From ab05ddd919aeb9a689bec59b086d7d89395bdde6 Mon Sep 17 00:00:00 2001 From: Rastislav Date: Mon, 7 Sep 2026 09:17:09 +0200 Subject: [PATCH 1/4] refresh --- .gitattributes | 7 + .github/ISSUE_TEMPLATE/bug.yml | 63 +- .github/ISSUE_TEMPLATE/feature.yml | 40 +- .github/workflows/nodejs.yml | 46 +- .github/workflows/publish-npm.yml | 51 +- .gitignore | 1 - .prettierrc.json | 1 + CHANGELOG.md | 12 + CONTRIBUTING.md | 34 + README.md | 117 +- dist/corebc.js | 32695 +++++++- dist/corebc.js.map | 2 +- dist/corebc.min.js | 2 +- dist/corebc.umd.js | 66321 +++++++++++----- dist/corebc.umd.js.map | 2 +- dist/corebc.umd.min.js | 2 +- dist/wordlists-extra.js | 3918 +- dist/wordlists-extra.js.map | 2 +- dist/wordlists-extra.min.js | 2 +- lib.commonjs/_tests/blockchain-data.d.ts.map | 2 +- lib.commonjs/_tests/blockchain-data.js | 25 +- lib.commonjs/_tests/blockchain-data.js.map | 2 +- lib.commonjs/_tests/create-provider.d.ts.map | 2 +- lib.commonjs/_tests/create-provider.js | 77 +- lib.commonjs/_tests/create-provider.js.map | 2 +- lib.commonjs/_tests/test-cip.d.ts | 2 + lib.commonjs/_tests/test-cip.d.ts.map | 1 + lib.commonjs/_tests/test-cip.js | 194 + lib.commonjs/_tests/test-cip.js.map | 1 + lib.commonjs/_tests/test-contract.js | 127 +- lib.commonjs/_tests/test-contract.js.map | 2 +- lib.commonjs/_tests/test-crypto.d.ts | 2 + lib.commonjs/_tests/test-crypto.d.ts.map | 1 + lib.commonjs/_tests/test-crypto.js | 79 + lib.commonjs/_tests/test-crypto.js.map | 1 + lib.commonjs/_tests/test-keystore.d.ts | 2 + lib.commonjs/_tests/test-keystore.d.ts.map | 1 + lib.commonjs/_tests/test-keystore.js | 82 + lib.commonjs/_tests/test-keystore.js.map | 1 + lib.commonjs/_tests/types.d.ts.map | 2 +- lib.commonjs/_tests/types.js | 6 +- lib.commonjs/_tests/types.js.map | 2 +- lib.commonjs/_version.d.ts | 4 +- lib.commonjs/_version.d.ts.map | 2 +- lib.commonjs/_version.js | 16 +- lib.commonjs/_version.js.map | 2 +- lib.commonjs/abi-types/Tes.d.ts.map | 2 +- lib.commonjs/abi-types/Tes.js | 6 +- lib.commonjs/abi-types/Tes.js.map | 2 +- lib.commonjs/abi-types/Tes_abi.d.ts.map | 2 +- lib.commonjs/abi-types/Tes_abi.js | 6 +- lib.commonjs/abi-types/Tes_abi.js.map | 2 +- lib.commonjs/abi-types/common.d.ts.map | 2 +- lib.commonjs/abi-types/common.js | 6 +- lib.commonjs/abi-types/common.js.map | 2 +- .../abi-types/factories/Tes__factory.d.ts.map | 2 +- .../abi-types/factories/Tes__factory.js | 53 +- .../abi-types/factories/Tes__factory.js.map | 2 +- .../factories/Tes_abi__factory.d.ts.map | 2 +- .../abi-types/factories/Tes_abi__factory.js | 53 +- .../factories/Tes_abi__factory.js.map | 2 +- lib.commonjs/abi-types/factories/index.js | 13 +- lib.commonjs/abi-types/factories/index.js.map | 2 +- lib.commonjs/abi-types/index.js | 18 +- lib.commonjs/abi-types/index.js.map | 2 +- lib.commonjs/abi/abi-coder.d.ts.map | 2 +- lib.commonjs/abi/abi-coder.js | 106 +- lib.commonjs/abi/abi-coder.js.map | 2 +- lib.commonjs/abi/bytes32.js | 36 +- lib.commonjs/abi/bytes32.js.map | 2 +- .../abi/coders/abstract-coder.d.ts.map | 2 +- lib.commonjs/abi/coders/abstract-coder.js | 80 +- lib.commonjs/abi/coders/abstract-coder.js.map | 2 +- lib.commonjs/abi/coders/address.d.ts.map | 2 +- lib.commonjs/abi/coders/address.js | 25 +- lib.commonjs/abi/coders/address.js.map | 2 +- lib.commonjs/abi/coders/anonymous.d.ts.map | 2 +- lib.commonjs/abi/coders/anonymous.js | 13 +- lib.commonjs/abi/coders/anonymous.js.map | 2 +- lib.commonjs/abi/coders/array.d.ts.map | 2 +- lib.commonjs/abi/coders/array.js | 61 +- lib.commonjs/abi/coders/array.js.map | 2 +- lib.commonjs/abi/coders/boolean.d.ts.map | 2 +- lib.commonjs/abi/coders/boolean.js | 17 +- lib.commonjs/abi/coders/boolean.js.map | 2 +- lib.commonjs/abi/coders/bytes.d.ts.map | 2 +- lib.commonjs/abi/coders/bytes.js | 29 +- lib.commonjs/abi/coders/bytes.js.map | 2 +- lib.commonjs/abi/coders/fixed-bytes.d.ts.map | 2 +- lib.commonjs/abi/coders/fixed-bytes.js | 35 +- lib.commonjs/abi/coders/fixed-bytes.js.map | 2 +- lib.commonjs/abi/coders/null.d.ts.map | 2 +- lib.commonjs/abi/coders/null.js | 13 +- lib.commonjs/abi/coders/null.js.map | 2 +- lib.commonjs/abi/coders/number.d.ts.map | 2 +- lib.commonjs/abi/coders/number.js | 41 +- lib.commonjs/abi/coders/number.js.map | 2 +- lib.commonjs/abi/coders/string.d.ts.map | 2 +- lib.commonjs/abi/coders/string.js | 21 +- lib.commonjs/abi/coders/string.js.map | 2 +- lib.commonjs/abi/coders/tuple.d.ts.map | 2 +- lib.commonjs/abi/coders/tuple.js | 27 +- lib.commonjs/abi/coders/tuple.js.map | 2 +- lib.commonjs/abi/fragments.d.ts.map | 2 +- lib.commonjs/abi/fragments.js | 112 +- lib.commonjs/abi/fragments.js.map | 2 +- lib.commonjs/abi/index.d.ts.map | 2 +- lib.commonjs/abi/index.js | 68 +- lib.commonjs/abi/index.js.map | 2 +- lib.commonjs/abi/interface.d.ts.map | 2 +- lib.commonjs/abi/interface.js | 334 +- lib.commonjs/abi/interface.js.map | 2 +- lib.commonjs/abi/typed.d.ts.map | 2 +- lib.commonjs/abi/typed.js | 25 +- lib.commonjs/abi/typed.js.map | 2 +- lib.commonjs/address/checks.js | 36 +- lib.commonjs/address/checks.js.map | 2 +- .../address/contract-address.d.ts.map | 2 +- lib.commonjs/address/contract-address.js | 48 +- lib.commonjs/address/contract-address.js.map | 2 +- lib.commonjs/address/index.d.ts.map | 2 +- lib.commonjs/address/index.js | 40 +- lib.commonjs/address/index.js.map | 2 +- lib.commonjs/bigNumber/bigNumber.d.ts.map | 2 +- lib.commonjs/bigNumber/bigNumber.js | 55 +- lib.commonjs/bigNumber/bigNumber.js.map | 2 +- lib.commonjs/cip/custom-units.d.ts | 33 + lib.commonjs/cip/custom-units.d.ts.map | 1 + lib.commonjs/cip/custom-units.js | 117 + lib.commonjs/cip/custom-units.js.map | 1 + lib.commonjs/cip/index.d.ts | 49 + lib.commonjs/cip/index.d.ts.map | 1 + lib.commonjs/cip/index.js | 167 + lib.commonjs/cip/index.js.map | 1 + lib.commonjs/constants/addresses.js | 11 +- lib.commonjs/constants/addresses.js.map | 2 +- lib.commonjs/constants/hashes.d.ts.map | 2 +- lib.commonjs/constants/hashes.js | 11 +- lib.commonjs/constants/hashes.js.map | 2 +- lib.commonjs/constants/index.d.ts.map | 2 +- lib.commonjs/constants/index.js | 49 +- lib.commonjs/constants/index.js.map | 2 +- lib.commonjs/constants/numbers.d.ts.map | 2 +- lib.commonjs/constants/numbers.js | 35 +- lib.commonjs/constants/numbers.js.map | 2 +- lib.commonjs/constants/strings.js | 14 +- lib.commonjs/constants/strings.js.map | 2 +- lib.commonjs/contract/contract.d.ts | 2 +- lib.commonjs/contract/contract.d.ts.map | 2 +- lib.commonjs/contract/contract.js | 138 +- lib.commonjs/contract/contract.js.map | 2 +- lib.commonjs/contract/factory.d.ts.map | 2 +- lib.commonjs/contract/factory.js | 54 +- lib.commonjs/contract/factory.js.map | 2 +- lib.commonjs/contract/index.d.ts.map | 2 +- lib.commonjs/contract/index.js | 37 +- lib.commonjs/contract/index.js.map | 2 +- lib.commonjs/contract/types.d.ts.map | 2 +- lib.commonjs/contract/types.js | 6 +- lib.commonjs/contract/types.js.map | 2 +- lib.commonjs/contract/wrappers.d.ts.map | 2 +- lib.commonjs/contract/wrappers.js | 44 +- lib.commonjs/contract/wrappers.js.map | 2 +- lib.commonjs/corebc.d.ts | 2 + lib.commonjs/corebc.d.ts.map | 2 +- lib.commonjs/corebc.js | 486 +- lib.commonjs/corebc.js.map | 2 +- lib.commonjs/crypto/browser-ed448.d.ts | 3 +- lib.commonjs/crypto/browser-ed448.d.ts.map | 2 +- lib.commonjs/crypto/browser-ed448.js | 17 +- lib.commonjs/crypto/browser-ed448.js.map | 2 +- lib.commonjs/crypto/browser-sha3.d.ts.map | 2 +- lib.commonjs/crypto/browser-sha3.js | 71 +- lib.commonjs/crypto/browser-sha3.js.map | 2 +- lib.commonjs/crypto/crypto-browser.d.ts.map | 2 +- lib.commonjs/crypto/crypto-browser.js | 73 +- lib.commonjs/crypto/crypto-browser.js.map | 2 +- lib.commonjs/crypto/crypto.d.ts | 1 + lib.commonjs/crypto/crypto.d.ts.map | 2 +- lib.commonjs/crypto/crypto.js | 41 +- lib.commonjs/crypto/crypto.js.map | 2 +- lib.commonjs/crypto/ed448-types.d.ts | 15 + lib.commonjs/crypto/ed448-types.d.ts.map | 1 + lib.commonjs/crypto/ed448-types.js | 3 + lib.commonjs/crypto/ed448-types.js.map | 1 + lib.commonjs/crypto/ed448.d.ts | 3 +- lib.commonjs/crypto/ed448.d.ts.map | 2 +- lib.commonjs/crypto/ed448.js | 17 +- lib.commonjs/crypto/ed448.js.map | 2 +- .../crypto/ed448goldilock-browser.d.ts | 5 +- .../crypto/ed448goldilock-browser.d.ts.map | 2 +- lib.commonjs/crypto/ed448goldilock-browser.js | 58 +- .../crypto/ed448goldilock-browser.js.map | 2 +- lib.commonjs/crypto/ed448goldilock.d.ts | 5 +- lib.commonjs/crypto/ed448goldilock.d.ts.map | 2 +- lib.commonjs/crypto/ed448goldilock.js | 58 +- lib.commonjs/crypto/ed448goldilock.js.map | 2 +- lib.commonjs/crypto/hmac.d.ts | 8 +- lib.commonjs/crypto/hmac.d.ts.map | 2 +- lib.commonjs/crypto/hmac.js | 35 +- lib.commonjs/crypto/hmac.js.map | 2 +- lib.commonjs/crypto/index.d.ts.map | 2 +- lib.commonjs/crypto/index.js | 75 +- lib.commonjs/crypto/index.js.map | 2 +- lib.commonjs/crypto/keccak.d.ts | 8 +- lib.commonjs/crypto/keccak.d.ts.map | 2 +- lib.commonjs/crypto/keccak.js | 29 +- lib.commonjs/crypto/keccak.js.map | 2 +- lib.commonjs/crypto/pbkdf2-browser.d.ts.map | 2 +- lib.commonjs/crypto/pbkdf2-browser.js | 15 +- lib.commonjs/crypto/pbkdf2-browser.js.map | 2 +- lib.commonjs/crypto/pbkdf2.d.ts | 8 +- lib.commonjs/crypto/pbkdf2.d.ts.map | 2 +- lib.commonjs/crypto/pbkdf2.js | 35 +- lib.commonjs/crypto/pbkdf2.js.map | 2 +- lib.commonjs/crypto/random.d.ts | 8 +- lib.commonjs/crypto/random.d.ts.map | 2 +- lib.commonjs/crypto/random.js | 19 +- lib.commonjs/crypto/random.js.map | 2 +- lib.commonjs/crypto/ripemd160.d.ts | 8 +- lib.commonjs/crypto/ripemd160.d.ts.map | 2 +- lib.commonjs/crypto/ripemd160.js | 29 +- lib.commonjs/crypto/ripemd160.js.map | 2 +- lib.commonjs/crypto/rlp.js | 105 +- lib.commonjs/crypto/rlp.js.map | 2 +- lib.commonjs/crypto/scrypt.d.ts | 15 +- lib.commonjs/crypto/scrypt.d.ts.map | 2 +- lib.commonjs/crypto/scrypt.js | 41 +- lib.commonjs/crypto/scrypt.js.map | 2 +- lib.commonjs/crypto/sha3.d.ts | 19 +- lib.commonjs/crypto/sha3.d.ts.map | 2 +- lib.commonjs/crypto/sha3.js | 119 +- lib.commonjs/crypto/sha3.js.map | 2 +- lib.commonjs/crypto/signature.d.ts.map | 2 +- lib.commonjs/crypto/signature.js | 53 +- lib.commonjs/crypto/signature.js.map | 2 +- lib.commonjs/crypto/signing-key.d.ts | 75 +- lib.commonjs/crypto/signing-key.d.ts.map | 2 +- lib.commonjs/crypto/signing-key.js | 187 +- lib.commonjs/crypto/signing-key.js.map | 2 +- lib.commonjs/hash/id.js | 27 +- lib.commonjs/hash/id.js.map | 2 +- lib.commonjs/hash/index.js | 37 +- lib.commonjs/hash/index.js.map | 2 +- lib.commonjs/hash/message.d.ts.map | 2 +- lib.commonjs/hash/message.js | 53 +- lib.commonjs/hash/message.js.map | 2 +- lib.commonjs/hash/solidity.d.ts.map | 2 +- lib.commonjs/hash/solidity.js | 74 +- lib.commonjs/hash/solidity.js.map | 2 +- lib.commonjs/hash/typed-data.d.ts.map | 2 +- lib.commonjs/hash/typed-data.js | 151 +- lib.commonjs/hash/typed-data.js.map | 2 +- lib.commonjs/index.js | 305 +- lib.commonjs/index.js.map | 2 +- lib.commonjs/ipfs/index.d.ts | 18 + lib.commonjs/ipfs/index.d.ts.map | 1 + lib.commonjs/ipfs/index.js | 78 + lib.commonjs/ipfs/index.js.map | 1 + lib.commonjs/logger/logger.d.ts.map | 2 +- lib.commonjs/logger/logger.js | 23 +- lib.commonjs/logger/logger.js.map | 2 +- lib.commonjs/package.json | 13 +- .../providers/abstract-provider.d.ts.map | 2 +- lib.commonjs/providers/abstract-provider.js | 262 +- .../providers/abstract-provider.js.map | 2 +- .../providers/abstract-signer.d.ts.map | 2 +- lib.commonjs/providers/abstract-signer.js | 72 +- lib.commonjs/providers/abstract-signer.js.map | 2 +- lib.commonjs/providers/community.d.ts.map | 2 +- lib.commonjs/providers/community.js | 8 +- lib.commonjs/providers/community.js.map | 2 +- lib.commonjs/providers/contracts.d.ts.map | 2 +- lib.commonjs/providers/contracts.js | 6 +- lib.commonjs/providers/contracts.js.map | 2 +- .../providers/default-provider.d.ts.map | 2 +- lib.commonjs/providers/default-provider.js | 81 +- .../providers/default-provider.js.map | 2 +- lib.commonjs/providers/format.d.ts.map | 2 +- lib.commonjs/providers/format.js | 219 +- lib.commonjs/providers/format.js.map | 2 +- lib.commonjs/providers/formatting.d.ts.map | 2 +- lib.commonjs/providers/formatting.js | 11 +- lib.commonjs/providers/formatting.js.map | 2 +- lib.commonjs/providers/index.d.ts.map | 2 +- lib.commonjs/providers/index.js | 128 +- lib.commonjs/providers/index.js.map | 2 +- lib.commonjs/providers/network.d.ts.map | 2 +- lib.commonjs/providers/network.js | 56 +- lib.commonjs/providers/network.js.map | 2 +- lib.commonjs/providers/pagination.d.ts.map | 2 +- lib.commonjs/providers/pagination.js | 6 +- lib.commonjs/providers/pagination.js.map | 2 +- .../providers/plugin-fallback.d.ts.map | 2 +- lib.commonjs/providers/plugin-fallback.js | 28 +- lib.commonjs/providers/plugin-fallback.js.map | 2 +- .../providers/plugins-network.d.ts.map | 2 +- lib.commonjs/providers/plugins-network.js | 32 +- lib.commonjs/providers/plugins-network.js.map | 2 +- .../providers/provider-alchemy.d.ts.map | 2 +- lib.commonjs/providers/provider-alchemy.js | 45 +- .../providers/provider-alchemy.js.map | 2 +- lib.commonjs/providers/provider-ankr.d.ts.map | 2 +- lib.commonjs/providers/provider-ankr.js | 41 +- lib.commonjs/providers/provider-ankr.js.map | 2 +- .../providers/provider-browser.d.ts.map | 2 +- lib.commonjs/providers/provider-browser.js | 24 +- .../providers/provider-browser.js.map | 2 +- .../providers/provider-cloudflare.d.ts.map | 2 +- lib.commonjs/providers/provider-cloudflare.js | 30 +- .../providers/provider-cloudflare.js.map | 2 +- .../providers/provider-fallback.d.ts.map | 2 +- lib.commonjs/providers/provider-fallback.js | 46 +- .../providers/provider-fallback.js.map | 2 +- .../providers/provider-infura.d.ts.map | 2 +- lib.commonjs/providers/provider-infura.js | 49 +- lib.commonjs/providers/provider-infura.js.map | 2 +- .../providers/provider-ipcsocket-browser.js | 8 +- .../provider-ipcsocket-browser.js.map | 2 +- .../providers/provider-ipcsocket.d.ts | 2 +- .../providers/provider-ipcsocket.d.ts.map | 2 +- lib.commonjs/providers/provider-ipcsocket.js | 23 +- .../providers/provider-ipcsocket.js.map | 2 +- .../providers/provider-jsonrpc.d.ts.map | 2 +- lib.commonjs/providers/provider-jsonrpc.js | 169 +- .../providers/provider-jsonrpc.js.map | 2 +- .../providers/provider-pocket.d.ts.map | 2 +- lib.commonjs/providers/provider-pocket.js | 41 +- lib.commonjs/providers/provider-pocket.js.map | 2 +- .../providers/provider-quicknode.d.ts.map | 2 +- lib.commonjs/providers/provider-quicknode.js | 39 +- .../providers/provider-quicknode.js.map | 2 +- .../providers/provider-socket.d.ts.map | 2 +- lib.commonjs/providers/provider-socket.js | 80 +- lib.commonjs/providers/provider-socket.js.map | 2 +- .../providers/provider-websocket.d.ts.map | 2 +- lib.commonjs/providers/provider-websocket.js | 43 +- .../providers/provider-websocket.js.map | 2 +- lib.commonjs/providers/provider.d.ts.map | 2 +- lib.commonjs/providers/provider.js | 73 +- lib.commonjs/providers/provider.js.map | 2 +- .../providers/signer-noncemanager.d.ts.map | 2 +- lib.commonjs/providers/signer-noncemanager.js | 25 +- .../providers/signer-noncemanager.js.map | 2 +- lib.commonjs/providers/signer.d.ts.map | 2 +- lib.commonjs/providers/signer.js | 6 +- lib.commonjs/providers/signer.js.map | 2 +- .../providers/subscriber-connection.d.ts.map | 2 +- .../providers/subscriber-connection.js | 20 +- .../providers/subscriber-connection.js.map | 2 +- .../providers/subscriber-filterid.d.ts.map | 2 +- lib.commonjs/providers/subscriber-filterid.js | 28 +- .../providers/subscriber-filterid.js.map | 2 +- .../providers/subscriber-polling.d.ts.map | 2 +- lib.commonjs/providers/subscriber-polling.js | 34 +- .../providers/subscriber-polling.js.map | 2 +- lib.commonjs/providers/ws-browser.js | 8 +- lib.commonjs/providers/ws-browser.js.map | 2 +- lib.commonjs/providers/ws.js | 17 +- lib.commonjs/providers/ws.js.map | 2 +- lib.commonjs/transaction/accesslist.js | 31 +- lib.commonjs/transaction/accesslist.js.map | 2 +- lib.commonjs/transaction/address.d.ts.map | 2 +- lib.commonjs/transaction/address.js | 47 +- lib.commonjs/transaction/address.js.map | 2 +- lib.commonjs/transaction/index.d.ts.map | 2 +- lib.commonjs/transaction/index.js | 30 +- lib.commonjs/transaction/index.js.map | 2 +- lib.commonjs/transaction/transaction.d.ts.map | 2 +- lib.commonjs/transaction/transaction.js | 116 +- lib.commonjs/transaction/transaction.js.map | 2 +- lib.commonjs/utils/base58.js | 21 +- lib.commonjs/utils/base58.js.map | 2 +- lib.commonjs/utils/base64-browser.js | 25 +- lib.commonjs/utils/base64-browser.js.map | 2 +- lib.commonjs/utils/base64.js | 19 +- lib.commonjs/utils/base64.js.map | 2 +- lib.commonjs/utils/data.d.ts.map | 2 +- lib.commonjs/utils/data.js | 70 +- lib.commonjs/utils/data.js.map | 2 +- lib.commonjs/utils/errors.d.ts.map | 2 +- lib.commonjs/utils/errors.js | 31 +- lib.commonjs/utils/errors.js.map | 2 +- lib.commonjs/utils/events.d.ts.map | 2 +- lib.commonjs/utils/events.js | 13 +- lib.commonjs/utils/events.js.map | 2 +- lib.commonjs/utils/fetch.d.ts.map | 2 +- lib.commonjs/utils/fetch.js | 71 +- lib.commonjs/utils/fetch.js.map | 2 +- lib.commonjs/utils/fixednumber.d.ts.map | 2 +- lib.commonjs/utils/fixednumber.js | 110 +- lib.commonjs/utils/fixednumber.js.map | 2 +- lib.commonjs/utils/geturl-browser.d.ts | 18 - lib.commonjs/utils/geturl-browser.d.ts.map | 2 +- lib.commonjs/utils/geturl-browser.js | 15 +- lib.commonjs/utils/geturl-browser.js.map | 2 +- lib.commonjs/utils/geturl.d.ts.map | 2 +- lib.commonjs/utils/geturl.js | 28 +- lib.commonjs/utils/geturl.js.map | 2 +- lib.commonjs/utils/index.d.ts.map | 2 +- lib.commonjs/utils/index.js | 154 +- lib.commonjs/utils/index.js.map | 2 +- lib.commonjs/utils/maths.js | 63 +- lib.commonjs/utils/maths.js.map | 2 +- lib.commonjs/utils/properties.d.ts.map | 2 +- lib.commonjs/utils/properties.js | 17 +- lib.commonjs/utils/properties.js.map | 2 +- lib.commonjs/utils/rlp-decode.js | 64 +- lib.commonjs/utils/rlp-decode.js.map | 2 +- lib.commonjs/utils/rlp-encode.js | 27 +- lib.commonjs/utils/rlp-encode.js.map | 2 +- lib.commonjs/utils/rlp.js | 24 +- lib.commonjs/utils/rlp.js.map | 2 +- lib.commonjs/utils/units.d.ts.map | 2 +- lib.commonjs/utils/units.js | 45 +- lib.commonjs/utils/units.js.map | 2 +- lib.commonjs/utils/utf8.d.ts.map | 2 +- lib.commonjs/utils/utf8.js | 34 +- lib.commonjs/utils/utf8.js.map | 2 +- lib.commonjs/utils/uuid.js | 15 +- lib.commonjs/utils/uuid.js.map | 2 +- lib.commonjs/wallet/base-wallet.d.ts.map | 2 +- lib.commonjs/wallet/base-wallet.js | 80 +- lib.commonjs/wallet/base-wallet.js.map | 2 +- lib.commonjs/wallet/english_words.d.ts.map | 2 +- lib.commonjs/wallet/english_words.js | 11 +- lib.commonjs/wallet/english_words.js.map | 2 +- lib.commonjs/wallet/hdwallet.d.ts.map | 2 +- lib.commonjs/wallet/hdwallet.js | 120 +- lib.commonjs/wallet/hdwallet.js.map | 2 +- lib.commonjs/wallet/index.d.ts.map | 2 +- lib.commonjs/wallet/index.js | 68 +- lib.commonjs/wallet/index.js.map | 2 +- lib.commonjs/wallet/json-crowdsale.d.ts.map | 2 +- lib.commonjs/wallet/json-crowdsale.js | 65 +- lib.commonjs/wallet/json-crowdsale.js.map | 2 +- lib.commonjs/wallet/json-keystore.d.ts.map | 2 +- lib.commonjs/wallet/json-keystore.js | 270 +- lib.commonjs/wallet/json-keystore.js.map | 2 +- lib.commonjs/wallet/mnemonic.d.ts.map | 2 +- lib.commonjs/wallet/mnemonic.js | 61 +- lib.commonjs/wallet/mnemonic.js.map | 2 +- lib.commonjs/wallet/mnemonicToSeed.d.ts.map | 2 +- lib.commonjs/wallet/mnemonicToSeed.js | 32 +- lib.commonjs/wallet/mnemonicToSeed.js.map | 2 +- lib.commonjs/wallet/utils.js | 40 +- lib.commonjs/wallet/utils.js.map | 2 +- lib.commonjs/wallet/wallet.d.ts.map | 2 +- lib.commonjs/wallet/wallet.js | 93 +- lib.commonjs/wallet/wallet.js.map | 2 +- lib.commonjs/wordlists/bit-reader.js | 8 +- lib.commonjs/wordlists/bit-reader.js.map | 2 +- lib.commonjs/wordlists/decode-owl.js | 22 +- lib.commonjs/wordlists/decode-owl.js.map | 2 +- lib.commonjs/wordlists/decode-owla.js | 28 +- lib.commonjs/wordlists/decode-owla.js.map | 2 +- lib.commonjs/wordlists/enwords.d.ts.map | 2 +- lib.commonjs/wordlists/enwords.js | 11 +- lib.commonjs/wordlists/enwords.js.map | 2 +- .../generation/encode-latin.d.ts.map | 2 +- .../wordlists/generation/encode-latin.js | 34 +- .../wordlists/generation/encode-latin.js.map | 2 +- lib.commonjs/wordlists/index.js | 49 +- lib.commonjs/wordlists/index.js.map | 2 +- lib.commonjs/wordlists/lang-cz.d.ts.map | 2 +- lib.commonjs/wordlists/lang-cz.js | 13 +- lib.commonjs/wordlists/lang-cz.js.map | 2 +- lib.commonjs/wordlists/lang-en.d.ts.map | 2 +- lib.commonjs/wordlists/lang-en.js | 13 +- lib.commonjs/wordlists/lang-en.js.map | 2 +- lib.commonjs/wordlists/lang-es.d.ts.map | 2 +- lib.commonjs/wordlists/lang-es.js | 13 +- lib.commonjs/wordlists/lang-es.js.map | 2 +- lib.commonjs/wordlists/lang-fr.d.ts.map | 2 +- lib.commonjs/wordlists/lang-fr.js | 13 +- lib.commonjs/wordlists/lang-fr.js.map | 2 +- lib.commonjs/wordlists/lang-it.d.ts.map | 2 +- lib.commonjs/wordlists/lang-it.js | 13 +- lib.commonjs/wordlists/lang-it.js.map | 2 +- lib.commonjs/wordlists/lang-ja.d.ts.map | 2 +- lib.commonjs/wordlists/lang-ja.js | 51 +- lib.commonjs/wordlists/lang-ja.js.map | 2 +- lib.commonjs/wordlists/lang-ko.d.ts.map | 2 +- lib.commonjs/wordlists/lang-ko.js | 48 +- lib.commonjs/wordlists/lang-ko.js.map | 2 +- lib.commonjs/wordlists/lang-pt.d.ts.map | 2 +- lib.commonjs/wordlists/lang-pt.js | 13 +- lib.commonjs/wordlists/lang-pt.js.map | 2 +- lib.commonjs/wordlists/lang-zh.d.ts.map | 2 +- lib.commonjs/wordlists/lang-zh.js | 48 +- lib.commonjs/wordlists/lang-zh.js.map | 2 +- lib.commonjs/wordlists/wordlist-owl.d.ts.map | 2 +- lib.commonjs/wordlists/wordlist-owl.js | 49 +- lib.commonjs/wordlists/wordlist-owl.js.map | 2 +- lib.commonjs/wordlists/wordlist-owla.d.ts.map | 2 +- lib.commonjs/wordlists/wordlist-owla.js | 17 +- lib.commonjs/wordlists/wordlist-owla.js.map | 2 +- lib.commonjs/wordlists/wordlist.d.ts.map | 2 +- lib.commonjs/wordlists/wordlist.js | 25 +- lib.commonjs/wordlists/wordlist.js.map | 2 +- lib.commonjs/wordlists/wordlists-browser.js | 16 +- .../wordlists/wordlists-browser.js.map | 2 +- lib.commonjs/wordlists/wordlists-extra.js | 42 +- lib.commonjs/wordlists/wordlists-extra.js.map | 2 +- lib.commonjs/wordlists/wordlists.js | 50 +- lib.commonjs/wordlists/wordlists.js.map | 2 +- lib.esm/_tests/blockchain-data.d.ts.map | 2 +- lib.esm/_tests/blockchain-data.js.map | 2 +- lib.esm/_tests/create-provider.d.ts.map | 2 +- lib.esm/_tests/create-provider.js.map | 2 +- lib.esm/_tests/test-cip.d.ts | 2 + lib.esm/_tests/test-cip.d.ts.map | 1 + lib.esm/_tests/test-cip.js | 150 + lib.esm/_tests/test-cip.js.map | 1 + lib.esm/_tests/test-contract.js | 13 +- lib.esm/_tests/test-contract.js.map | 2 +- lib.esm/_tests/test-crypto.d.ts | 2 + lib.esm/_tests/test-crypto.d.ts.map | 1 + lib.esm/_tests/test-crypto.js | 37 + lib.esm/_tests/test-crypto.js.map | 1 + lib.esm/_tests/test-keystore.d.ts | 2 + lib.esm/_tests/test-keystore.d.ts.map | 1 + lib.esm/_tests/test-keystore.js | 41 + lib.esm/_tests/test-keystore.js.map | 1 + lib.esm/_tests/types.d.ts.map | 2 +- lib.esm/_version.d.ts | 4 +- lib.esm/_version.d.ts.map | 2 +- lib.esm/_version.js | 7 +- lib.esm/_version.js.map | 2 +- lib.esm/abi-types/Tes.d.ts.map | 2 +- lib.esm/abi-types/Tes_abi.d.ts.map | 2 +- lib.esm/abi-types/common.d.ts.map | 2 +- .../abi-types/factories/Tes__factory.d.ts.map | 2 +- .../abi-types/factories/Tes__factory.js.map | 2 +- .../factories/Tes_abi__factory.d.ts.map | 2 +- .../factories/Tes_abi__factory.js.map | 2 +- lib.esm/abi/abi-coder.d.ts.map | 2 +- lib.esm/abi/abi-coder.js.map | 2 +- lib.esm/abi/bytes32.js.map | 2 +- lib.esm/abi/coders/abstract-coder.d.ts.map | 2 +- lib.esm/abi/coders/abstract-coder.js.map | 2 +- lib.esm/abi/coders/address.d.ts.map | 2 +- lib.esm/abi/coders/address.js.map | 2 +- lib.esm/abi/coders/anonymous.d.ts.map | 2 +- lib.esm/abi/coders/anonymous.js.map | 2 +- lib.esm/abi/coders/array.d.ts.map | 2 +- lib.esm/abi/coders/array.js.map | 2 +- lib.esm/abi/coders/boolean.d.ts.map | 2 +- lib.esm/abi/coders/boolean.js.map | 2 +- lib.esm/abi/coders/bytes.d.ts.map | 2 +- lib.esm/abi/coders/bytes.js.map | 2 +- lib.esm/abi/coders/fixed-bytes.d.ts.map | 2 +- lib.esm/abi/coders/fixed-bytes.js.map | 2 +- lib.esm/abi/coders/null.d.ts.map | 2 +- lib.esm/abi/coders/null.js.map | 2 +- lib.esm/abi/coders/number.d.ts.map | 2 +- lib.esm/abi/coders/number.js.map | 2 +- lib.esm/abi/coders/string.d.ts.map | 2 +- lib.esm/abi/coders/string.js.map | 2 +- lib.esm/abi/coders/tuple.d.ts.map | 2 +- lib.esm/abi/coders/tuple.js.map | 2 +- lib.esm/abi/fragments.d.ts.map | 2 +- lib.esm/abi/fragments.js.map | 2 +- lib.esm/abi/index.d.ts.map | 2 +- lib.esm/abi/index.js.map | 2 +- lib.esm/abi/interface.d.ts.map | 2 +- lib.esm/abi/interface.js | 104 +- lib.esm/abi/interface.js.map | 2 +- lib.esm/abi/typed.d.ts.map | 2 +- lib.esm/abi/typed.js.map | 2 +- lib.esm/address/checks.js.map | 2 +- lib.esm/address/contract-address.d.ts.map | 2 +- lib.esm/address/contract-address.js.map | 2 +- lib.esm/address/index.d.ts.map | 2 +- lib.esm/address/index.js.map | 2 +- lib.esm/bigNumber/bigNumber.d.ts.map | 2 +- lib.esm/bigNumber/bigNumber.js.map | 2 +- lib.esm/cip/custom-units.d.ts | 33 + lib.esm/cip/custom-units.d.ts.map | 1 + lib.esm/cip/custom-units.js | 81 + lib.esm/cip/custom-units.js.map | 1 + lib.esm/cip/index.d.ts | 49 + lib.esm/cip/index.d.ts.map | 1 + lib.esm/cip/index.js | 124 + lib.esm/cip/index.js.map | 1 + lib.esm/constants/hashes.d.ts.map | 2 +- lib.esm/constants/hashes.js.map | 2 +- lib.esm/constants/index.d.ts.map | 2 +- lib.esm/constants/index.js.map | 2 +- lib.esm/constants/numbers.d.ts.map | 2 +- lib.esm/constants/numbers.js.map | 2 +- lib.esm/contract/contract.d.ts | 2 +- lib.esm/contract/contract.d.ts.map | 2 +- lib.esm/contract/contract.js.map | 2 +- lib.esm/contract/factory.d.ts.map | 2 +- lib.esm/contract/factory.js.map | 2 +- lib.esm/contract/index.d.ts.map | 2 +- lib.esm/contract/index.js.map | 2 +- lib.esm/contract/types.d.ts.map | 2 +- lib.esm/contract/wrappers.d.ts.map | 2 +- lib.esm/contract/wrappers.js.map | 2 +- lib.esm/corebc.d.ts | 2 + lib.esm/corebc.d.ts.map | 2 +- lib.esm/corebc.js | 2 + lib.esm/corebc.js.map | 2 +- lib.esm/crypto/browser-ed448.d.ts | 3 +- lib.esm/crypto/browser-ed448.d.ts.map | 2 +- lib.esm/crypto/browser-ed448.js | 5 +- lib.esm/crypto/browser-ed448.js.map | 2 +- lib.esm/crypto/browser-sha3.d.ts.map | 2 +- lib.esm/crypto/browser-sha3.js | 3 +- lib.esm/crypto/browser-sha3.js.map | 2 +- lib.esm/crypto/crypto-browser.d.ts.map | 2 +- lib.esm/crypto/crypto-browser.js | 17 +- lib.esm/crypto/crypto-browser.js.map | 2 +- lib.esm/crypto/crypto.d.ts | 1 + lib.esm/crypto/crypto.d.ts.map | 2 +- lib.esm/crypto/crypto.js | 1 + lib.esm/crypto/crypto.js.map | 2 +- lib.esm/crypto/ed448-types.d.ts | 15 + lib.esm/crypto/ed448-types.d.ts.map | 1 + lib.esm/crypto/ed448-types.js | 2 + lib.esm/crypto/ed448-types.js.map | 1 + lib.esm/crypto/ed448.d.ts | 3 +- lib.esm/crypto/ed448.d.ts.map | 2 +- lib.esm/crypto/ed448.js | 5 +- lib.esm/crypto/ed448.js.map | 2 +- lib.esm/crypto/ed448goldilock-browser.d.ts | 5 +- .../crypto/ed448goldilock-browser.d.ts.map | 2 +- lib.esm/crypto/ed448goldilock-browser.js | 3 +- lib.esm/crypto/ed448goldilock-browser.js.map | 2 +- lib.esm/crypto/ed448goldilock.d.ts | 5 +- lib.esm/crypto/ed448goldilock.d.ts.map | 2 +- lib.esm/crypto/ed448goldilock.js | 5 +- lib.esm/crypto/ed448goldilock.js.map | 2 +- lib.esm/crypto/hmac.d.ts | 8 +- lib.esm/crypto/hmac.d.ts.map | 2 +- lib.esm/crypto/hmac.js.map | 2 +- lib.esm/crypto/index.d.ts.map | 2 +- lib.esm/crypto/index.js.map | 2 +- lib.esm/crypto/keccak.d.ts | 8 +- lib.esm/crypto/keccak.d.ts.map | 2 +- lib.esm/crypto/keccak.js | 2 +- lib.esm/crypto/keccak.js.map | 2 +- lib.esm/crypto/pbkdf2-browser.d.ts.map | 2 +- lib.esm/crypto/pbkdf2.d.ts | 8 +- lib.esm/crypto/pbkdf2.d.ts.map | 2 +- lib.esm/crypto/pbkdf2.js.map | 2 +- lib.esm/crypto/random.d.ts | 8 +- lib.esm/crypto/random.d.ts.map | 2 +- lib.esm/crypto/random.js.map | 2 +- lib.esm/crypto/ripemd160.d.ts | 8 +- lib.esm/crypto/ripemd160.d.ts.map | 2 +- lib.esm/crypto/ripemd160.js | 2 +- lib.esm/crypto/ripemd160.js.map | 2 +- lib.esm/crypto/rlp.js.map | 2 +- lib.esm/crypto/scrypt.d.ts | 15 +- lib.esm/crypto/scrypt.d.ts.map | 2 +- lib.esm/crypto/scrypt.js | 2 +- lib.esm/crypto/scrypt.js.map | 2 +- lib.esm/crypto/sha3.d.ts | 19 +- lib.esm/crypto/sha3.d.ts.map | 2 +- lib.esm/crypto/sha3.js | 59 +- lib.esm/crypto/sha3.js.map | 2 +- lib.esm/crypto/signature.d.ts.map | 2 +- lib.esm/crypto/signature.js.map | 2 +- lib.esm/crypto/signing-key.d.ts | 75 +- lib.esm/crypto/signing-key.d.ts.map | 2 +- lib.esm/crypto/signing-key.js | 112 +- lib.esm/crypto/signing-key.js.map | 2 +- lib.esm/hash/id.js.map | 2 +- lib.esm/hash/message.d.ts.map | 2 +- lib.esm/hash/message.js.map | 2 +- lib.esm/hash/solidity.d.ts.map | 2 +- lib.esm/hash/solidity.js.map | 2 +- lib.esm/hash/typed-data.d.ts.map | 2 +- lib.esm/hash/typed-data.js.map | 2 +- lib.esm/ipfs/index.d.ts | 18 + lib.esm/ipfs/index.d.ts.map | 1 + lib.esm/ipfs/index.js | 73 + lib.esm/ipfs/index.js.map | 1 + lib.esm/logger/logger.d.ts.map | 2 +- lib.esm/logger/logger.js.map | 2 +- lib.esm/package.json | 21 +- lib.esm/providers/abstract-provider.d.ts.map | 2 +- lib.esm/providers/abstract-provider.js | 4 +- lib.esm/providers/abstract-provider.js.map | 2 +- lib.esm/providers/abstract-signer.d.ts.map | 2 +- lib.esm/providers/abstract-signer.js.map | 2 +- lib.esm/providers/community.d.ts.map | 2 +- lib.esm/providers/community.js.map | 2 +- lib.esm/providers/contracts.d.ts.map | 2 +- lib.esm/providers/default-provider.d.ts.map | 2 +- lib.esm/providers/default-provider.js | 28 +- lib.esm/providers/default-provider.js.map | 2 +- lib.esm/providers/format.d.ts.map | 2 +- lib.esm/providers/format.js | 64 +- lib.esm/providers/format.js.map | 2 +- lib.esm/providers/formatting.d.ts.map | 2 +- lib.esm/providers/index.d.ts.map | 2 +- lib.esm/providers/index.js.map | 2 +- lib.esm/providers/network.d.ts.map | 2 +- lib.esm/providers/network.js.map | 2 +- lib.esm/providers/pagination.d.ts.map | 2 +- lib.esm/providers/plugin-fallback.d.ts.map | 2 +- lib.esm/providers/plugin-fallback.js.map | 2 +- lib.esm/providers/plugins-network.d.ts.map | 2 +- lib.esm/providers/plugins-network.js.map | 2 +- lib.esm/providers/provider-alchemy.d.ts.map | 2 +- lib.esm/providers/provider-alchemy.js.map | 2 +- lib.esm/providers/provider-ankr.d.ts.map | 2 +- lib.esm/providers/provider-ankr.js.map | 2 +- lib.esm/providers/provider-browser.d.ts.map | 2 +- lib.esm/providers/provider-browser.js.map | 2 +- .../providers/provider-cloudflare.d.ts.map | 2 +- lib.esm/providers/provider-cloudflare.js.map | 2 +- lib.esm/providers/provider-fallback.d.ts.map | 2 +- lib.esm/providers/provider-fallback.js.map | 2 +- lib.esm/providers/provider-infura.d.ts.map | 2 +- lib.esm/providers/provider-infura.js.map | 2 +- lib.esm/providers/provider-ipcsocket.d.ts | 2 +- lib.esm/providers/provider-ipcsocket.d.ts.map | 2 +- lib.esm/providers/provider-ipcsocket.js | 6 +- lib.esm/providers/provider-ipcsocket.js.map | 2 +- lib.esm/providers/provider-jsonrpc.d.ts.map | 2 +- lib.esm/providers/provider-jsonrpc.js | 16 +- lib.esm/providers/provider-jsonrpc.js.map | 2 +- lib.esm/providers/provider-pocket.d.ts.map | 2 +- lib.esm/providers/provider-pocket.js.map | 2 +- lib.esm/providers/provider-quicknode.d.ts.map | 2 +- lib.esm/providers/provider-quicknode.js.map | 2 +- lib.esm/providers/provider-socket.d.ts.map | 2 +- lib.esm/providers/provider-socket.js | 38 +- lib.esm/providers/provider-socket.js.map | 2 +- lib.esm/providers/provider-websocket.d.ts.map | 2 +- lib.esm/providers/provider-websocket.js | 26 +- lib.esm/providers/provider-websocket.js.map | 2 +- lib.esm/providers/provider.d.ts.map | 2 +- lib.esm/providers/provider.js.map | 2 +- .../providers/signer-noncemanager.d.ts.map | 2 +- lib.esm/providers/signer-noncemanager.js.map | 2 +- lib.esm/providers/signer.d.ts.map | 2 +- .../providers/subscriber-connection.d.ts.map | 2 +- .../providers/subscriber-connection.js.map | 2 +- .../providers/subscriber-filterid.d.ts.map | 2 +- lib.esm/providers/subscriber-filterid.js.map | 2 +- lib.esm/providers/subscriber-polling.d.ts.map | 2 +- lib.esm/providers/subscriber-polling.js.map | 2 +- lib.esm/providers/ws-browser.js.map | 2 +- lib.esm/transaction/accesslist.js.map | 2 +- lib.esm/transaction/address.d.ts.map | 2 +- lib.esm/transaction/address.js.map | 2 +- lib.esm/transaction/index.d.ts.map | 2 +- lib.esm/transaction/index.js.map | 2 +- lib.esm/transaction/transaction.d.ts.map | 2 +- lib.esm/transaction/transaction.js.map | 2 +- lib.esm/utils/base58.js.map | 2 +- lib.esm/utils/base64-browser.js.map | 2 +- lib.esm/utils/base64.js.map | 2 +- lib.esm/utils/data.d.ts.map | 2 +- lib.esm/utils/data.js | 17 +- lib.esm/utils/data.js.map | 2 +- lib.esm/utils/errors.d.ts.map | 2 +- lib.esm/utils/errors.js.map | 2 +- lib.esm/utils/events.d.ts.map | 2 +- lib.esm/utils/events.js.map | 2 +- lib.esm/utils/fetch.d.ts.map | 2 +- lib.esm/utils/fetch.js.map | 2 +- lib.esm/utils/fixednumber.d.ts.map | 2 +- lib.esm/utils/fixednumber.js | 40 +- lib.esm/utils/fixednumber.js.map | 2 +- lib.esm/utils/geturl-browser.d.ts | 18 - lib.esm/utils/geturl-browser.d.ts.map | 2 +- lib.esm/utils/geturl-browser.js.map | 2 +- lib.esm/utils/geturl.d.ts.map | 2 +- lib.esm/utils/geturl.js.map | 2 +- lib.esm/utils/index.d.ts.map | 2 +- lib.esm/utils/index.js.map | 2 +- lib.esm/utils/maths.js.map | 2 +- lib.esm/utils/properties.d.ts.map | 2 +- lib.esm/utils/properties.js.map | 2 +- lib.esm/utils/rlp-decode.js.map | 2 +- lib.esm/utils/rlp-encode.js.map | 2 +- lib.esm/utils/units.d.ts.map | 2 +- lib.esm/utils/units.js.map | 2 +- lib.esm/utils/utf8.d.ts.map | 2 +- lib.esm/utils/utf8.js.map | 2 +- lib.esm/utils/uuid.js.map | 2 +- lib.esm/wallet/base-wallet.d.ts.map | 2 +- lib.esm/wallet/base-wallet.js.map | 2 +- lib.esm/wallet/english_words.d.ts.map | 2 +- lib.esm/wallet/english_words.js.map | 2 +- lib.esm/wallet/hdwallet.d.ts.map | 2 +- lib.esm/wallet/hdwallet.js.map | 2 +- lib.esm/wallet/index.d.ts.map | 2 +- lib.esm/wallet/index.js.map | 2 +- lib.esm/wallet/json-crowdsale.d.ts.map | 2 +- lib.esm/wallet/json-crowdsale.js | 2 +- lib.esm/wallet/json-crowdsale.js.map | 2 +- lib.esm/wallet/json-keystore.d.ts.map | 2 +- lib.esm/wallet/json-keystore.js | 59 +- lib.esm/wallet/json-keystore.js.map | 2 +- lib.esm/wallet/mnemonic.d.ts.map | 2 +- lib.esm/wallet/mnemonic.js.map | 2 +- lib.esm/wallet/mnemonicToSeed.d.ts.map | 2 +- lib.esm/wallet/mnemonicToSeed.js | 9 +- lib.esm/wallet/mnemonicToSeed.js.map | 2 +- lib.esm/wallet/utils.js.map | 2 +- lib.esm/wallet/wallet.d.ts.map | 2 +- lib.esm/wallet/wallet.js.map | 2 +- lib.esm/wordlists/bit-reader.js.map | 2 +- lib.esm/wordlists/decode-owl.js.map | 2 +- lib.esm/wordlists/decode-owla.js.map | 2 +- lib.esm/wordlists/enwords.d.ts.map | 2 +- lib.esm/wordlists/enwords.js.map | 2 +- .../generation/encode-latin.d.ts.map | 2 +- .../wordlists/generation/encode-latin.js.map | 2 +- lib.esm/wordlists/lang-cz.d.ts.map | 2 +- lib.esm/wordlists/lang-cz.js.map | 2 +- lib.esm/wordlists/lang-en.d.ts.map | 2 +- lib.esm/wordlists/lang-en.js.map | 2 +- lib.esm/wordlists/lang-es.d.ts.map | 2 +- lib.esm/wordlists/lang-es.js.map | 2 +- lib.esm/wordlists/lang-fr.d.ts.map | 2 +- lib.esm/wordlists/lang-fr.js.map | 2 +- lib.esm/wordlists/lang-it.d.ts.map | 2 +- lib.esm/wordlists/lang-it.js.map | 2 +- lib.esm/wordlists/lang-ja.d.ts.map | 2 +- lib.esm/wordlists/lang-ja.js.map | 2 +- lib.esm/wordlists/lang-ko.d.ts.map | 2 +- lib.esm/wordlists/lang-ko.js.map | 2 +- lib.esm/wordlists/lang-pt.d.ts.map | 2 +- lib.esm/wordlists/lang-pt.js.map | 2 +- lib.esm/wordlists/lang-zh.d.ts.map | 2 +- lib.esm/wordlists/lang-zh.js.map | 2 +- lib.esm/wordlists/wordlist-owl.d.ts.map | 2 +- lib.esm/wordlists/wordlist-owl.js.map | 2 +- lib.esm/wordlists/wordlist-owla.d.ts.map | 2 +- lib.esm/wordlists/wordlist-owla.js.map | 2 +- lib.esm/wordlists/wordlist.d.ts.map | 2 +- lib.esm/wordlists/wordlist.js.map | 2 +- lib.esm/wordlists/wordlists-browser.js.map | 2 +- lib.esm/wordlists/wordlists.js.map | 2 +- package-lock.json | 1576 + package.json | 277 +- rollup.config.mjs | 98 +- scripts/build-commonjs.mjs | 28 + scripts/clean.mjs | 7 + scripts/prepare-build.mjs | 17 + scripts/test-browser.mjs | 37 + scripts/test-package.mjs | 74 + src.ts/_tests/blockchain-data.ts | 638 +- src.ts/_tests/create-provider.ts | 226 +- src.ts/_tests/test-cip.ts | 187 + src.ts/_tests/test-contract.ts | 237 +- src.ts/_tests/test-crypto.ts | 62 + src.ts/_tests/test-keystore.ts | 63 + src.ts/_tests/types.ts | 298 +- src.ts/_version.ts | 8 +- src.ts/abi-types/Tes.ts | 852 +- src.ts/abi-types/Tes_abi.ts | 852 +- src.ts/abi-types/common.ts | 163 +- src.ts/abi-types/factories/Tes__factory.ts | 722 +- .../abi-types/factories/Tes_abi__factory.ts | 722 +- src.ts/abi/abi-coder.ts | 398 +- src.ts/abi/bytes32.ts | 60 +- src.ts/abi/coders/abstract-coder.ts | 908 +- src.ts/abi/coders/address.ts | 36 +- src.ts/abi/coders/anonymous.ts | 28 +- src.ts/abi/coders/array.ts | 410 +- src.ts/abi/coders/boolean.ts | 26 +- src.ts/abi/coders/bytes.ts | 48 +- src.ts/abi/coders/fixed-bytes.ts | 52 +- src.ts/abi/coders/null.ts | 32 +- src.ts/abi/coders/number.ts | 84 +- src.ts/abi/coders/string.ts | 30 +- src.ts/abi/coders/tuple.ts | 122 +- src.ts/abi/fragments.ts | 3291 +- src.ts/abi/index.ts | 44 +- src.ts/abi/interface.ts | 2423 +- src.ts/abi/typed.ts | 916 +- src.ts/address/checks.ts | 76 +- src.ts/address/contract-address.ts | 76 +- src.ts/address/index.ts | 242 +- src.ts/bigNumber/bigNumber.ts | 712 +- src.ts/cip/custom-units.ts | 96 + src.ts/cip/index.ts | 172 + src.ts/constants/hashes.ts | 2 +- src.ts/constants/index.ts | 18 +- src.ts/constants/numbers.ts | 10 +- src.ts/contract/contract.ts | 2162 +- src.ts/contract/factory.ts | 240 +- src.ts/contract/index.ts | 38 +- src.ts/contract/types.ts | 117 +- src.ts/contract/wrappers.ts | 216 +- src.ts/corebc.ts | 563 +- src.ts/crypto/browser-ed448.ts | 7 +- src.ts/crypto/browser-sha3.ts | 61 +- src.ts/crypto/crypto-browser.ts | 128 +- src.ts/crypto/crypto.ts | 1 + src.ts/crypto/ed448-types.ts | 14 + src.ts/crypto/ed448.ts | 8 +- src.ts/crypto/ed448goldilock-browser.ts | 267 +- src.ts/crypto/ed448goldilock.ts | 269 +- src.ts/crypto/hmac.ts | 40 +- src.ts/crypto/index.ts | 38 +- src.ts/crypto/keccak.ts | 18 +- src.ts/crypto/pbkdf2.ts | 52 +- src.ts/crypto/random.ts | 14 +- src.ts/crypto/ripemd160.ts | 18 +- src.ts/crypto/rlp.ts | 288 +- src.ts/crypto/scrypt.ts | 156 +- src.ts/crypto/sha3.ts | 132 +- src.ts/crypto/signature.ts | 448 +- src.ts/crypto/signing-key.ts | 398 +- src.ts/hash/id.ts | 8 +- src.ts/hash/message.ts | 30 +- src.ts/hash/solidity.ts | 226 +- src.ts/hash/typed-data.ts | 1270 +- src.ts/ipfs/index.ts | 90 + src.ts/logger/logger.ts | 804 +- src.ts/providers/abstract-provider.ts | 3464 +- src.ts/providers/abstract-signer.ts | 373 +- src.ts/providers/community.ts | 62 +- src.ts/providers/contracts.ts | 24 +- src.ts/providers/default-provider.ts | 150 +- src.ts/providers/format.ts | 448 +- src.ts/providers/formatting.ts | 104 +- src.ts/providers/index.ts | 92 +- src.ts/providers/network.ts | 590 +- src.ts/providers/pagination.ts | 8 +- src.ts/providers/plugin-fallback.ts | 56 +- src.ts/providers/plugins-network.ts | 150 +- src.ts/providers/provider-alchemy.ts | 244 +- src.ts/providers/provider-ankr.ts | 190 +- src.ts/providers/provider-browser.ts | 264 +- src.ts/providers/provider-cloudflare.ts | 26 +- src.ts/providers/provider-fallback.ts | 1373 +- src.ts/providers/provider-infura.ts | 332 +- src.ts/providers/provider-ipcsocket.ts | 106 +- src.ts/providers/provider-jsonrpc.ts | 2148 +- src.ts/providers/provider-pocket.ts | 224 +- src.ts/providers/provider-quicknode.ts | 164 +- src.ts/providers/provider-socket.ts | 474 +- src.ts/providers/provider-websocket.ts | 110 +- src.ts/providers/provider.ts | 2791 +- src.ts/providers/signer-noncemanager.ts | 148 +- src.ts/providers/signer.ts | 268 +- src.ts/providers/subscriber-connection.ts | 94 +- src.ts/providers/subscriber-filterid.ts | 330 +- src.ts/providers/subscriber-polling.ts | 498 +- src.ts/providers/ws-browser.ts | 20 +- src.ts/thirdparty.d.ts | 18 +- src.ts/transaction/accesslist.ts | 116 +- src.ts/transaction/address.ts | 46 +- src.ts/transaction/index.ts | 4 +- src.ts/transaction/transaction.ts | 896 +- src.ts/utils/base58.ts | 44 +- src.ts/utils/base64-browser.ts | 24 +- src.ts/utils/base64.ts | 4 +- src.ts/utils/data.ts | 577 +- src.ts/utils/errors.ts | 997 +- src.ts/utils/events.ts | 138 +- src.ts/utils/fetch.ts | 1960 +- src.ts/utils/fixednumber.ts | 1286 +- src.ts/utils/geturl-browser.ts | 134 +- src.ts/utils/geturl.ts | 210 +- src.ts/utils/index.ts | 148 +- src.ts/utils/maths.ts | 376 +- src.ts/utils/properties.ts | 120 +- src.ts/utils/rlp-decode.ts | 218 +- src.ts/utils/rlp-encode.ts | 88 +- src.ts/utils/units.ts | 194 +- src.ts/utils/utf8.ts | 462 +- src.ts/utils/uuid.ts | 32 +- src.ts/wallet/base-wallet.ts | 308 +- src.ts/wallet/english_words.ts | 2 +- src.ts/wallet/hdwallet.ts | 808 +- src.ts/wallet/index.ts | 18 +- src.ts/wallet/json-crowdsale.ts | 83 +- src.ts/wallet/json-keystore.ts | 809 +- src.ts/wallet/mnemonic.ts | 454 +- src.ts/wallet/mnemonicToSeed.ts | 55 +- src.ts/wallet/utils.ts | 160 +- src.ts/wallet/wallet.ts | 444 +- src.ts/wordlists/bit-reader.ts | 54 +- src.ts/wordlists/decode-owl.ts | 90 +- src.ts/wordlists/decode-owla.ts | 48 +- src.ts/wordlists/enwords.ts | 2 +- src.ts/wordlists/generation/encode-latin.ts | 552 +- src.ts/wordlists/lang-cz.ts | 46 +- src.ts/wordlists/lang-en.ts | 46 +- src.ts/wordlists/lang-es.ts | 48 +- src.ts/wordlists/lang-fr.ts | 48 +- src.ts/wordlists/lang-it.ts | 46 +- src.ts/wordlists/lang-ja.ts | 322 +- src.ts/wordlists/lang-ko.ts | 178 +- src.ts/wordlists/lang-pt.ts | 46 +- src.ts/wordlists/lang-zh.ts | 182 +- src.ts/wordlists/wordlist-owl.ts | 92 +- src.ts/wordlists/wordlist-owla.ts | 22 +- src.ts/wordlists/wordlist.ts | 114 +- src.ts/wordlists/wordlists-browser.ts | 2 +- src.ts/wordlists/wordlists.ts | 20 +- tsconfig.base.json | 54 +- tsconfig.commonjs.json | 11 +- tsconfig.esm.json | 10 +- tsconfig.types.json | 21 +- types/_version.d.ts | 4 +- types/_version.d.ts.map | 2 +- types/abi-types/Tes.d.ts.map | 2 +- types/abi-types/Tes_abi.d.ts.map | 2 +- types/abi-types/common.d.ts.map | 2 +- .../abi-types/factories/Tes__factory.d.ts.map | 2 +- .../factories/Tes_abi__factory.d.ts.map | 2 +- types/abi/abi-coder.d.ts.map | 2 +- types/abi/coders/abstract-coder.d.ts.map | 2 +- types/abi/coders/address.d.ts.map | 2 +- types/abi/coders/anonymous.d.ts.map | 2 +- types/abi/coders/array.d.ts.map | 2 +- types/abi/coders/boolean.d.ts.map | 2 +- types/abi/coders/bytes.d.ts.map | 2 +- types/abi/coders/fixed-bytes.d.ts.map | 2 +- types/abi/coders/null.d.ts.map | 2 +- types/abi/coders/number.d.ts.map | 2 +- types/abi/coders/string.d.ts.map | 2 +- types/abi/coders/tuple.d.ts.map | 2 +- types/abi/fragments.d.ts.map | 2 +- types/abi/index.d.ts.map | 2 +- types/abi/interface.d.ts.map | 2 +- types/abi/typed.d.ts.map | 2 +- types/address/contract-address.d.ts.map | 2 +- types/address/index.d.ts.map | 2 +- types/bigNumber/bigNumber.d.ts.map | 2 +- types/cip/custom-units.d.ts | 33 + types/cip/custom-units.d.ts.map | 1 + types/cip/index.d.ts | 49 + types/cip/index.d.ts.map | 1 + types/constants/hashes.d.ts.map | 2 +- types/constants/index.d.ts.map | 2 +- types/constants/numbers.d.ts.map | 2 +- types/contract/contract.d.ts | 2 +- types/contract/contract.d.ts.map | 2 +- types/contract/factory.d.ts.map | 2 +- types/contract/index.d.ts.map | 2 +- types/contract/types.d.ts.map | 2 +- types/contract/wrappers.d.ts.map | 2 +- types/corebc.d.ts | 2 + types/corebc.d.ts.map | 2 +- types/crypto/browser-ed448.d.ts | 3 +- types/crypto/browser-ed448.d.ts.map | 2 +- types/crypto/browser-sha3.d.ts.map | 2 +- types/crypto/crypto-browser.d.ts.map | 2 +- types/crypto/crypto.d.ts | 1 + types/crypto/crypto.d.ts.map | 2 +- types/crypto/ed448-types.d.ts | 15 + types/crypto/ed448-types.d.ts.map | 1 + types/crypto/ed448.d.ts | 3 +- types/crypto/ed448.d.ts.map | 2 +- types/crypto/ed448goldilock-browser.d.ts | 5 +- types/crypto/ed448goldilock-browser.d.ts.map | 2 +- types/crypto/ed448goldilock.d.ts | 5 +- types/crypto/ed448goldilock.d.ts.map | 2 +- types/crypto/hmac.d.ts | 8 +- types/crypto/hmac.d.ts.map | 2 +- types/crypto/index.d.ts.map | 2 +- types/crypto/keccak.d.ts | 8 +- types/crypto/keccak.d.ts.map | 2 +- types/crypto/pbkdf2-browser.d.ts.map | 2 +- types/crypto/pbkdf2.d.ts | 8 +- types/crypto/pbkdf2.d.ts.map | 2 +- types/crypto/random.d.ts | 8 +- types/crypto/random.d.ts.map | 2 +- types/crypto/ripemd160.d.ts | 8 +- types/crypto/ripemd160.d.ts.map | 2 +- types/crypto/scrypt.d.ts | 15 +- types/crypto/scrypt.d.ts.map | 2 +- types/crypto/sha3.d.ts | 19 +- types/crypto/sha3.d.ts.map | 2 +- types/crypto/signature.d.ts.map | 2 +- types/crypto/signing-key.d.ts | 75 +- types/crypto/signing-key.d.ts.map | 2 +- types/hash/message.d.ts.map | 2 +- types/hash/solidity.d.ts.map | 2 +- types/hash/typed-data.d.ts.map | 2 +- types/ipfs/index.d.ts | 18 + types/ipfs/index.d.ts.map | 1 + types/logger/logger.d.ts.map | 2 +- types/providers/abstract-provider.d.ts.map | 2 +- types/providers/abstract-signer.d.ts.map | 2 +- types/providers/community.d.ts.map | 2 +- types/providers/contracts.d.ts.map | 2 +- types/providers/default-provider.d.ts.map | 2 +- types/providers/format.d.ts.map | 2 +- types/providers/formatting.d.ts.map | 2 +- types/providers/index.d.ts.map | 2 +- types/providers/network.d.ts.map | 2 +- types/providers/pagination.d.ts.map | 2 +- types/providers/plugin-fallback.d.ts.map | 2 +- types/providers/plugins-network.d.ts.map | 2 +- types/providers/provider-alchemy.d.ts.map | 2 +- types/providers/provider-ankr.d.ts.map | 2 +- types/providers/provider-browser.d.ts.map | 2 +- types/providers/provider-cloudflare.d.ts.map | 2 +- types/providers/provider-fallback.d.ts.map | 2 +- types/providers/provider-infura.d.ts.map | 2 +- types/providers/provider-ipcsocket.d.ts | 2 +- types/providers/provider-ipcsocket.d.ts.map | 2 +- types/providers/provider-jsonrpc.d.ts.map | 2 +- types/providers/provider-pocket.d.ts.map | 2 +- types/providers/provider-quicknode.d.ts.map | 2 +- types/providers/provider-socket.d.ts.map | 2 +- types/providers/provider-websocket.d.ts.map | 2 +- types/providers/provider.d.ts.map | 2 +- types/providers/signer-noncemanager.d.ts.map | 2 +- types/providers/signer.d.ts.map | 2 +- .../providers/subscriber-connection.d.ts.map | 2 +- types/providers/subscriber-filterid.d.ts.map | 2 +- types/providers/subscriber-polling.d.ts.map | 2 +- types/transaction/address.d.ts.map | 2 +- types/transaction/index.d.ts.map | 2 +- types/transaction/transaction.d.ts.map | 2 +- types/utils/data.d.ts.map | 2 +- types/utils/errors.d.ts.map | 2 +- types/utils/events.d.ts.map | 2 +- types/utils/fetch.d.ts.map | 2 +- types/utils/fixednumber.d.ts.map | 2 +- types/utils/geturl-browser.d.ts | 18 - types/utils/geturl-browser.d.ts.map | 2 +- types/utils/geturl.d.ts.map | 2 +- types/utils/index.d.ts.map | 2 +- types/utils/properties.d.ts.map | 2 +- types/utils/units.d.ts.map | 2 +- types/utils/utf8.d.ts.map | 2 +- types/wallet/base-wallet.d.ts.map | 2 +- types/wallet/english_words.d.ts.map | 2 +- types/wallet/hdwallet.d.ts.map | 2 +- types/wallet/index.d.ts.map | 2 +- types/wallet/json-crowdsale.d.ts.map | 2 +- types/wallet/json-keystore.d.ts.map | 2 +- types/wallet/mnemonic.d.ts.map | 2 +- types/wallet/mnemonicToSeed.d.ts.map | 2 +- types/wallet/wallet.d.ts.map | 2 +- types/wordlists/enwords.d.ts.map | 2 +- .../generation/encode-latin.d.ts.map | 2 +- types/wordlists/lang-cz.d.ts.map | 2 +- types/wordlists/lang-en.d.ts.map | 2 +- types/wordlists/lang-es.d.ts.map | 2 +- types/wordlists/lang-fr.d.ts.map | 2 +- types/wordlists/lang-it.d.ts.map | 2 +- types/wordlists/lang-ja.d.ts.map | 2 +- types/wordlists/lang-ko.d.ts.map | 2 +- types/wordlists/lang-pt.d.ts.map | 2 +- types/wordlists/lang-zh.d.ts.map | 2 +- types/wordlists/wordlist-owl.d.ts.map | 2 +- types/wordlists/wordlist-owla.d.ts.map | 2 +- types/wordlists/wordlist.d.ts.map | 2 +- 1157 files changed, 115539 insertions(+), 54692 deletions(-) create mode 100644 .gitattributes create mode 100644 .prettierrc.json create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 lib.commonjs/_tests/test-cip.d.ts create mode 100644 lib.commonjs/_tests/test-cip.d.ts.map create mode 100644 lib.commonjs/_tests/test-cip.js create mode 100644 lib.commonjs/_tests/test-cip.js.map create mode 100644 lib.commonjs/_tests/test-crypto.d.ts create mode 100644 lib.commonjs/_tests/test-crypto.d.ts.map create mode 100644 lib.commonjs/_tests/test-crypto.js create mode 100644 lib.commonjs/_tests/test-crypto.js.map create mode 100644 lib.commonjs/_tests/test-keystore.d.ts create mode 100644 lib.commonjs/_tests/test-keystore.d.ts.map create mode 100644 lib.commonjs/_tests/test-keystore.js create mode 100644 lib.commonjs/_tests/test-keystore.js.map create mode 100644 lib.commonjs/cip/custom-units.d.ts create mode 100644 lib.commonjs/cip/custom-units.d.ts.map create mode 100644 lib.commonjs/cip/custom-units.js create mode 100644 lib.commonjs/cip/custom-units.js.map create mode 100644 lib.commonjs/cip/index.d.ts create mode 100644 lib.commonjs/cip/index.d.ts.map create mode 100644 lib.commonjs/cip/index.js create mode 100644 lib.commonjs/cip/index.js.map create mode 100644 lib.commonjs/crypto/ed448-types.d.ts create mode 100644 lib.commonjs/crypto/ed448-types.d.ts.map create mode 100644 lib.commonjs/crypto/ed448-types.js create mode 100644 lib.commonjs/crypto/ed448-types.js.map create mode 100644 lib.commonjs/ipfs/index.d.ts create mode 100644 lib.commonjs/ipfs/index.d.ts.map create mode 100644 lib.commonjs/ipfs/index.js create mode 100644 lib.commonjs/ipfs/index.js.map create mode 100644 lib.esm/_tests/test-cip.d.ts create mode 100644 lib.esm/_tests/test-cip.d.ts.map create mode 100644 lib.esm/_tests/test-cip.js create mode 100644 lib.esm/_tests/test-cip.js.map create mode 100644 lib.esm/_tests/test-crypto.d.ts create mode 100644 lib.esm/_tests/test-crypto.d.ts.map create mode 100644 lib.esm/_tests/test-crypto.js create mode 100644 lib.esm/_tests/test-crypto.js.map create mode 100644 lib.esm/_tests/test-keystore.d.ts create mode 100644 lib.esm/_tests/test-keystore.d.ts.map create mode 100644 lib.esm/_tests/test-keystore.js create mode 100644 lib.esm/_tests/test-keystore.js.map create mode 100644 lib.esm/cip/custom-units.d.ts create mode 100644 lib.esm/cip/custom-units.d.ts.map create mode 100644 lib.esm/cip/custom-units.js create mode 100644 lib.esm/cip/custom-units.js.map create mode 100644 lib.esm/cip/index.d.ts create mode 100644 lib.esm/cip/index.d.ts.map create mode 100644 lib.esm/cip/index.js create mode 100644 lib.esm/cip/index.js.map create mode 100644 lib.esm/crypto/ed448-types.d.ts create mode 100644 lib.esm/crypto/ed448-types.d.ts.map create mode 100644 lib.esm/crypto/ed448-types.js create mode 100644 lib.esm/crypto/ed448-types.js.map create mode 100644 lib.esm/ipfs/index.d.ts create mode 100644 lib.esm/ipfs/index.d.ts.map create mode 100644 lib.esm/ipfs/index.js create mode 100644 lib.esm/ipfs/index.js.map create mode 100644 package-lock.json create mode 100644 scripts/build-commonjs.mjs create mode 100644 scripts/clean.mjs create mode 100644 scripts/prepare-build.mjs create mode 100644 scripts/test-browser.mjs create mode 100644 scripts/test-package.mjs create mode 100644 src.ts/_tests/test-cip.ts create mode 100644 src.ts/_tests/test-crypto.ts create mode 100644 src.ts/_tests/test-keystore.ts create mode 100644 src.ts/cip/custom-units.ts create mode 100644 src.ts/cip/index.ts create mode 100644 src.ts/crypto/ed448-types.ts create mode 100644 src.ts/ipfs/index.ts create mode 100644 types/cip/custom-units.d.ts create mode 100644 types/cip/custom-units.d.ts.map create mode 100644 types/cip/index.d.ts create mode 100644 types/cip/index.d.ts.map create mode 100644 types/crypto/ed448-types.d.ts create mode 100644 types/crypto/ed448-types.d.ts.map create mode 100644 types/ipfs/index.d.ts create mode 100644 types/ipfs/index.d.ts.map diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..7d273e83b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# Generated artifacts are retained for this repository's distribution model. +lib.esm/** linguist-generated=true +lib.commonjs/** linguist-generated=true +types/** linguist-generated=true +dist/** linguist-generated=true +# Rollup preserves trailing spaces in bundled third-party dependency sources. +dist/*.js whitespace=-blank-at-eol diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 1720b579d..c7b6f9073 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,63 +1,46 @@ -name: Report Bug 🪲 -description: Create a bug report -labels: - - bug +name: Bug report +description: Report a reproducible corebc.js problem +labels: [bug] body: - type: markdown attributes: - value: | - Please, provide as much details as possible to make proper evaluation and in the end resolve the bug report faster. - - - type: markdown - attributes: - value: | - Software specific details. - + value: Never include private keys, seed phrases, wallet passwords, or RPC credentials. - type: input - id: os + id: version attributes: - label: OS and version - description: Name and version of OS used. - placeholder: OS + label: corebc version + placeholder: 0.4.1 or commit hash validations: required: true - - - type: textarea - id: bug + - type: input + id: environment attributes: - label: Bug - description: Describe the Bug. - placeholder: Bug description + label: Runtime and operating system + description: Node.js or browser version, OS, and bundler if applicable. validations: required: true - + - type: dropdown + id: format + attributes: + label: Package format + options: [ESM, CommonJS, Browser bundle] - type: textarea id: reproduce attributes: - label: Reproduce Bug - description: Steps to reproduce the behavior. - placeholder: 1. Step 1 + label: Minimal reproduction + description: Include runnable code, steps, network ID, and CIP number when relevant. Use disposable test keys only. validations: required: true - - type: textarea id: expected attributes: label: Expected behavior - description: Describe the result you are expecting. - placeholder: Result validations: required: true - - - type: input - id: hash - attributes: - label: Commit hash - description: Commit hash if known. - placeholder: baf2aab0128f07262b564214ec70fc07befc6bb3 - - type: textarea - id: additional + id: actual attributes: - label: Additional context - description: Please, place additional content or screenshots. + label: Actual behavior and error output + description: Remove secrets and identifying information from logs. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml index 1eb2f3440..ae68baba4 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -1,43 +1,31 @@ -name: Feature request 🔮 -description: Suggest an idea for this project -labels: - - feature +name: Feature request +description: Propose an improvement to corebc.js +labels: [enhancement] body: - - type: markdown - attributes: - value: | - Suggest an idea for this project and developers will consider the integration. - - type: textarea id: problem attributes: - label: Problem - description: Is your feature request related to a problem? Please describe. + label: Problem or use case validations: required: true - - type: textarea id: solution attributes: - label: Solution - description: Describe the solution you'd like. + label: Proposed API or behavior + description: Include a TypeScript example if possible. validations: required: true - - type: textarea id: alternatives attributes: - label: Alternatives - description: Describe alternatives you've considered. - - - type: textarea - id: implementation + label: Alternatives considered + - type: input + id: cip attributes: - label: Implementation - description: Describe implementation with example of the code. - + label: Related CIP or implementation + description: Link the specification or a compatible implementation. - type: textarea - id: additional + id: compatibility attributes: - label: Additional context - description: Please, place additional content or screenshots. + label: Compatibility and testing + description: Describe effects on existing callers, Node.js, browsers, and expected tests. diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 46283ae02..4ccbff197 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,36 +1,28 @@ -name: Node.js CI - +name: Package checks on: push: - branches: - - master - + branches: [master] + pull_request: + workflow_dispatch: +permissions: + contents: read +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - - test-build: - + check: runs-on: ubuntu-latest - + timeout-minutes: 20 strategy: fail-fast: false matrix: - node-version: [ 16.x, 18.x, 20.x ] - + node: ["22.12.0", "24", "26"] steps: - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 with: - node-version: ${{ matrix.node-version }} - registry-url: 'https://registry.npmjs.org' - - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Install dependencies - run: npm install - - - name: Build CommonJS and ESM (from TypeScript) - run: npm run build-all - - - name: Run written tests - run: npm run test \ No newline at end of file + node-version: ${{ matrix.node }} + cache: npm + - run: npm ci + - run: npm run check + - run: npm audit --audit-level=high diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 8963519dc..f66641238 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -1,21 +1,46 @@ -name: Publish to NPM +name: Publish to npm on: release: types: [published] +permissions: + contents: read +concurrency: + group: npm-publish + cancel-in-progress: false jobs: - build: + publish: runs-on: ubuntu-latest + timeout-minutes: 20 + permissions: + contents: read + id-token: write steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 + - uses: actions/checkout@v6 with: - node-version: latest - registry-url: 'https://registry.npmjs.org' - - name: Install & Build 🔧 - run: npm i && npm run build - - name: Publish package on NPM 📦 - run: npm publish --access public + ref: ${{ github.event.release.tag_name }} + - uses: actions/setup-node@v6 + with: + node-version: "24" + registry-url: https://registry.npmjs.org + cache: npm + - name: Set up npm trusted publishing + run: npm install --global npm@11.19.0 + - name: Check release version + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: | + node --input-type=module -e 'import fs from "node:fs"; const p = JSON.parse(fs.readFileSync("package.json")); if (process.env.RELEASE_TAG.replace(/^v/, "") !== p.version) throw new Error("Release tag must match package.json version");' + - run: npm ci + - run: npm run check + - run: npm audit --audit-level=high + - name: Pack validated artifacts + run: npm pack --ignore-scripts + - name: Publish validated archive env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + PRERELEASE: ${{ github.event.release.prerelease }} + run: | + if [ "$PRERELEASE" = "true" ]; then + npm publish corebc-*.tgz --access public --provenance --tag next + else + npm publish corebc-*.tgz --access public --provenance --tag latest + fi diff --git a/.gitignore b/.gitignore index a0008a1e7..39ff228a6 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ lerna-debug.log* .pnp.* # lock files (excluding will cause npm ci inaccessible) -package-lock.json yarn.lock pnpm-lock.yaml diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..2903a07a6 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1 @@ +{ "useTabs": true } diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..1c77cfa3e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +## Unreleased + +- Support the updated Noble hashes, TypeScript 7, Node types, and Rollup dependencies. +- Require Node.js 22.12 or newer; regenerate CommonJS through Rollup for ESM dependencies. +- Correct byte-array signing-key input and use Ed448 for shared secrets and point addition. +- Fix AES 3 keystore integration and browser crypto parity; bound wallet KDF resources and compare all MAC bytes. +- Synchronize the exported runtime version with the npm package version. +- Add typed CIP-150, CIP-151, and CIP-152 helpers, bounded IPFS JSON loading, and exact Core custom-unit balances. +- Add regression tests, package and browser smoke checks, reproducible npm installs, issue forms, and validated npm trusted-publishing workflows. +- Update package documentation and contributor instructions. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..096451e26 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,34 @@ +# Contributing to corebc.js + +Use Node.js 22.12 or newer (Node.js 24 is used for releases) and npm. Install the locked dependencies with `npm ci`. + +```sh +npm ci +npm run check +``` + +Edit TypeScript in `src.ts/`. Use tabs for indentation; `npm run format` applies the repository's Prettier configuration. Add regression tests under `src.ts/_tests/test-*.ts` for behavior changes. Keep private keys and RPC credentials out of issues and logs; test vectors must use disposable keys. + +`npm run check` builds ESM, CommonJS, browser bundles, and declarations, checks formatting, runs both Node module test suites, and installs a packed archive into a temporary project to check public exports and TypeScript consumers. It also exercises browser bundles without Node globals. Build outputs are tracked in this repository; include regenerated outputs with source changes. `npm run clean` removes generated outputs and `npm run build-all` restores them. + +The live fee-data test is optional because it depends on an external node: + +```sh +COREBC_RPC_URL=https://your-node.example npm test +``` + +Use a node with the Core `xcb_*` RPC API. Ordinary tests need no live blockchain. The package smoke check downloads production dependencies into a temporary directory and therefore needs registry access. Run `npm audit` to inspect dependency advisories. + +For CIP changes, link the [proposal](https://cip.coreblockchain.net/), describe supported operations and interoperability vectors, and update the README. Current helpers follow the CIP-150/151/152 and custom-unit work introduced in core_web3dart commit `ec787c8`, with subsequent history reviewed through `e472746`. Custom units are a Core application convention and are not presented as a numbered CIP. Keep token amounts and Unix seconds as `bigint`; use an explicit block reference when related reads need a consistent snapshot. + +Open a pull request explaining the problem, changed behavior, and validation. Bug and feature forms are available under GitHub Issues. + +## Releases + +1. Update `package.json` and `src.ts/_version.ts` to the intended version, refresh `package-lock.json` with `npm install`, and document changes in `CHANGELOG.md`. +2. Run `npm run check` and commit the source, lockfile, and regenerated artifacts. +3. Create a GitHub release whose tag is the version, optionally prefixed with `v`. + +The release workflow checks the tag against the package version, reruns validation and the dependency audit, and publishes the validated npm archive with provenance. GitHub prereleases use the `next` dist-tag; normal releases use `latest`. + +Before the first automated release, a package owner must configure an npm trusted publisher for `CorePass/corebc.js`, workflow `publish-npm.yml`. This is an npm account setting, not a repository secret. See [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/). Publishing a GitHub release triggers publication; CI on pull requests does not publish. diff --git a/README.md b/README.md index d8119a15b..316ac2f24 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,110 @@ -# CoreBC +# corebc.js -A complete, compact, and simple library for CoreBC, written in [TypeScript](https://www.typescriptlang.org). +TypeScript and JavaScript tools for Core Blockchain: Ed448 wallets, signing, Core addresses, `xcb_*` JSON-RPC providers, ABI encoding, smart contracts, and token metadata. -## Features +## Install -- Keep your private keys in your client -- Import and export **JSON wallets** (Gocore, XCB HODLER, CorePass) -- Use meta-classes to generate JavaScript objects from any contract ABI, including **ABIv2** and **Human-Readable ABI** -- **Tree-shaking** focused; include only what you need during bundling -- **Complete** functionality to fulfill all your CoreBC needs -- Entirely written in **TypeScript** with strict types for enhanced security -- **CORE License** (MIT for ALL dependencies); fully open source +Requires Node.js **22.12 or newer**, or a modern browser with BigInt and Web Crypto support. -## Installation +```sh +npm install corebc +``` -### NodeJS +```ts +import { JsonRpcProvider, formatXCB } from "corebc"; -```bash -npm i corebc +const provider = new JsonRpcProvider("https://your-core-node.example"); +console.log(await provider.getBlockNumber()); +// console.log(formatXCB(await provider.getBalance(coreAddress))); +provider.destroy(); ``` -### Browser (ESM) +Use your own Core RPC endpoint. CommonJS is supported with `const { Wallet } = require("corebc")`. The package includes declarations and subpath exports such as `corebc/abi`, `corebc/crypto`, `corebc/providers`, `corebc/cip`, and `corebc/ipfs`. -The bundled library is available in the `./dist/` folder in this repo. +## Wallets and contracts -```html - +```ts +import { Wallet, networkIdToPrefix } from "corebc"; + +const wallet = Wallet.createRandom(networkIdToPrefix(3)); +console.log(wallet.address); +const signature = await wallet.signMessage("Hello Core"); +``` + +Wallets support mnemonics, seed derivation, and encrypted JSON keystores. Wallet KDF limits match Core Web3Dart: PBKDF2 permits up to 10 million iterations; scrypt permits `N <= 1048576`, `r * p <= 1048576`, and at most 256 MiB of estimated memory. Wallets exceeding these limits are rejected. Private keys stay with the caller. Core uses 57-byte Ed448 private and public keys and network-prefixed addresses; Ethereum secp256k1 keys are not interchangeable. Keep private keys and recovery phrases out of logs and source control. + +`Contract` accepts JSON or human-readable ABIs and a provider for reads or signer for writes. Transaction fields use `energyLimit`, `energyPrice`, and `networkId`. + +For compatibility, the existing `sha256` and `sha512` exports compute **SHA3-256 and SHA3-512** respectively. `keccak256` is a separate algorithm. Do not substitute hashes when porting signing code. + +## CIP metadata + +The typed helpers follow the same feature scope as Core Web3Dart: + +| Standard | Support | +| ---------------------------------------------------------- | -------------------------------------------------------------------------------- | +| [CIP-150](https://cip.coreblockchain.net/cip/cbc/cip-150/) | Read, enumerate, set, and seal on-chain metadata | +| [CIP-151](https://cip.coreblockchain.net/cip/cbc/cip-151/) | Optional expiration and trading-stop timestamps; inclusive boundary checks | +| [CIP-152](https://cip.coreblockchain.net/cip/cbc/cip-152/) | Resolve `lab` references ending in `lab.json` and validate measurement structure | + +```ts +import { Cip150MetadataContract, IpfsGateway } from "corebc"; + +// provider is a JsonRpcProvider; tokenAddress is a Core contract address. +const metadata = new Cip150MetadataContract(tokenAddress, provider); +const block = await provider.getBlockNumber(); +const entries = await metadata.readAll(block); +const lifecycle = await metadata.readLifecycle(block); +const expired = lifecycle.isExpiredAt(BigInt(Math.floor(Date.now() / 1000))); +const lab = await metadata.readLabCertificate(new IpfsGateway(), block); ``` -## Providers +CIP-151 timestamps remain exact `bigint` Unix seconds. Missing lifecycle values impose no limit. These helpers expose metadata; enforcement of transfers or trading belongs to the contract or application. CIP-152 validation checks JSON structure, not issuer authenticity or gateway content integrity. + +## IPFS and custom units -CoreBC collaborates with an ever-growing list of third-party providers, making it quick and easy to get started. CoreBC provides default keys for each service. +`IpfsGateway` accepts `ipfs://CID/path`, `/ipfs/CID/path`, bare CID references, and HTTP(S) URLs. Its default template is `https://ipf.sk/{cid}`; configure another gateway with `new IpfsGateway({ template: "https://gateway.example/ipfs/{cid}" })`. JSON reads default to a 1 MiB limit and 30-second timeout. Treat metadata URLs as untrusted input; server applications should supply a `fetch` implementation that enforces their outbound network policy. -These built-in keys allow you to use `corebc.getDefaultProvider()` and begin developing immediately. +```ts +import { CustomUnitToken } from "corebc/cip"; + +const token = new CustomUnitToken(tokenAddress, provider); +const block = await provider.getBlockNumber(); +const units = await token.discover(block); +if (units) { + const balance = await token.balance( + accountAddress, + units.preferredUnit, + block, + ); + console.log(balance.canonicalAmount, balance.unitAmount, balance.unit); +} +``` -However, note that the API keys provided by CoreBC are shared and intentionally throttled. This approach encourages developers to acquire their own keys, which come with additional benefits like faster responses, increased capacity, analytics, and access to features like archival data. +Custom-unit discovery follows the Tone/Core API convention: `supportsUnit`, `supportedUnits`, `preferredUnit`, and `balanceOfUnit`. Balances and multiplier numerator/denominator stay as `bigint`; a zero canonical balance has no defined multiplier. This convention is separate from the numbered CIPs above. -## Extension Packages +## Browser bundles -The `corebc` package includes the core functionality required to interact with CoreBC. There are several other packages designed to augment its functionality and improve the user experience. +ESM and UMD bundles, including minified versions, are in `dist/` in the npm package. Serve them from your application: + +```html + +``` + +The UMD bundle `dist/corebc.umd.min.js` exposes `globalThis.corebc`. Secure randomness requires a secure browser context. + +## Development + +```sh +npm ci +npm run check +``` -- Hardware Wallets (@TODO) +See [CONTRIBUTING.md](CONTRIBUTING.md) for builds, tests, CIP contributions, and release setup. Report problems or request features through the [issue forms](https://github.com/CorePass/corebc.js/issues/new/choose). ## License -CORE License (MIT for ALL dependencies). +[CORE License](LICENSE). Dependencies retain their respective licenses. diff --git a/dist/corebc.js b/dist/corebc.js index 544cc6dd5..d16fe3964 100644 --- a/dist/corebc.js +++ b/dist/corebc.js @@ -1,2265 +1,27315 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {}); -import { Buffer as Buffer$1 } from 'buffer'; -export { Buffer } from 'buffer'; -import ed448 from 'bcrypto/lib/ed448-browser.js'; -import _BN from 'bn.js'; -import pbkdf2$2 from 'bcrypto/lib/pbkdf2-browser.js'; -import SHA3_512 from 'bcrypto/lib/sha3-512.js'; -import utf8 from 'utf8'; -import pkg from 'aes-js'; - -/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ -/** - * The current version of corebc. - */ -const version = "6.4.0"; +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; -let _permanentCensorErrors = false; -let _censorErrors = false; -const LogLevels = { - debug: 1, - default: 2, - info: 2, - warning: 3, - error: 4, - off: 5, -}; -let _logLevel = LogLevels["default"]; -let _globalLogger = null; -function _checkNormalize() { - try { - const missing = []; - // Make sure all forms of normalization are supported - ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { - try { - if ("test".normalize(form) !== "test") { - throw new Error("bad normalize"); - } - } - catch (error) { - missing.push(form); - } - }); - if (missing.length) { - throw new Error("missing " + missing.join(", ")); - } - if (String.fromCharCode(0xe9).normalize("NFD") !== - String.fromCharCode(0x65, 0x0301)) { - throw new Error("broken implementation"); - } - } - catch (error) { - return error.message; - } - return null; -} -const _normalizeError = _checkNormalize(); -var LogLevel; -(function (LogLevel) { - LogLevel["DEBUG"] = "DEBUG"; - LogLevel["INFO"] = "INFO"; - LogLevel["WARNING"] = "WARNING"; - LogLevel["ERROR"] = "ERROR"; - LogLevel["OFF"] = "OFF"; -})(LogLevel || (LogLevel = {})); -var ErrorCode; -(function (ErrorCode) { - /////////////////// - // Generic Errors - // Unknown Error - ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR"; - // Not Implemented - ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED"; - // Unsupported Operation - // - operation - ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION"; - // Network Error (i.e. Core Network, such as an invalid network ID) - // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) - ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR"; - // Some sort of bad response from the server - ErrorCode["SERVER_ERROR"] = "SERVER_ERROR"; - // Timeout - ErrorCode["TIMEOUT"] = "TIMEOUT"; - /////////////////// - // Operational Errors - // Buffer Overrun - ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN"; - // Numeric Fault - // - operation: the operation being executed - // - fault: the reason this faulted - ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT"; - /////////////////// - // Argument Errors - // Missing new operator to an object - // - name: The name of the class - ErrorCode["MISSING_NEW"] = "MISSING_NEW"; - // Invalid argument (e.g. value is incompatible with type) to a function: - // - argument: The argument name that was invalid - // - value: The value of the argument - ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT"; - // Missing argument to a function: - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT"; - // Too many arguments - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT"; - /////////////////// - // Blockchain Errors - // Call exception - // - transaction: the transaction - // - address?: the contract address - // - args?: The arguments passed into the function - // - method?: The Solidity method signature - // - errorSignature?: The EIP848 error signature - // - errorArgs?: The EIP848 error parameters - // - reason: The reason (only for EIP848 "Error(string)") - ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION"; - // Insufficient funds (< value + energyLimit * energyPrice) - // - transaction: the transaction attempted - ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS"; - // Nonce has already been used - // - transaction: the transaction attempted - ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED"; - // The replacement fee for the transaction is too low - // - transaction: the transaction attempted - ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED"; - // The energy limit could not be estimated - // - transaction: the transaction passed to estimateEnergy - ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"] = "UNPREDICTABLE_ENERGY_LIMIT"; - // The transaction was replaced by one with a higher energy price - // - reason: "cancelled", "replaced" or "repriced" - // - cancelled: true if reason == "cancelled" or reason == "replaced") - // - hash: original transaction hash - // - replacement: the full TransactionsResponse for the replacement - // - receipt: the receipt of the replacement - ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; -})(ErrorCode || (ErrorCode = {})); -const HEX = "0123456789abcdef"; -class Logger { - version = "0.0.1"; - static errors = ErrorCode; - static levels = LogLevel; - constructor(version) { - Object.defineProperty(this, "version", { - enumerable: true, - value: version, - writable: false, - }); - } - _log(logLevel, args) { - const level = logLevel.toLowerCase(); - if (LogLevels[level] == null) { - this.throwArgumentError("invalid log level name", "logLevel", logLevel); - } - if (_logLevel > LogLevels[level]) { - return; - } - console.log.apply(console, args); - } - debug(...args) { - this._log(Logger.levels.DEBUG, args); - } - info(...args) { - this._log(Logger.levels.INFO, args); - } - warn(...args) { - this._log(Logger.levels.WARNING, args); - } - makeError(message, code, params) { - // Errors are being censored - if (_censorErrors) { - return this.makeError("censored error", code, {}); - } - if (!code) { - code = Logger.errors.UNKNOWN_ERROR; - } - if (!params) { - params = {}; - } - const messageDetails = []; - Object.keys(params).forEach((key) => { - const value = params[key]; - try { - if (value instanceof Uint8Array) { - let hex = ""; - for (let i = 0; i < value.length; i++) { - hex += HEX[value[i] >> 4]; - hex += HEX[value[i] & 0x0f]; - } - messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); - } - else { - messageDetails.push(key + "=" + JSON.stringify(value)); - } - } - catch (error) { - messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); - } - }); - messageDetails.push(`code=${code}`); - messageDetails.push(`version=${this.version}`); - const reason = message; - if (messageDetails.length) { - message += " (" + messageDetails.join(", ") + ")"; - } - // @TODO: Any?? - const error = new Error(message); - error.reason = reason; - error.code = code; - Object.keys(params).forEach(function (key) { - error[key] = params[key]; - }); - return error; - } - throwError(message, code, params) { - throw this.makeError(message, code, params); - } - throwArgumentError(message, name, value) { - return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { - argument: name, - value: value, - }); - } - assert(condition, message, code, params) { - if (!!condition) { - return; - } - this.throwError(message, code, params); - } - assertArgument(condition, message, name, value) { - if (!!condition) { - return; - } - this.throwArgumentError(message, name, value); - } - checkNormalize(message) { - if (_normalizeError) { - this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "String.prototype.normalize", - form: _normalizeError, - }); - } - } - checkSafeUint53(value, message) { - if (typeof value !== "number") { - return; - } - if (message == null) { - message = "value not safe"; - } - if (value < 0 || value >= 0x1fffffffffffff) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "out-of-safe-range", - value: value, - }); - } - if (value % 1) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "non-integer", - value: value, - }); - } - } - checkArgumentCount(count, expectedCount, message) { - if (message) { - message = ": " + message; - } - else { - message = ""; - } - if (count < expectedCount) { - this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - if (count > expectedCount) { - this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - } - checkNew(target, kind) { - if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - checkAbstract(target, kind) { - if (target === kind) { - this.throwError("cannot instantiate abstract class " + - JSON.stringify(kind.name) + - " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }); - } - else if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - static globalLogger() { - if (!_globalLogger) { - _globalLogger = new Logger("logger/0.0.1"); - } - return _globalLogger; - } - static setCensorship(censorship, permanent) { - if (!censorship && permanent) { - this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - if (_permanentCensorErrors) { - if (!censorship) { - return; - } - this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - _censorErrors = !!censorship; - _permanentCensorErrors = !!permanent; - } - static setLogLevel(logLevel) { - const level = LogLevels[logLevel.toLowerCase()]; - if (level == null) { - Logger.globalLogger().warn("invalid log level - " + logLevel); - return; - } - _logLevel = level; - } - static from(version) { - return new Logger(version); - } +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -const logger$7 = new Logger("utils/properties/0.0.1"); -function checkType(value, type, name) { - const types = type.split("|").map((t) => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof value === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; -} -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); -} -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = types ? types[key] : null; - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { - enumerable: true, - value, - writable: false, - }); - } +function getAugmentedNamespace(n) { + if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + var isInstance = false; + try { + isInstance = this instanceof a; + } catch (e) {} + if (isInstance) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; } -function checkProperties(object, properties) { - if (!object || typeof object !== "object") { - logger$7.throwArgumentError("invalid object", "object", object); - } - Object.keys(object).forEach((key) => { - if (!properties[key]) { - logger$7.throwArgumentError("invalid object key - " + key, "transaction:" + key, object); - } - }); + +var buffer = {}; + +var base64Js = {}; + +var hasRequiredBase64Js; + +function requireBase64Js () { + if (hasRequiredBase64Js) return base64Js; + hasRequiredBase64Js = 1; + + base64Js.byteLength = byteLength; + base64Js.toByteArray = toByteArray; + base64Js.fromByteArray = fromByteArray; + + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + + // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + + function getLens (b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4); + + return [validLen, placeHoldersLen] + } + + // base64 is 4/3 + up to two characters of the original data + function byteLength (b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen + } + + function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen + } + + function toByteArray (b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + + var curByte = 0; + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen; + + var i; + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = (tmp >> 16) & 0xFF; + arr[curByte++] = (tmp >> 8) & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4); + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2); + arr[curByte++] = (tmp >> 8) & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr + } + + function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] + } + + function encodeChunk (uint8, start, end) { + var tmp; + var output = []; + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + return output.join('') + } + + function fromByteArray (uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ); + } + + return parts.join('') + } + return base64Js; } -/** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -function stringify$1(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[ " + value.map(stringify$1).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return stringify$1(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "number": - return value.toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{ " + - keys.map((k) => `${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ") + - " }"); - } - } - return `[ COULD NOT SERIALIZE ]`; +var ieee754 = {}; + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + +var hasRequiredIeee754; + +function requireIeee754 () { + if (hasRequiredIeee754) return ieee754; + hasRequiredIeee754 = 1; + ieee754.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = (nBytes * 8) - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? (nBytes - 1) : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) + }; + + ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = (nBytes * 8) - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); + var i = isLE ? 0 : (nBytes - 1); + var d = isLE ? 1 : -1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + }; + return ieee754; } -/** - * Returns true if the %%error%% matches an error thrown by corebc - * that matches the error %%code%%. - * - * In TypeScript envornoments, this can be used to check that %%error%% - * matches an corebcError type, which means the expected properties will - * be set. + +/*! + * The buffer module from node.js, for the browser. * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -function isError(error, code) { - return error && error.code === code; -} -/** - * Returns true if %%error%% is a [[CallExceptionError]. + * @author Feross Aboukhadijeh + * @license MIT */ -function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); -} -/** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ -function makeError(message, code, info) { - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify$1(info)}`); - } - for (const key in info) { - const value = info[key]; - // try { - details.push(key + "=" + stringify$1(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - return error; -} -/** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } -} -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} -function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing arguemnt" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); - assert(count <= expectedCount, "too many arguemnts" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); -} -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; -}, []); -/** - * Throws if the normalization %%form%% is not supported. - */ -function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", - info: { form }, - }); -} -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation, - }); - } -} -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -const logger$6 = new Logger("utils/data/0.0.1"); -function isHexable(value) { - return !!value.toHexString; -} -function isInteger(value) { - return typeof value === "number" && value == value && value % 1 === 0; -} -function isBytes(value) { - if (value == null) { - return false; - } - if (value.constructor === Uint8Array) { - return true; - } - if (typeof value === "string") { - return false; - } - if (!isInteger(value.length) || value.length < 0) { - return false; - } - for (let i = 0; i < value.length; i++) { - const v = value[i]; - if (!isInteger(v) || v < 0 || v >= 256) { - return false; - } - } - return true; -} -function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); -} -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -function getBytes(value, name) { - return _getBytes(value, name, false); -} -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -function getBytesCopy(value, name) { - return _getBytes(value, name, true); -} -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -function isHexString(value, length) { - if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof length === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && value.length % 2 !== 0) { - return false; - } - return true; -} -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -function isBytesLike(value) { - return isHexString(value, true) || value instanceof Uint8Array; -} -const HexCharacters = "0123456789abcdef"; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -function hexlify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "string") { - if (value.includes(",") && value.startsWith("0x")) { - const v = value - .replace("0x", "") - .split(",") - .map((item) => Number(item)); - // @ts-ignore - value = new Uint8Array(v); - } - } - if (typeof value === "number") { - logger$6.checkSafeUint53(value, "invalid hexlify value"); - let hex = ""; - while (value) { - hex = HexCharacters[value & 0xf] + hex; - value = Math.floor(value / 16); - } - if (hex.length) { - if (hex.length % 2) { - hex = "0" + hex; - } - return "0x" + hex; - } - return "0x00"; - } - if (typeof value === "bigint") { - value = value.toString(16); - if (value.length % 2) { - return "0x0" + value; - } - return "0x" + value; - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - return value.toHexString(); - } - if (isHexString(value)) { - if (value.length % 2) { - if (options.hexPad === "left") { - value = "0x0" + value.substring(2); - } - else if (options.hexPad === "right") { - value += "0"; - } - else { - logger$6.throwArgumentError("hex data is odd-length", "value", value); - } - } - return value.toLowerCase(); - } - if (isBytes(value)) { - let result = "0x"; - for (let i = 0; i < value.length; i++) { - let v = value[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; - } - return logger$6.throwArgumentError("invalid hexlify value", "value", value); -} -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -function concat(items) { - return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); -} -function hexDataSlice(data, offset, endOffset) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - logger$6.throwArgumentError("invalid hexData", "value", data); - } - offset = 2 + 2 * offset; - if (endOffset != null) { - return "0x" + data.substring(offset, 2 + 2 * endOffset); - } - return "0x" + data.substring(offset); -} -function hexDataLength(data) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - return null; - } - return (data.length - 2) / 2; -} -/** - * Returns the length of %%data%%, in bytes. - */ -function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; -} -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: bytes.length, - offset: end, - }); - } - return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); -} -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; -} -function zeroPad(data, length, left) { - const bytes = getBytes(data); - assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1, - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -function zeroPadValue(data, length) { - return zeroPad(data, length, true); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -function zeroPadBytes(data, length) { - return zeroPad(data, length, false); -} -function stripZeros(value) { - let result = arrayify(value); - if (result.length === 0) { - return result; - } - // Find the first non-zero entry - let start = 0; - while (start < result.length && result[start] === 0) { - start++; - } - // If we started with zeros, strip them - if (start) { - result = result.slice(start); - } - return result; -} -function arrayify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "number") { - logger$6.checkSafeUint53(value, "invalid arrayify value"); - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value = parseInt(String(value / 256)); - } - if (result.length === 0) { - result.push(0); - } - return addSlice(new Uint8Array(result)); - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - value = value.toHexString(); - } - if (isHexString(value)) { - let hex = value.substring(2); - if (hex.length % 2) { - if (options.hexPad === "left") { - hex = "0x0" + hex.substring(2); - } - else if (options.hexPad === "right") { - hex += "0"; - } - else { - logger$6.throwArgumentError("hex data is odd-length", "value", value); - } - } - const result = []; - for (let i = 0; i < hex.length; i += 2) { - // @ts-ignore - result.push(parseInt(hex.substring(i, i + 2), 16)); - } - return addSlice(new Uint8Array(result)); - } - if (isBytes(value)) { - return addSlice(new Uint8Array(value)); - } - return logger$6.throwArgumentError("invalid arrayify value", "value", value); -} -function addSlice(array) { - // @ts-ignore - if (array.slice) { - return array; - } - array.slice = function () { - const args = Array.prototype.slice.call(arguments); - return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args))); - }; - return array; -} -function hexConcat(items) { - let result = "0x"; - items.forEach((item) => { - result += hexlify(item).substring(2); - }); - return result; -} +var hasRequiredBuffer; -var BN = _BN.BN; -const logger$5 = new Logger("bigNumber/0.0.1"); -const _constructorGuard = {}; -const MAX_SAFE = 0x1fffffffffffff; -// Only warn about passing 10 into radix once -let _warnedToStringRadix = false; -class BigNumber { - _hex; - _isBigNumber; - constructor(constructorGuard, hex) { - logger$5.checkNew(new.target, BigNumber); - if (constructorGuard !== _constructorGuard) { - logger$5.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "new (BigNumber)", - }); - } - this._hex = hex; - this._isBigNumber = true; - Object.freeze(this); - } - fromTwos(value) { - return toBigNumber(toBN(this).fromTwos(value)); - } - toTwos(value) { - return toBigNumber(toBN(this).toTwos(value)); - } - abs() { - if (this._hex[0] === "-") { - return BigNumber.from(this._hex.substring(1)); - } - return this; - } +function requireBuffer () { + if (hasRequiredBuffer) return buffer; + hasRequiredBuffer = 1; + (function (exports) { + + const base64 = requireBase64Js(); + const ieee754 = requireIeee754(); + const customInspectSymbol = + (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation + ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + + const K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && + typeof console.error === 'function') { + console.error( + 'This browser lacks typed array (Uint8Array) support which is required by ' + + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' + ); + } + + function typedArraySupport () { + // Can typed array instances can be augmented? + try { + const arr = new Uint8Array(1); + const proto = { foo: function () { return 42 } }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42 + } catch (e) { + return false + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.buffer + } + }); + + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.byteOffset + } + }); + + function createBuffer (length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"') + } + // Return an augmented `Uint8Array` instance + const buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf + } + + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + function Buffer (arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ) + } + return allocUnsafe(arg) + } + return from(arg, encodingOrOffset, length) + } + + Buffer.poolSize = 8192; // not used by this implementation + + function from (value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value) + } + + if (value == null) { + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof SharedArrayBuffer !== 'undefined' && + (isInstance(value, SharedArrayBuffer) || + (value && isInstance(value.buffer, SharedArrayBuffer)))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + const b = fromObject(value); + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length) + }; + + // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number') + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + } + + function alloc (size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill) + } + return createBuffer(size) + } + + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding) + }; + + function allocUnsafe (size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0) + } + + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size) + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size) + }; + + function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + const length = byteLength(string, encoding) | 0; + let buf = createBuffer(length); + + const actual = buf.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + + return buf + } + + function fromArrayLike (array) { + const length = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length); + for (let i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + return buf + } + + function fromArrayView (arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) + } + return fromArrayLike(arrayView) + } + + function fromArrayBuffer (array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds') + } + + let buf; + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(buf, Buffer.prototype); + + return buf + } + + function fromObject (obj) { + if (Buffer.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + + if (buf.length === 0) { + return buf + } + + obj.copy(buf, 0, 0, len); + return buf + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) + } + return fromArrayLike(obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } + } + + function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 + } + + function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0; + } + return Buffer.alloc(+length) + } + + Buffer.isBuffer = function isBuffer (b) { + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false + }; + + Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) + } + + if (a === b) return 0 + + let x = a.length; + let y = b.length; + + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 + }; + + Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } + }; + + Buffer.concat = function concat (list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + let i; + if (length === undefined) { + length = 0; + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + const buffer = Buffer.allocUnsafe(length); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call( + buffer, + buf, + pos + ); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer + }; + + function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) + } + + const len = string.length; + const mustMatch = (arguments.length > 2 && arguments[2] === true); + if (!mustMatch && len === 0) return 0 + + // Use a for loop to avoid recursion + let loweredCase = false; + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer.byteLength = byteLength; + + function slowToString (encoding, start, end) { + let loweredCase = false; + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0; + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return '' + } + + // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } + + // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + Buffer.prototype._isBuffer = true; + + function swap (b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16 () { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this + }; + + Buffer.prototype.swap32 = function swap32 () { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this + }; + + Buffer.prototype.swap64 = function swap64 () { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this + }; + + Buffer.prototype.toString = function toString () { + const length = this.length; + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 + }; + + Buffer.prototype.inspect = function inspect () { + let str = ''; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return '' + }; + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) + } + + if (start === undefined) { + start = 0; + } + if (end === undefined) { + end = target ? target.length : 0; + } + if (thisStart === undefined) { + thisStart = 0; + } + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + + if (this === target) return 0 + + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 + }; + + // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1); + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0; + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') + } + + function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break + } + } + if (found) return i + } + } + + return -1 + } + + Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 + }; + + Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) + }; + + function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + + const strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + let i; + for (i = 0; i < length; ++i) { + const parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i + buf[offset + i] = parsed; + } + return i + } + + function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) + } + + function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) + } + + function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) + } + + function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) + } + + Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + const remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8'; + + let loweredCase = false; + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } + }; + + function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } + } + + function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = (firstByte > 0xEF) + ? 4 + : (firstByte > 0xDF) + ? 3 + : (firstByte > 0xBF) + ? 2 + : 1; + + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + break + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + break + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + break + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res) + } + + // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + const MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray (codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + let res = ''; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ); + } + return res + } + + function asciiSlice (buf, start, end) { + let ret = ''; + end = Math.min(buf.length, end); + + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + return ret + } + + function latin1Slice (buf, start, end) { + let ret = ''; + end = Math.min(buf.length, end); + + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret + } + + function hexSlice (buf, start, end) { + const len = buf.length; + + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + + let out = ''; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out + } + + function utf16leSlice (buf, start, end) { + const bytes = buf.slice(start, end); + let res = ''; + // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)); + } + return res + } + + Buffer.prototype.slice = function slice (start, end) { + const len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + + const newBuf = this.subarray(start, end); + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(newBuf, Buffer.prototype); + + return newBuf + }; + + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') + } + + Buffer.prototype.readUintLE = + Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val + }; + + Buffer.prototype.readUintBE = + Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + let val = this[offset + --byteLength]; + let mul = 1; + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val + }; + + Buffer.prototype.readUint8 = + Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset] + }; + + Buffer.prototype.readUint16LE = + Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | (this[offset + 1] << 8) + }; + + Buffer.prototype.readUint16BE = + Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return (this[offset] << 8) | this[offset + 1] + }; + + Buffer.prototype.readUint32LE = + Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) + }; + + Buffer.prototype.readUint32BE = + Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) + }; + + Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const lo = first + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 24; + + const hi = this[++offset] + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + last * 2 ** 24; + + return BigInt(lo) + (BigInt(hi) << BigInt(32)) + }); + + Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const hi = first * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + this[++offset]; + + const lo = this[++offset] * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + last; + + return (BigInt(hi) << BigInt(32)) + BigInt(lo) + }); + + Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + mul *= 0x80; + + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + + return val + }; + + Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + let i = byteLength; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + mul *= 0x80; + + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + + return val + }; + + Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) + }; + + Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + const val = this[offset] | (this[offset + 1] << 8); + return (val & 0x8000) ? val | 0xFFFF0000 : val + }; + + Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + const val = this[offset + 1] | (this[offset] << 8); + return (val & 0x8000) ? val | 0xFFFF0000 : val + }; + + Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) + }; + + Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) + }; + + Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const val = this[offset + 4] + + this[offset + 5] * 2 ** 8 + + this[offset + 6] * 2 ** 16 + + (last << 24); // Overflow + + return (BigInt(val) << BigInt(32)) + + BigInt(first + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 24) + }); + + Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const val = (first << 24) + // Overflow + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + this[++offset]; + + return (BigInt(val) << BigInt(32)) + + BigInt(this[++offset] * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + last) + }); + + Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4) + }; + + Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4) + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8) + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8) + }; + + function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') + } + + Buffer.prototype.writeUintLE = + Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + let mul = 1; + let i = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeUintBE = + Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + let i = byteLength - 1; + let mul = 1; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeUint8 = + Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = (value & 0xff); + return offset + 1 + }; + + Buffer.prototype.writeUint16LE = + Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + return offset + 2 + }; + + Buffer.prototype.writeUint16BE = + Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = (value >>> 8); + this[offset + 1] = (value & 0xff); + return offset + 2 + }; + + Buffer.prototype.writeUint32LE = + Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = (value >>> 24); + this[offset + 2] = (value >>> 16); + this[offset + 1] = (value >>> 8); + this[offset] = (value & 0xff); + return offset + 4 + }; + + Buffer.prototype.writeUint32BE = + Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = (value >>> 24); + this[offset + 1] = (value >>> 16); + this[offset + 2] = (value >>> 8); + this[offset + 3] = (value & 0xff); + return offset + 4 + }; + + function wrtBigUInt64LE (buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + + let lo = Number(value & BigInt(0xffffffff)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset + } + + function wrtBigUInt64BE (buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + + let lo = Number(value & BigInt(0xffffffff)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8 + } + + Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) + }); + + Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) + }); + + Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, (8 * byteLength) - 1); + + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, (8 * byteLength) - 1); + + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + let i = byteLength - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128); + if (value < 0) value = 0xff + value + 1; + this[offset] = (value & 0xff); + return offset + 1 + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + return offset + 2 + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); + this[offset] = (value >>> 8); + this[offset + 1] = (value & 0xff); + return offset + 2 + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + this[offset + 2] = (value >>> 16); + this[offset + 3] = (value >>> 24); + return offset + 4 + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = (value >>> 24); + this[offset + 1] = (value >>> 16); + this[offset + 2] = (value >>> 8); + this[offset + 3] = (value & 0xff); + return offset + 4 + }; + + Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) + }); + + Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) + }); + + function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') + } + + function writeFloat (buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4 + } + + Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) + }; + + function writeDouble (buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8 + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) + }; + + // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + const len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ); + } + + return len + }; + + // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if ((encoding === 'utf8' && code < 128) || + encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + + if (!val) val = 0; + + let i; + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + + '" is invalid for argument "value"') + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this + }; + + // CUSTOM ERRORS + // ============= + + // Simplified versions from Node, changed for Buffer-only usage + const errors = {}; + function E (sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor () { + super(); + + Object.defineProperty(this, 'message', { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + + // Add the error code to the name to include it in the stack trace. + this.name = `${this.name} [${sym}]`; + // Access the stack to generate the error message including the error code + // from the name. + this.stack; // eslint-disable-line no-unused-expressions + // Reset the name to the actual name. + delete this.name; + } + + get code () { + return sym + } + + set code (value) { + Object.defineProperty(this, 'code', { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + + toString () { + return `${this.name} [${sym}]: ${this.message}` + } + }; + } + + E('ERR_BUFFER_OUT_OF_BOUNDS', + function (name) { + if (name) { + return `${name} is outside of buffer bounds` + } + + return 'Attempt to access memory outside buffer bounds' + }, RangeError); + E('ERR_INVALID_ARG_TYPE', + function (name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}` + }, TypeError); + E('ERR_OUT_OF_RANGE', + function (str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === 'bigint') { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += 'n'; + } + msg += ` It must be ${range}. Received ${received}`; + return msg + }, RangeError); + + function addNumericalSeparator (val) { + let res = ''; + let i = val.length; + const start = val[0] === '-' ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}` + } + + // CHECK FUNCTIONS + // =============== + + function checkBounds (buf, offset, byteLength) { + validateNumber(offset, 'offset'); + if (buf[offset] === undefined || buf[offset + byteLength] === undefined) { + boundsError(offset, buf.length - (byteLength + 1)); + } + } + + function checkIntBI (value, min, max, buf, offset, byteLength) { + if (value > max || value < min) { + const n = typeof min === 'bigint' ? 'n' : ''; + let range; + { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + + `${(byteLength + 1) * 8 - 1}${n}`; + } + } + throw new errors.ERR_OUT_OF_RANGE('value', range, value) + } + checkBounds(buf, offset, byteLength); + } + + function validateNumber (value, name) { + if (typeof value !== 'number') { + throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value) + } + } + + function boundsError (value, length, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE('offset', 'an integer', value) + } + + if (length < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS() + } + + throw new errors.ERR_OUT_OF_RANGE('offset', + `>= ${0} and <= ${length}`, + value) + } + + // HELPER FUNCTIONS + // ================ + + const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean (str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, ''); + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '='; + } + return str + } + + function utf8ToBytes (string, units) { + units = units || Infinity; + let codePoint; + const length = string.length; + let leadSurrogate = null; + const bytes = []; + + for (let i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue + } + + // valid lead + leadSurrogate = codePoint; + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ); + } else { + throw new Error('Invalid code point') + } + } + + return bytes + } + + function asciiToBytes (str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + return byteArray + } + + function utf16leToBytes (str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray + } + + function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) + } + + function blitBuffer (src, dst, offset, length) { + let i; + for (i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i]; + } + return i + } + + // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) + } + function numberIsNaN (obj) { + // For IE11 support + return obj !== obj // eslint-disable-line no-self-compare + } + + // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + const hexSliceLookupTable = (function () { + const alphabet = '0123456789abcdef'; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table + })(); + + // Return not function with Error if BigInt not supported + function defineBigIntMethod (fn) { + return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn + } + + function BufferBigIntNotDefined () { + throw new Error('BigInt not supported') + } + } (buffer)); + return buffer; +} + +var bufferExports = requireBuffer(); + +/** The current version of corebc; keep in sync with package.json. */ +const version = "0.4.1"; + +var bn$2 = {exports: {}}; + +var _nodeResolve_empty = {}; + +var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + default: _nodeResolve_empty +}); + +var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1); + +var bn$1 = bn$2.exports; + +var hasRequiredBn$1; + +function requireBn$1 () { + if (hasRequiredBn$1) return bn$2.exports; + hasRequiredBn$1 = 1; + (function (module) { + (function (module, exports) { + + // Utils + function assert (val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); + } + + // Could use `inherits` module, but don't want to move from single file + // architecture yet. + function inherits (ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + + // BN + + function BN (number, base, endian) { + if (BN.isBN(number)) { + return number; + } + + this.negative = 0; + this.words = null; + this.length = 0; + + // Reduction context + this.red = null; + + if (number !== null) { + if (base === 'le' || base === 'be') { + endian = base; + base = 10; + } + + this._init(number || 0, base || 10, endian || 'be'); + } + } + if (typeof module === 'object') { + module.exports = BN; + } else { + exports.BN = BN; + } + + BN.BN = BN; + BN.wordSize = 26; + + var Buffer; + try { + if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') { + Buffer = window.Buffer; + } else { + Buffer = require$$0.Buffer; + } + } catch (e) { + } + + BN.isBN = function isBN (num) { + if (num instanceof BN) { + return true; + } + + return num !== null && typeof num === 'object' && + num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + + BN.max = function max (left, right) { + if (left.cmp(right) > 0) return left; + return right; + }; + + BN.min = function min (left, right) { + if (left.cmp(right) < 0) return left; + return right; + }; + + BN.prototype._init = function init (number, base, endian) { + if (typeof number === 'number') { + return this._initNumber(number, base, endian); + } + + if (typeof number === 'object') { + return this._initArray(number, base, endian); + } + + if (base === 'hex') { + base = 16; + } + assert(base === (base | 0) && base >= 2 && base <= 36); + + number = number.toString().replace(/\s+/g, ''); + var start = 0; + if (number[0] === '-') { + start++; + this.negative = 1; + } + + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === 'le') { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + + BN.prototype._initNumber = function _initNumber (number, base, endian) { + if (number < 0) { + this.negative = 1; + number = -number; + } + if (number < 0x4000000) { + this.words = [number & 0x3ffffff]; + this.length = 1; + } else if (number < 0x10000000000000) { + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff + ]; + this.length = 2; + } else { + assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff, + 1 + ]; + this.length = 3; + } + + if (endian !== 'le') return; + + // Reverse the bytes + this._initArray(this.toArray(), base, endian); + }; + + BN.prototype._initArray = function _initArray (number, base, endian) { + // Perhaps a Uint8Array + assert(typeof number.length === 'number'); + if (number.length <= 0) { + this.words = [0]; + this.length = 1; + return this; + } + + this.length = Math.ceil(number.length / 3); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } + + var j, w; + var off = 0; + if (endian === 'be') { + for (i = number.length - 1, j = 0; i >= 0; i -= 3) { + w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } else if (endian === 'le') { + for (i = 0, j = 0; i < number.length; i += 3) { + w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } + return this._strip(); + }; + + function parseHex4Bits (string, index) { + var c = string.charCodeAt(index); + // '0' - '9' + if (c >= 48 && c <= 57) { + return c - 48; + // 'A' - 'F' + } else if (c >= 65 && c <= 70) { + return c - 55; + // 'a' - 'f' + } else if (c >= 97 && c <= 102) { + return c - 87; + } else { + assert(false, 'Invalid character in ' + string); + } + } + + function parseHexByte (string, lowerBound, index) { + var r = parseHex4Bits(string, index); + if (index - 1 >= lowerBound) { + r |= parseHex4Bits(string, index - 1) << 4; + } + return r; + } + + BN.prototype._parseHex = function _parseHex (number, start, endian) { + // Create possibly bigger array to ensure that it fits the number + this.length = Math.ceil((number.length - start) / 6); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } + + // 24-bits chunks + var off = 0; + var j = 0; + + var w; + if (endian === 'be') { + for (i = number.length - 1; i >= start; i -= 2) { + w = parseHexByte(number, start, i) << off; + this.words[j] |= w & 0x3ffffff; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } + } else { + var parseLength = number.length - start; + for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) { + w = parseHexByte(number, start, i) << off; + this.words[j] |= w & 0x3ffffff; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } + } + + this._strip(); + }; + + function parseBase (str, start, end, mul) { + var r = 0; + var b = 0; + var len = Math.min(str.length, end); + for (var i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; + + r *= mul; + + // 'a' + if (c >= 49) { + b = c - 49 + 0xa; + + // 'A' + } else if (c >= 17) { + b = c - 17 + 0xa; + + // '0' - '9' + } else { + b = c; + } + assert(c >= 0 && b < mul, 'Invalid character'); + r += b; + } + return r; + } + + BN.prototype._parseBase = function _parseBase (number, base, start) { + // Initialize as zero + this.words = [0]; + this.length = 1; + + // Find length of limb in base + for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = (limbPow / base) | 0; + + var total = number.length - start; + var mod = total % limbLen; + var end = Math.min(total, total - mod) + start; + + var word = 0; + for (var i = start; i < end; i += limbLen) { + word = parseBase(number, i, i + limbLen, base); + + this.imuln(limbPow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + + if (mod !== 0) { + var pow = 1; + word = parseBase(number, i, number.length, base); + + for (i = 0; i < mod; i++) { + pow *= base; + } + + this.imuln(pow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + + this._strip(); + }; + + BN.prototype.copy = function copy (dest) { + dest.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + dest.words[i] = this.words[i]; + } + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + }; + + function move (dest, src) { + dest.words = src.words; + dest.length = src.length; + dest.negative = src.negative; + dest.red = src.red; + } + + BN.prototype._move = function _move (dest) { + move(dest, this); + }; + + BN.prototype.clone = function clone () { + var r = new BN(null); + this.copy(r); + return r; + }; + + BN.prototype._expand = function _expand (size) { + while (this.length < size) { + this.words[this.length++] = 0; + } + return this; + }; + + // Remove leading `0` from `this` + BN.prototype._strip = function strip () { + while (this.length > 1 && this.words[this.length - 1] === 0) { + this.length--; + } + return this._normSign(); + }; + + BN.prototype._normSign = function _normSign () { + // -0 = 0 + if (this.length === 1 && this.words[0] === 0) { + this.negative = 0; + } + return this; + }; + + // Check Symbol.for because not everywhere where Symbol defined + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility + if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') { + try { + BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect; + } catch (e) { + BN.prototype.inspect = inspect; + } + } else { + BN.prototype.inspect = inspect; + } + + function inspect () { + return (this.red ? ''; + } + + /* + + var zeros = []; + var groupSizes = []; + var groupBases = []; + + var s = ''; + var i = -1; + while (++i < BN.wordSize) { + zeros[i] = s; + s += '0'; + } + groupSizes[0] = 0; + groupSizes[1] = 0; + groupBases[0] = 0; + groupBases[1] = 0; + var base = 2 - 1; + while (++base < 36 + 1) { + var groupSize = 0; + var groupBase = 1; + while (groupBase < (1 << BN.wordSize) / base) { + groupBase *= base; + groupSize += 1; + } + groupSizes[base] = groupSize; + groupBases[base] = groupBase; + } + + */ + + var zeros = [ + '', + '0', + '00', + '000', + '0000', + '00000', + '000000', + '0000000', + '00000000', + '000000000', + '0000000000', + '00000000000', + '000000000000', + '0000000000000', + '00000000000000', + '000000000000000', + '0000000000000000', + '00000000000000000', + '000000000000000000', + '0000000000000000000', + '00000000000000000000', + '000000000000000000000', + '0000000000000000000000', + '00000000000000000000000', + '000000000000000000000000', + '0000000000000000000000000' + ]; + + var groupSizes = [ + 0, 0, + 25, 16, 12, 11, 10, 9, 8, + 8, 7, 7, 7, 7, 6, 6, + 6, 6, 6, 6, 6, 5, 5, + 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5 + ]; + + var groupBases = [ + 0, 0, + 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, + 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, + 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, + 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, + 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 + ]; + + BN.prototype.toString = function toString (base, padding) { + base = base || 10; + padding = padding | 0 || 1; + + var out; + if (base === 16 || base === 'hex') { + out = ''; + var off = 0; + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = this.words[i]; + var word = (((w << off) | carry) & 0xffffff).toString(16); + carry = (w >>> (24 - off)) & 0xffffff; + off += 2; + if (off >= 26) { + off -= 26; + i--; + } + if (carry !== 0 || i !== this.length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + + if (base === (base | 0) && base >= 2 && base <= 36) { + // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); + var groupSize = groupSizes[base]; + // var groupBase = Math.pow(base, groupSize); + var groupBase = groupBases[base]; + out = ''; + var c = this.clone(); + c.negative = 0; + while (!c.isZero()) { + var r = c.modrn(groupBase).toString(base); + c = c.idivn(groupBase); + + if (!c.isZero()) { + out = zeros[groupSize - r.length] + r + out; + } else { + out = r + out; + } + } + if (this.isZero()) { + out = '0' + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + + assert(false, 'Base should be between 2 and 36'); + }; + + BN.prototype.toNumber = function toNumber () { + var ret = this.words[0]; + if (this.length === 2) { + ret += this.words[1] * 0x4000000; + } else if (this.length === 3 && this.words[2] === 0x01) { + // NOTE: at this stage it is known that the top bit is set + ret += 0x10000000000000 + (this.words[1] * 0x4000000); + } else if (this.length > 2) { + assert(false, 'Number can only safely store up to 53 bits'); + } + return (this.negative !== 0) ? -ret : ret; + }; + + BN.prototype.toJSON = function toJSON () { + return this.toString(16, 2); + }; + + if (Buffer) { + BN.prototype.toBuffer = function toBuffer (endian, length) { + return this.toArrayLike(Buffer, endian, length); + }; + } + + BN.prototype.toArray = function toArray (endian, length) { + return this.toArrayLike(Array, endian, length); + }; + + var allocate = function allocate (ArrayType, size) { + if (ArrayType.allocUnsafe) { + return ArrayType.allocUnsafe(size); + } + return new ArrayType(size); + }; + + BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { + this._strip(); + + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert(byteLength <= reqLength, 'byte array longer than desired length'); + assert(reqLength > 0, 'Requested array length <= 0'); + + var res = allocate(ArrayType, reqLength); + var postfix = endian === 'le' ? 'LE' : 'BE'; + this['_toArrayLike' + postfix](res, byteLength); + return res; + }; + + BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) { + var position = 0; + var carry = 0; + + for (var i = 0, shift = 0; i < this.length; i++) { + var word = (this.words[i] << shift) | carry; + + res[position++] = word & 0xff; + if (position < res.length) { + res[position++] = (word >> 8) & 0xff; + } + if (position < res.length) { + res[position++] = (word >> 16) & 0xff; + } + + if (shift === 6) { + if (position < res.length) { + res[position++] = (word >> 24) & 0xff; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + + if (position < res.length) { + res[position++] = carry; + + while (position < res.length) { + res[position++] = 0; + } + } + }; + + BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) { + var position = res.length - 1; + var carry = 0; + + for (var i = 0, shift = 0; i < this.length; i++) { + var word = (this.words[i] << shift) | carry; + + res[position--] = word & 0xff; + if (position >= 0) { + res[position--] = (word >> 8) & 0xff; + } + if (position >= 0) { + res[position--] = (word >> 16) & 0xff; + } + + if (shift === 6) { + if (position >= 0) { + res[position--] = (word >> 24) & 0xff; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + + if (position >= 0) { + res[position--] = carry; + + while (position >= 0) { + res[position--] = 0; + } + } + }; + + if (Math.clz32) { + BN.prototype._countBits = function _countBits (w) { + return 32 - Math.clz32(w); + }; + } else { + BN.prototype._countBits = function _countBits (w) { + var t = w; + var r = 0; + if (t >= 0x1000) { + r += 13; + t >>>= 13; + } + if (t >= 0x40) { + r += 7; + t >>>= 7; + } + if (t >= 0x8) { + r += 4; + t >>>= 4; + } + if (t >= 0x02) { + r += 2; + t >>>= 2; + } + return r + t; + }; + } + + BN.prototype._zeroBits = function _zeroBits (w) { + // Short-cut + if (w === 0) return 26; + + var t = w; + var r = 0; + if ((t & 0x1fff) === 0) { + r += 13; + t >>>= 13; + } + if ((t & 0x7f) === 0) { + r += 7; + t >>>= 7; + } + if ((t & 0xf) === 0) { + r += 4; + t >>>= 4; + } + if ((t & 0x3) === 0) { + r += 2; + t >>>= 2; + } + if ((t & 0x1) === 0) { + r++; + } + return r; + }; + + // Return number of used bits in a BN + BN.prototype.bitLength = function bitLength () { + var w = this.words[this.length - 1]; + var hi = this._countBits(w); + return (this.length - 1) * 26 + hi; + }; + + function toBitArray (num) { + var w = new Array(num.bitLength()); + + for (var bit = 0; bit < w.length; bit++) { + var off = (bit / 26) | 0; + var wbit = bit % 26; + + w[bit] = (num.words[off] >>> wbit) & 0x01; + } + + return w; + } + + // Number of trailing zero bits + BN.prototype.zeroBits = function zeroBits () { + if (this.isZero()) return 0; + + var r = 0; + for (var i = 0; i < this.length; i++) { + var b = this._zeroBits(this.words[i]); + r += b; + if (b !== 26) break; + } + return r; + }; + + BN.prototype.byteLength = function byteLength () { + return Math.ceil(this.bitLength() / 8); + }; + + BN.prototype.toTwos = function toTwos (width) { + if (this.negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + + BN.prototype.fromTwos = function fromTwos (width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + + BN.prototype.isNeg = function isNeg () { + return this.negative !== 0; + }; + + // Return negative clone of `this` + BN.prototype.neg = function neg () { + return this.clone().ineg(); + }; + + BN.prototype.ineg = function ineg () { + if (!this.isZero()) { + this.negative ^= 1; + } + + return this; + }; + + // Or `num` with `this` in-place + BN.prototype.iuor = function iuor (num) { + while (this.length < num.length) { + this.words[this.length++] = 0; + } + + for (var i = 0; i < num.length; i++) { + this.words[i] = this.words[i] | num.words[i]; + } + + return this._strip(); + }; + + BN.prototype.ior = function ior (num) { + assert((this.negative | num.negative) === 0); + return this.iuor(num); + }; + + // Or `num` with `this` + BN.prototype.or = function or (num) { + if (this.length > num.length) return this.clone().ior(num); + return num.clone().ior(this); + }; + + BN.prototype.uor = function uor (num) { + if (this.length > num.length) return this.clone().iuor(num); + return num.clone().iuor(this); + }; + + // And `num` with `this` in-place + BN.prototype.iuand = function iuand (num) { + // b = min-length(num, this) + var b; + if (this.length > num.length) { + b = num; + } else { + b = this; + } + + for (var i = 0; i < b.length; i++) { + this.words[i] = this.words[i] & num.words[i]; + } + + this.length = b.length; + + return this._strip(); + }; + + BN.prototype.iand = function iand (num) { + assert((this.negative | num.negative) === 0); + return this.iuand(num); + }; + + // And `num` with `this` + BN.prototype.and = function and (num) { + if (this.length > num.length) return this.clone().iand(num); + return num.clone().iand(this); + }; + + BN.prototype.uand = function uand (num) { + if (this.length > num.length) return this.clone().iuand(num); + return num.clone().iuand(this); + }; + + // Xor `num` with `this` in-place + BN.prototype.iuxor = function iuxor (num) { + // a.length > b.length + var a; + var b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + for (var i = 0; i < b.length; i++) { + this.words[i] = a.words[i] ^ b.words[i]; + } + + if (this !== a) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } + + this.length = a.length; + + return this._strip(); + }; + + BN.prototype.ixor = function ixor (num) { + assert((this.negative | num.negative) === 0); + return this.iuxor(num); + }; + + // Xor `num` with `this` + BN.prototype.xor = function xor (num) { + if (this.length > num.length) return this.clone().ixor(num); + return num.clone().ixor(this); + }; + + BN.prototype.uxor = function uxor (num) { + if (this.length > num.length) return this.clone().iuxor(num); + return num.clone().iuxor(this); + }; + + // Not ``this`` with ``width`` bitwidth + BN.prototype.inotn = function inotn (width) { + assert(typeof width === 'number' && width >= 0); + + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + + // Extend the buffer with leading zeroes + this._expand(bytesNeeded); + + if (bitsLeft > 0) { + bytesNeeded--; + } + + // Handle complete words + for (var i = 0; i < bytesNeeded; i++) { + this.words[i] = ~this.words[i] & 0x3ffffff; + } + + // Handle the residue + if (bitsLeft > 0) { + this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); + i++; + } + + // Clear words above the requested width so the result stays below 2 ** width + for (; i < this.length; i++) { + this.words[i] = 0; + } + + // And remove leading zeroes + return this._strip(); + }; + + BN.prototype.notn = function notn (width) { + return this.clone().inotn(width); + }; + + // Set `bit` of `this` + BN.prototype.setn = function setn (bit, val) { + assert(typeof bit === 'number' && bit >= 0); + + var off = (bit / 26) | 0; + var wbit = bit % 26; + + this._expand(off + 1); + + if (val) { + this.words[off] = this.words[off] | (1 << wbit); + } else { + this.words[off] = this.words[off] & ~(1 << wbit); + } + + return this._strip(); + }; + + // Add `num` to `this` in-place + BN.prototype.iadd = function iadd (num) { + var r; + + // negative + positive + if (this.negative !== 0 && num.negative === 0) { + this.negative = 0; + r = this.isub(num); + this.negative ^= 1; + return this._normSign(); + + // positive + negative + } else if (this.negative === 0 && num.negative !== 0) { + num.negative = 0; + r = this.isub(num); + num.negative = 1; + return r._normSign(); + } + + // a.length > b.length + var a, b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) + (b.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + + this.length = a.length; + if (carry !== 0) { + this.words[this.length] = carry; + this.length++; + // Copy the rest of the words + } else if (a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } + + return this; + }; + + // Add `num` to `this` + BN.prototype.add = function add (num) { + var res; + if (num.negative !== 0 && this.negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && this.negative !== 0) { + this.negative = 0; + res = num.sub(this); + this.negative = 1; + return res; + } + + if (this.length > num.length) return this.clone().iadd(num); + + return num.clone().iadd(this); + }; + + // Subtract `num` from `this` in-place + BN.prototype.isub = function isub (num) { + // this - (-num) = this + num + if (num.negative !== 0) { + num.negative = 0; + var r = this.iadd(num); + num.negative = 1; + return r._normSign(); + + // -this - num = -(this + num) + } else if (this.negative !== 0) { + this.negative = 0; + this.iadd(num); + this.negative = 1; + return this._normSign(); + } + + // At this point both numbers are positive + var cmp = this.cmp(num); + + // Optimization - zeroify + if (cmp === 0) { + this.negative = 0; + this.length = 1; + this.words[0] = 0; + return this; + } + + // a > b + var a, b; + if (cmp > 0) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) - (b.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } + + // Copy rest of the words + if (carry === 0 && i < a.length && a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } + + this.length = Math.max(this.length, i); + + if (a !== this) { + this.negative = 1; + } + + return this._strip(); + }; + + // Subtract `num` from `this` + BN.prototype.sub = function sub (num) { + return this.clone().isub(num); + }; + + function smallMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + var len = (self.length + num.length) | 0; + out.length = len; + len = (len - 1) | 0; + + // Peel one iteration (compiler can't do it, because of code complexity) + var a = self.words[0] | 0; + var b = num.words[0] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + var carry = (r / 0x4000000) | 0; + out.words[0] = lo; + + for (var k = 1; k < len; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = carry >>> 26; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = (k - j) | 0; + a = self.words[i] | 0; + b = num.words[j] | 0; + r = a * b + rword; + ncarry += (r / 0x4000000) | 0; + rword = r & 0x3ffffff; + } + out.words[k] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k] = carry | 0; + } else { + out.length--; + } + + return out._strip(); + } + + // TODO(indutny): it may be reasonable to omit it for users who don't need + // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit + // multiplication (like elliptic secp256k1). + var comb10MulTo = function comb10MulTo (self, num, out) { + var a = self.words; + var b = num.words; + var o = out.words; + var c = 0; + var lo; + var mid; + var hi; + var a0 = a[0] | 0; + var al0 = a0 & 0x1fff; + var ah0 = a0 >>> 13; + var a1 = a[1] | 0; + var al1 = a1 & 0x1fff; + var ah1 = a1 >>> 13; + var a2 = a[2] | 0; + var al2 = a2 & 0x1fff; + var ah2 = a2 >>> 13; + var a3 = a[3] | 0; + var al3 = a3 & 0x1fff; + var ah3 = a3 >>> 13; + var a4 = a[4] | 0; + var al4 = a4 & 0x1fff; + var ah4 = a4 >>> 13; + var a5 = a[5] | 0; + var al5 = a5 & 0x1fff; + var ah5 = a5 >>> 13; + var a6 = a[6] | 0; + var al6 = a6 & 0x1fff; + var ah6 = a6 >>> 13; + var a7 = a[7] | 0; + var al7 = a7 & 0x1fff; + var ah7 = a7 >>> 13; + var a8 = a[8] | 0; + var al8 = a8 & 0x1fff; + var ah8 = a8 >>> 13; + var a9 = a[9] | 0; + var al9 = a9 & 0x1fff; + var ah9 = a9 >>> 13; + var b0 = b[0] | 0; + var bl0 = b0 & 0x1fff; + var bh0 = b0 >>> 13; + var b1 = b[1] | 0; + var bl1 = b1 & 0x1fff; + var bh1 = b1 >>> 13; + var b2 = b[2] | 0; + var bl2 = b2 & 0x1fff; + var bh2 = b2 >>> 13; + var b3 = b[3] | 0; + var bl3 = b3 & 0x1fff; + var bh3 = b3 >>> 13; + var b4 = b[4] | 0; + var bl4 = b4 & 0x1fff; + var bh4 = b4 >>> 13; + var b5 = b[5] | 0; + var bl5 = b5 & 0x1fff; + var bh5 = b5 >>> 13; + var b6 = b[6] | 0; + var bl6 = b6 & 0x1fff; + var bh6 = b6 >>> 13; + var b7 = b[7] | 0; + var bl7 = b7 & 0x1fff; + var bh7 = b7 >>> 13; + var b8 = b[8] | 0; + var bl8 = b8 & 0x1fff; + var bh8 = b8 >>> 13; + var b9 = b[9] | 0; + var bl9 = b9 & 0x1fff; + var bh9 = b9 >>> 13; + + out.negative = self.negative ^ num.negative; + out.length = 19; + /* k = 0 */ + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = (mid + Math.imul(ah0, bl0)) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; + w0 &= 0x3ffffff; + /* k = 1 */ + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = (mid + Math.imul(ah1, bl0)) | 0; + hi = Math.imul(ah1, bh0); + lo = (lo + Math.imul(al0, bl1)) | 0; + mid = (mid + Math.imul(al0, bh1)) | 0; + mid = (mid + Math.imul(ah0, bl1)) | 0; + hi = (hi + Math.imul(ah0, bh1)) | 0; + var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; + w1 &= 0x3ffffff; + /* k = 2 */ + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = (mid + Math.imul(ah2, bl0)) | 0; + hi = Math.imul(ah2, bh0); + lo = (lo + Math.imul(al1, bl1)) | 0; + mid = (mid + Math.imul(al1, bh1)) | 0; + mid = (mid + Math.imul(ah1, bl1)) | 0; + hi = (hi + Math.imul(ah1, bh1)) | 0; + lo = (lo + Math.imul(al0, bl2)) | 0; + mid = (mid + Math.imul(al0, bh2)) | 0; + mid = (mid + Math.imul(ah0, bl2)) | 0; + hi = (hi + Math.imul(ah0, bh2)) | 0; + var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; + w2 &= 0x3ffffff; + /* k = 3 */ + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = (mid + Math.imul(ah3, bl0)) | 0; + hi = Math.imul(ah3, bh0); + lo = (lo + Math.imul(al2, bl1)) | 0; + mid = (mid + Math.imul(al2, bh1)) | 0; + mid = (mid + Math.imul(ah2, bl1)) | 0; + hi = (hi + Math.imul(ah2, bh1)) | 0; + lo = (lo + Math.imul(al1, bl2)) | 0; + mid = (mid + Math.imul(al1, bh2)) | 0; + mid = (mid + Math.imul(ah1, bl2)) | 0; + hi = (hi + Math.imul(ah1, bh2)) | 0; + lo = (lo + Math.imul(al0, bl3)) | 0; + mid = (mid + Math.imul(al0, bh3)) | 0; + mid = (mid + Math.imul(ah0, bl3)) | 0; + hi = (hi + Math.imul(ah0, bh3)) | 0; + var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; + w3 &= 0x3ffffff; + /* k = 4 */ + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = (mid + Math.imul(ah4, bl0)) | 0; + hi = Math.imul(ah4, bh0); + lo = (lo + Math.imul(al3, bl1)) | 0; + mid = (mid + Math.imul(al3, bh1)) | 0; + mid = (mid + Math.imul(ah3, bl1)) | 0; + hi = (hi + Math.imul(ah3, bh1)) | 0; + lo = (lo + Math.imul(al2, bl2)) | 0; + mid = (mid + Math.imul(al2, bh2)) | 0; + mid = (mid + Math.imul(ah2, bl2)) | 0; + hi = (hi + Math.imul(ah2, bh2)) | 0; + lo = (lo + Math.imul(al1, bl3)) | 0; + mid = (mid + Math.imul(al1, bh3)) | 0; + mid = (mid + Math.imul(ah1, bl3)) | 0; + hi = (hi + Math.imul(ah1, bh3)) | 0; + lo = (lo + Math.imul(al0, bl4)) | 0; + mid = (mid + Math.imul(al0, bh4)) | 0; + mid = (mid + Math.imul(ah0, bl4)) | 0; + hi = (hi + Math.imul(ah0, bh4)) | 0; + var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; + w4 &= 0x3ffffff; + /* k = 5 */ + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = (mid + Math.imul(ah5, bl0)) | 0; + hi = Math.imul(ah5, bh0); + lo = (lo + Math.imul(al4, bl1)) | 0; + mid = (mid + Math.imul(al4, bh1)) | 0; + mid = (mid + Math.imul(ah4, bl1)) | 0; + hi = (hi + Math.imul(ah4, bh1)) | 0; + lo = (lo + Math.imul(al3, bl2)) | 0; + mid = (mid + Math.imul(al3, bh2)) | 0; + mid = (mid + Math.imul(ah3, bl2)) | 0; + hi = (hi + Math.imul(ah3, bh2)) | 0; + lo = (lo + Math.imul(al2, bl3)) | 0; + mid = (mid + Math.imul(al2, bh3)) | 0; + mid = (mid + Math.imul(ah2, bl3)) | 0; + hi = (hi + Math.imul(ah2, bh3)) | 0; + lo = (lo + Math.imul(al1, bl4)) | 0; + mid = (mid + Math.imul(al1, bh4)) | 0; + mid = (mid + Math.imul(ah1, bl4)) | 0; + hi = (hi + Math.imul(ah1, bh4)) | 0; + lo = (lo + Math.imul(al0, bl5)) | 0; + mid = (mid + Math.imul(al0, bh5)) | 0; + mid = (mid + Math.imul(ah0, bl5)) | 0; + hi = (hi + Math.imul(ah0, bh5)) | 0; + var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; + w5 &= 0x3ffffff; + /* k = 6 */ + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = (mid + Math.imul(ah6, bl0)) | 0; + hi = Math.imul(ah6, bh0); + lo = (lo + Math.imul(al5, bl1)) | 0; + mid = (mid + Math.imul(al5, bh1)) | 0; + mid = (mid + Math.imul(ah5, bl1)) | 0; + hi = (hi + Math.imul(ah5, bh1)) | 0; + lo = (lo + Math.imul(al4, bl2)) | 0; + mid = (mid + Math.imul(al4, bh2)) | 0; + mid = (mid + Math.imul(ah4, bl2)) | 0; + hi = (hi + Math.imul(ah4, bh2)) | 0; + lo = (lo + Math.imul(al3, bl3)) | 0; + mid = (mid + Math.imul(al3, bh3)) | 0; + mid = (mid + Math.imul(ah3, bl3)) | 0; + hi = (hi + Math.imul(ah3, bh3)) | 0; + lo = (lo + Math.imul(al2, bl4)) | 0; + mid = (mid + Math.imul(al2, bh4)) | 0; + mid = (mid + Math.imul(ah2, bl4)) | 0; + hi = (hi + Math.imul(ah2, bh4)) | 0; + lo = (lo + Math.imul(al1, bl5)) | 0; + mid = (mid + Math.imul(al1, bh5)) | 0; + mid = (mid + Math.imul(ah1, bl5)) | 0; + hi = (hi + Math.imul(ah1, bh5)) | 0; + lo = (lo + Math.imul(al0, bl6)) | 0; + mid = (mid + Math.imul(al0, bh6)) | 0; + mid = (mid + Math.imul(ah0, bl6)) | 0; + hi = (hi + Math.imul(ah0, bh6)) | 0; + var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; + w6 &= 0x3ffffff; + /* k = 7 */ + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = (mid + Math.imul(ah7, bl0)) | 0; + hi = Math.imul(ah7, bh0); + lo = (lo + Math.imul(al6, bl1)) | 0; + mid = (mid + Math.imul(al6, bh1)) | 0; + mid = (mid + Math.imul(ah6, bl1)) | 0; + hi = (hi + Math.imul(ah6, bh1)) | 0; + lo = (lo + Math.imul(al5, bl2)) | 0; + mid = (mid + Math.imul(al5, bh2)) | 0; + mid = (mid + Math.imul(ah5, bl2)) | 0; + hi = (hi + Math.imul(ah5, bh2)) | 0; + lo = (lo + Math.imul(al4, bl3)) | 0; + mid = (mid + Math.imul(al4, bh3)) | 0; + mid = (mid + Math.imul(ah4, bl3)) | 0; + hi = (hi + Math.imul(ah4, bh3)) | 0; + lo = (lo + Math.imul(al3, bl4)) | 0; + mid = (mid + Math.imul(al3, bh4)) | 0; + mid = (mid + Math.imul(ah3, bl4)) | 0; + hi = (hi + Math.imul(ah3, bh4)) | 0; + lo = (lo + Math.imul(al2, bl5)) | 0; + mid = (mid + Math.imul(al2, bh5)) | 0; + mid = (mid + Math.imul(ah2, bl5)) | 0; + hi = (hi + Math.imul(ah2, bh5)) | 0; + lo = (lo + Math.imul(al1, bl6)) | 0; + mid = (mid + Math.imul(al1, bh6)) | 0; + mid = (mid + Math.imul(ah1, bl6)) | 0; + hi = (hi + Math.imul(ah1, bh6)) | 0; + lo = (lo + Math.imul(al0, bl7)) | 0; + mid = (mid + Math.imul(al0, bh7)) | 0; + mid = (mid + Math.imul(ah0, bl7)) | 0; + hi = (hi + Math.imul(ah0, bh7)) | 0; + var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; + w7 &= 0x3ffffff; + /* k = 8 */ + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = (mid + Math.imul(ah8, bl0)) | 0; + hi = Math.imul(ah8, bh0); + lo = (lo + Math.imul(al7, bl1)) | 0; + mid = (mid + Math.imul(al7, bh1)) | 0; + mid = (mid + Math.imul(ah7, bl1)) | 0; + hi = (hi + Math.imul(ah7, bh1)) | 0; + lo = (lo + Math.imul(al6, bl2)) | 0; + mid = (mid + Math.imul(al6, bh2)) | 0; + mid = (mid + Math.imul(ah6, bl2)) | 0; + hi = (hi + Math.imul(ah6, bh2)) | 0; + lo = (lo + Math.imul(al5, bl3)) | 0; + mid = (mid + Math.imul(al5, bh3)) | 0; + mid = (mid + Math.imul(ah5, bl3)) | 0; + hi = (hi + Math.imul(ah5, bh3)) | 0; + lo = (lo + Math.imul(al4, bl4)) | 0; + mid = (mid + Math.imul(al4, bh4)) | 0; + mid = (mid + Math.imul(ah4, bl4)) | 0; + hi = (hi + Math.imul(ah4, bh4)) | 0; + lo = (lo + Math.imul(al3, bl5)) | 0; + mid = (mid + Math.imul(al3, bh5)) | 0; + mid = (mid + Math.imul(ah3, bl5)) | 0; + hi = (hi + Math.imul(ah3, bh5)) | 0; + lo = (lo + Math.imul(al2, bl6)) | 0; + mid = (mid + Math.imul(al2, bh6)) | 0; + mid = (mid + Math.imul(ah2, bl6)) | 0; + hi = (hi + Math.imul(ah2, bh6)) | 0; + lo = (lo + Math.imul(al1, bl7)) | 0; + mid = (mid + Math.imul(al1, bh7)) | 0; + mid = (mid + Math.imul(ah1, bl7)) | 0; + hi = (hi + Math.imul(ah1, bh7)) | 0; + lo = (lo + Math.imul(al0, bl8)) | 0; + mid = (mid + Math.imul(al0, bh8)) | 0; + mid = (mid + Math.imul(ah0, bl8)) | 0; + hi = (hi + Math.imul(ah0, bh8)) | 0; + var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; + w8 &= 0x3ffffff; + /* k = 9 */ + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = (mid + Math.imul(ah9, bl0)) | 0; + hi = Math.imul(ah9, bh0); + lo = (lo + Math.imul(al8, bl1)) | 0; + mid = (mid + Math.imul(al8, bh1)) | 0; + mid = (mid + Math.imul(ah8, bl1)) | 0; + hi = (hi + Math.imul(ah8, bh1)) | 0; + lo = (lo + Math.imul(al7, bl2)) | 0; + mid = (mid + Math.imul(al7, bh2)) | 0; + mid = (mid + Math.imul(ah7, bl2)) | 0; + hi = (hi + Math.imul(ah7, bh2)) | 0; + lo = (lo + Math.imul(al6, bl3)) | 0; + mid = (mid + Math.imul(al6, bh3)) | 0; + mid = (mid + Math.imul(ah6, bl3)) | 0; + hi = (hi + Math.imul(ah6, bh3)) | 0; + lo = (lo + Math.imul(al5, bl4)) | 0; + mid = (mid + Math.imul(al5, bh4)) | 0; + mid = (mid + Math.imul(ah5, bl4)) | 0; + hi = (hi + Math.imul(ah5, bh4)) | 0; + lo = (lo + Math.imul(al4, bl5)) | 0; + mid = (mid + Math.imul(al4, bh5)) | 0; + mid = (mid + Math.imul(ah4, bl5)) | 0; + hi = (hi + Math.imul(ah4, bh5)) | 0; + lo = (lo + Math.imul(al3, bl6)) | 0; + mid = (mid + Math.imul(al3, bh6)) | 0; + mid = (mid + Math.imul(ah3, bl6)) | 0; + hi = (hi + Math.imul(ah3, bh6)) | 0; + lo = (lo + Math.imul(al2, bl7)) | 0; + mid = (mid + Math.imul(al2, bh7)) | 0; + mid = (mid + Math.imul(ah2, bl7)) | 0; + hi = (hi + Math.imul(ah2, bh7)) | 0; + lo = (lo + Math.imul(al1, bl8)) | 0; + mid = (mid + Math.imul(al1, bh8)) | 0; + mid = (mid + Math.imul(ah1, bl8)) | 0; + hi = (hi + Math.imul(ah1, bh8)) | 0; + lo = (lo + Math.imul(al0, bl9)) | 0; + mid = (mid + Math.imul(al0, bh9)) | 0; + mid = (mid + Math.imul(ah0, bl9)) | 0; + hi = (hi + Math.imul(ah0, bh9)) | 0; + var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; + w9 &= 0x3ffffff; + /* k = 10 */ + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = (mid + Math.imul(ah9, bl1)) | 0; + hi = Math.imul(ah9, bh1); + lo = (lo + Math.imul(al8, bl2)) | 0; + mid = (mid + Math.imul(al8, bh2)) | 0; + mid = (mid + Math.imul(ah8, bl2)) | 0; + hi = (hi + Math.imul(ah8, bh2)) | 0; + lo = (lo + Math.imul(al7, bl3)) | 0; + mid = (mid + Math.imul(al7, bh3)) | 0; + mid = (mid + Math.imul(ah7, bl3)) | 0; + hi = (hi + Math.imul(ah7, bh3)) | 0; + lo = (lo + Math.imul(al6, bl4)) | 0; + mid = (mid + Math.imul(al6, bh4)) | 0; + mid = (mid + Math.imul(ah6, bl4)) | 0; + hi = (hi + Math.imul(ah6, bh4)) | 0; + lo = (lo + Math.imul(al5, bl5)) | 0; + mid = (mid + Math.imul(al5, bh5)) | 0; + mid = (mid + Math.imul(ah5, bl5)) | 0; + hi = (hi + Math.imul(ah5, bh5)) | 0; + lo = (lo + Math.imul(al4, bl6)) | 0; + mid = (mid + Math.imul(al4, bh6)) | 0; + mid = (mid + Math.imul(ah4, bl6)) | 0; + hi = (hi + Math.imul(ah4, bh6)) | 0; + lo = (lo + Math.imul(al3, bl7)) | 0; + mid = (mid + Math.imul(al3, bh7)) | 0; + mid = (mid + Math.imul(ah3, bl7)) | 0; + hi = (hi + Math.imul(ah3, bh7)) | 0; + lo = (lo + Math.imul(al2, bl8)) | 0; + mid = (mid + Math.imul(al2, bh8)) | 0; + mid = (mid + Math.imul(ah2, bl8)) | 0; + hi = (hi + Math.imul(ah2, bh8)) | 0; + lo = (lo + Math.imul(al1, bl9)) | 0; + mid = (mid + Math.imul(al1, bh9)) | 0; + mid = (mid + Math.imul(ah1, bl9)) | 0; + hi = (hi + Math.imul(ah1, bh9)) | 0; + var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; + w10 &= 0x3ffffff; + /* k = 11 */ + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = (mid + Math.imul(ah9, bl2)) | 0; + hi = Math.imul(ah9, bh2); + lo = (lo + Math.imul(al8, bl3)) | 0; + mid = (mid + Math.imul(al8, bh3)) | 0; + mid = (mid + Math.imul(ah8, bl3)) | 0; + hi = (hi + Math.imul(ah8, bh3)) | 0; + lo = (lo + Math.imul(al7, bl4)) | 0; + mid = (mid + Math.imul(al7, bh4)) | 0; + mid = (mid + Math.imul(ah7, bl4)) | 0; + hi = (hi + Math.imul(ah7, bh4)) | 0; + lo = (lo + Math.imul(al6, bl5)) | 0; + mid = (mid + Math.imul(al6, bh5)) | 0; + mid = (mid + Math.imul(ah6, bl5)) | 0; + hi = (hi + Math.imul(ah6, bh5)) | 0; + lo = (lo + Math.imul(al5, bl6)) | 0; + mid = (mid + Math.imul(al5, bh6)) | 0; + mid = (mid + Math.imul(ah5, bl6)) | 0; + hi = (hi + Math.imul(ah5, bh6)) | 0; + lo = (lo + Math.imul(al4, bl7)) | 0; + mid = (mid + Math.imul(al4, bh7)) | 0; + mid = (mid + Math.imul(ah4, bl7)) | 0; + hi = (hi + Math.imul(ah4, bh7)) | 0; + lo = (lo + Math.imul(al3, bl8)) | 0; + mid = (mid + Math.imul(al3, bh8)) | 0; + mid = (mid + Math.imul(ah3, bl8)) | 0; + hi = (hi + Math.imul(ah3, bh8)) | 0; + lo = (lo + Math.imul(al2, bl9)) | 0; + mid = (mid + Math.imul(al2, bh9)) | 0; + mid = (mid + Math.imul(ah2, bl9)) | 0; + hi = (hi + Math.imul(ah2, bh9)) | 0; + var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; + w11 &= 0x3ffffff; + /* k = 12 */ + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = (mid + Math.imul(ah9, bl3)) | 0; + hi = Math.imul(ah9, bh3); + lo = (lo + Math.imul(al8, bl4)) | 0; + mid = (mid + Math.imul(al8, bh4)) | 0; + mid = (mid + Math.imul(ah8, bl4)) | 0; + hi = (hi + Math.imul(ah8, bh4)) | 0; + lo = (lo + Math.imul(al7, bl5)) | 0; + mid = (mid + Math.imul(al7, bh5)) | 0; + mid = (mid + Math.imul(ah7, bl5)) | 0; + hi = (hi + Math.imul(ah7, bh5)) | 0; + lo = (lo + Math.imul(al6, bl6)) | 0; + mid = (mid + Math.imul(al6, bh6)) | 0; + mid = (mid + Math.imul(ah6, bl6)) | 0; + hi = (hi + Math.imul(ah6, bh6)) | 0; + lo = (lo + Math.imul(al5, bl7)) | 0; + mid = (mid + Math.imul(al5, bh7)) | 0; + mid = (mid + Math.imul(ah5, bl7)) | 0; + hi = (hi + Math.imul(ah5, bh7)) | 0; + lo = (lo + Math.imul(al4, bl8)) | 0; + mid = (mid + Math.imul(al4, bh8)) | 0; + mid = (mid + Math.imul(ah4, bl8)) | 0; + hi = (hi + Math.imul(ah4, bh8)) | 0; + lo = (lo + Math.imul(al3, bl9)) | 0; + mid = (mid + Math.imul(al3, bh9)) | 0; + mid = (mid + Math.imul(ah3, bl9)) | 0; + hi = (hi + Math.imul(ah3, bh9)) | 0; + var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; + w12 &= 0x3ffffff; + /* k = 13 */ + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = (mid + Math.imul(ah9, bl4)) | 0; + hi = Math.imul(ah9, bh4); + lo = (lo + Math.imul(al8, bl5)) | 0; + mid = (mid + Math.imul(al8, bh5)) | 0; + mid = (mid + Math.imul(ah8, bl5)) | 0; + hi = (hi + Math.imul(ah8, bh5)) | 0; + lo = (lo + Math.imul(al7, bl6)) | 0; + mid = (mid + Math.imul(al7, bh6)) | 0; + mid = (mid + Math.imul(ah7, bl6)) | 0; + hi = (hi + Math.imul(ah7, bh6)) | 0; + lo = (lo + Math.imul(al6, bl7)) | 0; + mid = (mid + Math.imul(al6, bh7)) | 0; + mid = (mid + Math.imul(ah6, bl7)) | 0; + hi = (hi + Math.imul(ah6, bh7)) | 0; + lo = (lo + Math.imul(al5, bl8)) | 0; + mid = (mid + Math.imul(al5, bh8)) | 0; + mid = (mid + Math.imul(ah5, bl8)) | 0; + hi = (hi + Math.imul(ah5, bh8)) | 0; + lo = (lo + Math.imul(al4, bl9)) | 0; + mid = (mid + Math.imul(al4, bh9)) | 0; + mid = (mid + Math.imul(ah4, bl9)) | 0; + hi = (hi + Math.imul(ah4, bh9)) | 0; + var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; + w13 &= 0x3ffffff; + /* k = 14 */ + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = (mid + Math.imul(ah9, bl5)) | 0; + hi = Math.imul(ah9, bh5); + lo = (lo + Math.imul(al8, bl6)) | 0; + mid = (mid + Math.imul(al8, bh6)) | 0; + mid = (mid + Math.imul(ah8, bl6)) | 0; + hi = (hi + Math.imul(ah8, bh6)) | 0; + lo = (lo + Math.imul(al7, bl7)) | 0; + mid = (mid + Math.imul(al7, bh7)) | 0; + mid = (mid + Math.imul(ah7, bl7)) | 0; + hi = (hi + Math.imul(ah7, bh7)) | 0; + lo = (lo + Math.imul(al6, bl8)) | 0; + mid = (mid + Math.imul(al6, bh8)) | 0; + mid = (mid + Math.imul(ah6, bl8)) | 0; + hi = (hi + Math.imul(ah6, bh8)) | 0; + lo = (lo + Math.imul(al5, bl9)) | 0; + mid = (mid + Math.imul(al5, bh9)) | 0; + mid = (mid + Math.imul(ah5, bl9)) | 0; + hi = (hi + Math.imul(ah5, bh9)) | 0; + var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; + w14 &= 0x3ffffff; + /* k = 15 */ + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = (mid + Math.imul(ah9, bl6)) | 0; + hi = Math.imul(ah9, bh6); + lo = (lo + Math.imul(al8, bl7)) | 0; + mid = (mid + Math.imul(al8, bh7)) | 0; + mid = (mid + Math.imul(ah8, bl7)) | 0; + hi = (hi + Math.imul(ah8, bh7)) | 0; + lo = (lo + Math.imul(al7, bl8)) | 0; + mid = (mid + Math.imul(al7, bh8)) | 0; + mid = (mid + Math.imul(ah7, bl8)) | 0; + hi = (hi + Math.imul(ah7, bh8)) | 0; + lo = (lo + Math.imul(al6, bl9)) | 0; + mid = (mid + Math.imul(al6, bh9)) | 0; + mid = (mid + Math.imul(ah6, bl9)) | 0; + hi = (hi + Math.imul(ah6, bh9)) | 0; + var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; + w15 &= 0x3ffffff; + /* k = 16 */ + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = (mid + Math.imul(ah9, bl7)) | 0; + hi = Math.imul(ah9, bh7); + lo = (lo + Math.imul(al8, bl8)) | 0; + mid = (mid + Math.imul(al8, bh8)) | 0; + mid = (mid + Math.imul(ah8, bl8)) | 0; + hi = (hi + Math.imul(ah8, bh8)) | 0; + lo = (lo + Math.imul(al7, bl9)) | 0; + mid = (mid + Math.imul(al7, bh9)) | 0; + mid = (mid + Math.imul(ah7, bl9)) | 0; + hi = (hi + Math.imul(ah7, bh9)) | 0; + var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; + w16 &= 0x3ffffff; + /* k = 17 */ + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = (mid + Math.imul(ah9, bl8)) | 0; + hi = Math.imul(ah9, bh8); + lo = (lo + Math.imul(al8, bl9)) | 0; + mid = (mid + Math.imul(al8, bh9)) | 0; + mid = (mid + Math.imul(ah8, bl9)) | 0; + hi = (hi + Math.imul(ah8, bh9)) | 0; + var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; + w17 &= 0x3ffffff; + /* k = 18 */ + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = (mid + Math.imul(ah9, bl9)) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; + w18 &= 0x3ffffff; + o[0] = w0; + o[1] = w1; + o[2] = w2; + o[3] = w3; + o[4] = w4; + o[5] = w5; + o[6] = w6; + o[7] = w7; + o[8] = w8; + o[9] = w9; + o[10] = w10; + o[11] = w11; + o[12] = w12; + o[13] = w13; + o[14] = w14; + o[15] = w15; + o[16] = w16; + o[17] = w17; + o[18] = w18; + if (c !== 0) { + o[19] = c; + out.length++; + } + return out; + }; + + // Polyfill comb + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + + function bigMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + out.length = self.length + num.length; + + var carry = 0; + var hncarry = 0; + for (var k = 0; k < out.length - 1; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = k - j; + var a = self.words[i] | 0; + var b = num.words[j] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 0x3ffffff; + ncarry = (ncarry + (lo >>> 26)) | 0; + + hncarry += ncarry >>> 26; + ncarry &= 0x3ffffff; + } + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k] = carry; + } else { + out.length--; + } + + return out._strip(); + } + + function jumboMulTo (self, num, out) { + // Temporary disable, see https://github.com/indutny/bn.js/issues/211 + // var fftm = new FFTM(); + // return fftm.mulp(self, num, out); + return bigMulTo(self, num, out); + } + + BN.prototype.mulTo = function mulTo (num, out) { + var res; + var len = this.length + num.length; + if (this.length === 10 && num.length === 10) { + res = comb10MulTo(this, num, out); + } else if (len < 63) { + res = smallMulTo(this, num, out); + } else if (len < 1024) { + res = bigMulTo(this, num, out); + } else { + res = jumboMulTo(this, num, out); + } + + return res; + }; + + // Multiply `this` by `num` + BN.prototype.mul = function mul (num) { + var out = new BN(null); + out.words = new Array(this.length + num.length); + return this.mulTo(num, out); + }; + + // Multiply employing FFT + BN.prototype.mulf = function mulf (num) { + var out = new BN(null); + out.words = new Array(this.length + num.length); + return jumboMulTo(this, num, out); + }; + + // In-place Multiplication + BN.prototype.imul = function imul (num) { + return this.clone().mulTo(num, this); + }; + + BN.prototype.imuln = function imuln (num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + + assert(typeof num === 'number'); + assert(num < 0x4000000); + + // Carry + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = (this.words[i] | 0) * num; + var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); + carry >>= 26; + carry += (w / 0x4000000) | 0; + // NOTE: lo is 27bit maximum + carry += lo >>> 26; + this.words[i] = lo & 0x3ffffff; + } + + if (carry !== 0) { + this.words[i] = carry; + this.length++; + } + if (num === 0) { + this.length = 1; + this._normSign(); + } + + return isNegNum ? this.ineg() : this; + }; + + BN.prototype.muln = function muln (num) { + return this.clone().imuln(num); + }; + + // `this` * `this` + BN.prototype.sqr = function sqr () { + return this.mul(this); + }; + + // `this` * `this` in-place + BN.prototype.isqr = function isqr () { + return this.imul(this.clone()); + }; + + // Math.pow(`this`, `num`) + BN.prototype.pow = function pow (num) { + var w = toBitArray(num); + if (w.length === 0) return new BN(1); + + // Skip leading zeroes + var res = this; + for (var i = 0; i < w.length; i++, res = res.sqr()) { + if (w[i] !== 0) break; + } + + if (++i < w.length) { + for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { + if (w[i] === 0) continue; + + res = res.mul(q); + } + } + + return res; + }; + + // Shift-left in-place + BN.prototype.iushln = function iushln (bits) { + assert(typeof bits === 'number' && bits >= 0); + var r = bits % 26; + var s = (bits - r) / 26; + var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); + var i; + + if (r !== 0) { + var carry = 0; + + for (i = 0; i < this.length; i++) { + var newCarry = this.words[i] & carryMask; + var c = ((this.words[i] | 0) - newCarry) << r; + this.words[i] = c | carry; + carry = newCarry >>> (26 - r); + } + + if (carry) { + this.words[i] = carry; + this.length++; + } + } + + if (s !== 0) { + for (i = this.length - 1; i >= 0; i--) { + this.words[i + s] = this.words[i]; + } + + for (i = 0; i < s; i++) { + this.words[i] = 0; + } + + this.length += s; + } + + return this._strip(); + }; + + BN.prototype.ishln = function ishln (bits) { + // TODO(indutny): implement me + assert(this.negative === 0); + return this.iushln(bits); + }; + + // Shift-right in-place + // NOTE: `hint` is a lowest bit before trailing zeroes + // NOTE: if `extended` is present - it will be filled with destroyed bits + BN.prototype.iushrn = function iushrn (bits, hint, extended) { + assert(typeof bits === 'number' && bits >= 0); + var h; + if (hint) { + h = (hint - (hint % 26)) / 26; + } else { + h = 0; + } + + var r = bits % 26; + var s = Math.min((bits - r) / 26, this.length); + var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); + var maskedWords = extended; + + h -= s; + h = Math.max(0, h); + + // Extended mode, copy masked part + if (maskedWords) { + for (var i = 0; i < s; i++) { + maskedWords.words[i] = this.words[i]; + } + maskedWords.length = s; + } + + if (s === 0) ; else if (this.length > s) { + this.length -= s; + for (i = 0; i < this.length; i++) { + this.words[i] = this.words[i + s]; + } + } else { + this.words[0] = 0; + this.length = 1; + } + + var carry = 0; + for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { + var word = this.words[i] | 0; + this.words[i] = (carry << (26 - r)) | (word >>> r); + carry = word & mask; + } + + // Push carried bits as a mask + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + + if (this.length === 0) { + this.words[0] = 0; + this.length = 1; + } + + return this._strip(); + }; + + BN.prototype.ishrn = function ishrn (bits, hint, extended) { + // TODO(indutny): implement me + assert(this.negative === 0); + return this.iushrn(bits, hint, extended); + }; + + // Shift-left + BN.prototype.shln = function shln (bits) { + return this.clone().ishln(bits); + }; + + BN.prototype.ushln = function ushln (bits) { + return this.clone().iushln(bits); + }; + + // Shift-right + BN.prototype.shrn = function shrn (bits) { + return this.clone().ishrn(bits); + }; + + BN.prototype.ushrn = function ushrn (bits) { + return this.clone().iushrn(bits); + }; + + // Test if n bit is set + BN.prototype.testn = function testn (bit) { + assert(typeof bit === 'number' && bit >= 0); + var r = bit % 26; + var s = (bit - r) / 26; + var q = 1 << r; + + // Fast case: bit is much higher than all existing words + if (this.length <= s) return false; + + // Check bit and return + var w = this.words[s]; + + return !!(w & q); + }; + + // Return only lowers bits of number (in-place) + BN.prototype.imaskn = function imaskn (bits) { + assert(typeof bits === 'number' && bits >= 0); + var r = bits % 26; + var s = (bits - r) / 26; + + assert(this.negative === 0, 'imaskn works only with positive numbers'); + + if (this.length <= s) { + return this; + } + + if (r !== 0) { + s++; + } + this.length = Math.min(s, this.length); + + if (r !== 0) { + var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); + this.words[this.length - 1] &= mask; + } + + if (this.length === 0) { + this.words[0] = 0; + this.length = 1; + } + + return this._strip(); + }; + + // Return only lowers bits of number + BN.prototype.maskn = function maskn (bits) { + return this.clone().imaskn(bits); + }; + + // Add plain number `num` to `this` + BN.prototype.iaddn = function iaddn (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); + if (num < 0) return this.isubn(-num); + + // Possible sign change + if (this.negative !== 0) { + if (this.length === 1 && (this.words[0] | 0) <= num) { + this.words[0] = num - (this.words[0] | 0); + this.negative = 0; + return this; + } + + this.negative = 0; + this.isubn(num); + this.negative = 1; + return this; + } + + // Add without checks + return this._iaddn(num); + }; + + BN.prototype._iaddn = function _iaddn (num) { + this.words[0] += num; + + // Carry + for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { + this.words[i] -= 0x4000000; + if (i === this.length - 1) { + this.words[i + 1] = 1; + } else { + this.words[i + 1]++; + } + } + this.length = Math.max(this.length, i + 1); + + return this; + }; + + // Subtract plain number `num` from `this` + BN.prototype.isubn = function isubn (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); + if (num < 0) return this.iaddn(-num); + + if (this.negative !== 0) { + this.negative = 0; + this.iaddn(num); + this.negative = 1; + return this; + } + + this.words[0] -= num; + + if (this.length === 1 && this.words[0] < 0) { + this.words[0] = -this.words[0]; + this.negative = 1; + } else { + // Carry + for (var i = 0; i < this.length && this.words[i] < 0; i++) { + this.words[i] += 0x4000000; + this.words[i + 1] -= 1; + } + } + + return this._strip(); + }; + + BN.prototype.addn = function addn (num) { + return this.clone().iaddn(num); + }; + + BN.prototype.subn = function subn (num) { + return this.clone().isubn(num); + }; + + BN.prototype.iabs = function iabs () { + this.negative = 0; + + return this; + }; + + BN.prototype.abs = function abs () { + return this.clone().iabs(); + }; + + BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { + var len = num.length + shift; + var i; + + this._expand(len); + + var w; + var carry = 0; + for (i = 0; i < num.length; i++) { + w = (this.words[i + shift] | 0) + carry; + var right = (num.words[i] | 0) * mul; + w -= right & 0x3ffffff; + carry = (w >> 26) - ((right / 0x4000000) | 0); + this.words[i + shift] = w & 0x3ffffff; + } + for (; i < this.length - shift; i++) { + w = (this.words[i + shift] | 0) + carry; + carry = w >> 26; + this.words[i + shift] = w & 0x3ffffff; + } + + if (carry === 0) return this._strip(); + + // Subtraction overflow + assert(carry === -1); + carry = 0; + for (i = 0; i < this.length; i++) { + w = -(this.words[i] | 0) + carry; + carry = w >> 26; + this.words[i] = w & 0x3ffffff; + } + this.negative = 1; + + return this._strip(); + }; + + BN.prototype._wordDiv = function _wordDiv (num, mode) { + var shift = this.length - num.length; + + var a = this.clone(); + var b = num; + + // Normalize + var bhi = b.words[b.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b = b.ushln(shift); + a.iushln(shift); + bhi = b.words[b.length - 1] | 0; + } + + // Initialize quotient + var m = a.length - b.length; + var q; + + if (mode !== 'mod') { + q = new BN(null); + q.length = m + 1; + q.words = new Array(q.length); + for (var i = 0; i < q.length; i++) { + q.words[i] = 0; + } + } + + var diff = a.clone()._ishlnsubmul(b, 1, m); + if (diff.negative === 0) { + a = diff; + if (q) { + q.words[m] = 1; + } + } + + for (var j = m - 1; j >= 0; j--) { + var qj = (a.words[b.length + j] | 0) * 0x4000000 + + (a.words[b.length + j - 1] | 0); + + // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max + // (0x7ffffff) + qj = Math.min((qj / bhi) | 0, 0x3ffffff); + + a._ishlnsubmul(b, qj, j); + while (a.negative !== 0) { + qj--; + a.negative = 0; + a._ishlnsubmul(b, 1, j); + if (!a.isZero()) { + a.negative ^= 1; + } + } + if (q) { + q.words[j] = qj; + } + } + if (q) { + q._strip(); + } + a._strip(); + + // Denormalize + if (mode !== 'div' && shift !== 0) { + a.iushrn(shift); + } + + return { + div: q || null, + mod: a + }; + }; + + // NOTE: 1) `mode` can be set to `mod` to request mod only, + // to `div` to request div only, or be absent to + // request both div & mod + // 2) `positive` is true if unsigned mod is requested + BN.prototype.divmod = function divmod (num, mode, positive) { + assert(!num.isZero()); + + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + + var div, mod, res; + if (this.negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + + if (mode !== 'mod') { + div = res.div.neg(); + } + + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.iadd(num); + } + } + + return { + div: div, + mod: mod + }; + } + + if (this.negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + + if (mode !== 'mod') { + div = res.div.neg(); + } + + return { + div: div, + mod: res.mod + }; + } + + if ((this.negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.isub(num); + } + } + + return { + div: res.div, + mod: mod + }; + } + + // Both numbers are positive at this point + + // Strip both numbers to approximate shift value + if (num.length > this.length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this + }; + } + + // Very short reduction + if (num.length === 1) { + if (mode === 'div') { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + + if (mode === 'mod') { + return { + div: null, + mod: new BN(this.modrn(num.words[0])) + }; + } + + return { + div: this.divn(num.words[0]), + mod: new BN(this.modrn(num.words[0])) + }; + } + + return this._wordDiv(num, mode); + }; + + // Find `this` / `num` + BN.prototype.div = function div (num) { + return this.divmod(num, 'div', false).div; + }; + + // Find `this` % `num` + BN.prototype.mod = function mod (num) { + return this.divmod(num, 'mod', false).mod; + }; + + BN.prototype.umod = function umod (num) { + return this.divmod(num, 'mod', true).mod; + }; + + // Find Round(`this` / `num`) + BN.prototype.divRound = function divRound (num) { + var dm = this.divmod(num); + + // Fast case - exact division + if (dm.mod.isZero()) return dm.div; + + var mod = dm.mod.abs(); + + var half = num.abs().iushrn(1); + var r2 = num.words[0] & 1; + var cmp = mod.cmp(half); + + // Round down + if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div; + + // Round up, away from zero + var up = new BN(1); + up.negative = this.negative ^ num.negative; + return dm.div.iadd(up); + }; + + BN.prototype.modrn = function modrn (num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + + assert(num <= 0x3ffffff); + var p = (1 << 26) % num; + + var acc = 0; + for (var i = this.length - 1; i >= 0; i--) { + acc = (p * acc + (this.words[i] | 0)) % num; + } + + return isNegNum ? -acc : acc; + }; + + // WARNING: DEPRECATED + BN.prototype.modn = function modn (num) { + return this.modrn(num); + }; + + // In-place division by number + BN.prototype.idivn = function idivn (num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + + assert(num <= 0x3ffffff); + + var carry = 0; + for (var i = this.length - 1; i >= 0; i--) { + var w = (this.words[i] | 0) + carry * 0x4000000; + this.words[i] = (w / num) | 0; + carry = w % num; + } + + this._strip(); + return isNegNum ? this.ineg() : this; + }; + + BN.prototype.divn = function divn (num) { + return this.clone().idivn(num); + }; + + BN.prototype.egcd = function egcd (p) { + assert(p.negative === 0); + assert(!p.isZero()); + + var x = this; + var y = p.clone(); + + if (x.negative !== 0) { + x = x.umod(p); + } else { + x = x.clone(); + } + + // A * x + B * y = x + var A = new BN(1); + var B = new BN(0); + + // C * x + D * y = y + var C = new BN(0); + var D = new BN(1); + + var g = 0; + + while (x.isEven() && y.isEven()) { + x.iushrn(1); + y.iushrn(1); + ++g; + } + + var yp = y.clone(); + var xp = x.clone(); + + while (!x.isZero()) { + for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); + if (i > 0) { + x.iushrn(i); + while (i-- > 0) { + if (A.isOdd() || B.isOdd()) { + A.iadd(yp); + B.isub(xp); + } + + A.iushrn(1); + B.iushrn(1); + } + } + + for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); + if (j > 0) { + y.iushrn(j); + while (j-- > 0) { + if (C.isOdd() || D.isOdd()) { + C.iadd(yp); + D.isub(xp); + } + + C.iushrn(1); + D.iushrn(1); + } + } + + if (x.cmp(y) >= 0) { + x.isub(y); + A.isub(C); + B.isub(D); + } else { + y.isub(x); + C.isub(A); + D.isub(B); + } + } + + return { + a: C, + b: D, + gcd: y.iushln(g) + }; + }; + + // This is reduced incarnation of the binary EEA + // above, designated to invert members of the + // _prime_ fields F(p) at a maximal speed + BN.prototype._invmp = function _invmp (p) { + assert(p.negative === 0); + assert(!p.isZero()); + + var a = this; + var b = p.clone(); + + if (a.negative !== 0) { + a = a.umod(p); + } else { + a = a.clone(); + } + + var x1 = new BN(1); + var x2 = new BN(0); + + var delta = b.clone(); + + while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { + for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); + if (i > 0) { + a.iushrn(i); + while (i-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + + x1.iushrn(1); + } + } + + for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); + if (j > 0) { + b.iushrn(j); + while (j-- > 0) { + if (x2.isOdd()) { + x2.iadd(delta); + } + + x2.iushrn(1); + } + } + + if (a.cmp(b) >= 0) { + a.isub(b); + x1.isub(x2); + } else { + b.isub(a); + x2.isub(x1); + } + } + + var res; + if (a.cmpn(1) === 0) { + res = x1; + } else { + res = x2; + } + + if (res.cmpn(0) < 0) { + res.iadd(p); + } + + return res; + }; + + BN.prototype.gcd = function gcd (num) { + if (this.isZero()) return num.abs(); + if (num.isZero()) return this.abs(); + + var a = this.clone(); + var b = num.clone(); + a.negative = 0; + b.negative = 0; + + // Remove common factor of two + for (var shift = 0; a.isEven() && b.isEven(); shift++) { + a.iushrn(1); + b.iushrn(1); + } + + do { + while (a.isEven()) { + a.iushrn(1); + } + while (b.isEven()) { + b.iushrn(1); + } + + var r = a.cmp(b); + if (r < 0) { + // Swap `a` and `b` to make `a` always bigger than `b` + var t = a; + a = b; + b = t; + } else if (r === 0 || b.cmpn(1) === 0) { + break; + } + + a.isub(b); + } while (true); + + return b.iushln(shift); + }; + + // Invert number in the field F(num) + BN.prototype.invm = function invm (num) { + return this.egcd(num).a.umod(num); + }; + + BN.prototype.isEven = function isEven () { + return (this.words[0] & 1) === 0; + }; + + BN.prototype.isOdd = function isOdd () { + return (this.words[0] & 1) === 1; + }; + + // And first word and num + BN.prototype.andln = function andln (num) { + return this.words[0] & num; + }; + + // Increment at the bit position in-line + BN.prototype.bincn = function bincn (bit) { + assert(typeof bit === 'number'); + var r = bit % 26; + var s = (bit - r) / 26; + var q = 1 << r; + + // Fast case: bit is much higher than all existing words + if (this.length <= s) { + this._expand(s + 1); + this.words[s] |= q; + return this; + } + + // Add bit and propagate, if needed + var carry = q; + for (var i = s; carry !== 0 && i < this.length; i++) { + var w = this.words[i] | 0; + w += carry; + carry = w >>> 26; + w &= 0x3ffffff; + this.words[i] = w; + } + if (carry !== 0) { + this.words[i] = carry; + this.length++; + } + return this; + }; + + BN.prototype.isZero = function isZero () { + return this.length === 1 && this.words[0] === 0; + }; + + BN.prototype.cmpn = function cmpn (num) { + var negative = num < 0; + + if (this.negative !== 0 && !negative) return -1; + if (this.negative === 0 && negative) return 1; + + this._strip(); + + var res; + if (this.length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + + assert(num <= 0x3ffffff, 'Number is too big'); + + var w = this.words[0] | 0; + res = w === num ? 0 : w < num ? -1 : 1; + } + if (this.negative !== 0) return -res | 0; + return res; + }; + + // Compare two numbers and return: + // 1 - if `this` > `num` + // 0 - if `this` == `num` + // -1 - if `this` < `num` + BN.prototype.cmp = function cmp (num) { + if (this.negative !== 0 && num.negative === 0) return -1; + if (this.negative === 0 && num.negative !== 0) return 1; + + var res = this.ucmp(num); + if (this.negative !== 0) return -res | 0; + return res; + }; + + // Unsigned comparison + BN.prototype.ucmp = function ucmp (num) { + // At this point both numbers have the same sign + if (this.length > num.length) return 1; + if (this.length < num.length) return -1; + + var res = 0; + for (var i = this.length - 1; i >= 0; i--) { + var a = this.words[i] | 0; + var b = num.words[i] | 0; + + if (a === b) continue; + if (a < b) { + res = -1; + } else if (a > b) { + res = 1; + } + break; + } + return res; + }; + + BN.prototype.gtn = function gtn (num) { + return this.cmpn(num) === 1; + }; + + BN.prototype.gt = function gt (num) { + return this.cmp(num) === 1; + }; + + BN.prototype.gten = function gten (num) { + return this.cmpn(num) >= 0; + }; + + BN.prototype.gte = function gte (num) { + return this.cmp(num) >= 0; + }; + + BN.prototype.ltn = function ltn (num) { + return this.cmpn(num) === -1; + }; + + BN.prototype.lt = function lt (num) { + return this.cmp(num) === -1; + }; + + BN.prototype.lten = function lten (num) { + return this.cmpn(num) <= 0; + }; + + BN.prototype.lte = function lte (num) { + return this.cmp(num) <= 0; + }; + + BN.prototype.eqn = function eqn (num) { + return this.cmpn(num) === 0; + }; + + BN.prototype.eq = function eq (num) { + return this.cmp(num) === 0; + }; + + // + // A reduce context, could be using montgomery or something better, depending + // on the `m` itself. + // + BN.red = function red (num) { + return new Red(num); + }; + + BN.prototype.toRed = function toRed (ctx) { + assert(!this.red, 'Already a number in reduction context'); + assert(this.negative === 0, 'red works only with positives'); + return ctx.convertTo(this)._forceRed(ctx); + }; + + BN.prototype.fromRed = function fromRed () { + assert(this.red, 'fromRed works only with numbers in reduction context'); + return this.red.convertFrom(this); + }; + + BN.prototype._forceRed = function _forceRed (ctx) { + this.red = ctx; + return this; + }; + + BN.prototype.forceRed = function forceRed (ctx) { + assert(!this.red, 'Already a number in reduction context'); + return this._forceRed(ctx); + }; + + BN.prototype.redAdd = function redAdd (num) { + assert(this.red, 'redAdd works only with red numbers'); + return this.red.add(this, num); + }; + + BN.prototype.redIAdd = function redIAdd (num) { + assert(this.red, 'redIAdd works only with red numbers'); + return this.red.iadd(this, num); + }; + + BN.prototype.redSub = function redSub (num) { + assert(this.red, 'redSub works only with red numbers'); + return this.red.sub(this, num); + }; + + BN.prototype.redISub = function redISub (num) { + assert(this.red, 'redISub works only with red numbers'); + return this.red.isub(this, num); + }; + + BN.prototype.redShl = function redShl (num) { + assert(this.red, 'redShl works only with red numbers'); + return this.red.shl(this, num); + }; + + BN.prototype.redMul = function redMul (num) { + assert(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.mul(this, num); + }; + + BN.prototype.redIMul = function redIMul (num) { + assert(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.imul(this, num); + }; + + BN.prototype.redSqr = function redSqr () { + assert(this.red, 'redSqr works only with red numbers'); + this.red._verify1(this); + return this.red.sqr(this); + }; + + BN.prototype.redISqr = function redISqr () { + assert(this.red, 'redISqr works only with red numbers'); + this.red._verify1(this); + return this.red.isqr(this); + }; + + // Square root over p + BN.prototype.redSqrt = function redSqrt () { + assert(this.red, 'redSqrt works only with red numbers'); + this.red._verify1(this); + return this.red.sqrt(this); + }; + + BN.prototype.redInvm = function redInvm () { + assert(this.red, 'redInvm works only with red numbers'); + this.red._verify1(this); + return this.red.invm(this); + }; + + // Return negative clone of `this` % `red modulo` + BN.prototype.redNeg = function redNeg () { + assert(this.red, 'redNeg works only with red numbers'); + this.red._verify1(this); + return this.red.neg(this); + }; + + BN.prototype.redPow = function redPow (num) { + assert(this.red && !num.red, 'redPow(normalNum)'); + this.red._verify1(this); + return this.red.pow(this, num); + }; + + // Prime numbers with efficient reduction + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + + // Pseudo-Mersenne prime + function MPrime (name, p) { + // P = 2 ^ N - K + this.name = name; + this.p = new BN(p, 16); + this.n = this.p.bitLength(); + this.k = new BN(1).iushln(this.n).isub(this.p); + + this.tmp = this._tmp(); + } + + MPrime.prototype._tmp = function _tmp () { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil(this.n / 13)); + return tmp; + }; + + MPrime.prototype.ireduce = function ireduce (num) { + // Assumes that `num` is less than `P^2` + // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) + var r = num; + var rlen; + + do { + this.split(r, this.tmp); + r = this.imulK(r); + r = r.iadd(this.tmp); + rlen = r.bitLength(); + } while (rlen > this.n); + + var cmp = rlen < this.n ? -1 : r.ucmp(this.p); + if (cmp === 0) { + r.words[0] = 0; + r.length = 1; + } else if (cmp > 0) { + r.isub(this.p); + } else { + if (r.strip !== undefined) { + // r is a BN v4 instance + r.strip(); + } else { + // r is a BN v5 instance + r._strip(); + } + } + + return r; + }; + + MPrime.prototype.split = function split (input, out) { + input.iushrn(this.n, 0, out); + }; + + MPrime.prototype.imulK = function imulK (num) { + return num.imul(this.k); + }; + + function K256 () { + MPrime.call( + this, + 'k256', + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); + } + inherits(K256, MPrime); + + K256.prototype.split = function split (input, output) { + // 256 = 9 * 26 + 22 + var mask = 0x3fffff; + + var outLen = Math.min(input.length, 9); + for (var i = 0; i < outLen; i++) { + output.words[i] = input.words[i]; + } + output.length = outLen; + + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + + // Shift by 9 limbs + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + + for (i = 10; i < input.length; i++) { + var next = input.words[i] | 0; + input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); + prev = next; + } + prev >>>= 22; + input.words[i - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + + K256.prototype.imulK = function imulK (num) { + // K = 0x1000003d1 = [ 0x40, 0x3d1 ] + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + + // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 + var lo = 0; + for (var i = 0; i < num.length; i++) { + var w = num.words[i] | 0; + lo += w * 0x3d1; + num.words[i] = lo & 0x3ffffff; + lo = w * 0x40 + ((lo / 0x4000000) | 0); + } + + // Fast length reduction + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + + function P224 () { + MPrime.call( + this, + 'p224', + 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); + } + inherits(P224, MPrime); + + function P192 () { + MPrime.call( + this, + 'p192', + 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); + } + inherits(P192, MPrime); + + function P25519 () { + // 2 ^ 255 - 19 + MPrime.call( + this, + '25519', + '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); + } + inherits(P25519, MPrime); + + P25519.prototype.imulK = function imulK (num) { + // K = 0x13 + var carry = 0; + for (var i = 0; i < num.length; i++) { + var hi = (num.words[i] | 0) * 0x13 + carry; + var lo = hi & 0x3ffffff; + hi >>>= 26; + + num.words[i] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + + // Exported mostly for testing purposes, use plain name instead + BN._prime = function prime (name) { + // Cached version of prime + if (primes[name]) return primes[name]; + + var prime; + if (name === 'k256') { + prime = new K256(); + } else if (name === 'p224') { + prime = new P224(); + } else if (name === 'p192') { + prime = new P192(); + } else if (name === 'p25519') { + prime = new P25519(); + } else { + throw new Error('Unknown prime ' + name); + } + primes[name] = prime; + + return prime; + }; + + // + // Base reduction engine + // + function Red (m) { + if (typeof m === 'string') { + var prime = BN._prime(m); + this.m = prime.p; + this.prime = prime; + } else { + assert(m.gtn(1), 'modulus must be greater than 1'); + this.m = m; + this.prime = null; + } + } + + Red.prototype._verify1 = function _verify1 (a) { + assert(a.negative === 0, 'red works only with positives'); + assert(a.red, 'red works only with red numbers'); + }; + + Red.prototype._verify2 = function _verify2 (a, b) { + assert((a.negative | b.negative) === 0, 'red works only with positives'); + assert(a.red && a.red === b.red, + 'red works only with red numbers'); + }; + + Red.prototype.imod = function imod (a) { + if (this.prime) return this.prime.ireduce(a)._forceRed(this); + + move(a, a.umod(this.m)._forceRed(this)); + return a; + }; + + Red.prototype.neg = function neg (a) { + if (a.isZero()) { + return a.clone(); + } + + return this.m.sub(a)._forceRed(this); + }; + + Red.prototype.add = function add (a, b) { + this._verify2(a, b); + + var res = a.add(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res._forceRed(this); + }; + + Red.prototype.iadd = function iadd (a, b) { + this._verify2(a, b); + + var res = a.iadd(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res; + }; + + Red.prototype.sub = function sub (a, b) { + this._verify2(a, b); + + var res = a.sub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res._forceRed(this); + }; + + Red.prototype.isub = function isub (a, b) { + this._verify2(a, b); + + var res = a.isub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res; + }; + + Red.prototype.shl = function shl (a, num) { + this._verify1(a); + return this.imod(a.ushln(num)); + }; + + Red.prototype.imul = function imul (a, b) { + this._verify2(a, b); + return this.imod(a.imul(b)); + }; + + Red.prototype.mul = function mul (a, b) { + this._verify2(a, b); + return this.imod(a.mul(b)); + }; + + Red.prototype.isqr = function isqr (a) { + return this.imul(a, a.clone()); + }; + + Red.prototype.sqr = function sqr (a) { + return this.mul(a, a); + }; + + Red.prototype.sqrt = function sqrt (a) { + if (a.isZero()) return a.clone(); + + var mod3 = this.m.andln(3); + assert(mod3 % 2 === 1); + + // Fast case + if (mod3 === 3) { + var pow = this.m.add(new BN(1)).iushrn(2); + return this.pow(a, pow); + } + + // Tonelli-Shanks algorithm (Totally unoptimized and slow) + // + // Find Q and S, that Q * 2 ^ S = (P - 1) + var q = this.m.subn(1); + var s = 0; + while (!q.isZero() && q.andln(1) === 0) { + s++; + q.iushrn(1); + } + assert(!q.isZero()); + + var one = new BN(1).toRed(this); + var nOne = one.redNeg(); + + // Find quadratic non-residue + // NOTE: Max is such because of generalized Riemann hypothesis. + var lpow = this.m.subn(1).iushrn(1); + var z = this.m.bitLength(); + z = new BN(2 * z * z).toRed(this); + + while (this.pow(z, lpow).cmp(nOne) !== 0) { + z.redIAdd(nOne); + } + + var c = this.pow(z, q); + var r = this.pow(a, q.addn(1).iushrn(1)); + var t = this.pow(a, q); + var m = s; + while (t.cmp(one) !== 0) { + var tmp = t; + for (var i = 0; tmp.cmp(one) !== 0; i++) { + tmp = tmp.redSqr(); + } + assert(i < m); + var b = this.pow(c, new BN(1).iushln(m - i - 1)); + + r = r.redMul(b); + c = b.redSqr(); + t = t.redMul(c); + m = i; + } + + return r; + }; + + Red.prototype.invm = function invm (a) { + var inv = a._invmp(this.m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + + Red.prototype.pow = function pow (a, num) { + if (num.isZero()) return new BN(1).toRed(this); + if (num.cmpn(1) === 0) return a.clone(); + + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this); + wnd[1] = a; + for (var i = 2; i < wnd.length; i++) { + wnd[i] = this.mul(wnd[i - 1], a); + } + + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + + for (i = num.length - 1; i >= 0; i--) { + var word = num.words[i]; + for (var j = start - 1; j >= 0; j--) { + var bit = (word >> j) & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; + + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + + return res; + }; + + Red.prototype.convertTo = function convertTo (num) { + var r = num.umod(this.m); + + return r === num ? r.clone() : r; + }; + + Red.prototype.convertFrom = function convertFrom (num) { + var res = num.clone(); + res.red = null; + return res; + }; + + // + // Montgomery method engine + // + + BN.mont = function mont (num) { + return new Mont(num); + }; + + function Mont (m) { + Red.call(this, m); + + this.shift = this.m.bitLength(); + if (this.shift % 26 !== 0) { + this.shift += 26 - (this.shift % 26); + } + + this.r = new BN(1).iushln(this.shift); + this.r2 = this.imod(this.r.sqr()); + this.rinv = this.r._invmp(this.m); + + this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); + this.minv = this.minv.umod(this.r); + this.minv = this.r.sub(this.minv); + } + inherits(Mont, Red); + + Mont.prototype.convertTo = function convertTo (num) { + return this.imod(num.ushln(this.shift)); + }; + + Mont.prototype.convertFrom = function convertFrom (num) { + var r = this.imod(num.mul(this.rinv)); + r.red = null; + return r; + }; + + Mont.prototype.imul = function imul (a, b) { + if (a.isZero() || b.isZero()) { + a.words[0] = 0; + a.length = 1; + return a; + } + + var t = a.imul(b); + var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u = t.isub(c).iushrn(this.shift); + var res = u; + + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + + return res._forceRed(this); + }; + + Mont.prototype.mul = function mul (a, b) { + if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); + + var t = a.mul(b); + var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u = t.isub(c).iushrn(this.shift); + var res = u; + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + + return res._forceRed(this); + }; + + Mont.prototype.invm = function invm (a) { + // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R + var res = this.imod(a._invmp(this.m).mul(this.r2)); + return res._forceRed(this); + }; + })(module, bn$1); + } (bn$2)); + return bn$2.exports; +} + +var bnExports = requireBn$1(); +var _BN = /*@__PURE__*/getDefaultExportFromCjs(bnExports); + +let _permanentCensorErrors = false; +let _censorErrors = false; +const LogLevels = { + debug: 1, + default: 2, + info: 2, + warning: 3, + error: 4, + off: 5, +}; +let _logLevel = LogLevels["default"]; +let _globalLogger = null; +function _checkNormalize() { + try { + const missing = []; + // Make sure all forms of normalization are supported + ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { + try { + if ("test".normalize(form) !== "test") { + throw new Error("bad normalize"); + } + } + catch (error) { + missing.push(form); + } + }); + if (missing.length) { + throw new Error("missing " + missing.join(", ")); + } + if (String.fromCharCode(0xe9).normalize("NFD") !== + String.fromCharCode(0x65, 0x0301)) { + throw new Error("broken implementation"); + } + } + catch (error) { + return error.message; + } + return null; +} +const _normalizeError = _checkNormalize(); +var LogLevel; +(function (LogLevel) { + LogLevel["DEBUG"] = "DEBUG"; + LogLevel["INFO"] = "INFO"; + LogLevel["WARNING"] = "WARNING"; + LogLevel["ERROR"] = "ERROR"; + LogLevel["OFF"] = "OFF"; +})(LogLevel || (LogLevel = {})); +var ErrorCode; +(function (ErrorCode) { + /////////////////// + // Generic Errors + // Unknown Error + ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR"; + // Not Implemented + ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED"; + // Unsupported Operation + // - operation + ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION"; + // Network Error (i.e. Core Network, such as an invalid network ID) + // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) + ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR"; + // Some sort of bad response from the server + ErrorCode["SERVER_ERROR"] = "SERVER_ERROR"; + // Timeout + ErrorCode["TIMEOUT"] = "TIMEOUT"; + /////////////////// + // Operational Errors + // Buffer Overrun + ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN"; + // Numeric Fault + // - operation: the operation being executed + // - fault: the reason this faulted + ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT"; + /////////////////// + // Argument Errors + // Missing new operator to an object + // - name: The name of the class + ErrorCode["MISSING_NEW"] = "MISSING_NEW"; + // Invalid argument (e.g. value is incompatible with type) to a function: + // - argument: The argument name that was invalid + // - value: The value of the argument + ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT"; + // Missing argument to a function: + // - count: The number of arguments received + // - expectedCount: The number of arguments expected + ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT"; + // Too many arguments + // - count: The number of arguments received + // - expectedCount: The number of arguments expected + ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT"; + /////////////////// + // Blockchain Errors + // Call exception + // - transaction: the transaction + // - address?: the contract address + // - args?: The arguments passed into the function + // - method?: The Solidity method signature + // - errorSignature?: The EIP848 error signature + // - errorArgs?: The EIP848 error parameters + // - reason: The reason (only for EIP848 "Error(string)") + ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION"; + // Insufficient funds (< value + energyLimit * energyPrice) + // - transaction: the transaction attempted + ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS"; + // Nonce has already been used + // - transaction: the transaction attempted + ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED"; + // The replacement fee for the transaction is too low + // - transaction: the transaction attempted + ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED"; + // The energy limit could not be estimated + // - transaction: the transaction passed to estimateEnergy + ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"] = "UNPREDICTABLE_ENERGY_LIMIT"; + // The transaction was replaced by one with a higher energy price + // - reason: "cancelled", "replaced" or "repriced" + // - cancelled: true if reason == "cancelled" or reason == "replaced") + // - hash: original transaction hash + // - replacement: the full TransactionsResponse for the replacement + // - receipt: the receipt of the replacement + ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; +})(ErrorCode || (ErrorCode = {})); +const HEX = "0123456789abcdef"; +class Logger { + version = "0.0.1"; + static errors = ErrorCode; + static levels = LogLevel; + constructor(version) { + Object.defineProperty(this, "version", { + enumerable: true, + value: version, + writable: false, + }); + } + _log(logLevel, args) { + const level = logLevel.toLowerCase(); + if (LogLevels[level] == null) { + this.throwArgumentError("invalid log level name", "logLevel", logLevel); + } + if (_logLevel > LogLevels[level]) { + return; + } + console.log.apply(console, args); + } + debug(...args) { + this._log(Logger.levels.DEBUG, args); + } + info(...args) { + this._log(Logger.levels.INFO, args); + } + warn(...args) { + this._log(Logger.levels.WARNING, args); + } + makeError(message, code, params) { + // Errors are being censored + if (_censorErrors) { + return this.makeError("censored error", code, {}); + } + if (!code) { + code = Logger.errors.UNKNOWN_ERROR; + } + if (!params) { + params = {}; + } + const messageDetails = []; + Object.keys(params).forEach((key) => { + const value = params[key]; + try { + if (value instanceof Uint8Array) { + let hex = ""; + for (let i = 0; i < value.length; i++) { + hex += HEX[value[i] >> 4]; + hex += HEX[value[i] & 0x0f]; + } + messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); + } + else { + messageDetails.push(key + "=" + JSON.stringify(value)); + } + } + catch (error) { + messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); + } + }); + messageDetails.push(`code=${code}`); + messageDetails.push(`version=${this.version}`); + const reason = message; + if (messageDetails.length) { + message += " (" + messageDetails.join(", ") + ")"; + } + // @TODO: Any?? + const error = new Error(message); + error.reason = reason; + error.code = code; + Object.keys(params).forEach(function (key) { + error[key] = params[key]; + }); + return error; + } + throwError(message, code, params) { + throw this.makeError(message, code, params); + } + throwArgumentError(message, name, value) { + return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { + argument: name, + value: value, + }); + } + assert(condition, message, code, params) { + if (!!condition) { + return; + } + this.throwError(message, code, params); + } + assertArgument(condition, message, name, value) { + if (!!condition) { + return; + } + this.throwArgumentError(message, name, value); + } + checkNormalize(message) { + if (_normalizeError) { + this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { + operation: "String.prototype.normalize", + form: _normalizeError, + }); + } + } + checkSafeUint53(value, message) { + if (typeof value !== "number") { + return; + } + if (message == null) { + message = "value not safe"; + } + if (value < 0 || value >= 0x1fffffffffffff) { + this.throwError(message, Logger.errors.NUMERIC_FAULT, { + operation: "checkSafeInteger", + fault: "out-of-safe-range", + value: value, + }); + } + if (value % 1) { + this.throwError(message, Logger.errors.NUMERIC_FAULT, { + operation: "checkSafeInteger", + fault: "non-integer", + value: value, + }); + } + } + checkArgumentCount(count, expectedCount, message) { + if (message) { + message = ": " + message; + } + else { + message = ""; + } + if (count < expectedCount) { + this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, { + count: count, + expectedCount: expectedCount, + }); + } + if (count > expectedCount) { + this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, { + count: count, + expectedCount: expectedCount, + }); + } + } + checkNew(target, kind) { + if (target === Object || target == null) { + this.throwError("missing new", Logger.errors.MISSING_NEW, { + name: kind.name, + }); + } + } + checkAbstract(target, kind) { + if (target === kind) { + this.throwError("cannot instantiate abstract class " + + JSON.stringify(kind.name) + + " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }); + } + else if (target === Object || target == null) { + this.throwError("missing new", Logger.errors.MISSING_NEW, { + name: kind.name, + }); + } + } + static globalLogger() { + if (!_globalLogger) { + _globalLogger = new Logger("logger/0.0.1"); + } + return _globalLogger; + } + static setCensorship(censorship, permanent) { + if (!censorship && permanent) { + this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, { + operation: "setCensorship", + }); + } + if (_permanentCensorErrors) { + if (!censorship) { + return; + } + this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, { + operation: "setCensorship", + }); + } + _censorErrors = !!censorship; + _permanentCensorErrors = !!permanent; + } + static setLogLevel(logLevel) { + const level = LogLevels[logLevel.toLowerCase()]; + if (level == null) { + Logger.globalLogger().warn("invalid log level - " + logLevel); + return; + } + _logLevel = level; + } + static from(version) { + return new Logger(version); + } +} + +/** + * Property helper functions. + * + * @_subsection api/utils:Properties [about-properties] + */ +const logger$7 = new Logger("utils/properties/0.0.1"); +function checkType(value, type, name) { + const types = type.split("|").map((t) => t.trim()); + for (let i = 0; i < types.length; i++) { + switch (type) { + case "any": + return; + case "bigint": + case "boolean": + case "number": + case "string": + if (typeof value === type) { + return; + } + } + } + const error = new Error(`invalid value for type ${type}`); + error.code = "INVALID_ARGUMENT"; + error.argument = `value.${name}`; + error.value = value; + throw error; +} +/** + * Resolves to a new object that is a copy of %%value%%, but with all + * values resolved. + */ +async function resolveProperties(value) { + const keys = Object.keys(value); + const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); + return results.reduce((accum, v, index) => { + accum[keys[index]] = v; + return accum; + }, {}); +} +/** + * Assigns the %%values%% to %%target%% as read-only values. + * + * It %%types%% is specified, the values are checked. + */ +function defineProperties(target, values, types) { + for (let key in values) { + let value = values[key]; + const type = types ? types[key] : null; + if (type) { + checkType(value, type, key); + } + Object.defineProperty(target, key, { + enumerable: true, + value, + writable: false, + }); + } +} +function checkProperties(object, properties) { + if (!object || typeof object !== "object") { + logger$7.throwArgumentError("invalid object", "object", object); + } + Object.keys(object).forEach((key) => { + if (!properties[key]) { + logger$7.throwArgumentError("invalid object key - " + key, "transaction:" + key, object); + } + }); +} + +/** + * About Errors. + * + * @_section: api/utils/errors:Errors [about-errors] + */ +function stringify$1(value) { + if (value == null) { + return "null"; + } + if (Array.isArray(value)) { + return "[ " + value.map(stringify$1).join(", ") + " ]"; + } + if (value instanceof Uint8Array) { + const HEX = "0123456789abcdef"; + let result = "0x"; + for (let i = 0; i < value.length; i++) { + result += HEX[value[i] >> 4]; + result += HEX[value[i] & 0xf]; + } + return result; + } + if (typeof value === "object" && typeof value.toJSON === "function") { + return stringify$1(value.toJSON()); + } + switch (typeof value) { + case "boolean": + case "symbol": + return value.toString(); + case "bigint": + return BigInt(value).toString(); + case "number": + return value.toString(); + case "string": + return JSON.stringify(value); + case "object": { + const keys = Object.keys(value); + keys.sort(); + return ("{ " + + keys.map((k) => `${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ") + + " }"); + } + } + return `[ COULD NOT SERIALIZE ]`; +} +/** + * Returns true if the %%error%% matches an error thrown by corebc + * that matches the error %%code%%. + * + * In TypeScript envornoments, this can be used to check that %%error%% + * matches an corebcError type, which means the expected properties will + * be set. + * + * @See [ErrorCodes](api:ErrorCode) + * @example + * try { + * // code.... + * } catch (e) { + * if (isError(e, "CALL_EXCEPTION")) { + * // The Type Guard has validated this object + * console.log(e.data); + * } + * } + */ +function isError(error, code) { + return error && error.code === code; +} +/** + * Returns true if %%error%% is a [[CallExceptionError]. + */ +function isCallException(error) { + return isError(error, "CALL_EXCEPTION"); +} +/** + * Returns a new Error configured to the format corebc emits errors, with + * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties + * for the corresponding corebcError. + * + * Each error in corebc includes the version of corebc, a + * machine-readable [[ErrorCode]], and depneding on %%code%%, additional + * required properties. The error message will also include the %%meeage%%, + * corebc version, %%code%% and all aditional properties, serialized. + */ +function makeError(message, code, info) { + { + const details = []; + if (info) { + if ("message" in info || "code" in info || "name" in info) { + throw new Error(`value will overwrite populated values: ${stringify$1(info)}`); + } + for (const key in info) { + const value = info[key]; + // try { + details.push(key + "=" + stringify$1(value)); + // } catch (error: any) { + // console.log("MMM", error.message); + // details.push(key + "=[could not serialize object]"); + // } + } + } + details.push(`code=${code}`); + details.push(`version=${version}`); + if (details.length) { + message += " (" + details.join(", ") + ")"; + } + } + let error; + switch (code) { + case "INVALID_ARGUMENT": + error = new TypeError(message); + break; + case "NUMERIC_FAULT": + case "BUFFER_OVERRUN": + error = new RangeError(message); + break; + default: + error = new Error(message); + } + defineProperties(error, { code }); + if (info) { + Object.assign(error, info); + } + return error; +} +/** + * Throws an corebcError with %%message%%, %%code%% and additional error + * %%info%% when %%check%% is falsish.. + * + * @see [[api:makeError]] + */ +function assert(check, message, code, info) { + if (!check) { + throw makeError(message, code, info); + } +} +/** + * A simple helper to simply ensuring provided arguments match expected + * constraints, throwing if not. + * + * In TypeScript environments, the %%check%% has been asserted true, so + * any further code does not need additional compile-time checks. + */ +function assertArgument(check, message, name, value) { + assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); +} +function assertArgumentCount(count, expectedCount, message) { + if (message == null) { + message = ""; + } + if (message) { + message = ": " + message; + } + assert(count >= expectedCount, "missing arguemnt" + message, "MISSING_ARGUMENT", { + count: count, + expectedCount: expectedCount, + }); + assert(count <= expectedCount, "too many arguemnts" + message, "UNEXPECTED_ARGUMENT", { + count: count, + expectedCount: expectedCount, + }); +} +const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { + try { + // General test for normalize + /* c8 ignore start */ + if ("test".normalize(form) !== "test") { + throw new Error("bad"); + } + /* c8 ignore stop */ + if (form === "NFD") { + const check = String.fromCharCode(0xe9).normalize("NFD"); + const expected = String.fromCharCode(0x65, 0x0301); + /* c8 ignore start */ + if (check !== expected) { + throw new Error("broken"); + } + /* c8 ignore stop */ + } + accum.push(form); + } + catch (error) { } + return accum; +}, []); +/** + * Throws if the normalization %%form%% is not supported. + */ +function assertNormalize(form) { + assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { + operation: "String.prototype.normalize", + info: { form }, + }); +} +/** + * Many classes use file-scoped values to guard the constructor, + * making it effectively private. This facilitates that pattern + * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, + * throwing if not, indicating the %%className%% if provided. + */ +function assertPrivate(givenGuard, guard, className) { + if (className == null) { + className = ""; + } + if (givenGuard !== guard) { + let method = className, operation = "new"; + if (className) { + method += "."; + operation += " " + className; + } + assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { + operation, + }); + } +} + +/** + * Some data helpers. + * + * + * @_subsection api/utils:Data Helpers [about-data] + */ +const logger$6 = new Logger("utils/data/0.0.1"); +function isHexable(value) { + return !!value.toHexString; +} +function isInteger(value) { + return typeof value === "number" && value == value && value % 1 === 0; +} +function isBytes$1(value) { + if (value == null) { + return false; + } + if (value.constructor === Uint8Array) { + return true; + } + if (typeof value === "string") { + return false; + } + if (!isInteger(value.length) || value.length < 0) { + return false; + } + for (let i = 0; i < value.length; i++) { + const v = value[i]; + if (!isInteger(v) || v < 0 || v >= 256) { + return false; + } + } + return true; +} +function _getBytes(value, name, copy) { + if (value instanceof Uint8Array) { + if (copy) { + return new Uint8Array(value); + } + return value; + } + if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { + const result = new Uint8Array((value.length - 2) / 2); + let offset = 2; + for (let i = 0; i < result.length; i++) { + result[i] = parseInt(value.substring(offset, offset + 2), 16); + offset += 2; + } + return result; + } + assertArgument(false, "invalid BytesLike value", name || "value", value); +} +/** + * Get a typed Uint8Array for %%value%%. If already a Uint8Array + * the original %%value%% is returned; if a copy is required use + * [[getBytesCopy]]. + * + * @see: getBytesCopy + */ +function getBytes(value, name) { + return _getBytes(value, name, false); +} +/** + * Get a typed Uint8Array for %%value%%, creating a copy if necessary + * to prevent any modifications of the returned value from being + * reflected elsewhere. + * + * @see: getBytes + */ +function getBytesCopy(value, name) { + return _getBytes(value, name, true); +} +/** + * Returns true if %%value%% is a valid [[HexString]]. + * + * If %%length%% is ``true`` or a //number//, it also checks that + * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) + * bytes of data (e.g. ``0x1234`` is 2 bytes). + */ +function isHexString(value, length) { + if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { + return false; + } + if (typeof length === "number" && value.length !== 2 + 2 * length) { + return false; + } + if (length === true && value.length % 2 !== 0) { + return false; + } + return true; +} +/** + * Returns true if %%value%% is a valid representation of arbitrary + * data (i.e. a valid [[DataHexString]] or a Uint8Array). + */ +function isBytesLike(value) { + return isHexString(value, true) || value instanceof Uint8Array; +} +const HexCharacters = "0123456789abcdef"; +/** + * Returns a [[DataHexString]] representation of %%data%%. + */ +function hexlify(value, options) { + if (!options) { + options = {}; + } + if (typeof value === "string") { + if (value.includes(",") && value.startsWith("0x")) { + const v = value + .replace("0x", "") + .split(",") + .map((item) => Number(item)); + // @ts-ignore + value = new Uint8Array(v); + } + } + if (typeof value === "number") { + logger$6.checkSafeUint53(value, "invalid hexlify value"); + let hex = ""; + while (value) { + hex = HexCharacters[value & 0xf] + hex; + value = Math.floor(value / 16); + } + if (hex.length) { + if (hex.length % 2) { + hex = "0" + hex; + } + return "0x" + hex; + } + return "0x00"; + } + if (typeof value === "bigint") { + value = value.toString(16); + if (value.length % 2) { + return "0x0" + value; + } + return "0x" + value; + } + if (options.allowMissingPrefix && + typeof value === "string" && + value.substring(0, 2) !== "0x") { + value = "0x" + value; + } + if (isHexable(value)) { + return value.toHexString(); + } + if (isHexString(value)) { + if (value.length % 2) { + if (options.hexPad === "left") { + value = "0x0" + value.substring(2); + } + else if (options.hexPad === "right") { + value += "0"; + } + else { + logger$6.throwArgumentError("hex data is odd-length", "value", value); + } + } + return value.toLowerCase(); + } + if (isBytes$1(value)) { + let result = "0x"; + for (let i = 0; i < value.length; i++) { + let v = value[i]; + result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; + } + return result; + } + return logger$6.throwArgumentError("invalid hexlify value", "value", value); +} +/** + * Returns a [[DataHexString]] by concatenating all values + * within %%data%%. + */ +function concat(items) { + return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); +} +function hexDataSlice(data, offset, endOffset) { + if (typeof data !== "string") { + data = hexlify(data); + } + else if (!isHexString(data) || data.length % 2) { + logger$6.throwArgumentError("invalid hexData", "value", data); + } + offset = 2 + 2 * offset; + return "0x" + data.substring(offset); +} +function hexDataLength(data) { + if (typeof data !== "string") { + data = hexlify(data); + } + else if (!isHexString(data) || data.length % 2) { + return null; + } + return (data.length - 2) / 2; +} +/** + * Returns the length of %%data%%, in bytes. + */ +function dataLength(data) { + if (isHexString(data, true)) { + return (data.length - 2) / 2; + } + return getBytes(data).length; +} +/** + * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% + * offset to the %%end%% offset. + * + * By default %%start%% is 0 and %%end%% is the length of %%data%%. + */ +function dataSlice(data, start, end) { + const bytes = getBytes(data); + if (end != null && end > bytes.length) { + assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { + buffer: bytes, + length: bytes.length, + offset: end, + }); + } + return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); +} +/** + * Return the [[DataHexString]] result by stripping all **leading** + ** zero bytes from %%data%%. + */ +function stripZerosLeft(data) { + let bytes = hexlify(data).substring(2); + while (bytes.startsWith("00")) { + bytes = bytes.substring(2); + } + return "0x" + bytes; +} +function zeroPad(data, length, left) { + const bytes = getBytes(data); + assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { + buffer: new Uint8Array(bytes), + length: length, + offset: length + 1, + }); + const result = new Uint8Array(length); + result.fill(0); + if (left) { + result.set(bytes, length - bytes.length); + } + else { + result.set(bytes, 0); + } + return hexlify(result); +} +/** + * Return the [[DataHexString]] of %%data%% padded on the **left** + * to %%length%% bytes. + * + * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is + * thrown. + * + * This pads data the same as **values** are in Solidity + * (e.g. ``uint128``). + */ +function zeroPadValue(data, length) { + return zeroPad(data, length, true); +} +/** + * Return the [[DataHexString]] of %%data%% padded on the **right** + * to %%length%% bytes. + * + * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is + * thrown. + * + * This pads data the same as **bytes** are in Solidity + * (e.g. ``bytes16``). + */ +function zeroPadBytes(data, length) { + return zeroPad(data, length, false); +} +function stripZeros(value) { + let result = arrayify(value); + if (result.length === 0) { + return result; + } + // Find the first non-zero entry + let start = 0; + while (start < result.length && result[start] === 0) { + start++; + } + // If we started with zeros, strip them + if (start) { + result = result.slice(start); + } + return result; +} +function arrayify(value, options) { + if (!options) { + options = {}; + } + if (typeof value === "number") { + logger$6.checkSafeUint53(value, "invalid arrayify value"); + const result = []; + while (value) { + // @ts-ignore + result.unshift(value & 0xff); + value = parseInt(String(value / 256)); + } + if (result.length === 0) { + result.push(0); + } + return new Uint8Array(result); + } + if (options.allowMissingPrefix && + typeof value === "string" && + value.substring(0, 2) !== "0x") { + value = "0x" + value; + } + if (isHexable(value)) { + value = value.toHexString(); + } + if (isHexString(value)) { + let hex = value.substring(2); + if (hex.length % 2) { + if (options.hexPad === "left") { + hex = "0x0" + hex.substring(2); + } + else if (options.hexPad === "right") { + hex += "0"; + } + else { + logger$6.throwArgumentError("hex data is odd-length", "value", value); + } + } + const result = []; + for (let i = 0; i < hex.length; i += 2) { + // @ts-ignore + result.push(parseInt(hex.substring(i, i + 2), 16)); + } + return new Uint8Array(result); + } + if (isBytes$1(value)) { + return new Uint8Array(value); + } + return logger$6.throwArgumentError("invalid arrayify value", "value", value); +} +function hexConcat(items) { + let result = "0x"; + items.forEach((item) => { + result += hexlify(item).substring(2); + }); + return result; +} + +var BN = _BN.BN; +const logger$5 = new Logger("bigNumber/0.0.1"); +const _constructorGuard = {}; +const MAX_SAFE = 0x1fffffffffffff; +// Only warn about passing 10 into radix once +let _warnedToStringRadix = false; +class BigNumber { + _hex; + _isBigNumber; + constructor(constructorGuard, hex) { + logger$5.checkNew(new.target, BigNumber); + if (constructorGuard !== _constructorGuard) { + logger$5.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, { + operation: "new (BigNumber)", + }); + } + this._hex = hex; + this._isBigNumber = true; + Object.freeze(this); + } + fromTwos(value) { + return toBigNumber(toBN(this).fromTwos(value)); + } + toTwos(value) { + return toBigNumber(toBN(this).toTwos(value)); + } + abs() { + if (this._hex[0] === "-") { + return BigNumber.from(this._hex.substring(1)); + } + return this; + } add(other) { return toBigNumber(toBN(this).add(toBN(other))); } - sub(other) { - return toBigNumber(toBN(this).sub(toBN(other))); + sub(other) { + return toBigNumber(toBN(this).sub(toBN(other))); + } + div(other) { + const o = BigNumber.from(other); + if (o.isZero()) { + throwFault("division by zero", "div"); + } + return toBigNumber(toBN(this).div(toBN(other))); + } + mul(other) { + return toBigNumber(toBN(this).mul(toBN(other))); + } + mod(other) { + const value = toBN(other); + if (value.isNeg()) { + throwFault("cannot modulo negative values", "mod"); + } + return toBigNumber(toBN(this).umod(value)); + } + pow(other) { + const value = toBN(other); + if (value.isNeg()) { + throwFault("cannot raise to negative values", "pow"); + } + return toBigNumber(toBN(this).pow(value)); + } + and(other) { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault("cannot 'and' negative values", "and"); + } + return toBigNumber(toBN(this).and(value)); + } + or(other) { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault("cannot 'or' negative values", "or"); + } + return toBigNumber(toBN(this).or(value)); + } + xor(other) { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault("cannot 'xor' negative values", "xor"); + } + return toBigNumber(toBN(this).xor(value)); + } + mask(value) { + if (this.isNegative() || value < 0) { + throwFault("cannot mask negative values", "mask"); + } + return toBigNumber(toBN(this).maskn(value)); + } + shl(value) { + if (this.isNegative() || value < 0) { + throwFault("cannot shift negative values", "shl"); + } + return toBigNumber(toBN(this).shln(value)); + } + shr(value) { + if (this.isNegative() || value < 0) { + throwFault("cannot shift negative values", "shr"); + } + return toBigNumber(toBN(this).shrn(value)); + } + eq(other) { + return toBN(this).eq(toBN(other)); + } + lt(other) { + return toBN(this).lt(toBN(other)); + } + lte(other) { + return toBN(this).lte(toBN(other)); + } + gt(other) { + return toBN(this).gt(toBN(other)); + } + gte(other) { + return toBN(this).gte(toBN(other)); + } + isNegative() { + return this._hex[0] === "-"; + } + isZero() { + return toBN(this).isZero(); + } + toNumber() { + try { + return toBN(this).toNumber(); + } + catch (error) { + throwFault("overflow", "toNumber", this.toString()); + } + // @ts-ignore + return null; + } + toBigInt() { + try { + return BigInt(this.toString()); + } + catch (e) { } + return logger$5.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, { + value: this.toString(), + }); + } + toString() { + // Lots of people expect this, which we do not support, so check (See: #889) + if (arguments.length > 0) { + if (arguments[0] === 10) { + if (!_warnedToStringRadix) { + _warnedToStringRadix = true; + logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed"); + } + } + else if (arguments[0] === 16) { + logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {}); + } + else { + logger$5.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {}); + } + } + return toBN(this).toString(10); + } + toHexString() { + return this._hex; + } + toJSON(key) { + return { type: "BigNumber", hex: this.toHexString() }; + } + static from(value) { + if (value instanceof BigNumber) { + return value; + } + if (typeof value === "string") { + if (value.match(/^-?0x[0-9a-f]+$/i)) { + return new BigNumber(_constructorGuard, toHex(value)); + } + if (value.match(/^-?[0-9]+$/)) { + return new BigNumber(_constructorGuard, toHex(new BN(value))); + } + return logger$5.throwArgumentError("invalid BigNumber string", "value", value); + } + if (typeof value === "number") { + if (value % 1) { + throwFault("underflow", "BigNumber.from", value); + } + if (value >= MAX_SAFE || value <= -MAX_SAFE) { + throwFault("overflow", "BigNumber.from", value); + } + return BigNumber.from(String(value)); + } + const anyValue = value; + if (typeof anyValue === "bigint") { + return BigNumber.from(anyValue.toString()); + } + if (isBytes$1(anyValue)) { + return BigNumber.from(hexlify(anyValue)); + } + if (anyValue) { + // Hexable interface (takes priority) + if (anyValue.toHexString) { + const hex = anyValue.toHexString(); + if (typeof hex === "string") { + return BigNumber.from(hex); + } + } + else { + // For now, handle legacy JSON-ified values (goes away in v6) + let hex = anyValue._hex; + // New-form JSON + if (hex == null && anyValue.type === "BigNumber") { + hex = anyValue.hex; + } + if (typeof hex === "string") { + if (isHexString(hex) || + (hex[0] === "-" && isHexString(hex.substring(1)))) { + return BigNumber.from(hex); + } + } + } + } + return logger$5.throwArgumentError("invalid BigNumber value", "value", value); + } + static isBigNumber(value) { + return !!(value && value._isBigNumber); + } +} +// Normalize the hex string +// @ts-ignore +function toHex(value) { + // For BN, call on the hex string + if (typeof value !== "string") { + return toHex(value.toString(16)); + } + // If negative, prepend the negative sign to the normalized positive value + if (value[0] === "-") { + // Strip off the negative sign + value = value.substring(1); + // Cannot have multiple negative signs (e.g. "--0x04") + if (value[0] === "-") { + logger$5.throwArgumentError("invalid hex", "value", value); + } + // Call toHex on the positive component + value = toHex(value); + // Do not allow "-0x00" + if (value === "0x00") { + return value; + } + // Negate the value + return "-" + value; + } + // Add a "0x" prefix if missing + if (value.substring(0, 2) !== "0x") { + value = "0x" + value; + } + // Normalize zero + if (value === "0x") { + return "0x00"; + } + // Make the string even length + if (value.length % 2) { + value = "0x0" + value.substring(2); + } + // Trim to smallest even-length string + while (value.length > 4 && value.substring(0, 4) === "0x00") { + value = "0x" + value.substring(4); + } + return value; +} +// @ts-ignore +function toBigNumber(value) { + return BigNumber.from(toHex(value)); +} +// @ts-ignore +function toBN(value) { + const hex = BigNumber.from(value).toHexString(); + if (hex[0] === "-") { + return new BN("-" + hex.substring(3), 16); + } + return new BN(hex.substring(2), 16); +} +function throwFault(fault, operation, value) { + const params = { fault: fault, operation: operation }; + if (value != null) { + params.value = value; + } + return logger$5.throwError(fault, Logger.errors.NUMERIC_FAULT, params); +} + +const logger$4 = new Logger("rlp/0.0.1"); +function arrayifyInteger$1(value) { + const result = []; + while (value) { + // @ts-ignore + result.unshift(value & 0xff); + value >>= 8; + } + return result; +} +function unarrayifyInteger$1(data, offset, length) { + let result = 0; + for (let i = 0; i < length; i++) { + result = result * 256 + data[offset + i]; + } + return result; +} +function _encode$1(object) { + if (Array.isArray(object)) { + let payload = []; + object.forEach(function (child) { + payload = payload.concat(_encode$1(child)); + }); + if (payload.length <= 55) { + payload.unshift(0xc0 + payload.length); + return payload; + } + const length = arrayifyInteger$1(payload.length); + length.unshift(0xf7 + length.length); + return length.concat(payload); + } + if (!isBytesLike(object)) { + logger$4.throwArgumentError("RLP object must be BytesLike", "object", object); + } + const data = Array.prototype.slice.call(arrayify(object)); + if (data.length === 1 && data[0] <= 0x7f) { + return data; + } + else if (data.length <= 55) { + data.unshift(0x80 + data.length); + return data; + } + const length = arrayifyInteger$1(data.length); + length.unshift(0xb7 + length.length); + return length.concat(data); +} +function encode(object) { + return hexlify(_encode$1(object)); +} +function _decodeChildren$1(data, offset, childOffset, length) { + const result = []; + while (childOffset < offset + 1 + length) { + const decoded = _decode$1(data, childOffset); + result.push(decoded.result); + childOffset += decoded.consumed; + if (childOffset > offset + 1 + length) { + logger$4.throwError("child data too short", Logger.errors.BUFFER_OVERRUN, {}); + } + } + return { consumed: 1 + length, result: result }; +} +// returns { consumed: number, result: Object } +function _decode$1(data, offset) { + if (data.length === 0) { + logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); + } + // Array with extra length prefix + if (data[offset] >= 0xf8) { + const lengthLength = data[offset] - 0xf7; + if (offset + 1 + lengthLength > data.length) { + logger$4.throwError("data short segment too short", Logger.errors.BUFFER_OVERRUN, {}); + } + const length = unarrayifyInteger$1(data, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data.length) { + logger$4.throwError("data long segment too short", Logger.errors.BUFFER_OVERRUN, {}); + } + return _decodeChildren$1(data, offset, offset + 1 + lengthLength, lengthLength + length); + } + else if (data[offset] >= 0xc0) { + const length = data[offset] - 0xc0; + if (offset + 1 + length > data.length) { + logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); + } + return _decodeChildren$1(data, offset, offset + 1, length); + } + else if (data[offset] >= 0xb8) { + const lengthLength = data[offset] - 0xb7; + if (offset + 1 + lengthLength > data.length) { + logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); + } + const length = unarrayifyInteger$1(data, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data.length) { + logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); + } + const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); + return { consumed: 1 + lengthLength + length, result: result }; + } + else if (data[offset] >= 0x80) { + const length = data[offset] - 0x80; + if (offset + 1 + length > data.length) { + logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); + } + const result = hexlify(data.slice(offset + 1, offset + 1 + length)); + return { consumed: 1 + length, result: result }; + } + return { consumed: 1, result: hexlify(data[offset]) }; +} +function decode$1(data) { + const bytes = arrayify(data); + const decoded = _decode$1(bytes, 0); + if (decoded.consumed !== bytes.length) { + logger$4.throwArgumentError("invalid rlp data", "data", data); + } + return decoded.result; +} + +const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))(); +const _32n = /* @__PURE__ */ BigInt(32); +// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high +// }` to match little-endian word order rather than the property names. +function fromBig(n, le = false) { + if (le) + return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; + return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; +} +// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array +// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`. +function split(lst, le = false) { + const len = lst.length; + let Ah = new Uint32Array(len); + let Al = new Uint32Array(len); + for (let i = 0; i < len; i++) { + const { h, l } = fromBig(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; +} +// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers +// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below +// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes). +const fromNumH = (n) => (n / 2 ** 32) | 0; +const fromNumL = (n) => n >>> 0; +// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call +// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`. +function setU64FromNum(view, byteOffset, n, isLE) { + const h = fromNumH(n); + const l = fromNumL(n); + view.setUint32(byteOffset, isLE ? l : h, isLE); + view.setUint32(byteOffset + 4, isLE ? h : l, isLE); +} +// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`. +const shrSH = (h, _l, s) => h >>> s; +// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`. +const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); +// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. +const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); +// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. +const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); +// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. +const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); +// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. +const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); +// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps +// local copies so V8 inlines them into keccakP. +// Add two split 64-bit words and return the split `{ h, l }` sum. +// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out +// of the low sum and instead use division. +function add(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; +} +// Addition with more than 2 elements +// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`. +const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); +// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`. +const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; +// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`. +const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); +// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`. +const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; +// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`. +const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); +// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`. +const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; + +/** + * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. + * @param a - value to test + * @returns `true` when the value is a Uint8Array-compatible view. + * @example + * Check whether a value is a Uint8Array-compatible view. + * ```ts + * isBytes(new Uint8Array([1, 2, 3])); + * ``` + */ +function isBytes(a) { + // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases. + // The fallback still requires a real ArrayBuffer view, so plain + // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and + // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views. + return (a instanceof Uint8Array || + (ArrayBuffer.isView(a) && + a.constructor.name === 'Uint8Array' && + 'BYTES_PER_ELEMENT' in a && + a.BYTES_PER_ELEMENT === 1)); +} +// Shared error-message prefix builder. Only called on throw paths, so assert +// success paths never pay for the string concatenation. +const atitle = (title) => (title ? `"${title}" ` : ''); +/** + * Asserts something is a non-negative integer. + * @param n - number to validate + * @param title - label included in thrown errors + * @returns The validated number. + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Validate a non-negative integer option. + * ```ts + * anumber(32, 'length'); + * ``` + */ +function anumber(n, title = '') { + if (typeof n !== 'number') + throw new TypeError(atitle(title) + 'expected number, got ' + typeof n); + if (!Number.isSafeInteger(n) || n < 0) + throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n); + return n; +} +/** + * Asserts something is a boolean. + * @param value - value to validate + * @param title - label included in thrown errors + * @returns The validated boolean. + * @throws On wrong argument types. {@link TypeError} + * @example + * Validate a boolean option. + * ```ts + * abool(true, 'enableXOF'); + * ``` + */ +function abool(value, title = '') { + if (typeof value !== 'boolean') + throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value); + return value; +} +/** + * Asserts something is Uint8Array. + * @param value - value to validate + * @param length - optional exact length constraint + * @param title - label included in thrown errors + * @returns The validated byte array. + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Validate that a value is a byte array. + * ```ts + * abytes(new Uint8Array([1, 2, 3])); + * ``` + */ +function abytes(value, length, title = '') { + // Success path first: this runs at the start of every update() / digestInto(), and the + // common `abytes(data)` form must not pay for length handling it does not use. + if (isBytes(value) && (length === undefined)) + return value; + const bytes = isBytes(value); + const ofLen = ''; + const got = bytes ? `length=${value.length}` : `type=${typeof value}`; + const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got; + if (!bytes) + throw new TypeError(message); + throw new RangeError(message); +} +/** + * Asserts something is a wrapped hash constructor. + * @param h - hash constructor to validate + * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError} + * @throws On invalid hash metadata ranges or values. {@link RangeError} + * @throws If the hash metadata allows empty outputs or block sizes. {@link Error} + * @example + * Validate a callable hash wrapper. + * ```ts + * import { ahash } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * ahash(sha256); + * ``` + */ +function ahash(h) { + if (typeof h !== 'function' || typeof h.create !== 'function') + throw new TypeError('expected hash wrapped by utils.createHasher'); + anumber(h.outputLen); + anumber(h.blockLen); + // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass + // validation and can produce empty outputs instead of failing fast. + if (h.outputLen < 1 || h.blockLen < 1) + throw new Error('hash blockLen / outputLen must be >= 1'); +} +const aobject = (value, label) => { + if (value === null || typeof value !== 'object' || Array.isArray(value)) + throw new TypeError((label === 'object' ? '' : `"${label}" `) + 'expected object, got type=' + typeof value); +}; +const aopts = (value, label) => { + aobject(value, label); + const proto = Object.getPrototypeOf(value); + if (proto !== Object.prototype && proto !== null) + throw new TypeError(`"${label}" expected plain object`); + // Object.assign() treats an own "__proto__" source key as a write to the target's legacy + // prototype setter. Reject it before merging so inherited option values cannot be injected. + if (Object.hasOwn(value, '__proto__')) + throw new TypeError(`"${label}.__proto__" is not allowed`); +}; +/** + * Asserts a hash instance has not been destroyed or finished. + * @param instance - hash instance to validate + * @param checkFinished - whether to reject finalized instances + * @throws If the hash instance has already been destroyed or finalized. {@link Error} + * @example + * Validate that a hash instance is still usable. + * ```ts + * import { aexists } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const hash = sha256.create(); + * aexists(hash); + * ``` + */ +function aexists(instance, checkFinished = true) { + // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their + // truthiness is checked - re-validating their type per call was pure hot-path overhead. + if (instance.destroyed) + throw new Error('hash was destroyed'); + if (checkFinished && instance.finished) + throw new Error('digest() was already called'); +} +/** + * Asserts output is a sufficiently-sized byte array. + * @param out - destination buffer + * @param instance - hash instance providing output length + * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes. + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Validate a caller-provided digest buffer. + * ```ts + * import { aoutput } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const hash = sha256.create(); + * aoutput(new Uint8Array(hash.outputLen), hash); + * ``` + */ +function aoutput(out, instance) { + abytes(out, undefined, 'output'); + // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast + // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call. + const min = instance.outputLen; + if (!(out.length >= min)) { + throw new RangeError('"output" expected length >= ' + min); + } +} +/** + * Casts a typed array view to Uint32Array. + * `arr.byteOffset` must already be 4-byte aligned or the platform + * Uint32Array constructor will throw. + * @param arr - source typed array + * @returns Uint32Array view over the same buffer. + * @example + * Reinterpret a byte array as 32-bit words. + * ```ts + * u32(new Uint8Array(8)); + * ``` + */ +function u32(arr) { + return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +} +/** + * Zeroizes typed arrays in place. Warning: JS provides no guarantees. + * @param arrays - arrays to overwrite with zeros + * @example + * Zeroize sensitive buffers in place. + * ```ts + * clean(new Uint8Array([1, 2, 3])); + * ``` + */ +function clean(...arrays) { + for (let i = 0; i < arrays.length; i++) { + arrays[i].fill(0); + } +} +/** + * Creates a DataView for byte-level manipulation. + * @param arr - source typed array + * @returns DataView over the same buffer region. + * @example + * Create a DataView over an existing buffer. + * ```ts + * createView(new Uint8Array(4)); + * ``` + */ +function createView(arr) { + return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +} +/** + * Rotate-right operation for uint32 values. + * @param word - source word + * @param shift - shift amount in bits + * @returns Rotated word. + * @example + * Rotate a 32-bit word to the right. + * ```ts + * rotr(0x12345678, 8); + * ``` + */ +function rotr(word, shift) { + return (word << (32 - shift)) | (word >>> shift); +} +/** + * Rotate-left operation for uint32 values. + * @param word - source word + * @param shift - shift amount in bits + * @returns Rotated word. + * @example + * Rotate a 32-bit word to the left. + * ```ts + * rotl(0x12345678, 8); + * ``` + */ +function rotl(word, shift) { + return (word << shift) | ((word >>> (32 - shift)) >>> 0); +} +/** Whether the current platform is little-endian. */ +const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); +/** + * Byte-swap operation for uint32 values. + * @param word - source word + * @returns Word with reversed byte order. + * @example + * Reverse the byte order of a 32-bit word. + * ```ts + * byteSwap(0x11223344); + * ``` + */ +function byteSwap(word) { + return (((word << 24) & 0xff000000) | + ((word << 8) & 0xff0000) | + ((word >>> 8) & 0xff00) | + ((word >>> 24) & 0xff)); +} +/** + * Byte-swaps every word of a Uint32Array in place. + * @param arr - array to mutate + * @returns The same array after mutation; callers pass live state arrays here. + * @example + * Reverse the byte order of every word in place. + * ```ts + * byteSwap32(new Uint32Array([0x11223344])); + * ``` + */ +function byteSwap32(arr) { + for (let i = 0; i < arr.length; i++) { + arr[i] = byteSwap(arr[i]); + } + return arr; +} +/** + * Conditionally byte-swaps a Uint32Array on big-endian platforms. + * @param u - array to normalize for host endianness + * @returns Original or byte-swapped array depending on platform endianness. + * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`. + * @example + * Normalize a word array for host endianness. + * ```ts + * swap32IfBE(new Uint32Array([0x11223344])); + * ``` + */ +const swap32IfBE = isLE + ? (u) => u + : byteSwap32; +/** + * Yields to the host task scheduler so timers, I/O, and rendering can make progress. + * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback. + * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so + * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while + * still allowing other event-loop work to proceed. + * @param onReject - optional cleanup invoked only if the host yield fails + * @example + * Yield to the next scheduler tick. + * ```ts + * await nextTick(); + * ``` + */ +function nextTick(onReject) { + const host = globalThis; + if (typeof host.scheduler?.yield === 'function') { + const promise = host.scheduler.yield(); + // Keep the original scheduler rejection; this handler exists only for cleanup. + if (onReject) + promise.catch(onReject); + return promise; + } + return new Promise((resolve) => host.setTimeout(resolve, 0)); +} +/** + * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops. + * @param iters - number of loop iterations to run + * @param tick - maximum time slice in milliseconds + * @param cb - callback executed on each iteration + * @param onReject - optional cleanup invoked only if a host yield fails + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Run a loop that periodically yields back to the event loop. + * ```ts + * await asyncLoop(2, 0, () => {}); + * ``` + */ +async function asyncLoop(iters, tick, cb, onReject) { + anumber(iters, 'iters'); + anumber(tick, 'tick'); + if (typeof cb !== 'function') + throw new TypeError('callback must be a function'); + // Callback is synchronous by contract; asyncLoop only yields between sync work windows. + let ts = Date.now(); + for (let i = 0; i < iters; i++) { + cb(i); + // Date.now() is not monotonic, so in case if clock goes backwards we return return control too + const diff = Date.now() - ts; + if (diff >= 0 && diff < tick) + continue; + await nextTick(onReject); + // Track only synchronous work time; scheduler delay after yielding is outside our budget. + ts = Date.now(); + } +} +/** + * Converts string to bytes using UTF8 encoding. + * Built-in doesn't validate input to be string: we do the check. + * Non-ASCII details are delegated to the platform `TextEncoder`. + * @param str - string to encode + * @returns UTF-8 encoded bytes. + * @throws On wrong argument types. {@link TypeError} + * @example + * Encode a string as UTF-8 bytes. + * ```ts + * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99]) + * ``` + */ +function utf8ToBytes(str) { + if (typeof str !== 'string') + throw new TypeError('string expected'); + const encoded = new TextEncoder().encode(str); + try { + // Copy into the current realm for Firefox extension contexts. Callers that own the returned + // buffer can then wipe it independently of TextEncoder's temporary result. + return new Uint8Array(encoded); // https://bugzil.la/1681809 + } + finally { + clean(encoded); + } +} +/** + * Helper for KDFs: consumes Uint8Array or string. + * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer. + * @param data - user-provided KDF input + * @param errorTitle - label included in thrown errors + * @returns Byte representation of the input. + * @throws On wrong argument types. {@link TypeError} + * @example + * Normalize KDF input to bytes. + * ```ts + * kdfInputToBytes('password'); + * ``` + */ +function kdfInputToBytes(data, errorTitle = '') { + if (typeof data === 'string') + return utf8ToBytes(data); + return abytes(data, undefined, errorTitle); +} +/** + * Merges default options and passed options. + * @param defaults - base option object + * @param opts - user overrides + * @param title - label included in thrown override errors + * @returns Fresh merged option object with a null prototype. + * @throws On wrong argument types. {@link TypeError} + * @example + * Merge user overrides onto default options. + * ```ts + * checkOpts({ dkLen: 32 }, { asyncTick: 10 }); + * ``` + */ +function checkOpts(defaults, opts, title = 'opts') { + aopts(defaults, 'defaults'); + if (opts !== undefined) + aopts(opts, title); + // Callers read optional fields directly, so omitted values must not fall through to ambient + // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output). + const merged = Object.assign(Object.create(null), defaults, opts); + return merged; +} +/** + * Creates a callable hash function from a stateful class constructor. + * @param hashCons - hash constructor or factory + * @param info - optional metadata such as DER OID + * @returns Frozen callable hash wrapper with `.create()`. + * Wrapper construction eagerly calls `hashCons(undefined)` once to read + * `outputLen` / `blockLen`, so constructor side effects happen at module + * init time. + * @throws On wrong argument types. {@link TypeError} + * @example + * Wrap a stateful hash constructor into a callable helper. + * ```ts + * import { createHasher } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const wrapped = createHasher(sha256.create, { oid: sha256.oid }); + * wrapped(new Uint8Array([1])); + * ``` + */ +function createHasher(hashCons, info = {}) { + if (typeof hashCons !== 'function') + throw new TypeError('"hashCons" expected function, got type=' + typeof hashCons); + info = checkOpts({}, info, 'info'); + const hashC = (msg, opts) => hashCons(opts) + .update(msg) + .digest(); + const tmp = hashCons(undefined); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.canXOF = tmp.canXOF; + hashC.create = (opts) => hashCons(opts); + Object.assign(hashC, info); + return Object.freeze(hashC); +} +/** + * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`. + * @param suffix - final OID byte for the selected hash. + * The helper accepts any byte even though only the documented NIST hash + * suffixes are meaningful downstream. + * @returns Object containing the DER-encoded OID. + * @example + * Build OID metadata for a NIST hash. + * ```ts + * oidNist(0x01); + * ``` + */ +const oidNist = (suffix) => ({ + // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet. + // Larger suffix values would need base-128 OID encoding and a different length byte. + oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]), +}); + +/** + * Internal Merkle-Damgard hash utils. + * @module + */ +/** + * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`. + * Returns bits from `b` when `a` is set, otherwise from `c`. + * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never + * set the same bit. + * @param a - selector word + * @param b - word chosen when selector bit is set + * @param c - word chosen when selector bit is clear + * @returns Mixed 32-bit word. + * @example + * Combine three words with the shared 32-bit choice primitive. + * ```ts + * Chi(0xffffffff, 0x12345678, 0x87654321); + * ``` + */ +function Chi(a, b, c) { + return (a & b) ^ (~a & c); +} +/** + * Shared 32-bit majority primitive reused by SHA-256 and SHA-1. + * Returns bits shared by at least two inputs. + * @param a - first input word + * @param b - second input word + * @param c - third input word + * @returns Mixed 32-bit word. + * @example + * Combine three words with the shared 32-bit majority primitive. + * ```ts + * Maj(0xffffffff, 0x12345678, 0x87654321); + * ``` + */ +function Maj(a, b, c) { + return (a & b) ^ (a & c) ^ (b & c); +} +/** + * Merkle-Damgard hash construction base class. + * Could be used to create MD5, RIPEMD, SHA1, SHA2. + * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit + * strings with partial-byte tails. + * @param blockLen - internal block size in bytes + * @param outputLen - digest size in bytes + * @param padOffset - trailing length field size in bytes + * @param isLE - whether length and state words are encoded in little-endian + * @example + * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow. + * ```ts + * import { _SHA1 } from '@noble/hashes/legacy.js'; + * const hash = new _SHA1(); + * hash.update(new Uint8Array([97, 98, 99])); + * hash.digest(); + * ``` + */ +class HashMD { + blockLen; + outputLen; + canXOF = false; + padOffset; + isLE; + // For partial updates less than block size + buffer; + view; + finished = false; + length = 0; + pos = 0; + destroyed = false; + constructor(blockLen, outputLen, padOffset, isLE) { + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + aexists(this); + abytes(data); + const { view, buffer, blockLen } = this; + const len = data.length; + let processed = false; + for (let pos = 0; pos < len;) { + const take = Math.min(blockLen - this.pos, len - pos); + // Fast path only when there is no buffered partial block: `take === blockLen` implies + // `this.pos === 0`, so we can process full blocks directly from the input view. + if (take === blockLen) { + const dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + processed = true; + continue; + } + // When the whole input is buffered in one go (common for short messages), passing `data` + // directly avoids allocating a subarray view. + buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + processed = true; + } + } + this.length += data.length; + // Shared schedule buffers only pick up input-derived words inside process(); if everything + // was buffered without processing, there is nothing to zero. + if (processed) + this.roundClean(); + return this; + } + digestInto(out) { + aexists(this); + aoutput(out, this); + this.finished = true; + // Padding + // We can avoid allocation of buffer for padding completely if it + // was previously not allocated here. But it won't change performance. + const { buffer, view, blockLen, isLE } = this; + let { pos } = this; + // append the bit '1' to the message, then zero-pad the rest of the block + buffer[pos++] = 0b10000000; + buffer.fill(0, pos); + // we have less than padOffset left in buffer, so we cannot put length in + // current block, need process it and pad again + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + buffer.fill(0); + } + // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from + // the padding fill above, and JS will overflow before user input can make that half non-zero. + // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an + // integer below 2**53, so the split inside the helper stays exact). + setU64FromNum(view, blockLen - 8, this.length * 8, isLE); + this.process(view, 0); + // The final block above is processed outside update(), so the shared message-schedule + // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest(). + this.roundClean(); + // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one. + const oview = out === buffer ? view : createView(out); + const len = this.outputLen; + // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT + const outLen = len / 4; + const state = this.get(); + // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state. + if (len % 4 || outLen > state.length) + throw new Error('invalid outputLen'); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return + // fresh bytes to the caller. + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneIntoMeta(to) { + const { buffer, length, finished, destroyed, pos } = this; + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and + // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it. + if (pos) + to.buffer.set(buffer); // Avoid a hot modulo guard. + return to; + } + clone() { + return this._cloneInto(); + } +} +/** + * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. + * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. + */ +/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the + * square roots of the first eight prime numbers. Exported as a shared table; callers must treat + * it as read-only because constructors copy words from it by index. */ +const SHA256_IV = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, +]); +/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen + * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first + * eight prime numbers. Exported as a shared table; callers must treat it as read-only because + * constructors copy halves from it by index. */ +const SHA512_IV = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, + 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, +]); + +/** + +SHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions. +RFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors, +not the base RIPEMD-160 compression spec. +Don't use them in a new protocol. What "weak" means: + +- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. +- No practical pre-image attacks (only theoretical, 2^123.4) +- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151 + * @module + */ +// RIPEMD-160 +// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables. +const Rho160 = /* @__PURE__ */ Uint8Array.from([ + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, +]); +const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); +const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); +// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds. +const idxLR = /* @__PURE__ */ (() => { + const L = [Id160]; + const R = [Pi160]; + const res = [L, R]; + for (let i = 0; i < 4; i++) + for (let j of res) + j.push(j[i].map((k) => Rho160[k])); + return res; +})(); +const idxL = /* @__PURE__ */ (() => idxLR[0])(); +const idxR = /* @__PURE__ */ (() => idxLR[1])(); +// const [idxL, idxR] = idxLR; +// Base per-group shift table before the left/right message-order permutations are applied. +const shifts160 = /* @__PURE__ */ [ + [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], + [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], + [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], + [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], + [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], +].map((i) => Uint8Array.from(i)); +const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); +const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); +// Five left-lane additive constants for RIPEMD-160. +const Kl160 = /* @__PURE__ */ Uint32Array.from([ + 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, +]); +// Five right-lane additive constants for RIPEMD-160. +const Kr160 = /* @__PURE__ */ Uint32Array.from([ + 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, +]); +// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range +// inputs currently fall through to the group-4 branch. +function ripemd_f(group, x, y, z) { + if (group === 0) + return x ^ y ^ z; + if (group === 1) + return (x & y) | (~x & z); + if (group === 2) + return (x | ~y) ^ z; + if (group === 3) + return (x & z) | (y & ~z); + return x ^ (y | ~z); +} +// Reusable 16-word RIPEMD-160 message block buffer. +const BUF_160 = /* @__PURE__ */ new Uint32Array(16); +/** + * Internal RIPEMD-160 legacy hash class. + * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification. + */ +class _RIPEMD160 extends HashMD { + h0 = 0x67452301 | 0; + h1 = 0xefcdab89 | 0; + h2 = 0x98badcfe | 0; + h3 = 0x10325476 | 0; + h4 = 0xc3d2e1f0 | 0; + constructor() { + super(64, 20, 8, true); + } + get() { + const { h0, h1, h2, h3, h4 } = this; + return [h0, h1, h2, h3, h4]; + } + set(h0, h1, h2, h3, h4) { + this.h0 = h0 | 0; + this.h1 = h1 | 0; + this.h2 = h2 | 0; + this.h3 = h3 | 0; + this.h4 = h4 | 0; + } + _cloneInto(to) { + (to ||= new this.constructor()).set(...this.get()); + return this._cloneIntoMeta(to); + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + BUF_160[i] = view.getUint32(offset, true); + // prettier-ignore + let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; + // Instead of iterating 0 to 80, we split it into 5 groups + // And use the groups in constants, functions, etc. Much simpler + for (let group = 0; group < 5; group++) { + const rGroup = 4 - group; + const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore + const rl = idxL[group], rr = idxR[group]; // prettier-ignore + const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore + for (let i = 0; i < 16; i++) { + const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; + al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore + } + // 2 loops are 10% faster + for (let i = 0; i < 16; i++) { + const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; + ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore + } + } + // Add the compressed chunk to the current hash value + // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order. + this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); + } + roundClean() { + clean(BUF_160); + } + destroy() { + this.destroyed = true; + clean(this.buffer); + this.set(0, 0, 0, 0, 0); + } +} +/** + * RIPEMD-160 - a legacy hash function from 1990s. + * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point + * at the base RIPEMD-160 references. + * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html} + * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf} + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with RIPEMD-160. + * ```ts + * ripemd160(new Uint8Array([97, 98, 99])); + * ``` + */ +const ripemd160$1 = /* @__PURE__ */ createHasher(() => new _RIPEMD160()); + +/** + * HMAC: RFC2104 message authentication code. + * @module + */ +/** + * Internal class for HMAC. + * Accepts any byte key, although RFC 2104 §3 recommends keys at least + * `HashLen` bytes long. + */ +class _HMAC { + oHash; + iHash; + blockLen; + outputLen; + canXOF = false; + finished = false; + destroyed = false; + constructor(hash, key) { + ahash(hash); + abytes(key, undefined, 'key'); + this.iHash = hash.create(); + if (typeof this.iHash.update !== 'function') + throw new Error('expected Hash instance'); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + // blockLen can be bigger than outputLen + pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36; + this.iHash.update(pad); + // By doing update (processing of the first block) of the outer hash here, + // we can re-use it between multiple calls via clone. + this.oHash = hash.create(); + // Undo internal XOR && apply outer XOR + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36 ^ 0x5c; + this.oHash.update(pad); + clean(pad); + } + update(buf) { + aexists(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + aexists(this); + aoutput(out, this); + this.finished = true; + const buf = out.subarray(0, this.outputLen); + // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before + // overwriting that same prefix with the final tag, leaving any oversized tail untouched. + this.iHash.digestInto(buf); + this.oHash.update(buf); + this.oHash.digestInto(buf); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + // Create new instance without calling constructor since the key + // is already in state and we don't know it. + to ||= Object.create(Object.getPrototypeOf(this), {}); + const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.canXOF = canXOF; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + clone() { + return this._cloneInto(); + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } +} +const hmac$1 = /* @__PURE__ */ (() => { + const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest()); + hmac_.create = (hash, key) => new _HMAC(hash, key); + return hmac_; +})(); + +/** + * PBKDF (RFC 2898). Can be used to create a key from password and salt. + * @module + */ +// Common validation and per-call state setup for sync/async functions. +function pbkdf2Init(hash, _password, _salt, _opts) { + ahash(hash); + const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); + const { c, dkLen, asyncTick } = opts; + anumber(c, 'c'); + anumber(dkLen, 'dkLen'); + anumber(asyncTick, 'asyncTick'); + if (c < 1) + throw new Error('"c" (iterations) must be >= 1'); + // RFC 8018 §5.2 defines `dkLen` as "a positive integer". + if (dkLen < 1) + throw new Error('"dkLen" must be >= 1'); + // RFC 8018 §5.2 step 1 requires rejecting oversize `dkLen` + // before allocating the destination buffer. + if (dkLen > (2 ** 32 - 1) * hash.outputLen) + throw new Error('derived key too long'); + const p = kdfInputToBytes(_password, 'password'); + try { + const s = kdfInputToBytes(_salt, 'salt'); + try { + // DK = PBKDF2(PRF, Password, Salt, c, dkLen); + const DK = new Uint8Array(dkLen); + const { iHash, oHash, outputLen } = hmac$1.create(hash, p); + // Drive keyed hashes directly; the wrapper is only needed to initialize their HMAC midstates. + const u = new Uint8Array(outputLen); + const eng = pbkdf2Engine(iHash, oHash, s, u); + return { c, dkLen, asyncTick, DK, outputLen, eng }; + } + finally { + // Uint8Array inputs belong to the caller; only wipe our UTF-8 conversion. + if (typeof _salt === 'string') + clean(s); + } + } + finally { + if (typeof _password === 'string') + clean(p); + } +} +// Per-call PRF driver writes U1 into both `u` and `Ti`, then later digests into `u`; +// shared by the sync and async variants. +function pbkdf2Engine(iHash, oHash, salt, u) { + const counter = new Uint8Array(4); + const view = createView(counter); + // Full clones retain tree/config state; absorb salt before async yields without cloning input. + const salted = iHash._cloneInto().update(salt); + // u1() overwrites the worker before reading it. Seed from the outer midstate so a long salt + // cannot pre-populate a tree stack that the first reset would abandon without wiping. + const work = oHash._cloneInto(); + const iClone = iHash._cloneInto; // Capture before mixed feedback can materialize state tuples. + const oClone = oHash._cloneInto; + return { + u1: (ti, Ti) => { + view.setInt32(0, ti, false); + salted._cloneInto(work).update(counter).digestInto(u); + oHash._cloneInto(work).update(u).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + }, + // Whole `F` inner loop for the sync variant: one optimized function owns the hot loop. + rounds: (c, Ti) => { + for (let ui = 1; ui < c; ui++) { + iClone.call(iHash, work).update(u).digestInto(u); + oClone.call(oHash, work).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + } + }, + output: (DK) => { + // Keyed templates and derived worker states are secret material. + iHash.destroy(); + oHash.destroy(); + salted.destroy(); + work.destroy(); + // Shared sync/async cleanup point: wipe transient PRF state + // while preserving the derived key buffer. + clean(u); + return DK; + }, + }; +} +/** + * PBKDF2-HMAC: RFC 8018 key derivation function. + * @param hash - hash function that would be used e.g. sha256 + * @param password - password from which a derived key is generated; + * JS string inputs are UTF-8 encoded first + * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first + * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided, + * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}. + * @returns Derived key bytes. + * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error} + * @example + * PBKDF2-HMAC: RFC 2898 key derivation function. + * ```ts + * import { pbkdf2 } from '@noble/hashes/pbkdf2.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); + * ``` + */ +function pbkdf2$3(hash, password, salt, opts) { + const { c, dkLen, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) { + // Ti = F(Password, Salt, c, i) + // The last Ti view can be shorter than hLen, which applies + // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies. + const Ti = DK.subarray(pos, pos + outputLen); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + eng.u1(ti, Ti); + // Uc = PRF(Password, Uc−1); Ti ^= Uc + eng.rounds(c, Ti); + } + return eng.output(DK); +} + +/** + * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. + * SHA256 is the fastest hash implementable in JS, even faster than Blake3. + * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and + * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}. + * @module + */ +/** + * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits + * of the cube roots of the first 64 primes (2..311). + */ +// prettier-ignore +const SHA256_K = /* @__PURE__ */ Uint32Array.from([ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +]); +/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */ +const SHA256_W = /* @__PURE__ */ new Uint32Array(64); +/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */ +class SHA2_32B extends HashMD { + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + // Numeric initializers matter: starting the fields as `undefined` changes + // V8's field representation and makes sha256 3x slower (measured). + A = 0; + B = 0; + C = 0; + D = 0; + E = 0; + F = 0; + G = 0; + H = 0; + constructor(outputLen, IV) { + super(64, outputLen, 8, false); + this.A = IV[0] | 0; + this.B = IV[1] | 0; + this.C = IV[2] | 0; + this.D = IV[3] | 0; + this.E = IV[4] | 0; + this.F = IV[5] | 0; + this.G = IV[6] | 0; + this.H = IV[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + // prettier-ignore + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + _cloneInto(to) { + (to ||= new this.constructor()).set(...this.get()); + return this._cloneIntoMeta(to); + } + process(view, offset) { + // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W[i - 15]; + const W2 = SHA256_W[i - 2]; + const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); + const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); + SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; + } + // Compression function main loop, 64 rounds + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); + const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); + const T2 = (sigma0 + Maj(A, B, C)) | 0; + H = G; + G = F; + F = E; + E = (D + T1) | 0; + D = C; + C = B; + B = A; + A = (T1 + T2) | 0; + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + E = (E + this.E) | 0; + F = (F + this.F) | 0; + G = (G + this.G) | 0; + H = (H + this.H) | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + clean(SHA256_W); } - div(other) { - const o = BigNumber.from(other); - if (o.isZero()) { - throwFault("division by zero", "div"); - } - return toBigNumber(toBN(this).div(toBN(other))); + destroy() { + // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves + // update()/digest() callable on reused instances. + this.destroyed = true; + this.set(0, 0, 0, 0, 0, 0, 0, 0); + clean(this.buffer); } - mul(other) { - return toBigNumber(toBN(this).mul(toBN(other))); +} +/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */ +class _SHA256 extends SHA2_32B { + constructor() { + super(32, SHA256_IV); } - mod(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot modulo negative values", "mod"); - } - return toBigNumber(toBN(this).umod(value)); +} +// SHA2-512 is slower than sha256 in js because u64 operations are slow. +// SHA-384 / SHA-512 round constants from RFC 6234 §5.2: +// 80 full 64-bit words split into high/low halves. +// prettier-ignore +const K512 = /* @__PURE__ */ (() => split([ + '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', + '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', + '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', + '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', + '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', + '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', + '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', + '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', + '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', + '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', + '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', + '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', + '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', + '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', + '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', + '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', + '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', + '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', + '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', + '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' +].map(n => BigInt(n))))(); +const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); +const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); +// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. +const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); +// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. +const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); +/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */ +class SHA2_64B extends HashMD { + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + // h -- high 32 bits, l -- low 32 bits + // Numeric initializers matter: starting the fields as `undefined` changes + // V8's field representation and slows hashing down (measured on sha256). + Ah = 0; + Al = 0; + Bh = 0; + Bl = 0; + Ch = 0; + Cl = 0; + Dh = 0; + Dl = 0; + Eh = 0; + El = 0; + Fh = 0; + Fl = 0; + Gh = 0; + Gl = 0; + Hh = 0; + Hl = 0; + constructor(outputLen, IV) { + super(128, outputLen, 16, false); + this.Ah = IV[0] | 0; + this.Al = IV[1] | 0; + this.Bh = IV[2] | 0; + this.Bl = IV[3] | 0; + this.Ch = IV[4] | 0; + this.Cl = IV[5] | 0; + this.Dh = IV[6] | 0; + this.Dl = IV[7] | 0; + this.Eh = IV[8] | 0; + this.El = IV[9] | 0; + this.Fh = IV[10] | 0; + this.Fl = IV[11] | 0; + this.Gh = IV[12] | 0; + this.Gl = IV[13] | 0; + this.Hh = IV[14] | 0; + this.Hl = IV[15] | 0; } - pow(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot raise to negative values", "pow"); - } - return toBigNumber(toBN(this).pow(value)); + // prettier-ignore + get() { + const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; } - and(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'and' negative values", "and"); - } - return toBigNumber(toBN(this).and(value)); + // prettier-ignore + set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { + this.Ah = Ah | 0; + this.Al = Al | 0; + this.Bh = Bh | 0; + this.Bl = Bl | 0; + this.Ch = Ch | 0; + this.Cl = Cl | 0; + this.Dh = Dh | 0; + this.Dl = Dl | 0; + this.Eh = Eh | 0; + this.El = El | 0; + this.Fh = Fh | 0; + this.Fl = Fl | 0; + this.Gh = Gh | 0; + this.Gl = Gl | 0; + this.Hh = Hh | 0; + this.Hl = Hl | 0; } - or(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'or' negative values", "or"); - } - return toBigNumber(toBN(this).or(value)); + _cloneInto(to) { + (to ||= new this.constructor()).set(...this.get()); + return this._cloneIntoMeta(to); } - xor(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'xor' negative values", "xor"); + process(view, offset) { + // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) { + SHA512_W_H[i] = view.getUint32(offset); + SHA512_W_L[i] = view.getUint32((offset += 4)); } - return toBigNumber(toBN(this).xor(value)); - } - mask(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot mask negative values", "mask"); + for (let i = 16; i < 80; i++) { + // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) + const W15h = SHA512_W_H[i - 15] | 0; + const W15l = SHA512_W_L[i - 15] | 0; + const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7); + const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7); + // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) + const W2h = SHA512_W_H[i - 2] | 0; + const W2l = SHA512_W_L[i - 2] | 0; + const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6); + const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6); + // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16]; + const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); + const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); + SHA512_W_H[i] = SUMh | 0; + SHA512_W_L[i] = SUMl | 0; } - return toBigNumber(toBN(this).maskn(value)); - } - shl(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shl"); + let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + // Compression function main loop, 80 rounds + for (let i = 0; i < 80; i++) { + // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) + const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41); + const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41); + //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const CHIh = (Eh & Fh) ^ (~Eh & Gh); + const CHIl = (El & Fl) ^ (~El & Gl); + // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] + // prettier-ignore + const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); + const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); + const T1l = T1ll | 0; + // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) + const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39); + const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39); + const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); + const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); + Hh = Gh | 0; + Hl = Gl | 0; + Gh = Fh | 0; + Gl = Fl | 0; + Fh = Eh | 0; + Fl = El | 0; + ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh = Ch | 0; + Dl = Cl | 0; + Ch = Bh | 0; + Cl = Bl | 0; + Bh = Ah | 0; + Bl = Al | 0; + const All = add3L(T1l, sigma0l, MAJl); + Ah = add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; } - return toBigNumber(toBN(this).shln(value)); + // Add the compressed chunk to the current hash value + ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); } - shr(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shr"); - } - return toBigNumber(toBN(this).shrn(value)); + roundClean() { + clean(SHA512_W_H, SHA512_W_L); } - eq(other) { - return toBN(this).eq(toBN(other)); + destroy() { + // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves + // update()/digest() callable on reused instances. + this.destroyed = true; + clean(this.buffer); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } - lt(other) { - return toBN(this).lt(toBN(other)); +} +/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */ +class _SHA512 extends SHA2_64B { + constructor() { + super(64, SHA512_IV); } - lte(other) { - return toBN(this).lte(toBN(other)); +} +/** + * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info: + * + * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack. + * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + * - Each sha256 hash is executing 2^18 bit operations. + * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA2-256. + * ```ts + * sha256(new Uint8Array([97, 98, 99])); + * ``` + */ +const sha256$2 = /* @__PURE__ */ createHasher(() => new _SHA256(), +/* @__PURE__ */ oidNist(0x01)); +/** + * SHA2-512 hash function from RFC 4634. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA2-512. + * ```ts + * sha512(new Uint8Array([97, 98, 99])); + * ``` + */ +const sha512$1 = /* @__PURE__ */ createHasher(() => new _SHA512(), +/* @__PURE__ */ oidNist(0x03)); + +/** + * SHA3 (keccak) hash function, based on a new "Sponge function" design. + * Different from older hashes, the internal state is bigger than output size. + * + * Check out + * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202}, + * {@link https://keccak.team/keccak.html | Website}, and + * {@link https://crypto.stackexchange.com/q/15727 | the differences between + * SHA-3 and Keccak}. + * + * Check out `sha3-addons` module for cSHAKE, k12, and others. + * @module + */ +// No __PURE__ annotations in sha3 header: +// EVERYTHING is in fact used on every export. +// Various per round constants calculations +const _0n = BigInt(0); +const _1n = BigInt(1); +const _2n = BigInt(2); +const _7n = BigInt(7); +const _256n = BigInt(256); +// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors +// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`. +const _0x71n = BigInt(0x71); +const SHA3_PI = []; +const SHA3_ROTL = []; +const _SHA3_IOTA = []; // no pure annotation: var is always used +for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { + // Pi + [x, y] = [y, (2 * x + 3 * y) % 5]; + SHA3_PI.push(2 * (5 * y + x)); + // Rotational + SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); + // Iota + let t = _0n; + for (let j = 0; j < 7; j++) { + R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; + if (R & _2n) + t ^= _1n << ((_1n << BigInt(j)) - _1n); } - gt(other) { - return toBN(this).gt(toBN(other)); + _SHA3_IOTA.push(t); +} +const IOTAS = split(_SHA3_IOTA, true); +// `split(..., true)` keeps the local little-endian lane-word layout used by +// `state32`, so these `H` / `L` tables follow the file's first-word / +// second-word lane slots rather than `_u64.ts`'s usual high/low naming. +const SHA3_IOTA_H = IOTAS[0]; +const SHA3_IOTA_L = IOTAS[1]; +// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can +// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only +// consumer of left-rotates; other hashes use right-rotates from _u64. +// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64. +const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); +const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); +const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); +const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); +const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); +const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); +// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2. +// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation. +const B = new Uint32Array(5 * 2); +/** + * `keccakf1600` internal permutation, additionally allows adjusting the round count. + * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words + * in this file's local little-endian lane-word order + * @param rounds - number of rounds to execute + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @throws If `rounds` is outside the supported `1..24` range. {@link Error} + * @example + * Permute a Keccak state with the default 24 rounds. + * ```ts + * keccakP(new Uint32Array(50)); + * ``` + */ +function keccakP(s, rounds = 24) { + if (!(s instanceof Uint32Array)) + throw new TypeError('"s" expected Uint32Array(50), got type=' + typeof s); + if (s.length !== 50) + throw new RangeError('"s" expected Uint32Array(50), got length=' + s.length); + anumber(rounds, 'rounds'); + // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table. + if (rounds < 1 || rounds > 24) + throw new Error('"rounds" expected integer 1..24'); + // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) + for (let round = 24 - rounds; round < 24; round++) { + // Theta θ + for (let x = 0; x < 10; x++) + B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; + for (let x = 0; x < 10; x += 2) { + const idx1 = (x + 8) % 10; + const idx0 = (x + 2) % 10; + const B0 = B[idx0]; + const B1 = B[idx0 + 1]; + const Th = rotlH(B0, B1, 1) ^ B[idx1]; + const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; + for (let y = 0; y < 50; y += 10) { + s[x + y] ^= Th; + s[x + y + 1] ^= Tl; + } + } + // Rho (ρ) and Pi (π) + let curH = s[2]; + let curL = s[3]; + for (let t = 0; t < 24; t++) { + const shift = SHA3_ROTL[t]; + const Th = rotlH(curH, curL, shift); + const Tl = rotlL(curH, curL, shift); + const PI = SHA3_PI[t]; + curH = s[PI]; + curL = s[PI + 1]; + s[PI] = Th; + s[PI + 1] = Tl; + } + // Chi (χ) + // Same as: + // for (let x = 0; x < 10; x++) B[x] = s[y + x]; + // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; + for (let y = 0; y < 50; y += 10) { + const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3]; + s[y] ^= ~s[y + 2] & s[y + 4]; + s[y + 1] ^= ~s[y + 3] & s[y + 5]; + s[y + 2] ^= ~s[y + 4] & s[y + 6]; + s[y + 3] ^= ~s[y + 5] & s[y + 7]; + s[y + 4] ^= ~s[y + 6] & s[y + 8]; + s[y + 5] ^= ~s[y + 7] & s[y + 9]; + s[y + 6] ^= ~s[y + 8] & b0; + s[y + 7] ^= ~s[y + 9] & b1; + s[y + 8] ^= ~b0 & b2; + s[y + 9] ^= ~b1 & b3; + } + // Iota (ι) + s[0] ^= SHA3_IOTA_H[round]; + s[1] ^= SHA3_IOTA_L[round]; } - gte(other) { - return toBN(this).gte(toBN(other)); + clean(B); +} +/** + * Keccak sponge function. + * @param blockLen - absorb/squeeze rate in bytes + * @param suffix - domain separation suffix byte + * @param outputLen - default digest length in bytes. This base sponge only + * requires a non-negative integer; wrappers that need positive output + * lengths must enforce that themselves. + * @param enableXOF - whether XOF output is allowed + * @param rounds - number of Keccak-f rounds + * @example + * Build a sponge state, absorb bytes, then finalize a digest. + * ```ts + * const hash = new Keccak(136, 0x06, 32); + * hash.update(new Uint8Array([1, 2, 3])); + * hash.digest(); + * ``` + */ +class Keccak { + state; + pos = 0; + posOut = 0; + finished = false; + state32; + destroyed = false; + blockLen; + suffix; + outputLen; + canXOF; + enableXOF = false; + rounds; + // NOTE: we accept arguments in bytes instead of bits here. + constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { + anumber(blockLen, 'blockLen'); + anumber(suffix, 'suffix'); + anumber(rounds, 'rounds'); + abool(enableXOF, 'enableXOF'); + this.blockLen = blockLen; + this.suffix = suffix; + this.outputLen = outputLen; + this.enableXOF = enableXOF; + this.canXOF = enableXOF; + this.rounds = rounds; + // Can be passed from user as dkLen + anumber(outputLen, 'outputLen'); + // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state. + if (!(0 < blockLen && blockLen < 200)) + throw new Error('"blockLen" must be 1..199'); + this.state = new Uint8Array(200); + this.state32 = u32(this.state); + } + clone() { + return this._cloneInto(); + } + keccak() { + swap32IfBE(this.state32); + keccakP(this.state32, this.rounds); + swap32IfBE(this.state32); + this.posOut = 0; + this.pos = 0; } - isNegative() { - return this._hex[0] === "-"; + update(data) { + aexists(this); + abytes(data); + const { blockLen, state, state32 } = this; + const len = data.length; + // Absorb full blocks with u32 XORs when both sides are 4-byte aligned. + // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe. + const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0; + const blockLen32 = blockLen / 4; + const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined; + for (let pos = 0; pos < len;) { + if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) { + for (let i = 0, o = pos / 4; i < blockLen32; i++) + state32[i] ^= data32[o + i]; + pos += blockLen; + // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override, + // so it must reflect the fully-absorbed block before the permutation fires. + this.pos = blockLen; + this.keccak(); + continue; + } + const take = Math.min(blockLen - this.pos, len - pos); + for (let i = 0; i < take; i++) + state[this.pos++] ^= data[pos++]; + if (this.pos === blockLen) + this.keccak(); + } + return this; } - isZero() { - return toBN(this).isZero(); + finish() { + if (this.finished) + return; + this.finished = true; + const { state, suffix, pos, blockLen } = this; + // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1. + // These byte values already include the first padding bit, while the + // final `0x80` below supplies the closing `1` bit in the last rate byte. + state[pos] ^= suffix; + // If that combined suffix lands in the last rate byte and already sets + // bit 7, absorb it first so the final pad10*1 bit can be xored into a + // fresh block. + if ((suffix & 0x80) !== 0 && pos === blockLen - 1) + this.keccak(); + state[blockLen - 1] ^= 0x80; + this.keccak(); } - toNumber() { - try { - return toBN(this).toNumber(); - } - catch (error) { - throwFault("overflow", "toNumber", this.toString()); + writeInto(out) { + aexists(this, false); + abytes(out); + this.finish(); + const bufferOut = this.state; + const { blockLen } = this; + for (let pos = 0, len = out.length; pos < len;) { + if (this.posOut >= blockLen) + this.keccak(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; } - // @ts-ignore - return null; + return out; } - toBigInt() { - try { - return BigInt(this.toString()); - } - catch (e) { } - return logger$5.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, { - value: this.toString(), - }); + xofInto(out) { + // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base + // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/ + // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF. + if (!this.enableXOF) + throw new Error('XOF is not enabled'); + return this.writeInto(out); } - toString() { - // Lots of people expect this, which we do not support, so check (See: #889) - if (arguments.length > 0) { - if (arguments[0] === 10) { - if (!_warnedToStringRadix) { - _warnedToStringRadix = true; - logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed"); - } - } - else if (arguments[0] === 16) { - logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - else { - logger$5.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - } - return toBN(this).toString(10); + xof(bytes) { + anumber(bytes); + return this.xofInto(new Uint8Array(bytes)); } - toHexString() { - return this._hex; + digestInto(out) { + aoutput(out, this); + if (this.finished) + throw new Error('digest() was already called'); + // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest. + this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen)); + this.destroy(); } - toJSON(key) { - return { type: "BigNumber", hex: this.toHexString() }; + digest() { + const out = new Uint8Array(this.outputLen); + this.digestInto(out); + return out; } - static from(value) { - if (value instanceof BigNumber) { - return value; - } - if (typeof value === "string") { - if (value.match(/^-?0x[0-9a-f]+$/i)) { - return new BigNumber(_constructorGuard, toHex(value)); - } - if (value.match(/^-?[0-9]+$/)) { - return new BigNumber(_constructorGuard, toHex(new BN(value))); - } - return logger$5.throwArgumentError("invalid BigNumber string", "value", value); - } - if (typeof value === "number") { - if (value % 1) { - throwFault("underflow", "BigNumber.from", value); - } - if (value >= MAX_SAFE || value <= -MAX_SAFE) { - throwFault("overflow", "BigNumber.from", value); - } - return BigNumber.from(String(value)); - } - const anyValue = value; - if (typeof anyValue === "bigint") { - return BigNumber.from(anyValue.toString()); - } - if (isBytes(anyValue)) { - return BigNumber.from(hexlify(anyValue)); - } - if (anyValue) { - // Hexable interface (takes priority) - if (anyValue.toHexString) { - const hex = anyValue.toHexString(); - if (typeof hex === "string") { - return BigNumber.from(hex); - } - } - else { - // For now, handle legacy JSON-ified values (goes away in v6) - let hex = anyValue._hex; - // New-form JSON - if (hex == null && anyValue.type === "BigNumber") { - hex = anyValue.hex; - } - if (typeof hex === "string") { - if (isHexString(hex) || - (hex[0] === "-" && isHexString(hex.substring(1)))) { - return BigNumber.from(hex); - } - } - } - } - return logger$5.throwArgumentError("invalid BigNumber value", "value", value); + destroy() { + this.destroyed = true; + clean(this.state); } - static isBigNumber(value) { - return !!(value && value._isBigNumber); + _cloneInto(to) { + const { blockLen, suffix, outputLen, rounds, enableXOF } = this; + to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); + // Reused destinations can come from a different rate/capacity variant, so clone must rewrite + // the sponge geometry as well as the state words. + to.blockLen = blockLen; + to.state32.set(this.state32); + // Sponge padding and XOF output are positional, so both offsets are part of the clone state. + to.pos = this.pos; + to.posOut = this.posOut; + to.finished = this.finished; + to.rounds = rounds; + // Suffix can change in cSHAKE + to.suffix = suffix; + to.outputLen = outputLen; + to.enableXOF = enableXOF; + // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone + // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie. + to.canXOF = this.canXOF; + to.destroyed = this.destroyed; + return to; } } -// Normalize the hex string -// @ts-ignore -function toHex(value) { - // For BN, call on the hex string - if (typeof value !== "string") { - return toHex(value.toString(16)); - } - // If negative, prepend the negative sign to the normalized positive value - if (value[0] === "-") { - // Strip off the negative sign - value = value.substring(1); - // Cannot have multiple negative signs (e.g. "--0x04") - if (value[0] === "-") { - logger$5.throwArgumentError("invalid hex", "value", value); - } - // Call toHex on the positive component - value = toHex(value); - // Do not allow "-0x00" - if (value === "0x00") { - return value; - } - // Negate the value - return "-" + value; - } - // Add a "0x" prefix if missing - if (value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - // Normalize zero - if (value === "0x") { - return "0x00"; - } - // Make the string even length - if (value.length % 2) { - value = "0x0" + value.substring(2); - } - // Trim to smallest even-length string - while (value.length > 4 && value.substring(0, 4) === "0x00") { - value = "0x" + value.substring(4); - } - return value; +const genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info); +/** + * SHA3-256 hash function. Different from keccak-256. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA3-256. + * ```ts + * sha3_256(new Uint8Array([97, 98, 99])); + * ``` + */ +const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, +/* @__PURE__ */ oidNist(0x08)); +/** + * SHA3-512 hash function. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA3-512. + * ```ts + * sha3_512(new Uint8Array([97, 98, 99])); + * ``` + */ +const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, +/* @__PURE__ */ oidNist(0x0a)); +/** + * Keccak-256 hash function. Different from SHA3-256. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with Keccak-256. + * ```ts + * keccak_256(new Uint8Array([97, 98, 99])); + * ``` + */ +const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32); + +/*! + * assert.js - assert for bcrypto + * Copyright (c) 2020, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + +var assert_1; +var hasRequiredAssert; + +function requireAssert () { + if (hasRequiredAssert) return assert_1; + hasRequiredAssert = 1; + + /* + * Assert + */ + + function assert(val, msg) { + if (!val) { + const err = new Error(msg || 'Assertion failed'); + + if (Error.captureStackTrace) + Error.captureStackTrace(err, assert); + + throw err; + } + } + + /* + * Expose + */ + + assert_1 = assert; + return assert_1; +} + +var customBrowser = {}; + +/*! + * custom.js - custom inspect symbol for bcrypto + * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + +var hasRequiredCustomBrowser; + +function requireCustomBrowser () { + if (hasRequiredCustomBrowser) return customBrowser; + hasRequiredCustomBrowser = 1; + + customBrowser.custom = 'inspect'; + return customBrowser; +} + +var bn; +var hasRequiredBn; + +function requireBn () { + if (hasRequiredBn) return bn; + hasRequiredBn = 1; + + const {custom} = requireCustomBrowser(); + + /* + * Constants + */ + + const zeros = [ + '', + '0', + '00', + '000', + '0000', + '00000', + '000000', + '0000000', + '00000000', + '000000000', + '0000000000', + '00000000000', + '000000000000', + '0000000000000', + '00000000000000', + '000000000000000', + '0000000000000000', + '00000000000000000', + '000000000000000000', + '0000000000000000000', + '00000000000000000000', + '000000000000000000000', + '0000000000000000000000', + '00000000000000000000000', + '000000000000000000000000', + '0000000000000000000000000' + ]; + + const groupSizes = [ + 0x00, 0x19, 0x10, 0x0c, 0x0b, 0x0a, + 0x09, 0x08, 0x08, 0x07, 0x07, 0x07, + 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 + ]; + + const groupBases = [ + 0x00000000, 0x02000000, 0x0290d741, 0x01000000, + 0x02e90edd, 0x039aa400, 0x0267bf47, 0x01000000, + 0x0290d741, 0x00989680, 0x012959c3, 0x0222c000, + 0x03bd7765, 0x0072e440, 0x00adcea1, 0x01000000, + 0x01704f61, 0x0206fc40, 0x02cddcf9, 0x03d09000, + 0x003e5185, 0x004ea360, 0x006235f7, 0x00798000, + 0x009502f9, 0x00b54ba0, 0x00daf26b, 0x01069c00, + 0x0138f9ad, 0x0172c9e0, 0x01b4d89f, 0x02000000, + 0x025528a1, 0x02b54a20, 0x03216b93, 0x039aa400 + ]; + + const primes = { + p192: null, + p224: null, + p521: null, + k256: null, + p251: null, + p25519: null, + p448: null + }; + + const modes = { + NONE: 0, + QUO: 1, + REM: 2, + BOTH: 3, + EUCLID: 4, + ALL: 7 + }; + + const WND_WIDTH = 4; + const WND_SIZE = 1 << (WND_WIDTH - 1); + + const HAS_BIGINT = typeof BigInt === 'function'; + + /** + * BN + */ + + class BN { + constructor(num, base, endian) { + this.words = [0]; + this.length = 1; + this.negative = 0; + this.red = null; + this.from(num, base, endian); + } + + /* + * Addition Engine + */ + + _iadd(a, b) { + let carry = 0; + let i = 0; + + // a.length > b.length + if (a.length < b.length) + [a, b] = [b, a]; + + if (a !== this) + this._alloc(a.length); + + for (; i < b.length; i++) { + const r = (a.words[i] | 0) + (b.words[i] | 0) + carry; + + this.words[i] = r & 0x3ffffff; + + carry = r >>> 26; + } + + for (; carry !== 0 && i < a.length; i++) { + const r = (a.words[i] | 0) + carry; + + this.words[i] = r & 0x3ffffff; + + carry = r >>> 26; + } + + this.length = a.length; + + if (carry !== 0) { + this._alloc(this.length + 1); + this.words[this.length++] = carry; + } else if (a !== this) { + // Copy the rest of the words. + for (; i < a.length; i++) + this.words[i] = a.words[i]; + } + + // Note: we shouldn't need to strip here. + return this; + } + + _iaddn(num) { + this.words[0] += num; + + if (this.words[0] < 0x4000000) + return this; + + // Carry. + let i = 0; + + this._alloc(this.length + 1); + + this.words[this.length] = 0; + + for (; i < this.length && this.words[i] >= 0x4000000; i++) { + this.words[i] -= 0x4000000; + this.words[i + 1] += 1; + } + + this.length = Math.max(this.length, i + 1); + + // Note: we shouldn't need to strip here. + return this; + } + + /* + * Addition + */ + + iadd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.negative === num.negative) { + // x + y == x + y + // (-x) + (-y) == -(x + y) + this._iadd(this, num); + } else { + // x + (-y) == x - y == -(y - x) + // (-x) + y == y - x == -(x - y) + const cmp = this.ucmp(num); + + // x + (-x) == (-x) + x == 0 + if (cmp === 0) { + this.words[0] = 0; + this.length = 1; + this.negative = 0; + return this; + } + + if (cmp < 0) { + this._isub(num, this); + this.negative ^= 1; + } else { + this._isub(this, num); + } + } + + return this; + } + + iaddn(num) { + enforce(isSMI(num), 'num', 'smi'); + + const negative = (num < 0) | 0; + + if (negative) + num = -num; + + if (this.negative === negative) { + // x + y == x + y + // (-x) + (-y) == -(x + y) + this._iaddn(num); + } else { + // x + (-y) == x - y == -(y - x) + // (-x) + y == y - x == -(x - y) + if (this.length === 1 && this.words[0] < num) { + this.words[0] = num - this.words[0]; + this.negative ^= 1; + } else { + this._isubn(num); + } + } + + return this; + } + + add(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (num.length > this.length) + return num.clone().iadd(this); + + return this.clone().iadd(num); + } + + addn(num) { + return this.clone().iaddn(num); + } + + /* + * Subtraction Engine + */ + + _isub(a, b) { + let carry = 0; + let i = 0; + + // a > b + assert(a.length >= b.length); + + if (a !== this) + this._alloc(a.length); + + for (; i < b.length; i++) { + const r = (a.words[i] | 0) - (b.words[i] | 0) + carry; + + carry = r >> 26; + + this.words[i] = r & 0x3ffffff; + } + + for (; carry !== 0 && i < a.length; i++) { + const r = (a.words[i] | 0) + carry; + + carry = r >> 26; + + this.words[i] = r & 0x3ffffff; + } + + assert(carry === 0); + + // Copy rest of the words. + if (a !== this) { + for (; i < a.length; i++) + this.words[i] = a.words[i]; + } + + this.length = Math.max(this.length, i); + + return this._strip(); + } + + _isubn(num) { + this.words[0] -= num; + + if (this.words[0] >= 0) + return this._normalize(); + + assert(this.length !== 1); + + // Carry. + this._alloc(this.length + 1); + + for (let i = 0; i < this.length && this.words[i] < 0; i++) { + this.words[i] += 0x4000000; + this.words[i + 1] -= 1; + } + + this.words[this.length] = 0; + + return this._strip(); + } + + /* + * Subtraction + */ + + isub(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.negative !== num.negative) { + // x - (-y) == x + y + // (-x) - y == -(x + y) + this._iadd(this, num); + } else { + // x - y == x - y == -(y - x) + // (-x) - (-y) == y - x == -(x - y) + const cmp = this.ucmp(num); + + // x - x == 0 + if (cmp === 0) { + this.words[0] = 0; + this.length = 1; + this.negative = 0; + return this; + } + + if (cmp < 0) { + this._isub(num, this); + this.negative ^= 1; + } else { + this._isub(this, num); + } + } + + return this; + } + + isubn(num) { + enforce(isSMI(num), 'num', 'smi'); + + const negative = (num < 0) | 0; + + if (negative) + num = -num; + + if (this.negative !== negative) { + // x - (-y) == x + y + // (-x) - y == -(x + y) + this._iaddn(num); + } else { + // x - y == x - y == -(y - x) + // (-x) - (-y) == y - x == -(x - y) + if (this.length === 1 && this.words[0] < num) { + this.words[0] = num - this.words[0]; + this.negative ^= 1; + } else { + this._isubn(num); + } + } + + return this; + } + + sub(num) { + return this.clone().isub(num); + } + + subn(num) { + return this.clone().isubn(num); + } + + /* + * Multiplication Engine + */ + + _mul(num, out) { + enforce(BN.isBN(num), 'num', 'bignum'); + enforce(BN.isBN(out), 'out', 'bignum'); + + if (this.length === 10 && num.length === 10) + return comb10MulTo(this, num, out); + + const len = this.length + num.length; + + if (len < 63) + return smallMulTo(this, num, out); + + if (len < 1024) + return bigMulTo(this, num, out); + + return jumboMulTo(this, num, out); + } + + /* + * Multiplication + */ + + imul(num) { + return this.mul(num)._move(this); + } + + imuln(num) { + enforce(isSMI(num), 'num', 'smi'); + + const neg = (num < 0) | 0; + + if (neg) + num = -num; + + // Carry. + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const w = this.words[i] * num; + const lo = (w & 0x3ffffff) + (carry & 0x3ffffff); + + carry >>= 26; + carry += (w / 0x4000000) | 0; + carry += lo >>> 26; + + this.words[i] = lo & 0x3ffffff; + } + + this.negative ^= neg; + + if (carry !== 0) { + this._alloc(this.length + 1); + this.words[this.length++] = carry; + } else { + this._strip(); + } + + return this; + } + + mul(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + const len = this.length + num.length; + const out = new BN(); + + out.words = new Array(len); + + for (let i = 0; i < len; i ++) + out.words[i] = 0; + + return this._mul(num, out); + } + + muln(num) { + return this.clone().imuln(num); + } + + /* + * Multiplication + Shift + */ + + mulShift(num, bits) { + enforce(BN.isBN(num), 'num', 'bignum'); + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + const r = this.mul(num); + const b = r.utestn(bits - 1); + + r.iushrn(bits); + + if (this.negative ^ num.negative) + return r.isubn(b); + + return r.iaddn(b); + } + + /* + * Division Engine + */ + + _div(num, flags) { + enforce(BN.isBN(num), 'num', 'bignum'); + assert((flags & modes.ALL) === flags); + assert(flags !== modes.NONE); + + const a = this; + const b = num; + + nonzero(!b.isZero()); + + if (a.isZero()) + return [new BN(0), new BN(0)]; + + const as = a.negative; + const bs = b.negative; + + a.negative = 0; + b.negative = 0; + + let q = null; + let r = null; + + if (a.ucmp(b) < 0) { + if (flags & modes.QUO) + q = new BN(0); + + if (flags & modes.REM) + r = a.clone(); + } else if (b.length === 1) { + if (flags & modes.QUO) + q = a.quon(b.words[0]); + + if (flags & modes.REM) + r = a.remn(b.words[0]); + } else { + [q, r] = a._wordDiv(b, flags); + } + + a.negative = as; + b.negative = bs; + + if (flags & modes.QUO) { + q.negative = a.negative ^ b.negative; + q._normalize(); + } + + if (flags & modes.REM) { + r.negative = a.negative; + r._normalize(); + } + + if (flags & modes.EUCLID) { + if (flags & modes.QUO) { + assert((flags & modes.REM) !== 0); + + if (r.negative !== 0) { + if (b.negative !== 0) + q.iaddn(1); + else + q.isubn(1); + } + } + + if (flags & modes.REM) { + if (r.negative !== 0) { + if (b.negative !== 0) + r.isub(b); + else + r.iadd(b); + } + } + } + + return [q, r]; + } + + _wordDiv(num, flags) { + let a = this.clone(); + let b = num; + let q = null; + let hi; + + // Normalize. + const word = b.words[b.length - 1] | 0; + const shift = 26 - countBits(word); + + if (shift !== 0) { + b = b.clone(); + + a.iushln(shift); + b.iushln(shift); + + hi = b.words[b.length - 1] | 0; + } else { + hi = word; + } + + // Initialize quotient. + const m = a.length - b.length; + + assert(m >= 0); + + if (flags & modes.QUO) { + q = new BN(0); + q.length = m + 1; + q.words = new Array(q.length); + + for (let i = 0; i < q.length; i++) + q.words[i] = 0; + } + + // Diff. + const d = a.clone(); + + d._ishlnsubmul(b, 1, m); + + if (d.negative === 0) { + if (q) + q.words[m] = 1; + + a = d; + } + + // Divide. + for (let j = m - 1; j >= 0; j--) { + const ahi = a.words[b.length + j]; + const alo = a.words[b.length + j - 1]; + const quo = ((ahi * 0x4000000 + alo) / hi) | 0; + + let qj = Math.min(quo, 0x3ffffff); + + a._ishlnsubmul(b, qj, j); + + while (a.negative !== 0) { + qj -= 1; + a.negative = 0; + a._ishlnsubmul(b, 1, j); + a.ineg(); + } + + if (q) + q.words[j] = qj; + } + + // Strip. + if (q) + q._strip(); + + // Denormalize. + // Note: we shouldn't need to strip `a` here. + if ((flags & modes.REM) && shift !== 0) + a.iushrn(shift); + + return [q, a]; + } + + _ishlnsubmul(num, mul, shift) { + let carry = 0; + let i = 0; + + this._expand(num.length + shift); + + for (; i < num.length; i++) { + const k = (this.words[i + shift] | 0) + carry; + const r = num.words[i] * mul; + const w = k - (r & 0x3ffffff); + + carry = (w >> 26) - ((r / 0x4000000) | 0); + + this.words[i + shift] = w & 0x3ffffff; + } + + for (; i < this.length - shift; i++) { + const w = (this.words[i + shift] | 0) + carry; + + carry = w >> 26; + + this.words[i + shift] = w & 0x3ffffff; + } + + if (carry === 0) + return this._strip(); + + // Subtraction overflow. + assert(carry === -1); + + carry = 0; + + for (let i = 0; i < this.length; i++) { + const w = -(this.words[i] | 0) + carry; + + carry = w >> 26; + + this.words[i] = w & 0x3ffffff; + } + + this.negative = 1; + + return this._strip(); + } + + /* + * Truncation Division + Modulo + */ + + quorem(num) { + return this._div(num, modes.BOTH); + } + + /* + * Truncation Division + */ + + iquo(num) { + return this.quo(num)._move(this); + } + + iquon(num) { + enforce(isSMI(num), 'num', 'smi'); + nonzero(num !== 0); + + const neg = (num < 0) | 0; + + if (neg) + num = -num; + + let carry = 0; + + for (let i = this.length - 1; i >= 0; i--) { + const w = (this.words[i] | 0) + carry * 0x4000000; + + this.words[i] = (w / num) | 0; + + carry = w % num; + } + + this.negative ^= neg; + + return this._strip(); + } + + quo(num) { + return this._div(num, modes.QUO)[0]; + } + + quon(num) { + return this.clone().iquon(num); + } + + /* + * Truncation Modulo + */ + + irem(num) { + return this.rem(num)._move(this); + } + + iremn(num) { + let m = this.remrn(num); + + if (m < 0) + m = -m; + + this.words[0] = m; + this.length = 1; + + return this._normalize(); + } + + rem(num) { + return this._div(num, modes.REM)[1]; + } + + remn(num) { + return this.clone().iremn(num); + } + + remrn(num) { + enforce(isSMI(num), 'num', 'smi'); + nonzero(num !== 0); + + if (num < 0) + num = -num; + + const p = (1 << 26) % num; + + let acc = 0; + + for (let i = this.length - 1; i >= 0; i--) + acc = (p * acc + (this.words[i] | 0)) % num; + + return this.negative !== 0 ? (-acc | 0) : acc; + } + + /* + * Euclidean Division + Modulo + */ + + divmod(num) { + return this._div(num, modes.BOTH | modes.EUCLID); + } + + /* + * Euclidean Division + */ + + idiv(num) { + return this.div(num)._move(this); + } + + idivn(num) { + if (this.negative === 0) + return this.iquon(num); + + const r = this.remrn(num); + + this.iquon(num); + + if (r < 0) { + if (num < 0) + this.iaddn(1); + else + this.isubn(1); + } + + return this; + } + + div(num) { + return this._div(num, modes.BOTH | modes.EUCLID)[0]; + } + + divn(num) { + return this.clone().idivn(num); + } + + /* + * Euclidean Modulo + */ + + imod(num) { + if (this.ucmp(num) < 0) { + if (this.negative !== 0) { + this._isub(num, this); + this.negative = 0; + } + return this; + } + + return this.mod(num)._move(this); + } + + imodn(num) { + this.words[0] = this.modrn(num); + this.length = 1; + this.negative = 0; + return this; + } + + mod(num) { + return this._div(num, modes.REM | modes.EUCLID)[1]; + } + + modn(num) { + return this.clone().imodn(num); + } + + modrn(num) { + enforce(isSMI(num), 'num', 'smi'); + + let r = this.remrn(num); + + if (r < 0) { + if (num < 0) + r -= num; + else + r += num; + } + + return r; + } + + /* + * Round Division + */ + + divRound(num) { + const [q, r] = this.quorem(num); + + // Fast case - exact division. + if (r.isZero()) + return q; + + const bit = num.words[0] & 1; + + num.iushrn(1); + + const cmp = r.ucmp(num); + + num.iushln(1); + + num.words[0] |= bit; + + // Round down. + if (cmp < 0 || (num.isOdd() && cmp === 0)) + return q; + + // Round up. + if (this.negative ^ num.negative) + return q.isubn(1); + + return q.iaddn(1); + } + + /* + * Exponentiation + */ + + ipow(num) { + return this.pow(num)._move(this); + } + + ipown(num) { + return this.pown(num)._move(this); + } + + pow(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let b = countBits(num.words[num.length - 1]); + let r = new BN(1); + + for (let i = num.length - 1; i >= 0; i--) { + const word = num.words[i]; + + for (let j = b - 1; j >= 0; j--) { + r = r.sqr(); + + if ((word >> j) & 1) + r = r.mul(this); + } + + b = 26; + } + + return r; + } + + pown(num) { + enforce(isSMI(num), 'num', 'smi'); + + if (num < 0) + num = -num; + + if (num === 0) + return new BN(1); + + if (num === 1) + return this.clone(); + + const bits = countBits(num); + + let r = this; + + for (let i = bits - 2; i >= 0; i--) { + r = r.sqr(); + + if ((num >> i) & 1) + r = r.mul(this); + } + + return r; + } + + isqr() { + return this.imul(this); + } + + sqr() { + return this.mul(this); + } + + /* + * Roots Engine + */ + + _rootrem(pow, rem) { + enforce((pow >>> 0) === pow, 'num', 'uint32'); + + if (pow === 0) + throw new RangeError('Zeroth root.'); + + if (~pow & this.negative) + throw new RangeError('Negative with even root.'); + + if (this.ucmpn(1) <= 0) + return [this.clone(), new BN(0)]; + + let u = new BN(0); + let t = BN.shift(1, this.bitLength() / pow + 1 | 0); + let v, r; + + if (this.negative !== 0) + t.ineg(); + + if (pow === 2) { + do { + u = t; + t = this.quo(u); + t.iadd(u); + t.iushrn(1); + } while (t.ucmp(u) < 0); + } else { + do { + u = t; + t = u.pown(pow - 1); + t = this.quo(t); + v = u.muln(pow - 1); + t.iadd(v); + t = t.quon(pow); + } while (t.ucmp(u) < 0); + } + + if (rem) { + t = u.pown(pow); + r = this.sub(t); + } + + return [u, r]; + } + + /* + * Roots + */ + + rootrem(pow) { + return this._rootrem(pow, 1); + } + + iroot(pow) { + return this.root(pow)._move(this); + } + + root(pow) { + return this._rootrem(pow, 0)[0]; + } + + isPower(pow) { + enforce((pow >>> 0) === pow, 'num', 'uint32'); + + if (pow === 0 || (~pow & this.negative)) + return false; + + const [, r] = this.rootrem(pow); + + return r.sign() === 0; + } + + sqrtrem() { + return this.rootrem(2); + } + + isqrt() { + return this.sqrt()._move(this); + } + + sqrt() { + return this.root(2); + } + + isSquare() { + return this.isPower(2); + } + + /* + * AND + */ + + iand(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let x = this; + let y = num; + + if (x === y) + return x; + + if ((x.negative | y.negative) === 0) + return x.iuand(y); + + if ((x.negative & y.negative) === 1) { + // (-x) & (-y) == ~(x-1) & ~(y-1) + // == ~((x-1) | (y-1)) + // == -(((x-1) | (y-1)) + 1) + x.iaddn(1); + y.iaddn(1); + x.iuor(y); + x.isubn(1); + y.isubn(1); + return x; + } + + // Assume x is the positive number. + if (x.negative !== 0) + [x, y] = [y.clone(), x]; + + // x & (-y) == x & ~(y-1) + // == x & ~(y-1) + const width = x.bitLength(); + + y.iaddn(1); + y.inotn(width); + x.iuand(y); + y.inotn(width); + y.isubn(1); + + return x._move(this); + } + + iandn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if ((this.negative | (num < 0)) !== 0) + return this.iand(new BN(num)); + + this.words[0] &= num; + this.length = 1; + + return this; + } + + and(num) { + return this.clone().iand(num); + } + + andn(num) { + return this.clone().iandn(num); + } + + andrn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if ((this.negative | (num < 0)) !== 0) { + const n = this.iand(new BN(num)); + + if (n.length > 1) + throw new RangeError('Number exceeds 26 bits.'); + + return n.negative !== 0 ? -n.words[0] : n.words[0]; + } + + return this.words[0] & num; + } + + /* + * Unsigned AND + */ + + iuand(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + this.length = Math.min(this.length, num.length); + + for (let i = 0; i < this.length; i++) + this.words[i] &= num.words[i]; + + return this._strip(); + } + + iuandn(num) { + enforce(isSMI(num), 'num', 'smi'); + + this.words[0] &= Math.abs(num); + this.length = 1; + + return this._normalize(); + } + + uand(num) { + return this.clone().iuand(num); + } + + uandn(num) { + return this.clone().iuandn(num); + } + + uandrn(num) { + enforce(isSMI(num), 'num', 'smi'); + + const n = this.words[0] & Math.abs(num); + + return this.negative !== 0 ? (-n | 0) : n; + } + + /* + * OR + */ + + ior(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let x = this; + let y = num; + + if (x === y) + return x; + + if ((x.negative | y.negative) === 0) + return x.iuor(y); + + if ((x.negative & y.negative) === 1) { + // (-x) | (-y) == ~(x-1) | ~(y-1) + // == ~((x-1) & (y-1)) + // == -(((x-1) & (y-1)) + 1) + x.iaddn(1); + y.iaddn(1); + x.iuand(y); + x.isubn(1); + y.isubn(1); + return x; + } + + // Assume x is the positive number. + y = y.clone(); + + if (x.negative !== 0) + [x, y] = [y, x]; + + // x | (-y) == x | ~(y-1) + // == ~((y-1) & ~x) + // == -(((y-1) & ~x) + 1) + y.iaddn(1); + x.inotn(y.bitLength()); + y.iuand(x); + y.isubn(1); + + return y._move(this); + } + + iorn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if ((this.negative | (num < 0)) !== 0) + return this.ior(new BN(num)); + + this.words[0] |= num; + + return this; + } + + or(num) { + return this.clone().ior(num); + } + + orn(num) { + return this.clone().iorn(num); + } + + /* + * Unsigned OR + */ + + iuor(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + this._expand(num.length); + + for (let i = 0; i < num.length; i++) + this.words[i] |= num.words[i]; + + // Note: we shouldn't need to strip here. + return this; + } + + iuorn(num) { + enforce(isSMI(num), 'num', 'smi'); + + this.words[0] |= Math.abs(num); + + return this; + } + + uor(num) { + return this.clone().iuor(num); + } + + uorn(num) { + return this.clone().iuorn(num); + } + + /* + * XOR + */ + + ixor(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let x = this; + let y = num; + + if (x === y) { + x.words[0] = 0; + x.length = 1; + x.negative = 0; + return x; + } + + if ((x.negative | y.negative) === 0) + return x.iuxor(y); + + if ((x.negative & y.negative) === 1) { + // (-x) ^ (-y) == ~(x-1) ^ ~(y-1) + // == (x-1) ^ (y-1) + x.iaddn(1); + y.iaddn(1); + x.iuxor(y); + x.ineg(); + y.isubn(1); + return x; + } + + // Assume x is the positive number. + if (x.negative !== 0) + [x, y] = [y.clone(), x]; + + // x ^ (-y) == x ^ ~(y-1) + // == ~(x ^ (y-1)) + // == -((x ^ (y-1)) + 1) + y.iaddn(1); + x.iuxor(y); + x.iaddn(1); + x.ineg(); + y.isubn(1); + + return x._move(this); + } + + ixorn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if ((this.negative | (num < 0)) !== 0) + return this.ixor(new BN(num)); + + this.words[0] ^= num; + + return this; + } + + xor(num) { + return this.clone().ixor(num); + } + + xorn(num) { + return this.clone().ixorn(num); + } + + /* + * Unsigned XOR + */ + + iuxor(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let a = this; + let b = num; + + if (a.length < b.length) + [a, b] = [b, a]; + + let i = 0; + + for (; i < b.length; i++) + this.words[i] = a.words[i] ^ b.words[i]; + + if (a !== this) { + this._alloc(a.length); + + for (; i < a.length; i++) + this.words[i] = a.words[i]; + } + + this.length = a.length; + + return this._strip(); + } + + iuxorn(num) { + enforce(isSMI(num), 'num', 'smi'); + + this.words[0] ^= Math.abs(num); + + return this._normalize(); + } + + uxor(num) { + return this.clone().iuxor(num); + } + + uxorn(num) { + return this.clone().iuxorn(num); + } + + /* + * NOT + */ + + inot() { + if (this.negative !== 0) { + // ~(-x) == ~(~(x-1)) == x-1 + this.ineg().isubn(1); + } else { + // ~x == -x-1 == -(x+1) + this.iaddn(1).ineg(); + } + return this; + } + + not() { + return this.clone().inot(); + } + + inotn(width) { + enforce((width >>> 0) === width, 'width', 'uint32'); + + const r = width % 26; + + let s = Math.ceil(width / 26); + let i = 0; + + // Extend the buffer with leading zeroes. + this._expand(s); + + if (r > 0) + s -= 1; + + // Handle complete words. + for (; i < s; i++) + this.words[i] ^= 0x3ffffff; + + // Handle the residue. + if (r > 0) + this.words[i] ^= (1 << r) - 1; + + // And remove leading zeroes. + return this._strip(); + } + + notn(width) { + return this.clone().inotn(width); + } + + /* + * Left Shift + */ + + ishl(num) { + enforce(BN.isBN(num), 'bits', 'bignum'); + enforce(num.bitLength() <= 32, 'bits', 'uint32'); + return this.ishln(num.toNumber()); + } + + ishln(bits) { + return this.iushln(bits); + } + + shl(num) { + return this.clone().ishl(num); + } + + shln(bits) { + return this.clone().ishln(bits); + } + + /* + * Unsigned Left Shift + */ + + iushl(num) { + enforce(BN.isBN(num), 'bits', 'bignum'); + enforce(num.bitLength() <= 32, 'bits', 'uint32'); + return this.iushln(num.toNumber()); + } + + iushln(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + const r = bits % 26; + const s = (bits - r) / 26; + const mask = ((1 << r) - 1) << (26 - r); + + if (r !== 0) { + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const ncarry = this.words[i] & mask; + const c = ((this.words[i] | 0) - ncarry) << r; + + this.words[i] = c | carry; + + carry = ncarry >>> (26 - r); + } + + if (carry !== 0) { + this._alloc(this.length + 1); + this.words[this.length++] = carry; + } + } + + if (s !== 0) { + this._alloc(this.length + s); + + for (let i = this.length - 1; i >= 0; i--) + this.words[i + s] = this.words[i]; + + for (let i = 0; i < s; i++) + this.words[i] = 0; + + this.length += s; + } + + return this._strip(); + } + + ushl(num) { + return this.clone().iushl(num); + } + + ushln(bits) { + return this.clone().iushln(bits); + } + + /* + * Right Shift Engine + */ + + _split(bits, output) { + const r = bits % 26; + const s = Math.min((bits - r) / 26, this.length); + const mask = (1 << r) - 1; + + // Extended mode, copy masked part. + if (output) { + output._alloc(s); + + for (let i = 0; i < s; i++) + output.words[i] = this.words[i]; + + output.length = s; + } + + if (s === 0) ; else if (this.length > s) { + this.length -= s; + for (let i = 0; i < this.length; i++) + this.words[i] = this.words[i + s]; + } else { + this.words[0] = 0; + this.length = 1; + } + + let carry = 0; + + if (r !== 0) { + for (let i = this.length - 1; i >= 0; i--) { + const word = this.words[i] | 0; + + this.words[i] = (carry << (26 - r)) | (word >>> r); + + carry = word & mask; + } + } + + // Push carried bits as a mask. + if (output) { + if (carry !== 0) { + output._alloc(output.length + 1); + output.words[output.length++] = carry; + } else { + if (output.length === 0) + output.words[output.length++] = 0; + + output._strip(); + } + } + + return this._strip(); + } + + /* + * Right Shift + */ + + ishr(num) { + enforce(BN.isBN(num), 'bits', 'bignum'); + enforce(num.bitLength() <= 32, 'bits', 'uint32'); + return this.ishrn(num.toNumber()); + } + + ishrn(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + if (this.negative !== 0) { + // (-x) >> y == ~(x-1) >> y + // == ~((x-1) >> y) + // == -(((x-1) >> y) + 1) + this.iaddn(1); + this.iushrn(bits); + this.isubn(1); + return this; + } + + return this.iushrn(bits); + } + + shr(num) { + return this.clone().ishr(num); + } + + shrn(bits) { + return this.clone().ishrn(bits); + } + + /* + * Unsigned Right Shift + */ + + iushr(num) { + enforce(BN.isBN(num), 'bits', 'bignum'); + enforce(num.bitLength() <= 32, 'bits', 'uint32'); + return this.iushrn(num.toNumber()); + } + + iushrn(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + return this._split(bits, null); + } + + ushr(num) { + return this.clone().iushr(num); + } + + ushrn(bits) { + return this.clone().iushrn(bits); + } + + /* + * Bit Manipulation + */ + + setn(bit, val) { + enforce((bit >>> 0) === bit, 'bit', 'uint32'); + + if (this.negative !== 0) { + this.iaddn(1); + this.usetn(bit, !val); + this.isubn(1); + return this; + } + + return this.usetn(bit, val); + } + + usetn(bit, val) { + enforce((bit >>> 0) === bit, 'bit', 'uint32'); + + const r = bit % 26; + const s = (bit - r) / 26; + + this._expand(s + 1); + + if (val) + this.words[s] |= (1 << r); + else + this.words[s] &= ~(1 << r); + + return this._strip(); + } + + testn(bit) { + enforce((bit >>> 0) === bit, 'bit', 'uint32'); + + const r = bit % 26; + const s = (bit - r) / 26; + + // Fast case: bit is much higher than all existing words. + if (this.length <= s) + return this.negative; + + // Check bit and return. + const w = this.words[s]; + const val = (w >> r) & 1; + + if (this.negative !== 0) { + if (r > 0 && (w & ((1 << r) - 1))) + return val ^ 1; + + let j = s; + + while (j--) { + if (this.words[j] > 0) + return val ^ 1; + } + } + + return val; + } + + utestn(bit) { + enforce((bit >>> 0) === bit, 'bit', 'uint32'); + + const r = bit % 26; + const s = (bit - r) / 26; + + // Fast case: bit is much higher than all existing words. + if (this.length <= s) + return 0; + + // Check bit and return. + return (this.words[s] >> r) & 1; + } + + imaskn(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + if (this.negative !== 0) { + this.iaddn(1); + this.inotn(bits + 1); + this.ineg(); + } + + return this.iumaskn(bits); + } + + maskn(bits) { + return this.clone().imaskn(bits); + } + + iumaskn(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + const r = bits % 26; + + let s = (bits - r) / 26; + + if (this.length <= s) + return this; + + if (r !== 0) + s += 1; + + this.length = Math.min(s, this.length); + + if (r !== 0) + this.words[this.length - 1] &= (1 << r) - 1; + + if (this.length === 0) + this.words[this.length++] = 0; + + return this._strip(); + } + + umaskn(bits) { + return this.clone().iumaskn(bits); + } + + andln(num) { + return this.words[0] & num; + } + + bit(pos) { + return this.utestn(pos); + } + + bits(pos, width) { + enforce((pos >>> 0) === pos, 'pos', 'uint32'); + enforce((width >>> 0) === width, 'width', 'uint32'); + enforce(width <= 26, 'width', 'width'); + + const shift = pos % 26; + const index = (pos - shift) / 26; + + if (index >= this.length) + return 0; + + let bits = (this.words[index] >> shift) & ((1 << width) - 1); + + if (shift + width > 26 && index + 1 < this.length) { + const more = shift + width - 26; + const next = this.words[index + 1] & ((1 << more) - 1); + + bits |= next << (26 - shift); + } + + return bits; + } + + /* + * Negation + */ + + ineg() { + if (!this.isZero()) + this.negative ^= 1; + + return this; + } + + neg() { + return this.clone().ineg(); + } + + iabs() { + this.negative = 0; + return this; + } + + abs() { + return this.clone().iabs(); + } + + /* + * Comparison + */ + + cmp(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.negative !== num.negative) + return num.negative - this.negative; + + const res = this.ucmp(num); + + if (this.negative !== 0) + return -res | 0; + + return res; + } + + cmpn(num) { + enforce(isSMI(num), 'num', 'smi'); + + const negative = (num < 0) | 0; + + if (this.negative !== negative) + return negative - this.negative; + + const res = this.ucmpn(num); + + if (this.negative !== 0) + return -res | 0; + + return res; + } + + eq(num) { + return this.cmp(num) === 0; + } + + eqn(num) { + return this.cmpn(num) === 0; + } + + gt(num) { + return this.cmp(num) > 0; + } + + gtn(num) { + return this.cmpn(num) > 0; + } + + gte(num) { + return this.cmp(num) >= 0; + } + + gten(num) { + return this.cmpn(num) >= 0; + } + + lt(num) { + return this.cmp(num) < 0; + } + + ltn(num) { + return this.cmpn(num) < 0; + } + + lte(num) { + return this.cmp(num) <= 0; + } + + lten(num) { + return this.cmpn(num) <= 0; + } + + sign() { + if (this.negative !== 0) + return -1; + + if (this.length === 1 && this.words[0] === 0) + return 0; + + return 1; + } + + isZero() { + return this.length === 1 && this.words[0] === 0; + } + + isNeg() { + return this.negative !== 0; + } + + isPos() { + return this.negative === 0; + } + + isOdd() { + return (this.words[0] & 1) === 1; + } + + isEven() { + return (this.words[0] & 1) === 0; + } + + /* + * Unsigned Comparison + */ + + ucmp(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.length < num.length) + return -1; + + if (this.length > num.length) + return 1; + + for (let i = this.length - 1; i >= 0; i--) { + const a = this.words[i] | 0; + const b = num.words[i] | 0; + + if (a === b) + continue; + + return (a > b) - (a < b); + } + + return 0; + } + + ucmpn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if (this.length > 1) + return 1; + + const w = this.words[0] | 0; + + if (num < 0) + num = -num; + + return (w > num) - (w < num); + } + + /* + * Number Theoretic Functions + */ + + legendre(num) { + const red = HAS_BIGINT ? BN.red(num) : BN.mont(num); + return this.toRed(red).redLegendre(); + } + + jacobi(num) { + // See: A Binary Algorithm for the Jacobi Symbol + // J. Shallit, J. Sorenson + // Page 3, Section 3 + enforce(BN.isBN(num), 'num', 'bignum'); + + if (num.isZero() || num.isEven()) + throw new Error('jacobi: `num` must be odd.'); + + let a = this._cloneNormal(); + let b = num.clone(); + let j = 1; + + if (b.isNeg()) { + if (a.isNeg()) + j = -1; + b.ineg(); + } + + if (a.isNeg() || a.ucmp(b) >= 0) + a.imod(b); + + while (!a.isZero()) { + const bits = a._makeOdd(); + + if (bits & 1) { + const bmod8 = b.andln(7); + + if (bmod8 === 3 || bmod8 === 5) + j = -j; + } + + if (a.ucmp(b) < 0) { + [a, b] = [b, a]; + + if (a.andln(3) === 3 && b.andln(3) === 3) + j = -j; + } + + a._isub(a, b).iushrn(1); + + const bmod8 = b.andln(7); + + if (bmod8 === 3 || bmod8 === 5) + j = -j; + } + + if (b.cmpn(1) !== 0) + return 0; + + return j; + } + + kronecker(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.isZero()) + return num.ucmpn(1) === 0 ? 1 : 0; + + if (num.isZero()) + return this.ucmpn(1) === 0 ? 1 : 0; + + if (((this.words[0] | num.words[0]) & 1) === 0) + return 0; + + const x = this; + const y = num.clone(); + const bits = y._makeOdd(); + const table = [0, 1, 0, -1, 0, -1, 0, 1]; + + let k = x.jacobi(y); + + if (bits & 1) + k *= table[x.andln(7)]; + + return k | 0; + } + + igcd(num) { + return this.gcd(num)._move(this); + } + + gcd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.isZero()) + return num.abs(); + + if (num.isZero()) + return this.abs(); + + let a = this.clone(); + let b = num.clone(); + + a.negative = 0; + b.negative = 0; + + // Remove common factor of two. + const shift = a._factor2(b); + + if (shift !== 0) { + a.iushrn(shift); + b.iushrn(shift); + } + + for (;;) { + a._makeOdd(); + b._makeOdd(); + + const cmp = a.ucmp(b); + + if (cmp < 0) { + // a > b + [a, b] = [b, a]; + } else if (cmp === 0 || b.ucmpn(1) === 0) { + // Break if a == b. + // Break if b == 1 to avoid repeated subtraction. + break; + } + + a._isub(a, b); + } + + return b.iushln(shift); + } + + ilcm(num) { + return this.lcm(num)._move(this); + } + + lcm(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.isZero() || num.isZero()) + return new BN(0); + + return this.quo(this.gcd(num)).mul(num).iabs(); + } + + egcd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.isZero()) { + return [ + new BN(0), + new BN(num.sign()), + num.abs() + ]; + } + + if (num.isZero()) { + return [ + new BN(this.sign()), + new BN(0), + this.abs() + ]; + } + + const x = this.clone(); + const y = num.clone(); + + x.negative = 0; + y.negative = 0; + + // A * x + B * y = x + const A = new BN(1); + const B = new BN(0); + + // C * x + D * y = y + const C = new BN(0); + const D = new BN(1); + + // Remove common factor of two. + const g = x._factor2(y); + + if (g > 0) { + x.iushrn(g); + y.iushrn(g); + } + + const xp = x.clone(); + const yp = y.clone(); + + while (!x.isZero()) { + let i = x._makeOdd(); + let j = y._makeOdd(); + + while (i--) { + if (A.isOdd() || B.isOdd()) { + A.iadd(yp); + B.isub(xp); + } + + A.iushrn(1); + B.iushrn(1); + } + + while (j--) { + if (C.isOdd() || D.isOdd()) { + C.iadd(yp); + D.isub(xp); + } + + C.iushrn(1); + D.iushrn(1); + } + + if (x.cmp(y) >= 0) { + x.isub(y); + A.isub(C); + B.isub(D); + } else { + y.isub(x); + C.isub(A); + D.isub(B); + } + } + + if (this.negative !== 0) + C.ineg(); + + if (num.negative !== 0) + D.ineg(); + + return [C, D, y.iushln(g)]; + } + + iinvert(num) { + return this.invert(num)._move(this); + } + + invert(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + range(num.sign() > 0, 'invert'); + + if (num.isOdd()) + return this._invertp(num); + + if (num.cmpn(1) === 0) + throw new RangeError('Not invertible.'); + + const [s,, g] = this.egcd(num); + + if (g.cmpn(1) !== 0) + throw new RangeError('Not invertible.'); + + return s.imod(num); + } + + ifermat(num) { + return this.fermat(num)._move(this); + } + + fermat(num) { + const red = HAS_BIGINT ? BN.red(num) : BN.mont(num); + return this.toRed(red).redFermat().fromRed(); + } + + ipowm(y, m, mont) { + return this.powm(y, m, mont)._move(this); + } + + powm(y, m, mont) { + const red = !HAS_BIGINT && mont ? BN.mont(m) : BN.red(m); + return this.toRed(red).redPow(y).fromRed(); + } + + ipowmn(y, m, mont) { + return this.powmn(y, m, mont)._move(this); + } + + powmn(y, m, mont) { + const red = mont ? BN.mont(m) : BN.red(m); + return this.toRed(red).redPown(y).fromRed(); + } + + isqrtm(p) { + return this.sqrtm(p)._move(this); + } + + sqrtm(p) { + enforce(BN.isBN(p), 'p', 'bignum'); + + let red; + + if (p.andln(3) === 3 || p.andln(7) === 5) { + // Probably not worth the setup. + red = BN.red(p); + } else { + red = BN.mont(p); + } + + return this.toRed(red).redSqrt().fromRed(); + } + + isqrtpq(p, q) { + return this.sqrtpq(p, q)._move(this); + } + + sqrtpq(p, q) { + const sp = this.sqrtm(p); + const sq = this.sqrtm(q); + const [mp, mq] = p.egcd(q); + const lhs = sq.mul(mp).mul(p); + const rhs = sp.mul(mq).mul(q); + const n = p.mul(q); + + return lhs.iadd(rhs).imod(n); + } + + /* + * Primality Testing + */ + + isPrime(rng, reps, limit) { + enforce((reps >>> 0) === reps, 'reps', 'uint32'); + + if (!this.isPrimeMR(rng, reps + 1, true)) + return false; + + if (!this.isPrimeLucas(limit)) + return false; + + return true; + } + + isPrimeMR(rng, reps, force2 = false) { + enforce((reps >>> 0) === reps, 'reps', 'uint32'); + enforce(reps > 0, 'reps', 'integer'); + enforce(typeof force2 === 'boolean', 'force2', 'boolean'); + + const n = this; + + if (n.cmpn(7) < 0) { + return n.cmpn(2) === 0 + || n.cmpn(3) === 0 + || n.cmpn(5) === 0; + } + + if (n.isEven()) + return false; + + const nm1 = n.subn(1); + const nm3 = nm1.subn(2); + const k = nm1.zeroBits(); + const q = nm1.ushrn(k); + + const red = BN.red(n); + const rnm1 = nm1.toRed(red); + const rone = new BN(1).toRed(red); + + next: + for (let i = 0; i < reps; i++) { + let x; + + if (i === reps - 1 && force2) { + x = new BN(2); + } else { + x = BN.random(rng, 0, nm3); + x.iaddn(2); + } + + let y = x.toRed(red).redPow(q); + + if (y.cmp(rone) === 0 || y.cmp(rnm1) === 0) + continue; + + for (let j = 1; j < k; j++) { + y = y.redSqr(); + + if (y.cmp(rnm1) === 0) + continue next; + + if (y.cmp(rone) === 0) + return false; + } + + return false; + } + + return true; + } + + isPrimeLucas(limit = 0) { + enforce((limit >>> 0) === limit, 'limit', 'uint32'); + + const n = this; + + // Ignore 0 and 1. + if (n.cmpn(1) <= 0) + return false; + + // Two is the only even prime. + if (n.isEven()) + return n.cmpn(2) === 0; + + let p = 3; + + for (;;) { + if (p > 10000) { + // Thought to be impossible. + throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`); + } + + if (limit !== 0 && p > limit) { + // Optional DoS limit. + return false; + } + + const d = new BN(p * p - 4); + const j = d.jacobi(n); + + if (j === -1) + break; + + if (j === 0) + return n.cmpn(p + 2) === 0; + + if (p === 40) { + if (n.isSquare()) + return false; + } + + p += 1; + } + + const s = n.addn(1); + const r = s._makeOdd(); + + let vk = new BN(2); + let vk1 = new BN(p); + + for (let i = s.bitLength(); i >= 0; i--) { + if (s.utestn(i)) { + vk = vk.mul(vk1).isubn(p).imod(n); + vk1 = vk1.sqr().isubn(2).imod(n); + } else { + vk1 = vk1.mul(vk).isubn(p).imod(n); + vk = vk.sqr().isubn(2).imod(n); + } + } + + if (vk.cmpn(2) === 0 || vk.cmp(n.subn(2)) === 0) { + const a = vk.muln(p).imod(n); + const b = vk1.ushln(1).imod(n); + + if (a.cmp(b) === 0) + return true; + } + + for (let t = 0; t < r - 1; t++) { + if (vk.isZero()) + return true; + + if (vk.cmpn(2) === 0) + return false; + + vk = vk.sqr().isubn(2).imod(n); + } + + return false; + } + + /* + * Twos Complement + */ + + toTwos(width) { + if (this.negative !== 0) + return this.abs().inotn(width).iaddn(1); + + return this.clone(); + } + + fromTwos(width) { + enforce((width >>> 0) === width, 'width', 'uint32'); + range(width > 0, 'width'); + + if (this.testn(width - 1)) + return this.notn(width).iaddn(1).ineg(); + + return this.clone(); + } + + /* + * Reduction Context + */ + + toRed(ctx) { + enforce(ctx instanceof Red, 'ctx', 'reduction context'); + + if (this.red) + throw new Error('Already in reduction context.'); + + return ctx.convertTo(this); + } + + fromRed() { + red(this.red, 'fromRed'); + return this.red.convertFrom(this); + } + + forceRed(ctx) { + enforce(ctx instanceof Red, 'ctx', 'reduction context'); + + if (this.red) { + if (!ctx.m.eq(this.red.m) || ctx.mont !== this.red.mont) + throw new Error('Already in reduction context.'); + } else { + range(this.negative === 0, 'red'); + range(this.ucmp(ctx.m) < 0, 'red'); + } + + return this.clone()._forceRed(ctx); + } + + redIAdd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIAdd'); + return this.red.iadd(this, num); + } + + redAdd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redAdd'); + return this.red.add(this, num); + } + + redIAddn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redIAddn'); + return this.red.iaddn(this, num); + } + + redAddn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redAddn'); + return this.red.addn(this, num); + } + + redISub(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redISub'); + return this.red.isub(this, num); + } + + redSub(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redSub'); + return this.red.sub(this, num); + } + + redISubn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redISubn'); + return this.red.isubn(this, num); + } + + redSubn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redSubn'); + return this.red.subn(this, num); + } + + redIMul(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIMul'); + return this.red.imul(this, num); + } + + redMul(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redMul'); + return this.red.mul(this, num); + } + + redIMuln(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redIMuln'); + return this.red.imuln(this, num); + } + + redMuln(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redMuln'); + return this.red.muln(this, num); + } + + redIDiv(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIDiv'); + return this.red.idiv(this, num); + } + + redDiv(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redDiv'); + return this.red.div(this, num); + } + + redIDivn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redIDivn'); + return this.red.idivn(this, num); + } + + redDivn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redDivn'); + return this.red.divn(this, num); + } + + redIPow(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIPow'); + nonred(!num.red, 'redIPow'); + return this.red.ipow(this, num); + } + + redPow(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redPow'); + nonred(!num.red, 'redPow'); + return this.red.pow(this, num); + } + + redIPown(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redIPown'); + return this.red.ipown(this, num); + } + + redPown(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redPown'); + return this.red.pown(this, num); + } + + redISqr() { + red(this.red, 'redISqr'); + return this.red.isqr(this); + } + + redSqr() { + red(this.red, 'redSqr'); + return this.red.sqr(this); + } + + redISqrt() { + red(this.red, 'redISqrt'); + return this.red.isqrt(this); + } + + redSqrt() { + red(this.red, 'redSqrt'); + return this.red.sqrt(this); + } + + redIDivSqrt(v) { + red(this.red, 'redIDivSqrt'); + return this.red.idivsqrt(this, v); + } + + redDivSqrt(v) { + red(this.red, 'redDivSqrt'); + return this.red.divsqrt(this, v); + } + + redIsSquare() { + red(this.red, 'redIsSquare'); + return this.red.isSquare(this); + } + + redIShl(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIShl'); + nonred(!num.red, 'redIShl'); + return this.red.ishl(this, num); + } + + redShl(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redShl'); + nonred(!num.red, 'redShl'); + return this.red.shl(this, num); + } + + redIShln(num) { + enforce((num >>> 0) === num, 'num', 'uint32'); + red(this.red, 'redIShln'); + return this.red.ishln(this, num); + } + + redShln(num) { + enforce((num >>> 0) === num, 'num', 'uint32'); + red(this.red, 'redShln'); + return this.red.shln(this, num); + } + + redINeg() { + red(this.red, 'redINeg'); + return this.red.ineg(this); + } + + redNeg() { + red(this.red, 'redNeg'); + return this.red.neg(this); + } + + redEq(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redEq'); + return this.red.eq(this, num); + } + + redEqn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redEqn'); + return this.red.eqn(this, num); + } + + redIsHigh() { + red(this.red, 'redIsHigh'); + return this.red.isHigh(this); + } + + redIsLow() { + red(this.red, 'redIsLow'); + return this.red.isLow(this); + } + + redIsOdd() { + red(this.red, 'redIsOdd'); + return this.red.isOdd(this); + } + + redIsEven() { + red(this.red, 'redIsEven'); + return this.red.isEven(this); + } + + redLegendre() { + red(this.red, 'redLegendre'); + return this.red.legendre(this); + } + + redJacobi() { + red(this.red, 'redJacobi'); + return this.red.jacobi(this); + } + + redKronecker() { + red(this.red, 'redKronecker'); + return this.red.kronecker(this); + } + + redIInvert() { + red(this.red, 'redIInvert'); + return this.red.iinvert(this); + } + + redInvert() { + red(this.red, 'redInvert'); + return this.red.invert(this); + } + + redIFermat() { + red(this.red, 'redIFermat'); + return this.red.ifermat(this); + } + + redFermat() { + red(this.red, 'redFermat'); + return this.red.fermat(this); + } + + /* + * Internal + */ + + _move(dest) { + dest.words = this.words; + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + return dest; + } + + _alloc(size) { + while (this.words.length < size) + this.words.push(0); + + return this; + } + + _expand(size) { + this._alloc(size); + + while (this.length < size) + this.words[this.length++] = 0; + + return this; + } + + _strip() { + while (this.length > 1 && this.words[this.length - 1] === 0) + this.length -= 1; + + return this._normalize(); + } + + _normalize() { + assert(this.length > 0); + + // -0 = 0 + if (this.length === 1 && this.words[0] === 0) + this.negative = 0; + + return this; + } + + _check() { + // We never have a zero length number. + assert(this.length > 0); + + // Cannot exceed array bounds. + assert(this.length <= this.words.length); + + if (this.length === 1) { + // Must be normalized. + if (this.words[0] === 0) + assert(this.negative === 0); + return this; + } + + // Must be stripped. + assert(this.words[this.length - 1] !== 0); + + return this; + } + + _invertp(p) { + // Penk's right shift binary EGCD. + // + // See: The Art of Computer Programming, + // Volume 2, Seminumerical Algorithms + // Donald E. Knuth + // Exercise 4.5.2.39 + enforce(BN.isBN(p), 'p', 'bignum'); + range(p.sign() > 0, 'invert'); + assert(p.isOdd()); + + if (p.cmpn(1) === 0) + throw new RangeError('Not invertible.'); + + const a = this.clone(); + const b = p.clone(); + const u = new BN(1); + const v = new BN(0); + + if (a.isNeg() || a.ucmp(b) >= 0) + a.imod(b); + + while (!a.isZero()) { + let i = a._makeOdd(); + let j = b._makeOdd(); + + while (i--) { + if (u.isOdd()) + u._iadd(u, p); + + u.iushrn(1); + } + + while (j--) { + if (v.isOdd()) + v._iadd(v, p); + + v.iushrn(1); + } + + if (a.ucmp(b) >= 0) { + a._isub(a, b); + if (u.ucmp(v) < 0) { + u._isub(v, u); + u._isub(p, u); + } else { + u._isub(u, v); + } + } else { + b._isub(b, a); + if (v.ucmp(u) < 0) { + v._isub(u, v); + v._isub(p, v); + } else { + v._isub(v, u); + } + } + } + + if (b.cmpn(1) !== 0) + throw new RangeError('Not invertible.'); + + assert(v.negative === 0); + assert(v.ucmp(p) < 0); + + return v; + } + + _makeOdd() { + const shift = this.zeroBits(); + + if (shift > 0) + this.iushrn(shift); + + return shift; + } + + _factor2(num) { + // Find common factor of two. + // Expects inputs to be non-zero. + if ((this.words[0] | num.words[0]) & 1) + return 0; + + const len = Math.min(this.length, num.length); + + let r = 0; + + for (let i = 0; i < len; i++) { + const b = zeroBits(this.words[i] | num.words[i]); + + r += b; + + if (b !== 26) + break; + } + + return r; + } + + _cloneNormal() { + return this.red ? this.fromRed() : this.clone(); + } + + _forceRed(ctx) { + this.red = ctx; + return this; + } + + /* + * Helpers + */ + + clone() { + const copy = new BN(); + + copy.words = new Array(this.length); + + for (let i = 0; i < this.length; i++) + copy.words[i] = this.words[i]; + + copy.length = this.length; + copy.negative = this.negative; + copy.red = this.red; + + return copy; + } + + inject(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + this._alloc(num.length); + + for (let i = 0; i < num.length; i++) + this.words[i] = num.words[i]; + + this.length = num.length; + this.negative = num.negative; + this.red = num.red; + + return this; + } + + set(num, endian) { + return this.fromNumber(num, endian); + } + + swap(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + const x = this; + const y = num; + + [x.words, y.words] = [y.words, x.words]; + [x.length, y.length] = [y.length, x.length]; + [x.negative, y.negative] = [y.negative, x.negative]; + [x.red, y.red] = [y.red, x.red]; + + return x; + } + + reverse() { + const neg = this.negative; + + this.fromBuffer(this.toBuffer('be'), 'le'); + this.negative = neg; + + return this; + } + + byteLength() { + return Math.ceil(this.bitLength() / 8); + } + + bitLength() { + const w = this.words[this.length - 1]; + const hi = countBits(w); + return (this.length - 1) * 26 + hi; + } + + zeroBits() { + if (this.isZero()) + return 0; + + if (this.isOdd()) + return 0; + + let r = 0; + + for (let i = 0; i < this.length; i++) { + const b = zeroBits(this.words[i]); + + r += b; + + if (b !== 26) + break; + } + + return r; + } + + isSafe() { + if (this.length <= 2) + return true; + + if (this.length === 3 && this.words[2] === 0x01) + return true; + + return false; + } + + word(pos) { + enforce((pos >>> 0) === pos, 'pos', 'uint32'); + + if (pos >= this.length) + return 0; + + return this.words[pos]; + } + + [custom]() { + let prefix = 'BN'; + + if (this.red) + prefix = 'BN-R'; + + return `<${prefix}: ${this.toString(10)}>`; + } + + /* + * Conversion + */ + + toNumber() { + let num = this.words[0]; + + if (this.length === 2) { + num += this.words[1] * 0x4000000; + } else if (this.length === 3 && this.words[2] === 0x01) { + // Note: at this stage it is known that the top bit is set. + num += 0x10000000000000 + (this.words[1] * 0x4000000); + } else if (this.length > 2) { + throw new RangeError('Number can only safely store up to 53 bits.'); + } + + return this.negative !== 0 ? -num : num; + } + + toDouble() { + let num = 0; + + for (let i = this.length - 1; i >= 0; i--) + num = (num * 0x4000000) + this.words[i]; + + return this.negative !== 0 ? -num : num; + } + + valueOf() { + return this.toDouble(); + } + + toBigInt() { + if (!HAS_BIGINT) + throw new Error('BigInt is not supported!'); + + const s52 = BigInt(52); + const s26 = BigInt(26); + + let i = this.length - 1; + let num = BigInt(0); + + for (; i >= 1; i -= 2) { + const hi = this.words[i] * 0x4000000; + const lo = this.words[i - 1]; + + num = (num << s52) | BigInt(hi + lo); + } + + if (i >= 0) + num = (num << s26) | BigInt(this.words[0]); + + return this.negative !== 0 ? -num : num; + } + + toBool() { + return !this.isZero(); + } + + toString(base, padding) { + base = getBase(base); + + if (padding == null) + padding = 0; + + if (padding === 0) + padding = 1; + + enforce((base >>> 0) === base, 'base', 'uint32'); + enforce((padding >>> 0) === padding, 'padding', 'uint32'); + + if (base < 2 || base > 36) + throw new RangeError('Base ranges between 2 and 36.'); + + this._check(); + + if (base === 16) { + let out = ''; + let off = 0; + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const w = this.words[i]; + const word = (((w << off) | carry) & 0xffffff).toString(16); + + carry = (w >>> (24 - off)) & 0xffffff; + + if (carry !== 0 || i !== this.length - 1) + out = zeros[6 - word.length] + word + out; + else + out = word + out; + + off += 2; + + if (off >= 26) { + off -= 26; + i -= 1; + } + } + + if (carry !== 0) + out = carry.toString(16) + out; + + while (out.length % padding !== 0) + out = '0' + out; + + if (this.negative !== 0) + out = '-' + out; + + return out; + } + + const groupSize = groupSizes[base - 1]; + const groupBase = groupBases[base - 1]; + const c = this.clone(); + + let out = ''; + + c.negative = 0; + + while (!c.isZero()) { + const r = c.remrn(groupBase).toString(base); + + c.iquon(groupBase); + + if (!c.isZero()) + out = zeros[groupSize - r.length] + r + out; + else + out = r + out; + } + + if (this.isZero()) + out = '0'; + + while (out.length % padding !== 0) + out = '0' + out; + + if (this.negative !== 0) + out = '-' + out; + + return out; + } + + toJSON() { + return this.toString(16, 2); + } + + toArray(endian, length) { + return this.toArrayLike(Array, endian, length); + } + + toBuffer(endian, length) { + return this.toArrayLike(bufferExports.Buffer, endian, length); + } + + toArrayLike(ArrayType, endian, length) { + if (endian == null) + endian = 'be'; + + if (length == null) + length = 0; + + enforce(typeof ArrayType === 'function', 'ArrayType', 'function'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + enforce((length >>> 0) === length, 'length', 'uint32'); + + this._check(); + + const bytes = this.byteLength(); + const size = length || Math.max(1, bytes); + + if (bytes > size) + throw new RangeError('Byte array longer than desired length.'); + + const res = allocate(ArrayType, size); + + // See: https://github.com/indutny/bn.js/pull/222 + if (endian === 'be') { + let pos = res.length - 1; + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const shift = (i & 3) << 1; + const word = (this.words[i] << shift) | carry; + + res[pos--] = word & 0xff; + + if (pos >= 0) + res[pos--] = (word >>> 8) & 0xff; + + if (pos >= 0) + res[pos--] = (word >>> 16) & 0xff; + + if (shift === 6) { + if (pos >= 0) + res[pos--] = (word >>> 24) & 0xff; + + carry = 0; + } else { + carry = word >>> 24; + } + } + + if (pos >= 0) { + res[pos--] = carry; + + while (pos >= 0) + res[pos--] = 0; + + carry = 0; + } + + assert(carry === 0); + } else { + let pos = 0; + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const shift = (i & 3) << 1; + const word = (this.words[i] << shift) | carry; + + res[pos++] = word & 0xff; + + if (pos < res.length) + res[pos++] = (word >>> 8) & 0xff; + + if (pos < res.length) + res[pos++] = (word >>> 16) & 0xff; + + if (shift === 6) { + if (pos < res.length) + res[pos++] = (word >>> 24) & 0xff; + + carry = 0; + } else { + carry = word >>> 24; + } + } + + if (pos < res.length) { + res[pos++] = carry; + + while (pos < res.length) + res[pos++] = 0; + + carry = 0; + } + + assert(carry === 0); + } + + return res; + } + + encode(endian, length) { + return this.toBuffer(endian, length); + } + + /* + * Instantiation + */ + + of(num, endian) { + return this.fromNumber(num, endian); + } + + fromNumber(num, endian) { + if (endian == null) + endian = 'be'; + + enforce(isInteger(num), 'num', 'integer'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + const neg = (num < 0) | 0; + + if (neg) + num = -num; + + if (num < 0x4000000) { + this.words[0] = num & 0x3ffffff; + this.length = 1; + } else if (num < 0x10000000000000) { + this.words = [ + num & 0x3ffffff, + (num / 0x4000000) & 0x3ffffff + ]; + this.length = 2; + } else { + this.words = [ + num & 0x3ffffff, + (num / 0x4000000) & 0x3ffffff, + 1 + ]; + this.length = 3; + } + + this.negative = neg; + + if (endian === 'le') + this.reverse(); + + return this; + } + + fromDouble(num, endian) { + if (endian == null) + endian = 'be'; + + enforce(typeof num === 'number', 'num', 'double'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + if (!isFinite(num)) + num = 0; + + const neg = (num <= -1) | 0; + + if (num < 0) + num = -num; + + num = Math.floor(num); + + this.words = []; + + while (num > 0) { + const lo = num % 0x4000000; + const hi = (num - lo) / 0x4000000; + + this.words.push(lo); + + num = hi; + } + + if (this.words.length === 0) + this.words.push(0); + + this.length = this.words.length; + this.negative = neg; + + if (endian === 'le') + this.reverse(); + + return this; + } + + fromBigInt(num, endian) { + if (endian == null) + endian = 'be'; + + enforce(typeof num === 'bigint', 'num', 'bigint'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + if (!HAS_BIGINT) + throw new Error('BigInt is not supported!'); + + // You know the implementation has a + // problem when strings are twice + // as fast as bigints. + const start = (num < BigInt(0)) | 0; + + this._fromHex(num.toString(16), start); + this.negative = start; + + if (endian === 'le') + this.reverse(); + + return this; + } + + fromBool(value) { + enforce(typeof value === 'boolean', 'value', 'boolean'); + + this.words[0] = value | 0; + this.length = 1; + this.negative = 0; + + return this; + } + + fromString(str, base, endian) { + if (base === 'le' || base === 'be') + [base, endian] = [endian, base]; + + base = getBase(base); + + if (endian == null) + endian = 'be'; + + enforce(typeof str === 'string', 'string', 'string'); + enforce((base >>> 0) === base, 'base', 'uint32'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + if (base < 2 || base > 36) + throw new Error('Base ranges between 2 and 36.'); + + str = str.replace(/\s+/g, ''); + + let start = 0; + + if (str.length > 0 && str.charCodeAt(0) === 0x2d) + start = 1; + + if (base === 16) + this._fromHex(str, start); + else + this._fromBase(str, base, start); + + this.negative = start; + + this._normalize(); + + if (endian === 'le') + this.reverse(); + + return this; + } + + _fromHex(str, start) { + this.length = Math.max(2, Math.ceil((str.length - start) / 6)); + this.words = new Array(this.length); + + for (let i = 0; i < this.length; i++) + this.words[i] = 0; + + // Scan 24-bit chunks and add them to the number. + let off = 0; + let i = str.length - 6; + let j = 0; + + for (; i >= start; i -= 6) { + const w = parseHex(str, i, i + 6); + + this.words[j] |= (w << off) & 0x3ffffff; + + // `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb. + this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff; + + off += 24; + + if (off >= 26) { + off -= 26; + j += 1; + } + } + + if (i + 6 !== start) { + const w = parseHex(str, start, i + 6); + + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff; + } + + return this._strip(); + } + + _fromBase(str, base, start) { + // Initialize as zero. + this.words[0] = 0; + this.length = 1; + this.negative = 0; + + // Find length of limb in base. + let limbLen = 0; + let limbPow = 1; + + for (; limbPow <= 0x3ffffff; limbPow *= base) + limbLen += 1; + + limbLen -= 1; + limbPow = (limbPow / base) | 0; + + const total = str.length - start; + const mod = total % limbLen; + const end = Math.min(total, total - mod) + start; + + let i = start; + + for (; i < end; i += limbLen) { + const word = parseBase(str, i, i + limbLen, base); + + this.imuln(limbPow); + this._iaddn(word); + } + + if (mod !== 0) { + const pow = Math.pow(base, mod); + const word = parseBase(str, i, str.length, base); + + this.imuln(pow); + this._iaddn(word); + } + + return this; + } + + fromJSON(json) { + if (BN.isBN(json)) { + if (json.red) + return json.fromRed(); + + return json.clone(); + } + + if (Array.isArray(json)) { + for (const chunk of json) + enforce(typeof chunk === 'string', 'chunk', 'string'); + + json = json.join(''); + } + + return this.fromString(json, 16); + } + + fromBN(num) { + return this.inject(num); + } + + fromArray(data, endian) { + enforce(Array.isArray(data), 'data', 'array'); + return this.fromArrayLike(data, endian); + } + + fromBuffer(data, endian) { + enforce(bufferExports.Buffer.isBuffer(data), 'data', 'buffer'); + return this.fromArrayLike(data, endian); + } + + fromArrayLike(data, endian) { + if (endian == null) + endian = 'be'; + + enforce(data && (data.length >>> 0) === data.length, 'data', 'array-like'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + if (data.length === 0) { + this.words[0] = 0; + this.length = 1; + this.negative = 0; + return this; + } + + this.length = Math.max(2, Math.ceil(data.length / 3)); + this.words = new Array(this.length); + this.negative = 0; + + for (let i = 0; i < this.length; i++) + this.words[i] = 0; + + const left = data.length % 3; + + let off = 0; + let j = 0; + let w = 0; + + if (endian === 'be') { + for (let i = data.length - 1; i >= 2; i -= 3) { + const w = data[i] | (data[i - 1] << 8) | (data[i - 2] << 16); + + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + + off += 24; + + if (off >= 26) { + off -= 26; + j += 1; + } + } + + switch (left) { + case 2: + w = data[1] | (data[0] << 8); + break; + case 1: + w = data[0]; + break; + } + } else { + const len = data.length - left; + + for (let i = 0; i < len; i += 3) { + const w = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16); + + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + + off += 24; + + if (off >= 26) { + off -= 26; + j += 1; + } + } + + switch (left) { + case 2: + w = data[len] | (data[len + 1] << 8); + break; + case 1: + w = data[len]; + break; + } + } + + if (left > 0) { + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + } + + return this._strip(); + } + + decode(data, endian) { + return this.fromBuffer(data, endian); + } + + from(num, base, endian) { + if (num == null) + return this; + + if (base === 'le' || base === 'be') + [base, endian] = [endian, base]; + + if (typeof num === 'number') + return this.fromNumber(num, endian); + + if (typeof num === 'bigint') + return this.fromBigInt(num, endian); + + if (typeof num === 'string') + return this.fromString(num, base, endian); + + if (typeof num === 'object') { + if (BN.isBN(num)) + return this.fromBN(num, endian); + + if ((num.length >>> 0) === num.length) + return this.fromArrayLike(num, endian); + } + + if (typeof num === 'boolean') + return this.fromBool(num); + + throw new TypeError('Non-numeric object passed to BN.'); + } + + /* + * Static Methods + */ + + static min(...args) { + let min = null; + + for (const num of args) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (!min || num.cmp(min) < 0) + min = num; + } + + return min || new BN(0); + } + + static max(...args) { + let max = null; + + for (const num of args) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (!max || num.cmp(max) > 0) + max = num; + } + + return max || new BN(0); + } + + static cmp(a, b) { + enforce(BN.isBN(a), 'a', 'bignum'); + return a.cmp(b); + } + + static ucmp(a, b) { + enforce(BN.isBN(a), 'a', 'bignum'); + return a.ucmp(b); + } + + static red(num) { + return new Red(num); + } + + static barrett(num) { + return new Barrett(num); + } + + static mont(num) { + return new Mont(num); + } + + static _prime(name) { + if (primes[name]) + return primes[name]; + + let prime; + + if (name === 'p192') + prime = new P192(); + else if (name === 'p224') + prime = new P224(); + else if (name === 'p521') + prime = new P521(); + else if (name === 'k256') + prime = new K256(); + else if (name === 'p251') + prime = new P251(); + else if (name === 'p25519') + prime = new P25519(); + else if (name === 'p448') + prime = new P448(); + else + throw new Error(`Unknown prime: "${name}".`); + + primes[name] = prime; + + return prime; + } + + static prime(name) { + return BN._prime(name).p.clone(); + } + + static pow(num, exp) { + if (num === 2) + return BN.shift(1, exp); + + return new BN().fromNumber(num).pown(exp); + } + + static shift(num, bits) { + if (num === 1) + return new BN(0).usetn(bits, 1); + + return new BN().fromNumber(num).ishln(bits); + } + + static mask(bits) { + return BN.shift(1, bits).isubn(1); + } + + static randomBits(rng, bits) { + enforce(rng != null, 'rng', 'rng'); + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + if (typeof rng === 'object') { + enforce(typeof rng.randomBytes === 'function', 'rng', 'rng'); + + const size = (bits + 7) >>> 3; + const total = size * 8; + const bytes = rng.randomBytes(size); + + enforce(bufferExports.Buffer.isBuffer(bytes), 'bytes', 'buffer'); + + if (bytes.length !== size) + throw new RangeError('Invalid number of bytes returned from RNG.'); + + const num = BN.fromBuffer(bytes); + + if (total > bits) + num.iushrn(total - bits); + + return num; + } + + enforce(typeof rng === 'function', 'rng', 'rng'); + + const num = rng(bits); + + enforce(BN.isBN(num), 'num', 'bignum'); + range(num.negative === 0, 'RNG'); + nonred(!num.red, 'RNG'); + + if (num.bitLength() > bits) + throw new RangeError('Invalid number of bits returned from RNG.'); + + return num; + } + + static random(rng, min, max) { + min = BN.cast(min, 16); + max = BN.cast(max, 16); + + if (min.cmp(max) > 0) + throw new RangeError('Minimum cannot be greater than maximum.'); + + const space = max.sub(min).iabs(); + const bits = space.bitLength(); + + if (bits === 0) + return min.clone(); + + for (;;) { + const num = BN.randomBits(rng, bits); + + // Maximum is _exclusive_! + if (num.cmp(space) >= 0) + continue; + + // Minimum is _inclusive_! + num.iadd(min); + + return num; + } + } + + static of(num, endian) { + return new BN().of(num, endian); + } + + static fromNumber(num, endian) { + return new BN().fromNumber(num, endian); + } + + static fromDouble(num, endian) { + return new BN().fromDouble(num, endian); + } + + static fromBigInt(num, endian) { + return new BN().fromBigInt(num, endian); + } + + static fromBool(value) { + return new BN().fromBool(value); + } + + static fromString(str, base, endian) { + return new BN().fromString(str, base, endian); + } + + static fromJSON(json) { + return new BN().fromJSON(json); + } + + static fromBN(num) { + return new BN().fromBN(num); + } + + static fromArray(data, endian) { + return new BN().fromArray(data, endian); + } + + static fromBuffer(data, endian) { + return new BN().fromBuffer(data, endian); + } + + static fromArrayLike(data, endian) { + return new BN().fromArrayLike(data, endian); + } + + static decode(data, endian) { + return new BN().decode(data, endian); + } + + static from(num, base, endian) { + return new BN().from(num, base, endian); + } + + static cast(num, base, endian) { + if (BN.isBN(num)) + return num; + + return new BN(num, base, endian); + } + + static isBN(obj) { + return obj instanceof BN; + } + } + + /* + * Static + */ + + BN.BN = BN; + BN.wordSize = 26; + BN.native = 0; + + /** + * Prime + */ + + class Prime { + constructor(name, p) { + // P = 2^N - K + this.name = name; + this.p = new BN(p, 16); + this.n = this.p.bitLength(); + this.k = BN.shift(1, this.n).isub(this.p); + this.lo = this.p.clone(); + this.one = this.p.clone(); + } + + ireduce(num) { + // Assumes that `num` is less than `P^2`: + // num = HI * (2^N - K) + HI * K + LO = HI * K + LO (mod P) + const neg = num.negative !== 0; + + // Track bits. + let bits = num.bitLength(); + + // Must be less than P^2. + assert(bits <= this.n * 2); + + // Ensure positive. + num.negative = 0; + + // Reduce. + while (bits > this.n) { + // lo = num & ((1 << n) - 1) + // num = num >> n + this.split(num, this.lo); + + // num = num * K + this.imulK(num); + + // num = num + lo + num._iadd(num, this.lo); + + // bits = bitlen(num) + bits = num.bitLength(); + } + + // Final reduction. + const cmp = bits < this.n ? -1 : num.ucmp(this.p); + + if (cmp === 0) { + num.words[0] = 0; + num.length = 1; + } else if (cmp > 0) { + num._isub(num, this.p); + } else ; + + // Adjust sign. + if (neg && !num.isZero()) + num._isub(this.p, num); + + return num; + } + + split(input, out) { + input._split(this.n, out); + } + + imulK(num) { + return num.imul(this.k); + } + + pm2(x1) { + // Exponent: p - 2 + throw new Error('Not implemented.'); + } + + fermat(x) { + return this.pm2(x); + } + } + + /** + * Prime (3 mod 4) + */ + + class Prime34 extends Prime { + constructor(name, p) { + super(name, p); + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + throw new Error('Not implemented.'); + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + throw new Error('Not implemented.'); + } + + sqrt(x) { + // r = x^((p + 1) / 4) mod p + const {red} = x; + const r = this.pp1d4(x); + + if (!red.sqr(r).eq(x)) + throw new SquareRootError(r); + + return r; + } + + divsqrt(u, v) { + // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p + const {red} = u; + const u2 = red.sqr(u); + const u3 = red.mul(u2, u); + const u5 = red.mul(u3, u2); + const v3 = red.mul(red.sqr(v), v); + const p = this.pm3d4(red.mul(u5, v3)); + const x = red.mul(red.mul(u3, v), p); + const c = red.mul(v, red.sqr(x)); + + if (c.eq(u)) + return x; + + throw new SquareRootError(x); + } + } + + /** + * Prime (5 mod 8) + */ + + class Prime58 extends Prime { + constructor(name, p, sm1) { + super(name, p); + + this.sm1 = new BN(sm1, 16); + } + + pm5d8(x1) { + // Exponent: (p - 5) / 8 + throw new Error('Not implemented.'); + } + + pp3d8(x1) { + // Exponent: (p + 3) / 8 + throw new Error('Not implemented.'); + } + + sqrt(x) { + // r = x^((p + 3) / 8) mod p + const {red} = x; + const sm1 = this.sm1._forceRed(red); + const r = this.pp3d8(x); + + if (red.sqr(r).eq(x)) + return r; + + const c = red.mul(r, sm1); + + if (red.sqr(c).eq(x)) + return c; + + throw new SquareRootError(r); + } + + divsqrt(u, v) { + // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p + const {red} = u; + const sm1 = this.sm1._forceRed(red); + const v3 = red.mul(red.sqr(v), v); + const v7 = red.mul(red.sqr(v3), v); + const p = this.pm5d8(red.mul(u, v7)); + const x = red.mul(red.mul(u, v3), p); + const c = red.mul(v, red.sqr(x)); + + if (c.eq(u)) + return x; + + const mc = red.ineg(c); + + if (mc.eq(u)) + return red.mul(x, sm1); + + if (mc.eq(red.mul(u, sm1))) + throw new SquareRootError(red.mul(x, sm1)); + + throw new SquareRootError(x); + } + } + + /** + * Prime (1 mod 16) + */ + + class Prime116 extends Prime { + constructor(name, p, g) { + super(name, p); + + this.g = new BN(g, 16); + this.z = this.p.subn(1).zeroBits(); + } + + powS(x1) { + // Exponent: (p - 1) / 2^k + throw new Error('Not implemented.'); + } + + powE(x1) { + // Exponent: (s + 1) / 2 + throw new Error('Not implemented.'); + } + + sqrt(x) { + // Tonelli-Shanks (variable time). + // + // Constants: + // + // k = factors of 2 for (p - 1) + // s = (p - 1) / 2^k + // e = (s + 1) / 2 + // n = first non-square in F(p) + // + // Algorithm: + // + // g = n^s mod p + // y = x^e mod p + // b = x^s mod p + // + // loop: + // t = b + // m = 0 + // + // while t != 1: + // t = t^2 mod p + // m += 1 + // + // if m == 0: + // break + // + // if m >= k: + // fail + // + // t = g^(2^(k - m - 1)) mod p + // g = t^2 mod p + // y = y * t mod p + // b = b * g mod p + // k = m + // + // return y + // + const {red} = x; + + switch (red.jacobi(x)) { + case -1: + throw new SquareRootError(x); + case 0: + return x.clone(); + } + + let g = this.g._forceRed(red); + let y = this.powE(x); + let b = this.powS(x); + let k = this.z; + + for (;;) { + let t = b; + let m = 0; + + while (t.cmpn(1) !== 0 && m < k) { + t = red.sqr(t); + m += 1; + } + + if (m === 0) + break; + + assert(m < k); + + t = red.sqrn(g, k - m - 1); + g = red.sqr(t); + y = red.mul(y, t); + b = red.mul(b, g); + k = m; + } + + return y; + } + + divsqrt(u, v) { + const {red} = u; + + if (v.isZero()) + throw new SquareRootError(v); + + return this.sqrt(red.div(u, v)); + } + } + + /** + * P192 + */ + + class P192 extends Prime34 { + constructor() { + // 2^192 - 2^64 - 1 (= 3 mod 4) + super('p192', 'ffffffff ffffffff ffffffff fffffffe' + + 'ffffffff ffffffff'); + } + + imulK(num) { + // K = 0x10000000000000001 + // K = 2^64 + 1 + const one = this.one.inject(num); + return num.iushln(64)._iadd(num, one); + } + + core(x1) { + // Exponent: (p - 3) / 4 + // Bits: 127x1 1x0 62x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x12 = red.sqrnmul(x6, 6, x6); + const x24 = red.sqrnmul(x12, 12, x12); + const x30 = red.sqrnmul(x24, 6, x6); + const x31 = red.sqrnmul(x30, 1, x1); + const x62 = red.sqrnmul(x31, 31, x31); + const x124 = red.sqrnmul(x62, 62, x62); + const x127 = red.sqrnmul(x124, 3, x3); + const r0 = red.sqrn(x127, 1); + const r1 = red.sqrnmul(r0, 62, x62); + + return r1; + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + // Bits: 127x1 1x0 62x1 + return this.core(x1); + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 127x1 1x0 62x1 1x0 1x1 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 128x1 62x0 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x4 = red.sqrnmul(x2, 2, x2); + const x8 = red.sqrnmul(x4, 4, x4); + const x16 = red.sqrnmul(x8, 8, x8); + const x32 = red.sqrnmul(x16, 16, x16); + const x64 = red.sqrnmul(x32, 32, x32); + const x128 = red.sqrnmul(x64, 64, x64); + const r0 = red.sqrn(x128, 62); + + return r0; + } + } + + /** + * P224 + */ + + class P224 extends Prime116 { + constructor() { + // 2^224 - 2^96 + 1 (1 mod 16) + super('p224', 'ffffffff ffffffff ffffffff ffffffff' + + '00000000 00000000 00000001', + '6a0fec67 8598a792 0c55b2d4 0b2d6ffb' + + 'bea3d8ce f3fb3632 dc691b74'); + } + + imulK(num) { + // K = 0xffffffffffffffffffffffff + // K = 2^96 - 1 + const one = this.one.inject(num); + return num.iushln(96)._isub(num, one); + } + + powS(x1) { + // Exponent: 2^128 - 1 + // Bits: 128x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x4 = red.sqrnmul(x2, 2, x2); + const x8 = red.sqrnmul(x4, 4, x4); + const x16 = red.sqrnmul(x8, 8, x8); + const x32 = red.sqrnmul(x16, 16, x16); + const x64 = red.sqrnmul(x32, 32, x32); + const x128 = red.sqrnmul(x64, 64, x64); + + return x128; + } + + powE(x1) { + // Exponent: 2^127 + // Bits: 1x1 127x0 + const {red} = x1; + const r0 = red.sqrn(x1, 127); + + return r0; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 127x1 1x0 96x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x12 = red.sqrnmul(x6, 6, x6); + const x24 = red.sqrnmul(x12, 12, x12); + const x48 = red.sqrnmul(x24, 24, x24); + const x96 = red.sqrnmul(x48, 48, x48); + const x120 = red.sqrnmul(x96, 24, x24); + const x126 = red.sqrnmul(x120, 6, x6); + const x127 = red.sqrnmul(x126, 1, x1); + const r0 = red.sqrn(x127, 1); + const r1 = red.sqrnmul(r0, 96, x96); + + return r1; + } + } + + /** + * P521 + */ + + class P521 extends Prime34 { + constructor() { + // 2^521 - 1 (= 3 mod 4) + super('p521', '000001ff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff'); + } + + imulK(num) { + // K = 0x01 + return num; + } + + core(x1) { + // Exponent: 2^519 - 1 + // Bits: 519x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x7 = red.sqrnmul(x6, 1, x1); + const x8 = red.sqrnmul(x7, 1, x1); + const x16 = red.sqrnmul(x8, 8, x8); + const x32 = red.sqrnmul(x16, 16, x16); + const x64 = red.sqrnmul(x32, 32, x32); + const x128 = red.sqrnmul(x64, 64, x64); + const x256 = red.sqrnmul(x128, 128, x128); + const x512 = red.sqrnmul(x256, 256, x256); + const x519 = red.sqrnmul(x512, 7, x7); + + return x519; + } + + pm3d4(x1) { + // Exponent: 2^519 - 1 + // Bits: 519x1 + return this.core(x1); + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 519x1 1x0 1x1 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 1x1 519x0 + const {red} = x1; + const r0 = red.sqrn(x1, 519); + + return r0; + } + } + + /** + * K256 + */ + + class K256 extends Prime34 { + constructor() { + // 2^256 - 2^32 - 977 (= 3 mod 4) + super('k256', 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff fffffffe fffffc2f'); + } + + split(input, output) { + // 256 = 9 * 26 + 22 + const mask = 0x3fffff; + const len = Math.min(input.length, 9); + + output._alloc(len + 1); + + for (let i = 0; i < len; i++) + output.words[i] = input.words[i]; + + output.length = len; + + if (input.length <= 9) { + output._strip(); + input.words[0] = 0; + input.length = 1; + return; + } + + // Shift by 9 limbs. + let prev = input.words[9]; + let i = 10; + + output.words[output.length++] = prev & mask; + output._strip(); + + for (; i < input.length; i++) { + const next = input.words[i] | 0; + + input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); + + prev = next; + } + + prev >>>= 22; + + input.words[i - 10] = prev; + + if (prev === 0 && input.length > 10) + input.length -= 10; + else + input.length -= 9; + + input._strip(); // Unsure if we need this. + } + + imulK(num) { + // K = 0x1000003d1 = [0x40, 0x3d1] + // K = 2^32 + 977 + num._expand(num.length + 2); + + // Bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 + let lo = 0; + + for (let i = 0; i < num.length; i++) { + const w = num.words[i]; + + lo += w * 0x3d1; + + num.words[i] = lo & 0x3ffffff; + + lo = w * 0x40 + Math.floor(lo / 0x4000000); + } + + // Fast length reduction. + if (num.words[num.length - 1] === 0) { + num.length -= 1; + if (num.words[num.length - 1] === 0) + num.length -= 1; + } + + // Note: we shouldn't need to strip here. + return num; + } + + core(x1, x2) { + // Exponent: (p - 47) / 64 + // Bits: 223x1 1x0 22x1 4x0 + const {red} = x1; + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x9 = red.sqrnmul(x6, 3, x3); + const x11 = red.sqrnmul(x9, 2, x2); + const x22 = red.sqrnmul(x11, 11, x11); + const x44 = red.sqrnmul(x22, 22, x22); + const x88 = red.sqrnmul(x44, 44, x44); + const x176 = red.sqrnmul(x88, 88, x88); + const x220 = red.sqrnmul(x176, 44, x44); + const x223 = red.sqrnmul(x220, 3, x3); + const r0 = red.sqrn(x223, 1); + const r1 = red.sqrnmul(r0, 22, x22); + const r2 = red.sqrn(r1, 4); + + return r2; + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r2 = this.core(x1, x2); + const r3 = red.sqrnmul(r2, 1, x1); + const r4 = red.sqrn(r3, 1); + const r5 = red.sqrnmul(r4, 2, x2); + + return r5; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 1x0 1x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r2 = this.core(x1, x2); + const r3 = red.sqrnmul(r2, 1, x1); + const r4 = red.sqrn(r3, 1); + const r5 = red.sqrnmul(r4, 2, x2); + const r6 = red.sqrn(r5, 1); + const r7 = red.sqrnmul(r6, 1, x1); + + return r7; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 223x1 1x0 22x1 4x0 2x1 2x0 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r2 = this.core(x1, x2); + const r3 = red.sqrnmul(r2, 2, x2); + const r4 = red.sqrn(r3, 2); + + return r4; + } + } + + /** + * P251 + */ + + class P251 extends Prime34 { + constructor() { + // 2^251 - 9 + super('p251', '07ffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff fffffff7'); + } + + imulK(num) { + // K = 0x09 + if (num.isZero()) + return num; + + let carry = 0; + + for (let i = 0; i < num.length; i++) { + const w = num.words[i] * 0x09 + carry; + + carry = w >>> 26; + + num.words[i] = w & 0x3ffffff; + } + + if (carry !== 0) { + num._alloc(num.length + 1); + num.words[num.length++] = carry; + } + + // Note: we shouldn't need to strip here. + return num; + } + + core(x1) { + // Exponent: 2^247 - 1 + // Bits: 247x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x12 = red.sqrnmul(x6, 6, x6); + const x24 = red.sqrnmul(x12, 12, x12); + const x48 = red.sqrnmul(x24, 24, x24); + const x96 = red.sqrnmul(x48, 48, x48); + const x192 = red.sqrnmul(x96, 96, x96); + const x240 = red.sqrnmul(x192, 48, x48); + const x246 = red.sqrnmul(x240, 6, x6); + const x247 = red.sqrnmul(x246, 1, x1); + + return x247; + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + // Bits: 247x1 1x0 1x1 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 247x1 1x0 1x1 1x0 1x1 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + const r3 = red.sqrn(r2, 1); + const r4 = red.sqrnmul(r3, 1, x1); + + return r4; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 248x1 1x0 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrnmul(r0, 1, x1); + const r2 = red.sqrn(r1, 1); + + return r2; + } + } + + /** + * P25519 + */ + + class P25519 extends Prime58 { + constructor() { + // 2^255 - 19 (= 5 mod 8) + super('p25519', '7fffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffed', + '2b832480 4fc1df0b 2b4d0099 3dfbd7a7' + + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'); + } + + imulK(num) { + // K = 0x13 + let carry = 0; + + for (let i = 0; i < num.length; i++) { + const w = num.words[i] * 0x13 + carry; + + carry = w >>> 26; + + num.words[i] = w & 0x3ffffff; + } + + if (carry !== 0) { + num._alloc(num.length + 1); + num.words[num.length++] = carry; + } + + // Note: we shouldn't need to strip here. + return num; + } + + core(x1, x2) { + // Exponent: 2^250 - 1 + // Bits: 250x1 + const {red} = x1; + const x4 = red.sqrnmul(x2, 2, x2); + const x5 = red.sqrnmul(x4, 1, x1); + const x10 = red.sqrnmul(x5, 5, x5); + const x20 = red.sqrnmul(x10, 10, x10); + const x40 = red.sqrnmul(x20, 20, x20); + const x50 = red.sqrnmul(x40, 10, x10); + const x100 = red.sqrnmul(x50, 50, x50); + const x200 = red.sqrnmul(x100, 100, x100); + const x250 = red.sqrnmul(x200, 50, x50); + + return x250; + } + + pm5d8(x1) { + // Exponent: (p - 5) / 8 + // Bits: 250x1 1x0 1x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r0 = this.core(x1, x2); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 250x1 1x0 1x1 1x0 2x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r0 = this.core(x1, x2); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + const r3 = red.sqrn(r2, 1); + const r4 = red.sqrnmul(r3, 2, x2); + + return r4; + } + + pp3d8(x1) { + // Exponent: (p + 3) / 8 + // Bits: 251x1 1x0 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r0 = this.core(x1, x2); + const r1 = red.sqrnmul(r0, 1, x1); + const r2 = red.sqrn(r1, 1); + + return r2; + } + } + + /** + * P448 + */ + + class P448 extends Prime34 { + constructor() { + // 2^448 - 2^224 - 1 (= 3 mod 4) + super('p448', 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff fffffffe ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff'); + } + + imulK(num) { + // K = 0x100000000000000000000000000000000000000000000000000000001 + // K = 2^224 + 1 + const one = this.one.inject(num); + return num.iushln(224)._iadd(num, one); + } + + core(x1, x2) { + // Exponent: 2^222 - 1 + // Bits: 222x1 + const {red} = x1; + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x9 = red.sqrnmul(x6, 3, x3); + const x11 = red.sqrnmul(x9, 2, x2); + const x22 = red.sqrnmul(x11, 11, x11); + const x44 = red.sqrnmul(x22, 22, x22); + const x88 = red.sqrnmul(x44, 44, x44); + const x176 = red.sqrnmul(x88, 88, x88); + const x220 = red.sqrnmul(x176, 44, x44); + const x222 = red.sqrnmul(x220, 2, x2); + + return x222; + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + // Bits: 223x1 1x0 222x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x222 = this.core(x1, x2); + const r0 = red.sqrnmul(x222, 1, x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 222, x222); + + return r2; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 223x1 1x0 222x1 1x0 1x1 + const {red} = x1; + const r0 = this.pm3d4(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 224x1 222x0 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r0 = this.core(x1, x2); + const r1 = red.sqrnmul(r0, 2, x2); + const r2 = red.sqrn(r1, 222); + + return r2; + } + } + + /** + * Reduction Engine + */ + + class Red { + constructor(m) { + let prime = null; + + if (typeof m === 'string') { + prime = BN._prime(m); + m = prime.p; + } + + enforce(BN.isBN(m), 'm', 'bignum'); + nonred(!m.red, 'reduction'); + range(m.sign() > 0, 'reduction'); + + this.m = m; + this.prime = prime; + this.mb = null; + this.sm1 = null; + } + + _verify1(a) { + range(a.negative === 0, 'red'); + red(a.red != null, 'red'); + } + + _verify2(a, b) { + range((a.negative | b.negative) === 0, 'red'); + red(a.red != null && a.red === b.red, 'red'); + } + + get mont() { + return false; + } + + precompute() { + // Precompute `sqrt(-1)` for primes congruent to 5 mod 8. + if (this.sm1 === null && this.m.andln(7) === 5) { + if (this.prime) { + this.sm1 = this.prime.sm1.clone()._forceRed(this); + } else { + const x = new BN(2).toRed(this); + const e = this.m.subn(1).iushrn(2); + + // sqrt(-1) = 2^((p - 1) / 4) mod p + this.sm1 = this.pow(x, e); + } + } + + return this; + } + + convertTo(num) { + const res = num.mod(this.m); + res.red = this; + return res; + } + + convertFrom(num) { + const res = num.clone(); + res.red = null; + return res; + } + + intTo(a) { + return a; + } + + intFrom(a) { + return a; + } + + imod(a) { + if (this.prime) + return this.prime.ireduce(a)._forceRed(this); + + return a.imod(this.m)._forceRed(this); + } + + iadd(a, b) { + this._verify2(a, b); + + a._iadd(a, b); + + if (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + + return a; + } + + add(a, b) { + if (a.length < b.length) + return this.iadd(b.clone(), a); + + return this.iadd(a.clone(), b); + } + + iaddn(a, num) { + this._verify1(a); + + if (num < 0) + return this.isubn(a, -num); + + if (this.m.length === 1) + num %= this.m.words[0]; + + a._iaddn(num); + + if (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + + return a; + } + + addn(a, num) { + return this.iaddn(a.clone(), num); + } + + isub(a, b) { + this._verify2(a, b); + + // 0: a - a mod m == 0 + // -1: a - b mod m == m - (b - a) + // +1: a - b mod m == a - b + const cmp = a.ucmp(b); + + if (cmp === 0) { + a.words[0] = 0; + a.length = 1; + return a; + } + + if (cmp < 0) { + a._isub(b, a); + a._isub(this.m, a); + } else { + a._isub(a, b); + } + + return a; + } + + sub(a, b) { + return this.isub(a.clone(), b); + } + + isubn(a, num) { + this._verify1(a); + + if (num < 0) + return this.iaddn(a, -num); + + if (this.m.length === 1) + num %= this.m.words[0]; + + // <: a - b mod m == m - (b - a) + // >=: a - b mod m == a - b + if (a.length === 1 && a.words[0] < num) { + a.words[0] = num - a.words[0]; + a._isub(this.m, a); + } else { + a._isubn(num); + } + + return a; + } + + subn(a, num) { + return this.isubn(a.clone(), num); + } + + imul(a, b) { + this._verify2(a, b); + return this.imod(a.imul(b)); + } + + mul(a, b) { + this._verify2(a, b); + return this.imod(a.mul(b)); + } + + imuln(a, num) { + this._verify1(a); + + if (a.isZero()) + return a; + + if (num === 0) { + a.words[0] = 0; + a.length = 1; + return a; + } + + const neg = num < 0; + + if (neg) + num = -num; + + if (this.m.length === 1) + num %= this.m.words[0]; + + a.imuln(num); + + if (num <= 16) { + // Quick reduction. + while (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + } else { + this.imod(a); + } + + if (neg) + this.ineg(a); + + return a; + } + + muln(a, num) { + return this.imuln(a.clone(), num); + } + + idiv(a, b) { + return this.div(a, b)._move(a); + } + + div(a, b) { + return this.mul(a, this.invert(b)); + } + + idivn(a, num) { + return this.divn(a, num)._move(a); + } + + divn(a, num) { + return this.div(a, this.convertTo(new BN(num))); + } + + ipow(a, num) { + return this.pow(a, num)._move(a); + } + + pow(a, num) { + this._verify1(a); + + if (num.isNeg()) + a = this.invert(a); + + // Small exponent. + if (num.length === 1) + return this.pown(a, num.words[0]); + + // Call out to BigInt. + if (HAS_BIGINT && !this.prime) + return this.powInt(a, num); + + // Otherwise, a BN implementation. + return this.powNum(a, num); + } + + powNum(a, num) { + // Sliding window (odd multiples only). + const one = new BN(1).toRed(this); + const wnd = new Array(WND_SIZE); + const a2 = this.sqr(a); + + wnd[0] = a; + + for (let i = 1; i < WND_SIZE; i++) + wnd[i] = this.mul(wnd[i - 1], a2); + + let i = num.bitLength(); + let r = one; + + while (i >= WND_WIDTH) { + let width = WND_WIDTH; + let bits = num.bits(i - width, width); + + if (bits < WND_SIZE) { + r = this.sqr(r); + i -= 1; + continue; + } + + while ((bits & 1) === 0) { + width -= 1; + bits >>= 1; + } + + if (r === one) { + r = wnd[bits >> 1].clone(); + } else { + r = this.sqrn(r, width); + r = this.mul(r, wnd[bits >> 1]); + } + + i -= width; + } + + if (i > 0) { + const bits = num.bits(0, i); + + while (i--) { + r = this.sqr(r); + + if ((bits >> i) & 1) + r = this.mul(r, a); + } + } + + return r; + } + + powInt(a, num) { + if (this.mb === null) + this.mb = this.m.toBigInt(); + + const x = this.intFrom(a.toBigInt()); + const y = powInt(x, num, this.mb); + const z = this.intTo(y); + + return BN.fromBigInt(z)._forceRed(this); + } + + sqrn(a, n) { + while (n--) + a = this.sqr(a); + + return a; + } + + sqrnmul(a, n, b) { + return this.mul(this.sqrn(a, n), b); + } + + ipown(a, num) { + return this.pown(a, num)._move(a); + } + + pown(a, num) { + this._verify1(a); + + if (num < 0) { + a = this.invert(a); + num = -num; + } + + if (num === 0) + return new BN(1).toRed(this); + + if (num === 1) + return a.clone(); + + const bits = countBits(num); + + let r = a; + + for (let i = bits - 2; i >= 0; i--) { + r = this.sqr(r); + + if ((num >> i) & 1) + r = this.mul(r, a); + } + + return r; + } + + isqr(a) { + return this.imul(a, a); + } + + sqr(a) { + return this.mul(a, a); + } + + isqrt(x) { + return this.sqrt(x)._move(x); + } + + sqrt(x) { + this._verify1(x); + + // Optimized square root chain. + if (this.prime) + return this.prime.sqrt(x); + + // Fast case (p = 3 mod 4). + if (this.m.andln(3) === 3) + return this.sqrt3mod4(x); + + // Fast case (p = 5 mod 8). + if (this.m.andln(7) === 5) { + if (this.sm1 != null) + return this.sqrt5mod8sm1(x); + return this.sqrt5mod8(x); + } + + // Slow case (Tonelli-Shanks). + return this.sqrt0(x); + } + + sqrt3mod4(x) { + const e = this.m.addn(1).iushrn(2); // (p + 1) / 4 + const b = this.pow(x, e); + + if (!this.sqr(b).eq(x)) + throw new SquareRootError(b); + + return b; + } + + sqrt5mod8(x) { + // Atkin's Algorithm. + const one = new BN(1).toRed(this); + const e = this.m.ushrn(3); // (p - 5) / 8 + const x2 = this.add(x, x); + const alpha = this.pow(x2, e); + const beta = this.mul(x2, this.sqr(alpha)); + const b = this.mul(this.mul(alpha, x), this.isub(beta, one)); + + if (!this.sqr(b).eq(x)) + throw new SquareRootError(b); + + return b; + } + + sqrt5mod8sm1(x) { + const e = this.m.addn(3).iushrn(3); // (p + 3) / 8 + const b = this.pow(x, e); + + if (this.sqr(b).eq(x)) + return b; + + const c = this.mul(b, this.sm1); + + if (this.sqr(c).eq(x)) + return c; + + throw new SquareRootError(b); + } + + sqrt0(x) { + if (this.m.cmpn(1) === 0 || !this.m.isOdd()) + throw new Error('Invalid prime.'); + + switch (this.jacobi(x)) { + case -1: + throw new SquareRootError(x); + case 0: + return x.clone(); + } + + const one = new BN(1).toRed(this); + const s = this.m.subn(1); + const e = s._makeOdd(); + const n = new BN(2).toRed(this); + + while (this.jacobi(n) !== -1) + this.iadd(n, one); + + let g = this.pow(n, s); + let b = this.pow(x, s); + let y = this.pow(x, s.iaddn(1).iushrn(1)); + let k = e; + + for (;;) { + let t = b; + let m = 0; + + while (!t.eq(one) && m < k) { + t = this.sqr(t); + m += 1; + } + + if (m === 0) + break; + + assert(m < k); + + t = this.sqrn(g, k - m - 1); + g = this.sqr(t); + y = this.mul(y, t); + b = this.mul(b, g); + k = m; + } + + return y; + } + + idivsqrt(u, v) { + return this.divsqrt(u, v)._move(u); + } + + divsqrt(u, v) { + this._verify2(u, v); + + // u = 0, v = 0 + if (u.isZero() && v.isZero()) + throw new SquareRootError(v); + + // Optimized inverse square root chain. + if (this.prime) + return this.prime.divsqrt(u, v); + + // p = 3 mod 4 + if (this.m.andln(3) === 3) + return this.divsqrt3mod4(u, v); + + // p = 5 mod 8 + if (this.sm1 != null && this.m.andln(7) === 5) + return this.divsqrt5mod8(u, v); + + // v = 0 + if (v.isZero()) + throw new SquareRootError(v); + + return this.sqrt(this.div(u, v)); + } + + divsqrt3mod4(u, v) { + // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p + const e = this.m.subn(3).iushrn(2); + const u2 = this.sqr(u); + const u3 = this.mul(u2, u); + const u5 = this.mul(u3, u2); + const v3 = this.mul(this.sqr(v), v); + const p = this.pow(this.mul(u5, v3), e); + const x = this.mul(this.mul(u3, v), p); + const c = this.mul(v, this.sqr(x)); + + if (c.eq(u)) + return x; + + throw new SquareRootError(x); + } + + divsqrt5mod8(u, v) { + // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p + const e = this.m.subn(5).iushrn(3); + const v3 = this.mul(this.sqr(v), v); + const v7 = this.mul(this.sqr(v3), v); + const p = this.pow(this.mul(u, v7), e); + const x = this.mul(this.mul(u, v3), p); + const c = this.mul(v, this.sqr(x)); + + if (c.eq(u)) + return x; + + const mc = this.ineg(c); + + if (mc.eq(u)) + return this.mul(x, this.sm1); + + if (mc.eq(this.mul(u, this.sm1))) + throw new SquareRootError(this.mul(x, this.sm1)); + + throw new SquareRootError(x); + } + + isSquare(a) { + if (this.m.isOdd()) + return this.jacobi(a) >= 0; + + return this.kronecker(a) >= 0; + } + + ishl(a, num) { + this._verify1(a); + return this.imod(a.iushl(num)); + } + + shl(a, num) { + return this.ishl(a.clone(), num); + } + + ishln(a, num) { + this._verify1(a); + + a.iushln(num); + + if (num <= 4) { + // Quick reduction. + while (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + } else { + this.imod(a); + } + + return a; + } + + shln(a, num) { + return this.ishln(a.clone(), num); + } + + ineg(a) { + this._verify1(a); + + if (!a.isZero()) + a._isub(this.m, a); + + return a; + } + + neg(a) { + return this.ineg(a.clone()); + } + + eq(a, b) { + this._verify2(a, b); + return a.ucmp(b) === 0; + } + + eqn(a, num) { + this._verify1(a); + + if (this.m.length === 1) { + num %= this.m.words[0]; + + if (num < 0) + num += this.m.words[0]; + + return a.ucmpn(num) === 0; + } + + if (num < 0) { + this.m._isubn(-num); + + const cmp = a.ucmp(this.m); + + this.m._iaddn(-num); + + return cmp === 0; + } + + return a.ucmpn(num) === 0; + } + + isHigh(a) { + return !this.isLow(a); + } + + isLow(a) { + this._verify1(a); + return a.ucmp(this.m.ushrn(1)) <= 0; + } + + isOdd(a) { + this._verify1(a); + return a.isOdd(); + } + + isEven(a) { + this._verify1(a); + return a.isEven(); + } + + legendre(num) { + this._verify1(num); + + if (this.m.isEven()) + throw new Error('legendre: `num` must be odd.'); + + // Euler's criterion. + const e = this.m.subn(1).iushrn(1); // (p - 1) / 2 + const symbol = this.pow(num, e); + + if (symbol.isZero()) + return 0; + + const one = new BN(1).toRed(this); + + if (symbol.eq(one)) + return 1; + + if (symbol.eq(this.ineg(one))) + return -1; + + throw new Error('Invalid prime.'); + } + + jacobi(a) { + this._verify1(a); + return a.jacobi(this.m); + } + + kronecker(a) { + this._verify1(a); + return a.kronecker(this.m); + } + + iinvert(a) { + return this.invert(a)._move(a); + } + + invert(a) { + this._verify1(a); + return a.invert(this.m)._forceRed(this); + } + + ifermat(a) { + return this.fermat(a)._move(a); + } + + fermat(a) { + this._verify1(a); + + if (a.isZero() || this.m.cmpn(1) === 0) + throw new RangeError('Not invertible.'); + + // Optimized inversion chain. + if (this.prime) + return this.prime.fermat(a); + + // Invert using fermat's little theorem. + return this.pow(a, this.m.subn(2)); + } + + invertAll(elems) { + // Montgomery's trick. + enforce(Array.isArray(elems), 'elems', 'array'); + + for (const elem of elems) { + enforce(BN.isBN(elem), 'elem', 'bignum'); + + this._verify1(elem); + } + + if (this.m.cmpn(1) === 0 || this.m.isEven()) + throw new RangeError('Not invertible.'); + + const len = elems.length; + const invs = new Array(len); + + if (len === 0) + return invs; + + let acc = new BN(1).toRed(this); + + for (let i = 0; i < len; i++) { + if (elems[i].isZero()) { + invs[i] = elems[i].clone(); + continue; + } + + invs[i] = acc; + acc = this.mul(acc, elems[i]); + } + + acc = this.invert(acc); + + for (let i = len - 1; i >= 0; i--) { + if (elems[i].isZero()) + continue; + + invs[i] = this.mul(acc, invs[i]); + acc = this.mul(acc, elems[i]); + } + + return invs; + } + + [custom]() { + if (this.prime) + return ``; + + return ``; + } + } + + /** + * Barrett Engine + */ + + class Barrett extends Red { + constructor(m) { + super(m); + + this.prime = null; + this.n = this.m.bitLength(); + + if ((this.n % 26) !== 0) + this.n += 26 - (this.n % 26); + + this.k = this.n * 2; + this.w = this.k / 26; + this.b = BN.shift(1, this.k).div(this.m); + } + + convertTo(num) { + if (num.length > this.w) + return super.convertTo(num); + + return this.imod(num.clone()); + } + + _shift(q) { + let i = 0; + let j = this.w; + + while (j < q.length) + q.words[i++] = q.words[j++]; + + if (i === 0) + q.words[i++] = 0; + + q.length = i; + } + + imod(a) { + const neg = a.negative; + + assert(a.length <= this.w); + + a.negative = 0; + + const q = a.mul(this.b); + + // Shift right by `k` bits. + this._shift(q); + + a._isub(a, q.mul(this.m)); + + if (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + + if (neg && !a.isZero()) + a._isub(this.m, a); + + a.red = this; + + return a; + } + } + + /** + * Montgomery Engine + */ + + class Mont extends Red { + constructor(m) { + super(m); + + // Note that: + // + // mi = (-m^-1 mod (2^(n * 2))) mod r + // + // and: + // + // mi = (((2^n)^-1 mod m) * r^-1 - 1) / m + // + // are equivalent. + this.prime = null; + this.n = this.m.length * 26; + this.r = BN.shift(1, this.n); + this.r2 = BN.shift(1, this.n * 2).imod(this.m); + this.ri = this.r.invert(this.m); + this.mi = this.r.mul(this.ri).isubn(1).div(this.m); + this.rib = null; + } + + get mont() { + return true; + } + + convertTo(num) { + if (num.isNeg() || num.ucmp(this.m) >= 0) + return this.imod(num.ushln(this.n)); + + // Equivalent to: (num * 2^n) mod m + return this.mul(num, this.r2); + } + + convertFrom(num) { + // Equivalent to: num * r^-1 mod m + const r = this.mul(num, new BN(1)); + r.red = null; + return r; + } + + intTo(a) { + return (a << BigInt(this.n)) % this.mb; + } + + intFrom(a) { + if (this.rib === null) + this.rib = this.ri.toBigInt(); + + return (a * this.rib) % this.mb; + } + + iaddn(a, num) { + return this.iadd(a, this.convertTo(new BN(num))); + } + + isubn(a, num) { + return this.isub(a, this.convertTo(new BN(num))); + } + + imul(a, b) { + return this.mul(a, b)._move(a); + } + + mul(a, b) { + if (a.isZero() || b.isZero()) + return new BN(0)._forceRed(this); + + const t = a.mul(b); + const c = t.umaskn(this.n).mul(this.mi).iumaskn(this.n); + const u = t.iadd(c.mul(this.m)).iushrn(this.n); + + if (u.ucmp(this.m) >= 0) + u._isub(u, this.m); + + return u._forceRed(this); + } + + imuln(a, num) { + this._verify1(a); + + if (a.isZero()) + return a; + + if (num === 0) { + a.words[0] = 0; + a.length = 1; + return a; + } + + const neg = num < 0; + + if (neg) + num = -num; + + if (this.m.length === 1) + num %= this.m.words[0]; + + const bits = countBits(num); + + // Potentially compute with additions. + // This avoids an expensive division. + if (bits > 5) { + // Slow case (num > 31). + this.imul(a, this.convertTo(new BN(num))); + } else if ((num & (num - 1)) === 0) { + // Optimize for powers of two. + for (let i = 0; i < bits - 1; i++) + this.iadd(a, a); + } else { + // Multiply left to right. + const c = a.clone(); + + for (let i = bits - 2; i >= 0; i--) { + this.iadd(a, a); + + if ((num >> i) & 1) + this.iadd(a, c); + } + } + + if (neg) + this.ineg(a); + + return a; + } + + eqn(a, num) { + this._verify1(a); + + if (num === 0) + return a.isZero(); + + return a.ucmp(this.convertTo(new BN(num))) === 0; + } + + isLow(a) { + this._verify1(a); + return this.convertFrom(a).ucmp(this.m.ushrn(1)) <= 0; + } + + isOdd(a) { + this._verify1(a); + return this.convertFrom(a).isOdd(); + } + + isEven(a) { + this._verify1(a); + return this.convertFrom(a).isEven(); + } + + invert(a) { + this._verify1(a); + + // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R + return this.imod(a.invert(this.m).mul(this.r2)); + } + } + + /* + * Helpers + */ + + function makeError(Error, msg, start) { + const err = new Error(msg); + + if (Error.captureStackTrace) + Error.captureStackTrace(err, start); + + return err; + } + + function assert(value, message) { + if (!value) { + const msg = message || 'Assertion failed.'; + throw makeError(Error, msg, assert); + } + } + + function enforce(value, name, type) { + if (!value) { + const msg = `"${name}" must be a(n) ${type}.`; + throw makeError(TypeError, msg, enforce); + } + } + + function range(value, name) { + if (!value) { + const msg = `"${name}" only works with positive numbers.`; + throw makeError(RangeError, msg, range); + } + } + + function red(value, name) { + if (!value) { + const msg = `"${name}" only works with red numbers.`; + throw makeError(TypeError, msg, red); + } + } + + function nonred(value, name) { + if (!value) { + const msg = `"${name}" only works with normal numbers.`; + throw makeError(TypeError, msg, nonred); + } + } + + function nonzero(value) { + if (!value) { + const msg = 'Cannot divide by zero.'; + throw makeError(RangeError, msg, nonzero); + } + } + + class SquareRootError extends Error { + constructor(result) { + super(); + + this.name = 'SquareRootError'; + this.message = 'X is not a square mod P.'; + this.result = result.fromRed(); + + if (Error.captureStackTrace) + Error.captureStackTrace(this, SquareRootError); + } + } + + function isInteger(num) { + return Number.isSafeInteger(num); + } + + function isSMI(num) { + return isInteger(num) + && num >= -67108863 + && num <= 0x3ffffff; + } + + function allocate(ArrayType, size) { + if (ArrayType.allocUnsafeSlow) + return ArrayType.allocUnsafeSlow(size); + + return new ArrayType(size); + } + + function getBase(base) { + if (base == null) + return 10; + + if (typeof base === 'number') + return base; + + switch (base) { + case 'bin': + return 2; + case 'oct': + return 8; + case 'dec': + return 10; + case 'hex': + return 16; + } + + return 0; + } + + /* + * Internal + */ + + function countBits(w) { + if (Math.clz32) + return 32 - Math.clz32(w); + + let t = w; + let r = 0; + + if (t >= 0x1000) { + r += 13; + t >>>= 13; + } + + if (t >= 0x40) { + r += 7; + t >>>= 7; + } + + if (t >= 0x8) { + r += 4; + t >>>= 4; + } + + if (t >= 0x02) { + r += 2; + t >>>= 2; + } + + return r + t; + } + + function zeroBits(w) { + // Shortcut. + if (w === 0) + return 26; + + let t = w; + let r = 0; + + if ((t & 0x1fff) === 0) { + r += 13; + t >>>= 13; + } + + if ((t & 0x7f) === 0) { + r += 7; + t >>>= 7; + } + + if ((t & 0xf) === 0) { + r += 4; + t >>>= 4; + } + + if ((t & 0x3) === 0) { + r += 2; + t >>>= 2; + } + + if ((t & 0x1) === 0) + r += 1; + + return r; + } + + function parseHex(str, start, end) { + const len = Math.min(str.length, end); + + let r = 0; + let z = 0; + + for (let i = start; i < len; i++) { + const c = str.charCodeAt(i) - 48; + + r <<= 4; + + let b; + + if (c >= 49 && c <= 54) { + // 'a' - 'f' + b = c - 49 + 0xa; + } else if (c >= 17 && c <= 22) { + // 'A' - 'F' + b = c - 17 + 0xa; + } else { + // '0' - '9' + b = c; + } + + r |= b; + z |= b; + } + + if (z & -16) + throw new Error('Invalid string.'); + + return r; + } + + function parseBase(str, start, end, mul) { + const len = Math.min(str.length, end); + + let r = 0; + + for (let i = start; i < len; i++) { + const c = str.charCodeAt(i) - 48; + + r *= mul; + + let b; + + if (c >= 49) { + // 'a' + b = c - 49 + 0xa; + } else if (c >= 17) { + // 'A' + b = c - 17 + 0xa; + } else { + // '0' - '9' + b = c; + } + + if (c < 0 || c > 207 || b >= mul) + throw new Error('Invalid string.'); + + r += b; + } + + return r; + } + + /* + * Exponentiation (bigint) + */ + + function powInt(x, e, m) { + // Sliding window (odd multiples only). + const one = BigInt(1); + const wnd = new Array(WND_SIZE); + const x2 = (x * x) % m; + + wnd[0] = x; + + for (let i = 1; i < WND_SIZE; i++) + wnd[i] = (wnd[i - 1] * x2) % m; + + let i = e.bitLength(); + let r = one; + + while (i >= WND_WIDTH) { + let width = WND_WIDTH; + let bits = e.bits(i - width, width); + + if (bits < WND_SIZE) { + r = (r * r) % m; + i -= 1; + continue; + } + + while ((bits & 1) === 0) { + width -= 1; + bits >>= 1; + } + + if (r === one) { + r = wnd[bits >> 1]; + } else { + r = sqrn(r, width, m); + r = (r * wnd[bits >> 1]) % m; + } + + i -= width; + } + + if (i > 0) { + const bits = e.bits(0, i); + + while (i--) { + r = (r * r) % m; + + if ((bits >> i) & 1) + r = (r * x) % m; + } + } + + return r; + } + + function sqrn(x, n, m) { + for (let i = 0; i < n; i++) + x = (x * x) % m; + return x; + } + + /* + * Multiplication + */ + + function smallMulTo(self, num, out) { + const len = self.length + num.length; + + out.negative = self.negative ^ num.negative; + out._alloc(len); + out.length = len; + + // Peel one iteration (compiler can't + // do it, because of code complexity). + const a = self.words[0]; + const b = num.words[0]; + const r = a * b; + const lo = r & 0x3ffffff; + + let carry = (r / 0x4000000) | 0; + let k = 1; + + out.words[0] = lo; + + for (; k < out.length - 1; k++) { + // Sum all words with the same + // `i + j = k` and accumulate + // `ncarry`, note that ncarry + // could be >= 0x3ffffff. + let ncarry = carry >>> 26; + let rword = carry & 0x3ffffff; + + const min = Math.max(0, k - self.length + 1); + const max = Math.min(k, num.length - 1); + + for (let j = min; j <= max; j++) { + const i = k - j; + const a = self.words[i]; + const b = num.words[j]; + const r = a * b + rword; + + ncarry += (r / 0x4000000) | 0; + rword = r & 0x3ffffff; + } + + out.words[k] = rword | 0; + carry = ncarry | 0; + } + + if (carry !== 0) + out.words[k] = carry | 0; + else + out.length -= 1; + + return out._strip(); + } + + function bigMulTo(self, num, out) { + const len = self.length + num.length; + + out.negative = self.negative ^ num.negative; + out._alloc(len); + out.length = len; + + let carry = 0; + let hncarry = 0; + let k = 0; + + for (; k < out.length - 1; k++) { + // Sum all words with the same + // `i + j = k` and accumulate + // `ncarry`, note that ncarry + // could be >= 0x3ffffff. + let ncarry = hncarry; + + hncarry = 0; + + let rword = carry & 0x3ffffff; + + const min = Math.max(0, k - self.length + 1); + const max = Math.min(k, num.length - 1); + + for (let j = min; j <= max; j++) { + const i = k - j; + const a = self.words[i]; + const b = num.words[j]; + const r = a * b; + + let lo = r & 0x3ffffff; + + ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 0x3ffffff; + ncarry = (ncarry + (lo >>> 26)) | 0; + + hncarry += ncarry >>> 26; + ncarry &= 0x3ffffff; + } + + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; + } + + if (carry !== 0) + out.words[k] = carry; + else + out.length -= 1; + + return out._strip(); + } + + function jumboMulTo(x, y, out) { + // v8 has a 2147483519 bit max (~256mb). + if (!HAS_BIGINT || x.length + y.length > 82595519) + return bigMulTo(x, y, out); + + const zero = BigInt(0); + const mask = BigInt(0x3ffffff); + const shift = BigInt(26); + + let z = x.toBigInt() * y.toBigInt(); + + const neg = (z < zero) | 0; + + if (neg) + z = -z; + + let i = 0; + + while (z > zero) { + out.words[i++] = Number(z & mask); + z >>= shift; + } + + if (i === 0) + out.words[i++] = 0; + + out.length = i; + out.negative = neg; + + return out; + } + + function comb10MulTo(self, num, out) { + const a = self.words; + const b = num.words; + const o = out.words; + const a0 = a[0] | 0; + const al0 = a0 & 0x1fff; + const ah0 = a0 >>> 13; + const a1 = a[1] | 0; + const al1 = a1 & 0x1fff; + const ah1 = a1 >>> 13; + const a2 = a[2] | 0; + const al2 = a2 & 0x1fff; + const ah2 = a2 >>> 13; + const a3 = a[3] | 0; + const al3 = a3 & 0x1fff; + const ah3 = a3 >>> 13; + const a4 = a[4] | 0; + const al4 = a4 & 0x1fff; + const ah4 = a4 >>> 13; + const a5 = a[5] | 0; + const al5 = a5 & 0x1fff; + const ah5 = a5 >>> 13; + const a6 = a[6] | 0; + const al6 = a6 & 0x1fff; + const ah6 = a6 >>> 13; + const a7 = a[7] | 0; + const al7 = a7 & 0x1fff; + const ah7 = a7 >>> 13; + const a8 = a[8] | 0; + const al8 = a8 & 0x1fff; + const ah8 = a8 >>> 13; + const a9 = a[9] | 0; + const al9 = a9 & 0x1fff; + const ah9 = a9 >>> 13; + const b0 = b[0] | 0; + const bl0 = b0 & 0x1fff; + const bh0 = b0 >>> 13; + const b1 = b[1] | 0; + const bl1 = b1 & 0x1fff; + const bh1 = b1 >>> 13; + const b2 = b[2] | 0; + const bl2 = b2 & 0x1fff; + const bh2 = b2 >>> 13; + const b3 = b[3] | 0; + const bl3 = b3 & 0x1fff; + const bh3 = b3 >>> 13; + const b4 = b[4] | 0; + const bl4 = b4 & 0x1fff; + const bh4 = b4 >>> 13; + const b5 = b[5] | 0; + const bl5 = b5 & 0x1fff; + const bh5 = b5 >>> 13; + const b6 = b[6] | 0; + const bl6 = b6 & 0x1fff; + const bh6 = b6 >>> 13; + const b7 = b[7] | 0; + const bl7 = b7 & 0x1fff; + const bh7 = b7 >>> 13; + const b8 = b[8] | 0; + const bl8 = b8 & 0x1fff; + const bh8 = b8 >>> 13; + const b9 = b[9] | 0; + const bl9 = b9 & 0x1fff; + const bh9 = b9 >>> 13; + + let c = 0; + let lo, mid, hi; + + out.negative = self.negative ^ num.negative; + out._alloc(20); + out.length = 19; + + /* k = 0 */ + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = (mid + Math.imul(ah0, bl0)) | 0; + hi = Math.imul(ah0, bh0); + + let w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; + w0 &= 0x3ffffff; + + /* k = 1 */ + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = (mid + Math.imul(ah1, bl0)) | 0; + hi = Math.imul(ah1, bh0); + lo = (lo + Math.imul(al0, bl1)) | 0; + mid = (mid + Math.imul(al0, bh1)) | 0; + mid = (mid + Math.imul(ah0, bl1)) | 0; + hi = (hi + Math.imul(ah0, bh1)) | 0; + + let w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; + w1 &= 0x3ffffff; + + /* k = 2 */ + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = (mid + Math.imul(ah2, bl0)) | 0; + hi = Math.imul(ah2, bh0); + lo = (lo + Math.imul(al1, bl1)) | 0; + mid = (mid + Math.imul(al1, bh1)) | 0; + mid = (mid + Math.imul(ah1, bl1)) | 0; + hi = (hi + Math.imul(ah1, bh1)) | 0; + lo = (lo + Math.imul(al0, bl2)) | 0; + mid = (mid + Math.imul(al0, bh2)) | 0; + mid = (mid + Math.imul(ah0, bl2)) | 0; + hi = (hi + Math.imul(ah0, bh2)) | 0; + + let w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; + w2 &= 0x3ffffff; + + /* k = 3 */ + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = (mid + Math.imul(ah3, bl0)) | 0; + hi = Math.imul(ah3, bh0); + lo = (lo + Math.imul(al2, bl1)) | 0; + mid = (mid + Math.imul(al2, bh1)) | 0; + mid = (mid + Math.imul(ah2, bl1)) | 0; + hi = (hi + Math.imul(ah2, bh1)) | 0; + lo = (lo + Math.imul(al1, bl2)) | 0; + mid = (mid + Math.imul(al1, bh2)) | 0; + mid = (mid + Math.imul(ah1, bl2)) | 0; + hi = (hi + Math.imul(ah1, bh2)) | 0; + lo = (lo + Math.imul(al0, bl3)) | 0; + mid = (mid + Math.imul(al0, bh3)) | 0; + mid = (mid + Math.imul(ah0, bl3)) | 0; + hi = (hi + Math.imul(ah0, bh3)) | 0; + + let w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; + w3 &= 0x3ffffff; + + /* k = 4 */ + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = (mid + Math.imul(ah4, bl0)) | 0; + hi = Math.imul(ah4, bh0); + lo = (lo + Math.imul(al3, bl1)) | 0; + mid = (mid + Math.imul(al3, bh1)) | 0; + mid = (mid + Math.imul(ah3, bl1)) | 0; + hi = (hi + Math.imul(ah3, bh1)) | 0; + lo = (lo + Math.imul(al2, bl2)) | 0; + mid = (mid + Math.imul(al2, bh2)) | 0; + mid = (mid + Math.imul(ah2, bl2)) | 0; + hi = (hi + Math.imul(ah2, bh2)) | 0; + lo = (lo + Math.imul(al1, bl3)) | 0; + mid = (mid + Math.imul(al1, bh3)) | 0; + mid = (mid + Math.imul(ah1, bl3)) | 0; + hi = (hi + Math.imul(ah1, bh3)) | 0; + lo = (lo + Math.imul(al0, bl4)) | 0; + mid = (mid + Math.imul(al0, bh4)) | 0; + mid = (mid + Math.imul(ah0, bl4)) | 0; + hi = (hi + Math.imul(ah0, bh4)) | 0; + + let w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; + w4 &= 0x3ffffff; + + /* k = 5 */ + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = (mid + Math.imul(ah5, bl0)) | 0; + hi = Math.imul(ah5, bh0); + lo = (lo + Math.imul(al4, bl1)) | 0; + mid = (mid + Math.imul(al4, bh1)) | 0; + mid = (mid + Math.imul(ah4, bl1)) | 0; + hi = (hi + Math.imul(ah4, bh1)) | 0; + lo = (lo + Math.imul(al3, bl2)) | 0; + mid = (mid + Math.imul(al3, bh2)) | 0; + mid = (mid + Math.imul(ah3, bl2)) | 0; + hi = (hi + Math.imul(ah3, bh2)) | 0; + lo = (lo + Math.imul(al2, bl3)) | 0; + mid = (mid + Math.imul(al2, bh3)) | 0; + mid = (mid + Math.imul(ah2, bl3)) | 0; + hi = (hi + Math.imul(ah2, bh3)) | 0; + lo = (lo + Math.imul(al1, bl4)) | 0; + mid = (mid + Math.imul(al1, bh4)) | 0; + mid = (mid + Math.imul(ah1, bl4)) | 0; + hi = (hi + Math.imul(ah1, bh4)) | 0; + lo = (lo + Math.imul(al0, bl5)) | 0; + mid = (mid + Math.imul(al0, bh5)) | 0; + mid = (mid + Math.imul(ah0, bl5)) | 0; + hi = (hi + Math.imul(ah0, bh5)) | 0; + + let w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; + w5 &= 0x3ffffff; + + /* k = 6 */ + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = (mid + Math.imul(ah6, bl0)) | 0; + hi = Math.imul(ah6, bh0); + lo = (lo + Math.imul(al5, bl1)) | 0; + mid = (mid + Math.imul(al5, bh1)) | 0; + mid = (mid + Math.imul(ah5, bl1)) | 0; + hi = (hi + Math.imul(ah5, bh1)) | 0; + lo = (lo + Math.imul(al4, bl2)) | 0; + mid = (mid + Math.imul(al4, bh2)) | 0; + mid = (mid + Math.imul(ah4, bl2)) | 0; + hi = (hi + Math.imul(ah4, bh2)) | 0; + lo = (lo + Math.imul(al3, bl3)) | 0; + mid = (mid + Math.imul(al3, bh3)) | 0; + mid = (mid + Math.imul(ah3, bl3)) | 0; + hi = (hi + Math.imul(ah3, bh3)) | 0; + lo = (lo + Math.imul(al2, bl4)) | 0; + mid = (mid + Math.imul(al2, bh4)) | 0; + mid = (mid + Math.imul(ah2, bl4)) | 0; + hi = (hi + Math.imul(ah2, bh4)) | 0; + lo = (lo + Math.imul(al1, bl5)) | 0; + mid = (mid + Math.imul(al1, bh5)) | 0; + mid = (mid + Math.imul(ah1, bl5)) | 0; + hi = (hi + Math.imul(ah1, bh5)) | 0; + lo = (lo + Math.imul(al0, bl6)) | 0; + mid = (mid + Math.imul(al0, bh6)) | 0; + mid = (mid + Math.imul(ah0, bl6)) | 0; + hi = (hi + Math.imul(ah0, bh6)) | 0; + + let w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; + w6 &= 0x3ffffff; + + /* k = 7 */ + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = (mid + Math.imul(ah7, bl0)) | 0; + hi = Math.imul(ah7, bh0); + lo = (lo + Math.imul(al6, bl1)) | 0; + mid = (mid + Math.imul(al6, bh1)) | 0; + mid = (mid + Math.imul(ah6, bl1)) | 0; + hi = (hi + Math.imul(ah6, bh1)) | 0; + lo = (lo + Math.imul(al5, bl2)) | 0; + mid = (mid + Math.imul(al5, bh2)) | 0; + mid = (mid + Math.imul(ah5, bl2)) | 0; + hi = (hi + Math.imul(ah5, bh2)) | 0; + lo = (lo + Math.imul(al4, bl3)) | 0; + mid = (mid + Math.imul(al4, bh3)) | 0; + mid = (mid + Math.imul(ah4, bl3)) | 0; + hi = (hi + Math.imul(ah4, bh3)) | 0; + lo = (lo + Math.imul(al3, bl4)) | 0; + mid = (mid + Math.imul(al3, bh4)) | 0; + mid = (mid + Math.imul(ah3, bl4)) | 0; + hi = (hi + Math.imul(ah3, bh4)) | 0; + lo = (lo + Math.imul(al2, bl5)) | 0; + mid = (mid + Math.imul(al2, bh5)) | 0; + mid = (mid + Math.imul(ah2, bl5)) | 0; + hi = (hi + Math.imul(ah2, bh5)) | 0; + lo = (lo + Math.imul(al1, bl6)) | 0; + mid = (mid + Math.imul(al1, bh6)) | 0; + mid = (mid + Math.imul(ah1, bl6)) | 0; + hi = (hi + Math.imul(ah1, bh6)) | 0; + lo = (lo + Math.imul(al0, bl7)) | 0; + mid = (mid + Math.imul(al0, bh7)) | 0; + mid = (mid + Math.imul(ah0, bl7)) | 0; + hi = (hi + Math.imul(ah0, bh7)) | 0; + + let w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; + w7 &= 0x3ffffff; + + /* k = 8 */ + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = (mid + Math.imul(ah8, bl0)) | 0; + hi = Math.imul(ah8, bh0); + lo = (lo + Math.imul(al7, bl1)) | 0; + mid = (mid + Math.imul(al7, bh1)) | 0; + mid = (mid + Math.imul(ah7, bl1)) | 0; + hi = (hi + Math.imul(ah7, bh1)) | 0; + lo = (lo + Math.imul(al6, bl2)) | 0; + mid = (mid + Math.imul(al6, bh2)) | 0; + mid = (mid + Math.imul(ah6, bl2)) | 0; + hi = (hi + Math.imul(ah6, bh2)) | 0; + lo = (lo + Math.imul(al5, bl3)) | 0; + mid = (mid + Math.imul(al5, bh3)) | 0; + mid = (mid + Math.imul(ah5, bl3)) | 0; + hi = (hi + Math.imul(ah5, bh3)) | 0; + lo = (lo + Math.imul(al4, bl4)) | 0; + mid = (mid + Math.imul(al4, bh4)) | 0; + mid = (mid + Math.imul(ah4, bl4)) | 0; + hi = (hi + Math.imul(ah4, bh4)) | 0; + lo = (lo + Math.imul(al3, bl5)) | 0; + mid = (mid + Math.imul(al3, bh5)) | 0; + mid = (mid + Math.imul(ah3, bl5)) | 0; + hi = (hi + Math.imul(ah3, bh5)) | 0; + lo = (lo + Math.imul(al2, bl6)) | 0; + mid = (mid + Math.imul(al2, bh6)) | 0; + mid = (mid + Math.imul(ah2, bl6)) | 0; + hi = (hi + Math.imul(ah2, bh6)) | 0; + lo = (lo + Math.imul(al1, bl7)) | 0; + mid = (mid + Math.imul(al1, bh7)) | 0; + mid = (mid + Math.imul(ah1, bl7)) | 0; + hi = (hi + Math.imul(ah1, bh7)) | 0; + lo = (lo + Math.imul(al0, bl8)) | 0; + mid = (mid + Math.imul(al0, bh8)) | 0; + mid = (mid + Math.imul(ah0, bl8)) | 0; + hi = (hi + Math.imul(ah0, bh8)) | 0; + + let w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; + w8 &= 0x3ffffff; + + /* k = 9 */ + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = (mid + Math.imul(ah9, bl0)) | 0; + hi = Math.imul(ah9, bh0); + lo = (lo + Math.imul(al8, bl1)) | 0; + mid = (mid + Math.imul(al8, bh1)) | 0; + mid = (mid + Math.imul(ah8, bl1)) | 0; + hi = (hi + Math.imul(ah8, bh1)) | 0; + lo = (lo + Math.imul(al7, bl2)) | 0; + mid = (mid + Math.imul(al7, bh2)) | 0; + mid = (mid + Math.imul(ah7, bl2)) | 0; + hi = (hi + Math.imul(ah7, bh2)) | 0; + lo = (lo + Math.imul(al6, bl3)) | 0; + mid = (mid + Math.imul(al6, bh3)) | 0; + mid = (mid + Math.imul(ah6, bl3)) | 0; + hi = (hi + Math.imul(ah6, bh3)) | 0; + lo = (lo + Math.imul(al5, bl4)) | 0; + mid = (mid + Math.imul(al5, bh4)) | 0; + mid = (mid + Math.imul(ah5, bl4)) | 0; + hi = (hi + Math.imul(ah5, bh4)) | 0; + lo = (lo + Math.imul(al4, bl5)) | 0; + mid = (mid + Math.imul(al4, bh5)) | 0; + mid = (mid + Math.imul(ah4, bl5)) | 0; + hi = (hi + Math.imul(ah4, bh5)) | 0; + lo = (lo + Math.imul(al3, bl6)) | 0; + mid = (mid + Math.imul(al3, bh6)) | 0; + mid = (mid + Math.imul(ah3, bl6)) | 0; + hi = (hi + Math.imul(ah3, bh6)) | 0; + lo = (lo + Math.imul(al2, bl7)) | 0; + mid = (mid + Math.imul(al2, bh7)) | 0; + mid = (mid + Math.imul(ah2, bl7)) | 0; + hi = (hi + Math.imul(ah2, bh7)) | 0; + lo = (lo + Math.imul(al1, bl8)) | 0; + mid = (mid + Math.imul(al1, bh8)) | 0; + mid = (mid + Math.imul(ah1, bl8)) | 0; + hi = (hi + Math.imul(ah1, bh8)) | 0; + lo = (lo + Math.imul(al0, bl9)) | 0; + mid = (mid + Math.imul(al0, bh9)) | 0; + mid = (mid + Math.imul(ah0, bl9)) | 0; + hi = (hi + Math.imul(ah0, bh9)) | 0; + + let w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; + w9 &= 0x3ffffff; + + /* k = 10 */ + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = (mid + Math.imul(ah9, bl1)) | 0; + hi = Math.imul(ah9, bh1); + lo = (lo + Math.imul(al8, bl2)) | 0; + mid = (mid + Math.imul(al8, bh2)) | 0; + mid = (mid + Math.imul(ah8, bl2)) | 0; + hi = (hi + Math.imul(ah8, bh2)) | 0; + lo = (lo + Math.imul(al7, bl3)) | 0; + mid = (mid + Math.imul(al7, bh3)) | 0; + mid = (mid + Math.imul(ah7, bl3)) | 0; + hi = (hi + Math.imul(ah7, bh3)) | 0; + lo = (lo + Math.imul(al6, bl4)) | 0; + mid = (mid + Math.imul(al6, bh4)) | 0; + mid = (mid + Math.imul(ah6, bl4)) | 0; + hi = (hi + Math.imul(ah6, bh4)) | 0; + lo = (lo + Math.imul(al5, bl5)) | 0; + mid = (mid + Math.imul(al5, bh5)) | 0; + mid = (mid + Math.imul(ah5, bl5)) | 0; + hi = (hi + Math.imul(ah5, bh5)) | 0; + lo = (lo + Math.imul(al4, bl6)) | 0; + mid = (mid + Math.imul(al4, bh6)) | 0; + mid = (mid + Math.imul(ah4, bl6)) | 0; + hi = (hi + Math.imul(ah4, bh6)) | 0; + lo = (lo + Math.imul(al3, bl7)) | 0; + mid = (mid + Math.imul(al3, bh7)) | 0; + mid = (mid + Math.imul(ah3, bl7)) | 0; + hi = (hi + Math.imul(ah3, bh7)) | 0; + lo = (lo + Math.imul(al2, bl8)) | 0; + mid = (mid + Math.imul(al2, bh8)) | 0; + mid = (mid + Math.imul(ah2, bl8)) | 0; + hi = (hi + Math.imul(ah2, bh8)) | 0; + lo = (lo + Math.imul(al1, bl9)) | 0; + mid = (mid + Math.imul(al1, bh9)) | 0; + mid = (mid + Math.imul(ah1, bl9)) | 0; + hi = (hi + Math.imul(ah1, bh9)) | 0; + + let w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; + w10 &= 0x3ffffff; + + /* k = 11 */ + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = (mid + Math.imul(ah9, bl2)) | 0; + hi = Math.imul(ah9, bh2); + lo = (lo + Math.imul(al8, bl3)) | 0; + mid = (mid + Math.imul(al8, bh3)) | 0; + mid = (mid + Math.imul(ah8, bl3)) | 0; + hi = (hi + Math.imul(ah8, bh3)) | 0; + lo = (lo + Math.imul(al7, bl4)) | 0; + mid = (mid + Math.imul(al7, bh4)) | 0; + mid = (mid + Math.imul(ah7, bl4)) | 0; + hi = (hi + Math.imul(ah7, bh4)) | 0; + lo = (lo + Math.imul(al6, bl5)) | 0; + mid = (mid + Math.imul(al6, bh5)) | 0; + mid = (mid + Math.imul(ah6, bl5)) | 0; + hi = (hi + Math.imul(ah6, bh5)) | 0; + lo = (lo + Math.imul(al5, bl6)) | 0; + mid = (mid + Math.imul(al5, bh6)) | 0; + mid = (mid + Math.imul(ah5, bl6)) | 0; + hi = (hi + Math.imul(ah5, bh6)) | 0; + lo = (lo + Math.imul(al4, bl7)) | 0; + mid = (mid + Math.imul(al4, bh7)) | 0; + mid = (mid + Math.imul(ah4, bl7)) | 0; + hi = (hi + Math.imul(ah4, bh7)) | 0; + lo = (lo + Math.imul(al3, bl8)) | 0; + mid = (mid + Math.imul(al3, bh8)) | 0; + mid = (mid + Math.imul(ah3, bl8)) | 0; + hi = (hi + Math.imul(ah3, bh8)) | 0; + lo = (lo + Math.imul(al2, bl9)) | 0; + mid = (mid + Math.imul(al2, bh9)) | 0; + mid = (mid + Math.imul(ah2, bl9)) | 0; + hi = (hi + Math.imul(ah2, bh9)) | 0; + + let w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; + w11 &= 0x3ffffff; + + /* k = 12 */ + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = (mid + Math.imul(ah9, bl3)) | 0; + hi = Math.imul(ah9, bh3); + lo = (lo + Math.imul(al8, bl4)) | 0; + mid = (mid + Math.imul(al8, bh4)) | 0; + mid = (mid + Math.imul(ah8, bl4)) | 0; + hi = (hi + Math.imul(ah8, bh4)) | 0; + lo = (lo + Math.imul(al7, bl5)) | 0; + mid = (mid + Math.imul(al7, bh5)) | 0; + mid = (mid + Math.imul(ah7, bl5)) | 0; + hi = (hi + Math.imul(ah7, bh5)) | 0; + lo = (lo + Math.imul(al6, bl6)) | 0; + mid = (mid + Math.imul(al6, bh6)) | 0; + mid = (mid + Math.imul(ah6, bl6)) | 0; + hi = (hi + Math.imul(ah6, bh6)) | 0; + lo = (lo + Math.imul(al5, bl7)) | 0; + mid = (mid + Math.imul(al5, bh7)) | 0; + mid = (mid + Math.imul(ah5, bl7)) | 0; + hi = (hi + Math.imul(ah5, bh7)) | 0; + lo = (lo + Math.imul(al4, bl8)) | 0; + mid = (mid + Math.imul(al4, bh8)) | 0; + mid = (mid + Math.imul(ah4, bl8)) | 0; + hi = (hi + Math.imul(ah4, bh8)) | 0; + lo = (lo + Math.imul(al3, bl9)) | 0; + mid = (mid + Math.imul(al3, bh9)) | 0; + mid = (mid + Math.imul(ah3, bl9)) | 0; + hi = (hi + Math.imul(ah3, bh9)) | 0; + + let w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; + w12 &= 0x3ffffff; + + /* k = 13 */ + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = (mid + Math.imul(ah9, bl4)) | 0; + hi = Math.imul(ah9, bh4); + lo = (lo + Math.imul(al8, bl5)) | 0; + mid = (mid + Math.imul(al8, bh5)) | 0; + mid = (mid + Math.imul(ah8, bl5)) | 0; + hi = (hi + Math.imul(ah8, bh5)) | 0; + lo = (lo + Math.imul(al7, bl6)) | 0; + mid = (mid + Math.imul(al7, bh6)) | 0; + mid = (mid + Math.imul(ah7, bl6)) | 0; + hi = (hi + Math.imul(ah7, bh6)) | 0; + lo = (lo + Math.imul(al6, bl7)) | 0; + mid = (mid + Math.imul(al6, bh7)) | 0; + mid = (mid + Math.imul(ah6, bl7)) | 0; + hi = (hi + Math.imul(ah6, bh7)) | 0; + lo = (lo + Math.imul(al5, bl8)) | 0; + mid = (mid + Math.imul(al5, bh8)) | 0; + mid = (mid + Math.imul(ah5, bl8)) | 0; + hi = (hi + Math.imul(ah5, bh8)) | 0; + lo = (lo + Math.imul(al4, bl9)) | 0; + mid = (mid + Math.imul(al4, bh9)) | 0; + mid = (mid + Math.imul(ah4, bl9)) | 0; + hi = (hi + Math.imul(ah4, bh9)) | 0; + + let w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; + w13 &= 0x3ffffff; + + /* k = 14 */ + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = (mid + Math.imul(ah9, bl5)) | 0; + hi = Math.imul(ah9, bh5); + lo = (lo + Math.imul(al8, bl6)) | 0; + mid = (mid + Math.imul(al8, bh6)) | 0; + mid = (mid + Math.imul(ah8, bl6)) | 0; + hi = (hi + Math.imul(ah8, bh6)) | 0; + lo = (lo + Math.imul(al7, bl7)) | 0; + mid = (mid + Math.imul(al7, bh7)) | 0; + mid = (mid + Math.imul(ah7, bl7)) | 0; + hi = (hi + Math.imul(ah7, bh7)) | 0; + lo = (lo + Math.imul(al6, bl8)) | 0; + mid = (mid + Math.imul(al6, bh8)) | 0; + mid = (mid + Math.imul(ah6, bl8)) | 0; + hi = (hi + Math.imul(ah6, bh8)) | 0; + lo = (lo + Math.imul(al5, bl9)) | 0; + mid = (mid + Math.imul(al5, bh9)) | 0; + mid = (mid + Math.imul(ah5, bl9)) | 0; + hi = (hi + Math.imul(ah5, bh9)) | 0; + + let w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; + w14 &= 0x3ffffff; + + /* k = 15 */ + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = (mid + Math.imul(ah9, bl6)) | 0; + hi = Math.imul(ah9, bh6); + lo = (lo + Math.imul(al8, bl7)) | 0; + mid = (mid + Math.imul(al8, bh7)) | 0; + mid = (mid + Math.imul(ah8, bl7)) | 0; + hi = (hi + Math.imul(ah8, bh7)) | 0; + lo = (lo + Math.imul(al7, bl8)) | 0; + mid = (mid + Math.imul(al7, bh8)) | 0; + mid = (mid + Math.imul(ah7, bl8)) | 0; + hi = (hi + Math.imul(ah7, bh8)) | 0; + lo = (lo + Math.imul(al6, bl9)) | 0; + mid = (mid + Math.imul(al6, bh9)) | 0; + mid = (mid + Math.imul(ah6, bl9)) | 0; + hi = (hi + Math.imul(ah6, bh9)) | 0; + + let w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; + w15 &= 0x3ffffff; + + /* k = 16 */ + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = (mid + Math.imul(ah9, bl7)) | 0; + hi = Math.imul(ah9, bh7); + lo = (lo + Math.imul(al8, bl8)) | 0; + mid = (mid + Math.imul(al8, bh8)) | 0; + mid = (mid + Math.imul(ah8, bl8)) | 0; + hi = (hi + Math.imul(ah8, bh8)) | 0; + lo = (lo + Math.imul(al7, bl9)) | 0; + mid = (mid + Math.imul(al7, bh9)) | 0; + mid = (mid + Math.imul(ah7, bl9)) | 0; + hi = (hi + Math.imul(ah7, bh9)) | 0; + + let w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; + w16 &= 0x3ffffff; + + /* k = 17 */ + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = (mid + Math.imul(ah9, bl8)) | 0; + hi = Math.imul(ah9, bh8); + lo = (lo + Math.imul(al8, bl9)) | 0; + mid = (mid + Math.imul(al8, bh9)) | 0; + mid = (mid + Math.imul(ah8, bl9)) | 0; + hi = (hi + Math.imul(ah8, bh9)) | 0; + + let w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; + w17 &= 0x3ffffff; + + /* k = 18 */ + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = (mid + Math.imul(ah9, bl9)) | 0; + hi = Math.imul(ah9, bh9); + + let w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; + w18 &= 0x3ffffff; + + o[0] = w0; + o[1] = w1; + o[2] = w2; + o[3] = w3; + o[4] = w4; + o[5] = w5; + o[6] = w6; + o[7] = w7; + o[8] = w8; + o[9] = w9; + o[10] = w10; + o[11] = w11; + o[12] = w12; + o[13] = w13; + o[14] = w14; + o[15] = w15; + o[16] = w16; + o[17] = w17; + o[18] = w18; + + if (c !== 0) { + o[19] = c; + out.length += 1; + } + + // Note: we shouldn't need to strip here. + return out; + } + + // Polyfill comb. + if (!Math.imul) + comb10MulTo = smallMulTo; + + /* + * Expose + */ + + BN.Red = Red; + + bn = BN; + return bn; +} + +/*! + * bn.js - big numbers for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + +var bnBrowser; +var hasRequiredBnBrowser; + +function requireBnBrowser () { + if (hasRequiredBnBrowser) return bnBrowser; + hasRequiredBnBrowser = 1; + + bnBrowser = requireBn(); + return bnBrowser; +} + +var chacha20; +var hasRequiredChacha20; + +function requireChacha20 () { + if (hasRequiredChacha20) return chacha20; + hasRequiredChacha20 = 1; + + const assert = requireAssert(); + + /* + * Constants + */ + + const BIG_ENDIAN = new Int8Array(new Int16Array([1]).buffer)[0] === 0; + + /** + * ChaCha20 + */ + + class ChaCha20 { + /** + * Create a ChaCha20 context. + * @constructor + */ + + constructor() { + this.state = new Uint32Array(16); + this.stream = new Uint32Array(16); + this.bytes = new Uint8Array(this.stream.buffer); + this.pos = -1; + + if (BIG_ENDIAN) + this.bytes = bufferExports.Buffer.alloc(64); + } + + /** + * Initialize chacha20 with a key, nonce, and counter. + * @param {Buffer} key + * @param {Buffer} nonce + * @param {Number} counter + */ + + init(key, nonce, counter) { + if (counter == null) + counter = 0; + + assert(bufferExports.Buffer.isBuffer(key)); + assert(bufferExports.Buffer.isBuffer(nonce)); + assert(Number.isSafeInteger(counter)); + + if (key.length !== 16 && key.length !== 32) + throw new RangeError('Invalid key size.'); + + if (nonce.length >= 24) { + key = ChaCha20.derive(key, nonce.slice(0, 16)); + nonce = nonce.slice(16); + } + + this.state[0] = 0x61707865; + this.state[1] = key.length < 32 ? 0x3120646e : 0x3320646e; + this.state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32; + this.state[3] = 0x6b206574; + this.state[4] = readU32(key, 0); + this.state[5] = readU32(key, 4); + this.state[6] = readU32(key, 8); + this.state[7] = readU32(key, 12); + this.state[8] = readU32(key, 16 % key.length); + this.state[9] = readU32(key, 20 % key.length); + this.state[10] = readU32(key, 24 % key.length); + this.state[11] = readU32(key, 28 % key.length); + this.state[12] = counter >>> 0; + + if (nonce.length === 8) { + this.state[13] = (counter / 0x100000000) >>> 0; + this.state[14] = readU32(nonce, 0); + this.state[15] = readU32(nonce, 4); + } else if (nonce.length === 12) { + this.state[13] = readU32(nonce, 0); + this.state[14] = readU32(nonce, 4); + this.state[15] = readU32(nonce, 8); + } else if (nonce.length === 16) { + this.state[12] = readU32(nonce, 0); + this.state[13] = readU32(nonce, 4); + this.state[14] = readU32(nonce, 8); + this.state[15] = readU32(nonce, 12); + } else { + throw new RangeError('Invalid nonce size.'); + } + + this.pos = 0; + + return this; + } + + /** + * Encrypt/decrypt data. + * @param {Buffer} data - Will be mutated. + * @returns {Buffer} + */ + + encrypt(data) { + assert(bufferExports.Buffer.isBuffer(data)); + + if (this.pos === -1) + throw new Error('Context is not initialized.'); + + for (let i = 0; i < data.length; i++) { + if ((this.pos & 63) === 0) { + this._block(); + this.pos = 0; + } + + data[i] ^= this.bytes[this.pos++]; + } + + return data; + } + + /** + * Stir the stream. + */ + + _block() { + for (let i = 0; i < 16; i++) + this.stream[i] = this.state[i]; + + for (let i = 0; i < 10; i++) { + qround(this.stream, 0, 4, 8, 12); + qround(this.stream, 1, 5, 9, 13); + qround(this.stream, 2, 6, 10, 14); + qround(this.stream, 3, 7, 11, 15); + qround(this.stream, 0, 5, 10, 15); + qround(this.stream, 1, 6, 11, 12); + qround(this.stream, 2, 7, 8, 13); + qround(this.stream, 3, 4, 9, 14); + } + + for (let i = 0; i < 16; i++) + this.stream[i] += this.state[i]; + + if (BIG_ENDIAN) { + for (let i = 0; i < 16; i++) + writeU32(this.bytes, this.stream[i], i * 4); + } + + this.state[12] += 1; + + if (this.state[12] === 0) + this.state[13] += 1; + } + + /** + * Destroy context. + */ + + destroy() { + for (let i = 0; i < 16; i++) { + this.state[i] = 0; + this.stream[i] = 0; + } + + if (BIG_ENDIAN) { + for (let i = 0; i < 64; i++) + this.bytes[i] = 0; + } + + this.pos = -1; + + return this; + } + + /** + * Derive key with XChaCha20. + * @param {Buffer} key + * @param {Buffer} nonce + * @returns {Buffer} + */ + + static derive(key, nonce) { + assert(bufferExports.Buffer.isBuffer(key)); + assert(bufferExports.Buffer.isBuffer(nonce)); + + if (key.length !== 16 && key.length !== 32) + throw new RangeError('Invalid key size.'); + + if (nonce.length !== 16) + throw new RangeError('Invalid nonce size.'); + + const state = new Uint32Array(16); + + state[0] = 0x61707865; + state[1] = key.length < 32 ? 0x3120646e : 0x3320646e; + state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32; + state[3] = 0x6b206574; + state[4] = readU32(key, 0); + state[5] = readU32(key, 4); + state[6] = readU32(key, 8); + state[7] = readU32(key, 12); + state[8] = readU32(key, 16 % key.length); + state[9] = readU32(key, 20 % key.length); + state[10] = readU32(key, 24 % key.length); + state[11] = readU32(key, 28 % key.length); + state[12] = readU32(nonce, 0); + state[13] = readU32(nonce, 4); + state[14] = readU32(nonce, 8); + state[15] = readU32(nonce, 12); + + for (let i = 0; i < 10; i++) { + qround(state, 0, 4, 8, 12); + qround(state, 1, 5, 9, 13); + qround(state, 2, 6, 10, 14); + qround(state, 3, 7, 11, 15); + qround(state, 0, 5, 10, 15); + qround(state, 1, 6, 11, 12); + qround(state, 2, 7, 8, 13); + qround(state, 3, 4, 9, 14); + } + + const out = bufferExports.Buffer.alloc(32); + + writeU32(out, state[0], 0); + writeU32(out, state[1], 4); + writeU32(out, state[2], 8); + writeU32(out, state[3], 12); + writeU32(out, state[12], 16); + writeU32(out, state[13], 20); + writeU32(out, state[14], 24); + writeU32(out, state[15], 28); + + return out; + } + } + + /* + * Static + */ + + ChaCha20.native = 0; + + /* + * Helpers + */ + + function qround(x, a, b, c, d) { + x[a] += x[b]; + x[d] = rotl32(x[d] ^ x[a], 16); + + x[c] += x[d]; + x[b] = rotl32(x[b] ^ x[c], 12); + + x[a] += x[b]; + x[d] = rotl32(x[d] ^ x[a], 8); + + x[c] += x[d]; + x[b] = rotl32(x[b] ^ x[c], 7); + } + + function rotl32(w, b) { + return (w << b) | (w >>> (32 - b)); + } + + function readU32(data, off) { + return (data[off++] + + data[off++] * 0x100 + + data[off++] * 0x10000 + + data[off] * 0x1000000); + } + + function writeU32(dst, num, off) { + dst[off++] = num; + num >>>= 8; + dst[off++] = num; + num >>>= 8; + dst[off++] = num; + num >>>= 8; + dst[off++] = num; + return off; + } + + /* + * Expose + */ + + chacha20 = ChaCha20; + return chacha20; +} + +/*! + * chacha20.js - chacha20 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + +var chacha20Browser; +var hasRequiredChacha20Browser; + +function requireChacha20Browser () { + if (hasRequiredChacha20Browser) return chacha20Browser; + hasRequiredChacha20Browser = 1; + + chacha20Browser = requireChacha20(); + return chacha20Browser; } -// @ts-ignore -function toBigNumber(value) { - return BigNumber.from(toHex(value)); + +var hmac; +var hasRequiredHmac; + +function requireHmac () { + if (hasRequiredHmac) return hmac; + hasRequiredHmac = 1; + + const assert = requireAssert(); + + /** + * HMAC + */ + + class HMAC { + /** + * Create an HMAC. + * @param {Function} Hash + * @param {Number} size + * @param {Array} [x=[]] + * @param {Array} [y=[]] + */ + + constructor(Hash, size, x = [], y = []) { + assert(typeof Hash === 'function'); + assert((size >>> 0) === size); + assert(Array.isArray(x)); + assert(Array.isArray(y)); + + this.hash = Hash; + this.size = size; + this.x = x; + this.y = y; + + this.inner = new Hash(); + this.outer = new Hash(); + } + + /** + * Initialize HMAC context. + * @param {Buffer} data + */ + + init(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + // Shorten key + if (key.length > this.size) { + const Hash = this.hash; + const h = new Hash(); + + h.init(...this.x); + h.update(key); + + key = h.final(...this.y); + + assert(key.length <= this.size); + } + + // Pad key + const pad = bufferExports.Buffer.alloc(this.size); + + for (let i = 0; i < key.length; i++) + pad[i] = key[i] ^ 0x36; + + for (let i = key.length; i < pad.length; i++) + pad[i] = 0x36; + + this.inner.init(...this.x); + this.inner.update(pad); + + for (let i = 0; i < key.length; i++) + pad[i] = key[i] ^ 0x5c; + + for (let i = key.length; i < pad.length; i++) + pad[i] = 0x5c; + + this.outer.init(...this.x); + this.outer.update(pad); + + return this; + } + + /** + * Update HMAC context. + * @param {Buffer} data + */ + + update(data) { + this.inner.update(data); + return this; + } + + /** + * Finalize HMAC context. + * @returns {Buffer} + */ + + final() { + this.outer.update(this.inner.final(...this.y)); + return this.outer.final(...this.y); + } + } + + /* + * Expose + */ + + hmac = HMAC; + return hmac; } -// @ts-ignore -function toBN(value) { - const hex = BigNumber.from(value).toHexString(); - if (hex[0] === "-") { - return new BN("-" + hex.substring(3), 16); - } - return new BN(hex.substring(2), 16); + +var sha256$1; +var hasRequiredSha256; + +function requireSha256 () { + if (hasRequiredSha256) return sha256$1; + hasRequiredSha256 = 1; + + const assert = requireAssert(); + const HMAC = requireHmac(); + + /* + * Constants + */ + + const FINALIZED = -1; + const DESC = bufferExports.Buffer.alloc(8, 0x00); + const PADDING = bufferExports.Buffer.alloc(64, 0x00); + + PADDING[0] = 0x80; + + const K = new Uint32Array([ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 + ]); + + /** + * SHA256 + */ + + class SHA256 { + constructor() { + this.state = new Uint32Array(8); + this.msg = new Uint32Array(64); + this.block = bufferExports.Buffer.alloc(64); + this.size = FINALIZED; + } + + init() { + this.state[0] = 0x6a09e667; + this.state[1] = 0xbb67ae85; + this.state[2] = 0x3c6ef372; + this.state[3] = 0xa54ff53a; + this.state[4] = 0x510e527f; + this.state[5] = 0x9b05688c; + this.state[6] = 0x1f83d9ab; + this.state[7] = 0x5be0cd19; + this.size = 0; + return this; + } + + update(data) { + assert(bufferExports.Buffer.isBuffer(data)); + this._update(data, data.length); + return this; + } + + final() { + return this._final(bufferExports.Buffer.alloc(32)); + } + + _update(data, len) { + assert(this.size !== FINALIZED, 'Context is not initialized.'); + + let pos = this.size & 63; + let off = 0; + + this.size += len; + + if (pos > 0) { + let want = 64 - pos; + + if (want > len) + want = len; + + data.copy(this.block, pos, off, off + want); + + pos += want; + len -= want; + off += want; + + if (pos < 64) + return; + + this._transform(this.block, 0); + } + + while (len >= 64) { + this._transform(data, off); + off += 64; + len -= 64; + } + + if (len > 0) + data.copy(this.block, 0, off, off + len); + } + + _final(out) { + assert(this.size !== FINALIZED, 'Context is not initialized.'); + + const pos = this.size & 63; + const len = this.size * 8; + + writeU32(DESC, (len * (1 / 0x100000000)) >>> 0, 0); + writeU32(DESC, len >>> 0, 4); + + this._update(PADDING, 1 + ((119 - pos) & 63)); + this._update(DESC, 8); + + for (let i = 0; i < 8; i++) { + writeU32(out, this.state[i], i * 4); + this.state[i] = 0; + } + + for (let i = 0; i < 64; i++) + this.msg[i] = 0; + + for (let i = 0; i < 64; i++) + this.block[i] = 0; + + this.size = FINALIZED; + + return out; + } + + _transform(chunk, pos) { + const W = this.msg; + + let a = this.state[0]; + let b = this.state[1]; + let c = this.state[2]; + let d = this.state[3]; + let e = this.state[4]; + let f = this.state[5]; + let g = this.state[6]; + let h = this.state[7]; + let i = 0; + + for (; i < 16; i++) + W[i] = readU32(chunk, pos + i * 4); + + for (; i < 64; i++) + W[i] = sigma1(W[i - 2]) + W[i - 7] + sigma0(W[i - 15]) + W[i - 16]; + + for (i = 0; i < 64; i++) { + const t1 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; + const t2 = Sigma0(a) + Maj(a, b, c); + + h = g; + g = f; + f = e; + + e = (d + t1) >>> 0; + + d = c; + c = b; + b = a; + + a = (t1 + t2) >>> 0; + } + + this.state[0] += a; + this.state[1] += b; + this.state[2] += c; + this.state[3] += d; + this.state[4] += e; + this.state[5] += f; + this.state[6] += g; + this.state[7] += h; + } + + static hash() { + return new SHA256(); + } + + static hmac() { + return new HMAC(SHA256, 64); + } + + static digest(data) { + return SHA256.ctx.init().update(data).final(); + } + + static root(left, right) { + assert(bufferExports.Buffer.isBuffer(left) && left.length === 32); + assert(bufferExports.Buffer.isBuffer(right) && right.length === 32); + return SHA256.ctx.init().update(left).update(right).final(); + } + + static multi(x, y, z) { + const {ctx} = SHA256; + + ctx.init(); + ctx.update(x); + ctx.update(y); + + if (z) + ctx.update(z); + + return ctx.final(); + } + + static mac(data, key) { + return SHA256.hmac().init(key).update(data).final(); + } + } + + /* + * Static + */ + + SHA256.native = 0; + SHA256.id = 'SHA256'; + SHA256.size = 32; + SHA256.bits = 256; + SHA256.blockSize = 64; + SHA256.zero = bufferExports.Buffer.alloc(32, 0x00); + SHA256.ctx = new SHA256(); + + /* + * Helpers + */ + + function Sigma0(x) { + return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10); + } + + function Sigma1(x) { + return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7); + } + + function sigma0(x) { + return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3); + } + + function sigma1(x) { + return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10); + } + + function Ch(x, y, z) { + return z ^ (x & (y ^ z)); + } + + function Maj(x, y, z) { + return (x & y) | (z & (x | y)); + } + + function readU32(data, off) { + return (data[off++] * 0x1000000 + + data[off++] * 0x10000 + + data[off++] * 0x100 + + data[off]); + } + + function writeU32(data, num, off) { + data[off++] = num >>> 24; + data[off++] = num >>> 16; + data[off++] = num >>> 8; + data[off++] = num; + return off; + } + + /* + * Expose + */ + + sha256$1 = SHA256; + return sha256$1; } -function throwFault(fault, operation, value) { - const params = { fault: fault, operation: operation }; - if (value != null) { - params.value = value; - } - return logger$5.throwError(fault, Logger.errors.NUMERIC_FAULT, params); + +/*! + * sha256.js - sha256 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + +var sha256Browser; +var hasRequiredSha256Browser; + +function requireSha256Browser () { + if (hasRequiredSha256Browser) return sha256Browser; + hasRequiredSha256Browser = 1; + + sha256Browser = requireSha256(); + return sha256Browser; +} + +var batchRng; +var hasRequiredBatchRng; + +function requireBatchRng () { + if (hasRequiredBatchRng) return batchRng; + hasRequiredBatchRng = 1; + + const assert = requireAssert(); + const BN = requireBnBrowser(); + const ChaCha20 = requireChacha20Browser(); + const SHA256 = requireSha256Browser(); + + /** + * BatchRNG + */ + + class BatchRNG { + constructor(curve, encode = key => key) { + this.curve = curve; + this.encode = encode; + this.hash = new SHA256(); + this.chacha = new ChaCha20(); + this.key = bufferExports.Buffer.alloc(32, 0x00); + this.iv = bufferExports.Buffer.alloc(8, 0x00); + this.cache = [new BN(1), new BN(1)]; + } + + init(batch) { + assert(Array.isArray(batch)); + + this.hash.init(); + + for (const [msg, sig, key] of batch) { + this.hash.update(SHA256.digest(msg)); + this.hash.update(sig); + this.hash.update(this.encode(key)); + } + + this.key = this.hash.final(); + this.cache[0] = new BN(1); + this.cache[1] = new BN(1); + + return this; + } + + encrypt(counter) { + const size = this.curve.scalarSize * 2; + const data = bufferExports.Buffer.alloc(size, 0x00); + const left = data.slice(0, this.curve.scalarSize); + const right = data.slice(this.curve.scalarSize); + + this.chacha.init(this.key, this.iv, counter); + this.chacha.encrypt(data); + + return [ + this.curve.decodeScalar(left), + this.curve.decodeScalar(right) + ]; + } + + refresh(counter) { + let overflow = 0; + + for (;;) { + // First word is always zero. + this.iv[4] = overflow; + this.iv[5] = overflow >>> 8; + this.iv[6] = overflow >>> 16; + this.iv[7] = overflow >>> 24; + + overflow += 1; + + const [s1, s2] = this.encrypt(counter); + + if (s1.isZero() || s1.cmp(this.curve.n) >= 0) + continue; + + if (s2.isZero() || s2.cmp(this.curve.n) >= 0) + continue; + + this.cache[0] = s1; + this.cache[1] = s2; + + break; + } + } + + generate(index) { + assert((index >>> 0) === index); + + if (index & 1) + this.refresh(index >>> 1); + + return this.cache[index & 1]; + } + } + + /* + * Expose + */ + + batchRng = BatchRNG; + return batchRng; } -const logger$4 = new Logger("rlp/0.0.1"); -function arrayifyInteger$1(value) { - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function unarrayifyInteger$1(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; -} -function _encode$1(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode$1(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger$1(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - if (!isBytesLike(object)) { - logger$4.throwArgumentError("RLP object must be BytesLike", "object", object); - } - const data = Array.prototype.slice.call(arrayify(object)); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger$1(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); -} -function encode(object) { - return hexlify(_encode$1(object)); -} -function _decodeChildren$1(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode$1(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - if (childOffset > offset + 1 + length) { - logger$4.throwError("child data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - } - return { consumed: 1 + length, result: result }; -} -// returns { consumed: number, result: Object } -function _decode$1(data, offset) { - if (data.length === 0) { - logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - if (offset + 1 + lengthLength > data.length) { - logger$4.throwError("data short segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger$1(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger$4.throwError("data long segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren$1(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - if (offset + 1 + length > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren$1(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - if (offset + 1 + lengthLength > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger$1(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - if (offset + 1 + length > data.length) { - logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlify(data[offset]) }; -} -function decode$1(data) { - const bytes = arrayify(data); - const decoded = _decode$1(bytes, 0); - if (decoded.consumed !== bytes.length) { - logger$4.throwArgumentError("invalid rlp data", "data", data); - } - return decoded.result; -} +var elliptic = {}; + +var hasRequiredElliptic; + +function requireElliptic () { + if (hasRequiredElliptic) return elliptic; + hasRequiredElliptic = 1; + + const {custom} = requireCustomBrowser(); + const BN = requireBnBrowser(); + + /* + * Constants + */ + + const types = { + AFFINE: 0, + JACOBIAN: 1, + PROJECTIVE: 2, + EXTENDED: 3 + }; + + const jsfIndex = [ + -3, // -1 -1 + -1, // -1 0 + -5, // -1 1 + -7, // 0 -1 + 0, // 0 0 + 7, // 0 1 + 5, // 1 -1 + 1, // 1 0 + 3 // 1 1 + ]; + + let uid = 0; + + /** + * Curve + */ + + class Curve { + constructor(Point, type, conf) { + this.Point = null; + this.id = null; + this.uid = uid++; + this.ossl = null; + this.type = 'base'; + this.endian = 'be'; + this.hash = null; + this.prefix = null; + this.context = false; + this.prime = null; + this.p = null; + this.red = null; + this.fieldSize = 0; + this.fieldBits = 0; + this.adjustedSize = 0; + this.signBit = 0; + this.mask = 0; + this.n = null; + this.h = null; + this.q = null; + this.z = null; + this.g = null; + this.nh = null; + this.scalarSize = 0; + this.scalarBits = 0; + this.zero = null; + this.one = null; + this.two = null; + this.three = null; + this.four = null; + this.i2 = null; + this.i3 = null; + this.i4 = null; + this.i6 = null; + this.torsion = null; + this.endo = null; + this.hi = null; + this._init(Point, type, conf); + } + + _init(Point, type, conf) { + assert(typeof Point === 'function'); + assert(typeof type === 'string'); + assert(conf && typeof conf === 'object'); + assert(conf.red == null || (conf.red instanceof BN.Red)); + assert(conf.p != null, 'Must pass a prime.'); + assert(conf.id == null || typeof conf.id === 'string'); + assert(conf.ossl == null || typeof conf.ossl === 'string'); + assert(conf.endian == null || typeof conf.endian === 'string'); + assert(conf.hash == null || typeof conf.hash === 'string'); + assert(conf.prefix == null || typeof conf.prefix === 'string'); + assert(conf.context == null || typeof conf.context === 'boolean'); + assert(conf.prime == null || typeof conf.prime === 'string'); + assert(conf.torsion == null || Array.isArray(conf.torsion)); + + // Point class. + this.Point = Point; + + // Meta. + this.id = conf.id || null; + this.ossl = conf.ossl || null; + this.type = type; + this.endian = conf.endian || (type === 'short' ? 'be' : 'le'); + this.hash = conf.hash || null; + this.prefix = conf.prefix ? bufferExports.Buffer.from(conf.prefix, 'binary') : null; + this.context = conf.context || false; + this.prime = conf.prime || null; + + // Prime. + this.p = BN.fromJSON(conf.p); + + // Reduction. + if (conf.red) { + this.red = conf.red; + } else { + // Use Montgomery when there is no fast reduction for the prime. + this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); + this.red.precompute(); + } + + // Precalculate encoding length. + this.fieldSize = this.p.byteLength(); + this.fieldBits = this.p.bitLength(); + this.adjustedSize = this.fieldSize + ((this.fieldBits & 7) === 0); + this.signBit = this.adjustedSize * 8 - 1; + this.mask = 0xff; + + if ((this.fieldBits & 7) !== 0) + this.mask = (1 << (this.fieldBits & 7)) - 1; + + // Curve configuration, optional. + this.n = BN.fromJSON(conf.n || '0'); + this.h = BN.fromJSON(conf.h || '1'); + this.q = this.n.mul(this.h); + this.z = BN.fromJSON(conf.z || '0').toRed(this.red); + this.g = null; + this.nh = this.n.ushrn(1); + this.scalarSize = this.n.byteLength(); + this.scalarBits = this.n.bitLength(); + + // Useful for many curves. + this.zero = new BN(0).toRed(this.red); + this.one = new BN(1).toRed(this.red); + this.two = new BN(2).toRed(this.red); + this.three = new BN(3).toRed(this.red); + this.four = new BN(4).toRed(this.red); + + // Inverses. + this.i2 = this.two.redInvert(); + this.i3 = this.three.redInvert(); + this.i4 = this.i2.redSqr(); + this.i6 = this.i2.redMul(this.i3); + + // Torsion. + this.torsion = new Array(this.h.word(0)); + + for (let i = 0; i < this.torsion.length; i++) + this.torsion[i] = this.point(); + + // Endomorphism. + this.endo = null; + + // Cache. + this.hi = null; + + // Memoize. + this._scale = memoize(this._scale, this); + this.isIsomorphic = memoize(this.isIsomorphic, this); + this.isIsogenous = memoize(this.isIsogenous, this); + + // Sanity checks. + assert(this.p.sign() > 0 && this.p.isOdd()); + assert(this.n.sign() >= 0); + assert(this.h.sign() > 0 && this.h.cmpn(255) <= 0); + assert(this.endian === 'be' || this.endian === 'le'); + + return this; + } + + _finalize(conf) { + assert(conf && typeof conf === 'object'); + + // Create base point. + this.g = conf.g ? this.pointFromJSON(conf.g) : this.point(); + + // Parse small order points. + if (conf.torsion) { + assert(conf.torsion.length === this.torsion.length); + + for (let i = 0; i < this.torsion.length; i++) + this.torsion[i] = this.pointFromJSON(conf.torsion[i]); + } + + return this; + } + + _findTorsion() { + // Find all torsion points by grinding. + assert(!this.n.isZero()); + + const h = this.h.word(0); + const x = this.one.redNeg(); + const out = [this.point()]; + const set = new Set(); + + let len = h; + + while (out.length < len) { + let p; + + x.redIAdd(this.one); + + try { + p = this.pointFromX(x.clone()); + } catch (e) { + continue; + } + + try { + p = p.mul(this.n); + } catch (e) { + len = 2; + continue; + } + + if (p.isInfinity()) + continue; + + p.normalize(); + + for (const point of [p, p.neg()]) { + const key = point.key(); + + if (!set.has(key)) { + out.push(point); + set.add(key); + } + } + } + + out.sort((a, b) => a.cmp(b)); + + while (out.length < h) + out.push(this.point()); + + return out; + } + + _fixedMul(p, k) { + // Fixed-base method for point multiplication. + // + // [ECPM] "Windowed method". + // [GECC] Page 95, Section 3.3. + // + // Windows are appropriately shifted to avoid any + // doublings. This reduces a 256 bit multiplication + // down to 64 additions with a window size of 4. + assert(p instanceof Point); + assert(k instanceof BN); + assert(p.pre && p.pre.windows); + + // Get precomputed windows. + const {width, points} = p._getWindows(0, 0); + + // Recompute window size. + const size = 1 << width; + + // Recompute steps. + const bits = k.bitLength(); + const steps = ((bits + width - 1) / width) >>> 0; + + // Multiply. + let acc = this.jpoint(); + + for (let i = 0; i < steps; i++) { + const bits = k.bits(i * width, width); + + acc = acc.add(points[i * size + bits]); + } + + // Adjust sign. + if (k.isNeg()) + acc = acc.neg(); + + return acc; + } + + _fixedNafMul(p, k) { + // Fixed-base NAF windowing method for point multiplication. + // + // [GECC] Algorithm 3.42, Page 105, Section 3.3. + assert(p instanceof Point); + assert(k instanceof BN); + assert(p.pre && p.pre.doubles); + + // Get precomputed doubles. + const {step, points} = p._getDoubles(0, 0); + + // Get fixed NAF (in a more windowed form). + const naf = getFixedNAF(k, 2, k.bitLength() + 1, step); + + // Compute steps. + const I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3; + + // Multiply. + let a = this.jpoint(); + let b = this.jpoint(); + + for (let i = I; i > 0; i--) { + for (let j = 0; j < naf.length; j++) { + const nafW = naf[j]; + + if (nafW === i) + b = b.add(points[j]); + else if (nafW === -i) + b = b.sub(points[j]); + } + + a = a.add(b); + } + + return a; + } + + _wnafMul(w, p, k) { + // Window NAF method for point multiplication. + // + // [GECC] Algorithm 3.36, Page 100, Section 3.3. + assert(p instanceof Point); + assert(k instanceof BN); + + // Precompute window. + const {width, points} = p._safeNAF(w); + + // Get NAF form. + const naf = getNAF(k, width, k.bitLength() + 1); + + // Add `this`*(N+1) for every w-NAF index. + let acc = this.jpoint(); + + for (let i = naf.length - 1; i >= 0; i--) { + const z = naf[i]; + + if (i !== naf.length - 1) + acc = acc.dbl(); + + if (z > 0) + acc = acc.add(points[(z - 1) >> 1]); + else if (z < 0) + acc = acc.sub(points[(-z - 1) >> 1]); + } + + return acc; + } + + _wnafMulAdd(w, points, coeffs) { + // Multiple point multiplication, also known + // as "Shamir's trick" (with interleaved NAFs). + // + // [GECC] Algorithm 3.48, Page 109, Section 3.3.3. + // Algorithm 3.51, Page 112, Section 3.3. + // + // This is particularly useful for signature + // verifications and mutiplications after an + // endomorphism split. + assert((w >>> 0) === w); + assert(Array.isArray(points)); + assert(Array.isArray(coeffs)); + assert(points.length === coeffs.length); + + const length = points.length; + const wnd = new Array(length); + const naf = new Array(length); + + // Check arrays and calculate size. + let max = 0; + + for (let i = 0; i < length; i++) { + const point = points[i]; + const coeff = coeffs[i]; + + assert(point instanceof Point); + assert(coeff instanceof BN); + + if (i > 0 && point.type !== points[i - 1].type) + throw new Error('Cannot mix points.'); + + // Avoid sparse arrays. + wnd[i] = null; + naf[i] = null; + + // Compute max scalar size. + max = Math.max(max, coeff.bitLength() + 1); + } + + // Compute NAFs. + let ppoint = null; + let pcoeff = null; + let len = 0; + + for (let i = 0; i < length; i++) { + const point = points[i]; + const coeff = coeffs[i]; + const pre = point._getNAF(0); + + // Use precomputation if available. + if (pre) { + wnd[len] = pre.points; + naf[len] = getNAF(coeff, pre.width, max); + len += 1; + continue; + } + + // Save last non-precomputed point. + if (!ppoint) { + ppoint = point; + pcoeff = coeff; + continue; + } + + // Compute JSF in NAF form. + wnd[len] = ppoint._getJNAF(point); + naf[len] = getJNAF(pcoeff, coeff, max); + + ppoint = null; + pcoeff = null; + + len += 1; + } + + // Regular NAF for odd points. + if (ppoint) { + const nafw = ppoint._safeNAF(w); + + wnd[len] = nafw.points; + naf[len] = getNAF(pcoeff, nafw.width, max); + + len += 1; + } + + // Multiply and add. + let acc = this.jpoint(); + + for (let i = max - 1; i >= 0; i--) { + if (i !== max - 1) + acc = acc.dbl(); + + for (let j = 0; j < len; j++) { + const z = naf[j][i]; + + if (z > 0) + acc = acc.add(wnd[j][(z - 1) >> 1]); + else if (z < 0) + acc = acc.sub(wnd[j][(-z - 1) >> 1]); + } + } + + return acc; + } + + _endoWnafMulAdd(points, coeffs) { + throw new Error('Not implemented.'); + } + + _scale(curve, invert) { + assert(curve instanceof Curve); + assert(curve.p.eq(this.p)); + + switch (curve.type) { + case 'short': + return this._scaleShort(curve, invert); + case 'mont': + return this._scaleMont(curve, invert); + case 'edwards': + return this._scaleEdwards(curve, invert); + default: + throw new Error('Not implemented.'); + } + } + + _scaleShort(curve, invert) { + throw new Error('Not implemented.'); + } + + _scaleMont(curve, invert) { + throw new Error('Not implemented.'); + } + + _scaleEdwards(curve, invert) { + throw new Error('Not implemented.'); + } + + isElliptic() { + throw new Error('Not implemented.'); + } + + jinv() { + throw new Error('Not implemented.'); + } + + isComplete() { + return false; + } + + precompute(rng) { + assert(!this.g.isInfinity(), 'Must have base point.'); + assert(!this.n.isZero(), 'Must have order.'); + + this.g.precompute(this.n.bitLength(), rng); + + return this; + } + + scalar(num, base, endian) { + const k = new BN(num, base, endian); + + assert(!k.red); + + if (this.n.isZero()) + return k; + + return k.imod(this.n); + } + + field(num, base, endian) { + const x = BN.cast(num, base, endian); + + if (x.red) + return x.forceRed(this.red); + + return x.toRed(this.red); + } + + point(x, y) { + throw new Error('Not implemented.'); + } + + jpoint(x, y, z) { + throw new Error('Not implemented.'); + } + + xpoint(x, z) { + throw new Error('Not implemented.'); + } + + cpoint(xx, xz, yy, yz) { + assert(xx instanceof BN); + assert(xz instanceof BN); + assert(yy instanceof BN); + assert(yz instanceof BN); + + if (xz.isZero() || yz.isZero()) + return this.point(); + + const z = xz.redMul(yz).redInvert(); + const x = xx.redMul(yz).redMul(z); + const y = yy.redMul(xz).redMul(z); + + return this.point(x, y); + } + + solveX2(y) { + throw new Error('Not implemented.'); + } + + solveX(y) { + return this.solveX2(y).redSqrt(); + } + + solveY2(x) { + throw new Error('Not implemented.'); + } + + solveY(x) { + return this.solveY2(x).redSqrt(); + } + + validate(point) { + throw new Error('Not implemented.'); + } + + pointFromX(x, sign) { + throw new Error('Not implemented.'); + } + + pointFromY(y, sign) { + throw new Error('Not implemented.'); + } + + isIsomorphic(curve) { + throw new Error('Not implemented.'); + } + + isIsogenous(curve) { + throw new Error('Not implemented.'); + } + + pointFromShort(point) { + throw new Error('Not implemented.'); + } + + pointFromMont(point, sign) { + throw new Error('Not implemented.'); + } + + pointFromEdwards(point) { + throw new Error('Not implemented.'); + } + + pointFromUniform(u) { + throw new Error('Not implemented.'); + } + + pointToUniform(p) { + throw new Error('Not implemented.'); + } + + pointFromHash(bytes, pake = false) { + // [H2EC] "Roadmap". + assert(bufferExports.Buffer.isBuffer(bytes)); + assert(typeof pake === 'boolean'); + + if (bytes.length !== this.fieldSize * 2) + throw new Error('Invalid hash size.'); + + // Random oracle encoding. + // Ensure a proper distribution. + const s1 = bytes.slice(0, this.fieldSize); + const s2 = bytes.slice(this.fieldSize); + const u1 = this.decodeUniform(s1); + const u2 = this.decodeUniform(s2); + const p1 = this.pointFromUniform(u1); + const p2 = this.pointFromUniform(u2); + const p3 = p1.add(p2); + + return pake ? p3.mulH() : p3; + } + + pointToHash(p, subgroup, rng) { + // [SQUARED] Algorithm 1, Page 8, Section 3.3. + assert(p instanceof this.Point); + assert((subgroup >>> 0) === subgroup); + + // Add a random torsion component. + const i = subgroup % this.torsion.length; + const p0 = p.add(this.torsion[i]); + + // Average Cost (R = sqrt): + // + // SSWU (~4 iterations) => 8I + 16R + // SVDW (~4 iterations) => 12I + 28R + // Elligator 1 (~2 iterations) => 6I + 10R + // Elligator 2 (~2 iterations) => 4I + 6R + // Ristretto (~1 iteration) => 1I + 2R + h*1R + for (;;) { + const u1 = this.randomField(rng); + const p1 = this.pointFromUniform(u1); + + // Avoid 2-torsion points: + // Short Weierstrass: ((A / 3) / B, 0) + // Montgomery: (0, 0) + // Twisted Edwards: (0, -1) + if (p1.neg().eq(p1)) + continue; + + const p2 = p0.sub(p1); + const hint = randomInt(rng); + + let u2; + try { + u2 = this.pointToUniform(p2, hint & 15); + } catch (e) { + if (e.message === 'Invalid point.') + continue; + throw e; + } + + const s1 = this.encodeUniform(u1, hint >>> 8); + const s2 = this.encodeUniform(u2, hint >>> 16); + + return bufferExports.Buffer.concat([s1, s2]); + } + } + + randomScalar(rng) { + const max = this.n.isZero() ? this.p : this.n; + return BN.random(rng, 1, max); + } + + randomField(rng) { + return BN.random(rng, 1, this.p).toRed(this.red); + } + + randomPoint(rng) { + let p; + + for (;;) { + const x = this.randomField(rng); + const sign = (randomInt(rng) & 1) !== 0; + + try { + p = this.pointFromX(x, sign); + } catch (e) { + continue; + } + + assert(p.validate()); + + return p.mulH(); + } + } + + mulAll(points, coeffs) { + return this.jmulAll(points, coeffs); + } + + jmulAll(points, coeffs) { + assert(Array.isArray(points)); + assert(points.length === 0 || (points[0] instanceof Point)); + + // Multiply with endomorphism if we're using affine points. + if (this.endo && points.length > 0 && points[0].type === types.AFFINE) + return this._endoWnafMulAdd(points, coeffs); + + // Otherwise, a regular Shamir's trick. + return this._wnafMulAdd(5, points, coeffs); + } + + mulH(k) { + assert(k instanceof BN); + return this.imulH(k.clone()); + } + + imulH(k) { + assert(k instanceof BN); + assert(!k.red); + + const word = this.h.word(0); + + // Optimize for powers of two. + if ((word & (word - 1)) === 0) { + const bits = this.h.bitLength(); + return k.iushln(bits - 1).imod(this.n); + } + + return k.imuln(word).imod(this.n); + } + + normalizeAll(points) { + assert(Array.isArray(points)); + + const len = points.length; + const z = new Array(len); + + for (let i = 0; i < len; i++) { + const p = points[i]; + + assert(p instanceof Point); + assert(p.curve === this); + + if (p.type === types.AFFINE) { + z[i] = this.one; + continue; + } + + z[i] = p.z; + } + + const zi = this.red.invertAll(z); + const out = new Array(len); + + for (let i = 0; i < len; i++) + out[i] = points[i].scale(zi[i]); + + return out; + } + + affinizeAll(points) { + return this.normalizeAll(points); + } + + clamp(scalar) { + // [RFC7748] Page 8, Section 5. + // [RFC8032] Section 5.1.5 & 5.2.5. + assert(bufferExports.Buffer.isBuffer(scalar)); + assert(scalar.length === this.scalarSize); + assert(this.scalarSize <= this.fieldSize); + + let top = (this.fieldBits & 7) || 8; + let lsb = 0; + let msb = this.scalarSize - 1; + + // Swap endianness. + if (this.endian === 'be') + [lsb, msb] = [msb, lsb]; + + // Adjust for low order. + if (this.scalarSize < this.fieldSize) + top = 8; + + // Ensure a multiple of the cofactor. + scalar[lsb] &= -this.h.word(0) & 0xff; + + // Clamp to the prime. + scalar[msb] &= (1 << top) - 1; + + // Set the high bit. + scalar[msb] |= 1 << (top - 1); + + return scalar; + } + + splitHash(bytes) { + // [RFC8032] Section 5.1.6 & 5.2.6. + assert(bufferExports.Buffer.isBuffer(bytes)); + assert(bytes.length === this.adjustedSize * 2); + assert(this.scalarSize <= this.adjustedSize); + + let off = 0; + + if (this.endian === 'be') + off = this.adjustedSize - this.scalarSize; + + const scalar = bytes.slice(off, off + this.scalarSize); + const prefix = bytes.slice(this.adjustedSize); + + this.clamp(scalar); + + return [scalar, prefix]; + } + + encodeField(x) { + // [SEC1] Page 12, Section 2.3.5. + assert(x instanceof BN); + assert(!x.red); + + return x.encode(this.endian, this.fieldSize); + } + + decodeField(bytes) { + // [SEC1] Page 13, Section 2.3.6. + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.fieldSize) + throw new Error('Invalid field element size.'); + + return BN.decode(bytes, this.endian); + } + + encodeAdjusted(x) { + assert(x instanceof BN); + assert(!x.red); + + return x.encode(this.endian, this.adjustedSize); + } + + decodeAdjusted(bytes) { + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.adjustedSize) + throw new Error('Invalid field element size.'); + + return BN.decode(bytes, this.endian); + } + + encodeScalar(k) { + // [SEC1] Page 13, Section 2.3.7. + assert(k instanceof BN); + assert(!k.red); + + return k.encode(this.endian, this.scalarSize); + } + + decodeScalar(bytes) { + // [SEC1] Page 14, Section 2.3.8. + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.scalarSize) + throw new Error('Invalid scalar size.'); + + return BN.decode(bytes, this.endian); + } + + encodeClamped(k) { + // [RFC7748] Page 8, Section 5. + // [RFC8032] Section 5.1.5 & 5.2.5. + return this.clamp(this.encodeScalar(k)); + } + + decodeClamped(bytes) { + // [RFC7748] Page 8, Section 5. + // [RFC8032] Section 5.1.5 & 5.2.5. + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.scalarSize) + throw new Error('Invalid scalar size.'); + + const clamped = this.clamp(bufferExports.Buffer.from(bytes)); + + return BN.decode(clamped, this.endian); + } + + encodeUniform(x, bits) { + assert(x instanceof BN); + assert((bits >>> 0) === bits); + + const msb = this.endian === 'le' ? this.fieldSize - 1 : 0; + const bytes = x.fromRed().encode(this.endian, this.fieldSize); + + bytes[msb] |= (bits & ~this.mask) & 0xff; + + return bytes; + } + + decodeUniform(bytes) { + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.fieldSize) + throw new Error('Invalid field size.'); + + const x = BN.decode(bytes, this.endian); + + x.iumaskn(this.fieldBits); + + return x.toRed(this.red); + } + + encodePoint(point, compact) { + assert(point instanceof Point); + return point.encode(compact); + } + + decodePoint(bytes) { + throw new Error('Not implemented.'); + } + + encodeX(point) { + throw new Error('Not implemented.'); + } + + decodeX(bytes) { + throw new Error('Not implemented.'); + } + + decodeEven(bytes) { + throw new Error('Not implemented.'); + } + + decodeSquare(bytes) { + throw new Error('Not implemented.'); + } + + toShort() { + throw new Error('Not implemented.'); + } + + toMont(b0) { + throw new Error('Not implemented.'); + } + + toEdwards(a0) { + throw new Error('Not implemented.'); + } + + pointToJSON(point, pre) { + assert(point instanceof Point); + return point.toJSON(pre); + } + + pointFromJSON(json) { + throw new Error('Not implemented.'); + } + + toJSON(pre) { + let prefix, context; + let n, z, endo; + + if (this.type === 'edwards') { + prefix = this.prefix ? this.prefix.toString() : null; + context = this.context; + } + + if (!this.n.isZero()) + n = this.n.toJSON(); + + if (!this.z.isZero()) { + z = this.z.fromRed(); + + if (this.z.redIsHigh()) + z.isub(this.p); + + z = z.toString(16); + } + + if (this.endo) + endo = this.endo.toJSON(); + + return { + id: this.id, + ossl: this.ossl, + type: this.type, + endian: this.endian, + hash: this.hash, + prefix, + context, + prime: this.prime, + p: this.p.toJSON(), + a: undefined, + b: undefined, + d: undefined, + n, + h: this.h.toString(16), + s: undefined, + z, + c: undefined, + g: this.g.toJSON(pre), + endo + }; + } + + static fromJSON(json) { + return new this(json); + } + } + + /** + * Point + */ + + class Point { + constructor(curve, type) { + assert(curve instanceof Curve); + assert((type >>> 0) === type); + + this.curve = curve; + this.type = type; + this.pre = null; + } + + _init() { + throw new Error('Not implemented.'); + } + + _safeNAF(width) { + assert((width >>> 0) === width); + + if (this.pre && this.pre.naf) + return this.pre.naf; + + if (width === 0) + return null; + + const size = 1 << (width - 2); + const points = new Array(size); + const p = this.toJ(); + const dbl = size === 1 ? null : p.dbl(); + + points[0] = p; + + for (let i = 1; i < size; i++) + points[i] = points[i - 1].add(dbl); + + return new NAF(width, points); + } + + _getNAF(width) { + assert((width >>> 0) === width); + + if (this.pre && this.pre.naf) + return this.pre.naf; + + if (width === 0) + return null; + + const odds = this._safeNAF(width).points; + const points = this.curve.affinizeAll(odds); + + return new NAF(width, points); + } + + _getWindows(width, bits) { + assert((width >>> 0) === width); + assert((bits >>> 0) === bits); + + if (this.pre && this.pre.windows) + return this.pre.windows; + + if (width === 0) + return null; + + const size = 1 << width; + const steps = ((bits + width - 1) / width) >>> 0; + const wnds = new Array(steps * size); + + let g = this.toJ(); + + for (let i = 0; i < steps; i++) { + wnds[i * size] = this.curve.jpoint(); + + for (let j = 1; j < size; j++) + wnds[i * size + j] = wnds[i * size + j - 1].add(g); + + g = g.dblp(width); + } + + const points = this.curve.affinizeAll(wnds); + + return new Windows(width, bits, points); + } + + _getDoubles(step, power) { + assert((step >>> 0) === step); + assert((power >>> 0) === power); + + if (this.pre && this.pre.doubles) + return this.pre.doubles; + + if (step === 0) + return null; + + const len = Math.ceil(power / step) + 1; + const dbls = new Array(len); + + let acc = this.toJ(); + let k = 0; + + dbls[k++] = acc; + + for (let i = 0; i < power; i += step) { + for (let j = 0; j < step; j++) + acc = acc.dbl(); + + dbls[k++] = acc; + } + + assert(k === len); + + const points = this.curve.affinizeAll(dbls); + + return new Doubles(step, points); + } + + _getBeta() { + return null; + } + + _getBlinding(rng) { + if (this.pre && this.pre.blinding) + return this.pre.blinding; + + if (!rng) + return null; + + if (this.curve.n.isZero()) + return null; + + // Pregenerate a random blinding value: + // + // blind = random integer in [1,n-1] + // unblind = G * blind + // + // We intend to subtract the blinding value + // from scalars before multiplication. We + // can add the unblinding point once the + // multiplication is complete. + const blind = this.curve.randomScalar(rng); + const unblind = this.mul(blind); + + return new Blinding(blind, unblind); + } + + _hasWindows(k) { + assert(k instanceof BN); + + if (!this.pre || !this.pre.windows) + return false; + + const {width, bits} = this.pre.windows; + const steps = ((bits + width - 1) / width) >>> 0; + + return k.bitLength() <= steps * width; + } + + _hasDoubles(k) { + assert(k instanceof BN); + + if (!this.pre || !this.pre.doubles) + return false; + + const {step, points} = this.pre.doubles; + const power = k.bitLength() + 1; + + return points.length >= Math.ceil(power / step) + 1; + } + + _getJNAF(point) { + assert(point instanceof Point); + assert(point.type === this.type); + + // Create comb for JSF. + return [ + this, // 1 + this.add(point), // 3 + this.sub(point), // 5 + point // 7 + ]; + } + + _blind(k, rng) { + // [SIDE1] Page 5, Section 4. + // [BLIND] Page 20, Section 7. + assert(k instanceof BN); + assert(!k.red); + + // Scalar splitting (requires precomputation). + // + // Blind a multiplication by first subtracting + // a blinding value from the scalar. Example: + // + // b = random integer in [1,n-1] + // B = P * b (precomputed) + // Q = P * (k - b) + B + // + // Note that Joye describes a different method + // (multiplier randomization) which computes: + // + // B = random point in E + // Q = (P + B) * k - B * k + // + // Our method is more similar to the "scalar + // splitting" technique described in the + // second source above. + // + // The blinding value and its corresponding + // point are randomly generated and computed + // on boot. As long as an attacker is not + // able to observe the boot, this should give + // a decent bit of protection against various + // channel attacks. + if (this.pre && this.pre.blinding) { + const {blind, unblind} = this.pre.blinding; + const t = k.sub(blind); + + return [this, t, unblind]; + } + + // Randomization is not possible without + // an RNG. Do a normal multiplication. + if (!rng) + return [this, k, null]; + + // If we have no precomputed blinding + // factor, there are two possibilities + // for randomization: + // + // 1. Randomize the multiplier by adding + // a random multiple of `n`. + // + // 2. Re-scale the point itself by a + // random factor. + // + // The first option can be accomplished + // with some like: + // + // a = random integer in [1,n-1] + // r = a * n + // Q = P * (k + r) + // + // The second is accomplished with: + // + // a = random element in F(p) + // R = (x * a^2, y * a^3, z * a) + // Q = R * k + // + // If we have precomputed doubles / naf + // points, we opt for the first method + // to avoid randomizing everything. + if (this.pre) { + if (this.curve.n.isZero()) + return [this, k, null]; + + const a = this.curve.randomScalar(rng); + const r = a.mul(this.curve.n); + const t = r.iadd(k); + + return [this, t, null]; + } + + // If there is no precomputation _at all_, + // we opt for the second method. + const p = this.randomize(rng); + + return [p, k, null]; + } + + clone() { + throw new Error('Not implemented.'); + } + + precompute(bits, rng) { + assert((bits >>> 0) === bits); + + if (!this.pre) + this.pre = new Precomp(); + + if (!this.pre.naf) + this.pre.naf = this._getNAF(9); + + if (!this.pre.doubles) + this.pre.doubles = this._getDoubles(4, bits + 1); + + if (!this.pre.beta) + this.pre.beta = this._getBeta(); + + if (!this.pre.blinding) + this.pre.blinding = this._getBlinding(rng); + + return this; + } + + validate() { + return this.curve.validate(this); + } + + normalize() { + return this; + } + + scale(a) { + throw new Error('Not implemented.'); + } + + randomize(rng) { + const z = this.curve.randomField(rng); + return this.scale(z); + } + + neg() { + throw new Error('Not implemented.'); + } + + add(point) { + throw new Error('Not implemented.'); + } + + sub(point) { + assert(point instanceof Point); + return this.add(point.neg()); + } + + dbl() { + throw new Error('Not implemented.'); + } + + dblp(pow) { + // Repeated doubling. This can + // be optimized by child classes. + assert((pow >>> 0) === pow); + + let r = this; + + for (let i = 0; i < pow; i++) + r = r.dbl(); + + return r; + } + + diffAddDbl(p, q) { + throw new Error('Not implemented.'); + } + + getX() { + throw new Error('Not implemented.'); + } + + getY() { + throw new Error('Not implemented.'); + } + + eq(point) { + throw new Error('Not implemented.'); + } + + cmp(point) { + throw new Error('Not implemented.'); + } + + isInfinity() { + throw new Error('Not implemented.'); + } + + isOrder2() { + throw new Error('Not implemented.'); + } + + isOdd() { + throw new Error('Not implemented.'); + } + + isEven() { + throw new Error('Not implemented.'); + } + + isSquare() { + throw new Error('Not implemented.'); + } + + eqX(x) { + throw new Error('Not implemented.'); + } + + eqR(x) { + throw new Error('Not implemented.'); + } + + isSmall() { + // Test whether the point is of small order. + if (this.isInfinity()) + return false; + + // P * h = O + return this.jmulH().isInfinity(); + } + + hasTorsion() { + // Test whether the point is in another subgroup. + if (this.isInfinity()) + return false; + + // P * n != O + return !this.jmul(this.curve.n).isInfinity(); + } + + order() { + // Calculate point order. + const {h, n} = this.curve; + + let p = this.toJ(); + let q = new BN(1); + + while (!p.isInfinity()) { + q.iaddn(1); + + if (q.cmp(h) > 0) { + q = n.clone(); + break; + } + + p = p.add(this); + } + + return q; + } + + mul(k) { + return this.jmul(k); + } + + muln(k) { + return this.jmuln(k); + } + + mulBlind(k, rng) { + return this.jmulBlind(k, rng); + } + + mulAdd(k1, p2, k2) { + return this.jmulAdd(k1, p2, k2); + } + + mulH() { + return this.jmulH(); + } + + div(k) { + return this.jdiv(k); + } + + divn(k) { + return this.jdivn(k); + } + + divH() { + return this.jdivH(); + } + + jmul(k) { + + if (this._hasDoubles(k)) + return this.curve._fixedNafMul(this, k); + + if (this.curve.endo && this.type === types.AFFINE) + return this.curve._endoWnafMulAdd([this], [k]); + + return this.curve._wnafMul(5, this, k); + } + + jmuln(k) { + assert((k | 0) === k); + return this.jmul(new BN(k)); + } + + jmulBlind(k, rng = null) { + const [p, t, unblind] = this._blind(k, rng); + const q = p.jmul(t); + + if (unblind) + return q.add(unblind); + + return q; + } + + jmulAdd(k1, p2, k2) { + if (this.curve.endo && this.type === types.AFFINE) + return this.curve._endoWnafMulAdd([this, p2], [k1, k2]); + + return this.curve._wnafMulAdd(5, [this, p2], [k1, k2]); + } + + jmulH() { + const word = this.curve.h.word(0); + + // Optimize for powers of two. + if ((word & (word - 1)) === 0) { + const bits = this.curve.h.bitLength(); + return this.toJ().dblp(bits - 1); + } + + return this.jmul(this.curve.h); + } + + jdiv(k) { + assert(k instanceof BN); + assert(!k.red); + + return this.jmul(k.invert(this.curve.n)); + } + + jdivn(k) { + assert(!this.curve.n.isZero()); + + if (this.curve.h.cmpn(k) === 0) + return this.jdivH(); + + return this.jdiv(new BN(k)); + } + + jdivH() { + if (this.curve.n.isZero()) + return this.toJ(); + + if (this.curve.h.cmpn(1) === 0) + return this.toJ(); + + if (this.curve.hi === null) + this.curve.hi = this.curve.h.invert(this.curve.n); + + return this.jmul(this.curve.hi); + } + + toP() { + return this.normalize(); + } + + toJ() { + return this; + } + + toX() { + return this; + } + + key() { + if (this.isInfinity()) + return `${this.curve.uid}:oo`; + + this.normalize(); + + const x = this.getX().toString(16); + const y = this.getY().toString(16); + + return `${this.curve.uid}:${x},${y}`; + } + + encode(compact) { + throw new Error('Not implemented.'); + } + + static decode(curve, bytes) { + throw new Error('Not implemented.'); + } + + encodeX() { + throw new Error('Not implemented.'); + } + + static decodeX(curve, bytes) { + throw new Error('Not implemented.'); + } + + static decodeEven(curve, bytes) { + throw new Error('Not implemented.'); + } + + static decodeSquare(curve, bytes) { + throw new Error('Not implemented.'); + } + + toJSON(pre) { + throw new Error('Not implemented.'); + } + + static fromJSON(curve, json) { + throw new Error('Not implemented.'); + } + + [custom]() { + return ''; + } + } + + /** + * ShortCurve + */ + + class ShortCurve extends Curve { + constructor(conf) { + super(ShortPoint, 'short', conf); + + this.a = BN.fromJSON(conf.a).toRed(this.red); + this.b = BN.fromJSON(conf.b).toRed(this.red); + this.c = BN.fromJSON(conf.c || '0').toRed(this.red); + this.ai = this.a.isZero() ? this.zero : this.a.redInvert(); + this.zi = this.z.isZero() ? this.zero : this.z.redInvert(); + + this.zeroA = this.a.isZero(); + this.threeA = this.a.eq(this.three.redNeg()); + this.redN = this.n.toRed(this.red); + this.pmodn = this.p.clone(); + this.highOrder = this.n.cmp(this.p) >= 0; + this.smallGap = false; + + this._finalize(conf); + } + + _finalize(conf) { + super._finalize(conf); + + // Precalculate endomorphism. + if (conf.endo != null) + this.endo = Endo.fromJSON(this, conf.endo); + else + this.endo = this._getEndomorphism(); + + if (!this.n.isZero()) { + this.pmodn = this.p.mod(this.n); + + // Check for Maxwell's trick (see eqR). + this.smallGap = this.p.div(this.n).cmpn(1) <= 0; + } + + return this; + } + + static _isomorphism(curveA, curveB, custom, odd) { + // Short Weierstrass Isomorphism. + // + // [GECC] Page 84, Section 3.1.5. + // [ARITH1] Page 274, Section 13.1.5. + // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves). + // + // Find `u` such that `a * u^4 = a'` and `b * u^6 = b'`. + // + // Transformation: + // + // u4 = a' / a + // u2 = +-sqrt(u4) + // u6 = u4 * u2 + // a' = a * u4 + // b' = b * u6 + // + // Where `u2` is any root that is square. + // + // If a = 0, we can do: + // + // a' = 0 + // b' = b' + // + // Where (b' / b)^(1 / 3) is square. + // + // If b = 0, we can do: + // + // a' = a' + // b' = 0 + // + // Where sqrt(a' / a) is square. + assert(curveA instanceof BN); + assert(curveB instanceof BN); + assert(custom instanceof BN); + assert(odd == null || typeof odd === 'boolean'); + assert(!curveA.isZero() || !curveB.isZero()); + + if (custom.isZero()) + throw new Error('Invalid coefficient.'); + + if (curveA.isZero()) { + const customB = custom; + const u6 = customB.redDiv(curveB); + // Todo: allow index flag. + const u2 = uncube(u6); + + // Already checked in uncube(). + assert(u2.redJacobi() === 1); + + return [curveA.clone(), customB.clone()]; + } + + if (curveB.isZero()) { + const customA = custom; + const u4 = customA.redDiv(curveA); + const u2 = u4.redSqrt(); + + // Todo: allow odd flag. + if (u2.redJacobi() !== 1) + u2.redINeg(); + + if (u2.redJacobi() !== 1) + throw new Error('Invalid `a` coefficient.'); + + return [customA.clone(), curveB.clone()]; + } + + const customA = custom; + const u4 = customA.redDiv(curveA); + const u2 = u4.redSqrt(); + + if (odd != null) { + if (u2.redIsOdd() !== odd) + u2.redINeg(); + } else { + if (u2.redJacobi() !== 1) + u2.redINeg(); + } + + if (u2.redJacobi() !== 1) + throw new Error('Invalid `a` coefficient.'); + + const u6 = u4.redMul(u2); + const a = curveA.redMul(u4); + const b = curveB.redMul(u6); + + assert(a.eq(customA)); + + return [a, b]; + } + + _short(a0, odd) { + return ShortCurve._isomorphism(this.a, this.b, a0, odd); + } + + _mont(b0, odd) { + // Short Weierstrass->Montgomery Equivalence. + // + // [ARITH1] Page 286, Section 13.2.3.c. + // [SAFE] "Ladders". + // + // Transformation: + // + // r = A / (3 * B) + // s = +-sqrt(3 * r^2 + a) + // A = 3 * r / s + // B = 1 / s + const [r, s] = this._findRS(odd); + const b = s.redInvert(); + const a = r.redMuln(3).redMul(b); + + if (b0 != null) + return MontCurve._isomorphism(a, b, b0); + + return [a, b]; + } + + _edwards(a0, odd) { + // Short Weierstrass->Twisted Edwards Equivalence. + // + // [TWISTEQ] Section 1. + // + // Transformation: + // + // r = (a' + d') / 6 + // s = +-sqrt(3 * r^2 + a) + // a' = 3 * r + 2 * s + // d' = 3 * r - 2 * s + const [r, s] = this._findRS(odd); + const r3 = r.redMuln(3); + const s2 = s.redMuln(2); + const a = r3.redAdd(s2); + const d = r3.redSub(s2); + + if (a0 != null) + return EdwardsCurve._isomorphism(a, d, a0); + + return [a, d]; + } + + _findRS(sign) { + // Find `r` and `s` for equivalence. + // + // [ARITH1] Page 286, Section 13.2.3.c. + // [SAFE] "Ladders". + // + // Computation: + // + // r = solve(r^3 + a * r + b == 0, r) + // s = +-sqrt(3 * r^2 + a) + // + // Computing `r` is non-trivial. We need + // to solve `r^3 + a * r + b = 0`, but we + // don't have a polynomial solver, so we + // loop over random points until we find + // one with 2-torsion. Multiplying by the + // subgroup order should yield a point of + // ((A / 3) / B, 0) which is a solution. + assert(sign == null || typeof sign === 'boolean'); + assert(this.h.word(0) >= 4); + assert(!this.n.isZero()); + + const x = this.one.redNeg(); + + let p; + + for (;;) { + x.redIAdd(this.one); + + try { + p = this.pointFromX(x.clone()); + } catch (e) { + continue; + } + + p = p.mul(this.n); + + if (p.isInfinity()) + continue; + + if (!p.y.isZero()) + continue; + + break; + } + + const r = p.x; + const r2 = r.redSqr(); + const s = r2.redMuln(3).redIAdd(this.a).redSqrt(); + + if (sign != null) { + if (s.redIsOdd() !== sign) + s.redINeg(); + } + + return [r, s]; + } + + _scale0(a, b) { + // We can extract the isomorphism factors with: + // + // u4 = a' / a + // u6 = b' / b + // u2 = +-sqrt(u4) + // u = +-sqrt(u2) + // u3 = u2 * u + // + // `u2` should be picked such that `u4 * u2 = u6`. + // + // If a = 0, we can do: + // + // u6 = b' / b + // u2 = u6^(1 / 3) + // u = +-sqrt(u2) + // u3 = u2 * u + // + // Where `u2` is any root that is square. + // + // If b = 0, we can do: + // + // u4 = a' / a + // u2 = +-sqrt(u4) + // u = +-sqrt(u2) + // u3 = u2 * u + // + // Where `u2` is any root that is square. + assert(this.a.isZero() === a.isZero()); + assert(this.b.isZero() === b.isZero()); + + if (this.a.isZero()) { + const u6 = this.b.redDiv(this.field(b)); + // Todo: figure out how to check index. + const u2 = uncube(u6); + const u = u2.redSqrt(); + const u3 = u2.redMul(u); + + assert(u3.redSqr().eq(u6)); + assert(!u.isZero()); + + return [u2, u3]; + } + + if (this.b.isZero()) { + const u4 = this.a.redDiv(this.field(a)); + const u2 = u4.redSqrt(); + + // Todo: figure out how to check oddness. + if (u2.redJacobi() !== 1) + u2.redINeg(); + + const u = u2.redSqrt(); + const u3 = u2.redMul(u); + + assert(u3.redMul(u).eq(u4)); + assert(!u.isZero()); + + return [u2, u3]; + } + + const u4 = this.a.redDiv(this.field(a)); + const u6 = this.b.redDiv(this.field(b)); + const u2 = u4.redSqrt(); + + if (!u4.redMul(u2).eq(u6)) + u2.redINeg(); + + assert(u4.redMul(u2).eq(u6)); + + const u = u2.redSqrt(); + const u3 = u2.redMul(u); + + assert(!u.isZero()); + + return [u2, u3]; + } + + _scale1(x, y) { + // If base points are available, it is much + // easier, with: + // + // u2 = x' / x + // u3 = y' / y + // u = +-sqrt(u2) + // + // `u` should be picked such that `u2 * u = u3`. + const u2 = this.g.x.redDiv(this.field(x)); + const u3 = this.g.y.redDiv(this.field(y)); + const u = u2.redSqrt(); + + if (!u2.redMul(u).eq(u3)) + u.redINeg(); + + assert(u2.redMul(u).eq(u3)); + assert(!u.isZero()); + + return [u2, u3]; + } + + _scaleShort(curve) { + assert(curve instanceof ShortCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) + return this._scale0(curve.a, curve.b); + + return this._scale1(curve.g.x, curve.g.y); + } + + _scaleMont(curve) { + assert(curve instanceof MontCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) { + const [a, b] = curve._short(); + return this._scale0(a, b); + } + + const {x, y} = curve.g; + const nx = x.redAdd(curve.a3).redMul(curve.bi); + const ny = y.redMul(curve.bi); + + return this._scale1(nx, ny); + } + + _scaleEdwards(curve) { + assert(curve instanceof EdwardsCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) { + const [a, b] = curve._short(); + return this._scale0(a, b); + } + + const {x, y, z} = curve.g; + const a5 = curve.a.redMuln(5); + const d5 = curve.d.redMuln(5); + const dma = curve.d.redSub(curve.a); + const d5a = d5.redSub(curve.a); + const da5 = curve.d.redSub(a5); + const ypz = y.redAdd(z); + const ymz = y.redSub(z); + const xx = d5a.redMul(y).redIAdd(da5.redMul(z)); + const xz = ymz.redMuln(12); + const yy = dma.redMul(ypz).redMul(z); + const yz = ymz.redMul(x).redIMuln(4); + const zi = xz.redMul(yz).redInvert(); + const nx = xx.redMul(yz).redMul(zi); + const ny = yy.redMul(xz).redMul(zi); + + return this._scale1(nx, ny); + } + + _getEndomorphism(index = 0) { + // Compute endomorphism. + // + // [GECC] Example 3.76, Page 128, Section 3.5. + + // No curve params. + if (this.n.isZero() || this.g.isInfinity()) + return null; + + // No efficient endomorphism. + if (!this.zeroA || this.p.modrn(3) !== 1 || this.n.modrn(3) !== 1) + return null; + + // Solve beta^3 mod p = 1. + const [b1, b2] = this._getEndoRoots(this.p); + + // Choose the smallest beta by default. + const beta = [b1, b2][index & 1].toRed(this.red); + + // Solve lambda^3 mod n = 1. + const [l1, l2] = this._getEndoRoots(this.n); + + // Choose the lambda matching selected beta. + // Note that P * lambda = (x * beta, y). + const p = this.point(this.g.x.redMul(beta), this.g.y); + + let lambda; + + if (this.g.mul(l1).eq(p)) { + lambda = l1; + } else { + assert(this.g.mul(l2).eq(p)); + lambda = l2; + } + + // Get basis vectors. + const basis = this._getEndoBasis(lambda); + + // Precompute `g1` and `g2`. + const pre = this._getEndoPrecomp(basis); + + return new Endo(beta, lambda, basis, pre); + } + + _getEndoRoots(num) { + // Find roots for x^2 + x + 1 in F. + // + // [GECC] Example 3.76, Page 128, Section 3.5. + // [GLV] Page 192, Section 2 (Endomorphisms). + // + // The above document doesn't fully explain how + // to derive these and only "hints" at it, as + // mentioned by Hal Finney[1], but we're basically + // computing two possible cube roots of 1 here. + // + // Note that we could also compute[2]: + // + // beta = 2^((p - 1) / 3) mod p + // lambda = 3^((n - 1) / 3) mod n + // + // As an extension of Fermat's little theorem: + // + // g^(p - 1) mod p == 1 + // + // It is suspected[3] this is how Hal Finney[4] + // computed his original endomorphism roots. + // + // @indutny's method for computing cube roots + // of unity[5] appears to be the method described + // on wikipedia[6][7]. + // + // Sage produces the same solution: + // + // sage: solve(x^2 + x + 1 == 0, x) + // [x == -1/2*I*sqrt(3) - 1/2, x == 1/2*I*sqrt(3) - 1/2] + // + // This can be reduced to: + // + // x = (+-sqrt(-3) - 1) / 2 + // + // [1] https://bitcointalk.org/index.php?topic=3238.msg45565#msg45565 + // [2] https://crypto.stackexchange.com/a/22739 + // [3] https://bitcoin.stackexchange.com/a/35872 + // [4] https://github.com/halfinney/bitcoin/commit/dc411b5 + // [5] https://en.wikipedia.org/wiki/Cube_root_of_unity + // [6] https://en.wikipedia.org/wiki/Splitting_field#Cubic_example + // [7] http://mathworld.wolfram.com/SplittingField.html + const red = num === this.p ? this.red : BN.mont(num); + const two = new BN(2).toRed(red); + const three = new BN(3).toRed(red); + const i2 = two.redInvert(); + + // S1 = sqrt(-3) / 2 + const s1 = three.redNeg().redSqrt().redMul(i2); + + // S2 = -S1 + const s2 = s1.redNeg(); + + // R1 = S1 - 1 / 2 + const r1 = s1.redSub(i2).fromRed(); + + // R2 = S2 - 1 / 2 + const r2 = s2.redSub(i2).fromRed(); + + return [r1, r2].sort(BN.cmp); + } + + _getEndoBasis(lambda) { + // Compute endomorphic basis. + // + // This essentially computes Cornacchia's algorithm + // for solving x^2 + d * y^2 = m (d = lambda, m = order). + // + // https://en.wikipedia.org/wiki/Cornacchia%27s_algorithm + // + // [GECC] Algorithm 3.74, Page 127, Section 3.5. + // [GLV] Page 196, Section 4 (Decomposing K). + // + // Balanced length-two representation of a multiplier. + // + // 1. Run the extended euclidean algorithm with inputs n + // and lambda. The algorithm produces a sequence of + // equations si*n + ti*lam = ri where s0=1, t0=0, + // r0=n, s1=0, t1=1, r1=lam, and the remainders ri + // and are non-negative and strictly decreasing. Let + // l be the greatest index for which rl >= sqrt(n). + const [rl, tl, rl1, tl1, rl2, tl2] = this._egcdSqrt(lambda); + + // 2. Set (a1, b1) <- (rl+1, -tl+1). + const a1 = rl1; + const b1 = tl1.neg(); + + // 3. If (rl^2 + tl^2) <= (rl+2^2 + tl+2^2) + // then set (a2, b2) <- (rl, -tl). + // else set (a2, b2) <- (rl+2, -tl+2). + const lhs = rl.sqr().iadd(tl.sqr()); + const rhs = rl2.sqr().iadd(tl2.sqr()); + + let a2, b2; + + if (lhs.cmp(rhs) <= 0) { + a2 = rl; + b2 = tl.neg(); + } else { + a2 = rl2; + b2 = tl2.neg(); + } + + return [ + new Vector(a1, b1), + new Vector(a2, b2) + ]; + } + + _egcdSqrt(lambda) { + // Extended Euclidean algorithm for integers. + // + // [GECC] Algorithm 2.19, Page 40, Section 2.2. + // [GLV] Page 196, Section 4 (Decomposing K). + assert(lambda instanceof BN); + assert(!lambda.red); + assert(lambda.sign() > 0); + assert(this.n.sign() > 0); + + // Note that we insert the approximate square + // root checks as described in algorithm 3.74. + // + // Algorithm 2.19 is defined as: + // + // 1. u <- a + // v <- b + // + // 2. x1 <- 1 + // y1 <- 0 + // x2 <- 0 + // y2 <- 1 + // + // 3. while u != 0 do + // + // 3.1. q <- floor(v / u) + // r <- v - q * u + // x <- x2 - q * x1 + // y <- y2 - q * y1 + // + // 3.2. v <- u + // u <- r + // x2 <- x1 + // x1 <- x + // y2 <- y1 + // y1 <- y + // + // 4. d <- v + // x <- x2 + // y <- y2 + // + // 5. Return (d, x, y). + + // Start with an approximate square root of n. + const sqrtn = this.n.ushrn(this.n.bitLength() >>> 1); + + let u = lambda; // r1 + let v = this.n.clone(); // r0 + let x1 = new BN(1); // t1 + let y1 = new BN(0); // t0 + let x2 = new BN(0); // s1 + let y2 = new BN(1); // s0 + + // All vectors are roots of: a + b * lambda = 0 (mod n). + let rl, tl; + + // First vector. + let rl1, tl1; + + // Inner. + let i = 0; + let j = 0; + let p; + + // Compute EGCD. + while (!u.isZero() && i < 2) { + const q = v.quo(u); + const r = v.sub(q.mul(u)); + const x = x2.sub(q.mul(x1)); + const y = y2.sub(q.mul(y1)); + + // Check for r < sqrt(n). + if (j === 0 && r.cmp(sqrtn) < 0) { + rl = p; + tl = x1; + rl1 = r; + tl1 = x; + j = 1; // 1 more round. + } + + p = r; + v = u; + u = r; + x2 = x1; + x1 = x; + y2 = y1; + y1 = y; + + i += j; + } + + // Should never happen. + assert(j !== 0, 'Could not find r < sqrt(n).'); + + // Second vector. + const rl2 = x2; + const tl2 = x1; + + return [ + rl, + tl, + rl1, + tl1, + rl2, + tl2 + ]; + } + + _getEndoPrecomp(basis) { + // Precompute `g1` and `g2` to avoid round division. + // + // [JCEN12] Page 5, Section 4.3. + // + // Computation: + // + // d = a1 * b2 - b1 * a2 + // t = ceil(log2(d+1)) + p + // g1 = round((2^t * b2) / d) + // g2 = round((2^t * b1) / d) + // + // Where: + // + // `p` is the number of precision bits. + // `d` is equal to `n` (the curve order). + // + // The paper above uses 2 as the value of `p`, + // whereas libsecp256k1 uses 128 (total=384). + // + // We pick precision for `g1` and `g2` such that: + // + // abs(g1) < n + // abs(g2) < n + // + // This ensures maximum precision for the constants + // while also ensuring they fit into a fixed number + // of scalar limbs in more optimized implementations. + // + // Furthermore, we attempt to align to a limb width + // of 64 bits. This allows us to optimize the shift, + // a la libsecp256k1[1]. + // + // [1] https://github.com/bitcoin-core/secp256k1/pull/822 + assert(Array.isArray(basis)); + assert(basis.length === 2); + assert(basis[0] instanceof Vector); + assert(basis[1] instanceof Vector); + + const [v1, v2] = basis; + const d = v1.a.mul(v2.b).isub(v1.b.mul(v2.a)); + const bits = d.bitLength(); + const align = bits >= 160; + + assert(d.eq(this.n)); + + // Start with a rough estimate. + let shift = bits + Math.ceil(bits / 2) + 1; + let g1, g2; + + if (align) + shift -= shift & 63; + + while (shift > bits) { + g1 = v2.b.ushln(shift).divRound(d); + g2 = v1.b.ushln(shift).divRound(d); + + if (g1.ucmp(d) < 0 && g2.ucmp(d) < 0) + break; + + if (align) + shift -= 64; + else + shift -= 1; + } + + if (shift <= bits) + throw new Error('Could not calculate g1 and g2.'); + + return [shift, g1, g2]; + } + + _endoSplit(k) { + // Balanced length-two representation of a multiplier. + // + // [GECC] Algorithm 3.74, Page 127, Section 3.5. + // + // Also note that it is possible to precompute[1] + // values in order to avoid the division[2][3][4]. + // + // This involves precomputing `g1` and `g2 (see + // above). `c1` and `c2` can then be computed as + // follows: + // + // t = ceil(log2(n+1)) + p + // c1 = (k * g1) >> t + // c2 = -((k * g2) >> t) + // + // Where `>>` is an _unsigned_ right shift. Also + // note that the last bit discarded in the shift + // must be stored. If it is 1, then add 1 to the + // scalar (absolute addition). + // + // It's worth noting that libsecp256k1 uses a + // different calculation along the lines of: + // + // t = ceil(log2(n+1)) + p + // c1 = ((k * g1) >> t) * -b1 + // c2 = ((k * -g2) >> t) * -b2 + // k2 = c1 + c2 + // k1 = k2 * -lambda + k + // + // So, in the future, we can consider changing + // step 4 to: + // + // 4. Compute c1 = (k * g1) >> t + // and c2 = -((k * g2) >> t). + // + // const [shift, g1, g2] = this.endo.pre; + // const c1 = k.mulShift(g1, shift); + // const c2 = k.mulShift(g2, shift).ineg(); + // + // Once we're brave enough, that is. + // + // [1] [JCEN12] Page 5, Section 4.3. + // [2] https://github.com/bitcoin-core/secp256k1/blob/0b70241/src/scalar_impl.h#L259 + // [3] https://github.com/bitcoin-core/secp256k1/pull/21 + // [4] https://github.com/bitcoin-core/secp256k1/pull/127 + assert(k instanceof BN); + assert(!k.red); + assert(!this.n.isZero()); + + const [v1, v2] = this.endo.basis; + + // 4. Compute c1 = round(b2 * k / n) + // and c2 = round(-b1 * k / n). + const c1 = v2.b.mul(k).divRound(this.n); + const c2 = v1.b.neg().mul(k).divRound(this.n); + + // 5. Compute k1 = k - c1 * a1 - c2 * a2 + // and k2 = -c1 * b1 - c2 * b2. + const p1 = c1.mul(v1.a); + const p2 = c2.mul(v2.a); + const q1 = c1.ineg().mul(v1.b); + const q2 = c2.mul(v2.b); + + // Calculate answer. + const k1 = k.sub(p1).isub(p2); + const k2 = q1.isub(q2); + + // 6. Return (k1, k2). + return [k1, k2]; + } + + _endoBeta(point) { + assert(point instanceof ShortPoint); + return [point, point._getBeta()]; + } + + _endoWnafMulAdd(points, coeffs) { + // Point multiplication with efficiently computable endomorphisms. + // + // [GECC] Algorithm 3.77, Page 129, Section 3.5. + // [GLV] Page 193, Section 3 (Using Efficient Endomorphisms). + // + // Note it may be possible to do this 4-dimensionally [4GLV]. + assert(Array.isArray(points)); + assert(Array.isArray(coeffs)); + assert(points.length === coeffs.length); + assert(this.endo != null); + + const len = points.length; + const npoints = new Array(len * 2); + const ncoeffs = new Array(len * 2); + + for (let i = 0; i < len; i++) { + const [p1, p2] = this._endoBeta(points[i]); + const [k1, k2] = this._endoSplit(coeffs[i]); + + npoints[i * 2 + 0] = p1; + ncoeffs[i * 2 + 0] = k1; + npoints[i * 2 + 1] = p2; + ncoeffs[i * 2 + 1] = k2; + } + + return this._wnafMulAdd(5, npoints, ncoeffs); + } + + _sswu(u) { + // Simplified Shallue-Woestijne-Ulas Method. + // + // Distribution: 3/8. + // + // [SSWU1] Page 15-16, Section 7. Appendix G. + // [SSWU2] Page 5, Theorem 2.3. + // [H2EC] "Simplified Shallue-van de Woestijne-Ulas Method". + // + // Assumptions: + // + // - a != 0, b != 0. + // - Let z be a non-square in F(p). + // - z != -1. + // - The polynomial g(x) - z is irreducible over F(p). + // - g(b / (z * a)) is square in F(p). + // - u != 0, u != +-sqrt(-1 / z). + // + // Map: + // + // g(x) = x^3 + a * x + b + // t1 = 1 / (z^2 * u^4 + z * u^2) + // x1 = (-b / a) * (1 + t1) + // x1 = b / (z * a), if t1 = 0 + // x2 = z * u^2 * x1 + // x = x1, if g(x1) is square + // = x2, otherwise + // y = sign(u) * abs(sqrt(g(x))) + const {b, z, ai, zi, one} = this; + const z2 = z.redSqr(); + const ba = b.redNeg().redMul(ai); + const bza = b.redMul(zi).redMul(ai); + const u2 = u.redSqr(); + const u4 = u2.redSqr(); + const t0 = z2.redMul(u4).redIAdd(z.redMul(u2)); + const t1 = t0.isZero() ? t0 : t0.redInvert(); + const x1 = t1.isZero() ? bza : ba.redMul(one.redAdd(t1)); + const x2 = z.redMul(u2).redMul(x1); + const y1 = this.solveY2(x1); + const y2 = this.solveY2(x2); + const alpha = y1.redIsSquare() | 0; + const x = [x1, x2][alpha ^ 1]; + const y = [y1, y2][alpha ^ 1].redSqrt(); + + if (y.redIsOdd() !== u.redIsOdd()) + y.redINeg(); + + return this.point(x, y); + } + + _sswui(p, hint) { + // Inverting the Map (Simplified Shallue-Woestijne-Ulas). + // + // Assumptions: + // + // - a^2 * x^2 - 2 * a * b * x - 3 * b^2 is square in F(p). + // - If r < 3 then x != -b / a. + // + // Unlike SVDW, the preimages here are evenly + // distributed (more or less). SSWU covers ~3/8 + // of the curve points. Each preimage has a 1/2 + // chance of mapping to either x1 or x2. + // + // Assuming the point is within that set, each + // point has a 1/4 chance of inverting to any + // of the preimages. This means we can simply + // randomly select a preimage if one exists. + // + // However, the [SVDW2] sampling method seems + // slighly faster in practice for [SQUARED]. + // + // Map: + // + // c = sqrt(a^2 * x^2 - 2 * a * b * x - 3 * b^2) + // u1 = -(a * x + b - c) / (2 * (a * x + b) * z) + // u2 = -(a * x + b + c) / (2 * (a * x + b) * z) + // u3 = -(a * x + b - c) / (2 * b * z) + // u4 = -(a * x + b + c) / (2 * b * z) + // r = random integer in [1,4] + // u = sign(y) * abs(sqrt(ur)) + const {a, b, z} = this; + const {x, y} = p; + const r = hint & 3; + const a2x2 = a.redSqr().redMul(x.redSqr()); + const abx2 = a.redMul(b).redMul(x).redIMuln(2); + const b23 = b.redSqr().redMuln(3); + const axb = a.redMul(x).redIAdd(b); + const c = a2x2.redISub(abx2).redISub(b23).redSqrt(); + const n0 = axb.redSub(c).redINeg(); + const n1 = axb.redAdd(c).redINeg(); + const d0 = axb.redMul(z).redIMuln(2); + const d1 = b.redMul(z).redIMuln(2); + const n = [n0, n1][r & 1]; // r = 1 or 3 + const d = [d0, d1][r >>> 1]; // r = 2 or 3 + const u = n.redDivSqrt(d); + + if (u.redIsOdd() !== y.redIsOdd()) + u.redINeg(); + + return u; + } + + _svdwf(u) { + // Shallue-van de Woestijne Method. + // + // Distribution: 9/16. + // + // [SVDW1] Section 5. + // [SVDW2] Page 8, Section 3. + // Page 15, Section 6, Algorithm 1. + // [H2EC] "Shallue-van de Woestijne Method". + // + // Assumptions: + // + // - p = 1 (mod 3). + // - a = 0, b != 0. + // - Let z be a unique element in F(p). + // - g((sqrt(-3 * z^2) - z) / 2) is square in F(p). + // - u != 0, u != +-sqrt(-g(z)). + // + // Map: + // + // g(x) = x^3 + b + // c = sqrt(-3 * z^2) + // t1 = u^2 + g(z) + // t2 = 1 / (u^2 * t1) + // t3 = u^4 * t2 * c + // x1 = (c - z) / 2 - t3 + // x2 = t3 - (c + z) / 2 + // x3 = z - t1^3 * t2 / (3 * z^2) + // x = x1, if g(x1) is square + // = x2, if g(x2) is square + // = x3, otherwise + // y = sign(u) * abs(sqrt(g(x))) + const {c, z, zi, i2, i3} = this; + const gz = this.solveY2(z); + const z3 = i3.redMul(zi.redSqr()); + const u2 = u.redSqr(); + const u4 = u2.redSqr(); + const t1 = u2.redAdd(gz); + const u2t1 = u2.redMul(t1); + const t2 = u2t1.isZero() ? u2t1 : u2t1.redInvert(); + const t3 = u4.redMul(t2).redMul(c); + const t4 = t1.redSqr().redMul(t1); + const x1 = c.redSub(z).redMul(i2).redISub(t3); + const x2 = t3.redSub(c.redAdd(z).redMul(i2)); + const x3 = z.redSub(t4.redMul(t2).redMul(z3)); + const y1 = this.solveY2(x1); + const y2 = this.solveY2(x2); + const y3 = this.solveY2(x3); + const alpha = y1.redJacobi() | 1; + const beta = y2.redJacobi() | 1; + const i = mod((alpha - 1) * beta, 3); + const x = [x1, x2, x3][i]; + const y = [y1, y2, y3][i]; + + return [x, y]; + } + + _svdw(u) { + const [x, yy] = this._svdwf(u); + const y = yy.redSqrt(); + + if (y.redIsOdd() !== u.redIsOdd()) + y.redINeg(); + + return this.point(x, y); + } + + _svdwi(p, hint) { + // Inverting the Map (Shallue-van de Woestijne). + // + // [SQUARED] Algorithm 1, Page 8, Section 3.3. + // [SVDW2] Page 12, Section 5. + // [SVDW3] "Inverting the map". + // + // Assumptions: + // + // - If r = 1 then x != -(c + z) / 2. + // - If r = 2 then x != (c - z) / 2. + // - If r > 2 then (t0 - t1 + t2) is square in F(p). + // - f(f^-1(x)) = x where f is the map function. + // + // We use the sampling method from [SVDW2], + // _not_ [SQUARED]. This seems to have a + // better distribution in practice. + // + // Note that [SVDW3] also appears to be + // incorrect in terms of distribution. + // + // The distribution of f(u), assuming u is + // random, is (1/2, 1/4, 1/4). + // + // To mirror this, f^-1(x) should simply + // pick (1/2, 1/4, 1/8, 1/8). + // + // To anyone running the forward map, our + // strings will appear to be random. + // + // Map: + // + // g(x) = x^3 + b + // c = sqrt(-3 * z^2) + // t0 = 9 * (x^2 * z^2 + z^4) + // t1 = 18 * x * z^3 + // t2 = 12 * g(z) * (x - z) + // t3 = sqrt(t0 - t1 + t2) + // t4 = t3 * z + // u1 = g(z) * (c - 2 * x - z) / (c + 2 * x + z) + // u2 = g(z) * (c + 2 * x + z) / (c - 2 * x - z) + // u3 = (3 * (z^3 - x * z^2) - 2 * g(z) + t4) / 2 + // u4 = (3 * (z^3 - x * z^2) - 2 * g(z) - t4) / 2 + // r = random integer in [1,4] + // u = sign(y) * abs(sqrt(ur)) + const {b, c, z, zero, two} = this; + const {x, y} = p; + const r = hint & 3; + const z2 = z.redSqr(); + const z3 = z2.redMul(z); + const z4 = z2.redSqr(); + const gz = z3.redAdd(b); + const gz2 = gz.redMuln(2); + const xx = x.redSqr(); + const x2z = x.redMuln(2).redIAdd(z); + const xz2 = x.redMul(z2); + const c0 = c.redSub(x2z); + const c1 = c.redAdd(x2z); + const t0 = xx.redMul(z2).redIAdd(z4).redIMuln(9); + const t1 = x.redMul(z3).redIMuln(18); + const t2 = gz.redMul(x.redSub(z)).redIMuln(12); + const t3 = r >= 2 ? t0.redISub(t1).redIAdd(t2).redSqrt() : zero; + const t4 = t3.redMul(z); + const t5 = z3.redISub(xz2).redIMuln(3).redISub(gz2); + const n0 = gz.redMul(c0); + const n1 = gz.redMul(c1); + const n2 = t5.redAdd(t4); + const n3 = t5.redSub(t4); + const d2 = two; + const n = [n0, n1, n2, n3][r]; + const d = [c1, c0, d2, d2][r]; + const u = n.redDivSqrt(d); + const [x0] = this._svdwf(u); + + if (!x0.eq(x)) + throw new Error('Invalid point.'); + + if (u.redIsOdd() !== y.redIsOdd()) + u.redINeg(); + + return u; + } + + isElliptic() { + const {a, b} = this; + const a2 = a.redSqr(); + const a3 = a2.redMul(a); + const b2 = b.redSqr(); + const d = b2.redMuln(27).redIAdd(a3.redMuln(4)); + + // 4 * a^3 + 27 * b^2 != 0 + return !d.isZero(); + } + + jinv() { + // [ARITH1] Page 71, Section 4.4. + // http://mathworld.wolfram.com/j-Invariant.html + const {a, b} = this; + const a2 = a.redSqr(); + const a3 = a2.redMul(a); + const b2 = b.redSqr(); + const t0 = a3.redMuln(4); + const lhs = t0.redMuln(1728); + const rhs = b2.redMuln(27).redIAdd(t0); + + if (rhs.isZero()) + throw new Error('Curve is not elliptic.'); + + // (1728 * 4 * a^3) / (4 * a^3 + 27 * b^2) + return lhs.redDiv(rhs).fromRed(); + } + + point(x, y) { + return new ShortPoint(this, x, y); + } + + jpoint(x, y, z) { + return new JPoint(this, x, y, z); + } + + solveX(y) { + assert(y instanceof BN); + + if (!this.a.isZero()) + throw new Error('Not implemented.'); + + // x^3 = y^2 - b + const y2 = y.redSqr(); + const x3 = y2.redSub(this.b); + + return cubeRoots(x3); + } + + solveY2(x) { + // [GECC] Page 89, Section 3.2.2. + // https://hyperelliptic.org/EFD/g1p/auto-shortw.html + assert(x instanceof BN); + + // y^2 = x^3 + a * x + b + const x3 = x.redSqr().redMul(x); + const y2 = x3.redIAdd(this.b); + + if (!this.zeroA) { + // Save some cycles for a = -3. + if (this.threeA) + y2.redIAdd(x.redMuln(-3)); + else + y2.redIAdd(this.a.redMul(x)); + } + + return y2; + } + + validate(point) { + assert(point instanceof ShortPoint); + + if (point.inf) + return true; + + const {x, y} = point; + const y2 = this.solveY2(x); + + return y.redSqr().eq(y2); + } + + pointFromX(x, sign = null) { + assert(x instanceof BN); + assert(sign == null || typeof sign === 'boolean'); + + if (!x.red) + x = x.toRed(this.red); + + const y = this.solveY(x); + + if (sign != null) { + if (this.h.cmpn(1) > 0) { + if (y.isZero() && sign) + throw new Error('Invalid point.'); + } + + if (y.redIsOdd() !== sign) + y.redINeg(); + } + + return this.point(x, y); + } + + pointFromY(y, index = 0) { + assert(y instanceof BN); + assert((index >>> 0) === index); + + if (!y.red) + y = y.toRed(this.red); + + const coords = this.solveX(y); + + if (index >= coords.length) + throw new Error('Invalid X coordinate index.'); + + const x = coords[index]; + + return this.point(x, y); + } + + isIsomorphic(curve) { + // [GECC] Page 84, Section 3.1.5. + // [ARITH1] Page 286, Section 13.2.3.c. + assert(curve instanceof Curve); + + if (!curve.p.eq(this.p)) + return false; + + let u2, u3; + try { + [u2, u3] = this._scale(curve); + } catch (e) { + return false; + } + + // E(a,b) <-> E(au^4,bu^6) + if (curve.type === 'short') { + // a' = a * u^4, b' = b * u^6 + const a = this.field(curve.a).redMul(u2.redSqr()); + const b = this.field(curve.b).redMul(u3.redSqr()); + + return this.a.eq(a) && this.b.eq(b); + } + + // E(a,b) <-> M(A,B) + if (curve.type === 'mont') { + // (A / (3 * B))^3 + a * (A / (3 * B)) + b = 0 + const {a3, bi} = curve; + const x = this.field(a3.redMul(bi)).redMul(u2); + const y2 = this.solveY2(x); + + return y2.isZero(); + } + + // E(a,b) <-> E(a,d) + if (curve.type === 'edwards') { + // ((a' + d') / 6)^3 + a * ((a' + d') / 6) + b = 0 + const x = this.field(curve.ad6).redMul(u2); + const y2 = this.solveY2(x); + + return y2.isZero(); + } + + return false; + } + + isIsogenous(curve) { + assert(curve instanceof Curve); + return false; + } + + pointFromShort(point) { + // [GECC] Page 84, Section 3.1.5. + // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves). + assert(point instanceof ShortPoint); + + if (this.isIsomorphic(point.curve)) { + // Isomorphic maps for E(a,b)<->E(au^4,bu^6): + // + // x' = x * u^2 + // y' = y * u^3 + // + // Where a * u^4 = a' and b * u^6 = b'. + if (point.isInfinity()) + return this.point(); + + const [u2, u3] = this._scale(point.curve); + const x = this.field(point.x); + const y = this.field(point.y); + const nx = x.redMul(u2); + const ny = y.redMul(u3); + + return this.point(nx, ny); + } + + throw new Error('Not implemented.'); + } + + pointFromMont(point) { + // [ALT] Appendix E.2 (Switching between Alternative Representations). + // [MONT2] "Equivalence with Weierstrass curves" + assert(point instanceof MontPoint); + + if (this.isIsomorphic(point.curve)) { + // Equivalence for M(A,B)->E(a,b): + // + // x = (u + A / 3) / B + // y = v / B + // + // Undefined if ((u^3 + A * u^2 + u) / B) is not square. + if (point.isInfinity()) + return this.point(); + + const {a3, bi} = point.curve; + const [u2, u3] = this._scale(point.curve); + const nx = point.x.redAdd(a3).redMul(bi); + const ny = point.y.redMul(bi); + + return this.point(this.field(nx).redMul(u2), + this.field(ny).redMul(u3)); + } + + throw new Error('Not implemented.'); + } + + pointFromEdwards(point) { + // [TWISTEQ] Section 2. + assert(point instanceof EdwardsPoint); + + if (this.isIsomorphic(point.curve)) { + // Equivalence for E(a,d)->E(a',b'): + // + // x' = ((5 * d - a) * y + d - 5 * a) / (12 * (y - 1)) + // y' = (d - a) * (y + 1) / (4 * x * (y - 1)) + // + // Undefined for x = 0 or y = 1. + // + // Exceptional Cases: + // - (0, 1) -> O + // - (0, -1) -> ((a + d) / 6, 0) + // + // Unexceptional Cases: + // - (sqrt(1 / a), 0) -> ((5 * a - d) / 12, (a - d) / 4 * sqrt(a)) + const {a, d, ad6} = point.curve; + const [u2, u3] = this._scale(point.curve); + + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) { + const x = this.field(ad6).redMul(u2); + return this.point(x, this.zero); + } + + const {x, y, z} = point; + const a5 = a.redMuln(5); + const d5 = d.redMuln(5); + const dma = d.redSub(a); + const d5a = d5.redSub(a); + const da5 = d.redSub(a5); + const ypz = y.redAdd(z); + const ymz = y.redSub(z); + const xx = d5a.redMul(y).redIAdd(da5.redMul(z)); + const xz = ymz.redMuln(12); + const yy = dma.redMul(ypz).redMul(z); + const yz = ymz.redMul(x).redIMuln(4); + + return this.cpoint(this.field(xx).redMul(u2), + this.field(xz), + this.field(yy).redMul(u3), + this.field(yz)); + } + + throw new Error('Not implemented.'); + } + + pointFromUniform(u) { + assert(u instanceof BN); + + // z = 0 or b = 0 + if (this.z.isZero() || this.b.isZero()) + throw new Error('Not implemented.'); + + // a != 0, b != 0 + if (!this.a.isZero()) + return this._sswu(u); + + // p = 1 mod 3, a = 0, b != 0 + if (!this.c.isZero()) + return this._svdw(u); + + throw new Error('Not implemented.'); + } + + pointToUniform(p, hint) { + // Convert a short weierstrass point to a field + // element by inverting either the SSWU or SVDW + // map. + // + // Hint Layout: + // + // [00000000] [0000] [0000] + // | | | + // | | +-- preimage index + // | +--- subgroup + // +-- bits to OR with uniform bytes + assert(p instanceof ShortPoint); + assert((hint >>> 0) === hint); + + // z = 0 or b = 0 + if (this.z.isZero() || this.b.isZero()) + throw new Error('Not implemented.'); + + // P = O + if (p.isInfinity()) + throw new Error('Invalid point.'); + + // Add a random torsion component. + const i = ((hint >>> 4) & 15) % this.torsion.length; + const q = p.add(this.torsion[i]); + + return wrapErrors(() => { + // a != 0, b != 0 + if (!this.a.isZero()) + return this._sswui(q, hint); + + // p = 1 mod 3, a = 0, b != 0 + if (!this.c.isZero()) + return this._svdwi(q, hint); + + throw new Error('Not implemented.'); + }); + } + + mulAll(points, coeffs) { + return super.mulAll(points, coeffs).toP(); + } + + affinizeAll(points) { + const out = this.normalizeAll(points); + + for (let i = 0; i < out.length; i++) + out[i] = out[i].toP(); + + return out; + } + + decodePoint(bytes) { + return ShortPoint.decode(this, bytes); + } + + encodeX(point) { + assert(point instanceof Point); + return point.encodeX(); + } + + decodeEven(bytes) { + return ShortPoint.decodeEven(this, bytes); + } + + decodeSquare(bytes) { + return ShortPoint.decodeSquare(this, bytes); + } + + toShort(a0, odd, sign = null) { + const [a, b] = this._short(a0, odd); + + const curve = new ShortCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = curve._scale(this); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromShort(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromShort(this.torsion[i]); + + return curve; + } + + toMont(b0, odd, sign = null) { + const [a, b] = this._mont(b0, odd); + + const curve = new MontCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = this._scale(curve); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromShort(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromShort(this.torsion[i]); + + return curve; + } + + toEdwards(a0, odd, sign = null) { + const [a, d] = this._edwards(a0, odd); + + const curve = new EdwardsCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + d: d, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = this._scale(curve); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) { + curve.g = curve.pointFromShort(this.g); + curve.g.normalize(); + } + + if (curve.isComplete()) { + for (let i = 0; i < this.h.word(0); i++) { + curve.torsion[i] = curve.pointFromShort(this.torsion[i]); + curve.torsion[i].normalize(); + } + } + + return curve; + } + + pointFromJSON(json) { + return ShortPoint.fromJSON(this, json); + } + + toJSON(pre) { + const json = super.toJSON(pre); + + json.a = this.a.fromRed().toJSON(); + json.b = this.b.fromRed().toJSON(); + + if (!this.c.isZero()) + json.c = this.c.fromRed().toJSON(); + + return json; + } + } + + /** + * ShortPoint + */ + + class ShortPoint extends Point { + constructor(curve, x, y) { + assert(curve instanceof ShortCurve); + + super(curve, types.AFFINE); + + this.x = this.curve.zero; + this.y = this.curve.zero; + this.inf = true; + + if (x != null) + this._init(x, y); + } + + _init(x, y) { + assert(x instanceof BN); + assert(y instanceof BN); + + this.x = x; + this.y = y; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + + this.inf = false; + } + + _getBeta() { + if (!this.curve.endo) + return null; + + if (this.pre && this.pre.beta) + return this.pre.beta; + + // Augment the point with our beta value. + // This is the counterpart to `k2` after + // the endomorphism split of `k`. + // + // Note that if we have precomputation, + // we have to clone and update all of the + // precomputed points below. + const xb = this.x.redMul(this.curve.endo.beta); + const beta = this.curve.point(xb, this.y); + + if (this.pre) { + beta.pre = this.pre.map((point) => { + const xb = point.x.redMul(this.curve.endo.beta); + return this.curve.point(xb, point.y); + }); + + this.pre.beta = beta; + } + + return beta; + } + + _getJNAF(point) { + assert(point instanceof ShortPoint); + + if (this.inf || point.inf) + return super._getJNAF(point); + + // Create comb for JSF. + const comb = [ + this, // 1 + null, // 3 + null, // 5 + point // 7 + ]; + + // Try to avoid Jacobian points, if possible. + if (this.y.eq(point.y)) { + comb[1] = this.add(point); + comb[2] = this.toJ().sub(point); + } else if (this.y.eq(point.y.redNeg())) { + comb[1] = this.toJ().add(point); + comb[2] = this.sub(point); + } else { + comb[1] = this.toJ().add(point); + comb[2] = this.toJ().sub(point); + } + + return comb; + } + + clone() { + if (this.inf) + return this.curve.point(); + + return this.curve.point(this.x, this.y); + } + + scale(a) { + return this.toJ().scale(a); + } + + neg() { + // P = O + if (this.inf) + return this; + + // -(X1, Y1) = (X1, -Y1) + return this.curve.point(this.x, this.y.redNeg()); + } + + add(p) { + // [GECC] Page 80, Section 3.1.2. + // + // Addition Law: + // + // l = (y1 - y2) / (x1 - x2) + // x3 = l^2 - x1 - x2 + // y3 = l * (x1 - x3) - y1 + // + // 1I + 2M + 1S + 6A + assert(p instanceof ShortPoint); + + // O + P = P + if (this.inf) + return p; + + // P + O = P + if (p.inf) + return this; + + // P + P, P + -P + if (this.x.eq(p.x)) { + // P + -P = O + if (!this.y.eq(p.y)) + return this.curve.point(); + + // P + P = 2P + return this.dbl(); + } + + // X1 != X2, Y1 = Y2 + if (this.y.eq(p.y)) { + // X3 = -X1 - X2 + const nx = this.x.redNeg().redISub(p.x); + + // Y3 = -Y1 + const ny = this.y.redNeg(); + + // Skip the inverse. + return this.curve.point(nx, ny); + } + + // H = X1 - X2 + const h = this.x.redSub(p.x); + + // R = Y1 - Y2 + const r = this.y.redSub(p.y); + + // L = R / H + const l = r.redDiv(h); + + // X3 = L^2 - X1 - X2 + const nx = l.redSqr().redISub(this.x).redISub(p.x); + + // Y3 = L * (X1 - X3) - Y1 + const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); + + return this.curve.point(nx, ny); + } + + dbl() { + // [GECC] Page 80, Section 3.1.2. + // + // Addition Law (doubling): + // + // l = (3 * x1^2 + a) / (2 * y1) + // x3 = l^2 - 2 * x1 + // y3 = l * (x1 - x3) - y1 + // + // 1I + 2M + 2S + 3A + 2*2 + 1*3 + + // P = O + if (this.inf) + return this; + + // Y1 = 0 + if (this.y.isZero()) + return this.curve.point(); + + // XX = X1^2 + const xx = this.x.redSqr(); + + // M = 3 * XX + a + const m = xx.redIMuln(3).redIAdd(this.curve.a); + + // Z = 2 * Y1 + const z = this.y.redMuln(2); + + // L = M / Z + const l = m.redDiv(z); + + // X3 = L^2 - 2 * X1 + const nx = l.redSqr().redISub(this.x).redISub(this.x); + + // Y3 = L * (X1 - X3) - Y1 + const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); + + return this.curve.point(nx, ny); + } + + dblp(pow) { + return this.toJ().dblp(pow).toP(); + } + + getX() { + if (this.inf) + throw new Error('Invalid point.'); + + return this.x.fromRed(); + } + + getY() { + if (this.inf) + throw new Error('Invalid point.'); + + return this.y.fromRed(); + } + + eq(p) { + assert(p instanceof ShortPoint); + + // P = Q + if (this === p) + return true; + + // P = O + if (this.inf) + return p.inf; + + // Q = O + if (p.inf) + return false; + + // X1 = X2, Y1 = Y2 + return this.x.eq(p.x) + && this.y.eq(p.y); + } + + cmp(point) { + assert(point instanceof ShortPoint); + + if (this.inf && !point.inf) + return -1; + + if (!this.inf && point.inf) + return 1; + + if (this.inf && point.inf) + return 0; + + return this.order().cmp(point.order()) + || this.getX().cmp(point.getX()) + || this.getY().cmp(point.getY()); + } + + isInfinity() { + // Infinity cannot be represented in + // the affine space, except by a flag. + return this.inf; + } + + isOrder2() { + if (this.inf) + return false; + + return this.y.isZero(); + } + + isOdd() { + if (this.inf) + return false; + + return this.y.redIsOdd(); + } + + isEven() { + if (this.inf) + return false; + + return this.y.redIsEven(); + } + + isSquare() { + if (this.inf) + return false; + + return this.y.redJacobi() !== -1; + } + + eqX(x) { + assert(x instanceof BN); + assert(!x.red); + + if (this.inf) + return false; + + return this.getX().eq(x); + } + + eqR(x) { + assert(x instanceof BN); + assert(!x.red); + assert(!this.curve.n.isZero()); + + if (this.inf) + return false; + + return this.getX().imod(this.curve.n).eq(x); + } + + mul(k) { + return super.mul(k).toP(); + } + + muln(k) { + return super.muln(k).toP(); + } + + mulBlind(k, rng) { + return super.mulBlind(k, rng).toP(); + } + + mulAdd(k1, p2, k2) { + return super.mulAdd(k1, p2, k2).toP(); + } + + mulH() { + return super.mulH().toP(); + } + + div(k) { + return super.div(k).toP(); + } + + divn(k) { + return super.divn(k).toP(); + } + + divH() { + return super.divH().toP(); + } + + toP() { + return this; + } + + toJ() { + // (X3, Y3, Z3) = (1, 1, 0) + if (this.inf) + return this.curve.jpoint(); + + // (X3, Y3, Z3) = (X1, Y1, 1) + return this.curve.jpoint(this.x, this.y, this.curve.one); + } + + encode(compact) { + // [SEC1] Page 10, Section 2.3.3. + if (compact == null) + compact = true; + + assert(typeof compact === 'boolean'); + + const {fieldSize} = this.curve; + + // We do not serialize points at infinity. + if (this.inf) + throw new Error('Invalid point.'); + + // Compressed form (0x02 = even, 0x03 = odd). + if (compact) { + const p = bufferExports.Buffer.alloc(1 + fieldSize); + const x = this.curve.encodeField(this.getX()); + + p[0] = 0x02 | this.y.redIsOdd(); + x.copy(p, 1); + + return p; + } + + // Uncompressed form (0x04). + const p = bufferExports.Buffer.alloc(1 + fieldSize * 2); + const x = this.curve.encodeField(this.getX()); + const y = this.curve.encodeField(this.getY()); + + p[0] = 0x04; + x.copy(p, 1); + y.copy(p, 1 + fieldSize); + + return p; + } + + static decode(curve, bytes) { + // [SEC1] Page 11, Section 2.3.4. + assert(curve instanceof ShortCurve); + assert(bufferExports.Buffer.isBuffer(bytes)); + + const len = curve.fieldSize; + + if (bytes.length < 1 + len) + throw new Error('Not a point.'); + + // Point forms: + // + // 0x00 -> Infinity (openssl, unsupported) + // 0x02 -> Compressed Even + // 0x03 -> Compressed Odd + // 0x04 -> Uncompressed + // 0x06 -> Hybrid Even (openssl) + // 0x07 -> Hybrid Odd (openssl) + // + // Note that openssl supports serializing points + // at infinity as {0}. We choose not to support it + // because it's strange and not terribly useful. + const form = bytes[0]; + + switch (form) { + case 0x02: + case 0x03: { + if (bytes.length !== 1 + len) + throw new Error('Invalid point size for compressed.'); + + const x = curve.decodeField(bytes.slice(1, 1 + len)); + + if (x.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + const p = curve.pointFromX(x, form === 0x03); + + assert(!p.isInfinity()); + + return p; + } + + case 0x04: + case 0x06: + case 0x07: { + if (bytes.length !== 1 + len * 2) + throw new Error('Invalid point size for uncompressed.'); + + const x = curve.decodeField(bytes.slice(1, 1 + len)); + const y = curve.decodeField(bytes.slice(1 + len, 1 + 2 * len)); + + // [GECC] Algorithm 4.3, Page 180, Section 4. + if (x.cmp(curve.p) >= 0 || y.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + // OpenSSL hybrid encoding. + if (form !== 0x04 && form !== (0x06 | y.isOdd())) + throw new Error('Invalid hybrid encoding.'); + + const p = curve.point(x, y); + + if (!p.validate()) + throw new Error('Invalid point.'); + + assert(!p.isInfinity()); + + return p; + } + + default: { + throw new Error('Unknown point format.'); + } + } + } + + encodeX() { + // [SCHNORR] "Specification". + // [BIP340] "Specification". + return this.curve.encodeField(this.getX()); + } + + static decodeEven(curve, bytes) { + // [BIP340] "Specification". + assert(curve instanceof ShortCurve); + + const x = curve.decodeField(bytes); + + if (x.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + return curve.pointFromX(x, false); + } + + static decodeSquare(curve, bytes) { + // [SCHNORR] "Specification". + assert(curve instanceof ShortCurve); + + const x = curve.decodeField(bytes); + + if (x.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + return curve.pointFromX(x); + } + + toJSON(pre) { + if (this.inf) + return []; + + const x = this.getX().toJSON(); + const y = this.getY().toJSON(); + + if (pre === true && this.pre) + return [x, y, this.pre.toJSON()]; + + return [x, y]; + } + + toPretty() { + if (this.inf) + return []; + + const size = this.curve.fieldSize * 2; + const x = toPretty(this.getX(), size); + const y = toPretty(this.getY(), size); + + return [x, y]; + } + + static fromJSON(curve, json) { + assert(curve instanceof ShortCurve); + assert(Array.isArray(json)); + assert(json.length === 0 + || json.length === 2 + || json.length === 3); + + if (json.length === 0) + return curve.point(); + + const x = BN.fromJSON(json[0]); + const y = BN.fromJSON(json[1]); + const point = curve.point(x, y); + + if (json.length > 2 && json[2] != null) + point.pre = Precomp.fromJSON(point, json[2]); + + return point; + } + + [custom]() { + if (this.inf) + return ''; + + return ''; + } + } + + /** + * JPoint + */ + + class JPoint extends Point { + constructor(curve, x, y, z) { + assert(curve instanceof ShortCurve); + + super(curve, types.JACOBIAN); + + this.x = this.curve.one; + this.y = this.curve.one; + this.z = this.curve.zero; + this.zOne = false; + + if (x != null) + this._init(x, y, z); + } + + _init(x, y, z) { + assert(x instanceof BN); + assert(y instanceof BN); + assert(z == null || (z instanceof BN)); + + this.x = x; + this.y = y; + this.z = z || this.curve.one; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + + this.zOne = this.z.eq(this.curve.one); + } + + clone() { + return this.curve.jpoint(this.x, this.y, this.z); + } + + validate() { + // [GECC] Example 3.20, Page 88, Section 3. + const {a, b} = this.curve; + + // P = O + if (this.isInfinity()) + return true; + + // Z1 = 1 + if (this.zOne) + return this.curve.validate(this.toP()); + + // y^2 = x^3 + a * x * z^4 + b * z^6 + const lhs = this.y.redSqr(); + const x3 = this.x.redSqr().redMul(this.x); + const z2 = this.z.redSqr(); + const z4 = z2.redSqr(); + const z6 = z4.redMul(z2); + const rhs = x3.redIAdd(b.redMul(z6)); + + if (!this.curve.zeroA) { + // Save some cycles for a = -3. + if (this.curve.threeA) + rhs.redIAdd(z4.redIMuln(-3).redMul(this.x)); + else + rhs.redIAdd(a.redMul(z4).redMul(this.x)); + } + + return lhs.eq(rhs); + } + + normalize() { + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#scaling-z + // 1I + 3M + 1S + + // Z = 1 + if (this.zOne) + return this; + + // P = O + if (this.isInfinity()) + return this; + + // A = 1 / Z1 + const a = this.z.redInvert(); + + // AA = A^2 + const aa = a.redSqr(); + + // X3 = X1 * AA + this.x = this.x.redMul(aa); + + // Y3 = Y1 * AA * A + this.y = this.y.redMul(aa).redMul(a); + + // Z3 = 1 + this.z = this.curve.one; + this.zOne = true; + + return this; + } + + scale(a) { + assert(a instanceof BN); + + // P = O + if (this.isInfinity()) + return this.curve.jpoint(); + + // AA = A^2 + const aa = a.redSqr(); + + // X3 = X1 * AA + const nx = this.x.redMul(aa); + + // Y3 = Y1 * AA * A + const ny = this.y.redMul(aa).redMul(a); + + // Z3 = Z1 * A + const nz = this.z.redMul(a); + + return this.curve.jpoint(nx, ny, nz); + } + + neg() { + // -(X1, Y1, Z1) = (X1, -Y1, Z1) + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); + } + + add(p) { + assert(p instanceof Point); + + if (p.type === types.AFFINE) + return this._mixedAdd(p); + + return this._add(p); + } + + _add(p) { + assert(p instanceof JPoint); + + // O + P = P + if (this.isInfinity()) + return p; + + // P + O = P + if (p.isInfinity()) + return this; + + // Z1 = 1 + if (this.zOne) + return p._addJA(this); + + // Z2 = 1 + if (p.zOne) + return this._addJA(p); + + return this._addJJ(p); + } + + _mixedAdd(p) { + assert(p instanceof ShortPoint); + + // O + P = P + if (this.isInfinity()) + return p.toJ(); + + // P + O = P + if (p.isInfinity()) + return this; + + return this._addJA(p); + } + + _addJJ(p) { + // No assumptions. + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-1998-cmo-2 + // 12M + 4S + 6A + 1*2 (implemented as: 12M + 4S + 7A) + + // Z1Z1 = Z1^2 + const z1z1 = this.z.redSqr(); + + // Z2Z2 = Z2^2 + const z2z2 = p.z.redSqr(); + + // U1 = X1 * Z2Z2 + const u1 = this.x.redMul(z2z2); + + // U2 = X2 * Z1Z1 + const u2 = p.x.redMul(z1z1); + + // S1 = Y1 * Z2 * Z2Z2 + const s1 = this.y.redMul(p.z).redMul(z2z2); + + // S2 = Y2 * Z1 * Z1Z1 + const s2 = p.y.redMul(this.z).redMul(z1z1); + + // H = U2 - U1 + const h = u2.redISub(u1); + + // r = S2 - S1 + const r = s2.redISub(s1); + + // H = 0 + if (h.isZero()) { + if (!r.isZero()) + return this.curve.jpoint(); + + return this.dbl(); + } + + // HH = H^2 + const hh = h.redSqr(); + + // HHH = H * HH + const hhh = h.redMul(hh); + + // V = U1 * HH + const v = u1.redMul(hh); + + // X3 = r^2 - HHH - 2 * V + const nx = r.redSqr().redISub(hhh).redISub(v).redISub(v); + + // Y3 = r * (V - X3) - S1 * HHH + const ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh)); + + // Z3 = Z1 * Z2 * H + const nz = this.z.redMul(p.z).redMul(h); + + return this.curve.jpoint(nx, ny, nz); + } + + _addJA(p) { + // Assumes Z2 = 1. + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-madd + // 8M + 3S + 6A + 5*2 (implemented as: 8M + 3S + 7A + 4*2) + + // Z1Z1 = Z1^2 + const z1z1 = this.z.redSqr(); + + // U2 = X2 * Z1Z1 + const u2 = p.x.redMul(z1z1); + + // S2 = Y2 * Z1 * Z1Z1 + const s2 = p.y.redMul(this.z).redMul(z1z1); + + // H = U2 - X1 + const h = u2.redISub(this.x); + + // r = 2 * (S2 - Y1) + const r = s2.redISub(this.y).redIMuln(2); + + // H = 0 + if (h.isZero()) { + if (!r.isZero()) + return this.curve.jpoint(); + + return this.dbl(); + } + + // I = (2 * H)^2 + const i = h.redMuln(2).redSqr(); + + // J = H * I + const j = h.redMul(i); + + // V = X1 * I + const v = this.x.redMul(i); + + // X3 = r^2 - J - 2 * V + const nx = r.redSqr().redISub(j).redISub(v).redISub(v); + + // Y3 = r * (V - X3) - 2 * Y1 * J + const ny = r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2)); + + // Z3 = 2 * Z1 * H + const nz = this.z.redMul(h).redIMuln(2); + + return this.curve.jpoint(nx, ny, nz); + } + + dbl() { + // P = O + if (this.isInfinity()) + return this; + + // Y1 = 0 + if (this.y.isZero()) + return this.curve.jpoint(); + + // a = 0 + if (this.curve.zeroA) + return this._dbl0(); + + // a = -3 + if (this.curve.threeA) + return this._dbl3(); + + return this._dblJ(); + } + + _dblJ() { + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-1998-cmo-2 + // 3M + 6S + 4A + 1*a + 2*2 + 1*3 + 1*4 + 1*8 + // (implemented as: 3M + 6S + 5A + 1*a + 1*2 + 1*3 + 1*4 + 1*8) + + // XX = X1^2 + const xx = this.x.redSqr(); + + // YY = Y1^2 + const yy = this.y.redSqr(); + + // ZZ = Z1^2 + const zz = this.z.redSqr(); + + // S = 4 * X1 * YY + const s = this.x.redMul(yy).redIMuln(4); + + // M = 3 * XX + a * ZZ^2 + const m = xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr())); + + // T = M^2 - 2 * S + const t = m.redSqr().redISub(s).redISub(s); + + // X3 = T + const nx = t; + + // Y3 = M * (S - T) - 8 * YY^2 + const ny = m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8)); + + // Z3 = 2 * Y1 * Z1 + const nz = this.y.redMul(this.z).redIMuln(2); + + return this.curve.jpoint(nx, ny, nz); + } + + _dbl0() { + // Assumes a = 0. + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l + // 2M + 5S + 6A + 3*2 + 1*3 + 1*8 + // (implemented as: 2M + 5S + 7A + 2*2 + 1*3 + 1*8) + + // A = X1^2 + const a = this.x.redSqr(); + + // B = Y1^2 + const b = this.y.redSqr(); + + // C = B^2 + const c = b.redSqr(); + + // + XB2 = (X1 + B)^2 + const xb2 = b.redIAdd(this.x).redSqr(); + + // D = 2 * ((X1 + B)^2 - A - C) + const d = xb2.redISub(a).redISub(c).redIMuln(2); + + // E = 3 * A + const e = a.redIMuln(3); + + // F = E^2 + const f = e.redSqr(); + + // X3 = F - 2 * D + const nx = f.redISub(d).redISub(d); + + // Y3 = E * (D - X3) - 8 * C + const ny = e.redMul(d.redISub(nx)).redISub(c.redIMuln(8)); + + // Z3 = 2 * Y1 * Z1 + const nz = this.y.redMul(this.z).redIMuln(2); + + return this.curve.jpoint(nx, ny, nz); + } + + _dbl3() { + // Assumes a = -3. + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b + // 3M + 5S + 8A + 1*3 + 1*4 + 2*8 + // (implemented as: 3M + 5S + 8A + 1*2 + 1*3 + 1*4 + 1*8) + + // delta = Z1^2 + const delta = this.z.redSqr(); + + // gamma = Y1^2 + const gamma = this.y.redSqr(); + + // beta = X1 * gamma + const beta = this.x.redMul(gamma); + + // + xmdelta = X1 - delta + const xmdelta = this.x.redSub(delta); + + // + xpdelta = X1 + delta + const xpdelta = this.x.redAdd(delta); + + // alpha = 3 * (X1 - delta) * (X1 + delta) + const alpha = xmdelta.redMul(xpdelta).redIMuln(3); + + // + beta4 = 4 * beta + const beta4 = beta.redIMuln(4); + + // + beta8 = 2 * beta4 + const beta8 = beta4.redMuln(2); + + // + gamma28 = 8 * gamma^2 + const gamma28 = gamma.redSqr().redIMuln(8); + + // X3 = alpha^2 - 8 * beta + const nx = alpha.redSqr().redISub(beta8); + + // Z3 = (Y1 + Z1)^2 - gamma - delta + const nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + + // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 + const ny = alpha.redMul(beta4.redISub(nx)).redISub(gamma28); + + return this.curve.jpoint(nx, ny, nz); + } + + getX() { + if (this.isInfinity()) + throw new Error('Invalid point.'); + + this.normalize(); + + return this.x.fromRed(); + } + + getY() { + if (this.isInfinity()) + throw new Error('Invalid point.'); + + this.normalize(); + + return this.y.fromRed(); + } + + eq(p) { + assert(p instanceof JPoint); + + // P = Q + if (this === p) + return true; + + // P = O + if (this.isInfinity()) + return p.isInfinity(); + + // Q = O + if (p.isInfinity()) + return false; + + // Z1 = Z2 + if (this.z.eq(p.z)) { + return this.x.eq(p.x) + && this.y.eq(p.y); + } + + // X1 * Z2^2 = X2 * Z1^2 + const zz1 = this.z.redSqr(); + const zz2 = p.z.redSqr(); + const x1 = this.x.redMul(zz2); + const x2 = p.x.redMul(zz1); + + if (!x1.eq(x2)) + return false; + + // Y1 * Z2^3 = Y2 * Z1^3 + const zzz1 = zz1.redMul(this.z); + const zzz2 = zz2.redMul(p.z); + const y1 = this.y.redMul(zzz2); + const y2 = p.y.redMul(zzz1); + + return y1.eq(y2); + } + + cmp(point) { + assert(point instanceof JPoint); + + const inf1 = this.isInfinity(); + const inf2 = point.isInfinity(); + + if (inf1 && !inf2) + return -1; + + if (!inf1 && inf2) + return 1; + + if (inf1 && inf2) + return 0; + + return this.order().cmp(point.order()) + || this.getX().cmp(point.getX()) + || this.getY().cmp(point.getY()); + } + + isInfinity() { + // Z1 = 0 + return this.z.isZero(); + } + + isOrder2() { + if (this.isInfinity()) + return false; + + return this.y.isZero(); + } + + isOdd() { + if (this.isInfinity()) + return false; + + this.normalize(); + + return this.y.redIsOdd(); + } + + isEven() { + if (this.isInfinity()) + return false; + + this.normalize(); + + return this.y.redIsEven(); + } + + isSquare() { + if (this.isInfinity()) + return false; + + return this.y.redMul(this.z).redJacobi() !== -1; + } + + eqX(x) { + // Verify that integer `x` is equal to field + // element `x` by scaling it by our z coordinate. + // This optimization is mentioned in and used for + // bip-schnorr[1]. This avoids having to affinize + // the resulting point during verification. + // + // [1] [SCHNORR] "Optimizations". + assert(x instanceof BN); + assert(!x.red); + + if (this.isInfinity()) + return false; + + const zz = this.z.redSqr(); + const rx = x.toRed(this.curve.red).redMul(zz); + + return this.x.eq(rx); + } + + eqR(x) { + // Similar to the optimization above, this + // optimization, suggested by Maxwell[1], + // compares an integer to an X coordinate + // by scaling it. + // + // Since a signature's R value is modulo N + // in ECDSA, we may be dealing with an R + // value greater than N in actuality. + // + // If the equality check fails, we can + // scale N itself by Z and add it to the + // X field element. + // + // [1] https://github.com/bitcoin-core/secp256k1/commit/ce7eb6f + assert(x instanceof BN); + assert(!x.red); + + if (!this.curve.smallGap) + return this.toP().eqR(x); + + if (this.isInfinity()) + return false; + + if (x.cmp(this.curve.p) >= 0) + return false; + + const zz = this.z.redSqr(); + const rx = x.toRed(this.curve.red).redMul(zz); + + if (this.x.eq(rx)) + return true; + + if (this.curve.highOrder) + return false; + + if (x.cmp(this.curve.pmodn) >= 0) + return false; + + const rn = this.curve.redN.redMul(zz); + + rx.redIAdd(rn); + + return this.x.eq(rx); + } + + toP() { + // P = O + if (this.isInfinity()) + return this.curve.point(); + + this.normalize(); + + // (X3, Y3) = (X1 / Z1^2, Y1 / Z1^3) + return this.curve.point(this.x, this.y); + } + + toJ() { + return this; + } + + encode(compact) { + return this.toP().encode(compact); + } + + static decode(curve, bytes) { + return ShortPoint.decode(curve, bytes).toJ(); + } + + encodeX() { + return this.toP().encodeX(); + } + + static decodeEven(curve, bytes) { + return ShortPoint.decodeEven(curve, bytes).toJ(); + } + + static decodeSquare(curve, bytes) { + return ShortPoint.decodeSquare(curve, bytes).toJ(); + } + + toJSON(pre) { + return this.toP().toJSON(pre); + } + + toPretty() { + return this.toP().toPretty(); + } + + static fromJSON(curve, json) { + return ShortPoint.fromJSON(curve, json).toJ(); + } + + [custom]() { + if (this.isInfinity()) + return ''; + + return ''; + } + } + + /** + * MontCurve + */ + + class MontCurve extends Curve { + constructor(conf) { + super(MontPoint, 'mont', conf); + + this.a = BN.fromJSON(conf.a).toRed(this.red); + this.b = BN.fromJSON(conf.b).toRed(this.red); + + this.bi = this.b.redInvert(); + this.a2 = this.a.redAdd(this.two); + this.a24 = this.a2.redMul(this.i4); + this.a3 = this.a.redMul(this.i3); + this.a0 = this.a.redMul(this.bi); + this.b0 = this.bi.redSqr(); + + this._finalize(conf); + } + + static _isomorphism(curveA, curveB, customB) { + // Montgomery Isomorphism. + // + // [MONT3] Page 3, Section 2.1. + // + // Transformation: + // + // A' = A + // B' = B' + // + // Where (B / B') is square. + assert(curveA instanceof BN); + assert(curveB instanceof BN); + assert(customB instanceof BN); + + const a = curveA.clone(); + const b = customB.clone(); + const c = curveB.redDiv(customB); + + if (c.redJacobi() !== 1) + throw new Error('Invalid `b` coefficient.'); + + return [a, b]; + } + + _short(a0, odd) { + // Montgomery->Short Weierstrass Equivalence. + // + // [MONT2] "Equivalence with Weierstrass curves". + // + // Transformation: + // + // a = (3 - A^2) / (3 * B^2) + // b = (2 * A^3 - 9 * A) / (27 * B^3) + const {a, b, three} = this; + const a2 = a.redSqr(); + const a3 = a2.redMul(a); + const b2 = b.redSqr(); + const b3 = b2.redMul(b); + const n0 = three.redSub(a2); + const d0 = b2.redMuln(3); + const n1 = a3.redMuln(2).redISub(a.redMuln(9)); + const d1 = b3.redMuln(27); + const wa = n0.redDiv(d0); + const wb = n1.redDiv(d1); + + if (a0 != null) + return ShortCurve._isomorphism(wa, wb, a0, odd); + + return [wa, wb]; + } + + _mont(b0) { + return MontCurve._isomorphism(this.a, this.b, b0); + } + + _edwards(a0, invert = false) { + // Montgomery->Twisted Edwards Transformation. + // + // [MONT1] Page 11, Section 4.3.5. + // [TWISTED] Theorem 3.2, Page 4, Section 3. + // + // Equivalence: + // + // a = (A + 2) / B + // d = (A - 2) / B + // + // Isomorphism: + // + // a = a' + // d = a' * (A - 2) / (A + 2) + // + // Where ((A + 2) / (B * a')) is square. + // + // If `d` is square, we can usually find + // a complete curve by using the `invert` + // option. This will create an isomorphism + // chain of: M(A,B)->E(a,d)->E(d,a). + // + // The equivalence between E(a,d) and + // E(d,a) is: + // + // (x, y) = (x, 1 / y) + // + // Meaning our map to E(d,a) is: + // + // x = u / v + // y = 1 / ((u - 1) / (u + 1)) + // = (u + 1) / (u - 1) + assert(typeof invert === 'boolean'); + + const {two, bi} = this; + const a = this.a.redAdd(two).redMul(bi); + const d = this.a.redSub(two).redMul(bi); + + if (invert) + a.swap(d); + + if (a0 != null) + return EdwardsCurve._isomorphism(a, d, a0); + + return [a, d]; + } + + _scaleShort(curve) { + assert(curve instanceof ShortCurve); + + const [u2, u3] = curve._scale(this); + + return [this.field(u2.redInvert()), + this.field(u3.redInvert())]; + } + + _scaleMont(curve) { + // We can extract the isomorphism factor with: + // + // c = +-sqrt(B / B') + // + // If base points are available, we can do: + // + // c = v' / v + assert(curve instanceof MontCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) + return this.field(curve.b).redDivSqrt(this.b); + + return this.g.y.redDiv(this.field(curve.g.y)); + } + + _scaleEdwards(curve, invert) { + // We _could_ do something like: + // + // B = 4 / (a - d) + // c = +-sqrt(B / B') + // + // Which can be reduced to: + // + // c = +-sqrt(4 / ((a - d) * B')) + // + // If base points are available: + // + // v = u' / x + // c = v' / v + // + // Which can be reduced to: + // + // c = v' * x / u' + // + // However, the way our maps are + // written, we can re-use the Edwards + // isomorphism factor when going the + // other direction. + assert(curve instanceof EdwardsCurve); + + const c = curve._scale(this, invert); + + return this.field(c); + } + + _solveY0(x) { + assert(x instanceof BN); + + // y^2 = x^3 + A * x^2 + B * x + const a = this.a0; + const b = this.b0; + const x2 = x.redSqr(); + const x3 = x2.redMul(x); + const y2 = x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x)); + + return y2; + } + + _elligator2(u) { + // Elligator 2. + // + // Distribution: 1/2. + // + // [ELL2] Page 11, Section 5.2. + // [H2EC] "Elligator 2 Method". + // "Mappings for Montgomery curves". + // [SAFE] "Indistinguishability from uniform random strings". + // + // Assumptions: + // + // - y^2 = x^3 + A * x^2 + B * x. + // - A != 0, B != 0. + // - A^2 - 4 * B is non-zero and non-square in F(p). + // - Let z be a non-square in F(p). + // - u != +-sqrt(-1 / z). + // + // Note that Elligator 2 is defined over the form: + // + // y'^2 = x'^3 + A' * x'^2 + B' * x' + // + // Instead of: + // + // B * y^2 = x^3 + A * x^2 + x + // + // Where: + // + // A' = A / B + // B' = 1 / B^2 + // x' = x / B + // y' = y / B + // + // And: + // + // x = B * x' + // y = B * y' + // + // This is presumably the result of Elligator 2 + // being designed in long Weierstrass form. If + // we want to support B != 1, we need to do the + // conversion. + // + // Map: + // + // g(x) = x^3 + A * x^2 + B * x + // x1 = -A / (1 + z * u^2) + // x1 = -A, if x1 = 0 + // x2 = -x1 - A + // x = x1, if g(x1) is square + // = x2, otherwise + // y = sign(u) * abs(sqrt(g(x))) + const lhs = this.a0.redNeg(); + const rhs = this.one.redAdd(this.z.redMul(u.redSqr())); + + if (rhs.isZero()) + rhs.inject(this.one); + + const x1 = lhs.redMul(rhs.redInvert()); + const x2 = x1.redNeg().redISub(this.a0); + const y1 = this._solveY0(x1); + const y2 = this._solveY0(x2); + const alpha = y1.redIsSquare() | 0; + const x0 = [x1, x2][alpha ^ 1]; + const y0 = [y1, y2][alpha ^ 1].redSqrt(); + + if (y0.redIsOdd() !== u.redIsOdd()) + y0.redINeg(); + + const x = this.b.redMul(x0); + const y = this.b.redMul(y0); + + return this.point(x, y); + } + + _invert2(p, hint) { + // Inverting the Map (Elligator 2). + // + // [ELL2] Page 12, Section 5.3. + // + // Assumptions: + // + // - -z * x * (x + A) is square in F(p). + // - If r = 1 then x != 0. + // - If r = 2 then x != -A. + // + // Map: + // + // u1 = -(x + A) / (x * z) + // u2 = -x / ((x + A) * z) + // r = random integer in [1,2] + // u = sign(y) * abs(sqrt(ur)) + // + // Note that `0 / 0` can only occur if A = 0 + // (this violates the assumptions of Elligator 2). + const {x, y} = p; + const r = hint & 1; + const x0 = x.redMul(this.bi); + const y0 = y.redMul(this.bi); + const n = x0.redAdd(this.a0); + const d = x0; + const lhs = [n, d][r].redINeg(); + const rhs = [d, n][r].redMul(this.z); + const u = lhs.redDivSqrt(rhs); + + if (u.redIsOdd() !== y0.redIsOdd()) + u.redINeg(); + + return u; + } + + isElliptic() { + const a2 = this.a.redSqr(); + const d = this.b.redMul(a2.redSub(this.four)); + + // B * (A^2 - 4) != 0 + return !d.isZero(); + } + + jinv() { + // [MONT3] Page 3, Section 2. + const {a, three, four} = this; + const a2 = a.redSqr(); + const t0 = a2.redSub(three); + const lhs = t0.redPown(3).redIMuln(256); + const rhs = a2.redSub(four); + + if (rhs.isZero()) + throw new Error('Curve is not elliptic.'); + + // (256 * (A^2 - 3)^3) / (A^2 - 4) + return lhs.redDiv(rhs).fromRed(); + } + + point(x, y) { + return new MontPoint(this, x, y); + } + + jpoint(x, y, z) { + assert(x == null && y == null && z == null); + return this.point(); + } + + xpoint(x, z) { + return new XPoint(this, x, z); + } + + solveY2(x) { + // [MONT3] Page 3, Section 2. + // https://hyperelliptic.org/EFD/g1p/auto-montgom.html + assert(x instanceof BN); + + // B * y^2 = x^3 + A * x^2 + x + const x2 = x.redSqr(); + const x3 = x2.redMul(x); + const by2 = x3.redIAdd(this.a.redMul(x2)).redIAdd(x); + const y2 = by2.redMul(this.bi); + + return y2; + } + + validate(point) { + assert(point instanceof MontPoint); + + if (point.isInfinity()) + return true; + + const {x, y} = point; + const y2 = this.solveY2(x); + + return y.redSqr().eq(y2); + } + + pointFromX(x, sign = null) { + assert(x instanceof BN); + assert(sign == null || typeof sign === 'boolean'); + + if (!x.red) + x = x.toRed(this.red); + + const y = this.solveY(x); + + if (sign != null) { + if (y.isZero() && sign) + throw new Error('Invalid point.'); + + if (y.redIsOdd() !== sign) + y.redINeg(); + } + + return this.point(x, y); + } + + isIsomorphic(curve, invert) { + // [MONT3] Page 3, Section 2.1. + assert(curve instanceof Curve); + + if (!curve.p.eq(this.p)) + return false; + + // M(A,B) <-> M(A,B') + if (curve.type === 'mont') { + const a = this.field(curve.a); + const b = this.field(curve.b); + + // A' = A + if (!this.a.eq(a)) + return false; + + // B' != 0 + if (this.b.isZero()) + return false; + + // jacobi(B / B') = 1 + const c = b.redDiv(this.b); + + return c.redJacobi() === 1; + } + + return curve.isIsomorphic(this, invert); + } + + isIsogenous(curve) { + assert(curve instanceof Curve); + + if (curve.type === 'mont') + return false; + + return curve.isIsogenous(this); + } + + pointFromShort(point) { + // [ALT] Appendix E.2 (Switching between Alternative Representations). + // [MONT2] "Equivalence with Weierstrass curves" + assert(point instanceof ShortPoint); + + if (this.isIsomorphic(point.curve)) { + // Equivalence for E(a,b)->M(A,B): + // + // u = B * x - A / 3 + // v = B * y + // + // Undefined if ((u^3 + A * u^2 + u) / B) is not square. + if (point.isInfinity()) + return this.point(); + + const {a3, b} = this; + const [u2, u3] = this._scale(point.curve); + const x = this.field(point.x).redMul(u2); + const y = this.field(point.y).redMul(u3); + const u = b.redMul(x).redISub(a3); + const v = b.redMul(y); + + return this.point(u, v); + } + + throw new Error('Not implemented.'); + } + + pointFromMont(point) { + // [MONT3] Page 3, Section 2.1. + assert(point instanceof MontPoint); + + if (this.isIsomorphic(point.curve)) { + // Isomorphic maps for M(A,B)<->M(A,B'): + // + // u' = u + // v' = +-sqrt(B / B') * v + // + // Undefined if (B / B') is not square. + if (point.isInfinity()) + return this.point(); + + const c = this._scale(point.curve); + const u = this.field(point.x); + const v = this.field(point.y); + const nu = u; + const nv = c.redMul(v); + + return this.point(nu, nv); + } + + throw new Error('Not implemented.'); + } + + pointFromEdwards(point) { + // [RFC7748] Section 4.1 & 4.2. + // [MONT3] Page 6, Section 2.5. + // [TWISTED] Theorem 3.2, Page 4, Section 3. + assert(point instanceof EdwardsPoint); + assert(point.curve.p.eq(this.p)); + + // Edwards `x`, `y`, `z`. + const x = this.field(point.x); + const y = this.field(point.y); + const z = this.field(point.z); + + if (this.isIsogenous(point.curve)) { + // 4-isogeny maps for E(1,d)->M(2-4d,1): + // + // u = y^2 / x^2 + // v = (2 - x^2 - y^2) * y / x^3 + // + // Undefined for x = 0. + // + // Exceptional Cases: + // - (0, 1) -> O + // - (0, -1) -> (0, 0) + // + // Unexceptional Cases: + // - (+-1, 0) -> (0, 0) + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.zero); + + const c = z.redSqr().redIMuln(2); + const uu = y.redSqr(); + const uz = x.redSqr(); + const vv = c.redISub(uz).redISub(uu).redMul(y); + const vz = uz.redMul(x); + + return this.cpoint(uu, uz, vv, vz); + } + + if (this.isIsomorphic(point.curve, true)) { + // Isomorphic maps for E(d,a)->M(A,B): + // + // u = (y + 1) / (y - 1) + // v = +-sqrt((A - 2) / (B * a)) * u / x + // + // Undefined for x = 0 or y = 1. + // + // Exceptional Cases: + // - (0, 1) -> O + // - (0, -1) -> (0, 0) + // + // Unexceptional Cases: + // - (+-sqrt(1 / a), 0) -> (-1, +-sqrt((A - 2) / B)) + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.zero); + + const c = this._scale(point.curve, true); + const uu = y.redAdd(z); + const uz = y.redSub(z); + const vv = c.redMul(z).redMul(uu); + const vz = x.redMul(uz); + + return this.cpoint(uu, uz, vv, vz); + } + + if (this.isIsomorphic(point.curve, false)) { + // Isomorphic maps for E(a,d)->M(A,B): + // + // u = (1 + y) / (1 - y) + // v = +-sqrt((A + 2) / (B * a)) * u / x + // + // Undefined for x = 0 or y = 1. + // + // Exceptional Cases: + // - (0, 1) -> O + // - (0, -1) -> (0, 0) + // + // Unexceptional Cases: + // - (+-sqrt(1 / a), 0) -> (1, +-sqrt((A + 2) / B)) + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.zero); + + const c = this._scale(point.curve, false); + const uu = z.redAdd(y); + const uz = z.redSub(y); + const vv = c.redMul(z).redMul(uu); + const vz = x.redMul(uz); + + return this.cpoint(uu, uz, vv, vz); + } + + throw new Error('Not implemented.'); + } + + pointFromUniform(u) { + assert(u instanceof BN); + + // z = 0 or A = 0 + if (this.z.isZero() || this.a.isZero()) + throw new Error('Not implemented.'); + + return this._elligator2(u); + } + + pointToUniform(p, hint) { + // Convert a montgomery point to a field + // element by inverting the elligator2 map. + // + // Hint Layout: + // + // [00000000] [0000] [0000] + // | | | + // | | +-- preimage index + // | +--- subgroup + // +-- bits to OR with uniform bytes + assert(p instanceof MontPoint); + assert((hint >>> 0) === hint); + + // z = 0 or A = 0 + if (this.z.isZero() || this.a.isZero()) + throw new Error('Not implemented.'); + + // P = O + if (p.isInfinity()) + throw new Error('Invalid point.'); + + // Add a random torsion component. + const i = ((hint >>> 4) & 15) % this.torsion.length; + const q = p.add(this.torsion[i]); + + return wrapErrors(() => { + return this._invert2(q, hint); + }); + } + + decodePoint(bytes, sign) { + return MontPoint.decode(this, bytes, sign); + } + + encodeX(point) { + assert(point instanceof XPoint); + return point.encode(); + } + + decodeX(bytes) { + return XPoint.decode(this, bytes); + } + + toShort(a0, odd, sign = null) { + const [a, b] = this._short(a0, odd); + + const curve = new ShortCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = curve._scale(this); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromMont(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromMont(this.torsion[i]); + + return curve; + } + + toMont(b0, sign = null) { + const [a, b] = this._mont(b0); + + const curve = new MontCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h, + z: this.z + }); + + if (sign != null) { + const c = curve._scale(this); + + if (c.redIsOdd() !== sign) + c.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromMont(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromMont(this.torsion[i]); + + return curve; + } + + toEdwards(a0, invert, sign = null) { + const [a, d] = this._edwards(a0, invert); + + const curve = new EdwardsCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + d: d, + n: this.n, + h: this.h, + z: this.z + }); + + if (sign != null) { + const c = curve._scale(this, invert); + + if (c.redIsOdd() !== sign) + c.redINeg(); + } + + if (!this.g.isInfinity()) { + curve.g = curve.pointFromMont(this.g); + curve.g.normalize(); + } + + if (curve.isComplete()) { + for (let i = 0; i < this.h.word(0); i++) { + curve.torsion[i] = curve.pointFromMont(this.torsion[i]); + curve.torsion[i].normalize(); + } + } + + return curve; + } + + pointFromJSON(json) { + return MontPoint.fromJSON(this, json); + } + + toJSON(pre) { + const json = super.toJSON(pre); + json.a = this.a.fromRed().toJSON(); + json.b = this.b.fromRed().toJSON(); + return json; + } + } + + /** + * MontPoint + */ + + class MontPoint extends Point { + constructor(curve, x, y) { + assert(curve instanceof MontCurve); + + super(curve, types.AFFINE); + + this.x = this.curve.zero; + this.y = this.curve.zero; + this.inf = true; + + if (x != null) + this._init(x, y); + } + + _init(x, y) { + assert(x instanceof BN); + assert(y instanceof BN); + + this.x = x; + this.y = y; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + + this.inf = false; + } + + clone() { + if (this.inf) + return this.curve.point(); + + return this.curve.point(this.x, this.y); + } + + scale(a) { + return this.clone(); + } + + randomize(rng) { + return this.clone(); + } + + neg() { + // P = O + if (this.inf) + return this; + + // -(X1, Y1) = (X1, -Y1) + return this.curve.point(this.x, this.y.redNeg()); + } + + add(p) { + // [MONT1] Page 8, Section 4.3.2. + // + // Addition Law: + // + // l = (y2 - y1) / (x2 - x1) + // x3 = b * l^2 - a - x1 - x2 + // y3 = l * (x1 - x3) - y1 + // + // 1I + 2M + 1S + 7A + 1*b + assert(p instanceof MontPoint); + + // O + P = P + if (this.inf) + return p; + + // P + O = P + if (p.inf) + return this; + + // P + P, P + -P + if (this.x.eq(p.x)) { + // P + -P = O + if (!this.y.eq(p.y)) + return this.curve.point(); + + // P + P = 2P + return this.dbl(); + } + + // H = X2 - X1 + const h = p.x.redSub(this.x); + + // R = Y2 - Y1 + const r = p.y.redSub(this.y); + + // L = R / H + const l = r.redDiv(h); + + // K = b * L^2 + const k = this.curve.b.redMul(l.redSqr()); + + // X3 = K - a - X1 - X2 + const nx = k.redISub(this.curve.a).redISub(this.x).redISub(p.x); + + // Y3 = L * (X1 - X3) - Y1 + const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); + + return this.curve.point(nx, ny); + } + + dbl() { + // [MONT1] Page 8, Section 4.3.2. + // + // Addition Law (doubling): + // + // l = (3 * x1^2 + 2 * a * x1 + 1) / (2 * b * y1) + // x3 = b * l^2 - a - 2 * x1 + // y3 = l * (x1 - x3) - y1 + // + // 1I + 3M + 2S + 7A + 1*a + 1*b + 1*b + 2*2 + 1*3 + + // P = O + if (this.inf) + return this; + + // Y1 = 0 + if (this.y.isZero()) + return this.curve.point(); + + // M1 = 3 * X1^2 + const m1 = this.x.redSqr().redIMuln(3); + + // M2 = 2 * a * X1 + const m2 = this.curve.a.redMul(this.x).redIMuln(2); + + // M = M1 + M2 + 1 + const m = m1.redIAdd(m2).redIAdd(this.curve.one); + + // Z = 2 * b * Y1 + const z = this.curve.b.redMul(this.y).redIMuln(2); + + // L = M / Z + const l = m.redDiv(z); + + // K = b * L^2 + const k = this.curve.b.redMul(l.redSqr()); + + // X3 = K - a - 2 * X1 + const nx = k.redISub(this.curve.a).redISub(this.x).redISub(this.x); + + // Y3 = L * (X1 - X3) - Y1 + const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); + + return this.curve.point(nx, ny); + } + + getX() { + if (this.inf) + throw new Error('Invalid point.'); + + return this.x.fromRed(); + } + + getY() { + if (this.inf) + throw new Error('Invalid point.'); + + return this.y.fromRed(); + } + + eq(p) { + assert(p instanceof MontPoint); + + // P = Q + if (this === p) + return true; + + // P = O + if (this.inf) + return p.inf; + + // Q = O + if (p.inf) + return false; + + // X1 = X2, Y1 = Y2 + return this.x.eq(p.x) + && this.y.eq(p.y); + } + + cmp(point) { + assert(point instanceof MontPoint); + + if (this.inf && !point.inf) + return -1; + + if (!this.inf && point.inf) + return 1; + + if (this.inf && point.inf) + return 0; + + return this.order().cmp(point.order()) + || this.getX().cmp(point.getX()) + || this.getY().cmp(point.getY()); + } + + isInfinity() { + // Infinity cannot be represented in + // the affine space, except by a flag. + return this.inf; + } + + isOrder2() { + if (this.inf) + return false; + + return this.y.isZero(); + } + + isOdd() { + if (this.inf) + return false; + + return this.y.redIsOdd(); + } + + isEven() { + if (this.inf) + return false; + + return this.y.redIsEven(); + } + + toP() { + return this; + } + + toJ() { + return this; + } + + toX() { + // (X3, Z3) = (1, 0) + if (this.inf) + return this.curve.xpoint(); + + // (X3, Z3) = (X1, 1) + return this.curve.xpoint(this.x, this.curve.one); + } + + encode() { + return this.toX().encode(); + } + + static decode(curve, bytes, sign) { + assert(curve instanceof MontCurve); + return curve.decodeX(bytes).toP(sign); + } + + toJSON(pre) { + if (this.inf) + return []; + + const x = this.getX().toJSON(); + const y = this.getY().toJSON(); + + return [x, y]; + } + + toPretty() { + if (this.inf) + return []; + + const size = this.curve.fieldSize * 2; + const x = toPretty(this.getX(), size); + const y = toPretty(this.getY(), size); + + return [x, y]; + } + + static fromJSON(curve, json) { + assert(curve instanceof MontCurve); + assert(Array.isArray(json)); + assert(json.length === 0 + || json.length === 2 + || json.length === 3); + + if (json.length === 0) + return curve.point(); + + const x = BN.fromJSON(json[0]); + const y = BN.fromJSON(json[1]); + + return curve.point(x, y); + } + + [custom]() { + if (this.inf) + return ''; + + return ''; + } + } + + /** + * XPoint + */ + + class XPoint extends Point { + constructor(curve, x, z) { + assert(curve instanceof MontCurve); + + super(curve, types.PROJECTIVE); + + this.x = this.curve.one; + this.z = this.curve.zero; + + if (x != null) + this._init(x, z); + } + + _init(x, z) { + assert(x instanceof BN); + assert(z == null || (z instanceof BN)); + + this.x = x; + this.z = z || this.curve.one; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + } + + clone() { + return this.curve.xpoint(this.x, this.z); + } + + precompute(power, rng) { + // No-op. + return this; + } + + validate() { + if (this.isInfinity()) + return true; + + // B * y^2 * z = x^3 + A * x^2 * z + x * z^2 + const {x, z} = this; + const x2 = x.redSqr(); + const x3 = x2.redMul(x); + const z2 = z.redSqr(); + const ax2 = this.curve.a.redMul(x2).redMul(z); + const by2 = x3.redIAdd(ax2).redIAdd(x.redMul(z2)); + const y2 = by2.redMul(this.curve.bi); + + // sqrt(y^2 * z^4) = y * z^2 + return y2.redMul(z).redJacobi() !== -1; + } + + normalize() { + // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#scaling-scale + // 1I + 1M + + // P = O + if (this.isInfinity()) + return this; + + // Z1 = 1 + if (this.z.eq(this.curve.one)) + return this; + + // X3 = X1 / Z1 + this.x = this.x.redDiv(this.z); + + // Z3 = 1 + this.z = this.curve.one; + + return this; + } + + scale(a) { + assert(a instanceof BN); + + // P = O + if (this.isInfinity()) + return this.curve.xpoint(); + + // X3 = X1 * A + const nx = this.x.redMul(a); + + // Y3 = Y1 * A + const nz = this.z.redMul(a); + + return this.curve.xpoint(nx, nz); + } + + neg() { + // -(X1, Z1) = (X1, Z1) + return this; + } + + dbl() { + // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 + // 2M + 2S + 4A + 1*a24 + + // A = X1 + Z1 + const a = this.x.redAdd(this.z); + + // AA = A^2 + const aa = a.redSqr(); + + // B = X1 - Z1 + const b = this.x.redSub(this.z); + + // BB = B^2 + const bb = b.redSqr(); + + // C = AA - BB + const c = aa.redSub(bb); + + // X3 = AA * BB + const nx = aa.redMul(bb); + + // Z3 = C * (BB + a24 * C) + const nz = c.redMul(bb.redIAdd(this.curve.a24.redMul(c))); + + return this.curve.xpoint(nx, nz); + } + + diffAddDbl(p2, p3) { + // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#ladder-ladd-1987-m-3 + // 6M + 4S + 8A + 1*a24 + assert(p2 instanceof XPoint); + assert(p3 instanceof XPoint); + + // A = X2 + Z2 + const a = p2.x.redAdd(p2.z); + + // AA = A^2 + const aa = a.redSqr(); + + // B = X2 - Z2 + const b = p2.x.redSub(p2.z); + + // BB = B^2 + const bb = b.redSqr(); + + // E = AA - BB + const e = aa.redSub(bb); + + // C = X3 + Z3 + const c = p3.x.redAdd(p3.z); + + // D = X3 - Z3 + const d = p3.x.redSub(p3.z); + + // DA = D * A + const da = d.redMul(a); + + // CB = C * B + const cb = c.redMul(b); + + // X5 = Z1 * (DA + CB)^2 + const x5 = this.z.redMul(da.redAdd(cb).redSqr()); + + // Z5 = X1 * (DA - CB)^2 + const z5 = this.x.redMul(da.redISub(cb).redSqr()); + + // X4 = AA * BB + const x4 = aa.redMul(bb); + + // Z4 = E * (BB + a24 * E) + const z4 = e.redMul(bb.redIAdd(this.curve.a24.redMul(e))); + + return [ + this.curve.xpoint(x4, z4), + this.curve.xpoint(x5, z5) + ]; + } + + getX() { + if (this.isInfinity()) + throw new Error('Invalid point.'); + + this.normalize(); + + return this.x.fromRed(); + } + + getY(sign) { + return this.toP(sign).getY(); + } + + eq(p) { + assert(p instanceof XPoint); + + // P = Q + if (this === p) + return true; + + // P = O + if (this.isInfinity()) + return p.isInfinity(); + + // Q = O + if (p.isInfinity()) + return false; + + // Z1 = Z2 + if (this.z.eq(p.z)) + return this.x.eq(p.x); + + // X1 * Z2 = X2 * Z1 + const x1 = this.x.redMul(p.z); + const x2 = p.x.redMul(this.z); + + return x1.eq(x2); + } + + cmp(point) { + assert(point instanceof XPoint); + + const inf1 = this.isInfinity(); + const inf2 = point.isInfinity(); + + if (inf1 && !inf2) + return -1; + + if (!inf1 && inf2) + return 1; + + if (inf1 && inf2) + return 0; + + return this.order().cmp(point.order()) + || this.getX().cmp(point.getX()); + } + + isInfinity() { + // Z1 = 0 + return this.z.isZero(); + } + + isOrder2() { + if (this.isInfinity()) + return false; + + return this.x.isZero(); + } + + isOdd() { + return false; + } + + isEven() { + return false; + } + + hasTorsion() { + if (this.isInfinity()) + return false; + + // X1 = 0, Z1 != 0 (edge case) + if (this.x.isZero()) + return true; + + return super.hasTorsion(); + } + + order() { + try { + return this.toP().order(); + } catch (e) { + return new BN(1); + } + } + + jmul(k) { + // Multiply with the Montgomery Ladder. + // + // [MONT3] Algorithm 4, Page 12, Section 4.2. + // + // Note that any clamping is meant to + // be done _outside_ of this function. + assert(k instanceof BN); + assert(!k.red); + + const bits = k.bitLength(); + + let a = this.curve.xpoint(); + let b = this; + + for (let i = bits - 1; i >= 0; i--) { + const bit = k.bit(i); + + if (bit === 0) + [a, b] = this.diffAddDbl(a, b); + else + [b, a] = this.diffAddDbl(b, a); + } + + return a; + } + + jmulBlind(k, rng) { + if (!rng) + return this.jmul(k); + + // Randomize if available. + return this.randomize(rng).jmul(k); + } + + jmulAdd(k1, p2, k2) { + throw new Error('Not implemented.'); + } + + toP(sign = null) { + assert(sign == null || typeof sign === 'boolean'); + + if (this.isInfinity()) + return this.curve.point(); + + this.normalize(); + + return this.curve.pointFromX(this.x, sign); + } + + toJ() { + return this; + } + + toX() { + return this; + } + + key() { + if (this.isInfinity()) + return `${this.curve.uid}:oo`; + + this.normalize(); + + const x = this.getX().toString(16); + + return `${this.curve.uid}:${x}`; + } + + encode() { + // [RFC7748] Section 5. + return this.curve.encodeField(this.getX()); + } + + static decode(curve, bytes) { + assert(curve instanceof MontCurve); + + // [RFC7748] Section 5. + const x = curve.decodeField(bytes); + + // We're supposed to ignore the hi bit + // on montgomery points... I think. If + // we don't, the X25519 test vectors + // break, which is pretty convincing + // evidence. This is a no-op for X448. + x.iumaskn(curve.fieldBits); + + // Note: montgomery points are meant to be + // reduced by the prime and do not have to + // be explicitly validated in order to do + // the montgomery ladder. + const p = curve.xpoint(x, curve.one); + + assert(!p.isInfinity()); + + return p; + } + + toJSON(pre) { + return this.toP().toJSON(pre); + } + + toPretty() { + return this.toP().toPretty(); + } + + static fromJSON(curve, json) { + return MontPoint.fromJSON(curve, json).toX(); + } + + [custom]() { + if (this.isInfinity()) + return ''; + + return ''; + } + } + + /** + * EdwardsCurve + */ + + class EdwardsCurve extends Curve { + constructor(conf) { + super(EdwardsPoint, 'edwards', conf); + + this.a = BN.fromJSON(conf.a).toRed(this.red); + this.d = BN.fromJSON(conf.d).toRed(this.red); + this.s = BN.fromJSON(conf.s || '0').toRed(this.red); + this.si = this.s.isZero() ? this.zero : this.s.redInvert(); + + this.k = this.d.redMuln(2); + this.smi = -this.d.redNeg().word(0); + this.ad6 = this.a.redAdd(this.d).redMul(this.i6); + + this.twisted = !this.a.eq(this.one); + this.oneA = this.a.eq(this.one); + this.mOneA = this.a.eq(this.one.redNeg()); + this.smallD = this.prime != null && this.d.redNeg().length === 1; + this.alt = null; + + this._finalize(conf); + } + + static _isomorphism(curveA, curveD, customA) { + // Twisted Edwards Isomorphism. + // + // [TWISTED] Definition 2.1, Page 3, Section 2. + // + // Transformation: + // + // a' = a' + // d' = a' * d / a + // + // Where (a / a') is square. + assert(curveA instanceof BN); + assert(curveD instanceof BN); + assert(customA instanceof BN); + + const a = customA.clone(); + const d = customA.redMul(curveD).redDiv(curveA); + const c = curveA.redDiv(customA); + + if (c.redJacobi() !== 1) + throw new Error('Invalid `a` coefficient.'); + + return [a, d]; + } + + _short(a0, odd) { + // Twisted Edwards->Short Weierstrass Equivalence. + // + // [TWISTEQ] Section 2. + // + // Transformation: + // + // a' = -(a^2 + 14 * a * d + d^2) / 48 + // b' = (33 * (a^2 * d + a * d^2) - a^3 - d^3) / 864 + const {a, d} = this; + const a2 = a.redSqr(); + const a3 = a2.redMul(a); + const d2 = d.redSqr(); + const d3 = d2.redMul(d); + const ad14 = a.redMul(d).redIMuln(14); + const a2d = a2.redMul(d); + const ad2 = a.redMul(d2); + const t0 = a2d.redIAdd(ad2).redIMuln(33); + const wa = a2.redAdd(ad14).redIAdd(d2).redDivn(-48); + const wb = t0.redISub(a3).redISub(d3).redDivn(864); + + if (a0 != null) + return ShortCurve._isomorphism(wa, wb, a0, odd); + + return [wa, wb]; + } + + _mont(b0, invert = false) { + // Twisted Edwards->Montgomery Transformation. + // + // [TWISTED] Theorem 3.2, Page 4, Section 3. + // + // Equivalence: + // + // A = 2 * (a + d) / (a - d) + // B = 4 / (a - d) + // + // Isomorphism: + // + // A = 2 * (a + d) / (a - d) + // B = B' + // + // Where ((4 / (a - d)) / B') is square. + // + // If `4 / (a - d)` is non-square, we can + // usually force B=1 by using the `invert` + // option. This will create an isomorphism + // chain of: E(a,d)->E(d,a)->M(-A,-B). + // + // The equivalence between E(a,d) and E(d,a) + // is: + // + // (x, y) = (x, 1 / y) + // + // Meaning our map to M(-A,-B) is: + // + // u = (1 + 1 / y) / (1 - 1 / y) + // = (y + 1) / (y - 1) + // v = u / x + assert(typeof invert === 'boolean'); + + let apd, amd; + + if (invert) { + apd = this.d.redAdd(this.a); + amd = this.d.redSub(this.a); + } else { + apd = this.a.redAdd(this.d); + amd = this.a.redSub(this.d); + } + + const z = amd.redInvert(); + const a = apd.redMuln(2).redMul(z); + const b = z.redMuln(4); + + if (b0 != null) + return MontCurve._isomorphism(a, b, b0); + + return [a, b]; + } + + _edwards(a0) { + return EdwardsCurve._isomorphism(this.a, this.d, a0); + } + + _scaleShort(curve) { + assert(curve instanceof ShortCurve); + + const [u2, u3] = curve._scale(this); + + return [this.field(u2.redInvert()), + this.field(u3.redInvert())]; + } + + _scaleMont(curve, invert = false) { + // Calculate isomorphism factor between + // Twisted Edwards and Montgomery with: + // + // a = (A + 2) / B + // c = +-sqrt(a / a') + // + // Which can be reduced to: + // + // c = +-sqrt((A + 2) / (B * a')) + // + // If base points are available, we can do: + // + // x = u / v + // c = x' / x + // + // Which can be reduced to: + // + // c = v * x' / u + // + // We can now calculate the Edwards `x` with: + // + // x' = c * u / v + // + // And likewise, the Montgomery `v`: + // + // v = c * u / x' + assert(curve instanceof MontCurve); + assert(typeof invert === 'boolean'); + + if (this.g.isInfinity() || curve.g.isInfinity()) { + const [a] = curve._edwards(null, invert); + + return this.field(a).redDivSqrt(this.a); + } + + const x = curve.g.x.redDiv(curve.g.y); + + return this.g.x.redDiv(this.field(x)); + } + + _scaleEdwards(curve) { + // We can extract the isomorphism factor with: + // + // c = +-sqrt(a / a') + // + // If base points are available, we can do: + // + // c = x' / x + assert(curve instanceof EdwardsCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) + return this.field(curve.a).redDivSqrt(this.a); + + return this.g.x.redDiv(this.field(curve.g.x)); + } + + _mulA(num) { + assert(num instanceof BN); + + // n * a = n + if (this.oneA) + return num.clone(); + + // n * a = -n + if (this.mOneA) + return num.redNeg(); + + return this.a.redMul(num); + } + + _mulD(num) { + assert(num instanceof BN); + + // -d < 0x4000000 + if (this.smallD) + return num.redMuln(this.smi); + + return this.d.redMul(num); + } + + _elligator1(t) { + // Elligator 1. + // + // Distribution: 1/2. + // + // [ELL1] Page 6, Section 3. + // Page 15, Appendix A. + // [ELL2] Page 7, Section 3.2. + // + // Assumptions: + // + // - Let p be a prime power congruent to 3 mod 4. + // - Let s be a nonzero element of F(p). + // - Let c = 2 / s^2. + // - Let r = c + 1 / c. + // - Let d = -(c + 1)^2 / (c - 1)^2. + // - (s^2 - 2) * (s^2 + 2) != 0. + // - c * (c - 1) * (c + 1) != 0. + // - r != 0. + // - d is not square. + // - x^2 + y^2 = 1 + d * x^2 * y^2. + // - u * v * X * Y * x * (Y + 1) != 0. + // - Y^2 = X^5 + (r^2 - 2) * X^3 + X. + // + // Elligator 1, as devised by Fouque et al, + // takes place on the hyperelliptic curve of: + // + // y^2 = x^5 + (r^2 - 2) * x^3 + x + // + // Not only must our Edwards curve be complete, + // with a prime congruent to 3 mod 4, and a = 1, + // our curve must be isomorphic to a hyperelliptic + // curve of the above form. Roughly one half of + // all Edwards curves are isomorphic to a curve + // of said form. + // + // We can derive the isomorphism with: + // + // c = (d +- 2 * sqrt(-d) - 1) / (d + 1) + // s = +-sqrt(2 / c) + // r = c + 1 / c + // + // Note that even if your curve is an Elligator 1 + // curve, Elligator 2 is probably still preferable, + // as it has nearly the same properties (i.e. the + // same distribution), and is much less complex. + // + // Map: + // + // f(a) = a^((p - 1) / 2) + // u = (1 - t) / (1 + t) + // v = u^5 + (r^2 - 2) * u^3 + u + // X = f(v) * u + // Y = (f(v) * v)^((p + 1) / 4) * f(v) * f(u^2 + 1 / c^2) + // Y = 1, if u = 0 + // x = (c - 1) * s * X * (1 + X) / Y + // y = (r * X - (1 + X)^2) / (r * X + (1 + X)^2) + // + // When t = +-1, we create the hyperelliptic + // 2-torsion point of (0, 0). This needs to be + // mapped to (0, -1) in Edwards form, but the x + // denominator becomes zero. As far as I can + // tell, this is the only exceptional case. + // + // The only other exceptional case initially + // appears to be when the y denominator sums to + // zero (when t = sqrt(4 / r + 1)), however, the + // hyperelliptic `X` is negated by the sign of + // `v`, making this impossible. + const {s, si, i2, one, two} = this; + const c = si.redSqr().redIMuln(2); + const ci = s.redSqr().redMul(i2); + const ci2 = ci.redSqr(); + const r = c.redAdd(ci); + const r2 = r.redSqr().redISub(two); + const cm1 = c.redSub(one); + const uu = one.redSub(t); + const uz = one.redAdd(t); + const u = uz.isZero() ? uz : uu.redDiv(uz); + const u2 = u.redSqr(); + const u3 = u2.redMul(u); + const u5 = u3.redMul(u2); + const v = u5.redAdd(r2.redMul(u3)).redIAdd(u); + const f0 = this.field(v.redJacobi()); + const f1 = this.field(u2.redAdd(ci2).redJacobi()); + const f2 = f0.redMul(f1); + const X = f0.redMul(u); + const Y = f0.redMul(v).redSqrt().redMul(f2); + const X1 = one.redAdd(X); + const rX = r.redMul(X); + const X12 = X1.redSqr(); + const xx = cm1.redMul(s).redMul(X).redMul(X1); + const xz = u.isZero() ? this.one : Y; + const yy = rX.redSub(X12); + const yz = rX.redAdd(X12); + + return this.cpoint(xx, xz, yy, yz); + } + + _invert1(p, hint) { + // Inverting the Map (Elligator 1). + // + // [ELL1] Page 6, Section 3. + // Page 15, Appendix A. + // [ELL2] Page 7, Section 3.3. + // + // Assumptions: + // + // - y + 1 != 0. + // - (1 + n * r)^2 - 1 is square in F(p). + // - If n * r = -2 then x = 2 * s * (c - 1) * f(c) / r. + // - Y = (c - 1) * s * X * (1 + X) / x. + // + // Map: + // + // f(a) = a^((p - 1) / 2) + // n = (y - 1) / (2 * (y + 1)) + // X = -(1 + n * r) + ((1 + n * r)^2 - 1)^((p + 1) / 4) + // z = f((c - 1) * s * X * (1 + X) * x * (X^2 + 1 / c^2)) + // u = z * X + // t = (1 - u) / (1 + u) + const {s, si, i2, one} = this; + const {x, y, z} = p; + const sign = hint & 1; + const c = si.redSqr().redIMuln(2); + const ci = s.redSqr().redMul(i2); + const ci2 = ci.redSqr(); + const r = c.redAdd(ci); + const cm1 = c.redSub(one); + const nn = y.redSub(z); + const nz = y.redAdd(z).redIMuln(2); + const n = nz.isZero() ? nz : nn.redDiv(nz); + const nr1 = one.redAdd(n.redMul(r)); + const w2 = nr1.redSqr().redISub(one); + const w = w2.redSqrt(); + const X = w.redSub(nr1); + const X1 = one.redAdd(X); + const YY = cm1.redMul(s).redMul(X).redMul(X1); + const Y = YY.redMul(x.redMul(z)); + const X2 = X.redSqr().redIAdd(ci2); + const Z = this.field(Y.redMul(X2).redJacobi()); + const u = Z.redMul(X); + const tt = one.redSub(u); + const tz = one.redAdd(u); + const t = tz.isZero() ? tz : tt.redDiv(tz); + + if (t.redIsOdd() !== Boolean(sign)) + t.redINeg(); + + return t; + } + + _alt() { + if (!this.alt) + this.alt = this.toMont(); + + return this.alt; + } + + isElliptic() { + const ad = this.a.redMul(this.d); + const amd = this.a.redSub(this.d); + + // a * d * (a - d) != 0 + return !ad.redMul(amd).isZero(); + } + + jinv() { + // [TWISTED] Definition 2.1, Page 3, Section 2. + const {a, d} = this; + const ad = a.redMul(d); + const amd4 = a.redSub(d).redPown(4); + const a2 = a.redSqr(); + const d2 = d.redSqr(); + const t0 = a2.redAdd(ad.redMuln(14)).redIAdd(d2); + const lhs = t0.redPown(3).redIMuln(16); + const rhs = ad.redMul(amd4); + + if (rhs.isZero()) + throw new Error('Curve is not elliptic.'); + + // 16 * (a^2 + 14 * a * d + d^2)^3 / (a * d * (a - d)^4) + return lhs.redDiv(rhs).fromRed(); + } + + isComplete() { + return this.a.redJacobi() === 1 + && this.d.redJacobi() === -1; + } + + point(x, y, z, t) { + return new EdwardsPoint(this, x, y, z, t); + } + + jpoint(x, y, z) { + assert(x == null && y == null && z == null); + return this.point(); + } + + cpoint(xx, xz, yy, yz) { + assert(xx instanceof BN); + assert(xz instanceof BN); + assert(yy instanceof BN); + assert(yz instanceof BN); + + const x = xx.redMul(yz); + const y = yy.redMul(xz); + const z = xz.redMul(yz); + const t = xx.redMul(yy); + + return this.point(x, y, z, t); + } + + solveX2(y) { + // [RFC8032] Section 5.1.3 & 5.2.3. + assert(y instanceof BN); + + // x^2 = (y^2 - 1) / (d * y^2 - a) + const y2 = y.redSqr(); + const rhs = this._mulD(y2).redISub(this.a); + const lhs = y2.redISub(this.one); + const x2 = lhs.redDiv(rhs); + + return x2; + } + + solveX(y) { + // Optimize with inverse square root trick. + // + // Note that `0 / 0` can only occur if + // `a == d` (i.e. the curve is singular). + const y2 = y.redSqr(); + const rhs = this._mulD(y2).redISub(this.a); + const lhs = y2.redISub(this.one); + + return lhs.redDivSqrt(rhs); + } + + solveY2(x) { + assert(x instanceof BN); + + // y^2 = (a * x^2 - 1) / (d * x^2 - 1) + const x2 = x.redSqr(); + const lhs = this._mulA(x2).redISub(this.one); + const rhs = this._mulD(x2).redISub(this.one); + const y2 = lhs.redDiv(rhs); + + return y2; + } + + solveY(x) { + // Optimize with inverse square root trick. + // + // Note that `0 / 0` can only occur if + // `a == d` (i.e. the curve is singular). + const x2 = x.redSqr(); + const lhs = this._mulA(x2).redISub(this.one); + const rhs = this._mulD(x2).redISub(this.one); + + return lhs.redDivSqrt(rhs); + } + + validate(point) { + // [TWISTED] Definition 2.1, Page 3, Section 2. + // Page 11, Section 6. + assert(point instanceof EdwardsPoint); + + // Z1 = 1 + if (point.zOne) { + // a * x^2 + y^2 = 1 + d * x^2 * y^2 + const x2 = point.x.redSqr(); + const y2 = point.y.redSqr(); + const dxy = this._mulD(x2).redMul(y2); + const lhs = this._mulA(x2).redIAdd(y2); + const rhs = this.one.redAdd(dxy); + const tz = point.t; + const xy = point.x.redMul(point.y); + + return lhs.eq(rhs) && tz.eq(xy); + } + + // (a * x^2 + y^2) * z^2 = z^4 + d * x^2 * y^2 + const x2 = point.x.redSqr(); + const y2 = point.y.redSqr(); + const z2 = point.z.redSqr(); + const z4 = z2.redSqr(); + const dxy = this._mulD(x2).redMul(y2); + const lhs = this._mulA(x2).redIAdd(y2).redMul(z2); + const rhs = z4.redIAdd(dxy); + const tz = point.t.redMul(point.z); + const xy = point.x.redMul(point.y); + + return lhs.eq(rhs) && tz.eq(xy); + } + + pointFromX(x, sign = null) { + assert(x instanceof BN); + assert(sign == null || typeof sign === 'boolean'); + + if (!x.red) + x = x.toRed(this.red); + + const y = this.solveY(x); + + if (sign != null) { + if (y.isZero() && sign) + throw new Error('Invalid point.'); + + if (y.redIsOdd() !== sign) + y.redINeg(); + } + + return this.point(x, y); + } + + pointFromY(y, sign = null) { + assert(y instanceof BN); + assert(sign == null || typeof sign === 'boolean'); + + if (!y.red) + y = y.toRed(this.red); + + const x = this.solveX(y); + + if (sign != null) { + if (x.isZero() && sign) + throw new Error('Invalid point.'); + + if (x.redIsOdd() !== sign) + x.redINeg(); + } + + return this.point(x, y); + } + + isIsomorphic(curve, invert = false) { + // [TWISTED] Theorem 3.2, Page 4, Section 3. + // Definition 2.1, Page 3, Section 2. + assert(curve instanceof Curve); + assert(typeof invert === 'boolean'); + + if (!curve.p.eq(this.p)) + return false; + + // E(a,d) <-> E(a,b) + if (curve.type === 'short') + return curve.isIsomorphic(this); + + // E(a,d) <-> M(A,B) + // E(a,d) <-> M(-A,-B) + if (curve.type === 'mont') { + // A * (a - d) = 2 * (a + d) + const a = this.field(curve.a); + + let apd, amd; + + if (invert) { + apd = this.d.redAdd(this.a); + amd = this.d.redSub(this.a); + } else { + apd = this.a.redAdd(this.d); + amd = this.a.redSub(this.d); + } + + return a.redMul(amd).eq(apd.redIMuln(2)); + } + + // E(a,d) <-> E(a',a'd/a) + if (curve.type === 'edwards') { + // a' * d = a * d' + const a = this.field(curve.a); + const d = this.field(curve.d); + + return this.a.redMul(d).eq(a.redMul(this.d)); + } + + return false; + } + + isIsogenous(curve) { + // Check for the 4-isogenies described by Hamburg: + // https://moderncrypto.org/mail-archive/curves/2016/000806.html + assert(curve instanceof Curve); + + if (!curve.p.eq(this.p)) + return false; + + // E(1,d) <-> M(2-4d,1) + if (curve.type === 'mont') { + if (!this.a.eq(this.one)) + return false; + + const a = this.field(curve.a); + const b = this.field(curve.b); + const d24 = this.two.redSub(this.d.redMuln(4)); + + return a.eq(d24) && b.eq(this.one); + } + + // E(a,d) <-> E(-a,d-a) + if (curve.type === 'edwards') { + const a = this.field(curve.a); + const d = this.field(curve.d); + + return a.eq(this.a.redNeg()) + && d.eq(this.d.redSub(this.a)); + } + + return false; + } + + pointFromShort(point) { + // [TWISTEQ] Section 1. + assert(point instanceof ShortPoint); + + if (this.isIsomorphic(point.curve)) { + // Equivalence for E(a,b)->E(a',d'): + // + // x' = (6 * x - a' - d') / (6 * y) + // y' = (12 * x - 5 * a' + d') / (12 * x + a' - 5 * d') + // + // Undefined for x = (5 * d' - a') / 12 or y = 0. + // + // Exceptional Cases: + // - O -> (0, 1) + // - ((a' + d') / 6, 0) -> (0, -1) + // - ((5 * d' - a') / 12, (d' - a') / 4 * sqrt(d')) -> (sqrt(1/d'), oo) + // + // Unexceptional Cases: + // - ((5 * a' - d') / 12, (a' - d') / 4 * sqrt(a')) -> (sqrt(1/a'), 0) + if (point.isInfinity()) + return this.point(); + + if (point.y.isZero()) + return this.point(this.zero, this.one.redNeg()); + + const {a, d} = this; + const [u2, u3] = this._scale(point.curve); + const a5 = a.redMuln(5); + const d5 = d.redMuln(5); + const x = this.field(point.x).redMul(u2); + const y = this.field(point.y).redMul(u3); + const x6 = x.redMuln(6); + const x12 = x.redMuln(12); + const xx = x6.redSub(a).redISub(d); + const xz = y.redMuln(6); + const yy = x12.redSub(a5).redIAdd(d); + const yz = x12.redAdd(a).redISub(d5); + + return this.cpoint(xx, xz, yy, yz); + } + + throw new Error('Not implemented.'); + } + + pointFromMont(point) { + // [RFC7748] Section 4.1 & 4.2. + // [MONT3] Page 6, Section 2.5. + // [TWISTED] Theorem 3.2, Page 4, Section 3. + assert(point instanceof MontPoint); + assert(point.curve.p.eq(this.p)); + + // Montgomery `u`, `v`. + const u = this.field(point.x); + const v = this.field(point.y); + + if (this.isIsogenous(point.curve)) { + // 4-isogeny maps for M(2-4d,1)->E(1,d): + // + // x = 4 * v * (u^2 - 1) / (u^4 - 2 * u^2 + 4 * v^2 + 1) + // y = -(u^5 - 2 * u^3 - 4 * u * v^2 + u) / + // (u^5 - 2 * u^2 * v^2 - 2 * u^3 - 2 * v^2 + u) + // + // Undefined for u = 0 and v = 0. + // + // Exceptional Cases: + // - O -> (0, 1) + // - (0, 0) -> (0, 1) + // + // Unexceptional Cases: + // - (-1, +-sqrt(A - 2)) -> (0, 1) + // - (1, +-sqrt(A + 2)) -> (0, -1) + // + // The point (1, v) is invalid on Curve448. + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(); + + const u2 = u.redSqr(); + const u3 = u2.redMul(u); + const u4 = u3.redMul(u); + const u5 = u4.redMul(u); + const v2 = v.redSqr(); + const a = v.redMuln(4); + const b = u2.redSub(this.one); + const c = u2.redMuln(2); + const d = v2.redMuln(4); + const e = u3.redIMuln(2); + const f = u.redMul(v2).redIMuln(4); + const g = u2.redMul(v2).redIMuln(2); + const h = v2.redIMuln(2); + const xx = a.redMul(b); + const xz = u4.redISub(c).redIAdd(d).redIAdd(this.one); + const yy = u5.redSub(e).redISub(f).redIAdd(u).redINeg(); + const yz = u5.redISub(g).redISub(e).redISub(h).redIAdd(u); + + return this.cpoint(xx, xz, yy, yz).divn(4); + } + + if (this.isIsomorphic(point.curve, true)) { + // Isomorphic maps for M(-A,-B)->E(a,d): + // + // x = +-sqrt((A - 2) / (B * a)) * u / v + // y = (u + 1) / (u - 1) + // + // Undefined for u = 1 or v = 0. + // + // Exceptional Cases: + // - O -> (0, 1) + // - (0, 0) -> (0, -1) + // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / d), oo) + // + // Unexceptional Cases: + // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / a), 0) + // + // The point (1, v) is invalid on Curve448. + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.one.redNeg()); + + const c = this._scale(point.curve, true); + const xx = c.redMul(u); + const xz = v; + const yy = u.redAdd(this.one); + const yz = u.redSub(this.one); + + return this.cpoint(xx, xz, yy, yz); + } + + if (this.isIsomorphic(point.curve, false)) { + // Isomorphic maps for M(A,B)->E(a,d): + // + // x = +-sqrt((A + 2) / (B * a)) * u / v + // y = (u - 1) / (u + 1) + // + // Undefined for u = -1 or v = 0. + // + // Exceptional Cases: + // - O -> (0, 1) + // - (0, 0) -> (0, -1) + // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / d), oo) + // + // Unexceptional Cases: + // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / a), 0) + // + // The point (-1, v) is invalid on Curve25519. + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.one.redNeg()); + + const c = this._scale(point.curve, false); + const xx = c.redMul(u); + const xz = v; + const yy = u.redSub(this.one); + const yz = u.redAdd(this.one); + + return this.cpoint(xx, xz, yy, yz); + } + + throw new Error('Not implemented.'); + } + + pointFromEdwards(point) { + // [TWISTED] Definition 2.1, Page 3, Section 2. + // [ISOGENY] Page 2, Section 2. + assert(point instanceof EdwardsPoint); + assert(point.curve.p.eq(this.p)); + + // Edwards `x`, `y`, `z`, `t`. + const a = this.field(point.curve.a); + const x = this.field(point.x); + const y = this.field(point.y); + const z = this.field(point.z); + const t = this.field(point.t); + + if (this.isIsogenous(point.curve)) { + // 4-isogeny maps for E(a,d)<->E(-a,d-a): + // + // x' = (2 * x * y) / (y^2 - a * x^2) + // y' = (y^2 + a * x^2) / (2 - y^2 - a * x^2) + // + // Undefined for y^2 - a * x^2 = 0 + // or y^2 + a * x^2 = 2. + const xy = x.redMul(y); + const x2 = x.redSqr(); + const y2 = y.redSqr(); + const z2 = z.redSqr(); + const ax2 = a.redMul(x2); + const xx = xy.redIMuln(2); + const xz = y2.redSub(ax2); + const yy = y2.redAdd(ax2); + const yz = z2.redIMuln(2).redISub(yy); + const p = this.cpoint(xx, xz, yy, yz); + + return !this.twisted ? p.divn(4) : p; + } + + if (this.isIsomorphic(point.curve)) { + // Isomorphic maps for E(a,d)<->E(a',a'd/a): + // + // x' = +-sqrt(a / a') * x + // y' = y + // + // Undefined when (a / a') is not square. + const c = this._scale(point.curve); + const nx = c.redMul(x); + const ny = y; + const nz = z; + const nt = c.redMul(t); + + return this.point(nx, ny, nz, nt); + } + + throw new Error('Not implemented.'); + } + + pointFromUniform(u, curve = null) { + assert(u instanceof BN); + assert(u.red === this.red); + assert(curve == null || (curve instanceof MontCurve)); + + if (!curve) + curve = this._alt(); + + const u0 = curve.field(u); + const p0 = curve.pointFromUniform(u0); + + return this.pointFromMont(p0); + } + + pointToUniform(p, hint, curve = null) { + // Convert an edwards point to a field + // element by inverting the elligator2 map. + // + // Hint Layout: + // + // [00000000] [0000] [0000] + // | | | + // | | +-- preimage index + // | +--- subgroup + // +-- bits to OR with uniform bytes + assert(p instanceof EdwardsPoint); + assert((hint >>> 0) === hint); + assert(curve == null || (curve instanceof MontCurve)); + + if (!curve) + curve = this._alt(); + + // Add a random torsion component. + const i = ((hint >> 4) & 15) % this.torsion.length; + const q = p.add(this.torsion[i]); + + // Convert and invert. + const p0 = curve.pointFromEdwards(q); + const u0 = curve.pointToUniform(p0, hint & 15); + + return this.field(u0); + } + + pointFromHash(bytes, pake, curve = null) { + assert(curve == null || (curve instanceof MontCurve)); + + if (!curve) + curve = this._alt(); + + const p0 = curve.pointFromHash(bytes, pake); + + return this.pointFromMont(p0); + } + + pointToHash(p, subgroup, rng, curve = null) { + assert(p instanceof EdwardsPoint); + assert((subgroup >>> 0) === subgroup); + assert(curve == null || (curve instanceof MontCurve)); + + if (!curve) + curve = this._alt(); + + // Add a random torsion component. + const i = subgroup % this.torsion.length; + const q = p.add(this.torsion[i]); + + // Convert and invert. + const p0 = curve.pointFromEdwards(q); + + return curve.pointToHash(p0, 0, rng); + } + + decodePoint(bytes) { + return EdwardsPoint.decode(this, bytes); + } + + toShort(a0, odd, sign = null) { + const [a, b] = this._short(a0, odd); + + const curve = new ShortCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = curve._scale(this); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromEdwards(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); + + return curve; + } + + toMont(b0, invert, sign = null) { + const [a, b] = this._mont(b0, invert); + + const curve = new MontCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h, + z: this.z + }); + + if (sign != null) { + const c = this._scale(curve, invert); + + if (c.redIsOdd() !== sign) + c.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromEdwards(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); + + return curve; + } + + toEdwards(a0, sign = null) { + const [a, d] = this._edwards(a0); + + const curve = new EdwardsCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + d: d, + n: this.n, + h: this.h, + z: this.z + }); + + if (sign != null) { + const c = curve._scale(this); + + if (c.redIsOdd() !== sign) + c.redINeg(); + } + + if (!this.g.isInfinity()) { + curve.g = curve.pointFromEdwards(this.g); + curve.g.normalize(); + } + + if (curve.isComplete()) { + for (let i = 0; i < this.h.word(0); i++) { + curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); + curve.torsion[i].normalize(); + } + } + + return curve; + } + + pointFromJSON(json) { + return EdwardsPoint.fromJSON(this, json); + } + + toJSON(pre) { + const json = super.toJSON(pre); + + json.a = this.a.fromRed().toJSON(); + json.d = this.d.fromRed().toJSON(); + + if (!this.s.isZero()) + json.s = this.s.fromRed().toJSON(); + + return json; + } + } + + /** + * EdwardsPoint + */ + + class EdwardsPoint extends Point { + constructor(curve, x, y, z, t) { + assert(curve instanceof EdwardsCurve); + + super(curve, types.EXTENDED); + + this.x = this.curve.zero; + this.y = this.curve.one; + this.z = this.curve.one; + this.t = this.curve.zero; + this.zOne = true; + + if (x != null) + this._init(x, y, z, t); + } + + _init(x, y, z, t) { + assert(x instanceof BN); + assert(y instanceof BN); + assert(z == null || (z instanceof BN)); + assert(t == null || (t instanceof BN)); + + this.x = x; + this.y = y; + this.z = z || this.curve.one; + this.t = t || null; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + + if (this.t && !this.t.red) + this.t = this.t.toRed(this.curve.red); + + this.zOne = this.z.eq(this.curve.one); + + this._check(); + + if (!this.t) { + this.t = this.x.redMul(this.y); + if (!this.zOne) + this.t = this.t.redDiv(this.z); + } + } + + _check() { + // In order to achieve complete + // addition formulas, `a` must + // be a square (always the case + // for a=1), and `d` must be a + // non-square. + // + // If this is not the case, the + // addition formulas may have + // exceptional cases where Z3=0. + // + // In particular, this can occur + // when: Q*h = -P*h and Q != -P. + // + // This is assuming 4-torsion is + // involved (the 4-torsion point + // is _not_ representable when + // `d` is square). + if (this.z.isZero()) + throw new Error('Invalid point.'); + } + + clone() { + return this.curve.point(this.x, this.y, this.z, this.t); + } + + normalize() { + // https://hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#scaling-z + // 1I + 2M (+ 1M if extended) + + // Z1 = 1 + if (this.zOne) + return this; + + // A = 1 / Z1 + const a = this.z.redInvert(); + + // X3 = X1 * A + this.x = this.x.redMul(a); + + // Y3 = Y1 * A + this.y = this.y.redMul(a); + + // T3 = T1 * A + this.t = this.t.redMul(a); + + // Z3 = 1 + this.z = this.curve.one; + this.zOne = true; + + return this; + } + + scale(a) { + assert(a instanceof BN); + + // X3 = X1 * A + const nx = this.x.redMul(a); + + // Y3 = Y1 * A + const ny = this.y.redMul(a); + + // Z3 = Z1 * A + const nz = this.z.redMul(a); + + // T3 = T1 * A + const nt = this.t.redMul(a); + + return this.curve.point(nx, ny, nz, nt); + } + + neg() { + // -(X1, Y1, Z1, T1) = (-X1, Y1, Z1, -T1) + const nx = this.x.redNeg(); + const ny = this.y; + const nz = this.z; + const nt = this.t.redNeg(); + + return this.curve.point(nx, ny, nz, nt); + } + + add(p) { + assert(p instanceof EdwardsPoint); + + // P = O + if (this.isInfinity()) + return p; + + // Q = O + if (p.isInfinity()) + return this; + + // Z1 = 1 + if (this.zOne) + return p._add(this); + + return this._add(p); + } + + _add(p) { + // a = -1 + if (this.curve.mOneA) + return this._addM1(p); + + return this._addA(p); + } + + _addM1(p) { + // Assumes a = -1. + // + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-3 + // 8M + 8A + 1*k + 1*2 + // + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-madd-2008-hwcd-3 + // 7M + 8A + 1*k + 1*2 + + // A = (Y1 - X1) * (Y2 - X2) + const a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); + + // B = (Y1 + X1) * (Y2 + X2) + const b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); + + // C = T1 * k * T2 + const c = this.t.redMul(this.curve.k).redMul(p.t); + + // D = Z1 * 2 * Z2 + const d = p.zOne ? this.z.redAdd(this.z) : this.z.redMul(p.z).redIMuln(2); + + // E = B - A + const e = b.redSub(a); + + // F = D - C + const f = d.redSub(c); + + // G = D + C + const g = d.redIAdd(c); + + // H = B + A + const h = b.redIAdd(a); + + // X3 = E * F + const nx = e.redMul(f); + + // Y3 = G * H + const ny = g.redMul(h); + + // T3 = E * H + const nt = e.redMul(h); + + // Z3 = F * G + const nz = f.redMul(g); + + return this.curve.point(nx, ny, nz, nt); + } + + _addA(p) { + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd + // 9M + 7A + 1*a + 1*d + // + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-madd-2008-hwcd + // 8M + 7A + 1*a + 1*d + + // A = X1 * X2 + const a = this.x.redMul(p.x); + + // B = Y1 * Y2 + const b = this.y.redMul(p.y); + + // C = T1 * d * T2 + const c = this.curve._mulD(this.t).redMul(p.t); + + // D = Z1 * Z2 + const d = p.zOne ? this.z.clone() : this.z.redMul(p.z); + + // + XYXY = (X1 + Y1) * (X2 + Y2) + const xyxy = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)); + + // E = (X1 + Y1) * (X2 + Y2) - A - B + const e = xyxy.redISub(a).redISub(b); + + // F = D - C + const f = d.redSub(c); + + // G = D + C + const g = d.redIAdd(c); + + // H = B - a * A + const h = b.redISub(this.curve._mulA(a)); + + // X3 = E * F + const nx = e.redMul(f); + + // Y3 = G * H + const ny = g.redMul(h); + + // T3 = E * H + const nt = e.redMul(h); + + // Z3 = F * G + const nz = f.redMul(g); + + return this.curve.point(nx, ny, nz, nt); + } + + dbl() { + // P = O + if (this.isInfinity()) + return this; + + return this._dbl(); + } + + _dbl() { + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd + // 4M + 4S + 6A + 1*a + 1*2 + // + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-mdbl-2008-hwcd + // 3M + 4S + 7A + 1*a + 1*2 + + // A = X1^2 + const a = this.x.redSqr(); + + // B = Y1^2 + const b = this.y.redSqr(); + + // C = 2 * Z1^2 + const c = this.zOne ? this.curve.two : this.z.redSqr().redIMuln(2); + + // D = a * A + const d = this.curve._mulA(a); + + // E = (X1 + Y1)^2 - A - B + const e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); + + // G = D + B + const g = d.redAdd(b); + + // F = G - C + const f = g.redSub(c); + + // H = D - B + const h = d.redISub(b); + + // X3 = E * F + const nx = e.redMul(f); + + // Y3 = G * H + const ny = g.redMul(h); + + // T3 = E * H + const nt = e.redMul(h); + + // Z3 = F * G + const nz = f.redMul(g); + + return this.curve.point(nx, ny, nz, nt); + } + + getX() { + this.normalize(); + return this.x.fromRed(); + } + + getY() { + this.normalize(); + return this.y.fromRed(); + } + + eq(p) { + assert(p instanceof EdwardsPoint); + assert(!this.z.isZero()); + assert(!p.z.isZero()); + + // P = Q + if (this === p) + return true; + + // Z1 = Z2 + if (this.z.eq(p.z)) { + return this.x.eq(p.x) + && this.y.eq(p.y); + } + + // X1 * Z2 = X2 * Z1 + const x1 = this.x.redMul(p.z); + const x2 = p.x.redMul(this.z); + + if (!x1.eq(x2)) + return false; + + const y1 = this.y.redMul(p.z); + const y2 = p.y.redMul(this.z); + + return y1.eq(y2); + } + + cmp(point) { + assert(point instanceof EdwardsPoint); + + return this.order().cmp(point.order()) + || this.getY().cmp(point.getY()) + || this.getX().cmp(point.getX()); + } + + isInfinity() { + assert(!this.z.isZero()); + + // X1 = 0 + if (!this.x.isZero()) + return false; + + // Y1 = Z1 + return this.y.eq(this.z); + } + + isOrder2() { + if (this.isInfinity()) + return false; + + return this.x.isZero(); + } + + isOdd() { + this.normalize(); + return this.x.redIsOdd(); + } + + isEven() { + this.normalize(); + return this.x.redIsEven(); + } + + toP() { + return this.normalize(); + } + + toJ() { + return this; + } + + encode() { + // [RFC8032] Section 5.1.2. + const y = this.getY(); + + // Note: `x` normalized from `getY()` call. + y.setn(this.curve.signBit, this.x.redIsOdd()); + + return this.curve.encodeAdjusted(y); + } + + static decode(curve, bytes) { + // [RFC8032] Section 5.1.3. + assert(curve instanceof EdwardsCurve); + + const y = curve.decodeAdjusted(bytes); + const sign = y.testn(curve.signBit) !== 0; + + y.setn(curve.signBit, 0); + + if (y.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + return curve.pointFromY(y, sign); + } + + toJSON(pre) { + if (this.isInfinity()) + return []; + + const x = this.getX().toJSON(); + const y = this.getY().toJSON(); + + if (pre === true && this.pre) + return [x, y, this.pre.toJSON()]; + + return [x, y]; + } + + toPretty() { + const size = this.curve.fieldSize * 2; + const x = toPretty(this.getX(), size); + const y = toPretty(this.getY(), size); + + return [x, y]; + } + + static fromJSON(curve, json) { + assert(curve instanceof EdwardsCurve); + assert(Array.isArray(json)); + assert(json.length === 0 + || json.length === 2 + || json.length === 3); + + if (json.length === 0) + return curve.point(); + + const x = BN.fromJSON(json[0]); + const y = BN.fromJSON(json[1]); + const point = curve.point(x, y); + + if (json.length > 2 && json[2] != null) + point.pre = Precomp.fromJSON(point, json[2]); + + return point; + } + + [custom]() { + if (this.isInfinity()) + return ''; + + return ''; + } + } + + /** + * Precomp + */ + + class Precomp { + constructor() { + this.naf = null; + this.windows = null; + this.doubles = null; + this.blinding = null; + this.beta = null; + } + + map(func) { + assert(typeof func === 'function'); + + const out = new this.constructor(); + + if (this.naf) + out.naf = this.naf.map(func); + + if (this.doubles) + out.doubles = this.doubles.map(func); + + return out; + } + + toJSON() { + return { + naf: this.naf ? this.naf.toJSON() : null, + windows: this.windows ? this.windows.toJSON() : null, + doubles: this.doubles ? this.doubles.toJSON() : null, + blinding: this.blinding ? this.blinding.toJSON() : undefined + }; + } + + fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + + if (json.naf != null) + this.naf = NAF.fromJSON(point, json.naf); + + if (json.windows != null) + this.windows = Windows.fromJSON(point, json.windows); + + if (json.doubles != null) + this.doubles = Doubles.fromJSON(point, json.doubles); + + if (json.blinding != null) + this.blinding = Blinding.fromJSON(point, json.blinding); + + return this; + } + + static fromJSON(point, json) { + return new this().fromJSON(point, json); + } + } + + /** + * NAF + */ + + class NAF { + constructor(width, points) { + this.width = width; + this.points = points; + } + + map(func) { + assert(typeof func === 'function'); + + const {width} = this; + const points = []; + + for (const point of this.points) + points.push(func(point)); + + return new this.constructor(width, points); + } + + toJSON() { + return { + width: this.width, + points: this.points.slice(1).map((point) => { + return point.toJSON(); + }) + }; + } + + static fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + assert((json.width >>> 0) === json.width); + assert(Array.isArray(json.points)); + + const {curve} = point; + const {width} = json; + const points = [point]; + + for (const item of json.points) + points.push(curve.pointFromJSON(item)); + + return new this(width, points); + } + } + + /** + * Windows + */ + + class Windows { + constructor(width, bits, points) { + this.width = width; + this.bits = bits; + this.points = points; + } + + toJSON() { + return { + width: this.width, + bits: this.bits, + points: this.points.slice(1).map((point) => { + return point.toJSON(); + }) + }; + } + + static fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + assert((json.width >>> 0) === json.width); + assert((json.bits >>> 0) === json.bits); + assert(Array.isArray(json.points)); + + const {curve} = point; + const {width, bits} = json; + const points = [point]; + + for (const item of json.points) + points.push(curve.pointFromJSON(item)); + + return new this(width, bits, points); + } + } + + /** + * Doubles + */ + + class Doubles { + constructor(step, points) { + this.step = step; + this.points = points; + } + + map(func) { + assert(typeof func === 'function'); + + const {step} = this; + const points = []; + + for (const point of this.points) + points.push(func(point)); + + return new this.constructor(step, points); + } + + toJSON() { + return { + step: this.step, + points: this.points.slice(1).map((point) => { + return point.toJSON(); + }) + }; + } + + static fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + assert((json.step >>> 0) === json.step); + assert(Array.isArray(json.points)); + + const {curve} = point; + const {step} = json; + const points = [point]; + + for (const item of json.points) + points.push(curve.pointFromJSON(item)); + + return new this(step, points); + } + } + + /** + * Blinding + */ + + class Blinding { + constructor(blind, unblind) { + this.blind = blind; + this.unblind = unblind; + } + + toJSON() { + return { + blind: this.blind.toJSON(), + unblind: this.unblind.toJSON() + }; + } + + static fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + + const {curve} = point; + const blind = BN.fromJSON(json.blind); + const unblind = curve.pointFromJSON(json.unblind); + + return new this(blind, unblind); + } + } + + /** + * Endo + */ + + class Endo { + constructor(beta, lambda, basis, pre) { + this.beta = beta; + this.lambda = lambda; + this.basis = basis; + this.pre = pre; + } + + toJSON() { + return { + beta: this.beta.fromRed().toJSON(), + lambda: this.lambda.toJSON(), + basis: [ + this.basis[0].toJSON(), + this.basis[1].toJSON() + ], + pre: [ + this.pre[0], + this.pre[1].toJSON(), + this.pre[2].toJSON() + ] + }; + } + + static fromJSON(curve, json) { + assert(curve instanceof Curve); + assert(json && typeof json === 'object'); + assert(Array.isArray(json.basis)); + assert(Array.isArray(json.pre)); + assert(json.basis.length === 2); + assert(json.pre.length === 3); + assert((json.pre[0] >>> 0) === json.pre[0]); + + const beta = BN.fromJSON(json.beta).toRed(curve.red); + const lambda = BN.fromJSON(json.lambda); + + const basis = [ + Vector.fromJSON(json.basis[0]), + Vector.fromJSON(json.basis[1]) + ]; + + const pre = [ + json.pre[0], + BN.fromJSON(json.pre[1]), + BN.fromJSON(json.pre[2]) + ]; + + return new this(beta, lambda, basis, pre); + } + } + + /** + * Vector + */ + + class Vector { + constructor(a, b) { + this.a = a; + this.b = b; + } + + toJSON() { + return { + a: this.a.toJSON(), + b: this.b.toJSON() + }; + } + + static fromJSON(json) { + assert(json && typeof json === 'object'); + + const a = BN.fromJSON(json.a); + const b = BN.fromJSON(json.b); + + return new this(a, b); + } + } + + /** + * P192 + * https://tinyurl.com/fips-186-2 (page 29) + * https://tinyurl.com/fips-186-3 (page 88) + */ + + class P192 extends ShortCurve { + constructor(pre) { + super({ + id: 'P192', + ossl: 'prime192v1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: 'p192', + // 2^192 - 2^64 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff fffffffe', + 'ffffffff ffffffff'], + // -3 mod p + a: ['ffffffff ffffffff ffffffff fffffffe', + 'ffffffff fffffffc'], + b: ['64210519 e59c80e7 0fa7e9ab 72243049', + 'feb8deec c146b9b1'], + n: ['ffffffff ffffffff ffffffff 99def836', + '146bc9b1 b4d22831'], + h: '1', + // Icart + z: '-5', + g: [ + ['188da80e b03090f6 7cbf20eb 43a18800', + 'f4ff0afd 82ff1012'], + ['07192b95 ffc8da78 631011ed 6b24cdd5', + '73f977a1 1e794811'], + pre + ] + }); + } + } + + /** + * P224 + * https://tinyurl.com/fips-186-2 (page 30) + * https://tinyurl.com/fips-186-3 (page 88) + */ + + class P224 extends ShortCurve { + constructor(pre) { + super({ + id: 'P224', + ossl: 'secp224r1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: 'p224', + // 2^224 - 2^96 + 1 (1 mod 16) + p: ['ffffffff ffffffff ffffffff ffffffff', + '00000000 00000000 00000001'], + // -3 mod p + a: ['ffffffff ffffffff ffffffff fffffffe', + 'ffffffff ffffffff fffffffe'], + b: ['b4050a85 0c04b3ab f5413256 5044b0b7', + 'd7bfd8ba 270b3943 2355ffb4'], + n: ['ffffffff ffffffff ffffffff ffff16a2', + 'e0b8f03e 13dd2945 5c5c2a3d'], + h: '1', + // SSWU + z: '1f', + g: [ + ['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3', + '56c21122 343280d6 115c1d21'], + ['bd376388 b5f723fb 4c22dfe6 cd4375a0', + '5a074764 44d58199 85007e34'], + pre + ] + }); + } + } + + /** + * P256 + * https://tinyurl.com/fips-186-2 (page 31) + * https://tinyurl.com/fips-186-3 (page 89) + */ + + class P256 extends ShortCurve { + constructor(pre) { + super({ + id: 'P256', + ossl: 'prime256v1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: null, + // 2^256 - 2^224 + 2^192 + 2^96 - 1 (= 3 mod 4) + p: ['ffffffff 00000001 00000000 00000000', + '00000000 ffffffff ffffffff ffffffff'], + // -3 mod p + a: ['ffffffff 00000001 00000000 00000000', + '00000000 ffffffff ffffffff fffffffc'], + b: ['5ac635d8 aa3a93e7 b3ebbd55 769886bc', + '651d06b0 cc53b0f6 3bce3c3e 27d2604b'], + n: ['ffffffff 00000000 ffffffff ffffffff', + 'bce6faad a7179e84 f3b9cac2 fc632551'], + h: '1', + // SSWU + z: '-a', + g: [ + ['6b17d1f2 e12c4247 f8bce6e5 63a440f2', + '77037d81 2deb33a0 f4a13945 d898c296'], + ['4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16', + '2bce3357 6b315ece cbb64068 37bf51f5'], + pre + ] + }); + } + } + + /** + * P384 + * https://tinyurl.com/fips-186-2 (page 32) + * https://tinyurl.com/fips-186-3 (page 89) + */ + + class P384 extends ShortCurve { + constructor(pre) { + super({ + id: 'P384', + ossl: 'secp384r1', + type: 'short', + endian: 'be', + hash: 'SHA384', + prime: null, + // 2^384 - 2^128 - 2^96 + 2^32 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff fffffffe', + 'ffffffff 00000000 00000000 ffffffff'], + // -3 mod p + a: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff fffffffe', + 'ffffffff 00000000 00000000 fffffffc'], + b: ['b3312fa7 e23ee7e4 988e056b e3f82d19', + '181d9c6e fe814112 0314088f 5013875a', + 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'], + n: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff c7634d81 f4372ddf', + '581a0db2 48b0a77a ecec196a ccc52973'], + h: '1', + // Icart + z: '-c', + g: [ + ['aa87ca22 be8b0537 8eb1c71e f320ad74', + '6e1d3b62 8ba79b98 59f741e0 82542a38', + '5502f25d bf55296c 3a545e38 72760ab7'], + ['3617de4a 96262c6f 5d9e98bf 9292dc29', + 'f8f41dbd 289a147c e9da3113 b5f0b8c0', + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'], + pre + ] + }); + } + } + + /** + * P521 + * https://tinyurl.com/fips-186-2 (page 33) + * https://tinyurl.com/fips-186-3 (page 90) + */ + + class P521 extends ShortCurve { + constructor(pre) { + super({ + id: 'P521', + ossl: 'secp521r1', + type: 'short', + endian: 'be', + hash: 'SHA512', + prime: 'p521', + // 2^521 - 1 (= 3 mod 4) + p: ['000001ff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff'], + // -3 mod p + a: ['000001ff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'fffffffc'], + b: ['00000051 953eb961 8e1c9a1f 929a21a0', + 'b68540ee a2da725b 99b315f3 b8b48991', + '8ef109e1 56193951 ec7e937b 1652c0bd', + '3bb1bf07 3573df88 3d2c34f1 ef451fd4', + '6b503f00'], + n: ['000001ff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'fffffffa 51868783 bf2f966b 7fcc0148', + 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e', + '91386409'], + h: '1', + // SSWU + z: '-4', + g: [ + ['000000c6 858e06b7 0404e9cd 9e3ecb66', + '2395b442 9c648139 053fb521 f828af60', + '6b4d3dba a14b5e77 efe75928 fe1dc127', + 'a2ffa8de 3348b3c1 856a429b f97e7e31', + 'c2e5bd66'], + ['00000118 39296a78 9a3bc004 5c8a5fb4', + '2c7d1bd9 98f54449 579b4468 17afbd17', + '273e662c 97ee7299 5ef42640 c550b901', + '3fad0761 353c7086 a272c240 88be9476', + '9fd16650'], + pre + ] + }); + } + } + + /** + * SECP256K1 + * https://www.secg.org/SEC2-Ver-1.0.pdf (page 15, section 2.7.1) + * https://www.secg.org/sec2-v2.pdf (page 9, section 2.4.1) + */ + + class SECP256K1 extends ShortCurve { + constructor(pre) { + super({ + id: 'SECP256K1', + ossl: 'secp256k1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: 'k256', + // 2^256 - 2^32 - 977 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe fffffc2f'], + a: '0', + b: '7', + n: ['ffffffff ffffffff ffffffff fffffffe', + 'baaedce6 af48a03b bfd25e8c d0364141'], + h: '1', + // SVDW + z: '1', + // sqrt(-3) + c: ['0a2d2ba9 3507f1df 233770c2 a797962c', + 'c61f6d15 da14ecd4 7d8d27ae 1cd5f852'], + g: [ + ['79be667e f9dcbbac 55a06295 ce870b07', + '029bfcdb 2dce28d9 59f2815b 16f81798'], + ['483ada77 26a3c465 5da4fbfc 0e1108a8', + 'fd17b448 a6855419 9c47d08f fb10d4b8'], + pre + ], + // Precomputed endomorphism. + endo: { + beta: ['7ae96a2b 657c0710 6e64479e ac3434e9', + '9cf04975 12f58995 c1396c28 719501ee'], + lambda: ['5363ad4c c05c30e0 a5261c02 8812645a', + '122e22ea 20816678 df02967c 1b23bd72'], + basis: [ + { + a: '3086d221a7d46bcde86c90e49284eb15', + b: '-e4437ed6010e88286f547fa90abfe4c3' + }, + { + a: '114ca50f7a8e2f3f657c1108d9d44cfd8', + b: '3086d221a7d46bcde86c90e49284eb15' + } + ], + pre: [ + 384, + ['3086d221 a7d46bcd e86c90e4 9284eb15', + '3daa8a14 71e8ca7f e893209a 45dbb031'], + ['-', + 'e4437ed6 010e8828 6f547fa9 0abfe4c4', + '221208ac 9df506c6 1571b4ae 8ac47f71'] + ] + } + }); + } + } + + /** + * BRAINPOOLP256 + * https://tools.ietf.org/html/rfc5639#section-3.4 + */ + + class BRAINPOOLP256 extends ShortCurve { + constructor(pre) { + super({ + id: 'BRAINPOOLP256', + ossl: 'brainpoolP256r1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: null, + // (= 3 mod 4) + p: ['a9fb57db a1eea9bc 3e660a90 9d838d72', + '6e3bf623 d5262028 2013481d 1f6e5377'], + a: ['7d5a0975 fc2c3057 eef67530 417affe7', + 'fb8055c1 26dc5c6c e94a4b44 f330b5d9'], + b: ['26dc5c6c e94a4b44 f330b5d9 bbd77cbf', + '95841629 5cf7e1ce 6bccdc18 ff8c07b6'], + n: ['a9fb57db a1eea9bc 3e660a90 9d838d71', + '8c397aa3 b561a6f7 901e0e82 974856a7'], + h: '1', + // Icart + z: '-2', + g: [ + ['8bd2aeb9 cb7e57cb 2c4b482f fc81b7af', + 'b9de27e1 e3bd23c2 3a4453bd 9ace3262'], + ['547ef835 c3dac4fd 97f8461a 14611dc9', + 'c2774513 2ded8e54 5c1d54c7 2f046997'], + pre + ] + }); + } + } + + /** + * BRAINPOOLP384 + * https://tools.ietf.org/html/rfc5639#section-3.6 + */ + + class BRAINPOOLP384 extends ShortCurve { + constructor(pre) { + super({ + id: 'BRAINPOOLP384', + ossl: 'brainpoolP384r1', + type: 'short', + endian: 'be', + hash: 'SHA384', + prime: null, + // (= 3 mod 4) + p: ['8cb91e82 a3386d28 0f5d6f7e 50e641df', + '152f7109 ed5456b4 12b1da19 7fb71123', + 'acd3a729 901d1a71 87470013 3107ec53'], + a: ['7bc382c6 3d8c150c 3c72080a ce05afa0', + 'c2bea28e 4fb22787 139165ef ba91f90f', + '8aa5814a 503ad4eb 04a8c7dd 22ce2826'], + b: ['04a8c7dd 22ce2826 8b39b554 16f0447c', + '2fb77de1 07dcd2a6 2e880ea5 3eeb62d5', + '7cb43902 95dbc994 3ab78696 fa504c11'], + n: ['8cb91e82 a3386d28 0f5d6f7e 50e641df', + '152f7109 ed5456b3 1f166e6c ac0425a7', + 'cf3ab6af 6b7fc310 3b883202 e9046565'], + h: '1', + // SSWU + z: '-5', + g: [ + ['1d1c64f0 68cf45ff a2a63a81 b7c13f6b', + '8847a3e7 7ef14fe3 db7fcafe 0cbd10e8', + 'e826e034 36d646aa ef87b2e2 47d4af1e'], + ['8abe1d75 20f9c2a4 5cb1eb8e 95cfd552', + '62b70b29 feec5864 e19c054f f9912928', + '0e464621 77918111 42820341 263c5315'], + pre + ] + }); + } + } + + /** + * BRAINPOOLP512 + * https://tools.ietf.org/html/rfc5639#section-3.7 + */ + + class BRAINPOOLP512 extends ShortCurve { + constructor(pre) { + super({ + id: 'BRAINPOOLP512', + ossl: 'brainpoolP512r1', + type: 'short', + endian: 'be', + hash: 'SHA512', + prime: null, + // (= 3 mod 4) + p: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07', + 'cb308db3 b3c9d20e d6639cca 70330871', + '7d4d9b00 9bc66842 aecda12a e6a380e6', + '2881ff2f 2d82c685 28aa6056 583a48f3'], + a: ['7830a331 8b603b89 e2327145 ac234cc5', + '94cbdd8d 3df91610 a83441ca ea9863bc', + '2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5', + '7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca'], + b: ['3df91610 a83441ca ea9863bc 2ded5d5a', + 'a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7', + '2bf2c7b9 e7c1ac4d 77fc94ca dc083e67', + '984050b7 5ebae5dd 2809bd63 8016f723'], + n: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07', + 'cb308db3 b3c9d20e d6639cca 70330870', + '553e5c41 4ca92619 41866119 7fac1047', + '1db1d381 085ddadd b5879682 9ca90069'], + h: '1', + // Icart + z: '7', + g: [ + ['81aee4bd d82ed964 5a21322e 9c4c6a93', + '85ed9f70 b5d916c1 b43b62ee f4d0098e', + 'ff3b1f78 e2d0d48d 50d1687b 93b97d5f', + '7c6d5047 406a5e68 8b352209 bcb9f822'], + ['7dde385d 566332ec c0eabfa9 cf7822fd', + 'f209f700 24a57b1a a000c55b 881f8111', + 'b2dcde49 4a5f485e 5bca4bd8 8a2763ae', + 'd1ca2b2f a8f05406 78cd1e0f 3ad80892'], + pre + ] + }); + } + } + + /** + * X25519 + * https://tools.ietf.org/html/rfc7748#section-4.1 + */ + + class X25519 extends MontCurve { + constructor() { + super({ + id: 'X25519', + ossl: 'X25519', + type: 'mont', + endian: 'le', + hash: 'SHA512', + prime: 'p25519', + // 2^255 - 19 (= 5 mod 8) + p: ['7fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffed'], + // 486662 + a: '76d06', + b: '1', + n: ['10000000 00000000 00000000 00000000', + '14def9de a2f79cd6 5812631a 5cf5d3ed'], + h: '8', + // Elligator 2 + z: '2', + g: [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000009'], + // See: https://www.rfc-editor.org/errata/eid4730 + ['5f51e65e 475f794b 1fe122d3 88b72eb3', + '6dc2b281 92839e4d d6163a5d 81312c14'] + ], + torsion: [ + [], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000001'], + ['6be4f497 f9a9c2af c21fa77a d7f4a6ef', + '635a11c7 284a9363 e9a248ef 9c884415'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000001'], + ['141b0b68 06563d50 3de05885 280b5910', + '9ca5ee38 d7b56c9c 165db710 6377bbd8'] + ], + [ + ['57119fd0 dd4e22d8 868e1c58 c45c4404', + '5bef839c 55b1d0b1 248c50a3 bc959c5f'], + ['68c59389 3d458e64 31c6ca00 45fb5015', + '20a44346 8eaa68dd 0f103842 048065b7'] + ], + [ + ['57119fd0 dd4e22d8 868e1c58 c45c4404', + '5bef839c 55b1d0b1 248c50a3 bc959c5f'], + ['173a6c76 c2ba719b ce3935ff ba04afea', + 'df5bbcb9 71559722 f0efc7bd fb7f9a36'] + ], + [ + ['00b8495f 16056286 fdb1329c eb8d09da', + '6ac49ff1 fae35616 aeb8413b 7c7aebe0'], + ['3931c129 569e83a5 29482c14 e628b457', + '933bfc29 ed801b4d 68871483 92507b1a'] + ], + [ + ['00b8495f 16056286 fdb1329c eb8d09da', + '6ac49ff1 fae35616 aeb8413b 7c7aebe0'], + ['46ce3ed6 a9617c5a d6b7d3eb 19d74ba8', + '6cc403d6 127fe4b2 9778eb7c 6daf84d3'] + ] + ] + }); + } + } + + /** + * X448 + * https://tools.ietf.org/html/rfc7748#section-4.2 + */ + + class X448 extends MontCurve { + constructor() { + super({ + id: 'X448', + ossl: 'X448', + type: 'mont', + endian: 'le', + hash: 'SHAKE256', + prime: 'p448', + // 2^448 - 2^224 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff'], + // 156326 + a: '262a6', + b: '1', + n: ['3fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 7cca23e9', + 'c44edb49 aed63690 216cc272 8dc58f55', + '2378c292 ab5844f3'], + h: '4', + // Elligator 2 + z: '-1', + g: [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000005'], + ['7d235d12 95f5b1f6 6c98ab6e 58326fce', + 'cbae5d34 f55545d0 60f75dc2 8df3f6ed', + 'b8027e23 46430d21 1312c4b1 50677af7', + '6fd7223d 457b5b1a'] + ], + torsion: [ + [], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['ba4d3a08 29b6112f 8812e51b a0bb2abe', + 'bc1cb08e b48e5569 36ba50fd d2e7d68a', + 'f8cb3216 0522425b 3f990812 abbe635a', + 'd37a21e1 7551b193'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['45b2c5f7 d649eed0 77ed1ae4 5f44d541', + '43e34f71 4b71aa96 c945af01 2d182975', + '0734cde9 faddbda4 c066f7ed 54419ca5', + '2c85de1e 8aae4e6c'] + ] + ] + }); + } + } + + /** + * MONT448 + * Isomorphic to Ed448-Goldilocks. + */ + + class MONT448 extends MontCurve { + constructor() { + super({ + id: 'MONT448', + ossl: null, + type: 'mont', + endian: 'le', + hash: 'SHAKE256', + prime: 'p448', + // 2^448 - 2^224 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff'], + // -78160 / -39082 mod p + a: ['b2cf97d2 d43459a9 31ed36b1 fc4e3cb5', + '5d93f8d2 22746997 60ccffc6 49961ed6', + 'c5b05fca c24864ed 6fb59697 931b78da', + '84ddecd8 ca2b5cfb'], + b: '1', + n: ['3fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 7cca23e9', + 'c44edb49 aed63690 216cc272 8dc58f55', + '2378c292 ab5844f3'], + h: '4', + // Elligator 2 + z: '-1', + g: [ + ['ac0d24cc c6c75cb0 eb71f81e 7a6edf51', + '48e88aee 009a2a24 e795687e c28e125a', + '3e6730a6 0d46367b aa7fe99d 152128dc', + '41321bc7 7817f059'], + ['5a4437f6 80c0d0db 9b061276 d5d0ffcc', + 'e786ff33 b6a53d30 98746425 82e66f09', + '4433dae7 7244a6e2 6b11e905 7228f483', + '556c41a5 913f55fe'] + ], + torsion: [ + [], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['bec92fd0 6da2acf2 b4e261e8 7cef0d34', + '22e75c18 3c589857 b71924e5 73c2f9ce', + 'e18da5f2 466e2f39 3c2eedf0 f105a60a', + 'b40c717d 4f1e1fd7'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['4136d02f 925d530d 4b1d9e17 8310f2cb', + 'dd18a3e7 c3a767a8 48e6db19 8c3d0631', + '1e725a0d b991d0c6 c3d1120f 0efa59f5', + '4bf38e82 b0e1e028'] + ] + ] + }); + } + } + + /** + * ED25519 + * https://tools.ietf.org/html/rfc8032#section-5.1 + */ + + class ED25519 extends EdwardsCurve { + constructor(pre) { + super({ + id: 'ED25519', + ossl: 'ED25519', + type: 'edwards', + endian: 'le', + hash: 'SHA512', + prefix: 'SigEd25519 no Ed25519 collisions', + context: false, + prime: 'p25519', + // 2^255 - 19 (= 5 mod 8) + p: ['7fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffed'], + a: '-1', + // -121665 / 121666 mod p + d: ['52036cee 2b6ffe73 8cc74079 7779e898', + '00700a4d 4141d8ab 75eb4dca 135978a3'], + n: ['10000000 00000000 00000000 00000000', + '14def9de a2f79cd6 5812631a 5cf5d3ed'], + h: '8', + // Elligator 2 + z: '2', + g: [ + ['216936d3 cd6e53fe c0a4e231 fdd6dc5c', + '692cc760 9525a7b2 c9562d60 8f25d51a'], + // 4/5 + ['66666666 66666666 66666666 66666666', + '66666666 66666666 66666666 66666658'], + pre + ], + torsion: [ + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000001'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'], + ['7fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffec'] + ], + [ + ['2b832480 4fc1df0b 2b4d0099 3dfbd7a7', + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'] + ], + [ + ['547cdb7f b03e20f4 d4b2ff66 c2042858', + 'd0bce7f9 52d01b87 3b11e4d8 b5f15f3d'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'] + ], + [ + ['1fd5b9a0 06394a28 e9339932 38de4abb', + '5c193c70 13e5e238 dea14646 c545d14a'], + ['05fc536d 880238b1 3933c6d3 05acdfd5', + 'f098eff2 89f4c345 b027b2c2 8f95e826'] + ], + [ + ['602a465f f9c6b5d7 16cc66cd c721b544', + 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'], + ['05fc536d 880238b1 3933c6d3 05acdfd5', + 'f098eff2 89f4c345 b027b2c2 8f95e826'] + ], + [ + ['1fd5b9a0 06394a28 e9339932 38de4abb', + '5c193c70 13e5e238 dea14646 c545d14a'], + ['7a03ac92 77fdc74e c6cc392c fa53202a', + '0f67100d 760b3cba 4fd84d3d 706a17c7'] + ], + [ + ['602a465f f9c6b5d7 16cc66cd c721b544', + 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'], + ['7a03ac92 77fdc74e c6cc392c fa53202a', + '0f67100d 760b3cba 4fd84d3d 706a17c7'] + ] + ] + }); + } + } + + /** + * ISO448 + * https://tools.ietf.org/html/rfc7748#section-4.2 + * https://git.zx2c4.com/goldilocks/tree/_aux/ristretto/ristretto.sage#n658 + */ + + class ISO448 extends EdwardsCurve { + constructor(pre) { + super({ + id: 'ISO448', + ossl: null, + type: 'edwards', + endian: 'le', + hash: 'SHAKE256', + prefix: 'SigEd448', + context: true, + prime: 'p448', + // 2^448 - 2^224 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff'], + a: '1', + // 39082 / 39081 mod p + d: ['d78b4bdc 7f0daf19 f24f38c2 9373a2cc', + 'ad461572 42a50f37 809b1da3 412a12e7', + '9ccc9c81 264cfe9a d0809970 58fb61c4', + '243cc32d baa156b9'], + n: ['3fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 7cca23e9', + 'c44edb49 aed63690 216cc272 8dc58f55', + '2378c292 ab5844f3'], + h: '4', + // Elligator 2 + z: '-1', + g: [ + ['79a70b2b 70400553 ae7c9df4 16c792c6', + '1128751a c9296924 0c25a07d 728bdc93', + 'e21f7787 ed697224 9de732f3 8496cd11', + '69871309 3e9c04fc'], + // Note: the RFC has this wrong. + ['7fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 80000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'], + pre + ], + torsion: [ + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ] + ] + }); + } + } + + /** + * ED448 + * https://tools.ietf.org/html/rfc8032#section-5.2 + */ + + class ED448 extends EdwardsCurve { + constructor(pre) { + super({ + id: 'ED448', + ossl: 'ED448', + type: 'edwards', + endian: 'le', + hash: 'SHAKE256', + prefix: 'SigEd448', + context: true, + prime: 'p448', + // 2^448 - 2^224 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff'], + a: '1', + // -39081 mod p + d: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffff6756'], + n: ['3fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 7cca23e9', + 'c44edb49 aed63690 216cc272 8dc58f55', + '2378c292 ab5844f3'], + h: '4', + // Elligator 2 + z: '-1', + g: [ + ['4f1970c6 6bed0ded 221d15a6 22bf36da', + '9e146570 470f1767 ea6de324 a3d3a464', + '12ae1af7 2ab66511 433b80e1 8b00938e', + '2626a82b c70cc05e'], + ['693f4671 6eb6bc24 88762037 56c9c762', + '4bea7373 6ca39840 87789c1e 05a0c2d7', + '3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad', + '9808795b f230fa14'], + pre + ], + torsion: [ + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ] + ] + }); + } + } + + /* + * Curve Registry + */ + + const curves = { + __proto__: null, + P192, + P224, + P256, + P384, + P521, + SECP256K1, + BRAINPOOLP256, + BRAINPOOLP384, + BRAINPOOLP512, + X25519, + X448, + MONT448, + ED25519, + ISO448, + ED448 + }; + + const cache = { + __proto__: null, + P192: null, + P224: null, + P256: null, + P384: null, + P521: null, + SECP256K1: null, + BRAINPOOLP256: null, + BRAINPOOLP384: null, + BRAINPOOLP512: null, + X25519: null, + X448: null, + MONT448: null, + ED25519: null, + ISO448: null, + ED448: null + }; + + function curve(name, ...args) { + assert(typeof name === 'string'); + + const key = name.toUpperCase(); + + let curve = cache[key]; + + if (!curve) { + const Curve = curves[key]; + + if (!Curve) + throw new Error(`Curve not found: "${name}".`); + + curve = new Curve(...args); + cache[key] = curve; + } + + return curve; + } + + function register(name, Curve) { + assert(typeof name === 'string'); + assert(typeof Curve === 'function'); + + const key = name.toUpperCase(); + + if (curves[key]) + throw new Error(`Curve already registered: "${name}".`); + + curves[key] = Curve; + cache[key] = null; + } + + /* + * Scalar Recoding + */ -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`Wrong positive integer: ${n}`); -} -function bytes(b, ...lengths) { - if (!(b instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); -} -function hash(hash) { - if (typeof hash !== 'function' || typeof hash.create !== 'function') - throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(hash.outputLen); - number(hash.blockLen); -} -function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} - -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated, we can just drop the import. -const u8a = (a) => a instanceof Uint8Array; -const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -// Cast array to view -const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -// The rotate right (circular right shift) operation for uint32 -const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); -// big-endian hardware is rare. Just in case someone still decides to run hashes: -// early-throw an error because we don't support BE yet. -const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -if (!isLE) - throw new Error('Non little-endian hardware is not supported'); -// There is no setImmediate in browser and setTimeout is slow. -// call of async fn will return Promise, which will be fullfiled only on -// next scheduler queue processing step and this is exactly what we need. -const nextTick = async () => { }; -// Returns control to thread each 'tick' ms to avoid blocking -async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(); - ts += diff; - } -} -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - if (!u8a(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; -} -// For runtime check if class implements interface -class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } -} -const toStr = {}.toString; -function checkOpts(defaults, opts) { - if (opts !== undefined && toStr.call(opts) !== '[object Object]') - throw new Error('Options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; -} -function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; -} - -// HMAC (RFC 2104) -class HMAC extends Hash { - constructor(hash$1, _key) { - super(); - this.finished = false; - this.destroyed = false; - hash(hash$1); - const key = toBytes(_key); - this.iHash = hash$1.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash$1.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash$1.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - pad.fill(0); - } - update(buf) { - exists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - exists(this); - bytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} -/** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - */ -const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); -hmac.create = (hash, key) => new HMAC(hash, key); + function getNAF(k, width, max) { + // Computing the width-w NAF of a positive integer. + // + // [GECC] Algorithm 3.35, Page 100, Section 3.3. + // + // The above document describes a rather abstract + // method of recoding. The more optimal method + // below was ported from libsecp256k1. + assert(k instanceof BN); + assert(!k.red); + assert((width >>> 0) === width); + assert((max >>> 0) === max); -// Common prologue and epilogue for sync/async functions -function pbkdf2Init(hash$1, _password, _salt, _opts) { - hash(hash$1); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - number(c); - number(dkLen); - number(asyncTick); - if (c < 1) - throw new Error('PBKDF2: iterations (c) should be >= 1'); - const password = toBytes(_password); - const salt = toBytes(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash$1, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; -} -function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - u.fill(0); - return DK; -} -/** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - */ -function pbkdf2$1(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); -} - -// Polyfill for Safari 14 -function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -// Base SHA2 class (RFC 6234) -class SHA2 extends Hash { - constructor(blockLen, outputLen, padOffset, isLE) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - exists(this); - output(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } + const naf = new Array(max); + const bits = k.bitLength() + 1; + const sign = k.sign() | 1; + + assert(bits <= max); + + for (let i = 0; i < max; i++) + naf[i] = 0; + + let i = 0; + let carry = 0; + let word; + + while (i < bits) { + if (k.bit(i) === carry) { + i += 1; + continue; + } + + word = k.bits(i, width) + carry; + carry = (word >> (width - 1)) & 1; + word -= carry << width; + + naf[i] = sign * word; + + i += width; + } + + assert(carry === 0); + + return naf; + } + + function getFixedNAF(k, width, max, step) { + assert((step >>> 0) === step); + + // Recode to NAF. + const naf = getNAF(k, width, max); + + // Translate into more windowed form. + const len = Math.ceil(naf.length / step); + const repr = new Array(len); + + let i = 0; + + for (let j = 0; j < naf.length; j += step) { + let nafW = 0; + + for (let k = j + step - 1; k >= j; k--) + nafW = (nafW << 1) + naf[k]; + + repr[i++] = nafW; + } + + assert(i === len); + + return repr; + } + + function getJSF(k1, k2, max) { + // Joint sparse form. + // + // [GECC] Algorithm 3.50, Page 111, Section 3.3. + assert(k1 instanceof BN); + assert(k2 instanceof BN); + assert(!k1.red); + assert(!k2.red); + assert((max >>> 0) === max); + + const jsf = [new Array(max), new Array(max)]; + const bits = Math.max(k1.bitLength(), k2.bitLength()) + 1; + const s1 = k1.sign() | 1; + const s2 = k2.sign() | 1; + + assert(bits <= max); + + let d1 = 0; + let d2 = 0; + + for (let i = 0; i < bits; i++) { + const b1 = k1.bits(i, 3); + const b2 = k2.bits(i, 3); + + // First phase. + let m14 = ((b1 & 3) + d1) & 3; + let m24 = ((b2 & 3) + d2) & 3; + let u1 = 0; + let u2 = 0; + + if (m14 === 3) + m14 = -1; + + if (m24 === 3) + m24 = -1; + + if (m14 & 1) { + const m8 = ((b1 & 7) + d1) & 7; + + if ((m8 === 3 || m8 === 5) && m24 === 2) + u1 = -m14; + else + u1 = m14; + } + + if (m24 & 1) { + const m8 = ((b2 & 7) + d2) & 7; + + if ((m8 === 3 || m8 === 5) && m14 === 2) + u2 = -m24; + else + u2 = m24; + } + + jsf[0][i] = u1 * s1; + jsf[1][i] = u2 * s2; + + // Second phase. + if (2 * d1 === 1 + u1) + d1 = 1 - d1; + + if (2 * d2 === 1 + u2) + d2 = 1 - d2; + } + + for (let i = bits; i < max; i++) { + jsf[0][i] = 0; + jsf[1][i] = 0; + } + + return jsf; + } + + function getJNAF(c1, c2, max) { + const jsf = getJSF(c1, c2, max); + const naf = new Array(max); + + // JSF -> NAF conversion. + for (let i = 0; i < max; i++) { + const ja = jsf[0][i]; + const jb = jsf[1][i]; + + naf[i] = jsfIndex[(ja + 1) * 3 + (jb + 1)]; + } + + return naf; + } + + /* + * Helpers + */ + + function assert(val, msg) { + if (!val) { + const err = new Error(msg || 'Assertion failed'); + + if (Error.captureStackTrace) + Error.captureStackTrace(err, assert); + + throw err; + } + } + + function wrapErrors(fn) { + assert(typeof fn === 'function'); + + try { + return fn(); + } catch (e) { + if (e.message === 'X is not a square mod P.' + || e.message === 'Not invertible.') { + throw new Error('Invalid point.'); + } + throw e; + } + } + + function mod(x, y) { + // Euclidean modulo. + let r = x % y; + + if (r < 0) { + r += y; + } + + return r; + } + + function cubeRoot(x) { + assert(x instanceof BN); + assert(x.red); + + const p = x.red.m; + + if (p.cmpn(3) <= 0) + return x.clone(); + + // p = 2 mod 3 + if (p.modrn(3) === 2) { + // e = (2 * p - 1) / 3 + const e = p.ushln(1).isubn(1).idivn(3); + return x.redPow(e); + } + + const mod9 = p.modrn(9); + + // p = 4 mod 9 + if (mod9 === 4) { + // e = (2 * p + 1) / 9 + const e = p.ushln(1).iaddn(1).idivn(9); + const r = x.redPow(e); + const c = r.redSqr().redMul(r); + + if (!c.eq(x)) + throw new Error('X is not a cube mod P.'); + + return r; + } + + // p = 7 mod 9 + if (mod9 === 7) { + // e = (p + 2) / 9 + const e = p.addn(2).idivn(9); + const r = x.redPow(e); + const c = r.redSqr().redMul(r); + + if (!c.eq(x)) + throw new Error('X is not a cube mod P.'); + + return r; + } + + throw new Error('Not implemented.'); + } + + function cubeRoots(x) { + const r0 = cubeRoot(x); + + // p = 1 mod 3 + if (x.red.m.modrn(3) === 1) { + // Multiply by roots of unity to find other roots. + const two = new BN(2).toRed(x.red); + const three = new BN(3).toRed(x.red); + const i2 = two.redInvert(); + const s1 = three.redNeg().redSqrt().redMul(i2); + const s2 = s1.redNeg(); + const u1 = s1.redSub(i2); + const u2 = s2.redSub(i2); + const r1 = r0.redMul(u1); + const r2 = r0.redMul(u2); + + return [r0, r1, r2]; + } + + // p = 2 mod 3 guarantees 1 cube root per element. + return [r0]; + } + + function uncube(x) { + // Find a cube root which is also a quadratic residue. + for (const root of cubeRoots(x)) { + if (root.redJacobi() >= 0) + return root; + } + + throw new Error('X^(1/3) is not a square mod P.'); + } + + function randomInt(rng) { + return BN.randomBits(rng, 32).toNumber(); + } + + function memoize(method, self) { + const cache = new WeakMap(); + + return function memoized(curve, invert) { + const i = invert & 1; + const item = cache.get(curve); + + if (item && item[i] !== null) + return item[i]; + + const result = method.call(self, curve, invert); + + if (!cache.has(curve)) + cache.set(curve, [null, null]); + + cache.get(curve)[i] = result; + + return result; + }; + } + + function toPretty(x, size) { + assert(x instanceof BN); + assert((size >>> 0) === size); + + if (size & 7) + size += 8 - (size & 7); + + const str = x.toString(16, size); + const chunks = []; + const out = []; + + assert((str.length & 7) === 0); + + for (let i = 0; i < str.length; i += 8) + chunks.push(str.slice(i, i + 8)); + + for (let i = 0; i < chunks.length; i += 4) + out.push(chunks.slice(i, i + 4).join(' ')); + + return out; + } + + /* + * Expose + */ + + elliptic.Curve = Curve; + elliptic.Point = Point; + elliptic.ShortCurve = ShortCurve; + elliptic.ShortPoint = ShortPoint; + elliptic.JPoint = JPoint; + elliptic.MontCurve = MontCurve; + elliptic.MontPoint = MontPoint; + elliptic.XPoint = XPoint; + elliptic.EdwardsCurve = EdwardsCurve; + elliptic.EdwardsPoint = EdwardsPoint; + elliptic.curves = curves; + elliptic.curve = curve; + elliptic.register = register; + return elliptic; } -// SHA2-256 need to try 2^128 hashes to execute birthday attack. -// BTC network is doing 2^67 hashes/sec as per early 2023. -// Choice: a ? b : c -const Chi = (a, b, c) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); -// Round constants: -// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) -// prettier-ignore -const SHA256_K = /* @__PURE__ */ new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): -// prettier-ignore -const IV = /* @__PURE__ */ new Uint32Array([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -]); -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -class SHA256 extends SHA2 { - constructor() { - super(64, 32, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } +var random = {}; + +var hasRequiredRandom; + +function requireRandom () { + if (hasRequiredRandom) return random; + hasRequiredRandom = 1; + + const assert = requireAssert(); + + /* + * Constants + */ + + const crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto; + const HAS_CRYPTO = crypto && typeof crypto.getRandomValues === 'function'; + const randomValues = HAS_CRYPTO ? crypto.getRandomValues.bind(crypto) : null; + const pool = new Uint32Array(16); + const MAX_BYTES = 65536; + + let poolPos = 0; + + /** + * Generate pseudo-random bytes. + * @param {Number} size + * @returns {Buffer} + */ + + function randomBytes(size) { + assert((size >>> 0) === size); + + const data = bufferExports.Buffer.alloc(size); + + randomFillSync(data, 0, size); + + return data; + } + + /** + * Generate pseudo-random bytes. + * @param {Buffer} data + * @param {Number} [off=0] + * @param {Number} [size=data.length-off] + * @returns {Buffer} + */ + + function randomFill(data, off, size) { + assert(bufferExports.Buffer.isBuffer(data)); + + if (off == null) + off = 0; + + assert((off >>> 0) === off); + + if (size == null) + size = data.length - off; + + assert((size >>> 0) === size); + assert(off + size <= data.length); + + randomFillSync(data, off, size); + + return data; + } + + /** + * Generate a random uint32. + * @returns {Number} + */ + + function randomInt() { + if ((poolPos & 15) === 0) { + getRandomValues(pool); + poolPos = 0; + } + + return pool[poolPos++]; + } + + /** + * Generate a random uint32 within a range. + * @param {Number} min - Inclusive. + * @param {Number} max - Exclusive. + * @returns {Number} + */ + + function randomRange(min, max) { + assert((min >>> 0) === min); + assert((max >>> 0) === max); + assert(max >= min); + + const space = max - min; + + if (space === 0) + return min; + + const top = -space >>> 0; + + let x, r; + + do { + x = randomInt(); + r = x % space; + } while (x - r > top); + + return r + min; + } + + /* + * Helpers + */ + + function getRandomValues(array) { + if (!HAS_CRYPTO) + throw new Error('Entropy source not available.'); + + return randomValues(array); + } + + function randomFillSync(data, off, size) { + assert(bufferExports.Buffer.isBuffer(data)); + assert(data.buffer instanceof ArrayBuffer); + assert((data.byteOffset >>> 0) === data.byteOffset); + assert((data.byteLength >>> 0) === data.byteLength); + assert((off >>> 0) === off); + assert((size >>> 0) === size); + assert(off + size <= data.byteLength); + + if (size > 2 ** 31 - 1) + throw new RangeError('The value "size" is out of range.'); + + const offset = data.byteOffset + off; + const array = new Uint8Array(data.buffer, offset, size); + + if (array.length > MAX_BYTES) { + for (let i = 0; i < array.length; i += MAX_BYTES) { + let j = i + MAX_BYTES; + + if (j > array.length) + j = array.length; + + getRandomValues(array.subarray(i, j)); + } + } else { + if (array.length > 0) + getRandomValues(array); + } + } + + /* + * Expose + */ + + random.native = 0; + random.randomBytes = randomBytes; + random.randomFill = randomFill; + random.randomInt = randomInt; + random.randomRange = randomRange; + return random; } -/** - * SHA2-256 hash function - * @param message - data that would be hashed + +/*! + * random.js - random for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto */ -const sha256$1 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); -const _32n = /* @__PURE__ */ BigInt(32); -// We are not using BigUint64Array, because they are extremely slow as per 2022 -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -function split(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) -const shrSH = (h, _l, s) => h >>> s; -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -const rotr32L = (h, _l) => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, -}; -var u64$1 = u64; +var randomBrowser; +var hasRequiredRandomBrowser; + +function requireRandomBrowser () { + if (hasRequiredRandomBrowser) return randomBrowser; + hasRequiredRandomBrowser = 1; + + randomBrowser = requireRandom(); + return randomBrowser; +} + +var eddsa; +var hasRequiredEddsa; + +function requireEddsa () { + if (hasRequiredEddsa) return eddsa; + hasRequiredEddsa = 1; + + const assert = requireAssert(); + const BatchRNG = requireBatchRng(); + const BN = requireBnBrowser(); + const elliptic = requireElliptic(); + const rng = requireRandomBrowser(); + + /* + * EDDSA + */ + + class EDDSA { + constructor(id, mid, eid, hash, pre) { + assert(typeof id === 'string'); + assert(!mid || typeof mid === 'string'); + assert(!eid || typeof eid === 'string'); + assert(hash); + + this.id = id; + this.type = 'eddsa'; + this.mid = mid || null; + this.eid = eid || null; + this.hash = hash; + this.native = 0; + + this._pre = pre || null; + this._curve = null; + this._mont = null; + this._iso = null; + this._rng = null; + } + + get curve() { + if (!this._curve) { + this._curve = elliptic.curve(this.id, this._pre); + this._curve.precompute(rng); + this._pre = null; + } + return this._curve; + } + + get mont() { + if (this.mid && !this._mont) + this._mont = elliptic.curve(this.mid); + return this._mont; + } + + get iso() { + if (!this.eid) + return this.mont; + + if (!this._iso) + this._iso = elliptic.curve(this.eid); + + return this._iso; + } + + get rng() { + if (!this._rng) + this._rng = new BatchRNG(this.curve); + + return this._rng; + } + + get size() { + return this.curve.adjustedSize; + } + + get bits() { + return this.curve.fieldBits; + } + + hashNonce(prefix, msg, ph, ctx) { + const hash = new Hash(this); + + hash.init(ph, ctx); + hash.update(prefix); + hash.update(msg); + + return hash.final(); + } + + hashChallenge(R, A, m, ph, ctx) { + const hash = new Hash(this); + + hash.init(ph, ctx); + hash.update(R); + hash.update(A); + hash.update(m); + + return hash.final(); + } + + privateKeyGenerate() { + return rng.randomBytes(this.curve.adjustedSize); + } + + scalarGenerate() { + const scalar = rng.randomBytes(this.curve.scalarSize); + return this.curve.clamp(scalar); + } + + privateKeyExpand(secret) { + assert(bufferExports.Buffer.isBuffer(secret)); + assert(secret.length === this.curve.adjustedSize); + + const hash = this.hash.digest(secret, this.curve.adjustedSize * 2); + + return this.curve.splitHash(hash); + } + + privateKeyConvert(secret) { + const [key] = this.privateKeyExpand(secret); + return key; + } + + privateKeyVerify(secret) { + assert(bufferExports.Buffer.isBuffer(secret)); + return secret.length === this.curve.adjustedSize; + } + + scalarVerify(scalar) { + assert(bufferExports.Buffer.isBuffer(scalar)); + return scalar.length === this.curve.scalarSize; + } + + scalarIsZero(scalar) { + assert(bufferExports.Buffer.isBuffer(scalar)); + + let k; + try { + k = this.curve.decodeScalar(scalar).imod(this.curve.n); + } catch (e) { + return false; + } + + return k.isZero(); + } + + scalarClamp(scalar) { + assert(bufferExports.Buffer.isBuffer(scalar)); + assert(scalar.length === this.curve.scalarSize); + + return this.curve.clamp(bufferExports.Buffer.from(scalar)); + } + + privateKeyExport(secret) { + const pub = this.publicKeyCreate(secret); + const {x, y} = this.publicKeyExport(pub); + + return { + d: bufferExports.Buffer.from(secret), + x, + y + }; + } + + privateKeyImport(json) { + assert(json && typeof json === 'object'); + assert(bufferExports.Buffer.isBuffer(json.d)); + + if (json.d.length !== this.curve.adjustedSize) + throw new Error('Invalid private key.'); + + return bufferExports.Buffer.from(json.d); + } + + scalarTweakAdd(scalar, tweak) { + const a = this.curve.decodeScalar(scalar); + const t = this.curve.decodeScalar(tweak); + const k = a.add(t).imod(this.curve.n); + + return this.curve.encodeScalar(k); + } + + scalarTweakMul(scalar, tweak) { + const a = this.curve.decodeScalar(scalar); + const t = this.curve.decodeScalar(tweak); + const k = a.mul(t).imod(this.curve.n); + + return this.curve.encodeScalar(k); + } + + scalarReduce(scalar) { + const a = this.curve.decodeScalar(scalar); + const k = a.imod(this.curve.n); + + return this.curve.encodeScalar(k); + } + + scalarNegate(scalar) { + const a = this.curve.decodeScalar(scalar).imod(this.curve.n); + const k = a.neg().imod(this.curve.n); + + return this.curve.encodeScalar(k); + } + + scalarInvert(scalar) { + const a = this.curve.decodeScalar(scalar).imod(this.curve.n); + + if (a.isZero()) + return this.curve.encodeScalar(a); + + const k = a.invert(this.curve.n); + + return this.curve.encodeScalar(k); + } + + publicKeyCreate(secret) { + const key = this.privateKeyConvert(secret); + return this.publicKeyFromScalar(key); + } + + publicKeyFromScalar(scalar) { + const a = this.curve.decodeScalar(scalar).imod(this.curve.n); + const A = this.curve.g.mulBlind(a); + + return A.encode(); + } + + publicKeyConvert(key) { + if (!this.mont) + throw new Error('No equivalent montgomery curve.'); + + const A = this.curve.decodePoint(key); + const P = this.mont.pointFromEdwards(A); + + return P.encode(); + } + + publicKeyFromUniform(bytes) { + const u = this.curve.decodeUniform(bytes); + const A = this.curve.pointFromUniform(u, this.iso); + + return A.encode(); + } + + publicKeyToUniform(key, hint = rng.randomInt()) { + const A = this.curve.decodePoint(key); + const u = this.curve.pointToUniform(A, hint, this.iso); + + return this.curve.encodeUniform(u, hint >>> 8); + } + + publicKeyFromHash(bytes, pake = false) { + const A = this.curve.pointFromHash(bytes, pake, this.iso); + return A.encode(); + } + + publicKeyToHash(key, subgroup = rng.randomInt()) { + const A = this.curve.decodePoint(key); + return this.curve.pointToHash(A, subgroup, rng, this.iso); + } + + publicKeyVerify(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + try { + this.curve.decodePoint(key); + } catch (e) { + return false; + } + + return true; + } + + publicKeyIsInfinity(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + let A; + try { + A = this.curve.decodePoint(key); + } catch (e) { + return false; + } + + return A.isInfinity(); + } + + publicKeyIsSmall(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + let A; + try { + A = this.curve.decodePoint(key); + } catch (e) { + return false; + } + + return A.isSmall(); + } + + publicKeyHasTorsion(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + let A; + try { + A = this.curve.decodePoint(key); + } catch (e) { + return false; + } + + return A.hasTorsion(); + } + + publicKeyExport(key) { + const {x, y} = this.curve.decodePoint(key); + + return { + x: this.curve.encodeField(x.fromRed()), + y: this.curve.encodeField(y.fromRed()) + }; + } + + publicKeyImport(json) { + assert(json && typeof json === 'object'); + + let x = null; + let y = null; + let A; + + if (json.x != null) { + x = BN.decode(json.x, this.curve.endian); + + if (x.cmp(this.curve.p) >= 0) + throw new Error('Invalid point.'); + } + + if (json.y != null) { + y = BN.decode(json.y, this.curve.endian); + + if (y.cmp(this.curve.p) >= 0) + throw new Error('Invalid point.'); + } + + if (x && y) { + A = this.curve.point(x, y); + + if (!A.validate()) + throw new Error('Invalid point.'); + } else if (x) { + A = this.curve.pointFromX(x, json.sign); + } else if (y) { + A = this.curve.pointFromY(y, json.sign); + } else { + throw new Error('Invalid point.'); + } + + return A.encode(); + } + + publicKeyTweakAdd(key, tweak) { + const t = this.curve.decodeScalar(tweak).imod(this.curve.n); + const A = this.curve.decodePoint(key); + const T = this.curve.g.mul(t); + const P = T.add(A); + + return P.encode(); + } + + publicKeyTweakMul(key, tweak) { + const t = this.curve.decodeScalar(tweak); + const A = this.curve.decodePoint(key); + const P = A.mul(t); + + return P.encode(); + } + + publicKeyCombine(keys) { + assert(Array.isArray(keys)); + + let P = this.curve.point(); + + for (const key of keys) { + const A = this.curve.decodePoint(key); + + P = P.add(A); + } + + return P.encode(); + } + + publicKeyNegate(key) { + const A = this.curve.decodePoint(key); + const P = A.neg(); + + return P.encode(); + } + + sign(msg, secret, ph, ctx) { + const [key, prefix] = this.privateKeyExpand(secret); + return this.signWithScalar(msg, key, prefix, ph, ctx); + } + + signWithScalar(msg, scalar, prefix, ph, ctx) { + // EdDSA Signing. + // + // [EDDSA] Page 12, Section 4. + // [RFC8032] Page 8, Section 3.3. + // + // Assumptions: + // + // - Let `H` be a cryptographic hash function. + // - Let `m` be a byte array of arbitrary size. + // - Let `a` be a secret scalar. + // - Let `w` be a secret byte array. + // + // Computation: + // + // k = H(w, m) mod n + // R = G * k + // A = G * a + // e = H(R, A, m) mod n + // s = (k + e * a) mod n + // S = (R, s) + // + // Note that `k` must remain secret, + // otherwise an attacker can compute: + // + // a = (s - k) / e mod n + // + // The same is true of `w` as `k` + // can be re-derived as `H(w, m)`. + if (ctx == null) + ctx = bufferExports.Buffer.alloc(0); + + assert(bufferExports.Buffer.isBuffer(msg)); + assert(bufferExports.Buffer.isBuffer(prefix)); + assert(prefix.length === this.curve.adjustedSize); + + const {n} = this.curve; + const G = this.curve.g; + const k = this.hashNonce(prefix, msg, ph, ctx); + const Rraw = G.mulBlind(k).encode(); + const a = this.curve.decodeScalar(scalar); + const Araw = G.mulBlind(a).encode(); + const e = this.hashChallenge(Rraw, Araw, msg, ph, ctx); + const s = k.add(e.mul(a)).imod(n); + + return bufferExports.Buffer.concat([Rraw, this.curve.encodeAdjusted(s)]); + } + + signTweakAdd(msg, secret, tweak, ph, ctx) { + const [key_, prefix_] = this.privateKeyExpand(secret); + const key = this.scalarTweakAdd(key_, tweak); + const expanded = this.hash.multi(prefix_, tweak, null, + this.curve.adjustedSize * 2); + const prefix = expanded.slice(0, this.curve.adjustedSize); + + return this.signWithScalar(msg, key, prefix, ph, ctx); + } + + signTweakMul(msg, secret, tweak, ph, ctx) { + const [key_, prefix_] = this.privateKeyExpand(secret); + const key = this.scalarTweakMul(key_, tweak); + const expanded = this.hash.multi(prefix_, tweak, null, + this.curve.adjustedSize * 2); + const prefix = expanded.slice(0, this.curve.adjustedSize); + + return this.signWithScalar(msg, key, prefix, ph, ctx); + } + + verify(msg, sig, key, ph, ctx) { + if (ctx == null) + ctx = bufferExports.Buffer.alloc(0); + + assert(bufferExports.Buffer.isBuffer(msg)); + assert(bufferExports.Buffer.isBuffer(sig)); + assert(bufferExports.Buffer.isBuffer(key)); + assert(ph == null || typeof ph === 'boolean'); + assert(bufferExports.Buffer.isBuffer(ctx)); + + if (sig.length !== this.curve.adjustedSize * 2) + return false; + + if (key.length !== this.curve.adjustedSize) + return false; + + try { + return this._verify(msg, sig, key, ph, ctx); + } catch (e) { + return false; + } + } + + _verify(msg, sig, key, ph, ctx) { + // EdDSA Verification. + // + // [EDDSA] Page 15, Section 5. + // [RFC8032] Page 8, Section 3.4. + // + // Assumptions: + // + // - Let `H` be a cryptographic hash function. + // - Let `m` be a byte array of arbitrary size. + // - Let `R` and `s` be signature elements. + // - Let `A` be a valid group element. + // - s < n. + // + // Computation: + // + // e = H(R, A, m) mod n + // G * s == R + A * e + // + // Alternatively, we can compute: + // + // R == G * s - A * e + // + // This allows us to make use of a + // multi-exponentiation algorithm. + const {n} = this.curve; + const G = this.curve.g; + const Rraw = sig.slice(0, this.curve.adjustedSize); + const sraw = sig.slice(this.curve.adjustedSize); + const R = this.curve.decodePoint(Rraw); + const s = this.curve.decodeAdjusted(sraw); + const A = this.curve.decodePoint(key); + + if (s.cmp(n) >= 0) + return false; + + const e = this.hashChallenge(Rraw, key, msg, ph, ctx); + + return G.mulAdd(s, A.neg(), e).eq(R); + } + + verifySingle(msg, sig, key, ph, ctx) { + if (ctx == null) + ctx = bufferExports.Buffer.alloc(0); + + assert(bufferExports.Buffer.isBuffer(msg)); + assert(bufferExports.Buffer.isBuffer(sig)); + assert(bufferExports.Buffer.isBuffer(key)); + assert(ph == null || typeof ph === 'boolean'); + assert(bufferExports.Buffer.isBuffer(ctx)); + + if (sig.length !== this.curve.adjustedSize * 2) + return false; + + if (key.length !== this.curve.adjustedSize) + return false; + + try { + return this._verifySingle(msg, sig, key, ph, ctx); + } catch (e) { + return false; + } + } + + _verifySingle(msg, sig, key, ph, ctx) { + // EdDSA Verification (with cofactor multiplication). + // + // [EDDSA] Page 15, Section 5. + // [RFC8032] Page 8, Section 3.4. + // + // Assumptions: + // + // - Let `H` be a cryptographic hash function. + // - Let `m` be a byte array of arbitrary size. + // - Let `R` and `s` be signature elements. + // - Let `A` be a valid group element. + // - s < n. + // + // Computation: + // + // e = H(R, A, m) mod n + // (G * s) * h == (R + A * e) * h + // + // Alternatively, we can compute: + // + // R * h == G * (s * h) - (A * h) * e + // + // This allows us to make use of a + // multi-exponentiation algorithm. + const {n} = this.curve; + const G = this.curve.g; + const Rraw = sig.slice(0, this.curve.adjustedSize); + const sraw = sig.slice(this.curve.adjustedSize); + const R = this.curve.decodePoint(Rraw); + const s = this.curve.decodeAdjusted(sraw); + const A = this.curve.decodePoint(key); + + if (s.cmp(n) >= 0) + return false; + + const e = this.hashChallenge(Rraw, key, msg, ph, ctx); + const sh = this.curve.imulH(s); + const Ah = A.mulH(); + const Rh = R.mulH(); + + return G.mulAdd(sh, Ah.neg(), e).eq(Rh); + } + + verifyBatch(batch, ph, ctx) { + if (ctx == null) + ctx = bufferExports.Buffer.alloc(0); + + assert(Array.isArray(batch)); + assert(ph == null || typeof ph === 'boolean'); + assert(bufferExports.Buffer.isBuffer(ctx)); + + for (const item of batch) { + assert(Array.isArray(item) && item.length === 3); + + const [msg, sig, key] = item; + + assert(bufferExports.Buffer.isBuffer(msg)); + assert(bufferExports.Buffer.isBuffer(sig)); + assert(bufferExports.Buffer.isBuffer(key)); + + if (sig.length !== this.curve.adjustedSize * 2) + return false; + + if (key.length !== this.curve.adjustedSize) + return false; + } + + try { + return this._verifyBatch(batch, ph, ctx); + } catch (e) { + return false; + } + } + + _verifyBatch(batch, ph, ctx) { + // EdDSA Batch Verification. + // + // [EDDSA] Page 16, Section 5. + // + // Assumptions: + // + // - Let `H` be a cryptographic hash function. + // - Let `R` and `s` be signature elements. + // - Let `A` be a valid group element. + // - Let `i` be the batch item index. + // - s < n. + // - a1 = 1 mod n. + // + // Computation: + // + // ei = H(Ri, Ai, mi) mod n + // ai = random integer in [1,n-1] + // lhs = (si * ai + ...) * h mod n + // rhs = (Ri * h) * ai + (Ai * h) * (ei * ai mod n) + ... + // G * -lhs + rhs == O + const {n} = this.curve; + const G = this.curve.g; + const points = new Array(1 + batch.length * 2); + const coeffs = new Array(1 + batch.length * 2); + const sum = new BN(0); + + this.rng.init(batch); + + points[0] = G; + coeffs[0] = sum; + + for (let i = 0; i < batch.length; i++) { + const [msg, sig, key] = batch[i]; + const Rraw = sig.slice(0, this.curve.adjustedSize); + const sraw = sig.slice(this.curve.adjustedSize); + const R = this.curve.decodePoint(Rraw); + const s = this.curve.decodeAdjusted(sraw); + const A = this.curve.decodePoint(key); + + if (s.cmp(n) >= 0) + return false; + + const e = this.hashChallenge(Rraw, key, msg, ph, ctx); + const a = this.rng.generate(i); + const ea = e.mul(a).imod(n); + + sum.iadd(s.mul(a)).imod(n); + + points[1 + i * 2 + 0] = R.mulH(); + coeffs[1 + i * 2 + 0] = a; + points[1 + i * 2 + 1] = A.mulH(); + coeffs[1 + i * 2 + 1] = ea; + } + + this.curve.imulH(sum.ineg()); + + return this.curve.mulAll(points, coeffs).isInfinity(); + } + + derive(pub, secret) { + const scalar = this.privateKeyConvert(secret); + return this.deriveWithScalar(pub, scalar); + } + + deriveWithScalar(pub, scalar) { + const A = this.curve.decodePoint(pub); + const a = this.curve.decodeClamped(scalar); + const P = A.mulBlind(a, rng); + + if (P.isInfinity()) + throw new Error('Invalid point.'); + + return P.encode(); + } + } + + /* + * Hash + */ + + class Hash { + constructor(eddsa) { + this.curve = eddsa.curve; + // eslint-disable-next-line + this.hash = new eddsa.hash(); + } + + init(ph, ctx) { + assert(ph == null || typeof ph === 'boolean'); + assert(bufferExports.Buffer.isBuffer(ctx)); -// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409): -// prettier-ignore -const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64$1.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -// Temporary buffer, not used to store anything between runs -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -class SHA512 extends SHA2 { - constructor() { - super(128, 64, 16, false); - // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers. - // Also looks cleaner and easier to verify with spec. - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x6a09e667 | 0; - this.Al = 0xf3bcc908 | 0; - this.Bh = 0xbb67ae85 | 0; - this.Bl = 0x84caa73b | 0; - this.Ch = 0x3c6ef372 | 0; - this.Cl = 0xfe94f82b | 0; - this.Dh = 0xa54ff53a | 0; - this.Dl = 0x5f1d36f1 | 0; - this.Eh = 0x510e527f | 0; - this.El = 0xade682d1 | 0; - this.Fh = 0x9b05688c | 0; - this.Fl = 0x2b3e6c1f | 0; - this.Gh = 0x1f83d9ab | 0; - this.Gl = 0xfb41bd6b | 0; - this.Hh = 0x5be0cd19 | 0; - this.Hl = 0x137e2179 | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64$1.rotrSH(W15h, W15l, 1) ^ u64$1.rotrSH(W15h, W15l, 8) ^ u64$1.shrSH(W15h, W15l, 7); - const s0l = u64$1.rotrSL(W15h, W15l, 1) ^ u64$1.rotrSL(W15h, W15l, 8) ^ u64$1.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64$1.rotrSH(W2h, W2l, 19) ^ u64$1.rotrBH(W2h, W2l, 61) ^ u64$1.shrSH(W2h, W2l, 6); - const s1l = u64$1.rotrSL(W2h, W2l, 19) ^ u64$1.rotrBL(W2h, W2l, 61) ^ u64$1.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64$1.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64$1.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64$1.rotrSH(Eh, El, 14) ^ u64$1.rotrSH(Eh, El, 18) ^ u64$1.rotrBH(Eh, El, 41); - const sigma1l = u64$1.rotrSL(Eh, El, 14) ^ u64$1.rotrSL(Eh, El, 18) ^ u64$1.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64$1.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64$1.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64$1.rotrSH(Ah, Al, 28) ^ u64$1.rotrBH(Ah, Al, 34) ^ u64$1.rotrBH(Ah, Al, 39); - const sigma0l = u64$1.rotrSL(Ah, Al, 28) ^ u64$1.rotrBL(Ah, Al, 34) ^ u64$1.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64$1.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64$1.add3L(T1l, sigma0l, MAJl); - Ah = u64$1.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64$1.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64$1.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64$1.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64$1.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64$1.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64$1.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64$1.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64$1.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - SHA512_W_H.fill(0); - SHA512_W_L.fill(0); - } - destroy() { - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -const sha512$1 = /* @__PURE__ */ wrapConstructor(() => new SHA512()); + if (ctx.length > 255) + ctx = ctx.slice(0, 255); -// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. -// It's called a sponge function. -// Various per round constants calculations -const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -const _7n = /* @__PURE__ */ BigInt(7); -const _256n = /* @__PURE__ */ BigInt(256); -const _0x71n = /* @__PURE__ */ BigInt(0x71); -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); + this.hash.init(); + + if (this.curve.context || ph != null || ctx.length > 0) { + if (this.curve.prefix) + this.hash.update(this.curve.prefix); + + this.hash.update(byte(ph)); + this.hash.update(byte(ctx.length)); + this.hash.update(ctx); + } + + return this; + } + + update(data) { + this.hash.update(data); + return this; + } + + final() { + const hash = this.hash.final(this.curve.adjustedSize * 2); + const num = BN.decode(hash, this.curve.endian); + + return num.imod(this.curve.n); + } + } + + /* + * Helpers + */ + + function byte(ch) { + const buf = bufferExports.Buffer.alloc(1); + buf[0] = ch & 0xff; + return buf; + } + + /* + * Expose + */ + + eddsa = EDDSA; + return eddsa; } -const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true); -// Left rotation (without 0, 32, 64) -const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); -// Same as keccakf1600, but allows to skip some rounds -function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - B.fill(0); + +var keccak; +var hasRequiredKeccak; + +function requireKeccak () { + if (hasRequiredKeccak) return keccak; + hasRequiredKeccak = 1; + + const assert = requireAssert(); + const HMAC = requireHmac(); + + /* + * Constants + */ + + const FINALIZED = 0x80000000; + + const ROUND_CONST = new Uint32Array([ + 0x00000001, 0x00000000, 0x00008082, 0x00000000, + 0x0000808a, 0x80000000, 0x80008000, 0x80000000, + 0x0000808b, 0x00000000, 0x80000001, 0x00000000, + 0x80008081, 0x80000000, 0x00008009, 0x80000000, + 0x0000008a, 0x00000000, 0x00000088, 0x00000000, + 0x80008009, 0x00000000, 0x8000000a, 0x00000000, + 0x8000808b, 0x00000000, 0x0000008b, 0x80000000, + 0x00008089, 0x80000000, 0x00008003, 0x80000000, + 0x00008002, 0x80000000, 0x00000080, 0x80000000, + 0x0000800a, 0x00000000, 0x8000000a, 0x80000000, + 0x80008081, 0x80000000, 0x00008080, 0x80000000, + 0x80000001, 0x00000000, 0x80008008, 0x80000000 + ]); + + /** + * Keccak + */ + + class Keccak { + constructor() { + this.state = new Uint32Array(50); + this.block = bufferExports.Buffer.alloc(200); + this.bs = 136; + this.pos = FINALIZED; + } + + init(bits) { + if (bits == null) + bits = 256; + + assert((bits >>> 0) === bits); + assert(bits >= 128); + assert(bits <= 512); + + const rate = 1600 - bits * 2; + + assert(rate >= 0 && (rate & 63) === 0); + + this.bs = rate >>> 3; + this.pos = 0; + + return this; + } + + update(data) { + assert(bufferExports.Buffer.isBuffer(data)); + assert(!(this.pos & FINALIZED), 'Context is not initialized.'); + + let len = data.length; + let pos = this.pos; + let off = 0; + + this.pos = (this.pos + len) % this.bs; + + if (pos > 0) { + let want = this.bs - pos; + + if (want > len) + want = len; + + data.copy(this.block, pos, off, off + want); + + pos += want; + len -= want; + off += want; + + if (pos < this.bs) + return this; + + this._transform(this.block, 0); + } + + while (len >= this.bs) { + this._transform(data, off); + off += this.bs; + len -= this.bs; + } + + if (len > 0) + data.copy(this.block, 0, off, off + len); + + return this; + } + + final(pad, len) { + if (pad == null) + pad = 0x01; + + if (len == null || len === 0) + len = 100 - (this.bs >>> 1); + + assert((pad & 0xff) === pad); + assert((len >>> 0) === len); + assert(!(this.pos & FINALIZED), 'Context is not initialized.'); + + this.block.fill(0, this.pos, this.bs); + this.block[this.pos] |= pad; + this.block[this.bs - 1] |= 0x80; + this._transform(this.block, 0); + this.pos = FINALIZED; + + assert(len <= this.bs); + + const out = bufferExports.Buffer.alloc(len); + + for (let i = 0; i < len; i++) + out[i] = this.state[i >>> 2] >>> (8 * (i & 3)); + + for (let i = 0; i < 50; i++) + this.state[i] = 0; + + for (let i = 0; i < this.bs; i++) + this.block[i] = 0; + + return out; + } + + _transform(block, off) { + const count = this.bs >>> 2; + const s = this.state; + + for (let i = 0; i < count; i++) + s[i] ^= readU32(block, off + i * 4); + + for (let n = 0; n < 48; n += 2) { + const c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]; + const c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]; + const c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]; + const c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43]; + const c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44]; + const c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45]; + const c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46]; + const c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47]; + const c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48]; + const c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49]; + + const h0 = c8 ^ ((c2 << 1) | (c3 >>> 31)); + const l0 = c9 ^ ((c3 << 1) | (c2 >>> 31)); + const h1 = c0 ^ ((c4 << 1) | (c5 >>> 31)); + const l1 = c1 ^ ((c5 << 1) | (c4 >>> 31)); + const h2 = c2 ^ ((c6 << 1) | (c7 >>> 31)); + const l2 = c3 ^ ((c7 << 1) | (c6 >>> 31)); + const h3 = c4 ^ ((c8 << 1) | (c9 >>> 31)); + const l3 = c5 ^ ((c9 << 1) | (c8 >>> 31)); + const h4 = c6 ^ ((c0 << 1) | (c1 >>> 31)); + const l4 = c7 ^ ((c1 << 1) | (c0 >>> 31)); + + s[0] ^= h0; + s[1] ^= l0; + s[10] ^= h0; + s[11] ^= l0; + s[20] ^= h0; + s[21] ^= l0; + s[30] ^= h0; + s[31] ^= l0; + s[40] ^= h0; + s[41] ^= l0; + + s[2] ^= h1; + s[3] ^= l1; + s[12] ^= h1; + s[13] ^= l1; + s[22] ^= h1; + s[23] ^= l1; + s[32] ^= h1; + s[33] ^= l1; + s[42] ^= h1; + s[43] ^= l1; + + s[4] ^= h2; + s[5] ^= l2; + s[14] ^= h2; + s[15] ^= l2; + s[24] ^= h2; + s[25] ^= l2; + s[34] ^= h2; + s[35] ^= l2; + s[44] ^= h2; + s[45] ^= l2; + + s[6] ^= h3; + s[7] ^= l3; + s[16] ^= h3; + s[17] ^= l3; + s[26] ^= h3; + s[27] ^= l3; + s[36] ^= h3; + s[37] ^= l3; + s[46] ^= h3; + s[47] ^= l3; + + s[8] ^= h4; + s[9] ^= l4; + s[18] ^= h4; + s[19] ^= l4; + s[28] ^= h4; + s[29] ^= l4; + s[38] ^= h4; + s[39] ^= l4; + s[48] ^= h4; + s[49] ^= l4; + + const b0 = s[0]; + const b1 = s[1]; + const b32 = (s[11] << 4) | (s[10] >>> 28); + const b33 = (s[10] << 4) | (s[11] >>> 28); + const b14 = (s[20] << 3) | (s[21] >>> 29); + const b15 = (s[21] << 3) | (s[20] >>> 29); + const b46 = (s[31] << 9) | (s[30] >>> 23); + const b47 = (s[30] << 9) | (s[31] >>> 23); + const b28 = (s[40] << 18) | (s[41] >>> 14); + const b29 = (s[41] << 18) | (s[40] >>> 14); + const b20 = (s[2] << 1) | (s[3] >>> 31); + const b21 = (s[3] << 1) | (s[2] >>> 31); + const b2 = (s[13] << 12) | (s[12] >>> 20); + const b3 = (s[12] << 12) | (s[13] >>> 20); + const b34 = (s[22] << 10) | (s[23] >>> 22); + const b35 = (s[23] << 10) | (s[22] >>> 22); + const b16 = (s[33] << 13) | (s[32] >>> 19); + const b17 = (s[32] << 13) | (s[33] >>> 19); + const b48 = (s[42] << 2) | (s[43] >>> 30); + const b49 = (s[43] << 2) | (s[42] >>> 30); + const b40 = (s[5] << 30) | (s[4] >>> 2); + const b41 = (s[4] << 30) | (s[5] >>> 2); + const b22 = (s[14] << 6) | (s[15] >>> 26); + const b23 = (s[15] << 6) | (s[14] >>> 26); + const b4 = (s[25] << 11) | (s[24] >>> 21); + const b5 = (s[24] << 11) | (s[25] >>> 21); + const b36 = (s[34] << 15) | (s[35] >>> 17); + const b37 = (s[35] << 15) | (s[34] >>> 17); + const b18 = (s[45] << 29) | (s[44] >>> 3); + const b19 = (s[44] << 29) | (s[45] >>> 3); + const b10 = (s[6] << 28) | (s[7] >>> 4); + const b11 = (s[7] << 28) | (s[6] >>> 4); + const b42 = (s[17] << 23) | (s[16] >>> 9); + const b43 = (s[16] << 23) | (s[17] >>> 9); + const b24 = (s[26] << 25) | (s[27] >>> 7); + const b25 = (s[27] << 25) | (s[26] >>> 7); + const b6 = (s[36] << 21) | (s[37] >>> 11); + const b7 = (s[37] << 21) | (s[36] >>> 11); + const b38 = (s[47] << 24) | (s[46] >>> 8); + const b39 = (s[46] << 24) | (s[47] >>> 8); + const b30 = (s[8] << 27) | (s[9] >>> 5); + const b31 = (s[9] << 27) | (s[8] >>> 5); + const b12 = (s[18] << 20) | (s[19] >>> 12); + const b13 = (s[19] << 20) | (s[18] >>> 12); + const b44 = (s[29] << 7) | (s[28] >>> 25); + const b45 = (s[28] << 7) | (s[29] >>> 25); + const b26 = (s[38] << 8) | (s[39] >>> 24); + const b27 = (s[39] << 8) | (s[38] >>> 24); + const b8 = (s[48] << 14) | (s[49] >>> 18); + const b9 = (s[49] << 14) | (s[48] >>> 18); + + s[0] = b0 ^ (~b2 & b4); + s[1] = b1 ^ (~b3 & b5); + s[10] = b10 ^ (~b12 & b14); + s[11] = b11 ^ (~b13 & b15); + s[20] = b20 ^ (~b22 & b24); + s[21] = b21 ^ (~b23 & b25); + s[30] = b30 ^ (~b32 & b34); + s[31] = b31 ^ (~b33 & b35); + s[40] = b40 ^ (~b42 & b44); + s[41] = b41 ^ (~b43 & b45); + s[2] = b2 ^ (~b4 & b6); + s[3] = b3 ^ (~b5 & b7); + s[12] = b12 ^ (~b14 & b16); + s[13] = b13 ^ (~b15 & b17); + s[22] = b22 ^ (~b24 & b26); + s[23] = b23 ^ (~b25 & b27); + s[32] = b32 ^ (~b34 & b36); + s[33] = b33 ^ (~b35 & b37); + s[42] = b42 ^ (~b44 & b46); + s[43] = b43 ^ (~b45 & b47); + s[4] = b4 ^ (~b6 & b8); + s[5] = b5 ^ (~b7 & b9); + s[14] = b14 ^ (~b16 & b18); + s[15] = b15 ^ (~b17 & b19); + s[24] = b24 ^ (~b26 & b28); + s[25] = b25 ^ (~b27 & b29); + s[34] = b34 ^ (~b36 & b38); + s[35] = b35 ^ (~b37 & b39); + s[44] = b44 ^ (~b46 & b48); + s[45] = b45 ^ (~b47 & b49); + s[6] = b6 ^ (~b8 & b0); + s[7] = b7 ^ (~b9 & b1); + s[16] = b16 ^ (~b18 & b10); + s[17] = b17 ^ (~b19 & b11); + s[26] = b26 ^ (~b28 & b20); + s[27] = b27 ^ (~b29 & b21); + s[36] = b36 ^ (~b38 & b30); + s[37] = b37 ^ (~b39 & b31); + s[46] = b46 ^ (~b48 & b40); + s[47] = b47 ^ (~b49 & b41); + s[8] = b8 ^ (~b0 & b2); + s[9] = b9 ^ (~b1 & b3); + s[18] = b18 ^ (~b10 & b12); + s[19] = b19 ^ (~b11 & b13); + s[28] = b28 ^ (~b20 & b22); + s[29] = b29 ^ (~b21 & b23); + s[38] = b38 ^ (~b30 & b32); + s[39] = b39 ^ (~b31 & b33); + s[48] = b48 ^ (~b40 & b42); + s[49] = b49 ^ (~b41 & b43); + + s[0] ^= ROUND_CONST[n + 0]; + s[1] ^= ROUND_CONST[n + 1]; + } + } + + static hash() { + return new Keccak(); + } + + static hmac(bits, pad, len) { + if (bits == null) + bits = 256; + + assert((bits >>> 0) === bits); + + const rate = 1600 - bits * 2; + + assert(rate >= 0 && (rate & 63) === 0); + + return new HMAC(Keccak, rate >>> 3, [bits], [pad, len]); + } + + static digest(data, bits, pad, len) { + return Keccak.ctx.init(bits).update(data).final(pad, len); + } + + static root(left, right, bits, pad, len) { + if (bits == null) + bits = 256; + + if (len == null) + len = 0; + + if (len === 0) + len = bits >>> 3; + + assert((bits >>> 0) === bits); + assert((bits & 7) === 0); + assert((len >>> 0) === len); + assert(bufferExports.Buffer.isBuffer(left) && left.length === len); + assert(bufferExports.Buffer.isBuffer(right) && right.length === len); + + return Keccak.ctx.init(bits).update(left).update(right).final(pad, len); + } + + static multi(x, y, z, bits, pad, len) { + const {ctx} = Keccak; + + ctx.init(bits); + ctx.update(x); + ctx.update(y); + + if (z) + ctx.update(z); + + return ctx.final(pad, len); + } + + static mac(data, key, bits, pad, len) { + return Keccak.hmac(bits, pad, len).init(key).update(data).final(); + } + } + + /* + * Static + */ + + Keccak.native = 0; + Keccak.id = 'KECCAK256'; + Keccak.size = 32; + Keccak.bits = 256; + Keccak.blockSize = 136; + Keccak.zero = bufferExports.Buffer.alloc(32, 0x00); + Keccak.ctx = new Keccak(); + + /* + * Helpers + */ + + function readU32(data, off) { + return (data[off++] + + data[off++] * 0x100 + + data[off++] * 0x10000 + + data[off] * 0x1000000); + } + + /* + * Expose + */ + + keccak = Keccak; + return keccak; } -class Keccak extends Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - // Can be passed from user as dkLen - number(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - keccak() { - keccakP(this.state32, this.rounds); - this.posOut = 0; - this.pos = 0; - } - update(data) { - exists(this); - const { blockLen, state } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - exists(this, false); - bytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - number(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - output(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } + +/*! + * keccak.js - keccak for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + +var keccakBrowser; +var hasRequiredKeccakBrowser; + +function requireKeccakBrowser () { + if (hasRequiredKeccakBrowser) return keccakBrowser; + hasRequiredKeccakBrowser = 1; + + keccakBrowser = requireKeccak(); + return keccakBrowser; } -const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); -/** - * SHA3-256 hash function - * @param message - that would be hashed + +var shake; +var hasRequiredShake; + +function requireShake () { + if (hasRequiredShake) return shake; + hasRequiredShake = 1; + + const Keccak = requireKeccakBrowser(); + + /** + * SHAKE + */ + + class SHAKE extends Keccak { + /** + * Create a SHAKE Context. + * @constructor + */ + + constructor() { + super(); + } + + final(len) { + return super.final(0x1f, len); + } + + static hash() { + return new SHAKE(); + } + + static hmac(bits, len) { + return super.hmac(bits, 0x1f, len); + } + + static digest(data, bits, len) { + return super.digest(data, bits, 0x1f, len); + } + + static root(left, right, bits, len) { + return super.root(left, right, bits, 0x1f, len); + } + + static multi(x, y, z, bits, len) { + return super.multi(x, y, z, bits, 0x1f, len); + } + + static mac(data, key, bits, len) { + return super.mac(data, key, bits, 0x1f, len); + } + } + + /* + * Static + */ + + SHAKE.native = Keccak.native; + SHAKE.id = 'SHAKE256'; + SHAKE.size = 32; + SHAKE.bits = 256; + SHAKE.blockSize = 136; + SHAKE.zero = bufferExports.Buffer.alloc(32, 0x00); + SHAKE.ctx = new SHAKE(); + + /* + * Expose + */ + + shake = SHAKE; + return shake; +} + +var shake256; +var hasRequiredShake256; + +function requireShake256 () { + if (hasRequiredShake256) return shake256; + hasRequiredShake256 = 1; + + const SHAKE = requireShake(); + + /** + * SHAKE256 + */ + + class SHAKE256 extends SHAKE { + constructor() { + super(); + } + + init() { + return super.init(256); + } + + static hash() { + return new SHAKE256(); + } + + static hmac(len) { + return super.hmac(256, len); + } + + static digest(data, len) { + return super.digest(data, 256, len); + } + + static root(left, right, len) { + return super.root(left, right, 256, len); + } + + static multi(x, y, z, len) { + return super.multi(x, y, z, 256, len); + } + + static mac(data, key, len) { + return super.mac(data, key, 256, len); + } + } + + /* + * Static + */ + + SHAKE256.native = SHAKE.native; + SHAKE256.id = 'SHAKE256'; + SHAKE256.size = 32; + SHAKE256.bits = 256; + SHAKE256.blockSize = 136; + SHAKE256.zero = bufferExports.Buffer.alloc(32, 0x00); + SHAKE256.ctx = new SHAKE256(); + + /* + * Expose + */ + + shake256 = SHAKE256; + return shake256; +} + +/*! + * ed448.js - ed448 for bcrypto + * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + * + * Resources: + * https://eprint.iacr.org/2015/625.pdf + * https://tools.ietf.org/html/rfc8032#section-5.2 */ -const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8); -const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8); -/** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed + +var ed448$1; +var hasRequiredEd448; + +function requireEd448 () { + if (hasRequiredEd448) return ed448$1; + hasRequiredEd448 = 1; + + const EDDSA = requireEddsa(); + const SHAKE256 = requireShake256(); + + /* + * Expose + */ + + ed448$1 = new EDDSA('ED448', 'X448', 'MONT448', SHAKE256); + return ed448$1; +} + +/*! + * ed448.js - ed448 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto */ -const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8); + +var ed448Browser; +var hasRequiredEd448Browser; + +function requireEd448Browser () { + if (hasRequiredEd448Browser) return ed448Browser; + hasRequiredEd448Browser = 1; + + ed448Browser = requireEd448(); + return ed448Browser; +} + +var ed448BrowserExports = requireEd448Browser(); +var backend = /*@__PURE__*/getDefaultExportFromCjs(ed448BrowserExports); + +// bcrypto does not ship TypeScript declarations. +// @ts-ignore +const ed448 = backend; /** * Some mathematic operations. @@ -3713,7 +28763,7 @@ function checkValue(val, format, safeOp) { fault: "overflow", value: val, }); - val = ((val % limit) + limit) % limit & (limit - BN_1$4); + val = (((val % limit) + limit) % limit) & (limit - BN_1$4); } return val; } @@ -3881,27 +28931,27 @@ class FixedNumber { } #checkValue(val, safeOp) { /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - + const width = BigInt(this.width); + if (this.signed) { + const limit = (BN_1 << (width - BN_1)); + assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { + operation: safeOp, fault: "overflow", value: val + }); + + if (val > BN_0) { + val = fromTwos(mask(val, width), width); } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; + val = -fromTwos(mask(-val, width), width); } - */ + + } else { + const masked = mask(val, width); + assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { + operation: safeOp, fault: "overflow", value: val + }); + val = masked; + } +*/ val = checkValue(val, this.#format, safeOp); return new _a$1(_guard$5, val, this.#format); } @@ -4511,44 +29561,369 @@ function parseUnits(value, unit) { function formatXCB(ore) { return formatUnits(ore, 18); } -/** - * Converts the //decimal string// %%xcb%% to a BigInt, using 18 - * decimal places. +/** + * Converts the //decimal string// %%xcb%% to a BigInt, using 18 + * decimal places. + */ +function parseXCB(xcb) { + return parseUnits(xcb, 18); +} + +/** + * Explain UUID and link to RFC here. + * + * @_subsection: api/utils:UUID [about-uuid] + */ +/** + * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. + * + * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) + */ +function uuidV4(randomBytes) { + const bytes = getBytes(randomBytes, "randomBytes"); + // Section: 4.1.3: + // - time_hi_and_version[12:16] = 0b0100 + bytes[6] = (bytes[6] & 0x0f) | 0x40; + // Section 4.4 + // - clock_seq_hi_and_reserved[6] = 0b0 + // - clock_seq_hi_and_reserved[7] = 0b1 + bytes[8] = (bytes[8] & 0x3f) | 0x80; + const value = hexlify(bytes); + return [ + value.substring(2, 10), + value.substring(10, 14), + value.substring(14, 18), + value.substring(18, 22), + value.substring(22, 34), + ].join("-"); +} + +var pbkdf2$2 = {}; + +var hasRequiredPbkdf2; + +function requirePbkdf2 () { + if (hasRequiredPbkdf2) return pbkdf2$2; + hasRequiredPbkdf2 = 1; + + const assert = requireAssert(); + const crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto || {}; + const subtle = crypto.subtle || {}; + + /** + * Perform key derivation using PBKDF2. + * @param {Function} hash + * @param {Buffer} pass + * @param {Buffer} salt + * @param {Number} iter + * @param {Number} len + * @returns {Buffer} + */ + + function derive(hash, pass, salt, iter, len) { + if (typeof pass === 'string') + pass = bufferExports.Buffer.from(pass, 'utf8'); + + if (typeof salt === 'string') + salt = bufferExports.Buffer.from(salt, 'utf8'); + + if (salt == null) + salt = bufferExports.Buffer.alloc(0); + + assert(hash && typeof hash.id === 'string'); + assert(bufferExports.Buffer.isBuffer(pass)); + assert(bufferExports.Buffer.isBuffer(salt)); + assert((iter >>> 0) === iter); + assert((len >>> 0) === len); + + const size = hash.size; + const blocks = Math.ceil(len / size); + const out = bufferExports.Buffer.alloc(blocks * size); + const state = bufferExports.Buffer.alloc(salt.length + 4); + + salt.copy(state, 0); + + // Preemptively shorten key. + if (pass.length > hash.blockSize) { + pass = hash.digest(pass); + assert(pass.length <= hash.blockSize); + } + + for (let i = 0; i < blocks; i++) { + const round = i + 1; + + state[salt.length + 0] = round >>> 24; + state[salt.length + 1] = round >>> 16; + state[salt.length + 2] = round >>> 8; + state[salt.length + 3] = round; + + const block = hash.mac(state, pass); + + let mac = block; + + for (let j = 1; j < iter; j++) { + mac = hash.mac(mac, pass); + + for (let k = 0; k < size; k++) + block[k] ^= mac[k]; + } + + block.copy(out, i * size); + } + + return out.slice(0, len); + } + + /** + * Execute pbkdf2 asynchronously. + * @param {Function} hash + * @param {Buffer} pass + * @param {Buffer} salt + * @param {Number} iter + * @param {Number} len + * @returns {Promise} + */ + + async function deriveAsync(hash, pass, salt, iter, len) { + if (typeof pass === 'string') + pass = bufferExports.Buffer.from(pass, 'utf8'); + + if (typeof salt === 'string') + salt = bufferExports.Buffer.from(salt, 'utf8'); + + if (salt == null) + salt = bufferExports.Buffer.alloc(0); + + assert(hash && typeof hash.id === 'string'); + assert(bufferExports.Buffer.isBuffer(pass)); + assert(bufferExports.Buffer.isBuffer(salt)); + assert((iter >>> 0) === iter); + assert((len >>> 0) === len); + + const name = getHash(hash); + + if (!subtle.importKey || !subtle.deriveBits || !name) + return derive(hash, pass, salt, iter, len); + + const algo = { name: 'PBKDF2' }; + const use = ['deriveBits']; + + const options = { + name: 'PBKDF2', + salt: salt, + iterations: iter, + hash: name + }; + + const key = await subtle.importKey('raw', pass, algo, false, use); + const out = await subtle.deriveBits(options, key, len * 8); + + return bufferExports.Buffer.from(out); + } + + /* + * Helpers + */ + + function getHash(hash) { + switch (hash.id) { + case 'SHA1': + return 'SHA-1'; + case 'SHA256': + return 'SHA-256'; + case 'SHA384': + return 'SHA-384'; + case 'SHA512': + return 'SHA-512'; + default: + return null; + } + } + + /* + * Expose + */ + + pbkdf2$2.native = 0; + pbkdf2$2.derive = derive; + pbkdf2$2.deriveAsync = deriveAsync; + return pbkdf2$2; +} + +/*! + * pbkdf2.js - pbkdf2 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + +var pbkdf2Browser; +var hasRequiredPbkdf2Browser; + +function requirePbkdf2Browser () { + if (hasRequiredPbkdf2Browser) return pbkdf2Browser; + hasRequiredPbkdf2Browser = 1; + + pbkdf2Browser = requirePbkdf2(); + return pbkdf2Browser; +} + +var pbkdf2BrowserExports = requirePbkdf2Browser(); +var pbkdf2$1 = /*@__PURE__*/getDefaultExportFromCjs(pbkdf2BrowserExports); + +var sha3; +var hasRequiredSha3; + +function requireSha3 () { + if (hasRequiredSha3) return sha3; + hasRequiredSha3 = 1; + + const Keccak = requireKeccak(); + + /** + * SHA3 + */ + + class SHA3 extends Keccak { + constructor() { + super(); + } + + final() { + return super.final(0x06, null); + } + + static hash() { + return new SHA3(); + } + + static hmac(bits) { + return super.hmac(bits, 0x06, null); + } + + static digest(data, bits) { + return super.digest(data, bits, 0x06, null); + } + + static root(left, right, bits) { + return super.root(left, right, bits, 0x06, null); + } + + static multi(x, y, z, bits) { + return super.multi(x, y, z, bits, 0x06, null); + } + + static mac(data, key, bits) { + return super.mac(data, key, bits, 0x06, null); + } + } + + /* + * Static + */ + + SHA3.native = 0; + SHA3.id = 'SHA3_256'; + SHA3.size = 32; + SHA3.bits = 256; + SHA3.blockSize = 136; + SHA3.zero = bufferExports.Buffer.alloc(32, 0x00); + SHA3.ctx = new SHA3(); + + /* + * Expose + */ + + sha3 = SHA3; + return sha3; +} + +/*! + * sha3.js - sha3 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto */ -function parseXCB(xcb) { - return parseUnits(xcb, 18); + +var sha3Browser; +var hasRequiredSha3Browser; + +function requireSha3Browser () { + if (hasRequiredSha3Browser) return sha3Browser; + hasRequiredSha3Browser = 1; + + sha3Browser = requireSha3(); + return sha3Browser; } -/** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -function uuidV4(randomBytes) { - const bytes = getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); +var sha3512; +var hasRequiredSha3512; + +function requireSha3512 () { + if (hasRequiredSha3512) return sha3512; + hasRequiredSha3512 = 1; + + const SHA3 = requireSha3Browser(); + + /** + * SHA3-512 + */ + + class SHA3_512 extends SHA3 { + constructor() { + super(); + } + + init() { + return super.init(512); + } + + static hash() { + return new SHA3_512(); + } + + static hmac() { + return super.hmac(512); + } + + static digest(data) { + return super.digest(data, 512); + } + + static root(left, right) { + return super.root(left, right, 512); + } + + static multi(x, y, z) { + return super.multi(x, y, z, 512); + } + + static mac(data, key) { + return super.mac(data, key, 512); + } + } + + /* + * Static + */ + + SHA3_512.native = SHA3.native; + SHA3_512.id = 'SHA3_512'; + SHA3_512.size = 64; + SHA3_512.bits = 512; + SHA3_512.blockSize = 72; + SHA3_512.zero = bufferExports.Buffer.alloc(64, 0x00); + SHA3_512.ctx = new SHA3_512(); + + /* + * Expose + */ + + sha3512 = SHA3_512; + return sha3512; } -// @ts-ignore +var sha3512Exports = requireSha3512(); +var SHA3_512 = /*@__PURE__*/getDefaultExportFromCjs(sha3512Exports); + class Ed448Goldilock { static _channel = ed448; static generatePrivateKey() { @@ -4557,22 +29932,22 @@ class Ed448Goldilock { return privateKey; } static getPublicKeyFromPrivateKey(privateKey) { - var secret = Buffer.from(privateKey, "hex"); + var secret = bufferExports.Buffer.from(privateKey, "hex"); if (secret[56] > 127) { var scalar = secret.slice(0, 56); scalar[0] &= 0xfc; scalar[55] |= 0x80; var publicKey = this._channel.publicKeyFromScalar(scalar); - return Buffer.from(publicKey).toString("hex"); + return bufferExports.Buffer.from(publicKey).toString("hex"); } else { var publicKey = this._channel.publicKeyCreate(secret); - return Buffer.from(publicKey).toString("hex"); + return bufferExports.Buffer.from(publicKey).toString("hex"); } } static signWithPrivateKey(privateKey, msg) { - var msgToSign = Buffer.from(msg, "hex"); - var secret = Buffer.from(privateKey, "hex"); + var msgToSign = bufferExports.Buffer.from(msg, "hex"); + var secret = bufferExports.Buffer.from(privateKey, "hex"); if (secret[56] > 127) { var prefix = secret.slice(0, 57); prefix[0] &= 0xfc; @@ -4580,11 +29955,11 @@ class Ed448Goldilock { prefix[55] |= 0x80; var scalar = prefix.slice(0, 56); var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return Buffer.from(signedMessage).toString("hex"); + return bufferExports.Buffer.from(signedMessage).toString("hex"); } else { var signedMessage = this._channel.sign(msgToSign, secret); - return Buffer.from(signedMessage).toString("hex"); + return bufferExports.Buffer.from(signedMessage).toString("hex"); } } static signWithPrivateKeyNConcatPubkey(privateKey, msg) { @@ -4593,16 +29968,16 @@ class Ed448Goldilock { return signedMessage + publicKey; } static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(msgHash, signedMsg, pubKey); + return this._channel.verify(bufferExports.Buffer.from(msgHash, "hex"), bufferExports.Buffer.from(signedMsg, "hex"), bufferExports.Buffer.from(pubKey, "hex")); } static SHA512Hash(password, salt) { - var p1 = Buffer.from(password, "hex"); - var s1 = Buffer.from(salt, "hex"); - return Buffer.from(pbkdf2$2.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); + var p1 = bufferExports.Buffer.from(password, "hex"); + var s1 = bufferExports.Buffer.from(salt, "hex"); + return bufferExports.Buffer.from(pbkdf2$1.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); } static concatenateAndHex(prefix, key, index, salt) { - var ind = Buffer.alloc(4); - var p = Buffer.alloc(1); + var ind = bufferExports.Buffer.alloc(4); + var p = bufferExports.Buffer.alloc(1); p[0] = prefix % 256; var j = index; for (let i = 0; i < 4; i++) { @@ -4613,10 +29988,10 @@ class Ed448Goldilock { return Ed448Goldilock.SHA512Hash(t, salt); } static addScalar(a, b) { - var a1 = Buffer.from(a, "hex"); - var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); + var a1 = bufferExports.Buffer.from(a, "hex"); + var b1 = bufferExports.Buffer.from(b.substr(0, 106) + "00000000", "hex"); b1[0] &= 0xfc; - var c = Buffer.alloc(57); + var c = bufferExports.Buffer.alloc(57); var hold = 0; for (let i = 0; i < 57; i++) { hold += a1[i] + b1[i]; @@ -4628,7 +30003,7 @@ class Ed448Goldilock { static seedToExtendedPrivate(seed) { var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = Buffer.from(s2, "hex"); + var b = bufferExports.Buffer.from(s2, "hex"); b[56] |= 0x80; b[55] |= 0x80; b[55] &= 0xbf; @@ -4664,6 +30039,8 @@ class Ed448Goldilock { /* Browser Crypto Shims */ function getGlobal$1() { + if (typeof globalThis !== "undefined") + return globalThis; if (typeof self !== "undefined") { return self; } @@ -4679,8 +30056,10 @@ const anyGlobal = getGlobal$1(); const crypto = anyGlobal.crypto || anyGlobal.msCrypto; function createHash(algo) { switch (algo) { + case "ripemd160": + return ripemd160$1.create(); case "sha256": - return sha256$1.create(); + return sha256$2.create(); case "sha512": return sha512$1.create(); case "sha3-256": @@ -4691,14 +30070,14 @@ function createHash(algo) { assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); } function createHmac(_algo, key) { - const algo = { sha256: sha256$1, sha512: sha512$1 }[_algo]; + const algo = { sha256: sha256$2, sha512: sha512$1, "sha3-256": sha3_256, "sha3-512": sha3_512 }[_algo]; assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac.create(algo, key); + return hmac$1.create(algo, key); } function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = { sha256: sha256$1, sha512: sha512$1 }[_algo]; + const algo = { sha256: sha256$2, sha512: sha512$1 }[_algo]; assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2$1(algo, password, salt, { c: iterations, dkLen: keylen }); + return pbkdf2$3(algo, password, salt, { c: iterations, dkLen: keylen }); } function randomBytes$1(length) { assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { @@ -4710,23 +30089,13 @@ function randomBytes$1(length) { return result; } -const _sha256 = function (data) { - let v = "0x" + - createHash("sha3-256") - .update(Buffer$1.from(arrayify(data))) - .digest("hex"); - return v; -}; -const _sha512 = function (data) { - let v = "0x" + - createHash("sha3-512") - .update(Buffer$1.from(arrayify(data))) - .digest("hex"); - return v; -}; +const _sha256 = (data) => hexlify(createHash("sha3-256").update(data).digest()); +const _sha512 = (data) => hexlify(createHash("sha3-512").update(data).digest()); +let __sha256 = _sha256; +let __sha512 = _sha512; let locked256 = false, locked512 = false; /** - * Compute the cryptographic SHA2-256 hash of %%data%%. + * Compute the cryptographic SHA3-256 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -4748,15 +30117,7 @@ var SupportedAlgorithm; SupportedAlgorithm["sha512"] = "sha512"; })(SupportedAlgorithm || (SupportedAlgorithm = {})); function sha256(data) { - let createdHash = createHash("sha3-256") - .update(Buffer$1.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; + return hexlify(__sha256(getBytes(data))); } function legacySha256(data) { const _data = getBytes(data, "data"); @@ -4771,10 +30132,11 @@ sha256.register = function (func) { if (locked256) { throw new Error("sha256 is locked"); } + __sha256 = func; }; Object.freeze(sha256); /** - * Compute the cryptographic SHA2-512 hash of %%data%%. + * Compute the cryptographic SHA3-512 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -4790,15 +30152,7 @@ Object.freeze(sha256); * //_result: */ function sha512(data) { - let createdHash = createHash("sha3-512") - .update(Buffer$1.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; + return hexlify(__sha512(getBytes(data))); } sha512._ = _sha512; sha512.lock = function () { @@ -4808,8 +30162,9 @@ sha512.register = function (func) { if (locked512) { throw new Error("sha512 is locked"); } + __sha512 = func; }; -Object.freeze(sha256); +Object.freeze(sha512); /** * Addresses are a fundamental part of interacting with Core. They @@ -4977,108 +30332,6 @@ computeHmac.register = function (func) { }; Object.freeze(computeHmac); -// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html -// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf -const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); -const Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i); -const Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16); -let idxL = [Id]; -let idxR = [Pi]; -for (let i = 0; i < 4; i++) - for (let j of [idxL, idxR]) - j.push(j[i].map((k) => Rho[k])); -const shifts = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => new Uint8Array(i)); -const shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j])); -const shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j])); -const Kl = /* @__PURE__ */ new Uint32Array([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -const Kr = /* @__PURE__ */ new Uint32Array([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// The rotate left (circular left shift) operation for uint32 -const rotl$1 = (word, shift) => (word << shift) | (word >>> (32 - shift)); -// It's called f() in spec. -function f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - else if (group === 1) - return (x & y) | (~x & z); - else if (group === 2) - return (x | ~y) ^ z; - else if (group === 3) - return (x & z) | (y & ~z); - else - return x ^ (y | ~z); -} -// Temporary buffer, not used to store anything between runs -const BUF = /* @__PURE__ */ new Uint32Array(16); -class RIPEMD160 extends SHA2 { - constructor() { - super(64, 20, 8, true); - this.h0 = 0x67452301 | 0; - this.h1 = 0xefcdab89 | 0; - this.h2 = 0x98badcfe | 0; - this.h3 = 0x10325476 | 0; - this.h4 = 0xc3d2e1f0 | 0; - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl$1(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl$1(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl$1(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl$1(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0); - } -} -/** - * RIPEMD-160 - a hash function from 1990s. - * @param message - msg that would be hashed - */ -const ripemd160$1 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160()); - let locked$3 = false; const _ripemd160 = function (data) { return ripemd160$1(data); @@ -5201,14 +30454,18 @@ randomBytes.register = function (func) { }; Object.freeze(randomBytes); -// RFC 7914 Scrypt KDF -// Left rotate for uint32 -const rotl = (a, b) => (a << b) | (a >>> (32 - b)); +/** + * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. + * @module + */ // The main Scrypt loop: uses Salsa extensively. // Six versions of the function were tried, this is the fastest one. +// RFC 7914 §3 / §4 step 2 applies Salsa20/8 to one 16-word (64-byte) block +// after xor'ing two such blocks. +// The local `y*` snapshot keeps the xor input stable even when `out` aliases `prev` or `input`. // prettier-ignore function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html + // Based on https://cr.yp.to/salsa20.html and RFC 7914's Salsa20/8 core. // Xor blocks let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; @@ -5274,56 +30531,66 @@ function XorAndSalsa(prev, pi, input, ii, out, oi) { out[oi++] = (y15 + x15) | 0; } function BlockMix(input, ii, out, oi, r) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) + // The block B is `r` 128-byte chunks, i.e. `2r` 16-word (64-byte) Salsa blocks. let head = oi + 0; let tail = oi + 16 * r; for (let i = 0; i < 16; i++) out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 + // RFC 7914 §4 step 3 outputs `Y[0], Y[2], ...` first, then `Y[1], Y[3], ...`; + // `head` and `tail` lay out those even/odd halves in place. XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) if (i > 0) tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) + // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) + XorAndSalsa(out, head, input, (ii += 16), out, tail); } } +// 128*r*(N+p+1) for N=2**20, r=8, p=1: 1 GiB main table plus 2 KiB workspace. +const SCRYPT_DEFAULT_MAXMEM = 128 * 8 * (2 ** 20 + 1 + 1); // Common prologue and epilogue for sync/async functions function scryptInit(password, salt, _opts) { - // Maxmem - 1GB+1KB by default const opts = checkOpts({ dkLen: 32, asyncTick: 10, - maxmem: 1024 ** 3 + 1024, + maxmem: SCRYPT_DEFAULT_MAXMEM, }, _opts); const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - number(N); - number(r); - number(p); - number(dkLen); - number(asyncTick); - number(maxmem); + anumber(N, 'N'); + anumber(r, 'r'); + anumber(p, 'p'); + anumber(dkLen, 'dkLen'); + anumber(asyncTick, 'asyncTick'); + anumber(maxmem, 'maxmem'); if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); + throw new Error('"onProgress" must be a function'); + // Without this, r=0 slips through: blockSize=0 turns the `p` upper bound into + // Infinity and the failure surfaces later as a confusing pbkdf2 dkLen error. + if (r < 1) + throw new Error('"r" expected integer >= 1'); const blockSize = 128 * r; const blockSize32 = blockSize / 4; - if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) { - // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function - // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future. - throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32'); - } - if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) { - throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); - } - if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { - throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`); - } + // Max N is 2^32 (Integrify is 32-bit). + // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB. + // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, + // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: + // https://www.rfc-editor.org/errata_search.php?rfc=7914 + const pow32 = Math.pow(2, 32); + if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) + throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32'); + if (p < 1 || p > ((pow32 - 1) * 32) / blockSize) + throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)'); + // RFC 7914 §2 defines `dkLen` as a positive integer. + if (dkLen < 1 || dkLen > (pow32 - 1) * 32) + throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32'); + // Include the shared `tmp` scratch block so `maxmem` matches noble's actual temporary allocation. + // Node requires more headroom here, so this accounting is intentionally noble-specific. + const memUsed = blockSize * (N + p + 1); + if (memUsed > maxmem) + throw new Error('"maxmem" limit was hit: memUsed(128*r*(N+p+1))=' + memUsed + ', maxmem=' + maxmem); // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2$1(sha256$1, password, salt, { c: 1, dkLen: blockSize * p }); + const B = pbkdf2$3(sha256$2, password, salt, { c: 1, dkLen: blockSize * p }); const B32 = u32(B); // Re-used between parallel iterations. Array(iterations) of B const V = u32(new Uint8Array(blockSize * N)); @@ -5337,35 +30604,62 @@ function scryptInit(password, salt, _opts) { let blockMixCnt = 0; blockMixCb = () => { blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); + if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) { + // Wiping here instead of a try/catch around the main loops keeps them + // try-free: measured ~1% slower at N=2^21 with the loops inside a try. + // onProgress is the only user code that can throw mid-derivation. + try { + onProgress(blockMixCnt / totalBlockMix); + } + catch (e) { + clean(B, V, tmp); + throw e; + } + } }; } return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; } function scryptOutput(password, dkLen, B, V, tmp) { - const res = pbkdf2$1(sha256$1, password, B, { c: 1, dkLen }); - B.fill(0); - V.fill(0); - tmp.fill(0); + // Shared final PBKDF2-and-cleanup step: keep the derived key, wipe the scrypt workspace. + const res = pbkdf2$3(sha256$2, password, B, { c: 1, dkLen }); + clean(B, V, tmp); return res; } /** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key + * Scrypt KDF from RFC 7914. See {@link ScryptOpts}. + * @param password - password or key material to derive from; + * JS string inputs are UTF-8 encoded first + * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first + * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided, + * must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}. + * @returns Derived key bytes. + * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error} + * @example + * Derive a key with scrypt. + * ```ts + * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + * ``` + * @example + * Derive a key with small demo costs and progress/memory controls. + * ```ts + * const progressLog: number[] = []; + * scrypt('password', 'salt', { + * N: 16, + * r: 8, + * p: 1, + * dkLen: 32, + * maxmem: 1024 * 1024, + * asyncTick: 10, + * onProgress(progress) { + * progressLog.push(progress); + * }, + * }); + * ``` */ function scrypt$1(password, salt, opts) { const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); + swap32IfBE(B32); for (let pi = 0; pi < p; pi++) { const Pi = blockSize32 * pi; for (let i = 0; i < blockSize32; i++) @@ -5378,20 +30672,59 @@ function scrypt$1(password, salt, opts) { blockMixCb(); for (let i = 0; i < N; i++) { // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations + // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N + // only depends on the low word here because N is a power of two and + // this implementation caps N at 2^32. + // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked + // above; >>> 0 for unsigned, input fits in u32. + const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations + // tmp = B ^ V[j] for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] + tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) blockMixCb(); } } + swap32IfBE(B32); return scryptOutput(password, dkLen, B, V, tmp); } /** - * Scrypt KDF from RFC 7914. + * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}. + * @param password - password or key material to derive from; + * JS string inputs are UTF-8 encoded first + * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first + * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided, + * must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local + * scheduler-yield control for this JS wrapper, not part of RFC 7914. + * See {@link ScryptOpts}. + * @returns Promise resolving to derived key bytes. + * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error} + * @example + * Derive a key with scrypt asynchronously. + * ```ts + * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + * ``` + * @example + * Derive a key asynchronously with small demo costs and progress/memory controls. + * ```ts + * await scryptAsync('password', 'salt', { + * N: 16, + * r: 8, + * p: 1, + * dkLen: 32, + * maxmem: 1024 * 1024, + * asyncTick: 1, + * onProgress(progress) { + * if (progress > 1) throw new Error('invalid progress'); + * }, + * }); + * ``` */ async function scryptAsync(password, salt, opts) { const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); + // One failure handler covers both yield boundaries without putting the hot loops in a try block. + const abort = () => clean(B, V, tmp); + swap32IfBE(B32); for (let pi = 0; pi < p; pi++) { const Pi = blockSize32 * pi; for (let i = 0; i < blockSize32; i++) @@ -5400,18 +30733,25 @@ async function scryptAsync(password, salt, opts) { await asyncLoop(N - 1, asyncTick, () => { BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); blockMixCb(); - }); + }, abort); BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element blockMixCb(); await asyncLoop(N, asyncTick, () => { // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations + // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N + // only depends on the low word here because N is a power of two and + // this implementation caps N at 2^32. + // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked + // above; >>> 0 for unsigned, input fits in u32. + const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations + // tmp = B ^ V[j] for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] + tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) blockMixCb(); - }); + }, abort); } + swap32IfBE(B32); return scryptOutput(password, dkLen, B, V, tmp); } @@ -5564,268 +30904,12 @@ keccak256.register = function (func) { }; Object.freeze(keccak256); -/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ -const B256 = 2n ** 256n; // secp256k1 is short weierstrass curve -const P = B256 - 0x1000003d1n; // curve's field prime -const N$1 = B256 - 0x14551231950b75fc4402da1732fc9bebfn; // curve (group) order -const Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n; // base point x -const Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n; // base point y -const CURVE = { p: P, n: N$1, a: 0n, b: 7n, Gx, Gy }; // exported variables incl. a, b -const fLen = 32; // field / group byte length -const crv = (x) => mod(mod(x * x) * x + CURVE.b); // x³ + ax + b weierstrass formula; no a -const err = (m = '') => { throw new Error(m); }; // error helper, messes-up stack trace -const big = (n) => typeof n === 'bigint'; // is big integer -const str = (s) => typeof s === 'string'; // is string -const fe = (n) => big(n) && 0n < n && n < P; // is field element (invertible) -const ge = (n) => big(n) && 0n < n && n < N$1; // is group element -const au8 = (a, l) => // is Uint8Array (of specific length) - !(a instanceof Uint8Array) || (typeof l === 'number' && l > 0 && a.length !== l) ? - err('Uint8Array expected') : a; -const u8n = (data) => new Uint8Array(data); // creates Uint8Array -const toU8 = (a, len) => au8(str(a) ? h2b(a) : u8n(a), len); // norm(hex/u8a) to u8a -const mod = (a, b = P) => { let r = a % b; return r >= 0n ? r : b + r; }; // mod division -const isPoint = (p) => (p instanceof Point ? p : err('Point expected')); // is 3d point -let Gpows = undefined; // precomputes for base point G -class Point { - constructor(px, py, pz) { - this.px = px; - this.py = py; - this.pz = pz; - } //3d=less inversions - static fromAffine(p) { return new Point(p.x, p.y, 1n); } - static fromHex(hex) { - hex = toU8(hex); // convert hex string to Uint8Array - let p = undefined; - const head = hex[0], tail = hex.subarray(1); // first byte is prefix, rest is data - const x = slcNum(tail, 0, fLen), len = hex.length; // next 32 bytes are x coordinate - if (len === 33 && [0x02, 0x03].includes(head)) { // compressed points: 33b, start - if (!fe(x)) - err('Point hex invalid: x not FE'); // with byte 0x02 or 0x03. Check if 0 0n; d = d.double(), n >>= 1n) { // double-and-add ladder - if (n & 1n) - p = p.add(d); // if bit is present, add to point - else if (safe) - f = f.add(d); // if not, add to fake for timing safety - } - return p; - } - mulAddQUns(R, u1, u2) { - return this.mul(u1, false).add(R.mul(u2, false)).ok(); // Unsafe: do NOT use for stuff related - } // to private keys. Doesn't use Shamir trick - toAffine() { - const { px: x, py: y, pz: z } = this; // (x, y, z) ∋ (x=x/z, y=y/z) - if (this.equals(I)) - return { x: 0n, y: 0n }; // fast-path for zero point - if (z === 1n) - return { x, y }; // if z is 1, pass affine coordinates as-is - const iz = inv(z); // z^-1: invert z - if (mod(z * iz) !== 1n) - err('invalid inverse'); // (z * z^-1) must be 1, otherwise bad math - return { x: mod(x * iz), y: mod(y * iz) }; // x = x*z^-1; y = y*z^-1 - } - assertValidity() { - const { x, y } = this.aff(); // convert to 2d xy affine point. - if (!fe(x) || !fe(y)) - err('Point invalid: x or y'); // x and y must be in range 0 < n < P - return mod(y * y) === crv(x) ? // y² = x³ + ax + b, must be equal - this : err('Point invalid: not on curve'); - } - multiply(n) { return this.mul(n); } // Aliases to compress code - aff() { return this.toAffine(); } - ok() { return this.assertValidity(); } - toHex(isCompressed = true) { - const { x, y } = this.aff(); // convert to 2d xy affine point - const head = isCompressed ? ((y & 1n) === 0n ? '02' : '03') : '04'; // 0x02, 0x03, 0x04 prefix - return head + n2h(x) + (isCompressed ? '' : n2h(y)); // prefix||x and ||y - } - toRawBytes(isCompressed = true) { - return h2b(this.toHex(isCompressed)); // re-use toHex(), convert hex to bytes - } -} -Point.BASE = new Point(Gx, Gy, 1n); // Generator / base point -Point.ZERO = new Point(0n, 1n, 0n); // Identity / zero point -const { BASE: G, ZERO: I } = Point; // Generator, identity points -const padh = (n, pad) => n.toString(16).padStart(pad, '0'); -const b2h = (b) => Array.from(b).map(e => padh(e, 2)).join(''); // bytes to hex -const h2b = (hex) => { - const l = hex.length; // error if not string, - if (!str(hex) || l % 2) - err('hex invalid 1'); // or has odd length like 3, 5. - const arr = u8n(l / 2); // create result array - for (let i = 0; i < arr.length; i++) { - const j = i * 2; - const h = hex.slice(j, j + 2); // hexByte. slice is faster than substr - const b = Number.parseInt(h, 16); // byte, created from string part - if (Number.isNaN(b) || b < 0) - err('hex invalid 2'); // byte must be valid 0 <= byte < 256 - arr[i] = b; - } - return arr; -}; -const b2n = (b) => BigInt('0x' + (b2h(b) || '0')); // bytes to number -const slcNum = (b, from, to) => b2n(b.slice(from, to)); // slice bytes num -const n2b = (num) => { - return big(num) && num >= 0n && num < B256 ? h2b(padh(num, 2 * fLen)) : err('bigint expected'); -}; -const n2h = (num) => b2h(n2b(num)); // number to 32b hex -const inv = (num, md = P) => { - if (num === 0n || md <= 0n) - err('no inverse n=' + num + ' mod=' + md); // no neg exponent for now - let a = mod(num, md), b = md, x = 0n, u = 1n; - while (a !== 0n) { // uses euclidean gcd algorithm - const q = b / a, r = b % a; // not constant-time - const m = x - u * q; - b = a, a = r, x = u, u = m; - } - return b === 1n ? mod(x, md) : err('no inverse'); // b is gcd at this point -}; -const sqrt = (n) => { - let r = 1n; // So, a special, fast case. Paper: "Square Roots from 1;24,51,10 to Dan Shanks". - for (let num = n, e = (P + 1n) / 4n; e > 0n; e >>= 1n) { // powMod: modular exponentiation. - if (e & 1n) - r = (r * num) % P; // Uses exponentiation by squaring. - num = (num * num) % P; // Not constant-time. - } - return mod(r * r) === n ? r : err('sqrt invalid'); // check if result is valid -}; -const toPriv = (p) => { - if (!big(p)) - p = b2n(toU8(p, fLen)); // convert to bigint when bytes - return ge(p) ? p : err('private key out of range'); // check if bigint is in range -}; -function getSharedSecret(privA, pubB, isCompressed = true) { - return Point.fromHex(pubB).mul(toPriv(privA)).toRawBytes(isCompressed); // ECDH -} -const W = 8; // Precomputes-related code. W = window size -const precompute = () => { - const points = []; // 10x sign(), 2x verify(). To achieve this, - const windows = 256 / W + 1; // app needs to spend 40ms+ to calculate - let p = G, b = p; // a lot of points related to base point G. - for (let w = 0; w < windows; w++) { // Points are stored in array and used - b = p; // any time Gx multiplication is done. - points.push(b); // They consume 16-32 MiB of RAM. - for (let i = 1; i < 2 ** (W - 1); i++) { - b = b.add(p); - points.push(b); - } - p = b.double(); // Precomputes don't speed-up getSharedKey, - } // which multiplies user point by scalar, - return points; // when precomputes are using base point -}; -const wNAF = (n) => { - // Compared to other point mult methods, - const comp = Gpows || (Gpows = precompute()); // stores 2x less points using subtraction - const neg = (cnd, p) => { let n = p.negate(); return cnd ? n : p; }; // negate - let p = I, f = G; // f must be G, or could become I in the end - const windows = 1 + 256 / W; // W=8 17 windows - const wsize = 2 ** (W - 1); // W=8 128 window size - const mask = BigInt(2 ** W - 1); // W=8 will create mask 0b11111111 - const maxNum = 2 ** W; // W=8 256 - const shiftBy = BigInt(W); // W=8 8 - for (let w = 0; w < windows; w++) { - const off = w * wsize; - let wbits = Number(n & mask); // extract W bits. - n >>= shiftBy; // shift number by W bits. - if (wbits > wsize) { - wbits -= maxNum; - n += 1n; - } // split if bits > max: +224 => 256-32 - const off1 = off, off2 = off + Math.abs(wbits) - 1; // offsets, evaluate both - const cnd1 = w % 2 !== 0, cnd2 = wbits < 0; // conditions, evaluate both - if (wbits === 0) { - f = f.add(neg(cnd1, comp[off1])); // bits are 0: add garbage to fake point - } - else { // ^ can't add off2, off2 = I - p = p.add(neg(cnd2, comp[off2])); // bits are 1: add to result point - } - } - return { p, f }; // return both real and fake points for JIT -}; // !! you can disable precomputes by commenting-out call of the wNAF() inside Point#mul() - /** * Add details about signing here. * * @_subsection: api/crypto:Signing [about-signing] */ const logger$2 = new Logger("signing-key/0.0.1"); -//const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -// Make noble-secp256k1 sync /** * A **SigningKey** provides high-level access to the elliptic curve * cryptography (ECC) operations and key management. @@ -5836,12 +30920,11 @@ class SigningKey { * Creates a new **SigningKey** for %%privateKey%%. */ constructor(privateKey) { - let tmp = privateKey; - if (typeof tmp === "string" && tmp.startsWith("0x")) { - tmp = tmp.replace("0x", ""); - } - assertArgument(dataLength("0x" + tmp) === 57, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify("0x" + tmp); + const normalized = typeof privateKey === "string" && !privateKey.startsWith("0x") + ? "0x" + privateKey + : privateKey; + assertArgument(dataLength(normalized) === 57, "invalid private key", "privateKey", "[REDACTED]"); + this.#privateKey = hexlify(normalized); } /** * The private key. @@ -5849,22 +30932,11 @@ class SigningKey { get privateKey() { return this.#privateKey; } - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ + /** The 57-byte Ed448 public key encoded as hex. */ get publicKey() { return SigningKey.computePublicKey(this.#privateKey); } - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ + /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); } @@ -5888,70 +30960,33 @@ class SigningKey { prefix[55] |= 0x80; prefix[56] = 0; const scalar = prefix.slice(0, 56); - const bufferDigest = Buffer$1.from(digestBuffer); - const bufferPrfx = Buffer$1.from(prefix); - const bufferScalar = Buffer$1.from(scalar); + const bufferDigest = bufferExports.Buffer.from(digestBuffer); + const bufferPrfx = bufferExports.Buffer.from(prefix); + const bufferScalar = bufferExports.Buffer.from(scalar); const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); const hexlified = hexlify(sig); return hexConcat([hexlified, this.publicKey]); } - const sig = ed448.sign(Buffer$1.from(digestBuffer), Buffer$1.from(keyBuffer)); + const sig = ed448.sign(bufferExports.Buffer.from(digestBuffer), bufferExports.Buffer.from(keyBuffer)); const hexlified = hexlify(sig); return hexConcat([hexlified, this.publicKey]); } - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ + /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ computeSharedSecret(other) { - const pubKey = SigningKey.computePublicKey(other); - return hexlify(getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey))); + const pub = bufferExports.Buffer.from(getBytesCopy(other)); + assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), "invalid public key", "other", other); + const key = bufferExports.Buffer.from(getBytesCopy(this.#privateKey)); + if (key[56] > 127) { + const scalar = key.subarray(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + return hexlify(ed448.deriveWithScalar(pub, scalar)); + } + return hexlify(ed448.derive(pub, key)); } - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ + /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ static computePublicKey(key, compressed) { - const bytes = Buffer$1.from(arrayify(key)); + const bytes = bufferExports.Buffer.from(arrayify(key)); if (bytes.length !== 57) { logger$2.throwArgumentError("invalid private key", "key", "[REDACTED]"); } @@ -5985,8 +31020,8 @@ class SigningKey { */ static recoverPublicKey(digest, signature) { assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const digestBuffer = Buffer$1.from(arrayify(digest)); - const sigBuffer = Buffer$1.from(arrayify(signature)); + const digestBuffer = bufferExports.Buffer.from(arrayify(digest)); + const sigBuffer = bufferExports.Buffer.from(arrayify(signature)); if (sigBuffer.length !== 171) { logger$2.throwArgumentError("invalid signature", "signature", signature); } @@ -5998,20 +31033,14 @@ class SigningKey { logger$2.throwArgumentError("invalid signature", "signature", signature); return ""; } - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ + /** Adds two encoded Ed448 public points. The compression flag is ignored. */ static addPoints(p0, p1, compressed) { - const pub0 = Point.fromHex(SigningKey.computePublicKey(p0).substring(2)); - const pub1 = Point.fromHex(SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed); + const points = [p0, p1].map((point) => { + const bytes = bufferExports.Buffer.from(getBytesCopy(point)); + assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), "invalid public key", "point", point); + return bytes; + }); + return hexlify(ed448.publicKeyCombine(points)); } } @@ -10641,32 +35670,32 @@ class Interface { } // Get the 4-byte selector used by Solidity to identify a function /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ + getSelector(fragment: ErrorFragment | FunctionFragment): string { + if (typeof(fragment) === "string") { + const matches: Array = [ ]; + + try { matches.push(this.getFunction(fragment)); } catch (error) { } + try { matches.push(this.getError(fragment)); } catch (_) { } + + if (matches.length === 0) { + logger.throwArgumentError("unknown fragment", "key", fragment); + } else if (matches.length > 1) { + logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); + } + + fragment = matches[0]; + } + + return dataSlice(id(fragment.format()), 0, 4); + } + */ // Get the 32-byte topic hash used by Solidity to identify an event /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ + getEventTopic(fragment: EventFragment): string { + //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } + return id(fragment.format()); + } + */ _decodeParams(params, data) { return this.#abiCoder.decode(params, data); } @@ -10833,34 +35862,34 @@ class Interface { return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); } /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ + spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { + const promises: Array> = [ ]; + const process = function(type: ParamType, value: any): any { + if (type.baseType === "array") { + return descend(type.child + } + if (type. === "address") { + } + }; + + const descend = function (inputs: Array, values: ReadonlyArray) { + if (inputs.length !== values.length) { throw new Error("length mismatch"); } + }; + + const result: Array = [ ]; + values.forEach((value, index) => { + if (value == null) { + topics.push(null); + } else if (param.baseType === "array" || param.baseType === "tuple") { + logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); + } else if (Array.isArray(value)) { + topics.push(value.map((value) => encodeTopic(param, value))); + } else { + topics.push(encodeTopic(param, value)); + } + }); + } +*/ // Create the filter for the event with search criteria (e.g. for xcb_filterLog) encodeFilterTopics(fragment, values) { if (typeof fragment === "string") { @@ -13098,7 +38127,7 @@ class ContractFactory { else if (typeof bytecode === "string") { bytecode = bytecode; } - else if (isBytes(bytecode)) { + else if (isBytes$1(bytecode)) { bytecode = hexlify(bytecode); } else if (bytecode && typeof bytecode.object === "string") { @@ -13362,38 +38391,38 @@ function formatTransactionResponse(value) { } // @TODO: check networkId /* - if (value.networkId != null) { - let networkId = value.networkId; - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - result.networkId = networkId; - - } else { - let networkId = value.networkId; - - // geth-etc returns networkId - if (networkId == null && result.v == null) { - networkId = value.networkId; - } - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - if (typeof(networkId) !== "number" && result.v != null) { - networkId = (result.v - 35) / 2; - if (networkId < 0) { networkId = 0; } - networkId = parseInt(networkId); - } - - if (typeof(networkId) !== "number") { networkId = 0; } - - result.networkId = networkId; - } - */ + if (value.networkId != null) { + let networkId = value.networkId; + + if (isHexString(networkId)) { + networkId = BigNumber.from(networkId).toNumber(); + } + + result.networkId = networkId; + + } else { + let networkId = value.networkId; + + // geth-etc returns networkId + if (networkId == null && result.v == null) { + networkId = value.networkId; + } + + if (isHexString(networkId)) { + networkId = BigNumber.from(networkId).toNumber(); + } + + if (typeof(networkId) !== "number" && result.v != null) { + networkId = (result.v - 35) / 2; + if (networkId < 0) { networkId = 0; } + networkId = parseInt(networkId); + } + + if (typeof(networkId) !== "number") { networkId = 0; } + + result.networkId = networkId; + } + */ // 0x0000... should actually be null if (result.blockHash && getBigInt(result.blockHash) === BN_0) { result.blockHash = null; @@ -13715,15 +38744,15 @@ function injectCommonNetworks() { }); } } - registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); + registerEth("mainnet", 1, { altNames: ["homestead"] }); + registerEth("ropsten", 3, { }); + registerEth("rinkeby", 4, { }); + registerEth("goerli", 5, { }); + registerEth("kovan", 42, { }); registerEth("sepolia", 11155111, {}); registerEth("classic", 61, {}); registerEth("classicKotti", 6, {}); - registerEth("xdai", 100, { ensNetwork: 1 }); + registerEth("xdai", 100, { }); } function copy$2(obj) { @@ -14435,7 +39464,7 @@ class AbstractProvider { } const networkPromise = this.#networkPromise; const [expected, actual] = await Promise.all([ - networkPromise, + networkPromise, // Possibly an explicit Network this._detectNetwork(), // The actual connected network ]); if (expected.networkId !== actual.networkId) { @@ -14532,7 +39561,7 @@ class AbstractProvider { action: "call", data, reason: "OffchainLookup", - transaction: transaction, + transaction: transaction, // @TODO: populate data? invocation: null, revert: { signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", @@ -15541,8 +40570,8 @@ function isPollable(value) { const defaultOptions = { polling: false, staticNetwork: null, - batchStallTime: 10, - batchMaxSize: 1 << 20, + batchStallTime: 10, // 10ms + batchMaxSize: 1 << 20, // 1Mb batchMaxCount: 100, // 100 requests }; // @TODO: Unchecked Signers @@ -15803,12 +40832,12 @@ class JsonRpcApiProvider extends AbstractProvider { return this.#network; } /* - { - assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { - operation: "jsonRpcApiProvider._send" - }); - } - */ + { + assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { + operation: "jsonRpcApiProvider._send" + }); + } + */ /** * Resolves to the non-normalized value by performing %%req%%. * @@ -16709,13 +41738,13 @@ class SocketProvider extends JsonRpcApiProvider { } // This value is only valid after _start has been called /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ + get _network(): Network { + if (this.#network == null) { + throw new Error("this shouldn't happen"); + } + return this.#network.clone(); + } + */ _getSubscriber(sub) { switch (sub.type) { case "close": @@ -16761,18 +41790,18 @@ class SocketProvider extends JsonRpcApiProvider { } // Sub-classes must call this once they are connected /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ + async _start(): Promise { + if (this.#ready) { return; } + + for (const { payload } of this.#callbacks.values()) { + await this._write(JSON.stringify(payload)); + } + + this.#ready = (async function() { + await super._start(); + })(); + } + */ // Sub-classes must call this for each message async _processMessage(message) { const result = (JSON.parse(message)); @@ -16848,20 +41877,20 @@ class WebSocketProvider extends SocketProvider { this._processMessage(message.data); }; /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); + this.websocket.onclose = (event) => { + // @TODO: What event.code should we reconnect on? + const reconnect = false; + if (reconnect) { + this.pause(true); + if (this.#connect) { + this.#websocket = this.#connect(); + this.#websocket.onopen = ... + // @TODO: this requires the super class to rebroadcast; move it there } - }; - */ + this._reconnect(); + } + }; +*/ } async _write(message) { this.websocket.send(message); @@ -17728,20 +42757,20 @@ function getDefaultProvider(network, options) { } } /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } - */ + if (options.pocket !== "-") { + try { + let appId = options.pocket; + let secretKey: undefined | string = undefined; + let loadBalancer: undefined | boolean = undefined; + if (typeof(appId) === "object") { + loadBalancer = !!appId.loadBalancer; + secretKey = appId.secretKey; + appId = appId.appId; + } + providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); + } catch (error) { console.log(error); } + } +*/ if (options.quicknode !== "-") { try { let token = options.quicknode; @@ -18312,6 +43341,224 @@ class LangEn extends WordlistOwl { } } +var utf8$1 = {}; + +/*! https://mths.be/utf8js v3.0.0 by @mathias */ + +var hasRequiredUtf8; + +function requireUtf8 () { + if (hasRequiredUtf8) return utf8$1; + hasRequiredUtf8 = 1; + (function (exports) { +(function(root) { + + var stringFromCharCode = String.fromCharCode; + + // Taken from https://mths.be/punycode + function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + var value; + var extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + // Taken from https://mths.be/punycode + function ucs2encode(array) { + var length = array.length; + var index = -1; + var value; + var output = ''; + while (++index < length) { + value = array[index]; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + } + return output; + } + + function checkScalarValue(codePoint) { + if (codePoint >= 0xD800 && codePoint <= 0xDFFF) { + throw Error( + 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() + + ' is not a scalar value' + ); + } + } + /*--------------------------------------------------------------------------*/ + + function createByte(codePoint, shift) { + return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80); + } + + function encodeCodePoint(codePoint) { + if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence + return stringFromCharCode(codePoint); + } + var symbol = ''; + if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence + symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0); + } + else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence + checkScalarValue(codePoint); + symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0); + symbol += createByte(codePoint, 6); + } + else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence + symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0); + symbol += createByte(codePoint, 12); + symbol += createByte(codePoint, 6); + } + symbol += stringFromCharCode((codePoint & 0x3F) | 0x80); + return symbol; + } + + function utf8encode(string) { + var codePoints = ucs2decode(string); + var length = codePoints.length; + var index = -1; + var codePoint; + var byteString = ''; + while (++index < length) { + codePoint = codePoints[index]; + byteString += encodeCodePoint(codePoint); + } + return byteString; + } + + /*--------------------------------------------------------------------------*/ + + function readContinuationByte() { + if (byteIndex >= byteCount) { + throw Error('Invalid byte index'); + } + + var continuationByte = byteArray[byteIndex] & 0xFF; + byteIndex++; + + if ((continuationByte & 0xC0) == 0x80) { + return continuationByte & 0x3F; + } + + // If we end up here, it’s not a continuation byte + throw Error('Invalid continuation byte'); + } + + function decodeSymbol() { + var byte1; + var byte2; + var byte3; + var byte4; + var codePoint; + + if (byteIndex > byteCount) { + throw Error('Invalid byte index'); + } + + if (byteIndex == byteCount) { + return false; + } + + // Read first byte + byte1 = byteArray[byteIndex] & 0xFF; + byteIndex++; + + // 1-byte sequence (no continuation bytes) + if ((byte1 & 0x80) == 0) { + return byte1; + } + + // 2-byte sequence + if ((byte1 & 0xE0) == 0xC0) { + byte2 = readContinuationByte(); + codePoint = ((byte1 & 0x1F) << 6) | byte2; + if (codePoint >= 0x80) { + return codePoint; + } else { + throw Error('Invalid continuation byte'); + } + } + + // 3-byte sequence (may include unpaired surrogates) + if ((byte1 & 0xF0) == 0xE0) { + byte2 = readContinuationByte(); + byte3 = readContinuationByte(); + codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3; + if (codePoint >= 0x0800) { + checkScalarValue(codePoint); + return codePoint; + } else { + throw Error('Invalid continuation byte'); + } + } + + // 4-byte sequence + if ((byte1 & 0xF8) == 0xF0) { + byte2 = readContinuationByte(); + byte3 = readContinuationByte(); + byte4 = readContinuationByte(); + codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) | + (byte3 << 0x06) | byte4; + if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { + return codePoint; + } + } + + throw Error('Invalid UTF-8 detected'); + } + + var byteArray; + var byteCount; + var byteIndex; + function utf8decode(byteString) { + byteArray = ucs2decode(byteString); + byteCount = byteArray.length; + byteIndex = 0; + var codePoints = []; + var tmp; + while ((tmp = decodeSymbol()) !== false) { + codePoints.push(tmp); + } + return ucs2encode(codePoints); + } + + /*--------------------------------------------------------------------------*/ + + root.version = '3.0.0'; + root.encode = utf8encode; + root.decode = utf8decode; + + }(exports)); + } (utf8$1)); + return utf8$1; +} + +var utf8Exports = requireUtf8(); +var utf8 = /*@__PURE__*/getDefaultExportFromCjs(utf8Exports); + function mnemonicToSeed(mnemonic, password) { if (!password) { password = ""; @@ -18324,11 +43571,11 @@ const generateSeed = (mnemonic, password) => { const aesSaltPrefix = "mnemonicfortheAESkey"; const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); const aesSalt = utf8.encode(aesSaltPrefix + password); - const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), goldilockSalt, 2048, 64, "sha512"); - const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), aesSalt, 2048, 64, "sha512"); + const goldilockKey = pbkdf2Sync(bufferExports.Buffer.from(mnemonic), bufferExports.Buffer.from(goldilockSalt), 2048, 64, "sha512"); + const aesKeySeed = pbkdf2Sync(bufferExports.Buffer.from(mnemonic), bufferExports.Buffer.from(aesSalt), 2048, 64, "sha512"); return { - aes: aesKeySeed.toString("hex"), - goldilock: goldilockKey.toString("hex"), + aes: bufferExports.Buffer.from(aesKeySeed).toString("hex"), + goldilock: bufferExports.Buffer.from(goldilockKey).toString("hex"), }; }; @@ -18494,6 +43741,812 @@ class Mnemonic { } } +var aesJs = {exports: {}}; + +/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ + +var hasRequiredAesJs; + +function requireAesJs () { + if (hasRequiredAesJs) return aesJs.exports; + hasRequiredAesJs = 1; + (function (module, exports) { + (function(root) { + + function checkInt(value) { + return (parseInt(value) === value); + } + + function checkInts(arrayish) { + if (!checkInt(arrayish.length)) { return false; } + + for (var i = 0; i < arrayish.length; i++) { + if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) { + return false; + } + } + + return true; + } + + function coerceArray(arg, copy) { + + // ArrayBuffer view + if (arg.buffer && arg.name === 'Uint8Array') { + + if (copy) { + if (arg.slice) { + arg = arg.slice(); + } else { + arg = Array.prototype.slice.call(arg); + } + } + + return arg; + } + + // It's an array; check it is a valid representation of a byte + if (Array.isArray(arg)) { + if (!checkInts(arg)) { + throw new Error('Array contains invalid value: ' + arg); + } + + return new Uint8Array(arg); + } + + // Something else, but behaves like an array (maybe a Buffer? Arguments?) + if (checkInt(arg.length) && checkInts(arg)) { + return new Uint8Array(arg); + } + + throw new Error('unsupported array-like object'); + } + + function createArray(length) { + return new Uint8Array(length); + } + + function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) { + if (sourceStart != null || sourceEnd != null) { + if (sourceArray.slice) { + sourceArray = sourceArray.slice(sourceStart, sourceEnd); + } else { + sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd); + } + } + targetArray.set(sourceArray, targetStart); + } + + + + var convertUtf8 = (function() { + function toBytes(text) { + var result = [], i = 0; + text = encodeURI(text); + while (i < text.length) { + var c = text.charCodeAt(i++); + + // if it is a % sign, encode the following 2 bytes as a hex value + if (c === 37) { + result.push(parseInt(text.substr(i, 2), 16)); + i += 2; + + // otherwise, just the actual byte + } else { + result.push(c); + } + } + + return coerceArray(result); + } + + function fromBytes(bytes) { + var result = [], i = 0; + + while (i < bytes.length) { + var c = bytes[i]; + + if (c < 128) { + result.push(String.fromCharCode(c)); + i++; + } else if (c > 191 && c < 224) { + result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f))); + i += 2; + } else { + result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f))); + i += 3; + } + } + + return result.join(''); + } + + return { + toBytes: toBytes, + fromBytes: fromBytes, + } + })(); + + var convertHex = (function() { + function toBytes(text) { + var result = []; + for (var i = 0; i < text.length; i += 2) { + result.push(parseInt(text.substr(i, 2), 16)); + } + + return result; + } + + // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html + var Hex = '0123456789abcdef'; + + function fromBytes(bytes) { + var result = []; + for (var i = 0; i < bytes.length; i++) { + var v = bytes[i]; + result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]); + } + return result.join(''); + } + + return { + toBytes: toBytes, + fromBytes: fromBytes, + } + })(); + + + // Number of rounds by keysize + var numberOfRounds = {16: 10, 24: 12, 32: 14}; + + // Round constant words + var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; + + // S-box and Inverse S-box (S is for Substitution) + var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb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xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; + + // Transformations for encryption + var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; + var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; + var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; + var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; + + // Transformations for decryption + var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; + var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; + var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; + var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; + + // Transformations for decryption key expansion + var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; + var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; + var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; + var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; + + function convertToInt32(bytes) { + var result = []; + for (var i = 0; i < bytes.length; i += 4) { + result.push( + (bytes[i ] << 24) | + (bytes[i + 1] << 16) | + (bytes[i + 2] << 8) | + bytes[i + 3] + ); + } + return result; + } + + var AES = function(key) { + if (!(this instanceof AES)) { + throw Error('AES must be instanitated with `new`'); + } + + Object.defineProperty(this, 'key', { + value: coerceArray(key, true) + }); + + this._prepare(); + }; + + + AES.prototype._prepare = function() { + + var rounds = numberOfRounds[this.key.length]; + if (rounds == null) { + throw new Error('invalid key size (must be 16, 24 or 32 bytes)'); + } + + // encryption round keys + this._Ke = []; + + // decryption round keys + this._Kd = []; + + for (var i = 0; i <= rounds; i++) { + this._Ke.push([0, 0, 0, 0]); + this._Kd.push([0, 0, 0, 0]); + } + + var roundKeyCount = (rounds + 1) * 4; + var KC = this.key.length / 4; + + // convert the key into ints + var tk = convertToInt32(this.key); + + // copy values into round key arrays + var index; + for (var i = 0; i < KC; i++) { + index = i >> 2; + this._Ke[index][i % 4] = tk[i]; + this._Kd[rounds - index][i % 4] = tk[i]; + } + + // key expansion (fips-197 section 5.2) + var rconpointer = 0; + var t = KC, tt; + while (t < roundKeyCount) { + tt = tk[KC - 1]; + tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ + (S[(tt >> 8) & 0xFF] << 16) ^ + (S[ tt & 0xFF] << 8) ^ + S[(tt >> 24) & 0xFF] ^ + (rcon[rconpointer] << 24)); + rconpointer += 1; + + // key expansion (for non-256 bit) + if (KC != 8) { + for (var i = 1; i < KC; i++) { + tk[i] ^= tk[i - 1]; + } + + // key expansion for 256-bit keys is "slightly different" (fips-197) + } else { + for (var i = 1; i < (KC / 2); i++) { + tk[i] ^= tk[i - 1]; + } + tt = tk[(KC / 2) - 1]; + + tk[KC / 2] ^= (S[ tt & 0xFF] ^ + (S[(tt >> 8) & 0xFF] << 8) ^ + (S[(tt >> 16) & 0xFF] << 16) ^ + (S[(tt >> 24) & 0xFF] << 24)); + + for (var i = (KC / 2) + 1; i < KC; i++) { + tk[i] ^= tk[i - 1]; + } + } + + // copy values into round key arrays + var i = 0, r, c; + while (i < KC && t < roundKeyCount) { + r = t >> 2; + c = t % 4; + this._Ke[r][c] = tk[i]; + this._Kd[rounds - r][c] = tk[i++]; + t++; + } + } + + // inverse-cipher-ify the decryption round key (fips-197 section 5.3) + for (var r = 1; r < rounds; r++) { + for (var c = 0; c < 4; c++) { + tt = this._Kd[r][c]; + this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^ + U2[(tt >> 16) & 0xFF] ^ + U3[(tt >> 8) & 0xFF] ^ + U4[ tt & 0xFF]); + } + } + }; + + AES.prototype.encrypt = function(plaintext) { + if (plaintext.length != 16) { + throw new Error('invalid plaintext size (must be 16 bytes)'); + } + + var rounds = this._Ke.length - 1; + var a = [0, 0, 0, 0]; + + // convert plaintext to (ints ^ key) + var t = convertToInt32(plaintext); + for (var i = 0; i < 4; i++) { + t[i] ^= this._Ke[0][i]; + } + + // apply round transforms + for (var r = 1; r < rounds; r++) { + for (var i = 0; i < 4; i++) { + a[i] = (T1[(t[ i ] >> 24) & 0xff] ^ + T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ + T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ + T4[ t[(i + 3) % 4] & 0xff] ^ + this._Ke[r][i]); + } + t = a.slice(); + } + + // the last round is special + var result = createArray(16), tt; + for (var i = 0; i < 4; i++) { + tt = this._Ke[rounds][i]; + result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; + result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; + result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; + result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff; + } + + return result; + }; + + AES.prototype.decrypt = function(ciphertext) { + if (ciphertext.length != 16) { + throw new Error('invalid ciphertext size (must be 16 bytes)'); + } + + var rounds = this._Kd.length - 1; + var a = [0, 0, 0, 0]; + + // convert plaintext to (ints ^ key) + var t = convertToInt32(ciphertext); + for (var i = 0; i < 4; i++) { + t[i] ^= this._Kd[0][i]; + } + + // apply round transforms + for (var r = 1; r < rounds; r++) { + for (var i = 0; i < 4; i++) { + a[i] = (T5[(t[ i ] >> 24) & 0xff] ^ + T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ + T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ + T8[ t[(i + 1) % 4] & 0xff] ^ + this._Kd[r][i]); + } + t = a.slice(); + } + + // the last round is special + var result = createArray(16), tt; + for (var i = 0; i < 4; i++) { + tt = this._Kd[rounds][i]; + result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; + result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; + result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; + result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff; + } + + return result; + }; + + + /** + * Mode Of Operation - Electonic Codebook (ECB) + */ + var ModeOfOperationECB = function(key) { + if (!(this instanceof ModeOfOperationECB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Electronic Code Block"; + this.name = "ecb"; + + this._aes = new AES(key); + }; + + ModeOfOperationECB.prototype.encrypt = function(plaintext) { + plaintext = coerceArray(plaintext); + + if ((plaintext.length % 16) !== 0) { + throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); + } + + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + + for (var i = 0; i < plaintext.length; i += 16) { + copyArray(plaintext, block, 0, i, i + 16); + block = this._aes.encrypt(block); + copyArray(block, ciphertext, i); + } + + return ciphertext; + }; + + ModeOfOperationECB.prototype.decrypt = function(ciphertext) { + ciphertext = coerceArray(ciphertext); + + if ((ciphertext.length % 16) !== 0) { + throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); + } + + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + + for (var i = 0; i < ciphertext.length; i += 16) { + copyArray(ciphertext, block, 0, i, i + 16); + block = this._aes.decrypt(block); + copyArray(block, plaintext, i); + } + + return plaintext; + }; + + + /** + * Mode Of Operation - Cipher Block Chaining (CBC) + */ + var ModeOfOperationCBC = function(key, iv) { + if (!(this instanceof ModeOfOperationCBC)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Cipher Block Chaining"; + this.name = "cbc"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 bytes)'); + } + + this._lastCipherblock = coerceArray(iv, true); + + this._aes = new AES(key); + }; + + ModeOfOperationCBC.prototype.encrypt = function(plaintext) { + plaintext = coerceArray(plaintext); + + if ((plaintext.length % 16) !== 0) { + throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); + } + + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + + for (var i = 0; i < plaintext.length; i += 16) { + copyArray(plaintext, block, 0, i, i + 16); + + for (var j = 0; j < 16; j++) { + block[j] ^= this._lastCipherblock[j]; + } + + this._lastCipherblock = this._aes.encrypt(block); + copyArray(this._lastCipherblock, ciphertext, i); + } + + return ciphertext; + }; + + ModeOfOperationCBC.prototype.decrypt = function(ciphertext) { + ciphertext = coerceArray(ciphertext); + + if ((ciphertext.length % 16) !== 0) { + throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); + } + + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + + for (var i = 0; i < ciphertext.length; i += 16) { + copyArray(ciphertext, block, 0, i, i + 16); + block = this._aes.decrypt(block); + + for (var j = 0; j < 16; j++) { + plaintext[i + j] = block[j] ^ this._lastCipherblock[j]; + } + + copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16); + } + + return plaintext; + }; + + + /** + * Mode Of Operation - Cipher Feedback (CFB) + */ + var ModeOfOperationCFB = function(key, iv, segmentSize) { + if (!(this instanceof ModeOfOperationCFB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Cipher Feedback"; + this.name = "cfb"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 size)'); + } + + if (!segmentSize) { segmentSize = 1; } + + this.segmentSize = segmentSize; + + this._shiftRegister = coerceArray(iv, true); + + this._aes = new AES(key); + }; + + ModeOfOperationCFB.prototype.encrypt = function(plaintext) { + if ((plaintext.length % this.segmentSize) != 0) { + throw new Error('invalid plaintext size (must be segmentSize bytes)'); + } + + var encrypted = coerceArray(plaintext, true); + + var xorSegment; + for (var i = 0; i < encrypted.length; i += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + for (var j = 0; j < this.segmentSize; j++) { + encrypted[i + j] ^= xorSegment[j]; + } + + // Shift the register + copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); + copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); + } + + return encrypted; + }; + + ModeOfOperationCFB.prototype.decrypt = function(ciphertext) { + if ((ciphertext.length % this.segmentSize) != 0) { + throw new Error('invalid ciphertext size (must be segmentSize bytes)'); + } + + var plaintext = coerceArray(ciphertext, true); + + var xorSegment; + for (var i = 0; i < plaintext.length; i += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + + for (var j = 0; j < this.segmentSize; j++) { + plaintext[i + j] ^= xorSegment[j]; + } + + // Shift the register + copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); + copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); + } + + return plaintext; + }; + + /** + * Mode Of Operation - Output Feedback (OFB) + */ + var ModeOfOperationOFB = function(key, iv) { + if (!(this instanceof ModeOfOperationOFB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Output Feedback"; + this.name = "ofb"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 bytes)'); + } + + this._lastPrecipher = coerceArray(iv, true); + this._lastPrecipherIndex = 16; + + this._aes = new AES(key); + }; + + ModeOfOperationOFB.prototype.encrypt = function(plaintext) { + var encrypted = coerceArray(plaintext, true); + + for (var i = 0; i < encrypted.length; i++) { + if (this._lastPrecipherIndex === 16) { + this._lastPrecipher = this._aes.encrypt(this._lastPrecipher); + this._lastPrecipherIndex = 0; + } + encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++]; + } + + return encrypted; + }; + + // Decryption is symetric + ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt; + + + /** + * Counter object for CTR common mode of operation + */ + var Counter = function(initialValue) { + if (!(this instanceof Counter)) { + throw Error('Counter must be instanitated with `new`'); + } + + // We allow 0, but anything false-ish uses the default 1 + if (initialValue !== 0 && !initialValue) { initialValue = 1; } + + if (typeof(initialValue) === 'number') { + this._counter = createArray(16); + this.setValue(initialValue); + + } else { + this.setBytes(initialValue); + } + }; + + Counter.prototype.setValue = function(value) { + if (typeof(value) !== 'number' || parseInt(value) != value) { + throw new Error('invalid counter value (must be an integer)'); + } + + // We cannot safely handle numbers beyond the safe range for integers + if (value > Number.MAX_SAFE_INTEGER) { + throw new Error('integer value out of safe range'); + } + + for (var index = 15; index >= 0; --index) { + this._counter[index] = value % 256; + value = parseInt(value / 256); + } + }; + + Counter.prototype.setBytes = function(bytes) { + bytes = coerceArray(bytes, true); + + if (bytes.length != 16) { + throw new Error('invalid counter bytes size (must be 16 bytes)'); + } + + this._counter = bytes; + }; + + Counter.prototype.increment = function() { + for (var i = 15; i >= 0; i--) { + if (this._counter[i] === 255) { + this._counter[i] = 0; + } else { + this._counter[i]++; + break; + } + } + }; + + + /** + * Mode Of Operation - Counter (CTR) + */ + var ModeOfOperationCTR = function(key, counter) { + if (!(this instanceof ModeOfOperationCTR)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Counter"; + this.name = "ctr"; + + if (!(counter instanceof Counter)) { + counter = new Counter(counter); + } + + this._counter = counter; + + this._remainingCounter = null; + this._remainingCounterIndex = 16; + + this._aes = new AES(key); + }; + + ModeOfOperationCTR.prototype.encrypt = function(plaintext) { + var encrypted = coerceArray(plaintext, true); + + for (var i = 0; i < encrypted.length; i++) { + if (this._remainingCounterIndex === 16) { + this._remainingCounter = this._aes.encrypt(this._counter._counter); + this._remainingCounterIndex = 0; + this._counter.increment(); + } + encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++]; + } + + return encrypted; + }; + + // Decryption is symetric + ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt; + + + /////////////////////// + // Padding + + // See:https://tools.ietf.org/html/rfc2315 + function pkcs7pad(data) { + data = coerceArray(data, true); + var padder = 16 - (data.length % 16); + var result = createArray(data.length + padder); + copyArray(data, result); + for (var i = data.length; i < result.length; i++) { + result[i] = padder; + } + return result; + } + + function pkcs7strip(data) { + data = coerceArray(data, true); + if (data.length < 16) { throw new Error('PKCS#7 invalid length'); } + + var padder = data[data.length - 1]; + if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); } + + var length = data.length - padder; + for (var i = 0; i < padder; i++) { + if (data[length + i] !== padder) { + throw new Error('PKCS#7 invalid padding byte'); + } + } + + var result = createArray(length); + copyArray(data, result, 0, 0, length); + return result; + } + + /////////////////////// + // Exporting + + + // The block cipher + var aesjs = { + AES: AES, + Counter: Counter, + + ModeOfOperation: { + ecb: ModeOfOperationECB, + cbc: ModeOfOperationCBC, + cfb: ModeOfOperationCFB, + ofb: ModeOfOperationOFB, + ctr: ModeOfOperationCTR + }, + + utils: { + hex: convertHex, + utf8: convertUtf8 + }, + + padding: { + pkcs7: { + pad: pkcs7pad, + strip: pkcs7strip + } + }, + + _arrayTest: { + coerceArray: coerceArray, + createArray: createArray, + copyArray: copyArray, + } + }; + + + // node.js + { + module.exports = aesjs; + + // RequireJS/AMD + // http://www.requirejs.org/docs/api.html + // https://github.com/amdjs/amdjs-api/wiki/AMD + } + + + })(); + } (aesJs)); + return aesJs.exports; +} + +var aesJsExports = requireAesJs(); +var pkg = /*@__PURE__*/getDefaultExportFromCjs(aesJsExports); + /** * @_ignore */ @@ -18646,7 +44699,7 @@ export function uuidV4(randomBytes: BytesLike): string { * @_subsection: api/wallet:JSON Wallets [json-wallets] */ // @ts-ignore -const { CTR } = pkg; +const { Counter, ModeOfOperation: { ctr: CTR }, } = pkg; const defaultPath$1 = "m/44'/60'/0'/0/0"; /** * Returns true if %%json%% is a valid JSON Keystore Wallet. @@ -18666,7 +44719,7 @@ function decrypt(data, key, ciphertext) { const cipher = spelunk(data, "crypto.cipher:string"); if (cipher === "aes-128-ctr") { const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, iv); + const aesCtr = new CTR(key, new Counter(iv)); return hexlify(aesCtr.decrypt(ciphertext)); } assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { @@ -18677,7 +44730,16 @@ function getAccount(data, _key) { const key = getBytes(_key); const ciphertext = spelunk(data, "crypto.ciphertext:data!"); const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2); - assertArgument(computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); + const expectedMAC = spelunk(data, "crypto.mac:string!"); + let difference = 0; + const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC); + if (validMAC) { + const actual = getBytes("0x" + computedMAC); + const expected = getBytes("0x" + expectedMAC); + for (let i = 0; i < actual.length; i++) + difference |= actual[i] ^ expected[i]; + } + assertArgument(validMAC && difference === 0, "incorrect password", "password", "[REDACTED]"); const privateKey = decrypt(data, key.slice(0, 16), ciphertext); const address = getAddress(data.address); const prefix = extractPrefix(address); @@ -18698,7 +44760,7 @@ function getAccount(data, _key) { const mnemonicKey = key.slice(32, 64); const mnemonicCiphertext = spelunk(data, "x-corebc.mnemonicCiphertext:data!"); const mnemonicIv = spelunk(data, "x-corebc.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); account.mnemonic = { path: spelunk(data, "x-corebc.path:string") || defaultPath$1, locale: spelunk(data, "x-corebc.locale:string") || "en", @@ -18707,6 +44769,16 @@ function getAccount(data, _key) { } return account; } +// Match Core Web3Dart's wallet KDF resource limits. +function validateScrypt(N, r, p) { + assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, "unsafe scrypt N", "kdf.N", N); + assertArgument(Number.isSafeInteger(r) && + Number.isSafeInteger(p) && + r > 0 && + p > 0 && + r * p <= 1048576 && + 128 * N * r <= 256 * 1024 * 1024, "unsafe scrypt work or memory requirement", "kdf", { N, r, p }); +} function getDecryptKdfParams(data) { const kdf = spelunk(data, "crypto.kdf:string"); if (kdf && typeof kdf === "string") { @@ -18715,9 +44787,7 @@ function getDecryptKdfParams(data) { const N = spelunk(data, "crypto.kdfparams.n:int!"); const r = spelunk(data, "crypto.kdfparams.r:int!"); const p = spelunk(data, "crypto.kdfparams.p:int!"); - // Make sure N is a power of 2 - assertArgument(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - assertArgument(r > 0 && p > 0, "invalid kdf", "kdf", kdf); + validateScrypt(N, r, p); const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); return { name: "scrypt", salt, N, r, p, dkLen: 64 }; @@ -18726,11 +44796,18 @@ function getDecryptKdfParams(data) { const salt = spelunk(data, "crypto.kdfparams.salt:data!"); const prf = spelunk(data, "crypto.kdfparams.prf:string!"); const algorithm = prf.split("-").pop(); - assertArgument(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); + assertArgument(prf === "hmac-sha256" || prf === "hmac-sha512", "invalid kdf.pdf", "kdf.pdf", prf); const count = spelunk(data, "crypto.kdfparams.c:int!"); + assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, "unsafe PBKDF2 iteration count", "kdf.c", count); const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { name: "pbkdf2", salt, count, dkLen, algorithm }; + return { + name: "pbkdf2", + salt, + count, + dkLen, + algorithm: algorithm, + }; } } assertArgument(false, "unsupported key-derivation function", "kdf", kdf); @@ -18813,22 +44890,17 @@ function getEncryptKdfParams(options) { // Override the scrypt password-based key derivation function parameters let N = 1 << 17, r = 8, p = 1; if (options.scrypt) { - if (options.scrypt.N) { + if (options.scrypt.N != null) { N = options.scrypt.N; } - if (options.scrypt.r) { + if (options.scrypt.r != null) { r = options.scrypt.r; } - if (options.scrypt.p) { + if (options.scrypt.p != null) { p = options.scrypt.p; } } - assertArgument(typeof N === "number" && - N > 0 && - Number.isSafeInteger(N) && - (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); - assertArgument(typeof r === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); - assertArgument(typeof p === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); + validateScrypt(N, r, p); return { name: "scrypt", dkLen: 32, salt, N, r, p }; } function _encryptKeystore(key, kdf, account, options) { @@ -18847,7 +44919,7 @@ function _encryptKeystore(key, kdf, account, options) { const derivedKey = key.slice(0, 16); const macPrefix = key.slice(16, 32); // Encrypt the private key - const aesCtr = new CTR(derivedKey, iv); + const aesCtr = new CTR(derivedKey, new Counter(iv)); const ciphertext = getBytes(aesCtr.encrypt(privateKey)); // Compute the message authentication code, used to check the password const mac = sha256(concat([macPrefix, ciphertext])); @@ -18880,7 +44952,7 @@ function _encryptKeystore(key, kdf, account, options) { const mnemonicKey = key.slice(32, 64); const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); const now = new Date(); const timestamp = now.getUTCFullYear() + @@ -19306,7 +45378,7 @@ function getIndexedAccountPath(_index) { * @_subsection: api/wallet:JSON Wallets [json-wallets] */ // @ts-ignore -const { CBC, pkcs7Strip } = pkg; +const { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg; /** * Returns true if %%json%% is a valid JSON Crowdsale wallet. */ @@ -19611,189 +45683,478 @@ const wordlists = { en: LangEn.wordlist(), }; +const customUnitAbi = Object.freeze([ + "function supportsUnit(string unit) view returns (bool)", + "function supportedUnits() view returns (string[])", + "function preferredUnit() view returns (string)", + "function balanceOf(address account) view returns (uint256)", + "function balanceOfUnit(address account, string unit) view returns (uint256)", +]); +class CustomUnitDiscovery { + preferredUnit; + supportedUnits; + constructor(units, preferredUnit) { + this.preferredUnit = preferredUnit; + this.supportedUnits = Object.freeze([...units]); + } + get isValid() { + return (this.supports("units") && + this.preferredUnit !== "" && + this.supports(this.preferredUnit)); + } + supports(unit) { + return this.supportedUnits.includes(unit); + } +} +/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ +class CustomUnitBalance { + canonicalAmount; + unitAmount; + unit; + constructor(canonicalAmount, unitAmount, unit) { + this.canonicalAmount = canonicalAmount; + this.unitAmount = unitAmount; + this.unit = unit; + } + get multiplierNumerator() { + return this.unitAmount; + } + get multiplierDenominator() { + return this.canonicalAmount; + } +} +/** Core custom-unit contract convention used by Tone and Core API. */ +class CustomUnitToken { + contract; + constructor(address, runner) { + this.contract = new Contract(address, customUnitAbi, runner); + } + async supportsUnit(unit, blockTag) { + return (unit.trim() !== "" && + (await this.contract.supportsUnit(unit.trim(), { blockTag }))); + } + async supportedUnits(blockTag) { + return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag }))); + } + async preferredUnit(blockTag) { + return (await this.contract.preferredUnit({ blockTag })).trim(); + } + async discover(blockTag) { + if (!(await this.supportsUnit("units", blockTag))) + return null; + const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag)); + return discovery.isValid ? discovery : null; + } + canonicalBalance(account, blockTag) { + return this.contract.balanceOf(account, { blockTag }); + } + balanceOfUnit(account, unit, blockTag) { + if (!unit.trim()) + throw new TypeError("unit must not be empty"); + return this.contract.balanceOfUnit(account, unit.trim(), { blockTag }); + } + async balance(account, unit, blockTag) { + const resolved = unit?.trim() || (await this.preferredUnit(blockTag)); + const [canonical, calculated] = await Promise.all([ + this.canonicalBalance(account, blockTag), + this.balanceOfUnit(account, resolved, blockTag), + ]); + return new CustomUnitBalance(canonical, calculated, resolved); + } +} + +/** On-chain interface defined by CIP-150. */ +const cip150Abi = Object.freeze([ + "function getMetadataValue(string key) view returns (string value)", + "function hasMetadataKey(string key) view returns (bool exists)", + "function isMetadataSealed(string key) view returns (bool sealed)", + "function listMetadataKeys() view returns (string[] keys)", + "function getMetadataByIndex(uint256 index) view returns (string key, string value)", + "function metadataCount() view returns (uint256 total)", + "function setMetadataValue(string key, string value)", + "function sealMetadataKey(string key)", +]); +const cip151TokenExpirationKey = "tokenExpiration"; +const cip151TradingStopKey = "tradingStop"; +const cip152LabKey = "lab"; +/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ +class Cip151Lifecycle { + tokenExpiration; + tradingStop; + constructor(metadata = {}) { + const parse = (key) => { + const value = metadata[key]; + if (value == null || value === "") + return null; + if (!/^\d+$/.test(value)) + throw new TypeError(`${key} must be a non-negative Unix timestamp`); + return BigInt(value); + }; + this.tokenExpiration = parse(cip151TokenExpirationKey); + this.tradingStop = parse(cip151TradingStopKey); + } + isExpiredAt(seconds) { + return this.tokenExpiration !== null && seconds >= this.tokenExpiration; + } + isTradingStoppedAt(seconds) { + return this.tradingStop !== null && seconds >= this.tradingStop; + } +} +/** Validates certificate structure, not the authenticity of its issuer. */ +class Cip152LabCertificate { + measurements; + constructor(json) { + if (json === null || typeof json !== "object" || Array.isArray(json)) + throw new TypeError("CIP-152 lab.json must be an object"); + const measurements = Object.create(null); + for (const [key, property] of Object.entries(json)) { + if (!property || + typeof property !== "object" || + Array.isArray(property) || + !Object.hasOwn(property, "value")) + throw new TypeError(`CIP-152 property ${key} must contain a value`); + const { value, unit } = property; + if (!(typeof value === "string" || + (typeof value === "number" && Number.isFinite(value)))) + throw new TypeError(`CIP-152 property ${key} has an invalid value`); + if (unit != null && typeof unit !== "string") + throw new TypeError(`CIP-152 property ${key} has an invalid unit`); + measurements[key] = Object.freeze(unit == null ? { value } : { value, unit }); + } + this.measurements = Object.freeze(measurements); + } +} +/** Typed metadata reader and writer. Writes require a signer as runner. */ +class Cip150MetadataContract { + contract; + constructor(address, runner) { + this.contract = new Contract(address, cip150Abi, runner); + } + getValue(key, blockTag) { + return this.contract.getMetadataValue(key, { blockTag }); + } + hasKey(key, blockTag) { + return this.contract.hasMetadataKey(key, { blockTag }); + } + isSealed(key, blockTag) { + return this.contract.isMetadataSealed(key, { blockTag }); + } + async listKeys(blockTag) { + return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag }))); + } + async getByIndex(index, blockTag) { + const [key, value] = await this.contract.getMetadataByIndex(index, { + blockTag, + }); + return Object.freeze({ key, value }); + } + count(blockTag) { + return this.contract.metadataCount({ blockTag }); + } + async readAll(blockTag, includeSealedState = true) { + const entries = []; + for (const key of await this.listKeys(blockTag)) { + const value = await this.getValue(key, blockTag); + entries.push(Object.freeze(includeSealedState + ? { key, value, sealed: await this.isSealed(key, blockTag) } + : { key, value })); + } + return Object.freeze(entries); + } + setValue(key, value, overrides = {}) { + return this.contract.setMetadataValue(key, value, overrides); + } + sealKey(key, overrides = {}) { + return this.contract.sealMetadataKey(key, overrides); + } + async readLifecycle(blockTag) { + const metadata = {}; + for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) { + if (await this.hasKey(key, blockTag)) + metadata[key] = await this.getValue(key, blockTag); + } + return new Cip151Lifecycle(metadata); + } + async readLabCertificate(gateway, blockTag) { + if (!(await this.hasKey(cip152LabKey, blockTag))) + return null; + const reference = await this.getValue(cip152LabKey, blockTag); + if (!gateway.resolve(reference).pathname.endsWith("/lab.json")) + throw new TypeError("CIP-152 reference must point to lab.json"); + return new Cip152LabCertificate(await gateway.readJson(reference)); + } +} + +const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; +/** Configurable IPFS resolution and bounded JSON loading. */ +class IpfsGateway { + template; + maxResponseBytes; + timeoutMs; + #fetch; + constructor(options = {}) { + this.template = options.template ?? defaultIpfsGatewayTemplate; + this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024; + this.timeoutMs = options.timeoutMs ?? 30_000; + this.#fetch = options.fetch ?? globalThis.fetch; + const templateUrl = new URL(this.template.replace("{cid}", "cid")); + if (!/^https?:$/.test(templateUrl.protocol) || + this.template.split("{cid}").length !== 2) + throw new TypeError("gateway template must be HTTP(S) and contain one {cid}"); + for (const value of [this.maxResponseBytes, this.timeoutMs]) + if (!Number.isSafeInteger(value) || value <= 0) + throw new TypeError("gateway limits must be positive safe integers"); + } + resolve(reference) { + const value = reference.trim(); + if (/^https?:\/\//i.test(value)) + return new URL(value); + const path = value.replace(/^ipfs:\/\//, "").replace(/^\/?ipfs\//, ""); + if (!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path) || + path.split("/").some((part) => part === "." || part === "..")) + throw new TypeError("invalid IPFS reference"); + return new URL(this.template.replace("{cid}", path.split("/").map(encodeURIComponent).join("/"))); + } + async readJson(reference) { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), this.timeoutMs); + let reader; + try { + const response = await this.#fetch(this.resolve(reference), { + headers: { accept: "application/json" }, + signal: controller.signal, + }); + if (!response.ok) { + await response.body?.cancel(); + throw new Error(`IPFS gateway returned HTTP ${response.status}`); + } + if (!response.body) + throw new Error("IPFS gateway returned an empty body"); + reader = response.body.getReader(); + const chunks = []; + let length = 0; + while (true) { + const { done, value } = await reader.read(); + if (done) + break; + length += value.length; + if (length > this.maxResponseBytes) + throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`); + chunks.push(value); + } + const bytes = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + bytes.set(chunk, offset); + offset += chunk.length; + } + return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)); + } + finally { + clearTimeout(timer); + await reader?.cancel().catch(() => { }); + reader?.releaseLock(); + } + } +} + var corebc = /*#__PURE__*/Object.freeze({ - __proto__: null, - AbiCoder: AbiCoder, - AbstractProvider: AbstractProvider, - AbstractSigner: AbstractSigner, - AlchemyProvider: AlchemyProvider, - AnkrProvider: AnkrProvider, - BaseContract: BaseContract, - BaseWallet: BaseWallet, - BigNumber: BigNumber, - Block: Block, - BrowserProvider: BrowserProvider, - CloudflareProvider: CloudflareProvider, - ConstructorFragment: ConstructorFragment, - Contract: Contract, - ContractEventPayload: ContractEventPayload, - ContractFactory: ContractFactory, - ContractTransactionReceipt: ContractTransactionReceipt, - ContractTransactionResponse: ContractTransactionResponse, - ContractUnknownEventPayload: ContractUnknownEventPayload, - CoreSymbol: CoreSymbol, - Ed448Goldilock: Ed448Goldilock, - EnergyCostPlugin: EnergyCostPlugin, - ErrorDescription: ErrorDescription, - ErrorFragment: ErrorFragment, - EventFragment: EventFragment, - EventLog: EventLog, - EventPayload: EventPayload, - FallbackFragment: FallbackFragment, - FallbackProvider: FallbackProvider, - FeeData: FeeData, - FeeDataNetworkPlugin: FeeDataNetworkPlugin, - FetchCancelSignal: FetchCancelSignal, - FetchRequest: FetchRequest, - FetchResponse: FetchResponse, - FixedNumber: FixedNumber, - Fragment: Fragment, - FunctionFragment: FunctionFragment, - HDNodeWallet: HDNodeWallet, - Indexed: Indexed, - InfuraProvider: InfuraProvider, - InfuraWebSocketProvider: InfuraWebSocketProvider, - Interface: Interface, - IpcSocketProvider: IpcSocketProvider, - JsonRpcApiProvider: JsonRpcApiProvider, - JsonRpcProvider: JsonRpcProvider, - JsonRpcSigner: JsonRpcSigner, - LangEn: LangEn, - Log: Log, - LogDescription: LogDescription, - MaxInt256: MaxInt256, - MaxUint256: MaxUint256, - MessagePrefix: MessagePrefix, - MinInt256: MinInt256, - Mnemonic: Mnemonic, - N: N, - NamedFragment: NamedFragment, - Network: Network, - NetworkPlugin: NetworkPlugin, - NonceManager: NonceManager, - OrePerXCB: OrePerXCB, - ParamType: ParamType, - PocketProvider: PocketProvider, - QuickNodeProvider: QuickNodeProvider, - Result: Result, - Signature: Signature, - SigningKey: SigningKey, - SocketBlockSubscriber: SocketBlockSubscriber, - SocketEventSubscriber: SocketEventSubscriber, - SocketPendingSubscriber: SocketPendingSubscriber, - SocketProvider: SocketProvider, - SocketSubscriber: SocketSubscriber, - StructFragment: StructFragment, - Transaction: Transaction, - TransactionDescription: TransactionDescription, - TransactionReceipt: TransactionReceipt, - TransactionResponse: TransactionResponse, - Typed: Typed, - TypedDataEncoder: TypedDataEncoder, - UnmanagedSubscriber: UnmanagedSubscriber, - Utf8ErrorFuncs: Utf8ErrorFuncs, - VoidSigner: VoidSigner, - Wallet: Wallet, - WebSocketProvider: WebSocketProvider, - Wordlist: Wordlist, - WordlistOwl: WordlistOwl, - WordlistOwlA: WordlistOwlA, - ZeroAddress: ZeroAddress, - ZeroHash: ZeroHash, - accessListify: accessListify, - arrayify: arrayify, - assert: assert, - assertArgument: assertArgument, - assertArgumentCount: assertArgumentCount, - assertNormalize: assertNormalize, - assertPrivate: assertPrivate, - checkResultErrors: checkResultErrors, - computeAddress: computeAddress, - computeHmac: computeHmac, - concat: concat, - copyRequest: copyRequest, - dataLength: dataLength, - dataSlice: dataSlice, - decodeBase58: decodeBase58, - decodeBase64: decodeBase64, - decodeBytes32String: decodeBytes32String, - decodeRlp: decodeRlp, - decryptCrowdsaleJson: decryptCrowdsaleJson, - decryptKeystoreJson: decryptKeystoreJson, - decryptKeystoreJsonSync: decryptKeystoreJsonSync, - defaultPath: defaultPath, - defineProperties: defineProperties, - encodeBase58: encodeBase58, - encodeBase64: encodeBase64, - encodeBytes32String: encodeBytes32String, - encodeRlp: encodeRlp, - encryptKeystoreJson: encryptKeystoreJson, - encryptKeystoreJsonSync: encryptKeystoreJsonSync, - formatUnits: formatUnits, - formatXCB: formatXCB, - fromTwos: fromTwos, - getAccountPath: getAccountPath, - getAddress: getAddress, - getBigInt: getBigInt, - getBytes: getBytes, - getBytesCopy: getBytesCopy, - getCreate2Address: getCreate2Address, - getCreateAddress: getCreateAddress, - getDefaultProvider: getDefaultProvider, - getIndexedAccountPath: getIndexedAccountPath, - getNumber: getNumber, - getUint: getUint, - hashMessage: hashMessage, - hexConcat: hexConcat, - hexlify: hexlify, - id: id, - isAddress: isAddress, - isAddressable: isAddressable, - isBytesLike: isBytesLike, - isCallException: isCallException, - isCrowdsaleJson: isCrowdsaleJson, - isError: isError, - isHexString: isHexString, - isKeystoreJson: isKeystoreJson, - keccak256: keccak256, - lock: lock, - makeError: makeError, - mask: mask, - networkIdToPrefix: networkIdToPrefix, - parseUnits: parseUnits, - parseXCB: parseXCB, - pbkdf2: pbkdf2, - publicToAddress: publicToAddress, - randomBytes: randomBytes, - recoverAddress: recoverAddress, - resolveAddress: resolveAddress, - resolveProperties: resolveProperties, - ripemd160: ripemd160, - scrypt: scrypt, - scryptSync: scryptSync, - sha256: sha256, - sha512: sha512, - showThrottleMessage: showThrottleMessage, - solidityPacked: solidityPacked, - solidityPackedSha256: solidityPackedSha256, - stripZerosLeft: stripZerosLeft, - toBeArray: toBeArray, - toBeHex: toBeHex, - toBigInt: toBigInt, - toNumber: toNumber, - toQuantity: toQuantity, - toTwos: toTwos, - toUtf8Bytes: toUtf8Bytes, - toUtf8CodePoints: toUtf8CodePoints, - toUtf8String: toUtf8String, - uuidV4: uuidV4, - verifyMessage: verifyMessage, - verifyTypedData: verifyTypedData, - version: version, - wordlists: wordlists, - zeroPadBytes: zeroPadBytes, - zeroPadValue: zeroPadValue + __proto__: null, + AbiCoder: AbiCoder, + AbstractProvider: AbstractProvider, + AbstractSigner: AbstractSigner, + AlchemyProvider: AlchemyProvider, + AnkrProvider: AnkrProvider, + BaseContract: BaseContract, + BaseWallet: BaseWallet, + BigNumber: BigNumber, + Block: Block, + BrowserProvider: BrowserProvider, + Cip150MetadataContract: Cip150MetadataContract, + Cip151Lifecycle: Cip151Lifecycle, + Cip152LabCertificate: Cip152LabCertificate, + CloudflareProvider: CloudflareProvider, + ConstructorFragment: ConstructorFragment, + Contract: Contract, + ContractEventPayload: ContractEventPayload, + ContractFactory: ContractFactory, + ContractTransactionReceipt: ContractTransactionReceipt, + ContractTransactionResponse: ContractTransactionResponse, + ContractUnknownEventPayload: ContractUnknownEventPayload, + CoreSymbol: CoreSymbol, + CustomUnitBalance: CustomUnitBalance, + CustomUnitDiscovery: CustomUnitDiscovery, + CustomUnitToken: CustomUnitToken, + Ed448Goldilock: Ed448Goldilock, + EnergyCostPlugin: EnergyCostPlugin, + ErrorDescription: ErrorDescription, + ErrorFragment: ErrorFragment, + EventFragment: EventFragment, + EventLog: EventLog, + EventPayload: EventPayload, + FallbackFragment: FallbackFragment, + FallbackProvider: FallbackProvider, + FeeData: FeeData, + FeeDataNetworkPlugin: FeeDataNetworkPlugin, + FetchCancelSignal: FetchCancelSignal, + FetchRequest: FetchRequest, + FetchResponse: FetchResponse, + FixedNumber: FixedNumber, + Fragment: Fragment, + FunctionFragment: FunctionFragment, + HDNodeWallet: HDNodeWallet, + Indexed: Indexed, + InfuraProvider: InfuraProvider, + InfuraWebSocketProvider: InfuraWebSocketProvider, + Interface: Interface, + IpcSocketProvider: IpcSocketProvider, + IpfsGateway: IpfsGateway, + JsonRpcApiProvider: JsonRpcApiProvider, + JsonRpcProvider: JsonRpcProvider, + JsonRpcSigner: JsonRpcSigner, + LangEn: LangEn, + Log: Log, + LogDescription: LogDescription, + MaxInt256: MaxInt256, + MaxUint256: MaxUint256, + MessagePrefix: MessagePrefix, + MinInt256: MinInt256, + Mnemonic: Mnemonic, + N: N, + NamedFragment: NamedFragment, + Network: Network, + NetworkPlugin: NetworkPlugin, + NonceManager: NonceManager, + OrePerXCB: OrePerXCB, + ParamType: ParamType, + PocketProvider: PocketProvider, + QuickNodeProvider: QuickNodeProvider, + Result: Result, + Signature: Signature, + SigningKey: SigningKey, + SocketBlockSubscriber: SocketBlockSubscriber, + SocketEventSubscriber: SocketEventSubscriber, + SocketPendingSubscriber: SocketPendingSubscriber, + SocketProvider: SocketProvider, + SocketSubscriber: SocketSubscriber, + StructFragment: StructFragment, + Transaction: Transaction, + TransactionDescription: TransactionDescription, + TransactionReceipt: TransactionReceipt, + TransactionResponse: TransactionResponse, + Typed: Typed, + TypedDataEncoder: TypedDataEncoder, + UnmanagedSubscriber: UnmanagedSubscriber, + Utf8ErrorFuncs: Utf8ErrorFuncs, + VoidSigner: VoidSigner, + Wallet: Wallet, + WebSocketProvider: WebSocketProvider, + Wordlist: Wordlist, + WordlistOwl: WordlistOwl, + WordlistOwlA: WordlistOwlA, + ZeroAddress: ZeroAddress, + ZeroHash: ZeroHash, + accessListify: accessListify, + arrayify: arrayify, + assert: assert, + assertArgument: assertArgument, + assertArgumentCount: assertArgumentCount, + assertNormalize: assertNormalize, + assertPrivate: assertPrivate, + checkResultErrors: checkResultErrors, + cip150Abi: cip150Abi, + cip151TokenExpirationKey: cip151TokenExpirationKey, + cip151TradingStopKey: cip151TradingStopKey, + cip152LabKey: cip152LabKey, + computeAddress: computeAddress, + computeHmac: computeHmac, + concat: concat, + copyRequest: copyRequest, + customUnitAbi: customUnitAbi, + dataLength: dataLength, + dataSlice: dataSlice, + decodeBase58: decodeBase58, + decodeBase64: decodeBase64, + decodeBytes32String: decodeBytes32String, + decodeRlp: decodeRlp, + decryptCrowdsaleJson: decryptCrowdsaleJson, + decryptKeystoreJson: decryptKeystoreJson, + decryptKeystoreJsonSync: decryptKeystoreJsonSync, + defaultIpfsGatewayTemplate: defaultIpfsGatewayTemplate, + defaultPath: defaultPath, + defineProperties: defineProperties, + encodeBase58: encodeBase58, + encodeBase64: encodeBase64, + encodeBytes32String: encodeBytes32String, + encodeRlp: encodeRlp, + encryptKeystoreJson: encryptKeystoreJson, + encryptKeystoreJsonSync: encryptKeystoreJsonSync, + formatUnits: formatUnits, + formatXCB: formatXCB, + fromTwos: fromTwos, + getAccountPath: getAccountPath, + getAddress: getAddress, + getBigInt: getBigInt, + getBytes: getBytes, + getBytesCopy: getBytesCopy, + getCreate2Address: getCreate2Address, + getCreateAddress: getCreateAddress, + getDefaultProvider: getDefaultProvider, + getIndexedAccountPath: getIndexedAccountPath, + getNumber: getNumber, + getUint: getUint, + hashMessage: hashMessage, + hexConcat: hexConcat, + hexlify: hexlify, + id: id, + isAddress: isAddress, + isAddressable: isAddressable, + isBytesLike: isBytesLike, + isCallException: isCallException, + isCrowdsaleJson: isCrowdsaleJson, + isError: isError, + isHexString: isHexString, + isKeystoreJson: isKeystoreJson, + keccak256: keccak256, + lock: lock, + makeError: makeError, + mask: mask, + networkIdToPrefix: networkIdToPrefix, + parseUnits: parseUnits, + parseXCB: parseXCB, + pbkdf2: pbkdf2, + publicToAddress: publicToAddress, + randomBytes: randomBytes, + recoverAddress: recoverAddress, + resolveAddress: resolveAddress, + resolveProperties: resolveProperties, + ripemd160: ripemd160, + scrypt: scrypt, + scryptSync: scryptSync, + sha256: sha256, + sha512: sha512, + showThrottleMessage: showThrottleMessage, + solidityPacked: solidityPacked, + solidityPackedSha256: solidityPackedSha256, + stripZerosLeft: stripZerosLeft, + toBeArray: toBeArray, + toBeHex: toBeHex, + toBigInt: toBigInt, + toNumber: toNumber, + toQuantity: toQuantity, + toTwos: toTwos, + toUtf8Bytes: toUtf8Bytes, + toUtf8CodePoints: toUtf8CodePoints, + toUtf8String: toUtf8String, + uuidV4: uuidV4, + verifyMessage: verifyMessage, + verifyTypedData: verifyTypedData, + version: version, + wordlists: wordlists, + zeroPadBytes: zeroPadBytes, + zeroPadValue: zeroPadValue }); -export { AbiCoder, AbstractProvider, AbstractSigner, AlchemyProvider, AnkrProvider, BaseContract, BaseWallet, BigNumber, Block, BrowserProvider, CloudflareProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, CoreSymbol, Ed448Goldilock, EnergyCostPlugin, ErrorDescription, ErrorFragment, EventFragment, EventLog, EventPayload, FallbackFragment, FallbackProvider, FeeData, FeeDataNetworkPlugin, FetchCancelSignal, FetchRequest, FetchResponse, FixedNumber, Fragment, FunctionFragment, HDNodeWallet, Indexed, InfuraProvider, InfuraWebSocketProvider, Interface, IpcSocketProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, N, NamedFragment, Network, NetworkPlugin, NonceManager, OrePerXCB, ParamType, PocketProvider, QuickNodeProvider, Result, Signature, SigningKey, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketProvider, SocketSubscriber, StructFragment, Transaction, TransactionDescription, TransactionReceipt, TransactionResponse, Typed, TypedDataEncoder, UnmanagedSubscriber, Utf8ErrorFuncs, VoidSigner, Wallet, WebSocketProvider, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, accessListify, arrayify, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, checkResultErrors, computeAddress, computeHmac, concat, copyRequest, corebc, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32String, decodeRlp, decryptCrowdsaleJson, decryptKeystoreJson, decryptKeystoreJsonSync, defaultPath, defineProperties, encodeBase58, encodeBase64, encodeBytes32String, encodeRlp, encryptKeystoreJson, encryptKeystoreJsonSync, formatUnits, formatXCB, fromTwos, getAccountPath, getAddress, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getDefaultProvider, getIndexedAccountPath, getNumber, getUint, hashMessage, hexConcat, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isCrowdsaleJson, isError, isHexString, isKeystoreJson, keccak256, lock, makeError, mask, networkIdToPrefix, parseUnits, parseXCB, pbkdf2, publicToAddress, randomBytes, recoverAddress, resolveAddress, resolveProperties, ripemd160, scrypt, scryptSync, sha256, sha512, showThrottleMessage, solidityPacked, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, uuidV4, verifyMessage, verifyTypedData, version, wordlists, zeroPadBytes, zeroPadValue }; +var Buffer = bufferExports.Buffer; +export { AbiCoder, AbstractProvider, AbstractSigner, AlchemyProvider, AnkrProvider, BaseContract, BaseWallet, BigNumber, Block, BrowserProvider, Buffer, Cip150MetadataContract, Cip151Lifecycle, Cip152LabCertificate, CloudflareProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, CoreSymbol, CustomUnitBalance, CustomUnitDiscovery, CustomUnitToken, Ed448Goldilock, EnergyCostPlugin, ErrorDescription, ErrorFragment, EventFragment, EventLog, EventPayload, FallbackFragment, FallbackProvider, FeeData, FeeDataNetworkPlugin, FetchCancelSignal, FetchRequest, FetchResponse, FixedNumber, Fragment, FunctionFragment, HDNodeWallet, Indexed, InfuraProvider, InfuraWebSocketProvider, Interface, IpcSocketProvider, IpfsGateway, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, N, NamedFragment, Network, NetworkPlugin, NonceManager, OrePerXCB, ParamType, PocketProvider, QuickNodeProvider, Result, Signature, SigningKey, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketProvider, SocketSubscriber, StructFragment, Transaction, TransactionDescription, TransactionReceipt, TransactionResponse, Typed, TypedDataEncoder, UnmanagedSubscriber, Utf8ErrorFuncs, VoidSigner, Wallet, WebSocketProvider, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, accessListify, arrayify, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, checkResultErrors, cip150Abi, cip151TokenExpirationKey, cip151TradingStopKey, cip152LabKey, computeAddress, computeHmac, concat, copyRequest, corebc, customUnitAbi, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32String, decodeRlp, decryptCrowdsaleJson, decryptKeystoreJson, decryptKeystoreJsonSync, defaultIpfsGatewayTemplate, defaultPath, defineProperties, encodeBase58, encodeBase64, encodeBytes32String, encodeRlp, encryptKeystoreJson, encryptKeystoreJsonSync, formatUnits, formatXCB, fromTwos, getAccountPath, getAddress, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getDefaultProvider, getIndexedAccountPath, getNumber, getUint, hashMessage, hexConcat, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isCrowdsaleJson, isError, isHexString, isKeystoreJson, keccak256, lock, makeError, mask, networkIdToPrefix, parseUnits, parseXCB, pbkdf2, publicToAddress, randomBytes, recoverAddress, resolveAddress, resolveProperties, ripemd160, scrypt, scryptSync, sha256, sha512, showThrottleMessage, solidityPacked, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, uuidV4, verifyMessage, verifyTypedData, version, wordlists, zeroPadBytes, zeroPadValue }; //# sourceMappingURL=corebc.js.map diff --git a/dist/corebc.js.map b/dist/corebc.js.map index 61fd26d9a..a6de9e66c 100644 --- a/dist/corebc.js.map +++ b/dist/corebc.js.map @@ -1 +1 @@ -{"version":3,"file":"corebc.js","sources":["../lib.esm/_version.js","../lib.esm/logger/logger.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/bigNumber/bigNumber.js","../lib.esm/crypto/rlp.js","../node_modules/@noble/hashes/esm/_assert.js","../node_modules/@noble/hashes/esm/utils.js","../node_modules/@noble/hashes/esm/hmac.js","../node_modules/@noble/hashes/esm/pbkdf2.js","../node_modules/@noble/hashes/esm/_sha2.js","../node_modules/@noble/hashes/esm/sha256.js","../node_modules/@noble/hashes/esm/_u64.js","../node_modules/@noble/hashes/esm/sha512.js","../node_modules/@noble/hashes/esm/sha3.js","../lib.esm/utils/maths.js","../lib.esm/utils/base58.js","../lib.esm/utils/base64-browser.js","../lib.esm/utils/events.js","../lib.esm/utils/utf8.js","../lib.esm/utils/geturl-browser.js","../lib.esm/utils/fetch.js","../lib.esm/utils/fixednumber.js","../lib.esm/utils/rlp-decode.js","../lib.esm/utils/rlp-encode.js","../lib.esm/utils/units.js","../lib.esm/utils/uuid.js","../lib.esm/crypto/ed448goldilock-browser.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/sha3.js","../lib.esm/address/index.js","../lib.esm/crypto/hmac.js","../node_modules/@noble/hashes/esm/ripemd160.js","../lib.esm/crypto/ripemd160.js","../lib.esm/crypto/pbkdf2.js","../lib.esm/crypto/random.js","../node_modules/@noble/hashes/esm/scrypt.js","../lib.esm/crypto/scrypt.js","../lib.esm/crypto/keccak.js","../node_modules/@noble/secp256k1/index.js","../lib.esm/crypto/signing-key.js","../lib.esm/crypto/signature.js","../lib.esm/crypto/index.js","../lib.esm/transaction/address.js","../lib.esm/abi/coders/abstract-coder.js","../lib.esm/abi/typed.js","../lib.esm/abi/coders/address.js","../lib.esm/abi/coders/anonymous.js","../lib.esm/abi/coders/array.js","../lib.esm/abi/coders/boolean.js","../lib.esm/abi/coders/bytes.js","../lib.esm/abi/coders/fixed-bytes.js","../lib.esm/abi/coders/null.js","../lib.esm/abi/coders/number.js","../lib.esm/abi/coders/string.js","../lib.esm/abi/coders/tuple.js","../lib.esm/hash/id.js","../lib.esm/constants/addresses.js","../lib.esm/constants/hashes.js","../lib.esm/constants/numbers.js","../lib.esm/constants/strings.js","../lib.esm/transaction/accesslist.js","../lib.esm/transaction/transaction.js","../lib.esm/hash/message.js","../lib.esm/hash/solidity.js","../lib.esm/hash/typed-data.js","../lib.esm/abi/fragments.js","../lib.esm/abi/abi-coder.js","../lib.esm/abi/bytes32.js","../lib.esm/abi/interface.js","../lib.esm/address/contract-address.js","../lib.esm/address/checks.js","../lib.esm/providers/provider.js","../lib.esm/contract/wrappers.js","../lib.esm/contract/contract.js","../lib.esm/contract/factory.js","../lib.esm/providers/format.js","../lib.esm/providers/plugins-network.js","../lib.esm/providers/network.js","../lib.esm/providers/subscriber-polling.js","../lib.esm/providers/abstract-provider.js","../lib.esm/providers/abstract-signer.js","../lib.esm/providers/community.js","../lib.esm/providers/subscriber-filterid.js","../lib.esm/providers/provider-jsonrpc.js","../lib.esm/providers/provider-ankr.js","../lib.esm/providers/provider-alchemy.js","../lib.esm/providers/provider-cloudflare.js","../lib.esm/providers/ws-browser.js","../lib.esm/providers/provider-socket.js","../lib.esm/providers/provider-websocket.js","../lib.esm/providers/provider-infura.js","../lib.esm/providers/provider-quicknode.js","../lib.esm/providers/provider-fallback.js","../lib.esm/providers/default-provider.js","../lib.esm/providers/signer-noncemanager.js","../lib.esm/providers/provider-browser.js","../lib.esm/providers/provider-pocket.js","../lib.esm/providers/provider-ipcsocket-browser.js","../lib.esm/wallet/base-wallet.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-en.js","../lib.esm/wallet/mnemonicToSeed.js","../lib.esm/wallet/mnemonic.js","../lib.esm/wallet/utils.js","../lib.esm/wallet/json-keystore.js","../lib.esm/wallet/hdwallet.js","../lib.esm/wallet/json-crowdsale.js","../lib.esm/wallet/wallet.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/wordlists-browser.js"],"sourcesContent":["/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */\n/**\n * The current version of corebc.\n */\nexport const version = \"6.4.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map","import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map","/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return addSlice(new Uint8Array(result));\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return addSlice(new Uint8Array(result));\n }\n if (isBytes(value)) {\n return addSlice(new Uint8Array(value));\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nfunction addSlice(array) {\n // @ts-ignore\n if (array.slice) {\n return array;\n }\n array.slice = function () {\n const args = Array.prototype.slice.call(arguments);\n return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));\n };\n return array;\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { isBytes, hexlify, isHexString, } from \"../utils/data.js\";\nvar BN = _BN.BN;\nconst logger = new Logger(\"bigNumber/0.0.1\");\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null &&\n (BigNumber.isBigNumber(value) ||\n (typeof value === \"number\" && value % 1 === 0) ||\n (typeof value === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n typeof value === \"bigint\" ||\n isBytes(value)));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n _hex;\n _isBigNumber;\n constructor(constructorGuard, hex) {\n logger.checkNew(new.target, BigNumber);\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\",\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division by zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return this._hex[0] === \"-\";\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n // @ts-ignore\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString(),\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof value === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof value === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof anyValue === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof hex === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof hex === \"string\") {\n if (isHexString(hex) ||\n (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\n// @ts-ignore\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof value !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\n// @ts-ignore\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\n// @ts-ignore\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return new BN(\"-\" + hex.substring(3), 16);\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return new BN(value, 36).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return new BN(value, 16).toString(36);\n}\n//# sourceMappingURL=bigNumber.js.map","\"use strict\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify, isBytesLike } from \"../utils/data.js\";\nconst logger = new Logger(\"rlp/0.0.1\");\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return 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 _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 if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(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}\nexport function encode(object) {\n return hexlify(_encode(object));\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 if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: 1 + length, result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\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 if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: 1 + length, result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=rlp.js.map","function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nfunction bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new Error('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexport { number, bool, bytes, hash, exists, output };\nconst assert = { number, bool, bytes, hash, exists, output };\nexport default assert;\n//# sourceMappingURL=_assert.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\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}\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// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\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/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!u8a(data))\n throw new Error(`expected Uint8Array, got ${typeof data}`);\n return data;\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}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nconst toStr = {}.toString;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.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","import { hash as assertHash, number as assertNumber } from './_assert.js';\nimport { hmac } from './hmac.js';\nimport { createView, toBytes, checkOpts, asyncLoop } from './utils.js';\n// Common prologue and epilogue for sync/async functions\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n assertHash(hash);\n const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);\n const { c, dkLen, asyncTick } = opts;\n assertNumber(c);\n assertNumber(dkLen);\n assertNumber(asyncTick);\n if (c < 1)\n throw new Error('PBKDF2: iterations (c) should be >= 1');\n const password = toBytes(_password);\n const salt = toBytes(_salt);\n // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n const DK = new Uint8Array(dkLen);\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n const PRF = hmac.create(hash, password);\n const PRFSalt = PRF._cloneInto().update(salt);\n return { c, dkLen, asyncTick, DK, PRF, PRFSalt };\n}\nfunction pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {\n PRF.destroy();\n PRFSalt.destroy();\n if (prfW)\n prfW.destroy();\n u.fill(0);\n return DK;\n}\n/**\n * PBKDF2-HMAC: RFC 2898 key derivation function\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated\n * @param salt - cryptographic salt\n * @param opts - {c, dkLen} where c is work factor and dkLen is output message size\n */\nexport function pbkdf2(hash, password, salt, opts) {\n const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = createView(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n for (let ui = 1; ui < c; ui++) {\n // Uc = PRF(Password, Uc−1)\n PRF._cloneInto(prfW).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n }\n }\n return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\nexport async function pbkdf2Async(hash, password, salt, opts) {\n const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = createView(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n await asyncLoop(c - 1, asyncTick, () => {\n // Uc = PRF(Password, Uc−1)\n PRF._cloneInto(prfW).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n });\n }\n return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\n//# sourceMappingURL=pbkdf2.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","const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","import { SHA2 } from './_sha2.js';\nimport u64 from './_u64.js';\nimport { wrapConstructor } from './utils.js';\n// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409):\n// prettier-ignore\nconst [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\n// Temporary buffer, not used to store anything between runs\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nexport class SHA512 extends SHA2 {\n constructor() {\n super(128, 64, 16, false);\n // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers.\n // Also looks cleaner and easier to verify with spec.\n // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x6a09e667 | 0;\n this.Al = 0xf3bcc908 | 0;\n this.Bh = 0xbb67ae85 | 0;\n this.Bl = 0x84caa73b | 0;\n this.Ch = 0x3c6ef372 | 0;\n this.Cl = 0xfe94f82b | 0;\n this.Dh = 0xa54ff53a | 0;\n this.Dl = 0x5f1d36f1 | 0;\n this.Eh = 0x510e527f | 0;\n this.El = 0xade682d1 | 0;\n this.Fh = 0x9b05688c | 0;\n this.Fl = 0x2b3e6c1f | 0;\n this.Gh = 0x1f83d9ab | 0;\n this.Gl = 0xfb41bd6b | 0;\n this.Hh = 0x5be0cd19 | 0;\n this.Hl = 0x137e2179 | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n SHA512_W_H.fill(0);\n SHA512_W_L.fill(0);\n }\n destroy() {\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\nclass SHA512_224 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x8c3d37c8 | 0;\n this.Al = 0x19544da2 | 0;\n this.Bh = 0x73e19966 | 0;\n this.Bl = 0x89dcd4d6 | 0;\n this.Ch = 0x1dfab7ae | 0;\n this.Cl = 0x32ff9c82 | 0;\n this.Dh = 0x679dd514 | 0;\n this.Dl = 0x582f9fcf | 0;\n this.Eh = 0x0f6d2b69 | 0;\n this.El = 0x7bd44da8 | 0;\n this.Fh = 0x77e36f73 | 0;\n this.Fl = 0x04c48942 | 0;\n this.Gh = 0x3f9d85a8 | 0;\n this.Gl = 0x6a1d36c8 | 0;\n this.Hh = 0x1112e6ad | 0;\n this.Hl = 0x91d692a1 | 0;\n this.outputLen = 28;\n }\n}\nclass SHA512_256 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x22312194 | 0;\n this.Al = 0xfc2bf72c | 0;\n this.Bh = 0x9f555fa3 | 0;\n this.Bl = 0xc84c64c2 | 0;\n this.Ch = 0x2393b86b | 0;\n this.Cl = 0x6f53b151 | 0;\n this.Dh = 0x96387719 | 0;\n this.Dl = 0x5940eabd | 0;\n this.Eh = 0x96283ee2 | 0;\n this.El = 0xa88effe3 | 0;\n this.Fh = 0xbe5e1e25 | 0;\n this.Fl = 0x53863992 | 0;\n this.Gh = 0x2b0199fc | 0;\n this.Gl = 0x2c85b8aa | 0;\n this.Hh = 0x0eb72ddc | 0;\n this.Hl = 0x81c52ca2 | 0;\n this.outputLen = 32;\n }\n}\nclass SHA384 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0xcbbb9d5d | 0;\n this.Al = 0xc1059ed8 | 0;\n this.Bh = 0x629a292a | 0;\n this.Bl = 0x367cd507 | 0;\n this.Ch = 0x9159015a | 0;\n this.Cl = 0x3070dd17 | 0;\n this.Dh = 0x152fecd8 | 0;\n this.Dl = 0xf70e5939 | 0;\n this.Eh = 0x67332667 | 0;\n this.El = 0xffc00b31 | 0;\n this.Fh = 0x8eb44a87 | 0;\n this.Fl = 0x68581511 | 0;\n this.Gh = 0xdb0c2e0d | 0;\n this.Gl = 0x64f98fa7 | 0;\n this.Hh = 0x47b5481d | 0;\n this.Hl = 0xbefa4fa4 | 0;\n this.outputLen = 48;\n }\n}\nexport const sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA512());\nexport const sha512_224 = /* @__PURE__ */ wrapConstructor(() => new SHA512_224());\nexport const sha512_256 = /* @__PURE__ */ wrapConstructor(() => new SHA512_256());\nexport const sha384 = /* @__PURE__ */ wrapConstructor(() => new SHA384());\n//# sourceMappingURL=sha512.js.map","import { bytes, exists, number, output } from './_assert.js';\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js';\nimport { Hash, u32, toBytes, wrapConstructor, wrapXOFConstructorWithOpts, } from './utils.js';\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n number(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n keccak() {\n keccakP(this.state32, this.rounds);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n exists(this);\n const { blockLen, state } = 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 for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n exists(this, false);\n bytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n number(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n output(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\nexport const sha3_224 = /* @__PURE__ */ gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8);\nexport const sha3_384 = /* @__PURE__ */ gen(0x06, 104, 384 / 8);\nexport const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8);\nexport const keccak_224 = /* @__PURE__ */ gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8);\nexport const keccak_384 = /* @__PURE__ */ gen(0x01, 104, 384 / 8);\nexport const keccak_512 = /* @__PURE__ */ gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexport const shake128 = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8);\nexport const shake256 = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert(value >> width === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\",\n fault: \"overflow\",\n value: _value,\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -((~value & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = BN_1 << (width - BN_1);\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n const mask = (BN_1 << width) - BN_1;\n return (~value & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof value) {\n case \"bigint\":\n return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\",\n operation: \"getUint\",\n value,\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof value) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value,\n });\n // Pad the value to the required width\n while (result.length < width * 2) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n return new Uint8Array([]);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map","/**\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 let value = toBigInt(getBytes(_value));\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\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","// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map","/**\n * Explain events...\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map","/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import { assert } from \"./errors.js\";\n// @TODO: timeout is completely ignored; start a Promise.any with a reject?\n// @ts-ignore\nexport async function getUrl(req, _signal) {\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 let signal = undefined;\n if (_signal) {\n const controller = new AbortController();\n signal = controller.signal;\n _signal.addListener(() => {\n controller.abort();\n });\n }\n const init = {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal,\n };\n try {\n const resp = await fetch(req.url, init);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = respBody == null ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers,\n body,\n };\n }\n catch (error) {\n console.log({ error });\n return undefined;\n }\n}\n//# sourceMappingURL=geturl-browser.js.map","/**\n * Explain fetching here...\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 { getUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet getUrlFunc = getUrl;\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(() => {\n listener();\n }, 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() {\n return this.#cancelled;\n }\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 /**\n * The fetch URI to requrest.\n */\n get url() {\n return this.#url;\n }\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``) and the .\n *\n * If %%body%% is a string, the intrincis ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrincis ``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 chnages 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 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]],\n 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 complere response.\n * //(default: 5 minutes)//\n */\n get timeout() {\n return this.#timeout;\n }\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 * 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 }\n toString() {\n return ``;\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\",\n reason: \"timeout\",\n 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\n .makeServerError(\"error in post-processing function\", error)\n .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 getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req\n .redirect(location)\n .#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 ||\n (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof retryAfter === \"string\" &&\n retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req\n .clone()\n .#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\n .makeServerError(\"error in post-processing function\", error)\n .assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req\n .clone()\n .#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 locataions\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" &&\n (current !== \"https\" || target !== \"http\") &&\n 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 = \"GET\";\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 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 getUrlFunc = getUrl;\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 * 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 ``;\n }\n /**\n * The response status code.\n */\n get statusCode() {\n return this.#statusCode;\n }\n /**\n * The response status message.\n */\n get statusMessage() {\n return this.#statusMessage;\n }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() {\n return Object.assign({}, this.#headers);\n }\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\",\n 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\",\n 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]],\n 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 of 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() {\n return this.#request;\n }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" &&\n this.statusCode >= 200 &&\n 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 assert(false, message, \"SERVER_ERROR\", {\n request: this.request || \"unknown request\",\n response: this,\n error,\n });\n }\n}\nfunction getTime() {\n return new Date().getTime();\n}\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","var _a;\n/**\n * About fixed-point math...\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = BN_1 << (width - BN_1);\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = BN_1 << width;\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n val = ((val % limit) + limit) % limit & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof value === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof value === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = match[1] !== \"u\";\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof v[key] === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument(width % 8 === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return negative + str;\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return negative + str;\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, an value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() {\n return this.#format.signed;\n }\n /**\n * The number of bits available to store the value.\n */\n get width() {\n return this.#format.width;\n }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() {\n return this.#format.decimals;\n }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() {\n return this.#val;\n }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n \n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n \n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n */\n val = checkValue(val, this.#format, safeOp);\n return new _a(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) {\n return this.#add(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) {\n return this.#add(other, \"add\");\n }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) {\n return this.#sub(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) {\n return this.#sub(other, \"sub\");\n }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) {\n return this.#mul(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) {\n return this.#mul(other, \"mul\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert(value % this.#tens === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) {\n return this.#div(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) {\n return this.#div(other, \"div\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(other);\n const value = this.#val * this.#tens;\n assert(value % other.#val === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%other%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return -1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) {\n return this.cmp(other) === 0;\n }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) {\n return this.cmp(other) < 0;\n }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) {\n return this.cmp(other) <= 0;\n }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) {\n return this.cmp(other) > 0;\n }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) {\n return this.cmp(other) >= 0;\n }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new _a(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() {\n return this.#val === BN_0;\n }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() {\n return this.#val < BN_0;\n }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() {\n return this._value;\n }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() {\n return parseFloat(this.toString());\n }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return _a.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, decimals, _format) {\n if (decimals == null) {\n decimals = 0;\n }\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert(value % tens === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\",\n fault: \"underflow\",\n value: _value,\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && match[2].length + match[3].length > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = match[2] || \"0\", decimal = match[3] || \"\";\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\",\n fault: \"underflow\",\n value: _value,\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new _a(_guard, value, format);\n }\n}\n_a = FixedNumber;\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","import { 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,\n length,\n 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,\n length: 0,\n offset: 1,\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data,\n length: data.length,\n 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","import { 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","/**\n * Most interactions with Core requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Core, //Core// is divisible to 18 decimal places,\n * where each individual unit is called a //ore//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n ///Ore, the smallest and atomic amount of Core\n \"ore\",\n ///fecore, 1000 ore\n \"fecore\",\n ///Picore, one million ore\n \"picore\",\n ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices.\n \"nacore\",\n ///Μcore, 10^12 ore or 1 μCore\n \"mcore\",\n ///micore, 10^15 ore or 1 mcore\n \"micore\",\n \"core\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit.\n */\nexport const scientificToDecimal = (num) => {\n // @ts-ignore\n var nsign = Math.sign(num);\n //remove the sign\n // @ts-ignore\n num = Math.abs(num);\n //if the number is in scientific notation remove it\n // @ts-ignore\n if (/\\d+\\.?\\d*e[\\+\\-]*\\d+/i.test(num)) {\n var zero = \"0\", \n // @ts-ignore\n parts = String(num).toLowerCase().split(\"e\"), //split into coeff and exponent\n e = parts.pop(), //store the exponential part\n // @ts-ignore\n l = Math.abs(e), //get the number of zeros\n // @ts-ignore\n sign = e / l, coeff_array = parts[0].split(\".\");\n if (sign === -1) {\n l = l - coeff_array[0].length;\n if (l < 0) {\n // @ts-ignore\n num =\n coeff_array[0].slice(0, l) +\n \".\" +\n coeff_array[0].slice(l) +\n (coeff_array.length === 2 ? coeff_array[1] : \"\");\n }\n else {\n // @ts-ignore\n num = zero + \".\" + new Array(l + 1).join(zero) + coeff_array.join(\"\");\n }\n }\n else {\n var dec = coeff_array[1];\n if (dec)\n l = l - dec.length;\n if (l < 0) {\n // @ts-ignore\n num = coeff_array[0] + dec.slice(0, l) + \".\" + dec.slice(l);\n }\n else {\n // @ts-ignore\n num = coeff_array.join(\"\") + new Array(l + 1).join(zero);\n }\n }\n }\n // @ts-ignore\n return nsign < 0 ? \"-\" + num : num;\n};\nexport const trimDecimals = (n, decimals = 18) => {\n n += \"\";\n if (n.indexOf(\".\") === -1)\n return n;\n const arr = n.split(\".\");\n const fraction = arr[1].substr(0, decimals);\n return arr[0] + \".\" + fraction;\n};\nexport function parseUnits(value, unit) {\n assertArgument(typeof value === \"string\", \"value must be a string\", \"value\", value);\n if (value.includes(\"e\")) {\n value = scientificToDecimal(value).toString();\n }\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n value = trimDecimals(value, decimals);\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n value = trimDecimals(value, decimals);\n }\n return FixedNumber.fromString(value, { decimals }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatXCB(ore) {\n return formatUnits(ore, 18);\n}\n/**\n * Converts the //decimal string// %%xcb%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseXCB(xcb) {\n return parseUnits(xcb, 18);\n}\n//# sourceMappingURL=units.js.map","/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map","// @ts-ignore\nimport ed448 from \"./browser-ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"./pbkdf2-browser.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(msgHash, signedMsg, pubKey);\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock-browser.js.map","/* Browser Crypto Shims */\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = function (data) {\n let v = \"0x\" +\n createHash(\"sha3-256\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n return v;\n};\nconst _sha512 = function (data) {\n let v = \"0x\" +\n createHash(\"sha3-512\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n return v;\n};\n// @ts-ignore\nlet __sha256 = _sha256;\n// @ts-ignore\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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n let createdHash = \"0x\" +\n createHash(\"ripemd160\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n const v = \"0x\" + createdHash;\n if (typeof createdHash !== \"string\") {\n createdHash = hexlify(createdHash);\n return createdHash;\n }\n return v;\n}\nexport function sha256(data) {\n let createdHash = createHash(\"sha3-256\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n const v = \"0x\" + createdHash;\n if (typeof createdHash !== \"string\") {\n createdHash = hexlify(createdHash);\n return createdHash;\n }\n return v;\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return \"0x\" + createHmac(\"sha3-256\", k).update(d).digest(\"hex\");\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return \"0x\" + createHmac(\"sha3-512\", k).update(d).digest(\"hex\");\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 let createdHash = createHash(\"sha3-512\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n const v = \"0x\" + createdHash;\n if (typeof createdHash !== \"string\") {\n createdHash = hexlify(createdHash);\n return createdHash;\n }\n return v;\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha256);\n//# sourceMappingURL=sha3.js.map","/**\n * Addresses are a fundamental part of interacting with Core. They\n * represent the gloabal identity of Externally Owned Accounts (accounts\n * backed by a private key) and contracts.\n *\n * The Core Naming Service (CNS) provides an interconnected ecosystem\n * of contracts, standards and libraries which enable looking up an\n * address for an ENS name.\n *\n * These functions help convert between various formats, validate\n * addresses and safely resolve ENS names.\n *\n * @_section: api/address:Addresses [about-addresses]\n */\nnull;\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { encode } from \"../crypto/rlp.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexDataSlice, hexlify, stripZeros, } from \"../utils/data.js\";\nconst logger = new Logger(\"address/0.0.1\");\nconst precompiledAddresses = [\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n \"0000000000000000000000000000000000000000000000000000000000000001\",\n \"0000000000000000000000000000000000000000000000000000000000000002\",\n \"0000000000000000000000000000000000000000000000000000000000000003\",\n \"0000000000000000000000000000000000000000000000000000000000000004\",\n \"0000000000000000000000000000000000000000000000000000000000000005\",\n \"0000000000000000000000000000000000000000000000000000000000000006\",\n \"0000000000000000000000000000000000000000000000000000000000000007\",\n \"0000000000000000000000000000000000000000000000000000000000000008\",\n \"0000000000000000000000000000000000000000000000000000000000000009\",\n];\nfunction removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nfunction calculateCheckSum(_address, _prefix) {\n const address = getBytes(\"0x\" + _address.replace(\"0x\", \"\"));\n const prefix = getBytes(\"0x\" + _prefix.replace(\"0x\", \"\"));\n const tmpConcated = new Uint8Array([...address, ...prefix]);\n const hexedConcat = hexlify(tmpConcated).replace(\"0x\", \"\") + \"00\";\n const mods = Array.from(hexedConcat.toUpperCase(), (c) => {\n const charCode = c.charCodeAt(0);\n return charCode > 64 && charCode < 91\n ? (charCode - 55).toString()\n : (charCode - 48).toString();\n }).join(\"\");\n const bigVal = BigInt(mods);\n const val97 = BigInt(97);\n const val98 = BigInt(98);\n const remainder = bigVal % val97;\n const checkSum = val98 - remainder;\n const result = checkSum > 9 ? checkSum.toString() : \"0\" + checkSum.toString();\n return result;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address\n .split(\"\")\n .map((c) => {\n return ibanLookup[c];\n })\n .join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Core uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nfunction getAddress(address) {\n if (typeof address !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n const raw = removeHexPrefix(address);\n if (precompiledAddresses.includes(raw)) {\n return \"0x\" + raw;\n }\n const prefix = raw.substring(0, 2);\n const val = raw.substring(4);\n const checksum = calculateCheckSum(val, prefix);\n if (checksum !== raw.substring(2, 4)) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n return \"0x\" + prefix + checksum + val;\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nfunction getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\nfunction networkIdToPrefix(networkId) {\n if (networkId == 1) {\n return \"cb\";\n }\n else if (networkId == 3 || networkId == 4) {\n return \"ab\";\n }\n else if (networkId > 10 || networkId == 0) {\n return \"ce\";\n }\n else {\n logger.throwArgumentError(\"bad networkId\", \"networkId\", networkId);\n return \"\";\n }\n}\nfunction getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n const val = hexDataSlice(sha256(encode([from, nonce])), 12);\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, };\n//# sourceMappingURL=index.js.map","/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () {\n locked = true;\n};\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map","import { SHA2 } from './_sha2.js';\nimport { wrapConstructor } from './utils.js';\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf\nconst Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]);\nconst Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i);\nconst Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16);\nlet idxL = [Id];\nlet idxR = [Pi];\nfor (let i = 0; i < 4; i++)\n for (let j of [idxL, idxR])\n j.push(j[i].map((k) => Rho[k]));\nconst shifts = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => new Uint8Array(i));\nconst shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst Kl = /* @__PURE__ */ new Uint32Array([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\nconst Kr = /* @__PURE__ */ new Uint32Array([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | (word >>> (32 - shift));\n// It's called f() in spec.\nfunction f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n else if (group === 1)\n return (x & y) | (~x & z);\n else if (group === 2)\n return (x | ~y) ^ z;\n else if (group === 3)\n return (x & z) | (y & ~z);\n else\n return x ^ (y | ~z);\n}\n// Temporary buffer, not used to store anything between runs\nconst BUF = /* @__PURE__ */ new Uint32Array(16);\nexport class RIPEMD160 extends SHA2 {\n constructor() {\n super(64, 20, 8, true);\n this.h0 = 0x67452301 | 0;\n this.h1 = 0xefcdab89 | 0;\n this.h2 = 0x98badcfe | 0;\n this.h3 = 0x10325476 | 0;\n this.h4 = 0xc3d2e1f0 | 0;\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n BUF.fill(0);\n }\n destroy() {\n this.destroyed = true;\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a hash function from 1990s.\n * @param message - msg that would be hashed\n */\nexport const ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());\n//# sourceMappingURL=ripemd160.js.map","import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/ripemd160\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () {\n locked = true;\n};\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map","/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () {\n locked = true;\n};\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map","/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () {\n locked = true;\n};\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map","import { number as assertNumber } from './_assert.js';\nimport { sha256 } from './sha256.js';\nimport { pbkdf2 } from './pbkdf2.js';\nimport { asyncLoop, checkOpts, u32 } from './utils.js';\n// RFC 7914 Scrypt KDF\n// Left rotate for uint32\nconst rotl = (a, b) => (a << b) | (a >>> (32 - b));\n// The main Scrypt loop: uses Salsa extensively.\n// Six versions of the function were tried, this is the fastest one.\n// prettier-ignore\nfunction XorAndSalsa(prev, pi, input, ii, out, oi) {\n // Based on https://cr.yp.to/salsa20.html\n // Xor blocks\n let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];\n let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];\n let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];\n let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];\n let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];\n let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];\n let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];\n let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];\n // Save state to temporary variables (salsa)\n let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n // Main loop (salsa)\n for (let i = 0; i < 8; i += 2) {\n x04 ^= rotl(x00 + x12 | 0, 7);\n x08 ^= rotl(x04 + x00 | 0, 9);\n x12 ^= rotl(x08 + x04 | 0, 13);\n x00 ^= rotl(x12 + x08 | 0, 18);\n x09 ^= rotl(x05 + x01 | 0, 7);\n x13 ^= rotl(x09 + x05 | 0, 9);\n x01 ^= rotl(x13 + x09 | 0, 13);\n x05 ^= rotl(x01 + x13 | 0, 18);\n x14 ^= rotl(x10 + x06 | 0, 7);\n x02 ^= rotl(x14 + x10 | 0, 9);\n x06 ^= rotl(x02 + x14 | 0, 13);\n x10 ^= rotl(x06 + x02 | 0, 18);\n x03 ^= rotl(x15 + x11 | 0, 7);\n x07 ^= rotl(x03 + x15 | 0, 9);\n x11 ^= rotl(x07 + x03 | 0, 13);\n x15 ^= rotl(x11 + x07 | 0, 18);\n x01 ^= rotl(x00 + x03 | 0, 7);\n x02 ^= rotl(x01 + x00 | 0, 9);\n x03 ^= rotl(x02 + x01 | 0, 13);\n x00 ^= rotl(x03 + x02 | 0, 18);\n x06 ^= rotl(x05 + x04 | 0, 7);\n x07 ^= rotl(x06 + x05 | 0, 9);\n x04 ^= rotl(x07 + x06 | 0, 13);\n x05 ^= rotl(x04 + x07 | 0, 18);\n x11 ^= rotl(x10 + x09 | 0, 7);\n x08 ^= rotl(x11 + x10 | 0, 9);\n x09 ^= rotl(x08 + x11 | 0, 13);\n x10 ^= rotl(x09 + x08 | 0, 18);\n x12 ^= rotl(x15 + x14 | 0, 7);\n x13 ^= rotl(x12 + x15 | 0, 9);\n x14 ^= rotl(x13 + x12 | 0, 13);\n x15 ^= rotl(x14 + x13 | 0, 18);\n }\n // Write output (salsa)\n out[oi++] = (y00 + x00) | 0;\n out[oi++] = (y01 + x01) | 0;\n out[oi++] = (y02 + x02) | 0;\n out[oi++] = (y03 + x03) | 0;\n out[oi++] = (y04 + x04) | 0;\n out[oi++] = (y05 + x05) | 0;\n out[oi++] = (y06 + x06) | 0;\n out[oi++] = (y07 + x07) | 0;\n out[oi++] = (y08 + x08) | 0;\n out[oi++] = (y09 + x09) | 0;\n out[oi++] = (y10 + x10) | 0;\n out[oi++] = (y11 + x11) | 0;\n out[oi++] = (y12 + x12) | 0;\n out[oi++] = (y13 + x13) | 0;\n out[oi++] = (y14 + x14) | 0;\n out[oi++] = (y15 + x15) | 0;\n}\nfunction BlockMix(input, ii, out, oi, r) {\n // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks)\n let head = oi + 0;\n let tail = oi + 16 * r;\n for (let i = 0; i < 16; i++)\n out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]\n for (let i = 0; i < r; i++, head += 16, ii += 16) {\n // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1\n XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])\n if (i > 0)\n tail += 16; // First iteration overwrites tmp value in tail\n XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i])\n }\n}\n// Common prologue and epilogue for sync/async functions\nfunction scryptInit(password, salt, _opts) {\n // Maxmem - 1GB+1KB by default\n const opts = checkOpts({\n dkLen: 32,\n asyncTick: 10,\n maxmem: 1024 ** 3 + 1024,\n }, _opts);\n const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;\n assertNumber(N);\n assertNumber(r);\n assertNumber(p);\n assertNumber(dkLen);\n assertNumber(asyncTick);\n assertNumber(maxmem);\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('progressCb should be function');\n const blockSize = 128 * r;\n const blockSize32 = blockSize / 4;\n if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) {\n // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function\n // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future.\n throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32');\n }\n if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) {\n throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)');\n }\n if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) {\n throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32');\n }\n const memUsed = blockSize * (N + p);\n if (memUsed > maxmem) {\n throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`);\n }\n // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)\n // Since it has only one iteration there is no reason to use async variant\n const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });\n const B32 = u32(B);\n // Re-used between parallel iterations. Array(iterations) of B\n const V = u32(new Uint8Array(blockSize * N));\n const tmp = u32(new Uint8Array(blockSize));\n let blockMixCb = () => { };\n if (onProgress) {\n const totalBlockMix = 2 * N * p;\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);\n let blockMixCnt = 0;\n blockMixCb = () => {\n blockMixCnt++;\n if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix))\n onProgress(blockMixCnt / totalBlockMix);\n };\n }\n return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };\n}\nfunction scryptOutput(password, dkLen, B, V, tmp) {\n const res = pbkdf2(sha256, password, B, { c: 1, dkLen });\n B.fill(0);\n V.fill(0);\n tmp.fill(0);\n return res;\n}\n/**\n * Scrypt KDF from RFC 7914.\n * @param password - pass\n * @param salt - salt\n * @param opts - parameters\n * - `N` is cpu/mem work factor (power of 2 e.g. 2**18)\n * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance\n * - `p` is parallelization factor (1 is common)\n * - `dkLen` is output key length in bytes e.g. 32.\n * - `asyncTick` - (default: 10) max time in ms for which async function can block execution\n * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt\n * - `onProgress` - callback function that would be executed for progress report\n * @returns Derived key\n */\nexport function scrypt(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n for (let i = 0, pos = 0; i < N - 1; i++) {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n for (let i = 0; i < N; i++) {\n // First u32 of the last 64-byte block (u32 is LE)\n const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }\n }\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n/**\n * Scrypt KDF from RFC 7914.\n */\nexport async function scryptAsync(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n let pos = 0;\n await asyncLoop(N - 1, asyncTick, () => {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n });\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n await asyncLoop(N, asyncTick, () => {\n // First u32 of the last 64-byte block (u32 is LE)\n const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n });\n }\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n//# sourceMappingURL=scrypt.js.map","import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from \"@noble/hashes/scrypt\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () {\n lockedAsync = true;\n};\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () {\n lockedSync = true;\n};\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */\nconst B256 = 2n ** 256n; // secp256k1 is short weierstrass curve\nconst P = B256 - 0x1000003d1n; // curve's field prime\nconst N = B256 - 0x14551231950b75fc4402da1732fc9bebfn; // curve (group) order\nconst Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n; // base point x\nconst Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n; // base point y\nconst CURVE = { p: P, n: N, a: 0n, b: 7n, Gx, Gy }; // exported variables incl. a, b\nconst fLen = 32; // field / group byte length\nconst crv = (x) => mod(mod(x * x) * x + CURVE.b); // x³ + ax + b weierstrass formula; no a\nconst err = (m = '') => { throw new Error(m); }; // error helper, messes-up stack trace\nconst big = (n) => typeof n === 'bigint'; // is big integer\nconst str = (s) => typeof s === 'string'; // is string\nconst fe = (n) => big(n) && 0n < n && n < P; // is field element (invertible)\nconst ge = (n) => big(n) && 0n < n && n < N; // is group element\nconst au8 = (a, l) => // is Uint8Array (of specific length)\n !(a instanceof Uint8Array) || (typeof l === 'number' && l > 0 && a.length !== l) ?\n err('Uint8Array expected') : a;\nconst u8n = (data) => new Uint8Array(data); // creates Uint8Array\nconst toU8 = (a, len) => au8(str(a) ? h2b(a) : u8n(a), len); // norm(hex/u8a) to u8a\nconst mod = (a, b = P) => { let r = a % b; return r >= 0n ? r : b + r; }; // mod division\nconst isPoint = (p) => (p instanceof Point ? p : err('Point expected')); // is 3d point\nlet Gpows = undefined; // precomputes for base point G\nclass Point {\n constructor(px, py, pz) {\n this.px = px;\n this.py = py;\n this.pz = pz;\n } //3d=less inversions\n static fromAffine(p) { return new Point(p.x, p.y, 1n); }\n static fromHex(hex) {\n hex = toU8(hex); // convert hex string to Uint8Array\n let p = undefined;\n const head = hex[0], tail = hex.subarray(1); // first byte is prefix, rest is data\n const x = slcNum(tail, 0, fLen), len = hex.length; // next 32 bytes are x coordinate\n if (len === 33 && [0x02, 0x03].includes(head)) { // compressed points: 33b, start\n if (!fe(x))\n err('Point hex invalid: x not FE'); // with byte 0x02 or 0x03. Check if 0 0n; d = d.double(), n >>= 1n) { // double-and-add ladder\n if (n & 1n)\n p = p.add(d); // if bit is present, add to point\n else if (safe)\n f = f.add(d); // if not, add to fake for timing safety\n }\n return p;\n }\n mulAddQUns(R, u1, u2) {\n return this.mul(u1, false).add(R.mul(u2, false)).ok(); // Unsafe: do NOT use for stuff related\n } // to private keys. Doesn't use Shamir trick\n toAffine() {\n const { px: x, py: y, pz: z } = this; // (x, y, z) ∋ (x=x/z, y=y/z)\n if (this.equals(I))\n return { x: 0n, y: 0n }; // fast-path for zero point\n if (z === 1n)\n return { x, y }; // if z is 1, pass affine coordinates as-is\n const iz = inv(z); // z^-1: invert z\n if (mod(z * iz) !== 1n)\n err('invalid inverse'); // (z * z^-1) must be 1, otherwise bad math\n return { x: mod(x * iz), y: mod(y * iz) }; // x = x*z^-1; y = y*z^-1\n }\n assertValidity() {\n const { x, y } = this.aff(); // convert to 2d xy affine point.\n if (!fe(x) || !fe(y))\n err('Point invalid: x or y'); // x and y must be in range 0 < n < P\n return mod(y * y) === crv(x) ? // y² = x³ + ax + b, must be equal\n this : err('Point invalid: not on curve');\n }\n multiply(n) { return this.mul(n); } // Aliases to compress code\n aff() { return this.toAffine(); }\n ok() { return this.assertValidity(); }\n toHex(isCompressed = true) {\n const { x, y } = this.aff(); // convert to 2d xy affine point\n const head = isCompressed ? ((y & 1n) === 0n ? '02' : '03') : '04'; // 0x02, 0x03, 0x04 prefix\n return head + n2h(x) + (isCompressed ? '' : n2h(y)); // prefix||x and ||y\n }\n toRawBytes(isCompressed = true) {\n return h2b(this.toHex(isCompressed)); // re-use toHex(), convert hex to bytes\n }\n}\nPoint.BASE = new Point(Gx, Gy, 1n); // Generator / base point\nPoint.ZERO = new Point(0n, 1n, 0n); // Identity / zero point\nconst { BASE: G, ZERO: I } = Point; // Generator, identity points\nconst padh = (n, pad) => n.toString(16).padStart(pad, '0');\nconst b2h = (b) => Array.from(b).map(e => padh(e, 2)).join(''); // bytes to hex\nconst h2b = (hex) => {\n const l = hex.length; // error if not string,\n if (!str(hex) || l % 2)\n err('hex invalid 1'); // or has odd length like 3, 5.\n const arr = u8n(l / 2); // create result array\n for (let i = 0; i < arr.length; i++) {\n const j = i * 2;\n const h = hex.slice(j, j + 2); // hexByte. slice is faster than substr\n const b = Number.parseInt(h, 16); // byte, created from string part\n if (Number.isNaN(b) || b < 0)\n err('hex invalid 2'); // byte must be valid 0 <= byte < 256\n arr[i] = b;\n }\n return arr;\n};\nconst b2n = (b) => BigInt('0x' + (b2h(b) || '0')); // bytes to number\nconst slcNum = (b, from, to) => b2n(b.slice(from, to)); // slice bytes num\nconst n2b = (num) => {\n return big(num) && num >= 0n && num < B256 ? h2b(padh(num, 2 * fLen)) : err('bigint expected');\n};\nconst n2h = (num) => b2h(n2b(num)); // number to 32b hex\nconst concatB = (...arrs) => {\n const r = u8n(arrs.reduce((sum, a) => sum + au8(a).length, 0)); // create u8a of summed length\n let pad = 0; // walk through each array,\n arrs.forEach(a => { r.set(a, pad); pad += a.length; }); // ensure they have proper type\n return r;\n};\nconst inv = (num, md = P) => {\n if (num === 0n || md <= 0n)\n err('no inverse n=' + num + ' mod=' + md); // no neg exponent for now\n let a = mod(num, md), b = md, x = 0n, y = 1n, u = 1n, v = 0n;\n while (a !== 0n) { // uses euclidean gcd algorithm\n const q = b / a, r = b % a; // not constant-time\n const m = x - u * q, n = y - v * q;\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n return b === 1n ? mod(x, md) : err('no inverse'); // b is gcd at this point\n};\nconst sqrt = (n) => {\n let r = 1n; // So, a special, fast case. Paper: \"Square Roots from 1;24,51,10 to Dan Shanks\".\n for (let num = n, e = (P + 1n) / 4n; e > 0n; e >>= 1n) { // powMod: modular exponentiation.\n if (e & 1n)\n r = (r * num) % P; // Uses exponentiation by squaring.\n num = (num * num) % P; // Not constant-time.\n }\n return mod(r * r) === n ? r : err('sqrt invalid'); // check if result is valid\n};\nconst toPriv = (p) => {\n if (!big(p))\n p = b2n(toU8(p, fLen)); // convert to bigint when bytes\n return ge(p) ? p : err('private key out of range'); // check if bigint is in range\n};\nconst moreThanHalfN = (n) => n > (N >> 1n); // if a number is bigger than CURVE.n/2\nfunction getPublicKey(privKey, isCompressed = true) {\n return Point.fromPrivateKey(privKey).toRawBytes(isCompressed); // 33b or 65b output\n}\nclass Signature {\n constructor(r, s, recovery) {\n this.r = r;\n this.s = s;\n this.recovery = recovery;\n this.assertValidity(); // recovery bit is optional when\n } // constructed outside.\n static fromCompact(hex) {\n hex = toU8(hex, 64); // compact repr is (32b r)||(32b s)\n return new Signature(slcNum(hex, 0, fLen), slcNum(hex, fLen, 2 * fLen));\n }\n assertValidity() { return ge(this.r) && ge(this.s) ? this : err(); } // 0 < r or s < CURVE.n\n addRecoveryBit(rec) { return new Signature(this.r, this.s, rec); }\n hasHighS() { return moreThanHalfN(this.s); }\n recoverPublicKey(msgh) {\n const { r, s, recovery: rec } = this; // secg.org/sec1-v2.pdf 4.1.6\n if (![0, 1, 2, 3].includes(rec))\n err('recovery id invalid'); // check recovery id\n const h = bits2int_modN(toU8(msgh, 32)); // Truncate hash\n const radj = rec === 2 || rec === 3 ? r + N : r; // If rec was 2 or 3, q.x is bigger than n\n if (radj >= P)\n err('q.x invalid'); // ensure q.x is still a field element\n const head = (rec & 1) === 0 ? '02' : '03'; // head is 0x02 or 0x03\n const R = Point.fromHex(head + n2h(radj)); // concat head + hex repr of r\n const ir = inv(radj, N); // r^-1\n const u1 = mod(-h * ir, N); // -hr^-1\n const u2 = mod(s * ir, N); // sr^-1\n return G.mulAddQUns(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n }\n toCompactRawBytes() { return h2b(this.toCompactHex()); } // Uint8Array 64b compact repr\n toCompactHex() { return n2h(this.r) + n2h(this.s); } // hex 64b compact repr\n}\nconst bits2int = (bytes) => {\n const delta = bytes.length * 8 - 256; // RFC suggests optional truncating via bits2octets\n const num = b2n(bytes); // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which\n return delta > 0 ? num >> BigInt(delta) : num; // matches bits2int. bits2int can produce res>N.\n};\nconst bits2int_modN = (bytes) => {\n return mod(bits2int(bytes), N); // with 0: BAD for trunc as per RFC vectors\n};\nconst i2o = (num) => n2b(num); // int to octets\nconst cr = () => // We support: 1) browsers 2) node.js 19+ 3) deno, other envs with crypto\n typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\nlet _hmacSync; // Can be redefined by use in utils; built-ins don't provide it\nconst optS = { lowS: true }; // opts for sign()\nconst optV = { lowS: true }; // standard opts for verify()\nfunction prepSig(msgh, priv, opts = optS) {\n if (['der', 'recovered', 'canonical'].some(k => k in opts)) // Ban legacy options\n err('sign() legacy options not supported');\n let { lowS } = opts; // generates low-s sigs by default\n if (lowS == null)\n lowS = true; // RFC6979 3.2: we skip step A\n const h1i = bits2int_modN(toU8(msgh)); // msg bigint\n const h1o = i2o(h1i); // msg octets\n const d = toPriv(priv); // validate private key, convert to bigint\n const seed = [i2o(d), h1o]; // Step D of RFC6979 3.2\n let ent = opts.extraEntropy; // RFC6979 3.6: additional k' (optional)\n if (ent) { // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n if (ent === true)\n ent = etc.randomBytes(fLen); // if true, use CSPRNG to generate data\n const e = toU8(ent); // convert Hex|Bytes to Bytes\n if (e.length !== fLen)\n err(); // Expected 32 bytes of extra data\n seed.push(e);\n }\n const m = h1i; // convert msg to bigint\n const k2sig = (kBytes) => {\n const k = bits2int(kBytes); // RFC6979 method.\n if (!ge(k))\n return; // Check 0 < k < CURVE.n\n const ik = inv(k, N); // k^-1 mod n, NOT mod P\n const q = G.mul(k).aff(); // q = Gk\n const r = mod(q.x, N); // r = q.x mod n\n if (r === 0n)\n return; // r=0 invalid\n const s = mod(ik * mod(m + mod(d * r, N), N), N); // s = k^-1(m + rd) mod n\n if (s === 0n)\n return; // s=0 invalid\n let normS = s; // normalized S\n let rec = (q.x === r ? 0 : 2) | Number(q.y & 1n); // recovery bit\n if (lowS && moreThanHalfN(s)) { // if lowS was passed, ensure s is always\n normS = mod(-s, N); // in the bottom half of CURVE.n\n rec ^= 1;\n }\n return new Signature(r, normS, rec); // use normS, not s\n };\n return { seed: concatB(...seed), k2sig };\n}\nfunction hmacDrbg(asynchronous) {\n let v = u8n(fLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(fLen); // Steps B, 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 = () => { v.fill(1); k.fill(0); i = 0; };\n const _e = 'drbg: tried 1000 values';\n if (asynchronous) { // asynchronous=true\n const h = (...b) => etc.hmacSha256Async(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = async (seed = u8n()) => {\n k = await h(u8n([0x00]), seed); // k = hmac(K || V || 0x00 || seed)\n v = await h(); // v = hmac(K || V)\n if (seed.length === 0)\n return;\n k = await h(u8n([0x01]), seed); // k = hmac(K || V || 0x01 || seed)\n v = await h(); // v = hmac(K || V)\n };\n const gen = async () => {\n if (i++ >= 1000)\n err(_e);\n v = await h(); // v = hmac(K || V)\n return v;\n };\n return async (seed, pred) => {\n reset(); // the returned fn, don't, it's: 1. slower (JIT). 2. unsafe (async race conditions)\n await reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(await gen())))\n await reseed(); // test predicate until it returns ok\n reset();\n return res;\n };\n }\n else {\n const h = (...b) => {\n const f = _hmacSync;\n if (!f)\n err('etc.hmacSha256Sync not set');\n return f(k, v, ...b); // hmac(k)(v, ...values)\n };\n const reseed = (seed = u8n()) => {\n k = h(u8n([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(u8n([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n if (i++ >= 1000)\n err(_e);\n v = h(); // v = hmac(k || v)\n return v;\n };\n return (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(); // test predicate until it returns ok\n reset();\n return res;\n };\n }\n}\n// ECDSA signature generation. via secg.org/sec1-v2.pdf 4.1.2 + RFC6979 deterministic k\nasync function signAsync(msgh, priv, opts = optS) {\n const { seed, k2sig } = prepSig(msgh, priv, opts); // Extract arguments for hmac-drbg\n return hmacDrbg(true)(seed, k2sig); // Re-run hmac-drbg until k2sig returns ok\n}\nfunction sign(msgh, priv, opts = optS) {\n const { seed, k2sig } = prepSig(msgh, priv, opts); // Extract arguments for hmac-drbg\n return hmacDrbg(false)(seed, k2sig); // Re-run hmac-drbg until k2sig returns ok\n}\nfunction verify(sig, msgh, pub, opts = optV) {\n let { lowS } = opts; // ECDSA signature verification\n if (lowS == null)\n lowS = true; // Default lowS=true\n if ('strict' in opts)\n err('verify() legacy options not supported'); // legacy param\n let sig_, h, P; // secg.org/sec1-v2.pdf 4.1.4\n const rs = sig && typeof sig === 'object' && 'r' in sig; // Previous ver supported DER sigs. We\n if (!rs && (toU8(sig).length !== 2 * fLen)) // throw error when DER is suspected now.\n err('signature must be 64 bytes');\n try {\n sig_ = rs ? new Signature(sig.r, sig.s).assertValidity() : Signature.fromCompact(sig);\n h = bits2int_modN(toU8(msgh, fLen)); // Truncate hash\n P = pub instanceof Point ? pub.ok() : Point.fromHex(pub); // Validate public key\n }\n catch (e) {\n return false;\n } // Check sig for validity in both cases\n if (!sig_)\n return false;\n const { r, s } = sig_;\n if (lowS && moreThanHalfN(s))\n return false; // lowS bans sig.s >= CURVE.n/2\n let R;\n try {\n const is = inv(s, N); // s^-1\n const u1 = mod(h * is, N); // u1 = hs^-1 mod n\n const u2 = mod(r * is, N); // u2 = rs^-1 mod n\n R = G.mulAddQUns(P, u1, u2).aff(); // R = u1⋅G + u2⋅P\n }\n catch (error) {\n return false;\n }\n if (!R)\n return false; // stop if R is identity / zero point\n const v = mod(R.x, N); // <== The weird ECDSA part. R.x must be in N's field, not P's\n return v === r; // mod(R.x, n) == r\n}\nfunction getSharedSecret(privA, pubB, isCompressed = true) {\n return Point.fromHex(pubB).mul(toPriv(privA)).toRawBytes(isCompressed); // ECDH\n}\nfunction hashToPrivateKey(hash) {\n hash = toU8(hash); // produces private keys with modulo bias\n const minLen = fLen + 8; // being neglible.\n if (hash.length < minLen || hash.length > 1024)\n err('expected proper params');\n const num = mod(b2n(hash), N - 1n) + 1n; // takes at least n+8 bytes\n return n2b(num);\n}\nconst etc = {\n hexToBytes: h2b, bytesToHex: b2h,\n concatBytes: concatB, bytesToNumberBE: b2n, numberToBytesBE: n2b,\n mod, invert: inv,\n hmacSha256Async: async (key, ...msgs) => {\n const crypto = cr(); // HMAC-SHA256 async. No sync built-in!\n if (!crypto)\n return err('etc.hmacSha256Async not set'); // Uses webcrypto: native cryptography.\n const s = crypto.subtle;\n const k = await s.importKey('raw', key, { name: 'HMAC', hash: { name: 'SHA-256' } }, false, ['sign']);\n return u8n(await s.sign('HMAC', k, concatB(...msgs)));\n },\n hmacSha256Sync: _hmacSync,\n hashToPrivateKey,\n randomBytes: (len) => {\n const crypto = cr(); // Can be shimmed in node.js <= 18 to prevent error:\n // import { webcrypto } from 'node:crypto';\n // if (!globalThis.crypto) globalThis.crypto = webcrypto;\n if (!crypto)\n err('crypto.getRandomValues must be defined');\n return crypto.getRandomValues(u8n(len));\n },\n};\nconst utils = {\n normPrivateKeyToScalar: toPriv,\n isValidPrivateKey: (key) => { try {\n return !!toPriv(key);\n }\n catch (e) {\n return false;\n } },\n randomPrivateKey: () => hashToPrivateKey(etc.randomBytes(fLen + 8)),\n precompute(w = 8, p = G) { p.multiply(3n); return p; }, // no-op\n};\nObject.defineProperties(etc, { hmacSha256Sync: {\n configurable: false, get() { return _hmacSync; }, set(f) { if (!_hmacSync)\n _hmacSync = f; },\n } });\nconst W = 8; // Precomputes-related code. W = window size\nconst precompute = () => {\n const points = []; // 10x sign(), 2x verify(). To achieve this,\n const windows = 256 / W + 1; // app needs to spend 40ms+ to calculate\n let p = G, b = p; // a lot of points related to base point G.\n for (let w = 0; w < windows; w++) { // Points are stored in array and used\n b = p; // any time Gx multiplication is done.\n points.push(b); // They consume 16-32 MiB of RAM.\n for (let i = 1; i < 2 ** (W - 1); i++) {\n b = b.add(p);\n points.push(b);\n }\n p = b.double(); // Precomputes don't speed-up getSharedKey,\n } // which multiplies user point by scalar,\n return points; // when precomputes are using base point\n};\nconst wNAF = (n) => {\n // Compared to other point mult methods,\n const comp = Gpows || (Gpows = precompute()); // stores 2x less points using subtraction\n const neg = (cnd, p) => { let n = p.negate(); return cnd ? n : p; }; // negate\n let p = I, f = G; // f must be G, or could become I in the end\n const windows = 1 + 256 / W; // W=8 17 windows\n const wsize = 2 ** (W - 1); // W=8 128 window size\n const mask = BigInt(2 ** W - 1); // W=8 will create mask 0b11111111\n const maxNum = 2 ** W; // W=8 256\n const shiftBy = BigInt(W); // W=8 8\n for (let w = 0; w < windows; w++) {\n const off = w * wsize;\n let wbits = Number(n & mask); // extract W bits.\n n >>= shiftBy; // shift number by W bits.\n if (wbits > wsize) {\n wbits -= maxNum;\n n += 1n;\n } // split if bits > max: +224 => 256-32\n const off1 = off, off2 = off + Math.abs(wbits) - 1; // offsets, evaluate both\n const cnd1 = w % 2 !== 0, cnd2 = wbits < 0; // conditions, evaluate both\n if (wbits === 0) {\n f = f.add(neg(cnd1, comp[off1])); // bits are 0: add garbage to fake point\n }\n else { // ^ can't add off2, off2 = I\n p = p.add(neg(cnd2, comp[off2])); // bits are 1: add to result point\n }\n }\n return { p, f }; // return both real and fake points for JIT\n}; // !! you can disable precomputes by commenting-out call of the wNAF() inside Point#mul()\nexport { getPublicKey, sign, signAsync, verify, CURVE, // Remove the export to easily use in REPL\ngetSharedSecret, etc, utils, Point as ProjectivePoint, Signature }; // envs like browser console\n","/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport * as secp256k1 from \"@noble/secp256k1\";\nimport { dataLength, getBytes, getBytesCopy, hexlify, assertArgument, } from \"../utils/index.js\";\nimport { arrayify, hexConcat } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { ed448 } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"signing-key/0.0.1\");\n//const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n// Make noble-secp256k1 sync\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 let tmp = privateKey;\n if (typeof tmp === \"string\" && tmp.startsWith(\"0x\")) {\n tmp = tmp.replace(\"0x\", \"\");\n }\n assertArgument(dataLength(\"0x\" + tmp) === 57, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(\"0x\" + tmp);\n }\n /**\n * The private key.\n */\n get privateKey() {\n return this.#privateKey;\n }\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() {\n return SigningKey.computePublicKey(this.#privateKey);\n }\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() {\n return SigningKey.computePublicKey(this.#privateKey, true);\n }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n const key = getBytesCopy(this.#privateKey);\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const keyBuffer = new Uint8Array(arrayify(key));\n if (keyBuffer.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n const digestBuffer = new Uint8Array(arrayify(digest));\n if (digestBuffer.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n if (keyBuffer[56] > 127) {\n const prefix = keyBuffer.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[55] |= 0x80;\n prefix[56] = 0;\n const scalar = prefix.slice(0, 56);\n const bufferDigest = Buffer.from(digestBuffer);\n const bufferPrfx = Buffer.from(prefix);\n const bufferScalar = Buffer.from(scalar);\n const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx);\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer));\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\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)));\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 const bytes = Buffer.from(arrayify(key));\n if (bytes.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n if (bytes[56] > 127) {\n const scalar = bytes.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n const pub = ed448.publicKeyFromScalar(scalar);\n return hexlify(pub);\n }\n const pub = ed448.publicKeyCreate(bytes);\n return hexlify(pub);\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 digestBuffer = Buffer.from(arrayify(digest));\n const sigBuffer = Buffer.from(arrayify(signature));\n if (sigBuffer.length !== 171) {\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n }\n const sig = sigBuffer.slice(0, 114);\n const pub = sigBuffer.slice(114);\n if (ed448.verify(digestBuffer, sig, pub)) {\n return hexlify(pub);\n }\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n return \"\";\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 { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate, } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst _guard = {};\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signautre.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() {\n return this.#r;\n }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n const value = hexlify(_value);\n assertArgument(parseInt(value.substring(0, 3)) < 8, \"non-canonical s\", \"value\", value);\n this.#s = value;\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() {\n return this.#v;\n }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() {\n return this.#networkV;\n }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacynetworkId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getnetworkId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return this.v === 27 ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, this.yParity ? \"0x1c\" : \"0x1b\"]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return `Signature { r: \"${this.r}\", s: \"${this.s}\", yParity: ${this.yParity}, networkV: ${this.networkV} }`;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this.s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: networkV != null ? networkV.toString() : null,\n r: this.r,\n s: this.s,\n v: this.v,\n };\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getnetworkId(45)\n * //_result:\n *\n * Signature.getnetworkId(46)\n * //_result:\n */\n static getnetworkId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if (bv == BN_27 || bv == BN_28) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getnetworkIdV(5, 27)\n * //_result:\n *\n * Signature.getnetworkIdV(5, 28)\n * //_result:\n *\n */\n static getnetworkIdV(networkId, v) {\n return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return bv & BN_1 ? 27 : 28;\n }\n}\n//# sourceMappingURL=signature.js.map","/**\n * A fundamental building block of Core is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha3.js\";\nimport { Ed448Goldilock } from \"./crypto.js\";\nimport { keccak256 } from \"./keccak.js\";\nexport { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\nfunction lock() {\n computeHmac.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { arrayify, hexDataSlice } from \"../utils/data.js\";\nimport { calculateCheckSum } from \"../address/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 removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nexport function publicToAddress(key, prefix) {\n const val = hexDataSlice(sha256(key), 12);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport function computeAddress(key, prefix) {\n let pubkey;\n if (typeof key === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return publicToAddress(pubkey, prefix); // getAddress(sha256(\"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, prefix) {\n // return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature);\n return publicToAddress(publicKey, prefix);\n}\nexport function extractPrefix(address) {\n address = getAddress(address);\n return address.substring(2, 4);\n}\n//# sourceMappingURL=address.js.map","import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument, } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => {\n this[index] = item;\n });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof name === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, new Map());\n // Remove any key thats not unique\n this.#names = Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n }));\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof prop === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply(this === receiver ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply(this === receiver ? target : this, [\n prop,\n ]);\n }\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n }\n /**\n * Returns the Result as a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray() {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject() {\n return this.#names.reduce((accum, name, index) => {\n assert(name != null, \"value at index ${ index } unnamed\", \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\",\n });\n // Add values for names that don't conflict\n if (!(name in accum)) {\n accum[name] = this.getValue(name);\n }\n return accum;\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(this.#names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(this.#names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = this.#names.indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: WordSize,\n offset: bytes.length,\n });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\",\n type: \"string\",\n localName: \"string\",\n dynamic: \"boolean\",\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() {\n return this.#dataLength;\n }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n constructor(data, allowLoose) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#offset = 0;\n }\n get data() {\n return hexlify(this.#data);\n }\n get dataLength() {\n return this.#data.length;\n }\n get consumed() {\n return this.#offset;\n }\n get bytes() {\n return new Uint8Array(this.#data);\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose &&\n loose &&\n this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength,\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose);\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, {\n signed,\n width,\n });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${size ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_corebc_typed\");\nexport class Typed {\n type;\n value;\n #options;\n _typedSymbol;\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n defaultValue() {\n return 0;\n }\n minValue() {\n return 0;\n }\n maxValue() {\n return 0;\n }\n isBigInt() {\n return !!this.type.match(/^u?int[0-9]+$/);\n }\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n isString() {\n return this.type === \"string\";\n }\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return this.value.length;\n }\n return null;\n }\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n static uint8(v) {\n return n(v, 8);\n }\n static uint16(v) {\n return n(v, 16);\n }\n static uint24(v) {\n return n(v, 24);\n }\n static uint32(v) {\n return n(v, 32);\n }\n static uint40(v) {\n return n(v, 40);\n }\n static uint48(v) {\n return n(v, 48);\n }\n static uint56(v) {\n return n(v, 56);\n }\n static uint64(v) {\n return n(v, 64);\n }\n static uint72(v) {\n return n(v, 72);\n }\n static uint80(v) {\n return n(v, 80);\n }\n static uint88(v) {\n return n(v, 88);\n }\n static uint96(v) {\n return n(v, 96);\n }\n static uint104(v) {\n return n(v, 104);\n }\n static uint112(v) {\n return n(v, 112);\n }\n static uint120(v) {\n return n(v, 120);\n }\n static uint128(v) {\n return n(v, 128);\n }\n static uint136(v) {\n return n(v, 136);\n }\n static uint144(v) {\n return n(v, 144);\n }\n static uint152(v) {\n return n(v, 152);\n }\n static uint160(v) {\n return n(v, 160);\n }\n static uint168(v) {\n return n(v, 168);\n }\n static uint176(v) {\n return n(v, 176);\n }\n static uint184(v) {\n return n(v, 184);\n }\n static uint192(v) {\n return n(v, 192);\n }\n static uint200(v) {\n return n(v, 200);\n }\n static uint208(v) {\n return n(v, 208);\n }\n static uint216(v) {\n return n(v, 216);\n }\n static uint224(v) {\n return n(v, 224);\n }\n static uint232(v) {\n return n(v, 232);\n }\n static uint240(v) {\n return n(v, 240);\n }\n static uint248(v) {\n return n(v, 248);\n }\n static uint256(v) {\n return n(v, 256);\n }\n static uint(v) {\n return n(v, 256);\n }\n static int8(v) {\n return n(v, -8);\n }\n static int16(v) {\n return n(v, -16);\n }\n static int24(v) {\n return n(v, -24);\n }\n static int32(v) {\n return n(v, -32);\n }\n static int40(v) {\n return n(v, -40);\n }\n static int48(v) {\n return n(v, -48);\n }\n static int56(v) {\n return n(v, -56);\n }\n static int64(v) {\n return n(v, -64);\n }\n static int72(v) {\n return n(v, -72);\n }\n static int80(v) {\n return n(v, -80);\n }\n static int88(v) {\n return n(v, -88);\n }\n static int96(v) {\n return n(v, -96);\n }\n static int104(v) {\n return n(v, -104);\n }\n static int112(v) {\n return n(v, -112);\n }\n static int120(v) {\n return n(v, -120);\n }\n static int128(v) {\n return n(v, -128);\n }\n static int136(v) {\n return n(v, -136);\n }\n static int144(v) {\n return n(v, -144);\n }\n static int152(v) {\n return n(v, -152);\n }\n static int160(v) {\n return n(v, -160);\n }\n static int168(v) {\n return n(v, -168);\n }\n static int176(v) {\n return n(v, -176);\n }\n static int184(v) {\n return n(v, -184);\n }\n static int192(v) {\n return n(v, -192);\n }\n static int200(v) {\n return n(v, -200);\n }\n static int208(v) {\n return n(v, -208);\n }\n static int216(v) {\n return n(v, -216);\n }\n static int224(v) {\n return n(v, -224);\n }\n static int232(v) {\n return n(v, -232);\n }\n static int240(v) {\n return n(v, -240);\n }\n static int248(v) {\n return n(v, -248);\n }\n static int256(v) {\n return n(v, -256);\n }\n static int(v) {\n return n(v, -256);\n }\n static bytes1(v) {\n return b(v, 1);\n }\n static bytes2(v) {\n return b(v, 2);\n }\n static bytes3(v) {\n return b(v, 3);\n }\n static bytes4(v) {\n return b(v, 4);\n }\n static bytes5(v) {\n return b(v, 5);\n }\n static bytes6(v) {\n return b(v, 6);\n }\n static bytes7(v) {\n return b(v, 7);\n }\n static bytes8(v) {\n return b(v, 8);\n }\n static bytes9(v) {\n return b(v, 9);\n }\n static bytes10(v) {\n return b(v, 10);\n }\n static bytes11(v) {\n return b(v, 11);\n }\n static bytes12(v) {\n return b(v, 12);\n }\n static bytes13(v) {\n return b(v, 13);\n }\n static bytes14(v) {\n return b(v, 14);\n }\n static bytes15(v) {\n return b(v, 15);\n }\n static bytes16(v) {\n return b(v, 16);\n }\n static bytes17(v) {\n return b(v, 17);\n }\n static bytes18(v) {\n return b(v, 18);\n }\n static bytes19(v) {\n return b(v, 19);\n }\n static bytes20(v) {\n return b(v, 20);\n }\n static bytes21(v) {\n return b(v, 21);\n }\n static bytes22(v) {\n return b(v, 22);\n }\n static bytes23(v) {\n return b(v, 23);\n }\n static bytes24(v) {\n return b(v, 24);\n }\n static bytes25(v) {\n return b(v, 25);\n }\n static bytes26(v) {\n return b(v, 26);\n }\n static bytes27(v) {\n return b(v, 27);\n }\n static bytes28(v) {\n return b(v, 28);\n }\n static bytes29(v) {\n return b(v, 29);\n }\n static bytes30(v) {\n return b(v, 30);\n }\n static bytes31(v) {\n return b(v, 31);\n }\n static bytes32(v) {\n return b(v, 32);\n }\n static address(v) {\n return new Typed(_gaurd, \"address\", v);\n }\n static bool(v) {\n return new Typed(_gaurd, \"bool\", !!v);\n }\n static bytes(v) {\n return new Typed(_gaurd, \"bytes\", v);\n }\n static string(v) {\n return new Typed(_gaurd, \"string\", v);\n }\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return value && value._typedSymbol === _typedSymbol;\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map","import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 22));\n }\n}\n//# sourceMappingURL=address.js.map","import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","import { defineProperties, isError, assert, assertArgument, assertArgumentCount, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof values === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => {\n func(staticWriter.length);\n });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\";\n const dynamic = length === -1 || coder.dynamic;\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? \" \" + this.localName : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", {\n buffer: reader.bytes,\n offset: count * WordSize,\n length: reader.dataLength,\n });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map","import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map","import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map","import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\".substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map","import { defineProperties, fromTwos, getBigInt, mask, toTwos, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = (signed ? \"int\" : \"uint\") + size * 8;\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, this.size * 8 - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map","import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = \"tuple(\" + types.join(\",\") + \")\";\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, {\n coders: Object.freeze(coders.slice()),\n });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map","import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.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 * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of ore in a single xcb.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const OrePerXCB = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") *\n BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nexport const NegativeOne = /*#__PURE__*/ BigInt(-1);\nexport const Zero = /*#__PURE__*/ BigInt(0);\nexport const One = /*#__PURE__*/ BigInt(1);\nexport const Two = /*#__PURE__*/ BigInt(2);\n//# sourceMappingURL=numbers.js.map","// NFKC (composed) // (decomposed)\n/**\n * A constant for the core symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const CoreSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Core Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Core Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map","import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n }),\n };\n}\n/**\n * Returns a [[AccessList]] from any corebcsupported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof set === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof value === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => a.address.localeCompare(b.address));\n return result;\n}\n//# sourceMappingURL=accesslist.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { recoverAddress } from \"./address.js\";\nimport { checkProperties } from \"../utils/properties.js\";\nimport { arrayify, stripZeros } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport * as RLP from \"../crypto/rlp.js\";\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst logger = new Logger(\"transaction/0.0.1\");\nconst BN_0 = BigInt(0);\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction parse(data) {\n const handleNumber = (value) => {\n // @ts-ignore\n if (value === \"0x\") {\n return BigNumber.from(0);\n }\n return BigNumber.from(value);\n };\n const transaction = RLP.decode(data);\n if (transaction.length !== 7 && transaction.length !== 8) {\n logger.throwArgumentError(\"invalid raw transaction\", \"data\", data);\n }\n const isSigned = transaction.length === 8;\n const tx = {\n nonce: Number(handleNumber(transaction[0])),\n energyPrice: handleNumber(transaction[1]).toBigInt(),\n energyLimit: handleNumber(transaction[2]).toBigInt(),\n networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(),\n to: handleAddress(transaction[isSigned ? 4 : 3]),\n value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(),\n data: transaction[isSigned ? 6 : 5],\n };\n if (transaction.length === 8) {\n const prefix = networkIdToPrefix(Number(tx.networkId));\n const digest = sha256(serialize(tx));\n tx.hash = sha256(serialize(tx, transaction[7]));\n tx.from = recoverAddress(digest, transaction[7], prefix);\n tx.signature = transaction[7];\n }\n return tx;\n}\nconst unsignedTransactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n { name: \"networkId\", maxLength: 32, numeric: true },\n];\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"networkId\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n networkId: true,\n data: true,\n energyLimit: true,\n energyPrice: true,\n nonce: true,\n to: true,\n value: true,\n};\nfunction serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) {\n let value = transaction[name] || [];\n const options = {};\n if (numeric) {\n options.hexPad = \"left\";\n }\n const tmpHexlified = hexlify(value, options);\n value = arrayify(tmpHexlified);\n // Fixed-width field\n if (length && value.length !== length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n // Variable-width (with a maximum)\n if (maxLength) {\n value = stripZeros(value);\n if (value.length > maxLength) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n }\n const hexlified = hexlify(value);\n raw.push(hexlified);\n });\n if (!!signature) {\n raw.push(hexlify(signature));\n }\n const finalValue = RLP.encode(raw);\n return finalValue;\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Core by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in corebc) 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 #to;\n #data;\n #nonce;\n #energyLimit;\n #energyPrice;\n #value;\n #networkId;\n #sig;\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n return this.#to;\n }\n set to(value) {\n this.#to = value == null ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() {\n return this.#nonce;\n }\n set nonce(value) {\n this.#nonce = getNumber(value, \"value\");\n }\n /**\n * The energy limit.\n */\n get energyLimit() {\n return this.#energyLimit;\n }\n set energyLimit(value) {\n this.#energyLimit = getBigInt(value);\n }\n /**\n * The energy 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 energyPrice() {\n const value = this.#energyPrice;\n if (value == null) {\n return BN_0;\n }\n return value;\n }\n set energyPrice(value) {\n this.#energyPrice = value == null ? null : getBigInt(value, \"energyPrice\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() {\n return this.#data;\n }\n set data(value) {\n this.#data = hexlify(value);\n }\n /**\n * The amount of xcb (in ore) to send in this transactions.\n */\n get value() {\n return this.#value;\n }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value);\n }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() {\n return this.#sig || null;\n }\n set signature(value) {\n this.#sig = value == null ? null : value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#to = null;\n this.#nonce = 0;\n this.#energyLimit = BigInt(0);\n this.#energyPrice = null;\n this.#data = \"0x\";\n this.#value = BigInt(0);\n this.#networkId = BigInt(0);\n this.#sig = 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 sha256(this.serialized);\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 sha256(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 const prefix = networkIdToPrefix(Number(this.#networkId));\n return recoverAddress(this.unsignedHash, this.signature, prefix);\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);\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 //isSigned(): this is SignedTransaction {\n return this.signature != null;\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 assert(this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n return serialize(this, this.signature);\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 serialize(this);\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 to: this.to,\n data: this.data,\n nonce: this.nonce,\n energyLimit: s(this.energyLimit),\n energyPrice: s(this.energyPrice),\n value: s(this.value),\n networkId: s(this.networkId),\n sig: this.signature ? this.signature : null,\n };\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 return Transaction.from(parse(payload));\n }\n const result = new Transaction();\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.energyLimit != null) {\n result.energyLimit = tx.energyLimit;\n }\n if (tx.energyPrice != null) {\n result.energyPrice = tx.energyPrice;\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.networkId != null) {\n result.networkId = tx.networkId;\n }\n if (tx.signature != null) {\n result.signature = tx.signature;\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 { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof message === \"string\") {\n message = toUtf8Bytes(message);\n }\n return sha256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message,\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig, prefix) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig, prefix);\n}\n//# sourceMappingURL=message.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument, } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = !!value ? \"0x01\" : \"0x00\";\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = match[1] === \"int\";\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) &&\n size % 8 === 0 &&\n size !== 0 &&\n size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map","import { getAddress } from \"../address/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\";\nimport { sha256 } from \"../crypto/index.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\");\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 networkId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\",\n};\nconst domainFieldNames = [\n \"name\",\n \"version\",\n \"networkId\",\n \"verifyingContract\",\n \"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 networkId: function (_value) {\n const value = getBigInt(_value, \"domain.networkId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.networkId\", _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] || \"256\");\n assertArgument(width % 8 === 0 &&\n width !== 0 &&\n width <= 256 &&\n (match[2] == null || 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\":\n return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\":\n return function (value) {\n return !value ? hexFalse : hexTrue;\n };\n case \"bytes\":\n return function (value) {\n return sha256(value);\n };\n case \"string\":\n return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields\n .map(({ name, type }) => type + \" \" + name)\n .join(\",\")})`;\n}\nexport class TypedDataEncoder {\n primaryType;\n #types;\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n constructor(types) {\n this.#types = JSON.stringify(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 Object.keys(types).forEach((type) => {\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\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 = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1] || null;\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\n .map((t) => JSON.stringify(t))\n .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]) +\n st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(sha256);\n }\n return sha256(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 sha256(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 encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return sha256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n return value.map((v) => this._visit(match[1], 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 visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\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 static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value),\n ]);\n }\n static hash(domain, types, value) {\n return sha256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\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 &&\n !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 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 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, prefix) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix);\n}\n//# sourceMappingURL=typed-data.js.map","/**\n * About frgaments...\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nvar _a;\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\",\n \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\",\n \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\",\n \"@\": \"AT\",\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() {\n return this.#offset;\n }\n get length() {\n return this.#tokens.length - this.#offset;\n }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() {\n return new _a(this.#tokens);\n }\n reset() {\n this.#offset = 0;\n }\n #subTokenString(from = 0, to = 0) {\n return new _a(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: t.match - from,\n linkBack: t.linkBack - from,\n linkNext: t.linkNext - from,\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return top != null && allowed.has(top) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return top.type === type ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\n_a = TokenString;\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = offset < text.length ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = {\n depth: brackets.length,\n linkBack: -1,\n linkNext: -1,\n match: -1,\n type: \"\",\n text: \"\",\n offset,\n value: -1,\n };\n tokens.push(token);\n let type = SimpleTokens[cur[0]] || \"\";\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n tokens[token.match].match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n tokens[tokens.length - 1].value =\n getNumber(value);\n }\n if (tokens.length === 0 ||\n tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n tokens[tokens.length - 1].text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a energy limit, returning a BigNumber or null if none\nfunction consumeEnergy(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid energy\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_corebc_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **PAramType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name,\n type,\n baseType,\n indexed,\n components,\n arrayLength,\n arrayChildren,\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n let result = {\n type: this.baseType === \"tuple\" ? \"tuple\" : this.type,\n name: this.name || undefined,\n };\n if (typeof this.indexed === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${this.arrayLength < 0 ? \"\" : String(this.arrayLength)}]`;\n }\n else {\n if (this.isTuple()) {\n if (format !== \"sighash\") {\n result += this.type;\n }\n result +=\n \"(\" +\n this.components\n .map((comp) => comp.format(format))\n .join(format === \"full\" ? \", \" : \",\") +\n \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /*\n * Returns true if %%value%% is an Array type.\n *\n * This provides a type gaurd ensuring that the\n * [[arrayChildren]] and [[arrayLength]] are non-null.\n */\n //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } {\n // return value && (value.baseType === \"array\")\n //}\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return this.baseType === \"array\";\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return this.baseType === \"tuple\";\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return this.indexed != null;\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => _this.arrayChildren.walk(v, process));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => _this.components[i].walk(v, process));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof value !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () {\n setValue(await result);\n })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS naes by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ParamType.from(lex(obj), allowIndexed);\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") ||\n obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = obj.peekType(\"ID\") ? obj.pop().text : \"\";\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof name === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components,\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" ||\n type.startsWith(\"tuple(\" /* fix: ) */) ||\n type.startsWith(\"(\" /* fix: ) */)) {\n const comps = obj.components != null\n ? obj.components.map((c) => ParamType.from(c))\n : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return value && value[internal] === ParamTypeInternal;\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof obj === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n }\n else if (typeof obj === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\",\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof name === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return (\"(\" +\n params.map((p) => p.format(format)).join(format === \"full\" ? \", \" : \",\") +\n \")\");\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === ErrorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return EventFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n static isFragment(value) {\n return value && value[internal] === EventFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n payable;\n energy;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, energy) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, {\n value: ConstructorFragmentInternal,\n });\n defineProperties(this, { payable, energy });\n }\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: this.payable ? \"payable\" : \"undefined\",\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n result.push(this.payable ? \"payable\" : \"nonpayable\");\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n return result.join(\" \");\n }\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ConstructorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, setify([\"payable\"])).has(\"payable\");\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, energy);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === ConstructorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n format(format) {\n const type = this.inputs.length === 0 ? \"receive\" : \"fallback\";\n if (format === \"json\") {\n const stateMutability = this.payable ? \"payable\" : \"nonpayable\";\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FallbackFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = obj.stateMutability === \"payable\";\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n static isFragment(value) {\n return value && value[internal] === FallbackFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The amount of energy to send when calling this function\n */\n energy;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, energy) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = stateMutability === \"view\" || stateMutability === \"pure\";\n const payable = stateMutability === \"payable\";\n defineProperties(this, {\n constant,\n energy,\n outputs,\n payable,\n stateMutability,\n });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: this.stateMutability !== \"nonpayable\"\n ? this.stateMutability\n : undefined,\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n }\n return result.join(\" \");\n }\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FunctionFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof obj.constant === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === FunctionFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n format() {\n throw new Error(\"@TODO\");\n }\n static from(obj) {\n if (typeof obj === \"string\") {\n return StructFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === StructFragmentInternal;\n }\n}\n//# sourceMappingURL=fragments.js.map","/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason],\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code],\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: tx.to ? getAddress(tx.to) : null,\n data: tx.data || \"0x\",\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action,\n data,\n reason,\n transaction,\n invocation,\n revert,\n });\n}\n/**\n * About AbiCoder\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, match[1] === \"int\", param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose));\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an corebc-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map","/**\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","/**\n * About Interface\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert, } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nexport { checkResultErrors, Result };\nexport class LogDescription {\n fragment;\n name;\n signature;\n topic;\n args;\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n signature,\n topic,\n args,\n });\n }\n}\nexport class TransactionDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n value;\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n value,\n });\n }\n}\nexport class ErrorDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n });\n }\n}\nexport class Indexed {\n hash;\n _isIndexed;\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n },\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n },\n },\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving xcb is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof fragments === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(\"EE\", error);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags),\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, {\n deploy: fragment,\n });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback ||\n fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\"),\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = minimal ? \"minimal\" : \"full\";\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = values.length > 0 ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength &&\n (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 &&\n values &&\n values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null ||\n Array.isArray(lastArg) ||\n typeof lastArg !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#functions.get(name), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#events.get(name), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#errors.get(name), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\n getSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n \n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n \n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n \n fragment = matches[0];\n }\n \n return dataSlice(id(fragment.format()), 0, 4);\n }\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if (bytes.length % 32 === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() },\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name,\n signature: ef.format(),\n args,\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args,\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n \n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n };\n \n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n */\n // Create the filter for the event with search criteria (e.g. for xcb_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return sha256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof value === \"boolean\") {\n value = value ? \"0x01\" : \"0x00\";\n }\n if (param.type.match(/^u?int/)) {\n value = toBeHex(value);\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n //@TOOD should probably be return toHex(value, 32)\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", \"contract.\" + param.name, value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", \"contract.\" + param.name, value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(sha256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics,\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" ||\n param.type === \"bytes\" ||\n param.baseType === \"tuple\" ||\n param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt(tx.value != null ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof value === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // Maybe an interface from an older version, or from a symlinked copy\n if (typeof value.format === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map","import { concat, \n// dataSlice,\ngetBigInt,\n// encodeRlp\n } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { hexDataLength, hexDataSlice } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { removeHexPrefix } from \"../transaction/address.js\";\nimport { calculateCheckSum } from \"./index.js\";\nconst logger = new Logger(\"contract-address/0.0.1\");\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(from);\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\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 * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n const val = hexDataSlice(sha256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12);\n console.log({ \"contract-address/74=>should be string\": val });\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\n//# sourceMappingURL=contract-address.js.map","import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.corebc.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return value && typeof value.getAddress === \"function\";\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null ||\n result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof target !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target) {\n if (typeof target === \"string\") {\n return getAddress(target);\n // assert(resolver != null, \"ENS resolution requires a provider\",\n // \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n // return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof target.then === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map","import { defineProperties, getBigInt, getNumber, hexlify, resolveProperties, assert, assertArgument, isError, makeError, } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The energy price for legacy networks.\n */\n energyPrice;\n constructor(energyPrice) {\n defineProperties(this, {\n energyPrice: getValue(energyPrice),\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { energyPrice } = this;\n return {\n _type: \"FeeData\",\n energyPrice: toJson(energyPrice),\n };\n }\n}\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"networkId,energyLimit,energyPrice,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipReadEnabled = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Core.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total energy limit for this block.\n */\n energyLimit;\n /**\n * The total energy used in this block.\n */\n energyUsed;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per energy that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerEnergy;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof tx !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n nonce: block.nonce,\n difficulty: block.difficulty,\n energyLimit: block.energyLimit,\n energyUsed: block.energyUsed,\n miner: block.miner,\n extraData: block.extraData,\n baseFeePerEnergy: getValue(block.baseFeePerEnergy),\n });\n }\n /**\n * Returns the list of transaction hashes.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof tx === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions for blocks which\n * prefetched them, by passing ``true`` to %%prefetchTxs%%\n * into [[provider_getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof txs[0] === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\",\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this;\n return {\n _type: \"Block\",\n baseFeePerEnergy: toJson(baseFeePerEnergy),\n difficulty: toJson(difficulty),\n extraData,\n energyLimit: toJson(energyLimit),\n energyUsed: toJson(energyUsed),\n hash,\n miner,\n nonce,\n number,\n parentHash,\n timestamp,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++],\n done: false,\n };\n }\n return { value: undefined, done: true };\n },\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() {\n return this.#transactions.length;\n }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof indexOrHash === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof v === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash === hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof tx === \"string\") {\n return await this.provider.getTransaction(tx);\n }\n else {\n return tx;\n }\n }\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof indexOrHash === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Has this block been mined.\n *\n * If true, the block has been typed-gaurded that all mined\n * properties are non-null.\n */\n isMined() {\n return !!this.hash;\n }\n /**\n *\n */\n isLondon() {\n return !!this.baseFeePerEnergy;\n }\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\nexport class Log {\n provider;\n transactionHash;\n blockHash;\n blockNumber;\n removed;\n address;\n data;\n topics;\n index;\n transactionIndex;\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this;\n return {\n _type: \"log\",\n address,\n blockHash,\n blockNumber,\n data,\n index,\n removed,\n topics,\n transactionHash,\n transactionIndex,\n };\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\nexport class TransactionReceipt {\n provider;\n to;\n from;\n contractAddress;\n hash;\n index;\n blockHash;\n blockNumber;\n logsBloom;\n energyUsed;\n cumulativeEnergyUsed;\n energyPrice;\n type;\n //readonly byzantium!: boolean;\n status;\n root;\n #logs;\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n energyUsed: tx.energyUsed,\n cumulativeEnergyUsed: tx.cumulativeEnergyUsed,\n energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice),\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root,\n });\n }\n get logs() {\n return this.#logs;\n }\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,\n status, root, } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash,\n blockNumber,\n //byzantium,\n contractAddress,\n cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed),\n from,\n energyPrice: toJson(this.energyPrice),\n energyUsed: toJson(this.energyUsed),\n hash,\n index,\n logs,\n logsBloom,\n root,\n status,\n to,\n };\n }\n get length() {\n return this.logs.length;\n }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n },\n };\n }\n get fee() {\n return this.energyUsed * this.energyPrice;\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n async getResult() {\n return await this.provider.getTransactionResult(this.hash);\n }\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/*\nexport type ReplacementDetectionSetup = {\n to: string;\n from: string;\n value: bigint;\n data: string;\n nonce: number;\n block: number;\n};\n*/\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of energy this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n energyLimit;\n /**\n * The energy price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective energy price// (the fee per energy that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerEnergy]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of energy the transaction\n * consumes.\n */\n energyPrice;\n /**\n * The data.\n */\n data;\n /**\n * The value, in ore. Use [[formatXCB]] to format this value\n * as xcb.\n */\n value;\n /**\n * The chain ID.\n */\n networkId;\n /**\n * The signature.\n */\n signature;\n #startBlock;\n /**\n * Create a new TransactionResponse with %%tx%% parameters\n * connected to %%provider%%.\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null;\n this.blockHash = tx.blockHash != null ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.from = tx.from;\n this.to = tx.to || null;\n this.energyLimit = tx.energyLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.energyPrice = tx.energyPrice;\n this.networkId = tx.networkId;\n this.signature = tx.signature;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON representation of this transaction.\n */\n toJSON() {\n const { index, hash, type, to, from, nonce, data, signature } = this;\n return {\n _type: \"TransactionReceipt\",\n networkId: toJson(this.networkId),\n data,\n from,\n energyLimit: toJson(this.energyLimit),\n energyPrice: toJson(this.energyPrice),\n hash,\n nonce,\n signature,\n to,\n index,\n type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = _confirms == null ? 1 : _confirms;\n const timeout = _timeout == null ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = startBlock === -1 ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from),\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if (blockNumber - receipt.blockNumber + 1 < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data &&\n tx.to === this.to &&\n tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" &&\n tx.from === tx.to &&\n tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: reason === \"replaced\" || reason === \"cancelled\",\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt,\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (receipt) {\n if ((await receipt.confirmations()) >= confirms) {\n return receipt;\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => {\n cancellers.forEach((c) => c());\n };\n // On cancel, stop scanning for replacements\n cancellers.push(() => {\n stopScanning = true;\n });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => {\n clearTimeout(timer);\n });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n resolve(receipt);\n }\n };\n cancellers.push(() => {\n this.provider.off(this.hash, txListener);\n });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => {\n this.provider.off(\"block\", replaceListener);\n });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return this.blockHash != null;\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return this.type === 0;\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return {\n orphan: \"drop-log\",\n log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index,\n },\n };\n}\n//# sourceMappingURL=provider.js.map","import { Log, TransactionReceipt, TransactionResponse, } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\nexport class EventLog extends Log {\n interface;\n fragment;\n args;\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length\n ? this.#iface.getEvent(log.topics[0])\n : null;\n if (fragment) {\n return new EventLog(log, this.#iface, fragment);\n }\n else {\n return log;\n }\n });\n }\n}\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n async wait(confirms) {\n const receipt = await super.wait();\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\nexport class ContractUnknownEventPayload extends EventPayload {\n log;\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n async getBlock() {\n return await this.log.getBlock();\n }\n async getTransaction() {\n return await this.log.getTransaction();\n }\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map","import { Indexed, Interface, Typed } from \"../abi/index.js\";\nimport { resolveAddress } from \"../address/checks.js\";\nimport { copyRequest, Log, } from \"../providers/provider.js\";\nimport { defineProperties, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument, } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return value && typeof value.call === \"function\";\n}\nfunction canEstimate(value) {\n return value && typeof value.estimateEnergy === \"function\";\n}\nfunction canResolve(value) {\n return value && typeof value.resolveName === \"function\";\n}\nfunction canSend(value) {\n return value && typeof value.sendTransaction === \"function\";\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof value[feature] === \"function\") {\n return value;\n }\n if (value.provider && typeof value.provider[feature] === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(Typed.dereference(arg, \"overrides\"));\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from);\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n const iface = contract.interface;\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || (tx.value || BN_0) === BN_0, \"cannot send value to non-payable contract\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || (tx.data || \"0x\") === \"0x\", \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment in getFragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs),\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract,\n _key: key,\n getFragment,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment in defineProperty\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment in\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract,\n _key: key,\n getFragment,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_corebcInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value &&\n typeof value === \"object\" &&\n \"getTopicFilter\" in value &&\n typeof value.getTopicFilter === \"function\" &&\n value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof event === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics\n .map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n })\n .join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = addr ? addr : contract;\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment\n ? contract.interface.decodeEventLog(fragment, log.data, log.topics)\n : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n return count > 0;\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n target;\n interface;\n runner;\n filters;\n [internal];\n fallback;\n constructor(target, abi, runner, _deployTx) {\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof target === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, _prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = this.getEvent(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract event: ${prop}`);\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop)));\n },\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null,\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, _prop, receiver) => {\n if (_prop in target || passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = target.getFunction(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract method: ${prop}`);\n },\n has: (target, prop) => {\n if (prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(String(prop));\n },\n });\n }\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n async getAddress() {\n return await getInternal(this).addrPromise;\n }\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n async waitForDeployment() {\n // We have the deployement transaction; just use that (throws if deployement fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n getFunction(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n getEvent(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n async queryTransaction(hash) {\n // Is this useful?\n throw new Error(\"@TODO\");\n }\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = addr ? addr : await addrPromise;\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n return new EventLog(log, this.interface, foundFragment);\n }\n else {\n return new Log(log, provider);\n }\n });\n }\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners\n .map(({ listener }) => listener)\n .indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n 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 await this.off(event, listener);\n }\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map","import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\nimport { isBytes } from \"../utils/data.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\nexport class ContractFactory {\n interface;\n bytecode;\n runner;\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else if (typeof bytecode === \"string\") {\n bytecode = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecode = hexlify(bytecode);\n }\n else if (bytecode && typeof bytecode.object === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecode = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecode = \"!\";\n }\n defineProperties(this, {\n // @ts-ignore\n bytecode,\n interface: iface,\n runner: runner || null,\n });\n }\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([\n this.bytecode,\n this.interface.encodeDeploy(resolvedArgs),\n ]);\n return Object.assign({}, overrides, { data });\n }\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof this.runner.sendTransaction === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\",\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof output === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map","/**\n * @_ignore\n */\nimport { getAddress } from \"../address/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.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) {\n return (array) => {\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 number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n energyLimit: getBigInt,\n energyUsed: getBigInt,\n miner: allowNull(getAddress),\n extraData: formatData,\n baseFeePerEnergy: allowNull(getBigInt),\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 energyUsed: getBigInt,\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeEnergyUsed: getBigInt,\n effectiveEnergyPrice: allowNull(getBigInt),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0),\n}, {\n effectiveEnergyPrice: [\"energyPrice\"],\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 && !getAddress(value.to) && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n //confirmations: allowNull(getNumber, null),\n from: getAddress,\n maxFeePerEnergy: allowNull(getBigInt),\n energyLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n networkId: allowNull(getBigInt, null),\n }, {\n data: [\"input\"],\n energyLimit: [\"energy\"],\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 // Compute the signature\n if (value.signature) {\n result.signature = value.signature;\n }\n else {\n result.signature = value;\n }\n // Some backends omit networkId on legacy transactions, but we can compute it\n if (result.networkId == null) {\n const networkId = result.signature.legacynetworkId;\n if (networkId != null) {\n result.networkId = networkId;\n }\n }\n // @TODO: check networkId\n /*\n if (value.networkId != null) {\n let networkId = value.networkId;\n \n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n \n result.networkId = networkId;\n \n } else {\n let networkId = value.networkId;\n \n // geth-etc returns networkId\n if (networkId == null && result.v == null) {\n networkId = value.networkId;\n }\n \n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n \n if (typeof(networkId) !== \"number\" && result.v != null) {\n networkId = (result.v - 35) / 2;\n if (networkId < 0) { networkId = 0; }\n networkId = parseInt(networkId);\n }\n \n if (typeof(networkId) !== \"number\") { networkId = 0; }\n \n result.networkId = networkId;\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 { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nexport class NetworkPlugin {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\nexport class EnergyCostPlugin extends NetworkPlugin {\n effectiveBlock;\n txBase;\n txCreate;\n txDataZero;\n txDataNonzero;\n txAccessListStorageKey;\n txAccessListAddress;\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.corebc.network.plugins.EnergyCost#${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 clone() {\n return new EnergyCostPlugin(this.effectiveBlock, this);\n }\n}\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n constructor(feeDataFunc) {\n super(\"org.corebc.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\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 * About networks\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { getBigInt, assertArgument } from \"../utils/index.js\";\nimport { EnergyCostPlugin } from \"./plugins-network.js\";\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*/\n// Networks or clients with a higher need for security (such as clients\n// that may automatically make CCIP requests without user interaction)\n// can use this plugin to anonymize requests or intercept CCIP requests\n// to notify and/or receive authorization from the user\nconst Networks = new Map();\nexport class Network {\n #name;\n #networkId;\n #plugins;\n constructor(name, networkId) {\n this.#name = name;\n this.#networkId = getBigInt(networkId);\n this.#plugins = new Map();\n }\n toJSON() {\n return { name: this.name, networkId: String(this.networkId) };\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() {\n return this.#name;\n }\n set name(value) {\n this.#name = value;\n }\n /**\n * The network chain ID.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value, \"networkId\");\n }\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.networkId === 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.networkId === getBigInt(other);\n }\n catch (error) { }\n return false;\n }\n if (typeof other === \"object\") {\n if (other.networkId != null) {\n try {\n return this.networkId === getBigInt(other.networkId);\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.networkId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic energy required for a transaction.\n *\n * A EnergyCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicEnergy(tx) {\n const costs = this.getPlugin(\"org.corebc.plugins.network.EnergyCost\") || new EnergyCostPlugin();\n let energy = costs.txBase;\n if (tx.to == null) {\n energy += 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 energy += costs.txDataZero;\n }\n else {\n energy += costs.txDataNonzero;\n }\n }\n }\n return energy;\n }\n /**\n * Returns a new Network for the %%network%% name or networkId.\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.networkId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof network === \"object\") {\n assertArgument(typeof network.name === \"string\" &&\n typeof network.networkId === \"number\", \"invalid network object name or networkId\", \"network\", network);\n const custom = new Network(network.name, network.networkId);\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrnetworkId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrnetworkId, networkFunc) {\n if (typeof nameOrnetworkId === \"number\") {\n nameOrnetworkId = BigInt(nameOrnetworkId);\n }\n const existing = Networks.get(nameOrnetworkId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrnetworkId\", nameOrnetworkId);\n }\n Networks.set(nameOrnetworkId, networkFunc);\n }\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Core networks\n function registerEth(name, networkId, options) {\n const func = function () {\n const network = new Network(name, networkId);\n network.attachPlugin(new EnergyCostPlugin());\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(networkId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\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 registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map","import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * @TODO\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\",\n info: { event },\n });\n}\n// @TODO: refactor this\n/**\n * @TODO\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 constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n get pollingInterval() {\n return this.#interval;\n }\n set pollingInterval(value) {\n this.#interval = value;\n }\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\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) {\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n/**\n * @TODO\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\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 * @TODO\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 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 this.#blockNumber = blockNumber;\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\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 * About Subclassing the Provider...\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/checks.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 { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse, } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse, } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber, } from \"./subscriber-polling.js\";\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return value && typeof value.then === \"function\";\n}\nfunction getTag(prefix, value) {\n return (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 // 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}\nexport class UnmanagedSubscriber {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\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 \"pending\":\n case \"debug\":\n case \"error\":\n case \"network\": {\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 {\n type: \"orphan\",\n tag: getTag(\"orphan\", event),\n filter: copy(event),\n };\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));\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() {\n return new Date().getTime();\n}\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\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 // @TODO: This should be a () => Promise so network can be\n // done when needed; or rely entirely on _detectNetwork?\n constructor(_network) {\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(() => {\n this.emit(\"network\", network, null);\n }, 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.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get provider() {\n return this;\n }\n get plugins() {\n return Array.from(this.#plugins.values());\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 getPlugin(name) {\n return this.#plugins.get(name) || null;\n }\n get disableCcipRead() {\n return this.#disableCcipRead;\n }\n set disableCcipRead(value) {\n this.#disableCcipRead = !!value;\n }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\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 }, 250);\n }\n return await perform;\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\", {\n action: \"sendCcipReadFetchRequest\",\n request,\n index: i,\n urls,\n });\n let errorMessage = \"unknown error\";\n const resp = await request.send();\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchResult\",\n request,\n result,\n });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchError\",\n request,\n result,\n });\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\", {\n reason: \"404_MISSING_RESOURCE\",\n transaction: tx,\n info: { url, errorMessage },\n });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages\n .map((m) => JSON.stringify(m))\n .join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx,\n info: { urls, errorMessages },\n });\n }\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\",\n });\n }\n // Sub-classes should override this and handle PerformActionRequest requests, calling\n // the super for any unhandled actions.\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 _getAddress(address) {\n return resolveAddress(address);\n }\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"latest\":\n case \"pending\":\n case \"safe\":\n case \"finalized\":\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 _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:\n 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 _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]);\n if (isPromise(addr)) {\n promises.push((async function () {\n request[key] = await addr;\n })());\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 () {\n request.blockTag = await blockTag;\n })());\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 = this._detectNetwork().then((network) => {\n this.emit(\"network\", network, null);\n return network;\n }, (error) => {\n // Reset the networkPromise on failure, so we will try again\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\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.networkId !== actual.networkId) {\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.networkId} => ${actual.networkId} `, \"NETWORK_ERROR\", {\n event: \"changed\",\n });\n }\n }\n return expected.clone();\n }\n async getEnergyPrice() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async getFeeData() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async estimateEnergy(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateEnergy\",\n 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 return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead &&\n isCallException(error) &&\n error.data &&\n attempt >= 0 &&\n blockTag === \"latest\" &&\n transaction.to != null &&\n dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to);\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\",\n transaction,\n 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\",\n transaction,\n info: { data: error.data, errorArgs: ccipArgs.errorArgs },\n });\n const tx = {\n to: txSender,\n data: concat([\n ccipArgs.selector,\n encodeBytes([ccipResult, ccipArgs.extraData]),\n ]),\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\", {\n action: \"receiveCcipReadCallResult\",\n transaction: Object.assign({}, tx),\n result,\n });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadCallError\",\n transaction: Object.assign({}, tx),\n error,\n });\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\",\n blockHash: block,\n 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\",\n blockTag,\n 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 effectiveEnergyPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.energyPrice == null && params.effectiveEnergyPrice == 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 effectiveEnergyPrice\");\n }\n params.effectiveEnergyPrice = tx.energyPrice;\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(networkId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\",\n });\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 _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 _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 _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n // Event API; sub-classes should override this; any supported\n // event filter will have been munged into an EventFilter\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 return new PollingBlockSubscriber(this);\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 _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\" &&\n emitArgs &&\n emitArgs.length > 0 &&\n 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 = {\n subscriber,\n tag,\n addressableMap,\n nameMap,\n started: false,\n listeners: [],\n };\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 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\n .map(({ listener }) => listener)\n .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 // Sub-classes should override this to shutdown any sockets, etc.\n // but MUST call this super.shutdown.\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 }\n get paused() {\n return this.#pausedState != null;\n }\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 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 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: \"\",\n urls: [],\n calldata: \"\",\n selector: \"\",\n extraData: \"\",\n 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\"\n .split(/,/)\n .map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map","/**\n * About Abstract Signer and subclassing\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/checks.js\";\nimport { getAddress } 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);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).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}\nexport class AbstractSigner {\n provider;\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.energyLimit == null) {\n pop.energyLimit = await this.estimateEnergy(pop);\n }\n // Populate the chain ID\n const network = await this.provider.getNetwork();\n if (pop.networkId != null) {\n const networkId = getBigInt(pop.networkId);\n assertArgument(networkId === network.networkId, \"transaction networkId mismatch\", \"tx.networkId\", tx.networkId);\n }\n else {\n pop.networkId = network.networkId;\n }\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n // We need to auto-detect the intended type of this transaction...\n if (feeData.energyPrice != null) {\n // Network doesn't support EIP-1559...\n // Populate missing fee data\n if (pop.energyPrice == null) {\n pop.energyPrice = feeData.energyPrice;\n }\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 //@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 estimateEnergy(tx) {\n return checkProvider(this, \"estimateEnergy\").estimateEnergy(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 return getAddress(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}\nexport class VoidSigner extends AbstractSigner {\n address;\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\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","/**\n * There are many awesome community services that provide Core\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in tht console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n}\n//# sourceMappingURL=community.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 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 _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\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\") ||\n error.operation !== \"xcb_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.networkId !== network.networkId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"xcb_getFilterChanges\", [\n filterId,\n ]);\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 this.#provider.send(\"xcb_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() {\n this.start();\n }\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 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(\"xcb_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(\"xcb_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 * About JSON-RPC...\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, 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\";\nimport { resolveAddress } from \"../address/checks.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) => {\n setTimeout(resolve, duration);\n });\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, // 100 requests\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);\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 xcb_sendTransaction uses 90000 energy; 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.energyLimit == null) {\n promises.push((async () => {\n tx.energyLimit = await this.provider.estimateEnergy({\n ...tx,\n from: this.address,\n });\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);\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(\"xcb_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 const checkTx = async () => {\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 // Wait another 4 seconds\n this.provider._setTimeout(() => {\n checkTx();\n }, 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);\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(\"xcb_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),\n 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(\"xcb_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(),\n password,\n null,\n ]);\n }\n async _legacySignMessage(_message) {\n const message = typeof _message === \"string\" ? toUtf8Bytes(_message) : _message;\n return await this.provider.send(\"xcb_sign\", [\n this.address.toLowerCase(),\n 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 #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no hard in sending it immeidately\n const stallTime = this._getOption(\"batchMaxCount\") === 1\n ? 0\n : 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 // console.log({payload})\n const result = await this._send(payload);\n // console.log({result})\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\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 return reject(makeError(\"no response from server\", \"BAD_DATA\", {\n value: result,\n info: { payload },\n }));\n }\n // The response is an error\n if (\"error\" in resp) {\n return reject(this.getRpcError(payload, resp));\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);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n // Make sure any static network is compatbile with the provided netwrok\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (staticNetwork) {\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 {\n assert(false, \"sub-classes must override _send\", \"UNSUPPORTED_OPERATION\", {\n operation: \"jsonRpcApiProvider._send\"\n });\n }\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 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 return network;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n return Network.from(getBigInt(await this.send(\"xcb_networkId\", [])));\n }\n // We are not ready yet; use the primitive _send\n const payload = {\n id: this.#nextId++,\n method: \"xcb_networkId\",\n params: [],\n jsonrpc: \"2.0\",\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n }\n catch (error) {\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 /**\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) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n console.log(\"JsonRpcProvider failed to startup; retry in 1s\");\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() {\n return this.#notReady == null;\n }\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 [\n \"networkId\",\n \"energyLimit\",\n \"energyPrice\",\n \"type\",\n \"nonce\",\n \"value\",\n ].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"energyLimit\") {\n dstKey = \"energy\";\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 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 \"networkId\":\n return { method: \"xcb_networkId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"xcb_blockNumber\", args: [] };\n case \"getEnergyPrice\":\n return { method: \"xcb_energyPrice\", args: [] };\n case \"getBalance\": {\n return {\n method: \"xcb_getBalance\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n }\n case \"getTransactionCount\":\n return {\n method: \"xcb_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getCode\":\n return {\n method: \"xcb_getCode\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getStorage\":\n return {\n method: \"xcb_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: \"xcb_sendRawTransaction\",\n args: [req.signedTransaction],\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"xcb_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions],\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"xcb_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions],\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"xcb_getTransactionByHash\",\n args: [req.hash],\n };\n case \"getTransactionReceipt\":\n return {\n method: \"xcb_getTransactionReceipt\",\n args: [req.hash],\n };\n case \"call\":\n return {\n method: \"xcb_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag],\n };\n case \"estimateEnergy\": {\n return {\n method: \"xcb_estimateEnergy\",\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: \"xcb_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an CoreBC-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 === \"xcb_estimateEnergy\" && 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 }\n if (method === \"xcb_call\" || method === \"xcb_estimateEnergy\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException(method === \"xcb_call\" ? \"call\" : \"estimateEnergy\", payload.params[0], result ? result.data : null);\n e.info = { error, payload };\n return e;\n }\n // Only estimateEnergy 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\" &&\n error.message.match(/user denied|corebc-user-denied/i)) {\n const actionMap = {\n xcb_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n xcb_signTypedData_v4: \"signTypedData\",\n xcb_signTransaction: \"signTransaction\",\n xcb_sendTransaction: \"sendTransaction\",\n xcb_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 === \"xcb_sendRawTransaction\" ||\n method === \"xcb_sendTransaction\") {\n const transaction = payload.params[0];\n if (message.match(/insufficient funds|base fee exceeds energy limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction,\n 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\", {\n transaction,\n info: { error },\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) &&\n message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction,\n info: { error },\n });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method,\n info: { transaction, info: { error } },\n });\n }\n }\n if (message.match(/the method .* does not exist/i)) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method,\n info: { error },\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error });\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 networkId?? purge on switch_networks\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve,\n 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(\"xcb_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(\"xcb_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n}\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n this.#pollingInterval = 4000;\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() {\n return this.#pollingInterval;\n }\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. xcb_networkId) 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\" &&\n value.message.match(\"reverted\") &&\n 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 * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/xcb_goerli\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AnkrProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"xcb_sendRawTransaction\") {\n if (error &&\n error.error &&\n error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n}\n//# sourceMappingURL=provider-ankr.js.map","/**\n * About Alchemy\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.alchemyapi.io\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AlchemyProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash),\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = trace[0].error === \"Reverted\";\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null, // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", {\n value: trace,\n });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map","/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https://cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map","function getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map","/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\nexport class SocketSubscriber {\n #provider;\n #filter;\n get filter() {\n return JSON.parse(this.#filter);\n }\n #filterId;\n #paused;\n #emitPromise;\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider\n .send(\"xcb_subscribe\", this.filter)\n .then((filterId) => {\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n this.#filterId.then((filterId) => {\n this.#provider.send(\"xcb_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\nexport class SocketBlockSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\nexport class SocketPendingSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n get logFilter() {\n return JSON.parse(this.#logFilter);\n }\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * SocketProvider...\n *\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n constructor(network) {\n super(network, { batchMaxCount: 1 });\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n \n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n \n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n // Sub-classes must call this for each message\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (\"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result,\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result.method === \"xcb_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n }\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map","import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network) {\n super(network);\n if (typeof url === \"string\") {\n this.#connect = () => {\n return new _WebSocket(url);\n };\n this.#websocket = this.#connect();\n }\n else if (typeof url === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n */\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map","/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret,\n });\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(networkId) {\n try {\n return new InfuraProvider(networkId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map","/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"corebc.quiknode.pro\";\n case \"arbitrum\":\n return \"corebc.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"corebc.arbitrum-goerli.quiknode.pro\";\n case \"matic\":\n return \"corebc.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"corebc.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"corebc.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"corebc.optimism-goerli.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(networkId) {\n try {\n return new QuickNodeProvider(networkId, this.token);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.token === defaultToken;\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map","/**\n * Explain all the nitty-gritty about the **FallbackProvider**.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { getBigInt, getNumber, assert, assertArgument, } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\nfunction getTime() {\n return new Date().getTime();\n}\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof value === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2,\n requests: 0,\n lateResponses: 0,\n errorResponses: 0,\n outOfSync: -1,\n unsupportedEvents: 0,\n rollingDuration: 0,\n score: 0,\n _network: null,\n _updateNumber: null,\n _totalTime: 0,\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + value.map(_normalize).join(\",\") + \"]\";\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{\" +\n keys\n .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`)\n .join(\",\") +\n \"}\");\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(value) {\n if (\"error\" in value) {\n const error = value.error;\n return { tag: _normalize(error), value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum &&\n (weight > bestWeight ||\n (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A Fallback Provider.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n quorum;\n eventQuorum;\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n constructor(providers, network) {\n super(network);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n this.quorum = 2; //Math.ceil(providers.length / 2);\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), \"quorum exceed provider wieght\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"networkId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"networkId\":\n return (await provider.getNetwork()).networkId;\n case \"estimateEnergy\":\n return await provider.estimateEnergy(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = \"blockHash\" in req ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getEnergyPrice\":\n return (await provider.getFeeData()).energyPrice;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => b.priority - a.priority);\n for (const config of allConfigs) {\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config,\n result: null,\n didBump: false,\n perform: null,\n staller: null,\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = getTime() - now;\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push(waitForSync(config, 0));\n promises.push((async () => {\n config._network = await config.provider.getNetwork();\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let networkId = null;\n for (const config of this.#configs) {\n const network = config._network;\n if (networkId == null) {\n networkId = network.networkId;\n }\n else if (network.networkId !== networkId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\",\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight,\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getEnergyPrice\":\n case \"estimateEnergy\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"networkId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`,\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: {\n request: req,\n results: Array.from(running).map((r) => stringify(r.result)),\n },\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => {\n try {\n const result = await provider._perform(req);\n return Object.assign(normalizeResult({ result }), { weight });\n }\n catch (error) {\n return Object.assign(normalizeResult({ error }), { weight });\n }\n }));\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) },\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n for (let i = 0; i < this.quorum; i++) {\n this.#addRunner(running, req);\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map","import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value &&\n typeof value.send === \"function\" &&\n typeof value.close === \"function\");\n}\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n if (typeof network === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if ((typeof network === \"string\" && network.match(/^wss?:/)) ||\n isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n const providers = [];\n if (options.alchemy !== \"-\") {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.ankr !== \"-\" && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.cloudflare !== \"-\") {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.infura !== \"-\") {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof projectId === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) {\n console.log(error);\n }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n */\n if (options.quicknode !== \"-\") {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) {\n console.log(error);\n }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\",\n });\n if (providers.length === 1) {\n return providers[0];\n }\n return new FallbackProvider(providers);\n}\n//# sourceMappingURL=default-provider.js.map","import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nexport class NonceManager extends AbstractSigner {\n signer;\n #noncePromise;\n #delta;\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n increment() {\n this.#delta++;\n }\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n constructor(core, network) {\n super(network, { batchMaxCount: 1 });\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await core.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [\n {\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message },\n },\n ];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `corebc-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `corebc-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"xcb_accounts\", []);\n if (typeof address === \"number\") {\n return accounts.length > address;\n }\n address = address.toLowerCase();\n return (accounts.filter((a) => a.toLowerCase() === address).length !== 0);\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n //const resp =\n await this.#request(\"xcb_requestAccounts\", []);\n //console.log(\"RESP\", resp);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n}\n//# sourceMappingURL=provider-browser.js.map","/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, {\n applicationId,\n applicationSecret,\n });\n }\n _getProvider(networkId) {\n try {\n return new PocketProvider(networkId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return this.applicationId === defaultApplicationId;\n }\n}\n//# sourceMappingURL=provider-pocket.js.map","const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map","import { getAddress } from \"../address/index.js\";\nimport { hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, resolveProperties, assert, assertArgument, } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n prefix;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor({ signingKey, prefix, provider, }) {\n super(provider);\n this.prefix = prefix;\n assertArgument(signingKey && typeof signingKey.sign === \"function\", \"invalid signingKey key\", \"signingKey\", \"[ REDACTED ]\");\n this.#signingKey = signingKey;\n const address = computeAddress(this.#signingKey, prefix);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() {\n return this.#signingKey;\n }\n /**\n * The private key for this wallet.\n */\n get privateKey() {\n return this.signingKey.privateKey;\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new BaseWallet({\n signingKey: this.#signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n async signTransaction(tx) {\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: tx.to || undefined,\n from: tx.from || undefined,\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress(tx.from) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n const unSignedSerialized = btx.unsignedSerialized;\n const unsignedHash = sha256(unSignedSerialized);\n // sha256(btx.unsignedSerialized)\n btx.signature = this.signingKey.sign(unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name },\n });\n const address = getAddress(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name,\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value));\n }\n}\n//# sourceMappingURL=base-wallet.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+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=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"en\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map","import { pbkdf2Sync } from \"../crypto/crypto.js\";\nimport utf8 from \"utf8\";\nexport function mnemonicToSeed(mnemonic, password) {\n if (!password) {\n password = \"\";\n }\n const t = generateSeed(mnemonic, password);\n return t.goldilock;\n}\nconst generateSeed = (mnemonic, password) => {\n const goldilockSaltPrefix = \"mnemonic\";\n const aesSaltPrefix = \"mnemonicfortheAESkey\";\n const goldilockSalt = utf8.encode(goldilockSaltPrefix + password);\n const aesSalt = utf8.encode(aesSaltPrefix + password);\n const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), goldilockSalt, 2048, 64, \"sha512\");\n const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), aesSalt, 2048, 64, \"sha512\");\n return {\n aes: aesKeySeed.toString(\"hex\"),\n goldilock: goldilockKey.toString(\"hex\"),\n };\n};\n//# sourceMappingURL=mnemonicToSeed.js.map","import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { legacySha256 } from \"../crypto/sha3.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return (((1 << bits) - 1) << (8 - bits)) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset++;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) &\n getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n return mnemonicToSeed(this.phrase, this.password);\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase({ phrase, password, wordlist, }) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingURL=mnemonic.js.map","/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof hexString === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = \"0\" + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof password === \"string\") {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = match[4] === \"!\";\n let cur = object;\n for (const comp of path.toLowerCase().split(\".\")) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof cur === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof cur === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof cur) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map","/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Core along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { CTR } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from \"../crypto/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nimport { computeAddress, extractPrefix } from \"../transaction/address.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = data.version != null ? parseInt(data.version) : 0;\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, iv);\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\",\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n assertArgument(computedMAC === spelunk(data, \"crypto.mac:string!\").toLowerCase(), \"incorrect password\", \"password\", \"[ REDACTED ]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = getAddress(data.address);\n const prefix = extractPrefix(address);\n if (computeAddress(privateKey, prefix) !== address) {\n throw new Error(\"address mismatch\");\n }\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-corebc.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-corebc.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-corebc.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n account.mnemonic = {\n path: spelunk(data, \"x-corebc.path:string\") || defaultPath,\n locale: spelunk(data, \"x-corebc.locale:string\") || \"en\",\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))),\n };\n }\n return account;\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof kdf === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n // Make sure N is a power of 2\n assertArgument(N > 0 && (N & (N - 1)) === 0, \"invalid kdf.N\", \"kdf.N\", N);\n assertArgument(r > 0 && p > 0, \"invalid kdf\", \"kdf\", kdf);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(algorithm === \"sha256\" || algorithm === \"sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return { name: \"pbkdf2\", salt, count, dkLen, algorithm };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = options.salt != null\n ? getBytes(options.salt, \"options.salt\")\n : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = 1 << 17, r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p) {\n p = options.scrypt.p;\n }\n }\n assertArgument(typeof N === \"number\" &&\n N > 0 &&\n Number.isSafeInteger(N) &&\n (BigInt(N) & BigInt(N - 1)) === BigInt(0), \"invalid scrypt N parameter\", \"options.N\", N);\n assertArgument(typeof r === \"number\" && r > 0 && Number.isSafeInteger(r), \"invalid scrypt r parameter\", \"options.r\", r);\n assertArgument(typeof p === \"number\" && p > 0 && Number.isSafeInteger(p), \"invalid scrypt p parameter\", \"options.p\", p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = options.iv != null ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = options.uuid != null\n ? getBytes(options.uuid, \"options.uuid\")\n : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, iv);\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = sha256(concat([macPrefix, ciphertext]));\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r,\n },\n mac: mac.substring(2),\n },\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = options.client != null ? options.client : `corebc/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = now.getUTCFullYear() +\n \"-\" +\n zpad(now.getUTCMonth() + 1, 2) +\n \"-\" +\n zpad(now.getUTCDate(), 2) +\n \"T\" +\n zpad(now.getUTCHours(), 2) +\n \"-\" +\n zpad(now.getUTCMinutes(), 2) +\n \"-\" +\n zpad(now.getUTCSeconds(), 2) +\n \".0Z\";\n const gethFilename = \"UTC--\" + timestamp + \"--\" + data.address;\n data[\"x-corebc\"] = {\n client,\n gethFilename,\n path,\n locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\",\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map","/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { dataSlice, defineProperties, getNumber, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\nimport { Ed448Goldilock } from \"../crypto/crypto.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// import { arrayify,\n// // hexDataSlice\n// } from \"../utils/data.js\";\n// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array {\n// const p = getBytes(password);\n// const s = getBytes(salt);\n// return getBytes(pbkdf2(p, s, 2048, 57, \"sha512\"));\n// }\n/**\n * The default derivation path for Core HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m\";\n// \"Bitcoin seed\"\n// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\n// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array {\n// b = getBytes(concat([b.slice(0, 53), \"0x00000000\"]));\n// b[0] &= 0xfc;\n// const c = new Uint8Array(57);\n// let hold = 0;\n// for (let i = 0; i < 57; i++) {\n// hold += a[i] + b[i];\n// c[i] = hold % 256;\n// hold = Math.floor(hold / 256);\n// }\n// return c;\n// };\nconst _guard = {};\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0 && (components[0] === \"m\" || node.depth > 0), \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n prefix;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n #seed;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) {\n super({\n signingKey,\n prefix,\n provider,\n });\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.publicKey });\n this.prefix = prefix;\n this.#seed = seed;\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint,\n fingerprint,\n path,\n index,\n depth,\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet({\n guard: _guard,\n signingKey: this.signingKey,\n parentFingerprint: this.parentFingerprint,\n path: this.path,\n index: this.index,\n depth: this.depth,\n seed: this.#seed,\n mnemonic: this.mnemonic,\n provider,\n prefix: this.prefix,\n });\n }\n #account() {\n const account = {\n address: this.address,\n privateKey: this.privateKey,\n };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy,\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, {\n progressCallback,\n });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() {\n return this.path != null;\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index));\n const newSigningKey = new SigningKey(newPrivateKey);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (_index & ~HardenedBit);\n if (_index & HardenedBit) {\n path += \"'\";\n }\n }\n return new HDNodeWallet({\n guard: _guard,\n signingKey: newSigningKey,\n parentFingerprint: this.fingerprint,\n path,\n index: _index,\n seed: this.#seed,\n depth: this.depth + 1,\n mnemonic: this.mnemonic,\n provider: this.provider,\n prefix: this.prefix,\n });\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed({ _seed, mnemonic, prefix, path, }) {\n const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0);\n const signingKey = new SigningKey(extendetPrivateKey);\n // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length })\n return new HDNodeWallet({\n seed: _seed,\n guard: _guard,\n signingKey,\n parentFingerprint: \"0x00000000\",\n path: path || defaultPath,\n index: 0,\n depth: 0,\n mnemonic,\n provider: null,\n prefix,\n });\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(prefix, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist);\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Create am HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, prefix, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n static mnemonicToSeed(mnemonic, password) {\n const seed = mnemonicToSeed(mnemonic, password);\n return seed;\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, password, path, wordlist, }) {\n if (!password) {\n password = \"\";\n }\n if (!path) {\n path = defaultPath;\n }\n if (!wordlist) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist });\n const _seed = mnemonic.computeSeed();\n return HDNodeWallet.#fromSeed({\n _seed,\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed({ seed, prefix, path, }) {\n return HDNodeWallet.#fromSeed({\n _seed: seed,\n mnemonic: null,\n path: path || defaultPath,\n prefix,\n });\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the acount at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map","/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { CBC, pkcs7Strip } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n/**\n * Before Core launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive xcb\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Core Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && encseed.length % 16 === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map","import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { defaultPath, HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson, } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { extractPrefix } from \"../transaction/address.js\";\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected\n * to %%provider%%.\n */\n constructor({ key, prefix, provider, }) {\n if (typeof key === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = typeof key === \"string\" ? new SigningKey(key) : key;\n super({\n signingKey,\n prefix,\n provider,\n });\n }\n connect(provider) {\n return new Wallet({\n key: this.signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n const address = account.address;\n const prefix = extractPrefix(address);\n if (\"mnemonic\" in account &&\n account.mnemonic &&\n account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path);\n if (wallet.address === account.address &&\n wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet({\n key: account.privateKey,\n prefix,\n });\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the avavilable\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(prefix, provider) {\n const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, provider, password, }) {\n const wallet = HDNodeWallet.fromPhrase({\n phrase,\n prefix,\n password,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n static fromSeed({ seed, prefix, provider, path, }) {\n const wallet = HDNodeWallet.fromSeed({\n seed,\n prefix,\n path: path || defaultPath,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map"],"names":["logger","stringify","arrayifyInteger","unarrayifyInteger","_encode","_decodeChildren","_decode","decode","hash","assertHash","assertExists","assertBytes","assertNumber","pbkdf2","sha256","u64","sha512","BN_0","BN_1","locked","getTime","_a","_guard","getGlobal","randomBytes","Buffer","removeHexPrefix","rotl","ripemd160","noble_ripemd160","crypto_random","scrypt","_nobleAsync","_nobleSync","H","N","secp256k1.getSharedSecret","secp256k1.ProjectivePoint","BN_2","passProperties","getValue","BN_MAX_UINT256","RLP.decode","RLP.encode","_sha256","internal","PanicReasons","copy","stall","defaultApiKey","getHost","defaultPath"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAG;;ACHvB,IAAI,sBAAsB,GAAG,KAAK,CAAC;AACnC,IAAI,aAAa,GAAG,KAAK,CAAC;AAC1B,MAAM,SAAS,GAAG;AAClB,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,GAAG,EAAE,CAAC;AACV,CAAC,CAAC;AACF,IAAI,SAAS,GAAG,SAAS,CAAC,SA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tC,QAAQ,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;AAC9B,KAAK;AACL,IAAI,IAAI,OAAO,GAAG;AAClB,QAAQ,OAAO,IAAI,CAAC,OAAO,CAAC;AAC5B,KAAK;AACL,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;AACpD,KAAK;AACL;;ACzBY,MAAC,SAAS,GAAG;AACzB,IAAI,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;AACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[7,8,9,10,11,12,13,14,15,33,37,40]} \ No newline at end of file +{"version":3,"file":"corebc.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../lib.esm/_version.js","../node_modules/bn.js/lib/bn.js","../lib.esm/logger/logger.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/bigNumber/bigNumber.js","../lib.esm/crypto/rlp.js","../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/_md.js","../node_modules/@noble/hashes/legacy.js","../node_modules/@noble/hashes/hmac.js","../node_modules/@noble/hashes/pbkdf2.js","../node_modules/@noble/hashes/sha2.js","../node_modules/@noble/hashes/sha3.js","../node_modules/bcrypto/lib/internal/assert.js","../node_modules/bcrypto/lib/internal/custom-browser.js","../node_modules/bcrypto/lib/js/bn.js","../node_modules/bcrypto/lib/bn-browser.js","../node_modules/bcrypto/lib/js/chacha20.js","../node_modules/bcrypto/lib/chacha20-browser.js","../node_modules/bcrypto/lib/internal/hmac.js","../node_modules/bcrypto/lib/js/sha256.js","../node_modules/bcrypto/lib/sha256-browser.js","../node_modules/bcrypto/lib/js/batch-rng.js","../node_modules/bcrypto/lib/js/elliptic.js","../node_modules/bcrypto/lib/js/random.js","../node_modules/bcrypto/lib/random-browser.js","../node_modules/bcrypto/lib/js/eddsa.js","../node_modules/bcrypto/lib/js/keccak.js","../node_modules/bcrypto/lib/keccak-browser.js","../node_modules/bcrypto/lib/shake.js","../node_modules/bcrypto/lib/shake256.js","../node_modules/bcrypto/lib/js/ed448.js","../node_modules/bcrypto/lib/ed448-browser.js","../lib.esm/crypto/browser-ed448.js","../lib.esm/utils/maths.js","../lib.esm/utils/base58.js","../lib.esm/utils/base64-browser.js","../lib.esm/utils/events.js","../lib.esm/utils/utf8.js","../lib.esm/utils/geturl-browser.js","../lib.esm/utils/fetch.js","../lib.esm/utils/fixednumber.js","../lib.esm/utils/rlp-decode.js","../lib.esm/utils/rlp-encode.js","../lib.esm/utils/units.js","../lib.esm/utils/uuid.js","../node_modules/bcrypto/lib/js/pbkdf2.js","../node_modules/bcrypto/lib/pbkdf2-browser.js","../node_modules/bcrypto/lib/js/sha3.js","../node_modules/bcrypto/lib/sha3-browser.js","../node_modules/bcrypto/lib/sha3-512.js","../lib.esm/crypto/ed448goldilock-browser.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/sha3.js","../lib.esm/address/index.js","../lib.esm/crypto/hmac.js","../lib.esm/crypto/ripemd160.js","../lib.esm/crypto/pbkdf2.js","../lib.esm/crypto/random.js","../node_modules/@noble/hashes/scrypt.js","../lib.esm/crypto/scrypt.js","../lib.esm/crypto/keccak.js","../lib.esm/crypto/signing-key.js","../lib.esm/crypto/signature.js","../lib.esm/crypto/index.js","../lib.esm/transaction/address.js","../lib.esm/abi/coders/abstract-coder.js","../lib.esm/abi/typed.js","../lib.esm/abi/coders/address.js","../lib.esm/abi/coders/anonymous.js","../lib.esm/abi/coders/array.js","../lib.esm/abi/coders/boolean.js","../lib.esm/abi/coders/bytes.js","../lib.esm/abi/coders/fixed-bytes.js","../lib.esm/abi/coders/null.js","../lib.esm/abi/coders/number.js","../lib.esm/abi/coders/string.js","../lib.esm/abi/coders/tuple.js","../lib.esm/hash/id.js","../lib.esm/constants/addresses.js","../lib.esm/constants/hashes.js","../lib.esm/constants/numbers.js","../lib.esm/constants/strings.js","../lib.esm/transaction/accesslist.js","../lib.esm/transaction/transaction.js","../lib.esm/hash/message.js","../lib.esm/hash/solidity.js","../lib.esm/hash/typed-data.js","../lib.esm/abi/fragments.js","../lib.esm/abi/abi-coder.js","../lib.esm/abi/bytes32.js","../lib.esm/abi/interface.js","../lib.esm/address/contract-address.js","../lib.esm/address/checks.js","../lib.esm/providers/provider.js","../lib.esm/contract/wrappers.js","../lib.esm/contract/contract.js","../lib.esm/contract/factory.js","../lib.esm/providers/format.js","../lib.esm/providers/plugins-network.js","../lib.esm/providers/network.js","../lib.esm/providers/subscriber-polling.js","../lib.esm/providers/abstract-provider.js","../lib.esm/providers/abstract-signer.js","../lib.esm/providers/community.js","../lib.esm/providers/subscriber-filterid.js","../lib.esm/providers/provider-jsonrpc.js","../lib.esm/providers/provider-ankr.js","../lib.esm/providers/provider-alchemy.js","../lib.esm/providers/provider-cloudflare.js","../lib.esm/providers/ws-browser.js","../lib.esm/providers/provider-socket.js","../lib.esm/providers/provider-websocket.js","../lib.esm/providers/provider-infura.js","../lib.esm/providers/provider-quicknode.js","../lib.esm/providers/provider-fallback.js","../lib.esm/providers/default-provider.js","../lib.esm/providers/signer-noncemanager.js","../lib.esm/providers/provider-browser.js","../lib.esm/providers/provider-pocket.js","../lib.esm/providers/provider-ipcsocket-browser.js","../lib.esm/wallet/base-wallet.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-en.js","../node_modules/utf8/utf8.js","../lib.esm/wallet/mnemonicToSeed.js","../lib.esm/wallet/mnemonic.js","../node_modules/aes-js/index.js","../lib.esm/wallet/utils.js","../lib.esm/wallet/json-keystore.js","../lib.esm/wallet/hdwallet.js","../lib.esm/wallet/json-crowdsale.js","../lib.esm/wallet/wallet.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/wordlists-browser.js","../lib.esm/cip/custom-units.js","../lib.esm/cip/index.js","../lib.esm/ipfs/index.js"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","/** The current version of corebc; keep in sync with package.json. */\nexport const version = \"0.4.1\";\n//# sourceMappingURL=_version.js.map","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n i++;\n }\n\n // Clear words above the requested width so the result stays below 2 ** width\n for (; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n if (num === 0) {\n this.length = 1;\n this._normSign();\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.mod.abs();\n\n var half = num.abs().iushrn(1);\n var r2 = num.words[0] & 1;\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up, away from zero\n var up = new BN(1);\n up.negative = this.negative ^ num.negative;\n return dm.div.iadd(up);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map","import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map","/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return new Uint8Array(result);\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return new Uint8Array(result);\n }\n if (isBytes(value)) {\n return new Uint8Array(value);\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { isBytes, hexlify, isHexString, } from \"../utils/data.js\";\nvar BN = _BN.BN;\nconst logger = new Logger(\"bigNumber/0.0.1\");\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null &&\n (BigNumber.isBigNumber(value) ||\n (typeof value === \"number\" && value % 1 === 0) ||\n (typeof value === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n typeof value === \"bigint\" ||\n isBytes(value)));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n _hex;\n _isBigNumber;\n constructor(constructorGuard, hex) {\n logger.checkNew(new.target, BigNumber);\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\",\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division by zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return this._hex[0] === \"-\";\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n // @ts-ignore\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString(),\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof value === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof value === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof anyValue === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof hex === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof hex === \"string\") {\n if (isHexString(hex) ||\n (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\n// @ts-ignore\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof value !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\n// @ts-ignore\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\n// @ts-ignore\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return new BN(\"-\" + hex.substring(3), 16);\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return new BN(value, 36).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return new BN(value, 16).toString(36);\n}\n//# sourceMappingURL=bigNumber.js.map","\"use strict\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify, isBytesLike } from \"../utils/data.js\";\nconst logger = new Logger(\"rlp/0.0.1\");\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return 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 _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 if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(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}\nexport function encode(object) {\n return hexlify(_encode(object));\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 if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: 1 + length, result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\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 if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: 1 + length, result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=rlp.js.map","const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();\nconst _32n = /* @__PURE__ */ BigInt(32);\n// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high\n// }` to match little-endian word order rather than the property names.\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array\n// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS\n// bitwise results back to uint32 first, and little-endian callers must swap.\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers\n// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below\n// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes).\nconst fromNumH = (n) => (n / 2 ** 32) | 0;\nconst fromNumL = (n) => n >>> 0;\n// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call\n// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`.\nfunction setU64FromNum(view, byteOffset, n, isLE) {\n const h = fromNumH(n);\n const l = fromNumL(n);\n view.setUint32(byteOffset, isLE ? l : h, isLE);\n view.setUint32(byteOffset + 4, isLE ? h : l, isLE);\n}\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s) => h >>> s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.\nconst rotr32H = (_h, l) => l;\n// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.\nconst rotr32L = (h, _l) => h;\n// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps\n// local copies so V8 inlines them into keccakP.\n// Add two split 64-bit words and return the split `{ h, l }` sum.\n// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out\n// of the low sum and instead use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\n// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\n// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\n// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, fromNumH, fromNumL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, setU64FromNum, shrSH, shrSL, split, toBig };\n","/**\n * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.\n * @param a - value to test\n * @returns `true` when the value is a Uint8Array-compatible view.\n * @example\n * Check whether a value is a Uint8Array-compatible view.\n * ```ts\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n// Shared error-message prefix builder. Only called on throw paths, so assert\n// success paths never pay for the string concatenation.\nconst atitle = (title) => (title ? `\"${title}\" ` : '');\n/**\n * Asserts something is a non-negative integer.\n * @param n - number to validate\n * @param title - label included in thrown errors\n * @returns The validated number.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a non-negative integer option.\n * ```ts\n * anumber(32, 'length');\n * ```\n */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number')\n throw new TypeError(atitle(title) + 'expected number, got ' + typeof n);\n if (!Number.isSafeInteger(n) || n < 0)\n throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n);\n return n;\n}\n/**\n * Asserts something is a boolean.\n * @param value - value to validate\n * @param title - label included in thrown errors\n * @returns The validated boolean.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a boolean option.\n * ```ts\n * abool(true, 'enableXOF');\n * ```\n */\nexport function abool(value, title = '') {\n if (typeof value !== 'boolean')\n throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);\n return value;\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - value to validate\n * @param length - optional exact length constraint\n * @param title - label included in thrown errors\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate that a value is a byte array.\n * ```ts\n * abytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function abytes(value, length, title = '') {\n // Success path first: this runs at the start of every update() / digestInto(), and the\n // common `abytes(data)` form must not pay for length handling it does not use.\n if (isBytes(value) && (length === undefined || value.length === length))\n return value;\n // Error path: recompute freely to build the exact message.\n if (length !== undefined)\n anumber(length, 'length');\n const bytes = isBytes(value);\n const ofLen = length !== undefined ? ` of length ${length}` : '';\n const got = bytes ? `length=${value.length}` : `type=${typeof value}`;\n const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Asserts something is a wrapped hash constructor.\n * @param h - hash constructor to validate\n * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}\n * @throws On invalid hash metadata ranges or values. {@link RangeError}\n * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}\n * @example\n * Validate a callable hash wrapper.\n * ```ts\n * import { ahash } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('expected hash wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1 || h.blockLen < 1)\n throw new Error('hash blockLen / outputLen must be >= 1');\n}\nconst aobject = (value, label) => {\n if (value === null || typeof value !== 'object' || Array.isArray(value))\n throw new TypeError((label === 'object' ? '' : `\"${label}\" `) + 'expected object, got type=' + typeof value);\n};\nconst aopts = (value, label) => {\n aobject(value, label);\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null)\n throw new TypeError(`\"${label}\" expected plain object`);\n // Object.assign() treats an own \"__proto__\" source key as a write to the target's legacy\n // prototype setter. Reject it before merging so inherited option values cannot be injected.\n if (Object.hasOwn(value, '__proto__'))\n throw new TypeError(`\"${label}.__proto__\" is not allowed`);\n};\n/**\n * Asserts a hash instance has not been destroyed or finished.\n * @param instance - hash instance to validate\n * @param checkFinished - whether to reject finalized instances\n * @throws If the hash instance has already been destroyed or finalized. {@link Error}\n * @example\n * Validate that a hash instance is still usable.\n * ```ts\n * import { aexists } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aexists(hash);\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their\n // truthiness is checked - re-validating their type per call was pure hot-path overhead.\n if (instance.destroyed)\n throw new Error('hash was destroyed');\n if (checkFinished && instance.finished)\n throw new Error('digest() was already called');\n}\n/**\n * Asserts output is a sufficiently-sized byte array.\n * @param out - destination buffer\n * @param instance - hash instance providing output length\n * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a caller-provided digest buffer.\n * ```ts\n * import { aoutput } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aoutput(new Uint8Array(hash.outputLen), hash);\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast\n // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call.\n const min = instance.outputLen;\n if (!(out.length >= min)) {\n throw new RangeError('\"output\" expected length >= ' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed array view to Uint32Array.\n * `arr.byteOffset` must already be 4-byte aligned or the platform\n * Uint32Array constructor will throw.\n * @param arr - source typed array\n * @returns Uint32Array view over the same buffer.\n * @example\n * Reinterpret a byte array as 32-bit words.\n * ```ts\n * u32(new Uint8Array(8));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Zeroizes typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros\n * @example\n * Zeroize sensitive buffers in place.\n * ```ts\n * clean(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/**\n * Creates a DataView for byte-level manipulation.\n * @param arr - source typed array\n * @returns DataView over the same buffer region.\n * @example\n * Create a DataView over an existing buffer.\n * ```ts\n * createView(new Uint8Array(4));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Rotate-right operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the right.\n * ```ts\n * rotr(0x12345678, 8);\n * ```\n */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Rotate-left operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the left.\n * ```ts\n * rotl(0x12345678, 8);\n * ```\n */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/**\n * Byte-swap operation for uint32 values.\n * @param word - source word\n * @returns Word with reversed byte order.\n * @example\n * Reverse the byte order of a 32-bit word.\n * ```ts\n * byteSwap(0x11223344);\n * ```\n */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\n/**\n * Byte-swaps every word of a Uint32Array in place.\n * @param arr - array to mutate\n * @returns The same array after mutation; callers pass live state arrays here.\n * @example\n * Reverse the byte order of every word in place.\n * ```ts\n * byteSwap32(new Uint32Array([0x11223344]));\n * ```\n */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n/**\n * Conditionally byte-swaps a Uint32Array on big-endian platforms.\n * @param u - array to normalize for host endianness\n * @returns Original or byte-swapped array depending on platform endianness.\n * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.\n * @example\n * Normalize a word array for host endianness.\n * ```ts\n * swap32IfBE(new Uint32Array([0x11223344]));\n * ```\n */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\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}\n// Strict ASCII nibble parser: non-ASCII hex lookalikes are rejected as undefined.\n// ASCII codes: '0'..'9' = 48..57, 'A'..'F' = 65..70, 'a'..'f' = 97..102.\n// prettier-ignore\nfunction asciiToBase16(ch) {\n return ch >= 48 && ch <= 57 ? ch - 48 // '2' => 50-48\n : ch >= 65 && ch <= 70 ? ch - (65 - 10) // 'B' => 66-(65-10)\n : ch >= 97 && ch <= 102 ? ch - (97 - 10) // 'b' => 98-(97-10)\n : undefined;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi)); // parse first char, multiply it by 16\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); // parse second char\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // example: 'A9' => 10*16 + 9\n }\n return array;\n}\n/**\n * Yields to the host task scheduler so timers, I/O, and rendering can make progress.\n * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback.\n * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so\n * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while\n * still allowing other event-loop work to proceed.\n * @param onReject - optional cleanup invoked only if the host yield fails\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport function nextTick(onReject) {\n const host = globalThis;\n if (typeof host.scheduler?.yield === 'function') {\n const promise = host.scheduler.yield();\n // Keep the original scheduler rejection; this handler exists only for cleanup.\n if (onReject)\n promise.catch(onReject);\n return promise;\n }\n return new Promise((resolve) => host.setTimeout(resolve, 0));\n}\n/**\n * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @param onReject - optional cleanup invoked only if a host yield fails\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb, onReject) {\n anumber(iters, 'iters');\n anumber(tick, 'tick');\n if (typeof cb !== 'function')\n throw new TypeError('callback must be a function');\n // Callback is synchronous by contract; asyncLoop only yields between sync work windows.\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick(onReject);\n // Track only synchronous work time; scheduler delay after yielding is outside our budget.\n ts = Date.now();\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n const encoded = new TextEncoder().encode(str);\n try {\n // Copy into the current realm for Firefox extension contexts. Callers that own the returned\n // buffer can then wipe it independently of TextEncoder's temporary result.\n return new Uint8Array(encoded); // https://bugzil.la/1681809\n }\n finally {\n clean(encoded);\n }\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Validates declared required and optional field types on a plain object.\n * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct\n * one-line guards such as `abytes()`, `abool()`, or `anumber()` instead.\n * @param object - object to validate\n * @param fields - map of required field names to expected types\n * @param optFields - map of optional field names to expected types\n * @param title - label included in thrown errors\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate required and optional option fields.\n * ```ts\n * validateObject({ N: 1024, dkLen: 32 }, { N: 'number' }, { dkLen: 'number' });\n * ```\n */\nexport const validateObject = (object, fields = {}, optFields = {}, title = 'object') => {\n aobject(object, title);\n aobject(fields, 'fields');\n aobject(optFields, 'optFields');\n function checkField(fieldName, expectedType, isOpt) {\n const label = title === 'object' ? `param \"${String(fieldName)}\"` : `\"${title}.${String(fieldName)}\"`;\n // Config fields must be explicit own properties. Optional inherited values are rejected too\n // because callers keep reading the same options object after validation.\n const val = object[fieldName];\n // Runtime objects such as Field instances intentionally satisfy required method slots\n // via their shared prototype.\n if (!Object.hasOwn(object, fieldName) &&\n (isOpt ? val !== undefined : expectedType !== 'function')) {\n throw new TypeError(`${label} is invalid: expected own property`);\n }\n if (isOpt && val === undefined)\n return;\n const current = typeof val;\n if (current !== expectedType || val === null)\n throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);\n }\n const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));\n iter(fields, false);\n iter(optFields, true);\n};\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @param title - label included in thrown override errors\n * @returns Fresh merged option object with a null prototype.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts, title = 'opts') {\n aopts(defaults, 'defaults');\n if (opts !== undefined)\n aopts(opts, title);\n // Callers read optional fields directly, so omitted values must not fall through to ambient\n // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).\n const merged = Object.assign(Object.create(null), defaults, opts);\n return merged;\n}\n/**\n * Creates a callable hash function from a stateful class constructor.\n * @param hashCons - hash constructor or factory\n * @param info - optional metadata such as DER OID\n * @returns Frozen callable hash wrapper with `.create()`.\n * Wrapper construction eagerly calls `hashCons(undefined)` once to read\n * `outputLen` / `blockLen`, so constructor side effects happen at module\n * init time.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Wrap a stateful hash constructor into a callable helper.\n * ```ts\n * import { createHasher } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const wrapped = createHasher(sha256.create, { oid: sha256.oid });\n * wrapped(new Uint8Array([1]));\n * ```\n */\nexport function createHasher(hashCons, info = {}) {\n if (typeof hashCons !== 'function')\n throw new TypeError('\"hashCons\" expected function, got type=' + typeof hashCons);\n info = checkOpts({}, info, 'info');\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.canXOF = tmp.canXOF;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 §10.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.\n * @param suffix - final OID byte for the selected hash.\n * The helper accepts any byte even though only the documented NIST hash\n * suffixes are meaningful downstream.\n * @returns Object containing the DER-encoded OID.\n * @example\n * Build OID metadata for a NIST hash.\n * ```ts\n * oidNist(0x01);\n * ```\n */\nexport const oidNist = (suffix) => ({\n // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.\n // Larger suffix values would need base-128 OID encoding and a different length byte.\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { setU64FromNum } from \"./_u64.js\";\nimport { abytes, aexists, aoutput, createView } from \"./utils.js\";\n/**\n * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.\n * Returns bits from `b` when `a` is set, otherwise from `c`.\n * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never\n * set the same bit.\n * @param a - selector word\n * @param b - word chosen when selector bit is set\n * @param c - word chosen when selector bit is clear\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit choice primitive.\n * ```ts\n * Chi(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/**\n * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.\n * Returns bits shared by at least two inputs.\n * @param a - first input word\n * @param b - second input word\n * @param c - third input word\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit majority primitive.\n * ```ts\n * Maj(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit\n * strings with partial-byte tails.\n * @param blockLen - internal block size in bytes\n * @param outputLen - digest size in bytes\n * @param padOffset - trailing length field size in bytes\n * @param isLE - whether length and state words are encoded in little-endian\n * @example\n * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.\n * ```ts\n * import { _SHA1 } from '@noble/hashes/legacy.js';\n * const hash = new _SHA1();\n * hash.update(new Uint8Array([97, 98, 99]));\n * hash.digest();\n * ```\n */\nexport class HashMD {\n blockLen;\n outputLen;\n canXOF = false;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n let processed = false;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path only when there is no buffered partial block: `take === blockLen` implies\n // `this.pos === 0`, so we can process full blocks directly from the input view.\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n processed = true;\n continue;\n }\n // When the whole input is buffered in one go (common for short messages), passing `data`\n // directly avoids allocating a subarray view.\n buffer.set(pos === 0 && take === len ? data : 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 processed = true;\n }\n }\n this.length += data.length;\n // Shared schedule buffers only pick up input-derived words inside process(); if everything\n // was buffered without processing, there is nothing to zero.\n if (processed)\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(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, then zero-pad the rest of the block\n buffer[pos++] = 0b10000000;\n buffer.fill(0, pos);\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n buffer.fill(0);\n }\n // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from\n // the padding fill above, and JS will overflow before user input can make that half non-zero.\n // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an\n // integer below 2**53, so the split inside the helper stays exact).\n setU64FromNum(view, blockLen - 8, this.length * 8, isLE);\n this.process(view, 0);\n // The final block above is processed outside update(), so the shared message-schedule\n // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest().\n this.roundClean();\n // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.\n const oview = out === buffer ? view : createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n const outLen = len / 4;\n const state = this.get();\n // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state.\n if (len % 4 || outLen > state.length)\n throw new Error('invalid outputLen');\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 // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return\n // fresh bytes to the caller.\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneIntoMeta(to) {\n const { buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and\n // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it.\n if (pos)\n to.buffer.set(buffer); // Avoid a hot modulo guard.\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the\n * square roots of the first eight prime numbers. Exported as a shared table; callers must treat\n * it as read-only because constructors copy words from it by index. */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state `H(0)` from RFC 6234 §6.1. Exported as a shared table; callers must\n * treat it as read-only because constructors copy words from it by index. */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the ninth\n * through sixteenth prime numbers. Exported as a shared table; callers must treat it as read-only\n * because constructors copy halves from it by index. */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first\n * eight prime numbers. Exported as a shared table; callers must treat it as read-only because\n * constructors copy halves from it by index. */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n","/**\n\nSHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions.\nRFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors,\nnot the base RIPEMD-160 compression spec.\nDon't use them in a new protocol. What \"weak\" means:\n\n- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.\n- No practical pre-image attacks (only theoretical, 2^123.4)\n- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151\n * @module\n */\nimport { Chi, HashMD, Maj } from \"./_md.js\";\nimport { clean, createHasher, rotl } from \"./utils.js\";\n/** Initial SHA-1 state from RFC 3174 §6.1. */\nconst SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\n// Reusable 80-word SHA-1 message schedule buffer.\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA1 legacy hash class. */\nexport class _SHA1 extends HashMD {\n A = SHA1_IV[0] | 0;\n B = SHA1_IV[1] | 0;\n C = SHA1_IV[2] | 0;\n D = SHA1_IV[3] | 0;\n E = SHA1_IV[4] | 0;\n constructor() {\n super(64, 20, 8, false);\n }\n get() {\n const { A, B, C, D, E } = this;\n return [A, B, C, D, E];\n }\n set(A, B, C, D, E) {\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 }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n SHA1_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 80; i++)\n SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n // Compression function main loop, 80 rounds\n let { A, B, C, D, E } = this;\n for (let i = 0; i < 80; i++) {\n let F, K;\n if (i < 20) {\n F = Chi(B, C, D);\n K = 0x5a827999;\n }\n else if (i < 40) {\n F = B ^ C ^ D;\n K = 0x6ed9eba1;\n }\n else if (i < 60) {\n F = Maj(B, C, D);\n K = 0x8f1bbcdc;\n }\n else {\n F = B ^ C ^ D;\n K = 0xca62c1d6;\n }\n const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0;\n E = D;\n D = C;\n C = rotl(B, 30);\n B = A;\n A = T;\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 this.set(A, B, C, D, E);\n }\n roundClean() {\n clean(SHA1_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA1.\n * ```ts\n * sha1(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha1 = /* @__PURE__ */ createHasher(() => new _SHA1());\n/** RFC 1321 `T[i]` uses `floor(2^32 * abs(sin(i)))`; this is the shared `2^32` scale factor. */\nconst p32 = /* @__PURE__ */ Math.pow(2, 32);\n/** RFC 1321 `T[1..64]` table. */\nconst K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));\n/** MD5 initial state from RFC 1321, stored as 4 u32 words. */\nconst MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);\n// Reusable 16-word MD5 message block buffer.\nconst MD5_W = /* @__PURE__ */ new Uint32Array(16);\n// RFC 1321 §3.4 per-round rotate amounts, flattened to 64 entries so the round loop\n// avoids allocating a 4-element array literal every round (measured ~5% of md5).\nconst MD5_SHIFTS = /* @__PURE__ */ (() => {\n const S = [\n [7, 12, 17, 22],\n [5, 9, 14, 20],\n [4, 11, 16, 23],\n [6, 10, 15, 21],\n ];\n return Uint8Array.from({ length: 64 }, (_, i) => S[Math.floor(i / 16)][i % 4]);\n})();\n/** Internal MD5 legacy hash class. */\nexport class _MD5 extends HashMD {\n A = MD5_IV[0] | 0;\n B = MD5_IV[1] | 0;\n C = MD5_IV[2] | 0;\n D = MD5_IV[3] | 0;\n constructor() {\n super(64, 16, 8, true);\n }\n get() {\n const { A, B, C, D } = this;\n return [A, B, C, D];\n }\n set(A, B, C, D) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n MD5_W[i] = view.getUint32(offset, true);\n // Compression function main loop, 64 rounds\n let { A, B, C, D } = this;\n for (let i = 0; i < 64; i++) {\n let F, g;\n if (i < 16) {\n F = Chi(B, C, D);\n g = i;\n }\n else if (i < 32) {\n // RFC 1321 round 2 uses G(B,C,D) = (B & D) | (C & ~D), which is `Chi(D, B, C)`.\n F = Chi(D, B, C);\n g = (5 * i + 1) % 16;\n }\n else if (i < 48) {\n F = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n }\n else {\n F = C ^ (B | ~D);\n g = (7 * i) % 16;\n }\n F = F + A + K[i] + MD5_W[g];\n A = D;\n D = C;\n C = B;\n B = B + rotl(F, MD5_SHIFTS[i]);\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 this.set(A, B, C, D);\n }\n roundClean() {\n clean(MD5_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.\n * MD5 architecture is similar to SHA1, with some differences:\n * - Reduced output length: 16 bytes (128 bit) instead of 20\n * - 64 rounds, instead of 80\n * - Little-endian: could be faster, but will require more code\n * - Non-linear index selection: huge speed-up for unroll\n * - Per round constants: more memory accesses, additional speed-up for unroll\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with MD5.\n * ```ts\n * md5(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const md5 = /* @__PURE__ */ createHasher(() => new _MD5());\n// RIPEMD-160\n// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables.\nconst Rho160 = /* @__PURE__ */ Uint8Array.from([\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n]);\nconst Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();\nconst Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();\n// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds.\nconst idxLR = /* @__PURE__ */ (() => {\n const L = [Id160];\n const R = [Pi160];\n const res = [L, R];\n for (let i = 0; i < 4; i++)\n for (let j of res)\n j.push(j[i].map((k) => Rho160[k]));\n return res;\n})();\nconst idxL = /* @__PURE__ */ (() => idxLR[0])();\nconst idxR = /* @__PURE__ */ (() => idxLR[1])();\n// const [idxL, idxR] = idxLR;\n// Base per-group shift table before the left/right message-order permutations are applied.\nconst shifts160 = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => Uint8Array.from(i));\nconst shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));\nconst shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));\n// Five left-lane additive constants for RIPEMD-160.\nconst Kl160 = /* @__PURE__ */ Uint32Array.from([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\n// Five right-lane additive constants for RIPEMD-160.\nconst Kr160 = /* @__PURE__ */ Uint32Array.from([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range\n// inputs currently fall through to the group-4 branch.\nfunction ripemd_f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n if (group === 1)\n return (x & y) | (~x & z);\n if (group === 2)\n return (x | ~y) ^ z;\n if (group === 3)\n return (x & z) | (y & ~z);\n return x ^ (y | ~z);\n}\n// Reusable 16-word RIPEMD-160 message block buffer.\nconst BUF_160 = /* @__PURE__ */ new Uint32Array(16);\n/**\n * Internal RIPEMD-160 legacy hash class.\n * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification.\n */\nexport class _RIPEMD160 extends HashMD {\n h0 = 0x67452301 | 0;\n h1 = 0xefcdab89 | 0;\n h2 = 0x98badcfe | 0;\n h3 = 0x10325476 | 0;\n h4 = 0xc3d2e1f0 | 0;\n constructor() {\n super(64, 20, 8, true);\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF_160[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order.\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n clean(BUF_160);\n }\n destroy() {\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a legacy hash function from 1990s.\n * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point\n * at the base RIPEMD-160 references.\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html}\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf}\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with RIPEMD-160.\n * ```ts\n * ripemd160(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160());\n","/**\n * HMAC: RFC2104 message authentication code.\n * @module\n */\nimport { abytes, aexists, ahash, aoutput, clean, } from \"./utils.js\";\n/**\n * Internal class for HMAC.\n * Accepts any byte key, although RFC 2104 §3 recommends keys at least\n * `HashLen` bytes long.\n */\nexport class _HMAC {\n oHash;\n iHash;\n blockLen;\n outputLen;\n canXOF = false;\n finished = false;\n destroyed = false;\n constructor(hash, key) {\n ahash(hash);\n abytes(key, undefined, 'key');\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('expected Hash instance');\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 the first block) of the outer hash here,\n // 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 clean(pad);\n }\n update(buf) {\n aexists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n const buf = out.subarray(0, this.outputLen);\n // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before\n // overwriting that same prefix with the final tag, leaving any oversized tail untouched.\n this.iHash.digestInto(buf);\n this.oHash.update(buf);\n this.oHash.digestInto(buf);\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 the key\n // is already in state and we don't know it.\n to ||= Object.create(Object.getPrototypeOf(this), {});\n const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.canXOF = canXOF;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\nexport const hmac = /* @__PURE__ */ (() => {\n const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest());\n hmac_.create = (hash, key) => new _HMAC(hash, key);\n return hmac_;\n})();\n","/**\n * PBKDF (RFC 2898). Can be used to create a key from password and salt.\n * @module\n */\nimport { hmac } from \"./hmac.js\";\n// prettier-ignore\nimport { ahash, anumber, asyncLoop, checkOpts, clean, createView, kdfInputToBytes } from \"./utils.js\";\n// Common validation and per-call state setup for sync/async functions.\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n ahash(hash);\n const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);\n const { c, dkLen, asyncTick } = opts;\n anumber(c, 'c');\n anumber(dkLen, 'dkLen');\n anumber(asyncTick, 'asyncTick');\n if (c < 1)\n throw new Error('\"c\" (iterations) must be >= 1');\n // RFC 8018 §5.2 defines `dkLen` as \"a positive integer\".\n if (dkLen < 1)\n throw new Error('\"dkLen\" must be >= 1');\n // RFC 8018 §5.2 step 1 requires rejecting oversize `dkLen`\n // before allocating the destination buffer.\n if (dkLen > (2 ** 32 - 1) * hash.outputLen)\n throw new Error('derived key too long');\n const p = kdfInputToBytes(_password, 'password');\n try {\n const s = kdfInputToBytes(_salt, 'salt');\n try {\n // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n const DK = new Uint8Array(dkLen);\n const { iHash, oHash, outputLen } = hmac.create(hash, p);\n // Drive keyed hashes directly; the wrapper is only needed to initialize their HMAC midstates.\n const u = new Uint8Array(outputLen);\n const eng = pbkdf2Engine(iHash, oHash, s, u);\n return { c, dkLen, asyncTick, DK, outputLen, eng };\n }\n finally {\n // Uint8Array inputs belong to the caller; only wipe our UTF-8 conversion.\n if (typeof _salt === 'string')\n clean(s);\n }\n }\n finally {\n if (typeof _password === 'string')\n clean(p);\n }\n}\n// Per-call PRF driver writes U1 into both `u` and `Ti`, then later digests into `u`;\n// shared by the sync and async variants.\nfunction pbkdf2Engine(iHash, oHash, salt, u) {\n const counter = new Uint8Array(4);\n const view = createView(counter);\n // Full clones retain tree/config state; absorb salt before async yields without cloning input.\n const salted = iHash._cloneInto().update(salt);\n // u1() overwrites the worker before reading it. Seed from the outer midstate so a long salt\n // cannot pre-populate a tree stack that the first reset would abandon without wiping.\n const work = oHash._cloneInto();\n const iClone = iHash._cloneInto; // Capture before mixed feedback can materialize state tuples.\n const oClone = oHash._cloneInto;\n return {\n u1: (ti, Ti) => {\n view.setInt32(0, ti, false);\n salted._cloneInto(work).update(counter).digestInto(u);\n oHash._cloneInto(work).update(u).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n },\n // Whole `F` inner loop for the sync variant: one optimized function owns the hot loop.\n rounds: (c, Ti) => {\n for (let ui = 1; ui < c; ui++) {\n iClone.call(iHash, work).update(u).digestInto(u);\n oClone.call(oHash, work).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n }\n },\n output: (DK) => {\n // Keyed templates and derived worker states are secret material.\n iHash.destroy();\n oHash.destroy();\n salted.destroy();\n work.destroy();\n // Shared sync/async cleanup point: wipe transient PRF state\n // while preserving the derived key buffer.\n clean(u);\n return DK;\n },\n };\n}\n/**\n * PBKDF2-HMAC: RFC 8018 key derivation function.\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated;\n * JS string inputs are UTF-8 encoded first\n * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first\n * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,\n * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}.\n * @returns Derived key bytes.\n * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error}\n * @example\n * PBKDF2-HMAC: RFC 2898 key derivation function.\n * ```ts\n * import { pbkdf2 } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });\n * ```\n */\nexport function pbkdf2(hash, password, salt, opts) {\n const { c, dkLen, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) {\n // Ti = F(Password, Salt, c, i)\n // The last Ti view can be shorter than hLen, which applies\n // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies.\n const Ti = DK.subarray(pos, pos + outputLen);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n eng.u1(ti, Ti);\n // Uc = PRF(Password, Uc−1); Ti ^= Uc\n eng.rounds(c, Ti);\n }\n return eng.output(DK);\n}\n/**\n * PBKDF2-HMAC: RFC 8018 key derivation function. Async version.\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated;\n * JS string inputs are UTF-8 encoded first\n * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first\n * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,\n * must be `>= 1` per RFC 8018 §5.2. `asyncTick` is only a local\n * scheduler-yield knob for this JS wrapper, not part of RFC 8018.\n * See {@link Pbkdf2Opt}.\n * @returns Promise resolving to derived key bytes.\n * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error}\n * @example\n * PBKDF2-HMAC: RFC 2898 key derivation function.\n * ```ts\n * import { pbkdf2Async } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 });\n * ```\n * @example\n * Tune the async PBKDF2 scheduler for short UI tasks.\n * ```ts\n * import { pbkdf2Async } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = await pbkdf2Async(sha256, 'password', 'salt', {\n * dkLen: 32,\n * c: 32,\n * asyncTick: 1,\n * });\n * ```\n */\nexport async function pbkdf2Async(hash, password, salt, opts) {\n const { c, dkLen, asyncTick, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts);\n // Reuse normal state destruction, then wipe the incomplete output if a host yield aborts.\n const abort = () => {\n eng.output(DK);\n clean(DK);\n };\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) {\n // Ti = F(Password, Salt, c, i)\n // The last Ti view can be shorter than hLen, which applies\n // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies.\n const Ti = DK.subarray(pos, pos + outputLen);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n eng.u1(ti, Ti);\n await asyncLoop(c - 1, asyncTick, () => {\n // Uc = PRF(Password, Uc−1)\n eng.rounds(2, Ti); // c=2 runs exactly one PRF iteration per callback.\n }, abort);\n }\n return eng.output(DK);\n}\n","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\n/**\n * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits\n * of the cube roots of the first 64 primes (2..311).\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\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/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */\nclass SHA2_32B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and makes sha256 3x slower (measured).\n A = 0;\n B = 0;\n C = 0;\n D = 0;\n E = 0;\n F = 0;\n G = 0;\n H = 0;\n constructor(outputLen, IV) {\n super(64, outputLen, 8, false);\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 _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\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 clean(SHA256_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */\nexport class _SHA256 extends SHA2_32B {\n constructor() {\n super(32, SHA256_IV);\n }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */\nexport class _SHA224 extends SHA2_32B {\n constructor() {\n super(28, SHA224_IV);\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// SHA-384 / SHA-512 round constants from RFC 6234 §5.2:\n// 80 full 64-bit words split into high/low halves.\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\n// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */\nclass SHA2_64B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and slows hashing down (measured on sha256).\n Ah = 0;\n Al = 0;\n Bh = 0;\n Bl = 0;\n Ch = 0;\n Cl = 0;\n Dh = 0;\n Dl = 0;\n Eh = 0;\n El = 0;\n Fh = 0;\n Fl = 0;\n Gh = 0;\n Gl = 0;\n Hh = 0;\n Hl = 0;\n constructor(outputLen, IV) {\n super(128, outputLen, 16, false);\n this.Ah = IV[0] | 0;\n this.Al = IV[1] | 0;\n this.Bh = IV[2] | 0;\n this.Bl = IV[3] | 0;\n this.Ch = IV[4] | 0;\n this.Cl = IV[5] | 0;\n this.Dh = IV[6] | 0;\n this.Dl = IV[7] | 0;\n this.Eh = IV[8] | 0;\n this.El = IV[9] | 0;\n this.Fh = IV[10] | 0;\n this.Fl = IV[11] | 0;\n this.Gh = IV[12] | 0;\n this.Gl = IV[13] | 0;\n this.Hh = IV[14] | 0;\n this.Hl = IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA512 extends SHA2_64B {\n constructor() {\n super(64, SHA512_IV);\n }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA384 extends SHA2_64B {\n constructor() {\n super(48, SHA384_IV);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.\n * These IV literals are checked against that script rather than a dedicated\n * local RFC section.\n */\n/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_224 extends SHA2_64B {\n constructor() {\n super(28, T224_IV);\n }\n}\n/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_256 extends SHA2_64B {\n constructor() {\n super(32, T256_IV);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-256.\n * ```ts\n * sha256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__PURE__ */ oidNist(0x01));\n/**\n * SHA2-224 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-224.\n * ```ts\n * sha224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__PURE__ */ oidNist(0x04));\n/**\n * SHA2-512 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512.\n * ```ts\n * sha512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__PURE__ */ oidNist(0x03));\n/**\n * SHA2-384 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-384.\n * ```ts\n * sha384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/256.\n * ```ts\n * sha512_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/224.\n * ```ts\n * sha512_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202},\n * {@link https://keccak.team/keccak.html | Website}, and\n * {@link https://crypto.stackexchange.com/q/15727 | the differences between\n * SHA-3 and Keccak}.\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { split } from \"./_u64.js\";\n// prettier-ignore\nimport { abool, abytes, aexists, anumber, aoutput, checkOpts, clean, createHasher, oidNist, swap32IfBE, u32 } from \"./utils.js\";\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\n// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors\n// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`.\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = []; // no pure annotation: var is always used\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\n// `split(..., true)` keeps the local little-endian lane-word layout used by\n// `state32`, so these `H` / `L` tables follow the file's first-word /\n// second-word lane slots rather than `_u64.ts`'s usual high/low naming.\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can\n// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only\n// consumer of left-rotates; other hashes use right-rotates from _u64.\n// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64.\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2.\n// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation.\nconst B = new Uint32Array(5 * 2);\n/**\n * `keccakf1600` internal permutation, additionally allows adjusting the round count.\n * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words\n * in this file's local little-endian lane-word order\n * @param rounds - number of rounds to execute\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If `rounds` is outside the supported `1..24` range. {@link Error}\n * @example\n * Permute a Keccak state with the default 24 rounds.\n * ```ts\n * keccakP(new Uint32Array(50));\n * ```\n */\nexport function keccakP(s, rounds = 24) {\n if (!(s instanceof Uint32Array))\n throw new TypeError('\"s\" expected Uint32Array(50), got type=' + typeof s);\n if (s.length !== 50)\n throw new RangeError('\"s\" expected Uint32Array(50), got length=' + s.length);\n anumber(rounds, 'rounds');\n // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table.\n if (rounds < 1 || rounds > 24)\n throw new Error('\"rounds\" expected integer 1..24');\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n // Same as:\n // for (let x = 0; x < 10; x++) B[x] = s[y + x];\n // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n for (let y = 0; y < 50; y += 10) {\n const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3];\n s[y] ^= ~s[y + 2] & s[y + 4];\n s[y + 1] ^= ~s[y + 3] & s[y + 5];\n s[y + 2] ^= ~s[y + 4] & s[y + 6];\n s[y + 3] ^= ~s[y + 5] & s[y + 7];\n s[y + 4] ^= ~s[y + 6] & s[y + 8];\n s[y + 5] ^= ~s[y + 7] & s[y + 9];\n s[y + 6] ^= ~s[y + 8] & b0;\n s[y + 7] ^= ~s[y + 9] & b1;\n s[y + 8] ^= ~b0 & b2;\n s[y + 9] ^= ~b1 & b3;\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n/**\n * Keccak sponge function.\n * @param blockLen - absorb/squeeze rate in bytes\n * @param suffix - domain separation suffix byte\n * @param outputLen - default digest length in bytes. This base sponge only\n * requires a non-negative integer; wrappers that need positive output\n * lengths must enforce that themselves.\n * @param enableXOF - whether XOF output is allowed\n * @param rounds - number of Keccak-f rounds\n * @example\n * Build a sponge state, absorb bytes, then finalize a digest.\n * ```ts\n * const hash = new Keccak(136, 0x06, 32);\n * hash.update(new Uint8Array([1, 2, 3]));\n * hash.digest();\n * ```\n */\nexport class Keccak {\n state;\n pos = 0;\n posOut = 0;\n finished = false;\n state32;\n destroyed = false;\n blockLen;\n suffix;\n outputLen;\n canXOF;\n enableXOF = false;\n rounds;\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n anumber(blockLen, 'blockLen');\n anumber(suffix, 'suffix');\n anumber(rounds, 'rounds');\n abool(enableXOF, 'enableXOF');\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.canXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen, 'outputLen');\n // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state.\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('\"blockLen\" must be 1..199');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone() {\n return this._cloneInto();\n }\n keccak() {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { blockLen, state, state32 } = this;\n const len = data.length;\n // Absorb full blocks with u32 XORs when both sides are 4-byte aligned.\n // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe.\n const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0;\n const blockLen32 = blockLen / 4;\n const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined;\n for (let pos = 0; pos < len;) {\n if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) {\n for (let i = 0, o = pos / 4; i < blockLen32; i++)\n state32[i] ^= data32[o + i];\n pos += blockLen;\n // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override,\n // so it must reflect the fully-absorbed block before the permutation fires.\n this.pos = blockLen;\n this.keccak();\n continue;\n }\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1.\n // These byte values already include the first padding bit, while the\n // final `0x80` below supplies the closing `1` bit in the last rate byte.\n state[pos] ^= suffix;\n // If that combined suffix lands in the last rate byte and already sets\n // bit 7, absorb it first so the final pad10*1 bit can be xored into a\n // fresh block.\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base\n // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/\n // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF.\n if (!this.enableXOF)\n throw new Error('XOF is not enabled');\n return this.writeInto(out);\n }\n xof(bytes) {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n aoutput(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest.\n this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen));\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.outputLen);\n this.digestInto(out);\n return out;\n }\n destroy() {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);\n // Reused destinations can come from a different rate/capacity variant, so clone must rewrite\n // the sponge geometry as well as the state words.\n to.blockLen = blockLen;\n to.state32.set(this.state32);\n // Sponge padding and XOF output are positional, so both offsets are part of the clone state.\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone\n // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie.\n to.canXOF = this.canXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info);\n/**\n * SHA3-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-224.\n * ```ts\n * sha3_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_224 = /* @__PURE__ */ genKeccak(0x06, 144, 28, \n/* @__PURE__ */ oidNist(0x07));\n/**\n * SHA3-256 hash function. Different from keccak-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-256.\n * ```ts\n * sha3_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, \n/* @__PURE__ */ oidNist(0x08));\n/**\n * SHA3-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-384.\n * ```ts\n * sha3_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_384 = /* @__PURE__ */ genKeccak(0x06, 104, 48, \n/* @__PURE__ */ oidNist(0x09));\n/**\n * SHA3-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-512.\n * ```ts\n * sha3_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, \n/* @__PURE__ */ oidNist(0x0a));\n/**\n * Keccak-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-224.\n * ```ts\n * keccak_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_224 = /* @__PURE__ */ genKeccak(0x01, 144, 28);\n/**\n * Keccak-256 hash function. Different from SHA3-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-256.\n * ```ts\n * keccak_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32);\n/**\n * Keccak-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-384.\n * ```ts\n * keccak_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_384 = /* @__PURE__ */ genKeccak(0x01, 104, 48);\n/**\n * Keccak-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-512.\n * ```ts\n * keccak_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_512 = /* @__PURE__ */ genKeccak(0x01, 72, 64);\nconst genShake = (suffix, blockLen, outputLen, info = {}) => createHasher((opts = {}) => {\n opts = checkOpts({}, opts);\n return new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true);\n}, info);\n/**\n * SHAKE128 XOF with 128-bit security and a 16-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128.\n * ```ts\n * shake128(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 16, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 256-bit security and a 32-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256.\n * ```ts\n * shake256(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 32, /* @__PURE__ */ oidNist(0x0c));\n/**\n * SHAKE128 XOF with 256-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128 using a 32-byte default output.\n * ```ts\n * shake128_32(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128_32 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 32, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 512-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256 using a 64-byte default output.\n * ```ts\n * shake256_64(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256_64 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 64, /* @__PURE__ */ oidNist(0x0c));\n","/*!\n * assert.js - assert for bcrypto\n * Copyright (c) 2020, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\n/*\n * Assert\n */\n\nfunction assert(val, msg) {\n if (!val) {\n const err = new Error(msg || 'Assertion failed');\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, assert);\n\n throw err;\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = assert;\n","/*!\n * custom.js - custom inspect symbol for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nexports.custom = 'inspect';\n","/*!\n * bn.js - big numbers for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/bn.js:\n * Copyright (c) 2015, Fedor Indutny (MIT License).\n * https://github.com/indutny/bn.js\n *\n * Parts of this software are based on golang/go:\n * Copyright (c) 2009, The Go Authors. All rights reserved.\n * https://github.com/golang/go\n *\n * Parts of this software are based on openssl/openssl:\n * Copyright (c) 1998-2018, The OpenSSL Project (Apache License v2.0).\n * Copyright (c) 1995-1998, Eric A. Young, Tim J. Hudson. All rights reserved.\n * https://github.com/openssl/openssl\n *\n * Parts of this software are based on libgmp:\n * Copyright (c) 1991-1997, 1999-2014, Free Software Foundation, Inc.\n * https://gmplib.org/\n *\n * Parts of this software are based on v8/v8:\n * Copyright (c) 2017, The V8 Project Authors (BSD-Style License).\n * https://github.com/v8/v8\n *\n * Resources:\n * https://github.com/indutny/bn.js/blob/master/lib/bn.js\n * https://github.com/indutny/miller-rabin/blob/master/lib/mr.js\n * https://github.com/golang/go/blob/master/src/math/big/int.go\n * https://github.com/golang/go/blob/master/src/math/big/nat.go\n * https://github.com/golang/go/blob/master/src/math/big/prime.go\n * https://github.com/openssl/openssl/tree/master/crypto/bn\n * https://github.com/openssl/openssl/blob/master/crypto/bn/bn_kron.c\n * https://github.com/gnutls/nettle/blob/master/mini-gmp.c\n * https://github.com/v8/v8/blob/master/src/objects/bigint.cc\n */\n\n/* eslint valid-typeof: \"off\" */\n\n'use strict';\n\nconst {custom} = require('../internal/custom');\n\n/*\n * Constants\n */\n\nconst zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n];\n\nconst groupSizes = [\n 0x00, 0x19, 0x10, 0x0c, 0x0b, 0x0a,\n 0x09, 0x08, 0x08, 0x07, 0x07, 0x07,\n 0x07, 0x06, 0x06, 0x06, 0x06, 0x06,\n 0x06, 0x06, 0x05, 0x05, 0x05, 0x05,\n 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,\n 0x05, 0x05, 0x05, 0x05, 0x05, 0x05\n];\n\nconst groupBases = [\n 0x00000000, 0x02000000, 0x0290d741, 0x01000000,\n 0x02e90edd, 0x039aa400, 0x0267bf47, 0x01000000,\n 0x0290d741, 0x00989680, 0x012959c3, 0x0222c000,\n 0x03bd7765, 0x0072e440, 0x00adcea1, 0x01000000,\n 0x01704f61, 0x0206fc40, 0x02cddcf9, 0x03d09000,\n 0x003e5185, 0x004ea360, 0x006235f7, 0x00798000,\n 0x009502f9, 0x00b54ba0, 0x00daf26b, 0x01069c00,\n 0x0138f9ad, 0x0172c9e0, 0x01b4d89f, 0x02000000,\n 0x025528a1, 0x02b54a20, 0x03216b93, 0x039aa400\n];\n\nconst primes = {\n p192: null,\n p224: null,\n p521: null,\n k256: null,\n p251: null,\n p25519: null,\n p448: null\n};\n\nconst modes = {\n NONE: 0,\n QUO: 1,\n REM: 2,\n BOTH: 3,\n EUCLID: 4,\n ALL: 7\n};\n\nconst WND_WIDTH = 4;\nconst WND_SIZE = 1 << (WND_WIDTH - 1);\n\nconst HAS_BIGINT = typeof BigInt === 'function';\n\n/**\n * BN\n */\n\nclass BN {\n constructor(num, base, endian) {\n this.words = [0];\n this.length = 1;\n this.negative = 0;\n this.red = null;\n this.from(num, base, endian);\n }\n\n /*\n * Addition Engine\n */\n\n _iadd(a, b) {\n let carry = 0;\n let i = 0;\n\n // a.length > b.length\n if (a.length < b.length)\n [a, b] = [b, a];\n\n if (a !== this)\n this._alloc(a.length);\n\n for (; i < b.length; i++) {\n const r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n\n this.words[i] = r & 0x3ffffff;\n\n carry = r >>> 26;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n const r = (a.words[i] | 0) + carry;\n\n this.words[i] = r & 0x3ffffff;\n\n carry = r >>> 26;\n }\n\n this.length = a.length;\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n } else if (a !== this) {\n // Copy the rest of the words.\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n _iaddn(num) {\n this.words[0] += num;\n\n if (this.words[0] < 0x4000000)\n return this;\n\n // Carry.\n let i = 0;\n\n this._alloc(this.length + 1);\n\n this.words[this.length] = 0;\n\n for (; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n this.words[i + 1] += 1;\n }\n\n this.length = Math.max(this.length, i + 1);\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n /*\n * Addition\n */\n\n iadd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative === num.negative) {\n // x + y == x + y\n // (-x) + (-y) == -(x + y)\n this._iadd(this, num);\n } else {\n // x + (-y) == x - y == -(y - x)\n // (-x) + y == y - x == -(x - y)\n const cmp = this.ucmp(num);\n\n // x + (-x) == (-x) + x == 0\n if (cmp === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n if (cmp < 0) {\n this._isub(num, this);\n this.negative ^= 1;\n } else {\n this._isub(this, num);\n }\n }\n\n return this;\n }\n\n iaddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (negative)\n num = -num;\n\n if (this.negative === negative) {\n // x + y == x + y\n // (-x) + (-y) == -(x + y)\n this._iaddn(num);\n } else {\n // x + (-y) == x - y == -(y - x)\n // (-x) + y == y - x == -(x - y)\n if (this.length === 1 && this.words[0] < num) {\n this.words[0] = num - this.words[0];\n this.negative ^= 1;\n } else {\n this._isubn(num);\n }\n }\n\n return this;\n }\n\n add(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (num.length > this.length)\n return num.clone().iadd(this);\n\n return this.clone().iadd(num);\n }\n\n addn(num) {\n return this.clone().iaddn(num);\n }\n\n /*\n * Subtraction Engine\n */\n\n _isub(a, b) {\n let carry = 0;\n let i = 0;\n\n // a > b\n assert(a.length >= b.length);\n\n if (a !== this)\n this._alloc(a.length);\n\n for (; i < b.length; i++) {\n const r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n\n carry = r >> 26;\n\n this.words[i] = r & 0x3ffffff;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n const r = (a.words[i] | 0) + carry;\n\n carry = r >> 26;\n\n this.words[i] = r & 0x3ffffff;\n }\n\n assert(carry === 0);\n\n // Copy rest of the words.\n if (a !== this) {\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n this.length = Math.max(this.length, i);\n\n return this._strip();\n }\n\n _isubn(num) {\n this.words[0] -= num;\n\n if (this.words[0] >= 0)\n return this._normalize();\n\n assert(this.length !== 1);\n\n // Carry.\n this._alloc(this.length + 1);\n\n for (let i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n\n this.words[this.length] = 0;\n\n return this._strip();\n }\n\n /*\n * Subtraction\n */\n\n isub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative !== num.negative) {\n // x - (-y) == x + y\n // (-x) - y == -(x + y)\n this._iadd(this, num);\n } else {\n // x - y == x - y == -(y - x)\n // (-x) - (-y) == y - x == -(x - y)\n const cmp = this.ucmp(num);\n\n // x - x == 0\n if (cmp === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n if (cmp < 0) {\n this._isub(num, this);\n this.negative ^= 1;\n } else {\n this._isub(this, num);\n }\n }\n\n return this;\n }\n\n isubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (negative)\n num = -num;\n\n if (this.negative !== negative) {\n // x - (-y) == x + y\n // (-x) - y == -(x + y)\n this._iaddn(num);\n } else {\n // x - y == x - y == -(y - x)\n // (-x) - (-y) == y - x == -(x - y)\n if (this.length === 1 && this.words[0] < num) {\n this.words[0] = num - this.words[0];\n this.negative ^= 1;\n } else {\n this._isubn(num);\n }\n }\n\n return this;\n }\n\n sub(num) {\n return this.clone().isub(num);\n }\n\n subn(num) {\n return this.clone().isubn(num);\n }\n\n /*\n * Multiplication Engine\n */\n\n _mul(num, out) {\n enforce(BN.isBN(num), 'num', 'bignum');\n enforce(BN.isBN(out), 'out', 'bignum');\n\n if (this.length === 10 && num.length === 10)\n return comb10MulTo(this, num, out);\n\n const len = this.length + num.length;\n\n if (len < 63)\n return smallMulTo(this, num, out);\n\n if (len < 1024)\n return bigMulTo(this, num, out);\n\n return jumboMulTo(this, num, out);\n }\n\n /*\n * Multiplication\n */\n\n imul(num) {\n return this.mul(num)._move(this);\n }\n\n imuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n // Carry.\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = this.words[i] * num;\n const lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n carry += lo >>> 26;\n\n this.words[i] = lo & 0x3ffffff;\n }\n\n this.negative ^= neg;\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n } else {\n this._strip();\n }\n\n return this;\n }\n\n mul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n const len = this.length + num.length;\n const out = new BN();\n\n out.words = new Array(len);\n\n for (let i = 0; i < len; i ++)\n out.words[i] = 0;\n\n return this._mul(num, out);\n }\n\n muln(num) {\n return this.clone().imuln(num);\n }\n\n /*\n * Multiplication + Shift\n */\n\n mulShift(num, bits) {\n enforce(BN.isBN(num), 'num', 'bignum');\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = this.mul(num);\n const b = r.utestn(bits - 1);\n\n r.iushrn(bits);\n\n if (this.negative ^ num.negative)\n return r.isubn(b);\n\n return r.iaddn(b);\n }\n\n /*\n * Division Engine\n */\n\n _div(num, flags) {\n enforce(BN.isBN(num), 'num', 'bignum');\n assert((flags & modes.ALL) === flags);\n assert(flags !== modes.NONE);\n\n const a = this;\n const b = num;\n\n nonzero(!b.isZero());\n\n if (a.isZero())\n return [new BN(0), new BN(0)];\n\n const as = a.negative;\n const bs = b.negative;\n\n a.negative = 0;\n b.negative = 0;\n\n let q = null;\n let r = null;\n\n if (a.ucmp(b) < 0) {\n if (flags & modes.QUO)\n q = new BN(0);\n\n if (flags & modes.REM)\n r = a.clone();\n } else if (b.length === 1) {\n if (flags & modes.QUO)\n q = a.quon(b.words[0]);\n\n if (flags & modes.REM)\n r = a.remn(b.words[0]);\n } else {\n [q, r] = a._wordDiv(b, flags);\n }\n\n a.negative = as;\n b.negative = bs;\n\n if (flags & modes.QUO) {\n q.negative = a.negative ^ b.negative;\n q._normalize();\n }\n\n if (flags & modes.REM) {\n r.negative = a.negative;\n r._normalize();\n }\n\n if (flags & modes.EUCLID) {\n if (flags & modes.QUO) {\n assert((flags & modes.REM) !== 0);\n\n if (r.negative !== 0) {\n if (b.negative !== 0)\n q.iaddn(1);\n else\n q.isubn(1);\n }\n }\n\n if (flags & modes.REM) {\n if (r.negative !== 0) {\n if (b.negative !== 0)\n r.isub(b);\n else\n r.iadd(b);\n }\n }\n }\n\n return [q, r];\n }\n\n _wordDiv(num, flags) {\n let a = this.clone();\n let b = num;\n let q = null;\n let hi;\n\n // Normalize.\n const word = b.words[b.length - 1] | 0;\n const shift = 26 - countBits(word);\n\n if (shift !== 0) {\n b = b.clone();\n\n a.iushln(shift);\n b.iushln(shift);\n\n hi = b.words[b.length - 1] | 0;\n } else {\n hi = word;\n }\n\n // Initialize quotient.\n const m = a.length - b.length;\n\n assert(m >= 0);\n\n if (flags & modes.QUO) {\n q = new BN(0);\n q.length = m + 1;\n q.words = new Array(q.length);\n\n for (let i = 0; i < q.length; i++)\n q.words[i] = 0;\n }\n\n // Diff.\n const d = a.clone();\n\n d._ishlnsubmul(b, 1, m);\n\n if (d.negative === 0) {\n if (q)\n q.words[m] = 1;\n\n a = d;\n }\n\n // Divide.\n for (let j = m - 1; j >= 0; j--) {\n const ahi = a.words[b.length + j];\n const alo = a.words[b.length + j - 1];\n const quo = ((ahi * 0x4000000 + alo) / hi) | 0;\n\n let qj = Math.min(quo, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n\n while (a.negative !== 0) {\n qj -= 1;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n a.ineg();\n }\n\n if (q)\n q.words[j] = qj;\n }\n\n // Strip.\n if (q)\n q._strip();\n\n // Denormalize.\n // Note: we shouldn't need to strip `a` here.\n if ((flags & modes.REM) && shift !== 0)\n a.iushrn(shift);\n\n return [q, a];\n }\n\n _ishlnsubmul(num, mul, shift) {\n let carry = 0;\n let i = 0;\n\n this._expand(num.length + shift);\n\n for (; i < num.length; i++) {\n const k = (this.words[i + shift] | 0) + carry;\n const r = num.words[i] * mul;\n const w = k - (r & 0x3ffffff);\n\n carry = (w >> 26) - ((r / 0x4000000) | 0);\n\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n for (; i < this.length - shift; i++) {\n const w = (this.words[i + shift] | 0) + carry;\n\n carry = w >> 26;\n\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0)\n return this._strip();\n\n // Subtraction overflow.\n assert(carry === -1);\n\n carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = -(this.words[i] | 0) + carry;\n\n carry = w >> 26;\n\n this.words[i] = w & 0x3ffffff;\n }\n\n this.negative = 1;\n\n return this._strip();\n }\n\n /*\n * Truncation Division + Modulo\n */\n\n quorem(num) {\n return this._div(num, modes.BOTH);\n }\n\n /*\n * Truncation Division\n */\n\n iquo(num) {\n return this.quo(num)._move(this);\n }\n\n iquon(num) {\n enforce(isSMI(num), 'num', 'smi');\n nonzero(num !== 0);\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n let carry = 0;\n\n for (let i = this.length - 1; i >= 0; i--) {\n const w = (this.words[i] | 0) + carry * 0x4000000;\n\n this.words[i] = (w / num) | 0;\n\n carry = w % num;\n }\n\n this.negative ^= neg;\n\n return this._strip();\n }\n\n quo(num) {\n return this._div(num, modes.QUO)[0];\n }\n\n quon(num) {\n return this.clone().iquon(num);\n }\n\n /*\n * Truncation Modulo\n */\n\n irem(num) {\n return this.rem(num)._move(this);\n }\n\n iremn(num) {\n let m = this.remrn(num);\n\n if (m < 0)\n m = -m;\n\n this.words[0] = m;\n this.length = 1;\n\n return this._normalize();\n }\n\n rem(num) {\n return this._div(num, modes.REM)[1];\n }\n\n remn(num) {\n return this.clone().iremn(num);\n }\n\n remrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n nonzero(num !== 0);\n\n if (num < 0)\n num = -num;\n\n const p = (1 << 26) % num;\n\n let acc = 0;\n\n for (let i = this.length - 1; i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n\n return this.negative !== 0 ? (-acc | 0) : acc;\n }\n\n /*\n * Euclidean Division + Modulo\n */\n\n divmod(num) {\n return this._div(num, modes.BOTH | modes.EUCLID);\n }\n\n /*\n * Euclidean Division\n */\n\n idiv(num) {\n return this.div(num)._move(this);\n }\n\n idivn(num) {\n if (this.negative === 0)\n return this.iquon(num);\n\n const r = this.remrn(num);\n\n this.iquon(num);\n\n if (r < 0) {\n if (num < 0)\n this.iaddn(1);\n else\n this.isubn(1);\n }\n\n return this;\n }\n\n div(num) {\n return this._div(num, modes.BOTH | modes.EUCLID)[0];\n }\n\n divn(num) {\n return this.clone().idivn(num);\n }\n\n /*\n * Euclidean Modulo\n */\n\n imod(num) {\n if (this.ucmp(num) < 0) {\n if (this.negative !== 0) {\n this._isub(num, this);\n this.negative = 0;\n }\n return this;\n }\n\n return this.mod(num)._move(this);\n }\n\n imodn(num) {\n this.words[0] = this.modrn(num);\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n mod(num) {\n return this._div(num, modes.REM | modes.EUCLID)[1];\n }\n\n modn(num) {\n return this.clone().imodn(num);\n }\n\n modrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n let r = this.remrn(num);\n\n if (r < 0) {\n if (num < 0)\n r -= num;\n else\n r += num;\n }\n\n return r;\n }\n\n /*\n * Round Division\n */\n\n divRound(num) {\n const [q, r] = this.quorem(num);\n\n // Fast case - exact division.\n if (r.isZero())\n return q;\n\n const bit = num.words[0] & 1;\n\n num.iushrn(1);\n\n const cmp = r.ucmp(num);\n\n num.iushln(1);\n\n num.words[0] |= bit;\n\n // Round down.\n if (cmp < 0 || (num.isOdd() && cmp === 0))\n return q;\n\n // Round up.\n if (this.negative ^ num.negative)\n return q.isubn(1);\n\n return q.iaddn(1);\n }\n\n /*\n * Exponentiation\n */\n\n ipow(num) {\n return this.pow(num)._move(this);\n }\n\n ipown(num) {\n return this.pown(num)._move(this);\n }\n\n pow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let b = countBits(num.words[num.length - 1]);\n let r = new BN(1);\n\n for (let i = num.length - 1; i >= 0; i--) {\n const word = num.words[i];\n\n for (let j = b - 1; j >= 0; j--) {\n r = r.sqr();\n\n if ((word >> j) & 1)\n r = r.mul(this);\n }\n\n b = 26;\n }\n\n return r;\n }\n\n pown(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if (num < 0)\n num = -num;\n\n if (num === 0)\n return new BN(1);\n\n if (num === 1)\n return this.clone();\n\n const bits = countBits(num);\n\n let r = this;\n\n for (let i = bits - 2; i >= 0; i--) {\n r = r.sqr();\n\n if ((num >> i) & 1)\n r = r.mul(this);\n }\n\n return r;\n }\n\n isqr() {\n return this.imul(this);\n }\n\n sqr() {\n return this.mul(this);\n }\n\n /*\n * Roots Engine\n */\n\n _rootrem(pow, rem) {\n enforce((pow >>> 0) === pow, 'num', 'uint32');\n\n if (pow === 0)\n throw new RangeError('Zeroth root.');\n\n if (~pow & this.negative)\n throw new RangeError('Negative with even root.');\n\n if (this.ucmpn(1) <= 0)\n return [this.clone(), new BN(0)];\n\n let u = new BN(0);\n let t = BN.shift(1, this.bitLength() / pow + 1 | 0);\n let v, r;\n\n if (this.negative !== 0)\n t.ineg();\n\n if (pow === 2) {\n do {\n u = t;\n t = this.quo(u);\n t.iadd(u);\n t.iushrn(1);\n } while (t.ucmp(u) < 0);\n } else {\n do {\n u = t;\n t = u.pown(pow - 1);\n t = this.quo(t);\n v = u.muln(pow - 1);\n t.iadd(v);\n t = t.quon(pow);\n } while (t.ucmp(u) < 0);\n }\n\n if (rem) {\n t = u.pown(pow);\n r = this.sub(t);\n }\n\n return [u, r];\n }\n\n /*\n * Roots\n */\n\n rootrem(pow) {\n return this._rootrem(pow, 1);\n }\n\n iroot(pow) {\n return this.root(pow)._move(this);\n }\n\n root(pow) {\n return this._rootrem(pow, 0)[0];\n }\n\n isPower(pow) {\n enforce((pow >>> 0) === pow, 'num', 'uint32');\n\n if (pow === 0 || (~pow & this.negative))\n return false;\n\n const [, r] = this.rootrem(pow);\n\n return r.sign() === 0;\n }\n\n sqrtrem() {\n return this.rootrem(2);\n }\n\n isqrt() {\n return this.sqrt()._move(this);\n }\n\n sqrt() {\n return this.root(2);\n }\n\n isSquare() {\n return this.isPower(2);\n }\n\n /*\n * AND\n */\n\n iand(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y)\n return x;\n\n if ((x.negative | y.negative) === 0)\n return x.iuand(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) & (-y) == ~(x-1) & ~(y-1)\n // == ~((x-1) | (y-1))\n // == -(((x-1) | (y-1)) + 1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuor(y);\n x.isubn(1);\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n if (x.negative !== 0)\n [x, y] = [y.clone(), x];\n\n // x & (-y) == x & ~(y-1)\n // == x & ~(y-1)\n const width = x.bitLength();\n\n y.iaddn(1);\n y.inotn(width);\n x.iuand(y);\n y.inotn(width);\n y.isubn(1);\n\n return x._move(this);\n }\n\n iandn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.iand(new BN(num));\n\n this.words[0] &= num;\n this.length = 1;\n\n return this;\n }\n\n and(num) {\n return this.clone().iand(num);\n }\n\n andn(num) {\n return this.clone().iandn(num);\n }\n\n andrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0) {\n const n = this.iand(new BN(num));\n\n if (n.length > 1)\n throw new RangeError('Number exceeds 26 bits.');\n\n return n.negative !== 0 ? -n.words[0] : n.words[0];\n }\n\n return this.words[0] & num;\n }\n\n /*\n * Unsigned AND\n */\n\n iuand(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this.length = Math.min(this.length, num.length);\n\n for (let i = 0; i < this.length; i++)\n this.words[i] &= num.words[i];\n\n return this._strip();\n }\n\n iuandn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] &= Math.abs(num);\n this.length = 1;\n\n return this._normalize();\n }\n\n uand(num) {\n return this.clone().iuand(num);\n }\n\n uandn(num) {\n return this.clone().iuandn(num);\n }\n\n uandrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const n = this.words[0] & Math.abs(num);\n\n return this.negative !== 0 ? (-n | 0) : n;\n }\n\n /*\n * OR\n */\n\n ior(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y)\n return x;\n\n if ((x.negative | y.negative) === 0)\n return x.iuor(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) | (-y) == ~(x-1) | ~(y-1)\n // == ~((x-1) & (y-1))\n // == -(((x-1) & (y-1)) + 1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuand(y);\n x.isubn(1);\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n y = y.clone();\n\n if (x.negative !== 0)\n [x, y] = [y, x];\n\n // x | (-y) == x | ~(y-1)\n // == ~((y-1) & ~x)\n // == -(((y-1) & ~x) + 1)\n y.iaddn(1);\n x.inotn(y.bitLength());\n y.iuand(x);\n y.isubn(1);\n\n return y._move(this);\n }\n\n iorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.ior(new BN(num));\n\n this.words[0] |= num;\n\n return this;\n }\n\n or(num) {\n return this.clone().ior(num);\n }\n\n orn(num) {\n return this.clone().iorn(num);\n }\n\n /*\n * Unsigned OR\n */\n\n iuor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this._expand(num.length);\n\n for (let i = 0; i < num.length; i++)\n this.words[i] |= num.words[i];\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n iuorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] |= Math.abs(num);\n\n return this;\n }\n\n uor(num) {\n return this.clone().iuor(num);\n }\n\n uorn(num) {\n return this.clone().iuorn(num);\n }\n\n /*\n * XOR\n */\n\n ixor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y) {\n x.words[0] = 0;\n x.length = 1;\n x.negative = 0;\n return x;\n }\n\n if ((x.negative | y.negative) === 0)\n return x.iuxor(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) ^ (-y) == ~(x-1) ^ ~(y-1)\n // == (x-1) ^ (y-1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuxor(y);\n x.ineg();\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n if (x.negative !== 0)\n [x, y] = [y.clone(), x];\n\n // x ^ (-y) == x ^ ~(y-1)\n // == ~(x ^ (y-1))\n // == -((x ^ (y-1)) + 1)\n y.iaddn(1);\n x.iuxor(y);\n x.iaddn(1);\n x.ineg();\n y.isubn(1);\n\n return x._move(this);\n }\n\n ixorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.ixor(new BN(num));\n\n this.words[0] ^= num;\n\n return this;\n }\n\n xor(num) {\n return this.clone().ixor(num);\n }\n\n xorn(num) {\n return this.clone().ixorn(num);\n }\n\n /*\n * Unsigned XOR\n */\n\n iuxor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let a = this;\n let b = num;\n\n if (a.length < b.length)\n [a, b] = [b, a];\n\n let i = 0;\n\n for (; i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n\n if (a !== this) {\n this._alloc(a.length);\n\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n this.length = a.length;\n\n return this._strip();\n }\n\n iuxorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] ^= Math.abs(num);\n\n return this._normalize();\n }\n\n uxor(num) {\n return this.clone().iuxor(num);\n }\n\n uxorn(num) {\n return this.clone().iuxorn(num);\n }\n\n /*\n * NOT\n */\n\n inot() {\n if (this.negative !== 0) {\n // ~(-x) == ~(~(x-1)) == x-1\n this.ineg().isubn(1);\n } else {\n // ~x == -x-1 == -(x+1)\n this.iaddn(1).ineg();\n }\n return this;\n }\n\n not() {\n return this.clone().inot();\n }\n\n inotn(width) {\n enforce((width >>> 0) === width, 'width', 'uint32');\n\n const r = width % 26;\n\n let s = Math.ceil(width / 26);\n let i = 0;\n\n // Extend the buffer with leading zeroes.\n this._expand(s);\n\n if (r > 0)\n s -= 1;\n\n // Handle complete words.\n for (; i < s; i++)\n this.words[i] ^= 0x3ffffff;\n\n // Handle the residue.\n if (r > 0)\n this.words[i] ^= (1 << r) - 1;\n\n // And remove leading zeroes.\n return this._strip();\n }\n\n notn(width) {\n return this.clone().inotn(width);\n }\n\n /*\n * Left Shift\n */\n\n ishl(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.ishln(num.toNumber());\n }\n\n ishln(bits) {\n return this.iushln(bits);\n }\n\n shl(num) {\n return this.clone().ishl(num);\n }\n\n shln(bits) {\n return this.clone().ishln(bits);\n }\n\n /*\n * Unsigned Left Shift\n */\n\n iushl(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.iushln(num.toNumber());\n }\n\n iushln(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = bits % 26;\n const s = (bits - r) / 26;\n const mask = ((1 << r) - 1) << (26 - r);\n\n if (r !== 0) {\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const ncarry = this.words[i] & mask;\n const c = ((this.words[i] | 0) - ncarry) << r;\n\n this.words[i] = c | carry;\n\n carry = ncarry >>> (26 - r);\n }\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n }\n }\n\n if (s !== 0) {\n this._alloc(this.length + s);\n\n for (let i = this.length - 1; i >= 0; i--)\n this.words[i + s] = this.words[i];\n\n for (let i = 0; i < s; i++)\n this.words[i] = 0;\n\n this.length += s;\n }\n\n return this._strip();\n }\n\n ushl(num) {\n return this.clone().iushl(num);\n }\n\n ushln(bits) {\n return this.clone().iushln(bits);\n }\n\n /*\n * Right Shift Engine\n */\n\n _split(bits, output) {\n const r = bits % 26;\n const s = Math.min((bits - r) / 26, this.length);\n const mask = (1 << r) - 1;\n\n // Extended mode, copy masked part.\n if (output) {\n output._alloc(s);\n\n for (let i = 0; i < s; i++)\n output.words[i] = this.words[i];\n\n output.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all.\n } else if (this.length > s) {\n this.length -= s;\n for (let i = 0; i < this.length; i++)\n this.words[i] = this.words[i + s];\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n let carry = 0;\n\n if (r !== 0) {\n for (let i = this.length - 1; i >= 0; i--) {\n const word = this.words[i] | 0;\n\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n\n carry = word & mask;\n }\n }\n\n // Push carried bits as a mask.\n if (output) {\n if (carry !== 0) {\n output._alloc(output.length + 1);\n output.words[output.length++] = carry;\n } else {\n if (output.length === 0)\n output.words[output.length++] = 0;\n\n output._strip();\n }\n }\n\n return this._strip();\n }\n\n /*\n * Right Shift\n */\n\n ishr(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.ishrn(num.toNumber());\n }\n\n ishrn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (this.negative !== 0) {\n // (-x) >> y == ~(x-1) >> y\n // == ~((x-1) >> y)\n // == -(((x-1) >> y) + 1)\n this.iaddn(1);\n this.iushrn(bits);\n this.isubn(1);\n return this;\n }\n\n return this.iushrn(bits);\n }\n\n shr(num) {\n return this.clone().ishr(num);\n }\n\n shrn(bits) {\n return this.clone().ishrn(bits);\n }\n\n /*\n * Unsigned Right Shift\n */\n\n iushr(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.iushrn(num.toNumber());\n }\n\n iushrn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n return this._split(bits, null);\n }\n\n ushr(num) {\n return this.clone().iushr(num);\n }\n\n ushrn(bits) {\n return this.clone().iushrn(bits);\n }\n\n /*\n * Bit Manipulation\n */\n\n setn(bit, val) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n if (this.negative !== 0) {\n this.iaddn(1);\n this.usetn(bit, !val);\n this.isubn(1);\n return this;\n }\n\n return this.usetn(bit, val);\n }\n\n usetn(bit, val) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n this._expand(s + 1);\n\n if (val)\n this.words[s] |= (1 << r);\n else\n this.words[s] &= ~(1 << r);\n\n return this._strip();\n }\n\n testn(bit) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n // Fast case: bit is much higher than all existing words.\n if (this.length <= s)\n return this.negative;\n\n // Check bit and return.\n const w = this.words[s];\n const val = (w >> r) & 1;\n\n if (this.negative !== 0) {\n if (r > 0 && (w & ((1 << r) - 1)))\n return val ^ 1;\n\n let j = s;\n\n while (j--) {\n if (this.words[j] > 0)\n return val ^ 1;\n }\n }\n\n return val;\n }\n\n utestn(bit) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n // Fast case: bit is much higher than all existing words.\n if (this.length <= s)\n return 0;\n\n // Check bit and return.\n return (this.words[s] >> r) & 1;\n }\n\n imaskn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (this.negative !== 0) {\n this.iaddn(1);\n this.inotn(bits + 1);\n this.ineg();\n }\n\n return this.iumaskn(bits);\n }\n\n maskn(bits) {\n return this.clone().imaskn(bits);\n }\n\n iumaskn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = bits % 26;\n\n let s = (bits - r) / 26;\n\n if (this.length <= s)\n return this;\n\n if (r !== 0)\n s += 1;\n\n this.length = Math.min(s, this.length);\n\n if (r !== 0)\n this.words[this.length - 1] &= (1 << r) - 1;\n\n if (this.length === 0)\n this.words[this.length++] = 0;\n\n return this._strip();\n }\n\n umaskn(bits) {\n return this.clone().iumaskn(bits);\n }\n\n andln(num) {\n return this.words[0] & num;\n }\n\n bit(pos) {\n return this.utestn(pos);\n }\n\n bits(pos, width) {\n enforce((pos >>> 0) === pos, 'pos', 'uint32');\n enforce((width >>> 0) === width, 'width', 'uint32');\n enforce(width <= 26, 'width', 'width');\n\n const shift = pos % 26;\n const index = (pos - shift) / 26;\n\n if (index >= this.length)\n return 0;\n\n let bits = (this.words[index] >> shift) & ((1 << width) - 1);\n\n if (shift + width > 26 && index + 1 < this.length) {\n const more = shift + width - 26;\n const next = this.words[index + 1] & ((1 << more) - 1);\n\n bits |= next << (26 - shift);\n }\n\n return bits;\n }\n\n /*\n * Negation\n */\n\n ineg() {\n if (!this.isZero())\n this.negative ^= 1;\n\n return this;\n }\n\n neg() {\n return this.clone().ineg();\n }\n\n iabs() {\n this.negative = 0;\n return this;\n }\n\n abs() {\n return this.clone().iabs();\n }\n\n /*\n * Comparison\n */\n\n cmp(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative !== num.negative)\n return num.negative - this.negative;\n\n const res = this.ucmp(num);\n\n if (this.negative !== 0)\n return -res | 0;\n\n return res;\n }\n\n cmpn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (this.negative !== negative)\n return negative - this.negative;\n\n const res = this.ucmpn(num);\n\n if (this.negative !== 0)\n return -res | 0;\n\n return res;\n }\n\n eq(num) {\n return this.cmp(num) === 0;\n }\n\n eqn(num) {\n return this.cmpn(num) === 0;\n }\n\n gt(num) {\n return this.cmp(num) > 0;\n }\n\n gtn(num) {\n return this.cmpn(num) > 0;\n }\n\n gte(num) {\n return this.cmp(num) >= 0;\n }\n\n gten(num) {\n return this.cmpn(num) >= 0;\n }\n\n lt(num) {\n return this.cmp(num) < 0;\n }\n\n ltn(num) {\n return this.cmpn(num) < 0;\n }\n\n lte(num) {\n return this.cmp(num) <= 0;\n }\n\n lten(num) {\n return this.cmpn(num) <= 0;\n }\n\n sign() {\n if (this.negative !== 0)\n return -1;\n\n if (this.length === 1 && this.words[0] === 0)\n return 0;\n\n return 1;\n }\n\n isZero() {\n return this.length === 1 && this.words[0] === 0;\n }\n\n isNeg() {\n return this.negative !== 0;\n }\n\n isPos() {\n return this.negative === 0;\n }\n\n isOdd() {\n return (this.words[0] & 1) === 1;\n }\n\n isEven() {\n return (this.words[0] & 1) === 0;\n }\n\n /*\n * Unsigned Comparison\n */\n\n ucmp(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.length < num.length)\n return -1;\n\n if (this.length > num.length)\n return 1;\n\n for (let i = this.length - 1; i >= 0; i--) {\n const a = this.words[i] | 0;\n const b = num.words[i] | 0;\n\n if (a === b)\n continue;\n\n return (a > b) - (a < b);\n }\n\n return 0;\n }\n\n ucmpn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if (this.length > 1)\n return 1;\n\n const w = this.words[0] | 0;\n\n if (num < 0)\n num = -num;\n\n return (w > num) - (w < num);\n }\n\n /*\n * Number Theoretic Functions\n */\n\n legendre(num) {\n const red = HAS_BIGINT ? BN.red(num) : BN.mont(num);\n return this.toRed(red).redLegendre();\n }\n\n jacobi(num) {\n // See: A Binary Algorithm for the Jacobi Symbol\n // J. Shallit, J. Sorenson\n // Page 3, Section 3\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (num.isZero() || num.isEven())\n throw new Error('jacobi: `num` must be odd.');\n\n let a = this._cloneNormal();\n let b = num.clone();\n let j = 1;\n\n if (b.isNeg()) {\n if (a.isNeg())\n j = -1;\n b.ineg();\n }\n\n if (a.isNeg() || a.ucmp(b) >= 0)\n a.imod(b);\n\n while (!a.isZero()) {\n const bits = a._makeOdd();\n\n if (bits & 1) {\n const bmod8 = b.andln(7);\n\n if (bmod8 === 3 || bmod8 === 5)\n j = -j;\n }\n\n if (a.ucmp(b) < 0) {\n [a, b] = [b, a];\n\n if (a.andln(3) === 3 && b.andln(3) === 3)\n j = -j;\n }\n\n a._isub(a, b).iushrn(1);\n\n const bmod8 = b.andln(7);\n\n if (bmod8 === 3 || bmod8 === 5)\n j = -j;\n }\n\n if (b.cmpn(1) !== 0)\n return 0;\n\n return j;\n }\n\n kronecker(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero())\n return num.ucmpn(1) === 0 ? 1 : 0;\n\n if (num.isZero())\n return this.ucmpn(1) === 0 ? 1 : 0;\n\n if (((this.words[0] | num.words[0]) & 1) === 0)\n return 0;\n\n const x = this;\n const y = num.clone();\n const bits = y._makeOdd();\n const table = [0, 1, 0, -1, 0, -1, 0, 1];\n\n let k = x.jacobi(y);\n\n if (bits & 1)\n k *= table[x.andln(7)];\n\n return k | 0;\n }\n\n igcd(num) {\n return this.gcd(num)._move(this);\n }\n\n gcd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero())\n return num.abs();\n\n if (num.isZero())\n return this.abs();\n\n let a = this.clone();\n let b = num.clone();\n\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two.\n const shift = a._factor2(b);\n\n if (shift !== 0) {\n a.iushrn(shift);\n b.iushrn(shift);\n }\n\n for (;;) {\n a._makeOdd();\n b._makeOdd();\n\n const cmp = a.ucmp(b);\n\n if (cmp < 0) {\n // a > b\n [a, b] = [b, a];\n } else if (cmp === 0 || b.ucmpn(1) === 0) {\n // Break if a == b.\n // Break if b == 1 to avoid repeated subtraction.\n break;\n }\n\n a._isub(a, b);\n }\n\n return b.iushln(shift);\n }\n\n ilcm(num) {\n return this.lcm(num)._move(this);\n }\n\n lcm(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero() || num.isZero())\n return new BN(0);\n\n return this.quo(this.gcd(num)).mul(num).iabs();\n }\n\n egcd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero()) {\n return [\n new BN(0),\n new BN(num.sign()),\n num.abs()\n ];\n }\n\n if (num.isZero()) {\n return [\n new BN(this.sign()),\n new BN(0),\n this.abs()\n ];\n }\n\n const x = this.clone();\n const y = num.clone();\n\n x.negative = 0;\n y.negative = 0;\n\n // A * x + B * y = x\n const A = new BN(1);\n const B = new BN(0);\n\n // C * x + D * y = y\n const C = new BN(0);\n const D = new BN(1);\n\n // Remove common factor of two.\n const g = x._factor2(y);\n\n if (g > 0) {\n x.iushrn(g);\n y.iushrn(g);\n }\n\n const xp = x.clone();\n const yp = y.clone();\n\n while (!x.isZero()) {\n let i = x._makeOdd();\n let j = y._makeOdd();\n\n while (i--) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n\n while (j--) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n if (this.negative !== 0)\n C.ineg();\n\n if (num.negative !== 0)\n D.ineg();\n\n return [C, D, y.iushln(g)];\n }\n\n iinvert(num) {\n return this.invert(num)._move(this);\n }\n\n invert(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n range(num.sign() > 0, 'invert');\n\n if (num.isOdd())\n return this._invertp(num);\n\n if (num.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n const [s,, g] = this.egcd(num);\n\n if (g.cmpn(1) !== 0)\n throw new RangeError('Not invertible.');\n\n return s.imod(num);\n }\n\n ifermat(num) {\n return this.fermat(num)._move(this);\n }\n\n fermat(num) {\n const red = HAS_BIGINT ? BN.red(num) : BN.mont(num);\n return this.toRed(red).redFermat().fromRed();\n }\n\n ipowm(y, m, mont) {\n return this.powm(y, m, mont)._move(this);\n }\n\n powm(y, m, mont) {\n const red = !HAS_BIGINT && mont ? BN.mont(m) : BN.red(m);\n return this.toRed(red).redPow(y).fromRed();\n }\n\n ipowmn(y, m, mont) {\n return this.powmn(y, m, mont)._move(this);\n }\n\n powmn(y, m, mont) {\n const red = mont ? BN.mont(m) : BN.red(m);\n return this.toRed(red).redPown(y).fromRed();\n }\n\n isqrtm(p) {\n return this.sqrtm(p)._move(this);\n }\n\n sqrtm(p) {\n enforce(BN.isBN(p), 'p', 'bignum');\n\n let red;\n\n if (p.andln(3) === 3 || p.andln(7) === 5) {\n // Probably not worth the setup.\n red = BN.red(p);\n } else {\n red = BN.mont(p);\n }\n\n return this.toRed(red).redSqrt().fromRed();\n }\n\n isqrtpq(p, q) {\n return this.sqrtpq(p, q)._move(this);\n }\n\n sqrtpq(p, q) {\n const sp = this.sqrtm(p);\n const sq = this.sqrtm(q);\n const [mp, mq] = p.egcd(q);\n const lhs = sq.mul(mp).mul(p);\n const rhs = sp.mul(mq).mul(q);\n const n = p.mul(q);\n\n return lhs.iadd(rhs).imod(n);\n }\n\n /*\n * Primality Testing\n */\n\n isPrime(rng, reps, limit) {\n enforce((reps >>> 0) === reps, 'reps', 'uint32');\n\n if (!this.isPrimeMR(rng, reps + 1, true))\n return false;\n\n if (!this.isPrimeLucas(limit))\n return false;\n\n return true;\n }\n\n isPrimeMR(rng, reps, force2 = false) {\n enforce((reps >>> 0) === reps, 'reps', 'uint32');\n enforce(reps > 0, 'reps', 'integer');\n enforce(typeof force2 === 'boolean', 'force2', 'boolean');\n\n const n = this;\n\n if (n.cmpn(7) < 0) {\n return n.cmpn(2) === 0\n || n.cmpn(3) === 0\n || n.cmpn(5) === 0;\n }\n\n if (n.isEven())\n return false;\n\n const nm1 = n.subn(1);\n const nm3 = nm1.subn(2);\n const k = nm1.zeroBits();\n const q = nm1.ushrn(k);\n\n const red = BN.red(n);\n const rnm1 = nm1.toRed(red);\n const rone = new BN(1).toRed(red);\n\nnext:\n for (let i = 0; i < reps; i++) {\n let x;\n\n if (i === reps - 1 && force2) {\n x = new BN(2);\n } else {\n x = BN.random(rng, 0, nm3);\n x.iaddn(2);\n }\n\n let y = x.toRed(red).redPow(q);\n\n if (y.cmp(rone) === 0 || y.cmp(rnm1) === 0)\n continue;\n\n for (let j = 1; j < k; j++) {\n y = y.redSqr();\n\n if (y.cmp(rnm1) === 0)\n continue next;\n\n if (y.cmp(rone) === 0)\n return false;\n }\n\n return false;\n }\n\n return true;\n }\n\n isPrimeLucas(limit = 0) {\n enforce((limit >>> 0) === limit, 'limit', 'uint32');\n\n const n = this;\n\n // Ignore 0 and 1.\n if (n.cmpn(1) <= 0)\n return false;\n\n // Two is the only even prime.\n if (n.isEven())\n return n.cmpn(2) === 0;\n\n let p = 3;\n\n for (;;) {\n if (p > 10000) {\n // Thought to be impossible.\n throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`);\n }\n\n if (limit !== 0 && p > limit) {\n // Optional DoS limit.\n return false;\n }\n\n const d = new BN(p * p - 4);\n const j = d.jacobi(n);\n\n if (j === -1)\n break;\n\n if (j === 0)\n return n.cmpn(p + 2) === 0;\n\n if (p === 40) {\n if (n.isSquare())\n return false;\n }\n\n p += 1;\n }\n\n const s = n.addn(1);\n const r = s._makeOdd();\n\n let vk = new BN(2);\n let vk1 = new BN(p);\n\n for (let i = s.bitLength(); i >= 0; i--) {\n if (s.utestn(i)) {\n vk = vk.mul(vk1).isubn(p).imod(n);\n vk1 = vk1.sqr().isubn(2).imod(n);\n } else {\n vk1 = vk1.mul(vk).isubn(p).imod(n);\n vk = vk.sqr().isubn(2).imod(n);\n }\n }\n\n if (vk.cmpn(2) === 0 || vk.cmp(n.subn(2)) === 0) {\n const a = vk.muln(p).imod(n);\n const b = vk1.ushln(1).imod(n);\n\n if (a.cmp(b) === 0)\n return true;\n }\n\n for (let t = 0; t < r - 1; t++) {\n if (vk.isZero())\n return true;\n\n if (vk.cmpn(2) === 0)\n return false;\n\n vk = vk.sqr().isubn(2).imod(n);\n }\n\n return false;\n }\n\n /*\n * Twos Complement\n */\n\n toTwos(width) {\n if (this.negative !== 0)\n return this.abs().inotn(width).iaddn(1);\n\n return this.clone();\n }\n\n fromTwos(width) {\n enforce((width >>> 0) === width, 'width', 'uint32');\n range(width > 0, 'width');\n\n if (this.testn(width - 1))\n return this.notn(width).iaddn(1).ineg();\n\n return this.clone();\n }\n\n /*\n * Reduction Context\n */\n\n toRed(ctx) {\n enforce(ctx instanceof Red, 'ctx', 'reduction context');\n\n if (this.red)\n throw new Error('Already in reduction context.');\n\n return ctx.convertTo(this);\n }\n\n fromRed() {\n red(this.red, 'fromRed');\n return this.red.convertFrom(this);\n }\n\n forceRed(ctx) {\n enforce(ctx instanceof Red, 'ctx', 'reduction context');\n\n if (this.red) {\n if (!ctx.m.eq(this.red.m) || ctx.mont !== this.red.mont)\n throw new Error('Already in reduction context.');\n } else {\n range(this.negative === 0, 'red');\n range(this.ucmp(ctx.m) < 0, 'red');\n }\n\n return this.clone()._forceRed(ctx);\n }\n\n redIAdd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIAdd');\n return this.red.iadd(this, num);\n }\n\n redAdd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redAdd');\n return this.red.add(this, num);\n }\n\n redIAddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIAddn');\n return this.red.iaddn(this, num);\n }\n\n redAddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redAddn');\n return this.red.addn(this, num);\n }\n\n redISub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redISub');\n return this.red.isub(this, num);\n }\n\n redSub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redSub');\n return this.red.sub(this, num);\n }\n\n redISubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redISubn');\n return this.red.isubn(this, num);\n }\n\n redSubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redSubn');\n return this.red.subn(this, num);\n }\n\n redIMul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIMul');\n return this.red.imul(this, num);\n }\n\n redMul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redMul');\n return this.red.mul(this, num);\n }\n\n redIMuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIMuln');\n return this.red.imuln(this, num);\n }\n\n redMuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redMuln');\n return this.red.muln(this, num);\n }\n\n redIDiv(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIDiv');\n return this.red.idiv(this, num);\n }\n\n redDiv(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redDiv');\n return this.red.div(this, num);\n }\n\n redIDivn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIDivn');\n return this.red.idivn(this, num);\n }\n\n redDivn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redDivn');\n return this.red.divn(this, num);\n }\n\n redIPow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIPow');\n nonred(!num.red, 'redIPow');\n return this.red.ipow(this, num);\n }\n\n redPow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redPow');\n nonred(!num.red, 'redPow');\n return this.red.pow(this, num);\n }\n\n redIPown(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIPown');\n return this.red.ipown(this, num);\n }\n\n redPown(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redPown');\n return this.red.pown(this, num);\n }\n\n redISqr() {\n red(this.red, 'redISqr');\n return this.red.isqr(this);\n }\n\n redSqr() {\n red(this.red, 'redSqr');\n return this.red.sqr(this);\n }\n\n redISqrt() {\n red(this.red, 'redISqrt');\n return this.red.isqrt(this);\n }\n\n redSqrt() {\n red(this.red, 'redSqrt');\n return this.red.sqrt(this);\n }\n\n redIDivSqrt(v) {\n red(this.red, 'redIDivSqrt');\n return this.red.idivsqrt(this, v);\n }\n\n redDivSqrt(v) {\n red(this.red, 'redDivSqrt');\n return this.red.divsqrt(this, v);\n }\n\n redIsSquare() {\n red(this.red, 'redIsSquare');\n return this.red.isSquare(this);\n }\n\n redIShl(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIShl');\n nonred(!num.red, 'redIShl');\n return this.red.ishl(this, num);\n }\n\n redShl(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redShl');\n nonred(!num.red, 'redShl');\n return this.red.shl(this, num);\n }\n\n redIShln(num) {\n enforce((num >>> 0) === num, 'num', 'uint32');\n red(this.red, 'redIShln');\n return this.red.ishln(this, num);\n }\n\n redShln(num) {\n enforce((num >>> 0) === num, 'num', 'uint32');\n red(this.red, 'redShln');\n return this.red.shln(this, num);\n }\n\n redINeg() {\n red(this.red, 'redINeg');\n return this.red.ineg(this);\n }\n\n redNeg() {\n red(this.red, 'redNeg');\n return this.red.neg(this);\n }\n\n redEq(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redEq');\n return this.red.eq(this, num);\n }\n\n redEqn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redEqn');\n return this.red.eqn(this, num);\n }\n\n redIsHigh() {\n red(this.red, 'redIsHigh');\n return this.red.isHigh(this);\n }\n\n redIsLow() {\n red(this.red, 'redIsLow');\n return this.red.isLow(this);\n }\n\n redIsOdd() {\n red(this.red, 'redIsOdd');\n return this.red.isOdd(this);\n }\n\n redIsEven() {\n red(this.red, 'redIsEven');\n return this.red.isEven(this);\n }\n\n redLegendre() {\n red(this.red, 'redLegendre');\n return this.red.legendre(this);\n }\n\n redJacobi() {\n red(this.red, 'redJacobi');\n return this.red.jacobi(this);\n }\n\n redKronecker() {\n red(this.red, 'redKronecker');\n return this.red.kronecker(this);\n }\n\n redIInvert() {\n red(this.red, 'redIInvert');\n return this.red.iinvert(this);\n }\n\n redInvert() {\n red(this.red, 'redInvert');\n return this.red.invert(this);\n }\n\n redIFermat() {\n red(this.red, 'redIFermat');\n return this.red.ifermat(this);\n }\n\n redFermat() {\n red(this.red, 'redFermat');\n return this.red.fermat(this);\n }\n\n /*\n * Internal\n */\n\n _move(dest) {\n dest.words = this.words;\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n return dest;\n }\n\n _alloc(size) {\n while (this.words.length < size)\n this.words.push(0);\n\n return this;\n }\n\n _expand(size) {\n this._alloc(size);\n\n while (this.length < size)\n this.words[this.length++] = 0;\n\n return this;\n }\n\n _strip() {\n while (this.length > 1 && this.words[this.length - 1] === 0)\n this.length -= 1;\n\n return this._normalize();\n }\n\n _normalize() {\n assert(this.length > 0);\n\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0)\n this.negative = 0;\n\n return this;\n }\n\n _check() {\n // We never have a zero length number.\n assert(this.length > 0);\n\n // Cannot exceed array bounds.\n assert(this.length <= this.words.length);\n\n if (this.length === 1) {\n // Must be normalized.\n if (this.words[0] === 0)\n assert(this.negative === 0);\n return this;\n }\n\n // Must be stripped.\n assert(this.words[this.length - 1] !== 0);\n\n return this;\n }\n\n _invertp(p) {\n // Penk's right shift binary EGCD.\n //\n // See: The Art of Computer Programming,\n // Volume 2, Seminumerical Algorithms\n // Donald E. Knuth\n // Exercise 4.5.2.39\n enforce(BN.isBN(p), 'p', 'bignum');\n range(p.sign() > 0, 'invert');\n assert(p.isOdd());\n\n if (p.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n const a = this.clone();\n const b = p.clone();\n const u = new BN(1);\n const v = new BN(0);\n\n if (a.isNeg() || a.ucmp(b) >= 0)\n a.imod(b);\n\n while (!a.isZero()) {\n let i = a._makeOdd();\n let j = b._makeOdd();\n\n while (i--) {\n if (u.isOdd())\n u._iadd(u, p);\n\n u.iushrn(1);\n }\n\n while (j--) {\n if (v.isOdd())\n v._iadd(v, p);\n\n v.iushrn(1);\n }\n\n if (a.ucmp(b) >= 0) {\n a._isub(a, b);\n if (u.ucmp(v) < 0) {\n u._isub(v, u);\n u._isub(p, u);\n } else {\n u._isub(u, v);\n }\n } else {\n b._isub(b, a);\n if (v.ucmp(u) < 0) {\n v._isub(u, v);\n v._isub(p, v);\n } else {\n v._isub(v, u);\n }\n }\n }\n\n if (b.cmpn(1) !== 0)\n throw new RangeError('Not invertible.');\n\n assert(v.negative === 0);\n assert(v.ucmp(p) < 0);\n\n return v;\n }\n\n _makeOdd() {\n const shift = this.zeroBits();\n\n if (shift > 0)\n this.iushrn(shift);\n\n return shift;\n }\n\n _factor2(num) {\n // Find common factor of two.\n // Expects inputs to be non-zero.\n if ((this.words[0] | num.words[0]) & 1)\n return 0;\n\n const len = Math.min(this.length, num.length);\n\n let r = 0;\n\n for (let i = 0; i < len; i++) {\n const b = zeroBits(this.words[i] | num.words[i]);\n\n r += b;\n\n if (b !== 26)\n break;\n }\n\n return r;\n }\n\n _cloneNormal() {\n return this.red ? this.fromRed() : this.clone();\n }\n\n _forceRed(ctx) {\n this.red = ctx;\n return this;\n }\n\n /*\n * Helpers\n */\n\n clone() {\n const copy = new BN();\n\n copy.words = new Array(this.length);\n\n for (let i = 0; i < this.length; i++)\n copy.words[i] = this.words[i];\n\n copy.length = this.length;\n copy.negative = this.negative;\n copy.red = this.red;\n\n return copy;\n }\n\n inject(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this._alloc(num.length);\n\n for (let i = 0; i < num.length; i++)\n this.words[i] = num.words[i];\n\n this.length = num.length;\n this.negative = num.negative;\n this.red = num.red;\n\n return this;\n }\n\n set(num, endian) {\n return this.fromNumber(num, endian);\n }\n\n swap(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n const x = this;\n const y = num;\n\n [x.words, y.words] = [y.words, x.words];\n [x.length, y.length] = [y.length, x.length];\n [x.negative, y.negative] = [y.negative, x.negative];\n [x.red, y.red] = [y.red, x.red];\n\n return x;\n }\n\n reverse() {\n const neg = this.negative;\n\n this.fromBuffer(this.toBuffer('be'), 'le');\n this.negative = neg;\n\n return this;\n }\n\n byteLength() {\n return Math.ceil(this.bitLength() / 8);\n }\n\n bitLength() {\n const w = this.words[this.length - 1];\n const hi = countBits(w);\n return (this.length - 1) * 26 + hi;\n }\n\n zeroBits() {\n if (this.isZero())\n return 0;\n\n if (this.isOdd())\n return 0;\n\n let r = 0;\n\n for (let i = 0; i < this.length; i++) {\n const b = zeroBits(this.words[i]);\n\n r += b;\n\n if (b !== 26)\n break;\n }\n\n return r;\n }\n\n isSafe() {\n if (this.length <= 2)\n return true;\n\n if (this.length === 3 && this.words[2] === 0x01)\n return true;\n\n return false;\n }\n\n word(pos) {\n enforce((pos >>> 0) === pos, 'pos', 'uint32');\n\n if (pos >= this.length)\n return 0;\n\n return this.words[pos];\n }\n\n [custom]() {\n let prefix = 'BN';\n\n if (this.red)\n prefix = 'BN-R';\n\n return `<${prefix}: ${this.toString(10)}>`;\n }\n\n /*\n * Conversion\n */\n\n toNumber() {\n let num = this.words[0];\n\n if (this.length === 2) {\n num += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // Note: at this stage it is known that the top bit is set.\n num += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n throw new RangeError('Number can only safely store up to 53 bits.');\n }\n\n return this.negative !== 0 ? -num : num;\n }\n\n toDouble() {\n let num = 0;\n\n for (let i = this.length - 1; i >= 0; i--)\n num = (num * 0x4000000) + this.words[i];\n\n return this.negative !== 0 ? -num : num;\n }\n\n valueOf() {\n return this.toDouble();\n }\n\n toBigInt() {\n if (!HAS_BIGINT)\n throw new Error('BigInt is not supported!');\n\n const s52 = BigInt(52);\n const s26 = BigInt(26);\n\n let i = this.length - 1;\n let num = BigInt(0);\n\n for (; i >= 1; i -= 2) {\n const hi = this.words[i] * 0x4000000;\n const lo = this.words[i - 1];\n\n num = (num << s52) | BigInt(hi + lo);\n }\n\n if (i >= 0)\n num = (num << s26) | BigInt(this.words[0]);\n\n return this.negative !== 0 ? -num : num;\n }\n\n toBool() {\n return !this.isZero();\n }\n\n toString(base, padding) {\n base = getBase(base);\n\n if (padding == null)\n padding = 0;\n\n if (padding === 0)\n padding = 1;\n\n enforce((base >>> 0) === base, 'base', 'uint32');\n enforce((padding >>> 0) === padding, 'padding', 'uint32');\n\n if (base < 2 || base > 36)\n throw new RangeError('Base ranges between 2 and 36.');\n\n this._check();\n\n if (base === 16) {\n let out = '';\n let off = 0;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = this.words[i];\n const word = (((w << off) | carry) & 0xffffff).toString(16);\n\n carry = (w >>> (24 - off)) & 0xffffff;\n\n if (carry !== 0 || i !== this.length - 1)\n out = zeros[6 - word.length] + word + out;\n else\n out = word + out;\n\n off += 2;\n\n if (off >= 26) {\n off -= 26;\n i -= 1;\n }\n }\n\n if (carry !== 0)\n out = carry.toString(16) + out;\n\n while (out.length % padding !== 0)\n out = '0' + out;\n\n if (this.negative !== 0)\n out = '-' + out;\n\n return out;\n }\n\n const groupSize = groupSizes[base - 1];\n const groupBase = groupBases[base - 1];\n const c = this.clone();\n\n let out = '';\n\n c.negative = 0;\n\n while (!c.isZero()) {\n const r = c.remrn(groupBase).toString(base);\n\n c.iquon(groupBase);\n\n if (!c.isZero())\n out = zeros[groupSize - r.length] + r + out;\n else\n out = r + out;\n }\n\n if (this.isZero())\n out = '0';\n\n while (out.length % padding !== 0)\n out = '0' + out;\n\n if (this.negative !== 0)\n out = '-' + out;\n\n return out;\n }\n\n toJSON() {\n return this.toString(16, 2);\n }\n\n toArray(endian, length) {\n return this.toArrayLike(Array, endian, length);\n }\n\n toBuffer(endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n }\n\n toArrayLike(ArrayType, endian, length) {\n if (endian == null)\n endian = 'be';\n\n if (length == null)\n length = 0;\n\n enforce(typeof ArrayType === 'function', 'ArrayType', 'function');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n enforce((length >>> 0) === length, 'length', 'uint32');\n\n this._check();\n\n const bytes = this.byteLength();\n const size = length || Math.max(1, bytes);\n\n if (bytes > size)\n throw new RangeError('Byte array longer than desired length.');\n\n const res = allocate(ArrayType, size);\n\n // See: https://github.com/indutny/bn.js/pull/222\n if (endian === 'be') {\n let pos = res.length - 1;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const shift = (i & 3) << 1;\n const word = (this.words[i] << shift) | carry;\n\n res[pos--] = word & 0xff;\n\n if (pos >= 0)\n res[pos--] = (word >>> 8) & 0xff;\n\n if (pos >= 0)\n res[pos--] = (word >>> 16) & 0xff;\n\n if (shift === 6) {\n if (pos >= 0)\n res[pos--] = (word >>> 24) & 0xff;\n\n carry = 0;\n } else {\n carry = word >>> 24;\n }\n }\n\n if (pos >= 0) {\n res[pos--] = carry;\n\n while (pos >= 0)\n res[pos--] = 0;\n\n carry = 0;\n }\n\n assert(carry === 0);\n } else {\n let pos = 0;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const shift = (i & 3) << 1;\n const word = (this.words[i] << shift) | carry;\n\n res[pos++] = word & 0xff;\n\n if (pos < res.length)\n res[pos++] = (word >>> 8) & 0xff;\n\n if (pos < res.length)\n res[pos++] = (word >>> 16) & 0xff;\n\n if (shift === 6) {\n if (pos < res.length)\n res[pos++] = (word >>> 24) & 0xff;\n\n carry = 0;\n } else {\n carry = word >>> 24;\n }\n }\n\n if (pos < res.length) {\n res[pos++] = carry;\n\n while (pos < res.length)\n res[pos++] = 0;\n\n carry = 0;\n }\n\n assert(carry === 0);\n }\n\n return res;\n }\n\n encode(endian, length) {\n return this.toBuffer(endian, length);\n }\n\n /*\n * Instantiation\n */\n\n of(num, endian) {\n return this.fromNumber(num, endian);\n }\n\n fromNumber(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(isInteger(num), 'num', 'integer');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n if (num < 0x4000000) {\n this.words[0] = num & 0x3ffffff;\n this.length = 1;\n } else if (num < 0x10000000000000) {\n this.words = [\n num & 0x3ffffff,\n (num / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n this.words = [\n num & 0x3ffffff,\n (num / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n this.negative = neg;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromDouble(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(typeof num === 'number', 'num', 'double');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (!isFinite(num))\n num = 0;\n\n const neg = (num <= -1) | 0;\n\n if (num < 0)\n num = -num;\n\n num = Math.floor(num);\n\n this.words = [];\n\n while (num > 0) {\n const lo = num % 0x4000000;\n const hi = (num - lo) / 0x4000000;\n\n this.words.push(lo);\n\n num = hi;\n }\n\n if (this.words.length === 0)\n this.words.push(0);\n\n this.length = this.words.length;\n this.negative = neg;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromBigInt(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(typeof num === 'bigint', 'num', 'bigint');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (!HAS_BIGINT)\n throw new Error('BigInt is not supported!');\n\n // You know the implementation has a\n // problem when strings are twice\n // as fast as bigints.\n const start = (num < BigInt(0)) | 0;\n\n this._fromHex(num.toString(16), start);\n this.negative = start;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromBool(value) {\n enforce(typeof value === 'boolean', 'value', 'boolean');\n\n this.words[0] = value | 0;\n this.length = 1;\n this.negative = 0;\n\n return this;\n }\n\n fromString(str, base, endian) {\n if (base === 'le' || base === 'be')\n [base, endian] = [endian, base];\n\n base = getBase(base);\n\n if (endian == null)\n endian = 'be';\n\n enforce(typeof str === 'string', 'string', 'string');\n enforce((base >>> 0) === base, 'base', 'uint32');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (base < 2 || base > 36)\n throw new Error('Base ranges between 2 and 36.');\n\n str = str.replace(/\\s+/g, '');\n\n let start = 0;\n\n if (str.length > 0 && str.charCodeAt(0) === 0x2d)\n start = 1;\n\n if (base === 16)\n this._fromHex(str, start);\n else\n this._fromBase(str, base, start);\n\n this.negative = start;\n\n this._normalize();\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n _fromHex(str, start) {\n this.length = Math.max(2, Math.ceil((str.length - start) / 6));\n this.words = new Array(this.length);\n\n for (let i = 0; i < this.length; i++)\n this.words[i] = 0;\n\n // Scan 24-bit chunks and add them to the number.\n let off = 0;\n let i = str.length - 6;\n let j = 0;\n\n for (; i >= start; i -= 6) {\n const w = parseHex(str, i, i + 6);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n\n // `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb.\n this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n if (i + 6 !== start) {\n const w = parseHex(str, start, i + 6);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff;\n }\n\n return this._strip();\n }\n\n _fromBase(str, base, start) {\n // Initialize as zero.\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n\n // Find length of limb in base.\n let limbLen = 0;\n let limbPow = 1;\n\n for (; limbPow <= 0x3ffffff; limbPow *= base)\n limbLen += 1;\n\n limbLen -= 1;\n limbPow = (limbPow / base) | 0;\n\n const total = str.length - start;\n const mod = total % limbLen;\n const end = Math.min(total, total - mod) + start;\n\n let i = start;\n\n for (; i < end; i += limbLen) {\n const word = parseBase(str, i, i + limbLen, base);\n\n this.imuln(limbPow);\n this._iaddn(word);\n }\n\n if (mod !== 0) {\n const pow = Math.pow(base, mod);\n const word = parseBase(str, i, str.length, base);\n\n this.imuln(pow);\n this._iaddn(word);\n }\n\n return this;\n }\n\n fromJSON(json) {\n if (BN.isBN(json)) {\n if (json.red)\n return json.fromRed();\n\n return json.clone();\n }\n\n if (Array.isArray(json)) {\n for (const chunk of json)\n enforce(typeof chunk === 'string', 'chunk', 'string');\n\n json = json.join('');\n }\n\n return this.fromString(json, 16);\n }\n\n fromBN(num) {\n return this.inject(num);\n }\n\n fromArray(data, endian) {\n enforce(Array.isArray(data), 'data', 'array');\n return this.fromArrayLike(data, endian);\n }\n\n fromBuffer(data, endian) {\n enforce(Buffer.isBuffer(data), 'data', 'buffer');\n return this.fromArrayLike(data, endian);\n }\n\n fromArrayLike(data, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(data && (data.length >>> 0) === data.length, 'data', 'array-like');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (data.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n this.length = Math.max(2, Math.ceil(data.length / 3));\n this.words = new Array(this.length);\n this.negative = 0;\n\n for (let i = 0; i < this.length; i++)\n this.words[i] = 0;\n\n const left = data.length % 3;\n\n let off = 0;\n let j = 0;\n let w = 0;\n\n if (endian === 'be') {\n for (let i = data.length - 1; i >= 2; i -= 3) {\n const w = data[i] | (data[i - 1] << 8) | (data[i - 2] << 16);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n switch (left) {\n case 2:\n w = data[1] | (data[0] << 8);\n break;\n case 1:\n w = data[0];\n break;\n }\n } else {\n const len = data.length - left;\n\n for (let i = 0; i < len; i += 3) {\n const w = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n switch (left) {\n case 2:\n w = data[len] | (data[len + 1] << 8);\n break;\n case 1:\n w = data[len];\n break;\n }\n }\n\n if (left > 0) {\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n }\n\n return this._strip();\n }\n\n decode(data, endian) {\n return this.fromBuffer(data, endian);\n }\n\n from(num, base, endian) {\n if (num == null)\n return this;\n\n if (base === 'le' || base === 'be')\n [base, endian] = [endian, base];\n\n if (typeof num === 'number')\n return this.fromNumber(num, endian);\n\n if (typeof num === 'bigint')\n return this.fromBigInt(num, endian);\n\n if (typeof num === 'string')\n return this.fromString(num, base, endian);\n\n if (typeof num === 'object') {\n if (BN.isBN(num))\n return this.fromBN(num, endian);\n\n if ((num.length >>> 0) === num.length)\n return this.fromArrayLike(num, endian);\n }\n\n if (typeof num === 'boolean')\n return this.fromBool(num);\n\n throw new TypeError('Non-numeric object passed to BN.');\n }\n\n /*\n * Static Methods\n */\n\n static min(...args) {\n let min = null;\n\n for (const num of args) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (!min || num.cmp(min) < 0)\n min = num;\n }\n\n return min || new BN(0);\n }\n\n static max(...args) {\n let max = null;\n\n for (const num of args) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (!max || num.cmp(max) > 0)\n max = num;\n }\n\n return max || new BN(0);\n }\n\n static cmp(a, b) {\n enforce(BN.isBN(a), 'a', 'bignum');\n return a.cmp(b);\n }\n\n static ucmp(a, b) {\n enforce(BN.isBN(a), 'a', 'bignum');\n return a.ucmp(b);\n }\n\n static red(num) {\n return new Red(num);\n }\n\n static barrett(num) {\n return new Barrett(num);\n }\n\n static mont(num) {\n return new Mont(num);\n }\n\n static _prime(name) {\n if (primes[name])\n return primes[name];\n\n let prime;\n\n if (name === 'p192')\n prime = new P192();\n else if (name === 'p224')\n prime = new P224();\n else if (name === 'p521')\n prime = new P521();\n else if (name === 'k256')\n prime = new K256();\n else if (name === 'p251')\n prime = new P251();\n else if (name === 'p25519')\n prime = new P25519();\n else if (name === 'p448')\n prime = new P448();\n else\n throw new Error(`Unknown prime: \"${name}\".`);\n\n primes[name] = prime;\n\n return prime;\n }\n\n static prime(name) {\n return BN._prime(name).p.clone();\n }\n\n static pow(num, exp) {\n if (num === 2)\n return BN.shift(1, exp);\n\n return new BN().fromNumber(num).pown(exp);\n }\n\n static shift(num, bits) {\n if (num === 1)\n return new BN(0).usetn(bits, 1);\n\n return new BN().fromNumber(num).ishln(bits);\n }\n\n static mask(bits) {\n return BN.shift(1, bits).isubn(1);\n }\n\n static randomBits(rng, bits) {\n enforce(rng != null, 'rng', 'rng');\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (typeof rng === 'object') {\n enforce(typeof rng.randomBytes === 'function', 'rng', 'rng');\n\n const size = (bits + 7) >>> 3;\n const total = size * 8;\n const bytes = rng.randomBytes(size);\n\n enforce(Buffer.isBuffer(bytes), 'bytes', 'buffer');\n\n if (bytes.length !== size)\n throw new RangeError('Invalid number of bytes returned from RNG.');\n\n const num = BN.fromBuffer(bytes);\n\n if (total > bits)\n num.iushrn(total - bits);\n\n return num;\n }\n\n enforce(typeof rng === 'function', 'rng', 'rng');\n\n const num = rng(bits);\n\n enforce(BN.isBN(num), 'num', 'bignum');\n range(num.negative === 0, 'RNG');\n nonred(!num.red, 'RNG');\n\n if (num.bitLength() > bits)\n throw new RangeError('Invalid number of bits returned from RNG.');\n\n return num;\n }\n\n static random(rng, min, max) {\n min = BN.cast(min, 16);\n max = BN.cast(max, 16);\n\n if (min.cmp(max) > 0)\n throw new RangeError('Minimum cannot be greater than maximum.');\n\n const space = max.sub(min).iabs();\n const bits = space.bitLength();\n\n if (bits === 0)\n return min.clone();\n\n for (;;) {\n const num = BN.randomBits(rng, bits);\n\n // Maximum is _exclusive_!\n if (num.cmp(space) >= 0)\n continue;\n\n // Minimum is _inclusive_!\n num.iadd(min);\n\n return num;\n }\n }\n\n static of(num, endian) {\n return new BN().of(num, endian);\n }\n\n static fromNumber(num, endian) {\n return new BN().fromNumber(num, endian);\n }\n\n static fromDouble(num, endian) {\n return new BN().fromDouble(num, endian);\n }\n\n static fromBigInt(num, endian) {\n return new BN().fromBigInt(num, endian);\n }\n\n static fromBool(value) {\n return new BN().fromBool(value);\n }\n\n static fromString(str, base, endian) {\n return new BN().fromString(str, base, endian);\n }\n\n static fromJSON(json) {\n return new BN().fromJSON(json);\n }\n\n static fromBN(num) {\n return new BN().fromBN(num);\n }\n\n static fromArray(data, endian) {\n return new BN().fromArray(data, endian);\n }\n\n static fromBuffer(data, endian) {\n return new BN().fromBuffer(data, endian);\n }\n\n static fromArrayLike(data, endian) {\n return new BN().fromArrayLike(data, endian);\n }\n\n static decode(data, endian) {\n return new BN().decode(data, endian);\n }\n\n static from(num, base, endian) {\n return new BN().from(num, base, endian);\n }\n\n static cast(num, base, endian) {\n if (BN.isBN(num))\n return num;\n\n return new BN(num, base, endian);\n }\n\n static isBN(obj) {\n return obj instanceof BN;\n }\n}\n\n/*\n * Static\n */\n\nBN.BN = BN;\nBN.wordSize = 26;\nBN.native = 0;\n\n/**\n * Prime\n */\n\nclass Prime {\n constructor(name, p) {\n // P = 2^N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = BN.shift(1, this.n).isub(this.p);\n this.lo = this.p.clone();\n this.one = this.p.clone();\n }\n\n ireduce(num) {\n // Assumes that `num` is less than `P^2`:\n // num = HI * (2^N - K) + HI * K + LO = HI * K + LO (mod P)\n const neg = num.negative !== 0;\n\n // Track bits.\n let bits = num.bitLength();\n\n // Must be less than P^2.\n assert(bits <= this.n * 2);\n\n // Ensure positive.\n num.negative = 0;\n\n // Reduce.\n while (bits > this.n) {\n // lo = num & ((1 << n) - 1)\n // num = num >> n\n this.split(num, this.lo);\n\n // num = num * K\n this.imulK(num);\n\n // num = num + lo\n num._iadd(num, this.lo);\n\n // bits = bitlen(num)\n bits = num.bitLength();\n }\n\n // Final reduction.\n const cmp = bits < this.n ? -1 : num.ucmp(this.p);\n\n if (cmp === 0) {\n num.words[0] = 0;\n num.length = 1;\n } else if (cmp > 0) {\n num._isub(num, this.p);\n } else {\n // Note: we shouldn't need to strip here.\n }\n\n // Adjust sign.\n if (neg && !num.isZero())\n num._isub(this.p, num);\n\n return num;\n }\n\n split(input, out) {\n input._split(this.n, out);\n }\n\n imulK(num) {\n return num.imul(this.k);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n throw new Error('Not implemented.');\n }\n\n fermat(x) {\n return this.pm2(x);\n }\n}\n\n/**\n * Prime (3 mod 4)\n */\n\nclass Prime34 extends Prime {\n constructor(name, p) {\n super(name, p);\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n throw new Error('Not implemented.');\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // r = x^((p + 1) / 4) mod p\n const {red} = x;\n const r = this.pp1d4(x);\n\n if (!red.sqr(r).eq(x))\n throw new SquareRootError(r);\n\n return r;\n }\n\n divsqrt(u, v) {\n // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p\n const {red} = u;\n const u2 = red.sqr(u);\n const u3 = red.mul(u2, u);\n const u5 = red.mul(u3, u2);\n const v3 = red.mul(red.sqr(v), v);\n const p = this.pm3d4(red.mul(u5, v3));\n const x = red.mul(red.mul(u3, v), p);\n const c = red.mul(v, red.sqr(x));\n\n if (c.eq(u))\n return x;\n\n throw new SquareRootError(x);\n }\n}\n\n/**\n * Prime (5 mod 8)\n */\n\nclass Prime58 extends Prime {\n constructor(name, p, sm1) {\n super(name, p);\n\n this.sm1 = new BN(sm1, 16);\n }\n\n pm5d8(x1) {\n // Exponent: (p - 5) / 8\n throw new Error('Not implemented.');\n }\n\n pp3d8(x1) {\n // Exponent: (p + 3) / 8\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // r = x^((p + 3) / 8) mod p\n const {red} = x;\n const sm1 = this.sm1._forceRed(red);\n const r = this.pp3d8(x);\n\n if (red.sqr(r).eq(x))\n return r;\n\n const c = red.mul(r, sm1);\n\n if (red.sqr(c).eq(x))\n return c;\n\n throw new SquareRootError(r);\n }\n\n divsqrt(u, v) {\n // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p\n const {red} = u;\n const sm1 = this.sm1._forceRed(red);\n const v3 = red.mul(red.sqr(v), v);\n const v7 = red.mul(red.sqr(v3), v);\n const p = this.pm5d8(red.mul(u, v7));\n const x = red.mul(red.mul(u, v3), p);\n const c = red.mul(v, red.sqr(x));\n\n if (c.eq(u))\n return x;\n\n const mc = red.ineg(c);\n\n if (mc.eq(u))\n return red.mul(x, sm1);\n\n if (mc.eq(red.mul(u, sm1)))\n throw new SquareRootError(red.mul(x, sm1));\n\n throw new SquareRootError(x);\n }\n}\n\n/**\n * Prime (1 mod 16)\n */\n\nclass Prime116 extends Prime {\n constructor(name, p, g) {\n super(name, p);\n\n this.g = new BN(g, 16);\n this.z = this.p.subn(1).zeroBits();\n }\n\n powS(x1) {\n // Exponent: (p - 1) / 2^k\n throw new Error('Not implemented.');\n }\n\n powE(x1) {\n // Exponent: (s + 1) / 2\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // Tonelli-Shanks (variable time).\n //\n // Constants:\n //\n // k = factors of 2 for (p - 1)\n // s = (p - 1) / 2^k\n // e = (s + 1) / 2\n // n = first non-square in F(p)\n //\n // Algorithm:\n //\n // g = n^s mod p\n // y = x^e mod p\n // b = x^s mod p\n //\n // loop:\n // t = b\n // m = 0\n //\n // while t != 1:\n // t = t^2 mod p\n // m += 1\n //\n // if m == 0:\n // break\n //\n // if m >= k:\n // fail\n //\n // t = g^(2^(k - m - 1)) mod p\n // g = t^2 mod p\n // y = y * t mod p\n // b = b * g mod p\n // k = m\n //\n // return y\n //\n const {red} = x;\n\n switch (red.jacobi(x)) {\n case -1:\n throw new SquareRootError(x);\n case 0:\n return x.clone();\n case 1:\n break;\n }\n\n let g = this.g._forceRed(red);\n let y = this.powE(x);\n let b = this.powS(x);\n let k = this.z;\n\n for (;;) {\n let t = b;\n let m = 0;\n\n while (t.cmpn(1) !== 0 && m < k) {\n t = red.sqr(t);\n m += 1;\n }\n\n if (m === 0)\n break;\n\n assert(m < k);\n\n t = red.sqrn(g, k - m - 1);\n g = red.sqr(t);\n y = red.mul(y, t);\n b = red.mul(b, g);\n k = m;\n }\n\n return y;\n }\n\n divsqrt(u, v) {\n const {red} = u;\n\n if (v.isZero())\n throw new SquareRootError(v);\n\n return this.sqrt(red.div(u, v));\n }\n}\n\n/**\n * P192\n */\n\nclass P192 extends Prime34 {\n constructor() {\n // 2^192 - 2^64 - 1 (= 3 mod 4)\n super('p192', 'ffffffff ffffffff ffffffff fffffffe'\n + 'ffffffff ffffffff');\n }\n\n imulK(num) {\n // K = 0x10000000000000001\n // K = 2^64 + 1\n const one = this.one.inject(num);\n return num.iushln(64)._iadd(num, one);\n }\n\n core(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 127x1 1x0 62x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x30 = red.sqrnmul(x24, 6, x6);\n const x31 = red.sqrnmul(x30, 1, x1);\n const x62 = red.sqrnmul(x31, 31, x31);\n const x124 = red.sqrnmul(x62, 62, x62);\n const x127 = red.sqrnmul(x124, 3, x3);\n const r0 = red.sqrn(x127, 1);\n const r1 = red.sqrnmul(r0, 62, x62);\n\n return r1;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 127x1 1x0 62x1\n return this.core(x1);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 127x1 1x0 62x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 128x1 62x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x4 = red.sqrnmul(x2, 2, x2);\n const x8 = red.sqrnmul(x4, 4, x4);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n const r0 = red.sqrn(x128, 62);\n\n return r0;\n }\n}\n\n/**\n * P224\n */\n\nclass P224 extends Prime116 {\n constructor() {\n // 2^224 - 2^96 + 1 (1 mod 16)\n super('p224', 'ffffffff ffffffff ffffffff ffffffff'\n + '00000000 00000000 00000001',\n '6a0fec67 8598a792 0c55b2d4 0b2d6ffb'\n + 'bea3d8ce f3fb3632 dc691b74');\n }\n\n imulK(num) {\n // K = 0xffffffffffffffffffffffff\n // K = 2^96 - 1\n const one = this.one.inject(num);\n return num.iushln(96)._isub(num, one);\n }\n\n powS(x1) {\n // Exponent: 2^128 - 1\n // Bits: 128x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x4 = red.sqrnmul(x2, 2, x2);\n const x8 = red.sqrnmul(x4, 4, x4);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n\n return x128;\n }\n\n powE(x1) {\n // Exponent: 2^127\n // Bits: 1x1 127x0\n const {red} = x1;\n const r0 = red.sqrn(x1, 127);\n\n return r0;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 127x1 1x0 96x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x48 = red.sqrnmul(x24, 24, x24);\n const x96 = red.sqrnmul(x48, 48, x48);\n const x120 = red.sqrnmul(x96, 24, x24);\n const x126 = red.sqrnmul(x120, 6, x6);\n const x127 = red.sqrnmul(x126, 1, x1);\n const r0 = red.sqrn(x127, 1);\n const r1 = red.sqrnmul(r0, 96, x96);\n\n return r1;\n }\n}\n\n/**\n * P521\n */\n\nclass P521 extends Prime34 {\n constructor() {\n // 2^521 - 1 (= 3 mod 4)\n super('p521', '000001ff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff');\n }\n\n imulK(num) {\n // K = 0x01\n return num;\n }\n\n core(x1) {\n // Exponent: 2^519 - 1\n // Bits: 519x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x7 = red.sqrnmul(x6, 1, x1);\n const x8 = red.sqrnmul(x7, 1, x1);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n const x256 = red.sqrnmul(x128, 128, x128);\n const x512 = red.sqrnmul(x256, 256, x256);\n const x519 = red.sqrnmul(x512, 7, x7);\n\n return x519;\n }\n\n pm3d4(x1) {\n // Exponent: 2^519 - 1\n // Bits: 519x1\n return this.core(x1);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 519x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 1x1 519x0\n const {red} = x1;\n const r0 = red.sqrn(x1, 519);\n\n return r0;\n }\n}\n\n/**\n * K256\n */\n\nclass K256 extends Prime34 {\n constructor() {\n // 2^256 - 2^32 - 977 (= 3 mod 4)\n super('k256', 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff fffffffe fffffc2f');\n }\n\n split(input, output) {\n // 256 = 9 * 26 + 22\n const mask = 0x3fffff;\n const len = Math.min(input.length, 9);\n\n output._alloc(len + 1);\n\n for (let i = 0; i < len; i++)\n output.words[i] = input.words[i];\n\n output.length = len;\n\n if (input.length <= 9) {\n output._strip();\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs.\n let prev = input.words[9];\n let i = 10;\n\n output.words[output.length++] = prev & mask;\n output._strip();\n\n for (; i < input.length; i++) {\n const next = input.words[i] | 0;\n\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n\n prev = next;\n }\n\n prev >>>= 22;\n\n input.words[i - 10] = prev;\n\n if (prev === 0 && input.length > 10)\n input.length -= 10;\n else\n input.length -= 9;\n\n input._strip(); // Unsure if we need this.\n }\n\n imulK(num) {\n // K = 0x1000003d1 = [0x40, 0x3d1]\n // K = 2^32 + 977\n num._expand(num.length + 2);\n\n // Bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n let lo = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i];\n\n lo += w * 0x3d1;\n\n num.words[i] = lo & 0x3ffffff;\n\n lo = w * 0x40 + Math.floor(lo / 0x4000000);\n }\n\n // Fast length reduction.\n if (num.words[num.length - 1] === 0) {\n num.length -= 1;\n if (num.words[num.length - 1] === 0)\n num.length -= 1;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1, x2) {\n // Exponent: (p - 47) / 64\n // Bits: 223x1 1x0 22x1 4x0\n const {red} = x1;\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x9 = red.sqrnmul(x6, 3, x3);\n const x11 = red.sqrnmul(x9, 2, x2);\n const x22 = red.sqrnmul(x11, 11, x11);\n const x44 = red.sqrnmul(x22, 22, x22);\n const x88 = red.sqrnmul(x44, 44, x44);\n const x176 = red.sqrnmul(x88, 88, x88);\n const x220 = red.sqrnmul(x176, 44, x44);\n const x223 = red.sqrnmul(x220, 3, x3);\n const r0 = red.sqrn(x223, 1);\n const r1 = red.sqrnmul(r0, 22, x22);\n const r2 = red.sqrn(r1, 4);\n\n return r2;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 1, x1);\n const r4 = red.sqrn(r3, 1);\n const r5 = red.sqrnmul(r4, 2, x2);\n\n return r5;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 1x0 1x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 1, x1);\n const r4 = red.sqrn(r3, 1);\n const r5 = red.sqrnmul(r4, 2, x2);\n const r6 = red.sqrn(r5, 1);\n const r7 = red.sqrnmul(r6, 1, x1);\n\n return r7;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 223x1 1x0 22x1 4x0 2x1 2x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 2, x2);\n const r4 = red.sqrn(r3, 2);\n\n return r4;\n }\n}\n\n/**\n * P251\n */\n\nclass P251 extends Prime34 {\n constructor() {\n // 2^251 - 9\n super('p251', '07ffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff fffffff7');\n }\n\n imulK(num) {\n // K = 0x09\n if (num.isZero())\n return num;\n\n let carry = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i] * 0x09 + carry;\n\n carry = w >>> 26;\n\n num.words[i] = w & 0x3ffffff;\n }\n\n if (carry !== 0) {\n num._alloc(num.length + 1);\n num.words[num.length++] = carry;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1) {\n // Exponent: 2^247 - 1\n // Bits: 247x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x48 = red.sqrnmul(x24, 24, x24);\n const x96 = red.sqrnmul(x48, 48, x48);\n const x192 = red.sqrnmul(x96, 96, x96);\n const x240 = red.sqrnmul(x192, 48, x48);\n const x246 = red.sqrnmul(x240, 6, x6);\n const x247 = red.sqrnmul(x246, 1, x1);\n\n return x247;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 247x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 247x1 1x0 1x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n const r3 = red.sqrn(r2, 1);\n const r4 = red.sqrnmul(r3, 1, x1);\n\n return r4;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 248x1 1x0\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrnmul(r0, 1, x1);\n const r2 = red.sqrn(r1, 1);\n\n return r2;\n }\n}\n\n/**\n * P25519\n */\n\nclass P25519 extends Prime58 {\n constructor() {\n // 2^255 - 19 (= 5 mod 8)\n super('p25519', '7fffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffed',\n '2b832480 4fc1df0b 2b4d0099 3dfbd7a7'\n + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0');\n }\n\n imulK(num) {\n // K = 0x13\n let carry = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i] * 0x13 + carry;\n\n carry = w >>> 26;\n\n num.words[i] = w & 0x3ffffff;\n }\n\n if (carry !== 0) {\n num._alloc(num.length + 1);\n num.words[num.length++] = carry;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1, x2) {\n // Exponent: 2^250 - 1\n // Bits: 250x1\n const {red} = x1;\n const x4 = red.sqrnmul(x2, 2, x2);\n const x5 = red.sqrnmul(x4, 1, x1);\n const x10 = red.sqrnmul(x5, 5, x5);\n const x20 = red.sqrnmul(x10, 10, x10);\n const x40 = red.sqrnmul(x20, 20, x20);\n const x50 = red.sqrnmul(x40, 10, x10);\n const x100 = red.sqrnmul(x50, 50, x50);\n const x200 = red.sqrnmul(x100, 100, x100);\n const x250 = red.sqrnmul(x200, 50, x50);\n\n return x250;\n }\n\n pm5d8(x1) {\n // Exponent: (p - 5) / 8\n // Bits: 250x1 1x0 1x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 250x1 1x0 1x1 1x0 2x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n const r3 = red.sqrn(r2, 1);\n const r4 = red.sqrnmul(r3, 2, x2);\n\n return r4;\n }\n\n pp3d8(x1) {\n // Exponent: (p + 3) / 8\n // Bits: 251x1 1x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrnmul(r0, 1, x1);\n const r2 = red.sqrn(r1, 1);\n\n return r2;\n }\n}\n\n/**\n * P448\n */\n\nclass P448 extends Prime34 {\n constructor() {\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n super('p448', 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff fffffffe ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff');\n }\n\n imulK(num) {\n // K = 0x100000000000000000000000000000000000000000000000000000001\n // K = 2^224 + 1\n const one = this.one.inject(num);\n return num.iushln(224)._iadd(num, one);\n }\n\n core(x1, x2) {\n // Exponent: 2^222 - 1\n // Bits: 222x1\n const {red} = x1;\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x9 = red.sqrnmul(x6, 3, x3);\n const x11 = red.sqrnmul(x9, 2, x2);\n const x22 = red.sqrnmul(x11, 11, x11);\n const x44 = red.sqrnmul(x22, 22, x22);\n const x88 = red.sqrnmul(x44, 44, x44);\n const x176 = red.sqrnmul(x88, 88, x88);\n const x220 = red.sqrnmul(x176, 44, x44);\n const x222 = red.sqrnmul(x220, 2, x2);\n\n return x222;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 223x1 1x0 222x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x222 = this.core(x1, x2);\n const r0 = red.sqrnmul(x222, 1, x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 222, x222);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 223x1 1x0 222x1 1x0 1x1\n const {red} = x1;\n const r0 = this.pm3d4(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 224x1 222x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrnmul(r0, 2, x2);\n const r2 = red.sqrn(r1, 222);\n\n return r2;\n }\n}\n\n/**\n * Reduction Engine\n */\n\nclass Red {\n constructor(m) {\n let prime = null;\n\n if (typeof m === 'string') {\n prime = BN._prime(m);\n m = prime.p;\n }\n\n enforce(BN.isBN(m), 'm', 'bignum');\n nonred(!m.red, 'reduction');\n range(m.sign() > 0, 'reduction');\n\n this.m = m;\n this.prime = prime;\n this.mb = null;\n this.sm1 = null;\n }\n\n _verify1(a) {\n range(a.negative === 0, 'red');\n red(a.red != null, 'red');\n }\n\n _verify2(a, b) {\n range((a.negative | b.negative) === 0, 'red');\n red(a.red != null && a.red === b.red, 'red');\n }\n\n get mont() {\n return false;\n }\n\n precompute() {\n // Precompute `sqrt(-1)` for primes congruent to 5 mod 8.\n if (this.sm1 === null && this.m.andln(7) === 5) {\n if (this.prime) {\n this.sm1 = this.prime.sm1.clone()._forceRed(this);\n } else {\n const x = new BN(2).toRed(this);\n const e = this.m.subn(1).iushrn(2);\n\n // sqrt(-1) = 2^((p - 1) / 4) mod p\n this.sm1 = this.pow(x, e);\n }\n }\n\n return this;\n }\n\n convertTo(num) {\n const res = num.mod(this.m);\n res.red = this;\n return res;\n }\n\n convertFrom(num) {\n const res = num.clone();\n res.red = null;\n return res;\n }\n\n intTo(a) {\n return a;\n }\n\n intFrom(a) {\n return a;\n }\n\n imod(a) {\n if (this.prime)\n return this.prime.ireduce(a)._forceRed(this);\n\n return a.imod(this.m)._forceRed(this);\n }\n\n iadd(a, b) {\n this._verify2(a, b);\n\n a._iadd(a, b);\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n return a;\n }\n\n add(a, b) {\n if (a.length < b.length)\n return this.iadd(b.clone(), a);\n\n return this.iadd(a.clone(), b);\n }\n\n iaddn(a, num) {\n this._verify1(a);\n\n if (num < 0)\n return this.isubn(a, -num);\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n a._iaddn(num);\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n return a;\n }\n\n addn(a, num) {\n return this.iaddn(a.clone(), num);\n }\n\n isub(a, b) {\n this._verify2(a, b);\n\n // 0: a - a mod m == 0\n // -1: a - b mod m == m - (b - a)\n // +1: a - b mod m == a - b\n const cmp = a.ucmp(b);\n\n if (cmp === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n if (cmp < 0) {\n a._isub(b, a);\n a._isub(this.m, a);\n } else {\n a._isub(a, b);\n }\n\n return a;\n }\n\n sub(a, b) {\n return this.isub(a.clone(), b);\n }\n\n isubn(a, num) {\n this._verify1(a);\n\n if (num < 0)\n return this.iaddn(a, -num);\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n // <: a - b mod m == m - (b - a)\n // >=: a - b mod m == a - b\n if (a.length === 1 && a.words[0] < num) {\n a.words[0] = num - a.words[0];\n a._isub(this.m, a);\n } else {\n a._isubn(num);\n }\n\n return a;\n }\n\n subn(a, num) {\n return this.isubn(a.clone(), num);\n }\n\n imul(a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n }\n\n mul(a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n }\n\n imuln(a, num) {\n this._verify1(a);\n\n if (a.isZero())\n return a;\n\n if (num === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n const neg = num < 0;\n\n if (neg)\n num = -num;\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n a.imuln(num);\n\n if (num <= 16) {\n // Quick reduction.\n while (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n } else {\n this.imod(a);\n }\n\n if (neg)\n this.ineg(a);\n\n return a;\n }\n\n muln(a, num) {\n return this.imuln(a.clone(), num);\n }\n\n idiv(a, b) {\n return this.div(a, b)._move(a);\n }\n\n div(a, b) {\n return this.mul(a, this.invert(b));\n }\n\n idivn(a, num) {\n return this.divn(a, num)._move(a);\n }\n\n divn(a, num) {\n return this.div(a, this.convertTo(new BN(num)));\n }\n\n ipow(a, num) {\n return this.pow(a, num)._move(a);\n }\n\n pow(a, num) {\n this._verify1(a);\n\n if (num.isNeg())\n a = this.invert(a);\n\n // Small exponent.\n if (num.length === 1)\n return this.pown(a, num.words[0]);\n\n // Call out to BigInt.\n if (HAS_BIGINT && !this.prime)\n return this.powInt(a, num);\n\n // Otherwise, a BN implementation.\n return this.powNum(a, num);\n }\n\n powNum(a, num) {\n // Sliding window (odd multiples only).\n const one = new BN(1).toRed(this);\n const wnd = new Array(WND_SIZE);\n const a2 = this.sqr(a);\n\n wnd[0] = a;\n\n for (let i = 1; i < WND_SIZE; i++)\n wnd[i] = this.mul(wnd[i - 1], a2);\n\n let i = num.bitLength();\n let r = one;\n\n while (i >= WND_WIDTH) {\n let width = WND_WIDTH;\n let bits = num.bits(i - width, width);\n\n if (bits < WND_SIZE) {\n r = this.sqr(r);\n i -= 1;\n continue;\n }\n\n while ((bits & 1) === 0) {\n width -= 1;\n bits >>= 1;\n }\n\n if (r === one) {\n r = wnd[bits >> 1].clone();\n } else {\n r = this.sqrn(r, width);\n r = this.mul(r, wnd[bits >> 1]);\n }\n\n i -= width;\n }\n\n if (i > 0) {\n const bits = num.bits(0, i);\n\n while (i--) {\n r = this.sqr(r);\n\n if ((bits >> i) & 1)\n r = this.mul(r, a);\n }\n }\n\n return r;\n }\n\n powInt(a, num) {\n if (this.mb === null)\n this.mb = this.m.toBigInt();\n\n const x = this.intFrom(a.toBigInt());\n const y = powInt(x, num, this.mb);\n const z = this.intTo(y);\n\n return BN.fromBigInt(z)._forceRed(this);\n }\n\n sqrn(a, n) {\n while (n--)\n a = this.sqr(a);\n\n return a;\n }\n\n sqrnmul(a, n, b) {\n return this.mul(this.sqrn(a, n), b);\n }\n\n ipown(a, num) {\n return this.pown(a, num)._move(a);\n }\n\n pown(a, num) {\n this._verify1(a);\n\n if (num < 0) {\n a = this.invert(a);\n num = -num;\n }\n\n if (num === 0)\n return new BN(1).toRed(this);\n\n if (num === 1)\n return a.clone();\n\n const bits = countBits(num);\n\n let r = a;\n\n for (let i = bits - 2; i >= 0; i--) {\n r = this.sqr(r);\n\n if ((num >> i) & 1)\n r = this.mul(r, a);\n }\n\n return r;\n }\n\n isqr(a) {\n return this.imul(a, a);\n }\n\n sqr(a) {\n return this.mul(a, a);\n }\n\n isqrt(x) {\n return this.sqrt(x)._move(x);\n }\n\n sqrt(x) {\n this._verify1(x);\n\n // Optimized square root chain.\n if (this.prime)\n return this.prime.sqrt(x);\n\n // Fast case (p = 3 mod 4).\n if (this.m.andln(3) === 3)\n return this.sqrt3mod4(x);\n\n // Fast case (p = 5 mod 8).\n if (this.m.andln(7) === 5) {\n if (this.sm1 != null)\n return this.sqrt5mod8sm1(x);\n return this.sqrt5mod8(x);\n }\n\n // Slow case (Tonelli-Shanks).\n return this.sqrt0(x);\n }\n\n sqrt3mod4(x) {\n const e = this.m.addn(1).iushrn(2); // (p + 1) / 4\n const b = this.pow(x, e);\n\n if (!this.sqr(b).eq(x))\n throw new SquareRootError(b);\n\n return b;\n }\n\n sqrt5mod8(x) {\n // Atkin's Algorithm.\n const one = new BN(1).toRed(this);\n const e = this.m.ushrn(3); // (p - 5) / 8\n const x2 = this.add(x, x);\n const alpha = this.pow(x2, e);\n const beta = this.mul(x2, this.sqr(alpha));\n const b = this.mul(this.mul(alpha, x), this.isub(beta, one));\n\n if (!this.sqr(b).eq(x))\n throw new SquareRootError(b);\n\n return b;\n }\n\n sqrt5mod8sm1(x) {\n const e = this.m.addn(3).iushrn(3); // (p + 3) / 8\n const b = this.pow(x, e);\n\n if (this.sqr(b).eq(x))\n return b;\n\n const c = this.mul(b, this.sm1);\n\n if (this.sqr(c).eq(x))\n return c;\n\n throw new SquareRootError(b);\n }\n\n sqrt0(x) {\n if (this.m.cmpn(1) === 0 || !this.m.isOdd())\n throw new Error('Invalid prime.');\n\n switch (this.jacobi(x)) {\n case -1:\n throw new SquareRootError(x);\n case 0:\n return x.clone();\n case 1:\n break;\n }\n\n const one = new BN(1).toRed(this);\n const s = this.m.subn(1);\n const e = s._makeOdd();\n const n = new BN(2).toRed(this);\n\n while (this.jacobi(n) !== -1)\n this.iadd(n, one);\n\n let g = this.pow(n, s);\n let b = this.pow(x, s);\n let y = this.pow(x, s.iaddn(1).iushrn(1));\n let k = e;\n\n for (;;) {\n let t = b;\n let m = 0;\n\n while (!t.eq(one) && m < k) {\n t = this.sqr(t);\n m += 1;\n }\n\n if (m === 0)\n break;\n\n assert(m < k);\n\n t = this.sqrn(g, k - m - 1);\n g = this.sqr(t);\n y = this.mul(y, t);\n b = this.mul(b, g);\n k = m;\n }\n\n return y;\n }\n\n idivsqrt(u, v) {\n return this.divsqrt(u, v)._move(u);\n }\n\n divsqrt(u, v) {\n this._verify2(u, v);\n\n // u = 0, v = 0\n if (u.isZero() && v.isZero())\n throw new SquareRootError(v);\n\n // Optimized inverse square root chain.\n if (this.prime)\n return this.prime.divsqrt(u, v);\n\n // p = 3 mod 4\n if (this.m.andln(3) === 3)\n return this.divsqrt3mod4(u, v);\n\n // p = 5 mod 8\n if (this.sm1 != null && this.m.andln(7) === 5)\n return this.divsqrt5mod8(u, v);\n\n // v = 0\n if (v.isZero())\n throw new SquareRootError(v);\n\n return this.sqrt(this.div(u, v));\n }\n\n divsqrt3mod4(u, v) {\n // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p\n const e = this.m.subn(3).iushrn(2);\n const u2 = this.sqr(u);\n const u3 = this.mul(u2, u);\n const u5 = this.mul(u3, u2);\n const v3 = this.mul(this.sqr(v), v);\n const p = this.pow(this.mul(u5, v3), e);\n const x = this.mul(this.mul(u3, v), p);\n const c = this.mul(v, this.sqr(x));\n\n if (c.eq(u))\n return x;\n\n throw new SquareRootError(x);\n }\n\n divsqrt5mod8(u, v) {\n // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p\n const e = this.m.subn(5).iushrn(3);\n const v3 = this.mul(this.sqr(v), v);\n const v7 = this.mul(this.sqr(v3), v);\n const p = this.pow(this.mul(u, v7), e);\n const x = this.mul(this.mul(u, v3), p);\n const c = this.mul(v, this.sqr(x));\n\n if (c.eq(u))\n return x;\n\n const mc = this.ineg(c);\n\n if (mc.eq(u))\n return this.mul(x, this.sm1);\n\n if (mc.eq(this.mul(u, this.sm1)))\n throw new SquareRootError(this.mul(x, this.sm1));\n\n throw new SquareRootError(x);\n }\n\n isSquare(a) {\n if (this.m.isOdd())\n return this.jacobi(a) >= 0;\n\n return this.kronecker(a) >= 0;\n }\n\n ishl(a, num) {\n this._verify1(a);\n return this.imod(a.iushl(num));\n }\n\n shl(a, num) {\n return this.ishl(a.clone(), num);\n }\n\n ishln(a, num) {\n this._verify1(a);\n\n a.iushln(num);\n\n if (num <= 4) {\n // Quick reduction.\n while (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n } else {\n this.imod(a);\n }\n\n return a;\n }\n\n shln(a, num) {\n return this.ishln(a.clone(), num);\n }\n\n ineg(a) {\n this._verify1(a);\n\n if (!a.isZero())\n a._isub(this.m, a);\n\n return a;\n }\n\n neg(a) {\n return this.ineg(a.clone());\n }\n\n eq(a, b) {\n this._verify2(a, b);\n return a.ucmp(b) === 0;\n }\n\n eqn(a, num) {\n this._verify1(a);\n\n if (this.m.length === 1) {\n num %= this.m.words[0];\n\n if (num < 0)\n num += this.m.words[0];\n\n return a.ucmpn(num) === 0;\n }\n\n if (num < 0) {\n this.m._isubn(-num);\n\n const cmp = a.ucmp(this.m);\n\n this.m._iaddn(-num);\n\n return cmp === 0;\n }\n\n return a.ucmpn(num) === 0;\n }\n\n isHigh(a) {\n return !this.isLow(a);\n }\n\n isLow(a) {\n this._verify1(a);\n return a.ucmp(this.m.ushrn(1)) <= 0;\n }\n\n isOdd(a) {\n this._verify1(a);\n return a.isOdd();\n }\n\n isEven(a) {\n this._verify1(a);\n return a.isEven();\n }\n\n legendre(num) {\n this._verify1(num);\n\n if (this.m.isEven())\n throw new Error('legendre: `num` must be odd.');\n\n // Euler's criterion.\n const e = this.m.subn(1).iushrn(1); // (p - 1) / 2\n const symbol = this.pow(num, e);\n\n if (symbol.isZero())\n return 0;\n\n const one = new BN(1).toRed(this);\n\n if (symbol.eq(one))\n return 1;\n\n if (symbol.eq(this.ineg(one)))\n return -1;\n\n throw new Error('Invalid prime.');\n }\n\n jacobi(a) {\n this._verify1(a);\n return a.jacobi(this.m);\n }\n\n kronecker(a) {\n this._verify1(a);\n return a.kronecker(this.m);\n }\n\n iinvert(a) {\n return this.invert(a)._move(a);\n }\n\n invert(a) {\n this._verify1(a);\n return a.invert(this.m)._forceRed(this);\n }\n\n ifermat(a) {\n return this.fermat(a)._move(a);\n }\n\n fermat(a) {\n this._verify1(a);\n\n if (a.isZero() || this.m.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n // Optimized inversion chain.\n if (this.prime)\n return this.prime.fermat(a);\n\n // Invert using fermat's little theorem.\n return this.pow(a, this.m.subn(2));\n }\n\n invertAll(elems) {\n // Montgomery's trick.\n enforce(Array.isArray(elems), 'elems', 'array');\n\n for (const elem of elems) {\n enforce(BN.isBN(elem), 'elem', 'bignum');\n\n this._verify1(elem);\n }\n\n if (this.m.cmpn(1) === 0 || this.m.isEven())\n throw new RangeError('Not invertible.');\n\n const len = elems.length;\n const invs = new Array(len);\n\n if (len === 0)\n return invs;\n\n let acc = new BN(1).toRed(this);\n\n for (let i = 0; i < len; i++) {\n if (elems[i].isZero()) {\n invs[i] = elems[i].clone();\n continue;\n }\n\n invs[i] = acc;\n acc = this.mul(acc, elems[i]);\n }\n\n acc = this.invert(acc);\n\n for (let i = len - 1; i >= 0; i--) {\n if (elems[i].isZero())\n continue;\n\n invs[i] = this.mul(acc, invs[i]);\n acc = this.mul(acc, elems[i]);\n }\n\n return invs;\n }\n\n [custom]() {\n if (this.prime)\n return ``;\n\n return ``;\n }\n}\n\n/**\n * Barrett Engine\n */\n\nclass Barrett extends Red {\n constructor(m) {\n super(m);\n\n this.prime = null;\n this.n = this.m.bitLength();\n\n if ((this.n % 26) !== 0)\n this.n += 26 - (this.n % 26);\n\n this.k = this.n * 2;\n this.w = this.k / 26;\n this.b = BN.shift(1, this.k).div(this.m);\n }\n\n convertTo(num) {\n if (num.length > this.w)\n return super.convertTo(num);\n\n return this.imod(num.clone());\n }\n\n _shift(q) {\n let i = 0;\n let j = this.w;\n\n while (j < q.length)\n q.words[i++] = q.words[j++];\n\n if (i === 0)\n q.words[i++] = 0;\n\n q.length = i;\n }\n\n imod(a) {\n const neg = a.negative;\n\n assert(a.length <= this.w);\n\n a.negative = 0;\n\n const q = a.mul(this.b);\n\n // Shift right by `k` bits.\n this._shift(q);\n\n a._isub(a, q.mul(this.m));\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n if (neg && !a.isZero())\n a._isub(this.m, a);\n\n a.red = this;\n\n return a;\n }\n}\n\n/**\n * Montgomery Engine\n */\n\nclass Mont extends Red {\n constructor(m) {\n super(m);\n\n // Note that:\n //\n // mi = (-m^-1 mod (2^(n * 2))) mod r\n //\n // and:\n //\n // mi = (((2^n)^-1 mod m) * r^-1 - 1) / m\n //\n // are equivalent.\n this.prime = null;\n this.n = this.m.length * 26;\n this.r = BN.shift(1, this.n);\n this.r2 = BN.shift(1, this.n * 2).imod(this.m);\n this.ri = this.r.invert(this.m);\n this.mi = this.r.mul(this.ri).isubn(1).div(this.m);\n this.rib = null;\n }\n\n get mont() {\n return true;\n }\n\n convertTo(num) {\n if (num.isNeg() || num.ucmp(this.m) >= 0)\n return this.imod(num.ushln(this.n));\n\n // Equivalent to: (num * 2^n) mod m\n return this.mul(num, this.r2);\n }\n\n convertFrom(num) {\n // Equivalent to: num * r^-1 mod m\n const r = this.mul(num, new BN(1));\n r.red = null;\n return r;\n }\n\n intTo(a) {\n return (a << BigInt(this.n)) % this.mb;\n }\n\n intFrom(a) {\n if (this.rib === null)\n this.rib = this.ri.toBigInt();\n\n return (a * this.rib) % this.mb;\n }\n\n iaddn(a, num) {\n return this.iadd(a, this.convertTo(new BN(num)));\n }\n\n isubn(a, num) {\n return this.isub(a, this.convertTo(new BN(num)));\n }\n\n imul(a, b) {\n return this.mul(a, b)._move(a);\n }\n\n mul(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n\n const t = a.mul(b);\n const c = t.umaskn(this.n).mul(this.mi).iumaskn(this.n);\n const u = t.iadd(c.mul(this.m)).iushrn(this.n);\n\n if (u.ucmp(this.m) >= 0)\n u._isub(u, this.m);\n\n return u._forceRed(this);\n }\n\n imuln(a, num) {\n this._verify1(a);\n\n if (a.isZero())\n return a;\n\n if (num === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n const neg = num < 0;\n\n if (neg)\n num = -num;\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n const bits = countBits(num);\n\n // Potentially compute with additions.\n // This avoids an expensive division.\n if (bits > 5) {\n // Slow case (num > 31).\n this.imul(a, this.convertTo(new BN(num)));\n } else if ((num & (num - 1)) === 0) {\n // Optimize for powers of two.\n for (let i = 0; i < bits - 1; i++)\n this.iadd(a, a);\n } else {\n // Multiply left to right.\n const c = a.clone();\n\n for (let i = bits - 2; i >= 0; i--) {\n this.iadd(a, a);\n\n if ((num >> i) & 1)\n this.iadd(a, c);\n }\n }\n\n if (neg)\n this.ineg(a);\n\n return a;\n }\n\n eqn(a, num) {\n this._verify1(a);\n\n if (num === 0)\n return a.isZero();\n\n return a.ucmp(this.convertTo(new BN(num))) === 0;\n }\n\n isLow(a) {\n this._verify1(a);\n return this.convertFrom(a).ucmp(this.m.ushrn(1)) <= 0;\n }\n\n isOdd(a) {\n this._verify1(a);\n return this.convertFrom(a).isOdd();\n }\n\n isEven(a) {\n this._verify1(a);\n return this.convertFrom(a).isEven();\n }\n\n invert(a) {\n this._verify1(a);\n\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n return this.imod(a.invert(this.m).mul(this.r2));\n }\n}\n\n/*\n * Helpers\n */\n\nfunction makeError(Error, msg, start) {\n const err = new Error(msg);\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, start);\n\n return err;\n}\n\nfunction assert(value, message) {\n if (!value) {\n const msg = message || 'Assertion failed.';\n throw makeError(Error, msg, assert);\n }\n}\n\nfunction enforce(value, name, type) {\n if (!value) {\n const msg = `\"${name}\" must be a(n) ${type}.`;\n throw makeError(TypeError, msg, enforce);\n }\n}\n\nfunction range(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with positive numbers.`;\n throw makeError(RangeError, msg, range);\n }\n}\n\nfunction red(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with red numbers.`;\n throw makeError(TypeError, msg, red);\n }\n}\n\nfunction nonred(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with normal numbers.`;\n throw makeError(TypeError, msg, nonred);\n }\n}\n\nfunction nonzero(value) {\n if (!value) {\n const msg = 'Cannot divide by zero.';\n throw makeError(RangeError, msg, nonzero);\n }\n}\n\nclass SquareRootError extends Error {\n constructor(result) {\n super();\n\n this.name = 'SquareRootError';\n this.message = 'X is not a square mod P.';\n this.result = result.fromRed();\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, SquareRootError);\n }\n}\n\nfunction isInteger(num) {\n return Number.isSafeInteger(num);\n}\n\nfunction isSMI(num) {\n return isInteger(num)\n && num >= -0x3ffffff\n && num <= 0x3ffffff;\n}\n\nfunction allocate(ArrayType, size) {\n if (ArrayType.allocUnsafeSlow)\n return ArrayType.allocUnsafeSlow(size);\n\n return new ArrayType(size);\n}\n\nfunction getBase(base) {\n if (base == null)\n return 10;\n\n if (typeof base === 'number')\n return base;\n\n switch (base) {\n case 'bin':\n return 2;\n case 'oct':\n return 8;\n case 'dec':\n return 10;\n case 'hex':\n return 16;\n }\n\n return 0;\n}\n\n/*\n * Internal\n */\n\nfunction countBits(w) {\n if (Math.clz32)\n return 32 - Math.clz32(w);\n\n let t = w;\n let r = 0;\n\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n\n return r + t;\n}\n\nfunction zeroBits(w) {\n // Shortcut.\n if (w === 0)\n return 26;\n\n let t = w;\n let r = 0;\n\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n\n if ((t & 0x1) === 0)\n r += 1;\n\n return r;\n}\n\nfunction parseHex(str, start, end) {\n const len = Math.min(str.length, end);\n\n let r = 0;\n let z = 0;\n\n for (let i = start; i < len; i++) {\n const c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n let b;\n\n if (c >= 49 && c <= 54) {\n // 'a' - 'f'\n b = c - 49 + 0xa;\n } else if (c >= 17 && c <= 22) {\n // 'A' - 'F'\n b = c - 17 + 0xa;\n } else {\n // '0' - '9'\n b = c;\n }\n\n r |= b;\n z |= b;\n }\n\n if (z & ~15)\n throw new Error('Invalid string.');\n\n return r;\n}\n\nfunction parseBase(str, start, end, mul) {\n const len = Math.min(str.length, end);\n\n let r = 0;\n\n for (let i = start; i < len; i++) {\n const c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n let b;\n\n if (c >= 49) {\n // 'a'\n b = c - 49 + 0xa;\n } else if (c >= 17) {\n // 'A'\n b = c - 17 + 0xa;\n } else {\n // '0' - '9'\n b = c;\n }\n\n if (c < 0 || c > 207 || b >= mul)\n throw new Error('Invalid string.');\n\n r += b;\n }\n\n return r;\n}\n\n/*\n * Exponentiation (bigint)\n */\n\nfunction powInt(x, e, m) {\n // Sliding window (odd multiples only).\n const one = BigInt(1);\n const wnd = new Array(WND_SIZE);\n const x2 = (x * x) % m;\n\n wnd[0] = x;\n\n for (let i = 1; i < WND_SIZE; i++)\n wnd[i] = (wnd[i - 1] * x2) % m;\n\n let i = e.bitLength();\n let r = one;\n\n while (i >= WND_WIDTH) {\n let width = WND_WIDTH;\n let bits = e.bits(i - width, width);\n\n if (bits < WND_SIZE) {\n r = (r * r) % m;\n i -= 1;\n continue;\n }\n\n while ((bits & 1) === 0) {\n width -= 1;\n bits >>= 1;\n }\n\n if (r === one) {\n r = wnd[bits >> 1];\n } else {\n r = sqrn(r, width, m);\n r = (r * wnd[bits >> 1]) % m;\n }\n\n i -= width;\n }\n\n if (i > 0) {\n const bits = e.bits(0, i);\n\n while (i--) {\n r = (r * r) % m;\n\n if ((bits >> i) & 1)\n r = (r * x) % m;\n }\n }\n\n return r;\n}\n\nfunction sqrn(x, n, m) {\n for (let i = 0; i < n; i++)\n x = (x * x) % m;\n return x;\n}\n\n/*\n * Multiplication\n */\n\nfunction smallMulTo(self, num, out) {\n const len = self.length + num.length;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(len);\n out.length = len;\n\n // Peel one iteration (compiler can't\n // do it, because of code complexity).\n const a = self.words[0];\n const b = num.words[0];\n const r = a * b;\n const lo = r & 0x3ffffff;\n\n let carry = (r / 0x4000000) | 0;\n let k = 1;\n\n out.words[0] = lo;\n\n for (; k < out.length - 1; k++) {\n // Sum all words with the same\n // `i + j = k` and accumulate\n // `ncarry`, note that ncarry\n // could be >= 0x3ffffff.\n let ncarry = carry >>> 26;\n let rword = carry & 0x3ffffff;\n\n const min = Math.max(0, k - self.length + 1);\n const max = Math.min(k, num.length - 1);\n\n for (let j = min; j <= max; j++) {\n const i = k - j;\n const a = self.words[i];\n const b = num.words[j];\n const r = a * b + rword;\n\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n\n if (carry !== 0)\n out.words[k] = carry | 0;\n else\n out.length -= 1;\n\n return out._strip();\n}\n\nfunction bigMulTo(self, num, out) {\n const len = self.length + num.length;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(len);\n out.length = len;\n\n let carry = 0;\n let hncarry = 0;\n let k = 0;\n\n for (; k < out.length - 1; k++) {\n // Sum all words with the same\n // `i + j = k` and accumulate\n // `ncarry`, note that ncarry\n // could be >= 0x3ffffff.\n let ncarry = hncarry;\n\n hncarry = 0;\n\n let rword = carry & 0x3ffffff;\n\n const min = Math.max(0, k - self.length + 1);\n const max = Math.min(k, num.length - 1);\n\n for (let j = min; j <= max; j++) {\n const i = k - j;\n const a = self.words[i];\n const b = num.words[j];\n const r = a * b;\n\n let lo = r & 0x3ffffff;\n\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n\n if (carry !== 0)\n out.words[k] = carry;\n else\n out.length -= 1;\n\n return out._strip();\n}\n\nfunction jumboMulTo(x, y, out) {\n // v8 has a 2147483519 bit max (~256mb).\n if (!HAS_BIGINT || x.length + y.length > 82595519)\n return bigMulTo(x, y, out);\n\n const zero = BigInt(0);\n const mask = BigInt(0x3ffffff);\n const shift = BigInt(26);\n\n let z = x.toBigInt() * y.toBigInt();\n\n const neg = (z < zero) | 0;\n\n if (neg)\n z = -z;\n\n let i = 0;\n\n while (z > zero) {\n out.words[i++] = Number(z & mask);\n z >>= shift;\n }\n\n if (i === 0)\n out.words[i++] = 0;\n\n out.length = i;\n out.negative = neg;\n\n return out;\n}\n\nfunction comb10MulTo(self, num, out) {\n const a = self.words;\n const b = num.words;\n const o = out.words;\n const a0 = a[0] | 0;\n const al0 = a0 & 0x1fff;\n const ah0 = a0 >>> 13;\n const a1 = a[1] | 0;\n const al1 = a1 & 0x1fff;\n const ah1 = a1 >>> 13;\n const a2 = a[2] | 0;\n const al2 = a2 & 0x1fff;\n const ah2 = a2 >>> 13;\n const a3 = a[3] | 0;\n const al3 = a3 & 0x1fff;\n const ah3 = a3 >>> 13;\n const a4 = a[4] | 0;\n const al4 = a4 & 0x1fff;\n const ah4 = a4 >>> 13;\n const a5 = a[5] | 0;\n const al5 = a5 & 0x1fff;\n const ah5 = a5 >>> 13;\n const a6 = a[6] | 0;\n const al6 = a6 & 0x1fff;\n const ah6 = a6 >>> 13;\n const a7 = a[7] | 0;\n const al7 = a7 & 0x1fff;\n const ah7 = a7 >>> 13;\n const a8 = a[8] | 0;\n const al8 = a8 & 0x1fff;\n const ah8 = a8 >>> 13;\n const a9 = a[9] | 0;\n const al9 = a9 & 0x1fff;\n const ah9 = a9 >>> 13;\n const b0 = b[0] | 0;\n const bl0 = b0 & 0x1fff;\n const bh0 = b0 >>> 13;\n const b1 = b[1] | 0;\n const bl1 = b1 & 0x1fff;\n const bh1 = b1 >>> 13;\n const b2 = b[2] | 0;\n const bl2 = b2 & 0x1fff;\n const bh2 = b2 >>> 13;\n const b3 = b[3] | 0;\n const bl3 = b3 & 0x1fff;\n const bh3 = b3 >>> 13;\n const b4 = b[4] | 0;\n const bl4 = b4 & 0x1fff;\n const bh4 = b4 >>> 13;\n const b5 = b[5] | 0;\n const bl5 = b5 & 0x1fff;\n const bh5 = b5 >>> 13;\n const b6 = b[6] | 0;\n const bl6 = b6 & 0x1fff;\n const bh6 = b6 >>> 13;\n const b7 = b[7] | 0;\n const bl7 = b7 & 0x1fff;\n const bh7 = b7 >>> 13;\n const b8 = b[8] | 0;\n const bl8 = b8 & 0x1fff;\n const bh8 = b8 >>> 13;\n const b9 = b[9] | 0;\n const bl9 = b9 & 0x1fff;\n const bh9 = b9 >>> 13;\n\n let c = 0;\n let lo, mid, hi;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(20);\n out.length = 19;\n\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n\n let w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n\n let w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n\n let w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n\n let w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n\n let w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n\n let w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n\n let w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n\n let w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n\n let w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n\n let w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n\n let w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n\n let w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n\n let w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n\n let w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n\n let w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n\n let w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n\n let w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n\n let w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n\n let w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n\n if (c !== 0) {\n o[19] = c;\n out.length += 1;\n }\n\n // Note: we shouldn't need to strip here.\n return out;\n}\n\n// Polyfill comb.\nif (!Math.imul)\n comb10MulTo = smallMulTo;\n\n/*\n * Expose\n */\n\nBN.Red = Red;\n\nmodule.exports = BN;\n","/*!\n * bn.js - big numbers for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/bn');\n","/*!\n * chacha20.js - chacha20 for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources\n * https://en.wikipedia.org/wiki/Chacha20\n * https://tools.ietf.org/html/rfc7539#section-2\n * https://cr.yp.to/chacha.html\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/*\n * Constants\n */\n\nconst BIG_ENDIAN = new Int8Array(new Int16Array([1]).buffer)[0] === 0;\n\n/**\n * ChaCha20\n */\n\nclass ChaCha20 {\n /**\n * Create a ChaCha20 context.\n * @constructor\n */\n\n constructor() {\n this.state = new Uint32Array(16);\n this.stream = new Uint32Array(16);\n this.bytes = new Uint8Array(this.stream.buffer);\n this.pos = -1;\n\n if (BIG_ENDIAN)\n this.bytes = Buffer.alloc(64);\n }\n\n /**\n * Initialize chacha20 with a key, nonce, and counter.\n * @param {Buffer} key\n * @param {Buffer} nonce\n * @param {Number} counter\n */\n\n init(key, nonce, counter) {\n if (counter == null)\n counter = 0;\n\n assert(Buffer.isBuffer(key));\n assert(Buffer.isBuffer(nonce));\n assert(Number.isSafeInteger(counter));\n\n if (key.length !== 16 && key.length !== 32)\n throw new RangeError('Invalid key size.');\n\n if (nonce.length >= 24) {\n key = ChaCha20.derive(key, nonce.slice(0, 16));\n nonce = nonce.slice(16);\n }\n\n this.state[0] = 0x61707865;\n this.state[1] = key.length < 32 ? 0x3120646e : 0x3320646e;\n this.state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32;\n this.state[3] = 0x6b206574;\n this.state[4] = readU32(key, 0);\n this.state[5] = readU32(key, 4);\n this.state[6] = readU32(key, 8);\n this.state[7] = readU32(key, 12);\n this.state[8] = readU32(key, 16 % key.length);\n this.state[9] = readU32(key, 20 % key.length);\n this.state[10] = readU32(key, 24 % key.length);\n this.state[11] = readU32(key, 28 % key.length);\n this.state[12] = counter >>> 0;\n\n if (nonce.length === 8) {\n this.state[13] = (counter / 0x100000000) >>> 0;\n this.state[14] = readU32(nonce, 0);\n this.state[15] = readU32(nonce, 4);\n } else if (nonce.length === 12) {\n this.state[13] = readU32(nonce, 0);\n this.state[14] = readU32(nonce, 4);\n this.state[15] = readU32(nonce, 8);\n } else if (nonce.length === 16) {\n this.state[12] = readU32(nonce, 0);\n this.state[13] = readU32(nonce, 4);\n this.state[14] = readU32(nonce, 8);\n this.state[15] = readU32(nonce, 12);\n } else {\n throw new RangeError('Invalid nonce size.');\n }\n\n this.pos = 0;\n\n return this;\n }\n\n /**\n * Encrypt/decrypt data.\n * @param {Buffer} data - Will be mutated.\n * @returns {Buffer}\n */\n\n encrypt(data) {\n assert(Buffer.isBuffer(data));\n\n if (this.pos === -1)\n throw new Error('Context is not initialized.');\n\n for (let i = 0; i < data.length; i++) {\n if ((this.pos & 63) === 0) {\n this._block();\n this.pos = 0;\n }\n\n data[i] ^= this.bytes[this.pos++];\n }\n\n return data;\n }\n\n /**\n * Stir the stream.\n */\n\n _block() {\n for (let i = 0; i < 16; i++)\n this.stream[i] = this.state[i];\n\n for (let i = 0; i < 10; i++) {\n qround(this.stream, 0, 4, 8, 12);\n qround(this.stream, 1, 5, 9, 13);\n qround(this.stream, 2, 6, 10, 14);\n qround(this.stream, 3, 7, 11, 15);\n qround(this.stream, 0, 5, 10, 15);\n qround(this.stream, 1, 6, 11, 12);\n qround(this.stream, 2, 7, 8, 13);\n qround(this.stream, 3, 4, 9, 14);\n }\n\n for (let i = 0; i < 16; i++)\n this.stream[i] += this.state[i];\n\n if (BIG_ENDIAN) {\n for (let i = 0; i < 16; i++)\n writeU32(this.bytes, this.stream[i], i * 4);\n }\n\n this.state[12] += 1;\n\n if (this.state[12] === 0)\n this.state[13] += 1;\n }\n\n /**\n * Destroy context.\n */\n\n destroy() {\n for (let i = 0; i < 16; i++) {\n this.state[i] = 0;\n this.stream[i] = 0;\n }\n\n if (BIG_ENDIAN) {\n for (let i = 0; i < 64; i++)\n this.bytes[i] = 0;\n }\n\n this.pos = -1;\n\n return this;\n }\n\n /**\n * Derive key with XChaCha20.\n * @param {Buffer} key\n * @param {Buffer} nonce\n * @returns {Buffer}\n */\n\n static derive(key, nonce) {\n assert(Buffer.isBuffer(key));\n assert(Buffer.isBuffer(nonce));\n\n if (key.length !== 16 && key.length !== 32)\n throw new RangeError('Invalid key size.');\n\n if (nonce.length !== 16)\n throw new RangeError('Invalid nonce size.');\n\n const state = new Uint32Array(16);\n\n state[0] = 0x61707865;\n state[1] = key.length < 32 ? 0x3120646e : 0x3320646e;\n state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32;\n state[3] = 0x6b206574;\n state[4] = readU32(key, 0);\n state[5] = readU32(key, 4);\n state[6] = readU32(key, 8);\n state[7] = readU32(key, 12);\n state[8] = readU32(key, 16 % key.length);\n state[9] = readU32(key, 20 % key.length);\n state[10] = readU32(key, 24 % key.length);\n state[11] = readU32(key, 28 % key.length);\n state[12] = readU32(nonce, 0);\n state[13] = readU32(nonce, 4);\n state[14] = readU32(nonce, 8);\n state[15] = readU32(nonce, 12);\n\n for (let i = 0; i < 10; i++) {\n qround(state, 0, 4, 8, 12);\n qround(state, 1, 5, 9, 13);\n qround(state, 2, 6, 10, 14);\n qround(state, 3, 7, 11, 15);\n qround(state, 0, 5, 10, 15);\n qround(state, 1, 6, 11, 12);\n qround(state, 2, 7, 8, 13);\n qround(state, 3, 4, 9, 14);\n }\n\n const out = Buffer.alloc(32);\n\n writeU32(out, state[0], 0);\n writeU32(out, state[1], 4);\n writeU32(out, state[2], 8);\n writeU32(out, state[3], 12);\n writeU32(out, state[12], 16);\n writeU32(out, state[13], 20);\n writeU32(out, state[14], 24);\n writeU32(out, state[15], 28);\n\n return out;\n }\n}\n\n/*\n * Static\n */\n\nChaCha20.native = 0;\n\n/*\n * Helpers\n */\n\nfunction qround(x, a, b, c, d) {\n x[a] += x[b];\n x[d] = rotl32(x[d] ^ x[a], 16);\n\n x[c] += x[d];\n x[b] = rotl32(x[b] ^ x[c], 12);\n\n x[a] += x[b];\n x[d] = rotl32(x[d] ^ x[a], 8);\n\n x[c] += x[d];\n x[b] = rotl32(x[b] ^ x[c], 7);\n}\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\n\nfunction readU32(data, off) {\n return (data[off++]\n + data[off++] * 0x100\n + data[off++] * 0x10000\n + data[off] * 0x1000000);\n}\n\nfunction writeU32(dst, num, off) {\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n return off;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = ChaCha20;\n","/*!\n * chacha20.js - chacha20 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/chacha20');\n","/*!\n * hmac.js - hmac for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/hash.js:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/hash.js\n *\n * Resources:\n * https://en.wikipedia.org/wiki/HMAC\n * https://tools.ietf.org/html/rfc2104\n * https://github.com/indutny/hash.js/blob/master/lib/hash/hmac.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/**\n * HMAC\n */\n\nclass HMAC {\n /**\n * Create an HMAC.\n * @param {Function} Hash\n * @param {Number} size\n * @param {Array} [x=[]]\n * @param {Array} [y=[]]\n */\n\n constructor(Hash, size, x = [], y = []) {\n assert(typeof Hash === 'function');\n assert((size >>> 0) === size);\n assert(Array.isArray(x));\n assert(Array.isArray(y));\n\n this.hash = Hash;\n this.size = size;\n this.x = x;\n this.y = y;\n\n this.inner = new Hash();\n this.outer = new Hash();\n }\n\n /**\n * Initialize HMAC context.\n * @param {Buffer} data\n */\n\n init(key) {\n assert(Buffer.isBuffer(key));\n\n // Shorten key\n if (key.length > this.size) {\n const Hash = this.hash;\n const h = new Hash();\n\n h.init(...this.x);\n h.update(key);\n\n key = h.final(...this.y);\n\n assert(key.length <= this.size);\n }\n\n // Pad key\n const pad = Buffer.alloc(this.size);\n\n for (let i = 0; i < key.length; i++)\n pad[i] = key[i] ^ 0x36;\n\n for (let i = key.length; i < pad.length; i++)\n pad[i] = 0x36;\n\n this.inner.init(...this.x);\n this.inner.update(pad);\n\n for (let i = 0; i < key.length; i++)\n pad[i] = key[i] ^ 0x5c;\n\n for (let i = key.length; i < pad.length; i++)\n pad[i] = 0x5c;\n\n this.outer.init(...this.x);\n this.outer.update(pad);\n\n return this;\n }\n\n /**\n * Update HMAC context.\n * @param {Buffer} data\n */\n\n update(data) {\n this.inner.update(data);\n return this;\n }\n\n /**\n * Finalize HMAC context.\n * @returns {Buffer}\n */\n\n final() {\n this.outer.update(this.inner.final(...this.y));\n return this.outer.final(...this.y);\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = HMAC;\n","/*!\n * sha256.js - SHA256 implementation for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/hash.js:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/hash.js\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-2\n * https://tools.ietf.org/html/rfc4634\n * https://github.com/indutny/hash.js/blob/master/lib/hash/sha/256.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst HMAC = require('../internal/hmac');\n\n/*\n * Constants\n */\n\nconst FINALIZED = -1;\nconst DESC = Buffer.alloc(8, 0x00);\nconst PADDING = Buffer.alloc(64, 0x00);\n\nPADDING[0] = 0x80;\n\nconst K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n/**\n * SHA256\n */\n\nclass SHA256 {\n constructor() {\n this.state = new Uint32Array(8);\n this.msg = new Uint32Array(64);\n this.block = Buffer.alloc(64);\n this.size = FINALIZED;\n }\n\n init() {\n this.state[0] = 0x6a09e667;\n this.state[1] = 0xbb67ae85;\n this.state[2] = 0x3c6ef372;\n this.state[3] = 0xa54ff53a;\n this.state[4] = 0x510e527f;\n this.state[5] = 0x9b05688c;\n this.state[6] = 0x1f83d9ab;\n this.state[7] = 0x5be0cd19;\n this.size = 0;\n return this;\n }\n\n update(data) {\n assert(Buffer.isBuffer(data));\n this._update(data, data.length);\n return this;\n }\n\n final() {\n return this._final(Buffer.alloc(32));\n }\n\n _update(data, len) {\n assert(this.size !== FINALIZED, 'Context is not initialized.');\n\n let pos = this.size & 63;\n let off = 0;\n\n this.size += len;\n\n if (pos > 0) {\n let want = 64 - pos;\n\n if (want > len)\n want = len;\n\n data.copy(this.block, pos, off, off + want);\n\n pos += want;\n len -= want;\n off += want;\n\n if (pos < 64)\n return;\n\n this._transform(this.block, 0);\n }\n\n while (len >= 64) {\n this._transform(data, off);\n off += 64;\n len -= 64;\n }\n\n if (len > 0)\n data.copy(this.block, 0, off, off + len);\n }\n\n _final(out) {\n assert(this.size !== FINALIZED, 'Context is not initialized.');\n\n const pos = this.size & 63;\n const len = this.size * 8;\n\n writeU32(DESC, (len * (1 / 0x100000000)) >>> 0, 0);\n writeU32(DESC, len >>> 0, 4);\n\n this._update(PADDING, 1 + ((119 - pos) & 63));\n this._update(DESC, 8);\n\n for (let i = 0; i < 8; i++) {\n writeU32(out, this.state[i], i * 4);\n this.state[i] = 0;\n }\n\n for (let i = 0; i < 64; i++)\n this.msg[i] = 0;\n\n for (let i = 0; i < 64; i++)\n this.block[i] = 0;\n\n this.size = FINALIZED;\n\n return out;\n }\n\n _transform(chunk, pos) {\n const W = this.msg;\n\n let a = this.state[0];\n let b = this.state[1];\n let c = this.state[2];\n let d = this.state[3];\n let e = this.state[4];\n let f = this.state[5];\n let g = this.state[6];\n let h = this.state[7];\n let i = 0;\n\n for (; i < 16; i++)\n W[i] = readU32(chunk, pos + i * 4);\n\n for (; i < 64; i++)\n W[i] = sigma1(W[i - 2]) + W[i - 7] + sigma0(W[i - 15]) + W[i - 16];\n\n for (i = 0; i < 64; i++) {\n const t1 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i];\n const t2 = Sigma0(a) + Maj(a, b, c);\n\n h = g;\n g = f;\n f = e;\n\n e = (d + t1) >>> 0;\n\n d = c;\n c = b;\n b = a;\n\n a = (t1 + t2) >>> 0;\n }\n\n this.state[0] += a;\n this.state[1] += b;\n this.state[2] += c;\n this.state[3] += d;\n this.state[4] += e;\n this.state[5] += f;\n this.state[6] += g;\n this.state[7] += h;\n }\n\n static hash() {\n return new SHA256();\n }\n\n static hmac() {\n return new HMAC(SHA256, 64);\n }\n\n static digest(data) {\n return SHA256.ctx.init().update(data).final();\n }\n\n static root(left, right) {\n assert(Buffer.isBuffer(left) && left.length === 32);\n assert(Buffer.isBuffer(right) && right.length === 32);\n return SHA256.ctx.init().update(left).update(right).final();\n }\n\n static multi(x, y, z) {\n const {ctx} = SHA256;\n\n ctx.init();\n ctx.update(x);\n ctx.update(y);\n\n if (z)\n ctx.update(z);\n\n return ctx.final();\n }\n\n static mac(data, key) {\n return SHA256.hmac().init(key).update(data).final();\n }\n}\n\n/*\n * Static\n */\n\nSHA256.native = 0;\nSHA256.id = 'SHA256';\nSHA256.size = 32;\nSHA256.bits = 256;\nSHA256.blockSize = 64;\nSHA256.zero = Buffer.alloc(32, 0x00);\nSHA256.ctx = new SHA256();\n\n/*\n * Helpers\n */\n\nfunction Sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n}\n\nfunction Sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n}\n\nfunction sigma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3);\n}\n\nfunction sigma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10);\n}\n\nfunction Ch(x, y, z) {\n return z ^ (x & (y ^ z));\n}\n\nfunction Maj(x, y, z) {\n return (x & y) | (z & (x | y));\n}\n\nfunction readU32(data, off) {\n return (data[off++] * 0x1000000\n + data[off++] * 0x10000\n + data[off++] * 0x100\n + data[off]);\n}\n\nfunction writeU32(data, num, off) {\n data[off++] = num >>> 24;\n data[off++] = num >>> 16;\n data[off++] = num >>> 8;\n data[off++] = num;\n return off;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = SHA256;\n","/*!\n * sha256.js - sha256 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/sha256');\n","/*!\n * batch-rng.js - batch rng for bcrypto\n * Copyright (c) 2019-2020, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on ElementsProject/secp256k1-zkp:\n * Copyright (c) 2013, Pieter Wuille.\n * https://github.com/ElementsProject/secp256k1-zkp\n *\n * Resources:\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/modules/schnorrsig/main_impl.h#L166\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/scalar_4x64_impl.h#L972\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/scalar_8x32_impl.h#L747\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst BN = require('../bn');\nconst ChaCha20 = require('../chacha20');\nconst SHA256 = require('../sha256');\n\n/**\n * BatchRNG\n */\n\nclass BatchRNG {\n constructor(curve, encode = key => key) {\n this.curve = curve;\n this.encode = encode;\n this.hash = new SHA256();\n this.chacha = new ChaCha20();\n this.key = Buffer.alloc(32, 0x00);\n this.iv = Buffer.alloc(8, 0x00);\n this.cache = [new BN(1), new BN(1)];\n }\n\n init(batch) {\n assert(Array.isArray(batch));\n\n this.hash.init();\n\n for (const [msg, sig, key] of batch) {\n this.hash.update(SHA256.digest(msg));\n this.hash.update(sig);\n this.hash.update(this.encode(key));\n }\n\n this.key = this.hash.final();\n this.cache[0] = new BN(1);\n this.cache[1] = new BN(1);\n\n return this;\n }\n\n encrypt(counter) {\n const size = this.curve.scalarSize * 2;\n const data = Buffer.alloc(size, 0x00);\n const left = data.slice(0, this.curve.scalarSize);\n const right = data.slice(this.curve.scalarSize);\n\n this.chacha.init(this.key, this.iv, counter);\n this.chacha.encrypt(data);\n\n return [\n this.curve.decodeScalar(left),\n this.curve.decodeScalar(right)\n ];\n }\n\n refresh(counter) {\n let overflow = 0;\n\n for (;;) {\n // First word is always zero.\n this.iv[4] = overflow;\n this.iv[5] = overflow >>> 8;\n this.iv[6] = overflow >>> 16;\n this.iv[7] = overflow >>> 24;\n\n overflow += 1;\n\n const [s1, s2] = this.encrypt(counter);\n\n if (s1.isZero() || s1.cmp(this.curve.n) >= 0)\n continue;\n\n if (s2.isZero() || s2.cmp(this.curve.n) >= 0)\n continue;\n\n this.cache[0] = s1;\n this.cache[1] = s2;\n\n break;\n }\n }\n\n generate(index) {\n assert((index >>> 0) === index);\n\n if (index & 1)\n this.refresh(index >>> 1);\n\n return this.cache[index & 1];\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = BatchRNG;\n","/*!\n * elliptic.js - elliptic curves for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/elliptic:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/elliptic\n *\n * Formulas from DJB and Tanja Lange [EFD].\n *\n * References:\n *\n * [GECC] Guide to Elliptic Curve Cryptography\n * D. Hankerson, A. Menezes, and S. Vanstone\n * https://tinyurl.com/guide-to-ecc\n *\n * [GLV] Faster Point Multiplication on Elliptic Curves\n * R. Gallant, R. Lambert, and S. Vanstone\n * https://link.springer.com/content/pdf/10.1007/3-540-44647-8_11.pdf\n *\n * [MONT1] Montgomery curves and the Montgomery ladder\n * Daniel J. Bernstein, Tanja Lange\n * https://eprint.iacr.org/2017/293.pdf\n *\n * [SQUARED] Elligator Squared\n * Mehdi Tibouchi\n * https://eprint.iacr.org/2014/043.pdf\n *\n * [SEC1] SEC 1 - Standards for Efficient Cryptography Group\n * Certicom Research\n * https://www.secg.org/sec1-v2.pdf\n *\n * [SEC2] SEC 2: Recommended Elliptic Curve Domain Parameters\n * Certicom Research\n * https://www.secg.org/sec2-v2.pdf\n *\n * [SIDE1] Elliptic Curves and Side-Channel Attacks\n * Marc Joye\n * https://pdfs.semanticscholar.org/8d69/9645033e25d74fcfd4cbf07a770d2e943e14.pdf\n *\n * [BLIND] Side-Channel Analysis on Blinding Regular Scalar Multiplications\n * B. Feix, M. Roussellet, A. Venelli\n * https://eprint.iacr.org/2014/191.pdf\n *\n * [ALT] Alternative Elliptic Curve Representations\n * R. Struik\n * https://tools.ietf.org/id/draft-ietf-lwig-curve-representations-02.html\n *\n * [ARITH1] Arithmetic of Elliptic Curves\n * Christophe Doche, Tanja Lange\n * Handbook of Elliptic and Hyperelliptic Curve Cryptography\n * Page 267, Section 13 (978-1-58488-518-4)\n * https://hyperelliptic.org/HEHCC/index.html\n *\n * [ARITH2] The Arithmetic of Elliptic Curves, 2nd Edition\n * Joseph H. Silverman\n * http://www.pdmi.ras.ru/~lowdimma/BSD/Silverman-Arithmetic_of_EC.pdf\n *\n * [EFD] Explicit-Formulas Database\n * Daniel J. Bernstein, Tanja Lange\n * https://hyperelliptic.org/EFD/index.html\n *\n * [SAFE] SafeCurves: choosing safe curves for elliptic-curve cryptography\n * Daniel J. Bernstein\n * https://safecurves.cr.yp.to/\n *\n * [4GLV] Refinement of the Four-Dimensional GLV Method on Elliptic Curves\n * Hairong Yi, Yuqing Zhu, and Dongdai Lin\n * http://www.site.uottawa.ca/~cadams/papers/prepro/paper_19_slides.pdf\n *\n * [SSWU1] Efficient Indifferentiable Hashing into Ordinary Elliptic Curves\n * E. Brier, J. Coron, T. Icart, D. Madore, H. Randriam, M. Tibouchi\n * https://eprint.iacr.org/2009/340.pdf\n *\n * [SSWU2] Rational points on certain hyperelliptic curves over finite fields\n * Maciej Ulas\n * https://arxiv.org/abs/0706.1448\n *\n * [H2EC] Hashing to Elliptic Curves\n * A. Faz-Hernandez, S. Scott, N. Sullivan, R. S. Wahby, C. A. Wood\n * https://git.io/JeWz6\n * https://github.com/cfrg/draft-irtf-cfrg-hash-to-curve\n *\n * [SVDW1] Construction of Rational Points on Elliptic Curves\n * A. Shallue, C. E. van de Woestijne\n * https://works.bepress.com/andrew_shallue/1/download/\n *\n * [SVDW2] Indifferentiable Hashing to Barreto-Naehrig Curves\n * Pierre-Alain Fouque, Mehdi Tibouchi\n * https://www.di.ens.fr/~fouque/pub/latincrypt12.pdf\n *\n * [SVDW3] Covert ECDH over secp256k1\n * Pieter Wuille\n * https://gist.github.com/sipa/29118d3fcfac69f9930d57433316c039\n *\n * [MONT2] Montgomery Curve (wikipedia)\n * https://en.wikipedia.org/wiki/Montgomery_curve\n *\n * [MONT3] Montgomery Curves and their arithmetic\n * C. Costello, B. Smith\n * https://eprint.iacr.org/2017/212.pdf\n *\n * [ELL2] Elliptic-curve points indistinguishable from uniform random strings\n * D. Bernstein, M. Hamburg, A. Krasnova, T. Lange\n * https://elligator.cr.yp.to/elligator-20130828.pdf\n *\n * [RFC7748] Elliptic Curves for Security\n * A. Langley, M. Hamburg, S. Turner\n * https://tools.ietf.org/html/rfc7748\n *\n * [TWISTED] Twisted Edwards Curves\n * D. Bernstein, P. Birkner, M. Joye, T. Lange, C. Peters\n * https://eprint.iacr.org/2008/013.pdf\n *\n * [ELL1] Injective Encodings to Elliptic Curves\n * P. Fouque, A. Joux, M. Tibouchi\n * https://eprint.iacr.org/2013/373.pdf\n *\n * [ISOGENY] Twisting Edwards curves with isogenies\n * Mike Hamburg\n * https://www.shiftleft.org/papers/isogeny/isogeny.pdf\n *\n * [RFC8032] Edwards-Curve Digital Signature Algorithm (EdDSA)\n * S. Josefsson, SJD AB, I. Liusvaara\n * https://tools.ietf.org/html/rfc8032\n *\n * [SCHNORR] Schnorr Signatures for secp256k1\n * Pieter Wuille\n * https://github.com/sipa/bips/blob/d194620/bip-schnorr.mediawiki\n *\n * [BIP340] Schnorr Signatures for secp256k1\n * Pieter Wuille, Jonas Nick, Tim Ruffing\n * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\n *\n * [JCEN12] Efficient Software Implementation of Public-Key Cryptography\n * on Sensor Networks Using the MSP430X Microcontroller\n * C. P. L. Gouvea, L. B. Oliveira, J. Lopez\n * http://conradoplg.cryptoland.net/files/2010/12/jcen12.pdf\n *\n * [FIPS186] Federal Information Processing Standards Publication\n * National Institute of Standards and Technology\n * https://tinyurl.com/fips-186-3\n *\n * [RFC5639] Elliptic Curve Cryptography (ECC) Brainpool\n * Standard Curves and Curve Generation\n * M. Lochter, BSI, J. Merkle\n * https://tools.ietf.org/html/rfc5639\n *\n * [TWISTEQ] Twisted Edwards & Short Weierstrass Equivalence\n * Christopher Jeffrey\n * https://gist.github.com/chjj/16ba7fa08d64e8dda269a9fe5b2a8bbc\n *\n * [ECPM] Elliptic Curve Point Multiplication (wikipedia)\n * https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication\n */\n\n'use strict';\n\nconst {custom} = require('../internal/custom');\nconst BN = require('../bn');\n\n/*\n * Constants\n */\n\nconst types = {\n AFFINE: 0,\n JACOBIAN: 1,\n PROJECTIVE: 2,\n EXTENDED: 3\n};\n\nconst jsfIndex = [\n -3, // -1 -1\n -1, // -1 0\n -5, // -1 1\n -7, // 0 -1\n 0, // 0 0\n 7, // 0 1\n 5, // 1 -1\n 1, // 1 0\n 3 // 1 1\n];\n\nconst USE_FIXED = false;\n\nlet uid = 0;\n\n/**\n * Curve\n */\n\nclass Curve {\n constructor(Point, type, conf) {\n this.Point = null;\n this.id = null;\n this.uid = uid++;\n this.ossl = null;\n this.type = 'base';\n this.endian = 'be';\n this.hash = null;\n this.prefix = null;\n this.context = false;\n this.prime = null;\n this.p = null;\n this.red = null;\n this.fieldSize = 0;\n this.fieldBits = 0;\n this.adjustedSize = 0;\n this.signBit = 0;\n this.mask = 0;\n this.n = null;\n this.h = null;\n this.q = null;\n this.z = null;\n this.g = null;\n this.nh = null;\n this.scalarSize = 0;\n this.scalarBits = 0;\n this.zero = null;\n this.one = null;\n this.two = null;\n this.three = null;\n this.four = null;\n this.i2 = null;\n this.i3 = null;\n this.i4 = null;\n this.i6 = null;\n this.torsion = null;\n this.endo = null;\n this.hi = null;\n this._init(Point, type, conf);\n }\n\n _init(Point, type, conf) {\n assert(typeof Point === 'function');\n assert(typeof type === 'string');\n assert(conf && typeof conf === 'object');\n assert(conf.red == null || (conf.red instanceof BN.Red));\n assert(conf.p != null, 'Must pass a prime.');\n assert(conf.id == null || typeof conf.id === 'string');\n assert(conf.ossl == null || typeof conf.ossl === 'string');\n assert(conf.endian == null || typeof conf.endian === 'string');\n assert(conf.hash == null || typeof conf.hash === 'string');\n assert(conf.prefix == null || typeof conf.prefix === 'string');\n assert(conf.context == null || typeof conf.context === 'boolean');\n assert(conf.prime == null || typeof conf.prime === 'string');\n assert(conf.torsion == null || Array.isArray(conf.torsion));\n\n // Point class.\n this.Point = Point;\n\n // Meta.\n this.id = conf.id || null;\n this.ossl = conf.ossl || null;\n this.type = type;\n this.endian = conf.endian || (type === 'short' ? 'be' : 'le');\n this.hash = conf.hash || null;\n this.prefix = conf.prefix ? Buffer.from(conf.prefix, 'binary') : null;\n this.context = conf.context || false;\n this.prime = conf.prime || null;\n\n // Prime.\n this.p = BN.fromJSON(conf.p);\n\n // Reduction.\n if (conf.red) {\n this.red = conf.red;\n } else {\n // Use Montgomery when there is no fast reduction for the prime.\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n this.red.precompute();\n }\n\n // Precalculate encoding length.\n this.fieldSize = this.p.byteLength();\n this.fieldBits = this.p.bitLength();\n this.adjustedSize = this.fieldSize + ((this.fieldBits & 7) === 0);\n this.signBit = this.adjustedSize * 8 - 1;\n this.mask = 0xff;\n\n if ((this.fieldBits & 7) !== 0)\n this.mask = (1 << (this.fieldBits & 7)) - 1;\n\n // Curve configuration, optional.\n this.n = BN.fromJSON(conf.n || '0');\n this.h = BN.fromJSON(conf.h || '1');\n this.q = this.n.mul(this.h);\n this.z = BN.fromJSON(conf.z || '0').toRed(this.red);\n this.g = null;\n this.nh = this.n.ushrn(1);\n this.scalarSize = this.n.byteLength();\n this.scalarBits = this.n.bitLength();\n\n // Useful for many curves.\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n this.three = new BN(3).toRed(this.red);\n this.four = new BN(4).toRed(this.red);\n\n // Inverses.\n this.i2 = this.two.redInvert();\n this.i3 = this.three.redInvert();\n this.i4 = this.i2.redSqr();\n this.i6 = this.i2.redMul(this.i3);\n\n // Torsion.\n this.torsion = new Array(this.h.word(0));\n\n for (let i = 0; i < this.torsion.length; i++)\n this.torsion[i] = this.point();\n\n // Endomorphism.\n this.endo = null;\n\n // Cache.\n this.hi = null;\n\n // Memoize.\n this._scale = memoize(this._scale, this);\n this.isIsomorphic = memoize(this.isIsomorphic, this);\n this.isIsogenous = memoize(this.isIsogenous, this);\n\n // Sanity checks.\n assert(this.p.sign() > 0 && this.p.isOdd());\n assert(this.n.sign() >= 0);\n assert(this.h.sign() > 0 && this.h.cmpn(255) <= 0);\n assert(this.endian === 'be' || this.endian === 'le');\n\n return this;\n }\n\n _finalize(conf) {\n assert(conf && typeof conf === 'object');\n\n // Create base point.\n this.g = conf.g ? this.pointFromJSON(conf.g) : this.point();\n\n // Parse small order points.\n if (conf.torsion) {\n assert(conf.torsion.length === this.torsion.length);\n\n for (let i = 0; i < this.torsion.length; i++)\n this.torsion[i] = this.pointFromJSON(conf.torsion[i]);\n }\n\n return this;\n }\n\n _findTorsion() {\n // Find all torsion points by grinding.\n assert(!this.n.isZero());\n\n const h = this.h.word(0);\n const x = this.one.redNeg();\n const out = [this.point()];\n const set = new Set();\n\n let len = h;\n\n while (out.length < len) {\n let p;\n\n x.redIAdd(this.one);\n\n try {\n p = this.pointFromX(x.clone());\n } catch (e) {\n continue;\n }\n\n try {\n p = p.mul(this.n);\n } catch (e) {\n len = 2;\n continue;\n }\n\n if (p.isInfinity())\n continue;\n\n p.normalize();\n\n for (const point of [p, p.neg()]) {\n const key = point.key();\n\n if (!set.has(key)) {\n out.push(point);\n set.add(key);\n }\n }\n }\n\n out.sort((a, b) => a.cmp(b));\n\n while (out.length < h)\n out.push(this.point());\n\n return out;\n }\n\n _fixedMul(p, k) {\n // Fixed-base method for point multiplication.\n //\n // [ECPM] \"Windowed method\".\n // [GECC] Page 95, Section 3.3.\n //\n // Windows are appropriately shifted to avoid any\n // doublings. This reduces a 256 bit multiplication\n // down to 64 additions with a window size of 4.\n assert(p instanceof Point);\n assert(k instanceof BN);\n assert(p.pre && p.pre.windows);\n\n // Get precomputed windows.\n const {width, points} = p._getWindows(0, 0);\n\n // Recompute window size.\n const size = 1 << width;\n\n // Recompute steps.\n const bits = k.bitLength();\n const steps = ((bits + width - 1) / width) >>> 0;\n\n // Multiply.\n let acc = this.jpoint();\n\n for (let i = 0; i < steps; i++) {\n const bits = k.bits(i * width, width);\n\n acc = acc.add(points[i * size + bits]);\n }\n\n // Adjust sign.\n if (k.isNeg())\n acc = acc.neg();\n\n return acc;\n }\n\n _fixedNafMul(p, k) {\n // Fixed-base NAF windowing method for point multiplication.\n //\n // [GECC] Algorithm 3.42, Page 105, Section 3.3.\n assert(p instanceof Point);\n assert(k instanceof BN);\n assert(p.pre && p.pre.doubles);\n\n // Get precomputed doubles.\n const {step, points} = p._getDoubles(0, 0);\n\n // Get fixed NAF (in a more windowed form).\n const naf = getFixedNAF(k, 2, k.bitLength() + 1, step);\n\n // Compute steps.\n const I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3;\n\n // Multiply.\n let a = this.jpoint();\n let b = this.jpoint();\n\n for (let i = I; i > 0; i--) {\n for (let j = 0; j < naf.length; j++) {\n const nafW = naf[j];\n\n if (nafW === i)\n b = b.add(points[j]);\n else if (nafW === -i)\n b = b.sub(points[j]);\n }\n\n a = a.add(b);\n }\n\n return a;\n }\n\n _wnafMul(w, p, k) {\n // Window NAF method for point multiplication.\n //\n // [GECC] Algorithm 3.36, Page 100, Section 3.3.\n assert(p instanceof Point);\n assert(k instanceof BN);\n\n // Precompute window.\n const {width, points} = p._safeNAF(w);\n\n // Get NAF form.\n const naf = getNAF(k, width, k.bitLength() + 1);\n\n // Add `this`*(N+1) for every w-NAF index.\n let acc = this.jpoint();\n\n for (let i = naf.length - 1; i >= 0; i--) {\n const z = naf[i];\n\n if (i !== naf.length - 1)\n acc = acc.dbl();\n\n if (z > 0)\n acc = acc.add(points[(z - 1) >> 1]);\n else if (z < 0)\n acc = acc.sub(points[(-z - 1) >> 1]);\n }\n\n return acc;\n }\n\n _wnafMulAdd(w, points, coeffs) {\n // Multiple point multiplication, also known\n // as \"Shamir's trick\" (with interleaved NAFs).\n //\n // [GECC] Algorithm 3.48, Page 109, Section 3.3.3.\n // Algorithm 3.51, Page 112, Section 3.3.\n //\n // This is particularly useful for signature\n // verifications and mutiplications after an\n // endomorphism split.\n assert((w >>> 0) === w);\n assert(Array.isArray(points));\n assert(Array.isArray(coeffs));\n assert(points.length === coeffs.length);\n\n const length = points.length;\n const wnd = new Array(length);\n const naf = new Array(length);\n\n // Check arrays and calculate size.\n let max = 0;\n\n for (let i = 0; i < length; i++) {\n const point = points[i];\n const coeff = coeffs[i];\n\n assert(point instanceof Point);\n assert(coeff instanceof BN);\n\n if (i > 0 && point.type !== points[i - 1].type)\n throw new Error('Cannot mix points.');\n\n // Avoid sparse arrays.\n wnd[i] = null;\n naf[i] = null;\n\n // Compute max scalar size.\n max = Math.max(max, coeff.bitLength() + 1);\n }\n\n // Compute NAFs.\n let ppoint = null;\n let pcoeff = null;\n let len = 0;\n\n for (let i = 0; i < length; i++) {\n const point = points[i];\n const coeff = coeffs[i];\n const pre = point._getNAF(0);\n\n // Use precomputation if available.\n if (pre) {\n wnd[len] = pre.points;\n naf[len] = getNAF(coeff, pre.width, max);\n len += 1;\n continue;\n }\n\n // Save last non-precomputed point.\n if (!ppoint) {\n ppoint = point;\n pcoeff = coeff;\n continue;\n }\n\n // Compute JSF in NAF form.\n wnd[len] = ppoint._getJNAF(point);\n naf[len] = getJNAF(pcoeff, coeff, max);\n\n ppoint = null;\n pcoeff = null;\n\n len += 1;\n }\n\n // Regular NAF for odd points.\n if (ppoint) {\n const nafw = ppoint._safeNAF(w);\n\n wnd[len] = nafw.points;\n naf[len] = getNAF(pcoeff, nafw.width, max);\n\n len += 1;\n }\n\n // Multiply and add.\n let acc = this.jpoint();\n\n for (let i = max - 1; i >= 0; i--) {\n if (i !== max - 1)\n acc = acc.dbl();\n\n for (let j = 0; j < len; j++) {\n const z = naf[j][i];\n\n if (z > 0)\n acc = acc.add(wnd[j][(z - 1) >> 1]);\n else if (z < 0)\n acc = acc.sub(wnd[j][(-z - 1) >> 1]);\n }\n }\n\n return acc;\n }\n\n _endoWnafMulAdd(points, coeffs) {\n throw new Error('Not implemented.');\n }\n\n _scale(curve, invert) {\n assert(curve instanceof Curve);\n assert(curve.p.eq(this.p));\n\n switch (curve.type) {\n case 'short':\n return this._scaleShort(curve, invert);\n case 'mont':\n return this._scaleMont(curve, invert);\n case 'edwards':\n return this._scaleEdwards(curve, invert);\n default:\n throw new Error('Not implemented.');\n }\n }\n\n _scaleShort(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n _scaleMont(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n _scaleEdwards(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n isElliptic() {\n throw new Error('Not implemented.');\n }\n\n jinv() {\n throw new Error('Not implemented.');\n }\n\n isComplete() {\n return false;\n }\n\n precompute(rng) {\n assert(!this.g.isInfinity(), 'Must have base point.');\n assert(!this.n.isZero(), 'Must have order.');\n\n this.g.precompute(this.n.bitLength(), rng);\n\n return this;\n }\n\n scalar(num, base, endian) {\n const k = new BN(num, base, endian);\n\n assert(!k.red);\n\n if (this.n.isZero())\n return k;\n\n return k.imod(this.n);\n }\n\n field(num, base, endian) {\n const x = BN.cast(num, base, endian);\n\n if (x.red)\n return x.forceRed(this.red);\n\n return x.toRed(this.red);\n }\n\n point(x, y) {\n throw new Error('Not implemented.');\n }\n\n jpoint(x, y, z) {\n throw new Error('Not implemented.');\n }\n\n xpoint(x, z) {\n throw new Error('Not implemented.');\n }\n\n cpoint(xx, xz, yy, yz) {\n assert(xx instanceof BN);\n assert(xz instanceof BN);\n assert(yy instanceof BN);\n assert(yz instanceof BN);\n\n if (xz.isZero() || yz.isZero())\n return this.point();\n\n const z = xz.redMul(yz).redInvert();\n const x = xx.redMul(yz).redMul(z);\n const y = yy.redMul(xz).redMul(z);\n\n return this.point(x, y);\n }\n\n solveX2(y) {\n throw new Error('Not implemented.');\n }\n\n solveX(y) {\n return this.solveX2(y).redSqrt();\n }\n\n solveY2(x) {\n throw new Error('Not implemented.');\n }\n\n solveY(x) {\n return this.solveY2(x).redSqrt();\n }\n\n validate(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromX(x, sign) {\n throw new Error('Not implemented.');\n }\n\n pointFromY(y, sign) {\n throw new Error('Not implemented.');\n }\n\n isIsomorphic(curve) {\n throw new Error('Not implemented.');\n }\n\n isIsogenous(curve) {\n throw new Error('Not implemented.');\n }\n\n pointFromShort(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point, sign) {\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n throw new Error('Not implemented.');\n }\n\n pointToUniform(p) {\n throw new Error('Not implemented.');\n }\n\n pointFromHash(bytes, pake = false) {\n // [H2EC] \"Roadmap\".\n assert(Buffer.isBuffer(bytes));\n assert(typeof pake === 'boolean');\n\n if (bytes.length !== this.fieldSize * 2)\n throw new Error('Invalid hash size.');\n\n // Random oracle encoding.\n // Ensure a proper distribution.\n const s1 = bytes.slice(0, this.fieldSize);\n const s2 = bytes.slice(this.fieldSize);\n const u1 = this.decodeUniform(s1);\n const u2 = this.decodeUniform(s2);\n const p1 = this.pointFromUniform(u1);\n const p2 = this.pointFromUniform(u2);\n const p3 = p1.add(p2);\n\n return pake ? p3.mulH() : p3;\n }\n\n pointToHash(p, subgroup, rng) {\n // [SQUARED] Algorithm 1, Page 8, Section 3.3.\n assert(p instanceof this.Point);\n assert((subgroup >>> 0) === subgroup);\n\n // Add a random torsion component.\n const i = subgroup % this.torsion.length;\n const p0 = p.add(this.torsion[i]);\n\n // Average Cost (R = sqrt):\n //\n // SSWU (~4 iterations) => 8I + 16R\n // SVDW (~4 iterations) => 12I + 28R\n // Elligator 1 (~2 iterations) => 6I + 10R\n // Elligator 2 (~2 iterations) => 4I + 6R\n // Ristretto (~1 iteration) => 1I + 2R + h*1R\n for (;;) {\n const u1 = this.randomField(rng);\n const p1 = this.pointFromUniform(u1);\n\n // Avoid 2-torsion points:\n // Short Weierstrass: ((A / 3) / B, 0)\n // Montgomery: (0, 0)\n // Twisted Edwards: (0, -1)\n if (p1.neg().eq(p1))\n continue;\n\n const p2 = p0.sub(p1);\n const hint = randomInt(rng);\n\n let u2;\n try {\n u2 = this.pointToUniform(p2, hint & 15);\n } catch (e) {\n if (e.message === 'Invalid point.')\n continue;\n throw e;\n }\n\n const s1 = this.encodeUniform(u1, hint >>> 8);\n const s2 = this.encodeUniform(u2, hint >>> 16);\n\n return Buffer.concat([s1, s2]);\n }\n }\n\n randomScalar(rng) {\n const max = this.n.isZero() ? this.p : this.n;\n return BN.random(rng, 1, max);\n }\n\n randomField(rng) {\n return BN.random(rng, 1, this.p).toRed(this.red);\n }\n\n randomPoint(rng) {\n let p;\n\n for (;;) {\n const x = this.randomField(rng);\n const sign = (randomInt(rng) & 1) !== 0;\n\n try {\n p = this.pointFromX(x, sign);\n } catch (e) {\n continue;\n }\n\n assert(p.validate());\n\n return p.mulH();\n }\n }\n\n mulAll(points, coeffs) {\n return this.jmulAll(points, coeffs);\n }\n\n jmulAll(points, coeffs) {\n assert(Array.isArray(points));\n assert(points.length === 0 || (points[0] instanceof Point));\n\n // Multiply with endomorphism if we're using affine points.\n if (this.endo && points.length > 0 && points[0].type === types.AFFINE)\n return this._endoWnafMulAdd(points, coeffs);\n\n // Otherwise, a regular Shamir's trick.\n return this._wnafMulAdd(5, points, coeffs);\n }\n\n mulH(k) {\n assert(k instanceof BN);\n return this.imulH(k.clone());\n }\n\n imulH(k) {\n assert(k instanceof BN);\n assert(!k.red);\n\n const word = this.h.word(0);\n\n // Optimize for powers of two.\n if ((word & (word - 1)) === 0) {\n const bits = this.h.bitLength();\n return k.iushln(bits - 1).imod(this.n);\n }\n\n return k.imuln(word).imod(this.n);\n }\n\n normalizeAll(points) {\n assert(Array.isArray(points));\n\n const len = points.length;\n const z = new Array(len);\n\n for (let i = 0; i < len; i++) {\n const p = points[i];\n\n assert(p instanceof Point);\n assert(p.curve === this);\n\n if (p.type === types.AFFINE) {\n z[i] = this.one;\n continue;\n }\n\n z[i] = p.z;\n }\n\n const zi = this.red.invertAll(z);\n const out = new Array(len);\n\n for (let i = 0; i < len; i++)\n out[i] = points[i].scale(zi[i]);\n\n return out;\n }\n\n affinizeAll(points) {\n return this.normalizeAll(points);\n }\n\n clamp(scalar) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n assert(Buffer.isBuffer(scalar));\n assert(scalar.length === this.scalarSize);\n assert(this.scalarSize <= this.fieldSize);\n\n let top = (this.fieldBits & 7) || 8;\n let lsb = 0;\n let msb = this.scalarSize - 1;\n\n // Swap endianness.\n if (this.endian === 'be')\n [lsb, msb] = [msb, lsb];\n\n // Adjust for low order.\n if (this.scalarSize < this.fieldSize)\n top = 8;\n\n // Ensure a multiple of the cofactor.\n scalar[lsb] &= -this.h.word(0) & 0xff;\n\n // Clamp to the prime.\n scalar[msb] &= (1 << top) - 1;\n\n // Set the high bit.\n scalar[msb] |= 1 << (top - 1);\n\n return scalar;\n }\n\n splitHash(bytes) {\n // [RFC8032] Section 5.1.6 & 5.2.6.\n assert(Buffer.isBuffer(bytes));\n assert(bytes.length === this.adjustedSize * 2);\n assert(this.scalarSize <= this.adjustedSize);\n\n let off = 0;\n\n if (this.endian === 'be')\n off = this.adjustedSize - this.scalarSize;\n\n const scalar = bytes.slice(off, off + this.scalarSize);\n const prefix = bytes.slice(this.adjustedSize);\n\n this.clamp(scalar);\n\n return [scalar, prefix];\n }\n\n encodeField(x) {\n // [SEC1] Page 12, Section 2.3.5.\n assert(x instanceof BN);\n assert(!x.red);\n\n return x.encode(this.endian, this.fieldSize);\n }\n\n decodeField(bytes) {\n // [SEC1] Page 13, Section 2.3.6.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.fieldSize)\n throw new Error('Invalid field element size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeAdjusted(x) {\n assert(x instanceof BN);\n assert(!x.red);\n\n return x.encode(this.endian, this.adjustedSize);\n }\n\n decodeAdjusted(bytes) {\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.adjustedSize)\n throw new Error('Invalid field element size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeScalar(k) {\n // [SEC1] Page 13, Section 2.3.7.\n assert(k instanceof BN);\n assert(!k.red);\n\n return k.encode(this.endian, this.scalarSize);\n }\n\n decodeScalar(bytes) {\n // [SEC1] Page 14, Section 2.3.8.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.scalarSize)\n throw new Error('Invalid scalar size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeClamped(k) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n return this.clamp(this.encodeScalar(k));\n }\n\n decodeClamped(bytes) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.scalarSize)\n throw new Error('Invalid scalar size.');\n\n const clamped = this.clamp(Buffer.from(bytes));\n\n return BN.decode(clamped, this.endian);\n }\n\n encodeUniform(x, bits) {\n assert(x instanceof BN);\n assert((bits >>> 0) === bits);\n\n const msb = this.endian === 'le' ? this.fieldSize - 1 : 0;\n const bytes = x.fromRed().encode(this.endian, this.fieldSize);\n\n bytes[msb] |= (bits & ~this.mask) & 0xff;\n\n return bytes;\n }\n\n decodeUniform(bytes) {\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.fieldSize)\n throw new Error('Invalid field size.');\n\n const x = BN.decode(bytes, this.endian);\n\n x.iumaskn(this.fieldBits);\n\n return x.toRed(this.red);\n }\n\n encodePoint(point, compact) {\n assert(point instanceof Point);\n return point.encode(compact);\n }\n\n decodePoint(bytes) {\n throw new Error('Not implemented.');\n }\n\n encodeX(point) {\n throw new Error('Not implemented.');\n }\n\n decodeX(bytes) {\n throw new Error('Not implemented.');\n }\n\n decodeEven(bytes) {\n throw new Error('Not implemented.');\n }\n\n decodeSquare(bytes) {\n throw new Error('Not implemented.');\n }\n\n toShort() {\n throw new Error('Not implemented.');\n }\n\n toMont(b0) {\n throw new Error('Not implemented.');\n }\n\n toEdwards(a0) {\n throw new Error('Not implemented.');\n }\n\n pointToJSON(point, pre) {\n assert(point instanceof Point);\n return point.toJSON(pre);\n }\n\n pointFromJSON(json) {\n throw new Error('Not implemented.');\n }\n\n toJSON(pre) {\n let prefix, context;\n let n, z, endo;\n\n if (this.type === 'edwards') {\n prefix = this.prefix ? this.prefix.toString() : null;\n context = this.context;\n }\n\n if (!this.n.isZero())\n n = this.n.toJSON();\n\n if (!this.z.isZero()) {\n z = this.z.fromRed();\n\n if (this.z.redIsHigh())\n z.isub(this.p);\n\n z = z.toString(16);\n }\n\n if (this.endo)\n endo = this.endo.toJSON();\n\n return {\n id: this.id,\n ossl: this.ossl,\n type: this.type,\n endian: this.endian,\n hash: this.hash,\n prefix,\n context,\n prime: this.prime,\n p: this.p.toJSON(),\n a: undefined,\n b: undefined,\n d: undefined,\n n,\n h: this.h.toString(16),\n s: undefined,\n z,\n c: undefined,\n g: this.g.toJSON(pre),\n endo\n };\n }\n\n static fromJSON(json) {\n return new this(json);\n }\n}\n\n/**\n * Point\n */\n\nclass Point {\n constructor(curve, type) {\n assert(curve instanceof Curve);\n assert((type >>> 0) === type);\n\n this.curve = curve;\n this.type = type;\n this.pre = null;\n }\n\n _init() {\n throw new Error('Not implemented.');\n }\n\n _safeNAF(width) {\n assert((width >>> 0) === width);\n\n if (this.pre && this.pre.naf)\n return this.pre.naf;\n\n if (width === 0)\n return null;\n\n const size = 1 << (width - 2);\n const points = new Array(size);\n const p = this.toJ();\n const dbl = size === 1 ? null : p.dbl();\n\n points[0] = p;\n\n for (let i = 1; i < size; i++)\n points[i] = points[i - 1].add(dbl);\n\n return new NAF(width, points);\n }\n\n _getNAF(width) {\n assert((width >>> 0) === width);\n\n if (this.pre && this.pre.naf)\n return this.pre.naf;\n\n if (width === 0)\n return null;\n\n const odds = this._safeNAF(width).points;\n const points = this.curve.affinizeAll(odds);\n\n return new NAF(width, points);\n }\n\n _getWindows(width, bits) {\n assert((width >>> 0) === width);\n assert((bits >>> 0) === bits);\n\n if (this.pre && this.pre.windows)\n return this.pre.windows;\n\n if (width === 0)\n return null;\n\n const size = 1 << width;\n const steps = ((bits + width - 1) / width) >>> 0;\n const wnds = new Array(steps * size);\n\n let g = this.toJ();\n\n for (let i = 0; i < steps; i++) {\n wnds[i * size] = this.curve.jpoint();\n\n for (let j = 1; j < size; j++)\n wnds[i * size + j] = wnds[i * size + j - 1].add(g);\n\n g = g.dblp(width);\n }\n\n const points = this.curve.affinizeAll(wnds);\n\n return new Windows(width, bits, points);\n }\n\n _getDoubles(step, power) {\n assert((step >>> 0) === step);\n assert((power >>> 0) === power);\n\n if (this.pre && this.pre.doubles)\n return this.pre.doubles;\n\n if (step === 0)\n return null;\n\n const len = Math.ceil(power / step) + 1;\n const dbls = new Array(len);\n\n let acc = this.toJ();\n let k = 0;\n\n dbls[k++] = acc;\n\n for (let i = 0; i < power; i += step) {\n for (let j = 0; j < step; j++)\n acc = acc.dbl();\n\n dbls[k++] = acc;\n }\n\n assert(k === len);\n\n const points = this.curve.affinizeAll(dbls);\n\n return new Doubles(step, points);\n }\n\n _getBeta() {\n return null;\n }\n\n _getBlinding(rng) {\n if (this.pre && this.pre.blinding)\n return this.pre.blinding;\n\n if (!rng)\n return null;\n\n if (this.curve.n.isZero())\n return null;\n\n // Pregenerate a random blinding value:\n //\n // blind = random integer in [1,n-1]\n // unblind = G * blind\n //\n // We intend to subtract the blinding value\n // from scalars before multiplication. We\n // can add the unblinding point once the\n // multiplication is complete.\n const blind = this.curve.randomScalar(rng);\n const unblind = this.mul(blind);\n\n return new Blinding(blind, unblind);\n }\n\n _hasWindows(k) {\n assert(k instanceof BN);\n\n if (!this.pre || !this.pre.windows)\n return false;\n\n const {width, bits} = this.pre.windows;\n const steps = ((bits + width - 1) / width) >>> 0;\n\n return k.bitLength() <= steps * width;\n }\n\n _hasDoubles(k) {\n assert(k instanceof BN);\n\n if (!this.pre || !this.pre.doubles)\n return false;\n\n const {step, points} = this.pre.doubles;\n const power = k.bitLength() + 1;\n\n return points.length >= Math.ceil(power / step) + 1;\n }\n\n _getJNAF(point) {\n assert(point instanceof Point);\n assert(point.type === this.type);\n\n // Create comb for JSF.\n return [\n this, // 1\n this.add(point), // 3\n this.sub(point), // 5\n point // 7\n ];\n }\n\n _blind(k, rng) {\n // [SIDE1] Page 5, Section 4.\n // [BLIND] Page 20, Section 7.\n assert(k instanceof BN);\n assert(!k.red);\n\n // Scalar splitting (requires precomputation).\n //\n // Blind a multiplication by first subtracting\n // a blinding value from the scalar. Example:\n //\n // b = random integer in [1,n-1]\n // B = P * b (precomputed)\n // Q = P * (k - b) + B\n //\n // Note that Joye describes a different method\n // (multiplier randomization) which computes:\n //\n // B = random point in E\n // Q = (P + B) * k - B * k\n //\n // Our method is more similar to the \"scalar\n // splitting\" technique described in the\n // second source above.\n //\n // The blinding value and its corresponding\n // point are randomly generated and computed\n // on boot. As long as an attacker is not\n // able to observe the boot, this should give\n // a decent bit of protection against various\n // channel attacks.\n if (this.pre && this.pre.blinding) {\n const {blind, unblind} = this.pre.blinding;\n const t = k.sub(blind);\n\n return [this, t, unblind];\n }\n\n // Randomization is not possible without\n // an RNG. Do a normal multiplication.\n if (!rng)\n return [this, k, null];\n\n // If we have no precomputed blinding\n // factor, there are two possibilities\n // for randomization:\n //\n // 1. Randomize the multiplier by adding\n // a random multiple of `n`.\n //\n // 2. Re-scale the point itself by a\n // random factor.\n //\n // The first option can be accomplished\n // with some like:\n //\n // a = random integer in [1,n-1]\n // r = a * n\n // Q = P * (k + r)\n //\n // The second is accomplished with:\n //\n // a = random element in F(p)\n // R = (x * a^2, y * a^3, z * a)\n // Q = R * k\n //\n // If we have precomputed doubles / naf\n // points, we opt for the first method\n // to avoid randomizing everything.\n if (this.pre) {\n if (this.curve.n.isZero())\n return [this, k, null];\n\n const a = this.curve.randomScalar(rng);\n const r = a.mul(this.curve.n);\n const t = r.iadd(k);\n\n return [this, t, null];\n }\n\n // If there is no precomputation _at all_,\n // we opt for the second method.\n const p = this.randomize(rng);\n\n return [p, k, null];\n }\n\n clone() {\n throw new Error('Not implemented.');\n }\n\n precompute(bits, rng) {\n assert((bits >>> 0) === bits);\n\n if (!this.pre)\n this.pre = new Precomp();\n\n if (!this.pre.naf)\n this.pre.naf = this._getNAF(9);\n\n if (USE_FIXED && !this.pre.windows)\n this.pre.windows = this._getWindows(4, bits);\n\n if (!this.pre.doubles)\n this.pre.doubles = this._getDoubles(4, bits + 1);\n\n if (!this.pre.beta)\n this.pre.beta = this._getBeta();\n\n if (!this.pre.blinding)\n this.pre.blinding = this._getBlinding(rng);\n\n return this;\n }\n\n validate() {\n return this.curve.validate(this);\n }\n\n normalize() {\n return this;\n }\n\n scale(a) {\n throw new Error('Not implemented.');\n }\n\n randomize(rng) {\n const z = this.curve.randomField(rng);\n return this.scale(z);\n }\n\n neg() {\n throw new Error('Not implemented.');\n }\n\n add(point) {\n throw new Error('Not implemented.');\n }\n\n sub(point) {\n assert(point instanceof Point);\n return this.add(point.neg());\n }\n\n dbl() {\n throw new Error('Not implemented.');\n }\n\n dblp(pow) {\n // Repeated doubling. This can\n // be optimized by child classes.\n assert((pow >>> 0) === pow);\n\n let r = this;\n\n for (let i = 0; i < pow; i++)\n r = r.dbl();\n\n return r;\n }\n\n diffAddDbl(p, q) {\n throw new Error('Not implemented.');\n }\n\n getX() {\n throw new Error('Not implemented.');\n }\n\n getY() {\n throw new Error('Not implemented.');\n }\n\n eq(point) {\n throw new Error('Not implemented.');\n }\n\n cmp(point) {\n throw new Error('Not implemented.');\n }\n\n isInfinity() {\n throw new Error('Not implemented.');\n }\n\n isOrder2() {\n throw new Error('Not implemented.');\n }\n\n isOdd() {\n throw new Error('Not implemented.');\n }\n\n isEven() {\n throw new Error('Not implemented.');\n }\n\n isSquare() {\n throw new Error('Not implemented.');\n }\n\n eqX(x) {\n throw new Error('Not implemented.');\n }\n\n eqR(x) {\n throw new Error('Not implemented.');\n }\n\n isSmall() {\n // Test whether the point is of small order.\n if (this.isInfinity())\n return false;\n\n // P * h = O\n return this.jmulH().isInfinity();\n }\n\n hasTorsion() {\n // Test whether the point is in another subgroup.\n if (this.isInfinity())\n return false;\n\n // P * n != O\n return !this.jmul(this.curve.n).isInfinity();\n }\n\n order() {\n // Calculate point order.\n const {h, n} = this.curve;\n\n let p = this.toJ();\n let q = new BN(1);\n\n while (!p.isInfinity()) {\n q.iaddn(1);\n\n if (q.cmp(h) > 0) {\n q = n.clone();\n break;\n }\n\n p = p.add(this);\n }\n\n return q;\n }\n\n mul(k) {\n return this.jmul(k);\n }\n\n muln(k) {\n return this.jmuln(k);\n }\n\n mulBlind(k, rng) {\n return this.jmulBlind(k, rng);\n }\n\n mulAdd(k1, p2, k2) {\n return this.jmulAdd(k1, p2, k2);\n }\n\n mulH() {\n return this.jmulH();\n }\n\n div(k) {\n return this.jdiv(k);\n }\n\n divn(k) {\n return this.jdivn(k);\n }\n\n divH() {\n return this.jdivH();\n }\n\n jmul(k) {\n if (USE_FIXED && this._hasWindows(k))\n return this.curve._fixedMul(this, k);\n\n if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n\n if (this.curve.endo && this.type === types.AFFINE)\n return this.curve._endoWnafMulAdd([this], [k]);\n\n return this.curve._wnafMul(5, this, k);\n }\n\n jmuln(k) {\n assert((k | 0) === k);\n return this.jmul(new BN(k));\n }\n\n jmulBlind(k, rng = null) {\n const [p, t, unblind] = this._blind(k, rng);\n const q = p.jmul(t);\n\n if (unblind)\n return q.add(unblind);\n\n return q;\n }\n\n jmulAdd(k1, p2, k2) {\n if (this.curve.endo && this.type === types.AFFINE)\n return this.curve._endoWnafMulAdd([this, p2], [k1, k2]);\n\n return this.curve._wnafMulAdd(5, [this, p2], [k1, k2]);\n }\n\n jmulH() {\n const word = this.curve.h.word(0);\n\n // Optimize for powers of two.\n if ((word & (word - 1)) === 0) {\n const bits = this.curve.h.bitLength();\n return this.toJ().dblp(bits - 1);\n }\n\n return this.jmul(this.curve.h);\n }\n\n jdiv(k) {\n assert(k instanceof BN);\n assert(!k.red);\n\n return this.jmul(k.invert(this.curve.n));\n }\n\n jdivn(k) {\n assert(!this.curve.n.isZero());\n\n if (this.curve.h.cmpn(k) === 0)\n return this.jdivH();\n\n return this.jdiv(new BN(k));\n }\n\n jdivH() {\n if (this.curve.n.isZero())\n return this.toJ();\n\n if (this.curve.h.cmpn(1) === 0)\n return this.toJ();\n\n if (this.curve.hi === null)\n this.curve.hi = this.curve.h.invert(this.curve.n);\n\n return this.jmul(this.curve.hi);\n }\n\n toP() {\n return this.normalize();\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n return this;\n }\n\n key() {\n if (this.isInfinity())\n return `${this.curve.uid}:oo`;\n\n this.normalize();\n\n const x = this.getX().toString(16);\n const y = this.getY().toString(16);\n\n return `${this.curve.uid}:${x},${y}`;\n }\n\n encode(compact) {\n throw new Error('Not implemented.');\n }\n\n static decode(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n encodeX() {\n throw new Error('Not implemented.');\n }\n\n static decodeX(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n static decodeEven(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n static decodeSquare(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n toJSON(pre) {\n throw new Error('Not implemented.');\n }\n\n static fromJSON(curve, json) {\n throw new Error('Not implemented.');\n }\n\n [custom]() {\n return '';\n }\n}\n\n/**\n * ShortCurve\n */\n\nclass ShortCurve extends Curve {\n constructor(conf) {\n super(ShortPoint, 'short', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.b = BN.fromJSON(conf.b).toRed(this.red);\n this.c = BN.fromJSON(conf.c || '0').toRed(this.red);\n this.ai = this.a.isZero() ? this.zero : this.a.redInvert();\n this.zi = this.z.isZero() ? this.zero : this.z.redInvert();\n\n this.zeroA = this.a.isZero();\n this.threeA = this.a.eq(this.three.redNeg());\n this.redN = this.n.toRed(this.red);\n this.pmodn = this.p.clone();\n this.highOrder = this.n.cmp(this.p) >= 0;\n this.smallGap = false;\n\n this._finalize(conf);\n }\n\n _finalize(conf) {\n super._finalize(conf);\n\n // Precalculate endomorphism.\n if (conf.endo != null)\n this.endo = Endo.fromJSON(this, conf.endo);\n else\n this.endo = this._getEndomorphism();\n\n if (!this.n.isZero()) {\n this.pmodn = this.p.mod(this.n);\n\n // Check for Maxwell's trick (see eqR).\n this.smallGap = this.p.div(this.n).cmpn(1) <= 0;\n }\n\n return this;\n }\n\n static _isomorphism(curveA, curveB, custom, odd) {\n // Short Weierstrass Isomorphism.\n //\n // [GECC] Page 84, Section 3.1.5.\n // [ARITH1] Page 274, Section 13.1.5.\n // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves).\n //\n // Find `u` such that `a * u^4 = a'` and `b * u^6 = b'`.\n //\n // Transformation:\n //\n // u4 = a' / a\n // u2 = +-sqrt(u4)\n // u6 = u4 * u2\n // a' = a * u4\n // b' = b * u6\n //\n // Where `u2` is any root that is square.\n //\n // If a = 0, we can do:\n //\n // a' = 0\n // b' = b'\n //\n // Where (b' / b)^(1 / 3) is square.\n //\n // If b = 0, we can do:\n //\n // a' = a'\n // b' = 0\n //\n // Where sqrt(a' / a) is square.\n assert(curveA instanceof BN);\n assert(curveB instanceof BN);\n assert(custom instanceof BN);\n assert(odd == null || typeof odd === 'boolean');\n assert(!curveA.isZero() || !curveB.isZero());\n\n if (custom.isZero())\n throw new Error('Invalid coefficient.');\n\n if (curveA.isZero()) {\n const customB = custom;\n const u6 = customB.redDiv(curveB);\n // Todo: allow index flag.\n const u2 = uncube(u6);\n\n // Already checked in uncube().\n assert(u2.redJacobi() === 1);\n\n return [curveA.clone(), customB.clone()];\n }\n\n if (curveB.isZero()) {\n const customA = custom;\n const u4 = customA.redDiv(curveA);\n const u2 = u4.redSqrt();\n\n // Todo: allow odd flag.\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n\n if (u2.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n return [customA.clone(), curveB.clone()];\n }\n\n const customA = custom;\n const u4 = customA.redDiv(curveA);\n const u2 = u4.redSqrt();\n\n if (odd != null) {\n if (u2.redIsOdd() !== odd)\n u2.redINeg();\n } else {\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n }\n\n if (u2.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n const u6 = u4.redMul(u2);\n const a = curveA.redMul(u4);\n const b = curveB.redMul(u6);\n\n assert(a.eq(customA));\n\n return [a, b];\n }\n\n _short(a0, odd) {\n return ShortCurve._isomorphism(this.a, this.b, a0, odd);\n }\n\n _mont(b0, odd) {\n // Short Weierstrass->Montgomery Equivalence.\n //\n // [ARITH1] Page 286, Section 13.2.3.c.\n // [SAFE] \"Ladders\".\n //\n // Transformation:\n //\n // r = A / (3 * B)\n // s = +-sqrt(3 * r^2 + a)\n // A = 3 * r / s\n // B = 1 / s\n const [r, s] = this._findRS(odd);\n const b = s.redInvert();\n const a = r.redMuln(3).redMul(b);\n\n if (b0 != null)\n return MontCurve._isomorphism(a, b, b0);\n\n return [a, b];\n }\n\n _edwards(a0, odd) {\n // Short Weierstrass->Twisted Edwards Equivalence.\n //\n // [TWISTEQ] Section 1.\n //\n // Transformation:\n //\n // r = (a' + d') / 6\n // s = +-sqrt(3 * r^2 + a)\n // a' = 3 * r + 2 * s\n // d' = 3 * r - 2 * s\n const [r, s] = this._findRS(odd);\n const r3 = r.redMuln(3);\n const s2 = s.redMuln(2);\n const a = r3.redAdd(s2);\n const d = r3.redSub(s2);\n\n if (a0 != null)\n return EdwardsCurve._isomorphism(a, d, a0);\n\n return [a, d];\n }\n\n _findRS(sign) {\n // Find `r` and `s` for equivalence.\n //\n // [ARITH1] Page 286, Section 13.2.3.c.\n // [SAFE] \"Ladders\".\n //\n // Computation:\n //\n // r = solve(r^3 + a * r + b == 0, r)\n // s = +-sqrt(3 * r^2 + a)\n //\n // Computing `r` is non-trivial. We need\n // to solve `r^3 + a * r + b = 0`, but we\n // don't have a polynomial solver, so we\n // loop over random points until we find\n // one with 2-torsion. Multiplying by the\n // subgroup order should yield a point of\n // ((A / 3) / B, 0) which is a solution.\n assert(sign == null || typeof sign === 'boolean');\n assert(this.h.word(0) >= 4);\n assert(!this.n.isZero());\n\n const x = this.one.redNeg();\n\n let p;\n\n for (;;) {\n x.redIAdd(this.one);\n\n try {\n p = this.pointFromX(x.clone());\n } catch (e) {\n continue;\n }\n\n p = p.mul(this.n);\n\n if (p.isInfinity())\n continue;\n\n if (!p.y.isZero())\n continue;\n\n break;\n }\n\n const r = p.x;\n const r2 = r.redSqr();\n const s = r2.redMuln(3).redIAdd(this.a).redSqrt();\n\n if (sign != null) {\n if (s.redIsOdd() !== sign)\n s.redINeg();\n }\n\n return [r, s];\n }\n\n _scale0(a, b) {\n // We can extract the isomorphism factors with:\n //\n // u4 = a' / a\n // u6 = b' / b\n // u2 = +-sqrt(u4)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // `u2` should be picked such that `u4 * u2 = u6`.\n //\n // If a = 0, we can do:\n //\n // u6 = b' / b\n // u2 = u6^(1 / 3)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // Where `u2` is any root that is square.\n //\n // If b = 0, we can do:\n //\n // u4 = a' / a\n // u2 = +-sqrt(u4)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // Where `u2` is any root that is square.\n assert(this.a.isZero() === a.isZero());\n assert(this.b.isZero() === b.isZero());\n\n if (this.a.isZero()) {\n const u6 = this.b.redDiv(this.field(b));\n // Todo: figure out how to check index.\n const u2 = uncube(u6);\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(u3.redSqr().eq(u6));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n if (this.b.isZero()) {\n const u4 = this.a.redDiv(this.field(a));\n const u2 = u4.redSqrt();\n\n // Todo: figure out how to check oddness.\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(u3.redMul(u).eq(u4));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n const u4 = this.a.redDiv(this.field(a));\n const u6 = this.b.redDiv(this.field(b));\n const u2 = u4.redSqrt();\n\n if (!u4.redMul(u2).eq(u6))\n u2.redINeg();\n\n assert(u4.redMul(u2).eq(u6));\n\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n _scale1(x, y) {\n // If base points are available, it is much\n // easier, with:\n //\n // u2 = x' / x\n // u3 = y' / y\n // u = +-sqrt(u2)\n //\n // `u` should be picked such that `u2 * u = u3`.\n const u2 = this.g.x.redDiv(this.field(x));\n const u3 = this.g.y.redDiv(this.field(y));\n const u = u2.redSqrt();\n\n if (!u2.redMul(u).eq(u3))\n u.redINeg();\n\n assert(u2.redMul(u).eq(u3));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this._scale0(curve.a, curve.b);\n\n return this._scale1(curve.g.x, curve.g.y);\n }\n\n _scaleMont(curve) {\n assert(curve instanceof MontCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a, b] = curve._short();\n return this._scale0(a, b);\n }\n\n const {x, y} = curve.g;\n const nx = x.redAdd(curve.a3).redMul(curve.bi);\n const ny = y.redMul(curve.bi);\n\n return this._scale1(nx, ny);\n }\n\n _scaleEdwards(curve) {\n assert(curve instanceof EdwardsCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a, b] = curve._short();\n return this._scale0(a, b);\n }\n\n const {x, y, z} = curve.g;\n const a5 = curve.a.redMuln(5);\n const d5 = curve.d.redMuln(5);\n const dma = curve.d.redSub(curve.a);\n const d5a = d5.redSub(curve.a);\n const da5 = curve.d.redSub(a5);\n const ypz = y.redAdd(z);\n const ymz = y.redSub(z);\n const xx = d5a.redMul(y).redIAdd(da5.redMul(z));\n const xz = ymz.redMuln(12);\n const yy = dma.redMul(ypz).redMul(z);\n const yz = ymz.redMul(x).redIMuln(4);\n const zi = xz.redMul(yz).redInvert();\n const nx = xx.redMul(yz).redMul(zi);\n const ny = yy.redMul(xz).redMul(zi);\n\n return this._scale1(nx, ny);\n }\n\n _getEndomorphism(index = 0) {\n // Compute endomorphism.\n //\n // [GECC] Example 3.76, Page 128, Section 3.5.\n\n // No curve params.\n if (this.n.isZero() || this.g.isInfinity())\n return null;\n\n // No efficient endomorphism.\n if (!this.zeroA || this.p.modrn(3) !== 1 || this.n.modrn(3) !== 1)\n return null;\n\n // Solve beta^3 mod p = 1.\n const [b1, b2] = this._getEndoRoots(this.p);\n\n // Choose the smallest beta by default.\n const beta = [b1, b2][index & 1].toRed(this.red);\n\n // Solve lambda^3 mod n = 1.\n const [l1, l2] = this._getEndoRoots(this.n);\n\n // Choose the lambda matching selected beta.\n // Note that P * lambda = (x * beta, y).\n const p = this.point(this.g.x.redMul(beta), this.g.y);\n\n let lambda;\n\n if (this.g.mul(l1).eq(p)) {\n lambda = l1;\n } else {\n assert(this.g.mul(l2).eq(p));\n lambda = l2;\n }\n\n // Get basis vectors.\n const basis = this._getEndoBasis(lambda);\n\n // Precompute `g1` and `g2`.\n const pre = this._getEndoPrecomp(basis);\n\n return new Endo(beta, lambda, basis, pre);\n }\n\n _getEndoRoots(num) {\n // Find roots for x^2 + x + 1 in F.\n //\n // [GECC] Example 3.76, Page 128, Section 3.5.\n // [GLV] Page 192, Section 2 (Endomorphisms).\n //\n // The above document doesn't fully explain how\n // to derive these and only \"hints\" at it, as\n // mentioned by Hal Finney[1], but we're basically\n // computing two possible cube roots of 1 here.\n //\n // Note that we could also compute[2]:\n //\n // beta = 2^((p - 1) / 3) mod p\n // lambda = 3^((n - 1) / 3) mod n\n //\n // As an extension of Fermat's little theorem:\n //\n // g^(p - 1) mod p == 1\n //\n // It is suspected[3] this is how Hal Finney[4]\n // computed his original endomorphism roots.\n //\n // @indutny's method for computing cube roots\n // of unity[5] appears to be the method described\n // on wikipedia[6][7].\n //\n // Sage produces the same solution:\n //\n // sage: solve(x^2 + x + 1 == 0, x)\n // [x == -1/2*I*sqrt(3) - 1/2, x == 1/2*I*sqrt(3) - 1/2]\n //\n // This can be reduced to:\n //\n // x = (+-sqrt(-3) - 1) / 2\n //\n // [1] https://bitcointalk.org/index.php?topic=3238.msg45565#msg45565\n // [2] https://crypto.stackexchange.com/a/22739\n // [3] https://bitcoin.stackexchange.com/a/35872\n // [4] https://github.com/halfinney/bitcoin/commit/dc411b5\n // [5] https://en.wikipedia.org/wiki/Cube_root_of_unity\n // [6] https://en.wikipedia.org/wiki/Splitting_field#Cubic_example\n // [7] http://mathworld.wolfram.com/SplittingField.html\n const red = num === this.p ? this.red : BN.mont(num);\n const two = new BN(2).toRed(red);\n const three = new BN(3).toRed(red);\n const i2 = two.redInvert();\n\n // S1 = sqrt(-3) / 2\n const s1 = three.redNeg().redSqrt().redMul(i2);\n\n // S2 = -S1\n const s2 = s1.redNeg();\n\n // R1 = S1 - 1 / 2\n const r1 = s1.redSub(i2).fromRed();\n\n // R2 = S2 - 1 / 2\n const r2 = s2.redSub(i2).fromRed();\n\n return [r1, r2].sort(BN.cmp);\n }\n\n _getEndoBasis(lambda) {\n // Compute endomorphic basis.\n //\n // This essentially computes Cornacchia's algorithm\n // for solving x^2 + d * y^2 = m (d = lambda, m = order).\n //\n // https://en.wikipedia.org/wiki/Cornacchia%27s_algorithm\n //\n // [GECC] Algorithm 3.74, Page 127, Section 3.5.\n // [GLV] Page 196, Section 4 (Decomposing K).\n //\n // Balanced length-two representation of a multiplier.\n //\n // 1. Run the extended euclidean algorithm with inputs n\n // and lambda. The algorithm produces a sequence of\n // equations si*n + ti*lam = ri where s0=1, t0=0,\n // r0=n, s1=0, t1=1, r1=lam, and the remainders ri\n // and are non-negative and strictly decreasing. Let\n // l be the greatest index for which rl >= sqrt(n).\n const [rl, tl, rl1, tl1, rl2, tl2] = this._egcdSqrt(lambda);\n\n // 2. Set (a1, b1) <- (rl+1, -tl+1).\n const a1 = rl1;\n const b1 = tl1.neg();\n\n // 3. If (rl^2 + tl^2) <= (rl+2^2 + tl+2^2)\n // then set (a2, b2) <- (rl, -tl).\n // else set (a2, b2) <- (rl+2, -tl+2).\n const lhs = rl.sqr().iadd(tl.sqr());\n const rhs = rl2.sqr().iadd(tl2.sqr());\n\n let a2, b2;\n\n if (lhs.cmp(rhs) <= 0) {\n a2 = rl;\n b2 = tl.neg();\n } else {\n a2 = rl2;\n b2 = tl2.neg();\n }\n\n return [\n new Vector(a1, b1),\n new Vector(a2, b2)\n ];\n }\n\n _egcdSqrt(lambda) {\n // Extended Euclidean algorithm for integers.\n //\n // [GECC] Algorithm 2.19, Page 40, Section 2.2.\n // [GLV] Page 196, Section 4 (Decomposing K).\n assert(lambda instanceof BN);\n assert(!lambda.red);\n assert(lambda.sign() > 0);\n assert(this.n.sign() > 0);\n\n // Note that we insert the approximate square\n // root checks as described in algorithm 3.74.\n //\n // Algorithm 2.19 is defined as:\n //\n // 1. u <- a\n // v <- b\n //\n // 2. x1 <- 1\n // y1 <- 0\n // x2 <- 0\n // y2 <- 1\n //\n // 3. while u != 0 do\n //\n // 3.1. q <- floor(v / u)\n // r <- v - q * u\n // x <- x2 - q * x1\n // y <- y2 - q * y1\n //\n // 3.2. v <- u\n // u <- r\n // x2 <- x1\n // x1 <- x\n // y2 <- y1\n // y1 <- y\n //\n // 4. d <- v\n // x <- x2\n // y <- y2\n //\n // 5. Return (d, x, y).\n\n // Start with an approximate square root of n.\n const sqrtn = this.n.ushrn(this.n.bitLength() >>> 1);\n\n let u = lambda; // r1\n let v = this.n.clone(); // r0\n let x1 = new BN(1); // t1\n let y1 = new BN(0); // t0\n let x2 = new BN(0); // s1\n let y2 = new BN(1); // s0\n\n // All vectors are roots of: a + b * lambda = 0 (mod n).\n let rl, tl;\n\n // First vector.\n let rl1, tl1;\n\n // Inner.\n let i = 0;\n let j = 0;\n let p;\n\n // Compute EGCD.\n while (!u.isZero() && i < 2) {\n const q = v.quo(u);\n const r = v.sub(q.mul(u));\n const x = x2.sub(q.mul(x1));\n const y = y2.sub(q.mul(y1));\n\n // Check for r < sqrt(n).\n if (j === 0 && r.cmp(sqrtn) < 0) {\n rl = p;\n tl = x1;\n rl1 = r;\n tl1 = x;\n j = 1; // 1 more round.\n }\n\n p = r;\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n\n i += j;\n }\n\n // Should never happen.\n assert(j !== 0, 'Could not find r < sqrt(n).');\n\n // Second vector.\n const rl2 = x2;\n const tl2 = x1;\n\n return [\n rl,\n tl,\n rl1,\n tl1,\n rl2,\n tl2\n ];\n }\n\n _getEndoPrecomp(basis) {\n // Precompute `g1` and `g2` to avoid round division.\n //\n // [JCEN12] Page 5, Section 4.3.\n //\n // Computation:\n //\n // d = a1 * b2 - b1 * a2\n // t = ceil(log2(d+1)) + p\n // g1 = round((2^t * b2) / d)\n // g2 = round((2^t * b1) / d)\n //\n // Where:\n //\n // `p` is the number of precision bits.\n // `d` is equal to `n` (the curve order).\n //\n // The paper above uses 2 as the value of `p`,\n // whereas libsecp256k1 uses 128 (total=384).\n //\n // We pick precision for `g1` and `g2` such that:\n //\n // abs(g1) < n\n // abs(g2) < n\n //\n // This ensures maximum precision for the constants\n // while also ensuring they fit into a fixed number\n // of scalar limbs in more optimized implementations.\n //\n // Furthermore, we attempt to align to a limb width\n // of 64 bits. This allows us to optimize the shift,\n // a la libsecp256k1[1].\n //\n // [1] https://github.com/bitcoin-core/secp256k1/pull/822\n assert(Array.isArray(basis));\n assert(basis.length === 2);\n assert(basis[0] instanceof Vector);\n assert(basis[1] instanceof Vector);\n\n const [v1, v2] = basis;\n const d = v1.a.mul(v2.b).isub(v1.b.mul(v2.a));\n const bits = d.bitLength();\n const align = bits >= 160;\n\n assert(d.eq(this.n));\n\n // Start with a rough estimate.\n let shift = bits + Math.ceil(bits / 2) + 1;\n let g1, g2;\n\n if (align)\n shift -= shift & 63;\n\n while (shift > bits) {\n g1 = v2.b.ushln(shift).divRound(d);\n g2 = v1.b.ushln(shift).divRound(d);\n\n if (g1.ucmp(d) < 0 && g2.ucmp(d) < 0)\n break;\n\n if (align)\n shift -= 64;\n else\n shift -= 1;\n }\n\n if (shift <= bits)\n throw new Error('Could not calculate g1 and g2.');\n\n return [shift, g1, g2];\n }\n\n _endoSplit(k) {\n // Balanced length-two representation of a multiplier.\n //\n // [GECC] Algorithm 3.74, Page 127, Section 3.5.\n //\n // Also note that it is possible to precompute[1]\n // values in order to avoid the division[2][3][4].\n //\n // This involves precomputing `g1` and `g2 (see\n // above). `c1` and `c2` can then be computed as\n // follows:\n //\n // t = ceil(log2(n+1)) + p\n // c1 = (k * g1) >> t\n // c2 = -((k * g2) >> t)\n //\n // Where `>>` is an _unsigned_ right shift. Also\n // note that the last bit discarded in the shift\n // must be stored. If it is 1, then add 1 to the\n // scalar (absolute addition).\n //\n // It's worth noting that libsecp256k1 uses a\n // different calculation along the lines of:\n //\n // t = ceil(log2(n+1)) + p\n // c1 = ((k * g1) >> t) * -b1\n // c2 = ((k * -g2) >> t) * -b2\n // k2 = c1 + c2\n // k1 = k2 * -lambda + k\n //\n // So, in the future, we can consider changing\n // step 4 to:\n //\n // 4. Compute c1 = (k * g1) >> t\n // and c2 = -((k * g2) >> t).\n //\n // const [shift, g1, g2] = this.endo.pre;\n // const c1 = k.mulShift(g1, shift);\n // const c2 = k.mulShift(g2, shift).ineg();\n //\n // Once we're brave enough, that is.\n //\n // [1] [JCEN12] Page 5, Section 4.3.\n // [2] https://github.com/bitcoin-core/secp256k1/blob/0b70241/src/scalar_impl.h#L259\n // [3] https://github.com/bitcoin-core/secp256k1/pull/21\n // [4] https://github.com/bitcoin-core/secp256k1/pull/127\n assert(k instanceof BN);\n assert(!k.red);\n assert(!this.n.isZero());\n\n const [v1, v2] = this.endo.basis;\n\n // 4. Compute c1 = round(b2 * k / n)\n // and c2 = round(-b1 * k / n).\n const c1 = v2.b.mul(k).divRound(this.n);\n const c2 = v1.b.neg().mul(k).divRound(this.n);\n\n // 5. Compute k1 = k - c1 * a1 - c2 * a2\n // and k2 = -c1 * b1 - c2 * b2.\n const p1 = c1.mul(v1.a);\n const p2 = c2.mul(v2.a);\n const q1 = c1.ineg().mul(v1.b);\n const q2 = c2.mul(v2.b);\n\n // Calculate answer.\n const k1 = k.sub(p1).isub(p2);\n const k2 = q1.isub(q2);\n\n // 6. Return (k1, k2).\n return [k1, k2];\n }\n\n _endoBeta(point) {\n assert(point instanceof ShortPoint);\n return [point, point._getBeta()];\n }\n\n _endoWnafMulAdd(points, coeffs) {\n // Point multiplication with efficiently computable endomorphisms.\n //\n // [GECC] Algorithm 3.77, Page 129, Section 3.5.\n // [GLV] Page 193, Section 3 (Using Efficient Endomorphisms).\n //\n // Note it may be possible to do this 4-dimensionally [4GLV].\n assert(Array.isArray(points));\n assert(Array.isArray(coeffs));\n assert(points.length === coeffs.length);\n assert(this.endo != null);\n\n const len = points.length;\n const npoints = new Array(len * 2);\n const ncoeffs = new Array(len * 2);\n\n for (let i = 0; i < len; i++) {\n const [p1, p2] = this._endoBeta(points[i]);\n const [k1, k2] = this._endoSplit(coeffs[i]);\n\n npoints[i * 2 + 0] = p1;\n ncoeffs[i * 2 + 0] = k1;\n npoints[i * 2 + 1] = p2;\n ncoeffs[i * 2 + 1] = k2;\n }\n\n return this._wnafMulAdd(5, npoints, ncoeffs);\n }\n\n _sswu(u) {\n // Simplified Shallue-Woestijne-Ulas Method.\n //\n // Distribution: 3/8.\n //\n // [SSWU1] Page 15-16, Section 7. Appendix G.\n // [SSWU2] Page 5, Theorem 2.3.\n // [H2EC] \"Simplified Shallue-van de Woestijne-Ulas Method\".\n //\n // Assumptions:\n //\n // - a != 0, b != 0.\n // - Let z be a non-square in F(p).\n // - z != -1.\n // - The polynomial g(x) - z is irreducible over F(p).\n // - g(b / (z * a)) is square in F(p).\n // - u != 0, u != +-sqrt(-1 / z).\n //\n // Map:\n //\n // g(x) = x^3 + a * x + b\n // t1 = 1 / (z^2 * u^4 + z * u^2)\n // x1 = (-b / a) * (1 + t1)\n // x1 = b / (z * a), if t1 = 0\n // x2 = z * u^2 * x1\n // x = x1, if g(x1) is square\n // = x2, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const {b, z, ai, zi, one} = this;\n const z2 = z.redSqr();\n const ba = b.redNeg().redMul(ai);\n const bza = b.redMul(zi).redMul(ai);\n const u2 = u.redSqr();\n const u4 = u2.redSqr();\n const t0 = z2.redMul(u4).redIAdd(z.redMul(u2));\n const t1 = t0.isZero() ? t0 : t0.redInvert();\n const x1 = t1.isZero() ? bza : ba.redMul(one.redAdd(t1));\n const x2 = z.redMul(u2).redMul(x1);\n const y1 = this.solveY2(x1);\n const y2 = this.solveY2(x2);\n const alpha = y1.redIsSquare() | 0;\n const x = [x1, x2][alpha ^ 1];\n const y = [y1, y2][alpha ^ 1].redSqrt();\n\n if (y.redIsOdd() !== u.redIsOdd())\n y.redINeg();\n\n return this.point(x, y);\n }\n\n _sswui(p, hint) {\n // Inverting the Map (Simplified Shallue-Woestijne-Ulas).\n //\n // Assumptions:\n //\n // - a^2 * x^2 - 2 * a * b * x - 3 * b^2 is square in F(p).\n // - If r < 3 then x != -b / a.\n //\n // Unlike SVDW, the preimages here are evenly\n // distributed (more or less). SSWU covers ~3/8\n // of the curve points. Each preimage has a 1/2\n // chance of mapping to either x1 or x2.\n //\n // Assuming the point is within that set, each\n // point has a 1/4 chance of inverting to any\n // of the preimages. This means we can simply\n // randomly select a preimage if one exists.\n //\n // However, the [SVDW2] sampling method seems\n // slighly faster in practice for [SQUARED].\n //\n // Map:\n //\n // c = sqrt(a^2 * x^2 - 2 * a * b * x - 3 * b^2)\n // u1 = -(a * x + b - c) / (2 * (a * x + b) * z)\n // u2 = -(a * x + b + c) / (2 * (a * x + b) * z)\n // u3 = -(a * x + b - c) / (2 * b * z)\n // u4 = -(a * x + b + c) / (2 * b * z)\n // r = random integer in [1,4]\n // u = sign(y) * abs(sqrt(ur))\n const {a, b, z} = this;\n const {x, y} = p;\n const r = hint & 3;\n const a2x2 = a.redSqr().redMul(x.redSqr());\n const abx2 = a.redMul(b).redMul(x).redIMuln(2);\n const b23 = b.redSqr().redMuln(3);\n const axb = a.redMul(x).redIAdd(b);\n const c = a2x2.redISub(abx2).redISub(b23).redSqrt();\n const n0 = axb.redSub(c).redINeg();\n const n1 = axb.redAdd(c).redINeg();\n const d0 = axb.redMul(z).redIMuln(2);\n const d1 = b.redMul(z).redIMuln(2);\n const n = [n0, n1][r & 1]; // r = 1 or 3\n const d = [d0, d1][r >>> 1]; // r = 2 or 3\n const u = n.redDivSqrt(d);\n\n if (u.redIsOdd() !== y.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n _svdwf(u) {\n // Shallue-van de Woestijne Method.\n //\n // Distribution: 9/16.\n //\n // [SVDW1] Section 5.\n // [SVDW2] Page 8, Section 3.\n // Page 15, Section 6, Algorithm 1.\n // [H2EC] \"Shallue-van de Woestijne Method\".\n //\n // Assumptions:\n //\n // - p = 1 (mod 3).\n // - a = 0, b != 0.\n // - Let z be a unique element in F(p).\n // - g((sqrt(-3 * z^2) - z) / 2) is square in F(p).\n // - u != 0, u != +-sqrt(-g(z)).\n //\n // Map:\n //\n // g(x) = x^3 + b\n // c = sqrt(-3 * z^2)\n // t1 = u^2 + g(z)\n // t2 = 1 / (u^2 * t1)\n // t3 = u^4 * t2 * c\n // x1 = (c - z) / 2 - t3\n // x2 = t3 - (c + z) / 2\n // x3 = z - t1^3 * t2 / (3 * z^2)\n // x = x1, if g(x1) is square\n // = x2, if g(x2) is square\n // = x3, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const {c, z, zi, i2, i3} = this;\n const gz = this.solveY2(z);\n const z3 = i3.redMul(zi.redSqr());\n const u2 = u.redSqr();\n const u4 = u2.redSqr();\n const t1 = u2.redAdd(gz);\n const u2t1 = u2.redMul(t1);\n const t2 = u2t1.isZero() ? u2t1 : u2t1.redInvert();\n const t3 = u4.redMul(t2).redMul(c);\n const t4 = t1.redSqr().redMul(t1);\n const x1 = c.redSub(z).redMul(i2).redISub(t3);\n const x2 = t3.redSub(c.redAdd(z).redMul(i2));\n const x3 = z.redSub(t4.redMul(t2).redMul(z3));\n const y1 = this.solveY2(x1);\n const y2 = this.solveY2(x2);\n const y3 = this.solveY2(x3);\n const alpha = y1.redJacobi() | 1;\n const beta = y2.redJacobi() | 1;\n const i = mod((alpha - 1) * beta, 3);\n const x = [x1, x2, x3][i];\n const y = [y1, y2, y3][i];\n\n return [x, y];\n }\n\n _svdw(u) {\n const [x, yy] = this._svdwf(u);\n const y = yy.redSqrt();\n\n if (y.redIsOdd() !== u.redIsOdd())\n y.redINeg();\n\n return this.point(x, y);\n }\n\n _svdwi(p, hint) {\n // Inverting the Map (Shallue-van de Woestijne).\n //\n // [SQUARED] Algorithm 1, Page 8, Section 3.3.\n // [SVDW2] Page 12, Section 5.\n // [SVDW3] \"Inverting the map\".\n //\n // Assumptions:\n //\n // - If r = 1 then x != -(c + z) / 2.\n // - If r = 2 then x != (c - z) / 2.\n // - If r > 2 then (t0 - t1 + t2) is square in F(p).\n // - f(f^-1(x)) = x where f is the map function.\n //\n // We use the sampling method from [SVDW2],\n // _not_ [SQUARED]. This seems to have a\n // better distribution in practice.\n //\n // Note that [SVDW3] also appears to be\n // incorrect in terms of distribution.\n //\n // The distribution of f(u), assuming u is\n // random, is (1/2, 1/4, 1/4).\n //\n // To mirror this, f^-1(x) should simply\n // pick (1/2, 1/4, 1/8, 1/8).\n //\n // To anyone running the forward map, our\n // strings will appear to be random.\n //\n // Map:\n //\n // g(x) = x^3 + b\n // c = sqrt(-3 * z^2)\n // t0 = 9 * (x^2 * z^2 + z^4)\n // t1 = 18 * x * z^3\n // t2 = 12 * g(z) * (x - z)\n // t3 = sqrt(t0 - t1 + t2)\n // t4 = t3 * z\n // u1 = g(z) * (c - 2 * x - z) / (c + 2 * x + z)\n // u2 = g(z) * (c + 2 * x + z) / (c - 2 * x - z)\n // u3 = (3 * (z^3 - x * z^2) - 2 * g(z) + t4) / 2\n // u4 = (3 * (z^3 - x * z^2) - 2 * g(z) - t4) / 2\n // r = random integer in [1,4]\n // u = sign(y) * abs(sqrt(ur))\n const {b, c, z, zero, two} = this;\n const {x, y} = p;\n const r = hint & 3;\n const z2 = z.redSqr();\n const z3 = z2.redMul(z);\n const z4 = z2.redSqr();\n const gz = z3.redAdd(b);\n const gz2 = gz.redMuln(2);\n const xx = x.redSqr();\n const x2z = x.redMuln(2).redIAdd(z);\n const xz2 = x.redMul(z2);\n const c0 = c.redSub(x2z);\n const c1 = c.redAdd(x2z);\n const t0 = xx.redMul(z2).redIAdd(z4).redIMuln(9);\n const t1 = x.redMul(z3).redIMuln(18);\n const t2 = gz.redMul(x.redSub(z)).redIMuln(12);\n const t3 = r >= 2 ? t0.redISub(t1).redIAdd(t2).redSqrt() : zero;\n const t4 = t3.redMul(z);\n const t5 = z3.redISub(xz2).redIMuln(3).redISub(gz2);\n const n0 = gz.redMul(c0);\n const n1 = gz.redMul(c1);\n const n2 = t5.redAdd(t4);\n const n3 = t5.redSub(t4);\n const d2 = two;\n const n = [n0, n1, n2, n3][r];\n const d = [c1, c0, d2, d2][r];\n const u = n.redDivSqrt(d);\n const [x0] = this._svdwf(u);\n\n if (!x0.eq(x))\n throw new Error('Invalid point.');\n\n if (u.redIsOdd() !== y.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n isElliptic() {\n const {a, b} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const d = b2.redMuln(27).redIAdd(a3.redMuln(4));\n\n // 4 * a^3 + 27 * b^2 != 0\n return !d.isZero();\n }\n\n jinv() {\n // [ARITH1] Page 71, Section 4.4.\n // http://mathworld.wolfram.com/j-Invariant.html\n const {a, b} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const t0 = a3.redMuln(4);\n const lhs = t0.redMuln(1728);\n const rhs = b2.redMuln(27).redIAdd(t0);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // (1728 * 4 * a^3) / (4 * a^3 + 27 * b^2)\n return lhs.redDiv(rhs).fromRed();\n }\n\n point(x, y) {\n return new ShortPoint(this, x, y);\n }\n\n jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n }\n\n solveX(y) {\n assert(y instanceof BN);\n\n if (!this.a.isZero())\n throw new Error('Not implemented.');\n\n // x^3 = y^2 - b\n const y2 = y.redSqr();\n const x3 = y2.redSub(this.b);\n\n return cubeRoots(x3);\n }\n\n solveY2(x) {\n // [GECC] Page 89, Section 3.2.2.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw.html\n assert(x instanceof BN);\n\n // y^2 = x^3 + a * x + b\n const x3 = x.redSqr().redMul(x);\n const y2 = x3.redIAdd(this.b);\n\n if (!this.zeroA) {\n // Save some cycles for a = -3.\n if (this.threeA)\n y2.redIAdd(x.redMuln(-3));\n else\n y2.redIAdd(this.a.redMul(x));\n }\n\n return y2;\n }\n\n validate(point) {\n assert(point instanceof ShortPoint);\n\n if (point.inf)\n return true;\n\n const {x, y} = point;\n const y2 = this.solveY2(x);\n\n return y.redSqr().eq(y2);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (this.h.cmpn(1) > 0) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n }\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n pointFromY(y, index = 0) {\n assert(y instanceof BN);\n assert((index >>> 0) === index);\n\n if (!y.red)\n y = y.toRed(this.red);\n\n const coords = this.solveX(y);\n\n if (index >= coords.length)\n throw new Error('Invalid X coordinate index.');\n\n const x = coords[index];\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve) {\n // [GECC] Page 84, Section 3.1.5.\n // [ARITH1] Page 286, Section 13.2.3.c.\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n let u2, u3;\n try {\n [u2, u3] = this._scale(curve);\n } catch (e) {\n return false;\n }\n\n // E(a,b) <-> E(au^4,bu^6)\n if (curve.type === 'short') {\n // a' = a * u^4, b' = b * u^6\n const a = this.field(curve.a).redMul(u2.redSqr());\n const b = this.field(curve.b).redMul(u3.redSqr());\n\n return this.a.eq(a) && this.b.eq(b);\n }\n\n // E(a,b) <-> M(A,B)\n if (curve.type === 'mont') {\n // (A / (3 * B))^3 + a * (A / (3 * B)) + b = 0\n const {a3, bi} = curve;\n const x = this.field(a3.redMul(bi)).redMul(u2);\n const y2 = this.solveY2(x);\n\n return y2.isZero();\n }\n\n // E(a,b) <-> E(a,d)\n if (curve.type === 'edwards') {\n // ((a' + d') / 6)^3 + a * ((a' + d') / 6) + b = 0\n const x = this.field(curve.ad6).redMul(u2);\n const y2 = this.solveY2(x);\n\n return y2.isZero();\n }\n\n return false;\n }\n\n isIsogenous(curve) {\n assert(curve instanceof Curve);\n return false;\n }\n\n pointFromShort(point) {\n // [GECC] Page 84, Section 3.1.5.\n // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves).\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for E(a,b)<->E(au^4,bu^6):\n //\n // x' = x * u^2\n // y' = y * u^3\n //\n // Where a * u^4 = a' and b * u^6 = b'.\n if (point.isInfinity())\n return this.point();\n\n const [u2, u3] = this._scale(point.curve);\n const x = this.field(point.x);\n const y = this.field(point.y);\n const nx = x.redMul(u2);\n const ny = y.redMul(u3);\n\n return this.point(nx, ny);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [ALT] Appendix E.2 (Switching between Alternative Representations).\n // [MONT2] \"Equivalence with Weierstrass curves\"\n assert(point instanceof MontPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for M(A,B)->E(a,b):\n //\n // x = (u + A / 3) / B\n // y = v / B\n //\n // Undefined if ((u^3 + A * u^2 + u) / B) is not square.\n if (point.isInfinity())\n return this.point();\n\n const {a3, bi} = point.curve;\n const [u2, u3] = this._scale(point.curve);\n const nx = point.x.redAdd(a3).redMul(bi);\n const ny = point.y.redMul(bi);\n\n return this.point(this.field(nx).redMul(u2),\n this.field(ny).redMul(u3));\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [TWISTEQ] Section 2.\n assert(point instanceof EdwardsPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,d)->E(a',b'):\n //\n // x' = ((5 * d - a) * y + d - 5 * a) / (12 * (y - 1))\n // y' = (d - a) * (y + 1) / (4 * x * (y - 1))\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> ((a + d) / 6, 0)\n //\n // Unexceptional Cases:\n // - (sqrt(1 / a), 0) -> ((5 * a - d) / 12, (a - d) / 4 * sqrt(a))\n const {a, d, ad6} = point.curve;\n const [u2, u3] = this._scale(point.curve);\n\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero()) {\n const x = this.field(ad6).redMul(u2);\n return this.point(x, this.zero);\n }\n\n const {x, y, z} = point;\n const a5 = a.redMuln(5);\n const d5 = d.redMuln(5);\n const dma = d.redSub(a);\n const d5a = d5.redSub(a);\n const da5 = d.redSub(a5);\n const ypz = y.redAdd(z);\n const ymz = y.redSub(z);\n const xx = d5a.redMul(y).redIAdd(da5.redMul(z));\n const xz = ymz.redMuln(12);\n const yy = dma.redMul(ypz).redMul(z);\n const yz = ymz.redMul(x).redIMuln(4);\n\n return this.cpoint(this.field(xx).redMul(u2),\n this.field(xz),\n this.field(yy).redMul(u3),\n this.field(yz));\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n assert(u instanceof BN);\n\n // z = 0 or b = 0\n if (this.z.isZero() || this.b.isZero())\n throw new Error('Not implemented.');\n\n // a != 0, b != 0\n if (!this.a.isZero())\n return this._sswu(u);\n\n // p = 1 mod 3, a = 0, b != 0\n if (!this.c.isZero())\n return this._svdw(u);\n\n throw new Error('Not implemented.');\n }\n\n pointToUniform(p, hint) {\n // Convert a short weierstrass point to a field\n // element by inverting either the SSWU or SVDW\n // map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof ShortPoint);\n assert((hint >>> 0) === hint);\n\n // z = 0 or b = 0\n if (this.z.isZero() || this.b.isZero())\n throw new Error('Not implemented.');\n\n // P = O\n if (p.isInfinity())\n throw new Error('Invalid point.');\n\n // Add a random torsion component.\n const i = ((hint >>> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n return wrapErrors(() => {\n // a != 0, b != 0\n if (!this.a.isZero())\n return this._sswui(q, hint);\n\n // p = 1 mod 3, a = 0, b != 0\n if (!this.c.isZero())\n return this._svdwi(q, hint);\n\n throw new Error('Not implemented.');\n });\n }\n\n mulAll(points, coeffs) {\n return super.mulAll(points, coeffs).toP();\n }\n\n affinizeAll(points) {\n const out = this.normalizeAll(points);\n\n for (let i = 0; i < out.length; i++)\n out[i] = out[i].toP();\n\n return out;\n }\n\n decodePoint(bytes) {\n return ShortPoint.decode(this, bytes);\n }\n\n encodeX(point) {\n assert(point instanceof Point);\n return point.encodeX();\n }\n\n decodeEven(bytes) {\n return ShortPoint.decodeEven(this, bytes);\n }\n\n decodeSquare(bytes) {\n return ShortPoint.decodeSquare(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromShort(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, odd, sign = null) {\n const [a, b] = this._mont(b0, odd);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = this._scale(curve);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromShort(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, odd, sign = null) {\n const [a, d] = this._edwards(a0, odd);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = this._scale(curve);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromShort(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return ShortPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n\n json.a = this.a.fromRed().toJSON();\n json.b = this.b.fromRed().toJSON();\n\n if (!this.c.isZero())\n json.c = this.c.fromRed().toJSON();\n\n return json;\n }\n}\n\n/**\n * ShortPoint\n */\n\nclass ShortPoint extends Point {\n constructor(curve, x, y) {\n assert(curve instanceof ShortCurve);\n\n super(curve, types.AFFINE);\n\n this.x = this.curve.zero;\n this.y = this.curve.zero;\n this.inf = true;\n\n if (x != null)\n this._init(x, y);\n }\n\n _init(x, y) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n\n this.x = x;\n this.y = y;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n this.inf = false;\n }\n\n _getBeta() {\n if (!this.curve.endo)\n return null;\n\n if (this.pre && this.pre.beta)\n return this.pre.beta;\n\n // Augment the point with our beta value.\n // This is the counterpart to `k2` after\n // the endomorphism split of `k`.\n //\n // Note that if we have precomputation,\n // we have to clone and update all of the\n // precomputed points below.\n const xb = this.x.redMul(this.curve.endo.beta);\n const beta = this.curve.point(xb, this.y);\n\n if (this.pre) {\n beta.pre = this.pre.map((point) => {\n const xb = point.x.redMul(this.curve.endo.beta);\n return this.curve.point(xb, point.y);\n });\n\n this.pre.beta = beta;\n }\n\n return beta;\n }\n\n _getJNAF(point) {\n assert(point instanceof ShortPoint);\n\n if (this.inf || point.inf)\n return super._getJNAF(point);\n\n // Create comb for JSF.\n const comb = [\n this, // 1\n null, // 3\n null, // 5\n point // 7\n ];\n\n // Try to avoid Jacobian points, if possible.\n if (this.y.eq(point.y)) {\n comb[1] = this.add(point);\n comb[2] = this.toJ().sub(point);\n } else if (this.y.eq(point.y.redNeg())) {\n comb[1] = this.toJ().add(point);\n comb[2] = this.sub(point);\n } else {\n comb[1] = this.toJ().add(point);\n comb[2] = this.toJ().sub(point);\n }\n\n return comb;\n }\n\n clone() {\n if (this.inf)\n return this.curve.point();\n\n return this.curve.point(this.x, this.y);\n }\n\n scale(a) {\n return this.toJ().scale(a);\n }\n\n neg() {\n // P = O\n if (this.inf)\n return this;\n\n // -(X1, Y1) = (X1, -Y1)\n return this.curve.point(this.x, this.y.redNeg());\n }\n\n add(p) {\n // [GECC] Page 80, Section 3.1.2.\n //\n // Addition Law:\n //\n // l = (y1 - y2) / (x1 - x2)\n // x3 = l^2 - x1 - x2\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 1S + 6A\n assert(p instanceof ShortPoint);\n\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P, P + -P\n if (this.x.eq(p.x)) {\n // P + -P = O\n if (!this.y.eq(p.y))\n return this.curve.point();\n\n // P + P = 2P\n return this.dbl();\n }\n\n // X1 != X2, Y1 = Y2\n if (this.y.eq(p.y)) {\n // X3 = -X1 - X2\n const nx = this.x.redNeg().redISub(p.x);\n\n // Y3 = -Y1\n const ny = this.y.redNeg();\n\n // Skip the inverse.\n return this.curve.point(nx, ny);\n }\n\n // H = X1 - X2\n const h = this.x.redSub(p.x);\n\n // R = Y1 - Y2\n const r = this.y.redSub(p.y);\n\n // L = R / H\n const l = r.redDiv(h);\n\n // X3 = L^2 - X1 - X2\n const nx = l.redSqr().redISub(this.x).redISub(p.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dbl() {\n // [GECC] Page 80, Section 3.1.2.\n //\n // Addition Law (doubling):\n //\n // l = (3 * x1^2 + a) / (2 * y1)\n // x3 = l^2 - 2 * x1\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 2S + 3A + 2*2 + 1*3\n\n // P = O\n if (this.inf)\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.point();\n\n // XX = X1^2\n const xx = this.x.redSqr();\n\n // M = 3 * XX + a\n const m = xx.redIMuln(3).redIAdd(this.curve.a);\n\n // Z = 2 * Y1\n const z = this.y.redMuln(2);\n\n // L = M / Z\n const l = m.redDiv(z);\n\n // X3 = L^2 - 2 * X1\n const nx = l.redSqr().redISub(this.x).redISub(this.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dblp(pow) {\n return this.toJ().dblp(pow).toP();\n }\n\n getX() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof ShortPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.inf)\n return p.inf;\n\n // Q = O\n if (p.inf)\n return false;\n\n // X1 = X2, Y1 = Y2\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n cmp(point) {\n assert(point instanceof ShortPoint);\n\n if (this.inf && !point.inf)\n return -1;\n\n if (!this.inf && point.inf)\n return 1;\n\n if (this.inf && point.inf)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Infinity cannot be represented in\n // the affine space, except by a flag.\n return this.inf;\n }\n\n isOrder2() {\n if (this.inf)\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.inf)\n return false;\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.inf)\n return false;\n\n return this.y.redIsEven();\n }\n\n isSquare() {\n if (this.inf)\n return false;\n\n return this.y.redJacobi() !== -1;\n }\n\n eqX(x) {\n assert(x instanceof BN);\n assert(!x.red);\n\n if (this.inf)\n return false;\n\n return this.getX().eq(x);\n }\n\n eqR(x) {\n assert(x instanceof BN);\n assert(!x.red);\n assert(!this.curve.n.isZero());\n\n if (this.inf)\n return false;\n\n return this.getX().imod(this.curve.n).eq(x);\n }\n\n mul(k) {\n return super.mul(k).toP();\n }\n\n muln(k) {\n return super.muln(k).toP();\n }\n\n mulBlind(k, rng) {\n return super.mulBlind(k, rng).toP();\n }\n\n mulAdd(k1, p2, k2) {\n return super.mulAdd(k1, p2, k2).toP();\n }\n\n mulH() {\n return super.mulH().toP();\n }\n\n div(k) {\n return super.div(k).toP();\n }\n\n divn(k) {\n return super.divn(k).toP();\n }\n\n divH() {\n return super.divH().toP();\n }\n\n toP() {\n return this;\n }\n\n toJ() {\n // (X3, Y3, Z3) = (1, 1, 0)\n if (this.inf)\n return this.curve.jpoint();\n\n // (X3, Y3, Z3) = (X1, Y1, 1)\n return this.curve.jpoint(this.x, this.y, this.curve.one);\n }\n\n encode(compact) {\n // [SEC1] Page 10, Section 2.3.3.\n if (compact == null)\n compact = true;\n\n assert(typeof compact === 'boolean');\n\n const {fieldSize} = this.curve;\n\n // We do not serialize points at infinity.\n if (this.inf)\n throw new Error('Invalid point.');\n\n // Compressed form (0x02 = even, 0x03 = odd).\n if (compact) {\n const p = Buffer.alloc(1 + fieldSize);\n const x = this.curve.encodeField(this.getX());\n\n p[0] = 0x02 | this.y.redIsOdd();\n x.copy(p, 1);\n\n return p;\n }\n\n // Uncompressed form (0x04).\n const p = Buffer.alloc(1 + fieldSize * 2);\n const x = this.curve.encodeField(this.getX());\n const y = this.curve.encodeField(this.getY());\n\n p[0] = 0x04;\n x.copy(p, 1);\n y.copy(p, 1 + fieldSize);\n\n return p;\n }\n\n static decode(curve, bytes) {\n // [SEC1] Page 11, Section 2.3.4.\n assert(curve instanceof ShortCurve);\n assert(Buffer.isBuffer(bytes));\n\n const len = curve.fieldSize;\n\n if (bytes.length < 1 + len)\n throw new Error('Not a point.');\n\n // Point forms:\n //\n // 0x00 -> Infinity (openssl, unsupported)\n // 0x02 -> Compressed Even\n // 0x03 -> Compressed Odd\n // 0x04 -> Uncompressed\n // 0x06 -> Hybrid Even (openssl)\n // 0x07 -> Hybrid Odd (openssl)\n //\n // Note that openssl supports serializing points\n // at infinity as {0}. We choose not to support it\n // because it's strange and not terribly useful.\n const form = bytes[0];\n\n switch (form) {\n case 0x02:\n case 0x03: {\n if (bytes.length !== 1 + len)\n throw new Error('Invalid point size for compressed.');\n\n const x = curve.decodeField(bytes.slice(1, 1 + len));\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n const p = curve.pointFromX(x, form === 0x03);\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n case 0x04:\n case 0x06:\n case 0x07: {\n if (bytes.length !== 1 + len * 2)\n throw new Error('Invalid point size for uncompressed.');\n\n const x = curve.decodeField(bytes.slice(1, 1 + len));\n const y = curve.decodeField(bytes.slice(1 + len, 1 + 2 * len));\n\n // [GECC] Algorithm 4.3, Page 180, Section 4.\n if (x.cmp(curve.p) >= 0 || y.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n // OpenSSL hybrid encoding.\n if (form !== 0x04 && form !== (0x06 | y.isOdd()))\n throw new Error('Invalid hybrid encoding.');\n\n const p = curve.point(x, y);\n\n if (!p.validate())\n throw new Error('Invalid point.');\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n default: {\n throw new Error('Unknown point format.');\n }\n }\n }\n\n encodeX() {\n // [SCHNORR] \"Specification\".\n // [BIP340] \"Specification\".\n return this.curve.encodeField(this.getX());\n }\n\n static decodeEven(curve, bytes) {\n // [BIP340] \"Specification\".\n assert(curve instanceof ShortCurve);\n\n const x = curve.decodeField(bytes);\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromX(x, false);\n }\n\n static decodeSquare(curve, bytes) {\n // [SCHNORR] \"Specification\".\n assert(curve instanceof ShortCurve);\n\n const x = curve.decodeField(bytes);\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromX(x);\n }\n\n toJSON(pre) {\n if (this.inf)\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n if (pre === true && this.pre)\n return [x, y, this.pre.toJSON()];\n\n return [x, y];\n }\n\n toPretty() {\n if (this.inf)\n return [];\n\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof ShortCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n const point = curve.point(x, y);\n\n if (json.length > 2 && json[2] != null)\n point.pre = Precomp.fromJSON(point, json[2]);\n\n return point;\n }\n\n [custom]() {\n if (this.inf)\n return '';\n\n return '';\n }\n}\n\n/**\n * JPoint\n */\n\nclass JPoint extends Point {\n constructor(curve, x, y, z) {\n assert(curve instanceof ShortCurve);\n\n super(curve, types.JACOBIAN);\n\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = this.curve.zero;\n this.zOne = false;\n\n if (x != null)\n this._init(x, y, z);\n }\n\n _init(x, y, z) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n assert(z == null || (z instanceof BN));\n\n this.x = x;\n this.y = y;\n this.z = z || this.curve.one;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z.eq(this.curve.one);\n }\n\n clone() {\n return this.curve.jpoint(this.x, this.y, this.z);\n }\n\n validate() {\n // [GECC] Example 3.20, Page 88, Section 3.\n const {a, b} = this.curve;\n\n // P = O\n if (this.isInfinity())\n return true;\n\n // Z1 = 1\n if (this.zOne)\n return this.curve.validate(this.toP());\n\n // y^2 = x^3 + a * x * z^4 + b * z^6\n const lhs = this.y.redSqr();\n const x3 = this.x.redSqr().redMul(this.x);\n const z2 = this.z.redSqr();\n const z4 = z2.redSqr();\n const z6 = z4.redMul(z2);\n const rhs = x3.redIAdd(b.redMul(z6));\n\n if (!this.curve.zeroA) {\n // Save some cycles for a = -3.\n if (this.curve.threeA)\n rhs.redIAdd(z4.redIMuln(-3).redMul(this.x));\n else\n rhs.redIAdd(a.redMul(z4).redMul(this.x));\n }\n\n return lhs.eq(rhs);\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#scaling-z\n // 1I + 3M + 1S\n\n // Z = 1\n if (this.zOne)\n return this;\n\n // P = O\n if (this.isInfinity())\n return this;\n\n // A = 1 / Z1\n const a = this.z.redInvert();\n\n // AA = A^2\n const aa = a.redSqr();\n\n // X3 = X1 * AA\n this.x = this.x.redMul(aa);\n\n // Y3 = Y1 * AA * A\n this.y = this.y.redMul(aa).redMul(a);\n\n // Z3 = 1\n this.z = this.curve.one;\n this.zOne = true;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // P = O\n if (this.isInfinity())\n return this.curve.jpoint();\n\n // AA = A^2\n const aa = a.redSqr();\n\n // X3 = X1 * AA\n const nx = this.x.redMul(aa);\n\n // Y3 = Y1 * AA * A\n const ny = this.y.redMul(aa).redMul(a);\n\n // Z3 = Z1 * A\n const nz = this.z.redMul(a);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n neg() {\n // -(X1, Y1, Z1) = (X1, -Y1, Z1)\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }\n\n add(p) {\n assert(p instanceof Point);\n\n if (p.type === types.AFFINE)\n return this._mixedAdd(p);\n\n return this._add(p);\n }\n\n _add(p) {\n assert(p instanceof JPoint);\n\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.zOne)\n return p._addJA(this);\n\n // Z2 = 1\n if (p.zOne)\n return this._addJA(p);\n\n return this._addJJ(p);\n }\n\n _mixedAdd(p) {\n assert(p instanceof ShortPoint);\n\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n return this._addJA(p);\n }\n\n _addJJ(p) {\n // No assumptions.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-1998-cmo-2\n // 12M + 4S + 6A + 1*2 (implemented as: 12M + 4S + 7A)\n\n // Z1Z1 = Z1^2\n const z1z1 = this.z.redSqr();\n\n // Z2Z2 = Z2^2\n const z2z2 = p.z.redSqr();\n\n // U1 = X1 * Z2Z2\n const u1 = this.x.redMul(z2z2);\n\n // U2 = X2 * Z1Z1\n const u2 = p.x.redMul(z1z1);\n\n // S1 = Y1 * Z2 * Z2Z2\n const s1 = this.y.redMul(p.z).redMul(z2z2);\n\n // S2 = Y2 * Z1 * Z1Z1\n const s2 = p.y.redMul(this.z).redMul(z1z1);\n\n // H = U2 - U1\n const h = u2.redISub(u1);\n\n // r = S2 - S1\n const r = s2.redISub(s1);\n\n // H = 0\n if (h.isZero()) {\n if (!r.isZero())\n return this.curve.jpoint();\n\n return this.dbl();\n }\n\n // HH = H^2\n const hh = h.redSqr();\n\n // HHH = H * HH\n const hhh = h.redMul(hh);\n\n // V = U1 * HH\n const v = u1.redMul(hh);\n\n // X3 = r^2 - HHH - 2 * V\n const nx = r.redSqr().redISub(hhh).redISub(v).redISub(v);\n\n // Y3 = r * (V - X3) - S1 * HHH\n const ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh));\n\n // Z3 = Z1 * Z2 * H\n const nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _addJA(p) {\n // Assumes Z2 = 1.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-madd\n // 8M + 3S + 6A + 5*2 (implemented as: 8M + 3S + 7A + 4*2)\n\n // Z1Z1 = Z1^2\n const z1z1 = this.z.redSqr();\n\n // U2 = X2 * Z1Z1\n const u2 = p.x.redMul(z1z1);\n\n // S2 = Y2 * Z1 * Z1Z1\n const s2 = p.y.redMul(this.z).redMul(z1z1);\n\n // H = U2 - X1\n const h = u2.redISub(this.x);\n\n // r = 2 * (S2 - Y1)\n const r = s2.redISub(this.y).redIMuln(2);\n\n // H = 0\n if (h.isZero()) {\n if (!r.isZero())\n return this.curve.jpoint();\n\n return this.dbl();\n }\n\n // I = (2 * H)^2\n const i = h.redMuln(2).redSqr();\n\n // J = H * I\n const j = h.redMul(i);\n\n // V = X1 * I\n const v = this.x.redMul(i);\n\n // X3 = r^2 - J - 2 * V\n const nx = r.redSqr().redISub(j).redISub(v).redISub(v);\n\n // Y3 = r * (V - X3) - 2 * Y1 * J\n const ny = r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2));\n\n // Z3 = 2 * Z1 * H\n const nz = this.z.redMul(h).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n dbl() {\n // P = O\n if (this.isInfinity())\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.jpoint();\n\n // a = 0\n if (this.curve.zeroA)\n return this._dbl0();\n\n // a = -3\n if (this.curve.threeA)\n return this._dbl3();\n\n return this._dblJ();\n }\n\n _dblJ() {\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-1998-cmo-2\n // 3M + 6S + 4A + 1*a + 2*2 + 1*3 + 1*4 + 1*8\n // (implemented as: 3M + 6S + 5A + 1*a + 1*2 + 1*3 + 1*4 + 1*8)\n\n // XX = X1^2\n const xx = this.x.redSqr();\n\n // YY = Y1^2\n const yy = this.y.redSqr();\n\n // ZZ = Z1^2\n const zz = this.z.redSqr();\n\n // S = 4 * X1 * YY\n const s = this.x.redMul(yy).redIMuln(4);\n\n // M = 3 * XX + a * ZZ^2\n const m = xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr()));\n\n // T = M^2 - 2 * S\n const t = m.redSqr().redISub(s).redISub(s);\n\n // X3 = T\n const nx = t;\n\n // Y3 = M * (S - T) - 8 * YY^2\n const ny = m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8));\n\n // Z3 = 2 * Y1 * Z1\n const nz = this.y.redMul(this.z).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _dbl0() {\n // Assumes a = 0.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l\n // 2M + 5S + 6A + 3*2 + 1*3 + 1*8\n // (implemented as: 2M + 5S + 7A + 2*2 + 1*3 + 1*8)\n\n // A = X1^2\n const a = this.x.redSqr();\n\n // B = Y1^2\n const b = this.y.redSqr();\n\n // C = B^2\n const c = b.redSqr();\n\n // + XB2 = (X1 + B)^2\n const xb2 = b.redIAdd(this.x).redSqr();\n\n // D = 2 * ((X1 + B)^2 - A - C)\n const d = xb2.redISub(a).redISub(c).redIMuln(2);\n\n // E = 3 * A\n const e = a.redIMuln(3);\n\n // F = E^2\n const f = e.redSqr();\n\n // X3 = F - 2 * D\n const nx = f.redISub(d).redISub(d);\n\n // Y3 = E * (D - X3) - 8 * C\n const ny = e.redMul(d.redISub(nx)).redISub(c.redIMuln(8));\n\n // Z3 = 2 * Y1 * Z1\n const nz = this.y.redMul(this.z).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _dbl3() {\n // Assumes a = -3.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S + 8A + 1*3 + 1*4 + 2*8\n // (implemented as: 3M + 5S + 8A + 1*2 + 1*3 + 1*4 + 1*8)\n\n // delta = Z1^2\n const delta = this.z.redSqr();\n\n // gamma = Y1^2\n const gamma = this.y.redSqr();\n\n // beta = X1 * gamma\n const beta = this.x.redMul(gamma);\n\n // + xmdelta = X1 - delta\n const xmdelta = this.x.redSub(delta);\n\n // + xpdelta = X1 + delta\n const xpdelta = this.x.redAdd(delta);\n\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n const alpha = xmdelta.redMul(xpdelta).redIMuln(3);\n\n // + beta4 = 4 * beta\n const beta4 = beta.redIMuln(4);\n\n // + beta8 = 2 * beta4\n const beta8 = beta4.redMuln(2);\n\n // + gamma28 = 8 * gamma^2\n const gamma28 = gamma.redSqr().redIMuln(8);\n\n // X3 = alpha^2 - 8 * beta\n const nx = alpha.redSqr().redISub(beta8);\n\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n const nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n const ny = alpha.redMul(beta4.redISub(nx)).redISub(gamma28);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n getX() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof JPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.isInfinity())\n return p.isInfinity();\n\n // Q = O\n if (p.isInfinity())\n return false;\n\n // Z1 = Z2\n if (this.z.eq(p.z)) {\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n // X1 * Z2^2 = X2 * Z1^2\n const zz1 = this.z.redSqr();\n const zz2 = p.z.redSqr();\n const x1 = this.x.redMul(zz2);\n const x2 = p.x.redMul(zz1);\n\n if (!x1.eq(x2))\n return false;\n\n // Y1 * Z2^3 = Y2 * Z1^3\n const zzz1 = zz1.redMul(this.z);\n const zzz2 = zz2.redMul(p.z);\n const y1 = this.y.redMul(zzz2);\n const y2 = p.y.redMul(zzz1);\n\n return y1.eq(y2);\n }\n\n cmp(point) {\n assert(point instanceof JPoint);\n\n const inf1 = this.isInfinity();\n const inf2 = point.isInfinity();\n\n if (inf1 && !inf2)\n return -1;\n\n if (!inf1 && inf2)\n return 1;\n\n if (inf1 && inf2)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Z1 = 0\n return this.z.isZero();\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.isInfinity())\n return false;\n\n this.normalize();\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.isInfinity())\n return false;\n\n this.normalize();\n\n return this.y.redIsEven();\n }\n\n isSquare() {\n if (this.isInfinity())\n return false;\n\n return this.y.redMul(this.z).redJacobi() !== -1;\n }\n\n eqX(x) {\n // Verify that integer `x` is equal to field\n // element `x` by scaling it by our z coordinate.\n // This optimization is mentioned in and used for\n // bip-schnorr[1]. This avoids having to affinize\n // the resulting point during verification.\n //\n // [1] [SCHNORR] \"Optimizations\".\n assert(x instanceof BN);\n assert(!x.red);\n\n if (this.isInfinity())\n return false;\n\n const zz = this.z.redSqr();\n const rx = x.toRed(this.curve.red).redMul(zz);\n\n return this.x.eq(rx);\n }\n\n eqR(x) {\n // Similar to the optimization above, this\n // optimization, suggested by Maxwell[1],\n // compares an integer to an X coordinate\n // by scaling it.\n //\n // Since a signature's R value is modulo N\n // in ECDSA, we may be dealing with an R\n // value greater than N in actuality.\n //\n // If the equality check fails, we can\n // scale N itself by Z and add it to the\n // X field element.\n //\n // [1] https://github.com/bitcoin-core/secp256k1/commit/ce7eb6f\n assert(x instanceof BN);\n assert(!x.red);\n\n if (!this.curve.smallGap)\n return this.toP().eqR(x);\n\n if (this.isInfinity())\n return false;\n\n if (x.cmp(this.curve.p) >= 0)\n return false;\n\n const zz = this.z.redSqr();\n const rx = x.toRed(this.curve.red).redMul(zz);\n\n if (this.x.eq(rx))\n return true;\n\n if (this.curve.highOrder)\n return false;\n\n if (x.cmp(this.curve.pmodn) >= 0)\n return false;\n\n const rn = this.curve.redN.redMul(zz);\n\n rx.redIAdd(rn);\n\n return this.x.eq(rx);\n }\n\n toP() {\n // P = O\n if (this.isInfinity())\n return this.curve.point();\n\n this.normalize();\n\n // (X3, Y3) = (X1 / Z1^2, Y1 / Z1^3)\n return this.curve.point(this.x, this.y);\n }\n\n toJ() {\n return this;\n }\n\n encode(compact) {\n return this.toP().encode(compact);\n }\n\n static decode(curve, bytes) {\n return ShortPoint.decode(curve, bytes).toJ();\n }\n\n encodeX() {\n return this.toP().encodeX();\n }\n\n static decodeEven(curve, bytes) {\n return ShortPoint.decodeEven(curve, bytes).toJ();\n }\n\n static decodeSquare(curve, bytes) {\n return ShortPoint.decodeSquare(curve, bytes).toJ();\n }\n\n toJSON(pre) {\n return this.toP().toJSON(pre);\n }\n\n toPretty() {\n return this.toP().toPretty();\n }\n\n static fromJSON(curve, json) {\n return ShortPoint.fromJSON(curve, json).toJ();\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * MontCurve\n */\n\nclass MontCurve extends Curve {\n constructor(conf) {\n super(MontPoint, 'mont', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.b = BN.fromJSON(conf.b).toRed(this.red);\n\n this.bi = this.b.redInvert();\n this.a2 = this.a.redAdd(this.two);\n this.a24 = this.a2.redMul(this.i4);\n this.a3 = this.a.redMul(this.i3);\n this.a0 = this.a.redMul(this.bi);\n this.b0 = this.bi.redSqr();\n\n this._finalize(conf);\n }\n\n static _isomorphism(curveA, curveB, customB) {\n // Montgomery Isomorphism.\n //\n // [MONT3] Page 3, Section 2.1.\n //\n // Transformation:\n //\n // A' = A\n // B' = B'\n //\n // Where (B / B') is square.\n assert(curveA instanceof BN);\n assert(curveB instanceof BN);\n assert(customB instanceof BN);\n\n const a = curveA.clone();\n const b = customB.clone();\n const c = curveB.redDiv(customB);\n\n if (c.redJacobi() !== 1)\n throw new Error('Invalid `b` coefficient.');\n\n return [a, b];\n }\n\n _short(a0, odd) {\n // Montgomery->Short Weierstrass Equivalence.\n //\n // [MONT2] \"Equivalence with Weierstrass curves\".\n //\n // Transformation:\n //\n // a = (3 - A^2) / (3 * B^2)\n // b = (2 * A^3 - 9 * A) / (27 * B^3)\n const {a, b, three} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const b3 = b2.redMul(b);\n const n0 = three.redSub(a2);\n const d0 = b2.redMuln(3);\n const n1 = a3.redMuln(2).redISub(a.redMuln(9));\n const d1 = b3.redMuln(27);\n const wa = n0.redDiv(d0);\n const wb = n1.redDiv(d1);\n\n if (a0 != null)\n return ShortCurve._isomorphism(wa, wb, a0, odd);\n\n return [wa, wb];\n }\n\n _mont(b0) {\n return MontCurve._isomorphism(this.a, this.b, b0);\n }\n\n _edwards(a0, invert = false) {\n // Montgomery->Twisted Edwards Transformation.\n //\n // [MONT1] Page 11, Section 4.3.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n //\n // Equivalence:\n //\n // a = (A + 2) / B\n // d = (A - 2) / B\n //\n // Isomorphism:\n //\n // a = a'\n // d = a' * (A - 2) / (A + 2)\n //\n // Where ((A + 2) / (B * a')) is square.\n //\n // If `d` is square, we can usually find\n // a complete curve by using the `invert`\n // option. This will create an isomorphism\n // chain of: M(A,B)->E(a,d)->E(d,a).\n //\n // The equivalence between E(a,d) and\n // E(d,a) is:\n //\n // (x, y) = (x, 1 / y)\n //\n // Meaning our map to E(d,a) is:\n //\n // x = u / v\n // y = 1 / ((u - 1) / (u + 1))\n // = (u + 1) / (u - 1)\n assert(typeof invert === 'boolean');\n\n const {two, bi} = this;\n const a = this.a.redAdd(two).redMul(bi);\n const d = this.a.redSub(two).redMul(bi);\n\n if (invert)\n a.swap(d);\n\n if (a0 != null)\n return EdwardsCurve._isomorphism(a, d, a0);\n\n return [a, d];\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n const [u2, u3] = curve._scale(this);\n\n return [this.field(u2.redInvert()),\n this.field(u3.redInvert())];\n }\n\n _scaleMont(curve) {\n // We can extract the isomorphism factor with:\n //\n // c = +-sqrt(B / B')\n //\n // If base points are available, we can do:\n //\n // c = v' / v\n assert(curve instanceof MontCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this.field(curve.b).redDivSqrt(this.b);\n\n return this.g.y.redDiv(this.field(curve.g.y));\n }\n\n _scaleEdwards(curve, invert) {\n // We _could_ do something like:\n //\n // B = 4 / (a - d)\n // c = +-sqrt(B / B')\n //\n // Which can be reduced to:\n //\n // c = +-sqrt(4 / ((a - d) * B'))\n //\n // If base points are available:\n //\n // v = u' / x\n // c = v' / v\n //\n // Which can be reduced to:\n //\n // c = v' * x / u'\n //\n // However, the way our maps are\n // written, we can re-use the Edwards\n // isomorphism factor when going the\n // other direction.\n assert(curve instanceof EdwardsCurve);\n\n const c = curve._scale(this, invert);\n\n return this.field(c);\n }\n\n _solveY0(x) {\n assert(x instanceof BN);\n\n // y^2 = x^3 + A * x^2 + B * x\n const a = this.a0;\n const b = this.b0;\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const y2 = x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x));\n\n return y2;\n }\n\n _elligator2(u) {\n // Elligator 2.\n //\n // Distribution: 1/2.\n //\n // [ELL2] Page 11, Section 5.2.\n // [H2EC] \"Elligator 2 Method\".\n // \"Mappings for Montgomery curves\".\n // [SAFE] \"Indistinguishability from uniform random strings\".\n //\n // Assumptions:\n //\n // - y^2 = x^3 + A * x^2 + B * x.\n // - A != 0, B != 0.\n // - A^2 - 4 * B is non-zero and non-square in F(p).\n // - Let z be a non-square in F(p).\n // - u != +-sqrt(-1 / z).\n //\n // Note that Elligator 2 is defined over the form:\n //\n // y'^2 = x'^3 + A' * x'^2 + B' * x'\n //\n // Instead of:\n //\n // B * y^2 = x^3 + A * x^2 + x\n //\n // Where:\n //\n // A' = A / B\n // B' = 1 / B^2\n // x' = x / B\n // y' = y / B\n //\n // And:\n //\n // x = B * x'\n // y = B * y'\n //\n // This is presumably the result of Elligator 2\n // being designed in long Weierstrass form. If\n // we want to support B != 1, we need to do the\n // conversion.\n //\n // Map:\n //\n // g(x) = x^3 + A * x^2 + B * x\n // x1 = -A / (1 + z * u^2)\n // x1 = -A, if x1 = 0\n // x2 = -x1 - A\n // x = x1, if g(x1) is square\n // = x2, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const lhs = this.a0.redNeg();\n const rhs = this.one.redAdd(this.z.redMul(u.redSqr()));\n\n if (rhs.isZero())\n rhs.inject(this.one);\n\n const x1 = lhs.redMul(rhs.redInvert());\n const x2 = x1.redNeg().redISub(this.a0);\n const y1 = this._solveY0(x1);\n const y2 = this._solveY0(x2);\n const alpha = y1.redIsSquare() | 0;\n const x0 = [x1, x2][alpha ^ 1];\n const y0 = [y1, y2][alpha ^ 1].redSqrt();\n\n if (y0.redIsOdd() !== u.redIsOdd())\n y0.redINeg();\n\n const x = this.b.redMul(x0);\n const y = this.b.redMul(y0);\n\n return this.point(x, y);\n }\n\n _invert2(p, hint) {\n // Inverting the Map (Elligator 2).\n //\n // [ELL2] Page 12, Section 5.3.\n //\n // Assumptions:\n //\n // - -z * x * (x + A) is square in F(p).\n // - If r = 1 then x != 0.\n // - If r = 2 then x != -A.\n //\n // Map:\n //\n // u1 = -(x + A) / (x * z)\n // u2 = -x / ((x + A) * z)\n // r = random integer in [1,2]\n // u = sign(y) * abs(sqrt(ur))\n //\n // Note that `0 / 0` can only occur if A = 0\n // (this violates the assumptions of Elligator 2).\n const {x, y} = p;\n const r = hint & 1;\n const x0 = x.redMul(this.bi);\n const y0 = y.redMul(this.bi);\n const n = x0.redAdd(this.a0);\n const d = x0;\n const lhs = [n, d][r].redINeg();\n const rhs = [d, n][r].redMul(this.z);\n const u = lhs.redDivSqrt(rhs);\n\n if (u.redIsOdd() !== y0.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n isElliptic() {\n const a2 = this.a.redSqr();\n const d = this.b.redMul(a2.redSub(this.four));\n\n // B * (A^2 - 4) != 0\n return !d.isZero();\n }\n\n jinv() {\n // [MONT3] Page 3, Section 2.\n const {a, three, four} = this;\n const a2 = a.redSqr();\n const t0 = a2.redSub(three);\n const lhs = t0.redPown(3).redIMuln(256);\n const rhs = a2.redSub(four);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // (256 * (A^2 - 3)^3) / (A^2 - 4)\n return lhs.redDiv(rhs).fromRed();\n }\n\n point(x, y) {\n return new MontPoint(this, x, y);\n }\n\n jpoint(x, y, z) {\n assert(x == null && y == null && z == null);\n return this.point();\n }\n\n xpoint(x, z) {\n return new XPoint(this, x, z);\n }\n\n solveY2(x) {\n // [MONT3] Page 3, Section 2.\n // https://hyperelliptic.org/EFD/g1p/auto-montgom.html\n assert(x instanceof BN);\n\n // B * y^2 = x^3 + A * x^2 + x\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const by2 = x3.redIAdd(this.a.redMul(x2)).redIAdd(x);\n const y2 = by2.redMul(this.bi);\n\n return y2;\n }\n\n validate(point) {\n assert(point instanceof MontPoint);\n\n if (point.isInfinity())\n return true;\n\n const {x, y} = point;\n const y2 = this.solveY2(x);\n\n return y.redSqr().eq(y2);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve, invert) {\n // [MONT3] Page 3, Section 2.1.\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n // M(A,B) <-> M(A,B')\n if (curve.type === 'mont') {\n const a = this.field(curve.a);\n const b = this.field(curve.b);\n\n // A' = A\n if (!this.a.eq(a))\n return false;\n\n // B' != 0\n if (this.b.isZero())\n return false;\n\n // jacobi(B / B') = 1\n const c = b.redDiv(this.b);\n\n return c.redJacobi() === 1;\n }\n\n return curve.isIsomorphic(this, invert);\n }\n\n isIsogenous(curve) {\n assert(curve instanceof Curve);\n\n if (curve.type === 'mont')\n return false;\n\n return curve.isIsogenous(this);\n }\n\n pointFromShort(point) {\n // [ALT] Appendix E.2 (Switching between Alternative Representations).\n // [MONT2] \"Equivalence with Weierstrass curves\"\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,b)->M(A,B):\n //\n // u = B * x - A / 3\n // v = B * y\n //\n // Undefined if ((u^3 + A * u^2 + u) / B) is not square.\n if (point.isInfinity())\n return this.point();\n\n const {a3, b} = this;\n const [u2, u3] = this._scale(point.curve);\n const x = this.field(point.x).redMul(u2);\n const y = this.field(point.y).redMul(u3);\n const u = b.redMul(x).redISub(a3);\n const v = b.redMul(y);\n\n return this.point(u, v);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [MONT3] Page 3, Section 2.1.\n assert(point instanceof MontPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for M(A,B)<->M(A,B'):\n //\n // u' = u\n // v' = +-sqrt(B / B') * v\n //\n // Undefined if (B / B') is not square.\n if (point.isInfinity())\n return this.point();\n\n const c = this._scale(point.curve);\n const u = this.field(point.x);\n const v = this.field(point.y);\n const nu = u;\n const nv = c.redMul(v);\n\n return this.point(nu, nv);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [RFC7748] Section 4.1 & 4.2.\n // [MONT3] Page 6, Section 2.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n assert(point instanceof EdwardsPoint);\n assert(point.curve.p.eq(this.p));\n\n // Edwards `x`, `y`, `z`.\n const x = this.field(point.x);\n const y = this.field(point.y);\n const z = this.field(point.z);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for E(1,d)->M(2-4d,1):\n //\n // u = y^2 / x^2\n // v = (2 - x^2 - y^2) * y / x^3\n //\n // Undefined for x = 0.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-1, 0) -> (0, 0)\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = z.redSqr().redIMuln(2);\n const uu = y.redSqr();\n const uz = x.redSqr();\n const vv = c.redISub(uz).redISub(uu).redMul(y);\n const vz = uz.redMul(x);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n if (this.isIsomorphic(point.curve, true)) {\n // Isomorphic maps for E(d,a)->M(A,B):\n //\n // u = (y + 1) / (y - 1)\n // v = +-sqrt((A - 2) / (B * a)) * u / x\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-sqrt(1 / a), 0) -> (-1, +-sqrt((A - 2) / B))\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = this._scale(point.curve, true);\n const uu = y.redAdd(z);\n const uz = y.redSub(z);\n const vv = c.redMul(z).redMul(uu);\n const vz = x.redMul(uz);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n if (this.isIsomorphic(point.curve, false)) {\n // Isomorphic maps for E(a,d)->M(A,B):\n //\n // u = (1 + y) / (1 - y)\n // v = +-sqrt((A + 2) / (B * a)) * u / x\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-sqrt(1 / a), 0) -> (1, +-sqrt((A + 2) / B))\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = this._scale(point.curve, false);\n const uu = z.redAdd(y);\n const uz = z.redSub(y);\n const vv = c.redMul(z).redMul(uu);\n const vz = x.redMul(uz);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n assert(u instanceof BN);\n\n // z = 0 or A = 0\n if (this.z.isZero() || this.a.isZero())\n throw new Error('Not implemented.');\n\n return this._elligator2(u);\n }\n\n pointToUniform(p, hint) {\n // Convert a montgomery point to a field\n // element by inverting the elligator2 map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof MontPoint);\n assert((hint >>> 0) === hint);\n\n // z = 0 or A = 0\n if (this.z.isZero() || this.a.isZero())\n throw new Error('Not implemented.');\n\n // P = O\n if (p.isInfinity())\n throw new Error('Invalid point.');\n\n // Add a random torsion component.\n const i = ((hint >>> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n return wrapErrors(() => {\n return this._invert2(q, hint);\n });\n }\n\n decodePoint(bytes, sign) {\n return MontPoint.decode(this, bytes, sign);\n }\n\n encodeX(point) {\n assert(point instanceof XPoint);\n return point.encode();\n }\n\n decodeX(bytes) {\n return XPoint.decode(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromMont(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, sign = null) {\n const [a, b] = this._mont(b0);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromMont(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, invert, sign = null) {\n const [a, d] = this._edwards(a0, invert);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this, invert);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromMont(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return MontPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n json.a = this.a.fromRed().toJSON();\n json.b = this.b.fromRed().toJSON();\n return json;\n }\n}\n\n/**\n * MontPoint\n */\n\nclass MontPoint extends Point {\n constructor(curve, x, y) {\n assert(curve instanceof MontCurve);\n\n super(curve, types.AFFINE);\n\n this.x = this.curve.zero;\n this.y = this.curve.zero;\n this.inf = true;\n\n if (x != null)\n this._init(x, y);\n }\n\n _init(x, y) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n\n this.x = x;\n this.y = y;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n this.inf = false;\n }\n\n clone() {\n if (this.inf)\n return this.curve.point();\n\n return this.curve.point(this.x, this.y);\n }\n\n scale(a) {\n return this.clone();\n }\n\n randomize(rng) {\n return this.clone();\n }\n\n neg() {\n // P = O\n if (this.inf)\n return this;\n\n // -(X1, Y1) = (X1, -Y1)\n return this.curve.point(this.x, this.y.redNeg());\n }\n\n add(p) {\n // [MONT1] Page 8, Section 4.3.2.\n //\n // Addition Law:\n //\n // l = (y2 - y1) / (x2 - x1)\n // x3 = b * l^2 - a - x1 - x2\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 1S + 7A + 1*b\n assert(p instanceof MontPoint);\n\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P, P + -P\n if (this.x.eq(p.x)) {\n // P + -P = O\n if (!this.y.eq(p.y))\n return this.curve.point();\n\n // P + P = 2P\n return this.dbl();\n }\n\n // H = X2 - X1\n const h = p.x.redSub(this.x);\n\n // R = Y2 - Y1\n const r = p.y.redSub(this.y);\n\n // L = R / H\n const l = r.redDiv(h);\n\n // K = b * L^2\n const k = this.curve.b.redMul(l.redSqr());\n\n // X3 = K - a - X1 - X2\n const nx = k.redISub(this.curve.a).redISub(this.x).redISub(p.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dbl() {\n // [MONT1] Page 8, Section 4.3.2.\n //\n // Addition Law (doubling):\n //\n // l = (3 * x1^2 + 2 * a * x1 + 1) / (2 * b * y1)\n // x3 = b * l^2 - a - 2 * x1\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 3M + 2S + 7A + 1*a + 1*b + 1*b + 2*2 + 1*3\n\n // P = O\n if (this.inf)\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.point();\n\n // M1 = 3 * X1^2\n const m1 = this.x.redSqr().redIMuln(3);\n\n // M2 = 2 * a * X1\n const m2 = this.curve.a.redMul(this.x).redIMuln(2);\n\n // M = M1 + M2 + 1\n const m = m1.redIAdd(m2).redIAdd(this.curve.one);\n\n // Z = 2 * b * Y1\n const z = this.curve.b.redMul(this.y).redIMuln(2);\n\n // L = M / Z\n const l = m.redDiv(z);\n\n // K = b * L^2\n const k = this.curve.b.redMul(l.redSqr());\n\n // X3 = K - a - 2 * X1\n const nx = k.redISub(this.curve.a).redISub(this.x).redISub(this.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n getX() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof MontPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.inf)\n return p.inf;\n\n // Q = O\n if (p.inf)\n return false;\n\n // X1 = X2, Y1 = Y2\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n cmp(point) {\n assert(point instanceof MontPoint);\n\n if (this.inf && !point.inf)\n return -1;\n\n if (!this.inf && point.inf)\n return 1;\n\n if (this.inf && point.inf)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Infinity cannot be represented in\n // the affine space, except by a flag.\n return this.inf;\n }\n\n isOrder2() {\n if (this.inf)\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.inf)\n return false;\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.inf)\n return false;\n\n return this.y.redIsEven();\n }\n\n toP() {\n return this;\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n // (X3, Z3) = (1, 0)\n if (this.inf)\n return this.curve.xpoint();\n\n // (X3, Z3) = (X1, 1)\n return this.curve.xpoint(this.x, this.curve.one);\n }\n\n encode() {\n return this.toX().encode();\n }\n\n static decode(curve, bytes, sign) {\n assert(curve instanceof MontCurve);\n return curve.decodeX(bytes).toP(sign);\n }\n\n toJSON(pre) {\n if (this.inf)\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n return [x, y];\n }\n\n toPretty() {\n if (this.inf)\n return [];\n\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof MontCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n\n return curve.point(x, y);\n }\n\n [custom]() {\n if (this.inf)\n return '';\n\n return '';\n }\n}\n\n/**\n * XPoint\n */\n\nclass XPoint extends Point {\n constructor(curve, x, z) {\n assert(curve instanceof MontCurve);\n\n super(curve, types.PROJECTIVE);\n\n this.x = this.curve.one;\n this.z = this.curve.zero;\n\n if (x != null)\n this._init(x, z);\n }\n\n _init(x, z) {\n assert(x instanceof BN);\n assert(z == null || (z instanceof BN));\n\n this.x = x;\n this.z = z || this.curve.one;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n }\n\n clone() {\n return this.curve.xpoint(this.x, this.z);\n }\n\n precompute(power, rng) {\n // No-op.\n return this;\n }\n\n validate() {\n if (this.isInfinity())\n return true;\n\n // B * y^2 * z = x^3 + A * x^2 * z + x * z^2\n const {x, z} = this;\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const z2 = z.redSqr();\n const ax2 = this.curve.a.redMul(x2).redMul(z);\n const by2 = x3.redIAdd(ax2).redIAdd(x.redMul(z2));\n const y2 = by2.redMul(this.curve.bi);\n\n // sqrt(y^2 * z^4) = y * z^2\n return y2.redMul(z).redJacobi() !== -1;\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#scaling-scale\n // 1I + 1M\n\n // P = O\n if (this.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.z.eq(this.curve.one))\n return this;\n\n // X3 = X1 / Z1\n this.x = this.x.redDiv(this.z);\n\n // Z3 = 1\n this.z = this.curve.one;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // P = O\n if (this.isInfinity())\n return this.curve.xpoint();\n\n // X3 = X1 * A\n const nx = this.x.redMul(a);\n\n // Y3 = Y1 * A\n const nz = this.z.redMul(a);\n\n return this.curve.xpoint(nx, nz);\n }\n\n neg() {\n // -(X1, Z1) = (X1, Z1)\n return this;\n }\n\n dbl() {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n // 2M + 2S + 4A + 1*a24\n\n // A = X1 + Z1\n const a = this.x.redAdd(this.z);\n\n // AA = A^2\n const aa = a.redSqr();\n\n // B = X1 - Z1\n const b = this.x.redSub(this.z);\n\n // BB = B^2\n const bb = b.redSqr();\n\n // C = AA - BB\n const c = aa.redSub(bb);\n\n // X3 = AA * BB\n const nx = aa.redMul(bb);\n\n // Z3 = C * (BB + a24 * C)\n const nz = c.redMul(bb.redIAdd(this.curve.a24.redMul(c)));\n\n return this.curve.xpoint(nx, nz);\n }\n\n diffAddDbl(p2, p3) {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#ladder-ladd-1987-m-3\n // 6M + 4S + 8A + 1*a24\n assert(p2 instanceof XPoint);\n assert(p3 instanceof XPoint);\n\n // A = X2 + Z2\n const a = p2.x.redAdd(p2.z);\n\n // AA = A^2\n const aa = a.redSqr();\n\n // B = X2 - Z2\n const b = p2.x.redSub(p2.z);\n\n // BB = B^2\n const bb = b.redSqr();\n\n // E = AA - BB\n const e = aa.redSub(bb);\n\n // C = X3 + Z3\n const c = p3.x.redAdd(p3.z);\n\n // D = X3 - Z3\n const d = p3.x.redSub(p3.z);\n\n // DA = D * A\n const da = d.redMul(a);\n\n // CB = C * B\n const cb = c.redMul(b);\n\n // X5 = Z1 * (DA + CB)^2\n const x5 = this.z.redMul(da.redAdd(cb).redSqr());\n\n // Z5 = X1 * (DA - CB)^2\n const z5 = this.x.redMul(da.redISub(cb).redSqr());\n\n // X4 = AA * BB\n const x4 = aa.redMul(bb);\n\n // Z4 = E * (BB + a24 * E)\n const z4 = e.redMul(bb.redIAdd(this.curve.a24.redMul(e)));\n\n return [\n this.curve.xpoint(x4, z4),\n this.curve.xpoint(x5, z5)\n ];\n }\n\n getX() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.x.fromRed();\n }\n\n getY(sign) {\n return this.toP(sign).getY();\n }\n\n eq(p) {\n assert(p instanceof XPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.isInfinity())\n return p.isInfinity();\n\n // Q = O\n if (p.isInfinity())\n return false;\n\n // Z1 = Z2\n if (this.z.eq(p.z))\n return this.x.eq(p.x);\n\n // X1 * Z2 = X2 * Z1\n const x1 = this.x.redMul(p.z);\n const x2 = p.x.redMul(this.z);\n\n return x1.eq(x2);\n }\n\n cmp(point) {\n assert(point instanceof XPoint);\n\n const inf1 = this.isInfinity();\n const inf2 = point.isInfinity();\n\n if (inf1 && !inf2)\n return -1;\n\n if (!inf1 && inf2)\n return 1;\n\n if (inf1 && inf2)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX());\n }\n\n isInfinity() {\n // Z1 = 0\n return this.z.isZero();\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.x.isZero();\n }\n\n isOdd() {\n return false;\n }\n\n isEven() {\n return false;\n }\n\n hasTorsion() {\n if (this.isInfinity())\n return false;\n\n // X1 = 0, Z1 != 0 (edge case)\n if (this.x.isZero())\n return true;\n\n return super.hasTorsion();\n }\n\n order() {\n try {\n return this.toP().order();\n } catch (e) {\n return new BN(1);\n }\n }\n\n jmul(k) {\n // Multiply with the Montgomery Ladder.\n //\n // [MONT3] Algorithm 4, Page 12, Section 4.2.\n //\n // Note that any clamping is meant to\n // be done _outside_ of this function.\n assert(k instanceof BN);\n assert(!k.red);\n\n const bits = k.bitLength();\n\n let a = this.curve.xpoint();\n let b = this;\n\n for (let i = bits - 1; i >= 0; i--) {\n const bit = k.bit(i);\n\n if (bit === 0)\n [a, b] = this.diffAddDbl(a, b);\n else\n [b, a] = this.diffAddDbl(b, a);\n }\n\n return a;\n }\n\n jmulBlind(k, rng) {\n if (!rng)\n return this.jmul(k);\n\n // Randomize if available.\n return this.randomize(rng).jmul(k);\n }\n\n jmulAdd(k1, p2, k2) {\n throw new Error('Not implemented.');\n }\n\n toP(sign = null) {\n assert(sign == null || typeof sign === 'boolean');\n\n if (this.isInfinity())\n return this.curve.point();\n\n this.normalize();\n\n return this.curve.pointFromX(this.x, sign);\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n return this;\n }\n\n key() {\n if (this.isInfinity())\n return `${this.curve.uid}:oo`;\n\n this.normalize();\n\n const x = this.getX().toString(16);\n\n return `${this.curve.uid}:${x}`;\n }\n\n encode() {\n // [RFC7748] Section 5.\n return this.curve.encodeField(this.getX());\n }\n\n static decode(curve, bytes) {\n assert(curve instanceof MontCurve);\n\n // [RFC7748] Section 5.\n const x = curve.decodeField(bytes);\n\n // We're supposed to ignore the hi bit\n // on montgomery points... I think. If\n // we don't, the X25519 test vectors\n // break, which is pretty convincing\n // evidence. This is a no-op for X448.\n x.iumaskn(curve.fieldBits);\n\n // Note: montgomery points are meant to be\n // reduced by the prime and do not have to\n // be explicitly validated in order to do\n // the montgomery ladder.\n const p = curve.xpoint(x, curve.one);\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n toJSON(pre) {\n return this.toP().toJSON(pre);\n }\n\n toPretty() {\n return this.toP().toPretty();\n }\n\n static fromJSON(curve, json) {\n return MontPoint.fromJSON(curve, json).toX();\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * EdwardsCurve\n */\n\nclass EdwardsCurve extends Curve {\n constructor(conf) {\n super(EdwardsPoint, 'edwards', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.d = BN.fromJSON(conf.d).toRed(this.red);\n this.s = BN.fromJSON(conf.s || '0').toRed(this.red);\n this.si = this.s.isZero() ? this.zero : this.s.redInvert();\n\n this.k = this.d.redMuln(2);\n this.smi = -this.d.redNeg().word(0);\n this.ad6 = this.a.redAdd(this.d).redMul(this.i6);\n\n this.twisted = !this.a.eq(this.one);\n this.oneA = this.a.eq(this.one);\n this.mOneA = this.a.eq(this.one.redNeg());\n this.smallD = this.prime != null && this.d.redNeg().length === 1;\n this.alt = null;\n\n this._finalize(conf);\n }\n\n static _isomorphism(curveA, curveD, customA) {\n // Twisted Edwards Isomorphism.\n //\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n //\n // Transformation:\n //\n // a' = a'\n // d' = a' * d / a\n //\n // Where (a / a') is square.\n assert(curveA instanceof BN);\n assert(curveD instanceof BN);\n assert(customA instanceof BN);\n\n const a = customA.clone();\n const d = customA.redMul(curveD).redDiv(curveA);\n const c = curveA.redDiv(customA);\n\n if (c.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n return [a, d];\n }\n\n _short(a0, odd) {\n // Twisted Edwards->Short Weierstrass Equivalence.\n //\n // [TWISTEQ] Section 2.\n //\n // Transformation:\n //\n // a' = -(a^2 + 14 * a * d + d^2) / 48\n // b' = (33 * (a^2 * d + a * d^2) - a^3 - d^3) / 864\n const {a, d} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const d2 = d.redSqr();\n const d3 = d2.redMul(d);\n const ad14 = a.redMul(d).redIMuln(14);\n const a2d = a2.redMul(d);\n const ad2 = a.redMul(d2);\n const t0 = a2d.redIAdd(ad2).redIMuln(33);\n const wa = a2.redAdd(ad14).redIAdd(d2).redDivn(-48);\n const wb = t0.redISub(a3).redISub(d3).redDivn(864);\n\n if (a0 != null)\n return ShortCurve._isomorphism(wa, wb, a0, odd);\n\n return [wa, wb];\n }\n\n _mont(b0, invert = false) {\n // Twisted Edwards->Montgomery Transformation.\n //\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n //\n // Equivalence:\n //\n // A = 2 * (a + d) / (a - d)\n // B = 4 / (a - d)\n //\n // Isomorphism:\n //\n // A = 2 * (a + d) / (a - d)\n // B = B'\n //\n // Where ((4 / (a - d)) / B') is square.\n //\n // If `4 / (a - d)` is non-square, we can\n // usually force B=1 by using the `invert`\n // option. This will create an isomorphism\n // chain of: E(a,d)->E(d,a)->M(-A,-B).\n //\n // The equivalence between E(a,d) and E(d,a)\n // is:\n //\n // (x, y) = (x, 1 / y)\n //\n // Meaning our map to M(-A,-B) is:\n //\n // u = (1 + 1 / y) / (1 - 1 / y)\n // = (y + 1) / (y - 1)\n // v = u / x\n assert(typeof invert === 'boolean');\n\n let apd, amd;\n\n if (invert) {\n apd = this.d.redAdd(this.a);\n amd = this.d.redSub(this.a);\n } else {\n apd = this.a.redAdd(this.d);\n amd = this.a.redSub(this.d);\n }\n\n const z = amd.redInvert();\n const a = apd.redMuln(2).redMul(z);\n const b = z.redMuln(4);\n\n if (b0 != null)\n return MontCurve._isomorphism(a, b, b0);\n\n return [a, b];\n }\n\n _edwards(a0) {\n return EdwardsCurve._isomorphism(this.a, this.d, a0);\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n const [u2, u3] = curve._scale(this);\n\n return [this.field(u2.redInvert()),\n this.field(u3.redInvert())];\n }\n\n _scaleMont(curve, invert = false) {\n // Calculate isomorphism factor between\n // Twisted Edwards and Montgomery with:\n //\n // a = (A + 2) / B\n // c = +-sqrt(a / a')\n //\n // Which can be reduced to:\n //\n // c = +-sqrt((A + 2) / (B * a'))\n //\n // If base points are available, we can do:\n //\n // x = u / v\n // c = x' / x\n //\n // Which can be reduced to:\n //\n // c = v * x' / u\n //\n // We can now calculate the Edwards `x` with:\n //\n // x' = c * u / v\n //\n // And likewise, the Montgomery `v`:\n //\n // v = c * u / x'\n assert(curve instanceof MontCurve);\n assert(typeof invert === 'boolean');\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a] = curve._edwards(null, invert);\n\n return this.field(a).redDivSqrt(this.a);\n }\n\n const x = curve.g.x.redDiv(curve.g.y);\n\n return this.g.x.redDiv(this.field(x));\n }\n\n _scaleEdwards(curve) {\n // We can extract the isomorphism factor with:\n //\n // c = +-sqrt(a / a')\n //\n // If base points are available, we can do:\n //\n // c = x' / x\n assert(curve instanceof EdwardsCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this.field(curve.a).redDivSqrt(this.a);\n\n return this.g.x.redDiv(this.field(curve.g.x));\n }\n\n _mulA(num) {\n assert(num instanceof BN);\n\n // n * a = n\n if (this.oneA)\n return num.clone();\n\n // n * a = -n\n if (this.mOneA)\n return num.redNeg();\n\n return this.a.redMul(num);\n }\n\n _mulD(num) {\n assert(num instanceof BN);\n\n // -d < 0x4000000\n if (this.smallD)\n return num.redMuln(this.smi);\n\n return this.d.redMul(num);\n }\n\n _elligator1(t) {\n // Elligator 1.\n //\n // Distribution: 1/2.\n //\n // [ELL1] Page 6, Section 3.\n // Page 15, Appendix A.\n // [ELL2] Page 7, Section 3.2.\n //\n // Assumptions:\n //\n // - Let p be a prime power congruent to 3 mod 4.\n // - Let s be a nonzero element of F(p).\n // - Let c = 2 / s^2.\n // - Let r = c + 1 / c.\n // - Let d = -(c + 1)^2 / (c - 1)^2.\n // - (s^2 - 2) * (s^2 + 2) != 0.\n // - c * (c - 1) * (c + 1) != 0.\n // - r != 0.\n // - d is not square.\n // - x^2 + y^2 = 1 + d * x^2 * y^2.\n // - u * v * X * Y * x * (Y + 1) != 0.\n // - Y^2 = X^5 + (r^2 - 2) * X^3 + X.\n //\n // Elligator 1, as devised by Fouque et al,\n // takes place on the hyperelliptic curve of:\n //\n // y^2 = x^5 + (r^2 - 2) * x^3 + x\n //\n // Not only must our Edwards curve be complete,\n // with a prime congruent to 3 mod 4, and a = 1,\n // our curve must be isomorphic to a hyperelliptic\n // curve of the above form. Roughly one half of\n // all Edwards curves are isomorphic to a curve\n // of said form.\n //\n // We can derive the isomorphism with:\n //\n // c = (d +- 2 * sqrt(-d) - 1) / (d + 1)\n // s = +-sqrt(2 / c)\n // r = c + 1 / c\n //\n // Note that even if your curve is an Elligator 1\n // curve, Elligator 2 is probably still preferable,\n // as it has nearly the same properties (i.e. the\n // same distribution), and is much less complex.\n //\n // Map:\n //\n // f(a) = a^((p - 1) / 2)\n // u = (1 - t) / (1 + t)\n // v = u^5 + (r^2 - 2) * u^3 + u\n // X = f(v) * u\n // Y = (f(v) * v)^((p + 1) / 4) * f(v) * f(u^2 + 1 / c^2)\n // Y = 1, if u = 0\n // x = (c - 1) * s * X * (1 + X) / Y\n // y = (r * X - (1 + X)^2) / (r * X + (1 + X)^2)\n //\n // When t = +-1, we create the hyperelliptic\n // 2-torsion point of (0, 0). This needs to be\n // mapped to (0, -1) in Edwards form, but the x\n // denominator becomes zero. As far as I can\n // tell, this is the only exceptional case.\n //\n // The only other exceptional case initially\n // appears to be when the y denominator sums to\n // zero (when t = sqrt(4 / r + 1)), however, the\n // hyperelliptic `X` is negated by the sign of\n // `v`, making this impossible.\n const {s, si, i2, one, two} = this;\n const c = si.redSqr().redIMuln(2);\n const ci = s.redSqr().redMul(i2);\n const ci2 = ci.redSqr();\n const r = c.redAdd(ci);\n const r2 = r.redSqr().redISub(two);\n const cm1 = c.redSub(one);\n const uu = one.redSub(t);\n const uz = one.redAdd(t);\n const u = uz.isZero() ? uz : uu.redDiv(uz);\n const u2 = u.redSqr();\n const u3 = u2.redMul(u);\n const u5 = u3.redMul(u2);\n const v = u5.redAdd(r2.redMul(u3)).redIAdd(u);\n const f0 = this.field(v.redJacobi());\n const f1 = this.field(u2.redAdd(ci2).redJacobi());\n const f2 = f0.redMul(f1);\n const X = f0.redMul(u);\n const Y = f0.redMul(v).redSqrt().redMul(f2);\n const X1 = one.redAdd(X);\n const rX = r.redMul(X);\n const X12 = X1.redSqr();\n const xx = cm1.redMul(s).redMul(X).redMul(X1);\n const xz = u.isZero() ? this.one : Y;\n const yy = rX.redSub(X12);\n const yz = rX.redAdd(X12);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n _invert1(p, hint) {\n // Inverting the Map (Elligator 1).\n //\n // [ELL1] Page 6, Section 3.\n // Page 15, Appendix A.\n // [ELL2] Page 7, Section 3.3.\n //\n // Assumptions:\n //\n // - y + 1 != 0.\n // - (1 + n * r)^2 - 1 is square in F(p).\n // - If n * r = -2 then x = 2 * s * (c - 1) * f(c) / r.\n // - Y = (c - 1) * s * X * (1 + X) / x.\n //\n // Map:\n //\n // f(a) = a^((p - 1) / 2)\n // n = (y - 1) / (2 * (y + 1))\n // X = -(1 + n * r) + ((1 + n * r)^2 - 1)^((p + 1) / 4)\n // z = f((c - 1) * s * X * (1 + X) * x * (X^2 + 1 / c^2))\n // u = z * X\n // t = (1 - u) / (1 + u)\n const {s, si, i2, one} = this;\n const {x, y, z} = p;\n const sign = hint & 1;\n const c = si.redSqr().redIMuln(2);\n const ci = s.redSqr().redMul(i2);\n const ci2 = ci.redSqr();\n const r = c.redAdd(ci);\n const cm1 = c.redSub(one);\n const nn = y.redSub(z);\n const nz = y.redAdd(z).redIMuln(2);\n const n = nz.isZero() ? nz : nn.redDiv(nz);\n const nr1 = one.redAdd(n.redMul(r));\n const w2 = nr1.redSqr().redISub(one);\n const w = w2.redSqrt();\n const X = w.redSub(nr1);\n const X1 = one.redAdd(X);\n const YY = cm1.redMul(s).redMul(X).redMul(X1);\n const Y = YY.redMul(x.redMul(z));\n const X2 = X.redSqr().redIAdd(ci2);\n const Z = this.field(Y.redMul(X2).redJacobi());\n const u = Z.redMul(X);\n const tt = one.redSub(u);\n const tz = one.redAdd(u);\n const t = tz.isZero() ? tz : tt.redDiv(tz);\n\n if (t.redIsOdd() !== Boolean(sign))\n t.redINeg();\n\n return t;\n }\n\n _alt() {\n if (!this.alt)\n this.alt = this.toMont();\n\n return this.alt;\n }\n\n isElliptic() {\n const ad = this.a.redMul(this.d);\n const amd = this.a.redSub(this.d);\n\n // a * d * (a - d) != 0\n return !ad.redMul(amd).isZero();\n }\n\n jinv() {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n const {a, d} = this;\n const ad = a.redMul(d);\n const amd4 = a.redSub(d).redPown(4);\n const a2 = a.redSqr();\n const d2 = d.redSqr();\n const t0 = a2.redAdd(ad.redMuln(14)).redIAdd(d2);\n const lhs = t0.redPown(3).redIMuln(16);\n const rhs = ad.redMul(amd4);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // 16 * (a^2 + 14 * a * d + d^2)^3 / (a * d * (a - d)^4)\n return lhs.redDiv(rhs).fromRed();\n }\n\n isComplete() {\n return this.a.redJacobi() === 1\n && this.d.redJacobi() === -1;\n }\n\n point(x, y, z, t) {\n return new EdwardsPoint(this, x, y, z, t);\n }\n\n jpoint(x, y, z) {\n assert(x == null && y == null && z == null);\n return this.point();\n }\n\n cpoint(xx, xz, yy, yz) {\n assert(xx instanceof BN);\n assert(xz instanceof BN);\n assert(yy instanceof BN);\n assert(yz instanceof BN);\n\n const x = xx.redMul(yz);\n const y = yy.redMul(xz);\n const z = xz.redMul(yz);\n const t = xx.redMul(yy);\n\n return this.point(x, y, z, t);\n }\n\n solveX2(y) {\n // [RFC8032] Section 5.1.3 & 5.2.3.\n assert(y instanceof BN);\n\n // x^2 = (y^2 - 1) / (d * y^2 - a)\n const y2 = y.redSqr();\n const rhs = this._mulD(y2).redISub(this.a);\n const lhs = y2.redISub(this.one);\n const x2 = lhs.redDiv(rhs);\n\n return x2;\n }\n\n solveX(y) {\n // Optimize with inverse square root trick.\n //\n // Note that `0 / 0` can only occur if\n // `a == d` (i.e. the curve is singular).\n const y2 = y.redSqr();\n const rhs = this._mulD(y2).redISub(this.a);\n const lhs = y2.redISub(this.one);\n\n return lhs.redDivSqrt(rhs);\n }\n\n solveY2(x) {\n assert(x instanceof BN);\n\n // y^2 = (a * x^2 - 1) / (d * x^2 - 1)\n const x2 = x.redSqr();\n const lhs = this._mulA(x2).redISub(this.one);\n const rhs = this._mulD(x2).redISub(this.one);\n const y2 = lhs.redDiv(rhs);\n\n return y2;\n }\n\n solveY(x) {\n // Optimize with inverse square root trick.\n //\n // Note that `0 / 0` can only occur if\n // `a == d` (i.e. the curve is singular).\n const x2 = x.redSqr();\n const lhs = this._mulA(x2).redISub(this.one);\n const rhs = this._mulD(x2).redISub(this.one);\n\n return lhs.redDivSqrt(rhs);\n }\n\n validate(point) {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n // Page 11, Section 6.\n assert(point instanceof EdwardsPoint);\n\n // Z1 = 1\n if (point.zOne) {\n // a * x^2 + y^2 = 1 + d * x^2 * y^2\n const x2 = point.x.redSqr();\n const y2 = point.y.redSqr();\n const dxy = this._mulD(x2).redMul(y2);\n const lhs = this._mulA(x2).redIAdd(y2);\n const rhs = this.one.redAdd(dxy);\n const tz = point.t;\n const xy = point.x.redMul(point.y);\n\n return lhs.eq(rhs) && tz.eq(xy);\n }\n\n // (a * x^2 + y^2) * z^2 = z^4 + d * x^2 * y^2\n const x2 = point.x.redSqr();\n const y2 = point.y.redSqr();\n const z2 = point.z.redSqr();\n const z4 = z2.redSqr();\n const dxy = this._mulD(x2).redMul(y2);\n const lhs = this._mulA(x2).redIAdd(y2).redMul(z2);\n const rhs = z4.redIAdd(dxy);\n const tz = point.t.redMul(point.z);\n const xy = point.x.redMul(point.y);\n\n return lhs.eq(rhs) && tz.eq(xy);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n pointFromY(y, sign = null) {\n assert(y instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!y.red)\n y = y.toRed(this.red);\n\n const x = this.solveX(y);\n\n if (sign != null) {\n if (x.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (x.redIsOdd() !== sign)\n x.redINeg();\n }\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve, invert = false) {\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n // Definition 2.1, Page 3, Section 2.\n assert(curve instanceof Curve);\n assert(typeof invert === 'boolean');\n\n if (!curve.p.eq(this.p))\n return false;\n\n // E(a,d) <-> E(a,b)\n if (curve.type === 'short')\n return curve.isIsomorphic(this);\n\n // E(a,d) <-> M(A,B)\n // E(a,d) <-> M(-A,-B)\n if (curve.type === 'mont') {\n // A * (a - d) = 2 * (a + d)\n const a = this.field(curve.a);\n\n let apd, amd;\n\n if (invert) {\n apd = this.d.redAdd(this.a);\n amd = this.d.redSub(this.a);\n } else {\n apd = this.a.redAdd(this.d);\n amd = this.a.redSub(this.d);\n }\n\n return a.redMul(amd).eq(apd.redIMuln(2));\n }\n\n // E(a,d) <-> E(a',a'd/a)\n if (curve.type === 'edwards') {\n // a' * d = a * d'\n const a = this.field(curve.a);\n const d = this.field(curve.d);\n\n return this.a.redMul(d).eq(a.redMul(this.d));\n }\n\n return false;\n }\n\n isIsogenous(curve) {\n // Check for the 4-isogenies described by Hamburg:\n // https://moderncrypto.org/mail-archive/curves/2016/000806.html\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n // E(1,d) <-> M(2-4d,1)\n if (curve.type === 'mont') {\n if (!this.a.eq(this.one))\n return false;\n\n const a = this.field(curve.a);\n const b = this.field(curve.b);\n const d24 = this.two.redSub(this.d.redMuln(4));\n\n return a.eq(d24) && b.eq(this.one);\n }\n\n // E(a,d) <-> E(-a,d-a)\n if (curve.type === 'edwards') {\n const a = this.field(curve.a);\n const d = this.field(curve.d);\n\n return a.eq(this.a.redNeg())\n && d.eq(this.d.redSub(this.a));\n }\n\n return false;\n }\n\n pointFromShort(point) {\n // [TWISTEQ] Section 1.\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,b)->E(a',d'):\n //\n // x' = (6 * x - a' - d') / (6 * y)\n // y' = (12 * x - 5 * a' + d') / (12 * x + a' - 5 * d')\n //\n // Undefined for x = (5 * d' - a') / 12 or y = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - ((a' + d') / 6, 0) -> (0, -1)\n // - ((5 * d' - a') / 12, (d' - a') / 4 * sqrt(d')) -> (sqrt(1/d'), oo)\n //\n // Unexceptional Cases:\n // - ((5 * a' - d') / 12, (a' - d') / 4 * sqrt(a')) -> (sqrt(1/a'), 0)\n if (point.isInfinity())\n return this.point();\n\n if (point.y.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const {a, d} = this;\n const [u2, u3] = this._scale(point.curve);\n const a5 = a.redMuln(5);\n const d5 = d.redMuln(5);\n const x = this.field(point.x).redMul(u2);\n const y = this.field(point.y).redMul(u3);\n const x6 = x.redMuln(6);\n const x12 = x.redMuln(12);\n const xx = x6.redSub(a).redISub(d);\n const xz = y.redMuln(6);\n const yy = x12.redSub(a5).redIAdd(d);\n const yz = x12.redAdd(a).redISub(d5);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [RFC7748] Section 4.1 & 4.2.\n // [MONT3] Page 6, Section 2.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n assert(point instanceof MontPoint);\n assert(point.curve.p.eq(this.p));\n\n // Montgomery `u`, `v`.\n const u = this.field(point.x);\n const v = this.field(point.y);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for M(2-4d,1)->E(1,d):\n //\n // x = 4 * v * (u^2 - 1) / (u^4 - 2 * u^2 + 4 * v^2 + 1)\n // y = -(u^5 - 2 * u^3 - 4 * u * v^2 + u) /\n // (u^5 - 2 * u^2 * v^2 - 2 * u^3 - 2 * v^2 + u)\n //\n // Undefined for u = 0 and v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, 1)\n //\n // Unexceptional Cases:\n // - (-1, +-sqrt(A - 2)) -> (0, 1)\n // - (1, +-sqrt(A + 2)) -> (0, -1)\n //\n // The point (1, v) is invalid on Curve448.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point();\n\n const u2 = u.redSqr();\n const u3 = u2.redMul(u);\n const u4 = u3.redMul(u);\n const u5 = u4.redMul(u);\n const v2 = v.redSqr();\n const a = v.redMuln(4);\n const b = u2.redSub(this.one);\n const c = u2.redMuln(2);\n const d = v2.redMuln(4);\n const e = u3.redIMuln(2);\n const f = u.redMul(v2).redIMuln(4);\n const g = u2.redMul(v2).redIMuln(2);\n const h = v2.redIMuln(2);\n const xx = a.redMul(b);\n const xz = u4.redISub(c).redIAdd(d).redIAdd(this.one);\n const yy = u5.redSub(e).redISub(f).redIAdd(u).redINeg();\n const yz = u5.redISub(g).redISub(e).redISub(h).redIAdd(u);\n\n return this.cpoint(xx, xz, yy, yz).divn(4);\n }\n\n if (this.isIsomorphic(point.curve, true)) {\n // Isomorphic maps for M(-A,-B)->E(a,d):\n //\n // x = +-sqrt((A - 2) / (B * a)) * u / v\n // y = (u + 1) / (u - 1)\n //\n // Undefined for u = 1 or v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, -1)\n // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / d), oo)\n //\n // Unexceptional Cases:\n // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / a), 0)\n //\n // The point (1, v) is invalid on Curve448.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const c = this._scale(point.curve, true);\n const xx = c.redMul(u);\n const xz = v;\n const yy = u.redAdd(this.one);\n const yz = u.redSub(this.one);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n if (this.isIsomorphic(point.curve, false)) {\n // Isomorphic maps for M(A,B)->E(a,d):\n //\n // x = +-sqrt((A + 2) / (B * a)) * u / v\n // y = (u - 1) / (u + 1)\n //\n // Undefined for u = -1 or v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, -1)\n // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / d), oo)\n //\n // Unexceptional Cases:\n // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / a), 0)\n //\n // The point (-1, v) is invalid on Curve25519.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const c = this._scale(point.curve, false);\n const xx = c.redMul(u);\n const xz = v;\n const yy = u.redSub(this.one);\n const yz = u.redAdd(this.one);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n // [ISOGENY] Page 2, Section 2.\n assert(point instanceof EdwardsPoint);\n assert(point.curve.p.eq(this.p));\n\n // Edwards `x`, `y`, `z`, `t`.\n const a = this.field(point.curve.a);\n const x = this.field(point.x);\n const y = this.field(point.y);\n const z = this.field(point.z);\n const t = this.field(point.t);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for E(a,d)<->E(-a,d-a):\n //\n // x' = (2 * x * y) / (y^2 - a * x^2)\n // y' = (y^2 + a * x^2) / (2 - y^2 - a * x^2)\n //\n // Undefined for y^2 - a * x^2 = 0\n // or y^2 + a * x^2 = 2.\n const xy = x.redMul(y);\n const x2 = x.redSqr();\n const y2 = y.redSqr();\n const z2 = z.redSqr();\n const ax2 = a.redMul(x2);\n const xx = xy.redIMuln(2);\n const xz = y2.redSub(ax2);\n const yy = y2.redAdd(ax2);\n const yz = z2.redIMuln(2).redISub(yy);\n const p = this.cpoint(xx, xz, yy, yz);\n\n return !this.twisted ? p.divn(4) : p;\n }\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for E(a,d)<->E(a',a'd/a):\n //\n // x' = +-sqrt(a / a') * x\n // y' = y\n //\n // Undefined when (a / a') is not square.\n const c = this._scale(point.curve);\n const nx = c.redMul(x);\n const ny = y;\n const nz = z;\n const nt = c.redMul(t);\n\n return this.point(nx, ny, nz, nt);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u, curve = null) {\n assert(u instanceof BN);\n assert(u.red === this.red);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n const u0 = curve.field(u);\n const p0 = curve.pointFromUniform(u0);\n\n return this.pointFromMont(p0);\n }\n\n pointToUniform(p, hint, curve = null) {\n // Convert an edwards point to a field\n // element by inverting the elligator2 map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof EdwardsPoint);\n assert((hint >>> 0) === hint);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n // Add a random torsion component.\n const i = ((hint >> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n // Convert and invert.\n const p0 = curve.pointFromEdwards(q);\n const u0 = curve.pointToUniform(p0, hint & 15);\n\n return this.field(u0);\n }\n\n pointFromHash(bytes, pake, curve = null) {\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n const p0 = curve.pointFromHash(bytes, pake);\n\n return this.pointFromMont(p0);\n }\n\n pointToHash(p, subgroup, rng, curve = null) {\n assert(p instanceof EdwardsPoint);\n assert((subgroup >>> 0) === subgroup);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n // Add a random torsion component.\n const i = subgroup % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n // Convert and invert.\n const p0 = curve.pointFromEdwards(q);\n\n return curve.pointToHash(p0, 0, rng);\n }\n\n decodePoint(bytes) {\n return EdwardsPoint.decode(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromEdwards(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, invert, sign = null) {\n const [a, b] = this._mont(b0, invert);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = this._scale(curve, invert);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromEdwards(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, sign = null) {\n const [a, d] = this._edwards(a0);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromEdwards(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return EdwardsPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n\n json.a = this.a.fromRed().toJSON();\n json.d = this.d.fromRed().toJSON();\n\n if (!this.s.isZero())\n json.s = this.s.fromRed().toJSON();\n\n return json;\n }\n}\n\n/**\n * EdwardsPoint\n */\n\nclass EdwardsPoint extends Point {\n constructor(curve, x, y, z, t) {\n assert(curve instanceof EdwardsCurve);\n\n super(curve, types.EXTENDED);\n\n this.x = this.curve.zero;\n this.y = this.curve.one;\n this.z = this.curve.one;\n this.t = this.curve.zero;\n this.zOne = true;\n\n if (x != null)\n this._init(x, y, z, t);\n }\n\n _init(x, y, z, t) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n assert(z == null || (z instanceof BN));\n assert(t == null || (t instanceof BN));\n\n this.x = x;\n this.y = y;\n this.z = z || this.curve.one;\n this.t = t || null;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n if (this.t && !this.t.red)\n this.t = this.t.toRed(this.curve.red);\n\n this.zOne = this.z.eq(this.curve.one);\n\n this._check();\n\n if (!this.t) {\n this.t = this.x.redMul(this.y);\n if (!this.zOne)\n this.t = this.t.redDiv(this.z);\n }\n }\n\n _check() {\n // In order to achieve complete\n // addition formulas, `a` must\n // be a square (always the case\n // for a=1), and `d` must be a\n // non-square.\n //\n // If this is not the case, the\n // addition formulas may have\n // exceptional cases where Z3=0.\n //\n // In particular, this can occur\n // when: Q*h = -P*h and Q != -P.\n //\n // This is assuming 4-torsion is\n // involved (the 4-torsion point\n // is _not_ representable when\n // `d` is square).\n if (this.z.isZero())\n throw new Error('Invalid point.');\n }\n\n clone() {\n return this.curve.point(this.x, this.y, this.z, this.t);\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#scaling-z\n // 1I + 2M (+ 1M if extended)\n\n // Z1 = 1\n if (this.zOne)\n return this;\n\n // A = 1 / Z1\n const a = this.z.redInvert();\n\n // X3 = X1 * A\n this.x = this.x.redMul(a);\n\n // Y3 = Y1 * A\n this.y = this.y.redMul(a);\n\n // T3 = T1 * A\n this.t = this.t.redMul(a);\n\n // Z3 = 1\n this.z = this.curve.one;\n this.zOne = true;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // X3 = X1 * A\n const nx = this.x.redMul(a);\n\n // Y3 = Y1 * A\n const ny = this.y.redMul(a);\n\n // Z3 = Z1 * A\n const nz = this.z.redMul(a);\n\n // T3 = T1 * A\n const nt = this.t.redMul(a);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n neg() {\n // -(X1, Y1, Z1, T1) = (-X1, Y1, Z1, -T1)\n const nx = this.x.redNeg();\n const ny = this.y;\n const nz = this.z;\n const nt = this.t.redNeg();\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n add(p) {\n assert(p instanceof EdwardsPoint);\n\n // P = O\n if (this.isInfinity())\n return p;\n\n // Q = O\n if (p.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.zOne)\n return p._add(this);\n\n return this._add(p);\n }\n\n _add(p) {\n // a = -1\n if (this.curve.mOneA)\n return this._addM1(p);\n\n return this._addA(p);\n }\n\n _addM1(p) {\n // Assumes a = -1.\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-3\n // 8M + 8A + 1*k + 1*2\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-madd-2008-hwcd-3\n // 7M + 8A + 1*k + 1*2\n\n // A = (Y1 - X1) * (Y2 - X2)\n const a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n\n // B = (Y1 + X1) * (Y2 + X2)\n const b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n\n // C = T1 * k * T2\n const c = this.t.redMul(this.curve.k).redMul(p.t);\n\n // D = Z1 * 2 * Z2\n const d = p.zOne ? this.z.redAdd(this.z) : this.z.redMul(p.z).redIMuln(2);\n\n // E = B - A\n const e = b.redSub(a);\n\n // F = D - C\n const f = d.redSub(c);\n\n // G = D + C\n const g = d.redIAdd(c);\n\n // H = B + A\n const h = b.redIAdd(a);\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n _addA(p) {\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd\n // 9M + 7A + 1*a + 1*d\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-madd-2008-hwcd\n // 8M + 7A + 1*a + 1*d\n\n // A = X1 * X2\n const a = this.x.redMul(p.x);\n\n // B = Y1 * Y2\n const b = this.y.redMul(p.y);\n\n // C = T1 * d * T2\n const c = this.curve._mulD(this.t).redMul(p.t);\n\n // D = Z1 * Z2\n const d = p.zOne ? this.z.clone() : this.z.redMul(p.z);\n\n // + XYXY = (X1 + Y1) * (X2 + Y2)\n const xyxy = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y));\n\n // E = (X1 + Y1) * (X2 + Y2) - A - B\n const e = xyxy.redISub(a).redISub(b);\n\n // F = D - C\n const f = d.redSub(c);\n\n // G = D + C\n const g = d.redIAdd(c);\n\n // H = B - a * A\n const h = b.redISub(this.curve._mulA(a));\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n dbl() {\n // P = O\n if (this.isInfinity())\n return this;\n\n return this._dbl();\n }\n\n _dbl() {\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd\n // 4M + 4S + 6A + 1*a + 1*2\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-mdbl-2008-hwcd\n // 3M + 4S + 7A + 1*a + 1*2\n\n // A = X1^2\n const a = this.x.redSqr();\n\n // B = Y1^2\n const b = this.y.redSqr();\n\n // C = 2 * Z1^2\n const c = this.zOne ? this.curve.two : this.z.redSqr().redIMuln(2);\n\n // D = a * A\n const d = this.curve._mulA(a);\n\n // E = (X1 + Y1)^2 - A - B\n const e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n\n // G = D + B\n const g = d.redAdd(b);\n\n // F = G - C\n const f = g.redSub(c);\n\n // H = D - B\n const h = d.redISub(b);\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n getX() {\n this.normalize();\n return this.x.fromRed();\n }\n\n getY() {\n this.normalize();\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof EdwardsPoint);\n assert(!this.z.isZero());\n assert(!p.z.isZero());\n\n // P = Q\n if (this === p)\n return true;\n\n // Z1 = Z2\n if (this.z.eq(p.z)) {\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n // X1 * Z2 = X2 * Z1\n const x1 = this.x.redMul(p.z);\n const x2 = p.x.redMul(this.z);\n\n if (!x1.eq(x2))\n return false;\n\n const y1 = this.y.redMul(p.z);\n const y2 = p.y.redMul(this.z);\n\n return y1.eq(y2);\n }\n\n cmp(point) {\n assert(point instanceof EdwardsPoint);\n\n return this.order().cmp(point.order())\n || this.getY().cmp(point.getY())\n || this.getX().cmp(point.getX());\n }\n\n isInfinity() {\n assert(!this.z.isZero());\n\n // X1 = 0\n if (!this.x.isZero())\n return false;\n\n // Y1 = Z1\n return this.y.eq(this.z);\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.x.isZero();\n }\n\n isOdd() {\n this.normalize();\n return this.x.redIsOdd();\n }\n\n isEven() {\n this.normalize();\n return this.x.redIsEven();\n }\n\n toP() {\n return this.normalize();\n }\n\n toJ() {\n return this;\n }\n\n encode() {\n // [RFC8032] Section 5.1.2.\n const y = this.getY();\n\n // Note: `x` normalized from `getY()` call.\n y.setn(this.curve.signBit, this.x.redIsOdd());\n\n return this.curve.encodeAdjusted(y);\n }\n\n static decode(curve, bytes) {\n // [RFC8032] Section 5.1.3.\n assert(curve instanceof EdwardsCurve);\n\n const y = curve.decodeAdjusted(bytes);\n const sign = y.testn(curve.signBit) !== 0;\n\n y.setn(curve.signBit, 0);\n\n if (y.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromY(y, sign);\n }\n\n toJSON(pre) {\n if (this.isInfinity())\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n if (pre === true && this.pre)\n return [x, y, this.pre.toJSON()];\n\n return [x, y];\n }\n\n toPretty() {\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof EdwardsCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n const point = curve.point(x, y);\n\n if (json.length > 2 && json[2] != null)\n point.pre = Precomp.fromJSON(point, json[2]);\n\n return point;\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * Precomp\n */\n\nclass Precomp {\n constructor() {\n this.naf = null;\n this.windows = null;\n this.doubles = null;\n this.blinding = null;\n this.beta = null;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const out = new this.constructor();\n\n if (this.naf)\n out.naf = this.naf.map(func);\n\n if (this.doubles)\n out.doubles = this.doubles.map(func);\n\n return out;\n }\n\n toJSON() {\n return {\n naf: this.naf ? this.naf.toJSON() : null,\n windows: this.windows ? this.windows.toJSON() : null,\n doubles: this.doubles ? this.doubles.toJSON() : null,\n blinding: this.blinding ? this.blinding.toJSON() : undefined\n };\n }\n\n fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n\n if (json.naf != null)\n this.naf = NAF.fromJSON(point, json.naf);\n\n if (json.windows != null)\n this.windows = Windows.fromJSON(point, json.windows);\n\n if (json.doubles != null)\n this.doubles = Doubles.fromJSON(point, json.doubles);\n\n if (json.blinding != null)\n this.blinding = Blinding.fromJSON(point, json.blinding);\n\n return this;\n }\n\n static fromJSON(point, json) {\n return new this().fromJSON(point, json);\n }\n}\n\n/**\n * NAF\n */\n\nclass NAF {\n constructor(width, points) {\n this.width = width;\n this.points = points;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const {width} = this;\n const points = [];\n\n for (const point of this.points)\n points.push(func(point));\n\n return new this.constructor(width, points);\n }\n\n toJSON() {\n return {\n width: this.width,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.width >>> 0) === json.width);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {width} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(width, points);\n }\n}\n\n/**\n * Windows\n */\n\nclass Windows {\n constructor(width, bits, points) {\n this.width = width;\n this.bits = bits;\n this.points = points;\n }\n\n toJSON() {\n return {\n width: this.width,\n bits: this.bits,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.width >>> 0) === json.width);\n assert((json.bits >>> 0) === json.bits);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {width, bits} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(width, bits, points);\n }\n}\n\n/**\n * Doubles\n */\n\nclass Doubles {\n constructor(step, points) {\n this.step = step;\n this.points = points;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const {step} = this;\n const points = [];\n\n for (const point of this.points)\n points.push(func(point));\n\n return new this.constructor(step, points);\n }\n\n toJSON() {\n return {\n step: this.step,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.step >>> 0) === json.step);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {step} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(step, points);\n }\n}\n\n/**\n * Blinding\n */\n\nclass Blinding {\n constructor(blind, unblind) {\n this.blind = blind;\n this.unblind = unblind;\n }\n\n toJSON() {\n return {\n blind: this.blind.toJSON(),\n unblind: this.unblind.toJSON()\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n\n const {curve} = point;\n const blind = BN.fromJSON(json.blind);\n const unblind = curve.pointFromJSON(json.unblind);\n\n return new this(blind, unblind);\n }\n}\n\n/**\n * Endo\n */\n\nclass Endo {\n constructor(beta, lambda, basis, pre) {\n this.beta = beta;\n this.lambda = lambda;\n this.basis = basis;\n this.pre = pre;\n }\n\n toJSON() {\n return {\n beta: this.beta.fromRed().toJSON(),\n lambda: this.lambda.toJSON(),\n basis: [\n this.basis[0].toJSON(),\n this.basis[1].toJSON()\n ],\n pre: [\n this.pre[0],\n this.pre[1].toJSON(),\n this.pre[2].toJSON()\n ]\n };\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof Curve);\n assert(json && typeof json === 'object');\n assert(Array.isArray(json.basis));\n assert(Array.isArray(json.pre));\n assert(json.basis.length === 2);\n assert(json.pre.length === 3);\n assert((json.pre[0] >>> 0) === json.pre[0]);\n\n const beta = BN.fromJSON(json.beta).toRed(curve.red);\n const lambda = BN.fromJSON(json.lambda);\n\n const basis = [\n Vector.fromJSON(json.basis[0]),\n Vector.fromJSON(json.basis[1])\n ];\n\n const pre = [\n json.pre[0],\n BN.fromJSON(json.pre[1]),\n BN.fromJSON(json.pre[2])\n ];\n\n return new this(beta, lambda, basis, pre);\n }\n}\n\n/**\n * Vector\n */\n\nclass Vector {\n constructor(a, b) {\n this.a = a;\n this.b = b;\n }\n\n toJSON() {\n return {\n a: this.a.toJSON(),\n b: this.b.toJSON()\n };\n }\n\n static fromJSON(json) {\n assert(json && typeof json === 'object');\n\n const a = BN.fromJSON(json.a);\n const b = BN.fromJSON(json.b);\n\n return new this(a, b);\n }\n}\n\n/**\n * P192\n * https://tinyurl.com/fips-186-2 (page 29)\n * https://tinyurl.com/fips-186-3 (page 88)\n */\n\nclass P192 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P192',\n ossl: 'prime192v1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'p192',\n // 2^192 - 2^64 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff ffffffff'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff fffffffc'],\n b: ['64210519 e59c80e7 0fa7e9ab 72243049',\n 'feb8deec c146b9b1'],\n n: ['ffffffff ffffffff ffffffff 99def836',\n '146bc9b1 b4d22831'],\n h: '1',\n // Icart\n z: '-5',\n g: [\n ['188da80e b03090f6 7cbf20eb 43a18800',\n 'f4ff0afd 82ff1012'],\n ['07192b95 ffc8da78 631011ed 6b24cdd5',\n '73f977a1 1e794811'],\n pre\n ]\n });\n }\n}\n\n/**\n * P224\n * https://tinyurl.com/fips-186-2 (page 30)\n * https://tinyurl.com/fips-186-3 (page 88)\n */\n\nclass P224 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P224',\n ossl: 'secp224r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'p224',\n // 2^224 - 2^96 + 1 (1 mod 16)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n '00000000 00000000 00000001'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff ffffffff fffffffe'],\n b: ['b4050a85 0c04b3ab f5413256 5044b0b7',\n 'd7bfd8ba 270b3943 2355ffb4'],\n n: ['ffffffff ffffffff ffffffff ffff16a2',\n 'e0b8f03e 13dd2945 5c5c2a3d'],\n h: '1',\n // SSWU\n z: '1f',\n g: [\n ['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3',\n '56c21122 343280d6 115c1d21'],\n ['bd376388 b5f723fb 4c22dfe6 cd4375a0',\n '5a074764 44d58199 85007e34'],\n pre\n ]\n });\n }\n}\n\n/**\n * P256\n * https://tinyurl.com/fips-186-2 (page 31)\n * https://tinyurl.com/fips-186-3 (page 89)\n */\n\nclass P256 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P256',\n ossl: 'prime256v1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: null,\n // 2^256 - 2^224 + 2^192 + 2^96 - 1 (= 3 mod 4)\n p: ['ffffffff 00000001 00000000 00000000',\n '00000000 ffffffff ffffffff ffffffff'],\n // -3 mod p\n a: ['ffffffff 00000001 00000000 00000000',\n '00000000 ffffffff ffffffff fffffffc'],\n b: ['5ac635d8 aa3a93e7 b3ebbd55 769886bc',\n '651d06b0 cc53b0f6 3bce3c3e 27d2604b'],\n n: ['ffffffff 00000000 ffffffff ffffffff',\n 'bce6faad a7179e84 f3b9cac2 fc632551'],\n h: '1',\n // SSWU\n z: '-a',\n g: [\n ['6b17d1f2 e12c4247 f8bce6e5 63a440f2',\n '77037d81 2deb33a0 f4a13945 d898c296'],\n ['4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16',\n '2bce3357 6b315ece cbb64068 37bf51f5'],\n pre\n ]\n });\n }\n}\n\n/**\n * P384\n * https://tinyurl.com/fips-186-2 (page 32)\n * https://tinyurl.com/fips-186-3 (page 89)\n */\n\nclass P384 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P384',\n ossl: 'secp384r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA384',\n prime: null,\n // 2^384 - 2^128 - 2^96 + 2^32 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff 00000000 00000000 ffffffff'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff 00000000 00000000 fffffffc'],\n b: ['b3312fa7 e23ee7e4 988e056b e3f82d19',\n '181d9c6e fe814112 0314088f 5013875a',\n 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'],\n n: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff c7634d81 f4372ddf',\n '581a0db2 48b0a77a ecec196a ccc52973'],\n h: '1',\n // Icart\n z: '-c',\n g: [\n ['aa87ca22 be8b0537 8eb1c71e f320ad74',\n '6e1d3b62 8ba79b98 59f741e0 82542a38',\n '5502f25d bf55296c 3a545e38 72760ab7'],\n ['3617de4a 96262c6f 5d9e98bf 9292dc29',\n 'f8f41dbd 289a147c e9da3113 b5f0b8c0',\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'],\n pre\n ]\n });\n }\n}\n\n/**\n * P521\n * https://tinyurl.com/fips-186-2 (page 33)\n * https://tinyurl.com/fips-186-3 (page 90)\n */\n\nclass P521 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P521',\n ossl: 'secp521r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA512',\n prime: 'p521',\n // 2^521 - 1 (= 3 mod 4)\n p: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff'],\n // -3 mod p\n a: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'fffffffc'],\n b: ['00000051 953eb961 8e1c9a1f 929a21a0',\n 'b68540ee a2da725b 99b315f3 b8b48991',\n '8ef109e1 56193951 ec7e937b 1652c0bd',\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4',\n '6b503f00'],\n n: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'fffffffa 51868783 bf2f966b 7fcc0148',\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e',\n '91386409'],\n h: '1',\n // SSWU\n z: '-4',\n g: [\n ['000000c6 858e06b7 0404e9cd 9e3ecb66',\n '2395b442 9c648139 053fb521 f828af60',\n '6b4d3dba a14b5e77 efe75928 fe1dc127',\n 'a2ffa8de 3348b3c1 856a429b f97e7e31',\n 'c2e5bd66'],\n ['00000118 39296a78 9a3bc004 5c8a5fb4',\n '2c7d1bd9 98f54449 579b4468 17afbd17',\n '273e662c 97ee7299 5ef42640 c550b901',\n '3fad0761 353c7086 a272c240 88be9476',\n '9fd16650'],\n pre\n ]\n });\n }\n}\n\n/**\n * SECP256K1\n * https://www.secg.org/SEC2-Ver-1.0.pdf (page 15, section 2.7.1)\n * https://www.secg.org/sec2-v2.pdf (page 9, section 2.4.1)\n */\n\nclass SECP256K1 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'SECP256K1',\n ossl: 'secp256k1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'k256',\n // 2^256 - 2^32 - 977 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe fffffc2f'],\n a: '0',\n b: '7',\n n: ['ffffffff ffffffff ffffffff fffffffe',\n 'baaedce6 af48a03b bfd25e8c d0364141'],\n h: '1',\n // SVDW\n z: '1',\n // sqrt(-3)\n c: ['0a2d2ba9 3507f1df 233770c2 a797962c',\n 'c61f6d15 da14ecd4 7d8d27ae 1cd5f852'],\n g: [\n ['79be667e f9dcbbac 55a06295 ce870b07',\n '029bfcdb 2dce28d9 59f2815b 16f81798'],\n ['483ada77 26a3c465 5da4fbfc 0e1108a8',\n 'fd17b448 a6855419 9c47d08f fb10d4b8'],\n pre\n ],\n // Precomputed endomorphism.\n endo: {\n beta: ['7ae96a2b 657c0710 6e64479e ac3434e9',\n '9cf04975 12f58995 c1396c28 719501ee'],\n lambda: ['5363ad4c c05c30e0 a5261c02 8812645a',\n '122e22ea 20816678 df02967c 1b23bd72'],\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3'\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15'\n }\n ],\n pre: [\n 384,\n ['3086d221 a7d46bcd e86c90e4 9284eb15',\n '3daa8a14 71e8ca7f e893209a 45dbb031'],\n ['-',\n 'e4437ed6 010e8828 6f547fa9 0abfe4c4',\n '221208ac 9df506c6 1571b4ae 8ac47f71']\n ]\n }\n });\n }\n}\n\n/**\n * BRAINPOOLP256\n * https://tools.ietf.org/html/rfc5639#section-3.4\n */\n\nclass BRAINPOOLP256 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP256',\n ossl: 'brainpoolP256r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: null,\n // (= 3 mod 4)\n p: ['a9fb57db a1eea9bc 3e660a90 9d838d72',\n '6e3bf623 d5262028 2013481d 1f6e5377'],\n a: ['7d5a0975 fc2c3057 eef67530 417affe7',\n 'fb8055c1 26dc5c6c e94a4b44 f330b5d9'],\n b: ['26dc5c6c e94a4b44 f330b5d9 bbd77cbf',\n '95841629 5cf7e1ce 6bccdc18 ff8c07b6'],\n n: ['a9fb57db a1eea9bc 3e660a90 9d838d71',\n '8c397aa3 b561a6f7 901e0e82 974856a7'],\n h: '1',\n // Icart\n z: '-2',\n g: [\n ['8bd2aeb9 cb7e57cb 2c4b482f fc81b7af',\n 'b9de27e1 e3bd23c2 3a4453bd 9ace3262'],\n ['547ef835 c3dac4fd 97f8461a 14611dc9',\n 'c2774513 2ded8e54 5c1d54c7 2f046997'],\n pre\n ]\n });\n }\n}\n\n/**\n * BRAINPOOLP384\n * https://tools.ietf.org/html/rfc5639#section-3.6\n */\n\nclass BRAINPOOLP384 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP384',\n ossl: 'brainpoolP384r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA384',\n prime: null,\n // (= 3 mod 4)\n p: ['8cb91e82 a3386d28 0f5d6f7e 50e641df',\n '152f7109 ed5456b4 12b1da19 7fb71123',\n 'acd3a729 901d1a71 87470013 3107ec53'],\n a: ['7bc382c6 3d8c150c 3c72080a ce05afa0',\n 'c2bea28e 4fb22787 139165ef ba91f90f',\n '8aa5814a 503ad4eb 04a8c7dd 22ce2826'],\n b: ['04a8c7dd 22ce2826 8b39b554 16f0447c',\n '2fb77de1 07dcd2a6 2e880ea5 3eeb62d5',\n '7cb43902 95dbc994 3ab78696 fa504c11'],\n n: ['8cb91e82 a3386d28 0f5d6f7e 50e641df',\n '152f7109 ed5456b3 1f166e6c ac0425a7',\n 'cf3ab6af 6b7fc310 3b883202 e9046565'],\n h: '1',\n // SSWU\n z: '-5',\n g: [\n ['1d1c64f0 68cf45ff a2a63a81 b7c13f6b',\n '8847a3e7 7ef14fe3 db7fcafe 0cbd10e8',\n 'e826e034 36d646aa ef87b2e2 47d4af1e'],\n ['8abe1d75 20f9c2a4 5cb1eb8e 95cfd552',\n '62b70b29 feec5864 e19c054f f9912928',\n '0e464621 77918111 42820341 263c5315'],\n pre\n ]\n });\n }\n}\n\n/**\n * BRAINPOOLP512\n * https://tools.ietf.org/html/rfc5639#section-3.7\n */\n\nclass BRAINPOOLP512 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP512',\n ossl: 'brainpoolP512r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA512',\n prime: null,\n // (= 3 mod 4)\n p: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07',\n 'cb308db3 b3c9d20e d6639cca 70330871',\n '7d4d9b00 9bc66842 aecda12a e6a380e6',\n '2881ff2f 2d82c685 28aa6056 583a48f3'],\n a: ['7830a331 8b603b89 e2327145 ac234cc5',\n '94cbdd8d 3df91610 a83441ca ea9863bc',\n '2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5',\n '7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca'],\n b: ['3df91610 a83441ca ea9863bc 2ded5d5a',\n 'a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7',\n '2bf2c7b9 e7c1ac4d 77fc94ca dc083e67',\n '984050b7 5ebae5dd 2809bd63 8016f723'],\n n: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07',\n 'cb308db3 b3c9d20e d6639cca 70330870',\n '553e5c41 4ca92619 41866119 7fac1047',\n '1db1d381 085ddadd b5879682 9ca90069'],\n h: '1',\n // Icart\n z: '7',\n g: [\n ['81aee4bd d82ed964 5a21322e 9c4c6a93',\n '85ed9f70 b5d916c1 b43b62ee f4d0098e',\n 'ff3b1f78 e2d0d48d 50d1687b 93b97d5f',\n '7c6d5047 406a5e68 8b352209 bcb9f822'],\n ['7dde385d 566332ec c0eabfa9 cf7822fd',\n 'f209f700 24a57b1a a000c55b 881f8111',\n 'b2dcde49 4a5f485e 5bca4bd8 8a2763ae',\n 'd1ca2b2f a8f05406 78cd1e0f 3ad80892'],\n pre\n ]\n });\n }\n}\n\n/**\n * X25519\n * https://tools.ietf.org/html/rfc7748#section-4.1\n */\n\nclass X25519 extends MontCurve {\n constructor() {\n super({\n id: 'X25519',\n ossl: 'X25519',\n type: 'mont',\n endian: 'le',\n hash: 'SHA512',\n prime: 'p25519',\n // 2^255 - 19 (= 5 mod 8)\n p: ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffed'],\n // 486662\n a: '76d06',\n b: '1',\n n: ['10000000 00000000 00000000 00000000',\n '14def9de a2f79cd6 5812631a 5cf5d3ed'],\n h: '8',\n // Elligator 2\n z: '2',\n g: [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000009'],\n // See: https://www.rfc-editor.org/errata/eid4730\n ['5f51e65e 475f794b 1fe122d3 88b72eb3',\n '6dc2b281 92839e4d d6163a5d 81312c14']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001'],\n ['6be4f497 f9a9c2af c21fa77a d7f4a6ef',\n '635a11c7 284a9363 e9a248ef 9c884415']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001'],\n ['141b0b68 06563d50 3de05885 280b5910',\n '9ca5ee38 d7b56c9c 165db710 6377bbd8']\n ],\n [\n ['57119fd0 dd4e22d8 868e1c58 c45c4404',\n '5bef839c 55b1d0b1 248c50a3 bc959c5f'],\n ['68c59389 3d458e64 31c6ca00 45fb5015',\n '20a44346 8eaa68dd 0f103842 048065b7']\n ],\n [\n ['57119fd0 dd4e22d8 868e1c58 c45c4404',\n '5bef839c 55b1d0b1 248c50a3 bc959c5f'],\n ['173a6c76 c2ba719b ce3935ff ba04afea',\n 'df5bbcb9 71559722 f0efc7bd fb7f9a36']\n ],\n [\n ['00b8495f 16056286 fdb1329c eb8d09da',\n '6ac49ff1 fae35616 aeb8413b 7c7aebe0'],\n ['3931c129 569e83a5 29482c14 e628b457',\n '933bfc29 ed801b4d 68871483 92507b1a']\n ],\n [\n ['00b8495f 16056286 fdb1329c eb8d09da',\n '6ac49ff1 fae35616 aeb8413b 7c7aebe0'],\n ['46ce3ed6 a9617c5a d6b7d3eb 19d74ba8',\n '6cc403d6 127fe4b2 9778eb7c 6daf84d3']\n ]\n ]\n });\n }\n}\n\n/**\n * X448\n * https://tools.ietf.org/html/rfc7748#section-4.2\n */\n\nclass X448 extends MontCurve {\n constructor() {\n super({\n id: 'X448',\n ossl: 'X448',\n type: 'mont',\n endian: 'le',\n hash: 'SHAKE256',\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n // 156326\n a: '262a6',\n b: '1',\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000005'],\n ['7d235d12 95f5b1f6 6c98ab6e 58326fce',\n 'cbae5d34 f55545d0 60f75dc2 8df3f6ed',\n 'b8027e23 46430d21 1312c4b1 50677af7',\n '6fd7223d 457b5b1a']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['ba4d3a08 29b6112f 8812e51b a0bb2abe',\n 'bc1cb08e b48e5569 36ba50fd d2e7d68a',\n 'f8cb3216 0522425b 3f990812 abbe635a',\n 'd37a21e1 7551b193']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['45b2c5f7 d649eed0 77ed1ae4 5f44d541',\n '43e34f71 4b71aa96 c945af01 2d182975',\n '0734cde9 faddbda4 c066f7ed 54419ca5',\n '2c85de1e 8aae4e6c']\n ]\n ]\n });\n }\n}\n\n/**\n * MONT448\n * Isomorphic to Ed448-Goldilocks.\n */\n\nclass MONT448 extends MontCurve {\n constructor() {\n super({\n id: 'MONT448',\n ossl: null,\n type: 'mont',\n endian: 'le',\n hash: 'SHAKE256',\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n // -78160 / -39082 mod p\n a: ['b2cf97d2 d43459a9 31ed36b1 fc4e3cb5',\n '5d93f8d2 22746997 60ccffc6 49961ed6',\n 'c5b05fca c24864ed 6fb59697 931b78da',\n '84ddecd8 ca2b5cfb'],\n b: '1',\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['ac0d24cc c6c75cb0 eb71f81e 7a6edf51',\n '48e88aee 009a2a24 e795687e c28e125a',\n '3e6730a6 0d46367b aa7fe99d 152128dc',\n '41321bc7 7817f059'],\n ['5a4437f6 80c0d0db 9b061276 d5d0ffcc',\n 'e786ff33 b6a53d30 98746425 82e66f09',\n '4433dae7 7244a6e2 6b11e905 7228f483',\n '556c41a5 913f55fe']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['bec92fd0 6da2acf2 b4e261e8 7cef0d34',\n '22e75c18 3c589857 b71924e5 73c2f9ce',\n 'e18da5f2 466e2f39 3c2eedf0 f105a60a',\n 'b40c717d 4f1e1fd7']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['4136d02f 925d530d 4b1d9e17 8310f2cb',\n 'dd18a3e7 c3a767a8 48e6db19 8c3d0631',\n '1e725a0d b991d0c6 c3d1120f 0efa59f5',\n '4bf38e82 b0e1e028']\n ]\n ]\n });\n }\n}\n\n/**\n * ED25519\n * https://tools.ietf.org/html/rfc8032#section-5.1\n */\n\nclass ED25519 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ED25519',\n ossl: 'ED25519',\n type: 'edwards',\n endian: 'le',\n hash: 'SHA512',\n prefix: 'SigEd25519 no Ed25519 collisions',\n context: false,\n prime: 'p25519',\n // 2^255 - 19 (= 5 mod 8)\n p: ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffed'],\n a: '-1',\n // -121665 / 121666 mod p\n d: ['52036cee 2b6ffe73 8cc74079 7779e898',\n '00700a4d 4141d8ab 75eb4dca 135978a3'],\n n: ['10000000 00000000 00000000 00000000',\n '14def9de a2f79cd6 5812631a 5cf5d3ed'],\n h: '8',\n // Elligator 2\n z: '2',\n g: [\n ['216936d3 cd6e53fe c0a4e231 fdd6dc5c',\n '692cc760 9525a7b2 c9562d60 8f25d51a'],\n // 4/5\n ['66666666 66666666 66666666 66666666',\n '66666666 66666666 66666666 66666658'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffec']\n ],\n [\n ['2b832480 4fc1df0b 2b4d0099 3dfbd7a7',\n '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['547cdb7f b03e20f4 d4b2ff66 c2042858',\n 'd0bce7f9 52d01b87 3b11e4d8 b5f15f3d'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['1fd5b9a0 06394a28 e9339932 38de4abb',\n '5c193c70 13e5e238 dea14646 c545d14a'],\n ['05fc536d 880238b1 3933c6d3 05acdfd5',\n 'f098eff2 89f4c345 b027b2c2 8f95e826']\n ],\n [\n ['602a465f f9c6b5d7 16cc66cd c721b544',\n 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'],\n ['05fc536d 880238b1 3933c6d3 05acdfd5',\n 'f098eff2 89f4c345 b027b2c2 8f95e826']\n ],\n [\n ['1fd5b9a0 06394a28 e9339932 38de4abb',\n '5c193c70 13e5e238 dea14646 c545d14a'],\n ['7a03ac92 77fdc74e c6cc392c fa53202a',\n '0f67100d 760b3cba 4fd84d3d 706a17c7']\n ],\n [\n ['602a465f f9c6b5d7 16cc66cd c721b544',\n 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'],\n ['7a03ac92 77fdc74e c6cc392c fa53202a',\n '0f67100d 760b3cba 4fd84d3d 706a17c7']\n ]\n ]\n });\n }\n}\n\n/**\n * ISO448\n * https://tools.ietf.org/html/rfc7748#section-4.2\n * https://git.zx2c4.com/goldilocks/tree/_aux/ristretto/ristretto.sage#n658\n */\n\nclass ISO448 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ISO448',\n ossl: null,\n type: 'edwards',\n endian: 'le',\n hash: 'SHAKE256',\n prefix: 'SigEd448',\n context: true,\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n a: '1',\n // 39082 / 39081 mod p\n d: ['d78b4bdc 7f0daf19 f24f38c2 9373a2cc',\n 'ad461572 42a50f37 809b1da3 412a12e7',\n '9ccc9c81 264cfe9a d0809970 58fb61c4',\n '243cc32d baa156b9'],\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['79a70b2b 70400553 ae7c9df4 16c792c6',\n '1128751a c9296924 0c25a07d 728bdc93',\n 'e21f7787 ed697224 9de732f3 8496cd11',\n '69871309 3e9c04fc'],\n // Note: the RFC has this wrong.\n ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 80000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ]\n ]\n });\n }\n}\n\n/**\n * ED448\n * https://tools.ietf.org/html/rfc8032#section-5.2\n */\n\nclass ED448 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ED448',\n ossl: 'ED448',\n type: 'edwards',\n endian: 'le',\n hash: 'SHAKE256',\n prefix: 'SigEd448',\n context: true,\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n a: '1',\n // -39081 mod p\n d: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffff6756'],\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['4f1970c6 6bed0ded 221d15a6 22bf36da',\n '9e146570 470f1767 ea6de324 a3d3a464',\n '12ae1af7 2ab66511 433b80e1 8b00938e',\n '2626a82b c70cc05e'],\n ['693f4671 6eb6bc24 88762037 56c9c762',\n '4bea7373 6ca39840 87789c1e 05a0c2d7',\n '3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad',\n '9808795b f230fa14'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ]\n ]\n });\n }\n}\n\n/*\n * Curve Registry\n */\n\nconst curves = {\n __proto__: null,\n P192,\n P224,\n P256,\n P384,\n P521,\n SECP256K1,\n BRAINPOOLP256,\n BRAINPOOLP384,\n BRAINPOOLP512,\n X25519,\n X448,\n MONT448,\n ED25519,\n ISO448,\n ED448\n};\n\nconst cache = {\n __proto__: null,\n P192: null,\n P224: null,\n P256: null,\n P384: null,\n P521: null,\n SECP256K1: null,\n BRAINPOOLP256: null,\n BRAINPOOLP384: null,\n BRAINPOOLP512: null,\n X25519: null,\n X448: null,\n MONT448: null,\n ED25519: null,\n ISO448: null,\n ED448: null\n};\n\nfunction curve(name, ...args) {\n assert(typeof name === 'string');\n\n const key = name.toUpperCase();\n\n let curve = cache[key];\n\n if (!curve) {\n const Curve = curves[key];\n\n if (!Curve)\n throw new Error(`Curve not found: \"${name}\".`);\n\n curve = new Curve(...args);\n cache[key] = curve;\n }\n\n return curve;\n}\n\nfunction register(name, Curve) {\n assert(typeof name === 'string');\n assert(typeof Curve === 'function');\n\n const key = name.toUpperCase();\n\n if (curves[key])\n throw new Error(`Curve already registered: \"${name}\".`);\n\n curves[key] = Curve;\n cache[key] = null;\n}\n\n/*\n * Scalar Recoding\n */\n\nfunction getNAF(k, width, max) {\n // Computing the width-w NAF of a positive integer.\n //\n // [GECC] Algorithm 3.35, Page 100, Section 3.3.\n //\n // The above document describes a rather abstract\n // method of recoding. The more optimal method\n // below was ported from libsecp256k1.\n assert(k instanceof BN);\n assert(!k.red);\n assert((width >>> 0) === width);\n assert((max >>> 0) === max);\n\n const naf = new Array(max);\n const bits = k.bitLength() + 1;\n const sign = k.sign() | 1;\n\n assert(bits <= max);\n\n for (let i = 0; i < max; i++)\n naf[i] = 0;\n\n let i = 0;\n let carry = 0;\n let word;\n\n while (i < bits) {\n if (k.bit(i) === carry) {\n i += 1;\n continue;\n }\n\n word = k.bits(i, width) + carry;\n carry = (word >> (width - 1)) & 1;\n word -= carry << width;\n\n naf[i] = sign * word;\n\n i += width;\n }\n\n assert(carry === 0);\n\n return naf;\n}\n\nfunction getFixedNAF(k, width, max, step) {\n assert((step >>> 0) === step);\n\n // Recode to NAF.\n const naf = getNAF(k, width, max);\n\n // Translate into more windowed form.\n const len = Math.ceil(naf.length / step);\n const repr = new Array(len);\n\n let i = 0;\n\n for (let j = 0; j < naf.length; j += step) {\n let nafW = 0;\n\n for (let k = j + step - 1; k >= j; k--)\n nafW = (nafW << 1) + naf[k];\n\n repr[i++] = nafW;\n }\n\n assert(i === len);\n\n return repr;\n}\n\nfunction getJSF(k1, k2, max) {\n // Joint sparse form.\n //\n // [GECC] Algorithm 3.50, Page 111, Section 3.3.\n assert(k1 instanceof BN);\n assert(k2 instanceof BN);\n assert(!k1.red);\n assert(!k2.red);\n assert((max >>> 0) === max);\n\n const jsf = [new Array(max), new Array(max)];\n const bits = Math.max(k1.bitLength(), k2.bitLength()) + 1;\n const s1 = k1.sign() | 1;\n const s2 = k2.sign() | 1;\n\n assert(bits <= max);\n\n let d1 = 0;\n let d2 = 0;\n\n for (let i = 0; i < bits; i++) {\n const b1 = k1.bits(i, 3);\n const b2 = k2.bits(i, 3);\n\n // First phase.\n let m14 = ((b1 & 3) + d1) & 3;\n let m24 = ((b2 & 3) + d2) & 3;\n let u1 = 0;\n let u2 = 0;\n\n if (m14 === 3)\n m14 = -1;\n\n if (m24 === 3)\n m24 = -1;\n\n if (m14 & 1) {\n const m8 = ((b1 & 7) + d1) & 7;\n\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n\n if (m24 & 1) {\n const m8 = ((b2 & 7) + d2) & 7;\n\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n\n jsf[0][i] = u1 * s1;\n jsf[1][i] = u2 * s2;\n\n // Second phase.\n if (2 * d1 === 1 + u1)\n d1 = 1 - d1;\n\n if (2 * d2 === 1 + u2)\n d2 = 1 - d2;\n }\n\n for (let i = bits; i < max; i++) {\n jsf[0][i] = 0;\n jsf[1][i] = 0;\n }\n\n return jsf;\n}\n\nfunction getJNAF(c1, c2, max) {\n const jsf = getJSF(c1, c2, max);\n const naf = new Array(max);\n\n // JSF -> NAF conversion.\n for (let i = 0; i < max; i++) {\n const ja = jsf[0][i];\n const jb = jsf[1][i];\n\n naf[i] = jsfIndex[(ja + 1) * 3 + (jb + 1)];\n }\n\n return naf;\n}\n\n/*\n * Helpers\n */\n\nfunction assert(val, msg) {\n if (!val) {\n const err = new Error(msg || 'Assertion failed');\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, assert);\n\n throw err;\n }\n}\n\nfunction wrapErrors(fn) {\n assert(typeof fn === 'function');\n\n try {\n return fn();\n } catch (e) {\n if (e.message === 'X is not a square mod P.'\n || e.message === 'Not invertible.') {\n throw new Error('Invalid point.');\n }\n throw e;\n }\n}\n\nfunction mod(x, y) {\n // Euclidean modulo.\n let r = x % y;\n\n if (r < 0) {\n if (y < 0)\n r -= y;\n else\n r += y;\n }\n\n return r;\n}\n\nfunction cubeRoot(x) {\n assert(x instanceof BN);\n assert(x.red);\n\n const p = x.red.m;\n\n if (p.cmpn(3) <= 0)\n return x.clone();\n\n // p = 2 mod 3\n if (p.modrn(3) === 2) {\n // e = (2 * p - 1) / 3\n const e = p.ushln(1).isubn(1).idivn(3);\n return x.redPow(e);\n }\n\n const mod9 = p.modrn(9);\n\n // p = 4 mod 9\n if (mod9 === 4) {\n // e = (2 * p + 1) / 9\n const e = p.ushln(1).iaddn(1).idivn(9);\n const r = x.redPow(e);\n const c = r.redSqr().redMul(r);\n\n if (!c.eq(x))\n throw new Error('X is not a cube mod P.');\n\n return r;\n }\n\n // p = 7 mod 9\n if (mod9 === 7) {\n // e = (p + 2) / 9\n const e = p.addn(2).idivn(9);\n const r = x.redPow(e);\n const c = r.redSqr().redMul(r);\n\n if (!c.eq(x))\n throw new Error('X is not a cube mod P.');\n\n return r;\n }\n\n throw new Error('Not implemented.');\n}\n\nfunction cubeRoots(x) {\n const r0 = cubeRoot(x);\n\n // p = 1 mod 3\n if (x.red.m.modrn(3) === 1) {\n // Multiply by roots of unity to find other roots.\n const two = new BN(2).toRed(x.red);\n const three = new BN(3).toRed(x.red);\n const i2 = two.redInvert();\n const s1 = three.redNeg().redSqrt().redMul(i2);\n const s2 = s1.redNeg();\n const u1 = s1.redSub(i2);\n const u2 = s2.redSub(i2);\n const r1 = r0.redMul(u1);\n const r2 = r0.redMul(u2);\n\n return [r0, r1, r2];\n }\n\n // p = 2 mod 3 guarantees 1 cube root per element.\n return [r0];\n}\n\nfunction uncube(x) {\n // Find a cube root which is also a quadratic residue.\n for (const root of cubeRoots(x)) {\n if (root.redJacobi() >= 0)\n return root;\n }\n\n throw new Error('X^(1/3) is not a square mod P.');\n}\n\nfunction randomInt(rng) {\n return BN.randomBits(rng, 32).toNumber();\n}\n\nfunction memoize(method, self) {\n const cache = new WeakMap();\n\n return function memoized(curve, invert) {\n const i = invert & 1;\n const item = cache.get(curve);\n\n if (item && item[i] !== null)\n return item[i];\n\n const result = method.call(self, curve, invert);\n\n if (!cache.has(curve))\n cache.set(curve, [null, null]);\n\n cache.get(curve)[i] = result;\n\n return result;\n };\n}\n\nfunction toPretty(x, size) {\n assert(x instanceof BN);\n assert((size >>> 0) === size);\n\n if (size & 7)\n size += 8 - (size & 7);\n\n const str = x.toString(16, size);\n const chunks = [];\n const out = [];\n\n assert((str.length & 7) === 0);\n\n for (let i = 0; i < str.length; i += 8)\n chunks.push(str.slice(i, i + 8));\n\n for (let i = 0; i < chunks.length; i += 4)\n out.push(chunks.slice(i, i + 4).join(' '));\n\n return out;\n}\n\n/*\n * Expose\n */\n\nexports.Curve = Curve;\nexports.Point = Point;\nexports.ShortCurve = ShortCurve;\nexports.ShortPoint = ShortPoint;\nexports.JPoint = JPoint;\nexports.MontCurve = MontCurve;\nexports.MontPoint = MontPoint;\nexports.XPoint = XPoint;\nexports.EdwardsCurve = EdwardsCurve;\nexports.EdwardsPoint = EdwardsPoint;\nexports.curves = curves;\nexports.curve = curve;\nexports.register = register;\n","/*!\n * random.js - random number generator for bcrypto\n * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://wiki.openssl.org/index.php/Random_Numbers\n * https://csrc.nist.gov/projects/random-bit-generation/\n * http://www.pcg-random.org/posts/bounded-rands.html\n * https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/*\n * Constants\n */\n\nconst crypto = global.crypto || global.msCrypto;\nconst HAS_CRYPTO = crypto && typeof crypto.getRandomValues === 'function';\nconst randomValues = HAS_CRYPTO ? crypto.getRandomValues.bind(crypto) : null;\nconst pool = new Uint32Array(16);\nconst MAX_BYTES = 65536;\n\nlet poolPos = 0;\n\n/**\n * Generate pseudo-random bytes.\n * @param {Number} size\n * @returns {Buffer}\n */\n\nfunction randomBytes(size) {\n assert((size >>> 0) === size);\n\n const data = Buffer.alloc(size);\n\n randomFillSync(data, 0, size);\n\n return data;\n}\n\n/**\n * Generate pseudo-random bytes.\n * @param {Buffer} data\n * @param {Number} [off=0]\n * @param {Number} [size=data.length-off]\n * @returns {Buffer}\n */\n\nfunction randomFill(data, off, size) {\n assert(Buffer.isBuffer(data));\n\n if (off == null)\n off = 0;\n\n assert((off >>> 0) === off);\n\n if (size == null)\n size = data.length - off;\n\n assert((size >>> 0) === size);\n assert(off + size <= data.length);\n\n randomFillSync(data, off, size);\n\n return data;\n}\n\n/**\n * Generate a random uint32.\n * @returns {Number}\n */\n\nfunction randomInt() {\n if ((poolPos & 15) === 0) {\n getRandomValues(pool);\n poolPos = 0;\n }\n\n return pool[poolPos++];\n}\n\n/**\n * Generate a random uint32 within a range.\n * @param {Number} min - Inclusive.\n * @param {Number} max - Exclusive.\n * @returns {Number}\n */\n\nfunction randomRange(min, max) {\n assert((min >>> 0) === min);\n assert((max >>> 0) === max);\n assert(max >= min);\n\n const space = max - min;\n\n if (space === 0)\n return min;\n\n const top = -space >>> 0;\n\n let x, r;\n\n do {\n x = randomInt();\n r = x % space;\n } while (x - r > top);\n\n return r + min;\n}\n\n/*\n * Helpers\n */\n\nfunction getRandomValues(array) {\n if (!HAS_CRYPTO)\n throw new Error('Entropy source not available.');\n\n return randomValues(array);\n}\n\nfunction randomFillSync(data, off, size) {\n assert(Buffer.isBuffer(data));\n assert(data.buffer instanceof ArrayBuffer);\n assert((data.byteOffset >>> 0) === data.byteOffset);\n assert((data.byteLength >>> 0) === data.byteLength);\n assert((off >>> 0) === off);\n assert((size >>> 0) === size);\n assert(off + size <= data.byteLength);\n\n if (size > 2 ** 31 - 1)\n throw new RangeError('The value \"size\" is out of range.');\n\n const offset = data.byteOffset + off;\n const array = new Uint8Array(data.buffer, offset, size);\n\n if (array.length > MAX_BYTES) {\n for (let i = 0; i < array.length; i += MAX_BYTES) {\n let j = i + MAX_BYTES;\n\n if (j > array.length)\n j = array.length;\n\n getRandomValues(array.subarray(i, j));\n }\n } else {\n if (array.length > 0)\n getRandomValues(array);\n }\n}\n\n/*\n * Expose\n */\n\nexports.native = 0;\nexports.randomBytes = randomBytes;\nexports.randomFill = randomFill;\nexports.randomInt = randomInt;\nexports.randomRange = randomRange;\n","/*!\n * random.js - random for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/random');\n","/*!\n * eddsa.js - EdDSA for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/elliptic:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/elliptic\n *\n * References:\n *\n * [EDDSA] High-speed high-security signatures\n * D. J. Bernstein, N. Duif, T. Lange, P. Schwabe, B. Yang\n * https://ed25519.cr.yp.to/ed25519-20110926.pdf\n *\n * [RFC8032] Edwards-Curve Digital Signature Algorithm (EdDSA)\n * S. Josefsson, I. Liusvaara\n * https://tools.ietf.org/html/rfc8032\n *\n * Implementation Notes:\n *\n * - In contrast to the ECDSA backend, we allow points at\n * infinity (in all functions).\n *\n * - Mike Hamburg's Ed448-Goldilocks rejects both infinity as\n * well as the torsion point (0, -1). We do not replicate\n * this behavior.\n *\n * - For Ed25519, we do \"cofactor-less\" verification by default.\n * This means torsion components will affect the result of the\n * verification.\n *\n * - For Ed448, we do cofactor verification by default to mimic\n * OpenSSL and Mike Hamburg's Ed448-Goldilocks implementation.\n *\n * - `verifySingle`/`verifyBatch` do cofactor verification. Do\n * not use `verifyBatch` expecting the same results as the\n * regular `verify` call[1]. This will not be the case for\n * Ed25519.\n *\n * - All functions are completely unaware of points of small\n * order and torsion components (in other words, points will\n * not be explicitly checked for this, anywhere).\n *\n * - `deriveWithScalar` and `exchangeWithScalar` automatically\n * clamp scalars before multiplying (meaning torsion components\n * are removed from the result and points of small order will\n * be normalized to infinity).\n *\n * - The HD function, `publicKeyTweakMul`, _does not_ clamp\n * automatically. It is possible to end up with a torsion\n * component in the resulting point (assuming the input\n * point had one).\n *\n * - Ed448-Goldilocks is 4-isogenous to Curve448. This means\n * that when converting to Curve448, small order points will\n * be normalized to (0, 0). When converting back to Ed448,\n * any small order points will be normalized to infinity,\n * and any torsion components will be removed completely.\n * Also note that when converting back, the implementation\n * needs to divide the point by 4. This is a major perf hit,\n * so treat `x448.publicKeyConvert` as if it were a point\n * multiplication.\n *\n * - Elligators should not be used with Edwards curves. As\n * Tibouchi notes[2], regular public keys will map to\n * _distinguishable_ field elements as they are always in\n * the primary subgroup. Either the Ristretto Elligator[3],\n * or a prime order curve with an Elligator Squared[2]\n * construction are suitable alternatives here.\n *\n * - These notes also spell out why you should avoid using\n * Edwards curves on a blockchain[4].\n *\n * [1] https://moderncrypto.org/mail-archive/curves/2016/000836.html\n * [2] https://eprint.iacr.org/2014/043.pdf\n * [3] https://ristretto.group/formulas/elligator.html\n * [4] https://src.getmonero.org/2017/05/17/disclosure-of-a-major-bug-in-cryptonote-based-currencies.html\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst BatchRNG = require('./batch-rng');\nconst BN = require('../bn');\nconst elliptic = require('./elliptic');\nconst rng = require('../random');\n\n/*\n * EDDSA\n */\n\nclass EDDSA {\n constructor(id, mid, eid, hash, pre) {\n assert(typeof id === 'string');\n assert(!mid || typeof mid === 'string');\n assert(!eid || typeof eid === 'string');\n assert(hash);\n\n this.id = id;\n this.type = 'eddsa';\n this.mid = mid || null;\n this.eid = eid || null;\n this.hash = hash;\n this.native = 0;\n\n this._pre = pre || null;\n this._curve = null;\n this._mont = null;\n this._iso = null;\n this._rng = null;\n }\n\n get curve() {\n if (!this._curve) {\n this._curve = elliptic.curve(this.id, this._pre);\n this._curve.precompute(rng);\n this._pre = null;\n }\n return this._curve;\n }\n\n get mont() {\n if (this.mid && !this._mont)\n this._mont = elliptic.curve(this.mid);\n return this._mont;\n }\n\n get iso() {\n if (!this.eid)\n return this.mont;\n\n if (!this._iso)\n this._iso = elliptic.curve(this.eid);\n\n return this._iso;\n }\n\n get rng() {\n if (!this._rng)\n this._rng = new BatchRNG(this.curve);\n\n return this._rng;\n }\n\n get size() {\n return this.curve.adjustedSize;\n }\n\n get bits() {\n return this.curve.fieldBits;\n }\n\n hashNonce(prefix, msg, ph, ctx) {\n const hash = new Hash(this);\n\n hash.init(ph, ctx);\n hash.update(prefix);\n hash.update(msg);\n\n return hash.final();\n }\n\n hashChallenge(R, A, m, ph, ctx) {\n const hash = new Hash(this);\n\n hash.init(ph, ctx);\n hash.update(R);\n hash.update(A);\n hash.update(m);\n\n return hash.final();\n }\n\n privateKeyGenerate() {\n return rng.randomBytes(this.curve.adjustedSize);\n }\n\n scalarGenerate() {\n const scalar = rng.randomBytes(this.curve.scalarSize);\n return this.curve.clamp(scalar);\n }\n\n privateKeyExpand(secret) {\n assert(Buffer.isBuffer(secret));\n assert(secret.length === this.curve.adjustedSize);\n\n const hash = this.hash.digest(secret, this.curve.adjustedSize * 2);\n\n return this.curve.splitHash(hash);\n }\n\n privateKeyConvert(secret) {\n const [key] = this.privateKeyExpand(secret);\n return key;\n }\n\n privateKeyVerify(secret) {\n assert(Buffer.isBuffer(secret));\n return secret.length === this.curve.adjustedSize;\n }\n\n scalarVerify(scalar) {\n assert(Buffer.isBuffer(scalar));\n return scalar.length === this.curve.scalarSize;\n }\n\n scalarIsZero(scalar) {\n assert(Buffer.isBuffer(scalar));\n\n let k;\n try {\n k = this.curve.decodeScalar(scalar).imod(this.curve.n);\n } catch (e) {\n return false;\n }\n\n return k.isZero();\n }\n\n scalarClamp(scalar) {\n assert(Buffer.isBuffer(scalar));\n assert(scalar.length === this.curve.scalarSize);\n\n return this.curve.clamp(Buffer.from(scalar));\n }\n\n privateKeyExport(secret) {\n const pub = this.publicKeyCreate(secret);\n const {x, y} = this.publicKeyExport(pub);\n\n return {\n d: Buffer.from(secret),\n x,\n y\n };\n }\n\n privateKeyImport(json) {\n assert(json && typeof json === 'object');\n assert(Buffer.isBuffer(json.d));\n\n if (json.d.length !== this.curve.adjustedSize)\n throw new Error('Invalid private key.');\n\n return Buffer.from(json.d);\n }\n\n scalarTweakAdd(scalar, tweak) {\n const a = this.curve.decodeScalar(scalar);\n const t = this.curve.decodeScalar(tweak);\n const k = a.add(t).imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarTweakMul(scalar, tweak) {\n const a = this.curve.decodeScalar(scalar);\n const t = this.curve.decodeScalar(tweak);\n const k = a.mul(t).imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarReduce(scalar) {\n const a = this.curve.decodeScalar(scalar);\n const k = a.imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarNegate(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n const k = a.neg().imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarInvert(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n\n if (a.isZero())\n return this.curve.encodeScalar(a);\n\n const k = a.invert(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n publicKeyCreate(secret) {\n const key = this.privateKeyConvert(secret);\n return this.publicKeyFromScalar(key);\n }\n\n publicKeyFromScalar(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n const A = this.curve.g.mulBlind(a);\n\n return A.encode();\n }\n\n publicKeyConvert(key) {\n if (!this.mont)\n throw new Error('No equivalent montgomery curve.');\n\n const A = this.curve.decodePoint(key);\n const P = this.mont.pointFromEdwards(A);\n\n return P.encode();\n }\n\n publicKeyFromUniform(bytes) {\n const u = this.curve.decodeUniform(bytes);\n const A = this.curve.pointFromUniform(u, this.iso);\n\n return A.encode();\n }\n\n publicKeyToUniform(key, hint = rng.randomInt()) {\n const A = this.curve.decodePoint(key);\n const u = this.curve.pointToUniform(A, hint, this.iso);\n\n return this.curve.encodeUniform(u, hint >>> 8);\n }\n\n publicKeyFromHash(bytes, pake = false) {\n const A = this.curve.pointFromHash(bytes, pake, this.iso);\n return A.encode();\n }\n\n publicKeyToHash(key, subgroup = rng.randomInt()) {\n const A = this.curve.decodePoint(key);\n return this.curve.pointToHash(A, subgroup, rng, this.iso);\n }\n\n publicKeyVerify(key) {\n assert(Buffer.isBuffer(key));\n\n try {\n this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return true;\n }\n\n publicKeyIsInfinity(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.isInfinity();\n }\n\n publicKeyIsSmall(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.isSmall();\n }\n\n publicKeyHasTorsion(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.hasTorsion();\n }\n\n publicKeyExport(key) {\n const {x, y} = this.curve.decodePoint(key);\n\n return {\n x: this.curve.encodeField(x.fromRed()),\n y: this.curve.encodeField(y.fromRed())\n };\n }\n\n publicKeyImport(json) {\n assert(json && typeof json === 'object');\n\n let x = null;\n let y = null;\n let A;\n\n if (json.x != null) {\n x = BN.decode(json.x, this.curve.endian);\n\n if (x.cmp(this.curve.p) >= 0)\n throw new Error('Invalid point.');\n }\n\n if (json.y != null) {\n y = BN.decode(json.y, this.curve.endian);\n\n if (y.cmp(this.curve.p) >= 0)\n throw new Error('Invalid point.');\n }\n\n if (x && y) {\n A = this.curve.point(x, y);\n\n if (!A.validate())\n throw new Error('Invalid point.');\n } else if (x) {\n A = this.curve.pointFromX(x, json.sign);\n } else if (y) {\n A = this.curve.pointFromY(y, json.sign);\n } else {\n throw new Error('Invalid point.');\n }\n\n return A.encode();\n }\n\n publicKeyTweakAdd(key, tweak) {\n const t = this.curve.decodeScalar(tweak).imod(this.curve.n);\n const A = this.curve.decodePoint(key);\n const T = this.curve.g.mul(t);\n const P = T.add(A);\n\n return P.encode();\n }\n\n publicKeyTweakMul(key, tweak) {\n const t = this.curve.decodeScalar(tweak);\n const A = this.curve.decodePoint(key);\n const P = A.mul(t);\n\n return P.encode();\n }\n\n publicKeyCombine(keys) {\n assert(Array.isArray(keys));\n\n let P = this.curve.point();\n\n for (const key of keys) {\n const A = this.curve.decodePoint(key);\n\n P = P.add(A);\n }\n\n return P.encode();\n }\n\n publicKeyNegate(key) {\n const A = this.curve.decodePoint(key);\n const P = A.neg();\n\n return P.encode();\n }\n\n sign(msg, secret, ph, ctx) {\n const [key, prefix] = this.privateKeyExpand(secret);\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n signWithScalar(msg, scalar, prefix, ph, ctx) {\n // EdDSA Signing.\n //\n // [EDDSA] Page 12, Section 4.\n // [RFC8032] Page 8, Section 3.3.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `a` be a secret scalar.\n // - Let `w` be a secret byte array.\n //\n // Computation:\n //\n // k = H(w, m) mod n\n // R = G * k\n // A = G * a\n // e = H(R, A, m) mod n\n // s = (k + e * a) mod n\n // S = (R, s)\n //\n // Note that `k` must remain secret,\n // otherwise an attacker can compute:\n //\n // a = (s - k) / e mod n\n //\n // The same is true of `w` as `k`\n // can be re-derived as `H(w, m)`.\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(prefix));\n assert(prefix.length === this.curve.adjustedSize);\n\n const {n} = this.curve;\n const G = this.curve.g;\n const k = this.hashNonce(prefix, msg, ph, ctx);\n const Rraw = G.mulBlind(k).encode();\n const a = this.curve.decodeScalar(scalar);\n const Araw = G.mulBlind(a).encode();\n const e = this.hashChallenge(Rraw, Araw, msg, ph, ctx);\n const s = k.add(e.mul(a)).imod(n);\n\n return Buffer.concat([Rraw, this.curve.encodeAdjusted(s)]);\n }\n\n signTweakAdd(msg, secret, tweak, ph, ctx) {\n const [key_, prefix_] = this.privateKeyExpand(secret);\n const key = this.scalarTweakAdd(key_, tweak);\n const expanded = this.hash.multi(prefix_, tweak, null,\n this.curve.adjustedSize * 2);\n const prefix = expanded.slice(0, this.curve.adjustedSize);\n\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n signTweakMul(msg, secret, tweak, ph, ctx) {\n const [key_, prefix_] = this.privateKeyExpand(secret);\n const key = this.scalarTweakMul(key_, tweak);\n const expanded = this.hash.multi(prefix_, tweak, null,\n this.curve.adjustedSize * 2);\n const prefix = expanded.slice(0, this.curve.adjustedSize);\n\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n verify(msg, sig, key, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n\n try {\n return this._verify(msg, sig, key, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verify(msg, sig, key, ph, ctx) {\n // EdDSA Verification.\n //\n // [EDDSA] Page 15, Section 5.\n // [RFC8032] Page 8, Section 3.4.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - s < n.\n //\n // Computation:\n //\n // e = H(R, A, m) mod n\n // G * s == R + A * e\n //\n // Alternatively, we can compute:\n //\n // R == G * s - A * e\n //\n // This allows us to make use of a\n // multi-exponentiation algorithm.\n const {n} = this.curve;\n const G = this.curve.g;\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n\n return G.mulAdd(s, A.neg(), e).eq(R);\n }\n\n verifySingle(msg, sig, key, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n\n try {\n return this._verifySingle(msg, sig, key, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verifySingle(msg, sig, key, ph, ctx) {\n // EdDSA Verification (with cofactor multiplication).\n //\n // [EDDSA] Page 15, Section 5.\n // [RFC8032] Page 8, Section 3.4.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - s < n.\n //\n // Computation:\n //\n // e = H(R, A, m) mod n\n // (G * s) * h == (R + A * e) * h\n //\n // Alternatively, we can compute:\n //\n // R * h == G * (s * h) - (A * h) * e\n //\n // This allows us to make use of a\n // multi-exponentiation algorithm.\n const {n} = this.curve;\n const G = this.curve.g;\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n const sh = this.curve.imulH(s);\n const Ah = A.mulH();\n const Rh = R.mulH();\n\n return G.mulAdd(sh, Ah.neg(), e).eq(Rh);\n }\n\n verifyBatch(batch, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Array.isArray(batch));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n for (const item of batch) {\n assert(Array.isArray(item) && item.length === 3);\n\n const [msg, sig, key] = item;\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n }\n\n try {\n return this._verifyBatch(batch, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verifyBatch(batch, ph, ctx) {\n // EdDSA Batch Verification.\n //\n // [EDDSA] Page 16, Section 5.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - Let `i` be the batch item index.\n // - s < n.\n // - a1 = 1 mod n.\n //\n // Computation:\n //\n // ei = H(Ri, Ai, mi) mod n\n // ai = random integer in [1,n-1]\n // lhs = (si * ai + ...) * h mod n\n // rhs = (Ri * h) * ai + (Ai * h) * (ei * ai mod n) + ...\n // G * -lhs + rhs == O\n const {n} = this.curve;\n const G = this.curve.g;\n const points = new Array(1 + batch.length * 2);\n const coeffs = new Array(1 + batch.length * 2);\n const sum = new BN(0);\n\n this.rng.init(batch);\n\n points[0] = G;\n coeffs[0] = sum;\n\n for (let i = 0; i < batch.length; i++) {\n const [msg, sig, key] = batch[i];\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n const a = this.rng.generate(i);\n const ea = e.mul(a).imod(n);\n\n sum.iadd(s.mul(a)).imod(n);\n\n points[1 + i * 2 + 0] = R.mulH();\n coeffs[1 + i * 2 + 0] = a;\n points[1 + i * 2 + 1] = A.mulH();\n coeffs[1 + i * 2 + 1] = ea;\n }\n\n this.curve.imulH(sum.ineg());\n\n return this.curve.mulAll(points, coeffs).isInfinity();\n }\n\n derive(pub, secret) {\n const scalar = this.privateKeyConvert(secret);\n return this.deriveWithScalar(pub, scalar);\n }\n\n deriveWithScalar(pub, scalar) {\n const A = this.curve.decodePoint(pub);\n const a = this.curve.decodeClamped(scalar);\n const P = A.mulBlind(a, rng);\n\n if (P.isInfinity())\n throw new Error('Invalid point.');\n\n return P.encode();\n }\n}\n\n/*\n * Hash\n */\n\nclass Hash {\n constructor(eddsa) {\n this.curve = eddsa.curve;\n // eslint-disable-next-line\n this.hash = new eddsa.hash();\n }\n\n init(ph, ctx) {\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (ctx.length > 255)\n ctx = ctx.slice(0, 255);\n\n this.hash.init();\n\n if (this.curve.context || ph != null || ctx.length > 0) {\n if (this.curve.prefix)\n this.hash.update(this.curve.prefix);\n\n this.hash.update(byte(ph));\n this.hash.update(byte(ctx.length));\n this.hash.update(ctx);\n }\n\n return this;\n }\n\n update(data) {\n this.hash.update(data);\n return this;\n }\n\n final() {\n const hash = this.hash.final(this.curve.adjustedSize * 2);\n const num = BN.decode(hash, this.curve.endian);\n\n return num.imod(this.curve.n);\n }\n}\n\n/*\n * Helpers\n */\n\nfunction byte(ch) {\n const buf = Buffer.alloc(1);\n buf[0] = ch & 0xff;\n return buf;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = EDDSA;\n","/*!\n * keccak.js - Keccak/SHA3 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on emn178/js-sha3:\n * Copyright (c) 2015-2017, Chen, Yi-Cyuan (MIT License).\n * https://github.com/emn178/js-sha3\n *\n * Parts of this software are based on rhash/RHash:\n * Copyright (c) 2005-2014, Aleksey Kravchenko\n * https://github.com/rhash/RHash\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n * https://github.com/rhash/RHash/blob/master/librhash/sha3.c\n * https://github.com/emn178/js-sha3/blob/master/src/sha3.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst HMAC = require('../internal/hmac');\n\n/*\n * Constants\n */\n\nconst FINALIZED = 0x80000000;\n\nconst ROUND_CONST = new Uint32Array([\n 0x00000001, 0x00000000, 0x00008082, 0x00000000,\n 0x0000808a, 0x80000000, 0x80008000, 0x80000000,\n 0x0000808b, 0x00000000, 0x80000001, 0x00000000,\n 0x80008081, 0x80000000, 0x00008009, 0x80000000,\n 0x0000008a, 0x00000000, 0x00000088, 0x00000000,\n 0x80008009, 0x00000000, 0x8000000a, 0x00000000,\n 0x8000808b, 0x00000000, 0x0000008b, 0x80000000,\n 0x00008089, 0x80000000, 0x00008003, 0x80000000,\n 0x00008002, 0x80000000, 0x00000080, 0x80000000,\n 0x0000800a, 0x00000000, 0x8000000a, 0x80000000,\n 0x80008081, 0x80000000, 0x00008080, 0x80000000,\n 0x80000001, 0x00000000, 0x80008008, 0x80000000\n]);\n\n/**\n * Keccak\n */\n\nclass Keccak {\n constructor() {\n this.state = new Uint32Array(50);\n this.block = Buffer.alloc(200);\n this.bs = 136;\n this.pos = FINALIZED;\n }\n\n init(bits) {\n if (bits == null)\n bits = 256;\n\n assert((bits >>> 0) === bits);\n assert(bits >= 128);\n assert(bits <= 512);\n\n const rate = 1600 - bits * 2;\n\n assert(rate >= 0 && (rate & 63) === 0);\n\n this.bs = rate >>> 3;\n this.pos = 0;\n\n return this;\n }\n\n update(data) {\n assert(Buffer.isBuffer(data));\n assert(!(this.pos & FINALIZED), 'Context is not initialized.');\n\n let len = data.length;\n let pos = this.pos;\n let off = 0;\n\n this.pos = (this.pos + len) % this.bs;\n\n if (pos > 0) {\n let want = this.bs - pos;\n\n if (want > len)\n want = len;\n\n data.copy(this.block, pos, off, off + want);\n\n pos += want;\n len -= want;\n off += want;\n\n if (pos < this.bs)\n return this;\n\n this._transform(this.block, 0);\n }\n\n while (len >= this.bs) {\n this._transform(data, off);\n off += this.bs;\n len -= this.bs;\n }\n\n if (len > 0)\n data.copy(this.block, 0, off, off + len);\n\n return this;\n }\n\n final(pad, len) {\n if (pad == null)\n pad = 0x01;\n\n if (len == null || len === 0)\n len = 100 - (this.bs >>> 1);\n\n assert((pad & 0xff) === pad);\n assert((len >>> 0) === len);\n assert(!(this.pos & FINALIZED), 'Context is not initialized.');\n\n this.block.fill(0, this.pos, this.bs);\n this.block[this.pos] |= pad;\n this.block[this.bs - 1] |= 0x80;\n this._transform(this.block, 0);\n this.pos = FINALIZED;\n\n assert(len <= this.bs);\n\n const out = Buffer.alloc(len);\n\n for (let i = 0; i < len; i++)\n out[i] = this.state[i >>> 2] >>> (8 * (i & 3));\n\n for (let i = 0; i < 50; i++)\n this.state[i] = 0;\n\n for (let i = 0; i < this.bs; i++)\n this.block[i] = 0;\n\n return out;\n }\n\n _transform(block, off) {\n const count = this.bs >>> 2;\n const s = this.state;\n\n for (let i = 0; i < count; i++)\n s[i] ^= readU32(block, off + i * 4);\n\n for (let n = 0; n < 48; n += 2) {\n const c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n const c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n const c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n const c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n const c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n const c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n const c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n const c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n const c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n const c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n const h0 = c8 ^ ((c2 << 1) | (c3 >>> 31));\n const l0 = c9 ^ ((c3 << 1) | (c2 >>> 31));\n const h1 = c0 ^ ((c4 << 1) | (c5 >>> 31));\n const l1 = c1 ^ ((c5 << 1) | (c4 >>> 31));\n const h2 = c2 ^ ((c6 << 1) | (c7 >>> 31));\n const l2 = c3 ^ ((c7 << 1) | (c6 >>> 31));\n const h3 = c4 ^ ((c8 << 1) | (c9 >>> 31));\n const l3 = c5 ^ ((c9 << 1) | (c8 >>> 31));\n const h4 = c6 ^ ((c0 << 1) | (c1 >>> 31));\n const l4 = c7 ^ ((c1 << 1) | (c0 >>> 31));\n\n s[0] ^= h0;\n s[1] ^= l0;\n s[10] ^= h0;\n s[11] ^= l0;\n s[20] ^= h0;\n s[21] ^= l0;\n s[30] ^= h0;\n s[31] ^= l0;\n s[40] ^= h0;\n s[41] ^= l0;\n\n s[2] ^= h1;\n s[3] ^= l1;\n s[12] ^= h1;\n s[13] ^= l1;\n s[22] ^= h1;\n s[23] ^= l1;\n s[32] ^= h1;\n s[33] ^= l1;\n s[42] ^= h1;\n s[43] ^= l1;\n\n s[4] ^= h2;\n s[5] ^= l2;\n s[14] ^= h2;\n s[15] ^= l2;\n s[24] ^= h2;\n s[25] ^= l2;\n s[34] ^= h2;\n s[35] ^= l2;\n s[44] ^= h2;\n s[45] ^= l2;\n\n s[6] ^= h3;\n s[7] ^= l3;\n s[16] ^= h3;\n s[17] ^= l3;\n s[26] ^= h3;\n s[27] ^= l3;\n s[36] ^= h3;\n s[37] ^= l3;\n s[46] ^= h3;\n s[47] ^= l3;\n\n s[8] ^= h4;\n s[9] ^= l4;\n s[18] ^= h4;\n s[19] ^= l4;\n s[28] ^= h4;\n s[29] ^= l4;\n s[38] ^= h4;\n s[39] ^= l4;\n s[48] ^= h4;\n s[49] ^= l4;\n\n const b0 = s[0];\n const b1 = s[1];\n const b32 = (s[11] << 4) | (s[10] >>> 28);\n const b33 = (s[10] << 4) | (s[11] >>> 28);\n const b14 = (s[20] << 3) | (s[21] >>> 29);\n const b15 = (s[21] << 3) | (s[20] >>> 29);\n const b46 = (s[31] << 9) | (s[30] >>> 23);\n const b47 = (s[30] << 9) | (s[31] >>> 23);\n const b28 = (s[40] << 18) | (s[41] >>> 14);\n const b29 = (s[41] << 18) | (s[40] >>> 14);\n const b20 = (s[2] << 1) | (s[3] >>> 31);\n const b21 = (s[3] << 1) | (s[2] >>> 31);\n const b2 = (s[13] << 12) | (s[12] >>> 20);\n const b3 = (s[12] << 12) | (s[13] >>> 20);\n const b34 = (s[22] << 10) | (s[23] >>> 22);\n const b35 = (s[23] << 10) | (s[22] >>> 22);\n const b16 = (s[33] << 13) | (s[32] >>> 19);\n const b17 = (s[32] << 13) | (s[33] >>> 19);\n const b48 = (s[42] << 2) | (s[43] >>> 30);\n const b49 = (s[43] << 2) | (s[42] >>> 30);\n const b40 = (s[5] << 30) | (s[4] >>> 2);\n const b41 = (s[4] << 30) | (s[5] >>> 2);\n const b22 = (s[14] << 6) | (s[15] >>> 26);\n const b23 = (s[15] << 6) | (s[14] >>> 26);\n const b4 = (s[25] << 11) | (s[24] >>> 21);\n const b5 = (s[24] << 11) | (s[25] >>> 21);\n const b36 = (s[34] << 15) | (s[35] >>> 17);\n const b37 = (s[35] << 15) | (s[34] >>> 17);\n const b18 = (s[45] << 29) | (s[44] >>> 3);\n const b19 = (s[44] << 29) | (s[45] >>> 3);\n const b10 = (s[6] << 28) | (s[7] >>> 4);\n const b11 = (s[7] << 28) | (s[6] >>> 4);\n const b42 = (s[17] << 23) | (s[16] >>> 9);\n const b43 = (s[16] << 23) | (s[17] >>> 9);\n const b24 = (s[26] << 25) | (s[27] >>> 7);\n const b25 = (s[27] << 25) | (s[26] >>> 7);\n const b6 = (s[36] << 21) | (s[37] >>> 11);\n const b7 = (s[37] << 21) | (s[36] >>> 11);\n const b38 = (s[47] << 24) | (s[46] >>> 8);\n const b39 = (s[46] << 24) | (s[47] >>> 8);\n const b30 = (s[8] << 27) | (s[9] >>> 5);\n const b31 = (s[9] << 27) | (s[8] >>> 5);\n const b12 = (s[18] << 20) | (s[19] >>> 12);\n const b13 = (s[19] << 20) | (s[18] >>> 12);\n const b44 = (s[29] << 7) | (s[28] >>> 25);\n const b45 = (s[28] << 7) | (s[29] >>> 25);\n const b26 = (s[38] << 8) | (s[39] >>> 24);\n const b27 = (s[39] << 8) | (s[38] >>> 24);\n const b8 = (s[48] << 14) | (s[49] >>> 18);\n const 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] ^= ROUND_CONST[n + 0];\n s[1] ^= ROUND_CONST[n + 1];\n }\n }\n\n static hash() {\n return new Keccak();\n }\n\n static hmac(bits, pad, len) {\n if (bits == null)\n bits = 256;\n\n assert((bits >>> 0) === bits);\n\n const rate = 1600 - bits * 2;\n\n assert(rate >= 0 && (rate & 63) === 0);\n\n return new HMAC(Keccak, rate >>> 3, [bits], [pad, len]);\n }\n\n static digest(data, bits, pad, len) {\n return Keccak.ctx.init(bits).update(data).final(pad, len);\n }\n\n static root(left, right, bits, pad, len) {\n if (bits == null)\n bits = 256;\n\n if (len == null)\n len = 0;\n\n if (len === 0)\n len = bits >>> 3;\n\n assert((bits >>> 0) === bits);\n assert((bits & 7) === 0);\n assert((len >>> 0) === len);\n assert(Buffer.isBuffer(left) && left.length === len);\n assert(Buffer.isBuffer(right) && right.length === len);\n\n return Keccak.ctx.init(bits).update(left).update(right).final(pad, len);\n }\n\n static multi(x, y, z, bits, pad, len) {\n const {ctx} = Keccak;\n\n ctx.init(bits);\n ctx.update(x);\n ctx.update(y);\n\n if (z)\n ctx.update(z);\n\n return ctx.final(pad, len);\n }\n\n static mac(data, key, bits, pad, len) {\n return Keccak.hmac(bits, pad, len).init(key).update(data).final();\n }\n}\n\n/*\n * Static\n */\n\nKeccak.native = 0;\nKeccak.id = 'KECCAK256';\nKeccak.size = 32;\nKeccak.bits = 256;\nKeccak.blockSize = 136;\nKeccak.zero = Buffer.alloc(32, 0x00);\nKeccak.ctx = new Keccak();\n\n/*\n * Helpers\n */\n\nfunction readU32(data, off) {\n return (data[off++]\n + data[off++] * 0x100\n + data[off++] * 0x10000\n + data[off] * 0x1000000);\n}\n\n/*\n * Expose\n */\n\nmodule.exports = Keccak;\n","/*!\n * keccak.js - keccak for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/keccak');\n","/*!\n * shake.js - SHAKE implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n */\n\n'use strict';\n\nconst Keccak = require('./keccak');\n\n/**\n * SHAKE\n */\n\nclass SHAKE extends Keccak {\n /**\n * Create a SHAKE Context.\n * @constructor\n */\n\n constructor() {\n super();\n }\n\n final(len) {\n return super.final(0x1f, len);\n }\n\n static hash() {\n return new SHAKE();\n }\n\n static hmac(bits, len) {\n return super.hmac(bits, 0x1f, len);\n }\n\n static digest(data, bits, len) {\n return super.digest(data, bits, 0x1f, len);\n }\n\n static root(left, right, bits, len) {\n return super.root(left, right, bits, 0x1f, len);\n }\n\n static multi(x, y, z, bits, len) {\n return super.multi(x, y, z, bits, 0x1f, len);\n }\n\n static mac(data, key, bits, len) {\n return super.mac(data, key, bits, 0x1f, len);\n }\n}\n\n/*\n * Static\n */\n\nSHAKE.native = Keccak.native;\nSHAKE.id = 'SHAKE256';\nSHAKE.size = 32;\nSHAKE.bits = 256;\nSHAKE.blockSize = 136;\nSHAKE.zero = Buffer.alloc(32, 0x00);\nSHAKE.ctx = new SHAKE();\n\n/*\n * Expose\n */\n\nmodule.exports = SHAKE;\n","/*!\n * shake256.js - SHAKE256 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nconst SHAKE = require('./shake');\n\n/**\n * SHAKE256\n */\n\nclass SHAKE256 extends SHAKE {\n constructor() {\n super();\n }\n\n init() {\n return super.init(256);\n }\n\n static hash() {\n return new SHAKE256();\n }\n\n static hmac(len) {\n return super.hmac(256, len);\n }\n\n static digest(data, len) {\n return super.digest(data, 256, len);\n }\n\n static root(left, right, len) {\n return super.root(left, right, 256, len);\n }\n\n static multi(x, y, z, len) {\n return super.multi(x, y, z, 256, len);\n }\n\n static mac(data, key, len) {\n return super.mac(data, key, 256, len);\n }\n}\n\n/*\n * Static\n */\n\nSHAKE256.native = SHAKE.native;\nSHAKE256.id = 'SHAKE256';\nSHAKE256.size = 32;\nSHAKE256.bits = 256;\nSHAKE256.blockSize = 136;\nSHAKE256.zero = Buffer.alloc(32, 0x00);\nSHAKE256.ctx = new SHAKE256();\n\n/*\n * Expose\n */\n\nmodule.exports = SHAKE256;\n","/*!\n * ed448.js - ed448 for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://eprint.iacr.org/2015/625.pdf\n * https://tools.ietf.org/html/rfc8032#section-5.2\n */\n\n'use strict';\n\nconst EDDSA = require('./eddsa');\nconst SHAKE256 = require('../shake256');\n\n/*\n * Expose\n */\n\nmodule.exports = new EDDSA('ED448', 'X448', 'MONT448', SHAKE256);\n","/*!\n * ed448.js - ed448 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/ed448');\n","// bcrypto does not ship TypeScript declarations.\n// @ts-ignore\nimport backend from \"bcrypto/lib/ed448-browser.js\";\nconst ed448 = backend;\nexport default ed448;\n//# sourceMappingURL=browser-ed448.js.map","/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert(value >> width === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\",\n fault: \"overflow\",\n value: _value,\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -((~value & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = BN_1 << (width - BN_1);\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n const mask = (BN_1 << width) - BN_1;\n return (~value & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof value) {\n case \"bigint\":\n return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\",\n operation: \"getUint\",\n value,\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof value) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value,\n });\n // Pad the value to the required width\n while (result.length < width * 2) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n return new Uint8Array([]);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map","/**\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 let value = toBigInt(getBytes(_value));\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\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","// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map","/**\n * Explain events...\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map","/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import { assert } from \"./errors.js\";\n// @TODO: timeout is completely ignored; start a Promise.any with a reject?\n// @ts-ignore\nexport async function getUrl(req, _signal) {\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 let signal = undefined;\n if (_signal) {\n const controller = new AbortController();\n signal = controller.signal;\n _signal.addListener(() => {\n controller.abort();\n });\n }\n const init = {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal,\n };\n try {\n const resp = await fetch(req.url, init);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = respBody == null ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers,\n body,\n };\n }\n catch (error) {\n console.log({ error });\n return undefined;\n }\n}\n//# sourceMappingURL=geturl-browser.js.map","/**\n * Explain fetching here...\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 { getUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet getUrlFunc = getUrl;\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(() => {\n listener();\n }, 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() {\n return this.#cancelled;\n }\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 /**\n * The fetch URI to requrest.\n */\n get url() {\n return this.#url;\n }\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``) and the .\n *\n * If %%body%% is a string, the intrincis ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrincis ``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 chnages 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 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]],\n 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 complere response.\n * //(default: 5 minutes)//\n */\n get timeout() {\n return this.#timeout;\n }\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 * 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 }\n toString() {\n return ``;\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\",\n reason: \"timeout\",\n 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\n .makeServerError(\"error in post-processing function\", error)\n .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 getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req\n .redirect(location)\n .#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 ||\n (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof retryAfter === \"string\" &&\n retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req\n .clone()\n .#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\n .makeServerError(\"error in post-processing function\", error)\n .assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req\n .clone()\n .#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 locataions\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" &&\n (current !== \"https\" || target !== \"http\") &&\n 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 = \"GET\";\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 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 getUrlFunc = getUrl;\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 * 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 ``;\n }\n /**\n * The response status code.\n */\n get statusCode() {\n return this.#statusCode;\n }\n /**\n * The response status message.\n */\n get statusMessage() {\n return this.#statusMessage;\n }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() {\n return Object.assign({}, this.#headers);\n }\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\",\n 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\",\n 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]],\n 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 of 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() {\n return this.#request;\n }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" &&\n this.statusCode >= 200 &&\n 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 assert(false, message, \"SERVER_ERROR\", {\n request: this.request || \"unknown request\",\n response: this,\n error,\n });\n }\n}\nfunction getTime() {\n return new Date().getTime();\n}\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","var _a;\n/**\n * About fixed-point math...\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = BN_1 << (width - BN_1);\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = BN_1 << width;\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n val = (((val % limit) + limit) % limit) & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof value === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof value === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = match[1] !== \"u\";\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof v[key] === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument(width % 8 === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return negative + str;\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return negative + str;\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, an value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() {\n return this.#format.signed;\n }\n /**\n * The number of bits available to store the value.\n */\n get width() {\n return this.#format.width;\n }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() {\n return this.#format.decimals;\n }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() {\n return this.#val;\n }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n\n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n*/\n val = checkValue(val, this.#format, safeOp);\n return new _a(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) {\n return this.#add(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) {\n return this.#add(other, \"add\");\n }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) {\n return this.#sub(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) {\n return this.#sub(other, \"sub\");\n }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) {\n return this.#mul(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) {\n return this.#mul(other, \"mul\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert(value % this.#tens === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) {\n return this.#div(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) {\n return this.#div(other, \"div\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(other);\n const value = this.#val * this.#tens;\n assert(value % other.#val === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%other%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return -1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) {\n return this.cmp(other) === 0;\n }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) {\n return this.cmp(other) < 0;\n }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) {\n return this.cmp(other) <= 0;\n }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) {\n return this.cmp(other) > 0;\n }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) {\n return this.cmp(other) >= 0;\n }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new _a(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() {\n return this.#val === BN_0;\n }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() {\n return this.#val < BN_0;\n }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() {\n return this._value;\n }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() {\n return parseFloat(this.toString());\n }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return _a.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, decimals, _format) {\n if (decimals == null) {\n decimals = 0;\n }\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert(value % tens === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\",\n fault: \"underflow\",\n value: _value,\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && match[2].length + match[3].length > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = match[2] || \"0\", decimal = match[3] || \"\";\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\",\n fault: \"underflow\",\n value: _value,\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new _a(_guard, value, format);\n }\n}\n_a = FixedNumber;\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","import { 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,\n length,\n 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,\n length: 0,\n offset: 1,\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data,\n length: data.length,\n 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","import { 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","/**\n * Most interactions with Core requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Core, //Core// is divisible to 18 decimal places,\n * where each individual unit is called a //ore//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n ///Ore, the smallest and atomic amount of Core\n \"ore\",\n ///fecore, 1000 ore\n \"fecore\",\n ///Picore, one million ore\n \"picore\",\n ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices.\n \"nacore\",\n ///Μcore, 10^12 ore or 1 μCore\n \"mcore\",\n ///micore, 10^15 ore or 1 mcore\n \"micore\",\n \"core\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit.\n */\nexport const scientificToDecimal = (num) => {\n // @ts-ignore\n var nsign = Math.sign(num);\n //remove the sign\n // @ts-ignore\n num = Math.abs(num);\n //if the number is in scientific notation remove it\n // @ts-ignore\n if (/\\d+\\.?\\d*e[\\+\\-]*\\d+/i.test(num)) {\n var zero = \"0\", \n // @ts-ignore\n parts = String(num).toLowerCase().split(\"e\"), //split into coeff and exponent\n e = parts.pop(), //store the exponential part\n // @ts-ignore\n l = Math.abs(e), //get the number of zeros\n // @ts-ignore\n sign = e / l, coeff_array = parts[0].split(\".\");\n if (sign === -1) {\n l = l - coeff_array[0].length;\n if (l < 0) {\n // @ts-ignore\n num =\n coeff_array[0].slice(0, l) +\n \".\" +\n coeff_array[0].slice(l) +\n (coeff_array.length === 2 ? coeff_array[1] : \"\");\n }\n else {\n // @ts-ignore\n num = zero + \".\" + new Array(l + 1).join(zero) + coeff_array.join(\"\");\n }\n }\n else {\n var dec = coeff_array[1];\n if (dec)\n l = l - dec.length;\n if (l < 0) {\n // @ts-ignore\n num = coeff_array[0] + dec.slice(0, l) + \".\" + dec.slice(l);\n }\n else {\n // @ts-ignore\n num = coeff_array.join(\"\") + new Array(l + 1).join(zero);\n }\n }\n }\n // @ts-ignore\n return nsign < 0 ? \"-\" + num : num;\n};\nexport const trimDecimals = (n, decimals = 18) => {\n n += \"\";\n if (n.indexOf(\".\") === -1)\n return n;\n const arr = n.split(\".\");\n const fraction = arr[1].substr(0, decimals);\n return arr[0] + \".\" + fraction;\n};\nexport function parseUnits(value, unit) {\n assertArgument(typeof value === \"string\", \"value must be a string\", \"value\", value);\n if (value.includes(\"e\")) {\n value = scientificToDecimal(value).toString();\n }\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n value = trimDecimals(value, decimals);\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n value = trimDecimals(value, decimals);\n }\n return FixedNumber.fromString(value, { decimals }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatXCB(ore) {\n return formatUnits(ore, 18);\n}\n/**\n * Converts the //decimal string// %%xcb%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseXCB(xcb) {\n return parseUnits(xcb, 18);\n}\n//# sourceMappingURL=units.js.map","/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map","/*!\n * pbkdf2.js - pbkdf2 for bcrypto\n * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/PBKDF2\n * https://tools.ietf.org/html/rfc2898\n * https://tools.ietf.org/html/rfc2898#section-5.2\n * https://tools.ietf.org/html/rfc6070\n * https://www.emc.com/collateral/white-papers/h11302-pkcs5v2-1-password-based-cryptography-standard-wp.pdf\n * http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst crypto = global.crypto || global.msCrypto || {};\nconst subtle = crypto.subtle || {};\n\n/**\n * Perform key derivation using PBKDF2.\n * @param {Function} hash\n * @param {Buffer} pass\n * @param {Buffer} salt\n * @param {Number} iter\n * @param {Number} len\n * @returns {Buffer}\n */\n\nfunction derive(hash, pass, salt, iter, len) {\n if (typeof pass === 'string')\n pass = Buffer.from(pass, 'utf8');\n\n if (typeof salt === 'string')\n salt = Buffer.from(salt, 'utf8');\n\n if (salt == null)\n salt = Buffer.alloc(0);\n\n assert(hash && typeof hash.id === 'string');\n assert(Buffer.isBuffer(pass));\n assert(Buffer.isBuffer(salt));\n assert((iter >>> 0) === iter);\n assert((len >>> 0) === len);\n\n const size = hash.size;\n const blocks = Math.ceil(len / size);\n const out = Buffer.alloc(blocks * size);\n const state = Buffer.alloc(salt.length + 4);\n\n salt.copy(state, 0);\n\n // Preemptively shorten key.\n if (pass.length > hash.blockSize) {\n pass = hash.digest(pass);\n assert(pass.length <= hash.blockSize);\n }\n\n for (let i = 0; i < blocks; i++) {\n const round = i + 1;\n\n state[salt.length + 0] = round >>> 24;\n state[salt.length + 1] = round >>> 16;\n state[salt.length + 2] = round >>> 8;\n state[salt.length + 3] = round;\n\n const block = hash.mac(state, pass);\n\n let mac = block;\n\n for (let j = 1; j < iter; j++) {\n mac = hash.mac(mac, pass);\n\n for (let k = 0; k < size; k++)\n block[k] ^= mac[k];\n }\n\n block.copy(out, i * size);\n }\n\n return out.slice(0, len);\n}\n\n/**\n * Execute pbkdf2 asynchronously.\n * @param {Function} hash\n * @param {Buffer} pass\n * @param {Buffer} salt\n * @param {Number} iter\n * @param {Number} len\n * @returns {Promise}\n */\n\nasync function deriveAsync(hash, pass, salt, iter, len) {\n if (typeof pass === 'string')\n pass = Buffer.from(pass, 'utf8');\n\n if (typeof salt === 'string')\n salt = Buffer.from(salt, 'utf8');\n\n if (salt == null)\n salt = Buffer.alloc(0);\n\n assert(hash && typeof hash.id === 'string');\n assert(Buffer.isBuffer(pass));\n assert(Buffer.isBuffer(salt));\n assert((iter >>> 0) === iter);\n assert((len >>> 0) === len);\n\n const name = getHash(hash);\n\n if (!subtle.importKey || !subtle.deriveBits || !name)\n return derive(hash, pass, salt, iter, len);\n\n const algo = { name: 'PBKDF2' };\n const use = ['deriveBits'];\n\n const options = {\n name: 'PBKDF2',\n salt: salt,\n iterations: iter,\n hash: name\n };\n\n const key = await subtle.importKey('raw', pass, algo, false, use);\n const out = await subtle.deriveBits(options, key, len * 8);\n\n return Buffer.from(out);\n}\n\n/*\n * Helpers\n */\n\nfunction getHash(hash) {\n switch (hash.id) {\n case 'SHA1':\n return 'SHA-1';\n case 'SHA256':\n return 'SHA-256';\n case 'SHA384':\n return 'SHA-384';\n case 'SHA512':\n return 'SHA-512';\n default:\n return null;\n }\n}\n\n/*\n * Expose\n */\n\nexports.native = 0;\nexports.derive = derive;\nexports.deriveAsync = deriveAsync;\n","/*!\n * pbkdf2.js - pbkdf2 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/pbkdf2');\n","/*!\n * sha3.js - SHA3 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n */\n\n'use strict';\n\nconst Keccak = require('./keccak');\n\n/**\n * SHA3\n */\n\nclass SHA3 extends Keccak {\n constructor() {\n super();\n }\n\n final() {\n return super.final(0x06, null);\n }\n\n static hash() {\n return new SHA3();\n }\n\n static hmac(bits) {\n return super.hmac(bits, 0x06, null);\n }\n\n static digest(data, bits) {\n return super.digest(data, bits, 0x06, null);\n }\n\n static root(left, right, bits) {\n return super.root(left, right, bits, 0x06, null);\n }\n\n static multi(x, y, z, bits) {\n return super.multi(x, y, z, bits, 0x06, null);\n }\n\n static mac(data, key, bits) {\n return super.mac(data, key, bits, 0x06, null);\n }\n}\n\n/*\n * Static\n */\n\nSHA3.native = 0;\nSHA3.id = 'SHA3_256';\nSHA3.size = 32;\nSHA3.bits = 256;\nSHA3.blockSize = 136;\nSHA3.zero = Buffer.alloc(32, 0x00);\nSHA3.ctx = new SHA3();\n\n/*\n * Expose\n */\n\nmodule.exports = SHA3;\n","/*!\n * sha3.js - sha3 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/sha3');\n","/*!\n * sha3-512.js - sha3-512 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nconst SHA3 = require('./sha3');\n\n/**\n * SHA3-512\n */\n\nclass SHA3_512 extends SHA3 {\n constructor() {\n super();\n }\n\n init() {\n return super.init(512);\n }\n\n static hash() {\n return new SHA3_512();\n }\n\n static hmac() {\n return super.hmac(512);\n }\n\n static digest(data) {\n return super.digest(data, 512);\n }\n\n static root(left, right) {\n return super.root(left, right, 512);\n }\n\n static multi(x, y, z) {\n return super.multi(x, y, z, 512);\n }\n\n static mac(data, key) {\n return super.mac(data, key, 512);\n }\n}\n\n/*\n * Static\n */\n\nSHA3_512.native = SHA3.native;\nSHA3_512.id = 'SHA3_512';\nSHA3_512.size = 64;\nSHA3_512.bits = 512;\nSHA3_512.blockSize = 72;\nSHA3_512.zero = Buffer.alloc(64, 0x00);\nSHA3_512.ctx = new SHA3_512();\n\n/*\n * Expose\n */\n\nmodule.exports = SHA3_512;\n","import { Buffer } from \"buffer\";\n// @ts-ignore\nimport ed448 from \"./browser-ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"./pbkdf2-browser.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(Buffer.from(msgHash, \"hex\"), Buffer.from(signedMsg, \"hex\"), Buffer.from(pubKey, \"hex\"));\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock-browser.js.map","/* Browser Crypto Shims */\nimport { ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"ripemd160\":\n return ripemd160.create();\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512, \"sha3-256\": sha3_256, \"sha3-512\": sha3_512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = (data) => hexlify(createHash(\"sha3-256\").update(data).digest());\nconst _sha512 = (data) => hexlify(createHash(\"sha3-512\").update(data).digest());\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA3-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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n return hexlify(createHash(\"ripemd160\").update(getBytes(data)).digest());\n}\nexport function sha256(data) {\n return hexlify(__sha256(getBytes(data)));\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(createHmac(\"sha3-256\", k).update(d).digest());\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(createHmac(\"sha3-512\", k).update(d).digest());\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 SHA3-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 return hexlify(__sha512(getBytes(data)));\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha512);\n//# sourceMappingURL=sha3.js.map","/**\n * Addresses are a fundamental part of interacting with Core. They\n * represent the gloabal identity of Externally Owned Accounts (accounts\n * backed by a private key) and contracts.\n *\n * The Core Naming Service (CNS) provides an interconnected ecosystem\n * of contracts, standards and libraries which enable looking up an\n * address for an ENS name.\n *\n * These functions help convert between various formats, validate\n * addresses and safely resolve ENS names.\n *\n * @_section: api/address:Addresses [about-addresses]\n */\nnull;\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { encode } from \"../crypto/rlp.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexDataSlice, hexlify, stripZeros, } from \"../utils/data.js\";\nconst logger = new Logger(\"address/0.0.1\");\nconst precompiledAddresses = [\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n \"0000000000000000000000000000000000000000000000000000000000000001\",\n \"0000000000000000000000000000000000000000000000000000000000000002\",\n \"0000000000000000000000000000000000000000000000000000000000000003\",\n \"0000000000000000000000000000000000000000000000000000000000000004\",\n \"0000000000000000000000000000000000000000000000000000000000000005\",\n \"0000000000000000000000000000000000000000000000000000000000000006\",\n \"0000000000000000000000000000000000000000000000000000000000000007\",\n \"0000000000000000000000000000000000000000000000000000000000000008\",\n \"0000000000000000000000000000000000000000000000000000000000000009\",\n];\nfunction removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nfunction calculateCheckSum(_address, _prefix) {\n const address = getBytes(\"0x\" + _address.replace(\"0x\", \"\"));\n const prefix = getBytes(\"0x\" + _prefix.replace(\"0x\", \"\"));\n const tmpConcated = new Uint8Array([...address, ...prefix]);\n const hexedConcat = hexlify(tmpConcated).replace(\"0x\", \"\") + \"00\";\n const mods = Array.from(hexedConcat.toUpperCase(), (c) => {\n const charCode = c.charCodeAt(0);\n return charCode > 64 && charCode < 91\n ? (charCode - 55).toString()\n : (charCode - 48).toString();\n }).join(\"\");\n const bigVal = BigInt(mods);\n const val97 = BigInt(97);\n const val98 = BigInt(98);\n const remainder = bigVal % val97;\n const checkSum = val98 - remainder;\n const result = checkSum > 9 ? checkSum.toString() : \"0\" + checkSum.toString();\n return result;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address\n .split(\"\")\n .map((c) => {\n return ibanLookup[c];\n })\n .join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Core uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nfunction getAddress(address) {\n if (typeof address !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n const raw = removeHexPrefix(address);\n if (precompiledAddresses.includes(raw)) {\n return \"0x\" + raw;\n }\n const prefix = raw.substring(0, 2);\n const val = raw.substring(4);\n const checksum = calculateCheckSum(val, prefix);\n if (checksum !== raw.substring(2, 4)) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n return \"0x\" + prefix + checksum + val;\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nfunction getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\nfunction networkIdToPrefix(networkId) {\n if (networkId == 1) {\n return \"cb\";\n }\n else if (networkId == 3 || networkId == 4) {\n return \"ab\";\n }\n else if (networkId > 10 || networkId == 0) {\n return \"ce\";\n }\n else {\n logger.throwArgumentError(\"bad networkId\", \"networkId\", networkId);\n return \"\";\n }\n}\nfunction getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n const val = hexDataSlice(sha256(encode([from, nonce])), 12);\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, };\n//# sourceMappingURL=index.js.map","/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () {\n locked = true;\n};\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map","import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () {\n locked = true;\n};\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map","/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () {\n locked = true;\n};\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map","/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () {\n locked = true;\n};\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map","/**\n * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt.\n * @module\n */\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { sha256 } from \"./sha2.js\";\n// prettier-ignore\nimport { anumber, asyncLoop, checkOpts, clean, rotl, swap32IfBE, u32 } from \"./utils.js\";\n// The main Scrypt loop: uses Salsa extensively.\n// Six versions of the function were tried, this is the fastest one.\n// RFC 7914 §3 / §4 step 2 applies Salsa20/8 to one 16-word (64-byte) block\n// after xor'ing two such blocks.\n// The local `y*` snapshot keeps the xor input stable even when `out` aliases `prev` or `input`.\n// prettier-ignore\nfunction XorAndSalsa(prev, pi, input, ii, out, oi) {\n // Based on https://cr.yp.to/salsa20.html and RFC 7914's Salsa20/8 core.\n // Xor blocks\n let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];\n let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];\n let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];\n let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];\n let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];\n let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];\n let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];\n let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];\n // Save state to temporary variables (salsa)\n let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n // Main loop (salsa)\n for (let i = 0; i < 8; i += 2) {\n x04 ^= rotl(x00 + x12 | 0, 7);\n x08 ^= rotl(x04 + x00 | 0, 9);\n x12 ^= rotl(x08 + x04 | 0, 13);\n x00 ^= rotl(x12 + x08 | 0, 18);\n x09 ^= rotl(x05 + x01 | 0, 7);\n x13 ^= rotl(x09 + x05 | 0, 9);\n x01 ^= rotl(x13 + x09 | 0, 13);\n x05 ^= rotl(x01 + x13 | 0, 18);\n x14 ^= rotl(x10 + x06 | 0, 7);\n x02 ^= rotl(x14 + x10 | 0, 9);\n x06 ^= rotl(x02 + x14 | 0, 13);\n x10 ^= rotl(x06 + x02 | 0, 18);\n x03 ^= rotl(x15 + x11 | 0, 7);\n x07 ^= rotl(x03 + x15 | 0, 9);\n x11 ^= rotl(x07 + x03 | 0, 13);\n x15 ^= rotl(x11 + x07 | 0, 18);\n x01 ^= rotl(x00 + x03 | 0, 7);\n x02 ^= rotl(x01 + x00 | 0, 9);\n x03 ^= rotl(x02 + x01 | 0, 13);\n x00 ^= rotl(x03 + x02 | 0, 18);\n x06 ^= rotl(x05 + x04 | 0, 7);\n x07 ^= rotl(x06 + x05 | 0, 9);\n x04 ^= rotl(x07 + x06 | 0, 13);\n x05 ^= rotl(x04 + x07 | 0, 18);\n x11 ^= rotl(x10 + x09 | 0, 7);\n x08 ^= rotl(x11 + x10 | 0, 9);\n x09 ^= rotl(x08 + x11 | 0, 13);\n x10 ^= rotl(x09 + x08 | 0, 18);\n x12 ^= rotl(x15 + x14 | 0, 7);\n x13 ^= rotl(x12 + x15 | 0, 9);\n x14 ^= rotl(x13 + x12 | 0, 13);\n x15 ^= rotl(x14 + x13 | 0, 18);\n }\n // Write output (salsa)\n out[oi++] = (y00 + x00) | 0;\n out[oi++] = (y01 + x01) | 0;\n out[oi++] = (y02 + x02) | 0;\n out[oi++] = (y03 + x03) | 0;\n out[oi++] = (y04 + x04) | 0;\n out[oi++] = (y05 + x05) | 0;\n out[oi++] = (y06 + x06) | 0;\n out[oi++] = (y07 + x07) | 0;\n out[oi++] = (y08 + x08) | 0;\n out[oi++] = (y09 + x09) | 0;\n out[oi++] = (y10 + x10) | 0;\n out[oi++] = (y11 + x11) | 0;\n out[oi++] = (y12 + x12) | 0;\n out[oi++] = (y13 + x13) | 0;\n out[oi++] = (y14 + x14) | 0;\n out[oi++] = (y15 + x15) | 0;\n}\nfunction BlockMix(input, ii, out, oi, r) {\n // The block B is `r` 128-byte chunks, i.e. `2r` 16-word (64-byte) Salsa blocks.\n let head = oi + 0;\n let tail = oi + 16 * r;\n for (let i = 0; i < 16; i++)\n out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]\n for (let i = 0; i < r; i++, head += 16, ii += 16) {\n // RFC 7914 §4 step 3 outputs `Y[0], Y[2], ...` first, then `Y[1], Y[3], ...`;\n // `head` and `tail` lay out those even/odd halves in place.\n XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])\n if (i > 0)\n tail += 16; // First iteration overwrites tmp value in tail\n // tail[i] = Salsa(blockIn[2*i+1] ^ head[i])\n XorAndSalsa(out, head, input, (ii += 16), out, tail);\n }\n}\n// 128*r*(N+p+1) for N=2**20, r=8, p=1: 1 GiB main table plus 2 KiB workspace.\nconst SCRYPT_DEFAULT_MAXMEM = 128 * 8 * (2 ** 20 + 1 + 1);\n// Common prologue and epilogue for sync/async functions\nfunction scryptInit(password, salt, _opts) {\n const opts = checkOpts({\n dkLen: 32,\n asyncTick: 10,\n maxmem: SCRYPT_DEFAULT_MAXMEM,\n }, _opts);\n const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;\n anumber(N, 'N');\n anumber(r, 'r');\n anumber(p, 'p');\n anumber(dkLen, 'dkLen');\n anumber(asyncTick, 'asyncTick');\n anumber(maxmem, 'maxmem');\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('\"onProgress\" must be a function');\n // Without this, r=0 slips through: blockSize=0 turns the `p` upper bound into\n // Infinity and the failure surfaces later as a confusing pbkdf2 dkLen error.\n if (r < 1)\n throw new Error('\"r\" expected integer >= 1');\n const blockSize = 128 * r;\n const blockSize32 = blockSize / 4;\n // Max N is 2^32 (Integrify is 32-bit).\n // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB.\n // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs,\n // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error:\n // https://www.rfc-editor.org/errata_search.php?rfc=7914\n const pow32 = Math.pow(2, 32);\n if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32)\n throw new Error('\"N\" expected a power of 2, and 2^1 <= N <= 2^32');\n if (p < 1 || p > ((pow32 - 1) * 32) / blockSize)\n throw new Error('\"p\" expected integer 1..((2^32 - 1) * 32) / (128 * r)');\n // RFC 7914 §2 defines `dkLen` as a positive integer.\n if (dkLen < 1 || dkLen > (pow32 - 1) * 32)\n throw new Error('\"dkLen\" expected integer 1..(2^32 - 1) * 32');\n // Include the shared `tmp` scratch block so `maxmem` matches noble's actual temporary allocation.\n // Node requires more headroom here, so this accounting is intentionally noble-specific.\n const memUsed = blockSize * (N + p + 1);\n if (memUsed > maxmem)\n throw new Error('\"maxmem\" limit was hit: memUsed(128*r*(N+p+1))=' + memUsed + ', maxmem=' + maxmem);\n // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)\n // Since it has only one iteration there is no reason to use async variant\n const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });\n const B32 = u32(B);\n // Re-used between parallel iterations. Array(iterations) of B\n const V = u32(new Uint8Array(blockSize * N));\n const tmp = u32(new Uint8Array(blockSize));\n let blockMixCb = () => { };\n if (onProgress) {\n const totalBlockMix = 2 * N * p;\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);\n let blockMixCnt = 0;\n blockMixCb = () => {\n blockMixCnt++;\n if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) {\n // Wiping here instead of a try/catch around the main loops keeps them\n // try-free: measured ~1% slower at N=2^21 with the loops inside a try.\n // onProgress is the only user code that can throw mid-derivation.\n try {\n onProgress(blockMixCnt / totalBlockMix);\n }\n catch (e) {\n clean(B, V, tmp);\n throw e;\n }\n }\n };\n }\n return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };\n}\nfunction scryptOutput(password, dkLen, B, V, tmp) {\n // Shared final PBKDF2-and-cleanup step: keep the derived key, wipe the scrypt workspace.\n const res = pbkdf2(sha256, password, B, { c: 1, dkLen });\n clean(B, V, tmp);\n return res;\n}\n/**\n * Scrypt KDF from RFC 7914. See {@link ScryptOpts}.\n * @param password - password or key material to derive from;\n * JS string inputs are UTF-8 encoded first\n * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first\n * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,\n * must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}.\n * @returns Derived key bytes.\n * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}\n * @example\n * Derive a key with scrypt.\n * ```ts\n * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });\n * ```\n * @example\n * Derive a key with small demo costs and progress/memory controls.\n * ```ts\n * const progressLog: number[] = [];\n * scrypt('password', 'salt', {\n * N: 16,\n * r: 8,\n * p: 1,\n * dkLen: 32,\n * maxmem: 1024 * 1024,\n * asyncTick: 10,\n * onProgress(progress) {\n * progressLog.push(progress);\n * },\n * });\n * ```\n */\nexport function scrypt(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts);\n swap32IfBE(B32);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n for (let i = 0, pos = 0; i < N - 1; i++) {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n for (let i = 0; i < N; i++) {\n // First u32 of the last 64-byte block (u32 is LE)\n // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N\n // only depends on the low word here because N is a power of two and\n // this implementation caps N at 2^32.\n // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked\n // above; >>> 0 for unsigned, input fits in u32.\n const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations\n // tmp = B ^ V[j]\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }\n }\n swap32IfBE(B32);\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n/**\n * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}.\n * @param password - password or key material to derive from;\n * JS string inputs are UTF-8 encoded first\n * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first\n * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,\n * must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local\n * scheduler-yield control for this JS wrapper, not part of RFC 7914.\n * See {@link ScryptOpts}.\n * @returns Promise resolving to derived key bytes.\n * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}\n * @example\n * Derive a key with scrypt asynchronously.\n * ```ts\n * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });\n * ```\n * @example\n * Derive a key asynchronously with small demo costs and progress/memory controls.\n * ```ts\n * await scryptAsync('password', 'salt', {\n * N: 16,\n * r: 8,\n * p: 1,\n * dkLen: 32,\n * maxmem: 1024 * 1024,\n * asyncTick: 1,\n * onProgress(progress) {\n * if (progress > 1) throw new Error('invalid progress');\n * },\n * });\n * ```\n */\nexport async function scryptAsync(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts);\n // One failure handler covers both yield boundaries without putting the hot loops in a try block.\n const abort = () => clean(B, V, tmp);\n swap32IfBE(B32);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n let pos = 0;\n await asyncLoop(N - 1, asyncTick, () => {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }, abort);\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n await asyncLoop(N, asyncTick, () => {\n // First u32 of the last 64-byte block (u32 is LE)\n // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N\n // only depends on the low word here because N is a power of two and\n // this implementation caps N at 2^32.\n // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked\n // above; >>> 0 for unsigned, input fits in u32.\n const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations\n // tmp = B ^ V[j]\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }, abort);\n }\n swap32IfBE(B32);\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n","import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from \"@noble/hashes/scrypt.js\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () {\n lockedAsync = true;\n};\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () {\n lockedSync = true;\n};\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport { dataLength, getBytesCopy, hexlify, assertArgument, } from \"../utils/index.js\";\nimport { arrayify, hexConcat } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { ed448 } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"signing-key/0.0.1\");\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 const normalized = typeof privateKey === \"string\" && !privateKey.startsWith(\"0x\")\n ? \"0x\" + privateKey\n : privateKey;\n assertArgument(dataLength(normalized) === 57, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(normalized);\n }\n /**\n * The private key.\n */\n get privateKey() {\n return this.#privateKey;\n }\n /** The 57-byte Ed448 public key encoded as hex. */\n get publicKey() {\n return SigningKey.computePublicKey(this.#privateKey);\n }\n /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */\n get compressedPublicKey() {\n return SigningKey.computePublicKey(this.#privateKey, true);\n }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n const key = getBytesCopy(this.#privateKey);\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const keyBuffer = new Uint8Array(arrayify(key));\n if (keyBuffer.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n const digestBuffer = new Uint8Array(arrayify(digest));\n if (digestBuffer.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n if (keyBuffer[56] > 127) {\n const prefix = keyBuffer.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[55] |= 0x80;\n prefix[56] = 0;\n const scalar = prefix.slice(0, 56);\n const bufferDigest = Buffer.from(digestBuffer);\n const bufferPrfx = Buffer.from(prefix);\n const bufferScalar = Buffer.from(scalar);\n const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx);\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer));\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */\n computeSharedSecret(other) {\n const pub = Buffer.from(getBytesCopy(other));\n assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), \"invalid public key\", \"other\", other);\n const key = Buffer.from(getBytesCopy(this.#privateKey));\n if (key[56] > 127) {\n const scalar = key.subarray(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n return hexlify(ed448.deriveWithScalar(pub, scalar));\n }\n return hexlify(ed448.derive(pub, key));\n }\n /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */\n static computePublicKey(key, compressed) {\n const bytes = Buffer.from(arrayify(key));\n if (bytes.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n if (bytes[56] > 127) {\n const scalar = bytes.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n const pub = ed448.publicKeyFromScalar(scalar);\n return hexlify(pub);\n }\n const pub = ed448.publicKeyCreate(bytes);\n return hexlify(pub);\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 digestBuffer = Buffer.from(arrayify(digest));\n const sigBuffer = Buffer.from(arrayify(signature));\n if (sigBuffer.length !== 171) {\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n }\n const sig = sigBuffer.slice(0, 114);\n const pub = sigBuffer.slice(114);\n if (ed448.verify(digestBuffer, sig, pub)) {\n return hexlify(pub);\n }\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n return \"\";\n }\n /** Adds two encoded Ed448 public points. The compression flag is ignored. */\n static addPoints(p0, p1, compressed) {\n const points = [p0, p1].map((point) => {\n const bytes = Buffer.from(getBytesCopy(point));\n assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), \"invalid public key\", \"point\", point);\n return bytes;\n });\n return hexlify(ed448.publicKeyCombine(points));\n }\n}\n//# sourceMappingURL=signing-key.js.map","import { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate, } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst _guard = {};\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signautre.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() {\n return this.#r;\n }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n const value = hexlify(_value);\n assertArgument(parseInt(value.substring(0, 3)) < 8, \"non-canonical s\", \"value\", value);\n this.#s = value;\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() {\n return this.#v;\n }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() {\n return this.#networkV;\n }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacynetworkId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getnetworkId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return this.v === 27 ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, this.yParity ? \"0x1c\" : \"0x1b\"]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return `Signature { r: \"${this.r}\", s: \"${this.s}\", yParity: ${this.yParity}, networkV: ${this.networkV} }`;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this.s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: networkV != null ? networkV.toString() : null,\n r: this.r,\n s: this.s,\n v: this.v,\n };\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getnetworkId(45)\n * //_result:\n *\n * Signature.getnetworkId(46)\n * //_result:\n */\n static getnetworkId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if (bv == BN_27 || bv == BN_28) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getnetworkIdV(5, 27)\n * //_result:\n *\n * Signature.getnetworkIdV(5, 28)\n * //_result:\n *\n */\n static getnetworkIdV(networkId, v) {\n return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return bv & BN_1 ? 27 : 28;\n }\n}\n//# sourceMappingURL=signature.js.map","/**\n * A fundamental building block of Core is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha3.js\";\nimport { Ed448Goldilock } from \"./crypto.js\";\nimport { keccak256 } from \"./keccak.js\";\nexport { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\nfunction lock() {\n computeHmac.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { arrayify, hexDataSlice } from \"../utils/data.js\";\nimport { calculateCheckSum } from \"../address/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 removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nexport function publicToAddress(key, prefix) {\n const val = hexDataSlice(sha256(key), 12);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport function computeAddress(key, prefix) {\n let pubkey;\n if (typeof key === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return publicToAddress(pubkey, prefix); // getAddress(sha256(\"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, prefix) {\n // return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature);\n return publicToAddress(publicKey, prefix);\n}\nexport function extractPrefix(address) {\n address = getAddress(address);\n return address.substring(2, 4);\n}\n//# sourceMappingURL=address.js.map","import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument, } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => {\n this[index] = item;\n });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof name === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, new Map());\n // Remove any key thats not unique\n this.#names = Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n }));\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof prop === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply(this === receiver ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply(this === receiver ? target : this, [\n prop,\n ]);\n }\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n }\n /**\n * Returns the Result as a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray() {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject() {\n return this.#names.reduce((accum, name, index) => {\n assert(name != null, \"value at index ${ index } unnamed\", \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\",\n });\n // Add values for names that don't conflict\n if (!(name in accum)) {\n accum[name] = this.getValue(name);\n }\n return accum;\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(this.#names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(this.#names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = this.#names.indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: WordSize,\n offset: bytes.length,\n });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\",\n type: \"string\",\n localName: \"string\",\n dynamic: \"boolean\",\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() {\n return this.#dataLength;\n }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n constructor(data, allowLoose) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#offset = 0;\n }\n get data() {\n return hexlify(this.#data);\n }\n get dataLength() {\n return this.#data.length;\n }\n get consumed() {\n return this.#offset;\n }\n get bytes() {\n return new Uint8Array(this.#data);\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose &&\n loose &&\n this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength,\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose);\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, {\n signed,\n width,\n });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${size ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_corebc_typed\");\nexport class Typed {\n type;\n value;\n #options;\n _typedSymbol;\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n defaultValue() {\n return 0;\n }\n minValue() {\n return 0;\n }\n maxValue() {\n return 0;\n }\n isBigInt() {\n return !!this.type.match(/^u?int[0-9]+$/);\n }\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n isString() {\n return this.type === \"string\";\n }\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return this.value.length;\n }\n return null;\n }\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n static uint8(v) {\n return n(v, 8);\n }\n static uint16(v) {\n return n(v, 16);\n }\n static uint24(v) {\n return n(v, 24);\n }\n static uint32(v) {\n return n(v, 32);\n }\n static uint40(v) {\n return n(v, 40);\n }\n static uint48(v) {\n return n(v, 48);\n }\n static uint56(v) {\n return n(v, 56);\n }\n static uint64(v) {\n return n(v, 64);\n }\n static uint72(v) {\n return n(v, 72);\n }\n static uint80(v) {\n return n(v, 80);\n }\n static uint88(v) {\n return n(v, 88);\n }\n static uint96(v) {\n return n(v, 96);\n }\n static uint104(v) {\n return n(v, 104);\n }\n static uint112(v) {\n return n(v, 112);\n }\n static uint120(v) {\n return n(v, 120);\n }\n static uint128(v) {\n return n(v, 128);\n }\n static uint136(v) {\n return n(v, 136);\n }\n static uint144(v) {\n return n(v, 144);\n }\n static uint152(v) {\n return n(v, 152);\n }\n static uint160(v) {\n return n(v, 160);\n }\n static uint168(v) {\n return n(v, 168);\n }\n static uint176(v) {\n return n(v, 176);\n }\n static uint184(v) {\n return n(v, 184);\n }\n static uint192(v) {\n return n(v, 192);\n }\n static uint200(v) {\n return n(v, 200);\n }\n static uint208(v) {\n return n(v, 208);\n }\n static uint216(v) {\n return n(v, 216);\n }\n static uint224(v) {\n return n(v, 224);\n }\n static uint232(v) {\n return n(v, 232);\n }\n static uint240(v) {\n return n(v, 240);\n }\n static uint248(v) {\n return n(v, 248);\n }\n static uint256(v) {\n return n(v, 256);\n }\n static uint(v) {\n return n(v, 256);\n }\n static int8(v) {\n return n(v, -8);\n }\n static int16(v) {\n return n(v, -16);\n }\n static int24(v) {\n return n(v, -24);\n }\n static int32(v) {\n return n(v, -32);\n }\n static int40(v) {\n return n(v, -40);\n }\n static int48(v) {\n return n(v, -48);\n }\n static int56(v) {\n return n(v, -56);\n }\n static int64(v) {\n return n(v, -64);\n }\n static int72(v) {\n return n(v, -72);\n }\n static int80(v) {\n return n(v, -80);\n }\n static int88(v) {\n return n(v, -88);\n }\n static int96(v) {\n return n(v, -96);\n }\n static int104(v) {\n return n(v, -104);\n }\n static int112(v) {\n return n(v, -112);\n }\n static int120(v) {\n return n(v, -120);\n }\n static int128(v) {\n return n(v, -128);\n }\n static int136(v) {\n return n(v, -136);\n }\n static int144(v) {\n return n(v, -144);\n }\n static int152(v) {\n return n(v, -152);\n }\n static int160(v) {\n return n(v, -160);\n }\n static int168(v) {\n return n(v, -168);\n }\n static int176(v) {\n return n(v, -176);\n }\n static int184(v) {\n return n(v, -184);\n }\n static int192(v) {\n return n(v, -192);\n }\n static int200(v) {\n return n(v, -200);\n }\n static int208(v) {\n return n(v, -208);\n }\n static int216(v) {\n return n(v, -216);\n }\n static int224(v) {\n return n(v, -224);\n }\n static int232(v) {\n return n(v, -232);\n }\n static int240(v) {\n return n(v, -240);\n }\n static int248(v) {\n return n(v, -248);\n }\n static int256(v) {\n return n(v, -256);\n }\n static int(v) {\n return n(v, -256);\n }\n static bytes1(v) {\n return b(v, 1);\n }\n static bytes2(v) {\n return b(v, 2);\n }\n static bytes3(v) {\n return b(v, 3);\n }\n static bytes4(v) {\n return b(v, 4);\n }\n static bytes5(v) {\n return b(v, 5);\n }\n static bytes6(v) {\n return b(v, 6);\n }\n static bytes7(v) {\n return b(v, 7);\n }\n static bytes8(v) {\n return b(v, 8);\n }\n static bytes9(v) {\n return b(v, 9);\n }\n static bytes10(v) {\n return b(v, 10);\n }\n static bytes11(v) {\n return b(v, 11);\n }\n static bytes12(v) {\n return b(v, 12);\n }\n static bytes13(v) {\n return b(v, 13);\n }\n static bytes14(v) {\n return b(v, 14);\n }\n static bytes15(v) {\n return b(v, 15);\n }\n static bytes16(v) {\n return b(v, 16);\n }\n static bytes17(v) {\n return b(v, 17);\n }\n static bytes18(v) {\n return b(v, 18);\n }\n static bytes19(v) {\n return b(v, 19);\n }\n static bytes20(v) {\n return b(v, 20);\n }\n static bytes21(v) {\n return b(v, 21);\n }\n static bytes22(v) {\n return b(v, 22);\n }\n static bytes23(v) {\n return b(v, 23);\n }\n static bytes24(v) {\n return b(v, 24);\n }\n static bytes25(v) {\n return b(v, 25);\n }\n static bytes26(v) {\n return b(v, 26);\n }\n static bytes27(v) {\n return b(v, 27);\n }\n static bytes28(v) {\n return b(v, 28);\n }\n static bytes29(v) {\n return b(v, 29);\n }\n static bytes30(v) {\n return b(v, 30);\n }\n static bytes31(v) {\n return b(v, 31);\n }\n static bytes32(v) {\n return b(v, 32);\n }\n static address(v) {\n return new Typed(_gaurd, \"address\", v);\n }\n static bool(v) {\n return new Typed(_gaurd, \"bool\", !!v);\n }\n static bytes(v) {\n return new Typed(_gaurd, \"bytes\", v);\n }\n static string(v) {\n return new Typed(_gaurd, \"string\", v);\n }\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return value && value._typedSymbol === _typedSymbol;\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map","import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 22));\n }\n}\n//# sourceMappingURL=address.js.map","import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","import { defineProperties, isError, assert, assertArgument, assertArgumentCount, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof values === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => {\n func(staticWriter.length);\n });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\";\n const dynamic = length === -1 || coder.dynamic;\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? \" \" + this.localName : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", {\n buffer: reader.bytes,\n offset: count * WordSize,\n length: reader.dataLength,\n });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map","import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map","import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map","import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\".substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map","import { defineProperties, fromTwos, getBigInt, mask, toTwos, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = (signed ? \"int\" : \"uint\") + size * 8;\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, this.size * 8 - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map","import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = \"tuple(\" + types.join(\",\") + \")\";\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, {\n coders: Object.freeze(coders.slice()),\n });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map","import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.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 * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of ore in a single xcb.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const OrePerXCB = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") *\n BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nexport const NegativeOne = /*#__PURE__*/ BigInt(-1);\nexport const Zero = /*#__PURE__*/ BigInt(0);\nexport const One = /*#__PURE__*/ BigInt(1);\nexport const Two = /*#__PURE__*/ BigInt(2);\n//# sourceMappingURL=numbers.js.map","// NFKC (composed) // (decomposed)\n/**\n * A constant for the core symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const CoreSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Core Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Core Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map","import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n }),\n };\n}\n/**\n * Returns a [[AccessList]] from any corebcsupported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof set === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof value === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => a.address.localeCompare(b.address));\n return result;\n}\n//# sourceMappingURL=accesslist.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { recoverAddress } from \"./address.js\";\nimport { checkProperties } from \"../utils/properties.js\";\nimport { arrayify, stripZeros } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport * as RLP from \"../crypto/rlp.js\";\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst logger = new Logger(\"transaction/0.0.1\");\nconst BN_0 = BigInt(0);\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction parse(data) {\n const handleNumber = (value) => {\n // @ts-ignore\n if (value === \"0x\") {\n return BigNumber.from(0);\n }\n return BigNumber.from(value);\n };\n const transaction = RLP.decode(data);\n if (transaction.length !== 7 && transaction.length !== 8) {\n logger.throwArgumentError(\"invalid raw transaction\", \"data\", data);\n }\n const isSigned = transaction.length === 8;\n const tx = {\n nonce: Number(handleNumber(transaction[0])),\n energyPrice: handleNumber(transaction[1]).toBigInt(),\n energyLimit: handleNumber(transaction[2]).toBigInt(),\n networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(),\n to: handleAddress(transaction[isSigned ? 4 : 3]),\n value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(),\n data: transaction[isSigned ? 6 : 5],\n };\n if (transaction.length === 8) {\n const prefix = networkIdToPrefix(Number(tx.networkId));\n const digest = sha256(serialize(tx));\n tx.hash = sha256(serialize(tx, transaction[7]));\n tx.from = recoverAddress(digest, transaction[7], prefix);\n tx.signature = transaction[7];\n }\n return tx;\n}\nconst unsignedTransactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n { name: \"networkId\", maxLength: 32, numeric: true },\n];\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"networkId\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n networkId: true,\n data: true,\n energyLimit: true,\n energyPrice: true,\n nonce: true,\n to: true,\n value: true,\n};\nfunction serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) {\n let value = transaction[name] || [];\n const options = {};\n if (numeric) {\n options.hexPad = \"left\";\n }\n const tmpHexlified = hexlify(value, options);\n value = arrayify(tmpHexlified);\n // Fixed-width field\n if (length && value.length !== length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n // Variable-width (with a maximum)\n if (maxLength) {\n value = stripZeros(value);\n if (value.length > maxLength) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n }\n const hexlified = hexlify(value);\n raw.push(hexlified);\n });\n if (!!signature) {\n raw.push(hexlify(signature));\n }\n const finalValue = RLP.encode(raw);\n return finalValue;\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Core by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in corebc) 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 #to;\n #data;\n #nonce;\n #energyLimit;\n #energyPrice;\n #value;\n #networkId;\n #sig;\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n return this.#to;\n }\n set to(value) {\n this.#to = value == null ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() {\n return this.#nonce;\n }\n set nonce(value) {\n this.#nonce = getNumber(value, \"value\");\n }\n /**\n * The energy limit.\n */\n get energyLimit() {\n return this.#energyLimit;\n }\n set energyLimit(value) {\n this.#energyLimit = getBigInt(value);\n }\n /**\n * The energy 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 energyPrice() {\n const value = this.#energyPrice;\n if (value == null) {\n return BN_0;\n }\n return value;\n }\n set energyPrice(value) {\n this.#energyPrice = value == null ? null : getBigInt(value, \"energyPrice\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() {\n return this.#data;\n }\n set data(value) {\n this.#data = hexlify(value);\n }\n /**\n * The amount of xcb (in ore) to send in this transactions.\n */\n get value() {\n return this.#value;\n }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value);\n }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() {\n return this.#sig || null;\n }\n set signature(value) {\n this.#sig = value == null ? null : value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#to = null;\n this.#nonce = 0;\n this.#energyLimit = BigInt(0);\n this.#energyPrice = null;\n this.#data = \"0x\";\n this.#value = BigInt(0);\n this.#networkId = BigInt(0);\n this.#sig = 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 sha256(this.serialized);\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 sha256(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 const prefix = networkIdToPrefix(Number(this.#networkId));\n return recoverAddress(this.unsignedHash, this.signature, prefix);\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);\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 //isSigned(): this is SignedTransaction {\n return this.signature != null;\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 assert(this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n return serialize(this, this.signature);\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 serialize(this);\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 to: this.to,\n data: this.data,\n nonce: this.nonce,\n energyLimit: s(this.energyLimit),\n energyPrice: s(this.energyPrice),\n value: s(this.value),\n networkId: s(this.networkId),\n sig: this.signature ? this.signature : null,\n };\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 return Transaction.from(parse(payload));\n }\n const result = new Transaction();\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.energyLimit != null) {\n result.energyLimit = tx.energyLimit;\n }\n if (tx.energyPrice != null) {\n result.energyPrice = tx.energyPrice;\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.networkId != null) {\n result.networkId = tx.networkId;\n }\n if (tx.signature != null) {\n result.signature = tx.signature;\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 { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof message === \"string\") {\n message = toUtf8Bytes(message);\n }\n return sha256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message,\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig, prefix) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig, prefix);\n}\n//# sourceMappingURL=message.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument, } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = !!value ? \"0x01\" : \"0x00\";\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = match[1] === \"int\";\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) &&\n size % 8 === 0 &&\n size !== 0 &&\n size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map","import { getAddress } from \"../address/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\";\nimport { sha256 } from \"../crypto/index.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\");\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 networkId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\",\n};\nconst domainFieldNames = [\n \"name\",\n \"version\",\n \"networkId\",\n \"verifyingContract\",\n \"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 networkId: function (_value) {\n const value = getBigInt(_value, \"domain.networkId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.networkId\", _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] || \"256\");\n assertArgument(width % 8 === 0 &&\n width !== 0 &&\n width <= 256 &&\n (match[2] == null || 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\":\n return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\":\n return function (value) {\n return !value ? hexFalse : hexTrue;\n };\n case \"bytes\":\n return function (value) {\n return sha256(value);\n };\n case \"string\":\n return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields\n .map(({ name, type }) => type + \" \" + name)\n .join(\",\")})`;\n}\nexport class TypedDataEncoder {\n primaryType;\n #types;\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n constructor(types) {\n this.#types = JSON.stringify(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 Object.keys(types).forEach((type) => {\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\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 = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1] || null;\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\n .map((t) => JSON.stringify(t))\n .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]) +\n st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(sha256);\n }\n return sha256(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 sha256(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 encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return sha256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n return value.map((v) => this._visit(match[1], 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 visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\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 static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value),\n ]);\n }\n static hash(domain, types, value) {\n return sha256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\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 &&\n !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 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 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, prefix) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix);\n}\n//# sourceMappingURL=typed-data.js.map","/**\n * About frgaments...\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nvar _a;\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\",\n \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\",\n \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\",\n \"@\": \"AT\",\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() {\n return this.#offset;\n }\n get length() {\n return this.#tokens.length - this.#offset;\n }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() {\n return new _a(this.#tokens);\n }\n reset() {\n this.#offset = 0;\n }\n #subTokenString(from = 0, to = 0) {\n return new _a(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: t.match - from,\n linkBack: t.linkBack - from,\n linkNext: t.linkNext - from,\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return top != null && allowed.has(top) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return top.type === type ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\n_a = TokenString;\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = offset < text.length ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = {\n depth: brackets.length,\n linkBack: -1,\n linkNext: -1,\n match: -1,\n type: \"\",\n text: \"\",\n offset,\n value: -1,\n };\n tokens.push(token);\n let type = SimpleTokens[cur[0]] || \"\";\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n tokens[token.match].match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n tokens[tokens.length - 1].value =\n getNumber(value);\n }\n if (tokens.length === 0 ||\n tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n tokens[tokens.length - 1].text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a energy limit, returning a BigNumber or null if none\nfunction consumeEnergy(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid energy\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_corebc_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **PAramType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name,\n type,\n baseType,\n indexed,\n components,\n arrayLength,\n arrayChildren,\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n let result = {\n type: this.baseType === \"tuple\" ? \"tuple\" : this.type,\n name: this.name || undefined,\n };\n if (typeof this.indexed === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${this.arrayLength < 0 ? \"\" : String(this.arrayLength)}]`;\n }\n else {\n if (this.isTuple()) {\n if (format !== \"sighash\") {\n result += this.type;\n }\n result +=\n \"(\" +\n this.components\n .map((comp) => comp.format(format))\n .join(format === \"full\" ? \", \" : \",\") +\n \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /*\n * Returns true if %%value%% is an Array type.\n *\n * This provides a type gaurd ensuring that the\n * [[arrayChildren]] and [[arrayLength]] are non-null.\n */\n //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } {\n // return value && (value.baseType === \"array\")\n //}\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return this.baseType === \"array\";\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return this.baseType === \"tuple\";\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return this.indexed != null;\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => _this.arrayChildren.walk(v, process));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => _this.components[i].walk(v, process));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof value !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () {\n setValue(await result);\n })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS naes by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ParamType.from(lex(obj), allowIndexed);\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") ||\n obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = obj.peekType(\"ID\") ? obj.pop().text : \"\";\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof name === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components,\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" ||\n type.startsWith(\"tuple(\" /* fix: ) */) ||\n type.startsWith(\"(\" /* fix: ) */)) {\n const comps = obj.components != null\n ? obj.components.map((c) => ParamType.from(c))\n : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return value && value[internal] === ParamTypeInternal;\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof obj === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n }\n else if (typeof obj === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\",\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof name === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return (\"(\" +\n params.map((p) => p.format(format)).join(format === \"full\" ? \", \" : \",\") +\n \")\");\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === ErrorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return EventFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n static isFragment(value) {\n return value && value[internal] === EventFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n payable;\n energy;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, energy) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, {\n value: ConstructorFragmentInternal,\n });\n defineProperties(this, { payable, energy });\n }\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: this.payable ? \"payable\" : \"undefined\",\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n result.push(this.payable ? \"payable\" : \"nonpayable\");\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n return result.join(\" \");\n }\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ConstructorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, setify([\"payable\"])).has(\"payable\");\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, energy);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === ConstructorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n format(format) {\n const type = this.inputs.length === 0 ? \"receive\" : \"fallback\";\n if (format === \"json\") {\n const stateMutability = this.payable ? \"payable\" : \"nonpayable\";\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FallbackFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = obj.stateMutability === \"payable\";\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n static isFragment(value) {\n return value && value[internal] === FallbackFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The amount of energy to send when calling this function\n */\n energy;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, energy) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = stateMutability === \"view\" || stateMutability === \"pure\";\n const payable = stateMutability === \"payable\";\n defineProperties(this, {\n constant,\n energy,\n outputs,\n payable,\n stateMutability,\n });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: this.stateMutability !== \"nonpayable\"\n ? this.stateMutability\n : undefined,\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n }\n return result.join(\" \");\n }\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FunctionFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof obj.constant === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === FunctionFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n format() {\n throw new Error(\"@TODO\");\n }\n static from(obj) {\n if (typeof obj === \"string\") {\n return StructFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === StructFragmentInternal;\n }\n}\n//# sourceMappingURL=fragments.js.map","/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason],\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code],\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: tx.to ? getAddress(tx.to) : null,\n data: tx.data || \"0x\",\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action,\n data,\n reason,\n transaction,\n invocation,\n revert,\n });\n}\n/**\n * About AbiCoder\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, match[1] === \"int\", param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose));\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an corebc-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map","/**\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","/**\n * About Interface\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert, } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nexport { checkResultErrors, Result };\nexport class LogDescription {\n fragment;\n name;\n signature;\n topic;\n args;\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n signature,\n topic,\n args,\n });\n }\n}\nexport class TransactionDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n value;\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n value,\n });\n }\n}\nexport class ErrorDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n });\n }\n}\nexport class Indexed {\n hash;\n _isIndexed;\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n },\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n },\n },\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving xcb is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof fragments === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(\"EE\", error);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags),\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, {\n deploy: fragment,\n });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback ||\n fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\"),\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = minimal ? \"minimal\" : \"full\";\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = values.length > 0 ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength &&\n (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 &&\n values &&\n values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null ||\n Array.isArray(lastArg) ||\n typeof lastArg !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#functions.get(name), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#events.get(name), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#errors.get(name), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\n getSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n\n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n\n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n\n fragment = matches[0];\n }\n\n return dataSlice(id(fragment.format()), 0, 4);\n }\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if (bytes.length % 32 === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() },\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name,\n signature: ef.format(),\n args,\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args,\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n\n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n };\n\n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n*/\n // Create the filter for the event with search criteria (e.g. for xcb_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return sha256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof value === \"boolean\") {\n value = value ? \"0x01\" : \"0x00\";\n }\n if (param.type.match(/^u?int/)) {\n value = toBeHex(value);\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n //@TOOD should probably be return toHex(value, 32)\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", \"contract.\" + param.name, value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", \"contract.\" + param.name, value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(sha256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics,\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" ||\n param.type === \"bytes\" ||\n param.baseType === \"tuple\" ||\n param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt(tx.value != null ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof value === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // Maybe an interface from an older version, or from a symlinked copy\n if (typeof value.format === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map","import { concat, \n// dataSlice,\ngetBigInt,\n// encodeRlp\n } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { hexDataLength, hexDataSlice } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { removeHexPrefix } from \"../transaction/address.js\";\nimport { calculateCheckSum } from \"./index.js\";\nconst logger = new Logger(\"contract-address/0.0.1\");\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(from);\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\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 * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n const val = hexDataSlice(sha256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12);\n console.log({ \"contract-address/74=>should be string\": val });\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\n//# sourceMappingURL=contract-address.js.map","import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.corebc.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return value && typeof value.getAddress === \"function\";\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null ||\n result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof target !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target) {\n if (typeof target === \"string\") {\n return getAddress(target);\n // assert(resolver != null, \"ENS resolution requires a provider\",\n // \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n // return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof target.then === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map","import { defineProperties, getBigInt, getNumber, hexlify, resolveProperties, assert, assertArgument, isError, makeError, } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The energy price for legacy networks.\n */\n energyPrice;\n constructor(energyPrice) {\n defineProperties(this, {\n energyPrice: getValue(energyPrice),\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { energyPrice } = this;\n return {\n _type: \"FeeData\",\n energyPrice: toJson(energyPrice),\n };\n }\n}\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"networkId,energyLimit,energyPrice,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipReadEnabled = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Core.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total energy limit for this block.\n */\n energyLimit;\n /**\n * The total energy used in this block.\n */\n energyUsed;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per energy that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerEnergy;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof tx !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n nonce: block.nonce,\n difficulty: block.difficulty,\n energyLimit: block.energyLimit,\n energyUsed: block.energyUsed,\n miner: block.miner,\n extraData: block.extraData,\n baseFeePerEnergy: getValue(block.baseFeePerEnergy),\n });\n }\n /**\n * Returns the list of transaction hashes.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof tx === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions for blocks which\n * prefetched them, by passing ``true`` to %%prefetchTxs%%\n * into [[provider_getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof txs[0] === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\",\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this;\n return {\n _type: \"Block\",\n baseFeePerEnergy: toJson(baseFeePerEnergy),\n difficulty: toJson(difficulty),\n extraData,\n energyLimit: toJson(energyLimit),\n energyUsed: toJson(energyUsed),\n hash,\n miner,\n nonce,\n number,\n parentHash,\n timestamp,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++],\n done: false,\n };\n }\n return { value: undefined, done: true };\n },\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() {\n return this.#transactions.length;\n }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof indexOrHash === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof v === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash === hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof tx === \"string\") {\n return await this.provider.getTransaction(tx);\n }\n else {\n return tx;\n }\n }\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof indexOrHash === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Has this block been mined.\n *\n * If true, the block has been typed-gaurded that all mined\n * properties are non-null.\n */\n isMined() {\n return !!this.hash;\n }\n /**\n *\n */\n isLondon() {\n return !!this.baseFeePerEnergy;\n }\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\nexport class Log {\n provider;\n transactionHash;\n blockHash;\n blockNumber;\n removed;\n address;\n data;\n topics;\n index;\n transactionIndex;\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this;\n return {\n _type: \"log\",\n address,\n blockHash,\n blockNumber,\n data,\n index,\n removed,\n topics,\n transactionHash,\n transactionIndex,\n };\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\nexport class TransactionReceipt {\n provider;\n to;\n from;\n contractAddress;\n hash;\n index;\n blockHash;\n blockNumber;\n logsBloom;\n energyUsed;\n cumulativeEnergyUsed;\n energyPrice;\n type;\n //readonly byzantium!: boolean;\n status;\n root;\n #logs;\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n energyUsed: tx.energyUsed,\n cumulativeEnergyUsed: tx.cumulativeEnergyUsed,\n energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice),\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root,\n });\n }\n get logs() {\n return this.#logs;\n }\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,\n status, root, } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash,\n blockNumber,\n //byzantium,\n contractAddress,\n cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed),\n from,\n energyPrice: toJson(this.energyPrice),\n energyUsed: toJson(this.energyUsed),\n hash,\n index,\n logs,\n logsBloom,\n root,\n status,\n to,\n };\n }\n get length() {\n return this.logs.length;\n }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n },\n };\n }\n get fee() {\n return this.energyUsed * this.energyPrice;\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n async getResult() {\n return await this.provider.getTransactionResult(this.hash);\n }\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/*\nexport type ReplacementDetectionSetup = {\n to: string;\n from: string;\n value: bigint;\n data: string;\n nonce: number;\n block: number;\n};\n*/\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of energy this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n energyLimit;\n /**\n * The energy price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective energy price// (the fee per energy that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerEnergy]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of energy the transaction\n * consumes.\n */\n energyPrice;\n /**\n * The data.\n */\n data;\n /**\n * The value, in ore. Use [[formatXCB]] to format this value\n * as xcb.\n */\n value;\n /**\n * The chain ID.\n */\n networkId;\n /**\n * The signature.\n */\n signature;\n #startBlock;\n /**\n * Create a new TransactionResponse with %%tx%% parameters\n * connected to %%provider%%.\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null;\n this.blockHash = tx.blockHash != null ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.from = tx.from;\n this.to = tx.to || null;\n this.energyLimit = tx.energyLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.energyPrice = tx.energyPrice;\n this.networkId = tx.networkId;\n this.signature = tx.signature;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON representation of this transaction.\n */\n toJSON() {\n const { index, hash, type, to, from, nonce, data, signature } = this;\n return {\n _type: \"TransactionReceipt\",\n networkId: toJson(this.networkId),\n data,\n from,\n energyLimit: toJson(this.energyLimit),\n energyPrice: toJson(this.energyPrice),\n hash,\n nonce,\n signature,\n to,\n index,\n type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = _confirms == null ? 1 : _confirms;\n const timeout = _timeout == null ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = startBlock === -1 ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from),\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if (blockNumber - receipt.blockNumber + 1 < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data &&\n tx.to === this.to &&\n tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" &&\n tx.from === tx.to &&\n tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: reason === \"replaced\" || reason === \"cancelled\",\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt,\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (receipt) {\n if ((await receipt.confirmations()) >= confirms) {\n return receipt;\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => {\n cancellers.forEach((c) => c());\n };\n // On cancel, stop scanning for replacements\n cancellers.push(() => {\n stopScanning = true;\n });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => {\n clearTimeout(timer);\n });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n resolve(receipt);\n }\n };\n cancellers.push(() => {\n this.provider.off(this.hash, txListener);\n });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => {\n this.provider.off(\"block\", replaceListener);\n });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return this.blockHash != null;\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return this.type === 0;\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return {\n orphan: \"drop-log\",\n log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index,\n },\n };\n}\n//# sourceMappingURL=provider.js.map","import { Log, TransactionReceipt, TransactionResponse, } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\nexport class EventLog extends Log {\n interface;\n fragment;\n args;\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length\n ? this.#iface.getEvent(log.topics[0])\n : null;\n if (fragment) {\n return new EventLog(log, this.#iface, fragment);\n }\n else {\n return log;\n }\n });\n }\n}\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n async wait(confirms) {\n const receipt = await super.wait();\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\nexport class ContractUnknownEventPayload extends EventPayload {\n log;\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n async getBlock() {\n return await this.log.getBlock();\n }\n async getTransaction() {\n return await this.log.getTransaction();\n }\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map","import { Indexed, Interface, Typed } from \"../abi/index.js\";\nimport { resolveAddress } from \"../address/checks.js\";\nimport { copyRequest, Log, } from \"../providers/provider.js\";\nimport { defineProperties, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument, } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return value && typeof value.call === \"function\";\n}\nfunction canEstimate(value) {\n return value && typeof value.estimateEnergy === \"function\";\n}\nfunction canResolve(value) {\n return value && typeof value.resolveName === \"function\";\n}\nfunction canSend(value) {\n return value && typeof value.sendTransaction === \"function\";\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof value[feature] === \"function\") {\n return value;\n }\n if (value.provider && typeof value.provider[feature] === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(Typed.dereference(arg, \"overrides\"));\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from);\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n const iface = contract.interface;\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || (tx.value || BN_0) === BN_0, \"cannot send value to non-payable contract\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || (tx.data || \"0x\") === \"0x\", \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment in getFragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs),\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract,\n _key: key,\n getFragment,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment in defineProperty\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment in\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract,\n _key: key,\n getFragment,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_corebcInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value &&\n typeof value === \"object\" &&\n \"getTopicFilter\" in value &&\n typeof value.getTopicFilter === \"function\" &&\n value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof event === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics\n .map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n })\n .join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = addr ? addr : contract;\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment\n ? contract.interface.decodeEventLog(fragment, log.data, log.topics)\n : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n return count > 0;\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n target;\n interface;\n runner;\n filters;\n [internal];\n fallback;\n constructor(target, abi, runner, _deployTx) {\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof target === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, _prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = this.getEvent(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract event: ${prop}`);\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop)));\n },\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null,\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, _prop, receiver) => {\n if (_prop in target || passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = target.getFunction(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract method: ${prop}`);\n },\n has: (target, prop) => {\n if (prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(String(prop));\n },\n });\n }\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n async getAddress() {\n return await getInternal(this).addrPromise;\n }\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n async waitForDeployment() {\n // We have the deployement transaction; just use that (throws if deployement fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n getFunction(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n getEvent(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n async queryTransaction(hash) {\n // Is this useful?\n throw new Error(\"@TODO\");\n }\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = addr ? addr : await addrPromise;\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n return new EventLog(log, this.interface, foundFragment);\n }\n else {\n return new Log(log, provider);\n }\n });\n }\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners\n .map(({ listener }) => listener)\n .indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n 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 await this.off(event, listener);\n }\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map","import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\nimport { isBytes } from \"../utils/data.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\nexport class ContractFactory {\n interface;\n bytecode;\n runner;\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else if (typeof bytecode === \"string\") {\n bytecode = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecode = hexlify(bytecode);\n }\n else if (bytecode && typeof bytecode.object === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecode = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecode = \"!\";\n }\n defineProperties(this, {\n // @ts-ignore\n bytecode,\n interface: iface,\n runner: runner || null,\n });\n }\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([\n this.bytecode,\n this.interface.encodeDeploy(resolvedArgs),\n ]);\n return Object.assign({}, overrides, { data });\n }\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof this.runner.sendTransaction === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\",\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof output === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map","/**\n * @_ignore\n */\nimport { getAddress } from \"../address/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.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) {\n return (array) => {\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 number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n energyLimit: getBigInt,\n energyUsed: getBigInt,\n miner: allowNull(getAddress),\n extraData: formatData,\n baseFeePerEnergy: allowNull(getBigInt),\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 energyUsed: getBigInt,\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeEnergyUsed: getBigInt,\n effectiveEnergyPrice: allowNull(getBigInt),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0),\n}, {\n effectiveEnergyPrice: [\"energyPrice\"],\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 && !getAddress(value.to) && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n //confirmations: allowNull(getNumber, null),\n from: getAddress,\n maxFeePerEnergy: allowNull(getBigInt),\n energyLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n networkId: allowNull(getBigInt, null),\n }, {\n data: [\"input\"],\n energyLimit: [\"energy\"],\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 // Compute the signature\n if (value.signature) {\n result.signature = value.signature;\n }\n else {\n result.signature = value;\n }\n // Some backends omit networkId on legacy transactions, but we can compute it\n if (result.networkId == null) {\n const networkId = result.signature.legacynetworkId;\n if (networkId != null) {\n result.networkId = networkId;\n }\n }\n // @TODO: check networkId\n /*\n if (value.networkId != null) {\n let networkId = value.networkId;\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n result.networkId = networkId;\n\n } else {\n let networkId = value.networkId;\n\n // geth-etc returns networkId\n if (networkId == null && result.v == null) {\n networkId = value.networkId;\n }\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n if (typeof(networkId) !== \"number\" && result.v != null) {\n networkId = (result.v - 35) / 2;\n if (networkId < 0) { networkId = 0; }\n networkId = parseInt(networkId);\n }\n\n if (typeof(networkId) !== \"number\") { networkId = 0; }\n\n result.networkId = networkId;\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 { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nexport class NetworkPlugin {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\nexport class EnergyCostPlugin extends NetworkPlugin {\n effectiveBlock;\n txBase;\n txCreate;\n txDataZero;\n txDataNonzero;\n txAccessListStorageKey;\n txAccessListAddress;\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.corebc.network.plugins.EnergyCost#${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 clone() {\n return new EnergyCostPlugin(this.effectiveBlock, this);\n }\n}\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n constructor(feeDataFunc) {\n super(\"org.corebc.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\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 * About networks\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { getBigInt, assertArgument } from \"../utils/index.js\";\nimport { EnergyCostPlugin } from \"./plugins-network.js\";\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*/\n// Networks or clients with a higher need for security (such as clients\n// that may automatically make CCIP requests without user interaction)\n// can use this plugin to anonymize requests or intercept CCIP requests\n// to notify and/or receive authorization from the user\nconst Networks = new Map();\nexport class Network {\n #name;\n #networkId;\n #plugins;\n constructor(name, networkId) {\n this.#name = name;\n this.#networkId = getBigInt(networkId);\n this.#plugins = new Map();\n }\n toJSON() {\n return { name: this.name, networkId: String(this.networkId) };\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() {\n return this.#name;\n }\n set name(value) {\n this.#name = value;\n }\n /**\n * The network chain ID.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value, \"networkId\");\n }\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.networkId === 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.networkId === getBigInt(other);\n }\n catch (error) { }\n return false;\n }\n if (typeof other === \"object\") {\n if (other.networkId != null) {\n try {\n return this.networkId === getBigInt(other.networkId);\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.networkId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic energy required for a transaction.\n *\n * A EnergyCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicEnergy(tx) {\n const costs = this.getPlugin(\"org.corebc.plugins.network.EnergyCost\") || new EnergyCostPlugin();\n let energy = costs.txBase;\n if (tx.to == null) {\n energy += 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 energy += costs.txDataZero;\n }\n else {\n energy += costs.txDataNonzero;\n }\n }\n }\n return energy;\n }\n /**\n * Returns a new Network for the %%network%% name or networkId.\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.networkId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof network === \"object\") {\n assertArgument(typeof network.name === \"string\" &&\n typeof network.networkId === \"number\", \"invalid network object name or networkId\", \"network\", network);\n const custom = new Network(network.name, network.networkId);\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrnetworkId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrnetworkId, networkFunc) {\n if (typeof nameOrnetworkId === \"number\") {\n nameOrnetworkId = BigInt(nameOrnetworkId);\n }\n const existing = Networks.get(nameOrnetworkId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrnetworkId\", nameOrnetworkId);\n }\n Networks.set(nameOrnetworkId, networkFunc);\n }\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Core networks\n function registerEth(name, networkId, options) {\n const func = function () {\n const network = new Network(name, networkId);\n network.attachPlugin(new EnergyCostPlugin());\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(networkId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\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 registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map","import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * @TODO\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\",\n info: { event },\n });\n}\n// @TODO: refactor this\n/**\n * @TODO\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 constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n get pollingInterval() {\n return this.#interval;\n }\n set pollingInterval(value) {\n this.#interval = value;\n }\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\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) {\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n/**\n * @TODO\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\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 * @TODO\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 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 this.#blockNumber = blockNumber;\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\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 * About Subclassing the Provider...\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/checks.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 { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse, } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse, } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber, } from \"./subscriber-polling.js\";\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return value && typeof value.then === \"function\";\n}\nfunction getTag(prefix, value) {\n return (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 // 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}\nexport class UnmanagedSubscriber {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\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 \"pending\":\n case \"debug\":\n case \"error\":\n case \"network\": {\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 {\n type: \"orphan\",\n tag: getTag(\"orphan\", event),\n filter: copy(event),\n };\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));\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() {\n return new Date().getTime();\n}\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\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 // @TODO: This should be a () => Promise so network can be\n // done when needed; or rely entirely on _detectNetwork?\n constructor(_network) {\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(() => {\n this.emit(\"network\", network, null);\n }, 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.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get provider() {\n return this;\n }\n get plugins() {\n return Array.from(this.#plugins.values());\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 getPlugin(name) {\n return this.#plugins.get(name) || null;\n }\n get disableCcipRead() {\n return this.#disableCcipRead;\n }\n set disableCcipRead(value) {\n this.#disableCcipRead = !!value;\n }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\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 }, 250);\n }\n return await perform;\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\", {\n action: \"sendCcipReadFetchRequest\",\n request,\n index: i,\n urls,\n });\n let errorMessage = \"unknown error\";\n const resp = await request.send();\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchResult\",\n request,\n result,\n });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchError\",\n request,\n result,\n });\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\", {\n reason: \"404_MISSING_RESOURCE\",\n transaction: tx,\n info: { url, errorMessage },\n });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages\n .map((m) => JSON.stringify(m))\n .join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx,\n info: { urls, errorMessages },\n });\n }\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\",\n });\n }\n // Sub-classes should override this and handle PerformActionRequest requests, calling\n // the super for any unhandled actions.\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 _getAddress(address) {\n return resolveAddress(address);\n }\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"latest\":\n case \"pending\":\n case \"safe\":\n case \"finalized\":\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 _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:\n 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 _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]);\n if (isPromise(addr)) {\n promises.push((async function () {\n request[key] = await addr;\n })());\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 () {\n request.blockTag = await blockTag;\n })());\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 = this._detectNetwork().then((network) => {\n this.emit(\"network\", network, null);\n return network;\n }, (error) => {\n // Reset the networkPromise on failure, so we will try again\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\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, // Possibly an explicit Network\n this._detectNetwork(), // The actual connected network\n ]);\n if (expected.networkId !== actual.networkId) {\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.networkId} => ${actual.networkId} `, \"NETWORK_ERROR\", {\n event: \"changed\",\n });\n }\n }\n return expected.clone();\n }\n async getEnergyPrice() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async getFeeData() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async estimateEnergy(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateEnergy\",\n 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 return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead &&\n isCallException(error) &&\n error.data &&\n attempt >= 0 &&\n blockTag === \"latest\" &&\n transaction.to != null &&\n dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to);\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\",\n transaction,\n 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, // @TODO: populate data?\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\",\n transaction,\n info: { data: error.data, errorArgs: ccipArgs.errorArgs },\n });\n const tx = {\n to: txSender,\n data: concat([\n ccipArgs.selector,\n encodeBytes([ccipResult, ccipArgs.extraData]),\n ]),\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\", {\n action: \"receiveCcipReadCallResult\",\n transaction: Object.assign({}, tx),\n result,\n });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadCallError\",\n transaction: Object.assign({}, tx),\n error,\n });\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\",\n blockHash: block,\n 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\",\n blockTag,\n 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 effectiveEnergyPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.energyPrice == null && params.effectiveEnergyPrice == 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 effectiveEnergyPrice\");\n }\n params.effectiveEnergyPrice = tx.energyPrice;\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(networkId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\",\n });\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 _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 _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 _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n // Event API; sub-classes should override this; any supported\n // event filter will have been munged into an EventFilter\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 return new PollingBlockSubscriber(this);\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 _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\" &&\n emitArgs &&\n emitArgs.length > 0 &&\n 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 = {\n subscriber,\n tag,\n addressableMap,\n nameMap,\n started: false,\n listeners: [],\n };\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 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\n .map(({ listener }) => listener)\n .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 // Sub-classes should override this to shutdown any sockets, etc.\n // but MUST call this super.shutdown.\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 }\n get paused() {\n return this.#pausedState != null;\n }\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 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 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: \"\",\n urls: [],\n calldata: \"\",\n selector: \"\",\n extraData: \"\",\n 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\"\n .split(/,/)\n .map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map","/**\n * About Abstract Signer and subclassing\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/checks.js\";\nimport { getAddress } 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);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).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}\nexport class AbstractSigner {\n provider;\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.energyLimit == null) {\n pop.energyLimit = await this.estimateEnergy(pop);\n }\n // Populate the chain ID\n const network = await this.provider.getNetwork();\n if (pop.networkId != null) {\n const networkId = getBigInt(pop.networkId);\n assertArgument(networkId === network.networkId, \"transaction networkId mismatch\", \"tx.networkId\", tx.networkId);\n }\n else {\n pop.networkId = network.networkId;\n }\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n // We need to auto-detect the intended type of this transaction...\n if (feeData.energyPrice != null) {\n // Network doesn't support EIP-1559...\n // Populate missing fee data\n if (pop.energyPrice == null) {\n pop.energyPrice = feeData.energyPrice;\n }\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 //@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 estimateEnergy(tx) {\n return checkProvider(this, \"estimateEnergy\").estimateEnergy(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 return getAddress(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}\nexport class VoidSigner extends AbstractSigner {\n address;\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\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","/**\n * There are many awesome community services that provide Core\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in tht console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n}\n//# sourceMappingURL=community.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 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 _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\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\") ||\n error.operation !== \"xcb_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.networkId !== network.networkId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"xcb_getFilterChanges\", [\n filterId,\n ]);\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 this.#provider.send(\"xcb_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() {\n this.start();\n }\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 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(\"xcb_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(\"xcb_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 * About JSON-RPC...\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, 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\";\nimport { resolveAddress } from \"../address/checks.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) => {\n setTimeout(resolve, duration);\n });\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, // 10ms\n batchMaxSize: 1 << 20, // 1Mb\n batchMaxCount: 100, // 100 requests\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);\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 xcb_sendTransaction uses 90000 energy; 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.energyLimit == null) {\n promises.push((async () => {\n tx.energyLimit = await this.provider.estimateEnergy({\n ...tx,\n from: this.address,\n });\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);\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(\"xcb_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 const checkTx = async () => {\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 // Wait another 4 seconds\n this.provider._setTimeout(() => {\n checkTx();\n }, 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);\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(\"xcb_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),\n 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(\"xcb_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(),\n password,\n null,\n ]);\n }\n async _legacySignMessage(_message) {\n const message = typeof _message === \"string\" ? toUtf8Bytes(_message) : _message;\n return await this.provider.send(\"xcb_sign\", [\n this.address.toLowerCase(),\n 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 #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no hard in sending it immeidately\n const stallTime = this._getOption(\"batchMaxCount\") === 1\n ? 0\n : 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 // console.log({payload})\n const result = await this._send(payload);\n // console.log({result})\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\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 return reject(makeError(\"no response from server\", \"BAD_DATA\", {\n value: result,\n info: { payload },\n }));\n }\n // The response is an error\n if (\"error\" in resp) {\n return reject(this.getRpcError(payload, resp));\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);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n // Make sure any static network is compatbile with the provided netwrok\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (staticNetwork) {\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 {\n assert(false, \"sub-classes must override _send\", \"UNSUPPORTED_OPERATION\", {\n operation: \"jsonRpcApiProvider._send\"\n });\n }\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 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 return network;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n return Network.from(getBigInt(await this.send(\"xcb_networkId\", [])));\n }\n // We are not ready yet; use the primitive _send\n const payload = {\n id: this.#nextId++,\n method: \"xcb_networkId\",\n params: [],\n jsonrpc: \"2.0\",\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n }\n catch (error) {\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 /**\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) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n console.log(\"JsonRpcProvider failed to startup; retry in 1s\");\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() {\n return this.#notReady == null;\n }\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 [\n \"networkId\",\n \"energyLimit\",\n \"energyPrice\",\n \"type\",\n \"nonce\",\n \"value\",\n ].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"energyLimit\") {\n dstKey = \"energy\";\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 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 \"networkId\":\n return { method: \"xcb_networkId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"xcb_blockNumber\", args: [] };\n case \"getEnergyPrice\":\n return { method: \"xcb_energyPrice\", args: [] };\n case \"getBalance\": {\n return {\n method: \"xcb_getBalance\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n }\n case \"getTransactionCount\":\n return {\n method: \"xcb_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getCode\":\n return {\n method: \"xcb_getCode\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getStorage\":\n return {\n method: \"xcb_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: \"xcb_sendRawTransaction\",\n args: [req.signedTransaction],\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"xcb_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions],\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"xcb_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions],\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"xcb_getTransactionByHash\",\n args: [req.hash],\n };\n case \"getTransactionReceipt\":\n return {\n method: \"xcb_getTransactionReceipt\",\n args: [req.hash],\n };\n case \"call\":\n return {\n method: \"xcb_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag],\n };\n case \"estimateEnergy\": {\n return {\n method: \"xcb_estimateEnergy\",\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: \"xcb_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an CoreBC-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 === \"xcb_estimateEnergy\" && 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 }\n if (method === \"xcb_call\" || method === \"xcb_estimateEnergy\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException(method === \"xcb_call\" ? \"call\" : \"estimateEnergy\", payload.params[0], result ? result.data : null);\n e.info = { error, payload };\n return e;\n }\n // Only estimateEnergy 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\" &&\n error.message.match(/user denied|corebc-user-denied/i)) {\n const actionMap = {\n xcb_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n xcb_signTypedData_v4: \"signTypedData\",\n xcb_signTransaction: \"signTransaction\",\n xcb_sendTransaction: \"sendTransaction\",\n xcb_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 === \"xcb_sendRawTransaction\" ||\n method === \"xcb_sendTransaction\") {\n const transaction = payload.params[0];\n if (message.match(/insufficient funds|base fee exceeds energy limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction,\n 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\", {\n transaction,\n info: { error },\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) &&\n message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction,\n info: { error },\n });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method,\n info: { transaction, info: { error } },\n });\n }\n }\n if (message.match(/the method .* does not exist/i)) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method,\n info: { error },\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error });\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 networkId?? purge on switch_networks\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve,\n 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(\"xcb_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(\"xcb_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n}\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n this.#pollingInterval = 4000;\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() {\n return this.#pollingInterval;\n }\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. xcb_networkId) 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\" &&\n value.message.match(\"reverted\") &&\n 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 * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/xcb_goerli\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AnkrProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"xcb_sendRawTransaction\") {\n if (error &&\n error.error &&\n error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n}\n//# sourceMappingURL=provider-ankr.js.map","/**\n * About Alchemy\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.alchemyapi.io\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AlchemyProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash),\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = trace[0].error === \"Reverted\";\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null, // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", {\n value: trace,\n });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map","/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https://cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map","function getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map","/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\nexport class SocketSubscriber {\n #provider;\n #filter;\n get filter() {\n return JSON.parse(this.#filter);\n }\n #filterId;\n #paused;\n #emitPromise;\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider\n .send(\"xcb_subscribe\", this.filter)\n .then((filterId) => {\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n this.#filterId.then((filterId) => {\n this.#provider.send(\"xcb_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\nexport class SocketBlockSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\nexport class SocketPendingSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n get logFilter() {\n return JSON.parse(this.#logFilter);\n }\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * SocketProvider...\n *\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n constructor(network) {\n super(network, { batchMaxCount: 1 });\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n\n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n\n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n // Sub-classes must call this for each message\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (\"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result,\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result.method === \"xcb_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n }\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map","import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network) {\n super(network);\n if (typeof url === \"string\") {\n this.#connect = () => {\n return new _WebSocket(url);\n };\n this.#websocket = this.#connect();\n }\n else if (typeof url === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n*/\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map","/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret,\n });\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(networkId) {\n try {\n return new InfuraProvider(networkId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map","/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"corebc.quiknode.pro\";\n case \"arbitrum\":\n return \"corebc.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"corebc.arbitrum-goerli.quiknode.pro\";\n case \"matic\":\n return \"corebc.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"corebc.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"corebc.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"corebc.optimism-goerli.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(networkId) {\n try {\n return new QuickNodeProvider(networkId, this.token);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.token === defaultToken;\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map","/**\n * Explain all the nitty-gritty about the **FallbackProvider**.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { getBigInt, getNumber, assert, assertArgument, } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\nfunction getTime() {\n return new Date().getTime();\n}\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof value === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2,\n requests: 0,\n lateResponses: 0,\n errorResponses: 0,\n outOfSync: -1,\n unsupportedEvents: 0,\n rollingDuration: 0,\n score: 0,\n _network: null,\n _updateNumber: null,\n _totalTime: 0,\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + value.map(_normalize).join(\",\") + \"]\";\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{\" +\n keys\n .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`)\n .join(\",\") +\n \"}\");\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(value) {\n if (\"error\" in value) {\n const error = value.error;\n return { tag: _normalize(error), value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum &&\n (weight > bestWeight ||\n (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A Fallback Provider.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n quorum;\n eventQuorum;\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n constructor(providers, network) {\n super(network);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n this.quorum = 2; //Math.ceil(providers.length / 2);\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), \"quorum exceed provider wieght\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"networkId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"networkId\":\n return (await provider.getNetwork()).networkId;\n case \"estimateEnergy\":\n return await provider.estimateEnergy(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = \"blockHash\" in req ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getEnergyPrice\":\n return (await provider.getFeeData()).energyPrice;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => b.priority - a.priority);\n for (const config of allConfigs) {\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config,\n result: null,\n didBump: false,\n perform: null,\n staller: null,\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = getTime() - now;\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push(waitForSync(config, 0));\n promises.push((async () => {\n config._network = await config.provider.getNetwork();\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let networkId = null;\n for (const config of this.#configs) {\n const network = config._network;\n if (networkId == null) {\n networkId = network.networkId;\n }\n else if (network.networkId !== networkId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\",\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight,\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getEnergyPrice\":\n case \"estimateEnergy\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"networkId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`,\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: {\n request: req,\n results: Array.from(running).map((r) => stringify(r.result)),\n },\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => {\n try {\n const result = await provider._perform(req);\n return Object.assign(normalizeResult({ result }), { weight });\n }\n catch (error) {\n return Object.assign(normalizeResult({ error }), { weight });\n }\n }));\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) },\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n for (let i = 0; i < this.quorum; i++) {\n this.#addRunner(running, req);\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map","import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value &&\n typeof value.send === \"function\" &&\n typeof value.close === \"function\");\n}\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n if (typeof network === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if ((typeof network === \"string\" && network.match(/^wss?:/)) ||\n isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n const providers = [];\n if (options.alchemy !== \"-\") {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.ankr !== \"-\" && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.cloudflare !== \"-\") {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.infura !== \"-\") {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof projectId === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) {\n console.log(error);\n }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n*/\n if (options.quicknode !== \"-\") {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) {\n console.log(error);\n }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\",\n });\n if (providers.length === 1) {\n return providers[0];\n }\n return new FallbackProvider(providers);\n}\n//# sourceMappingURL=default-provider.js.map","import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nexport class NonceManager extends AbstractSigner {\n signer;\n #noncePromise;\n #delta;\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n increment() {\n this.#delta++;\n }\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n constructor(core, network) {\n super(network, { batchMaxCount: 1 });\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await core.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [\n {\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message },\n },\n ];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `corebc-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `corebc-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"xcb_accounts\", []);\n if (typeof address === \"number\") {\n return accounts.length > address;\n }\n address = address.toLowerCase();\n return (accounts.filter((a) => a.toLowerCase() === address).length !== 0);\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n //const resp =\n await this.#request(\"xcb_requestAccounts\", []);\n //console.log(\"RESP\", resp);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n}\n//# sourceMappingURL=provider-browser.js.map","/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, {\n applicationId,\n applicationSecret,\n });\n }\n _getProvider(networkId) {\n try {\n return new PocketProvider(networkId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return this.applicationId === defaultApplicationId;\n }\n}\n//# sourceMappingURL=provider-pocket.js.map","const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map","import { getAddress } from \"../address/index.js\";\nimport { hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, resolveProperties, assert, assertArgument, } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n prefix;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor({ signingKey, prefix, provider, }) {\n super(provider);\n this.prefix = prefix;\n assertArgument(signingKey && typeof signingKey.sign === \"function\", \"invalid signingKey key\", \"signingKey\", \"[ REDACTED ]\");\n this.#signingKey = signingKey;\n const address = computeAddress(this.#signingKey, prefix);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() {\n return this.#signingKey;\n }\n /**\n * The private key for this wallet.\n */\n get privateKey() {\n return this.signingKey.privateKey;\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new BaseWallet({\n signingKey: this.#signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n async signTransaction(tx) {\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: tx.to || undefined,\n from: tx.from || undefined,\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress(tx.from) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n const unSignedSerialized = btx.unsignedSerialized;\n const unsignedHash = sha256(unSignedSerialized);\n // sha256(btx.unsignedSerialized)\n btx.signature = this.signingKey.sign(unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name },\n });\n const address = getAddress(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name,\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value));\n }\n}\n//# sourceMappingURL=base-wallet.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca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dNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"en\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map","/*! https://mths.be/utf8js v3.0.0 by @mathias */\n;(function(root) {\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tthrow Error(\n\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t' is not a scalar value'\n\t\t\t);\n\t\t}\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tcheckScalarValue(codePoint);\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string) {\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol() {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\tcheckScalarValue(codePoint);\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString) {\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol()) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\troot.version = '3.0.0';\n\troot.encode = utf8encode;\n\troot.decode = utf8decode;\n\n}(typeof exports === 'undefined' ? this.utf8 = {} : exports));\n","import { Buffer } from \"buffer\";\nimport { pbkdf2Sync } from \"../crypto/crypto.js\";\nimport utf8 from \"utf8\";\nexport function mnemonicToSeed(mnemonic, password) {\n if (!password) {\n password = \"\";\n }\n const t = generateSeed(mnemonic, password);\n return t.goldilock;\n}\nconst generateSeed = (mnemonic, password) => {\n const goldilockSaltPrefix = \"mnemonic\";\n const aesSaltPrefix = \"mnemonicfortheAESkey\";\n const goldilockSalt = utf8.encode(goldilockSaltPrefix + password);\n const aesSalt = utf8.encode(aesSaltPrefix + password);\n const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(goldilockSalt), 2048, 64, \"sha512\");\n const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(aesSalt), 2048, 64, \"sha512\");\n return {\n aes: Buffer.from(aesKeySeed).toString(\"hex\"),\n goldilock: Buffer.from(goldilockKey).toString(\"hex\"),\n };\n};\n//# sourceMappingURL=mnemonicToSeed.js.map","import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { legacySha256 } from \"../crypto/sha3.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return (((1 << bits) - 1) << (8 - bits)) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset++;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) &\n getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n return mnemonicToSeed(this.phrase, this.password);\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase({ phrase, password, wordlist, }) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingURL=mnemonic.js.map","/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */\n(function(root) {\n \"use strict\";\n\n function checkInt(value) {\n return (parseInt(value) === value);\n }\n\n function checkInts(arrayish) {\n if (!checkInt(arrayish.length)) { return false; }\n\n for (var i = 0; i < arrayish.length; i++) {\n if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {\n return false;\n }\n }\n\n return true;\n }\n\n function coerceArray(arg, copy) {\n\n // ArrayBuffer view\n if (arg.buffer && arg.name === 'Uint8Array') {\n\n if (copy) {\n if (arg.slice) {\n arg = arg.slice();\n } else {\n arg = Array.prototype.slice.call(arg);\n }\n }\n\n return arg;\n }\n\n // It's an array; check it is a valid representation of a byte\n if (Array.isArray(arg)) {\n if (!checkInts(arg)) {\n throw new Error('Array contains invalid value: ' + arg);\n }\n\n return new Uint8Array(arg);\n }\n\n // Something else, but behaves like an array (maybe a Buffer? Arguments?)\n if (checkInt(arg.length) && checkInts(arg)) {\n return new Uint8Array(arg);\n }\n\n throw new Error('unsupported array-like object');\n }\n\n function createArray(length) {\n return new Uint8Array(length);\n }\n\n function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {\n if (sourceStart != null || sourceEnd != null) {\n if (sourceArray.slice) {\n sourceArray = sourceArray.slice(sourceStart, sourceEnd);\n } else {\n sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);\n }\n }\n targetArray.set(sourceArray, targetStart);\n }\n\n\n\n var convertUtf8 = (function() {\n function toBytes(text) {\n var result = [], i = 0;\n text = encodeURI(text);\n while (i < text.length) {\n var c = text.charCodeAt(i++);\n\n // if it is a % sign, encode the following 2 bytes as a hex value\n if (c === 37) {\n result.push(parseInt(text.substr(i, 2), 16))\n i += 2;\n\n // otherwise, just the actual byte\n } else {\n result.push(c)\n }\n }\n\n return coerceArray(result);\n }\n\n function fromBytes(bytes) {\n var result = [], i = 0;\n\n while (i < bytes.length) {\n var c = bytes[i];\n\n if (c < 128) {\n result.push(String.fromCharCode(c));\n i++;\n } else if (c > 191 && c < 224) {\n result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f)));\n i += 2;\n } else {\n result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f)));\n i += 3;\n }\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n var convertHex = (function() {\n function toBytes(text) {\n var result = [];\n for (var i = 0; i < text.length; i += 2) {\n result.push(parseInt(text.substr(i, 2), 16));\n }\n\n return result;\n }\n\n // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html\n var Hex = '0123456789abcdef';\n\n function fromBytes(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i++) {\n var v = bytes[i];\n result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]);\n }\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n\n // Number of rounds by keysize\n var numberOfRounds = {16: 10, 24: 12, 32: 14}\n\n // Round constant words\n var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n\n // S-box and Inverse S-box (S is for Substitution)\n var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd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xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n\n // Transformations for encryption\n var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\n var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\n var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\n var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n\n // Transformations for decryption\n var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\n var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\n var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\n var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n\n // Transformations for decryption key expansion\n var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\n var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\n var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\n var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\n\n function convertToInt32(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i += 4) {\n result.push(\n (bytes[i ] << 24) |\n (bytes[i + 1] << 16) |\n (bytes[i + 2] << 8) |\n bytes[i + 3]\n );\n }\n return result;\n }\n\n var AES = function(key) {\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n Object.defineProperty(this, 'key', {\n value: coerceArray(key, true)\n });\n\n this._prepare();\n }\n\n\n AES.prototype._prepare = function() {\n\n var rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new Error('invalid key size (must be 16, 24 or 32 bytes)');\n }\n\n // encryption round keys\n this._Ke = [];\n\n // decryption round keys\n this._Kd = [];\n\n for (var i = 0; i <= rounds; i++) {\n this._Ke.push([0, 0, 0, 0]);\n this._Kd.push([0, 0, 0, 0]);\n }\n\n var roundKeyCount = (rounds + 1) * 4;\n var KC = this.key.length / 4;\n\n // convert the key into ints\n var tk = convertToInt32(this.key);\n\n // copy values into round key arrays\n var index;\n for (var i = 0; i < KC; i++) {\n index = i >> 2;\n this._Ke[index][i % 4] = tk[i];\n this._Kd[rounds - index][i % 4] = tk[i];\n }\n\n // key expansion (fips-197 section 5.2)\n var rconpointer = 0;\n var t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[ tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (var i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n } else {\n for (var i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n\n tk[KC / 2] ^= (S[ tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n\n for (var i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n\n // copy values into round key arrays\n var i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n this._Ke[r][c] = tk[i];\n this._Kd[rounds - r][c] = tk[i++];\n t++;\n }\n }\n\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (var r = 1; r < rounds; r++) {\n for (var c = 0; c < 4; c++) {\n tt = this._Kd[r][c];\n this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[ tt & 0xFF]);\n }\n }\n }\n\n AES.prototype.encrypt = function(plaintext) {\n if (plaintext.length != 16) {\n throw new Error('invalid plaintext size (must be 16 bytes)');\n }\n\n var rounds = this._Ke.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(plaintext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Ke[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T1[(t[ i ] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[ t[(i + 3) % 4] & 0xff] ^\n this._Ke[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Ke[rounds][i];\n result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n AES.prototype.decrypt = function(ciphertext) {\n if (ciphertext.length != 16) {\n throw new Error('invalid ciphertext size (must be 16 bytes)');\n }\n\n var rounds = this._Kd.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(ciphertext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Kd[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T5[(t[ i ] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[ t[(i + 1) % 4] & 0xff] ^\n this._Kd[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Kd[rounds][i];\n result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n\n /**\n * Mode Of Operation - Electonic Codebook (ECB)\n */\n var ModeOfOperationECB = function(key) {\n if (!(this instanceof ModeOfOperationECB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Electronic Code Block\";\n this.name = \"ecb\";\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationECB.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n block = this._aes.encrypt(block);\n copyArray(block, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationECB.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n copyArray(block, plaintext, i);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Block Chaining (CBC)\n */\n var ModeOfOperationCBC = function(key, iv) {\n if (!(this instanceof ModeOfOperationCBC)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Block Chaining\";\n this.name = \"cbc\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastCipherblock = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCBC.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n\n for (var j = 0; j < 16; j++) {\n block[j] ^= this._lastCipherblock[j];\n }\n\n this._lastCipherblock = this._aes.encrypt(block);\n copyArray(this._lastCipherblock, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n\n for (var j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ this._lastCipherblock[j];\n }\n\n copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Feedback (CFB)\n */\n var ModeOfOperationCFB = function(key, iv, segmentSize) {\n if (!(this instanceof ModeOfOperationCFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Feedback\";\n this.name = \"cfb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 size)');\n }\n\n if (!segmentSize) { segmentSize = 1; }\n\n this.segmentSize = segmentSize;\n\n this._shiftRegister = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCFB.prototype.encrypt = function(plaintext) {\n if ((plaintext.length % this.segmentSize) != 0) {\n throw new Error('invalid plaintext size (must be segmentSize bytes)');\n }\n\n var encrypted = coerceArray(plaintext, true);\n\n var xorSegment;\n for (var i = 0; i < encrypted.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n for (var j = 0; j < this.segmentSize; j++) {\n encrypted[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return encrypted;\n }\n\n ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {\n if ((ciphertext.length % this.segmentSize) != 0) {\n throw new Error('invalid ciphertext size (must be segmentSize bytes)');\n }\n\n var plaintext = coerceArray(ciphertext, true);\n\n var xorSegment;\n for (var i = 0; i < plaintext.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n plaintext[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return plaintext;\n }\n\n /**\n * Mode Of Operation - Output Feedback (OFB)\n */\n var ModeOfOperationOFB = function(key, iv) {\n if (!(this instanceof ModeOfOperationOFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Output Feedback\";\n this.name = \"ofb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastPrecipher = coerceArray(iv, true);\n this._lastPrecipherIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationOFB.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._lastPrecipherIndex === 16) {\n this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);\n this._lastPrecipherIndex = 0;\n }\n encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;\n\n\n /**\n * Counter object for CTR common mode of operation\n */\n var Counter = function(initialValue) {\n if (!(this instanceof Counter)) {\n throw Error('Counter must be instanitated with `new`');\n }\n\n // We allow 0, but anything false-ish uses the default 1\n if (initialValue !== 0 && !initialValue) { initialValue = 1; }\n\n if (typeof(initialValue) === 'number') {\n this._counter = createArray(16);\n this.setValue(initialValue);\n\n } else {\n this.setBytes(initialValue);\n }\n }\n\n Counter.prototype.setValue = function(value) {\n if (typeof(value) !== 'number' || parseInt(value) != value) {\n throw new Error('invalid counter value (must be an integer)');\n }\n\n // We cannot safely handle numbers beyond the safe range for integers\n if (value > Number.MAX_SAFE_INTEGER) {\n throw new Error('integer value out of safe range');\n }\n\n for (var index = 15; index >= 0; --index) {\n this._counter[index] = value % 256;\n value = parseInt(value / 256);\n }\n }\n\n Counter.prototype.setBytes = function(bytes) {\n bytes = coerceArray(bytes, true);\n\n if (bytes.length != 16) {\n throw new Error('invalid counter bytes size (must be 16 bytes)');\n }\n\n this._counter = bytes;\n };\n\n Counter.prototype.increment = function() {\n for (var i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n\n\n /**\n * Mode Of Operation - Counter (CTR)\n */\n var ModeOfOperationCTR = function(key, counter) {\n if (!(this instanceof ModeOfOperationCTR)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Counter\";\n this.name = \"ctr\";\n\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter)\n }\n\n this._counter = counter;\n\n this._remainingCounter = null;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCTR.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = this._aes.encrypt(this._counter._counter);\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;\n\n\n ///////////////////////\n // Padding\n\n // See:https://tools.ietf.org/html/rfc2315\n function pkcs7pad(data) {\n data = coerceArray(data, true);\n var padder = 16 - (data.length % 16);\n var result = createArray(data.length + padder);\n copyArray(data, result);\n for (var i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n }\n\n function pkcs7strip(data) {\n data = coerceArray(data, true);\n if (data.length < 16) { throw new Error('PKCS#7 invalid length'); }\n\n var padder = data[data.length - 1];\n if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); }\n\n var length = data.length - padder;\n for (var i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new Error('PKCS#7 invalid padding byte');\n }\n }\n\n var result = createArray(length);\n copyArray(data, result, 0, 0, length);\n return result;\n }\n\n ///////////////////////\n // Exporting\n\n\n // The block cipher\n var aesjs = {\n AES: AES,\n Counter: Counter,\n\n ModeOfOperation: {\n ecb: ModeOfOperationECB,\n cbc: ModeOfOperationCBC,\n cfb: ModeOfOperationCFB,\n ofb: ModeOfOperationOFB,\n ctr: ModeOfOperationCTR\n },\n\n utils: {\n hex: convertHex,\n utf8: convertUtf8\n },\n\n padding: {\n pkcs7: {\n pad: pkcs7pad,\n strip: pkcs7strip\n }\n },\n\n _arrayTest: {\n coerceArray: coerceArray,\n createArray: createArray,\n copyArray: copyArray,\n }\n };\n\n\n // node.js\n if (typeof exports !== 'undefined') {\n module.exports = aesjs\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define([], function() { return aesjs; });\n\n // Web Browsers\n } else {\n\n // If there was an existing library at \"aesjs\" make sure it's still available\n if (root.aesjs) {\n aesjs._aesjs = root.aesjs;\n }\n\n root.aesjs = aesjs;\n }\n\n\n})(this);\n","/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof hexString === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = \"0\" + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof password === \"string\") {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = match[4] === \"!\";\n let cur = object;\n for (const comp of path.toLowerCase().split(\".\")) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof cur === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof cur === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof cur) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map","/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Core along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { Counter, ModeOfOperation: { ctr: CTR }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from \"../crypto/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nimport { computeAddress, extractPrefix } from \"../transaction/address.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = data.version != null ? parseInt(data.version) : 0;\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, new Counter(iv));\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\",\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n const expectedMAC = spelunk(data, \"crypto.mac:string!\");\n let difference = 0;\n const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC);\n if (validMAC) {\n const actual = getBytes(\"0x\" + computedMAC);\n const expected = getBytes(\"0x\" + expectedMAC);\n for (let i = 0; i < actual.length; i++)\n difference |= actual[i] ^ expected[i];\n }\n assertArgument(validMAC && difference === 0, \"incorrect password\", \"password\", \"[REDACTED]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = getAddress(data.address);\n const prefix = extractPrefix(address);\n if (computeAddress(privateKey, prefix) !== address) {\n throw new Error(\"address mismatch\");\n }\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-corebc.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-corebc.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-corebc.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n account.mnemonic = {\n path: spelunk(data, \"x-corebc.path:string\") || defaultPath,\n locale: spelunk(data, \"x-corebc.locale:string\") || \"en\",\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))),\n };\n }\n return account;\n}\n// Match Core Web3Dart's wallet KDF resource limits.\nfunction validateScrypt(N, r, p) {\n assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, \"unsafe scrypt N\", \"kdf.N\", N);\n assertArgument(Number.isSafeInteger(r) &&\n Number.isSafeInteger(p) &&\n r > 0 &&\n p > 0 &&\n r * p <= 1048576 &&\n 128 * N * r <= 256 * 1024 * 1024, \"unsafe scrypt work or memory requirement\", \"kdf\", { N, r, p });\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof kdf === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n validateScrypt(N, r, p);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(prf === \"hmac-sha256\" || prf === \"hmac-sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, \"unsafe PBKDF2 iteration count\", \"kdf.c\", count);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return {\n name: \"pbkdf2\",\n salt,\n count,\n dkLen,\n algorithm: algorithm,\n };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = options.salt != null\n ? getBytes(options.salt, \"options.salt\")\n : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = 1 << 17, r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N != null) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r != null) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p != null) {\n p = options.scrypt.p;\n }\n }\n validateScrypt(N, r, p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = options.iv != null ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = options.uuid != null\n ? getBytes(options.uuid, \"options.uuid\")\n : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, new Counter(iv));\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = sha256(concat([macPrefix, ciphertext]));\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r,\n },\n mac: mac.substring(2),\n },\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = options.client != null ? options.client : `corebc/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = now.getUTCFullYear() +\n \"-\" +\n zpad(now.getUTCMonth() + 1, 2) +\n \"-\" +\n zpad(now.getUTCDate(), 2) +\n \"T\" +\n zpad(now.getUTCHours(), 2) +\n \"-\" +\n zpad(now.getUTCMinutes(), 2) +\n \"-\" +\n zpad(now.getUTCSeconds(), 2) +\n \".0Z\";\n const gethFilename = \"UTC--\" + timestamp + \"--\" + data.address;\n data[\"x-corebc\"] = {\n client,\n gethFilename,\n path,\n locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\",\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map","/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { dataSlice, defineProperties, getNumber, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\nimport { Ed448Goldilock } from \"../crypto/crypto.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// import { arrayify,\n// // hexDataSlice\n// } from \"../utils/data.js\";\n// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array {\n// const p = getBytes(password);\n// const s = getBytes(salt);\n// return getBytes(pbkdf2(p, s, 2048, 57, \"sha512\"));\n// }\n/**\n * The default derivation path for Core HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m\";\n// \"Bitcoin seed\"\n// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\n// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array {\n// b = getBytes(concat([b.slice(0, 53), \"0x00000000\"]));\n// b[0] &= 0xfc;\n// const c = new Uint8Array(57);\n// let hold = 0;\n// for (let i = 0; i < 57; i++) {\n// hold += a[i] + b[i];\n// c[i] = hold % 256;\n// hold = Math.floor(hold / 256);\n// }\n// return c;\n// };\nconst _guard = {};\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0 && (components[0] === \"m\" || node.depth > 0), \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n prefix;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n #seed;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) {\n super({\n signingKey,\n prefix,\n provider,\n });\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.publicKey });\n this.prefix = prefix;\n this.#seed = seed;\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint,\n fingerprint,\n path,\n index,\n depth,\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet({\n guard: _guard,\n signingKey: this.signingKey,\n parentFingerprint: this.parentFingerprint,\n path: this.path,\n index: this.index,\n depth: this.depth,\n seed: this.#seed,\n mnemonic: this.mnemonic,\n provider,\n prefix: this.prefix,\n });\n }\n #account() {\n const account = {\n address: this.address,\n privateKey: this.privateKey,\n };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy,\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, {\n progressCallback,\n });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() {\n return this.path != null;\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index));\n const newSigningKey = new SigningKey(newPrivateKey);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (_index & ~HardenedBit);\n if (_index & HardenedBit) {\n path += \"'\";\n }\n }\n return new HDNodeWallet({\n guard: _guard,\n signingKey: newSigningKey,\n parentFingerprint: this.fingerprint,\n path,\n index: _index,\n seed: this.#seed,\n depth: this.depth + 1,\n mnemonic: this.mnemonic,\n provider: this.provider,\n prefix: this.prefix,\n });\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed({ _seed, mnemonic, prefix, path, }) {\n const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0);\n const signingKey = new SigningKey(extendetPrivateKey);\n // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length })\n return new HDNodeWallet({\n seed: _seed,\n guard: _guard,\n signingKey,\n parentFingerprint: \"0x00000000\",\n path: path || defaultPath,\n index: 0,\n depth: 0,\n mnemonic,\n provider: null,\n prefix,\n });\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(prefix, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist);\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Create am HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, prefix, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n static mnemonicToSeed(mnemonic, password) {\n const seed = mnemonicToSeed(mnemonic, password);\n return seed;\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, password, path, wordlist, }) {\n if (!password) {\n password = \"\";\n }\n if (!path) {\n path = defaultPath;\n }\n if (!wordlist) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist });\n const _seed = mnemonic.computeSeed();\n return HDNodeWallet.#fromSeed({\n _seed,\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed({ seed, prefix, path, }) {\n return HDNodeWallet.#fromSeed({\n _seed: seed,\n mnemonic: null,\n path: path || defaultPath,\n prefix,\n });\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the acount at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map","/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n/**\n * Before Core launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive xcb\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Core Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && encseed.length % 16 === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map","import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { defaultPath, HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson, } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { extractPrefix } from \"../transaction/address.js\";\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected\n * to %%provider%%.\n */\n constructor({ key, prefix, provider, }) {\n if (typeof key === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = typeof key === \"string\" ? new SigningKey(key) : key;\n super({\n signingKey,\n prefix,\n provider,\n });\n }\n connect(provider) {\n return new Wallet({\n key: this.signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n const address = account.address;\n const prefix = extractPrefix(address);\n if (\"mnemonic\" in account &&\n account.mnemonic &&\n account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path);\n if (wallet.address === account.address &&\n wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet({\n key: account.privateKey,\n prefix,\n });\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the avavilable\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(prefix, provider) {\n const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, provider, password, }) {\n const wallet = HDNodeWallet.fromPhrase({\n phrase,\n prefix,\n password,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n static fromSeed({ seed, prefix, provider, path, }) {\n const wallet = HDNodeWallet.fromSeed({\n seed,\n prefix,\n path: path || defaultPath,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map","import { Contract } from \"../contract/index.js\";\nexport const customUnitAbi = Object.freeze([\n \"function supportsUnit(string unit) view returns (bool)\",\n \"function supportedUnits() view returns (string[])\",\n \"function preferredUnit() view returns (string)\",\n \"function balanceOf(address account) view returns (uint256)\",\n \"function balanceOfUnit(address account, string unit) view returns (uint256)\",\n]);\nexport class CustomUnitDiscovery {\n preferredUnit;\n supportedUnits;\n constructor(units, preferredUnit) {\n this.preferredUnit = preferredUnit;\n this.supportedUnits = Object.freeze([...units]);\n }\n get isValid() {\n return (this.supports(\"units\") &&\n this.preferredUnit !== \"\" &&\n this.supports(this.preferredUnit));\n }\n supports(unit) {\n return this.supportedUnits.includes(unit);\n }\n}\n/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */\nexport class CustomUnitBalance {\n canonicalAmount;\n unitAmount;\n unit;\n constructor(canonicalAmount, unitAmount, unit) {\n this.canonicalAmount = canonicalAmount;\n this.unitAmount = unitAmount;\n this.unit = unit;\n }\n get multiplierNumerator() {\n return this.unitAmount;\n }\n get multiplierDenominator() {\n return this.canonicalAmount;\n }\n}\n/** Core custom-unit contract convention used by Tone and Core API. */\nexport class CustomUnitToken {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, customUnitAbi, runner);\n }\n async supportsUnit(unit, blockTag) {\n return (unit.trim() !== \"\" &&\n (await this.contract.supportsUnit(unit.trim(), { blockTag })));\n }\n async supportedUnits(blockTag) {\n return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag })));\n }\n async preferredUnit(blockTag) {\n return (await this.contract.preferredUnit({ blockTag })).trim();\n }\n async discover(blockTag) {\n if (!(await this.supportsUnit(\"units\", blockTag)))\n return null;\n const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag));\n return discovery.isValid ? discovery : null;\n }\n canonicalBalance(account, blockTag) {\n return this.contract.balanceOf(account, { blockTag });\n }\n balanceOfUnit(account, unit, blockTag) {\n if (!unit.trim())\n throw new TypeError(\"unit must not be empty\");\n return this.contract.balanceOfUnit(account, unit.trim(), { blockTag });\n }\n async balance(account, unit, blockTag) {\n const resolved = unit?.trim() || (await this.preferredUnit(blockTag));\n const [canonical, calculated] = await Promise.all([\n this.canonicalBalance(account, blockTag),\n this.balanceOfUnit(account, resolved, blockTag),\n ]);\n return new CustomUnitBalance(canonical, calculated, resolved);\n }\n}\n//# sourceMappingURL=custom-units.js.map","import { Contract } from \"../contract/index.js\";\n/** On-chain interface defined by CIP-150. */\nexport const cip150Abi = Object.freeze([\n \"function getMetadataValue(string key) view returns (string value)\",\n \"function hasMetadataKey(string key) view returns (bool exists)\",\n \"function isMetadataSealed(string key) view returns (bool sealed)\",\n \"function listMetadataKeys() view returns (string[] keys)\",\n \"function getMetadataByIndex(uint256 index) view returns (string key, string value)\",\n \"function metadataCount() view returns (uint256 total)\",\n \"function setMetadataValue(string key, string value)\",\n \"function sealMetadataKey(string key)\",\n]);\nexport const cip151TokenExpirationKey = \"tokenExpiration\";\nexport const cip151TradingStopKey = \"tradingStop\";\nexport const cip152LabKey = \"lab\";\n/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */\nexport class Cip151Lifecycle {\n tokenExpiration;\n tradingStop;\n constructor(metadata = {}) {\n const parse = (key) => {\n const value = metadata[key];\n if (value == null || value === \"\")\n return null;\n if (!/^\\d+$/.test(value))\n throw new TypeError(`${key} must be a non-negative Unix timestamp`);\n return BigInt(value);\n };\n this.tokenExpiration = parse(cip151TokenExpirationKey);\n this.tradingStop = parse(cip151TradingStopKey);\n }\n isExpiredAt(seconds) {\n return this.tokenExpiration !== null && seconds >= this.tokenExpiration;\n }\n isTradingStoppedAt(seconds) {\n return this.tradingStop !== null && seconds >= this.tradingStop;\n }\n}\n/** Validates certificate structure, not the authenticity of its issuer. */\nexport class Cip152LabCertificate {\n measurements;\n constructor(json) {\n if (json === null || typeof json !== \"object\" || Array.isArray(json))\n throw new TypeError(\"CIP-152 lab.json must be an object\");\n const measurements = Object.create(null);\n for (const [key, property] of Object.entries(json)) {\n if (!property ||\n typeof property !== \"object\" ||\n Array.isArray(property) ||\n !Object.hasOwn(property, \"value\"))\n throw new TypeError(`CIP-152 property ${key} must contain a value`);\n const { value, unit } = property;\n if (!(typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value))))\n throw new TypeError(`CIP-152 property ${key} has an invalid value`);\n if (unit != null && typeof unit !== \"string\")\n throw new TypeError(`CIP-152 property ${key} has an invalid unit`);\n measurements[key] = Object.freeze(unit == null ? { value } : { value, unit });\n }\n this.measurements = Object.freeze(measurements);\n }\n}\n/** Typed metadata reader and writer. Writes require a signer as runner. */\nexport class Cip150MetadataContract {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, cip150Abi, runner);\n }\n getValue(key, blockTag) {\n return this.contract.getMetadataValue(key, { blockTag });\n }\n hasKey(key, blockTag) {\n return this.contract.hasMetadataKey(key, { blockTag });\n }\n isSealed(key, blockTag) {\n return this.contract.isMetadataSealed(key, { blockTag });\n }\n async listKeys(blockTag) {\n return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag })));\n }\n async getByIndex(index, blockTag) {\n const [key, value] = await this.contract.getMetadataByIndex(index, {\n blockTag,\n });\n return Object.freeze({ key, value });\n }\n count(blockTag) {\n return this.contract.metadataCount({ blockTag });\n }\n async readAll(blockTag, includeSealedState = true) {\n const entries = [];\n for (const key of await this.listKeys(blockTag)) {\n const value = await this.getValue(key, blockTag);\n entries.push(Object.freeze(includeSealedState\n ? { key, value, sealed: await this.isSealed(key, blockTag) }\n : { key, value }));\n }\n return Object.freeze(entries);\n }\n setValue(key, value, overrides = {}) {\n return this.contract.setMetadataValue(key, value, overrides);\n }\n sealKey(key, overrides = {}) {\n return this.contract.sealMetadataKey(key, overrides);\n }\n async readLifecycle(blockTag) {\n const metadata = {};\n for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) {\n if (await this.hasKey(key, blockTag))\n metadata[key] = await this.getValue(key, blockTag);\n }\n return new Cip151Lifecycle(metadata);\n }\n async readLabCertificate(gateway, blockTag) {\n if (!(await this.hasKey(cip152LabKey, blockTag)))\n return null;\n const reference = await this.getValue(cip152LabKey, blockTag);\n if (!gateway.resolve(reference).pathname.endsWith(\"/lab.json\"))\n throw new TypeError(\"CIP-152 reference must point to lab.json\");\n return new Cip152LabCertificate(await gateway.readJson(reference));\n }\n}\nexport { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from \"./custom-units.js\";\n//# sourceMappingURL=index.js.map","export const defaultIpfsGatewayTemplate = \"https://ipf.sk/{cid}\";\n/** Configurable IPFS resolution and bounded JSON loading. */\nexport class IpfsGateway {\n template;\n maxResponseBytes;\n timeoutMs;\n #fetch;\n constructor(options = {}) {\n this.template = options.template ?? defaultIpfsGatewayTemplate;\n this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024;\n this.timeoutMs = options.timeoutMs ?? 30_000;\n this.#fetch = options.fetch ?? globalThis.fetch;\n const templateUrl = new URL(this.template.replace(\"{cid}\", \"cid\"));\n if (!/^https?:$/.test(templateUrl.protocol) ||\n this.template.split(\"{cid}\").length !== 2)\n throw new TypeError(\"gateway template must be HTTP(S) and contain one {cid}\");\n for (const value of [this.maxResponseBytes, this.timeoutMs])\n if (!Number.isSafeInteger(value) || value <= 0)\n throw new TypeError(\"gateway limits must be positive safe integers\");\n }\n resolve(reference) {\n const value = reference.trim();\n if (/^https?:\\/\\//i.test(value))\n return new URL(value);\n const path = value.replace(/^ipfs:\\/\\//, \"\").replace(/^\\/?ipfs\\//, \"\");\n if (!/^[A-Za-z0-9]+(?:\\/[^?#]*)?$/.test(path) ||\n path.split(\"/\").some((part) => part === \".\" || part === \"..\"))\n throw new TypeError(\"invalid IPFS reference\");\n return new URL(this.template.replace(\"{cid}\", path.split(\"/\").map(encodeURIComponent).join(\"/\")));\n }\n async readJson(reference) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n let reader;\n try {\n const response = await this.#fetch(this.resolve(reference), {\n headers: { accept: \"application/json\" },\n signal: controller.signal,\n });\n if (!response.ok) {\n await response.body?.cancel();\n throw new Error(`IPFS gateway returned HTTP ${response.status}`);\n }\n if (!response.body)\n throw new Error(\"IPFS gateway returned an empty body\");\n reader = response.body.getReader();\n const chunks = [];\n let length = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done)\n break;\n length += value.length;\n if (length > this.maxResponseBytes)\n throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);\n chunks.push(value);\n }\n const bytes = new Uint8Array(length);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.length;\n }\n return JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes));\n }\n finally {\n clearTimeout(timer);\n await reader?.cancel().catch(() => { });\n reader?.releaseLock();\n }\n }\n}\n//# sourceMappingURL=index.js.map"],"names":["require$$0","require$$1","this","logger","stringify","isBytes","arrayifyInteger","unarrayifyInteger","_encode","_decodeChildren","_decode","decode","ripemd160","hmac","pbkdf2","u64.split","u64.rotrSH","u64.shrSH","u64.rotrSL","u64.shrSL","u64.rotrBH","u64.rotrBL","u64.add4L","u64.add4H","u64.add5L","u64.add5H","u64.add","u64.add3L","u64.add3H","sha256","sha512","Buffer","require$$2","require$$3","global","require$$4","ed448","BN_0","BN_1","locked","getTime","_a","_guard","getGlobal","randomBytes","removeHexPrefix","noble_ripemd160","crypto_random","scrypt","_nobleAsync","_nobleSync","H","BN_2","passProperties","getValue","BN_MAX_UINT256","RLP.decode","RLP.encode","_sha256","internal","PanicReasons","copy","stall","defaultApiKey","getHost","defaultPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,CAAA,QAAA,CAAA,UAAkB,GAAG;AACrB,CAAA,QAAA,CAAA,WAAmB,GAAG;AACtB,CAAA,QAAA,CAAA,aAAqB,GAA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ClC,YAAY;AACZ,YAAY,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC;AAChD,YAAY,IAAI,MAAM,GAAG,CAAC;AAC1B,YAAY,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;AACxC,gBAAgB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,gBAAgB,MAAM,IAAI,KAAK,CAAC,MAAM;AACtC,YAAY;AACZ,YAAY,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtF,QAAQ;AACR,gBAAgB;AAChB,YAAY,YAAY,CAAC,KAAK,CAAC;AAC/B,YAAY,MAAM,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACnD,YAAY,MAAM,EAAE,WAAW,EAAE;AACjC,QAAQ;AACR,IAAI;AACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,4,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,52,53,54,55,56,65,132,135]} \ No newline at end of file diff --git a/dist/corebc.min.js b/dist/corebc.min.js index e7175dcd3..986ddb5cd 100644 --- a/dist/corebc.min.js +++ b/dist/corebc.min.js @@ -1 +1 @@ -const __$G=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};import{Buffer as Buffer$1}from"buffer";export{Buffer}from"buffer";import ed448 from"bcrypto/lib/ed448-browser.js";import _BN from"bn.js";import pbkdf2$2 from"bcrypto/lib/pbkdf2-browser.js";import SHA3_512 from"bcrypto/lib/sha3-512.js";import utf8 from"utf8";import pkg from"aes-js";const version="6.4.0";let _permanentCensorErrors=false;let _censorErrors=false;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels["default"];let _globalLogger=null;function _checkNormalize(){try{const missing=[];["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing.push(form)}});if(missing.length){throw new Error("missing "+missing.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"]="UNPREDICTABLE_ENERGY_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{version="0.0.1";static errors=ErrorCode;static levels=LogLevel;constructor(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}_log(logLevel,args){const level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)}debug(...args){this._log(Logger.levels.DEBUG,args)}info(...args){this._log(Logger.levels.INFO,args)}warn(...args){this._log(Logger.levels.WARNING,args)}makeError(message,code,params){if(_censorErrors){return this.makeError("censored error",code,{})}if(!code){code=Logger.errors.UNKNOWN_ERROR}if(!params){params={}}const messageDetails=[];Object.keys(params).forEach(key=>{const value=params[key];try{if(value instanceof Uint8Array){let hex="";for(let i=0;i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push(`code=${code}`);messageDetails.push(`version=${this.version}`);const reason=message;if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}const error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error}throwError(message,code,params){throw this.makeError(message,code,params)}throwArgumentError(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})}assert(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)}assertArgument(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)}checkNormalize(message){if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}}checkSafeUint53(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}}checkArgumentCount(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}}checkNew(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}checkAbstract(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}static globalLogger(){if(!_globalLogger){_globalLogger=new Logger("logger/0.0.1")}return _globalLogger}static setCensorship(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent}static setLogLevel(logLevel){const level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level}static from(version){return new Logger(version)}}const logger$7=new Logger("utils/properties/0.0.1");function checkType(value,type,name){const types=type.split("|").map(t=>t.trim());for(let i=0;iPromise.resolve(value[k])));return results.reduce((accum,v,index)=>{accum[keys[index]]=v;return accum},{})}function defineProperties(target,values,types){for(let key in values){let value=values[key];const type=types?types[key]:null;if(type){checkType(value,type,key)}Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function checkProperties(object,properties){if(!object||typeof object!=="object"){logger$7.throwArgumentError("invalid object","object",object)}Object.keys(object).forEach(key=>{if(!properties[key]){logger$7.throwArgumentError("invalid object key - "+key,"transaction:"+key,object)}})}function stringify$1(value){if(value==null){return"null"}if(Array.isArray(value)){return"[ "+value.map(stringify$1).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify$1(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"number":return value.toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function isError(error,code){return error&&error.code===code}function isCallException(error){return isError(error,"CALL_EXCEPTION")}function makeError(message,code,info){{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify$1(info)}`)}for(const key in info){const value=info[key];details.push(key+"="+stringify$1(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}function assertArgumentCount(count,expectedCount,message){if(message==null){message=""}if(message){message=": "+message}assert(count>=expectedCount,"missing arguemnt"+message,"MISSING_ARGUMENT",{count:count,expectedCount:expectedCount});assert(count<=expectedCount,"too many arguemnts"+message,"UNEXPECTED_ARGUMENT",{count:count,expectedCount:expectedCount})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function assertNormalize(form){assert(_normalizeForms.indexOf(form)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:form}})}function assertPrivate(givenGuard,guard,className){if(className==null){className=""}if(givenGuard!==guard){let method=className,operation="new";if(className){method+=".";operation+=" "+className}assert(false,`private constructor; use ${method}from* methods`,"UNSUPPORTED_OPERATION",{operation:operation})}}const logger$6=new Logger("utils/data/0.0.1");function isHexable(value){return!!value.toHexString}function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(let i=0;i=256){return false}}return true}function _getBytes(value,name,copy){if(value instanceof Uint8Array){if(copy){return new Uint8Array(value)}return value}if(typeof value==="string"&&value.match(/^0x([0-9a-f][0-9a-f])*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;iNumber(item));value=new Uint8Array(v)}}if(typeof value==="number"){logger$6.checkSafeUint53(value,"invalid hexlify value");let hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger$6.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes(value)){let result="0x";for(let i=0;i>4]+HexCharacters[v&15]}return result}return logger$6.throwArgumentError("invalid hexlify value","value",value)}function concat(items){return"0x"+items.map(d=>hexlify(d).substring(2)).join("")}function hexDataSlice(data,offset,endOffset){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){logger$6.throwArgumentError("invalid hexData","value",data)}offset=2+2*offset;if(endOffset!=null){return"0x"+data.substring(offset,2+2*endOffset)}return"0x"+data.substring(offset)}function hexDataLength(data){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){return null}return(data.length-2)/2}function dataLength(data){if(isHexString(data,true)){return(data.length-2)/2}return getBytes(data).length}function dataSlice(data,start,end){const bytes=getBytes(data);if(end!=null&&end>bytes.length){assert(false,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:bytes,length:bytes.length,offset:end})}return hexlify(bytes.slice(start==null?0:start,end==null?bytes.length:end))}function stripZerosLeft(data){let bytes=hexlify(data).substring(2);while(bytes.startsWith("00")){bytes=bytes.substring(2)}return"0x"+bytes}function zeroPad(data,length,left){const bytes=getBytes(data);assert(length>=bytes.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(bytes),length:length,offset:length+1});const result=new Uint8Array(length);result.fill(0);if(left){result.set(bytes,length-bytes.length)}else{result.set(bytes,0)}return hexlify(result)}function zeroPadValue(data,length){return zeroPad(data,length,true)}function zeroPadBytes(data,length){return zeroPad(data,length,false)}function stripZeros(value){let result=arrayify(value);if(result.length===0){return result}let start=0;while(start{result+=hexlify(item).substring(2)});return result}var BN=_BN.BN;const logger$5=new Logger("bigNumber/0.0.1");const _constructorGuard={};const MAX_SAFE=9007199254740991;let _warnedToStringRadix=false;class BigNumber{_hex;_isBigNumber;constructor(constructorGuard,hex){logger$5.checkNew(new.target,BigNumber);if(constructorGuard!==_constructorGuard){logger$5.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"})}this._hex=hex;this._isBigNumber=true;Object.freeze(this)}fromTwos(value){return toBigNumber(toBN(this).fromTwos(value))}toTwos(value){return toBigNumber(toBN(this).toTwos(value))}abs(){if(this._hex[0]==="-"){return BigNumber.from(this._hex.substring(1))}return this}add(other){return toBigNumber(toBN(this).add(toBN(other)))}sub(other){return toBigNumber(toBN(this).sub(toBN(other)))}div(other){const o=BigNumber.from(other);if(o.isZero()){throwFault("division by zero","div")}return toBigNumber(toBN(this).div(toBN(other)))}mul(other){return toBigNumber(toBN(this).mul(toBN(other)))}mod(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot modulo negative values","mod")}return toBigNumber(toBN(this).umod(value))}pow(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot raise to negative values","pow")}return toBigNumber(toBN(this).pow(value))}and(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'and' negative values","and")}return toBigNumber(toBN(this).and(value))}or(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'or' negative values","or")}return toBigNumber(toBN(this).or(value))}xor(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'xor' negative values","xor")}return toBigNumber(toBN(this).xor(value))}mask(value){if(this.isNegative()||value<0){throwFault("cannot mask negative values","mask")}return toBigNumber(toBN(this).maskn(value))}shl(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shl")}return toBigNumber(toBN(this).shln(value))}shr(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shr")}return toBigNumber(toBN(this).shrn(value))}eq(other){return toBN(this).eq(toBN(other))}lt(other){return toBN(this).lt(toBN(other))}lte(other){return toBN(this).lte(toBN(other))}gt(other){return toBN(this).gt(toBN(other))}gte(other){return toBN(this).gte(toBN(other))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch(error){throwFault("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return logger$5.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){if(arguments.length>0){if(arguments[0]===10){if(!_warnedToStringRadix){_warnedToStringRadix=true;logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")}}else if(arguments[0]===16){logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{})}else{logger$5.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})}}return toBN(this).toString(10)}toHexString(){return this._hex}toJSON(key){return{type:"BigNumber",hex:this.toHexString()}}static from(value){if(value instanceof BigNumber){return value}if(typeof value==="string"){if(value.match(/^-?0x[0-9a-f]+$/i)){return new BigNumber(_constructorGuard,toHex(value))}if(value.match(/^-?[0-9]+$/)){return new BigNumber(_constructorGuard,toHex(new BN(value)))}return logger$5.throwArgumentError("invalid BigNumber string","value",value)}if(typeof value==="number"){if(value%1){throwFault("underflow","BigNumber.from",value)}if(value>=MAX_SAFE||value<=-MAX_SAFE){throwFault("overflow","BigNumber.from",value)}return BigNumber.from(String(value))}const anyValue=value;if(typeof anyValue==="bigint"){return BigNumber.from(anyValue.toString())}if(isBytes(anyValue)){return BigNumber.from(hexlify(anyValue))}if(anyValue){if(anyValue.toHexString){const hex=anyValue.toHexString();if(typeof hex==="string"){return BigNumber.from(hex)}}else{let hex=anyValue._hex;if(hex==null&&anyValue.type==="BigNumber"){hex=anyValue.hex}if(typeof hex==="string"){if(isHexString(hex)||hex[0]==="-"&&isHexString(hex.substring(1))){return BigNumber.from(hex)}}}}return logger$5.throwArgumentError("invalid BigNumber value","value",value)}static isBigNumber(value){return!!(value&&value._isBigNumber)}}function toHex(value){if(typeof value!=="string"){return toHex(value.toString(16))}if(value[0]==="-"){value=value.substring(1);if(value[0]==="-"){logger$5.throwArgumentError("invalid hex","value",value)}value=toHex(value);if(value==="0x00"){return value}return"-"+value}if(value.substring(0,2)!=="0x"){value="0x"+value}if(value==="0x"){return"0x00"}if(value.length%2){value="0x0"+value.substring(2)}while(value.length>4&&value.substring(0,4)==="0x00"){value="0x"+value.substring(4)}return value}function toBigNumber(value){return BigNumber.from(toHex(value))}function toBN(value){const hex=BigNumber.from(value).toHexString();if(hex[0]==="-"){return new BN("-"+hex.substring(3),16)}return new BN(hex.substring(2),16)}function throwFault(fault,operation,value){const params={fault:fault,operation:operation};if(value!=null){params.value=value}return logger$5.throwError(fault,Logger.errors.NUMERIC_FAULT,params)}const logger$4=new Logger("rlp/0.0.1");function arrayifyInteger$1(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function unarrayifyInteger$1(data,offset,length){let result=0;for(let i=0;ioffset+1+length){logger$4.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}}return{consumed:1+length,result:result}}function _decode$1(data,offset){if(data.length===0){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}if(data[offset]>=248){const lengthLength=data[offset]-247;if(offset+1+lengthLength>data.length){logger$4.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;if(offset+1+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;if(offset+1+lengthLength>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;if(offset+1+length>data.length){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlify(data[offset])}}function decode$1(data){const bytes=arrayify(data);const decoded=_decode$1(bytes,0);if(decoded.consumed!==bytes.length){logger$4.throwArgumentError("invalid rlp data","data",data)}return decoded.result}function number(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function bytes(b,...lengths){if(!(b instanceof Uint8Array))throw new Error("Expected Uint8Array");if(lengths.length>0&&!lengths.includes(b.length))throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`)}function hash(hash){if(typeof hash!=="function"||typeof hash.create!=="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(hash.outputLen);number(hash.blockLen)}function exists(instance,checkFinished=true){if(instance.destroyed)throw new Error("Hash instance has been destroyed");if(checkFinished&&instance.finished)throw new Error("Hash#digest() has already been called")}function output(out,instance){bytes(out);const min=instance.outputLen;if(out.lengtha instanceof Uint8Array;const u32=arr=>new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4));const createView=arr=>new DataView(arr.buffer,arr.byteOffset,arr.byteLength);const rotr=(word,shift)=>word<<32-shift|word>>>shift;const isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");const nextTick=async()=>{};async function asyncLoop(iters,tick,cb){let ts=Date.now();for(let i=0;i=0&&diffhashCons().update(toBytes(msg)).digest();const tmp=hashCons();hashC.outputLen=tmp.outputLen;hashC.blockLen=tmp.blockLen;hashC.create=()=>hashCons();return hashC}class HMAC extends Hash{constructor(hash$1,_key){super();this.finished=false;this.destroyed=false;hash(hash$1);const key=toBytes(_key);this.iHash=hash$1.create();if(typeof this.iHash.update!=="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const blockLen=this.blockLen;const pad=new Uint8Array(blockLen);pad.set(key.length>blockLen?hash$1.create().update(key).digest():key);for(let i=0;inew HMAC(hash,key).update(message).digest();hmac.create=(hash,key)=>new HMAC(hash,key);function pbkdf2Init(hash$1,_password,_salt,_opts){hash(hash$1);const opts=checkOpts({dkLen:32,asyncTick:10},_opts);const{c,dkLen,asyncTick}=opts;number(c);number(dkLen);number(asyncTick);if(c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const password=toBytes(_password);const salt=toBytes(_salt);const DK=new Uint8Array(dkLen);const PRF=hmac.create(hash$1,password);const PRFSalt=PRF._cloneInto().update(salt);return{c:c,dkLen:dkLen,asyncTick:asyncTick,DK:DK,PRF:PRF,PRFSalt:PRFSalt}}function pbkdf2Output(PRF,PRFSalt,DK,prfW,u){PRF.destroy();PRFSalt.destroy();if(prfW)prfW.destroy();u.fill(0);return DK}function pbkdf2$1(hash,password,salt,opts){const{c,dkLen,DK,PRF,PRFSalt}=pbkdf2Init(hash,password,salt,opts);let prfW;const arr=new Uint8Array(4);const view=createView(arr);const u=new Uint8Array(PRF.outputLen);for(let ti=1,pos=0;pos>_32n&_u32_max);const wl=Number(value&_u32_max);const h=isLE?4:0;const l=isLE?0:4;view.setUint32(byteOffset+h,wh,isLE);view.setUint32(byteOffset+l,wl,isLE)}class SHA2 extends Hash{constructor(blockLen,outputLen,padOffset,isLE){super();this.blockLen=blockLen;this.outputLen=outputLen;this.padOffset=padOffset;this.isLE=isLE;this.finished=false;this.length=0;this.pos=0;this.destroyed=false;this.buffer=new Uint8Array(blockLen);this.view=createView(this.buffer)}update(data){exists(this);const{view,buffer,blockLen}=this;data=toBytes(data);const len=data.length;for(let pos=0;posblockLen-pos){this.process(view,0);pos=0}for(let i=pos;istate.length)throw new Error("_sha2: outputLen bigger than state");for(let i=0;ia&b^~a&c;const Maj=(a,b,c)=>a&b^a&c^b&c;const SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);const IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);const SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,false);this.A=IV[0]|0;this.B=IV[1]|0;this.C=IV[2]|0;this.D=IV[3]|0;this.E=IV[4]|0;this.F=IV[5]|0;this.G=IV[6]|0;this.H=IV[7]|0}get(){const{A,B,C,D,E,F,G,H}=this;return[A,B,C,D,E,F,G,H]}set(A,B,C,D,E,F,G,H){this.A=A|0;this.B=B|0;this.C=C|0;this.D=D|0;this.E=E|0;this.F=F|0;this.G=G|0;this.H=H|0}process(view,offset){for(let i=0;i<16;i++,offset+=4)SHA256_W[i]=view.getUint32(offset,false);for(let i=16;i<64;i++){const W15=SHA256_W[i-15];const W2=SHA256_W[i-2];const s0=rotr(W15,7)^rotr(W15,18)^W15>>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0);this.buffer.fill(0)}}const sha256$1=wrapConstructor(()=>new SHA256);const U32_MASK64=BigInt(2**32-1);const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){let Ah=new Uint32Array(lst.length);let Al=new Uint32Array(lst.length);for(let i=0;iBigInt(h>>>0)<<_32n|BigInt(l>>>0);const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;const rotr32H=(_h,l)=>l;const rotr32L=(h,_l)=>h;const rotlSH=(h,l,s)=>h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;const u64={fromBig:fromBig,split:split,toBig:toBig,shrSH:shrSH,shrSL:shrSL,rotrSH:rotrSH,rotrSL:rotrSL,rotrBH:rotrBH,rotrBL:rotrBL,rotr32H:rotr32H,rotr32L:rotr32L,rotlSH:rotlSH,rotlSL:rotlSL,rotlBH:rotlBH,rotlBL:rotlBL,add:add,add3L:add3L,add3H:add3H,add4L:add4L,add4H:add4H,add5H:add5H,add5L:add5L};var u64$1=u64;const[SHA512_Kh,SHA512_Kl]=(()=>u64$1.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA512 extends SHA2{constructor(){super(128,64,16,false);this.Ah=1779033703|0;this.Al=4089235720|0;this.Bh=3144134277|0;this.Bl=2227873595|0;this.Ch=1013904242|0;this.Cl=4271175723|0;this.Dh=2773480762|0;this.Dl=1595750129|0;this.Eh=1359893119|0;this.El=2917565137|0;this.Fh=2600822924|0;this.Fl=725511199|0;this.Gh=528734635|0;this.Gl=4215389547|0;this.Hh=1541459225|0;this.Hl=327033209|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=u64$1.rotrSH(W15h,W15l,1)^u64$1.rotrSH(W15h,W15l,8)^u64$1.shrSH(W15h,W15l,7);const s0l=u64$1.rotrSL(W15h,W15l,1)^u64$1.rotrSL(W15h,W15l,8)^u64$1.shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=u64$1.rotrSH(W2h,W2l,19)^u64$1.rotrBH(W2h,W2l,61)^u64$1.shrSH(W2h,W2l,6);const s1l=u64$1.rotrSL(W2h,W2l,19)^u64$1.rotrBL(W2h,W2l,61)^u64$1.shrSL(W2h,W2l,6);const SUMl=u64$1.add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=u64$1.add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=u64$1.rotrSH(Eh,El,14)^u64$1.rotrSH(Eh,El,18)^u64$1.rotrBH(Eh,El,41);const sigma1l=u64$1.rotrSL(Eh,El,14)^u64$1.rotrSL(Eh,El,18)^u64$1.rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=u64$1.add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=u64$1.add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=u64$1.rotrSH(Ah,Al,28)^u64$1.rotrBH(Ah,Al,34)^u64$1.rotrBH(Ah,Al,39);const sigma0l=u64$1.rotrSL(Ah,Al,28)^u64$1.rotrBL(Ah,Al,34)^u64$1.rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=u64$1.add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=u64$1.add3L(T1l,sigma0l,MAJl);Ah=u64$1.add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=u64$1.add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=u64$1.add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=u64$1.add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=u64$1.add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=u64$1.add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=u64$1.add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=u64$1.add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=u64$1.add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){SHA512_W_H.fill(0);SHA512_W_L.fill(0)}destroy(){this.buffer.fill(0);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sha512$1=wrapConstructor(()=>new SHA512);const[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]];const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);function keccakP(s,rounds=24){const B=new Uint32Array(5*2);for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){for(let x=0;x<10;x++)B[x]=s[y+x];for(let x=0;x<10;x++)s[y+x]^=~B[(x+2)%10]&B[(x+4)%10]}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}B.fill(0)}class Keccak extends Hash{constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){super();this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.rounds=rounds;this.pos=0;this.posOut=0;this.finished=false;this.destroyed=false;number(outputLen);if(0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200);this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds);this.posOut=0;this.pos=0}update(data){exists(this);const{blockLen,state}=this;data=toBytes(data);const len=data.length;for(let pos=0;pos=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(out)}xof(bytes){number(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){output(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out);this.destroy();return out}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true;this.state.fill(0)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||(to=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds));to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.destroyed=this.destroyed;return to}}const gen=(suffix,blockLen,outputLen)=>wrapConstructor(()=>new Keccak(blockLen,suffix,outputLen));const sha3_256=gen(6,136,256/8);const sha3_512=gen(6,72,512/8);const keccak_256=gen(1,136,256/8);const BN_0$9=BigInt(0);const BN_1$5=BigInt(1);const maxValue=9007199254740991;function fromTwos(_value,_width){const value=getUint(_value,"value");const width=BigInt(getNumber(_width,"width"));assert(value>>width===BN_0$9,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:_value});if(value>>width-BN_1$5){const mask=(BN_1$5<=-maxValue&&value<=maxValue,"overflow",name||"value",value);return BigInt(value);case"string":try{if(value===""){throw new Error("empty string")}if(value[0]==="-"&&value[1]!=="-"){return-BigInt(value.substring(1))}return BigInt(value)}catch(e){assertArgument(false,`invalid BigNumberish string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid BigNumberish value",name||"value",value)}function getUint(value,name){const result=getBigInt(value,name);assert(result>=BN_0$9,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:value});return result}const Nibbles="0123456789abcdef";function toBigInt(value){if(value instanceof Uint8Array){let result="0x0";for(const v of value){result+=Nibbles[v>>4];result+=Nibbles[v&15]}return BigInt(result)}return getBigInt(value)}function getNumber(value,name){switch(typeof value){case"bigint":assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return Number(value);case"number":assertArgument(Number.isInteger(value),"underflow",name||"value",value);assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return value;case"string":try{if(value===""){throw new Error("empty string")}return getNumber(BigInt(value),name)}catch(e){assertArgument(false,`invalid numeric string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid numeric value",name||"value",value)}function toNumber(value){return getNumber(toBigInt(value))}function toBeHex(_value,_width){const value=getUint(_value,"value");let result=value.toString(16);if(_width==null){if(result.length%2){result="0"+result}}else{const width=getNumber(_width,"width");assert(width*2>=result.length,`value exceeds width (${width} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:_value});while(result.length>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){if(form!=null){assertNormalize(form);str=str.normalize(form)}let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}function toUtf8CodePoints(str,form){return getUtf8CodePoints(toUtf8Bytes(str,form))}async function getUrl(req,_signal){const protocol=req.url.split(":")[0].toLowerCase();assert(protocol==="http"||protocol==="https",`unsupported protocol ${protocol}`,"UNSUPPORTED_OPERATION",{info:{protocol:protocol},operation:"request"});assert(protocol==="https"||!req.credentials||req.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let signal=undefined;if(_signal){const controller=new AbortController;signal=controller.signal;_signal.addListener(()=>{controller.abort()})}const init={method:req.method,headers:new Headers(Array.from(req)),body:req.body||undefined,signal:signal};try{const resp=await fetch(req.url,init);const headers={};resp.headers.forEach((value,key)=>{headers[key.toLowerCase()]=value});const respBody=await resp.arrayBuffer();const body=respBody==null?null:new Uint8Array(respBody);return{statusCode:resp.status,statusMessage:resp.statusText,headers:headers,body:body}}catch(error){console.log({error:error});return undefined}}const MAX_ATTEMPTS=12;const SLOT_INTERVAL=250;let getUrlFunc=getUrl;const reData=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i");const reIpfs=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let locked$5=false;async function dataGatewayFunc(url,signal){try{const match=url.match(reData);if(!match){throw new Error("invalid data")}return new FetchResponse(200,"OK",{"content-type":match[1]||"text/plain"},match[2]?decodeBase64(match[3]):unpercent(match[3]))}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(url))}}function getIpfsGatewayFunc(baseUrl){async function gatewayIpfs(url,signal){try{const match=url.match(reIpfs);if(!match){throw new Error("invalid link")}return new FetchRequest(`${baseUrl}${match[2]}`)}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(url))}}return gatewayIpfs}const Gateways={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")};const fetchSignals=new WeakMap;class FetchCancelSignal{#listeners;#cancelled;constructor(request){this.#listeners=[];this.#cancelled=false;fetchSignals.set(request,()=>{if(this.#cancelled){return}this.#cancelled=true;for(const listener of this.#listeners){setTimeout(()=>{listener()},0)}this.#listeners=[]})}addListener(listener){assert(!this.#cancelled,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"});this.#listeners.push(listener)}get cancelled(){return this.#cancelled}checkSignal(){assert(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(signal){if(signal==null){throw new Error("missing signal; should not happen")}signal.checkSignal();return signal}class FetchRequest{#allowInsecure;#gzip;#headers;#method;#timeout;#url;#body;#bodyType;#creds;#preflight;#process;#retry;#signal;#throttle;get url(){return this.#url}set url(url){this.#url=String(url)}get body(){if(this.#body==null){return null}return new Uint8Array(this.#body)}set body(body){if(body==null){this.#body=undefined;this.#bodyType=undefined}else if(typeof body==="string"){this.#body=toUtf8Bytes(body);this.#bodyType="text/plain"}else if(body instanceof Uint8Array){this.#body=body;this.#bodyType="application/octet-stream"}else if(typeof body==="object"){this.#body=toUtf8Bytes(JSON.stringify(body));this.#bodyType="application/json"}else{throw new Error("invalid body")}}hasBody(){return this.#body!=null}get method(){if(this.#method){return this.#method}if(this.hasBody()){return"POST"}return"GET"}set method(method){if(method==null){method=""}this.#method=String(method).toUpperCase()}get headers(){const headers=Object.assign({},this.#headers);if(this.#creds){headers["authorization"]=`Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`}if(this.allowGzip){headers["accept-encoding"]="gzip"}if(headers["content-type"]==null&&this.#bodyType){headers["content-type"]=this.#bodyType}if(this.body){headers["content-length"]=String(this.body.length)}return headers}getHeader(key){return this.headers[key.toLowerCase()]}setHeader(key,value){this.#headers[String(key).toLowerCase()]=String(value)}clearHeaders(){this.#headers={}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index=0,"timeout must be non-zero","timeout",timeout);this.#timeout=timeout}get preflightFunc(){return this.#preflight||null}set preflightFunc(preflight){this.#preflight=preflight}get processFunc(){return this.#process||null}set processFunc(process){this.#process=process}get retryFunc(){return this.#retry||null}set retryFunc(retry){this.#retry=retry}constructor(url){this.#url=String(url);this.#allowInsecure=false;this.#gzip=true;this.#headers={};this.#method="";this.#timeout=3e5;this.#throttle={slotInterval:SLOT_INTERVAL,maxAttempts:MAX_ATTEMPTS}}toString(){return``}setThrottleParams(params){if(params.slotInterval!=null){this.#throttle.slotInterval=params.slotInterval}if(params.maxAttempts!=null){this.#throttle.maxAttempts=params.maxAttempts}}async#send(attempt,expires,delay,_request,_response){if(attempt>=this.#throttle.maxAttempts){return _response.makeServerError("exceeded maximum retry limit")}assert(getTime$2()<=expires,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:_request});if(delay>0){await wait(delay)}let req=this.clone();const scheme=(req.url.split(":")[0]||"").toLowerCase();if(scheme in Gateways){const result=await Gateways[scheme](req.url,checkSignal(_request.#signal));if(result instanceof FetchResponse){let response=result;if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}}}return response}req=result}if(this.preflightFunc){req=await this.preflightFunc(req)}const resp=await getUrlFunc(req,checkSignal(_request.#signal));let response=new FetchResponse(resp.statusCode,resp.statusMessage,resp.headers,resp.body,_request);if(response.statusCode===301||response.statusCode===302){try{const location=response.headers.location||"";return req.redirect(location).#send(attempt+1,expires,0,_request,response)}catch(error){}return response}else if(response.statusCode===429){if(this.retryFunc==null||await this.retryFunc(req,response,attempt)){const retryAfter=response.headers["retry-after"];let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(typeof retryAfter==="string"&&retryAfter.match(/^[1-9][0-9]*$/)){delay=parseInt(retryAfter)}return req.clone().#send(attempt+1,expires,delay,_request,response)}}if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(error.stall>=0){delay=error.stall}return req.clone().#send(attempt+1,expires,delay,_request,response)}}return response}send(){assert(this.#signal==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"});this.#signal=new FetchCancelSignal(this);return this.#send(0,getTime$2()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){assert(this.#signal!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const signal=fetchSignals.get(this);if(!signal){throw new Error("missing signal; should not happen")}signal()}redirect(location){const current=this.url.split(":")[0].toLowerCase();const target=location.split(":")[0].toLowerCase();assert(this.method==="GET"&&(current!=="https"||target!=="http")&&location.match(/^https?:/),`unsupported redirect`,"UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`});const req=new FetchRequest(location);req.method="GET";req.allowGzip=this.allowGzip;req.timeout=this.timeout;req.#headers=Object.assign({},this.#headers);if(this.#body){req.#body=new Uint8Array(this.#body)}req.#bodyType=this.#bodyType;return req}clone(){const clone=new FetchRequest(this.url);clone.#method=this.#method;if(this.#body){clone.#body=this.#body}clone.#bodyType=this.#bodyType;clone.#headers=Object.assign({},this.#headers);clone.#creds=this.#creds;if(this.allowGzip){clone.allowGzip=true}clone.timeout=this.timeout;if(this.allowInsecureAuthentication){clone.allowInsecureAuthentication=true}clone.#preflight=this.#preflight;clone.#process=this.#process;clone.#retry=this.#retry;return clone}static lockConfig(){locked$5=true}static getGateway(scheme){return Gateways[scheme.toLowerCase()]||null}static registerGateway(scheme,func){scheme=scheme.toLowerCase();if(scheme==="http"||scheme==="https"){throw new Error(`cannot intercept ${scheme}; use registerGetUrl`)}if(locked$5){throw new Error("gateways locked")}Gateways[scheme]=func}static registerGetUrl(getUrl){if(locked$5){throw new Error("gateways locked")}getUrlFunc=getUrl}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(baseUrl){return getIpfsGatewayFunc(baseUrl)}}class FetchResponse{#statusCode;#statusMessage;#headers;#body;#request;#error;toString(){return``}get statusCode(){return this.#statusCode}get statusMessage(){return this.#statusMessage}get headers(){return Object.assign({},this.#headers)}get body(){return this.#body==null?null:new Uint8Array(this.#body)}get bodyText(){try{return this.#body==null?"":toUtf8String(this.#body)}catch(error){assert(false,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(error){assert(false,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index{accum[k.toLowerCase()]=String(headers[k]);return accum},{});this.#body=body==null?null:new Uint8Array(body);this.#request=request||null;this.#error={message:""}}makeServerError(message,error){let statusMessage;if(!message){message=`${this.statusCode} ${this.statusMessage}`;statusMessage=`CLIENT ESCALATED SERVER ERROR (${message})`}else{statusMessage=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`}const response=new FetchResponse(599,statusMessage,this.headers,this.body,this.#request||undefined);response.#error={message:message,error:error};return response}throwThrottleError(message,stall){if(stall==null){stall=-1}else{assertArgument(Number.isInteger(stall)&&stall>=0,"invalid stall timeout","stall",stall)}const error=new Error(message||"throttling requests");defineProperties(error,{stall:stall,throttle:true});throw error}getHeader(key){return this.headers[key.toLowerCase()]}hasBody(){return this.#body!=null}get request(){return this.#request}ok(){return this.#error.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok()){return}let{message,error}=this.#error;if(message===""){message=`server response ${this.statusCode} ${this.statusMessage}`}assert(false,message,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:error})}}function getTime$2(){return(new Date).getTime()}function unpercent(value){return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi,(all,code)=>{return String.fromCharCode(parseInt(code,16))}))}function wait(delay){return new Promise(resolve=>setTimeout(resolve,delay))}var _a$1;const BN_N1=BigInt(-1);const BN_0$7=BigInt(0);const BN_1$4=BigInt(1);const BN_5=BigInt(5);const _guard$5={};let Zeros="0000";while(Zeros.length<80){Zeros+=Zeros}function getTens(decimals){let result=Zeros;while(result.length=-limit&&valBN_0$7){val=fromTwos(mask(val,width),width)}else{val=-fromTwos(mask(-val,width),width)}}else{const limit=BN_1$4<=0&&val{if(v[key]==null){return defaultValue}assertArgument(typeof v[key]===type,"invalid fixed format ("+key+" not "+type+")","format."+key,v[key]);return v[key]};signed=check("signed","boolean",signed);width=check("width","number",width);decimals=check("decimals","number",decimals)}assertArgument(width%8===0,"invalid FixedNumber width (not byte aligned)","format.width",width);assertArgument(decimals<=80,"invalid FixedNumber decimals (too large)","format.decimals",decimals);const name=(signed?"":"u")+"fixed"+String(width)+"x"+String(decimals);return{signed:signed,width:width,decimals:decimals,name:name}}function toString(val,decimals){let negative="";if(val0){b*=getTens(delta)}else if(delta<0){a*=getTens(-delta)}if(ab){return-1}return 0}eq(other){return this.cmp(other)===0}lt(other){return this.cmp(other)<0}lte(other){return this.cmp(other)<=0}gt(other){return this.cmp(other)>0}gte(other){return this.cmp(other)>=0}floor(){let val=this.#val;if(this.#valBN_0$7){val+=this.#tens-BN_1$4}val=this.#val/this.#tens*this.#tens;return this.#checkValue(val,"ceiling")}round(decimals){if(decimals==null){decimals=0}if(decimals>=this.decimals){return this}const delta=this.decimals-decimals;const bump=BN_5*getTens(delta-1);let value=this.value+bump;const tens=getTens(delta);value=value/tens*tens;checkValue(value,this.#format,"round");return new _a$1(_guard$5,value,this.#format)}isZero(){return this.#val===BN_0$7}isNegative(){return this.#val0){const tens=getTens(delta);assert(value%tens===BN_0$7,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:_value});value/=tens}else if(delta<0){value*=getTens(-delta)}checkValue(value,format,"fromValue");return new _a$1(_guard$5,value,format)}static fromString(_value,_format){const match=_value.match(/^(-?)([0-9]*)\.?([0-9]*)$/);assertArgument(match&&match[2].length+match[3].length>0,"invalid FixedNumber string value","value",_value);const format=getFormat(_format);let whole=match[2]||"0",decimal=match[3]||"";while(decimal.length{assert(offset<=data.length,"data short segment too short","BUFFER_OVERRUN",{buffer:data,length:data.length,offset:offset})};if(data[offset]>=248){const lengthLength=data[offset]-247;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);return _decodeChildren(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;checkOffset(offset+1+length);return _decodeChildren(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;checkOffset(offset+1+length);const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlifyByte(data[offset])}}function decodeRlp(_data){const data=getBytes(_data,"data");const decoded=_decode(data,0);assertArgument(decoded.consumed===data.length,"unexpected junk after rlp payload","data",_data);return decoded.result}function arrayifyInteger(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function _encode(object){if(Array.isArray(object)){let payload=[];object.forEach(function(child){payload=payload.concat(_encode(child))});if(payload.length<=55){payload.unshift(192+payload.length);return payload}const length=arrayifyInteger(payload.length);length.unshift(247+length.length);return length.concat(payload)}const data=Array.prototype.slice.call(getBytes(object,"object"));if(data.length===1&&data[0]<=127){return data}else if(data.length<=55){data.unshift(128+data.length);return data}const length=arrayifyInteger(data.length);length.unshift(183+length.length);return length.concat(data)}const nibbles="0123456789abcdef";function encodeRlp(object){let result="0x";for(const v of _encode(object)){result+=nibbles[v>>4];result+=nibbles[v&15]}return result}const names=["ore","fecore","picore","nacore","mcore","micore","core"];function formatUnits(value,unit){let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromValue(value,decimals,{decimals:decimals}).toString()}const scientificToDecimal=num=>{var nsign=Math.sign(num);num=Math.abs(num);if(/\d+\.?\d*e[\+\-]*\d+/i.test(num)){var zero="0",parts=String(num).toLowerCase().split("e"),e=parts.pop(),l=Math.abs(e),sign=e/l,coeff_array=parts[0].split(".");if(sign===-1){l=l-coeff_array[0].length;if(l<0){num=coeff_array[0].slice(0,l)+"."+coeff_array[0].slice(l)+(coeff_array.length===2?coeff_array[1]:"")}else{num=zero+"."+new Array(l+1).join(zero)+coeff_array.join("")}}else{var dec=coeff_array[1];if(dec)l=l-dec.length;if(l<0){num=coeff_array[0]+dec.slice(0,l)+"."+dec.slice(l)}else{num=coeff_array.join("")+new Array(l+1).join(zero)}}}return nsign<0?"-"+num:num};const trimDecimals=(n,decimals=18)=>{n+="";if(n.indexOf(".")===-1)return n;const arr=n.split(".");const fraction=arr[1].substr(0,decimals);return arr[0]+"."+fraction};function parseUnits(value,unit){assertArgument(typeof value==="string","value must be a string","value",value);if(value.includes("e")){value=scientificToDecimal(value).toString()}let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index;value=trimDecimals(value,decimals)}else if(unit!=null){decimals=getNumber(unit,"unit");value=trimDecimals(value,decimals)}return FixedNumber.fromString(value,{decimals:decimals}).value}function formatXCB(ore){return formatUnits(ore,18)}function parseXCB(xcb){return parseUnits(xcb,18)}function uuidV4(randomBytes){const bytes=getBytes(randomBytes,"randomBytes");bytes[6]=bytes[6]&15|64;bytes[8]=bytes[8]&63|128;const value=hexlify(bytes);return[value.substring(2,10),value.substring(10,14),value.substring(14,18),value.substring(18,22),value.substring(22,34)].join("-")}class Ed448Goldilock{static _channel=ed448;static generatePrivateKey(){var privateKey=ed448.privateKeyGenerate();privateKey[56]&=127;return privateKey}static getPublicKeyFromPrivateKey(privateKey){var secret=Buffer.from(privateKey,"hex");if(secret[56]>127){var scalar=secret.slice(0,56);scalar[0]&=252;scalar[55]|=128;var publicKey=this._channel.publicKeyFromScalar(scalar);return Buffer.from(publicKey).toString("hex")}else{var publicKey=this._channel.publicKeyCreate(secret);return Buffer.from(publicKey).toString("hex")}}static signWithPrivateKey(privateKey,msg){var msgToSign=Buffer.from(msg,"hex");var secret=Buffer.from(privateKey,"hex");if(secret[56]>127){var prefix=secret.slice(0,57);prefix[0]&=252;prefix[56]=0;prefix[55]|=128;var scalar=prefix.slice(0,56);var signedMessage=this._channel.signWithScalar(msgToSign,scalar,prefix);return Buffer.from(signedMessage).toString("hex")}else{var signedMessage=this._channel.sign(msgToSign,secret);return Buffer.from(signedMessage).toString("hex")}}static signWithPrivateKeyNConcatPubkey(privateKey,msg){var signedMessage=Ed448Goldilock.signWithPrivateKey(privateKey,msg);var publicKey=Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);return signedMessage+publicKey}static verifySignature(msgHash,signedMsg,pubKey){return this._channel.verify(msgHash,signedMsg,pubKey)}static SHA512Hash(password,salt){var p1=Buffer.from(password,"hex");var s1=Buffer.from(salt,"hex");return Buffer.from(pbkdf2$2.derive(SHA3_512,p1,s1,2048,57)).toString("hex")}static concatenateAndHex(prefix,key,index,salt){var ind=Buffer.alloc(4);var p=Buffer.alloc(1);p[0]=prefix%256;var j=index;for(let i=0;i<4;i++){ind[i]=j%256;j=Math.floor(j/256)}var t=p.toString("hex")+key+ind.toString("hex");return Ed448Goldilock.SHA512Hash(t,salt)}static addScalar(a,b){var a1=Buffer.from(a,"hex");var b1=Buffer.from(b.substr(0,106)+"00000000","hex");b1[0]&=252;var c=Buffer.alloc(57);var hold=0;for(let i=0;i<57;i++){hold+=a1[i]+b1[i];c[i]=hold%256;hold=Math.floor(hold/256)}return c.toString("hex")}static seedToExtendedPrivate(seed){var s1=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f72746865636861696e");var s2=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f727468656b6579");var b=Buffer.from(s2,"hex");b[56]|=128;b[55]|=128;b[55]&=191;var s3=b.toString("hex");return s1+s3}static childPrivateToPrivate(s,index){var s0=s.substr(0,114);var s1=s.substr(114,228);var r0,r1;if(index>=2147483648){r0=Ed448Goldilock.concatenateAndHex(1,s1,index,s0);r1=Ed448Goldilock.concatenateAndHex(0,s1,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}else{var pub=Ed448Goldilock.getPublicKeyFromPrivateKey(s1);r0=Ed448Goldilock.concatenateAndHex(3,pub,index,s0);r1=Ed448Goldilock.concatenateAndHex(2,pub,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}}static HDWalletGenerateKeyFromSeed(seed,index){var m=Ed448Goldilock.seedToExtendedPrivate(seed);var k1=Ed448Goldilock.childPrivateToPrivate(m,2147483648+44);var k2=Ed448Goldilock.childPrivateToPrivate(k1,2147483648+654);var k3=Ed448Goldilock.childPrivateToPrivate(k2,2147483648+0);var k4=Ed448Goldilock.childPrivateToPrivate(k3,2147483648+0);var k5=Ed448Goldilock.childPrivateToPrivate(k4,index);return k5.substr(114,228)}}function getGlobal$1(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal$1();const crypto=anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"sha256":return sha256$1.create();case"sha512":return sha512$1.create();case"sha3-256":return sha3_256.create();case"sha3-512":return sha3_512.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}function createHmac(_algo,key){const algo={sha256:sha256$1,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid hmac algorithm","algorithm",_algo);return hmac.create(algo,key)}function pbkdf2Sync(password,salt,iterations,keylen,_algo){const algo={sha256:sha256$1,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid pbkdf2 algorithm","algorithm",_algo);return pbkdf2$1(algo,password,salt,{c:iterations,dkLen:keylen})}function randomBytes$1(length){assert(crypto!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});assertArgument(Number.isInteger(length)&&length>0&&length<=1024,"invalid length","length",length);const result=new Uint8Array(length);crypto.getRandomValues(result);return result}const _sha256=function(data){let v="0x"+createHash("sha3-256").update(Buffer$1.from(arrayify(data))).digest("hex");return v};const _sha512=function(data){let v="0x"+createHash("sha3-512").update(Buffer$1.from(arrayify(data))).digest("hex");return v};let locked256=false,locked512=false;var SupportedAlgorithm;(function(SupportedAlgorithm){SupportedAlgorithm["sha256"]="sha256";SupportedAlgorithm["sha512"]="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));function sha256(data){let createdHash=createHash("sha3-256").update(Buffer$1.from(arrayify(data))).digest("hex");const v="0x"+createdHash;if(typeof createdHash!=="string"){createdHash=hexlify(createdHash);return createdHash}return v}function legacySha256(data){const _data=getBytes(data,"data");const hexlified=hexlify(createHash("sha256").update(_data).digest());return hexlified}sha256._=_sha256;sha256.lock=function(){locked256=true};sha256.register=function(func){if(locked256){throw new Error("sha256 is locked")}};Object.freeze(sha256);function sha512(data){let createdHash=createHash("sha3-512").update(Buffer$1.from(arrayify(data))).digest("hex");const v="0x"+createdHash;if(typeof createdHash!=="string"){createdHash=hexlify(createdHash);return createdHash}return v}sha512._=_sha512;sha512.lock=function(){locked512=true};sha512.register=function(func){if(locked512){throw new Error("sha512 is locked")}};Object.freeze(sha256);const logger$3=new Logger("address/0.0.1");const precompiledAddresses=["0000000000000000000000000000000000000000000000000000000000000000","0000000000000000000000000000000000000000000000000000000000000001","0000000000000000000000000000000000000000000000000000000000000002","0000000000000000000000000000000000000000000000000000000000000003","0000000000000000000000000000000000000000000000000000000000000004","0000000000000000000000000000000000000000000000000000000000000005","0000000000000000000000000000000000000000000000000000000000000006","0000000000000000000000000000000000000000000000000000000000000007","0000000000000000000000000000000000000000000000000000000000000008","0000000000000000000000000000000000000000000000000000000000000009"];function removeHexPrefix$1(val){return val.substring(0,2)==="0x"?val.substring(2):val}function calculateCheckSum(_address,_prefix){const address=getBytes("0x"+_address.replace("0x",""));const prefix=getBytes("0x"+_prefix.replace("0x",""));const tmpConcated=new Uint8Array([...address,...prefix]);const hexedConcat=hexlify(tmpConcated).replace("0x","")+"00";const mods=Array.from(hexedConcat.toUpperCase(),c=>{const charCode=c.charCodeAt(0);return charCode>64&&charCode<91?(charCode-55).toString():(charCode-48).toString()}).join("");const bigVal=BigInt(mods);const val97=BigInt(97);const val98=BigInt(98);const remainder=bigVal%val97;const checkSum=val98-remainder;const result=checkSum>9?checkSum.toString():"0"+checkSum.toString();return result}function getAddress(address){if(typeof address!=="string"){logger$3.throwArgumentError("invalid address","address",address)}if(!address.match(/^(0x)?[0-9a-fA-F]{44}$/)){logger$3.throwArgumentError("invalid address","address",address)}const raw=removeHexPrefix$1(address);if(precompiledAddresses.includes(raw)){return"0x"+raw}const prefix=raw.substring(0,2);const val=raw.substring(4);const checksum=calculateCheckSum(val,prefix);if(checksum!==raw.substring(2,4)){logger$3.throwArgumentError("bad address checksum","address",address)}return"0x"+prefix+checksum+val}function networkIdToPrefix(networkId){if(networkId==1){return"cb"}else if(networkId==3||networkId==4){return"ab"}else if(networkId>10||networkId==0){return"ce"}else{logger$3.throwArgumentError("bad networkId","networkId",networkId);return""}}let locked$4=false;const _computeHmac=function(algorithm,key,data){return createHmac(algorithm,key).update(data).digest()};let __computeHmac=_computeHmac;function computeHmac(algorithm,_key,_data){const key=getBytes(_key,"key");const data=getBytes(_data,"data");return hexlify(__computeHmac(algorithm,key,data))}computeHmac._=_computeHmac;computeHmac.lock=function(){locked$4=true};computeHmac.register=function(func){if(locked$4){throw new Error("computeHmac is locked")}__computeHmac=func};Object.freeze(computeHmac);const Rho=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]);const Id=Uint8Array.from({length:16},(_,i)=>i);const Pi=Id.map(i=>(9*i+5)%16);let idxL=[Id];let idxR=[Pi];for(let i=0;i<4;i++)for(let j of[idxL,idxR])j.push(j[i].map(k=>Rho[k]));const shifts=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(i=>new Uint8Array(i));const shiftsL=idxL.map((idx,i)=>idx.map(j=>shifts[i][j]));const shiftsR=idxR.map((idx,i)=>idx.map(j=>shifts[i][j]));const Kl=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]);const Kr=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);const rotl$1=(word,shift)=>word<>>32-shift;function f(group,x,y,z){if(group===0)return x^y^z;else if(group===1)return x&y|~x&z;else if(group===2)return(x|~y)^z;else if(group===3)return x&z|y&~z;else return x^(y|~z)}const BUF=new Uint32Array(16);class RIPEMD160 extends SHA2{constructor(){super(64,20,8,true);this.h0=1732584193|0;this.h1=4023233417|0;this.h2=2562383102|0;this.h3=271733878|0;this.h4=3285377520|0}get(){const{h0,h1,h2,h3,h4}=this;return[h0,h1,h2,h3,h4]}set(h0,h1,h2,h3,h4){this.h0=h0|0;this.h1=h1|0;this.h2=h2|0;this.h3=h3|0;this.h4=h4|0}process(view,offset){for(let i=0;i<16;i++,offset+=4)BUF[i]=view.getUint32(offset,true);let al=this.h0|0,ar=al,bl=this.h1|0,br=bl,cl=this.h2|0,cr=cl,dl=this.h3|0,dr=dl,el=this.h4|0,er=el;for(let group=0;group<5;group++){const rGroup=4-group;const hbl=Kl[group],hbr=Kr[group];const rl=idxL[group],rr=idxR[group];const sl=shiftsL[group],sr=shiftsR[group];for(let i=0;i<16;i++){const tl=rotl$1(al+f(group,bl,cl,dl)+BUF[rl[i]]+hbl,sl[i])+el|0;al=el,el=dl,dl=rotl$1(cl,10)|0,cl=bl,bl=tl}for(let i=0;i<16;i++){const tr=rotl$1(ar+f(rGroup,br,cr,dr)+BUF[rr[i]]+hbr,sr[i])+er|0;ar=er,er=dr,dr=rotl$1(cr,10)|0,cr=br,br=tr}}this.set(this.h1+cl+dr|0,this.h2+dl+er|0,this.h3+el+ar|0,this.h4+al+br|0,this.h0+bl+cr|0)}roundClean(){BUF.fill(0)}destroy(){this.destroyed=true;this.buffer.fill(0);this.set(0,0,0,0,0)}}const ripemd160$1=wrapConstructor(()=>new RIPEMD160);let locked$3=false;const _ripemd160=function(data){return ripemd160$1(data)};let __ripemd160=_ripemd160;function ripemd160(_data){const data=getBytes(_data,"data");return hexlify(__ripemd160(data))}ripemd160._=_ripemd160;ripemd160.lock=function(){locked$3=true};ripemd160.register=function(func){if(locked$3){throw new TypeError("ripemd160 is locked")}__ripemd160=func};Object.freeze(ripemd160);let locked$2=false;const _pbkdf2=function(password,salt,iterations,keylen,algo){return pbkdf2Sync(password,salt,iterations,keylen,algo)};let __pbkdf2=_pbkdf2;function pbkdf2(_password,_salt,iterations,keylen,algo){const password=getBytes(_password,"password");const salt=getBytes(_salt,"salt");return hexlify(__pbkdf2(password,salt,iterations,keylen,algo))}pbkdf2._=_pbkdf2;pbkdf2.lock=function(){locked$2=true};pbkdf2.register=function(func){if(locked$2){throw new Error("pbkdf2 is locked")}__pbkdf2=func};Object.freeze(pbkdf2);let locked$1=false;const _randomBytes=function(length){return new Uint8Array(randomBytes$1(length))};let __randomBytes=_randomBytes;function randomBytes(length){return __randomBytes(length)}randomBytes._=_randomBytes;randomBytes.lock=function(){locked$1=true};randomBytes.register=function(func){if(locked$1){throw new Error("randomBytes is locked")}__randomBytes=func};Object.freeze(randomBytes);const rotl=(a,b)=>a<>>32-b;function XorAndSalsa(prev,pi,input,ii,out,oi){let y00=prev[pi++]^input[ii++],y01=prev[pi++]^input[ii++];let y02=prev[pi++]^input[ii++],y03=prev[pi++]^input[ii++];let y04=prev[pi++]^input[ii++],y05=prev[pi++]^input[ii++];let y06=prev[pi++]^input[ii++],y07=prev[pi++]^input[ii++];let y08=prev[pi++]^input[ii++],y09=prev[pi++]^input[ii++];let y10=prev[pi++]^input[ii++],y11=prev[pi++]^input[ii++];let y12=prev[pi++]^input[ii++],y13=prev[pi++]^input[ii++];let y14=prev[pi++]^input[ii++],y15=prev[pi++]^input[ii++];let x00=y00,x01=y01,x02=y02,x03=y03,x04=y04,x05=y05,x06=y06,x07=y07,x08=y08,x09=y09,x10=y10,x11=y11,x12=y12,x13=y13,x14=y14,x15=y15;for(let i=0;i<8;i+=2){x04^=rotl(x00+x12|0,7);x08^=rotl(x04+x00|0,9);x12^=rotl(x08+x04|0,13);x00^=rotl(x12+x08|0,18);x09^=rotl(x05+x01|0,7);x13^=rotl(x09+x05|0,9);x01^=rotl(x13+x09|0,13);x05^=rotl(x01+x13|0,18);x14^=rotl(x10+x06|0,7);x02^=rotl(x14+x10|0,9);x06^=rotl(x02+x14|0,13);x10^=rotl(x06+x02|0,18);x03^=rotl(x15+x11|0,7);x07^=rotl(x03+x15|0,9);x11^=rotl(x07+x03|0,13);x15^=rotl(x11+x07|0,18);x01^=rotl(x00+x03|0,7);x02^=rotl(x01+x00|0,9);x03^=rotl(x02+x01|0,13);x00^=rotl(x03+x02|0,18);x06^=rotl(x05+x04|0,7);x07^=rotl(x06+x05|0,9);x04^=rotl(x07+x06|0,13);x05^=rotl(x04+x07|0,18);x11^=rotl(x10+x09|0,7);x08^=rotl(x11+x10|0,9);x09^=rotl(x08+x11|0,13);x10^=rotl(x09+x08|0,18);x12^=rotl(x15+x14|0,7);x13^=rotl(x12+x15|0,9);x14^=rotl(x13+x12|0,13);x15^=rotl(x14+x13|0,18)}out[oi++]=y00+x00|0;out[oi++]=y01+x01|0;out[oi++]=y02+x02|0;out[oi++]=y03+x03|0;out[oi++]=y04+x04|0;out[oi++]=y05+x05|0;out[oi++]=y06+x06|0;out[oi++]=y07+x07|0;out[oi++]=y08+x08|0;out[oi++]=y09+x09|0;out[oi++]=y10+x10|0;out[oi++]=y11+x11|0;out[oi++]=y12+x12|0;out[oi++]=y13+x13|0;out[oi++]=y14+x14|0;out[oi++]=y15+x15|0}function BlockMix(input,ii,out,oi,r){let head=oi+0;let tail=oi+16*r;for(let i=0;i<16;i++)out[tail+i]=input[ii+(2*r-1)*16+i];for(let i=0;i0)tail+=16;XorAndSalsa(out,head,input,ii+=16,out,tail)}}function scryptInit(password,salt,_opts){const opts=checkOpts({dkLen:32,asyncTick:10,maxmem:1024**3+1024},_opts);const{N,r,p,dkLen,asyncTick,maxmem,onProgress}=opts;number(N);number(r);number(p);number(dkLen);number(asyncTick);number(maxmem);if(onProgress!==undefined&&typeof onProgress!=="function")throw new Error("progressCb should be function");const blockSize=128*r;const blockSize32=blockSize/4;if(N<=1||(N&N-1)!==0||N>=2**(blockSize/8)||N>2**32){throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32")}if(p<0||p>(2**32-1)*32/blockSize){throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)")}if(dkLen<0||dkLen>(2**32-1)*32){throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32")}const memUsed=blockSize*(N+p);if(memUsed>maxmem){throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`)}const B=pbkdf2$1(sha256$1,password,salt,{c:1,dkLen:blockSize*p});const B32=u32(B);const V=u32(new Uint8Array(blockSize*N));const tmp=u32(new Uint8Array(blockSize));let blockMixCb=()=>{};if(onProgress){const totalBlockMix=2*N*p;const callbackPer=Math.max(Math.floor(totalBlockMix/1e4),1);let blockMixCnt=0;blockMixCb=()=>{blockMixCnt++;if(onProgress&&(!(blockMixCnt%callbackPer)||blockMixCnt===totalBlockMix))onProgress(blockMixCnt/totalBlockMix)}}return{N:N,r:r,p:p,dkLen:dkLen,blockSize32:blockSize32,V:V,B32:B32,B:B,tmp:tmp,blockMixCb:blockMixCb,asyncTick:asyncTick}}function scryptOutput(password,dkLen,B,V,tmp){const res=pbkdf2$1(sha256$1,password,B,{c:1,dkLen:dkLen});B.fill(0);V.fill(0);tmp.fill(0);return res}function scrypt$1(password,salt,opts){const{N,r,p,dkLen,blockSize32,V,B32,B,tmp,blockMixCb}=scryptInit(password,salt,opts);for(let pi=0;pi{BlockMix(V,pos,V,pos+=blockSize32,r);blockMixCb()});BlockMix(V,(N-1)*blockSize32,B32,Pi,r);blockMixCb();await asyncLoop(N,asyncTick,()=>{const j=B32[Pi+blockSize32-16]%N;for(let k=0;kmod(mod(x*x)*x+CURVE.b);const err=(m="")=>{throw new Error(m)};const big=n=>typeof n==="bigint";const str=s=>typeof s==="string";const fe=n=>big(n)&&0nbig(n)&&0n!(a instanceof Uint8Array)||typeof l==="number"&&l>0&&a.length!==l?err("Uint8Array expected"):a;const u8n=data=>new Uint8Array(data);const toU8=(a,len)=>au8(str(a)?h2b(a):u8n(a),len);const mod=(a,b=P)=>{let r=a%b;return r>=0n?r:b+r};const isPoint=p=>p instanceof Point?p:err("Point expected");let Gpows=undefined;class Point{constructor(px,py,pz){this.px=px;this.py=py;this.pz=pz}static fromAffine(p){return new Point(p.x,p.y,1n)}static fromHex(hex){hex=toU8(hex);let p=undefined;const head=hex[0],tail=hex.subarray(1);const x=slcNum(tail,0,fLen),len=hex.length;if(len===33&&[2,3].includes(head)){if(!fe(x))err("Point hex invalid: x not FE");let y=sqrt(crv(x));const isYOdd=(y&1n)===1n;const headOdd=(head&1)===1;if(headOdd!==isYOdd)y=mod(-y);p=new Point(x,y,1n)}if(len===65&&head===4)p=new Point(x,slcNum(tail,fLen,2*fLen),1n);return p?p.ok():err("Point is not on curve")}static fromPrivateKey(k){return G.mul(toPriv(k))}get x(){return this.aff().x}get y(){return this.aff().y}equals(other){const{px:X1,py:Y1,pz:Z1}=this;const{px:X2,py:Y2,pz:Z2}=isPoint(other);const X1Z2=mod(X1*Z2),X2Z1=mod(X2*Z1);const Y1Z2=mod(Y1*Z2),Y2Z1=mod(Y2*Z1);return X1Z2===X2Z1&&Y1Z2===Y2Z1}negate(){return new Point(this.px,mod(-this.py),this.pz)}double(){return this.add(this)}add(other){const{px:X1,py:Y1,pz:Z1}=this;const{px:X2,py:Y2,pz:Z2}=isPoint(other);const{a,b}=CURVE;let X3=0n,Y3=0n,Z3=0n;const b3=mod(b*3n);let t0=mod(X1*X2),t1=mod(Y1*Y2),t2=mod(Z1*Z2),t3=mod(X1+Y1);let t4=mod(X2+Y2);t3=mod(t3*t4);t4=mod(t0+t1);t3=mod(t3-t4);t4=mod(X1+Z1);let t5=mod(X2+Z2);t4=mod(t4*t5);t5=mod(t0+t2);t4=mod(t4-t5);t5=mod(Y1+Z1);X3=mod(Y2+Z2);t5=mod(t5*X3);X3=mod(t1+t2);t5=mod(t5-X3);Z3=mod(a*t4);X3=mod(b3*t2);Z3=mod(X3+Z3);X3=mod(t1-Z3);Z3=mod(t1+Z3);Y3=mod(X3*Z3);t1=mod(t0+t0);t1=mod(t1+t0);t2=mod(a*t2);t4=mod(b3*t4);t1=mod(t1+t2);t2=mod(t0-t2);t2=mod(a*t2);t4=mod(t4+t2);t0=mod(t1*t4);Y3=mod(Y3+t0);t0=mod(t5*t4);X3=mod(t3*X3);X3=mod(X3-t0);t0=mod(t3*t1);Z3=mod(t5*Z3);Z3=mod(Z3+t0);return new Point(X3,Y3,Z3)}mul(n,safe=true){if(!safe&&n===0n)return I;if(!ge(n))err("invalid scalar");if(this.equals(G))return wNAF(n).p;let p=I,f=G;for(let d=this;n>0n;d=d.double(),n>>=1n){if(n&1n)p=p.add(d);else if(safe)f=f.add(d)}return p}mulAddQUns(R,u1,u2){return this.mul(u1,false).add(R.mul(u2,false)).ok()}toAffine(){const{px:x,py:y,pz:z}=this;if(this.equals(I))return{x:0n,y:0n};if(z===1n)return{x:x,y:y};const iz=inv(z);if(mod(z*iz)!==1n)err("invalid inverse");return{x:mod(x*iz),y:mod(y*iz)}}assertValidity(){const{x,y}=this.aff();if(!fe(x)||!fe(y))err("Point invalid: x or y");return mod(y*y)===crv(x)?this:err("Point invalid: not on curve")}multiply(n){return this.mul(n)}aff(){return this.toAffine()}ok(){return this.assertValidity()}toHex(isCompressed=true){const{x,y}=this.aff();const head=isCompressed?(y&1n)===0n?"02":"03":"04";return head+n2h(x)+(isCompressed?"":n2h(y))}toRawBytes(isCompressed=true){return h2b(this.toHex(isCompressed))}}Point.BASE=new Point(Gx,Gy,1n);Point.ZERO=new Point(0n,1n,0n);const{BASE:G,ZERO:I}=Point;const padh=(n,pad)=>n.toString(16).padStart(pad,"0");const b2h=b=>Array.from(b).map(e=>padh(e,2)).join("");const h2b=hex=>{const l=hex.length;if(!str(hex)||l%2)err("hex invalid 1");const arr=u8n(l/2);for(let i=0;iBigInt("0x"+(b2h(b)||"0"));const slcNum=(b,from,to)=>b2n(b.slice(from,to));const n2b=num=>{return big(num)&&num>=0n&&numb2h(n2b(num));const inv=(num,md=P)=>{if(num===0n||md<=0n)err("no inverse n="+num+" mod="+md);let a=mod(num,md),b=md,x=0n,u=1n;while(a!==0n){const q=b/a,r=b%a;const m=x-u*q;b=a,a=r,x=u,u=m}return b===1n?mod(x,md):err("no inverse")};const sqrt=n=>{let r=1n;for(let num=n,e=(P+1n)/4n;e>0n;e>>=1n){if(e&1n)r=r*num%P;num=num*num%P}return mod(r*r)===n?r:err("sqrt invalid")};const toPriv=p=>{if(!big(p))p=b2n(toU8(p,fLen));return ge(p)?p:err("private key out of range")};function getSharedSecret(privA,pubB,isCompressed=true){return Point.fromHex(pubB).mul(toPriv(privA)).toRawBytes(isCompressed)}const W=8;const precompute=()=>{const points=[];const windows=256/W+1;let p=G,b=p;for(let w=0;w{const comp=Gpows||(Gpows=precompute());const neg=(cnd,p)=>{let n=p.negate();return cnd?n:p};let p=I,f=G;const windows=1+256/W;const wsize=2**(W-1);const mask=BigInt(2**W-1);const maxNum=2**W;const shiftBy=BigInt(W);for(let w=0;w>=shiftBy;if(wbits>wsize){wbits-=maxNum;n+=1n}const off1=off,off2=off+Math.abs(wbits)-1;const cnd1=w%2!==0,cnd2=wbits<0;if(wbits===0){f=f.add(neg(cnd1,comp[off1]))}else{p=p.add(neg(cnd2,comp[off2]))}}return{p:p,f:f}};const logger$2=new Logger("signing-key/0.0.1");class SigningKey{#privateKey;constructor(privateKey){let tmp=privateKey;if(typeof tmp==="string"&&tmp.startsWith("0x")){tmp=tmp.replace("0x","")}assertArgument(dataLength("0x"+tmp)===57,"invalid private key","privateKey","[REDACTED]");this.#privateKey=hexlify("0x"+tmp)}get privateKey(){return this.#privateKey}get publicKey(){return SigningKey.computePublicKey(this.#privateKey)}get compressedPublicKey(){return SigningKey.computePublicKey(this.#privateKey,true)}sign(digest){const key=getBytesCopy(this.#privateKey);assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const keyBuffer=new Uint8Array(arrayify(key));if(keyBuffer.length!==57){logger$2.throwArgumentError("invalid private key","key","[REDACTED]")}const digestBuffer=new Uint8Array(arrayify(digest));if(digestBuffer.length!==32){logger$2.throwArgumentError("bad digest length","digest",digest)}if(keyBuffer[56]>127){const prefix=keyBuffer.slice(0,57);prefix[0]&=252;prefix[55]|=128;prefix[56]=0;const scalar=prefix.slice(0,56);const bufferDigest=Buffer$1.from(digestBuffer);const bufferPrfx=Buffer$1.from(prefix);const bufferScalar=Buffer$1.from(scalar);const sig=ed448.signWithScalar(bufferDigest,bufferScalar,bufferPrfx);const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}const sig=ed448.sign(Buffer$1.from(digestBuffer),Buffer$1.from(keyBuffer));const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}computeSharedSecret(other){const pubKey=SigningKey.computePublicKey(other);return hexlify(getSharedSecret(getBytesCopy(this.#privateKey),getBytes(pubKey)))}static computePublicKey(key,compressed){const bytes=Buffer$1.from(arrayify(key));if(bytes.length!==57){logger$2.throwArgumentError("invalid private key","key","[REDACTED]")}if(bytes[56]>127){const scalar=bytes.slice(0,56);scalar[0]&=252;scalar[55]|=128;const pub=ed448.publicKeyFromScalar(scalar);return hexlify(pub)}const pub=ed448.publicKeyCreate(bytes);return hexlify(pub)}static recoverPublicKey(digest,signature){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const digestBuffer=Buffer$1.from(arrayify(digest));const sigBuffer=Buffer$1.from(arrayify(signature));if(sigBuffer.length!==171){logger$2.throwArgumentError("invalid signature","signature",signature)}const sig=sigBuffer.slice(0,114);const pub=sigBuffer.slice(114);if(ed448.verify(digestBuffer,sig,pub)){return hexlify(pub)}logger$2.throwArgumentError("invalid signature","signature",signature);return""}static addPoints(p0,p1,compressed){const pub0=Point.fromHex(SigningKey.computePublicKey(p0).substring(2));const pub1=Point.fromHex(SigningKey.computePublicKey(p1).substring(2));return"0x"+pub0.add(pub1).toHex(!!compressed)}}const BN_0$6=BigInt(0);const BN_1$3=BigInt(1);const BN_2$1=BigInt(2);const BN_27=BigInt(27);const BN_28=BigInt(28);const BN_35=BigInt(35);const _guard$4={};class Signature{#r;#s;#v;#networkV;get r(){return this.#r}set r(value){assertArgument(dataLength(value)===32,"invalid r","value",value);this.#r=hexlify(value)}get s(){return this.#s}set s(_value){assertArgument(dataLength(_value)===32,"invalid s","value",_value);const value=hexlify(_value);assertArgument(parseInt(value.substring(0,3))<8,"non-canonical s","value",value);this.#s=value}get v(){return this.#v}set v(value){const v=getNumber(value,"value");assertArgument(v===27||v===28,"invalid v","v",value);this.#v=v}get networkV(){return this.#networkV}get legacynetworkId(){const v=this.networkV;if(v==null){return null}return Signature.getnetworkId(v)}get yParity(){return this.v===27?0:1}get yParityAndS(){const yParityAndS=getBytes(this.s);if(this.yParity){yParityAndS[0]|=128}return hexlify(yParityAndS)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(guard,r,s,v){assertPrivate(guard,_guard$4,"Signature");this.#r=r;this.#s=s;this.#v=v;this.#networkV=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const clone=new Signature(_guard$4,this.r,this.s,this.v);if(this.networkV){clone.#networkV=this.networkV}return clone}toJSON(){const networkV=this.networkV;return{_type:"signature",networkV:networkV!=null?networkV.toString():null,r:this.r,s:this.s,v:this.v}}static getnetworkId(v){const bv=getBigInt(v,"v");if(bv==BN_27||bv==BN_28){return BN_0$6}assertArgument(bv>=BN_35,"invalid EIP-155 v","v",v);return(bv-BN_35)/BN_2$1}static getnetworkIdV(networkId,v){return getBigInt(networkId)*BN_2$1+BigInt(35+v-27)}static getNormalizedV(v){const bv=getBigInt(v);if(bv===BN_0$6||bv===BN_27){return 27}if(bv===BN_1$3||bv===BN_28){return 28}assertArgument(bv>=BN_35,"invalid v","v",v);return bv&BN_1$3?27:28}}function lock(){computeHmac.lock();pbkdf2.lock();randomBytes.lock();ripemd160.lock();scrypt.lock();scryptSync.lock();sha256.lock();sha512.lock();randomBytes.lock()}function removeHexPrefix(val){return val.substring(0,2)==="0x"?val.substring(2):val}function publicToAddress(key,prefix){const val=hexDataSlice(sha256(key),12);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function computeAddress(key,prefix){let pubkey;if(typeof key==="string"){pubkey=SigningKey.computePublicKey(key,false)}else{pubkey=key.publicKey}return publicToAddress(pubkey,prefix)}function recoverAddress(digest,signature,prefix){const publicKey=SigningKey.recoverPublicKey(arrayify(digest),signature);return publicToAddress(publicKey,prefix)}function extractPrefix(address){address=getAddress(address);return address.substring(2,4)}const WordSize=32;const Padding=new Uint8Array(WordSize);const passProperties$1=["then"];const _guard$3={};function throwError(name,error){const wrapped=new Error(`deferred error during ABI decoding triggered accessing ${name}`);wrapped.error=error;throw wrapped}class Result extends Array{#names;constructor(...args){const guard=args[0];let items=args[1];let names=(args[2]||[]).slice();let wrap=true;if(guard!==_guard$3){items=args;names=[];wrap=false}super(items.length);items.forEach((item,index)=>{this[index]=item});const nameCounts=names.reduce((accum,name)=>{if(typeof name==="string"){accum.set(name,(accum.get(name)||0)+1)}return accum},new Map);this.#names=Object.freeze(items.map((item,index)=>{const name=names[index];if(name!=null&&nameCounts.get(name)===1){return name}return null}));if(!wrap){return}Object.freeze(this);return new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="string"){if(prop.match(/^[0-9]+$/)){const index=getNumber(prop,"%index");if(index<0||index>=this.length){throw new RangeError("out of result range")}const item=target[index];if(item instanceof Error){throwError(`index ${index}`,item)}return item}if(passProperties$1.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}const value=target[prop];if(value instanceof Function){return function(...args){return value.apply(this===receiver?target:this,args)}}else if(!(prop in target)){return target.getValue.apply(this===receiver?target:this,[prop])}}return Reflect.get(target,prop,receiver)}})}toArray(){const result=[];this.forEach((item,index)=>{if(item instanceof Error){throwError(`index ${index}`,item)}result.push(item)});return result}toObject(){return this.#names.reduce((accum,name,index)=>{assert(name!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"});if(!(name in accum)){accum[name]=this.getValue(name)}return accum},{})}slice(start,end){if(start==null){start=0}if(start<0){start+=this.length;if(start<0){start=0}}if(end==null){end=this.length}if(end<0){end+=this.length;if(end<0){end=0}}if(end>this.length){end=this.length}const result=[],names=[];for(let i=start;i{this.#data[offset]=getValue$1(value)}}}class Reader{allowLoose;#data;#offset;constructor(data,allowLoose){defineProperties(this,{allowLoose:!!allowLoose});this.#data=getBytesCopy(data);this.#offset=0}get data(){return hexlify(this.#data)}get dataLength(){return this.#data.length}get consumed(){return this.#offset}get bytes(){return new Uint8Array(this.#data)}#peekBytes(offset,length,loose){let alignedLength=Math.ceil(length/WordSize)*WordSize;if(this.#offset+alignedLength>this.#data.length){if(this.allowLoose&&loose&&this.#offset+length<=this.#data.length){alignedLength=length}else{assert(false,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),length:this.#data.length,offset:this.#offset+alignedLength})}}return this.#data.slice(this.#offset,this.#offset+alignedLength)}subReader(offset){return new Reader(this.#data.slice(this.#offset+offset),this.allowLoose)}readBytes(length,loose){let bytes=this.#peekBytes(0,length,!!loose);this.#offset+=bytes.length;return bytes.slice(0,length)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}}const _gaurd={};function n(value,width){let signed=false;if(width<0){signed=true;width*=-1}return new Typed(_gaurd,`${signed?"":"u"}int${width}`,value,{signed:signed,width:width})}function b(value,size){return new Typed(_gaurd,`bytes${size?size:""}`,value,{size:size})}const _typedSymbol=Symbol.for("_corebc_typed");class Typed{type;value;#options;_typedSymbol;constructor(gaurd,type,value,options){if(options==null){options=null}assertPrivate(_gaurd,gaurd,"Typed");defineProperties(this,{_typedSymbol:_typedSymbol,type:type,value:value});this.#options=options;this.format()}format(){if(this.type==="array"){throw new Error("")}else if(this.type==="dynamicArray"){throw new Error("")}else if(this.type==="tuple"){return`tuple(${this.value.map(v=>v.format()).join(",")})`}return this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple"){throw TypeError("not a tuple")}return this.#options}get arrayLength(){if(this.type!=="array"){throw TypeError("not an array")}if(this.#options===true){return-1}if(this.#options===false){return this.value.length}return null}static from(type,value){return new Typed(_gaurd,type,value)}static uint8(v){return n(v,8)}static uint16(v){return n(v,16)}static uint24(v){return n(v,24)}static uint32(v){return n(v,32)}static uint40(v){return n(v,40)}static uint48(v){return n(v,48)}static uint56(v){return n(v,56)}static uint64(v){return n(v,64)}static uint72(v){return n(v,72)}static uint80(v){return n(v,80)}static uint88(v){return n(v,88)}static uint96(v){return n(v,96)}static uint104(v){return n(v,104)}static uint112(v){return n(v,112)}static uint120(v){return n(v,120)}static uint128(v){return n(v,128)}static uint136(v){return n(v,136)}static uint144(v){return n(v,144)}static uint152(v){return n(v,152)}static uint160(v){return n(v,160)}static uint168(v){return n(v,168)}static uint176(v){return n(v,176)}static uint184(v){return n(v,184)}static uint192(v){return n(v,192)}static uint200(v){return n(v,200)}static uint208(v){return n(v,208)}static uint216(v){return n(v,216)}static uint224(v){return n(v,224)}static uint232(v){return n(v,232)}static uint240(v){return n(v,240)}static uint248(v){return n(v,248)}static uint256(v){return n(v,256)}static uint(v){return n(v,256)}static int8(v){return n(v,-8)}static int16(v){return n(v,-16)}static int24(v){return n(v,-24)}static int32(v){return n(v,-32)}static int40(v){return n(v,-40)}static int48(v){return n(v,-48)}static int56(v){return n(v,-56)}static int64(v){return n(v,-64)}static int72(v){return n(v,-72)}static int80(v){return n(v,-80)}static int88(v){return n(v,-88)}static int96(v){return n(v,-96)}static int104(v){return n(v,-104)}static int112(v){return n(v,-112)}static int120(v){return n(v,-120)}static int128(v){return n(v,-128)}static int136(v){return n(v,-136)}static int144(v){return n(v,-144)}static int152(v){return n(v,-152)}static int160(v){return n(v,-160)}static int168(v){return n(v,-168)}static int176(v){return n(v,-176)}static int184(v){return n(v,-184)}static int192(v){return n(v,-192)}static int200(v){return n(v,-200)}static int208(v){return n(v,-208)}static int216(v){return n(v,-216)}static int224(v){return n(v,-224)}static int232(v){return n(v,-232)}static int240(v){return n(v,-240)}static int248(v){return n(v,-248)}static int256(v){return n(v,-256)}static int(v){return n(v,-256)}static bytes1(v){return b(v,1)}static bytes2(v){return b(v,2)}static bytes3(v){return b(v,3)}static bytes4(v){return b(v,4)}static bytes5(v){return b(v,5)}static bytes6(v){return b(v,6)}static bytes7(v){return b(v,7)}static bytes8(v){return b(v,8)}static bytes9(v){return b(v,9)}static bytes10(v){return b(v,10)}static bytes11(v){return b(v,11)}static bytes12(v){return b(v,12)}static bytes13(v){return b(v,13)}static bytes14(v){return b(v,14)}static bytes15(v){return b(v,15)}static bytes16(v){return b(v,16)}static bytes17(v){return b(v,17)}static bytes18(v){return b(v,18)}static bytes19(v){return b(v,19)}static bytes20(v){return b(v,20)}static bytes21(v){return b(v,21)}static bytes22(v){return b(v,22)}static bytes23(v){return b(v,23)}static bytes24(v){return b(v,24)}static bytes25(v){return b(v,25)}static bytes26(v){return b(v,26)}static bytes27(v){return b(v,27)}static bytes28(v){return b(v,28)}static bytes29(v){return b(v,29)}static bytes30(v){return b(v,30)}static bytes31(v){return b(v,31)}static bytes32(v){return b(v,32)}static address(v){return new Typed(_gaurd,"address",v)}static bool(v){return new Typed(_gaurd,"bool",!!v)}static bytes(v){return new Typed(_gaurd,"bytes",v)}static string(v){return new Typed(_gaurd,"string",v)}static array(v,dynamic){throw new Error("not implemented yet")}static tuple(v,name){throw new Error("not implemented yet")}static overrides(v){return new Typed(_gaurd,"overrides",Object.assign({},v))}static isTyped(value){return value&&value._typedSymbol===_typedSymbol}static dereference(value,type){if(Typed.isTyped(value)){if(value.type!==type){throw new Error(`invalid type: expecetd ${type}, got ${value.type}`)}return value.value}return value}}class AddressCoder extends Coder{constructor(localName){super("address","address",localName,false)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(writer,_value){let value=Typed.dereference(_value,"string");try{value=getAddress(value)}catch(error){return this._throwError(error.message,_value)}return writer.writeValue(value)}decode(reader){return getAddress(toBeHex(reader.readValue(),22))}}class AnonymousCoder extends Coder{coder;constructor(coder){super(coder.name,coder.type,"_",coder.dynamic);this.coder=coder}defaultValue(){return this.coder.defaultValue()}encode(writer,value){return this.coder.encode(writer,value)}decode(reader){return this.coder.decode(reader)}}function pack(writer,coders,values){let arrayValues=[];if(Array.isArray(values)){arrayValues=values}else if(values&&typeof values==="object"){let unique={};arrayValues=coders.map(coder=>{const name=coder.localName;assert(name,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});assert(!unique[name],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});unique[name]=true;return values[name]})}else{assertArgument(false,"invalid tuple value","tuple",values)}assertArgument(coders.length===arrayValues.length,"types/value length mismatch","tuple",values);let staticWriter=new Writer;let dynamicWriter=new Writer;let updateFuncs=[];coders.forEach((coder,index)=>{let value=arrayValues[index];if(coder.dynamic){let dynamicOffset=dynamicWriter.length;coder.encode(dynamicWriter,value);let updateFunc=staticWriter.writeUpdatableValue();updateFuncs.push(baseOffset=>{updateFunc(baseOffset+dynamicOffset)})}else{coder.encode(staticWriter,value)}});updateFuncs.forEach(func=>{func(staticWriter.length)});let length=writer.appendWriter(staticWriter);length+=writer.appendWriter(dynamicWriter);return length}function unpack(reader,coders){let values=[];let keys=[];let baseReader=reader.subReader(0);coders.forEach(coder=>{let value=null;if(coder.dynamic){let offset=reader.readIndex();let offsetReader=baseReader.subReader(offset);try{value=coder.decode(offsetReader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}else{try{value=coder.decode(reader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}if(value==undefined){throw new Error("investigate")}values.push(value);keys.push(coder.localName||null)});return Result.fromItems(values,keys)}class ArrayCoder extends Coder{coder;length;constructor(coder,length,localName){const type=coder.type+"["+(length>=0?length:"")+"]";const dynamic=length===-1||coder.dynamic;super("array",type,localName,dynamic);defineProperties(this,{coder:coder,length:length})}defaultValue(){const defaultChild=this.coder.defaultValue();const result=[];for(let i=0;ibounds||value<-(bounds+BN_1$2)){this._throwError("value out-of-bounds",_value)}value=toTwos(value,8*WordSize)}else if(valuemask(maxUintValue,this.size*8)){this._throwError("value out-of-bounds",_value)}return writer.writeValue(value)}decode(reader){let value=mask(reader.readValue(),this.size*8);if(this.signed){value=fromTwos(value,this.size*8)}return value}}class StringCoder extends DynamicBytesCoder{constructor(localName){super("string",localName)}defaultValue(){return""}encode(writer,_value){return super.encode(writer,toUtf8Bytes(Typed.dereference(_value,"string")))}decode(reader){return toUtf8String(super.decode(reader))}}class TupleCoder extends Coder{coders;constructor(coders,localName){let dynamic=false;const types=[];coders.forEach(coder=>{if(coder.dynamic){dynamic=true}types.push(coder.type)});const type="tuple("+types.join(",")+")";super("tuple",type,localName,dynamic);defineProperties(this,{coders:Object.freeze(coders.slice())})}defaultValue(){const values=[];this.coders.forEach(coder=>{values.push(coder.defaultValue())});const uniqueNames=this.coders.reduce((accum,coder)=>{const name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});this.coders.forEach((coder,index)=>{let name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}values[name]=values[index]});return Object.freeze(values)}encode(writer,_value){const value=Typed.dereference(_value,"tuple");return pack(writer,this.coders,value)}decode(reader){return unpack(reader,this.coders)}}function id(value,useKeccak){if(useKeccak){return keccak256(toUtf8Bytes(value))}return sha256(toUtf8Bytes(value))}const ZeroAddress="0x0000000000000000000000000000000000000000";const ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000";const N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const OrePerXCB=BigInt("1000000000000000000");const MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);const MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const CoreSymbol="Ξ";const MessagePrefix="Core Signed Message:\n";function accessSetify(addr,storageKeys){return{address:getAddress(addr),storageKeys:storageKeys.map((storageKey,index)=>{assertArgument(isHexString(storageKey,32),"invalid slot",`storageKeys[${index}]`,storageKey);return storageKey.toLowerCase()})}}function accessListify(value){if(Array.isArray(value)){return value.map((set,index)=>{if(Array.isArray(set)){assertArgument(set.length===2,"invalid slot set",`value[${index}]`,set);return accessSetify(set[0],set[1])}assertArgument(set!=null&&typeof set==="object","invalid address-slot set","value",value);return accessSetify(set.address,set.storageKeys)})}assertArgument(value!=null&&typeof value==="object","invalid access list","value",value);const result=Object.keys(value).map(addr=>{const storageKeys=value[addr].reduce((accum,storageKey)=>{accum[storageKey]=true;return accum},{});return accessSetify(addr,Object.keys(storageKeys).sort())});result.sort((a,b)=>a.address.localeCompare(b.address));return result}const logger$1=new Logger("transaction/0.0.1");const BN_0$4=BigInt(0);function handleAddress(value){if(value==="0x"){return null}return getAddress(value)}function parse(data){const handleNumber=value=>{if(value==="0x"){return BigNumber.from(0)}return BigNumber.from(value)};const transaction=decode$1(data);if(transaction.length!==7&&transaction.length!==8){logger$1.throwArgumentError("invalid raw transaction","data",data)}const isSigned=transaction.length===8;const tx={nonce:Number(handleNumber(transaction[0])),energyPrice:handleNumber(transaction[1]).toBigInt(),energyLimit:handleNumber(transaction[2]).toBigInt(),networkId:handleNumber(transaction[isSigned?3:6]).toBigInt(),to:handleAddress(transaction[isSigned?4:3]),value:handleNumber(transaction[isSigned?5:4]).toBigInt(),data:transaction[isSigned?6:5]};if(transaction.length===8){const prefix=networkIdToPrefix(Number(tx.networkId));const digest=sha256(serialize(tx));tx.hash=sha256(serialize(tx,transaction[7]));tx.from=recoverAddress(digest,transaction[7],prefix);tx.signature=transaction[7]}return tx}const unsignedTransactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"},{name:"networkId",maxLength:32,numeric:true}];const transactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"networkId",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"}];const allowedTransactionKeys={networkId:true,data:true,energyLimit:true,energyPrice:true,nonce:true,to:true,value:true};function serialize(transaction,signature){checkProperties(transaction,allowedTransactionKeys);const raw=[];(!!signature?transactionFields:unsignedTransactionFields).forEach(function({numeric,maxLength,name,length}){let value=transaction[name]||[];const options={};if(numeric){options.hexPad="left"}const tmpHexlified=hexlify(value,options);value=arrayify(tmpHexlified);if(length&&value.length!==length&&value.length>0){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}if(maxLength){value=stripZeros(value);if(value.length>maxLength){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}}const hexlified=hexlify(value);raw.push(hexlified)});if(!!signature){raw.push(hexlify(signature))}const finalValue=encode(raw);return finalValue}class Transaction{#to;#data;#nonce;#energyLimit;#energyPrice;#value;#networkId;#sig;get to(){return this.#to}set to(value){this.#to=value==null?null:getAddress(value)}get nonce(){return this.#nonce}set nonce(value){this.#nonce=getNumber(value,"value")}get energyLimit(){return this.#energyLimit}set energyLimit(value){this.#energyLimit=getBigInt(value)}get energyPrice(){const value=this.#energyPrice;if(value==null){return BN_0$4}return value}set energyPrice(value){this.#energyPrice=value==null?null:getBigInt(value,"energyPrice")}get data(){return this.#data}set data(value){this.#data=hexlify(value)}get value(){return this.#value}set value(value){this.#value=getBigInt(value,"value")}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value)}get signature(){return this.#sig||null}set signature(value){this.#sig=value==null?null:value}constructor(){this.#to=null;this.#nonce=0;this.#energyLimit=BigInt(0);this.#energyPrice=null;this.#data="0x";this.#value=BigInt(0);this.#networkId=BigInt(0);this.#sig=null}get hash(){if(this.signature==null){return null}return sha256(this.serialized)}get unsignedHash(){return sha256(this.unsignedSerialized)}get from(){if(this.signature==null){return null}const prefix=networkIdToPrefix(Number(this.#networkId));return recoverAddress(this.unsignedHash,this.signature,prefix)}get fromPublicKey(){if(this.signature==null){return null}return SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){assert(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});return serialize(this,this.signature)}get unsignedSerialized(){return serialize(this)}clone(){return Transaction.from(this)}toJSON(){const s=v=>{if(v==null){return null}return v.toString()};return{to:this.to,data:this.data,nonce:this.nonce,energyLimit:s(this.energyLimit),energyPrice:s(this.energyPrice),value:s(this.value),networkId:s(this.networkId),sig:this.signature?this.signature:null}}static from(tx){if(tx==null){return new Transaction}if(typeof tx==="string"){const payload=getBytes(tx);return Transaction.from(parse(payload))}const result=new Transaction;if(tx.to!=null){result.to=tx.to}if(tx.nonce!=null){result.nonce=tx.nonce}if(tx.energyLimit!=null){result.energyLimit=tx.energyLimit}if(tx.energyPrice!=null){result.energyPrice=tx.energyPrice}if(tx.data!=null){result.data=tx.data}if(tx.value!=null){result.value=tx.value}if(tx.networkId!=null){result.networkId=tx.networkId}if(tx.signature!=null){result.signature=tx.signature}if(tx.hash!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define hash","tx",tx);assertArgument(result.hash===tx.hash,"hash mismatch","tx",tx)}if(tx.from!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define from","tx",tx);assertArgument(result.from.toLowerCase()===(tx.from||"").toLowerCase(),"from mismatch","tx",tx)}return result}}function hashMessage(message){if(typeof message==="string"){message=toUtf8Bytes(message)}return sha256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(message.length)),message]))}function verifyMessage(message,sig,prefix){const digest=hashMessage(message);return recoverAddress(digest,sig,prefix)}const regexBytes=new RegExp("^bytes([0-9]+)$");const regexNumber=new RegExp("^(u?int)([0-9]*)$");const regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$");function _pack(type,value,isArray){switch(type){case"address":if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(getAddress(value));case"string":return toUtf8Bytes(value);case"bytes":return getBytes(value);case"bool":value=!!value?"0x01":"0x00";if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(value)}let match=type.match(regexNumber);if(match){let signed=match[1]==="int";let size=parseInt(match[2]||"256");assertArgument((!match[2]||match[2]===String(size))&&size%8===0&&size!==0&&size<=256,"invalid number type","type",type);if(isArray){size=256}if(signed){value=toTwos(value,size)}return getBytes(zeroPadValue(toBeArray(value),size/8))}match=type.match(regexBytes);if(match){const size=parseInt(match[1]);assertArgument(String(size)===match[1]&&size!==0&&size<=32,"invalid bytes type","type",type);assertArgument(dataLength(value)===size,`invalid value for ${type}`,"value",value);if(isArray){return getBytes(zeroPadBytes(value,32))}return value}match=type.match(regexArray);if(match&&Array.isArray(value)){const baseType=match[1];const count=parseInt(match[2]||String(value.length));assertArgument(count===value.length,`invalid array length for ${type}`,"value",value);const result=[];value.forEach(function(value){result.push(_pack(baseType,value,true))});return getBytes(concat(result))}assertArgument(false,"invalid type","type",type)}function solidityPacked(types,values){assertArgument(types.length===values.length,"wrong number of values; expected ${ types.length }","values",values);const tight=[];types.forEach(function(type,index){tight.push(_pack(type,values[index]))});return hexlify(concat(tight))}function solidityPackedSha256(types,values){return sha256(solidityPacked(types,values))}const padding=new Uint8Array(32);padding.fill(0);const BN__1=BigInt(-1);const BN_0$3=BigInt(0);const BN_1$1=BigInt(1);const BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(value){const bytes=getBytes(value);const padOffset=bytes.length%32;if(padOffset){return concat([bytes,padding.slice(padOffset)])}return hexlify(bytes)}const hexTrue=toBeHex(BN_1$1,32);const hexFalse=toBeHex(BN_0$3,32);const domainFieldTypes={name:"string",version:"string",networkId:"uint256",verifyingContract:"address",salt:"bytes32"};const domainFieldNames=["name","version","networkId","verifyingContract","salt"];function checkString(key){return function(value){assertArgument(typeof value==="string",`invalid domain value for ${JSON.stringify(key)}`,`domain.${key}`,value);return value}}const domainChecks={name:checkString("name"),version:checkString("version"),networkId:function(_value){const value=getBigInt(_value,"domain.networkId");assertArgument(value>=0,"invalid chain ID","domain.networkId",_value);if(Number.isSafeInteger(value)){return Number(value)}return toQuantity(value)},verifyingContract:function(value){try{return getAddress(value).toLowerCase()}catch(error){}assertArgument(false,`invalid domain value "verifyingContract"`,"domain.verifyingContract",value)},salt:function(value){const bytes=getBytes(value,"domain.salt");assertArgument(bytes.length===32,`invalid domain value "salt"`,"domain.salt",value);return hexlify(bytes)}};function getBaseEncoder(type){{const match=type.match(/^(u?)int(\d*)$/);if(match){const signed=match[1]==="";const width=parseInt(match[2]||"256");assertArgument(width%8===0&&width!==0&&width<=256&&(match[2]==null||match[2]===String(width)),"invalid numeric width","type",type);const boundsUpper=mask(BN_MAX_UINT256,signed?width-1:width);const boundsLower=signed?(boundsUpper+BN_1$1)*BN__1:BN_0$3;return function(_value){const value=getBigInt(_value,"value");assertArgument(value>=boundsLower&&value<=boundsUpper,`value out-of-bounds for ${type}`,"value",value);return toBeHex(signed?toTwos(value,256):value,32)}}}{const match=type.match(/^bytes(\d+)$/);if(match){const width=parseInt(match[1]);assertArgument(width!==0&&width<=32&&match[1]===String(width),"invalid bytes width","type",type);return function(value){const bytes=getBytes(value);assertArgument(bytes.length===width,`invalid length for ${type}`,"value",value);return hexPadRight(value)}}}switch(type){case"address":return function(value){return zeroPadValue(getAddress(value),32)};case"bool":return function(value){return!value?hexFalse:hexTrue};case"bytes":return function(value){return sha256(value)};case"string":return function(value){return id(value)}}return null}function encodeType(name,fields){return`${name}(${fields.map(({name,type})=>type+" "+name).join(",")})`}class TypedDataEncoder{primaryType;#types;get types(){return JSON.parse(this.#types)}#fullTypes;#encoderCache;constructor(types){this.#types=JSON.stringify(types);this.#fullTypes=new Map;this.#encoderCache=new Map;const links=new Map;const parents=new Map;const subtypes=new Map;Object.keys(types).forEach(type=>{links.set(type,new Set);parents.set(type,[]);subtypes.set(type,new Set)});for(const name in types){const uniqueNames=new Set;for(const field of types[name]){assertArgument(!uniqueNames.has(field.name),`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`,"types",types);uniqueNames.add(field.name);const baseType=field.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;assertArgument(baseType!==name,`circular type reference to ${JSON.stringify(baseType)}`,"types",types);const encoder=getBaseEncoder(baseType);if(encoder){continue}assertArgument(parents.has(baseType),`unknown type ${JSON.stringify(baseType)}`,"types",types);parents.get(baseType).push(name);links.get(name).add(baseType)}}const primaryTypes=Array.from(parents.keys()).filter(n=>parents.get(n).length===0);assertArgument(primaryTypes.length!==0,"missing primary type","types",types);assertArgument(primaryTypes.length===1,`ambiguous primary types or unused types: ${primaryTypes.map(t=>JSON.stringify(t)).join(", ")}`,"types",types);defineProperties(this,{primaryType:primaryTypes[0]});function checkCircular(type,found){assertArgument(!found.has(type),`circular type reference to ${JSON.stringify(type)}`,"types",types);found.add(type);for(const child of links.get(type)){if(!parents.has(child)){continue}checkCircular(child,found);for(const subtype of found){subtypes.get(subtype).add(child)}}found.delete(type)}checkCircular(this.primaryType,new Set);for(const[name,set]of subtypes){const st=Array.from(set);st.sort();this.#fullTypes.set(name,encodeType(name,types[name])+st.map(t=>encodeType(t,types[t])).join(""))}}getEncoder(type){let encoder=this.#encoderCache.get(type);if(!encoder){encoder=this.#getEncoder(type);this.#encoderCache.set(type,encoder)}return encoder}#getEncoder(type){{const encoder=getBaseEncoder(type);if(encoder){return encoder}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){const subtype=match[1];const subEncoder=this.getEncoder(subtype);return value=>{assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);let result=value.map(subEncoder);if(this.#fullTypes.has(subtype)){result=result.map(sha256)}return sha256(concat(result))}}const fields=this.types[type];if(fields){const encodedType=id(this.#fullTypes.get(type));return value=>{const values=fields.map(({name,type})=>{const result=this.getEncoder(type)(value[name]);if(this.#fullTypes.has(type)){return sha256(result)}return result});values.unshift(encodedType);return concat(values)}}assertArgument(false,`unknown type: ${type}`,"type",type)}encodeType(name){const result=this.#fullTypes.get(name);assertArgument(result,`unknown type: ${JSON.stringify(name)}`,"name",name);return result}encodeData(type,value){return this.getEncoder(type)(value)}hashStruct(name,value){return sha256(this.encodeData(name,value))}encode(value){return this.encodeData(this.primaryType,value)}hash(value){return this.hashStruct(this.primaryType,value)}_visit(type,value,callback){{const encoder=getBaseEncoder(type);if(encoder){return callback(type,value)}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);return value.map(v=>this._visit(match[1],v,callback))}const fields=this.types[type];if(fields){return fields.reduce((accum,{name,type})=>{accum[name]=this._visit(type,value[name],callback);return accum},{})}assertArgument(false,`unknown type: ${type}`,"type",type)}visit(value,callback){return this._visit(this.primaryType,value,callback)}static from(types){return new TypedDataEncoder(types)}static getPrimaryType(types){return TypedDataEncoder.from(types).primaryType}static hashStruct(name,types,value){return TypedDataEncoder.from(types).hashStruct(name,value)}static hashDomain(domain){const domainFields=[];for(const name in domain){if(domain[name]==null){continue}const type=domainFieldTypes[name];assertArgument(type,`invalid typed-data domain key: ${JSON.stringify(name)}`,"domain",domain);domainFields.push({name:name,type:type})}domainFields.sort((a,b)=>{return domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(b.name)});return TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:domainFields},domain)}static encode(domain,types,value){return concat(["0x1901",TypedDataEncoder.hashDomain(domain),TypedDataEncoder.from(types).hash(value)])}static hash(domain,types,value){return sha256(TypedDataEncoder.encode(domain,types,value))}static async resolveNames(domain,types,value,resolveName){domain=Object.assign({},domain);for(const key in domain){if(domain[key]==null){delete domain[key]}}const ensCache={};if(domain.verifyingContract&&!isHexString(domain.verifyingContract,20)){ensCache[domain.verifyingContract]="0x"}const encoder=TypedDataEncoder.from(types);encoder.visit(value,(type,value)=>{if(type==="address"&&!isHexString(value,20)){ensCache[value]="0x"}return value});for(const name in ensCache){ensCache[name]=await resolveName(name)}if(domain.verifyingContract&&ensCache[domain.verifyingContract]){domain.verifyingContract=ensCache[domain.verifyingContract]}value=encoder.visit(value,(type,value)=>{if(type==="address"&&ensCache[value]){return ensCache[value]}return value});return{domain:domain,value:value}}static getPayload(domain,types,value){TypedDataEncoder.hashDomain(domain);const domainValues={};const domainTypes=[];domainFieldNames.forEach(name=>{const value=domain[name];if(value==null){return}domainValues[name]=domainChecks[name](value);domainTypes.push({name:name,type:domainFieldTypes[name]})});const encoder=TypedDataEncoder.from(types);const typesWithDomain=Object.assign({},types);assertArgument(typesWithDomain.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",types);typesWithDomain.EIP712Domain=domainTypes;encoder.encode(value);return{types:typesWithDomain,domain:domainValues,primaryType:encoder.primaryType,message:encoder.visit(value,(type,value)=>{if(type.match(/^bytes(\d*)/)){return hexlify(getBytes(value))}if(type.match(/^u?int/)){return getBigInt(value).toString()}switch(type){case"address":return value.toLowerCase();case"bool":return!!value;case"string":assertArgument(typeof value==="string","invalid string","value",value);return value}assertArgument(false,"unsupported type","type",type)})}}}function verifyTypedData(domain,types,value,signature,prefix){return recoverAddress(TypedDataEncoder.hash(domain,types,value),signature,prefix)}var _a;function setify(items){const result=new Set;items.forEach(k=>result.add(k));return Object.freeze(result)}const _kwVisib="constant external internal payable private public pure view";const KwVisib=setify(_kwVisib.split(" "));const _kwTypes="constructor error event fallback function receive struct";const KwTypes=setify(_kwTypes.split(" "));const _kwModifiers="calldata memory storage payable indexed";const KwModifiers=setify(_kwModifiers.split(" "));const _kwOther="tuple returns";const _keywords=[_kwTypes,_kwModifiers,_kwOther,_kwVisib].join(" ");const Keywords=setify(_keywords.split(" "));const SimpleTokens={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"};const regexWhitespacePrefix=new RegExp("^(\\s*)");const regexNumberPrefix=new RegExp("^([0-9]+)");const regexIdPrefix=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");const regexId=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");const regexType=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class TokenString{#offset;#tokens;get offset(){return this.#offset}get length(){return this.#tokens.length-this.#offset}constructor(tokens){this.#offset=0;this.#tokens=tokens.slice()}clone(){return new _a(this.#tokens)}reset(){this.#offset=0}#subTokenString(from=0,to=0){return new _a(this.#tokens.slice(from,to).map(t=>{return Object.freeze(Object.assign({},t,{match:t.match-from,linkBack:t.linkBack-from,linkNext:t.linkNext-from}))}))}popKeyword(allowed){const top=this.peek();if(top.type!=="KEYWORD"||!allowed.has(top.text)){throw new Error(`expected keyword ${top.text}`)}return this.pop().text}popType(type){if(this.peek().type!==type){throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`)}return this.pop().text}popParen(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=this.#subTokenString(this.#offset+1,top.match+1);this.#offset=top.match+1;return result}popParams(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=[];while(this.#offset=this.#tokens.length){throw new Error("out-of-bounds")}return this.#tokens[this.#offset]}peekKeyword(allowed){const top=this.peekType("KEYWORD");return top!=null&&allowed.has(top)?top:null}peekType(type){if(this.length===0){return null}const top=this.peek();return top.type===type?top.text:null}pop(){const result=this.peek();this.#offset++;return result}toString(){const tokens=[];for(let i=this.#offset;i`}}_a=TokenString;function lex(text){const tokens=[];const throwError=message=>{const token=offset0&&tokens[tokens.length-1].type==="NUMBER"){const value=tokens.pop().text;suffix=value+suffix;tokens[tokens.length-1].value=getNumber(value)}if(tokens.length===0||tokens[tokens.length-1].type!=="BRACKET"){throw new Error("missing opening bracket")}tokens[tokens.length-1].text+=suffix}continue}match=cur.match(regexIdPrefix);if(match){token.text=match[1];offset+=token.text.length;if(Keywords.has(token.text)){token.type="KEYWORD";continue}if(token.text.match(regexType)){token.type="TYPE";continue}token.type="ID";continue}match=cur.match(regexNumberPrefix);if(match){token.text=match[1];token.type="NUMBER";offset+=token.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`)}return new TokenString(tokens.map(t=>Object.freeze(t)))}function allowSingle(set,allowed){let included=[];for(const key in allowed.keys()){if(set.has(key)){included.push(key)}}if(included.length>1){throw new Error(`conflicting types: ${included.join(", ")}`)}}function consumeName(type,tokens){if(tokens.peekKeyword(KwTypes)){const keyword=tokens.pop().text;if(keyword!==type){throw new Error(`expected ${type}, got ${keyword}`)}}return tokens.popType("ID")}function consumeKeywords(tokens,allowed){const keywords=new Set;while(true){const keyword=tokens.peekType("KEYWORD");if(keyword==null||allowed&&!allowed.has(keyword)){break}tokens.pop();if(keywords.has(keyword)){throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`)}keywords.add(keyword)}return Object.freeze(keywords)}function consumeMutability(tokens){let modifiers=consumeKeywords(tokens,KwVisib);allowSingle(modifiers,setify("constant payable nonpayable".split(" ")));allowSingle(modifiers,setify("pure view payable nonpayable".split(" ")));if(modifiers.has("view")){return"view"}if(modifiers.has("pure")){return"pure"}if(modifiers.has("payable")){return"payable"}if(modifiers.has("nonpayable")){return"nonpayable"}if(modifiers.has("constant")){return"view"}return"nonpayable"}function consumeParams(tokens,allowIndexed){return tokens.popParams().map(t=>ParamType.from(t,allowIndexed))}function consumeEnergy(tokens){if(tokens.peekType("AT")){tokens.pop();if(tokens.peekType("NUMBER")){return getBigInt(tokens.pop().text)}throw new Error("invalid energy")}return null}function consumeEoi(tokens){if(tokens.length){throw new Error(`unexpected tokens: ${tokens.toString()}`)}}const regexArrayType=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(type){const match=type.match(regexType);assertArgument(match,"invalid type","type",type);if(type==="uint"){return"uint256"}if(type==="int"){return"int256"}if(match[2]){const length=parseInt(match[2]);assertArgument(length!==0&&length<=32,"invalid bytes length","type",type)}else if(match[3]){const size=parseInt(match[3]);assertArgument(size!==0&&size<=256&&size%8===0,"invalid numeric width","type",type)}return type}const _guard$2={};const internal$1=Symbol.for("_corebc_internal");const ParamTypeInternal="_ParamTypeInternal";const ErrorFragmentInternal="_ErrorInternal";const EventFragmentInternal="_EventInternal";const ConstructorFragmentInternal="_ConstructorInternal";const FallbackFragmentInternal="_FallbackInternal";const FunctionFragmentInternal="_FunctionInternal";const StructFragmentInternal="_StructInternal";class ParamType{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(guard,name,type,baseType,indexed,components,arrayLength,arrayChildren){assertPrivate(guard,_guard$2,"ParamType");Object.defineProperty(this,internal$1,{value:ParamTypeInternal});if(components){components=Object.freeze(components.slice())}if(baseType==="array"){if(arrayLength==null||arrayChildren==null){throw new Error("")}}else if(arrayLength!=null||arrayChildren!=null){throw new Error("")}if(baseType==="tuple"){if(components==null){throw new Error("")}}else if(components!=null){throw new Error("")}defineProperties(this,{name:name,type:type,baseType:baseType,indexed:indexed,components:components,arrayLength:arrayLength,arrayChildren:arrayChildren})}format(format){if(format==null){format="sighash"}if(format==="json"){let result={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||undefined};if(typeof this.indexed==="boolean"){result.indexed=this.indexed}if(this.isTuple()){result.components=this.components.map(c=>JSON.parse(c.format(format)))}return JSON.stringify(result)}let result="";if(this.isArray()){result+=this.arrayChildren.format(format);result+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`}else{if(this.isTuple()){if(format!=="sighash"){result+=this.type}result+="("+this.components.map(comp=>comp.format(format)).join(format==="full"?", ":",")+")"}else{result+=this.type}}if(format!=="sighash"){if(this.indexed===true){result+=" indexed"}if(format==="full"&&this.name){result+=" "+this.name}}return result}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(value,process){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const _this=this;return value.map(v=>_this.arrayChildren.walk(v,process))}if(this.isTuple()){if(!Array.isArray(value)){throw new Error("invalid tuple value")}if(value.length!==this.components.length){throw new Error("array is wrong length")}const _this=this;return value.map((v,i)=>_this.components[i].walk(v,process))}return process(this.type,value)}#walkAsync(promises,value,process,setValue){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const childType=this.arrayChildren;const result=value.slice();result.forEach((value,index)=>{childType.#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}if(this.isTuple()){const components=this.components;let result;if(Array.isArray(value)){result=value.slice()}else{if(value==null||typeof value!=="object"){throw new Error("invalid tuple value")}result=components.map(param=>{if(!param.name){throw new Error("cannot use object value with unnamed components")}if(!(param.name in value)){throw new Error(`missing value for component ${param.name}`)}return value[param.name]})}if(result.length!==this.components.length){throw new Error("array is wrong length")}result.forEach((value,index)=>{components[index].#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}const result=process(this.type,value);if(result.then){promises.push(async function(){setValue(await result)}())}else{setValue(result)}}async walkAsync(value,process){const promises=[];const result=[value];this.#walkAsync(promises,value,process,value=>{result[0]=value});if(promises.length){await Promise.all(promises)}return result[0]}static from(obj,allowIndexed){if(ParamType.isParamType(obj)){return obj}if(typeof obj==="string"){return ParamType.from(lex(obj),allowIndexed)}else if(obj instanceof TokenString){let type="",baseType="";let comps=null;if(consumeKeywords(obj,setify(["tuple"])).has("tuple")||obj.peekType("OPEN_PAREN")){baseType="tuple";comps=obj.popParams().map(t=>ParamType.from(t));type=`tuple(${comps.map(c=>c.format()).join(",")})`}else{type=verifyBasicType(obj.popType("TYPE"));baseType=type}let arrayChildren=null;let arrayLength=null;while(obj.length&&obj.peekType("BRACKET")){const bracket=obj.pop();arrayChildren=new ParamType(_guard$2,"",type,baseType,null,comps,arrayLength,arrayChildren);arrayLength=bracket.value;type+=bracket.text;baseType="array";comps=null}let indexed=null;const keywords=consumeKeywords(obj,KwModifiers);if(keywords.has("indexed")){if(!allowIndexed){throw new Error("")}indexed=true}const name=obj.peekType("ID")?obj.pop().text:"";if(obj.length){throw new Error("leftover tokens")}return new ParamType(_guard$2,name,type,baseType,indexed,comps,arrayLength,arrayChildren)}const name=obj.name;assertArgument(!name||typeof name==="string"&&name.match(regexId),"invalid name","obj.name",name);let indexed=obj.indexed;if(indexed!=null){assertArgument(allowIndexed,"parameter cannot be indexed","obj.indexed",obj.indexed);indexed=!!indexed}let type=obj.type;let arrayMatch=type.match(regexArrayType);if(arrayMatch){const arrayLength=parseInt(arrayMatch[2]||"-1");const arrayChildren=ParamType.from({type:arrayMatch[1],components:obj.components});return new ParamType(_guard$2,name||"",type,"array",indexed,null,arrayLength,arrayChildren)}if(type==="tuple"||type.startsWith("tuple(")||type.startsWith("(")){const comps=obj.components!=null?obj.components.map(c=>ParamType.from(c)):null;const tuple=new ParamType(_guard$2,name||"",type,"tuple",indexed,comps,null,null);return tuple}type=verifyBasicType(obj.type);return new ParamType(_guard$2,name||"",type,type,indexed,null,null,null)}static isParamType(value){return value&&value[internal$1]===ParamTypeInternal}}class Fragment{type;inputs;constructor(guard,type,inputs){assertPrivate(guard,_guard$2,"Fragment");inputs=Object.freeze(inputs.slice());defineProperties(this,{type:type,inputs:inputs})}static from(obj){if(typeof obj==="string"){try{Fragment.from(JSON.parse(obj))}catch(e){}return Fragment.from(lex(obj))}if(obj instanceof TokenString){const type=obj.peekKeyword(KwTypes);switch(type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}}else if(typeof obj==="object"){switch(obj.type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}assert(false,`unsupported type: ${obj.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(false,"unsupported frgament object","obj",obj)}static isConstructor(value){return ConstructorFragment.isFragment(value)}static isError(value){return ErrorFragment.isFragment(value)}static isEvent(value){return EventFragment.isFragment(value)}static isFunction(value){return FunctionFragment.isFragment(value)}static isStruct(value){return StructFragment.isFragment(value)}}class NamedFragment extends Fragment{name;constructor(guard,type,name,inputs){super(guard,type,inputs);assertArgument(typeof name==="string"&&name.match(regexId),"invalid identifier","name",name);inputs=Object.freeze(inputs.slice());defineProperties(this,{name:name})}}function joinParams(format,params){return"("+params.map(p=>p.format(format)).join(format==="full"?", ":",")+")"}class ErrorFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"error",name,inputs);Object.defineProperty(this,internal$1,{value:ErrorFragmentInternal})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(format)))})}const result=[];if(format!=="sighash"){result.push("error")}result.push(this.name+joinParams(format,this.inputs));return result.join(" ")}static from(obj){if(ErrorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ErrorFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("error",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new ErrorFragment(_guard$2,name,inputs)}return new ErrorFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===ErrorFragmentInternal}}class EventFragment extends NamedFragment{anonymous;constructor(guard,name,inputs,anonymous){super(guard,"event",name,inputs);Object.defineProperty(this,internal$1,{value:EventFragmentInternal});defineProperties(this,{anonymous:anonymous})}get topicHash(){return id(this.format("sighash"))}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[];if(format!=="sighash"){result.push("event")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"&&this.anonymous){result.push("anonymous")}return result.join(" ")}static getTopicHash(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new EventFragment(_guard$2,name,params,false);return fragment.topicHash}static from(obj){if(EventFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return EventFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("event",obj);const inputs=consumeParams(obj,true);const anonymous=!!consumeKeywords(obj,setify(["anonymous"])).has("anonymous");consumeEoi(obj);return new EventFragment(_guard$2,name,inputs,anonymous)}return new EventFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(p=>ParamType.from(p,true)):[],!!obj.anonymous)}static isFragment(value){return value&&value[internal$1]===EventFragmentInternal}}class ConstructorFragment extends Fragment{payable;energy;constructor(guard,type,inputs,payable,energy){super(guard,type,inputs);Object.defineProperty(this,internal$1,{value:ConstructorFragmentInternal});defineProperties(this,{payable:payable,energy:energy})}format(format){assert(format!=null&&format!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"});if(format==="json"){return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[`constructor${joinParams(format,this.inputs)}`];result.push(this.payable?"payable":"nonpayable");if(this.energy!=null){result.push(`@${this.energy.toString()}`)}return result.join(" ")}static from(obj){if(ConstructorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ConstructorFragment.from(lex(obj))}else if(obj instanceof TokenString){consumeKeywords(obj,setify(["constructor"]));const inputs=consumeParams(obj);const payable=!!consumeKeywords(obj,setify(["payable"])).has("payable");const energy=consumeEnergy(obj);consumeEoi(obj);return new ConstructorFragment(_guard$2,"constructor",inputs,payable,energy)}return new ConstructorFragment(_guard$2,"constructor",obj.inputs?obj.inputs.map(ParamType.from):[],!!obj.payable,obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===ConstructorFragmentInternal}}class FallbackFragment extends Fragment{payable;constructor(guard,inputs,payable){super(guard,"fallback",inputs);Object.defineProperty(this,internal$1,{value:FallbackFragmentInternal});defineProperties(this,{payable:payable})}format(format){const type=this.inputs.length===0?"receive":"fallback";if(format==="json"){const stateMutability=this.payable?"payable":"nonpayable";return JSON.stringify({type:type,stateMutability:stateMutability})}return`${type}()${this.payable?" payable":""}`}static from(obj){if(FallbackFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FallbackFragment.from(lex(obj))}else if(obj instanceof TokenString){const errorObj=obj.toString();const topIsValid=obj.peekKeyword(setify(["fallback","receive"]));assertArgument(topIsValid,"type must be fallback or receive","obj",errorObj);const type=obj.popKeyword(setify(["fallback","receive"]));if(type==="receive"){const inputs=consumeParams(obj);assertArgument(inputs.length===0,`receive cannot have arguments`,"obj.inputs",inputs);consumeKeywords(obj,setify(["payable"]));consumeEoi(obj);return new FallbackFragment(_guard$2,[],true)}let inputs=consumeParams(obj);if(inputs.length){assertArgument(inputs.length===1&&inputs[0].type==="bytes","invalid fallback inputs","obj.inputs",inputs.map(i=>i.format("minimal")).join(", "))}else{inputs=[ParamType.from("bytes")]}const mutability=consumeMutability(obj);assertArgument(mutability==="nonpayable"||mutability==="payable","fallback cannot be constants","obj.stateMutability",mutability);if(consumeKeywords(obj,setify(["returns"])).has("returns")){const outputs=consumeParams(obj);assertArgument(outputs.length===1&&outputs[0].type==="bytes","invalid fallback outputs","obj.outputs",outputs.map(i=>i.format("minimal")).join(", "))}consumeEoi(obj);return new FallbackFragment(_guard$2,inputs,mutability==="payable")}if(obj.type==="receive"){return new FallbackFragment(_guard$2,[],true)}if(obj.type==="fallback"){const inputs=[ParamType.from("bytes")];const payable=obj.stateMutability==="payable";return new FallbackFragment(_guard$2,inputs,payable)}assertArgument(false,"invalid fallback description","obj",obj)}static isFragment(value){return value&&value[internal$1]===FallbackFragmentInternal}}class FunctionFragment extends NamedFragment{constant;outputs;stateMutability;payable;energy;constructor(guard,name,stateMutability,inputs,outputs,energy){super(guard,"function",name,inputs);Object.defineProperty(this,internal$1,{value:FunctionFragmentInternal});outputs=Object.freeze(outputs.slice());const constant=stateMutability==="view"||stateMutability==="pure";const payable=stateMutability==="payable";defineProperties(this,{constant:constant,energy:energy,outputs:outputs,payable:payable,stateMutability:stateMutability})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format))),outputs:this.outputs.map(o=>JSON.parse(o.format(format)))})}const result=[];if(format!=="sighash"){result.push("function")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"){if(this.stateMutability!=="nonpayable"){result.push(this.stateMutability)}if(this.outputs&&this.outputs.length){result.push("returns");result.push(joinParams(format,this.outputs))}if(this.energy!=null){result.push(`@${this.energy.toString()}`)}}return result.join(" ")}static getSelector(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new FunctionFragment(_guard$2,name,"view",params,[],null);return fragment.selector}static from(obj){if(FunctionFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FunctionFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("function",obj);const inputs=consumeParams(obj);const mutability=consumeMutability(obj);let outputs=[];if(consumeKeywords(obj,setify(["returns"])).has("returns")){outputs=consumeParams(obj)}const energy=consumeEnergy(obj);consumeEoi(obj);return new FunctionFragment(_guard$2,name,mutability,inputs,outputs,energy)}let stateMutability=obj.stateMutability;if(stateMutability==null){stateMutability="payable";if(typeof obj.constant==="boolean"){stateMutability="view";if(!obj.constant){stateMutability="payable";if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}}else if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}return new FunctionFragment(_guard$2,obj.name,stateMutability,obj.inputs?obj.inputs.map(ParamType.from):[],obj.outputs?obj.outputs.map(ParamType.from):[],obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===FunctionFragmentInternal}}class StructFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"struct",name,inputs);Object.defineProperty(this,internal$1,{value:StructFragmentInternal})}format(){throw new Error("@TODO")}static from(obj){if(typeof obj==="string"){return StructFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("struct",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new StructFragment(_guard$2,name,inputs)}return new StructFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===StructFragmentInternal}}const PanicReasons$1=new Map;PanicReasons$1.set(0,"GENERIC_PANIC");PanicReasons$1.set(1,"ASSERT_FALSE");PanicReasons$1.set(17,"OVERFLOW");PanicReasons$1.set(18,"DIVIDE_BY_ZERO");PanicReasons$1.set(33,"ENUM_RANGE_ERROR");PanicReasons$1.set(34,"BAD_STORAGE_DATA");PanicReasons$1.set(49,"STACK_UNDERFLOW");PanicReasons$1.set(50,"ARRAY_RANGE_ERROR");PanicReasons$1.set(65,"OUT_OF_MEMORY");PanicReasons$1.set(81,"UNINITIALIZED_FUNCTION_CALL");const paramTypeBytes=new RegExp(/^bytes([0-9]*)$/);const paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);let defaultCoder=null;function getBuiltinCallException(action,tx,data,abiCoder){let message="missing revert data";let reason=null;const invocation=null;let revert=null;if(data){message="execution reverted";const bytes=getBytes(data);data=hexlify(data);if(bytes.length===0){message+=" (no data present; likely require(false) occurred";reason="require(false)"}else if(bytes.length%32!==4){message+=" (could not decode reason; invalid data length)"}else if(hexlify(bytes.slice(0,4))==="0x08c379a0"){try{reason=abiCoder.decode(["string"],bytes.slice(4))[0];revert={signature:"Error(string)",name:"Error",args:[reason]};message+=`: ${JSON.stringify(reason)}`}catch(error){message+=" (could not decode reason; invalid string data)"}}else if(hexlify(bytes.slice(0,4))==="0x4e487b71"){try{const code=Number(abiCoder.decode(["uint256"],bytes.slice(4))[0]);revert={signature:"Panic(uint256)",name:"Panic",args:[code]};reason=`Panic due to ${PanicReasons$1.get(code)||"UNKNOWN"}(${code})`;message+=`: ${reason}`}catch(error){message+=" (could not decode panic code)"}}else{message+=" (unknown custom error)"}}const transaction={to:tx.to?getAddress(tx.to):null,data:tx.data||"0x"};if(tx.from){transaction.from=getAddress(tx.from)}return makeError(message,"CALL_EXCEPTION",{action:action,data:data,reason:reason,transaction:transaction,invocation:invocation,revert:revert})}class AbiCoder{#getCoder(param){if(param.isArray()){return new ArrayCoder(this.#getCoder(param.arrayChildren),param.arrayLength,param.name)}if(param.isTuple()){return new TupleCoder(param.components.map(c=>this.#getCoder(c)),param.name)}switch(param.baseType){case"address":return new AddressCoder(param.name);case"bool":return new BooleanCoder(param.name);case"string":return new StringCoder(param.name);case"bytes":return new BytesCoder(param.name);case"":return new NullCoder(param.name)}let match=param.type.match(paramTypeNumber);if(match){let size=parseInt(match[2]||"256");assertArgument(size!==0&&size<=256&&size%8===0,"invalid "+match[1]+" bit length","param",param);return new NumberCoder(size/8,match[1]==="int",param.name)}match=param.type.match(paramTypeBytes);if(match){let size=parseInt(match[1]);assertArgument(size!==0&&size<=32,"invalid bytes length","param",param);return new FixedBytesCoder(size,param.name)}assertArgument(false,"invalid type","type",param.type)}getDefaultValue(types){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.defaultValue()}encode(types,values){assertArgumentCount(values.length,types.length,"types/values length mismatch");const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");const writer=new Writer;coder.encode(writer,values);return writer.data}decode(types,data,loose){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.decode(new Reader(data,loose))}static defaultAbiCoder(){if(defaultCoder==null){defaultCoder=new AbiCoder}return defaultCoder}static getBuiltinCallException(action,tx,data){return getBuiltinCallException(action,tx,data,AbiCoder.defaultAbiCoder())}}function encodeBytes32String(text){const bytes=toUtf8Bytes(text);if(bytes.length>31){throw new Error("bytes32 string must be less than 32 bytes")}return zeroPadBytes(bytes,32)}function decodeBytes32String(_bytes){const data=getBytes(_bytes,"bytes");if(data.length!==32){throw new Error("invalid bytes32 - not 32 bytes long")}if(data[31]!==0){throw new Error("invalid bytes32 string - no null terminator")}let length=31;while(data[length-1]===0){length--}return toUtf8String(data.slice(0,length))}class LogDescription{fragment;name;signature;topic;args;constructor(fragment,topic,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,signature:signature,topic:topic,args:args})}}class TransactionDescription{fragment;name;args;signature;selector;value;constructor(fragment,selector,args,value){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector,value:value})}}class ErrorDescription{fragment;name;args;signature;selector;constructor(fragment,selector,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector})}}class Indexed{hash;_isIndexed;static isIndexed(value){return!!(value&&value._isIndexed)}constructor(hash){defineProperties(this,{hash:hash,_isIndexed:true})}}const PanicReasons={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"};const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:message=>{return`reverted with reason string ${JSON.stringify(message)}`}},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:code=>{let reason="unknown panic code";if(code>=0&&code<=255&&PanicReasons[code.toString()]){reason=PanicReasons[code.toString()]}return`reverted with panic code 0x${code.toString(16)} (${reason})`}}};class Interface{fragments;deploy;fallback;receive;#errors;#events;#functions;#abiCoder;constructor(fragments){let abi=[];if(typeof fragments==="string"){abi=JSON.parse(fragments)}else{abi=fragments}this.#functions=new Map;this.#errors=new Map;this.#events=new Map;const frags=[];for(const a of abi){try{frags.push(Fragment.from(a))}catch(error){console.log("EE",error)}}defineProperties(this,{fragments:Object.freeze(frags)});let fallback=null;let receive=false;this.#abiCoder=this.getAbiCoder();this.fragments.forEach((fragment,index)=>{let bucket;switch(fragment.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}defineProperties(this,{deploy:fragment});return;case"fallback":if(fragment.inputs.length===0){receive=true}else{assertArgument(!fallback||fragment.payable!==fallback.payable,"conflicting fallback fragments",`fragments[${index}]`,fragment);fallback=fragment;receive=fallback.payable}return;case"function":bucket=this.#functions;break;case"event":bucket=this.#events;break;case"error":bucket=this.#errors;break;default:return}const signature=fragment.format();if(bucket.has(signature)){return}bucket.set(signature,fragment)});if(!this.deploy){defineProperties(this,{deploy:ConstructorFragment.from("constructor()")})}defineProperties(this,{fallback:fallback,receive:receive})}format(minimal){const format=minimal?"minimal":"full";const abi=this.fragments.map(f=>f.format(format));return abi}formatJson(){const abi=this.fragments.map(f=>f.format("json"));return JSON.stringify(abi.map(j=>JSON.parse(j)))}getAbiCoder(){return AbiCoder.defaultAbiCoder()}#getFunction(key,values,forceUnique){if(isHexString(key)){const selector=key.toLowerCase();for(const fragment of this.#functions.values()){if(selector===fragment.selector){return fragment}}return null}if(key.indexOf("(")===-1){const matching=[];for(const[name,fragment]of this.#functions){if(name.split("(")[0]===key){matching.push(fragment)}}if(values){const lastValue=values.length>0?values[values.length-1]:null;let valueLength=values.length;let allowOptions=true;if(Typed.isTyped(lastValue)&&lastValue.type==="overrides"){allowOptions=false;valueLength--}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs.length;if(inputs!==valueLength&&(!allowOptions||inputs!==valueLength-1)){matching.splice(i,1)}}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs;for(let j=0;j=inputs.length){if(values[j].type==="overrides"){continue}matching.splice(i,1);break}if(values[j].type!==inputs[j].baseType){matching.splice(i,1);break}}}}if(matching.length===1&&values&&values.length!==matching[0].inputs.length){const lastArg=values[values.length-1];if(lastArg==null||Array.isArray(lastArg)||typeof lastArg!=="object"){matching.splice(0,1)}}if(matching.length===0){return null}if(matching.length>1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous function description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#functions.get(FunctionFragment.from(key).format());if(result){return result}return null}getFunctionName(key){const fragment=this.#getFunction(key,null,false);assertArgument(fragment,"no matching function","key",key);return fragment.name}hasFunction(key){return!!this.#getFunction(key,null,false)}getFunction(key,values){return this.#getFunction(key,values||null,true)}forEachFunction(callback){const names=Array.from(this.#functions.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i=0;i--){if(matching[i].inputs.length=0;i--){const inputs=matching[i].inputs;for(let j=0;j1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous event description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#events.get(EventFragment.from(key).format());if(result){return result}return null}getEventName(key){const fragment=this.#getEvent(key,null,false);assertArgument(fragment,"no matching event","key",key);return fragment.name}hasEvent(key){return!!this.#getEvent(key,null,false)}getEvent(key,values){return this.#getEvent(key,values||null,true)}forEachEvent(callback){const names=Array.from(this.#events.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i1){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous error description (i.e. ${matchStr})`,"name",key)}return matching[0]}key=ErrorFragment.from(key).format();if(key==="Error(string)"){return ErrorFragment.from("error Error(string)")}if(key==="Panic(uint256)"){return ErrorFragment.from("error Panic(uint256)")}const result=this.#errors.get(key);if(result){return result}return null}forEachError(callback){const names=Array.from(this.#errors.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i{if(param.type==="string"){return id(value)}else if(param.type==="bytes"){return sha256(hexlify(value))}if(param.type==="bool"&&typeof value==="boolean"){value=value?"0x01":"0x00"}if(param.type.match(/^u?int/)){value=toBeHex(value)}if(param.type==="address"){this.#abiCoder.encode(["address"],[value])}return zeroPadValue(hexlify(value),32)};values.forEach((value,index)=>{const param=fragment.inputs[index];if(!param.indexed){assertArgument(value==null,"cannot filter non-indexed parameters; must be null","contract."+param.name,value);return}if(value==null){topics.push(null)}else if(param.baseType==="array"||param.baseType==="tuple"){assertArgument(false,"filtering with tuples or arrays not supported","contract."+param.name,value)}else if(Array.isArray(value)){topics.push(value.map(value=>encodeTopic(param,value)))}else{topics.push(encodeTopic(param,value))}});while(topics.length&&topics[topics.length-1]===null){topics.pop()}return topics}encodeEventLog(fragment,values){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}const topics=[];const dataTypes=[];const dataValues=[];if(!fragment.anonymous){topics.push(fragment.topicHash)}assertArgument(values.length===fragment.inputs.length,"event arguments/values mismatch","values",values);fragment.inputs.forEach((param,index)=>{const value=values[index];if(param.indexed){if(param.type==="string"){topics.push(id(value))}else if(param.type==="bytes"){topics.push(sha256(value))}else if(param.baseType==="tuple"||param.baseType==="array"){throw new Error("not implemented")}else{topics.push(this.#abiCoder.encode([param.type],[value]))}}else{dataTypes.push(param);dataValues.push(value)}});return{data:this.#abiCoder.encode(dataTypes,dataValues),topics:topics}}decodeEventLog(fragment,data,topics){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}if(topics!=null&&!fragment.anonymous){const eventTopic=fragment.topicHash;assertArgument(isHexString(topics[0],32)&&topics[0].toLowerCase()===eventTopic,"fragment/topic mismatch","topics[0]",topics[0]);topics=topics.slice(1)}const indexed=[];const nonIndexed=[];const dynamic=[];fragment.inputs.forEach((param,index)=>{if(param.indexed){if(param.type==="string"||param.type==="bytes"||param.baseType==="tuple"||param.baseType==="array"){indexed.push(ParamType.from({type:"bytes32",name:param.name}));dynamic.push(true)}else{indexed.push(param);dynamic.push(false)}}else{nonIndexed.push(param);dynamic.push(false)}});const resultIndexed=topics!=null?this.#abiCoder.decode(indexed,concat(topics)):null;const resultNonIndexed=this.#abiCoder.decode(nonIndexed,data,true);const values=[];const keys=[];let nonIndexedIndex=0,indexedIndex=0;fragment.inputs.forEach((param,index)=>{let value=null;if(param.indexed){if(resultIndexed==null){value=new Indexed(null)}else if(dynamic[index]){value=new Indexed(resultIndexed[indexedIndex++])}else{try{value=resultIndexed[indexedIndex++]}catch(error){value=error}}}else{try{value=resultNonIndexed[nonIndexedIndex++]}catch(error){value=error}}values.push(value);keys.push(param.name||null)});return Result.fromItems(values,keys)}parseTransaction(tx){const data=getBytes(tx.data,"tx.data");const value=getBigInt(tx.value!=null?tx.value:0,"tx.value");const fragment=this.getFunction(hexlify(data.slice(0,4)));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,data.slice(4));return new TransactionDescription(fragment,fragment.selector,args,value)}parseCallResult(data){throw new Error("@TODO")}parseLog(log){const fragment=this.getEvent(log.topics[0]);if(!fragment||fragment.anonymous){return null}return new LogDescription(fragment,fragment.topicHash,this.decodeEventLog(fragment,log.data,log.topics))}parseError(data){const hexData=hexlify(data);const fragment=this.getError(dataSlice(hexData,0,4));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,dataSlice(hexData,4));return new ErrorDescription(fragment,fragment.selector,args)}static from(value){if(value instanceof Interface){return value}if(typeof value==="string"){return new Interface(JSON.parse(value))}if(typeof value.format==="function"){return new Interface(value.format("json"))}return new Interface(value)}}const logger=new Logger("contract-address/0.0.1");function getCreateAddress(tx){const from=getAddress(tx.from);const nonce=getBigInt(tx.nonce,"tx.nonce");let nonceHex=nonce.toString(16);if(nonceHex==="0"){nonceHex="0x"}else if(nonceHex.length%2){nonceHex="0x0"+nonceHex}else{nonceHex="0x"+nonceHex}return getAddress(from)}function getCreate2Address(from,salt,initCodeHash){if(hexDataLength(salt)!==32){logger.throwArgumentError("salt must be 32 bytes","salt",salt)}if(hexDataLength(initCodeHash)!==32){logger.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",initCodeHash)}const val=hexDataSlice(sha256(concat(["0xff",getAddress(from),salt,initCodeHash])),12);console.log({"contract-address/74=>should be string":val});const prefix=from.substring(2,4);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function isAddressable(value){return value&&typeof value.getAddress==="function"}function isAddress(value){try{getAddress(value);return true}catch(error){}return false}async function checkAddress(target,promise){const result=await promise;if(result==null||result==="0x0000000000000000000000000000000000000000"){assert(typeof target!=="string","unconfigured name","UNCONFIGURED_NAME",{value:target});assertArgument(false,"invalid AddressLike value; did not resolve to a value address","target",target)}return getAddress(result)}function resolveAddress(target){if(typeof target==="string"){return getAddress(target)}else if(isAddressable(target)){return checkAddress(target,target.getAddress())}else if(target&&typeof target.then==="function"){return checkAddress(target,target)}assertArgument(false,"unsupported addressable value","target",target)}const BN_0$2=BigInt(0);function getValue(value){if(value==null){return null}return value}function toJson(value){if(value==null){return null}return value.toString()}class FeeData{energyPrice;constructor(energyPrice){defineProperties(this,{energyPrice:getValue(energyPrice)})}toJSON(){const{energyPrice}=this;return{_type:"FeeData",energyPrice:toJson(energyPrice)}}}function copyRequest(req){const result={};if(req.to){result.to=req.to}if(req.from){result.from=req.from}if(req.data){result.data=hexlify(req.data)}const bigIntKeys="networkId,energyLimit,energyPrice,value".split(/,/);for(const key of bigIntKeys){if(!(key in req)||req[key]==null){continue}result[key]=getBigInt(req[key],`request.${key}`)}const numberKeys="type,nonce".split(/,/);for(const key of numberKeys){if(!(key in req)||req[key]==null){continue}result[key]=getNumber(req[key],`request.${key}`)}if("blockTag"in req){result.blockTag=req.blockTag}if("enableCcipRead"in req){result.enableCcipReadEnabled=!!req.enableCcipRead}if("customData"in req){result.customData=req.customData}return result}class Block{provider;number;hash;timestamp;parentHash;nonce;difficulty;energyLimit;energyUsed;miner;extraData;baseFeePerEnergy;#transactions;constructor(block,provider){this.#transactions=block.transactions.map(tx=>{if(typeof tx!=="string"){return new TransactionResponse(tx,provider)}return tx});defineProperties(this,{provider:provider,hash:getValue(block.hash),number:block.number,timestamp:block.timestamp,parentHash:block.parentHash,nonce:block.nonce,difficulty:block.difficulty,energyLimit:block.energyLimit,energyUsed:block.energyUsed,miner:block.miner,extraData:block.extraData,baseFeePerEnergy:getValue(block.baseFeePerEnergy)})}get transactions(){return this.#transactions.map(tx=>{if(typeof tx==="string"){return tx}return tx.hash})}get prefetchedTransactions(){const txs=this.#transactions.slice();if(txs.length===0){return[]}assert(typeof txs[0]==="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"});return txs}toJSON(){const{baseFeePerEnergy,difficulty,extraData,energyLimit,energyUsed,hash,miner,nonce,number,parentHash,timestamp,transactions}=this;return{_type:"Block",baseFeePerEnergy:toJson(baseFeePerEnergy),difficulty:toJson(difficulty),extraData:extraData,energyLimit:toJson(energyLimit),energyUsed:toJson(energyUsed),hash:hash,miner:miner,nonce:nonce,number:number,parentHash:parentHash,timestamp:timestamp,transactions:transactions}}[Symbol.iterator](){let index=0;const txs=this.transactions;return{next:()=>{if(index{return new Log(log,provider)}));defineProperties(this,{provider:provider,to:tx.to,from:tx.from,contractAddress:tx.contractAddress,hash:tx.hash,index:tx.index,blockHash:tx.blockHash,blockNumber:tx.blockNumber,logsBloom:tx.logsBloom,energyUsed:tx.energyUsed,cumulativeEnergyUsed:tx.cumulativeEnergyUsed,energyPrice:tx.effectiveEnergyPrice||tx.energyPrice,status:tx.status,root:tx.root})}get logs(){return this.#logs}toJSON(){const{to,from,contractAddress,hash,index,blockHash,blockNumber,logsBloom,logs,status,root}=this;return{_type:"TransactionReceipt",blockHash:blockHash,blockNumber:blockNumber,contractAddress:contractAddress,cumulativeEnergyUsed:toJson(this.cumulativeEnergyUsed),from:from,energyPrice:toJson(this.energyPrice),energyUsed:toJson(this.energyUsed),hash:hash,index:index,logs:logs,logsBloom:logsBloom,root:root,status:status,to:to}}get length(){return this.logs.length}[Symbol.iterator](){let index=0;return{next:()=>{if(index{if(stopScanning){return null}const{blockNumber,nonce}=await resolveProperties({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(nonce=confirms){return receipt}}else{await checkReplacement();if(confirms===0){return null}}const waiter=new Promise((resolve,reject)=>{const cancellers=[];const cancel=()=>{cancellers.forEach(c=>c())};cancellers.push(()=>{stopScanning=true});if(timeout>0){const timer=setTimeout(()=>{cancel();reject(makeError("wait for transaction timeout","TIMEOUT"))},timeout);cancellers.push(()=>{clearTimeout(timer)})}const txListener=async receipt=>{if(await receipt.confirmations()>=confirms){cancel();resolve(receipt)}};cancellers.push(()=>{this.provider.off(this.hash,txListener)});this.provider.on(this.hash,txListener);if(startBlock>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(error){if(isError(error,"TRANSACTION_REPLACED")){cancel();reject(error);return}}if(!stopScanning){this.provider.once("block",replaceListener)}};cancellers.push(()=>{this.provider.off("block",replaceListener)});this.provider.once("block",replaceListener)}});return await waiter}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}removedEvent(){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createRemovedTransactionFilter(this)}reorderedEvent(other){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});assert(!other||other.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createReorderedTransactionFilter(this,other)}replaceableTransaction(startBlock){assertArgument(Number.isInteger(startBlock)&&startBlock>=0,"invalid startBlock","startBlock",startBlock);const tx=new TransactionResponse(this,this.provider);tx.#startBlock=startBlock;return tx}}function createOrphanedBlockFilter(block){return{orphan:"drop-block",hash:block.hash,number:block.number}}function createReorderedTransactionFilter(tx,other){return{orphan:"reorder-transaction",tx:tx,other:other}}function createRemovedTransactionFilter(tx){return{orphan:"drop-transaction",tx:tx}}function createRemovedLogFilter(log){return{orphan:"drop-log",log:{transactionHash:log.transactionHash,blockHash:log.blockHash,blockNumber:log.blockNumber,address:log.address,data:log.data,topics:Object.freeze(log.topics.slice()),index:log.index}}}class EventLog extends Log{interface;fragment;args;constructor(log,iface,fragment){super(log,log.provider);const args=iface.decodeEventLog(fragment,log.data,log.topics);defineProperties(this,{args:args,fragment:fragment,interface:iface})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class ContractTransactionReceipt extends TransactionReceipt{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}get logs(){return super.logs.map(log=>{const fragment=log.topics.length?this.#iface.getEvent(log.topics[0]):null;if(fragment){return new EventLog(log,this.#iface,fragment)}else{return log}})}}class ContractTransactionResponse extends TransactionResponse{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}async wait(confirms){const receipt=await super.wait();if(receipt==null){return null}return new ContractTransactionReceipt(this.#iface,this.provider,receipt)}}class ContractUnknownEventPayload extends EventPayload{log;constructor(contract,listener,filter,log){super(contract,listener,filter);defineProperties(this,{log:log})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class ContractEventPayload extends ContractUnknownEventPayload{constructor(contract,listener,filter,fragment,_log){super(contract,listener,filter,new EventLog(_log,contract.interface,fragment));const args=contract.interface.decodeEventLog(fragment,this.log.data,this.log.topics);defineProperties(this,{args:args,fragment:fragment})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const BN_0$1=BigInt(0);function canCall(value){return value&&typeof value.call==="function"}function canEstimate(value){return value&&typeof value.estimateEnergy==="function"}function canResolve(value){return value&&typeof value.resolveName==="function"}function canSend(value){return value&&typeof value.sendTransaction==="function"}class PreparedTopicFilter{#filter;fragment;constructor(contract,fragment,args){defineProperties(this,{fragment:fragment});if(fragment.inputs.length{const arg=args[index];if(arg==null){return null}return param.walkAsync(args[index],(type,value)=>{if(type==="address"){return resolveAddress(value)}return value})}));return contract.interface.encodeFilterTopics(fragment,resolvedArgs)}()}getTopicFilter(){return this.#filter}}function getRunner(value,feature){if(value==null){return null}if(typeof value[feature]==="function"){return value}if(value.provider&&typeof value.provider[feature]==="function"){return value.provider}return null}function getProvider(value){if(value==null){return null}return value.provider||null}async function copyOverrides(arg,allowed){const overrides=copyRequest(Typed.dereference(arg,"overrides"));assertArgument(overrides.to==null||(allowed||[]).indexOf("to")>=0,"cannot override to","overrides.to",overrides.to);assertArgument(overrides.data==null||(allowed||[]).indexOf("data")>=0,"cannot override data","overrides.data",overrides.data);if(overrides.from){overrides.from=await resolveAddress(overrides.from)}return overrides}async function resolveArgs(_runner,inputs,args){return await Promise.all(inputs.map((param,index)=>{return param.walkAsync(args[index],(type,value)=>{value=Typed.dereference(value,type);if(type==="address"){return resolveAddress(value)}return value})}))}function buildWrappedFallback(contract){const populateTransaction=async function(overrides){const tx=await copyOverrides(overrides,["data"]);tx.to=await contract.getAddress();const iface=contract.interface;const payable=iface.receive||iface.fallback&&iface.fallback.payable;assertArgument(payable||(tx.value||BN_0$1)===BN_0$1,"cannot send value to non-payable contract","overrides.value",tx.value);assertArgument(iface.fallback||(tx.data||"0x")==="0x","cannot send data to receive-only contract","overrides.data",tx.data);return tx};const staticCall=async function(overrides){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(overrides);try{return await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}};const send=async function(overrides){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(overrides));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(overrides){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(overrides))};const method=async overrides=>{return await send(overrides)};defineProperties(method,{_contract:contract,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall});return method}function buildWrappedMethod(contract,key){const getFragment=function(...args){const fragment=contract.interface.getFunction(key,args);assert(fragment,"no matching fragment in getFragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const populateTransaction=async function(...args){const fragment=getFragment(...args);let overrides={};if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("internal error: fragment inputs doesn't match arguments; should not happen")}const resolvedArgs=await resolveArgs(contract.runner,fragment.inputs,args);return Object.assign({},overrides,await resolveProperties({to:contract.getAddress(),data:contract.interface.encodeFunctionData(fragment,resolvedArgs)}))};const staticCall=async function(...args){const result=await staticCallResult(...args);if(result.length===1){return result[0]}return result};const send=async function(...args){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(...args));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(...args){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(...args))};const staticCallResult=async function(...args){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(...args);let result="0x";try{result=await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}const fragment=getFragment(...args);return contract.interface.decodeFunctionResult(fragment,result)};const method=async(...args)=>{const fragment=getFragment(...args);if(fragment.constant){return await staticCall(...args)}return await send(...args)};defineProperties(method,{name:contract.interface.getFunctionName(key),_contract:contract,_key:key,getFragment:getFragment,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getFunction(key);assert(fragment,"no matching fragment in defineProperty","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}function buildWrappedEvent(contract,key){const getFragment=function(...args){const fragment=contract.interface.getEvent(key,args);assert(fragment,"no matching fragment in","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const method=function(...args){return new PreparedTopicFilter(contract,getFragment(...args),args)};defineProperties(method,{name:contract.interface.getEventName(key),_contract:contract,_key:key,getFragment:getFragment});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getEvent(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}const internal=Symbol.for("_corebcInternal_contract");const internalValues=new WeakMap;function setInternal(contract,values){internalValues.set(contract[internal],values)}function getInternal(contract){return internalValues.get(contract[internal])}function isDeferred(value){return value&&typeof value==="object"&&"getTopicFilter"in value&&typeof value.getTopicFilter==="function"&&value.fragment}async function getSubInfo(contract,event){let topics;let fragment=null;if(Array.isArray(event)){const topicHashify=function(name){if(isHexString(name,32)){return name}const fragment=contract.interface.getEvent(name);assertArgument(fragment,"unknown fragment","name",name);return fragment.topicHash};topics=event.map(e=>{if(e==null){return null}if(Array.isArray(e)){return e.map(topicHashify)}return topicHashify(e)})}else if(event==="*"){topics=[null]}else if(typeof event==="string"){if(isHexString(event,32)){topics=[event]}else{fragment=contract.interface.getEvent(event);assertArgument(fragment,"unknown fragment","event",event);topics=[fragment.topicHash]}}else if(isDeferred(event)){topics=await event.getTopicFilter()}else if("fragment"in event){fragment=event.fragment;topics=[fragment.topicHash]}else{assertArgument(false,"unknown event name","event",event)}topics=topics.map(t=>{if(t==null){return null}if(Array.isArray(t)){const items=Array.from(new Set(t.map(t=>t.toLowerCase())).values());if(items.length===1){return items[0]}items.sort();return items}return t.toLowerCase()});const tag=topics.map(t=>{if(t==null){return"null"}if(Array.isArray(t)){return t.join("|")}return t}).join("&");return{fragment:fragment,tag:tag,topics:topics}}async function hasSub(contract,event){const{subs}=getInternal(contract);return subs.get((await getSubInfo(contract,event)).tag)||null}async function getSub(contract,operation,event){const provider=getProvider(contract.runner);assert(provider,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:operation});const{fragment,tag,topics}=await getSubInfo(contract,event);const{addr,subs}=getInternal(contract);let sub=subs.get(tag);if(!sub){const address=addr?addr:contract;const filter={address:address,topics:topics};const listener=log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=contract.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){const _foundFragment=foundFragment;const args=fragment?contract.interface.decodeEventLog(fragment,log.data,log.topics):[];emit(contract,event,args,listener=>{return new ContractEventPayload(contract,listener,event,_foundFragment,log)})}else{emit(contract,event,[],listener=>{return new ContractUnknownEventPayload(contract,listener,event,log)})}};let starting=[];const start=()=>{if(starting.length){return}starting.push(provider.on(filter,listener))};const stop=async()=>{if(starting.length==0){return}let started=starting;starting=[];await Promise.all(started);provider.off(filter,listener)};sub={tag:tag,listeners:[],start:start,stop:stop};subs.set(tag,sub)}return sub}let lastEmit=Promise.resolve();async function _emit(contract,event,args,payloadFunc){await lastEmit;const sub=await hasSub(contract,event);if(!sub){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const passArgs=Array.from(args);if(payloadFunc){passArgs.push(payloadFunc(once?null:listener))}try{listener.call(contract,...passArgs)}catch(error){}return!once});return count>0}async function emit(contract,event,args,payloadFunc){try{await lastEmit}catch(error){}const resultPromise=_emit(contract,event,args,payloadFunc);lastEmit=resultPromise;return await resultPromise}const passProperties=["then"];class BaseContract{target;interface;runner;filters;[internal];fallback;constructor(target,abi,runner,_deployTx){if(runner==null){runner=null}const iface=Interface.from(abi);defineProperties(this,{target:target,runner:runner,interface:iface});Object.defineProperty(this,internal,{value:{}});let addrPromise;let addr=null;let deployTx=null;if(_deployTx){const provider=getProvider(runner);deployTx=new ContractTransactionResponse(this.interface,provider,_deployTx)}let subs=new Map;if(typeof target==="string"){if(isHexString(target)){addr=target;addrPromise=Promise.resolve(target)}else{const resolver=getRunner(runner,"resolveName");if(!canResolve(resolver)){throw makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"})}addrPromise=resolver.resolveName(target).then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}}else{addrPromise=target.getAddress().then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}setInternal(this,{addrPromise:addrPromise,addr:addr,deployTx:deployTx,subs:subs});const filters=new Proxy({},{get:(target,_prop,receiver)=>{if(passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=this.getEvent(prop);if(result){return result}throw new Error(`unknown contract event: ${prop}`)},has:(target,prop)=>{if(passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return Reflect.has(target,prop)||this.interface.hasEvent(String(prop))}});defineProperties(this,{filters:filters});defineProperties(this,{fallback:iface.receive||iface.fallback?buildWrappedFallback(this):null});return new Proxy(this,{get:(target,_prop,receiver)=>{if(_prop in target||passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=target.getFunction(prop);if(result){return result}throw new Error(`unknown contract method: ${prop}`)},has:(target,prop)=>{if(prop in target||passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return target.interface.hasFunction(String(prop))}})}connect(runner){return new BaseContract(this.target,this.interface,runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const provider=getProvider(this.runner);assert(provider,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const code=await provider.getCode(await this.getAddress());if(code==="0x"){return null}return code}async waitForDeployment(){const deployTx=this.deploymentTransaction();if(deployTx){await deployTx.wait();return this}const code=await this.getDeployedCode();if(code!=null){return this}const provider=getProvider(this.runner);assert(provider!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"});return new Promise((resolve,reject)=>{const checkCode=async()=>{try{const code=await this.getDeployedCode();if(code!=null){return resolve(this)}provider.once("block",checkCode)}catch(error){reject(error)}};checkCode()})}deploymentTransaction(){return getInternal(this).deployTx}getFunction(key){if(typeof key!=="string"){key=key.format()}const func=buildWrappedMethod(this,key);return func}getEvent(key){if(typeof key!=="string"){key=key.format()}return buildWrappedEvent(this,key)}async queryTransaction(hash){throw new Error("@TODO")}async queryFilter(event,fromBlock,toBlock){if(fromBlock==null){fromBlock=0}if(toBlock==null){toBlock="latest"}const{addr,addrPromise}=getInternal(this);const address=addr?addr:await addrPromise;const{fragment,topics}=await getSubInfo(this,event);const filter={address:address,topics:topics,fromBlock:fromBlock,toBlock:toBlock};const provider=getProvider(this.runner);assert(provider,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"});return(await provider.getLogs(filter)).map(log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=this.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){return new EventLog(log,this.interface,foundFragment)}else{return new Log(log,provider)}})}async on(event,listener){const sub=await getSub(this,"on",event);sub.listeners.push({listener:listener,once:false});sub.start();return this}async once(event,listener){const sub=await getSub(this,"once",event);sub.listeners.push({listener:listener,once:true});sub.start();return this}async emit(event,...args){return await emit(this,event,args,null)}async listenerCount(event){if(event){const sub=await hasSub(this,event);if(!sub){return 0}return sub.listeners.length}const{subs}=getInternal(this);let total=0;for(const{listeners}of subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}const{subs}=getInternal(this);let result=[];for(const{listeners}of subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await hasSub(this,event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(listener==null||sub.listeners.length===0){sub.stop();getInternal(this).subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return this}sub.stop();getInternal(this).subs.delete(sub.tag)}else{const{subs}=getInternal(this);for(const{tag,stop}of subs.values()){stop();subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return await this.off(event,listener)}static buildClass(abi){class CustomContract extends BaseContract{constructor(address,runner=null){super(address,abi,runner)}}return CustomContract}static from(target,abi,runner){if(runner==null){runner=null}const contract=new this(target,abi,runner);return contract}static isIndexed(value){return Indexed.isIndexed(value)}}function _ContractBase(){return BaseContract}class Contract extends _ContractBase(){}class ContractFactory{interface;bytecode;runner;constructor(abi,bytecode,runner){const iface=Interface.from(abi);if(bytecode instanceof Uint8Array){bytecode=hexlify(getBytes(bytecode))}else if(typeof bytecode==="string"){bytecode=bytecode}else if(isBytes(bytecode)){bytecode=hexlify(bytecode)}else if(bytecode&&typeof bytecode.object==="string"){bytecode=bytecode.object}else{bytecode="!"}defineProperties(this,{bytecode:bytecode,interface:iface,runner:runner||null})}async getDeployTransaction(...args){let overrides={};const fragment=this.interface.deploy;if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("incorrect number of arguments to constructor")}const resolvedArgs=await resolveArgs(this.runner,fragment.inputs,args);const data=concat([this.bytecode,this.interface.encodeDeploy(resolvedArgs)]);return Object.assign({},overrides,{data:data})}async deploy(...args){const tx=await this.getDeployTransaction(...args);assert(this.runner&&typeof this.runner.sendTransaction==="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const sentTx=await this.runner.sendTransaction(tx);const address=getCreateAddress(sentTx);return new BaseContract(address,this.interface,this.runner,sentTx)}connect(runner){return new ContractFactory(this.interface,this.bytecode,runner)}static fromSolidity(output,runner){assertArgument(output!=null,"bad compiler output","output",output);if(typeof output==="string"){output=JSON.parse(output)}const abi=output.abi;let bytecode="";if(output.bytecode){bytecode=output.bytecode}else if(output.evm&&output.evm.bytecode){bytecode=output.evm.bytecode}return new this(abi,bytecode,runner)}}const BN_0=BigInt(0);function allowNull(format,nullValue){return function(value){if(value==null){return nullValue}return format(value)}}function arrayOf(format){return array=>{if(!Array.isArray(array)){throw new Error("not an array")}return array.map(i=>format(i))}}function object(format,altNames){return value=>{const result={};for(const key in format){let srcKey=key;if(altNames&&key in altNames&&!(srcKey in value)){for(const altKey of altNames[key]){if(altKey in value){srcKey=altKey;break}}}try{const nv=format[key](value[srcKey]);if(nv!==undefined){result[key]=nv}}catch(error){const message=error instanceof Error?error.message:"not-an-error";assert(false,`invalid value for value.${key} (${message})`,"BAD_DATA",{value:value})}}return result}}function formatBoolean(value){switch(value){case true:case"true":return true;case false:case"false":return false}assertArgument(false,`invalid boolean; ${JSON.stringify(value)}`,"value",value)}function formatData(value){assertArgument(isHexString(value,true),"invalid data","value",value);return value}function formatHash(value){assertArgument(isHexString(value,32),"invalid hash","value",value);return value}const _formatLog=object({address:getAddress,blockHash:formatHash,blockNumber:getNumber,data:formatData,index:getNumber,removed:allowNull(formatBoolean,false),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:getNumber},{index:["logIndex"]});function formatLog(value){return _formatLog(value)}const _formatBlock=object({hash:allowNull(formatHash),parentHash:formatHash,number:getNumber,timestamp:getNumber,nonce:allowNull(formatData),difficulty:getBigInt,energyLimit:getBigInt,energyUsed:getBigInt,miner:allowNull(getAddress),extraData:formatData,baseFeePerEnergy:allowNull(getBigInt)});function formatBlock(value){const result=_formatBlock(value);result.transactions=value.transactions.map(tx=>{if(typeof tx==="string"){return tx}return formatTransactionResponse(tx)});return result}const _formatReceiptLog=object({transactionIndex:getNumber,blockNumber:getNumber,transactionHash:formatHash,address:getAddress,topics:arrayOf(formatHash),data:formatData,index:getNumber,blockHash:formatHash},{index:["logIndex"]});function formatReceiptLog(value){return _formatReceiptLog(value)}const _formatTransactionReceipt=object({to:allowNull(getAddress,null),from:allowNull(getAddress,null),contractAddress:allowNull(getAddress,null),index:getNumber,root:allowNull(hexlify),energyUsed:getBigInt,logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf(formatReceiptLog),blockNumber:getNumber,cumulativeEnergyUsed:getBigInt,effectiveEnergyPrice:allowNull(getBigInt),status:allowNull(getNumber),type:allowNull(getNumber,0)},{effectiveEnergyPrice:["energyPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionReceipt(value){return _formatTransactionReceipt(value)}function formatTransactionResponse(value){if(value.to&&!getAddress(value.to)&&getBigInt(value.to)===BN_0){value.to="0x0000000000000000000000000000000000000000"}const result=object({hash:formatHash,type:value=>{if(value==="0x"||value==null){return 0}return getNumber(value)},accessList:allowNull(accessListify,null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(getNumber,null),transactionIndex:allowNull(getNumber,null),from:getAddress,maxFeePerEnergy:allowNull(getBigInt),energyLimit:getBigInt,to:allowNull(getAddress,null),value:getBigInt,nonce:getNumber,data:formatData,creates:allowNull(getAddress,null),networkId:allowNull(getBigInt,null)},{data:["input"],energyLimit:["energy"]})(value);if(result.to==null&&result.creates==null){result.creates=getCreateAddress(result)}if(value.signature){result.signature=value.signature}else{result.signature=value}if(result.networkId==null){const networkId=result.signature.legacynetworkId;if(networkId!=null){result.networkId=networkId}}if(result.blockHash&&getBigInt(result.blockHash)===BN_0){result.blockHash=null}return result}class NetworkPlugin{name;constructor(name){defineProperties(this,{name:name})}clone(){return new NetworkPlugin(this.name)}}class EnergyCostPlugin extends NetworkPlugin{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(effectiveBlock,costs){if(effectiveBlock==null){effectiveBlock=0}super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock||0}`);const props={effectiveBlock:effectiveBlock};function set(name,nullish){let value=(costs||{})[name];if(value==null){value=nullish}assertArgument(typeof value==="number",`invalud value for ${name}`,"costs",costs);props[name]=value}set("txBase",21e3);set("txCreate",32e3);set("txDataZero",4);set("txDataNonzero",16);set("txAccessListStorageKey",1900);set("txAccessListAddress",2400);defineProperties(this,props)}clone(){return new EnergyCostPlugin(this.effectiveBlock,this)}}class FeeDataNetworkPlugin extends NetworkPlugin{#feeDataFunc;get feeDataFunc(){return this.#feeDataFunc}constructor(feeDataFunc){super("org.corebc.plugins.network.FeeData");this.#feeDataFunc=feeDataFunc}async getFeeData(provider){return await this.#feeDataFunc(provider)}clone(){return new FeeDataNetworkPlugin(this.#feeDataFunc)}}const Networks=new Map;class Network{#name;#networkId;#plugins;constructor(name,networkId){this.#name=name;this.#networkId=getBigInt(networkId);this.#plugins=new Map}toJSON(){return{name:this.name,networkId:String(this.networkId)}}get name(){return this.#name}set name(value){this.#name=value}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value,"networkId")}matches(other){if(other==null){return false}if(typeof other==="string"){try{return this.networkId===getBigInt(other)}catch(error){}return this.name===other}if(typeof other==="number"||typeof other==="bigint"){try{return this.networkId===getBigInt(other)}catch(error){}return false}if(typeof other==="object"){if(other.networkId!=null){try{return this.networkId===getBigInt(other.networkId)}catch(error){}return false}if(other.name!=null){return this.name===other.name}return false}return false}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.clone());return this}getPlugin(name){return this.#plugins.get(name)||null}getPlugins(basename){return this.plugins.filter(p=>p.name.split("#")[0]===basename)}clone(){const clone=new Network(this.name,this.networkId);this.plugins.forEach(plugin=>{clone.attachPlugin(plugin.clone())});return clone}computeIntrinsicEnergy(tx){const costs=this.getPlugin("org.corebc.plugins.network.EnergyCost")||new EnergyCostPlugin;let energy=costs.txBase;if(tx.to==null){energy+=costs.txCreate}if(tx.data){for(let i=2;i{Network.register(name,func)})}}registerEth("mainnet",1,{ensNetwork:1,altNames:["homestead"]});registerEth("ropsten",3,{ensNetwork:3});registerEth("rinkeby",4,{ensNetwork:4});registerEth("goerli",5,{ensNetwork:5});registerEth("kovan",42,{ensNetwork:42});registerEth("sepolia",11155111,{});registerEth("classic",61,{});registerEth("classicKotti",6,{});registerEth("xdai",100,{ensNetwork:1})}function copy$2(obj){return JSON.parse(JSON.stringify(obj))}class PollingBlockSubscriber{#provider;#poller;#interval;#blockNumber;constructor(provider){this.#provider=provider;this.#poller=null;this.#interval=4e3;this.#blockNumber=-2}get pollingInterval(){return this.#interval}set pollingInterval(value){this.#interval=value}async#poll(){try{const blockNumber=await this.#provider.getBlockNumber();if(this.#blockNumber===-2){this.#blockNumber=blockNumber;return}if(blockNumber!==this.#blockNumber){for(let b=this.#blockNumber+1;b<=blockNumber;b++){if(this.#poller==null){return}await this.#provider.emit("block",b)}this.#blockNumber=blockNumber}}catch(error){}if(this.#poller==null){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval)}start(){if(this.#poller){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval);this.#poll()}stop(){if(!this.#poller){return}this.#provider._clearTimeout(this.#poller);this.#poller=null}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}class OnBlockSubscriber{#provider;#poll;#running;constructor(provider){this.#provider=provider;this.#running=false;this.#poll=blockNumber=>{this._poll(blockNumber,this.#provider)}}async _poll(blockNumber,provider){throw new Error("sub-classes must override this")}start(){if(this.#running){return}this.#running=true;this.#poll(-2);this.#provider.on("block",this.#poll)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poll)}pause(dropWhilePaused){this.stop()}resume(){this.start()}}class PollingOrphanSubscriber extends OnBlockSubscriber{#filter;constructor(provider,filter){super(provider);this.#filter=copy$2(filter)}async _poll(blockNumber,provider){throw new Error("@TODO")}}class PollingTransactionSubscriber extends OnBlockSubscriber{#hash;constructor(provider,hash){super(provider);this.#hash=hash}async _poll(blockNumber,provider){const tx=await provider.getTransactionReceipt(this.#hash);if(tx){provider.emit(this.#hash,tx)}}}class PollingEventSubscriber{#provider;#filter;#poller;#running;#blockNumber;constructor(provider,filter){this.#provider=provider;this.#filter=copy$2(filter);this.#poller=this.#poll.bind(this);this.#running=false;this.#blockNumber=-2}async#poll(blockNumber){if(this.#blockNumber===-2){return}const filter=copy$2(this.#filter);filter.fromBlock=this.#blockNumber+1;filter.toBlock=blockNumber;const logs=await this.#provider.getLogs(filter);if(logs.length===0){if(this.#blockNumber{this.#blockNumber=blockNumber})}this.#provider.on("block",this.#poller)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poller)}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}const MAX_CCIP_REDIRECTS=10;function isPromise(value){return value&&typeof value.then==="function"}function getTag(prefix,value){return prefix+":"+JSON.stringify(value,(k,v)=>{if(v==null){return"null"}if(typeof v==="bigint"){return`bigint:${v.toString()}`}if(typeof v==="string"){return v.toLowerCase()}if(typeof v==="object"&&!Array.isArray(v)){const keys=Object.keys(v);keys.sort();return keys.reduce((accum,key)=>{accum[key]=v[key];return accum},{})}return v})}class UnmanagedSubscriber{name;constructor(name){defineProperties(this,{name:name})}start(){}stop(){}pause(dropWhilePaused){}resume(){}}function copy$1(value){return JSON.parse(JSON.stringify(value))}function concisify(items){items=Array.from(new Set(items).values());items.sort();return items}async function getSubscription(_event,provider){if(_event==null){throw new Error("invalid event")}if(Array.isArray(_event)){_event={topics:_event}}if(typeof _event==="string"){switch(_event){case"block":case"pending":case"debug":case"error":case"network":{return{type:_event,tag:_event}}}}if(isHexString(_event,32)){const hash=_event.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:hash}),hash:hash}}if(_event.orphan){const event=_event;return{type:"orphan",tag:getTag("orphan",event),filter:copy$1(event)}}if(_event.address||_event.topics){const event=_event;const filter={topics:(event.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()})};if(event.address){const addresses=[];const promises=[];const addAddress=addr=>{if(isHexString(addr)){addresses.push(addr)}else{promises.push((async()=>{addresses.push(await resolveAddress(addr))})())}};if(Array.isArray(event.address)){event.address.forEach(addAddress)}else{addAddress(event.address)}if(promises.length){await Promise.all(promises)}filter.address=concisify(addresses.map(a=>a.toLowerCase()))}return{filter:filter,tag:getTag("event",filter),type:"event"}}assertArgument(false,"unknown ProviderEvent","event",_event)}function getTime$1(){return(new Date).getTime()}class AbstractProvider{#subs;#plugins;#pausedState;#networkPromise;#anyNetwork;#performCache;#lastBlockNumber;#nextTimer;#timers;#disableCcipRead;constructor(_network){if(_network==="any"){this.#anyNetwork=true;this.#networkPromise=null}else if(_network){const network=Network.from(_network);this.#anyNetwork=false;this.#networkPromise=Promise.resolve(network);setTimeout(()=>{this.emit("network",network,null)},0)}else{this.#anyNetwork=false;this.#networkPromise=null}this.#lastBlockNumber=-1;this.#performCache=new Map;this.#subs=new Map;this.#plugins=new Map;this.#pausedState=null;this.#nextTimer=1;this.#timers=new Map;this.#disableCcipRead=false}get provider(){return this}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.connect(this));return this}getPlugin(name){return this.#plugins.get(name)||null}get disableCcipRead(){return this.#disableCcipRead}set disableCcipRead(value){this.#disableCcipRead=!!value}async#perform(req){const tag=getTag(req.method,req);let perform=this.#performCache.get(tag);if(!perform){perform=this._perform(req);this.#performCache.set(tag,perform);setTimeout(()=>{if(this.#performCache.get(tag)===perform){this.#performCache.delete(tag)}},250)}return await perform}async ccipReadFetch(tx,calldata,urls){if(this.disableCcipRead||urls.length===0||tx.to==null){return null}const sender=tx.to.toLowerCase();const data=calldata.toLowerCase();const errorMessages=[];for(let i=0;i=500,`response not found during CCIP fetch: ${errorMessage}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:tx,info:{url:url,errorMessage:errorMessage}});errorMessages.push(errorMessage)}assert(false,`error encountered during CCIP fetch: ${errorMessages.map(m=>JSON.stringify(m)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:tx,info:{urls:urls,errorMessages:errorMessages}})}_wrapBlock(value,network){return new Block(formatBlock(value),this)}_wrapLog(value,network){return new Log(formatLog(value),this)}_wrapTransactionReceipt(value,network){return new TransactionReceipt(formatTransactionReceipt(value),this)}_wrapTransactionResponse(tx,network){return new TransactionResponse(formatTransactionResponse(tx),this)}_detectNetwork(){assert(false,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(req){assert(false,`unsupported method: ${req.method}`,"UNSUPPORTED_OPERATION",{operation:req.method,info:req})}async getBlockNumber(){const blockNumber=getNumber(await this.#perform({method:"getBlockNumber"}),"%response");if(this.#lastBlockNumber>=0){this.#lastBlockNumber=blockNumber}return blockNumber}_getAddress(address){return resolveAddress(address)}_getBlockTag(blockTag){if(blockTag==null){return"latest"}switch(blockTag){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return blockTag}if(isHexString(blockTag)){if(isHexString(blockTag,32)){return blockTag}return toQuantity(blockTag)}if(typeof blockTag==="bigint"){blockTag=getNumber(blockTag,"blockTag")}if(typeof blockTag==="number"){if(blockTag>=0){return toQuantity(blockTag)}if(this.#lastBlockNumber>=0){return toQuantity(this.#lastBlockNumber+blockTag)}return this.getBlockNumber().then(b=>toQuantity(b+blockTag))}assertArgument(false,"invalid blockTag","blockTag",blockTag)}_getFilter(filter){const topics=(filter.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()});const blockHash="blockHash"in filter?filter.blockHash:undefined;const resolve=(_address,fromBlock,toBlock)=>{let address=undefined;switch(_address.length){case 0:break;case 1:address=_address[0];break;default:_address.sort();address=_address}if(blockHash){if(fromBlock!=null||toBlock!=null){throw new Error("invalid filter")}}const filter={};if(address){filter.address=address}if(topics.length){filter.topics=topics}if(fromBlock){filter.fromBlock=fromBlock}if(toBlock){filter.toBlock=toBlock}if(blockHash){filter.blockHash=blockHash}return filter};let address=[];if(filter.address){if(Array.isArray(filter.address)){for(const addr of filter.address){address.push(this._getAddress(addr))}}else{address.push(this._getAddress(filter.address))}}let fromBlock=undefined;if("fromBlock"in filter){fromBlock=this._getBlockTag(filter.fromBlock)}let toBlock=undefined;if("toBlock"in filter){toBlock=this._getBlockTag(filter.toBlock)}if(address.filter(a=>typeof a!=="string").length||fromBlock!=null&&typeof fromBlock!=="string"||toBlock!=null&&typeof toBlock!=="string"){return Promise.all([Promise.all(address),fromBlock,toBlock]).then(result=>{return resolve(result[0],result[1],result[2])})}return resolve(address,fromBlock,toBlock)}_getTransactionRequest(_request){const request=copyRequest(_request);const promises=[];["to","from"].forEach(key=>{if(request[key]==null){return}const addr=resolveAddress(request[key]);if(isPromise(addr)){promises.push(async function(){request[key]=await addr}())}else{request[key]=addr}});if(request.blockTag!=null){const blockTag=this._getBlockTag(request.blockTag);if(isPromise(blockTag)){promises.push(async function(){request.blockTag=await blockTag}())}else{request.blockTag=blockTag}}if(promises.length){return async function(){await Promise.all(promises);return request}()}return request}async getNetwork(){if(this.#networkPromise==null){const detectNetwork=this._detectNetwork().then(network=>{this.emit("network",network,null);return network},error=>{if(this.#networkPromise===detectNetwork){this.#networkPromise=null}throw error});this.#networkPromise=detectNetwork;return(await detectNetwork).clone()}const networkPromise=this.#networkPromise;const[expected,actual]=await Promise.all([networkPromise,this._detectNetwork()]);if(expected.networkId!==actual.networkId){if(this.#anyNetwork){this.emit("network",actual,expected);if(this.#networkPromise===networkPromise){this.#networkPromise=Promise.resolve(actual)}}else{assert(false,`network changed: ${expected.networkId} => ${actual.networkId} `,"NETWORK_ERROR",{event:"changed"})}}return expected.clone()}async getEnergyPrice(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async getFeeData(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async estimateEnergy(_tx){let tx=this._getTransactionRequest(_tx);if(isPromise(tx)){tx=await tx}return getBigInt(await this.#perform({method:"estimateEnergy",transaction:tx}),"%response")}async#call(tx,blockTag,attempt){assert(attempt=0&&blockTag==="latest"&&transaction.to!=null&&dataSlice(error.data,0,4)==="0x556f1830"){const data=error.data;const txSender=await resolveAddress(transaction.to);let ccipArgs;try{ccipArgs=parseOffchainLookup(dataSlice(error.data,4))}catch(error){assert(false,error.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:transaction,info:{data:data}})}assert(ccipArgs.sender.toLowerCase()===txSender.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:data,reason:"OffchainLookup",transaction:transaction,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ccipArgs.errorArgs}});const ccipResult=await this.ccipReadFetch(transaction,ccipArgs.calldata,ccipArgs.urls);assert(ccipResult!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:transaction,info:{data:error.data,errorArgs:ccipArgs.errorArgs}});const tx={to:txSender,data:concat([ccipArgs.selector,encodeBytes([ccipResult,ccipArgs.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:tx});try{const result=await this.#call(tx,blockTag,attempt+1);this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},tx),result:result});return result}catch(error){this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},tx),error:error});throw error}}throw error}}async#checkNetwork(promise){const{value}=await resolveProperties({network:this.getNetwork(),value:promise});return value}async call(_tx){const{tx,blockTag}=await resolveProperties({tx:this._getTransactionRequest(_tx),blockTag:this._getBlockTag(_tx.blockTag)});return await this.#checkNetwork(this.#call(tx,blockTag,_tx.enableCcipRead?0:-1))}async#getAccountValue(request,_address,_blockTag){let address=this._getAddress(_address);let blockTag=this._getBlockTag(_blockTag);if(typeof address!=="string"||typeof blockTag!=="string"){[address,blockTag]=await Promise.all([address,blockTag])}return await this.#checkNetwork(this.#perform(Object.assign(request,{address:address,blockTag:blockTag})))}async getBalance(address,blockTag){return getBigInt(await this.#getAccountValue({method:"getBalance"},address,blockTag),"%response")}async getTransactionCount(address,blockTag){return getNumber(await this.#getAccountValue({method:"getTransactionCount"},address,blockTag),"%response")}async getCode(address,blockTag){return hexlify(await this.#getAccountValue({method:"getCode"},address,blockTag))}async getStorage(address,_position,blockTag){const position=getBigInt(_position,"position");return hexlify(await this.#getAccountValue({method:"getStorage",position:position},address,blockTag))}async broadcastTransaction(signedTx){const{blockNumber,hash,network}=await resolveProperties({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:signedTx}),network:this.getNetwork()});const tx=Transaction.from(signedTx);if(tx.hash!==hash){throw new Error("@TODO: the returned hash did not match")}return this._wrapTransactionResponse(tx,network).replaceableTransaction(blockNumber)}async#getBlock(block,includeTransactions){if(isHexString(block,32)){return await this.#perform({method:"getBlock",blockHash:block,includeTransactions:includeTransactions})}let blockTag=this._getBlockTag(block);if(typeof blockTag!=="string"){blockTag=await blockTag}return await this.#perform({method:"getBlock",blockTag:blockTag,includeTransactions:includeTransactions})}async getBlock(block,prefetchTxs){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#getBlock(block,!!prefetchTxs)});if(params==null){return null}return this._wrapBlock(params,network)}async getTransaction(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransaction",hash:hash})});if(params==null){return null}return this._wrapTransactionResponse(params,network)}async getTransactionReceipt(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransactionReceipt",hash:hash})});if(params==null){return null}if(params.energyPrice==null&¶ms.effectiveEnergyPrice==null){const tx=await this.#perform({method:"getTransaction",hash:hash});if(tx==null){throw new Error("report this; could not find tx or effectiveEnergyPrice")}params.effectiveEnergyPrice=tx.energyPrice}return this._wrapTransactionReceipt(params,network)}async getTransactionResult(hash){const{result}=await resolveProperties({network:this.getNetwork(),result:this.#perform({method:"getTransactionResult",hash:hash})});if(result==null){return null}return hexlify(result)}async getLogs(_filter){let filter=this._getFilter(_filter);if(isPromise(filter)){filter=await filter}const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getLogs",filter:filter})});return params.map(p=>this._wrapLog(p,network))}_getProvider(networkId){assert(false,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async waitForTransaction(hash,_confirms,timeout){const confirms=_confirms!=null?_confirms:1;if(confirms===0){return this.getTransactionReceipt(hash)}return new Promise(async(resolve,reject)=>{let timer=null;const listener=async blockNumber=>{try{const receipt=await this.getTransactionReceipt(hash);if(receipt!=null){if(blockNumber-receipt.blockNumber+1>=confirms){resolve(receipt);if(timer){clearTimeout(timer);timer=null}return}}}catch(error){console.log("EEE",error)}this.once("block",listener)};if(timeout!=null){timer=setTimeout(()=>{if(timer==null){return}timer=null;this.off("block",listener);reject(makeError("timeout","TIMEOUT",{reason:"timeout"}))},timeout)}listener(await this.getBlockNumber())})}async waitForBlock(blockTag){assert(false,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(timerId){const timer=this.#timers.get(timerId);if(!timer){return}if(timer.timer){clearTimeout(timer.timer)}this.#timers.delete(timerId)}_setTimeout(_func,timeout){if(timeout==null){timeout=0}const timerId=this.#nextTimer++;const func=()=>{this.#timers.delete(timerId);_func()};if(this.paused){this.#timers.set(timerId,{timer:null,func:func,time:timeout})}else{const timer=setTimeout(func,timeout);this.#timers.set(timerId,{timer:timer,func:func,time:getTime$1()})}return timerId}_forEachSubscriber(func){for(const sub of this.#subs.values()){func(sub.subscriber)}}_getSubscriber(sub){switch(sub.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(sub.type);case"block":return new PollingBlockSubscriber(this);case"event":return new PollingEventSubscriber(this,sub.filter);case"transaction":return new PollingTransactionSubscriber(this,sub.hash);case"orphan":return new PollingOrphanSubscriber(this,sub.filter)}throw new Error(`unsupported event: ${sub.type}`)}_recoverSubscriber(oldSub,newSub){for(const sub of this.#subs.values()){if(sub.subscriber===oldSub){if(sub.started){sub.subscriber.stop()}sub.subscriber=newSub;if(sub.started){newSub.start()}if(this.#pausedState!=null){newSub.pause(this.#pausedState)}break}}}async#hasSub(event,emitArgs){let sub=await getSubscription(event);if(sub.type==="event"&&emitArgs&&emitArgs.length>0&&emitArgs[0].removed===true){sub=await getSubscription({orphan:"drop-log",log:emitArgs[0]})}return this.#subs.get(sub.tag)||null}async#getSub(event){const subscription=await getSubscription(event);const tag=subscription.tag;let sub=this.#subs.get(tag);if(!sub){const subscriber=this._getSubscriber(subscription);const addressableMap=new WeakMap;const nameMap=new Map;sub={subscriber:subscriber,tag:tag,addressableMap:addressableMap,nameMap:nameMap,started:false,listeners:[]};this.#subs.set(tag,sub)}return sub}async on(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:false});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async once(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:true});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async emit(event,...args){const sub=await this.#hasSub(event,args);if(!sub||sub.listeners.length===0){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const payload=new EventPayload(this,once?null:listener,event);try{listener.call(this,...args,payload)}catch(error){}return!once});if(sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return count>0}async listenerCount(event){if(event){const sub=await this.#hasSub(event);if(!sub){return 0}return sub.listeners.length}let total=0;for(const{listeners}of this.#subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await this.#hasSub(event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}let result=[];for(const{listeners}of this.#subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await this.#hasSub(event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(!listener||sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const{tag,started,subscriber}=await this.#getSub(event);if(started){subscriber.stop()}this.#subs.delete(tag)}else{for(const[tag,{started,subscriber}]of this.#subs){if(started){subscriber.stop()}this.#subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return this.off(event,listener)}destroy(){this.removeAllListeners();for(const timerId of this.#timers.keys()){this._clearTimeout(timerId)}}get paused(){return this.#pausedState!=null}set paused(pause){if(!!pause===this.paused){return}if(this.paused){this.resume()}else{this.pause(false)}}pause(dropWhilePaused){this.#lastBlockNumber=-1;if(this.#pausedState!=null){if(this.#pausedState==!!dropWhilePaused){return}assert(false,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(s=>s.pause(dropWhilePaused));this.#pausedState=!!dropWhilePaused;for(const timer of this.#timers.values()){if(timer.timer){clearTimeout(timer.timer)}timer.time=getTime$1()-timer.time}}resume(){if(this.#pausedState==null){return}this._forEachSubscriber(s=>s.resume());this.#pausedState=null;for(const timer of this.#timers.values()){let timeout=timer.time;if(timeout<0){timeout=0}timer.time=getTime$1();setTimeout(timer.func,timeout)}}}function _parseString(result,start){try{const bytes=_parseBytes(result,start);if(bytes){return toUtf8String(bytes)}}catch(error){}return null}function _parseBytes(result,start){if(result==="0x"){return null}try{const offset=getNumber(dataSlice(result,start,start+32));const length=getNumber(dataSlice(result,offset,offset+32));return dataSlice(result,offset+32,offset+32+length)}catch(error){}return null}function numPad(value){const result=toBeArray(value);if(result.length>32){throw new Error("internal; should not happen")}const padded=new Uint8Array(32);padded.set(result,32-result.length);return padded}function bytesPad(value){if(value.length%32===0){return value}const result=new Uint8Array(Math.ceil(value.length/32)*32);result.set(value);return result}const empty=new Uint8Array([]);function encodeBytes(datas){const result=[];let byteCount=0;for(let i=0;i=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const sender=dataSlice(data,0,32);assert(dataSlice(sender,0,12)===dataSlice(zeros,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"});result.sender=dataSlice(sender,12);try{const urls=[];const urlsOffset=getNumber(dataSlice(data,32,64));const urlsLength=getNumber(dataSlice(data,urlsOffset,urlsOffset+32));const urlsData=dataSlice(data,urlsOffset+32);for(let u=0;uresult[k]);return result}function checkProvider(signer,operation){if(signer.provider){return signer.provider}assert(false,"missing provider","UNSUPPORTED_OPERATION",{operation:operation})}async function populate(signer,tx){let pop=copyRequest(tx);if(pop.to!=null){pop.to=resolveAddress(pop.to)}if(pop.from!=null){const from=pop.from;pop.from=Promise.all([signer.getAddress(),resolveAddress(from)]).then(([address,from])=>{assertArgument(address.toLowerCase()===from.toLowerCase(),"transaction from mismatch","tx.from",from);return address})}else{pop.from=signer.getAddress()}return await resolveProperties(pop)}class AbstractSigner{provider;constructor(provider){defineProperties(this,{provider:provider||null})}async getNonce(blockTag){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),blockTag)}async populateCall(tx){const pop=await populate(this,tx);return pop}async populateTransaction(tx){const provider=checkProvider(this,"populateTransaction");const pop=await populate(this,tx);if(pop.nonce==null){pop.nonce=await this.getNonce("pending")}if(pop.energyLimit==null){pop.energyLimit=await this.estimateEnergy(pop)}const network=await this.provider.getNetwork();if(pop.networkId!=null){const networkId=getBigInt(pop.networkId);assertArgument(networkId===network.networkId,"transaction networkId mismatch","tx.networkId",tx.networkId)}else{pop.networkId=network.networkId}const feeData=await provider.getFeeData();if(feeData.energyPrice!=null){if(pop.energyPrice==null){pop.energyPrice=feeData.energyPrice}}else{assert(false,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"})}return await resolveProperties(pop)}async estimateEnergy(tx){return checkProvider(this,"estimateEnergy").estimateEnergy(await this.populateCall(tx))}async call(tx){return checkProvider(this,"call").call(await this.populateCall(tx))}async resolveName(name){return getAddress(name)}async sendTransaction(tx){const provider=checkProvider(this,"sendTransaction");const pop=await this.populateTransaction(tx);delete pop.from;const txObj=Transaction.from(pop);return await provider.broadcastTransaction(await this.signTransaction(txObj))}}class VoidSigner extends AbstractSigner{address;constructor(address,provider){super(provider);defineProperties(this,{address:address})}async getAddress(){return this.address}connect(provider){return new VoidSigner(this.address,provider)}#throwUnsupported(suffix,operation){assert(false,`VoidSigner cannot sign ${suffix}`,"UNSUPPORTED_OPERATION",{operation:operation})}async signTransaction(tx){this.#throwUnsupported("transactions","signTransaction")}async signMessage(message){this.#throwUnsupported("messages","signMessage")}async signTypedData(domain,types,value){this.#throwUnsupported("typed-data","signTypedData")}}const shown=new Set;function showThrottleMessage(service){if(shown.has(service)){return}shown.add(service);console.log("========= NOTICE =========");console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);console.log("");console.log("The default API keys for each service are provided as a highly-throttled,");console.log("community resource for low-traffic projects and early prototyping.");console.log("");console.log("While your application will continue to function, we highly recommended");console.log("signing up for your own API keys to improve performance, increase your");console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");console.log("")}function copy(obj){return JSON.parse(JSON.stringify(obj))}class FilterIdSubscriber{#provider;#filterIdPromise;#poller;#running;#network;#hault;constructor(provider){this.#provider=provider;this.#filterIdPromise=null;this.#poller=this.#poll.bind(this);this.#running=false;this.#network=null;this.#hault=false}_subscribe(provider){throw new Error("subclasses must override this")}_emitResults(provider,result){throw new Error("subclasses must override this")}_recover(provider){throw new Error("subclasses must override this")}async#poll(blockNumber){try{if(this.#filterIdPromise==null){this.#filterIdPromise=this._subscribe(this.#provider)}let filterId=null;try{filterId=await this.#filterIdPromise}catch(error){if(!isError(error,"UNSUPPORTED_OPERATION")||error.operation!=="xcb_newFilter"){throw error}}if(filterId==null){this.#filterIdPromise=null;this.#provider._recoverSubscriber(this,this._recover(this.#provider));return}const network=await this.#provider.getNetwork();if(!this.#network){this.#network=network}if(this.#network.networkId!==network.networkId){throw new Error("chaid changed")}if(this.#hault){return}const result=await this.#provider.send("xcb_getFilterChanges",[filterId]);await this._emitResults(this.#provider,result)}catch(error){console.log("@TODO",error)}this.#provider.once("block",this.#poller)}#teardown(){const filterIdPromise=this.#filterIdPromise;if(filterIdPromise){this.#filterIdPromise=null;filterIdPromise.then(filterId=>{this.#provider.send("xcb_uninstallFilter",[filterId])})}}start(){if(this.#running){return}this.#running=true;this.#poll(-2)}stop(){if(!this.#running){return}this.#running=false;this.#hault=true;this.#teardown();this.#provider.off("block",this.#poller)}pause(dropWhilePaused){if(dropWhilePaused){this.#teardown()}this.#provider.off("block",this.#poller)}resume(){this.start()}}class FilterIdEventSubscriber extends FilterIdSubscriber{#event;constructor(provider,filter){super(provider);this.#event=copy(filter)}_recover(provider){return new PollingEventSubscriber(provider,this.#event)}async _subscribe(provider){const filterId=await provider.send("xcb_newFilter",[this.#event]);return filterId}async _emitResults(provider,results){for(const result of results){provider.emit(this.#event,provider._wrapLog(result,provider._network))}}}class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(provider){return await provider.send("xcb_newPendingTransactionFilter",[])}async _emitResults(provider,results){for(const result of results){provider.emit("pending",result)}}}const Primitive="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy(value){if(value==null||Primitive.indexOf(typeof value)>=0){return value}if(typeof value.getAddress==="function"){return value}if(Array.isArray(value)){return value.map(deepCopy)}if(typeof value==="object"){return Object.keys(value).reduce((accum,key)=>{accum[key]=value[key];return accum},{})}throw new Error(`should not happen: ${value} (${typeof value})`)}function stall$3(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getLowerCase(value){if(value){return value.toLowerCase()}return value}function isPollable(value){return value&&typeof value.pollingInterval==="number"}const defaultOptions={polling:false,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100};class JsonRpcSigner extends AbstractSigner{address;constructor(provider,address){super(provider);address=getAddress(address);defineProperties(this,{address:address})}connect(provider){assert(false,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(tx){return await this.populateCall(tx)}async sendUncheckedTransaction(_tx){const tx=deepCopy(_tx);const promises=[];if(tx.from){const _from=tx.from;promises.push((async()=>{const from=await resolveAddress(_from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from})())}else{tx.from=this.address}if(tx.energyLimit==null){promises.push((async()=>{tx.energyLimit=await this.provider.estimateEnergy({...tx,from:this.address})})())}if(tx.to!=null){const _to=tx.to;promises.push((async()=>{tx.to=await resolveAddress(_to)})())}if(promises.length){await Promise.all(promises)}const hexTx=this.provider.getRpcTransaction(tx);return this.provider.send("xcb_sendTransaction",[hexTx])}async sendTransaction(tx){const blockNumber=await this.provider.getBlockNumber();const hash=await this.sendUncheckedTransaction(tx);return await new Promise((resolve,reject)=>{const timeouts=[1e3,100];const checkTx=async()=>{const tx=await this.provider.getTransaction(hash);if(tx!=null){resolve(tx.replaceableTransaction(blockNumber));return}this.provider._setTimeout(()=>{checkTx()},timeouts.pop()||4e3)};checkTx()})}async signTransaction(_tx){const tx=deepCopy(_tx);if(tx.from){const from=await resolveAddress(tx.from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from}else{tx.from=this.address}const hexTx=this.provider.getRpcTransaction(tx);return await this.provider.send("xcb_signTransaction",[hexTx])}async signMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("personal_sign",[hexlify(message),this.address.toLowerCase()])}async signTypedData(domain,types,_value){const value=deepCopy(_value);const populated=await TypedDataEncoder.resolveNames(domain,types,value,async value=>{const address=await resolveAddress(value);assertArgument(address!=null,"TypedData does not support null address","value",value);return address});return await this.provider.send("xcb_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(populated.domain,types,populated.value))])}async unlock(password){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),password,null])}async _legacySignMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("xcb_sign",[this.address.toLowerCase(),hexlify(message)])}}class JsonRpcApiProvider extends AbstractProvider{#options;#nextId;#payloads;#drainTimer;#notReady;#network;#scheduleDrain(){if(this.#drainTimer){return}const stallTime=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#drainTimer=setTimeout(()=>{this.#drainTimer=null;const payloads=this.#payloads;this.#payloads=[];while(payloads.length){const batch=[payloads.shift()];while(payloads.length){if(batch.length===this.#options.batchMaxCount){break}batch.push(payloads.shift());const bytes=JSON.stringify(batch.map(p=>p.payload));if(bytes.length>this.#options.batchMaxSize){payloads.unshift(batch.pop());break}}(async()=>{const payload=batch.length===1?batch[0].payload:batch.map(p=>p.payload);this.emit("debug",{action:"sendRpcPayload",payload:payload});try{const result=await this._send(payload);this.emit("debug",{action:"receiveRpcResult",result:result});for(const{resolve,reject,payload}of batch){const resp=result.filter(r=>r.id===payload.id)[0];if(resp==null){return reject(makeError("no response from server","BAD_DATA",{value:result,info:{payload:payload}}))}if("error"in resp){return reject(this.getRpcError(payload,resp))}resolve(resp.result)}}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});for(const{reject}of batch){reject(error)}}})()}},stallTime)}constructor(network,options){super(network);this.#nextId=1;this.#options=Object.assign({},defaultOptions,options||{});this.#payloads=[];this.#drainTimer=null;this.#network=null;{let resolve=null;const promise=new Promise(_resolve=>{resolve=_resolve});this.#notReady={promise:promise,resolve:resolve}}const staticNetwork=this._getOption("staticNetwork");if(staticNetwork){assertArgument(network==null||staticNetwork.matches(network),"staticNetwork MUST match network object","options",options);this.#network=staticNetwork}}_getOption(key){return this.#options[key]}get _network(){assert(this.#network,"network is not available yet","NETWORK_ERROR");return this.#network}async _perform(req){const request=this.getRpcRequest(req);if(request!=null){return await this.send(request.method,request.args)}return super._perform(req)}async _detectNetwork(){const network=this._getOption("staticNetwork");if(network){return network}if(this.ready){return Network.from(getBigInt(await this.send("xcb_networkId",[])))}const payload={id:this.#nextId++,method:"xcb_networkId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:payload});let result;try{result=(await this._send(payload))[0]}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});throw error}this.emit("debug",{action:"receiveRpcResult",result:result});if("result"in result){return Network.from(getBigInt(result.result))}throw this.getRpcError(payload,result)}_start(){if(this.#notReady==null||this.#notReady.resolve==null){return}this.#notReady.resolve();this.#notReady=null;(async()=>{while(this.#network==null){try{this.#network=await this._detectNetwork()}catch(error){console.log("JsonRpcProvider failed to startup; retry in 1s");await stall$3(1e3)}}this.#scheduleDrain()})()}async _waitUntilReady(){if(this.#notReady==null){return}return await this.#notReady.promise}_getSubscriber(sub){if(sub.type==="pending"){return new FilterIdPendingSubscriber(this)}if(sub.type==="event"){if(this._getOption("polling")){return new PollingEventSubscriber(this,sub.filter)}return new FilterIdEventSubscriber(this,sub.filter)}if(sub.type==="orphan"&&sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("orphan")}return super._getSubscriber(sub)}get ready(){return this.#notReady==null}getRpcTransaction(tx){const result={};["networkId","energyLimit","energyPrice","type","nonce","value"].forEach(key=>{if(tx[key]==null){return}let dstKey=key;if(key==="energyLimit"){dstKey="energy"}result[dstKey]=toQuantity(getBigInt(tx[key],`tx.${key}`))});["from","to","data"].forEach(key=>{if(tx[key]==null){return}result[key]=hexlify(tx[key])});return result}getRpcRequest(req){switch(req.method){case"networkId":return{method:"xcb_networkId",args:[]};case"getBlockNumber":return{method:"xcb_blockNumber",args:[]};case"getEnergyPrice":return{method:"xcb_energyPrice",args:[]};case"getBalance":{return{method:"xcb_getBalance",args:[getLowerCase(req.address),req.blockTag]}}case"getTransactionCount":return{method:"xcb_getTransactionCount",args:[getLowerCase(req.address),req.blockTag]};case"getCode":return{method:"xcb_getCode",args:[getLowerCase(req.address),req.blockTag]};case"getStorage":return{method:"xcb_getStorageAt",args:[getLowerCase(req.address),"0x"+req.position.toString(16),req.blockTag]};case"broadcastTransaction":return{method:"xcb_sendRawTransaction",args:[req.signedTransaction]};case"getBlock":if("blockTag"in req){return{method:"xcb_getBlockByNumber",args:[req.blockTag,!!req.includeTransactions]}}else if("blockHash"in req){return{method:"xcb_getBlockByHash",args:[req.blockHash,!!req.includeTransactions]}}break;case"getTransaction":return{method:"xcb_getTransactionByHash",args:[req.hash]};case"getTransactionReceipt":return{method:"xcb_getTransactionReceipt",args:[req.hash]};case"call":return{method:"xcb_call",args:[this.getRpcTransaction(req.transaction),req.blockTag]};case"estimateEnergy":{return{method:"xcb_estimateEnergy",args:[this.getRpcTransaction(req.transaction)]}}case"getLogs":if(req.filter&&req.filter.address!=null){if(Array.isArray(req.filter.address)){req.filter.address=req.filter.address.map(getLowerCase)}else{req.filter.address=getLowerCase(req.filter.address)}}return{method:"xcb_getLogs",args:[req.filter]}}return null}getRpcError(payload,_error){const{method}=payload;const{error}=_error;if(method==="xcb_estimateEnergy"&&error.message){const msg=error.message;if(!msg.match(/revert/i)&&msg.match(/insufficient funds/i)){return makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:payload.params[0],info:{payload:payload,error:error}})}}if(method==="xcb_call"||method==="xcb_estimateEnergy"){const result=spelunkData(error);const e=AbiCoder.getBuiltinCallException(method==="xcb_call"?"call":"estimateEnergy",payload.params[0],result?result.data:null);e.info={error:error,payload:payload};return e}const message=JSON.stringify(spelunkMessage(error));if(typeof error.message==="string"&&error.message.match(/user denied|corebc-user-denied/i)){const actionMap={xcb_sign:"signMessage",personal_sign:"signMessage",xcb_signTypedData_v4:"signTypedData",xcb_signTransaction:"signTransaction",xcb_sendTransaction:"sendTransaction",xcb_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return makeError(`user rejected action`,"ACTION_REJECTED",{action:actionMap[method]||"unknown",reason:"rejected",info:{payload:payload,error:error}})}if(method==="xcb_sendRawTransaction"||method==="xcb_sendTransaction"){const transaction=payload.params[0];if(message.match(/insufficient funds|base fee exceeds energy limit/i)){return makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction,info:{error:error}})}if(message.match(/nonce/i)&&message.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:transaction,info:{error:error}})}if(message.match(/replacement transaction/i)&&message.match(/underpriced/i)){return makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction,info:{error:error}})}if(message.match(/only replay-protected/i)){return makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:method,info:{transaction:transaction,info:{error:error}}})}}if(message.match(/the method .* does not exist/i)){return makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:payload.method,info:{error:error}})}return makeError("could not coalesce error","UNKNOWN_ERROR",{error:error})}send(method,params){const id=this.#nextId++;const promise=new Promise((resolve,reject)=>{this.#payloads.push({resolve:resolve,reject:reject,payload:{method:method,params:params,id:id,jsonrpc:"2.0"}})});this.#scheduleDrain();return promise}async getSigner(address){if(address==null){address=0}const accountsPromise=this.send("xcb_accounts",[]);if(typeof address==="number"){const accounts=await accountsPromise;if(address>=accounts.length){throw new Error("no such account")}return new JsonRpcSigner(this,accounts[address])}const{accounts}=await resolveProperties({network:this.getNetwork(),accounts:accountsPromise});address=getAddress(address);for(const account of accounts){if(getAddress(account)===address){return new JsonRpcSigner(this,address)}}throw new Error("invalid account")}async listAccounts(){const accounts=await this.send("xcb_accounts",[]);return accounts.map(a=>new JsonRpcSigner(this,a))}}class JsonRpcApiPollingProvider extends JsonRpcApiProvider{#pollingInterval;constructor(network,options){super(network,options);this.#pollingInterval=4e3}_getSubscriber(sub){const subscriber=super._getSubscriber(sub);if(isPollable(subscriber)){subscriber.pollingInterval=this.#pollingInterval}return subscriber}get pollingInterval(){return this.#pollingInterval}set pollingInterval(value){if(!Number.isInteger(value)||value<0){throw new Error("invalid interval")}this.#pollingInterval=value;this._forEachSubscriber(sub=>{if(isPollable(sub)){sub.pollingInterval=this.#pollingInterval}})}}class JsonRpcProvider extends JsonRpcApiPollingProvider{#connect;constructor(url,network,options){if(url==null){url="http://localhost:8545"}super(network,options);if(typeof url==="string"){this.#connect=new FetchRequest(url)}else{this.#connect=url.clone()}}_getConnection(){return this.#connect.clone()}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){const request=this._getConnection();request.body=JSON.stringify(payload);request.setHeader("content-type","application/json");const response=await request.send();response.assertOk();let resp=response.bodyJson;if(!Array.isArray(resp)){resp=[resp]}return resp}}function spelunkData(value){if(value==null){return null}if(typeof value.message==="string"&&value.message.match("reverted")&&isHexString(value.data)){return{message:value.message,data:value.data}}if(typeof value==="object"){for(const key in value){const result=spelunkData(value[key]);if(result){return result}}return null}if(typeof value==="string"){try{return spelunkData(JSON.parse(value))}catch(error){}}return null}function _spelunkMessage(value,result){if(value==null){return}if(typeof value.message==="string"){result.push(value.message)}if(typeof value==="object"){for(const key in value){_spelunkMessage(value[key],result)}}if(typeof value==="string"){try{return _spelunkMessage(JSON.parse(value),result)}catch(error){}}}function spelunkMessage(value){const result=[];_spelunkMessage(value,result);return result}const defaultApiKey$1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function getHost$4(name){switch(name){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/xcb_goerli";case"matic":return"rpc.ankr.com/polygon";case"arbitrum":return"rpc.ankr.com/arbitrum"}assertArgument(false,"unsupported network","network",name)}class AnkrProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey$1}const options={polling:true,staticNetwork:network};const request=AnkrProvider.getRequest(network,apiKey);super(request,network,options);defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AnkrProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey$1}const request=new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey$1){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("AnkrProvider");return true}}return request}getRpcError(payload,error){if(payload.method==="xcb_sendRawTransaction"){if(error&&error.error&&error.error.message==="INTERNAL_ERROR: could not replace existing tx"){error.error.message="replacement transaction underpriced"}}return super.getRpcError(payload,error)}isCommunityResource(){return this.apiKey===defaultApiKey$1}}const defaultApiKey="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function getHost$3(name){switch(name){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com"}assertArgument(false,"unsupported network","network",name)}class AlchemyProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey}const request=AlchemyProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AlchemyProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}async _perform(req){if(req.method==="getTransactionResult"){const{trace,tx}=await resolveProperties({trace:this.send("trace_transaction",[req.hash]),tx:this.getTransaction(req.hash)});if(trace==null||tx==null){return null}let data;let error=false;try{data=trace[0].result.output;error=trace[0].error==="Reverted"}catch(error){}if(data){assert(!error,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:data,reason:null,transaction:tx,invocation:null,revert:null});return data}assert(false,"could not parse trace result","BAD_DATA",{value:trace})}return await super._perform(req)}isCommunityResource(){return this.apiKey===defaultApiKey}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey}const request=new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("alchemy");return true}}return request}}class CloudflareProvider extends JsonRpcProvider{constructor(_network){if(_network==null){_network="mainnet"}const network=Network.from(_network);assertArgument(network.name==="mainnet","unsupported network","network",_network);super("https://cloudflare-eth.com/",network,{staticNetwork:network})}}function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const _WebSocket=getGlobal().WebSocket;class SocketSubscriber{#provider;#filter;get filter(){return JSON.parse(this.#filter)}#filterId;#paused;#emitPromise;constructor(provider,filter){this.#provider=provider;this.#filter=JSON.stringify(filter);this.#filterId=null;this.#paused=null;this.#emitPromise=null}start(){this.#filterId=this.#provider.send("xcb_subscribe",this.filter).then(filterId=>{this.#provider._register(filterId,this);return filterId})}stop(){this.#filterId.then(filterId=>{this.#provider.send("xcb_unsubscribe",[filterId])});this.#filterId=null}pause(dropWhilePaused){assert(dropWhilePaused,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"});this.#paused=!!dropWhilePaused}resume(){this.#paused=null}_handleMessage(message){if(this.#filterId==null){return}if(this.#paused===null){let emitPromise=this.#emitPromise;if(emitPromise==null){emitPromise=this._emit(this.#provider,message)}else{emitPromise=emitPromise.then(async()=>{await this._emit(this.#provider,message)})}this.#emitPromise=emitPromise.then(()=>{if(this.#emitPromise===emitPromise){this.#emitPromise=null}})}}async _emit(provider,message){throw new Error("sub-classes must implemente this; _emit")}}class SocketBlockSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newHeads"])}async _emit(provider,message){provider.emit("block",parseInt(message.number))}}class SocketPendingSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newPendingTransactions"])}async _emit(provider,message){provider.emit("pending",message)}}class SocketEventSubscriber extends SocketSubscriber{#logFilter;get logFilter(){return JSON.parse(this.#logFilter)}constructor(provider,filter){super(provider,["logs",filter]);this.#logFilter=JSON.stringify(filter)}async _emit(provider,message){provider.emit(this.logFilter,provider._wrapLog(message,provider._network))}}class SocketProvider extends JsonRpcApiProvider{#callbacks;#subs;#pending;constructor(network){super(network,{batchMaxCount:1});this.#callbacks=new Map;this.#subs=new Map;this.#pending=new Map}_getSubscriber(sub){switch(sub.type){case"close":return new UnmanagedSubscriber("close");case"block":return new SocketBlockSubscriber(this);case"pending":return new SocketPendingSubscriber(this);case"event":return new SocketEventSubscriber(this,sub.filter);case"orphan":if(sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("drop-log")}}return super._getSubscriber(sub)}_register(filterId,subscriber){this.#subs.set(filterId,subscriber);const pending=this.#pending.get(filterId);if(pending){for(const message of pending){subscriber._handleMessage(message)}this.#pending.delete(filterId)}}async _send(payload){assertArgument(!Array.isArray(payload),"WebSocket does not support batch send","payload",payload);const promise=new Promise((resolve,reject)=>{this.#callbacks.set(payload.id,{payload:payload,resolve:resolve,reject:reject})});await this._waitUntilReady();await this._write(JSON.stringify(payload));return[await promise]}async _processMessage(message){const result=JSON.parse(message);if("id"in result){const callback=this.#callbacks.get(result.id);if(callback==null){this.emit("error",makeError("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:result}));return}this.#callbacks.delete(result.id);callback.resolve(result)}else if(result.method==="xcb_subscription"){const filterId=result.params.subscription;const subscriber=this.#subs.get(filterId);if(subscriber){subscriber._handleMessage(result.params.result)}else{let pending=this.#pending.get(filterId);if(pending==null){pending=[];this.#pending.set(filterId,pending)}pending.push(result.params.result)}}}async _write(message){throw new Error("sub-classes must override this")}}class WebSocketProvider extends SocketProvider{#connect;#websocket;get websocket(){if(this.#websocket==null){throw new Error("websocket closed")}return this.#websocket}constructor(url,network){super(network);if(typeof url==="string"){this.#connect=()=>{return new _WebSocket(url)};this.#websocket=this.#connect()}else if(typeof url==="function"){this.#connect=url;this.#websocket=url()}else{this.#connect=null;this.#websocket=url}this.websocket.onopen=async()=>{try{await this._start();this.resume()}catch(error){console.log("failed to start WebsocketProvider",error)}};this.websocket.onmessage=message=>{this._processMessage(message.data)}}async _write(message){this.websocket.send(message)}async destroy(){if(this.#websocket!=null){this.#websocket.close();this.#websocket=null}super.destroy()}}const defaultProjectId="84842078b09946638c03157f83405213";function getHost$2(name){switch(name){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io"}assertArgument(false,"unsupported network","network",name)}class InfuraWebSocketProvider extends WebSocketProvider{projectId;projectSecret;constructor(network,projectId){const provider=new InfuraProvider(network,projectId);const req=provider._getConnection();assert(!req.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const url=req.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(url,network);defineProperties(this,{projectId:provider.projectId,projectSecret:provider.projectSecret})}isCommunityResource(){return this.projectId===defaultProjectId}}class InfuraProvider extends JsonRpcProvider{projectId;projectSecret;constructor(_network,projectId,projectSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=InfuraProvider.getRequest(network,projectId,projectSecret);super(request,network,{staticNetwork:network});defineProperties(this,{projectId:projectId,projectSecret:projectSecret})}_getProvider(networkId){try{return new InfuraProvider(networkId,this.projectId,this.projectSecret)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.projectId===defaultProjectId}static getWebSocketProvider(network,projectId){return new InfuraWebSocketProvider(network,projectId)}static getRequest(network,projectId,projectSecret){if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`);request.allowGzip=true;if(projectSecret){request.setCredentials("",projectSecret)}if(projectId===defaultProjectId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("InfuraProvider");return true}}return request}}const defaultToken="919b412a057b5e9c9b6dce193c5a60242d6efadb";function getHost$1(name){switch(name){case"mainnet":return"corebc.quiknode.pro";case"arbitrum":return"corebc.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"corebc.arbitrum-goerli.quiknode.pro";case"matic":return"corebc.matic.quiknode.pro";case"matic-mumbai":return"corebc.matic-testnet.quiknode.pro";case"optimism":return"corebc.optimism.quiknode.pro";case"optimism-goerli":return"corebc.optimism-goerli.quiknode.pro"}assertArgument(false,"unsupported network","network",name)}class QuickNodeProvider extends JsonRpcProvider{token;constructor(_network,token){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(token==null){token=defaultToken}const request=QuickNodeProvider.getRequest(network,token);super(request,network,{staticNetwork:network});defineProperties(this,{token:token})}_getProvider(networkId){try{return new QuickNodeProvider(networkId,this.token)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.token===defaultToken}static getRequest(network,token){if(token==null){token=defaultToken}const request=new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`);request.allowGzip=true;if(token===defaultToken){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("QuickNodeProvider");return true}}return request}}const BN_1=BigInt("1");const BN_2=BigInt("2");function shuffle(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));const tmp=array[i];array[i]=array[j];array[j]=tmp}}function stall$2(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getTime(){return(new Date).getTime()}function stringify(value){return JSON.stringify(value,(key,value)=>{if(typeof value==="bigint"){return{type:"bigint",value:value.toString()}}return value})}const defaultConfig={stallTimeout:400,priority:1,weight:1};const defaultState={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0};async function waitForSync(config,blockNumber){while(config.blockNumber<0||config.blockNumber{const blockNumber=await config.provider.getBlockNumber();if(blockNumber>config.blockNumber){config.blockNumber=blockNumber}config._updateNumber=null})()}await config._updateNumber;config.outOfSync++}}function _normalize(value){if(value==null){return"null"}if(Array.isArray(value)){return"["+value.map(_normalize).join(",")+"]"}if(typeof value==="object"&&typeof value.toJSON==="function"){return _normalize(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":case"number":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{"+keys.map(k=>`${JSON.stringify(k)}:${_normalize(value[k])}`).join(",")+"}"}}console.log("Could not serialize",value);throw new Error("Hmm...")}function normalizeResult(value){if("error"in value){const error=value.error;return{tag:_normalize(error),value:error}}const result=value.result;return{tag:_normalize(result),value:result}}function checkQuorum(quorum,results){const tally=new Map;for(const{value,tag,weight}of results){const t=tally.get(tag)||{value:value,weight:0};t.weight+=weight;tally.set(tag,t)}let best=null;for(const r of tally.values()){if(r.weight>=quorum&&(!best||r.weight>best.weight)){best=r}}if(best){return best.value}return undefined}function getMedian(quorum,results){let resultWeight=0;const errorMap=new Map;let bestError=null;const values=[];for(const{value,tag,weight}of results){if(value instanceof Error){const e=errorMap.get(tag)||{value:value,weight:0};e.weight+=weight;errorMap.set(tag,e);if(bestError==null||e.weight>bestError.weight){bestError=e}}else{values.push(BigInt(value));resultWeight+=weight}}if(resultWeight=quorum){return bestError.value}return undefined}values.sort((a,b)=>aa?1:0);const mid=Math.floor(values.length/2);if(values.length%2){return values[mid]}return(values[mid-1]+values[mid]+BN_1)/BN_2}function getAnyResult(quorum,results){const result=checkQuorum(quorum,results);if(result!==undefined){return result}for(const r of results){if(r.value){return r.value}}return undefined}function getFuzzyMode(quorum,results){if(quorum===1){return getNumber(getMedian(quorum,results),"%internal")}const tally=new Map;const add=(result,weight)=>{const t=tally.get(result)||{result:result,weight:0};t.weight+=weight;tally.set(result,t)};for(const{weight,value}of results){const r=getNumber(value);add(r-1,weight);add(r,weight);add(r+1,weight)}let bestWeight=0;let bestResult=undefined;for(const{weight,result}of tally.values()){if(weight>=quorum&&(weight>bestWeight||bestResult!=null&&weight===bestWeight&&result>bestResult)){bestWeight=weight;bestResult=result}}return bestResult}class FallbackProvider extends AbstractProvider{quorum;eventQuorum;eventWorkers;#configs;#height;#initialSyncPromise;constructor(providers,network){super(network);this.#configs=providers.map(p=>{if(p instanceof AbstractProvider){return Object.assign({provider:p},defaultConfig,defaultState)}else{return Object.assign({},defaultConfig,p,defaultState)}});this.#height=-2;this.#initialSyncPromise=null;this.quorum=2;this.eventQuorum=1;this.eventWorkers=1;assertArgument(this.quorum<=this.#configs.reduce((a,c)=>a+c.weight,0),"quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return this.#configs.map(c=>{const result=Object.assign({},c);for(const key in result){if(key[0]==="_"){delete result[key]}}return result})}async _detectNetwork(){return Network.from(getBigInt(await this._perform({method:"networkId"})))}async _translatePerform(provider,req){switch(req.method){case"broadcastTransaction":return await provider.broadcastTransaction(req.signedTransaction);case"call":return await provider.call(Object.assign({},req.transaction,{blockTag:req.blockTag}));case"networkId":return(await provider.getNetwork()).networkId;case"estimateEnergy":return await provider.estimateEnergy(req.transaction);case"getBalance":return await provider.getBalance(req.address,req.blockTag);case"getBlock":{const block="blockHash"in req?req.blockHash:req.blockTag;return await provider.getBlock(block,req.includeTransactions)}case"getBlockNumber":return await provider.getBlockNumber();case"getCode":return await provider.getCode(req.address,req.blockTag);case"getEnergyPrice":return(await provider.getFeeData()).energyPrice;case"getLogs":return await provider.getLogs(req.filter);case"getStorage":return await provider.getStorage(req.address,req.position,req.blockTag);case"getTransaction":return await provider.getTransaction(req.hash);case"getTransactionCount":return await provider.getTransactionCount(req.address,req.blockTag);case"getTransactionReceipt":return await provider.getTransactionReceipt(req.hash);case"getTransactionResult":return await provider.getTransactionResult(req.hash)}}#getNextConfig(running){const configs=Array.from(running).map(r=>r.config);const allConfigs=this.#configs.slice();shuffle(allConfigs);allConfigs.sort((a,b)=>b.priority-a.priority);for(const config of allConfigs){if(configs.indexOf(config)===-1){return config}}return null}#addRunner(running,req){const config=this.#getNextConfig(running);if(config==null){return null}const runner={config:config,result:null,didBump:false,perform:null,staller:null};const now=getTime();runner.perform=(async()=>{try{config.requests++;const result=await this._translatePerform(config.provider,req);runner.result={result:result}}catch(error){config.errorResponses++;runner.result={error:error}}const dt=getTime()-now;config._totalTime+=dt;config.rollingDuration=.95*config.rollingDuration+.05*dt;runner.perform=null})();runner.staller=(async()=>{await stall$2(config.stallTimeout);runner.staller=null})();running.add(runner);return runner}async#initialSync(){let initialSync=this.#initialSyncPromise;if(!initialSync){const promises=[];this.#configs.forEach(config=>{promises.push(waitForSync(config,0));promises.push((async()=>{config._network=await config.provider.getNetwork()})())});this.#initialSyncPromise=initialSync=(async()=>{await Promise.all(promises);let networkId=null;for(const config of this.#configs){const network=config._network;if(networkId==null){networkId=network.networkId}else if(network.networkId!==networkId){assert(false,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}}})()}await initialSync}async#checkQuorum(running,req){const results=[];for(const runner of running){if(runner.result!=null){const{tag,value}=normalizeResult(runner.result);results.push({tag:tag,value:value,weight:runner.config.weight})}}if(results.reduce((a,r)=>a+r.weight,0)({value:c.blockNumber,tag:getNumber(c.blockNumber).toString(),weight:c.weight})))))}const mode=getFuzzyMode(this.quorum,results);if(mode===undefined){return undefined}if(mode>this.#height){this.#height=mode}return this.#height}case"getEnergyPrice":case"estimateEnergy":return getMedian(this.quorum,results);case"getBlock":if("blockTag"in req&&req.blockTag==="pending"){return getAnyResult(this.quorum,results)}return checkQuorum(this.quorum,results);case"call":case"networkId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return checkQuorum(this.quorum,results);case"broadcastTransaction":return getAnyResult(this.quorum,results)}assert(false,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${stringify(req.method)})`})}async#waitForQuorum(running,req){if(running.size===0){throw new Error("no runners?!")}const interesting=[];let newRunners=0;for(const runner of running){if(runner.perform){interesting.push(runner.perform)}if(runner.staller){interesting.push(runner.staller);continue}if(runner.didBump){continue}runner.didBump=true;newRunners++}const value=await this.#checkQuorum(running,req);if(value!==undefined){if(value instanceof Error){throw value}return value}for(let i=0;i0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:Array.from(running).map(r=>stringify(r.result))}});await Promise.race(interesting);return await this.#waitForQuorum(running,req)}async _perform(req){if(req.method==="broadcastTransaction"){const results=await Promise.all(this.#configs.map(async({provider,weight})=>{try{const result=await provider._perform(req);return Object.assign(normalizeResult({result:result}),{weight:weight})}catch(error){return Object.assign(normalizeResult({error:error}),{weight:weight})}}));const result=getAnyResult(this.quorum,results);assert(result!==undefined,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:results.map(stringify)}});if(result instanceof Error){throw result}return result}await this.#initialSync();const running=new Set;for(let i=0;i{const payload={method:method,params:params};this.emit("debug",{action:"sendEip1193Request",payload:payload});try{const result=await core.request(payload);this.emit("debug",{action:"receiveEip1193Result",result:result});return result}catch(e){const error=new Error(e.message);error.code=e.code;error.data=e.data;error.payload=payload;this.emit("debug",{action:"receiveEip1193Error",error:error});throw error}}}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){assertArgument(!Array.isArray(payload),"EIP-1193 does not support batch request","payload",payload);try{const result=await this.#request(payload.method,payload.params||[]);return[{id:payload.id,result:result}]}catch(e){return[{id:payload.id,error:{code:e.code,data:e.data,message:e.message}}]}}getRpcError(payload,error){error=JSON.parse(JSON.stringify(error));switch(error.error.code||-1){case 4001:error.error.message=`corebc-user-denied: ${error.error.message}`;break;case 4200:error.error.message=`corebc-unsupported: ${error.error.message}`;break}return super.getRpcError(payload,error)}async hasSigner(address){if(address==null){address=0}const accounts=await this.send("xcb_accounts",[]);if(typeof address==="number"){return accounts.length>address}address=address.toLowerCase();return accounts.filter(a=>a.toLowerCase()===address).length!==0}async getSigner(address){if(address==null){address=0}if(!await this.hasSigner(address)){try{await this.#request("xcb_requestAccounts",[])}catch(error){const payload=error.payload;throw this.getRpcError(payload,{id:payload.id,error:error})}}return await super.getSigner(address)}}const defaultApplicationId="62e1ad51b37b8e00394bda3b";function getHost(name){switch(name){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}assertArgument(false,"unsupported network","network",name)}class PocketProvider extends JsonRpcProvider{applicationId;applicationSecret;constructor(_network,applicationId,applicationSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(applicationId==null){applicationId=defaultApplicationId}if(applicationSecret==null){applicationSecret=null}const options={staticNetwork:network};const request=PocketProvider.getRequest(network,applicationId,applicationSecret);super(request,network,options);defineProperties(this,{applicationId:applicationId,applicationSecret:applicationSecret})}_getProvider(networkId){try{return new PocketProvider(networkId,this.applicationId,this.applicationSecret)}catch(error){}return super._getProvider(networkId)}static getRequest(network,applicationId,applicationSecret){if(applicationId==null){applicationId=defaultApplicationId}const request=new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`);request.allowGzip=true;if(applicationSecret){request.setCredentials("",applicationSecret)}if(applicationId===defaultApplicationId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("PocketProvider");return true}}return request}isCommunityResource(){return this.applicationId===defaultApplicationId}}const IpcSocketProvider=undefined;class BaseWallet extends AbstractSigner{address;prefix;#signingKey;constructor({signingKey,prefix,provider}){super(provider);this.prefix=prefix;assertArgument(signingKey&&typeof signingKey.sign==="function","invalid signingKey key","signingKey","[ REDACTED ]");this.#signingKey=signingKey;const address=computeAddress(this.#signingKey,prefix);defineProperties(this,{address:address})}get signingKey(){return this.#signingKey}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(provider){return new BaseWallet({signingKey:this.#signingKey,prefix:this.prefix,provider:provider})}async signTransaction(tx){const{to,from}=await resolveProperties({to:tx.to||undefined,from:tx.from||undefined});if(to!=null){tx.to=to}if(from!=null){tx.from=from}if(tx.from!=null){assertArgument(getAddress(tx.from)===this.address,"transaction from address mismatch","tx.from",tx.from);delete tx.from}const btx=Transaction.from(tx);const unSignedSerialized=btx.unsignedSerialized;const unsignedHash=sha256(unSignedSerialized);btx.signature=this.signingKey.sign(unsignedHash);return btx.serialized}async signMessage(message){return this.signMessageSync(message)}signMessageSync(message){return this.signingKey.sign(hashMessage(message))}async signTypedData(domain,types,value){const populated=await TypedDataEncoder.resolveNames(domain,types,value,async name=>{assert(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:name}});const address=getAddress(name);assert(address!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:name});return address});return this.signingKey.sign(TypedDataEncoder.hash(populated.domain,types,populated.value))}}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}static check(wordlist){const words=[];for(let i=0;i<2048;i++){const word=wordlist.getWord(i);if(i!==wordlist.getWordIndex(word)){return"0x"}words.push(word)}return id(words.join("\n")+"\n")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n",true);if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index{const goldilockSaltPrefix="mnemonic";const aesSaltPrefix="mnemonicfortheAESkey";const goldilockSalt=utf8.encode(goldilockSaltPrefix+password);const aesSalt=utf8.encode(aesSaltPrefix+password);const goldilockKey=pbkdf2Sync(Buffer.from(mnemonic),goldilockSalt,2048,64,"sha512");const aesKeySeed=pbkdf2Sync(Buffer.from(mnemonic),aesSalt,2048,64,"sha512");return{aes:aesKeySeed.toString("hex"),goldilock:goldilockKey.toString("hex")}};function getUpperMask(bits){return(1<=12&&words.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const entropy=new Uint8Array(Math.ceil(11*words.length/8));let offset=0;for(let i=0;i=0,`invalid mnemonic word at index ${i}`,"mnemonic","[ REDACTED ]");for(let bit=0;bit<11;bit++){if(index&1<<10-bit){entropy[offset>>3]|=1<<7-offset%8}offset++}}const entropyBits=32*words.length/3;const checksumBits=words.length/3;const checksumMask=getUpperMask(checksumBits);const checksum=getBytes(legacySha256(entropy.slice(0,entropyBits/8)))[0]&checksumMask;assertArgument(checksum===(entropy[entropy.length-1]&checksumMask),"invalid mnemonic checksum","mnemonic","[ REDACTED ]");return hexlify(entropy.slice(0,entropyBits/8))}function entropyToMnemonic(entropy,wordlist){assertArgument(entropy.length%4===0&&entropy.length>=16&&entropy.length<=32,"invalid entropy size","entropy","[ REDACTED ]");if(wordlist==null){wordlist=LangEn.wordlist()}const indices=[0];let remainingBits=11;for(let i=0;i8){indices[indices.length-1]<<=8;indices[indices.length-1]|=entropy[i];remainingBits-=8}else{indices[indices.length-1]<<=remainingBits;indices[indices.length-1]|=entropy[i]>>8-remainingBits;indices.push(entropy[i]&getLowerMask(8-remainingBits));remainingBits+=3}}const checksumBits=entropy.length/4;const checksum=parseInt(legacySha256(entropy).substring(2,4),16)&getUpperMask(checksumBits);indices[indices.length-1]<<=checksumBits;indices[indices.length-1]|=checksum>>8-checksumBits;return wordlist.join(indices.map(index=>wordlist.getWord(index)))}const _guard$1={};class Mnemonic{phrase;password;wordlist;entropy;constructor(guard,entropy,phrase,password,wordlist){if(password==null){password=""}if(wordlist==null){wordlist=LangEn.wordlist()}assertPrivate(guard,_guard$1,"Mnemonic");defineProperties(this,{phrase:phrase,password:password,wordlist:wordlist,entropy:entropy})}computeSeed(){return mnemonicToSeed(this.phrase,this.password)}static fromPhrase({phrase,password,wordlist}){const entropy=mnemonicToEntropy(phrase,wordlist);phrase=entropyToMnemonic(getBytes(entropy),wordlist);return new Mnemonic(_guard$1,entropy,phrase,password,wordlist)}static fromEntropy(_entropy,password,wordlist){const entropy=getBytes(_entropy,"entropy");const phrase=entropyToMnemonic(entropy,wordlist);return new Mnemonic(_guard$1,hexlify(entropy),phrase,password,wordlist)}static entropyToPhrase(_entropy,wordlist){const entropy=getBytes(_entropy,"entropy");return entropyToMnemonic(entropy,wordlist)}static phraseToEntropy(phrase,wordlist){return mnemonicToEntropy(phrase,wordlist)}static isValidMnemonic(phrase,wordlist){try{mnemonicToEntropy(phrase,wordlist);return true}catch(error){}return false}}function looseArrayify(hexString){if(typeof hexString==="string"&&!hexString.startsWith("0x")){hexString="0x"+hexString}return getBytesCopy(hexString)}function zpad(value,length){value=String(value);while(value.length0&&(N&N-1)===0,"invalid kdf.N","kdf.N",N);assertArgument(r>0&&p>0,"invalid kdf","kdf",kdf);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dflen",dkLen);return{name:"scrypt",salt:salt,N:N,r:r,p:p,dkLen:64}}else if(kdf.toLowerCase()==="pbkdf2"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const prf=spelunk(data,"crypto.kdfparams.prf:string!");const algorithm=prf.split("-").pop();assertArgument(algorithm==="sha256"||algorithm==="sha512","invalid kdf.pdf","kdf.pdf",prf);const count=spelunk(data,"crypto.kdfparams.c:int!");const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dklen",dkLen);return{name:"pbkdf2",salt:salt,count:count,dkLen:dkLen,algorithm:algorithm}}}assertArgument(false,"unsupported key-derivation function","kdf",kdf)}function decryptKeystoreJsonSync(json,_password){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=scryptSync(password,salt,N,r,p,dkLen);return getAccount(data,key)}function stall$1(duration){return new Promise(resolve=>{setTimeout(()=>{resolve()},duration)})}async function decryptKeystoreJson(json,_password,progress){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){if(progress){progress(0);await stall$1(0)}const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);if(progress){progress(1);await stall$1(0)}return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=await scrypt(password,salt,N,r,p,dkLen,progress);return getAccount(data,key)}function getEncryptKdfParams(options){const salt=options.salt!=null?getBytes(options.salt,"options.salt"):randomBytes(32);let N=1<<17,r=8,p=1;if(options.scrypt){if(options.scrypt.N){N=options.scrypt.N}if(options.scrypt.r){r=options.scrypt.r}if(options.scrypt.p){p=options.scrypt.p}}assertArgument(typeof N==="number"&&N>0&&Number.isSafeInteger(N)&&(BigInt(N)&BigInt(N-1))===BigInt(0),"invalid scrypt N parameter","options.N",N);assertArgument(typeof r==="number"&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r);assertArgument(typeof p==="number"&&p>0&&Number.isSafeInteger(p),"invalid scrypt p parameter","options.p",p);return{name:"scrypt",dkLen:32,salt:salt,N:N,r:r,p:p}}function _encryptKeystore(key,kdf,account,options){const privateKey=getBytes(account.privateKey,"privateKey");const iv=options.iv!=null?getBytes(options.iv,"options.iv"):randomBytes(16);assertArgument(iv.length===16,"invalid options.iv length","options.iv",options.iv);const uuidRandom=options.uuid!=null?getBytes(options.uuid,"options.uuid"):randomBytes(16);assertArgument(uuidRandom.length===16,"invalid options.uuid length","options.uuid",options.iv);const derivedKey=key.slice(0,16);const macPrefix=key.slice(16,32);const aesCtr=new CTR(derivedKey,iv);const ciphertext=getBytes(aesCtr.encrypt(privateKey));const mac=sha256(concat([macPrefix,ciphertext]));const data={address:account.address.substring(2).toLowerCase(),id:uuidV4(uuidRandom),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(iv).substring(2)},ciphertext:hexlify(ciphertext).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify(kdf.salt).substring(2),n:kdf.N,dklen:32,p:kdf.p,r:kdf.r},mac:mac.substring(2)}};if(account.mnemonic){const client=options.client!=null?options.client:`corebc/${version}`;const path=account.mnemonic.path||defaultPath$1;const locale=account.mnemonic.locale||"en";const mnemonicKey=key.slice(32,64);const entropy=getBytes(account.mnemonic.entropy,"account.mnemonic.entropy");const mnemonicIv=randomBytes(16);const mnemonicAesCtr=new CTR(mnemonicKey,mnemonicIv);const mnemonicCiphertext=getBytes(mnemonicAesCtr.encrypt(entropy));const now=new Date;const timestamp=now.getUTCFullYear()+"-"+zpad(now.getUTCMonth()+1,2)+"-"+zpad(now.getUTCDate(),2)+"T"+zpad(now.getUTCHours(),2)+"-"+zpad(now.getUTCMinutes(),2)+"-"+zpad(now.getUTCSeconds(),2)+".0Z";const gethFilename="UTC--"+timestamp+"--"+data.address;data["x-corebc"]={client:client,gethFilename:gethFilename,path:path,locale:locale,mnemonicCounter:hexlify(mnemonicIv).substring(2),mnemonicCiphertext:hexlify(mnemonicCiphertext).substring(2),version:"0.1"}}return JSON.stringify(data)}function encryptKeystoreJsonSync(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=scryptSync(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64);return _encryptKeystore(getBytes(key),kdf,account,options)}async function encryptKeystoreJson(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=await scrypt(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64,options.progressCallback);return _encryptKeystore(getBytes(key),kdf,account,options)}const defaultPath="m";const HardenedBit=2147483648;const _guard={};function derivePath(node,path){const components=path.split("/");assertArgument(components.length>0&&(components[0]==="m"||node.depth>0),"invalid path","path",path);if(components[0]==="m"){components.shift()}let result=node;for(let i=0;i=0&&index=0&&index{setTimeout(()=>{resolve()},duration)})}class Wallet extends BaseWallet{constructor({key,prefix,provider}){if(typeof key==="string"&&!key.startsWith("0x")){key="0x"+key}let signingKey=typeof key==="string"?new SigningKey(key):key;super({signingKey:signingKey,prefix:prefix,provider:provider})}connect(provider){return new Wallet({key:this.signingKey,prefix:this.prefix,provider:provider})}async encrypt(password,progressCallback){const account={address:this.address,privateKey:this.privateKey};return await encryptKeystoreJson(account,password,{progressCallback:progressCallback})}encryptSync(password){const account={address:this.address,privateKey:this.privateKey};return encryptKeystoreJsonSync(account,password)}static#fromAccount(account){assertArgument(account,"invalid JSON wallet","json","[ REDACTED ]");const address=account.address;const prefix=extractPrefix(address);if("mnemonic"in account&&account.mnemonic&&account.mnemonic.locale==="en"){const mnemonic=Mnemonic.fromEntropy(account.mnemonic.entropy);const wallet=HDNodeWallet.fromMnemonic(mnemonic,prefix,account.mnemonic.path);if(wallet.address===account.address&&wallet.privateKey===account.privateKey){return wallet}console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const wallet=new Wallet({key:account.privateKey,prefix:prefix});assertArgument(wallet.address===account.address,"address/privateKey mismatch","json","[ REDACTED ]");return wallet}static async fromEncryptedJson(json,password,progress){let account=null;if(isKeystoreJson(json)){account=await decryptKeystoreJson(json,password,progress)}else if(isCrowdsaleJson(json)){if(progress){progress(0);await stall(0)}account=decryptCrowdsaleJson(json,password);if(progress){progress(1);await stall(0)}}return Wallet.#fromAccount(account)}static fromEncryptedJsonSync(json,password){let account=null;if(isKeystoreJson(json)){account=decryptKeystoreJsonSync(json,password)}else if(isCrowdsaleJson(json)){account=decryptCrowdsaleJson(json,password)}else{assertArgument(false,"invalid JSON wallet","json","[ REDACTED ]")}return Wallet.#fromAccount(account)}static createRandom(prefix,provider){const wallet=HDNodeWallet.createRandom(prefix,undefined,undefined,undefined);if(provider){return wallet.connect(provider)}return wallet}static fromPhrase({phrase,prefix,provider,password}){const wallet=HDNodeWallet.fromPhrase({phrase:phrase,prefix:prefix,password:password});if(provider){return wallet.connect(provider)}return wallet}static fromSeed({seed,prefix,provider,path}){const wallet=HDNodeWallet.fromSeed({seed:seed,prefix:prefix,path:path||defaultPath});if(provider){return wallet.connect(provider)}return wallet}}const Base64=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function decodeBits(width,data){const maxValue=(1<=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const wordlists={en:LangEn.wordlist()};var corebc=Object.freeze({__proto__:null,AbiCoder:AbiCoder,AbstractProvider:AbstractProvider,AbstractSigner:AbstractSigner,AlchemyProvider:AlchemyProvider,AnkrProvider:AnkrProvider,BaseContract:BaseContract,BaseWallet:BaseWallet,BigNumber:BigNumber,Block:Block,BrowserProvider:BrowserProvider,CloudflareProvider:CloudflareProvider,ConstructorFragment:ConstructorFragment,Contract:Contract,ContractEventPayload:ContractEventPayload,ContractFactory:ContractFactory,ContractTransactionReceipt:ContractTransactionReceipt,ContractTransactionResponse:ContractTransactionResponse,ContractUnknownEventPayload:ContractUnknownEventPayload,CoreSymbol:CoreSymbol,Ed448Goldilock:Ed448Goldilock,EnergyCostPlugin:EnergyCostPlugin,ErrorDescription:ErrorDescription,ErrorFragment:ErrorFragment,EventFragment:EventFragment,EventLog:EventLog,EventPayload:EventPayload,FallbackFragment:FallbackFragment,FallbackProvider:FallbackProvider,FeeData:FeeData,FeeDataNetworkPlugin:FeeDataNetworkPlugin,FetchCancelSignal:FetchCancelSignal,FetchRequest:FetchRequest,FetchResponse:FetchResponse,FixedNumber:FixedNumber,Fragment:Fragment,FunctionFragment:FunctionFragment,HDNodeWallet:HDNodeWallet,Indexed:Indexed,InfuraProvider:InfuraProvider,InfuraWebSocketProvider:InfuraWebSocketProvider,Interface:Interface,IpcSocketProvider:IpcSocketProvider,JsonRpcApiProvider:JsonRpcApiProvider,JsonRpcProvider:JsonRpcProvider,JsonRpcSigner:JsonRpcSigner,LangEn:LangEn,Log:Log,LogDescription:LogDescription,MaxInt256:MaxInt256,MaxUint256:MaxUint256,MessagePrefix:MessagePrefix,MinInt256:MinInt256,Mnemonic:Mnemonic,N:N,NamedFragment:NamedFragment,Network:Network,NetworkPlugin:NetworkPlugin,NonceManager:NonceManager,OrePerXCB:OrePerXCB,ParamType:ParamType,PocketProvider:PocketProvider,QuickNodeProvider:QuickNodeProvider,Result:Result,Signature:Signature,SigningKey:SigningKey,SocketBlockSubscriber:SocketBlockSubscriber,SocketEventSubscriber:SocketEventSubscriber,SocketPendingSubscriber:SocketPendingSubscriber,SocketProvider:SocketProvider,SocketSubscriber:SocketSubscriber,StructFragment:StructFragment,Transaction:Transaction,TransactionDescription:TransactionDescription,TransactionReceipt:TransactionReceipt,TransactionResponse:TransactionResponse,Typed:Typed,TypedDataEncoder:TypedDataEncoder,UnmanagedSubscriber:UnmanagedSubscriber,Utf8ErrorFuncs:Utf8ErrorFuncs,VoidSigner:VoidSigner,Wallet:Wallet,WebSocketProvider:WebSocketProvider,Wordlist:Wordlist,WordlistOwl:WordlistOwl,WordlistOwlA:WordlistOwlA,ZeroAddress:ZeroAddress,ZeroHash:ZeroHash,accessListify:accessListify,arrayify:arrayify,assert:assert,assertArgument:assertArgument,assertArgumentCount:assertArgumentCount,assertNormalize:assertNormalize,assertPrivate:assertPrivate,checkResultErrors:checkResultErrors,computeAddress:computeAddress,computeHmac:computeHmac,concat:concat,copyRequest:copyRequest,dataLength:dataLength,dataSlice:dataSlice,decodeBase58:decodeBase58,decodeBase64:decodeBase64,decodeBytes32String:decodeBytes32String,decodeRlp:decodeRlp,decryptCrowdsaleJson:decryptCrowdsaleJson,decryptKeystoreJson:decryptKeystoreJson,decryptKeystoreJsonSync:decryptKeystoreJsonSync,defaultPath:defaultPath,defineProperties:defineProperties,encodeBase58:encodeBase58,encodeBase64:encodeBase64,encodeBytes32String:encodeBytes32String,encodeRlp:encodeRlp,encryptKeystoreJson:encryptKeystoreJson,encryptKeystoreJsonSync:encryptKeystoreJsonSync,formatUnits:formatUnits,formatXCB:formatXCB,fromTwos:fromTwos,getAccountPath:getAccountPath,getAddress:getAddress,getBigInt:getBigInt,getBytes:getBytes,getBytesCopy:getBytesCopy,getCreate2Address:getCreate2Address,getCreateAddress:getCreateAddress,getDefaultProvider:getDefaultProvider,getIndexedAccountPath:getIndexedAccountPath,getNumber:getNumber,getUint:getUint,hashMessage:hashMessage,hexConcat:hexConcat,hexlify:hexlify,id:id,isAddress:isAddress,isAddressable:isAddressable,isBytesLike:isBytesLike,isCallException:isCallException,isCrowdsaleJson:isCrowdsaleJson,isError:isError,isHexString:isHexString,isKeystoreJson:isKeystoreJson,keccak256:keccak256,lock:lock,makeError:makeError,mask:mask,networkIdToPrefix:networkIdToPrefix,parseUnits:parseUnits,parseXCB:parseXCB,pbkdf2:pbkdf2,publicToAddress:publicToAddress,randomBytes:randomBytes,recoverAddress:recoverAddress,resolveAddress:resolveAddress,resolveProperties:resolveProperties,ripemd160:ripemd160,scrypt:scrypt,scryptSync:scryptSync,sha256:sha256,sha512:sha512,showThrottleMessage:showThrottleMessage,solidityPacked:solidityPacked,solidityPackedSha256:solidityPackedSha256,stripZerosLeft:stripZerosLeft,toBeArray:toBeArray,toBeHex:toBeHex,toBigInt:toBigInt,toNumber:toNumber,toQuantity:toQuantity,toTwos:toTwos,toUtf8Bytes:toUtf8Bytes,toUtf8CodePoints:toUtf8CodePoints,toUtf8String:toUtf8String,uuidV4:uuidV4,verifyMessage:verifyMessage,verifyTypedData:verifyTypedData,version:version,wordlists:wordlists,zeroPadBytes:zeroPadBytes,zeroPadValue:zeroPadValue});export{AbiCoder,AbstractProvider,AbstractSigner,AlchemyProvider,AnkrProvider,BaseContract,BaseWallet,BigNumber,Block,BrowserProvider,CloudflareProvider,ConstructorFragment,Contract,ContractEventPayload,ContractFactory,ContractTransactionReceipt,ContractTransactionResponse,ContractUnknownEventPayload,CoreSymbol,Ed448Goldilock,EnergyCostPlugin,ErrorDescription,ErrorFragment,EventFragment,EventLog,EventPayload,FallbackFragment,FallbackProvider,FeeData,FeeDataNetworkPlugin,FetchCancelSignal,FetchRequest,FetchResponse,FixedNumber,Fragment,FunctionFragment,HDNodeWallet,Indexed,InfuraProvider,InfuraWebSocketProvider,Interface,IpcSocketProvider,JsonRpcApiProvider,JsonRpcProvider,JsonRpcSigner,LangEn,Log,LogDescription,MaxInt256,MaxUint256,MessagePrefix,MinInt256,Mnemonic,N,NamedFragment,Network,NetworkPlugin,NonceManager,OrePerXCB,ParamType,PocketProvider,QuickNodeProvider,Result,Signature,SigningKey,SocketBlockSubscriber,SocketEventSubscriber,SocketPendingSubscriber,SocketProvider,SocketSubscriber,StructFragment,Transaction,TransactionDescription,TransactionReceipt,TransactionResponse,Typed,TypedDataEncoder,UnmanagedSubscriber,Utf8ErrorFuncs,VoidSigner,Wallet,WebSocketProvider,Wordlist,WordlistOwl,WordlistOwlA,ZeroAddress,ZeroHash,accessListify,arrayify,assert,assertArgument,assertArgumentCount,assertNormalize,assertPrivate,checkResultErrors,computeAddress,computeHmac,concat,copyRequest,corebc,dataLength,dataSlice,decodeBase58,decodeBase64,decodeBytes32String,decodeRlp,decryptCrowdsaleJson,decryptKeystoreJson,decryptKeystoreJsonSync,defaultPath,defineProperties,encodeBase58,encodeBase64,encodeBytes32String,encodeRlp,encryptKeystoreJson,encryptKeystoreJsonSync,formatUnits,formatXCB,fromTwos,getAccountPath,getAddress,getBigInt,getBytes,getBytesCopy,getCreate2Address,getCreateAddress,getDefaultProvider,getIndexedAccountPath,getNumber,getUint,hashMessage,hexConcat,hexlify,id,isAddress,isAddressable,isBytesLike,isCallException,isCrowdsaleJson,isError,isHexString,isKeystoreJson,keccak256,lock,makeError,mask,networkIdToPrefix,parseUnits,parseXCB,pbkdf2,publicToAddress,randomBytes,recoverAddress,resolveAddress,resolveProperties,ripemd160,scrypt,scryptSync,sha256,sha512,showThrottleMessage,solidityPacked,solidityPackedSha256,stripZerosLeft,toBeArray,toBeHex,toBigInt,toNumber,toQuantity,toTwos,toUtf8Bytes,toUtf8CodePoints,toUtf8String,uuidV4,verifyMessage,verifyTypedData,version,wordlists,zeroPadBytes,zeroPadValue}; \ No newline at end of file +const __$G=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x}function getAugmentedNamespace(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var f=n.default;if(typeof f=="function"){var a=function a(){var isInstance=false;try{isInstance=this instanceof a}catch(e){}if(isInstance){return Reflect.construct(f,arguments,this.constructor)}return f.apply(this,arguments)};a.prototype=f.prototype}else a={};Object.defineProperty(a,"__esModule",{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k]}})});return a}var buffer={};var base64Js={};var hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1;base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){if(hasRequiredIeee754)return ieee754;hasRequiredIeee754=1;ieee754.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};ieee754.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128};return ieee754}var hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;(function(exports){const base64=requireBase64Js();const ieee754=requireIeee754();const customInspectSymbol=typeof Symbol==="function"&&typeof Symbol["for"]==="function"?Symbol["for"]("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;const K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{const arr=new Uint8Array(1);const proto={foo:function(){return 42}};Object.setPrototypeOf(proto,Uint8Array.prototype);Object.setPrototypeOf(arr,proto);return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}const buf=new Uint8Array(length);Object.setPrototypeOf(buf,Buffer.prototype);return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayView(value)}if(value==null){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof SharedArrayBuffer!=="undefined"&&(isInstance(value,SharedArrayBuffer)||value&&isInstance(value.buffer,SharedArrayBuffer))){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}const valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}const b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}const length=byteLength(string,encoding)|0;let buf=createBuffer(length);const actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){const length=array.length<0?0:checked(array.length)|0;const buf=createBuffer(length);for(let i=0;i=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;let x=a.length;let y=b.length;for(let i=0,len=Math.min(x,y);ibuffer.length){if(!Buffer.isBuffer(buf))buf=Buffer.from(buf);buf.copy(buffer,pos)}else{Uint8Array.prototype.set.call(buffer,buf,pos)}}else if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}else{buf.copy(buffer,pos)}pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(ArrayBuffer.isView(string)||isInstance(string,ArrayBuffer)){return string.byteLength}if(typeof string!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof string)}const len=string.length;const mustMatch=arguments.length>2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;let loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){let loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){const i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){const len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(let i=0;imax)str+=" ... ";return""};if(customInspectSymbol){Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect}Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;let x=thisEnd-thisStart;let y=end-start;const len=Math.min(x,y);const thisCopy=this.slice(thisStart,thisEnd);const targetCopy=target.slice(start,end);for(let i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){let indexSize=1;let arrLength=arr.length;let valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}let i;if(dir){let foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){let found=true;for(let j=0;jremaining){length=remaining}}const strLen=string.length;if(length>strLen/2){length=strLen/2}let i;for(i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}const remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";let loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":case"latin1":case"binary":return asciiWrite(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);const res=[];let i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){let secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}const MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){const len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}let res="";let i=0;while(ilen)end=len;let out="";for(let i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}let val=this[offset+--byteLength];let mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readBigUInt64LE=defineBigIntMethod(function readBigUInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const lo=first+this[++offset]*2**8+this[++offset]*2**16+this[++offset]*2**24;const hi=this[++offset]+this[++offset]*2**8+this[++offset]*2**16+last*2**24;return BigInt(lo)+(BigInt(hi)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const hi=first*2**24+this[++offset]*2**16+this[++offset]*2**8+this[++offset];const lo=this[++offset]*2**24+this[++offset]*2**16+this[++offset]*2**8+last;return(BigInt(hi)<>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let i=byteLength;let mul=1;let val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readBigInt64LE=defineBigIntMethod(function readBigInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=this[offset+4]+this[offset+5]*2**8+this[offset+6]*2**16+(last<<24);return(BigInt(val)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=(first<<24)+this[++offset]*2**16+this[++offset]*2**8+this[++offset];return(BigInt(val)<>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let mul=1;let i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let i=byteLength-1;let mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function wrtBigUInt64LE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;return offset}function wrtBigUInt64BE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset+7]=lo;lo=lo>>8;buf[offset+6]=lo;lo=lo>>8;buf[offset+5]=lo;lo=lo>>8;buf[offset+4]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset+3]=hi;hi=hi>>8;buf[offset+2]=hi;hi=hi>>8;buf[offset+1]=hi;hi=hi>>8;buf[offset]=hi;return offset+8}Buffer.prototype.writeBigUInt64LE=defineBigIntMethod(function writeBigUInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeBigUInt64BE=defineBigIntMethod(function writeBigUInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=0;let mul=1;let sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=byteLength-1;let mul=1;let sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeBigInt64LE=defineBigIntMethod(function writeBigInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Buffer.prototype.writeBigInt64BE=defineBigIntMethod(function writeBigInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;let i;if(typeof val==="number"){for(i=start;i2**32){received=addNumericalSeparator(String(input))}else if(typeof input==="bigint"){received=String(input);if(input>BigInt(2)**BigInt(32)||input<-(BigInt(2)**BigInt(32))){received=addNumericalSeparator(received)}received+="n"}msg+=` It must be ${range}. Received ${received}`;return msg},RangeError);function addNumericalSeparator(val){let res="";let i=val.length;const start=val[0]==="-"?1:0;for(;i>=start+4;i-=3){res=`_${val.slice(i-3,i)}${res}`}return`${val.slice(0,i)}${res}`}function checkBounds(buf,offset,byteLength){validateNumber(offset,"offset");if(buf[offset]===undefined||buf[offset+byteLength]===undefined){boundsError(offset,buf.length-(byteLength+1))}}function checkIntBI(value,min,max,buf,offset,byteLength){if(value>max||value= 0${n} and < 2${n} ** ${(byteLength+1)*8}${n}`}else{range=`>= -(2${n} ** ${(byteLength+1)*8-1}${n}) and < 2 ** `+`${(byteLength+1)*8-1}${n}`}}throw new errors.ERR_OUT_OF_RANGE("value",range,value)}checkBounds(buf,offset,byteLength)}function validateNumber(value,name){if(typeof value!=="number"){throw new errors.ERR_INVALID_ARG_TYPE(name,"number",value)}}function boundsError(value,length,type){if(Math.floor(value)!==value){validateNumber(value,type);throw new errors.ERR_OUT_OF_RANGE("offset","an integer",value)}if(length<0){throw new errors.ERR_BUFFER_OUT_OF_BOUNDS}throw new errors.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${length}`,value)}const INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(str){str=str.split("=")[0];str=str.trim().replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function utf8ToBytes(string,units){units=units||Infinity;let codePoint;const length=string.length;let leadSurrogate=null;const bytes=[];for(let i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){const byteArray=[];for(let i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){let i;for(i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}const hexSliceLookupTable=function(){const alphabet="0123456789abcdef";const table=new Array(256);for(let i=0;i<16;++i){const i16=i*16;for(let j=0;j<16;++j){table[i16+j]=alphabet[i]+alphabet[j]}}return table}();function defineBigIntMethod(fn){return typeof BigInt==="undefined"?BufferBigIntNotDefined:fn}function BufferBigIntNotDefined(){throw new Error("BigInt not supported")}})(buffer);return buffer}var bufferExports=requireBuffer();const version="0.4.1";var bn$2={exports:{}};var _nodeResolve_empty={};var _nodeResolve_empty$1=Object.freeze({__proto__:null,default:_nodeResolve_empty});var require$$0=getAugmentedNamespace(_nodeResolve_empty$1);var bn$1=bn$2.exports;var hasRequiredBn$1;function requireBn$1(){if(hasRequiredBn$1)return bn$2.exports;hasRequiredBn$1=1;(function(module){(function(module,exports){function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number)){return number}this.negative=0;this.words=null;this.length=0;this.red=null;if(number!==null){if(base==="le"||base==="be"){endian=base;base=10}this._init(number||0,base||10,endian||"be")}}if(typeof module==="object"){module.exports=BN}else{exports.BN=BN}BN.BN=BN;BN.wordSize=26;var Buffer;try{if(typeof window!=="undefined"&&typeof window.Buffer!=="undefined"){Buffer=window.Buffer}else{Buffer=require$$0.Buffer}}catch(e){}BN.isBN=function isBN(num){if(num instanceof BN){return true}return num!==null&&typeof num==="object"&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)};BN.max=function max(left,right){if(left.cmp(right)>0)return left;return right};BN.min=function min(left,right){if(left.cmp(right)<0)return left;return right};BN.prototype._init=function init(number,base,endian){if(typeof number==="number"){return this._initNumber(number,base,endian)}if(typeof number==="object"){return this._initArray(number,base,endian)}if(base==="hex"){base=16}assert(base===(base|0)&&base>=2&&base<=36);number=number.toString().replace(/\s+/g,"");var start=0;if(number[0]==="-"){start++;this.negative=1}if(start=0;i-=3){w=number[i]|number[i-1]<<8|number[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}else if(endian==="le"){for(i=0,j=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}return this._strip()};function parseHex4Bits(string,index){var c=string.charCodeAt(index);if(c>=48&&c<=57){return c-48}else if(c>=65&&c<=70){return c-55}else if(c>=97&&c<=102){return c-87}else{assert(false,"Invalid character in "+string)}}function parseHexByte(string,lowerBound,index){var r=parseHex4Bits(string,index);if(index-1>=lowerBound){r|=parseHex4Bits(string,index-1)<<4}return r}BN.prototype._parseHex=function _parseHex(number,start,endian){this.length=Math.ceil((number.length-start)/6);this.words=new Array(this.length);for(var i=0;i=start;i-=2){w=parseHexByte(number,start,i)<=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}else{var parseLength=number.length-start;for(i=parseLength%2===0?start+1:start;i=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}this._strip()};function parseBase(str,start,end,mul){var r=0;var b=0;var len=Math.min(str.length,end);for(var i=start;i=49){b=c-49+10}else if(c>=17){b=c-17+10}else{b=c}assert(c>=0&&b1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};if(typeof Symbol!=="undefined"&&typeof Symbol.for==="function"){try{BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}catch(e){BN.prototype.inspect=inspect}}else{BN.prototype.inspect=inspect}function inspect(){return(this.red?""}var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(base,padding){base=base||10;padding=padding|0||1;var out;if(base===16||base==="hex"){out="";var off=0;var carry=0;for(var i=0;i>>24-off&16777215;off+=2;if(off>=26){off-=26;i--}if(carry!==0||i!==this.length-1){out=zeros[6-word.length]+word+out}else{out=word+out}}if(carry!==0){out=carry.toString(16)+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}if(base===(base|0)&&base>=2&&base<=36){var groupSize=groupSizes[base];var groupBase=groupBases[base];out="";var c=this.clone();c.negative=0;while(!c.isZero()){var r=c.modrn(groupBase).toString(base);c=c.idivn(groupBase);if(!c.isZero()){out=zeros[groupSize-r.length]+r+out}else{out=r+out}}if(this.isZero()){out="0"+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var ret=this.words[0];if(this.length===2){ret+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){ret+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-ret:ret};BN.prototype.toJSON=function toJSON(){return this.toString(16,2)};if(Buffer){BN.prototype.toBuffer=function toBuffer(endian,length){return this.toArrayLike(Buffer,endian,length)}}BN.prototype.toArray=function toArray(endian,length){return this.toArrayLike(Array,endian,length)};var allocate=function allocate(ArrayType,size){if(ArrayType.allocUnsafe){return ArrayType.allocUnsafe(size)}return new ArrayType(size)};BN.prototype.toArrayLike=function toArrayLike(ArrayType,endian,length){this._strip();var byteLength=this.byteLength();var reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length");assert(reqLength>0,"Requested array length <= 0");var res=allocate(ArrayType,reqLength);var postfix=endian==="le"?"LE":"BE";this["_toArrayLike"+postfix](res,byteLength);return res};BN.prototype._toArrayLikeLE=function _toArrayLikeLE(res,byteLength){var position=0;var carry=0;for(var i=0,shift=0;i>8&255}if(position>16&255}if(shift===6){if(position>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position=0){res[position--]=word>>8&255}if(position>=0){res[position--]=word>>16&255}if(shift===6){if(position>=0){res[position--]=word>>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position>=0){res[position--]=carry;while(position>=0){res[position--]=0}}};if(Math.clz32){BN.prototype._countBits=function _countBits(w){return 32-Math.clz32(w)}}else{BN.prototype._countBits=function _countBits(w){var t=w;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(w){if(w===0)return 26;var t=w;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var w=this.words[this.length-1];var hi=this._countBits(w);return(this.length-1)*26+hi};function toBitArray(num){var w=new Array(num.bitLength());for(var bit=0;bit>>wbit&1}return w}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var r=0;for(var i=0;inum.length)return this.clone().ior(num);return num.clone().ior(this)};BN.prototype.uor=function uor(num){if(this.length>num.length)return this.clone().iuor(num);return num.clone().iuor(this)};BN.prototype.iuand=function iuand(num){var b;if(this.length>num.length){b=num}else{b=this}for(var i=0;inum.length)return this.clone().iand(num);return num.clone().iand(this)};BN.prototype.uand=function uand(num){if(this.length>num.length)return this.clone().iuand(num);return num.clone().iuand(this)};BN.prototype.iuxor=function iuxor(num){var a;var b;if(this.length>num.length){a=this;b=num}else{a=num;b=this}for(var i=0;inum.length)return this.clone().ixor(num);return num.clone().ixor(this)};BN.prototype.uxor=function uxor(num){if(this.length>num.length)return this.clone().iuxor(num);return num.clone().iuxor(this)};BN.prototype.inotn=function inotn(width){assert(typeof width==="number"&&width>=0);var bytesNeeded=Math.ceil(width/26)|0;var bitsLeft=width%26;this._expand(bytesNeeded);if(bitsLeft>0){bytesNeeded--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-bitsLeft;i++}for(;i=0);var off=bit/26|0;var wbit=bit%26;this._expand(off+1);if(val){this.words[off]=this.words[off]|1<num.length){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this.words[this.length]=carry;this.length++}else if(a!==this){for(;inum.length)return this.clone().iadd(num);return num.clone().iadd(this)};BN.prototype.isub=function isub(num){if(num.negative!==0){num.negative=0;var r=this.iadd(num);num.negative=1;return r._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(num);this.negative=1;return this._normSign()}var cmp=this.cmp(num);if(cmp===0){this.negative=0;this.length=1;this.words[0]=0;return this}var a,b;if(cmp>0){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}if(carry===0&&i>>26;var rword=carry&67108863;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=self.words[i]|0;b=num.words[j]|0;r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0){out.words[k]=carry|0}else{out.length--}return out._strip()}var comb10MulTo=function comb10MulTo(self,num,out){var a=self.words;var b=num.words;var o=out.words;var c=0;var lo;var mid;var hi;var a0=a[0]|0;var al0=a0&8191;var ah0=a0>>>13;var a1=a[1]|0;var al1=a1&8191;var ah1=a1>>>13;var a2=a[2]|0;var al2=a2&8191;var ah2=a2>>>13;var a3=a[3]|0;var al3=a3&8191;var ah3=a3>>>13;var a4=a[4]|0;var al4=a4&8191;var ah4=a4>>>13;var a5=a[5]|0;var al5=a5&8191;var ah5=a5>>>13;var a6=a[6]|0;var al6=a6&8191;var ah6=a6>>>13;var a7=a[7]|0;var al7=a7&8191;var ah7=a7>>>13;var a8=a[8]|0;var al8=a8&8191;var ah8=a8>>>13;var a9=a[9]|0;var al9=a9&8191;var ah9=a9>>>13;var b0=b[0]|0;var bl0=b0&8191;var bh0=b0>>>13;var b1=b[1]|0;var bl1=b1&8191;var bh1=b1>>>13;var b2=b[2]|0;var bl2=b2&8191;var bh2=b2>>>13;var b3=b[3]|0;var bl3=b3&8191;var bh3=b3>>>13;var b4=b[4]|0;var bl4=b4&8191;var bh4=b4>>>13;var b5=b[5]|0;var bl5=b5&8191;var bh5=b5>>>13;var b6=b[6]|0;var bl6=b6&8191;var bh6=b6>>>13;var b7=b[7]|0;var bl7=b7&8191;var bh7=b7>>>13;var b8=b[8]|0;var bl8=b8&8191;var bh8=b8>>>13;var b9=b[9]|0;var bl9=b9&8191;var bh9=b9>>>13;out.negative=self.negative^num.negative;out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length++}return out};if(!Math.imul){comb10MulTo=smallMulTo}function bigMulTo(self,num,out){out.negative=num.negative^self.negative;out.length=self.length+num.length;var carry=0;var hncarry=0;for(var k=0;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0){out.words[k]=carry}else{out.length--}return out._strip()}function jumboMulTo(self,num,out){return bigMulTo(self,num,out)}BN.prototype.mulTo=function mulTo(num,out){var res;var len=this.length+num.length;if(this.length===10&&num.length===10){res=comb10MulTo(this,num,out)}else if(len<63){res=smallMulTo(this,num,out)}else if(len<1024){res=bigMulTo(this,num,out)}else{res=jumboMulTo(this,num,out)}return res};BN.prototype.mul=function mul(num){var out=new BN(null);out.words=new Array(this.length+num.length);return this.mulTo(num,out)};BN.prototype.mulf=function mulf(num){var out=new BN(null);out.words=new Array(this.length+num.length);return jumboMulTo(this,num,out)};BN.prototype.imul=function imul(num){return this.clone().mulTo(num,this)};BN.prototype.imuln=function imuln(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(typeof num==="number");assert(num<67108864);var carry=0;for(var i=0;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}if(carry!==0){this.words[i]=carry;this.length++}if(num===0){this.length=1;this._normSign()}return isNegNum?this.ineg():this};BN.prototype.muln=function muln(num){return this.clone().imuln(num)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(num){var w=toBitArray(num);if(w.length===0)return new BN(1);var res=this;for(var i=0;i=0);var r=bits%26;var s=(bits-r)/26;var carryMask=67108863>>>26-r<<26-r;var i;if(r!==0){var carry=0;for(i=0;i>>26-r}if(carry){this.words[i]=carry;this.length++}}if(s!==0){for(i=this.length-1;i>=0;i--){this.words[i+s]=this.words[i]}for(i=0;i=0);var h;if(hint){h=(hint-hint%26)/26}else{h=0}var r=bits%26;var s=Math.min((bits-r)/26,this.length);var mask=67108863^67108863>>>r<s){this.length-=s;for(i=0;i=0&&(carry!==0||i>=h);i--){var word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}if(maskedWords&&carry!==0){maskedWords.words[maskedWords.length++]=carry}if(this.length===0){this.words[0]=0;this.length=1}return this._strip()};BN.prototype.ishrn=function ishrn(bits,hint,extended){assert(this.negative===0);return this.iushrn(bits,hint,extended)};BN.prototype.shln=function shln(bits){return this.clone().ishln(bits)};BN.prototype.ushln=function ushln(bits){return this.clone().iushln(bits)};BN.prototype.shrn=function shrn(bits){return this.clone().ishrn(bits)};BN.prototype.ushrn=function ushrn(bits){return this.clone().iushrn(bits)};BN.prototype.testn=function testn(bit){assert(typeof bit==="number"&&bit>=0);var r=bit%26;var s=(bit-r)/26;var q=1<=0);var r=bits%26;var s=(bits-r)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=s){return this}if(r!==0){s++}this.length=Math.min(s,this.length);if(r!==0){var mask=67108863^67108863>>>r<=67108864;i++){this.words[i]-=67108864;if(i===this.length-1){this.words[i+1]=1}else{this.words[i+1]++}}this.length=Math.max(this.length,i+1);return this};BN.prototype.isubn=function isubn(num){assert(typeof num==="number");assert(num<67108864);if(num<0)return this.iaddn(-num);if(this.negative!==0){this.negative=0;this.iaddn(num);this.negative=1;return this}this.words[0]-=num;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var i=0;i>26)-(right/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this._strip();assert(carry===-1);carry=0;for(i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this._strip()};BN.prototype._wordDiv=function _wordDiv(num,mode){var shift=this.length-num.length;var a=this.clone();var b=num;var bhi=b.words[b.length-1]|0;var bhiBits=this._countBits(bhi);shift=26-bhiBits;if(shift!==0){b=b.ushln(shift);a.iushln(shift);bhi=b.words[b.length-1]|0}var m=a.length-b.length;var q;if(mode!=="mod"){q=new BN(null);q.length=m+1;q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=(a.words[b.length+j]|0)*67108864+(a.words[b.length+j-1]|0);qj=Math.min(qj/bhi|0,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj--;a.negative=0;a._ishlnsubmul(b,1,j);if(!a.isZero()){a.negative^=1}}if(q){q.words[j]=qj}}if(q){q._strip()}a._strip();if(mode!=="div"&&shift!==0){a.iushrn(shift)}return{div:q||null,mod:a}};BN.prototype.divmod=function divmod(num,mode,positive){assert(!num.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var div,mod,res;if(this.negative!==0&&num.negative===0){res=this.neg().divmod(num,mode);if(mode!=="mod"){div=res.div.neg()}if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.iadd(num)}}return{div:div,mod:mod}}if(this.negative===0&&num.negative!==0){res=this.divmod(num.neg(),mode);if(mode!=="mod"){div=res.div.neg()}return{div:div,mod:res.mod}}if((this.negative&num.negative)!==0){res=this.neg().divmod(num.neg(),mode);if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.isub(num)}}return{div:res.div,mod:mod}}if(num.length>this.length||this.cmp(num)<0){return{div:new BN(0),mod:this}}if(num.length===1){if(mode==="div"){return{div:this.divn(num.words[0]),mod:null}}if(mode==="mod"){return{div:null,mod:new BN(this.modrn(num.words[0]))}}return{div:this.divn(num.words[0]),mod:new BN(this.modrn(num.words[0]))}}return this._wordDiv(num,mode)};BN.prototype.div=function div(num){return this.divmod(num,"div",false).div};BN.prototype.mod=function mod(num){return this.divmod(num,"mod",false).mod};BN.prototype.umod=function umod(num){return this.divmod(num,"mod",true).mod};BN.prototype.divRound=function divRound(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=dm.mod.abs();var half=num.abs().iushrn(1);var r2=num.words[0]&1;var cmp=mod.cmp(half);if(cmp<0||r2===1&&cmp===0)return dm.div;var up=new BN(1);up.negative=this.negative^num.negative;return dm.div.iadd(up)};BN.prototype.modrn=function modrn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var p=(1<<26)%num;var acc=0;for(var i=this.length-1;i>=0;i--){acc=(p*acc+(this.words[i]|0))%num}return isNegNum?-acc:acc};BN.prototype.modn=function modn(num){return this.modrn(num)};BN.prototype.idivn=function idivn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var carry=0;for(var i=this.length-1;i>=0;i--){var w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}this._strip();return isNegNum?this.ineg():this};BN.prototype.divn=function divn(num){return this.clone().idivn(num)};BN.prototype.egcd=function egcd(p){assert(p.negative===0);assert(!p.isZero());var x=this;var y=p.clone();if(x.negative!==0){x=x.umod(p)}else{x=x.clone()}var A=new BN(1);var B=new BN(0);var C=new BN(0);var D=new BN(1);var g=0;while(x.isEven()&&y.isEven()){x.iushrn(1);y.iushrn(1);++g}var yp=y.clone();var xp=x.clone();while(!x.isZero()){for(var i=0,im=1;(x.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){x.iushrn(i);while(i-- >0){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}}for(var j=0,jm=1;(y.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){y.iushrn(j);while(j-- >0){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}return{a:C,b:D,gcd:y.iushln(g)}};BN.prototype._invmp=function _invmp(p){assert(p.negative===0);assert(!p.isZero());var a=this;var b=p.clone();if(a.negative!==0){a=a.umod(p)}else{a=a.clone()}var x1=new BN(1);var x2=new BN(0);var delta=b.clone();while(a.cmpn(1)>0&&b.cmpn(1)>0){for(var i=0,im=1;(a.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){a.iushrn(i);while(i-- >0){if(x1.isOdd()){x1.iadd(delta)}x1.iushrn(1)}}for(var j=0,jm=1;(b.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){b.iushrn(j);while(j-- >0){if(x2.isOdd()){x2.iadd(delta)}x2.iushrn(1)}}if(a.cmp(b)>=0){a.isub(b);x1.isub(x2)}else{b.isub(a);x2.isub(x1)}}var res;if(a.cmpn(1)===0){res=x1}else{res=x2}if(res.cmpn(0)<0){res.iadd(p)}return res};BN.prototype.gcd=function gcd(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone();var b=num.clone();a.negative=0;b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++){a.iushrn(1);b.iushrn(1)}do{while(a.isEven()){a.iushrn(1)}while(b.isEven()){b.iushrn(1)}var r=a.cmp(b);if(r<0){var t=a;a=b;b=t}else if(r===0||b.cmpn(1)===0){break}a.isub(b)}while(true);return b.iushln(shift)};BN.prototype.invm=function invm(num){return this.egcd(num).a.umod(num)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(num){return this.words[0]&num};BN.prototype.bincn=function bincn(bit){assert(typeof bit==="number");var r=bit%26;var s=(bit-r)/26;var q=1<>>26;w&=67108863;this.words[i]=w}if(carry!==0){this.words[i]=carry;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(num){var negative=num<0;if(this.negative!==0&&!negative)return-1;if(this.negative===0&&negative)return 1;this._strip();var res;if(this.length>1){res=1}else{if(negative){num=-num}assert(num<=67108863,"Number is too big");var w=this.words[0]|0;res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=this.words[i]|0;var b=num.words[i]|0;if(a===b)continue;if(ab){res=1}break}return res};BN.prototype.gtn=function gtn(num){return this.cmpn(num)===1};BN.prototype.gt=function gt(num){return this.cmp(num)===1};BN.prototype.gten=function gten(num){return this.cmpn(num)>=0};BN.prototype.gte=function gte(num){return this.cmp(num)>=0};BN.prototype.ltn=function ltn(num){return this.cmpn(num)===-1};BN.prototype.lt=function lt(num){return this.cmp(num)===-1};BN.prototype.lten=function lten(num){return this.cmpn(num)<=0};BN.prototype.lte=function lte(num){return this.cmp(num)<=0};BN.prototype.eqn=function eqn(num){return this.cmpn(num)===0};BN.prototype.eq=function eq(num){return this.cmp(num)===0};BN.red=function red(num){return new Red(num)};BN.prototype.toRed=function toRed(ctx){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return ctx.convertTo(this)._forceRed(ctx)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(ctx){this.red=ctx;return this};BN.prototype.forceRed=function forceRed(ctx){assert(!this.red,"Already a number in reduction context");return this._forceRed(ctx)};BN.prototype.redAdd=function redAdd(num){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,num)};BN.prototype.redIAdd=function redIAdd(num){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,num)};BN.prototype.redSub=function redSub(num){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,num)};BN.prototype.redISub=function redISub(num){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,num)};BN.prototype.redShl=function redShl(num){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,num)};BN.prototype.redMul=function redMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.mul(this,num)};BN.prototype.redIMul=function redIMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.imul(this,num)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(num){assert(this.red&&!num.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};function MPrime(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var tmp=new BN(null);tmp.words=new Array(Math.ceil(this.n/13));return tmp};MPrime.prototype.ireduce=function ireduce(num){var r=num;var rlen;do{this.split(r,this.tmp);r=this.imulK(r);r=r.iadd(this.tmp);rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0){r.isub(this.p)}else{if(r.strip!==undefined){r.strip()}else{r._strip()}}return r};MPrime.prototype.split=function split(input,out){input.iushrn(this.n,0,out)};MPrime.prototype.imulK=function imulK(num){return num.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(input,output){var mask=4194303;var outLen=Math.min(input.length,9);for(var i=0;i>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10){input.length-=10}else{input.length-=9}};K256.prototype.imulK=function imulK(num){num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;var lo=0;for(var i=0;i>>=26;num.words[i]=lo;carry=hi}if(carry!==0){num.words[num.length++]=carry}return num};BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if(name==="k256"){prime=new K256}else if(name==="p224"){prime=new P224}else if(name==="p192"){prime=new P192}else if(name==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+name)}primes[name]=prime;return prime};function Red(m){if(typeof m==="string"){var prime=BN._prime(m);this.m=prime.p;this.prime=prime}else{assert(m.gtn(1),"modulus must be greater than 1");this.m=m;this.prime=null}}Red.prototype._verify1=function _verify1(a){assert(a.negative===0,"red works only with positives");assert(a.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(a,b){assert((a.negative|b.negative)===0,"red works only with positives");assert(a.red&&a.red===b.red,"red works only with red numbers")};Red.prototype.imod=function imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);move(a,a.umod(this.m)._forceRed(this));return a};Red.prototype.neg=function neg(a){if(a.isZero()){return a.clone()}return this.m.sub(a)._forceRed(this)};Red.prototype.add=function add(a,b){this._verify2(a,b);var res=a.add(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res._forceRed(this)};Red.prototype.iadd=function iadd(a,b){this._verify2(a,b);var res=a.iadd(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res};Red.prototype.sub=function sub(a,b){this._verify2(a,b);var res=a.sub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res._forceRed(this)};Red.prototype.isub=function isub(a,b){this._verify2(a,b);var res=a.isub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res};Red.prototype.shl=function shl(a,num){this._verify1(a);return this.imod(a.ushln(num))};Red.prototype.imul=function imul(a,b){this._verify2(a,b);return this.imod(a.imul(b))};Red.prototype.mul=function mul(a,b){this._verify2(a,b);return this.imod(a.mul(b))};Red.prototype.isqr=function isqr(a){return this.imul(a,a.clone())};Red.prototype.sqr=function sqr(a){return this.mul(a,a)};Red.prototype.sqrt=function sqrt(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);assert(mod3%2===1);if(mod3===3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}var q=this.m.subn(1);var s=0;while(!q.isZero()&&q.andln(1)===0){s++;q.iushrn(1)}assert(!q.isZero());var one=new BN(1).toRed(this);var nOne=one.redNeg();var lpow=this.m.subn(1).iushrn(1);var z=this.m.bitLength();z=new BN(2*z*z).toRed(this);while(this.pow(z,lpow).cmp(nOne)!==0){z.redIAdd(nOne)}var c=this.pow(z,q);var r=this.pow(a,q.addn(1).iushrn(1));var t=this.pow(a,q);var m=s;while(t.cmp(one)!==0){var tmp=t;for(var i=0;tmp.cmp(one)!==0;i++){tmp=tmp.redSqr()}assert(i=0;i--){var word=num.words[i];for(var j=start-1;j>=0;j--){var bit=word>>j&1;if(res!==wnd[0]){res=this.sqr(res)}if(bit===0&¤t===0){currentLen=0;continue}current<<=1;current|=bit;currentLen++;if(currentLen!==windowSize&&(i!==0||j!==0))continue;res=this.mul(res,wnd[current]);currentLen=0;current=0}start=26}return res};Red.prototype.convertTo=function convertTo(num){var r=num.umod(this.m);return r===num?r.clone():r};Red.prototype.convertFrom=function convertFrom(num){var res=num.clone();res.red=null;return res};BN.mont=function mont(num){return new Mont(num)};function Mont(m){Red.call(this,m);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(num){return this.imod(num.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(num){var r=this.imod(num.mul(this.rinv));r.red=null;return r};Mont.prototype.imul=function imul(a,b){if(a.isZero()||b.isZero()){a.words[0]=0;a.length=1;return a}var t=a.imul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.mul=function mul(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.invm=function invm(a){var res=this.imod(a._invmp(this.m).mul(this.r2));return res._forceRed(this)}})(module,bn$1)})(bn$2);return bn$2.exports}var bnExports=requireBn$1();var _BN=getDefaultExportFromCjs(bnExports);let _permanentCensorErrors=false;let _censorErrors=false;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels["default"];let _globalLogger=null;function _checkNormalize(){try{const missing=[];["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing.push(form)}});if(missing.length){throw new Error("missing "+missing.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"]="UNPREDICTABLE_ENERGY_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{version="0.0.1";static errors=ErrorCode;static levels=LogLevel;constructor(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}_log(logLevel,args){const level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)}debug(...args){this._log(Logger.levels.DEBUG,args)}info(...args){this._log(Logger.levels.INFO,args)}warn(...args){this._log(Logger.levels.WARNING,args)}makeError(message,code,params){if(_censorErrors){return this.makeError("censored error",code,{})}if(!code){code=Logger.errors.UNKNOWN_ERROR}if(!params){params={}}const messageDetails=[];Object.keys(params).forEach(key=>{const value=params[key];try{if(value instanceof Uint8Array){let hex="";for(let i=0;i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push(`code=${code}`);messageDetails.push(`version=${this.version}`);const reason=message;if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}const error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error}throwError(message,code,params){throw this.makeError(message,code,params)}throwArgumentError(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})}assert(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)}assertArgument(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)}checkNormalize(message){if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}}checkSafeUint53(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}}checkArgumentCount(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}}checkNew(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}checkAbstract(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}static globalLogger(){if(!_globalLogger){_globalLogger=new Logger("logger/0.0.1")}return _globalLogger}static setCensorship(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent}static setLogLevel(logLevel){const level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level}static from(version){return new Logger(version)}}const logger$7=new Logger("utils/properties/0.0.1");function checkType(value,type,name){const types=type.split("|").map(t=>t.trim());for(let i=0;iPromise.resolve(value[k])));return results.reduce((accum,v,index)=>{accum[keys[index]]=v;return accum},{})}function defineProperties(target,values,types){for(let key in values){let value=values[key];const type=types?types[key]:null;if(type){checkType(value,type,key)}Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function checkProperties(object,properties){if(!object||typeof object!=="object"){logger$7.throwArgumentError("invalid object","object",object)}Object.keys(object).forEach(key=>{if(!properties[key]){logger$7.throwArgumentError("invalid object key - "+key,"transaction:"+key,object)}})}function stringify$1(value){if(value==null){return"null"}if(Array.isArray(value)){return"[ "+value.map(stringify$1).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify$1(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"number":return value.toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function isError(error,code){return error&&error.code===code}function isCallException(error){return isError(error,"CALL_EXCEPTION")}function makeError(message,code,info){{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify$1(info)}`)}for(const key in info){const value=info[key];details.push(key+"="+stringify$1(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}function assertArgumentCount(count,expectedCount,message){if(message==null){message=""}if(message){message=": "+message}assert(count>=expectedCount,"missing arguemnt"+message,"MISSING_ARGUMENT",{count:count,expectedCount:expectedCount});assert(count<=expectedCount,"too many arguemnts"+message,"UNEXPECTED_ARGUMENT",{count:count,expectedCount:expectedCount})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function assertNormalize(form){assert(_normalizeForms.indexOf(form)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:form}})}function assertPrivate(givenGuard,guard,className){if(className==null){className=""}if(givenGuard!==guard){let method=className,operation="new";if(className){method+=".";operation+=" "+className}assert(false,`private constructor; use ${method}from* methods`,"UNSUPPORTED_OPERATION",{operation:operation})}}const logger$6=new Logger("utils/data/0.0.1");function isHexable(value){return!!value.toHexString}function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes$1(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(let i=0;i=256){return false}}return true}function _getBytes(value,name,copy){if(value instanceof Uint8Array){if(copy){return new Uint8Array(value)}return value}if(typeof value==="string"&&value.match(/^0x([0-9a-f][0-9a-f])*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;iNumber(item));value=new Uint8Array(v)}}if(typeof value==="number"){logger$6.checkSafeUint53(value,"invalid hexlify value");let hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger$6.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes$1(value)){let result="0x";for(let i=0;i>4]+HexCharacters[v&15]}return result}return logger$6.throwArgumentError("invalid hexlify value","value",value)}function concat(items){return"0x"+items.map(d=>hexlify(d).substring(2)).join("")}function hexDataSlice(data,offset,endOffset){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){logger$6.throwArgumentError("invalid hexData","value",data)}offset=2+2*offset;return"0x"+data.substring(offset)}function hexDataLength(data){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){return null}return(data.length-2)/2}function dataLength(data){if(isHexString(data,true)){return(data.length-2)/2}return getBytes(data).length}function dataSlice(data,start,end){const bytes=getBytes(data);if(end!=null&&end>bytes.length){assert(false,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:bytes,length:bytes.length,offset:end})}return hexlify(bytes.slice(start==null?0:start,end==null?bytes.length:end))}function stripZerosLeft(data){let bytes=hexlify(data).substring(2);while(bytes.startsWith("00")){bytes=bytes.substring(2)}return"0x"+bytes}function zeroPad(data,length,left){const bytes=getBytes(data);assert(length>=bytes.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(bytes),length:length,offset:length+1});const result=new Uint8Array(length);result.fill(0);if(left){result.set(bytes,length-bytes.length)}else{result.set(bytes,0)}return hexlify(result)}function zeroPadValue(data,length){return zeroPad(data,length,true)}function zeroPadBytes(data,length){return zeroPad(data,length,false)}function stripZeros(value){let result=arrayify(value);if(result.length===0){return result}let start=0;while(start{result+=hexlify(item).substring(2)});return result}var BN=_BN.BN;const logger$5=new Logger("bigNumber/0.0.1");const _constructorGuard={};const MAX_SAFE=9007199254740991;let _warnedToStringRadix=false;class BigNumber{_hex;_isBigNumber;constructor(constructorGuard,hex){logger$5.checkNew(new.target,BigNumber);if(constructorGuard!==_constructorGuard){logger$5.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"})}this._hex=hex;this._isBigNumber=true;Object.freeze(this)}fromTwos(value){return toBigNumber(toBN(this).fromTwos(value))}toTwos(value){return toBigNumber(toBN(this).toTwos(value))}abs(){if(this._hex[0]==="-"){return BigNumber.from(this._hex.substring(1))}return this}add(other){return toBigNumber(toBN(this).add(toBN(other)))}sub(other){return toBigNumber(toBN(this).sub(toBN(other)))}div(other){const o=BigNumber.from(other);if(o.isZero()){throwFault("division by zero","div")}return toBigNumber(toBN(this).div(toBN(other)))}mul(other){return toBigNumber(toBN(this).mul(toBN(other)))}mod(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot modulo negative values","mod")}return toBigNumber(toBN(this).umod(value))}pow(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot raise to negative values","pow")}return toBigNumber(toBN(this).pow(value))}and(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'and' negative values","and")}return toBigNumber(toBN(this).and(value))}or(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'or' negative values","or")}return toBigNumber(toBN(this).or(value))}xor(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'xor' negative values","xor")}return toBigNumber(toBN(this).xor(value))}mask(value){if(this.isNegative()||value<0){throwFault("cannot mask negative values","mask")}return toBigNumber(toBN(this).maskn(value))}shl(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shl")}return toBigNumber(toBN(this).shln(value))}shr(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shr")}return toBigNumber(toBN(this).shrn(value))}eq(other){return toBN(this).eq(toBN(other))}lt(other){return toBN(this).lt(toBN(other))}lte(other){return toBN(this).lte(toBN(other))}gt(other){return toBN(this).gt(toBN(other))}gte(other){return toBN(this).gte(toBN(other))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch(error){throwFault("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return logger$5.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){if(arguments.length>0){if(arguments[0]===10){if(!_warnedToStringRadix){_warnedToStringRadix=true;logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")}}else if(arguments[0]===16){logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{})}else{logger$5.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})}}return toBN(this).toString(10)}toHexString(){return this._hex}toJSON(key){return{type:"BigNumber",hex:this.toHexString()}}static from(value){if(value instanceof BigNumber){return value}if(typeof value==="string"){if(value.match(/^-?0x[0-9a-f]+$/i)){return new BigNumber(_constructorGuard,toHex(value))}if(value.match(/^-?[0-9]+$/)){return new BigNumber(_constructorGuard,toHex(new BN(value)))}return logger$5.throwArgumentError("invalid BigNumber string","value",value)}if(typeof value==="number"){if(value%1){throwFault("underflow","BigNumber.from",value)}if(value>=MAX_SAFE||value<=-MAX_SAFE){throwFault("overflow","BigNumber.from",value)}return BigNumber.from(String(value))}const anyValue=value;if(typeof anyValue==="bigint"){return BigNumber.from(anyValue.toString())}if(isBytes$1(anyValue)){return BigNumber.from(hexlify(anyValue))}if(anyValue){if(anyValue.toHexString){const hex=anyValue.toHexString();if(typeof hex==="string"){return BigNumber.from(hex)}}else{let hex=anyValue._hex;if(hex==null&&anyValue.type==="BigNumber"){hex=anyValue.hex}if(typeof hex==="string"){if(isHexString(hex)||hex[0]==="-"&&isHexString(hex.substring(1))){return BigNumber.from(hex)}}}}return logger$5.throwArgumentError("invalid BigNumber value","value",value)}static isBigNumber(value){return!!(value&&value._isBigNumber)}}function toHex(value){if(typeof value!=="string"){return toHex(value.toString(16))}if(value[0]==="-"){value=value.substring(1);if(value[0]==="-"){logger$5.throwArgumentError("invalid hex","value",value)}value=toHex(value);if(value==="0x00"){return value}return"-"+value}if(value.substring(0,2)!=="0x"){value="0x"+value}if(value==="0x"){return"0x00"}if(value.length%2){value="0x0"+value.substring(2)}while(value.length>4&&value.substring(0,4)==="0x00"){value="0x"+value.substring(4)}return value}function toBigNumber(value){return BigNumber.from(toHex(value))}function toBN(value){const hex=BigNumber.from(value).toHexString();if(hex[0]==="-"){return new BN("-"+hex.substring(3),16)}return new BN(hex.substring(2),16)}function throwFault(fault,operation,value){const params={fault:fault,operation:operation};if(value!=null){params.value=value}return logger$5.throwError(fault,Logger.errors.NUMERIC_FAULT,params)}const logger$4=new Logger("rlp/0.0.1");function arrayifyInteger$1(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function unarrayifyInteger$1(data,offset,length){let result=0;for(let i=0;ioffset+1+length){logger$4.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}}return{consumed:1+length,result:result}}function _decode$1(data,offset){if(data.length===0){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}if(data[offset]>=248){const lengthLength=data[offset]-247;if(offset+1+lengthLength>data.length){logger$4.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;if(offset+1+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;if(offset+1+lengthLength>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;if(offset+1+length>data.length){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlify(data[offset])}}function decode$1(data){const bytes=arrayify(data);const decoded=_decode$1(bytes,0);if(decoded.consumed!==bytes.length){logger$4.throwArgumentError("invalid rlp data","data",data)}return decoded.result}const U32_MASK64=(()=>BigInt(2**32-1))();const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){const len=lst.length;let Ah=new Uint32Array(len);let Al=new Uint32Array(len);for(let i=0;in/2**32|0;const fromNumL=n=>n>>>0;function setU64FromNum(view,byteOffset,n,isLE){const h=fromNumH(n);const l=fromNumL(n);view.setUint32(byteOffset,isLE?l:h,isLE);view.setUint32(byteOffset+4,isLE?h:l,isLE)}const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;function isBytes(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in a&&a.BYTES_PER_ELEMENT===1}const atitle=title=>title?`"${title}" `:"";function anumber(n,title=""){if(typeof n!=="number")throw new TypeError(atitle(title)+"expected number, got "+typeof n);if(!Number.isSafeInteger(n)||n<0)throw new RangeError(atitle(title)+"expected integer >= 0, got "+n);return n}function abool(value,title=""){if(typeof value!=="boolean")throw new TypeError(atitle(title)+"expected boolean, got type="+typeof value);return value}function abytes(value,length,title=""){if(isBytes(value)&&length===undefined)return value;const bytes=isBytes(value);const ofLen="";const got=bytes?`length=${value.length}`:`type=${typeof value}`;const message=atitle(title)+"expected Uint8Array"+ofLen+", got "+got;if(!bytes)throw new TypeError(message);throw new RangeError(message)}function ahash(h){if(typeof h!=="function"||typeof h.create!=="function")throw new TypeError("expected hash wrapped by utils.createHasher");anumber(h.outputLen);anumber(h.blockLen);if(h.outputLen<1||h.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const aobject=(value,label)=>{if(value===null||typeof value!=="object"||Array.isArray(value))throw new TypeError((label==="object"?"":`"${label}" `)+"expected object, got type="+typeof value)};const aopts=(value,label)=>{aobject(value,label);const proto=Object.getPrototypeOf(value);if(proto!==Object.prototype&&proto!==null)throw new TypeError(`"${label}" expected plain object`);if(Object.hasOwn(value,"__proto__"))throw new TypeError(`"${label}.__proto__" is not allowed`)};function aexists(instance,checkFinished=true){if(instance.destroyed)throw new Error("hash was destroyed");if(checkFinished&&instance.finished)throw new Error("digest() was already called")}function aoutput(out,instance){abytes(out,undefined,"output");const min=instance.outputLen;if(!(out.length>=min)){throw new RangeError('"output" expected length >= '+min)}}function u32(arr){return new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4))}function clean(...arrays){for(let i=0;i>>shift}function rotl(word,shift){return word<>>32-shift>>>0}const isLE=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function byteSwap(word){return word<<24&4278190080|word<<8&16711680|word>>>8&65280|word>>>24&255}function byteSwap32(arr){for(let i=0;iu:byteSwap32;function nextTick(onReject){const host=globalThis;if(typeof host.scheduler?.yield==="function"){const promise=host.scheduler.yield();if(onReject)promise.catch(onReject);return promise}return new Promise(resolve=>host.setTimeout(resolve,0))}async function asyncLoop(iters,tick,cb,onReject){anumber(iters,"iters");anumber(tick,"tick");if(typeof cb!=="function")throw new TypeError("callback must be a function");let ts=Date.now();for(let i=0;i=0&&diff= 1');if(dkLen<1)throw new Error('"dkLen" must be >= 1');if(dkLen>(2**32-1)*hash.outputLen)throw new Error("derived key too long");const p=kdfInputToBytes(_password,"password");try{const s=kdfInputToBytes(_salt,"salt");try{const DK=new Uint8Array(dkLen);const{iHash,oHash,outputLen}=hmac$1.create(hash,p);const u=new Uint8Array(outputLen);const eng=pbkdf2Engine(iHash,oHash,s,u);return{c:c,dkLen:dkLen,asyncTick:asyncTick,DK:DK,outputLen:outputLen,eng:eng}}finally{if(typeof _salt==="string")clean(s)}}finally{if(typeof _password==="string")clean(p)}}function pbkdf2Engine(iHash,oHash,salt,u){const counter=new Uint8Array(4);const view=createView(counter);const salted=iHash._cloneInto().update(salt);const work=oHash._cloneInto();const iClone=iHash._cloneInto;const oClone=oHash._cloneInto;return{u1:(ti,Ti)=>{view.setInt32(0,ti,false);salted._cloneInto(work).update(counter).digestInto(u);oHash._cloneInto(work).update(u).digestInto(u);Ti.set(u.subarray(0,Ti.length))},rounds:(c,Ti)=>{for(let ui=1;ui{iHash.destroy();oHash.destroy();salted.destroy();work.destroy();clean(u);return DK}}}function pbkdf2$3(hash,password,salt,opts){const{c,dkLen,DK,outputLen,eng}=pbkdf2Init(hash,password,salt,opts);for(let ti=1,pos=0;pos>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){clean(SHA256_W)}destroy(){this.destroyed=true;this.set(0,0,0,0,0,0,0,0);clean(this.buffer)}}class _SHA256 extends SHA2_32B{constructor(){super(32,SHA256_IV)}}const K512=(()=>split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_Kh=(()=>K512[0])();const SHA512_Kl=(()=>K512[1])();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA2_64B extends HashMD{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(outputLen,IV){super(128,outputLen,16,false);this.Ah=IV[0]|0;this.Al=IV[1]|0;this.Bh=IV[2]|0;this.Bl=IV[3]|0;this.Ch=IV[4]|0;this.Cl=IV[5]|0;this.Dh=IV[6]|0;this.Dl=IV[7]|0;this.Eh=IV[8]|0;this.El=IV[9]|0;this.Fh=IV[10]|0;this.Fl=IV[11]|0;this.Gh=IV[12]|0;this.Gl=IV[13]|0;this.Hh=IV[14]|0;this.Hl=IV[15]|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=rotrSH(W15h,W15l,1)^rotrSH(W15h,W15l,8)^shrSH(W15h,W15l,7);const s0l=rotrSL(W15h,W15l,1)^rotrSL(W15h,W15l,8)^shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=rotrSH(W2h,W2l,19)^rotrBH(W2h,W2l,61)^shrSH(W2h,W2l,6);const s1l=rotrSL(W2h,W2l,19)^rotrBL(W2h,W2l,61)^shrSL(W2h,W2l,6);const SUMl=add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=rotrSH(Eh,El,14)^rotrSH(Eh,El,18)^rotrBH(Eh,El,41);const sigma1l=rotrSL(Eh,El,14)^rotrSL(Eh,El,18)^rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=rotrSH(Ah,Al,28)^rotrBH(Ah,Al,34)^rotrBH(Ah,Al,39);const sigma0l=rotrSL(Ah,Al,28)^rotrBL(Ah,Al,34)^rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=add3L(T1l,sigma0l,MAJl);Ah=add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){clean(SHA512_W_H,SHA512_W_L)}destroy(){this.destroyed=true;clean(this.buffer);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class _SHA512 extends SHA2_64B{constructor(){super(64,SHA512_IV)}}const sha256$2=createHasher(()=>new _SHA256,oidNist(1));const sha512$1=createHasher(()=>new _SHA512,oidNist(3));const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);const SHA3_PI=[];const SHA3_ROTL=[];const _SHA3_IOTA=[];for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;const rotlH=(h,l,s)=>s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);const B=new Uint32Array(5*2);function keccakP(s,rounds=24){if(!(s instanceof Uint32Array))throw new TypeError('"s" expected Uint32Array(50), got type='+typeof s);if(s.length!==50)throw new RangeError('"s" expected Uint32Array(50), got length='+s.length);anumber(rounds,"rounds");if(rounds<1||rounds>24)throw new Error('"rounds" expected integer 1..24');for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){const b0=s[y],b1=s[y+1],b2=s[y+2],b3=s[y+3];s[y]^=~s[y+2]&s[y+4];s[y+1]^=~s[y+3]&s[y+5];s[y+2]^=~s[y+4]&s[y+6];s[y+3]^=~s[y+5]&s[y+7];s[y+4]^=~s[y+6]&s[y+8];s[y+5]^=~s[y+7]&s[y+9];s[y+6]^=~s[y+8]&b0;s[y+7]^=~s[y+9]&b1;s[y+8]^=~b0&b2;s[y+9]^=~b1&b3}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}clean(B)}class Keccak{state;pos=0;posOut=0;finished=false;state32;destroyed=false;blockLen;suffix;outputLen;canXOF;enableXOF=false;rounds;constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){anumber(blockLen,"blockLen");anumber(suffix,"suffix");anumber(rounds,"rounds");abool(enableXOF,"enableXOF");this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.canXOF=enableXOF;this.rounds=rounds;anumber(outputLen,"outputLen");if(!(0=blockLen?u32(data):undefined;for(let pos=0;pos=blockLen){for(let i=0,o=pos/4;i=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not enabled");return this.writeInto(out)}xof(bytes){anumber(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){aoutput(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out.length===this.outputLen?out:out.subarray(0,this.outputLen));this.destroy()}digest(){const out=new Uint8Array(this.outputLen);this.digestInto(out);return out}destroy(){this.destroyed=true;clean(this.state)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds);to.blockLen=blockLen;to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.canXOF=this.canXOF;to.destroyed=this.destroyed;return to}}const genKeccak=(suffix,blockLen,outputLen,info={})=>createHasher(()=>new Keccak(blockLen,suffix,outputLen),info);const sha3_256=genKeccak(6,136,32,oidNist(8));const sha3_512=genKeccak(6,72,64,oidNist(10));const keccak_256=genKeccak(1,136,32);var assert_1;var hasRequiredAssert;function requireAssert(){if(hasRequiredAssert)return assert_1;hasRequiredAssert=1;function assert(val,msg){if(!val){const err=new Error(msg||"Assertion failed");if(Error.captureStackTrace)Error.captureStackTrace(err,assert);throw err}}assert_1=assert;return assert_1}var customBrowser={};var hasRequiredCustomBrowser;function requireCustomBrowser(){if(hasRequiredCustomBrowser)return customBrowser;hasRequiredCustomBrowser=1;customBrowser.custom="inspect";return customBrowser}var bn;var hasRequiredBn;function requireBn(){if(hasRequiredBn)return bn;hasRequiredBn=1;const{custom}=requireCustomBrowser();const zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];const groupSizes=[0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];const groupBases=[0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];const primes={p192:null,p224:null,p521:null,k256:null,p251:null,p25519:null,p448:null};const modes={NONE:0,QUO:1,REM:2,BOTH:3,EUCLID:4,ALL:7};const WND_WIDTH=4;const WND_SIZE=1<>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}else if(a!==this){for(;i=67108864;i++){this.words[i]-=67108864;this.words[i+1]+=1}this.length=Math.max(this.length,i+1);return this}iadd(num){enforce(BN.isBN(num),"num","bignum");if(this.negative===num.negative){this._iadd(this,num)}else{const cmp=this.ucmp(num);if(cmp===0){this.words[0]=0;this.length=1;this.negative=0;return this}if(cmp<0){this._isub(num,this);this.negative^=1}else{this._isub(this,num)}}return this}iaddn(num){enforce(isSMI(num),"num","smi");const negative=num<0|0;if(negative)num=-num;if(this.negative===negative){this._iaddn(num)}else{if(this.length===1&&this.words[0]this.length)return num.clone().iadd(this);return this.clone().iadd(num)}addn(num){return this.clone().iaddn(num)}_isub(a,b){let carry=0;let i=0;assert(a.length>=b.length);if(a!==this)this._alloc(a.length);for(;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}assert(carry===0);if(a!==this){for(;i=0)return this._normalize();assert(this.length!==1);this._alloc(this.length+1);for(let i=0;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}this.negative^=neg;if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}else{this._strip()}return this}mul(num){enforce(BN.isBN(num),"num","bignum");const len=this.length+num.length;const out=new BN;out.words=new Array(len);for(let i=0;i>>0===bits,"bits","uint32");const r=this.mul(num);const b=r.utestn(bits-1);r.iushrn(bits);if(this.negative^num.negative)return r.isubn(b);return r.iaddn(b)}_div(num,flags){enforce(BN.isBN(num),"num","bignum");assert((flags&modes.ALL)===flags);assert(flags!==modes.NONE);const a=this;const b=num;nonzero(!b.isZero());if(a.isZero())return[new BN(0),new BN(0)];const as=a.negative;const bs=b.negative;a.negative=0;b.negative=0;let q=null;let r=null;if(a.ucmp(b)<0){if(flags&modes.QUO)q=new BN(0);if(flags&modes.REM)r=a.clone()}else if(b.length===1){if(flags&modes.QUO)q=a.quon(b.words[0]);if(flags&modes.REM)r=a.remn(b.words[0])}else{[q,r]=a._wordDiv(b,flags)}a.negative=as;b.negative=bs;if(flags&modes.QUO){q.negative=a.negative^b.negative;q._normalize()}if(flags&modes.REM){r.negative=a.negative;r._normalize()}if(flags&modes.EUCLID){if(flags&modes.QUO){assert((flags&modes.REM)!==0);if(r.negative!==0){if(b.negative!==0)q.iaddn(1);else q.isubn(1)}}if(flags&modes.REM){if(r.negative!==0){if(b.negative!==0)r.isub(b);else r.iadd(b)}}}return[q,r]}_wordDiv(num,flags){let a=this.clone();let b=num;let q=null;let hi;const word=b.words[b.length-1]|0;const shift=26-countBits(word);if(shift!==0){b=b.clone();a.iushln(shift);b.iushln(shift);hi=b.words[b.length-1]|0}else{hi=word}const m=a.length-b.length;assert(m>=0);if(flags&modes.QUO){q=new BN(0);q.length=m+1;q.words=new Array(q.length);for(let i=0;i=0;j--){const ahi=a.words[b.length+j];const alo=a.words[b.length+j-1];const quo=(ahi*67108864+alo)/hi|0;let qj=Math.min(quo,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj-=1;a.negative=0;a._ishlnsubmul(b,1,j);a.ineg()}if(q)q.words[j]=qj}if(q)q._strip();if(flags&modes.REM&&shift!==0)a.iushrn(shift);return[q,a]}_ishlnsubmul(num,mul,shift){let carry=0;let i=0;this._expand(num.length+shift);for(;i>26)-(r/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this._strip();assert(carry===-1);carry=0;for(let i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this._strip()}quorem(num){return this._div(num,modes.BOTH)}iquo(num){return this.quo(num)._move(this)}iquon(num){enforce(isSMI(num),"num","smi");nonzero(num!==0);const neg=num<0|0;if(neg)num=-num;let carry=0;for(let i=this.length-1;i>=0;i--){const w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}this.negative^=neg;return this._strip()}quo(num){return this._div(num,modes.QUO)[0]}quon(num){return this.clone().iquon(num)}irem(num){return this.rem(num)._move(this)}iremn(num){let m=this.remrn(num);if(m<0)m=-m;this.words[0]=m;this.length=1;return this._normalize()}rem(num){return this._div(num,modes.REM)[1]}remn(num){return this.clone().iremn(num)}remrn(num){enforce(isSMI(num),"num","smi");nonzero(num!==0);if(num<0)num=-num;const p=(1<<26)%num;let acc=0;for(let i=this.length-1;i>=0;i--)acc=(p*acc+(this.words[i]|0))%num;return this.negative!==0?-acc|0:acc}divmod(num){return this._div(num,modes.BOTH|modes.EUCLID)}idiv(num){return this.div(num)._move(this)}idivn(num){if(this.negative===0)return this.iquon(num);const r=this.remrn(num);this.iquon(num);if(r<0){if(num<0)this.iaddn(1);else this.isubn(1)}return this}div(num){return this._div(num,modes.BOTH|modes.EUCLID)[0]}divn(num){return this.clone().idivn(num)}imod(num){if(this.ucmp(num)<0){if(this.negative!==0){this._isub(num,this);this.negative=0}return this}return this.mod(num)._move(this)}imodn(num){this.words[0]=this.modrn(num);this.length=1;this.negative=0;return this}mod(num){return this._div(num,modes.REM|modes.EUCLID)[1]}modn(num){return this.clone().imodn(num)}modrn(num){enforce(isSMI(num),"num","smi");let r=this.remrn(num);if(r<0){if(num<0)r-=num;else r+=num}return r}divRound(num){const[q,r]=this.quorem(num);if(r.isZero())return q;const bit=num.words[0]&1;num.iushrn(1);const cmp=r.ucmp(num);num.iushln(1);num.words[0]|=bit;if(cmp<0||num.isOdd()&&cmp===0)return q;if(this.negative^num.negative)return q.isubn(1);return q.iaddn(1)}ipow(num){return this.pow(num)._move(this)}ipown(num){return this.pown(num)._move(this)}pow(num){enforce(BN.isBN(num),"num","bignum");let b=countBits(num.words[num.length-1]);let r=new BN(1);for(let i=num.length-1;i>=0;i--){const word=num.words[i];for(let j=b-1;j>=0;j--){r=r.sqr();if(word>>j&1)r=r.mul(this)}b=26}return r}pown(num){enforce(isSMI(num),"num","smi");if(num<0)num=-num;if(num===0)return new BN(1);if(num===1)return this.clone();const bits=countBits(num);let r=this;for(let i=bits-2;i>=0;i--){r=r.sqr();if(num>>i&1)r=r.mul(this)}return r}isqr(){return this.imul(this)}sqr(){return this.mul(this)}_rootrem(pow,rem){enforce(pow>>>0===pow,"num","uint32");if(pow===0)throw new RangeError("Zeroth root.");if(~pow&this.negative)throw new RangeError("Negative with even root.");if(this.ucmpn(1)<=0)return[this.clone(),new BN(0)];let u=new BN(0);let t=BN.shift(1,this.bitLength()/pow+1|0);let v,r;if(this.negative!==0)t.ineg();if(pow===2){do{u=t;t=this.quo(u);t.iadd(u);t.iushrn(1)}while(t.ucmp(u)<0)}else{do{u=t;t=u.pown(pow-1);t=this.quo(t);v=u.muln(pow-1);t.iadd(v);t=t.quon(pow)}while(t.ucmp(u)<0)}if(rem){t=u.pown(pow);r=this.sub(t)}return[u,r]}rootrem(pow){return this._rootrem(pow,1)}iroot(pow){return this.root(pow)._move(this)}root(pow){return this._rootrem(pow,0)[0]}isPower(pow){enforce(pow>>>0===pow,"num","uint32");if(pow===0||~pow&this.negative)return false;const[,r]=this.rootrem(pow);return r.sign()===0}sqrtrem(){return this.rootrem(2)}isqrt(){return this.sqrt()._move(this)}sqrt(){return this.root(2)}isSquare(){return this.isPower(2)}iand(num){enforce(BN.isBN(num),"num","bignum");let x=this;let y=num;if(x===y)return x;if((x.negative|y.negative)===0)return x.iuand(y);if((x.negative&y.negative)===1){x.iaddn(1);y.iaddn(1);x.iuor(y);x.isubn(1);y.isubn(1);return x}if(x.negative!==0)[x,y]=[y.clone(),x];const width=x.bitLength();y.iaddn(1);y.inotn(width);x.iuand(y);y.inotn(width);y.isubn(1);return x._move(this)}iandn(num){enforce(isSMI(num),"num","smi");if((this.negative|num<0)!==0)return this.iand(new BN(num));this.words[0]&=num;this.length=1;return this}and(num){return this.clone().iand(num)}andn(num){return this.clone().iandn(num)}andrn(num){enforce(isSMI(num),"num","smi");if((this.negative|num<0)!==0){const n=this.iand(new BN(num));if(n.length>1)throw new RangeError("Number exceeds 26 bits.");return n.negative!==0?-n.words[0]:n.words[0]}return this.words[0]&num}iuand(num){enforce(BN.isBN(num),"num","bignum");this.length=Math.min(this.length,num.length);for(let i=0;i>>0===width,"width","uint32");const r=width%26;let s=Math.ceil(width/26);let i=0;this._expand(s);if(r>0)s-=1;for(;i0)this.words[i]^=(1<>>0===bits,"bits","uint32");const r=bits%26;const s=(bits-r)/26;const mask=(1<>>26-r}if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}}if(s!==0){this._alloc(this.length+s);for(let i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(let i=0;is){this.length-=s;for(let i=0;i=0;i--){const word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}}if(output){if(carry!==0){output._alloc(output.length+1);output.words[output.length++]=carry}else{if(output.length===0)output.words[output.length++]=0;output._strip()}}return this._strip()}ishr(num){enforce(BN.isBN(num),"bits","bignum");enforce(num.bitLength()<=32,"bits","uint32");return this.ishrn(num.toNumber())}ishrn(bits){enforce(bits>>>0===bits,"bits","uint32");if(this.negative!==0){this.iaddn(1);this.iushrn(bits);this.isubn(1);return this}return this.iushrn(bits)}shr(num){return this.clone().ishr(num)}shrn(bits){return this.clone().ishrn(bits)}iushr(num){enforce(BN.isBN(num),"bits","bignum");enforce(num.bitLength()<=32,"bits","uint32");return this.iushrn(num.toNumber())}iushrn(bits){enforce(bits>>>0===bits,"bits","uint32");return this._split(bits,null)}ushr(num){return this.clone().iushr(num)}ushrn(bits){return this.clone().iushrn(bits)}setn(bit,val){enforce(bit>>>0===bit,"bit","uint32");if(this.negative!==0){this.iaddn(1);this.usetn(bit,!val);this.isubn(1);return this}return this.usetn(bit,val)}usetn(bit,val){enforce(bit>>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;this._expand(s+1);if(val)this.words[s]|=1<>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;if(this.length<=s)return this.negative;const w=this.words[s];const val=w>>r&1;if(this.negative!==0){if(r>0&&w&(1<0)return val^1}}return val}utestn(bit){enforce(bit>>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;if(this.length<=s)return 0;return this.words[s]>>r&1}imaskn(bits){enforce(bits>>>0===bits,"bits","uint32");if(this.negative!==0){this.iaddn(1);this.inotn(bits+1);this.ineg()}return this.iumaskn(bits)}maskn(bits){return this.clone().imaskn(bits)}iumaskn(bits){enforce(bits>>>0===bits,"bits","uint32");const r=bits%26;let s=(bits-r)/26;if(this.length<=s)return this;if(r!==0)s+=1;this.length=Math.min(s,this.length);if(r!==0)this.words[this.length-1]&=(1<>>0===pos,"pos","uint32");enforce(width>>>0===width,"width","uint32");enforce(width<=26,"width","width");const shift=pos%26;const index=(pos-shift)/26;if(index>=this.length)return 0;let bits=this.words[index]>>shift&(1<26&&index+10}gtn(num){return this.cmpn(num)>0}gte(num){return this.cmp(num)>=0}gten(num){return this.cmpn(num)>=0}lt(num){return this.cmp(num)<0}ltn(num){return this.cmpn(num)<0}lte(num){return this.cmp(num)<=0}lten(num){return this.cmpn(num)<=0}sign(){if(this.negative!==0)return-1;if(this.length===1&&this.words[0]===0)return 0;return 1}isZero(){return this.length===1&&this.words[0]===0}isNeg(){return this.negative!==0}isPos(){return this.negative===0}isOdd(){return(this.words[0]&1)===1}isEven(){return(this.words[0]&1)===0}ucmp(num){enforce(BN.isBN(num),"num","bignum");if(this.lengthnum.length)return 1;for(let i=this.length-1;i>=0;i--){const a=this.words[i]|0;const b=num.words[i]|0;if(a===b)continue;return(a>b)-(a1)return 1;const w=this.words[0]|0;if(num<0)num=-num;return(w>num)-(w=0)a.imod(b);while(!a.isZero()){const bits=a._makeOdd();if(bits&1){const bmod8=b.andln(7);if(bmod8===3||bmod8===5)j=-j}if(a.ucmp(b)<0){[a,b]=[b,a];if(a.andln(3)===3&&b.andln(3)===3)j=-j}a._isub(a,b).iushrn(1);const bmod8=b.andln(7);if(bmod8===3||bmod8===5)j=-j}if(b.cmpn(1)!==0)return 0;return j}kronecker(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero())return num.ucmpn(1)===0?1:0;if(num.isZero())return this.ucmpn(1)===0?1:0;if(((this.words[0]|num.words[0])&1)===0)return 0;const x=this;const y=num.clone();const bits=y._makeOdd();const table=[0,1,0,-1,0,-1,0,1];let k=x.jacobi(y);if(bits&1)k*=table[x.andln(7)];return k|0}igcd(num){return this.gcd(num)._move(this)}gcd(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero())return num.abs();if(num.isZero())return this.abs();let a=this.clone();let b=num.clone();a.negative=0;b.negative=0;const shift=a._factor2(b);if(shift!==0){a.iushrn(shift);b.iushrn(shift)}for(;;){a._makeOdd();b._makeOdd();const cmp=a.ucmp(b);if(cmp<0){[a,b]=[b,a]}else if(cmp===0||b.ucmpn(1)===0){break}a._isub(a,b)}return b.iushln(shift)}ilcm(num){return this.lcm(num)._move(this)}lcm(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero()||num.isZero())return new BN(0);return this.quo(this.gcd(num)).mul(num).iabs()}egcd(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero()){return[new BN(0),new BN(num.sign()),num.abs()]}if(num.isZero()){return[new BN(this.sign()),new BN(0),this.abs()]}const x=this.clone();const y=num.clone();x.negative=0;y.negative=0;const A=new BN(1);const B=new BN(0);const C=new BN(0);const D=new BN(1);const g=x._factor2(y);if(g>0){x.iushrn(g);y.iushrn(g)}const xp=x.clone();const yp=y.clone();while(!x.isZero()){let i=x._makeOdd();let j=y._makeOdd();while(i--){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}while(j--){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}if(this.negative!==0)C.ineg();if(num.negative!==0)D.ineg();return[C,D,y.iushln(g)]}iinvert(num){return this.invert(num)._move(this)}invert(num){enforce(BN.isBN(num),"num","bignum");range(num.sign()>0,"invert");if(num.isOdd())return this._invertp(num);if(num.cmpn(1)===0)throw new RangeError("Not invertible.");const[s,,g]=this.egcd(num);if(g.cmpn(1)!==0)throw new RangeError("Not invertible.");return s.imod(num)}ifermat(num){return this.fermat(num)._move(this)}fermat(num){const red=HAS_BIGINT?BN.red(num):BN.mont(num);return this.toRed(red).redFermat().fromRed()}ipowm(y,m,mont){return this.powm(y,m,mont)._move(this)}powm(y,m,mont){const red=!HAS_BIGINT&&mont?BN.mont(m):BN.red(m);return this.toRed(red).redPow(y).fromRed()}ipowmn(y,m,mont){return this.powmn(y,m,mont)._move(this)}powmn(y,m,mont){const red=mont?BN.mont(m):BN.red(m);return this.toRed(red).redPown(y).fromRed()}isqrtm(p){return this.sqrtm(p)._move(this)}sqrtm(p){enforce(BN.isBN(p),"p","bignum");let red;if(p.andln(3)===3||p.andln(7)===5){red=BN.red(p)}else{red=BN.mont(p)}return this.toRed(red).redSqrt().fromRed()}isqrtpq(p,q){return this.sqrtpq(p,q)._move(this)}sqrtpq(p,q){const sp=this.sqrtm(p);const sq=this.sqrtm(q);const[mp,mq]=p.egcd(q);const lhs=sq.mul(mp).mul(p);const rhs=sp.mul(mq).mul(q);const n=p.mul(q);return lhs.iadd(rhs).imod(n)}isPrime(rng,reps,limit){enforce(reps>>>0===reps,"reps","uint32");if(!this.isPrimeMR(rng,reps+1,true))return false;if(!this.isPrimeLucas(limit))return false;return true}isPrimeMR(rng,reps,force2=false){enforce(reps>>>0===reps,"reps","uint32");enforce(reps>0,"reps","integer");enforce(typeof force2==="boolean","force2","boolean");const n=this;if(n.cmpn(7)<0){return n.cmpn(2)===0||n.cmpn(3)===0||n.cmpn(5)===0}if(n.isEven())return false;const nm1=n.subn(1);const nm3=nm1.subn(2);const k=nm1.zeroBits();const q=nm1.ushrn(k);const red=BN.red(n);const rnm1=nm1.toRed(red);const rone=new BN(1).toRed(red);next:for(let i=0;i>>0===limit,"limit","uint32");const n=this;if(n.cmpn(1)<=0)return false;if(n.isEven())return n.cmpn(2)===0;let p=3;for(;;){if(p>1e4){throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`)}if(limit!==0&&p>limit){return false}const d=new BN(p*p-4);const j=d.jacobi(n);if(j===-1)break;if(j===0)return n.cmpn(p+2)===0;if(p===40){if(n.isSquare())return false}p+=1}const s=n.addn(1);const r=s._makeOdd();let vk=new BN(2);let vk1=new BN(p);for(let i=s.bitLength();i>=0;i--){if(s.utestn(i)){vk=vk.mul(vk1).isubn(p).imod(n);vk1=vk1.sqr().isubn(2).imod(n)}else{vk1=vk1.mul(vk).isubn(p).imod(n);vk=vk.sqr().isubn(2).imod(n)}}if(vk.cmpn(2)===0||vk.cmp(n.subn(2))===0){const a=vk.muln(p).imod(n);const b=vk1.ushln(1).imod(n);if(a.cmp(b)===0)return true}for(let t=0;t>>0===width,"width","uint32");range(width>0,"width");if(this.testn(width-1))return this.notn(width).iaddn(1).ineg();return this.clone()}toRed(ctx){enforce(ctx instanceof Red,"ctx","reduction context");if(this.red)throw new Error("Already in reduction context.");return ctx.convertTo(this)}fromRed(){red(this.red,"fromRed");return this.red.convertFrom(this)}forceRed(ctx){enforce(ctx instanceof Red,"ctx","reduction context");if(this.red){if(!ctx.m.eq(this.red.m)||ctx.mont!==this.red.mont)throw new Error("Already in reduction context.")}else{range(this.negative===0,"red");range(this.ucmp(ctx.m)<0,"red")}return this.clone()._forceRed(ctx)}redIAdd(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIAdd");return this.red.iadd(this,num)}redAdd(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redAdd");return this.red.add(this,num)}redIAddn(num){enforce(isSMI(num),"num","smi");red(this.red,"redIAddn");return this.red.iaddn(this,num)}redAddn(num){enforce(isSMI(num),"num","smi");red(this.red,"redAddn");return this.red.addn(this,num)}redISub(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redISub");return this.red.isub(this,num)}redSub(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redSub");return this.red.sub(this,num)}redISubn(num){enforce(isSMI(num),"num","smi");red(this.red,"redISubn");return this.red.isubn(this,num)}redSubn(num){enforce(isSMI(num),"num","smi");red(this.red,"redSubn");return this.red.subn(this,num)}redIMul(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIMul");return this.red.imul(this,num)}redMul(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redMul");return this.red.mul(this,num)}redIMuln(num){enforce(isSMI(num),"num","smi");red(this.red,"redIMuln");return this.red.imuln(this,num)}redMuln(num){enforce(isSMI(num),"num","smi");red(this.red,"redMuln");return this.red.muln(this,num)}redIDiv(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIDiv");return this.red.idiv(this,num)}redDiv(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redDiv");return this.red.div(this,num)}redIDivn(num){enforce(isSMI(num),"num","smi");red(this.red,"redIDivn");return this.red.idivn(this,num)}redDivn(num){enforce(isSMI(num),"num","smi");red(this.red,"redDivn");return this.red.divn(this,num)}redIPow(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIPow");nonred(!num.red,"redIPow");return this.red.ipow(this,num)}redPow(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redPow");nonred(!num.red,"redPow");return this.red.pow(this,num)}redIPown(num){enforce(isSMI(num),"num","smi");red(this.red,"redIPown");return this.red.ipown(this,num)}redPown(num){enforce(isSMI(num),"num","smi");red(this.red,"redPown");return this.red.pown(this,num)}redISqr(){red(this.red,"redISqr");return this.red.isqr(this)}redSqr(){red(this.red,"redSqr");return this.red.sqr(this)}redISqrt(){red(this.red,"redISqrt");return this.red.isqrt(this)}redSqrt(){red(this.red,"redSqrt");return this.red.sqrt(this)}redIDivSqrt(v){red(this.red,"redIDivSqrt");return this.red.idivsqrt(this,v)}redDivSqrt(v){red(this.red,"redDivSqrt");return this.red.divsqrt(this,v)}redIsSquare(){red(this.red,"redIsSquare");return this.red.isSquare(this)}redIShl(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIShl");nonred(!num.red,"redIShl");return this.red.ishl(this,num)}redShl(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redShl");nonred(!num.red,"redShl");return this.red.shl(this,num)}redIShln(num){enforce(num>>>0===num,"num","uint32");red(this.red,"redIShln");return this.red.ishln(this,num)}redShln(num){enforce(num>>>0===num,"num","uint32");red(this.red,"redShln");return this.red.shln(this,num)}redINeg(){red(this.red,"redINeg");return this.red.ineg(this)}redNeg(){red(this.red,"redNeg");return this.red.neg(this)}redEq(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redEq");return this.red.eq(this,num)}redEqn(num){enforce(isSMI(num),"num","smi");red(this.red,"redEqn");return this.red.eqn(this,num)}redIsHigh(){red(this.red,"redIsHigh");return this.red.isHigh(this)}redIsLow(){red(this.red,"redIsLow");return this.red.isLow(this)}redIsOdd(){red(this.red,"redIsOdd");return this.red.isOdd(this)}redIsEven(){red(this.red,"redIsEven");return this.red.isEven(this)}redLegendre(){red(this.red,"redLegendre");return this.red.legendre(this)}redJacobi(){red(this.red,"redJacobi");return this.red.jacobi(this)}redKronecker(){red(this.red,"redKronecker");return this.red.kronecker(this)}redIInvert(){red(this.red,"redIInvert");return this.red.iinvert(this)}redInvert(){red(this.red,"redInvert");return this.red.invert(this)}redIFermat(){red(this.red,"redIFermat");return this.red.ifermat(this)}redFermat(){red(this.red,"redFermat");return this.red.fermat(this)}_move(dest){dest.words=this.words;dest.length=this.length;dest.negative=this.negative;dest.red=this.red;return dest}_alloc(size){while(this.words.length1&&this.words[this.length-1]===0)this.length-=1;return this._normalize()}_normalize(){assert(this.length>0);if(this.length===1&&this.words[0]===0)this.negative=0;return this}_check(){assert(this.length>0);assert(this.length<=this.words.length);if(this.length===1){if(this.words[0]===0)assert(this.negative===0);return this}assert(this.words[this.length-1]!==0);return this}_invertp(p){enforce(BN.isBN(p),"p","bignum");range(p.sign()>0,"invert");assert(p.isOdd());if(p.cmpn(1)===0)throw new RangeError("Not invertible.");const a=this.clone();const b=p.clone();const u=new BN(1);const v=new BN(0);if(a.isNeg()||a.ucmp(b)>=0)a.imod(b);while(!a.isZero()){let i=a._makeOdd();let j=b._makeOdd();while(i--){if(u.isOdd())u._iadd(u,p);u.iushrn(1)}while(j--){if(v.isOdd())v._iadd(v,p);v.iushrn(1)}if(a.ucmp(b)>=0){a._isub(a,b);if(u.ucmp(v)<0){u._isub(v,u);u._isub(p,u)}else{u._isub(u,v)}}else{b._isub(b,a);if(v.ucmp(u)<0){v._isub(u,v);v._isub(p,v)}else{v._isub(v,u)}}}if(b.cmpn(1)!==0)throw new RangeError("Not invertible.");assert(v.negative===0);assert(v.ucmp(p)<0);return v}_makeOdd(){const shift=this.zeroBits();if(shift>0)this.iushrn(shift);return shift}_factor2(num){if((this.words[0]|num.words[0])&1)return 0;const len=Math.min(this.length,num.length);let r=0;for(let i=0;i>>0===pos,"pos","uint32");if(pos>=this.length)return 0;return this.words[pos]}[custom](){let prefix="BN";if(this.red)prefix="BN-R";return`<${prefix}: ${this.toString(10)}>`}toNumber(){let num=this.words[0];if(this.length===2){num+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){num+=4503599627370496+this.words[1]*67108864}else if(this.length>2){throw new RangeError("Number can only safely store up to 53 bits.")}return this.negative!==0?-num:num}toDouble(){let num=0;for(let i=this.length-1;i>=0;i--)num=num*67108864+this.words[i];return this.negative!==0?-num:num}valueOf(){return this.toDouble()}toBigInt(){if(!HAS_BIGINT)throw new Error("BigInt is not supported!");const s52=BigInt(52);const s26=BigInt(26);let i=this.length-1;let num=BigInt(0);for(;i>=1;i-=2){const hi=this.words[i]*67108864;const lo=this.words[i-1];num=num<=0)num=num<>>0===base,"base","uint32");enforce(padding>>>0===padding,"padding","uint32");if(base<2||base>36)throw new RangeError("Base ranges between 2 and 36.");this._check();if(base===16){let out="";let off=0;let carry=0;for(let i=0;i>>24-off&16777215;if(carry!==0||i!==this.length-1)out=zeros[6-word.length]+word+out;else out=word+out;off+=2;if(off>=26){off-=26;i-=1}}if(carry!==0)out=carry.toString(16)+out;while(out.length%padding!==0)out="0"+out;if(this.negative!==0)out="-"+out;return out}const groupSize=groupSizes[base-1];const groupBase=groupBases[base-1];const c=this.clone();let out="";c.negative=0;while(!c.isZero()){const r=c.remrn(groupBase).toString(base);c.iquon(groupBase);if(!c.isZero())out=zeros[groupSize-r.length]+r+out;else out=r+out}if(this.isZero())out="0";while(out.length%padding!==0)out="0"+out;if(this.negative!==0)out="-"+out;return out}toJSON(){return this.toString(16,2)}toArray(endian,length){return this.toArrayLike(Array,endian,length)}toBuffer(endian,length){return this.toArrayLike(bufferExports.Buffer,endian,length)}toArrayLike(ArrayType,endian,length){if(endian==null)endian="be";if(length==null)length=0;enforce(typeof ArrayType==="function","ArrayType","function");enforce(endian==="be"||endian==="le","endian","endianness");enforce(length>>>0===length,"length","uint32");this._check();const bytes=this.byteLength();const size=length||Math.max(1,bytes);if(bytes>size)throw new RangeError("Byte array longer than desired length.");const res=allocate(ArrayType,size);if(endian==="be"){let pos=res.length-1;let carry=0;for(let i=0;i=0)res[pos--]=word>>>8&255;if(pos>=0)res[pos--]=word>>>16&255;if(shift===6){if(pos>=0)res[pos--]=word>>>24&255;carry=0}else{carry=word>>>24}}if(pos>=0){res[pos--]=carry;while(pos>=0)res[pos--]=0;carry=0}assert(carry===0)}else{let pos=0;let carry=0;for(let i=0;i>>8&255;if(pos>>16&255;if(shift===6){if(pos>>24&255;carry=0}else{carry=word>>>24}}if(pos0){const lo=num%67108864;const hi=(num-lo)/67108864;this.words.push(lo);num=hi}if(this.words.length===0)this.words.push(0);this.length=this.words.length;this.negative=neg;if(endian==="le")this.reverse();return this}fromBigInt(num,endian){if(endian==null)endian="be";enforce(typeof num==="bigint","num","bigint");enforce(endian==="be"||endian==="le","endian","endianness");if(!HAS_BIGINT)throw new Error("BigInt is not supported!");const start=num>>0===base,"base","uint32");enforce(endian==="be"||endian==="le","endian","endianness");if(base<2||base>36)throw new Error("Base ranges between 2 and 36.");str=str.replace(/\s+/g,"");let start=0;if(str.length>0&&str.charCodeAt(0)===45)start=1;if(base===16)this._fromHex(str,start);else this._fromBase(str,base,start);this.negative=start;this._normalize();if(endian==="le")this.reverse();return this}_fromHex(str,start){this.length=Math.max(2,Math.ceil((str.length-start)/6));this.words=new Array(this.length);for(let i=0;i=start;i-=6){const w=parseHex(str,i,i+6);this.words[j]|=w<>>26-off&4194303;off+=24;if(off>=26){off-=26;j+=1}}if(i+6!==start){const w=parseHex(str,start,i+6);this.words[j]|=w<>>26-off&4194303}return this._strip()}_fromBase(str,base,start){this.words[0]=0;this.length=1;this.negative=0;let limbLen=0;let limbPow=1;for(;limbPow<=67108863;limbPow*=base)limbLen+=1;limbLen-=1;limbPow=limbPow/base|0;const total=str.length-start;const mod=total%limbLen;const end=Math.min(total,total-mod)+start;let i=start;for(;i>>0===data.length,"data","array-like");enforce(endian==="be"||endian==="le","endian","endianness");if(data.length===0){this.words[0]=0;this.length=1;this.negative=0;return this}this.length=Math.max(2,Math.ceil(data.length/3));this.words=new Array(this.length);this.negative=0;for(let i=0;i=2;i-=3){const w=data[i]|data[i-1]<<8|data[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j+=1}}switch(left){case 2:w=data[1]|data[0]<<8;break;case 1:w=data[0];break}}else{const len=data.length-left;for(let i=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j+=1}}switch(left){case 2:w=data[len]|data[len+1]<<8;break;case 1:w=data[len];break}}if(left>0){this.words[j]|=w<>>26-off&67108863}return this._strip()}decode(data,endian){return this.fromBuffer(data,endian)}from(num,base,endian){if(num==null)return this;if(base==="le"||base==="be")[base,endian]=[endian,base];if(typeof num==="number")return this.fromNumber(num,endian);if(typeof num==="bigint")return this.fromBigInt(num,endian);if(typeof num==="string")return this.fromString(num,base,endian);if(typeof num==="object"){if(BN.isBN(num))return this.fromBN(num,endian);if(num.length>>>0===num.length)return this.fromArrayLike(num,endian)}if(typeof num==="boolean")return this.fromBool(num);throw new TypeError("Non-numeric object passed to BN.")}static min(...args){let min=null;for(const num of args){enforce(BN.isBN(num),"num","bignum");if(!min||num.cmp(min)<0)min=num}return min||new BN(0)}static max(...args){let max=null;for(const num of args){enforce(BN.isBN(num),"num","bignum");if(!max||num.cmp(max)>0)max=num}return max||new BN(0)}static cmp(a,b){enforce(BN.isBN(a),"a","bignum");return a.cmp(b)}static ucmp(a,b){enforce(BN.isBN(a),"a","bignum");return a.ucmp(b)}static red(num){return new Red(num)}static barrett(num){return new Barrett(num)}static mont(num){return new Mont(num)}static _prime(name){if(primes[name])return primes[name];let prime;if(name==="p192")prime=new P192;else if(name==="p224")prime=new P224;else if(name==="p521")prime=new P521;else if(name==="k256")prime=new K256;else if(name==="p251")prime=new P251;else if(name==="p25519")prime=new P25519;else if(name==="p448")prime=new P448;else throw new Error(`Unknown prime: "${name}".`);primes[name]=prime;return prime}static prime(name){return BN._prime(name).p.clone()}static pow(num,exp){if(num===2)return BN.shift(1,exp);return(new BN).fromNumber(num).pown(exp)}static shift(num,bits){if(num===1)return new BN(0).usetn(bits,1);return(new BN).fromNumber(num).ishln(bits)}static mask(bits){return BN.shift(1,bits).isubn(1)}static randomBits(rng,bits){enforce(rng!=null,"rng","rng");enforce(bits>>>0===bits,"bits","uint32");if(typeof rng==="object"){enforce(typeof rng.randomBytes==="function","rng","rng");const size=bits+7>>>3;const total=size*8;const bytes=rng.randomBytes(size);enforce(bufferExports.Buffer.isBuffer(bytes),"bytes","buffer");if(bytes.length!==size)throw new RangeError("Invalid number of bytes returned from RNG.");const num=BN.fromBuffer(bytes);if(total>bits)num.iushrn(total-bits);return num}enforce(typeof rng==="function","rng","rng");const num=rng(bits);enforce(BN.isBN(num),"num","bignum");range(num.negative===0,"RNG");nonred(!num.red,"RNG");if(num.bitLength()>bits)throw new RangeError("Invalid number of bits returned from RNG.");return num}static random(rng,min,max){min=BN.cast(min,16);max=BN.cast(max,16);if(min.cmp(max)>0)throw new RangeError("Minimum cannot be greater than maximum.");const space=max.sub(min).iabs();const bits=space.bitLength();if(bits===0)return min.clone();for(;;){const num=BN.randomBits(rng,bits);if(num.cmp(space)>=0)continue;num.iadd(min);return num}}static of(num,endian){return(new BN).of(num,endian)}static fromNumber(num,endian){return(new BN).fromNumber(num,endian)}static fromDouble(num,endian){return(new BN).fromDouble(num,endian)}static fromBigInt(num,endian){return(new BN).fromBigInt(num,endian)}static fromBool(value){return(new BN).fromBool(value)}static fromString(str,base,endian){return(new BN).fromString(str,base,endian)}static fromJSON(json){return(new BN).fromJSON(json)}static fromBN(num){return(new BN).fromBN(num)}static fromArray(data,endian){return(new BN).fromArray(data,endian)}static fromBuffer(data,endian){return(new BN).fromBuffer(data,endian)}static fromArrayLike(data,endian){return(new BN).fromArrayLike(data,endian)}static decode(data,endian){return(new BN).decode(data,endian)}static from(num,base,endian){return(new BN).from(num,base,endian)}static cast(num,base,endian){if(BN.isBN(num))return num;return new BN(num,base,endian)}static isBN(obj){return obj instanceof BN}}BN.BN=BN;BN.wordSize=26;BN.native=0;class Prime{constructor(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=BN.shift(1,this.n).isub(this.p);this.lo=this.p.clone();this.one=this.p.clone()}ireduce(num){const neg=num.negative!==0;let bits=num.bitLength();assert(bits<=this.n*2);num.negative=0;while(bits>this.n){this.split(num,this.lo);this.imulK(num);num._iadd(num,this.lo);bits=num.bitLength()}const cmp=bits0){num._isub(num,this.p)}else;if(neg&&!num.isZero())num._isub(this.p,num);return num}split(input,out){input._split(this.n,out)}imulK(num){return num.imul(this.k)}pm2(x1){throw new Error("Not implemented.")}fermat(x){return this.pm2(x)}}class Prime34 extends Prime{constructor(name,p){super(name,p)}pm3d4(x1){throw new Error("Not implemented.")}pp1d4(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;const r=this.pp1d4(x);if(!red.sqr(r).eq(x))throw new SquareRootError(r);return r}divsqrt(u,v){const{red}=u;const u2=red.sqr(u);const u3=red.mul(u2,u);const u5=red.mul(u3,u2);const v3=red.mul(red.sqr(v),v);const p=this.pm3d4(red.mul(u5,v3));const x=red.mul(red.mul(u3,v),p);const c=red.mul(v,red.sqr(x));if(c.eq(u))return x;throw new SquareRootError(x)}}class Prime58 extends Prime{constructor(name,p,sm1){super(name,p);this.sm1=new BN(sm1,16)}pm5d8(x1){throw new Error("Not implemented.")}pp3d8(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;const sm1=this.sm1._forceRed(red);const r=this.pp3d8(x);if(red.sqr(r).eq(x))return r;const c=red.mul(r,sm1);if(red.sqr(c).eq(x))return c;throw new SquareRootError(r)}divsqrt(u,v){const{red}=u;const sm1=this.sm1._forceRed(red);const v3=red.mul(red.sqr(v),v);const v7=red.mul(red.sqr(v3),v);const p=this.pm5d8(red.mul(u,v7));const x=red.mul(red.mul(u,v3),p);const c=red.mul(v,red.sqr(x));if(c.eq(u))return x;const mc=red.ineg(c);if(mc.eq(u))return red.mul(x,sm1);if(mc.eq(red.mul(u,sm1)))throw new SquareRootError(red.mul(x,sm1));throw new SquareRootError(x)}}class Prime116 extends Prime{constructor(name,p,g){super(name,p);this.g=new BN(g,16);this.z=this.p.subn(1).zeroBits()}powS(x1){throw new Error("Not implemented.")}powE(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;switch(red.jacobi(x)){case-1:throw new SquareRootError(x);case 0:return x.clone()}let g=this.g._forceRed(red);let y=this.powE(x);let b=this.powS(x);let k=this.z;for(;;){let t=b;let m=0;while(t.cmpn(1)!==0&&m>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10)input.length-=10;else input.length-=9;input._strip()}imulK(num){num._expand(num.length+2);let lo=0;for(let i=0;i>>26;num.words[i]=w&67108863}if(carry!==0){num._alloc(num.length+1);num.words[num.length++]=carry}return num}core(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const x3=red.sqrnmul(x2,1,x1);const x6=red.sqrnmul(x3,3,x3);const x12=red.sqrnmul(x6,6,x6);const x24=red.sqrnmul(x12,12,x12);const x48=red.sqrnmul(x24,24,x24);const x96=red.sqrnmul(x48,48,x48);const x192=red.sqrnmul(x96,96,x96);const x240=red.sqrnmul(x192,48,x48);const x246=red.sqrnmul(x240,6,x6);const x247=red.sqrnmul(x246,1,x1);return x247}pm3d4(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pm2(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);const r3=red.sqrn(r2,1);const r4=red.sqrnmul(r3,1,x1);return r4}pp1d4(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrnmul(r0,1,x1);const r2=red.sqrn(r1,1);return r2}}class P25519 extends Prime58{constructor(){super("p25519","7fffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff ffffffff ffffffed","2b832480 4fc1df0b 2b4d0099 3dfbd7a7"+"2f431806 ad2fe478 c4ee1b27 4a0ea0b0")}imulK(num){let carry=0;for(let i=0;i>>26;num.words[i]=w&67108863}if(carry!==0){num._alloc(num.length+1);num.words[num.length++]=carry}return num}core(x1,x2){const{red}=x1;const x4=red.sqrnmul(x2,2,x2);const x5=red.sqrnmul(x4,1,x1);const x10=red.sqrnmul(x5,5,x5);const x20=red.sqrnmul(x10,10,x10);const x40=red.sqrnmul(x20,20,x20);const x50=red.sqrnmul(x40,10,x10);const x100=red.sqrnmul(x50,50,x50);const x200=red.sqrnmul(x100,100,x100);const x250=red.sqrnmul(x200,50,x50);return x250}pm5d8(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pm2(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);const r3=red.sqrn(r2,1);const r4=red.sqrnmul(r3,2,x2);return r4}pp3d8(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrnmul(r0,1,x1);const r2=red.sqrn(r1,1);return r2}}class P448 extends Prime34{constructor(){super("p448","ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff fffffffe ffffffff"+"ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff")}imulK(num){const one=this.one.inject(num);return num.iushln(224)._iadd(num,one)}core(x1,x2){const{red}=x1;const x3=red.sqrnmul(x2,1,x1);const x6=red.sqrnmul(x3,3,x3);const x9=red.sqrnmul(x6,3,x3);const x11=red.sqrnmul(x9,2,x2);const x22=red.sqrnmul(x11,11,x11);const x44=red.sqrnmul(x22,22,x22);const x88=red.sqrnmul(x44,44,x44);const x176=red.sqrnmul(x88,88,x88);const x220=red.sqrnmul(x176,44,x44);const x222=red.sqrnmul(x220,2,x2);return x222}pm3d4(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const x222=this.core(x1,x2);const r0=red.sqrnmul(x222,1,x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,222,x222);return r2}pm2(x1){const{red}=x1;const r0=this.pm3d4(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pp1d4(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrnmul(r0,2,x2);const r2=red.sqrn(r1,222);return r2}}class Red{constructor(m){let prime=null;if(typeof m==="string"){prime=BN._prime(m);m=prime.p}enforce(BN.isBN(m),"m","bignum");nonred(!m.red,"reduction");range(m.sign()>0,"reduction");this.m=m;this.prime=prime;this.mb=null;this.sm1=null}_verify1(a){range(a.negative===0,"red");red(a.red!=null,"red")}_verify2(a,b){range((a.negative|b.negative)===0,"red");red(a.red!=null&&a.red===b.red,"red")}get mont(){return false}precompute(){if(this.sm1===null&&this.m.andln(7)===5){if(this.prime){this.sm1=this.prime.sm1.clone()._forceRed(this)}else{const x=new BN(2).toRed(this);const e=this.m.subn(1).iushrn(2);this.sm1=this.pow(x,e)}}return this}convertTo(num){const res=num.mod(this.m);res.red=this;return res}convertFrom(num){const res=num.clone();res.red=null;return res}intTo(a){return a}intFrom(a){return a}imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.imod(this.m)._forceRed(this)}iadd(a,b){this._verify2(a,b);a._iadd(a,b);if(a.ucmp(this.m)>=0)a._isub(a,this.m);return a}add(a,b){if(a.length=0)a._isub(a,this.m);return a}addn(a,num){return this.iaddn(a.clone(),num)}isub(a,b){this._verify2(a,b);const cmp=a.ucmp(b);if(cmp===0){a.words[0]=0;a.length=1;return a}if(cmp<0){a._isub(b,a);a._isub(this.m,a)}else{a._isub(a,b)}return a}sub(a,b){return this.isub(a.clone(),b)}isubn(a,num){this._verify1(a);if(num<0)return this.iaddn(a,-num);if(this.m.length===1)num%=this.m.words[0];if(a.length===1&&a.words[0]=0)a._isub(a,this.m)}else{this.imod(a)}if(neg)this.ineg(a);return a}muln(a,num){return this.imuln(a.clone(),num)}idiv(a,b){return this.div(a,b)._move(a)}div(a,b){return this.mul(a,this.invert(b))}idivn(a,num){return this.divn(a,num)._move(a)}divn(a,num){return this.div(a,this.convertTo(new BN(num)))}ipow(a,num){return this.pow(a,num)._move(a)}pow(a,num){this._verify1(a);if(num.isNeg())a=this.invert(a);if(num.length===1)return this.pown(a,num.words[0]);if(HAS_BIGINT&&!this.prime)return this.powInt(a,num);return this.powNum(a,num)}powNum(a,num){const one=new BN(1).toRed(this);const wnd=new Array(WND_SIZE);const a2=this.sqr(a);wnd[0]=a;for(let i=1;i=WND_WIDTH){let width=WND_WIDTH;let bits=num.bits(i-width,width);if(bits>=1}if(r===one){r=wnd[bits>>1].clone()}else{r=this.sqrn(r,width);r=this.mul(r,wnd[bits>>1])}i-=width}if(i>0){const bits=num.bits(0,i);while(i--){r=this.sqr(r);if(bits>>i&1)r=this.mul(r,a)}}return r}powInt(a,num){if(this.mb===null)this.mb=this.m.toBigInt();const x=this.intFrom(a.toBigInt());const y=powInt(x,num,this.mb);const z=this.intTo(y);return BN.fromBigInt(z)._forceRed(this)}sqrn(a,n){while(n--)a=this.sqr(a);return a}sqrnmul(a,n,b){return this.mul(this.sqrn(a,n),b)}ipown(a,num){return this.pown(a,num)._move(a)}pown(a,num){this._verify1(a);if(num<0){a=this.invert(a);num=-num}if(num===0)return new BN(1).toRed(this);if(num===1)return a.clone();const bits=countBits(num);let r=a;for(let i=bits-2;i>=0;i--){r=this.sqr(r);if(num>>i&1)r=this.mul(r,a)}return r}isqr(a){return this.imul(a,a)}sqr(a){return this.mul(a,a)}isqrt(x){return this.sqrt(x)._move(x)}sqrt(x){this._verify1(x);if(this.prime)return this.prime.sqrt(x);if(this.m.andln(3)===3)return this.sqrt3mod4(x);if(this.m.andln(7)===5){if(this.sm1!=null)return this.sqrt5mod8sm1(x);return this.sqrt5mod8(x)}return this.sqrt0(x)}sqrt3mod4(x){const e=this.m.addn(1).iushrn(2);const b=this.pow(x,e);if(!this.sqr(b).eq(x))throw new SquareRootError(b);return b}sqrt5mod8(x){const one=new BN(1).toRed(this);const e=this.m.ushrn(3);const x2=this.add(x,x);const alpha=this.pow(x2,e);const beta=this.mul(x2,this.sqr(alpha));const b=this.mul(this.mul(alpha,x),this.isub(beta,one));if(!this.sqr(b).eq(x))throw new SquareRootError(b);return b}sqrt5mod8sm1(x){const e=this.m.addn(3).iushrn(3);const b=this.pow(x,e);if(this.sqr(b).eq(x))return b;const c=this.mul(b,this.sm1);if(this.sqr(c).eq(x))return c;throw new SquareRootError(b)}sqrt0(x){if(this.m.cmpn(1)===0||!this.m.isOdd())throw new Error("Invalid prime.");switch(this.jacobi(x)){case-1:throw new SquareRootError(x);case 0:return x.clone()}const one=new BN(1).toRed(this);const s=this.m.subn(1);const e=s._makeOdd();const n=new BN(2).toRed(this);while(this.jacobi(n)!==-1)this.iadd(n,one);let g=this.pow(n,s);let b=this.pow(x,s);let y=this.pow(x,s.iaddn(1).iushrn(1));let k=e;for(;;){let t=b;let m=0;while(!t.eq(one)&&m=0;return this.kronecker(a)>=0}ishl(a,num){this._verify1(a);return this.imod(a.iushl(num))}shl(a,num){return this.ishl(a.clone(),num)}ishln(a,num){this._verify1(a);a.iushln(num);if(num<=4){while(a.ucmp(this.m)>=0)a._isub(a,this.m)}else{this.imod(a)}return a}shln(a,num){return this.ishln(a.clone(),num)}ineg(a){this._verify1(a);if(!a.isZero())a._isub(this.m,a);return a}neg(a){return this.ineg(a.clone())}eq(a,b){this._verify2(a,b);return a.ucmp(b)===0}eqn(a,num){this._verify1(a);if(this.m.length===1){num%=this.m.words[0];if(num<0)num+=this.m.words[0];return a.ucmpn(num)===0}if(num<0){this.m._isubn(-num);const cmp=a.ucmp(this.m);this.m._iaddn(-num);return cmp===0}return a.ucmpn(num)===0}isHigh(a){return!this.isLow(a)}isLow(a){this._verify1(a);return a.ucmp(this.m.ushrn(1))<=0}isOdd(a){this._verify1(a);return a.isOdd()}isEven(a){this._verify1(a);return a.isEven()}legendre(num){this._verify1(num);if(this.m.isEven())throw new Error("legendre: `num` must be odd.");const e=this.m.subn(1).iushrn(1);const symbol=this.pow(num,e);if(symbol.isZero())return 0;const one=new BN(1).toRed(this);if(symbol.eq(one))return 1;if(symbol.eq(this.ineg(one)))return-1;throw new Error("Invalid prime.")}jacobi(a){this._verify1(a);return a.jacobi(this.m)}kronecker(a){this._verify1(a);return a.kronecker(this.m)}iinvert(a){return this.invert(a)._move(a)}invert(a){this._verify1(a);return a.invert(this.m)._forceRed(this)}ifermat(a){return this.fermat(a)._move(a)}fermat(a){this._verify1(a);if(a.isZero()||this.m.cmpn(1)===0)throw new RangeError("Not invertible.");if(this.prime)return this.prime.fermat(a);return this.pow(a,this.m.subn(2))}invertAll(elems){enforce(Array.isArray(elems),"elems","array");for(const elem of elems){enforce(BN.isBN(elem),"elem","bignum");this._verify1(elem)}if(this.m.cmpn(1)===0||this.m.isEven())throw new RangeError("Not invertible.");const len=elems.length;const invs=new Array(len);if(len===0)return invs;let acc=new BN(1).toRed(this);for(let i=0;i=0;i--){if(elems[i].isZero())continue;invs[i]=this.mul(acc,invs[i]);acc=this.mul(acc,elems[i])}return invs}[custom](){if(this.prime)return``;return``}}class Barrett extends Red{constructor(m){super(m);this.prime=null;this.n=this.m.bitLength();if(this.n%26!==0)this.n+=26-this.n%26;this.k=this.n*2;this.w=this.k/26;this.b=BN.shift(1,this.k).div(this.m)}convertTo(num){if(num.length>this.w)return super.convertTo(num);return this.imod(num.clone())}_shift(q){let i=0;let j=this.w;while(j=0)a._isub(a,this.m);if(neg&&!a.isZero())a._isub(this.m,a);a.red=this;return a}}class Mont extends Red{constructor(m){super(m);this.prime=null;this.n=this.m.length*26;this.r=BN.shift(1,this.n);this.r2=BN.shift(1,this.n*2).imod(this.m);this.ri=this.r.invert(this.m);this.mi=this.r.mul(this.ri).isubn(1).div(this.m);this.rib=null}get mont(){return true}convertTo(num){if(num.isNeg()||num.ucmp(this.m)>=0)return this.imod(num.ushln(this.n));return this.mul(num,this.r2)}convertFrom(num){const r=this.mul(num,new BN(1));r.red=null;return r}intTo(a){return(a<=0)u._isub(u,this.m);return u._forceRed(this)}imuln(a,num){this._verify1(a);if(a.isZero())return a;if(num===0){a.words[0]=0;a.length=1;return a}const neg=num<0;if(neg)num=-num;if(this.m.length===1)num%=this.m.words[0];const bits=countBits(num);if(bits>5){this.imul(a,this.convertTo(new BN(num)))}else if((num&num-1)===0){for(let i=0;i=0;i--){this.iadd(a,a);if(num>>i&1)this.iadd(a,c)}}if(neg)this.ineg(a);return a}eqn(a,num){this._verify1(a);if(num===0)return a.isZero();return a.ucmp(this.convertTo(new BN(num)))===0}isLow(a){this._verify1(a);return this.convertFrom(a).ucmp(this.m.ushrn(1))<=0}isOdd(a){this._verify1(a);return this.convertFrom(a).isOdd()}isEven(a){this._verify1(a);return this.convertFrom(a).isEven()}invert(a){this._verify1(a);return this.imod(a.invert(this.m).mul(this.r2))}}function makeError(Error,msg,start){const err=new Error(msg);if(Error.captureStackTrace)Error.captureStackTrace(err,start);return err}function assert(value,message){if(!value){const msg=message||"Assertion failed.";throw makeError(Error,msg,assert)}}function enforce(value,name,type){if(!value){const msg=`"${name}" must be a(n) ${type}.`;throw makeError(TypeError,msg,enforce)}}function range(value,name){if(!value){const msg=`"${name}" only works with positive numbers.`;throw makeError(RangeError,msg,range)}}function red(value,name){if(!value){const msg=`"${name}" only works with red numbers.`;throw makeError(TypeError,msg,red)}}function nonred(value,name){if(!value){const msg=`"${name}" only works with normal numbers.`;throw makeError(TypeError,msg,nonred)}}function nonzero(value){if(!value){const msg="Cannot divide by zero.";throw makeError(RangeError,msg,nonzero)}}class SquareRootError extends Error{constructor(result){super();this.name="SquareRootError";this.message="X is not a square mod P.";this.result=result.fromRed();if(Error.captureStackTrace)Error.captureStackTrace(this,SquareRootError)}}function isInteger(num){return Number.isSafeInteger(num)}function isSMI(num){return isInteger(num)&&num>=-67108863&&num<=67108863}function allocate(ArrayType,size){if(ArrayType.allocUnsafeSlow)return ArrayType.allocUnsafeSlow(size);return new ArrayType(size)}function getBase(base){if(base==null)return 10;if(typeof base==="number")return base;switch(base){case"bin":return 2;case"oct":return 8;case"dec":return 10;case"hex":return 16}return 0}function countBits(w){if(Math.clz32)return 32-Math.clz32(w);let t=w;let r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}function zeroBits(w){if(w===0)return 26;let t=w;let r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0)r+=1;return r}function parseHex(str,start,end){const len=Math.min(str.length,end);let r=0;let z=0;for(let i=start;i=49&&c<=54){b=c-49+10}else if(c>=17&&c<=22){b=c-17+10}else{b=c}r|=b;z|=b}if(z&-16)throw new Error("Invalid string.");return r}function parseBase(str,start,end,mul){const len=Math.min(str.length,end);let r=0;for(let i=start;i=49){b=c-49+10}else if(c>=17){b=c-17+10}else{b=c}if(c<0||c>207||b>=mul)throw new Error("Invalid string.");r+=b}return r}function powInt(x,e,m){const one=BigInt(1);const wnd=new Array(WND_SIZE);const x2=x*x%m;wnd[0]=x;for(let i=1;i=WND_WIDTH){let width=WND_WIDTH;let bits=e.bits(i-width,width);if(bits>=1}if(r===one){r=wnd[bits>>1]}else{r=sqrn(r,width,m);r=r*wnd[bits>>1]%m}i-=width}if(i>0){const bits=e.bits(0,i);while(i--){r=r*r%m;if(bits>>i&1)r=r*x%m}}return r}function sqrn(x,n,m){for(let i=0;i>>26;let rword=carry&67108863;const min=Math.max(0,k-self.length+1);const max=Math.min(k,num.length-1);for(let j=min;j<=max;j++){const i=k-j;const a=self.words[i];const b=num.words[j];const r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0)out.words[k]=carry|0;else out.length-=1;return out._strip()}function bigMulTo(self,num,out){const len=self.length+num.length;out.negative=self.negative^num.negative;out._alloc(len);out.length=len;let carry=0;let hncarry=0;let k=0;for(;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0)out.words[k]=carry;else out.length-=1;return out._strip()}function jumboMulTo(x,y,out){if(!HAS_BIGINT||x.length+y.length>82595519)return bigMulTo(x,y,out);const zero=BigInt(0);const mask=BigInt(67108863);const shift=BigInt(26);let z=x.toBigInt()*y.toBigInt();const neg=zzero){out.words[i++]=Number(z&mask);z>>=shift}if(i===0)out.words[i++]=0;out.length=i;out.negative=neg;return out}function comb10MulTo(self,num,out){const a=self.words;const b=num.words;const o=out.words;const a0=a[0]|0;const al0=a0&8191;const ah0=a0>>>13;const a1=a[1]|0;const al1=a1&8191;const ah1=a1>>>13;const a2=a[2]|0;const al2=a2&8191;const ah2=a2>>>13;const a3=a[3]|0;const al3=a3&8191;const ah3=a3>>>13;const a4=a[4]|0;const al4=a4&8191;const ah4=a4>>>13;const a5=a[5]|0;const al5=a5&8191;const ah5=a5>>>13;const a6=a[6]|0;const al6=a6&8191;const ah6=a6>>>13;const a7=a[7]|0;const al7=a7&8191;const ah7=a7>>>13;const a8=a[8]|0;const al8=a8&8191;const ah8=a8>>>13;const a9=a[9]|0;const al9=a9&8191;const ah9=a9>>>13;const b0=b[0]|0;const bl0=b0&8191;const bh0=b0>>>13;const b1=b[1]|0;const bl1=b1&8191;const bh1=b1>>>13;const b2=b[2]|0;const bl2=b2&8191;const bh2=b2>>>13;const b3=b[3]|0;const bl3=b3&8191;const bh3=b3>>>13;const b4=b[4]|0;const bl4=b4&8191;const bh4=b4>>>13;const b5=b[5]|0;const bl5=b5&8191;const bh5=b5>>>13;const b6=b[6]|0;const bl6=b6&8191;const bh6=b6>>>13;const b7=b[7]|0;const bl7=b7&8191;const bh7=b7>>>13;const b8=b[8]|0;const bl8=b8&8191;const bh8=b8>>>13;const b9=b[9]|0;const bl9=b9&8191;const bh9=b9>>>13;let c=0;let lo,mid,hi;out.negative=self.negative^num.negative;out._alloc(20);out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);let w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;let w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;let w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;let w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;let w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;let w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;let w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;let w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;let w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;let w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;let w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;let w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;let w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;let w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;let w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;let w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;let w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;let w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);let w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length+=1}return out}if(!Math.imul)comb10MulTo=smallMulTo;BN.Red=Red;bn=BN;return bn}var bnBrowser;var hasRequiredBnBrowser;function requireBnBrowser(){if(hasRequiredBnBrowser)return bnBrowser;hasRequiredBnBrowser=1;bnBrowser=requireBn();return bnBrowser}var chacha20;var hasRequiredChacha20;function requireChacha20(){if(hasRequiredChacha20)return chacha20;hasRequiredChacha20=1;const assert=requireAssert();const BIG_ENDIAN=new Int8Array(new Int16Array([1]).buffer)[0]===0;class ChaCha20{constructor(){this.state=new Uint32Array(16);this.stream=new Uint32Array(16);this.bytes=new Uint8Array(this.stream.buffer);this.pos=-1;if(BIG_ENDIAN)this.bytes=bufferExports.Buffer.alloc(64)}init(key,nonce,counter){if(counter==null)counter=0;assert(bufferExports.Buffer.isBuffer(key));assert(bufferExports.Buffer.isBuffer(nonce));assert(Number.isSafeInteger(counter));if(key.length!==16&&key.length!==32)throw new RangeError("Invalid key size.");if(nonce.length>=24){key=ChaCha20.derive(key,nonce.slice(0,16));nonce=nonce.slice(16)}this.state[0]=1634760805;this.state[1]=key.length<32?824206446:857760878;this.state[2]=key.length<32?2036477238:2036477234;this.state[3]=1797285236;this.state[4]=readU32(key,0);this.state[5]=readU32(key,4);this.state[6]=readU32(key,8);this.state[7]=readU32(key,12);this.state[8]=readU32(key,16%key.length);this.state[9]=readU32(key,20%key.length);this.state[10]=readU32(key,24%key.length);this.state[11]=readU32(key,28%key.length);this.state[12]=counter>>>0;if(nonce.length===8){this.state[13]=counter/4294967296>>>0;this.state[14]=readU32(nonce,0);this.state[15]=readU32(nonce,4)}else if(nonce.length===12){this.state[13]=readU32(nonce,0);this.state[14]=readU32(nonce,4);this.state[15]=readU32(nonce,8)}else if(nonce.length===16){this.state[12]=readU32(nonce,0);this.state[13]=readU32(nonce,4);this.state[14]=readU32(nonce,8);this.state[15]=readU32(nonce,12)}else{throw new RangeError("Invalid nonce size.")}this.pos=0;return this}encrypt(data){assert(bufferExports.Buffer.isBuffer(data));if(this.pos===-1)throw new Error("Context is not initialized.");for(let i=0;i>>32-b}function readU32(data,off){return data[off++]+data[off++]*256+data[off++]*65536+data[off]*16777216}function writeU32(dst,num,off){dst[off++]=num;num>>>=8;dst[off++]=num;num>>>=8;dst[off++]=num;num>>>=8;dst[off++]=num;return off}chacha20=ChaCha20;return chacha20}var chacha20Browser;var hasRequiredChacha20Browser;function requireChacha20Browser(){if(hasRequiredChacha20Browser)return chacha20Browser;hasRequiredChacha20Browser=1;chacha20Browser=requireChacha20();return chacha20Browser}var hmac;var hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;const assert=requireAssert();class HMAC{constructor(Hash,size,x=[],y=[]){assert(typeof Hash==="function");assert(size>>>0===size);assert(Array.isArray(x));assert(Array.isArray(y));this.hash=Hash;this.size=size;this.x=x;this.y=y;this.inner=new Hash;this.outer=new Hash}init(key){assert(bufferExports.Buffer.isBuffer(key));if(key.length>this.size){const Hash=this.hash;const h=new Hash;h.init(...this.x);h.update(key);key=h.final(...this.y);assert(key.length<=this.size)}const pad=bufferExports.Buffer.alloc(this.size);for(let i=0;i0){let want=64-pos;if(want>len)want=len;data.copy(this.block,pos,off,off+want);pos+=want;len-=want;off+=want;if(pos<64)return;this._transform(this.block,0)}while(len>=64){this._transform(data,off);off+=64;len-=64}if(len>0)data.copy(this.block,0,off,off+len)}_final(out){assert(this.size!==FINALIZED,"Context is not initialized.");const pos=this.size&63;const len=this.size*8;writeU32(DESC,len*(1/4294967296)>>>0,0);writeU32(DESC,len>>>0,4);this._update(PADDING,1+(119-pos&63));this._update(DESC,8);for(let i=0;i<8;i++){writeU32(out,this.state[i],i*4);this.state[i]=0}for(let i=0;i<64;i++)this.msg[i]=0;for(let i=0;i<64;i++)this.block[i]=0;this.size=FINALIZED;return out}_transform(chunk,pos){const W=this.msg;let a=this.state[0];let b=this.state[1];let c=this.state[2];let d=this.state[3];let e=this.state[4];let f=this.state[5];let g=this.state[6];let h=this.state[7];let i=0;for(;i<16;i++)W[i]=readU32(chunk,pos+i*4);for(;i<64;i++)W[i]=sigma1(W[i-2])+W[i-7]+sigma0(W[i-15])+W[i-16];for(i=0;i<64;i++){const t1=h+Sigma1(e)+Ch(e,f,g)+K[i]+W[i];const t2=Sigma0(a)+Maj(a,b,c);h=g;g=f;f=e;e=d+t1>>>0;d=c;c=b;b=a;a=t1+t2>>>0}this.state[0]+=a;this.state[1]+=b;this.state[2]+=c;this.state[3]+=d;this.state[4]+=e;this.state[5]+=f;this.state[6]+=g;this.state[7]+=h}static hash(){return new SHA256}static hmac(){return new HMAC(SHA256,64)}static digest(data){return SHA256.ctx.init().update(data).final()}static root(left,right){assert(bufferExports.Buffer.isBuffer(left)&&left.length===32);assert(bufferExports.Buffer.isBuffer(right)&&right.length===32);return SHA256.ctx.init().update(left).update(right).final()}static multi(x,y,z){const{ctx}=SHA256;ctx.init();ctx.update(x);ctx.update(y);if(z)ctx.update(z);return ctx.final()}static mac(data,key){return SHA256.hmac().init(key).update(data).final()}}SHA256.native=0;SHA256.id="SHA256";SHA256.size=32;SHA256.bits=256;SHA256.blockSize=64;SHA256.zero=bufferExports.Buffer.alloc(32,0);SHA256.ctx=new SHA256;function Sigma0(x){return(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function Sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function sigma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function sigma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}function Ch(x,y,z){return z^x&(y^z)}function Maj(x,y,z){return x&y|z&(x|y)}function readU32(data,off){return data[off++]*16777216+data[off++]*65536+data[off++]*256+data[off]}function writeU32(data,num,off){data[off++]=num>>>24;data[off++]=num>>>16;data[off++]=num>>>8;data[off++]=num;return off}sha256$1=SHA256;return sha256$1}var sha256Browser;var hasRequiredSha256Browser;function requireSha256Browser(){if(hasRequiredSha256Browser)return sha256Browser;hasRequiredSha256Browser=1;sha256Browser=requireSha256();return sha256Browser}var batchRng;var hasRequiredBatchRng;function requireBatchRng(){if(hasRequiredBatchRng)return batchRng;hasRequiredBatchRng=1;const assert=requireAssert();const BN=requireBnBrowser();const ChaCha20=requireChacha20Browser();const SHA256=requireSha256Browser();class BatchRNG{constructor(curve,encode=key=>key){this.curve=curve;this.encode=encode;this.hash=new SHA256;this.chacha=new ChaCha20;this.key=bufferExports.Buffer.alloc(32,0);this.iv=bufferExports.Buffer.alloc(8,0);this.cache=[new BN(1),new BN(1)]}init(batch){assert(Array.isArray(batch));this.hash.init();for(const[msg,sig,key]of batch){this.hash.update(SHA256.digest(msg));this.hash.update(sig);this.hash.update(this.encode(key))}this.key=this.hash.final();this.cache[0]=new BN(1);this.cache[1]=new BN(1);return this}encrypt(counter){const size=this.curve.scalarSize*2;const data=bufferExports.Buffer.alloc(size,0);const left=data.slice(0,this.curve.scalarSize);const right=data.slice(this.curve.scalarSize);this.chacha.init(this.key,this.iv,counter);this.chacha.encrypt(data);return[this.curve.decodeScalar(left),this.curve.decodeScalar(right)]}refresh(counter){let overflow=0;for(;;){this.iv[4]=overflow;this.iv[5]=overflow>>>8;this.iv[6]=overflow>>>16;this.iv[7]=overflow>>>24;overflow+=1;const[s1,s2]=this.encrypt(counter);if(s1.isZero()||s1.cmp(this.curve.n)>=0)continue;if(s2.isZero()||s2.cmp(this.curve.n)>=0)continue;this.cache[0]=s1;this.cache[1]=s2;break}}generate(index){assert(index>>>0===index);if(index&1)this.refresh(index>>>1);return this.cache[index&1]}}batchRng=BatchRNG;return batchRng}var elliptic={};var hasRequiredElliptic;function requireElliptic(){if(hasRequiredElliptic)return elliptic;hasRequiredElliptic=1;const{custom}=requireCustomBrowser();const BN=requireBnBrowser();const types={AFFINE:0,JACOBIAN:1,PROJECTIVE:2,EXTENDED:3};const jsfIndex=[-3,-1,-5,-7,0,7,5,1,3];let uid=0;class Curve{constructor(Point,type,conf){this.Point=null;this.id=null;this.uid=uid++;this.ossl=null;this.type="base";this.endian="be";this.hash=null;this.prefix=null;this.context=false;this.prime=null;this.p=null;this.red=null;this.fieldSize=0;this.fieldBits=0;this.adjustedSize=0;this.signBit=0;this.mask=0;this.n=null;this.h=null;this.q=null;this.z=null;this.g=null;this.nh=null;this.scalarSize=0;this.scalarBits=0;this.zero=null;this.one=null;this.two=null;this.three=null;this.four=null;this.i2=null;this.i3=null;this.i4=null;this.i6=null;this.torsion=null;this.endo=null;this.hi=null;this._init(Point,type,conf)}_init(Point,type,conf){assert(typeof Point==="function");assert(typeof type==="string");assert(conf&&typeof conf==="object");assert(conf.red==null||conf.red instanceof BN.Red);assert(conf.p!=null,"Must pass a prime.");assert(conf.id==null||typeof conf.id==="string");assert(conf.ossl==null||typeof conf.ossl==="string");assert(conf.endian==null||typeof conf.endian==="string");assert(conf.hash==null||typeof conf.hash==="string");assert(conf.prefix==null||typeof conf.prefix==="string");assert(conf.context==null||typeof conf.context==="boolean");assert(conf.prime==null||typeof conf.prime==="string");assert(conf.torsion==null||Array.isArray(conf.torsion));this.Point=Point;this.id=conf.id||null;this.ossl=conf.ossl||null;this.type=type;this.endian=conf.endian||(type==="short"?"be":"le");this.hash=conf.hash||null;this.prefix=conf.prefix?bufferExports.Buffer.from(conf.prefix,"binary"):null;this.context=conf.context||false;this.prime=conf.prime||null;this.p=BN.fromJSON(conf.p);if(conf.red){this.red=conf.red}else{this.red=conf.prime?BN.red(conf.prime):BN.mont(this.p);this.red.precompute()}this.fieldSize=this.p.byteLength();this.fieldBits=this.p.bitLength();this.adjustedSize=this.fieldSize+((this.fieldBits&7)===0);this.signBit=this.adjustedSize*8-1;this.mask=255;if((this.fieldBits&7)!==0)this.mask=(1<<(this.fieldBits&7))-1;this.n=BN.fromJSON(conf.n||"0");this.h=BN.fromJSON(conf.h||"1");this.q=this.n.mul(this.h);this.z=BN.fromJSON(conf.z||"0").toRed(this.red);this.g=null;this.nh=this.n.ushrn(1);this.scalarSize=this.n.byteLength();this.scalarBits=this.n.bitLength();this.zero=new BN(0).toRed(this.red);this.one=new BN(1).toRed(this.red);this.two=new BN(2).toRed(this.red);this.three=new BN(3).toRed(this.red);this.four=new BN(4).toRed(this.red);this.i2=this.two.redInvert();this.i3=this.three.redInvert();this.i4=this.i2.redSqr();this.i6=this.i2.redMul(this.i3);this.torsion=new Array(this.h.word(0));for(let i=0;i0&&this.p.isOdd());assert(this.n.sign()>=0);assert(this.h.sign()>0&&this.h.cmpn(255)<=0);assert(this.endian==="be"||this.endian==="le");return this}_finalize(conf){assert(conf&&typeof conf==="object");this.g=conf.g?this.pointFromJSON(conf.g):this.point();if(conf.torsion){assert(conf.torsion.length===this.torsion.length);for(let i=0;ia.cmp(b));while(out.length>>0;let acc=this.jpoint();for(let i=0;i0;i--){for(let j=0;j=0;i--){const z=naf[i];if(i!==naf.length-1)acc=acc.dbl();if(z>0)acc=acc.add(points[z-1>>1]);else if(z<0)acc=acc.sub(points[-z-1>>1])}return acc}_wnafMulAdd(w,points,coeffs){assert(w>>>0===w);assert(Array.isArray(points));assert(Array.isArray(coeffs));assert(points.length===coeffs.length);const length=points.length;const wnd=new Array(length);const naf=new Array(length);let max=0;for(let i=0;i0&&point.type!==points[i-1].type)throw new Error("Cannot mix points.");wnd[i]=null;naf[i]=null;max=Math.max(max,coeff.bitLength()+1)}let ppoint=null;let pcoeff=null;let len=0;for(let i=0;i=0;i--){if(i!==max-1)acc=acc.dbl();for(let j=0;j0)acc=acc.add(wnd[j][z-1>>1]);else if(z<0)acc=acc.sub(wnd[j][-z-1>>1])}}return acc}_endoWnafMulAdd(points,coeffs){throw new Error("Not implemented.")}_scale(curve,invert){assert(curve instanceof Curve);assert(curve.p.eq(this.p));switch(curve.type){case"short":return this._scaleShort(curve,invert);case"mont":return this._scaleMont(curve,invert);case"edwards":return this._scaleEdwards(curve,invert);default:throw new Error("Not implemented.")}}_scaleShort(curve,invert){throw new Error("Not implemented.")}_scaleMont(curve,invert){throw new Error("Not implemented.")}_scaleEdwards(curve,invert){throw new Error("Not implemented.")}isElliptic(){throw new Error("Not implemented.")}jinv(){throw new Error("Not implemented.")}isComplete(){return false}precompute(rng){assert(!this.g.isInfinity(),"Must have base point.");assert(!this.n.isZero(),"Must have order.");this.g.precompute(this.n.bitLength(),rng);return this}scalar(num,base,endian){const k=new BN(num,base,endian);assert(!k.red);if(this.n.isZero())return k;return k.imod(this.n)}field(num,base,endian){const x=BN.cast(num,base,endian);if(x.red)return x.forceRed(this.red);return x.toRed(this.red)}point(x,y){throw new Error("Not implemented.")}jpoint(x,y,z){throw new Error("Not implemented.")}xpoint(x,z){throw new Error("Not implemented.")}cpoint(xx,xz,yy,yz){assert(xx instanceof BN);assert(xz instanceof BN);assert(yy instanceof BN);assert(yz instanceof BN);if(xz.isZero()||yz.isZero())return this.point();const z=xz.redMul(yz).redInvert();const x=xx.redMul(yz).redMul(z);const y=yy.redMul(xz).redMul(z);return this.point(x,y)}solveX2(y){throw new Error("Not implemented.")}solveX(y){return this.solveX2(y).redSqrt()}solveY2(x){throw new Error("Not implemented.")}solveY(x){return this.solveY2(x).redSqrt()}validate(point){throw new Error("Not implemented.")}pointFromX(x,sign){throw new Error("Not implemented.")}pointFromY(y,sign){throw new Error("Not implemented.")}isIsomorphic(curve){throw new Error("Not implemented.")}isIsogenous(curve){throw new Error("Not implemented.")}pointFromShort(point){throw new Error("Not implemented.")}pointFromMont(point,sign){throw new Error("Not implemented.")}pointFromEdwards(point){throw new Error("Not implemented.")}pointFromUniform(u){throw new Error("Not implemented.")}pointToUniform(p){throw new Error("Not implemented.")}pointFromHash(bytes,pake=false){assert(bufferExports.Buffer.isBuffer(bytes));assert(typeof pake==="boolean");if(bytes.length!==this.fieldSize*2)throw new Error("Invalid hash size.");const s1=bytes.slice(0,this.fieldSize);const s2=bytes.slice(this.fieldSize);const u1=this.decodeUniform(s1);const u2=this.decodeUniform(s2);const p1=this.pointFromUniform(u1);const p2=this.pointFromUniform(u2);const p3=p1.add(p2);return pake?p3.mulH():p3}pointToHash(p,subgroup,rng){assert(p instanceof this.Point);assert(subgroup>>>0===subgroup);const i=subgroup%this.torsion.length;const p0=p.add(this.torsion[i]);for(;;){const u1=this.randomField(rng);const p1=this.pointFromUniform(u1);if(p1.neg().eq(p1))continue;const p2=p0.sub(p1);const hint=randomInt(rng);let u2;try{u2=this.pointToUniform(p2,hint&15)}catch(e){if(e.message==="Invalid point.")continue;throw e}const s1=this.encodeUniform(u1,hint>>>8);const s2=this.encodeUniform(u2,hint>>>16);return bufferExports.Buffer.concat([s1,s2])}}randomScalar(rng){const max=this.n.isZero()?this.p:this.n;return BN.random(rng,1,max)}randomField(rng){return BN.random(rng,1,this.p).toRed(this.red)}randomPoint(rng){let p;for(;;){const x=this.randomField(rng);const sign=(randomInt(rng)&1)!==0;try{p=this.pointFromX(x,sign)}catch(e){continue}assert(p.validate());return p.mulH()}}mulAll(points,coeffs){return this.jmulAll(points,coeffs)}jmulAll(points,coeffs){assert(Array.isArray(points));assert(points.length===0||points[0]instanceof Point);if(this.endo&&points.length>0&&points[0].type===types.AFFINE)return this._endoWnafMulAdd(points,coeffs);return this._wnafMulAdd(5,points,coeffs)}mulH(k){assert(k instanceof BN);return this.imulH(k.clone())}imulH(k){assert(k instanceof BN);assert(!k.red);const word=this.h.word(0);if((word&word-1)===0){const bits=this.h.bitLength();return k.iushln(bits-1).imod(this.n)}return k.imuln(word).imod(this.n)}normalizeAll(points){assert(Array.isArray(points));const len=points.length;const z=new Array(len);for(let i=0;i>>0===bits);const msb=this.endian==="le"?this.fieldSize-1:0;const bytes=x.fromRed().encode(this.endian,this.fieldSize);bytes[msb]|=bits&~this.mask&255;return bytes}decodeUniform(bytes){assert(bufferExports.Buffer.isBuffer(bytes));if(bytes.length!==this.fieldSize)throw new Error("Invalid field size.");const x=BN.decode(bytes,this.endian);x.iumaskn(this.fieldBits);return x.toRed(this.red)}encodePoint(point,compact){assert(point instanceof Point);return point.encode(compact)}decodePoint(bytes){throw new Error("Not implemented.")}encodeX(point){throw new Error("Not implemented.")}decodeX(bytes){throw new Error("Not implemented.")}decodeEven(bytes){throw new Error("Not implemented.")}decodeSquare(bytes){throw new Error("Not implemented.")}toShort(){throw new Error("Not implemented.")}toMont(b0){throw new Error("Not implemented.")}toEdwards(a0){throw new Error("Not implemented.")}pointToJSON(point,pre){assert(point instanceof Point);return point.toJSON(pre)}pointFromJSON(json){throw new Error("Not implemented.")}toJSON(pre){let prefix,context;let n,z,endo;if(this.type==="edwards"){prefix=this.prefix?this.prefix.toString():null;context=this.context}if(!this.n.isZero())n=this.n.toJSON();if(!this.z.isZero()){z=this.z.fromRed();if(this.z.redIsHigh())z.isub(this.p);z=z.toString(16)}if(this.endo)endo=this.endo.toJSON();return{id:this.id,ossl:this.ossl,type:this.type,endian:this.endian,hash:this.hash,prefix:prefix,context:context,prime:this.prime,p:this.p.toJSON(),a:undefined,b:undefined,d:undefined,n:n,h:this.h.toString(16),s:undefined,z:z,c:undefined,g:this.g.toJSON(pre),endo:endo}}static fromJSON(json){return new this(json)}}class Point{constructor(curve,type){assert(curve instanceof Curve);assert(type>>>0===type);this.curve=curve;this.type=type;this.pre=null}_init(){throw new Error("Not implemented.")}_safeNAF(width){assert(width>>>0===width);if(this.pre&&this.pre.naf)return this.pre.naf;if(width===0)return null;const size=1<>>0===width);if(this.pre&&this.pre.naf)return this.pre.naf;if(width===0)return null;const odds=this._safeNAF(width).points;const points=this.curve.affinizeAll(odds);return new NAF(width,points)}_getWindows(width,bits){assert(width>>>0===width);assert(bits>>>0===bits);if(this.pre&&this.pre.windows)return this.pre.windows;if(width===0)return null;const size=1<>>0;const wnds=new Array(steps*size);let g=this.toJ();for(let i=0;i>>0===step);assert(power>>>0===power);if(this.pre&&this.pre.doubles)return this.pre.doubles;if(step===0)return null;const len=Math.ceil(power/step)+1;const dbls=new Array(len);let acc=this.toJ();let k=0;dbls[k++]=acc;for(let i=0;i>>0;return k.bitLength()<=steps*width}_hasDoubles(k){assert(k instanceof BN);if(!this.pre||!this.pre.doubles)return false;const{step,points}=this.pre.doubles;const power=k.bitLength()+1;return points.length>=Math.ceil(power/step)+1}_getJNAF(point){assert(point instanceof Point);assert(point.type===this.type);return[this,this.add(point),this.sub(point),point]}_blind(k,rng){assert(k instanceof BN);assert(!k.red);if(this.pre&&this.pre.blinding){const{blind,unblind}=this.pre.blinding;const t=k.sub(blind);return[this,t,unblind]}if(!rng)return[this,k,null];if(this.pre){if(this.curve.n.isZero())return[this,k,null];const a=this.curve.randomScalar(rng);const r=a.mul(this.curve.n);const t=r.iadd(k);return[this,t,null]}const p=this.randomize(rng);return[p,k,null]}clone(){throw new Error("Not implemented.")}precompute(bits,rng){assert(bits>>>0===bits);if(!this.pre)this.pre=new Precomp;if(!this.pre.naf)this.pre.naf=this._getNAF(9);if(!this.pre.doubles)this.pre.doubles=this._getDoubles(4,bits+1);if(!this.pre.beta)this.pre.beta=this._getBeta();if(!this.pre.blinding)this.pre.blinding=this._getBlinding(rng);return this}validate(){return this.curve.validate(this)}normalize(){return this}scale(a){throw new Error("Not implemented.")}randomize(rng){const z=this.curve.randomField(rng);return this.scale(z)}neg(){throw new Error("Not implemented.")}add(point){throw new Error("Not implemented.")}sub(point){assert(point instanceof Point);return this.add(point.neg())}dbl(){throw new Error("Not implemented.")}dblp(pow){assert(pow>>>0===pow);let r=this;for(let i=0;i0){q=n.clone();break}p=p.add(this)}return q}mul(k){return this.jmul(k)}muln(k){return this.jmuln(k)}mulBlind(k,rng){return this.jmulBlind(k,rng)}mulAdd(k1,p2,k2){return this.jmulAdd(k1,p2,k2)}mulH(){return this.jmulH()}div(k){return this.jdiv(k)}divn(k){return this.jdivn(k)}divH(){return this.jdivH()}jmul(k){if(this._hasDoubles(k))return this.curve._fixedNafMul(this,k);if(this.curve.endo&&this.type===types.AFFINE)return this.curve._endoWnafMulAdd([this],[k]);return this.curve._wnafMul(5,this,k)}jmuln(k){assert((k|0)===k);return this.jmul(new BN(k))}jmulBlind(k,rng=null){const[p,t,unblind]=this._blind(k,rng);const q=p.jmul(t);if(unblind)return q.add(unblind);return q}jmulAdd(k1,p2,k2){if(this.curve.endo&&this.type===types.AFFINE)return this.curve._endoWnafMulAdd([this,p2],[k1,k2]);return this.curve._wnafMulAdd(5,[this,p2],[k1,k2])}jmulH(){const word=this.curve.h.word(0);if((word&word-1)===0){const bits=this.curve.h.bitLength();return this.toJ().dblp(bits-1)}return this.jmul(this.curve.h)}jdiv(k){assert(k instanceof BN);assert(!k.red);return this.jmul(k.invert(this.curve.n))}jdivn(k){assert(!this.curve.n.isZero());if(this.curve.h.cmpn(k)===0)return this.jdivH();return this.jdiv(new BN(k))}jdivH(){if(this.curve.n.isZero())return this.toJ();if(this.curve.h.cmpn(1)===0)return this.toJ();if(this.curve.hi===null)this.curve.hi=this.curve.h.invert(this.curve.n);return this.jmul(this.curve.hi)}toP(){return this.normalize()}toJ(){return this}toX(){return this}key(){if(this.isInfinity())return`${this.curve.uid}:oo`;this.normalize();const x=this.getX().toString(16);const y=this.getY().toString(16);return`${this.curve.uid}:${x},${y}`}encode(compact){throw new Error("Not implemented.")}static decode(curve,bytes){throw new Error("Not implemented.")}encodeX(){throw new Error("Not implemented.")}static decodeX(curve,bytes){throw new Error("Not implemented.")}static decodeEven(curve,bytes){throw new Error("Not implemented.")}static decodeSquare(curve,bytes){throw new Error("Not implemented.")}toJSON(pre){throw new Error("Not implemented.")}static fromJSON(curve,json){throw new Error("Not implemented.")}[custom](){return""}}class ShortCurve extends Curve{constructor(conf){super(ShortPoint,"short",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.b=BN.fromJSON(conf.b).toRed(this.red);this.c=BN.fromJSON(conf.c||"0").toRed(this.red);this.ai=this.a.isZero()?this.zero:this.a.redInvert();this.zi=this.z.isZero()?this.zero:this.z.redInvert();this.zeroA=this.a.isZero();this.threeA=this.a.eq(this.three.redNeg());this.redN=this.n.toRed(this.red);this.pmodn=this.p.clone();this.highOrder=this.n.cmp(this.p)>=0;this.smallGap=false;this._finalize(conf)}_finalize(conf){super._finalize(conf);if(conf.endo!=null)this.endo=Endo.fromJSON(this,conf.endo);else this.endo=this._getEndomorphism();if(!this.n.isZero()){this.pmodn=this.p.mod(this.n);this.smallGap=this.p.div(this.n).cmpn(1)<=0}return this}static _isomorphism(curveA,curveB,custom,odd){assert(curveA instanceof BN);assert(curveB instanceof BN);assert(custom instanceof BN);assert(odd==null||typeof odd==="boolean");assert(!curveA.isZero()||!curveB.isZero());if(custom.isZero())throw new Error("Invalid coefficient.");if(curveA.isZero()){const customB=custom;const u6=customB.redDiv(curveB);const u2=uncube(u6);assert(u2.redJacobi()===1);return[curveA.clone(),customB.clone()]}if(curveB.isZero()){const customA=custom;const u4=customA.redDiv(curveA);const u2=u4.redSqrt();if(u2.redJacobi()!==1)u2.redINeg();if(u2.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");return[customA.clone(),curveB.clone()]}const customA=custom;const u4=customA.redDiv(curveA);const u2=u4.redSqrt();if(odd!=null){if(u2.redIsOdd()!==odd)u2.redINeg()}else{if(u2.redJacobi()!==1)u2.redINeg()}if(u2.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");const u6=u4.redMul(u2);const a=curveA.redMul(u4);const b=curveB.redMul(u6);assert(a.eq(customA));return[a,b]}_short(a0,odd){return ShortCurve._isomorphism(this.a,this.b,a0,odd)}_mont(b0,odd){const[r,s]=this._findRS(odd);const b=s.redInvert();const a=r.redMuln(3).redMul(b);if(b0!=null)return MontCurve._isomorphism(a,b,b0);return[a,b]}_edwards(a0,odd){const[r,s]=this._findRS(odd);const r3=r.redMuln(3);const s2=s.redMuln(2);const a=r3.redAdd(s2);const d=r3.redSub(s2);if(a0!=null)return EdwardsCurve._isomorphism(a,d,a0);return[a,d]}_findRS(sign){assert(sign==null||typeof sign==="boolean");assert(this.h.word(0)>=4);assert(!this.n.isZero());const x=this.one.redNeg();let p;for(;;){x.redIAdd(this.one);try{p=this.pointFromX(x.clone())}catch(e){continue}p=p.mul(this.n);if(p.isInfinity())continue;if(!p.y.isZero())continue;break}const r=p.x;const r2=r.redSqr();const s=r2.redMuln(3).redIAdd(this.a).redSqrt();if(sign!=null){if(s.redIsOdd()!==sign)s.redINeg()}return[r,s]}_scale0(a,b){assert(this.a.isZero()===a.isZero());assert(this.b.isZero()===b.isZero());if(this.a.isZero()){const u6=this.b.redDiv(this.field(b));const u2=uncube(u6);const u=u2.redSqrt();const u3=u2.redMul(u);assert(u3.redSqr().eq(u6));assert(!u.isZero());return[u2,u3]}if(this.b.isZero()){const u4=this.a.redDiv(this.field(a));const u2=u4.redSqrt();if(u2.redJacobi()!==1)u2.redINeg();const u=u2.redSqrt();const u3=u2.redMul(u);assert(u3.redMul(u).eq(u4));assert(!u.isZero());return[u2,u3]}const u4=this.a.redDiv(this.field(a));const u6=this.b.redDiv(this.field(b));const u2=u4.redSqrt();if(!u4.redMul(u2).eq(u6))u2.redINeg();assert(u4.redMul(u2).eq(u6));const u=u2.redSqrt();const u3=u2.redMul(u);assert(!u.isZero());return[u2,u3]}_scale1(x,y){const u2=this.g.x.redDiv(this.field(x));const u3=this.g.y.redDiv(this.field(y));const u=u2.redSqrt();if(!u2.redMul(u).eq(u3))u.redINeg();assert(u2.redMul(u).eq(u3));assert(!u.isZero());return[u2,u3]}_scaleShort(curve){assert(curve instanceof ShortCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this._scale0(curve.a,curve.b);return this._scale1(curve.g.x,curve.g.y)}_scaleMont(curve){assert(curve instanceof MontCurve);if(this.g.isInfinity()||curve.g.isInfinity()){const[a,b]=curve._short();return this._scale0(a,b)}const{x,y}=curve.g;const nx=x.redAdd(curve.a3).redMul(curve.bi);const ny=y.redMul(curve.bi);return this._scale1(nx,ny)}_scaleEdwards(curve){assert(curve instanceof EdwardsCurve);if(this.g.isInfinity()||curve.g.isInfinity()){const[a,b]=curve._short();return this._scale0(a,b)}const{x,y,z}=curve.g;const a5=curve.a.redMuln(5);const d5=curve.d.redMuln(5);const dma=curve.d.redSub(curve.a);const d5a=d5.redSub(curve.a);const da5=curve.d.redSub(a5);const ypz=y.redAdd(z);const ymz=y.redSub(z);const xx=d5a.redMul(y).redIAdd(da5.redMul(z));const xz=ymz.redMuln(12);const yy=dma.redMul(ypz).redMul(z);const yz=ymz.redMul(x).redIMuln(4);const zi=xz.redMul(yz).redInvert();const nx=xx.redMul(yz).redMul(zi);const ny=yy.redMul(xz).redMul(zi);return this._scale1(nx,ny)}_getEndomorphism(index=0){if(this.n.isZero()||this.g.isInfinity())return null;if(!this.zeroA||this.p.modrn(3)!==1||this.n.modrn(3)!==1)return null;const[b1,b2]=this._getEndoRoots(this.p);const beta=[b1,b2][index&1].toRed(this.red);const[l1,l2]=this._getEndoRoots(this.n);const p=this.point(this.g.x.redMul(beta),this.g.y);let lambda;if(this.g.mul(l1).eq(p)){lambda=l1}else{assert(this.g.mul(l2).eq(p));lambda=l2}const basis=this._getEndoBasis(lambda);const pre=this._getEndoPrecomp(basis);return new Endo(beta,lambda,basis,pre)}_getEndoRoots(num){const red=num===this.p?this.red:BN.mont(num);const two=new BN(2).toRed(red);const three=new BN(3).toRed(red);const i2=two.redInvert();const s1=three.redNeg().redSqrt().redMul(i2);const s2=s1.redNeg();const r1=s1.redSub(i2).fromRed();const r2=s2.redSub(i2).fromRed();return[r1,r2].sort(BN.cmp)}_getEndoBasis(lambda){const[rl,tl,rl1,tl1,rl2,tl2]=this._egcdSqrt(lambda);const a1=rl1;const b1=tl1.neg();const lhs=rl.sqr().iadd(tl.sqr());const rhs=rl2.sqr().iadd(tl2.sqr());let a2,b2;if(lhs.cmp(rhs)<=0){a2=rl;b2=tl.neg()}else{a2=rl2;b2=tl2.neg()}return[new Vector(a1,b1),new Vector(a2,b2)]}_egcdSqrt(lambda){assert(lambda instanceof BN);assert(!lambda.red);assert(lambda.sign()>0);assert(this.n.sign()>0);const sqrtn=this.n.ushrn(this.n.bitLength()>>>1);let u=lambda;let v=this.n.clone();let x1=new BN(1);let y1=new BN(0);let x2=new BN(0);let y2=new BN(1);let rl,tl;let rl1,tl1;let i=0;let j=0;let p;while(!u.isZero()&&i<2){const q=v.quo(u);const r=v.sub(q.mul(u));const x=x2.sub(q.mul(x1));const y=y2.sub(q.mul(y1));if(j===0&&r.cmp(sqrtn)<0){rl=p;tl=x1;rl1=r;tl1=x;j=1}p=r;v=u;u=r;x2=x1;x1=x;y2=y1;y1=y;i+=j}assert(j!==0,"Could not find r < sqrt(n).");const rl2=x2;const tl2=x1;return[rl,tl,rl1,tl1,rl2,tl2]}_getEndoPrecomp(basis){assert(Array.isArray(basis));assert(basis.length===2);assert(basis[0]instanceof Vector);assert(basis[1]instanceof Vector);const[v1,v2]=basis;const d=v1.a.mul(v2.b).isub(v1.b.mul(v2.a));const bits=d.bitLength();const align=bits>=160;assert(d.eq(this.n));let shift=bits+Math.ceil(bits/2)+1;let g1,g2;if(align)shift-=shift&63;while(shift>bits){g1=v2.b.ushln(shift).divRound(d);g2=v1.b.ushln(shift).divRound(d);if(g1.ucmp(d)<0&&g2.ucmp(d)<0)break;if(align)shift-=64;else shift-=1}if(shift<=bits)throw new Error("Could not calculate g1 and g2.");return[shift,g1,g2]}_endoSplit(k){assert(k instanceof BN);assert(!k.red);assert(!this.n.isZero());const[v1,v2]=this.endo.basis;const c1=v2.b.mul(k).divRound(this.n);const c2=v1.b.neg().mul(k).divRound(this.n);const p1=c1.mul(v1.a);const p2=c2.mul(v2.a);const q1=c1.ineg().mul(v1.b);const q2=c2.mul(v2.b);const k1=k.sub(p1).isub(p2);const k2=q1.isub(q2);return[k1,k2]}_endoBeta(point){assert(point instanceof ShortPoint);return[point,point._getBeta()]}_endoWnafMulAdd(points,coeffs){assert(Array.isArray(points));assert(Array.isArray(coeffs));assert(points.length===coeffs.length);assert(this.endo!=null);const len=points.length;const npoints=new Array(len*2);const ncoeffs=new Array(len*2);for(let i=0;i>>1];const u=n.redDivSqrt(d);if(u.redIsOdd()!==y.redIsOdd())u.redINeg();return u}_svdwf(u){const{c,z,zi,i2,i3}=this;const gz=this.solveY2(z);const z3=i3.redMul(zi.redSqr());const u2=u.redSqr();const u4=u2.redSqr();const t1=u2.redAdd(gz);const u2t1=u2.redMul(t1);const t2=u2t1.isZero()?u2t1:u2t1.redInvert();const t3=u4.redMul(t2).redMul(c);const t4=t1.redSqr().redMul(t1);const x1=c.redSub(z).redMul(i2).redISub(t3);const x2=t3.redSub(c.redAdd(z).redMul(i2));const x3=z.redSub(t4.redMul(t2).redMul(z3));const y1=this.solveY2(x1);const y2=this.solveY2(x2);const y3=this.solveY2(x3);const alpha=y1.redJacobi()|1;const beta=y2.redJacobi()|1;const i=mod((alpha-1)*beta,3);const x=[x1,x2,x3][i];const y=[y1,y2,y3][i];return[x,y]}_svdw(u){const[x,yy]=this._svdwf(u);const y=yy.redSqrt();if(y.redIsOdd()!==u.redIsOdd())y.redINeg();return this.point(x,y)}_svdwi(p,hint){const{b,c,z,zero,two}=this;const{x,y}=p;const r=hint&3;const z2=z.redSqr();const z3=z2.redMul(z);const z4=z2.redSqr();const gz=z3.redAdd(b);const gz2=gz.redMuln(2);const xx=x.redSqr();const x2z=x.redMuln(2).redIAdd(z);const xz2=x.redMul(z2);const c0=c.redSub(x2z);const c1=c.redAdd(x2z);const t0=xx.redMul(z2).redIAdd(z4).redIMuln(9);const t1=x.redMul(z3).redIMuln(18);const t2=gz.redMul(x.redSub(z)).redIMuln(12);const t3=r>=2?t0.redISub(t1).redIAdd(t2).redSqrt():zero;const t4=t3.redMul(z);const t5=z3.redISub(xz2).redIMuln(3).redISub(gz2);const n0=gz.redMul(c0);const n1=gz.redMul(c1);const n2=t5.redAdd(t4);const n3=t5.redSub(t4);const d2=two;const n=[n0,n1,n2,n3][r];const d=[c1,c0,d2,d2][r];const u=n.redDivSqrt(d);const[x0]=this._svdwf(u);if(!x0.eq(x))throw new Error("Invalid point.");if(u.redIsOdd()!==y.redIsOdd())u.redINeg();return u}isElliptic(){const{a,b}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const d=b2.redMuln(27).redIAdd(a3.redMuln(4));return!d.isZero()}jinv(){const{a,b}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const t0=a3.redMuln(4);const lhs=t0.redMuln(1728);const rhs=b2.redMuln(27).redIAdd(t0);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}point(x,y){return new ShortPoint(this,x,y)}jpoint(x,y,z){return new JPoint(this,x,y,z)}solveX(y){assert(y instanceof BN);if(!this.a.isZero())throw new Error("Not implemented.");const y2=y.redSqr();const x3=y2.redSub(this.b);return cubeRoots(x3)}solveY2(x){assert(x instanceof BN);const x3=x.redSqr().redMul(x);const y2=x3.redIAdd(this.b);if(!this.zeroA){if(this.threeA)y2.redIAdd(x.redMuln(-3));else y2.redIAdd(this.a.redMul(x))}return y2}validate(point){assert(point instanceof ShortPoint);if(point.inf)return true;const{x,y}=point;const y2=this.solveY2(x);return y.redSqr().eq(y2)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(this.h.cmpn(1)>0){if(y.isZero()&&sign)throw new Error("Invalid point.")}if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}pointFromY(y,index=0){assert(y instanceof BN);assert(index>>>0===index);if(!y.red)y=y.toRed(this.red);const coords=this.solveX(y);if(index>=coords.length)throw new Error("Invalid X coordinate index.");const x=coords[index];return this.point(x,y)}isIsomorphic(curve){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;let u2,u3;try{[u2,u3]=this._scale(curve)}catch(e){return false}if(curve.type==="short"){const a=this.field(curve.a).redMul(u2.redSqr());const b=this.field(curve.b).redMul(u3.redSqr());return this.a.eq(a)&&this.b.eq(b)}if(curve.type==="mont"){const{a3,bi}=curve;const x=this.field(a3.redMul(bi)).redMul(u2);const y2=this.solveY2(x);return y2.isZero()}if(curve.type==="edwards"){const x=this.field(curve.ad6).redMul(u2);const y2=this.solveY2(x);return y2.isZero()}return false}isIsogenous(curve){assert(curve instanceof Curve);return false}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const[u2,u3]=this._scale(point.curve);const x=this.field(point.x);const y=this.field(point.y);const nx=x.redMul(u2);const ny=y.redMul(u3);return this.point(nx,ny)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const{a3,bi}=point.curve;const[u2,u3]=this._scale(point.curve);const nx=point.x.redAdd(a3).redMul(bi);const ny=point.y.redMul(bi);return this.point(this.field(nx).redMul(u2),this.field(ny).redMul(u3))}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);if(this.isIsomorphic(point.curve)){const{a,d,ad6}=point.curve;const[u2,u3]=this._scale(point.curve);if(point.isInfinity())return this.point();if(point.x.isZero()){const x=this.field(ad6).redMul(u2);return this.point(x,this.zero)}const{x,y,z}=point;const a5=a.redMuln(5);const d5=d.redMuln(5);const dma=d.redSub(a);const d5a=d5.redSub(a);const da5=d.redSub(a5);const ypz=y.redAdd(z);const ymz=y.redSub(z);const xx=d5a.redMul(y).redIAdd(da5.redMul(z));const xz=ymz.redMuln(12);const yy=dma.redMul(ypz).redMul(z);const yz=ymz.redMul(x).redIMuln(4);return this.cpoint(this.field(xx).redMul(u2),this.field(xz),this.field(yy).redMul(u3),this.field(yz))}throw new Error("Not implemented.")}pointFromUniform(u){assert(u instanceof BN);if(this.z.isZero()||this.b.isZero())throw new Error("Not implemented.");if(!this.a.isZero())return this._sswu(u);if(!this.c.isZero())return this._svdw(u);throw new Error("Not implemented.")}pointToUniform(p,hint){assert(p instanceof ShortPoint);assert(hint>>>0===hint);if(this.z.isZero()||this.b.isZero())throw new Error("Not implemented.");if(p.isInfinity())throw new Error("Invalid point.");const i=(hint>>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);return wrapErrors(()=>{if(!this.a.isZero())return this._sswui(q,hint);if(!this.c.isZero())return this._svdwi(q,hint);throw new Error("Not implemented.")})}mulAll(points,coeffs){return super.mulAll(points,coeffs).toP()}affinizeAll(points){const out=this.normalizeAll(points);for(let i=0;i{const xb=point.x.redMul(this.curve.endo.beta);return this.curve.point(xb,point.y)});this.pre.beta=beta}return beta}_getJNAF(point){assert(point instanceof ShortPoint);if(this.inf||point.inf)return super._getJNAF(point);const comb=[this,null,null,point];if(this.y.eq(point.y)){comb[1]=this.add(point);comb[2]=this.toJ().sub(point)}else if(this.y.eq(point.y.redNeg())){comb[1]=this.toJ().add(point);comb[2]=this.sub(point)}else{comb[1]=this.toJ().add(point);comb[2]=this.toJ().sub(point)}return comb}clone(){if(this.inf)return this.curve.point();return this.curve.point(this.x,this.y)}scale(a){return this.toJ().scale(a)}neg(){if(this.inf)return this;return this.curve.point(this.x,this.y.redNeg())}add(p){assert(p instanceof ShortPoint);if(this.inf)return p;if(p.inf)return this;if(this.x.eq(p.x)){if(!this.y.eq(p.y))return this.curve.point();return this.dbl()}if(this.y.eq(p.y)){const nx=this.x.redNeg().redISub(p.x);const ny=this.y.redNeg();return this.curve.point(nx,ny)}const h=this.x.redSub(p.x);const r=this.y.redSub(p.y);const l=r.redDiv(h);const nx=l.redSqr().redISub(this.x).redISub(p.x);const ny=l.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)}dbl(){if(this.inf)return this;if(this.y.isZero())return this.curve.point();const xx=this.x.redSqr();const m=xx.redIMuln(3).redIAdd(this.curve.a);const z=this.y.redMuln(2);const l=m.redDiv(z);const nx=l.redSqr().redISub(this.x).redISub(this.x);const ny=l.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)}dblp(pow){return this.toJ().dblp(pow).toP()}getX(){if(this.inf)throw new Error("Invalid point.");return this.x.fromRed()}getY(){if(this.inf)throw new Error("Invalid point.");return this.y.fromRed()}eq(p){assert(p instanceof ShortPoint);if(this===p)return true;if(this.inf)return p.inf;if(p.inf)return false;return this.x.eq(p.x)&&this.y.eq(p.y)}cmp(point){assert(point instanceof ShortPoint);if(this.inf&&!point.inf)return-1;if(!this.inf&&point.inf)return 1;if(this.inf&&point.inf)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())||this.getY().cmp(point.getY())}isInfinity(){return this.inf}isOrder2(){if(this.inf)return false;return this.y.isZero()}isOdd(){if(this.inf)return false;return this.y.redIsOdd()}isEven(){if(this.inf)return false;return this.y.redIsEven()}isSquare(){if(this.inf)return false;return this.y.redJacobi()!==-1}eqX(x){assert(x instanceof BN);assert(!x.red);if(this.inf)return false;return this.getX().eq(x)}eqR(x){assert(x instanceof BN);assert(!x.red);assert(!this.curve.n.isZero());if(this.inf)return false;return this.getX().imod(this.curve.n).eq(x)}mul(k){return super.mul(k).toP()}muln(k){return super.muln(k).toP()}mulBlind(k,rng){return super.mulBlind(k,rng).toP()}mulAdd(k1,p2,k2){return super.mulAdd(k1,p2,k2).toP()}mulH(){return super.mulH().toP()}div(k){return super.div(k).toP()}divn(k){return super.divn(k).toP()}divH(){return super.divH().toP()}toP(){return this}toJ(){if(this.inf)return this.curve.jpoint();return this.curve.jpoint(this.x,this.y,this.curve.one)}encode(compact){if(compact==null)compact=true;assert(typeof compact==="boolean");const{fieldSize}=this.curve;if(this.inf)throw new Error("Invalid point.");if(compact){const p=bufferExports.Buffer.alloc(1+fieldSize);const x=this.curve.encodeField(this.getX());p[0]=2|this.y.redIsOdd();x.copy(p,1);return p}const p=bufferExports.Buffer.alloc(1+fieldSize*2);const x=this.curve.encodeField(this.getX());const y=this.curve.encodeField(this.getY());p[0]=4;x.copy(p,1);y.copy(p,1+fieldSize);return p}static decode(curve,bytes){assert(curve instanceof ShortCurve);assert(bufferExports.Buffer.isBuffer(bytes));const len=curve.fieldSize;if(bytes.length<1+len)throw new Error("Not a point.");const form=bytes[0];switch(form){case 2:case 3:{if(bytes.length!==1+len)throw new Error("Invalid point size for compressed.");const x=curve.decodeField(bytes.slice(1,1+len));if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");const p=curve.pointFromX(x,form===3);assert(!p.isInfinity());return p}case 4:case 6:case 7:{if(bytes.length!==1+len*2)throw new Error("Invalid point size for uncompressed.");const x=curve.decodeField(bytes.slice(1,1+len));const y=curve.decodeField(bytes.slice(1+len,1+2*len));if(x.cmp(curve.p)>=0||y.cmp(curve.p)>=0)throw new Error("Invalid point.");if(form!==4&&form!==(6|y.isOdd()))throw new Error("Invalid hybrid encoding.");const p=curve.point(x,y);if(!p.validate())throw new Error("Invalid point.");assert(!p.isInfinity());return p}default:{throw new Error("Unknown point format.")}}}encodeX(){return this.curve.encodeField(this.getX())}static decodeEven(curve,bytes){assert(curve instanceof ShortCurve);const x=curve.decodeField(bytes);if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");return curve.pointFromX(x,false)}static decodeSquare(curve,bytes){assert(curve instanceof ShortCurve);const x=curve.decodeField(bytes);if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");return curve.pointFromX(x)}toJSON(pre){if(this.inf)return[];const x=this.getX().toJSON();const y=this.getY().toJSON();if(pre===true&&this.pre)return[x,y,this.pre.toJSON()];return[x,y]}toPretty(){if(this.inf)return[];const size=this.curve.fieldSize*2;const x=toPretty(this.getX(),size);const y=toPretty(this.getY(),size);return[x,y]}static fromJSON(curve,json){assert(curve instanceof ShortCurve);assert(Array.isArray(json));assert(json.length===0||json.length===2||json.length===3);if(json.length===0)return curve.point();const x=BN.fromJSON(json[0]);const y=BN.fromJSON(json[1]);const point=curve.point(x,y);if(json.length>2&&json[2]!=null)point.pre=Precomp.fromJSON(point,json[2]);return point}[custom](){if(this.inf)return"";return""}}class JPoint extends Point{constructor(curve,x,y,z){assert(curve instanceof ShortCurve);super(curve,types.JACOBIAN);this.x=this.curve.one;this.y=this.curve.one;this.z=this.curve.zero;this.zOne=false;if(x!=null)this._init(x,y,z)}_init(x,y,z){assert(x instanceof BN);assert(y instanceof BN);assert(z==null||z instanceof BN);this.x=x;this.y=y;this.z=z||this.curve.one;if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z.eq(this.curve.one)}clone(){return this.curve.jpoint(this.x,this.y,this.z)}validate(){const{a,b}=this.curve;if(this.isInfinity())return true;if(this.zOne)return this.curve.validate(this.toP());const lhs=this.y.redSqr();const x3=this.x.redSqr().redMul(this.x);const z2=this.z.redSqr();const z4=z2.redSqr();const z6=z4.redMul(z2);const rhs=x3.redIAdd(b.redMul(z6));if(!this.curve.zeroA){if(this.curve.threeA)rhs.redIAdd(z4.redIMuln(-3).redMul(this.x));else rhs.redIAdd(a.redMul(z4).redMul(this.x))}return lhs.eq(rhs)}normalize(){if(this.zOne)return this;if(this.isInfinity())return this;const a=this.z.redInvert();const aa=a.redSqr();this.x=this.x.redMul(aa);this.y=this.y.redMul(aa).redMul(a);this.z=this.curve.one;this.zOne=true;return this}scale(a){assert(a instanceof BN);if(this.isInfinity())return this.curve.jpoint();const aa=a.redSqr();const nx=this.x.redMul(aa);const ny=this.y.redMul(aa).redMul(a);const nz=this.z.redMul(a);return this.curve.jpoint(nx,ny,nz)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(p){assert(p instanceof Point);if(p.type===types.AFFINE)return this._mixedAdd(p);return this._add(p)}_add(p){assert(p instanceof JPoint);if(this.isInfinity())return p;if(p.isInfinity())return this;if(this.zOne)return p._addJA(this);if(p.zOne)return this._addJA(p);return this._addJJ(p)}_mixedAdd(p){assert(p instanceof ShortPoint);if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;return this._addJA(p)}_addJJ(p){const z1z1=this.z.redSqr();const z2z2=p.z.redSqr();const u1=this.x.redMul(z2z2);const u2=p.x.redMul(z1z1);const s1=this.y.redMul(p.z).redMul(z2z2);const s2=p.y.redMul(this.z).redMul(z1z1);const h=u2.redISub(u1);const r=s2.redISub(s1);if(h.isZero()){if(!r.isZero())return this.curve.jpoint();return this.dbl()}const hh=h.redSqr();const hhh=h.redMul(hh);const v=u1.redMul(hh);const nx=r.redSqr().redISub(hhh).redISub(v).redISub(v);const ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh));const nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)}_addJA(p){const z1z1=this.z.redSqr();const u2=p.x.redMul(z1z1);const s2=p.y.redMul(this.z).redMul(z1z1);const h=u2.redISub(this.x);const r=s2.redISub(this.y).redIMuln(2);if(h.isZero()){if(!r.isZero())return this.curve.jpoint();return this.dbl()}const i=h.redMuln(2).redSqr();const j=h.redMul(i);const v=this.x.redMul(i);const nx=r.redSqr().redISub(j).redISub(v).redISub(v);const ny=r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2));const nz=this.z.redMul(h).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}dbl(){if(this.isInfinity())return this;if(this.y.isZero())return this.curve.jpoint();if(this.curve.zeroA)return this._dbl0();if(this.curve.threeA)return this._dbl3();return this._dblJ()}_dblJ(){const xx=this.x.redSqr();const yy=this.y.redSqr();const zz=this.z.redSqr();const s=this.x.redMul(yy).redIMuln(4);const m=xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr()));const t=m.redSqr().redISub(s).redISub(s);const nx=t;const ny=m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8));const nz=this.y.redMul(this.z).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}_dbl0(){const a=this.x.redSqr();const b=this.y.redSqr();const c=b.redSqr();const xb2=b.redIAdd(this.x).redSqr();const d=xb2.redISub(a).redISub(c).redIMuln(2);const e=a.redIMuln(3);const f=e.redSqr();const nx=f.redISub(d).redISub(d);const ny=e.redMul(d.redISub(nx)).redISub(c.redIMuln(8));const nz=this.y.redMul(this.z).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}_dbl3(){const delta=this.z.redSqr();const gamma=this.y.redSqr();const beta=this.x.redMul(gamma);const xmdelta=this.x.redSub(delta);const xpdelta=this.x.redAdd(delta);const alpha=xmdelta.redMul(xpdelta).redIMuln(3);const beta4=beta.redIMuln(4);const beta8=beta4.redMuln(2);const gamma28=gamma.redSqr().redIMuln(8);const nx=alpha.redSqr().redISub(beta8);const nz=this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);const ny=alpha.redMul(beta4.redISub(nx)).redISub(gamma28);return this.curve.jpoint(nx,ny,nz)}getX(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.x.fromRed()}getY(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.y.fromRed()}eq(p){assert(p instanceof JPoint);if(this===p)return true;if(this.isInfinity())return p.isInfinity();if(p.isInfinity())return false;if(this.z.eq(p.z)){return this.x.eq(p.x)&&this.y.eq(p.y)}const zz1=this.z.redSqr();const zz2=p.z.redSqr();const x1=this.x.redMul(zz2);const x2=p.x.redMul(zz1);if(!x1.eq(x2))return false;const zzz1=zz1.redMul(this.z);const zzz2=zz2.redMul(p.z);const y1=this.y.redMul(zzz2);const y2=p.y.redMul(zzz1);return y1.eq(y2)}cmp(point){assert(point instanceof JPoint);const inf1=this.isInfinity();const inf2=point.isInfinity();if(inf1&&!inf2)return-1;if(!inf1&&inf2)return 1;if(inf1&&inf2)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())||this.getY().cmp(point.getY())}isInfinity(){return this.z.isZero()}isOrder2(){if(this.isInfinity())return false;return this.y.isZero()}isOdd(){if(this.isInfinity())return false;this.normalize();return this.y.redIsOdd()}isEven(){if(this.isInfinity())return false;this.normalize();return this.y.redIsEven()}isSquare(){if(this.isInfinity())return false;return this.y.redMul(this.z).redJacobi()!==-1}eqX(x){assert(x instanceof BN);assert(!x.red);if(this.isInfinity())return false;const zz=this.z.redSqr();const rx=x.toRed(this.curve.red).redMul(zz);return this.x.eq(rx)}eqR(x){assert(x instanceof BN);assert(!x.red);if(!this.curve.smallGap)return this.toP().eqR(x);if(this.isInfinity())return false;if(x.cmp(this.curve.p)>=0)return false;const zz=this.z.redSqr();const rx=x.toRed(this.curve.red).redMul(zz);if(this.x.eq(rx))return true;if(this.curve.highOrder)return false;if(x.cmp(this.curve.pmodn)>=0)return false;const rn=this.curve.redN.redMul(zz);rx.redIAdd(rn);return this.x.eq(rx)}toP(){if(this.isInfinity())return this.curve.point();this.normalize();return this.curve.point(this.x,this.y)}toJ(){return this}encode(compact){return this.toP().encode(compact)}static decode(curve,bytes){return ShortPoint.decode(curve,bytes).toJ()}encodeX(){return this.toP().encodeX()}static decodeEven(curve,bytes){return ShortPoint.decodeEven(curve,bytes).toJ()}static decodeSquare(curve,bytes){return ShortPoint.decodeSquare(curve,bytes).toJ()}toJSON(pre){return this.toP().toJSON(pre)}toPretty(){return this.toP().toPretty()}static fromJSON(curve,json){return ShortPoint.fromJSON(curve,json).toJ()}[custom](){if(this.isInfinity())return"";return""}}class MontCurve extends Curve{constructor(conf){super(MontPoint,"mont",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.b=BN.fromJSON(conf.b).toRed(this.red);this.bi=this.b.redInvert();this.a2=this.a.redAdd(this.two);this.a24=this.a2.redMul(this.i4);this.a3=this.a.redMul(this.i3);this.a0=this.a.redMul(this.bi);this.b0=this.bi.redSqr();this._finalize(conf)}static _isomorphism(curveA,curveB,customB){assert(curveA instanceof BN);assert(curveB instanceof BN);assert(customB instanceof BN);const a=curveA.clone();const b=customB.clone();const c=curveB.redDiv(customB);if(c.redJacobi()!==1)throw new Error("Invalid `b` coefficient.");return[a,b]}_short(a0,odd){const{a,b,three}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const b3=b2.redMul(b);const n0=three.redSub(a2);const d0=b2.redMuln(3);const n1=a3.redMuln(2).redISub(a.redMuln(9));const d1=b3.redMuln(27);const wa=n0.redDiv(d0);const wb=n1.redDiv(d1);if(a0!=null)return ShortCurve._isomorphism(wa,wb,a0,odd);return[wa,wb]}_mont(b0){return MontCurve._isomorphism(this.a,this.b,b0)}_edwards(a0,invert=false){assert(typeof invert==="boolean");const{two,bi}=this;const a=this.a.redAdd(two).redMul(bi);const d=this.a.redSub(two).redMul(bi);if(invert)a.swap(d);if(a0!=null)return EdwardsCurve._isomorphism(a,d,a0);return[a,d]}_scaleShort(curve){assert(curve instanceof ShortCurve);const[u2,u3]=curve._scale(this);return[this.field(u2.redInvert()),this.field(u3.redInvert())]}_scaleMont(curve){assert(curve instanceof MontCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this.field(curve.b).redDivSqrt(this.b);return this.g.y.redDiv(this.field(curve.g.y))}_scaleEdwards(curve,invert){assert(curve instanceof EdwardsCurve);const c=curve._scale(this,invert);return this.field(c)}_solveY0(x){assert(x instanceof BN);const a=this.a0;const b=this.b0;const x2=x.redSqr();const x3=x2.redMul(x);const y2=x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x));return y2}_elligator2(u){const lhs=this.a0.redNeg();const rhs=this.one.redAdd(this.z.redMul(u.redSqr()));if(rhs.isZero())rhs.inject(this.one);const x1=lhs.redMul(rhs.redInvert());const x2=x1.redNeg().redISub(this.a0);const y1=this._solveY0(x1);const y2=this._solveY0(x2);const alpha=y1.redIsSquare()|0;const x0=[x1,x2][alpha^1];const y0=[y1,y2][alpha^1].redSqrt();if(y0.redIsOdd()!==u.redIsOdd())y0.redINeg();const x=this.b.redMul(x0);const y=this.b.redMul(y0);return this.point(x,y)}_invert2(p,hint){const{x,y}=p;const r=hint&1;const x0=x.redMul(this.bi);const y0=y.redMul(this.bi);const n=x0.redAdd(this.a0);const d=x0;const lhs=[n,d][r].redINeg();const rhs=[d,n][r].redMul(this.z);const u=lhs.redDivSqrt(rhs);if(u.redIsOdd()!==y0.redIsOdd())u.redINeg();return u}isElliptic(){const a2=this.a.redSqr();const d=this.b.redMul(a2.redSub(this.four));return!d.isZero()}jinv(){const{a,three,four}=this;const a2=a.redSqr();const t0=a2.redSub(three);const lhs=t0.redPown(3).redIMuln(256);const rhs=a2.redSub(four);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}point(x,y){return new MontPoint(this,x,y)}jpoint(x,y,z){assert(x==null&&y==null&&z==null);return this.point()}xpoint(x,z){return new XPoint(this,x,z)}solveY2(x){assert(x instanceof BN);const x2=x.redSqr();const x3=x2.redMul(x);const by2=x3.redIAdd(this.a.redMul(x2)).redIAdd(x);const y2=by2.redMul(this.bi);return y2}validate(point){assert(point instanceof MontPoint);if(point.isInfinity())return true;const{x,y}=point;const y2=this.solveY2(x);return y.redSqr().eq(y2)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(y.isZero()&&sign)throw new Error("Invalid point.");if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}isIsomorphic(curve,invert){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;if(curve.type==="mont"){const a=this.field(curve.a);const b=this.field(curve.b);if(!this.a.eq(a))return false;if(this.b.isZero())return false;const c=b.redDiv(this.b);return c.redJacobi()===1}return curve.isIsomorphic(this,invert)}isIsogenous(curve){assert(curve instanceof Curve);if(curve.type==="mont")return false;return curve.isIsogenous(this)}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const{a3,b}=this;const[u2,u3]=this._scale(point.curve);const x=this.field(point.x).redMul(u2);const y=this.field(point.y).redMul(u3);const u=b.redMul(x).redISub(a3);const v=b.redMul(y);return this.point(u,v)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const c=this._scale(point.curve);const u=this.field(point.x);const v=this.field(point.y);const nu=u;const nv=c.redMul(v);return this.point(nu,nv)}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);assert(point.curve.p.eq(this.p));const x=this.field(point.x);const y=this.field(point.y);const z=this.field(point.z);if(this.isIsogenous(point.curve)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=z.redSqr().redIMuln(2);const uu=y.redSqr();const uz=x.redSqr();const vv=c.redISub(uz).redISub(uu).redMul(y);const vz=uz.redMul(x);return this.cpoint(uu,uz,vv,vz)}if(this.isIsomorphic(point.curve,true)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=this._scale(point.curve,true);const uu=y.redAdd(z);const uz=y.redSub(z);const vv=c.redMul(z).redMul(uu);const vz=x.redMul(uz);return this.cpoint(uu,uz,vv,vz)}if(this.isIsomorphic(point.curve,false)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=this._scale(point.curve,false);const uu=z.redAdd(y);const uz=z.redSub(y);const vv=c.redMul(z).redMul(uu);const vz=x.redMul(uz);return this.cpoint(uu,uz,vv,vz)}throw new Error("Not implemented.")}pointFromUniform(u){assert(u instanceof BN);if(this.z.isZero()||this.a.isZero())throw new Error("Not implemented.");return this._elligator2(u)}pointToUniform(p,hint){assert(p instanceof MontPoint);assert(hint>>>0===hint);if(this.z.isZero()||this.a.isZero())throw new Error("Not implemented.");if(p.isInfinity())throw new Error("Invalid point.");const i=(hint>>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);return wrapErrors(()=>{return this._invert2(q,hint)})}decodePoint(bytes,sign){return MontPoint.decode(this,bytes,sign)}encodeX(point){assert(point instanceof XPoint);return point.encode()}decodeX(bytes){return XPoint.decode(this,bytes)}toShort(a0,odd,sign=null){const[a,b]=this._short(a0,odd);const curve=new ShortCurve({red:this.red,prime:this.prime,p:this.p,a:a,b:b,n:this.n,h:this.h});if(sign!=null){const[,u3]=curve._scale(this);if(u3.redIsOdd()!==sign)u3.redINeg()}if(!this.g.isInfinity())curve.g=curve.pointFromMont(this.g);for(let i=0;i";return""}}class XPoint extends Point{constructor(curve,x,z){assert(curve instanceof MontCurve);super(curve,types.PROJECTIVE);this.x=this.curve.one;this.z=this.curve.zero;if(x!=null)this._init(x,z)}_init(x,z){assert(x instanceof BN);assert(z==null||z instanceof BN);this.x=x;this.z=z||this.curve.one;if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}clone(){return this.curve.xpoint(this.x,this.z)}precompute(power,rng){return this}validate(){if(this.isInfinity())return true;const{x,z}=this;const x2=x.redSqr();const x3=x2.redMul(x);const z2=z.redSqr();const ax2=this.curve.a.redMul(x2).redMul(z);const by2=x3.redIAdd(ax2).redIAdd(x.redMul(z2));const y2=by2.redMul(this.curve.bi);return y2.redMul(z).redJacobi()!==-1}normalize(){if(this.isInfinity())return this;if(this.z.eq(this.curve.one))return this;this.x=this.x.redDiv(this.z);this.z=this.curve.one;return this}scale(a){assert(a instanceof BN);if(this.isInfinity())return this.curve.xpoint();const nx=this.x.redMul(a);const nz=this.z.redMul(a);return this.curve.xpoint(nx,nz)}neg(){return this}dbl(){const a=this.x.redAdd(this.z);const aa=a.redSqr();const b=this.x.redSub(this.z);const bb=b.redSqr();const c=aa.redSub(bb);const nx=aa.redMul(bb);const nz=c.redMul(bb.redIAdd(this.curve.a24.redMul(c)));return this.curve.xpoint(nx,nz)}diffAddDbl(p2,p3){assert(p2 instanceof XPoint);assert(p3 instanceof XPoint);const a=p2.x.redAdd(p2.z);const aa=a.redSqr();const b=p2.x.redSub(p2.z);const bb=b.redSqr();const e=aa.redSub(bb);const c=p3.x.redAdd(p3.z);const d=p3.x.redSub(p3.z);const da=d.redMul(a);const cb=c.redMul(b);const x5=this.z.redMul(da.redAdd(cb).redSqr());const z5=this.x.redMul(da.redISub(cb).redSqr());const x4=aa.redMul(bb);const z4=e.redMul(bb.redIAdd(this.curve.a24.redMul(e)));return[this.curve.xpoint(x4,z4),this.curve.xpoint(x5,z5)]}getX(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.x.fromRed()}getY(sign){return this.toP(sign).getY()}eq(p){assert(p instanceof XPoint);if(this===p)return true;if(this.isInfinity())return p.isInfinity();if(p.isInfinity())return false;if(this.z.eq(p.z))return this.x.eq(p.x);const x1=this.x.redMul(p.z);const x2=p.x.redMul(this.z);return x1.eq(x2)}cmp(point){assert(point instanceof XPoint);const inf1=this.isInfinity();const inf2=point.isInfinity();if(inf1&&!inf2)return-1;if(!inf1&&inf2)return 1;if(inf1&&inf2)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())}isInfinity(){return this.z.isZero()}isOrder2(){if(this.isInfinity())return false;return this.x.isZero()}isOdd(){return false}isEven(){return false}hasTorsion(){if(this.isInfinity())return false;if(this.x.isZero())return true;return super.hasTorsion()}order(){try{return this.toP().order()}catch(e){return new BN(1)}}jmul(k){assert(k instanceof BN);assert(!k.red);const bits=k.bitLength();let a=this.curve.xpoint();let b=this;for(let i=bits-1;i>=0;i--){const bit=k.bit(i);if(bit===0)[a,b]=this.diffAddDbl(a,b);else[b,a]=this.diffAddDbl(b,a)}return a}jmulBlind(k,rng){if(!rng)return this.jmul(k);return this.randomize(rng).jmul(k)}jmulAdd(k1,p2,k2){throw new Error("Not implemented.")}toP(sign=null){assert(sign==null||typeof sign==="boolean");if(this.isInfinity())return this.curve.point();this.normalize();return this.curve.pointFromX(this.x,sign)}toJ(){return this}toX(){return this}key(){if(this.isInfinity())return`${this.curve.uid}:oo`;this.normalize();const x=this.getX().toString(16);return`${this.curve.uid}:${x}`}encode(){return this.curve.encodeField(this.getX())}static decode(curve,bytes){assert(curve instanceof MontCurve);const x=curve.decodeField(bytes);x.iumaskn(curve.fieldBits);const p=curve.xpoint(x,curve.one);assert(!p.isInfinity());return p}toJSON(pre){return this.toP().toJSON(pre)}toPretty(){return this.toP().toPretty()}static fromJSON(curve,json){return MontPoint.fromJSON(curve,json).toX()}[custom](){if(this.isInfinity())return"";return""}}class EdwardsCurve extends Curve{constructor(conf){super(EdwardsPoint,"edwards",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.d=BN.fromJSON(conf.d).toRed(this.red);this.s=BN.fromJSON(conf.s||"0").toRed(this.red);this.si=this.s.isZero()?this.zero:this.s.redInvert();this.k=this.d.redMuln(2);this.smi=-this.d.redNeg().word(0);this.ad6=this.a.redAdd(this.d).redMul(this.i6);this.twisted=!this.a.eq(this.one);this.oneA=this.a.eq(this.one);this.mOneA=this.a.eq(this.one.redNeg());this.smallD=this.prime!=null&&this.d.redNeg().length===1;this.alt=null;this._finalize(conf)}static _isomorphism(curveA,curveD,customA){assert(curveA instanceof BN);assert(curveD instanceof BN);assert(customA instanceof BN);const a=customA.clone();const d=customA.redMul(curveD).redDiv(curveA);const c=curveA.redDiv(customA);if(c.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");return[a,d]}_short(a0,odd){const{a,d}=this;const a2=a.redSqr();const a3=a2.redMul(a);const d2=d.redSqr();const d3=d2.redMul(d);const ad14=a.redMul(d).redIMuln(14);const a2d=a2.redMul(d);const ad2=a.redMul(d2);const t0=a2d.redIAdd(ad2).redIMuln(33);const wa=a2.redAdd(ad14).redIAdd(d2).redDivn(-48);const wb=t0.redISub(a3).redISub(d3).redDivn(864);if(a0!=null)return ShortCurve._isomorphism(wa,wb,a0,odd);return[wa,wb]}_mont(b0,invert=false){assert(typeof invert==="boolean");let apd,amd;if(invert){apd=this.d.redAdd(this.a);amd=this.d.redSub(this.a)}else{apd=this.a.redAdd(this.d);amd=this.a.redSub(this.d)}const z=amd.redInvert();const a=apd.redMuln(2).redMul(z);const b=z.redMuln(4);if(b0!=null)return MontCurve._isomorphism(a,b,b0);return[a,b]}_edwards(a0){return EdwardsCurve._isomorphism(this.a,this.d,a0)}_scaleShort(curve){assert(curve instanceof ShortCurve);const[u2,u3]=curve._scale(this);return[this.field(u2.redInvert()),this.field(u3.redInvert())]}_scaleMont(curve,invert=false){assert(curve instanceof MontCurve);assert(typeof invert==="boolean");if(this.g.isInfinity()||curve.g.isInfinity()){const[a]=curve._edwards(null,invert);return this.field(a).redDivSqrt(this.a)}const x=curve.g.x.redDiv(curve.g.y);return this.g.x.redDiv(this.field(x))}_scaleEdwards(curve){assert(curve instanceof EdwardsCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this.field(curve.a).redDivSqrt(this.a);return this.g.x.redDiv(this.field(curve.g.x))}_mulA(num){assert(num instanceof BN);if(this.oneA)return num.clone();if(this.mOneA)return num.redNeg();return this.a.redMul(num)}_mulD(num){assert(num instanceof BN);if(this.smallD)return num.redMuln(this.smi);return this.d.redMul(num)}_elligator1(t){const{s,si,i2,one,two}=this;const c=si.redSqr().redIMuln(2);const ci=s.redSqr().redMul(i2);const ci2=ci.redSqr();const r=c.redAdd(ci);const r2=r.redSqr().redISub(two);const cm1=c.redSub(one);const uu=one.redSub(t);const uz=one.redAdd(t);const u=uz.isZero()?uz:uu.redDiv(uz);const u2=u.redSqr();const u3=u2.redMul(u);const u5=u3.redMul(u2);const v=u5.redAdd(r2.redMul(u3)).redIAdd(u);const f0=this.field(v.redJacobi());const f1=this.field(u2.redAdd(ci2).redJacobi());const f2=f0.redMul(f1);const X=f0.redMul(u);const Y=f0.redMul(v).redSqrt().redMul(f2);const X1=one.redAdd(X);const rX=r.redMul(X);const X12=X1.redSqr();const xx=cm1.redMul(s).redMul(X).redMul(X1);const xz=u.isZero()?this.one:Y;const yy=rX.redSub(X12);const yz=rX.redAdd(X12);return this.cpoint(xx,xz,yy,yz)}_invert1(p,hint){const{s,si,i2,one}=this;const{x,y,z}=p;const sign=hint&1;const c=si.redSqr().redIMuln(2);const ci=s.redSqr().redMul(i2);const ci2=ci.redSqr();const r=c.redAdd(ci);const cm1=c.redSub(one);const nn=y.redSub(z);const nz=y.redAdd(z).redIMuln(2);const n=nz.isZero()?nz:nn.redDiv(nz);const nr1=one.redAdd(n.redMul(r));const w2=nr1.redSqr().redISub(one);const w=w2.redSqrt();const X=w.redSub(nr1);const X1=one.redAdd(X);const YY=cm1.redMul(s).redMul(X).redMul(X1);const Y=YY.redMul(x.redMul(z));const X2=X.redSqr().redIAdd(ci2);const Z=this.field(Y.redMul(X2).redJacobi());const u=Z.redMul(X);const tt=one.redSub(u);const tz=one.redAdd(u);const t=tz.isZero()?tz:tt.redDiv(tz);if(t.redIsOdd()!==Boolean(sign))t.redINeg();return t}_alt(){if(!this.alt)this.alt=this.toMont();return this.alt}isElliptic(){const ad=this.a.redMul(this.d);const amd=this.a.redSub(this.d);return!ad.redMul(amd).isZero()}jinv(){const{a,d}=this;const ad=a.redMul(d);const amd4=a.redSub(d).redPown(4);const a2=a.redSqr();const d2=d.redSqr();const t0=a2.redAdd(ad.redMuln(14)).redIAdd(d2);const lhs=t0.redPown(3).redIMuln(16);const rhs=ad.redMul(amd4);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}isComplete(){return this.a.redJacobi()===1&&this.d.redJacobi()===-1}point(x,y,z,t){return new EdwardsPoint(this,x,y,z,t)}jpoint(x,y,z){assert(x==null&&y==null&&z==null);return this.point()}cpoint(xx,xz,yy,yz){assert(xx instanceof BN);assert(xz instanceof BN);assert(yy instanceof BN);assert(yz instanceof BN);const x=xx.redMul(yz);const y=yy.redMul(xz);const z=xz.redMul(yz);const t=xx.redMul(yy);return this.point(x,y,z,t)}solveX2(y){assert(y instanceof BN);const y2=y.redSqr();const rhs=this._mulD(y2).redISub(this.a);const lhs=y2.redISub(this.one);const x2=lhs.redDiv(rhs);return x2}solveX(y){const y2=y.redSqr();const rhs=this._mulD(y2).redISub(this.a);const lhs=y2.redISub(this.one);return lhs.redDivSqrt(rhs)}solveY2(x){assert(x instanceof BN);const x2=x.redSqr();const lhs=this._mulA(x2).redISub(this.one);const rhs=this._mulD(x2).redISub(this.one);const y2=lhs.redDiv(rhs);return y2}solveY(x){const x2=x.redSqr();const lhs=this._mulA(x2).redISub(this.one);const rhs=this._mulD(x2).redISub(this.one);return lhs.redDivSqrt(rhs)}validate(point){assert(point instanceof EdwardsPoint);if(point.zOne){const x2=point.x.redSqr();const y2=point.y.redSqr();const dxy=this._mulD(x2).redMul(y2);const lhs=this._mulA(x2).redIAdd(y2);const rhs=this.one.redAdd(dxy);const tz=point.t;const xy=point.x.redMul(point.y);return lhs.eq(rhs)&&tz.eq(xy)}const x2=point.x.redSqr();const y2=point.y.redSqr();const z2=point.z.redSqr();const z4=z2.redSqr();const dxy=this._mulD(x2).redMul(y2);const lhs=this._mulA(x2).redIAdd(y2).redMul(z2);const rhs=z4.redIAdd(dxy);const tz=point.t.redMul(point.z);const xy=point.x.redMul(point.y);return lhs.eq(rhs)&&tz.eq(xy)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(y.isZero()&&sign)throw new Error("Invalid point.");if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}pointFromY(y,sign=null){assert(y instanceof BN);assert(sign==null||typeof sign==="boolean");if(!y.red)y=y.toRed(this.red);const x=this.solveX(y);if(sign!=null){if(x.isZero()&&sign)throw new Error("Invalid point.");if(x.redIsOdd()!==sign)x.redINeg()}return this.point(x,y)}isIsomorphic(curve,invert=false){assert(curve instanceof Curve);assert(typeof invert==="boolean");if(!curve.p.eq(this.p))return false;if(curve.type==="short")return curve.isIsomorphic(this);if(curve.type==="mont"){const a=this.field(curve.a);let apd,amd;if(invert){apd=this.d.redAdd(this.a);amd=this.d.redSub(this.a)}else{apd=this.a.redAdd(this.d);amd=this.a.redSub(this.d)}return a.redMul(amd).eq(apd.redIMuln(2))}if(curve.type==="edwards"){const a=this.field(curve.a);const d=this.field(curve.d);return this.a.redMul(d).eq(a.redMul(this.d))}return false}isIsogenous(curve){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;if(curve.type==="mont"){if(!this.a.eq(this.one))return false;const a=this.field(curve.a);const b=this.field(curve.b);const d24=this.two.redSub(this.d.redMuln(4));return a.eq(d24)&&b.eq(this.one)}if(curve.type==="edwards"){const a=this.field(curve.a);const d=this.field(curve.d);return a.eq(this.a.redNeg())&&d.eq(this.d.redSub(this.a))}return false}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();if(point.y.isZero())return this.point(this.zero,this.one.redNeg());const{a,d}=this;const[u2,u3]=this._scale(point.curve);const a5=a.redMuln(5);const d5=d.redMuln(5);const x=this.field(point.x).redMul(u2);const y=this.field(point.y).redMul(u3);const x6=x.redMuln(6);const x12=x.redMuln(12);const xx=x6.redSub(a).redISub(d);const xz=y.redMuln(6);const yy=x12.redSub(a5).redIAdd(d);const yz=x12.redAdd(a).redISub(d5);return this.cpoint(xx,xz,yy,yz)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);assert(point.curve.p.eq(this.p));const u=this.field(point.x);const v=this.field(point.y);if(this.isIsogenous(point.curve)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point();const u2=u.redSqr();const u3=u2.redMul(u);const u4=u3.redMul(u);const u5=u4.redMul(u);const v2=v.redSqr();const a=v.redMuln(4);const b=u2.redSub(this.one);const c=u2.redMuln(2);const d=v2.redMuln(4);const e=u3.redIMuln(2);const f=u.redMul(v2).redIMuln(4);const g=u2.redMul(v2).redIMuln(2);const h=v2.redIMuln(2);const xx=a.redMul(b);const xz=u4.redISub(c).redIAdd(d).redIAdd(this.one);const yy=u5.redSub(e).redISub(f).redIAdd(u).redINeg();const yz=u5.redISub(g).redISub(e).redISub(h).redIAdd(u);return this.cpoint(xx,xz,yy,yz).divn(4)}if(this.isIsomorphic(point.curve,true)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.one.redNeg());const c=this._scale(point.curve,true);const xx=c.redMul(u);const xz=v;const yy=u.redAdd(this.one);const yz=u.redSub(this.one);return this.cpoint(xx,xz,yy,yz)}if(this.isIsomorphic(point.curve,false)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.one.redNeg());const c=this._scale(point.curve,false);const xx=c.redMul(u);const xz=v;const yy=u.redSub(this.one);const yz=u.redAdd(this.one);return this.cpoint(xx,xz,yy,yz)}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);assert(point.curve.p.eq(this.p));const a=this.field(point.curve.a);const x=this.field(point.x);const y=this.field(point.y);const z=this.field(point.z);const t=this.field(point.t);if(this.isIsogenous(point.curve)){const xy=x.redMul(y);const x2=x.redSqr();const y2=y.redSqr();const z2=z.redSqr();const ax2=a.redMul(x2);const xx=xy.redIMuln(2);const xz=y2.redSub(ax2);const yy=y2.redAdd(ax2);const yz=z2.redIMuln(2).redISub(yy);const p=this.cpoint(xx,xz,yy,yz);return!this.twisted?p.divn(4):p}if(this.isIsomorphic(point.curve)){const c=this._scale(point.curve);const nx=c.redMul(x);const ny=y;const nz=z;const nt=c.redMul(t);return this.point(nx,ny,nz,nt)}throw new Error("Not implemented.")}pointFromUniform(u,curve=null){assert(u instanceof BN);assert(u.red===this.red);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const u0=curve.field(u);const p0=curve.pointFromUniform(u0);return this.pointFromMont(p0)}pointToUniform(p,hint,curve=null){assert(p instanceof EdwardsPoint);assert(hint>>>0===hint);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const i=(hint>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);const p0=curve.pointFromEdwards(q);const u0=curve.pointToUniform(p0,hint&15);return this.field(u0)}pointFromHash(bytes,pake,curve=null){assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const p0=curve.pointFromHash(bytes,pake);return this.pointFromMont(p0)}pointToHash(p,subgroup,rng,curve=null){assert(p instanceof EdwardsPoint);assert(subgroup>>>0===subgroup);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const i=subgroup%this.torsion.length;const q=p.add(this.torsion[i]);const p0=curve.pointFromEdwards(q);return curve.pointToHash(p0,0,rng)}decodePoint(bytes){return EdwardsPoint.decode(this,bytes)}toShort(a0,odd,sign=null){const[a,b]=this._short(a0,odd);const curve=new ShortCurve({red:this.red,prime:this.prime,p:this.p,a:a,b:b,n:this.n,h:this.h});if(sign!=null){const[,u3]=curve._scale(this);if(u3.redIsOdd()!==sign)u3.redINeg()}if(!this.g.isInfinity())curve.g=curve.pointFromEdwards(this.g);for(let i=0;i=0)throw new Error("Invalid point.");return curve.pointFromY(y,sign)}toJSON(pre){if(this.isInfinity())return[];const x=this.getX().toJSON();const y=this.getY().toJSON();if(pre===true&&this.pre)return[x,y,this.pre.toJSON()];return[x,y]}toPretty(){const size=this.curve.fieldSize*2;const x=toPretty(this.getX(),size);const y=toPretty(this.getY(),size);return[x,y]}static fromJSON(curve,json){assert(curve instanceof EdwardsCurve);assert(Array.isArray(json));assert(json.length===0||json.length===2||json.length===3);if(json.length===0)return curve.point();const x=BN.fromJSON(json[0]);const y=BN.fromJSON(json[1]);const point=curve.point(x,y);if(json.length>2&&json[2]!=null)point.pre=Precomp.fromJSON(point,json[2]);return point}[custom](){if(this.isInfinity())return"";return""}}class Precomp{constructor(){this.naf=null;this.windows=null;this.doubles=null;this.blinding=null;this.beta=null}map(func){assert(typeof func==="function");const out=new this.constructor;if(this.naf)out.naf=this.naf.map(func);if(this.doubles)out.doubles=this.doubles.map(func);return out}toJSON(){return{naf:this.naf?this.naf.toJSON():null,windows:this.windows?this.windows.toJSON():null,doubles:this.doubles?this.doubles.toJSON():null,blinding:this.blinding?this.blinding.toJSON():undefined}}fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");if(json.naf!=null)this.naf=NAF.fromJSON(point,json.naf);if(json.windows!=null)this.windows=Windows.fromJSON(point,json.windows);if(json.doubles!=null)this.doubles=Doubles.fromJSON(point,json.doubles);if(json.blinding!=null)this.blinding=Blinding.fromJSON(point,json.blinding);return this}static fromJSON(point,json){return(new this).fromJSON(point,json)}}class NAF{constructor(width,points){this.width=width;this.points=points}map(func){assert(typeof func==="function");const{width}=this;const points=[];for(const point of this.points)points.push(func(point));return new this.constructor(width,points)}toJSON(){return{width:this.width,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.width>>>0===json.width);assert(Array.isArray(json.points));const{curve}=point;const{width}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(width,points)}}class Windows{constructor(width,bits,points){this.width=width;this.bits=bits;this.points=points}toJSON(){return{width:this.width,bits:this.bits,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.width>>>0===json.width);assert(json.bits>>>0===json.bits);assert(Array.isArray(json.points));const{curve}=point;const{width,bits}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(width,bits,points)}}class Doubles{constructor(step,points){this.step=step;this.points=points}map(func){assert(typeof func==="function");const{step}=this;const points=[];for(const point of this.points)points.push(func(point));return new this.constructor(step,points)}toJSON(){return{step:this.step,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.step>>>0===json.step);assert(Array.isArray(json.points));const{curve}=point;const{step}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(step,points)}}class Blinding{constructor(blind,unblind){this.blind=blind;this.unblind=unblind}toJSON(){return{blind:this.blind.toJSON(),unblind:this.unblind.toJSON()}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");const{curve}=point;const blind=BN.fromJSON(json.blind);const unblind=curve.pointFromJSON(json.unblind);return new this(blind,unblind)}}class Endo{constructor(beta,lambda,basis,pre){this.beta=beta;this.lambda=lambda;this.basis=basis;this.pre=pre}toJSON(){return{beta:this.beta.fromRed().toJSON(),lambda:this.lambda.toJSON(),basis:[this.basis[0].toJSON(),this.basis[1].toJSON()],pre:[this.pre[0],this.pre[1].toJSON(),this.pre[2].toJSON()]}}static fromJSON(curve,json){assert(curve instanceof Curve);assert(json&&typeof json==="object");assert(Array.isArray(json.basis));assert(Array.isArray(json.pre));assert(json.basis.length===2);assert(json.pre.length===3);assert(json.pre[0]>>>0===json.pre[0]);const beta=BN.fromJSON(json.beta).toRed(curve.red);const lambda=BN.fromJSON(json.lambda);const basis=[Vector.fromJSON(json.basis[0]),Vector.fromJSON(json.basis[1])];const pre=[json.pre[0],BN.fromJSON(json.pre[1]),BN.fromJSON(json.pre[2])];return new this(beta,lambda,basis,pre)}}class Vector{constructor(a,b){this.a=a;this.b=b}toJSON(){return{a:this.a.toJSON(),b:this.b.toJSON()}}static fromJSON(json){assert(json&&typeof json==="object");const a=BN.fromJSON(json.a);const b=BN.fromJSON(json.b);return new this(a,b)}}class P192 extends ShortCurve{constructor(pre){super({id:"P192",ossl:"prime192v1",type:"short",endian:"be",hash:"SHA256",prime:"p192",p:["ffffffff ffffffff ffffffff fffffffe","ffffffff ffffffff"],a:["ffffffff ffffffff ffffffff fffffffe","ffffffff fffffffc"],b:["64210519 e59c80e7 0fa7e9ab 72243049","feb8deec c146b9b1"],n:["ffffffff ffffffff ffffffff 99def836","146bc9b1 b4d22831"],h:"1",z:"-5",g:[["188da80e b03090f6 7cbf20eb 43a18800","f4ff0afd 82ff1012"],["07192b95 ffc8da78 631011ed 6b24cdd5","73f977a1 1e794811"],pre]})}}class P224 extends ShortCurve{constructor(pre){super({id:"P224",ossl:"secp224r1",type:"short",endian:"be",hash:"SHA256",prime:"p224",p:["ffffffff ffffffff ffffffff ffffffff","00000000 00000000 00000001"],a:["ffffffff ffffffff ffffffff fffffffe","ffffffff ffffffff fffffffe"],b:["b4050a85 0c04b3ab f5413256 5044b0b7","d7bfd8ba 270b3943 2355ffb4"],n:["ffffffff ffffffff ffffffff ffff16a2","e0b8f03e 13dd2945 5c5c2a3d"],h:"1",z:"1f",g:[["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3","56c21122 343280d6 115c1d21"],["bd376388 b5f723fb 4c22dfe6 cd4375a0","5a074764 44d58199 85007e34"],pre]})}}class P256 extends ShortCurve{constructor(pre){super({id:"P256",ossl:"prime256v1",type:"short",endian:"be",hash:"SHA256",prime:null,p:["ffffffff 00000001 00000000 00000000","00000000 ffffffff ffffffff ffffffff"],a:["ffffffff 00000001 00000000 00000000","00000000 ffffffff ffffffff fffffffc"],b:["5ac635d8 aa3a93e7 b3ebbd55 769886bc","651d06b0 cc53b0f6 3bce3c3e 27d2604b"],n:["ffffffff 00000000 ffffffff ffffffff","bce6faad a7179e84 f3b9cac2 fc632551"],h:"1",z:"-a",g:[["6b17d1f2 e12c4247 f8bce6e5 63a440f2","77037d81 2deb33a0 f4a13945 d898c296"],["4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16","2bce3357 6b315ece cbb64068 37bf51f5"],pre]})}}class P384 extends ShortCurve{constructor(pre){super({id:"P384",ossl:"secp384r1",type:"short",endian:"be",hash:"SHA384",prime:null,p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff fffffffe","ffffffff 00000000 00000000 ffffffff"],a:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff fffffffe","ffffffff 00000000 00000000 fffffffc"],b:["b3312fa7 e23ee7e4 988e056b e3f82d19","181d9c6e fe814112 0314088f 5013875a","c656398d 8a2ed19d 2a85c8ed d3ec2aef"],n:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff c7634d81 f4372ddf","581a0db2 48b0a77a ecec196a ccc52973"],h:"1",z:"-c",g:[["aa87ca22 be8b0537 8eb1c71e f320ad74","6e1d3b62 8ba79b98 59f741e0 82542a38","5502f25d bf55296c 3a545e38 72760ab7"],["3617de4a 96262c6f 5d9e98bf 9292dc29","f8f41dbd 289a147c e9da3113 b5f0b8c0","0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"],pre]})}}class P521 extends ShortCurve{constructor(pre){super({id:"P521",ossl:"secp521r1",type:"short",endian:"be",hash:"SHA512",prime:"p521",p:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff"],a:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","fffffffc"],b:["00000051 953eb961 8e1c9a1f 929a21a0","b68540ee a2da725b 99b315f3 b8b48991","8ef109e1 56193951 ec7e937b 1652c0bd","3bb1bf07 3573df88 3d2c34f1 ef451fd4","6b503f00"],n:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","fffffffa 51868783 bf2f966b 7fcc0148","f709a5d0 3bb5c9b8 899c47ae bb6fb71e","91386409"],h:"1",z:"-4",g:[["000000c6 858e06b7 0404e9cd 9e3ecb66","2395b442 9c648139 053fb521 f828af60","6b4d3dba a14b5e77 efe75928 fe1dc127","a2ffa8de 3348b3c1 856a429b f97e7e31","c2e5bd66"],["00000118 39296a78 9a3bc004 5c8a5fb4","2c7d1bd9 98f54449 579b4468 17afbd17","273e662c 97ee7299 5ef42640 c550b901","3fad0761 353c7086 a272c240 88be9476","9fd16650"],pre]})}}class SECP256K1 extends ShortCurve{constructor(pre){super({id:"SECP256K1",ossl:"secp256k1",type:"short",endian:"be",hash:"SHA256",prime:"k256",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe fffffc2f"],a:"0",b:"7",n:["ffffffff ffffffff ffffffff fffffffe","baaedce6 af48a03b bfd25e8c d0364141"],h:"1",z:"1",c:["0a2d2ba9 3507f1df 233770c2 a797962c","c61f6d15 da14ecd4 7d8d27ae 1cd5f852"],g:[["79be667e f9dcbbac 55a06295 ce870b07","029bfcdb 2dce28d9 59f2815b 16f81798"],["483ada77 26a3c465 5da4fbfc 0e1108a8","fd17b448 a6855419 9c47d08f fb10d4b8"],pre],endo:{beta:["7ae96a2b 657c0710 6e64479e ac3434e9","9cf04975 12f58995 c1396c28 719501ee"],lambda:["5363ad4c c05c30e0 a5261c02 8812645a","122e22ea 20816678 df02967c 1b23bd72"],basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],pre:[384,["3086d221 a7d46bcd e86c90e4 9284eb15","3daa8a14 71e8ca7f e893209a 45dbb031"],["-","e4437ed6 010e8828 6f547fa9 0abfe4c4","221208ac 9df506c6 1571b4ae 8ac47f71"]]}})}}class BRAINPOOLP256 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP256",ossl:"brainpoolP256r1",type:"short",endian:"be",hash:"SHA256",prime:null,p:["a9fb57db a1eea9bc 3e660a90 9d838d72","6e3bf623 d5262028 2013481d 1f6e5377"],a:["7d5a0975 fc2c3057 eef67530 417affe7","fb8055c1 26dc5c6c e94a4b44 f330b5d9"],b:["26dc5c6c e94a4b44 f330b5d9 bbd77cbf","95841629 5cf7e1ce 6bccdc18 ff8c07b6"],n:["a9fb57db a1eea9bc 3e660a90 9d838d71","8c397aa3 b561a6f7 901e0e82 974856a7"],h:"1",z:"-2",g:[["8bd2aeb9 cb7e57cb 2c4b482f fc81b7af","b9de27e1 e3bd23c2 3a4453bd 9ace3262"],["547ef835 c3dac4fd 97f8461a 14611dc9","c2774513 2ded8e54 5c1d54c7 2f046997"],pre]})}}class BRAINPOOLP384 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP384",ossl:"brainpoolP384r1",type:"short",endian:"be",hash:"SHA384",prime:null,p:["8cb91e82 a3386d28 0f5d6f7e 50e641df","152f7109 ed5456b4 12b1da19 7fb71123","acd3a729 901d1a71 87470013 3107ec53"],a:["7bc382c6 3d8c150c 3c72080a ce05afa0","c2bea28e 4fb22787 139165ef ba91f90f","8aa5814a 503ad4eb 04a8c7dd 22ce2826"],b:["04a8c7dd 22ce2826 8b39b554 16f0447c","2fb77de1 07dcd2a6 2e880ea5 3eeb62d5","7cb43902 95dbc994 3ab78696 fa504c11"],n:["8cb91e82 a3386d28 0f5d6f7e 50e641df","152f7109 ed5456b3 1f166e6c ac0425a7","cf3ab6af 6b7fc310 3b883202 e9046565"],h:"1",z:"-5",g:[["1d1c64f0 68cf45ff a2a63a81 b7c13f6b","8847a3e7 7ef14fe3 db7fcafe 0cbd10e8","e826e034 36d646aa ef87b2e2 47d4af1e"],["8abe1d75 20f9c2a4 5cb1eb8e 95cfd552","62b70b29 feec5864 e19c054f f9912928","0e464621 77918111 42820341 263c5315"],pre]})}}class BRAINPOOLP512 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP512",ossl:"brainpoolP512r1",type:"short",endian:"be",hash:"SHA512",prime:null,p:["aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07","cb308db3 b3c9d20e d6639cca 70330871","7d4d9b00 9bc66842 aecda12a e6a380e6","2881ff2f 2d82c685 28aa6056 583a48f3"],a:["7830a331 8b603b89 e2327145 ac234cc5","94cbdd8d 3df91610 a83441ca ea9863bc","2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5","7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca"],b:["3df91610 a83441ca ea9863bc 2ded5d5a","a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7","2bf2c7b9 e7c1ac4d 77fc94ca dc083e67","984050b7 5ebae5dd 2809bd63 8016f723"],n:["aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07","cb308db3 b3c9d20e d6639cca 70330870","553e5c41 4ca92619 41866119 7fac1047","1db1d381 085ddadd b5879682 9ca90069"],h:"1",z:"7",g:[["81aee4bd d82ed964 5a21322e 9c4c6a93","85ed9f70 b5d916c1 b43b62ee f4d0098e","ff3b1f78 e2d0d48d 50d1687b 93b97d5f","7c6d5047 406a5e68 8b352209 bcb9f822"],["7dde385d 566332ec c0eabfa9 cf7822fd","f209f700 24a57b1a a000c55b 881f8111","b2dcde49 4a5f485e 5bca4bd8 8a2763ae","d1ca2b2f a8f05406 78cd1e0f 3ad80892"],pre]})}}class X25519 extends MontCurve{constructor(){super({id:"X25519",ossl:"X25519",type:"mont",endian:"le",hash:"SHA512",prime:"p25519",p:["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffed"],a:"76d06",b:"1",n:["10000000 00000000 00000000 00000000","14def9de a2f79cd6 5812631a 5cf5d3ed"],h:"8",z:"2",g:[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000009"],["5f51e65e 475f794b 1fe122d3 88b72eb3","6dc2b281 92839e4d d6163a5d 81312c14"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"],["6be4f497 f9a9c2af c21fa77a d7f4a6ef","635a11c7 284a9363 e9a248ef 9c884415"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"],["141b0b68 06563d50 3de05885 280b5910","9ca5ee38 d7b56c9c 165db710 6377bbd8"]],[["57119fd0 dd4e22d8 868e1c58 c45c4404","5bef839c 55b1d0b1 248c50a3 bc959c5f"],["68c59389 3d458e64 31c6ca00 45fb5015","20a44346 8eaa68dd 0f103842 048065b7"]],[["57119fd0 dd4e22d8 868e1c58 c45c4404","5bef839c 55b1d0b1 248c50a3 bc959c5f"],["173a6c76 c2ba719b ce3935ff ba04afea","df5bbcb9 71559722 f0efc7bd fb7f9a36"]],[["00b8495f 16056286 fdb1329c eb8d09da","6ac49ff1 fae35616 aeb8413b 7c7aebe0"],["3931c129 569e83a5 29482c14 e628b457","933bfc29 ed801b4d 68871483 92507b1a"]],[["00b8495f 16056286 fdb1329c eb8d09da","6ac49ff1 fae35616 aeb8413b 7c7aebe0"],["46ce3ed6 a9617c5a d6b7d3eb 19d74ba8","6cc403d6 127fe4b2 9778eb7c 6daf84d3"]]]})}}class X448 extends MontCurve{constructor(){super({id:"X448",ossl:"X448",type:"mont",endian:"le",hash:"SHAKE256",prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"262a6",b:"1",n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000005"],["7d235d12 95f5b1f6 6c98ab6e 58326fce","cbae5d34 f55545d0 60f75dc2 8df3f6ed","b8027e23 46430d21 1312c4b1 50677af7","6fd7223d 457b5b1a"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["ba4d3a08 29b6112f 8812e51b a0bb2abe","bc1cb08e b48e5569 36ba50fd d2e7d68a","f8cb3216 0522425b 3f990812 abbe635a","d37a21e1 7551b193"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["45b2c5f7 d649eed0 77ed1ae4 5f44d541","43e34f71 4b71aa96 c945af01 2d182975","0734cde9 faddbda4 c066f7ed 54419ca5","2c85de1e 8aae4e6c"]]]})}}class MONT448 extends MontCurve{constructor(){super({id:"MONT448",ossl:null,type:"mont",endian:"le",hash:"SHAKE256",prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:["b2cf97d2 d43459a9 31ed36b1 fc4e3cb5","5d93f8d2 22746997 60ccffc6 49961ed6","c5b05fca c24864ed 6fb59697 931b78da","84ddecd8 ca2b5cfb"],b:"1",n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["ac0d24cc c6c75cb0 eb71f81e 7a6edf51","48e88aee 009a2a24 e795687e c28e125a","3e6730a6 0d46367b aa7fe99d 152128dc","41321bc7 7817f059"],["5a4437f6 80c0d0db 9b061276 d5d0ffcc","e786ff33 b6a53d30 98746425 82e66f09","4433dae7 7244a6e2 6b11e905 7228f483","556c41a5 913f55fe"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["bec92fd0 6da2acf2 b4e261e8 7cef0d34","22e75c18 3c589857 b71924e5 73c2f9ce","e18da5f2 466e2f39 3c2eedf0 f105a60a","b40c717d 4f1e1fd7"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["4136d02f 925d530d 4b1d9e17 8310f2cb","dd18a3e7 c3a767a8 48e6db19 8c3d0631","1e725a0d b991d0c6 c3d1120f 0efa59f5","4bf38e82 b0e1e028"]]]})}}class ED25519 extends EdwardsCurve{constructor(pre){super({id:"ED25519",ossl:"ED25519",type:"edwards",endian:"le",hash:"SHA512",prefix:"SigEd25519 no Ed25519 collisions",context:false,prime:"p25519",p:["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffed"],a:"-1",d:["52036cee 2b6ffe73 8cc74079 7779e898","00700a4d 4141d8ab 75eb4dca 135978a3"],n:["10000000 00000000 00000000 00000000","14def9de a2f79cd6 5812631a 5cf5d3ed"],h:"8",z:"2",g:[["216936d3 cd6e53fe c0a4e231 fdd6dc5c","692cc760 9525a7b2 c9562d60 8f25d51a"],["66666666 66666666 66666666 66666666","66666666 66666666 66666666 66666658"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffec"]],[["2b832480 4fc1df0b 2b4d0099 3dfbd7a7","2f431806 ad2fe478 c4ee1b27 4a0ea0b0"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["547cdb7f b03e20f4 d4b2ff66 c2042858","d0bce7f9 52d01b87 3b11e4d8 b5f15f3d"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["1fd5b9a0 06394a28 e9339932 38de4abb","5c193c70 13e5e238 dea14646 c545d14a"],["05fc536d 880238b1 3933c6d3 05acdfd5","f098eff2 89f4c345 b027b2c2 8f95e826"]],[["602a465f f9c6b5d7 16cc66cd c721b544","a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3"],["05fc536d 880238b1 3933c6d3 05acdfd5","f098eff2 89f4c345 b027b2c2 8f95e826"]],[["1fd5b9a0 06394a28 e9339932 38de4abb","5c193c70 13e5e238 dea14646 c545d14a"],["7a03ac92 77fdc74e c6cc392c fa53202a","0f67100d 760b3cba 4fd84d3d 706a17c7"]],[["602a465f f9c6b5d7 16cc66cd c721b544","a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3"],["7a03ac92 77fdc74e c6cc392c fa53202a","0f67100d 760b3cba 4fd84d3d 706a17c7"]]]})}}class ISO448 extends EdwardsCurve{constructor(pre){super({id:"ISO448",ossl:null,type:"edwards",endian:"le",hash:"SHAKE256",prefix:"SigEd448",context:true,prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"1",d:["d78b4bdc 7f0daf19 f24f38c2 9373a2cc","ad461572 42a50f37 809b1da3 412a12e7","9ccc9c81 264cfe9a d0809970 58fb61c4","243cc32d baa156b9"],n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["79a70b2b 70400553 ae7c9df4 16c792c6","1128751a c9296924 0c25a07d 728bdc93","e21f7787 ed697224 9de732f3 8496cd11","69871309 3e9c04fc"],["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 80000000","00000000 00000000 00000000 00000000","00000000 00000001"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]]]})}}class ED448 extends EdwardsCurve{constructor(pre){super({id:"ED448",ossl:"ED448",type:"edwards",endian:"le",hash:"SHAKE256",prefix:"SigEd448",context:true,prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"1",d:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffff6756"],n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["4f1970c6 6bed0ded 221d15a6 22bf36da","9e146570 470f1767 ea6de324 a3d3a464","12ae1af7 2ab66511 433b80e1 8b00938e","2626a82b c70cc05e"],["693f4671 6eb6bc24 88762037 56c9c762","4bea7373 6ca39840 87789c1e 05a0c2d7","3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad","9808795b f230fa14"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]]]})}}const curves={__proto__:null,P192:P192,P224:P224,P256:P256,P384:P384,P521:P521,SECP256K1:SECP256K1,BRAINPOOLP256:BRAINPOOLP256,BRAINPOOLP384:BRAINPOOLP384,BRAINPOOLP512:BRAINPOOLP512,X25519:X25519,X448:X448,MONT448:MONT448,ED25519:ED25519,ISO448:ISO448,ED448:ED448};const cache={__proto__:null,P192:null,P224:null,P256:null,P384:null,P521:null,SECP256K1:null,BRAINPOOLP256:null,BRAINPOOLP384:null,BRAINPOOLP512:null,X25519:null,X448:null,MONT448:null,ED25519:null,ISO448:null,ED448:null};function curve(name,...args){assert(typeof name==="string");const key=name.toUpperCase();let curve=cache[key];if(!curve){const Curve=curves[key];if(!Curve)throw new Error(`Curve not found: "${name}".`);curve=new Curve(...args);cache[key]=curve}return curve}function register(name,Curve){assert(typeof name==="string");assert(typeof Curve==="function");const key=name.toUpperCase();if(curves[key])throw new Error(`Curve already registered: "${name}".`);curves[key]=Curve;cache[key]=null}function getNAF(k,width,max){assert(k instanceof BN);assert(!k.red);assert(width>>>0===width);assert(max>>>0===max);const naf=new Array(max);const bits=k.bitLength()+1;const sign=k.sign()|1;assert(bits<=max);for(let i=0;i>width-1&1;word-=carry<>>0===step);const naf=getNAF(k,width,max);const len=Math.ceil(naf.length/step);const repr=new Array(len);let i=0;for(let j=0;j=j;k--)nafW=(nafW<<1)+naf[k];repr[i++]=nafW}assert(i===len);return repr}function getJSF(k1,k2,max){assert(k1 instanceof BN);assert(k2 instanceof BN);assert(!k1.red);assert(!k2.red);assert(max>>>0===max);const jsf=[new Array(max),new Array(max)];const bits=Math.max(k1.bitLength(),k2.bitLength())+1;const s1=k1.sign()|1;const s2=k2.sign()|1;assert(bits<=max);let d1=0;let d2=0;for(let i=0;i=0)return root}throw new Error("X^(1/3) is not a square mod P.")}function randomInt(rng){return BN.randomBits(rng,32).toNumber()}function memoize(method,self){const cache=new WeakMap;return function memoized(curve,invert){const i=invert&1;const item=cache.get(curve);if(item&&item[i]!==null)return item[i];const result=method.call(self,curve,invert);if(!cache.has(curve))cache.set(curve,[null,null]);cache.get(curve)[i]=result;return result}}function toPretty(x,size){assert(x instanceof BN);assert(size>>>0===size);if(size&7)size+=8-(size&7);const str=x.toString(16,size);const chunks=[];const out=[];assert((str.length&7)===0);for(let i=0;i>>0===size);const data=bufferExports.Buffer.alloc(size);randomFillSync(data,0,size);return data}function randomFill(data,off,size){assert(bufferExports.Buffer.isBuffer(data));if(off==null)off=0;assert(off>>>0===off);if(size==null)size=data.length-off;assert(size>>>0===size);assert(off+size<=data.length);randomFillSync(data,off,size);return data}function randomInt(){if((poolPos&15)===0){getRandomValues(pool);poolPos=0}return pool[poolPos++]}function randomRange(min,max){assert(min>>>0===min);assert(max>>>0===max);assert(max>=min);const space=max-min;if(space===0)return min;const top=-space>>>0;let x,r;do{x=randomInt();r=x%space}while(x-r>top);return r+min}function getRandomValues(array){if(!HAS_CRYPTO)throw new Error("Entropy source not available.");return randomValues(array)}function randomFillSync(data,off,size){assert(bufferExports.Buffer.isBuffer(data));assert(data.buffer instanceof ArrayBuffer);assert(data.byteOffset>>>0===data.byteOffset);assert(data.byteLength>>>0===data.byteLength);assert(off>>>0===off);assert(size>>>0===size);assert(off+size<=data.byteLength);if(size>2**31-1)throw new RangeError('The value "size" is out of range.');const offset=data.byteOffset+off;const array=new Uint8Array(data.buffer,offset,size);if(array.length>MAX_BYTES){for(let i=0;iarray.length)j=array.length;getRandomValues(array.subarray(i,j))}}else{if(array.length>0)getRandomValues(array)}}random.native=0;random.randomBytes=randomBytes;random.randomFill=randomFill;random.randomInt=randomInt;random.randomRange=randomRange;return random}var randomBrowser;var hasRequiredRandomBrowser;function requireRandomBrowser(){if(hasRequiredRandomBrowser)return randomBrowser;hasRequiredRandomBrowser=1;randomBrowser=requireRandom();return randomBrowser}var eddsa;var hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;const assert=requireAssert();const BatchRNG=requireBatchRng();const BN=requireBnBrowser();const elliptic=requireElliptic();const rng=requireRandomBrowser();class EDDSA{constructor(id,mid,eid,hash,pre){assert(typeof id==="string");assert(!mid||typeof mid==="string");assert(!eid||typeof eid==="string");assert(hash);this.id=id;this.type="eddsa";this.mid=mid||null;this.eid=eid||null;this.hash=hash;this.native=0;this._pre=pre||null;this._curve=null;this._mont=null;this._iso=null;this._rng=null}get curve(){if(!this._curve){this._curve=elliptic.curve(this.id,this._pre);this._curve.precompute(rng);this._pre=null}return this._curve}get mont(){if(this.mid&&!this._mont)this._mont=elliptic.curve(this.mid);return this._mont}get iso(){if(!this.eid)return this.mont;if(!this._iso)this._iso=elliptic.curve(this.eid);return this._iso}get rng(){if(!this._rng)this._rng=new BatchRNG(this.curve);return this._rng}get size(){return this.curve.adjustedSize}get bits(){return this.curve.fieldBits}hashNonce(prefix,msg,ph,ctx){const hash=new Hash(this);hash.init(ph,ctx);hash.update(prefix);hash.update(msg);return hash.final()}hashChallenge(R,A,m,ph,ctx){const hash=new Hash(this);hash.init(ph,ctx);hash.update(R);hash.update(A);hash.update(m);return hash.final()}privateKeyGenerate(){return rng.randomBytes(this.curve.adjustedSize)}scalarGenerate(){const scalar=rng.randomBytes(this.curve.scalarSize);return this.curve.clamp(scalar)}privateKeyExpand(secret){assert(bufferExports.Buffer.isBuffer(secret));assert(secret.length===this.curve.adjustedSize);const hash=this.hash.digest(secret,this.curve.adjustedSize*2);return this.curve.splitHash(hash)}privateKeyConvert(secret){const[key]=this.privateKeyExpand(secret);return key}privateKeyVerify(secret){assert(bufferExports.Buffer.isBuffer(secret));return secret.length===this.curve.adjustedSize}scalarVerify(scalar){assert(bufferExports.Buffer.isBuffer(scalar));return scalar.length===this.curve.scalarSize}scalarIsZero(scalar){assert(bufferExports.Buffer.isBuffer(scalar));let k;try{k=this.curve.decodeScalar(scalar).imod(this.curve.n)}catch(e){return false}return k.isZero()}scalarClamp(scalar){assert(bufferExports.Buffer.isBuffer(scalar));assert(scalar.length===this.curve.scalarSize);return this.curve.clamp(bufferExports.Buffer.from(scalar))}privateKeyExport(secret){const pub=this.publicKeyCreate(secret);const{x,y}=this.publicKeyExport(pub);return{d:bufferExports.Buffer.from(secret),x:x,y:y}}privateKeyImport(json){assert(json&&typeof json==="object");assert(bufferExports.Buffer.isBuffer(json.d));if(json.d.length!==this.curve.adjustedSize)throw new Error("Invalid private key.");return bufferExports.Buffer.from(json.d)}scalarTweakAdd(scalar,tweak){const a=this.curve.decodeScalar(scalar);const t=this.curve.decodeScalar(tweak);const k=a.add(t).imod(this.curve.n);return this.curve.encodeScalar(k)}scalarTweakMul(scalar,tweak){const a=this.curve.decodeScalar(scalar);const t=this.curve.decodeScalar(tweak);const k=a.mul(t).imod(this.curve.n);return this.curve.encodeScalar(k)}scalarReduce(scalar){const a=this.curve.decodeScalar(scalar);const k=a.imod(this.curve.n);return this.curve.encodeScalar(k)}scalarNegate(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);const k=a.neg().imod(this.curve.n);return this.curve.encodeScalar(k)}scalarInvert(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);if(a.isZero())return this.curve.encodeScalar(a);const k=a.invert(this.curve.n);return this.curve.encodeScalar(k)}publicKeyCreate(secret){const key=this.privateKeyConvert(secret);return this.publicKeyFromScalar(key)}publicKeyFromScalar(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);const A=this.curve.g.mulBlind(a);return A.encode()}publicKeyConvert(key){if(!this.mont)throw new Error("No equivalent montgomery curve.");const A=this.curve.decodePoint(key);const P=this.mont.pointFromEdwards(A);return P.encode()}publicKeyFromUniform(bytes){const u=this.curve.decodeUniform(bytes);const A=this.curve.pointFromUniform(u,this.iso);return A.encode()}publicKeyToUniform(key,hint=rng.randomInt()){const A=this.curve.decodePoint(key);const u=this.curve.pointToUniform(A,hint,this.iso);return this.curve.encodeUniform(u,hint>>>8)}publicKeyFromHash(bytes,pake=false){const A=this.curve.pointFromHash(bytes,pake,this.iso);return A.encode()}publicKeyToHash(key,subgroup=rng.randomInt()){const A=this.curve.decodePoint(key);return this.curve.pointToHash(A,subgroup,rng,this.iso)}publicKeyVerify(key){assert(bufferExports.Buffer.isBuffer(key));try{this.curve.decodePoint(key)}catch(e){return false}return true}publicKeyIsInfinity(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.isInfinity()}publicKeyIsSmall(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.isSmall()}publicKeyHasTorsion(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.hasTorsion()}publicKeyExport(key){const{x,y}=this.curve.decodePoint(key);return{x:this.curve.encodeField(x.fromRed()),y:this.curve.encodeField(y.fromRed())}}publicKeyImport(json){assert(json&&typeof json==="object");let x=null;let y=null;let A;if(json.x!=null){x=BN.decode(json.x,this.curve.endian);if(x.cmp(this.curve.p)>=0)throw new Error("Invalid point.")}if(json.y!=null){y=BN.decode(json.y,this.curve.endian);if(y.cmp(this.curve.p)>=0)throw new Error("Invalid point.")}if(x&&y){A=this.curve.point(x,y);if(!A.validate())throw new Error("Invalid point.")}else if(x){A=this.curve.pointFromX(x,json.sign)}else if(y){A=this.curve.pointFromY(y,json.sign)}else{throw new Error("Invalid point.")}return A.encode()}publicKeyTweakAdd(key,tweak){const t=this.curve.decodeScalar(tweak).imod(this.curve.n);const A=this.curve.decodePoint(key);const T=this.curve.g.mul(t);const P=T.add(A);return P.encode()}publicKeyTweakMul(key,tweak){const t=this.curve.decodeScalar(tweak);const A=this.curve.decodePoint(key);const P=A.mul(t);return P.encode()}publicKeyCombine(keys){assert(Array.isArray(keys));let P=this.curve.point();for(const key of keys){const A=this.curve.decodePoint(key);P=P.add(A)}return P.encode()}publicKeyNegate(key){const A=this.curve.decodePoint(key);const P=A.neg();return P.encode()}sign(msg,secret,ph,ctx){const[key,prefix]=this.privateKeyExpand(secret);return this.signWithScalar(msg,key,prefix,ph,ctx)}signWithScalar(msg,scalar,prefix,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(prefix));assert(prefix.length===this.curve.adjustedSize);const{n}=this.curve;const G=this.curve.g;const k=this.hashNonce(prefix,msg,ph,ctx);const Rraw=G.mulBlind(k).encode();const a=this.curve.decodeScalar(scalar);const Araw=G.mulBlind(a).encode();const e=this.hashChallenge(Rraw,Araw,msg,ph,ctx);const s=k.add(e.mul(a)).imod(n);return bufferExports.Buffer.concat([Rraw,this.curve.encodeAdjusted(s)])}signTweakAdd(msg,secret,tweak,ph,ctx){const[key_,prefix_]=this.privateKeyExpand(secret);const key=this.scalarTweakAdd(key_,tweak);const expanded=this.hash.multi(prefix_,tweak,null,this.curve.adjustedSize*2);const prefix=expanded.slice(0,this.curve.adjustedSize);return this.signWithScalar(msg,key,prefix,ph,ctx)}signTweakMul(msg,secret,tweak,ph,ctx){const[key_,prefix_]=this.privateKeyExpand(secret);const key=this.scalarTweakMul(key_,tweak);const expanded=this.hash.multi(prefix_,tweak,null,this.curve.adjustedSize*2);const prefix=expanded.slice(0,this.curve.adjustedSize);return this.signWithScalar(msg,key,prefix,ph,ctx)}verify(msg,sig,key,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false;try{return this._verify(msg,sig,key,ph,ctx)}catch(e){return false}}_verify(msg,sig,key,ph,ctx){const{n}=this.curve;const G=this.curve.g;const Rraw=sig.slice(0,this.curve.adjustedSize);const sraw=sig.slice(this.curve.adjustedSize);const R=this.curve.decodePoint(Rraw);const s=this.curve.decodeAdjusted(sraw);const A=this.curve.decodePoint(key);if(s.cmp(n)>=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);return G.mulAdd(s,A.neg(),e).eq(R)}verifySingle(msg,sig,key,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false;try{return this._verifySingle(msg,sig,key,ph,ctx)}catch(e){return false}}_verifySingle(msg,sig,key,ph,ctx){const{n}=this.curve;const G=this.curve.g;const Rraw=sig.slice(0,this.curve.adjustedSize);const sraw=sig.slice(this.curve.adjustedSize);const R=this.curve.decodePoint(Rraw);const s=this.curve.decodeAdjusted(sraw);const A=this.curve.decodePoint(key);if(s.cmp(n)>=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);const sh=this.curve.imulH(s);const Ah=A.mulH();const Rh=R.mulH();return G.mulAdd(sh,Ah.neg(),e).eq(Rh)}verifyBatch(batch,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(Array.isArray(batch));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));for(const item of batch){assert(Array.isArray(item)&&item.length===3);const[msg,sig,key]=item;assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false}try{return this._verifyBatch(batch,ph,ctx)}catch(e){return false}}_verifyBatch(batch,ph,ctx){const{n}=this.curve;const G=this.curve.g;const points=new Array(1+batch.length*2);const coeffs=new Array(1+batch.length*2);const sum=new BN(0);this.rng.init(batch);points[0]=G;coeffs[0]=sum;for(let i=0;i=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);const a=this.rng.generate(i);const ea=e.mul(a).imod(n);sum.iadd(s.mul(a)).imod(n);points[1+i*2+0]=R.mulH();coeffs[1+i*2+0]=a;points[1+i*2+1]=A.mulH();coeffs[1+i*2+1]=ea}this.curve.imulH(sum.ineg());return this.curve.mulAll(points,coeffs).isInfinity()}derive(pub,secret){const scalar=this.privateKeyConvert(secret);return this.deriveWithScalar(pub,scalar)}deriveWithScalar(pub,scalar){const A=this.curve.decodePoint(pub);const a=this.curve.decodeClamped(scalar);const P=A.mulBlind(a,rng);if(P.isInfinity())throw new Error("Invalid point.");return P.encode()}}class Hash{constructor(eddsa){this.curve=eddsa.curve;this.hash=new eddsa.hash}init(ph,ctx){assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(ctx.length>255)ctx=ctx.slice(0,255);this.hash.init();if(this.curve.context||ph!=null||ctx.length>0){if(this.curve.prefix)this.hash.update(this.curve.prefix);this.hash.update(byte(ph));this.hash.update(byte(ctx.length));this.hash.update(ctx)}return this}update(data){this.hash.update(data);return this}final(){const hash=this.hash.final(this.curve.adjustedSize*2);const num=BN.decode(hash,this.curve.endian);return num.imod(this.curve.n)}}function byte(ch){const buf=bufferExports.Buffer.alloc(1);buf[0]=ch&255;return buf}eddsa=EDDSA;return eddsa}var keccak;var hasRequiredKeccak;function requireKeccak(){if(hasRequiredKeccak)return keccak;hasRequiredKeccak=1;const assert=requireAssert();const HMAC=requireHmac();const FINALIZED=2147483648;const ROUND_CONST=new Uint32Array([1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648]);class Keccak{constructor(){this.state=new Uint32Array(50);this.block=bufferExports.Buffer.alloc(200);this.bs=136;this.pos=FINALIZED}init(bits){if(bits==null)bits=256;assert(bits>>>0===bits);assert(bits>=128);assert(bits<=512);const rate=1600-bits*2;assert(rate>=0&&(rate&63)===0);this.bs=rate>>>3;this.pos=0;return this}update(data){assert(bufferExports.Buffer.isBuffer(data));assert(!(this.pos&FINALIZED),"Context is not initialized.");let len=data.length;let pos=this.pos;let off=0;this.pos=(this.pos+len)%this.bs;if(pos>0){let want=this.bs-pos;if(want>len)want=len;data.copy(this.block,pos,off,off+want);pos+=want;len-=want;off+=want;if(pos=this.bs){this._transform(data,off);off+=this.bs;len-=this.bs}if(len>0)data.copy(this.block,0,off,off+len);return this}final(pad,len){if(pad==null)pad=1;if(len==null||len===0)len=100-(this.bs>>>1);assert((pad&255)===pad);assert(len>>>0===len);assert(!(this.pos&FINALIZED),"Context is not initialized.");this.block.fill(0,this.pos,this.bs);this.block[this.pos]|=pad;this.block[this.bs-1]|=128;this._transform(this.block,0);this.pos=FINALIZED;assert(len<=this.bs);const out=bufferExports.Buffer.alloc(len);for(let i=0;i>>2]>>>8*(i&3);for(let i=0;i<50;i++)this.state[i]=0;for(let i=0;i>>2;const s=this.state;for(let i=0;i>>31);const l0=c9^(c3<<1|c2>>>31);const h1=c0^(c4<<1|c5>>>31);const l1=c1^(c5<<1|c4>>>31);const h2=c2^(c6<<1|c7>>>31);const l2=c3^(c7<<1|c6>>>31);const h3=c4^(c8<<1|c9>>>31);const l3=c5^(c9<<1|c8>>>31);const h4=c6^(c0<<1|c1>>>31);const l4=c7^(c1<<1|c0>>>31);s[0]^=h0;s[1]^=l0;s[10]^=h0;s[11]^=l0;s[20]^=h0;s[21]^=l0;s[30]^=h0;s[31]^=l0;s[40]^=h0;s[41]^=l0;s[2]^=h1;s[3]^=l1;s[12]^=h1;s[13]^=l1;s[22]^=h1;s[23]^=l1;s[32]^=h1;s[33]^=l1;s[42]^=h1;s[43]^=l1;s[4]^=h2;s[5]^=l2;s[14]^=h2;s[15]^=l2;s[24]^=h2;s[25]^=l2;s[34]^=h2;s[35]^=l2;s[44]^=h2;s[45]^=l2;s[6]^=h3;s[7]^=l3;s[16]^=h3;s[17]^=l3;s[26]^=h3;s[27]^=l3;s[36]^=h3;s[37]^=l3;s[46]^=h3;s[47]^=l3;s[8]^=h4;s[9]^=l4;s[18]^=h4;s[19]^=l4;s[28]^=h4;s[29]^=l4;s[38]^=h4;s[39]^=l4;s[48]^=h4;s[49]^=l4;const b0=s[0];const b1=s[1];const b32=s[11]<<4|s[10]>>>28;const b33=s[10]<<4|s[11]>>>28;const b14=s[20]<<3|s[21]>>>29;const b15=s[21]<<3|s[20]>>>29;const b46=s[31]<<9|s[30]>>>23;const b47=s[30]<<9|s[31]>>>23;const b28=s[40]<<18|s[41]>>>14;const b29=s[41]<<18|s[40]>>>14;const b20=s[2]<<1|s[3]>>>31;const b21=s[3]<<1|s[2]>>>31;const b2=s[13]<<12|s[12]>>>20;const b3=s[12]<<12|s[13]>>>20;const b34=s[22]<<10|s[23]>>>22;const b35=s[23]<<10|s[22]>>>22;const b16=s[33]<<13|s[32]>>>19;const b17=s[32]<<13|s[33]>>>19;const b48=s[42]<<2|s[43]>>>30;const b49=s[43]<<2|s[42]>>>30;const b40=s[5]<<30|s[4]>>>2;const b41=s[4]<<30|s[5]>>>2;const b22=s[14]<<6|s[15]>>>26;const b23=s[15]<<6|s[14]>>>26;const b4=s[25]<<11|s[24]>>>21;const b5=s[24]<<11|s[25]>>>21;const b36=s[34]<<15|s[35]>>>17;const b37=s[35]<<15|s[34]>>>17;const b18=s[45]<<29|s[44]>>>3;const b19=s[44]<<29|s[45]>>>3;const b10=s[6]<<28|s[7]>>>4;const b11=s[7]<<28|s[6]>>>4;const b42=s[17]<<23|s[16]>>>9;const b43=s[16]<<23|s[17]>>>9;const b24=s[26]<<25|s[27]>>>7;const b25=s[27]<<25|s[26]>>>7;const b6=s[36]<<21|s[37]>>>11;const b7=s[37]<<21|s[36]>>>11;const b38=s[47]<<24|s[46]>>>8;const b39=s[46]<<24|s[47]>>>8;const b30=s[8]<<27|s[9]>>>5;const b31=s[9]<<27|s[8]>>>5;const b12=s[18]<<20|s[19]>>>12;const b13=s[19]<<20|s[18]>>>12;const b44=s[29]<<7|s[28]>>>25;const b45=s[28]<<7|s[29]>>>25;const b26=s[38]<<8|s[39]>>>24;const b27=s[39]<<8|s[38]>>>24;const b8=s[48]<<14|s[49]>>>18;const b9=s[49]<<14|s[48]>>>18;s[0]=b0^~b2&b4;s[1]=b1^~b3&b5;s[10]=b10^~b12&b14;s[11]=b11^~b13&b15;s[20]=b20^~b22&b24;s[21]=b21^~b23&b25;s[30]=b30^~b32&b34;s[31]=b31^~b33&b35;s[40]=b40^~b42&b44;s[41]=b41^~b43&b45;s[2]=b2^~b4&b6;s[3]=b3^~b5&b7;s[12]=b12^~b14&b16;s[13]=b13^~b15&b17;s[22]=b22^~b24&b26;s[23]=b23^~b25&b27;s[32]=b32^~b34&b36;s[33]=b33^~b35&b37;s[42]=b42^~b44&b46;s[43]=b43^~b45&b47;s[4]=b4^~b6&b8;s[5]=b5^~b7&b9;s[14]=b14^~b16&b18;s[15]=b15^~b17&b19;s[24]=b24^~b26&b28;s[25]=b25^~b27&b29;s[34]=b34^~b36&b38;s[35]=b35^~b37&b39;s[44]=b44^~b46&b48;s[45]=b45^~b47&b49;s[6]=b6^~b8&b0;s[7]=b7^~b9&b1;s[16]=b16^~b18&b10;s[17]=b17^~b19&b11;s[26]=b26^~b28&b20;s[27]=b27^~b29&b21;s[36]=b36^~b38&b30;s[37]=b37^~b39&b31;s[46]=b46^~b48&b40;s[47]=b47^~b49&b41;s[8]=b8^~b0&b2;s[9]=b9^~b1&b3;s[18]=b18^~b10&b12;s[19]=b19^~b11&b13;s[28]=b28^~b20&b22;s[29]=b29^~b21&b23;s[38]=b38^~b30&b32;s[39]=b39^~b31&b33;s[48]=b48^~b40&b42;s[49]=b49^~b41&b43;s[0]^=ROUND_CONST[n+0];s[1]^=ROUND_CONST[n+1]}}static hash(){return new Keccak}static hmac(bits,pad,len){if(bits==null)bits=256;assert(bits>>>0===bits);const rate=1600-bits*2;assert(rate>=0&&(rate&63)===0);return new HMAC(Keccak,rate>>>3,[bits],[pad,len])}static digest(data,bits,pad,len){return Keccak.ctx.init(bits).update(data).final(pad,len)}static root(left,right,bits,pad,len){if(bits==null)bits=256;if(len==null)len=0;if(len===0)len=bits>>>3;assert(bits>>>0===bits);assert((bits&7)===0);assert(len>>>0===len);assert(bufferExports.Buffer.isBuffer(left)&&left.length===len);assert(bufferExports.Buffer.isBuffer(right)&&right.length===len);return Keccak.ctx.init(bits).update(left).update(right).final(pad,len)}static multi(x,y,z,bits,pad,len){const{ctx}=Keccak;ctx.init(bits);ctx.update(x);ctx.update(y);if(z)ctx.update(z);return ctx.final(pad,len)}static mac(data,key,bits,pad,len){return Keccak.hmac(bits,pad,len).init(key).update(data).final()}}Keccak.native=0;Keccak.id="KECCAK256";Keccak.size=32;Keccak.bits=256;Keccak.blockSize=136;Keccak.zero=bufferExports.Buffer.alloc(32,0);Keccak.ctx=new Keccak;function readU32(data,off){return data[off++]+data[off++]*256+data[off++]*65536+data[off]*16777216}keccak=Keccak;return keccak}var keccakBrowser;var hasRequiredKeccakBrowser;function requireKeccakBrowser(){if(hasRequiredKeccakBrowser)return keccakBrowser;hasRequiredKeccakBrowser=1;keccakBrowser=requireKeccak();return keccakBrowser}var shake;var hasRequiredShake;function requireShake(){if(hasRequiredShake)return shake;hasRequiredShake=1;const Keccak=requireKeccakBrowser();class SHAKE extends Keccak{constructor(){super()}final(len){return super.final(31,len)}static hash(){return new SHAKE}static hmac(bits,len){return super.hmac(bits,31,len)}static digest(data,bits,len){return super.digest(data,bits,31,len)}static root(left,right,bits,len){return super.root(left,right,bits,31,len)}static multi(x,y,z,bits,len){return super.multi(x,y,z,bits,31,len)}static mac(data,key,bits,len){return super.mac(data,key,bits,31,len)}}SHAKE.native=Keccak.native;SHAKE.id="SHAKE256";SHAKE.size=32;SHAKE.bits=256;SHAKE.blockSize=136;SHAKE.zero=bufferExports.Buffer.alloc(32,0);SHAKE.ctx=new SHAKE;shake=SHAKE;return shake}var shake256;var hasRequiredShake256;function requireShake256(){if(hasRequiredShake256)return shake256;hasRequiredShake256=1;const SHAKE=requireShake();class SHAKE256 extends SHAKE{constructor(){super()}init(){return super.init(256)}static hash(){return new SHAKE256}static hmac(len){return super.hmac(256,len)}static digest(data,len){return super.digest(data,256,len)}static root(left,right,len){return super.root(left,right,256,len)}static multi(x,y,z,len){return super.multi(x,y,z,256,len)}static mac(data,key,len){return super.mac(data,key,256,len)}}SHAKE256.native=SHAKE.native;SHAKE256.id="SHAKE256";SHAKE256.size=32;SHAKE256.bits=256;SHAKE256.blockSize=136;SHAKE256.zero=bufferExports.Buffer.alloc(32,0);SHAKE256.ctx=new SHAKE256;shake256=SHAKE256;return shake256}var ed448$1;var hasRequiredEd448;function requireEd448(){if(hasRequiredEd448)return ed448$1;hasRequiredEd448=1;const EDDSA=requireEddsa();const SHAKE256=requireShake256();ed448$1=new EDDSA("ED448","X448","MONT448",SHAKE256);return ed448$1}var ed448Browser;var hasRequiredEd448Browser;function requireEd448Browser(){if(hasRequiredEd448Browser)return ed448Browser;hasRequiredEd448Browser=1;ed448Browser=requireEd448();return ed448Browser}var ed448BrowserExports=requireEd448Browser();var backend=getDefaultExportFromCjs(ed448BrowserExports);const ed448=backend;const BN_0$9=BigInt(0);const BN_1$5=BigInt(1);const maxValue=9007199254740991;function fromTwos(_value,_width){const value=getUint(_value,"value");const width=BigInt(getNumber(_width,"width"));assert(value>>width===BN_0$9,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:_value});if(value>>width-BN_1$5){const mask=(BN_1$5<=-maxValue&&value<=maxValue,"overflow",name||"value",value);return BigInt(value);case"string":try{if(value===""){throw new Error("empty string")}if(value[0]==="-"&&value[1]!=="-"){return-BigInt(value.substring(1))}return BigInt(value)}catch(e){assertArgument(false,`invalid BigNumberish string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid BigNumberish value",name||"value",value)}function getUint(value,name){const result=getBigInt(value,name);assert(result>=BN_0$9,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:value});return result}const Nibbles="0123456789abcdef";function toBigInt(value){if(value instanceof Uint8Array){let result="0x0";for(const v of value){result+=Nibbles[v>>4];result+=Nibbles[v&15]}return BigInt(result)}return getBigInt(value)}function getNumber(value,name){switch(typeof value){case"bigint":assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return Number(value);case"number":assertArgument(Number.isInteger(value),"underflow",name||"value",value);assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return value;case"string":try{if(value===""){throw new Error("empty string")}return getNumber(BigInt(value),name)}catch(e){assertArgument(false,`invalid numeric string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid numeric value",name||"value",value)}function toNumber(value){return getNumber(toBigInt(value))}function toBeHex(_value,_width){const value=getUint(_value,"value");let result=value.toString(16);if(_width==null){if(result.length%2){result="0"+result}}else{const width=getNumber(_width,"width");assert(width*2>=result.length,`value exceeds width (${width} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:_value});while(result.length>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){if(form!=null){assertNormalize(form);str=str.normalize(form)}let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}function toUtf8CodePoints(str,form){return getUtf8CodePoints(toUtf8Bytes(str,form))}async function getUrl(req,_signal){const protocol=req.url.split(":")[0].toLowerCase();assert(protocol==="http"||protocol==="https",`unsupported protocol ${protocol}`,"UNSUPPORTED_OPERATION",{info:{protocol:protocol},operation:"request"});assert(protocol==="https"||!req.credentials||req.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let signal=undefined;if(_signal){const controller=new AbortController;signal=controller.signal;_signal.addListener(()=>{controller.abort()})}const init={method:req.method,headers:new Headers(Array.from(req)),body:req.body||undefined,signal:signal};try{const resp=await fetch(req.url,init);const headers={};resp.headers.forEach((value,key)=>{headers[key.toLowerCase()]=value});const respBody=await resp.arrayBuffer();const body=respBody==null?null:new Uint8Array(respBody);return{statusCode:resp.status,statusMessage:resp.statusText,headers:headers,body:body}}catch(error){console.log({error:error});return undefined}}const MAX_ATTEMPTS=12;const SLOT_INTERVAL=250;let getUrlFunc=getUrl;const reData=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i");const reIpfs=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let locked$5=false;async function dataGatewayFunc(url,signal){try{const match=url.match(reData);if(!match){throw new Error("invalid data")}return new FetchResponse(200,"OK",{"content-type":match[1]||"text/plain"},match[2]?decodeBase64(match[3]):unpercent(match[3]))}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(url))}}function getIpfsGatewayFunc(baseUrl){async function gatewayIpfs(url,signal){try{const match=url.match(reIpfs);if(!match){throw new Error("invalid link")}return new FetchRequest(`${baseUrl}${match[2]}`)}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(url))}}return gatewayIpfs}const Gateways={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")};const fetchSignals=new WeakMap;class FetchCancelSignal{#listeners;#cancelled;constructor(request){this.#listeners=[];this.#cancelled=false;fetchSignals.set(request,()=>{if(this.#cancelled){return}this.#cancelled=true;for(const listener of this.#listeners){setTimeout(()=>{listener()},0)}this.#listeners=[]})}addListener(listener){assert(!this.#cancelled,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"});this.#listeners.push(listener)}get cancelled(){return this.#cancelled}checkSignal(){assert(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(signal){if(signal==null){throw new Error("missing signal; should not happen")}signal.checkSignal();return signal}class FetchRequest{#allowInsecure;#gzip;#headers;#method;#timeout;#url;#body;#bodyType;#creds;#preflight;#process;#retry;#signal;#throttle;get url(){return this.#url}set url(url){this.#url=String(url)}get body(){if(this.#body==null){return null}return new Uint8Array(this.#body)}set body(body){if(body==null){this.#body=undefined;this.#bodyType=undefined}else if(typeof body==="string"){this.#body=toUtf8Bytes(body);this.#bodyType="text/plain"}else if(body instanceof Uint8Array){this.#body=body;this.#bodyType="application/octet-stream"}else if(typeof body==="object"){this.#body=toUtf8Bytes(JSON.stringify(body));this.#bodyType="application/json"}else{throw new Error("invalid body")}}hasBody(){return this.#body!=null}get method(){if(this.#method){return this.#method}if(this.hasBody()){return"POST"}return"GET"}set method(method){if(method==null){method=""}this.#method=String(method).toUpperCase()}get headers(){const headers=Object.assign({},this.#headers);if(this.#creds){headers["authorization"]=`Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`}if(this.allowGzip){headers["accept-encoding"]="gzip"}if(headers["content-type"]==null&&this.#bodyType){headers["content-type"]=this.#bodyType}if(this.body){headers["content-length"]=String(this.body.length)}return headers}getHeader(key){return this.headers[key.toLowerCase()]}setHeader(key,value){this.#headers[String(key).toLowerCase()]=String(value)}clearHeaders(){this.#headers={}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index=0,"timeout must be non-zero","timeout",timeout);this.#timeout=timeout}get preflightFunc(){return this.#preflight||null}set preflightFunc(preflight){this.#preflight=preflight}get processFunc(){return this.#process||null}set processFunc(process){this.#process=process}get retryFunc(){return this.#retry||null}set retryFunc(retry){this.#retry=retry}constructor(url){this.#url=String(url);this.#allowInsecure=false;this.#gzip=true;this.#headers={};this.#method="";this.#timeout=3e5;this.#throttle={slotInterval:SLOT_INTERVAL,maxAttempts:MAX_ATTEMPTS}}toString(){return``}setThrottleParams(params){if(params.slotInterval!=null){this.#throttle.slotInterval=params.slotInterval}if(params.maxAttempts!=null){this.#throttle.maxAttempts=params.maxAttempts}}async#send(attempt,expires,delay,_request,_response){if(attempt>=this.#throttle.maxAttempts){return _response.makeServerError("exceeded maximum retry limit")}assert(getTime$2()<=expires,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:_request});if(delay>0){await wait(delay)}let req=this.clone();const scheme=(req.url.split(":")[0]||"").toLowerCase();if(scheme in Gateways){const result=await Gateways[scheme](req.url,checkSignal(_request.#signal));if(result instanceof FetchResponse){let response=result;if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}}}return response}req=result}if(this.preflightFunc){req=await this.preflightFunc(req)}const resp=await getUrlFunc(req,checkSignal(_request.#signal));let response=new FetchResponse(resp.statusCode,resp.statusMessage,resp.headers,resp.body,_request);if(response.statusCode===301||response.statusCode===302){try{const location=response.headers.location||"";return req.redirect(location).#send(attempt+1,expires,0,_request,response)}catch(error){}return response}else if(response.statusCode===429){if(this.retryFunc==null||await this.retryFunc(req,response,attempt)){const retryAfter=response.headers["retry-after"];let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(typeof retryAfter==="string"&&retryAfter.match(/^[1-9][0-9]*$/)){delay=parseInt(retryAfter)}return req.clone().#send(attempt+1,expires,delay,_request,response)}}if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(error.stall>=0){delay=error.stall}return req.clone().#send(attempt+1,expires,delay,_request,response)}}return response}send(){assert(this.#signal==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"});this.#signal=new FetchCancelSignal(this);return this.#send(0,getTime$2()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){assert(this.#signal!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const signal=fetchSignals.get(this);if(!signal){throw new Error("missing signal; should not happen")}signal()}redirect(location){const current=this.url.split(":")[0].toLowerCase();const target=location.split(":")[0].toLowerCase();assert(this.method==="GET"&&(current!=="https"||target!=="http")&&location.match(/^https?:/),`unsupported redirect`,"UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`});const req=new FetchRequest(location);req.method="GET";req.allowGzip=this.allowGzip;req.timeout=this.timeout;req.#headers=Object.assign({},this.#headers);if(this.#body){req.#body=new Uint8Array(this.#body)}req.#bodyType=this.#bodyType;return req}clone(){const clone=new FetchRequest(this.url);clone.#method=this.#method;if(this.#body){clone.#body=this.#body}clone.#bodyType=this.#bodyType;clone.#headers=Object.assign({},this.#headers);clone.#creds=this.#creds;if(this.allowGzip){clone.allowGzip=true}clone.timeout=this.timeout;if(this.allowInsecureAuthentication){clone.allowInsecureAuthentication=true}clone.#preflight=this.#preflight;clone.#process=this.#process;clone.#retry=this.#retry;return clone}static lockConfig(){locked$5=true}static getGateway(scheme){return Gateways[scheme.toLowerCase()]||null}static registerGateway(scheme,func){scheme=scheme.toLowerCase();if(scheme==="http"||scheme==="https"){throw new Error(`cannot intercept ${scheme}; use registerGetUrl`)}if(locked$5){throw new Error("gateways locked")}Gateways[scheme]=func}static registerGetUrl(getUrl){if(locked$5){throw new Error("gateways locked")}getUrlFunc=getUrl}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(baseUrl){return getIpfsGatewayFunc(baseUrl)}}class FetchResponse{#statusCode;#statusMessage;#headers;#body;#request;#error;toString(){return``}get statusCode(){return this.#statusCode}get statusMessage(){return this.#statusMessage}get headers(){return Object.assign({},this.#headers)}get body(){return this.#body==null?null:new Uint8Array(this.#body)}get bodyText(){try{return this.#body==null?"":toUtf8String(this.#body)}catch(error){assert(false,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(error){assert(false,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index{accum[k.toLowerCase()]=String(headers[k]);return accum},{});this.#body=body==null?null:new Uint8Array(body);this.#request=request||null;this.#error={message:""}}makeServerError(message,error){let statusMessage;if(!message){message=`${this.statusCode} ${this.statusMessage}`;statusMessage=`CLIENT ESCALATED SERVER ERROR (${message})`}else{statusMessage=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`}const response=new FetchResponse(599,statusMessage,this.headers,this.body,this.#request||undefined);response.#error={message:message,error:error};return response}throwThrottleError(message,stall){if(stall==null){stall=-1}else{assertArgument(Number.isInteger(stall)&&stall>=0,"invalid stall timeout","stall",stall)}const error=new Error(message||"throttling requests");defineProperties(error,{stall:stall,throttle:true});throw error}getHeader(key){return this.headers[key.toLowerCase()]}hasBody(){return this.#body!=null}get request(){return this.#request}ok(){return this.#error.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok()){return}let{message,error}=this.#error;if(message===""){message=`server response ${this.statusCode} ${this.statusMessage}`}assert(false,message,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:error})}}function getTime$2(){return(new Date).getTime()}function unpercent(value){return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi,(all,code)=>{return String.fromCharCode(parseInt(code,16))}))}function wait(delay){return new Promise(resolve=>setTimeout(resolve,delay))}var _a$1;const BN_N1=BigInt(-1);const BN_0$7=BigInt(0);const BN_1$4=BigInt(1);const BN_5=BigInt(5);const _guard$5={};let Zeros="0000";while(Zeros.length<80){Zeros+=Zeros}function getTens(decimals){let result=Zeros;while(result.length=-limit&&valBN_0$7){val=fromTwos(mask(val,width),width)}else{val=-fromTwos(mask(-val,width),width)}}else{const limit=BN_1$4<=0&&val{if(v[key]==null){return defaultValue}assertArgument(typeof v[key]===type,"invalid fixed format ("+key+" not "+type+")","format."+key,v[key]);return v[key]};signed=check("signed","boolean",signed);width=check("width","number",width);decimals=check("decimals","number",decimals)}assertArgument(width%8===0,"invalid FixedNumber width (not byte aligned)","format.width",width);assertArgument(decimals<=80,"invalid FixedNumber decimals (too large)","format.decimals",decimals);const name=(signed?"":"u")+"fixed"+String(width)+"x"+String(decimals);return{signed:signed,width:width,decimals:decimals,name:name}}function toString(val,decimals){let negative="";if(val0){b*=getTens(delta)}else if(delta<0){a*=getTens(-delta)}if(ab){return-1}return 0}eq(other){return this.cmp(other)===0}lt(other){return this.cmp(other)<0}lte(other){return this.cmp(other)<=0}gt(other){return this.cmp(other)>0}gte(other){return this.cmp(other)>=0}floor(){let val=this.#val;if(this.#valBN_0$7){val+=this.#tens-BN_1$4}val=this.#val/this.#tens*this.#tens;return this.#checkValue(val,"ceiling")}round(decimals){if(decimals==null){decimals=0}if(decimals>=this.decimals){return this}const delta=this.decimals-decimals;const bump=BN_5*getTens(delta-1);let value=this.value+bump;const tens=getTens(delta);value=value/tens*tens;checkValue(value,this.#format,"round");return new _a$1(_guard$5,value,this.#format)}isZero(){return this.#val===BN_0$7}isNegative(){return this.#val0){const tens=getTens(delta);assert(value%tens===BN_0$7,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:_value});value/=tens}else if(delta<0){value*=getTens(-delta)}checkValue(value,format,"fromValue");return new _a$1(_guard$5,value,format)}static fromString(_value,_format){const match=_value.match(/^(-?)([0-9]*)\.?([0-9]*)$/);assertArgument(match&&match[2].length+match[3].length>0,"invalid FixedNumber string value","value",_value);const format=getFormat(_format);let whole=match[2]||"0",decimal=match[3]||"";while(decimal.length{assert(offset<=data.length,"data short segment too short","BUFFER_OVERRUN",{buffer:data,length:data.length,offset:offset})};if(data[offset]>=248){const lengthLength=data[offset]-247;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);return _decodeChildren(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;checkOffset(offset+1+length);return _decodeChildren(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;checkOffset(offset+1+length);const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlifyByte(data[offset])}}function decodeRlp(_data){const data=getBytes(_data,"data");const decoded=_decode(data,0);assertArgument(decoded.consumed===data.length,"unexpected junk after rlp payload","data",_data);return decoded.result}function arrayifyInteger(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function _encode(object){if(Array.isArray(object)){let payload=[];object.forEach(function(child){payload=payload.concat(_encode(child))});if(payload.length<=55){payload.unshift(192+payload.length);return payload}const length=arrayifyInteger(payload.length);length.unshift(247+length.length);return length.concat(payload)}const data=Array.prototype.slice.call(getBytes(object,"object"));if(data.length===1&&data[0]<=127){return data}else if(data.length<=55){data.unshift(128+data.length);return data}const length=arrayifyInteger(data.length);length.unshift(183+length.length);return length.concat(data)}const nibbles="0123456789abcdef";function encodeRlp(object){let result="0x";for(const v of _encode(object)){result+=nibbles[v>>4];result+=nibbles[v&15]}return result}const names=["ore","fecore","picore","nacore","mcore","micore","core"];function formatUnits(value,unit){let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromValue(value,decimals,{decimals:decimals}).toString()}const scientificToDecimal=num=>{var nsign=Math.sign(num);num=Math.abs(num);if(/\d+\.?\d*e[\+\-]*\d+/i.test(num)){var zero="0",parts=String(num).toLowerCase().split("e"),e=parts.pop(),l=Math.abs(e),sign=e/l,coeff_array=parts[0].split(".");if(sign===-1){l=l-coeff_array[0].length;if(l<0){num=coeff_array[0].slice(0,l)+"."+coeff_array[0].slice(l)+(coeff_array.length===2?coeff_array[1]:"")}else{num=zero+"."+new Array(l+1).join(zero)+coeff_array.join("")}}else{var dec=coeff_array[1];if(dec)l=l-dec.length;if(l<0){num=coeff_array[0]+dec.slice(0,l)+"."+dec.slice(l)}else{num=coeff_array.join("")+new Array(l+1).join(zero)}}}return nsign<0?"-"+num:num};const trimDecimals=(n,decimals=18)=>{n+="";if(n.indexOf(".")===-1)return n;const arr=n.split(".");const fraction=arr[1].substr(0,decimals);return arr[0]+"."+fraction};function parseUnits(value,unit){assertArgument(typeof value==="string","value must be a string","value",value);if(value.includes("e")){value=scientificToDecimal(value).toString()}let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index;value=trimDecimals(value,decimals)}else if(unit!=null){decimals=getNumber(unit,"unit");value=trimDecimals(value,decimals)}return FixedNumber.fromString(value,{decimals:decimals}).value}function formatXCB(ore){return formatUnits(ore,18)}function parseXCB(xcb){return parseUnits(xcb,18)}function uuidV4(randomBytes){const bytes=getBytes(randomBytes,"randomBytes");bytes[6]=bytes[6]&15|64;bytes[8]=bytes[8]&63|128;const value=hexlify(bytes);return[value.substring(2,10),value.substring(10,14),value.substring(14,18),value.substring(18,22),value.substring(22,34)].join("-")}var pbkdf2$2={};var hasRequiredPbkdf2;function requirePbkdf2(){if(hasRequiredPbkdf2)return pbkdf2$2;hasRequiredPbkdf2=1;const assert=requireAssert();const crypto=commonjsGlobal.crypto||commonjsGlobal.msCrypto||{};const subtle=crypto.subtle||{};function derive(hash,pass,salt,iter,len){if(typeof pass==="string")pass=bufferExports.Buffer.from(pass,"utf8");if(typeof salt==="string")salt=bufferExports.Buffer.from(salt,"utf8");if(salt==null)salt=bufferExports.Buffer.alloc(0);assert(hash&&typeof hash.id==="string");assert(bufferExports.Buffer.isBuffer(pass));assert(bufferExports.Buffer.isBuffer(salt));assert(iter>>>0===iter);assert(len>>>0===len);const size=hash.size;const blocks=Math.ceil(len/size);const out=bufferExports.Buffer.alloc(blocks*size);const state=bufferExports.Buffer.alloc(salt.length+4);salt.copy(state,0);if(pass.length>hash.blockSize){pass=hash.digest(pass);assert(pass.length<=hash.blockSize)}for(let i=0;i>>24;state[salt.length+1]=round>>>16;state[salt.length+2]=round>>>8;state[salt.length+3]=round;const block=hash.mac(state,pass);let mac=block;for(let j=1;j>>0===iter);assert(len>>>0===len);const name=getHash(hash);if(!subtle.importKey||!subtle.deriveBits||!name)return derive(hash,pass,salt,iter,len);const algo={name:"PBKDF2"};const use=["deriveBits"];const options={name:"PBKDF2",salt:salt,iterations:iter,hash:name};const key=await subtle.importKey("raw",pass,algo,false,use);const out=await subtle.deriveBits(options,key,len*8);return bufferExports.Buffer.from(out)}function getHash(hash){switch(hash.id){case"SHA1":return"SHA-1";case"SHA256":return"SHA-256";case"SHA384":return"SHA-384";case"SHA512":return"SHA-512";default:return null}}pbkdf2$2.native=0;pbkdf2$2.derive=derive;pbkdf2$2.deriveAsync=deriveAsync;return pbkdf2$2}var pbkdf2Browser;var hasRequiredPbkdf2Browser;function requirePbkdf2Browser(){if(hasRequiredPbkdf2Browser)return pbkdf2Browser;hasRequiredPbkdf2Browser=1;pbkdf2Browser=requirePbkdf2();return pbkdf2Browser}var pbkdf2BrowserExports=requirePbkdf2Browser();var pbkdf2$1=getDefaultExportFromCjs(pbkdf2BrowserExports);var sha3;var hasRequiredSha3;function requireSha3(){if(hasRequiredSha3)return sha3;hasRequiredSha3=1;const Keccak=requireKeccak();class SHA3 extends Keccak{constructor(){super()}final(){return super.final(6,null)}static hash(){return new SHA3}static hmac(bits){return super.hmac(bits,6,null)}static digest(data,bits){return super.digest(data,bits,6,null)}static root(left,right,bits){return super.root(left,right,bits,6,null)}static multi(x,y,z,bits){return super.multi(x,y,z,bits,6,null)}static mac(data,key,bits){return super.mac(data,key,bits,6,null)}}SHA3.native=0;SHA3.id="SHA3_256";SHA3.size=32;SHA3.bits=256;SHA3.blockSize=136;SHA3.zero=bufferExports.Buffer.alloc(32,0);SHA3.ctx=new SHA3;sha3=SHA3;return sha3}var sha3Browser;var hasRequiredSha3Browser;function requireSha3Browser(){if(hasRequiredSha3Browser)return sha3Browser;hasRequiredSha3Browser=1;sha3Browser=requireSha3();return sha3Browser}var sha3512;var hasRequiredSha3512;function requireSha3512(){if(hasRequiredSha3512)return sha3512;hasRequiredSha3512=1;const SHA3=requireSha3Browser();class SHA3_512 extends SHA3{constructor(){super()}init(){return super.init(512)}static hash(){return new SHA3_512}static hmac(){return super.hmac(512)}static digest(data){return super.digest(data,512)}static root(left,right){return super.root(left,right,512)}static multi(x,y,z){return super.multi(x,y,z,512)}static mac(data,key){return super.mac(data,key,512)}}SHA3_512.native=SHA3.native;SHA3_512.id="SHA3_512";SHA3_512.size=64;SHA3_512.bits=512;SHA3_512.blockSize=72;SHA3_512.zero=bufferExports.Buffer.alloc(64,0);SHA3_512.ctx=new SHA3_512;sha3512=SHA3_512;return sha3512}var sha3512Exports=requireSha3512();var SHA3_512=getDefaultExportFromCjs(sha3512Exports);class Ed448Goldilock{static _channel=ed448;static generatePrivateKey(){var privateKey=ed448.privateKeyGenerate();privateKey[56]&=127;return privateKey}static getPublicKeyFromPrivateKey(privateKey){var secret=bufferExports.Buffer.from(privateKey,"hex");if(secret[56]>127){var scalar=secret.slice(0,56);scalar[0]&=252;scalar[55]|=128;var publicKey=this._channel.publicKeyFromScalar(scalar);return bufferExports.Buffer.from(publicKey).toString("hex")}else{var publicKey=this._channel.publicKeyCreate(secret);return bufferExports.Buffer.from(publicKey).toString("hex")}}static signWithPrivateKey(privateKey,msg){var msgToSign=bufferExports.Buffer.from(msg,"hex");var secret=bufferExports.Buffer.from(privateKey,"hex");if(secret[56]>127){var prefix=secret.slice(0,57);prefix[0]&=252;prefix[56]=0;prefix[55]|=128;var scalar=prefix.slice(0,56);var signedMessage=this._channel.signWithScalar(msgToSign,scalar,prefix);return bufferExports.Buffer.from(signedMessage).toString("hex")}else{var signedMessage=this._channel.sign(msgToSign,secret);return bufferExports.Buffer.from(signedMessage).toString("hex")}}static signWithPrivateKeyNConcatPubkey(privateKey,msg){var signedMessage=Ed448Goldilock.signWithPrivateKey(privateKey,msg);var publicKey=Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);return signedMessage+publicKey}static verifySignature(msgHash,signedMsg,pubKey){return this._channel.verify(bufferExports.Buffer.from(msgHash,"hex"),bufferExports.Buffer.from(signedMsg,"hex"),bufferExports.Buffer.from(pubKey,"hex"))}static SHA512Hash(password,salt){var p1=bufferExports.Buffer.from(password,"hex");var s1=bufferExports.Buffer.from(salt,"hex");return bufferExports.Buffer.from(pbkdf2$1.derive(SHA3_512,p1,s1,2048,57)).toString("hex")}static concatenateAndHex(prefix,key,index,salt){var ind=bufferExports.Buffer.alloc(4);var p=bufferExports.Buffer.alloc(1);p[0]=prefix%256;var j=index;for(let i=0;i<4;i++){ind[i]=j%256;j=Math.floor(j/256)}var t=p.toString("hex")+key+ind.toString("hex");return Ed448Goldilock.SHA512Hash(t,salt)}static addScalar(a,b){var a1=bufferExports.Buffer.from(a,"hex");var b1=bufferExports.Buffer.from(b.substr(0,106)+"00000000","hex");b1[0]&=252;var c=bufferExports.Buffer.alloc(57);var hold=0;for(let i=0;i<57;i++){hold+=a1[i]+b1[i];c[i]=hold%256;hold=Math.floor(hold/256)}return c.toString("hex")}static seedToExtendedPrivate(seed){var s1=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f72746865636861696e");var s2=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f727468656b6579");var b=bufferExports.Buffer.from(s2,"hex");b[56]|=128;b[55]|=128;b[55]&=191;var s3=b.toString("hex");return s1+s3}static childPrivateToPrivate(s,index){var s0=s.substr(0,114);var s1=s.substr(114,228);var r0,r1;if(index>=2147483648){r0=Ed448Goldilock.concatenateAndHex(1,s1,index,s0);r1=Ed448Goldilock.concatenateAndHex(0,s1,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}else{var pub=Ed448Goldilock.getPublicKeyFromPrivateKey(s1);r0=Ed448Goldilock.concatenateAndHex(3,pub,index,s0);r1=Ed448Goldilock.concatenateAndHex(2,pub,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}}static HDWalletGenerateKeyFromSeed(seed,index){var m=Ed448Goldilock.seedToExtendedPrivate(seed);var k1=Ed448Goldilock.childPrivateToPrivate(m,2147483648+44);var k2=Ed448Goldilock.childPrivateToPrivate(k1,2147483648+654);var k3=Ed448Goldilock.childPrivateToPrivate(k2,2147483648+0);var k4=Ed448Goldilock.childPrivateToPrivate(k3,2147483648+0);var k5=Ed448Goldilock.childPrivateToPrivate(k4,index);return k5.substr(114,228)}}function getGlobal$1(){if(typeof globalThis!=="undefined")return globalThis;if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal$1();const crypto=anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"ripemd160":return ripemd160$1.create();case"sha256":return sha256$2.create();case"sha512":return sha512$1.create();case"sha3-256":return sha3_256.create();case"sha3-512":return sha3_512.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}function createHmac(_algo,key){const algo={sha256:sha256$2,sha512:sha512$1,"sha3-256":sha3_256,"sha3-512":sha3_512}[_algo];assertArgument(algo!=null,"invalid hmac algorithm","algorithm",_algo);return hmac$1.create(algo,key)}function pbkdf2Sync(password,salt,iterations,keylen,_algo){const algo={sha256:sha256$2,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid pbkdf2 algorithm","algorithm",_algo);return pbkdf2$3(algo,password,salt,{c:iterations,dkLen:keylen})}function randomBytes$1(length){assert(crypto!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});assertArgument(Number.isInteger(length)&&length>0&&length<=1024,"invalid length","length",length);const result=new Uint8Array(length);crypto.getRandomValues(result);return result}const _sha256=data=>hexlify(createHash("sha3-256").update(data).digest());const _sha512=data=>hexlify(createHash("sha3-512").update(data).digest());let __sha256=_sha256;let __sha512=_sha512;let locked256=false,locked512=false;var SupportedAlgorithm;(function(SupportedAlgorithm){SupportedAlgorithm["sha256"]="sha256";SupportedAlgorithm["sha512"]="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));function sha256(data){return hexlify(__sha256(getBytes(data)))}function legacySha256(data){const _data=getBytes(data,"data");const hexlified=hexlify(createHash("sha256").update(_data).digest());return hexlified}sha256._=_sha256;sha256.lock=function(){locked256=true};sha256.register=function(func){if(locked256){throw new Error("sha256 is locked")}__sha256=func};Object.freeze(sha256);function sha512(data){return hexlify(__sha512(getBytes(data)))}sha512._=_sha512;sha512.lock=function(){locked512=true};sha512.register=function(func){if(locked512){throw new Error("sha512 is locked")}__sha512=func};Object.freeze(sha512);const logger$3=new Logger("address/0.0.1");const precompiledAddresses=["0000000000000000000000000000000000000000000000000000000000000000","0000000000000000000000000000000000000000000000000000000000000001","0000000000000000000000000000000000000000000000000000000000000002","0000000000000000000000000000000000000000000000000000000000000003","0000000000000000000000000000000000000000000000000000000000000004","0000000000000000000000000000000000000000000000000000000000000005","0000000000000000000000000000000000000000000000000000000000000006","0000000000000000000000000000000000000000000000000000000000000007","0000000000000000000000000000000000000000000000000000000000000008","0000000000000000000000000000000000000000000000000000000000000009"];function removeHexPrefix$1(val){return val.substring(0,2)==="0x"?val.substring(2):val}function calculateCheckSum(_address,_prefix){const address=getBytes("0x"+_address.replace("0x",""));const prefix=getBytes("0x"+_prefix.replace("0x",""));const tmpConcated=new Uint8Array([...address,...prefix]);const hexedConcat=hexlify(tmpConcated).replace("0x","")+"00";const mods=Array.from(hexedConcat.toUpperCase(),c=>{const charCode=c.charCodeAt(0);return charCode>64&&charCode<91?(charCode-55).toString():(charCode-48).toString()}).join("");const bigVal=BigInt(mods);const val97=BigInt(97);const val98=BigInt(98);const remainder=bigVal%val97;const checkSum=val98-remainder;const result=checkSum>9?checkSum.toString():"0"+checkSum.toString();return result}function getAddress(address){if(typeof address!=="string"){logger$3.throwArgumentError("invalid address","address",address)}if(!address.match(/^(0x)?[0-9a-fA-F]{44}$/)){logger$3.throwArgumentError("invalid address","address",address)}const raw=removeHexPrefix$1(address);if(precompiledAddresses.includes(raw)){return"0x"+raw}const prefix=raw.substring(0,2);const val=raw.substring(4);const checksum=calculateCheckSum(val,prefix);if(checksum!==raw.substring(2,4)){logger$3.throwArgumentError("bad address checksum","address",address)}return"0x"+prefix+checksum+val}function networkIdToPrefix(networkId){if(networkId==1){return"cb"}else if(networkId==3||networkId==4){return"ab"}else if(networkId>10||networkId==0){return"ce"}else{logger$3.throwArgumentError("bad networkId","networkId",networkId);return""}}let locked$4=false;const _computeHmac=function(algorithm,key,data){return createHmac(algorithm,key).update(data).digest()};let __computeHmac=_computeHmac;function computeHmac(algorithm,_key,_data){const key=getBytes(_key,"key");const data=getBytes(_data,"data");return hexlify(__computeHmac(algorithm,key,data))}computeHmac._=_computeHmac;computeHmac.lock=function(){locked$4=true};computeHmac.register=function(func){if(locked$4){throw new Error("computeHmac is locked")}__computeHmac=func};Object.freeze(computeHmac);let locked$3=false;const _ripemd160=function(data){return ripemd160$1(data)};let __ripemd160=_ripemd160;function ripemd160(_data){const data=getBytes(_data,"data");return hexlify(__ripemd160(data))}ripemd160._=_ripemd160;ripemd160.lock=function(){locked$3=true};ripemd160.register=function(func){if(locked$3){throw new TypeError("ripemd160 is locked")}__ripemd160=func};Object.freeze(ripemd160);let locked$2=false;const _pbkdf2=function(password,salt,iterations,keylen,algo){return pbkdf2Sync(password,salt,iterations,keylen,algo)};let __pbkdf2=_pbkdf2;function pbkdf2(_password,_salt,iterations,keylen,algo){const password=getBytes(_password,"password");const salt=getBytes(_salt,"salt");return hexlify(__pbkdf2(password,salt,iterations,keylen,algo))}pbkdf2._=_pbkdf2;pbkdf2.lock=function(){locked$2=true};pbkdf2.register=function(func){if(locked$2){throw new Error("pbkdf2 is locked")}__pbkdf2=func};Object.freeze(pbkdf2);let locked$1=false;const _randomBytes=function(length){return new Uint8Array(randomBytes$1(length))};let __randomBytes=_randomBytes;function randomBytes(length){return __randomBytes(length)}randomBytes._=_randomBytes;randomBytes.lock=function(){locked$1=true};randomBytes.register=function(func){if(locked$1){throw new Error("randomBytes is locked")}__randomBytes=func};Object.freeze(randomBytes);function XorAndSalsa(prev,pi,input,ii,out,oi){let y00=prev[pi++]^input[ii++],y01=prev[pi++]^input[ii++];let y02=prev[pi++]^input[ii++],y03=prev[pi++]^input[ii++];let y04=prev[pi++]^input[ii++],y05=prev[pi++]^input[ii++];let y06=prev[pi++]^input[ii++],y07=prev[pi++]^input[ii++];let y08=prev[pi++]^input[ii++],y09=prev[pi++]^input[ii++];let y10=prev[pi++]^input[ii++],y11=prev[pi++]^input[ii++];let y12=prev[pi++]^input[ii++],y13=prev[pi++]^input[ii++];let y14=prev[pi++]^input[ii++],y15=prev[pi++]^input[ii++];let x00=y00,x01=y01,x02=y02,x03=y03,x04=y04,x05=y05,x06=y06,x07=y07,x08=y08,x09=y09,x10=y10,x11=y11,x12=y12,x13=y13,x14=y14,x15=y15;for(let i=0;i<8;i+=2){x04^=rotl(x00+x12|0,7);x08^=rotl(x04+x00|0,9);x12^=rotl(x08+x04|0,13);x00^=rotl(x12+x08|0,18);x09^=rotl(x05+x01|0,7);x13^=rotl(x09+x05|0,9);x01^=rotl(x13+x09|0,13);x05^=rotl(x01+x13|0,18);x14^=rotl(x10+x06|0,7);x02^=rotl(x14+x10|0,9);x06^=rotl(x02+x14|0,13);x10^=rotl(x06+x02|0,18);x03^=rotl(x15+x11|0,7);x07^=rotl(x03+x15|0,9);x11^=rotl(x07+x03|0,13);x15^=rotl(x11+x07|0,18);x01^=rotl(x00+x03|0,7);x02^=rotl(x01+x00|0,9);x03^=rotl(x02+x01|0,13);x00^=rotl(x03+x02|0,18);x06^=rotl(x05+x04|0,7);x07^=rotl(x06+x05|0,9);x04^=rotl(x07+x06|0,13);x05^=rotl(x04+x07|0,18);x11^=rotl(x10+x09|0,7);x08^=rotl(x11+x10|0,9);x09^=rotl(x08+x11|0,13);x10^=rotl(x09+x08|0,18);x12^=rotl(x15+x14|0,7);x13^=rotl(x12+x15|0,9);x14^=rotl(x13+x12|0,13);x15^=rotl(x14+x13|0,18)}out[oi++]=y00+x00|0;out[oi++]=y01+x01|0;out[oi++]=y02+x02|0;out[oi++]=y03+x03|0;out[oi++]=y04+x04|0;out[oi++]=y05+x05|0;out[oi++]=y06+x06|0;out[oi++]=y07+x07|0;out[oi++]=y08+x08|0;out[oi++]=y09+x09|0;out[oi++]=y10+x10|0;out[oi++]=y11+x11|0;out[oi++]=y12+x12|0;out[oi++]=y13+x13|0;out[oi++]=y14+x14|0;out[oi++]=y15+x15|0}function BlockMix(input,ii,out,oi,r){let head=oi+0;let tail=oi+16*r;for(let i=0;i<16;i++)out[tail+i]=input[ii+(2*r-1)*16+i];for(let i=0;i0)tail+=16;XorAndSalsa(out,head,input,ii+=16,out,tail)}}const SCRYPT_DEFAULT_MAXMEM=128*8*(2**20+1+1);function scryptInit(password,salt,_opts){const opts=checkOpts({dkLen:32,asyncTick:10,maxmem:SCRYPT_DEFAULT_MAXMEM},_opts);const{N,r,p,dkLen,asyncTick,maxmem,onProgress}=opts;anumber(N,"N");anumber(r,"r");anumber(p,"p");anumber(dkLen,"dkLen");anumber(asyncTick,"asyncTick");anumber(maxmem,"maxmem");if(onProgress!==undefined&&typeof onProgress!=="function")throw new Error('"onProgress" must be a function');if(r<1)throw new Error('"r" expected integer >= 1');const blockSize=128*r;const blockSize32=blockSize/4;const pow32=Math.pow(2,32);if(N<=1||(N&N-1)!==0||N>pow32)throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32');if(p<1||p>(pow32-1)*32/blockSize)throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)');if(dkLen<1||dkLen>(pow32-1)*32)throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32');const memUsed=blockSize*(N+p+1);if(memUsed>maxmem)throw new Error('"maxmem" limit was hit: memUsed(128*r*(N+p+1))='+memUsed+", maxmem="+maxmem);const B=pbkdf2$3(sha256$2,password,salt,{c:1,dkLen:blockSize*p});const B32=u32(B);const V=u32(new Uint8Array(blockSize*N));const tmp=u32(new Uint8Array(blockSize));let blockMixCb=()=>{};if(onProgress){const totalBlockMix=2*N*p;const callbackPer=Math.max(Math.floor(totalBlockMix/1e4),1);let blockMixCnt=0;blockMixCb=()=>{blockMixCnt++;if(onProgress&&(!(blockMixCnt%callbackPer)||blockMixCnt===totalBlockMix)){try{onProgress(blockMixCnt/totalBlockMix)}catch(e){clean(B,V,tmp);throw e}}}}return{N:N,r:r,p:p,dkLen:dkLen,blockSize32:blockSize32,V:V,B32:B32,B:B,tmp:tmp,blockMixCb:blockMixCb,asyncTick:asyncTick}}function scryptOutput(password,dkLen,B,V,tmp){const res=pbkdf2$3(sha256$2,password,B,{c:1,dkLen:dkLen});clean(B,V,tmp);return res}function scrypt$1(password,salt,opts){const{N,r,p,dkLen,blockSize32,V,B32,B,tmp,blockMixCb}=scryptInit(password,salt,opts);swap32IfBE(B32);for(let pi=0;pi>>0;for(let k=0;kclean(B,V,tmp);swap32IfBE(B32);for(let pi=0;pi{BlockMix(V,pos,V,pos+=blockSize32,r);blockMixCb()},abort);BlockMix(V,(N-1)*blockSize32,B32,Pi,r);blockMixCb();await asyncLoop(N,asyncTick,()=>{const j=(B32[Pi+blockSize32-16]&N-1)>>>0;for(let k=0;k127){const prefix=keyBuffer.slice(0,57);prefix[0]&=252;prefix[55]|=128;prefix[56]=0;const scalar=prefix.slice(0,56);const bufferDigest=bufferExports.Buffer.from(digestBuffer);const bufferPrfx=bufferExports.Buffer.from(prefix);const bufferScalar=bufferExports.Buffer.from(scalar);const sig=ed448.signWithScalar(bufferDigest,bufferScalar,bufferPrfx);const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}const sig=ed448.sign(bufferExports.Buffer.from(digestBuffer),bufferExports.Buffer.from(keyBuffer));const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}computeSharedSecret(other){const pub=bufferExports.Buffer.from(getBytesCopy(other));assertArgument(pub.length===57&&ed448.publicKeyVerify(pub),"invalid public key","other",other);const key=bufferExports.Buffer.from(getBytesCopy(this.#privateKey));if(key[56]>127){const scalar=key.subarray(0,56);scalar[0]&=252;scalar[55]|=128;return hexlify(ed448.deriveWithScalar(pub,scalar))}return hexlify(ed448.derive(pub,key))}static computePublicKey(key,compressed){const bytes=bufferExports.Buffer.from(arrayify(key));if(bytes.length!==57){logger$2.throwArgumentError("invalid private key","key","[REDACTED]")}if(bytes[56]>127){const scalar=bytes.slice(0,56);scalar[0]&=252;scalar[55]|=128;const pub=ed448.publicKeyFromScalar(scalar);return hexlify(pub)}const pub=ed448.publicKeyCreate(bytes);return hexlify(pub)}static recoverPublicKey(digest,signature){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const digestBuffer=bufferExports.Buffer.from(arrayify(digest));const sigBuffer=bufferExports.Buffer.from(arrayify(signature));if(sigBuffer.length!==171){logger$2.throwArgumentError("invalid signature","signature",signature)}const sig=sigBuffer.slice(0,114);const pub=sigBuffer.slice(114);if(ed448.verify(digestBuffer,sig,pub)){return hexlify(pub)}logger$2.throwArgumentError("invalid signature","signature",signature);return""}static addPoints(p0,p1,compressed){const points=[p0,p1].map(point=>{const bytes=bufferExports.Buffer.from(getBytesCopy(point));assertArgument(bytes.length===57&&ed448.publicKeyVerify(bytes),"invalid public key","point",point);return bytes});return hexlify(ed448.publicKeyCombine(points))}}const BN_0$6=BigInt(0);const BN_1$3=BigInt(1);const BN_2$1=BigInt(2);const BN_27=BigInt(27);const BN_28=BigInt(28);const BN_35=BigInt(35);const _guard$4={};class Signature{#r;#s;#v;#networkV;get r(){return this.#r}set r(value){assertArgument(dataLength(value)===32,"invalid r","value",value);this.#r=hexlify(value)}get s(){return this.#s}set s(_value){assertArgument(dataLength(_value)===32,"invalid s","value",_value);const value=hexlify(_value);assertArgument(parseInt(value.substring(0,3))<8,"non-canonical s","value",value);this.#s=value}get v(){return this.#v}set v(value){const v=getNumber(value,"value");assertArgument(v===27||v===28,"invalid v","v",value);this.#v=v}get networkV(){return this.#networkV}get legacynetworkId(){const v=this.networkV;if(v==null){return null}return Signature.getnetworkId(v)}get yParity(){return this.v===27?0:1}get yParityAndS(){const yParityAndS=getBytes(this.s);if(this.yParity){yParityAndS[0]|=128}return hexlify(yParityAndS)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(guard,r,s,v){assertPrivate(guard,_guard$4,"Signature");this.#r=r;this.#s=s;this.#v=v;this.#networkV=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const clone=new Signature(_guard$4,this.r,this.s,this.v);if(this.networkV){clone.#networkV=this.networkV}return clone}toJSON(){const networkV=this.networkV;return{_type:"signature",networkV:networkV!=null?networkV.toString():null,r:this.r,s:this.s,v:this.v}}static getnetworkId(v){const bv=getBigInt(v,"v");if(bv==BN_27||bv==BN_28){return BN_0$6}assertArgument(bv>=BN_35,"invalid EIP-155 v","v",v);return(bv-BN_35)/BN_2$1}static getnetworkIdV(networkId,v){return getBigInt(networkId)*BN_2$1+BigInt(35+v-27)}static getNormalizedV(v){const bv=getBigInt(v);if(bv===BN_0$6||bv===BN_27){return 27}if(bv===BN_1$3||bv===BN_28){return 28}assertArgument(bv>=BN_35,"invalid v","v",v);return bv&BN_1$3?27:28}}function lock(){computeHmac.lock();pbkdf2.lock();randomBytes.lock();ripemd160.lock();scrypt.lock();scryptSync.lock();sha256.lock();sha512.lock();randomBytes.lock()}function removeHexPrefix(val){return val.substring(0,2)==="0x"?val.substring(2):val}function publicToAddress(key,prefix){const val=hexDataSlice(sha256(key),12);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function computeAddress(key,prefix){let pubkey;if(typeof key==="string"){pubkey=SigningKey.computePublicKey(key,false)}else{pubkey=key.publicKey}return publicToAddress(pubkey,prefix)}function recoverAddress(digest,signature,prefix){const publicKey=SigningKey.recoverPublicKey(arrayify(digest),signature);return publicToAddress(publicKey,prefix)}function extractPrefix(address){address=getAddress(address);return address.substring(2,4)}const WordSize=32;const Padding=new Uint8Array(WordSize);const passProperties$1=["then"];const _guard$3={};function throwError(name,error){const wrapped=new Error(`deferred error during ABI decoding triggered accessing ${name}`);wrapped.error=error;throw wrapped}class Result extends Array{#names;constructor(...args){const guard=args[0];let items=args[1];let names=(args[2]||[]).slice();let wrap=true;if(guard!==_guard$3){items=args;names=[];wrap=false}super(items.length);items.forEach((item,index)=>{this[index]=item});const nameCounts=names.reduce((accum,name)=>{if(typeof name==="string"){accum.set(name,(accum.get(name)||0)+1)}return accum},new Map);this.#names=Object.freeze(items.map((item,index)=>{const name=names[index];if(name!=null&&nameCounts.get(name)===1){return name}return null}));if(!wrap){return}Object.freeze(this);return new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="string"){if(prop.match(/^[0-9]+$/)){const index=getNumber(prop,"%index");if(index<0||index>=this.length){throw new RangeError("out of result range")}const item=target[index];if(item instanceof Error){throwError(`index ${index}`,item)}return item}if(passProperties$1.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}const value=target[prop];if(value instanceof Function){return function(...args){return value.apply(this===receiver?target:this,args)}}else if(!(prop in target)){return target.getValue.apply(this===receiver?target:this,[prop])}}return Reflect.get(target,prop,receiver)}})}toArray(){const result=[];this.forEach((item,index)=>{if(item instanceof Error){throwError(`index ${index}`,item)}result.push(item)});return result}toObject(){return this.#names.reduce((accum,name,index)=>{assert(name!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"});if(!(name in accum)){accum[name]=this.getValue(name)}return accum},{})}slice(start,end){if(start==null){start=0}if(start<0){start+=this.length;if(start<0){start=0}}if(end==null){end=this.length}if(end<0){end+=this.length;if(end<0){end=0}}if(end>this.length){end=this.length}const result=[],names=[];for(let i=start;i{this.#data[offset]=getValue$1(value)}}}class Reader{allowLoose;#data;#offset;constructor(data,allowLoose){defineProperties(this,{allowLoose:!!allowLoose});this.#data=getBytesCopy(data);this.#offset=0}get data(){return hexlify(this.#data)}get dataLength(){return this.#data.length}get consumed(){return this.#offset}get bytes(){return new Uint8Array(this.#data)}#peekBytes(offset,length,loose){let alignedLength=Math.ceil(length/WordSize)*WordSize;if(this.#offset+alignedLength>this.#data.length){if(this.allowLoose&&loose&&this.#offset+length<=this.#data.length){alignedLength=length}else{assert(false,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),length:this.#data.length,offset:this.#offset+alignedLength})}}return this.#data.slice(this.#offset,this.#offset+alignedLength)}subReader(offset){return new Reader(this.#data.slice(this.#offset+offset),this.allowLoose)}readBytes(length,loose){let bytes=this.#peekBytes(0,length,!!loose);this.#offset+=bytes.length;return bytes.slice(0,length)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}}const _gaurd={};function n(value,width){let signed=false;if(width<0){signed=true;width*=-1}return new Typed(_gaurd,`${signed?"":"u"}int${width}`,value,{signed:signed,width:width})}function b(value,size){return new Typed(_gaurd,`bytes${size?size:""}`,value,{size:size})}const _typedSymbol=Symbol.for("_corebc_typed");class Typed{type;value;#options;_typedSymbol;constructor(gaurd,type,value,options){if(options==null){options=null}assertPrivate(_gaurd,gaurd,"Typed");defineProperties(this,{_typedSymbol:_typedSymbol,type:type,value:value});this.#options=options;this.format()}format(){if(this.type==="array"){throw new Error("")}else if(this.type==="dynamicArray"){throw new Error("")}else if(this.type==="tuple"){return`tuple(${this.value.map(v=>v.format()).join(",")})`}return this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple"){throw TypeError("not a tuple")}return this.#options}get arrayLength(){if(this.type!=="array"){throw TypeError("not an array")}if(this.#options===true){return-1}if(this.#options===false){return this.value.length}return null}static from(type,value){return new Typed(_gaurd,type,value)}static uint8(v){return n(v,8)}static uint16(v){return n(v,16)}static uint24(v){return n(v,24)}static uint32(v){return n(v,32)}static uint40(v){return n(v,40)}static uint48(v){return n(v,48)}static uint56(v){return n(v,56)}static uint64(v){return n(v,64)}static uint72(v){return n(v,72)}static uint80(v){return n(v,80)}static uint88(v){return n(v,88)}static uint96(v){return n(v,96)}static uint104(v){return n(v,104)}static uint112(v){return n(v,112)}static uint120(v){return n(v,120)}static uint128(v){return n(v,128)}static uint136(v){return n(v,136)}static uint144(v){return n(v,144)}static uint152(v){return n(v,152)}static uint160(v){return n(v,160)}static uint168(v){return n(v,168)}static uint176(v){return n(v,176)}static uint184(v){return n(v,184)}static uint192(v){return n(v,192)}static uint200(v){return n(v,200)}static uint208(v){return n(v,208)}static uint216(v){return n(v,216)}static uint224(v){return n(v,224)}static uint232(v){return n(v,232)}static uint240(v){return n(v,240)}static uint248(v){return n(v,248)}static uint256(v){return n(v,256)}static uint(v){return n(v,256)}static int8(v){return n(v,-8)}static int16(v){return n(v,-16)}static int24(v){return n(v,-24)}static int32(v){return n(v,-32)}static int40(v){return n(v,-40)}static int48(v){return n(v,-48)}static int56(v){return n(v,-56)}static int64(v){return n(v,-64)}static int72(v){return n(v,-72)}static int80(v){return n(v,-80)}static int88(v){return n(v,-88)}static int96(v){return n(v,-96)}static int104(v){return n(v,-104)}static int112(v){return n(v,-112)}static int120(v){return n(v,-120)}static int128(v){return n(v,-128)}static int136(v){return n(v,-136)}static int144(v){return n(v,-144)}static int152(v){return n(v,-152)}static int160(v){return n(v,-160)}static int168(v){return n(v,-168)}static int176(v){return n(v,-176)}static int184(v){return n(v,-184)}static int192(v){return n(v,-192)}static int200(v){return n(v,-200)}static int208(v){return n(v,-208)}static int216(v){return n(v,-216)}static int224(v){return n(v,-224)}static int232(v){return n(v,-232)}static int240(v){return n(v,-240)}static int248(v){return n(v,-248)}static int256(v){return n(v,-256)}static int(v){return n(v,-256)}static bytes1(v){return b(v,1)}static bytes2(v){return b(v,2)}static bytes3(v){return b(v,3)}static bytes4(v){return b(v,4)}static bytes5(v){return b(v,5)}static bytes6(v){return b(v,6)}static bytes7(v){return b(v,7)}static bytes8(v){return b(v,8)}static bytes9(v){return b(v,9)}static bytes10(v){return b(v,10)}static bytes11(v){return b(v,11)}static bytes12(v){return b(v,12)}static bytes13(v){return b(v,13)}static bytes14(v){return b(v,14)}static bytes15(v){return b(v,15)}static bytes16(v){return b(v,16)}static bytes17(v){return b(v,17)}static bytes18(v){return b(v,18)}static bytes19(v){return b(v,19)}static bytes20(v){return b(v,20)}static bytes21(v){return b(v,21)}static bytes22(v){return b(v,22)}static bytes23(v){return b(v,23)}static bytes24(v){return b(v,24)}static bytes25(v){return b(v,25)}static bytes26(v){return b(v,26)}static bytes27(v){return b(v,27)}static bytes28(v){return b(v,28)}static bytes29(v){return b(v,29)}static bytes30(v){return b(v,30)}static bytes31(v){return b(v,31)}static bytes32(v){return b(v,32)}static address(v){return new Typed(_gaurd,"address",v)}static bool(v){return new Typed(_gaurd,"bool",!!v)}static bytes(v){return new Typed(_gaurd,"bytes",v)}static string(v){return new Typed(_gaurd,"string",v)}static array(v,dynamic){throw new Error("not implemented yet")}static tuple(v,name){throw new Error("not implemented yet")}static overrides(v){return new Typed(_gaurd,"overrides",Object.assign({},v))}static isTyped(value){return value&&value._typedSymbol===_typedSymbol}static dereference(value,type){if(Typed.isTyped(value)){if(value.type!==type){throw new Error(`invalid type: expecetd ${type}, got ${value.type}`)}return value.value}return value}}class AddressCoder extends Coder{constructor(localName){super("address","address",localName,false)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(writer,_value){let value=Typed.dereference(_value,"string");try{value=getAddress(value)}catch(error){return this._throwError(error.message,_value)}return writer.writeValue(value)}decode(reader){return getAddress(toBeHex(reader.readValue(),22))}}class AnonymousCoder extends Coder{coder;constructor(coder){super(coder.name,coder.type,"_",coder.dynamic);this.coder=coder}defaultValue(){return this.coder.defaultValue()}encode(writer,value){return this.coder.encode(writer,value)}decode(reader){return this.coder.decode(reader)}}function pack(writer,coders,values){let arrayValues=[];if(Array.isArray(values)){arrayValues=values}else if(values&&typeof values==="object"){let unique={};arrayValues=coders.map(coder=>{const name=coder.localName;assert(name,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});assert(!unique[name],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});unique[name]=true;return values[name]})}else{assertArgument(false,"invalid tuple value","tuple",values)}assertArgument(coders.length===arrayValues.length,"types/value length mismatch","tuple",values);let staticWriter=new Writer;let dynamicWriter=new Writer;let updateFuncs=[];coders.forEach((coder,index)=>{let value=arrayValues[index];if(coder.dynamic){let dynamicOffset=dynamicWriter.length;coder.encode(dynamicWriter,value);let updateFunc=staticWriter.writeUpdatableValue();updateFuncs.push(baseOffset=>{updateFunc(baseOffset+dynamicOffset)})}else{coder.encode(staticWriter,value)}});updateFuncs.forEach(func=>{func(staticWriter.length)});let length=writer.appendWriter(staticWriter);length+=writer.appendWriter(dynamicWriter);return length}function unpack(reader,coders){let values=[];let keys=[];let baseReader=reader.subReader(0);coders.forEach(coder=>{let value=null;if(coder.dynamic){let offset=reader.readIndex();let offsetReader=baseReader.subReader(offset);try{value=coder.decode(offsetReader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}else{try{value=coder.decode(reader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}if(value==undefined){throw new Error("investigate")}values.push(value);keys.push(coder.localName||null)});return Result.fromItems(values,keys)}class ArrayCoder extends Coder{coder;length;constructor(coder,length,localName){const type=coder.type+"["+(length>=0?length:"")+"]";const dynamic=length===-1||coder.dynamic;super("array",type,localName,dynamic);defineProperties(this,{coder:coder,length:length})}defaultValue(){const defaultChild=this.coder.defaultValue();const result=[];for(let i=0;ibounds||value<-(bounds+BN_1$2)){this._throwError("value out-of-bounds",_value)}value=toTwos(value,8*WordSize)}else if(valuemask(maxUintValue,this.size*8)){this._throwError("value out-of-bounds",_value)}return writer.writeValue(value)}decode(reader){let value=mask(reader.readValue(),this.size*8);if(this.signed){value=fromTwos(value,this.size*8)}return value}}class StringCoder extends DynamicBytesCoder{constructor(localName){super("string",localName)}defaultValue(){return""}encode(writer,_value){return super.encode(writer,toUtf8Bytes(Typed.dereference(_value,"string")))}decode(reader){return toUtf8String(super.decode(reader))}}class TupleCoder extends Coder{coders;constructor(coders,localName){let dynamic=false;const types=[];coders.forEach(coder=>{if(coder.dynamic){dynamic=true}types.push(coder.type)});const type="tuple("+types.join(",")+")";super("tuple",type,localName,dynamic);defineProperties(this,{coders:Object.freeze(coders.slice())})}defaultValue(){const values=[];this.coders.forEach(coder=>{values.push(coder.defaultValue())});const uniqueNames=this.coders.reduce((accum,coder)=>{const name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});this.coders.forEach((coder,index)=>{let name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}values[name]=values[index]});return Object.freeze(values)}encode(writer,_value){const value=Typed.dereference(_value,"tuple");return pack(writer,this.coders,value)}decode(reader){return unpack(reader,this.coders)}}function id(value,useKeccak){if(useKeccak){return keccak256(toUtf8Bytes(value))}return sha256(toUtf8Bytes(value))}const ZeroAddress="0x0000000000000000000000000000000000000000";const ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000";const N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const OrePerXCB=BigInt("1000000000000000000");const MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);const MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const CoreSymbol="Ξ";const MessagePrefix="Core Signed Message:\n";function accessSetify(addr,storageKeys){return{address:getAddress(addr),storageKeys:storageKeys.map((storageKey,index)=>{assertArgument(isHexString(storageKey,32),"invalid slot",`storageKeys[${index}]`,storageKey);return storageKey.toLowerCase()})}}function accessListify(value){if(Array.isArray(value)){return value.map((set,index)=>{if(Array.isArray(set)){assertArgument(set.length===2,"invalid slot set",`value[${index}]`,set);return accessSetify(set[0],set[1])}assertArgument(set!=null&&typeof set==="object","invalid address-slot set","value",value);return accessSetify(set.address,set.storageKeys)})}assertArgument(value!=null&&typeof value==="object","invalid access list","value",value);const result=Object.keys(value).map(addr=>{const storageKeys=value[addr].reduce((accum,storageKey)=>{accum[storageKey]=true;return accum},{});return accessSetify(addr,Object.keys(storageKeys).sort())});result.sort((a,b)=>a.address.localeCompare(b.address));return result}const logger$1=new Logger("transaction/0.0.1");const BN_0$4=BigInt(0);function handleAddress(value){if(value==="0x"){return null}return getAddress(value)}function parse(data){const handleNumber=value=>{if(value==="0x"){return BigNumber.from(0)}return BigNumber.from(value)};const transaction=decode$1(data);if(transaction.length!==7&&transaction.length!==8){logger$1.throwArgumentError("invalid raw transaction","data",data)}const isSigned=transaction.length===8;const tx={nonce:Number(handleNumber(transaction[0])),energyPrice:handleNumber(transaction[1]).toBigInt(),energyLimit:handleNumber(transaction[2]).toBigInt(),networkId:handleNumber(transaction[isSigned?3:6]).toBigInt(),to:handleAddress(transaction[isSigned?4:3]),value:handleNumber(transaction[isSigned?5:4]).toBigInt(),data:transaction[isSigned?6:5]};if(transaction.length===8){const prefix=networkIdToPrefix(Number(tx.networkId));const digest=sha256(serialize(tx));tx.hash=sha256(serialize(tx,transaction[7]));tx.from=recoverAddress(digest,transaction[7],prefix);tx.signature=transaction[7]}return tx}const unsignedTransactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"},{name:"networkId",maxLength:32,numeric:true}];const transactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"networkId",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"}];const allowedTransactionKeys={networkId:true,data:true,energyLimit:true,energyPrice:true,nonce:true,to:true,value:true};function serialize(transaction,signature){checkProperties(transaction,allowedTransactionKeys);const raw=[];(!!signature?transactionFields:unsignedTransactionFields).forEach(function({numeric,maxLength,name,length}){let value=transaction[name]||[];const options={};if(numeric){options.hexPad="left"}const tmpHexlified=hexlify(value,options);value=arrayify(tmpHexlified);if(length&&value.length!==length&&value.length>0){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}if(maxLength){value=stripZeros(value);if(value.length>maxLength){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}}const hexlified=hexlify(value);raw.push(hexlified)});if(!!signature){raw.push(hexlify(signature))}const finalValue=encode(raw);return finalValue}class Transaction{#to;#data;#nonce;#energyLimit;#energyPrice;#value;#networkId;#sig;get to(){return this.#to}set to(value){this.#to=value==null?null:getAddress(value)}get nonce(){return this.#nonce}set nonce(value){this.#nonce=getNumber(value,"value")}get energyLimit(){return this.#energyLimit}set energyLimit(value){this.#energyLimit=getBigInt(value)}get energyPrice(){const value=this.#energyPrice;if(value==null){return BN_0$4}return value}set energyPrice(value){this.#energyPrice=value==null?null:getBigInt(value,"energyPrice")}get data(){return this.#data}set data(value){this.#data=hexlify(value)}get value(){return this.#value}set value(value){this.#value=getBigInt(value,"value")}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value)}get signature(){return this.#sig||null}set signature(value){this.#sig=value==null?null:value}constructor(){this.#to=null;this.#nonce=0;this.#energyLimit=BigInt(0);this.#energyPrice=null;this.#data="0x";this.#value=BigInt(0);this.#networkId=BigInt(0);this.#sig=null}get hash(){if(this.signature==null){return null}return sha256(this.serialized)}get unsignedHash(){return sha256(this.unsignedSerialized)}get from(){if(this.signature==null){return null}const prefix=networkIdToPrefix(Number(this.#networkId));return recoverAddress(this.unsignedHash,this.signature,prefix)}get fromPublicKey(){if(this.signature==null){return null}return SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){assert(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});return serialize(this,this.signature)}get unsignedSerialized(){return serialize(this)}clone(){return Transaction.from(this)}toJSON(){const s=v=>{if(v==null){return null}return v.toString()};return{to:this.to,data:this.data,nonce:this.nonce,energyLimit:s(this.energyLimit),energyPrice:s(this.energyPrice),value:s(this.value),networkId:s(this.networkId),sig:this.signature?this.signature:null}}static from(tx){if(tx==null){return new Transaction}if(typeof tx==="string"){const payload=getBytes(tx);return Transaction.from(parse(payload))}const result=new Transaction;if(tx.to!=null){result.to=tx.to}if(tx.nonce!=null){result.nonce=tx.nonce}if(tx.energyLimit!=null){result.energyLimit=tx.energyLimit}if(tx.energyPrice!=null){result.energyPrice=tx.energyPrice}if(tx.data!=null){result.data=tx.data}if(tx.value!=null){result.value=tx.value}if(tx.networkId!=null){result.networkId=tx.networkId}if(tx.signature!=null){result.signature=tx.signature}if(tx.hash!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define hash","tx",tx);assertArgument(result.hash===tx.hash,"hash mismatch","tx",tx)}if(tx.from!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define from","tx",tx);assertArgument(result.from.toLowerCase()===(tx.from||"").toLowerCase(),"from mismatch","tx",tx)}return result}}function hashMessage(message){if(typeof message==="string"){message=toUtf8Bytes(message)}return sha256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(message.length)),message]))}function verifyMessage(message,sig,prefix){const digest=hashMessage(message);return recoverAddress(digest,sig,prefix)}const regexBytes=new RegExp("^bytes([0-9]+)$");const regexNumber=new RegExp("^(u?int)([0-9]*)$");const regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$");function _pack(type,value,isArray){switch(type){case"address":if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(getAddress(value));case"string":return toUtf8Bytes(value);case"bytes":return getBytes(value);case"bool":value=!!value?"0x01":"0x00";if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(value)}let match=type.match(regexNumber);if(match){let signed=match[1]==="int";let size=parseInt(match[2]||"256");assertArgument((!match[2]||match[2]===String(size))&&size%8===0&&size!==0&&size<=256,"invalid number type","type",type);if(isArray){size=256}if(signed){value=toTwos(value,size)}return getBytes(zeroPadValue(toBeArray(value),size/8))}match=type.match(regexBytes);if(match){const size=parseInt(match[1]);assertArgument(String(size)===match[1]&&size!==0&&size<=32,"invalid bytes type","type",type);assertArgument(dataLength(value)===size,`invalid value for ${type}`,"value",value);if(isArray){return getBytes(zeroPadBytes(value,32))}return value}match=type.match(regexArray);if(match&&Array.isArray(value)){const baseType=match[1];const count=parseInt(match[2]||String(value.length));assertArgument(count===value.length,`invalid array length for ${type}`,"value",value);const result=[];value.forEach(function(value){result.push(_pack(baseType,value,true))});return getBytes(concat(result))}assertArgument(false,"invalid type","type",type)}function solidityPacked(types,values){assertArgument(types.length===values.length,"wrong number of values; expected ${ types.length }","values",values);const tight=[];types.forEach(function(type,index){tight.push(_pack(type,values[index]))});return hexlify(concat(tight))}function solidityPackedSha256(types,values){return sha256(solidityPacked(types,values))}const padding=new Uint8Array(32);padding.fill(0);const BN__1=BigInt(-1);const BN_0$3=BigInt(0);const BN_1$1=BigInt(1);const BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(value){const bytes=getBytes(value);const padOffset=bytes.length%32;if(padOffset){return concat([bytes,padding.slice(padOffset)])}return hexlify(bytes)}const hexTrue=toBeHex(BN_1$1,32);const hexFalse=toBeHex(BN_0$3,32);const domainFieldTypes={name:"string",version:"string",networkId:"uint256",verifyingContract:"address",salt:"bytes32"};const domainFieldNames=["name","version","networkId","verifyingContract","salt"];function checkString(key){return function(value){assertArgument(typeof value==="string",`invalid domain value for ${JSON.stringify(key)}`,`domain.${key}`,value);return value}}const domainChecks={name:checkString("name"),version:checkString("version"),networkId:function(_value){const value=getBigInt(_value,"domain.networkId");assertArgument(value>=0,"invalid chain ID","domain.networkId",_value);if(Number.isSafeInteger(value)){return Number(value)}return toQuantity(value)},verifyingContract:function(value){try{return getAddress(value).toLowerCase()}catch(error){}assertArgument(false,`invalid domain value "verifyingContract"`,"domain.verifyingContract",value)},salt:function(value){const bytes=getBytes(value,"domain.salt");assertArgument(bytes.length===32,`invalid domain value "salt"`,"domain.salt",value);return hexlify(bytes)}};function getBaseEncoder(type){{const match=type.match(/^(u?)int(\d*)$/);if(match){const signed=match[1]==="";const width=parseInt(match[2]||"256");assertArgument(width%8===0&&width!==0&&width<=256&&(match[2]==null||match[2]===String(width)),"invalid numeric width","type",type);const boundsUpper=mask(BN_MAX_UINT256,signed?width-1:width);const boundsLower=signed?(boundsUpper+BN_1$1)*BN__1:BN_0$3;return function(_value){const value=getBigInt(_value,"value");assertArgument(value>=boundsLower&&value<=boundsUpper,`value out-of-bounds for ${type}`,"value",value);return toBeHex(signed?toTwos(value,256):value,32)}}}{const match=type.match(/^bytes(\d+)$/);if(match){const width=parseInt(match[1]);assertArgument(width!==0&&width<=32&&match[1]===String(width),"invalid bytes width","type",type);return function(value){const bytes=getBytes(value);assertArgument(bytes.length===width,`invalid length for ${type}`,"value",value);return hexPadRight(value)}}}switch(type){case"address":return function(value){return zeroPadValue(getAddress(value),32)};case"bool":return function(value){return!value?hexFalse:hexTrue};case"bytes":return function(value){return sha256(value)};case"string":return function(value){return id(value)}}return null}function encodeType(name,fields){return`${name}(${fields.map(({name,type})=>type+" "+name).join(",")})`}class TypedDataEncoder{primaryType;#types;get types(){return JSON.parse(this.#types)}#fullTypes;#encoderCache;constructor(types){this.#types=JSON.stringify(types);this.#fullTypes=new Map;this.#encoderCache=new Map;const links=new Map;const parents=new Map;const subtypes=new Map;Object.keys(types).forEach(type=>{links.set(type,new Set);parents.set(type,[]);subtypes.set(type,new Set)});for(const name in types){const uniqueNames=new Set;for(const field of types[name]){assertArgument(!uniqueNames.has(field.name),`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`,"types",types);uniqueNames.add(field.name);const baseType=field.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;assertArgument(baseType!==name,`circular type reference to ${JSON.stringify(baseType)}`,"types",types);const encoder=getBaseEncoder(baseType);if(encoder){continue}assertArgument(parents.has(baseType),`unknown type ${JSON.stringify(baseType)}`,"types",types);parents.get(baseType).push(name);links.get(name).add(baseType)}}const primaryTypes=Array.from(parents.keys()).filter(n=>parents.get(n).length===0);assertArgument(primaryTypes.length!==0,"missing primary type","types",types);assertArgument(primaryTypes.length===1,`ambiguous primary types or unused types: ${primaryTypes.map(t=>JSON.stringify(t)).join(", ")}`,"types",types);defineProperties(this,{primaryType:primaryTypes[0]});function checkCircular(type,found){assertArgument(!found.has(type),`circular type reference to ${JSON.stringify(type)}`,"types",types);found.add(type);for(const child of links.get(type)){if(!parents.has(child)){continue}checkCircular(child,found);for(const subtype of found){subtypes.get(subtype).add(child)}}found.delete(type)}checkCircular(this.primaryType,new Set);for(const[name,set]of subtypes){const st=Array.from(set);st.sort();this.#fullTypes.set(name,encodeType(name,types[name])+st.map(t=>encodeType(t,types[t])).join(""))}}getEncoder(type){let encoder=this.#encoderCache.get(type);if(!encoder){encoder=this.#getEncoder(type);this.#encoderCache.set(type,encoder)}return encoder}#getEncoder(type){{const encoder=getBaseEncoder(type);if(encoder){return encoder}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){const subtype=match[1];const subEncoder=this.getEncoder(subtype);return value=>{assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);let result=value.map(subEncoder);if(this.#fullTypes.has(subtype)){result=result.map(sha256)}return sha256(concat(result))}}const fields=this.types[type];if(fields){const encodedType=id(this.#fullTypes.get(type));return value=>{const values=fields.map(({name,type})=>{const result=this.getEncoder(type)(value[name]);if(this.#fullTypes.has(type)){return sha256(result)}return result});values.unshift(encodedType);return concat(values)}}assertArgument(false,`unknown type: ${type}`,"type",type)}encodeType(name){const result=this.#fullTypes.get(name);assertArgument(result,`unknown type: ${JSON.stringify(name)}`,"name",name);return result}encodeData(type,value){return this.getEncoder(type)(value)}hashStruct(name,value){return sha256(this.encodeData(name,value))}encode(value){return this.encodeData(this.primaryType,value)}hash(value){return this.hashStruct(this.primaryType,value)}_visit(type,value,callback){{const encoder=getBaseEncoder(type);if(encoder){return callback(type,value)}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);return value.map(v=>this._visit(match[1],v,callback))}const fields=this.types[type];if(fields){return fields.reduce((accum,{name,type})=>{accum[name]=this._visit(type,value[name],callback);return accum},{})}assertArgument(false,`unknown type: ${type}`,"type",type)}visit(value,callback){return this._visit(this.primaryType,value,callback)}static from(types){return new TypedDataEncoder(types)}static getPrimaryType(types){return TypedDataEncoder.from(types).primaryType}static hashStruct(name,types,value){return TypedDataEncoder.from(types).hashStruct(name,value)}static hashDomain(domain){const domainFields=[];for(const name in domain){if(domain[name]==null){continue}const type=domainFieldTypes[name];assertArgument(type,`invalid typed-data domain key: ${JSON.stringify(name)}`,"domain",domain);domainFields.push({name:name,type:type})}domainFields.sort((a,b)=>{return domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(b.name)});return TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:domainFields},domain)}static encode(domain,types,value){return concat(["0x1901",TypedDataEncoder.hashDomain(domain),TypedDataEncoder.from(types).hash(value)])}static hash(domain,types,value){return sha256(TypedDataEncoder.encode(domain,types,value))}static async resolveNames(domain,types,value,resolveName){domain=Object.assign({},domain);for(const key in domain){if(domain[key]==null){delete domain[key]}}const ensCache={};if(domain.verifyingContract&&!isHexString(domain.verifyingContract,20)){ensCache[domain.verifyingContract]="0x"}const encoder=TypedDataEncoder.from(types);encoder.visit(value,(type,value)=>{if(type==="address"&&!isHexString(value,20)){ensCache[value]="0x"}return value});for(const name in ensCache){ensCache[name]=await resolveName(name)}if(domain.verifyingContract&&ensCache[domain.verifyingContract]){domain.verifyingContract=ensCache[domain.verifyingContract]}value=encoder.visit(value,(type,value)=>{if(type==="address"&&ensCache[value]){return ensCache[value]}return value});return{domain:domain,value:value}}static getPayload(domain,types,value){TypedDataEncoder.hashDomain(domain);const domainValues={};const domainTypes=[];domainFieldNames.forEach(name=>{const value=domain[name];if(value==null){return}domainValues[name]=domainChecks[name](value);domainTypes.push({name:name,type:domainFieldTypes[name]})});const encoder=TypedDataEncoder.from(types);const typesWithDomain=Object.assign({},types);assertArgument(typesWithDomain.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",types);typesWithDomain.EIP712Domain=domainTypes;encoder.encode(value);return{types:typesWithDomain,domain:domainValues,primaryType:encoder.primaryType,message:encoder.visit(value,(type,value)=>{if(type.match(/^bytes(\d*)/)){return hexlify(getBytes(value))}if(type.match(/^u?int/)){return getBigInt(value).toString()}switch(type){case"address":return value.toLowerCase();case"bool":return!!value;case"string":assertArgument(typeof value==="string","invalid string","value",value);return value}assertArgument(false,"unsupported type","type",type)})}}}function verifyTypedData(domain,types,value,signature,prefix){return recoverAddress(TypedDataEncoder.hash(domain,types,value),signature,prefix)}var _a;function setify(items){const result=new Set;items.forEach(k=>result.add(k));return Object.freeze(result)}const _kwVisib="constant external internal payable private public pure view";const KwVisib=setify(_kwVisib.split(" "));const _kwTypes="constructor error event fallback function receive struct";const KwTypes=setify(_kwTypes.split(" "));const _kwModifiers="calldata memory storage payable indexed";const KwModifiers=setify(_kwModifiers.split(" "));const _kwOther="tuple returns";const _keywords=[_kwTypes,_kwModifiers,_kwOther,_kwVisib].join(" ");const Keywords=setify(_keywords.split(" "));const SimpleTokens={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"};const regexWhitespacePrefix=new RegExp("^(\\s*)");const regexNumberPrefix=new RegExp("^([0-9]+)");const regexIdPrefix=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");const regexId=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");const regexType=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class TokenString{#offset;#tokens;get offset(){return this.#offset}get length(){return this.#tokens.length-this.#offset}constructor(tokens){this.#offset=0;this.#tokens=tokens.slice()}clone(){return new _a(this.#tokens)}reset(){this.#offset=0}#subTokenString(from=0,to=0){return new _a(this.#tokens.slice(from,to).map(t=>{return Object.freeze(Object.assign({},t,{match:t.match-from,linkBack:t.linkBack-from,linkNext:t.linkNext-from}))}))}popKeyword(allowed){const top=this.peek();if(top.type!=="KEYWORD"||!allowed.has(top.text)){throw new Error(`expected keyword ${top.text}`)}return this.pop().text}popType(type){if(this.peek().type!==type){throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`)}return this.pop().text}popParen(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=this.#subTokenString(this.#offset+1,top.match+1);this.#offset=top.match+1;return result}popParams(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=[];while(this.#offset=this.#tokens.length){throw new Error("out-of-bounds")}return this.#tokens[this.#offset]}peekKeyword(allowed){const top=this.peekType("KEYWORD");return top!=null&&allowed.has(top)?top:null}peekType(type){if(this.length===0){return null}const top=this.peek();return top.type===type?top.text:null}pop(){const result=this.peek();this.#offset++;return result}toString(){const tokens=[];for(let i=this.#offset;i`}}_a=TokenString;function lex(text){const tokens=[];const throwError=message=>{const token=offset0&&tokens[tokens.length-1].type==="NUMBER"){const value=tokens.pop().text;suffix=value+suffix;tokens[tokens.length-1].value=getNumber(value)}if(tokens.length===0||tokens[tokens.length-1].type!=="BRACKET"){throw new Error("missing opening bracket")}tokens[tokens.length-1].text+=suffix}continue}match=cur.match(regexIdPrefix);if(match){token.text=match[1];offset+=token.text.length;if(Keywords.has(token.text)){token.type="KEYWORD";continue}if(token.text.match(regexType)){token.type="TYPE";continue}token.type="ID";continue}match=cur.match(regexNumberPrefix);if(match){token.text=match[1];token.type="NUMBER";offset+=token.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`)}return new TokenString(tokens.map(t=>Object.freeze(t)))}function allowSingle(set,allowed){let included=[];for(const key in allowed.keys()){if(set.has(key)){included.push(key)}}if(included.length>1){throw new Error(`conflicting types: ${included.join(", ")}`)}}function consumeName(type,tokens){if(tokens.peekKeyword(KwTypes)){const keyword=tokens.pop().text;if(keyword!==type){throw new Error(`expected ${type}, got ${keyword}`)}}return tokens.popType("ID")}function consumeKeywords(tokens,allowed){const keywords=new Set;while(true){const keyword=tokens.peekType("KEYWORD");if(keyword==null||allowed&&!allowed.has(keyword)){break}tokens.pop();if(keywords.has(keyword)){throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`)}keywords.add(keyword)}return Object.freeze(keywords)}function consumeMutability(tokens){let modifiers=consumeKeywords(tokens,KwVisib);allowSingle(modifiers,setify("constant payable nonpayable".split(" ")));allowSingle(modifiers,setify("pure view payable nonpayable".split(" ")));if(modifiers.has("view")){return"view"}if(modifiers.has("pure")){return"pure"}if(modifiers.has("payable")){return"payable"}if(modifiers.has("nonpayable")){return"nonpayable"}if(modifiers.has("constant")){return"view"}return"nonpayable"}function consumeParams(tokens,allowIndexed){return tokens.popParams().map(t=>ParamType.from(t,allowIndexed))}function consumeEnergy(tokens){if(tokens.peekType("AT")){tokens.pop();if(tokens.peekType("NUMBER")){return getBigInt(tokens.pop().text)}throw new Error("invalid energy")}return null}function consumeEoi(tokens){if(tokens.length){throw new Error(`unexpected tokens: ${tokens.toString()}`)}}const regexArrayType=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(type){const match=type.match(regexType);assertArgument(match,"invalid type","type",type);if(type==="uint"){return"uint256"}if(type==="int"){return"int256"}if(match[2]){const length=parseInt(match[2]);assertArgument(length!==0&&length<=32,"invalid bytes length","type",type)}else if(match[3]){const size=parseInt(match[3]);assertArgument(size!==0&&size<=256&&size%8===0,"invalid numeric width","type",type)}return type}const _guard$2={};const internal$1=Symbol.for("_corebc_internal");const ParamTypeInternal="_ParamTypeInternal";const ErrorFragmentInternal="_ErrorInternal";const EventFragmentInternal="_EventInternal";const ConstructorFragmentInternal="_ConstructorInternal";const FallbackFragmentInternal="_FallbackInternal";const FunctionFragmentInternal="_FunctionInternal";const StructFragmentInternal="_StructInternal";class ParamType{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(guard,name,type,baseType,indexed,components,arrayLength,arrayChildren){assertPrivate(guard,_guard$2,"ParamType");Object.defineProperty(this,internal$1,{value:ParamTypeInternal});if(components){components=Object.freeze(components.slice())}if(baseType==="array"){if(arrayLength==null||arrayChildren==null){throw new Error("")}}else if(arrayLength!=null||arrayChildren!=null){throw new Error("")}if(baseType==="tuple"){if(components==null){throw new Error("")}}else if(components!=null){throw new Error("")}defineProperties(this,{name:name,type:type,baseType:baseType,indexed:indexed,components:components,arrayLength:arrayLength,arrayChildren:arrayChildren})}format(format){if(format==null){format="sighash"}if(format==="json"){let result={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||undefined};if(typeof this.indexed==="boolean"){result.indexed=this.indexed}if(this.isTuple()){result.components=this.components.map(c=>JSON.parse(c.format(format)))}return JSON.stringify(result)}let result="";if(this.isArray()){result+=this.arrayChildren.format(format);result+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`}else{if(this.isTuple()){if(format!=="sighash"){result+=this.type}result+="("+this.components.map(comp=>comp.format(format)).join(format==="full"?", ":",")+")"}else{result+=this.type}}if(format!=="sighash"){if(this.indexed===true){result+=" indexed"}if(format==="full"&&this.name){result+=" "+this.name}}return result}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(value,process){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const _this=this;return value.map(v=>_this.arrayChildren.walk(v,process))}if(this.isTuple()){if(!Array.isArray(value)){throw new Error("invalid tuple value")}if(value.length!==this.components.length){throw new Error("array is wrong length")}const _this=this;return value.map((v,i)=>_this.components[i].walk(v,process))}return process(this.type,value)}#walkAsync(promises,value,process,setValue){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const childType=this.arrayChildren;const result=value.slice();result.forEach((value,index)=>{childType.#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}if(this.isTuple()){const components=this.components;let result;if(Array.isArray(value)){result=value.slice()}else{if(value==null||typeof value!=="object"){throw new Error("invalid tuple value")}result=components.map(param=>{if(!param.name){throw new Error("cannot use object value with unnamed components")}if(!(param.name in value)){throw new Error(`missing value for component ${param.name}`)}return value[param.name]})}if(result.length!==this.components.length){throw new Error("array is wrong length")}result.forEach((value,index)=>{components[index].#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}const result=process(this.type,value);if(result.then){promises.push(async function(){setValue(await result)}())}else{setValue(result)}}async walkAsync(value,process){const promises=[];const result=[value];this.#walkAsync(promises,value,process,value=>{result[0]=value});if(promises.length){await Promise.all(promises)}return result[0]}static from(obj,allowIndexed){if(ParamType.isParamType(obj)){return obj}if(typeof obj==="string"){return ParamType.from(lex(obj),allowIndexed)}else if(obj instanceof TokenString){let type="",baseType="";let comps=null;if(consumeKeywords(obj,setify(["tuple"])).has("tuple")||obj.peekType("OPEN_PAREN")){baseType="tuple";comps=obj.popParams().map(t=>ParamType.from(t));type=`tuple(${comps.map(c=>c.format()).join(",")})`}else{type=verifyBasicType(obj.popType("TYPE"));baseType=type}let arrayChildren=null;let arrayLength=null;while(obj.length&&obj.peekType("BRACKET")){const bracket=obj.pop();arrayChildren=new ParamType(_guard$2,"",type,baseType,null,comps,arrayLength,arrayChildren);arrayLength=bracket.value;type+=bracket.text;baseType="array";comps=null}let indexed=null;const keywords=consumeKeywords(obj,KwModifiers);if(keywords.has("indexed")){if(!allowIndexed){throw new Error("")}indexed=true}const name=obj.peekType("ID")?obj.pop().text:"";if(obj.length){throw new Error("leftover tokens")}return new ParamType(_guard$2,name,type,baseType,indexed,comps,arrayLength,arrayChildren)}const name=obj.name;assertArgument(!name||typeof name==="string"&&name.match(regexId),"invalid name","obj.name",name);let indexed=obj.indexed;if(indexed!=null){assertArgument(allowIndexed,"parameter cannot be indexed","obj.indexed",obj.indexed);indexed=!!indexed}let type=obj.type;let arrayMatch=type.match(regexArrayType);if(arrayMatch){const arrayLength=parseInt(arrayMatch[2]||"-1");const arrayChildren=ParamType.from({type:arrayMatch[1],components:obj.components});return new ParamType(_guard$2,name||"",type,"array",indexed,null,arrayLength,arrayChildren)}if(type==="tuple"||type.startsWith("tuple(")||type.startsWith("(")){const comps=obj.components!=null?obj.components.map(c=>ParamType.from(c)):null;const tuple=new ParamType(_guard$2,name||"",type,"tuple",indexed,comps,null,null);return tuple}type=verifyBasicType(obj.type);return new ParamType(_guard$2,name||"",type,type,indexed,null,null,null)}static isParamType(value){return value&&value[internal$1]===ParamTypeInternal}}class Fragment{type;inputs;constructor(guard,type,inputs){assertPrivate(guard,_guard$2,"Fragment");inputs=Object.freeze(inputs.slice());defineProperties(this,{type:type,inputs:inputs})}static from(obj){if(typeof obj==="string"){try{Fragment.from(JSON.parse(obj))}catch(e){}return Fragment.from(lex(obj))}if(obj instanceof TokenString){const type=obj.peekKeyword(KwTypes);switch(type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}}else if(typeof obj==="object"){switch(obj.type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}assert(false,`unsupported type: ${obj.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(false,"unsupported frgament object","obj",obj)}static isConstructor(value){return ConstructorFragment.isFragment(value)}static isError(value){return ErrorFragment.isFragment(value)}static isEvent(value){return EventFragment.isFragment(value)}static isFunction(value){return FunctionFragment.isFragment(value)}static isStruct(value){return StructFragment.isFragment(value)}}class NamedFragment extends Fragment{name;constructor(guard,type,name,inputs){super(guard,type,inputs);assertArgument(typeof name==="string"&&name.match(regexId),"invalid identifier","name",name);inputs=Object.freeze(inputs.slice());defineProperties(this,{name:name})}}function joinParams(format,params){return"("+params.map(p=>p.format(format)).join(format==="full"?", ":",")+")"}class ErrorFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"error",name,inputs);Object.defineProperty(this,internal$1,{value:ErrorFragmentInternal})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(format)))})}const result=[];if(format!=="sighash"){result.push("error")}result.push(this.name+joinParams(format,this.inputs));return result.join(" ")}static from(obj){if(ErrorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ErrorFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("error",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new ErrorFragment(_guard$2,name,inputs)}return new ErrorFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===ErrorFragmentInternal}}class EventFragment extends NamedFragment{anonymous;constructor(guard,name,inputs,anonymous){super(guard,"event",name,inputs);Object.defineProperty(this,internal$1,{value:EventFragmentInternal});defineProperties(this,{anonymous:anonymous})}get topicHash(){return id(this.format("sighash"))}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[];if(format!=="sighash"){result.push("event")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"&&this.anonymous){result.push("anonymous")}return result.join(" ")}static getTopicHash(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new EventFragment(_guard$2,name,params,false);return fragment.topicHash}static from(obj){if(EventFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return EventFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("event",obj);const inputs=consumeParams(obj,true);const anonymous=!!consumeKeywords(obj,setify(["anonymous"])).has("anonymous");consumeEoi(obj);return new EventFragment(_guard$2,name,inputs,anonymous)}return new EventFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(p=>ParamType.from(p,true)):[],!!obj.anonymous)}static isFragment(value){return value&&value[internal$1]===EventFragmentInternal}}class ConstructorFragment extends Fragment{payable;energy;constructor(guard,type,inputs,payable,energy){super(guard,type,inputs);Object.defineProperty(this,internal$1,{value:ConstructorFragmentInternal});defineProperties(this,{payable:payable,energy:energy})}format(format){assert(format!=null&&format!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"});if(format==="json"){return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[`constructor${joinParams(format,this.inputs)}`];result.push(this.payable?"payable":"nonpayable");if(this.energy!=null){result.push(`@${this.energy.toString()}`)}return result.join(" ")}static from(obj){if(ConstructorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ConstructorFragment.from(lex(obj))}else if(obj instanceof TokenString){consumeKeywords(obj,setify(["constructor"]));const inputs=consumeParams(obj);const payable=!!consumeKeywords(obj,setify(["payable"])).has("payable");const energy=consumeEnergy(obj);consumeEoi(obj);return new ConstructorFragment(_guard$2,"constructor",inputs,payable,energy)}return new ConstructorFragment(_guard$2,"constructor",obj.inputs?obj.inputs.map(ParamType.from):[],!!obj.payable,obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===ConstructorFragmentInternal}}class FallbackFragment extends Fragment{payable;constructor(guard,inputs,payable){super(guard,"fallback",inputs);Object.defineProperty(this,internal$1,{value:FallbackFragmentInternal});defineProperties(this,{payable:payable})}format(format){const type=this.inputs.length===0?"receive":"fallback";if(format==="json"){const stateMutability=this.payable?"payable":"nonpayable";return JSON.stringify({type:type,stateMutability:stateMutability})}return`${type}()${this.payable?" payable":""}`}static from(obj){if(FallbackFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FallbackFragment.from(lex(obj))}else if(obj instanceof TokenString){const errorObj=obj.toString();const topIsValid=obj.peekKeyword(setify(["fallback","receive"]));assertArgument(topIsValid,"type must be fallback or receive","obj",errorObj);const type=obj.popKeyword(setify(["fallback","receive"]));if(type==="receive"){const inputs=consumeParams(obj);assertArgument(inputs.length===0,`receive cannot have arguments`,"obj.inputs",inputs);consumeKeywords(obj,setify(["payable"]));consumeEoi(obj);return new FallbackFragment(_guard$2,[],true)}let inputs=consumeParams(obj);if(inputs.length){assertArgument(inputs.length===1&&inputs[0].type==="bytes","invalid fallback inputs","obj.inputs",inputs.map(i=>i.format("minimal")).join(", "))}else{inputs=[ParamType.from("bytes")]}const mutability=consumeMutability(obj);assertArgument(mutability==="nonpayable"||mutability==="payable","fallback cannot be constants","obj.stateMutability",mutability);if(consumeKeywords(obj,setify(["returns"])).has("returns")){const outputs=consumeParams(obj);assertArgument(outputs.length===1&&outputs[0].type==="bytes","invalid fallback outputs","obj.outputs",outputs.map(i=>i.format("minimal")).join(", "))}consumeEoi(obj);return new FallbackFragment(_guard$2,inputs,mutability==="payable")}if(obj.type==="receive"){return new FallbackFragment(_guard$2,[],true)}if(obj.type==="fallback"){const inputs=[ParamType.from("bytes")];const payable=obj.stateMutability==="payable";return new FallbackFragment(_guard$2,inputs,payable)}assertArgument(false,"invalid fallback description","obj",obj)}static isFragment(value){return value&&value[internal$1]===FallbackFragmentInternal}}class FunctionFragment extends NamedFragment{constant;outputs;stateMutability;payable;energy;constructor(guard,name,stateMutability,inputs,outputs,energy){super(guard,"function",name,inputs);Object.defineProperty(this,internal$1,{value:FunctionFragmentInternal});outputs=Object.freeze(outputs.slice());const constant=stateMutability==="view"||stateMutability==="pure";const payable=stateMutability==="payable";defineProperties(this,{constant:constant,energy:energy,outputs:outputs,payable:payable,stateMutability:stateMutability})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format))),outputs:this.outputs.map(o=>JSON.parse(o.format(format)))})}const result=[];if(format!=="sighash"){result.push("function")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"){if(this.stateMutability!=="nonpayable"){result.push(this.stateMutability)}if(this.outputs&&this.outputs.length){result.push("returns");result.push(joinParams(format,this.outputs))}if(this.energy!=null){result.push(`@${this.energy.toString()}`)}}return result.join(" ")}static getSelector(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new FunctionFragment(_guard$2,name,"view",params,[],null);return fragment.selector}static from(obj){if(FunctionFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FunctionFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("function",obj);const inputs=consumeParams(obj);const mutability=consumeMutability(obj);let outputs=[];if(consumeKeywords(obj,setify(["returns"])).has("returns")){outputs=consumeParams(obj)}const energy=consumeEnergy(obj);consumeEoi(obj);return new FunctionFragment(_guard$2,name,mutability,inputs,outputs,energy)}let stateMutability=obj.stateMutability;if(stateMutability==null){stateMutability="payable";if(typeof obj.constant==="boolean"){stateMutability="view";if(!obj.constant){stateMutability="payable";if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}}else if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}return new FunctionFragment(_guard$2,obj.name,stateMutability,obj.inputs?obj.inputs.map(ParamType.from):[],obj.outputs?obj.outputs.map(ParamType.from):[],obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===FunctionFragmentInternal}}class StructFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"struct",name,inputs);Object.defineProperty(this,internal$1,{value:StructFragmentInternal})}format(){throw new Error("@TODO")}static from(obj){if(typeof obj==="string"){return StructFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("struct",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new StructFragment(_guard$2,name,inputs)}return new StructFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===StructFragmentInternal}}const PanicReasons$1=new Map;PanicReasons$1.set(0,"GENERIC_PANIC");PanicReasons$1.set(1,"ASSERT_FALSE");PanicReasons$1.set(17,"OVERFLOW");PanicReasons$1.set(18,"DIVIDE_BY_ZERO");PanicReasons$1.set(33,"ENUM_RANGE_ERROR");PanicReasons$1.set(34,"BAD_STORAGE_DATA");PanicReasons$1.set(49,"STACK_UNDERFLOW");PanicReasons$1.set(50,"ARRAY_RANGE_ERROR");PanicReasons$1.set(65,"OUT_OF_MEMORY");PanicReasons$1.set(81,"UNINITIALIZED_FUNCTION_CALL");const paramTypeBytes=new RegExp(/^bytes([0-9]*)$/);const paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);let defaultCoder=null;function getBuiltinCallException(action,tx,data,abiCoder){let message="missing revert data";let reason=null;const invocation=null;let revert=null;if(data){message="execution reverted";const bytes=getBytes(data);data=hexlify(data);if(bytes.length===0){message+=" (no data present; likely require(false) occurred";reason="require(false)"}else if(bytes.length%32!==4){message+=" (could not decode reason; invalid data length)"}else if(hexlify(bytes.slice(0,4))==="0x08c379a0"){try{reason=abiCoder.decode(["string"],bytes.slice(4))[0];revert={signature:"Error(string)",name:"Error",args:[reason]};message+=`: ${JSON.stringify(reason)}`}catch(error){message+=" (could not decode reason; invalid string data)"}}else if(hexlify(bytes.slice(0,4))==="0x4e487b71"){try{const code=Number(abiCoder.decode(["uint256"],bytes.slice(4))[0]);revert={signature:"Panic(uint256)",name:"Panic",args:[code]};reason=`Panic due to ${PanicReasons$1.get(code)||"UNKNOWN"}(${code})`;message+=`: ${reason}`}catch(error){message+=" (could not decode panic code)"}}else{message+=" (unknown custom error)"}}const transaction={to:tx.to?getAddress(tx.to):null,data:tx.data||"0x"};if(tx.from){transaction.from=getAddress(tx.from)}return makeError(message,"CALL_EXCEPTION",{action:action,data:data,reason:reason,transaction:transaction,invocation:invocation,revert:revert})}class AbiCoder{#getCoder(param){if(param.isArray()){return new ArrayCoder(this.#getCoder(param.arrayChildren),param.arrayLength,param.name)}if(param.isTuple()){return new TupleCoder(param.components.map(c=>this.#getCoder(c)),param.name)}switch(param.baseType){case"address":return new AddressCoder(param.name);case"bool":return new BooleanCoder(param.name);case"string":return new StringCoder(param.name);case"bytes":return new BytesCoder(param.name);case"":return new NullCoder(param.name)}let match=param.type.match(paramTypeNumber);if(match){let size=parseInt(match[2]||"256");assertArgument(size!==0&&size<=256&&size%8===0,"invalid "+match[1]+" bit length","param",param);return new NumberCoder(size/8,match[1]==="int",param.name)}match=param.type.match(paramTypeBytes);if(match){let size=parseInt(match[1]);assertArgument(size!==0&&size<=32,"invalid bytes length","param",param);return new FixedBytesCoder(size,param.name)}assertArgument(false,"invalid type","type",param.type)}getDefaultValue(types){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.defaultValue()}encode(types,values){assertArgumentCount(values.length,types.length,"types/values length mismatch");const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");const writer=new Writer;coder.encode(writer,values);return writer.data}decode(types,data,loose){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.decode(new Reader(data,loose))}static defaultAbiCoder(){if(defaultCoder==null){defaultCoder=new AbiCoder}return defaultCoder}static getBuiltinCallException(action,tx,data){return getBuiltinCallException(action,tx,data,AbiCoder.defaultAbiCoder())}}function encodeBytes32String(text){const bytes=toUtf8Bytes(text);if(bytes.length>31){throw new Error("bytes32 string must be less than 32 bytes")}return zeroPadBytes(bytes,32)}function decodeBytes32String(_bytes){const data=getBytes(_bytes,"bytes");if(data.length!==32){throw new Error("invalid bytes32 - not 32 bytes long")}if(data[31]!==0){throw new Error("invalid bytes32 string - no null terminator")}let length=31;while(data[length-1]===0){length--}return toUtf8String(data.slice(0,length))}class LogDescription{fragment;name;signature;topic;args;constructor(fragment,topic,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,signature:signature,topic:topic,args:args})}}class TransactionDescription{fragment;name;args;signature;selector;value;constructor(fragment,selector,args,value){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector,value:value})}}class ErrorDescription{fragment;name;args;signature;selector;constructor(fragment,selector,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector})}}class Indexed{hash;_isIndexed;static isIndexed(value){return!!(value&&value._isIndexed)}constructor(hash){defineProperties(this,{hash:hash,_isIndexed:true})}}const PanicReasons={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"};const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:message=>{return`reverted with reason string ${JSON.stringify(message)}`}},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:code=>{let reason="unknown panic code";if(code>=0&&code<=255&&PanicReasons[code.toString()]){reason=PanicReasons[code.toString()]}return`reverted with panic code 0x${code.toString(16)} (${reason})`}}};class Interface{fragments;deploy;fallback;receive;#errors;#events;#functions;#abiCoder;constructor(fragments){let abi=[];if(typeof fragments==="string"){abi=JSON.parse(fragments)}else{abi=fragments}this.#functions=new Map;this.#errors=new Map;this.#events=new Map;const frags=[];for(const a of abi){try{frags.push(Fragment.from(a))}catch(error){console.log("EE",error)}}defineProperties(this,{fragments:Object.freeze(frags)});let fallback=null;let receive=false;this.#abiCoder=this.getAbiCoder();this.fragments.forEach((fragment,index)=>{let bucket;switch(fragment.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}defineProperties(this,{deploy:fragment});return;case"fallback":if(fragment.inputs.length===0){receive=true}else{assertArgument(!fallback||fragment.payable!==fallback.payable,"conflicting fallback fragments",`fragments[${index}]`,fragment);fallback=fragment;receive=fallback.payable}return;case"function":bucket=this.#functions;break;case"event":bucket=this.#events;break;case"error":bucket=this.#errors;break;default:return}const signature=fragment.format();if(bucket.has(signature)){return}bucket.set(signature,fragment)});if(!this.deploy){defineProperties(this,{deploy:ConstructorFragment.from("constructor()")})}defineProperties(this,{fallback:fallback,receive:receive})}format(minimal){const format=minimal?"minimal":"full";const abi=this.fragments.map(f=>f.format(format));return abi}formatJson(){const abi=this.fragments.map(f=>f.format("json"));return JSON.stringify(abi.map(j=>JSON.parse(j)))}getAbiCoder(){return AbiCoder.defaultAbiCoder()}#getFunction(key,values,forceUnique){if(isHexString(key)){const selector=key.toLowerCase();for(const fragment of this.#functions.values()){if(selector===fragment.selector){return fragment}}return null}if(key.indexOf("(")===-1){const matching=[];for(const[name,fragment]of this.#functions){if(name.split("(")[0]===key){matching.push(fragment)}}if(values){const lastValue=values.length>0?values[values.length-1]:null;let valueLength=values.length;let allowOptions=true;if(Typed.isTyped(lastValue)&&lastValue.type==="overrides"){allowOptions=false;valueLength--}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs.length;if(inputs!==valueLength&&(!allowOptions||inputs!==valueLength-1)){matching.splice(i,1)}}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs;for(let j=0;j=inputs.length){if(values[j].type==="overrides"){continue}matching.splice(i,1);break}if(values[j].type!==inputs[j].baseType){matching.splice(i,1);break}}}}if(matching.length===1&&values&&values.length!==matching[0].inputs.length){const lastArg=values[values.length-1];if(lastArg==null||Array.isArray(lastArg)||typeof lastArg!=="object"){matching.splice(0,1)}}if(matching.length===0){return null}if(matching.length>1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous function description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#functions.get(FunctionFragment.from(key).format());if(result){return result}return null}getFunctionName(key){const fragment=this.#getFunction(key,null,false);assertArgument(fragment,"no matching function","key",key);return fragment.name}hasFunction(key){return!!this.#getFunction(key,null,false)}getFunction(key,values){return this.#getFunction(key,values||null,true)}forEachFunction(callback){const names=Array.from(this.#functions.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i=0;i--){if(matching[i].inputs.length=0;i--){const inputs=matching[i].inputs;for(let j=0;j1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous event description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#events.get(EventFragment.from(key).format());if(result){return result}return null}getEventName(key){const fragment=this.#getEvent(key,null,false);assertArgument(fragment,"no matching event","key",key);return fragment.name}hasEvent(key){return!!this.#getEvent(key,null,false)}getEvent(key,values){return this.#getEvent(key,values||null,true)}forEachEvent(callback){const names=Array.from(this.#events.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i1){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous error description (i.e. ${matchStr})`,"name",key)}return matching[0]}key=ErrorFragment.from(key).format();if(key==="Error(string)"){return ErrorFragment.from("error Error(string)")}if(key==="Panic(uint256)"){return ErrorFragment.from("error Panic(uint256)")}const result=this.#errors.get(key);if(result){return result}return null}forEachError(callback){const names=Array.from(this.#errors.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i{if(param.type==="string"){return id(value)}else if(param.type==="bytes"){return sha256(hexlify(value))}if(param.type==="bool"&&typeof value==="boolean"){value=value?"0x01":"0x00"}if(param.type.match(/^u?int/)){value=toBeHex(value)}if(param.type==="address"){this.#abiCoder.encode(["address"],[value])}return zeroPadValue(hexlify(value),32)};values.forEach((value,index)=>{const param=fragment.inputs[index];if(!param.indexed){assertArgument(value==null,"cannot filter non-indexed parameters; must be null","contract."+param.name,value);return}if(value==null){topics.push(null)}else if(param.baseType==="array"||param.baseType==="tuple"){assertArgument(false,"filtering with tuples or arrays not supported","contract."+param.name,value)}else if(Array.isArray(value)){topics.push(value.map(value=>encodeTopic(param,value)))}else{topics.push(encodeTopic(param,value))}});while(topics.length&&topics[topics.length-1]===null){topics.pop()}return topics}encodeEventLog(fragment,values){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}const topics=[];const dataTypes=[];const dataValues=[];if(!fragment.anonymous){topics.push(fragment.topicHash)}assertArgument(values.length===fragment.inputs.length,"event arguments/values mismatch","values",values);fragment.inputs.forEach((param,index)=>{const value=values[index];if(param.indexed){if(param.type==="string"){topics.push(id(value))}else if(param.type==="bytes"){topics.push(sha256(value))}else if(param.baseType==="tuple"||param.baseType==="array"){throw new Error("not implemented")}else{topics.push(this.#abiCoder.encode([param.type],[value]))}}else{dataTypes.push(param);dataValues.push(value)}});return{data:this.#abiCoder.encode(dataTypes,dataValues),topics:topics}}decodeEventLog(fragment,data,topics){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}if(topics!=null&&!fragment.anonymous){const eventTopic=fragment.topicHash;assertArgument(isHexString(topics[0],32)&&topics[0].toLowerCase()===eventTopic,"fragment/topic mismatch","topics[0]",topics[0]);topics=topics.slice(1)}const indexed=[];const nonIndexed=[];const dynamic=[];fragment.inputs.forEach((param,index)=>{if(param.indexed){if(param.type==="string"||param.type==="bytes"||param.baseType==="tuple"||param.baseType==="array"){indexed.push(ParamType.from({type:"bytes32",name:param.name}));dynamic.push(true)}else{indexed.push(param);dynamic.push(false)}}else{nonIndexed.push(param);dynamic.push(false)}});const resultIndexed=topics!=null?this.#abiCoder.decode(indexed,concat(topics)):null;const resultNonIndexed=this.#abiCoder.decode(nonIndexed,data,true);const values=[];const keys=[];let nonIndexedIndex=0,indexedIndex=0;fragment.inputs.forEach((param,index)=>{let value=null;if(param.indexed){if(resultIndexed==null){value=new Indexed(null)}else if(dynamic[index]){value=new Indexed(resultIndexed[indexedIndex++])}else{try{value=resultIndexed[indexedIndex++]}catch(error){value=error}}}else{try{value=resultNonIndexed[nonIndexedIndex++]}catch(error){value=error}}values.push(value);keys.push(param.name||null)});return Result.fromItems(values,keys)}parseTransaction(tx){const data=getBytes(tx.data,"tx.data");const value=getBigInt(tx.value!=null?tx.value:0,"tx.value");const fragment=this.getFunction(hexlify(data.slice(0,4)));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,data.slice(4));return new TransactionDescription(fragment,fragment.selector,args,value)}parseCallResult(data){throw new Error("@TODO")}parseLog(log){const fragment=this.getEvent(log.topics[0]);if(!fragment||fragment.anonymous){return null}return new LogDescription(fragment,fragment.topicHash,this.decodeEventLog(fragment,log.data,log.topics))}parseError(data){const hexData=hexlify(data);const fragment=this.getError(dataSlice(hexData,0,4));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,dataSlice(hexData,4));return new ErrorDescription(fragment,fragment.selector,args)}static from(value){if(value instanceof Interface){return value}if(typeof value==="string"){return new Interface(JSON.parse(value))}if(typeof value.format==="function"){return new Interface(value.format("json"))}return new Interface(value)}}const logger=new Logger("contract-address/0.0.1");function getCreateAddress(tx){const from=getAddress(tx.from);const nonce=getBigInt(tx.nonce,"tx.nonce");let nonceHex=nonce.toString(16);if(nonceHex==="0"){nonceHex="0x"}else if(nonceHex.length%2){nonceHex="0x0"+nonceHex}else{nonceHex="0x"+nonceHex}return getAddress(from)}function getCreate2Address(from,salt,initCodeHash){if(hexDataLength(salt)!==32){logger.throwArgumentError("salt must be 32 bytes","salt",salt)}if(hexDataLength(initCodeHash)!==32){logger.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",initCodeHash)}const val=hexDataSlice(sha256(concat(["0xff",getAddress(from),salt,initCodeHash])),12);console.log({"contract-address/74=>should be string":val});const prefix=from.substring(2,4);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function isAddressable(value){return value&&typeof value.getAddress==="function"}function isAddress(value){try{getAddress(value);return true}catch(error){}return false}async function checkAddress(target,promise){const result=await promise;if(result==null||result==="0x0000000000000000000000000000000000000000"){assert(typeof target!=="string","unconfigured name","UNCONFIGURED_NAME",{value:target});assertArgument(false,"invalid AddressLike value; did not resolve to a value address","target",target)}return getAddress(result)}function resolveAddress(target){if(typeof target==="string"){return getAddress(target)}else if(isAddressable(target)){return checkAddress(target,target.getAddress())}else if(target&&typeof target.then==="function"){return checkAddress(target,target)}assertArgument(false,"unsupported addressable value","target",target)}const BN_0$2=BigInt(0);function getValue(value){if(value==null){return null}return value}function toJson(value){if(value==null){return null}return value.toString()}class FeeData{energyPrice;constructor(energyPrice){defineProperties(this,{energyPrice:getValue(energyPrice)})}toJSON(){const{energyPrice}=this;return{_type:"FeeData",energyPrice:toJson(energyPrice)}}}function copyRequest(req){const result={};if(req.to){result.to=req.to}if(req.from){result.from=req.from}if(req.data){result.data=hexlify(req.data)}const bigIntKeys="networkId,energyLimit,energyPrice,value".split(/,/);for(const key of bigIntKeys){if(!(key in req)||req[key]==null){continue}result[key]=getBigInt(req[key],`request.${key}`)}const numberKeys="type,nonce".split(/,/);for(const key of numberKeys){if(!(key in req)||req[key]==null){continue}result[key]=getNumber(req[key],`request.${key}`)}if("blockTag"in req){result.blockTag=req.blockTag}if("enableCcipRead"in req){result.enableCcipReadEnabled=!!req.enableCcipRead}if("customData"in req){result.customData=req.customData}return result}class Block{provider;number;hash;timestamp;parentHash;nonce;difficulty;energyLimit;energyUsed;miner;extraData;baseFeePerEnergy;#transactions;constructor(block,provider){this.#transactions=block.transactions.map(tx=>{if(typeof tx!=="string"){return new TransactionResponse(tx,provider)}return tx});defineProperties(this,{provider:provider,hash:getValue(block.hash),number:block.number,timestamp:block.timestamp,parentHash:block.parentHash,nonce:block.nonce,difficulty:block.difficulty,energyLimit:block.energyLimit,energyUsed:block.energyUsed,miner:block.miner,extraData:block.extraData,baseFeePerEnergy:getValue(block.baseFeePerEnergy)})}get transactions(){return this.#transactions.map(tx=>{if(typeof tx==="string"){return tx}return tx.hash})}get prefetchedTransactions(){const txs=this.#transactions.slice();if(txs.length===0){return[]}assert(typeof txs[0]==="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"});return txs}toJSON(){const{baseFeePerEnergy,difficulty,extraData,energyLimit,energyUsed,hash,miner,nonce,number,parentHash,timestamp,transactions}=this;return{_type:"Block",baseFeePerEnergy:toJson(baseFeePerEnergy),difficulty:toJson(difficulty),extraData:extraData,energyLimit:toJson(energyLimit),energyUsed:toJson(energyUsed),hash:hash,miner:miner,nonce:nonce,number:number,parentHash:parentHash,timestamp:timestamp,transactions:transactions}}[Symbol.iterator](){let index=0;const txs=this.transactions;return{next:()=>{if(index{return new Log(log,provider)}));defineProperties(this,{provider:provider,to:tx.to,from:tx.from,contractAddress:tx.contractAddress,hash:tx.hash,index:tx.index,blockHash:tx.blockHash,blockNumber:tx.blockNumber,logsBloom:tx.logsBloom,energyUsed:tx.energyUsed,cumulativeEnergyUsed:tx.cumulativeEnergyUsed,energyPrice:tx.effectiveEnergyPrice||tx.energyPrice,status:tx.status,root:tx.root})}get logs(){return this.#logs}toJSON(){const{to,from,contractAddress,hash,index,blockHash,blockNumber,logsBloom,logs,status,root}=this;return{_type:"TransactionReceipt",blockHash:blockHash,blockNumber:blockNumber,contractAddress:contractAddress,cumulativeEnergyUsed:toJson(this.cumulativeEnergyUsed),from:from,energyPrice:toJson(this.energyPrice),energyUsed:toJson(this.energyUsed),hash:hash,index:index,logs:logs,logsBloom:logsBloom,root:root,status:status,to:to}}get length(){return this.logs.length}[Symbol.iterator](){let index=0;return{next:()=>{if(index{if(stopScanning){return null}const{blockNumber,nonce}=await resolveProperties({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(nonce=confirms){return receipt}}else{await checkReplacement();if(confirms===0){return null}}const waiter=new Promise((resolve,reject)=>{const cancellers=[];const cancel=()=>{cancellers.forEach(c=>c())};cancellers.push(()=>{stopScanning=true});if(timeout>0){const timer=setTimeout(()=>{cancel();reject(makeError("wait for transaction timeout","TIMEOUT"))},timeout);cancellers.push(()=>{clearTimeout(timer)})}const txListener=async receipt=>{if(await receipt.confirmations()>=confirms){cancel();resolve(receipt)}};cancellers.push(()=>{this.provider.off(this.hash,txListener)});this.provider.on(this.hash,txListener);if(startBlock>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(error){if(isError(error,"TRANSACTION_REPLACED")){cancel();reject(error);return}}if(!stopScanning){this.provider.once("block",replaceListener)}};cancellers.push(()=>{this.provider.off("block",replaceListener)});this.provider.once("block",replaceListener)}});return await waiter}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}removedEvent(){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createRemovedTransactionFilter(this)}reorderedEvent(other){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});assert(!other||other.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createReorderedTransactionFilter(this,other)}replaceableTransaction(startBlock){assertArgument(Number.isInteger(startBlock)&&startBlock>=0,"invalid startBlock","startBlock",startBlock);const tx=new TransactionResponse(this,this.provider);tx.#startBlock=startBlock;return tx}}function createOrphanedBlockFilter(block){return{orphan:"drop-block",hash:block.hash,number:block.number}}function createReorderedTransactionFilter(tx,other){return{orphan:"reorder-transaction",tx:tx,other:other}}function createRemovedTransactionFilter(tx){return{orphan:"drop-transaction",tx:tx}}function createRemovedLogFilter(log){return{orphan:"drop-log",log:{transactionHash:log.transactionHash,blockHash:log.blockHash,blockNumber:log.blockNumber,address:log.address,data:log.data,topics:Object.freeze(log.topics.slice()),index:log.index}}}class EventLog extends Log{interface;fragment;args;constructor(log,iface,fragment){super(log,log.provider);const args=iface.decodeEventLog(fragment,log.data,log.topics);defineProperties(this,{args:args,fragment:fragment,interface:iface})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class ContractTransactionReceipt extends TransactionReceipt{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}get logs(){return super.logs.map(log=>{const fragment=log.topics.length?this.#iface.getEvent(log.topics[0]):null;if(fragment){return new EventLog(log,this.#iface,fragment)}else{return log}})}}class ContractTransactionResponse extends TransactionResponse{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}async wait(confirms){const receipt=await super.wait();if(receipt==null){return null}return new ContractTransactionReceipt(this.#iface,this.provider,receipt)}}class ContractUnknownEventPayload extends EventPayload{log;constructor(contract,listener,filter,log){super(contract,listener,filter);defineProperties(this,{log:log})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class ContractEventPayload extends ContractUnknownEventPayload{constructor(contract,listener,filter,fragment,_log){super(contract,listener,filter,new EventLog(_log,contract.interface,fragment));const args=contract.interface.decodeEventLog(fragment,this.log.data,this.log.topics);defineProperties(this,{args:args,fragment:fragment})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const BN_0$1=BigInt(0);function canCall(value){return value&&typeof value.call==="function"}function canEstimate(value){return value&&typeof value.estimateEnergy==="function"}function canResolve(value){return value&&typeof value.resolveName==="function"}function canSend(value){return value&&typeof value.sendTransaction==="function"}class PreparedTopicFilter{#filter;fragment;constructor(contract,fragment,args){defineProperties(this,{fragment:fragment});if(fragment.inputs.length{const arg=args[index];if(arg==null){return null}return param.walkAsync(args[index],(type,value)=>{if(type==="address"){return resolveAddress(value)}return value})}));return contract.interface.encodeFilterTopics(fragment,resolvedArgs)}()}getTopicFilter(){return this.#filter}}function getRunner(value,feature){if(value==null){return null}if(typeof value[feature]==="function"){return value}if(value.provider&&typeof value.provider[feature]==="function"){return value.provider}return null}function getProvider(value){if(value==null){return null}return value.provider||null}async function copyOverrides(arg,allowed){const overrides=copyRequest(Typed.dereference(arg,"overrides"));assertArgument(overrides.to==null||(allowed||[]).indexOf("to")>=0,"cannot override to","overrides.to",overrides.to);assertArgument(overrides.data==null||(allowed||[]).indexOf("data")>=0,"cannot override data","overrides.data",overrides.data);if(overrides.from){overrides.from=await resolveAddress(overrides.from)}return overrides}async function resolveArgs(_runner,inputs,args){return await Promise.all(inputs.map((param,index)=>{return param.walkAsync(args[index],(type,value)=>{value=Typed.dereference(value,type);if(type==="address"){return resolveAddress(value)}return value})}))}function buildWrappedFallback(contract){const populateTransaction=async function(overrides){const tx=await copyOverrides(overrides,["data"]);tx.to=await contract.getAddress();const iface=contract.interface;const payable=iface.receive||iface.fallback&&iface.fallback.payable;assertArgument(payable||(tx.value||BN_0$1)===BN_0$1,"cannot send value to non-payable contract","overrides.value",tx.value);assertArgument(iface.fallback||(tx.data||"0x")==="0x","cannot send data to receive-only contract","overrides.data",tx.data);return tx};const staticCall=async function(overrides){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(overrides);try{return await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}};const send=async function(overrides){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(overrides));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(overrides){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(overrides))};const method=async overrides=>{return await send(overrides)};defineProperties(method,{_contract:contract,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall});return method}function buildWrappedMethod(contract,key){const getFragment=function(...args){const fragment=contract.interface.getFunction(key,args);assert(fragment,"no matching fragment in getFragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const populateTransaction=async function(...args){const fragment=getFragment(...args);let overrides={};if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("internal error: fragment inputs doesn't match arguments; should not happen")}const resolvedArgs=await resolveArgs(contract.runner,fragment.inputs,args);return Object.assign({},overrides,await resolveProperties({to:contract.getAddress(),data:contract.interface.encodeFunctionData(fragment,resolvedArgs)}))};const staticCall=async function(...args){const result=await staticCallResult(...args);if(result.length===1){return result[0]}return result};const send=async function(...args){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(...args));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(...args){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(...args))};const staticCallResult=async function(...args){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(...args);let result="0x";try{result=await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}const fragment=getFragment(...args);return contract.interface.decodeFunctionResult(fragment,result)};const method=async(...args)=>{const fragment=getFragment(...args);if(fragment.constant){return await staticCall(...args)}return await send(...args)};defineProperties(method,{name:contract.interface.getFunctionName(key),_contract:contract,_key:key,getFragment:getFragment,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getFunction(key);assert(fragment,"no matching fragment in defineProperty","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}function buildWrappedEvent(contract,key){const getFragment=function(...args){const fragment=contract.interface.getEvent(key,args);assert(fragment,"no matching fragment in","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const method=function(...args){return new PreparedTopicFilter(contract,getFragment(...args),args)};defineProperties(method,{name:contract.interface.getEventName(key),_contract:contract,_key:key,getFragment:getFragment});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getEvent(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}const internal=Symbol.for("_corebcInternal_contract");const internalValues=new WeakMap;function setInternal(contract,values){internalValues.set(contract[internal],values)}function getInternal(contract){return internalValues.get(contract[internal])}function isDeferred(value){return value&&typeof value==="object"&&"getTopicFilter"in value&&typeof value.getTopicFilter==="function"&&value.fragment}async function getSubInfo(contract,event){let topics;let fragment=null;if(Array.isArray(event)){const topicHashify=function(name){if(isHexString(name,32)){return name}const fragment=contract.interface.getEvent(name);assertArgument(fragment,"unknown fragment","name",name);return fragment.topicHash};topics=event.map(e=>{if(e==null){return null}if(Array.isArray(e)){return e.map(topicHashify)}return topicHashify(e)})}else if(event==="*"){topics=[null]}else if(typeof event==="string"){if(isHexString(event,32)){topics=[event]}else{fragment=contract.interface.getEvent(event);assertArgument(fragment,"unknown fragment","event",event);topics=[fragment.topicHash]}}else if(isDeferred(event)){topics=await event.getTopicFilter()}else if("fragment"in event){fragment=event.fragment;topics=[fragment.topicHash]}else{assertArgument(false,"unknown event name","event",event)}topics=topics.map(t=>{if(t==null){return null}if(Array.isArray(t)){const items=Array.from(new Set(t.map(t=>t.toLowerCase())).values());if(items.length===1){return items[0]}items.sort();return items}return t.toLowerCase()});const tag=topics.map(t=>{if(t==null){return"null"}if(Array.isArray(t)){return t.join("|")}return t}).join("&");return{fragment:fragment,tag:tag,topics:topics}}async function hasSub(contract,event){const{subs}=getInternal(contract);return subs.get((await getSubInfo(contract,event)).tag)||null}async function getSub(contract,operation,event){const provider=getProvider(contract.runner);assert(provider,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:operation});const{fragment,tag,topics}=await getSubInfo(contract,event);const{addr,subs}=getInternal(contract);let sub=subs.get(tag);if(!sub){const address=addr?addr:contract;const filter={address:address,topics:topics};const listener=log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=contract.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){const _foundFragment=foundFragment;const args=fragment?contract.interface.decodeEventLog(fragment,log.data,log.topics):[];emit(contract,event,args,listener=>{return new ContractEventPayload(contract,listener,event,_foundFragment,log)})}else{emit(contract,event,[],listener=>{return new ContractUnknownEventPayload(contract,listener,event,log)})}};let starting=[];const start=()=>{if(starting.length){return}starting.push(provider.on(filter,listener))};const stop=async()=>{if(starting.length==0){return}let started=starting;starting=[];await Promise.all(started);provider.off(filter,listener)};sub={tag:tag,listeners:[],start:start,stop:stop};subs.set(tag,sub)}return sub}let lastEmit=Promise.resolve();async function _emit(contract,event,args,payloadFunc){await lastEmit;const sub=await hasSub(contract,event);if(!sub){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const passArgs=Array.from(args);if(payloadFunc){passArgs.push(payloadFunc(once?null:listener))}try{listener.call(contract,...passArgs)}catch(error){}return!once});return count>0}async function emit(contract,event,args,payloadFunc){try{await lastEmit}catch(error){}const resultPromise=_emit(contract,event,args,payloadFunc);lastEmit=resultPromise;return await resultPromise}const passProperties=["then"];class BaseContract{target;interface;runner;filters;[internal];fallback;constructor(target,abi,runner,_deployTx){if(runner==null){runner=null}const iface=Interface.from(abi);defineProperties(this,{target:target,runner:runner,interface:iface});Object.defineProperty(this,internal,{value:{}});let addrPromise;let addr=null;let deployTx=null;if(_deployTx){const provider=getProvider(runner);deployTx=new ContractTransactionResponse(this.interface,provider,_deployTx)}let subs=new Map;if(typeof target==="string"){if(isHexString(target)){addr=target;addrPromise=Promise.resolve(target)}else{const resolver=getRunner(runner,"resolveName");if(!canResolve(resolver)){throw makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"})}addrPromise=resolver.resolveName(target).then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}}else{addrPromise=target.getAddress().then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}setInternal(this,{addrPromise:addrPromise,addr:addr,deployTx:deployTx,subs:subs});const filters=new Proxy({},{get:(target,_prop,receiver)=>{if(passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=this.getEvent(prop);if(result){return result}throw new Error(`unknown contract event: ${prop}`)},has:(target,prop)=>{if(passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return Reflect.has(target,prop)||this.interface.hasEvent(String(prop))}});defineProperties(this,{filters:filters});defineProperties(this,{fallback:iface.receive||iface.fallback?buildWrappedFallback(this):null});return new Proxy(this,{get:(target,_prop,receiver)=>{if(_prop in target||passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=target.getFunction(prop);if(result){return result}throw new Error(`unknown contract method: ${prop}`)},has:(target,prop)=>{if(prop in target||passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return target.interface.hasFunction(String(prop))}})}connect(runner){return new BaseContract(this.target,this.interface,runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const provider=getProvider(this.runner);assert(provider,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const code=await provider.getCode(await this.getAddress());if(code==="0x"){return null}return code}async waitForDeployment(){const deployTx=this.deploymentTransaction();if(deployTx){await deployTx.wait();return this}const code=await this.getDeployedCode();if(code!=null){return this}const provider=getProvider(this.runner);assert(provider!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"});return new Promise((resolve,reject)=>{const checkCode=async()=>{try{const code=await this.getDeployedCode();if(code!=null){return resolve(this)}provider.once("block",checkCode)}catch(error){reject(error)}};checkCode()})}deploymentTransaction(){return getInternal(this).deployTx}getFunction(key){if(typeof key!=="string"){key=key.format()}const func=buildWrappedMethod(this,key);return func}getEvent(key){if(typeof key!=="string"){key=key.format()}return buildWrappedEvent(this,key)}async queryTransaction(hash){throw new Error("@TODO")}async queryFilter(event,fromBlock,toBlock){if(fromBlock==null){fromBlock=0}if(toBlock==null){toBlock="latest"}const{addr,addrPromise}=getInternal(this);const address=addr?addr:await addrPromise;const{fragment,topics}=await getSubInfo(this,event);const filter={address:address,topics:topics,fromBlock:fromBlock,toBlock:toBlock};const provider=getProvider(this.runner);assert(provider,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"});return(await provider.getLogs(filter)).map(log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=this.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){return new EventLog(log,this.interface,foundFragment)}else{return new Log(log,provider)}})}async on(event,listener){const sub=await getSub(this,"on",event);sub.listeners.push({listener:listener,once:false});sub.start();return this}async once(event,listener){const sub=await getSub(this,"once",event);sub.listeners.push({listener:listener,once:true});sub.start();return this}async emit(event,...args){return await emit(this,event,args,null)}async listenerCount(event){if(event){const sub=await hasSub(this,event);if(!sub){return 0}return sub.listeners.length}const{subs}=getInternal(this);let total=0;for(const{listeners}of subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}const{subs}=getInternal(this);let result=[];for(const{listeners}of subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await hasSub(this,event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(listener==null||sub.listeners.length===0){sub.stop();getInternal(this).subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return this}sub.stop();getInternal(this).subs.delete(sub.tag)}else{const{subs}=getInternal(this);for(const{tag,stop}of subs.values()){stop();subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return await this.off(event,listener)}static buildClass(abi){class CustomContract extends BaseContract{constructor(address,runner=null){super(address,abi,runner)}}return CustomContract}static from(target,abi,runner){if(runner==null){runner=null}const contract=new this(target,abi,runner);return contract}static isIndexed(value){return Indexed.isIndexed(value)}}function _ContractBase(){return BaseContract}class Contract extends _ContractBase(){}class ContractFactory{interface;bytecode;runner;constructor(abi,bytecode,runner){const iface=Interface.from(abi);if(bytecode instanceof Uint8Array){bytecode=hexlify(getBytes(bytecode))}else if(typeof bytecode==="string"){bytecode=bytecode}else if(isBytes$1(bytecode)){bytecode=hexlify(bytecode)}else if(bytecode&&typeof bytecode.object==="string"){bytecode=bytecode.object}else{bytecode="!"}defineProperties(this,{bytecode:bytecode,interface:iface,runner:runner||null})}async getDeployTransaction(...args){let overrides={};const fragment=this.interface.deploy;if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("incorrect number of arguments to constructor")}const resolvedArgs=await resolveArgs(this.runner,fragment.inputs,args);const data=concat([this.bytecode,this.interface.encodeDeploy(resolvedArgs)]);return Object.assign({},overrides,{data:data})}async deploy(...args){const tx=await this.getDeployTransaction(...args);assert(this.runner&&typeof this.runner.sendTransaction==="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const sentTx=await this.runner.sendTransaction(tx);const address=getCreateAddress(sentTx);return new BaseContract(address,this.interface,this.runner,sentTx)}connect(runner){return new ContractFactory(this.interface,this.bytecode,runner)}static fromSolidity(output,runner){assertArgument(output!=null,"bad compiler output","output",output);if(typeof output==="string"){output=JSON.parse(output)}const abi=output.abi;let bytecode="";if(output.bytecode){bytecode=output.bytecode}else if(output.evm&&output.evm.bytecode){bytecode=output.evm.bytecode}return new this(abi,bytecode,runner)}}const BN_0=BigInt(0);function allowNull(format,nullValue){return function(value){if(value==null){return nullValue}return format(value)}}function arrayOf(format){return array=>{if(!Array.isArray(array)){throw new Error("not an array")}return array.map(i=>format(i))}}function object(format,altNames){return value=>{const result={};for(const key in format){let srcKey=key;if(altNames&&key in altNames&&!(srcKey in value)){for(const altKey of altNames[key]){if(altKey in value){srcKey=altKey;break}}}try{const nv=format[key](value[srcKey]);if(nv!==undefined){result[key]=nv}}catch(error){const message=error instanceof Error?error.message:"not-an-error";assert(false,`invalid value for value.${key} (${message})`,"BAD_DATA",{value:value})}}return result}}function formatBoolean(value){switch(value){case true:case"true":return true;case false:case"false":return false}assertArgument(false,`invalid boolean; ${JSON.stringify(value)}`,"value",value)}function formatData(value){assertArgument(isHexString(value,true),"invalid data","value",value);return value}function formatHash(value){assertArgument(isHexString(value,32),"invalid hash","value",value);return value}const _formatLog=object({address:getAddress,blockHash:formatHash,blockNumber:getNumber,data:formatData,index:getNumber,removed:allowNull(formatBoolean,false),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:getNumber},{index:["logIndex"]});function formatLog(value){return _formatLog(value)}const _formatBlock=object({hash:allowNull(formatHash),parentHash:formatHash,number:getNumber,timestamp:getNumber,nonce:allowNull(formatData),difficulty:getBigInt,energyLimit:getBigInt,energyUsed:getBigInt,miner:allowNull(getAddress),extraData:formatData,baseFeePerEnergy:allowNull(getBigInt)});function formatBlock(value){const result=_formatBlock(value);result.transactions=value.transactions.map(tx=>{if(typeof tx==="string"){return tx}return formatTransactionResponse(tx)});return result}const _formatReceiptLog=object({transactionIndex:getNumber,blockNumber:getNumber,transactionHash:formatHash,address:getAddress,topics:arrayOf(formatHash),data:formatData,index:getNumber,blockHash:formatHash},{index:["logIndex"]});function formatReceiptLog(value){return _formatReceiptLog(value)}const _formatTransactionReceipt=object({to:allowNull(getAddress,null),from:allowNull(getAddress,null),contractAddress:allowNull(getAddress,null),index:getNumber,root:allowNull(hexlify),energyUsed:getBigInt,logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf(formatReceiptLog),blockNumber:getNumber,cumulativeEnergyUsed:getBigInt,effectiveEnergyPrice:allowNull(getBigInt),status:allowNull(getNumber),type:allowNull(getNumber,0)},{effectiveEnergyPrice:["energyPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionReceipt(value){return _formatTransactionReceipt(value)}function formatTransactionResponse(value){if(value.to&&!getAddress(value.to)&&getBigInt(value.to)===BN_0){value.to="0x0000000000000000000000000000000000000000"}const result=object({hash:formatHash,type:value=>{if(value==="0x"||value==null){return 0}return getNumber(value)},accessList:allowNull(accessListify,null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(getNumber,null),transactionIndex:allowNull(getNumber,null),from:getAddress,maxFeePerEnergy:allowNull(getBigInt),energyLimit:getBigInt,to:allowNull(getAddress,null),value:getBigInt,nonce:getNumber,data:formatData,creates:allowNull(getAddress,null),networkId:allowNull(getBigInt,null)},{data:["input"],energyLimit:["energy"]})(value);if(result.to==null&&result.creates==null){result.creates=getCreateAddress(result)}if(value.signature){result.signature=value.signature}else{result.signature=value}if(result.networkId==null){const networkId=result.signature.legacynetworkId;if(networkId!=null){result.networkId=networkId}}if(result.blockHash&&getBigInt(result.blockHash)===BN_0){result.blockHash=null}return result}class NetworkPlugin{name;constructor(name){defineProperties(this,{name:name})}clone(){return new NetworkPlugin(this.name)}}class EnergyCostPlugin extends NetworkPlugin{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(effectiveBlock,costs){if(effectiveBlock==null){effectiveBlock=0}super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock||0}`);const props={effectiveBlock:effectiveBlock};function set(name,nullish){let value=(costs||{})[name];if(value==null){value=nullish}assertArgument(typeof value==="number",`invalud value for ${name}`,"costs",costs);props[name]=value}set("txBase",21e3);set("txCreate",32e3);set("txDataZero",4);set("txDataNonzero",16);set("txAccessListStorageKey",1900);set("txAccessListAddress",2400);defineProperties(this,props)}clone(){return new EnergyCostPlugin(this.effectiveBlock,this)}}class FeeDataNetworkPlugin extends NetworkPlugin{#feeDataFunc;get feeDataFunc(){return this.#feeDataFunc}constructor(feeDataFunc){super("org.corebc.plugins.network.FeeData");this.#feeDataFunc=feeDataFunc}async getFeeData(provider){return await this.#feeDataFunc(provider)}clone(){return new FeeDataNetworkPlugin(this.#feeDataFunc)}}const Networks=new Map;class Network{#name;#networkId;#plugins;constructor(name,networkId){this.#name=name;this.#networkId=getBigInt(networkId);this.#plugins=new Map}toJSON(){return{name:this.name,networkId:String(this.networkId)}}get name(){return this.#name}set name(value){this.#name=value}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value,"networkId")}matches(other){if(other==null){return false}if(typeof other==="string"){try{return this.networkId===getBigInt(other)}catch(error){}return this.name===other}if(typeof other==="number"||typeof other==="bigint"){try{return this.networkId===getBigInt(other)}catch(error){}return false}if(typeof other==="object"){if(other.networkId!=null){try{return this.networkId===getBigInt(other.networkId)}catch(error){}return false}if(other.name!=null){return this.name===other.name}return false}return false}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.clone());return this}getPlugin(name){return this.#plugins.get(name)||null}getPlugins(basename){return this.plugins.filter(p=>p.name.split("#")[0]===basename)}clone(){const clone=new Network(this.name,this.networkId);this.plugins.forEach(plugin=>{clone.attachPlugin(plugin.clone())});return clone}computeIntrinsicEnergy(tx){const costs=this.getPlugin("org.corebc.plugins.network.EnergyCost")||new EnergyCostPlugin;let energy=costs.txBase;if(tx.to==null){energy+=costs.txCreate}if(tx.data){for(let i=2;i{Network.register(name,func)})}}registerEth("mainnet",1,{altNames:["homestead"]});registerEth("ropsten",3,{});registerEth("rinkeby",4,{});registerEth("goerli",5,{});registerEth("kovan",42,{});registerEth("sepolia",11155111,{});registerEth("classic",61,{});registerEth("classicKotti",6,{});registerEth("xdai",100,{})}function copy$2(obj){return JSON.parse(JSON.stringify(obj))}class PollingBlockSubscriber{#provider;#poller;#interval;#blockNumber;constructor(provider){this.#provider=provider;this.#poller=null;this.#interval=4e3;this.#blockNumber=-2}get pollingInterval(){return this.#interval}set pollingInterval(value){this.#interval=value}async#poll(){try{const blockNumber=await this.#provider.getBlockNumber();if(this.#blockNumber===-2){this.#blockNumber=blockNumber;return}if(blockNumber!==this.#blockNumber){for(let b=this.#blockNumber+1;b<=blockNumber;b++){if(this.#poller==null){return}await this.#provider.emit("block",b)}this.#blockNumber=blockNumber}}catch(error){}if(this.#poller==null){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval)}start(){if(this.#poller){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval);this.#poll()}stop(){if(!this.#poller){return}this.#provider._clearTimeout(this.#poller);this.#poller=null}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}class OnBlockSubscriber{#provider;#poll;#running;constructor(provider){this.#provider=provider;this.#running=false;this.#poll=blockNumber=>{this._poll(blockNumber,this.#provider)}}async _poll(blockNumber,provider){throw new Error("sub-classes must override this")}start(){if(this.#running){return}this.#running=true;this.#poll(-2);this.#provider.on("block",this.#poll)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poll)}pause(dropWhilePaused){this.stop()}resume(){this.start()}}class PollingOrphanSubscriber extends OnBlockSubscriber{#filter;constructor(provider,filter){super(provider);this.#filter=copy$2(filter)}async _poll(blockNumber,provider){throw new Error("@TODO")}}class PollingTransactionSubscriber extends OnBlockSubscriber{#hash;constructor(provider,hash){super(provider);this.#hash=hash}async _poll(blockNumber,provider){const tx=await provider.getTransactionReceipt(this.#hash);if(tx){provider.emit(this.#hash,tx)}}}class PollingEventSubscriber{#provider;#filter;#poller;#running;#blockNumber;constructor(provider,filter){this.#provider=provider;this.#filter=copy$2(filter);this.#poller=this.#poll.bind(this);this.#running=false;this.#blockNumber=-2}async#poll(blockNumber){if(this.#blockNumber===-2){return}const filter=copy$2(this.#filter);filter.fromBlock=this.#blockNumber+1;filter.toBlock=blockNumber;const logs=await this.#provider.getLogs(filter);if(logs.length===0){if(this.#blockNumber{this.#blockNumber=blockNumber})}this.#provider.on("block",this.#poller)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poller)}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}const MAX_CCIP_REDIRECTS=10;function isPromise(value){return value&&typeof value.then==="function"}function getTag(prefix,value){return prefix+":"+JSON.stringify(value,(k,v)=>{if(v==null){return"null"}if(typeof v==="bigint"){return`bigint:${v.toString()}`}if(typeof v==="string"){return v.toLowerCase()}if(typeof v==="object"&&!Array.isArray(v)){const keys=Object.keys(v);keys.sort();return keys.reduce((accum,key)=>{accum[key]=v[key];return accum},{})}return v})}class UnmanagedSubscriber{name;constructor(name){defineProperties(this,{name:name})}start(){}stop(){}pause(dropWhilePaused){}resume(){}}function copy$1(value){return JSON.parse(JSON.stringify(value))}function concisify(items){items=Array.from(new Set(items).values());items.sort();return items}async function getSubscription(_event,provider){if(_event==null){throw new Error("invalid event")}if(Array.isArray(_event)){_event={topics:_event}}if(typeof _event==="string"){switch(_event){case"block":case"pending":case"debug":case"error":case"network":{return{type:_event,tag:_event}}}}if(isHexString(_event,32)){const hash=_event.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:hash}),hash:hash}}if(_event.orphan){const event=_event;return{type:"orphan",tag:getTag("orphan",event),filter:copy$1(event)}}if(_event.address||_event.topics){const event=_event;const filter={topics:(event.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()})};if(event.address){const addresses=[];const promises=[];const addAddress=addr=>{if(isHexString(addr)){addresses.push(addr)}else{promises.push((async()=>{addresses.push(await resolveAddress(addr))})())}};if(Array.isArray(event.address)){event.address.forEach(addAddress)}else{addAddress(event.address)}if(promises.length){await Promise.all(promises)}filter.address=concisify(addresses.map(a=>a.toLowerCase()))}return{filter:filter,tag:getTag("event",filter),type:"event"}}assertArgument(false,"unknown ProviderEvent","event",_event)}function getTime$1(){return(new Date).getTime()}class AbstractProvider{#subs;#plugins;#pausedState;#networkPromise;#anyNetwork;#performCache;#lastBlockNumber;#nextTimer;#timers;#disableCcipRead;constructor(_network){if(_network==="any"){this.#anyNetwork=true;this.#networkPromise=null}else if(_network){const network=Network.from(_network);this.#anyNetwork=false;this.#networkPromise=Promise.resolve(network);setTimeout(()=>{this.emit("network",network,null)},0)}else{this.#anyNetwork=false;this.#networkPromise=null}this.#lastBlockNumber=-1;this.#performCache=new Map;this.#subs=new Map;this.#plugins=new Map;this.#pausedState=null;this.#nextTimer=1;this.#timers=new Map;this.#disableCcipRead=false}get provider(){return this}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.connect(this));return this}getPlugin(name){return this.#plugins.get(name)||null}get disableCcipRead(){return this.#disableCcipRead}set disableCcipRead(value){this.#disableCcipRead=!!value}async#perform(req){const tag=getTag(req.method,req);let perform=this.#performCache.get(tag);if(!perform){perform=this._perform(req);this.#performCache.set(tag,perform);setTimeout(()=>{if(this.#performCache.get(tag)===perform){this.#performCache.delete(tag)}},250)}return await perform}async ccipReadFetch(tx,calldata,urls){if(this.disableCcipRead||urls.length===0||tx.to==null){return null}const sender=tx.to.toLowerCase();const data=calldata.toLowerCase();const errorMessages=[];for(let i=0;i=500,`response not found during CCIP fetch: ${errorMessage}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:tx,info:{url:url,errorMessage:errorMessage}});errorMessages.push(errorMessage)}assert(false,`error encountered during CCIP fetch: ${errorMessages.map(m=>JSON.stringify(m)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:tx,info:{urls:urls,errorMessages:errorMessages}})}_wrapBlock(value,network){return new Block(formatBlock(value),this)}_wrapLog(value,network){return new Log(formatLog(value),this)}_wrapTransactionReceipt(value,network){return new TransactionReceipt(formatTransactionReceipt(value),this)}_wrapTransactionResponse(tx,network){return new TransactionResponse(formatTransactionResponse(tx),this)}_detectNetwork(){assert(false,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(req){assert(false,`unsupported method: ${req.method}`,"UNSUPPORTED_OPERATION",{operation:req.method,info:req})}async getBlockNumber(){const blockNumber=getNumber(await this.#perform({method:"getBlockNumber"}),"%response");if(this.#lastBlockNumber>=0){this.#lastBlockNumber=blockNumber}return blockNumber}_getAddress(address){return resolveAddress(address)}_getBlockTag(blockTag){if(blockTag==null){return"latest"}switch(blockTag){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return blockTag}if(isHexString(blockTag)){if(isHexString(blockTag,32)){return blockTag}return toQuantity(blockTag)}if(typeof blockTag==="bigint"){blockTag=getNumber(blockTag,"blockTag")}if(typeof blockTag==="number"){if(blockTag>=0){return toQuantity(blockTag)}if(this.#lastBlockNumber>=0){return toQuantity(this.#lastBlockNumber+blockTag)}return this.getBlockNumber().then(b=>toQuantity(b+blockTag))}assertArgument(false,"invalid blockTag","blockTag",blockTag)}_getFilter(filter){const topics=(filter.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()});const blockHash="blockHash"in filter?filter.blockHash:undefined;const resolve=(_address,fromBlock,toBlock)=>{let address=undefined;switch(_address.length){case 0:break;case 1:address=_address[0];break;default:_address.sort();address=_address}if(blockHash){if(fromBlock!=null||toBlock!=null){throw new Error("invalid filter")}}const filter={};if(address){filter.address=address}if(topics.length){filter.topics=topics}if(fromBlock){filter.fromBlock=fromBlock}if(toBlock){filter.toBlock=toBlock}if(blockHash){filter.blockHash=blockHash}return filter};let address=[];if(filter.address){if(Array.isArray(filter.address)){for(const addr of filter.address){address.push(this._getAddress(addr))}}else{address.push(this._getAddress(filter.address))}}let fromBlock=undefined;if("fromBlock"in filter){fromBlock=this._getBlockTag(filter.fromBlock)}let toBlock=undefined;if("toBlock"in filter){toBlock=this._getBlockTag(filter.toBlock)}if(address.filter(a=>typeof a!=="string").length||fromBlock!=null&&typeof fromBlock!=="string"||toBlock!=null&&typeof toBlock!=="string"){return Promise.all([Promise.all(address),fromBlock,toBlock]).then(result=>{return resolve(result[0],result[1],result[2])})}return resolve(address,fromBlock,toBlock)}_getTransactionRequest(_request){const request=copyRequest(_request);const promises=[];["to","from"].forEach(key=>{if(request[key]==null){return}const addr=resolveAddress(request[key]);if(isPromise(addr)){promises.push(async function(){request[key]=await addr}())}else{request[key]=addr}});if(request.blockTag!=null){const blockTag=this._getBlockTag(request.blockTag);if(isPromise(blockTag)){promises.push(async function(){request.blockTag=await blockTag}())}else{request.blockTag=blockTag}}if(promises.length){return async function(){await Promise.all(promises);return request}()}return request}async getNetwork(){if(this.#networkPromise==null){const detectNetwork=this._detectNetwork().then(network=>{this.emit("network",network,null);return network},error=>{if(this.#networkPromise===detectNetwork){this.#networkPromise=null}throw error});this.#networkPromise=detectNetwork;return(await detectNetwork).clone()}const networkPromise=this.#networkPromise;const[expected,actual]=await Promise.all([networkPromise,this._detectNetwork()]);if(expected.networkId!==actual.networkId){if(this.#anyNetwork){this.emit("network",actual,expected);if(this.#networkPromise===networkPromise){this.#networkPromise=Promise.resolve(actual)}}else{assert(false,`network changed: ${expected.networkId} => ${actual.networkId} `,"NETWORK_ERROR",{event:"changed"})}}return expected.clone()}async getEnergyPrice(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async getFeeData(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async estimateEnergy(_tx){let tx=this._getTransactionRequest(_tx);if(isPromise(tx)){tx=await tx}return getBigInt(await this.#perform({method:"estimateEnergy",transaction:tx}),"%response")}async#call(tx,blockTag,attempt){assert(attempt=0&&blockTag==="latest"&&transaction.to!=null&&dataSlice(error.data,0,4)==="0x556f1830"){const data=error.data;const txSender=await resolveAddress(transaction.to);let ccipArgs;try{ccipArgs=parseOffchainLookup(dataSlice(error.data,4))}catch(error){assert(false,error.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:transaction,info:{data:data}})}assert(ccipArgs.sender.toLowerCase()===txSender.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:data,reason:"OffchainLookup",transaction:transaction,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ccipArgs.errorArgs}});const ccipResult=await this.ccipReadFetch(transaction,ccipArgs.calldata,ccipArgs.urls);assert(ccipResult!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:transaction,info:{data:error.data,errorArgs:ccipArgs.errorArgs}});const tx={to:txSender,data:concat([ccipArgs.selector,encodeBytes([ccipResult,ccipArgs.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:tx});try{const result=await this.#call(tx,blockTag,attempt+1);this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},tx),result:result});return result}catch(error){this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},tx),error:error});throw error}}throw error}}async#checkNetwork(promise){const{value}=await resolveProperties({network:this.getNetwork(),value:promise});return value}async call(_tx){const{tx,blockTag}=await resolveProperties({tx:this._getTransactionRequest(_tx),blockTag:this._getBlockTag(_tx.blockTag)});return await this.#checkNetwork(this.#call(tx,blockTag,_tx.enableCcipRead?0:-1))}async#getAccountValue(request,_address,_blockTag){let address=this._getAddress(_address);let blockTag=this._getBlockTag(_blockTag);if(typeof address!=="string"||typeof blockTag!=="string"){[address,blockTag]=await Promise.all([address,blockTag])}return await this.#checkNetwork(this.#perform(Object.assign(request,{address:address,blockTag:blockTag})))}async getBalance(address,blockTag){return getBigInt(await this.#getAccountValue({method:"getBalance"},address,blockTag),"%response")}async getTransactionCount(address,blockTag){return getNumber(await this.#getAccountValue({method:"getTransactionCount"},address,blockTag),"%response")}async getCode(address,blockTag){return hexlify(await this.#getAccountValue({method:"getCode"},address,blockTag))}async getStorage(address,_position,blockTag){const position=getBigInt(_position,"position");return hexlify(await this.#getAccountValue({method:"getStorage",position:position},address,blockTag))}async broadcastTransaction(signedTx){const{blockNumber,hash,network}=await resolveProperties({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:signedTx}),network:this.getNetwork()});const tx=Transaction.from(signedTx);if(tx.hash!==hash){throw new Error("@TODO: the returned hash did not match")}return this._wrapTransactionResponse(tx,network).replaceableTransaction(blockNumber)}async#getBlock(block,includeTransactions){if(isHexString(block,32)){return await this.#perform({method:"getBlock",blockHash:block,includeTransactions:includeTransactions})}let blockTag=this._getBlockTag(block);if(typeof blockTag!=="string"){blockTag=await blockTag}return await this.#perform({method:"getBlock",blockTag:blockTag,includeTransactions:includeTransactions})}async getBlock(block,prefetchTxs){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#getBlock(block,!!prefetchTxs)});if(params==null){return null}return this._wrapBlock(params,network)}async getTransaction(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransaction",hash:hash})});if(params==null){return null}return this._wrapTransactionResponse(params,network)}async getTransactionReceipt(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransactionReceipt",hash:hash})});if(params==null){return null}if(params.energyPrice==null&¶ms.effectiveEnergyPrice==null){const tx=await this.#perform({method:"getTransaction",hash:hash});if(tx==null){throw new Error("report this; could not find tx or effectiveEnergyPrice")}params.effectiveEnergyPrice=tx.energyPrice}return this._wrapTransactionReceipt(params,network)}async getTransactionResult(hash){const{result}=await resolveProperties({network:this.getNetwork(),result:this.#perform({method:"getTransactionResult",hash:hash})});if(result==null){return null}return hexlify(result)}async getLogs(_filter){let filter=this._getFilter(_filter);if(isPromise(filter)){filter=await filter}const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getLogs",filter:filter})});return params.map(p=>this._wrapLog(p,network))}_getProvider(networkId){assert(false,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async waitForTransaction(hash,_confirms,timeout){const confirms=_confirms!=null?_confirms:1;if(confirms===0){return this.getTransactionReceipt(hash)}return new Promise(async(resolve,reject)=>{let timer=null;const listener=async blockNumber=>{try{const receipt=await this.getTransactionReceipt(hash);if(receipt!=null){if(blockNumber-receipt.blockNumber+1>=confirms){resolve(receipt);if(timer){clearTimeout(timer);timer=null}return}}}catch(error){console.log("EEE",error)}this.once("block",listener)};if(timeout!=null){timer=setTimeout(()=>{if(timer==null){return}timer=null;this.off("block",listener);reject(makeError("timeout","TIMEOUT",{reason:"timeout"}))},timeout)}listener(await this.getBlockNumber())})}async waitForBlock(blockTag){assert(false,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(timerId){const timer=this.#timers.get(timerId);if(!timer){return}if(timer.timer){clearTimeout(timer.timer)}this.#timers.delete(timerId)}_setTimeout(_func,timeout){if(timeout==null){timeout=0}const timerId=this.#nextTimer++;const func=()=>{this.#timers.delete(timerId);_func()};if(this.paused){this.#timers.set(timerId,{timer:null,func:func,time:timeout})}else{const timer=setTimeout(func,timeout);this.#timers.set(timerId,{timer:timer,func:func,time:getTime$1()})}return timerId}_forEachSubscriber(func){for(const sub of this.#subs.values()){func(sub.subscriber)}}_getSubscriber(sub){switch(sub.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(sub.type);case"block":return new PollingBlockSubscriber(this);case"event":return new PollingEventSubscriber(this,sub.filter);case"transaction":return new PollingTransactionSubscriber(this,sub.hash);case"orphan":return new PollingOrphanSubscriber(this,sub.filter)}throw new Error(`unsupported event: ${sub.type}`)}_recoverSubscriber(oldSub,newSub){for(const sub of this.#subs.values()){if(sub.subscriber===oldSub){if(sub.started){sub.subscriber.stop()}sub.subscriber=newSub;if(sub.started){newSub.start()}if(this.#pausedState!=null){newSub.pause(this.#pausedState)}break}}}async#hasSub(event,emitArgs){let sub=await getSubscription(event);if(sub.type==="event"&&emitArgs&&emitArgs.length>0&&emitArgs[0].removed===true){sub=await getSubscription({orphan:"drop-log",log:emitArgs[0]})}return this.#subs.get(sub.tag)||null}async#getSub(event){const subscription=await getSubscription(event);const tag=subscription.tag;let sub=this.#subs.get(tag);if(!sub){const subscriber=this._getSubscriber(subscription);const addressableMap=new WeakMap;const nameMap=new Map;sub={subscriber:subscriber,tag:tag,addressableMap:addressableMap,nameMap:nameMap,started:false,listeners:[]};this.#subs.set(tag,sub)}return sub}async on(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:false});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async once(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:true});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async emit(event,...args){const sub=await this.#hasSub(event,args);if(!sub||sub.listeners.length===0){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const payload=new EventPayload(this,once?null:listener,event);try{listener.call(this,...args,payload)}catch(error){}return!once});if(sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return count>0}async listenerCount(event){if(event){const sub=await this.#hasSub(event);if(!sub){return 0}return sub.listeners.length}let total=0;for(const{listeners}of this.#subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await this.#hasSub(event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}let result=[];for(const{listeners}of this.#subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await this.#hasSub(event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(!listener||sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const{tag,started,subscriber}=await this.#getSub(event);if(started){subscriber.stop()}this.#subs.delete(tag)}else{for(const[tag,{started,subscriber}]of this.#subs){if(started){subscriber.stop()}this.#subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return this.off(event,listener)}destroy(){this.removeAllListeners();for(const timerId of this.#timers.keys()){this._clearTimeout(timerId)}}get paused(){return this.#pausedState!=null}set paused(pause){if(!!pause===this.paused){return}if(this.paused){this.resume()}else{this.pause(false)}}pause(dropWhilePaused){this.#lastBlockNumber=-1;if(this.#pausedState!=null){if(this.#pausedState==!!dropWhilePaused){return}assert(false,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(s=>s.pause(dropWhilePaused));this.#pausedState=!!dropWhilePaused;for(const timer of this.#timers.values()){if(timer.timer){clearTimeout(timer.timer)}timer.time=getTime$1()-timer.time}}resume(){if(this.#pausedState==null){return}this._forEachSubscriber(s=>s.resume());this.#pausedState=null;for(const timer of this.#timers.values()){let timeout=timer.time;if(timeout<0){timeout=0}timer.time=getTime$1();setTimeout(timer.func,timeout)}}}function _parseString(result,start){try{const bytes=_parseBytes(result,start);if(bytes){return toUtf8String(bytes)}}catch(error){}return null}function _parseBytes(result,start){if(result==="0x"){return null}try{const offset=getNumber(dataSlice(result,start,start+32));const length=getNumber(dataSlice(result,offset,offset+32));return dataSlice(result,offset+32,offset+32+length)}catch(error){}return null}function numPad(value){const result=toBeArray(value);if(result.length>32){throw new Error("internal; should not happen")}const padded=new Uint8Array(32);padded.set(result,32-result.length);return padded}function bytesPad(value){if(value.length%32===0){return value}const result=new Uint8Array(Math.ceil(value.length/32)*32);result.set(value);return result}const empty=new Uint8Array([]);function encodeBytes(datas){const result=[];let byteCount=0;for(let i=0;i=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const sender=dataSlice(data,0,32);assert(dataSlice(sender,0,12)===dataSlice(zeros,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"});result.sender=dataSlice(sender,12);try{const urls=[];const urlsOffset=getNumber(dataSlice(data,32,64));const urlsLength=getNumber(dataSlice(data,urlsOffset,urlsOffset+32));const urlsData=dataSlice(data,urlsOffset+32);for(let u=0;uresult[k]);return result}function checkProvider(signer,operation){if(signer.provider){return signer.provider}assert(false,"missing provider","UNSUPPORTED_OPERATION",{operation:operation})}async function populate(signer,tx){let pop=copyRequest(tx);if(pop.to!=null){pop.to=resolveAddress(pop.to)}if(pop.from!=null){const from=pop.from;pop.from=Promise.all([signer.getAddress(),resolveAddress(from)]).then(([address,from])=>{assertArgument(address.toLowerCase()===from.toLowerCase(),"transaction from mismatch","tx.from",from);return address})}else{pop.from=signer.getAddress()}return await resolveProperties(pop)}class AbstractSigner{provider;constructor(provider){defineProperties(this,{provider:provider||null})}async getNonce(blockTag){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),blockTag)}async populateCall(tx){const pop=await populate(this,tx);return pop}async populateTransaction(tx){const provider=checkProvider(this,"populateTransaction");const pop=await populate(this,tx);if(pop.nonce==null){pop.nonce=await this.getNonce("pending")}if(pop.energyLimit==null){pop.energyLimit=await this.estimateEnergy(pop)}const network=await this.provider.getNetwork();if(pop.networkId!=null){const networkId=getBigInt(pop.networkId);assertArgument(networkId===network.networkId,"transaction networkId mismatch","tx.networkId",tx.networkId)}else{pop.networkId=network.networkId}const feeData=await provider.getFeeData();if(feeData.energyPrice!=null){if(pop.energyPrice==null){pop.energyPrice=feeData.energyPrice}}else{assert(false,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"})}return await resolveProperties(pop)}async estimateEnergy(tx){return checkProvider(this,"estimateEnergy").estimateEnergy(await this.populateCall(tx))}async call(tx){return checkProvider(this,"call").call(await this.populateCall(tx))}async resolveName(name){return getAddress(name)}async sendTransaction(tx){const provider=checkProvider(this,"sendTransaction");const pop=await this.populateTransaction(tx);delete pop.from;const txObj=Transaction.from(pop);return await provider.broadcastTransaction(await this.signTransaction(txObj))}}class VoidSigner extends AbstractSigner{address;constructor(address,provider){super(provider);defineProperties(this,{address:address})}async getAddress(){return this.address}connect(provider){return new VoidSigner(this.address,provider)}#throwUnsupported(suffix,operation){assert(false,`VoidSigner cannot sign ${suffix}`,"UNSUPPORTED_OPERATION",{operation:operation})}async signTransaction(tx){this.#throwUnsupported("transactions","signTransaction")}async signMessage(message){this.#throwUnsupported("messages","signMessage")}async signTypedData(domain,types,value){this.#throwUnsupported("typed-data","signTypedData")}}const shown=new Set;function showThrottleMessage(service){if(shown.has(service)){return}shown.add(service);console.log("========= NOTICE =========");console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);console.log("");console.log("The default API keys for each service are provided as a highly-throttled,");console.log("community resource for low-traffic projects and early prototyping.");console.log("");console.log("While your application will continue to function, we highly recommended");console.log("signing up for your own API keys to improve performance, increase your");console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");console.log("")}function copy(obj){return JSON.parse(JSON.stringify(obj))}class FilterIdSubscriber{#provider;#filterIdPromise;#poller;#running;#network;#hault;constructor(provider){this.#provider=provider;this.#filterIdPromise=null;this.#poller=this.#poll.bind(this);this.#running=false;this.#network=null;this.#hault=false}_subscribe(provider){throw new Error("subclasses must override this")}_emitResults(provider,result){throw new Error("subclasses must override this")}_recover(provider){throw new Error("subclasses must override this")}async#poll(blockNumber){try{if(this.#filterIdPromise==null){this.#filterIdPromise=this._subscribe(this.#provider)}let filterId=null;try{filterId=await this.#filterIdPromise}catch(error){if(!isError(error,"UNSUPPORTED_OPERATION")||error.operation!=="xcb_newFilter"){throw error}}if(filterId==null){this.#filterIdPromise=null;this.#provider._recoverSubscriber(this,this._recover(this.#provider));return}const network=await this.#provider.getNetwork();if(!this.#network){this.#network=network}if(this.#network.networkId!==network.networkId){throw new Error("chaid changed")}if(this.#hault){return}const result=await this.#provider.send("xcb_getFilterChanges",[filterId]);await this._emitResults(this.#provider,result)}catch(error){console.log("@TODO",error)}this.#provider.once("block",this.#poller)}#teardown(){const filterIdPromise=this.#filterIdPromise;if(filterIdPromise){this.#filterIdPromise=null;filterIdPromise.then(filterId=>{this.#provider.send("xcb_uninstallFilter",[filterId])})}}start(){if(this.#running){return}this.#running=true;this.#poll(-2)}stop(){if(!this.#running){return}this.#running=false;this.#hault=true;this.#teardown();this.#provider.off("block",this.#poller)}pause(dropWhilePaused){if(dropWhilePaused){this.#teardown()}this.#provider.off("block",this.#poller)}resume(){this.start()}}class FilterIdEventSubscriber extends FilterIdSubscriber{#event;constructor(provider,filter){super(provider);this.#event=copy(filter)}_recover(provider){return new PollingEventSubscriber(provider,this.#event)}async _subscribe(provider){const filterId=await provider.send("xcb_newFilter",[this.#event]);return filterId}async _emitResults(provider,results){for(const result of results){provider.emit(this.#event,provider._wrapLog(result,provider._network))}}}class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(provider){return await provider.send("xcb_newPendingTransactionFilter",[])}async _emitResults(provider,results){for(const result of results){provider.emit("pending",result)}}}const Primitive="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy(value){if(value==null||Primitive.indexOf(typeof value)>=0){return value}if(typeof value.getAddress==="function"){return value}if(Array.isArray(value)){return value.map(deepCopy)}if(typeof value==="object"){return Object.keys(value).reduce((accum,key)=>{accum[key]=value[key];return accum},{})}throw new Error(`should not happen: ${value} (${typeof value})`)}function stall$3(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getLowerCase(value){if(value){return value.toLowerCase()}return value}function isPollable(value){return value&&typeof value.pollingInterval==="number"}const defaultOptions={polling:false,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100};class JsonRpcSigner extends AbstractSigner{address;constructor(provider,address){super(provider);address=getAddress(address);defineProperties(this,{address:address})}connect(provider){assert(false,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(tx){return await this.populateCall(tx)}async sendUncheckedTransaction(_tx){const tx=deepCopy(_tx);const promises=[];if(tx.from){const _from=tx.from;promises.push((async()=>{const from=await resolveAddress(_from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from})())}else{tx.from=this.address}if(tx.energyLimit==null){promises.push((async()=>{tx.energyLimit=await this.provider.estimateEnergy({...tx,from:this.address})})())}if(tx.to!=null){const _to=tx.to;promises.push((async()=>{tx.to=await resolveAddress(_to)})())}if(promises.length){await Promise.all(promises)}const hexTx=this.provider.getRpcTransaction(tx);return this.provider.send("xcb_sendTransaction",[hexTx])}async sendTransaction(tx){const blockNumber=await this.provider.getBlockNumber();const hash=await this.sendUncheckedTransaction(tx);return await new Promise((resolve,reject)=>{const timeouts=[1e3,100];const checkTx=async()=>{const tx=await this.provider.getTransaction(hash);if(tx!=null){resolve(tx.replaceableTransaction(blockNumber));return}this.provider._setTimeout(()=>{checkTx()},timeouts.pop()||4e3)};checkTx()})}async signTransaction(_tx){const tx=deepCopy(_tx);if(tx.from){const from=await resolveAddress(tx.from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from}else{tx.from=this.address}const hexTx=this.provider.getRpcTransaction(tx);return await this.provider.send("xcb_signTransaction",[hexTx])}async signMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("personal_sign",[hexlify(message),this.address.toLowerCase()])}async signTypedData(domain,types,_value){const value=deepCopy(_value);const populated=await TypedDataEncoder.resolveNames(domain,types,value,async value=>{const address=await resolveAddress(value);assertArgument(address!=null,"TypedData does not support null address","value",value);return address});return await this.provider.send("xcb_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(populated.domain,types,populated.value))])}async unlock(password){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),password,null])}async _legacySignMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("xcb_sign",[this.address.toLowerCase(),hexlify(message)])}}class JsonRpcApiProvider extends AbstractProvider{#options;#nextId;#payloads;#drainTimer;#notReady;#network;#scheduleDrain(){if(this.#drainTimer){return}const stallTime=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#drainTimer=setTimeout(()=>{this.#drainTimer=null;const payloads=this.#payloads;this.#payloads=[];while(payloads.length){const batch=[payloads.shift()];while(payloads.length){if(batch.length===this.#options.batchMaxCount){break}batch.push(payloads.shift());const bytes=JSON.stringify(batch.map(p=>p.payload));if(bytes.length>this.#options.batchMaxSize){payloads.unshift(batch.pop());break}}(async()=>{const payload=batch.length===1?batch[0].payload:batch.map(p=>p.payload);this.emit("debug",{action:"sendRpcPayload",payload:payload});try{const result=await this._send(payload);this.emit("debug",{action:"receiveRpcResult",result:result});for(const{resolve,reject,payload}of batch){const resp=result.filter(r=>r.id===payload.id)[0];if(resp==null){return reject(makeError("no response from server","BAD_DATA",{value:result,info:{payload:payload}}))}if("error"in resp){return reject(this.getRpcError(payload,resp))}resolve(resp.result)}}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});for(const{reject}of batch){reject(error)}}})()}},stallTime)}constructor(network,options){super(network);this.#nextId=1;this.#options=Object.assign({},defaultOptions,options||{});this.#payloads=[];this.#drainTimer=null;this.#network=null;{let resolve=null;const promise=new Promise(_resolve=>{resolve=_resolve});this.#notReady={promise:promise,resolve:resolve}}const staticNetwork=this._getOption("staticNetwork");if(staticNetwork){assertArgument(network==null||staticNetwork.matches(network),"staticNetwork MUST match network object","options",options);this.#network=staticNetwork}}_getOption(key){return this.#options[key]}get _network(){assert(this.#network,"network is not available yet","NETWORK_ERROR");return this.#network}async _perform(req){const request=this.getRpcRequest(req);if(request!=null){return await this.send(request.method,request.args)}return super._perform(req)}async _detectNetwork(){const network=this._getOption("staticNetwork");if(network){return network}if(this.ready){return Network.from(getBigInt(await this.send("xcb_networkId",[])))}const payload={id:this.#nextId++,method:"xcb_networkId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:payload});let result;try{result=(await this._send(payload))[0]}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});throw error}this.emit("debug",{action:"receiveRpcResult",result:result});if("result"in result){return Network.from(getBigInt(result.result))}throw this.getRpcError(payload,result)}_start(){if(this.#notReady==null||this.#notReady.resolve==null){return}this.#notReady.resolve();this.#notReady=null;(async()=>{while(this.#network==null){try{this.#network=await this._detectNetwork()}catch(error){console.log("JsonRpcProvider failed to startup; retry in 1s");await stall$3(1e3)}}this.#scheduleDrain()})()}async _waitUntilReady(){if(this.#notReady==null){return}return await this.#notReady.promise}_getSubscriber(sub){if(sub.type==="pending"){return new FilterIdPendingSubscriber(this)}if(sub.type==="event"){if(this._getOption("polling")){return new PollingEventSubscriber(this,sub.filter)}return new FilterIdEventSubscriber(this,sub.filter)}if(sub.type==="orphan"&&sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("orphan")}return super._getSubscriber(sub)}get ready(){return this.#notReady==null}getRpcTransaction(tx){const result={};["networkId","energyLimit","energyPrice","type","nonce","value"].forEach(key=>{if(tx[key]==null){return}let dstKey=key;if(key==="energyLimit"){dstKey="energy"}result[dstKey]=toQuantity(getBigInt(tx[key],`tx.${key}`))});["from","to","data"].forEach(key=>{if(tx[key]==null){return}result[key]=hexlify(tx[key])});return result}getRpcRequest(req){switch(req.method){case"networkId":return{method:"xcb_networkId",args:[]};case"getBlockNumber":return{method:"xcb_blockNumber",args:[]};case"getEnergyPrice":return{method:"xcb_energyPrice",args:[]};case"getBalance":{return{method:"xcb_getBalance",args:[getLowerCase(req.address),req.blockTag]}}case"getTransactionCount":return{method:"xcb_getTransactionCount",args:[getLowerCase(req.address),req.blockTag]};case"getCode":return{method:"xcb_getCode",args:[getLowerCase(req.address),req.blockTag]};case"getStorage":return{method:"xcb_getStorageAt",args:[getLowerCase(req.address),"0x"+req.position.toString(16),req.blockTag]};case"broadcastTransaction":return{method:"xcb_sendRawTransaction",args:[req.signedTransaction]};case"getBlock":if("blockTag"in req){return{method:"xcb_getBlockByNumber",args:[req.blockTag,!!req.includeTransactions]}}else if("blockHash"in req){return{method:"xcb_getBlockByHash",args:[req.blockHash,!!req.includeTransactions]}}break;case"getTransaction":return{method:"xcb_getTransactionByHash",args:[req.hash]};case"getTransactionReceipt":return{method:"xcb_getTransactionReceipt",args:[req.hash]};case"call":return{method:"xcb_call",args:[this.getRpcTransaction(req.transaction),req.blockTag]};case"estimateEnergy":{return{method:"xcb_estimateEnergy",args:[this.getRpcTransaction(req.transaction)]}}case"getLogs":if(req.filter&&req.filter.address!=null){if(Array.isArray(req.filter.address)){req.filter.address=req.filter.address.map(getLowerCase)}else{req.filter.address=getLowerCase(req.filter.address)}}return{method:"xcb_getLogs",args:[req.filter]}}return null}getRpcError(payload,_error){const{method}=payload;const{error}=_error;if(method==="xcb_estimateEnergy"&&error.message){const msg=error.message;if(!msg.match(/revert/i)&&msg.match(/insufficient funds/i)){return makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:payload.params[0],info:{payload:payload,error:error}})}}if(method==="xcb_call"||method==="xcb_estimateEnergy"){const result=spelunkData(error);const e=AbiCoder.getBuiltinCallException(method==="xcb_call"?"call":"estimateEnergy",payload.params[0],result?result.data:null);e.info={error:error,payload:payload};return e}const message=JSON.stringify(spelunkMessage(error));if(typeof error.message==="string"&&error.message.match(/user denied|corebc-user-denied/i)){const actionMap={xcb_sign:"signMessage",personal_sign:"signMessage",xcb_signTypedData_v4:"signTypedData",xcb_signTransaction:"signTransaction",xcb_sendTransaction:"sendTransaction",xcb_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return makeError(`user rejected action`,"ACTION_REJECTED",{action:actionMap[method]||"unknown",reason:"rejected",info:{payload:payload,error:error}})}if(method==="xcb_sendRawTransaction"||method==="xcb_sendTransaction"){const transaction=payload.params[0];if(message.match(/insufficient funds|base fee exceeds energy limit/i)){return makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction,info:{error:error}})}if(message.match(/nonce/i)&&message.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:transaction,info:{error:error}})}if(message.match(/replacement transaction/i)&&message.match(/underpriced/i)){return makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction,info:{error:error}})}if(message.match(/only replay-protected/i)){return makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:method,info:{transaction:transaction,info:{error:error}}})}}if(message.match(/the method .* does not exist/i)){return makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:payload.method,info:{error:error}})}return makeError("could not coalesce error","UNKNOWN_ERROR",{error:error})}send(method,params){const id=this.#nextId++;const promise=new Promise((resolve,reject)=>{this.#payloads.push({resolve:resolve,reject:reject,payload:{method:method,params:params,id:id,jsonrpc:"2.0"}})});this.#scheduleDrain();return promise}async getSigner(address){if(address==null){address=0}const accountsPromise=this.send("xcb_accounts",[]);if(typeof address==="number"){const accounts=await accountsPromise;if(address>=accounts.length){throw new Error("no such account")}return new JsonRpcSigner(this,accounts[address])}const{accounts}=await resolveProperties({network:this.getNetwork(),accounts:accountsPromise});address=getAddress(address);for(const account of accounts){if(getAddress(account)===address){return new JsonRpcSigner(this,address)}}throw new Error("invalid account")}async listAccounts(){const accounts=await this.send("xcb_accounts",[]);return accounts.map(a=>new JsonRpcSigner(this,a))}}class JsonRpcApiPollingProvider extends JsonRpcApiProvider{#pollingInterval;constructor(network,options){super(network,options);this.#pollingInterval=4e3}_getSubscriber(sub){const subscriber=super._getSubscriber(sub);if(isPollable(subscriber)){subscriber.pollingInterval=this.#pollingInterval}return subscriber}get pollingInterval(){return this.#pollingInterval}set pollingInterval(value){if(!Number.isInteger(value)||value<0){throw new Error("invalid interval")}this.#pollingInterval=value;this._forEachSubscriber(sub=>{if(isPollable(sub)){sub.pollingInterval=this.#pollingInterval}})}}class JsonRpcProvider extends JsonRpcApiPollingProvider{#connect;constructor(url,network,options){if(url==null){url="http://localhost:8545"}super(network,options);if(typeof url==="string"){this.#connect=new FetchRequest(url)}else{this.#connect=url.clone()}}_getConnection(){return this.#connect.clone()}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){const request=this._getConnection();request.body=JSON.stringify(payload);request.setHeader("content-type","application/json");const response=await request.send();response.assertOk();let resp=response.bodyJson;if(!Array.isArray(resp)){resp=[resp]}return resp}}function spelunkData(value){if(value==null){return null}if(typeof value.message==="string"&&value.message.match("reverted")&&isHexString(value.data)){return{message:value.message,data:value.data}}if(typeof value==="object"){for(const key in value){const result=spelunkData(value[key]);if(result){return result}}return null}if(typeof value==="string"){try{return spelunkData(JSON.parse(value))}catch(error){}}return null}function _spelunkMessage(value,result){if(value==null){return}if(typeof value.message==="string"){result.push(value.message)}if(typeof value==="object"){for(const key in value){_spelunkMessage(value[key],result)}}if(typeof value==="string"){try{return _spelunkMessage(JSON.parse(value),result)}catch(error){}}}function spelunkMessage(value){const result=[];_spelunkMessage(value,result);return result}const defaultApiKey$1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function getHost$4(name){switch(name){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/xcb_goerli";case"matic":return"rpc.ankr.com/polygon";case"arbitrum":return"rpc.ankr.com/arbitrum"}assertArgument(false,"unsupported network","network",name)}class AnkrProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey$1}const options={polling:true,staticNetwork:network};const request=AnkrProvider.getRequest(network,apiKey);super(request,network,options);defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AnkrProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey$1}const request=new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey$1){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("AnkrProvider");return true}}return request}getRpcError(payload,error){if(payload.method==="xcb_sendRawTransaction"){if(error&&error.error&&error.error.message==="INTERNAL_ERROR: could not replace existing tx"){error.error.message="replacement transaction underpriced"}}return super.getRpcError(payload,error)}isCommunityResource(){return this.apiKey===defaultApiKey$1}}const defaultApiKey="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function getHost$3(name){switch(name){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com"}assertArgument(false,"unsupported network","network",name)}class AlchemyProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey}const request=AlchemyProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AlchemyProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}async _perform(req){if(req.method==="getTransactionResult"){const{trace,tx}=await resolveProperties({trace:this.send("trace_transaction",[req.hash]),tx:this.getTransaction(req.hash)});if(trace==null||tx==null){return null}let data;let error=false;try{data=trace[0].result.output;error=trace[0].error==="Reverted"}catch(error){}if(data){assert(!error,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:data,reason:null,transaction:tx,invocation:null,revert:null});return data}assert(false,"could not parse trace result","BAD_DATA",{value:trace})}return await super._perform(req)}isCommunityResource(){return this.apiKey===defaultApiKey}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey}const request=new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("alchemy");return true}}return request}}class CloudflareProvider extends JsonRpcProvider{constructor(_network){if(_network==null){_network="mainnet"}const network=Network.from(_network);assertArgument(network.name==="mainnet","unsupported network","network",_network);super("https://cloudflare-eth.com/",network,{staticNetwork:network})}}function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const _WebSocket=getGlobal().WebSocket;class SocketSubscriber{#provider;#filter;get filter(){return JSON.parse(this.#filter)}#filterId;#paused;#emitPromise;constructor(provider,filter){this.#provider=provider;this.#filter=JSON.stringify(filter);this.#filterId=null;this.#paused=null;this.#emitPromise=null}start(){this.#filterId=this.#provider.send("xcb_subscribe",this.filter).then(filterId=>{this.#provider._register(filterId,this);return filterId})}stop(){this.#filterId.then(filterId=>{this.#provider.send("xcb_unsubscribe",[filterId])});this.#filterId=null}pause(dropWhilePaused){assert(dropWhilePaused,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"});this.#paused=!!dropWhilePaused}resume(){this.#paused=null}_handleMessage(message){if(this.#filterId==null){return}if(this.#paused===null){let emitPromise=this.#emitPromise;if(emitPromise==null){emitPromise=this._emit(this.#provider,message)}else{emitPromise=emitPromise.then(async()=>{await this._emit(this.#provider,message)})}this.#emitPromise=emitPromise.then(()=>{if(this.#emitPromise===emitPromise){this.#emitPromise=null}})}}async _emit(provider,message){throw new Error("sub-classes must implemente this; _emit")}}class SocketBlockSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newHeads"])}async _emit(provider,message){provider.emit("block",parseInt(message.number))}}class SocketPendingSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newPendingTransactions"])}async _emit(provider,message){provider.emit("pending",message)}}class SocketEventSubscriber extends SocketSubscriber{#logFilter;get logFilter(){return JSON.parse(this.#logFilter)}constructor(provider,filter){super(provider,["logs",filter]);this.#logFilter=JSON.stringify(filter)}async _emit(provider,message){provider.emit(this.logFilter,provider._wrapLog(message,provider._network))}}class SocketProvider extends JsonRpcApiProvider{#callbacks;#subs;#pending;constructor(network){super(network,{batchMaxCount:1});this.#callbacks=new Map;this.#subs=new Map;this.#pending=new Map}_getSubscriber(sub){switch(sub.type){case"close":return new UnmanagedSubscriber("close");case"block":return new SocketBlockSubscriber(this);case"pending":return new SocketPendingSubscriber(this);case"event":return new SocketEventSubscriber(this,sub.filter);case"orphan":if(sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("drop-log")}}return super._getSubscriber(sub)}_register(filterId,subscriber){this.#subs.set(filterId,subscriber);const pending=this.#pending.get(filterId);if(pending){for(const message of pending){subscriber._handleMessage(message)}this.#pending.delete(filterId)}}async _send(payload){assertArgument(!Array.isArray(payload),"WebSocket does not support batch send","payload",payload);const promise=new Promise((resolve,reject)=>{this.#callbacks.set(payload.id,{payload:payload,resolve:resolve,reject:reject})});await this._waitUntilReady();await this._write(JSON.stringify(payload));return[await promise]}async _processMessage(message){const result=JSON.parse(message);if("id"in result){const callback=this.#callbacks.get(result.id);if(callback==null){this.emit("error",makeError("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:result}));return}this.#callbacks.delete(result.id);callback.resolve(result)}else if(result.method==="xcb_subscription"){const filterId=result.params.subscription;const subscriber=this.#subs.get(filterId);if(subscriber){subscriber._handleMessage(result.params.result)}else{let pending=this.#pending.get(filterId);if(pending==null){pending=[];this.#pending.set(filterId,pending)}pending.push(result.params.result)}}}async _write(message){throw new Error("sub-classes must override this")}}class WebSocketProvider extends SocketProvider{#connect;#websocket;get websocket(){if(this.#websocket==null){throw new Error("websocket closed")}return this.#websocket}constructor(url,network){super(network);if(typeof url==="string"){this.#connect=()=>{return new _WebSocket(url)};this.#websocket=this.#connect()}else if(typeof url==="function"){this.#connect=url;this.#websocket=url()}else{this.#connect=null;this.#websocket=url}this.websocket.onopen=async()=>{try{await this._start();this.resume()}catch(error){console.log("failed to start WebsocketProvider",error)}};this.websocket.onmessage=message=>{this._processMessage(message.data)}}async _write(message){this.websocket.send(message)}async destroy(){if(this.#websocket!=null){this.#websocket.close();this.#websocket=null}super.destroy()}}const defaultProjectId="84842078b09946638c03157f83405213";function getHost$2(name){switch(name){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io"}assertArgument(false,"unsupported network","network",name)}class InfuraWebSocketProvider extends WebSocketProvider{projectId;projectSecret;constructor(network,projectId){const provider=new InfuraProvider(network,projectId);const req=provider._getConnection();assert(!req.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const url=req.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(url,network);defineProperties(this,{projectId:provider.projectId,projectSecret:provider.projectSecret})}isCommunityResource(){return this.projectId===defaultProjectId}}class InfuraProvider extends JsonRpcProvider{projectId;projectSecret;constructor(_network,projectId,projectSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=InfuraProvider.getRequest(network,projectId,projectSecret);super(request,network,{staticNetwork:network});defineProperties(this,{projectId:projectId,projectSecret:projectSecret})}_getProvider(networkId){try{return new InfuraProvider(networkId,this.projectId,this.projectSecret)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.projectId===defaultProjectId}static getWebSocketProvider(network,projectId){return new InfuraWebSocketProvider(network,projectId)}static getRequest(network,projectId,projectSecret){if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`);request.allowGzip=true;if(projectSecret){request.setCredentials("",projectSecret)}if(projectId===defaultProjectId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("InfuraProvider");return true}}return request}}const defaultToken="919b412a057b5e9c9b6dce193c5a60242d6efadb";function getHost$1(name){switch(name){case"mainnet":return"corebc.quiknode.pro";case"arbitrum":return"corebc.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"corebc.arbitrum-goerli.quiknode.pro";case"matic":return"corebc.matic.quiknode.pro";case"matic-mumbai":return"corebc.matic-testnet.quiknode.pro";case"optimism":return"corebc.optimism.quiknode.pro";case"optimism-goerli":return"corebc.optimism-goerli.quiknode.pro"}assertArgument(false,"unsupported network","network",name)}class QuickNodeProvider extends JsonRpcProvider{token;constructor(_network,token){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(token==null){token=defaultToken}const request=QuickNodeProvider.getRequest(network,token);super(request,network,{staticNetwork:network});defineProperties(this,{token:token})}_getProvider(networkId){try{return new QuickNodeProvider(networkId,this.token)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.token===defaultToken}static getRequest(network,token){if(token==null){token=defaultToken}const request=new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`);request.allowGzip=true;if(token===defaultToken){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("QuickNodeProvider");return true}}return request}}const BN_1=BigInt("1");const BN_2=BigInt("2");function shuffle(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));const tmp=array[i];array[i]=array[j];array[j]=tmp}}function stall$2(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getTime(){return(new Date).getTime()}function stringify(value){return JSON.stringify(value,(key,value)=>{if(typeof value==="bigint"){return{type:"bigint",value:value.toString()}}return value})}const defaultConfig={stallTimeout:400,priority:1,weight:1};const defaultState={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0};async function waitForSync(config,blockNumber){while(config.blockNumber<0||config.blockNumber{const blockNumber=await config.provider.getBlockNumber();if(blockNumber>config.blockNumber){config.blockNumber=blockNumber}config._updateNumber=null})()}await config._updateNumber;config.outOfSync++}}function _normalize(value){if(value==null){return"null"}if(Array.isArray(value)){return"["+value.map(_normalize).join(",")+"]"}if(typeof value==="object"&&typeof value.toJSON==="function"){return _normalize(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":case"number":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{"+keys.map(k=>`${JSON.stringify(k)}:${_normalize(value[k])}`).join(",")+"}"}}console.log("Could not serialize",value);throw new Error("Hmm...")}function normalizeResult(value){if("error"in value){const error=value.error;return{tag:_normalize(error),value:error}}const result=value.result;return{tag:_normalize(result),value:result}}function checkQuorum(quorum,results){const tally=new Map;for(const{value,tag,weight}of results){const t=tally.get(tag)||{value:value,weight:0};t.weight+=weight;tally.set(tag,t)}let best=null;for(const r of tally.values()){if(r.weight>=quorum&&(!best||r.weight>best.weight)){best=r}}if(best){return best.value}return undefined}function getMedian(quorum,results){let resultWeight=0;const errorMap=new Map;let bestError=null;const values=[];for(const{value,tag,weight}of results){if(value instanceof Error){const e=errorMap.get(tag)||{value:value,weight:0};e.weight+=weight;errorMap.set(tag,e);if(bestError==null||e.weight>bestError.weight){bestError=e}}else{values.push(BigInt(value));resultWeight+=weight}}if(resultWeight=quorum){return bestError.value}return undefined}values.sort((a,b)=>aa?1:0);const mid=Math.floor(values.length/2);if(values.length%2){return values[mid]}return(values[mid-1]+values[mid]+BN_1)/BN_2}function getAnyResult(quorum,results){const result=checkQuorum(quorum,results);if(result!==undefined){return result}for(const r of results){if(r.value){return r.value}}return undefined}function getFuzzyMode(quorum,results){if(quorum===1){return getNumber(getMedian(quorum,results),"%internal")}const tally=new Map;const add=(result,weight)=>{const t=tally.get(result)||{result:result,weight:0};t.weight+=weight;tally.set(result,t)};for(const{weight,value}of results){const r=getNumber(value);add(r-1,weight);add(r,weight);add(r+1,weight)}let bestWeight=0;let bestResult=undefined;for(const{weight,result}of tally.values()){if(weight>=quorum&&(weight>bestWeight||bestResult!=null&&weight===bestWeight&&result>bestResult)){bestWeight=weight;bestResult=result}}return bestResult}class FallbackProvider extends AbstractProvider{quorum;eventQuorum;eventWorkers;#configs;#height;#initialSyncPromise;constructor(providers,network){super(network);this.#configs=providers.map(p=>{if(p instanceof AbstractProvider){return Object.assign({provider:p},defaultConfig,defaultState)}else{return Object.assign({},defaultConfig,p,defaultState)}});this.#height=-2;this.#initialSyncPromise=null;this.quorum=2;this.eventQuorum=1;this.eventWorkers=1;assertArgument(this.quorum<=this.#configs.reduce((a,c)=>a+c.weight,0),"quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return this.#configs.map(c=>{const result=Object.assign({},c);for(const key in result){if(key[0]==="_"){delete result[key]}}return result})}async _detectNetwork(){return Network.from(getBigInt(await this._perform({method:"networkId"})))}async _translatePerform(provider,req){switch(req.method){case"broadcastTransaction":return await provider.broadcastTransaction(req.signedTransaction);case"call":return await provider.call(Object.assign({},req.transaction,{blockTag:req.blockTag}));case"networkId":return(await provider.getNetwork()).networkId;case"estimateEnergy":return await provider.estimateEnergy(req.transaction);case"getBalance":return await provider.getBalance(req.address,req.blockTag);case"getBlock":{const block="blockHash"in req?req.blockHash:req.blockTag;return await provider.getBlock(block,req.includeTransactions)}case"getBlockNumber":return await provider.getBlockNumber();case"getCode":return await provider.getCode(req.address,req.blockTag);case"getEnergyPrice":return(await provider.getFeeData()).energyPrice;case"getLogs":return await provider.getLogs(req.filter);case"getStorage":return await provider.getStorage(req.address,req.position,req.blockTag);case"getTransaction":return await provider.getTransaction(req.hash);case"getTransactionCount":return await provider.getTransactionCount(req.address,req.blockTag);case"getTransactionReceipt":return await provider.getTransactionReceipt(req.hash);case"getTransactionResult":return await provider.getTransactionResult(req.hash)}}#getNextConfig(running){const configs=Array.from(running).map(r=>r.config);const allConfigs=this.#configs.slice();shuffle(allConfigs);allConfigs.sort((a,b)=>b.priority-a.priority);for(const config of allConfigs){if(configs.indexOf(config)===-1){return config}}return null}#addRunner(running,req){const config=this.#getNextConfig(running);if(config==null){return null}const runner={config:config,result:null,didBump:false,perform:null,staller:null};const now=getTime();runner.perform=(async()=>{try{config.requests++;const result=await this._translatePerform(config.provider,req);runner.result={result:result}}catch(error){config.errorResponses++;runner.result={error:error}}const dt=getTime()-now;config._totalTime+=dt;config.rollingDuration=.95*config.rollingDuration+.05*dt;runner.perform=null})();runner.staller=(async()=>{await stall$2(config.stallTimeout);runner.staller=null})();running.add(runner);return runner}async#initialSync(){let initialSync=this.#initialSyncPromise;if(!initialSync){const promises=[];this.#configs.forEach(config=>{promises.push(waitForSync(config,0));promises.push((async()=>{config._network=await config.provider.getNetwork()})())});this.#initialSyncPromise=initialSync=(async()=>{await Promise.all(promises);let networkId=null;for(const config of this.#configs){const network=config._network;if(networkId==null){networkId=network.networkId}else if(network.networkId!==networkId){assert(false,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}}})()}await initialSync}async#checkQuorum(running,req){const results=[];for(const runner of running){if(runner.result!=null){const{tag,value}=normalizeResult(runner.result);results.push({tag:tag,value:value,weight:runner.config.weight})}}if(results.reduce((a,r)=>a+r.weight,0)({value:c.blockNumber,tag:getNumber(c.blockNumber).toString(),weight:c.weight})))))}const mode=getFuzzyMode(this.quorum,results);if(mode===undefined){return undefined}if(mode>this.#height){this.#height=mode}return this.#height}case"getEnergyPrice":case"estimateEnergy":return getMedian(this.quorum,results);case"getBlock":if("blockTag"in req&&req.blockTag==="pending"){return getAnyResult(this.quorum,results)}return checkQuorum(this.quorum,results);case"call":case"networkId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return checkQuorum(this.quorum,results);case"broadcastTransaction":return getAnyResult(this.quorum,results)}assert(false,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${stringify(req.method)})`})}async#waitForQuorum(running,req){if(running.size===0){throw new Error("no runners?!")}const interesting=[];let newRunners=0;for(const runner of running){if(runner.perform){interesting.push(runner.perform)}if(runner.staller){interesting.push(runner.staller);continue}if(runner.didBump){continue}runner.didBump=true;newRunners++}const value=await this.#checkQuorum(running,req);if(value!==undefined){if(value instanceof Error){throw value}return value}for(let i=0;i0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:Array.from(running).map(r=>stringify(r.result))}});await Promise.race(interesting);return await this.#waitForQuorum(running,req)}async _perform(req){if(req.method==="broadcastTransaction"){const results=await Promise.all(this.#configs.map(async({provider,weight})=>{try{const result=await provider._perform(req);return Object.assign(normalizeResult({result:result}),{weight:weight})}catch(error){return Object.assign(normalizeResult({error:error}),{weight:weight})}}));const result=getAnyResult(this.quorum,results);assert(result!==undefined,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:results.map(stringify)}});if(result instanceof Error){throw result}return result}await this.#initialSync();const running=new Set;for(let i=0;i{const payload={method:method,params:params};this.emit("debug",{action:"sendEip1193Request",payload:payload});try{const result=await core.request(payload);this.emit("debug",{action:"receiveEip1193Result",result:result});return result}catch(e){const error=new Error(e.message);error.code=e.code;error.data=e.data;error.payload=payload;this.emit("debug",{action:"receiveEip1193Error",error:error});throw error}}}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){assertArgument(!Array.isArray(payload),"EIP-1193 does not support batch request","payload",payload);try{const result=await this.#request(payload.method,payload.params||[]);return[{id:payload.id,result:result}]}catch(e){return[{id:payload.id,error:{code:e.code,data:e.data,message:e.message}}]}}getRpcError(payload,error){error=JSON.parse(JSON.stringify(error));switch(error.error.code||-1){case 4001:error.error.message=`corebc-user-denied: ${error.error.message}`;break;case 4200:error.error.message=`corebc-unsupported: ${error.error.message}`;break}return super.getRpcError(payload,error)}async hasSigner(address){if(address==null){address=0}const accounts=await this.send("xcb_accounts",[]);if(typeof address==="number"){return accounts.length>address}address=address.toLowerCase();return accounts.filter(a=>a.toLowerCase()===address).length!==0}async getSigner(address){if(address==null){address=0}if(!await this.hasSigner(address)){try{await this.#request("xcb_requestAccounts",[])}catch(error){const payload=error.payload;throw this.getRpcError(payload,{id:payload.id,error:error})}}return await super.getSigner(address)}}const defaultApplicationId="62e1ad51b37b8e00394bda3b";function getHost(name){switch(name){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}assertArgument(false,"unsupported network","network",name)}class PocketProvider extends JsonRpcProvider{applicationId;applicationSecret;constructor(_network,applicationId,applicationSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(applicationId==null){applicationId=defaultApplicationId}if(applicationSecret==null){applicationSecret=null}const options={staticNetwork:network};const request=PocketProvider.getRequest(network,applicationId,applicationSecret);super(request,network,options);defineProperties(this,{applicationId:applicationId,applicationSecret:applicationSecret})}_getProvider(networkId){try{return new PocketProvider(networkId,this.applicationId,this.applicationSecret)}catch(error){}return super._getProvider(networkId)}static getRequest(network,applicationId,applicationSecret){if(applicationId==null){applicationId=defaultApplicationId}const request=new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`);request.allowGzip=true;if(applicationSecret){request.setCredentials("",applicationSecret)}if(applicationId===defaultApplicationId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("PocketProvider");return true}}return request}isCommunityResource(){return this.applicationId===defaultApplicationId}}const IpcSocketProvider=undefined;class BaseWallet extends AbstractSigner{address;prefix;#signingKey;constructor({signingKey,prefix,provider}){super(provider);this.prefix=prefix;assertArgument(signingKey&&typeof signingKey.sign==="function","invalid signingKey key","signingKey","[ REDACTED ]");this.#signingKey=signingKey;const address=computeAddress(this.#signingKey,prefix);defineProperties(this,{address:address})}get signingKey(){return this.#signingKey}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(provider){return new BaseWallet({signingKey:this.#signingKey,prefix:this.prefix,provider:provider})}async signTransaction(tx){const{to,from}=await resolveProperties({to:tx.to||undefined,from:tx.from||undefined});if(to!=null){tx.to=to}if(from!=null){tx.from=from}if(tx.from!=null){assertArgument(getAddress(tx.from)===this.address,"transaction from address mismatch","tx.from",tx.from);delete tx.from}const btx=Transaction.from(tx);const unSignedSerialized=btx.unsignedSerialized;const unsignedHash=sha256(unSignedSerialized);btx.signature=this.signingKey.sign(unsignedHash);return btx.serialized}async signMessage(message){return this.signMessageSync(message)}signMessageSync(message){return this.signingKey.sign(hashMessage(message))}async signTypedData(domain,types,value){const populated=await TypedDataEncoder.resolveNames(domain,types,value,async name=>{assert(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:name}});const address=getAddress(name);assert(address!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:name});return address});return this.signingKey.sign(TypedDataEncoder.hash(populated.domain,types,populated.value))}}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}static check(wordlist){const words=[];for(let i=0;i<2048;i++){const word=wordlist.getWord(i);if(i!==wordlist.getWordIndex(word)){return"0x"}words.push(word)}return id(words.join("\n")+"\n")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n",true);if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value)}return output}function checkScalarValue(codePoint){if(codePoint>=55296&&codePoint<=57343){throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value")}}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint){if((codePoint&4294967168)==0){return stringFromCharCode(codePoint)}var symbol="";if((codePoint&4294965248)==0){symbol=stringFromCharCode(codePoint>>6&31|192)}else if((codePoint&4294901760)==0){checkScalarValue(codePoint);symbol=stringFromCharCode(codePoint>>12&15|224);symbol+=createByte(codePoint,6)}else if((codePoint&4292870144)==0){symbol=stringFromCharCode(codePoint>>18&7|240);symbol+=createByte(codePoint,12);symbol+=createByte(codePoint,6)}symbol+=stringFromCharCode(codePoint&63|128);return symbol}function utf8encode(string){var codePoints=ucs2decode(string);var length=codePoints.length;var index=-1;var codePoint;var byteString="";while(++index=byteCount){throw Error("Invalid byte index")}var continuationByte=byteArray[byteIndex]&255;byteIndex++;if((continuationByte&192)==128){return continuationByte&63}throw Error("Invalid continuation byte")}function decodeSymbol(){var byte1;var byte2;var byte3;var byte4;var codePoint;if(byteIndex>byteCount){throw Error("Invalid byte index")}if(byteIndex==byteCount){return false}byte1=byteArray[byteIndex]&255;byteIndex++;if((byte1&128)==0){return byte1}if((byte1&224)==192){byte2=readContinuationByte();codePoint=(byte1&31)<<6|byte2;if(codePoint>=128){return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&240)==224){byte2=readContinuationByte();byte3=readContinuationByte();codePoint=(byte1&15)<<12|byte2<<6|byte3;if(codePoint>=2048){checkScalarValue(codePoint);return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&248)==240){byte2=readContinuationByte();byte3=readContinuationByte();byte4=readContinuationByte();codePoint=(byte1&7)<<18|byte2<<12|byte3<<6|byte4;if(codePoint>=65536&&codePoint<=1114111){return codePoint}}throw Error("Invalid UTF-8 detected")}var byteArray;var byteCount;var byteIndex;function utf8decode(byteString){byteArray=ucs2decode(byteString);byteCount=byteArray.length;byteIndex=0;var codePoints=[];var tmp;while((tmp=decodeSymbol())!==false){codePoints.push(tmp)}return ucs2encode(codePoints)}root.version="3.0.0";root.encode=utf8encode;root.decode=utf8decode})(exports)})(utf8$1);return utf8$1}var utf8Exports=requireUtf8();var utf8=getDefaultExportFromCjs(utf8Exports);function mnemonicToSeed(mnemonic,password){if(!password){password=""}const t=generateSeed(mnemonic,password);return t.goldilock}const generateSeed=(mnemonic,password)=>{const goldilockSaltPrefix="mnemonic";const aesSaltPrefix="mnemonicfortheAESkey";const goldilockSalt=utf8.encode(goldilockSaltPrefix+password);const aesSalt=utf8.encode(aesSaltPrefix+password);const goldilockKey=pbkdf2Sync(bufferExports.Buffer.from(mnemonic),bufferExports.Buffer.from(goldilockSalt),2048,64,"sha512");const aesKeySeed=pbkdf2Sync(bufferExports.Buffer.from(mnemonic),bufferExports.Buffer.from(aesSalt),2048,64,"sha512");return{aes:bufferExports.Buffer.from(aesKeySeed).toString("hex"),goldilock:bufferExports.Buffer.from(goldilockKey).toString("hex")}};function getUpperMask(bits){return(1<=12&&words.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const entropy=new Uint8Array(Math.ceil(11*words.length/8));let offset=0;for(let i=0;i=0,`invalid mnemonic word at index ${i}`,"mnemonic","[ REDACTED ]");for(let bit=0;bit<11;bit++){if(index&1<<10-bit){entropy[offset>>3]|=1<<7-offset%8}offset++}}const entropyBits=32*words.length/3;const checksumBits=words.length/3;const checksumMask=getUpperMask(checksumBits);const checksum=getBytes(legacySha256(entropy.slice(0,entropyBits/8)))[0]&checksumMask;assertArgument(checksum===(entropy[entropy.length-1]&checksumMask),"invalid mnemonic checksum","mnemonic","[ REDACTED ]");return hexlify(entropy.slice(0,entropyBits/8))}function entropyToMnemonic(entropy,wordlist){assertArgument(entropy.length%4===0&&entropy.length>=16&&entropy.length<=32,"invalid entropy size","entropy","[ REDACTED ]");if(wordlist==null){wordlist=LangEn.wordlist()}const indices=[0];let remainingBits=11;for(let i=0;i8){indices[indices.length-1]<<=8;indices[indices.length-1]|=entropy[i];remainingBits-=8}else{indices[indices.length-1]<<=remainingBits;indices[indices.length-1]|=entropy[i]>>8-remainingBits;indices.push(entropy[i]&getLowerMask(8-remainingBits));remainingBits+=3}}const checksumBits=entropy.length/4;const checksum=parseInt(legacySha256(entropy).substring(2,4),16)&getUpperMask(checksumBits);indices[indices.length-1]<<=checksumBits;indices[indices.length-1]|=checksum>>8-checksumBits;return wordlist.join(indices.map(index=>wordlist.getWord(index)))}const _guard$1={};class Mnemonic{phrase;password;wordlist;entropy;constructor(guard,entropy,phrase,password,wordlist){if(password==null){password=""}if(wordlist==null){wordlist=LangEn.wordlist()}assertPrivate(guard,_guard$1,"Mnemonic");defineProperties(this,{phrase:phrase,password:password,wordlist:wordlist,entropy:entropy})}computeSeed(){return mnemonicToSeed(this.phrase,this.password)}static fromPhrase({phrase,password,wordlist}){const entropy=mnemonicToEntropy(phrase,wordlist);phrase=entropyToMnemonic(getBytes(entropy),wordlist);return new Mnemonic(_guard$1,entropy,phrase,password,wordlist)}static fromEntropy(_entropy,password,wordlist){const entropy=getBytes(_entropy,"entropy");const phrase=entropyToMnemonic(entropy,wordlist);return new Mnemonic(_guard$1,hexlify(entropy),phrase,password,wordlist)}static entropyToPhrase(_entropy,wordlist){const entropy=getBytes(_entropy,"entropy");return entropyToMnemonic(entropy,wordlist)}static phraseToEntropy(phrase,wordlist){return mnemonicToEntropy(phrase,wordlist)}static isValidMnemonic(phrase,wordlist){try{mnemonicToEntropy(phrase,wordlist);return true}catch(error){}return false}}var aesJs={exports:{}};var hasRequiredAesJs;function requireAesJs(){if(hasRequiredAesJs)return aesJs.exports;hasRequiredAesJs=1;(function(module,exports){(function(root){function checkInt(value){return parseInt(value)===value}function checkInts(arrayish){if(!checkInt(arrayish.length)){return false}for(var i=0;i255){return false}}return true}function coerceArray(arg,copy){if(arg.buffer&&arg.name==="Uint8Array"){if(copy){if(arg.slice){arg=arg.slice()}else{arg=Array.prototype.slice.call(arg)}}return arg}if(Array.isArray(arg)){if(!checkInts(arg)){throw new Error("Array contains invalid value: "+arg)}return new Uint8Array(arg)}if(checkInt(arg.length)&&checkInts(arg)){return new Uint8Array(arg)}throw new Error("unsupported array-like object")}function createArray(length){return new Uint8Array(length)}function copyArray(sourceArray,targetArray,targetStart,sourceStart,sourceEnd){if(sourceStart!=null||sourceEnd!=null){if(sourceArray.slice){sourceArray=sourceArray.slice(sourceStart,sourceEnd)}else{sourceArray=Array.prototype.slice.call(sourceArray,sourceStart,sourceEnd)}}targetArray.set(sourceArray,targetStart)}var convertUtf8=function(){function toBytes(text){var result=[],i=0;text=encodeURI(text);while(i191&&c<224){result.push(String.fromCharCode((c&31)<<6|bytes[i+1]&63));i+=2}else{result.push(String.fromCharCode((c&15)<<12|(bytes[i+1]&63)<<6|bytes[i+2]&63));i+=3}}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var convertHex=function(){function toBytes(text){var result=[];for(var i=0;i>4]+Hex[v&15])}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var numberOfRounds={16:10,24:12,32:14};var rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];var S=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];var Si=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];var T1=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986];var T2=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766];var T3=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126];var T4=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436];var T5=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890];var T6=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935];var T7=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600];var T8=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480];var U1=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795];var U2=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855];var U3=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150];var U4=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(bytes){var result=[];for(var i=0;i>2;this._Ke[index][i%4]=tk[i];this._Kd[rounds-index][i%4]=tk[i]}var rconpointer=0;var t=KC,tt;while(t>16&255]<<24^S[tt>>8&255]<<16^S[tt&255]<<8^S[tt>>24&255]^rcon[rconpointer]<<24;rconpointer+=1;if(KC!=8){for(var i=1;i>8&255]<<8^S[tt>>16&255]<<16^S[tt>>24&255]<<24;for(var i=KC/2+1;i>2;c=t%4;this._Ke[r][c]=tk[i];this._Kd[rounds-r][c]=tk[i++];t++}}for(var r=1;r>24&255]^U2[tt>>16&255]^U3[tt>>8&255]^U4[tt&255]}}};AES.prototype.encrypt=function(plaintext){if(plaintext.length!=16){throw new Error("invalid plaintext size (must be 16 bytes)")}var rounds=this._Ke.length-1;var a=[0,0,0,0];var t=convertToInt32(plaintext);for(var i=0;i<4;i++){t[i]^=this._Ke[0][i]}for(var r=1;r>24&255]^T2[t[(i+1)%4]>>16&255]^T3[t[(i+2)%4]>>8&255]^T4[t[(i+3)%4]&255]^this._Ke[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Ke[rounds][i];result[4*i]=(S[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(S[t[(i+1)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(S[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(S[t[(i+3)%4]&255]^tt)&255}return result};AES.prototype.decrypt=function(ciphertext){if(ciphertext.length!=16){throw new Error("invalid ciphertext size (must be 16 bytes)")}var rounds=this._Kd.length-1;var a=[0,0,0,0];var t=convertToInt32(ciphertext);for(var i=0;i<4;i++){t[i]^=this._Kd[0][i]}for(var r=1;r>24&255]^T6[t[(i+3)%4]>>16&255]^T7[t[(i+2)%4]>>8&255]^T8[t[(i+1)%4]&255]^this._Kd[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Kd[rounds][i];result[4*i]=(Si[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(Si[t[(i+3)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(Si[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(Si[t[(i+1)%4]&255]^tt)&255}return result};var ModeOfOperationECB=function(key){if(!(this instanceof ModeOfOperationECB)){throw Error("AES must be instanitated with `new`")}this.description="Electronic Code Block";this.name="ecb";this._aes=new AES(key)};ModeOfOperationECB.prototype.encrypt=function(plaintext){plaintext=coerceArray(plaintext);if(plaintext.length%16!==0){throw new Error("invalid plaintext size (must be multiple of 16 bytes)")}var ciphertext=createArray(plaintext.length);var block=createArray(16);for(var i=0;iNumber.MAX_SAFE_INTEGER){throw new Error("integer value out of safe range")}for(var index=15;index>=0;--index){this._counter[index]=value%256;value=parseInt(value/256)}};Counter.prototype.setBytes=function(bytes){bytes=coerceArray(bytes,true);if(bytes.length!=16){throw new Error("invalid counter bytes size (must be 16 bytes)")}this._counter=bytes};Counter.prototype.increment=function(){for(var i=15;i>=0;i--){if(this._counter[i]===255){this._counter[i]=0}else{this._counter[i]++;break}}};var ModeOfOperationCTR=function(key,counter){if(!(this instanceof ModeOfOperationCTR)){throw Error("AES must be instanitated with `new`")}this.description="Counter";this.name="ctr";if(!(counter instanceof Counter)){counter=new Counter(counter)}this._counter=counter;this._remainingCounter=null;this._remainingCounterIndex=16;this._aes=new AES(key)};ModeOfOperationCTR.prototype.encrypt=function(plaintext){var encrypted=coerceArray(plaintext,true);for(var i=0;i16){throw new Error("PKCS#7 padding byte out of range")}var length=data.length-padder;for(var i=0;i1&&N<=1048576&&(N&N-1)===0,"unsafe scrypt N","kdf.N",N);assertArgument(Number.isSafeInteger(r)&&Number.isSafeInteger(p)&&r>0&&p>0&&r*p<=1048576&&128*N*r<=256*1024*1024,"unsafe scrypt work or memory requirement","kdf",{N:N,r:r,p:p})}function getDecryptKdfParams(data){const kdf=spelunk(data,"crypto.kdf:string");if(kdf&&typeof kdf==="string"){if(kdf.toLowerCase()==="scrypt"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const N=spelunk(data,"crypto.kdfparams.n:int!");const r=spelunk(data,"crypto.kdfparams.r:int!");const p=spelunk(data,"crypto.kdfparams.p:int!");validateScrypt(N,r,p);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dflen",dkLen);return{name:"scrypt",salt:salt,N:N,r:r,p:p,dkLen:64}}else if(kdf.toLowerCase()==="pbkdf2"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const prf=spelunk(data,"crypto.kdfparams.prf:string!");const algorithm=prf.split("-").pop();assertArgument(prf==="hmac-sha256"||prf==="hmac-sha512","invalid kdf.pdf","kdf.pdf",prf);const count=spelunk(data,"crypto.kdfparams.c:int!");assertArgument(Number.isSafeInteger(count)&&count>0&&count<=1e7,"unsafe PBKDF2 iteration count","kdf.c",count);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dklen",dkLen);return{name:"pbkdf2",salt:salt,count:count,dkLen:dkLen,algorithm:algorithm}}}assertArgument(false,"unsupported key-derivation function","kdf",kdf)}function decryptKeystoreJsonSync(json,_password){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=scryptSync(password,salt,N,r,p,dkLen);return getAccount(data,key)}function stall$1(duration){return new Promise(resolve=>{setTimeout(()=>{resolve()},duration)})}async function decryptKeystoreJson(json,_password,progress){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){if(progress){progress(0);await stall$1(0)}const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);if(progress){progress(1);await stall$1(0)}return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=await scrypt(password,salt,N,r,p,dkLen,progress);return getAccount(data,key)}function getEncryptKdfParams(options){const salt=options.salt!=null?getBytes(options.salt,"options.salt"):randomBytes(32);let N=1<<17,r=8,p=1;if(options.scrypt){if(options.scrypt.N!=null){N=options.scrypt.N}if(options.scrypt.r!=null){r=options.scrypt.r}if(options.scrypt.p!=null){p=options.scrypt.p}}validateScrypt(N,r,p);return{name:"scrypt",dkLen:32,salt:salt,N:N,r:r,p:p}}function _encryptKeystore(key,kdf,account,options){const privateKey=getBytes(account.privateKey,"privateKey");const iv=options.iv!=null?getBytes(options.iv,"options.iv"):randomBytes(16);assertArgument(iv.length===16,"invalid options.iv length","options.iv",options.iv);const uuidRandom=options.uuid!=null?getBytes(options.uuid,"options.uuid"):randomBytes(16);assertArgument(uuidRandom.length===16,"invalid options.uuid length","options.uuid",options.iv);const derivedKey=key.slice(0,16);const macPrefix=key.slice(16,32);const aesCtr=new CTR(derivedKey,new Counter(iv));const ciphertext=getBytes(aesCtr.encrypt(privateKey));const mac=sha256(concat([macPrefix,ciphertext]));const data={address:account.address.substring(2).toLowerCase(),id:uuidV4(uuidRandom),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(iv).substring(2)},ciphertext:hexlify(ciphertext).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify(kdf.salt).substring(2),n:kdf.N,dklen:32,p:kdf.p,r:kdf.r},mac:mac.substring(2)}};if(account.mnemonic){const client=options.client!=null?options.client:`corebc/${version}`;const path=account.mnemonic.path||defaultPath$1;const locale=account.mnemonic.locale||"en";const mnemonicKey=key.slice(32,64);const entropy=getBytes(account.mnemonic.entropy,"account.mnemonic.entropy");const mnemonicIv=randomBytes(16);const mnemonicAesCtr=new CTR(mnemonicKey,new Counter(mnemonicIv));const mnemonicCiphertext=getBytes(mnemonicAesCtr.encrypt(entropy));const now=new Date;const timestamp=now.getUTCFullYear()+"-"+zpad(now.getUTCMonth()+1,2)+"-"+zpad(now.getUTCDate(),2)+"T"+zpad(now.getUTCHours(),2)+"-"+zpad(now.getUTCMinutes(),2)+"-"+zpad(now.getUTCSeconds(),2)+".0Z";const gethFilename="UTC--"+timestamp+"--"+data.address;data["x-corebc"]={client:client,gethFilename:gethFilename,path:path,locale:locale,mnemonicCounter:hexlify(mnemonicIv).substring(2),mnemonicCiphertext:hexlify(mnemonicCiphertext).substring(2),version:"0.1"}}return JSON.stringify(data)}function encryptKeystoreJsonSync(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=scryptSync(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64);return _encryptKeystore(getBytes(key),kdf,account,options)}async function encryptKeystoreJson(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=await scrypt(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64,options.progressCallback);return _encryptKeystore(getBytes(key),kdf,account,options)}const defaultPath="m";const HardenedBit=2147483648;const _guard={};function derivePath(node,path){const components=path.split("/");assertArgument(components.length>0&&(components[0]==="m"||node.depth>0),"invalid path","path",path);if(components[0]==="m"){components.shift()}let result=node;for(let i=0;i=0&&index=0&&index{setTimeout(()=>{resolve()},duration)})}class Wallet extends BaseWallet{constructor({key,prefix,provider}){if(typeof key==="string"&&!key.startsWith("0x")){key="0x"+key}let signingKey=typeof key==="string"?new SigningKey(key):key;super({signingKey:signingKey,prefix:prefix,provider:provider})}connect(provider){return new Wallet({key:this.signingKey,prefix:this.prefix,provider:provider})}async encrypt(password,progressCallback){const account={address:this.address,privateKey:this.privateKey};return await encryptKeystoreJson(account,password,{progressCallback:progressCallback})}encryptSync(password){const account={address:this.address,privateKey:this.privateKey};return encryptKeystoreJsonSync(account,password)}static#fromAccount(account){assertArgument(account,"invalid JSON wallet","json","[ REDACTED ]");const address=account.address;const prefix=extractPrefix(address);if("mnemonic"in account&&account.mnemonic&&account.mnemonic.locale==="en"){const mnemonic=Mnemonic.fromEntropy(account.mnemonic.entropy);const wallet=HDNodeWallet.fromMnemonic(mnemonic,prefix,account.mnemonic.path);if(wallet.address===account.address&&wallet.privateKey===account.privateKey){return wallet}console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const wallet=new Wallet({key:account.privateKey,prefix:prefix});assertArgument(wallet.address===account.address,"address/privateKey mismatch","json","[ REDACTED ]");return wallet}static async fromEncryptedJson(json,password,progress){let account=null;if(isKeystoreJson(json)){account=await decryptKeystoreJson(json,password,progress)}else if(isCrowdsaleJson(json)){if(progress){progress(0);await stall(0)}account=decryptCrowdsaleJson(json,password);if(progress){progress(1);await stall(0)}}return Wallet.#fromAccount(account)}static fromEncryptedJsonSync(json,password){let account=null;if(isKeystoreJson(json)){account=decryptKeystoreJsonSync(json,password)}else if(isCrowdsaleJson(json)){account=decryptCrowdsaleJson(json,password)}else{assertArgument(false,"invalid JSON wallet","json","[ REDACTED ]")}return Wallet.#fromAccount(account)}static createRandom(prefix,provider){const wallet=HDNodeWallet.createRandom(prefix,undefined,undefined,undefined);if(provider){return wallet.connect(provider)}return wallet}static fromPhrase({phrase,prefix,provider,password}){const wallet=HDNodeWallet.fromPhrase({phrase:phrase,prefix:prefix,password:password});if(provider){return wallet.connect(provider)}return wallet}static fromSeed({seed,prefix,provider,path}){const wallet=HDNodeWallet.fromSeed({seed:seed,prefix:prefix,path:path||defaultPath});if(provider){return wallet.connect(provider)}return wallet}}const Base64=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function decodeBits(width,data){const maxValue=(1<=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const wordlists={en:LangEn.wordlist()};const customUnitAbi=Object.freeze(["function supportsUnit(string unit) view returns (bool)","function supportedUnits() view returns (string[])","function preferredUnit() view returns (string)","function balanceOf(address account) view returns (uint256)","function balanceOfUnit(address account, string unit) view returns (uint256)"]);class CustomUnitDiscovery{preferredUnit;supportedUnits;constructor(units,preferredUnit){this.preferredUnit=preferredUnit;this.supportedUnits=Object.freeze([...units])}get isValid(){return this.supports("units")&&this.preferredUnit!==""&&this.supports(this.preferredUnit)}supports(unit){return this.supportedUnits.includes(unit)}}class CustomUnitBalance{canonicalAmount;unitAmount;unit;constructor(canonicalAmount,unitAmount,unit){this.canonicalAmount=canonicalAmount;this.unitAmount=unitAmount;this.unit=unit}get multiplierNumerator(){return this.unitAmount}get multiplierDenominator(){return this.canonicalAmount}}class CustomUnitToken{contract;constructor(address,runner){this.contract=new Contract(address,customUnitAbi,runner)}async supportsUnit(unit,blockTag){return unit.trim()!==""&&await this.contract.supportsUnit(unit.trim(),{blockTag:blockTag})}async supportedUnits(blockTag){return Object.freeze(Array.from(await this.contract.supportedUnits({blockTag:blockTag})))}async preferredUnit(blockTag){return(await this.contract.preferredUnit({blockTag:blockTag})).trim()}async discover(blockTag){if(!await this.supportsUnit("units",blockTag))return null;const discovery=new CustomUnitDiscovery(await this.supportedUnits(blockTag),await this.preferredUnit(blockTag));return discovery.isValid?discovery:null}canonicalBalance(account,blockTag){return this.contract.balanceOf(account,{blockTag:blockTag})}balanceOfUnit(account,unit,blockTag){if(!unit.trim())throw new TypeError("unit must not be empty");return this.contract.balanceOfUnit(account,unit.trim(),{blockTag:blockTag})}async balance(account,unit,blockTag){const resolved=unit?.trim()||await this.preferredUnit(blockTag);const[canonical,calculated]=await Promise.all([this.canonicalBalance(account,blockTag),this.balanceOfUnit(account,resolved,blockTag)]);return new CustomUnitBalance(canonical,calculated,resolved)}}const cip150Abi=Object.freeze(["function getMetadataValue(string key) view returns (string value)","function hasMetadataKey(string key) view returns (bool exists)","function isMetadataSealed(string key) view returns (bool sealed)","function listMetadataKeys() view returns (string[] keys)","function getMetadataByIndex(uint256 index) view returns (string key, string value)","function metadataCount() view returns (uint256 total)","function setMetadataValue(string key, string value)","function sealMetadataKey(string key)"]);const cip151TokenExpirationKey="tokenExpiration";const cip151TradingStopKey="tradingStop";const cip152LabKey="lab";class Cip151Lifecycle{tokenExpiration;tradingStop;constructor(metadata={}){const parse=key=>{const value=metadata[key];if(value==null||value==="")return null;if(!/^\d+$/.test(value))throw new TypeError(`${key} must be a non-negative Unix timestamp`);return BigInt(value)};this.tokenExpiration=parse(cip151TokenExpirationKey);this.tradingStop=parse(cip151TradingStopKey)}isExpiredAt(seconds){return this.tokenExpiration!==null&&seconds>=this.tokenExpiration}isTradingStoppedAt(seconds){return this.tradingStop!==null&&seconds>=this.tradingStop}}class Cip152LabCertificate{measurements;constructor(json){if(json===null||typeof json!=="object"||Array.isArray(json))throw new TypeError("CIP-152 lab.json must be an object");const measurements=Object.create(null);for(const[key,property]of Object.entries(json)){if(!property||typeof property!=="object"||Array.isArray(property)||!Object.hasOwn(property,"value"))throw new TypeError(`CIP-152 property ${key} must contain a value`);const{value,unit}=property;if(!(typeof value==="string"||typeof value==="number"&&Number.isFinite(value)))throw new TypeError(`CIP-152 property ${key} has an invalid value`);if(unit!=null&&typeof unit!=="string")throw new TypeError(`CIP-152 property ${key} has an invalid unit`);measurements[key]=Object.freeze(unit==null?{value:value}:{value:value,unit:unit})}this.measurements=Object.freeze(measurements)}}class Cip150MetadataContract{contract;constructor(address,runner){this.contract=new Contract(address,cip150Abi,runner)}getValue(key,blockTag){return this.contract.getMetadataValue(key,{blockTag:blockTag})}hasKey(key,blockTag){return this.contract.hasMetadataKey(key,{blockTag:blockTag})}isSealed(key,blockTag){return this.contract.isMetadataSealed(key,{blockTag:blockTag})}async listKeys(blockTag){return Object.freeze(Array.from(await this.contract.listMetadataKeys({blockTag:blockTag})))}async getByIndex(index,blockTag){const[key,value]=await this.contract.getMetadataByIndex(index,{blockTag:blockTag});return Object.freeze({key:key,value:value})}count(blockTag){return this.contract.metadataCount({blockTag:blockTag})}async readAll(blockTag,includeSealedState=true){const entries=[];for(const key of await this.listKeys(blockTag)){const value=await this.getValue(key,blockTag);entries.push(Object.freeze(includeSealedState?{key:key,value:value,sealed:await this.isSealed(key,blockTag)}:{key:key,value:value}))}return Object.freeze(entries)}setValue(key,value,overrides={}){return this.contract.setMetadataValue(key,value,overrides)}sealKey(key,overrides={}){return this.contract.sealMetadataKey(key,overrides)}async readLifecycle(blockTag){const metadata={};for(const key of[cip151TokenExpirationKey,cip151TradingStopKey]){if(await this.hasKey(key,blockTag))metadata[key]=await this.getValue(key,blockTag)}return new Cip151Lifecycle(metadata)}async readLabCertificate(gateway,blockTag){if(!await this.hasKey(cip152LabKey,blockTag))return null;const reference=await this.getValue(cip152LabKey,blockTag);if(!gateway.resolve(reference).pathname.endsWith("/lab.json"))throw new TypeError("CIP-152 reference must point to lab.json");return new Cip152LabCertificate(await gateway.readJson(reference))}}const defaultIpfsGatewayTemplate="https://ipf.sk/{cid}";class IpfsGateway{template;maxResponseBytes;timeoutMs;#fetch;constructor(options={}){this.template=options.template??defaultIpfsGatewayTemplate;this.maxResponseBytes=options.maxResponseBytes??1024*1024;this.timeoutMs=options.timeoutMs??3e4;this.#fetch=options.fetch??globalThis.fetch;const templateUrl=new URL(this.template.replace("{cid}","cid"));if(!/^https?:$/.test(templateUrl.protocol)||this.template.split("{cid}").length!==2)throw new TypeError("gateway template must be HTTP(S) and contain one {cid}");for(const value of[this.maxResponseBytes,this.timeoutMs])if(!Number.isSafeInteger(value)||value<=0)throw new TypeError("gateway limits must be positive safe integers")}resolve(reference){const value=reference.trim();if(/^https?:\/\//i.test(value))return new URL(value);const path=value.replace(/^ipfs:\/\//,"").replace(/^\/?ipfs\//,"");if(!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path)||path.split("/").some(part=>part==="."||part===".."))throw new TypeError("invalid IPFS reference");return new URL(this.template.replace("{cid}",path.split("/").map(encodeURIComponent).join("/")))}async readJson(reference){const controller=new AbortController;const timer=setTimeout(()=>controller.abort(),this.timeoutMs);let reader;try{const response=await this.#fetch(this.resolve(reference),{headers:{accept:"application/json"},signal:controller.signal});if(!response.ok){await response.body?.cancel();throw new Error(`IPFS gateway returned HTTP ${response.status}`)}if(!response.body)throw new Error("IPFS gateway returned an empty body");reader=response.body.getReader();const chunks=[];let length=0;while(true){const{done,value}=await reader.read();if(done)break;length+=value.length;if(length>this.maxResponseBytes)throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);chunks.push(value)}const bytes=new Uint8Array(length);let offset=0;for(const chunk of chunks){bytes.set(chunk,offset);offset+=chunk.length}return JSON.parse(new TextDecoder("utf-8",{fatal:true}).decode(bytes))}finally{clearTimeout(timer);await reader?.cancel().catch(()=>{});reader?.releaseLock()}}}var corebc=Object.freeze({__proto__:null,AbiCoder:AbiCoder,AbstractProvider:AbstractProvider,AbstractSigner:AbstractSigner,AlchemyProvider:AlchemyProvider,AnkrProvider:AnkrProvider,BaseContract:BaseContract,BaseWallet:BaseWallet,BigNumber:BigNumber,Block:Block,BrowserProvider:BrowserProvider,Cip150MetadataContract:Cip150MetadataContract,Cip151Lifecycle:Cip151Lifecycle,Cip152LabCertificate:Cip152LabCertificate,CloudflareProvider:CloudflareProvider,ConstructorFragment:ConstructorFragment,Contract:Contract,ContractEventPayload:ContractEventPayload,ContractFactory:ContractFactory,ContractTransactionReceipt:ContractTransactionReceipt,ContractTransactionResponse:ContractTransactionResponse,ContractUnknownEventPayload:ContractUnknownEventPayload,CoreSymbol:CoreSymbol,CustomUnitBalance:CustomUnitBalance,CustomUnitDiscovery:CustomUnitDiscovery,CustomUnitToken:CustomUnitToken,Ed448Goldilock:Ed448Goldilock,EnergyCostPlugin:EnergyCostPlugin,ErrorDescription:ErrorDescription,ErrorFragment:ErrorFragment,EventFragment:EventFragment,EventLog:EventLog,EventPayload:EventPayload,FallbackFragment:FallbackFragment,FallbackProvider:FallbackProvider,FeeData:FeeData,FeeDataNetworkPlugin:FeeDataNetworkPlugin,FetchCancelSignal:FetchCancelSignal,FetchRequest:FetchRequest,FetchResponse:FetchResponse,FixedNumber:FixedNumber,Fragment:Fragment,FunctionFragment:FunctionFragment,HDNodeWallet:HDNodeWallet,Indexed:Indexed,InfuraProvider:InfuraProvider,InfuraWebSocketProvider:InfuraWebSocketProvider,Interface:Interface,IpcSocketProvider:IpcSocketProvider,IpfsGateway:IpfsGateway,JsonRpcApiProvider:JsonRpcApiProvider,JsonRpcProvider:JsonRpcProvider,JsonRpcSigner:JsonRpcSigner,LangEn:LangEn,Log:Log,LogDescription:LogDescription,MaxInt256:MaxInt256,MaxUint256:MaxUint256,MessagePrefix:MessagePrefix,MinInt256:MinInt256,Mnemonic:Mnemonic,N:N,NamedFragment:NamedFragment,Network:Network,NetworkPlugin:NetworkPlugin,NonceManager:NonceManager,OrePerXCB:OrePerXCB,ParamType:ParamType,PocketProvider:PocketProvider,QuickNodeProvider:QuickNodeProvider,Result:Result,Signature:Signature,SigningKey:SigningKey,SocketBlockSubscriber:SocketBlockSubscriber,SocketEventSubscriber:SocketEventSubscriber,SocketPendingSubscriber:SocketPendingSubscriber,SocketProvider:SocketProvider,SocketSubscriber:SocketSubscriber,StructFragment:StructFragment,Transaction:Transaction,TransactionDescription:TransactionDescription,TransactionReceipt:TransactionReceipt,TransactionResponse:TransactionResponse,Typed:Typed,TypedDataEncoder:TypedDataEncoder,UnmanagedSubscriber:UnmanagedSubscriber,Utf8ErrorFuncs:Utf8ErrorFuncs,VoidSigner:VoidSigner,Wallet:Wallet,WebSocketProvider:WebSocketProvider,Wordlist:Wordlist,WordlistOwl:WordlistOwl,WordlistOwlA:WordlistOwlA,ZeroAddress:ZeroAddress,ZeroHash:ZeroHash,accessListify:accessListify,arrayify:arrayify,assert:assert,assertArgument:assertArgument,assertArgumentCount:assertArgumentCount,assertNormalize:assertNormalize,assertPrivate:assertPrivate,checkResultErrors:checkResultErrors,cip150Abi:cip150Abi,cip151TokenExpirationKey:cip151TokenExpirationKey,cip151TradingStopKey:cip151TradingStopKey,cip152LabKey:cip152LabKey,computeAddress:computeAddress,computeHmac:computeHmac,concat:concat,copyRequest:copyRequest,customUnitAbi:customUnitAbi,dataLength:dataLength,dataSlice:dataSlice,decodeBase58:decodeBase58,decodeBase64:decodeBase64,decodeBytes32String:decodeBytes32String,decodeRlp:decodeRlp,decryptCrowdsaleJson:decryptCrowdsaleJson,decryptKeystoreJson:decryptKeystoreJson,decryptKeystoreJsonSync:decryptKeystoreJsonSync,defaultIpfsGatewayTemplate:defaultIpfsGatewayTemplate,defaultPath:defaultPath,defineProperties:defineProperties,encodeBase58:encodeBase58,encodeBase64:encodeBase64,encodeBytes32String:encodeBytes32String,encodeRlp:encodeRlp,encryptKeystoreJson:encryptKeystoreJson,encryptKeystoreJsonSync:encryptKeystoreJsonSync,formatUnits:formatUnits,formatXCB:formatXCB,fromTwos:fromTwos,getAccountPath:getAccountPath,getAddress:getAddress,getBigInt:getBigInt,getBytes:getBytes,getBytesCopy:getBytesCopy,getCreate2Address:getCreate2Address,getCreateAddress:getCreateAddress,getDefaultProvider:getDefaultProvider,getIndexedAccountPath:getIndexedAccountPath,getNumber:getNumber,getUint:getUint,hashMessage:hashMessage,hexConcat:hexConcat,hexlify:hexlify,id:id,isAddress:isAddress,isAddressable:isAddressable,isBytesLike:isBytesLike,isCallException:isCallException,isCrowdsaleJson:isCrowdsaleJson,isError:isError,isHexString:isHexString,isKeystoreJson:isKeystoreJson,keccak256:keccak256,lock:lock,makeError:makeError,mask:mask,networkIdToPrefix:networkIdToPrefix,parseUnits:parseUnits,parseXCB:parseXCB,pbkdf2:pbkdf2,publicToAddress:publicToAddress,randomBytes:randomBytes,recoverAddress:recoverAddress,resolveAddress:resolveAddress,resolveProperties:resolveProperties,ripemd160:ripemd160,scrypt:scrypt,scryptSync:scryptSync,sha256:sha256,sha512:sha512,showThrottleMessage:showThrottleMessage,solidityPacked:solidityPacked,solidityPackedSha256:solidityPackedSha256,stripZerosLeft:stripZerosLeft,toBeArray:toBeArray,toBeHex:toBeHex,toBigInt:toBigInt,toNumber:toNumber,toQuantity:toQuantity,toTwos:toTwos,toUtf8Bytes:toUtf8Bytes,toUtf8CodePoints:toUtf8CodePoints,toUtf8String:toUtf8String,uuidV4:uuidV4,verifyMessage:verifyMessage,verifyTypedData:verifyTypedData,version:version,wordlists:wordlists,zeroPadBytes:zeroPadBytes,zeroPadValue:zeroPadValue});var Buffer=bufferExports.Buffer;export{AbiCoder,AbstractProvider,AbstractSigner,AlchemyProvider,AnkrProvider,BaseContract,BaseWallet,BigNumber,Block,BrowserProvider,Buffer,Cip150MetadataContract,Cip151Lifecycle,Cip152LabCertificate,CloudflareProvider,ConstructorFragment,Contract,ContractEventPayload,ContractFactory,ContractTransactionReceipt,ContractTransactionResponse,ContractUnknownEventPayload,CoreSymbol,CustomUnitBalance,CustomUnitDiscovery,CustomUnitToken,Ed448Goldilock,EnergyCostPlugin,ErrorDescription,ErrorFragment,EventFragment,EventLog,EventPayload,FallbackFragment,FallbackProvider,FeeData,FeeDataNetworkPlugin,FetchCancelSignal,FetchRequest,FetchResponse,FixedNumber,Fragment,FunctionFragment,HDNodeWallet,Indexed,InfuraProvider,InfuraWebSocketProvider,Interface,IpcSocketProvider,IpfsGateway,JsonRpcApiProvider,JsonRpcProvider,JsonRpcSigner,LangEn,Log,LogDescription,MaxInt256,MaxUint256,MessagePrefix,MinInt256,Mnemonic,N,NamedFragment,Network,NetworkPlugin,NonceManager,OrePerXCB,ParamType,PocketProvider,QuickNodeProvider,Result,Signature,SigningKey,SocketBlockSubscriber,SocketEventSubscriber,SocketPendingSubscriber,SocketProvider,SocketSubscriber,StructFragment,Transaction,TransactionDescription,TransactionReceipt,TransactionResponse,Typed,TypedDataEncoder,UnmanagedSubscriber,Utf8ErrorFuncs,VoidSigner,Wallet,WebSocketProvider,Wordlist,WordlistOwl,WordlistOwlA,ZeroAddress,ZeroHash,accessListify,arrayify,assert,assertArgument,assertArgumentCount,assertNormalize,assertPrivate,checkResultErrors,cip150Abi,cip151TokenExpirationKey,cip151TradingStopKey,cip152LabKey,computeAddress,computeHmac,concat,copyRequest,corebc,customUnitAbi,dataLength,dataSlice,decodeBase58,decodeBase64,decodeBytes32String,decodeRlp,decryptCrowdsaleJson,decryptKeystoreJson,decryptKeystoreJsonSync,defaultIpfsGatewayTemplate,defaultPath,defineProperties,encodeBase58,encodeBase64,encodeBytes32String,encodeRlp,encryptKeystoreJson,encryptKeystoreJsonSync,formatUnits,formatXCB,fromTwos,getAccountPath,getAddress,getBigInt,getBytes,getBytesCopy,getCreate2Address,getCreateAddress,getDefaultProvider,getIndexedAccountPath,getNumber,getUint,hashMessage,hexConcat,hexlify,id,isAddress,isAddressable,isBytesLike,isCallException,isCrowdsaleJson,isError,isHexString,isKeystoreJson,keccak256,lock,makeError,mask,networkIdToPrefix,parseUnits,parseXCB,pbkdf2,publicToAddress,randomBytes,recoverAddress,resolveAddress,resolveProperties,ripemd160,scrypt,scryptSync,sha256,sha512,showThrottleMessage,solidityPacked,solidityPackedSha256,stripZerosLeft,toBeArray,toBeHex,toBigInt,toNumber,toQuantity,toTwos,toUtf8Bytes,toUtf8CodePoints,toUtf8String,uuidV4,verifyMessage,verifyTypedData,version,wordlists,zeroPadBytes,zeroPadValue}; \ No newline at end of file diff --git a/dist/corebc.umd.js b/dist/corebc.umd.js index b17f76aad..97c11736c 100644 --- a/dist/corebc.umd.js +++ b/dist/corebc.umd.js @@ -1,19982 +1,46361 @@ const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {}); (function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('buffer'), require('bcrypto/lib/ed448-browser.js'), require('bn.js'), require('bcrypto/lib/pbkdf2-browser.js'), require('bcrypto/lib/sha3-512.js'), require('utf8'), require('aes-js')) : - typeof define === 'function' && define.amd ? define(['exports', 'buffer', 'bcrypto/lib/ed448-browser.js', 'bn.js', 'bcrypto/lib/pbkdf2-browser.js', 'bcrypto/lib/sha3-512.js', 'utf8', 'aes-js'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.corebc = {}, global.buffer, global.ed448, global._BN, global.pbkdf2$2, global.SHA3_512, global.utf8, global.pkg)); -})(this, (function (exports, buffer, ed448, _BN, pbkdf2$2, SHA3_512, utf8, pkg) { 'use strict'; - - /* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ - /** - * The current version of corebc. - */ - const version = "6.4.0"; - - let _permanentCensorErrors = false; - let _censorErrors = false; - const LogLevels = { - debug: 1, - default: 2, - info: 2, - warning: 3, - error: 4, - off: 5, - }; - let _logLevel = LogLevels["default"]; - let _globalLogger = null; - function _checkNormalize() { - try { - const missing = []; - // Make sure all forms of normalization are supported - ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { - try { - if ("test".normalize(form) !== "test") { - throw new Error("bad normalize"); - } - } - catch (error) { - missing.push(form); - } - }); - if (missing.length) { - throw new Error("missing " + missing.join(", ")); - } - if (String.fromCharCode(0xe9).normalize("NFD") !== - String.fromCharCode(0x65, 0x0301)) { - throw new Error("broken implementation"); - } - } - catch (error) { - return error.message; - } - return null; - } - const _normalizeError = _checkNormalize(); - var LogLevel; - (function (LogLevel) { - LogLevel["DEBUG"] = "DEBUG"; - LogLevel["INFO"] = "INFO"; - LogLevel["WARNING"] = "WARNING"; - LogLevel["ERROR"] = "ERROR"; - LogLevel["OFF"] = "OFF"; - })(LogLevel || (LogLevel = {})); - var ErrorCode; - (function (ErrorCode) { - /////////////////// - // Generic Errors - // Unknown Error - ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR"; - // Not Implemented - ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED"; - // Unsupported Operation - // - operation - ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION"; - // Network Error (i.e. Core Network, such as an invalid network ID) - // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) - ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR"; - // Some sort of bad response from the server - ErrorCode["SERVER_ERROR"] = "SERVER_ERROR"; - // Timeout - ErrorCode["TIMEOUT"] = "TIMEOUT"; - /////////////////// - // Operational Errors - // Buffer Overrun - ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN"; - // Numeric Fault - // - operation: the operation being executed - // - fault: the reason this faulted - ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT"; - /////////////////// - // Argument Errors - // Missing new operator to an object - // - name: The name of the class - ErrorCode["MISSING_NEW"] = "MISSING_NEW"; - // Invalid argument (e.g. value is incompatible with type) to a function: - // - argument: The argument name that was invalid - // - value: The value of the argument - ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT"; - // Missing argument to a function: - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT"; - // Too many arguments - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT"; - /////////////////// - // Blockchain Errors - // Call exception - // - transaction: the transaction - // - address?: the contract address - // - args?: The arguments passed into the function - // - method?: The Solidity method signature - // - errorSignature?: The EIP848 error signature - // - errorArgs?: The EIP848 error parameters - // - reason: The reason (only for EIP848 "Error(string)") - ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION"; - // Insufficient funds (< value + energyLimit * energyPrice) - // - transaction: the transaction attempted - ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS"; - // Nonce has already been used - // - transaction: the transaction attempted - ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED"; - // The replacement fee for the transaction is too low - // - transaction: the transaction attempted - ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED"; - // The energy limit could not be estimated - // - transaction: the transaction passed to estimateEnergy - ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"] = "UNPREDICTABLE_ENERGY_LIMIT"; - // The transaction was replaced by one with a higher energy price - // - reason: "cancelled", "replaced" or "repriced" - // - cancelled: true if reason == "cancelled" or reason == "replaced") - // - hash: original transaction hash - // - replacement: the full TransactionsResponse for the replacement - // - receipt: the receipt of the replacement - ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; - })(ErrorCode || (ErrorCode = {})); - const HEX = "0123456789abcdef"; - class Logger { - version = "0.0.1"; - static errors = ErrorCode; - static levels = LogLevel; - constructor(version) { - Object.defineProperty(this, "version", { - enumerable: true, - value: version, - writable: false, - }); - } - _log(logLevel, args) { - const level = logLevel.toLowerCase(); - if (LogLevels[level] == null) { - this.throwArgumentError("invalid log level name", "logLevel", logLevel); - } - if (_logLevel > LogLevels[level]) { - return; - } - console.log.apply(console, args); - } - debug(...args) { - this._log(Logger.levels.DEBUG, args); - } - info(...args) { - this._log(Logger.levels.INFO, args); - } - warn(...args) { - this._log(Logger.levels.WARNING, args); - } - makeError(message, code, params) { - // Errors are being censored - if (_censorErrors) { - return this.makeError("censored error", code, {}); - } - if (!code) { - code = Logger.errors.UNKNOWN_ERROR; - } - if (!params) { - params = {}; - } - const messageDetails = []; - Object.keys(params).forEach((key) => { - const value = params[key]; - try { - if (value instanceof Uint8Array) { - let hex = ""; - for (let i = 0; i < value.length; i++) { - hex += HEX[value[i] >> 4]; - hex += HEX[value[i] & 0x0f]; - } - messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); - } - else { - messageDetails.push(key + "=" + JSON.stringify(value)); - } - } - catch (error) { - messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); - } - }); - messageDetails.push(`code=${code}`); - messageDetails.push(`version=${this.version}`); - const reason = message; - if (messageDetails.length) { - message += " (" + messageDetails.join(", ") + ")"; - } - // @TODO: Any?? - const error = new Error(message); - error.reason = reason; - error.code = code; - Object.keys(params).forEach(function (key) { - error[key] = params[key]; - }); - return error; - } - throwError(message, code, params) { - throw this.makeError(message, code, params); - } - throwArgumentError(message, name, value) { - return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { - argument: name, - value: value, - }); - } - assert(condition, message, code, params) { - if (!!condition) { - return; - } - this.throwError(message, code, params); - } - assertArgument(condition, message, name, value) { - if (!!condition) { - return; - } - this.throwArgumentError(message, name, value); - } - checkNormalize(message) { - if (_normalizeError) { - this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "String.prototype.normalize", - form: _normalizeError, - }); - } - } - checkSafeUint53(value, message) { - if (typeof value !== "number") { - return; - } - if (message == null) { - message = "value not safe"; - } - if (value < 0 || value >= 0x1fffffffffffff) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "out-of-safe-range", - value: value, - }); - } - if (value % 1) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "non-integer", - value: value, - }); - } - } - checkArgumentCount(count, expectedCount, message) { - if (message) { - message = ": " + message; - } - else { - message = ""; - } - if (count < expectedCount) { - this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - if (count > expectedCount) { - this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - } - checkNew(target, kind) { - if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - checkAbstract(target, kind) { - if (target === kind) { - this.throwError("cannot instantiate abstract class " + - JSON.stringify(kind.name) + - " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }); - } - else if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - static globalLogger() { - if (!_globalLogger) { - _globalLogger = new Logger("logger/0.0.1"); - } - return _globalLogger; - } - static setCensorship(censorship, permanent) { - if (!censorship && permanent) { - this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - if (_permanentCensorErrors) { - if (!censorship) { - return; - } - this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - _censorErrors = !!censorship; - _permanentCensorErrors = !!permanent; - } - static setLogLevel(logLevel) { - const level = LogLevels[logLevel.toLowerCase()]; - if (level == null) { - Logger.globalLogger().warn("invalid log level - " + logLevel); - return; - } - _logLevel = level; - } - static from(version) { - return new Logger(version); - } - } - - /** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ - const logger$7 = new Logger("utils/properties/0.0.1"); - function checkType(value, type, name) { - const types = type.split("|").map((t) => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof value === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; - } - /** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ - async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); - } - /** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ - function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = types ? types[key] : null; - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { - enumerable: true, - value, - writable: false, - }); - } - } - function checkProperties(object, properties) { - if (!object || typeof object !== "object") { - logger$7.throwArgumentError("invalid object", "object", object); - } - Object.keys(object).forEach((key) => { - if (!properties[key]) { - logger$7.throwArgumentError("invalid object key - " + key, "transaction:" + key, object); - } - }); - } - - /** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ - function stringify$1(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[ " + value.map(stringify$1).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return stringify$1(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "number": - return value.toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{ " + - keys.map((k) => `${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ") + - " }"); - } - } - return `[ COULD NOT SERIALIZE ]`; - } - /** - * Returns true if the %%error%% matches an error thrown by corebc - * that matches the error %%code%%. - * - * In TypeScript envornoments, this can be used to check that %%error%% - * matches an corebcError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ - function isError(error, code) { - return error && error.code === code; - } - /** - * Returns true if %%error%% is a [[CallExceptionError]. - */ - function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); - } - /** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ - function makeError(message, code, info) { - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify$1(info)}`); - } - for (const key in info) { - const value = info[key]; - // try { - details.push(key + "=" + stringify$1(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - return error; - } - /** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ - function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } - } - /** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ - function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); - } - function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing arguemnt" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); - assert(count <= expectedCount, "too many arguemnts" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); - } - const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; - }, []); - /** - * Throws if the normalization %%form%% is not supported. - */ - function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", - info: { form }, - }); - } - /** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ - function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation, - }); - } - } - - /** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ - const logger$6 = new Logger("utils/data/0.0.1"); - function isHexable(value) { - return !!value.toHexString; - } - function isInteger(value) { - return typeof value === "number" && value == value && value % 1 === 0; - } - function isBytes(value) { - if (value == null) { - return false; - } - if (value.constructor === Uint8Array) { - return true; - } - if (typeof value === "string") { - return false; - } - if (!isInteger(value.length) || value.length < 0) { - return false; - } - for (let i = 0; i < value.length; i++) { - const v = value[i]; - if (!isInteger(v) || v < 0 || v >= 256) { - return false; - } - } - return true; - } - function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); - } - /** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ - function getBytes(value, name) { - return _getBytes(value, name, false); - } - /** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ - function getBytesCopy(value, name) { - return _getBytes(value, name, true); - } - /** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ - function isHexString(value, length) { - if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof length === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && value.length % 2 !== 0) { - return false; - } - return true; - } - /** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ - function isBytesLike(value) { - return isHexString(value, true) || value instanceof Uint8Array; - } - const HexCharacters = "0123456789abcdef"; - /** - * Returns a [[DataHexString]] representation of %%data%%. - */ - function hexlify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "string") { - if (value.includes(",") && value.startsWith("0x")) { - const v = value - .replace("0x", "") - .split(",") - .map((item) => Number(item)); - // @ts-ignore - value = new Uint8Array(v); - } - } - if (typeof value === "number") { - logger$6.checkSafeUint53(value, "invalid hexlify value"); - let hex = ""; - while (value) { - hex = HexCharacters[value & 0xf] + hex; - value = Math.floor(value / 16); - } - if (hex.length) { - if (hex.length % 2) { - hex = "0" + hex; - } - return "0x" + hex; - } - return "0x00"; - } - if (typeof value === "bigint") { - value = value.toString(16); - if (value.length % 2) { - return "0x0" + value; - } - return "0x" + value; - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - return value.toHexString(); - } - if (isHexString(value)) { - if (value.length % 2) { - if (options.hexPad === "left") { - value = "0x0" + value.substring(2); - } - else if (options.hexPad === "right") { - value += "0"; - } - else { - logger$6.throwArgumentError("hex data is odd-length", "value", value); - } - } - return value.toLowerCase(); - } - if (isBytes(value)) { - let result = "0x"; - for (let i = 0; i < value.length; i++) { - let v = value[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; - } - return logger$6.throwArgumentError("invalid hexlify value", "value", value); - } - /** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ - function concat(items) { - return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); - } - function hexDataSlice(data, offset, endOffset) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - logger$6.throwArgumentError("invalid hexData", "value", data); - } - offset = 2 + 2 * offset; - if (endOffset != null) { - return "0x" + data.substring(offset, 2 + 2 * endOffset); - } - return "0x" + data.substring(offset); - } - function hexDataLength(data) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - return null; - } - return (data.length - 2) / 2; - } - /** - * Returns the length of %%data%%, in bytes. - */ - function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; - } - /** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ - function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: bytes.length, - offset: end, - }); - } - return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); - } - /** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ - function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; - } - function zeroPad(data, length, left) { - const bytes = getBytes(data); - assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1, - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); - } - /** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ - function zeroPadValue(data, length) { - return zeroPad(data, length, true); - } - /** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ - function zeroPadBytes(data, length) { - return zeroPad(data, length, false); - } - function stripZeros(value) { - let result = arrayify(value); - if (result.length === 0) { - return result; - } - // Find the first non-zero entry - let start = 0; - while (start < result.length && result[start] === 0) { - start++; - } - // If we started with zeros, strip them - if (start) { - result = result.slice(start); - } - return result; - } - function arrayify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "number") { - logger$6.checkSafeUint53(value, "invalid arrayify value"); - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value = parseInt(String(value / 256)); - } - if (result.length === 0) { - result.push(0); - } - return addSlice(new Uint8Array(result)); - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - value = value.toHexString(); - } - if (isHexString(value)) { - let hex = value.substring(2); - if (hex.length % 2) { - if (options.hexPad === "left") { - hex = "0x0" + hex.substring(2); - } - else if (options.hexPad === "right") { - hex += "0"; - } - else { - logger$6.throwArgumentError("hex data is odd-length", "value", value); - } - } - const result = []; - for (let i = 0; i < hex.length; i += 2) { - // @ts-ignore - result.push(parseInt(hex.substring(i, i + 2), 16)); - } - return addSlice(new Uint8Array(result)); - } - if (isBytes(value)) { - return addSlice(new Uint8Array(value)); - } - return logger$6.throwArgumentError("invalid arrayify value", "value", value); - } - function addSlice(array) { - // @ts-ignore - if (array.slice) { - return array; - } - array.slice = function () { - const args = Array.prototype.slice.call(arguments); - return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args))); - }; - return array; - } - function hexConcat(items) { - let result = "0x"; - items.forEach((item) => { - result += hexlify(item).substring(2); - }); - return result; - } - - var BN = _BN.BN; - const logger$5 = new Logger("bigNumber/0.0.1"); - const _constructorGuard = {}; - const MAX_SAFE = 0x1fffffffffffff; - // Only warn about passing 10 into radix once - let _warnedToStringRadix = false; - class BigNumber { - _hex; - _isBigNumber; - constructor(constructorGuard, hex) { - logger$5.checkNew(new.target, BigNumber); - if (constructorGuard !== _constructorGuard) { - logger$5.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "new (BigNumber)", - }); - } - this._hex = hex; - this._isBigNumber = true; - Object.freeze(this); - } - fromTwos(value) { - return toBigNumber(toBN(this).fromTwos(value)); - } - toTwos(value) { - return toBigNumber(toBN(this).toTwos(value)); - } - abs() { - if (this._hex[0] === "-") { - return BigNumber.from(this._hex.substring(1)); - } - return this; - } - add(other) { - return toBigNumber(toBN(this).add(toBN(other))); - } - sub(other) { - return toBigNumber(toBN(this).sub(toBN(other))); - } - div(other) { - const o = BigNumber.from(other); - if (o.isZero()) { - throwFault("division by zero", "div"); - } - return toBigNumber(toBN(this).div(toBN(other))); - } - mul(other) { - return toBigNumber(toBN(this).mul(toBN(other))); - } - mod(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot modulo negative values", "mod"); - } - return toBigNumber(toBN(this).umod(value)); - } - pow(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot raise to negative values", "pow"); - } - return toBigNumber(toBN(this).pow(value)); - } - and(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'and' negative values", "and"); - } - return toBigNumber(toBN(this).and(value)); - } - or(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'or' negative values", "or"); - } - return toBigNumber(toBN(this).or(value)); - } - xor(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'xor' negative values", "xor"); - } - return toBigNumber(toBN(this).xor(value)); - } - mask(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot mask negative values", "mask"); - } - return toBigNumber(toBN(this).maskn(value)); - } - shl(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shl"); - } - return toBigNumber(toBN(this).shln(value)); - } - shr(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shr"); - } - return toBigNumber(toBN(this).shrn(value)); - } - eq(other) { - return toBN(this).eq(toBN(other)); - } - lt(other) { - return toBN(this).lt(toBN(other)); - } - lte(other) { - return toBN(this).lte(toBN(other)); - } - gt(other) { - return toBN(this).gt(toBN(other)); - } - gte(other) { - return toBN(this).gte(toBN(other)); - } - isNegative() { - return this._hex[0] === "-"; - } - isZero() { - return toBN(this).isZero(); - } - toNumber() { - try { - return toBN(this).toNumber(); - } - catch (error) { - throwFault("overflow", "toNumber", this.toString()); - } - // @ts-ignore - return null; - } - toBigInt() { - try { - return BigInt(this.toString()); - } - catch (e) { } - return logger$5.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, { - value: this.toString(), - }); - } - toString() { - // Lots of people expect this, which we do not support, so check (See: #889) - if (arguments.length > 0) { - if (arguments[0] === 10) { - if (!_warnedToStringRadix) { - _warnedToStringRadix = true; - logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed"); - } - } - else if (arguments[0] === 16) { - logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - else { - logger$5.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - } - return toBN(this).toString(10); - } - toHexString() { - return this._hex; - } - toJSON(key) { - return { type: "BigNumber", hex: this.toHexString() }; - } - static from(value) { - if (value instanceof BigNumber) { - return value; - } - if (typeof value === "string") { - if (value.match(/^-?0x[0-9a-f]+$/i)) { - return new BigNumber(_constructorGuard, toHex(value)); - } - if (value.match(/^-?[0-9]+$/)) { - return new BigNumber(_constructorGuard, toHex(new BN(value))); - } - return logger$5.throwArgumentError("invalid BigNumber string", "value", value); - } - if (typeof value === "number") { - if (value % 1) { - throwFault("underflow", "BigNumber.from", value); - } - if (value >= MAX_SAFE || value <= -MAX_SAFE) { - throwFault("overflow", "BigNumber.from", value); - } - return BigNumber.from(String(value)); - } - const anyValue = value; - if (typeof anyValue === "bigint") { - return BigNumber.from(anyValue.toString()); - } - if (isBytes(anyValue)) { - return BigNumber.from(hexlify(anyValue)); - } - if (anyValue) { - // Hexable interface (takes priority) - if (anyValue.toHexString) { - const hex = anyValue.toHexString(); - if (typeof hex === "string") { - return BigNumber.from(hex); - } - } - else { - // For now, handle legacy JSON-ified values (goes away in v6) - let hex = anyValue._hex; - // New-form JSON - if (hex == null && anyValue.type === "BigNumber") { - hex = anyValue.hex; - } - if (typeof hex === "string") { - if (isHexString(hex) || - (hex[0] === "-" && isHexString(hex.substring(1)))) { - return BigNumber.from(hex); - } - } - } - } - return logger$5.throwArgumentError("invalid BigNumber value", "value", value); - } - static isBigNumber(value) { - return !!(value && value._isBigNumber); - } - } - // Normalize the hex string - // @ts-ignore - function toHex(value) { - // For BN, call on the hex string - if (typeof value !== "string") { - return toHex(value.toString(16)); - } - // If negative, prepend the negative sign to the normalized positive value - if (value[0] === "-") { - // Strip off the negative sign - value = value.substring(1); - // Cannot have multiple negative signs (e.g. "--0x04") - if (value[0] === "-") { - logger$5.throwArgumentError("invalid hex", "value", value); - } - // Call toHex on the positive component - value = toHex(value); - // Do not allow "-0x00" - if (value === "0x00") { - return value; - } - // Negate the value - return "-" + value; - } - // Add a "0x" prefix if missing - if (value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - // Normalize zero - if (value === "0x") { - return "0x00"; - } - // Make the string even length - if (value.length % 2) { - value = "0x0" + value.substring(2); - } - // Trim to smallest even-length string - while (value.length > 4 && value.substring(0, 4) === "0x00") { - value = "0x" + value.substring(4); - } - return value; - } - // @ts-ignore - function toBigNumber(value) { - return BigNumber.from(toHex(value)); - } - // @ts-ignore - function toBN(value) { - const hex = BigNumber.from(value).toHexString(); - if (hex[0] === "-") { - return new BN("-" + hex.substring(3), 16); - } - return new BN(hex.substring(2), 16); - } - function throwFault(fault, operation, value) { - const params = { fault: fault, operation: operation }; - if (value != null) { - params.value = value; - } - return logger$5.throwError(fault, Logger.errors.NUMERIC_FAULT, params); - } - - const logger$4 = new Logger("rlp/0.0.1"); - function arrayifyInteger$1(value) { - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value >>= 8; - } - return result; - } - function unarrayifyInteger$1(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; - } - function _encode$1(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode$1(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger$1(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - if (!isBytesLike(object)) { - logger$4.throwArgumentError("RLP object must be BytesLike", "object", object); - } - const data = Array.prototype.slice.call(arrayify(object)); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger$1(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); - } - function encode(object) { - return hexlify(_encode$1(object)); - } - function _decodeChildren$1(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode$1(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - if (childOffset > offset + 1 + length) { - logger$4.throwError("child data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - } - return { consumed: 1 + length, result: result }; - } - // returns { consumed: number, result: Object } - function _decode$1(data, offset) { - if (data.length === 0) { - logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - if (offset + 1 + lengthLength > data.length) { - logger$4.throwError("data short segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger$1(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger$4.throwError("data long segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren$1(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - if (offset + 1 + length > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren$1(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - if (offset + 1 + lengthLength > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger$1(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - if (offset + 1 + length > data.length) { - logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlify(data[offset]) }; - } - function decode$1(data) { - const bytes = arrayify(data); - const decoded = _decode$1(bytes, 0); - if (decoded.consumed !== bytes.length) { - logger$4.throwArgumentError("invalid rlp data", "data", data); - } - return decoded.result; - } - - function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`Wrong positive integer: ${n}`); - } - function bytes(b, ...lengths) { - if (!(b instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); - } - function hash(hash) { - if (typeof hash !== 'function' || typeof hash.create !== 'function') - throw new Error('Hash should be wrapped by utils.wrapConstructor'); - number(hash.outputLen); - number(hash.blockLen); - } - function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); - } - function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } - } - - /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ - // We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. - // node.js versions earlier than v19 don't declare it in global scope. - // For node.js, package.json#exports field mapping rewrites import - // from `crypto` to `cryptoNode`, which imports native module. - // Makes the utils un-importable in browsers without a bundler. - // Once node.js 18 is deprecated, we can just drop the import. - const u8a = (a) => a instanceof Uint8Array; - const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); - // Cast array to view - const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); - // The rotate right (circular right shift) operation for uint32 - const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); - // big-endian hardware is rare. Just in case someone still decides to run hashes: - // early-throw an error because we don't support BE yet. - const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; - if (!isLE) - throw new Error('Non little-endian hardware is not supported'); - // There is no setImmediate in browser and setTimeout is slow. - // call of async fn will return Promise, which will be fullfiled only on - // next scheduler queue processing step and this is exactly what we need. - const nextTick = async () => { }; - // Returns control to thread each 'tick' ms to avoid blocking - async function asyncLoop(iters, tick, cb) { - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(); - ts += diff; - } - } - /** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ - function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 - } - /** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ - function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - if (!u8a(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; - } - // For runtime check if class implements interface - class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); - } - } - const toStr = {}.toString; - function checkOpts(defaults, opts) { - if (opts !== undefined && toStr.call(opts) !== '[object Object]') - throw new Error('Options should be object or undefined'); - const merged = Object.assign(defaults, opts); - return merged; - } - function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; - } - - // HMAC (RFC 2104) - class HMAC extends Hash { - constructor(hash$1, _key) { - super(); - this.finished = false; - this.destroyed = false; - hash(hash$1); - const key = toBytes(_key); - this.iHash = hash$1.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('Expected instance of class which extends utils.Hash'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash$1.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of first block) of outer hash here we can re-use it between multiple calls via clone - this.oHash = hash$1.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - pad.fill(0); - } - update(buf) { - exists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - exists(this); - bytes(out, this.outputLen); - this.finished = true; - this.iHash.digestInto(out); - this.oHash.update(out); - this.oHash.digestInto(out); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since key already in state and we don't know it. - to || (to = Object.create(Object.getPrototypeOf(this), {})); - const { oHash, iHash, finished, destroyed, blockLen, outputLen } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } - } - /** - * HMAC: RFC2104 message authentication code. - * @param hash - function that would be used e.g. sha256 - * @param key - message key - * @param message - message data - */ - const hmac = (hash, key, message) => new HMAC(hash, key).update(message).digest(); - hmac.create = (hash, key) => new HMAC(hash, key); - - // Common prologue and epilogue for sync/async functions - function pbkdf2Init(hash$1, _password, _salt, _opts) { - hash(hash$1); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - number(c); - number(dkLen); - number(asyncTick); - if (c < 1) - throw new Error('PBKDF2: iterations (c) should be >= 1'); - const password = toBytes(_password); - const salt = toBytes(_salt); - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - // U1 = PRF(Password, Salt + INT_32_BE(i)) - const PRF = hmac.create(hash$1, password); - const PRFSalt = PRF._cloneInto().update(salt); - return { c, dkLen, asyncTick, DK, PRF, PRFSalt }; - } - function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) { - PRF.destroy(); - PRFSalt.destroy(); - if (prfW) - prfW.destroy(); - u.fill(0); - return DK; - } - /** - * PBKDF2-HMAC: RFC 2898 key derivation function - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated - * @param salt - cryptographic salt - * @param opts - {c, dkLen} where c is work factor and dkLen is output message size - */ - function pbkdf2$1(hash, password, salt, opts) { - const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts); - let prfW; // Working copy - const arr = new Uint8Array(4); - const view = createView(arr); - const u = new Uint8Array(PRF.outputLen); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) { - // Ti = F(Password, Salt, c, i) - const Ti = DK.subarray(pos, pos + PRF.outputLen); - view.setInt32(0, ti, false); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - for (let ui = 1; ui < c; ui++) { - // Uc = PRF(Password, Uc−1) - PRF._cloneInto(prfW).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - } - return pbkdf2Output(PRF, PRFSalt, DK, prfW, u); - } - - // Polyfill for Safari 14 - function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); - } - // Base SHA2 class (RFC 6234) - class SHA2 extends Hash { - constructor(blockLen, outputLen, padOffset, isLE) { - super(); - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - exists(this); - const { view, buffer, blockLen } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - continue; - } - buffer.set(data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - } - } - this.length += data.length; - this.roundClean(); - return this; - } - digestInto(out) { - exists(this); - output(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message - buffer[pos++] = 0b10000000; - this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); - this.process(view, 0); - const oview = createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); - const outLen = len / 4; - const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; - to.length = length; - to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); - return to; - } - } - - // SHA2-256 need to try 2^128 hashes to execute birthday attack. - // BTC network is doing 2^67 hashes/sec as per early 2023. - // Choice: a ? b : c - const Chi = (a, b, c) => (a & b) ^ (~a & c); - // Majority function, true if any two inpust is true - const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); - // Round constants: - // first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) - // prettier-ignore - const SHA256_K = /* @__PURE__ */ new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 - ]); - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // prettier-ignore - const IV = /* @__PURE__ */ new Uint32Array([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 - ]); - // Temporary buffer, not used to store anything between runs - // Named this way because it matches specification. - const SHA256_W = /* @__PURE__ */ new Uint32Array(64); - class SHA256 extends SHA2 { - constructor() { - super(64, 32, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - SHA256_W.fill(0); - } - destroy() { - this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); - } - } - /** - * SHA2-256 hash function - * @param message - data that would be hashed - */ - const sha256$1 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); - - const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); - const _32n = /* @__PURE__ */ BigInt(32); - // We are not using BigUint64Array, because they are extremely slow as per 2022 - function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; - } - function split(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; - } - const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); - // for Shift in [0, 32) - const shrSH = (h, _l, s) => h >>> s; - const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); - // Right rotate for Shift in [1, 32) - const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); - const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); - // Right rotate for Shift in (32, 64), NOTE: 32 is special case. - const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); - const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); - // Right rotate for shift===32 (just swaps l&h) - const rotr32H = (_h, l) => l; - const rotr32L = (h, _l) => h; - // Left rotate for Shift in [1, 32) - const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); - const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); - // Left rotate for Shift in (32, 64), NOTE: 32 is special case. - const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); - const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); - // JS uses 32-bit signed integers for bitwise operations which means we cannot - // simple take carry out of low bit sum by shift, we need to use division. - function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; - } - // Addition with more than 2 elements - const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); - const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; - const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); - const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; - const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); - const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; - // prettier-ignore - const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, - }; - var u64$1 = u64; - - // Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409): - // prettier-ignore - const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64$1.split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' - ].map(n => BigInt(n))))(); - // Temporary buffer, not used to store anything between runs - const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); - const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); - class SHA512 extends SHA2 { - constructor() { - super(128, 64, 16, false); - // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers. - // Also looks cleaner and easier to verify with spec. - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x6a09e667 | 0; - this.Al = 0xf3bcc908 | 0; - this.Bh = 0xbb67ae85 | 0; - this.Bl = 0x84caa73b | 0; - this.Ch = 0x3c6ef372 | 0; - this.Cl = 0xfe94f82b | 0; - this.Dh = 0xa54ff53a | 0; - this.Dl = 0x5f1d36f1 | 0; - this.Eh = 0x510e527f | 0; - this.El = 0xade682d1 | 0; - this.Fh = 0x9b05688c | 0; - this.Fl = 0x2b3e6c1f | 0; - this.Gh = 0x1f83d9ab | 0; - this.Gl = 0xfb41bd6b | 0; - this.Hh = 0x5be0cd19 | 0; - this.Hl = 0x137e2179 | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64$1.rotrSH(W15h, W15l, 1) ^ u64$1.rotrSH(W15h, W15l, 8) ^ u64$1.shrSH(W15h, W15l, 7); - const s0l = u64$1.rotrSL(W15h, W15l, 1) ^ u64$1.rotrSL(W15h, W15l, 8) ^ u64$1.shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64$1.rotrSH(W2h, W2l, 19) ^ u64$1.rotrBH(W2h, W2l, 61) ^ u64$1.shrSH(W2h, W2l, 6); - const s1l = u64$1.rotrSL(W2h, W2l, 19) ^ u64$1.rotrBL(W2h, W2l, 61) ^ u64$1.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64$1.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64$1.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64$1.rotrSH(Eh, El, 14) ^ u64$1.rotrSH(Eh, El, 18) ^ u64$1.rotrBH(Eh, El, 41); - const sigma1l = u64$1.rotrSL(Eh, El, 14) ^ u64$1.rotrSL(Eh, El, 18) ^ u64$1.rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = u64$1.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64$1.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64$1.rotrSH(Ah, Al, 28) ^ u64$1.rotrBH(Ah, Al, 34) ^ u64$1.rotrBH(Ah, Al, 39); - const sigma0l = u64$1.rotrSL(Ah, Al, 28) ^ u64$1.rotrBL(Ah, Al, 34) ^ u64$1.rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = u64$1.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = u64$1.add3L(T1l, sigma0l, MAJl); - Ah = u64$1.add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64$1.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64$1.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64$1.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64$1.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64$1.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64$1.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64$1.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64$1.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - SHA512_W_H.fill(0); - SHA512_W_L.fill(0); - } - destroy() { - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - } - const sha512$1 = /* @__PURE__ */ wrapConstructor(() => new SHA512()); - - // SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. - // It's called a sponge function. - // Various per round constants calculations - const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; - const _0n = /* @__PURE__ */ BigInt(0); - const _1n = /* @__PURE__ */ BigInt(1); - const _2n = /* @__PURE__ */ BigInt(2); - const _7n = /* @__PURE__ */ BigInt(7); - const _256n = /* @__PURE__ */ BigInt(256); - const _0x71n = /* @__PURE__ */ BigInt(0x71); - for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); - } - const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true); - // Left rotation (without 0, 32, 64) - const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); - const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); - // Same as keccakf1600, but allows to skip some rounds - function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - B.fill(0); - } - class Keccak extends Hash { - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; - // Can be passed from user as dkLen - number(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - keccak() { - keccakP(this.state32, this.rounds); - this.posOut = 0; - this.pos = 0; - } - update(data) { - exists(this); - const { blockLen, state } = this; - data = toBytes(data); - const len = data.length; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // Do the padding - state[pos] ^= suffix; - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - exists(this, false); - bytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF - if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); - return this.writeInto(out); - } - xof(bytes) { - number(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - output(out, this); - if (this.finished) - throw new Error('digest() was already called'); - this.writeInto(out); - this.destroy(); - return out; - } - digest() { - return this.digestInto(new Uint8Array(this.outputLen)); - } - destroy() { - this.destroyed = true; - this.state.fill(0); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); - to.state32.set(this.state32); - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - to.destroyed = this.destroyed; - return to; - } - } - const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); - /** - * SHA3-256 hash function - * @param message - that would be hashed - */ - const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8); - const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8); - /** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed - */ - const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8); - - /** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ - const BN_0$9 = BigInt(0); - const BN_1$5 = BigInt(1); - //const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; - // IEEE 754 support 53-bits of mantissa - const maxValue = 0x1fffffffffffff; - /** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ - function fromTwos(_value, _width) { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - assert(value >> width === BN_0$9, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", - fault: "overflow", - value: _value, - }); - // Top bit set; treat as a negative value - if (value >> (width - BN_1$5)) { - const mask = (BN_1$5 << width) - BN_1$5; - return -((~value & mask) + BN_1$5); - } - return value; - } - /** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ - function toTwos(_value, _width) { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = BN_1$5 << (width - BN_1$5); - if (value < BN_0$9) { - value = -value; - assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - const mask = (BN_1$5 << width) - BN_1$5; - return (~value & mask) + BN_1$5; - } - else { - assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - } - return value; - } - /** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ - function mask(_value, _bits) { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1$5 << bits) - BN_1$5); - } - /** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ - function getBigInt(value, name) { - switch (typeof value) { - case "bigint": - return value; - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } - catch (e) { - assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid BigNumberish value", name || "value", value); - } - function getUint(value, name) { - const result = getBigInt(value, name); - assert(result >= BN_0$9, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", - operation: "getUint", - value, - }); - return result; - } - const Nibbles = "0123456789abcdef"; - /* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ - function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles[v >> 4]; - result += Nibbles[v & 0x0f]; - } - return BigInt(result); - } - return getBigInt(value); - } - /** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ - function getNumber(value, name) { - switch (typeof value) { - case "bigint": - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } - catch (e) { - assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid numeric value", name || "value", value); - } - /** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ - function toNumber(value) { - return getNumber(toBigInt(value)); - } - /** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ - function toBeHex(_value, _width) { - const value = getUint(_value, "value"); - let result = value.toString(16); - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } - else { - const width = getNumber(_width, "width"); - assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value, - }); - // Pad the value to the required width - while (result.length < width * 2) { - result = "0" + result; - } - } - return "0x" + result; - } - /** - * Converts %%value%% to a Big Endian Uint8Array. - */ - function toBeArray(_value) { - const value = getUint(_value, "value"); - if (value === BN_0$9) { - return new Uint8Array([]); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - return result; - } - /** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ - function toQuantity(value) { - let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; - } - - /** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ - const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; - let Lookup = null; - function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; - } - const BN_0$8 = BigInt(0); - const BN_58 = BigInt(58); - /** - * Encode %%value%% as a Base58-encoded string. - */ - function encodeBase58(_value) { - let value = toBigInt(getBytes(_value)); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - return result; - } - /** - * Decode the Base58-encoded %%value%%. - */ - function decodeBase58(value) { - let result = BN_0$8; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; - } - - // utils/base64-browser - function decodeBase64(textData) { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return getBytes(data); - } - function encodeBase64(_data) { - const data = getBytes(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); - } - - /** - * Explain events... - * - * @_section api/utils/events:Events [about-events] - */ - /** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ - class EventPayload { - /** - * The event filter. - */ - filter; - /** - * The **EventEmitterable**. - */ - emitter; - #listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter, listener, filter) { - this.#listener = listener; - defineProperties(this, { emitter, filter }); - } - /** - * Unregister the triggered listener for future events. - */ - async removeListener() { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } - } - - /** - * Using strings in Core (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ - function errorFunc(reason, offset, bytes, output, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); - } - function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; - } - function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes); - } - /** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ - const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc, - }); - // http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 - function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; - } - // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array - /** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ - function toUtf8Bytes(str, form) { - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); - } - //export - function _toUtf8String(codePoints) { - return codePoints - .map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00); - }) - .join(""); - } - /** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ - function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); - } - /** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ - function toUtf8CodePoints(str, form) { - return getUtf8CodePoints(toUtf8Bytes(str, form)); - } - - // @TODO: timeout is completely ignored; start a Promise.any with a reject? - // @ts-ignore - async function getUrl(req, _signal) { - const protocol = req.url.split(":")[0].toLowerCase(); - assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request", - }); - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request", - }); - let signal = undefined; - if (_signal) { - const controller = new AbortController(); - signal = controller.signal; - _signal.addListener(() => { - controller.abort(); - }); - } - const init = { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal, - }; - try { - const resp = await fetch(req.url, init); - const headers = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - const respBody = await resp.arrayBuffer(); - const body = respBody == null ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, - body, - }; - } - catch (error) { - console.log({ error }); - return undefined; - } - } - - /** - * Explain fetching here... - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ - const MAX_ATTEMPTS = 12; - const SLOT_INTERVAL = 250; - // The global FetchGetUrlFunc implementation. - let getUrlFunc = getUrl; - const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); - const reIpfs = new RegExp("^ipfs://(ipfs/)?(.*)$", "i"); - // If locked, new Gateways cannot be added - let locked$5 = false; - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs - async function dataGatewayFunc(url, signal) { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse(200, "OK", { - "content-type": match[1] || "text/plain", - }, match[2] ? decodeBase64(match[3]) : unpercent(match[3])); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); - } - } - /** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ - function getIpfsGatewayFunc(baseUrl) { - async function gatewayIpfs(url, signal) { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); - } - } - return gatewayIpfs; - } - const Gateways = { - data: dataGatewayFunc, - ipfs: getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/"), - }; - const fetchSignals = new WeakMap(); - /** - * @_ignore - */ - class FetchCancelSignal { - #listeners; - #cancelled; - constructor(request) { - this.#listeners = []; - this.#cancelled = false; - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - for (const listener of this.#listeners) { - setTimeout(() => { - listener(); - }, 0); - } - this.#listeners = []; - }); - } - addListener(listener) { - assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener", - }); - this.#listeners.push(listener); - } - get cancelled() { - return this.#cancelled; - } - checkSignal() { - assert(!this.cancelled, "cancelled", "CANCELLED", {}); - } - } - // Check the signal, throwing if it is cancelled - function checkSignal(signal) { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; - } - /** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ - class FetchRequest { - #allowInsecure; - #gzip; - #headers; - #method; - #timeout; - #url; - #body; - #bodyType; - #creds; - // Hooks - #preflight; - #process; - #retry; - #signal; - #throttle; - /** - * The fetch URI to requrest. - */ - get url() { - return this.#url; - } - set url(url) { - this.#url = String(url); - } - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . - * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrincis ``Content-Type`` is - * set to ``application/json``. - */ - get body() { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } - else if (typeof body === "string") { - this.#body = toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } - else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } - else if (typeof body === "object") { - this.#body = toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } - else { - throw new Error("invalid body"); - } - } - /** - * Returns true if the request has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method() { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any chnages will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers() { - const headers = Object.assign({}, this.#headers); - if (this.#creds) { - headers["authorization"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`; - } - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - return headers; - } - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key, value) { - this.#headers[String(key).toLowerCase()] = String(value); - } - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders() { - this.#headers = {}; - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials() { - return this.#creds || null; - } - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username, password) { - assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${username}:${password}`; - } - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip() { - return this.#gzip; - } - set allowGzip(value) { - this.#gzip = !!value; - } - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication() { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value) { - this.#allowInsecure = !!value; - } - /** - * The timeout (in milliseconds) to wait for a complere response. - * //(default: 5 minutes)// - */ - get timeout() { - return this.#timeout; - } - set timeout(timeout) { - assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc() { - return this.#preflight || null; - } - set preflightFunc(preflight) { - this.#preflight = preflight; - } - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc() { - return this.#process || null; - } - set processFunc(process) { - this.#process = process; - } - /** - * This function is called on each retry attempt. - */ - get retryFunc() { - return this.#retry || null; - } - set retryFunc(retry) { - this.#retry = retry; - } - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url) { - this.#url = String(url); - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS, - }; - } - toString() { - return ``; - } - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params) { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - async #send(attempt, expires, delay, _request, _response) { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - assert(getTime$2() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", - reason: "timeout", - request: _request, - }); - if (delay > 0) { - await wait(delay); - } - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Ignore throttling - } - } - return response; - } - req = result; - } - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - const resp = await getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req - .redirect(location) - .#send(attempt + 1, expires, 0, _request, response); - } - catch (error) { } - // Things won't get any better on another attempt; abort - return response; - } - else if (response.statusCode === 429) { - // Throttle - if (this.retryFunc == null || - (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof retryAfter === "string" && - retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Throttle - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (error.stall >= 0) { - delay = error.stall; - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - return response; - } - /** - * Resolves to the response by sending the request. - */ - send() { - assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime$2() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); - } - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel() { - assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location) { - // Redirection; for now we only support absolute locataions - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - assert(this.method === "GET" && - (current !== "https" || target !== "http") && - location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`, - }); - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - return req; - } - /** - * Create a new copy of this request. - */ - clone() { - const clone = new FetchRequest(this.url); - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - if (this.allowGzip) { - clone.allowGzip = true; - } - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - return clone; - } - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig() { - locked$5 = true; - } - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme) { - return Gateways[scheme.toLowerCase()] || null; - } - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme, func) { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked$5) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl) { - if (locked$5) { - throw new Error("gateways locked"); - } - getUrlFunc = getUrl; - } - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway() { - return dataGatewayFunc; - } - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl) { - return getIpfsGatewayFunc(baseUrl); - } - } - /** - * The response for a FetchREquest. - */ - class FetchResponse { - #statusCode; - #statusMessage; - #headers; - #body; - #request; - #error; - toString() { - return ``; - } - /** - * The response status code. - */ - get statusCode() { - return this.#statusCode; - } - /** - * The response status message. - */ - get statusMessage() { - return this.#statusMessage; - } - /** - * The response headers. All keys are lower-case. - */ - get headers() { - return Object.assign({}, this.#headers); - } - /** - * The response body, or ``null`` if there was no body. - */ - get body() { - return this.#body == null ? null : new Uint8Array(this.#body); - } - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText() { - try { - return this.#body == null ? "" : toUtf8String(this.#body); - } - catch (error) { - assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", - info: { response: this }, - }); - } - } - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson() { - try { - return JSON.parse(this.bodyText); - } - catch (error) { - assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", - info: { response: this }, - }); - } - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - constructor(statusCode, statusMessage, headers, body, request) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, {}); - this.#body = body == null ? null : new Uint8Array(body); - this.#request = request || null; - this.#error = { message: "" }; - } - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message, error) { - let statusMessage; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } - else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message, stall) { - if (stall == null) { - stall = -1; - } - else { - assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - const error = new Error(message || "throttling requests"); - defineProperties(error, { stall, throttle: true }); - throw error; - } - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Returns true of the response has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The request made for this response. - */ - get request() { - return this.#request; - } - /** - * Returns true if this response was a success statusCode. - */ - ok() { - return (this.#error.message === "" && - this.statusCode >= 200 && - this.statusCode < 300); - } - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk() { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - assert(false, message, "SERVER_ERROR", { - request: this.request || "unknown request", - response: this, - error, - }); - } - } - function getTime$2() { - return new Date().getTime(); - } - function unpercent(value) { - return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); - } - function wait(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); - } - - var _a$1; - const BN_N1 = BigInt(-1); - const BN_0$7 = BigInt(0); - const BN_1$4 = BigInt(1); - const BN_5 = BigInt(5); - const _guard$5 = {}; - // Constant to pull zeros from for multipliers - let Zeros = "0000"; - while (Zeros.length < 80) { - Zeros += Zeros; - } - // Returns a string "1" followed by decimal "0"s - function getTens(decimals) { - let result = Zeros; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); - } - function checkValue(val, format, safeOp) { - const width = BigInt(format.width); - if (format.signed) { - const limit = BN_1$4 << (width - BN_1$4); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - if (val > BN_0$7) { - val = fromTwos(mask(val, width), width); - } - else { - val = -fromTwos(mask(-val, width), width); - } - } - else { - const limit = BN_1$4 << width; - assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - val = ((val % limit) + limit) % limit & (limit - BN_1$4); - } - return val; - } - function getFormat(value) { - if (typeof value === "number") { - value = `fixed128x${value}`; - } - let signed = true; - let width = 128; - let decimals = 18; - if (typeof value === "string") { - // Parse the format string - if (value === "fixed") ; - else if (value === "ufixed") { - signed = false; - } - else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - assertArgument(match, "invalid fixed format", "format", value); - signed = match[1] !== "u"; - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } - else if (value) { - // Extract the values from the object - const v = value; - const check = (key, type, defaultValue) => { - if (v[key] == null) { - return defaultValue; - } - assertArgument(typeof v[key] === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - assertArgument(width % 8 === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - return { signed, width, decimals, name }; - } - function toString(val, decimals) { - let negative = ""; - if (val < BN_0$7) { - negative = "-"; - val *= BN_N1; - } - let str = val.toString(); - // No decimal point for whole values - if (decimals === 0) { - return negative + str; - } - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros + str; - } - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - return negative + str; - } - /** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, an value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ - class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - format; - #format; - // The actual value (accounting for decimals) - #val; - // A base-10 value to multiple values by to maintain the magnitude - #tens; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - _value; - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - /** - * @private - */ - constructor(guard, value, format) { - assertPrivate(guard, _guard$5, "FixedNumber"); - this.#val = value; - this.#format = format; - const _value = toString(value, format.decimals); - defineProperties(this, { format: format.name, _value }); - this.#tens = getTens(format.decimals); - } - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed() { - return this.#format.signed; - } - /** - * The number of bits available to store the value. - */ - get width() { - return this.#format.width; - } - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals() { - return this.#format.decimals; - } - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value() { - return this.#val; - } - #checkFormat(other) { - assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); - } - #checkValue(val, safeOp) { - /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } - */ - val = checkValue(val, this.#format, safeOp); - return new _a$1(_guard$5, val, this.#format); - } - #add(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other) { - return this.#add(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other) { - return this.#add(other, "add"); - } - #sub(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other) { - return this.#sub(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other) { - return this.#sub(other, "sub"); - } - #mul(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other) { - return this.#mul(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other) { - return this.#mul(other, "mul"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other) { - this.#checkFormat(other); - const value = this.#val * other.#val; - assert(value % this.#tens === BN_0$7, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - #div(o, safeOp) { - assert(o.#val !== BN_0$7, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other) { - return this.#div(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other) { - return this.#div(other, "div"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other) { - assert(other.#val !== BN_0$7, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(other); - const value = this.#val * this.#tens; - assert(value % other.#val === BN_0$7, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%other%% is larger and ``0`` implies - * both are equal. - */ - cmp(other) { - let a = this.value, b = other.value; - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } - else if (delta < 0) { - a *= getTens(-delta); - } - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return -1; - } - return 0; - } - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other) { - return this.cmp(other) === 0; - } - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other) { - return this.cmp(other) < 0; - } - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other) { - return this.cmp(other) <= 0; - } - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other) { - return this.cmp(other) > 0; - } - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other) { - return this.cmp(other) >= 0; - } - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor() { - let val = this.#val; - if (this.#val < BN_0$7) { - val -= this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling() { - let val = this.#val; - if (this.#val > BN_0$7) { - val += this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals) { - if (decimals == null) { - decimals = 0; - } - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - checkValue(value, this.#format, "round"); - return new _a$1(_guard$5, value, this.#format); - } - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero() { - return this.#val === BN_0$7; - } - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative() { - return this.#val < BN_0$7; - } - /** - * Returns the string representation of %%this%%. - */ - toString() { - return this._value; - } - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat() { - return parseFloat(this.toString()); - } - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format) { - return _a$1.fromString(this.toString(), format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value, decimals, _format) { - if (decimals == null) { - decimals = 0; - } - const format = getFormat(_format); - let value = getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - assert(value % tens === BN_0$7, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", - fault: "underflow", - value: _value, - }); - value /= tens; - } - else if (delta < 0) { - value *= getTens(-delta); - } - checkValue(value, format, "fromValue"); - return new _a$1(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value, _format) { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - assertArgument(match && match[2].length + match[3].length > 0, "invalid FixedNumber string value", "value", _value); - const format = getFormat(_format); - let whole = match[2] || "0", decimal = match[3] || ""; - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros; - } - // Check precision is safe - assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", - fault: "underflow", - value: _value, - }); - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - const value = BigInt(match[1] + whole + decimal); - checkValue(value, format, "fromString"); - return new _a$1(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value, _format) { - let value = toBigInt(getBytes(_value, "value")); - const format = getFormat(_format); - if (format.signed) { - value = fromTwos(value, format.width); - } - checkValue(value, format, "fromBytes"); - return new _a$1(_guard$5, value, format); - } - } - _a$1 = FixedNumber; - //const f1 = FixedNumber.fromString("12.56", "fixed16x2"); - //const f2 = FixedNumber.fromString("0.3", "fixed16x2"); - //console.log(f1.divSignal(f2)); - //const BUMP = FixedNumber.from("0.5"); - - function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; - } - function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; - } - function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, - length, - offset, - }); - } - return { consumed: 1 + length, result: result }; - } - // returns { consumed: number, result: Object } - function _decode(data, offset) { - assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, - length: 0, - offset: 1, - }); - const checkOffset = (offset) => { - assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, - length: data.length, - offset, - }); - }; - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - return _decodeChildren(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlifyByte(data[offset]) }; - } - /** - * Decodes %%data%% into the structured data it represents. - */ - function decodeRlp(_data) { - const data = getBytes(_data, "data"); - const decoded = _decode(data, 0); - assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; - } - - function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; - } - function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - const data = Array.prototype.slice.call(getBytes(object, "object")); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); - } - const nibbles = "0123456789abcdef"; - /** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ - function encodeRlp(object) { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; - } - - /** - * Most interactions with Core requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Core, //Core// is divisible to 18 decimal places, - * where each individual unit is called a //ore//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ - const names = [ - ///Ore, the smallest and atomic amount of Core - "ore", - ///fecore, 1000 ore - "fecore", - ///Picore, one million ore - "picore", - ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices. - "nacore", - ///Μcore, 10^12 ore or 1 μCore - "mcore", - ///micore, 10^15 ore or 1 mcore - "micore", - "core", - ]; - /** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit - * - */ - function formatUnits(value, unit) { - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromValue(value, decimals, { decimals }).toString(); - } - /** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit. - */ - const scientificToDecimal = (num) => { - // @ts-ignore - var nsign = Math.sign(num); - //remove the sign - // @ts-ignore - num = Math.abs(num); - //if the number is in scientific notation remove it - // @ts-ignore - if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) { - var zero = "0", - // @ts-ignore - parts = String(num).toLowerCase().split("e"), //split into coeff and exponent - e = parts.pop(), //store the exponential part - // @ts-ignore - l = Math.abs(e), //get the number of zeros - // @ts-ignore - sign = e / l, coeff_array = parts[0].split("."); - if (sign === -1) { - l = l - coeff_array[0].length; - if (l < 0) { - // @ts-ignore - num = - coeff_array[0].slice(0, l) + - "." + - coeff_array[0].slice(l) + - (coeff_array.length === 2 ? coeff_array[1] : ""); - } - else { - // @ts-ignore - num = zero + "." + new Array(l + 1).join(zero) + coeff_array.join(""); - } - } - else { - var dec = coeff_array[1]; - if (dec) - l = l - dec.length; - if (l < 0) { - // @ts-ignore - num = coeff_array[0] + dec.slice(0, l) + "." + dec.slice(l); - } - else { - // @ts-ignore - num = coeff_array.join("") + new Array(l + 1).join(zero); - } - } - } - // @ts-ignore - return nsign < 0 ? "-" + num : num; - }; - const trimDecimals = (n, decimals = 18) => { - n += ""; - if (n.indexOf(".") === -1) - return n; - const arr = n.split("."); - const fraction = arr[1].substr(0, decimals); - return arr[0] + "." + fraction; - }; - function parseUnits(value, unit) { - assertArgument(typeof value === "string", "value must be a string", "value", value); - if (value.includes("e")) { - value = scientificToDecimal(value).toString(); - } - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - value = trimDecimals(value, decimals); - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - value = trimDecimals(value, decimals); - } - return FixedNumber.fromString(value, { decimals }).value; - } - /** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ - function formatXCB(ore) { - return formatUnits(ore, 18); - } - /** - * Converts the //decimal string// %%xcb%% to a BigInt, using 18 - * decimal places. - */ - function parseXCB(xcb) { - return parseUnits(xcb, 18); - } - - /** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ - /** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ - function uuidV4(randomBytes) { - const bytes = getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); - } - - // @ts-ignore - class Ed448Goldilock { - static _channel = ed448; - static generatePrivateKey() { - var privateKey = ed448.privateKeyGenerate(); - privateKey[56] &= 0x7f; - return privateKey; - } - static getPublicKeyFromPrivateKey(privateKey) { - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var scalar = secret.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - var publicKey = this._channel.publicKeyFromScalar(scalar); - return Buffer.from(publicKey).toString("hex"); - } - else { - var publicKey = this._channel.publicKeyCreate(secret); - return Buffer.from(publicKey).toString("hex"); - } - } - static signWithPrivateKey(privateKey, msg) { - var msgToSign = Buffer.from(msg, "hex"); - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var prefix = secret.slice(0, 57); - prefix[0] &= 0xfc; - prefix[56] = 0; - prefix[55] |= 0x80; - var scalar = prefix.slice(0, 56); - var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return Buffer.from(signedMessage).toString("hex"); - } - else { - var signedMessage = this._channel.sign(msgToSign, secret); - return Buffer.from(signedMessage).toString("hex"); - } - } - static signWithPrivateKeyNConcatPubkey(privateKey, msg) { - var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); - var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); - return signedMessage + publicKey; - } - static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(msgHash, signedMsg, pubKey); - } - static SHA512Hash(password, salt) { - var p1 = Buffer.from(password, "hex"); - var s1 = Buffer.from(salt, "hex"); - return Buffer.from(pbkdf2$2.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); - } - static concatenateAndHex(prefix, key, index, salt) { - var ind = Buffer.alloc(4); - var p = Buffer.alloc(1); - p[0] = prefix % 256; - var j = index; - for (let i = 0; i < 4; i++) { - ind[i] = j % 256; - j = Math.floor(j / 256); - } - var t = p.toString("hex") + key + ind.toString("hex"); - return Ed448Goldilock.SHA512Hash(t, salt); - } - static addScalar(a, b) { - var a1 = Buffer.from(a, "hex"); - var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); - b1[0] &= 0xfc; - var c = Buffer.alloc(57); - var hold = 0; - for (let i = 0; i < 57; i++) { - hold += a1[i] + b1[i]; - c[i] = hold % 256; - hold = Math.floor(hold / 256); - } - return c.toString("hex"); - } - static seedToExtendedPrivate(seed) { - var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); - var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = Buffer.from(s2, "hex"); - b[56] |= 0x80; - b[55] |= 0x80; - b[55] &= 0xbf; - var s3 = b.toString("hex"); - return s1 + s3; - } - static childPrivateToPrivate(s, index) { - var s0 = s.substr(0, 114); - var s1 = s.substr(114, 228); - var r0, r1; - if (index >= 0x80000000) { - r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - else { - var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); - r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - } - static HDWalletGenerateKeyFromSeed(seed, index) { - var m = Ed448Goldilock.seedToExtendedPrivate(seed); - var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); - var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); - var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); - var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); - var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); - return k5.substr(114, 228); - } - } - - /* Browser Crypto Shims */ - function getGlobal$1() { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); - } - const anyGlobal = getGlobal$1(); - const crypto = anyGlobal.crypto || anyGlobal.msCrypto; - function createHash(algo) { - switch (algo) { - case "sha256": - return sha256$1.create(); - case "sha512": - return sha512$1.create(); - case "sha3-256": - return sha3_256.create(); - case "sha3-512": - return sha3_512.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); - } - function createHmac(_algo, key) { - const algo = { sha256: sha256$1, sha512: sha512$1 }[_algo]; - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac.create(algo, key); - } - function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = { sha256: sha256$1, sha512: sha512$1 }[_algo]; - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2$1(algo, password, salt, { c: iterations, dkLen: keylen }); - } - function randomBytes$1(length) { - assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes", - }); - assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; - } - - const _sha256 = function (data) { - let v = "0x" + - createHash("sha3-256") - .update(buffer.Buffer.from(arrayify(data))) - .digest("hex"); - return v; - }; - const _sha512 = function (data) { - let v = "0x" + - createHash("sha3-512") - .update(buffer.Buffer.from(arrayify(data))) - .digest("hex"); - return v; - }; - let locked256 = false, locked512 = false; - /** - * Compute the cryptographic SHA2-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ - var SupportedAlgorithm; - (function (SupportedAlgorithm) { - SupportedAlgorithm["sha256"] = "sha256"; - SupportedAlgorithm["sha512"] = "sha512"; - })(SupportedAlgorithm || (SupportedAlgorithm = {})); - function sha256(data) { - let createdHash = createHash("sha3-256") - .update(buffer.Buffer.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; - } - function legacySha256(data) { - const _data = getBytes(data, "data"); - const hexlified = hexlify(createHash("sha256").update(_data).digest()); - return hexlified; - } - sha256._ = _sha256; - sha256.lock = function () { - locked256 = true; - }; - sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - }; - Object.freeze(sha256); - /** - * Compute the cryptographic SHA2-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ - function sha512(data) { - let createdHash = createHash("sha3-512") - .update(buffer.Buffer.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; - } - sha512._ = _sha512; - sha512.lock = function () { - locked512 = true; - }; - sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - }; - Object.freeze(sha256); - - /** - * Addresses are a fundamental part of interacting with Core. They - * represent the gloabal identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Core Naming Service (CNS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ - const logger$3 = new Logger("address/0.0.1"); - const precompiledAddresses = [ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000002", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000005", - "0000000000000000000000000000000000000000000000000000000000000006", - "0000000000000000000000000000000000000000000000000000000000000007", - "0000000000000000000000000000000000000000000000000000000000000008", - "0000000000000000000000000000000000000000000000000000000000000009", - ]; - function removeHexPrefix$1(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; - } - function calculateCheckSum(_address, _prefix) { - const address = getBytes("0x" + _address.replace("0x", "")); - const prefix = getBytes("0x" + _prefix.replace("0x", "")); - const tmpConcated = new Uint8Array([...address, ...prefix]); - const hexedConcat = hexlify(tmpConcated).replace("0x", "") + "00"; - const mods = Array.from(hexedConcat.toUpperCase(), (c) => { - const charCode = c.charCodeAt(0); - return charCode > 64 && charCode < 91 - ? (charCode - 55).toString() - : (charCode - 48).toString(); - }).join(""); - const bigVal = BigInt(mods); - const val97 = BigInt(97); - const val98 = BigInt(98); - const remainder = bigVal % val97; - const checkSum = val98 - remainder; - const result = checkSum > 9 ? checkSum.toString() : "0" + checkSum.toString(); - return result; - } - /** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Core uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ - function getAddress(address) { - if (typeof address !== "string") { - logger$3.throwArgumentError("invalid address", "address", address); - } - if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) { - logger$3.throwArgumentError("invalid address", "address", address); - } - const raw = removeHexPrefix$1(address); - if (precompiledAddresses.includes(raw)) { - return "0x" + raw; - } - const prefix = raw.substring(0, 2); - const val = raw.substring(4); - const checksum = calculateCheckSum(val, prefix); - if (checksum !== raw.substring(2, 4)) { - logger$3.throwArgumentError("bad address checksum", "address", address); - } - return "0x" + prefix + checksum + val; - } - function networkIdToPrefix(networkId) { - if (networkId == 1) { - return "cb"; - } - else if (networkId == 3 || networkId == 4) { - return "ab"; - } - else if (networkId > 10 || networkId == 0) { - return "ce"; - } - else { - logger$3.throwArgumentError("bad networkId", "networkId", networkId); - return ""; - } - } - - /** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ - let locked$4 = false; - const _computeHmac = function (algorithm, key, data) { - return createHmac(algorithm, key).update(data).digest(); - }; - let __computeHmac = _computeHmac; - /** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ - function computeHmac(algorithm, _key, _data) { - const key = getBytes(_key, "key"); - const data = getBytes(_data, "data"); - return hexlify(__computeHmac(algorithm, key, data)); - } - computeHmac._ = _computeHmac; - computeHmac.lock = function () { - locked$4 = true; - }; - computeHmac.register = function (func) { - if (locked$4) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; - }; - Object.freeze(computeHmac); - - // https://homes.esat.kuleuven.be/~bosselae/ripemd160.html - // https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf - const Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]); - const Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i); - const Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16); - let idxL = [Id]; - let idxR = [Pi]; - for (let i = 0; i < 4; i++) - for (let j of [idxL, idxR]) - j.push(j[i].map((k) => Rho[k])); - const shifts = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], - ].map((i) => new Uint8Array(i)); - const shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j])); - const shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j])); - const Kl = /* @__PURE__ */ new Uint32Array([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, - ]); - const Kr = /* @__PURE__ */ new Uint32Array([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, - ]); - // The rotate left (circular left shift) operation for uint32 - const rotl$1 = (word, shift) => (word << shift) | (word >>> (32 - shift)); - // It's called f() in spec. - function f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - else if (group === 1) - return (x & y) | (~x & z); - else if (group === 2) - return (x | ~y) ^ z; - else if (group === 3) - return (x & z) | (y & ~z); - else - return x ^ (y | ~z); - } - // Temporary buffer, not used to store anything between runs - const BUF = /* @__PURE__ */ new Uint32Array(16); - class RIPEMD160 extends SHA2 { - constructor() { - super(64, 20, 8, true); - this.h0 = 0x67452301 | 0; - this.h1 = 0xefcdab89 | 0; - this.h2 = 0x98badcfe | 0; - this.h3 = 0x10325476 | 0; - this.h4 = 0xc3d2e1f0 | 0; - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl$1(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl$1(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl$1(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl$1(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - BUF.fill(0); - } - destroy() { - this.destroyed = true; - this.buffer.fill(0); - this.set(0, 0, 0, 0, 0); - } - } - /** - * RIPEMD-160 - a hash function from 1990s. - * @param message - msg that would be hashed - */ - const ripemd160$1 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160()); - - let locked$3 = false; - const _ripemd160 = function (data) { - return ripemd160$1(data); - }; - let __ripemd160 = _ripemd160; - /** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ - function ripemd160(_data) { - const data = getBytes(_data, "data"); - return hexlify(__ripemd160(data)); - } - ripemd160._ = _ripemd160; - ripemd160.lock = function () { - locked$3 = true; - }; - ripemd160.register = function (func) { - if (locked$3) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; - }; - Object.freeze(ripemd160); - - /** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ - let locked$2 = false; - const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return pbkdf2Sync(password, salt, iterations, keylen, algo); - }; - let __pbkdf2 = _pbkdf2; - /** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ - function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); - } - pbkdf2._ = _pbkdf2; - pbkdf2.lock = function () { - locked$2 = true; - }; - pbkdf2.register = function (func) { - if (locked$2) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; - }; - Object.freeze(pbkdf2); - - /** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ - let locked$1 = false; - const _randomBytes = function (length) { - return new Uint8Array(randomBytes$1(length)); - }; - let __randomBytes = _randomBytes; - /** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ - function randomBytes(length) { - return __randomBytes(length); - } - randomBytes._ = _randomBytes; - randomBytes.lock = function () { - locked$1 = true; - }; - randomBytes.register = function (func) { - if (locked$1) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; - }; - Object.freeze(randomBytes); - - // RFC 7914 Scrypt KDF - // Left rotate for uint32 - const rotl = (a, b) => (a << b) | (a >>> (32 - b)); - // The main Scrypt loop: uses Salsa extensively. - // Six versions of the function were tried, this is the fastest one. - // prettier-ignore - function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; - } - function BlockMix(input, ii, out, oi, r) { - // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks) - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1 - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - } - } - // Common prologue and epilogue for sync/async functions - function scryptInit(password, salt, _opts) { - // Maxmem - 1GB+1KB by default - const opts = checkOpts({ - dkLen: 32, - asyncTick: 10, - maxmem: 1024 ** 3 + 1024, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - number(N); - number(r); - number(p); - number(dkLen); - number(asyncTick); - number(maxmem); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('progressCb should be function'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) { - // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function - // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future. - throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32'); - } - if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) { - throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)'); - } - if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) { - throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32'); - } - const memUsed = blockSize * (N + p); - if (memUsed > maxmem) { - throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`); - } - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2$1(sha256$1, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) - onProgress(blockMixCnt / totalBlockMix); - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; - } - function scryptOutput(password, dkLen, B, V, tmp) { - const res = pbkdf2$1(sha256$1, password, B, { c: 1, dkLen }); - B.fill(0); - V.fill(0); - tmp.fill(0); - return res; - } - /** - * Scrypt KDF from RFC 7914. - * @param password - pass - * @param salt - salt - * @param opts - parameters - * - `N` is cpu/mem work factor (power of 2 e.g. 2**18) - * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance - * - `p` is parallelization factor (1 is common) - * - `dkLen` is output key length in bytes e.g. 32. - * - `asyncTick` - (default: 10) max time in ms for which async function can block execution - * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt - * - `onProgress` - callback function that would be executed for progress report - * @returns Derived key - */ - function scrypt$1(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - return scryptOutput(password, dkLen, B, V, tmp); - } - /** - * Scrypt KDF from RFC 7914. - */ - async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j] - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }); - } - return scryptOutput(password, dkLen, B, V, tmp); - } - - let lockedSync = false, lockedAsync = false; - const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await scryptAsync(passwd, salt, { N, r, p, dkLen, onProgress }); - }; - const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return scrypt$1(passwd, salt, { N, r, p, dkLen }); - }; - let __scryptAsync = _scryptAsync; - let __scryptSync = _scryptSync; - /** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ - async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); - } - scrypt._ = _scryptAsync; - scrypt.lock = function () { - lockedAsync = true; - }; - scrypt.register = function (func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; - }; - Object.freeze(scrypt); - /** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ - function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(__scryptSync(passwd, salt, N, r, p, dkLen)); - } - scryptSync._ = _scryptSync; - scryptSync.lock = function () { - lockedSync = true; - }; - scryptSync.register = function (func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; - }; - Object.freeze(scryptSync); - - /** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ - let locked = false; - const _keccak256 = function (data) { - return keccak_256(data); - }; - let __keccak256 = _keccak256; - /** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ - function keccak256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); - } - keccak256._ = _keccak256; - keccak256.lock = function () { - locked = true; - }; - keccak256.register = function (func) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; - }; - Object.freeze(keccak256); - - /*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ - const B256 = 2n ** 256n; // secp256k1 is short weierstrass curve - const P = B256 - 0x1000003d1n; // curve's field prime - const N$1 = B256 - 0x14551231950b75fc4402da1732fc9bebfn; // curve (group) order - const Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n; // base point x - const Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n; // base point y - const CURVE = { p: P, n: N$1, a: 0n, b: 7n, Gx, Gy }; // exported variables incl. a, b - const fLen = 32; // field / group byte length - const crv = (x) => mod(mod(x * x) * x + CURVE.b); // x³ + ax + b weierstrass formula; no a - const err = (m = '') => { throw new Error(m); }; // error helper, messes-up stack trace - const big = (n) => typeof n === 'bigint'; // is big integer - const str = (s) => typeof s === 'string'; // is string - const fe = (n) => big(n) && 0n < n && n < P; // is field element (invertible) - const ge = (n) => big(n) && 0n < n && n < N$1; // is group element - const au8 = (a, l) => // is Uint8Array (of specific length) - !(a instanceof Uint8Array) || (typeof l === 'number' && l > 0 && a.length !== l) ? - err('Uint8Array expected') : a; - const u8n = (data) => new Uint8Array(data); // creates Uint8Array - const toU8 = (a, len) => au8(str(a) ? h2b(a) : u8n(a), len); // norm(hex/u8a) to u8a - const mod = (a, b = P) => { let r = a % b; return r >= 0n ? r : b + r; }; // mod division - const isPoint = (p) => (p instanceof Point ? p : err('Point expected')); // is 3d point - let Gpows = undefined; // precomputes for base point G - class Point { - constructor(px, py, pz) { - this.px = px; - this.py = py; - this.pz = pz; - } //3d=less inversions - static fromAffine(p) { return new Point(p.x, p.y, 1n); } - static fromHex(hex) { - hex = toU8(hex); // convert hex string to Uint8Array - let p = undefined; - const head = hex[0], tail = hex.subarray(1); // first byte is prefix, rest is data - const x = slcNum(tail, 0, fLen), len = hex.length; // next 32 bytes are x coordinate - if (len === 33 && [0x02, 0x03].includes(head)) { // compressed points: 33b, start - if (!fe(x)) - err('Point hex invalid: x not FE'); // with byte 0x02 or 0x03. Check if 0 0n; d = d.double(), n >>= 1n) { // double-and-add ladder - if (n & 1n) - p = p.add(d); // if bit is present, add to point - else if (safe) - f = f.add(d); // if not, add to fake for timing safety - } - return p; - } - mulAddQUns(R, u1, u2) { - return this.mul(u1, false).add(R.mul(u2, false)).ok(); // Unsafe: do NOT use for stuff related - } // to private keys. Doesn't use Shamir trick - toAffine() { - const { px: x, py: y, pz: z } = this; // (x, y, z) ∋ (x=x/z, y=y/z) - if (this.equals(I)) - return { x: 0n, y: 0n }; // fast-path for zero point - if (z === 1n) - return { x, y }; // if z is 1, pass affine coordinates as-is - const iz = inv(z); // z^-1: invert z - if (mod(z * iz) !== 1n) - err('invalid inverse'); // (z * z^-1) must be 1, otherwise bad math - return { x: mod(x * iz), y: mod(y * iz) }; // x = x*z^-1; y = y*z^-1 - } - assertValidity() { - const { x, y } = this.aff(); // convert to 2d xy affine point. - if (!fe(x) || !fe(y)) - err('Point invalid: x or y'); // x and y must be in range 0 < n < P - return mod(y * y) === crv(x) ? // y² = x³ + ax + b, must be equal - this : err('Point invalid: not on curve'); - } - multiply(n) { return this.mul(n); } // Aliases to compress code - aff() { return this.toAffine(); } - ok() { return this.assertValidity(); } - toHex(isCompressed = true) { - const { x, y } = this.aff(); // convert to 2d xy affine point - const head = isCompressed ? ((y & 1n) === 0n ? '02' : '03') : '04'; // 0x02, 0x03, 0x04 prefix - return head + n2h(x) + (isCompressed ? '' : n2h(y)); // prefix||x and ||y - } - toRawBytes(isCompressed = true) { - return h2b(this.toHex(isCompressed)); // re-use toHex(), convert hex to bytes - } - } - Point.BASE = new Point(Gx, Gy, 1n); // Generator / base point - Point.ZERO = new Point(0n, 1n, 0n); // Identity / zero point - const { BASE: G, ZERO: I } = Point; // Generator, identity points - const padh = (n, pad) => n.toString(16).padStart(pad, '0'); - const b2h = (b) => Array.from(b).map(e => padh(e, 2)).join(''); // bytes to hex - const h2b = (hex) => { - const l = hex.length; // error if not string, - if (!str(hex) || l % 2) - err('hex invalid 1'); // or has odd length like 3, 5. - const arr = u8n(l / 2); // create result array - for (let i = 0; i < arr.length; i++) { - const j = i * 2; - const h = hex.slice(j, j + 2); // hexByte. slice is faster than substr - const b = Number.parseInt(h, 16); // byte, created from string part - if (Number.isNaN(b) || b < 0) - err('hex invalid 2'); // byte must be valid 0 <= byte < 256 - arr[i] = b; - } - return arr; - }; - const b2n = (b) => BigInt('0x' + (b2h(b) || '0')); // bytes to number - const slcNum = (b, from, to) => b2n(b.slice(from, to)); // slice bytes num - const n2b = (num) => { - return big(num) && num >= 0n && num < B256 ? h2b(padh(num, 2 * fLen)) : err('bigint expected'); - }; - const n2h = (num) => b2h(n2b(num)); // number to 32b hex - const inv = (num, md = P) => { - if (num === 0n || md <= 0n) - err('no inverse n=' + num + ' mod=' + md); // no neg exponent for now - let a = mod(num, md), b = md, x = 0n, u = 1n; - while (a !== 0n) { // uses euclidean gcd algorithm - const q = b / a, r = b % a; // not constant-time - const m = x - u * q; - b = a, a = r, x = u, u = m; - } - return b === 1n ? mod(x, md) : err('no inverse'); // b is gcd at this point - }; - const sqrt = (n) => { - let r = 1n; // So, a special, fast case. Paper: "Square Roots from 1;24,51,10 to Dan Shanks". - for (let num = n, e = (P + 1n) / 4n; e > 0n; e >>= 1n) { // powMod: modular exponentiation. - if (e & 1n) - r = (r * num) % P; // Uses exponentiation by squaring. - num = (num * num) % P; // Not constant-time. - } - return mod(r * r) === n ? r : err('sqrt invalid'); // check if result is valid - }; - const toPriv = (p) => { - if (!big(p)) - p = b2n(toU8(p, fLen)); // convert to bigint when bytes - return ge(p) ? p : err('private key out of range'); // check if bigint is in range - }; - function getSharedSecret(privA, pubB, isCompressed = true) { - return Point.fromHex(pubB).mul(toPriv(privA)).toRawBytes(isCompressed); // ECDH - } - const W = 8; // Precomputes-related code. W = window size - const precompute = () => { - const points = []; // 10x sign(), 2x verify(). To achieve this, - const windows = 256 / W + 1; // app needs to spend 40ms+ to calculate - let p = G, b = p; // a lot of points related to base point G. - for (let w = 0; w < windows; w++) { // Points are stored in array and used - b = p; // any time Gx multiplication is done. - points.push(b); // They consume 16-32 MiB of RAM. - for (let i = 1; i < 2 ** (W - 1); i++) { - b = b.add(p); - points.push(b); - } - p = b.double(); // Precomputes don't speed-up getSharedKey, - } // which multiplies user point by scalar, - return points; // when precomputes are using base point - }; - const wNAF = (n) => { - // Compared to other point mult methods, - const comp = Gpows || (Gpows = precompute()); // stores 2x less points using subtraction - const neg = (cnd, p) => { let n = p.negate(); return cnd ? n : p; }; // negate - let p = I, f = G; // f must be G, or could become I in the end - const windows = 1 + 256 / W; // W=8 17 windows - const wsize = 2 ** (W - 1); // W=8 128 window size - const mask = BigInt(2 ** W - 1); // W=8 will create mask 0b11111111 - const maxNum = 2 ** W; // W=8 256 - const shiftBy = BigInt(W); // W=8 8 - for (let w = 0; w < windows; w++) { - const off = w * wsize; - let wbits = Number(n & mask); // extract W bits. - n >>= shiftBy; // shift number by W bits. - if (wbits > wsize) { - wbits -= maxNum; - n += 1n; - } // split if bits > max: +224 => 256-32 - const off1 = off, off2 = off + Math.abs(wbits) - 1; // offsets, evaluate both - const cnd1 = w % 2 !== 0, cnd2 = wbits < 0; // conditions, evaluate both - if (wbits === 0) { - f = f.add(neg(cnd1, comp[off1])); // bits are 0: add garbage to fake point - } - else { // ^ can't add off2, off2 = I - p = p.add(neg(cnd2, comp[off2])); // bits are 1: add to result point - } - } - return { p, f }; // return both real and fake points for JIT - }; // !! you can disable precomputes by commenting-out call of the wNAF() inside Point#mul() - - /** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ - const logger$2 = new Logger("signing-key/0.0.1"); - //const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); - // Make noble-secp256k1 sync - /** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ - class SigningKey { - #privateKey; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - let tmp = privateKey; - if (typeof tmp === "string" && tmp.startsWith("0x")) { - tmp = tmp.replace("0x", ""); - } - assertArgument(dataLength("0x" + tmp) === 57, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify("0x" + tmp); - } - /** - * The private key. - */ - get privateKey() { - return this.#privateKey; - } - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey() { - return SigningKey.computePublicKey(this.#privateKey); - } - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey() { - return SigningKey.computePublicKey(this.#privateKey, true); - } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest) { - const key = getBytesCopy(this.#privateKey); - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const keyBuffer = new Uint8Array(arrayify(key)); - if (keyBuffer.length !== 57) { - logger$2.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - const digestBuffer = new Uint8Array(arrayify(digest)); - if (digestBuffer.length !== 32) { - logger$2.throwArgumentError("bad digest length", "digest", digest); - } - if (keyBuffer[56] > 127) { - const prefix = keyBuffer.slice(0, 57); - prefix[0] &= 0xfc; - prefix[55] |= 0x80; - prefix[56] = 0; - const scalar = prefix.slice(0, 56); - const bufferDigest = buffer.Buffer.from(digestBuffer); - const bufferPrfx = buffer.Buffer.from(prefix); - const bufferScalar = buffer.Buffer.from(scalar); - const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - const sig = ed448.sign(buffer.Buffer.from(digestBuffer), buffer.Buffer.from(keyBuffer)); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other) { - const pubKey = SigningKey.computePublicKey(other); - return hexlify(getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey))); - } - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key, compressed) { - const bytes = buffer.Buffer.from(arrayify(key)); - if (bytes.length !== 57) { - logger$2.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - if (bytes[56] > 127) { - const scalar = bytes.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - const pub = ed448.publicKeyFromScalar(scalar); - return hexlify(pub); - } - const pub = ed448.publicKeyCreate(bytes); - return hexlify(pub); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest, signature) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const digestBuffer = buffer.Buffer.from(arrayify(digest)); - const sigBuffer = buffer.Buffer.from(arrayify(signature)); - if (sigBuffer.length !== 171) { - logger$2.throwArgumentError("invalid signature", "signature", signature); - } - const sig = sigBuffer.slice(0, 114); - const pub = sigBuffer.slice(114); - if (ed448.verify(digestBuffer, sig, pub)) { - return hexlify(pub); - } - logger$2.throwArgumentError("invalid signature", "signature", signature); - return ""; - } - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p0, p1, compressed) { - const pub0 = Point.fromHex(SigningKey.computePublicKey(p0).substring(2)); - const pub1 = Point.fromHex(SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed); - } - } - - // Constants - const BN_0$6 = BigInt(0); - const BN_1$3 = BigInt(1); - const BN_2$1 = BigInt(2); - const BN_27 = BigInt(27); - const BN_28 = BigInt(28); - const BN_35 = BigInt(35); - const _guard$4 = {}; - /** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ - class Signature { - #r; - #s; - #v; - #networkV; - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { - return this.#r; - } - set r(value) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - this.#r = hexlify(value); - } - /** - * The ``s`` value for a signature. - */ - get s() { - return this.#s; - } - set s(_value) { - assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); - const value = hexlify(_value); - assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); - this.#s = value; - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { - return this.#v; - } - set v(value) { - const v = getNumber(value, "value"); - assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { - return this.#networkV; - } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacynetworkId() { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getnetworkId(v); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return this.v === 27 ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - // The EIP-2098 compact representation - const yParityAndS = getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return hexlify(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return concat([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); - } - /** - * @private - */ - constructor(guard, r, s, v) { - assertPrivate(guard, _guard$4, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - [Symbol.for("nodejs.util.inspect.custom")]() { - return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone = new Signature(_guard$4, this.r, this.s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: networkV != null ? networkV.toString() : null, - r: this.r, - s: this.s, - v: this.v, - }; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getnetworkId(45) - * //_result: - * - * Signature.getnetworkId(46) - * //_result: - */ - static getnetworkId(v) { - const bv = getBigInt(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if (bv == BN_27 || bv == BN_28) { - return BN_0$6; - } - // Bad value for an EIP-155 v - assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); - return (bv - BN_35) / BN_2$1; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getnetworkIdV(5, 27) - * //_result: - * - * Signature.getnetworkIdV(5, 28) - * //_result: - * - */ - static getnetworkIdV(networkId, v) { - return getBigInt(networkId) * BN_2$1 + BigInt(35 + v - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v) { - const bv = getBigInt(v); - if (bv === BN_0$6 || bv === BN_27) { - return 27; - } - if (bv === BN_1$3 || bv === BN_28) { - return 28; - } - assertArgument(bv >= BN_35, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return bv & BN_1$3 ? 27 : 28; - } - } - - /** - * A fundamental building block of Core is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ - function lock() { - computeHmac.lock(); - pbkdf2.lock(); - randomBytes.lock(); - ripemd160.lock(); - scrypt.lock(); - scryptSync.lock(); - sha256.lock(); - sha512.lock(); - randomBytes.lock(); - } - - /** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ - function removeHexPrefix(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; - } - function publicToAddress(key, prefix) { - const val = hexDataSlice(sha256(key), 12); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); - } - function computeAddress(key, prefix) { - let pubkey; - if (typeof key === "string") { - pubkey = SigningKey.computePublicKey(key, false); - } - else { - pubkey = key.publicKey; - } - return publicToAddress(pubkey, prefix); // getAddress(sha256("0x" + pubkey.substring(4)).substring(26)); - } - /** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ - function recoverAddress(digest, signature, prefix) { - // return computeAddress(SigningKey.recoverPublicKey(digest, signature)); - const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature); - return publicToAddress(publicKey, prefix); - } - function extractPrefix(address) { - address = getAddress(address); - return address.substring(2, 4); - } - - /** - * @_ignore: - */ - const WordSize = 32; - const Padding = new Uint8Array(WordSize); - // Properties used to immediate pass through to the underlying object - // - `then` is used to detect if an object is a Promise for await - const passProperties$1 = ["then"]; - const _guard$3 = {}; - function throwError(name, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); - wrapped.error = error; - throw wrapped; - } - /** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ - class Result extends Array { - #names; - /** - * @private - */ - constructor(...args) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap = true; - if (guard !== _guard$3) { - items = args; - names = []; - wrap = false; - } - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { - this[index] = item; - }); - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof name === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, new Map()); - // Remove any key thats not unique - this.#names = Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - })); - if (!wrap) { - return; - } - // A wrapped Result is immutable - Object.freeze(this); - // Proxy indices and names so we can trap deferred errors - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof prop === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - // Pass important checks (like `then` for Promise) through - if (passProperties$1.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (...args) { - return value.apply(this === receiver ? target : this, args); - }; - } - else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply(this === receiver ? target : this, [ - prop, - ]); - } - } - return Reflect.get(target, prop, receiver); - }, - }); - } - /** - * Returns the Result as a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray() { - const result = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject() { - return this.#names.reduce((accum, name, index) => { - assert(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", { - operation: "toObject()", - }); - // Add values for names that don't conflict - if (!(name in accum)) { - accum[name] = this.getValue(name); - } - return accum; - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const result = [], names = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(this.#names[i]); - } - return new Result(_guard$3, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const result = [], names = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(this.#names[i]); - } - } - return new Result(_guard$3, result, names); - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name) { - const index = this.#names.indexOf(name); - if (index === -1) { - return undefined; - } - const value = this[index]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys) { - return new Result(_guard$3, items, keys); - } - } - /** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ - function checkResultErrors(result) { - // Find the first error (if any) - const errors = []; - const checkErrors = function (path, object) { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - try { - checkErrors(childPath, object[key]); - } - catch (error) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - return errors; - } - function getValue$1(value) { - let bytes = toBeArray(value); - assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: WordSize, - offset: bytes.length, - }); - if (bytes.length !== WordSize) { - bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes])); - } - return bytes; - } - /** - * @_ignore - */ - class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - name; - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - type; - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - localName; - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - dynamic; - constructor(name, type, localName, dynamic) { - defineProperties(this, { name, type, localName, dynamic }, { - name: "string", - type: "string", - localName: "string", - dynamic: "boolean", - }); - } - _throwError(message, value) { - assertArgument(false, message, this.localName, value); - } - } - /** - * @_ignore - */ - class Writer { - // An array of WordSize lengthed objects to concatenation - #data; - #dataLength; - constructor() { - this.#data = []; - this.#dataLength = 0; - } - get data() { - return concat(this.#data); - } - get length() { - return this.#dataLength; - } - #writeData(data) { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - appendWriter(writer) { - return this.#writeData(getBytesCopy(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes = getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return this.#writeData(getValue$1(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value) => { - this.#data[offset] = getValue$1(value); - }; - } - } - /** - * @_ignore - */ - class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - allowLoose; - #data; - #offset; - constructor(data, allowLoose) { - defineProperties(this, { allowLoose: !!allowLoose }); - this.#data = getBytesCopy(data); - this.#offset = 0; - } - get data() { - return hexlify(this.#data); - } - get dataLength() { - return this.#data.length; - } - get consumed() { - return this.#offset; - } - get bytes() { - return new Uint8Array(this.#data); - } - #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && - loose && - this.#offset + length <= this.#data.length) { - alignedLength = length; - } - else { - assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength, - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset) { - return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose); - } - // Read bytes - readBytes(length, loose) { - let bytes = this.#peekBytes(0, length, !!loose); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - // Read a numeric values - readValue() { - return toBigInt(this.readBytes(WordSize)); - } - readIndex() { - return toNumber(this.readBytes(WordSize)); - } - } - - /** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ - const _gaurd = {}; - function n(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { - signed, - width, - }); - } - function b(value, size) { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size }); - } - const _typedSymbol = Symbol.for("_corebc_typed"); - class Typed { - type; - value; - #options; - _typedSymbol; - constructor(gaurd, type, value, options) { - if (options == null) { - options = null; - } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - // Check the value is valid - this.format(); - } - format() { - if (this.type === "array") { - throw new Error(""); - } - else if (this.type === "dynamicArray") { - throw new Error(""); - } - else if (this.type === "tuple") { - return `tuple(${this.value.map((v) => v.format()).join(",")})`; - } - return this.type; - } - defaultValue() { - return 0; - } - minValue() { - return 0; - } - maxValue() { - return 0; - } - isBigInt() { - return !!this.type.match(/^u?int[0-9]+$/); - } - isData() { - return this.type.startsWith("bytes"); - } - isString() { - return this.type === "string"; - } - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return this.value.length; - } - return null; - } - static from(type, value) { - return new Typed(_gaurd, type, value); - } - static uint8(v) { - return n(v, 8); - } - static uint16(v) { - return n(v, 16); - } - static uint24(v) { - return n(v, 24); - } - static uint32(v) { - return n(v, 32); - } - static uint40(v) { - return n(v, 40); - } - static uint48(v) { - return n(v, 48); - } - static uint56(v) { - return n(v, 56); - } - static uint64(v) { - return n(v, 64); - } - static uint72(v) { - return n(v, 72); - } - static uint80(v) { - return n(v, 80); - } - static uint88(v) { - return n(v, 88); - } - static uint96(v) { - return n(v, 96); - } - static uint104(v) { - return n(v, 104); - } - static uint112(v) { - return n(v, 112); - } - static uint120(v) { - return n(v, 120); - } - static uint128(v) { - return n(v, 128); - } - static uint136(v) { - return n(v, 136); - } - static uint144(v) { - return n(v, 144); - } - static uint152(v) { - return n(v, 152); - } - static uint160(v) { - return n(v, 160); - } - static uint168(v) { - return n(v, 168); - } - static uint176(v) { - return n(v, 176); - } - static uint184(v) { - return n(v, 184); - } - static uint192(v) { - return n(v, 192); - } - static uint200(v) { - return n(v, 200); - } - static uint208(v) { - return n(v, 208); - } - static uint216(v) { - return n(v, 216); - } - static uint224(v) { - return n(v, 224); - } - static uint232(v) { - return n(v, 232); - } - static uint240(v) { - return n(v, 240); - } - static uint248(v) { - return n(v, 248); - } - static uint256(v) { - return n(v, 256); - } - static uint(v) { - return n(v, 256); - } - static int8(v) { - return n(v, -8); - } - static int16(v) { - return n(v, -16); - } - static int24(v) { - return n(v, -24); - } - static int32(v) { - return n(v, -32); - } - static int40(v) { - return n(v, -40); - } - static int48(v) { - return n(v, -48); - } - static int56(v) { - return n(v, -56); - } - static int64(v) { - return n(v, -64); - } - static int72(v) { - return n(v, -72); - } - static int80(v) { - return n(v, -80); - } - static int88(v) { - return n(v, -88); - } - static int96(v) { - return n(v, -96); - } - static int104(v) { - return n(v, -104); - } - static int112(v) { - return n(v, -112); - } - static int120(v) { - return n(v, -120); - } - static int128(v) { - return n(v, -128); - } - static int136(v) { - return n(v, -136); - } - static int144(v) { - return n(v, -144); - } - static int152(v) { - return n(v, -152); - } - static int160(v) { - return n(v, -160); - } - static int168(v) { - return n(v, -168); - } - static int176(v) { - return n(v, -176); - } - static int184(v) { - return n(v, -184); - } - static int192(v) { - return n(v, -192); - } - static int200(v) { - return n(v, -200); - } - static int208(v) { - return n(v, -208); - } - static int216(v) { - return n(v, -216); - } - static int224(v) { - return n(v, -224); - } - static int232(v) { - return n(v, -232); - } - static int240(v) { - return n(v, -240); - } - static int248(v) { - return n(v, -248); - } - static int256(v) { - return n(v, -256); - } - static int(v) { - return n(v, -256); - } - static bytes1(v) { - return b(v, 1); - } - static bytes2(v) { - return b(v, 2); - } - static bytes3(v) { - return b(v, 3); - } - static bytes4(v) { - return b(v, 4); - } - static bytes5(v) { - return b(v, 5); - } - static bytes6(v) { - return b(v, 6); - } - static bytes7(v) { - return b(v, 7); - } - static bytes8(v) { - return b(v, 8); - } - static bytes9(v) { - return b(v, 9); - } - static bytes10(v) { - return b(v, 10); - } - static bytes11(v) { - return b(v, 11); - } - static bytes12(v) { - return b(v, 12); - } - static bytes13(v) { - return b(v, 13); - } - static bytes14(v) { - return b(v, 14); - } - static bytes15(v) { - return b(v, 15); - } - static bytes16(v) { - return b(v, 16); - } - static bytes17(v) { - return b(v, 17); - } - static bytes18(v) { - return b(v, 18); - } - static bytes19(v) { - return b(v, 19); - } - static bytes20(v) { - return b(v, 20); - } - static bytes21(v) { - return b(v, 21); - } - static bytes22(v) { - return b(v, 22); - } - static bytes23(v) { - return b(v, 23); - } - static bytes24(v) { - return b(v, 24); - } - static bytes25(v) { - return b(v, 25); - } - static bytes26(v) { - return b(v, 26); - } - static bytes27(v) { - return b(v, 27); - } - static bytes28(v) { - return b(v, 28); - } - static bytes29(v) { - return b(v, 29); - } - static bytes30(v) { - return b(v, 30); - } - static bytes31(v) { - return b(v, 31); - } - static bytes32(v) { - return b(v, 32); - } - static address(v) { - return new Typed(_gaurd, "address", v); - } - static bool(v) { - return new Typed(_gaurd, "bool", !!v); - } - static bytes(v) { - return new Typed(_gaurd, "bytes", v); - } - static string(v) { - return new Typed(_gaurd, "string", v); - } - static array(v, dynamic) { - throw new Error("not implemented yet"); - } - static tuple(v, name) { - throw new Error("not implemented yet"); - } - static overrides(v) { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return value && value._typedSymbol === _typedSymbol; - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type) { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } - } - - /** - * @_ignore - */ - class AddressCoder extends Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value) { - let value = Typed.dereference(_value, "string"); - try { - value = getAddress(value); - } - catch (error) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - decode(reader) { - return getAddress(toBeHex(reader.readValue(), 22)); - } - } - - /** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ - class AnonymousCoder extends Coder { - coder; - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } - } - - /** - * @_ignore - */ - function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } - else if (values && typeof values === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name = coder.localName; - assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name] = true; - return values[name]; - }); - } - else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - let updateFuncs = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } - else { - coder.encode(staticWriter, value); - } - }); - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { - func(staticWriter.length); - }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; - } - /** - * @_ignore - */ - function unpack(reader, coders) { - let values = []; - let keys = []; - // A reader anchored to this base - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - else { - try { - value = coder.decode(reader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == undefined) { - throw new Error("investigate"); - } - values.push(value); - keys.push(coder.localName || null); - }); - return Result.fromItems(values, keys); - } - /** - * @_ignore - */ - class ArrayCoder extends Coder { - coder; - length; - constructor(coder, length, localName) { - const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; - const dynamic = length === -1 || coder.dynamic; - super("array", type, localName, dynamic); - defineProperties(this, { coder, length }); - } - defaultValue() { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { - buffer: reader.bytes, - offset: count * WordSize, - length: reader.dataLength, - }); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } - } - - /** - * @_ignore - */ - class BooleanCoder extends Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } - } - - /** - * @_ignore - */ - class DynamicBytesCoder extends Coder { - constructor(type, localName) { - super(type, type, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } - } - /** - * @_ignore - */ - class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return hexlify(super.decode(reader)); - } - } - - /** - * @_ignore - */ - class FixedBytesCoder extends Coder { - size; - constructor(size, localName) { - let name = "bytes" + String(size); - super(name, name, localName, false); - defineProperties(this, { size }, { size: "number" }); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); - } - encode(writer, _value) { - let data = getBytesCopy(Typed.dereference(_value, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data); - } - decode(reader) { - return hexlify(reader.readBytes(this.size)); - } - } - - const Empty = new Uint8Array([]); - /** - * @_ignore - */ - class NullCoder extends Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } - } - - const BN_0$5 = BigInt(0); - const BN_1$2 = BigInt(1); - const BN_MAX_UINT256$1 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - /** - * @_ignore - */ - class NumberCoder extends Coder { - size; - signed; - constructor(size, signed, localName) { - const name = (signed ? "int" : "uint") + size * 8; - super(name, name, localName, false); - defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value) { - let value = getBigInt(Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = mask(BN_MAX_UINT256$1, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, this.size * 8 - 1); - if (value > bounds || value < -(bounds + BN_1$2)) { - this._throwError("value out-of-bounds", _value); - } - value = toTwos(value, 8 * WordSize); - } - else if (value < BN_0$5 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - return writer.writeValue(value); - } - decode(reader) { - let value = mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = fromTwos(value, this.size * 8); - } - return value; - } - } - - /** - * @_ignore - */ - class StringCoder extends DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value) { - return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); - } - decode(reader) { - return toUtf8String(super.decode(reader)); - } - } - - /** - * @_ignore - */ - class TupleCoder extends Coder { - coders; - constructor(coders, localName) { - let dynamic = false; - const types = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = "tuple(" + types.join(",") + ")"; - super("tuple", type, localName, dynamic); - defineProperties(this, { - coders: Object.freeze(coders.slice()), - }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, {}); - // Add named values - this.coders.forEach((coder, index) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } - if (name === "length") { - name = "_length"; - } - if (values[name] != null) { - return; - } - values[name] = values[index]; - }); - return Object.freeze(values); - } - encode(writer, _value) { - const value = Typed.dereference(_value, "tuple"); - return pack(writer, this.coders, value); - } - decode(reader) { - return unpack(reader, this.coders); - } - } - - /** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * - * @example: - * id("hello world") - * //_result: - */ - function id(value, useKeccak) { - if (useKeccak) { - return keccak256(toUtf8Bytes(value)); - } - return sha256(toUtf8Bytes(value)); - } - - /** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ - const ZeroAddress = "0x0000000000000000000000000000000000000000"; - - /** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ - const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; - - /** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ - const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); - /** - * A constant for the number of ore in a single xcb. - * - * (**i.e.** ``1000000000000000000n``) - */ - const OrePerXCB = BigInt("1000000000000000000"); - /** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ - const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - /** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ - const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * - BigInt(-1); - /** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ - const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - - // NFKC (composed) // (decomposed) - /** - * A constant for the core symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ - const CoreSymbol = "\u039e"; // "\uD835\uDF63"; - /** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Core Signed Message:\\n"``) - */ - const MessagePrefix = "\x19Core Signed Message:\n"; - - function accessSetify(addr, storageKeys) { - return { - address: getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); - return storageKey.toLowerCase(); - }), - }; - } - /** - * Returns a [[AccessList]] from any corebcsupported access-list structure. - */ - function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set, index) => { - if (Array.isArray(set)) { - assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); - return accessSetify(set[0], set[1]); - } - assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => a.address.localeCompare(b.address)); - return result; - } - - const logger$1 = new Logger("transaction/0.0.1"); - const BN_0$4 = BigInt(0); - function handleAddress(value) { - if (value === "0x") { - return null; - } - return getAddress(value); - } - function parse(data) { - const handleNumber = (value) => { - // @ts-ignore - if (value === "0x") { - return BigNumber.from(0); - } - return BigNumber.from(value); - }; - const transaction = decode$1(data); - if (transaction.length !== 7 && transaction.length !== 8) { - logger$1.throwArgumentError("invalid raw transaction", "data", data); - } - const isSigned = transaction.length === 8; - const tx = { - nonce: Number(handleNumber(transaction[0])), - energyPrice: handleNumber(transaction[1]).toBigInt(), - energyLimit: handleNumber(transaction[2]).toBigInt(), - networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(), - to: handleAddress(transaction[isSigned ? 4 : 3]), - value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(), - data: transaction[isSigned ? 6 : 5], - }; - if (transaction.length === 8) { - const prefix = networkIdToPrefix(Number(tx.networkId)); - const digest = sha256(serialize(tx)); - tx.hash = sha256(serialize(tx, transaction[7])); - tx.from = recoverAddress(digest, transaction[7], prefix); - tx.signature = transaction[7]; - } - return tx; - } - const unsignedTransactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, - { name: "networkId", maxLength: 32, numeric: true }, - ]; - const transactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "networkId", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, - ]; - const allowedTransactionKeys = { - networkId: true, - data: true, - energyLimit: true, - energyPrice: true, - nonce: true, - to: true, - value: true, - }; - function serialize(transaction, signature) { - checkProperties(transaction, allowedTransactionKeys); - const raw = []; - (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) { - let value = transaction[name] || []; - const options = {}; - if (numeric) { - options.hexPad = "left"; - } - const tmpHexlified = hexlify(value, options); - value = arrayify(tmpHexlified); - // Fixed-width field - if (length && value.length !== length && value.length > 0) { - logger$1.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - // Variable-width (with a maximum) - if (maxLength) { - value = stripZeros(value); - if (value.length > maxLength) { - logger$1.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - } - const hexlified = hexlify(value); - raw.push(hexlified); - }); - if (!!signature) { - raw.push(hexlify(signature)); - } - const finalValue = encode(raw); - return finalValue; - } - /** - * A **Transaction** describes an operation to be executed on - * Core by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in corebc) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ - class Transaction { - #to; - #data; - #nonce; - #energyLimit; - #energyPrice; - #value; - #networkId; - #sig; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - return this.#to; - } - set to(value) { - this.#to = value == null ? null : getAddress(value); - } - /** - * The transaction nonce. - */ - get nonce() { - return this.#nonce; - } - set nonce(value) { - this.#nonce = getNumber(value, "value"); - } - /** - * The energy limit. - */ - get energyLimit() { - return this.#energyLimit; - } - set energyLimit(value) { - this.#energyLimit = getBigInt(value); - } - /** - * The energy price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get energyPrice() { - const value = this.#energyPrice; - if (value == null) { - return BN_0$4; - } - return value; - } - set energyPrice(value) { - this.#energyPrice = value == null ? null : getBigInt(value, "energyPrice"); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { - return this.#data; - } - set data(value) { - this.#data = hexlify(value); - } - /** - * The amount of xcb (in ore) to send in this transactions. - */ - get value() { - return this.#value; - } - set value(value) { - this.#value = getBigInt(value, "value"); - } - /** - * The chain ID this transaction is valid on. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = getBigInt(value); - } - /** - * If signed, the signature for this transaction. - */ - get signature() { - return this.#sig || null; - } - set signature(value) { - this.#sig = value == null ? null : value; - } - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#to = null; - this.#nonce = 0; - this.#energyLimit = BigInt(0); - this.#energyPrice = null; - this.#data = "0x"; - this.#value = BigInt(0); - this.#networkId = BigInt(0); - this.#sig = null; - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return sha256(this.serialized); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return sha256(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - const prefix = networkIdToPrefix(Number(this.#networkId)); - return recoverAddress(this.unsignedHash, this.signature, prefix); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - //isSigned(): this is SignedTransaction { - return this.signature != null; - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - assert(this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - return serialize(this, this.signature); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return serialize(this); - } - /** - * Create a copy of this transaciton. - */ - clone() { - return Transaction.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s = (v) => { - if (v == null) { - return null; - } - return v.toString(); - }; - return { - to: this.to, - data: this.data, - nonce: this.nonce, - energyLimit: s(this.energyLimit), - energyPrice: s(this.energyPrice), - value: s(this.value), - networkId: s(this.networkId), - sig: this.signature ? this.signature : null, - }; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new Transaction(); - } - if (typeof tx === "string") { - const payload = getBytes(tx); - return Transaction.from(parse(payload)); - } - const result = new Transaction(); - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.energyLimit != null) { - result.energyLimit = tx.energyLimit; - } - if (tx.energyPrice != null) { - result.energyPrice = tx.energyPrice; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.networkId != null) { - result.networkId = tx.networkId; - } - if (tx.signature != null) { - result.signature = tx.signature; - } - if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); - assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } - } - - /** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ - function hashMessage(message) { - if (typeof message === "string") { - message = toUtf8Bytes(message); - } - return sha256(concat([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message.length)), - message, - ])); - } - /** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ - function verifyMessage(message, sig, prefix) { - const digest = hashMessage(message); - return recoverAddress(digest, sig, prefix); - } - - const regexBytes = new RegExp("^bytes([0-9]+)$"); - const regexNumber = new RegExp("^(u?int)([0-9]*)$"); - const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); - function _pack(type, value, isArray) { - switch (type) { - case "address": - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(getAddress(value)); - case "string": - return toUtf8Bytes(value); - case "bytes": - return getBytes(value); - case "bool": - value = !!value ? "0x01" : "0x00"; - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(value); - } - let match = type.match(regexNumber); - if (match) { - let signed = match[1] === "int"; - let size = parseInt(match[2] || "256"); - assertArgument((!match[2] || match[2] === String(size)) && - size % 8 === 0 && - size !== 0 && - size <= 256, "invalid number type", "type", type); - if (isArray) { - size = 256; - } - if (signed) { - value = toTwos(value, size); - } - return getBytes(zeroPadValue(toBeArray(value), size / 8)); - } - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - assertArgument(dataLength(value) === size, `invalid value for ${type}`, "value", value); - if (isArray) { - return getBytes(zeroPadBytes(value, 32)); - } - return value; - } - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); - const result = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return getBytes(concat(result)); - } - assertArgument(false, "invalid type", "type", type); - } - // @TODO: Array Enum - /** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ - function solidityPacked(types, values) { - assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - const tight = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return hexlify(concat(tight)); - } - /** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ - function solidityPackedSha256(types, values) { - return sha256(solidityPacked(types, values)); - } - - const padding = new Uint8Array(32); - padding.fill(0); - const BN__1 = BigInt(-1); - const BN_0$3 = BigInt(0); - const BN_1$1 = BigInt(1); - const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - function hexPadRight(value) { - const bytes = getBytes(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return concat([bytes, padding.slice(padOffset)]); - } - return hexlify(bytes); - } - const hexTrue = toBeHex(BN_1$1, 32); - const hexFalse = toBeHex(BN_0$3, 32); - const domainFieldTypes = { - name: "string", - version: "string", - networkId: "uint256", - verifyingContract: "address", - salt: "bytes32", - }; - const domainFieldNames = [ - "name", - "version", - "networkId", - "verifyingContract", - "salt", - ]; - function checkString(key) { - return function (value) { - assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); - return value; - }; - } - const domainChecks = { - name: checkString("name"), - version: checkString("version"), - networkId: function (_value) { - const value = getBigInt(_value, "domain.networkId"); - assertArgument(value >= 0, "invalid chain ID", "domain.networkId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function (value) { - try { - return getAddress(value).toLowerCase(); - } - catch (error) { } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function (value) { - const bytes = getBytes(value, "domain.salt"); - assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes); - }, - }; - function getBaseEncoder(type) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d*)$/); - if (match) { - const signed = match[1] === ""; - const width = parseInt(match[2] || "256"); - assertArgument(width % 8 === 0 && - width !== 0 && - width <= 256 && - (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type); - const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); - const boundsLower = signed ? (boundsUpper + BN_1$1) * BN__1 : BN_0$3; - return function (_value) { - const value = getBigInt(_value, "value"); - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - return function (value) { - const bytes = getBytes(value); - assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type) { - case "address": - return function (value) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": - return function (value) { - return !value ? hexFalse : hexTrue; - }; - case "bytes": - return function (value) { - return sha256(value); - }; - case "string": - return function (value) { - return id(value); - }; - } - return null; - } - function encodeType(name, fields) { - return `${name}(${fields + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.corebc = {})); +})(this, (function (exports) { 'use strict'; + + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + + function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + function getAugmentedNamespace(n) { + if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + var isInstance = false; + try { + isInstance = this instanceof a; + } catch (e) {} + if (isInstance) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; + } + + var buffer = {}; + + var base64Js = {}; + + var hasRequiredBase64Js; + + function requireBase64Js () { + if (hasRequiredBase64Js) return base64Js; + hasRequiredBase64Js = 1; + + base64Js.byteLength = byteLength; + base64Js.toByteArray = toByteArray; + base64Js.fromByteArray = fromByteArray; + + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + + // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + + function getLens (b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4); + + return [validLen, placeHoldersLen] + } + + // base64 is 4/3 + up to two characters of the original data + function byteLength (b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen + } + + function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen + } + + function toByteArray (b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + + var curByte = 0; + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen; + + var i; + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = (tmp >> 16) & 0xFF; + arr[curByte++] = (tmp >> 8) & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4); + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2); + arr[curByte++] = (tmp >> 8) & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr + } + + function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] + } + + function encodeChunk (uint8, start, end) { + var tmp; + var output = []; + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + return output.join('') + } + + function fromByteArray (uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ); + } + + return parts.join('') + } + return base64Js; + } + + var ieee754 = {}; + + /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + + var hasRequiredIeee754; + + function requireIeee754 () { + if (hasRequiredIeee754) return ieee754; + hasRequiredIeee754 = 1; + ieee754.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = (nBytes * 8) - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? (nBytes - 1) : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) + }; + + ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = (nBytes * 8) - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); + var i = isLE ? 0 : (nBytes - 1); + var d = isLE ? 1 : -1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + }; + return ieee754; + } + + /*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + + var hasRequiredBuffer; + + function requireBuffer () { + if (hasRequiredBuffer) return buffer; + hasRequiredBuffer = 1; + (function (exports) { + + const base64 = requireBase64Js(); + const ieee754 = requireIeee754(); + const customInspectSymbol = + (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation + ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + + const K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && + typeof console.error === 'function') { + console.error( + 'This browser lacks typed array (Uint8Array) support which is required by ' + + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' + ); + } + + function typedArraySupport () { + // Can typed array instances can be augmented? + try { + const arr = new Uint8Array(1); + const proto = { foo: function () { return 42 } }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42 + } catch (e) { + return false + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.buffer + } + }); + + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.byteOffset + } + }); + + function createBuffer (length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"') + } + // Return an augmented `Uint8Array` instance + const buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf + } + + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + function Buffer (arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ) + } + return allocUnsafe(arg) + } + return from(arg, encodingOrOffset, length) + } + + Buffer.poolSize = 8192; // not used by this implementation + + function from (value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value) + } + + if (value == null) { + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof SharedArrayBuffer !== 'undefined' && + (isInstance(value, SharedArrayBuffer) || + (value && isInstance(value.buffer, SharedArrayBuffer)))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + const b = fromObject(value); + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length) + }; + + // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number') + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + } + + function alloc (size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill) + } + return createBuffer(size) + } + + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding) + }; + + function allocUnsafe (size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0) + } + + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size) + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size) + }; + + function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + const length = byteLength(string, encoding) | 0; + let buf = createBuffer(length); + + const actual = buf.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + + return buf + } + + function fromArrayLike (array) { + const length = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length); + for (let i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + return buf + } + + function fromArrayView (arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) + } + return fromArrayLike(arrayView) + } + + function fromArrayBuffer (array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds') + } + + let buf; + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(buf, Buffer.prototype); + + return buf + } + + function fromObject (obj) { + if (Buffer.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + + if (buf.length === 0) { + return buf + } + + obj.copy(buf, 0, 0, len); + return buf + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) + } + return fromArrayLike(obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } + } + + function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 + } + + function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0; + } + return Buffer.alloc(+length) + } + + Buffer.isBuffer = function isBuffer (b) { + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false + }; + + Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) + } + + if (a === b) return 0 + + let x = a.length; + let y = b.length; + + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 + }; + + Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } + }; + + Buffer.concat = function concat (list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + let i; + if (length === undefined) { + length = 0; + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + const buffer = Buffer.allocUnsafe(length); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call( + buffer, + buf, + pos + ); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer + }; + + function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) + } + + const len = string.length; + const mustMatch = (arguments.length > 2 && arguments[2] === true); + if (!mustMatch && len === 0) return 0 + + // Use a for loop to avoid recursion + let loweredCase = false; + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer.byteLength = byteLength; + + function slowToString (encoding, start, end) { + let loweredCase = false; + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0; + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return '' + } + + // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } + + // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + Buffer.prototype._isBuffer = true; + + function swap (b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16 () { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this + }; + + Buffer.prototype.swap32 = function swap32 () { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this + }; + + Buffer.prototype.swap64 = function swap64 () { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this + }; + + Buffer.prototype.toString = function toString () { + const length = this.length; + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 + }; + + Buffer.prototype.inspect = function inspect () { + let str = ''; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return '' + }; + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) + } + + if (start === undefined) { + start = 0; + } + if (end === undefined) { + end = target ? target.length : 0; + } + if (thisStart === undefined) { + thisStart = 0; + } + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + + if (this === target) return 0 + + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 + }; + + // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1); + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0; + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') + } + + function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break + } + } + if (found) return i + } + } + + return -1 + } + + Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 + }; + + Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) + }; + + function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + + const strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + let i; + for (i = 0; i < length; ++i) { + const parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i + buf[offset + i] = parsed; + } + return i + } + + function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) + } + + function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) + } + + function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) + } + + function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) + } + + Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + const remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8'; + + let loweredCase = false; + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } + }; + + function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } + } + + function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = (firstByte > 0xEF) + ? 4 + : (firstByte > 0xDF) + ? 3 + : (firstByte > 0xBF) + ? 2 + : 1; + + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + break + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + break + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + break + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res) + } + + // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + const MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray (codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + let res = ''; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ); + } + return res + } + + function asciiSlice (buf, start, end) { + let ret = ''; + end = Math.min(buf.length, end); + + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + return ret + } + + function latin1Slice (buf, start, end) { + let ret = ''; + end = Math.min(buf.length, end); + + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret + } + + function hexSlice (buf, start, end) { + const len = buf.length; + + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + + let out = ''; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out + } + + function utf16leSlice (buf, start, end) { + const bytes = buf.slice(start, end); + let res = ''; + // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)); + } + return res + } + + Buffer.prototype.slice = function slice (start, end) { + const len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + + const newBuf = this.subarray(start, end); + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(newBuf, Buffer.prototype); + + return newBuf + }; + + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') + } + + Buffer.prototype.readUintLE = + Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val + }; + + Buffer.prototype.readUintBE = + Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + let val = this[offset + --byteLength]; + let mul = 1; + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val + }; + + Buffer.prototype.readUint8 = + Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset] + }; + + Buffer.prototype.readUint16LE = + Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | (this[offset + 1] << 8) + }; + + Buffer.prototype.readUint16BE = + Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return (this[offset] << 8) | this[offset + 1] + }; + + Buffer.prototype.readUint32LE = + Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) + }; + + Buffer.prototype.readUint32BE = + Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) + }; + + Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const lo = first + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 24; + + const hi = this[++offset] + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + last * 2 ** 24; + + return BigInt(lo) + (BigInt(hi) << BigInt(32)) + }); + + Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const hi = first * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + this[++offset]; + + const lo = this[++offset] * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + last; + + return (BigInt(hi) << BigInt(32)) + BigInt(lo) + }); + + Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + mul *= 0x80; + + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + + return val + }; + + Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + let i = byteLength; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + mul *= 0x80; + + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + + return val + }; + + Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) + }; + + Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + const val = this[offset] | (this[offset + 1] << 8); + return (val & 0x8000) ? val | 0xFFFF0000 : val + }; + + Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + const val = this[offset + 1] | (this[offset] << 8); + return (val & 0x8000) ? val | 0xFFFF0000 : val + }; + + Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) + }; + + Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) + }; + + Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const val = this[offset + 4] + + this[offset + 5] * 2 ** 8 + + this[offset + 6] * 2 ** 16 + + (last << 24); // Overflow + + return (BigInt(val) << BigInt(32)) + + BigInt(first + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 24) + }); + + Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const val = (first << 24) + // Overflow + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + this[++offset]; + + return (BigInt(val) << BigInt(32)) + + BigInt(this[++offset] * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + last) + }); + + Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4) + }; + + Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4) + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8) + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8) + }; + + function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') + } + + Buffer.prototype.writeUintLE = + Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + let mul = 1; + let i = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeUintBE = + Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + let i = byteLength - 1; + let mul = 1; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeUint8 = + Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = (value & 0xff); + return offset + 1 + }; + + Buffer.prototype.writeUint16LE = + Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + return offset + 2 + }; + + Buffer.prototype.writeUint16BE = + Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = (value >>> 8); + this[offset + 1] = (value & 0xff); + return offset + 2 + }; + + Buffer.prototype.writeUint32LE = + Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = (value >>> 24); + this[offset + 2] = (value >>> 16); + this[offset + 1] = (value >>> 8); + this[offset] = (value & 0xff); + return offset + 4 + }; + + Buffer.prototype.writeUint32BE = + Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = (value >>> 24); + this[offset + 1] = (value >>> 16); + this[offset + 2] = (value >>> 8); + this[offset + 3] = (value & 0xff); + return offset + 4 + }; + + function wrtBigUInt64LE (buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + + let lo = Number(value & BigInt(0xffffffff)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset + } + + function wrtBigUInt64BE (buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + + let lo = Number(value & BigInt(0xffffffff)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8 + } + + Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) + }); + + Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) + }); + + Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, (8 * byteLength) - 1); + + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, (8 * byteLength) - 1); + + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + let i = byteLength - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128); + if (value < 0) value = 0xff + value + 1; + this[offset] = (value & 0xff); + return offset + 1 + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + return offset + 2 + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); + this[offset] = (value >>> 8); + this[offset + 1] = (value & 0xff); + return offset + 2 + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + this[offset + 2] = (value >>> 16); + this[offset + 3] = (value >>> 24); + return offset + 4 + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = (value >>> 24); + this[offset + 1] = (value >>> 16); + this[offset + 2] = (value >>> 8); + this[offset + 3] = (value & 0xff); + return offset + 4 + }; + + Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) + }); + + Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) + }); + + function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') + } + + function writeFloat (buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4 + } + + Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) + }; + + function writeDouble (buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8 + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) + }; + + // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + const len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ); + } + + return len + }; + + // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if ((encoding === 'utf8' && code < 128) || + encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + + if (!val) val = 0; + + let i; + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + + '" is invalid for argument "value"') + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this + }; + + // CUSTOM ERRORS + // ============= + + // Simplified versions from Node, changed for Buffer-only usage + const errors = {}; + function E (sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor () { + super(); + + Object.defineProperty(this, 'message', { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + + // Add the error code to the name to include it in the stack trace. + this.name = `${this.name} [${sym}]`; + // Access the stack to generate the error message including the error code + // from the name. + this.stack; // eslint-disable-line no-unused-expressions + // Reset the name to the actual name. + delete this.name; + } + + get code () { + return sym + } + + set code (value) { + Object.defineProperty(this, 'code', { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + + toString () { + return `${this.name} [${sym}]: ${this.message}` + } + }; + } + + E('ERR_BUFFER_OUT_OF_BOUNDS', + function (name) { + if (name) { + return `${name} is outside of buffer bounds` + } + + return 'Attempt to access memory outside buffer bounds' + }, RangeError); + E('ERR_INVALID_ARG_TYPE', + function (name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}` + }, TypeError); + E('ERR_OUT_OF_RANGE', + function (str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === 'bigint') { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += 'n'; + } + msg += ` It must be ${range}. Received ${received}`; + return msg + }, RangeError); + + function addNumericalSeparator (val) { + let res = ''; + let i = val.length; + const start = val[0] === '-' ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}` + } + + // CHECK FUNCTIONS + // =============== + + function checkBounds (buf, offset, byteLength) { + validateNumber(offset, 'offset'); + if (buf[offset] === undefined || buf[offset + byteLength] === undefined) { + boundsError(offset, buf.length - (byteLength + 1)); + } + } + + function checkIntBI (value, min, max, buf, offset, byteLength) { + if (value > max || value < min) { + const n = typeof min === 'bigint' ? 'n' : ''; + let range; + { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + + `${(byteLength + 1) * 8 - 1}${n}`; + } + } + throw new errors.ERR_OUT_OF_RANGE('value', range, value) + } + checkBounds(buf, offset, byteLength); + } + + function validateNumber (value, name) { + if (typeof value !== 'number') { + throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value) + } + } + + function boundsError (value, length, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE('offset', 'an integer', value) + } + + if (length < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS() + } + + throw new errors.ERR_OUT_OF_RANGE('offset', + `>= ${0} and <= ${length}`, + value) + } + + // HELPER FUNCTIONS + // ================ + + const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean (str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, ''); + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '='; + } + return str + } + + function utf8ToBytes (string, units) { + units = units || Infinity; + let codePoint; + const length = string.length; + let leadSurrogate = null; + const bytes = []; + + for (let i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue + } + + // valid lead + leadSurrogate = codePoint; + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ); + } else { + throw new Error('Invalid code point') + } + } + + return bytes + } + + function asciiToBytes (str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + return byteArray + } + + function utf16leToBytes (str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray + } + + function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) + } + + function blitBuffer (src, dst, offset, length) { + let i; + for (i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i]; + } + return i + } + + // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) + } + function numberIsNaN (obj) { + // For IE11 support + return obj !== obj // eslint-disable-line no-self-compare + } + + // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + const hexSliceLookupTable = (function () { + const alphabet = '0123456789abcdef'; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table + })(); + + // Return not function with Error if BigInt not supported + function defineBigIntMethod (fn) { + return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn + } + + function BufferBigIntNotDefined () { + throw new Error('BigInt not supported') + } + } (buffer)); + return buffer; + } + + var bufferExports = requireBuffer(); + + /** The current version of corebc; keep in sync with package.json. */ + const version = "0.4.1"; + + var bn$2 = {exports: {}}; + + var _nodeResolve_empty = {}; + + var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + default: _nodeResolve_empty + }); + + var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1); + + var bn$1 = bn$2.exports; + + var hasRequiredBn$1; + + function requireBn$1 () { + if (hasRequiredBn$1) return bn$2.exports; + hasRequiredBn$1 = 1; + (function (module) { + (function (module, exports) { + + // Utils + function assert (val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); + } + + // Could use `inherits` module, but don't want to move from single file + // architecture yet. + function inherits (ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + + // BN + + function BN (number, base, endian) { + if (BN.isBN(number)) { + return number; + } + + this.negative = 0; + this.words = null; + this.length = 0; + + // Reduction context + this.red = null; + + if (number !== null) { + if (base === 'le' || base === 'be') { + endian = base; + base = 10; + } + + this._init(number || 0, base || 10, endian || 'be'); + } + } + if (typeof module === 'object') { + module.exports = BN; + } else { + exports.BN = BN; + } + + BN.BN = BN; + BN.wordSize = 26; + + var Buffer; + try { + if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') { + Buffer = window.Buffer; + } else { + Buffer = require$$0.Buffer; + } + } catch (e) { + } + + BN.isBN = function isBN (num) { + if (num instanceof BN) { + return true; + } + + return num !== null && typeof num === 'object' && + num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; + + BN.max = function max (left, right) { + if (left.cmp(right) > 0) return left; + return right; + }; + + BN.min = function min (left, right) { + if (left.cmp(right) < 0) return left; + return right; + }; + + BN.prototype._init = function init (number, base, endian) { + if (typeof number === 'number') { + return this._initNumber(number, base, endian); + } + + if (typeof number === 'object') { + return this._initArray(number, base, endian); + } + + if (base === 'hex') { + base = 16; + } + assert(base === (base | 0) && base >= 2 && base <= 36); + + number = number.toString().replace(/\s+/g, ''); + var start = 0; + if (number[0] === '-') { + start++; + this.negative = 1; + } + + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); + } else { + this._parseBase(number, base, start); + if (endian === 'le') { + this._initArray(this.toArray(), base, endian); + } + } + } + }; + + BN.prototype._initNumber = function _initNumber (number, base, endian) { + if (number < 0) { + this.negative = 1; + number = -number; + } + if (number < 0x4000000) { + this.words = [number & 0x3ffffff]; + this.length = 1; + } else if (number < 0x10000000000000) { + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff + ]; + this.length = 2; + } else { + assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff, + 1 + ]; + this.length = 3; + } + + if (endian !== 'le') return; + + // Reverse the bytes + this._initArray(this.toArray(), base, endian); + }; + + BN.prototype._initArray = function _initArray (number, base, endian) { + // Perhaps a Uint8Array + assert(typeof number.length === 'number'); + if (number.length <= 0) { + this.words = [0]; + this.length = 1; + return this; + } + + this.length = Math.ceil(number.length / 3); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } + + var j, w; + var off = 0; + if (endian === 'be') { + for (i = number.length - 1, j = 0; i >= 0; i -= 3) { + w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } else if (endian === 'le') { + for (i = 0, j = 0; i < number.length; i += 3) { + w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } + return this._strip(); + }; + + function parseHex4Bits (string, index) { + var c = string.charCodeAt(index); + // '0' - '9' + if (c >= 48 && c <= 57) { + return c - 48; + // 'A' - 'F' + } else if (c >= 65 && c <= 70) { + return c - 55; + // 'a' - 'f' + } else if (c >= 97 && c <= 102) { + return c - 87; + } else { + assert(false, 'Invalid character in ' + string); + } + } + + function parseHexByte (string, lowerBound, index) { + var r = parseHex4Bits(string, index); + if (index - 1 >= lowerBound) { + r |= parseHex4Bits(string, index - 1) << 4; + } + return r; + } + + BN.prototype._parseHex = function _parseHex (number, start, endian) { + // Create possibly bigger array to ensure that it fits the number + this.length = Math.ceil((number.length - start) / 6); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } + + // 24-bits chunks + var off = 0; + var j = 0; + + var w; + if (endian === 'be') { + for (i = number.length - 1; i >= start; i -= 2) { + w = parseHexByte(number, start, i) << off; + this.words[j] |= w & 0x3ffffff; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } + } else { + var parseLength = number.length - start; + for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) { + w = parseHexByte(number, start, i) << off; + this.words[j] |= w & 0x3ffffff; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } + } + + this._strip(); + }; + + function parseBase (str, start, end, mul) { + var r = 0; + var b = 0; + var len = Math.min(str.length, end); + for (var i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; + + r *= mul; + + // 'a' + if (c >= 49) { + b = c - 49 + 0xa; + + // 'A' + } else if (c >= 17) { + b = c - 17 + 0xa; + + // '0' - '9' + } else { + b = c; + } + assert(c >= 0 && b < mul, 'Invalid character'); + r += b; + } + return r; + } + + BN.prototype._parseBase = function _parseBase (number, base, start) { + // Initialize as zero + this.words = [0]; + this.length = 1; + + // Find length of limb in base + for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { + limbLen++; + } + limbLen--; + limbPow = (limbPow / base) | 0; + + var total = number.length - start; + var mod = total % limbLen; + var end = Math.min(total, total - mod) + start; + + var word = 0; + for (var i = start; i < end; i += limbLen) { + word = parseBase(number, i, i + limbLen, base); + + this.imuln(limbPow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + + if (mod !== 0) { + var pow = 1; + word = parseBase(number, i, number.length, base); + + for (i = 0; i < mod; i++) { + pow *= base; + } + + this.imuln(pow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } + } + + this._strip(); + }; + + BN.prototype.copy = function copy (dest) { + dest.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + dest.words[i] = this.words[i]; + } + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + }; + + function move (dest, src) { + dest.words = src.words; + dest.length = src.length; + dest.negative = src.negative; + dest.red = src.red; + } + + BN.prototype._move = function _move (dest) { + move(dest, this); + }; + + BN.prototype.clone = function clone () { + var r = new BN(null); + this.copy(r); + return r; + }; + + BN.prototype._expand = function _expand (size) { + while (this.length < size) { + this.words[this.length++] = 0; + } + return this; + }; + + // Remove leading `0` from `this` + BN.prototype._strip = function strip () { + while (this.length > 1 && this.words[this.length - 1] === 0) { + this.length--; + } + return this._normSign(); + }; + + BN.prototype._normSign = function _normSign () { + // -0 = 0 + if (this.length === 1 && this.words[0] === 0) { + this.negative = 0; + } + return this; + }; + + // Check Symbol.for because not everywhere where Symbol defined + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility + if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') { + try { + BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect; + } catch (e) { + BN.prototype.inspect = inspect; + } + } else { + BN.prototype.inspect = inspect; + } + + function inspect () { + return (this.red ? ''; + } + + /* + + var zeros = []; + var groupSizes = []; + var groupBases = []; + + var s = ''; + var i = -1; + while (++i < BN.wordSize) { + zeros[i] = s; + s += '0'; + } + groupSizes[0] = 0; + groupSizes[1] = 0; + groupBases[0] = 0; + groupBases[1] = 0; + var base = 2 - 1; + while (++base < 36 + 1) { + var groupSize = 0; + var groupBase = 1; + while (groupBase < (1 << BN.wordSize) / base) { + groupBase *= base; + groupSize += 1; + } + groupSizes[base] = groupSize; + groupBases[base] = groupBase; + } + + */ + + var zeros = [ + '', + '0', + '00', + '000', + '0000', + '00000', + '000000', + '0000000', + '00000000', + '000000000', + '0000000000', + '00000000000', + '000000000000', + '0000000000000', + '00000000000000', + '000000000000000', + '0000000000000000', + '00000000000000000', + '000000000000000000', + '0000000000000000000', + '00000000000000000000', + '000000000000000000000', + '0000000000000000000000', + '00000000000000000000000', + '000000000000000000000000', + '0000000000000000000000000' + ]; + + var groupSizes = [ + 0, 0, + 25, 16, 12, 11, 10, 9, 8, + 8, 7, 7, 7, 7, 6, 6, + 6, 6, 6, 6, 6, 5, 5, + 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5 + ]; + + var groupBases = [ + 0, 0, + 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, + 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, + 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, + 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, + 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 + ]; + + BN.prototype.toString = function toString (base, padding) { + base = base || 10; + padding = padding | 0 || 1; + + var out; + if (base === 16 || base === 'hex') { + out = ''; + var off = 0; + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = this.words[i]; + var word = (((w << off) | carry) & 0xffffff).toString(16); + carry = (w >>> (24 - off)) & 0xffffff; + off += 2; + if (off >= 26) { + off -= 26; + i--; + } + if (carry !== 0 || i !== this.length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + + if (base === (base | 0) && base >= 2 && base <= 36) { + // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); + var groupSize = groupSizes[base]; + // var groupBase = Math.pow(base, groupSize); + var groupBase = groupBases[base]; + out = ''; + var c = this.clone(); + c.negative = 0; + while (!c.isZero()) { + var r = c.modrn(groupBase).toString(base); + c = c.idivn(groupBase); + + if (!c.isZero()) { + out = zeros[groupSize - r.length] + r + out; + } else { + out = r + out; + } + } + if (this.isZero()) { + out = '0' + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + + assert(false, 'Base should be between 2 and 36'); + }; + + BN.prototype.toNumber = function toNumber () { + var ret = this.words[0]; + if (this.length === 2) { + ret += this.words[1] * 0x4000000; + } else if (this.length === 3 && this.words[2] === 0x01) { + // NOTE: at this stage it is known that the top bit is set + ret += 0x10000000000000 + (this.words[1] * 0x4000000); + } else if (this.length > 2) { + assert(false, 'Number can only safely store up to 53 bits'); + } + return (this.negative !== 0) ? -ret : ret; + }; + + BN.prototype.toJSON = function toJSON () { + return this.toString(16, 2); + }; + + if (Buffer) { + BN.prototype.toBuffer = function toBuffer (endian, length) { + return this.toArrayLike(Buffer, endian, length); + }; + } + + BN.prototype.toArray = function toArray (endian, length) { + return this.toArrayLike(Array, endian, length); + }; + + var allocate = function allocate (ArrayType, size) { + if (ArrayType.allocUnsafe) { + return ArrayType.allocUnsafe(size); + } + return new ArrayType(size); + }; + + BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { + this._strip(); + + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert(byteLength <= reqLength, 'byte array longer than desired length'); + assert(reqLength > 0, 'Requested array length <= 0'); + + var res = allocate(ArrayType, reqLength); + var postfix = endian === 'le' ? 'LE' : 'BE'; + this['_toArrayLike' + postfix](res, byteLength); + return res; + }; + + BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) { + var position = 0; + var carry = 0; + + for (var i = 0, shift = 0; i < this.length; i++) { + var word = (this.words[i] << shift) | carry; + + res[position++] = word & 0xff; + if (position < res.length) { + res[position++] = (word >> 8) & 0xff; + } + if (position < res.length) { + res[position++] = (word >> 16) & 0xff; + } + + if (shift === 6) { + if (position < res.length) { + res[position++] = (word >> 24) & 0xff; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + + if (position < res.length) { + res[position++] = carry; + + while (position < res.length) { + res[position++] = 0; + } + } + }; + + BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) { + var position = res.length - 1; + var carry = 0; + + for (var i = 0, shift = 0; i < this.length; i++) { + var word = (this.words[i] << shift) | carry; + + res[position--] = word & 0xff; + if (position >= 0) { + res[position--] = (word >> 8) & 0xff; + } + if (position >= 0) { + res[position--] = (word >> 16) & 0xff; + } + + if (shift === 6) { + if (position >= 0) { + res[position--] = (word >> 24) & 0xff; + } + carry = 0; + shift = 0; + } else { + carry = word >>> 24; + shift += 2; + } + } + + if (position >= 0) { + res[position--] = carry; + + while (position >= 0) { + res[position--] = 0; + } + } + }; + + if (Math.clz32) { + BN.prototype._countBits = function _countBits (w) { + return 32 - Math.clz32(w); + }; + } else { + BN.prototype._countBits = function _countBits (w) { + var t = w; + var r = 0; + if (t >= 0x1000) { + r += 13; + t >>>= 13; + } + if (t >= 0x40) { + r += 7; + t >>>= 7; + } + if (t >= 0x8) { + r += 4; + t >>>= 4; + } + if (t >= 0x02) { + r += 2; + t >>>= 2; + } + return r + t; + }; + } + + BN.prototype._zeroBits = function _zeroBits (w) { + // Short-cut + if (w === 0) return 26; + + var t = w; + var r = 0; + if ((t & 0x1fff) === 0) { + r += 13; + t >>>= 13; + } + if ((t & 0x7f) === 0) { + r += 7; + t >>>= 7; + } + if ((t & 0xf) === 0) { + r += 4; + t >>>= 4; + } + if ((t & 0x3) === 0) { + r += 2; + t >>>= 2; + } + if ((t & 0x1) === 0) { + r++; + } + return r; + }; + + // Return number of used bits in a BN + BN.prototype.bitLength = function bitLength () { + var w = this.words[this.length - 1]; + var hi = this._countBits(w); + return (this.length - 1) * 26 + hi; + }; + + function toBitArray (num) { + var w = new Array(num.bitLength()); + + for (var bit = 0; bit < w.length; bit++) { + var off = (bit / 26) | 0; + var wbit = bit % 26; + + w[bit] = (num.words[off] >>> wbit) & 0x01; + } + + return w; + } + + // Number of trailing zero bits + BN.prototype.zeroBits = function zeroBits () { + if (this.isZero()) return 0; + + var r = 0; + for (var i = 0; i < this.length; i++) { + var b = this._zeroBits(this.words[i]); + r += b; + if (b !== 26) break; + } + return r; + }; + + BN.prototype.byteLength = function byteLength () { + return Math.ceil(this.bitLength() / 8); + }; + + BN.prototype.toTwos = function toTwos (width) { + if (this.negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); + }; + + BN.prototype.fromTwos = function fromTwos (width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); + }; + + BN.prototype.isNeg = function isNeg () { + return this.negative !== 0; + }; + + // Return negative clone of `this` + BN.prototype.neg = function neg () { + return this.clone().ineg(); + }; + + BN.prototype.ineg = function ineg () { + if (!this.isZero()) { + this.negative ^= 1; + } + + return this; + }; + + // Or `num` with `this` in-place + BN.prototype.iuor = function iuor (num) { + while (this.length < num.length) { + this.words[this.length++] = 0; + } + + for (var i = 0; i < num.length; i++) { + this.words[i] = this.words[i] | num.words[i]; + } + + return this._strip(); + }; + + BN.prototype.ior = function ior (num) { + assert((this.negative | num.negative) === 0); + return this.iuor(num); + }; + + // Or `num` with `this` + BN.prototype.or = function or (num) { + if (this.length > num.length) return this.clone().ior(num); + return num.clone().ior(this); + }; + + BN.prototype.uor = function uor (num) { + if (this.length > num.length) return this.clone().iuor(num); + return num.clone().iuor(this); + }; + + // And `num` with `this` in-place + BN.prototype.iuand = function iuand (num) { + // b = min-length(num, this) + var b; + if (this.length > num.length) { + b = num; + } else { + b = this; + } + + for (var i = 0; i < b.length; i++) { + this.words[i] = this.words[i] & num.words[i]; + } + + this.length = b.length; + + return this._strip(); + }; + + BN.prototype.iand = function iand (num) { + assert((this.negative | num.negative) === 0); + return this.iuand(num); + }; + + // And `num` with `this` + BN.prototype.and = function and (num) { + if (this.length > num.length) return this.clone().iand(num); + return num.clone().iand(this); + }; + + BN.prototype.uand = function uand (num) { + if (this.length > num.length) return this.clone().iuand(num); + return num.clone().iuand(this); + }; + + // Xor `num` with `this` in-place + BN.prototype.iuxor = function iuxor (num) { + // a.length > b.length + var a; + var b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + for (var i = 0; i < b.length; i++) { + this.words[i] = a.words[i] ^ b.words[i]; + } + + if (this !== a) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } + + this.length = a.length; + + return this._strip(); + }; + + BN.prototype.ixor = function ixor (num) { + assert((this.negative | num.negative) === 0); + return this.iuxor(num); + }; + + // Xor `num` with `this` + BN.prototype.xor = function xor (num) { + if (this.length > num.length) return this.clone().ixor(num); + return num.clone().ixor(this); + }; + + BN.prototype.uxor = function uxor (num) { + if (this.length > num.length) return this.clone().iuxor(num); + return num.clone().iuxor(this); + }; + + // Not ``this`` with ``width`` bitwidth + BN.prototype.inotn = function inotn (width) { + assert(typeof width === 'number' && width >= 0); + + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + + // Extend the buffer with leading zeroes + this._expand(bytesNeeded); + + if (bitsLeft > 0) { + bytesNeeded--; + } + + // Handle complete words + for (var i = 0; i < bytesNeeded; i++) { + this.words[i] = ~this.words[i] & 0x3ffffff; + } + + // Handle the residue + if (bitsLeft > 0) { + this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); + i++; + } + + // Clear words above the requested width so the result stays below 2 ** width + for (; i < this.length; i++) { + this.words[i] = 0; + } + + // And remove leading zeroes + return this._strip(); + }; + + BN.prototype.notn = function notn (width) { + return this.clone().inotn(width); + }; + + // Set `bit` of `this` + BN.prototype.setn = function setn (bit, val) { + assert(typeof bit === 'number' && bit >= 0); + + var off = (bit / 26) | 0; + var wbit = bit % 26; + + this._expand(off + 1); + + if (val) { + this.words[off] = this.words[off] | (1 << wbit); + } else { + this.words[off] = this.words[off] & ~(1 << wbit); + } + + return this._strip(); + }; + + // Add `num` to `this` in-place + BN.prototype.iadd = function iadd (num) { + var r; + + // negative + positive + if (this.negative !== 0 && num.negative === 0) { + this.negative = 0; + r = this.isub(num); + this.negative ^= 1; + return this._normSign(); + + // positive + negative + } else if (this.negative === 0 && num.negative !== 0) { + num.negative = 0; + r = this.isub(num); + num.negative = 1; + return r._normSign(); + } + + // a.length > b.length + var a, b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) + (b.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + + this.length = a.length; + if (carry !== 0) { + this.words[this.length] = carry; + this.length++; + // Copy the rest of the words + } else if (a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } + + return this; + }; + + // Add `num` to `this` + BN.prototype.add = function add (num) { + var res; + if (num.negative !== 0 && this.negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && this.negative !== 0) { + this.negative = 0; + res = num.sub(this); + this.negative = 1; + return res; + } + + if (this.length > num.length) return this.clone().iadd(num); + + return num.clone().iadd(this); + }; + + // Subtract `num` from `this` in-place + BN.prototype.isub = function isub (num) { + // this - (-num) = this + num + if (num.negative !== 0) { + num.negative = 0; + var r = this.iadd(num); + num.negative = 1; + return r._normSign(); + + // -this - num = -(this + num) + } else if (this.negative !== 0) { + this.negative = 0; + this.iadd(num); + this.negative = 1; + return this._normSign(); + } + + // At this point both numbers are positive + var cmp = this.cmp(num); + + // Optimization - zeroify + if (cmp === 0) { + this.negative = 0; + this.length = 1; + this.words[0] = 0; + return this; + } + + // a > b + var a, b; + if (cmp > 0) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) - (b.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } + + // Copy rest of the words + if (carry === 0 && i < a.length && a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } + + this.length = Math.max(this.length, i); + + if (a !== this) { + this.negative = 1; + } + + return this._strip(); + }; + + // Subtract `num` from `this` + BN.prototype.sub = function sub (num) { + return this.clone().isub(num); + }; + + function smallMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + var len = (self.length + num.length) | 0; + out.length = len; + len = (len - 1) | 0; + + // Peel one iteration (compiler can't do it, because of code complexity) + var a = self.words[0] | 0; + var b = num.words[0] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + var carry = (r / 0x4000000) | 0; + out.words[0] = lo; + + for (var k = 1; k < len; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = carry >>> 26; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = (k - j) | 0; + a = self.words[i] | 0; + b = num.words[j] | 0; + r = a * b + rword; + ncarry += (r / 0x4000000) | 0; + rword = r & 0x3ffffff; + } + out.words[k] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k] = carry | 0; + } else { + out.length--; + } + + return out._strip(); + } + + // TODO(indutny): it may be reasonable to omit it for users who don't need + // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit + // multiplication (like elliptic secp256k1). + var comb10MulTo = function comb10MulTo (self, num, out) { + var a = self.words; + var b = num.words; + var o = out.words; + var c = 0; + var lo; + var mid; + var hi; + var a0 = a[0] | 0; + var al0 = a0 & 0x1fff; + var ah0 = a0 >>> 13; + var a1 = a[1] | 0; + var al1 = a1 & 0x1fff; + var ah1 = a1 >>> 13; + var a2 = a[2] | 0; + var al2 = a2 & 0x1fff; + var ah2 = a2 >>> 13; + var a3 = a[3] | 0; + var al3 = a3 & 0x1fff; + var ah3 = a3 >>> 13; + var a4 = a[4] | 0; + var al4 = a4 & 0x1fff; + var ah4 = a4 >>> 13; + var a5 = a[5] | 0; + var al5 = a5 & 0x1fff; + var ah5 = a5 >>> 13; + var a6 = a[6] | 0; + var al6 = a6 & 0x1fff; + var ah6 = a6 >>> 13; + var a7 = a[7] | 0; + var al7 = a7 & 0x1fff; + var ah7 = a7 >>> 13; + var a8 = a[8] | 0; + var al8 = a8 & 0x1fff; + var ah8 = a8 >>> 13; + var a9 = a[9] | 0; + var al9 = a9 & 0x1fff; + var ah9 = a9 >>> 13; + var b0 = b[0] | 0; + var bl0 = b0 & 0x1fff; + var bh0 = b0 >>> 13; + var b1 = b[1] | 0; + var bl1 = b1 & 0x1fff; + var bh1 = b1 >>> 13; + var b2 = b[2] | 0; + var bl2 = b2 & 0x1fff; + var bh2 = b2 >>> 13; + var b3 = b[3] | 0; + var bl3 = b3 & 0x1fff; + var bh3 = b3 >>> 13; + var b4 = b[4] | 0; + var bl4 = b4 & 0x1fff; + var bh4 = b4 >>> 13; + var b5 = b[5] | 0; + var bl5 = b5 & 0x1fff; + var bh5 = b5 >>> 13; + var b6 = b[6] | 0; + var bl6 = b6 & 0x1fff; + var bh6 = b6 >>> 13; + var b7 = b[7] | 0; + var bl7 = b7 & 0x1fff; + var bh7 = b7 >>> 13; + var b8 = b[8] | 0; + var bl8 = b8 & 0x1fff; + var bh8 = b8 >>> 13; + var b9 = b[9] | 0; + var bl9 = b9 & 0x1fff; + var bh9 = b9 >>> 13; + + out.negative = self.negative ^ num.negative; + out.length = 19; + /* k = 0 */ + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = (mid + Math.imul(ah0, bl0)) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; + w0 &= 0x3ffffff; + /* k = 1 */ + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = (mid + Math.imul(ah1, bl0)) | 0; + hi = Math.imul(ah1, bh0); + lo = (lo + Math.imul(al0, bl1)) | 0; + mid = (mid + Math.imul(al0, bh1)) | 0; + mid = (mid + Math.imul(ah0, bl1)) | 0; + hi = (hi + Math.imul(ah0, bh1)) | 0; + var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; + w1 &= 0x3ffffff; + /* k = 2 */ + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = (mid + Math.imul(ah2, bl0)) | 0; + hi = Math.imul(ah2, bh0); + lo = (lo + Math.imul(al1, bl1)) | 0; + mid = (mid + Math.imul(al1, bh1)) | 0; + mid = (mid + Math.imul(ah1, bl1)) | 0; + hi = (hi + Math.imul(ah1, bh1)) | 0; + lo = (lo + Math.imul(al0, bl2)) | 0; + mid = (mid + Math.imul(al0, bh2)) | 0; + mid = (mid + Math.imul(ah0, bl2)) | 0; + hi = (hi + Math.imul(ah0, bh2)) | 0; + var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; + w2 &= 0x3ffffff; + /* k = 3 */ + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = (mid + Math.imul(ah3, bl0)) | 0; + hi = Math.imul(ah3, bh0); + lo = (lo + Math.imul(al2, bl1)) | 0; + mid = (mid + Math.imul(al2, bh1)) | 0; + mid = (mid + Math.imul(ah2, bl1)) | 0; + hi = (hi + Math.imul(ah2, bh1)) | 0; + lo = (lo + Math.imul(al1, bl2)) | 0; + mid = (mid + Math.imul(al1, bh2)) | 0; + mid = (mid + Math.imul(ah1, bl2)) | 0; + hi = (hi + Math.imul(ah1, bh2)) | 0; + lo = (lo + Math.imul(al0, bl3)) | 0; + mid = (mid + Math.imul(al0, bh3)) | 0; + mid = (mid + Math.imul(ah0, bl3)) | 0; + hi = (hi + Math.imul(ah0, bh3)) | 0; + var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; + w3 &= 0x3ffffff; + /* k = 4 */ + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = (mid + Math.imul(ah4, bl0)) | 0; + hi = Math.imul(ah4, bh0); + lo = (lo + Math.imul(al3, bl1)) | 0; + mid = (mid + Math.imul(al3, bh1)) | 0; + mid = (mid + Math.imul(ah3, bl1)) | 0; + hi = (hi + Math.imul(ah3, bh1)) | 0; + lo = (lo + Math.imul(al2, bl2)) | 0; + mid = (mid + Math.imul(al2, bh2)) | 0; + mid = (mid + Math.imul(ah2, bl2)) | 0; + hi = (hi + Math.imul(ah2, bh2)) | 0; + lo = (lo + Math.imul(al1, bl3)) | 0; + mid = (mid + Math.imul(al1, bh3)) | 0; + mid = (mid + Math.imul(ah1, bl3)) | 0; + hi = (hi + Math.imul(ah1, bh3)) | 0; + lo = (lo + Math.imul(al0, bl4)) | 0; + mid = (mid + Math.imul(al0, bh4)) | 0; + mid = (mid + Math.imul(ah0, bl4)) | 0; + hi = (hi + Math.imul(ah0, bh4)) | 0; + var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; + w4 &= 0x3ffffff; + /* k = 5 */ + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = (mid + Math.imul(ah5, bl0)) | 0; + hi = Math.imul(ah5, bh0); + lo = (lo + Math.imul(al4, bl1)) | 0; + mid = (mid + Math.imul(al4, bh1)) | 0; + mid = (mid + Math.imul(ah4, bl1)) | 0; + hi = (hi + Math.imul(ah4, bh1)) | 0; + lo = (lo + Math.imul(al3, bl2)) | 0; + mid = (mid + Math.imul(al3, bh2)) | 0; + mid = (mid + Math.imul(ah3, bl2)) | 0; + hi = (hi + Math.imul(ah3, bh2)) | 0; + lo = (lo + Math.imul(al2, bl3)) | 0; + mid = (mid + Math.imul(al2, bh3)) | 0; + mid = (mid + Math.imul(ah2, bl3)) | 0; + hi = (hi + Math.imul(ah2, bh3)) | 0; + lo = (lo + Math.imul(al1, bl4)) | 0; + mid = (mid + Math.imul(al1, bh4)) | 0; + mid = (mid + Math.imul(ah1, bl4)) | 0; + hi = (hi + Math.imul(ah1, bh4)) | 0; + lo = (lo + Math.imul(al0, bl5)) | 0; + mid = (mid + Math.imul(al0, bh5)) | 0; + mid = (mid + Math.imul(ah0, bl5)) | 0; + hi = (hi + Math.imul(ah0, bh5)) | 0; + var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; + w5 &= 0x3ffffff; + /* k = 6 */ + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = (mid + Math.imul(ah6, bl0)) | 0; + hi = Math.imul(ah6, bh0); + lo = (lo + Math.imul(al5, bl1)) | 0; + mid = (mid + Math.imul(al5, bh1)) | 0; + mid = (mid + Math.imul(ah5, bl1)) | 0; + hi = (hi + Math.imul(ah5, bh1)) | 0; + lo = (lo + Math.imul(al4, bl2)) | 0; + mid = (mid + Math.imul(al4, bh2)) | 0; + mid = (mid + Math.imul(ah4, bl2)) | 0; + hi = (hi + Math.imul(ah4, bh2)) | 0; + lo = (lo + Math.imul(al3, bl3)) | 0; + mid = (mid + Math.imul(al3, bh3)) | 0; + mid = (mid + Math.imul(ah3, bl3)) | 0; + hi = (hi + Math.imul(ah3, bh3)) | 0; + lo = (lo + Math.imul(al2, bl4)) | 0; + mid = (mid + Math.imul(al2, bh4)) | 0; + mid = (mid + Math.imul(ah2, bl4)) | 0; + hi = (hi + Math.imul(ah2, bh4)) | 0; + lo = (lo + Math.imul(al1, bl5)) | 0; + mid = (mid + Math.imul(al1, bh5)) | 0; + mid = (mid + Math.imul(ah1, bl5)) | 0; + hi = (hi + Math.imul(ah1, bh5)) | 0; + lo = (lo + Math.imul(al0, bl6)) | 0; + mid = (mid + Math.imul(al0, bh6)) | 0; + mid = (mid + Math.imul(ah0, bl6)) | 0; + hi = (hi + Math.imul(ah0, bh6)) | 0; + var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; + w6 &= 0x3ffffff; + /* k = 7 */ + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = (mid + Math.imul(ah7, bl0)) | 0; + hi = Math.imul(ah7, bh0); + lo = (lo + Math.imul(al6, bl1)) | 0; + mid = (mid + Math.imul(al6, bh1)) | 0; + mid = (mid + Math.imul(ah6, bl1)) | 0; + hi = (hi + Math.imul(ah6, bh1)) | 0; + lo = (lo + Math.imul(al5, bl2)) | 0; + mid = (mid + Math.imul(al5, bh2)) | 0; + mid = (mid + Math.imul(ah5, bl2)) | 0; + hi = (hi + Math.imul(ah5, bh2)) | 0; + lo = (lo + Math.imul(al4, bl3)) | 0; + mid = (mid + Math.imul(al4, bh3)) | 0; + mid = (mid + Math.imul(ah4, bl3)) | 0; + hi = (hi + Math.imul(ah4, bh3)) | 0; + lo = (lo + Math.imul(al3, bl4)) | 0; + mid = (mid + Math.imul(al3, bh4)) | 0; + mid = (mid + Math.imul(ah3, bl4)) | 0; + hi = (hi + Math.imul(ah3, bh4)) | 0; + lo = (lo + Math.imul(al2, bl5)) | 0; + mid = (mid + Math.imul(al2, bh5)) | 0; + mid = (mid + Math.imul(ah2, bl5)) | 0; + hi = (hi + Math.imul(ah2, bh5)) | 0; + lo = (lo + Math.imul(al1, bl6)) | 0; + mid = (mid + Math.imul(al1, bh6)) | 0; + mid = (mid + Math.imul(ah1, bl6)) | 0; + hi = (hi + Math.imul(ah1, bh6)) | 0; + lo = (lo + Math.imul(al0, bl7)) | 0; + mid = (mid + Math.imul(al0, bh7)) | 0; + mid = (mid + Math.imul(ah0, bl7)) | 0; + hi = (hi + Math.imul(ah0, bh7)) | 0; + var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; + w7 &= 0x3ffffff; + /* k = 8 */ + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = (mid + Math.imul(ah8, bl0)) | 0; + hi = Math.imul(ah8, bh0); + lo = (lo + Math.imul(al7, bl1)) | 0; + mid = (mid + Math.imul(al7, bh1)) | 0; + mid = (mid + Math.imul(ah7, bl1)) | 0; + hi = (hi + Math.imul(ah7, bh1)) | 0; + lo = (lo + Math.imul(al6, bl2)) | 0; + mid = (mid + Math.imul(al6, bh2)) | 0; + mid = (mid + Math.imul(ah6, bl2)) | 0; + hi = (hi + Math.imul(ah6, bh2)) | 0; + lo = (lo + Math.imul(al5, bl3)) | 0; + mid = (mid + Math.imul(al5, bh3)) | 0; + mid = (mid + Math.imul(ah5, bl3)) | 0; + hi = (hi + Math.imul(ah5, bh3)) | 0; + lo = (lo + Math.imul(al4, bl4)) | 0; + mid = (mid + Math.imul(al4, bh4)) | 0; + mid = (mid + Math.imul(ah4, bl4)) | 0; + hi = (hi + Math.imul(ah4, bh4)) | 0; + lo = (lo + Math.imul(al3, bl5)) | 0; + mid = (mid + Math.imul(al3, bh5)) | 0; + mid = (mid + Math.imul(ah3, bl5)) | 0; + hi = (hi + Math.imul(ah3, bh5)) | 0; + lo = (lo + Math.imul(al2, bl6)) | 0; + mid = (mid + Math.imul(al2, bh6)) | 0; + mid = (mid + Math.imul(ah2, bl6)) | 0; + hi = (hi + Math.imul(ah2, bh6)) | 0; + lo = (lo + Math.imul(al1, bl7)) | 0; + mid = (mid + Math.imul(al1, bh7)) | 0; + mid = (mid + Math.imul(ah1, bl7)) | 0; + hi = (hi + Math.imul(ah1, bh7)) | 0; + lo = (lo + Math.imul(al0, bl8)) | 0; + mid = (mid + Math.imul(al0, bh8)) | 0; + mid = (mid + Math.imul(ah0, bl8)) | 0; + hi = (hi + Math.imul(ah0, bh8)) | 0; + var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; + w8 &= 0x3ffffff; + /* k = 9 */ + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = (mid + Math.imul(ah9, bl0)) | 0; + hi = Math.imul(ah9, bh0); + lo = (lo + Math.imul(al8, bl1)) | 0; + mid = (mid + Math.imul(al8, bh1)) | 0; + mid = (mid + Math.imul(ah8, bl1)) | 0; + hi = (hi + Math.imul(ah8, bh1)) | 0; + lo = (lo + Math.imul(al7, bl2)) | 0; + mid = (mid + Math.imul(al7, bh2)) | 0; + mid = (mid + Math.imul(ah7, bl2)) | 0; + hi = (hi + Math.imul(ah7, bh2)) | 0; + lo = (lo + Math.imul(al6, bl3)) | 0; + mid = (mid + Math.imul(al6, bh3)) | 0; + mid = (mid + Math.imul(ah6, bl3)) | 0; + hi = (hi + Math.imul(ah6, bh3)) | 0; + lo = (lo + Math.imul(al5, bl4)) | 0; + mid = (mid + Math.imul(al5, bh4)) | 0; + mid = (mid + Math.imul(ah5, bl4)) | 0; + hi = (hi + Math.imul(ah5, bh4)) | 0; + lo = (lo + Math.imul(al4, bl5)) | 0; + mid = (mid + Math.imul(al4, bh5)) | 0; + mid = (mid + Math.imul(ah4, bl5)) | 0; + hi = (hi + Math.imul(ah4, bh5)) | 0; + lo = (lo + Math.imul(al3, bl6)) | 0; + mid = (mid + Math.imul(al3, bh6)) | 0; + mid = (mid + Math.imul(ah3, bl6)) | 0; + hi = (hi + Math.imul(ah3, bh6)) | 0; + lo = (lo + Math.imul(al2, bl7)) | 0; + mid = (mid + Math.imul(al2, bh7)) | 0; + mid = (mid + Math.imul(ah2, bl7)) | 0; + hi = (hi + Math.imul(ah2, bh7)) | 0; + lo = (lo + Math.imul(al1, bl8)) | 0; + mid = (mid + Math.imul(al1, bh8)) | 0; + mid = (mid + Math.imul(ah1, bl8)) | 0; + hi = (hi + Math.imul(ah1, bh8)) | 0; + lo = (lo + Math.imul(al0, bl9)) | 0; + mid = (mid + Math.imul(al0, bh9)) | 0; + mid = (mid + Math.imul(ah0, bl9)) | 0; + hi = (hi + Math.imul(ah0, bh9)) | 0; + var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; + w9 &= 0x3ffffff; + /* k = 10 */ + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = (mid + Math.imul(ah9, bl1)) | 0; + hi = Math.imul(ah9, bh1); + lo = (lo + Math.imul(al8, bl2)) | 0; + mid = (mid + Math.imul(al8, bh2)) | 0; + mid = (mid + Math.imul(ah8, bl2)) | 0; + hi = (hi + Math.imul(ah8, bh2)) | 0; + lo = (lo + Math.imul(al7, bl3)) | 0; + mid = (mid + Math.imul(al7, bh3)) | 0; + mid = (mid + Math.imul(ah7, bl3)) | 0; + hi = (hi + Math.imul(ah7, bh3)) | 0; + lo = (lo + Math.imul(al6, bl4)) | 0; + mid = (mid + Math.imul(al6, bh4)) | 0; + mid = (mid + Math.imul(ah6, bl4)) | 0; + hi = (hi + Math.imul(ah6, bh4)) | 0; + lo = (lo + Math.imul(al5, bl5)) | 0; + mid = (mid + Math.imul(al5, bh5)) | 0; + mid = (mid + Math.imul(ah5, bl5)) | 0; + hi = (hi + Math.imul(ah5, bh5)) | 0; + lo = (lo + Math.imul(al4, bl6)) | 0; + mid = (mid + Math.imul(al4, bh6)) | 0; + mid = (mid + Math.imul(ah4, bl6)) | 0; + hi = (hi + Math.imul(ah4, bh6)) | 0; + lo = (lo + Math.imul(al3, bl7)) | 0; + mid = (mid + Math.imul(al3, bh7)) | 0; + mid = (mid + Math.imul(ah3, bl7)) | 0; + hi = (hi + Math.imul(ah3, bh7)) | 0; + lo = (lo + Math.imul(al2, bl8)) | 0; + mid = (mid + Math.imul(al2, bh8)) | 0; + mid = (mid + Math.imul(ah2, bl8)) | 0; + hi = (hi + Math.imul(ah2, bh8)) | 0; + lo = (lo + Math.imul(al1, bl9)) | 0; + mid = (mid + Math.imul(al1, bh9)) | 0; + mid = (mid + Math.imul(ah1, bl9)) | 0; + hi = (hi + Math.imul(ah1, bh9)) | 0; + var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; + w10 &= 0x3ffffff; + /* k = 11 */ + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = (mid + Math.imul(ah9, bl2)) | 0; + hi = Math.imul(ah9, bh2); + lo = (lo + Math.imul(al8, bl3)) | 0; + mid = (mid + Math.imul(al8, bh3)) | 0; + mid = (mid + Math.imul(ah8, bl3)) | 0; + hi = (hi + Math.imul(ah8, bh3)) | 0; + lo = (lo + Math.imul(al7, bl4)) | 0; + mid = (mid + Math.imul(al7, bh4)) | 0; + mid = (mid + Math.imul(ah7, bl4)) | 0; + hi = (hi + Math.imul(ah7, bh4)) | 0; + lo = (lo + Math.imul(al6, bl5)) | 0; + mid = (mid + Math.imul(al6, bh5)) | 0; + mid = (mid + Math.imul(ah6, bl5)) | 0; + hi = (hi + Math.imul(ah6, bh5)) | 0; + lo = (lo + Math.imul(al5, bl6)) | 0; + mid = (mid + Math.imul(al5, bh6)) | 0; + mid = (mid + Math.imul(ah5, bl6)) | 0; + hi = (hi + Math.imul(ah5, bh6)) | 0; + lo = (lo + Math.imul(al4, bl7)) | 0; + mid = (mid + Math.imul(al4, bh7)) | 0; + mid = (mid + Math.imul(ah4, bl7)) | 0; + hi = (hi + Math.imul(ah4, bh7)) | 0; + lo = (lo + Math.imul(al3, bl8)) | 0; + mid = (mid + Math.imul(al3, bh8)) | 0; + mid = (mid + Math.imul(ah3, bl8)) | 0; + hi = (hi + Math.imul(ah3, bh8)) | 0; + lo = (lo + Math.imul(al2, bl9)) | 0; + mid = (mid + Math.imul(al2, bh9)) | 0; + mid = (mid + Math.imul(ah2, bl9)) | 0; + hi = (hi + Math.imul(ah2, bh9)) | 0; + var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; + w11 &= 0x3ffffff; + /* k = 12 */ + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = (mid + Math.imul(ah9, bl3)) | 0; + hi = Math.imul(ah9, bh3); + lo = (lo + Math.imul(al8, bl4)) | 0; + mid = (mid + Math.imul(al8, bh4)) | 0; + mid = (mid + Math.imul(ah8, bl4)) | 0; + hi = (hi + Math.imul(ah8, bh4)) | 0; + lo = (lo + Math.imul(al7, bl5)) | 0; + mid = (mid + Math.imul(al7, bh5)) | 0; + mid = (mid + Math.imul(ah7, bl5)) | 0; + hi = (hi + Math.imul(ah7, bh5)) | 0; + lo = (lo + Math.imul(al6, bl6)) | 0; + mid = (mid + Math.imul(al6, bh6)) | 0; + mid = (mid + Math.imul(ah6, bl6)) | 0; + hi = (hi + Math.imul(ah6, bh6)) | 0; + lo = (lo + Math.imul(al5, bl7)) | 0; + mid = (mid + Math.imul(al5, bh7)) | 0; + mid = (mid + Math.imul(ah5, bl7)) | 0; + hi = (hi + Math.imul(ah5, bh7)) | 0; + lo = (lo + Math.imul(al4, bl8)) | 0; + mid = (mid + Math.imul(al4, bh8)) | 0; + mid = (mid + Math.imul(ah4, bl8)) | 0; + hi = (hi + Math.imul(ah4, bh8)) | 0; + lo = (lo + Math.imul(al3, bl9)) | 0; + mid = (mid + Math.imul(al3, bh9)) | 0; + mid = (mid + Math.imul(ah3, bl9)) | 0; + hi = (hi + Math.imul(ah3, bh9)) | 0; + var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; + w12 &= 0x3ffffff; + /* k = 13 */ + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = (mid + Math.imul(ah9, bl4)) | 0; + hi = Math.imul(ah9, bh4); + lo = (lo + Math.imul(al8, bl5)) | 0; + mid = (mid + Math.imul(al8, bh5)) | 0; + mid = (mid + Math.imul(ah8, bl5)) | 0; + hi = (hi + Math.imul(ah8, bh5)) | 0; + lo = (lo + Math.imul(al7, bl6)) | 0; + mid = (mid + Math.imul(al7, bh6)) | 0; + mid = (mid + Math.imul(ah7, bl6)) | 0; + hi = (hi + Math.imul(ah7, bh6)) | 0; + lo = (lo + Math.imul(al6, bl7)) | 0; + mid = (mid + Math.imul(al6, bh7)) | 0; + mid = (mid + Math.imul(ah6, bl7)) | 0; + hi = (hi + Math.imul(ah6, bh7)) | 0; + lo = (lo + Math.imul(al5, bl8)) | 0; + mid = (mid + Math.imul(al5, bh8)) | 0; + mid = (mid + Math.imul(ah5, bl8)) | 0; + hi = (hi + Math.imul(ah5, bh8)) | 0; + lo = (lo + Math.imul(al4, bl9)) | 0; + mid = (mid + Math.imul(al4, bh9)) | 0; + mid = (mid + Math.imul(ah4, bl9)) | 0; + hi = (hi + Math.imul(ah4, bh9)) | 0; + var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; + w13 &= 0x3ffffff; + /* k = 14 */ + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = (mid + Math.imul(ah9, bl5)) | 0; + hi = Math.imul(ah9, bh5); + lo = (lo + Math.imul(al8, bl6)) | 0; + mid = (mid + Math.imul(al8, bh6)) | 0; + mid = (mid + Math.imul(ah8, bl6)) | 0; + hi = (hi + Math.imul(ah8, bh6)) | 0; + lo = (lo + Math.imul(al7, bl7)) | 0; + mid = (mid + Math.imul(al7, bh7)) | 0; + mid = (mid + Math.imul(ah7, bl7)) | 0; + hi = (hi + Math.imul(ah7, bh7)) | 0; + lo = (lo + Math.imul(al6, bl8)) | 0; + mid = (mid + Math.imul(al6, bh8)) | 0; + mid = (mid + Math.imul(ah6, bl8)) | 0; + hi = (hi + Math.imul(ah6, bh8)) | 0; + lo = (lo + Math.imul(al5, bl9)) | 0; + mid = (mid + Math.imul(al5, bh9)) | 0; + mid = (mid + Math.imul(ah5, bl9)) | 0; + hi = (hi + Math.imul(ah5, bh9)) | 0; + var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; + w14 &= 0x3ffffff; + /* k = 15 */ + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = (mid + Math.imul(ah9, bl6)) | 0; + hi = Math.imul(ah9, bh6); + lo = (lo + Math.imul(al8, bl7)) | 0; + mid = (mid + Math.imul(al8, bh7)) | 0; + mid = (mid + Math.imul(ah8, bl7)) | 0; + hi = (hi + Math.imul(ah8, bh7)) | 0; + lo = (lo + Math.imul(al7, bl8)) | 0; + mid = (mid + Math.imul(al7, bh8)) | 0; + mid = (mid + Math.imul(ah7, bl8)) | 0; + hi = (hi + Math.imul(ah7, bh8)) | 0; + lo = (lo + Math.imul(al6, bl9)) | 0; + mid = (mid + Math.imul(al6, bh9)) | 0; + mid = (mid + Math.imul(ah6, bl9)) | 0; + hi = (hi + Math.imul(ah6, bh9)) | 0; + var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; + w15 &= 0x3ffffff; + /* k = 16 */ + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = (mid + Math.imul(ah9, bl7)) | 0; + hi = Math.imul(ah9, bh7); + lo = (lo + Math.imul(al8, bl8)) | 0; + mid = (mid + Math.imul(al8, bh8)) | 0; + mid = (mid + Math.imul(ah8, bl8)) | 0; + hi = (hi + Math.imul(ah8, bh8)) | 0; + lo = (lo + Math.imul(al7, bl9)) | 0; + mid = (mid + Math.imul(al7, bh9)) | 0; + mid = (mid + Math.imul(ah7, bl9)) | 0; + hi = (hi + Math.imul(ah7, bh9)) | 0; + var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; + w16 &= 0x3ffffff; + /* k = 17 */ + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = (mid + Math.imul(ah9, bl8)) | 0; + hi = Math.imul(ah9, bh8); + lo = (lo + Math.imul(al8, bl9)) | 0; + mid = (mid + Math.imul(al8, bh9)) | 0; + mid = (mid + Math.imul(ah8, bl9)) | 0; + hi = (hi + Math.imul(ah8, bh9)) | 0; + var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; + w17 &= 0x3ffffff; + /* k = 18 */ + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = (mid + Math.imul(ah9, bl9)) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; + w18 &= 0x3ffffff; + o[0] = w0; + o[1] = w1; + o[2] = w2; + o[3] = w3; + o[4] = w4; + o[5] = w5; + o[6] = w6; + o[7] = w7; + o[8] = w8; + o[9] = w9; + o[10] = w10; + o[11] = w11; + o[12] = w12; + o[13] = w13; + o[14] = w14; + o[15] = w15; + o[16] = w16; + o[17] = w17; + o[18] = w18; + if (c !== 0) { + o[19] = c; + out.length++; + } + return out; + }; + + // Polyfill comb + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + + function bigMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + out.length = self.length + num.length; + + var carry = 0; + var hncarry = 0; + for (var k = 0; k < out.length - 1; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = k - j; + var a = self.words[i] | 0; + var b = num.words[j] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 0x3ffffff; + ncarry = (ncarry + (lo >>> 26)) | 0; + + hncarry += ncarry >>> 26; + ncarry &= 0x3ffffff; + } + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; + } + if (carry !== 0) { + out.words[k] = carry; + } else { + out.length--; + } + + return out._strip(); + } + + function jumboMulTo (self, num, out) { + // Temporary disable, see https://github.com/indutny/bn.js/issues/211 + // var fftm = new FFTM(); + // return fftm.mulp(self, num, out); + return bigMulTo(self, num, out); + } + + BN.prototype.mulTo = function mulTo (num, out) { + var res; + var len = this.length + num.length; + if (this.length === 10 && num.length === 10) { + res = comb10MulTo(this, num, out); + } else if (len < 63) { + res = smallMulTo(this, num, out); + } else if (len < 1024) { + res = bigMulTo(this, num, out); + } else { + res = jumboMulTo(this, num, out); + } + + return res; + }; + + // Multiply `this` by `num` + BN.prototype.mul = function mul (num) { + var out = new BN(null); + out.words = new Array(this.length + num.length); + return this.mulTo(num, out); + }; + + // Multiply employing FFT + BN.prototype.mulf = function mulf (num) { + var out = new BN(null); + out.words = new Array(this.length + num.length); + return jumboMulTo(this, num, out); + }; + + // In-place Multiplication + BN.prototype.imul = function imul (num) { + return this.clone().mulTo(num, this); + }; + + BN.prototype.imuln = function imuln (num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + + assert(typeof num === 'number'); + assert(num < 0x4000000); + + // Carry + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = (this.words[i] | 0) * num; + var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); + carry >>= 26; + carry += (w / 0x4000000) | 0; + // NOTE: lo is 27bit maximum + carry += lo >>> 26; + this.words[i] = lo & 0x3ffffff; + } + + if (carry !== 0) { + this.words[i] = carry; + this.length++; + } + if (num === 0) { + this.length = 1; + this._normSign(); + } + + return isNegNum ? this.ineg() : this; + }; + + BN.prototype.muln = function muln (num) { + return this.clone().imuln(num); + }; + + // `this` * `this` + BN.prototype.sqr = function sqr () { + return this.mul(this); + }; + + // `this` * `this` in-place + BN.prototype.isqr = function isqr () { + return this.imul(this.clone()); + }; + + // Math.pow(`this`, `num`) + BN.prototype.pow = function pow (num) { + var w = toBitArray(num); + if (w.length === 0) return new BN(1); + + // Skip leading zeroes + var res = this; + for (var i = 0; i < w.length; i++, res = res.sqr()) { + if (w[i] !== 0) break; + } + + if (++i < w.length) { + for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { + if (w[i] === 0) continue; + + res = res.mul(q); + } + } + + return res; + }; + + // Shift-left in-place + BN.prototype.iushln = function iushln (bits) { + assert(typeof bits === 'number' && bits >= 0); + var r = bits % 26; + var s = (bits - r) / 26; + var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); + var i; + + if (r !== 0) { + var carry = 0; + + for (i = 0; i < this.length; i++) { + var newCarry = this.words[i] & carryMask; + var c = ((this.words[i] | 0) - newCarry) << r; + this.words[i] = c | carry; + carry = newCarry >>> (26 - r); + } + + if (carry) { + this.words[i] = carry; + this.length++; + } + } + + if (s !== 0) { + for (i = this.length - 1; i >= 0; i--) { + this.words[i + s] = this.words[i]; + } + + for (i = 0; i < s; i++) { + this.words[i] = 0; + } + + this.length += s; + } + + return this._strip(); + }; + + BN.prototype.ishln = function ishln (bits) { + // TODO(indutny): implement me + assert(this.negative === 0); + return this.iushln(bits); + }; + + // Shift-right in-place + // NOTE: `hint` is a lowest bit before trailing zeroes + // NOTE: if `extended` is present - it will be filled with destroyed bits + BN.prototype.iushrn = function iushrn (bits, hint, extended) { + assert(typeof bits === 'number' && bits >= 0); + var h; + if (hint) { + h = (hint - (hint % 26)) / 26; + } else { + h = 0; + } + + var r = bits % 26; + var s = Math.min((bits - r) / 26, this.length); + var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); + var maskedWords = extended; + + h -= s; + h = Math.max(0, h); + + // Extended mode, copy masked part + if (maskedWords) { + for (var i = 0; i < s; i++) { + maskedWords.words[i] = this.words[i]; + } + maskedWords.length = s; + } + + if (s === 0) ; else if (this.length > s) { + this.length -= s; + for (i = 0; i < this.length; i++) { + this.words[i] = this.words[i + s]; + } + } else { + this.words[0] = 0; + this.length = 1; + } + + var carry = 0; + for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { + var word = this.words[i] | 0; + this.words[i] = (carry << (26 - r)) | (word >>> r); + carry = word & mask; + } + + // Push carried bits as a mask + if (maskedWords && carry !== 0) { + maskedWords.words[maskedWords.length++] = carry; + } + + if (this.length === 0) { + this.words[0] = 0; + this.length = 1; + } + + return this._strip(); + }; + + BN.prototype.ishrn = function ishrn (bits, hint, extended) { + // TODO(indutny): implement me + assert(this.negative === 0); + return this.iushrn(bits, hint, extended); + }; + + // Shift-left + BN.prototype.shln = function shln (bits) { + return this.clone().ishln(bits); + }; + + BN.prototype.ushln = function ushln (bits) { + return this.clone().iushln(bits); + }; + + // Shift-right + BN.prototype.shrn = function shrn (bits) { + return this.clone().ishrn(bits); + }; + + BN.prototype.ushrn = function ushrn (bits) { + return this.clone().iushrn(bits); + }; + + // Test if n bit is set + BN.prototype.testn = function testn (bit) { + assert(typeof bit === 'number' && bit >= 0); + var r = bit % 26; + var s = (bit - r) / 26; + var q = 1 << r; + + // Fast case: bit is much higher than all existing words + if (this.length <= s) return false; + + // Check bit and return + var w = this.words[s]; + + return !!(w & q); + }; + + // Return only lowers bits of number (in-place) + BN.prototype.imaskn = function imaskn (bits) { + assert(typeof bits === 'number' && bits >= 0); + var r = bits % 26; + var s = (bits - r) / 26; + + assert(this.negative === 0, 'imaskn works only with positive numbers'); + + if (this.length <= s) { + return this; + } + + if (r !== 0) { + s++; + } + this.length = Math.min(s, this.length); + + if (r !== 0) { + var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); + this.words[this.length - 1] &= mask; + } + + if (this.length === 0) { + this.words[0] = 0; + this.length = 1; + } + + return this._strip(); + }; + + // Return only lowers bits of number + BN.prototype.maskn = function maskn (bits) { + return this.clone().imaskn(bits); + }; + + // Add plain number `num` to `this` + BN.prototype.iaddn = function iaddn (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); + if (num < 0) return this.isubn(-num); + + // Possible sign change + if (this.negative !== 0) { + if (this.length === 1 && (this.words[0] | 0) <= num) { + this.words[0] = num - (this.words[0] | 0); + this.negative = 0; + return this; + } + + this.negative = 0; + this.isubn(num); + this.negative = 1; + return this; + } + + // Add without checks + return this._iaddn(num); + }; + + BN.prototype._iaddn = function _iaddn (num) { + this.words[0] += num; + + // Carry + for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { + this.words[i] -= 0x4000000; + if (i === this.length - 1) { + this.words[i + 1] = 1; + } else { + this.words[i + 1]++; + } + } + this.length = Math.max(this.length, i + 1); + + return this; + }; + + // Subtract plain number `num` from `this` + BN.prototype.isubn = function isubn (num) { + assert(typeof num === 'number'); + assert(num < 0x4000000); + if (num < 0) return this.iaddn(-num); + + if (this.negative !== 0) { + this.negative = 0; + this.iaddn(num); + this.negative = 1; + return this; + } + + this.words[0] -= num; + + if (this.length === 1 && this.words[0] < 0) { + this.words[0] = -this.words[0]; + this.negative = 1; + } else { + // Carry + for (var i = 0; i < this.length && this.words[i] < 0; i++) { + this.words[i] += 0x4000000; + this.words[i + 1] -= 1; + } + } + + return this._strip(); + }; + + BN.prototype.addn = function addn (num) { + return this.clone().iaddn(num); + }; + + BN.prototype.subn = function subn (num) { + return this.clone().isubn(num); + }; + + BN.prototype.iabs = function iabs () { + this.negative = 0; + + return this; + }; + + BN.prototype.abs = function abs () { + return this.clone().iabs(); + }; + + BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { + var len = num.length + shift; + var i; + + this._expand(len); + + var w; + var carry = 0; + for (i = 0; i < num.length; i++) { + w = (this.words[i + shift] | 0) + carry; + var right = (num.words[i] | 0) * mul; + w -= right & 0x3ffffff; + carry = (w >> 26) - ((right / 0x4000000) | 0); + this.words[i + shift] = w & 0x3ffffff; + } + for (; i < this.length - shift; i++) { + w = (this.words[i + shift] | 0) + carry; + carry = w >> 26; + this.words[i + shift] = w & 0x3ffffff; + } + + if (carry === 0) return this._strip(); + + // Subtraction overflow + assert(carry === -1); + carry = 0; + for (i = 0; i < this.length; i++) { + w = -(this.words[i] | 0) + carry; + carry = w >> 26; + this.words[i] = w & 0x3ffffff; + } + this.negative = 1; + + return this._strip(); + }; + + BN.prototype._wordDiv = function _wordDiv (num, mode) { + var shift = this.length - num.length; + + var a = this.clone(); + var b = num; + + // Normalize + var bhi = b.words[b.length - 1] | 0; + var bhiBits = this._countBits(bhi); + shift = 26 - bhiBits; + if (shift !== 0) { + b = b.ushln(shift); + a.iushln(shift); + bhi = b.words[b.length - 1] | 0; + } + + // Initialize quotient + var m = a.length - b.length; + var q; + + if (mode !== 'mod') { + q = new BN(null); + q.length = m + 1; + q.words = new Array(q.length); + for (var i = 0; i < q.length; i++) { + q.words[i] = 0; + } + } + + var diff = a.clone()._ishlnsubmul(b, 1, m); + if (diff.negative === 0) { + a = diff; + if (q) { + q.words[m] = 1; + } + } + + for (var j = m - 1; j >= 0; j--) { + var qj = (a.words[b.length + j] | 0) * 0x4000000 + + (a.words[b.length + j - 1] | 0); + + // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max + // (0x7ffffff) + qj = Math.min((qj / bhi) | 0, 0x3ffffff); + + a._ishlnsubmul(b, qj, j); + while (a.negative !== 0) { + qj--; + a.negative = 0; + a._ishlnsubmul(b, 1, j); + if (!a.isZero()) { + a.negative ^= 1; + } + } + if (q) { + q.words[j] = qj; + } + } + if (q) { + q._strip(); + } + a._strip(); + + // Denormalize + if (mode !== 'div' && shift !== 0) { + a.iushrn(shift); + } + + return { + div: q || null, + mod: a + }; + }; + + // NOTE: 1) `mode` can be set to `mod` to request mod only, + // to `div` to request div only, or be absent to + // request both div & mod + // 2) `positive` is true if unsigned mod is requested + BN.prototype.divmod = function divmod (num, mode, positive) { + assert(!num.isZero()); + + if (this.isZero()) { + return { + div: new BN(0), + mod: new BN(0) + }; + } + + var div, mod, res; + if (this.negative !== 0 && num.negative === 0) { + res = this.neg().divmod(num, mode); + + if (mode !== 'mod') { + div = res.div.neg(); + } + + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.iadd(num); + } + } + + return { + div: div, + mod: mod + }; + } + + if (this.negative === 0 && num.negative !== 0) { + res = this.divmod(num.neg(), mode); + + if (mode !== 'mod') { + div = res.div.neg(); + } + + return { + div: div, + mod: res.mod + }; + } + + if ((this.negative & num.negative) !== 0) { + res = this.neg().divmod(num.neg(), mode); + + if (mode !== 'div') { + mod = res.mod.neg(); + if (positive && mod.negative !== 0) { + mod.isub(num); + } + } + + return { + div: res.div, + mod: mod + }; + } + + // Both numbers are positive at this point + + // Strip both numbers to approximate shift value + if (num.length > this.length || this.cmp(num) < 0) { + return { + div: new BN(0), + mod: this + }; + } + + // Very short reduction + if (num.length === 1) { + if (mode === 'div') { + return { + div: this.divn(num.words[0]), + mod: null + }; + } + + if (mode === 'mod') { + return { + div: null, + mod: new BN(this.modrn(num.words[0])) + }; + } + + return { + div: this.divn(num.words[0]), + mod: new BN(this.modrn(num.words[0])) + }; + } + + return this._wordDiv(num, mode); + }; + + // Find `this` / `num` + BN.prototype.div = function div (num) { + return this.divmod(num, 'div', false).div; + }; + + // Find `this` % `num` + BN.prototype.mod = function mod (num) { + return this.divmod(num, 'mod', false).mod; + }; + + BN.prototype.umod = function umod (num) { + return this.divmod(num, 'mod', true).mod; + }; + + // Find Round(`this` / `num`) + BN.prototype.divRound = function divRound (num) { + var dm = this.divmod(num); + + // Fast case - exact division + if (dm.mod.isZero()) return dm.div; + + var mod = dm.mod.abs(); + + var half = num.abs().iushrn(1); + var r2 = num.words[0] & 1; + var cmp = mod.cmp(half); + + // Round down + if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div; + + // Round up, away from zero + var up = new BN(1); + up.negative = this.negative ^ num.negative; + return dm.div.iadd(up); + }; + + BN.prototype.modrn = function modrn (num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + + assert(num <= 0x3ffffff); + var p = (1 << 26) % num; + + var acc = 0; + for (var i = this.length - 1; i >= 0; i--) { + acc = (p * acc + (this.words[i] | 0)) % num; + } + + return isNegNum ? -acc : acc; + }; + + // WARNING: DEPRECATED + BN.prototype.modn = function modn (num) { + return this.modrn(num); + }; + + // In-place division by number + BN.prototype.idivn = function idivn (num) { + var isNegNum = num < 0; + if (isNegNum) num = -num; + + assert(num <= 0x3ffffff); + + var carry = 0; + for (var i = this.length - 1; i >= 0; i--) { + var w = (this.words[i] | 0) + carry * 0x4000000; + this.words[i] = (w / num) | 0; + carry = w % num; + } + + this._strip(); + return isNegNum ? this.ineg() : this; + }; + + BN.prototype.divn = function divn (num) { + return this.clone().idivn(num); + }; + + BN.prototype.egcd = function egcd (p) { + assert(p.negative === 0); + assert(!p.isZero()); + + var x = this; + var y = p.clone(); + + if (x.negative !== 0) { + x = x.umod(p); + } else { + x = x.clone(); + } + + // A * x + B * y = x + var A = new BN(1); + var B = new BN(0); + + // C * x + D * y = y + var C = new BN(0); + var D = new BN(1); + + var g = 0; + + while (x.isEven() && y.isEven()) { + x.iushrn(1); + y.iushrn(1); + ++g; + } + + var yp = y.clone(); + var xp = x.clone(); + + while (!x.isZero()) { + for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); + if (i > 0) { + x.iushrn(i); + while (i-- > 0) { + if (A.isOdd() || B.isOdd()) { + A.iadd(yp); + B.isub(xp); + } + + A.iushrn(1); + B.iushrn(1); + } + } + + for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); + if (j > 0) { + y.iushrn(j); + while (j-- > 0) { + if (C.isOdd() || D.isOdd()) { + C.iadd(yp); + D.isub(xp); + } + + C.iushrn(1); + D.iushrn(1); + } + } + + if (x.cmp(y) >= 0) { + x.isub(y); + A.isub(C); + B.isub(D); + } else { + y.isub(x); + C.isub(A); + D.isub(B); + } + } + + return { + a: C, + b: D, + gcd: y.iushln(g) + }; + }; + + // This is reduced incarnation of the binary EEA + // above, designated to invert members of the + // _prime_ fields F(p) at a maximal speed + BN.prototype._invmp = function _invmp (p) { + assert(p.negative === 0); + assert(!p.isZero()); + + var a = this; + var b = p.clone(); + + if (a.negative !== 0) { + a = a.umod(p); + } else { + a = a.clone(); + } + + var x1 = new BN(1); + var x2 = new BN(0); + + var delta = b.clone(); + + while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { + for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); + if (i > 0) { + a.iushrn(i); + while (i-- > 0) { + if (x1.isOdd()) { + x1.iadd(delta); + } + + x1.iushrn(1); + } + } + + for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); + if (j > 0) { + b.iushrn(j); + while (j-- > 0) { + if (x2.isOdd()) { + x2.iadd(delta); + } + + x2.iushrn(1); + } + } + + if (a.cmp(b) >= 0) { + a.isub(b); + x1.isub(x2); + } else { + b.isub(a); + x2.isub(x1); + } + } + + var res; + if (a.cmpn(1) === 0) { + res = x1; + } else { + res = x2; + } + + if (res.cmpn(0) < 0) { + res.iadd(p); + } + + return res; + }; + + BN.prototype.gcd = function gcd (num) { + if (this.isZero()) return num.abs(); + if (num.isZero()) return this.abs(); + + var a = this.clone(); + var b = num.clone(); + a.negative = 0; + b.negative = 0; + + // Remove common factor of two + for (var shift = 0; a.isEven() && b.isEven(); shift++) { + a.iushrn(1); + b.iushrn(1); + } + + do { + while (a.isEven()) { + a.iushrn(1); + } + while (b.isEven()) { + b.iushrn(1); + } + + var r = a.cmp(b); + if (r < 0) { + // Swap `a` and `b` to make `a` always bigger than `b` + var t = a; + a = b; + b = t; + } else if (r === 0 || b.cmpn(1) === 0) { + break; + } + + a.isub(b); + } while (true); + + return b.iushln(shift); + }; + + // Invert number in the field F(num) + BN.prototype.invm = function invm (num) { + return this.egcd(num).a.umod(num); + }; + + BN.prototype.isEven = function isEven () { + return (this.words[0] & 1) === 0; + }; + + BN.prototype.isOdd = function isOdd () { + return (this.words[0] & 1) === 1; + }; + + // And first word and num + BN.prototype.andln = function andln (num) { + return this.words[0] & num; + }; + + // Increment at the bit position in-line + BN.prototype.bincn = function bincn (bit) { + assert(typeof bit === 'number'); + var r = bit % 26; + var s = (bit - r) / 26; + var q = 1 << r; + + // Fast case: bit is much higher than all existing words + if (this.length <= s) { + this._expand(s + 1); + this.words[s] |= q; + return this; + } + + // Add bit and propagate, if needed + var carry = q; + for (var i = s; carry !== 0 && i < this.length; i++) { + var w = this.words[i] | 0; + w += carry; + carry = w >>> 26; + w &= 0x3ffffff; + this.words[i] = w; + } + if (carry !== 0) { + this.words[i] = carry; + this.length++; + } + return this; + }; + + BN.prototype.isZero = function isZero () { + return this.length === 1 && this.words[0] === 0; + }; + + BN.prototype.cmpn = function cmpn (num) { + var negative = num < 0; + + if (this.negative !== 0 && !negative) return -1; + if (this.negative === 0 && negative) return 1; + + this._strip(); + + var res; + if (this.length > 1) { + res = 1; + } else { + if (negative) { + num = -num; + } + + assert(num <= 0x3ffffff, 'Number is too big'); + + var w = this.words[0] | 0; + res = w === num ? 0 : w < num ? -1 : 1; + } + if (this.negative !== 0) return -res | 0; + return res; + }; + + // Compare two numbers and return: + // 1 - if `this` > `num` + // 0 - if `this` == `num` + // -1 - if `this` < `num` + BN.prototype.cmp = function cmp (num) { + if (this.negative !== 0 && num.negative === 0) return -1; + if (this.negative === 0 && num.negative !== 0) return 1; + + var res = this.ucmp(num); + if (this.negative !== 0) return -res | 0; + return res; + }; + + // Unsigned comparison + BN.prototype.ucmp = function ucmp (num) { + // At this point both numbers have the same sign + if (this.length > num.length) return 1; + if (this.length < num.length) return -1; + + var res = 0; + for (var i = this.length - 1; i >= 0; i--) { + var a = this.words[i] | 0; + var b = num.words[i] | 0; + + if (a === b) continue; + if (a < b) { + res = -1; + } else if (a > b) { + res = 1; + } + break; + } + return res; + }; + + BN.prototype.gtn = function gtn (num) { + return this.cmpn(num) === 1; + }; + + BN.prototype.gt = function gt (num) { + return this.cmp(num) === 1; + }; + + BN.prototype.gten = function gten (num) { + return this.cmpn(num) >= 0; + }; + + BN.prototype.gte = function gte (num) { + return this.cmp(num) >= 0; + }; + + BN.prototype.ltn = function ltn (num) { + return this.cmpn(num) === -1; + }; + + BN.prototype.lt = function lt (num) { + return this.cmp(num) === -1; + }; + + BN.prototype.lten = function lten (num) { + return this.cmpn(num) <= 0; + }; + + BN.prototype.lte = function lte (num) { + return this.cmp(num) <= 0; + }; + + BN.prototype.eqn = function eqn (num) { + return this.cmpn(num) === 0; + }; + + BN.prototype.eq = function eq (num) { + return this.cmp(num) === 0; + }; + + // + // A reduce context, could be using montgomery or something better, depending + // on the `m` itself. + // + BN.red = function red (num) { + return new Red(num); + }; + + BN.prototype.toRed = function toRed (ctx) { + assert(!this.red, 'Already a number in reduction context'); + assert(this.negative === 0, 'red works only with positives'); + return ctx.convertTo(this)._forceRed(ctx); + }; + + BN.prototype.fromRed = function fromRed () { + assert(this.red, 'fromRed works only with numbers in reduction context'); + return this.red.convertFrom(this); + }; + + BN.prototype._forceRed = function _forceRed (ctx) { + this.red = ctx; + return this; + }; + + BN.prototype.forceRed = function forceRed (ctx) { + assert(!this.red, 'Already a number in reduction context'); + return this._forceRed(ctx); + }; + + BN.prototype.redAdd = function redAdd (num) { + assert(this.red, 'redAdd works only with red numbers'); + return this.red.add(this, num); + }; + + BN.prototype.redIAdd = function redIAdd (num) { + assert(this.red, 'redIAdd works only with red numbers'); + return this.red.iadd(this, num); + }; + + BN.prototype.redSub = function redSub (num) { + assert(this.red, 'redSub works only with red numbers'); + return this.red.sub(this, num); + }; + + BN.prototype.redISub = function redISub (num) { + assert(this.red, 'redISub works only with red numbers'); + return this.red.isub(this, num); + }; + + BN.prototype.redShl = function redShl (num) { + assert(this.red, 'redShl works only with red numbers'); + return this.red.shl(this, num); + }; + + BN.prototype.redMul = function redMul (num) { + assert(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.mul(this, num); + }; + + BN.prototype.redIMul = function redIMul (num) { + assert(this.red, 'redMul works only with red numbers'); + this.red._verify2(this, num); + return this.red.imul(this, num); + }; + + BN.prototype.redSqr = function redSqr () { + assert(this.red, 'redSqr works only with red numbers'); + this.red._verify1(this); + return this.red.sqr(this); + }; + + BN.prototype.redISqr = function redISqr () { + assert(this.red, 'redISqr works only with red numbers'); + this.red._verify1(this); + return this.red.isqr(this); + }; + + // Square root over p + BN.prototype.redSqrt = function redSqrt () { + assert(this.red, 'redSqrt works only with red numbers'); + this.red._verify1(this); + return this.red.sqrt(this); + }; + + BN.prototype.redInvm = function redInvm () { + assert(this.red, 'redInvm works only with red numbers'); + this.red._verify1(this); + return this.red.invm(this); + }; + + // Return negative clone of `this` % `red modulo` + BN.prototype.redNeg = function redNeg () { + assert(this.red, 'redNeg works only with red numbers'); + this.red._verify1(this); + return this.red.neg(this); + }; + + BN.prototype.redPow = function redPow (num) { + assert(this.red && !num.red, 'redPow(normalNum)'); + this.red._verify1(this); + return this.red.pow(this, num); + }; + + // Prime numbers with efficient reduction + var primes = { + k256: null, + p224: null, + p192: null, + p25519: null + }; + + // Pseudo-Mersenne prime + function MPrime (name, p) { + // P = 2 ^ N - K + this.name = name; + this.p = new BN(p, 16); + this.n = this.p.bitLength(); + this.k = new BN(1).iushln(this.n).isub(this.p); + + this.tmp = this._tmp(); + } + + MPrime.prototype._tmp = function _tmp () { + var tmp = new BN(null); + tmp.words = new Array(Math.ceil(this.n / 13)); + return tmp; + }; + + MPrime.prototype.ireduce = function ireduce (num) { + // Assumes that `num` is less than `P^2` + // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) + var r = num; + var rlen; + + do { + this.split(r, this.tmp); + r = this.imulK(r); + r = r.iadd(this.tmp); + rlen = r.bitLength(); + } while (rlen > this.n); + + var cmp = rlen < this.n ? -1 : r.ucmp(this.p); + if (cmp === 0) { + r.words[0] = 0; + r.length = 1; + } else if (cmp > 0) { + r.isub(this.p); + } else { + if (r.strip !== undefined) { + // r is a BN v4 instance + r.strip(); + } else { + // r is a BN v5 instance + r._strip(); + } + } + + return r; + }; + + MPrime.prototype.split = function split (input, out) { + input.iushrn(this.n, 0, out); + }; + + MPrime.prototype.imulK = function imulK (num) { + return num.imul(this.k); + }; + + function K256 () { + MPrime.call( + this, + 'k256', + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); + } + inherits(K256, MPrime); + + K256.prototype.split = function split (input, output) { + // 256 = 9 * 26 + 22 + var mask = 0x3fffff; + + var outLen = Math.min(input.length, 9); + for (var i = 0; i < outLen; i++) { + output.words[i] = input.words[i]; + } + output.length = outLen; + + if (input.length <= 9) { + input.words[0] = 0; + input.length = 1; + return; + } + + // Shift by 9 limbs + var prev = input.words[9]; + output.words[output.length++] = prev & mask; + + for (i = 10; i < input.length; i++) { + var next = input.words[i] | 0; + input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); + prev = next; + } + prev >>>= 22; + input.words[i - 10] = prev; + if (prev === 0 && input.length > 10) { + input.length -= 10; + } else { + input.length -= 9; + } + }; + + K256.prototype.imulK = function imulK (num) { + // K = 0x1000003d1 = [ 0x40, 0x3d1 ] + num.words[num.length] = 0; + num.words[num.length + 1] = 0; + num.length += 2; + + // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 + var lo = 0; + for (var i = 0; i < num.length; i++) { + var w = num.words[i] | 0; + lo += w * 0x3d1; + num.words[i] = lo & 0x3ffffff; + lo = w * 0x40 + ((lo / 0x4000000) | 0); + } + + // Fast length reduction + if (num.words[num.length - 1] === 0) { + num.length--; + if (num.words[num.length - 1] === 0) { + num.length--; + } + } + return num; + }; + + function P224 () { + MPrime.call( + this, + 'p224', + 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); + } + inherits(P224, MPrime); + + function P192 () { + MPrime.call( + this, + 'p192', + 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); + } + inherits(P192, MPrime); + + function P25519 () { + // 2 ^ 255 - 19 + MPrime.call( + this, + '25519', + '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); + } + inherits(P25519, MPrime); + + P25519.prototype.imulK = function imulK (num) { + // K = 0x13 + var carry = 0; + for (var i = 0; i < num.length; i++) { + var hi = (num.words[i] | 0) * 0x13 + carry; + var lo = hi & 0x3ffffff; + hi >>>= 26; + + num.words[i] = lo; + carry = hi; + } + if (carry !== 0) { + num.words[num.length++] = carry; + } + return num; + }; + + // Exported mostly for testing purposes, use plain name instead + BN._prime = function prime (name) { + // Cached version of prime + if (primes[name]) return primes[name]; + + var prime; + if (name === 'k256') { + prime = new K256(); + } else if (name === 'p224') { + prime = new P224(); + } else if (name === 'p192') { + prime = new P192(); + } else if (name === 'p25519') { + prime = new P25519(); + } else { + throw new Error('Unknown prime ' + name); + } + primes[name] = prime; + + return prime; + }; + + // + // Base reduction engine + // + function Red (m) { + if (typeof m === 'string') { + var prime = BN._prime(m); + this.m = prime.p; + this.prime = prime; + } else { + assert(m.gtn(1), 'modulus must be greater than 1'); + this.m = m; + this.prime = null; + } + } + + Red.prototype._verify1 = function _verify1 (a) { + assert(a.negative === 0, 'red works only with positives'); + assert(a.red, 'red works only with red numbers'); + }; + + Red.prototype._verify2 = function _verify2 (a, b) { + assert((a.negative | b.negative) === 0, 'red works only with positives'); + assert(a.red && a.red === b.red, + 'red works only with red numbers'); + }; + + Red.prototype.imod = function imod (a) { + if (this.prime) return this.prime.ireduce(a)._forceRed(this); + + move(a, a.umod(this.m)._forceRed(this)); + return a; + }; + + Red.prototype.neg = function neg (a) { + if (a.isZero()) { + return a.clone(); + } + + return this.m.sub(a)._forceRed(this); + }; + + Red.prototype.add = function add (a, b) { + this._verify2(a, b); + + var res = a.add(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res._forceRed(this); + }; + + Red.prototype.iadd = function iadd (a, b) { + this._verify2(a, b); + + var res = a.iadd(b); + if (res.cmp(this.m) >= 0) { + res.isub(this.m); + } + return res; + }; + + Red.prototype.sub = function sub (a, b) { + this._verify2(a, b); + + var res = a.sub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res._forceRed(this); + }; + + Red.prototype.isub = function isub (a, b) { + this._verify2(a, b); + + var res = a.isub(b); + if (res.cmpn(0) < 0) { + res.iadd(this.m); + } + return res; + }; + + Red.prototype.shl = function shl (a, num) { + this._verify1(a); + return this.imod(a.ushln(num)); + }; + + Red.prototype.imul = function imul (a, b) { + this._verify2(a, b); + return this.imod(a.imul(b)); + }; + + Red.prototype.mul = function mul (a, b) { + this._verify2(a, b); + return this.imod(a.mul(b)); + }; + + Red.prototype.isqr = function isqr (a) { + return this.imul(a, a.clone()); + }; + + Red.prototype.sqr = function sqr (a) { + return this.mul(a, a); + }; + + Red.prototype.sqrt = function sqrt (a) { + if (a.isZero()) return a.clone(); + + var mod3 = this.m.andln(3); + assert(mod3 % 2 === 1); + + // Fast case + if (mod3 === 3) { + var pow = this.m.add(new BN(1)).iushrn(2); + return this.pow(a, pow); + } + + // Tonelli-Shanks algorithm (Totally unoptimized and slow) + // + // Find Q and S, that Q * 2 ^ S = (P - 1) + var q = this.m.subn(1); + var s = 0; + while (!q.isZero() && q.andln(1) === 0) { + s++; + q.iushrn(1); + } + assert(!q.isZero()); + + var one = new BN(1).toRed(this); + var nOne = one.redNeg(); + + // Find quadratic non-residue + // NOTE: Max is such because of generalized Riemann hypothesis. + var lpow = this.m.subn(1).iushrn(1); + var z = this.m.bitLength(); + z = new BN(2 * z * z).toRed(this); + + while (this.pow(z, lpow).cmp(nOne) !== 0) { + z.redIAdd(nOne); + } + + var c = this.pow(z, q); + var r = this.pow(a, q.addn(1).iushrn(1)); + var t = this.pow(a, q); + var m = s; + while (t.cmp(one) !== 0) { + var tmp = t; + for (var i = 0; tmp.cmp(one) !== 0; i++) { + tmp = tmp.redSqr(); + } + assert(i < m); + var b = this.pow(c, new BN(1).iushln(m - i - 1)); + + r = r.redMul(b); + c = b.redSqr(); + t = t.redMul(c); + m = i; + } + + return r; + }; + + Red.prototype.invm = function invm (a) { + var inv = a._invmp(this.m); + if (inv.negative !== 0) { + inv.negative = 0; + return this.imod(inv).redNeg(); + } else { + return this.imod(inv); + } + }; + + Red.prototype.pow = function pow (a, num) { + if (num.isZero()) return new BN(1).toRed(this); + if (num.cmpn(1) === 0) return a.clone(); + + var windowSize = 4; + var wnd = new Array(1 << windowSize); + wnd[0] = new BN(1).toRed(this); + wnd[1] = a; + for (var i = 2; i < wnd.length; i++) { + wnd[i] = this.mul(wnd[i - 1], a); + } + + var res = wnd[0]; + var current = 0; + var currentLen = 0; + var start = num.bitLength() % 26; + if (start === 0) { + start = 26; + } + + for (i = num.length - 1; i >= 0; i--) { + var word = num.words[i]; + for (var j = start - 1; j >= 0; j--) { + var bit = (word >> j) & 1; + if (res !== wnd[0]) { + res = this.sqr(res); + } + + if (bit === 0 && current === 0) { + currentLen = 0; + continue; + } + + current <<= 1; + current |= bit; + currentLen++; + if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; + + res = this.mul(res, wnd[current]); + currentLen = 0; + current = 0; + } + start = 26; + } + + return res; + }; + + Red.prototype.convertTo = function convertTo (num) { + var r = num.umod(this.m); + + return r === num ? r.clone() : r; + }; + + Red.prototype.convertFrom = function convertFrom (num) { + var res = num.clone(); + res.red = null; + return res; + }; + + // + // Montgomery method engine + // + + BN.mont = function mont (num) { + return new Mont(num); + }; + + function Mont (m) { + Red.call(this, m); + + this.shift = this.m.bitLength(); + if (this.shift % 26 !== 0) { + this.shift += 26 - (this.shift % 26); + } + + this.r = new BN(1).iushln(this.shift); + this.r2 = this.imod(this.r.sqr()); + this.rinv = this.r._invmp(this.m); + + this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); + this.minv = this.minv.umod(this.r); + this.minv = this.r.sub(this.minv); + } + inherits(Mont, Red); + + Mont.prototype.convertTo = function convertTo (num) { + return this.imod(num.ushln(this.shift)); + }; + + Mont.prototype.convertFrom = function convertFrom (num) { + var r = this.imod(num.mul(this.rinv)); + r.red = null; + return r; + }; + + Mont.prototype.imul = function imul (a, b) { + if (a.isZero() || b.isZero()) { + a.words[0] = 0; + a.length = 1; + return a; + } + + var t = a.imul(b); + var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u = t.isub(c).iushrn(this.shift); + var res = u; + + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + + return res._forceRed(this); + }; + + Mont.prototype.mul = function mul (a, b) { + if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); + + var t = a.mul(b); + var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); + var u = t.isub(c).iushrn(this.shift); + var res = u; + if (u.cmp(this.m) >= 0) { + res = u.isub(this.m); + } else if (u.cmpn(0) < 0) { + res = u.iadd(this.m); + } + + return res._forceRed(this); + }; + + Mont.prototype.invm = function invm (a) { + // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R + var res = this.imod(a._invmp(this.m).mul(this.r2)); + return res._forceRed(this); + }; + })(module, bn$1); + } (bn$2)); + return bn$2.exports; + } + + var bnExports = requireBn$1(); + var _BN = /*@__PURE__*/getDefaultExportFromCjs(bnExports); + + let _permanentCensorErrors = false; + let _censorErrors = false; + const LogLevels = { + debug: 1, + default: 2, + info: 2, + warning: 3, + error: 4, + off: 5, + }; + let _logLevel = LogLevels["default"]; + let _globalLogger = null; + function _checkNormalize() { + try { + const missing = []; + // Make sure all forms of normalization are supported + ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { + try { + if ("test".normalize(form) !== "test") { + throw new Error("bad normalize"); + } + } + catch (error) { + missing.push(form); + } + }); + if (missing.length) { + throw new Error("missing " + missing.join(", ")); + } + if (String.fromCharCode(0xe9).normalize("NFD") !== + String.fromCharCode(0x65, 0x0301)) { + throw new Error("broken implementation"); + } + } + catch (error) { + return error.message; + } + return null; + } + const _normalizeError = _checkNormalize(); + var LogLevel; + (function (LogLevel) { + LogLevel["DEBUG"] = "DEBUG"; + LogLevel["INFO"] = "INFO"; + LogLevel["WARNING"] = "WARNING"; + LogLevel["ERROR"] = "ERROR"; + LogLevel["OFF"] = "OFF"; + })(LogLevel || (LogLevel = {})); + var ErrorCode; + (function (ErrorCode) { + /////////////////// + // Generic Errors + // Unknown Error + ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR"; + // Not Implemented + ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED"; + // Unsupported Operation + // - operation + ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION"; + // Network Error (i.e. Core Network, such as an invalid network ID) + // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) + ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR"; + // Some sort of bad response from the server + ErrorCode["SERVER_ERROR"] = "SERVER_ERROR"; + // Timeout + ErrorCode["TIMEOUT"] = "TIMEOUT"; + /////////////////// + // Operational Errors + // Buffer Overrun + ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN"; + // Numeric Fault + // - operation: the operation being executed + // - fault: the reason this faulted + ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT"; + /////////////////// + // Argument Errors + // Missing new operator to an object + // - name: The name of the class + ErrorCode["MISSING_NEW"] = "MISSING_NEW"; + // Invalid argument (e.g. value is incompatible with type) to a function: + // - argument: The argument name that was invalid + // - value: The value of the argument + ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT"; + // Missing argument to a function: + // - count: The number of arguments received + // - expectedCount: The number of arguments expected + ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT"; + // Too many arguments + // - count: The number of arguments received + // - expectedCount: The number of arguments expected + ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT"; + /////////////////// + // Blockchain Errors + // Call exception + // - transaction: the transaction + // - address?: the contract address + // - args?: The arguments passed into the function + // - method?: The Solidity method signature + // - errorSignature?: The EIP848 error signature + // - errorArgs?: The EIP848 error parameters + // - reason: The reason (only for EIP848 "Error(string)") + ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION"; + // Insufficient funds (< value + energyLimit * energyPrice) + // - transaction: the transaction attempted + ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS"; + // Nonce has already been used + // - transaction: the transaction attempted + ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED"; + // The replacement fee for the transaction is too low + // - transaction: the transaction attempted + ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED"; + // The energy limit could not be estimated + // - transaction: the transaction passed to estimateEnergy + ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"] = "UNPREDICTABLE_ENERGY_LIMIT"; + // The transaction was replaced by one with a higher energy price + // - reason: "cancelled", "replaced" or "repriced" + // - cancelled: true if reason == "cancelled" or reason == "replaced") + // - hash: original transaction hash + // - replacement: the full TransactionsResponse for the replacement + // - receipt: the receipt of the replacement + ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; + })(ErrorCode || (ErrorCode = {})); + const HEX = "0123456789abcdef"; + class Logger { + version = "0.0.1"; + static errors = ErrorCode; + static levels = LogLevel; + constructor(version) { + Object.defineProperty(this, "version", { + enumerable: true, + value: version, + writable: false, + }); + } + _log(logLevel, args) { + const level = logLevel.toLowerCase(); + if (LogLevels[level] == null) { + this.throwArgumentError("invalid log level name", "logLevel", logLevel); + } + if (_logLevel > LogLevels[level]) { + return; + } + console.log.apply(console, args); + } + debug(...args) { + this._log(Logger.levels.DEBUG, args); + } + info(...args) { + this._log(Logger.levels.INFO, args); + } + warn(...args) { + this._log(Logger.levels.WARNING, args); + } + makeError(message, code, params) { + // Errors are being censored + if (_censorErrors) { + return this.makeError("censored error", code, {}); + } + if (!code) { + code = Logger.errors.UNKNOWN_ERROR; + } + if (!params) { + params = {}; + } + const messageDetails = []; + Object.keys(params).forEach((key) => { + const value = params[key]; + try { + if (value instanceof Uint8Array) { + let hex = ""; + for (let i = 0; i < value.length; i++) { + hex += HEX[value[i] >> 4]; + hex += HEX[value[i] & 0x0f]; + } + messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); + } + else { + messageDetails.push(key + "=" + JSON.stringify(value)); + } + } + catch (error) { + messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); + } + }); + messageDetails.push(`code=${code}`); + messageDetails.push(`version=${this.version}`); + const reason = message; + if (messageDetails.length) { + message += " (" + messageDetails.join(", ") + ")"; + } + // @TODO: Any?? + const error = new Error(message); + error.reason = reason; + error.code = code; + Object.keys(params).forEach(function (key) { + error[key] = params[key]; + }); + return error; + } + throwError(message, code, params) { + throw this.makeError(message, code, params); + } + throwArgumentError(message, name, value) { + return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { + argument: name, + value: value, + }); + } + assert(condition, message, code, params) { + if (!!condition) { + return; + } + this.throwError(message, code, params); + } + assertArgument(condition, message, name, value) { + if (!!condition) { + return; + } + this.throwArgumentError(message, name, value); + } + checkNormalize(message) { + if (_normalizeError) { + this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { + operation: "String.prototype.normalize", + form: _normalizeError, + }); + } + } + checkSafeUint53(value, message) { + if (typeof value !== "number") { + return; + } + if (message == null) { + message = "value not safe"; + } + if (value < 0 || value >= 0x1fffffffffffff) { + this.throwError(message, Logger.errors.NUMERIC_FAULT, { + operation: "checkSafeInteger", + fault: "out-of-safe-range", + value: value, + }); + } + if (value % 1) { + this.throwError(message, Logger.errors.NUMERIC_FAULT, { + operation: "checkSafeInteger", + fault: "non-integer", + value: value, + }); + } + } + checkArgumentCount(count, expectedCount, message) { + if (message) { + message = ": " + message; + } + else { + message = ""; + } + if (count < expectedCount) { + this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, { + count: count, + expectedCount: expectedCount, + }); + } + if (count > expectedCount) { + this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, { + count: count, + expectedCount: expectedCount, + }); + } + } + checkNew(target, kind) { + if (target === Object || target == null) { + this.throwError("missing new", Logger.errors.MISSING_NEW, { + name: kind.name, + }); + } + } + checkAbstract(target, kind) { + if (target === kind) { + this.throwError("cannot instantiate abstract class " + + JSON.stringify(kind.name) + + " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }); + } + else if (target === Object || target == null) { + this.throwError("missing new", Logger.errors.MISSING_NEW, { + name: kind.name, + }); + } + } + static globalLogger() { + if (!_globalLogger) { + _globalLogger = new Logger("logger/0.0.1"); + } + return _globalLogger; + } + static setCensorship(censorship, permanent) { + if (!censorship && permanent) { + this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, { + operation: "setCensorship", + }); + } + if (_permanentCensorErrors) { + if (!censorship) { + return; + } + this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, { + operation: "setCensorship", + }); + } + _censorErrors = !!censorship; + _permanentCensorErrors = !!permanent; + } + static setLogLevel(logLevel) { + const level = LogLevels[logLevel.toLowerCase()]; + if (level == null) { + Logger.globalLogger().warn("invalid log level - " + logLevel); + return; + } + _logLevel = level; + } + static from(version) { + return new Logger(version); + } + } + + /** + * Property helper functions. + * + * @_subsection api/utils:Properties [about-properties] + */ + const logger$7 = new Logger("utils/properties/0.0.1"); + function checkType(value, type, name) { + const types = type.split("|").map((t) => t.trim()); + for (let i = 0; i < types.length; i++) { + switch (type) { + case "any": + return; + case "bigint": + case "boolean": + case "number": + case "string": + if (typeof value === type) { + return; + } + } + } + const error = new Error(`invalid value for type ${type}`); + error.code = "INVALID_ARGUMENT"; + error.argument = `value.${name}`; + error.value = value; + throw error; + } + /** + * Resolves to a new object that is a copy of %%value%%, but with all + * values resolved. + */ + async function resolveProperties(value) { + const keys = Object.keys(value); + const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); + return results.reduce((accum, v, index) => { + accum[keys[index]] = v; + return accum; + }, {}); + } + /** + * Assigns the %%values%% to %%target%% as read-only values. + * + * It %%types%% is specified, the values are checked. + */ + function defineProperties(target, values, types) { + for (let key in values) { + let value = values[key]; + const type = types ? types[key] : null; + if (type) { + checkType(value, type, key); + } + Object.defineProperty(target, key, { + enumerable: true, + value, + writable: false, + }); + } + } + function checkProperties(object, properties) { + if (!object || typeof object !== "object") { + logger$7.throwArgumentError("invalid object", "object", object); + } + Object.keys(object).forEach((key) => { + if (!properties[key]) { + logger$7.throwArgumentError("invalid object key - " + key, "transaction:" + key, object); + } + }); + } + + /** + * About Errors. + * + * @_section: api/utils/errors:Errors [about-errors] + */ + function stringify$1(value) { + if (value == null) { + return "null"; + } + if (Array.isArray(value)) { + return "[ " + value.map(stringify$1).join(", ") + " ]"; + } + if (value instanceof Uint8Array) { + const HEX = "0123456789abcdef"; + let result = "0x"; + for (let i = 0; i < value.length; i++) { + result += HEX[value[i] >> 4]; + result += HEX[value[i] & 0xf]; + } + return result; + } + if (typeof value === "object" && typeof value.toJSON === "function") { + return stringify$1(value.toJSON()); + } + switch (typeof value) { + case "boolean": + case "symbol": + return value.toString(); + case "bigint": + return BigInt(value).toString(); + case "number": + return value.toString(); + case "string": + return JSON.stringify(value); + case "object": { + const keys = Object.keys(value); + keys.sort(); + return ("{ " + + keys.map((k) => `${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ") + + " }"); + } + } + return `[ COULD NOT SERIALIZE ]`; + } + /** + * Returns true if the %%error%% matches an error thrown by corebc + * that matches the error %%code%%. + * + * In TypeScript envornoments, this can be used to check that %%error%% + * matches an corebcError type, which means the expected properties will + * be set. + * + * @See [ErrorCodes](api:ErrorCode) + * @example + * try { + * // code.... + * } catch (e) { + * if (isError(e, "CALL_EXCEPTION")) { + * // The Type Guard has validated this object + * console.log(e.data); + * } + * } + */ + function isError(error, code) { + return error && error.code === code; + } + /** + * Returns true if %%error%% is a [[CallExceptionError]. + */ + function isCallException(error) { + return isError(error, "CALL_EXCEPTION"); + } + /** + * Returns a new Error configured to the format corebc emits errors, with + * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties + * for the corresponding corebcError. + * + * Each error in corebc includes the version of corebc, a + * machine-readable [[ErrorCode]], and depneding on %%code%%, additional + * required properties. The error message will also include the %%meeage%%, + * corebc version, %%code%% and all aditional properties, serialized. + */ + function makeError(message, code, info) { + { + const details = []; + if (info) { + if ("message" in info || "code" in info || "name" in info) { + throw new Error(`value will overwrite populated values: ${stringify$1(info)}`); + } + for (const key in info) { + const value = info[key]; + // try { + details.push(key + "=" + stringify$1(value)); + // } catch (error: any) { + // console.log("MMM", error.message); + // details.push(key + "=[could not serialize object]"); + // } + } + } + details.push(`code=${code}`); + details.push(`version=${version}`); + if (details.length) { + message += " (" + details.join(", ") + ")"; + } + } + let error; + switch (code) { + case "INVALID_ARGUMENT": + error = new TypeError(message); + break; + case "NUMERIC_FAULT": + case "BUFFER_OVERRUN": + error = new RangeError(message); + break; + default: + error = new Error(message); + } + defineProperties(error, { code }); + if (info) { + Object.assign(error, info); + } + return error; + } + /** + * Throws an corebcError with %%message%%, %%code%% and additional error + * %%info%% when %%check%% is falsish.. + * + * @see [[api:makeError]] + */ + function assert(check, message, code, info) { + if (!check) { + throw makeError(message, code, info); + } + } + /** + * A simple helper to simply ensuring provided arguments match expected + * constraints, throwing if not. + * + * In TypeScript environments, the %%check%% has been asserted true, so + * any further code does not need additional compile-time checks. + */ + function assertArgument(check, message, name, value) { + assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); + } + function assertArgumentCount(count, expectedCount, message) { + if (message == null) { + message = ""; + } + if (message) { + message = ": " + message; + } + assert(count >= expectedCount, "missing arguemnt" + message, "MISSING_ARGUMENT", { + count: count, + expectedCount: expectedCount, + }); + assert(count <= expectedCount, "too many arguemnts" + message, "UNEXPECTED_ARGUMENT", { + count: count, + expectedCount: expectedCount, + }); + } + const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { + try { + // General test for normalize + /* c8 ignore start */ + if ("test".normalize(form) !== "test") { + throw new Error("bad"); + } + /* c8 ignore stop */ + if (form === "NFD") { + const check = String.fromCharCode(0xe9).normalize("NFD"); + const expected = String.fromCharCode(0x65, 0x0301); + /* c8 ignore start */ + if (check !== expected) { + throw new Error("broken"); + } + /* c8 ignore stop */ + } + accum.push(form); + } + catch (error) { } + return accum; + }, []); + /** + * Throws if the normalization %%form%% is not supported. + */ + function assertNormalize(form) { + assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { + operation: "String.prototype.normalize", + info: { form }, + }); + } + /** + * Many classes use file-scoped values to guard the constructor, + * making it effectively private. This facilitates that pattern + * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, + * throwing if not, indicating the %%className%% if provided. + */ + function assertPrivate(givenGuard, guard, className) { + if (className == null) { + className = ""; + } + if (givenGuard !== guard) { + let method = className, operation = "new"; + if (className) { + method += "."; + operation += " " + className; + } + assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { + operation, + }); + } + } + + /** + * Some data helpers. + * + * + * @_subsection api/utils:Data Helpers [about-data] + */ + const logger$6 = new Logger("utils/data/0.0.1"); + function isHexable(value) { + return !!value.toHexString; + } + function isInteger(value) { + return typeof value === "number" && value == value && value % 1 === 0; + } + function isBytes$1(value) { + if (value == null) { + return false; + } + if (value.constructor === Uint8Array) { + return true; + } + if (typeof value === "string") { + return false; + } + if (!isInteger(value.length) || value.length < 0) { + return false; + } + for (let i = 0; i < value.length; i++) { + const v = value[i]; + if (!isInteger(v) || v < 0 || v >= 256) { + return false; + } + } + return true; + } + function _getBytes(value, name, copy) { + if (value instanceof Uint8Array) { + if (copy) { + return new Uint8Array(value); + } + return value; + } + if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { + const result = new Uint8Array((value.length - 2) / 2); + let offset = 2; + for (let i = 0; i < result.length; i++) { + result[i] = parseInt(value.substring(offset, offset + 2), 16); + offset += 2; + } + return result; + } + assertArgument(false, "invalid BytesLike value", name || "value", value); + } + /** + * Get a typed Uint8Array for %%value%%. If already a Uint8Array + * the original %%value%% is returned; if a copy is required use + * [[getBytesCopy]]. + * + * @see: getBytesCopy + */ + function getBytes(value, name) { + return _getBytes(value, name, false); + } + /** + * Get a typed Uint8Array for %%value%%, creating a copy if necessary + * to prevent any modifications of the returned value from being + * reflected elsewhere. + * + * @see: getBytes + */ + function getBytesCopy(value, name) { + return _getBytes(value, name, true); + } + /** + * Returns true if %%value%% is a valid [[HexString]]. + * + * If %%length%% is ``true`` or a //number//, it also checks that + * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) + * bytes of data (e.g. ``0x1234`` is 2 bytes). + */ + function isHexString(value, length) { + if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { + return false; + } + if (typeof length === "number" && value.length !== 2 + 2 * length) { + return false; + } + if (length === true && value.length % 2 !== 0) { + return false; + } + return true; + } + /** + * Returns true if %%value%% is a valid representation of arbitrary + * data (i.e. a valid [[DataHexString]] or a Uint8Array). + */ + function isBytesLike(value) { + return isHexString(value, true) || value instanceof Uint8Array; + } + const HexCharacters = "0123456789abcdef"; + /** + * Returns a [[DataHexString]] representation of %%data%%. + */ + function hexlify(value, options) { + if (!options) { + options = {}; + } + if (typeof value === "string") { + if (value.includes(",") && value.startsWith("0x")) { + const v = value + .replace("0x", "") + .split(",") + .map((item) => Number(item)); + // @ts-ignore + value = new Uint8Array(v); + } + } + if (typeof value === "number") { + logger$6.checkSafeUint53(value, "invalid hexlify value"); + let hex = ""; + while (value) { + hex = HexCharacters[value & 0xf] + hex; + value = Math.floor(value / 16); + } + if (hex.length) { + if (hex.length % 2) { + hex = "0" + hex; + } + return "0x" + hex; + } + return "0x00"; + } + if (typeof value === "bigint") { + value = value.toString(16); + if (value.length % 2) { + return "0x0" + value; + } + return "0x" + value; + } + if (options.allowMissingPrefix && + typeof value === "string" && + value.substring(0, 2) !== "0x") { + value = "0x" + value; + } + if (isHexable(value)) { + return value.toHexString(); + } + if (isHexString(value)) { + if (value.length % 2) { + if (options.hexPad === "left") { + value = "0x0" + value.substring(2); + } + else if (options.hexPad === "right") { + value += "0"; + } + else { + logger$6.throwArgumentError("hex data is odd-length", "value", value); + } + } + return value.toLowerCase(); + } + if (isBytes$1(value)) { + let result = "0x"; + for (let i = 0; i < value.length; i++) { + let v = value[i]; + result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; + } + return result; + } + return logger$6.throwArgumentError("invalid hexlify value", "value", value); + } + /** + * Returns a [[DataHexString]] by concatenating all values + * within %%data%%. + */ + function concat(items) { + return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); + } + function hexDataSlice(data, offset, endOffset) { + if (typeof data !== "string") { + data = hexlify(data); + } + else if (!isHexString(data) || data.length % 2) { + logger$6.throwArgumentError("invalid hexData", "value", data); + } + offset = 2 + 2 * offset; + return "0x" + data.substring(offset); + } + function hexDataLength(data) { + if (typeof data !== "string") { + data = hexlify(data); + } + else if (!isHexString(data) || data.length % 2) { + return null; + } + return (data.length - 2) / 2; + } + /** + * Returns the length of %%data%%, in bytes. + */ + function dataLength(data) { + if (isHexString(data, true)) { + return (data.length - 2) / 2; + } + return getBytes(data).length; + } + /** + * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% + * offset to the %%end%% offset. + * + * By default %%start%% is 0 and %%end%% is the length of %%data%%. + */ + function dataSlice(data, start, end) { + const bytes = getBytes(data); + if (end != null && end > bytes.length) { + assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { + buffer: bytes, + length: bytes.length, + offset: end, + }); + } + return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); + } + /** + * Return the [[DataHexString]] result by stripping all **leading** + ** zero bytes from %%data%%. + */ + function stripZerosLeft(data) { + let bytes = hexlify(data).substring(2); + while (bytes.startsWith("00")) { + bytes = bytes.substring(2); + } + return "0x" + bytes; + } + function zeroPad(data, length, left) { + const bytes = getBytes(data); + assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { + buffer: new Uint8Array(bytes), + length: length, + offset: length + 1, + }); + const result = new Uint8Array(length); + result.fill(0); + if (left) { + result.set(bytes, length - bytes.length); + } + else { + result.set(bytes, 0); + } + return hexlify(result); + } + /** + * Return the [[DataHexString]] of %%data%% padded on the **left** + * to %%length%% bytes. + * + * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is + * thrown. + * + * This pads data the same as **values** are in Solidity + * (e.g. ``uint128``). + */ + function zeroPadValue(data, length) { + return zeroPad(data, length, true); + } + /** + * Return the [[DataHexString]] of %%data%% padded on the **right** + * to %%length%% bytes. + * + * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is + * thrown. + * + * This pads data the same as **bytes** are in Solidity + * (e.g. ``bytes16``). + */ + function zeroPadBytes(data, length) { + return zeroPad(data, length, false); + } + function stripZeros(value) { + let result = arrayify(value); + if (result.length === 0) { + return result; + } + // Find the first non-zero entry + let start = 0; + while (start < result.length && result[start] === 0) { + start++; + } + // If we started with zeros, strip them + if (start) { + result = result.slice(start); + } + return result; + } + function arrayify(value, options) { + if (!options) { + options = {}; + } + if (typeof value === "number") { + logger$6.checkSafeUint53(value, "invalid arrayify value"); + const result = []; + while (value) { + // @ts-ignore + result.unshift(value & 0xff); + value = parseInt(String(value / 256)); + } + if (result.length === 0) { + result.push(0); + } + return new Uint8Array(result); + } + if (options.allowMissingPrefix && + typeof value === "string" && + value.substring(0, 2) !== "0x") { + value = "0x" + value; + } + if (isHexable(value)) { + value = value.toHexString(); + } + if (isHexString(value)) { + let hex = value.substring(2); + if (hex.length % 2) { + if (options.hexPad === "left") { + hex = "0x0" + hex.substring(2); + } + else if (options.hexPad === "right") { + hex += "0"; + } + else { + logger$6.throwArgumentError("hex data is odd-length", "value", value); + } + } + const result = []; + for (let i = 0; i < hex.length; i += 2) { + // @ts-ignore + result.push(parseInt(hex.substring(i, i + 2), 16)); + } + return new Uint8Array(result); + } + if (isBytes$1(value)) { + return new Uint8Array(value); + } + return logger$6.throwArgumentError("invalid arrayify value", "value", value); + } + function hexConcat(items) { + let result = "0x"; + items.forEach((item) => { + result += hexlify(item).substring(2); + }); + return result; + } + + var BN = _BN.BN; + const logger$5 = new Logger("bigNumber/0.0.1"); + const _constructorGuard = {}; + const MAX_SAFE = 0x1fffffffffffff; + // Only warn about passing 10 into radix once + let _warnedToStringRadix = false; + class BigNumber { + _hex; + _isBigNumber; + constructor(constructorGuard, hex) { + logger$5.checkNew(new.target, BigNumber); + if (constructorGuard !== _constructorGuard) { + logger$5.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, { + operation: "new (BigNumber)", + }); + } + this._hex = hex; + this._isBigNumber = true; + Object.freeze(this); + } + fromTwos(value) { + return toBigNumber(toBN(this).fromTwos(value)); + } + toTwos(value) { + return toBigNumber(toBN(this).toTwos(value)); + } + abs() { + if (this._hex[0] === "-") { + return BigNumber.from(this._hex.substring(1)); + } + return this; + } + add(other) { + return toBigNumber(toBN(this).add(toBN(other))); + } + sub(other) { + return toBigNumber(toBN(this).sub(toBN(other))); + } + div(other) { + const o = BigNumber.from(other); + if (o.isZero()) { + throwFault("division by zero", "div"); + } + return toBigNumber(toBN(this).div(toBN(other))); + } + mul(other) { + return toBigNumber(toBN(this).mul(toBN(other))); + } + mod(other) { + const value = toBN(other); + if (value.isNeg()) { + throwFault("cannot modulo negative values", "mod"); + } + return toBigNumber(toBN(this).umod(value)); + } + pow(other) { + const value = toBN(other); + if (value.isNeg()) { + throwFault("cannot raise to negative values", "pow"); + } + return toBigNumber(toBN(this).pow(value)); + } + and(other) { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault("cannot 'and' negative values", "and"); + } + return toBigNumber(toBN(this).and(value)); + } + or(other) { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault("cannot 'or' negative values", "or"); + } + return toBigNumber(toBN(this).or(value)); + } + xor(other) { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault("cannot 'xor' negative values", "xor"); + } + return toBigNumber(toBN(this).xor(value)); + } + mask(value) { + if (this.isNegative() || value < 0) { + throwFault("cannot mask negative values", "mask"); + } + return toBigNumber(toBN(this).maskn(value)); + } + shl(value) { + if (this.isNegative() || value < 0) { + throwFault("cannot shift negative values", "shl"); + } + return toBigNumber(toBN(this).shln(value)); + } + shr(value) { + if (this.isNegative() || value < 0) { + throwFault("cannot shift negative values", "shr"); + } + return toBigNumber(toBN(this).shrn(value)); + } + eq(other) { + return toBN(this).eq(toBN(other)); + } + lt(other) { + return toBN(this).lt(toBN(other)); + } + lte(other) { + return toBN(this).lte(toBN(other)); + } + gt(other) { + return toBN(this).gt(toBN(other)); + } + gte(other) { + return toBN(this).gte(toBN(other)); + } + isNegative() { + return this._hex[0] === "-"; + } + isZero() { + return toBN(this).isZero(); + } + toNumber() { + try { + return toBN(this).toNumber(); + } + catch (error) { + throwFault("overflow", "toNumber", this.toString()); + } + // @ts-ignore + return null; + } + toBigInt() { + try { + return BigInt(this.toString()); + } + catch (e) { } + return logger$5.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, { + value: this.toString(), + }); + } + toString() { + // Lots of people expect this, which we do not support, so check (See: #889) + if (arguments.length > 0) { + if (arguments[0] === 10) { + if (!_warnedToStringRadix) { + _warnedToStringRadix = true; + logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed"); + } + } + else if (arguments[0] === 16) { + logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {}); + } + else { + logger$5.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {}); + } + } + return toBN(this).toString(10); + } + toHexString() { + return this._hex; + } + toJSON(key) { + return { type: "BigNumber", hex: this.toHexString() }; + } + static from(value) { + if (value instanceof BigNumber) { + return value; + } + if (typeof value === "string") { + if (value.match(/^-?0x[0-9a-f]+$/i)) { + return new BigNumber(_constructorGuard, toHex(value)); + } + if (value.match(/^-?[0-9]+$/)) { + return new BigNumber(_constructorGuard, toHex(new BN(value))); + } + return logger$5.throwArgumentError("invalid BigNumber string", "value", value); + } + if (typeof value === "number") { + if (value % 1) { + throwFault("underflow", "BigNumber.from", value); + } + if (value >= MAX_SAFE || value <= -MAX_SAFE) { + throwFault("overflow", "BigNumber.from", value); + } + return BigNumber.from(String(value)); + } + const anyValue = value; + if (typeof anyValue === "bigint") { + return BigNumber.from(anyValue.toString()); + } + if (isBytes$1(anyValue)) { + return BigNumber.from(hexlify(anyValue)); + } + if (anyValue) { + // Hexable interface (takes priority) + if (anyValue.toHexString) { + const hex = anyValue.toHexString(); + if (typeof hex === "string") { + return BigNumber.from(hex); + } + } + else { + // For now, handle legacy JSON-ified values (goes away in v6) + let hex = anyValue._hex; + // New-form JSON + if (hex == null && anyValue.type === "BigNumber") { + hex = anyValue.hex; + } + if (typeof hex === "string") { + if (isHexString(hex) || + (hex[0] === "-" && isHexString(hex.substring(1)))) { + return BigNumber.from(hex); + } + } + } + } + return logger$5.throwArgumentError("invalid BigNumber value", "value", value); + } + static isBigNumber(value) { + return !!(value && value._isBigNumber); + } + } + // Normalize the hex string + // @ts-ignore + function toHex(value) { + // For BN, call on the hex string + if (typeof value !== "string") { + return toHex(value.toString(16)); + } + // If negative, prepend the negative sign to the normalized positive value + if (value[0] === "-") { + // Strip off the negative sign + value = value.substring(1); + // Cannot have multiple negative signs (e.g. "--0x04") + if (value[0] === "-") { + logger$5.throwArgumentError("invalid hex", "value", value); + } + // Call toHex on the positive component + value = toHex(value); + // Do not allow "-0x00" + if (value === "0x00") { + return value; + } + // Negate the value + return "-" + value; + } + // Add a "0x" prefix if missing + if (value.substring(0, 2) !== "0x") { + value = "0x" + value; + } + // Normalize zero + if (value === "0x") { + return "0x00"; + } + // Make the string even length + if (value.length % 2) { + value = "0x0" + value.substring(2); + } + // Trim to smallest even-length string + while (value.length > 4 && value.substring(0, 4) === "0x00") { + value = "0x" + value.substring(4); + } + return value; + } + // @ts-ignore + function toBigNumber(value) { + return BigNumber.from(toHex(value)); + } + // @ts-ignore + function toBN(value) { + const hex = BigNumber.from(value).toHexString(); + if (hex[0] === "-") { + return new BN("-" + hex.substring(3), 16); + } + return new BN(hex.substring(2), 16); + } + function throwFault(fault, operation, value) { + const params = { fault: fault, operation: operation }; + if (value != null) { + params.value = value; + } + return logger$5.throwError(fault, Logger.errors.NUMERIC_FAULT, params); + } + + const logger$4 = new Logger("rlp/0.0.1"); + function arrayifyInteger$1(value) { + const result = []; + while (value) { + // @ts-ignore + result.unshift(value & 0xff); + value >>= 8; + } + return result; + } + function unarrayifyInteger$1(data, offset, length) { + let result = 0; + for (let i = 0; i < length; i++) { + result = result * 256 + data[offset + i]; + } + return result; + } + function _encode$1(object) { + if (Array.isArray(object)) { + let payload = []; + object.forEach(function (child) { + payload = payload.concat(_encode$1(child)); + }); + if (payload.length <= 55) { + payload.unshift(0xc0 + payload.length); + return payload; + } + const length = arrayifyInteger$1(payload.length); + length.unshift(0xf7 + length.length); + return length.concat(payload); + } + if (!isBytesLike(object)) { + logger$4.throwArgumentError("RLP object must be BytesLike", "object", object); + } + const data = Array.prototype.slice.call(arrayify(object)); + if (data.length === 1 && data[0] <= 0x7f) { + return data; + } + else if (data.length <= 55) { + data.unshift(0x80 + data.length); + return data; + } + const length = arrayifyInteger$1(data.length); + length.unshift(0xb7 + length.length); + return length.concat(data); + } + function encode(object) { + return hexlify(_encode$1(object)); + } + function _decodeChildren$1(data, offset, childOffset, length) { + const result = []; + while (childOffset < offset + 1 + length) { + const decoded = _decode$1(data, childOffset); + result.push(decoded.result); + childOffset += decoded.consumed; + if (childOffset > offset + 1 + length) { + logger$4.throwError("child data too short", Logger.errors.BUFFER_OVERRUN, {}); + } + } + return { consumed: 1 + length, result: result }; + } + // returns { consumed: number, result: Object } + function _decode$1(data, offset) { + if (data.length === 0) { + logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); + } + // Array with extra length prefix + if (data[offset] >= 0xf8) { + const lengthLength = data[offset] - 0xf7; + if (offset + 1 + lengthLength > data.length) { + logger$4.throwError("data short segment too short", Logger.errors.BUFFER_OVERRUN, {}); + } + const length = unarrayifyInteger$1(data, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data.length) { + logger$4.throwError("data long segment too short", Logger.errors.BUFFER_OVERRUN, {}); + } + return _decodeChildren$1(data, offset, offset + 1 + lengthLength, lengthLength + length); + } + else if (data[offset] >= 0xc0) { + const length = data[offset] - 0xc0; + if (offset + 1 + length > data.length) { + logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); + } + return _decodeChildren$1(data, offset, offset + 1, length); + } + else if (data[offset] >= 0xb8) { + const lengthLength = data[offset] - 0xb7; + if (offset + 1 + lengthLength > data.length) { + logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); + } + const length = unarrayifyInteger$1(data, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data.length) { + logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); + } + const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); + return { consumed: 1 + lengthLength + length, result: result }; + } + else if (data[offset] >= 0x80) { + const length = data[offset] - 0x80; + if (offset + 1 + length > data.length) { + logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); + } + const result = hexlify(data.slice(offset + 1, offset + 1 + length)); + return { consumed: 1 + length, result: result }; + } + return { consumed: 1, result: hexlify(data[offset]) }; + } + function decode$1(data) { + const bytes = arrayify(data); + const decoded = _decode$1(bytes, 0); + if (decoded.consumed !== bytes.length) { + logger$4.throwArgumentError("invalid rlp data", "data", data); + } + return decoded.result; + } + + const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))(); + const _32n = /* @__PURE__ */ BigInt(32); + // Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high + // }` to match little-endian word order rather than the property names. + function fromBig(n, le = false) { + if (le) + return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; + return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; + } + // Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array + // holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`. + function split(lst, le = false) { + const len = lst.length; + let Ah = new Uint32Array(len); + let Al = new Uint32Array(len); + for (let i = 0; i < len; i++) { + const { h, l } = fromBig(lst[i], le); + [Ah[i], Al[i]] = [h, l]; + } + return [Ah, Al]; + } + // Split a JS number into u32 halves without a BigInt allocation. Exact only for integers + // `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below + // that (an ArrayBuffer cannot exceed 2**53 - 1 bytes). + const fromNumH = (n) => (n / 2 ** 32) | 0; + const fromNumL = (n) => n >>> 0; + // Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call + // BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`. + function setU64FromNum(view, byteOffset, n, isLE) { + const h = fromNumH(n); + const l = fromNumL(n); + view.setUint32(byteOffset, isLE ? l : h, isLE); + view.setUint32(byteOffset + 4, isLE ? h : l, isLE); + } + // High 32-bit half of a 64-bit logical right shift for `s` in `0..31`. + const shrSH = (h, _l, s) => h >>> s; + // Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`. + const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); + // High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. + const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); + // Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. + const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); + // High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. + const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); + // Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. + const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); + // 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps + // local copies so V8 inlines them into keccakP. + // Add two split 64-bit words and return the split `{ h, l }` sum. + // JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out + // of the low sum and instead use division. + function add(Ah, Al, Bh, Bl) { + const l = (Al >>> 0) + (Bl >>> 0); + return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; + } + // Addition with more than 2 elements + // Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`. + const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); + // High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`. + const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; + // Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`. + const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); + // High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`. + const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; + // Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`. + const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); + // High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`. + const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; + + /** + * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. + * @param a - value to test + * @returns `true` when the value is a Uint8Array-compatible view. + * @example + * Check whether a value is a Uint8Array-compatible view. + * ```ts + * isBytes(new Uint8Array([1, 2, 3])); + * ``` + */ + function isBytes(a) { + // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases. + // The fallback still requires a real ArrayBuffer view, so plain + // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and + // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views. + return (a instanceof Uint8Array || + (ArrayBuffer.isView(a) && + a.constructor.name === 'Uint8Array' && + 'BYTES_PER_ELEMENT' in a && + a.BYTES_PER_ELEMENT === 1)); + } + // Shared error-message prefix builder. Only called on throw paths, so assert + // success paths never pay for the string concatenation. + const atitle = (title) => (title ? `"${title}" ` : ''); + /** + * Asserts something is a non-negative integer. + * @param n - number to validate + * @param title - label included in thrown errors + * @returns The validated number. + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Validate a non-negative integer option. + * ```ts + * anumber(32, 'length'); + * ``` + */ + function anumber(n, title = '') { + if (typeof n !== 'number') + throw new TypeError(atitle(title) + 'expected number, got ' + typeof n); + if (!Number.isSafeInteger(n) || n < 0) + throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n); + return n; + } + /** + * Asserts something is a boolean. + * @param value - value to validate + * @param title - label included in thrown errors + * @returns The validated boolean. + * @throws On wrong argument types. {@link TypeError} + * @example + * Validate a boolean option. + * ```ts + * abool(true, 'enableXOF'); + * ``` + */ + function abool(value, title = '') { + if (typeof value !== 'boolean') + throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value); + return value; + } + /** + * Asserts something is Uint8Array. + * @param value - value to validate + * @param length - optional exact length constraint + * @param title - label included in thrown errors + * @returns The validated byte array. + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Validate that a value is a byte array. + * ```ts + * abytes(new Uint8Array([1, 2, 3])); + * ``` + */ + function abytes(value, length, title = '') { + // Success path first: this runs at the start of every update() / digestInto(), and the + // common `abytes(data)` form must not pay for length handling it does not use. + if (isBytes(value) && (length === undefined)) + return value; + const bytes = isBytes(value); + const ofLen = ''; + const got = bytes ? `length=${value.length}` : `type=${typeof value}`; + const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got; + if (!bytes) + throw new TypeError(message); + throw new RangeError(message); + } + /** + * Asserts something is a wrapped hash constructor. + * @param h - hash constructor to validate + * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError} + * @throws On invalid hash metadata ranges or values. {@link RangeError} + * @throws If the hash metadata allows empty outputs or block sizes. {@link Error} + * @example + * Validate a callable hash wrapper. + * ```ts + * import { ahash } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * ahash(sha256); + * ``` + */ + function ahash(h) { + if (typeof h !== 'function' || typeof h.create !== 'function') + throw new TypeError('expected hash wrapped by utils.createHasher'); + anumber(h.outputLen); + anumber(h.blockLen); + // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass + // validation and can produce empty outputs instead of failing fast. + if (h.outputLen < 1 || h.blockLen < 1) + throw new Error('hash blockLen / outputLen must be >= 1'); + } + const aobject = (value, label) => { + if (value === null || typeof value !== 'object' || Array.isArray(value)) + throw new TypeError((label === 'object' ? '' : `"${label}" `) + 'expected object, got type=' + typeof value); + }; + const aopts = (value, label) => { + aobject(value, label); + const proto = Object.getPrototypeOf(value); + if (proto !== Object.prototype && proto !== null) + throw new TypeError(`"${label}" expected plain object`); + // Object.assign() treats an own "__proto__" source key as a write to the target's legacy + // prototype setter. Reject it before merging so inherited option values cannot be injected. + if (Object.hasOwn(value, '__proto__')) + throw new TypeError(`"${label}.__proto__" is not allowed`); + }; + /** + * Asserts a hash instance has not been destroyed or finished. + * @param instance - hash instance to validate + * @param checkFinished - whether to reject finalized instances + * @throws If the hash instance has already been destroyed or finalized. {@link Error} + * @example + * Validate that a hash instance is still usable. + * ```ts + * import { aexists } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const hash = sha256.create(); + * aexists(hash); + * ``` + */ + function aexists(instance, checkFinished = true) { + // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their + // truthiness is checked - re-validating their type per call was pure hot-path overhead. + if (instance.destroyed) + throw new Error('hash was destroyed'); + if (checkFinished && instance.finished) + throw new Error('digest() was already called'); + } + /** + * Asserts output is a sufficiently-sized byte array. + * @param out - destination buffer + * @param instance - hash instance providing output length + * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes. + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Validate a caller-provided digest buffer. + * ```ts + * import { aoutput } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const hash = sha256.create(); + * aoutput(new Uint8Array(hash.outputLen), hash); + * ``` + */ + function aoutput(out, instance) { + abytes(out, undefined, 'output'); + // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast + // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call. + const min = instance.outputLen; + if (!(out.length >= min)) { + throw new RangeError('"output" expected length >= ' + min); + } + } + /** + * Casts a typed array view to Uint32Array. + * `arr.byteOffset` must already be 4-byte aligned or the platform + * Uint32Array constructor will throw. + * @param arr - source typed array + * @returns Uint32Array view over the same buffer. + * @example + * Reinterpret a byte array as 32-bit words. + * ```ts + * u32(new Uint8Array(8)); + * ``` + */ + function u32(arr) { + return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); + } + /** + * Zeroizes typed arrays in place. Warning: JS provides no guarantees. + * @param arrays - arrays to overwrite with zeros + * @example + * Zeroize sensitive buffers in place. + * ```ts + * clean(new Uint8Array([1, 2, 3])); + * ``` + */ + function clean(...arrays) { + for (let i = 0; i < arrays.length; i++) { + arrays[i].fill(0); + } + } + /** + * Creates a DataView for byte-level manipulation. + * @param arr - source typed array + * @returns DataView over the same buffer region. + * @example + * Create a DataView over an existing buffer. + * ```ts + * createView(new Uint8Array(4)); + * ``` + */ + function createView(arr) { + return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); + } + /** + * Rotate-right operation for uint32 values. + * @param word - source word + * @param shift - shift amount in bits + * @returns Rotated word. + * @example + * Rotate a 32-bit word to the right. + * ```ts + * rotr(0x12345678, 8); + * ``` + */ + function rotr(word, shift) { + return (word << (32 - shift)) | (word >>> shift); + } + /** + * Rotate-left operation for uint32 values. + * @param word - source word + * @param shift - shift amount in bits + * @returns Rotated word. + * @example + * Rotate a 32-bit word to the left. + * ```ts + * rotl(0x12345678, 8); + * ``` + */ + function rotl(word, shift) { + return (word << shift) | ((word >>> (32 - shift)) >>> 0); + } + /** Whether the current platform is little-endian. */ + const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); + /** + * Byte-swap operation for uint32 values. + * @param word - source word + * @returns Word with reversed byte order. + * @example + * Reverse the byte order of a 32-bit word. + * ```ts + * byteSwap(0x11223344); + * ``` + */ + function byteSwap(word) { + return (((word << 24) & 0xff000000) | + ((word << 8) & 0xff0000) | + ((word >>> 8) & 0xff00) | + ((word >>> 24) & 0xff)); + } + /** + * Byte-swaps every word of a Uint32Array in place. + * @param arr - array to mutate + * @returns The same array after mutation; callers pass live state arrays here. + * @example + * Reverse the byte order of every word in place. + * ```ts + * byteSwap32(new Uint32Array([0x11223344])); + * ``` + */ + function byteSwap32(arr) { + for (let i = 0; i < arr.length; i++) { + arr[i] = byteSwap(arr[i]); + } + return arr; + } + /** + * Conditionally byte-swaps a Uint32Array on big-endian platforms. + * @param u - array to normalize for host endianness + * @returns Original or byte-swapped array depending on platform endianness. + * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`. + * @example + * Normalize a word array for host endianness. + * ```ts + * swap32IfBE(new Uint32Array([0x11223344])); + * ``` + */ + const swap32IfBE = isLE + ? (u) => u + : byteSwap32; + /** + * Yields to the host task scheduler so timers, I/O, and rendering can make progress. + * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback. + * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so + * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while + * still allowing other event-loop work to proceed. + * @param onReject - optional cleanup invoked only if the host yield fails + * @example + * Yield to the next scheduler tick. + * ```ts + * await nextTick(); + * ``` + */ + function nextTick(onReject) { + const host = globalThis; + if (typeof host.scheduler?.yield === 'function') { + const promise = host.scheduler.yield(); + // Keep the original scheduler rejection; this handler exists only for cleanup. + if (onReject) + promise.catch(onReject); + return promise; + } + return new Promise((resolve) => host.setTimeout(resolve, 0)); + } + /** + * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops. + * @param iters - number of loop iterations to run + * @param tick - maximum time slice in milliseconds + * @param cb - callback executed on each iteration + * @param onReject - optional cleanup invoked only if a host yield fails + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Run a loop that periodically yields back to the event loop. + * ```ts + * await asyncLoop(2, 0, () => {}); + * ``` + */ + async function asyncLoop(iters, tick, cb, onReject) { + anumber(iters, 'iters'); + anumber(tick, 'tick'); + if (typeof cb !== 'function') + throw new TypeError('callback must be a function'); + // Callback is synchronous by contract; asyncLoop only yields between sync work windows. + let ts = Date.now(); + for (let i = 0; i < iters; i++) { + cb(i); + // Date.now() is not monotonic, so in case if clock goes backwards we return return control too + const diff = Date.now() - ts; + if (diff >= 0 && diff < tick) + continue; + await nextTick(onReject); + // Track only synchronous work time; scheduler delay after yielding is outside our budget. + ts = Date.now(); + } + } + /** + * Converts string to bytes using UTF8 encoding. + * Built-in doesn't validate input to be string: we do the check. + * Non-ASCII details are delegated to the platform `TextEncoder`. + * @param str - string to encode + * @returns UTF-8 encoded bytes. + * @throws On wrong argument types. {@link TypeError} + * @example + * Encode a string as UTF-8 bytes. + * ```ts + * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99]) + * ``` + */ + function utf8ToBytes(str) { + if (typeof str !== 'string') + throw new TypeError('string expected'); + const encoded = new TextEncoder().encode(str); + try { + // Copy into the current realm for Firefox extension contexts. Callers that own the returned + // buffer can then wipe it independently of TextEncoder's temporary result. + return new Uint8Array(encoded); // https://bugzil.la/1681809 + } + finally { + clean(encoded); + } + } + /** + * Helper for KDFs: consumes Uint8Array or string. + * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer. + * @param data - user-provided KDF input + * @param errorTitle - label included in thrown errors + * @returns Byte representation of the input. + * @throws On wrong argument types. {@link TypeError} + * @example + * Normalize KDF input to bytes. + * ```ts + * kdfInputToBytes('password'); + * ``` + */ + function kdfInputToBytes(data, errorTitle = '') { + if (typeof data === 'string') + return utf8ToBytes(data); + return abytes(data, undefined, errorTitle); + } + /** + * Merges default options and passed options. + * @param defaults - base option object + * @param opts - user overrides + * @param title - label included in thrown override errors + * @returns Fresh merged option object with a null prototype. + * @throws On wrong argument types. {@link TypeError} + * @example + * Merge user overrides onto default options. + * ```ts + * checkOpts({ dkLen: 32 }, { asyncTick: 10 }); + * ``` + */ + function checkOpts(defaults, opts, title = 'opts') { + aopts(defaults, 'defaults'); + if (opts !== undefined) + aopts(opts, title); + // Callers read optional fields directly, so omitted values must not fall through to ambient + // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output). + const merged = Object.assign(Object.create(null), defaults, opts); + return merged; + } + /** + * Creates a callable hash function from a stateful class constructor. + * @param hashCons - hash constructor or factory + * @param info - optional metadata such as DER OID + * @returns Frozen callable hash wrapper with `.create()`. + * Wrapper construction eagerly calls `hashCons(undefined)` once to read + * `outputLen` / `blockLen`, so constructor side effects happen at module + * init time. + * @throws On wrong argument types. {@link TypeError} + * @example + * Wrap a stateful hash constructor into a callable helper. + * ```ts + * import { createHasher } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const wrapped = createHasher(sha256.create, { oid: sha256.oid }); + * wrapped(new Uint8Array([1])); + * ``` + */ + function createHasher(hashCons, info = {}) { + if (typeof hashCons !== 'function') + throw new TypeError('"hashCons" expected function, got type=' + typeof hashCons); + info = checkOpts({}, info, 'info'); + const hashC = (msg, opts) => hashCons(opts) + .update(msg) + .digest(); + const tmp = hashCons(undefined); + hashC.outputLen = tmp.outputLen; + hashC.blockLen = tmp.blockLen; + hashC.canXOF = tmp.canXOF; + hashC.create = (opts) => hashCons(opts); + Object.assign(hashC, info); + return Object.freeze(hashC); + } + /** + * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`. + * @param suffix - final OID byte for the selected hash. + * The helper accepts any byte even though only the documented NIST hash + * suffixes are meaningful downstream. + * @returns Object containing the DER-encoded OID. + * @example + * Build OID metadata for a NIST hash. + * ```ts + * oidNist(0x01); + * ``` + */ + const oidNist = (suffix) => ({ + // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet. + // Larger suffix values would need base-128 OID encoding and a different length byte. + oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]), + }); + + /** + * Internal Merkle-Damgard hash utils. + * @module + */ + /** + * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`. + * Returns bits from `b` when `a` is set, otherwise from `c`. + * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never + * set the same bit. + * @param a - selector word + * @param b - word chosen when selector bit is set + * @param c - word chosen when selector bit is clear + * @returns Mixed 32-bit word. + * @example + * Combine three words with the shared 32-bit choice primitive. + * ```ts + * Chi(0xffffffff, 0x12345678, 0x87654321); + * ``` + */ + function Chi(a, b, c) { + return (a & b) ^ (~a & c); + } + /** + * Shared 32-bit majority primitive reused by SHA-256 and SHA-1. + * Returns bits shared by at least two inputs. + * @param a - first input word + * @param b - second input word + * @param c - third input word + * @returns Mixed 32-bit word. + * @example + * Combine three words with the shared 32-bit majority primitive. + * ```ts + * Maj(0xffffffff, 0x12345678, 0x87654321); + * ``` + */ + function Maj(a, b, c) { + return (a & b) ^ (a & c) ^ (b & c); + } + /** + * Merkle-Damgard hash construction base class. + * Could be used to create MD5, RIPEMD, SHA1, SHA2. + * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit + * strings with partial-byte tails. + * @param blockLen - internal block size in bytes + * @param outputLen - digest size in bytes + * @param padOffset - trailing length field size in bytes + * @param isLE - whether length and state words are encoded in little-endian + * @example + * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow. + * ```ts + * import { _SHA1 } from '@noble/hashes/legacy.js'; + * const hash = new _SHA1(); + * hash.update(new Uint8Array([97, 98, 99])); + * hash.digest(); + * ``` + */ + class HashMD { + blockLen; + outputLen; + canXOF = false; + padOffset; + isLE; + // For partial updates less than block size + buffer; + view; + finished = false; + length = 0; + pos = 0; + destroyed = false; + constructor(blockLen, outputLen, padOffset, isLE) { + this.blockLen = blockLen; + this.outputLen = outputLen; + this.padOffset = padOffset; + this.isLE = isLE; + this.buffer = new Uint8Array(blockLen); + this.view = createView(this.buffer); + } + update(data) { + aexists(this); + abytes(data); + const { view, buffer, blockLen } = this; + const len = data.length; + let processed = false; + for (let pos = 0; pos < len;) { + const take = Math.min(blockLen - this.pos, len - pos); + // Fast path only when there is no buffered partial block: `take === blockLen` implies + // `this.pos === 0`, so we can process full blocks directly from the input view. + if (take === blockLen) { + const dataView = createView(data); + for (; blockLen <= len - pos; pos += blockLen) + this.process(dataView, pos); + processed = true; + continue; + } + // When the whole input is buffered in one go (common for short messages), passing `data` + // directly avoids allocating a subarray view. + buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos); + this.pos += take; + pos += take; + if (this.pos === blockLen) { + this.process(view, 0); + this.pos = 0; + processed = true; + } + } + this.length += data.length; + // Shared schedule buffers only pick up input-derived words inside process(); if everything + // was buffered without processing, there is nothing to zero. + if (processed) + this.roundClean(); + return this; + } + digestInto(out) { + aexists(this); + aoutput(out, this); + this.finished = true; + // Padding + // We can avoid allocation of buffer for padding completely if it + // was previously not allocated here. But it won't change performance. + const { buffer, view, blockLen, isLE } = this; + let { pos } = this; + // append the bit '1' to the message, then zero-pad the rest of the block + buffer[pos++] = 0b10000000; + buffer.fill(0, pos); + // we have less than padOffset left in buffer, so we cannot put length in + // current block, need process it and pad again + if (this.padOffset > blockLen - pos) { + this.process(view, 0); + buffer.fill(0); + } + // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from + // the padding fill above, and JS will overflow before user input can make that half non-zero. + // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an + // integer below 2**53, so the split inside the helper stays exact). + setU64FromNum(view, blockLen - 8, this.length * 8, isLE); + this.process(view, 0); + // The final block above is processed outside update(), so the shared message-schedule + // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest(). + this.roundClean(); + // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one. + const oview = out === buffer ? view : createView(out); + const len = this.outputLen; + // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT + const outLen = len / 4; + const state = this.get(); + // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state. + if (len % 4 || outLen > state.length) + throw new Error('invalid outputLen'); + for (let i = 0; i < outLen; i++) + oview.setUint32(4 * i, state[i], isLE); + } + digest() { + const { buffer, outputLen } = this; + this.digestInto(buffer); + // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return + // fresh bytes to the caller. + const res = buffer.slice(0, outputLen); + this.destroy(); + return res; + } + _cloneIntoMeta(to) { + const { buffer, length, finished, destroyed, pos } = this; + to.destroyed = destroyed; + to.finished = finished; + to.length = length; + to.pos = pos; + // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and + // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it. + if (pos) + to.buffer.set(buffer); // Avoid a hot modulo guard. + return to; + } + clone() { + return this._cloneInto(); + } + } + /** + * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. + * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. + */ + /** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the + * square roots of the first eight prime numbers. Exported as a shared table; callers must treat + * it as read-only because constructors copy words from it by index. */ + const SHA256_IV = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, + ]); + /** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen + * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first + * eight prime numbers. Exported as a shared table; callers must treat it as read-only because + * constructors copy halves from it by index. */ + const SHA512_IV = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, + 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, + ]); + + /** + + SHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions. + RFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors, + not the base RIPEMD-160 compression spec. + Don't use them in a new protocol. What "weak" means: + + - Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. + - No practical pre-image attacks (only theoretical, 2^123.4) + - HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151 + * @module + */ + // RIPEMD-160 + // Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables. + const Rho160 = /* @__PURE__ */ Uint8Array.from([ + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + ]); + const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); + const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); + // Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds. + const idxLR = /* @__PURE__ */ (() => { + const L = [Id160]; + const R = [Pi160]; + const res = [L, R]; + for (let i = 0; i < 4; i++) + for (let j of res) + j.push(j[i].map((k) => Rho160[k])); + return res; + })(); + const idxL = /* @__PURE__ */ (() => idxLR[0])(); + const idxR = /* @__PURE__ */ (() => idxLR[1])(); + // const [idxL, idxR] = idxLR; + // Base per-group shift table before the left/right message-order permutations are applied. + const shifts160 = /* @__PURE__ */ [ + [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], + [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], + [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], + [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], + [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], + ].map((i) => Uint8Array.from(i)); + const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); + const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); + // Five left-lane additive constants for RIPEMD-160. + const Kl160 = /* @__PURE__ */ Uint32Array.from([ + 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, + ]); + // Five right-lane additive constants for RIPEMD-160. + const Kr160 = /* @__PURE__ */ Uint32Array.from([ + 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, + ]); + // Called `f()` in the spec; valid `group` values are 0..4, and out-of-range + // inputs currently fall through to the group-4 branch. + function ripemd_f(group, x, y, z) { + if (group === 0) + return x ^ y ^ z; + if (group === 1) + return (x & y) | (~x & z); + if (group === 2) + return (x | ~y) ^ z; + if (group === 3) + return (x & z) | (y & ~z); + return x ^ (y | ~z); + } + // Reusable 16-word RIPEMD-160 message block buffer. + const BUF_160 = /* @__PURE__ */ new Uint32Array(16); + /** + * Internal RIPEMD-160 legacy hash class. + * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification. + */ + class _RIPEMD160 extends HashMD { + h0 = 0x67452301 | 0; + h1 = 0xefcdab89 | 0; + h2 = 0x98badcfe | 0; + h3 = 0x10325476 | 0; + h4 = 0xc3d2e1f0 | 0; + constructor() { + super(64, 20, 8, true); + } + get() { + const { h0, h1, h2, h3, h4 } = this; + return [h0, h1, h2, h3, h4]; + } + set(h0, h1, h2, h3, h4) { + this.h0 = h0 | 0; + this.h1 = h1 | 0; + this.h2 = h2 | 0; + this.h3 = h3 | 0; + this.h4 = h4 | 0; + } + _cloneInto(to) { + (to ||= new this.constructor()).set(...this.get()); + return this._cloneIntoMeta(to); + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + BUF_160[i] = view.getUint32(offset, true); + // prettier-ignore + let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; + // Instead of iterating 0 to 80, we split it into 5 groups + // And use the groups in constants, functions, etc. Much simpler + for (let group = 0; group < 5; group++) { + const rGroup = 4 - group; + const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore + const rl = idxL[group], rr = idxR[group]; // prettier-ignore + const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore + for (let i = 0; i < 16; i++) { + const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; + al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore + } + // 2 loops are 10% faster + for (let i = 0; i < 16; i++) { + const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; + ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore + } + } + // Add the compressed chunk to the current hash value + // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order. + this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); + } + roundClean() { + clean(BUF_160); + } + destroy() { + this.destroyed = true; + clean(this.buffer); + this.set(0, 0, 0, 0, 0); + } + } + /** + * RIPEMD-160 - a legacy hash function from 1990s. + * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point + * at the base RIPEMD-160 references. + * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html} + * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf} + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with RIPEMD-160. + * ```ts + * ripemd160(new Uint8Array([97, 98, 99])); + * ``` + */ + const ripemd160$1 = /* @__PURE__ */ createHasher(() => new _RIPEMD160()); + + /** + * HMAC: RFC2104 message authentication code. + * @module + */ + /** + * Internal class for HMAC. + * Accepts any byte key, although RFC 2104 §3 recommends keys at least + * `HashLen` bytes long. + */ + class _HMAC { + oHash; + iHash; + blockLen; + outputLen; + canXOF = false; + finished = false; + destroyed = false; + constructor(hash, key) { + ahash(hash); + abytes(key, undefined, 'key'); + this.iHash = hash.create(); + if (typeof this.iHash.update !== 'function') + throw new Error('expected Hash instance'); + this.blockLen = this.iHash.blockLen; + this.outputLen = this.iHash.outputLen; + const blockLen = this.blockLen; + const pad = new Uint8Array(blockLen); + // blockLen can be bigger than outputLen + pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36; + this.iHash.update(pad); + // By doing update (processing of the first block) of the outer hash here, + // we can re-use it between multiple calls via clone. + this.oHash = hash.create(); + // Undo internal XOR && apply outer XOR + for (let i = 0; i < pad.length; i++) + pad[i] ^= 0x36 ^ 0x5c; + this.oHash.update(pad); + clean(pad); + } + update(buf) { + aexists(this); + this.iHash.update(buf); + return this; + } + digestInto(out) { + aexists(this); + aoutput(out, this); + this.finished = true; + const buf = out.subarray(0, this.outputLen); + // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before + // overwriting that same prefix with the final tag, leaving any oversized tail untouched. + this.iHash.digestInto(buf); + this.oHash.update(buf); + this.oHash.digestInto(buf); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.oHash.outputLen); + this.digestInto(out); + return out; + } + _cloneInto(to) { + // Create new instance without calling constructor since the key + // is already in state and we don't know it. + to ||= Object.create(Object.getPrototypeOf(this), {}); + const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this; + to = to; + to.finished = finished; + to.destroyed = destroyed; + to.blockLen = blockLen; + to.outputLen = outputLen; + to.canXOF = canXOF; + to.oHash = oHash._cloneInto(to.oHash); + to.iHash = iHash._cloneInto(to.iHash); + return to; + } + clone() { + return this._cloneInto(); + } + destroy() { + this.destroyed = true; + this.oHash.destroy(); + this.iHash.destroy(); + } + } + const hmac$1 = /* @__PURE__ */ (() => { + const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest()); + hmac_.create = (hash, key) => new _HMAC(hash, key); + return hmac_; + })(); + + /** + * PBKDF (RFC 2898). Can be used to create a key from password and salt. + * @module + */ + // Common validation and per-call state setup for sync/async functions. + function pbkdf2Init(hash, _password, _salt, _opts) { + ahash(hash); + const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); + const { c, dkLen, asyncTick } = opts; + anumber(c, 'c'); + anumber(dkLen, 'dkLen'); + anumber(asyncTick, 'asyncTick'); + if (c < 1) + throw new Error('"c" (iterations) must be >= 1'); + // RFC 8018 §5.2 defines `dkLen` as "a positive integer". + if (dkLen < 1) + throw new Error('"dkLen" must be >= 1'); + // RFC 8018 §5.2 step 1 requires rejecting oversize `dkLen` + // before allocating the destination buffer. + if (dkLen > (2 ** 32 - 1) * hash.outputLen) + throw new Error('derived key too long'); + const p = kdfInputToBytes(_password, 'password'); + try { + const s = kdfInputToBytes(_salt, 'salt'); + try { + // DK = PBKDF2(PRF, Password, Salt, c, dkLen); + const DK = new Uint8Array(dkLen); + const { iHash, oHash, outputLen } = hmac$1.create(hash, p); + // Drive keyed hashes directly; the wrapper is only needed to initialize their HMAC midstates. + const u = new Uint8Array(outputLen); + const eng = pbkdf2Engine(iHash, oHash, s, u); + return { c, dkLen, asyncTick, DK, outputLen, eng }; + } + finally { + // Uint8Array inputs belong to the caller; only wipe our UTF-8 conversion. + if (typeof _salt === 'string') + clean(s); + } + } + finally { + if (typeof _password === 'string') + clean(p); + } + } + // Per-call PRF driver writes U1 into both `u` and `Ti`, then later digests into `u`; + // shared by the sync and async variants. + function pbkdf2Engine(iHash, oHash, salt, u) { + const counter = new Uint8Array(4); + const view = createView(counter); + // Full clones retain tree/config state; absorb salt before async yields without cloning input. + const salted = iHash._cloneInto().update(salt); + // u1() overwrites the worker before reading it. Seed from the outer midstate so a long salt + // cannot pre-populate a tree stack that the first reset would abandon without wiping. + const work = oHash._cloneInto(); + const iClone = iHash._cloneInto; // Capture before mixed feedback can materialize state tuples. + const oClone = oHash._cloneInto; + return { + u1: (ti, Ti) => { + view.setInt32(0, ti, false); + salted._cloneInto(work).update(counter).digestInto(u); + oHash._cloneInto(work).update(u).digestInto(u); + Ti.set(u.subarray(0, Ti.length)); + }, + // Whole `F` inner loop for the sync variant: one optimized function owns the hot loop. + rounds: (c, Ti) => { + for (let ui = 1; ui < c; ui++) { + iClone.call(iHash, work).update(u).digestInto(u); + oClone.call(oHash, work).update(u).digestInto(u); + for (let i = 0; i < Ti.length; i++) + Ti[i] ^= u[i]; + } + }, + output: (DK) => { + // Keyed templates and derived worker states are secret material. + iHash.destroy(); + oHash.destroy(); + salted.destroy(); + work.destroy(); + // Shared sync/async cleanup point: wipe transient PRF state + // while preserving the derived key buffer. + clean(u); + return DK; + }, + }; + } + /** + * PBKDF2-HMAC: RFC 8018 key derivation function. + * @param hash - hash function that would be used e.g. sha256 + * @param password - password from which a derived key is generated; + * JS string inputs are UTF-8 encoded first + * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first + * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided, + * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}. + * @returns Derived key bytes. + * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error} + * @example + * PBKDF2-HMAC: RFC 2898 key derivation function. + * ```ts + * import { pbkdf2 } from '@noble/hashes/pbkdf2.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); + * ``` + */ + function pbkdf2$3(hash, password, salt, opts) { + const { c, dkLen, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts); + // DK = T1 + T2 + ⋯ + Tdklen/hlen + for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) { + // Ti = F(Password, Salt, c, i) + // The last Ti view can be shorter than hLen, which applies + // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies. + const Ti = DK.subarray(pos, pos + outputLen); + // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc + // U1 = PRF(Password, Salt + INT_32_BE(i)) + eng.u1(ti, Ti); + // Uc = PRF(Password, Uc−1); Ti ^= Uc + eng.rounds(c, Ti); + } + return eng.output(DK); + } + + /** + * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. + * SHA256 is the fastest hash implementable in JS, even faster than Blake3. + * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and + * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}. + * @module + */ + /** + * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits + * of the cube roots of the first 64 primes (2..311). + */ + // prettier-ignore + const SHA256_K = /* @__PURE__ */ Uint32Array.from([ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 + ]); + /** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */ + const SHA256_W = /* @__PURE__ */ new Uint32Array(64); + /** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */ + class SHA2_32B extends HashMD { + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + // Numeric initializers matter: starting the fields as `undefined` changes + // V8's field representation and makes sha256 3x slower (measured). + A = 0; + B = 0; + C = 0; + D = 0; + E = 0; + F = 0; + G = 0; + H = 0; + constructor(outputLen, IV) { + super(64, outputLen, 8, false); + this.A = IV[0] | 0; + this.B = IV[1] | 0; + this.C = IV[2] | 0; + this.D = IV[3] | 0; + this.E = IV[4] | 0; + this.F = IV[5] | 0; + this.G = IV[6] | 0; + this.H = IV[7] | 0; + } + get() { + const { A, B, C, D, E, F, G, H } = this; + return [A, B, C, D, E, F, G, H]; + } + // prettier-ignore + set(A, B, C, D, E, F, G, H) { + this.A = A | 0; + this.B = B | 0; + this.C = C | 0; + this.D = D | 0; + this.E = E | 0; + this.F = F | 0; + this.G = G | 0; + this.H = H | 0; + } + _cloneInto(to) { + (to ||= new this.constructor()).set(...this.get()); + return this._cloneIntoMeta(to); + } + process(view, offset) { + // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) + SHA256_W[i] = view.getUint32(offset, false); + for (let i = 16; i < 64; i++) { + const W15 = SHA256_W[i - 15]; + const W2 = SHA256_W[i - 2]; + const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); + const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); + SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; + } + // Compression function main loop, 64 rounds + let { A, B, C, D, E, F, G, H } = this; + for (let i = 0; i < 64; i++) { + const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); + const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); + const T2 = (sigma0 + Maj(A, B, C)) | 0; + H = G; + G = F; + F = E; + E = (D + T1) | 0; + D = C; + C = B; + B = A; + A = (T1 + T2) | 0; + } + // Add the compressed chunk to the current hash value + A = (A + this.A) | 0; + B = (B + this.B) | 0; + C = (C + this.C) | 0; + D = (D + this.D) | 0; + E = (E + this.E) | 0; + F = (F + this.F) | 0; + G = (G + this.G) | 0; + H = (H + this.H) | 0; + this.set(A, B, C, D, E, F, G, H); + } + roundClean() { + clean(SHA256_W); + } + destroy() { + // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves + // update()/digest() callable on reused instances. + this.destroyed = true; + this.set(0, 0, 0, 0, 0, 0, 0, 0); + clean(this.buffer); + } + } + /** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */ + class _SHA256 extends SHA2_32B { + constructor() { + super(32, SHA256_IV); + } + } + // SHA2-512 is slower than sha256 in js because u64 operations are slow. + // SHA-384 / SHA-512 round constants from RFC 6234 §5.2: + // 80 full 64-bit words split into high/low halves. + // prettier-ignore + const K512 = /* @__PURE__ */ (() => split([ + '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', + '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', + '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', + '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', + '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', + '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', + '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', + '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', + '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', + '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', + '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', + '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', + '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', + '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', + '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', + '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', + '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', + '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', + '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', + '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' + ].map(n => BigInt(n))))(); + const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); + const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); + // Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. + const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); + // Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. + const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); + /** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */ + class SHA2_64B extends HashMD { + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + // h -- high 32 bits, l -- low 32 bits + // Numeric initializers matter: starting the fields as `undefined` changes + // V8's field representation and slows hashing down (measured on sha256). + Ah = 0; + Al = 0; + Bh = 0; + Bl = 0; + Ch = 0; + Cl = 0; + Dh = 0; + Dl = 0; + Eh = 0; + El = 0; + Fh = 0; + Fl = 0; + Gh = 0; + Gl = 0; + Hh = 0; + Hl = 0; + constructor(outputLen, IV) { + super(128, outputLen, 16, false); + this.Ah = IV[0] | 0; + this.Al = IV[1] | 0; + this.Bh = IV[2] | 0; + this.Bl = IV[3] | 0; + this.Ch = IV[4] | 0; + this.Cl = IV[5] | 0; + this.Dh = IV[6] | 0; + this.Dl = IV[7] | 0; + this.Eh = IV[8] | 0; + this.El = IV[9] | 0; + this.Fh = IV[10] | 0; + this.Fl = IV[11] | 0; + this.Gh = IV[12] | 0; + this.Gl = IV[13] | 0; + this.Hh = IV[14] | 0; + this.Hl = IV[15] | 0; + } + // prettier-ignore + get() { + const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; + } + // prettier-ignore + set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { + this.Ah = Ah | 0; + this.Al = Al | 0; + this.Bh = Bh | 0; + this.Bl = Bl | 0; + this.Ch = Ch | 0; + this.Cl = Cl | 0; + this.Dh = Dh | 0; + this.Dl = Dl | 0; + this.Eh = Eh | 0; + this.El = El | 0; + this.Fh = Fh | 0; + this.Fl = Fl | 0; + this.Gh = Gh | 0; + this.Gl = Gl | 0; + this.Hh = Hh | 0; + this.Hl = Hl | 0; + } + _cloneInto(to) { + (to ||= new this.constructor()).set(...this.get()); + return this._cloneIntoMeta(to); + } + process(view, offset) { + // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array + for (let i = 0; i < 16; i++, offset += 4) { + SHA512_W_H[i] = view.getUint32(offset); + SHA512_W_L[i] = view.getUint32((offset += 4)); + } + for (let i = 16; i < 80; i++) { + // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) + const W15h = SHA512_W_H[i - 15] | 0; + const W15l = SHA512_W_L[i - 15] | 0; + const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7); + const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7); + // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) + const W2h = SHA512_W_H[i - 2] | 0; + const W2l = SHA512_W_L[i - 2] | 0; + const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6); + const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6); + // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16]; + const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); + const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); + SHA512_W_H[i] = SUMh | 0; + SHA512_W_L[i] = SUMl | 0; + } + let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; + // Compression function main loop, 80 rounds + for (let i = 0; i < 80; i++) { + // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) + const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41); + const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41); + //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; + const CHIh = (Eh & Fh) ^ (~Eh & Gh); + const CHIl = (El & Fl) ^ (~El & Gl); + // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] + // prettier-ignore + const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); + const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); + const T1l = T1ll | 0; + // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) + const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39); + const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39); + const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); + const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); + Hh = Gh | 0; + Hl = Gl | 0; + Gh = Fh | 0; + Gl = Fl | 0; + Fh = Eh | 0; + Fl = El | 0; + ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + Dh = Ch | 0; + Dl = Cl | 0; + Ch = Bh | 0; + Cl = Bl | 0; + Bh = Ah | 0; + Bl = Al | 0; + const All = add3L(T1l, sigma0l, MAJl); + Ah = add3H(All, T1h, sigma0h, MAJh); + Al = All | 0; + } + // Add the compressed chunk to the current hash value + ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); + } + roundClean() { + clean(SHA512_W_H, SHA512_W_L); + } + destroy() { + // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves + // update()/digest() callable on reused instances. + this.destroyed = true; + clean(this.buffer); + this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + } + } + /** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */ + class _SHA512 extends SHA2_64B { + constructor() { + super(64, SHA512_IV); + } + } + /** + * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info: + * + * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack. + * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + * - Each sha256 hash is executing 2^18 bit operations. + * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA2-256. + * ```ts + * sha256(new Uint8Array([97, 98, 99])); + * ``` + */ + const sha256$2 = /* @__PURE__ */ createHasher(() => new _SHA256(), + /* @__PURE__ */ oidNist(0x01)); + /** + * SHA2-512 hash function from RFC 4634. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA2-512. + * ```ts + * sha512(new Uint8Array([97, 98, 99])); + * ``` + */ + const sha512$1 = /* @__PURE__ */ createHasher(() => new _SHA512(), + /* @__PURE__ */ oidNist(0x03)); + + /** + * SHA3 (keccak) hash function, based on a new "Sponge function" design. + * Different from older hashes, the internal state is bigger than output size. + * + * Check out + * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202}, + * {@link https://keccak.team/keccak.html | Website}, and + * {@link https://crypto.stackexchange.com/q/15727 | the differences between + * SHA-3 and Keccak}. + * + * Check out `sha3-addons` module for cSHAKE, k12, and others. + * @module + */ + // No __PURE__ annotations in sha3 header: + // EVERYTHING is in fact used on every export. + // Various per round constants calculations + const _0n = BigInt(0); + const _1n = BigInt(1); + const _2n = BigInt(2); + const _7n = BigInt(7); + const _256n = BigInt(256); + // FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors + // taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`. + const _0x71n = BigInt(0x71); + const SHA3_PI = []; + const SHA3_ROTL = []; + const _SHA3_IOTA = []; // no pure annotation: var is always used + for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { + // Pi + [x, y] = [y, (2 * x + 3 * y) % 5]; + SHA3_PI.push(2 * (5 * y + x)); + // Rotational + SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); + // Iota + let t = _0n; + for (let j = 0; j < 7; j++) { + R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; + if (R & _2n) + t ^= _1n << ((_1n << BigInt(j)) - _1n); + } + _SHA3_IOTA.push(t); + } + const IOTAS = split(_SHA3_IOTA, true); + // `split(..., true)` keeps the local little-endian lane-word layout used by + // `state32`, so these `H` / `L` tables follow the file's first-word / + // second-word lane slots rather than `_u64.ts`'s usual high/low naming. + const SHA3_IOTA_H = IOTAS[0]; + const SHA3_IOTA_L = IOTAS[1]; + // 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can + // inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only + // consumer of left-rotates; other hashes use right-rotates from _u64. + // Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64. + const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); + const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); + const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); + const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); + const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); + const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); + // Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2. + // keccakP never calls user code, so the shared buffer cannot be observed mid-permutation. + const B = new Uint32Array(5 * 2); + /** + * `keccakf1600` internal permutation, additionally allows adjusting the round count. + * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words + * in this file's local little-endian lane-word order + * @param rounds - number of rounds to execute + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @throws If `rounds` is outside the supported `1..24` range. {@link Error} + * @example + * Permute a Keccak state with the default 24 rounds. + * ```ts + * keccakP(new Uint32Array(50)); + * ``` + */ + function keccakP(s, rounds = 24) { + if (!(s instanceof Uint32Array)) + throw new TypeError('"s" expected Uint32Array(50), got type=' + typeof s); + if (s.length !== 50) + throw new RangeError('"s" expected Uint32Array(50), got length=' + s.length); + anumber(rounds, 'rounds'); + // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table. + if (rounds < 1 || rounds > 24) + throw new Error('"rounds" expected integer 1..24'); + // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) + for (let round = 24 - rounds; round < 24; round++) { + // Theta θ + for (let x = 0; x < 10; x++) + B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; + for (let x = 0; x < 10; x += 2) { + const idx1 = (x + 8) % 10; + const idx0 = (x + 2) % 10; + const B0 = B[idx0]; + const B1 = B[idx0 + 1]; + const Th = rotlH(B0, B1, 1) ^ B[idx1]; + const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; + for (let y = 0; y < 50; y += 10) { + s[x + y] ^= Th; + s[x + y + 1] ^= Tl; + } + } + // Rho (ρ) and Pi (π) + let curH = s[2]; + let curL = s[3]; + for (let t = 0; t < 24; t++) { + const shift = SHA3_ROTL[t]; + const Th = rotlH(curH, curL, shift); + const Tl = rotlL(curH, curL, shift); + const PI = SHA3_PI[t]; + curH = s[PI]; + curL = s[PI + 1]; + s[PI] = Th; + s[PI + 1] = Tl; + } + // Chi (χ) + // Same as: + // for (let x = 0; x < 10; x++) B[x] = s[y + x]; + // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; + for (let y = 0; y < 50; y += 10) { + const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3]; + s[y] ^= ~s[y + 2] & s[y + 4]; + s[y + 1] ^= ~s[y + 3] & s[y + 5]; + s[y + 2] ^= ~s[y + 4] & s[y + 6]; + s[y + 3] ^= ~s[y + 5] & s[y + 7]; + s[y + 4] ^= ~s[y + 6] & s[y + 8]; + s[y + 5] ^= ~s[y + 7] & s[y + 9]; + s[y + 6] ^= ~s[y + 8] & b0; + s[y + 7] ^= ~s[y + 9] & b1; + s[y + 8] ^= ~b0 & b2; + s[y + 9] ^= ~b1 & b3; + } + // Iota (ι) + s[0] ^= SHA3_IOTA_H[round]; + s[1] ^= SHA3_IOTA_L[round]; + } + clean(B); + } + /** + * Keccak sponge function. + * @param blockLen - absorb/squeeze rate in bytes + * @param suffix - domain separation suffix byte + * @param outputLen - default digest length in bytes. This base sponge only + * requires a non-negative integer; wrappers that need positive output + * lengths must enforce that themselves. + * @param enableXOF - whether XOF output is allowed + * @param rounds - number of Keccak-f rounds + * @example + * Build a sponge state, absorb bytes, then finalize a digest. + * ```ts + * const hash = new Keccak(136, 0x06, 32); + * hash.update(new Uint8Array([1, 2, 3])); + * hash.digest(); + * ``` + */ + class Keccak { + state; + pos = 0; + posOut = 0; + finished = false; + state32; + destroyed = false; + blockLen; + suffix; + outputLen; + canXOF; + enableXOF = false; + rounds; + // NOTE: we accept arguments in bytes instead of bits here. + constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { + anumber(blockLen, 'blockLen'); + anumber(suffix, 'suffix'); + anumber(rounds, 'rounds'); + abool(enableXOF, 'enableXOF'); + this.blockLen = blockLen; + this.suffix = suffix; + this.outputLen = outputLen; + this.enableXOF = enableXOF; + this.canXOF = enableXOF; + this.rounds = rounds; + // Can be passed from user as dkLen + anumber(outputLen, 'outputLen'); + // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state. + if (!(0 < blockLen && blockLen < 200)) + throw new Error('"blockLen" must be 1..199'); + this.state = new Uint8Array(200); + this.state32 = u32(this.state); + } + clone() { + return this._cloneInto(); + } + keccak() { + swap32IfBE(this.state32); + keccakP(this.state32, this.rounds); + swap32IfBE(this.state32); + this.posOut = 0; + this.pos = 0; + } + update(data) { + aexists(this); + abytes(data); + const { blockLen, state, state32 } = this; + const len = data.length; + // Absorb full blocks with u32 XORs when both sides are 4-byte aligned. + // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe. + const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0; + const blockLen32 = blockLen / 4; + const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined; + for (let pos = 0; pos < len;) { + if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) { + for (let i = 0, o = pos / 4; i < blockLen32; i++) + state32[i] ^= data32[o + i]; + pos += blockLen; + // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override, + // so it must reflect the fully-absorbed block before the permutation fires. + this.pos = blockLen; + this.keccak(); + continue; + } + const take = Math.min(blockLen - this.pos, len - pos); + for (let i = 0; i < take; i++) + state[this.pos++] ^= data[pos++]; + if (this.pos === blockLen) + this.keccak(); + } + return this; + } + finish() { + if (this.finished) + return; + this.finished = true; + const { state, suffix, pos, blockLen } = this; + // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1. + // These byte values already include the first padding bit, while the + // final `0x80` below supplies the closing `1` bit in the last rate byte. + state[pos] ^= suffix; + // If that combined suffix lands in the last rate byte and already sets + // bit 7, absorb it first so the final pad10*1 bit can be xored into a + // fresh block. + if ((suffix & 0x80) !== 0 && pos === blockLen - 1) + this.keccak(); + state[blockLen - 1] ^= 0x80; + this.keccak(); + } + writeInto(out) { + aexists(this, false); + abytes(out); + this.finish(); + const bufferOut = this.state; + const { blockLen } = this; + for (let pos = 0, len = out.length; pos < len;) { + if (this.posOut >= blockLen) + this.keccak(); + const take = Math.min(blockLen - this.posOut, len - pos); + out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); + this.posOut += take; + pos += take; + } + return out; + } + xofInto(out) { + // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base + // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/ + // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF. + if (!this.enableXOF) + throw new Error('XOF is not enabled'); + return this.writeInto(out); + } + xof(bytes) { + anumber(bytes); + return this.xofInto(new Uint8Array(bytes)); + } + digestInto(out) { + aoutput(out, this); + if (this.finished) + throw new Error('digest() was already called'); + // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest. + this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen)); + this.destroy(); + } + digest() { + const out = new Uint8Array(this.outputLen); + this.digestInto(out); + return out; + } + destroy() { + this.destroyed = true; + clean(this.state); + } + _cloneInto(to) { + const { blockLen, suffix, outputLen, rounds, enableXOF } = this; + to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); + // Reused destinations can come from a different rate/capacity variant, so clone must rewrite + // the sponge geometry as well as the state words. + to.blockLen = blockLen; + to.state32.set(this.state32); + // Sponge padding and XOF output are positional, so both offsets are part of the clone state. + to.pos = this.pos; + to.posOut = this.posOut; + to.finished = this.finished; + to.rounds = rounds; + // Suffix can change in cSHAKE + to.suffix = suffix; + to.outputLen = outputLen; + to.enableXOF = enableXOF; + // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone + // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie. + to.canXOF = this.canXOF; + to.destroyed = this.destroyed; + return to; + } + } + const genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info); + /** + * SHA3-256 hash function. Different from keccak-256. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA3-256. + * ```ts + * sha3_256(new Uint8Array([97, 98, 99])); + * ``` + */ + const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, + /* @__PURE__ */ oidNist(0x08)); + /** + * SHA3-512 hash function. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA3-512. + * ```ts + * sha3_512(new Uint8Array([97, 98, 99])); + * ``` + */ + const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, + /* @__PURE__ */ oidNist(0x0a)); + /** + * Keccak-256 hash function. Different from SHA3-256. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with Keccak-256. + * ```ts + * keccak_256(new Uint8Array([97, 98, 99])); + * ``` + */ + const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32); + + /*! + * assert.js - assert for bcrypto + * Copyright (c) 2020, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var assert_1; + var hasRequiredAssert; + + function requireAssert () { + if (hasRequiredAssert) return assert_1; + hasRequiredAssert = 1; + + /* + * Assert + */ + + function assert(val, msg) { + if (!val) { + const err = new Error(msg || 'Assertion failed'); + + if (Error.captureStackTrace) + Error.captureStackTrace(err, assert); + + throw err; + } + } + + /* + * Expose + */ + + assert_1 = assert; + return assert_1; + } + + var customBrowser = {}; + + /*! + * custom.js - custom inspect symbol for bcrypto + * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var hasRequiredCustomBrowser; + + function requireCustomBrowser () { + if (hasRequiredCustomBrowser) return customBrowser; + hasRequiredCustomBrowser = 1; + + customBrowser.custom = 'inspect'; + return customBrowser; + } + + var bn; + var hasRequiredBn; + + function requireBn () { + if (hasRequiredBn) return bn; + hasRequiredBn = 1; + + const {custom} = requireCustomBrowser(); + + /* + * Constants + */ + + const zeros = [ + '', + '0', + '00', + '000', + '0000', + '00000', + '000000', + '0000000', + '00000000', + '000000000', + '0000000000', + '00000000000', + '000000000000', + '0000000000000', + '00000000000000', + '000000000000000', + '0000000000000000', + '00000000000000000', + '000000000000000000', + '0000000000000000000', + '00000000000000000000', + '000000000000000000000', + '0000000000000000000000', + '00000000000000000000000', + '000000000000000000000000', + '0000000000000000000000000' + ]; + + const groupSizes = [ + 0x00, 0x19, 0x10, 0x0c, 0x0b, 0x0a, + 0x09, 0x08, 0x08, 0x07, 0x07, 0x07, + 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 + ]; + + const groupBases = [ + 0x00000000, 0x02000000, 0x0290d741, 0x01000000, + 0x02e90edd, 0x039aa400, 0x0267bf47, 0x01000000, + 0x0290d741, 0x00989680, 0x012959c3, 0x0222c000, + 0x03bd7765, 0x0072e440, 0x00adcea1, 0x01000000, + 0x01704f61, 0x0206fc40, 0x02cddcf9, 0x03d09000, + 0x003e5185, 0x004ea360, 0x006235f7, 0x00798000, + 0x009502f9, 0x00b54ba0, 0x00daf26b, 0x01069c00, + 0x0138f9ad, 0x0172c9e0, 0x01b4d89f, 0x02000000, + 0x025528a1, 0x02b54a20, 0x03216b93, 0x039aa400 + ]; + + const primes = { + p192: null, + p224: null, + p521: null, + k256: null, + p251: null, + p25519: null, + p448: null + }; + + const modes = { + NONE: 0, + QUO: 1, + REM: 2, + BOTH: 3, + EUCLID: 4, + ALL: 7 + }; + + const WND_WIDTH = 4; + const WND_SIZE = 1 << (WND_WIDTH - 1); + + const HAS_BIGINT = typeof BigInt === 'function'; + + /** + * BN + */ + + class BN { + constructor(num, base, endian) { + this.words = [0]; + this.length = 1; + this.negative = 0; + this.red = null; + this.from(num, base, endian); + } + + /* + * Addition Engine + */ + + _iadd(a, b) { + let carry = 0; + let i = 0; + + // a.length > b.length + if (a.length < b.length) + [a, b] = [b, a]; + + if (a !== this) + this._alloc(a.length); + + for (; i < b.length; i++) { + const r = (a.words[i] | 0) + (b.words[i] | 0) + carry; + + this.words[i] = r & 0x3ffffff; + + carry = r >>> 26; + } + + for (; carry !== 0 && i < a.length; i++) { + const r = (a.words[i] | 0) + carry; + + this.words[i] = r & 0x3ffffff; + + carry = r >>> 26; + } + + this.length = a.length; + + if (carry !== 0) { + this._alloc(this.length + 1); + this.words[this.length++] = carry; + } else if (a !== this) { + // Copy the rest of the words. + for (; i < a.length; i++) + this.words[i] = a.words[i]; + } + + // Note: we shouldn't need to strip here. + return this; + } + + _iaddn(num) { + this.words[0] += num; + + if (this.words[0] < 0x4000000) + return this; + + // Carry. + let i = 0; + + this._alloc(this.length + 1); + + this.words[this.length] = 0; + + for (; i < this.length && this.words[i] >= 0x4000000; i++) { + this.words[i] -= 0x4000000; + this.words[i + 1] += 1; + } + + this.length = Math.max(this.length, i + 1); + + // Note: we shouldn't need to strip here. + return this; + } + + /* + * Addition + */ + + iadd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.negative === num.negative) { + // x + y == x + y + // (-x) + (-y) == -(x + y) + this._iadd(this, num); + } else { + // x + (-y) == x - y == -(y - x) + // (-x) + y == y - x == -(x - y) + const cmp = this.ucmp(num); + + // x + (-x) == (-x) + x == 0 + if (cmp === 0) { + this.words[0] = 0; + this.length = 1; + this.negative = 0; + return this; + } + + if (cmp < 0) { + this._isub(num, this); + this.negative ^= 1; + } else { + this._isub(this, num); + } + } + + return this; + } + + iaddn(num) { + enforce(isSMI(num), 'num', 'smi'); + + const negative = (num < 0) | 0; + + if (negative) + num = -num; + + if (this.negative === negative) { + // x + y == x + y + // (-x) + (-y) == -(x + y) + this._iaddn(num); + } else { + // x + (-y) == x - y == -(y - x) + // (-x) + y == y - x == -(x - y) + if (this.length === 1 && this.words[0] < num) { + this.words[0] = num - this.words[0]; + this.negative ^= 1; + } else { + this._isubn(num); + } + } + + return this; + } + + add(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (num.length > this.length) + return num.clone().iadd(this); + + return this.clone().iadd(num); + } + + addn(num) { + return this.clone().iaddn(num); + } + + /* + * Subtraction Engine + */ + + _isub(a, b) { + let carry = 0; + let i = 0; + + // a > b + assert(a.length >= b.length); + + if (a !== this) + this._alloc(a.length); + + for (; i < b.length; i++) { + const r = (a.words[i] | 0) - (b.words[i] | 0) + carry; + + carry = r >> 26; + + this.words[i] = r & 0x3ffffff; + } + + for (; carry !== 0 && i < a.length; i++) { + const r = (a.words[i] | 0) + carry; + + carry = r >> 26; + + this.words[i] = r & 0x3ffffff; + } + + assert(carry === 0); + + // Copy rest of the words. + if (a !== this) { + for (; i < a.length; i++) + this.words[i] = a.words[i]; + } + + this.length = Math.max(this.length, i); + + return this._strip(); + } + + _isubn(num) { + this.words[0] -= num; + + if (this.words[0] >= 0) + return this._normalize(); + + assert(this.length !== 1); + + // Carry. + this._alloc(this.length + 1); + + for (let i = 0; i < this.length && this.words[i] < 0; i++) { + this.words[i] += 0x4000000; + this.words[i + 1] -= 1; + } + + this.words[this.length] = 0; + + return this._strip(); + } + + /* + * Subtraction + */ + + isub(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.negative !== num.negative) { + // x - (-y) == x + y + // (-x) - y == -(x + y) + this._iadd(this, num); + } else { + // x - y == x - y == -(y - x) + // (-x) - (-y) == y - x == -(x - y) + const cmp = this.ucmp(num); + + // x - x == 0 + if (cmp === 0) { + this.words[0] = 0; + this.length = 1; + this.negative = 0; + return this; + } + + if (cmp < 0) { + this._isub(num, this); + this.negative ^= 1; + } else { + this._isub(this, num); + } + } + + return this; + } + + isubn(num) { + enforce(isSMI(num), 'num', 'smi'); + + const negative = (num < 0) | 0; + + if (negative) + num = -num; + + if (this.negative !== negative) { + // x - (-y) == x + y + // (-x) - y == -(x + y) + this._iaddn(num); + } else { + // x - y == x - y == -(y - x) + // (-x) - (-y) == y - x == -(x - y) + if (this.length === 1 && this.words[0] < num) { + this.words[0] = num - this.words[0]; + this.negative ^= 1; + } else { + this._isubn(num); + } + } + + return this; + } + + sub(num) { + return this.clone().isub(num); + } + + subn(num) { + return this.clone().isubn(num); + } + + /* + * Multiplication Engine + */ + + _mul(num, out) { + enforce(BN.isBN(num), 'num', 'bignum'); + enforce(BN.isBN(out), 'out', 'bignum'); + + if (this.length === 10 && num.length === 10) + return comb10MulTo(this, num, out); + + const len = this.length + num.length; + + if (len < 63) + return smallMulTo(this, num, out); + + if (len < 1024) + return bigMulTo(this, num, out); + + return jumboMulTo(this, num, out); + } + + /* + * Multiplication + */ + + imul(num) { + return this.mul(num)._move(this); + } + + imuln(num) { + enforce(isSMI(num), 'num', 'smi'); + + const neg = (num < 0) | 0; + + if (neg) + num = -num; + + // Carry. + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const w = this.words[i] * num; + const lo = (w & 0x3ffffff) + (carry & 0x3ffffff); + + carry >>= 26; + carry += (w / 0x4000000) | 0; + carry += lo >>> 26; + + this.words[i] = lo & 0x3ffffff; + } + + this.negative ^= neg; + + if (carry !== 0) { + this._alloc(this.length + 1); + this.words[this.length++] = carry; + } else { + this._strip(); + } + + return this; + } + + mul(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + const len = this.length + num.length; + const out = new BN(); + + out.words = new Array(len); + + for (let i = 0; i < len; i ++) + out.words[i] = 0; + + return this._mul(num, out); + } + + muln(num) { + return this.clone().imuln(num); + } + + /* + * Multiplication + Shift + */ + + mulShift(num, bits) { + enforce(BN.isBN(num), 'num', 'bignum'); + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + const r = this.mul(num); + const b = r.utestn(bits - 1); + + r.iushrn(bits); + + if (this.negative ^ num.negative) + return r.isubn(b); + + return r.iaddn(b); + } + + /* + * Division Engine + */ + + _div(num, flags) { + enforce(BN.isBN(num), 'num', 'bignum'); + assert((flags & modes.ALL) === flags); + assert(flags !== modes.NONE); + + const a = this; + const b = num; + + nonzero(!b.isZero()); + + if (a.isZero()) + return [new BN(0), new BN(0)]; + + const as = a.negative; + const bs = b.negative; + + a.negative = 0; + b.negative = 0; + + let q = null; + let r = null; + + if (a.ucmp(b) < 0) { + if (flags & modes.QUO) + q = new BN(0); + + if (flags & modes.REM) + r = a.clone(); + } else if (b.length === 1) { + if (flags & modes.QUO) + q = a.quon(b.words[0]); + + if (flags & modes.REM) + r = a.remn(b.words[0]); + } else { + [q, r] = a._wordDiv(b, flags); + } + + a.negative = as; + b.negative = bs; + + if (flags & modes.QUO) { + q.negative = a.negative ^ b.negative; + q._normalize(); + } + + if (flags & modes.REM) { + r.negative = a.negative; + r._normalize(); + } + + if (flags & modes.EUCLID) { + if (flags & modes.QUO) { + assert((flags & modes.REM) !== 0); + + if (r.negative !== 0) { + if (b.negative !== 0) + q.iaddn(1); + else + q.isubn(1); + } + } + + if (flags & modes.REM) { + if (r.negative !== 0) { + if (b.negative !== 0) + r.isub(b); + else + r.iadd(b); + } + } + } + + return [q, r]; + } + + _wordDiv(num, flags) { + let a = this.clone(); + let b = num; + let q = null; + let hi; + + // Normalize. + const word = b.words[b.length - 1] | 0; + const shift = 26 - countBits(word); + + if (shift !== 0) { + b = b.clone(); + + a.iushln(shift); + b.iushln(shift); + + hi = b.words[b.length - 1] | 0; + } else { + hi = word; + } + + // Initialize quotient. + const m = a.length - b.length; + + assert(m >= 0); + + if (flags & modes.QUO) { + q = new BN(0); + q.length = m + 1; + q.words = new Array(q.length); + + for (let i = 0; i < q.length; i++) + q.words[i] = 0; + } + + // Diff. + const d = a.clone(); + + d._ishlnsubmul(b, 1, m); + + if (d.negative === 0) { + if (q) + q.words[m] = 1; + + a = d; + } + + // Divide. + for (let j = m - 1; j >= 0; j--) { + const ahi = a.words[b.length + j]; + const alo = a.words[b.length + j - 1]; + const quo = ((ahi * 0x4000000 + alo) / hi) | 0; + + let qj = Math.min(quo, 0x3ffffff); + + a._ishlnsubmul(b, qj, j); + + while (a.negative !== 0) { + qj -= 1; + a.negative = 0; + a._ishlnsubmul(b, 1, j); + a.ineg(); + } + + if (q) + q.words[j] = qj; + } + + // Strip. + if (q) + q._strip(); + + // Denormalize. + // Note: we shouldn't need to strip `a` here. + if ((flags & modes.REM) && shift !== 0) + a.iushrn(shift); + + return [q, a]; + } + + _ishlnsubmul(num, mul, shift) { + let carry = 0; + let i = 0; + + this._expand(num.length + shift); + + for (; i < num.length; i++) { + const k = (this.words[i + shift] | 0) + carry; + const r = num.words[i] * mul; + const w = k - (r & 0x3ffffff); + + carry = (w >> 26) - ((r / 0x4000000) | 0); + + this.words[i + shift] = w & 0x3ffffff; + } + + for (; i < this.length - shift; i++) { + const w = (this.words[i + shift] | 0) + carry; + + carry = w >> 26; + + this.words[i + shift] = w & 0x3ffffff; + } + + if (carry === 0) + return this._strip(); + + // Subtraction overflow. + assert(carry === -1); + + carry = 0; + + for (let i = 0; i < this.length; i++) { + const w = -(this.words[i] | 0) + carry; + + carry = w >> 26; + + this.words[i] = w & 0x3ffffff; + } + + this.negative = 1; + + return this._strip(); + } + + /* + * Truncation Division + Modulo + */ + + quorem(num) { + return this._div(num, modes.BOTH); + } + + /* + * Truncation Division + */ + + iquo(num) { + return this.quo(num)._move(this); + } + + iquon(num) { + enforce(isSMI(num), 'num', 'smi'); + nonzero(num !== 0); + + const neg = (num < 0) | 0; + + if (neg) + num = -num; + + let carry = 0; + + for (let i = this.length - 1; i >= 0; i--) { + const w = (this.words[i] | 0) + carry * 0x4000000; + + this.words[i] = (w / num) | 0; + + carry = w % num; + } + + this.negative ^= neg; + + return this._strip(); + } + + quo(num) { + return this._div(num, modes.QUO)[0]; + } + + quon(num) { + return this.clone().iquon(num); + } + + /* + * Truncation Modulo + */ + + irem(num) { + return this.rem(num)._move(this); + } + + iremn(num) { + let m = this.remrn(num); + + if (m < 0) + m = -m; + + this.words[0] = m; + this.length = 1; + + return this._normalize(); + } + + rem(num) { + return this._div(num, modes.REM)[1]; + } + + remn(num) { + return this.clone().iremn(num); + } + + remrn(num) { + enforce(isSMI(num), 'num', 'smi'); + nonzero(num !== 0); + + if (num < 0) + num = -num; + + const p = (1 << 26) % num; + + let acc = 0; + + for (let i = this.length - 1; i >= 0; i--) + acc = (p * acc + (this.words[i] | 0)) % num; + + return this.negative !== 0 ? (-acc | 0) : acc; + } + + /* + * Euclidean Division + Modulo + */ + + divmod(num) { + return this._div(num, modes.BOTH | modes.EUCLID); + } + + /* + * Euclidean Division + */ + + idiv(num) { + return this.div(num)._move(this); + } + + idivn(num) { + if (this.negative === 0) + return this.iquon(num); + + const r = this.remrn(num); + + this.iquon(num); + + if (r < 0) { + if (num < 0) + this.iaddn(1); + else + this.isubn(1); + } + + return this; + } + + div(num) { + return this._div(num, modes.BOTH | modes.EUCLID)[0]; + } + + divn(num) { + return this.clone().idivn(num); + } + + /* + * Euclidean Modulo + */ + + imod(num) { + if (this.ucmp(num) < 0) { + if (this.negative !== 0) { + this._isub(num, this); + this.negative = 0; + } + return this; + } + + return this.mod(num)._move(this); + } + + imodn(num) { + this.words[0] = this.modrn(num); + this.length = 1; + this.negative = 0; + return this; + } + + mod(num) { + return this._div(num, modes.REM | modes.EUCLID)[1]; + } + + modn(num) { + return this.clone().imodn(num); + } + + modrn(num) { + enforce(isSMI(num), 'num', 'smi'); + + let r = this.remrn(num); + + if (r < 0) { + if (num < 0) + r -= num; + else + r += num; + } + + return r; + } + + /* + * Round Division + */ + + divRound(num) { + const [q, r] = this.quorem(num); + + // Fast case - exact division. + if (r.isZero()) + return q; + + const bit = num.words[0] & 1; + + num.iushrn(1); + + const cmp = r.ucmp(num); + + num.iushln(1); + + num.words[0] |= bit; + + // Round down. + if (cmp < 0 || (num.isOdd() && cmp === 0)) + return q; + + // Round up. + if (this.negative ^ num.negative) + return q.isubn(1); + + return q.iaddn(1); + } + + /* + * Exponentiation + */ + + ipow(num) { + return this.pow(num)._move(this); + } + + ipown(num) { + return this.pown(num)._move(this); + } + + pow(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let b = countBits(num.words[num.length - 1]); + let r = new BN(1); + + for (let i = num.length - 1; i >= 0; i--) { + const word = num.words[i]; + + for (let j = b - 1; j >= 0; j--) { + r = r.sqr(); + + if ((word >> j) & 1) + r = r.mul(this); + } + + b = 26; + } + + return r; + } + + pown(num) { + enforce(isSMI(num), 'num', 'smi'); + + if (num < 0) + num = -num; + + if (num === 0) + return new BN(1); + + if (num === 1) + return this.clone(); + + const bits = countBits(num); + + let r = this; + + for (let i = bits - 2; i >= 0; i--) { + r = r.sqr(); + + if ((num >> i) & 1) + r = r.mul(this); + } + + return r; + } + + isqr() { + return this.imul(this); + } + + sqr() { + return this.mul(this); + } + + /* + * Roots Engine + */ + + _rootrem(pow, rem) { + enforce((pow >>> 0) === pow, 'num', 'uint32'); + + if (pow === 0) + throw new RangeError('Zeroth root.'); + + if (~pow & this.negative) + throw new RangeError('Negative with even root.'); + + if (this.ucmpn(1) <= 0) + return [this.clone(), new BN(0)]; + + let u = new BN(0); + let t = BN.shift(1, this.bitLength() / pow + 1 | 0); + let v, r; + + if (this.negative !== 0) + t.ineg(); + + if (pow === 2) { + do { + u = t; + t = this.quo(u); + t.iadd(u); + t.iushrn(1); + } while (t.ucmp(u) < 0); + } else { + do { + u = t; + t = u.pown(pow - 1); + t = this.quo(t); + v = u.muln(pow - 1); + t.iadd(v); + t = t.quon(pow); + } while (t.ucmp(u) < 0); + } + + if (rem) { + t = u.pown(pow); + r = this.sub(t); + } + + return [u, r]; + } + + /* + * Roots + */ + + rootrem(pow) { + return this._rootrem(pow, 1); + } + + iroot(pow) { + return this.root(pow)._move(this); + } + + root(pow) { + return this._rootrem(pow, 0)[0]; + } + + isPower(pow) { + enforce((pow >>> 0) === pow, 'num', 'uint32'); + + if (pow === 0 || (~pow & this.negative)) + return false; + + const [, r] = this.rootrem(pow); + + return r.sign() === 0; + } + + sqrtrem() { + return this.rootrem(2); + } + + isqrt() { + return this.sqrt()._move(this); + } + + sqrt() { + return this.root(2); + } + + isSquare() { + return this.isPower(2); + } + + /* + * AND + */ + + iand(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let x = this; + let y = num; + + if (x === y) + return x; + + if ((x.negative | y.negative) === 0) + return x.iuand(y); + + if ((x.negative & y.negative) === 1) { + // (-x) & (-y) == ~(x-1) & ~(y-1) + // == ~((x-1) | (y-1)) + // == -(((x-1) | (y-1)) + 1) + x.iaddn(1); + y.iaddn(1); + x.iuor(y); + x.isubn(1); + y.isubn(1); + return x; + } + + // Assume x is the positive number. + if (x.negative !== 0) + [x, y] = [y.clone(), x]; + + // x & (-y) == x & ~(y-1) + // == x & ~(y-1) + const width = x.bitLength(); + + y.iaddn(1); + y.inotn(width); + x.iuand(y); + y.inotn(width); + y.isubn(1); + + return x._move(this); + } + + iandn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if ((this.negative | (num < 0)) !== 0) + return this.iand(new BN(num)); + + this.words[0] &= num; + this.length = 1; + + return this; + } + + and(num) { + return this.clone().iand(num); + } + + andn(num) { + return this.clone().iandn(num); + } + + andrn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if ((this.negative | (num < 0)) !== 0) { + const n = this.iand(new BN(num)); + + if (n.length > 1) + throw new RangeError('Number exceeds 26 bits.'); + + return n.negative !== 0 ? -n.words[0] : n.words[0]; + } + + return this.words[0] & num; + } + + /* + * Unsigned AND + */ + + iuand(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + this.length = Math.min(this.length, num.length); + + for (let i = 0; i < this.length; i++) + this.words[i] &= num.words[i]; + + return this._strip(); + } + + iuandn(num) { + enforce(isSMI(num), 'num', 'smi'); + + this.words[0] &= Math.abs(num); + this.length = 1; + + return this._normalize(); + } + + uand(num) { + return this.clone().iuand(num); + } + + uandn(num) { + return this.clone().iuandn(num); + } + + uandrn(num) { + enforce(isSMI(num), 'num', 'smi'); + + const n = this.words[0] & Math.abs(num); + + return this.negative !== 0 ? (-n | 0) : n; + } + + /* + * OR + */ + + ior(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let x = this; + let y = num; + + if (x === y) + return x; + + if ((x.negative | y.negative) === 0) + return x.iuor(y); + + if ((x.negative & y.negative) === 1) { + // (-x) | (-y) == ~(x-1) | ~(y-1) + // == ~((x-1) & (y-1)) + // == -(((x-1) & (y-1)) + 1) + x.iaddn(1); + y.iaddn(1); + x.iuand(y); + x.isubn(1); + y.isubn(1); + return x; + } + + // Assume x is the positive number. + y = y.clone(); + + if (x.negative !== 0) + [x, y] = [y, x]; + + // x | (-y) == x | ~(y-1) + // == ~((y-1) & ~x) + // == -(((y-1) & ~x) + 1) + y.iaddn(1); + x.inotn(y.bitLength()); + y.iuand(x); + y.isubn(1); + + return y._move(this); + } + + iorn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if ((this.negative | (num < 0)) !== 0) + return this.ior(new BN(num)); + + this.words[0] |= num; + + return this; + } + + or(num) { + return this.clone().ior(num); + } + + orn(num) { + return this.clone().iorn(num); + } + + /* + * Unsigned OR + */ + + iuor(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + this._expand(num.length); + + for (let i = 0; i < num.length; i++) + this.words[i] |= num.words[i]; + + // Note: we shouldn't need to strip here. + return this; + } + + iuorn(num) { + enforce(isSMI(num), 'num', 'smi'); + + this.words[0] |= Math.abs(num); + + return this; + } + + uor(num) { + return this.clone().iuor(num); + } + + uorn(num) { + return this.clone().iuorn(num); + } + + /* + * XOR + */ + + ixor(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let x = this; + let y = num; + + if (x === y) { + x.words[0] = 0; + x.length = 1; + x.negative = 0; + return x; + } + + if ((x.negative | y.negative) === 0) + return x.iuxor(y); + + if ((x.negative & y.negative) === 1) { + // (-x) ^ (-y) == ~(x-1) ^ ~(y-1) + // == (x-1) ^ (y-1) + x.iaddn(1); + y.iaddn(1); + x.iuxor(y); + x.ineg(); + y.isubn(1); + return x; + } + + // Assume x is the positive number. + if (x.negative !== 0) + [x, y] = [y.clone(), x]; + + // x ^ (-y) == x ^ ~(y-1) + // == ~(x ^ (y-1)) + // == -((x ^ (y-1)) + 1) + y.iaddn(1); + x.iuxor(y); + x.iaddn(1); + x.ineg(); + y.isubn(1); + + return x._move(this); + } + + ixorn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if ((this.negative | (num < 0)) !== 0) + return this.ixor(new BN(num)); + + this.words[0] ^= num; + + return this; + } + + xor(num) { + return this.clone().ixor(num); + } + + xorn(num) { + return this.clone().ixorn(num); + } + + /* + * Unsigned XOR + */ + + iuxor(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + let a = this; + let b = num; + + if (a.length < b.length) + [a, b] = [b, a]; + + let i = 0; + + for (; i < b.length; i++) + this.words[i] = a.words[i] ^ b.words[i]; + + if (a !== this) { + this._alloc(a.length); + + for (; i < a.length; i++) + this.words[i] = a.words[i]; + } + + this.length = a.length; + + return this._strip(); + } + + iuxorn(num) { + enforce(isSMI(num), 'num', 'smi'); + + this.words[0] ^= Math.abs(num); + + return this._normalize(); + } + + uxor(num) { + return this.clone().iuxor(num); + } + + uxorn(num) { + return this.clone().iuxorn(num); + } + + /* + * NOT + */ + + inot() { + if (this.negative !== 0) { + // ~(-x) == ~(~(x-1)) == x-1 + this.ineg().isubn(1); + } else { + // ~x == -x-1 == -(x+1) + this.iaddn(1).ineg(); + } + return this; + } + + not() { + return this.clone().inot(); + } + + inotn(width) { + enforce((width >>> 0) === width, 'width', 'uint32'); + + const r = width % 26; + + let s = Math.ceil(width / 26); + let i = 0; + + // Extend the buffer with leading zeroes. + this._expand(s); + + if (r > 0) + s -= 1; + + // Handle complete words. + for (; i < s; i++) + this.words[i] ^= 0x3ffffff; + + // Handle the residue. + if (r > 0) + this.words[i] ^= (1 << r) - 1; + + // And remove leading zeroes. + return this._strip(); + } + + notn(width) { + return this.clone().inotn(width); + } + + /* + * Left Shift + */ + + ishl(num) { + enforce(BN.isBN(num), 'bits', 'bignum'); + enforce(num.bitLength() <= 32, 'bits', 'uint32'); + return this.ishln(num.toNumber()); + } + + ishln(bits) { + return this.iushln(bits); + } + + shl(num) { + return this.clone().ishl(num); + } + + shln(bits) { + return this.clone().ishln(bits); + } + + /* + * Unsigned Left Shift + */ + + iushl(num) { + enforce(BN.isBN(num), 'bits', 'bignum'); + enforce(num.bitLength() <= 32, 'bits', 'uint32'); + return this.iushln(num.toNumber()); + } + + iushln(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + const r = bits % 26; + const s = (bits - r) / 26; + const mask = ((1 << r) - 1) << (26 - r); + + if (r !== 0) { + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const ncarry = this.words[i] & mask; + const c = ((this.words[i] | 0) - ncarry) << r; + + this.words[i] = c | carry; + + carry = ncarry >>> (26 - r); + } + + if (carry !== 0) { + this._alloc(this.length + 1); + this.words[this.length++] = carry; + } + } + + if (s !== 0) { + this._alloc(this.length + s); + + for (let i = this.length - 1; i >= 0; i--) + this.words[i + s] = this.words[i]; + + for (let i = 0; i < s; i++) + this.words[i] = 0; + + this.length += s; + } + + return this._strip(); + } + + ushl(num) { + return this.clone().iushl(num); + } + + ushln(bits) { + return this.clone().iushln(bits); + } + + /* + * Right Shift Engine + */ + + _split(bits, output) { + const r = bits % 26; + const s = Math.min((bits - r) / 26, this.length); + const mask = (1 << r) - 1; + + // Extended mode, copy masked part. + if (output) { + output._alloc(s); + + for (let i = 0; i < s; i++) + output.words[i] = this.words[i]; + + output.length = s; + } + + if (s === 0) ; else if (this.length > s) { + this.length -= s; + for (let i = 0; i < this.length; i++) + this.words[i] = this.words[i + s]; + } else { + this.words[0] = 0; + this.length = 1; + } + + let carry = 0; + + if (r !== 0) { + for (let i = this.length - 1; i >= 0; i--) { + const word = this.words[i] | 0; + + this.words[i] = (carry << (26 - r)) | (word >>> r); + + carry = word & mask; + } + } + + // Push carried bits as a mask. + if (output) { + if (carry !== 0) { + output._alloc(output.length + 1); + output.words[output.length++] = carry; + } else { + if (output.length === 0) + output.words[output.length++] = 0; + + output._strip(); + } + } + + return this._strip(); + } + + /* + * Right Shift + */ + + ishr(num) { + enforce(BN.isBN(num), 'bits', 'bignum'); + enforce(num.bitLength() <= 32, 'bits', 'uint32'); + return this.ishrn(num.toNumber()); + } + + ishrn(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + if (this.negative !== 0) { + // (-x) >> y == ~(x-1) >> y + // == ~((x-1) >> y) + // == -(((x-1) >> y) + 1) + this.iaddn(1); + this.iushrn(bits); + this.isubn(1); + return this; + } + + return this.iushrn(bits); + } + + shr(num) { + return this.clone().ishr(num); + } + + shrn(bits) { + return this.clone().ishrn(bits); + } + + /* + * Unsigned Right Shift + */ + + iushr(num) { + enforce(BN.isBN(num), 'bits', 'bignum'); + enforce(num.bitLength() <= 32, 'bits', 'uint32'); + return this.iushrn(num.toNumber()); + } + + iushrn(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + return this._split(bits, null); + } + + ushr(num) { + return this.clone().iushr(num); + } + + ushrn(bits) { + return this.clone().iushrn(bits); + } + + /* + * Bit Manipulation + */ + + setn(bit, val) { + enforce((bit >>> 0) === bit, 'bit', 'uint32'); + + if (this.negative !== 0) { + this.iaddn(1); + this.usetn(bit, !val); + this.isubn(1); + return this; + } + + return this.usetn(bit, val); + } + + usetn(bit, val) { + enforce((bit >>> 0) === bit, 'bit', 'uint32'); + + const r = bit % 26; + const s = (bit - r) / 26; + + this._expand(s + 1); + + if (val) + this.words[s] |= (1 << r); + else + this.words[s] &= ~(1 << r); + + return this._strip(); + } + + testn(bit) { + enforce((bit >>> 0) === bit, 'bit', 'uint32'); + + const r = bit % 26; + const s = (bit - r) / 26; + + // Fast case: bit is much higher than all existing words. + if (this.length <= s) + return this.negative; + + // Check bit and return. + const w = this.words[s]; + const val = (w >> r) & 1; + + if (this.negative !== 0) { + if (r > 0 && (w & ((1 << r) - 1))) + return val ^ 1; + + let j = s; + + while (j--) { + if (this.words[j] > 0) + return val ^ 1; + } + } + + return val; + } + + utestn(bit) { + enforce((bit >>> 0) === bit, 'bit', 'uint32'); + + const r = bit % 26; + const s = (bit - r) / 26; + + // Fast case: bit is much higher than all existing words. + if (this.length <= s) + return 0; + + // Check bit and return. + return (this.words[s] >> r) & 1; + } + + imaskn(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + if (this.negative !== 0) { + this.iaddn(1); + this.inotn(bits + 1); + this.ineg(); + } + + return this.iumaskn(bits); + } + + maskn(bits) { + return this.clone().imaskn(bits); + } + + iumaskn(bits) { + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + const r = bits % 26; + + let s = (bits - r) / 26; + + if (this.length <= s) + return this; + + if (r !== 0) + s += 1; + + this.length = Math.min(s, this.length); + + if (r !== 0) + this.words[this.length - 1] &= (1 << r) - 1; + + if (this.length === 0) + this.words[this.length++] = 0; + + return this._strip(); + } + + umaskn(bits) { + return this.clone().iumaskn(bits); + } + + andln(num) { + return this.words[0] & num; + } + + bit(pos) { + return this.utestn(pos); + } + + bits(pos, width) { + enforce((pos >>> 0) === pos, 'pos', 'uint32'); + enforce((width >>> 0) === width, 'width', 'uint32'); + enforce(width <= 26, 'width', 'width'); + + const shift = pos % 26; + const index = (pos - shift) / 26; + + if (index >= this.length) + return 0; + + let bits = (this.words[index] >> shift) & ((1 << width) - 1); + + if (shift + width > 26 && index + 1 < this.length) { + const more = shift + width - 26; + const next = this.words[index + 1] & ((1 << more) - 1); + + bits |= next << (26 - shift); + } + + return bits; + } + + /* + * Negation + */ + + ineg() { + if (!this.isZero()) + this.negative ^= 1; + + return this; + } + + neg() { + return this.clone().ineg(); + } + + iabs() { + this.negative = 0; + return this; + } + + abs() { + return this.clone().iabs(); + } + + /* + * Comparison + */ + + cmp(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.negative !== num.negative) + return num.negative - this.negative; + + const res = this.ucmp(num); + + if (this.negative !== 0) + return -res | 0; + + return res; + } + + cmpn(num) { + enforce(isSMI(num), 'num', 'smi'); + + const negative = (num < 0) | 0; + + if (this.negative !== negative) + return negative - this.negative; + + const res = this.ucmpn(num); + + if (this.negative !== 0) + return -res | 0; + + return res; + } + + eq(num) { + return this.cmp(num) === 0; + } + + eqn(num) { + return this.cmpn(num) === 0; + } + + gt(num) { + return this.cmp(num) > 0; + } + + gtn(num) { + return this.cmpn(num) > 0; + } + + gte(num) { + return this.cmp(num) >= 0; + } + + gten(num) { + return this.cmpn(num) >= 0; + } + + lt(num) { + return this.cmp(num) < 0; + } + + ltn(num) { + return this.cmpn(num) < 0; + } + + lte(num) { + return this.cmp(num) <= 0; + } + + lten(num) { + return this.cmpn(num) <= 0; + } + + sign() { + if (this.negative !== 0) + return -1; + + if (this.length === 1 && this.words[0] === 0) + return 0; + + return 1; + } + + isZero() { + return this.length === 1 && this.words[0] === 0; + } + + isNeg() { + return this.negative !== 0; + } + + isPos() { + return this.negative === 0; + } + + isOdd() { + return (this.words[0] & 1) === 1; + } + + isEven() { + return (this.words[0] & 1) === 0; + } + + /* + * Unsigned Comparison + */ + + ucmp(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.length < num.length) + return -1; + + if (this.length > num.length) + return 1; + + for (let i = this.length - 1; i >= 0; i--) { + const a = this.words[i] | 0; + const b = num.words[i] | 0; + + if (a === b) + continue; + + return (a > b) - (a < b); + } + + return 0; + } + + ucmpn(num) { + enforce(isSMI(num), 'num', 'smi'); + + if (this.length > 1) + return 1; + + const w = this.words[0] | 0; + + if (num < 0) + num = -num; + + return (w > num) - (w < num); + } + + /* + * Number Theoretic Functions + */ + + legendre(num) { + const red = HAS_BIGINT ? BN.red(num) : BN.mont(num); + return this.toRed(red).redLegendre(); + } + + jacobi(num) { + // See: A Binary Algorithm for the Jacobi Symbol + // J. Shallit, J. Sorenson + // Page 3, Section 3 + enforce(BN.isBN(num), 'num', 'bignum'); + + if (num.isZero() || num.isEven()) + throw new Error('jacobi: `num` must be odd.'); + + let a = this._cloneNormal(); + let b = num.clone(); + let j = 1; + + if (b.isNeg()) { + if (a.isNeg()) + j = -1; + b.ineg(); + } + + if (a.isNeg() || a.ucmp(b) >= 0) + a.imod(b); + + while (!a.isZero()) { + const bits = a._makeOdd(); + + if (bits & 1) { + const bmod8 = b.andln(7); + + if (bmod8 === 3 || bmod8 === 5) + j = -j; + } + + if (a.ucmp(b) < 0) { + [a, b] = [b, a]; + + if (a.andln(3) === 3 && b.andln(3) === 3) + j = -j; + } + + a._isub(a, b).iushrn(1); + + const bmod8 = b.andln(7); + + if (bmod8 === 3 || bmod8 === 5) + j = -j; + } + + if (b.cmpn(1) !== 0) + return 0; + + return j; + } + + kronecker(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.isZero()) + return num.ucmpn(1) === 0 ? 1 : 0; + + if (num.isZero()) + return this.ucmpn(1) === 0 ? 1 : 0; + + if (((this.words[0] | num.words[0]) & 1) === 0) + return 0; + + const x = this; + const y = num.clone(); + const bits = y._makeOdd(); + const table = [0, 1, 0, -1, 0, -1, 0, 1]; + + let k = x.jacobi(y); + + if (bits & 1) + k *= table[x.andln(7)]; + + return k | 0; + } + + igcd(num) { + return this.gcd(num)._move(this); + } + + gcd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.isZero()) + return num.abs(); + + if (num.isZero()) + return this.abs(); + + let a = this.clone(); + let b = num.clone(); + + a.negative = 0; + b.negative = 0; + + // Remove common factor of two. + const shift = a._factor2(b); + + if (shift !== 0) { + a.iushrn(shift); + b.iushrn(shift); + } + + for (;;) { + a._makeOdd(); + b._makeOdd(); + + const cmp = a.ucmp(b); + + if (cmp < 0) { + // a > b + [a, b] = [b, a]; + } else if (cmp === 0 || b.ucmpn(1) === 0) { + // Break if a == b. + // Break if b == 1 to avoid repeated subtraction. + break; + } + + a._isub(a, b); + } + + return b.iushln(shift); + } + + ilcm(num) { + return this.lcm(num)._move(this); + } + + lcm(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.isZero() || num.isZero()) + return new BN(0); + + return this.quo(this.gcd(num)).mul(num).iabs(); + } + + egcd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (this.isZero()) { + return [ + new BN(0), + new BN(num.sign()), + num.abs() + ]; + } + + if (num.isZero()) { + return [ + new BN(this.sign()), + new BN(0), + this.abs() + ]; + } + + const x = this.clone(); + const y = num.clone(); + + x.negative = 0; + y.negative = 0; + + // A * x + B * y = x + const A = new BN(1); + const B = new BN(0); + + // C * x + D * y = y + const C = new BN(0); + const D = new BN(1); + + // Remove common factor of two. + const g = x._factor2(y); + + if (g > 0) { + x.iushrn(g); + y.iushrn(g); + } + + const xp = x.clone(); + const yp = y.clone(); + + while (!x.isZero()) { + let i = x._makeOdd(); + let j = y._makeOdd(); + + while (i--) { + if (A.isOdd() || B.isOdd()) { + A.iadd(yp); + B.isub(xp); + } + + A.iushrn(1); + B.iushrn(1); + } + + while (j--) { + if (C.isOdd() || D.isOdd()) { + C.iadd(yp); + D.isub(xp); + } + + C.iushrn(1); + D.iushrn(1); + } + + if (x.cmp(y) >= 0) { + x.isub(y); + A.isub(C); + B.isub(D); + } else { + y.isub(x); + C.isub(A); + D.isub(B); + } + } + + if (this.negative !== 0) + C.ineg(); + + if (num.negative !== 0) + D.ineg(); + + return [C, D, y.iushln(g)]; + } + + iinvert(num) { + return this.invert(num)._move(this); + } + + invert(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + range(num.sign() > 0, 'invert'); + + if (num.isOdd()) + return this._invertp(num); + + if (num.cmpn(1) === 0) + throw new RangeError('Not invertible.'); + + const [s,, g] = this.egcd(num); + + if (g.cmpn(1) !== 0) + throw new RangeError('Not invertible.'); + + return s.imod(num); + } + + ifermat(num) { + return this.fermat(num)._move(this); + } + + fermat(num) { + const red = HAS_BIGINT ? BN.red(num) : BN.mont(num); + return this.toRed(red).redFermat().fromRed(); + } + + ipowm(y, m, mont) { + return this.powm(y, m, mont)._move(this); + } + + powm(y, m, mont) { + const red = !HAS_BIGINT && mont ? BN.mont(m) : BN.red(m); + return this.toRed(red).redPow(y).fromRed(); + } + + ipowmn(y, m, mont) { + return this.powmn(y, m, mont)._move(this); + } + + powmn(y, m, mont) { + const red = mont ? BN.mont(m) : BN.red(m); + return this.toRed(red).redPown(y).fromRed(); + } + + isqrtm(p) { + return this.sqrtm(p)._move(this); + } + + sqrtm(p) { + enforce(BN.isBN(p), 'p', 'bignum'); + + let red; + + if (p.andln(3) === 3 || p.andln(7) === 5) { + // Probably not worth the setup. + red = BN.red(p); + } else { + red = BN.mont(p); + } + + return this.toRed(red).redSqrt().fromRed(); + } + + isqrtpq(p, q) { + return this.sqrtpq(p, q)._move(this); + } + + sqrtpq(p, q) { + const sp = this.sqrtm(p); + const sq = this.sqrtm(q); + const [mp, mq] = p.egcd(q); + const lhs = sq.mul(mp).mul(p); + const rhs = sp.mul(mq).mul(q); + const n = p.mul(q); + + return lhs.iadd(rhs).imod(n); + } + + /* + * Primality Testing + */ + + isPrime(rng, reps, limit) { + enforce((reps >>> 0) === reps, 'reps', 'uint32'); + + if (!this.isPrimeMR(rng, reps + 1, true)) + return false; + + if (!this.isPrimeLucas(limit)) + return false; + + return true; + } + + isPrimeMR(rng, reps, force2 = false) { + enforce((reps >>> 0) === reps, 'reps', 'uint32'); + enforce(reps > 0, 'reps', 'integer'); + enforce(typeof force2 === 'boolean', 'force2', 'boolean'); + + const n = this; + + if (n.cmpn(7) < 0) { + return n.cmpn(2) === 0 + || n.cmpn(3) === 0 + || n.cmpn(5) === 0; + } + + if (n.isEven()) + return false; + + const nm1 = n.subn(1); + const nm3 = nm1.subn(2); + const k = nm1.zeroBits(); + const q = nm1.ushrn(k); + + const red = BN.red(n); + const rnm1 = nm1.toRed(red); + const rone = new BN(1).toRed(red); + + next: + for (let i = 0; i < reps; i++) { + let x; + + if (i === reps - 1 && force2) { + x = new BN(2); + } else { + x = BN.random(rng, 0, nm3); + x.iaddn(2); + } + + let y = x.toRed(red).redPow(q); + + if (y.cmp(rone) === 0 || y.cmp(rnm1) === 0) + continue; + + for (let j = 1; j < k; j++) { + y = y.redSqr(); + + if (y.cmp(rnm1) === 0) + continue next; + + if (y.cmp(rone) === 0) + return false; + } + + return false; + } + + return true; + } + + isPrimeLucas(limit = 0) { + enforce((limit >>> 0) === limit, 'limit', 'uint32'); + + const n = this; + + // Ignore 0 and 1. + if (n.cmpn(1) <= 0) + return false; + + // Two is the only even prime. + if (n.isEven()) + return n.cmpn(2) === 0; + + let p = 3; + + for (;;) { + if (p > 10000) { + // Thought to be impossible. + throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`); + } + + if (limit !== 0 && p > limit) { + // Optional DoS limit. + return false; + } + + const d = new BN(p * p - 4); + const j = d.jacobi(n); + + if (j === -1) + break; + + if (j === 0) + return n.cmpn(p + 2) === 0; + + if (p === 40) { + if (n.isSquare()) + return false; + } + + p += 1; + } + + const s = n.addn(1); + const r = s._makeOdd(); + + let vk = new BN(2); + let vk1 = new BN(p); + + for (let i = s.bitLength(); i >= 0; i--) { + if (s.utestn(i)) { + vk = vk.mul(vk1).isubn(p).imod(n); + vk1 = vk1.sqr().isubn(2).imod(n); + } else { + vk1 = vk1.mul(vk).isubn(p).imod(n); + vk = vk.sqr().isubn(2).imod(n); + } + } + + if (vk.cmpn(2) === 0 || vk.cmp(n.subn(2)) === 0) { + const a = vk.muln(p).imod(n); + const b = vk1.ushln(1).imod(n); + + if (a.cmp(b) === 0) + return true; + } + + for (let t = 0; t < r - 1; t++) { + if (vk.isZero()) + return true; + + if (vk.cmpn(2) === 0) + return false; + + vk = vk.sqr().isubn(2).imod(n); + } + + return false; + } + + /* + * Twos Complement + */ + + toTwos(width) { + if (this.negative !== 0) + return this.abs().inotn(width).iaddn(1); + + return this.clone(); + } + + fromTwos(width) { + enforce((width >>> 0) === width, 'width', 'uint32'); + range(width > 0, 'width'); + + if (this.testn(width - 1)) + return this.notn(width).iaddn(1).ineg(); + + return this.clone(); + } + + /* + * Reduction Context + */ + + toRed(ctx) { + enforce(ctx instanceof Red, 'ctx', 'reduction context'); + + if (this.red) + throw new Error('Already in reduction context.'); + + return ctx.convertTo(this); + } + + fromRed() { + red(this.red, 'fromRed'); + return this.red.convertFrom(this); + } + + forceRed(ctx) { + enforce(ctx instanceof Red, 'ctx', 'reduction context'); + + if (this.red) { + if (!ctx.m.eq(this.red.m) || ctx.mont !== this.red.mont) + throw new Error('Already in reduction context.'); + } else { + range(this.negative === 0, 'red'); + range(this.ucmp(ctx.m) < 0, 'red'); + } + + return this.clone()._forceRed(ctx); + } + + redIAdd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIAdd'); + return this.red.iadd(this, num); + } + + redAdd(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redAdd'); + return this.red.add(this, num); + } + + redIAddn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redIAddn'); + return this.red.iaddn(this, num); + } + + redAddn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redAddn'); + return this.red.addn(this, num); + } + + redISub(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redISub'); + return this.red.isub(this, num); + } + + redSub(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redSub'); + return this.red.sub(this, num); + } + + redISubn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redISubn'); + return this.red.isubn(this, num); + } + + redSubn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redSubn'); + return this.red.subn(this, num); + } + + redIMul(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIMul'); + return this.red.imul(this, num); + } + + redMul(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redMul'); + return this.red.mul(this, num); + } + + redIMuln(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redIMuln'); + return this.red.imuln(this, num); + } + + redMuln(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redMuln'); + return this.red.muln(this, num); + } + + redIDiv(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIDiv'); + return this.red.idiv(this, num); + } + + redDiv(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redDiv'); + return this.red.div(this, num); + } + + redIDivn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redIDivn'); + return this.red.idivn(this, num); + } + + redDivn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redDivn'); + return this.red.divn(this, num); + } + + redIPow(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIPow'); + nonred(!num.red, 'redIPow'); + return this.red.ipow(this, num); + } + + redPow(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redPow'); + nonred(!num.red, 'redPow'); + return this.red.pow(this, num); + } + + redIPown(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redIPown'); + return this.red.ipown(this, num); + } + + redPown(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redPown'); + return this.red.pown(this, num); + } + + redISqr() { + red(this.red, 'redISqr'); + return this.red.isqr(this); + } + + redSqr() { + red(this.red, 'redSqr'); + return this.red.sqr(this); + } + + redISqrt() { + red(this.red, 'redISqrt'); + return this.red.isqrt(this); + } + + redSqrt() { + red(this.red, 'redSqrt'); + return this.red.sqrt(this); + } + + redIDivSqrt(v) { + red(this.red, 'redIDivSqrt'); + return this.red.idivsqrt(this, v); + } + + redDivSqrt(v) { + red(this.red, 'redDivSqrt'); + return this.red.divsqrt(this, v); + } + + redIsSquare() { + red(this.red, 'redIsSquare'); + return this.red.isSquare(this); + } + + redIShl(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redIShl'); + nonred(!num.red, 'redIShl'); + return this.red.ishl(this, num); + } + + redShl(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redShl'); + nonred(!num.red, 'redShl'); + return this.red.shl(this, num); + } + + redIShln(num) { + enforce((num >>> 0) === num, 'num', 'uint32'); + red(this.red, 'redIShln'); + return this.red.ishln(this, num); + } + + redShln(num) { + enforce((num >>> 0) === num, 'num', 'uint32'); + red(this.red, 'redShln'); + return this.red.shln(this, num); + } + + redINeg() { + red(this.red, 'redINeg'); + return this.red.ineg(this); + } + + redNeg() { + red(this.red, 'redNeg'); + return this.red.neg(this); + } + + redEq(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + red(this.red, 'redEq'); + return this.red.eq(this, num); + } + + redEqn(num) { + enforce(isSMI(num), 'num', 'smi'); + red(this.red, 'redEqn'); + return this.red.eqn(this, num); + } + + redIsHigh() { + red(this.red, 'redIsHigh'); + return this.red.isHigh(this); + } + + redIsLow() { + red(this.red, 'redIsLow'); + return this.red.isLow(this); + } + + redIsOdd() { + red(this.red, 'redIsOdd'); + return this.red.isOdd(this); + } + + redIsEven() { + red(this.red, 'redIsEven'); + return this.red.isEven(this); + } + + redLegendre() { + red(this.red, 'redLegendre'); + return this.red.legendre(this); + } + + redJacobi() { + red(this.red, 'redJacobi'); + return this.red.jacobi(this); + } + + redKronecker() { + red(this.red, 'redKronecker'); + return this.red.kronecker(this); + } + + redIInvert() { + red(this.red, 'redIInvert'); + return this.red.iinvert(this); + } + + redInvert() { + red(this.red, 'redInvert'); + return this.red.invert(this); + } + + redIFermat() { + red(this.red, 'redIFermat'); + return this.red.ifermat(this); + } + + redFermat() { + red(this.red, 'redFermat'); + return this.red.fermat(this); + } + + /* + * Internal + */ + + _move(dest) { + dest.words = this.words; + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + return dest; + } + + _alloc(size) { + while (this.words.length < size) + this.words.push(0); + + return this; + } + + _expand(size) { + this._alloc(size); + + while (this.length < size) + this.words[this.length++] = 0; + + return this; + } + + _strip() { + while (this.length > 1 && this.words[this.length - 1] === 0) + this.length -= 1; + + return this._normalize(); + } + + _normalize() { + assert(this.length > 0); + + // -0 = 0 + if (this.length === 1 && this.words[0] === 0) + this.negative = 0; + + return this; + } + + _check() { + // We never have a zero length number. + assert(this.length > 0); + + // Cannot exceed array bounds. + assert(this.length <= this.words.length); + + if (this.length === 1) { + // Must be normalized. + if (this.words[0] === 0) + assert(this.negative === 0); + return this; + } + + // Must be stripped. + assert(this.words[this.length - 1] !== 0); + + return this; + } + + _invertp(p) { + // Penk's right shift binary EGCD. + // + // See: The Art of Computer Programming, + // Volume 2, Seminumerical Algorithms + // Donald E. Knuth + // Exercise 4.5.2.39 + enforce(BN.isBN(p), 'p', 'bignum'); + range(p.sign() > 0, 'invert'); + assert(p.isOdd()); + + if (p.cmpn(1) === 0) + throw new RangeError('Not invertible.'); + + const a = this.clone(); + const b = p.clone(); + const u = new BN(1); + const v = new BN(0); + + if (a.isNeg() || a.ucmp(b) >= 0) + a.imod(b); + + while (!a.isZero()) { + let i = a._makeOdd(); + let j = b._makeOdd(); + + while (i--) { + if (u.isOdd()) + u._iadd(u, p); + + u.iushrn(1); + } + + while (j--) { + if (v.isOdd()) + v._iadd(v, p); + + v.iushrn(1); + } + + if (a.ucmp(b) >= 0) { + a._isub(a, b); + if (u.ucmp(v) < 0) { + u._isub(v, u); + u._isub(p, u); + } else { + u._isub(u, v); + } + } else { + b._isub(b, a); + if (v.ucmp(u) < 0) { + v._isub(u, v); + v._isub(p, v); + } else { + v._isub(v, u); + } + } + } + + if (b.cmpn(1) !== 0) + throw new RangeError('Not invertible.'); + + assert(v.negative === 0); + assert(v.ucmp(p) < 0); + + return v; + } + + _makeOdd() { + const shift = this.zeroBits(); + + if (shift > 0) + this.iushrn(shift); + + return shift; + } + + _factor2(num) { + // Find common factor of two. + // Expects inputs to be non-zero. + if ((this.words[0] | num.words[0]) & 1) + return 0; + + const len = Math.min(this.length, num.length); + + let r = 0; + + for (let i = 0; i < len; i++) { + const b = zeroBits(this.words[i] | num.words[i]); + + r += b; + + if (b !== 26) + break; + } + + return r; + } + + _cloneNormal() { + return this.red ? this.fromRed() : this.clone(); + } + + _forceRed(ctx) { + this.red = ctx; + return this; + } + + /* + * Helpers + */ + + clone() { + const copy = new BN(); + + copy.words = new Array(this.length); + + for (let i = 0; i < this.length; i++) + copy.words[i] = this.words[i]; + + copy.length = this.length; + copy.negative = this.negative; + copy.red = this.red; + + return copy; + } + + inject(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + this._alloc(num.length); + + for (let i = 0; i < num.length; i++) + this.words[i] = num.words[i]; + + this.length = num.length; + this.negative = num.negative; + this.red = num.red; + + return this; + } + + set(num, endian) { + return this.fromNumber(num, endian); + } + + swap(num) { + enforce(BN.isBN(num), 'num', 'bignum'); + + const x = this; + const y = num; + + [x.words, y.words] = [y.words, x.words]; + [x.length, y.length] = [y.length, x.length]; + [x.negative, y.negative] = [y.negative, x.negative]; + [x.red, y.red] = [y.red, x.red]; + + return x; + } + + reverse() { + const neg = this.negative; + + this.fromBuffer(this.toBuffer('be'), 'le'); + this.negative = neg; + + return this; + } + + byteLength() { + return Math.ceil(this.bitLength() / 8); + } + + bitLength() { + const w = this.words[this.length - 1]; + const hi = countBits(w); + return (this.length - 1) * 26 + hi; + } + + zeroBits() { + if (this.isZero()) + return 0; + + if (this.isOdd()) + return 0; + + let r = 0; + + for (let i = 0; i < this.length; i++) { + const b = zeroBits(this.words[i]); + + r += b; + + if (b !== 26) + break; + } + + return r; + } + + isSafe() { + if (this.length <= 2) + return true; + + if (this.length === 3 && this.words[2] === 0x01) + return true; + + return false; + } + + word(pos) { + enforce((pos >>> 0) === pos, 'pos', 'uint32'); + + if (pos >= this.length) + return 0; + + return this.words[pos]; + } + + [custom]() { + let prefix = 'BN'; + + if (this.red) + prefix = 'BN-R'; + + return `<${prefix}: ${this.toString(10)}>`; + } + + /* + * Conversion + */ + + toNumber() { + let num = this.words[0]; + + if (this.length === 2) { + num += this.words[1] * 0x4000000; + } else if (this.length === 3 && this.words[2] === 0x01) { + // Note: at this stage it is known that the top bit is set. + num += 0x10000000000000 + (this.words[1] * 0x4000000); + } else if (this.length > 2) { + throw new RangeError('Number can only safely store up to 53 bits.'); + } + + return this.negative !== 0 ? -num : num; + } + + toDouble() { + let num = 0; + + for (let i = this.length - 1; i >= 0; i--) + num = (num * 0x4000000) + this.words[i]; + + return this.negative !== 0 ? -num : num; + } + + valueOf() { + return this.toDouble(); + } + + toBigInt() { + if (!HAS_BIGINT) + throw new Error('BigInt is not supported!'); + + const s52 = BigInt(52); + const s26 = BigInt(26); + + let i = this.length - 1; + let num = BigInt(0); + + for (; i >= 1; i -= 2) { + const hi = this.words[i] * 0x4000000; + const lo = this.words[i - 1]; + + num = (num << s52) | BigInt(hi + lo); + } + + if (i >= 0) + num = (num << s26) | BigInt(this.words[0]); + + return this.negative !== 0 ? -num : num; + } + + toBool() { + return !this.isZero(); + } + + toString(base, padding) { + base = getBase(base); + + if (padding == null) + padding = 0; + + if (padding === 0) + padding = 1; + + enforce((base >>> 0) === base, 'base', 'uint32'); + enforce((padding >>> 0) === padding, 'padding', 'uint32'); + + if (base < 2 || base > 36) + throw new RangeError('Base ranges between 2 and 36.'); + + this._check(); + + if (base === 16) { + let out = ''; + let off = 0; + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const w = this.words[i]; + const word = (((w << off) | carry) & 0xffffff).toString(16); + + carry = (w >>> (24 - off)) & 0xffffff; + + if (carry !== 0 || i !== this.length - 1) + out = zeros[6 - word.length] + word + out; + else + out = word + out; + + off += 2; + + if (off >= 26) { + off -= 26; + i -= 1; + } + } + + if (carry !== 0) + out = carry.toString(16) + out; + + while (out.length % padding !== 0) + out = '0' + out; + + if (this.negative !== 0) + out = '-' + out; + + return out; + } + + const groupSize = groupSizes[base - 1]; + const groupBase = groupBases[base - 1]; + const c = this.clone(); + + let out = ''; + + c.negative = 0; + + while (!c.isZero()) { + const r = c.remrn(groupBase).toString(base); + + c.iquon(groupBase); + + if (!c.isZero()) + out = zeros[groupSize - r.length] + r + out; + else + out = r + out; + } + + if (this.isZero()) + out = '0'; + + while (out.length % padding !== 0) + out = '0' + out; + + if (this.negative !== 0) + out = '-' + out; + + return out; + } + + toJSON() { + return this.toString(16, 2); + } + + toArray(endian, length) { + return this.toArrayLike(Array, endian, length); + } + + toBuffer(endian, length) { + return this.toArrayLike(bufferExports.Buffer, endian, length); + } + + toArrayLike(ArrayType, endian, length) { + if (endian == null) + endian = 'be'; + + if (length == null) + length = 0; + + enforce(typeof ArrayType === 'function', 'ArrayType', 'function'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + enforce((length >>> 0) === length, 'length', 'uint32'); + + this._check(); + + const bytes = this.byteLength(); + const size = length || Math.max(1, bytes); + + if (bytes > size) + throw new RangeError('Byte array longer than desired length.'); + + const res = allocate(ArrayType, size); + + // See: https://github.com/indutny/bn.js/pull/222 + if (endian === 'be') { + let pos = res.length - 1; + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const shift = (i & 3) << 1; + const word = (this.words[i] << shift) | carry; + + res[pos--] = word & 0xff; + + if (pos >= 0) + res[pos--] = (word >>> 8) & 0xff; + + if (pos >= 0) + res[pos--] = (word >>> 16) & 0xff; + + if (shift === 6) { + if (pos >= 0) + res[pos--] = (word >>> 24) & 0xff; + + carry = 0; + } else { + carry = word >>> 24; + } + } + + if (pos >= 0) { + res[pos--] = carry; + + while (pos >= 0) + res[pos--] = 0; + + carry = 0; + } + + assert(carry === 0); + } else { + let pos = 0; + let carry = 0; + + for (let i = 0; i < this.length; i++) { + const shift = (i & 3) << 1; + const word = (this.words[i] << shift) | carry; + + res[pos++] = word & 0xff; + + if (pos < res.length) + res[pos++] = (word >>> 8) & 0xff; + + if (pos < res.length) + res[pos++] = (word >>> 16) & 0xff; + + if (shift === 6) { + if (pos < res.length) + res[pos++] = (word >>> 24) & 0xff; + + carry = 0; + } else { + carry = word >>> 24; + } + } + + if (pos < res.length) { + res[pos++] = carry; + + while (pos < res.length) + res[pos++] = 0; + + carry = 0; + } + + assert(carry === 0); + } + + return res; + } + + encode(endian, length) { + return this.toBuffer(endian, length); + } + + /* + * Instantiation + */ + + of(num, endian) { + return this.fromNumber(num, endian); + } + + fromNumber(num, endian) { + if (endian == null) + endian = 'be'; + + enforce(isInteger(num), 'num', 'integer'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + const neg = (num < 0) | 0; + + if (neg) + num = -num; + + if (num < 0x4000000) { + this.words[0] = num & 0x3ffffff; + this.length = 1; + } else if (num < 0x10000000000000) { + this.words = [ + num & 0x3ffffff, + (num / 0x4000000) & 0x3ffffff + ]; + this.length = 2; + } else { + this.words = [ + num & 0x3ffffff, + (num / 0x4000000) & 0x3ffffff, + 1 + ]; + this.length = 3; + } + + this.negative = neg; + + if (endian === 'le') + this.reverse(); + + return this; + } + + fromDouble(num, endian) { + if (endian == null) + endian = 'be'; + + enforce(typeof num === 'number', 'num', 'double'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + if (!isFinite(num)) + num = 0; + + const neg = (num <= -1) | 0; + + if (num < 0) + num = -num; + + num = Math.floor(num); + + this.words = []; + + while (num > 0) { + const lo = num % 0x4000000; + const hi = (num - lo) / 0x4000000; + + this.words.push(lo); + + num = hi; + } + + if (this.words.length === 0) + this.words.push(0); + + this.length = this.words.length; + this.negative = neg; + + if (endian === 'le') + this.reverse(); + + return this; + } + + fromBigInt(num, endian) { + if (endian == null) + endian = 'be'; + + enforce(typeof num === 'bigint', 'num', 'bigint'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + if (!HAS_BIGINT) + throw new Error('BigInt is not supported!'); + + // You know the implementation has a + // problem when strings are twice + // as fast as bigints. + const start = (num < BigInt(0)) | 0; + + this._fromHex(num.toString(16), start); + this.negative = start; + + if (endian === 'le') + this.reverse(); + + return this; + } + + fromBool(value) { + enforce(typeof value === 'boolean', 'value', 'boolean'); + + this.words[0] = value | 0; + this.length = 1; + this.negative = 0; + + return this; + } + + fromString(str, base, endian) { + if (base === 'le' || base === 'be') + [base, endian] = [endian, base]; + + base = getBase(base); + + if (endian == null) + endian = 'be'; + + enforce(typeof str === 'string', 'string', 'string'); + enforce((base >>> 0) === base, 'base', 'uint32'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + if (base < 2 || base > 36) + throw new Error('Base ranges between 2 and 36.'); + + str = str.replace(/\s+/g, ''); + + let start = 0; + + if (str.length > 0 && str.charCodeAt(0) === 0x2d) + start = 1; + + if (base === 16) + this._fromHex(str, start); + else + this._fromBase(str, base, start); + + this.negative = start; + + this._normalize(); + + if (endian === 'le') + this.reverse(); + + return this; + } + + _fromHex(str, start) { + this.length = Math.max(2, Math.ceil((str.length - start) / 6)); + this.words = new Array(this.length); + + for (let i = 0; i < this.length; i++) + this.words[i] = 0; + + // Scan 24-bit chunks and add them to the number. + let off = 0; + let i = str.length - 6; + let j = 0; + + for (; i >= start; i -= 6) { + const w = parseHex(str, i, i + 6); + + this.words[j] |= (w << off) & 0x3ffffff; + + // `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb. + this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff; + + off += 24; + + if (off >= 26) { + off -= 26; + j += 1; + } + } + + if (i + 6 !== start) { + const w = parseHex(str, start, i + 6); + + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff; + } + + return this._strip(); + } + + _fromBase(str, base, start) { + // Initialize as zero. + this.words[0] = 0; + this.length = 1; + this.negative = 0; + + // Find length of limb in base. + let limbLen = 0; + let limbPow = 1; + + for (; limbPow <= 0x3ffffff; limbPow *= base) + limbLen += 1; + + limbLen -= 1; + limbPow = (limbPow / base) | 0; + + const total = str.length - start; + const mod = total % limbLen; + const end = Math.min(total, total - mod) + start; + + let i = start; + + for (; i < end; i += limbLen) { + const word = parseBase(str, i, i + limbLen, base); + + this.imuln(limbPow); + this._iaddn(word); + } + + if (mod !== 0) { + const pow = Math.pow(base, mod); + const word = parseBase(str, i, str.length, base); + + this.imuln(pow); + this._iaddn(word); + } + + return this; + } + + fromJSON(json) { + if (BN.isBN(json)) { + if (json.red) + return json.fromRed(); + + return json.clone(); + } + + if (Array.isArray(json)) { + for (const chunk of json) + enforce(typeof chunk === 'string', 'chunk', 'string'); + + json = json.join(''); + } + + return this.fromString(json, 16); + } + + fromBN(num) { + return this.inject(num); + } + + fromArray(data, endian) { + enforce(Array.isArray(data), 'data', 'array'); + return this.fromArrayLike(data, endian); + } + + fromBuffer(data, endian) { + enforce(bufferExports.Buffer.isBuffer(data), 'data', 'buffer'); + return this.fromArrayLike(data, endian); + } + + fromArrayLike(data, endian) { + if (endian == null) + endian = 'be'; + + enforce(data && (data.length >>> 0) === data.length, 'data', 'array-like'); + enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); + + if (data.length === 0) { + this.words[0] = 0; + this.length = 1; + this.negative = 0; + return this; + } + + this.length = Math.max(2, Math.ceil(data.length / 3)); + this.words = new Array(this.length); + this.negative = 0; + + for (let i = 0; i < this.length; i++) + this.words[i] = 0; + + const left = data.length % 3; + + let off = 0; + let j = 0; + let w = 0; + + if (endian === 'be') { + for (let i = data.length - 1; i >= 2; i -= 3) { + const w = data[i] | (data[i - 1] << 8) | (data[i - 2] << 16); + + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + + off += 24; + + if (off >= 26) { + off -= 26; + j += 1; + } + } + + switch (left) { + case 2: + w = data[1] | (data[0] << 8); + break; + case 1: + w = data[0]; + break; + } + } else { + const len = data.length - left; + + for (let i = 0; i < len; i += 3) { + const w = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16); + + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + + off += 24; + + if (off >= 26) { + off -= 26; + j += 1; + } + } + + switch (left) { + case 2: + w = data[len] | (data[len + 1] << 8); + break; + case 1: + w = data[len]; + break; + } + } + + if (left > 0) { + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + } + + return this._strip(); + } + + decode(data, endian) { + return this.fromBuffer(data, endian); + } + + from(num, base, endian) { + if (num == null) + return this; + + if (base === 'le' || base === 'be') + [base, endian] = [endian, base]; + + if (typeof num === 'number') + return this.fromNumber(num, endian); + + if (typeof num === 'bigint') + return this.fromBigInt(num, endian); + + if (typeof num === 'string') + return this.fromString(num, base, endian); + + if (typeof num === 'object') { + if (BN.isBN(num)) + return this.fromBN(num, endian); + + if ((num.length >>> 0) === num.length) + return this.fromArrayLike(num, endian); + } + + if (typeof num === 'boolean') + return this.fromBool(num); + + throw new TypeError('Non-numeric object passed to BN.'); + } + + /* + * Static Methods + */ + + static min(...args) { + let min = null; + + for (const num of args) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (!min || num.cmp(min) < 0) + min = num; + } + + return min || new BN(0); + } + + static max(...args) { + let max = null; + + for (const num of args) { + enforce(BN.isBN(num), 'num', 'bignum'); + + if (!max || num.cmp(max) > 0) + max = num; + } + + return max || new BN(0); + } + + static cmp(a, b) { + enforce(BN.isBN(a), 'a', 'bignum'); + return a.cmp(b); + } + + static ucmp(a, b) { + enforce(BN.isBN(a), 'a', 'bignum'); + return a.ucmp(b); + } + + static red(num) { + return new Red(num); + } + + static barrett(num) { + return new Barrett(num); + } + + static mont(num) { + return new Mont(num); + } + + static _prime(name) { + if (primes[name]) + return primes[name]; + + let prime; + + if (name === 'p192') + prime = new P192(); + else if (name === 'p224') + prime = new P224(); + else if (name === 'p521') + prime = new P521(); + else if (name === 'k256') + prime = new K256(); + else if (name === 'p251') + prime = new P251(); + else if (name === 'p25519') + prime = new P25519(); + else if (name === 'p448') + prime = new P448(); + else + throw new Error(`Unknown prime: "${name}".`); + + primes[name] = prime; + + return prime; + } + + static prime(name) { + return BN._prime(name).p.clone(); + } + + static pow(num, exp) { + if (num === 2) + return BN.shift(1, exp); + + return new BN().fromNumber(num).pown(exp); + } + + static shift(num, bits) { + if (num === 1) + return new BN(0).usetn(bits, 1); + + return new BN().fromNumber(num).ishln(bits); + } + + static mask(bits) { + return BN.shift(1, bits).isubn(1); + } + + static randomBits(rng, bits) { + enforce(rng != null, 'rng', 'rng'); + enforce((bits >>> 0) === bits, 'bits', 'uint32'); + + if (typeof rng === 'object') { + enforce(typeof rng.randomBytes === 'function', 'rng', 'rng'); + + const size = (bits + 7) >>> 3; + const total = size * 8; + const bytes = rng.randomBytes(size); + + enforce(bufferExports.Buffer.isBuffer(bytes), 'bytes', 'buffer'); + + if (bytes.length !== size) + throw new RangeError('Invalid number of bytes returned from RNG.'); + + const num = BN.fromBuffer(bytes); + + if (total > bits) + num.iushrn(total - bits); + + return num; + } + + enforce(typeof rng === 'function', 'rng', 'rng'); + + const num = rng(bits); + + enforce(BN.isBN(num), 'num', 'bignum'); + range(num.negative === 0, 'RNG'); + nonred(!num.red, 'RNG'); + + if (num.bitLength() > bits) + throw new RangeError('Invalid number of bits returned from RNG.'); + + return num; + } + + static random(rng, min, max) { + min = BN.cast(min, 16); + max = BN.cast(max, 16); + + if (min.cmp(max) > 0) + throw new RangeError('Minimum cannot be greater than maximum.'); + + const space = max.sub(min).iabs(); + const bits = space.bitLength(); + + if (bits === 0) + return min.clone(); + + for (;;) { + const num = BN.randomBits(rng, bits); + + // Maximum is _exclusive_! + if (num.cmp(space) >= 0) + continue; + + // Minimum is _inclusive_! + num.iadd(min); + + return num; + } + } + + static of(num, endian) { + return new BN().of(num, endian); + } + + static fromNumber(num, endian) { + return new BN().fromNumber(num, endian); + } + + static fromDouble(num, endian) { + return new BN().fromDouble(num, endian); + } + + static fromBigInt(num, endian) { + return new BN().fromBigInt(num, endian); + } + + static fromBool(value) { + return new BN().fromBool(value); + } + + static fromString(str, base, endian) { + return new BN().fromString(str, base, endian); + } + + static fromJSON(json) { + return new BN().fromJSON(json); + } + + static fromBN(num) { + return new BN().fromBN(num); + } + + static fromArray(data, endian) { + return new BN().fromArray(data, endian); + } + + static fromBuffer(data, endian) { + return new BN().fromBuffer(data, endian); + } + + static fromArrayLike(data, endian) { + return new BN().fromArrayLike(data, endian); + } + + static decode(data, endian) { + return new BN().decode(data, endian); + } + + static from(num, base, endian) { + return new BN().from(num, base, endian); + } + + static cast(num, base, endian) { + if (BN.isBN(num)) + return num; + + return new BN(num, base, endian); + } + + static isBN(obj) { + return obj instanceof BN; + } + } + + /* + * Static + */ + + BN.BN = BN; + BN.wordSize = 26; + BN.native = 0; + + /** + * Prime + */ + + class Prime { + constructor(name, p) { + // P = 2^N - K + this.name = name; + this.p = new BN(p, 16); + this.n = this.p.bitLength(); + this.k = BN.shift(1, this.n).isub(this.p); + this.lo = this.p.clone(); + this.one = this.p.clone(); + } + + ireduce(num) { + // Assumes that `num` is less than `P^2`: + // num = HI * (2^N - K) + HI * K + LO = HI * K + LO (mod P) + const neg = num.negative !== 0; + + // Track bits. + let bits = num.bitLength(); + + // Must be less than P^2. + assert(bits <= this.n * 2); + + // Ensure positive. + num.negative = 0; + + // Reduce. + while (bits > this.n) { + // lo = num & ((1 << n) - 1) + // num = num >> n + this.split(num, this.lo); + + // num = num * K + this.imulK(num); + + // num = num + lo + num._iadd(num, this.lo); + + // bits = bitlen(num) + bits = num.bitLength(); + } + + // Final reduction. + const cmp = bits < this.n ? -1 : num.ucmp(this.p); + + if (cmp === 0) { + num.words[0] = 0; + num.length = 1; + } else if (cmp > 0) { + num._isub(num, this.p); + } else ; + + // Adjust sign. + if (neg && !num.isZero()) + num._isub(this.p, num); + + return num; + } + + split(input, out) { + input._split(this.n, out); + } + + imulK(num) { + return num.imul(this.k); + } + + pm2(x1) { + // Exponent: p - 2 + throw new Error('Not implemented.'); + } + + fermat(x) { + return this.pm2(x); + } + } + + /** + * Prime (3 mod 4) + */ + + class Prime34 extends Prime { + constructor(name, p) { + super(name, p); + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + throw new Error('Not implemented.'); + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + throw new Error('Not implemented.'); + } + + sqrt(x) { + // r = x^((p + 1) / 4) mod p + const {red} = x; + const r = this.pp1d4(x); + + if (!red.sqr(r).eq(x)) + throw new SquareRootError(r); + + return r; + } + + divsqrt(u, v) { + // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p + const {red} = u; + const u2 = red.sqr(u); + const u3 = red.mul(u2, u); + const u5 = red.mul(u3, u2); + const v3 = red.mul(red.sqr(v), v); + const p = this.pm3d4(red.mul(u5, v3)); + const x = red.mul(red.mul(u3, v), p); + const c = red.mul(v, red.sqr(x)); + + if (c.eq(u)) + return x; + + throw new SquareRootError(x); + } + } + + /** + * Prime (5 mod 8) + */ + + class Prime58 extends Prime { + constructor(name, p, sm1) { + super(name, p); + + this.sm1 = new BN(sm1, 16); + } + + pm5d8(x1) { + // Exponent: (p - 5) / 8 + throw new Error('Not implemented.'); + } + + pp3d8(x1) { + // Exponent: (p + 3) / 8 + throw new Error('Not implemented.'); + } + + sqrt(x) { + // r = x^((p + 3) / 8) mod p + const {red} = x; + const sm1 = this.sm1._forceRed(red); + const r = this.pp3d8(x); + + if (red.sqr(r).eq(x)) + return r; + + const c = red.mul(r, sm1); + + if (red.sqr(c).eq(x)) + return c; + + throw new SquareRootError(r); + } + + divsqrt(u, v) { + // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p + const {red} = u; + const sm1 = this.sm1._forceRed(red); + const v3 = red.mul(red.sqr(v), v); + const v7 = red.mul(red.sqr(v3), v); + const p = this.pm5d8(red.mul(u, v7)); + const x = red.mul(red.mul(u, v3), p); + const c = red.mul(v, red.sqr(x)); + + if (c.eq(u)) + return x; + + const mc = red.ineg(c); + + if (mc.eq(u)) + return red.mul(x, sm1); + + if (mc.eq(red.mul(u, sm1))) + throw new SquareRootError(red.mul(x, sm1)); + + throw new SquareRootError(x); + } + } + + /** + * Prime (1 mod 16) + */ + + class Prime116 extends Prime { + constructor(name, p, g) { + super(name, p); + + this.g = new BN(g, 16); + this.z = this.p.subn(1).zeroBits(); + } + + powS(x1) { + // Exponent: (p - 1) / 2^k + throw new Error('Not implemented.'); + } + + powE(x1) { + // Exponent: (s + 1) / 2 + throw new Error('Not implemented.'); + } + + sqrt(x) { + // Tonelli-Shanks (variable time). + // + // Constants: + // + // k = factors of 2 for (p - 1) + // s = (p - 1) / 2^k + // e = (s + 1) / 2 + // n = first non-square in F(p) + // + // Algorithm: + // + // g = n^s mod p + // y = x^e mod p + // b = x^s mod p + // + // loop: + // t = b + // m = 0 + // + // while t != 1: + // t = t^2 mod p + // m += 1 + // + // if m == 0: + // break + // + // if m >= k: + // fail + // + // t = g^(2^(k - m - 1)) mod p + // g = t^2 mod p + // y = y * t mod p + // b = b * g mod p + // k = m + // + // return y + // + const {red} = x; + + switch (red.jacobi(x)) { + case -1: + throw new SquareRootError(x); + case 0: + return x.clone(); + } + + let g = this.g._forceRed(red); + let y = this.powE(x); + let b = this.powS(x); + let k = this.z; + + for (;;) { + let t = b; + let m = 0; + + while (t.cmpn(1) !== 0 && m < k) { + t = red.sqr(t); + m += 1; + } + + if (m === 0) + break; + + assert(m < k); + + t = red.sqrn(g, k - m - 1); + g = red.sqr(t); + y = red.mul(y, t); + b = red.mul(b, g); + k = m; + } + + return y; + } + + divsqrt(u, v) { + const {red} = u; + + if (v.isZero()) + throw new SquareRootError(v); + + return this.sqrt(red.div(u, v)); + } + } + + /** + * P192 + */ + + class P192 extends Prime34 { + constructor() { + // 2^192 - 2^64 - 1 (= 3 mod 4) + super('p192', 'ffffffff ffffffff ffffffff fffffffe' + + 'ffffffff ffffffff'); + } + + imulK(num) { + // K = 0x10000000000000001 + // K = 2^64 + 1 + const one = this.one.inject(num); + return num.iushln(64)._iadd(num, one); + } + + core(x1) { + // Exponent: (p - 3) / 4 + // Bits: 127x1 1x0 62x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x12 = red.sqrnmul(x6, 6, x6); + const x24 = red.sqrnmul(x12, 12, x12); + const x30 = red.sqrnmul(x24, 6, x6); + const x31 = red.sqrnmul(x30, 1, x1); + const x62 = red.sqrnmul(x31, 31, x31); + const x124 = red.sqrnmul(x62, 62, x62); + const x127 = red.sqrnmul(x124, 3, x3); + const r0 = red.sqrn(x127, 1); + const r1 = red.sqrnmul(r0, 62, x62); + + return r1; + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + // Bits: 127x1 1x0 62x1 + return this.core(x1); + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 127x1 1x0 62x1 1x0 1x1 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 128x1 62x0 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x4 = red.sqrnmul(x2, 2, x2); + const x8 = red.sqrnmul(x4, 4, x4); + const x16 = red.sqrnmul(x8, 8, x8); + const x32 = red.sqrnmul(x16, 16, x16); + const x64 = red.sqrnmul(x32, 32, x32); + const x128 = red.sqrnmul(x64, 64, x64); + const r0 = red.sqrn(x128, 62); + + return r0; + } + } + + /** + * P224 + */ + + class P224 extends Prime116 { + constructor() { + // 2^224 - 2^96 + 1 (1 mod 16) + super('p224', 'ffffffff ffffffff ffffffff ffffffff' + + '00000000 00000000 00000001', + '6a0fec67 8598a792 0c55b2d4 0b2d6ffb' + + 'bea3d8ce f3fb3632 dc691b74'); + } + + imulK(num) { + // K = 0xffffffffffffffffffffffff + // K = 2^96 - 1 + const one = this.one.inject(num); + return num.iushln(96)._isub(num, one); + } + + powS(x1) { + // Exponent: 2^128 - 1 + // Bits: 128x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x4 = red.sqrnmul(x2, 2, x2); + const x8 = red.sqrnmul(x4, 4, x4); + const x16 = red.sqrnmul(x8, 8, x8); + const x32 = red.sqrnmul(x16, 16, x16); + const x64 = red.sqrnmul(x32, 32, x32); + const x128 = red.sqrnmul(x64, 64, x64); + + return x128; + } + + powE(x1) { + // Exponent: 2^127 + // Bits: 1x1 127x0 + const {red} = x1; + const r0 = red.sqrn(x1, 127); + + return r0; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 127x1 1x0 96x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x12 = red.sqrnmul(x6, 6, x6); + const x24 = red.sqrnmul(x12, 12, x12); + const x48 = red.sqrnmul(x24, 24, x24); + const x96 = red.sqrnmul(x48, 48, x48); + const x120 = red.sqrnmul(x96, 24, x24); + const x126 = red.sqrnmul(x120, 6, x6); + const x127 = red.sqrnmul(x126, 1, x1); + const r0 = red.sqrn(x127, 1); + const r1 = red.sqrnmul(r0, 96, x96); + + return r1; + } + } + + /** + * P521 + */ + + class P521 extends Prime34 { + constructor() { + // 2^521 - 1 (= 3 mod 4) + super('p521', '000001ff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff'); + } + + imulK(num) { + // K = 0x01 + return num; + } + + core(x1) { + // Exponent: 2^519 - 1 + // Bits: 519x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x7 = red.sqrnmul(x6, 1, x1); + const x8 = red.sqrnmul(x7, 1, x1); + const x16 = red.sqrnmul(x8, 8, x8); + const x32 = red.sqrnmul(x16, 16, x16); + const x64 = red.sqrnmul(x32, 32, x32); + const x128 = red.sqrnmul(x64, 64, x64); + const x256 = red.sqrnmul(x128, 128, x128); + const x512 = red.sqrnmul(x256, 256, x256); + const x519 = red.sqrnmul(x512, 7, x7); + + return x519; + } + + pm3d4(x1) { + // Exponent: 2^519 - 1 + // Bits: 519x1 + return this.core(x1); + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 519x1 1x0 1x1 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 1x1 519x0 + const {red} = x1; + const r0 = red.sqrn(x1, 519); + + return r0; + } + } + + /** + * K256 + */ + + class K256 extends Prime34 { + constructor() { + // 2^256 - 2^32 - 977 (= 3 mod 4) + super('k256', 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff fffffffe fffffc2f'); + } + + split(input, output) { + // 256 = 9 * 26 + 22 + const mask = 0x3fffff; + const len = Math.min(input.length, 9); + + output._alloc(len + 1); + + for (let i = 0; i < len; i++) + output.words[i] = input.words[i]; + + output.length = len; + + if (input.length <= 9) { + output._strip(); + input.words[0] = 0; + input.length = 1; + return; + } + + // Shift by 9 limbs. + let prev = input.words[9]; + let i = 10; + + output.words[output.length++] = prev & mask; + output._strip(); + + for (; i < input.length; i++) { + const next = input.words[i] | 0; + + input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); + + prev = next; + } + + prev >>>= 22; + + input.words[i - 10] = prev; + + if (prev === 0 && input.length > 10) + input.length -= 10; + else + input.length -= 9; + + input._strip(); // Unsure if we need this. + } + + imulK(num) { + // K = 0x1000003d1 = [0x40, 0x3d1] + // K = 2^32 + 977 + num._expand(num.length + 2); + + // Bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 + let lo = 0; + + for (let i = 0; i < num.length; i++) { + const w = num.words[i]; + + lo += w * 0x3d1; + + num.words[i] = lo & 0x3ffffff; + + lo = w * 0x40 + Math.floor(lo / 0x4000000); + } + + // Fast length reduction. + if (num.words[num.length - 1] === 0) { + num.length -= 1; + if (num.words[num.length - 1] === 0) + num.length -= 1; + } + + // Note: we shouldn't need to strip here. + return num; + } + + core(x1, x2) { + // Exponent: (p - 47) / 64 + // Bits: 223x1 1x0 22x1 4x0 + const {red} = x1; + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x9 = red.sqrnmul(x6, 3, x3); + const x11 = red.sqrnmul(x9, 2, x2); + const x22 = red.sqrnmul(x11, 11, x11); + const x44 = red.sqrnmul(x22, 22, x22); + const x88 = red.sqrnmul(x44, 44, x44); + const x176 = red.sqrnmul(x88, 88, x88); + const x220 = red.sqrnmul(x176, 44, x44); + const x223 = red.sqrnmul(x220, 3, x3); + const r0 = red.sqrn(x223, 1); + const r1 = red.sqrnmul(r0, 22, x22); + const r2 = red.sqrn(r1, 4); + + return r2; + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r2 = this.core(x1, x2); + const r3 = red.sqrnmul(r2, 1, x1); + const r4 = red.sqrn(r3, 1); + const r5 = red.sqrnmul(r4, 2, x2); + + return r5; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 1x0 1x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r2 = this.core(x1, x2); + const r3 = red.sqrnmul(r2, 1, x1); + const r4 = red.sqrn(r3, 1); + const r5 = red.sqrnmul(r4, 2, x2); + const r6 = red.sqrn(r5, 1); + const r7 = red.sqrnmul(r6, 1, x1); + + return r7; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 223x1 1x0 22x1 4x0 2x1 2x0 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r2 = this.core(x1, x2); + const r3 = red.sqrnmul(r2, 2, x2); + const r4 = red.sqrn(r3, 2); + + return r4; + } + } + + /** + * P251 + */ + + class P251 extends Prime34 { + constructor() { + // 2^251 - 9 + super('p251', '07ffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff fffffff7'); + } + + imulK(num) { + // K = 0x09 + if (num.isZero()) + return num; + + let carry = 0; + + for (let i = 0; i < num.length; i++) { + const w = num.words[i] * 0x09 + carry; + + carry = w >>> 26; + + num.words[i] = w & 0x3ffffff; + } + + if (carry !== 0) { + num._alloc(num.length + 1); + num.words[num.length++] = carry; + } + + // Note: we shouldn't need to strip here. + return num; + } + + core(x1) { + // Exponent: 2^247 - 1 + // Bits: 247x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x12 = red.sqrnmul(x6, 6, x6); + const x24 = red.sqrnmul(x12, 12, x12); + const x48 = red.sqrnmul(x24, 24, x24); + const x96 = red.sqrnmul(x48, 48, x48); + const x192 = red.sqrnmul(x96, 96, x96); + const x240 = red.sqrnmul(x192, 48, x48); + const x246 = red.sqrnmul(x240, 6, x6); + const x247 = red.sqrnmul(x246, 1, x1); + + return x247; + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + // Bits: 247x1 1x0 1x1 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 247x1 1x0 1x1 1x0 1x1 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + const r3 = red.sqrn(r2, 1); + const r4 = red.sqrnmul(r3, 1, x1); + + return r4; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 248x1 1x0 + const {red} = x1; + const r0 = this.core(x1); + const r1 = red.sqrnmul(r0, 1, x1); + const r2 = red.sqrn(r1, 1); + + return r2; + } + } + + /** + * P25519 + */ + + class P25519 extends Prime58 { + constructor() { + // 2^255 - 19 (= 5 mod 8) + super('p25519', '7fffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff ffffffff ffffffed', + '2b832480 4fc1df0b 2b4d0099 3dfbd7a7' + + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'); + } + + imulK(num) { + // K = 0x13 + let carry = 0; + + for (let i = 0; i < num.length; i++) { + const w = num.words[i] * 0x13 + carry; + + carry = w >>> 26; + + num.words[i] = w & 0x3ffffff; + } + + if (carry !== 0) { + num._alloc(num.length + 1); + num.words[num.length++] = carry; + } + + // Note: we shouldn't need to strip here. + return num; + } + + core(x1, x2) { + // Exponent: 2^250 - 1 + // Bits: 250x1 + const {red} = x1; + const x4 = red.sqrnmul(x2, 2, x2); + const x5 = red.sqrnmul(x4, 1, x1); + const x10 = red.sqrnmul(x5, 5, x5); + const x20 = red.sqrnmul(x10, 10, x10); + const x40 = red.sqrnmul(x20, 20, x20); + const x50 = red.sqrnmul(x40, 10, x10); + const x100 = red.sqrnmul(x50, 50, x50); + const x200 = red.sqrnmul(x100, 100, x100); + const x250 = red.sqrnmul(x200, 50, x50); + + return x250; + } + + pm5d8(x1) { + // Exponent: (p - 5) / 8 + // Bits: 250x1 1x0 1x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r0 = this.core(x1, x2); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 250x1 1x0 1x1 1x0 2x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r0 = this.core(x1, x2); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + const r3 = red.sqrn(r2, 1); + const r4 = red.sqrnmul(r3, 2, x2); + + return r4; + } + + pp3d8(x1) { + // Exponent: (p + 3) / 8 + // Bits: 251x1 1x0 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r0 = this.core(x1, x2); + const r1 = red.sqrnmul(r0, 1, x1); + const r2 = red.sqrn(r1, 1); + + return r2; + } + } + + /** + * P448 + */ + + class P448 extends Prime34 { + constructor() { + // 2^448 - 2^224 - 1 (= 3 mod 4) + super('p448', 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff fffffffe ffffffff' + + 'ffffffff ffffffff ffffffff ffffffff' + + 'ffffffff ffffffff'); + } + + imulK(num) { + // K = 0x100000000000000000000000000000000000000000000000000000001 + // K = 2^224 + 1 + const one = this.one.inject(num); + return num.iushln(224)._iadd(num, one); + } + + core(x1, x2) { + // Exponent: 2^222 - 1 + // Bits: 222x1 + const {red} = x1; + const x3 = red.sqrnmul(x2, 1, x1); + const x6 = red.sqrnmul(x3, 3, x3); + const x9 = red.sqrnmul(x6, 3, x3); + const x11 = red.sqrnmul(x9, 2, x2); + const x22 = red.sqrnmul(x11, 11, x11); + const x44 = red.sqrnmul(x22, 22, x22); + const x88 = red.sqrnmul(x44, 44, x44); + const x176 = red.sqrnmul(x88, 88, x88); + const x220 = red.sqrnmul(x176, 44, x44); + const x222 = red.sqrnmul(x220, 2, x2); + + return x222; + } + + pm3d4(x1) { + // Exponent: (p - 3) / 4 + // Bits: 223x1 1x0 222x1 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const x222 = this.core(x1, x2); + const r0 = red.sqrnmul(x222, 1, x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 222, x222); + + return r2; + } + + pm2(x1) { + // Exponent: p - 2 + // Bits: 223x1 1x0 222x1 1x0 1x1 + const {red} = x1; + const r0 = this.pm3d4(x1); + const r1 = red.sqrn(r0, 1); + const r2 = red.sqrnmul(r1, 1, x1); + + return r2; + } + + pp1d4(x1) { + // Exponent: (p + 1) / 4 + // Bits: 224x1 222x0 + const {red} = x1; + const x2 = red.sqrnmul(x1, 1, x1); + const r0 = this.core(x1, x2); + const r1 = red.sqrnmul(r0, 2, x2); + const r2 = red.sqrn(r1, 222); + + return r2; + } + } + + /** + * Reduction Engine + */ + + class Red { + constructor(m) { + let prime = null; + + if (typeof m === 'string') { + prime = BN._prime(m); + m = prime.p; + } + + enforce(BN.isBN(m), 'm', 'bignum'); + nonred(!m.red, 'reduction'); + range(m.sign() > 0, 'reduction'); + + this.m = m; + this.prime = prime; + this.mb = null; + this.sm1 = null; + } + + _verify1(a) { + range(a.negative === 0, 'red'); + red(a.red != null, 'red'); + } + + _verify2(a, b) { + range((a.negative | b.negative) === 0, 'red'); + red(a.red != null && a.red === b.red, 'red'); + } + + get mont() { + return false; + } + + precompute() { + // Precompute `sqrt(-1)` for primes congruent to 5 mod 8. + if (this.sm1 === null && this.m.andln(7) === 5) { + if (this.prime) { + this.sm1 = this.prime.sm1.clone()._forceRed(this); + } else { + const x = new BN(2).toRed(this); + const e = this.m.subn(1).iushrn(2); + + // sqrt(-1) = 2^((p - 1) / 4) mod p + this.sm1 = this.pow(x, e); + } + } + + return this; + } + + convertTo(num) { + const res = num.mod(this.m); + res.red = this; + return res; + } + + convertFrom(num) { + const res = num.clone(); + res.red = null; + return res; + } + + intTo(a) { + return a; + } + + intFrom(a) { + return a; + } + + imod(a) { + if (this.prime) + return this.prime.ireduce(a)._forceRed(this); + + return a.imod(this.m)._forceRed(this); + } + + iadd(a, b) { + this._verify2(a, b); + + a._iadd(a, b); + + if (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + + return a; + } + + add(a, b) { + if (a.length < b.length) + return this.iadd(b.clone(), a); + + return this.iadd(a.clone(), b); + } + + iaddn(a, num) { + this._verify1(a); + + if (num < 0) + return this.isubn(a, -num); + + if (this.m.length === 1) + num %= this.m.words[0]; + + a._iaddn(num); + + if (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + + return a; + } + + addn(a, num) { + return this.iaddn(a.clone(), num); + } + + isub(a, b) { + this._verify2(a, b); + + // 0: a - a mod m == 0 + // -1: a - b mod m == m - (b - a) + // +1: a - b mod m == a - b + const cmp = a.ucmp(b); + + if (cmp === 0) { + a.words[0] = 0; + a.length = 1; + return a; + } + + if (cmp < 0) { + a._isub(b, a); + a._isub(this.m, a); + } else { + a._isub(a, b); + } + + return a; + } + + sub(a, b) { + return this.isub(a.clone(), b); + } + + isubn(a, num) { + this._verify1(a); + + if (num < 0) + return this.iaddn(a, -num); + + if (this.m.length === 1) + num %= this.m.words[0]; + + // <: a - b mod m == m - (b - a) + // >=: a - b mod m == a - b + if (a.length === 1 && a.words[0] < num) { + a.words[0] = num - a.words[0]; + a._isub(this.m, a); + } else { + a._isubn(num); + } + + return a; + } + + subn(a, num) { + return this.isubn(a.clone(), num); + } + + imul(a, b) { + this._verify2(a, b); + return this.imod(a.imul(b)); + } + + mul(a, b) { + this._verify2(a, b); + return this.imod(a.mul(b)); + } + + imuln(a, num) { + this._verify1(a); + + if (a.isZero()) + return a; + + if (num === 0) { + a.words[0] = 0; + a.length = 1; + return a; + } + + const neg = num < 0; + + if (neg) + num = -num; + + if (this.m.length === 1) + num %= this.m.words[0]; + + a.imuln(num); + + if (num <= 16) { + // Quick reduction. + while (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + } else { + this.imod(a); + } + + if (neg) + this.ineg(a); + + return a; + } + + muln(a, num) { + return this.imuln(a.clone(), num); + } + + idiv(a, b) { + return this.div(a, b)._move(a); + } + + div(a, b) { + return this.mul(a, this.invert(b)); + } + + idivn(a, num) { + return this.divn(a, num)._move(a); + } + + divn(a, num) { + return this.div(a, this.convertTo(new BN(num))); + } + + ipow(a, num) { + return this.pow(a, num)._move(a); + } + + pow(a, num) { + this._verify1(a); + + if (num.isNeg()) + a = this.invert(a); + + // Small exponent. + if (num.length === 1) + return this.pown(a, num.words[0]); + + // Call out to BigInt. + if (HAS_BIGINT && !this.prime) + return this.powInt(a, num); + + // Otherwise, a BN implementation. + return this.powNum(a, num); + } + + powNum(a, num) { + // Sliding window (odd multiples only). + const one = new BN(1).toRed(this); + const wnd = new Array(WND_SIZE); + const a2 = this.sqr(a); + + wnd[0] = a; + + for (let i = 1; i < WND_SIZE; i++) + wnd[i] = this.mul(wnd[i - 1], a2); + + let i = num.bitLength(); + let r = one; + + while (i >= WND_WIDTH) { + let width = WND_WIDTH; + let bits = num.bits(i - width, width); + + if (bits < WND_SIZE) { + r = this.sqr(r); + i -= 1; + continue; + } + + while ((bits & 1) === 0) { + width -= 1; + bits >>= 1; + } + + if (r === one) { + r = wnd[bits >> 1].clone(); + } else { + r = this.sqrn(r, width); + r = this.mul(r, wnd[bits >> 1]); + } + + i -= width; + } + + if (i > 0) { + const bits = num.bits(0, i); + + while (i--) { + r = this.sqr(r); + + if ((bits >> i) & 1) + r = this.mul(r, a); + } + } + + return r; + } + + powInt(a, num) { + if (this.mb === null) + this.mb = this.m.toBigInt(); + + const x = this.intFrom(a.toBigInt()); + const y = powInt(x, num, this.mb); + const z = this.intTo(y); + + return BN.fromBigInt(z)._forceRed(this); + } + + sqrn(a, n) { + while (n--) + a = this.sqr(a); + + return a; + } + + sqrnmul(a, n, b) { + return this.mul(this.sqrn(a, n), b); + } + + ipown(a, num) { + return this.pown(a, num)._move(a); + } + + pown(a, num) { + this._verify1(a); + + if (num < 0) { + a = this.invert(a); + num = -num; + } + + if (num === 0) + return new BN(1).toRed(this); + + if (num === 1) + return a.clone(); + + const bits = countBits(num); + + let r = a; + + for (let i = bits - 2; i >= 0; i--) { + r = this.sqr(r); + + if ((num >> i) & 1) + r = this.mul(r, a); + } + + return r; + } + + isqr(a) { + return this.imul(a, a); + } + + sqr(a) { + return this.mul(a, a); + } + + isqrt(x) { + return this.sqrt(x)._move(x); + } + + sqrt(x) { + this._verify1(x); + + // Optimized square root chain. + if (this.prime) + return this.prime.sqrt(x); + + // Fast case (p = 3 mod 4). + if (this.m.andln(3) === 3) + return this.sqrt3mod4(x); + + // Fast case (p = 5 mod 8). + if (this.m.andln(7) === 5) { + if (this.sm1 != null) + return this.sqrt5mod8sm1(x); + return this.sqrt5mod8(x); + } + + // Slow case (Tonelli-Shanks). + return this.sqrt0(x); + } + + sqrt3mod4(x) { + const e = this.m.addn(1).iushrn(2); // (p + 1) / 4 + const b = this.pow(x, e); + + if (!this.sqr(b).eq(x)) + throw new SquareRootError(b); + + return b; + } + + sqrt5mod8(x) { + // Atkin's Algorithm. + const one = new BN(1).toRed(this); + const e = this.m.ushrn(3); // (p - 5) / 8 + const x2 = this.add(x, x); + const alpha = this.pow(x2, e); + const beta = this.mul(x2, this.sqr(alpha)); + const b = this.mul(this.mul(alpha, x), this.isub(beta, one)); + + if (!this.sqr(b).eq(x)) + throw new SquareRootError(b); + + return b; + } + + sqrt5mod8sm1(x) { + const e = this.m.addn(3).iushrn(3); // (p + 3) / 8 + const b = this.pow(x, e); + + if (this.sqr(b).eq(x)) + return b; + + const c = this.mul(b, this.sm1); + + if (this.sqr(c).eq(x)) + return c; + + throw new SquareRootError(b); + } + + sqrt0(x) { + if (this.m.cmpn(1) === 0 || !this.m.isOdd()) + throw new Error('Invalid prime.'); + + switch (this.jacobi(x)) { + case -1: + throw new SquareRootError(x); + case 0: + return x.clone(); + } + + const one = new BN(1).toRed(this); + const s = this.m.subn(1); + const e = s._makeOdd(); + const n = new BN(2).toRed(this); + + while (this.jacobi(n) !== -1) + this.iadd(n, one); + + let g = this.pow(n, s); + let b = this.pow(x, s); + let y = this.pow(x, s.iaddn(1).iushrn(1)); + let k = e; + + for (;;) { + let t = b; + let m = 0; + + while (!t.eq(one) && m < k) { + t = this.sqr(t); + m += 1; + } + + if (m === 0) + break; + + assert(m < k); + + t = this.sqrn(g, k - m - 1); + g = this.sqr(t); + y = this.mul(y, t); + b = this.mul(b, g); + k = m; + } + + return y; + } + + idivsqrt(u, v) { + return this.divsqrt(u, v)._move(u); + } + + divsqrt(u, v) { + this._verify2(u, v); + + // u = 0, v = 0 + if (u.isZero() && v.isZero()) + throw new SquareRootError(v); + + // Optimized inverse square root chain. + if (this.prime) + return this.prime.divsqrt(u, v); + + // p = 3 mod 4 + if (this.m.andln(3) === 3) + return this.divsqrt3mod4(u, v); + + // p = 5 mod 8 + if (this.sm1 != null && this.m.andln(7) === 5) + return this.divsqrt5mod8(u, v); + + // v = 0 + if (v.isZero()) + throw new SquareRootError(v); + + return this.sqrt(this.div(u, v)); + } + + divsqrt3mod4(u, v) { + // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p + const e = this.m.subn(3).iushrn(2); + const u2 = this.sqr(u); + const u3 = this.mul(u2, u); + const u5 = this.mul(u3, u2); + const v3 = this.mul(this.sqr(v), v); + const p = this.pow(this.mul(u5, v3), e); + const x = this.mul(this.mul(u3, v), p); + const c = this.mul(v, this.sqr(x)); + + if (c.eq(u)) + return x; + + throw new SquareRootError(x); + } + + divsqrt5mod8(u, v) { + // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p + const e = this.m.subn(5).iushrn(3); + const v3 = this.mul(this.sqr(v), v); + const v7 = this.mul(this.sqr(v3), v); + const p = this.pow(this.mul(u, v7), e); + const x = this.mul(this.mul(u, v3), p); + const c = this.mul(v, this.sqr(x)); + + if (c.eq(u)) + return x; + + const mc = this.ineg(c); + + if (mc.eq(u)) + return this.mul(x, this.sm1); + + if (mc.eq(this.mul(u, this.sm1))) + throw new SquareRootError(this.mul(x, this.sm1)); + + throw new SquareRootError(x); + } + + isSquare(a) { + if (this.m.isOdd()) + return this.jacobi(a) >= 0; + + return this.kronecker(a) >= 0; + } + + ishl(a, num) { + this._verify1(a); + return this.imod(a.iushl(num)); + } + + shl(a, num) { + return this.ishl(a.clone(), num); + } + + ishln(a, num) { + this._verify1(a); + + a.iushln(num); + + if (num <= 4) { + // Quick reduction. + while (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + } else { + this.imod(a); + } + + return a; + } + + shln(a, num) { + return this.ishln(a.clone(), num); + } + + ineg(a) { + this._verify1(a); + + if (!a.isZero()) + a._isub(this.m, a); + + return a; + } + + neg(a) { + return this.ineg(a.clone()); + } + + eq(a, b) { + this._verify2(a, b); + return a.ucmp(b) === 0; + } + + eqn(a, num) { + this._verify1(a); + + if (this.m.length === 1) { + num %= this.m.words[0]; + + if (num < 0) + num += this.m.words[0]; + + return a.ucmpn(num) === 0; + } + + if (num < 0) { + this.m._isubn(-num); + + const cmp = a.ucmp(this.m); + + this.m._iaddn(-num); + + return cmp === 0; + } + + return a.ucmpn(num) === 0; + } + + isHigh(a) { + return !this.isLow(a); + } + + isLow(a) { + this._verify1(a); + return a.ucmp(this.m.ushrn(1)) <= 0; + } + + isOdd(a) { + this._verify1(a); + return a.isOdd(); + } + + isEven(a) { + this._verify1(a); + return a.isEven(); + } + + legendre(num) { + this._verify1(num); + + if (this.m.isEven()) + throw new Error('legendre: `num` must be odd.'); + + // Euler's criterion. + const e = this.m.subn(1).iushrn(1); // (p - 1) / 2 + const symbol = this.pow(num, e); + + if (symbol.isZero()) + return 0; + + const one = new BN(1).toRed(this); + + if (symbol.eq(one)) + return 1; + + if (symbol.eq(this.ineg(one))) + return -1; + + throw new Error('Invalid prime.'); + } + + jacobi(a) { + this._verify1(a); + return a.jacobi(this.m); + } + + kronecker(a) { + this._verify1(a); + return a.kronecker(this.m); + } + + iinvert(a) { + return this.invert(a)._move(a); + } + + invert(a) { + this._verify1(a); + return a.invert(this.m)._forceRed(this); + } + + ifermat(a) { + return this.fermat(a)._move(a); + } + + fermat(a) { + this._verify1(a); + + if (a.isZero() || this.m.cmpn(1) === 0) + throw new RangeError('Not invertible.'); + + // Optimized inversion chain. + if (this.prime) + return this.prime.fermat(a); + + // Invert using fermat's little theorem. + return this.pow(a, this.m.subn(2)); + } + + invertAll(elems) { + // Montgomery's trick. + enforce(Array.isArray(elems), 'elems', 'array'); + + for (const elem of elems) { + enforce(BN.isBN(elem), 'elem', 'bignum'); + + this._verify1(elem); + } + + if (this.m.cmpn(1) === 0 || this.m.isEven()) + throw new RangeError('Not invertible.'); + + const len = elems.length; + const invs = new Array(len); + + if (len === 0) + return invs; + + let acc = new BN(1).toRed(this); + + for (let i = 0; i < len; i++) { + if (elems[i].isZero()) { + invs[i] = elems[i].clone(); + continue; + } + + invs[i] = acc; + acc = this.mul(acc, elems[i]); + } + + acc = this.invert(acc); + + for (let i = len - 1; i >= 0; i--) { + if (elems[i].isZero()) + continue; + + invs[i] = this.mul(acc, invs[i]); + acc = this.mul(acc, elems[i]); + } + + return invs; + } + + [custom]() { + if (this.prime) + return ``; + + return ``; + } + } + + /** + * Barrett Engine + */ + + class Barrett extends Red { + constructor(m) { + super(m); + + this.prime = null; + this.n = this.m.bitLength(); + + if ((this.n % 26) !== 0) + this.n += 26 - (this.n % 26); + + this.k = this.n * 2; + this.w = this.k / 26; + this.b = BN.shift(1, this.k).div(this.m); + } + + convertTo(num) { + if (num.length > this.w) + return super.convertTo(num); + + return this.imod(num.clone()); + } + + _shift(q) { + let i = 0; + let j = this.w; + + while (j < q.length) + q.words[i++] = q.words[j++]; + + if (i === 0) + q.words[i++] = 0; + + q.length = i; + } + + imod(a) { + const neg = a.negative; + + assert(a.length <= this.w); + + a.negative = 0; + + const q = a.mul(this.b); + + // Shift right by `k` bits. + this._shift(q); + + a._isub(a, q.mul(this.m)); + + if (a.ucmp(this.m) >= 0) + a._isub(a, this.m); + + if (neg && !a.isZero()) + a._isub(this.m, a); + + a.red = this; + + return a; + } + } + + /** + * Montgomery Engine + */ + + class Mont extends Red { + constructor(m) { + super(m); + + // Note that: + // + // mi = (-m^-1 mod (2^(n * 2))) mod r + // + // and: + // + // mi = (((2^n)^-1 mod m) * r^-1 - 1) / m + // + // are equivalent. + this.prime = null; + this.n = this.m.length * 26; + this.r = BN.shift(1, this.n); + this.r2 = BN.shift(1, this.n * 2).imod(this.m); + this.ri = this.r.invert(this.m); + this.mi = this.r.mul(this.ri).isubn(1).div(this.m); + this.rib = null; + } + + get mont() { + return true; + } + + convertTo(num) { + if (num.isNeg() || num.ucmp(this.m) >= 0) + return this.imod(num.ushln(this.n)); + + // Equivalent to: (num * 2^n) mod m + return this.mul(num, this.r2); + } + + convertFrom(num) { + // Equivalent to: num * r^-1 mod m + const r = this.mul(num, new BN(1)); + r.red = null; + return r; + } + + intTo(a) { + return (a << BigInt(this.n)) % this.mb; + } + + intFrom(a) { + if (this.rib === null) + this.rib = this.ri.toBigInt(); + + return (a * this.rib) % this.mb; + } + + iaddn(a, num) { + return this.iadd(a, this.convertTo(new BN(num))); + } + + isubn(a, num) { + return this.isub(a, this.convertTo(new BN(num))); + } + + imul(a, b) { + return this.mul(a, b)._move(a); + } + + mul(a, b) { + if (a.isZero() || b.isZero()) + return new BN(0)._forceRed(this); + + const t = a.mul(b); + const c = t.umaskn(this.n).mul(this.mi).iumaskn(this.n); + const u = t.iadd(c.mul(this.m)).iushrn(this.n); + + if (u.ucmp(this.m) >= 0) + u._isub(u, this.m); + + return u._forceRed(this); + } + + imuln(a, num) { + this._verify1(a); + + if (a.isZero()) + return a; + + if (num === 0) { + a.words[0] = 0; + a.length = 1; + return a; + } + + const neg = num < 0; + + if (neg) + num = -num; + + if (this.m.length === 1) + num %= this.m.words[0]; + + const bits = countBits(num); + + // Potentially compute with additions. + // This avoids an expensive division. + if (bits > 5) { + // Slow case (num > 31). + this.imul(a, this.convertTo(new BN(num))); + } else if ((num & (num - 1)) === 0) { + // Optimize for powers of two. + for (let i = 0; i < bits - 1; i++) + this.iadd(a, a); + } else { + // Multiply left to right. + const c = a.clone(); + + for (let i = bits - 2; i >= 0; i--) { + this.iadd(a, a); + + if ((num >> i) & 1) + this.iadd(a, c); + } + } + + if (neg) + this.ineg(a); + + return a; + } + + eqn(a, num) { + this._verify1(a); + + if (num === 0) + return a.isZero(); + + return a.ucmp(this.convertTo(new BN(num))) === 0; + } + + isLow(a) { + this._verify1(a); + return this.convertFrom(a).ucmp(this.m.ushrn(1)) <= 0; + } + + isOdd(a) { + this._verify1(a); + return this.convertFrom(a).isOdd(); + } + + isEven(a) { + this._verify1(a); + return this.convertFrom(a).isEven(); + } + + invert(a) { + this._verify1(a); + + // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R + return this.imod(a.invert(this.m).mul(this.r2)); + } + } + + /* + * Helpers + */ + + function makeError(Error, msg, start) { + const err = new Error(msg); + + if (Error.captureStackTrace) + Error.captureStackTrace(err, start); + + return err; + } + + function assert(value, message) { + if (!value) { + const msg = message || 'Assertion failed.'; + throw makeError(Error, msg, assert); + } + } + + function enforce(value, name, type) { + if (!value) { + const msg = `"${name}" must be a(n) ${type}.`; + throw makeError(TypeError, msg, enforce); + } + } + + function range(value, name) { + if (!value) { + const msg = `"${name}" only works with positive numbers.`; + throw makeError(RangeError, msg, range); + } + } + + function red(value, name) { + if (!value) { + const msg = `"${name}" only works with red numbers.`; + throw makeError(TypeError, msg, red); + } + } + + function nonred(value, name) { + if (!value) { + const msg = `"${name}" only works with normal numbers.`; + throw makeError(TypeError, msg, nonred); + } + } + + function nonzero(value) { + if (!value) { + const msg = 'Cannot divide by zero.'; + throw makeError(RangeError, msg, nonzero); + } + } + + class SquareRootError extends Error { + constructor(result) { + super(); + + this.name = 'SquareRootError'; + this.message = 'X is not a square mod P.'; + this.result = result.fromRed(); + + if (Error.captureStackTrace) + Error.captureStackTrace(this, SquareRootError); + } + } + + function isInteger(num) { + return Number.isSafeInteger(num); + } + + function isSMI(num) { + return isInteger(num) + && num >= -67108863 + && num <= 0x3ffffff; + } + + function allocate(ArrayType, size) { + if (ArrayType.allocUnsafeSlow) + return ArrayType.allocUnsafeSlow(size); + + return new ArrayType(size); + } + + function getBase(base) { + if (base == null) + return 10; + + if (typeof base === 'number') + return base; + + switch (base) { + case 'bin': + return 2; + case 'oct': + return 8; + case 'dec': + return 10; + case 'hex': + return 16; + } + + return 0; + } + + /* + * Internal + */ + + function countBits(w) { + if (Math.clz32) + return 32 - Math.clz32(w); + + let t = w; + let r = 0; + + if (t >= 0x1000) { + r += 13; + t >>>= 13; + } + + if (t >= 0x40) { + r += 7; + t >>>= 7; + } + + if (t >= 0x8) { + r += 4; + t >>>= 4; + } + + if (t >= 0x02) { + r += 2; + t >>>= 2; + } + + return r + t; + } + + function zeroBits(w) { + // Shortcut. + if (w === 0) + return 26; + + let t = w; + let r = 0; + + if ((t & 0x1fff) === 0) { + r += 13; + t >>>= 13; + } + + if ((t & 0x7f) === 0) { + r += 7; + t >>>= 7; + } + + if ((t & 0xf) === 0) { + r += 4; + t >>>= 4; + } + + if ((t & 0x3) === 0) { + r += 2; + t >>>= 2; + } + + if ((t & 0x1) === 0) + r += 1; + + return r; + } + + function parseHex(str, start, end) { + const len = Math.min(str.length, end); + + let r = 0; + let z = 0; + + for (let i = start; i < len; i++) { + const c = str.charCodeAt(i) - 48; + + r <<= 4; + + let b; + + if (c >= 49 && c <= 54) { + // 'a' - 'f' + b = c - 49 + 0xa; + } else if (c >= 17 && c <= 22) { + // 'A' - 'F' + b = c - 17 + 0xa; + } else { + // '0' - '9' + b = c; + } + + r |= b; + z |= b; + } + + if (z & -16) + throw new Error('Invalid string.'); + + return r; + } + + function parseBase(str, start, end, mul) { + const len = Math.min(str.length, end); + + let r = 0; + + for (let i = start; i < len; i++) { + const c = str.charCodeAt(i) - 48; + + r *= mul; + + let b; + + if (c >= 49) { + // 'a' + b = c - 49 + 0xa; + } else if (c >= 17) { + // 'A' + b = c - 17 + 0xa; + } else { + // '0' - '9' + b = c; + } + + if (c < 0 || c > 207 || b >= mul) + throw new Error('Invalid string.'); + + r += b; + } + + return r; + } + + /* + * Exponentiation (bigint) + */ + + function powInt(x, e, m) { + // Sliding window (odd multiples only). + const one = BigInt(1); + const wnd = new Array(WND_SIZE); + const x2 = (x * x) % m; + + wnd[0] = x; + + for (let i = 1; i < WND_SIZE; i++) + wnd[i] = (wnd[i - 1] * x2) % m; + + let i = e.bitLength(); + let r = one; + + while (i >= WND_WIDTH) { + let width = WND_WIDTH; + let bits = e.bits(i - width, width); + + if (bits < WND_SIZE) { + r = (r * r) % m; + i -= 1; + continue; + } + + while ((bits & 1) === 0) { + width -= 1; + bits >>= 1; + } + + if (r === one) { + r = wnd[bits >> 1]; + } else { + r = sqrn(r, width, m); + r = (r * wnd[bits >> 1]) % m; + } + + i -= width; + } + + if (i > 0) { + const bits = e.bits(0, i); + + while (i--) { + r = (r * r) % m; + + if ((bits >> i) & 1) + r = (r * x) % m; + } + } + + return r; + } + + function sqrn(x, n, m) { + for (let i = 0; i < n; i++) + x = (x * x) % m; + return x; + } + + /* + * Multiplication + */ + + function smallMulTo(self, num, out) { + const len = self.length + num.length; + + out.negative = self.negative ^ num.negative; + out._alloc(len); + out.length = len; + + // Peel one iteration (compiler can't + // do it, because of code complexity). + const a = self.words[0]; + const b = num.words[0]; + const r = a * b; + const lo = r & 0x3ffffff; + + let carry = (r / 0x4000000) | 0; + let k = 1; + + out.words[0] = lo; + + for (; k < out.length - 1; k++) { + // Sum all words with the same + // `i + j = k` and accumulate + // `ncarry`, note that ncarry + // could be >= 0x3ffffff. + let ncarry = carry >>> 26; + let rword = carry & 0x3ffffff; + + const min = Math.max(0, k - self.length + 1); + const max = Math.min(k, num.length - 1); + + for (let j = min; j <= max; j++) { + const i = k - j; + const a = self.words[i]; + const b = num.words[j]; + const r = a * b + rword; + + ncarry += (r / 0x4000000) | 0; + rword = r & 0x3ffffff; + } + + out.words[k] = rword | 0; + carry = ncarry | 0; + } + + if (carry !== 0) + out.words[k] = carry | 0; + else + out.length -= 1; + + return out._strip(); + } + + function bigMulTo(self, num, out) { + const len = self.length + num.length; + + out.negative = self.negative ^ num.negative; + out._alloc(len); + out.length = len; + + let carry = 0; + let hncarry = 0; + let k = 0; + + for (; k < out.length - 1; k++) { + // Sum all words with the same + // `i + j = k` and accumulate + // `ncarry`, note that ncarry + // could be >= 0x3ffffff. + let ncarry = hncarry; + + hncarry = 0; + + let rword = carry & 0x3ffffff; + + const min = Math.max(0, k - self.length + 1); + const max = Math.min(k, num.length - 1); + + for (let j = min; j <= max; j++) { + const i = k - j; + const a = self.words[i]; + const b = num.words[j]; + const r = a * b; + + let lo = r & 0x3ffffff; + + ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 0x3ffffff; + ncarry = (ncarry + (lo >>> 26)) | 0; + + hncarry += ncarry >>> 26; + ncarry &= 0x3ffffff; + } + + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; + } + + if (carry !== 0) + out.words[k] = carry; + else + out.length -= 1; + + return out._strip(); + } + + function jumboMulTo(x, y, out) { + // v8 has a 2147483519 bit max (~256mb). + if (!HAS_BIGINT || x.length + y.length > 82595519) + return bigMulTo(x, y, out); + + const zero = BigInt(0); + const mask = BigInt(0x3ffffff); + const shift = BigInt(26); + + let z = x.toBigInt() * y.toBigInt(); + + const neg = (z < zero) | 0; + + if (neg) + z = -z; + + let i = 0; + + while (z > zero) { + out.words[i++] = Number(z & mask); + z >>= shift; + } + + if (i === 0) + out.words[i++] = 0; + + out.length = i; + out.negative = neg; + + return out; + } + + function comb10MulTo(self, num, out) { + const a = self.words; + const b = num.words; + const o = out.words; + const a0 = a[0] | 0; + const al0 = a0 & 0x1fff; + const ah0 = a0 >>> 13; + const a1 = a[1] | 0; + const al1 = a1 & 0x1fff; + const ah1 = a1 >>> 13; + const a2 = a[2] | 0; + const al2 = a2 & 0x1fff; + const ah2 = a2 >>> 13; + const a3 = a[3] | 0; + const al3 = a3 & 0x1fff; + const ah3 = a3 >>> 13; + const a4 = a[4] | 0; + const al4 = a4 & 0x1fff; + const ah4 = a4 >>> 13; + const a5 = a[5] | 0; + const al5 = a5 & 0x1fff; + const ah5 = a5 >>> 13; + const a6 = a[6] | 0; + const al6 = a6 & 0x1fff; + const ah6 = a6 >>> 13; + const a7 = a[7] | 0; + const al7 = a7 & 0x1fff; + const ah7 = a7 >>> 13; + const a8 = a[8] | 0; + const al8 = a8 & 0x1fff; + const ah8 = a8 >>> 13; + const a9 = a[9] | 0; + const al9 = a9 & 0x1fff; + const ah9 = a9 >>> 13; + const b0 = b[0] | 0; + const bl0 = b0 & 0x1fff; + const bh0 = b0 >>> 13; + const b1 = b[1] | 0; + const bl1 = b1 & 0x1fff; + const bh1 = b1 >>> 13; + const b2 = b[2] | 0; + const bl2 = b2 & 0x1fff; + const bh2 = b2 >>> 13; + const b3 = b[3] | 0; + const bl3 = b3 & 0x1fff; + const bh3 = b3 >>> 13; + const b4 = b[4] | 0; + const bl4 = b4 & 0x1fff; + const bh4 = b4 >>> 13; + const b5 = b[5] | 0; + const bl5 = b5 & 0x1fff; + const bh5 = b5 >>> 13; + const b6 = b[6] | 0; + const bl6 = b6 & 0x1fff; + const bh6 = b6 >>> 13; + const b7 = b[7] | 0; + const bl7 = b7 & 0x1fff; + const bh7 = b7 >>> 13; + const b8 = b[8] | 0; + const bl8 = b8 & 0x1fff; + const bh8 = b8 >>> 13; + const b9 = b[9] | 0; + const bl9 = b9 & 0x1fff; + const bh9 = b9 >>> 13; + + let c = 0; + let lo, mid, hi; + + out.negative = self.negative ^ num.negative; + out._alloc(20); + out.length = 19; + + /* k = 0 */ + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = (mid + Math.imul(ah0, bl0)) | 0; + hi = Math.imul(ah0, bh0); + + let w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; + w0 &= 0x3ffffff; + + /* k = 1 */ + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = (mid + Math.imul(ah1, bl0)) | 0; + hi = Math.imul(ah1, bh0); + lo = (lo + Math.imul(al0, bl1)) | 0; + mid = (mid + Math.imul(al0, bh1)) | 0; + mid = (mid + Math.imul(ah0, bl1)) | 0; + hi = (hi + Math.imul(ah0, bh1)) | 0; + + let w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; + w1 &= 0x3ffffff; + + /* k = 2 */ + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = (mid + Math.imul(ah2, bl0)) | 0; + hi = Math.imul(ah2, bh0); + lo = (lo + Math.imul(al1, bl1)) | 0; + mid = (mid + Math.imul(al1, bh1)) | 0; + mid = (mid + Math.imul(ah1, bl1)) | 0; + hi = (hi + Math.imul(ah1, bh1)) | 0; + lo = (lo + Math.imul(al0, bl2)) | 0; + mid = (mid + Math.imul(al0, bh2)) | 0; + mid = (mid + Math.imul(ah0, bl2)) | 0; + hi = (hi + Math.imul(ah0, bh2)) | 0; + + let w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; + w2 &= 0x3ffffff; + + /* k = 3 */ + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = (mid + Math.imul(ah3, bl0)) | 0; + hi = Math.imul(ah3, bh0); + lo = (lo + Math.imul(al2, bl1)) | 0; + mid = (mid + Math.imul(al2, bh1)) | 0; + mid = (mid + Math.imul(ah2, bl1)) | 0; + hi = (hi + Math.imul(ah2, bh1)) | 0; + lo = (lo + Math.imul(al1, bl2)) | 0; + mid = (mid + Math.imul(al1, bh2)) | 0; + mid = (mid + Math.imul(ah1, bl2)) | 0; + hi = (hi + Math.imul(ah1, bh2)) | 0; + lo = (lo + Math.imul(al0, bl3)) | 0; + mid = (mid + Math.imul(al0, bh3)) | 0; + mid = (mid + Math.imul(ah0, bl3)) | 0; + hi = (hi + Math.imul(ah0, bh3)) | 0; + + let w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; + w3 &= 0x3ffffff; + + /* k = 4 */ + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = (mid + Math.imul(ah4, bl0)) | 0; + hi = Math.imul(ah4, bh0); + lo = (lo + Math.imul(al3, bl1)) | 0; + mid = (mid + Math.imul(al3, bh1)) | 0; + mid = (mid + Math.imul(ah3, bl1)) | 0; + hi = (hi + Math.imul(ah3, bh1)) | 0; + lo = (lo + Math.imul(al2, bl2)) | 0; + mid = (mid + Math.imul(al2, bh2)) | 0; + mid = (mid + Math.imul(ah2, bl2)) | 0; + hi = (hi + Math.imul(ah2, bh2)) | 0; + lo = (lo + Math.imul(al1, bl3)) | 0; + mid = (mid + Math.imul(al1, bh3)) | 0; + mid = (mid + Math.imul(ah1, bl3)) | 0; + hi = (hi + Math.imul(ah1, bh3)) | 0; + lo = (lo + Math.imul(al0, bl4)) | 0; + mid = (mid + Math.imul(al0, bh4)) | 0; + mid = (mid + Math.imul(ah0, bl4)) | 0; + hi = (hi + Math.imul(ah0, bh4)) | 0; + + let w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; + w4 &= 0x3ffffff; + + /* k = 5 */ + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = (mid + Math.imul(ah5, bl0)) | 0; + hi = Math.imul(ah5, bh0); + lo = (lo + Math.imul(al4, bl1)) | 0; + mid = (mid + Math.imul(al4, bh1)) | 0; + mid = (mid + Math.imul(ah4, bl1)) | 0; + hi = (hi + Math.imul(ah4, bh1)) | 0; + lo = (lo + Math.imul(al3, bl2)) | 0; + mid = (mid + Math.imul(al3, bh2)) | 0; + mid = (mid + Math.imul(ah3, bl2)) | 0; + hi = (hi + Math.imul(ah3, bh2)) | 0; + lo = (lo + Math.imul(al2, bl3)) | 0; + mid = (mid + Math.imul(al2, bh3)) | 0; + mid = (mid + Math.imul(ah2, bl3)) | 0; + hi = (hi + Math.imul(ah2, bh3)) | 0; + lo = (lo + Math.imul(al1, bl4)) | 0; + mid = (mid + Math.imul(al1, bh4)) | 0; + mid = (mid + Math.imul(ah1, bl4)) | 0; + hi = (hi + Math.imul(ah1, bh4)) | 0; + lo = (lo + Math.imul(al0, bl5)) | 0; + mid = (mid + Math.imul(al0, bh5)) | 0; + mid = (mid + Math.imul(ah0, bl5)) | 0; + hi = (hi + Math.imul(ah0, bh5)) | 0; + + let w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; + w5 &= 0x3ffffff; + + /* k = 6 */ + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = (mid + Math.imul(ah6, bl0)) | 0; + hi = Math.imul(ah6, bh0); + lo = (lo + Math.imul(al5, bl1)) | 0; + mid = (mid + Math.imul(al5, bh1)) | 0; + mid = (mid + Math.imul(ah5, bl1)) | 0; + hi = (hi + Math.imul(ah5, bh1)) | 0; + lo = (lo + Math.imul(al4, bl2)) | 0; + mid = (mid + Math.imul(al4, bh2)) | 0; + mid = (mid + Math.imul(ah4, bl2)) | 0; + hi = (hi + Math.imul(ah4, bh2)) | 0; + lo = (lo + Math.imul(al3, bl3)) | 0; + mid = (mid + Math.imul(al3, bh3)) | 0; + mid = (mid + Math.imul(ah3, bl3)) | 0; + hi = (hi + Math.imul(ah3, bh3)) | 0; + lo = (lo + Math.imul(al2, bl4)) | 0; + mid = (mid + Math.imul(al2, bh4)) | 0; + mid = (mid + Math.imul(ah2, bl4)) | 0; + hi = (hi + Math.imul(ah2, bh4)) | 0; + lo = (lo + Math.imul(al1, bl5)) | 0; + mid = (mid + Math.imul(al1, bh5)) | 0; + mid = (mid + Math.imul(ah1, bl5)) | 0; + hi = (hi + Math.imul(ah1, bh5)) | 0; + lo = (lo + Math.imul(al0, bl6)) | 0; + mid = (mid + Math.imul(al0, bh6)) | 0; + mid = (mid + Math.imul(ah0, bl6)) | 0; + hi = (hi + Math.imul(ah0, bh6)) | 0; + + let w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; + w6 &= 0x3ffffff; + + /* k = 7 */ + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = (mid + Math.imul(ah7, bl0)) | 0; + hi = Math.imul(ah7, bh0); + lo = (lo + Math.imul(al6, bl1)) | 0; + mid = (mid + Math.imul(al6, bh1)) | 0; + mid = (mid + Math.imul(ah6, bl1)) | 0; + hi = (hi + Math.imul(ah6, bh1)) | 0; + lo = (lo + Math.imul(al5, bl2)) | 0; + mid = (mid + Math.imul(al5, bh2)) | 0; + mid = (mid + Math.imul(ah5, bl2)) | 0; + hi = (hi + Math.imul(ah5, bh2)) | 0; + lo = (lo + Math.imul(al4, bl3)) | 0; + mid = (mid + Math.imul(al4, bh3)) | 0; + mid = (mid + Math.imul(ah4, bl3)) | 0; + hi = (hi + Math.imul(ah4, bh3)) | 0; + lo = (lo + Math.imul(al3, bl4)) | 0; + mid = (mid + Math.imul(al3, bh4)) | 0; + mid = (mid + Math.imul(ah3, bl4)) | 0; + hi = (hi + Math.imul(ah3, bh4)) | 0; + lo = (lo + Math.imul(al2, bl5)) | 0; + mid = (mid + Math.imul(al2, bh5)) | 0; + mid = (mid + Math.imul(ah2, bl5)) | 0; + hi = (hi + Math.imul(ah2, bh5)) | 0; + lo = (lo + Math.imul(al1, bl6)) | 0; + mid = (mid + Math.imul(al1, bh6)) | 0; + mid = (mid + Math.imul(ah1, bl6)) | 0; + hi = (hi + Math.imul(ah1, bh6)) | 0; + lo = (lo + Math.imul(al0, bl7)) | 0; + mid = (mid + Math.imul(al0, bh7)) | 0; + mid = (mid + Math.imul(ah0, bl7)) | 0; + hi = (hi + Math.imul(ah0, bh7)) | 0; + + let w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; + w7 &= 0x3ffffff; + + /* k = 8 */ + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = (mid + Math.imul(ah8, bl0)) | 0; + hi = Math.imul(ah8, bh0); + lo = (lo + Math.imul(al7, bl1)) | 0; + mid = (mid + Math.imul(al7, bh1)) | 0; + mid = (mid + Math.imul(ah7, bl1)) | 0; + hi = (hi + Math.imul(ah7, bh1)) | 0; + lo = (lo + Math.imul(al6, bl2)) | 0; + mid = (mid + Math.imul(al6, bh2)) | 0; + mid = (mid + Math.imul(ah6, bl2)) | 0; + hi = (hi + Math.imul(ah6, bh2)) | 0; + lo = (lo + Math.imul(al5, bl3)) | 0; + mid = (mid + Math.imul(al5, bh3)) | 0; + mid = (mid + Math.imul(ah5, bl3)) | 0; + hi = (hi + Math.imul(ah5, bh3)) | 0; + lo = (lo + Math.imul(al4, bl4)) | 0; + mid = (mid + Math.imul(al4, bh4)) | 0; + mid = (mid + Math.imul(ah4, bl4)) | 0; + hi = (hi + Math.imul(ah4, bh4)) | 0; + lo = (lo + Math.imul(al3, bl5)) | 0; + mid = (mid + Math.imul(al3, bh5)) | 0; + mid = (mid + Math.imul(ah3, bl5)) | 0; + hi = (hi + Math.imul(ah3, bh5)) | 0; + lo = (lo + Math.imul(al2, bl6)) | 0; + mid = (mid + Math.imul(al2, bh6)) | 0; + mid = (mid + Math.imul(ah2, bl6)) | 0; + hi = (hi + Math.imul(ah2, bh6)) | 0; + lo = (lo + Math.imul(al1, bl7)) | 0; + mid = (mid + Math.imul(al1, bh7)) | 0; + mid = (mid + Math.imul(ah1, bl7)) | 0; + hi = (hi + Math.imul(ah1, bh7)) | 0; + lo = (lo + Math.imul(al0, bl8)) | 0; + mid = (mid + Math.imul(al0, bh8)) | 0; + mid = (mid + Math.imul(ah0, bl8)) | 0; + hi = (hi + Math.imul(ah0, bh8)) | 0; + + let w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; + w8 &= 0x3ffffff; + + /* k = 9 */ + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = (mid + Math.imul(ah9, bl0)) | 0; + hi = Math.imul(ah9, bh0); + lo = (lo + Math.imul(al8, bl1)) | 0; + mid = (mid + Math.imul(al8, bh1)) | 0; + mid = (mid + Math.imul(ah8, bl1)) | 0; + hi = (hi + Math.imul(ah8, bh1)) | 0; + lo = (lo + Math.imul(al7, bl2)) | 0; + mid = (mid + Math.imul(al7, bh2)) | 0; + mid = (mid + Math.imul(ah7, bl2)) | 0; + hi = (hi + Math.imul(ah7, bh2)) | 0; + lo = (lo + Math.imul(al6, bl3)) | 0; + mid = (mid + Math.imul(al6, bh3)) | 0; + mid = (mid + Math.imul(ah6, bl3)) | 0; + hi = (hi + Math.imul(ah6, bh3)) | 0; + lo = (lo + Math.imul(al5, bl4)) | 0; + mid = (mid + Math.imul(al5, bh4)) | 0; + mid = (mid + Math.imul(ah5, bl4)) | 0; + hi = (hi + Math.imul(ah5, bh4)) | 0; + lo = (lo + Math.imul(al4, bl5)) | 0; + mid = (mid + Math.imul(al4, bh5)) | 0; + mid = (mid + Math.imul(ah4, bl5)) | 0; + hi = (hi + Math.imul(ah4, bh5)) | 0; + lo = (lo + Math.imul(al3, bl6)) | 0; + mid = (mid + Math.imul(al3, bh6)) | 0; + mid = (mid + Math.imul(ah3, bl6)) | 0; + hi = (hi + Math.imul(ah3, bh6)) | 0; + lo = (lo + Math.imul(al2, bl7)) | 0; + mid = (mid + Math.imul(al2, bh7)) | 0; + mid = (mid + Math.imul(ah2, bl7)) | 0; + hi = (hi + Math.imul(ah2, bh7)) | 0; + lo = (lo + Math.imul(al1, bl8)) | 0; + mid = (mid + Math.imul(al1, bh8)) | 0; + mid = (mid + Math.imul(ah1, bl8)) | 0; + hi = (hi + Math.imul(ah1, bh8)) | 0; + lo = (lo + Math.imul(al0, bl9)) | 0; + mid = (mid + Math.imul(al0, bh9)) | 0; + mid = (mid + Math.imul(ah0, bl9)) | 0; + hi = (hi + Math.imul(ah0, bh9)) | 0; + + let w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; + w9 &= 0x3ffffff; + + /* k = 10 */ + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = (mid + Math.imul(ah9, bl1)) | 0; + hi = Math.imul(ah9, bh1); + lo = (lo + Math.imul(al8, bl2)) | 0; + mid = (mid + Math.imul(al8, bh2)) | 0; + mid = (mid + Math.imul(ah8, bl2)) | 0; + hi = (hi + Math.imul(ah8, bh2)) | 0; + lo = (lo + Math.imul(al7, bl3)) | 0; + mid = (mid + Math.imul(al7, bh3)) | 0; + mid = (mid + Math.imul(ah7, bl3)) | 0; + hi = (hi + Math.imul(ah7, bh3)) | 0; + lo = (lo + Math.imul(al6, bl4)) | 0; + mid = (mid + Math.imul(al6, bh4)) | 0; + mid = (mid + Math.imul(ah6, bl4)) | 0; + hi = (hi + Math.imul(ah6, bh4)) | 0; + lo = (lo + Math.imul(al5, bl5)) | 0; + mid = (mid + Math.imul(al5, bh5)) | 0; + mid = (mid + Math.imul(ah5, bl5)) | 0; + hi = (hi + Math.imul(ah5, bh5)) | 0; + lo = (lo + Math.imul(al4, bl6)) | 0; + mid = (mid + Math.imul(al4, bh6)) | 0; + mid = (mid + Math.imul(ah4, bl6)) | 0; + hi = (hi + Math.imul(ah4, bh6)) | 0; + lo = (lo + Math.imul(al3, bl7)) | 0; + mid = (mid + Math.imul(al3, bh7)) | 0; + mid = (mid + Math.imul(ah3, bl7)) | 0; + hi = (hi + Math.imul(ah3, bh7)) | 0; + lo = (lo + Math.imul(al2, bl8)) | 0; + mid = (mid + Math.imul(al2, bh8)) | 0; + mid = (mid + Math.imul(ah2, bl8)) | 0; + hi = (hi + Math.imul(ah2, bh8)) | 0; + lo = (lo + Math.imul(al1, bl9)) | 0; + mid = (mid + Math.imul(al1, bh9)) | 0; + mid = (mid + Math.imul(ah1, bl9)) | 0; + hi = (hi + Math.imul(ah1, bh9)) | 0; + + let w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; + w10 &= 0x3ffffff; + + /* k = 11 */ + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = (mid + Math.imul(ah9, bl2)) | 0; + hi = Math.imul(ah9, bh2); + lo = (lo + Math.imul(al8, bl3)) | 0; + mid = (mid + Math.imul(al8, bh3)) | 0; + mid = (mid + Math.imul(ah8, bl3)) | 0; + hi = (hi + Math.imul(ah8, bh3)) | 0; + lo = (lo + Math.imul(al7, bl4)) | 0; + mid = (mid + Math.imul(al7, bh4)) | 0; + mid = (mid + Math.imul(ah7, bl4)) | 0; + hi = (hi + Math.imul(ah7, bh4)) | 0; + lo = (lo + Math.imul(al6, bl5)) | 0; + mid = (mid + Math.imul(al6, bh5)) | 0; + mid = (mid + Math.imul(ah6, bl5)) | 0; + hi = (hi + Math.imul(ah6, bh5)) | 0; + lo = (lo + Math.imul(al5, bl6)) | 0; + mid = (mid + Math.imul(al5, bh6)) | 0; + mid = (mid + Math.imul(ah5, bl6)) | 0; + hi = (hi + Math.imul(ah5, bh6)) | 0; + lo = (lo + Math.imul(al4, bl7)) | 0; + mid = (mid + Math.imul(al4, bh7)) | 0; + mid = (mid + Math.imul(ah4, bl7)) | 0; + hi = (hi + Math.imul(ah4, bh7)) | 0; + lo = (lo + Math.imul(al3, bl8)) | 0; + mid = (mid + Math.imul(al3, bh8)) | 0; + mid = (mid + Math.imul(ah3, bl8)) | 0; + hi = (hi + Math.imul(ah3, bh8)) | 0; + lo = (lo + Math.imul(al2, bl9)) | 0; + mid = (mid + Math.imul(al2, bh9)) | 0; + mid = (mid + Math.imul(ah2, bl9)) | 0; + hi = (hi + Math.imul(ah2, bh9)) | 0; + + let w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; + w11 &= 0x3ffffff; + + /* k = 12 */ + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = (mid + Math.imul(ah9, bl3)) | 0; + hi = Math.imul(ah9, bh3); + lo = (lo + Math.imul(al8, bl4)) | 0; + mid = (mid + Math.imul(al8, bh4)) | 0; + mid = (mid + Math.imul(ah8, bl4)) | 0; + hi = (hi + Math.imul(ah8, bh4)) | 0; + lo = (lo + Math.imul(al7, bl5)) | 0; + mid = (mid + Math.imul(al7, bh5)) | 0; + mid = (mid + Math.imul(ah7, bl5)) | 0; + hi = (hi + Math.imul(ah7, bh5)) | 0; + lo = (lo + Math.imul(al6, bl6)) | 0; + mid = (mid + Math.imul(al6, bh6)) | 0; + mid = (mid + Math.imul(ah6, bl6)) | 0; + hi = (hi + Math.imul(ah6, bh6)) | 0; + lo = (lo + Math.imul(al5, bl7)) | 0; + mid = (mid + Math.imul(al5, bh7)) | 0; + mid = (mid + Math.imul(ah5, bl7)) | 0; + hi = (hi + Math.imul(ah5, bh7)) | 0; + lo = (lo + Math.imul(al4, bl8)) | 0; + mid = (mid + Math.imul(al4, bh8)) | 0; + mid = (mid + Math.imul(ah4, bl8)) | 0; + hi = (hi + Math.imul(ah4, bh8)) | 0; + lo = (lo + Math.imul(al3, bl9)) | 0; + mid = (mid + Math.imul(al3, bh9)) | 0; + mid = (mid + Math.imul(ah3, bl9)) | 0; + hi = (hi + Math.imul(ah3, bh9)) | 0; + + let w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; + w12 &= 0x3ffffff; + + /* k = 13 */ + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = (mid + Math.imul(ah9, bl4)) | 0; + hi = Math.imul(ah9, bh4); + lo = (lo + Math.imul(al8, bl5)) | 0; + mid = (mid + Math.imul(al8, bh5)) | 0; + mid = (mid + Math.imul(ah8, bl5)) | 0; + hi = (hi + Math.imul(ah8, bh5)) | 0; + lo = (lo + Math.imul(al7, bl6)) | 0; + mid = (mid + Math.imul(al7, bh6)) | 0; + mid = (mid + Math.imul(ah7, bl6)) | 0; + hi = (hi + Math.imul(ah7, bh6)) | 0; + lo = (lo + Math.imul(al6, bl7)) | 0; + mid = (mid + Math.imul(al6, bh7)) | 0; + mid = (mid + Math.imul(ah6, bl7)) | 0; + hi = (hi + Math.imul(ah6, bh7)) | 0; + lo = (lo + Math.imul(al5, bl8)) | 0; + mid = (mid + Math.imul(al5, bh8)) | 0; + mid = (mid + Math.imul(ah5, bl8)) | 0; + hi = (hi + Math.imul(ah5, bh8)) | 0; + lo = (lo + Math.imul(al4, bl9)) | 0; + mid = (mid + Math.imul(al4, bh9)) | 0; + mid = (mid + Math.imul(ah4, bl9)) | 0; + hi = (hi + Math.imul(ah4, bh9)) | 0; + + let w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; + w13 &= 0x3ffffff; + + /* k = 14 */ + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = (mid + Math.imul(ah9, bl5)) | 0; + hi = Math.imul(ah9, bh5); + lo = (lo + Math.imul(al8, bl6)) | 0; + mid = (mid + Math.imul(al8, bh6)) | 0; + mid = (mid + Math.imul(ah8, bl6)) | 0; + hi = (hi + Math.imul(ah8, bh6)) | 0; + lo = (lo + Math.imul(al7, bl7)) | 0; + mid = (mid + Math.imul(al7, bh7)) | 0; + mid = (mid + Math.imul(ah7, bl7)) | 0; + hi = (hi + Math.imul(ah7, bh7)) | 0; + lo = (lo + Math.imul(al6, bl8)) | 0; + mid = (mid + Math.imul(al6, bh8)) | 0; + mid = (mid + Math.imul(ah6, bl8)) | 0; + hi = (hi + Math.imul(ah6, bh8)) | 0; + lo = (lo + Math.imul(al5, bl9)) | 0; + mid = (mid + Math.imul(al5, bh9)) | 0; + mid = (mid + Math.imul(ah5, bl9)) | 0; + hi = (hi + Math.imul(ah5, bh9)) | 0; + + let w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; + w14 &= 0x3ffffff; + + /* k = 15 */ + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = (mid + Math.imul(ah9, bl6)) | 0; + hi = Math.imul(ah9, bh6); + lo = (lo + Math.imul(al8, bl7)) | 0; + mid = (mid + Math.imul(al8, bh7)) | 0; + mid = (mid + Math.imul(ah8, bl7)) | 0; + hi = (hi + Math.imul(ah8, bh7)) | 0; + lo = (lo + Math.imul(al7, bl8)) | 0; + mid = (mid + Math.imul(al7, bh8)) | 0; + mid = (mid + Math.imul(ah7, bl8)) | 0; + hi = (hi + Math.imul(ah7, bh8)) | 0; + lo = (lo + Math.imul(al6, bl9)) | 0; + mid = (mid + Math.imul(al6, bh9)) | 0; + mid = (mid + Math.imul(ah6, bl9)) | 0; + hi = (hi + Math.imul(ah6, bh9)) | 0; + + let w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; + w15 &= 0x3ffffff; + + /* k = 16 */ + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = (mid + Math.imul(ah9, bl7)) | 0; + hi = Math.imul(ah9, bh7); + lo = (lo + Math.imul(al8, bl8)) | 0; + mid = (mid + Math.imul(al8, bh8)) | 0; + mid = (mid + Math.imul(ah8, bl8)) | 0; + hi = (hi + Math.imul(ah8, bh8)) | 0; + lo = (lo + Math.imul(al7, bl9)) | 0; + mid = (mid + Math.imul(al7, bh9)) | 0; + mid = (mid + Math.imul(ah7, bl9)) | 0; + hi = (hi + Math.imul(ah7, bh9)) | 0; + + let w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; + w16 &= 0x3ffffff; + + /* k = 17 */ + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = (mid + Math.imul(ah9, bl8)) | 0; + hi = Math.imul(ah9, bh8); + lo = (lo + Math.imul(al8, bl9)) | 0; + mid = (mid + Math.imul(al8, bh9)) | 0; + mid = (mid + Math.imul(ah8, bl9)) | 0; + hi = (hi + Math.imul(ah8, bh9)) | 0; + + let w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; + w17 &= 0x3ffffff; + + /* k = 18 */ + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = (mid + Math.imul(ah9, bl9)) | 0; + hi = Math.imul(ah9, bh9); + + let w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; + w18 &= 0x3ffffff; + + o[0] = w0; + o[1] = w1; + o[2] = w2; + o[3] = w3; + o[4] = w4; + o[5] = w5; + o[6] = w6; + o[7] = w7; + o[8] = w8; + o[9] = w9; + o[10] = w10; + o[11] = w11; + o[12] = w12; + o[13] = w13; + o[14] = w14; + o[15] = w15; + o[16] = w16; + o[17] = w17; + o[18] = w18; + + if (c !== 0) { + o[19] = c; + out.length += 1; + } + + // Note: we shouldn't need to strip here. + return out; + } + + // Polyfill comb. + if (!Math.imul) + comb10MulTo = smallMulTo; + + /* + * Expose + */ + + BN.Red = Red; + + bn = BN; + return bn; + } + + /*! + * bn.js - big numbers for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var bnBrowser; + var hasRequiredBnBrowser; + + function requireBnBrowser () { + if (hasRequiredBnBrowser) return bnBrowser; + hasRequiredBnBrowser = 1; + + bnBrowser = requireBn(); + return bnBrowser; + } + + var chacha20; + var hasRequiredChacha20; + + function requireChacha20 () { + if (hasRequiredChacha20) return chacha20; + hasRequiredChacha20 = 1; + + const assert = requireAssert(); + + /* + * Constants + */ + + const BIG_ENDIAN = new Int8Array(new Int16Array([1]).buffer)[0] === 0; + + /** + * ChaCha20 + */ + + class ChaCha20 { + /** + * Create a ChaCha20 context. + * @constructor + */ + + constructor() { + this.state = new Uint32Array(16); + this.stream = new Uint32Array(16); + this.bytes = new Uint8Array(this.stream.buffer); + this.pos = -1; + + if (BIG_ENDIAN) + this.bytes = bufferExports.Buffer.alloc(64); + } + + /** + * Initialize chacha20 with a key, nonce, and counter. + * @param {Buffer} key + * @param {Buffer} nonce + * @param {Number} counter + */ + + init(key, nonce, counter) { + if (counter == null) + counter = 0; + + assert(bufferExports.Buffer.isBuffer(key)); + assert(bufferExports.Buffer.isBuffer(nonce)); + assert(Number.isSafeInteger(counter)); + + if (key.length !== 16 && key.length !== 32) + throw new RangeError('Invalid key size.'); + + if (nonce.length >= 24) { + key = ChaCha20.derive(key, nonce.slice(0, 16)); + nonce = nonce.slice(16); + } + + this.state[0] = 0x61707865; + this.state[1] = key.length < 32 ? 0x3120646e : 0x3320646e; + this.state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32; + this.state[3] = 0x6b206574; + this.state[4] = readU32(key, 0); + this.state[5] = readU32(key, 4); + this.state[6] = readU32(key, 8); + this.state[7] = readU32(key, 12); + this.state[8] = readU32(key, 16 % key.length); + this.state[9] = readU32(key, 20 % key.length); + this.state[10] = readU32(key, 24 % key.length); + this.state[11] = readU32(key, 28 % key.length); + this.state[12] = counter >>> 0; + + if (nonce.length === 8) { + this.state[13] = (counter / 0x100000000) >>> 0; + this.state[14] = readU32(nonce, 0); + this.state[15] = readU32(nonce, 4); + } else if (nonce.length === 12) { + this.state[13] = readU32(nonce, 0); + this.state[14] = readU32(nonce, 4); + this.state[15] = readU32(nonce, 8); + } else if (nonce.length === 16) { + this.state[12] = readU32(nonce, 0); + this.state[13] = readU32(nonce, 4); + this.state[14] = readU32(nonce, 8); + this.state[15] = readU32(nonce, 12); + } else { + throw new RangeError('Invalid nonce size.'); + } + + this.pos = 0; + + return this; + } + + /** + * Encrypt/decrypt data. + * @param {Buffer} data - Will be mutated. + * @returns {Buffer} + */ + + encrypt(data) { + assert(bufferExports.Buffer.isBuffer(data)); + + if (this.pos === -1) + throw new Error('Context is not initialized.'); + + for (let i = 0; i < data.length; i++) { + if ((this.pos & 63) === 0) { + this._block(); + this.pos = 0; + } + + data[i] ^= this.bytes[this.pos++]; + } + + return data; + } + + /** + * Stir the stream. + */ + + _block() { + for (let i = 0; i < 16; i++) + this.stream[i] = this.state[i]; + + for (let i = 0; i < 10; i++) { + qround(this.stream, 0, 4, 8, 12); + qround(this.stream, 1, 5, 9, 13); + qround(this.stream, 2, 6, 10, 14); + qround(this.stream, 3, 7, 11, 15); + qround(this.stream, 0, 5, 10, 15); + qround(this.stream, 1, 6, 11, 12); + qround(this.stream, 2, 7, 8, 13); + qround(this.stream, 3, 4, 9, 14); + } + + for (let i = 0; i < 16; i++) + this.stream[i] += this.state[i]; + + if (BIG_ENDIAN) { + for (let i = 0; i < 16; i++) + writeU32(this.bytes, this.stream[i], i * 4); + } + + this.state[12] += 1; + + if (this.state[12] === 0) + this.state[13] += 1; + } + + /** + * Destroy context. + */ + + destroy() { + for (let i = 0; i < 16; i++) { + this.state[i] = 0; + this.stream[i] = 0; + } + + if (BIG_ENDIAN) { + for (let i = 0; i < 64; i++) + this.bytes[i] = 0; + } + + this.pos = -1; + + return this; + } + + /** + * Derive key with XChaCha20. + * @param {Buffer} key + * @param {Buffer} nonce + * @returns {Buffer} + */ + + static derive(key, nonce) { + assert(bufferExports.Buffer.isBuffer(key)); + assert(bufferExports.Buffer.isBuffer(nonce)); + + if (key.length !== 16 && key.length !== 32) + throw new RangeError('Invalid key size.'); + + if (nonce.length !== 16) + throw new RangeError('Invalid nonce size.'); + + const state = new Uint32Array(16); + + state[0] = 0x61707865; + state[1] = key.length < 32 ? 0x3120646e : 0x3320646e; + state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32; + state[3] = 0x6b206574; + state[4] = readU32(key, 0); + state[5] = readU32(key, 4); + state[6] = readU32(key, 8); + state[7] = readU32(key, 12); + state[8] = readU32(key, 16 % key.length); + state[9] = readU32(key, 20 % key.length); + state[10] = readU32(key, 24 % key.length); + state[11] = readU32(key, 28 % key.length); + state[12] = readU32(nonce, 0); + state[13] = readU32(nonce, 4); + state[14] = readU32(nonce, 8); + state[15] = readU32(nonce, 12); + + for (let i = 0; i < 10; i++) { + qround(state, 0, 4, 8, 12); + qround(state, 1, 5, 9, 13); + qround(state, 2, 6, 10, 14); + qround(state, 3, 7, 11, 15); + qround(state, 0, 5, 10, 15); + qround(state, 1, 6, 11, 12); + qround(state, 2, 7, 8, 13); + qround(state, 3, 4, 9, 14); + } + + const out = bufferExports.Buffer.alloc(32); + + writeU32(out, state[0], 0); + writeU32(out, state[1], 4); + writeU32(out, state[2], 8); + writeU32(out, state[3], 12); + writeU32(out, state[12], 16); + writeU32(out, state[13], 20); + writeU32(out, state[14], 24); + writeU32(out, state[15], 28); + + return out; + } + } + + /* + * Static + */ + + ChaCha20.native = 0; + + /* + * Helpers + */ + + function qround(x, a, b, c, d) { + x[a] += x[b]; + x[d] = rotl32(x[d] ^ x[a], 16); + + x[c] += x[d]; + x[b] = rotl32(x[b] ^ x[c], 12); + + x[a] += x[b]; + x[d] = rotl32(x[d] ^ x[a], 8); + + x[c] += x[d]; + x[b] = rotl32(x[b] ^ x[c], 7); + } + + function rotl32(w, b) { + return (w << b) | (w >>> (32 - b)); + } + + function readU32(data, off) { + return (data[off++] + + data[off++] * 0x100 + + data[off++] * 0x10000 + + data[off] * 0x1000000); + } + + function writeU32(dst, num, off) { + dst[off++] = num; + num >>>= 8; + dst[off++] = num; + num >>>= 8; + dst[off++] = num; + num >>>= 8; + dst[off++] = num; + return off; + } + + /* + * Expose + */ + + chacha20 = ChaCha20; + return chacha20; + } + + /*! + * chacha20.js - chacha20 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var chacha20Browser; + var hasRequiredChacha20Browser; + + function requireChacha20Browser () { + if (hasRequiredChacha20Browser) return chacha20Browser; + hasRequiredChacha20Browser = 1; + + chacha20Browser = requireChacha20(); + return chacha20Browser; + } + + var hmac; + var hasRequiredHmac; + + function requireHmac () { + if (hasRequiredHmac) return hmac; + hasRequiredHmac = 1; + + const assert = requireAssert(); + + /** + * HMAC + */ + + class HMAC { + /** + * Create an HMAC. + * @param {Function} Hash + * @param {Number} size + * @param {Array} [x=[]] + * @param {Array} [y=[]] + */ + + constructor(Hash, size, x = [], y = []) { + assert(typeof Hash === 'function'); + assert((size >>> 0) === size); + assert(Array.isArray(x)); + assert(Array.isArray(y)); + + this.hash = Hash; + this.size = size; + this.x = x; + this.y = y; + + this.inner = new Hash(); + this.outer = new Hash(); + } + + /** + * Initialize HMAC context. + * @param {Buffer} data + */ + + init(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + // Shorten key + if (key.length > this.size) { + const Hash = this.hash; + const h = new Hash(); + + h.init(...this.x); + h.update(key); + + key = h.final(...this.y); + + assert(key.length <= this.size); + } + + // Pad key + const pad = bufferExports.Buffer.alloc(this.size); + + for (let i = 0; i < key.length; i++) + pad[i] = key[i] ^ 0x36; + + for (let i = key.length; i < pad.length; i++) + pad[i] = 0x36; + + this.inner.init(...this.x); + this.inner.update(pad); + + for (let i = 0; i < key.length; i++) + pad[i] = key[i] ^ 0x5c; + + for (let i = key.length; i < pad.length; i++) + pad[i] = 0x5c; + + this.outer.init(...this.x); + this.outer.update(pad); + + return this; + } + + /** + * Update HMAC context. + * @param {Buffer} data + */ + + update(data) { + this.inner.update(data); + return this; + } + + /** + * Finalize HMAC context. + * @returns {Buffer} + */ + + final() { + this.outer.update(this.inner.final(...this.y)); + return this.outer.final(...this.y); + } + } + + /* + * Expose + */ + + hmac = HMAC; + return hmac; + } + + var sha256$1; + var hasRequiredSha256; + + function requireSha256 () { + if (hasRequiredSha256) return sha256$1; + hasRequiredSha256 = 1; + + const assert = requireAssert(); + const HMAC = requireHmac(); + + /* + * Constants + */ + + const FINALIZED = -1; + const DESC = bufferExports.Buffer.alloc(8, 0x00); + const PADDING = bufferExports.Buffer.alloc(64, 0x00); + + PADDING[0] = 0x80; + + const K = new Uint32Array([ + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 + ]); + + /** + * SHA256 + */ + + class SHA256 { + constructor() { + this.state = new Uint32Array(8); + this.msg = new Uint32Array(64); + this.block = bufferExports.Buffer.alloc(64); + this.size = FINALIZED; + } + + init() { + this.state[0] = 0x6a09e667; + this.state[1] = 0xbb67ae85; + this.state[2] = 0x3c6ef372; + this.state[3] = 0xa54ff53a; + this.state[4] = 0x510e527f; + this.state[5] = 0x9b05688c; + this.state[6] = 0x1f83d9ab; + this.state[7] = 0x5be0cd19; + this.size = 0; + return this; + } + + update(data) { + assert(bufferExports.Buffer.isBuffer(data)); + this._update(data, data.length); + return this; + } + + final() { + return this._final(bufferExports.Buffer.alloc(32)); + } + + _update(data, len) { + assert(this.size !== FINALIZED, 'Context is not initialized.'); + + let pos = this.size & 63; + let off = 0; + + this.size += len; + + if (pos > 0) { + let want = 64 - pos; + + if (want > len) + want = len; + + data.copy(this.block, pos, off, off + want); + + pos += want; + len -= want; + off += want; + + if (pos < 64) + return; + + this._transform(this.block, 0); + } + + while (len >= 64) { + this._transform(data, off); + off += 64; + len -= 64; + } + + if (len > 0) + data.copy(this.block, 0, off, off + len); + } + + _final(out) { + assert(this.size !== FINALIZED, 'Context is not initialized.'); + + const pos = this.size & 63; + const len = this.size * 8; + + writeU32(DESC, (len * (1 / 0x100000000)) >>> 0, 0); + writeU32(DESC, len >>> 0, 4); + + this._update(PADDING, 1 + ((119 - pos) & 63)); + this._update(DESC, 8); + + for (let i = 0; i < 8; i++) { + writeU32(out, this.state[i], i * 4); + this.state[i] = 0; + } + + for (let i = 0; i < 64; i++) + this.msg[i] = 0; + + for (let i = 0; i < 64; i++) + this.block[i] = 0; + + this.size = FINALIZED; + + return out; + } + + _transform(chunk, pos) { + const W = this.msg; + + let a = this.state[0]; + let b = this.state[1]; + let c = this.state[2]; + let d = this.state[3]; + let e = this.state[4]; + let f = this.state[5]; + let g = this.state[6]; + let h = this.state[7]; + let i = 0; + + for (; i < 16; i++) + W[i] = readU32(chunk, pos + i * 4); + + for (; i < 64; i++) + W[i] = sigma1(W[i - 2]) + W[i - 7] + sigma0(W[i - 15]) + W[i - 16]; + + for (i = 0; i < 64; i++) { + const t1 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; + const t2 = Sigma0(a) + Maj(a, b, c); + + h = g; + g = f; + f = e; + + e = (d + t1) >>> 0; + + d = c; + c = b; + b = a; + + a = (t1 + t2) >>> 0; + } + + this.state[0] += a; + this.state[1] += b; + this.state[2] += c; + this.state[3] += d; + this.state[4] += e; + this.state[5] += f; + this.state[6] += g; + this.state[7] += h; + } + + static hash() { + return new SHA256(); + } + + static hmac() { + return new HMAC(SHA256, 64); + } + + static digest(data) { + return SHA256.ctx.init().update(data).final(); + } + + static root(left, right) { + assert(bufferExports.Buffer.isBuffer(left) && left.length === 32); + assert(bufferExports.Buffer.isBuffer(right) && right.length === 32); + return SHA256.ctx.init().update(left).update(right).final(); + } + + static multi(x, y, z) { + const {ctx} = SHA256; + + ctx.init(); + ctx.update(x); + ctx.update(y); + + if (z) + ctx.update(z); + + return ctx.final(); + } + + static mac(data, key) { + return SHA256.hmac().init(key).update(data).final(); + } + } + + /* + * Static + */ + + SHA256.native = 0; + SHA256.id = 'SHA256'; + SHA256.size = 32; + SHA256.bits = 256; + SHA256.blockSize = 64; + SHA256.zero = bufferExports.Buffer.alloc(32, 0x00); + SHA256.ctx = new SHA256(); + + /* + * Helpers + */ + + function Sigma0(x) { + return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10); + } + + function Sigma1(x) { + return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7); + } + + function sigma0(x) { + return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3); + } + + function sigma1(x) { + return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10); + } + + function Ch(x, y, z) { + return z ^ (x & (y ^ z)); + } + + function Maj(x, y, z) { + return (x & y) | (z & (x | y)); + } + + function readU32(data, off) { + return (data[off++] * 0x1000000 + + data[off++] * 0x10000 + + data[off++] * 0x100 + + data[off]); + } + + function writeU32(data, num, off) { + data[off++] = num >>> 24; + data[off++] = num >>> 16; + data[off++] = num >>> 8; + data[off++] = num; + return off; + } + + /* + * Expose + */ + + sha256$1 = SHA256; + return sha256$1; + } + + /*! + * sha256.js - sha256 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var sha256Browser; + var hasRequiredSha256Browser; + + function requireSha256Browser () { + if (hasRequiredSha256Browser) return sha256Browser; + hasRequiredSha256Browser = 1; + + sha256Browser = requireSha256(); + return sha256Browser; + } + + var batchRng; + var hasRequiredBatchRng; + + function requireBatchRng () { + if (hasRequiredBatchRng) return batchRng; + hasRequiredBatchRng = 1; + + const assert = requireAssert(); + const BN = requireBnBrowser(); + const ChaCha20 = requireChacha20Browser(); + const SHA256 = requireSha256Browser(); + + /** + * BatchRNG + */ + + class BatchRNG { + constructor(curve, encode = key => key) { + this.curve = curve; + this.encode = encode; + this.hash = new SHA256(); + this.chacha = new ChaCha20(); + this.key = bufferExports.Buffer.alloc(32, 0x00); + this.iv = bufferExports.Buffer.alloc(8, 0x00); + this.cache = [new BN(1), new BN(1)]; + } + + init(batch) { + assert(Array.isArray(batch)); + + this.hash.init(); + + for (const [msg, sig, key] of batch) { + this.hash.update(SHA256.digest(msg)); + this.hash.update(sig); + this.hash.update(this.encode(key)); + } + + this.key = this.hash.final(); + this.cache[0] = new BN(1); + this.cache[1] = new BN(1); + + return this; + } + + encrypt(counter) { + const size = this.curve.scalarSize * 2; + const data = bufferExports.Buffer.alloc(size, 0x00); + const left = data.slice(0, this.curve.scalarSize); + const right = data.slice(this.curve.scalarSize); + + this.chacha.init(this.key, this.iv, counter); + this.chacha.encrypt(data); + + return [ + this.curve.decodeScalar(left), + this.curve.decodeScalar(right) + ]; + } + + refresh(counter) { + let overflow = 0; + + for (;;) { + // First word is always zero. + this.iv[4] = overflow; + this.iv[5] = overflow >>> 8; + this.iv[6] = overflow >>> 16; + this.iv[7] = overflow >>> 24; + + overflow += 1; + + const [s1, s2] = this.encrypt(counter); + + if (s1.isZero() || s1.cmp(this.curve.n) >= 0) + continue; + + if (s2.isZero() || s2.cmp(this.curve.n) >= 0) + continue; + + this.cache[0] = s1; + this.cache[1] = s2; + + break; + } + } + + generate(index) { + assert((index >>> 0) === index); + + if (index & 1) + this.refresh(index >>> 1); + + return this.cache[index & 1]; + } + } + + /* + * Expose + */ + + batchRng = BatchRNG; + return batchRng; + } + + var elliptic = {}; + + var hasRequiredElliptic; + + function requireElliptic () { + if (hasRequiredElliptic) return elliptic; + hasRequiredElliptic = 1; + + const {custom} = requireCustomBrowser(); + const BN = requireBnBrowser(); + + /* + * Constants + */ + + const types = { + AFFINE: 0, + JACOBIAN: 1, + PROJECTIVE: 2, + EXTENDED: 3 + }; + + const jsfIndex = [ + -3, // -1 -1 + -1, // -1 0 + -5, // -1 1 + -7, // 0 -1 + 0, // 0 0 + 7, // 0 1 + 5, // 1 -1 + 1, // 1 0 + 3 // 1 1 + ]; + + let uid = 0; + + /** + * Curve + */ + + class Curve { + constructor(Point, type, conf) { + this.Point = null; + this.id = null; + this.uid = uid++; + this.ossl = null; + this.type = 'base'; + this.endian = 'be'; + this.hash = null; + this.prefix = null; + this.context = false; + this.prime = null; + this.p = null; + this.red = null; + this.fieldSize = 0; + this.fieldBits = 0; + this.adjustedSize = 0; + this.signBit = 0; + this.mask = 0; + this.n = null; + this.h = null; + this.q = null; + this.z = null; + this.g = null; + this.nh = null; + this.scalarSize = 0; + this.scalarBits = 0; + this.zero = null; + this.one = null; + this.two = null; + this.three = null; + this.four = null; + this.i2 = null; + this.i3 = null; + this.i4 = null; + this.i6 = null; + this.torsion = null; + this.endo = null; + this.hi = null; + this._init(Point, type, conf); + } + + _init(Point, type, conf) { + assert(typeof Point === 'function'); + assert(typeof type === 'string'); + assert(conf && typeof conf === 'object'); + assert(conf.red == null || (conf.red instanceof BN.Red)); + assert(conf.p != null, 'Must pass a prime.'); + assert(conf.id == null || typeof conf.id === 'string'); + assert(conf.ossl == null || typeof conf.ossl === 'string'); + assert(conf.endian == null || typeof conf.endian === 'string'); + assert(conf.hash == null || typeof conf.hash === 'string'); + assert(conf.prefix == null || typeof conf.prefix === 'string'); + assert(conf.context == null || typeof conf.context === 'boolean'); + assert(conf.prime == null || typeof conf.prime === 'string'); + assert(conf.torsion == null || Array.isArray(conf.torsion)); + + // Point class. + this.Point = Point; + + // Meta. + this.id = conf.id || null; + this.ossl = conf.ossl || null; + this.type = type; + this.endian = conf.endian || (type === 'short' ? 'be' : 'le'); + this.hash = conf.hash || null; + this.prefix = conf.prefix ? bufferExports.Buffer.from(conf.prefix, 'binary') : null; + this.context = conf.context || false; + this.prime = conf.prime || null; + + // Prime. + this.p = BN.fromJSON(conf.p); + + // Reduction. + if (conf.red) { + this.red = conf.red; + } else { + // Use Montgomery when there is no fast reduction for the prime. + this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); + this.red.precompute(); + } + + // Precalculate encoding length. + this.fieldSize = this.p.byteLength(); + this.fieldBits = this.p.bitLength(); + this.adjustedSize = this.fieldSize + ((this.fieldBits & 7) === 0); + this.signBit = this.adjustedSize * 8 - 1; + this.mask = 0xff; + + if ((this.fieldBits & 7) !== 0) + this.mask = (1 << (this.fieldBits & 7)) - 1; + + // Curve configuration, optional. + this.n = BN.fromJSON(conf.n || '0'); + this.h = BN.fromJSON(conf.h || '1'); + this.q = this.n.mul(this.h); + this.z = BN.fromJSON(conf.z || '0').toRed(this.red); + this.g = null; + this.nh = this.n.ushrn(1); + this.scalarSize = this.n.byteLength(); + this.scalarBits = this.n.bitLength(); + + // Useful for many curves. + this.zero = new BN(0).toRed(this.red); + this.one = new BN(1).toRed(this.red); + this.two = new BN(2).toRed(this.red); + this.three = new BN(3).toRed(this.red); + this.four = new BN(4).toRed(this.red); + + // Inverses. + this.i2 = this.two.redInvert(); + this.i3 = this.three.redInvert(); + this.i4 = this.i2.redSqr(); + this.i6 = this.i2.redMul(this.i3); + + // Torsion. + this.torsion = new Array(this.h.word(0)); + + for (let i = 0; i < this.torsion.length; i++) + this.torsion[i] = this.point(); + + // Endomorphism. + this.endo = null; + + // Cache. + this.hi = null; + + // Memoize. + this._scale = memoize(this._scale, this); + this.isIsomorphic = memoize(this.isIsomorphic, this); + this.isIsogenous = memoize(this.isIsogenous, this); + + // Sanity checks. + assert(this.p.sign() > 0 && this.p.isOdd()); + assert(this.n.sign() >= 0); + assert(this.h.sign() > 0 && this.h.cmpn(255) <= 0); + assert(this.endian === 'be' || this.endian === 'le'); + + return this; + } + + _finalize(conf) { + assert(conf && typeof conf === 'object'); + + // Create base point. + this.g = conf.g ? this.pointFromJSON(conf.g) : this.point(); + + // Parse small order points. + if (conf.torsion) { + assert(conf.torsion.length === this.torsion.length); + + for (let i = 0; i < this.torsion.length; i++) + this.torsion[i] = this.pointFromJSON(conf.torsion[i]); + } + + return this; + } + + _findTorsion() { + // Find all torsion points by grinding. + assert(!this.n.isZero()); + + const h = this.h.word(0); + const x = this.one.redNeg(); + const out = [this.point()]; + const set = new Set(); + + let len = h; + + while (out.length < len) { + let p; + + x.redIAdd(this.one); + + try { + p = this.pointFromX(x.clone()); + } catch (e) { + continue; + } + + try { + p = p.mul(this.n); + } catch (e) { + len = 2; + continue; + } + + if (p.isInfinity()) + continue; + + p.normalize(); + + for (const point of [p, p.neg()]) { + const key = point.key(); + + if (!set.has(key)) { + out.push(point); + set.add(key); + } + } + } + + out.sort((a, b) => a.cmp(b)); + + while (out.length < h) + out.push(this.point()); + + return out; + } + + _fixedMul(p, k) { + // Fixed-base method for point multiplication. + // + // [ECPM] "Windowed method". + // [GECC] Page 95, Section 3.3. + // + // Windows are appropriately shifted to avoid any + // doublings. This reduces a 256 bit multiplication + // down to 64 additions with a window size of 4. + assert(p instanceof Point); + assert(k instanceof BN); + assert(p.pre && p.pre.windows); + + // Get precomputed windows. + const {width, points} = p._getWindows(0, 0); + + // Recompute window size. + const size = 1 << width; + + // Recompute steps. + const bits = k.bitLength(); + const steps = ((bits + width - 1) / width) >>> 0; + + // Multiply. + let acc = this.jpoint(); + + for (let i = 0; i < steps; i++) { + const bits = k.bits(i * width, width); + + acc = acc.add(points[i * size + bits]); + } + + // Adjust sign. + if (k.isNeg()) + acc = acc.neg(); + + return acc; + } + + _fixedNafMul(p, k) { + // Fixed-base NAF windowing method for point multiplication. + // + // [GECC] Algorithm 3.42, Page 105, Section 3.3. + assert(p instanceof Point); + assert(k instanceof BN); + assert(p.pre && p.pre.doubles); + + // Get precomputed doubles. + const {step, points} = p._getDoubles(0, 0); + + // Get fixed NAF (in a more windowed form). + const naf = getFixedNAF(k, 2, k.bitLength() + 1, step); + + // Compute steps. + const I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3; + + // Multiply. + let a = this.jpoint(); + let b = this.jpoint(); + + for (let i = I; i > 0; i--) { + for (let j = 0; j < naf.length; j++) { + const nafW = naf[j]; + + if (nafW === i) + b = b.add(points[j]); + else if (nafW === -i) + b = b.sub(points[j]); + } + + a = a.add(b); + } + + return a; + } + + _wnafMul(w, p, k) { + // Window NAF method for point multiplication. + // + // [GECC] Algorithm 3.36, Page 100, Section 3.3. + assert(p instanceof Point); + assert(k instanceof BN); + + // Precompute window. + const {width, points} = p._safeNAF(w); + + // Get NAF form. + const naf = getNAF(k, width, k.bitLength() + 1); + + // Add `this`*(N+1) for every w-NAF index. + let acc = this.jpoint(); + + for (let i = naf.length - 1; i >= 0; i--) { + const z = naf[i]; + + if (i !== naf.length - 1) + acc = acc.dbl(); + + if (z > 0) + acc = acc.add(points[(z - 1) >> 1]); + else if (z < 0) + acc = acc.sub(points[(-z - 1) >> 1]); + } + + return acc; + } + + _wnafMulAdd(w, points, coeffs) { + // Multiple point multiplication, also known + // as "Shamir's trick" (with interleaved NAFs). + // + // [GECC] Algorithm 3.48, Page 109, Section 3.3.3. + // Algorithm 3.51, Page 112, Section 3.3. + // + // This is particularly useful for signature + // verifications and mutiplications after an + // endomorphism split. + assert((w >>> 0) === w); + assert(Array.isArray(points)); + assert(Array.isArray(coeffs)); + assert(points.length === coeffs.length); + + const length = points.length; + const wnd = new Array(length); + const naf = new Array(length); + + // Check arrays and calculate size. + let max = 0; + + for (let i = 0; i < length; i++) { + const point = points[i]; + const coeff = coeffs[i]; + + assert(point instanceof Point); + assert(coeff instanceof BN); + + if (i > 0 && point.type !== points[i - 1].type) + throw new Error('Cannot mix points.'); + + // Avoid sparse arrays. + wnd[i] = null; + naf[i] = null; + + // Compute max scalar size. + max = Math.max(max, coeff.bitLength() + 1); + } + + // Compute NAFs. + let ppoint = null; + let pcoeff = null; + let len = 0; + + for (let i = 0; i < length; i++) { + const point = points[i]; + const coeff = coeffs[i]; + const pre = point._getNAF(0); + + // Use precomputation if available. + if (pre) { + wnd[len] = pre.points; + naf[len] = getNAF(coeff, pre.width, max); + len += 1; + continue; + } + + // Save last non-precomputed point. + if (!ppoint) { + ppoint = point; + pcoeff = coeff; + continue; + } + + // Compute JSF in NAF form. + wnd[len] = ppoint._getJNAF(point); + naf[len] = getJNAF(pcoeff, coeff, max); + + ppoint = null; + pcoeff = null; + + len += 1; + } + + // Regular NAF for odd points. + if (ppoint) { + const nafw = ppoint._safeNAF(w); + + wnd[len] = nafw.points; + naf[len] = getNAF(pcoeff, nafw.width, max); + + len += 1; + } + + // Multiply and add. + let acc = this.jpoint(); + + for (let i = max - 1; i >= 0; i--) { + if (i !== max - 1) + acc = acc.dbl(); + + for (let j = 0; j < len; j++) { + const z = naf[j][i]; + + if (z > 0) + acc = acc.add(wnd[j][(z - 1) >> 1]); + else if (z < 0) + acc = acc.sub(wnd[j][(-z - 1) >> 1]); + } + } + + return acc; + } + + _endoWnafMulAdd(points, coeffs) { + throw new Error('Not implemented.'); + } + + _scale(curve, invert) { + assert(curve instanceof Curve); + assert(curve.p.eq(this.p)); + + switch (curve.type) { + case 'short': + return this._scaleShort(curve, invert); + case 'mont': + return this._scaleMont(curve, invert); + case 'edwards': + return this._scaleEdwards(curve, invert); + default: + throw new Error('Not implemented.'); + } + } + + _scaleShort(curve, invert) { + throw new Error('Not implemented.'); + } + + _scaleMont(curve, invert) { + throw new Error('Not implemented.'); + } + + _scaleEdwards(curve, invert) { + throw new Error('Not implemented.'); + } + + isElliptic() { + throw new Error('Not implemented.'); + } + + jinv() { + throw new Error('Not implemented.'); + } + + isComplete() { + return false; + } + + precompute(rng) { + assert(!this.g.isInfinity(), 'Must have base point.'); + assert(!this.n.isZero(), 'Must have order.'); + + this.g.precompute(this.n.bitLength(), rng); + + return this; + } + + scalar(num, base, endian) { + const k = new BN(num, base, endian); + + assert(!k.red); + + if (this.n.isZero()) + return k; + + return k.imod(this.n); + } + + field(num, base, endian) { + const x = BN.cast(num, base, endian); + + if (x.red) + return x.forceRed(this.red); + + return x.toRed(this.red); + } + + point(x, y) { + throw new Error('Not implemented.'); + } + + jpoint(x, y, z) { + throw new Error('Not implemented.'); + } + + xpoint(x, z) { + throw new Error('Not implemented.'); + } + + cpoint(xx, xz, yy, yz) { + assert(xx instanceof BN); + assert(xz instanceof BN); + assert(yy instanceof BN); + assert(yz instanceof BN); + + if (xz.isZero() || yz.isZero()) + return this.point(); + + const z = xz.redMul(yz).redInvert(); + const x = xx.redMul(yz).redMul(z); + const y = yy.redMul(xz).redMul(z); + + return this.point(x, y); + } + + solveX2(y) { + throw new Error('Not implemented.'); + } + + solveX(y) { + return this.solveX2(y).redSqrt(); + } + + solveY2(x) { + throw new Error('Not implemented.'); + } + + solveY(x) { + return this.solveY2(x).redSqrt(); + } + + validate(point) { + throw new Error('Not implemented.'); + } + + pointFromX(x, sign) { + throw new Error('Not implemented.'); + } + + pointFromY(y, sign) { + throw new Error('Not implemented.'); + } + + isIsomorphic(curve) { + throw new Error('Not implemented.'); + } + + isIsogenous(curve) { + throw new Error('Not implemented.'); + } + + pointFromShort(point) { + throw new Error('Not implemented.'); + } + + pointFromMont(point, sign) { + throw new Error('Not implemented.'); + } + + pointFromEdwards(point) { + throw new Error('Not implemented.'); + } + + pointFromUniform(u) { + throw new Error('Not implemented.'); + } + + pointToUniform(p) { + throw new Error('Not implemented.'); + } + + pointFromHash(bytes, pake = false) { + // [H2EC] "Roadmap". + assert(bufferExports.Buffer.isBuffer(bytes)); + assert(typeof pake === 'boolean'); + + if (bytes.length !== this.fieldSize * 2) + throw new Error('Invalid hash size.'); + + // Random oracle encoding. + // Ensure a proper distribution. + const s1 = bytes.slice(0, this.fieldSize); + const s2 = bytes.slice(this.fieldSize); + const u1 = this.decodeUniform(s1); + const u2 = this.decodeUniform(s2); + const p1 = this.pointFromUniform(u1); + const p2 = this.pointFromUniform(u2); + const p3 = p1.add(p2); + + return pake ? p3.mulH() : p3; + } + + pointToHash(p, subgroup, rng) { + // [SQUARED] Algorithm 1, Page 8, Section 3.3. + assert(p instanceof this.Point); + assert((subgroup >>> 0) === subgroup); + + // Add a random torsion component. + const i = subgroup % this.torsion.length; + const p0 = p.add(this.torsion[i]); + + // Average Cost (R = sqrt): + // + // SSWU (~4 iterations) => 8I + 16R + // SVDW (~4 iterations) => 12I + 28R + // Elligator 1 (~2 iterations) => 6I + 10R + // Elligator 2 (~2 iterations) => 4I + 6R + // Ristretto (~1 iteration) => 1I + 2R + h*1R + for (;;) { + const u1 = this.randomField(rng); + const p1 = this.pointFromUniform(u1); + + // Avoid 2-torsion points: + // Short Weierstrass: ((A / 3) / B, 0) + // Montgomery: (0, 0) + // Twisted Edwards: (0, -1) + if (p1.neg().eq(p1)) + continue; + + const p2 = p0.sub(p1); + const hint = randomInt(rng); + + let u2; + try { + u2 = this.pointToUniform(p2, hint & 15); + } catch (e) { + if (e.message === 'Invalid point.') + continue; + throw e; + } + + const s1 = this.encodeUniform(u1, hint >>> 8); + const s2 = this.encodeUniform(u2, hint >>> 16); + + return bufferExports.Buffer.concat([s1, s2]); + } + } + + randomScalar(rng) { + const max = this.n.isZero() ? this.p : this.n; + return BN.random(rng, 1, max); + } + + randomField(rng) { + return BN.random(rng, 1, this.p).toRed(this.red); + } + + randomPoint(rng) { + let p; + + for (;;) { + const x = this.randomField(rng); + const sign = (randomInt(rng) & 1) !== 0; + + try { + p = this.pointFromX(x, sign); + } catch (e) { + continue; + } + + assert(p.validate()); + + return p.mulH(); + } + } + + mulAll(points, coeffs) { + return this.jmulAll(points, coeffs); + } + + jmulAll(points, coeffs) { + assert(Array.isArray(points)); + assert(points.length === 0 || (points[0] instanceof Point)); + + // Multiply with endomorphism if we're using affine points. + if (this.endo && points.length > 0 && points[0].type === types.AFFINE) + return this._endoWnafMulAdd(points, coeffs); + + // Otherwise, a regular Shamir's trick. + return this._wnafMulAdd(5, points, coeffs); + } + + mulH(k) { + assert(k instanceof BN); + return this.imulH(k.clone()); + } + + imulH(k) { + assert(k instanceof BN); + assert(!k.red); + + const word = this.h.word(0); + + // Optimize for powers of two. + if ((word & (word - 1)) === 0) { + const bits = this.h.bitLength(); + return k.iushln(bits - 1).imod(this.n); + } + + return k.imuln(word).imod(this.n); + } + + normalizeAll(points) { + assert(Array.isArray(points)); + + const len = points.length; + const z = new Array(len); + + for (let i = 0; i < len; i++) { + const p = points[i]; + + assert(p instanceof Point); + assert(p.curve === this); + + if (p.type === types.AFFINE) { + z[i] = this.one; + continue; + } + + z[i] = p.z; + } + + const zi = this.red.invertAll(z); + const out = new Array(len); + + for (let i = 0; i < len; i++) + out[i] = points[i].scale(zi[i]); + + return out; + } + + affinizeAll(points) { + return this.normalizeAll(points); + } + + clamp(scalar) { + // [RFC7748] Page 8, Section 5. + // [RFC8032] Section 5.1.5 & 5.2.5. + assert(bufferExports.Buffer.isBuffer(scalar)); + assert(scalar.length === this.scalarSize); + assert(this.scalarSize <= this.fieldSize); + + let top = (this.fieldBits & 7) || 8; + let lsb = 0; + let msb = this.scalarSize - 1; + + // Swap endianness. + if (this.endian === 'be') + [lsb, msb] = [msb, lsb]; + + // Adjust for low order. + if (this.scalarSize < this.fieldSize) + top = 8; + + // Ensure a multiple of the cofactor. + scalar[lsb] &= -this.h.word(0) & 0xff; + + // Clamp to the prime. + scalar[msb] &= (1 << top) - 1; + + // Set the high bit. + scalar[msb] |= 1 << (top - 1); + + return scalar; + } + + splitHash(bytes) { + // [RFC8032] Section 5.1.6 & 5.2.6. + assert(bufferExports.Buffer.isBuffer(bytes)); + assert(bytes.length === this.adjustedSize * 2); + assert(this.scalarSize <= this.adjustedSize); + + let off = 0; + + if (this.endian === 'be') + off = this.adjustedSize - this.scalarSize; + + const scalar = bytes.slice(off, off + this.scalarSize); + const prefix = bytes.slice(this.adjustedSize); + + this.clamp(scalar); + + return [scalar, prefix]; + } + + encodeField(x) { + // [SEC1] Page 12, Section 2.3.5. + assert(x instanceof BN); + assert(!x.red); + + return x.encode(this.endian, this.fieldSize); + } + + decodeField(bytes) { + // [SEC1] Page 13, Section 2.3.6. + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.fieldSize) + throw new Error('Invalid field element size.'); + + return BN.decode(bytes, this.endian); + } + + encodeAdjusted(x) { + assert(x instanceof BN); + assert(!x.red); + + return x.encode(this.endian, this.adjustedSize); + } + + decodeAdjusted(bytes) { + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.adjustedSize) + throw new Error('Invalid field element size.'); + + return BN.decode(bytes, this.endian); + } + + encodeScalar(k) { + // [SEC1] Page 13, Section 2.3.7. + assert(k instanceof BN); + assert(!k.red); + + return k.encode(this.endian, this.scalarSize); + } + + decodeScalar(bytes) { + // [SEC1] Page 14, Section 2.3.8. + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.scalarSize) + throw new Error('Invalid scalar size.'); + + return BN.decode(bytes, this.endian); + } + + encodeClamped(k) { + // [RFC7748] Page 8, Section 5. + // [RFC8032] Section 5.1.5 & 5.2.5. + return this.clamp(this.encodeScalar(k)); + } + + decodeClamped(bytes) { + // [RFC7748] Page 8, Section 5. + // [RFC8032] Section 5.1.5 & 5.2.5. + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.scalarSize) + throw new Error('Invalid scalar size.'); + + const clamped = this.clamp(bufferExports.Buffer.from(bytes)); + + return BN.decode(clamped, this.endian); + } + + encodeUniform(x, bits) { + assert(x instanceof BN); + assert((bits >>> 0) === bits); + + const msb = this.endian === 'le' ? this.fieldSize - 1 : 0; + const bytes = x.fromRed().encode(this.endian, this.fieldSize); + + bytes[msb] |= (bits & ~this.mask) & 0xff; + + return bytes; + } + + decodeUniform(bytes) { + assert(bufferExports.Buffer.isBuffer(bytes)); + + if (bytes.length !== this.fieldSize) + throw new Error('Invalid field size.'); + + const x = BN.decode(bytes, this.endian); + + x.iumaskn(this.fieldBits); + + return x.toRed(this.red); + } + + encodePoint(point, compact) { + assert(point instanceof Point); + return point.encode(compact); + } + + decodePoint(bytes) { + throw new Error('Not implemented.'); + } + + encodeX(point) { + throw new Error('Not implemented.'); + } + + decodeX(bytes) { + throw new Error('Not implemented.'); + } + + decodeEven(bytes) { + throw new Error('Not implemented.'); + } + + decodeSquare(bytes) { + throw new Error('Not implemented.'); + } + + toShort() { + throw new Error('Not implemented.'); + } + + toMont(b0) { + throw new Error('Not implemented.'); + } + + toEdwards(a0) { + throw new Error('Not implemented.'); + } + + pointToJSON(point, pre) { + assert(point instanceof Point); + return point.toJSON(pre); + } + + pointFromJSON(json) { + throw new Error('Not implemented.'); + } + + toJSON(pre) { + let prefix, context; + let n, z, endo; + + if (this.type === 'edwards') { + prefix = this.prefix ? this.prefix.toString() : null; + context = this.context; + } + + if (!this.n.isZero()) + n = this.n.toJSON(); + + if (!this.z.isZero()) { + z = this.z.fromRed(); + + if (this.z.redIsHigh()) + z.isub(this.p); + + z = z.toString(16); + } + + if (this.endo) + endo = this.endo.toJSON(); + + return { + id: this.id, + ossl: this.ossl, + type: this.type, + endian: this.endian, + hash: this.hash, + prefix, + context, + prime: this.prime, + p: this.p.toJSON(), + a: undefined, + b: undefined, + d: undefined, + n, + h: this.h.toString(16), + s: undefined, + z, + c: undefined, + g: this.g.toJSON(pre), + endo + }; + } + + static fromJSON(json) { + return new this(json); + } + } + + /** + * Point + */ + + class Point { + constructor(curve, type) { + assert(curve instanceof Curve); + assert((type >>> 0) === type); + + this.curve = curve; + this.type = type; + this.pre = null; + } + + _init() { + throw new Error('Not implemented.'); + } + + _safeNAF(width) { + assert((width >>> 0) === width); + + if (this.pre && this.pre.naf) + return this.pre.naf; + + if (width === 0) + return null; + + const size = 1 << (width - 2); + const points = new Array(size); + const p = this.toJ(); + const dbl = size === 1 ? null : p.dbl(); + + points[0] = p; + + for (let i = 1; i < size; i++) + points[i] = points[i - 1].add(dbl); + + return new NAF(width, points); + } + + _getNAF(width) { + assert((width >>> 0) === width); + + if (this.pre && this.pre.naf) + return this.pre.naf; + + if (width === 0) + return null; + + const odds = this._safeNAF(width).points; + const points = this.curve.affinizeAll(odds); + + return new NAF(width, points); + } + + _getWindows(width, bits) { + assert((width >>> 0) === width); + assert((bits >>> 0) === bits); + + if (this.pre && this.pre.windows) + return this.pre.windows; + + if (width === 0) + return null; + + const size = 1 << width; + const steps = ((bits + width - 1) / width) >>> 0; + const wnds = new Array(steps * size); + + let g = this.toJ(); + + for (let i = 0; i < steps; i++) { + wnds[i * size] = this.curve.jpoint(); + + for (let j = 1; j < size; j++) + wnds[i * size + j] = wnds[i * size + j - 1].add(g); + + g = g.dblp(width); + } + + const points = this.curve.affinizeAll(wnds); + + return new Windows(width, bits, points); + } + + _getDoubles(step, power) { + assert((step >>> 0) === step); + assert((power >>> 0) === power); + + if (this.pre && this.pre.doubles) + return this.pre.doubles; + + if (step === 0) + return null; + + const len = Math.ceil(power / step) + 1; + const dbls = new Array(len); + + let acc = this.toJ(); + let k = 0; + + dbls[k++] = acc; + + for (let i = 0; i < power; i += step) { + for (let j = 0; j < step; j++) + acc = acc.dbl(); + + dbls[k++] = acc; + } + + assert(k === len); + + const points = this.curve.affinizeAll(dbls); + + return new Doubles(step, points); + } + + _getBeta() { + return null; + } + + _getBlinding(rng) { + if (this.pre && this.pre.blinding) + return this.pre.blinding; + + if (!rng) + return null; + + if (this.curve.n.isZero()) + return null; + + // Pregenerate a random blinding value: + // + // blind = random integer in [1,n-1] + // unblind = G * blind + // + // We intend to subtract the blinding value + // from scalars before multiplication. We + // can add the unblinding point once the + // multiplication is complete. + const blind = this.curve.randomScalar(rng); + const unblind = this.mul(blind); + + return new Blinding(blind, unblind); + } + + _hasWindows(k) { + assert(k instanceof BN); + + if (!this.pre || !this.pre.windows) + return false; + + const {width, bits} = this.pre.windows; + const steps = ((bits + width - 1) / width) >>> 0; + + return k.bitLength() <= steps * width; + } + + _hasDoubles(k) { + assert(k instanceof BN); + + if (!this.pre || !this.pre.doubles) + return false; + + const {step, points} = this.pre.doubles; + const power = k.bitLength() + 1; + + return points.length >= Math.ceil(power / step) + 1; + } + + _getJNAF(point) { + assert(point instanceof Point); + assert(point.type === this.type); + + // Create comb for JSF. + return [ + this, // 1 + this.add(point), // 3 + this.sub(point), // 5 + point // 7 + ]; + } + + _blind(k, rng) { + // [SIDE1] Page 5, Section 4. + // [BLIND] Page 20, Section 7. + assert(k instanceof BN); + assert(!k.red); + + // Scalar splitting (requires precomputation). + // + // Blind a multiplication by first subtracting + // a blinding value from the scalar. Example: + // + // b = random integer in [1,n-1] + // B = P * b (precomputed) + // Q = P * (k - b) + B + // + // Note that Joye describes a different method + // (multiplier randomization) which computes: + // + // B = random point in E + // Q = (P + B) * k - B * k + // + // Our method is more similar to the "scalar + // splitting" technique described in the + // second source above. + // + // The blinding value and its corresponding + // point are randomly generated and computed + // on boot. As long as an attacker is not + // able to observe the boot, this should give + // a decent bit of protection against various + // channel attacks. + if (this.pre && this.pre.blinding) { + const {blind, unblind} = this.pre.blinding; + const t = k.sub(blind); + + return [this, t, unblind]; + } + + // Randomization is not possible without + // an RNG. Do a normal multiplication. + if (!rng) + return [this, k, null]; + + // If we have no precomputed blinding + // factor, there are two possibilities + // for randomization: + // + // 1. Randomize the multiplier by adding + // a random multiple of `n`. + // + // 2. Re-scale the point itself by a + // random factor. + // + // The first option can be accomplished + // with some like: + // + // a = random integer in [1,n-1] + // r = a * n + // Q = P * (k + r) + // + // The second is accomplished with: + // + // a = random element in F(p) + // R = (x * a^2, y * a^3, z * a) + // Q = R * k + // + // If we have precomputed doubles / naf + // points, we opt for the first method + // to avoid randomizing everything. + if (this.pre) { + if (this.curve.n.isZero()) + return [this, k, null]; + + const a = this.curve.randomScalar(rng); + const r = a.mul(this.curve.n); + const t = r.iadd(k); + + return [this, t, null]; + } + + // If there is no precomputation _at all_, + // we opt for the second method. + const p = this.randomize(rng); + + return [p, k, null]; + } + + clone() { + throw new Error('Not implemented.'); + } + + precompute(bits, rng) { + assert((bits >>> 0) === bits); + + if (!this.pre) + this.pre = new Precomp(); + + if (!this.pre.naf) + this.pre.naf = this._getNAF(9); + + if (!this.pre.doubles) + this.pre.doubles = this._getDoubles(4, bits + 1); + + if (!this.pre.beta) + this.pre.beta = this._getBeta(); + + if (!this.pre.blinding) + this.pre.blinding = this._getBlinding(rng); + + return this; + } + + validate() { + return this.curve.validate(this); + } + + normalize() { + return this; + } + + scale(a) { + throw new Error('Not implemented.'); + } + + randomize(rng) { + const z = this.curve.randomField(rng); + return this.scale(z); + } + + neg() { + throw new Error('Not implemented.'); + } + + add(point) { + throw new Error('Not implemented.'); + } + + sub(point) { + assert(point instanceof Point); + return this.add(point.neg()); + } + + dbl() { + throw new Error('Not implemented.'); + } + + dblp(pow) { + // Repeated doubling. This can + // be optimized by child classes. + assert((pow >>> 0) === pow); + + let r = this; + + for (let i = 0; i < pow; i++) + r = r.dbl(); + + return r; + } + + diffAddDbl(p, q) { + throw new Error('Not implemented.'); + } + + getX() { + throw new Error('Not implemented.'); + } + + getY() { + throw new Error('Not implemented.'); + } + + eq(point) { + throw new Error('Not implemented.'); + } + + cmp(point) { + throw new Error('Not implemented.'); + } + + isInfinity() { + throw new Error('Not implemented.'); + } + + isOrder2() { + throw new Error('Not implemented.'); + } + + isOdd() { + throw new Error('Not implemented.'); + } + + isEven() { + throw new Error('Not implemented.'); + } + + isSquare() { + throw new Error('Not implemented.'); + } + + eqX(x) { + throw new Error('Not implemented.'); + } + + eqR(x) { + throw new Error('Not implemented.'); + } + + isSmall() { + // Test whether the point is of small order. + if (this.isInfinity()) + return false; + + // P * h = O + return this.jmulH().isInfinity(); + } + + hasTorsion() { + // Test whether the point is in another subgroup. + if (this.isInfinity()) + return false; + + // P * n != O + return !this.jmul(this.curve.n).isInfinity(); + } + + order() { + // Calculate point order. + const {h, n} = this.curve; + + let p = this.toJ(); + let q = new BN(1); + + while (!p.isInfinity()) { + q.iaddn(1); + + if (q.cmp(h) > 0) { + q = n.clone(); + break; + } + + p = p.add(this); + } + + return q; + } + + mul(k) { + return this.jmul(k); + } + + muln(k) { + return this.jmuln(k); + } + + mulBlind(k, rng) { + return this.jmulBlind(k, rng); + } + + mulAdd(k1, p2, k2) { + return this.jmulAdd(k1, p2, k2); + } + + mulH() { + return this.jmulH(); + } + + div(k) { + return this.jdiv(k); + } + + divn(k) { + return this.jdivn(k); + } + + divH() { + return this.jdivH(); + } + + jmul(k) { + + if (this._hasDoubles(k)) + return this.curve._fixedNafMul(this, k); + + if (this.curve.endo && this.type === types.AFFINE) + return this.curve._endoWnafMulAdd([this], [k]); + + return this.curve._wnafMul(5, this, k); + } + + jmuln(k) { + assert((k | 0) === k); + return this.jmul(new BN(k)); + } + + jmulBlind(k, rng = null) { + const [p, t, unblind] = this._blind(k, rng); + const q = p.jmul(t); + + if (unblind) + return q.add(unblind); + + return q; + } + + jmulAdd(k1, p2, k2) { + if (this.curve.endo && this.type === types.AFFINE) + return this.curve._endoWnafMulAdd([this, p2], [k1, k2]); + + return this.curve._wnafMulAdd(5, [this, p2], [k1, k2]); + } + + jmulH() { + const word = this.curve.h.word(0); + + // Optimize for powers of two. + if ((word & (word - 1)) === 0) { + const bits = this.curve.h.bitLength(); + return this.toJ().dblp(bits - 1); + } + + return this.jmul(this.curve.h); + } + + jdiv(k) { + assert(k instanceof BN); + assert(!k.red); + + return this.jmul(k.invert(this.curve.n)); + } + + jdivn(k) { + assert(!this.curve.n.isZero()); + + if (this.curve.h.cmpn(k) === 0) + return this.jdivH(); + + return this.jdiv(new BN(k)); + } + + jdivH() { + if (this.curve.n.isZero()) + return this.toJ(); + + if (this.curve.h.cmpn(1) === 0) + return this.toJ(); + + if (this.curve.hi === null) + this.curve.hi = this.curve.h.invert(this.curve.n); + + return this.jmul(this.curve.hi); + } + + toP() { + return this.normalize(); + } + + toJ() { + return this; + } + + toX() { + return this; + } + + key() { + if (this.isInfinity()) + return `${this.curve.uid}:oo`; + + this.normalize(); + + const x = this.getX().toString(16); + const y = this.getY().toString(16); + + return `${this.curve.uid}:${x},${y}`; + } + + encode(compact) { + throw new Error('Not implemented.'); + } + + static decode(curve, bytes) { + throw new Error('Not implemented.'); + } + + encodeX() { + throw new Error('Not implemented.'); + } + + static decodeX(curve, bytes) { + throw new Error('Not implemented.'); + } + + static decodeEven(curve, bytes) { + throw new Error('Not implemented.'); + } + + static decodeSquare(curve, bytes) { + throw new Error('Not implemented.'); + } + + toJSON(pre) { + throw new Error('Not implemented.'); + } + + static fromJSON(curve, json) { + throw new Error('Not implemented.'); + } + + [custom]() { + return ''; + } + } + + /** + * ShortCurve + */ + + class ShortCurve extends Curve { + constructor(conf) { + super(ShortPoint, 'short', conf); + + this.a = BN.fromJSON(conf.a).toRed(this.red); + this.b = BN.fromJSON(conf.b).toRed(this.red); + this.c = BN.fromJSON(conf.c || '0').toRed(this.red); + this.ai = this.a.isZero() ? this.zero : this.a.redInvert(); + this.zi = this.z.isZero() ? this.zero : this.z.redInvert(); + + this.zeroA = this.a.isZero(); + this.threeA = this.a.eq(this.three.redNeg()); + this.redN = this.n.toRed(this.red); + this.pmodn = this.p.clone(); + this.highOrder = this.n.cmp(this.p) >= 0; + this.smallGap = false; + + this._finalize(conf); + } + + _finalize(conf) { + super._finalize(conf); + + // Precalculate endomorphism. + if (conf.endo != null) + this.endo = Endo.fromJSON(this, conf.endo); + else + this.endo = this._getEndomorphism(); + + if (!this.n.isZero()) { + this.pmodn = this.p.mod(this.n); + + // Check for Maxwell's trick (see eqR). + this.smallGap = this.p.div(this.n).cmpn(1) <= 0; + } + + return this; + } + + static _isomorphism(curveA, curveB, custom, odd) { + // Short Weierstrass Isomorphism. + // + // [GECC] Page 84, Section 3.1.5. + // [ARITH1] Page 274, Section 13.1.5. + // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves). + // + // Find `u` such that `a * u^4 = a'` and `b * u^6 = b'`. + // + // Transformation: + // + // u4 = a' / a + // u2 = +-sqrt(u4) + // u6 = u4 * u2 + // a' = a * u4 + // b' = b * u6 + // + // Where `u2` is any root that is square. + // + // If a = 0, we can do: + // + // a' = 0 + // b' = b' + // + // Where (b' / b)^(1 / 3) is square. + // + // If b = 0, we can do: + // + // a' = a' + // b' = 0 + // + // Where sqrt(a' / a) is square. + assert(curveA instanceof BN); + assert(curveB instanceof BN); + assert(custom instanceof BN); + assert(odd == null || typeof odd === 'boolean'); + assert(!curveA.isZero() || !curveB.isZero()); + + if (custom.isZero()) + throw new Error('Invalid coefficient.'); + + if (curveA.isZero()) { + const customB = custom; + const u6 = customB.redDiv(curveB); + // Todo: allow index flag. + const u2 = uncube(u6); + + // Already checked in uncube(). + assert(u2.redJacobi() === 1); + + return [curveA.clone(), customB.clone()]; + } + + if (curveB.isZero()) { + const customA = custom; + const u4 = customA.redDiv(curveA); + const u2 = u4.redSqrt(); + + // Todo: allow odd flag. + if (u2.redJacobi() !== 1) + u2.redINeg(); + + if (u2.redJacobi() !== 1) + throw new Error('Invalid `a` coefficient.'); + + return [customA.clone(), curveB.clone()]; + } + + const customA = custom; + const u4 = customA.redDiv(curveA); + const u2 = u4.redSqrt(); + + if (odd != null) { + if (u2.redIsOdd() !== odd) + u2.redINeg(); + } else { + if (u2.redJacobi() !== 1) + u2.redINeg(); + } + + if (u2.redJacobi() !== 1) + throw new Error('Invalid `a` coefficient.'); + + const u6 = u4.redMul(u2); + const a = curveA.redMul(u4); + const b = curveB.redMul(u6); + + assert(a.eq(customA)); + + return [a, b]; + } + + _short(a0, odd) { + return ShortCurve._isomorphism(this.a, this.b, a0, odd); + } + + _mont(b0, odd) { + // Short Weierstrass->Montgomery Equivalence. + // + // [ARITH1] Page 286, Section 13.2.3.c. + // [SAFE] "Ladders". + // + // Transformation: + // + // r = A / (3 * B) + // s = +-sqrt(3 * r^2 + a) + // A = 3 * r / s + // B = 1 / s + const [r, s] = this._findRS(odd); + const b = s.redInvert(); + const a = r.redMuln(3).redMul(b); + + if (b0 != null) + return MontCurve._isomorphism(a, b, b0); + + return [a, b]; + } + + _edwards(a0, odd) { + // Short Weierstrass->Twisted Edwards Equivalence. + // + // [TWISTEQ] Section 1. + // + // Transformation: + // + // r = (a' + d') / 6 + // s = +-sqrt(3 * r^2 + a) + // a' = 3 * r + 2 * s + // d' = 3 * r - 2 * s + const [r, s] = this._findRS(odd); + const r3 = r.redMuln(3); + const s2 = s.redMuln(2); + const a = r3.redAdd(s2); + const d = r3.redSub(s2); + + if (a0 != null) + return EdwardsCurve._isomorphism(a, d, a0); + + return [a, d]; + } + + _findRS(sign) { + // Find `r` and `s` for equivalence. + // + // [ARITH1] Page 286, Section 13.2.3.c. + // [SAFE] "Ladders". + // + // Computation: + // + // r = solve(r^3 + a * r + b == 0, r) + // s = +-sqrt(3 * r^2 + a) + // + // Computing `r` is non-trivial. We need + // to solve `r^3 + a * r + b = 0`, but we + // don't have a polynomial solver, so we + // loop over random points until we find + // one with 2-torsion. Multiplying by the + // subgroup order should yield a point of + // ((A / 3) / B, 0) which is a solution. + assert(sign == null || typeof sign === 'boolean'); + assert(this.h.word(0) >= 4); + assert(!this.n.isZero()); + + const x = this.one.redNeg(); + + let p; + + for (;;) { + x.redIAdd(this.one); + + try { + p = this.pointFromX(x.clone()); + } catch (e) { + continue; + } + + p = p.mul(this.n); + + if (p.isInfinity()) + continue; + + if (!p.y.isZero()) + continue; + + break; + } + + const r = p.x; + const r2 = r.redSqr(); + const s = r2.redMuln(3).redIAdd(this.a).redSqrt(); + + if (sign != null) { + if (s.redIsOdd() !== sign) + s.redINeg(); + } + + return [r, s]; + } + + _scale0(a, b) { + // We can extract the isomorphism factors with: + // + // u4 = a' / a + // u6 = b' / b + // u2 = +-sqrt(u4) + // u = +-sqrt(u2) + // u3 = u2 * u + // + // `u2` should be picked such that `u4 * u2 = u6`. + // + // If a = 0, we can do: + // + // u6 = b' / b + // u2 = u6^(1 / 3) + // u = +-sqrt(u2) + // u3 = u2 * u + // + // Where `u2` is any root that is square. + // + // If b = 0, we can do: + // + // u4 = a' / a + // u2 = +-sqrt(u4) + // u = +-sqrt(u2) + // u3 = u2 * u + // + // Where `u2` is any root that is square. + assert(this.a.isZero() === a.isZero()); + assert(this.b.isZero() === b.isZero()); + + if (this.a.isZero()) { + const u6 = this.b.redDiv(this.field(b)); + // Todo: figure out how to check index. + const u2 = uncube(u6); + const u = u2.redSqrt(); + const u3 = u2.redMul(u); + + assert(u3.redSqr().eq(u6)); + assert(!u.isZero()); + + return [u2, u3]; + } + + if (this.b.isZero()) { + const u4 = this.a.redDiv(this.field(a)); + const u2 = u4.redSqrt(); + + // Todo: figure out how to check oddness. + if (u2.redJacobi() !== 1) + u2.redINeg(); + + const u = u2.redSqrt(); + const u3 = u2.redMul(u); + + assert(u3.redMul(u).eq(u4)); + assert(!u.isZero()); + + return [u2, u3]; + } + + const u4 = this.a.redDiv(this.field(a)); + const u6 = this.b.redDiv(this.field(b)); + const u2 = u4.redSqrt(); + + if (!u4.redMul(u2).eq(u6)) + u2.redINeg(); + + assert(u4.redMul(u2).eq(u6)); + + const u = u2.redSqrt(); + const u3 = u2.redMul(u); + + assert(!u.isZero()); + + return [u2, u3]; + } + + _scale1(x, y) { + // If base points are available, it is much + // easier, with: + // + // u2 = x' / x + // u3 = y' / y + // u = +-sqrt(u2) + // + // `u` should be picked such that `u2 * u = u3`. + const u2 = this.g.x.redDiv(this.field(x)); + const u3 = this.g.y.redDiv(this.field(y)); + const u = u2.redSqrt(); + + if (!u2.redMul(u).eq(u3)) + u.redINeg(); + + assert(u2.redMul(u).eq(u3)); + assert(!u.isZero()); + + return [u2, u3]; + } + + _scaleShort(curve) { + assert(curve instanceof ShortCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) + return this._scale0(curve.a, curve.b); + + return this._scale1(curve.g.x, curve.g.y); + } + + _scaleMont(curve) { + assert(curve instanceof MontCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) { + const [a, b] = curve._short(); + return this._scale0(a, b); + } + + const {x, y} = curve.g; + const nx = x.redAdd(curve.a3).redMul(curve.bi); + const ny = y.redMul(curve.bi); + + return this._scale1(nx, ny); + } + + _scaleEdwards(curve) { + assert(curve instanceof EdwardsCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) { + const [a, b] = curve._short(); + return this._scale0(a, b); + } + + const {x, y, z} = curve.g; + const a5 = curve.a.redMuln(5); + const d5 = curve.d.redMuln(5); + const dma = curve.d.redSub(curve.a); + const d5a = d5.redSub(curve.a); + const da5 = curve.d.redSub(a5); + const ypz = y.redAdd(z); + const ymz = y.redSub(z); + const xx = d5a.redMul(y).redIAdd(da5.redMul(z)); + const xz = ymz.redMuln(12); + const yy = dma.redMul(ypz).redMul(z); + const yz = ymz.redMul(x).redIMuln(4); + const zi = xz.redMul(yz).redInvert(); + const nx = xx.redMul(yz).redMul(zi); + const ny = yy.redMul(xz).redMul(zi); + + return this._scale1(nx, ny); + } + + _getEndomorphism(index = 0) { + // Compute endomorphism. + // + // [GECC] Example 3.76, Page 128, Section 3.5. + + // No curve params. + if (this.n.isZero() || this.g.isInfinity()) + return null; + + // No efficient endomorphism. + if (!this.zeroA || this.p.modrn(3) !== 1 || this.n.modrn(3) !== 1) + return null; + + // Solve beta^3 mod p = 1. + const [b1, b2] = this._getEndoRoots(this.p); + + // Choose the smallest beta by default. + const beta = [b1, b2][index & 1].toRed(this.red); + + // Solve lambda^3 mod n = 1. + const [l1, l2] = this._getEndoRoots(this.n); + + // Choose the lambda matching selected beta. + // Note that P * lambda = (x * beta, y). + const p = this.point(this.g.x.redMul(beta), this.g.y); + + let lambda; + + if (this.g.mul(l1).eq(p)) { + lambda = l1; + } else { + assert(this.g.mul(l2).eq(p)); + lambda = l2; + } + + // Get basis vectors. + const basis = this._getEndoBasis(lambda); + + // Precompute `g1` and `g2`. + const pre = this._getEndoPrecomp(basis); + + return new Endo(beta, lambda, basis, pre); + } + + _getEndoRoots(num) { + // Find roots for x^2 + x + 1 in F. + // + // [GECC] Example 3.76, Page 128, Section 3.5. + // [GLV] Page 192, Section 2 (Endomorphisms). + // + // The above document doesn't fully explain how + // to derive these and only "hints" at it, as + // mentioned by Hal Finney[1], but we're basically + // computing two possible cube roots of 1 here. + // + // Note that we could also compute[2]: + // + // beta = 2^((p - 1) / 3) mod p + // lambda = 3^((n - 1) / 3) mod n + // + // As an extension of Fermat's little theorem: + // + // g^(p - 1) mod p == 1 + // + // It is suspected[3] this is how Hal Finney[4] + // computed his original endomorphism roots. + // + // @indutny's method for computing cube roots + // of unity[5] appears to be the method described + // on wikipedia[6][7]. + // + // Sage produces the same solution: + // + // sage: solve(x^2 + x + 1 == 0, x) + // [x == -1/2*I*sqrt(3) - 1/2, x == 1/2*I*sqrt(3) - 1/2] + // + // This can be reduced to: + // + // x = (+-sqrt(-3) - 1) / 2 + // + // [1] https://bitcointalk.org/index.php?topic=3238.msg45565#msg45565 + // [2] https://crypto.stackexchange.com/a/22739 + // [3] https://bitcoin.stackexchange.com/a/35872 + // [4] https://github.com/halfinney/bitcoin/commit/dc411b5 + // [5] https://en.wikipedia.org/wiki/Cube_root_of_unity + // [6] https://en.wikipedia.org/wiki/Splitting_field#Cubic_example + // [7] http://mathworld.wolfram.com/SplittingField.html + const red = num === this.p ? this.red : BN.mont(num); + const two = new BN(2).toRed(red); + const three = new BN(3).toRed(red); + const i2 = two.redInvert(); + + // S1 = sqrt(-3) / 2 + const s1 = three.redNeg().redSqrt().redMul(i2); + + // S2 = -S1 + const s2 = s1.redNeg(); + + // R1 = S1 - 1 / 2 + const r1 = s1.redSub(i2).fromRed(); + + // R2 = S2 - 1 / 2 + const r2 = s2.redSub(i2).fromRed(); + + return [r1, r2].sort(BN.cmp); + } + + _getEndoBasis(lambda) { + // Compute endomorphic basis. + // + // This essentially computes Cornacchia's algorithm + // for solving x^2 + d * y^2 = m (d = lambda, m = order). + // + // https://en.wikipedia.org/wiki/Cornacchia%27s_algorithm + // + // [GECC] Algorithm 3.74, Page 127, Section 3.5. + // [GLV] Page 196, Section 4 (Decomposing K). + // + // Balanced length-two representation of a multiplier. + // + // 1. Run the extended euclidean algorithm with inputs n + // and lambda. The algorithm produces a sequence of + // equations si*n + ti*lam = ri where s0=1, t0=0, + // r0=n, s1=0, t1=1, r1=lam, and the remainders ri + // and are non-negative and strictly decreasing. Let + // l be the greatest index for which rl >= sqrt(n). + const [rl, tl, rl1, tl1, rl2, tl2] = this._egcdSqrt(lambda); + + // 2. Set (a1, b1) <- (rl+1, -tl+1). + const a1 = rl1; + const b1 = tl1.neg(); + + // 3. If (rl^2 + tl^2) <= (rl+2^2 + tl+2^2) + // then set (a2, b2) <- (rl, -tl). + // else set (a2, b2) <- (rl+2, -tl+2). + const lhs = rl.sqr().iadd(tl.sqr()); + const rhs = rl2.sqr().iadd(tl2.sqr()); + + let a2, b2; + + if (lhs.cmp(rhs) <= 0) { + a2 = rl; + b2 = tl.neg(); + } else { + a2 = rl2; + b2 = tl2.neg(); + } + + return [ + new Vector(a1, b1), + new Vector(a2, b2) + ]; + } + + _egcdSqrt(lambda) { + // Extended Euclidean algorithm for integers. + // + // [GECC] Algorithm 2.19, Page 40, Section 2.2. + // [GLV] Page 196, Section 4 (Decomposing K). + assert(lambda instanceof BN); + assert(!lambda.red); + assert(lambda.sign() > 0); + assert(this.n.sign() > 0); + + // Note that we insert the approximate square + // root checks as described in algorithm 3.74. + // + // Algorithm 2.19 is defined as: + // + // 1. u <- a + // v <- b + // + // 2. x1 <- 1 + // y1 <- 0 + // x2 <- 0 + // y2 <- 1 + // + // 3. while u != 0 do + // + // 3.1. q <- floor(v / u) + // r <- v - q * u + // x <- x2 - q * x1 + // y <- y2 - q * y1 + // + // 3.2. v <- u + // u <- r + // x2 <- x1 + // x1 <- x + // y2 <- y1 + // y1 <- y + // + // 4. d <- v + // x <- x2 + // y <- y2 + // + // 5. Return (d, x, y). + + // Start with an approximate square root of n. + const sqrtn = this.n.ushrn(this.n.bitLength() >>> 1); + + let u = lambda; // r1 + let v = this.n.clone(); // r0 + let x1 = new BN(1); // t1 + let y1 = new BN(0); // t0 + let x2 = new BN(0); // s1 + let y2 = new BN(1); // s0 + + // All vectors are roots of: a + b * lambda = 0 (mod n). + let rl, tl; + + // First vector. + let rl1, tl1; + + // Inner. + let i = 0; + let j = 0; + let p; + + // Compute EGCD. + while (!u.isZero() && i < 2) { + const q = v.quo(u); + const r = v.sub(q.mul(u)); + const x = x2.sub(q.mul(x1)); + const y = y2.sub(q.mul(y1)); + + // Check for r < sqrt(n). + if (j === 0 && r.cmp(sqrtn) < 0) { + rl = p; + tl = x1; + rl1 = r; + tl1 = x; + j = 1; // 1 more round. + } + + p = r; + v = u; + u = r; + x2 = x1; + x1 = x; + y2 = y1; + y1 = y; + + i += j; + } + + // Should never happen. + assert(j !== 0, 'Could not find r < sqrt(n).'); + + // Second vector. + const rl2 = x2; + const tl2 = x1; + + return [ + rl, + tl, + rl1, + tl1, + rl2, + tl2 + ]; + } + + _getEndoPrecomp(basis) { + // Precompute `g1` and `g2` to avoid round division. + // + // [JCEN12] Page 5, Section 4.3. + // + // Computation: + // + // d = a1 * b2 - b1 * a2 + // t = ceil(log2(d+1)) + p + // g1 = round((2^t * b2) / d) + // g2 = round((2^t * b1) / d) + // + // Where: + // + // `p` is the number of precision bits. + // `d` is equal to `n` (the curve order). + // + // The paper above uses 2 as the value of `p`, + // whereas libsecp256k1 uses 128 (total=384). + // + // We pick precision for `g1` and `g2` such that: + // + // abs(g1) < n + // abs(g2) < n + // + // This ensures maximum precision for the constants + // while also ensuring they fit into a fixed number + // of scalar limbs in more optimized implementations. + // + // Furthermore, we attempt to align to a limb width + // of 64 bits. This allows us to optimize the shift, + // a la libsecp256k1[1]. + // + // [1] https://github.com/bitcoin-core/secp256k1/pull/822 + assert(Array.isArray(basis)); + assert(basis.length === 2); + assert(basis[0] instanceof Vector); + assert(basis[1] instanceof Vector); + + const [v1, v2] = basis; + const d = v1.a.mul(v2.b).isub(v1.b.mul(v2.a)); + const bits = d.bitLength(); + const align = bits >= 160; + + assert(d.eq(this.n)); + + // Start with a rough estimate. + let shift = bits + Math.ceil(bits / 2) + 1; + let g1, g2; + + if (align) + shift -= shift & 63; + + while (shift > bits) { + g1 = v2.b.ushln(shift).divRound(d); + g2 = v1.b.ushln(shift).divRound(d); + + if (g1.ucmp(d) < 0 && g2.ucmp(d) < 0) + break; + + if (align) + shift -= 64; + else + shift -= 1; + } + + if (shift <= bits) + throw new Error('Could not calculate g1 and g2.'); + + return [shift, g1, g2]; + } + + _endoSplit(k) { + // Balanced length-two representation of a multiplier. + // + // [GECC] Algorithm 3.74, Page 127, Section 3.5. + // + // Also note that it is possible to precompute[1] + // values in order to avoid the division[2][3][4]. + // + // This involves precomputing `g1` and `g2 (see + // above). `c1` and `c2` can then be computed as + // follows: + // + // t = ceil(log2(n+1)) + p + // c1 = (k * g1) >> t + // c2 = -((k * g2) >> t) + // + // Where `>>` is an _unsigned_ right shift. Also + // note that the last bit discarded in the shift + // must be stored. If it is 1, then add 1 to the + // scalar (absolute addition). + // + // It's worth noting that libsecp256k1 uses a + // different calculation along the lines of: + // + // t = ceil(log2(n+1)) + p + // c1 = ((k * g1) >> t) * -b1 + // c2 = ((k * -g2) >> t) * -b2 + // k2 = c1 + c2 + // k1 = k2 * -lambda + k + // + // So, in the future, we can consider changing + // step 4 to: + // + // 4. Compute c1 = (k * g1) >> t + // and c2 = -((k * g2) >> t). + // + // const [shift, g1, g2] = this.endo.pre; + // const c1 = k.mulShift(g1, shift); + // const c2 = k.mulShift(g2, shift).ineg(); + // + // Once we're brave enough, that is. + // + // [1] [JCEN12] Page 5, Section 4.3. + // [2] https://github.com/bitcoin-core/secp256k1/blob/0b70241/src/scalar_impl.h#L259 + // [3] https://github.com/bitcoin-core/secp256k1/pull/21 + // [4] https://github.com/bitcoin-core/secp256k1/pull/127 + assert(k instanceof BN); + assert(!k.red); + assert(!this.n.isZero()); + + const [v1, v2] = this.endo.basis; + + // 4. Compute c1 = round(b2 * k / n) + // and c2 = round(-b1 * k / n). + const c1 = v2.b.mul(k).divRound(this.n); + const c2 = v1.b.neg().mul(k).divRound(this.n); + + // 5. Compute k1 = k - c1 * a1 - c2 * a2 + // and k2 = -c1 * b1 - c2 * b2. + const p1 = c1.mul(v1.a); + const p2 = c2.mul(v2.a); + const q1 = c1.ineg().mul(v1.b); + const q2 = c2.mul(v2.b); + + // Calculate answer. + const k1 = k.sub(p1).isub(p2); + const k2 = q1.isub(q2); + + // 6. Return (k1, k2). + return [k1, k2]; + } + + _endoBeta(point) { + assert(point instanceof ShortPoint); + return [point, point._getBeta()]; + } + + _endoWnafMulAdd(points, coeffs) { + // Point multiplication with efficiently computable endomorphisms. + // + // [GECC] Algorithm 3.77, Page 129, Section 3.5. + // [GLV] Page 193, Section 3 (Using Efficient Endomorphisms). + // + // Note it may be possible to do this 4-dimensionally [4GLV]. + assert(Array.isArray(points)); + assert(Array.isArray(coeffs)); + assert(points.length === coeffs.length); + assert(this.endo != null); + + const len = points.length; + const npoints = new Array(len * 2); + const ncoeffs = new Array(len * 2); + + for (let i = 0; i < len; i++) { + const [p1, p2] = this._endoBeta(points[i]); + const [k1, k2] = this._endoSplit(coeffs[i]); + + npoints[i * 2 + 0] = p1; + ncoeffs[i * 2 + 0] = k1; + npoints[i * 2 + 1] = p2; + ncoeffs[i * 2 + 1] = k2; + } + + return this._wnafMulAdd(5, npoints, ncoeffs); + } + + _sswu(u) { + // Simplified Shallue-Woestijne-Ulas Method. + // + // Distribution: 3/8. + // + // [SSWU1] Page 15-16, Section 7. Appendix G. + // [SSWU2] Page 5, Theorem 2.3. + // [H2EC] "Simplified Shallue-van de Woestijne-Ulas Method". + // + // Assumptions: + // + // - a != 0, b != 0. + // - Let z be a non-square in F(p). + // - z != -1. + // - The polynomial g(x) - z is irreducible over F(p). + // - g(b / (z * a)) is square in F(p). + // - u != 0, u != +-sqrt(-1 / z). + // + // Map: + // + // g(x) = x^3 + a * x + b + // t1 = 1 / (z^2 * u^4 + z * u^2) + // x1 = (-b / a) * (1 + t1) + // x1 = b / (z * a), if t1 = 0 + // x2 = z * u^2 * x1 + // x = x1, if g(x1) is square + // = x2, otherwise + // y = sign(u) * abs(sqrt(g(x))) + const {b, z, ai, zi, one} = this; + const z2 = z.redSqr(); + const ba = b.redNeg().redMul(ai); + const bza = b.redMul(zi).redMul(ai); + const u2 = u.redSqr(); + const u4 = u2.redSqr(); + const t0 = z2.redMul(u4).redIAdd(z.redMul(u2)); + const t1 = t0.isZero() ? t0 : t0.redInvert(); + const x1 = t1.isZero() ? bza : ba.redMul(one.redAdd(t1)); + const x2 = z.redMul(u2).redMul(x1); + const y1 = this.solveY2(x1); + const y2 = this.solveY2(x2); + const alpha = y1.redIsSquare() | 0; + const x = [x1, x2][alpha ^ 1]; + const y = [y1, y2][alpha ^ 1].redSqrt(); + + if (y.redIsOdd() !== u.redIsOdd()) + y.redINeg(); + + return this.point(x, y); + } + + _sswui(p, hint) { + // Inverting the Map (Simplified Shallue-Woestijne-Ulas). + // + // Assumptions: + // + // - a^2 * x^2 - 2 * a * b * x - 3 * b^2 is square in F(p). + // - If r < 3 then x != -b / a. + // + // Unlike SVDW, the preimages here are evenly + // distributed (more or less). SSWU covers ~3/8 + // of the curve points. Each preimage has a 1/2 + // chance of mapping to either x1 or x2. + // + // Assuming the point is within that set, each + // point has a 1/4 chance of inverting to any + // of the preimages. This means we can simply + // randomly select a preimage if one exists. + // + // However, the [SVDW2] sampling method seems + // slighly faster in practice for [SQUARED]. + // + // Map: + // + // c = sqrt(a^2 * x^2 - 2 * a * b * x - 3 * b^2) + // u1 = -(a * x + b - c) / (2 * (a * x + b) * z) + // u2 = -(a * x + b + c) / (2 * (a * x + b) * z) + // u3 = -(a * x + b - c) / (2 * b * z) + // u4 = -(a * x + b + c) / (2 * b * z) + // r = random integer in [1,4] + // u = sign(y) * abs(sqrt(ur)) + const {a, b, z} = this; + const {x, y} = p; + const r = hint & 3; + const a2x2 = a.redSqr().redMul(x.redSqr()); + const abx2 = a.redMul(b).redMul(x).redIMuln(2); + const b23 = b.redSqr().redMuln(3); + const axb = a.redMul(x).redIAdd(b); + const c = a2x2.redISub(abx2).redISub(b23).redSqrt(); + const n0 = axb.redSub(c).redINeg(); + const n1 = axb.redAdd(c).redINeg(); + const d0 = axb.redMul(z).redIMuln(2); + const d1 = b.redMul(z).redIMuln(2); + const n = [n0, n1][r & 1]; // r = 1 or 3 + const d = [d0, d1][r >>> 1]; // r = 2 or 3 + const u = n.redDivSqrt(d); + + if (u.redIsOdd() !== y.redIsOdd()) + u.redINeg(); + + return u; + } + + _svdwf(u) { + // Shallue-van de Woestijne Method. + // + // Distribution: 9/16. + // + // [SVDW1] Section 5. + // [SVDW2] Page 8, Section 3. + // Page 15, Section 6, Algorithm 1. + // [H2EC] "Shallue-van de Woestijne Method". + // + // Assumptions: + // + // - p = 1 (mod 3). + // - a = 0, b != 0. + // - Let z be a unique element in F(p). + // - g((sqrt(-3 * z^2) - z) / 2) is square in F(p). + // - u != 0, u != +-sqrt(-g(z)). + // + // Map: + // + // g(x) = x^3 + b + // c = sqrt(-3 * z^2) + // t1 = u^2 + g(z) + // t2 = 1 / (u^2 * t1) + // t3 = u^4 * t2 * c + // x1 = (c - z) / 2 - t3 + // x2 = t3 - (c + z) / 2 + // x3 = z - t1^3 * t2 / (3 * z^2) + // x = x1, if g(x1) is square + // = x2, if g(x2) is square + // = x3, otherwise + // y = sign(u) * abs(sqrt(g(x))) + const {c, z, zi, i2, i3} = this; + const gz = this.solveY2(z); + const z3 = i3.redMul(zi.redSqr()); + const u2 = u.redSqr(); + const u4 = u2.redSqr(); + const t1 = u2.redAdd(gz); + const u2t1 = u2.redMul(t1); + const t2 = u2t1.isZero() ? u2t1 : u2t1.redInvert(); + const t3 = u4.redMul(t2).redMul(c); + const t4 = t1.redSqr().redMul(t1); + const x1 = c.redSub(z).redMul(i2).redISub(t3); + const x2 = t3.redSub(c.redAdd(z).redMul(i2)); + const x3 = z.redSub(t4.redMul(t2).redMul(z3)); + const y1 = this.solveY2(x1); + const y2 = this.solveY2(x2); + const y3 = this.solveY2(x3); + const alpha = y1.redJacobi() | 1; + const beta = y2.redJacobi() | 1; + const i = mod((alpha - 1) * beta, 3); + const x = [x1, x2, x3][i]; + const y = [y1, y2, y3][i]; + + return [x, y]; + } + + _svdw(u) { + const [x, yy] = this._svdwf(u); + const y = yy.redSqrt(); + + if (y.redIsOdd() !== u.redIsOdd()) + y.redINeg(); + + return this.point(x, y); + } + + _svdwi(p, hint) { + // Inverting the Map (Shallue-van de Woestijne). + // + // [SQUARED] Algorithm 1, Page 8, Section 3.3. + // [SVDW2] Page 12, Section 5. + // [SVDW3] "Inverting the map". + // + // Assumptions: + // + // - If r = 1 then x != -(c + z) / 2. + // - If r = 2 then x != (c - z) / 2. + // - If r > 2 then (t0 - t1 + t2) is square in F(p). + // - f(f^-1(x)) = x where f is the map function. + // + // We use the sampling method from [SVDW2], + // _not_ [SQUARED]. This seems to have a + // better distribution in practice. + // + // Note that [SVDW3] also appears to be + // incorrect in terms of distribution. + // + // The distribution of f(u), assuming u is + // random, is (1/2, 1/4, 1/4). + // + // To mirror this, f^-1(x) should simply + // pick (1/2, 1/4, 1/8, 1/8). + // + // To anyone running the forward map, our + // strings will appear to be random. + // + // Map: + // + // g(x) = x^3 + b + // c = sqrt(-3 * z^2) + // t0 = 9 * (x^2 * z^2 + z^4) + // t1 = 18 * x * z^3 + // t2 = 12 * g(z) * (x - z) + // t3 = sqrt(t0 - t1 + t2) + // t4 = t3 * z + // u1 = g(z) * (c - 2 * x - z) / (c + 2 * x + z) + // u2 = g(z) * (c + 2 * x + z) / (c - 2 * x - z) + // u3 = (3 * (z^3 - x * z^2) - 2 * g(z) + t4) / 2 + // u4 = (3 * (z^3 - x * z^2) - 2 * g(z) - t4) / 2 + // r = random integer in [1,4] + // u = sign(y) * abs(sqrt(ur)) + const {b, c, z, zero, two} = this; + const {x, y} = p; + const r = hint & 3; + const z2 = z.redSqr(); + const z3 = z2.redMul(z); + const z4 = z2.redSqr(); + const gz = z3.redAdd(b); + const gz2 = gz.redMuln(2); + const xx = x.redSqr(); + const x2z = x.redMuln(2).redIAdd(z); + const xz2 = x.redMul(z2); + const c0 = c.redSub(x2z); + const c1 = c.redAdd(x2z); + const t0 = xx.redMul(z2).redIAdd(z4).redIMuln(9); + const t1 = x.redMul(z3).redIMuln(18); + const t2 = gz.redMul(x.redSub(z)).redIMuln(12); + const t3 = r >= 2 ? t0.redISub(t1).redIAdd(t2).redSqrt() : zero; + const t4 = t3.redMul(z); + const t5 = z3.redISub(xz2).redIMuln(3).redISub(gz2); + const n0 = gz.redMul(c0); + const n1 = gz.redMul(c1); + const n2 = t5.redAdd(t4); + const n3 = t5.redSub(t4); + const d2 = two; + const n = [n0, n1, n2, n3][r]; + const d = [c1, c0, d2, d2][r]; + const u = n.redDivSqrt(d); + const [x0] = this._svdwf(u); + + if (!x0.eq(x)) + throw new Error('Invalid point.'); + + if (u.redIsOdd() !== y.redIsOdd()) + u.redINeg(); + + return u; + } + + isElliptic() { + const {a, b} = this; + const a2 = a.redSqr(); + const a3 = a2.redMul(a); + const b2 = b.redSqr(); + const d = b2.redMuln(27).redIAdd(a3.redMuln(4)); + + // 4 * a^3 + 27 * b^2 != 0 + return !d.isZero(); + } + + jinv() { + // [ARITH1] Page 71, Section 4.4. + // http://mathworld.wolfram.com/j-Invariant.html + const {a, b} = this; + const a2 = a.redSqr(); + const a3 = a2.redMul(a); + const b2 = b.redSqr(); + const t0 = a3.redMuln(4); + const lhs = t0.redMuln(1728); + const rhs = b2.redMuln(27).redIAdd(t0); + + if (rhs.isZero()) + throw new Error('Curve is not elliptic.'); + + // (1728 * 4 * a^3) / (4 * a^3 + 27 * b^2) + return lhs.redDiv(rhs).fromRed(); + } + + point(x, y) { + return new ShortPoint(this, x, y); + } + + jpoint(x, y, z) { + return new JPoint(this, x, y, z); + } + + solveX(y) { + assert(y instanceof BN); + + if (!this.a.isZero()) + throw new Error('Not implemented.'); + + // x^3 = y^2 - b + const y2 = y.redSqr(); + const x3 = y2.redSub(this.b); + + return cubeRoots(x3); + } + + solveY2(x) { + // [GECC] Page 89, Section 3.2.2. + // https://hyperelliptic.org/EFD/g1p/auto-shortw.html + assert(x instanceof BN); + + // y^2 = x^3 + a * x + b + const x3 = x.redSqr().redMul(x); + const y2 = x3.redIAdd(this.b); + + if (!this.zeroA) { + // Save some cycles for a = -3. + if (this.threeA) + y2.redIAdd(x.redMuln(-3)); + else + y2.redIAdd(this.a.redMul(x)); + } + + return y2; + } + + validate(point) { + assert(point instanceof ShortPoint); + + if (point.inf) + return true; + + const {x, y} = point; + const y2 = this.solveY2(x); + + return y.redSqr().eq(y2); + } + + pointFromX(x, sign = null) { + assert(x instanceof BN); + assert(sign == null || typeof sign === 'boolean'); + + if (!x.red) + x = x.toRed(this.red); + + const y = this.solveY(x); + + if (sign != null) { + if (this.h.cmpn(1) > 0) { + if (y.isZero() && sign) + throw new Error('Invalid point.'); + } + + if (y.redIsOdd() !== sign) + y.redINeg(); + } + + return this.point(x, y); + } + + pointFromY(y, index = 0) { + assert(y instanceof BN); + assert((index >>> 0) === index); + + if (!y.red) + y = y.toRed(this.red); + + const coords = this.solveX(y); + + if (index >= coords.length) + throw new Error('Invalid X coordinate index.'); + + const x = coords[index]; + + return this.point(x, y); + } + + isIsomorphic(curve) { + // [GECC] Page 84, Section 3.1.5. + // [ARITH1] Page 286, Section 13.2.3.c. + assert(curve instanceof Curve); + + if (!curve.p.eq(this.p)) + return false; + + let u2, u3; + try { + [u2, u3] = this._scale(curve); + } catch (e) { + return false; + } + + // E(a,b) <-> E(au^4,bu^6) + if (curve.type === 'short') { + // a' = a * u^4, b' = b * u^6 + const a = this.field(curve.a).redMul(u2.redSqr()); + const b = this.field(curve.b).redMul(u3.redSqr()); + + return this.a.eq(a) && this.b.eq(b); + } + + // E(a,b) <-> M(A,B) + if (curve.type === 'mont') { + // (A / (3 * B))^3 + a * (A / (3 * B)) + b = 0 + const {a3, bi} = curve; + const x = this.field(a3.redMul(bi)).redMul(u2); + const y2 = this.solveY2(x); + + return y2.isZero(); + } + + // E(a,b) <-> E(a,d) + if (curve.type === 'edwards') { + // ((a' + d') / 6)^3 + a * ((a' + d') / 6) + b = 0 + const x = this.field(curve.ad6).redMul(u2); + const y2 = this.solveY2(x); + + return y2.isZero(); + } + + return false; + } + + isIsogenous(curve) { + assert(curve instanceof Curve); + return false; + } + + pointFromShort(point) { + // [GECC] Page 84, Section 3.1.5. + // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves). + assert(point instanceof ShortPoint); + + if (this.isIsomorphic(point.curve)) { + // Isomorphic maps for E(a,b)<->E(au^4,bu^6): + // + // x' = x * u^2 + // y' = y * u^3 + // + // Where a * u^4 = a' and b * u^6 = b'. + if (point.isInfinity()) + return this.point(); + + const [u2, u3] = this._scale(point.curve); + const x = this.field(point.x); + const y = this.field(point.y); + const nx = x.redMul(u2); + const ny = y.redMul(u3); + + return this.point(nx, ny); + } + + throw new Error('Not implemented.'); + } + + pointFromMont(point) { + // [ALT] Appendix E.2 (Switching between Alternative Representations). + // [MONT2] "Equivalence with Weierstrass curves" + assert(point instanceof MontPoint); + + if (this.isIsomorphic(point.curve)) { + // Equivalence for M(A,B)->E(a,b): + // + // x = (u + A / 3) / B + // y = v / B + // + // Undefined if ((u^3 + A * u^2 + u) / B) is not square. + if (point.isInfinity()) + return this.point(); + + const {a3, bi} = point.curve; + const [u2, u3] = this._scale(point.curve); + const nx = point.x.redAdd(a3).redMul(bi); + const ny = point.y.redMul(bi); + + return this.point(this.field(nx).redMul(u2), + this.field(ny).redMul(u3)); + } + + throw new Error('Not implemented.'); + } + + pointFromEdwards(point) { + // [TWISTEQ] Section 2. + assert(point instanceof EdwardsPoint); + + if (this.isIsomorphic(point.curve)) { + // Equivalence for E(a,d)->E(a',b'): + // + // x' = ((5 * d - a) * y + d - 5 * a) / (12 * (y - 1)) + // y' = (d - a) * (y + 1) / (4 * x * (y - 1)) + // + // Undefined for x = 0 or y = 1. + // + // Exceptional Cases: + // - (0, 1) -> O + // - (0, -1) -> ((a + d) / 6, 0) + // + // Unexceptional Cases: + // - (sqrt(1 / a), 0) -> ((5 * a - d) / 12, (a - d) / 4 * sqrt(a)) + const {a, d, ad6} = point.curve; + const [u2, u3] = this._scale(point.curve); + + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) { + const x = this.field(ad6).redMul(u2); + return this.point(x, this.zero); + } + + const {x, y, z} = point; + const a5 = a.redMuln(5); + const d5 = d.redMuln(5); + const dma = d.redSub(a); + const d5a = d5.redSub(a); + const da5 = d.redSub(a5); + const ypz = y.redAdd(z); + const ymz = y.redSub(z); + const xx = d5a.redMul(y).redIAdd(da5.redMul(z)); + const xz = ymz.redMuln(12); + const yy = dma.redMul(ypz).redMul(z); + const yz = ymz.redMul(x).redIMuln(4); + + return this.cpoint(this.field(xx).redMul(u2), + this.field(xz), + this.field(yy).redMul(u3), + this.field(yz)); + } + + throw new Error('Not implemented.'); + } + + pointFromUniform(u) { + assert(u instanceof BN); + + // z = 0 or b = 0 + if (this.z.isZero() || this.b.isZero()) + throw new Error('Not implemented.'); + + // a != 0, b != 0 + if (!this.a.isZero()) + return this._sswu(u); + + // p = 1 mod 3, a = 0, b != 0 + if (!this.c.isZero()) + return this._svdw(u); + + throw new Error('Not implemented.'); + } + + pointToUniform(p, hint) { + // Convert a short weierstrass point to a field + // element by inverting either the SSWU or SVDW + // map. + // + // Hint Layout: + // + // [00000000] [0000] [0000] + // | | | + // | | +-- preimage index + // | +--- subgroup + // +-- bits to OR with uniform bytes + assert(p instanceof ShortPoint); + assert((hint >>> 0) === hint); + + // z = 0 or b = 0 + if (this.z.isZero() || this.b.isZero()) + throw new Error('Not implemented.'); + + // P = O + if (p.isInfinity()) + throw new Error('Invalid point.'); + + // Add a random torsion component. + const i = ((hint >>> 4) & 15) % this.torsion.length; + const q = p.add(this.torsion[i]); + + return wrapErrors(() => { + // a != 0, b != 0 + if (!this.a.isZero()) + return this._sswui(q, hint); + + // p = 1 mod 3, a = 0, b != 0 + if (!this.c.isZero()) + return this._svdwi(q, hint); + + throw new Error('Not implemented.'); + }); + } + + mulAll(points, coeffs) { + return super.mulAll(points, coeffs).toP(); + } + + affinizeAll(points) { + const out = this.normalizeAll(points); + + for (let i = 0; i < out.length; i++) + out[i] = out[i].toP(); + + return out; + } + + decodePoint(bytes) { + return ShortPoint.decode(this, bytes); + } + + encodeX(point) { + assert(point instanceof Point); + return point.encodeX(); + } + + decodeEven(bytes) { + return ShortPoint.decodeEven(this, bytes); + } + + decodeSquare(bytes) { + return ShortPoint.decodeSquare(this, bytes); + } + + toShort(a0, odd, sign = null) { + const [a, b] = this._short(a0, odd); + + const curve = new ShortCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = curve._scale(this); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromShort(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromShort(this.torsion[i]); + + return curve; + } + + toMont(b0, odd, sign = null) { + const [a, b] = this._mont(b0, odd); + + const curve = new MontCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = this._scale(curve); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromShort(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromShort(this.torsion[i]); + + return curve; + } + + toEdwards(a0, odd, sign = null) { + const [a, d] = this._edwards(a0, odd); + + const curve = new EdwardsCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + d: d, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = this._scale(curve); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) { + curve.g = curve.pointFromShort(this.g); + curve.g.normalize(); + } + + if (curve.isComplete()) { + for (let i = 0; i < this.h.word(0); i++) { + curve.torsion[i] = curve.pointFromShort(this.torsion[i]); + curve.torsion[i].normalize(); + } + } + + return curve; + } + + pointFromJSON(json) { + return ShortPoint.fromJSON(this, json); + } + + toJSON(pre) { + const json = super.toJSON(pre); + + json.a = this.a.fromRed().toJSON(); + json.b = this.b.fromRed().toJSON(); + + if (!this.c.isZero()) + json.c = this.c.fromRed().toJSON(); + + return json; + } + } + + /** + * ShortPoint + */ + + class ShortPoint extends Point { + constructor(curve, x, y) { + assert(curve instanceof ShortCurve); + + super(curve, types.AFFINE); + + this.x = this.curve.zero; + this.y = this.curve.zero; + this.inf = true; + + if (x != null) + this._init(x, y); + } + + _init(x, y) { + assert(x instanceof BN); + assert(y instanceof BN); + + this.x = x; + this.y = y; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + + this.inf = false; + } + + _getBeta() { + if (!this.curve.endo) + return null; + + if (this.pre && this.pre.beta) + return this.pre.beta; + + // Augment the point with our beta value. + // This is the counterpart to `k2` after + // the endomorphism split of `k`. + // + // Note that if we have precomputation, + // we have to clone and update all of the + // precomputed points below. + const xb = this.x.redMul(this.curve.endo.beta); + const beta = this.curve.point(xb, this.y); + + if (this.pre) { + beta.pre = this.pre.map((point) => { + const xb = point.x.redMul(this.curve.endo.beta); + return this.curve.point(xb, point.y); + }); + + this.pre.beta = beta; + } + + return beta; + } + + _getJNAF(point) { + assert(point instanceof ShortPoint); + + if (this.inf || point.inf) + return super._getJNAF(point); + + // Create comb for JSF. + const comb = [ + this, // 1 + null, // 3 + null, // 5 + point // 7 + ]; + + // Try to avoid Jacobian points, if possible. + if (this.y.eq(point.y)) { + comb[1] = this.add(point); + comb[2] = this.toJ().sub(point); + } else if (this.y.eq(point.y.redNeg())) { + comb[1] = this.toJ().add(point); + comb[2] = this.sub(point); + } else { + comb[1] = this.toJ().add(point); + comb[2] = this.toJ().sub(point); + } + + return comb; + } + + clone() { + if (this.inf) + return this.curve.point(); + + return this.curve.point(this.x, this.y); + } + + scale(a) { + return this.toJ().scale(a); + } + + neg() { + // P = O + if (this.inf) + return this; + + // -(X1, Y1) = (X1, -Y1) + return this.curve.point(this.x, this.y.redNeg()); + } + + add(p) { + // [GECC] Page 80, Section 3.1.2. + // + // Addition Law: + // + // l = (y1 - y2) / (x1 - x2) + // x3 = l^2 - x1 - x2 + // y3 = l * (x1 - x3) - y1 + // + // 1I + 2M + 1S + 6A + assert(p instanceof ShortPoint); + + // O + P = P + if (this.inf) + return p; + + // P + O = P + if (p.inf) + return this; + + // P + P, P + -P + if (this.x.eq(p.x)) { + // P + -P = O + if (!this.y.eq(p.y)) + return this.curve.point(); + + // P + P = 2P + return this.dbl(); + } + + // X1 != X2, Y1 = Y2 + if (this.y.eq(p.y)) { + // X3 = -X1 - X2 + const nx = this.x.redNeg().redISub(p.x); + + // Y3 = -Y1 + const ny = this.y.redNeg(); + + // Skip the inverse. + return this.curve.point(nx, ny); + } + + // H = X1 - X2 + const h = this.x.redSub(p.x); + + // R = Y1 - Y2 + const r = this.y.redSub(p.y); + + // L = R / H + const l = r.redDiv(h); + + // X3 = L^2 - X1 - X2 + const nx = l.redSqr().redISub(this.x).redISub(p.x); + + // Y3 = L * (X1 - X3) - Y1 + const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); + + return this.curve.point(nx, ny); + } + + dbl() { + // [GECC] Page 80, Section 3.1.2. + // + // Addition Law (doubling): + // + // l = (3 * x1^2 + a) / (2 * y1) + // x3 = l^2 - 2 * x1 + // y3 = l * (x1 - x3) - y1 + // + // 1I + 2M + 2S + 3A + 2*2 + 1*3 + + // P = O + if (this.inf) + return this; + + // Y1 = 0 + if (this.y.isZero()) + return this.curve.point(); + + // XX = X1^2 + const xx = this.x.redSqr(); + + // M = 3 * XX + a + const m = xx.redIMuln(3).redIAdd(this.curve.a); + + // Z = 2 * Y1 + const z = this.y.redMuln(2); + + // L = M / Z + const l = m.redDiv(z); + + // X3 = L^2 - 2 * X1 + const nx = l.redSqr().redISub(this.x).redISub(this.x); + + // Y3 = L * (X1 - X3) - Y1 + const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); + + return this.curve.point(nx, ny); + } + + dblp(pow) { + return this.toJ().dblp(pow).toP(); + } + + getX() { + if (this.inf) + throw new Error('Invalid point.'); + + return this.x.fromRed(); + } + + getY() { + if (this.inf) + throw new Error('Invalid point.'); + + return this.y.fromRed(); + } + + eq(p) { + assert(p instanceof ShortPoint); + + // P = Q + if (this === p) + return true; + + // P = O + if (this.inf) + return p.inf; + + // Q = O + if (p.inf) + return false; + + // X1 = X2, Y1 = Y2 + return this.x.eq(p.x) + && this.y.eq(p.y); + } + + cmp(point) { + assert(point instanceof ShortPoint); + + if (this.inf && !point.inf) + return -1; + + if (!this.inf && point.inf) + return 1; + + if (this.inf && point.inf) + return 0; + + return this.order().cmp(point.order()) + || this.getX().cmp(point.getX()) + || this.getY().cmp(point.getY()); + } + + isInfinity() { + // Infinity cannot be represented in + // the affine space, except by a flag. + return this.inf; + } + + isOrder2() { + if (this.inf) + return false; + + return this.y.isZero(); + } + + isOdd() { + if (this.inf) + return false; + + return this.y.redIsOdd(); + } + + isEven() { + if (this.inf) + return false; + + return this.y.redIsEven(); + } + + isSquare() { + if (this.inf) + return false; + + return this.y.redJacobi() !== -1; + } + + eqX(x) { + assert(x instanceof BN); + assert(!x.red); + + if (this.inf) + return false; + + return this.getX().eq(x); + } + + eqR(x) { + assert(x instanceof BN); + assert(!x.red); + assert(!this.curve.n.isZero()); + + if (this.inf) + return false; + + return this.getX().imod(this.curve.n).eq(x); + } + + mul(k) { + return super.mul(k).toP(); + } + + muln(k) { + return super.muln(k).toP(); + } + + mulBlind(k, rng) { + return super.mulBlind(k, rng).toP(); + } + + mulAdd(k1, p2, k2) { + return super.mulAdd(k1, p2, k2).toP(); + } + + mulH() { + return super.mulH().toP(); + } + + div(k) { + return super.div(k).toP(); + } + + divn(k) { + return super.divn(k).toP(); + } + + divH() { + return super.divH().toP(); + } + + toP() { + return this; + } + + toJ() { + // (X3, Y3, Z3) = (1, 1, 0) + if (this.inf) + return this.curve.jpoint(); + + // (X3, Y3, Z3) = (X1, Y1, 1) + return this.curve.jpoint(this.x, this.y, this.curve.one); + } + + encode(compact) { + // [SEC1] Page 10, Section 2.3.3. + if (compact == null) + compact = true; + + assert(typeof compact === 'boolean'); + + const {fieldSize} = this.curve; + + // We do not serialize points at infinity. + if (this.inf) + throw new Error('Invalid point.'); + + // Compressed form (0x02 = even, 0x03 = odd). + if (compact) { + const p = bufferExports.Buffer.alloc(1 + fieldSize); + const x = this.curve.encodeField(this.getX()); + + p[0] = 0x02 | this.y.redIsOdd(); + x.copy(p, 1); + + return p; + } + + // Uncompressed form (0x04). + const p = bufferExports.Buffer.alloc(1 + fieldSize * 2); + const x = this.curve.encodeField(this.getX()); + const y = this.curve.encodeField(this.getY()); + + p[0] = 0x04; + x.copy(p, 1); + y.copy(p, 1 + fieldSize); + + return p; + } + + static decode(curve, bytes) { + // [SEC1] Page 11, Section 2.3.4. + assert(curve instanceof ShortCurve); + assert(bufferExports.Buffer.isBuffer(bytes)); + + const len = curve.fieldSize; + + if (bytes.length < 1 + len) + throw new Error('Not a point.'); + + // Point forms: + // + // 0x00 -> Infinity (openssl, unsupported) + // 0x02 -> Compressed Even + // 0x03 -> Compressed Odd + // 0x04 -> Uncompressed + // 0x06 -> Hybrid Even (openssl) + // 0x07 -> Hybrid Odd (openssl) + // + // Note that openssl supports serializing points + // at infinity as {0}. We choose not to support it + // because it's strange and not terribly useful. + const form = bytes[0]; + + switch (form) { + case 0x02: + case 0x03: { + if (bytes.length !== 1 + len) + throw new Error('Invalid point size for compressed.'); + + const x = curve.decodeField(bytes.slice(1, 1 + len)); + + if (x.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + const p = curve.pointFromX(x, form === 0x03); + + assert(!p.isInfinity()); + + return p; + } + + case 0x04: + case 0x06: + case 0x07: { + if (bytes.length !== 1 + len * 2) + throw new Error('Invalid point size for uncompressed.'); + + const x = curve.decodeField(bytes.slice(1, 1 + len)); + const y = curve.decodeField(bytes.slice(1 + len, 1 + 2 * len)); + + // [GECC] Algorithm 4.3, Page 180, Section 4. + if (x.cmp(curve.p) >= 0 || y.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + // OpenSSL hybrid encoding. + if (form !== 0x04 && form !== (0x06 | y.isOdd())) + throw new Error('Invalid hybrid encoding.'); + + const p = curve.point(x, y); + + if (!p.validate()) + throw new Error('Invalid point.'); + + assert(!p.isInfinity()); + + return p; + } + + default: { + throw new Error('Unknown point format.'); + } + } + } + + encodeX() { + // [SCHNORR] "Specification". + // [BIP340] "Specification". + return this.curve.encodeField(this.getX()); + } + + static decodeEven(curve, bytes) { + // [BIP340] "Specification". + assert(curve instanceof ShortCurve); + + const x = curve.decodeField(bytes); + + if (x.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + return curve.pointFromX(x, false); + } + + static decodeSquare(curve, bytes) { + // [SCHNORR] "Specification". + assert(curve instanceof ShortCurve); + + const x = curve.decodeField(bytes); + + if (x.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + return curve.pointFromX(x); + } + + toJSON(pre) { + if (this.inf) + return []; + + const x = this.getX().toJSON(); + const y = this.getY().toJSON(); + + if (pre === true && this.pre) + return [x, y, this.pre.toJSON()]; + + return [x, y]; + } + + toPretty() { + if (this.inf) + return []; + + const size = this.curve.fieldSize * 2; + const x = toPretty(this.getX(), size); + const y = toPretty(this.getY(), size); + + return [x, y]; + } + + static fromJSON(curve, json) { + assert(curve instanceof ShortCurve); + assert(Array.isArray(json)); + assert(json.length === 0 + || json.length === 2 + || json.length === 3); + + if (json.length === 0) + return curve.point(); + + const x = BN.fromJSON(json[0]); + const y = BN.fromJSON(json[1]); + const point = curve.point(x, y); + + if (json.length > 2 && json[2] != null) + point.pre = Precomp.fromJSON(point, json[2]); + + return point; + } + + [custom]() { + if (this.inf) + return ''; + + return ''; + } + } + + /** + * JPoint + */ + + class JPoint extends Point { + constructor(curve, x, y, z) { + assert(curve instanceof ShortCurve); + + super(curve, types.JACOBIAN); + + this.x = this.curve.one; + this.y = this.curve.one; + this.z = this.curve.zero; + this.zOne = false; + + if (x != null) + this._init(x, y, z); + } + + _init(x, y, z) { + assert(x instanceof BN); + assert(y instanceof BN); + assert(z == null || (z instanceof BN)); + + this.x = x; + this.y = y; + this.z = z || this.curve.one; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + + this.zOne = this.z.eq(this.curve.one); + } + + clone() { + return this.curve.jpoint(this.x, this.y, this.z); + } + + validate() { + // [GECC] Example 3.20, Page 88, Section 3. + const {a, b} = this.curve; + + // P = O + if (this.isInfinity()) + return true; + + // Z1 = 1 + if (this.zOne) + return this.curve.validate(this.toP()); + + // y^2 = x^3 + a * x * z^4 + b * z^6 + const lhs = this.y.redSqr(); + const x3 = this.x.redSqr().redMul(this.x); + const z2 = this.z.redSqr(); + const z4 = z2.redSqr(); + const z6 = z4.redMul(z2); + const rhs = x3.redIAdd(b.redMul(z6)); + + if (!this.curve.zeroA) { + // Save some cycles for a = -3. + if (this.curve.threeA) + rhs.redIAdd(z4.redIMuln(-3).redMul(this.x)); + else + rhs.redIAdd(a.redMul(z4).redMul(this.x)); + } + + return lhs.eq(rhs); + } + + normalize() { + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#scaling-z + // 1I + 3M + 1S + + // Z = 1 + if (this.zOne) + return this; + + // P = O + if (this.isInfinity()) + return this; + + // A = 1 / Z1 + const a = this.z.redInvert(); + + // AA = A^2 + const aa = a.redSqr(); + + // X3 = X1 * AA + this.x = this.x.redMul(aa); + + // Y3 = Y1 * AA * A + this.y = this.y.redMul(aa).redMul(a); + + // Z3 = 1 + this.z = this.curve.one; + this.zOne = true; + + return this; + } + + scale(a) { + assert(a instanceof BN); + + // P = O + if (this.isInfinity()) + return this.curve.jpoint(); + + // AA = A^2 + const aa = a.redSqr(); + + // X3 = X1 * AA + const nx = this.x.redMul(aa); + + // Y3 = Y1 * AA * A + const ny = this.y.redMul(aa).redMul(a); + + // Z3 = Z1 * A + const nz = this.z.redMul(a); + + return this.curve.jpoint(nx, ny, nz); + } + + neg() { + // -(X1, Y1, Z1) = (X1, -Y1, Z1) + return this.curve.jpoint(this.x, this.y.redNeg(), this.z); + } + + add(p) { + assert(p instanceof Point); + + if (p.type === types.AFFINE) + return this._mixedAdd(p); + + return this._add(p); + } + + _add(p) { + assert(p instanceof JPoint); + + // O + P = P + if (this.isInfinity()) + return p; + + // P + O = P + if (p.isInfinity()) + return this; + + // Z1 = 1 + if (this.zOne) + return p._addJA(this); + + // Z2 = 1 + if (p.zOne) + return this._addJA(p); + + return this._addJJ(p); + } + + _mixedAdd(p) { + assert(p instanceof ShortPoint); + + // O + P = P + if (this.isInfinity()) + return p.toJ(); + + // P + O = P + if (p.isInfinity()) + return this; + + return this._addJA(p); + } + + _addJJ(p) { + // No assumptions. + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-1998-cmo-2 + // 12M + 4S + 6A + 1*2 (implemented as: 12M + 4S + 7A) + + // Z1Z1 = Z1^2 + const z1z1 = this.z.redSqr(); + + // Z2Z2 = Z2^2 + const z2z2 = p.z.redSqr(); + + // U1 = X1 * Z2Z2 + const u1 = this.x.redMul(z2z2); + + // U2 = X2 * Z1Z1 + const u2 = p.x.redMul(z1z1); + + // S1 = Y1 * Z2 * Z2Z2 + const s1 = this.y.redMul(p.z).redMul(z2z2); + + // S2 = Y2 * Z1 * Z1Z1 + const s2 = p.y.redMul(this.z).redMul(z1z1); + + // H = U2 - U1 + const h = u2.redISub(u1); + + // r = S2 - S1 + const r = s2.redISub(s1); + + // H = 0 + if (h.isZero()) { + if (!r.isZero()) + return this.curve.jpoint(); + + return this.dbl(); + } + + // HH = H^2 + const hh = h.redSqr(); + + // HHH = H * HH + const hhh = h.redMul(hh); + + // V = U1 * HH + const v = u1.redMul(hh); + + // X3 = r^2 - HHH - 2 * V + const nx = r.redSqr().redISub(hhh).redISub(v).redISub(v); + + // Y3 = r * (V - X3) - S1 * HHH + const ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh)); + + // Z3 = Z1 * Z2 * H + const nz = this.z.redMul(p.z).redMul(h); + + return this.curve.jpoint(nx, ny, nz); + } + + _addJA(p) { + // Assumes Z2 = 1. + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-madd + // 8M + 3S + 6A + 5*2 (implemented as: 8M + 3S + 7A + 4*2) + + // Z1Z1 = Z1^2 + const z1z1 = this.z.redSqr(); + + // U2 = X2 * Z1Z1 + const u2 = p.x.redMul(z1z1); + + // S2 = Y2 * Z1 * Z1Z1 + const s2 = p.y.redMul(this.z).redMul(z1z1); + + // H = U2 - X1 + const h = u2.redISub(this.x); + + // r = 2 * (S2 - Y1) + const r = s2.redISub(this.y).redIMuln(2); + + // H = 0 + if (h.isZero()) { + if (!r.isZero()) + return this.curve.jpoint(); + + return this.dbl(); + } + + // I = (2 * H)^2 + const i = h.redMuln(2).redSqr(); + + // J = H * I + const j = h.redMul(i); + + // V = X1 * I + const v = this.x.redMul(i); + + // X3 = r^2 - J - 2 * V + const nx = r.redSqr().redISub(j).redISub(v).redISub(v); + + // Y3 = r * (V - X3) - 2 * Y1 * J + const ny = r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2)); + + // Z3 = 2 * Z1 * H + const nz = this.z.redMul(h).redIMuln(2); + + return this.curve.jpoint(nx, ny, nz); + } + + dbl() { + // P = O + if (this.isInfinity()) + return this; + + // Y1 = 0 + if (this.y.isZero()) + return this.curve.jpoint(); + + // a = 0 + if (this.curve.zeroA) + return this._dbl0(); + + // a = -3 + if (this.curve.threeA) + return this._dbl3(); + + return this._dblJ(); + } + + _dblJ() { + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-1998-cmo-2 + // 3M + 6S + 4A + 1*a + 2*2 + 1*3 + 1*4 + 1*8 + // (implemented as: 3M + 6S + 5A + 1*a + 1*2 + 1*3 + 1*4 + 1*8) + + // XX = X1^2 + const xx = this.x.redSqr(); + + // YY = Y1^2 + const yy = this.y.redSqr(); + + // ZZ = Z1^2 + const zz = this.z.redSqr(); + + // S = 4 * X1 * YY + const s = this.x.redMul(yy).redIMuln(4); + + // M = 3 * XX + a * ZZ^2 + const m = xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr())); + + // T = M^2 - 2 * S + const t = m.redSqr().redISub(s).redISub(s); + + // X3 = T + const nx = t; + + // Y3 = M * (S - T) - 8 * YY^2 + const ny = m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8)); + + // Z3 = 2 * Y1 * Z1 + const nz = this.y.redMul(this.z).redIMuln(2); + + return this.curve.jpoint(nx, ny, nz); + } + + _dbl0() { + // Assumes a = 0. + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l + // 2M + 5S + 6A + 3*2 + 1*3 + 1*8 + // (implemented as: 2M + 5S + 7A + 2*2 + 1*3 + 1*8) + + // A = X1^2 + const a = this.x.redSqr(); + + // B = Y1^2 + const b = this.y.redSqr(); + + // C = B^2 + const c = b.redSqr(); + + // + XB2 = (X1 + B)^2 + const xb2 = b.redIAdd(this.x).redSqr(); + + // D = 2 * ((X1 + B)^2 - A - C) + const d = xb2.redISub(a).redISub(c).redIMuln(2); + + // E = 3 * A + const e = a.redIMuln(3); + + // F = E^2 + const f = e.redSqr(); + + // X3 = F - 2 * D + const nx = f.redISub(d).redISub(d); + + // Y3 = E * (D - X3) - 8 * C + const ny = e.redMul(d.redISub(nx)).redISub(c.redIMuln(8)); + + // Z3 = 2 * Y1 * Z1 + const nz = this.y.redMul(this.z).redIMuln(2); + + return this.curve.jpoint(nx, ny, nz); + } + + _dbl3() { + // Assumes a = -3. + // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b + // 3M + 5S + 8A + 1*3 + 1*4 + 2*8 + // (implemented as: 3M + 5S + 8A + 1*2 + 1*3 + 1*4 + 1*8) + + // delta = Z1^2 + const delta = this.z.redSqr(); + + // gamma = Y1^2 + const gamma = this.y.redSqr(); + + // beta = X1 * gamma + const beta = this.x.redMul(gamma); + + // + xmdelta = X1 - delta + const xmdelta = this.x.redSub(delta); + + // + xpdelta = X1 + delta + const xpdelta = this.x.redAdd(delta); + + // alpha = 3 * (X1 - delta) * (X1 + delta) + const alpha = xmdelta.redMul(xpdelta).redIMuln(3); + + // + beta4 = 4 * beta + const beta4 = beta.redIMuln(4); + + // + beta8 = 2 * beta4 + const beta8 = beta4.redMuln(2); + + // + gamma28 = 8 * gamma^2 + const gamma28 = gamma.redSqr().redIMuln(8); + + // X3 = alpha^2 - 8 * beta + const nx = alpha.redSqr().redISub(beta8); + + // Z3 = (Y1 + Z1)^2 - gamma - delta + const nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); + + // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 + const ny = alpha.redMul(beta4.redISub(nx)).redISub(gamma28); + + return this.curve.jpoint(nx, ny, nz); + } + + getX() { + if (this.isInfinity()) + throw new Error('Invalid point.'); + + this.normalize(); + + return this.x.fromRed(); + } + + getY() { + if (this.isInfinity()) + throw new Error('Invalid point.'); + + this.normalize(); + + return this.y.fromRed(); + } + + eq(p) { + assert(p instanceof JPoint); + + // P = Q + if (this === p) + return true; + + // P = O + if (this.isInfinity()) + return p.isInfinity(); + + // Q = O + if (p.isInfinity()) + return false; + + // Z1 = Z2 + if (this.z.eq(p.z)) { + return this.x.eq(p.x) + && this.y.eq(p.y); + } + + // X1 * Z2^2 = X2 * Z1^2 + const zz1 = this.z.redSqr(); + const zz2 = p.z.redSqr(); + const x1 = this.x.redMul(zz2); + const x2 = p.x.redMul(zz1); + + if (!x1.eq(x2)) + return false; + + // Y1 * Z2^3 = Y2 * Z1^3 + const zzz1 = zz1.redMul(this.z); + const zzz2 = zz2.redMul(p.z); + const y1 = this.y.redMul(zzz2); + const y2 = p.y.redMul(zzz1); + + return y1.eq(y2); + } + + cmp(point) { + assert(point instanceof JPoint); + + const inf1 = this.isInfinity(); + const inf2 = point.isInfinity(); + + if (inf1 && !inf2) + return -1; + + if (!inf1 && inf2) + return 1; + + if (inf1 && inf2) + return 0; + + return this.order().cmp(point.order()) + || this.getX().cmp(point.getX()) + || this.getY().cmp(point.getY()); + } + + isInfinity() { + // Z1 = 0 + return this.z.isZero(); + } + + isOrder2() { + if (this.isInfinity()) + return false; + + return this.y.isZero(); + } + + isOdd() { + if (this.isInfinity()) + return false; + + this.normalize(); + + return this.y.redIsOdd(); + } + + isEven() { + if (this.isInfinity()) + return false; + + this.normalize(); + + return this.y.redIsEven(); + } + + isSquare() { + if (this.isInfinity()) + return false; + + return this.y.redMul(this.z).redJacobi() !== -1; + } + + eqX(x) { + // Verify that integer `x` is equal to field + // element `x` by scaling it by our z coordinate. + // This optimization is mentioned in and used for + // bip-schnorr[1]. This avoids having to affinize + // the resulting point during verification. + // + // [1] [SCHNORR] "Optimizations". + assert(x instanceof BN); + assert(!x.red); + + if (this.isInfinity()) + return false; + + const zz = this.z.redSqr(); + const rx = x.toRed(this.curve.red).redMul(zz); + + return this.x.eq(rx); + } + + eqR(x) { + // Similar to the optimization above, this + // optimization, suggested by Maxwell[1], + // compares an integer to an X coordinate + // by scaling it. + // + // Since a signature's R value is modulo N + // in ECDSA, we may be dealing with an R + // value greater than N in actuality. + // + // If the equality check fails, we can + // scale N itself by Z and add it to the + // X field element. + // + // [1] https://github.com/bitcoin-core/secp256k1/commit/ce7eb6f + assert(x instanceof BN); + assert(!x.red); + + if (!this.curve.smallGap) + return this.toP().eqR(x); + + if (this.isInfinity()) + return false; + + if (x.cmp(this.curve.p) >= 0) + return false; + + const zz = this.z.redSqr(); + const rx = x.toRed(this.curve.red).redMul(zz); + + if (this.x.eq(rx)) + return true; + + if (this.curve.highOrder) + return false; + + if (x.cmp(this.curve.pmodn) >= 0) + return false; + + const rn = this.curve.redN.redMul(zz); + + rx.redIAdd(rn); + + return this.x.eq(rx); + } + + toP() { + // P = O + if (this.isInfinity()) + return this.curve.point(); + + this.normalize(); + + // (X3, Y3) = (X1 / Z1^2, Y1 / Z1^3) + return this.curve.point(this.x, this.y); + } + + toJ() { + return this; + } + + encode(compact) { + return this.toP().encode(compact); + } + + static decode(curve, bytes) { + return ShortPoint.decode(curve, bytes).toJ(); + } + + encodeX() { + return this.toP().encodeX(); + } + + static decodeEven(curve, bytes) { + return ShortPoint.decodeEven(curve, bytes).toJ(); + } + + static decodeSquare(curve, bytes) { + return ShortPoint.decodeSquare(curve, bytes).toJ(); + } + + toJSON(pre) { + return this.toP().toJSON(pre); + } + + toPretty() { + return this.toP().toPretty(); + } + + static fromJSON(curve, json) { + return ShortPoint.fromJSON(curve, json).toJ(); + } + + [custom]() { + if (this.isInfinity()) + return ''; + + return ''; + } + } + + /** + * MontCurve + */ + + class MontCurve extends Curve { + constructor(conf) { + super(MontPoint, 'mont', conf); + + this.a = BN.fromJSON(conf.a).toRed(this.red); + this.b = BN.fromJSON(conf.b).toRed(this.red); + + this.bi = this.b.redInvert(); + this.a2 = this.a.redAdd(this.two); + this.a24 = this.a2.redMul(this.i4); + this.a3 = this.a.redMul(this.i3); + this.a0 = this.a.redMul(this.bi); + this.b0 = this.bi.redSqr(); + + this._finalize(conf); + } + + static _isomorphism(curveA, curveB, customB) { + // Montgomery Isomorphism. + // + // [MONT3] Page 3, Section 2.1. + // + // Transformation: + // + // A' = A + // B' = B' + // + // Where (B / B') is square. + assert(curveA instanceof BN); + assert(curveB instanceof BN); + assert(customB instanceof BN); + + const a = curveA.clone(); + const b = customB.clone(); + const c = curveB.redDiv(customB); + + if (c.redJacobi() !== 1) + throw new Error('Invalid `b` coefficient.'); + + return [a, b]; + } + + _short(a0, odd) { + // Montgomery->Short Weierstrass Equivalence. + // + // [MONT2] "Equivalence with Weierstrass curves". + // + // Transformation: + // + // a = (3 - A^2) / (3 * B^2) + // b = (2 * A^3 - 9 * A) / (27 * B^3) + const {a, b, three} = this; + const a2 = a.redSqr(); + const a3 = a2.redMul(a); + const b2 = b.redSqr(); + const b3 = b2.redMul(b); + const n0 = three.redSub(a2); + const d0 = b2.redMuln(3); + const n1 = a3.redMuln(2).redISub(a.redMuln(9)); + const d1 = b3.redMuln(27); + const wa = n0.redDiv(d0); + const wb = n1.redDiv(d1); + + if (a0 != null) + return ShortCurve._isomorphism(wa, wb, a0, odd); + + return [wa, wb]; + } + + _mont(b0) { + return MontCurve._isomorphism(this.a, this.b, b0); + } + + _edwards(a0, invert = false) { + // Montgomery->Twisted Edwards Transformation. + // + // [MONT1] Page 11, Section 4.3.5. + // [TWISTED] Theorem 3.2, Page 4, Section 3. + // + // Equivalence: + // + // a = (A + 2) / B + // d = (A - 2) / B + // + // Isomorphism: + // + // a = a' + // d = a' * (A - 2) / (A + 2) + // + // Where ((A + 2) / (B * a')) is square. + // + // If `d` is square, we can usually find + // a complete curve by using the `invert` + // option. This will create an isomorphism + // chain of: M(A,B)->E(a,d)->E(d,a). + // + // The equivalence between E(a,d) and + // E(d,a) is: + // + // (x, y) = (x, 1 / y) + // + // Meaning our map to E(d,a) is: + // + // x = u / v + // y = 1 / ((u - 1) / (u + 1)) + // = (u + 1) / (u - 1) + assert(typeof invert === 'boolean'); + + const {two, bi} = this; + const a = this.a.redAdd(two).redMul(bi); + const d = this.a.redSub(two).redMul(bi); + + if (invert) + a.swap(d); + + if (a0 != null) + return EdwardsCurve._isomorphism(a, d, a0); + + return [a, d]; + } + + _scaleShort(curve) { + assert(curve instanceof ShortCurve); + + const [u2, u3] = curve._scale(this); + + return [this.field(u2.redInvert()), + this.field(u3.redInvert())]; + } + + _scaleMont(curve) { + // We can extract the isomorphism factor with: + // + // c = +-sqrt(B / B') + // + // If base points are available, we can do: + // + // c = v' / v + assert(curve instanceof MontCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) + return this.field(curve.b).redDivSqrt(this.b); + + return this.g.y.redDiv(this.field(curve.g.y)); + } + + _scaleEdwards(curve, invert) { + // We _could_ do something like: + // + // B = 4 / (a - d) + // c = +-sqrt(B / B') + // + // Which can be reduced to: + // + // c = +-sqrt(4 / ((a - d) * B')) + // + // If base points are available: + // + // v = u' / x + // c = v' / v + // + // Which can be reduced to: + // + // c = v' * x / u' + // + // However, the way our maps are + // written, we can re-use the Edwards + // isomorphism factor when going the + // other direction. + assert(curve instanceof EdwardsCurve); + + const c = curve._scale(this, invert); + + return this.field(c); + } + + _solveY0(x) { + assert(x instanceof BN); + + // y^2 = x^3 + A * x^2 + B * x + const a = this.a0; + const b = this.b0; + const x2 = x.redSqr(); + const x3 = x2.redMul(x); + const y2 = x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x)); + + return y2; + } + + _elligator2(u) { + // Elligator 2. + // + // Distribution: 1/2. + // + // [ELL2] Page 11, Section 5.2. + // [H2EC] "Elligator 2 Method". + // "Mappings for Montgomery curves". + // [SAFE] "Indistinguishability from uniform random strings". + // + // Assumptions: + // + // - y^2 = x^3 + A * x^2 + B * x. + // - A != 0, B != 0. + // - A^2 - 4 * B is non-zero and non-square in F(p). + // - Let z be a non-square in F(p). + // - u != +-sqrt(-1 / z). + // + // Note that Elligator 2 is defined over the form: + // + // y'^2 = x'^3 + A' * x'^2 + B' * x' + // + // Instead of: + // + // B * y^2 = x^3 + A * x^2 + x + // + // Where: + // + // A' = A / B + // B' = 1 / B^2 + // x' = x / B + // y' = y / B + // + // And: + // + // x = B * x' + // y = B * y' + // + // This is presumably the result of Elligator 2 + // being designed in long Weierstrass form. If + // we want to support B != 1, we need to do the + // conversion. + // + // Map: + // + // g(x) = x^3 + A * x^2 + B * x + // x1 = -A / (1 + z * u^2) + // x1 = -A, if x1 = 0 + // x2 = -x1 - A + // x = x1, if g(x1) is square + // = x2, otherwise + // y = sign(u) * abs(sqrt(g(x))) + const lhs = this.a0.redNeg(); + const rhs = this.one.redAdd(this.z.redMul(u.redSqr())); + + if (rhs.isZero()) + rhs.inject(this.one); + + const x1 = lhs.redMul(rhs.redInvert()); + const x2 = x1.redNeg().redISub(this.a0); + const y1 = this._solveY0(x1); + const y2 = this._solveY0(x2); + const alpha = y1.redIsSquare() | 0; + const x0 = [x1, x2][alpha ^ 1]; + const y0 = [y1, y2][alpha ^ 1].redSqrt(); + + if (y0.redIsOdd() !== u.redIsOdd()) + y0.redINeg(); + + const x = this.b.redMul(x0); + const y = this.b.redMul(y0); + + return this.point(x, y); + } + + _invert2(p, hint) { + // Inverting the Map (Elligator 2). + // + // [ELL2] Page 12, Section 5.3. + // + // Assumptions: + // + // - -z * x * (x + A) is square in F(p). + // - If r = 1 then x != 0. + // - If r = 2 then x != -A. + // + // Map: + // + // u1 = -(x + A) / (x * z) + // u2 = -x / ((x + A) * z) + // r = random integer in [1,2] + // u = sign(y) * abs(sqrt(ur)) + // + // Note that `0 / 0` can only occur if A = 0 + // (this violates the assumptions of Elligator 2). + const {x, y} = p; + const r = hint & 1; + const x0 = x.redMul(this.bi); + const y0 = y.redMul(this.bi); + const n = x0.redAdd(this.a0); + const d = x0; + const lhs = [n, d][r].redINeg(); + const rhs = [d, n][r].redMul(this.z); + const u = lhs.redDivSqrt(rhs); + + if (u.redIsOdd() !== y0.redIsOdd()) + u.redINeg(); + + return u; + } + + isElliptic() { + const a2 = this.a.redSqr(); + const d = this.b.redMul(a2.redSub(this.four)); + + // B * (A^2 - 4) != 0 + return !d.isZero(); + } + + jinv() { + // [MONT3] Page 3, Section 2. + const {a, three, four} = this; + const a2 = a.redSqr(); + const t0 = a2.redSub(three); + const lhs = t0.redPown(3).redIMuln(256); + const rhs = a2.redSub(four); + + if (rhs.isZero()) + throw new Error('Curve is not elliptic.'); + + // (256 * (A^2 - 3)^3) / (A^2 - 4) + return lhs.redDiv(rhs).fromRed(); + } + + point(x, y) { + return new MontPoint(this, x, y); + } + + jpoint(x, y, z) { + assert(x == null && y == null && z == null); + return this.point(); + } + + xpoint(x, z) { + return new XPoint(this, x, z); + } + + solveY2(x) { + // [MONT3] Page 3, Section 2. + // https://hyperelliptic.org/EFD/g1p/auto-montgom.html + assert(x instanceof BN); + + // B * y^2 = x^3 + A * x^2 + x + const x2 = x.redSqr(); + const x3 = x2.redMul(x); + const by2 = x3.redIAdd(this.a.redMul(x2)).redIAdd(x); + const y2 = by2.redMul(this.bi); + + return y2; + } + + validate(point) { + assert(point instanceof MontPoint); + + if (point.isInfinity()) + return true; + + const {x, y} = point; + const y2 = this.solveY2(x); + + return y.redSqr().eq(y2); + } + + pointFromX(x, sign = null) { + assert(x instanceof BN); + assert(sign == null || typeof sign === 'boolean'); + + if (!x.red) + x = x.toRed(this.red); + + const y = this.solveY(x); + + if (sign != null) { + if (y.isZero() && sign) + throw new Error('Invalid point.'); + + if (y.redIsOdd() !== sign) + y.redINeg(); + } + + return this.point(x, y); + } + + isIsomorphic(curve, invert) { + // [MONT3] Page 3, Section 2.1. + assert(curve instanceof Curve); + + if (!curve.p.eq(this.p)) + return false; + + // M(A,B) <-> M(A,B') + if (curve.type === 'mont') { + const a = this.field(curve.a); + const b = this.field(curve.b); + + // A' = A + if (!this.a.eq(a)) + return false; + + // B' != 0 + if (this.b.isZero()) + return false; + + // jacobi(B / B') = 1 + const c = b.redDiv(this.b); + + return c.redJacobi() === 1; + } + + return curve.isIsomorphic(this, invert); + } + + isIsogenous(curve) { + assert(curve instanceof Curve); + + if (curve.type === 'mont') + return false; + + return curve.isIsogenous(this); + } + + pointFromShort(point) { + // [ALT] Appendix E.2 (Switching between Alternative Representations). + // [MONT2] "Equivalence with Weierstrass curves" + assert(point instanceof ShortPoint); + + if (this.isIsomorphic(point.curve)) { + // Equivalence for E(a,b)->M(A,B): + // + // u = B * x - A / 3 + // v = B * y + // + // Undefined if ((u^3 + A * u^2 + u) / B) is not square. + if (point.isInfinity()) + return this.point(); + + const {a3, b} = this; + const [u2, u3] = this._scale(point.curve); + const x = this.field(point.x).redMul(u2); + const y = this.field(point.y).redMul(u3); + const u = b.redMul(x).redISub(a3); + const v = b.redMul(y); + + return this.point(u, v); + } + + throw new Error('Not implemented.'); + } + + pointFromMont(point) { + // [MONT3] Page 3, Section 2.1. + assert(point instanceof MontPoint); + + if (this.isIsomorphic(point.curve)) { + // Isomorphic maps for M(A,B)<->M(A,B'): + // + // u' = u + // v' = +-sqrt(B / B') * v + // + // Undefined if (B / B') is not square. + if (point.isInfinity()) + return this.point(); + + const c = this._scale(point.curve); + const u = this.field(point.x); + const v = this.field(point.y); + const nu = u; + const nv = c.redMul(v); + + return this.point(nu, nv); + } + + throw new Error('Not implemented.'); + } + + pointFromEdwards(point) { + // [RFC7748] Section 4.1 & 4.2. + // [MONT3] Page 6, Section 2.5. + // [TWISTED] Theorem 3.2, Page 4, Section 3. + assert(point instanceof EdwardsPoint); + assert(point.curve.p.eq(this.p)); + + // Edwards `x`, `y`, `z`. + const x = this.field(point.x); + const y = this.field(point.y); + const z = this.field(point.z); + + if (this.isIsogenous(point.curve)) { + // 4-isogeny maps for E(1,d)->M(2-4d,1): + // + // u = y^2 / x^2 + // v = (2 - x^2 - y^2) * y / x^3 + // + // Undefined for x = 0. + // + // Exceptional Cases: + // - (0, 1) -> O + // - (0, -1) -> (0, 0) + // + // Unexceptional Cases: + // - (+-1, 0) -> (0, 0) + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.zero); + + const c = z.redSqr().redIMuln(2); + const uu = y.redSqr(); + const uz = x.redSqr(); + const vv = c.redISub(uz).redISub(uu).redMul(y); + const vz = uz.redMul(x); + + return this.cpoint(uu, uz, vv, vz); + } + + if (this.isIsomorphic(point.curve, true)) { + // Isomorphic maps for E(d,a)->M(A,B): + // + // u = (y + 1) / (y - 1) + // v = +-sqrt((A - 2) / (B * a)) * u / x + // + // Undefined for x = 0 or y = 1. + // + // Exceptional Cases: + // - (0, 1) -> O + // - (0, -1) -> (0, 0) + // + // Unexceptional Cases: + // - (+-sqrt(1 / a), 0) -> (-1, +-sqrt((A - 2) / B)) + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.zero); + + const c = this._scale(point.curve, true); + const uu = y.redAdd(z); + const uz = y.redSub(z); + const vv = c.redMul(z).redMul(uu); + const vz = x.redMul(uz); + + return this.cpoint(uu, uz, vv, vz); + } + + if (this.isIsomorphic(point.curve, false)) { + // Isomorphic maps for E(a,d)->M(A,B): + // + // u = (1 + y) / (1 - y) + // v = +-sqrt((A + 2) / (B * a)) * u / x + // + // Undefined for x = 0 or y = 1. + // + // Exceptional Cases: + // - (0, 1) -> O + // - (0, -1) -> (0, 0) + // + // Unexceptional Cases: + // - (+-sqrt(1 / a), 0) -> (1, +-sqrt((A + 2) / B)) + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.zero); + + const c = this._scale(point.curve, false); + const uu = z.redAdd(y); + const uz = z.redSub(y); + const vv = c.redMul(z).redMul(uu); + const vz = x.redMul(uz); + + return this.cpoint(uu, uz, vv, vz); + } + + throw new Error('Not implemented.'); + } + + pointFromUniform(u) { + assert(u instanceof BN); + + // z = 0 or A = 0 + if (this.z.isZero() || this.a.isZero()) + throw new Error('Not implemented.'); + + return this._elligator2(u); + } + + pointToUniform(p, hint) { + // Convert a montgomery point to a field + // element by inverting the elligator2 map. + // + // Hint Layout: + // + // [00000000] [0000] [0000] + // | | | + // | | +-- preimage index + // | +--- subgroup + // +-- bits to OR with uniform bytes + assert(p instanceof MontPoint); + assert((hint >>> 0) === hint); + + // z = 0 or A = 0 + if (this.z.isZero() || this.a.isZero()) + throw new Error('Not implemented.'); + + // P = O + if (p.isInfinity()) + throw new Error('Invalid point.'); + + // Add a random torsion component. + const i = ((hint >>> 4) & 15) % this.torsion.length; + const q = p.add(this.torsion[i]); + + return wrapErrors(() => { + return this._invert2(q, hint); + }); + } + + decodePoint(bytes, sign) { + return MontPoint.decode(this, bytes, sign); + } + + encodeX(point) { + assert(point instanceof XPoint); + return point.encode(); + } + + decodeX(bytes) { + return XPoint.decode(this, bytes); + } + + toShort(a0, odd, sign = null) { + const [a, b] = this._short(a0, odd); + + const curve = new ShortCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = curve._scale(this); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromMont(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromMont(this.torsion[i]); + + return curve; + } + + toMont(b0, sign = null) { + const [a, b] = this._mont(b0); + + const curve = new MontCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h, + z: this.z + }); + + if (sign != null) { + const c = curve._scale(this); + + if (c.redIsOdd() !== sign) + c.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromMont(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromMont(this.torsion[i]); + + return curve; + } + + toEdwards(a0, invert, sign = null) { + const [a, d] = this._edwards(a0, invert); + + const curve = new EdwardsCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + d: d, + n: this.n, + h: this.h, + z: this.z + }); + + if (sign != null) { + const c = curve._scale(this, invert); + + if (c.redIsOdd() !== sign) + c.redINeg(); + } + + if (!this.g.isInfinity()) { + curve.g = curve.pointFromMont(this.g); + curve.g.normalize(); + } + + if (curve.isComplete()) { + for (let i = 0; i < this.h.word(0); i++) { + curve.torsion[i] = curve.pointFromMont(this.torsion[i]); + curve.torsion[i].normalize(); + } + } + + return curve; + } + + pointFromJSON(json) { + return MontPoint.fromJSON(this, json); + } + + toJSON(pre) { + const json = super.toJSON(pre); + json.a = this.a.fromRed().toJSON(); + json.b = this.b.fromRed().toJSON(); + return json; + } + } + + /** + * MontPoint + */ + + class MontPoint extends Point { + constructor(curve, x, y) { + assert(curve instanceof MontCurve); + + super(curve, types.AFFINE); + + this.x = this.curve.zero; + this.y = this.curve.zero; + this.inf = true; + + if (x != null) + this._init(x, y); + } + + _init(x, y) { + assert(x instanceof BN); + assert(y instanceof BN); + + this.x = x; + this.y = y; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + + this.inf = false; + } + + clone() { + if (this.inf) + return this.curve.point(); + + return this.curve.point(this.x, this.y); + } + + scale(a) { + return this.clone(); + } + + randomize(rng) { + return this.clone(); + } + + neg() { + // P = O + if (this.inf) + return this; + + // -(X1, Y1) = (X1, -Y1) + return this.curve.point(this.x, this.y.redNeg()); + } + + add(p) { + // [MONT1] Page 8, Section 4.3.2. + // + // Addition Law: + // + // l = (y2 - y1) / (x2 - x1) + // x3 = b * l^2 - a - x1 - x2 + // y3 = l * (x1 - x3) - y1 + // + // 1I + 2M + 1S + 7A + 1*b + assert(p instanceof MontPoint); + + // O + P = P + if (this.inf) + return p; + + // P + O = P + if (p.inf) + return this; + + // P + P, P + -P + if (this.x.eq(p.x)) { + // P + -P = O + if (!this.y.eq(p.y)) + return this.curve.point(); + + // P + P = 2P + return this.dbl(); + } + + // H = X2 - X1 + const h = p.x.redSub(this.x); + + // R = Y2 - Y1 + const r = p.y.redSub(this.y); + + // L = R / H + const l = r.redDiv(h); + + // K = b * L^2 + const k = this.curve.b.redMul(l.redSqr()); + + // X3 = K - a - X1 - X2 + const nx = k.redISub(this.curve.a).redISub(this.x).redISub(p.x); + + // Y3 = L * (X1 - X3) - Y1 + const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); + + return this.curve.point(nx, ny); + } + + dbl() { + // [MONT1] Page 8, Section 4.3.2. + // + // Addition Law (doubling): + // + // l = (3 * x1^2 + 2 * a * x1 + 1) / (2 * b * y1) + // x3 = b * l^2 - a - 2 * x1 + // y3 = l * (x1 - x3) - y1 + // + // 1I + 3M + 2S + 7A + 1*a + 1*b + 1*b + 2*2 + 1*3 + + // P = O + if (this.inf) + return this; + + // Y1 = 0 + if (this.y.isZero()) + return this.curve.point(); + + // M1 = 3 * X1^2 + const m1 = this.x.redSqr().redIMuln(3); + + // M2 = 2 * a * X1 + const m2 = this.curve.a.redMul(this.x).redIMuln(2); + + // M = M1 + M2 + 1 + const m = m1.redIAdd(m2).redIAdd(this.curve.one); + + // Z = 2 * b * Y1 + const z = this.curve.b.redMul(this.y).redIMuln(2); + + // L = M / Z + const l = m.redDiv(z); + + // K = b * L^2 + const k = this.curve.b.redMul(l.redSqr()); + + // X3 = K - a - 2 * X1 + const nx = k.redISub(this.curve.a).redISub(this.x).redISub(this.x); + + // Y3 = L * (X1 - X3) - Y1 + const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); + + return this.curve.point(nx, ny); + } + + getX() { + if (this.inf) + throw new Error('Invalid point.'); + + return this.x.fromRed(); + } + + getY() { + if (this.inf) + throw new Error('Invalid point.'); + + return this.y.fromRed(); + } + + eq(p) { + assert(p instanceof MontPoint); + + // P = Q + if (this === p) + return true; + + // P = O + if (this.inf) + return p.inf; + + // Q = O + if (p.inf) + return false; + + // X1 = X2, Y1 = Y2 + return this.x.eq(p.x) + && this.y.eq(p.y); + } + + cmp(point) { + assert(point instanceof MontPoint); + + if (this.inf && !point.inf) + return -1; + + if (!this.inf && point.inf) + return 1; + + if (this.inf && point.inf) + return 0; + + return this.order().cmp(point.order()) + || this.getX().cmp(point.getX()) + || this.getY().cmp(point.getY()); + } + + isInfinity() { + // Infinity cannot be represented in + // the affine space, except by a flag. + return this.inf; + } + + isOrder2() { + if (this.inf) + return false; + + return this.y.isZero(); + } + + isOdd() { + if (this.inf) + return false; + + return this.y.redIsOdd(); + } + + isEven() { + if (this.inf) + return false; + + return this.y.redIsEven(); + } + + toP() { + return this; + } + + toJ() { + return this; + } + + toX() { + // (X3, Z3) = (1, 0) + if (this.inf) + return this.curve.xpoint(); + + // (X3, Z3) = (X1, 1) + return this.curve.xpoint(this.x, this.curve.one); + } + + encode() { + return this.toX().encode(); + } + + static decode(curve, bytes, sign) { + assert(curve instanceof MontCurve); + return curve.decodeX(bytes).toP(sign); + } + + toJSON(pre) { + if (this.inf) + return []; + + const x = this.getX().toJSON(); + const y = this.getY().toJSON(); + + return [x, y]; + } + + toPretty() { + if (this.inf) + return []; + + const size = this.curve.fieldSize * 2; + const x = toPretty(this.getX(), size); + const y = toPretty(this.getY(), size); + + return [x, y]; + } + + static fromJSON(curve, json) { + assert(curve instanceof MontCurve); + assert(Array.isArray(json)); + assert(json.length === 0 + || json.length === 2 + || json.length === 3); + + if (json.length === 0) + return curve.point(); + + const x = BN.fromJSON(json[0]); + const y = BN.fromJSON(json[1]); + + return curve.point(x, y); + } + + [custom]() { + if (this.inf) + return ''; + + return ''; + } + } + + /** + * XPoint + */ + + class XPoint extends Point { + constructor(curve, x, z) { + assert(curve instanceof MontCurve); + + super(curve, types.PROJECTIVE); + + this.x = this.curve.one; + this.z = this.curve.zero; + + if (x != null) + this._init(x, z); + } + + _init(x, z) { + assert(x instanceof BN); + assert(z == null || (z instanceof BN)); + + this.x = x; + this.z = z || this.curve.one; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + } + + clone() { + return this.curve.xpoint(this.x, this.z); + } + + precompute(power, rng) { + // No-op. + return this; + } + + validate() { + if (this.isInfinity()) + return true; + + // B * y^2 * z = x^3 + A * x^2 * z + x * z^2 + const {x, z} = this; + const x2 = x.redSqr(); + const x3 = x2.redMul(x); + const z2 = z.redSqr(); + const ax2 = this.curve.a.redMul(x2).redMul(z); + const by2 = x3.redIAdd(ax2).redIAdd(x.redMul(z2)); + const y2 = by2.redMul(this.curve.bi); + + // sqrt(y^2 * z^4) = y * z^2 + return y2.redMul(z).redJacobi() !== -1; + } + + normalize() { + // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#scaling-scale + // 1I + 1M + + // P = O + if (this.isInfinity()) + return this; + + // Z1 = 1 + if (this.z.eq(this.curve.one)) + return this; + + // X3 = X1 / Z1 + this.x = this.x.redDiv(this.z); + + // Z3 = 1 + this.z = this.curve.one; + + return this; + } + + scale(a) { + assert(a instanceof BN); + + // P = O + if (this.isInfinity()) + return this.curve.xpoint(); + + // X3 = X1 * A + const nx = this.x.redMul(a); + + // Y3 = Y1 * A + const nz = this.z.redMul(a); + + return this.curve.xpoint(nx, nz); + } + + neg() { + // -(X1, Z1) = (X1, Z1) + return this; + } + + dbl() { + // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 + // 2M + 2S + 4A + 1*a24 + + // A = X1 + Z1 + const a = this.x.redAdd(this.z); + + // AA = A^2 + const aa = a.redSqr(); + + // B = X1 - Z1 + const b = this.x.redSub(this.z); + + // BB = B^2 + const bb = b.redSqr(); + + // C = AA - BB + const c = aa.redSub(bb); + + // X3 = AA * BB + const nx = aa.redMul(bb); + + // Z3 = C * (BB + a24 * C) + const nz = c.redMul(bb.redIAdd(this.curve.a24.redMul(c))); + + return this.curve.xpoint(nx, nz); + } + + diffAddDbl(p2, p3) { + // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#ladder-ladd-1987-m-3 + // 6M + 4S + 8A + 1*a24 + assert(p2 instanceof XPoint); + assert(p3 instanceof XPoint); + + // A = X2 + Z2 + const a = p2.x.redAdd(p2.z); + + // AA = A^2 + const aa = a.redSqr(); + + // B = X2 - Z2 + const b = p2.x.redSub(p2.z); + + // BB = B^2 + const bb = b.redSqr(); + + // E = AA - BB + const e = aa.redSub(bb); + + // C = X3 + Z3 + const c = p3.x.redAdd(p3.z); + + // D = X3 - Z3 + const d = p3.x.redSub(p3.z); + + // DA = D * A + const da = d.redMul(a); + + // CB = C * B + const cb = c.redMul(b); + + // X5 = Z1 * (DA + CB)^2 + const x5 = this.z.redMul(da.redAdd(cb).redSqr()); + + // Z5 = X1 * (DA - CB)^2 + const z5 = this.x.redMul(da.redISub(cb).redSqr()); + + // X4 = AA * BB + const x4 = aa.redMul(bb); + + // Z4 = E * (BB + a24 * E) + const z4 = e.redMul(bb.redIAdd(this.curve.a24.redMul(e))); + + return [ + this.curve.xpoint(x4, z4), + this.curve.xpoint(x5, z5) + ]; + } + + getX() { + if (this.isInfinity()) + throw new Error('Invalid point.'); + + this.normalize(); + + return this.x.fromRed(); + } + + getY(sign) { + return this.toP(sign).getY(); + } + + eq(p) { + assert(p instanceof XPoint); + + // P = Q + if (this === p) + return true; + + // P = O + if (this.isInfinity()) + return p.isInfinity(); + + // Q = O + if (p.isInfinity()) + return false; + + // Z1 = Z2 + if (this.z.eq(p.z)) + return this.x.eq(p.x); + + // X1 * Z2 = X2 * Z1 + const x1 = this.x.redMul(p.z); + const x2 = p.x.redMul(this.z); + + return x1.eq(x2); + } + + cmp(point) { + assert(point instanceof XPoint); + + const inf1 = this.isInfinity(); + const inf2 = point.isInfinity(); + + if (inf1 && !inf2) + return -1; + + if (!inf1 && inf2) + return 1; + + if (inf1 && inf2) + return 0; + + return this.order().cmp(point.order()) + || this.getX().cmp(point.getX()); + } + + isInfinity() { + // Z1 = 0 + return this.z.isZero(); + } + + isOrder2() { + if (this.isInfinity()) + return false; + + return this.x.isZero(); + } + + isOdd() { + return false; + } + + isEven() { + return false; + } + + hasTorsion() { + if (this.isInfinity()) + return false; + + // X1 = 0, Z1 != 0 (edge case) + if (this.x.isZero()) + return true; + + return super.hasTorsion(); + } + + order() { + try { + return this.toP().order(); + } catch (e) { + return new BN(1); + } + } + + jmul(k) { + // Multiply with the Montgomery Ladder. + // + // [MONT3] Algorithm 4, Page 12, Section 4.2. + // + // Note that any clamping is meant to + // be done _outside_ of this function. + assert(k instanceof BN); + assert(!k.red); + + const bits = k.bitLength(); + + let a = this.curve.xpoint(); + let b = this; + + for (let i = bits - 1; i >= 0; i--) { + const bit = k.bit(i); + + if (bit === 0) + [a, b] = this.diffAddDbl(a, b); + else + [b, a] = this.diffAddDbl(b, a); + } + + return a; + } + + jmulBlind(k, rng) { + if (!rng) + return this.jmul(k); + + // Randomize if available. + return this.randomize(rng).jmul(k); + } + + jmulAdd(k1, p2, k2) { + throw new Error('Not implemented.'); + } + + toP(sign = null) { + assert(sign == null || typeof sign === 'boolean'); + + if (this.isInfinity()) + return this.curve.point(); + + this.normalize(); + + return this.curve.pointFromX(this.x, sign); + } + + toJ() { + return this; + } + + toX() { + return this; + } + + key() { + if (this.isInfinity()) + return `${this.curve.uid}:oo`; + + this.normalize(); + + const x = this.getX().toString(16); + + return `${this.curve.uid}:${x}`; + } + + encode() { + // [RFC7748] Section 5. + return this.curve.encodeField(this.getX()); + } + + static decode(curve, bytes) { + assert(curve instanceof MontCurve); + + // [RFC7748] Section 5. + const x = curve.decodeField(bytes); + + // We're supposed to ignore the hi bit + // on montgomery points... I think. If + // we don't, the X25519 test vectors + // break, which is pretty convincing + // evidence. This is a no-op for X448. + x.iumaskn(curve.fieldBits); + + // Note: montgomery points are meant to be + // reduced by the prime and do not have to + // be explicitly validated in order to do + // the montgomery ladder. + const p = curve.xpoint(x, curve.one); + + assert(!p.isInfinity()); + + return p; + } + + toJSON(pre) { + return this.toP().toJSON(pre); + } + + toPretty() { + return this.toP().toPretty(); + } + + static fromJSON(curve, json) { + return MontPoint.fromJSON(curve, json).toX(); + } + + [custom]() { + if (this.isInfinity()) + return ''; + + return ''; + } + } + + /** + * EdwardsCurve + */ + + class EdwardsCurve extends Curve { + constructor(conf) { + super(EdwardsPoint, 'edwards', conf); + + this.a = BN.fromJSON(conf.a).toRed(this.red); + this.d = BN.fromJSON(conf.d).toRed(this.red); + this.s = BN.fromJSON(conf.s || '0').toRed(this.red); + this.si = this.s.isZero() ? this.zero : this.s.redInvert(); + + this.k = this.d.redMuln(2); + this.smi = -this.d.redNeg().word(0); + this.ad6 = this.a.redAdd(this.d).redMul(this.i6); + + this.twisted = !this.a.eq(this.one); + this.oneA = this.a.eq(this.one); + this.mOneA = this.a.eq(this.one.redNeg()); + this.smallD = this.prime != null && this.d.redNeg().length === 1; + this.alt = null; + + this._finalize(conf); + } + + static _isomorphism(curveA, curveD, customA) { + // Twisted Edwards Isomorphism. + // + // [TWISTED] Definition 2.1, Page 3, Section 2. + // + // Transformation: + // + // a' = a' + // d' = a' * d / a + // + // Where (a / a') is square. + assert(curveA instanceof BN); + assert(curveD instanceof BN); + assert(customA instanceof BN); + + const a = customA.clone(); + const d = customA.redMul(curveD).redDiv(curveA); + const c = curveA.redDiv(customA); + + if (c.redJacobi() !== 1) + throw new Error('Invalid `a` coefficient.'); + + return [a, d]; + } + + _short(a0, odd) { + // Twisted Edwards->Short Weierstrass Equivalence. + // + // [TWISTEQ] Section 2. + // + // Transformation: + // + // a' = -(a^2 + 14 * a * d + d^2) / 48 + // b' = (33 * (a^2 * d + a * d^2) - a^3 - d^3) / 864 + const {a, d} = this; + const a2 = a.redSqr(); + const a3 = a2.redMul(a); + const d2 = d.redSqr(); + const d3 = d2.redMul(d); + const ad14 = a.redMul(d).redIMuln(14); + const a2d = a2.redMul(d); + const ad2 = a.redMul(d2); + const t0 = a2d.redIAdd(ad2).redIMuln(33); + const wa = a2.redAdd(ad14).redIAdd(d2).redDivn(-48); + const wb = t0.redISub(a3).redISub(d3).redDivn(864); + + if (a0 != null) + return ShortCurve._isomorphism(wa, wb, a0, odd); + + return [wa, wb]; + } + + _mont(b0, invert = false) { + // Twisted Edwards->Montgomery Transformation. + // + // [TWISTED] Theorem 3.2, Page 4, Section 3. + // + // Equivalence: + // + // A = 2 * (a + d) / (a - d) + // B = 4 / (a - d) + // + // Isomorphism: + // + // A = 2 * (a + d) / (a - d) + // B = B' + // + // Where ((4 / (a - d)) / B') is square. + // + // If `4 / (a - d)` is non-square, we can + // usually force B=1 by using the `invert` + // option. This will create an isomorphism + // chain of: E(a,d)->E(d,a)->M(-A,-B). + // + // The equivalence between E(a,d) and E(d,a) + // is: + // + // (x, y) = (x, 1 / y) + // + // Meaning our map to M(-A,-B) is: + // + // u = (1 + 1 / y) / (1 - 1 / y) + // = (y + 1) / (y - 1) + // v = u / x + assert(typeof invert === 'boolean'); + + let apd, amd; + + if (invert) { + apd = this.d.redAdd(this.a); + amd = this.d.redSub(this.a); + } else { + apd = this.a.redAdd(this.d); + amd = this.a.redSub(this.d); + } + + const z = amd.redInvert(); + const a = apd.redMuln(2).redMul(z); + const b = z.redMuln(4); + + if (b0 != null) + return MontCurve._isomorphism(a, b, b0); + + return [a, b]; + } + + _edwards(a0) { + return EdwardsCurve._isomorphism(this.a, this.d, a0); + } + + _scaleShort(curve) { + assert(curve instanceof ShortCurve); + + const [u2, u3] = curve._scale(this); + + return [this.field(u2.redInvert()), + this.field(u3.redInvert())]; + } + + _scaleMont(curve, invert = false) { + // Calculate isomorphism factor between + // Twisted Edwards and Montgomery with: + // + // a = (A + 2) / B + // c = +-sqrt(a / a') + // + // Which can be reduced to: + // + // c = +-sqrt((A + 2) / (B * a')) + // + // If base points are available, we can do: + // + // x = u / v + // c = x' / x + // + // Which can be reduced to: + // + // c = v * x' / u + // + // We can now calculate the Edwards `x` with: + // + // x' = c * u / v + // + // And likewise, the Montgomery `v`: + // + // v = c * u / x' + assert(curve instanceof MontCurve); + assert(typeof invert === 'boolean'); + + if (this.g.isInfinity() || curve.g.isInfinity()) { + const [a] = curve._edwards(null, invert); + + return this.field(a).redDivSqrt(this.a); + } + + const x = curve.g.x.redDiv(curve.g.y); + + return this.g.x.redDiv(this.field(x)); + } + + _scaleEdwards(curve) { + // We can extract the isomorphism factor with: + // + // c = +-sqrt(a / a') + // + // If base points are available, we can do: + // + // c = x' / x + assert(curve instanceof EdwardsCurve); + + if (this.g.isInfinity() || curve.g.isInfinity()) + return this.field(curve.a).redDivSqrt(this.a); + + return this.g.x.redDiv(this.field(curve.g.x)); + } + + _mulA(num) { + assert(num instanceof BN); + + // n * a = n + if (this.oneA) + return num.clone(); + + // n * a = -n + if (this.mOneA) + return num.redNeg(); + + return this.a.redMul(num); + } + + _mulD(num) { + assert(num instanceof BN); + + // -d < 0x4000000 + if (this.smallD) + return num.redMuln(this.smi); + + return this.d.redMul(num); + } + + _elligator1(t) { + // Elligator 1. + // + // Distribution: 1/2. + // + // [ELL1] Page 6, Section 3. + // Page 15, Appendix A. + // [ELL2] Page 7, Section 3.2. + // + // Assumptions: + // + // - Let p be a prime power congruent to 3 mod 4. + // - Let s be a nonzero element of F(p). + // - Let c = 2 / s^2. + // - Let r = c + 1 / c. + // - Let d = -(c + 1)^2 / (c - 1)^2. + // - (s^2 - 2) * (s^2 + 2) != 0. + // - c * (c - 1) * (c + 1) != 0. + // - r != 0. + // - d is not square. + // - x^2 + y^2 = 1 + d * x^2 * y^2. + // - u * v * X * Y * x * (Y + 1) != 0. + // - Y^2 = X^5 + (r^2 - 2) * X^3 + X. + // + // Elligator 1, as devised by Fouque et al, + // takes place on the hyperelliptic curve of: + // + // y^2 = x^5 + (r^2 - 2) * x^3 + x + // + // Not only must our Edwards curve be complete, + // with a prime congruent to 3 mod 4, and a = 1, + // our curve must be isomorphic to a hyperelliptic + // curve of the above form. Roughly one half of + // all Edwards curves are isomorphic to a curve + // of said form. + // + // We can derive the isomorphism with: + // + // c = (d +- 2 * sqrt(-d) - 1) / (d + 1) + // s = +-sqrt(2 / c) + // r = c + 1 / c + // + // Note that even if your curve is an Elligator 1 + // curve, Elligator 2 is probably still preferable, + // as it has nearly the same properties (i.e. the + // same distribution), and is much less complex. + // + // Map: + // + // f(a) = a^((p - 1) / 2) + // u = (1 - t) / (1 + t) + // v = u^5 + (r^2 - 2) * u^3 + u + // X = f(v) * u + // Y = (f(v) * v)^((p + 1) / 4) * f(v) * f(u^2 + 1 / c^2) + // Y = 1, if u = 0 + // x = (c - 1) * s * X * (1 + X) / Y + // y = (r * X - (1 + X)^2) / (r * X + (1 + X)^2) + // + // When t = +-1, we create the hyperelliptic + // 2-torsion point of (0, 0). This needs to be + // mapped to (0, -1) in Edwards form, but the x + // denominator becomes zero. As far as I can + // tell, this is the only exceptional case. + // + // The only other exceptional case initially + // appears to be when the y denominator sums to + // zero (when t = sqrt(4 / r + 1)), however, the + // hyperelliptic `X` is negated by the sign of + // `v`, making this impossible. + const {s, si, i2, one, two} = this; + const c = si.redSqr().redIMuln(2); + const ci = s.redSqr().redMul(i2); + const ci2 = ci.redSqr(); + const r = c.redAdd(ci); + const r2 = r.redSqr().redISub(two); + const cm1 = c.redSub(one); + const uu = one.redSub(t); + const uz = one.redAdd(t); + const u = uz.isZero() ? uz : uu.redDiv(uz); + const u2 = u.redSqr(); + const u3 = u2.redMul(u); + const u5 = u3.redMul(u2); + const v = u5.redAdd(r2.redMul(u3)).redIAdd(u); + const f0 = this.field(v.redJacobi()); + const f1 = this.field(u2.redAdd(ci2).redJacobi()); + const f2 = f0.redMul(f1); + const X = f0.redMul(u); + const Y = f0.redMul(v).redSqrt().redMul(f2); + const X1 = one.redAdd(X); + const rX = r.redMul(X); + const X12 = X1.redSqr(); + const xx = cm1.redMul(s).redMul(X).redMul(X1); + const xz = u.isZero() ? this.one : Y; + const yy = rX.redSub(X12); + const yz = rX.redAdd(X12); + + return this.cpoint(xx, xz, yy, yz); + } + + _invert1(p, hint) { + // Inverting the Map (Elligator 1). + // + // [ELL1] Page 6, Section 3. + // Page 15, Appendix A. + // [ELL2] Page 7, Section 3.3. + // + // Assumptions: + // + // - y + 1 != 0. + // - (1 + n * r)^2 - 1 is square in F(p). + // - If n * r = -2 then x = 2 * s * (c - 1) * f(c) / r. + // - Y = (c - 1) * s * X * (1 + X) / x. + // + // Map: + // + // f(a) = a^((p - 1) / 2) + // n = (y - 1) / (2 * (y + 1)) + // X = -(1 + n * r) + ((1 + n * r)^2 - 1)^((p + 1) / 4) + // z = f((c - 1) * s * X * (1 + X) * x * (X^2 + 1 / c^2)) + // u = z * X + // t = (1 - u) / (1 + u) + const {s, si, i2, one} = this; + const {x, y, z} = p; + const sign = hint & 1; + const c = si.redSqr().redIMuln(2); + const ci = s.redSqr().redMul(i2); + const ci2 = ci.redSqr(); + const r = c.redAdd(ci); + const cm1 = c.redSub(one); + const nn = y.redSub(z); + const nz = y.redAdd(z).redIMuln(2); + const n = nz.isZero() ? nz : nn.redDiv(nz); + const nr1 = one.redAdd(n.redMul(r)); + const w2 = nr1.redSqr().redISub(one); + const w = w2.redSqrt(); + const X = w.redSub(nr1); + const X1 = one.redAdd(X); + const YY = cm1.redMul(s).redMul(X).redMul(X1); + const Y = YY.redMul(x.redMul(z)); + const X2 = X.redSqr().redIAdd(ci2); + const Z = this.field(Y.redMul(X2).redJacobi()); + const u = Z.redMul(X); + const tt = one.redSub(u); + const tz = one.redAdd(u); + const t = tz.isZero() ? tz : tt.redDiv(tz); + + if (t.redIsOdd() !== Boolean(sign)) + t.redINeg(); + + return t; + } + + _alt() { + if (!this.alt) + this.alt = this.toMont(); + + return this.alt; + } + + isElliptic() { + const ad = this.a.redMul(this.d); + const amd = this.a.redSub(this.d); + + // a * d * (a - d) != 0 + return !ad.redMul(amd).isZero(); + } + + jinv() { + // [TWISTED] Definition 2.1, Page 3, Section 2. + const {a, d} = this; + const ad = a.redMul(d); + const amd4 = a.redSub(d).redPown(4); + const a2 = a.redSqr(); + const d2 = d.redSqr(); + const t0 = a2.redAdd(ad.redMuln(14)).redIAdd(d2); + const lhs = t0.redPown(3).redIMuln(16); + const rhs = ad.redMul(amd4); + + if (rhs.isZero()) + throw new Error('Curve is not elliptic.'); + + // 16 * (a^2 + 14 * a * d + d^2)^3 / (a * d * (a - d)^4) + return lhs.redDiv(rhs).fromRed(); + } + + isComplete() { + return this.a.redJacobi() === 1 + && this.d.redJacobi() === -1; + } + + point(x, y, z, t) { + return new EdwardsPoint(this, x, y, z, t); + } + + jpoint(x, y, z) { + assert(x == null && y == null && z == null); + return this.point(); + } + + cpoint(xx, xz, yy, yz) { + assert(xx instanceof BN); + assert(xz instanceof BN); + assert(yy instanceof BN); + assert(yz instanceof BN); + + const x = xx.redMul(yz); + const y = yy.redMul(xz); + const z = xz.redMul(yz); + const t = xx.redMul(yy); + + return this.point(x, y, z, t); + } + + solveX2(y) { + // [RFC8032] Section 5.1.3 & 5.2.3. + assert(y instanceof BN); + + // x^2 = (y^2 - 1) / (d * y^2 - a) + const y2 = y.redSqr(); + const rhs = this._mulD(y2).redISub(this.a); + const lhs = y2.redISub(this.one); + const x2 = lhs.redDiv(rhs); + + return x2; + } + + solveX(y) { + // Optimize with inverse square root trick. + // + // Note that `0 / 0` can only occur if + // `a == d` (i.e. the curve is singular). + const y2 = y.redSqr(); + const rhs = this._mulD(y2).redISub(this.a); + const lhs = y2.redISub(this.one); + + return lhs.redDivSqrt(rhs); + } + + solveY2(x) { + assert(x instanceof BN); + + // y^2 = (a * x^2 - 1) / (d * x^2 - 1) + const x2 = x.redSqr(); + const lhs = this._mulA(x2).redISub(this.one); + const rhs = this._mulD(x2).redISub(this.one); + const y2 = lhs.redDiv(rhs); + + return y2; + } + + solveY(x) { + // Optimize with inverse square root trick. + // + // Note that `0 / 0` can only occur if + // `a == d` (i.e. the curve is singular). + const x2 = x.redSqr(); + const lhs = this._mulA(x2).redISub(this.one); + const rhs = this._mulD(x2).redISub(this.one); + + return lhs.redDivSqrt(rhs); + } + + validate(point) { + // [TWISTED] Definition 2.1, Page 3, Section 2. + // Page 11, Section 6. + assert(point instanceof EdwardsPoint); + + // Z1 = 1 + if (point.zOne) { + // a * x^2 + y^2 = 1 + d * x^2 * y^2 + const x2 = point.x.redSqr(); + const y2 = point.y.redSqr(); + const dxy = this._mulD(x2).redMul(y2); + const lhs = this._mulA(x2).redIAdd(y2); + const rhs = this.one.redAdd(dxy); + const tz = point.t; + const xy = point.x.redMul(point.y); + + return lhs.eq(rhs) && tz.eq(xy); + } + + // (a * x^2 + y^2) * z^2 = z^4 + d * x^2 * y^2 + const x2 = point.x.redSqr(); + const y2 = point.y.redSqr(); + const z2 = point.z.redSqr(); + const z4 = z2.redSqr(); + const dxy = this._mulD(x2).redMul(y2); + const lhs = this._mulA(x2).redIAdd(y2).redMul(z2); + const rhs = z4.redIAdd(dxy); + const tz = point.t.redMul(point.z); + const xy = point.x.redMul(point.y); + + return lhs.eq(rhs) && tz.eq(xy); + } + + pointFromX(x, sign = null) { + assert(x instanceof BN); + assert(sign == null || typeof sign === 'boolean'); + + if (!x.red) + x = x.toRed(this.red); + + const y = this.solveY(x); + + if (sign != null) { + if (y.isZero() && sign) + throw new Error('Invalid point.'); + + if (y.redIsOdd() !== sign) + y.redINeg(); + } + + return this.point(x, y); + } + + pointFromY(y, sign = null) { + assert(y instanceof BN); + assert(sign == null || typeof sign === 'boolean'); + + if (!y.red) + y = y.toRed(this.red); + + const x = this.solveX(y); + + if (sign != null) { + if (x.isZero() && sign) + throw new Error('Invalid point.'); + + if (x.redIsOdd() !== sign) + x.redINeg(); + } + + return this.point(x, y); + } + + isIsomorphic(curve, invert = false) { + // [TWISTED] Theorem 3.2, Page 4, Section 3. + // Definition 2.1, Page 3, Section 2. + assert(curve instanceof Curve); + assert(typeof invert === 'boolean'); + + if (!curve.p.eq(this.p)) + return false; + + // E(a,d) <-> E(a,b) + if (curve.type === 'short') + return curve.isIsomorphic(this); + + // E(a,d) <-> M(A,B) + // E(a,d) <-> M(-A,-B) + if (curve.type === 'mont') { + // A * (a - d) = 2 * (a + d) + const a = this.field(curve.a); + + let apd, amd; + + if (invert) { + apd = this.d.redAdd(this.a); + amd = this.d.redSub(this.a); + } else { + apd = this.a.redAdd(this.d); + amd = this.a.redSub(this.d); + } + + return a.redMul(amd).eq(apd.redIMuln(2)); + } + + // E(a,d) <-> E(a',a'd/a) + if (curve.type === 'edwards') { + // a' * d = a * d' + const a = this.field(curve.a); + const d = this.field(curve.d); + + return this.a.redMul(d).eq(a.redMul(this.d)); + } + + return false; + } + + isIsogenous(curve) { + // Check for the 4-isogenies described by Hamburg: + // https://moderncrypto.org/mail-archive/curves/2016/000806.html + assert(curve instanceof Curve); + + if (!curve.p.eq(this.p)) + return false; + + // E(1,d) <-> M(2-4d,1) + if (curve.type === 'mont') { + if (!this.a.eq(this.one)) + return false; + + const a = this.field(curve.a); + const b = this.field(curve.b); + const d24 = this.two.redSub(this.d.redMuln(4)); + + return a.eq(d24) && b.eq(this.one); + } + + // E(a,d) <-> E(-a,d-a) + if (curve.type === 'edwards') { + const a = this.field(curve.a); + const d = this.field(curve.d); + + return a.eq(this.a.redNeg()) + && d.eq(this.d.redSub(this.a)); + } + + return false; + } + + pointFromShort(point) { + // [TWISTEQ] Section 1. + assert(point instanceof ShortPoint); + + if (this.isIsomorphic(point.curve)) { + // Equivalence for E(a,b)->E(a',d'): + // + // x' = (6 * x - a' - d') / (6 * y) + // y' = (12 * x - 5 * a' + d') / (12 * x + a' - 5 * d') + // + // Undefined for x = (5 * d' - a') / 12 or y = 0. + // + // Exceptional Cases: + // - O -> (0, 1) + // - ((a' + d') / 6, 0) -> (0, -1) + // - ((5 * d' - a') / 12, (d' - a') / 4 * sqrt(d')) -> (sqrt(1/d'), oo) + // + // Unexceptional Cases: + // - ((5 * a' - d') / 12, (a' - d') / 4 * sqrt(a')) -> (sqrt(1/a'), 0) + if (point.isInfinity()) + return this.point(); + + if (point.y.isZero()) + return this.point(this.zero, this.one.redNeg()); + + const {a, d} = this; + const [u2, u3] = this._scale(point.curve); + const a5 = a.redMuln(5); + const d5 = d.redMuln(5); + const x = this.field(point.x).redMul(u2); + const y = this.field(point.y).redMul(u3); + const x6 = x.redMuln(6); + const x12 = x.redMuln(12); + const xx = x6.redSub(a).redISub(d); + const xz = y.redMuln(6); + const yy = x12.redSub(a5).redIAdd(d); + const yz = x12.redAdd(a).redISub(d5); + + return this.cpoint(xx, xz, yy, yz); + } + + throw new Error('Not implemented.'); + } + + pointFromMont(point) { + // [RFC7748] Section 4.1 & 4.2. + // [MONT3] Page 6, Section 2.5. + // [TWISTED] Theorem 3.2, Page 4, Section 3. + assert(point instanceof MontPoint); + assert(point.curve.p.eq(this.p)); + + // Montgomery `u`, `v`. + const u = this.field(point.x); + const v = this.field(point.y); + + if (this.isIsogenous(point.curve)) { + // 4-isogeny maps for M(2-4d,1)->E(1,d): + // + // x = 4 * v * (u^2 - 1) / (u^4 - 2 * u^2 + 4 * v^2 + 1) + // y = -(u^5 - 2 * u^3 - 4 * u * v^2 + u) / + // (u^5 - 2 * u^2 * v^2 - 2 * u^3 - 2 * v^2 + u) + // + // Undefined for u = 0 and v = 0. + // + // Exceptional Cases: + // - O -> (0, 1) + // - (0, 0) -> (0, 1) + // + // Unexceptional Cases: + // - (-1, +-sqrt(A - 2)) -> (0, 1) + // - (1, +-sqrt(A + 2)) -> (0, -1) + // + // The point (1, v) is invalid on Curve448. + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(); + + const u2 = u.redSqr(); + const u3 = u2.redMul(u); + const u4 = u3.redMul(u); + const u5 = u4.redMul(u); + const v2 = v.redSqr(); + const a = v.redMuln(4); + const b = u2.redSub(this.one); + const c = u2.redMuln(2); + const d = v2.redMuln(4); + const e = u3.redIMuln(2); + const f = u.redMul(v2).redIMuln(4); + const g = u2.redMul(v2).redIMuln(2); + const h = v2.redIMuln(2); + const xx = a.redMul(b); + const xz = u4.redISub(c).redIAdd(d).redIAdd(this.one); + const yy = u5.redSub(e).redISub(f).redIAdd(u).redINeg(); + const yz = u5.redISub(g).redISub(e).redISub(h).redIAdd(u); + + return this.cpoint(xx, xz, yy, yz).divn(4); + } + + if (this.isIsomorphic(point.curve, true)) { + // Isomorphic maps for M(-A,-B)->E(a,d): + // + // x = +-sqrt((A - 2) / (B * a)) * u / v + // y = (u + 1) / (u - 1) + // + // Undefined for u = 1 or v = 0. + // + // Exceptional Cases: + // - O -> (0, 1) + // - (0, 0) -> (0, -1) + // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / d), oo) + // + // Unexceptional Cases: + // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / a), 0) + // + // The point (1, v) is invalid on Curve448. + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.one.redNeg()); + + const c = this._scale(point.curve, true); + const xx = c.redMul(u); + const xz = v; + const yy = u.redAdd(this.one); + const yz = u.redSub(this.one); + + return this.cpoint(xx, xz, yy, yz); + } + + if (this.isIsomorphic(point.curve, false)) { + // Isomorphic maps for M(A,B)->E(a,d): + // + // x = +-sqrt((A + 2) / (B * a)) * u / v + // y = (u - 1) / (u + 1) + // + // Undefined for u = -1 or v = 0. + // + // Exceptional Cases: + // - O -> (0, 1) + // - (0, 0) -> (0, -1) + // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / d), oo) + // + // Unexceptional Cases: + // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / a), 0) + // + // The point (-1, v) is invalid on Curve25519. + if (point.isInfinity()) + return this.point(); + + if (point.x.isZero()) + return this.point(this.zero, this.one.redNeg()); + + const c = this._scale(point.curve, false); + const xx = c.redMul(u); + const xz = v; + const yy = u.redSub(this.one); + const yz = u.redAdd(this.one); + + return this.cpoint(xx, xz, yy, yz); + } + + throw new Error('Not implemented.'); + } + + pointFromEdwards(point) { + // [TWISTED] Definition 2.1, Page 3, Section 2. + // [ISOGENY] Page 2, Section 2. + assert(point instanceof EdwardsPoint); + assert(point.curve.p.eq(this.p)); + + // Edwards `x`, `y`, `z`, `t`. + const a = this.field(point.curve.a); + const x = this.field(point.x); + const y = this.field(point.y); + const z = this.field(point.z); + const t = this.field(point.t); + + if (this.isIsogenous(point.curve)) { + // 4-isogeny maps for E(a,d)<->E(-a,d-a): + // + // x' = (2 * x * y) / (y^2 - a * x^2) + // y' = (y^2 + a * x^2) / (2 - y^2 - a * x^2) + // + // Undefined for y^2 - a * x^2 = 0 + // or y^2 + a * x^2 = 2. + const xy = x.redMul(y); + const x2 = x.redSqr(); + const y2 = y.redSqr(); + const z2 = z.redSqr(); + const ax2 = a.redMul(x2); + const xx = xy.redIMuln(2); + const xz = y2.redSub(ax2); + const yy = y2.redAdd(ax2); + const yz = z2.redIMuln(2).redISub(yy); + const p = this.cpoint(xx, xz, yy, yz); + + return !this.twisted ? p.divn(4) : p; + } + + if (this.isIsomorphic(point.curve)) { + // Isomorphic maps for E(a,d)<->E(a',a'd/a): + // + // x' = +-sqrt(a / a') * x + // y' = y + // + // Undefined when (a / a') is not square. + const c = this._scale(point.curve); + const nx = c.redMul(x); + const ny = y; + const nz = z; + const nt = c.redMul(t); + + return this.point(nx, ny, nz, nt); + } + + throw new Error('Not implemented.'); + } + + pointFromUniform(u, curve = null) { + assert(u instanceof BN); + assert(u.red === this.red); + assert(curve == null || (curve instanceof MontCurve)); + + if (!curve) + curve = this._alt(); + + const u0 = curve.field(u); + const p0 = curve.pointFromUniform(u0); + + return this.pointFromMont(p0); + } + + pointToUniform(p, hint, curve = null) { + // Convert an edwards point to a field + // element by inverting the elligator2 map. + // + // Hint Layout: + // + // [00000000] [0000] [0000] + // | | | + // | | +-- preimage index + // | +--- subgroup + // +-- bits to OR with uniform bytes + assert(p instanceof EdwardsPoint); + assert((hint >>> 0) === hint); + assert(curve == null || (curve instanceof MontCurve)); + + if (!curve) + curve = this._alt(); + + // Add a random torsion component. + const i = ((hint >> 4) & 15) % this.torsion.length; + const q = p.add(this.torsion[i]); + + // Convert and invert. + const p0 = curve.pointFromEdwards(q); + const u0 = curve.pointToUniform(p0, hint & 15); + + return this.field(u0); + } + + pointFromHash(bytes, pake, curve = null) { + assert(curve == null || (curve instanceof MontCurve)); + + if (!curve) + curve = this._alt(); + + const p0 = curve.pointFromHash(bytes, pake); + + return this.pointFromMont(p0); + } + + pointToHash(p, subgroup, rng, curve = null) { + assert(p instanceof EdwardsPoint); + assert((subgroup >>> 0) === subgroup); + assert(curve == null || (curve instanceof MontCurve)); + + if (!curve) + curve = this._alt(); + + // Add a random torsion component. + const i = subgroup % this.torsion.length; + const q = p.add(this.torsion[i]); + + // Convert and invert. + const p0 = curve.pointFromEdwards(q); + + return curve.pointToHash(p0, 0, rng); + } + + decodePoint(bytes) { + return EdwardsPoint.decode(this, bytes); + } + + toShort(a0, odd, sign = null) { + const [a, b] = this._short(a0, odd); + + const curve = new ShortCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h + }); + + if (sign != null) { + const [, u3] = curve._scale(this); + + if (u3.redIsOdd() !== sign) + u3.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromEdwards(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); + + return curve; + } + + toMont(b0, invert, sign = null) { + const [a, b] = this._mont(b0, invert); + + const curve = new MontCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + b: b, + n: this.n, + h: this.h, + z: this.z + }); + + if (sign != null) { + const c = this._scale(curve, invert); + + if (c.redIsOdd() !== sign) + c.redINeg(); + } + + if (!this.g.isInfinity()) + curve.g = curve.pointFromEdwards(this.g); + + for (let i = 0; i < this.h.word(0); i++) + curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); + + return curve; + } + + toEdwards(a0, sign = null) { + const [a, d] = this._edwards(a0); + + const curve = new EdwardsCurve({ + red: this.red, + prime: this.prime, + p: this.p, + a: a, + d: d, + n: this.n, + h: this.h, + z: this.z + }); + + if (sign != null) { + const c = curve._scale(this); + + if (c.redIsOdd() !== sign) + c.redINeg(); + } + + if (!this.g.isInfinity()) { + curve.g = curve.pointFromEdwards(this.g); + curve.g.normalize(); + } + + if (curve.isComplete()) { + for (let i = 0; i < this.h.word(0); i++) { + curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); + curve.torsion[i].normalize(); + } + } + + return curve; + } + + pointFromJSON(json) { + return EdwardsPoint.fromJSON(this, json); + } + + toJSON(pre) { + const json = super.toJSON(pre); + + json.a = this.a.fromRed().toJSON(); + json.d = this.d.fromRed().toJSON(); + + if (!this.s.isZero()) + json.s = this.s.fromRed().toJSON(); + + return json; + } + } + + /** + * EdwardsPoint + */ + + class EdwardsPoint extends Point { + constructor(curve, x, y, z, t) { + assert(curve instanceof EdwardsCurve); + + super(curve, types.EXTENDED); + + this.x = this.curve.zero; + this.y = this.curve.one; + this.z = this.curve.one; + this.t = this.curve.zero; + this.zOne = true; + + if (x != null) + this._init(x, y, z, t); + } + + _init(x, y, z, t) { + assert(x instanceof BN); + assert(y instanceof BN); + assert(z == null || (z instanceof BN)); + assert(t == null || (t instanceof BN)); + + this.x = x; + this.y = y; + this.z = z || this.curve.one; + this.t = t || null; + + if (!this.x.red) + this.x = this.x.toRed(this.curve.red); + + if (!this.y.red) + this.y = this.y.toRed(this.curve.red); + + if (!this.z.red) + this.z = this.z.toRed(this.curve.red); + + if (this.t && !this.t.red) + this.t = this.t.toRed(this.curve.red); + + this.zOne = this.z.eq(this.curve.one); + + this._check(); + + if (!this.t) { + this.t = this.x.redMul(this.y); + if (!this.zOne) + this.t = this.t.redDiv(this.z); + } + } + + _check() { + // In order to achieve complete + // addition formulas, `a` must + // be a square (always the case + // for a=1), and `d` must be a + // non-square. + // + // If this is not the case, the + // addition formulas may have + // exceptional cases where Z3=0. + // + // In particular, this can occur + // when: Q*h = -P*h and Q != -P. + // + // This is assuming 4-torsion is + // involved (the 4-torsion point + // is _not_ representable when + // `d` is square). + if (this.z.isZero()) + throw new Error('Invalid point.'); + } + + clone() { + return this.curve.point(this.x, this.y, this.z, this.t); + } + + normalize() { + // https://hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#scaling-z + // 1I + 2M (+ 1M if extended) + + // Z1 = 1 + if (this.zOne) + return this; + + // A = 1 / Z1 + const a = this.z.redInvert(); + + // X3 = X1 * A + this.x = this.x.redMul(a); + + // Y3 = Y1 * A + this.y = this.y.redMul(a); + + // T3 = T1 * A + this.t = this.t.redMul(a); + + // Z3 = 1 + this.z = this.curve.one; + this.zOne = true; + + return this; + } + + scale(a) { + assert(a instanceof BN); + + // X3 = X1 * A + const nx = this.x.redMul(a); + + // Y3 = Y1 * A + const ny = this.y.redMul(a); + + // Z3 = Z1 * A + const nz = this.z.redMul(a); + + // T3 = T1 * A + const nt = this.t.redMul(a); + + return this.curve.point(nx, ny, nz, nt); + } + + neg() { + // -(X1, Y1, Z1, T1) = (-X1, Y1, Z1, -T1) + const nx = this.x.redNeg(); + const ny = this.y; + const nz = this.z; + const nt = this.t.redNeg(); + + return this.curve.point(nx, ny, nz, nt); + } + + add(p) { + assert(p instanceof EdwardsPoint); + + // P = O + if (this.isInfinity()) + return p; + + // Q = O + if (p.isInfinity()) + return this; + + // Z1 = 1 + if (this.zOne) + return p._add(this); + + return this._add(p); + } + + _add(p) { + // a = -1 + if (this.curve.mOneA) + return this._addM1(p); + + return this._addA(p); + } + + _addM1(p) { + // Assumes a = -1. + // + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-3 + // 8M + 8A + 1*k + 1*2 + // + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-madd-2008-hwcd-3 + // 7M + 8A + 1*k + 1*2 + + // A = (Y1 - X1) * (Y2 - X2) + const a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); + + // B = (Y1 + X1) * (Y2 + X2) + const b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); + + // C = T1 * k * T2 + const c = this.t.redMul(this.curve.k).redMul(p.t); + + // D = Z1 * 2 * Z2 + const d = p.zOne ? this.z.redAdd(this.z) : this.z.redMul(p.z).redIMuln(2); + + // E = B - A + const e = b.redSub(a); + + // F = D - C + const f = d.redSub(c); + + // G = D + C + const g = d.redIAdd(c); + + // H = B + A + const h = b.redIAdd(a); + + // X3 = E * F + const nx = e.redMul(f); + + // Y3 = G * H + const ny = g.redMul(h); + + // T3 = E * H + const nt = e.redMul(h); + + // Z3 = F * G + const nz = f.redMul(g); + + return this.curve.point(nx, ny, nz, nt); + } + + _addA(p) { + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd + // 9M + 7A + 1*a + 1*d + // + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-madd-2008-hwcd + // 8M + 7A + 1*a + 1*d + + // A = X1 * X2 + const a = this.x.redMul(p.x); + + // B = Y1 * Y2 + const b = this.y.redMul(p.y); + + // C = T1 * d * T2 + const c = this.curve._mulD(this.t).redMul(p.t); + + // D = Z1 * Z2 + const d = p.zOne ? this.z.clone() : this.z.redMul(p.z); + + // + XYXY = (X1 + Y1) * (X2 + Y2) + const xyxy = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)); + + // E = (X1 + Y1) * (X2 + Y2) - A - B + const e = xyxy.redISub(a).redISub(b); + + // F = D - C + const f = d.redSub(c); + + // G = D + C + const g = d.redIAdd(c); + + // H = B - a * A + const h = b.redISub(this.curve._mulA(a)); + + // X3 = E * F + const nx = e.redMul(f); + + // Y3 = G * H + const ny = g.redMul(h); + + // T3 = E * H + const nt = e.redMul(h); + + // Z3 = F * G + const nz = f.redMul(g); + + return this.curve.point(nx, ny, nz, nt); + } + + dbl() { + // P = O + if (this.isInfinity()) + return this; + + return this._dbl(); + } + + _dbl() { + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd + // 4M + 4S + 6A + 1*a + 1*2 + // + // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-mdbl-2008-hwcd + // 3M + 4S + 7A + 1*a + 1*2 + + // A = X1^2 + const a = this.x.redSqr(); + + // B = Y1^2 + const b = this.y.redSqr(); + + // C = 2 * Z1^2 + const c = this.zOne ? this.curve.two : this.z.redSqr().redIMuln(2); + + // D = a * A + const d = this.curve._mulA(a); + + // E = (X1 + Y1)^2 - A - B + const e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); + + // G = D + B + const g = d.redAdd(b); + + // F = G - C + const f = g.redSub(c); + + // H = D - B + const h = d.redISub(b); + + // X3 = E * F + const nx = e.redMul(f); + + // Y3 = G * H + const ny = g.redMul(h); + + // T3 = E * H + const nt = e.redMul(h); + + // Z3 = F * G + const nz = f.redMul(g); + + return this.curve.point(nx, ny, nz, nt); + } + + getX() { + this.normalize(); + return this.x.fromRed(); + } + + getY() { + this.normalize(); + return this.y.fromRed(); + } + + eq(p) { + assert(p instanceof EdwardsPoint); + assert(!this.z.isZero()); + assert(!p.z.isZero()); + + // P = Q + if (this === p) + return true; + + // Z1 = Z2 + if (this.z.eq(p.z)) { + return this.x.eq(p.x) + && this.y.eq(p.y); + } + + // X1 * Z2 = X2 * Z1 + const x1 = this.x.redMul(p.z); + const x2 = p.x.redMul(this.z); + + if (!x1.eq(x2)) + return false; + + const y1 = this.y.redMul(p.z); + const y2 = p.y.redMul(this.z); + + return y1.eq(y2); + } + + cmp(point) { + assert(point instanceof EdwardsPoint); + + return this.order().cmp(point.order()) + || this.getY().cmp(point.getY()) + || this.getX().cmp(point.getX()); + } + + isInfinity() { + assert(!this.z.isZero()); + + // X1 = 0 + if (!this.x.isZero()) + return false; + + // Y1 = Z1 + return this.y.eq(this.z); + } + + isOrder2() { + if (this.isInfinity()) + return false; + + return this.x.isZero(); + } + + isOdd() { + this.normalize(); + return this.x.redIsOdd(); + } + + isEven() { + this.normalize(); + return this.x.redIsEven(); + } + + toP() { + return this.normalize(); + } + + toJ() { + return this; + } + + encode() { + // [RFC8032] Section 5.1.2. + const y = this.getY(); + + // Note: `x` normalized from `getY()` call. + y.setn(this.curve.signBit, this.x.redIsOdd()); + + return this.curve.encodeAdjusted(y); + } + + static decode(curve, bytes) { + // [RFC8032] Section 5.1.3. + assert(curve instanceof EdwardsCurve); + + const y = curve.decodeAdjusted(bytes); + const sign = y.testn(curve.signBit) !== 0; + + y.setn(curve.signBit, 0); + + if (y.cmp(curve.p) >= 0) + throw new Error('Invalid point.'); + + return curve.pointFromY(y, sign); + } + + toJSON(pre) { + if (this.isInfinity()) + return []; + + const x = this.getX().toJSON(); + const y = this.getY().toJSON(); + + if (pre === true && this.pre) + return [x, y, this.pre.toJSON()]; + + return [x, y]; + } + + toPretty() { + const size = this.curve.fieldSize * 2; + const x = toPretty(this.getX(), size); + const y = toPretty(this.getY(), size); + + return [x, y]; + } + + static fromJSON(curve, json) { + assert(curve instanceof EdwardsCurve); + assert(Array.isArray(json)); + assert(json.length === 0 + || json.length === 2 + || json.length === 3); + + if (json.length === 0) + return curve.point(); + + const x = BN.fromJSON(json[0]); + const y = BN.fromJSON(json[1]); + const point = curve.point(x, y); + + if (json.length > 2 && json[2] != null) + point.pre = Precomp.fromJSON(point, json[2]); + + return point; + } + + [custom]() { + if (this.isInfinity()) + return ''; + + return ''; + } + } + + /** + * Precomp + */ + + class Precomp { + constructor() { + this.naf = null; + this.windows = null; + this.doubles = null; + this.blinding = null; + this.beta = null; + } + + map(func) { + assert(typeof func === 'function'); + + const out = new this.constructor(); + + if (this.naf) + out.naf = this.naf.map(func); + + if (this.doubles) + out.doubles = this.doubles.map(func); + + return out; + } + + toJSON() { + return { + naf: this.naf ? this.naf.toJSON() : null, + windows: this.windows ? this.windows.toJSON() : null, + doubles: this.doubles ? this.doubles.toJSON() : null, + blinding: this.blinding ? this.blinding.toJSON() : undefined + }; + } + + fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + + if (json.naf != null) + this.naf = NAF.fromJSON(point, json.naf); + + if (json.windows != null) + this.windows = Windows.fromJSON(point, json.windows); + + if (json.doubles != null) + this.doubles = Doubles.fromJSON(point, json.doubles); + + if (json.blinding != null) + this.blinding = Blinding.fromJSON(point, json.blinding); + + return this; + } + + static fromJSON(point, json) { + return new this().fromJSON(point, json); + } + } + + /** + * NAF + */ + + class NAF { + constructor(width, points) { + this.width = width; + this.points = points; + } + + map(func) { + assert(typeof func === 'function'); + + const {width} = this; + const points = []; + + for (const point of this.points) + points.push(func(point)); + + return new this.constructor(width, points); + } + + toJSON() { + return { + width: this.width, + points: this.points.slice(1).map((point) => { + return point.toJSON(); + }) + }; + } + + static fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + assert((json.width >>> 0) === json.width); + assert(Array.isArray(json.points)); + + const {curve} = point; + const {width} = json; + const points = [point]; + + for (const item of json.points) + points.push(curve.pointFromJSON(item)); + + return new this(width, points); + } + } + + /** + * Windows + */ + + class Windows { + constructor(width, bits, points) { + this.width = width; + this.bits = bits; + this.points = points; + } + + toJSON() { + return { + width: this.width, + bits: this.bits, + points: this.points.slice(1).map((point) => { + return point.toJSON(); + }) + }; + } + + static fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + assert((json.width >>> 0) === json.width); + assert((json.bits >>> 0) === json.bits); + assert(Array.isArray(json.points)); + + const {curve} = point; + const {width, bits} = json; + const points = [point]; + + for (const item of json.points) + points.push(curve.pointFromJSON(item)); + + return new this(width, bits, points); + } + } + + /** + * Doubles + */ + + class Doubles { + constructor(step, points) { + this.step = step; + this.points = points; + } + + map(func) { + assert(typeof func === 'function'); + + const {step} = this; + const points = []; + + for (const point of this.points) + points.push(func(point)); + + return new this.constructor(step, points); + } + + toJSON() { + return { + step: this.step, + points: this.points.slice(1).map((point) => { + return point.toJSON(); + }) + }; + } + + static fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + assert((json.step >>> 0) === json.step); + assert(Array.isArray(json.points)); + + const {curve} = point; + const {step} = json; + const points = [point]; + + for (const item of json.points) + points.push(curve.pointFromJSON(item)); + + return new this(step, points); + } + } + + /** + * Blinding + */ + + class Blinding { + constructor(blind, unblind) { + this.blind = blind; + this.unblind = unblind; + } + + toJSON() { + return { + blind: this.blind.toJSON(), + unblind: this.unblind.toJSON() + }; + } + + static fromJSON(point, json) { + assert(point instanceof Point); + assert(json && typeof json === 'object'); + + const {curve} = point; + const blind = BN.fromJSON(json.blind); + const unblind = curve.pointFromJSON(json.unblind); + + return new this(blind, unblind); + } + } + + /** + * Endo + */ + + class Endo { + constructor(beta, lambda, basis, pre) { + this.beta = beta; + this.lambda = lambda; + this.basis = basis; + this.pre = pre; + } + + toJSON() { + return { + beta: this.beta.fromRed().toJSON(), + lambda: this.lambda.toJSON(), + basis: [ + this.basis[0].toJSON(), + this.basis[1].toJSON() + ], + pre: [ + this.pre[0], + this.pre[1].toJSON(), + this.pre[2].toJSON() + ] + }; + } + + static fromJSON(curve, json) { + assert(curve instanceof Curve); + assert(json && typeof json === 'object'); + assert(Array.isArray(json.basis)); + assert(Array.isArray(json.pre)); + assert(json.basis.length === 2); + assert(json.pre.length === 3); + assert((json.pre[0] >>> 0) === json.pre[0]); + + const beta = BN.fromJSON(json.beta).toRed(curve.red); + const lambda = BN.fromJSON(json.lambda); + + const basis = [ + Vector.fromJSON(json.basis[0]), + Vector.fromJSON(json.basis[1]) + ]; + + const pre = [ + json.pre[0], + BN.fromJSON(json.pre[1]), + BN.fromJSON(json.pre[2]) + ]; + + return new this(beta, lambda, basis, pre); + } + } + + /** + * Vector + */ + + class Vector { + constructor(a, b) { + this.a = a; + this.b = b; + } + + toJSON() { + return { + a: this.a.toJSON(), + b: this.b.toJSON() + }; + } + + static fromJSON(json) { + assert(json && typeof json === 'object'); + + const a = BN.fromJSON(json.a); + const b = BN.fromJSON(json.b); + + return new this(a, b); + } + } + + /** + * P192 + * https://tinyurl.com/fips-186-2 (page 29) + * https://tinyurl.com/fips-186-3 (page 88) + */ + + class P192 extends ShortCurve { + constructor(pre) { + super({ + id: 'P192', + ossl: 'prime192v1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: 'p192', + // 2^192 - 2^64 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff fffffffe', + 'ffffffff ffffffff'], + // -3 mod p + a: ['ffffffff ffffffff ffffffff fffffffe', + 'ffffffff fffffffc'], + b: ['64210519 e59c80e7 0fa7e9ab 72243049', + 'feb8deec c146b9b1'], + n: ['ffffffff ffffffff ffffffff 99def836', + '146bc9b1 b4d22831'], + h: '1', + // Icart + z: '-5', + g: [ + ['188da80e b03090f6 7cbf20eb 43a18800', + 'f4ff0afd 82ff1012'], + ['07192b95 ffc8da78 631011ed 6b24cdd5', + '73f977a1 1e794811'], + pre + ] + }); + } + } + + /** + * P224 + * https://tinyurl.com/fips-186-2 (page 30) + * https://tinyurl.com/fips-186-3 (page 88) + */ + + class P224 extends ShortCurve { + constructor(pre) { + super({ + id: 'P224', + ossl: 'secp224r1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: 'p224', + // 2^224 - 2^96 + 1 (1 mod 16) + p: ['ffffffff ffffffff ffffffff ffffffff', + '00000000 00000000 00000001'], + // -3 mod p + a: ['ffffffff ffffffff ffffffff fffffffe', + 'ffffffff ffffffff fffffffe'], + b: ['b4050a85 0c04b3ab f5413256 5044b0b7', + 'd7bfd8ba 270b3943 2355ffb4'], + n: ['ffffffff ffffffff ffffffff ffff16a2', + 'e0b8f03e 13dd2945 5c5c2a3d'], + h: '1', + // SSWU + z: '1f', + g: [ + ['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3', + '56c21122 343280d6 115c1d21'], + ['bd376388 b5f723fb 4c22dfe6 cd4375a0', + '5a074764 44d58199 85007e34'], + pre + ] + }); + } + } + + /** + * P256 + * https://tinyurl.com/fips-186-2 (page 31) + * https://tinyurl.com/fips-186-3 (page 89) + */ + + class P256 extends ShortCurve { + constructor(pre) { + super({ + id: 'P256', + ossl: 'prime256v1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: null, + // 2^256 - 2^224 + 2^192 + 2^96 - 1 (= 3 mod 4) + p: ['ffffffff 00000001 00000000 00000000', + '00000000 ffffffff ffffffff ffffffff'], + // -3 mod p + a: ['ffffffff 00000001 00000000 00000000', + '00000000 ffffffff ffffffff fffffffc'], + b: ['5ac635d8 aa3a93e7 b3ebbd55 769886bc', + '651d06b0 cc53b0f6 3bce3c3e 27d2604b'], + n: ['ffffffff 00000000 ffffffff ffffffff', + 'bce6faad a7179e84 f3b9cac2 fc632551'], + h: '1', + // SSWU + z: '-a', + g: [ + ['6b17d1f2 e12c4247 f8bce6e5 63a440f2', + '77037d81 2deb33a0 f4a13945 d898c296'], + ['4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16', + '2bce3357 6b315ece cbb64068 37bf51f5'], + pre + ] + }); + } + } + + /** + * P384 + * https://tinyurl.com/fips-186-2 (page 32) + * https://tinyurl.com/fips-186-3 (page 89) + */ + + class P384 extends ShortCurve { + constructor(pre) { + super({ + id: 'P384', + ossl: 'secp384r1', + type: 'short', + endian: 'be', + hash: 'SHA384', + prime: null, + // 2^384 - 2^128 - 2^96 + 2^32 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff fffffffe', + 'ffffffff 00000000 00000000 ffffffff'], + // -3 mod p + a: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff fffffffe', + 'ffffffff 00000000 00000000 fffffffc'], + b: ['b3312fa7 e23ee7e4 988e056b e3f82d19', + '181d9c6e fe814112 0314088f 5013875a', + 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'], + n: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff c7634d81 f4372ddf', + '581a0db2 48b0a77a ecec196a ccc52973'], + h: '1', + // Icart + z: '-c', + g: [ + ['aa87ca22 be8b0537 8eb1c71e f320ad74', + '6e1d3b62 8ba79b98 59f741e0 82542a38', + '5502f25d bf55296c 3a545e38 72760ab7'], + ['3617de4a 96262c6f 5d9e98bf 9292dc29', + 'f8f41dbd 289a147c e9da3113 b5f0b8c0', + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'], + pre + ] + }); + } + } + + /** + * P521 + * https://tinyurl.com/fips-186-2 (page 33) + * https://tinyurl.com/fips-186-3 (page 90) + */ + + class P521 extends ShortCurve { + constructor(pre) { + super({ + id: 'P521', + ossl: 'secp521r1', + type: 'short', + endian: 'be', + hash: 'SHA512', + prime: 'p521', + // 2^521 - 1 (= 3 mod 4) + p: ['000001ff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff'], + // -3 mod p + a: ['000001ff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'fffffffc'], + b: ['00000051 953eb961 8e1c9a1f 929a21a0', + 'b68540ee a2da725b 99b315f3 b8b48991', + '8ef109e1 56193951 ec7e937b 1652c0bd', + '3bb1bf07 3573df88 3d2c34f1 ef451fd4', + '6b503f00'], + n: ['000001ff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'fffffffa 51868783 bf2f966b 7fcc0148', + 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e', + '91386409'], + h: '1', + // SSWU + z: '-4', + g: [ + ['000000c6 858e06b7 0404e9cd 9e3ecb66', + '2395b442 9c648139 053fb521 f828af60', + '6b4d3dba a14b5e77 efe75928 fe1dc127', + 'a2ffa8de 3348b3c1 856a429b f97e7e31', + 'c2e5bd66'], + ['00000118 39296a78 9a3bc004 5c8a5fb4', + '2c7d1bd9 98f54449 579b4468 17afbd17', + '273e662c 97ee7299 5ef42640 c550b901', + '3fad0761 353c7086 a272c240 88be9476', + '9fd16650'], + pre + ] + }); + } + } + + /** + * SECP256K1 + * https://www.secg.org/SEC2-Ver-1.0.pdf (page 15, section 2.7.1) + * https://www.secg.org/sec2-v2.pdf (page 9, section 2.4.1) + */ + + class SECP256K1 extends ShortCurve { + constructor(pre) { + super({ + id: 'SECP256K1', + ossl: 'secp256k1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: 'k256', + // 2^256 - 2^32 - 977 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe fffffc2f'], + a: '0', + b: '7', + n: ['ffffffff ffffffff ffffffff fffffffe', + 'baaedce6 af48a03b bfd25e8c d0364141'], + h: '1', + // SVDW + z: '1', + // sqrt(-3) + c: ['0a2d2ba9 3507f1df 233770c2 a797962c', + 'c61f6d15 da14ecd4 7d8d27ae 1cd5f852'], + g: [ + ['79be667e f9dcbbac 55a06295 ce870b07', + '029bfcdb 2dce28d9 59f2815b 16f81798'], + ['483ada77 26a3c465 5da4fbfc 0e1108a8', + 'fd17b448 a6855419 9c47d08f fb10d4b8'], + pre + ], + // Precomputed endomorphism. + endo: { + beta: ['7ae96a2b 657c0710 6e64479e ac3434e9', + '9cf04975 12f58995 c1396c28 719501ee'], + lambda: ['5363ad4c c05c30e0 a5261c02 8812645a', + '122e22ea 20816678 df02967c 1b23bd72'], + basis: [ + { + a: '3086d221a7d46bcde86c90e49284eb15', + b: '-e4437ed6010e88286f547fa90abfe4c3' + }, + { + a: '114ca50f7a8e2f3f657c1108d9d44cfd8', + b: '3086d221a7d46bcde86c90e49284eb15' + } + ], + pre: [ + 384, + ['3086d221 a7d46bcd e86c90e4 9284eb15', + '3daa8a14 71e8ca7f e893209a 45dbb031'], + ['-', + 'e4437ed6 010e8828 6f547fa9 0abfe4c4', + '221208ac 9df506c6 1571b4ae 8ac47f71'] + ] + } + }); + } + } + + /** + * BRAINPOOLP256 + * https://tools.ietf.org/html/rfc5639#section-3.4 + */ + + class BRAINPOOLP256 extends ShortCurve { + constructor(pre) { + super({ + id: 'BRAINPOOLP256', + ossl: 'brainpoolP256r1', + type: 'short', + endian: 'be', + hash: 'SHA256', + prime: null, + // (= 3 mod 4) + p: ['a9fb57db a1eea9bc 3e660a90 9d838d72', + '6e3bf623 d5262028 2013481d 1f6e5377'], + a: ['7d5a0975 fc2c3057 eef67530 417affe7', + 'fb8055c1 26dc5c6c e94a4b44 f330b5d9'], + b: ['26dc5c6c e94a4b44 f330b5d9 bbd77cbf', + '95841629 5cf7e1ce 6bccdc18 ff8c07b6'], + n: ['a9fb57db a1eea9bc 3e660a90 9d838d71', + '8c397aa3 b561a6f7 901e0e82 974856a7'], + h: '1', + // Icart + z: '-2', + g: [ + ['8bd2aeb9 cb7e57cb 2c4b482f fc81b7af', + 'b9de27e1 e3bd23c2 3a4453bd 9ace3262'], + ['547ef835 c3dac4fd 97f8461a 14611dc9', + 'c2774513 2ded8e54 5c1d54c7 2f046997'], + pre + ] + }); + } + } + + /** + * BRAINPOOLP384 + * https://tools.ietf.org/html/rfc5639#section-3.6 + */ + + class BRAINPOOLP384 extends ShortCurve { + constructor(pre) { + super({ + id: 'BRAINPOOLP384', + ossl: 'brainpoolP384r1', + type: 'short', + endian: 'be', + hash: 'SHA384', + prime: null, + // (= 3 mod 4) + p: ['8cb91e82 a3386d28 0f5d6f7e 50e641df', + '152f7109 ed5456b4 12b1da19 7fb71123', + 'acd3a729 901d1a71 87470013 3107ec53'], + a: ['7bc382c6 3d8c150c 3c72080a ce05afa0', + 'c2bea28e 4fb22787 139165ef ba91f90f', + '8aa5814a 503ad4eb 04a8c7dd 22ce2826'], + b: ['04a8c7dd 22ce2826 8b39b554 16f0447c', + '2fb77de1 07dcd2a6 2e880ea5 3eeb62d5', + '7cb43902 95dbc994 3ab78696 fa504c11'], + n: ['8cb91e82 a3386d28 0f5d6f7e 50e641df', + '152f7109 ed5456b3 1f166e6c ac0425a7', + 'cf3ab6af 6b7fc310 3b883202 e9046565'], + h: '1', + // SSWU + z: '-5', + g: [ + ['1d1c64f0 68cf45ff a2a63a81 b7c13f6b', + '8847a3e7 7ef14fe3 db7fcafe 0cbd10e8', + 'e826e034 36d646aa ef87b2e2 47d4af1e'], + ['8abe1d75 20f9c2a4 5cb1eb8e 95cfd552', + '62b70b29 feec5864 e19c054f f9912928', + '0e464621 77918111 42820341 263c5315'], + pre + ] + }); + } + } + + /** + * BRAINPOOLP512 + * https://tools.ietf.org/html/rfc5639#section-3.7 + */ + + class BRAINPOOLP512 extends ShortCurve { + constructor(pre) { + super({ + id: 'BRAINPOOLP512', + ossl: 'brainpoolP512r1', + type: 'short', + endian: 'be', + hash: 'SHA512', + prime: null, + // (= 3 mod 4) + p: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07', + 'cb308db3 b3c9d20e d6639cca 70330871', + '7d4d9b00 9bc66842 aecda12a e6a380e6', + '2881ff2f 2d82c685 28aa6056 583a48f3'], + a: ['7830a331 8b603b89 e2327145 ac234cc5', + '94cbdd8d 3df91610 a83441ca ea9863bc', + '2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5', + '7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca'], + b: ['3df91610 a83441ca ea9863bc 2ded5d5a', + 'a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7', + '2bf2c7b9 e7c1ac4d 77fc94ca dc083e67', + '984050b7 5ebae5dd 2809bd63 8016f723'], + n: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07', + 'cb308db3 b3c9d20e d6639cca 70330870', + '553e5c41 4ca92619 41866119 7fac1047', + '1db1d381 085ddadd b5879682 9ca90069'], + h: '1', + // Icart + z: '7', + g: [ + ['81aee4bd d82ed964 5a21322e 9c4c6a93', + '85ed9f70 b5d916c1 b43b62ee f4d0098e', + 'ff3b1f78 e2d0d48d 50d1687b 93b97d5f', + '7c6d5047 406a5e68 8b352209 bcb9f822'], + ['7dde385d 566332ec c0eabfa9 cf7822fd', + 'f209f700 24a57b1a a000c55b 881f8111', + 'b2dcde49 4a5f485e 5bca4bd8 8a2763ae', + 'd1ca2b2f a8f05406 78cd1e0f 3ad80892'], + pre + ] + }); + } + } + + /** + * X25519 + * https://tools.ietf.org/html/rfc7748#section-4.1 + */ + + class X25519 extends MontCurve { + constructor() { + super({ + id: 'X25519', + ossl: 'X25519', + type: 'mont', + endian: 'le', + hash: 'SHA512', + prime: 'p25519', + // 2^255 - 19 (= 5 mod 8) + p: ['7fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffed'], + // 486662 + a: '76d06', + b: '1', + n: ['10000000 00000000 00000000 00000000', + '14def9de a2f79cd6 5812631a 5cf5d3ed'], + h: '8', + // Elligator 2 + z: '2', + g: [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000009'], + // See: https://www.rfc-editor.org/errata/eid4730 + ['5f51e65e 475f794b 1fe122d3 88b72eb3', + '6dc2b281 92839e4d d6163a5d 81312c14'] + ], + torsion: [ + [], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000001'], + ['6be4f497 f9a9c2af c21fa77a d7f4a6ef', + '635a11c7 284a9363 e9a248ef 9c884415'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000001'], + ['141b0b68 06563d50 3de05885 280b5910', + '9ca5ee38 d7b56c9c 165db710 6377bbd8'] + ], + [ + ['57119fd0 dd4e22d8 868e1c58 c45c4404', + '5bef839c 55b1d0b1 248c50a3 bc959c5f'], + ['68c59389 3d458e64 31c6ca00 45fb5015', + '20a44346 8eaa68dd 0f103842 048065b7'] + ], + [ + ['57119fd0 dd4e22d8 868e1c58 c45c4404', + '5bef839c 55b1d0b1 248c50a3 bc959c5f'], + ['173a6c76 c2ba719b ce3935ff ba04afea', + 'df5bbcb9 71559722 f0efc7bd fb7f9a36'] + ], + [ + ['00b8495f 16056286 fdb1329c eb8d09da', + '6ac49ff1 fae35616 aeb8413b 7c7aebe0'], + ['3931c129 569e83a5 29482c14 e628b457', + '933bfc29 ed801b4d 68871483 92507b1a'] + ], + [ + ['00b8495f 16056286 fdb1329c eb8d09da', + '6ac49ff1 fae35616 aeb8413b 7c7aebe0'], + ['46ce3ed6 a9617c5a d6b7d3eb 19d74ba8', + '6cc403d6 127fe4b2 9778eb7c 6daf84d3'] + ] + ] + }); + } + } + + /** + * X448 + * https://tools.ietf.org/html/rfc7748#section-4.2 + */ + + class X448 extends MontCurve { + constructor() { + super({ + id: 'X448', + ossl: 'X448', + type: 'mont', + endian: 'le', + hash: 'SHAKE256', + prime: 'p448', + // 2^448 - 2^224 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff'], + // 156326 + a: '262a6', + b: '1', + n: ['3fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 7cca23e9', + 'c44edb49 aed63690 216cc272 8dc58f55', + '2378c292 ab5844f3'], + h: '4', + // Elligator 2 + z: '-1', + g: [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000005'], + ['7d235d12 95f5b1f6 6c98ab6e 58326fce', + 'cbae5d34 f55545d0 60f75dc2 8df3f6ed', + 'b8027e23 46430d21 1312c4b1 50677af7', + '6fd7223d 457b5b1a'] + ], + torsion: [ + [], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['ba4d3a08 29b6112f 8812e51b a0bb2abe', + 'bc1cb08e b48e5569 36ba50fd d2e7d68a', + 'f8cb3216 0522425b 3f990812 abbe635a', + 'd37a21e1 7551b193'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['45b2c5f7 d649eed0 77ed1ae4 5f44d541', + '43e34f71 4b71aa96 c945af01 2d182975', + '0734cde9 faddbda4 c066f7ed 54419ca5', + '2c85de1e 8aae4e6c'] + ] + ] + }); + } + } + + /** + * MONT448 + * Isomorphic to Ed448-Goldilocks. + */ + + class MONT448 extends MontCurve { + constructor() { + super({ + id: 'MONT448', + ossl: null, + type: 'mont', + endian: 'le', + hash: 'SHAKE256', + prime: 'p448', + // 2^448 - 2^224 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff'], + // -78160 / -39082 mod p + a: ['b2cf97d2 d43459a9 31ed36b1 fc4e3cb5', + '5d93f8d2 22746997 60ccffc6 49961ed6', + 'c5b05fca c24864ed 6fb59697 931b78da', + '84ddecd8 ca2b5cfb'], + b: '1', + n: ['3fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 7cca23e9', + 'c44edb49 aed63690 216cc272 8dc58f55', + '2378c292 ab5844f3'], + h: '4', + // Elligator 2 + z: '-1', + g: [ + ['ac0d24cc c6c75cb0 eb71f81e 7a6edf51', + '48e88aee 009a2a24 e795687e c28e125a', + '3e6730a6 0d46367b aa7fe99d 152128dc', + '41321bc7 7817f059'], + ['5a4437f6 80c0d0db 9b061276 d5d0ffcc', + 'e786ff33 b6a53d30 98746425 82e66f09', + '4433dae7 7244a6e2 6b11e905 7228f483', + '556c41a5 913f55fe'] + ], + torsion: [ + [], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['bec92fd0 6da2acf2 b4e261e8 7cef0d34', + '22e75c18 3c589857 b71924e5 73c2f9ce', + 'e18da5f2 466e2f39 3c2eedf0 f105a60a', + 'b40c717d 4f1e1fd7'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['4136d02f 925d530d 4b1d9e17 8310f2cb', + 'dd18a3e7 c3a767a8 48e6db19 8c3d0631', + '1e725a0d b991d0c6 c3d1120f 0efa59f5', + '4bf38e82 b0e1e028'] + ] + ] + }); + } + } + + /** + * ED25519 + * https://tools.ietf.org/html/rfc8032#section-5.1 + */ + + class ED25519 extends EdwardsCurve { + constructor(pre) { + super({ + id: 'ED25519', + ossl: 'ED25519', + type: 'edwards', + endian: 'le', + hash: 'SHA512', + prefix: 'SigEd25519 no Ed25519 collisions', + context: false, + prime: 'p25519', + // 2^255 - 19 (= 5 mod 8) + p: ['7fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffed'], + a: '-1', + // -121665 / 121666 mod p + d: ['52036cee 2b6ffe73 8cc74079 7779e898', + '00700a4d 4141d8ab 75eb4dca 135978a3'], + n: ['10000000 00000000 00000000 00000000', + '14def9de a2f79cd6 5812631a 5cf5d3ed'], + h: '8', + // Elligator 2 + z: '2', + g: [ + ['216936d3 cd6e53fe c0a4e231 fdd6dc5c', + '692cc760 9525a7b2 c9562d60 8f25d51a'], + // 4/5 + ['66666666 66666666 66666666 66666666', + '66666666 66666666 66666666 66666658'], + pre + ], + torsion: [ + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000001'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'], + ['7fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff ffffffec'] + ], + [ + ['2b832480 4fc1df0b 2b4d0099 3dfbd7a7', + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'] + ], + [ + ['547cdb7f b03e20f4 d4b2ff66 c2042858', + 'd0bce7f9 52d01b87 3b11e4d8 b5f15f3d'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000'] + ], + [ + ['1fd5b9a0 06394a28 e9339932 38de4abb', + '5c193c70 13e5e238 dea14646 c545d14a'], + ['05fc536d 880238b1 3933c6d3 05acdfd5', + 'f098eff2 89f4c345 b027b2c2 8f95e826'] + ], + [ + ['602a465f f9c6b5d7 16cc66cd c721b544', + 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'], + ['05fc536d 880238b1 3933c6d3 05acdfd5', + 'f098eff2 89f4c345 b027b2c2 8f95e826'] + ], + [ + ['1fd5b9a0 06394a28 e9339932 38de4abb', + '5c193c70 13e5e238 dea14646 c545d14a'], + ['7a03ac92 77fdc74e c6cc392c fa53202a', + '0f67100d 760b3cba 4fd84d3d 706a17c7'] + ], + [ + ['602a465f f9c6b5d7 16cc66cd c721b544', + 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'], + ['7a03ac92 77fdc74e c6cc392c fa53202a', + '0f67100d 760b3cba 4fd84d3d 706a17c7'] + ] + ] + }); + } + } + + /** + * ISO448 + * https://tools.ietf.org/html/rfc7748#section-4.2 + * https://git.zx2c4.com/goldilocks/tree/_aux/ristretto/ristretto.sage#n658 + */ + + class ISO448 extends EdwardsCurve { + constructor(pre) { + super({ + id: 'ISO448', + ossl: null, + type: 'edwards', + endian: 'le', + hash: 'SHAKE256', + prefix: 'SigEd448', + context: true, + prime: 'p448', + // 2^448 - 2^224 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff'], + a: '1', + // 39082 / 39081 mod p + d: ['d78b4bdc 7f0daf19 f24f38c2 9373a2cc', + 'ad461572 42a50f37 809b1da3 412a12e7', + '9ccc9c81 264cfe9a d0809970 58fb61c4', + '243cc32d baa156b9'], + n: ['3fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 7cca23e9', + 'c44edb49 aed63690 216cc272 8dc58f55', + '2378c292 ab5844f3'], + h: '4', + // Elligator 2 + z: '-1', + g: [ + ['79a70b2b 70400553 ae7c9df4 16c792c6', + '1128751a c9296924 0c25a07d 728bdc93', + 'e21f7787 ed697224 9de732f3 8496cd11', + '69871309 3e9c04fc'], + // Note: the RFC has this wrong. + ['7fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 80000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'], + pre + ], + torsion: [ + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ] + ] + }); + } + } + + /** + * ED448 + * https://tools.ietf.org/html/rfc8032#section-5.2 + */ + + class ED448 extends EdwardsCurve { + constructor(pre) { + super({ + id: 'ED448', + ossl: 'ED448', + type: 'edwards', + endian: 'le', + hash: 'SHAKE256', + prefix: 'SigEd448', + context: true, + prime: 'p448', + // 2^448 - 2^224 - 1 (= 3 mod 4) + p: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff'], + a: '1', + // -39081 mod p + d: ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffff6756'], + n: ['3fffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff ffffffff 7cca23e9', + 'c44edb49 aed63690 216cc272 8dc58f55', + '2378c292 ab5844f3'], + h: '4', + // Elligator 2 + z: '-1', + g: [ + ['4f1970c6 6bed0ded 221d15a6 22bf36da', + '9e146570 470f1767 ea6de324 a3d3a464', + '12ae1af7 2ab66511 433b80e1 8b00938e', + '2626a82b c70cc05e'], + ['693f4671 6eb6bc24 88762037 56c9c762', + '4bea7373 6ca39840 87789c1e 05a0c2d7', + '3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad', + '9808795b f230fa14'], + pre + ], + torsion: [ + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'], + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'] + ], + [ + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000001'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ], + [ + ['ffffffff ffffffff ffffffff ffffffff', + 'ffffffff ffffffff fffffffe ffffffff', + 'ffffffff ffffffff ffffffff ffffffff', + 'ffffffff fffffffe'], + ['00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000 00000000 00000000', + '00000000 00000000'] + ] + ] + }); + } + } + + /* + * Curve Registry + */ + + const curves = { + __proto__: null, + P192, + P224, + P256, + P384, + P521, + SECP256K1, + BRAINPOOLP256, + BRAINPOOLP384, + BRAINPOOLP512, + X25519, + X448, + MONT448, + ED25519, + ISO448, + ED448 + }; + + const cache = { + __proto__: null, + P192: null, + P224: null, + P256: null, + P384: null, + P521: null, + SECP256K1: null, + BRAINPOOLP256: null, + BRAINPOOLP384: null, + BRAINPOOLP512: null, + X25519: null, + X448: null, + MONT448: null, + ED25519: null, + ISO448: null, + ED448: null + }; + + function curve(name, ...args) { + assert(typeof name === 'string'); + + const key = name.toUpperCase(); + + let curve = cache[key]; + + if (!curve) { + const Curve = curves[key]; + + if (!Curve) + throw new Error(`Curve not found: "${name}".`); + + curve = new Curve(...args); + cache[key] = curve; + } + + return curve; + } + + function register(name, Curve) { + assert(typeof name === 'string'); + assert(typeof Curve === 'function'); + + const key = name.toUpperCase(); + + if (curves[key]) + throw new Error(`Curve already registered: "${name}".`); + + curves[key] = Curve; + cache[key] = null; + } + + /* + * Scalar Recoding + */ + + function getNAF(k, width, max) { + // Computing the width-w NAF of a positive integer. + // + // [GECC] Algorithm 3.35, Page 100, Section 3.3. + // + // The above document describes a rather abstract + // method of recoding. The more optimal method + // below was ported from libsecp256k1. + assert(k instanceof BN); + assert(!k.red); + assert((width >>> 0) === width); + assert((max >>> 0) === max); + + const naf = new Array(max); + const bits = k.bitLength() + 1; + const sign = k.sign() | 1; + + assert(bits <= max); + + for (let i = 0; i < max; i++) + naf[i] = 0; + + let i = 0; + let carry = 0; + let word; + + while (i < bits) { + if (k.bit(i) === carry) { + i += 1; + continue; + } + + word = k.bits(i, width) + carry; + carry = (word >> (width - 1)) & 1; + word -= carry << width; + + naf[i] = sign * word; + + i += width; + } + + assert(carry === 0); + + return naf; + } + + function getFixedNAF(k, width, max, step) { + assert((step >>> 0) === step); + + // Recode to NAF. + const naf = getNAF(k, width, max); + + // Translate into more windowed form. + const len = Math.ceil(naf.length / step); + const repr = new Array(len); + + let i = 0; + + for (let j = 0; j < naf.length; j += step) { + let nafW = 0; + + for (let k = j + step - 1; k >= j; k--) + nafW = (nafW << 1) + naf[k]; + + repr[i++] = nafW; + } + + assert(i === len); + + return repr; + } + + function getJSF(k1, k2, max) { + // Joint sparse form. + // + // [GECC] Algorithm 3.50, Page 111, Section 3.3. + assert(k1 instanceof BN); + assert(k2 instanceof BN); + assert(!k1.red); + assert(!k2.red); + assert((max >>> 0) === max); + + const jsf = [new Array(max), new Array(max)]; + const bits = Math.max(k1.bitLength(), k2.bitLength()) + 1; + const s1 = k1.sign() | 1; + const s2 = k2.sign() | 1; + + assert(bits <= max); + + let d1 = 0; + let d2 = 0; + + for (let i = 0; i < bits; i++) { + const b1 = k1.bits(i, 3); + const b2 = k2.bits(i, 3); + + // First phase. + let m14 = ((b1 & 3) + d1) & 3; + let m24 = ((b2 & 3) + d2) & 3; + let u1 = 0; + let u2 = 0; + + if (m14 === 3) + m14 = -1; + + if (m24 === 3) + m24 = -1; + + if (m14 & 1) { + const m8 = ((b1 & 7) + d1) & 7; + + if ((m8 === 3 || m8 === 5) && m24 === 2) + u1 = -m14; + else + u1 = m14; + } + + if (m24 & 1) { + const m8 = ((b2 & 7) + d2) & 7; + + if ((m8 === 3 || m8 === 5) && m14 === 2) + u2 = -m24; + else + u2 = m24; + } + + jsf[0][i] = u1 * s1; + jsf[1][i] = u2 * s2; + + // Second phase. + if (2 * d1 === 1 + u1) + d1 = 1 - d1; + + if (2 * d2 === 1 + u2) + d2 = 1 - d2; + } + + for (let i = bits; i < max; i++) { + jsf[0][i] = 0; + jsf[1][i] = 0; + } + + return jsf; + } + + function getJNAF(c1, c2, max) { + const jsf = getJSF(c1, c2, max); + const naf = new Array(max); + + // JSF -> NAF conversion. + for (let i = 0; i < max; i++) { + const ja = jsf[0][i]; + const jb = jsf[1][i]; + + naf[i] = jsfIndex[(ja + 1) * 3 + (jb + 1)]; + } + + return naf; + } + + /* + * Helpers + */ + + function assert(val, msg) { + if (!val) { + const err = new Error(msg || 'Assertion failed'); + + if (Error.captureStackTrace) + Error.captureStackTrace(err, assert); + + throw err; + } + } + + function wrapErrors(fn) { + assert(typeof fn === 'function'); + + try { + return fn(); + } catch (e) { + if (e.message === 'X is not a square mod P.' + || e.message === 'Not invertible.') { + throw new Error('Invalid point.'); + } + throw e; + } + } + + function mod(x, y) { + // Euclidean modulo. + let r = x % y; + + if (r < 0) { + r += y; + } + + return r; + } + + function cubeRoot(x) { + assert(x instanceof BN); + assert(x.red); + + const p = x.red.m; + + if (p.cmpn(3) <= 0) + return x.clone(); + + // p = 2 mod 3 + if (p.modrn(3) === 2) { + // e = (2 * p - 1) / 3 + const e = p.ushln(1).isubn(1).idivn(3); + return x.redPow(e); + } + + const mod9 = p.modrn(9); + + // p = 4 mod 9 + if (mod9 === 4) { + // e = (2 * p + 1) / 9 + const e = p.ushln(1).iaddn(1).idivn(9); + const r = x.redPow(e); + const c = r.redSqr().redMul(r); + + if (!c.eq(x)) + throw new Error('X is not a cube mod P.'); + + return r; + } + + // p = 7 mod 9 + if (mod9 === 7) { + // e = (p + 2) / 9 + const e = p.addn(2).idivn(9); + const r = x.redPow(e); + const c = r.redSqr().redMul(r); + + if (!c.eq(x)) + throw new Error('X is not a cube mod P.'); + + return r; + } + + throw new Error('Not implemented.'); + } + + function cubeRoots(x) { + const r0 = cubeRoot(x); + + // p = 1 mod 3 + if (x.red.m.modrn(3) === 1) { + // Multiply by roots of unity to find other roots. + const two = new BN(2).toRed(x.red); + const three = new BN(3).toRed(x.red); + const i2 = two.redInvert(); + const s1 = three.redNeg().redSqrt().redMul(i2); + const s2 = s1.redNeg(); + const u1 = s1.redSub(i2); + const u2 = s2.redSub(i2); + const r1 = r0.redMul(u1); + const r2 = r0.redMul(u2); + + return [r0, r1, r2]; + } + + // p = 2 mod 3 guarantees 1 cube root per element. + return [r0]; + } + + function uncube(x) { + // Find a cube root which is also a quadratic residue. + for (const root of cubeRoots(x)) { + if (root.redJacobi() >= 0) + return root; + } + + throw new Error('X^(1/3) is not a square mod P.'); + } + + function randomInt(rng) { + return BN.randomBits(rng, 32).toNumber(); + } + + function memoize(method, self) { + const cache = new WeakMap(); + + return function memoized(curve, invert) { + const i = invert & 1; + const item = cache.get(curve); + + if (item && item[i] !== null) + return item[i]; + + const result = method.call(self, curve, invert); + + if (!cache.has(curve)) + cache.set(curve, [null, null]); + + cache.get(curve)[i] = result; + + return result; + }; + } + + function toPretty(x, size) { + assert(x instanceof BN); + assert((size >>> 0) === size); + + if (size & 7) + size += 8 - (size & 7); + + const str = x.toString(16, size); + const chunks = []; + const out = []; + + assert((str.length & 7) === 0); + + for (let i = 0; i < str.length; i += 8) + chunks.push(str.slice(i, i + 8)); + + for (let i = 0; i < chunks.length; i += 4) + out.push(chunks.slice(i, i + 4).join(' ')); + + return out; + } + + /* + * Expose + */ + + elliptic.Curve = Curve; + elliptic.Point = Point; + elliptic.ShortCurve = ShortCurve; + elliptic.ShortPoint = ShortPoint; + elliptic.JPoint = JPoint; + elliptic.MontCurve = MontCurve; + elliptic.MontPoint = MontPoint; + elliptic.XPoint = XPoint; + elliptic.EdwardsCurve = EdwardsCurve; + elliptic.EdwardsPoint = EdwardsPoint; + elliptic.curves = curves; + elliptic.curve = curve; + elliptic.register = register; + return elliptic; + } + + var random = {}; + + var hasRequiredRandom; + + function requireRandom () { + if (hasRequiredRandom) return random; + hasRequiredRandom = 1; + + const assert = requireAssert(); + + /* + * Constants + */ + + const crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto; + const HAS_CRYPTO = crypto && typeof crypto.getRandomValues === 'function'; + const randomValues = HAS_CRYPTO ? crypto.getRandomValues.bind(crypto) : null; + const pool = new Uint32Array(16); + const MAX_BYTES = 65536; + + let poolPos = 0; + + /** + * Generate pseudo-random bytes. + * @param {Number} size + * @returns {Buffer} + */ + + function randomBytes(size) { + assert((size >>> 0) === size); + + const data = bufferExports.Buffer.alloc(size); + + randomFillSync(data, 0, size); + + return data; + } + + /** + * Generate pseudo-random bytes. + * @param {Buffer} data + * @param {Number} [off=0] + * @param {Number} [size=data.length-off] + * @returns {Buffer} + */ + + function randomFill(data, off, size) { + assert(bufferExports.Buffer.isBuffer(data)); + + if (off == null) + off = 0; + + assert((off >>> 0) === off); + + if (size == null) + size = data.length - off; + + assert((size >>> 0) === size); + assert(off + size <= data.length); + + randomFillSync(data, off, size); + + return data; + } + + /** + * Generate a random uint32. + * @returns {Number} + */ + + function randomInt() { + if ((poolPos & 15) === 0) { + getRandomValues(pool); + poolPos = 0; + } + + return pool[poolPos++]; + } + + /** + * Generate a random uint32 within a range. + * @param {Number} min - Inclusive. + * @param {Number} max - Exclusive. + * @returns {Number} + */ + + function randomRange(min, max) { + assert((min >>> 0) === min); + assert((max >>> 0) === max); + assert(max >= min); + + const space = max - min; + + if (space === 0) + return min; + + const top = -space >>> 0; + + let x, r; + + do { + x = randomInt(); + r = x % space; + } while (x - r > top); + + return r + min; + } + + /* + * Helpers + */ + + function getRandomValues(array) { + if (!HAS_CRYPTO) + throw new Error('Entropy source not available.'); + + return randomValues(array); + } + + function randomFillSync(data, off, size) { + assert(bufferExports.Buffer.isBuffer(data)); + assert(data.buffer instanceof ArrayBuffer); + assert((data.byteOffset >>> 0) === data.byteOffset); + assert((data.byteLength >>> 0) === data.byteLength); + assert((off >>> 0) === off); + assert((size >>> 0) === size); + assert(off + size <= data.byteLength); + + if (size > 2 ** 31 - 1) + throw new RangeError('The value "size" is out of range.'); + + const offset = data.byteOffset + off; + const array = new Uint8Array(data.buffer, offset, size); + + if (array.length > MAX_BYTES) { + for (let i = 0; i < array.length; i += MAX_BYTES) { + let j = i + MAX_BYTES; + + if (j > array.length) + j = array.length; + + getRandomValues(array.subarray(i, j)); + } + } else { + if (array.length > 0) + getRandomValues(array); + } + } + + /* + * Expose + */ + + random.native = 0; + random.randomBytes = randomBytes; + random.randomFill = randomFill; + random.randomInt = randomInt; + random.randomRange = randomRange; + return random; + } + + /*! + * random.js - random for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var randomBrowser; + var hasRequiredRandomBrowser; + + function requireRandomBrowser () { + if (hasRequiredRandomBrowser) return randomBrowser; + hasRequiredRandomBrowser = 1; + + randomBrowser = requireRandom(); + return randomBrowser; + } + + var eddsa; + var hasRequiredEddsa; + + function requireEddsa () { + if (hasRequiredEddsa) return eddsa; + hasRequiredEddsa = 1; + + const assert = requireAssert(); + const BatchRNG = requireBatchRng(); + const BN = requireBnBrowser(); + const elliptic = requireElliptic(); + const rng = requireRandomBrowser(); + + /* + * EDDSA + */ + + class EDDSA { + constructor(id, mid, eid, hash, pre) { + assert(typeof id === 'string'); + assert(!mid || typeof mid === 'string'); + assert(!eid || typeof eid === 'string'); + assert(hash); + + this.id = id; + this.type = 'eddsa'; + this.mid = mid || null; + this.eid = eid || null; + this.hash = hash; + this.native = 0; + + this._pre = pre || null; + this._curve = null; + this._mont = null; + this._iso = null; + this._rng = null; + } + + get curve() { + if (!this._curve) { + this._curve = elliptic.curve(this.id, this._pre); + this._curve.precompute(rng); + this._pre = null; + } + return this._curve; + } + + get mont() { + if (this.mid && !this._mont) + this._mont = elliptic.curve(this.mid); + return this._mont; + } + + get iso() { + if (!this.eid) + return this.mont; + + if (!this._iso) + this._iso = elliptic.curve(this.eid); + + return this._iso; + } + + get rng() { + if (!this._rng) + this._rng = new BatchRNG(this.curve); + + return this._rng; + } + + get size() { + return this.curve.adjustedSize; + } + + get bits() { + return this.curve.fieldBits; + } + + hashNonce(prefix, msg, ph, ctx) { + const hash = new Hash(this); + + hash.init(ph, ctx); + hash.update(prefix); + hash.update(msg); + + return hash.final(); + } + + hashChallenge(R, A, m, ph, ctx) { + const hash = new Hash(this); + + hash.init(ph, ctx); + hash.update(R); + hash.update(A); + hash.update(m); + + return hash.final(); + } + + privateKeyGenerate() { + return rng.randomBytes(this.curve.adjustedSize); + } + + scalarGenerate() { + const scalar = rng.randomBytes(this.curve.scalarSize); + return this.curve.clamp(scalar); + } + + privateKeyExpand(secret) { + assert(bufferExports.Buffer.isBuffer(secret)); + assert(secret.length === this.curve.adjustedSize); + + const hash = this.hash.digest(secret, this.curve.adjustedSize * 2); + + return this.curve.splitHash(hash); + } + + privateKeyConvert(secret) { + const [key] = this.privateKeyExpand(secret); + return key; + } + + privateKeyVerify(secret) { + assert(bufferExports.Buffer.isBuffer(secret)); + return secret.length === this.curve.adjustedSize; + } + + scalarVerify(scalar) { + assert(bufferExports.Buffer.isBuffer(scalar)); + return scalar.length === this.curve.scalarSize; + } + + scalarIsZero(scalar) { + assert(bufferExports.Buffer.isBuffer(scalar)); + + let k; + try { + k = this.curve.decodeScalar(scalar).imod(this.curve.n); + } catch (e) { + return false; + } + + return k.isZero(); + } + + scalarClamp(scalar) { + assert(bufferExports.Buffer.isBuffer(scalar)); + assert(scalar.length === this.curve.scalarSize); + + return this.curve.clamp(bufferExports.Buffer.from(scalar)); + } + + privateKeyExport(secret) { + const pub = this.publicKeyCreate(secret); + const {x, y} = this.publicKeyExport(pub); + + return { + d: bufferExports.Buffer.from(secret), + x, + y + }; + } + + privateKeyImport(json) { + assert(json && typeof json === 'object'); + assert(bufferExports.Buffer.isBuffer(json.d)); + + if (json.d.length !== this.curve.adjustedSize) + throw new Error('Invalid private key.'); + + return bufferExports.Buffer.from(json.d); + } + + scalarTweakAdd(scalar, tweak) { + const a = this.curve.decodeScalar(scalar); + const t = this.curve.decodeScalar(tweak); + const k = a.add(t).imod(this.curve.n); + + return this.curve.encodeScalar(k); + } + + scalarTweakMul(scalar, tweak) { + const a = this.curve.decodeScalar(scalar); + const t = this.curve.decodeScalar(tweak); + const k = a.mul(t).imod(this.curve.n); + + return this.curve.encodeScalar(k); + } + + scalarReduce(scalar) { + const a = this.curve.decodeScalar(scalar); + const k = a.imod(this.curve.n); + + return this.curve.encodeScalar(k); + } + + scalarNegate(scalar) { + const a = this.curve.decodeScalar(scalar).imod(this.curve.n); + const k = a.neg().imod(this.curve.n); + + return this.curve.encodeScalar(k); + } + + scalarInvert(scalar) { + const a = this.curve.decodeScalar(scalar).imod(this.curve.n); + + if (a.isZero()) + return this.curve.encodeScalar(a); + + const k = a.invert(this.curve.n); + + return this.curve.encodeScalar(k); + } + + publicKeyCreate(secret) { + const key = this.privateKeyConvert(secret); + return this.publicKeyFromScalar(key); + } + + publicKeyFromScalar(scalar) { + const a = this.curve.decodeScalar(scalar).imod(this.curve.n); + const A = this.curve.g.mulBlind(a); + + return A.encode(); + } + + publicKeyConvert(key) { + if (!this.mont) + throw new Error('No equivalent montgomery curve.'); + + const A = this.curve.decodePoint(key); + const P = this.mont.pointFromEdwards(A); + + return P.encode(); + } + + publicKeyFromUniform(bytes) { + const u = this.curve.decodeUniform(bytes); + const A = this.curve.pointFromUniform(u, this.iso); + + return A.encode(); + } + + publicKeyToUniform(key, hint = rng.randomInt()) { + const A = this.curve.decodePoint(key); + const u = this.curve.pointToUniform(A, hint, this.iso); + + return this.curve.encodeUniform(u, hint >>> 8); + } + + publicKeyFromHash(bytes, pake = false) { + const A = this.curve.pointFromHash(bytes, pake, this.iso); + return A.encode(); + } + + publicKeyToHash(key, subgroup = rng.randomInt()) { + const A = this.curve.decodePoint(key); + return this.curve.pointToHash(A, subgroup, rng, this.iso); + } + + publicKeyVerify(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + try { + this.curve.decodePoint(key); + } catch (e) { + return false; + } + + return true; + } + + publicKeyIsInfinity(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + let A; + try { + A = this.curve.decodePoint(key); + } catch (e) { + return false; + } + + return A.isInfinity(); + } + + publicKeyIsSmall(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + let A; + try { + A = this.curve.decodePoint(key); + } catch (e) { + return false; + } + + return A.isSmall(); + } + + publicKeyHasTorsion(key) { + assert(bufferExports.Buffer.isBuffer(key)); + + let A; + try { + A = this.curve.decodePoint(key); + } catch (e) { + return false; + } + + return A.hasTorsion(); + } + + publicKeyExport(key) { + const {x, y} = this.curve.decodePoint(key); + + return { + x: this.curve.encodeField(x.fromRed()), + y: this.curve.encodeField(y.fromRed()) + }; + } + + publicKeyImport(json) { + assert(json && typeof json === 'object'); + + let x = null; + let y = null; + let A; + + if (json.x != null) { + x = BN.decode(json.x, this.curve.endian); + + if (x.cmp(this.curve.p) >= 0) + throw new Error('Invalid point.'); + } + + if (json.y != null) { + y = BN.decode(json.y, this.curve.endian); + + if (y.cmp(this.curve.p) >= 0) + throw new Error('Invalid point.'); + } + + if (x && y) { + A = this.curve.point(x, y); + + if (!A.validate()) + throw new Error('Invalid point.'); + } else if (x) { + A = this.curve.pointFromX(x, json.sign); + } else if (y) { + A = this.curve.pointFromY(y, json.sign); + } else { + throw new Error('Invalid point.'); + } + + return A.encode(); + } + + publicKeyTweakAdd(key, tweak) { + const t = this.curve.decodeScalar(tweak).imod(this.curve.n); + const A = this.curve.decodePoint(key); + const T = this.curve.g.mul(t); + const P = T.add(A); + + return P.encode(); + } + + publicKeyTweakMul(key, tweak) { + const t = this.curve.decodeScalar(tweak); + const A = this.curve.decodePoint(key); + const P = A.mul(t); + + return P.encode(); + } + + publicKeyCombine(keys) { + assert(Array.isArray(keys)); + + let P = this.curve.point(); + + for (const key of keys) { + const A = this.curve.decodePoint(key); + + P = P.add(A); + } + + return P.encode(); + } + + publicKeyNegate(key) { + const A = this.curve.decodePoint(key); + const P = A.neg(); + + return P.encode(); + } + + sign(msg, secret, ph, ctx) { + const [key, prefix] = this.privateKeyExpand(secret); + return this.signWithScalar(msg, key, prefix, ph, ctx); + } + + signWithScalar(msg, scalar, prefix, ph, ctx) { + // EdDSA Signing. + // + // [EDDSA] Page 12, Section 4. + // [RFC8032] Page 8, Section 3.3. + // + // Assumptions: + // + // - Let `H` be a cryptographic hash function. + // - Let `m` be a byte array of arbitrary size. + // - Let `a` be a secret scalar. + // - Let `w` be a secret byte array. + // + // Computation: + // + // k = H(w, m) mod n + // R = G * k + // A = G * a + // e = H(R, A, m) mod n + // s = (k + e * a) mod n + // S = (R, s) + // + // Note that `k` must remain secret, + // otherwise an attacker can compute: + // + // a = (s - k) / e mod n + // + // The same is true of `w` as `k` + // can be re-derived as `H(w, m)`. + if (ctx == null) + ctx = bufferExports.Buffer.alloc(0); + + assert(bufferExports.Buffer.isBuffer(msg)); + assert(bufferExports.Buffer.isBuffer(prefix)); + assert(prefix.length === this.curve.adjustedSize); + + const {n} = this.curve; + const G = this.curve.g; + const k = this.hashNonce(prefix, msg, ph, ctx); + const Rraw = G.mulBlind(k).encode(); + const a = this.curve.decodeScalar(scalar); + const Araw = G.mulBlind(a).encode(); + const e = this.hashChallenge(Rraw, Araw, msg, ph, ctx); + const s = k.add(e.mul(a)).imod(n); + + return bufferExports.Buffer.concat([Rraw, this.curve.encodeAdjusted(s)]); + } + + signTweakAdd(msg, secret, tweak, ph, ctx) { + const [key_, prefix_] = this.privateKeyExpand(secret); + const key = this.scalarTweakAdd(key_, tweak); + const expanded = this.hash.multi(prefix_, tweak, null, + this.curve.adjustedSize * 2); + const prefix = expanded.slice(0, this.curve.adjustedSize); + + return this.signWithScalar(msg, key, prefix, ph, ctx); + } + + signTweakMul(msg, secret, tweak, ph, ctx) { + const [key_, prefix_] = this.privateKeyExpand(secret); + const key = this.scalarTweakMul(key_, tweak); + const expanded = this.hash.multi(prefix_, tweak, null, + this.curve.adjustedSize * 2); + const prefix = expanded.slice(0, this.curve.adjustedSize); + + return this.signWithScalar(msg, key, prefix, ph, ctx); + } + + verify(msg, sig, key, ph, ctx) { + if (ctx == null) + ctx = bufferExports.Buffer.alloc(0); + + assert(bufferExports.Buffer.isBuffer(msg)); + assert(bufferExports.Buffer.isBuffer(sig)); + assert(bufferExports.Buffer.isBuffer(key)); + assert(ph == null || typeof ph === 'boolean'); + assert(bufferExports.Buffer.isBuffer(ctx)); + + if (sig.length !== this.curve.adjustedSize * 2) + return false; + + if (key.length !== this.curve.adjustedSize) + return false; + + try { + return this._verify(msg, sig, key, ph, ctx); + } catch (e) { + return false; + } + } + + _verify(msg, sig, key, ph, ctx) { + // EdDSA Verification. + // + // [EDDSA] Page 15, Section 5. + // [RFC8032] Page 8, Section 3.4. + // + // Assumptions: + // + // - Let `H` be a cryptographic hash function. + // - Let `m` be a byte array of arbitrary size. + // - Let `R` and `s` be signature elements. + // - Let `A` be a valid group element. + // - s < n. + // + // Computation: + // + // e = H(R, A, m) mod n + // G * s == R + A * e + // + // Alternatively, we can compute: + // + // R == G * s - A * e + // + // This allows us to make use of a + // multi-exponentiation algorithm. + const {n} = this.curve; + const G = this.curve.g; + const Rraw = sig.slice(0, this.curve.adjustedSize); + const sraw = sig.slice(this.curve.adjustedSize); + const R = this.curve.decodePoint(Rraw); + const s = this.curve.decodeAdjusted(sraw); + const A = this.curve.decodePoint(key); + + if (s.cmp(n) >= 0) + return false; + + const e = this.hashChallenge(Rraw, key, msg, ph, ctx); + + return G.mulAdd(s, A.neg(), e).eq(R); + } + + verifySingle(msg, sig, key, ph, ctx) { + if (ctx == null) + ctx = bufferExports.Buffer.alloc(0); + + assert(bufferExports.Buffer.isBuffer(msg)); + assert(bufferExports.Buffer.isBuffer(sig)); + assert(bufferExports.Buffer.isBuffer(key)); + assert(ph == null || typeof ph === 'boolean'); + assert(bufferExports.Buffer.isBuffer(ctx)); + + if (sig.length !== this.curve.adjustedSize * 2) + return false; + + if (key.length !== this.curve.adjustedSize) + return false; + + try { + return this._verifySingle(msg, sig, key, ph, ctx); + } catch (e) { + return false; + } + } + + _verifySingle(msg, sig, key, ph, ctx) { + // EdDSA Verification (with cofactor multiplication). + // + // [EDDSA] Page 15, Section 5. + // [RFC8032] Page 8, Section 3.4. + // + // Assumptions: + // + // - Let `H` be a cryptographic hash function. + // - Let `m` be a byte array of arbitrary size. + // - Let `R` and `s` be signature elements. + // - Let `A` be a valid group element. + // - s < n. + // + // Computation: + // + // e = H(R, A, m) mod n + // (G * s) * h == (R + A * e) * h + // + // Alternatively, we can compute: + // + // R * h == G * (s * h) - (A * h) * e + // + // This allows us to make use of a + // multi-exponentiation algorithm. + const {n} = this.curve; + const G = this.curve.g; + const Rraw = sig.slice(0, this.curve.adjustedSize); + const sraw = sig.slice(this.curve.adjustedSize); + const R = this.curve.decodePoint(Rraw); + const s = this.curve.decodeAdjusted(sraw); + const A = this.curve.decodePoint(key); + + if (s.cmp(n) >= 0) + return false; + + const e = this.hashChallenge(Rraw, key, msg, ph, ctx); + const sh = this.curve.imulH(s); + const Ah = A.mulH(); + const Rh = R.mulH(); + + return G.mulAdd(sh, Ah.neg(), e).eq(Rh); + } + + verifyBatch(batch, ph, ctx) { + if (ctx == null) + ctx = bufferExports.Buffer.alloc(0); + + assert(Array.isArray(batch)); + assert(ph == null || typeof ph === 'boolean'); + assert(bufferExports.Buffer.isBuffer(ctx)); + + for (const item of batch) { + assert(Array.isArray(item) && item.length === 3); + + const [msg, sig, key] = item; + + assert(bufferExports.Buffer.isBuffer(msg)); + assert(bufferExports.Buffer.isBuffer(sig)); + assert(bufferExports.Buffer.isBuffer(key)); + + if (sig.length !== this.curve.adjustedSize * 2) + return false; + + if (key.length !== this.curve.adjustedSize) + return false; + } + + try { + return this._verifyBatch(batch, ph, ctx); + } catch (e) { + return false; + } + } + + _verifyBatch(batch, ph, ctx) { + // EdDSA Batch Verification. + // + // [EDDSA] Page 16, Section 5. + // + // Assumptions: + // + // - Let `H` be a cryptographic hash function. + // - Let `R` and `s` be signature elements. + // - Let `A` be a valid group element. + // - Let `i` be the batch item index. + // - s < n. + // - a1 = 1 mod n. + // + // Computation: + // + // ei = H(Ri, Ai, mi) mod n + // ai = random integer in [1,n-1] + // lhs = (si * ai + ...) * h mod n + // rhs = (Ri * h) * ai + (Ai * h) * (ei * ai mod n) + ... + // G * -lhs + rhs == O + const {n} = this.curve; + const G = this.curve.g; + const points = new Array(1 + batch.length * 2); + const coeffs = new Array(1 + batch.length * 2); + const sum = new BN(0); + + this.rng.init(batch); + + points[0] = G; + coeffs[0] = sum; + + for (let i = 0; i < batch.length; i++) { + const [msg, sig, key] = batch[i]; + const Rraw = sig.slice(0, this.curve.adjustedSize); + const sraw = sig.slice(this.curve.adjustedSize); + const R = this.curve.decodePoint(Rraw); + const s = this.curve.decodeAdjusted(sraw); + const A = this.curve.decodePoint(key); + + if (s.cmp(n) >= 0) + return false; + + const e = this.hashChallenge(Rraw, key, msg, ph, ctx); + const a = this.rng.generate(i); + const ea = e.mul(a).imod(n); + + sum.iadd(s.mul(a)).imod(n); + + points[1 + i * 2 + 0] = R.mulH(); + coeffs[1 + i * 2 + 0] = a; + points[1 + i * 2 + 1] = A.mulH(); + coeffs[1 + i * 2 + 1] = ea; + } + + this.curve.imulH(sum.ineg()); + + return this.curve.mulAll(points, coeffs).isInfinity(); + } + + derive(pub, secret) { + const scalar = this.privateKeyConvert(secret); + return this.deriveWithScalar(pub, scalar); + } + + deriveWithScalar(pub, scalar) { + const A = this.curve.decodePoint(pub); + const a = this.curve.decodeClamped(scalar); + const P = A.mulBlind(a, rng); + + if (P.isInfinity()) + throw new Error('Invalid point.'); + + return P.encode(); + } + } + + /* + * Hash + */ + + class Hash { + constructor(eddsa) { + this.curve = eddsa.curve; + // eslint-disable-next-line + this.hash = new eddsa.hash(); + } + + init(ph, ctx) { + assert(ph == null || typeof ph === 'boolean'); + assert(bufferExports.Buffer.isBuffer(ctx)); + + if (ctx.length > 255) + ctx = ctx.slice(0, 255); + + this.hash.init(); + + if (this.curve.context || ph != null || ctx.length > 0) { + if (this.curve.prefix) + this.hash.update(this.curve.prefix); + + this.hash.update(byte(ph)); + this.hash.update(byte(ctx.length)); + this.hash.update(ctx); + } + + return this; + } + + update(data) { + this.hash.update(data); + return this; + } + + final() { + const hash = this.hash.final(this.curve.adjustedSize * 2); + const num = BN.decode(hash, this.curve.endian); + + return num.imod(this.curve.n); + } + } + + /* + * Helpers + */ + + function byte(ch) { + const buf = bufferExports.Buffer.alloc(1); + buf[0] = ch & 0xff; + return buf; + } + + /* + * Expose + */ + + eddsa = EDDSA; + return eddsa; + } + + var keccak; + var hasRequiredKeccak; + + function requireKeccak () { + if (hasRequiredKeccak) return keccak; + hasRequiredKeccak = 1; + + const assert = requireAssert(); + const HMAC = requireHmac(); + + /* + * Constants + */ + + const FINALIZED = 0x80000000; + + const ROUND_CONST = new Uint32Array([ + 0x00000001, 0x00000000, 0x00008082, 0x00000000, + 0x0000808a, 0x80000000, 0x80008000, 0x80000000, + 0x0000808b, 0x00000000, 0x80000001, 0x00000000, + 0x80008081, 0x80000000, 0x00008009, 0x80000000, + 0x0000008a, 0x00000000, 0x00000088, 0x00000000, + 0x80008009, 0x00000000, 0x8000000a, 0x00000000, + 0x8000808b, 0x00000000, 0x0000008b, 0x80000000, + 0x00008089, 0x80000000, 0x00008003, 0x80000000, + 0x00008002, 0x80000000, 0x00000080, 0x80000000, + 0x0000800a, 0x00000000, 0x8000000a, 0x80000000, + 0x80008081, 0x80000000, 0x00008080, 0x80000000, + 0x80000001, 0x00000000, 0x80008008, 0x80000000 + ]); + + /** + * Keccak + */ + + class Keccak { + constructor() { + this.state = new Uint32Array(50); + this.block = bufferExports.Buffer.alloc(200); + this.bs = 136; + this.pos = FINALIZED; + } + + init(bits) { + if (bits == null) + bits = 256; + + assert((bits >>> 0) === bits); + assert(bits >= 128); + assert(bits <= 512); + + const rate = 1600 - bits * 2; + + assert(rate >= 0 && (rate & 63) === 0); + + this.bs = rate >>> 3; + this.pos = 0; + + return this; + } + + update(data) { + assert(bufferExports.Buffer.isBuffer(data)); + assert(!(this.pos & FINALIZED), 'Context is not initialized.'); + + let len = data.length; + let pos = this.pos; + let off = 0; + + this.pos = (this.pos + len) % this.bs; + + if (pos > 0) { + let want = this.bs - pos; + + if (want > len) + want = len; + + data.copy(this.block, pos, off, off + want); + + pos += want; + len -= want; + off += want; + + if (pos < this.bs) + return this; + + this._transform(this.block, 0); + } + + while (len >= this.bs) { + this._transform(data, off); + off += this.bs; + len -= this.bs; + } + + if (len > 0) + data.copy(this.block, 0, off, off + len); + + return this; + } + + final(pad, len) { + if (pad == null) + pad = 0x01; + + if (len == null || len === 0) + len = 100 - (this.bs >>> 1); + + assert((pad & 0xff) === pad); + assert((len >>> 0) === len); + assert(!(this.pos & FINALIZED), 'Context is not initialized.'); + + this.block.fill(0, this.pos, this.bs); + this.block[this.pos] |= pad; + this.block[this.bs - 1] |= 0x80; + this._transform(this.block, 0); + this.pos = FINALIZED; + + assert(len <= this.bs); + + const out = bufferExports.Buffer.alloc(len); + + for (let i = 0; i < len; i++) + out[i] = this.state[i >>> 2] >>> (8 * (i & 3)); + + for (let i = 0; i < 50; i++) + this.state[i] = 0; + + for (let i = 0; i < this.bs; i++) + this.block[i] = 0; + + return out; + } + + _transform(block, off) { + const count = this.bs >>> 2; + const s = this.state; + + for (let i = 0; i < count; i++) + s[i] ^= readU32(block, off + i * 4); + + for (let n = 0; n < 48; n += 2) { + const c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]; + const c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]; + const c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]; + const c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43]; + const c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44]; + const c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45]; + const c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46]; + const c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47]; + const c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48]; + const c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49]; + + const h0 = c8 ^ ((c2 << 1) | (c3 >>> 31)); + const l0 = c9 ^ ((c3 << 1) | (c2 >>> 31)); + const h1 = c0 ^ ((c4 << 1) | (c5 >>> 31)); + const l1 = c1 ^ ((c5 << 1) | (c4 >>> 31)); + const h2 = c2 ^ ((c6 << 1) | (c7 >>> 31)); + const l2 = c3 ^ ((c7 << 1) | (c6 >>> 31)); + const h3 = c4 ^ ((c8 << 1) | (c9 >>> 31)); + const l3 = c5 ^ ((c9 << 1) | (c8 >>> 31)); + const h4 = c6 ^ ((c0 << 1) | (c1 >>> 31)); + const l4 = c7 ^ ((c1 << 1) | (c0 >>> 31)); + + s[0] ^= h0; + s[1] ^= l0; + s[10] ^= h0; + s[11] ^= l0; + s[20] ^= h0; + s[21] ^= l0; + s[30] ^= h0; + s[31] ^= l0; + s[40] ^= h0; + s[41] ^= l0; + + s[2] ^= h1; + s[3] ^= l1; + s[12] ^= h1; + s[13] ^= l1; + s[22] ^= h1; + s[23] ^= l1; + s[32] ^= h1; + s[33] ^= l1; + s[42] ^= h1; + s[43] ^= l1; + + s[4] ^= h2; + s[5] ^= l2; + s[14] ^= h2; + s[15] ^= l2; + s[24] ^= h2; + s[25] ^= l2; + s[34] ^= h2; + s[35] ^= l2; + s[44] ^= h2; + s[45] ^= l2; + + s[6] ^= h3; + s[7] ^= l3; + s[16] ^= h3; + s[17] ^= l3; + s[26] ^= h3; + s[27] ^= l3; + s[36] ^= h3; + s[37] ^= l3; + s[46] ^= h3; + s[47] ^= l3; + + s[8] ^= h4; + s[9] ^= l4; + s[18] ^= h4; + s[19] ^= l4; + s[28] ^= h4; + s[29] ^= l4; + s[38] ^= h4; + s[39] ^= l4; + s[48] ^= h4; + s[49] ^= l4; + + const b0 = s[0]; + const b1 = s[1]; + const b32 = (s[11] << 4) | (s[10] >>> 28); + const b33 = (s[10] << 4) | (s[11] >>> 28); + const b14 = (s[20] << 3) | (s[21] >>> 29); + const b15 = (s[21] << 3) | (s[20] >>> 29); + const b46 = (s[31] << 9) | (s[30] >>> 23); + const b47 = (s[30] << 9) | (s[31] >>> 23); + const b28 = (s[40] << 18) | (s[41] >>> 14); + const b29 = (s[41] << 18) | (s[40] >>> 14); + const b20 = (s[2] << 1) | (s[3] >>> 31); + const b21 = (s[3] << 1) | (s[2] >>> 31); + const b2 = (s[13] << 12) | (s[12] >>> 20); + const b3 = (s[12] << 12) | (s[13] >>> 20); + const b34 = (s[22] << 10) | (s[23] >>> 22); + const b35 = (s[23] << 10) | (s[22] >>> 22); + const b16 = (s[33] << 13) | (s[32] >>> 19); + const b17 = (s[32] << 13) | (s[33] >>> 19); + const b48 = (s[42] << 2) | (s[43] >>> 30); + const b49 = (s[43] << 2) | (s[42] >>> 30); + const b40 = (s[5] << 30) | (s[4] >>> 2); + const b41 = (s[4] << 30) | (s[5] >>> 2); + const b22 = (s[14] << 6) | (s[15] >>> 26); + const b23 = (s[15] << 6) | (s[14] >>> 26); + const b4 = (s[25] << 11) | (s[24] >>> 21); + const b5 = (s[24] << 11) | (s[25] >>> 21); + const b36 = (s[34] << 15) | (s[35] >>> 17); + const b37 = (s[35] << 15) | (s[34] >>> 17); + const b18 = (s[45] << 29) | (s[44] >>> 3); + const b19 = (s[44] << 29) | (s[45] >>> 3); + const b10 = (s[6] << 28) | (s[7] >>> 4); + const b11 = (s[7] << 28) | (s[6] >>> 4); + const b42 = (s[17] << 23) | (s[16] >>> 9); + const b43 = (s[16] << 23) | (s[17] >>> 9); + const b24 = (s[26] << 25) | (s[27] >>> 7); + const b25 = (s[27] << 25) | (s[26] >>> 7); + const b6 = (s[36] << 21) | (s[37] >>> 11); + const b7 = (s[37] << 21) | (s[36] >>> 11); + const b38 = (s[47] << 24) | (s[46] >>> 8); + const b39 = (s[46] << 24) | (s[47] >>> 8); + const b30 = (s[8] << 27) | (s[9] >>> 5); + const b31 = (s[9] << 27) | (s[8] >>> 5); + const b12 = (s[18] << 20) | (s[19] >>> 12); + const b13 = (s[19] << 20) | (s[18] >>> 12); + const b44 = (s[29] << 7) | (s[28] >>> 25); + const b45 = (s[28] << 7) | (s[29] >>> 25); + const b26 = (s[38] << 8) | (s[39] >>> 24); + const b27 = (s[39] << 8) | (s[38] >>> 24); + const b8 = (s[48] << 14) | (s[49] >>> 18); + const b9 = (s[49] << 14) | (s[48] >>> 18); + + s[0] = b0 ^ (~b2 & b4); + s[1] = b1 ^ (~b3 & b5); + s[10] = b10 ^ (~b12 & b14); + s[11] = b11 ^ (~b13 & b15); + s[20] = b20 ^ (~b22 & b24); + s[21] = b21 ^ (~b23 & b25); + s[30] = b30 ^ (~b32 & b34); + s[31] = b31 ^ (~b33 & b35); + s[40] = b40 ^ (~b42 & b44); + s[41] = b41 ^ (~b43 & b45); + s[2] = b2 ^ (~b4 & b6); + s[3] = b3 ^ (~b5 & b7); + s[12] = b12 ^ (~b14 & b16); + s[13] = b13 ^ (~b15 & b17); + s[22] = b22 ^ (~b24 & b26); + s[23] = b23 ^ (~b25 & b27); + s[32] = b32 ^ (~b34 & b36); + s[33] = b33 ^ (~b35 & b37); + s[42] = b42 ^ (~b44 & b46); + s[43] = b43 ^ (~b45 & b47); + s[4] = b4 ^ (~b6 & b8); + s[5] = b5 ^ (~b7 & b9); + s[14] = b14 ^ (~b16 & b18); + s[15] = b15 ^ (~b17 & b19); + s[24] = b24 ^ (~b26 & b28); + s[25] = b25 ^ (~b27 & b29); + s[34] = b34 ^ (~b36 & b38); + s[35] = b35 ^ (~b37 & b39); + s[44] = b44 ^ (~b46 & b48); + s[45] = b45 ^ (~b47 & b49); + s[6] = b6 ^ (~b8 & b0); + s[7] = b7 ^ (~b9 & b1); + s[16] = b16 ^ (~b18 & b10); + s[17] = b17 ^ (~b19 & b11); + s[26] = b26 ^ (~b28 & b20); + s[27] = b27 ^ (~b29 & b21); + s[36] = b36 ^ (~b38 & b30); + s[37] = b37 ^ (~b39 & b31); + s[46] = b46 ^ (~b48 & b40); + s[47] = b47 ^ (~b49 & b41); + s[8] = b8 ^ (~b0 & b2); + s[9] = b9 ^ (~b1 & b3); + s[18] = b18 ^ (~b10 & b12); + s[19] = b19 ^ (~b11 & b13); + s[28] = b28 ^ (~b20 & b22); + s[29] = b29 ^ (~b21 & b23); + s[38] = b38 ^ (~b30 & b32); + s[39] = b39 ^ (~b31 & b33); + s[48] = b48 ^ (~b40 & b42); + s[49] = b49 ^ (~b41 & b43); + + s[0] ^= ROUND_CONST[n + 0]; + s[1] ^= ROUND_CONST[n + 1]; + } + } + + static hash() { + return new Keccak(); + } + + static hmac(bits, pad, len) { + if (bits == null) + bits = 256; + + assert((bits >>> 0) === bits); + + const rate = 1600 - bits * 2; + + assert(rate >= 0 && (rate & 63) === 0); + + return new HMAC(Keccak, rate >>> 3, [bits], [pad, len]); + } + + static digest(data, bits, pad, len) { + return Keccak.ctx.init(bits).update(data).final(pad, len); + } + + static root(left, right, bits, pad, len) { + if (bits == null) + bits = 256; + + if (len == null) + len = 0; + + if (len === 0) + len = bits >>> 3; + + assert((bits >>> 0) === bits); + assert((bits & 7) === 0); + assert((len >>> 0) === len); + assert(bufferExports.Buffer.isBuffer(left) && left.length === len); + assert(bufferExports.Buffer.isBuffer(right) && right.length === len); + + return Keccak.ctx.init(bits).update(left).update(right).final(pad, len); + } + + static multi(x, y, z, bits, pad, len) { + const {ctx} = Keccak; + + ctx.init(bits); + ctx.update(x); + ctx.update(y); + + if (z) + ctx.update(z); + + return ctx.final(pad, len); + } + + static mac(data, key, bits, pad, len) { + return Keccak.hmac(bits, pad, len).init(key).update(data).final(); + } + } + + /* + * Static + */ + + Keccak.native = 0; + Keccak.id = 'KECCAK256'; + Keccak.size = 32; + Keccak.bits = 256; + Keccak.blockSize = 136; + Keccak.zero = bufferExports.Buffer.alloc(32, 0x00); + Keccak.ctx = new Keccak(); + + /* + * Helpers + */ + + function readU32(data, off) { + return (data[off++] + + data[off++] * 0x100 + + data[off++] * 0x10000 + + data[off] * 0x1000000); + } + + /* + * Expose + */ + + keccak = Keccak; + return keccak; + } + + /*! + * keccak.js - keccak for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var keccakBrowser; + var hasRequiredKeccakBrowser; + + function requireKeccakBrowser () { + if (hasRequiredKeccakBrowser) return keccakBrowser; + hasRequiredKeccakBrowser = 1; + + keccakBrowser = requireKeccak(); + return keccakBrowser; + } + + var shake; + var hasRequiredShake; + + function requireShake () { + if (hasRequiredShake) return shake; + hasRequiredShake = 1; + + const Keccak = requireKeccakBrowser(); + + /** + * SHAKE + */ + + class SHAKE extends Keccak { + /** + * Create a SHAKE Context. + * @constructor + */ + + constructor() { + super(); + } + + final(len) { + return super.final(0x1f, len); + } + + static hash() { + return new SHAKE(); + } + + static hmac(bits, len) { + return super.hmac(bits, 0x1f, len); + } + + static digest(data, bits, len) { + return super.digest(data, bits, 0x1f, len); + } + + static root(left, right, bits, len) { + return super.root(left, right, bits, 0x1f, len); + } + + static multi(x, y, z, bits, len) { + return super.multi(x, y, z, bits, 0x1f, len); + } + + static mac(data, key, bits, len) { + return super.mac(data, key, bits, 0x1f, len); + } + } + + /* + * Static + */ + + SHAKE.native = Keccak.native; + SHAKE.id = 'SHAKE256'; + SHAKE.size = 32; + SHAKE.bits = 256; + SHAKE.blockSize = 136; + SHAKE.zero = bufferExports.Buffer.alloc(32, 0x00); + SHAKE.ctx = new SHAKE(); + + /* + * Expose + */ + + shake = SHAKE; + return shake; + } + + var shake256; + var hasRequiredShake256; + + function requireShake256 () { + if (hasRequiredShake256) return shake256; + hasRequiredShake256 = 1; + + const SHAKE = requireShake(); + + /** + * SHAKE256 + */ + + class SHAKE256 extends SHAKE { + constructor() { + super(); + } + + init() { + return super.init(256); + } + + static hash() { + return new SHAKE256(); + } + + static hmac(len) { + return super.hmac(256, len); + } + + static digest(data, len) { + return super.digest(data, 256, len); + } + + static root(left, right, len) { + return super.root(left, right, 256, len); + } + + static multi(x, y, z, len) { + return super.multi(x, y, z, 256, len); + } + + static mac(data, key, len) { + return super.mac(data, key, 256, len); + } + } + + /* + * Static + */ + + SHAKE256.native = SHAKE.native; + SHAKE256.id = 'SHAKE256'; + SHAKE256.size = 32; + SHAKE256.bits = 256; + SHAKE256.blockSize = 136; + SHAKE256.zero = bufferExports.Buffer.alloc(32, 0x00); + SHAKE256.ctx = new SHAKE256(); + + /* + * Expose + */ + + shake256 = SHAKE256; + return shake256; + } + + /*! + * ed448.js - ed448 for bcrypto + * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + * + * Resources: + * https://eprint.iacr.org/2015/625.pdf + * https://tools.ietf.org/html/rfc8032#section-5.2 + */ + + var ed448$1; + var hasRequiredEd448; + + function requireEd448 () { + if (hasRequiredEd448) return ed448$1; + hasRequiredEd448 = 1; + + const EDDSA = requireEddsa(); + const SHAKE256 = requireShake256(); + + /* + * Expose + */ + + ed448$1 = new EDDSA('ED448', 'X448', 'MONT448', SHAKE256); + return ed448$1; + } + + /*! + * ed448.js - ed448 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var ed448Browser; + var hasRequiredEd448Browser; + + function requireEd448Browser () { + if (hasRequiredEd448Browser) return ed448Browser; + hasRequiredEd448Browser = 1; + + ed448Browser = requireEd448(); + return ed448Browser; + } + + var ed448BrowserExports = requireEd448Browser(); + var backend = /*@__PURE__*/getDefaultExportFromCjs(ed448BrowserExports); + + // bcrypto does not ship TypeScript declarations. + // @ts-ignore + const ed448 = backend; + + /** + * Some mathematic operations. + * + * @_subsection: api/utils:Math Helpers [about-maths] + */ + const BN_0$9 = BigInt(0); + const BN_1$5 = BigInt(1); + //const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; + // IEEE 754 support 53-bits of mantissa + const maxValue = 0x1fffffffffffff; + /** + * Convert %%value%% from a twos-compliment representation of %%width%% + * bits to its value. + * + * If the highest bit is ``1``, the result will be negative. + */ + function fromTwos(_value, _width) { + const value = getUint(_value, "value"); + const width = BigInt(getNumber(_width, "width")); + assert(value >> width === BN_0$9, "overflow", "NUMERIC_FAULT", { + operation: "fromTwos", + fault: "overflow", + value: _value, + }); + // Top bit set; treat as a negative value + if (value >> (width - BN_1$5)) { + const mask = (BN_1$5 << width) - BN_1$5; + return -((~value & mask) + BN_1$5); + } + return value; + } + /** + * Convert %%value%% to a twos-compliment representation of + * %%width%% bits. + * + * The result will always be positive. + */ + function toTwos(_value, _width) { + let value = getBigInt(_value, "value"); + const width = BigInt(getNumber(_width, "width")); + const limit = BN_1$5 << (width - BN_1$5); + if (value < BN_0$9) { + value = -value; + assert(value <= limit, "too low", "NUMERIC_FAULT", { + operation: "toTwos", + fault: "overflow", + value: _value, + }); + const mask = (BN_1$5 << width) - BN_1$5; + return (~value & mask) + BN_1$5; + } + else { + assert(value < limit, "too high", "NUMERIC_FAULT", { + operation: "toTwos", + fault: "overflow", + value: _value, + }); + } + return value; + } + /** + * Mask %%value%% with a bitmask of %%bits%% ones. + */ + function mask(_value, _bits) { + const value = getUint(_value, "value"); + const bits = BigInt(getNumber(_bits, "bits")); + return value & ((BN_1$5 << bits) - BN_1$5); + } + /** + * Gets a BigInt from %%value%%. If it is an invalid value for + * a BigInt, then an ArgumentError will be thrown for %%name%%. + */ + function getBigInt(value, name) { + switch (typeof value) { + case "bigint": + return value; + case "number": + assertArgument(Number.isInteger(value), "underflow", name || "value", value); + assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); + return BigInt(value); + case "string": + try { + if (value === "") { + throw new Error("empty string"); + } + if (value[0] === "-" && value[1] !== "-") { + return -BigInt(value.substring(1)); + } + return BigInt(value); + } + catch (e) { + assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); + } + } + assertArgument(false, "invalid BigNumberish value", name || "value", value); + } + function getUint(value, name) { + const result = getBigInt(value, name); + assert(result >= BN_0$9, "unsigned value cannot be negative", "NUMERIC_FAULT", { + fault: "overflow", + operation: "getUint", + value, + }); + return result; + } + const Nibbles = "0123456789abcdef"; + /* + * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it + * is treated as Big Endian data. + */ + function toBigInt(value) { + if (value instanceof Uint8Array) { + let result = "0x0"; + for (const v of value) { + result += Nibbles[v >> 4]; + result += Nibbles[v & 0x0f]; + } + return BigInt(result); + } + return getBigInt(value); + } + /** + * Gets a //number// from %%value%%. If it is an invalid value for + * a //number//, then an ArgumentError will be thrown for %%name%%. + */ + function getNumber(value, name) { + switch (typeof value) { + case "bigint": + assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); + return Number(value); + case "number": + assertArgument(Number.isInteger(value), "underflow", name || "value", value); + assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); + return value; + case "string": + try { + if (value === "") { + throw new Error("empty string"); + } + return getNumber(BigInt(value), name); + } + catch (e) { + assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); + } + } + assertArgument(false, "invalid numeric value", name || "value", value); + } + /** + * Converts %%value%% to a number. If %%value%% is a Uint8Array, it + * is treated as Big Endian data. Throws if the value is not safe. + */ + function toNumber(value) { + return getNumber(toBigInt(value)); + } + /** + * Converts %%value%% to a Big Endian hexstring, optionally padded to + * %%width%% bytes. + */ + function toBeHex(_value, _width) { + const value = getUint(_value, "value"); + let result = value.toString(16); + if (_width == null) { + // Ensure the value is of even length + if (result.length % 2) { + result = "0" + result; + } + } + else { + const width = getNumber(_width, "width"); + assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, "NUMERIC_FAULT", { + operation: "toBeHex", + fault: "overflow", + value: _value, + }); + // Pad the value to the required width + while (result.length < width * 2) { + result = "0" + result; + } + } + return "0x" + result; + } + /** + * Converts %%value%% to a Big Endian Uint8Array. + */ + function toBeArray(_value) { + const value = getUint(_value, "value"); + if (value === BN_0$9) { + return new Uint8Array([]); + } + let hex = value.toString(16); + if (hex.length % 2) { + hex = "0" + hex; + } + const result = new Uint8Array(hex.length / 2); + for (let i = 0; i < result.length; i++) { + const offset = i * 2; + result[i] = parseInt(hex.substring(offset, offset + 2), 16); + } + return result; + } + /** + * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. + * + * A //Quantity// does not have and leading 0 values unless the value is + * the literal value `0x0`. This is most commonly used for JSSON-RPC + * numeric values. + */ + function toQuantity(value) { + let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); + while (result.startsWith("0")) { + result = result.substring(1); + } + if (result === "") { + result = "0"; + } + return "0x" + result; + } + + /** + * The [Base58 Encoding](link-base58) scheme allows a **numeric** value + * to be encoded as a compact string using a radix of 58 using only + * alpha-numeric characters. Confusingly similar characters are omitted + * (i.e. ``"l0O"``). + * + * Note that Base58 encodes a **numeric** value, not arbitrary bytes, + * since any zero-bytes on the left would get removed. To mitigate this + * issue most schemes that use Base58 choose specific high-order values + * to ensure non-zero prefixes. + * + * @_subsection: api/utils:Base58 Encoding [about-base58] + */ + const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; + let Lookup = null; + function getAlpha(letter) { + if (Lookup == null) { + Lookup = {}; + for (let i = 0; i < Alphabet.length; i++) { + Lookup[Alphabet[i]] = BigInt(i); + } + } + const result = Lookup[letter]; + assertArgument(result != null, `invalid base58 value`, "letter", letter); + return result; + } + const BN_0$8 = BigInt(0); + const BN_58 = BigInt(58); + /** + * Encode %%value%% as a Base58-encoded string. + */ + function encodeBase58(_value) { + let value = toBigInt(getBytes(_value)); + let result = ""; + while (value) { + result = Alphabet[Number(value % BN_58)] + result; + value /= BN_58; + } + return result; + } + /** + * Decode the Base58-encoded %%value%%. + */ + function decodeBase58(value) { + let result = BN_0$8; + for (let i = 0; i < value.length; i++) { + result *= BN_58; + result += getAlpha(value[i]); + } + return result; + } + + // utils/base64-browser + function decodeBase64(textData) { + textData = atob(textData); + const data = new Uint8Array(textData.length); + for (let i = 0; i < textData.length; i++) { + data[i] = textData.charCodeAt(i); + } + return getBytes(data); + } + function encodeBase64(_data) { + const data = getBytes(_data); + let textData = ""; + for (let i = 0; i < data.length; i++) { + textData += String.fromCharCode(data[i]); + } + return btoa(textData); + } + + /** + * Explain events... + * + * @_section api/utils/events:Events [about-events] + */ + /** + * When an [[EventEmitterable]] triggers a [[Listener]], the + * callback always ahas one additional argument passed, which is + * an **EventPayload**. + */ + class EventPayload { + /** + * The event filter. + */ + filter; + /** + * The **EventEmitterable**. + */ + emitter; + #listener; + /** + * Create a new **EventPayload** for %%emitter%% with + * the %%listener%% and for %%filter%%. + */ + constructor(emitter, listener, filter) { + this.#listener = listener; + defineProperties(this, { emitter, filter }); + } + /** + * Unregister the triggered listener for future events. + */ + async removeListener() { + if (this.#listener == null) { + return; + } + await this.emitter.off(this.filter, this.#listener); + } + } + + /** + * Using strings in Core (or any security-basd system) requires + * additional care. These utilities attempt to mitigate some of the + * safety issues as well as provide the ability to recover and analyse + * strings. + * + * @_subsection api/utils:Strings and UTF-8 [about-strings] + */ + function errorFunc(reason, offset, bytes, output, badCodepoint) { + assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); + } + function ignoreFunc(reason, offset, bytes, output, badCodepoint) { + // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes + if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { + let i = 0; + for (let o = offset + 1; o < bytes.length; o++) { + if (bytes[o] >> 6 !== 0x02) { + break; + } + i++; + } + return i; + } + // This byte runs us past the end of the string, so just jump to the end + // (but the first byte was read already read and therefore skipped) + if (reason === "OVERRUN") { + return bytes.length - offset - 1; + } + // Nothing to skip + return 0; + } + function replaceFunc(reason, offset, bytes, output, badCodepoint) { + // Overlong representations are otherwise "valid" code points; just non-deistingtished + if (reason === "OVERLONG") { + assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); + output.push(badCodepoint); + return 0; + } + // Put the replacement character into the output + output.push(0xfffd); + // Otherwise, process as if ignoring errors + return ignoreFunc(reason, offset, bytes); + } + /** + * A handful of popular, built-in UTF-8 error handling strategies. + * + * **``"error"``** - throws on ANY illegal UTF-8 sequence or + * non-canonical (overlong) codepoints (this is the default) + * + * **``"ignore"``** - silently drops any illegal UTF-8 sequence + * and accepts non-canonical (overlong) codepoints + * + * **``"replace"``** - replace any illegal UTF-8 sequence with the + * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts + * non-canonical (overlong) codepoints + * + * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> + */ + const Utf8ErrorFuncs = Object.freeze({ + error: errorFunc, + ignore: ignoreFunc, + replace: replaceFunc, + }); + // http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 + function getUtf8CodePoints(_bytes, onError) { + if (onError == null) { + onError = Utf8ErrorFuncs.error; + } + const bytes = getBytes(_bytes, "bytes"); + const result = []; + let i = 0; + // Invalid bytes are ignored + while (i < bytes.length) { + const c = bytes[i++]; + // 0xxx xxxx + if (c >> 7 === 0) { + result.push(c); + continue; + } + // Multibyte; how many bytes left for this character? + let extraLength = null; + let overlongMask = null; + // 110x xxxx 10xx xxxx + if ((c & 0xe0) === 0xc0) { + extraLength = 1; + overlongMask = 0x7f; + // 1110 xxxx 10xx xxxx 10xx xxxx + } + else if ((c & 0xf0) === 0xe0) { + extraLength = 2; + overlongMask = 0x7ff; + // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx + } + else if ((c & 0xf8) === 0xf0) { + extraLength = 3; + overlongMask = 0xffff; + } + else { + if ((c & 0xc0) === 0x80) { + i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); + } + else { + i += onError("BAD_PREFIX", i - 1, bytes, result); + } + continue; + } + // Do we have enough bytes in our data? + if (i - 1 + extraLength >= bytes.length) { + i += onError("OVERRUN", i - 1, bytes, result); + continue; + } + // Remove the length prefix from the char + let res = c & ((1 << (8 - extraLength - 1)) - 1); + for (let j = 0; j < extraLength; j++) { + let nextChar = bytes[i]; + // Invalid continuation byte + if ((nextChar & 0xc0) != 0x80) { + i += onError("MISSING_CONTINUE", i, bytes, result); + res = null; + break; + } + res = (res << 6) | (nextChar & 0x3f); + i++; + } + // See above loop for invalid continuation byte + if (res === null) { + continue; + } + // Maximum code point + if (res > 0x10ffff) { + i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); + continue; + } + // Reserved for UTF-16 surrogate halves + if (res >= 0xd800 && res <= 0xdfff) { + i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); + continue; + } + // Check for overlong sequences (more bytes than needed) + if (res <= overlongMask) { + i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); + continue; + } + result.push(res); + } + return result; + } + // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array + /** + * Returns the UTF-8 byte representation of %%str%%. + * + * If %%form%% is specified, the string is normalized. + */ + function toUtf8Bytes(str, form) { + if (form != null) { + assertNormalize(form); + str = str.normalize(form); + } + let result = []; + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + if (c < 0x80) { + result.push(c); + } + else if (c < 0x800) { + result.push((c >> 6) | 0xc0); + result.push((c & 0x3f) | 0x80); + } + else if ((c & 0xfc00) == 0xd800) { + i++; + const c2 = str.charCodeAt(i); + assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); + // Surrogate Pair + const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); + result.push((pair >> 18) | 0xf0); + result.push(((pair >> 12) & 0x3f) | 0x80); + result.push(((pair >> 6) & 0x3f) | 0x80); + result.push((pair & 0x3f) | 0x80); + } + else { + result.push((c >> 12) | 0xe0); + result.push(((c >> 6) & 0x3f) | 0x80); + result.push((c & 0x3f) | 0x80); + } + } + return new Uint8Array(result); + } + //export + function _toUtf8String(codePoints) { + return codePoints + .map((codePoint) => { + if (codePoint <= 0xffff) { + return String.fromCharCode(codePoint); + } + codePoint -= 0x10000; + return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00); + }) + .join(""); + } + /** + * Returns the string represented by the UTF-8 data %%bytes%%. + * + * When %%onError%% function is specified, it is called on UTF-8 + * errors allowing recovery using the [[Utf8ErrorFunc]] API. + * (default: [error](Utf8ErrorFuncs)) + */ + function toUtf8String(bytes, onError) { + return _toUtf8String(getUtf8CodePoints(bytes, onError)); + } + /** + * Returns the UTF-8 code-points for %%str%%. + * + * If %%form%% is specified, the string is normalized. + */ + function toUtf8CodePoints(str, form) { + return getUtf8CodePoints(toUtf8Bytes(str, form)); + } + + // @TODO: timeout is completely ignored; start a Promise.any with a reject? + // @ts-ignore + async function getUrl(req, _signal) { + const protocol = req.url.split(":")[0].toLowerCase(); + assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { + info: { protocol }, + operation: "request", + }); + assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { + operation: "request", + }); + let signal = undefined; + if (_signal) { + const controller = new AbortController(); + signal = controller.signal; + _signal.addListener(() => { + controller.abort(); + }); + } + const init = { + method: req.method, + headers: new Headers(Array.from(req)), + body: req.body || undefined, + signal, + }; + try { + const resp = await fetch(req.url, init); + const headers = {}; + resp.headers.forEach((value, key) => { + headers[key.toLowerCase()] = value; + }); + const respBody = await resp.arrayBuffer(); + const body = respBody == null ? null : new Uint8Array(respBody); + return { + statusCode: resp.status, + statusMessage: resp.statusText, + headers, + body, + }; + } + catch (error) { + console.log({ error }); + return undefined; + } + } + + /** + * Explain fetching here... + * + * @_section api/utils/fetching:Fetching Web Content [about-fetch] + */ + const MAX_ATTEMPTS = 12; + const SLOT_INTERVAL = 250; + // The global FetchGetUrlFunc implementation. + let getUrlFunc = getUrl; + const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); + const reIpfs = new RegExp("^ipfs://(ipfs/)?(.*)$", "i"); + // If locked, new Gateways cannot be added + let locked$5 = false; + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs + async function dataGatewayFunc(url, signal) { + try { + const match = url.match(reData); + if (!match) { + throw new Error("invalid data"); + } + return new FetchResponse(200, "OK", { + "content-type": match[1] || "text/plain", + }, match[2] ? decodeBase64(match[3]) : unpercent(match[3])); + } + catch (error) { + return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); + } + } + /** + * Returns a [[FetchGatewayFunc]] for fetching content from a standard + * IPFS gateway hosted at %%baseUrl%%. + */ + function getIpfsGatewayFunc(baseUrl) { + async function gatewayIpfs(url, signal) { + try { + const match = url.match(reIpfs); + if (!match) { + throw new Error("invalid link"); + } + return new FetchRequest(`${baseUrl}${match[2]}`); + } + catch (error) { + return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); + } + } + return gatewayIpfs; + } + const Gateways = { + data: dataGatewayFunc, + ipfs: getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/"), + }; + const fetchSignals = new WeakMap(); + /** + * @_ignore + */ + class FetchCancelSignal { + #listeners; + #cancelled; + constructor(request) { + this.#listeners = []; + this.#cancelled = false; + fetchSignals.set(request, () => { + if (this.#cancelled) { + return; + } + this.#cancelled = true; + for (const listener of this.#listeners) { + setTimeout(() => { + listener(); + }, 0); + } + this.#listeners = []; + }); + } + addListener(listener) { + assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { + operation: "fetchCancelSignal.addCancelListener", + }); + this.#listeners.push(listener); + } + get cancelled() { + return this.#cancelled; + } + checkSignal() { + assert(!this.cancelled, "cancelled", "CANCELLED", {}); + } + } + // Check the signal, throwing if it is cancelled + function checkSignal(signal) { + if (signal == null) { + throw new Error("missing signal; should not happen"); + } + signal.checkSignal(); + return signal; + } + /** + * Represents a request for a resource using a URI. + * + * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, + * and ``IPFS:``. + * + * Additional schemes can be added globally using [[registerGateway]]. + * + * @example: + * req = new FetchRequest("https://www.ricmoo.com") + * resp = await req.send() + * resp.body.length + * //_result: + */ + class FetchRequest { + #allowInsecure; + #gzip; + #headers; + #method; + #timeout; + #url; + #body; + #bodyType; + #creds; + // Hooks + #preflight; + #process; + #retry; + #signal; + #throttle; + /** + * The fetch URI to requrest. + */ + get url() { + return this.#url; + } + set url(url) { + this.#url = String(url); + } + /** + * The fetch body, if any, to send as the request body. //(default: null)// + * + * When setting a body, the intrinsic ``Content-Type`` is automatically + * set and will be used if **not overridden** by setting a custom + * header. + * + * If %%body%% is null, the body is cleared (along with the + * intrinsic ``Content-Type``) and the . + * + * If %%body%% is a string, the intrincis ``Content-Type`` is set to + * ``text/plain``. + * + * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to + * ``application/octet-stream``. + * + * If %%body%% is any other object, the intrincis ``Content-Type`` is + * set to ``application/json``. + */ + get body() { + if (this.#body == null) { + return null; + } + return new Uint8Array(this.#body); + } + set body(body) { + if (body == null) { + this.#body = undefined; + this.#bodyType = undefined; + } + else if (typeof body === "string") { + this.#body = toUtf8Bytes(body); + this.#bodyType = "text/plain"; + } + else if (body instanceof Uint8Array) { + this.#body = body; + this.#bodyType = "application/octet-stream"; + } + else if (typeof body === "object") { + this.#body = toUtf8Bytes(JSON.stringify(body)); + this.#bodyType = "application/json"; + } + else { + throw new Error("invalid body"); + } + } + /** + * Returns true if the request has a body. + */ + hasBody() { + return this.#body != null; + } + /** + * The HTTP method to use when requesting the URI. If no method + * has been explicitly set, then ``GET`` is used if the body is + * null and ``POST`` otherwise. + */ + get method() { + if (this.#method) { + return this.#method; + } + if (this.hasBody()) { + return "POST"; + } + return "GET"; + } + set method(method) { + if (method == null) { + method = ""; + } + this.#method = String(method).toUpperCase(); + } + /** + * The headers that will be used when requesting the URI. All + * keys are lower-case. + * + * This object is a copy, so any chnages will **NOT** be reflected + * in the ``FetchRequest``. + * + * To set a header entry, use the ``setHeader`` method. + */ + get headers() { + const headers = Object.assign({}, this.#headers); + if (this.#creds) { + headers["authorization"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`; + } + if (this.allowGzip) { + headers["accept-encoding"] = "gzip"; + } + if (headers["content-type"] == null && this.#bodyType) { + headers["content-type"] = this.#bodyType; + } + if (this.body) { + headers["content-length"] = String(this.body.length); + } + return headers; + } + /** + * Get the header for %%key%%, ignoring case. + */ + getHeader(key) { + return this.headers[key.toLowerCase()]; + } + /** + * Set the header for %%key%% to %%value%%. All values are coerced + * to a string. + */ + setHeader(key, value) { + this.#headers[String(key).toLowerCase()] = String(value); + } + /** + * Clear all headers, resetting all intrinsic headers. + */ + clearHeaders() { + this.#headers = {}; + } + [Symbol.iterator]() { + const headers = this.headers; + const keys = Object.keys(headers); + let index = 0; + return { + next: () => { + if (index < keys.length) { + const key = keys[index++]; + return { + value: [key, headers[key]], + done: false, + }; + } + return { value: undefined, done: true }; + }, + }; + } + /** + * The value that will be sent for the ``Authorization`` header. + * + * To set the credentials, use the ``setCredentials`` method. + */ + get credentials() { + return this.#creds || null; + } + /** + * Sets an ``Authorization`` for %%username%% with %%password%%. + */ + setCredentials(username, password) { + assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); + this.#creds = `${username}:${password}`; + } + /** + * Enable and request gzip-encoded responses. The response will + * automatically be decompressed. //(default: true)// + */ + get allowGzip() { + return this.#gzip; + } + set allowGzip(value) { + this.#gzip = !!value; + } + /** + * Allow ``Authentication`` credentials to be sent over insecure + * channels. //(default: false)// + */ + get allowInsecureAuthentication() { + return !!this.#allowInsecure; + } + set allowInsecureAuthentication(value) { + this.#allowInsecure = !!value; + } + /** + * The timeout (in milliseconds) to wait for a complere response. + * //(default: 5 minutes)// + */ + get timeout() { + return this.#timeout; + } + set timeout(timeout) { + assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); + this.#timeout = timeout; + } + /** + * This function is called prior to each request, for example + * during a redirection or retry in case of server throttling. + * + * This offers an opportunity to populate headers or update + * content before sending a request. + */ + get preflightFunc() { + return this.#preflight || null; + } + set preflightFunc(preflight) { + this.#preflight = preflight; + } + /** + * This function is called after each response, offering an + * opportunity to provide client-level throttling or updating + * response data. + * + * Any error thrown in this causes the ``send()`` to throw. + * + * To schedule a retry attempt (assuming the maximum retry limit + * has not been reached), use [[response.throwThrottleError]]. + */ + get processFunc() { + return this.#process || null; + } + set processFunc(process) { + this.#process = process; + } + /** + * This function is called on each retry attempt. + */ + get retryFunc() { + return this.#retry || null; + } + set retryFunc(retry) { + this.#retry = retry; + } + /** + * Create a new FetchRequest instance with default values. + * + * Once created, each property may be set before issuing a + * ``.send()`` to make the request. + */ + constructor(url) { + this.#url = String(url); + this.#allowInsecure = false; + this.#gzip = true; + this.#headers = {}; + this.#method = ""; + this.#timeout = 300000; + this.#throttle = { + slotInterval: SLOT_INTERVAL, + maxAttempts: MAX_ATTEMPTS, + }; + } + toString() { + return ``; + } + /** + * Update the throttle parameters used to determine maximum + * attempts and exponential-backoff properties. + */ + setThrottleParams(params) { + if (params.slotInterval != null) { + this.#throttle.slotInterval = params.slotInterval; + } + if (params.maxAttempts != null) { + this.#throttle.maxAttempts = params.maxAttempts; + } + } + async #send(attempt, expires, delay, _request, _response) { + if (attempt >= this.#throttle.maxAttempts) { + return _response.makeServerError("exceeded maximum retry limit"); + } + assert(getTime$2() <= expires, "timeout", "TIMEOUT", { + operation: "request.send", + reason: "timeout", + request: _request, + }); + if (delay > 0) { + await wait(delay); + } + let req = this.clone(); + const scheme = (req.url.split(":")[0] || "").toLowerCase(); + // Process any Gateways + if (scheme in Gateways) { + const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); + if (result instanceof FetchResponse) { + let response = result; + if (this.processFunc) { + checkSignal(_request.#signal); + try { + response = await this.processFunc(req, response); + } + catch (error) { + // Something went wrong during processing; throw a 5xx server error + if (error.throttle == null || typeof error.stall !== "number") { + response + .makeServerError("error in post-processing function", error) + .assertOk(); + } + // Ignore throttling + } + } + return response; + } + req = result; + } + // We have a preflight function; update the request + if (this.preflightFunc) { + req = await this.preflightFunc(req); + } + const resp = await getUrlFunc(req, checkSignal(_request.#signal)); + let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); + if (response.statusCode === 301 || response.statusCode === 302) { + // Redirect + try { + const location = response.headers.location || ""; + return req + .redirect(location) + .#send(attempt + 1, expires, 0, _request, response); + } + catch (error) { } + // Things won't get any better on another attempt; abort + return response; + } + else if (response.statusCode === 429) { + // Throttle + if (this.retryFunc == null || + (await this.retryFunc(req, response, attempt))) { + const retryAfter = response.headers["retry-after"]; + let delay = this.#throttle.slotInterval * + Math.trunc(Math.random() * Math.pow(2, attempt)); + if (typeof retryAfter === "string" && + retryAfter.match(/^[1-9][0-9]*$/)) { + delay = parseInt(retryAfter); + } + return req + .clone() + .#send(attempt + 1, expires, delay, _request, response); + } + } + if (this.processFunc) { + checkSignal(_request.#signal); + try { + response = await this.processFunc(req, response); + } + catch (error) { + // Something went wrong during processing; throw a 5xx server error + if (error.throttle == null || typeof error.stall !== "number") { + response + .makeServerError("error in post-processing function", error) + .assertOk(); + } + // Throttle + let delay = this.#throttle.slotInterval * + Math.trunc(Math.random() * Math.pow(2, attempt)); + if (error.stall >= 0) { + delay = error.stall; + } + return req + .clone() + .#send(attempt + 1, expires, delay, _request, response); + } + } + return response; + } + /** + * Resolves to the response by sending the request. + */ + send() { + assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); + this.#signal = new FetchCancelSignal(this); + return this.#send(0, getTime$2() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); + } + /** + * Cancels the inflight response, causing a ``CANCELLED`` + * error to be rejected from the [[send]]. + */ + cancel() { + assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); + const signal = fetchSignals.get(this); + if (!signal) { + throw new Error("missing signal; should not happen"); + } + signal(); + } + /** + * Returns a new [[FetchRequest]] that represents the redirection + * to %%location%%. + */ + redirect(location) { + // Redirection; for now we only support absolute locataions + const current = this.url.split(":")[0].toLowerCase(); + const target = location.split(":")[0].toLowerCase(); + // Don't allow redirecting: + // - non-GET requests + // - downgrading the security (e.g. https => http) + // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] + assert(this.method === "GET" && + (current !== "https" || target !== "http") && + location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { + operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`, + }); + // Create a copy of this request, with a new URL + const req = new FetchRequest(location); + req.method = "GET"; + req.allowGzip = this.allowGzip; + req.timeout = this.timeout; + req.#headers = Object.assign({}, this.#headers); + if (this.#body) { + req.#body = new Uint8Array(this.#body); + } + req.#bodyType = this.#bodyType; + // Do not forward credentials unless on the same domain; only absolute + //req.allowInsecure = false; + // paths are currently supported; may want a way to specify to forward? + //setStore(req.#props, "creds", getStore(this.#pros, "creds")); + return req; + } + /** + * Create a new copy of this request. + */ + clone() { + const clone = new FetchRequest(this.url); + // Preserve "default method" (i.e. null) + clone.#method = this.#method; + // Preserve "default body" with type, copying the Uint8Array is present + if (this.#body) { + clone.#body = this.#body; + } + clone.#bodyType = this.#bodyType; + // Preserve "default headers" + clone.#headers = Object.assign({}, this.#headers); + // Credentials is readonly, so we copy internally + clone.#creds = this.#creds; + if (this.allowGzip) { + clone.allowGzip = true; + } + clone.timeout = this.timeout; + if (this.allowInsecureAuthentication) { + clone.allowInsecureAuthentication = true; + } + clone.#preflight = this.#preflight; + clone.#process = this.#process; + clone.#retry = this.#retry; + return clone; + } + /** + * Locks all static configuration for gateways and FetchGetUrlFunc + * registration. + */ + static lockConfig() { + locked$5 = true; + } + /** + * Get the current Gateway function for %%scheme%%. + */ + static getGateway(scheme) { + return Gateways[scheme.toLowerCase()] || null; + } + /** + * Use the %%func%% when fetching URIs using %%scheme%%. + * + * This method affects all requests globally. + * + * If [[lockConfig]] has been called, no change is made and this + * throws. + */ + static registerGateway(scheme, func) { + scheme = scheme.toLowerCase(); + if (scheme === "http" || scheme === "https") { + throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); + } + if (locked$5) { + throw new Error("gateways locked"); + } + Gateways[scheme] = func; + } + /** + * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. + * + * This method affects all requests globally. + * + * If [[lockConfig]] has been called, no change is made and this + * throws. + */ + static registerGetUrl(getUrl) { + if (locked$5) { + throw new Error("gateways locked"); + } + getUrlFunc = getUrl; + } + /** + * Creates a function that can "fetch" data URIs. + * + * Note that this is automatically done internally to support + * data URIs, so it is not necessary to register it. + * + * This is not generally something that is needed, but may + * be useful in a wrapper to perfom custom data URI functionality. + */ + static createDataGateway() { + return dataGatewayFunc; + } + /** + * Creates a function that will fetch IPFS (unvalidated) from + * a custom gateway baseUrl. + * + * The default IPFS gateway used internally is + * ``"https:/\/gateway.ipfs.io/ipfs/"``. + */ + static createIpfsGatewayFunc(baseUrl) { + return getIpfsGatewayFunc(baseUrl); + } + } + /** + * The response for a FetchREquest. + */ + class FetchResponse { + #statusCode; + #statusMessage; + #headers; + #body; + #request; + #error; + toString() { + return ``; + } + /** + * The response status code. + */ + get statusCode() { + return this.#statusCode; + } + /** + * The response status message. + */ + get statusMessage() { + return this.#statusMessage; + } + /** + * The response headers. All keys are lower-case. + */ + get headers() { + return Object.assign({}, this.#headers); + } + /** + * The response body, or ``null`` if there was no body. + */ + get body() { + return this.#body == null ? null : new Uint8Array(this.#body); + } + /** + * The response body as a UTF-8 encoded string, or the empty + * string (i.e. ``""``) if there was no body. + * + * An error is thrown if the body is invalid UTF-8 data. + */ + get bodyText() { + try { + return this.#body == null ? "" : toUtf8String(this.#body); + } + catch (error) { + assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { + operation: "bodyText", + info: { response: this }, + }); + } + } + /** + * The response body, decoded as JSON. + * + * An error is thrown if the body is invalid JSON-encoded data + * or if there was no body. + */ + get bodyJson() { + try { + return JSON.parse(this.bodyText); + } + catch (error) { + assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { + operation: "bodyJson", + info: { response: this }, + }); + } + } + [Symbol.iterator]() { + const headers = this.headers; + const keys = Object.keys(headers); + let index = 0; + return { + next: () => { + if (index < keys.length) { + const key = keys[index++]; + return { + value: [key, headers[key]], + done: false, + }; + } + return { value: undefined, done: true }; + }, + }; + } + constructor(statusCode, statusMessage, headers, body, request) { + this.#statusCode = statusCode; + this.#statusMessage = statusMessage; + this.#headers = Object.keys(headers).reduce((accum, k) => { + accum[k.toLowerCase()] = String(headers[k]); + return accum; + }, {}); + this.#body = body == null ? null : new Uint8Array(body); + this.#request = request || null; + this.#error = { message: "" }; + } + /** + * Return a Response with matching headers and body, but with + * an error status code (i.e. 599) and %%message%% with an + * optional %%error%%. + */ + makeServerError(message, error) { + let statusMessage; + if (!message) { + message = `${this.statusCode} ${this.statusMessage}`; + statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; + } + else { + statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; + } + const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); + response.#error = { message, error }; + return response; + } + /** + * If called within a [request.processFunc](FetchRequest-processFunc) + * call, causes the request to retry as if throttled for %%stall%% + * milliseconds. + */ + throwThrottleError(message, stall) { + if (stall == null) { + stall = -1; + } + else { + assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); + } + const error = new Error(message || "throttling requests"); + defineProperties(error, { stall, throttle: true }); + throw error; + } + /** + * Get the header value for %%key%%, ignoring case. + */ + getHeader(key) { + return this.headers[key.toLowerCase()]; + } + /** + * Returns true of the response has a body. + */ + hasBody() { + return this.#body != null; + } + /** + * The request made for this response. + */ + get request() { + return this.#request; + } + /** + * Returns true if this response was a success statusCode. + */ + ok() { + return (this.#error.message === "" && + this.statusCode >= 200 && + this.statusCode < 300); + } + /** + * Throws a ``SERVER_ERROR`` if this response is not ok. + */ + assertOk() { + if (this.ok()) { + return; + } + let { message, error } = this.#error; + if (message === "") { + message = `server response ${this.statusCode} ${this.statusMessage}`; + } + assert(false, message, "SERVER_ERROR", { + request: this.request || "unknown request", + response: this, + error, + }); + } + } + function getTime$2() { + return new Date().getTime(); + } + function unpercent(value) { + return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { + return String.fromCharCode(parseInt(code, 16)); + })); + } + function wait(delay) { + return new Promise((resolve) => setTimeout(resolve, delay)); + } + + var _a$1; + const BN_N1 = BigInt(-1); + const BN_0$7 = BigInt(0); + const BN_1$4 = BigInt(1); + const BN_5 = BigInt(5); + const _guard$5 = {}; + // Constant to pull zeros from for multipliers + let Zeros = "0000"; + while (Zeros.length < 80) { + Zeros += Zeros; + } + // Returns a string "1" followed by decimal "0"s + function getTens(decimals) { + let result = Zeros; + while (result.length < decimals) { + result += result; + } + return BigInt("1" + result.substring(0, decimals)); + } + function checkValue(val, format, safeOp) { + const width = BigInt(format.width); + if (format.signed) { + const limit = BN_1$4 << (width - BN_1$4); + assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { + operation: safeOp, + fault: "overflow", + value: val, + }); + if (val > BN_0$7) { + val = fromTwos(mask(val, width), width); + } + else { + val = -fromTwos(mask(-val, width), width); + } + } + else { + const limit = BN_1$4 << width; + assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { + operation: safeOp, + fault: "overflow", + value: val, + }); + val = (((val % limit) + limit) % limit) & (limit - BN_1$4); + } + return val; + } + function getFormat(value) { + if (typeof value === "number") { + value = `fixed128x${value}`; + } + let signed = true; + let width = 128; + let decimals = 18; + if (typeof value === "string") { + // Parse the format string + if (value === "fixed") ; + else if (value === "ufixed") { + signed = false; + } + else { + const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); + assertArgument(match, "invalid fixed format", "format", value); + signed = match[1] !== "u"; + width = parseInt(match[2]); + decimals = parseInt(match[3]); + } + } + else if (value) { + // Extract the values from the object + const v = value; + const check = (key, type, defaultValue) => { + if (v[key] == null) { + return defaultValue; + } + assertArgument(typeof v[key] === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); + return v[key]; + }; + signed = check("signed", "boolean", signed); + width = check("width", "number", width); + decimals = check("decimals", "number", decimals); + } + assertArgument(width % 8 === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); + assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); + const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); + return { signed, width, decimals, name }; + } + function toString(val, decimals) { + let negative = ""; + if (val < BN_0$7) { + negative = "-"; + val *= BN_N1; + } + let str = val.toString(); + // No decimal point for whole values + if (decimals === 0) { + return negative + str; + } + // Pad out to the whole component (including a whole digit) + while (str.length <= decimals) { + str = Zeros + str; + } + // Insert the decimal point + const index = str.length - decimals; + str = str.substring(0, index) + "." + str.substring(index); + // Trim the whole component (leaving at least one 0) + while (str[0] === "0" && str[1] !== ".") { + str = str.substring(1); + } + // Trim the decimal component (leaving at least one 0) + while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { + str = str.substring(0, str.length - 1); + } + return negative + str; + } + /** + * A FixedNumber represents a value over its [[FixedFormat]] + * arithmetic field. + * + * A FixedNumber can be used to perform math, losslessly, on + * values which have decmial places. + * + * A FixedNumber has a fixed bit-width to store values in, and stores all + * values internally by multiplying the value by 10 raised to the power of + * %%decimals%%. + * + * If operations are performed that cause a value to grow too high (close to + * positive infinity) or too low (close to negative infinity), the value + * is said to //overflow//. + * + * For example, an 8-bit signed value, with 0 decimals may only be within + * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become + * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. + * + * Many operation have a normal and //unsafe// variant. The normal variant + * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// + * variant will silently allow overflow, corrupting its value value. + * + * If operations are performed that cause a value to become too small + * (close to zero), the value loses precison and is said to //underflow//. + * + * For example, an value with 1 decimal place may store a number as small + * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit + * into 1 decimal place, so underflow occurs which means precision is lost + * and the value becomes ``0``. + * + * Some operations have a normal and //signalling// variant. The normal + * variant will silently ignore underflow, while the //signalling// variant + * will thow a [[NumericFaultError]] on underflow. + */ + class FixedNumber { + /** + * The specific fixed-point arithmetic field for this value. + */ + format; + #format; + // The actual value (accounting for decimals) + #val; + // A base-10 value to multiple values by to maintain the magnitude + #tens; + /** + * This is a property so console.log shows a human-meaningful value. + * + * @private + */ + _value; + // Use this when changing this file to get some typing info, + // but then switch to any to mask the internal type + //constructor(guard: any, value: bigint, format: _FixedFormat) { + /** + * @private + */ + constructor(guard, value, format) { + assertPrivate(guard, _guard$5, "FixedNumber"); + this.#val = value; + this.#format = format; + const _value = toString(value, format.decimals); + defineProperties(this, { format: format.name, _value }); + this.#tens = getTens(format.decimals); + } + /** + * If true, negative values are permitted, otherwise only + * positive values and zero are allowed. + */ + get signed() { + return this.#format.signed; + } + /** + * The number of bits available to store the value. + */ + get width() { + return this.#format.width; + } + /** + * The number of decimal places in the fixed-point arithment field. + */ + get decimals() { + return this.#format.decimals; + } + /** + * The value as an integer, based on the smallest unit the + * [[decimals]] allow. + */ + get value() { + return this.#val; + } + #checkFormat(other) { + assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); + } + #checkValue(val, safeOp) { + /* + const width = BigInt(this.width); + if (this.signed) { + const limit = (BN_1 << (width - BN_1)); + assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { + operation: safeOp, fault: "overflow", value: val + }); + + if (val > BN_0) { + val = fromTwos(mask(val, width), width); + } else { + val = -fromTwos(mask(-val, width), width); + } + + } else { + const masked = mask(val, width); + assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { + operation: safeOp, fault: "overflow", value: val + }); + val = masked; + } + */ + val = checkValue(val, this.#format, safeOp); + return new _a$1(_guard$5, val, this.#format); + } + #add(o, safeOp) { + this.#checkFormat(o); + return this.#checkValue(this.#val + o.#val, safeOp); + } + /** + * Returns a new [[FixedNumber]] with the result of %%this%% added + * to %%other%%, ignoring overflow. + */ + addUnsafe(other) { + return this.#add(other); + } + /** + * Returns a new [[FixedNumber]] with the result of %%this%% added + * to %%other%%. A [[NumericFaultError]] is thrown if overflow + * occurs. + */ + add(other) { + return this.#add(other, "add"); + } + #sub(o, safeOp) { + this.#checkFormat(o); + return this.#checkValue(this.#val - o.#val, safeOp); + } + /** + * Returns a new [[FixedNumber]] with the result of %%other%% subtracted + * from %%this%%, ignoring overflow. + */ + subUnsafe(other) { + return this.#sub(other); + } + /** + * Returns a new [[FixedNumber]] with the result of %%other%% subtracted + * from %%this%%. A [[NumericFaultError]] is thrown if overflow + * occurs. + */ + sub(other) { + return this.#sub(other, "sub"); + } + #mul(o, safeOp) { + this.#checkFormat(o); + return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); + } + /** + * Returns a new [[FixedNumber]] with the result of %%this%% multiplied + * by %%other%%, ignoring overflow and underflow (precision loss). + */ + mulUnsafe(other) { + return this.#mul(other); + } + /** + * Returns a new [[FixedNumber]] with the result of %%this%% multiplied + * by %%other%%. A [[NumericFaultError]] is thrown if overflow + * occurs. + */ + mul(other) { + return this.#mul(other, "mul"); + } + /** + * Returns a new [[FixedNumber]] with the result of %%this%% multiplied + * by %%other%%. A [[NumericFaultError]] is thrown if overflow + * occurs or if underflow (precision loss) occurs. + */ + mulSignal(other) { + this.#checkFormat(other); + const value = this.#val * other.#val; + assert(value % this.#tens === BN_0$7, "precision lost during signalling mul", "NUMERIC_FAULT", { + operation: "mulSignal", + fault: "underflow", + value: this, + }); + return this.#checkValue(value / this.#tens, "mulSignal"); + } + #div(o, safeOp) { + assert(o.#val !== BN_0$7, "division by zero", "NUMERIC_FAULT", { + operation: "div", + fault: "divide-by-zero", + value: this, + }); + this.#checkFormat(o); + return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); + } + /** + * Returns a new [[FixedNumber]] with the result of %%this%% divided + * by %%other%%, ignoring underflow (precision loss). A + * [[NumericFaultError]] is thrown if overflow occurs. + */ + divUnsafe(other) { + return this.#div(other); + } + /** + * Returns a new [[FixedNumber]] with the result of %%this%% divided + * by %%other%%, ignoring underflow (precision loss). A + * [[NumericFaultError]] is thrown if overflow occurs. + */ + div(other) { + return this.#div(other, "div"); + } + /** + * Returns a new [[FixedNumber]] with the result of %%this%% divided + * by %%other%%. A [[NumericFaultError]] is thrown if underflow + * (precision loss) occurs. + */ + divSignal(other) { + assert(other.#val !== BN_0$7, "division by zero", "NUMERIC_FAULT", { + operation: "div", + fault: "divide-by-zero", + value: this, + }); + this.#checkFormat(other); + const value = this.#val * this.#tens; + assert(value % other.#val === BN_0$7, "precision lost during signalling div", "NUMERIC_FAULT", { + operation: "divSignal", + fault: "underflow", + value: this, + }); + return this.#checkValue(value / other.#val, "divSignal"); + } + /** + * Returns a comparison result between %%this%% and %%other%%. + * + * This is suitable for use in sorting, where ``-1`` implies %%this%% + * is smaller, ``1`` implies %%other%% is larger and ``0`` implies + * both are equal. + */ + cmp(other) { + let a = this.value, b = other.value; + // Coerce a and b to the same magnitude + const delta = this.decimals - other.decimals; + if (delta > 0) { + b *= getTens(delta); + } + else if (delta < 0) { + a *= getTens(-delta); + } + // Comnpare + if (a < b) { + return -1; + } + if (a > b) { + return -1; + } + return 0; + } + /** + * Returns true if %%other%% is equal to %%this%%. + */ + eq(other) { + return this.cmp(other) === 0; + } + /** + * Returns true if %%other%% is less than to %%this%%. + */ + lt(other) { + return this.cmp(other) < 0; + } + /** + * Returns true if %%other%% is less than or equal to %%this%%. + */ + lte(other) { + return this.cmp(other) <= 0; + } + /** + * Returns true if %%other%% is greater than to %%this%%. + */ + gt(other) { + return this.cmp(other) > 0; + } + /** + * Returns true if %%other%% is greater than or equal to %%this%%. + */ + gte(other) { + return this.cmp(other) >= 0; + } + /** + * Returns a new [[FixedNumber]] which is the largest **integer** + * that is less than or equal to %%this%%. + * + * The decimal component of the result will always be ``0``. + */ + floor() { + let val = this.#val; + if (this.#val < BN_0$7) { + val -= this.#tens - BN_1$4; + } + val = (this.#val / this.#tens) * this.#tens; + return this.#checkValue(val, "floor"); + } + /** + * Returns a new [[FixedNumber]] which is the smallest **integer** + * that is greater than or equal to %%this%%. + * + * The decimal component of the result will always be ``0``. + */ + ceiling() { + let val = this.#val; + if (this.#val > BN_0$7) { + val += this.#tens - BN_1$4; + } + val = (this.#val / this.#tens) * this.#tens; + return this.#checkValue(val, "ceiling"); + } + /** + * Returns a new [[FixedNumber]] with the decimal component + * rounded up on ties at %%decimals%% places. + */ + round(decimals) { + if (decimals == null) { + decimals = 0; + } + // Not enough precision to not already be rounded + if (decimals >= this.decimals) { + return this; + } + const delta = this.decimals - decimals; + const bump = BN_5 * getTens(delta - 1); + let value = this.value + bump; + const tens = getTens(delta); + value = (value / tens) * tens; + checkValue(value, this.#format, "round"); + return new _a$1(_guard$5, value, this.#format); + } + /** + * Returns true if %%this%% is equal to ``0``. + */ + isZero() { + return this.#val === BN_0$7; + } + /** + * Returns true if %%this%% is less than ``0``. + */ + isNegative() { + return this.#val < BN_0$7; + } + /** + * Returns the string representation of %%this%%. + */ + toString() { + return this._value; + } + /** + * Returns a float approximation. + * + * Due to IEEE 754 precission (or lack thereof), this function + * can only return an approximation and most values will contain + * rounding errors. + */ + toUnsafeFloat() { + return parseFloat(this.toString()); + } + /** + * Return a new [[FixedNumber]] with the same value but has had + * its field set to %%format%%. + * + * This will throw if the value cannot fit into %%format%%. + */ + toFormat(format) { + return _a$1.fromString(this.toString(), format); + } + /** + * Creates a new [[FixedNumber]] for %%value%% divided by + * %%decimal%% places with %%format%%. + * + * This will throw a [[NumericFaultError]] if %%value%% (once adjusted + * for %%decimals%%) cannot fit in %%format%%, either due to overflow + * or underflow (precision loss). + */ + static fromValue(_value, decimals, _format) { + if (decimals == null) { + decimals = 0; + } + const format = getFormat(_format); + let value = getBigInt(_value, "value"); + const delta = decimals - format.decimals; + if (delta > 0) { + const tens = getTens(delta); + assert(value % tens === BN_0$7, "value loses precision for format", "NUMERIC_FAULT", { + operation: "fromValue", + fault: "underflow", + value: _value, + }); + value /= tens; + } + else if (delta < 0) { + value *= getTens(-delta); + } + checkValue(value, format, "fromValue"); + return new _a$1(_guard$5, value, format); + } + /** + * Creates a new [[FixedNumber]] for %%value%% with %%format%%. + * + * This will throw a [[NumericFaultError]] if %%value%% cannot fit + * in %%format%%, either due to overflow or underflow (precision loss). + */ + static fromString(_value, _format) { + const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); + assertArgument(match && match[2].length + match[3].length > 0, "invalid FixedNumber string value", "value", _value); + const format = getFormat(_format); + let whole = match[2] || "0", decimal = match[3] || ""; + // Pad out the decimals + while (decimal.length < format.decimals) { + decimal += Zeros; + } + // Check precision is safe + assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { + operation: "fromString", + fault: "underflow", + value: _value, + }); + // Remove extra padding + decimal = decimal.substring(0, format.decimals); + const value = BigInt(match[1] + whole + decimal); + checkValue(value, format, "fromString"); + return new _a$1(_guard$5, value, format); + } + /** + * Creates a new [[FixedNumber]] with the big-endian representation + * %%value%% with %%format%%. + * + * This will throw a [[NumericFaultError]] if %%value%% cannot fit + * in %%format%% due to overflow. + */ + static fromBytes(_value, _format) { + let value = toBigInt(getBytes(_value, "value")); + const format = getFormat(_format); + if (format.signed) { + value = fromTwos(value, format.width); + } + checkValue(value, format, "fromBytes"); + return new _a$1(_guard$5, value, format); + } + } + _a$1 = FixedNumber; + //const f1 = FixedNumber.fromString("12.56", "fixed16x2"); + //const f2 = FixedNumber.fromString("0.3", "fixed16x2"); + //console.log(f1.divSignal(f2)); + //const BUMP = FixedNumber.from("0.5"); + + function hexlifyByte(value) { + let result = value.toString(16); + while (result.length < 2) { + result = "0" + result; + } + return "0x" + result; + } + function unarrayifyInteger(data, offset, length) { + let result = 0; + for (let i = 0; i < length; i++) { + result = result * 256 + data[offset + i]; + } + return result; + } + function _decodeChildren(data, offset, childOffset, length) { + const result = []; + while (childOffset < offset + 1 + length) { + const decoded = _decode(data, childOffset); + result.push(decoded.result); + childOffset += decoded.consumed; + assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { + buffer: data, + length, + offset, + }); + } + return { consumed: 1 + length, result: result }; + } + // returns { consumed: number, result: Object } + function _decode(data, offset) { + assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { + buffer: data, + length: 0, + offset: 1, + }); + const checkOffset = (offset) => { + assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { + buffer: data, + length: data.length, + offset, + }); + }; + // Array with extra length prefix + if (data[offset] >= 0xf8) { + const lengthLength = data[offset] - 0xf7; + checkOffset(offset + 1 + lengthLength); + const length = unarrayifyInteger(data, offset + 1, lengthLength); + checkOffset(offset + 1 + lengthLength + length); + return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); + } + else if (data[offset] >= 0xc0) { + const length = data[offset] - 0xc0; + checkOffset(offset + 1 + length); + return _decodeChildren(data, offset, offset + 1, length); + } + else if (data[offset] >= 0xb8) { + const lengthLength = data[offset] - 0xb7; + checkOffset(offset + 1 + lengthLength); + const length = unarrayifyInteger(data, offset + 1, lengthLength); + checkOffset(offset + 1 + lengthLength + length); + const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); + return { consumed: 1 + lengthLength + length, result: result }; + } + else if (data[offset] >= 0x80) { + const length = data[offset] - 0x80; + checkOffset(offset + 1 + length); + const result = hexlify(data.slice(offset + 1, offset + 1 + length)); + return { consumed: 1 + length, result: result }; + } + return { consumed: 1, result: hexlifyByte(data[offset]) }; + } + /** + * Decodes %%data%% into the structured data it represents. + */ + function decodeRlp(_data) { + const data = getBytes(_data, "data"); + const decoded = _decode(data, 0); + assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); + return decoded.result; + } + + function arrayifyInteger(value) { + const result = []; + while (value) { + result.unshift(value & 0xff); + value >>= 8; + } + return result; + } + function _encode(object) { + if (Array.isArray(object)) { + let payload = []; + object.forEach(function (child) { + payload = payload.concat(_encode(child)); + }); + if (payload.length <= 55) { + payload.unshift(0xc0 + payload.length); + return payload; + } + const length = arrayifyInteger(payload.length); + length.unshift(0xf7 + length.length); + return length.concat(payload); + } + const data = Array.prototype.slice.call(getBytes(object, "object")); + if (data.length === 1 && data[0] <= 0x7f) { + return data; + } + else if (data.length <= 55) { + data.unshift(0x80 + data.length); + return data; + } + const length = arrayifyInteger(data.length); + length.unshift(0xb7 + length.length); + return length.concat(data); + } + const nibbles = "0123456789abcdef"; + /** + * Encodes %%object%% as an RLP-encoded [[DataHexString]]. + */ + function encodeRlp(object) { + let result = "0x"; + for (const v of _encode(object)) { + result += nibbles[v >> 4]; + result += nibbles[v & 0xf]; + } + return result; + } + + /** + * Most interactions with Core requires integer values, which use + * the smallest magnitude unit. + * + * For example, imagine dealing with dollars and cents. Since dollars + * are divisible, non-integer values are possible, such as ``$10.77``. + * By using the smallest indivisible unit (i.e. cents), the value can + * be kept as the integer ``1077``. + * + * When receiving decimal input from the user (as a decimal string), + * the value should be converted to an integer and when showing a user + * a value, the integer value should be converted to a decimal string. + * + * This creates a clear distinction, between values to be used by code + * (integers) and values used for display logic to users (decimals). + * + * The native unit in Core, //Core// is divisible to 18 decimal places, + * where each individual unit is called a //ore//. + * + * @_subsection api/utils:Unit Conversion [about-units] + */ + const names = [ + ///Ore, the smallest and atomic amount of Core + "ore", + ///fecore, 1000 ore + "fecore", + ///Picore, one million ore + "picore", + ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices. + "nacore", + ///Μcore, 10^12 ore or 1 μCore + "mcore", + ///micore, 10^15 ore or 1 mcore + "micore", + "core", + ]; + /** + * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal + * places. The %%unit%% may be the number of decimal places or the name of + * a unit + * + */ + function formatUnits(value, unit) { + let decimals = 18; + if (typeof unit === "string") { + const index = names.indexOf(unit); + assertArgument(index >= 0, "invalid unit", "unit", unit); + decimals = 3 * index; + } + else if (unit != null) { + decimals = getNumber(unit, "unit"); + } + return FixedNumber.fromValue(value, decimals, { decimals }).toString(); + } + /** + * Converts the //decimal string// %%value%% to a BigInt, assuming + * %%unit%% decimal places. The %%unit%% may the number of decimal places + * or the name of a unit. + */ + const scientificToDecimal = (num) => { + // @ts-ignore + var nsign = Math.sign(num); + //remove the sign + // @ts-ignore + num = Math.abs(num); + //if the number is in scientific notation remove it + // @ts-ignore + if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) { + var zero = "0", + // @ts-ignore + parts = String(num).toLowerCase().split("e"), //split into coeff and exponent + e = parts.pop(), //store the exponential part + // @ts-ignore + l = Math.abs(e), //get the number of zeros + // @ts-ignore + sign = e / l, coeff_array = parts[0].split("."); + if (sign === -1) { + l = l - coeff_array[0].length; + if (l < 0) { + // @ts-ignore + num = + coeff_array[0].slice(0, l) + + "." + + coeff_array[0].slice(l) + + (coeff_array.length === 2 ? coeff_array[1] : ""); + } + else { + // @ts-ignore + num = zero + "." + new Array(l + 1).join(zero) + coeff_array.join(""); + } + } + else { + var dec = coeff_array[1]; + if (dec) + l = l - dec.length; + if (l < 0) { + // @ts-ignore + num = coeff_array[0] + dec.slice(0, l) + "." + dec.slice(l); + } + else { + // @ts-ignore + num = coeff_array.join("") + new Array(l + 1).join(zero); + } + } + } + // @ts-ignore + return nsign < 0 ? "-" + num : num; + }; + const trimDecimals = (n, decimals = 18) => { + n += ""; + if (n.indexOf(".") === -1) + return n; + const arr = n.split("."); + const fraction = arr[1].substr(0, decimals); + return arr[0] + "." + fraction; + }; + function parseUnits(value, unit) { + assertArgument(typeof value === "string", "value must be a string", "value", value); + if (value.includes("e")) { + value = scientificToDecimal(value).toString(); + } + let decimals = 18; + if (typeof unit === "string") { + const index = names.indexOf(unit); + assertArgument(index >= 0, "invalid unit", "unit", unit); + decimals = 3 * index; + value = trimDecimals(value, decimals); + } + else if (unit != null) { + decimals = getNumber(unit, "unit"); + value = trimDecimals(value, decimals); + } + return FixedNumber.fromString(value, { decimals }).value; + } + /** + * Converts %%value%% into a //decimal string// using 18 decimal places. + */ + function formatXCB(ore) { + return formatUnits(ore, 18); + } + /** + * Converts the //decimal string// %%xcb%% to a BigInt, using 18 + * decimal places. + */ + function parseXCB(xcb) { + return parseUnits(xcb, 18); + } + + /** + * Explain UUID and link to RFC here. + * + * @_subsection: api/utils:UUID [about-uuid] + */ + /** + * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. + * + * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) + */ + function uuidV4(randomBytes) { + const bytes = getBytes(randomBytes, "randomBytes"); + // Section: 4.1.3: + // - time_hi_and_version[12:16] = 0b0100 + bytes[6] = (bytes[6] & 0x0f) | 0x40; + // Section 4.4 + // - clock_seq_hi_and_reserved[6] = 0b0 + // - clock_seq_hi_and_reserved[7] = 0b1 + bytes[8] = (bytes[8] & 0x3f) | 0x80; + const value = hexlify(bytes); + return [ + value.substring(2, 10), + value.substring(10, 14), + value.substring(14, 18), + value.substring(18, 22), + value.substring(22, 34), + ].join("-"); + } + + var pbkdf2$2 = {}; + + var hasRequiredPbkdf2; + + function requirePbkdf2 () { + if (hasRequiredPbkdf2) return pbkdf2$2; + hasRequiredPbkdf2 = 1; + + const assert = requireAssert(); + const crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto || {}; + const subtle = crypto.subtle || {}; + + /** + * Perform key derivation using PBKDF2. + * @param {Function} hash + * @param {Buffer} pass + * @param {Buffer} salt + * @param {Number} iter + * @param {Number} len + * @returns {Buffer} + */ + + function derive(hash, pass, salt, iter, len) { + if (typeof pass === 'string') + pass = bufferExports.Buffer.from(pass, 'utf8'); + + if (typeof salt === 'string') + salt = bufferExports.Buffer.from(salt, 'utf8'); + + if (salt == null) + salt = bufferExports.Buffer.alloc(0); + + assert(hash && typeof hash.id === 'string'); + assert(bufferExports.Buffer.isBuffer(pass)); + assert(bufferExports.Buffer.isBuffer(salt)); + assert((iter >>> 0) === iter); + assert((len >>> 0) === len); + + const size = hash.size; + const blocks = Math.ceil(len / size); + const out = bufferExports.Buffer.alloc(blocks * size); + const state = bufferExports.Buffer.alloc(salt.length + 4); + + salt.copy(state, 0); + + // Preemptively shorten key. + if (pass.length > hash.blockSize) { + pass = hash.digest(pass); + assert(pass.length <= hash.blockSize); + } + + for (let i = 0; i < blocks; i++) { + const round = i + 1; + + state[salt.length + 0] = round >>> 24; + state[salt.length + 1] = round >>> 16; + state[salt.length + 2] = round >>> 8; + state[salt.length + 3] = round; + + const block = hash.mac(state, pass); + + let mac = block; + + for (let j = 1; j < iter; j++) { + mac = hash.mac(mac, pass); + + for (let k = 0; k < size; k++) + block[k] ^= mac[k]; + } + + block.copy(out, i * size); + } + + return out.slice(0, len); + } + + /** + * Execute pbkdf2 asynchronously. + * @param {Function} hash + * @param {Buffer} pass + * @param {Buffer} salt + * @param {Number} iter + * @param {Number} len + * @returns {Promise} + */ + + async function deriveAsync(hash, pass, salt, iter, len) { + if (typeof pass === 'string') + pass = bufferExports.Buffer.from(pass, 'utf8'); + + if (typeof salt === 'string') + salt = bufferExports.Buffer.from(salt, 'utf8'); + + if (salt == null) + salt = bufferExports.Buffer.alloc(0); + + assert(hash && typeof hash.id === 'string'); + assert(bufferExports.Buffer.isBuffer(pass)); + assert(bufferExports.Buffer.isBuffer(salt)); + assert((iter >>> 0) === iter); + assert((len >>> 0) === len); + + const name = getHash(hash); + + if (!subtle.importKey || !subtle.deriveBits || !name) + return derive(hash, pass, salt, iter, len); + + const algo = { name: 'PBKDF2' }; + const use = ['deriveBits']; + + const options = { + name: 'PBKDF2', + salt: salt, + iterations: iter, + hash: name + }; + + const key = await subtle.importKey('raw', pass, algo, false, use); + const out = await subtle.deriveBits(options, key, len * 8); + + return bufferExports.Buffer.from(out); + } + + /* + * Helpers + */ + + function getHash(hash) { + switch (hash.id) { + case 'SHA1': + return 'SHA-1'; + case 'SHA256': + return 'SHA-256'; + case 'SHA384': + return 'SHA-384'; + case 'SHA512': + return 'SHA-512'; + default: + return null; + } + } + + /* + * Expose + */ + + pbkdf2$2.native = 0; + pbkdf2$2.derive = derive; + pbkdf2$2.deriveAsync = deriveAsync; + return pbkdf2$2; + } + + /*! + * pbkdf2.js - pbkdf2 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var pbkdf2Browser; + var hasRequiredPbkdf2Browser; + + function requirePbkdf2Browser () { + if (hasRequiredPbkdf2Browser) return pbkdf2Browser; + hasRequiredPbkdf2Browser = 1; + + pbkdf2Browser = requirePbkdf2(); + return pbkdf2Browser; + } + + var pbkdf2BrowserExports = requirePbkdf2Browser(); + var pbkdf2$1 = /*@__PURE__*/getDefaultExportFromCjs(pbkdf2BrowserExports); + + var sha3; + var hasRequiredSha3; + + function requireSha3 () { + if (hasRequiredSha3) return sha3; + hasRequiredSha3 = 1; + + const Keccak = requireKeccak(); + + /** + * SHA3 + */ + + class SHA3 extends Keccak { + constructor() { + super(); + } + + final() { + return super.final(0x06, null); + } + + static hash() { + return new SHA3(); + } + + static hmac(bits) { + return super.hmac(bits, 0x06, null); + } + + static digest(data, bits) { + return super.digest(data, bits, 0x06, null); + } + + static root(left, right, bits) { + return super.root(left, right, bits, 0x06, null); + } + + static multi(x, y, z, bits) { + return super.multi(x, y, z, bits, 0x06, null); + } + + static mac(data, key, bits) { + return super.mac(data, key, bits, 0x06, null); + } + } + + /* + * Static + */ + + SHA3.native = 0; + SHA3.id = 'SHA3_256'; + SHA3.size = 32; + SHA3.bits = 256; + SHA3.blockSize = 136; + SHA3.zero = bufferExports.Buffer.alloc(32, 0x00); + SHA3.ctx = new SHA3(); + + /* + * Expose + */ + + sha3 = SHA3; + return sha3; + } + + /*! + * sha3.js - sha3 for bcrypto + * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). + * https://github.com/bcoin-org/bcrypto + */ + + var sha3Browser; + var hasRequiredSha3Browser; + + function requireSha3Browser () { + if (hasRequiredSha3Browser) return sha3Browser; + hasRequiredSha3Browser = 1; + + sha3Browser = requireSha3(); + return sha3Browser; + } + + var sha3512; + var hasRequiredSha3512; + + function requireSha3512 () { + if (hasRequiredSha3512) return sha3512; + hasRequiredSha3512 = 1; + + const SHA3 = requireSha3Browser(); + + /** + * SHA3-512 + */ + + class SHA3_512 extends SHA3 { + constructor() { + super(); + } + + init() { + return super.init(512); + } + + static hash() { + return new SHA3_512(); + } + + static hmac() { + return super.hmac(512); + } + + static digest(data) { + return super.digest(data, 512); + } + + static root(left, right) { + return super.root(left, right, 512); + } + + static multi(x, y, z) { + return super.multi(x, y, z, 512); + } + + static mac(data, key) { + return super.mac(data, key, 512); + } + } + + /* + * Static + */ + + SHA3_512.native = SHA3.native; + SHA3_512.id = 'SHA3_512'; + SHA3_512.size = 64; + SHA3_512.bits = 512; + SHA3_512.blockSize = 72; + SHA3_512.zero = bufferExports.Buffer.alloc(64, 0x00); + SHA3_512.ctx = new SHA3_512(); + + /* + * Expose + */ + + sha3512 = SHA3_512; + return sha3512; + } + + var sha3512Exports = requireSha3512(); + var SHA3_512 = /*@__PURE__*/getDefaultExportFromCjs(sha3512Exports); + + class Ed448Goldilock { + static _channel = ed448; + static generatePrivateKey() { + var privateKey = ed448.privateKeyGenerate(); + privateKey[56] &= 0x7f; + return privateKey; + } + static getPublicKeyFromPrivateKey(privateKey) { + var secret = bufferExports.Buffer.from(privateKey, "hex"); + if (secret[56] > 127) { + var scalar = secret.slice(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + var publicKey = this._channel.publicKeyFromScalar(scalar); + return bufferExports.Buffer.from(publicKey).toString("hex"); + } + else { + var publicKey = this._channel.publicKeyCreate(secret); + return bufferExports.Buffer.from(publicKey).toString("hex"); + } + } + static signWithPrivateKey(privateKey, msg) { + var msgToSign = bufferExports.Buffer.from(msg, "hex"); + var secret = bufferExports.Buffer.from(privateKey, "hex"); + if (secret[56] > 127) { + var prefix = secret.slice(0, 57); + prefix[0] &= 0xfc; + prefix[56] = 0; + prefix[55] |= 0x80; + var scalar = prefix.slice(0, 56); + var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); + return bufferExports.Buffer.from(signedMessage).toString("hex"); + } + else { + var signedMessage = this._channel.sign(msgToSign, secret); + return bufferExports.Buffer.from(signedMessage).toString("hex"); + } + } + static signWithPrivateKeyNConcatPubkey(privateKey, msg) { + var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); + var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); + return signedMessage + publicKey; + } + static verifySignature(msgHash, signedMsg, pubKey) { + return this._channel.verify(bufferExports.Buffer.from(msgHash, "hex"), bufferExports.Buffer.from(signedMsg, "hex"), bufferExports.Buffer.from(pubKey, "hex")); + } + static SHA512Hash(password, salt) { + var p1 = bufferExports.Buffer.from(password, "hex"); + var s1 = bufferExports.Buffer.from(salt, "hex"); + return bufferExports.Buffer.from(pbkdf2$1.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); + } + static concatenateAndHex(prefix, key, index, salt) { + var ind = bufferExports.Buffer.alloc(4); + var p = bufferExports.Buffer.alloc(1); + p[0] = prefix % 256; + var j = index; + for (let i = 0; i < 4; i++) { + ind[i] = j % 256; + j = Math.floor(j / 256); + } + var t = p.toString("hex") + key + ind.toString("hex"); + return Ed448Goldilock.SHA512Hash(t, salt); + } + static addScalar(a, b) { + var a1 = bufferExports.Buffer.from(a, "hex"); + var b1 = bufferExports.Buffer.from(b.substr(0, 106) + "00000000", "hex"); + b1[0] &= 0xfc; + var c = bufferExports.Buffer.alloc(57); + var hold = 0; + for (let i = 0; i < 57; i++) { + hold += a1[i] + b1[i]; + c[i] = hold % 256; + hold = Math.floor(hold / 256); + } + return c.toString("hex"); + } + static seedToExtendedPrivate(seed) { + var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); + var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); + var b = bufferExports.Buffer.from(s2, "hex"); + b[56] |= 0x80; + b[55] |= 0x80; + b[55] &= 0xbf; + var s3 = b.toString("hex"); + return s1 + s3; + } + static childPrivateToPrivate(s, index) { + var s0 = s.substr(0, 114); + var s1 = s.substr(114, 228); + var r0, r1; + if (index >= 0x80000000) { + r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); + r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); + return r0 + Ed448Goldilock.addScalar(s1, r1); + } + else { + var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); + r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); + r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); + return r0 + Ed448Goldilock.addScalar(s1, r1); + } + } + static HDWalletGenerateKeyFromSeed(seed, index) { + var m = Ed448Goldilock.seedToExtendedPrivate(seed); + var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); + var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); + var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); + var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); + var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); + return k5.substr(114, 228); + } + } + + /* Browser Crypto Shims */ + function getGlobal$1() { + if (typeof globalThis !== "undefined") + return globalThis; + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw new Error("unable to locate global object"); + } + const anyGlobal = getGlobal$1(); + const crypto = anyGlobal.crypto || anyGlobal.msCrypto; + function createHash(algo) { + switch (algo) { + case "ripemd160": + return ripemd160$1.create(); + case "sha256": + return sha256$2.create(); + case "sha512": + return sha512$1.create(); + case "sha3-256": + return sha3_256.create(); + case "sha3-512": + return sha3_512.create(); + } + assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); + } + function createHmac(_algo, key) { + const algo = { sha256: sha256$2, sha512: sha512$1, "sha3-256": sha3_256, "sha3-512": sha3_512 }[_algo]; + assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); + return hmac$1.create(algo, key); + } + function pbkdf2Sync(password, salt, iterations, keylen, _algo) { + const algo = { sha256: sha256$2, sha512: sha512$1 }[_algo]; + assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); + return pbkdf2$3(algo, password, salt, { c: iterations, dkLen: keylen }); + } + function randomBytes$1(length) { + assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { + operation: "randomBytes", + }); + assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); + const result = new Uint8Array(length); + crypto.getRandomValues(result); + return result; + } + + const _sha256 = (data) => hexlify(createHash("sha3-256").update(data).digest()); + const _sha512 = (data) => hexlify(createHash("sha3-512").update(data).digest()); + let __sha256 = _sha256; + let __sha512 = _sha512; + let locked256 = false, locked512 = false; + /** + * Compute the cryptographic SHA3-256 hash of %%data%%. + * + * @_docloc: api/crypto:Hash Functions + * @returns DataHexstring + * + * @example: + * sha256("0x") + * //_result: + * + * sha256("0x1337") + * //_result: + * + * sha256(new Uint8Array([ 0x13, 0x37 ])) + * //_result: + * + */ + var SupportedAlgorithm; + (function (SupportedAlgorithm) { + SupportedAlgorithm["sha256"] = "sha256"; + SupportedAlgorithm["sha512"] = "sha512"; + })(SupportedAlgorithm || (SupportedAlgorithm = {})); + function sha256(data) { + return hexlify(__sha256(getBytes(data))); + } + function legacySha256(data) { + const _data = getBytes(data, "data"); + const hexlified = hexlify(createHash("sha256").update(_data).digest()); + return hexlified; + } + sha256._ = _sha256; + sha256.lock = function () { + locked256 = true; + }; + sha256.register = function (func) { + if (locked256) { + throw new Error("sha256 is locked"); + } + __sha256 = func; + }; + Object.freeze(sha256); + /** + * Compute the cryptographic SHA3-512 hash of %%data%%. + * + * @_docloc: api/crypto:Hash Functions + * @returns DataHexstring + * + * @example: + * sha512("0x") + * //_result: + * + * sha512("0x1337") + * //_result: + * + * sha512(new Uint8Array([ 0x13, 0x37 ])) + * //_result: + */ + function sha512(data) { + return hexlify(__sha512(getBytes(data))); + } + sha512._ = _sha512; + sha512.lock = function () { + locked512 = true; + }; + sha512.register = function (func) { + if (locked512) { + throw new Error("sha512 is locked"); + } + __sha512 = func; + }; + Object.freeze(sha512); + + /** + * Addresses are a fundamental part of interacting with Core. They + * represent the gloabal identity of Externally Owned Accounts (accounts + * backed by a private key) and contracts. + * + * The Core Naming Service (CNS) provides an interconnected ecosystem + * of contracts, standards and libraries which enable looking up an + * address for an ENS name. + * + * These functions help convert between various formats, validate + * addresses and safely resolve ENS names. + * + * @_section: api/address:Addresses [about-addresses] + */ + const logger$3 = new Logger("address/0.0.1"); + const precompiledAddresses = [ + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000001", + "0000000000000000000000000000000000000000000000000000000000000002", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000005", + "0000000000000000000000000000000000000000000000000000000000000006", + "0000000000000000000000000000000000000000000000000000000000000007", + "0000000000000000000000000000000000000000000000000000000000000008", + "0000000000000000000000000000000000000000000000000000000000000009", + ]; + function removeHexPrefix$1(val) { + return val.substring(0, 2) === "0x" ? val.substring(2) : val; + } + function calculateCheckSum(_address, _prefix) { + const address = getBytes("0x" + _address.replace("0x", "")); + const prefix = getBytes("0x" + _prefix.replace("0x", "")); + const tmpConcated = new Uint8Array([...address, ...prefix]); + const hexedConcat = hexlify(tmpConcated).replace("0x", "") + "00"; + const mods = Array.from(hexedConcat.toUpperCase(), (c) => { + const charCode = c.charCodeAt(0); + return charCode > 64 && charCode < 91 + ? (charCode - 55).toString() + : (charCode - 48).toString(); + }).join(""); + const bigVal = BigInt(mods); + const val97 = BigInt(97); + const val98 = BigInt(98); + const remainder = bigVal % val97; + const checkSum = val98 - remainder; + const result = checkSum > 9 ? checkSum.toString() : "0" + checkSum.toString(); + return result; + } + /** + * Returns a normalized and checksumed address for %%address%%. + * This accepts non-checksum addresses, checksum addresses and + * [[getIcapAddress]] formats. + * + * The checksum in Core uses the capitalization (upper-case + * vs lower-case) of the characters within an address to encode + * its checksum, which offers, on average, a checksum of 15-bits. + * + * If %%address%% contains both upper-case and lower-case, it is + * assumed to already be a checksum address and its checksum is + * validated, and if the address fails its expected checksum an + * error is thrown. + * + * If you wish the checksum of %%address%% to be ignore, it should + * be converted to lower-case (i.e. ``.toLowercase()``) before + * being passed in. This should be a very rare situation though, + * that you wish to bypass the safegaurds in place to protect + * against an address that has been incorrectly copied from another + * source. + * + * @example: + * // Adds the checksum (via upper-casing specific letters) + * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") + * //_result: + * + * // Converts ICAP address and adds checksum + * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); + * //_result: + * + * // Throws an error if an address contains mixed case, + * // but the checksum fails + * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") + * //_error: + */ + function getAddress(address) { + if (typeof address !== "string") { + logger$3.throwArgumentError("invalid address", "address", address); + } + if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) { + logger$3.throwArgumentError("invalid address", "address", address); + } + const raw = removeHexPrefix$1(address); + if (precompiledAddresses.includes(raw)) { + return "0x" + raw; + } + const prefix = raw.substring(0, 2); + const val = raw.substring(4); + const checksum = calculateCheckSum(val, prefix); + if (checksum !== raw.substring(2, 4)) { + logger$3.throwArgumentError("bad address checksum", "address", address); + } + return "0x" + prefix + checksum + val; + } + function networkIdToPrefix(networkId) { + if (networkId == 1) { + return "cb"; + } + else if (networkId == 3 || networkId == 4) { + return "ab"; + } + else if (networkId > 10 || networkId == 0) { + return "ce"; + } + else { + logger$3.throwArgumentError("bad networkId", "networkId", networkId); + return ""; + } + } + + /** + * An **HMAC** enables verification that a given key was used + * to authenticate a payload. + * + * See: [[link-wiki-hmac]] + * + * @_subsection: api/crypto:HMAC [about-hmac] + */ + let locked$4 = false; + const _computeHmac = function (algorithm, key, data) { + return createHmac(algorithm, key).update(data).digest(); + }; + let __computeHmac = _computeHmac; + /** + * Return the HMAC for %%data%% using the %%key%% key with the underlying + * %%algo%% used for compression. + * + * @example: + * key = id("some-secret") + * + * // Compute the HMAC + * computeHmac("sha256", key, "0x1337") + * //_result: + * + * // To compute the HMAC of UTF-8 data, the data must be + * // converted to UTF-8 bytes + * computeHmac("sha256", key, toUtf8Bytes("Hello World")) + * //_result: + * + */ + function computeHmac(algorithm, _key, _data) { + const key = getBytes(_key, "key"); + const data = getBytes(_data, "data"); + return hexlify(__computeHmac(algorithm, key, data)); + } + computeHmac._ = _computeHmac; + computeHmac.lock = function () { + locked$4 = true; + }; + computeHmac.register = function (func) { + if (locked$4) { + throw new Error("computeHmac is locked"); + } + __computeHmac = func; + }; + Object.freeze(computeHmac); + + let locked$3 = false; + const _ripemd160 = function (data) { + return ripemd160$1(data); + }; + let __ripemd160 = _ripemd160; + /** + * Compute the cryptographic RIPEMD-160 hash of %%data%%. + * + * @_docloc: api/crypto:Hash Functions + * @returns DataHexstring + * + * @example: + * ripemd160("0x") + * //_result: + * + * ripemd160("0x1337") + * //_result: + * + * ripemd160(new Uint8Array([ 0x13, 0x37 ])) + * //_result: + * + */ + function ripemd160(_data) { + const data = getBytes(_data, "data"); + return hexlify(__ripemd160(data)); + } + ripemd160._ = _ripemd160; + ripemd160.lock = function () { + locked$3 = true; + }; + ripemd160.register = function (func) { + if (locked$3) { + throw new TypeError("ripemd160 is locked"); + } + __ripemd160 = func; + }; + Object.freeze(ripemd160); + + /** + * A **Password-Based Key-Derivation Function** is designed to create + * a sequence of bytes suitible as a **key** from a human-rememberable + * password. + * + * @_subsection: api/crypto:Passwords [about-pbkdf] + */ + let locked$2 = false; + const _pbkdf2 = function (password, salt, iterations, keylen, algo) { + return pbkdf2Sync(password, salt, iterations, keylen, algo); + }; + let __pbkdf2 = _pbkdf2; + /** + * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using + * the %%salt%% and using %%iterations%% of %%algo%%. + * + * This PBKDF is outdated and should not be used in new projects, but is + * required to decrypt older files. + * + * @example: + * // The password must be converted to bytes, and it is generally + * // best practices to ensure the string has been normalized. Many + * // formats explicitly indicate the normalization form to use. + * password = "hello" + * passwordBytes = toUtf8Bytes(password, "NFKC") + * + * salt = id("some-salt") + * + * // Compute the PBKDF2 + * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") + * //_result: + */ + function pbkdf2(_password, _salt, iterations, keylen, algo) { + const password = getBytes(_password, "password"); + const salt = getBytes(_salt, "salt"); + return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); + } + pbkdf2._ = _pbkdf2; + pbkdf2.lock = function () { + locked$2 = true; + }; + pbkdf2.register = function (func) { + if (locked$2) { + throw new Error("pbkdf2 is locked"); + } + __pbkdf2 = func; + }; + Object.freeze(pbkdf2); + + /** + * A **Cryptographically Secure Random Value** is one that has been + * generated with additional care take to prevent side-channels + * from allowing others to detect it and prevent others from through + * coincidence generate the same values. + * + * @_subsection: api/crypto:Random Values [about-crypto-random] + */ + let locked$1 = false; + const _randomBytes = function (length) { + return new Uint8Array(randomBytes$1(length)); + }; + let __randomBytes = _randomBytes; + /** + * Return %%length%% bytes of cryptographically secure random data. + * + * @example: + * randomBytes(8) + * //_result: + */ + function randomBytes(length) { + return __randomBytes(length); + } + randomBytes._ = _randomBytes; + randomBytes.lock = function () { + locked$1 = true; + }; + randomBytes.register = function (func) { + if (locked$1) { + throw new Error("randomBytes is locked"); + } + __randomBytes = func; + }; + Object.freeze(randomBytes); + + /** + * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. + * @module + */ + // The main Scrypt loop: uses Salsa extensively. + // Six versions of the function were tried, this is the fastest one. + // RFC 7914 §3 / §4 step 2 applies Salsa20/8 to one 16-word (64-byte) block + // after xor'ing two such blocks. + // The local `y*` snapshot keeps the xor input stable even when `out` aliases `prev` or `input`. + // prettier-ignore + function XorAndSalsa(prev, pi, input, ii, out, oi) { + // Based on https://cr.yp.to/salsa20.html and RFC 7914's Salsa20/8 core. + // Xor blocks + let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; + let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; + let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; + let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; + let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; + let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; + let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; + let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; + // Save state to temporary variables (salsa) + let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; + // Main loop (salsa) + for (let i = 0; i < 8; i += 2) { + x04 ^= rotl(x00 + x12 | 0, 7); + x08 ^= rotl(x04 + x00 | 0, 9); + x12 ^= rotl(x08 + x04 | 0, 13); + x00 ^= rotl(x12 + x08 | 0, 18); + x09 ^= rotl(x05 + x01 | 0, 7); + x13 ^= rotl(x09 + x05 | 0, 9); + x01 ^= rotl(x13 + x09 | 0, 13); + x05 ^= rotl(x01 + x13 | 0, 18); + x14 ^= rotl(x10 + x06 | 0, 7); + x02 ^= rotl(x14 + x10 | 0, 9); + x06 ^= rotl(x02 + x14 | 0, 13); + x10 ^= rotl(x06 + x02 | 0, 18); + x03 ^= rotl(x15 + x11 | 0, 7); + x07 ^= rotl(x03 + x15 | 0, 9); + x11 ^= rotl(x07 + x03 | 0, 13); + x15 ^= rotl(x11 + x07 | 0, 18); + x01 ^= rotl(x00 + x03 | 0, 7); + x02 ^= rotl(x01 + x00 | 0, 9); + x03 ^= rotl(x02 + x01 | 0, 13); + x00 ^= rotl(x03 + x02 | 0, 18); + x06 ^= rotl(x05 + x04 | 0, 7); + x07 ^= rotl(x06 + x05 | 0, 9); + x04 ^= rotl(x07 + x06 | 0, 13); + x05 ^= rotl(x04 + x07 | 0, 18); + x11 ^= rotl(x10 + x09 | 0, 7); + x08 ^= rotl(x11 + x10 | 0, 9); + x09 ^= rotl(x08 + x11 | 0, 13); + x10 ^= rotl(x09 + x08 | 0, 18); + x12 ^= rotl(x15 + x14 | 0, 7); + x13 ^= rotl(x12 + x15 | 0, 9); + x14 ^= rotl(x13 + x12 | 0, 13); + x15 ^= rotl(x14 + x13 | 0, 18); + } + // Write output (salsa) + out[oi++] = (y00 + x00) | 0; + out[oi++] = (y01 + x01) | 0; + out[oi++] = (y02 + x02) | 0; + out[oi++] = (y03 + x03) | 0; + out[oi++] = (y04 + x04) | 0; + out[oi++] = (y05 + x05) | 0; + out[oi++] = (y06 + x06) | 0; + out[oi++] = (y07 + x07) | 0; + out[oi++] = (y08 + x08) | 0; + out[oi++] = (y09 + x09) | 0; + out[oi++] = (y10 + x10) | 0; + out[oi++] = (y11 + x11) | 0; + out[oi++] = (y12 + x12) | 0; + out[oi++] = (y13 + x13) | 0; + out[oi++] = (y14 + x14) | 0; + out[oi++] = (y15 + x15) | 0; + } + function BlockMix(input, ii, out, oi, r) { + // The block B is `r` 128-byte chunks, i.e. `2r` 16-word (64-byte) Salsa blocks. + let head = oi + 0; + let tail = oi + 16 * r; + for (let i = 0; i < 16; i++) + out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] + for (let i = 0; i < r; i++, head += 16, ii += 16) { + // RFC 7914 §4 step 3 outputs `Y[0], Y[2], ...` first, then `Y[1], Y[3], ...`; + // `head` and `tail` lay out those even/odd halves in place. + XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) + if (i > 0) + tail += 16; // First iteration overwrites tmp value in tail + // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) + XorAndSalsa(out, head, input, (ii += 16), out, tail); + } + } + // 128*r*(N+p+1) for N=2**20, r=8, p=1: 1 GiB main table plus 2 KiB workspace. + const SCRYPT_DEFAULT_MAXMEM = 128 * 8 * (2 ** 20 + 1 + 1); + // Common prologue and epilogue for sync/async functions + function scryptInit(password, salt, _opts) { + const opts = checkOpts({ + dkLen: 32, + asyncTick: 10, + maxmem: SCRYPT_DEFAULT_MAXMEM, + }, _opts); + const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; + anumber(N, 'N'); + anumber(r, 'r'); + anumber(p, 'p'); + anumber(dkLen, 'dkLen'); + anumber(asyncTick, 'asyncTick'); + anumber(maxmem, 'maxmem'); + if (onProgress !== undefined && typeof onProgress !== 'function') + throw new Error('"onProgress" must be a function'); + // Without this, r=0 slips through: blockSize=0 turns the `p` upper bound into + // Infinity and the failure surfaces later as a confusing pbkdf2 dkLen error. + if (r < 1) + throw new Error('"r" expected integer >= 1'); + const blockSize = 128 * r; + const blockSize32 = blockSize / 4; + // Max N is 2^32 (Integrify is 32-bit). + // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB. + // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, + // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: + // https://www.rfc-editor.org/errata_search.php?rfc=7914 + const pow32 = Math.pow(2, 32); + if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) + throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32'); + if (p < 1 || p > ((pow32 - 1) * 32) / blockSize) + throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)'); + // RFC 7914 §2 defines `dkLen` as a positive integer. + if (dkLen < 1 || dkLen > (pow32 - 1) * 32) + throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32'); + // Include the shared `tmp` scratch block so `maxmem` matches noble's actual temporary allocation. + // Node requires more headroom here, so this accounting is intentionally noble-specific. + const memUsed = blockSize * (N + p + 1); + if (memUsed > maxmem) + throw new Error('"maxmem" limit was hit: memUsed(128*r*(N+p+1))=' + memUsed + ', maxmem=' + maxmem); + // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) + // Since it has only one iteration there is no reason to use async variant + const B = pbkdf2$3(sha256$2, password, salt, { c: 1, dkLen: blockSize * p }); + const B32 = u32(B); + // Re-used between parallel iterations. Array(iterations) of B + const V = u32(new Uint8Array(blockSize * N)); + const tmp = u32(new Uint8Array(blockSize)); + let blockMixCb = () => { }; + if (onProgress) { + const totalBlockMix = 2 * N * p; + // Invoke callback if progress changes from 10.01 to 10.02 + // Allows to draw smooth progress bar on up to 8K screen + const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); + let blockMixCnt = 0; + blockMixCb = () => { + blockMixCnt++; + if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) { + // Wiping here instead of a try/catch around the main loops keeps them + // try-free: measured ~1% slower at N=2^21 with the loops inside a try. + // onProgress is the only user code that can throw mid-derivation. + try { + onProgress(blockMixCnt / totalBlockMix); + } + catch (e) { + clean(B, V, tmp); + throw e; + } + } + }; + } + return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; + } + function scryptOutput(password, dkLen, B, V, tmp) { + // Shared final PBKDF2-and-cleanup step: keep the derived key, wipe the scrypt workspace. + const res = pbkdf2$3(sha256$2, password, B, { c: 1, dkLen }); + clean(B, V, tmp); + return res; + } + /** + * Scrypt KDF from RFC 7914. See {@link ScryptOpts}. + * @param password - password or key material to derive from; + * JS string inputs are UTF-8 encoded first + * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first + * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided, + * must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}. + * @returns Derived key bytes. + * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error} + * @example + * Derive a key with scrypt. + * ```ts + * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + * ``` + * @example + * Derive a key with small demo costs and progress/memory controls. + * ```ts + * const progressLog: number[] = []; + * scrypt('password', 'salt', { + * N: 16, + * r: 8, + * p: 1, + * dkLen: 32, + * maxmem: 1024 * 1024, + * asyncTick: 10, + * onProgress(progress) { + * progressLog.push(progress); + * }, + * }); + * ``` + */ + function scrypt$1(password, salt, opts) { + const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); + swap32IfBE(B32); + for (let pi = 0; pi < p; pi++) { + const Pi = blockSize32 * pi; + for (let i = 0; i < blockSize32; i++) + V[i] = B32[Pi + i]; // V[0] = B[i] + for (let i = 0, pos = 0; i < N - 1; i++) { + BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); + blockMixCb(); + } + BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element + blockMixCb(); + for (let i = 0; i < N; i++) { + // First u32 of the last 64-byte block (u32 is LE) + // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N + // only depends on the low word here because N is a power of two and + // this implementation caps N at 2^32. + // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked + // above; >>> 0 for unsigned, input fits in u32. + const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations + // tmp = B ^ V[j] + for (let k = 0; k < blockSize32; k++) + tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; + BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) + blockMixCb(); + } + } + swap32IfBE(B32); + return scryptOutput(password, dkLen, B, V, tmp); + } + /** + * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}. + * @param password - password or key material to derive from; + * JS string inputs are UTF-8 encoded first + * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first + * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided, + * must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local + * scheduler-yield control for this JS wrapper, not part of RFC 7914. + * See {@link ScryptOpts}. + * @returns Promise resolving to derived key bytes. + * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error} + * @example + * Derive a key with scrypt asynchronously. + * ```ts + * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); + * ``` + * @example + * Derive a key asynchronously with small demo costs and progress/memory controls. + * ```ts + * await scryptAsync('password', 'salt', { + * N: 16, + * r: 8, + * p: 1, + * dkLen: 32, + * maxmem: 1024 * 1024, + * asyncTick: 1, + * onProgress(progress) { + * if (progress > 1) throw new Error('invalid progress'); + * }, + * }); + * ``` + */ + async function scryptAsync(password, salt, opts) { + const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); + // One failure handler covers both yield boundaries without putting the hot loops in a try block. + const abort = () => clean(B, V, tmp); + swap32IfBE(B32); + for (let pi = 0; pi < p; pi++) { + const Pi = blockSize32 * pi; + for (let i = 0; i < blockSize32; i++) + V[i] = B32[Pi + i]; // V[0] = B[i] + let pos = 0; + await asyncLoop(N - 1, asyncTick, () => { + BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); + blockMixCb(); + }, abort); + BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element + blockMixCb(); + await asyncLoop(N, asyncTick, () => { + // First u32 of the last 64-byte block (u32 is LE) + // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N + // only depends on the low word here because N is a power of two and + // this implementation caps N at 2^32. + // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked + // above; >>> 0 for unsigned, input fits in u32. + const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations + // tmp = B ^ V[j] + for (let k = 0; k < blockSize32; k++) + tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; + BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) + blockMixCb(); + }, abort); + } + swap32IfBE(B32); + return scryptOutput(password, dkLen, B, V, tmp); + } + + let lockedSync = false, lockedAsync = false; + const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { + return await scryptAsync(passwd, salt, { N, r, p, dkLen, onProgress }); + }; + const _scryptSync = function (passwd, salt, N, r, p, dkLen) { + return scrypt$1(passwd, salt, { N, r, p, dkLen }); + }; + let __scryptAsync = _scryptAsync; + let __scryptSync = _scryptSync; + /** + * The [[link-wiki-scrypt]] uses a memory and cpu hard method of + * derivation to increase the resource cost to brute-force a password + * for a given key. + * + * This means this algorithm is intentionally slow, and can be tuned to + * become slower. As computation and memory speed improve over time, + * increasing the difficulty maintains the cost of an attacker. + * + * For example, if a target time of 5 seconds is used, a legitimate user + * which knows their password requires only 5 seconds to unlock their + * account. A 6 character password has 68 billion possibilities, which + * would require an attacker to invest over 10,000 years of CPU time. This + * is of course a crude example (as password generally aren't random), + * but demonstrates to value of imposing large costs to decryption. + * + * For this reason, if building a UI which involved decrypting or + * encrypting datsa using scrypt, it is recommended to use a + * [[ProgressCallback]] (as event short periods can seem lik an eternity + * if the UI freezes). Including the phrase //"decrypting"// in the UI + * can also help, assuring the user their waiting is for a good reason. + * + * @_docloc: api/crypto:Passwords + * + * @example: + * // The password must be converted to bytes, and it is generally + * // best practices to ensure the string has been normalized. Many + * // formats explicitly indicate the normalization form to use. + * password = "hello" + * passwordBytes = toUtf8Bytes(password, "NFKC") + * + * salt = id("some-salt") + * + * // Compute the scrypt + * scrypt(passwordBytes, salt, 1024, 8, 1, 16) + * //_result: + */ + async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { + const passwd = getBytes(_passwd, "passwd"); + const salt = getBytes(_salt, "salt"); + return hexlify(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); + } + scrypt._ = _scryptAsync; + scrypt.lock = function () { + lockedAsync = true; + }; + scrypt.register = function (func) { + if (lockedAsync) { + throw new Error("scrypt is locked"); + } + __scryptAsync = func; + }; + Object.freeze(scrypt); + /** + * Provides a synchronous variant of [[scrypt]]. + * + * This will completely lock up and freeze the UI in a browser and will + * prevent any event loop from progressing. For this reason, it is + * preferred to use the [async variant](scrypt). + * + * @_docloc: api/crypto:Passwords + * + * @example: + * // The password must be converted to bytes, and it is generally + * // best practices to ensure the string has been normalized. Many + * // formats explicitly indicate the normalization form to use. + * password = "hello" + * passwordBytes = toUtf8Bytes(password, "NFKC") + * + * salt = id("some-salt") + * + * // Compute the scrypt + * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) + * //_result: + */ + function scryptSync(_passwd, _salt, N, r, p, dkLen) { + const passwd = getBytes(_passwd, "passwd"); + const salt = getBytes(_salt, "salt"); + return hexlify(__scryptSync(passwd, salt, N, r, p, dkLen)); + } + scryptSync._ = _scryptSync; + scryptSync.lock = function () { + lockedSync = true; + }; + scryptSync.register = function (func) { + if (lockedSync) { + throw new Error("scryptSync is locked"); + } + __scryptSync = func; + }; + Object.freeze(scryptSync); + + /** + * Cryptographic hashing functions + * + * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] + */ + let locked = false; + const _keccak256 = function (data) { + return keccak_256(data); + }; + let __keccak256 = _keccak256; + /** + * Compute the cryptographic KECCAK256 hash of %%data%%. + * + * The %%data%% **must** be a data representation, to compute the + * hash of UTF-8 data use the [[id]] function. + * + * @returns DataHexstring + * @example: + * keccak256("0x") + * //_result: + * + * keccak256("0x1337") + * //_result: + * + * keccak256(new Uint8Array([ 0x13, 0x37 ])) + * //_result: + * + * // Strings are assumed to be DataHexString, otherwise it will + * // throw. To hash UTF-8 data, see the note above. + * keccak256("Hello World") + * //_error: + */ + function keccak256(_data) { + const data = getBytes(_data, "data"); + return hexlify(__keccak256(data)); + } + keccak256._ = _keccak256; + keccak256.lock = function () { + locked = true; + }; + keccak256.register = function (func) { + if (locked) { + throw new TypeError("keccak256 is locked"); + } + __keccak256 = func; + }; + Object.freeze(keccak256); + + /** + * Add details about signing here. + * + * @_subsection: api/crypto:Signing [about-signing] + */ + const logger$2 = new Logger("signing-key/0.0.1"); + /** + * A **SigningKey** provides high-level access to the elliptic curve + * cryptography (ECC) operations and key management. + */ + class SigningKey { + #privateKey; + /** + * Creates a new **SigningKey** for %%privateKey%%. + */ + constructor(privateKey) { + const normalized = typeof privateKey === "string" && !privateKey.startsWith("0x") + ? "0x" + privateKey + : privateKey; + assertArgument(dataLength(normalized) === 57, "invalid private key", "privateKey", "[REDACTED]"); + this.#privateKey = hexlify(normalized); + } + /** + * The private key. + */ + get privateKey() { + return this.#privateKey; + } + /** The 57-byte Ed448 public key encoded as hex. */ + get publicKey() { + return SigningKey.computePublicKey(this.#privateKey); + } + /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ + get compressedPublicKey() { + return SigningKey.computePublicKey(this.#privateKey, true); + } + /** + * Return the signature of the signed %%digest%%. + */ + sign(digest) { + const key = getBytesCopy(this.#privateKey); + assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); + const keyBuffer = new Uint8Array(arrayify(key)); + if (keyBuffer.length !== 57) { + logger$2.throwArgumentError("invalid private key", "key", "[REDACTED]"); + } + const digestBuffer = new Uint8Array(arrayify(digest)); + if (digestBuffer.length !== 32) { + logger$2.throwArgumentError("bad digest length", "digest", digest); + } + if (keyBuffer[56] > 127) { + const prefix = keyBuffer.slice(0, 57); + prefix[0] &= 0xfc; + prefix[55] |= 0x80; + prefix[56] = 0; + const scalar = prefix.slice(0, 56); + const bufferDigest = bufferExports.Buffer.from(digestBuffer); + const bufferPrfx = bufferExports.Buffer.from(prefix); + const bufferScalar = bufferExports.Buffer.from(scalar); + const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); + const hexlified = hexlify(sig); + return hexConcat([hexlified, this.publicKey]); + } + const sig = ed448.sign(bufferExports.Buffer.from(digestBuffer), bufferExports.Buffer.from(keyBuffer)); + const hexlified = hexlify(sig); + return hexConcat([hexlified, this.publicKey]); + } + /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ + computeSharedSecret(other) { + const pub = bufferExports.Buffer.from(getBytesCopy(other)); + assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), "invalid public key", "other", other); + const key = bufferExports.Buffer.from(getBytesCopy(this.#privateKey)); + if (key[56] > 127) { + const scalar = key.subarray(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + return hexlify(ed448.deriveWithScalar(pub, scalar)); + } + return hexlify(ed448.derive(pub, key)); + } + /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ + static computePublicKey(key, compressed) { + const bytes = bufferExports.Buffer.from(arrayify(key)); + if (bytes.length !== 57) { + logger$2.throwArgumentError("invalid private key", "key", "[REDACTED]"); + } + if (bytes[56] > 127) { + const scalar = bytes.slice(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + const pub = ed448.publicKeyFromScalar(scalar); + return hexlify(pub); + } + const pub = ed448.publicKeyCreate(bytes); + return hexlify(pub); + } + /** + * Returns the public key for the private key which produced the + * %%signature%% for the given %%digest%%. + * + * @example: + * key = new SigningKey(id("some-secret")) + * digest = id("hello world") + * sig = key.sign(digest) + * + * // Notice the signer public key... + * key.publicKey + * //_result: + * + * // ...is equal to the recovered public key + * SigningKey.recoverPublicKey(digest, sig) + * //_result: + * + */ + static recoverPublicKey(digest, signature) { + assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); + const digestBuffer = bufferExports.Buffer.from(arrayify(digest)); + const sigBuffer = bufferExports.Buffer.from(arrayify(signature)); + if (sigBuffer.length !== 171) { + logger$2.throwArgumentError("invalid signature", "signature", signature); + } + const sig = sigBuffer.slice(0, 114); + const pub = sigBuffer.slice(114); + if (ed448.verify(digestBuffer, sig, pub)) { + return hexlify(pub); + } + logger$2.throwArgumentError("invalid signature", "signature", signature); + return ""; + } + /** Adds two encoded Ed448 public points. The compression flag is ignored. */ + static addPoints(p0, p1, compressed) { + const points = [p0, p1].map((point) => { + const bytes = bufferExports.Buffer.from(getBytesCopy(point)); + assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), "invalid public key", "point", point); + return bytes; + }); + return hexlify(ed448.publicKeyCombine(points)); + } + } + + // Constants + const BN_0$6 = BigInt(0); + const BN_1$3 = BigInt(1); + const BN_2$1 = BigInt(2); + const BN_27 = BigInt(27); + const BN_28 = BigInt(28); + const BN_35 = BigInt(35); + const _guard$4 = {}; + /** + * A Signature @TODO + * + * + * @_docloc: api/crypto:Signing + */ + class Signature { + #r; + #s; + #v; + #networkV; + /** + * The ``r`` value for a signautre. + * + * This represents the ``x`` coordinate of a "reference" or + * challenge point, from which the ``y`` can be computed. + */ + get r() { + return this.#r; + } + set r(value) { + assertArgument(dataLength(value) === 32, "invalid r", "value", value); + this.#r = hexlify(value); + } + /** + * The ``s`` value for a signature. + */ + get s() { + return this.#s; + } + set s(_value) { + assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); + const value = hexlify(_value); + assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); + this.#s = value; + } + /** + * The ``v`` value for a signature. + * + * Since a given ``x`` value for ``r`` has two possible values for + * its correspondin ``y``, the ``v`` indicates which of the two ``y`` + * values to use. + * + * It is normalized to the values ``27`` or ``28`` for legacy + * purposes. + */ + get v() { + return this.#v; + } + set v(value) { + const v = getNumber(value, "value"); + assertArgument(v === 27 || v === 28, "invalid v", "v", value); + this.#v = v; + } + /** + * The EIP-155 ``v`` for legacy transactions. For non-legacy + * transactions, this value is ``null``. + */ + get networkV() { + return this.#networkV; + } + /** + * The chain ID for EIP-155 legacy transactions. For non-legacy + * transactions, this value is ``null``. + */ + get legacynetworkId() { + const v = this.networkV; + if (v == null) { + return null; + } + return Signature.getnetworkId(v); + } + /** + * The ``yParity`` for the signature. + * + * See ``v`` for more details on how this value is used. + */ + get yParity() { + return this.v === 27 ? 0 : 1; + } + /** + * The [[link-eip-2098]] compact representation of the ``yParity`` + * and ``s`` compacted into a single ``bytes32``. + */ + get yParityAndS() { + // The EIP-2098 compact representation + const yParityAndS = getBytes(this.s); + if (this.yParity) { + yParityAndS[0] |= 0x80; + } + return hexlify(yParityAndS); + } + /** + * The [[link-eip-2098]] compact representation. + */ + get compactSerialized() { + return concat([this.r, this.yParityAndS]); + } + /** + * The serialized representation. + */ + get serialized() { + return concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); + } + /** + * @private + */ + constructor(guard, r, s, v) { + assertPrivate(guard, _guard$4, "Signature"); + this.#r = r; + this.#s = s; + this.#v = v; + this.#networkV = null; + } + [Symbol.for("nodejs.util.inspect.custom")]() { + return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; + } + /** + * Returns a new identical [[Signature]]. + */ + clone() { + const clone = new Signature(_guard$4, this.r, this.s, this.v); + if (this.networkV) { + clone.#networkV = this.networkV; + } + return clone; + } + /** + * Returns a representation that is compatible with ``JSON.stringify``. + */ + toJSON() { + const networkV = this.networkV; + return { + _type: "signature", + networkV: networkV != null ? networkV.toString() : null, + r: this.r, + s: this.s, + v: this.v, + }; + } + /** + * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. + * + * @example: + * Signature.getnetworkId(45) + * //_result: + * + * Signature.getnetworkId(46) + * //_result: + */ + static getnetworkId(v) { + const bv = getBigInt(v, "v"); + // The v is not an EIP-155 v, so it is the unspecified chain ID + if (bv == BN_27 || bv == BN_28) { + return BN_0$6; + } + // Bad value for an EIP-155 v + assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); + return (bv - BN_35) / BN_2$1; + } + /** + * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. + * + * Legacy transactions which use [[link-eip-155]] hijack the ``v`` + * property to include the chain ID. + * + * @example: + * Signature.getnetworkIdV(5, 27) + * //_result: + * + * Signature.getnetworkIdV(5, 28) + * //_result: + * + */ + static getnetworkIdV(networkId, v) { + return getBigInt(networkId) * BN_2$1 + BigInt(35 + v - 27); + } + /** + * Compute the normalized legacy transaction ``v`` from a ``yParirty``, + * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. + * + * @example: + * // The values 0 and 1 imply v is actually yParity + * Signature.getNormalizedV(0) + * //_result: + * + * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) + * Signature.getNormalizedV(27) + * //_result: + * + * // Legacy EIP-155 transaction (i.e. >= 35) + * Signature.getNormalizedV(46) + * //_result: + * + * // Invalid values throw + * Signature.getNormalizedV(5) + * //_error: + */ + static getNormalizedV(v) { + const bv = getBigInt(v); + if (bv === BN_0$6 || bv === BN_27) { + return 27; + } + if (bv === BN_1$3 || bv === BN_28) { + return 28; + } + assertArgument(bv >= BN_35, "invalid v", "v", v); + // Otherwise, EIP-155 v means odd is 27 and even is 28 + return bv & BN_1$3 ? 27 : 28; + } + } + + /** + * A fundamental building block of Core is the underlying + * cryptographic primitives. + * + * @_section: api/crypto:Cryptographic Functions [about-crypto] + */ + function lock() { + computeHmac.lock(); + pbkdf2.lock(); + randomBytes.lock(); + ripemd160.lock(); + scrypt.lock(); + scryptSync.lock(); + sha256.lock(); + sha512.lock(); + randomBytes.lock(); + } + + /** + * Returns the address for the %%key%%. + * + * The key may be any standard form of public key or a private key. + */ + function removeHexPrefix(val) { + return val.substring(0, 2) === "0x" ? val.substring(2) : val; + } + function publicToAddress(key, prefix) { + const val = hexDataSlice(sha256(key), 12); + const checksum = calculateCheckSum(val, prefix); + return "0x" + prefix + checksum + removeHexPrefix(val); + } + function computeAddress(key, prefix) { + let pubkey; + if (typeof key === "string") { + pubkey = SigningKey.computePublicKey(key, false); + } + else { + pubkey = key.publicKey; + } + return publicToAddress(pubkey, prefix); // getAddress(sha256("0x" + pubkey.substring(4)).substring(26)); + } + /** + * Returns the recovered address for the private key that was + * used to sign %%digest%% that resulted in %%signature%%. + */ + function recoverAddress(digest, signature, prefix) { + // return computeAddress(SigningKey.recoverPublicKey(digest, signature)); + const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature); + return publicToAddress(publicKey, prefix); + } + function extractPrefix(address) { + address = getAddress(address); + return address.substring(2, 4); + } + + /** + * @_ignore: + */ + const WordSize = 32; + const Padding = new Uint8Array(WordSize); + // Properties used to immediate pass through to the underlying object + // - `then` is used to detect if an object is a Promise for await + const passProperties$1 = ["then"]; + const _guard$3 = {}; + function throwError(name, error) { + const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); + wrapped.error = error; + throw wrapped; + } + /** + * A [[Result]] is a sub-class of Array, which allows accessing any + * of its values either positionally by its index or, if keys are + * provided by its name. + * + * @_docloc: api/abi + */ + class Result extends Array { + #names; + /** + * @private + */ + constructor(...args) { + // To properly sub-class Array so the other built-in + // functions work, the constructor has to behave fairly + // well. So, in the event we are created via fromItems() + // we build the read-only Result object we want, but on + // any other input, we use the default constructor + // constructor(guard: any, items: Array, keys?: Array); + const guard = args[0]; + let items = args[1]; + let names = (args[2] || []).slice(); + let wrap = true; + if (guard !== _guard$3) { + items = args; + names = []; + wrap = false; + } + // Can't just pass in ...items since an array of length 1 + // is a special case in the super. + super(items.length); + items.forEach((item, index) => { + this[index] = item; + }); + // Find all unique keys + const nameCounts = names.reduce((accum, name) => { + if (typeof name === "string") { + accum.set(name, (accum.get(name) || 0) + 1); + } + return accum; + }, new Map()); + // Remove any key thats not unique + this.#names = Object.freeze(items.map((item, index) => { + const name = names[index]; + if (name != null && nameCounts.get(name) === 1) { + return name; + } + return null; + })); + if (!wrap) { + return; + } + // A wrapped Result is immutable + Object.freeze(this); + // Proxy indices and names so we can trap deferred errors + return new Proxy(this, { + get: (target, prop, receiver) => { + if (typeof prop === "string") { + // Index accessor + if (prop.match(/^[0-9]+$/)) { + const index = getNumber(prop, "%index"); + if (index < 0 || index >= this.length) { + throw new RangeError("out of result range"); + } + const item = target[index]; + if (item instanceof Error) { + throwError(`index ${index}`, item); + } + return item; + } + // Pass important checks (like `then` for Promise) through + if (passProperties$1.indexOf(prop) >= 0) { + return Reflect.get(target, prop, receiver); + } + const value = target[prop]; + if (value instanceof Function) { + // Make sure functions work with private variables + // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding + return function (...args) { + return value.apply(this === receiver ? target : this, args); + }; + } + else if (!(prop in target)) { + // Possible name accessor + return target.getValue.apply(this === receiver ? target : this, [ + prop, + ]); + } + } + return Reflect.get(target, prop, receiver); + }, + }); + } + /** + * Returns the Result as a normal Array. + * + * This will throw if there are any outstanding deferred + * errors. + */ + toArray() { + const result = []; + this.forEach((item, index) => { + if (item instanceof Error) { + throwError(`index ${index}`, item); + } + result.push(item); + }); + return result; + } + /** + * Returns the Result as an Object with each name-value pair. + * + * This will throw if any value is unnamed, or if there are + * any outstanding deferred errors. + */ + toObject() { + return this.#names.reduce((accum, name, index) => { + assert(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", { + operation: "toObject()", + }); + // Add values for names that don't conflict + if (!(name in accum)) { + accum[name] = this.getValue(name); + } + return accum; + }, {}); + } + /** + * @_ignore + */ + slice(start, end) { + if (start == null) { + start = 0; + } + if (start < 0) { + start += this.length; + if (start < 0) { + start = 0; + } + } + if (end == null) { + end = this.length; + } + if (end < 0) { + end += this.length; + if (end < 0) { + end = 0; + } + } + if (end > this.length) { + end = this.length; + } + const result = [], names = []; + for (let i = start; i < end; i++) { + result.push(this[i]); + names.push(this.#names[i]); + } + return new Result(_guard$3, result, names); + } + /** + * @_ignore + */ + filter(callback, thisArg) { + const result = [], names = []; + for (let i = 0; i < this.length; i++) { + const item = this[i]; + if (item instanceof Error) { + throwError(`index ${i}`, item); + } + if (callback.call(thisArg, item, i, this)) { + result.push(item); + names.push(this.#names[i]); + } + } + return new Result(_guard$3, result, names); + } + /** + * Returns the value for %%name%%. + * + * Since it is possible to have a key whose name conflicts with + * a method on a [[Result]] or its superclass Array, or any + * JavaScript keyword, this ensures all named values are still + * accessible by name. + */ + getValue(name) { + const index = this.#names.indexOf(name); + if (index === -1) { + return undefined; + } + const value = this[index]; + if (value instanceof Error) { + throwError(`property ${JSON.stringify(name)}`, value.error); + } + return value; + } + /** + * Creates a new [[Result]] for %%items%% with each entry + * also accessible by its corresponding name in %%keys%%. + */ + static fromItems(items, keys) { + return new Result(_guard$3, items, keys); + } + } + /** + * Returns all errors found in a [[Result]]. + * + * Since certain errors encountered when creating a [[Result]] do + * not impact the ability to continue parsing data, they are + * deferred until they are actually accessed. Hence a faulty string + * in an Event that is never used does not impact the program flow. + * + * However, sometimes it may be useful to access, identify or + * validate correctness of a [[Result]]. + * + * @_docloc api/abi + */ + function checkResultErrors(result) { + // Find the first error (if any) + const errors = []; + const checkErrors = function (path, object) { + if (!Array.isArray(object)) { + return; + } + for (let key in object) { + const childPath = path.slice(); + childPath.push(key); + try { + checkErrors(childPath, object[key]); + } + catch (error) { + errors.push({ path: childPath, error: error }); + } + } + }; + checkErrors([], result); + return errors; + } + function getValue$1(value) { + let bytes = toBeArray(value); + assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { + buffer: bytes, + length: WordSize, + offset: bytes.length, + }); + if (bytes.length !== WordSize) { + bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes])); + } + return bytes; + } + /** + * @_ignore + */ + class Coder { + // The coder name: + // - address, uint256, tuple, array, etc. + name; + // The fully expanded type, including composite types: + // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. + type; + // The localName bound in the signature, in this example it is "baz": + // - tuple(address foo, uint bar) baz + localName; + // Whether this type is dynamic: + // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. + // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) + dynamic; + constructor(name, type, localName, dynamic) { + defineProperties(this, { name, type, localName, dynamic }, { + name: "string", + type: "string", + localName: "string", + dynamic: "boolean", + }); + } + _throwError(message, value) { + assertArgument(false, message, this.localName, value); + } + } + /** + * @_ignore + */ + class Writer { + // An array of WordSize lengthed objects to concatenation + #data; + #dataLength; + constructor() { + this.#data = []; + this.#dataLength = 0; + } + get data() { + return concat(this.#data); + } + get length() { + return this.#dataLength; + } + #writeData(data) { + this.#data.push(data); + this.#dataLength += data.length; + return data.length; + } + appendWriter(writer) { + return this.#writeData(getBytesCopy(writer.data)); + } + // Arrayish item; pad on the right to *nearest* WordSize + writeBytes(value) { + let bytes = getBytesCopy(value); + const paddingOffset = bytes.length % WordSize; + if (paddingOffset) { + bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); + } + return this.#writeData(bytes); + } + // Numeric item; pad on the left *to* WordSize + writeValue(value) { + return this.#writeData(getValue$1(value)); + } + // Inserts a numeric place-holder, returning a callback that can + // be used to asjust the value later + writeUpdatableValue() { + const offset = this.#data.length; + this.#data.push(Padding); + this.#dataLength += WordSize; + return (value) => { + this.#data[offset] = getValue$1(value); + }; + } + } + /** + * @_ignore + */ + class Reader { + // Allows incomplete unpadded data to be read; otherwise an error + // is raised if attempting to overrun the buffer. This is required + // to deal with an old Solidity bug, in which event data for + // external (not public thoguh) was tightly packed. + allowLoose; + #data; + #offset; + constructor(data, allowLoose) { + defineProperties(this, { allowLoose: !!allowLoose }); + this.#data = getBytesCopy(data); + this.#offset = 0; + } + get data() { + return hexlify(this.#data); + } + get dataLength() { + return this.#data.length; + } + get consumed() { + return this.#offset; + } + get bytes() { + return new Uint8Array(this.#data); + } + #peekBytes(offset, length, loose) { + let alignedLength = Math.ceil(length / WordSize) * WordSize; + if (this.#offset + alignedLength > this.#data.length) { + if (this.allowLoose && + loose && + this.#offset + length <= this.#data.length) { + alignedLength = length; + } + else { + assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { + buffer: getBytesCopy(this.#data), + length: this.#data.length, + offset: this.#offset + alignedLength, + }); + } + } + return this.#data.slice(this.#offset, this.#offset + alignedLength); + } + // Create a sub-reader with the same underlying data, but offset + subReader(offset) { + return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose); + } + // Read bytes + readBytes(length, loose) { + let bytes = this.#peekBytes(0, length, !!loose); + this.#offset += bytes.length; + // @TODO: Make sure the length..end bytes are all 0? + return bytes.slice(0, length); + } + // Read a numeric values + readValue() { + return toBigInt(this.readBytes(WordSize)); + } + readIndex() { + return toNumber(this.readBytes(WordSize)); + } + } + + /** + * A Typed object allows a value to have its type explicitly + * specified. + * + * For example, in Solidity, the value ``45`` could represent a + * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent + * a ``bytes2`` or ``bytes``. + * + * Since JavaScript has no meaningful way to explicitly inform any + * APIs which what the type is, this allows transparent interoperation + * with Soldity. + * + * @_subsection: api/abi:Typed Values + */ + const _gaurd = {}; + function n(value, width) { + let signed = false; + if (width < 0) { + signed = true; + width *= -1; + } + // @TODO: Check range is valid for value + return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { + signed, + width, + }); + } + function b(value, size) { + // @TODO: Check range is valid for value + return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size }); + } + const _typedSymbol = Symbol.for("_corebc_typed"); + class Typed { + type; + value; + #options; + _typedSymbol; + constructor(gaurd, type, value, options) { + if (options == null) { + options = null; + } + assertPrivate(_gaurd, gaurd, "Typed"); + defineProperties(this, { _typedSymbol, type, value }); + this.#options = options; + // Check the value is valid + this.format(); + } + format() { + if (this.type === "array") { + throw new Error(""); + } + else if (this.type === "dynamicArray") { + throw new Error(""); + } + else if (this.type === "tuple") { + return `tuple(${this.value.map((v) => v.format()).join(",")})`; + } + return this.type; + } + defaultValue() { + return 0; + } + minValue() { + return 0; + } + maxValue() { + return 0; + } + isBigInt() { + return !!this.type.match(/^u?int[0-9]+$/); + } + isData() { + return this.type.startsWith("bytes"); + } + isString() { + return this.type === "string"; + } + get tupleName() { + if (this.type !== "tuple") { + throw TypeError("not a tuple"); + } + return this.#options; + } + // Returns the length of this type as an array + // - `null` indicates the length is unforced, it could be dynamic + // - `-1` indicates the length is dynamic + // - any other value indicates it is a static array and is its length + get arrayLength() { + if (this.type !== "array") { + throw TypeError("not an array"); + } + if (this.#options === true) { + return -1; + } + if (this.#options === false) { + return this.value.length; + } + return null; + } + static from(type, value) { + return new Typed(_gaurd, type, value); + } + static uint8(v) { + return n(v, 8); + } + static uint16(v) { + return n(v, 16); + } + static uint24(v) { + return n(v, 24); + } + static uint32(v) { + return n(v, 32); + } + static uint40(v) { + return n(v, 40); + } + static uint48(v) { + return n(v, 48); + } + static uint56(v) { + return n(v, 56); + } + static uint64(v) { + return n(v, 64); + } + static uint72(v) { + return n(v, 72); + } + static uint80(v) { + return n(v, 80); + } + static uint88(v) { + return n(v, 88); + } + static uint96(v) { + return n(v, 96); + } + static uint104(v) { + return n(v, 104); + } + static uint112(v) { + return n(v, 112); + } + static uint120(v) { + return n(v, 120); + } + static uint128(v) { + return n(v, 128); + } + static uint136(v) { + return n(v, 136); + } + static uint144(v) { + return n(v, 144); + } + static uint152(v) { + return n(v, 152); + } + static uint160(v) { + return n(v, 160); + } + static uint168(v) { + return n(v, 168); + } + static uint176(v) { + return n(v, 176); + } + static uint184(v) { + return n(v, 184); + } + static uint192(v) { + return n(v, 192); + } + static uint200(v) { + return n(v, 200); + } + static uint208(v) { + return n(v, 208); + } + static uint216(v) { + return n(v, 216); + } + static uint224(v) { + return n(v, 224); + } + static uint232(v) { + return n(v, 232); + } + static uint240(v) { + return n(v, 240); + } + static uint248(v) { + return n(v, 248); + } + static uint256(v) { + return n(v, 256); + } + static uint(v) { + return n(v, 256); + } + static int8(v) { + return n(v, -8); + } + static int16(v) { + return n(v, -16); + } + static int24(v) { + return n(v, -24); + } + static int32(v) { + return n(v, -32); + } + static int40(v) { + return n(v, -40); + } + static int48(v) { + return n(v, -48); + } + static int56(v) { + return n(v, -56); + } + static int64(v) { + return n(v, -64); + } + static int72(v) { + return n(v, -72); + } + static int80(v) { + return n(v, -80); + } + static int88(v) { + return n(v, -88); + } + static int96(v) { + return n(v, -96); + } + static int104(v) { + return n(v, -104); + } + static int112(v) { + return n(v, -112); + } + static int120(v) { + return n(v, -120); + } + static int128(v) { + return n(v, -128); + } + static int136(v) { + return n(v, -136); + } + static int144(v) { + return n(v, -144); + } + static int152(v) { + return n(v, -152); + } + static int160(v) { + return n(v, -160); + } + static int168(v) { + return n(v, -168); + } + static int176(v) { + return n(v, -176); + } + static int184(v) { + return n(v, -184); + } + static int192(v) { + return n(v, -192); + } + static int200(v) { + return n(v, -200); + } + static int208(v) { + return n(v, -208); + } + static int216(v) { + return n(v, -216); + } + static int224(v) { + return n(v, -224); + } + static int232(v) { + return n(v, -232); + } + static int240(v) { + return n(v, -240); + } + static int248(v) { + return n(v, -248); + } + static int256(v) { + return n(v, -256); + } + static int(v) { + return n(v, -256); + } + static bytes1(v) { + return b(v, 1); + } + static bytes2(v) { + return b(v, 2); + } + static bytes3(v) { + return b(v, 3); + } + static bytes4(v) { + return b(v, 4); + } + static bytes5(v) { + return b(v, 5); + } + static bytes6(v) { + return b(v, 6); + } + static bytes7(v) { + return b(v, 7); + } + static bytes8(v) { + return b(v, 8); + } + static bytes9(v) { + return b(v, 9); + } + static bytes10(v) { + return b(v, 10); + } + static bytes11(v) { + return b(v, 11); + } + static bytes12(v) { + return b(v, 12); + } + static bytes13(v) { + return b(v, 13); + } + static bytes14(v) { + return b(v, 14); + } + static bytes15(v) { + return b(v, 15); + } + static bytes16(v) { + return b(v, 16); + } + static bytes17(v) { + return b(v, 17); + } + static bytes18(v) { + return b(v, 18); + } + static bytes19(v) { + return b(v, 19); + } + static bytes20(v) { + return b(v, 20); + } + static bytes21(v) { + return b(v, 21); + } + static bytes22(v) { + return b(v, 22); + } + static bytes23(v) { + return b(v, 23); + } + static bytes24(v) { + return b(v, 24); + } + static bytes25(v) { + return b(v, 25); + } + static bytes26(v) { + return b(v, 26); + } + static bytes27(v) { + return b(v, 27); + } + static bytes28(v) { + return b(v, 28); + } + static bytes29(v) { + return b(v, 29); + } + static bytes30(v) { + return b(v, 30); + } + static bytes31(v) { + return b(v, 31); + } + static bytes32(v) { + return b(v, 32); + } + static address(v) { + return new Typed(_gaurd, "address", v); + } + static bool(v) { + return new Typed(_gaurd, "bool", !!v); + } + static bytes(v) { + return new Typed(_gaurd, "bytes", v); + } + static string(v) { + return new Typed(_gaurd, "string", v); + } + static array(v, dynamic) { + throw new Error("not implemented yet"); + } + static tuple(v, name) { + throw new Error("not implemented yet"); + } + static overrides(v) { + return new Typed(_gaurd, "overrides", Object.assign({}, v)); + } + /** + * Returns true only if %%value%% is a [[Typed]] instance. + */ + static isTyped(value) { + return value && value._typedSymbol === _typedSymbol; + } + /** + * If the value is a [[Typed]] instance, validates the underlying value + * and returns it, otherwise returns value directly. + * + * This is useful for functions that with to accept either a [[Typed]] + * object or values. + */ + static dereference(value, type) { + if (Typed.isTyped(value)) { + if (value.type !== type) { + throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); + } + return value.value; + } + return value; + } + } + + /** + * @_ignore + */ + class AddressCoder extends Coder { + constructor(localName) { + super("address", "address", localName, false); + } + defaultValue() { + return "0x0000000000000000000000000000000000000000"; + } + encode(writer, _value) { + let value = Typed.dereference(_value, "string"); + try { + value = getAddress(value); + } + catch (error) { + return this._throwError(error.message, _value); + } + return writer.writeValue(value); + } + decode(reader) { + return getAddress(toBeHex(reader.readValue(), 22)); + } + } + + /** + * Clones the functionality of an existing Coder, but without a localName + * + * @_ignore + */ + class AnonymousCoder extends Coder { + coder; + constructor(coder) { + super(coder.name, coder.type, "_", coder.dynamic); + this.coder = coder; + } + defaultValue() { + return this.coder.defaultValue(); + } + encode(writer, value) { + return this.coder.encode(writer, value); + } + decode(reader) { + return this.coder.decode(reader); + } + } + + /** + * @_ignore + */ + function pack(writer, coders, values) { + let arrayValues = []; + if (Array.isArray(values)) { + arrayValues = values; + } + else if (values && typeof values === "object") { + let unique = {}; + arrayValues = coders.map((coder) => { + const name = coder.localName; + assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); + assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); + unique[name] = true; + return values[name]; + }); + } + else { + assertArgument(false, "invalid tuple value", "tuple", values); + } + assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); + let staticWriter = new Writer(); + let dynamicWriter = new Writer(); + let updateFuncs = []; + coders.forEach((coder, index) => { + let value = arrayValues[index]; + if (coder.dynamic) { + // Get current dynamic offset (for the future pointer) + let dynamicOffset = dynamicWriter.length; + // Encode the dynamic value into the dynamicWriter + coder.encode(dynamicWriter, value); + // Prepare to populate the correct offset once we are done + let updateFunc = staticWriter.writeUpdatableValue(); + updateFuncs.push((baseOffset) => { + updateFunc(baseOffset + dynamicOffset); + }); + } + else { + coder.encode(staticWriter, value); + } + }); + // Backfill all the dynamic offsets, now that we know the static length + updateFuncs.forEach((func) => { + func(staticWriter.length); + }); + let length = writer.appendWriter(staticWriter); + length += writer.appendWriter(dynamicWriter); + return length; + } + /** + * @_ignore + */ + function unpack(reader, coders) { + let values = []; + let keys = []; + // A reader anchored to this base + let baseReader = reader.subReader(0); + coders.forEach((coder) => { + let value = null; + if (coder.dynamic) { + let offset = reader.readIndex(); + let offsetReader = baseReader.subReader(offset); + try { + value = coder.decode(offsetReader); + } + catch (error) { + // Cannot recover from this + if (isError(error, "BUFFER_OVERRUN")) { + throw error; + } + value = error; + value.baseType = coder.name; + value.name = coder.localName; + value.type = coder.type; + } + } + else { + try { + value = coder.decode(reader); + } + catch (error) { + // Cannot recover from this + if (isError(error, "BUFFER_OVERRUN")) { + throw error; + } + value = error; + value.baseType = coder.name; + value.name = coder.localName; + value.type = coder.type; + } + } + if (value == undefined) { + throw new Error("investigate"); + } + values.push(value); + keys.push(coder.localName || null); + }); + return Result.fromItems(values, keys); + } + /** + * @_ignore + */ + class ArrayCoder extends Coder { + coder; + length; + constructor(coder, length, localName) { + const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; + const dynamic = length === -1 || coder.dynamic; + super("array", type, localName, dynamic); + defineProperties(this, { coder, length }); + } + defaultValue() { + // Verifies the child coder is valid (even if the array is dynamic or 0-length) + const defaultChild = this.coder.defaultValue(); + const result = []; + for (let i = 0; i < this.length; i++) { + result.push(defaultChild); + } + return result; + } + encode(writer, _value) { + const value = Typed.dereference(_value, "array"); + if (!Array.isArray(value)) { + this._throwError("expected array value", value); + } + let count = this.length; + if (count === -1) { + count = value.length; + writer.writeValue(value.length); + } + assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); + let coders = []; + for (let i = 0; i < value.length; i++) { + coders.push(this.coder); + } + return pack(writer, coders, value); + } + decode(reader) { + let count = this.length; + if (count === -1) { + count = reader.readIndex(); + // Check that there is *roughly* enough data to ensure + // stray random data is not being read as a length. Each + // slot requires at least 32 bytes for their value (or 32 + // bytes as a link to the data). This could use a much + // tighter bound, but we are erroring on the side of safety. + assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { + buffer: reader.bytes, + offset: count * WordSize, + length: reader.dataLength, + }); + } + let coders = []; + for (let i = 0; i < count; i++) { + coders.push(new AnonymousCoder(this.coder)); + } + return unpack(reader, coders); + } + } + + /** + * @_ignore + */ + class BooleanCoder extends Coder { + constructor(localName) { + super("bool", "bool", localName, false); + } + defaultValue() { + return false; + } + encode(writer, _value) { + const value = Typed.dereference(_value, "bool"); + return writer.writeValue(value ? 1 : 0); + } + decode(reader) { + return !!reader.readValue(); + } + } + + /** + * @_ignore + */ + class DynamicBytesCoder extends Coder { + constructor(type, localName) { + super(type, type, localName, true); + } + defaultValue() { + return "0x"; + } + encode(writer, value) { + value = getBytesCopy(value); + let length = writer.writeValue(value.length); + length += writer.writeBytes(value); + return length; + } + decode(reader) { + return reader.readBytes(reader.readIndex(), true); + } + } + /** + * @_ignore + */ + class BytesCoder extends DynamicBytesCoder { + constructor(localName) { + super("bytes", localName); + } + decode(reader) { + return hexlify(super.decode(reader)); + } + } + + /** + * @_ignore + */ + class FixedBytesCoder extends Coder { + size; + constructor(size, localName) { + let name = "bytes" + String(size); + super(name, name, localName, false); + defineProperties(this, { size }, { size: "number" }); + } + defaultValue() { + return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); + } + encode(writer, _value) { + let data = getBytesCopy(Typed.dereference(_value, this.type)); + if (data.length !== this.size) { + this._throwError("incorrect data length", _value); + } + return writer.writeBytes(data); + } + decode(reader) { + return hexlify(reader.readBytes(this.size)); + } + } + + const Empty = new Uint8Array([]); + /** + * @_ignore + */ + class NullCoder extends Coder { + constructor(localName) { + super("null", "", localName, false); + } + defaultValue() { + return null; + } + encode(writer, value) { + if (value != null) { + this._throwError("not null", value); + } + return writer.writeBytes(Empty); + } + decode(reader) { + reader.readBytes(0); + return null; + } + } + + const BN_0$5 = BigInt(0); + const BN_1$2 = BigInt(1); + const BN_MAX_UINT256$1 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + /** + * @_ignore + */ + class NumberCoder extends Coder { + size; + signed; + constructor(size, signed, localName) { + const name = (signed ? "int" : "uint") + size * 8; + super(name, name, localName, false); + defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); + } + defaultValue() { + return 0; + } + encode(writer, _value) { + let value = getBigInt(Typed.dereference(_value, this.type)); + // Check bounds are safe for encoding + let maxUintValue = mask(BN_MAX_UINT256$1, WordSize * 8); + if (this.signed) { + let bounds = mask(maxUintValue, this.size * 8 - 1); + if (value > bounds || value < -(bounds + BN_1$2)) { + this._throwError("value out-of-bounds", _value); + } + value = toTwos(value, 8 * WordSize); + } + else if (value < BN_0$5 || value > mask(maxUintValue, this.size * 8)) { + this._throwError("value out-of-bounds", _value); + } + return writer.writeValue(value); + } + decode(reader) { + let value = mask(reader.readValue(), this.size * 8); + if (this.signed) { + value = fromTwos(value, this.size * 8); + } + return value; + } + } + + /** + * @_ignore + */ + class StringCoder extends DynamicBytesCoder { + constructor(localName) { + super("string", localName); + } + defaultValue() { + return ""; + } + encode(writer, _value) { + return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); + } + decode(reader) { + return toUtf8String(super.decode(reader)); + } + } + + /** + * @_ignore + */ + class TupleCoder extends Coder { + coders; + constructor(coders, localName) { + let dynamic = false; + const types = []; + coders.forEach((coder) => { + if (coder.dynamic) { + dynamic = true; + } + types.push(coder.type); + }); + const type = "tuple(" + types.join(",") + ")"; + super("tuple", type, localName, dynamic); + defineProperties(this, { + coders: Object.freeze(coders.slice()), + }); + } + defaultValue() { + const values = []; + this.coders.forEach((coder) => { + values.push(coder.defaultValue()); + }); + // We only output named properties for uniquely named coders + const uniqueNames = this.coders.reduce((accum, coder) => { + const name = coder.localName; + if (name) { + if (!accum[name]) { + accum[name] = 0; + } + accum[name]++; + } + return accum; + }, {}); + // Add named values + this.coders.forEach((coder, index) => { + let name = coder.localName; + if (!name || uniqueNames[name] !== 1) { + return; + } + if (name === "length") { + name = "_length"; + } + if (values[name] != null) { + return; + } + values[name] = values[index]; + }); + return Object.freeze(values); + } + encode(writer, _value) { + const value = Typed.dereference(_value, "tuple"); + return pack(writer, this.coders, value); + } + decode(reader) { + return unpack(reader, this.coders); + } + } + + /** + * A simple hashing function which operates on UTF-8 strings to + * compute an 32-byte identifier. + * + * + * @example: + * id("hello world") + * //_result: + */ + function id(value, useKeccak) { + if (useKeccak) { + return keccak256(toUtf8Bytes(value)); + } + return sha256(toUtf8Bytes(value)); + } + + /** + * A constant for the zero address. + * + * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) + */ + const ZeroAddress = "0x0000000000000000000000000000000000000000"; + + /** + * A constant for the zero hash. + * + * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) + */ + const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; + + /** + * A constant for the order N for the secp256k1 curve. + * + * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) + */ + const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); + /** + * A constant for the number of ore in a single xcb. + * + * (**i.e.** ``1000000000000000000n``) + */ + const OrePerXCB = BigInt("1000000000000000000"); + /** + * A constant for the maximum value for a ``uint256``. + * + * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) + */ + const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + /** + * A constant for the minimum value for an ``int256``. + * + * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) + */ + const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * + BigInt(-1); + /** + * A constant for the maximum value for an ``int256``. + * + * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) + */ + const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + + // NFKC (composed) // (decomposed) + /** + * A constant for the core symbol (normalized using NFKC). + * + * (**i.e.** ``"\\u039e"``) + */ + const CoreSymbol = "\u039e"; // "\uD835\uDF63"; + /** + * A constant for the [[link-eip-191]] personal message prefix. + * + * (**i.e.** ``"\\x19Core Signed Message:\\n"``) + */ + const MessagePrefix = "\x19Core Signed Message:\n"; + + function accessSetify(addr, storageKeys) { + return { + address: getAddress(addr), + storageKeys: storageKeys.map((storageKey, index) => { + assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); + return storageKey.toLowerCase(); + }), + }; + } + /** + * Returns a [[AccessList]] from any corebcsupported access-list structure. + */ + function accessListify(value) { + if (Array.isArray(value)) { + return value.map((set, index) => { + if (Array.isArray(set)) { + assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); + return accessSetify(set[0], set[1]); + } + assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value); + return accessSetify(set.address, set.storageKeys); + }); + } + assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); + const result = Object.keys(value).map((addr) => { + const storageKeys = value[addr].reduce((accum, storageKey) => { + accum[storageKey] = true; + return accum; + }, {}); + return accessSetify(addr, Object.keys(storageKeys).sort()); + }); + result.sort((a, b) => a.address.localeCompare(b.address)); + return result; + } + + const logger$1 = new Logger("transaction/0.0.1"); + const BN_0$4 = BigInt(0); + function handleAddress(value) { + if (value === "0x") { + return null; + } + return getAddress(value); + } + function parse(data) { + const handleNumber = (value) => { + // @ts-ignore + if (value === "0x") { + return BigNumber.from(0); + } + return BigNumber.from(value); + }; + const transaction = decode$1(data); + if (transaction.length !== 7 && transaction.length !== 8) { + logger$1.throwArgumentError("invalid raw transaction", "data", data); + } + const isSigned = transaction.length === 8; + const tx = { + nonce: Number(handleNumber(transaction[0])), + energyPrice: handleNumber(transaction[1]).toBigInt(), + energyLimit: handleNumber(transaction[2]).toBigInt(), + networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(), + to: handleAddress(transaction[isSigned ? 4 : 3]), + value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(), + data: transaction[isSigned ? 6 : 5], + }; + if (transaction.length === 8) { + const prefix = networkIdToPrefix(Number(tx.networkId)); + const digest = sha256(serialize(tx)); + tx.hash = sha256(serialize(tx, transaction[7])); + tx.from = recoverAddress(digest, transaction[7], prefix); + tx.signature = transaction[7]; + } + return tx; + } + const unsignedTransactionFields = [ + { name: "nonce", maxLength: 32, numeric: true }, + { name: "energyPrice", maxLength: 32, numeric: true }, + { name: "energyLimit", maxLength: 32, numeric: true }, + { name: "to", length: 22 }, + { name: "value", maxLength: 32, numeric: true }, + { name: "data" }, + { name: "networkId", maxLength: 32, numeric: true }, + ]; + const transactionFields = [ + { name: "nonce", maxLength: 32, numeric: true }, + { name: "energyPrice", maxLength: 32, numeric: true }, + { name: "energyLimit", maxLength: 32, numeric: true }, + { name: "networkId", maxLength: 32, numeric: true }, + { name: "to", length: 22 }, + { name: "value", maxLength: 32, numeric: true }, + { name: "data" }, + ]; + const allowedTransactionKeys = { + networkId: true, + data: true, + energyLimit: true, + energyPrice: true, + nonce: true, + to: true, + value: true, + }; + function serialize(transaction, signature) { + checkProperties(transaction, allowedTransactionKeys); + const raw = []; + (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) { + let value = transaction[name] || []; + const options = {}; + if (numeric) { + options.hexPad = "left"; + } + const tmpHexlified = hexlify(value, options); + value = arrayify(tmpHexlified); + // Fixed-width field + if (length && value.length !== length && value.length > 0) { + logger$1.throwArgumentError("invalid length for " + name, "transaction:" + name, value); + } + // Variable-width (with a maximum) + if (maxLength) { + value = stripZeros(value); + if (value.length > maxLength) { + logger$1.throwArgumentError("invalid length for " + name, "transaction:" + name, value); + } + } + const hexlified = hexlify(value); + raw.push(hexlified); + }); + if (!!signature) { + raw.push(hexlify(signature)); + } + const finalValue = encode(raw); + return finalValue; + } + /** + * A **Transaction** describes an operation to be executed on + * Core by an Externally Owned Account (EOA). It includes + * who (the [[to]] address), what (the [[data]]) and how much (the + * [[value]] in corebc) the operation should entail. + * + * @example: + * tx = new Transaction() + * //_result: + * + * tx.data = "0x1234"; + * //_result: + */ + class Transaction { + #to; + #data; + #nonce; + #energyLimit; + #energyPrice; + #value; + #networkId; + #sig; + /** + * The ``to`` address for the transaction or ``null`` if the + * transaction is an ``init`` transaction. + */ + get to() { + return this.#to; + } + set to(value) { + this.#to = value == null ? null : getAddress(value); + } + /** + * The transaction nonce. + */ + get nonce() { + return this.#nonce; + } + set nonce(value) { + this.#nonce = getNumber(value, "value"); + } + /** + * The energy limit. + */ + get energyLimit() { + return this.#energyLimit; + } + set energyLimit(value) { + this.#energyLimit = getBigInt(value); + } + /** + * The energy price. + * + * On legacy networks this defines the fee that will be paid. On + * EIP-1559 networks, this should be ``null``. + */ + get energyPrice() { + const value = this.#energyPrice; + if (value == null) { + return BN_0$4; + } + return value; + } + set energyPrice(value) { + this.#energyPrice = value == null ? null : getBigInt(value, "energyPrice"); + } + /** + * The transaction data. For ``init`` transactions this is the + * deployment code. + */ + get data() { + return this.#data; + } + set data(value) { + this.#data = hexlify(value); + } + /** + * The amount of xcb (in ore) to send in this transactions. + */ + get value() { + return this.#value; + } + set value(value) { + this.#value = getBigInt(value, "value"); + } + /** + * The chain ID this transaction is valid on. + */ + get networkId() { + return this.#networkId; + } + set networkId(value) { + this.#networkId = getBigInt(value); + } + /** + * If signed, the signature for this transaction. + */ + get signature() { + return this.#sig || null; + } + set signature(value) { + this.#sig = value == null ? null : value; + } + /** + * Creates a new Transaction with default values. + */ + constructor() { + this.#to = null; + this.#nonce = 0; + this.#energyLimit = BigInt(0); + this.#energyPrice = null; + this.#data = "0x"; + this.#value = BigInt(0); + this.#networkId = BigInt(0); + this.#sig = null; + } + /** + * The transaction hash, if signed. Otherwise, ``null``. + */ + get hash() { + if (this.signature == null) { + return null; + } + return sha256(this.serialized); + } + /** + * The pre-image hash of this transaction. + * + * This is the digest that a [[Signer]] must sign to authorize + * this transaction. + */ + get unsignedHash() { + return sha256(this.unsignedSerialized); + } + /** + * The sending address, if signed. Otherwise, ``null``. + */ + get from() { + if (this.signature == null) { + return null; + } + const prefix = networkIdToPrefix(Number(this.#networkId)); + return recoverAddress(this.unsignedHash, this.signature, prefix); + } + /** + * The public key of the sender, if signed. Otherwise, ``null``. + */ + get fromPublicKey() { + if (this.signature == null) { + return null; + } + return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); + } + /** + * Returns true if signed. + * + * This provides a Type Guard that properties requiring a signed + * transaction are non-null. + */ + isSigned() { + //isSigned(): this is SignedTransaction { + return this.signature != null; + } + /** + * The serialized transaction. + * + * This throws if the transaction is unsigned. For the pre-image, + * use [[unsignedSerialized]]. + */ + get serialized() { + assert(this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); + return serialize(this, this.signature); + } + /** + * The transaction pre-image. + * + * The hash of this is the digest which needs to be signed to + * authorize this transaction. + */ + get unsignedSerialized() { + return serialize(this); + } + /** + * Create a copy of this transaciton. + */ + clone() { + return Transaction.from(this); + } + /** + * Return a JSON-friendly object. + */ + toJSON() { + const s = (v) => { + if (v == null) { + return null; + } + return v.toString(); + }; + return { + to: this.to, + data: this.data, + nonce: this.nonce, + energyLimit: s(this.energyLimit), + energyPrice: s(this.energyPrice), + value: s(this.value), + networkId: s(this.networkId), + sig: this.signature ? this.signature : null, + }; + } + /** + * Create a **Transaction** from a serialized transaction or a + * Transaction-like object. + */ + static from(tx) { + if (tx == null) { + return new Transaction(); + } + if (typeof tx === "string") { + const payload = getBytes(tx); + return Transaction.from(parse(payload)); + } + const result = new Transaction(); + if (tx.to != null) { + result.to = tx.to; + } + if (tx.nonce != null) { + result.nonce = tx.nonce; + } + if (tx.energyLimit != null) { + result.energyLimit = tx.energyLimit; + } + if (tx.energyPrice != null) { + result.energyPrice = tx.energyPrice; + } + if (tx.data != null) { + result.data = tx.data; + } + if (tx.value != null) { + result.value = tx.value; + } + if (tx.networkId != null) { + result.networkId = tx.networkId; + } + if (tx.signature != null) { + result.signature = tx.signature; + } + if (tx.hash != null) { + assertArgument(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); + assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); + } + if (tx.from != null) { + assertArgument(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); + assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); + } + return result; + } + } + + /** + * Computes the [[link-eip-191]] personal-sign message digest to sign. + * + * + * If %%message%% is a string, it is converted to its UTF-8 bytes + * first. To compute the digest of a [[DataHexString]], it must be converted + * to [bytes](getBytes). + * + * @example: + * hashMessage("Hello World") + * //_result: + * + * // Hashes the SIX (6) string characters, i.e. + * // [ "0", "x", "4", "2", "4", "3" ] + * hashMessage("0x4243") + * //_result: + * + * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... + * hashMessage(getBytes("0x4243")) + * //_result: + * + * // ...which is equal to using data + * hashMessage(new Uint8Array([ 0x42, 0x43 ])) + * //_result: + * + */ + function hashMessage(message) { + if (typeof message === "string") { + message = toUtf8Bytes(message); + } + return sha256(concat([ + toUtf8Bytes(MessagePrefix), + toUtf8Bytes(String(message.length)), + message, + ])); + } + /** + * Return the address of the private key that produced + * the signature %%sig%% during signing for %%message%%. + */ + function verifyMessage(message, sig, prefix) { + const digest = hashMessage(message); + return recoverAddress(digest, sig, prefix); + } + + const regexBytes = new RegExp("^bytes([0-9]+)$"); + const regexNumber = new RegExp("^(u?int)([0-9]*)$"); + const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); + function _pack(type, value, isArray) { + switch (type) { + case "address": + if (isArray) { + return getBytes(zeroPadValue(value, 32)); + } + return getBytes(getAddress(value)); + case "string": + return toUtf8Bytes(value); + case "bytes": + return getBytes(value); + case "bool": + value = !!value ? "0x01" : "0x00"; + if (isArray) { + return getBytes(zeroPadValue(value, 32)); + } + return getBytes(value); + } + let match = type.match(regexNumber); + if (match) { + let signed = match[1] === "int"; + let size = parseInt(match[2] || "256"); + assertArgument((!match[2] || match[2] === String(size)) && + size % 8 === 0 && + size !== 0 && + size <= 256, "invalid number type", "type", type); + if (isArray) { + size = 256; + } + if (signed) { + value = toTwos(value, size); + } + return getBytes(zeroPadValue(toBeArray(value), size / 8)); + } + match = type.match(regexBytes); + if (match) { + const size = parseInt(match[1]); + assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); + assertArgument(dataLength(value) === size, `invalid value for ${type}`, "value", value); + if (isArray) { + return getBytes(zeroPadBytes(value, 32)); + } + return value; + } + match = type.match(regexArray); + if (match && Array.isArray(value)) { + const baseType = match[1]; + const count = parseInt(match[2] || String(value.length)); + assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); + const result = []; + value.forEach(function (value) { + result.push(_pack(baseType, value, true)); + }); + return getBytes(concat(result)); + } + assertArgument(false, "invalid type", "type", type); + } + // @TODO: Array Enum + /** + * Computes the [[link-solc-packed]] representation of %%values%% + * respectively to their %%types%%. + * + * @example: + * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" + * solidityPacked([ "address", "uint" ], [ addr, 45 ]); + * //_result: + */ + function solidityPacked(types, values) { + assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); + const tight = []; + types.forEach(function (type, index) { + tight.push(_pack(type, values[index])); + }); + return hexlify(concat(tight)); + } + /** + * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% + * respectively to their %%types%%. + * + * @example: + * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" + * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); + * //_result: + */ + function solidityPackedSha256(types, values) { + return sha256(solidityPacked(types, values)); + } + + const padding = new Uint8Array(32); + padding.fill(0); + const BN__1 = BigInt(-1); + const BN_0$3 = BigInt(0); + const BN_1$1 = BigInt(1); + const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); + function hexPadRight(value) { + const bytes = getBytes(value); + const padOffset = bytes.length % 32; + if (padOffset) { + return concat([bytes, padding.slice(padOffset)]); + } + return hexlify(bytes); + } + const hexTrue = toBeHex(BN_1$1, 32); + const hexFalse = toBeHex(BN_0$3, 32); + const domainFieldTypes = { + name: "string", + version: "string", + networkId: "uint256", + verifyingContract: "address", + salt: "bytes32", + }; + const domainFieldNames = [ + "name", + "version", + "networkId", + "verifyingContract", + "salt", + ]; + function checkString(key) { + return function (value) { + assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); + return value; + }; + } + const domainChecks = { + name: checkString("name"), + version: checkString("version"), + networkId: function (_value) { + const value = getBigInt(_value, "domain.networkId"); + assertArgument(value >= 0, "invalid chain ID", "domain.networkId", _value); + if (Number.isSafeInteger(value)) { + return Number(value); + } + return toQuantity(value); + }, + verifyingContract: function (value) { + try { + return getAddress(value).toLowerCase(); + } + catch (error) { } + assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); + }, + salt: function (value) { + const bytes = getBytes(value, "domain.salt"); + assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); + return hexlify(bytes); + }, + }; + function getBaseEncoder(type) { + // intXX and uintXX + { + const match = type.match(/^(u?)int(\d*)$/); + if (match) { + const signed = match[1] === ""; + const width = parseInt(match[2] || "256"); + assertArgument(width % 8 === 0 && + width !== 0 && + width <= 256 && + (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type); + const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); + const boundsLower = signed ? (boundsUpper + BN_1$1) * BN__1 : BN_0$3; + return function (_value) { + const value = getBigInt(_value, "value"); + assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); + return toBeHex(signed ? toTwos(value, 256) : value, 32); + }; + } + } + // bytesXX + { + const match = type.match(/^bytes(\d+)$/); + if (match) { + const width = parseInt(match[1]); + assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); + return function (value) { + const bytes = getBytes(value); + assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); + return hexPadRight(value); + }; + } + } + switch (type) { + case "address": + return function (value) { + return zeroPadValue(getAddress(value), 32); + }; + case "bool": + return function (value) { + return !value ? hexFalse : hexTrue; + }; + case "bytes": + return function (value) { + return sha256(value); + }; + case "string": + return function (value) { + return id(value); + }; + } + return null; + } + function encodeType(name, fields) { + return `${name}(${fields .map(({ name, type }) => type + " " + name) .join(",")})`; - } - class TypedDataEncoder { - primaryType; - #types; - get types() { - return JSON.parse(this.#types); - } - #fullTypes; - #encoderCache; - constructor(types) { - this.#types = JSON.stringify(types); - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - // Link struct types to their direct child structs - const links = new Map(); - // Link structs to structs which contain them as a child - const parents = new Map(); - // Link all subtypes within a given struct - const subtypes = new Map(); - Object.keys(types).forEach((type) => { - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - for (const name in types) { - const uniqueNames = new Set(); - for (const field of types[name]) { - // Check each field has a unique name - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types); - uniqueNames.add(field.name); - // Get the base type (drop any array specifiers) - const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1] || null; - assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types); - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types); - // Add linkage - parents.get(baseType).push(name); - links.get(name).add(baseType); - } - } - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => parents.get(n).length === 0); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", types); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes + } + class TypedDataEncoder { + primaryType; + #types; + get types() { + return JSON.parse(this.#types); + } + #fullTypes; + #encoderCache; + constructor(types) { + this.#types = JSON.stringify(types); + this.#fullTypes = new Map(); + this.#encoderCache = new Map(); + // Link struct types to their direct child structs + const links = new Map(); + // Link structs to structs which contain them as a child + const parents = new Map(); + // Link all subtypes within a given struct + const subtypes = new Map(); + Object.keys(types).forEach((type) => { + links.set(type, new Set()); + parents.set(type, []); + subtypes.set(type, new Set()); + }); + for (const name in types) { + const uniqueNames = new Set(); + for (const field of types[name]) { + // Check each field has a unique name + assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types); + uniqueNames.add(field.name); + // Get the base type (drop any array specifiers) + const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1] || null; + assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types); + // Is this a base encoding type? + const encoder = getBaseEncoder(baseType); + if (encoder) { + continue; + } + assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types); + // Add linkage + parents.get(baseType).push(name); + links.get(name).add(baseType); + } + } + // Deduce the primary type + const primaryTypes = Array.from(parents.keys()).filter((n) => parents.get(n).length === 0); + assertArgument(primaryTypes.length !== 0, "missing primary type", "types", types); + assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes .map((t) => JSON.stringify(t)) .join(", ")}`, "types", types); - defineProperties(this, { primaryType: primaryTypes[0] }); - // Check for circular type references - function checkCircular(type, found) { - assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types); - found.add(type); - for (const child of links.get(type)) { - if (!parents.has(child)) { - continue; - } - // Recursively check children - checkCircular(child, found); - // Mark all ancestors as having this decendant - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + - st.map((t) => encodeType(t, types[t])).join("")); - } - } - getEncoder(type) { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - #getEncoder(type) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - const subtype = match[1]; - const subEncoder = this.getEncoder(subtype); - return (value) => { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(sha256); - } - return sha256(concat(result)); - }; - } - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id(this.#fullTypes.get(type)); - return (value) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return sha256(result); - } - return result; - }); - values.unshift(encodedType); - return concat(values); - }; - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - encodeType(name) { - const result = this.#fullTypes.get(name); - assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); - return result; - } - encodeData(type, value) { - return this.getEncoder(type)(value); - } - hashStruct(name, value) { - return sha256(this.encodeData(name, value)); - } - encode(value) { - return this.encodeData(this.primaryType, value); - } - hash(value) { - return this.hashStruct(this.primaryType, value); - } - _visit(type, value, callback) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - return value.map((v) => this._visit(match[1], v, callback)); - } - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, {}); - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - static from(types) { - return new TypedDataEncoder(types); - } - static getPrimaryType(types) { - return TypedDataEncoder.from(types).primaryType; - } - static hashStruct(name, types, value) { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - static hashDomain(domain) { - const domainFields = []; - for (const name in domain) { - if (domain[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); - domainFields.push({ name, type }); - } - domainFields.sort((a, b) => { - return (domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name)); - }); - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - static encode(domain, types, value) { - return concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value), - ]); - } - static hash(domain, types, value) { - return sha256(TypedDataEncoder.encode(domain, types, value)); - } - // Replaces all address types with ENS names with their looked up address - static async resolveNames(domain, types, value, resolveName) { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - // Allow passing null to ignore value - for (const key in domain) { - if (domain[key] == null) { - delete domain[key]; - } - } - // Look up all ENS names - const ensCache = {}; - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && - !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - // Get a list of all the addresses - encoder.visit(value, (type, value) => { - if (type === "address" && !isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - // Replace all ENS names with their address - value = encoder.visit(value, (type, value) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - return { domain, value }; - } - static getPayload(domain, types, value) { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - // Derive the EIP712Domain Struct reference type - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name) => { - const value = domain[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - const encoder = TypedDataEncoder.from(types); - const typesWithDomain = Object.assign({}, types); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - typesWithDomain.EIP712Domain = domainTypes; - // Validate the data structures and types - encoder.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type, value) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value)); - } - // uint or int - if (type.match(/^u?int/)) { - return getBigInt(value).toString(); - } - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - assertArgument(typeof value === "string", "invalid string", "value", value); - return value; - } - assertArgument(false, "unsupported type", "type", type); - }), - }; - } - } - /** - * Compute the address used to sign the typed data for the %%signature%%. - */ - function verifyTypedData(domain, types, value, signature, prefix) { - return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix); - } - - /** - * About frgaments... - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ - var _a; - // [ "a", "b" ] => { "a": 1, "b": 1 } - function setify(items) { - const result = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); - } - // Visibility Keywords - const _kwVisib = "constant external internal payable private public pure view"; - const KwVisib = setify(_kwVisib.split(" ")); - const _kwTypes = "constructor error event fallback function receive struct"; - const KwTypes = setify(_kwTypes.split(" ")); - const _kwModifiers = "calldata memory storage payable indexed"; - const KwModifiers = setify(_kwModifiers.split(" ")); - const _kwOther = "tuple returns"; - // All Keywords - const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); - const Keywords = setify(_keywords.split(" ")); - // Single character tokens - const SimpleTokens = { - "(": "OPEN_PAREN", - ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", - "]": "CLOSE_BRACKET", - ",": "COMMA", - "@": "AT", - }; - // Parser regexes to consume the next token - const regexWhitespacePrefix = new RegExp("^(\\s*)"); - const regexNumberPrefix = new RegExp("^([0-9]+)"); - const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); - // Parser regexs to check validity - const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); - const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); - class TokenString { - #offset; - #tokens; - get offset() { - return this.#offset; - } - get length() { - return this.#tokens.length - this.#offset; - } - constructor(tokens) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - clone() { - return new _a(this.#tokens); - } - reset() { - this.#offset = 0; - } - #subTokenString(from = 0, to = 0) { - return new _a(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({}, t, { - match: t.match - from, - linkBack: t.linkBack - from, - linkNext: t.linkNext - from, - })); - })); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type) { - if (this.peek().type !== type) { - throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - this.#offset = top.match + 1; - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return top != null && allowed.has(top) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return top.type === type ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - this.#offset++; - return result; - } - toString() { - const tokens = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } - } - _a = TokenString; - function lex(text) { - const tokens = []; - const throwError = (message) => { - const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - let brackets = []; - let commas = []; - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - const token = { - depth: brackets.length, - linkBack: -1, - linkNext: -1, - match: -1, - type: "", - text: "", - offset, - value: -1, - }; - tokens.push(token); - let type = SimpleTokens[cur[0]] || ""; - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } - else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - token.match = brackets.pop(); - tokens[token.match].match = tokens.length - 1; - token.depth--; - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - } - else if (type === "COMMA") { - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } - else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } - else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - tokens[tokens.length - 1].value = - getNumber(value); - } - if (tokens.length === 0 || - tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - tokens[tokens.length - 1].text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - token.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); - } - return new TokenString(tokens.map((t) => Object.freeze(t))); - } - // Check only one of `allowed` is in `set` - function allowSingle(set, allowed) { - let included = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } - } - // Functions to process a Solidity Signature TokenString from left-to-right for... - // ...the name with an optional type, returning the name - function consumeName(type, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - return tokens.popType("ID"); - } - // ...all keywords matching allowed, returning the keywords - function consumeKeywords(tokens, allowed) { - const keywords = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - return Object.freeze(keywords); - } - // ...all visibility keywords, returning the coalesced mutability - function consumeMutability(tokens) { - let modifiers = consumeKeywords(tokens, KwVisib); - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; - } - // ...a parameter list, returning the ParamType list - function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); - } - // ...a energy limit, returning a BigNumber or null if none - function consumeEnergy(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid energy"); - } - return null; - } - function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens: ${tokens.toString()}`); - } - } - const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); - function verifyBasicType(type) { - const match = type.match(regexType); - assertArgument(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); - } - else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3]); - assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid numeric width", "type", type); - } - return type; - } - // Make the Fragment constructors effectively private - const _guard$2 = {}; - const internal$1 = Symbol.for("_corebc_internal"); - const ParamTypeInternal = "_ParamTypeInternal"; - const ErrorFragmentInternal = "_ErrorInternal"; - const EventFragmentInternal = "_EventInternal"; - const ConstructorFragmentInternal = "_ConstructorInternal"; - const FallbackFragmentInternal = "_FallbackInternal"; - const FunctionFragmentInternal = "_FunctionInternal"; - const StructFragmentInternal = "_StructInternal"; - /** - * Each input and output of a [[Fragment]] is an Array of **PAramType**. - */ - class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - name; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - type; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - baseType; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - indexed; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - components; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - arrayLength; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - arrayChildren; - /** - * @private - */ - constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - assertPrivate(guard, _guard$2, "ParamType"); - Object.defineProperty(this, internal$1, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } - else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } - else if (components != null) { - throw new Error(""); - } - defineProperties(this, { - name, - type, - baseType, - indexed, - components, - arrayLength, - arrayChildren, - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - let result = { - type: this.baseType === "tuple" ? "tuple" : this.type, - name: this.name || undefined, - }; - if (typeof this.indexed === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - let result = ""; - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; - } - else { - if (this.isTuple()) { - if (format !== "sighash") { - result += this.type; - } - result += - "(" + - this.components - .map((comp) => comp.format(format)) - .join(format === "full" ? ", " : ",") + - ")"; - } - else { - result += this.type; - } - } - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /* - * Returns true if %%value%% is an Array type. - * - * This provides a type gaurd ensuring that the - * [[arrayChildren]] and [[arrayLength]] are non-null. - */ - //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } { - // return value && (value.baseType === "array") - //} - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return this.baseType === "array"; - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return this.baseType === "tuple"; - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return this.indexed != null; - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => _this.arrayChildren.walk(v, process)); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => _this.components[i].walk(v, process)); - } - return process(this.type, value); - } - #walkAsync(promises, value, process, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - if (this.isTuple()) { - const components = this.components; - // Convert the object into an array - let result; - if (Array.isArray(value)) { - result = value.slice(); - } - else { - if (value == null || typeof value !== "object") { - throw new Error("invalid tuple value"); - } - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - const result = process(this.type, value); - if (result.then) { - promises.push((async function () { - setValue(await result); - })()); - } - else { - setValue(result); - } - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process) { - const promises = []; - const result = [value]; - this.#walkAsync(promises, value, process, (value) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (ParamType.isParamType(obj)) { - return obj; - } - if (typeof obj === "string") { - return ParamType.from(lex(obj), allowIndexed); - } - else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || - obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } - else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - // Check for Array - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard$2, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - let indexed = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - const name = obj.peekType("ID") ? obj.pop().text : ""; - if (obj.length) { - throw new Error("leftover tokens"); - } - return new ParamType(_guard$2, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - const name = obj.name; - assertArgument(!name || (typeof name === "string" && name.match(regexId)), "invalid name", "obj.name", name); - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type = obj.type; - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components, - }); - return new ParamType(_guard$2, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - if (type === "tuple" || - type.startsWith("tuple(" /* fix: ) */) || - type.startsWith("(" /* fix: ) */)) { - const comps = obj.components != null - ? obj.components.map((c) => ParamType.from(c)) - : null; - const tuple = new ParamType(_guard$2, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - type = verifyBasicType(obj.type); - return new ParamType(_guard$2, name || "", type, type, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return value && value[internal$1] === ParamTypeInternal; - } - } - /** - * An abstract class to represent An individual fragment from a parse ABI. - */ - class Fragment { - /** - * The type of the fragment. - */ - type; - /** - * The inputs for the fragment. - */ - inputs; - /** - * @private - */ - constructor(guard, type, inputs) { - assertPrivate(guard, _guard$2, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof obj === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } - catch (e) { } - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - const type = obj.peekKeyword(KwTypes); - switch (type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - } - else if (typeof obj === "object") { - // JSON ABI - switch (obj.type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from", - }); - } - assertArgument(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } - } - /** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ - class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - name; - /** - * @private - */ - constructor(guard, type, name, inputs) { - super(guard, type, inputs); - assertArgument(typeof name === "string" && name.match(regexId), "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name }); - } - } - function joinParams(format, params) { - return ("(" + - params.map((p) => p.format(format)).join(format === "full" ? ", " : ",") + - ")"); - } - /** - * A Fragment which represents a //Custom Error//. - */ - class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal$1, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ErrorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard$2, name, inputs); - } - return new ErrorFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal$1] === ErrorFragmentInternal; - } - } - /** - * A Fragment which represents an Event. - */ - class EventFragment extends NamedFragment { - anonymous; - /** - * @private - */ - constructor(guard, name, inputs, anonymous) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal$1, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return id(this.format("sighash")); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - static getTopicHash(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard$2, name, params, false); - return fragment.topicHash; - } - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return EventFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard$2, name, inputs, anonymous); - } - return new EventFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); - } - static isFragment(value) { - return value && value[internal$1] === EventFragmentInternal; - } - } - /** - * A Fragment which represents a constructor. - */ - class ConstructorFragment extends Fragment { - payable; - energy; - /** - * @private - */ - constructor(guard, type, inputs, payable, energy) { - super(guard, type, inputs); - Object.defineProperty(this, internal$1, { - value: ConstructorFragmentInternal, - }); - defineProperties(this, { payable, energy }); - } - format(format) { - assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: this.payable ? "payable" : "undefined", - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = [`constructor${joinParams(format, this.inputs)}`]; - result.push(this.payable ? "payable" : "nonpayable"); - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - return result.join(" "); - } - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ConstructorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable"); - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard$2, "constructor", inputs, payable, energy); - } - return new ConstructorFragment(_guard$2, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal$1] === ConstructorFragmentInternal; - } - } - /** - * A Fragment which represents a method. - */ - class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - payable; - constructor(guard, inputs, payable) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal$1, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - format(format) { - const type = this.inputs.length === 0 ? "receive" : "fallback"; - if (format === "json") { - const stateMutability = this.payable ? "payable" : "nonpayable"; - return JSON.stringify({ type, stateMutability }); - } - return `${type}()${this.payable ? " payable" : ""}`; - } - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FallbackFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type = obj.popKeyword(setify(["fallback", "receive"])); - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard$2, [], true); - } - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); - } - else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard$2, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard$2, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = obj.stateMutability === "payable"; - return new FallbackFragment(_guard$2, inputs, payable); - } - assertArgument(false, "invalid fallback description", "obj", obj); - } - static isFragment(value) { - return value && value[internal$1] === FallbackFragmentInternal; - } - } - /** - * A Fragment which represents a method. - */ - class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - constant; - /** - * The returned types for the result of calling this function. - */ - outputs; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - stateMutability; - /** - * If the function can be sent value during invocation. - */ - payable; - /** - * The amount of energy to send when calling this function - */ - energy; - /** - * @private - */ - constructor(guard, name, stateMutability, inputs, outputs, energy) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal$1, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = stateMutability === "view" || stateMutability === "pure"; - const payable = stateMutability === "payable"; - defineProperties(this, { - constant, - energy, - outputs, - payable, - stateMutability, - }); - } - /** - * The Function selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: this.stateMutability !== "nonpayable" - ? this.stateMutability - : undefined, - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - } - return result.join(" "); - } - static getSelector(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard$2, name, "view", params, [], null); - return fragment.selector; - } - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FunctionFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new FunctionFragment(_guard$2, name, mutability, inputs, outputs, energy); - } - let stateMutability = obj.stateMutability; - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof obj.constant === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } - else if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - return new FunctionFragment(_guard$2, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal$1] === FunctionFragmentInternal; - } - } - /** - * A Fragment which represents a structure. - */ - class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal$1, { value: StructFragmentInternal }); - } - format() { - throw new Error("@TODO"); - } - static from(obj) { - if (typeof obj === "string") { - return StructFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard$2, name, inputs); - } - return new StructFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal$1] === StructFragmentInternal; - } - } - - /** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ - // https://docs.soliditylang.org/en/v0.8.17/control-structures.html - const PanicReasons$1 = new Map(); - PanicReasons$1.set(0x00, "GENERIC_PANIC"); - PanicReasons$1.set(0x01, "ASSERT_FALSE"); - PanicReasons$1.set(0x11, "OVERFLOW"); - PanicReasons$1.set(0x12, "DIVIDE_BY_ZERO"); - PanicReasons$1.set(0x21, "ENUM_RANGE_ERROR"); - PanicReasons$1.set(0x22, "BAD_STORAGE_DATA"); - PanicReasons$1.set(0x31, "STACK_UNDERFLOW"); - PanicReasons$1.set(0x32, "ARRAY_RANGE_ERROR"); - PanicReasons$1.set(0x41, "OUT_OF_MEMORY"); - PanicReasons$1.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); - const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); - const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); - let defaultCoder = null; - function getBuiltinCallException(action, tx, data, abiCoder) { - let message = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data) { - message = "execution reverted"; - const bytes = getBytes(data); - data = hexlify(data); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } - else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } - else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason], - }; - message += `: ${JSON.stringify(reason)}`; - } - catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } - else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code], - }; - reason = `Panic due to ${PanicReasons$1.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } - catch (error) { - message += " (could not decode panic code)"; - } - } - else { - message += " (unknown custom error)"; - } - } - const transaction = { - to: tx.to ? getAddress(tx.to) : null, - data: tx.data || "0x", - }; - if (tx.from) { - transaction.from = getAddress(tx.from); - } - return makeError(message, "CALL_EXCEPTION", { - action, - data, - reason, - transaction, - invocation, - revert, - }); - } - /** - * About AbiCoder - */ - class AbiCoder { - #getCoder(param) { - if (param.isArray()) { - return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param); - return new NumberCoder(size / 8, match[1] === "int", param.name); - } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new FixedBytesCoder(size, param.name); - } - assertArgument(false, "invalid type", "type", param.type); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types, values) { - assertArgumentCount(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose)); - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an corebc-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } - } - - /** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ - /** - * Encodes %%text%% as a Bytes32 string. - */ - function encodeBytes32String(text) { - // Get the bytes - const bytes = toUtf8Bytes(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } - // Zero-pad (implicitly null-terminates) - return zeroPadBytes(bytes, 32); - } - /** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ - function decodeBytes32String(_bytes) { - const data = getBytes(_bytes, "bytes"); - // Must be 32 bytes with a null-termination - if (data.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { - length--; - } - // Determine the string value - return toUtf8String(data.slice(0, length)); - } - - /** - * About Interface - * - * @_subsection api/abi:Interfaces [interfaces] - */ - class LogDescription { - fragment; - name; - signature; - topic; - args; - constructor(fragment, topic, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - signature, - topic, - args, - }); - } - } - class TransactionDescription { - fragment; - name; - args; - signature; - selector; - value; - constructor(fragment, selector, args, value) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - value, - }); - } - } - class ErrorDescription { - fragment; - name; - args; - signature; - selector; - constructor(fragment, selector, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - }); - } - } - class Indexed { - hash; - _isIndexed; - static isIndexed(value) { - return !!(value && value._isIndexed); - } - constructor(hash) { - defineProperties(this, { hash, _isIndexed: true }); - } - } - // https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require - const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", - }; - const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message) => { - return `reverted with reason string ${JSON.stringify(message)}`; - }, - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - }, - }, - }; - /** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ - class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - fragments; - /** - * The Contract constructor. - */ - deploy; - /** - * The Fallback method, if any. - */ - fallback; - /** - * If receiving xcb is supported. - */ - receive; - #errors; - #events; - #functions; - // #structs: Map; - #abiCoder; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments) { - let abi = []; - if (typeof fragments === "string") { - abi = JSON.parse(fragments); - } - else { - abi = fragments; - } - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - const frags = []; - for (const a of abi) { - try { - frags.push(Fragment.from(a)); - } - catch (error) { - console.log("EE", error); - } - } - defineProperties(this, { - fragments: Object.freeze(frags), - }); - let fallback = null; - let receive = false; - this.#abiCoder = this.getAbiCoder(); - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - defineProperties(this, { - deploy: fragment, - }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } - else { - assertArgument(!fallback || - fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - case "error": - bucket = this.#errors; - break; - default: - return; - } - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - bucket.set(signature, fragment); - }); - // If we do not have a constructor add a default - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()"), - }); - } - defineProperties(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format = minimal ? "minimal" : "full"; - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi = this.fragments.map((f) => f.format("json")); - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return AbiCoder.defaultAbiCoder(); - } - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key, values, forceUnique) { - // Selector - if (isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - const lastValue = values.length > 0 ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && - (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && - values && - values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || - Array.isArray(lastArg) || - typeof lastArg !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#functions.get(FunctionFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key) { - const fragment = this.#getFunction(key, null, false); - assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key) { - return !!this.#getFunction(key, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key, values) { - return this.#getFunction(key, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#functions.get(name), i); - } - } - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key, values, forceUnique) { - // EventTopic - if (isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#events.get(EventFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key) { - const fragment = this.#getEvent(key, null, false); - assertArgument(fragment, "no matching event", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key) { - return !!this.#getEvent(key, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key, values) { - return this.#getEvent(key, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#events.get(name), i); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key, values) { - if (isHexString(key)) { - const selector = key.toLowerCase(); - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key === "Error") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return ErrorFragment.from("error Panic(uint256)"); - } - return null; - } - else if (matching.length > 1) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - key = ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return ErrorFragment.from("error Panic(uint256)"); - } - const result = this.#errors.get(key); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#errors.get(name), i); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return this.#abiCoder.decode(params, data); - } - _encodeParams(params, values) { - return this.#abiCoder.encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - let message = "invalid length for result data"; - const bytes = getBytesCopy(data); - if (bytes.length % 32 === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } - catch (error) { - message = "could not decode result data"; - } - } - // Call returned data with no error, but the data is junk - assert(false, message, "BAD_DATA", { - value: hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() }, - }); - } - makeError(_data, tx) { - const data = getBytes(_data, "data"); - const error = AbiCoder.getBuiltinCallException("call", tx, data); - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, - signature: ef.format(), - args, - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } - catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args, - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ - // Create the filter for the event with search criteria (e.g. for xcb_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param, value) => { - if (param.type === "string") { - return id(value); - } - else if (param.type === "bytes") { - return sha256(hexlify(value)); - } - if (param.type === "bool" && typeof value === "boolean") { - value = value ? "0x01" : "0x00"; - } - if (param.type.match(/^u?int/)) { - value = toBeHex(value); - } - // Check addresses are valid - if (param.type === "address") { - this.#abiCoder.encode(["address"], [value]); - } - return zeroPadValue(hexlify(value), 32); - //@TOOD should probably be return toHex(value, 32) - }; - values.forEach((value, index) => { - const param = fragment.inputs[index]; - if (!param.indexed) { - assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); - return; - } - if (value == null) { - topics.push(null); - } - else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); - } - else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } - else { - topics.push(encodeTopic(param, value)); - } - }); - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)); - } - else if (param.type === "bytes") { - topics.push(sha256(value)); - } - else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } - else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } - else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics, - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || - param.type === "bytes" || - param.baseType === "tuple" || - param.baseType === "array") { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } - else { - indexed.push(param); - dynamic.push(false); - } - } - else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values = []; - const keys = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } - else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } - else { - try { - value = resultIndexed[indexedIndex++]; - } - catch (error) { - value = error; - } - } - } - else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } - catch (error) { - value = error; - } - } - values.push(value); - keys.push(param.name || null); - }); - return Result.fromItems(values, keys); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log) { - const fragment = this.getEvent(log.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data) { - const hexData = hexlify(data); - const fragment = this.getError(dataSlice(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - // JSON - if (typeof value === "string") { - return new Interface(JSON.parse(value)); - } - // Maybe an interface from an older version, or from a symlinked copy - if (typeof value.format === "function") { - return new Interface(value.format("json")); - } - // Array of fragments - return new Interface(value); - } - } - - const logger = new Logger("contract-address/0.0.1"); - /** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ - function getCreateAddress(tx) { - const from = getAddress(tx.from); - const nonce = getBigInt(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } - else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } - else { - nonceHex = "0x" + nonceHex; - } - return getAddress(from); - } - /** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ - function getCreate2Address(from, salt, initCodeHash) { - if (hexDataLength(salt) !== 32) { - logger.throwArgumentError("salt must be 32 bytes", "salt", salt); - } - if (hexDataLength(initCodeHash) !== 32) { - logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash); - } - const val = hexDataSlice(sha256(concat(["0xff", getAddress(from), salt, initCodeHash])), 12); - console.log({ "contract-address/74=>should be string": val }); - const prefix = from.substring(2, 4); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); - } - - /** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.corebc.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ - function isAddressable(value) { - return value && typeof value.getAddress === "function"; - } - /** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ - function isAddress(value) { - try { - getAddress(value); - return true; - } - catch (error) { } - return false; - } - async function checkAddress(target, promise) { - const result = await promise; - if (result == null || - result === "0x0000000000000000000000000000000000000000") { - assert(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return getAddress(result); - } - /** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ - function resolveAddress(target) { - if (typeof target === "string") { - return getAddress(target); - // assert(resolver != null, "ENS resolution requires a provider", - // "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - // return checkAddress(target, resolver.resolveName(target)); - } - else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } - else if (target && typeof target.then === "function") { - return checkAddress(target, target); - } - assertArgument(false, "unsupported addressable value", "target", target); - } - - const BN_0$2 = BigInt(0); - // ----------------------- - function getValue(value) { - if (value == null) { - return null; - } - return value; - } - function toJson(value) { - if (value == null) { - return null; - } - return value.toString(); - } - // @TODO? implements Required - /** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ - class FeeData { - /** - * The energy price for legacy networks. - */ - energyPrice; - constructor(energyPrice) { - defineProperties(this, { - energyPrice: getValue(energyPrice), - }); - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { energyPrice } = this; - return { - _type: "FeeData", - energyPrice: toJson(energyPrice), - }; - } - } - function copyRequest(req) { - const result = {}; - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = hexlify(req.data); - } - const bigIntKeys = "networkId,energyLimit,energyPrice,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getBigInt(req[key], `request.${key}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getNumber(req[key], `request.${key}`); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipReadEnabled = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - return result; - } - /** - * A **Block** represents the data associated with a full block on - * Core. - */ - class Block { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - number; - /** - * The block hash. - */ - hash; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - timestamp; - /** - * The block hash of the parent block. - */ - parentHash; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - nonce; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - difficulty; - /** - * The total energy limit for this block. - */ - energyLimit; - /** - * The total energy used in this block. - */ - energyUsed; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - miner; - /** - * Any extra data the validator wished to include. - */ - extraData; - /** - * The base fee per energy that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - baseFeePerEnergy; - #transactions; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block, provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof tx !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - defineProperties(this, { - provider, - hash: getValue(block.hash), - number: block.number, - timestamp: block.timestamp, - parentHash: block.parentHash, - nonce: block.nonce, - difficulty: block.difficulty, - energyLimit: block.energyLimit, - energyUsed: block.energyUsed, - miner: block.miner, - extraData: block.extraData, - baseFeePerEnergy: getValue(block.baseFeePerEnergy), - }); - } - /** - * Returns the list of transaction hashes. - */ - get transactions() { - return this.#transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return tx.hash; - }); - } - /** - * Returns the complete transactions for blocks which - * prefetched them, by passing ``true`` to %%prefetchTxs%% - * into [[provider_getBlock]]. - */ - get prefetchedTransactions() { - const txs = this.#transactions.slice(); - // Doesn't matter... - if (txs.length === 0) { - return []; - } - // Make sure we prefetched the transactions - assert(typeof txs[0] === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()", - }); - return txs; - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this; - return { - _type: "Block", - baseFeePerEnergy: toJson(baseFeePerEnergy), - difficulty: toJson(difficulty), - extraData, - energyLimit: toJson(energyLimit), - energyUsed: toJson(energyUsed), - hash, - miner, - nonce, - number, - parentHash, - timestamp, - transactions, - }; - } - [Symbol.iterator]() { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The number of transactions in this block. - */ - get length() { - return this.#transactions.length; - } - /** - * The [[link-js-date]] this block was included at. - */ - get date() { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash) { - // Find the internal value by its index or hash - let tx = undefined; - if (typeof indexOrHash === "number") { - tx = this.#transactions[indexOrHash]; - } - else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof v === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } - else { - if (v.hash === hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - if (typeof tx === "string") { - return await this.provider.getTransaction(tx); - } - else { - return tx; - } - } - getPrefetchedTransaction(indexOrHash) { - const txs = this.prefetchedTransactions; - if (typeof indexOrHash === "number") { - return txs[indexOrHash]; - } - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); - } - /** - * Has this block been mined. - * - * If true, the block has been typed-gaurded that all mined - * properties are non-null. - */ - isMined() { - return !!this.hash; - } - /** - * - */ - isLondon() { - return !!this.baseFeePerEnergy; - } - orphanedEvent() { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } - } - ////////////////////// - // Log - class Log { - provider; - transactionHash; - blockHash; - blockNumber; - removed; - address; - data; - topics; - index; - transactionIndex; - constructor(log, provider) { - this.provider = provider; - const topics = Object.freeze(log.topics.slice()); - defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - removed: log.removed, - address: log.address, - data: log.data, - topics, - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - toJSON() { - const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this; - return { - _type: "log", - address, - blockHash, - blockNumber, - data, - index, - removed, - topics, - transactionHash, - transactionIndex, - }; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.transactionHash); - assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - async getTransactionReceipt() { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); - return receipt; - } - removedEvent() { - return createRemovedLogFilter(this); - } - } - ////////////////////// - // Transaction Receipt - /* - export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; - } - - export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; - } - */ - class TransactionReceipt { - provider; - to; - from; - contractAddress; - hash; - index; - blockHash; - blockNumber; - logsBloom; - energyUsed; - cumulativeEnergyUsed; - energyPrice; - type; - //readonly byzantium!: boolean; - status; - root; - #logs; - constructor(tx, provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - defineProperties(this, { - provider, - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - hash: tx.hash, - index: tx.index, - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - logsBloom: tx.logsBloom, - energyUsed: tx.energyUsed, - cumulativeEnergyUsed: tx.cumulativeEnergyUsed, - energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice), - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root, - }); - } - get logs() { - return this.#logs; - } - toJSON() { - const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, - status, root, } = this; - return { - _type: "TransactionReceipt", - blockHash, - blockNumber, - //byzantium, - contractAddress, - cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed), - from, - energyPrice: toJson(this.energyPrice), - energyUsed: toJson(this.energyUsed), - hash, - index, - logs, - logsBloom, - root, - status, - to, - }; - } - get length() { - return this.logs.length; - } - [Symbol.iterator]() { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - }, - }; - } - get fee() { - return this.energyUsed * this.energyPrice; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - async getResult() { - return await this.provider.getTransactionResult(this.hash); - } - async confirmations() { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - removedEvent() { - return createRemovedTransactionFilter(this); - } - reorderedEvent(other) { - assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } - } - /* - export type ReplacementDetectionSetup = { - to: string; - from: string; - value: bigint; - data: string; - nonce: number; - block: number; - }; - */ - class TransactionResponse { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockNumber; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockHash; - /** - * The index within the block that this transaction resides at. - */ - index; - /** - * The transaction hash. - */ - hash; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - type; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - to; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - from; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - nonce; - /** - * The maximum units of energy this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - energyLimit; - /** - * The energy price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective energy price// (the fee per energy that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerEnergy]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of energy the transaction - * consumes. - */ - energyPrice; - /** - * The data. - */ - data; - /** - * The value, in ore. Use [[formatXCB]] to format this value - * as xcb. - */ - value; - /** - * The chain ID. - */ - networkId; - /** - * The signature. - */ - signature; - #startBlock; - /** - * Create a new TransactionResponse with %%tx%% parameters - * connected to %%provider%%. - */ - constructor(tx, provider) { - this.provider = provider; - this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null; - this.blockHash = tx.blockHash != null ? tx.blockHash : null; - this.hash = tx.hash; - this.index = tx.index; - this.from = tx.from; - this.to = tx.to || null; - this.energyLimit = tx.energyLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - this.energyPrice = tx.energyPrice; - this.networkId = tx.networkId; - this.signature = tx.signature; - this.#startBlock = -1; - } - /** - * Returns a JSON representation of this transaction. - */ - toJSON() { - const { index, hash, type, to, from, nonce, data, signature } = this; - return { - _type: "TransactionReceipt", - networkId: toJson(this.networkId), - data, - from, - energyLimit: toJson(this.energyLimit), - energyPrice: toJson(this.energyPrice), - hash, - nonce, - signature, - to, - index, - type, - value: toJson(this.value), - }; - } - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock() { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction() { - return this.provider.getTransaction(this.hash); - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms, _timeout) { - const confirms = _confirms == null ? 1 : _confirms; - const timeout = _timeout == null ? 0 : _timeout; - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = startBlock === -1 ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from), - }); - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - // We were replaced; start scanning for that transaction - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx = await block.getTransaction(i); - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - // We will retry this on the next block (this case could be optimized) - if (blockNumber - receipt.blockNumber + 1 < confirms) { - return; - } - // The reason we were replaced - let reason = "replaced"; - if (tx.data === this.data && - tx.to === this.to && - tx.value === this.value) { - reason = "repriced"; - } - else if (tx.data === "0x" && - tx.from === tx.to && - tx.value === BN_0$2) { - reason = "cancelled"; - } - assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: reason === "replaced" || reason === "cancelled", - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt, - }); - } - } - nextScan++; - } - return; - }; - const receipt = await this.provider.getTransactionReceipt(this.hash); - if (receipt) { - if ((await receipt.confirmations()) >= confirms) { - return receipt; - } - } - else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers = []; - const cancel = () => { - cancellers.forEach((c) => c()); - }; - // On cancel, stop scanning for replacements - cancellers.push(() => { - stopScanning = true; - }); - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { - clearTimeout(timer); - }); - } - const txListener = async (receipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - resolve(receipt); - } - }; - cancellers.push(() => { - this.provider.off(this.hash, txListener); - }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } - catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { - this.provider.off("block", replaceListener); - }); - this.provider.once("block", replaceListener); - } - }); - return await waiter; - } - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined() { - return this.blockHash != null; - } - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy() { - return this.type === 0; - } - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent() { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other) { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createReorderedTransactionFilter(this, other); - } - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock) { - assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } - } - function createOrphanedBlockFilter(block) { - return { orphan: "drop-block", hash: block.hash, number: block.number }; - } - function createReorderedTransactionFilter(tx, other) { - return { orphan: "reorder-transaction", tx, other }; - } - function createRemovedTransactionFilter(tx) { - return { orphan: "drop-transaction", tx }; - } - function createRemovedLogFilter(log) { - return { - orphan: "drop-log", - log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index, - }, - }; - } - - class EventLog extends Log { - interface; - fragment; - args; - constructor(log, iface, fragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - defineProperties(this, { args, fragment, interface: iface }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } - } - class ContractTransactionReceipt extends TransactionReceipt { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - get logs() { - return super.logs.map((log) => { - const fragment = log.topics.length - ? this.#iface.getEvent(log.topics[0]) - : null; - if (fragment) { - return new EventLog(log, this.#iface, fragment); - } - else { - return log; - } - }); - } - } - class ContractTransactionResponse extends TransactionResponse { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - async wait(confirms) { - const receipt = await super.wait(); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } - } - class ContractUnknownEventPayload extends EventPayload { - log; - constructor(contract, listener, filter, log) { - super(contract, listener, filter); - defineProperties(this, { log }); - } - async getBlock() { - return await this.log.getBlock(); - } - async getTransaction() { - return await this.log.getTransaction(); - } - async getTransactionReceipt() { - return await this.log.getTransactionReceipt(); - } - } - class ContractEventPayload extends ContractUnknownEventPayload { - constructor(contract, listener, filter, fragment, _log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - defineProperties(this, { args, fragment }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } - } - - const BN_0$1 = BigInt(0); - function canCall(value) { - return value && typeof value.call === "function"; - } - function canEstimate(value) { - return value && typeof value.estimateEnergy === "function"; - } - function canResolve(value) { - return value && typeof value.resolveName === "function"; - } - function canSend(value) { - return value && typeof value.sendTransaction === "function"; - } - class PreparedTopicFilter { - #filter; - fragment; - constructor(contract, fragment, args) { - defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - // Recursively descend into args and resolve any addresses - this.#filter = (async function () { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - })); - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - getTopicFilter() { - return this.#filter; - } - } - // A = Arguments passed in as a tuple - // R = The result type of the call (i.e. if only one return type, - // the qualified type, otherwise Result) - // D = The type the default call will return (i.e. R for view/pure, - // TransactionResponse otherwise) - //export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { - function getRunner(value, feature) { - if (value == null) { - return null; - } - if (typeof value[feature] === "function") { - return value; - } - if (value.provider && typeof value.provider[feature] === "function") { - return value.provider; - } - return null; - } - function getProvider(value) { - if (value == null) { - return null; - } - return value.provider || null; - } - /** - * @_ignore: - */ - async function copyOverrides(arg, allowed) { - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = copyRequest(Typed.dereference(arg, "overrides")); - assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); - // Resolve any from - if (overrides.from) { - overrides.from = await resolveAddress(overrides.from); - } - return overrides; - } - /** - * @_ignore: - */ - async function resolveArgs(_runner, inputs, args) { - // Recursively descend into args and resolve any addresses - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = Typed.dereference(value, type); - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - })); - } - function buildWrappedFallback(contract) { - const populateTransaction = async function (overrides) { - // If an overrides was passed in, copy it and normalize the values - const tx = (await copyOverrides(overrides, ["data"])); - tx.to = await contract.getAddress(); - const iface = contract.interface; - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - assertArgument(payable || (tx.value || BN_0$1) === BN_0$1, "cannot send value to non-payable contract", "overrides.value", tx.value); - // Only allow fallback contracts to set non-empty data - assertArgument(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data); - return tx; - }; - const staticCall = async function (overrides) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(overrides); - try { - return await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - const send = async function (overrides) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (overrides) { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(overrides)); - }; - const method = async (overrides) => { - return await send(overrides); - }; - defineProperties(method, { - _contract: contract, - estimateEnergy, - populateTransaction, - send, - staticCall, - }); - return method; - } - function buildWrappedMethod(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getFunction(key, args); - assert(fragment, "no matching fragment in getFragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const populateTransaction = async function (...args) { - const fragment = getFragment(...args); - // If an overrides was passed in, copy it and normalize the values - let overrides = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs), - })); - }; - const staticCall = async function (...args) { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return result; - }; - const send = async function (...args) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (...args) { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(...args)); - }; - const staticCallResult = async function (...args) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(...args); - let result = "0x"; - try { - result = await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - const method = async (...args) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, - _key: key, - getFragment, - estimateEnergy, - populateTransaction, - send, - staticCall, - staticCallResult, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - assert(fragment, "no matching fragment in defineProperty", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; - } - function buildWrappedEvent(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getEvent(key, args); - assert(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const method = function (...args) { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, - _key: key, - getFragment, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; - } - // The combination of TypeScrype, Private Fields and Proxies makes - // the world go boom; so we hide variables with some trickery keeping - // a symbol attached to each BaseContract which its sub-class (even - // via a Proxy) can reach and use to look up its internal values. - const internal = Symbol.for("_corebcInternal_contract"); - const internalValues = new WeakMap(); - function setInternal(contract, values) { - internalValues.set(contract[internal], values); - } - function getInternal(contract) { - return internalValues.get(contract[internal]); - } - function isDeferred(value) { - return (value && - typeof value === "object" && - "getTopicFilter" in value && - typeof value.getTopicFilter === "function" && - value.fragment); - } - async function getSubInfo(contract, event) { - let topics; - let fragment = null; - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - if (Array.isArray(event)) { - const topicHashify = function (name) { - if (isHexString(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } - else if (event === "*") { - topics = [null]; - } - else if (typeof event === "string") { - if (isHexString(event, 32)) { - // Topic Hash - topics = [event]; - } - else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - assertArgument(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } - else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } - else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } - else { - assertArgument(false, "unknown event name", "event", event); - } - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - const tag = topics - .map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }) - .join("&"); - return { fragment, tag, topics }; - } - async function hasSub(contract, event) { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; - } - async function getSub(contract, operation, event) { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); - const { fragment, tag, topics } = await getSubInfo(contract, event); - const { addr, subs } = getInternal(contract); - let sub = subs.get(tag); - if (!sub) { - const address = addr ? addr : contract; - const filter = { address, topics }; - const listener = (log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - // If fragment is null, we do not deconstruct the args to emit - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment - ? contract.interface.decodeEventLog(fragment, log.data, log.topics) - : []; - emit(contract, event, args, (listener) => { - return new ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } - else { - emit(contract, event, [], (listener) => { - return new ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - let starting = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - const stop = async () => { - if (starting.length == 0) { - return; - } - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; - } - // We use this to ensure one emit resolves before firing the next to - // ensure correct ordering (note this cannot throw and just adds the - // notice to the event queu using setTimeout). - let lastEmit = Promise.resolve(); - async function _emit(contract, event, args, payloadFunc) { - await lastEmit; - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } - catch (error) { } - return !once; - }); - return count > 0; - } - async function emit(contract, event, args, payloadFunc) { - try { - await lastEmit; - } - catch (error) { } - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; - } - const passProperties = ["then"]; - class BaseContract { - target; - interface; - runner; - filters; - [internal]; - fallback; - constructor(target, abi, runner, _deployTx) { - if (runner == null) { - runner = null; - } - const iface = Interface.from(abi); - defineProperties(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - let addrPromise; - let addr = null; - let deployTx = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); - } - let subs = new Map(); - // Resolve the target as the address - if (typeof target === "string") { - if (isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } - else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - }); - } - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - } - else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - // Add the event filters - const filters = new Proxy({}, { - get: (target, _prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = this.getEvent(prop); - if (result) { - return result; - } - throw new Error(`unknown contract event: ${prop}`); - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop))); - }, - }); - defineProperties(this, { filters }); - defineProperties(this, { - fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null, - }); - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, _prop, receiver) => { - if (_prop in target || passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = target.getFunction(prop); - if (result) { - return result; - } - throw new Error(`unknown contract method: ${prop}`); - }, - has: (target, prop) => { - if (prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return target.interface.hasFunction(String(prop)); - }, - }); - } - connect(runner) { - return new BaseContract(this.target, this.interface, runner); - } - async getAddress() { - return await getInternal(this).addrPromise; - } - async getDeployedCode() { - const provider = getProvider(this.runner); - assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - async waitForDeployment() { - // We have the deployement transaction; just use that (throws if deployement fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } - catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - deploymentTransaction() { - return getInternal(this).deployTx; - } - getFunction(key) { - if (typeof key !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - getEvent(key) { - if (typeof key !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - async queryTransaction(hash) { - // Is this useful? - throw new Error("@TODO"); - } - async queryFilter(event, fromBlock, toBlock) { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = addr ? addr : await addrPromise; - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - if (foundFragment) { - return new EventLog(log, this.interface, foundFragment); - } - else { - return new Log(log, provider); - } - }); - } - async on(event, listener) { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - async once(event, listener) { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - async emit(event, ...args) { - return await emit(this, event, args, null); - } - async listenerCount(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - const { subs } = getInternal(this); - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - const { subs } = getInternal(this); - let result = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return await this.off(event, listener); - } - static buildClass(abi) { - class CustomContract extends BaseContract { - constructor(address, runner = null) { - super(address, abi, runner); - } - } - return CustomContract; - } - static from(target, abi, runner) { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract; - } - static isIndexed(value) { - return Indexed.isIndexed(value); - } - } - function _ContractBase() { - return BaseContract; - } - class Contract extends _ContractBase() { - } - - // A = Arguments to the constructor - // I = Interface of deployed contracts - class ContractFactory { - interface; - bytecode; - runner; - constructor(abi, bytecode, runner) { - const iface = Interface.from(abi); - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = hexlify(getBytes(bytecode)); - } - else if (typeof bytecode === "string") { - bytecode = bytecode; - } - else if (isBytes(bytecode)) { - bytecode = hexlify(bytecode); - } - else if (bytecode && typeof bytecode.object === "string") { - // Allow the bytecode object from the Solidity compiler - bytecode = bytecode.object; - } - else { - // Crash in the next verification step - bytecode = "!"; - } - defineProperties(this, { - // @ts-ignore - bytecode, - interface: iface, - runner: runner || null, - }); - } - async getDeployTransaction(...args) { - let overrides = {}; - const fragment = this.interface.deploy; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); - const data = concat([ - this.bytecode, - this.interface.encodeDeploy(resolvedArgs), - ]); - return Object.assign({}, overrides, { data }); - } - async deploy(...args) { - const tx = await this.getDeployTransaction(...args); - assert(this.runner && typeof this.runner.sendTransaction === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction", - }); - const sentTx = await this.runner.sendTransaction(tx); - const address = getCreateAddress(sentTx); - return new BaseContract(address, this.interface, this.runner, sentTx); - } - connect(runner) { - return new ContractFactory(this.interface, this.bytecode, runner); - } - static fromSolidity(output, runner) { - assertArgument(output != null, "bad compiler output", "output", output); - if (typeof output === "string") { - output = JSON.parse(output); - } - const abi = output.abi; - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } - else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - return new this(abi, bytecode, runner); - } - } - - /** - * @_ignore - */ - const BN_0 = BigInt(0); - function allowNull(format, nullValue) { - return function (value) { - if (value == null) { - return nullValue; - } - return format(value); - }; - } - function arrayOf(format) { - return (array) => { - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }; - } - // Requires an object which matches a fleet of other formatters - // Any FormatFunc may return `undefined` to have the value omitted - // from the result object. Calls preserve `this`. - function object(format, altNames) { - return (value) => { - const result = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } - catch (error) { - const message = error instanceof Error ? error.message : "not-an-error"; - assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); - } - } - return result; - }; - } - function formatBoolean(value) { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); - } - function formatData(value) { - assertArgument(isHexString(value, true), "invalid data", "value", value); - return value; - } - function formatHash(value) { - assertArgument(isHexString(value, 32), "invalid hash", "value", value); - return value; - } - const _formatLog = object({ - address: getAddress, - blockHash: formatHash, - blockNumber: getNumber, - data: formatData, - index: getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: getNumber, - }, { - index: ["logIndex"], - }); - function formatLog(value) { - return _formatLog(value); - } - const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - number: getNumber, - timestamp: getNumber, - nonce: allowNull(formatData), - difficulty: getBigInt, - energyLimit: getBigInt, - energyUsed: getBigInt, - miner: allowNull(getAddress), - extraData: formatData, - baseFeePerEnergy: allowNull(getBigInt), - }); - function formatBlock(value) { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return formatTransactionResponse(tx); - }); - return result; - } - const _formatReceiptLog = object({ - transactionIndex: getNumber, - blockNumber: getNumber, - transactionHash: formatHash, - address: getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: getNumber, - blockHash: formatHash, - }, { - index: ["logIndex"], - }); - function formatReceiptLog(value) { - return _formatReceiptLog(value); - } - const _formatTransactionReceipt = object({ - to: allowNull(getAddress, null), - from: allowNull(getAddress, null), - contractAddress: allowNull(getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: getNumber, - root: allowNull(hexlify), - energyUsed: getBigInt, - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeEnergyUsed: getBigInt, - effectiveEnergyPrice: allowNull(getBigInt), - status: allowNull(getNumber), - type: allowNull(getNumber, 0), - }, { - effectiveEnergyPrice: ["energyPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], - }); - function formatTransactionReceipt(value) { - return _formatTransactionReceipt(value); - } - function formatTransactionResponse(value) { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && !getAddress(value.to) && getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - const result = object({ - hash: formatHash, - type: (value) => { - if (value === "0x" || value == null) { - return 0; - } - return getNumber(value); - }, - accessList: allowNull(accessListify, null), - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(getNumber, null), - transactionIndex: allowNull(getNumber, null), - //confirmations: allowNull(getNumber, null), - from: getAddress, - maxFeePerEnergy: allowNull(getBigInt), - energyLimit: getBigInt, - to: allowNull(getAddress, null), - value: getBigInt, - nonce: getNumber, - data: formatData, - creates: allowNull(getAddress, null), - networkId: allowNull(getBigInt, null), - }, { - data: ["input"], - energyLimit: ["energy"], - })(value); - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = getCreateAddress(result); - } - // Compute the signature - if (value.signature) { - result.signature = value.signature; - } - else { - result.signature = value; - } - // Some backends omit networkId on legacy transactions, but we can compute it - if (result.networkId == null) { - const networkId = result.signature.legacynetworkId; - if (networkId != null) { - result.networkId = networkId; - } - } - // @TODO: check networkId - /* - if (value.networkId != null) { - let networkId = value.networkId; - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - result.networkId = networkId; - - } else { - let networkId = value.networkId; - - // geth-etc returns networkId - if (networkId == null && result.v == null) { - networkId = value.networkId; - } - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - if (typeof(networkId) !== "number" && result.v != null) { - networkId = (result.v - 35) / 2; - if (networkId < 0) { networkId = 0; } - networkId = parseInt(networkId); - } - - if (typeof(networkId) !== "number") { networkId = 0; } - - result.networkId = networkId; - } - */ - // 0x0000... should actually be null - if (result.blockHash && getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } - return result; - } - - class NetworkPlugin { - name; - constructor(name) { - defineProperties(this, { name }); - } - clone() { - return new NetworkPlugin(this.name); - } - } - class EnergyCostPlugin extends NetworkPlugin { - effectiveBlock; - txBase; - txCreate; - txDataZero; - txDataNonzero; - txAccessListStorageKey; - txAccessListAddress; - constructor(effectiveBlock, costs) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock || 0}`); - const props = { effectiveBlock }; - function set(name, nullish) { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs); - props[name] = value; - } - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - defineProperties(this, props); - } - clone() { - return new EnergyCostPlugin(this.effectiveBlock, this); - } - } - class FeeDataNetworkPlugin extends NetworkPlugin { - #feeDataFunc; - get feeDataFunc() { - return this.#feeDataFunc; - } - constructor(feeDataFunc) { - super("org.corebc.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - async getFeeData(provider) { - return await this.#feeDataFunc(provider); - } - clone() { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } - } - /* - export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } - } - */ - - /** - * About networks - * - * @_subsection: api/providers:Networks [networks] - */ - /* * * * - // Networks which operation against an L2 can use this plugin to - // specify how to access L1, for the purpose of resolving ENS, - // for example. - export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; - */ - // Networks or clients with a higher need for security (such as clients - // that may automatically make CCIP requests without user interaction) - // can use this plugin to anonymize requests or intercept CCIP requests - // to notify and/or receive authorization from the user - const Networks = new Map(); - class Network { - #name; - #networkId; - #plugins; - constructor(name, networkId) { - this.#name = name; - this.#networkId = getBigInt(networkId); - this.#plugins = new Map(); - } - toJSON() { - return { name: this.name, networkId: String(this.networkId) }; - } - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name() { - return this.#name; - } - set name(value) { - this.#name = value; - } - /** - * The network chain ID. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = getBigInt(value, "networkId"); - } - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other) { - if (other == null) { - return false; - } - if (typeof other === "string") { - try { - return this.networkId === getBigInt(other); - } - catch (error) { } - return this.name === other; - } - if (typeof other === "number" || typeof other === "bigint") { - try { - return this.networkId === getBigInt(other); - } - catch (error) { } - return false; - } - if (typeof other === "object") { - if (other.networkId != null) { - try { - return this.networkId === getBigInt(other.networkId); - } - catch (error) { } - return false; - } - if (other.name != null) { - return this.name === other.name; - } - return false; - } - return false; - } - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name) { - return this.#plugins.get(name) || null; - } - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename) { - return (this.plugins.filter((p) => p.name.split("#")[0] === basename)); - } - /** - * Create a copy of this Network. - */ - clone() { - const clone = new Network(this.name, this.networkId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - /** - * Compute the intrinsic energy required for a transaction. - * - * A EnergyCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicEnergy(tx) { - const costs = this.getPlugin("org.corebc.plugins.network.EnergyCost") || new EnergyCostPlugin(); - let energy = costs.txBase; - if (tx.to == null) { - energy += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - energy += costs.txDataZero; - } - else { - energy += costs.txDataNonzero; - } - } - } - return energy; - } - /** - * Returns a new Network for the %%network%% name or networkId. - */ - static from(network) { - injectCommonNetworks(); - // Default network - if (network == null) { - return Network.from("mainnet"); - } - // Canonical name or chain ID - if (typeof network === "number") { - network = BigInt(network); - } - if (typeof network === "string" || typeof network === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof network === "bigint") { - return new Network("unknown", network); - } - assertArgument(false, "unknown network", "network", network); - } - // Clonable with network-like abilities - if (typeof network.clone === "function") { - const clone = network.clone(); - //if (typeof(network.name) !== "string" || typeof(network.networkId) !== "number") { - //} - return clone; - } - // Networkish - if (typeof network === "object") { - assertArgument(typeof network.name === "string" && - typeof network.networkId === "number", "invalid network object name or networkId", "network", network); - const custom = new Network(network.name, network.networkId); - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - return custom; - } - assertArgument(false, "invalid network", "network", network); - } - /** - * Register %%nameOrnetworkId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrnetworkId, networkFunc) { - if (typeof nameOrnetworkId === "number") { - nameOrnetworkId = BigInt(nameOrnetworkId); - } - const existing = Networks.get(nameOrnetworkId); - if (existing) { - assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrnetworkId", nameOrnetworkId); - } - Networks.set(nameOrnetworkId, networkFunc); - } - } - // See: https://chainlist.org - let injected = false; - function injectCommonNetworks() { - if (injected) { - return; - } - injected = true; - /// Register popular Core networks - function registerEth(name, networkId, options) { - const func = function () { - const network = new Network(name, networkId); - network.attachPlugin(new EnergyCostPlugin()); - return network; - }; - // Register the network by name and chain ID - Network.register(name, func); - Network.register(networkId, func); - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); - registerEth("sepolia", 11155111, {}); - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - registerEth("xdai", 100, { ensNetwork: 1 }); - } - - function copy$2(obj) { - return JSON.parse(JSON.stringify(obj)); - } - // @TODO: refactor this - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class PollingBlockSubscriber { - #provider; - #poller; - #interval; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - this.#blockNumber = -2; - } - get pollingInterval() { - return this.#interval; - } - set pollingInterval(value) { - this.#interval = value; - } - async #poll() { - try { - const blockNumber = await this.#provider.getBlockNumber(); - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - // @TODO: Put a cap on the maximum number of events per loop? - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - await this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - } - } - catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - // We have been stopped - if (this.#poller == null) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - start() { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - stop() { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } - } - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class OnBlockSubscriber { - #provider; - #poll; - #running; - constructor(provider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber) => { - this._poll(blockNumber, this.#provider); - }; - } - async _poll(blockNumber, provider) { - throw new Error("sub-classes must override this"); - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poll); - } - pause(dropWhilePaused) { - this.stop(); - } - resume() { - this.start(); - } - } - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter; - constructor(provider, filter) { - super(provider); - this.#filter = copy$2(filter); - } - async _poll(blockNumber, provider) { - throw new Error("@TODO"); - } - } - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash; - constructor(provider, hash) { - super(provider); - this.#hash = hash; - } - async _poll(blockNumber, provider) { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } - } - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class PollingEventSubscriber { - #provider; - #filter; - #poller; - #running; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = copy$2(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - async #poll(blockNumber) { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - const filter = copy$2(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - this.#blockNumber = blockNumber; - for (const log of logs) { - this.#provider.emit(this.#filter, log); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } - } - - /** - * About Subclassing the Provider... - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ - // @TODO - // Event coalescence - // When we register an event with an async value (e.g. address is a Signer - // or ENS name), we need to add it immeidately for the Event API, but also - // need time to resolve the address. Upon resolving the address, we need to - // migrate the listener to the static event. We also need to maintain a map - // of Signer/ENS name to address so we can sync respond to listenerCount. - const MAX_CCIP_REDIRECTS = 10; - function isPromise(value) { - return value && typeof value.then === "function"; - } - function getTag(prefix, value) { - return (prefix + - ":" + - JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof v === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof v === "string") { - return v.toLowerCase(); - } - // Sort object keys - if (typeof v === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, {}); - } - return v; - })); - } - class UnmanagedSubscriber { - name; - constructor(name) { - defineProperties(this, { name }); - } - start() { } - stop() { } - pause(dropWhilePaused) { } - resume() { } - } - function copy$1(value) { - return JSON.parse(JSON.stringify(value)); - } - function concisify(items) { - items = Array.from(new Set(items).values()); - items.sort(); - return items; - } - async function getSubscription(_event, provider) { - if (_event == null) { - throw new Error("invalid event"); - } - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - if (typeof _event === "string") { - switch (_event) { - case "block": - case "pending": - case "debug": - case "error": - case "network": { - return { type: _event, tag: _event }; - } - } - } - if (isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - if (_event.orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { - type: "orphan", - tag: getTag("orphan", event), - filter: copy$1(event), - }; - } - if (_event.address || _event.topics) { - const event = _event; - const filter = { - topics: (event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }), - }; - if (event.address) { - const addresses = []; - const promises = []; - const addAddress = (addr) => { - if (isHexString(addr)) { - addresses.push(addr); - } - else { - promises.push((async () => { - addresses.push(await resolveAddress(addr)); - })()); - } - }; - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } - else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - return { filter, tag: getTag("event", filter), type: "event" }; - } - assertArgument(false, "unknown ProviderEvent", "event", _event); - } - function getTime$1() { - return new Date().getTime(); - } - class AbstractProvider { - #subs; - #plugins; - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState; - #networkPromise; - #anyNetwork; - #performCache; - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber; - #nextTimer; - #timers; - #disableCcipRead; - // @TODO: This should be a () => Promise so network can be - // done when needed; or rely entirely on _detectNetwork? - constructor(_network) { - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } - else if (_network) { - const network = Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { - this.emit("network", network, null); - }, 0); - } - else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - this.#lastBlockNumber = -1; - this.#performCache = new Map(); - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - this.#nextTimer = 1; - this.#timers = new Map(); - this.#disableCcipRead = false; - } - get provider() { - return this; - } - get plugins() { - return Array.from(this.#plugins.values()); - } - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - getPlugin(name) { - return this.#plugins.get(name) || null; - } - get disableCcipRead() { - return this.#disableCcipRead; - } - set disableCcipRead(value) { - this.#disableCcipRead = !!value; - } - // Shares multiple identical requests made during the same 250ms - async #perform(req) { - // Create a tag - const tag = getTag(req.method, req); - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, 250); - } - return await perform; - } - async ccipReadFetch(tx, calldata, urls) { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - const errorMessages = []; - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - this.emit("debug", { - action: "sendCcipReadFetchRequest", - request, - index: i, - urls, - }); - let errorMessage = "unknown error"; - const resp = await request.send(); - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { - action: "receiveCcipReadFetchResult", - request, - result, - }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { - action: "receiveCcipReadFetchError", - request, - result, - }); - } - catch (error) { } - // 4xx indicates the result is not present; stop - 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 }, - }); - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - assert(false, `error encountered during CCIP fetch: ${errorMessages + defineProperties(this, { primaryType: primaryTypes[0] }); + // Check for circular type references + function checkCircular(type, found) { + assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types); + found.add(type); + for (const child of links.get(type)) { + if (!parents.has(child)) { + continue; + } + // Recursively check children + checkCircular(child, found); + // Mark all ancestors as having this decendant + for (const subtype of found) { + subtypes.get(subtype).add(child); + } + } + found.delete(type); + } + checkCircular(this.primaryType, new Set()); + // Compute each fully describe type + for (const [name, set] of subtypes) { + const st = Array.from(set); + st.sort(); + this.#fullTypes.set(name, encodeType(name, types[name]) + + st.map((t) => encodeType(t, types[t])).join("")); + } + } + getEncoder(type) { + let encoder = this.#encoderCache.get(type); + if (!encoder) { + encoder = this.#getEncoder(type); + this.#encoderCache.set(type, encoder); + } + return encoder; + } + #getEncoder(type) { + // Basic encoder type (address, bool, uint256, etc) + { + const encoder = getBaseEncoder(type); + if (encoder) { + return encoder; + } + } + // Array + const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); + if (match) { + const subtype = match[1]; + const subEncoder = this.getEncoder(subtype); + return (value) => { + assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); + let result = value.map(subEncoder); + if (this.#fullTypes.has(subtype)) { + result = result.map(sha256); + } + return sha256(concat(result)); + }; + } + // Struct + const fields = this.types[type]; + if (fields) { + const encodedType = id(this.#fullTypes.get(type)); + return (value) => { + const values = fields.map(({ name, type }) => { + const result = this.getEncoder(type)(value[name]); + if (this.#fullTypes.has(type)) { + return sha256(result); + } + return result; + }); + values.unshift(encodedType); + return concat(values); + }; + } + assertArgument(false, `unknown type: ${type}`, "type", type); + } + encodeType(name) { + const result = this.#fullTypes.get(name); + assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); + return result; + } + encodeData(type, value) { + return this.getEncoder(type)(value); + } + hashStruct(name, value) { + return sha256(this.encodeData(name, value)); + } + encode(value) { + return this.encodeData(this.primaryType, value); + } + hash(value) { + return this.hashStruct(this.primaryType, value); + } + _visit(type, value, callback) { + // Basic encoder type (address, bool, uint256, etc) + { + const encoder = getBaseEncoder(type); + if (encoder) { + return callback(type, value); + } + } + // Array + const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); + if (match) { + assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); + return value.map((v) => this._visit(match[1], v, callback)); + } + // Struct + const fields = this.types[type]; + if (fields) { + return fields.reduce((accum, { name, type }) => { + accum[name] = this._visit(type, value[name], callback); + return accum; + }, {}); + } + assertArgument(false, `unknown type: ${type}`, "type", type); + } + visit(value, callback) { + return this._visit(this.primaryType, value, callback); + } + static from(types) { + return new TypedDataEncoder(types); + } + static getPrimaryType(types) { + return TypedDataEncoder.from(types).primaryType; + } + static hashStruct(name, types, value) { + return TypedDataEncoder.from(types).hashStruct(name, value); + } + static hashDomain(domain) { + const domainFields = []; + for (const name in domain) { + if (domain[name] == null) { + continue; + } + const type = domainFieldTypes[name]; + assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); + domainFields.push({ name, type }); + } + domainFields.sort((a, b) => { + return (domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name)); + }); + return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); + } + static encode(domain, types, value) { + return concat([ + "0x1901", + TypedDataEncoder.hashDomain(domain), + TypedDataEncoder.from(types).hash(value), + ]); + } + static hash(domain, types, value) { + return sha256(TypedDataEncoder.encode(domain, types, value)); + } + // Replaces all address types with ENS names with their looked up address + static async resolveNames(domain, types, value, resolveName) { + // Make a copy to isolate it from the object passed in + domain = Object.assign({}, domain); + // Allow passing null to ignore value + for (const key in domain) { + if (domain[key] == null) { + delete domain[key]; + } + } + // Look up all ENS names + const ensCache = {}; + // Do we need to look up the domain's verifyingContract? + if (domain.verifyingContract && + !isHexString(domain.verifyingContract, 20)) { + ensCache[domain.verifyingContract] = "0x"; + } + // We are going to use the encoder to visit all the base values + const encoder = TypedDataEncoder.from(types); + // Get a list of all the addresses + encoder.visit(value, (type, value) => { + if (type === "address" && !isHexString(value, 20)) { + ensCache[value] = "0x"; + } + return value; + }); + // Lookup each name + for (const name in ensCache) { + ensCache[name] = await resolveName(name); + } + // Replace the domain verifyingContract if needed + if (domain.verifyingContract && ensCache[domain.verifyingContract]) { + domain.verifyingContract = ensCache[domain.verifyingContract]; + } + // Replace all ENS names with their address + value = encoder.visit(value, (type, value) => { + if (type === "address" && ensCache[value]) { + return ensCache[value]; + } + return value; + }); + return { domain, value }; + } + static getPayload(domain, types, value) { + // Validate the domain fields + TypedDataEncoder.hashDomain(domain); + // Derive the EIP712Domain Struct reference type + const domainValues = {}; + const domainTypes = []; + domainFieldNames.forEach((name) => { + const value = domain[name]; + if (value == null) { + return; + } + domainValues[name] = domainChecks[name](value); + domainTypes.push({ name, type: domainFieldTypes[name] }); + }); + const encoder = TypedDataEncoder.from(types); + const typesWithDomain = Object.assign({}, types); + assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); + typesWithDomain.EIP712Domain = domainTypes; + // Validate the data structures and types + encoder.encode(value); + return { + types: typesWithDomain, + domain: domainValues, + primaryType: encoder.primaryType, + message: encoder.visit(value, (type, value) => { + // bytes + if (type.match(/^bytes(\d*)/)) { + return hexlify(getBytes(value)); + } + // uint or int + if (type.match(/^u?int/)) { + return getBigInt(value).toString(); + } + switch (type) { + case "address": + return value.toLowerCase(); + case "bool": + return !!value; + case "string": + assertArgument(typeof value === "string", "invalid string", "value", value); + return value; + } + assertArgument(false, "unsupported type", "type", type); + }), + }; + } + } + /** + * Compute the address used to sign the typed data for the %%signature%%. + */ + function verifyTypedData(domain, types, value, signature, prefix) { + return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix); + } + + /** + * About frgaments... + * + * @_subsection api/abi/abi-coder:Fragments [about-fragments] + */ + var _a; + // [ "a", "b" ] => { "a": 1, "b": 1 } + function setify(items) { + const result = new Set(); + items.forEach((k) => result.add(k)); + return Object.freeze(result); + } + // Visibility Keywords + const _kwVisib = "constant external internal payable private public pure view"; + const KwVisib = setify(_kwVisib.split(" ")); + const _kwTypes = "constructor error event fallback function receive struct"; + const KwTypes = setify(_kwTypes.split(" ")); + const _kwModifiers = "calldata memory storage payable indexed"; + const KwModifiers = setify(_kwModifiers.split(" ")); + const _kwOther = "tuple returns"; + // All Keywords + const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); + const Keywords = setify(_keywords.split(" ")); + // Single character tokens + const SimpleTokens = { + "(": "OPEN_PAREN", + ")": "CLOSE_PAREN", + "[": "OPEN_BRACKET", + "]": "CLOSE_BRACKET", + ",": "COMMA", + "@": "AT", + }; + // Parser regexes to consume the next token + const regexWhitespacePrefix = new RegExp("^(\\s*)"); + const regexNumberPrefix = new RegExp("^([0-9]+)"); + const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); + // Parser regexs to check validity + const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); + const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); + class TokenString { + #offset; + #tokens; + get offset() { + return this.#offset; + } + get length() { + return this.#tokens.length - this.#offset; + } + constructor(tokens) { + this.#offset = 0; + this.#tokens = tokens.slice(); + } + clone() { + return new _a(this.#tokens); + } + reset() { + this.#offset = 0; + } + #subTokenString(from = 0, to = 0) { + return new _a(this.#tokens.slice(from, to).map((t) => { + return Object.freeze(Object.assign({}, t, { + match: t.match - from, + linkBack: t.linkBack - from, + linkNext: t.linkNext - from, + })); + })); + } + // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens + popKeyword(allowed) { + const top = this.peek(); + if (top.type !== "KEYWORD" || !allowed.has(top.text)) { + throw new Error(`expected keyword ${top.text}`); + } + return this.pop().text; + } + // Pops and returns the value of the next token if it is `type`; throws if out of tokens + popType(type) { + if (this.peek().type !== type) { + throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`); + } + return this.pop().text; + } + // Pops and returns a "(" TOKENS ")" + popParen() { + const top = this.peek(); + if (top.type !== "OPEN_PAREN") { + throw new Error("bad start"); + } + const result = this.#subTokenString(this.#offset + 1, top.match + 1); + this.#offset = top.match + 1; + return result; + } + // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" + popParams() { + const top = this.peek(); + if (top.type !== "OPEN_PAREN") { + throw new Error("bad start"); + } + const result = []; + while (this.#offset < top.match - 1) { + const link = this.peek().linkNext; + result.push(this.#subTokenString(this.#offset + 1, link)); + this.#offset = link; + } + this.#offset = top.match + 1; + return result; + } + // Returns the top Token, throwing if out of tokens + peek() { + if (this.#offset >= this.#tokens.length) { + throw new Error("out-of-bounds"); + } + return this.#tokens[this.#offset]; + } + // Returns the next value, if it is a keyword in `allowed` + peekKeyword(allowed) { + const top = this.peekType("KEYWORD"); + return top != null && allowed.has(top) ? top : null; + } + // Returns the value of the next token if it is `type` + peekType(type) { + if (this.length === 0) { + return null; + } + const top = this.peek(); + return top.type === type ? top.text : null; + } + // Returns the next token; throws if out of tokens + pop() { + const result = this.peek(); + this.#offset++; + return result; + } + toString() { + const tokens = []; + for (let i = this.#offset; i < this.#tokens.length; i++) { + const token = this.#tokens[i]; + tokens.push(`${token.type}:${token.text}`); + } + return ``; + } + } + _a = TokenString; + function lex(text) { + const tokens = []; + const throwError = (message) => { + const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI"; + throw new Error(`invalid token ${token} at ${offset}: ${message}`); + }; + let brackets = []; + let commas = []; + let offset = 0; + while (offset < text.length) { + // Strip off any leading whitespace + let cur = text.substring(offset); + let match = cur.match(regexWhitespacePrefix); + if (match) { + offset += match[1].length; + cur = text.substring(offset); + } + const token = { + depth: brackets.length, + linkBack: -1, + linkNext: -1, + match: -1, + type: "", + text: "", + offset, + value: -1, + }; + tokens.push(token); + let type = SimpleTokens[cur[0]] || ""; + if (type) { + token.type = type; + token.text = cur[0]; + offset++; + if (type === "OPEN_PAREN") { + brackets.push(tokens.length - 1); + commas.push(tokens.length - 1); + } + else if (type == "CLOSE_PAREN") { + if (brackets.length === 0) { + throwError("no matching open bracket"); + } + token.match = brackets.pop(); + tokens[token.match].match = tokens.length - 1; + token.depth--; + token.linkBack = commas.pop(); + tokens[token.linkBack].linkNext = tokens.length - 1; + } + else if (type === "COMMA") { + token.linkBack = commas.pop(); + tokens[token.linkBack].linkNext = tokens.length - 1; + commas.push(tokens.length - 1); + } + else if (type === "OPEN_BRACKET") { + token.type = "BRACKET"; + } + else if (type === "CLOSE_BRACKET") { + // Remove the CLOSE_BRACKET + let suffix = tokens.pop().text; + if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { + const value = tokens.pop().text; + suffix = value + suffix; + tokens[tokens.length - 1].value = + getNumber(value); + } + if (tokens.length === 0 || + tokens[tokens.length - 1].type !== "BRACKET") { + throw new Error("missing opening bracket"); + } + tokens[tokens.length - 1].text += suffix; + } + continue; + } + match = cur.match(regexIdPrefix); + if (match) { + token.text = match[1]; + offset += token.text.length; + if (Keywords.has(token.text)) { + token.type = "KEYWORD"; + continue; + } + if (token.text.match(regexType)) { + token.type = "TYPE"; + continue; + } + token.type = "ID"; + continue; + } + match = cur.match(regexNumberPrefix); + if (match) { + token.text = match[1]; + token.type = "NUMBER"; + offset += token.text.length; + continue; + } + throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); + } + return new TokenString(tokens.map((t) => Object.freeze(t))); + } + // Check only one of `allowed` is in `set` + function allowSingle(set, allowed) { + let included = []; + for (const key in allowed.keys()) { + if (set.has(key)) { + included.push(key); + } + } + if (included.length > 1) { + throw new Error(`conflicting types: ${included.join(", ")}`); + } + } + // Functions to process a Solidity Signature TokenString from left-to-right for... + // ...the name with an optional type, returning the name + function consumeName(type, tokens) { + if (tokens.peekKeyword(KwTypes)) { + const keyword = tokens.pop().text; + if (keyword !== type) { + throw new Error(`expected ${type}, got ${keyword}`); + } + } + return tokens.popType("ID"); + } + // ...all keywords matching allowed, returning the keywords + function consumeKeywords(tokens, allowed) { + const keywords = new Set(); + while (true) { + const keyword = tokens.peekType("KEYWORD"); + if (keyword == null || (allowed && !allowed.has(keyword))) { + break; + } + tokens.pop(); + if (keywords.has(keyword)) { + throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); + } + keywords.add(keyword); + } + return Object.freeze(keywords); + } + // ...all visibility keywords, returning the coalesced mutability + function consumeMutability(tokens) { + let modifiers = consumeKeywords(tokens, KwVisib); + // Detect conflicting modifiers + allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); + allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); + // Process mutability states + if (modifiers.has("view")) { + return "view"; + } + if (modifiers.has("pure")) { + return "pure"; + } + if (modifiers.has("payable")) { + return "payable"; + } + if (modifiers.has("nonpayable")) { + return "nonpayable"; + } + // Process legacy `constant` last + if (modifiers.has("constant")) { + return "view"; + } + return "nonpayable"; + } + // ...a parameter list, returning the ParamType list + function consumeParams(tokens, allowIndexed) { + return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); + } + // ...a energy limit, returning a BigNumber or null if none + function consumeEnergy(tokens) { + if (tokens.peekType("AT")) { + tokens.pop(); + if (tokens.peekType("NUMBER")) { + return getBigInt(tokens.pop().text); + } + throw new Error("invalid energy"); + } + return null; + } + function consumeEoi(tokens) { + if (tokens.length) { + throw new Error(`unexpected tokens: ${tokens.toString()}`); + } + } + const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); + function verifyBasicType(type) { + const match = type.match(regexType); + assertArgument(match, "invalid type", "type", type); + if (type === "uint") { + return "uint256"; + } + if (type === "int") { + return "int256"; + } + if (match[2]) { + // bytesXX + const length = parseInt(match[2]); + assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); + } + else if (match[3]) { + // intXX or uintXX + const size = parseInt(match[3]); + assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid numeric width", "type", type); + } + return type; + } + // Make the Fragment constructors effectively private + const _guard$2 = {}; + const internal$1 = Symbol.for("_corebc_internal"); + const ParamTypeInternal = "_ParamTypeInternal"; + const ErrorFragmentInternal = "_ErrorInternal"; + const EventFragmentInternal = "_EventInternal"; + const ConstructorFragmentInternal = "_ConstructorInternal"; + const FallbackFragmentInternal = "_FallbackInternal"; + const FunctionFragmentInternal = "_FunctionInternal"; + const StructFragmentInternal = "_StructInternal"; + /** + * Each input and output of a [[Fragment]] is an Array of **PAramType**. + */ + class ParamType { + /** + * The local name of the parameter (or ``""`` if unbound) + */ + name; + /** + * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, + * ``"uint256[3][]"``) + */ + type; + /** + * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) + */ + baseType; + /** + * True if the parameters is indexed. + * + * For non-indexable types this is ``null``. + */ + indexed; + /** + * The components for the tuple. + * + * For non-tuple types this is ``null``. + */ + components; + /** + * The array length, or ``-1`` for dynamic-lengthed arrays. + * + * For non-array types this is ``null``. + */ + arrayLength; + /** + * The type of each child in the array. + * + * For non-array types this is ``null``. + */ + arrayChildren; + /** + * @private + */ + constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { + assertPrivate(guard, _guard$2, "ParamType"); + Object.defineProperty(this, internal$1, { value: ParamTypeInternal }); + if (components) { + components = Object.freeze(components.slice()); + } + if (baseType === "array") { + if (arrayLength == null || arrayChildren == null) { + throw new Error(""); + } + } + else if (arrayLength != null || arrayChildren != null) { + throw new Error(""); + } + if (baseType === "tuple") { + if (components == null) { + throw new Error(""); + } + } + else if (components != null) { + throw new Error(""); + } + defineProperties(this, { + name, + type, + baseType, + indexed, + components, + arrayLength, + arrayChildren, + }); + } + /** + * Return a string representation of this type. + * + * For example, + * + * ``sighash" => "(uint256,address)"`` + * + * ``"minimal" => "tuple(uint256,address) indexed"`` + * + * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` + */ + format(format) { + if (format == null) { + format = "sighash"; + } + if (format === "json") { + let result = { + type: this.baseType === "tuple" ? "tuple" : this.type, + name: this.name || undefined, + }; + if (typeof this.indexed === "boolean") { + result.indexed = this.indexed; + } + if (this.isTuple()) { + result.components = this.components.map((c) => JSON.parse(c.format(format))); + } + return JSON.stringify(result); + } + let result = ""; + // Array + if (this.isArray()) { + result += this.arrayChildren.format(format); + result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; + } + else { + if (this.isTuple()) { + if (format !== "sighash") { + result += this.type; + } + result += + "(" + + this.components + .map((comp) => comp.format(format)) + .join(format === "full" ? ", " : ",") + + ")"; + } + else { + result += this.type; + } + } + if (format !== "sighash") { + if (this.indexed === true) { + result += " indexed"; + } + if (format === "full" && this.name) { + result += " " + this.name; + } + } + return result; + } + /* + * Returns true if %%value%% is an Array type. + * + * This provides a type gaurd ensuring that the + * [[arrayChildren]] and [[arrayLength]] are non-null. + */ + //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } { + // return value && (value.baseType === "array") + //} + /** + * Returns true if %%this%% is an Array type. + * + * This provides a type gaurd ensuring that [[arrayChildren]] + * and [[arrayLength]] are non-null. + */ + isArray() { + return this.baseType === "array"; + } + /** + * Returns true if %%this%% is a Tuple type. + * + * This provides a type gaurd ensuring that [[components]] + * is non-null. + */ + isTuple() { + return this.baseType === "tuple"; + } + /** + * Returns true if %%this%% is an Indexable type. + * + * This provides a type gaurd ensuring that [[indexed]] + * is non-null. + */ + isIndexable() { + return this.indexed != null; + } + /** + * Walks the **ParamType** with %%value%%, calling %%process%% + * on each type, destructing the %%value%% recursively. + */ + walk(value, process) { + if (this.isArray()) { + if (!Array.isArray(value)) { + throw new Error("invalid array value"); + } + if (this.arrayLength !== -1 && value.length !== this.arrayLength) { + throw new Error("array is wrong length"); + } + const _this = this; + return value.map((v) => _this.arrayChildren.walk(v, process)); + } + if (this.isTuple()) { + if (!Array.isArray(value)) { + throw new Error("invalid tuple value"); + } + if (value.length !== this.components.length) { + throw new Error("array is wrong length"); + } + const _this = this; + return value.map((v, i) => _this.components[i].walk(v, process)); + } + return process(this.type, value); + } + #walkAsync(promises, value, process, setValue) { + if (this.isArray()) { + if (!Array.isArray(value)) { + throw new Error("invalid array value"); + } + if (this.arrayLength !== -1 && value.length !== this.arrayLength) { + throw new Error("array is wrong length"); + } + const childType = this.arrayChildren; + const result = value.slice(); + result.forEach((value, index) => { + childType.#walkAsync(promises, value, process, (value) => { + result[index] = value; + }); + }); + setValue(result); + return; + } + if (this.isTuple()) { + const components = this.components; + // Convert the object into an array + let result; + if (Array.isArray(value)) { + result = value.slice(); + } + else { + if (value == null || typeof value !== "object") { + throw new Error("invalid tuple value"); + } + result = components.map((param) => { + if (!param.name) { + throw new Error("cannot use object value with unnamed components"); + } + if (!(param.name in value)) { + throw new Error(`missing value for component ${param.name}`); + } + return value[param.name]; + }); + } + if (result.length !== this.components.length) { + throw new Error("array is wrong length"); + } + result.forEach((value, index) => { + components[index].#walkAsync(promises, value, process, (value) => { + result[index] = value; + }); + }); + setValue(result); + return; + } + const result = process(this.type, value); + if (result.then) { + promises.push((async function () { + setValue(await result); + })()); + } + else { + setValue(result); + } + } + /** + * Walks the **ParamType** with %%value%%, asynchronously calling + * %%process%% on each type, destructing the %%value%% recursively. + * + * This can be used to resolve ENS naes by walking and resolving each + * ``"address"`` type. + */ + async walkAsync(value, process) { + const promises = []; + const result = [value]; + this.#walkAsync(promises, value, process, (value) => { + result[0] = value; + }); + if (promises.length) { + await Promise.all(promises); + } + return result[0]; + } + /** + * Creates a new **ParamType** for %%obj%%. + * + * If %%allowIndexed%% then the ``indexed`` keyword is permitted, + * otherwise the ``indexed`` keyword will throw an error. + */ + static from(obj, allowIndexed) { + if (ParamType.isParamType(obj)) { + return obj; + } + if (typeof obj === "string") { + return ParamType.from(lex(obj), allowIndexed); + } + else if (obj instanceof TokenString) { + let type = "", baseType = ""; + let comps = null; + if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || + obj.peekType("OPEN_PAREN")) { + // Tuple + baseType = "tuple"; + comps = obj.popParams().map((t) => ParamType.from(t)); + type = `tuple(${comps.map((c) => c.format()).join(",")})`; + } + else { + // Normal + type = verifyBasicType(obj.popType("TYPE")); + baseType = type; + } + // Check for Array + let arrayChildren = null; + let arrayLength = null; + while (obj.length && obj.peekType("BRACKET")) { + const bracket = obj.pop(); //arrays[i]; + arrayChildren = new ParamType(_guard$2, "", type, baseType, null, comps, arrayLength, arrayChildren); + arrayLength = bracket.value; + type += bracket.text; + baseType = "array"; + comps = null; + } + let indexed = null; + const keywords = consumeKeywords(obj, KwModifiers); + if (keywords.has("indexed")) { + if (!allowIndexed) { + throw new Error(""); + } + indexed = true; + } + const name = obj.peekType("ID") ? obj.pop().text : ""; + if (obj.length) { + throw new Error("leftover tokens"); + } + return new ParamType(_guard$2, name, type, baseType, indexed, comps, arrayLength, arrayChildren); + } + const name = obj.name; + assertArgument(!name || (typeof name === "string" && name.match(regexId)), "invalid name", "obj.name", name); + let indexed = obj.indexed; + if (indexed != null) { + assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); + indexed = !!indexed; + } + let type = obj.type; + let arrayMatch = type.match(regexArrayType); + if (arrayMatch) { + const arrayLength = parseInt(arrayMatch[2] || "-1"); + const arrayChildren = ParamType.from({ + type: arrayMatch[1], + components: obj.components, + }); + return new ParamType(_guard$2, name || "", type, "array", indexed, null, arrayLength, arrayChildren); + } + if (type === "tuple" || + type.startsWith("tuple(" /* fix: ) */) || + type.startsWith("(" /* fix: ) */)) { + const comps = obj.components != null + ? obj.components.map((c) => ParamType.from(c)) + : null; + const tuple = new ParamType(_guard$2, name || "", type, "tuple", indexed, comps, null, null); + // @TODO: use lexer to validate and normalize type + return tuple; + } + type = verifyBasicType(obj.type); + return new ParamType(_guard$2, name || "", type, type, indexed, null, null, null); + } + /** + * Returns true if %%value%% is a **ParamType**. + */ + static isParamType(value) { + return value && value[internal$1] === ParamTypeInternal; + } + } + /** + * An abstract class to represent An individual fragment from a parse ABI. + */ + class Fragment { + /** + * The type of the fragment. + */ + type; + /** + * The inputs for the fragment. + */ + inputs; + /** + * @private + */ + constructor(guard, type, inputs) { + assertPrivate(guard, _guard$2, "Fragment"); + inputs = Object.freeze(inputs.slice()); + defineProperties(this, { type, inputs }); + } + /** + * Creates a new **Fragment** for %%obj%%, wich can be any supported + * ABI frgament type. + */ + static from(obj) { + if (typeof obj === "string") { + // Try parsing JSON... + try { + Fragment.from(JSON.parse(obj)); + } + catch (e) { } + // ...otherwise, use the human-readable lexer + return Fragment.from(lex(obj)); + } + if (obj instanceof TokenString) { + // Human-readable ABI (already lexed) + const type = obj.peekKeyword(KwTypes); + switch (type) { + case "constructor": + return ConstructorFragment.from(obj); + case "error": + return ErrorFragment.from(obj); + case "event": + return EventFragment.from(obj); + case "fallback": + case "receive": + return FallbackFragment.from(obj); + case "function": + return FunctionFragment.from(obj); + case "struct": + return StructFragment.from(obj); + } + } + else if (typeof obj === "object") { + // JSON ABI + switch (obj.type) { + case "constructor": + return ConstructorFragment.from(obj); + case "error": + return ErrorFragment.from(obj); + case "event": + return EventFragment.from(obj); + case "fallback": + case "receive": + return FallbackFragment.from(obj); + case "function": + return FunctionFragment.from(obj); + case "struct": + return StructFragment.from(obj); + } + assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { + operation: "Fragment.from", + }); + } + assertArgument(false, "unsupported frgament object", "obj", obj); + } + /** + * Returns true if %%value%% is a [[ConstructorFragment]]. + */ + static isConstructor(value) { + return ConstructorFragment.isFragment(value); + } + /** + * Returns true if %%value%% is an [[ErrorFragment]]. + */ + static isError(value) { + return ErrorFragment.isFragment(value); + } + /** + * Returns true if %%value%% is an [[EventFragment]]. + */ + static isEvent(value) { + return EventFragment.isFragment(value); + } + /** + * Returns true if %%value%% is a [[FunctionFragment]]. + */ + static isFunction(value) { + return FunctionFragment.isFragment(value); + } + /** + * Returns true if %%value%% is a [[StructFragment]]. + */ + static isStruct(value) { + return StructFragment.isFragment(value); + } + } + /** + * An abstract class to represent An individual fragment + * which has a name from a parse ABI. + */ + class NamedFragment extends Fragment { + /** + * The name of the fragment. + */ + name; + /** + * @private + */ + constructor(guard, type, name, inputs) { + super(guard, type, inputs); + assertArgument(typeof name === "string" && name.match(regexId), "invalid identifier", "name", name); + inputs = Object.freeze(inputs.slice()); + defineProperties(this, { name }); + } + } + function joinParams(format, params) { + return ("(" + + params.map((p) => p.format(format)).join(format === "full" ? ", " : ",") + + ")"); + } + /** + * A Fragment which represents a //Custom Error//. + */ + class ErrorFragment extends NamedFragment { + /** + * @private + */ + constructor(guard, name, inputs) { + super(guard, "error", name, inputs); + Object.defineProperty(this, internal$1, { value: ErrorFragmentInternal }); + } + /** + * The Custom Error selector. + */ + get selector() { + return id(this.format("sighash")).substring(0, 10); + } + format(format) { + if (format == null) { + format = "sighash"; + } + if (format === "json") { + return JSON.stringify({ + type: "error", + name: this.name, + inputs: this.inputs.map((input) => JSON.parse(input.format(format))), + }); + } + const result = []; + if (format !== "sighash") { + result.push("error"); + } + result.push(this.name + joinParams(format, this.inputs)); + return result.join(" "); + } + static from(obj) { + if (ErrorFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return ErrorFragment.from(lex(obj)); + } + else if (obj instanceof TokenString) { + const name = consumeName("error", obj); + const inputs = consumeParams(obj); + consumeEoi(obj); + return new ErrorFragment(_guard$2, name, inputs); + } + return new ErrorFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); + } + static isFragment(value) { + return value && value[internal$1] === ErrorFragmentInternal; + } + } + /** + * A Fragment which represents an Event. + */ + class EventFragment extends NamedFragment { + anonymous; + /** + * @private + */ + constructor(guard, name, inputs, anonymous) { + super(guard, "event", name, inputs); + Object.defineProperty(this, internal$1, { value: EventFragmentInternal }); + defineProperties(this, { anonymous }); + } + /** + * The Event topic hash. + */ + get topicHash() { + return id(this.format("sighash")); + } + format(format) { + if (format == null) { + format = "sighash"; + } + if (format === "json") { + return JSON.stringify({ + type: "event", + anonymous: this.anonymous, + name: this.name, + inputs: this.inputs.map((i) => JSON.parse(i.format(format))), + }); + } + const result = []; + if (format !== "sighash") { + result.push("event"); + } + result.push(this.name + joinParams(format, this.inputs)); + if (format !== "sighash" && this.anonymous) { + result.push("anonymous"); + } + return result.join(" "); + } + static getTopicHash(name, params) { + params = (params || []).map((p) => ParamType.from(p)); + const fragment = new EventFragment(_guard$2, name, params, false); + return fragment.topicHash; + } + static from(obj) { + if (EventFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return EventFragment.from(lex(obj)); + } + else if (obj instanceof TokenString) { + const name = consumeName("event", obj); + const inputs = consumeParams(obj, true); + const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); + consumeEoi(obj); + return new EventFragment(_guard$2, name, inputs, anonymous); + } + return new EventFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); + } + static isFragment(value) { + return value && value[internal$1] === EventFragmentInternal; + } + } + /** + * A Fragment which represents a constructor. + */ + class ConstructorFragment extends Fragment { + payable; + energy; + /** + * @private + */ + constructor(guard, type, inputs, payable, energy) { + super(guard, type, inputs); + Object.defineProperty(this, internal$1, { + value: ConstructorFragmentInternal, + }); + defineProperties(this, { payable, energy }); + } + format(format) { + assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); + if (format === "json") { + return JSON.stringify({ + type: "constructor", + stateMutability: this.payable ? "payable" : "undefined", + payable: this.payable, + energy: this.energy != null ? this.energy : undefined, + inputs: this.inputs.map((i) => JSON.parse(i.format(format))), + }); + } + const result = [`constructor${joinParams(format, this.inputs)}`]; + result.push(this.payable ? "payable" : "nonpayable"); + if (this.energy != null) { + result.push(`@${this.energy.toString()}`); + } + return result.join(" "); + } + static from(obj) { + if (ConstructorFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return ConstructorFragment.from(lex(obj)); + } + else if (obj instanceof TokenString) { + consumeKeywords(obj, setify(["constructor"])); + const inputs = consumeParams(obj); + const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable"); + const energy = consumeEnergy(obj); + consumeEoi(obj); + return new ConstructorFragment(_guard$2, "constructor", inputs, payable, energy); + } + return new ConstructorFragment(_guard$2, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null); + } + static isFragment(value) { + return value && value[internal$1] === ConstructorFragmentInternal; + } + } + /** + * A Fragment which represents a method. + */ + class FallbackFragment extends Fragment { + /** + * If the function can be sent value during invocation. + */ + payable; + constructor(guard, inputs, payable) { + super(guard, "fallback", inputs); + Object.defineProperty(this, internal$1, { value: FallbackFragmentInternal }); + defineProperties(this, { payable }); + } + format(format) { + const type = this.inputs.length === 0 ? "receive" : "fallback"; + if (format === "json") { + const stateMutability = this.payable ? "payable" : "nonpayable"; + return JSON.stringify({ type, stateMutability }); + } + return `${type}()${this.payable ? " payable" : ""}`; + } + static from(obj) { + if (FallbackFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return FallbackFragment.from(lex(obj)); + } + else if (obj instanceof TokenString) { + const errorObj = obj.toString(); + const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); + assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); + const type = obj.popKeyword(setify(["fallback", "receive"])); + // receive() + if (type === "receive") { + const inputs = consumeParams(obj); + assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); + consumeKeywords(obj, setify(["payable"])); + consumeEoi(obj); + return new FallbackFragment(_guard$2, [], true); + } + // fallback() [payable] + // fallback(bytes) [payable] returns (bytes) + let inputs = consumeParams(obj); + if (inputs.length) { + assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); + } + else { + inputs = [ParamType.from("bytes")]; + } + const mutability = consumeMutability(obj); + assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); + if (consumeKeywords(obj, setify(["returns"])).has("returns")) { + const outputs = consumeParams(obj); + assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); + } + consumeEoi(obj); + return new FallbackFragment(_guard$2, inputs, mutability === "payable"); + } + if (obj.type === "receive") { + return new FallbackFragment(_guard$2, [], true); + } + if (obj.type === "fallback") { + const inputs = [ParamType.from("bytes")]; + const payable = obj.stateMutability === "payable"; + return new FallbackFragment(_guard$2, inputs, payable); + } + assertArgument(false, "invalid fallback description", "obj", obj); + } + static isFragment(value) { + return value && value[internal$1] === FallbackFragmentInternal; + } + } + /** + * A Fragment which represents a method. + */ + class FunctionFragment extends NamedFragment { + /** + * If the function is constant (e.g. ``pure`` or ``view`` functions). + */ + constant; + /** + * The returned types for the result of calling this function. + */ + outputs; + /** + * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` + * or ``pure``) + */ + stateMutability; + /** + * If the function can be sent value during invocation. + */ + payable; + /** + * The amount of energy to send when calling this function + */ + energy; + /** + * @private + */ + constructor(guard, name, stateMutability, inputs, outputs, energy) { + super(guard, "function", name, inputs); + Object.defineProperty(this, internal$1, { value: FunctionFragmentInternal }); + outputs = Object.freeze(outputs.slice()); + const constant = stateMutability === "view" || stateMutability === "pure"; + const payable = stateMutability === "payable"; + defineProperties(this, { + constant, + energy, + outputs, + payable, + stateMutability, + }); + } + /** + * The Function selector. + */ + get selector() { + return id(this.format("sighash")).substring(0, 10); + } + format(format) { + if (format == null) { + format = "sighash"; + } + if (format === "json") { + return JSON.stringify({ + type: "function", + name: this.name, + constant: this.constant, + stateMutability: this.stateMutability !== "nonpayable" + ? this.stateMutability + : undefined, + payable: this.payable, + energy: this.energy != null ? this.energy : undefined, + inputs: this.inputs.map((i) => JSON.parse(i.format(format))), + outputs: this.outputs.map((o) => JSON.parse(o.format(format))), + }); + } + const result = []; + if (format !== "sighash") { + result.push("function"); + } + result.push(this.name + joinParams(format, this.inputs)); + if (format !== "sighash") { + if (this.stateMutability !== "nonpayable") { + result.push(this.stateMutability); + } + if (this.outputs && this.outputs.length) { + result.push("returns"); + result.push(joinParams(format, this.outputs)); + } + if (this.energy != null) { + result.push(`@${this.energy.toString()}`); + } + } + return result.join(" "); + } + static getSelector(name, params) { + params = (params || []).map((p) => ParamType.from(p)); + const fragment = new FunctionFragment(_guard$2, name, "view", params, [], null); + return fragment.selector; + } + static from(obj) { + if (FunctionFragment.isFragment(obj)) { + return obj; + } + if (typeof obj === "string") { + return FunctionFragment.from(lex(obj)); + } + else if (obj instanceof TokenString) { + const name = consumeName("function", obj); + const inputs = consumeParams(obj); + const mutability = consumeMutability(obj); + let outputs = []; + if (consumeKeywords(obj, setify(["returns"])).has("returns")) { + outputs = consumeParams(obj); + } + const energy = consumeEnergy(obj); + consumeEoi(obj); + return new FunctionFragment(_guard$2, name, mutability, inputs, outputs, energy); + } + let stateMutability = obj.stateMutability; + // Use legacy Solidity ABI logic if stateMutability is missing + if (stateMutability == null) { + stateMutability = "payable"; + if (typeof obj.constant === "boolean") { + stateMutability = "view"; + if (!obj.constant) { + stateMutability = "payable"; + if (typeof obj.payable === "boolean" && !obj.payable) { + stateMutability = "nonpayable"; + } + } + } + else if (typeof obj.payable === "boolean" && !obj.payable) { + stateMutability = "nonpayable"; + } + } + // @TODO: verifyState for stateMutability (e.g. throw if + // payable: false but stateMutability is "nonpayable") + return new FunctionFragment(_guard$2, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null); + } + static isFragment(value) { + return value && value[internal$1] === FunctionFragmentInternal; + } + } + /** + * A Fragment which represents a structure. + */ + class StructFragment extends NamedFragment { + /** + * @private + */ + constructor(guard, name, inputs) { + super(guard, "struct", name, inputs); + Object.defineProperty(this, internal$1, { value: StructFragmentInternal }); + } + format() { + throw new Error("@TODO"); + } + static from(obj) { + if (typeof obj === "string") { + return StructFragment.from(lex(obj)); + } + else if (obj instanceof TokenString) { + const name = consumeName("struct", obj); + const inputs = consumeParams(obj); + consumeEoi(obj); + return new StructFragment(_guard$2, name, inputs); + } + return new StructFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); + } + static isFragment(value) { + return value && value[internal$1] === StructFragmentInternal; + } + } + + /** + * When sending values to or receiving values from a [[Contract]], the + * data is generally encoded using the [ABI standard](link-solc-abi). + * + * The AbiCoder provides a utility to encode values to ABI data and + * decode values from ABI data. + * + * Most of the time, developers should favour the [[Contract]] class, + * which further abstracts a lot of the finer details of ABI data. + * + * @_section api/abi/abi-coder:ABI Encoding + */ + // https://docs.soliditylang.org/en/v0.8.17/control-structures.html + const PanicReasons$1 = new Map(); + PanicReasons$1.set(0x00, "GENERIC_PANIC"); + PanicReasons$1.set(0x01, "ASSERT_FALSE"); + PanicReasons$1.set(0x11, "OVERFLOW"); + PanicReasons$1.set(0x12, "DIVIDE_BY_ZERO"); + PanicReasons$1.set(0x21, "ENUM_RANGE_ERROR"); + PanicReasons$1.set(0x22, "BAD_STORAGE_DATA"); + PanicReasons$1.set(0x31, "STACK_UNDERFLOW"); + PanicReasons$1.set(0x32, "ARRAY_RANGE_ERROR"); + PanicReasons$1.set(0x41, "OUT_OF_MEMORY"); + PanicReasons$1.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); + const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); + const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); + let defaultCoder = null; + function getBuiltinCallException(action, tx, data, abiCoder) { + let message = "missing revert data"; + let reason = null; + const invocation = null; + let revert = null; + if (data) { + message = "execution reverted"; + const bytes = getBytes(data); + data = hexlify(data); + if (bytes.length === 0) { + message += " (no data present; likely require(false) occurred"; + reason = "require(false)"; + } + else if (bytes.length % 32 !== 4) { + message += " (could not decode reason; invalid data length)"; + } + else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { + // Error(string) + try { + reason = abiCoder.decode(["string"], bytes.slice(4))[0]; + revert = { + signature: "Error(string)", + name: "Error", + args: [reason], + }; + message += `: ${JSON.stringify(reason)}`; + } + catch (error) { + message += " (could not decode reason; invalid string data)"; + } + } + else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { + // Panic(uint256) + try { + const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); + revert = { + signature: "Panic(uint256)", + name: "Panic", + args: [code], + }; + reason = `Panic due to ${PanicReasons$1.get(code) || "UNKNOWN"}(${code})`; + message += `: ${reason}`; + } + catch (error) { + message += " (could not decode panic code)"; + } + } + else { + message += " (unknown custom error)"; + } + } + const transaction = { + to: tx.to ? getAddress(tx.to) : null, + data: tx.data || "0x", + }; + if (tx.from) { + transaction.from = getAddress(tx.from); + } + return makeError(message, "CALL_EXCEPTION", { + action, + data, + reason, + transaction, + invocation, + revert, + }); + } + /** + * About AbiCoder + */ + class AbiCoder { + #getCoder(param) { + if (param.isArray()) { + return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); + } + if (param.isTuple()) { + return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); + } + switch (param.baseType) { + case "address": + return new AddressCoder(param.name); + case "bool": + return new BooleanCoder(param.name); + case "string": + return new StringCoder(param.name); + case "bytes": + return new BytesCoder(param.name); + case "": + return new NullCoder(param.name); + } + // u?int[0-9]* + let match = param.type.match(paramTypeNumber); + if (match) { + let size = parseInt(match[2] || "256"); + assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param); + return new NumberCoder(size / 8, match[1] === "int", param.name); + } + // bytes[0-9]+ + match = param.type.match(paramTypeBytes); + if (match) { + let size = parseInt(match[1]); + assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); + return new FixedBytesCoder(size, param.name); + } + assertArgument(false, "invalid type", "type", param.type); + } + /** + * Get the default values for the given %%types%%. + * + * For example, a ``uint`` is by default ``0`` and ``bool`` + * is by default ``false``. + */ + getDefaultValue(types) { + const coders = types.map((type) => this.#getCoder(ParamType.from(type))); + const coder = new TupleCoder(coders, "_"); + return coder.defaultValue(); + } + /** + * Encode the %%values%% as the %%types%% into ABI data. + * + * @returns DataHexstring + */ + encode(types, values) { + assertArgumentCount(values.length, types.length, "types/values length mismatch"); + const coders = types.map((type) => this.#getCoder(ParamType.from(type))); + const coder = new TupleCoder(coders, "_"); + const writer = new Writer(); + coder.encode(writer, values); + return writer.data; + } + /** + * Decode the ABI %%data%% as the %%types%% into values. + * + * If %%loose%% decoding is enabled, then strict padding is + * not enforced. Some older versions of Solidity incorrectly + * padded event data emitted from ``external`` functions. + */ + decode(types, data, loose) { + const coders = types.map((type) => this.#getCoder(ParamType.from(type))); + const coder = new TupleCoder(coders, "_"); + return coder.decode(new Reader(data, loose)); + } + /** + * Returns the shared singleton instance of a default [[AbiCoder]]. + * + * On the first call, the instance is created internally. + */ + static defaultAbiCoder() { + if (defaultCoder == null) { + defaultCoder = new AbiCoder(); + } + return defaultCoder; + } + /** + * Returns an corebc-compatible [[CallExceptionError]] Error for the given + * result %%data%% for the [[CallExceptionAction]] %%action%% against + * the Transaction %%tx%%. + */ + static getBuiltinCallException(action, tx, data) { + return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); + } + } + + /** + * About bytes32 strings... + * + * @_docloc: api/utils:Bytes32 Strings + */ + /** + * Encodes %%text%% as a Bytes32 string. + */ + function encodeBytes32String(text) { + // Get the bytes + const bytes = toUtf8Bytes(text); + // Check we have room for null-termination + if (bytes.length > 31) { + throw new Error("bytes32 string must be less than 32 bytes"); + } + // Zero-pad (implicitly null-terminates) + return zeroPadBytes(bytes, 32); + } + /** + * Encodes the Bytes32-encoded %%bytes%% into a string. + */ + function decodeBytes32String(_bytes) { + const data = getBytes(_bytes, "bytes"); + // Must be 32 bytes with a null-termination + if (data.length !== 32) { + throw new Error("invalid bytes32 - not 32 bytes long"); + } + if (data[31] !== 0) { + throw new Error("invalid bytes32 string - no null terminator"); + } + // Find the null termination + let length = 31; + while (data[length - 1] === 0) { + length--; + } + // Determine the string value + return toUtf8String(data.slice(0, length)); + } + + /** + * About Interface + * + * @_subsection api/abi:Interfaces [interfaces] + */ + class LogDescription { + fragment; + name; + signature; + topic; + args; + constructor(fragment, topic, args) { + const name = fragment.name, signature = fragment.format(); + defineProperties(this, { + fragment, + name, + signature, + topic, + args, + }); + } + } + class TransactionDescription { + fragment; + name; + args; + signature; + selector; + value; + constructor(fragment, selector, args, value) { + const name = fragment.name, signature = fragment.format(); + defineProperties(this, { + fragment, + name, + args, + signature, + selector, + value, + }); + } + } + class ErrorDescription { + fragment; + name; + args; + signature; + selector; + constructor(fragment, selector, args) { + const name = fragment.name, signature = fragment.format(); + defineProperties(this, { + fragment, + name, + args, + signature, + selector, + }); + } + } + class Indexed { + hash; + _isIndexed; + static isIndexed(value) { + return !!(value && value._isIndexed); + } + constructor(hash) { + defineProperties(this, { hash, _isIndexed: true }); + } + } + // https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require + const PanicReasons = { + "0": "generic panic", + "1": "assert(false)", + "17": "arithmetic overflow", + "18": "division or modulo by zero", + "33": "enum overflow", + "34": "invalid encoded storage byte array accessed", + "49": "out-of-bounds array access; popping on an empty array", + "50": "out-of-bounds access of an array or bytesN", + "65": "out of memory", + "81": "uninitialized function", + }; + const BuiltinErrors = { + "0x08c379a0": { + signature: "Error(string)", + name: "Error", + inputs: ["string"], + reason: (message) => { + return `reverted with reason string ${JSON.stringify(message)}`; + }, + }, + "0x4e487b71": { + signature: "Panic(uint256)", + name: "Panic", + inputs: ["uint256"], + reason: (code) => { + let reason = "unknown panic code"; + if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { + reason = PanicReasons[code.toString()]; + } + return `reverted with panic code 0x${code.toString(16)} (${reason})`; + }, + }, + }; + /** + * An Interface abstracts many of the low-level details for + * encoding and decoding the data on the blockchain. + * + * An ABI provides information on how to encode data to send to + * a Contract, how to decode the results and events and how to + * interpret revert errors. + * + * The ABI can be specified by [any supported format](InterfaceAbi). + */ + class Interface { + /** + * All the Contract ABI members (i.e. methods, events, errors, etc). + */ + fragments; + /** + * The Contract constructor. + */ + deploy; + /** + * The Fallback method, if any. + */ + fallback; + /** + * If receiving xcb is supported. + */ + receive; + #errors; + #events; + #functions; + // #structs: Map; + #abiCoder; + /** + * Create a new Interface for the %%fragments%%. + */ + constructor(fragments) { + let abi = []; + if (typeof fragments === "string") { + abi = JSON.parse(fragments); + } + else { + abi = fragments; + } + this.#functions = new Map(); + this.#errors = new Map(); + this.#events = new Map(); + // this.#structs = new Map(); + const frags = []; + for (const a of abi) { + try { + frags.push(Fragment.from(a)); + } + catch (error) { + console.log("EE", error); + } + } + defineProperties(this, { + fragments: Object.freeze(frags), + }); + let fallback = null; + let receive = false; + this.#abiCoder = this.getAbiCoder(); + // Add all fragments by their signature + this.fragments.forEach((fragment, index) => { + let bucket; + switch (fragment.type) { + case "constructor": + if (this.deploy) { + console.log("duplicate definition - constructor"); + return; + } + //checkNames(fragment, "input", fragment.inputs); + defineProperties(this, { + deploy: fragment, + }); + return; + case "fallback": + if (fragment.inputs.length === 0) { + receive = true; + } + else { + assertArgument(!fallback || + fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); + fallback = fragment; + receive = fallback.payable; + } + return; + case "function": + //checkNames(fragment, "input", fragment.inputs); + //checkNames(fragment, "output", (fragment).outputs); + bucket = this.#functions; + break; + case "event": + //checkNames(fragment, "input", fragment.inputs); + bucket = this.#events; + break; + case "error": + bucket = this.#errors; + break; + default: + return; + } + // Two identical entries; ignore it + const signature = fragment.format(); + if (bucket.has(signature)) { + return; + } + bucket.set(signature, fragment); + }); + // If we do not have a constructor add a default + if (!this.deploy) { + defineProperties(this, { + deploy: ConstructorFragment.from("constructor()"), + }); + } + defineProperties(this, { fallback, receive }); + } + /** + * Returns the entire Human-Readable ABI, as an array of + * signatures, optionally as %%minimal%% strings, which + * removes parameter names and unneceesary spaces. + */ + format(minimal) { + const format = minimal ? "minimal" : "full"; + const abi = this.fragments.map((f) => f.format(format)); + return abi; + } + /** + * Return the JSON-encoded ABI. This is the format Solidiy + * returns. + */ + formatJson() { + const abi = this.fragments.map((f) => f.format("json")); + // We need to re-bundle the JSON fragments a bit + return JSON.stringify(abi.map((j) => JSON.parse(j))); + } + /** + * The ABI coder that will be used to encode and decode binary + * data. + */ + getAbiCoder() { + return AbiCoder.defaultAbiCoder(); + } + // Find a function definition by any means necessary (unless it is ambiguous) + #getFunction(key, values, forceUnique) { + // Selector + if (isHexString(key)) { + const selector = key.toLowerCase(); + for (const fragment of this.#functions.values()) { + if (selector === fragment.selector) { + return fragment; + } + } + return null; + } + // It is a bare name, look up the function (will return null if ambiguous) + if (key.indexOf("(") === -1) { + const matching = []; + for (const [name, fragment] of this.#functions) { + if (name.split("(" /* fix:) */)[0] === key) { + matching.push(fragment); + } + } + if (values) { + const lastValue = values.length > 0 ? values[values.length - 1] : null; + let valueLength = values.length; + let allowOptions = true; + if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { + allowOptions = false; + valueLength--; + } + // Remove all matches that don't have a compatible length. The args + // may contain an overrides, so the match may have n or n - 1 parameters + for (let i = matching.length - 1; i >= 0; i--) { + const inputs = matching[i].inputs.length; + if (inputs !== valueLength && + (!allowOptions || inputs !== valueLength - 1)) { + matching.splice(i, 1); + } + } + // Remove all matches that don't match the Typed signature + for (let i = matching.length - 1; i >= 0; i--) { + const inputs = matching[i].inputs; + for (let j = 0; j < values.length; j++) { + // Not a typed value + if (!Typed.isTyped(values[j])) { + continue; + } + // We are past the inputs + if (j >= inputs.length) { + if (values[j].type === "overrides") { + continue; + } + matching.splice(i, 1); + break; + } + // Make sure the value type matches the input type + if (values[j].type !== inputs[j].baseType) { + matching.splice(i, 1); + break; + } + } + } + } + // We found a single matching signature with an overrides, but the + // last value is something that cannot possibly be an options + if (matching.length === 1 && + values && + values.length !== matching[0].inputs.length) { + const lastArg = values[values.length - 1]; + if (lastArg == null || + Array.isArray(lastArg) || + typeof lastArg !== "object") { + matching.splice(0, 1); + } + } + if (matching.length === 0) { + return null; + } + if (matching.length > 1 && forceUnique) { + const matchStr = matching + .map((m) => JSON.stringify(m.format())) + .join(", "); + assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); + } + return matching[0]; + } + // Normalize the signature and lookup the function + const result = this.#functions.get(FunctionFragment.from(key).format()); + if (result) { + return result; + } + return null; + } + /** + * Get the function name for %%key%%, which may be a function selector, + * function name or function signature that belongs to the ABI. + */ + getFunctionName(key) { + const fragment = this.#getFunction(key, null, false); + assertArgument(fragment, "no matching function", "key", key); + return fragment.name; + } + /** + * Returns true if %%key%% (a function selector, function name or + * function signature) is present in the ABI. + * + * In the case of a function name, the name may be ambiguous, so + * accessing the [[FunctionFragment]] may require refinement. + */ + hasFunction(key) { + return !!this.#getFunction(key, null, false); + } + /** + * Get the [[FunctionFragment]] for %%key%%, which may be a function + * selector, function name or function signature that belongs to the ABI. + * + * If %%values%% is provided, it will use the Typed API to handle + * ambiguous cases where multiple functions match by name. + * + * If the %%key%% and %%values%% do not refine to a single function in + * the ABI, this will throw. + */ + getFunction(key, values) { + return this.#getFunction(key, values || null, true); + } + /** + * Iterate over all functions, calling %%callback%%, sorted by their name. + */ + forEachFunction(callback) { + const names = Array.from(this.#functions.keys()); + names.sort((a, b) => a.localeCompare(b)); + for (let i = 0; i < names.length; i++) { + const name = names[i]; + callback(this.#functions.get(name), i); + } + } + // Find an event definition by any means necessary (unless it is ambiguous) + #getEvent(key, values, forceUnique) { + // EventTopic + if (isHexString(key)) { + const eventTopic = key.toLowerCase(); + for (const fragment of this.#events.values()) { + if (eventTopic === fragment.topicHash) { + return fragment; + } + } + return null; + } + // It is a bare name, look up the function (will return null if ambiguous) + if (key.indexOf("(") === -1) { + const matching = []; + for (const [name, fragment] of this.#events) { + if (name.split("(" /* fix:) */)[0] === key) { + matching.push(fragment); + } + } + if (values) { + // Remove all matches that don't have a compatible length. + for (let i = matching.length - 1; i >= 0; i--) { + if (matching[i].inputs.length < values.length) { + matching.splice(i, 1); + } + } + // Remove all matches that don't match the Typed signature + for (let i = matching.length - 1; i >= 0; i--) { + const inputs = matching[i].inputs; + for (let j = 0; j < values.length; j++) { + // Not a typed value + if (!Typed.isTyped(values[j])) { + continue; + } + // Make sure the value type matches the input type + if (values[j].type !== inputs[j].baseType) { + matching.splice(i, 1); + break; + } + } + } + } + if (matching.length === 0) { + return null; + } + if (matching.length > 1 && forceUnique) { + const matchStr = matching + .map((m) => JSON.stringify(m.format())) + .join(", "); + assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); + } + return matching[0]; + } + // Normalize the signature and lookup the function + const result = this.#events.get(EventFragment.from(key).format()); + if (result) { + return result; + } + return null; + } + /** + * Get the event name for %%key%%, which may be a topic hash, + * event name or event signature that belongs to the ABI. + */ + getEventName(key) { + const fragment = this.#getEvent(key, null, false); + assertArgument(fragment, "no matching event", "key", key); + return fragment.name; + } + /** + * Returns true if %%key%% (an event topic hash, event name or + * event signature) is present in the ABI. + * + * In the case of an event name, the name may be ambiguous, so + * accessing the [[EventFragment]] may require refinement. + */ + hasEvent(key) { + return !!this.#getEvent(key, null, false); + } + /** + * Get the [[EventFragment]] for %%key%%, which may be a topic hash, + * event name or event signature that belongs to the ABI. + * + * If %%values%% is provided, it will use the Typed API to handle + * ambiguous cases where multiple events match by name. + * + * If the %%key%% and %%values%% do not refine to a single event in + * the ABI, this will throw. + */ + getEvent(key, values) { + return this.#getEvent(key, values || null, true); + } + /** + * Iterate over all events, calling %%callback%%, sorted by their name. + */ + forEachEvent(callback) { + const names = Array.from(this.#events.keys()); + names.sort((a, b) => a.localeCompare(b)); + for (let i = 0; i < names.length; i++) { + const name = names[i]; + callback(this.#events.get(name), i); + } + } + /** + * Get the [[ErrorFragment]] for %%key%%, which may be an error + * selector, error name or error signature that belongs to the ABI. + * + * If %%values%% is provided, it will use the Typed API to handle + * ambiguous cases where multiple errors match by name. + * + * If the %%key%% and %%values%% do not refine to a single error in + * the ABI, this will throw. + */ + getError(key, values) { + if (isHexString(key)) { + const selector = key.toLowerCase(); + if (BuiltinErrors[selector]) { + return ErrorFragment.from(BuiltinErrors[selector].signature); + } + for (const fragment of this.#errors.values()) { + if (selector === fragment.selector) { + return fragment; + } + } + return null; + } + // It is a bare name, look up the function (will return null if ambiguous) + if (key.indexOf("(") === -1) { + const matching = []; + for (const [name, fragment] of this.#errors) { + if (name.split("(" /* fix:) */)[0] === key) { + matching.push(fragment); + } + } + if (matching.length === 0) { + if (key === "Error") { + return ErrorFragment.from("error Error(string)"); + } + if (key === "Panic") { + return ErrorFragment.from("error Panic(uint256)"); + } + return null; + } + else if (matching.length > 1) { + const matchStr = matching + .map((m) => JSON.stringify(m.format())) + .join(", "); + assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); + } + return matching[0]; + } + // Normalize the signature and lookup the function + key = ErrorFragment.from(key).format(); + if (key === "Error(string)") { + return ErrorFragment.from("error Error(string)"); + } + if (key === "Panic(uint256)") { + return ErrorFragment.from("error Panic(uint256)"); + } + const result = this.#errors.get(key); + if (result) { + return result; + } + return null; + } + /** + * Iterate over all errors, calling %%callback%%, sorted by their name. + */ + forEachError(callback) { + const names = Array.from(this.#errors.keys()); + names.sort((a, b) => a.localeCompare(b)); + for (let i = 0; i < names.length; i++) { + const name = names[i]; + callback(this.#errors.get(name), i); + } + } + // Get the 4-byte selector used by Solidity to identify a function + /* + getSelector(fragment: ErrorFragment | FunctionFragment): string { + if (typeof(fragment) === "string") { + const matches: Array = [ ]; + + try { matches.push(this.getFunction(fragment)); } catch (error) { } + try { matches.push(this.getError(fragment)); } catch (_) { } + + if (matches.length === 0) { + logger.throwArgumentError("unknown fragment", "key", fragment); + } else if (matches.length > 1) { + logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); + } + + fragment = matches[0]; + } + + return dataSlice(id(fragment.format()), 0, 4); + } + */ + // Get the 32-byte topic hash used by Solidity to identify an event + /* + getEventTopic(fragment: EventFragment): string { + //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } + return id(fragment.format()); + } + */ + _decodeParams(params, data) { + return this.#abiCoder.decode(params, data); + } + _encodeParams(params, values) { + return this.#abiCoder.encode(params, values); + } + /** + * Encodes a ``tx.data`` object for deploying the Contract with + * the %%values%% as the constructor arguments. + */ + encodeDeploy(values) { + return this._encodeParams(this.deploy.inputs, values || []); + } + /** + * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the + * specified error (see [[getError]] for valid values for + * %%key%%). + * + * Most developers should prefer the [[parseCallResult]] method instead, + * which will automatically detect a ``CALL_EXCEPTION`` and throw the + * corresponding error. + */ + decodeErrorResult(fragment, data) { + if (typeof fragment === "string") { + const f = this.getError(fragment); + assertArgument(f, "unknown error", "fragment", fragment); + fragment = f; + } + assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); + return this._decodeParams(fragment.inputs, dataSlice(data, 4)); + } + /** + * Encodes the transaction revert data for a call result that + * reverted from the the Contract with the sepcified %%error%% + * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. + * + * This is generally not used by most developers, unless trying to mock + * a result from a Contract. + */ + encodeErrorResult(fragment, values) { + if (typeof fragment === "string") { + const f = this.getError(fragment); + assertArgument(f, "unknown error", "fragment", fragment); + fragment = f; + } + return concat([ + fragment.selector, + this._encodeParams(fragment.inputs, values || []), + ]); + } + /** + * Decodes the %%data%% from a transaction ``tx.data`` for + * the function specified (see [[getFunction]] for valid values + * for %%fragment%%). + * + * Most developers should prefer the [[parseTransaction]] method + * instead, which will automatically detect the fragment. + */ + decodeFunctionData(fragment, data) { + if (typeof fragment === "string") { + const f = this.getFunction(fragment); + assertArgument(f, "unknown function", "fragment", fragment); + fragment = f; + } + assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); + return this._decodeParams(fragment.inputs, dataSlice(data, 4)); + } + /** + * Encodes the ``tx.data`` for a transaction that calls the function + * specified (see [[getFunction]] for valid values for %%fragment%%) with + * the %%values%%. + */ + encodeFunctionData(fragment, values) { + if (typeof fragment === "string") { + const f = this.getFunction(fragment); + assertArgument(f, "unknown function", "fragment", fragment); + fragment = f; + } + return concat([ + fragment.selector, + this._encodeParams(fragment.inputs, values || []), + ]); + } + /** + * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the + * specified function (see [[getFunction]] for valid values for + * %%key%%). + * + * Most developers should prefer the [[parseCallResult]] method instead, + * which will automatically detect a ``CALL_EXCEPTION`` and throw the + * corresponding error. + */ + decodeFunctionResult(fragment, data) { + if (typeof fragment === "string") { + const f = this.getFunction(fragment); + assertArgument(f, "unknown function", "fragment", fragment); + fragment = f; + } + let message = "invalid length for result data"; + const bytes = getBytesCopy(data); + if (bytes.length % 32 === 0) { + try { + return this.#abiCoder.decode(fragment.outputs, bytes); + } + catch (error) { + message = "could not decode result data"; + } + } + // Call returned data with no error, but the data is junk + assert(false, message, "BAD_DATA", { + value: hexlify(bytes), + info: { method: fragment.name, signature: fragment.format() }, + }); + } + makeError(_data, tx) { + const data = getBytes(_data, "data"); + const error = AbiCoder.getBuiltinCallException("call", tx, data); + // Not a built-in error; try finding a custom error + const customPrefix = "execution reverted (unknown custom error)"; + if (error.message.startsWith(customPrefix)) { + const selector = hexlify(data.slice(0, 4)); + const ef = this.getError(selector); + if (ef) { + try { + const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); + error.revert = { + name: ef.name, + signature: ef.format(), + args, + }; + error.reason = error.revert.signature; + error.message = `execution reverted: ${error.reason}`; + } + catch (e) { + error.message = `execution reverted (coult not decode custom error)`; + } + } + } + // Add the invocation, if available + const parsed = this.parseTransaction(tx); + if (parsed) { + error.invocation = { + method: parsed.name, + signature: parsed.signature, + args: parsed.args, + }; + } + return error; + } + /** + * Encodes the result data (e.g. from an ``xcb_call``) for the + * specified function (see [[getFunction]] for valid values + * for %%fragment%%) with %%values%%. + * + * This is generally not used by most developers, unless trying to mock + * a result from a Contract. + */ + encodeFunctionResult(fragment, values) { + if (typeof fragment === "string") { + const f = this.getFunction(fragment); + assertArgument(f, "unknown function", "fragment", fragment); + fragment = f; + } + return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); + } + /* + spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { + const promises: Array> = [ ]; + const process = function(type: ParamType, value: any): any { + if (type.baseType === "array") { + return descend(type.child + } + if (type. === "address") { + } + }; + + const descend = function (inputs: Array, values: ReadonlyArray) { + if (inputs.length !== values.length) { throw new Error("length mismatch"); } + }; + + const result: Array = [ ]; + values.forEach((value, index) => { + if (value == null) { + topics.push(null); + } else if (param.baseType === "array" || param.baseType === "tuple") { + logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); + } else if (Array.isArray(value)) { + topics.push(value.map((value) => encodeTopic(param, value))); + } else { + topics.push(encodeTopic(param, value)); + } + }); + } + */ + // Create the filter for the event with search criteria (e.g. for xcb_filterLog) + encodeFilterTopics(fragment, values) { + if (typeof fragment === "string") { + const f = this.getEvent(fragment); + assertArgument(f, "unknown event", "eventFragment", fragment); + fragment = f; + } + assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); + const topics = []; + if (!fragment.anonymous) { + topics.push(fragment.topicHash); + } + // @TODO: Use the coders for this; to properly support tuples, etc. + const encodeTopic = (param, value) => { + if (param.type === "string") { + return id(value); + } + else if (param.type === "bytes") { + return sha256(hexlify(value)); + } + if (param.type === "bool" && typeof value === "boolean") { + value = value ? "0x01" : "0x00"; + } + if (param.type.match(/^u?int/)) { + value = toBeHex(value); + } + // Check addresses are valid + if (param.type === "address") { + this.#abiCoder.encode(["address"], [value]); + } + return zeroPadValue(hexlify(value), 32); + //@TOOD should probably be return toHex(value, 32) + }; + values.forEach((value, index) => { + const param = fragment.inputs[index]; + if (!param.indexed) { + assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); + return; + } + if (value == null) { + topics.push(null); + } + else if (param.baseType === "array" || param.baseType === "tuple") { + assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); + } + else if (Array.isArray(value)) { + topics.push(value.map((value) => encodeTopic(param, value))); + } + else { + topics.push(encodeTopic(param, value)); + } + }); + // Trim off trailing nulls + while (topics.length && topics[topics.length - 1] === null) { + topics.pop(); + } + return topics; + } + encodeEventLog(fragment, values) { + if (typeof fragment === "string") { + const f = this.getEvent(fragment); + assertArgument(f, "unknown event", "eventFragment", fragment); + fragment = f; + } + const topics = []; + const dataTypes = []; + const dataValues = []; + if (!fragment.anonymous) { + topics.push(fragment.topicHash); + } + assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); + fragment.inputs.forEach((param, index) => { + const value = values[index]; + if (param.indexed) { + if (param.type === "string") { + topics.push(id(value)); + } + else if (param.type === "bytes") { + topics.push(sha256(value)); + } + else if (param.baseType === "tuple" || param.baseType === "array") { + // @TODO + throw new Error("not implemented"); + } + else { + topics.push(this.#abiCoder.encode([param.type], [value])); + } + } + else { + dataTypes.push(param); + dataValues.push(value); + } + }); + return { + data: this.#abiCoder.encode(dataTypes, dataValues), + topics: topics, + }; + } + // Decode a filter for the event and the search criteria + decodeEventLog(fragment, data, topics) { + if (typeof fragment === "string") { + const f = this.getEvent(fragment); + assertArgument(f, "unknown event", "eventFragment", fragment); + fragment = f; + } + if (topics != null && !fragment.anonymous) { + const eventTopic = fragment.topicHash; + assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); + topics = topics.slice(1); + } + const indexed = []; + const nonIndexed = []; + const dynamic = []; + fragment.inputs.forEach((param, index) => { + if (param.indexed) { + if (param.type === "string" || + param.type === "bytes" || + param.baseType === "tuple" || + param.baseType === "array") { + indexed.push(ParamType.from({ type: "bytes32", name: param.name })); + dynamic.push(true); + } + else { + indexed.push(param); + dynamic.push(false); + } + } + else { + nonIndexed.push(param); + dynamic.push(false); + } + }); + const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null; + const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); + //const result: (Array & { [ key: string ]: any }) = [ ]; + const values = []; + const keys = []; + let nonIndexedIndex = 0, indexedIndex = 0; + fragment.inputs.forEach((param, index) => { + let value = null; + if (param.indexed) { + if (resultIndexed == null) { + value = new Indexed(null); + } + else if (dynamic[index]) { + value = new Indexed(resultIndexed[indexedIndex++]); + } + else { + try { + value = resultIndexed[indexedIndex++]; + } + catch (error) { + value = error; + } + } + } + else { + try { + value = resultNonIndexed[nonIndexedIndex++]; + } + catch (error) { + value = error; + } + } + values.push(value); + keys.push(param.name || null); + }); + return Result.fromItems(values, keys); + } + /** + * Parses a transaction, finding the matching function and extracts + * the parameter values along with other useful function details. + * + * If the matching function cannot be found, return null. + */ + parseTransaction(tx) { + const data = getBytes(tx.data, "tx.data"); + const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); + const fragment = this.getFunction(hexlify(data.slice(0, 4))); + if (!fragment) { + return null; + } + const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); + return new TransactionDescription(fragment, fragment.selector, args, value); + } + parseCallResult(data) { + throw new Error("@TODO"); + } + /** + * Parses a receipt log, finding the matching event and extracts + * the parameter values along with other useful event details. + * + * If the matching event cannot be found, returns null. + */ + parseLog(log) { + const fragment = this.getEvent(log.topics[0]); + if (!fragment || fragment.anonymous) { + return null; + } + // @TODO: If anonymous, and the only method, and the input count matches, should we parse? + // Probably not, because just because it is the only event in the ABI does + // not mean we have the full ABI; maybe just a fragment? + return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); + } + /** + * Parses a revert data, finding the matching error and extracts + * the parameter values along with other useful error details. + * + * If the matching event cannot be found, returns null. + */ + parseError(data) { + const hexData = hexlify(data); + const fragment = this.getError(dataSlice(hexData, 0, 4)); + if (!fragment) { + return null; + } + const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); + return new ErrorDescription(fragment, fragment.selector, args); + } + /** + * Creates a new [[Interface]] from the ABI %%value%%. + * + * The %%value%% may be provided as an existing [[Interface]] object, + * a JSON-encoded ABI or any Human-Readable ABI format. + */ + static from(value) { + // Already an Interface, which is immutable + if (value instanceof Interface) { + return value; + } + // JSON + if (typeof value === "string") { + return new Interface(JSON.parse(value)); + } + // Maybe an interface from an older version, or from a symlinked copy + if (typeof value.format === "function") { + return new Interface(value.format("json")); + } + // Array of fragments + return new Interface(value); + } + } + + const logger = new Logger("contract-address/0.0.1"); + /** + * Returns the address that would result from a ``CREATE`` for %%tx%%. + * + * This can be used to compute the address a contract will be + * deployed to by an EOA when sending a deployment transaction (i.e. + * when the ``to`` address is ``null``). + * + * This can also be used to compute the address a contract will be + * deployed to by a contract, by using the contract's address as the + * ``to`` and the contract's nonce. + * + * @example + * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; + * nonce = 5; + * + * getCreateAddress({ from, nonce }); + * //_result: + */ + function getCreateAddress(tx) { + const from = getAddress(tx.from); + const nonce = getBigInt(tx.nonce, "tx.nonce"); + let nonceHex = nonce.toString(16); + if (nonceHex === "0") { + nonceHex = "0x"; + } + else if (nonceHex.length % 2) { + nonceHex = "0x0" + nonceHex; + } + else { + nonceHex = "0x" + nonceHex; + } + return getAddress(from); + } + /** + * Returns the address that would result from a ``CREATE2`` operation + * with the given %%from%%, %%salt%% and %%initCodeHash%%. + + * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. + * + * @example + * // The address of the contract + * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" + * + * // The salt + * salt = id("HelloWorld") + * + * getCreate2Address(from, salt, initCodeHash) + * //_result: + */ + function getCreate2Address(from, salt, initCodeHash) { + if (hexDataLength(salt) !== 32) { + logger.throwArgumentError("salt must be 32 bytes", "salt", salt); + } + if (hexDataLength(initCodeHash) !== 32) { + logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash); + } + const val = hexDataSlice(sha256(concat(["0xff", getAddress(from), salt, initCodeHash])), 12); + console.log({ "contract-address/74=>should be string": val }); + const prefix = from.substring(2, 4); + const checksum = calculateCheckSum(val, prefix); + return "0x" + prefix + checksum + removeHexPrefix(val); + } + + /** + * Returns true if %%value%% is an object which implements the + * [[Addressable]] interface. + * + * @example: + * // Wallets and AbstractSigner sub-classes + * isAddressable(Wallet.createRandom()) + * //_result: + * + * // Contracts + * contract = new Contract("dai.tokens.corebc.eth", [ ], provider) + * isAddressable(contract) + * //_result: + */ + function isAddressable(value) { + return value && typeof value.getAddress === "function"; + } + /** + * Returns true if %%value%% is a valid address. + * + * @example: + * // Valid address + * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") + * //_result: + * + * // Valid ICAP address + * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") + * //_result: + * + * // Invalid checksum + * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") + * //_result: + * + * // Invalid ICAP checksum + * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") + * //_result: + * + * // Not an address (an ENS name requires a provided and an + * // asynchronous API to access) + * isAddress("ricmoo.eth") + * //_result: + */ + function isAddress(value) { + try { + getAddress(value); + return true; + } + catch (error) { } + return false; + } + async function checkAddress(target, promise) { + const result = await promise; + if (result == null || + result === "0x0000000000000000000000000000000000000000") { + assert(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); + assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); + } + return getAddress(result); + } + /** + * Resolves to an address for the %%target%%, which may be any + * supported address type, an [[Addressable]] or a Promise which + * resolves to an address. + * + * If an ENS name is provided, but that name has not been correctly + * configured a [[UnconfiguredNameError]] is thrown. + * + * @example: + * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" + * + * // Addresses are return synchronously + * resolveAddress(addr, provider) + * //_result: + * + * // Address promises are resolved asynchronously + * resolveAddress(Promise.resolve(addr)) + * //_result: + * + * + * // Addressable objects are resolved asynchronously + * contract = new Contract(addr, [ ]) + * resolveAddress(contract, provider) + * //_result: + * + * // Unconfigured ENS names reject + * resolveAddress("nothing-here.ricmoo.eth", provider) + * //_error: + * + * // ENS names require a NameResolver object passed in + * // (notice the provider was omitted) + * resolveAddress("nothing-here.ricmoo.eth") + * //_error: + */ + function resolveAddress(target) { + if (typeof target === "string") { + return getAddress(target); + // assert(resolver != null, "ENS resolution requires a provider", + // "UNSUPPORTED_OPERATION", { operation: "resolveName" }); + // return checkAddress(target, resolver.resolveName(target)); + } + else if (isAddressable(target)) { + return checkAddress(target, target.getAddress()); + } + else if (target && typeof target.then === "function") { + return checkAddress(target, target); + } + assertArgument(false, "unsupported addressable value", "target", target); + } + + const BN_0$2 = BigInt(0); + // ----------------------- + function getValue(value) { + if (value == null) { + return null; + } + return value; + } + function toJson(value) { + if (value == null) { + return null; + } + return value.toString(); + } + // @TODO? implements Required + /** + * A **FeeData** wraps all the fee-related values associated with + * the network. + */ + class FeeData { + /** + * The energy price for legacy networks. + */ + energyPrice; + constructor(energyPrice) { + defineProperties(this, { + energyPrice: getValue(energyPrice), + }); + } + /** + * Returns a JSON-friendly value. + */ + toJSON() { + const { energyPrice } = this; + return { + _type: "FeeData", + energyPrice: toJson(energyPrice), + }; + } + } + function copyRequest(req) { + const result = {}; + // These could be addresses, ENS names or Addressables + if (req.to) { + result.to = req.to; + } + if (req.from) { + result.from = req.from; + } + if (req.data) { + result.data = hexlify(req.data); + } + const bigIntKeys = "networkId,energyLimit,energyPrice,value".split(/,/); + for (const key of bigIntKeys) { + if (!(key in req) || req[key] == null) { + continue; + } + result[key] = getBigInt(req[key], `request.${key}`); + } + const numberKeys = "type,nonce".split(/,/); + for (const key of numberKeys) { + if (!(key in req) || req[key] == null) { + continue; + } + result[key] = getNumber(req[key], `request.${key}`); + } + if ("blockTag" in req) { + result.blockTag = req.blockTag; + } + if ("enableCcipRead" in req) { + result.enableCcipReadEnabled = !!req.enableCcipRead; + } + if ("customData" in req) { + result.customData = req.customData; + } + return result; + } + /** + * A **Block** represents the data associated with a full block on + * Core. + */ + class Block { + /** + * The provider connected to the block used to fetch additional details + * if necessary. + */ + provider; + /** + * The block number, sometimes called the block height. This is a + * sequential number that is one higher than the parent block. + */ + number; + /** + * The block hash. + */ + hash; + /** + * The timestamp for this block, which is the number of seconds since + * epoch that this block was included. + */ + timestamp; + /** + * The block hash of the parent block. + */ + parentHash; + /** + * The nonce. + * + * On legacy networks, this is the random number inserted which + * permitted the difficulty target to be reached. + */ + nonce; + /** + * The difficulty target. + * + * On legacy networks, this is the proof-of-work target required + * for a block to meet the protocol rules to be included. + * + * On modern networks, this is a random number arrived at using + * randao. @TODO: Find links? + */ + difficulty; + /** + * The total energy limit for this block. + */ + energyLimit; + /** + * The total energy used in this block. + */ + energyUsed; + /** + * The miner coinbase address, wihch receives any subsidies for + * including this block. + */ + miner; + /** + * Any extra data the validator wished to include. + */ + extraData; + /** + * The base fee per energy that all transactions in this block were + * charged. + * + * This adjusts after each block, depending on how congested the network + * is. + */ + baseFeePerEnergy; + #transactions; + /** + * Create a new **Block** object. + * + * This should generally not be necessary as the unless implementing a + * low-level library. + */ + constructor(block, provider) { + this.#transactions = block.transactions.map((tx) => { + if (typeof tx !== "string") { + return new TransactionResponse(tx, provider); + } + return tx; + }); + defineProperties(this, { + provider, + hash: getValue(block.hash), + number: block.number, + timestamp: block.timestamp, + parentHash: block.parentHash, + nonce: block.nonce, + difficulty: block.difficulty, + energyLimit: block.energyLimit, + energyUsed: block.energyUsed, + miner: block.miner, + extraData: block.extraData, + baseFeePerEnergy: getValue(block.baseFeePerEnergy), + }); + } + /** + * Returns the list of transaction hashes. + */ + get transactions() { + return this.#transactions.map((tx) => { + if (typeof tx === "string") { + return tx; + } + return tx.hash; + }); + } + /** + * Returns the complete transactions for blocks which + * prefetched them, by passing ``true`` to %%prefetchTxs%% + * into [[provider_getBlock]]. + */ + get prefetchedTransactions() { + const txs = this.#transactions.slice(); + // Doesn't matter... + if (txs.length === 0) { + return []; + } + // Make sure we prefetched the transactions + assert(typeof txs[0] === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { + operation: "transactionResponses()", + }); + return txs; + } + /** + * Returns a JSON-friendly value. + */ + toJSON() { + const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this; + return { + _type: "Block", + baseFeePerEnergy: toJson(baseFeePerEnergy), + difficulty: toJson(difficulty), + extraData, + energyLimit: toJson(energyLimit), + energyUsed: toJson(energyUsed), + hash, + miner, + nonce, + number, + parentHash, + timestamp, + transactions, + }; + } + [Symbol.iterator]() { + let index = 0; + const txs = this.transactions; + return { + next: () => { + if (index < this.length) { + return { + value: txs[index++], + done: false, + }; + } + return { value: undefined, done: true }; + }, + }; + } + /** + * The number of transactions in this block. + */ + get length() { + return this.#transactions.length; + } + /** + * The [[link-js-date]] this block was included at. + */ + get date() { + if (this.timestamp == null) { + return null; + } + return new Date(this.timestamp * 1000); + } + /** + * Get the transaction at %%indexe%% within this block. + */ + async getTransaction(indexOrHash) { + // Find the internal value by its index or hash + let tx = undefined; + if (typeof indexOrHash === "number") { + tx = this.#transactions[indexOrHash]; + } + else { + const hash = indexOrHash.toLowerCase(); + for (const v of this.#transactions) { + if (typeof v === "string") { + if (v !== hash) { + continue; + } + tx = v; + break; + } + else { + if (v.hash === hash) { + continue; + } + tx = v; + break; + } + } + } + if (tx == null) { + throw new Error("no such tx"); + } + if (typeof tx === "string") { + return await this.provider.getTransaction(tx); + } + else { + return tx; + } + } + getPrefetchedTransaction(indexOrHash) { + const txs = this.prefetchedTransactions; + if (typeof indexOrHash === "number") { + return txs[indexOrHash]; + } + indexOrHash = indexOrHash.toLowerCase(); + for (const tx of txs) { + if (tx.hash === indexOrHash) { + return tx; + } + } + assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); + } + /** + * Has this block been mined. + * + * If true, the block has been typed-gaurded that all mined + * properties are non-null. + */ + isMined() { + return !!this.hash; + } + /** + * + */ + isLondon() { + return !!this.baseFeePerEnergy; + } + orphanedEvent() { + if (!this.isMined()) { + throw new Error(""); + } + return createOrphanedBlockFilter(this); + } + } + ////////////////////// + // Log + class Log { + provider; + transactionHash; + blockHash; + blockNumber; + removed; + address; + data; + topics; + index; + transactionIndex; + constructor(log, provider) { + this.provider = provider; + const topics = Object.freeze(log.topics.slice()); + defineProperties(this, { + transactionHash: log.transactionHash, + blockHash: log.blockHash, + blockNumber: log.blockNumber, + removed: log.removed, + address: log.address, + data: log.data, + topics, + index: log.index, + transactionIndex: log.transactionIndex, + }); + } + toJSON() { + const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this; + return { + _type: "log", + address, + blockHash, + blockNumber, + data, + index, + removed, + topics, + transactionHash, + transactionIndex, + }; + } + async getBlock() { + const block = await this.provider.getBlock(this.blockHash); + assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); + return block; + } + async getTransaction() { + const tx = await this.provider.getTransaction(this.transactionHash); + assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); + return tx; + } + async getTransactionReceipt() { + const receipt = await this.provider.getTransactionReceipt(this.transactionHash); + assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); + return receipt; + } + removedEvent() { + return createRemovedLogFilter(this); + } + } + ////////////////////// + // Transaction Receipt + /* + export interface LegacyTransactionReceipt { + byzantium: false; + status: null; + root: string; + } + + export interface ByzantiumTransactionReceipt { + byzantium: true; + status: number; + root: null; + } + */ + class TransactionReceipt { + provider; + to; + from; + contractAddress; + hash; + index; + blockHash; + blockNumber; + logsBloom; + energyUsed; + cumulativeEnergyUsed; + energyPrice; + type; + //readonly byzantium!: boolean; + status; + root; + #logs; + constructor(tx, provider) { + this.#logs = Object.freeze(tx.logs.map((log) => { + return new Log(log, provider); + })); + defineProperties(this, { + provider, + to: tx.to, + from: tx.from, + contractAddress: tx.contractAddress, + hash: tx.hash, + index: tx.index, + blockHash: tx.blockHash, + blockNumber: tx.blockNumber, + logsBloom: tx.logsBloom, + energyUsed: tx.energyUsed, + cumulativeEnergyUsed: tx.cumulativeEnergyUsed, + energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice), + //byzantium: tx.byzantium, + status: tx.status, + root: tx.root, + }); + } + get logs() { + return this.#logs; + } + toJSON() { + const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, + status, root, } = this; + return { + _type: "TransactionReceipt", + blockHash, + blockNumber, + //byzantium, + contractAddress, + cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed), + from, + energyPrice: toJson(this.energyPrice), + energyUsed: toJson(this.energyUsed), + hash, + index, + logs, + logsBloom, + root, + status, + to, + }; + } + get length() { + return this.logs.length; + } + [Symbol.iterator]() { + let index = 0; + return { + next: () => { + if (index < this.length) { + return { value: this.logs[index++], done: false }; + } + return { value: undefined, done: true }; + }, + }; + } + get fee() { + return this.energyUsed * this.energyPrice; + } + async getBlock() { + const block = await this.provider.getBlock(this.blockHash); + if (block == null) { + throw new Error("TODO"); + } + return block; + } + async getTransaction() { + const tx = await this.provider.getTransaction(this.hash); + if (tx == null) { + throw new Error("TODO"); + } + return tx; + } + async getResult() { + return await this.provider.getTransactionResult(this.hash); + } + async confirmations() { + return (await this.provider.getBlockNumber()) - this.blockNumber + 1; + } + removedEvent() { + return createRemovedTransactionFilter(this); + } + reorderedEvent(other) { + assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); + return createReorderedTransactionFilter(this, other); + } + } + /* + export type ReplacementDetectionSetup = { + to: string; + from: string; + value: bigint; + data: string; + nonce: number; + block: number; + }; + */ + class TransactionResponse { + /** + * The provider this is connected to, which will influence how its + * methods will resolve its async inspection methods. + */ + provider; + /** + * The block number of the block that this transaction was included in. + * + * This is ``null`` for pending transactions. + */ + blockNumber; + /** + * The blockHash of the block that this transaction was included in. + * + * This is ``null`` for pending transactions. + */ + blockHash; + /** + * The index within the block that this transaction resides at. + */ + index; + /** + * The transaction hash. + */ + hash; + /** + * The [[link-eip-2718]] transaction envelope type. This is + * ``0`` for legacy transactions types. + */ + type; + /** + * The receiver of this transaction. + * + * If ``null``, then the transaction is an initcode transaction. + * This means the result of executing the [[data]] will be deployed + * as a new contract on chain (assuming it does not revert) and the + * address may be computed using [[getCreateAddress]]. + */ + to; + /** + * The sender of this transaction. It is implicitly computed + * from the transaction pre-image hash (as the digest) and the + * [[signature]] using ecrecover. + */ + from; + /** + * The nonce, which is used to prevent replay attacks and offer + * a method to ensure transactions from a given sender are explicitly + * ordered. + * + * When sending a transaction, this must be equal to the number of + * transactions ever sent by [[from]]. + */ + nonce; + /** + * The maximum units of energy this transaction can consume. If execution + * exceeds this, the entries transaction is reverted and the sender + * is charged for the full amount, despite not state changes being made. + */ + energyLimit; + /** + * The energy price can have various values, depending on the network. + * + * In modern networks, for transactions that are included this is + * the //effective energy price// (the fee per energy that was actually + * charged), while for transactions that have not been included yet + * is the [[maxFeePerEnergy]]. + * + * For legacy transactions, or transactions on legacy networks, this + * is the fee that will be charged per unit of energy the transaction + * consumes. + */ + energyPrice; + /** + * The data. + */ + data; + /** + * The value, in ore. Use [[formatXCB]] to format this value + * as xcb. + */ + value; + /** + * The chain ID. + */ + networkId; + /** + * The signature. + */ + signature; + #startBlock; + /** + * Create a new TransactionResponse with %%tx%% parameters + * connected to %%provider%%. + */ + constructor(tx, provider) { + this.provider = provider; + this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null; + this.blockHash = tx.blockHash != null ? tx.blockHash : null; + this.hash = tx.hash; + this.index = tx.index; + this.from = tx.from; + this.to = tx.to || null; + this.energyLimit = tx.energyLimit; + this.nonce = tx.nonce; + this.data = tx.data; + this.value = tx.value; + this.energyPrice = tx.energyPrice; + this.networkId = tx.networkId; + this.signature = tx.signature; + this.#startBlock = -1; + } + /** + * Returns a JSON representation of this transaction. + */ + toJSON() { + const { index, hash, type, to, from, nonce, data, signature } = this; + return { + _type: "TransactionReceipt", + networkId: toJson(this.networkId), + data, + from, + energyLimit: toJson(this.energyLimit), + energyPrice: toJson(this.energyPrice), + hash, + nonce, + signature, + to, + index, + type, + value: toJson(this.value), + }; + } + /** + * Resolves to the Block that this transaction was included in. + * + * This will return null if the transaction has not been included yet. + */ + async getBlock() { + let blockNumber = this.blockNumber; + if (blockNumber == null) { + const tx = await this.getTransaction(); + if (tx) { + blockNumber = tx.blockNumber; + } + } + if (blockNumber == null) { + return null; + } + const block = this.provider.getBlock(blockNumber); + if (block == null) { + throw new Error("TODO"); + } + return block; + } + /** + * Resolves to this transaction being re-requested from the + * provider. This can be used if you have an unmined transaction + * and wish to get an up-to-date populated instance. + */ + async getTransaction() { + return this.provider.getTransaction(this.hash); + } + /** + * Resolves once this transaction has been mined and has + * %%confirms%% blocks including it (default: ``1``) with an + * optional %%timeout%%. + * + * This can resolve to ``null`` only if %%confirms%% is ``0`` + * and the transaction has not been mined, otherwise this will + * wait until enough confirmations have completed. + */ + async wait(_confirms, _timeout) { + const confirms = _confirms == null ? 1 : _confirms; + const timeout = _timeout == null ? 0 : _timeout; + let startBlock = this.#startBlock; + let nextScan = -1; + let stopScanning = startBlock === -1 ? true : false; + const checkReplacement = async () => { + // Get the current transaction count for this sender + if (stopScanning) { + return null; + } + const { blockNumber, nonce } = await resolveProperties({ + blockNumber: this.provider.getBlockNumber(), + nonce: this.provider.getTransactionCount(this.from), + }); + // No transaction or our nonce has not been mined yet; but we + // can start scanning later when we do start + if (nonce < this.nonce) { + startBlock = blockNumber; + return; + } + // We were mined; no replacement + if (stopScanning) { + return null; + } + const mined = await this.getTransaction(); + if (mined && mined.blockNumber != null) { + return; + } + // We were replaced; start scanning for that transaction + // Starting to scan; look back a few extra blocks for safety + if (nextScan === -1) { + nextScan = startBlock - 3; + if (nextScan < this.#startBlock) { + nextScan = this.#startBlock; + } + } + while (nextScan <= blockNumber) { + // Get the next block to scan + if (stopScanning) { + return null; + } + const block = await this.provider.getBlock(nextScan, true); + // This should not happen; but we'll try again shortly + if (block == null) { + return; + } + // We were mined; no replacement + for (const hash of block) { + if (hash === this.hash) { + return; + } + } + // Search for the transaction that replaced us + for (let i = 0; i < block.length; i++) { + const tx = await block.getTransaction(i); + if (tx.from === this.from && tx.nonce === this.nonce) { + // Get the receipt + if (stopScanning) { + return null; + } + const receipt = await this.provider.getTransactionReceipt(tx.hash); + // This should not happen; but we'll try again shortly + if (receipt == null) { + return; + } + // We will retry this on the next block (this case could be optimized) + if (blockNumber - receipt.blockNumber + 1 < confirms) { + return; + } + // The reason we were replaced + let reason = "replaced"; + if (tx.data === this.data && + tx.to === this.to && + tx.value === this.value) { + reason = "repriced"; + } + else if (tx.data === "0x" && + tx.from === tx.to && + tx.value === BN_0$2) { + reason = "cancelled"; + } + assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { + cancelled: reason === "replaced" || reason === "cancelled", + reason, + replacement: tx.replaceableTransaction(startBlock), + hash: tx.hash, + receipt, + }); + } + } + nextScan++; + } + return; + }; + const receipt = await this.provider.getTransactionReceipt(this.hash); + if (receipt) { + if ((await receipt.confirmations()) >= confirms) { + return receipt; + } + } + else { + // Check for a replacement; throws if a replacement was found + await checkReplacement(); + // Allow null only when the confirms is 0 + if (confirms === 0) { + return null; + } + } + const waiter = new Promise((resolve, reject) => { + // List of things to cancel when we have a result (one way or the other) + const cancellers = []; + const cancel = () => { + cancellers.forEach((c) => c()); + }; + // On cancel, stop scanning for replacements + cancellers.push(() => { + stopScanning = true; + }); + // Set up any timeout requested + if (timeout > 0) { + const timer = setTimeout(() => { + cancel(); + reject(makeError("wait for transaction timeout", "TIMEOUT")); + }, timeout); + cancellers.push(() => { + clearTimeout(timer); + }); + } + const txListener = async (receipt) => { + // Done; return it! + if ((await receipt.confirmations()) >= confirms) { + cancel(); + resolve(receipt); + } + }; + cancellers.push(() => { + this.provider.off(this.hash, txListener); + }); + this.provider.on(this.hash, txListener); + // We support replacement detection; start checking + if (startBlock >= 0) { + const replaceListener = async () => { + try { + // Check for a replacement; this throws only if one is found + await checkReplacement(); + } + catch (error) { + // We were replaced (with enough confirms); re-throw the error + if (isError(error, "TRANSACTION_REPLACED")) { + cancel(); + reject(error); + return; + } + } + // Rescheudle a check on the next block + if (!stopScanning) { + this.provider.once("block", replaceListener); + } + }; + cancellers.push(() => { + this.provider.off("block", replaceListener); + }); + this.provider.once("block", replaceListener); + } + }); + return await waiter; + } + /** + * Returns ``true`` if this transaction has been included. + * + * This is effective only as of the time the TransactionResponse + * was instantiated. To get up-to-date information, use + * [[getTransaction]]. + * + * This provides a Type Guard that this transaction will have + * non-null property values for properties that are null for + * unmined transactions. + */ + isMined() { + return this.blockHash != null; + } + /** + * Returns true if the transaction is a legacy (i.e. ``type == 0``) + * transaction. + * + * This provides a Type Guard that this transaction will have + * the ``null``-ness for hardfork-specific properties set correctly. + */ + isLegacy() { + return this.type === 0; + } + /** + * Returns a filter which can be used to listen for orphan events + * that evict this transaction. + */ + removedEvent() { + assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); + return createRemovedTransactionFilter(this); + } + /** + * Returns a filter which can be used to listen for orphan events + * that re-order this event against %%other%%. + */ + reorderedEvent(other) { + assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); + assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); + return createReorderedTransactionFilter(this, other); + } + /** + * Returns a new TransactionResponse instance which has the ability to + * detect (and throw an error) if the transaction is replaced, which + * will begin scanning at %%startBlock%%. + * + * This should generally not be used by developers and is intended + * primarily for internal use. Setting an incorrect %%startBlock%% can + * have devastating performance consequences if used incorrectly. + */ + replaceableTransaction(startBlock) { + assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); + const tx = new TransactionResponse(this, this.provider); + tx.#startBlock = startBlock; + return tx; + } + } + function createOrphanedBlockFilter(block) { + return { orphan: "drop-block", hash: block.hash, number: block.number }; + } + function createReorderedTransactionFilter(tx, other) { + return { orphan: "reorder-transaction", tx, other }; + } + function createRemovedTransactionFilter(tx) { + return { orphan: "drop-transaction", tx }; + } + function createRemovedLogFilter(log) { + return { + orphan: "drop-log", + log: { + transactionHash: log.transactionHash, + blockHash: log.blockHash, + blockNumber: log.blockNumber, + address: log.address, + data: log.data, + topics: Object.freeze(log.topics.slice()), + index: log.index, + }, + }; + } + + class EventLog extends Log { + interface; + fragment; + args; + constructor(log, iface, fragment) { + super(log, log.provider); + const args = iface.decodeEventLog(fragment, log.data, log.topics); + defineProperties(this, { args, fragment, interface: iface }); + } + get eventName() { + return this.fragment.name; + } + get eventSignature() { + return this.fragment.format(); + } + } + class ContractTransactionReceipt extends TransactionReceipt { + #iface; + constructor(iface, provider, tx) { + super(tx, provider); + this.#iface = iface; + } + get logs() { + return super.logs.map((log) => { + const fragment = log.topics.length + ? this.#iface.getEvent(log.topics[0]) + : null; + if (fragment) { + return new EventLog(log, this.#iface, fragment); + } + else { + return log; + } + }); + } + } + class ContractTransactionResponse extends TransactionResponse { + #iface; + constructor(iface, provider, tx) { + super(tx, provider); + this.#iface = iface; + } + async wait(confirms) { + const receipt = await super.wait(); + if (receipt == null) { + return null; + } + return new ContractTransactionReceipt(this.#iface, this.provider, receipt); + } + } + class ContractUnknownEventPayload extends EventPayload { + log; + constructor(contract, listener, filter, log) { + super(contract, listener, filter); + defineProperties(this, { log }); + } + async getBlock() { + return await this.log.getBlock(); + } + async getTransaction() { + return await this.log.getTransaction(); + } + async getTransactionReceipt() { + return await this.log.getTransactionReceipt(); + } + } + class ContractEventPayload extends ContractUnknownEventPayload { + constructor(contract, listener, filter, fragment, _log) { + super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); + const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); + defineProperties(this, { args, fragment }); + } + get eventName() { + return this.fragment.name; + } + get eventSignature() { + return this.fragment.format(); + } + } + + const BN_0$1 = BigInt(0); + function canCall(value) { + return value && typeof value.call === "function"; + } + function canEstimate(value) { + return value && typeof value.estimateEnergy === "function"; + } + function canResolve(value) { + return value && typeof value.resolveName === "function"; + } + function canSend(value) { + return value && typeof value.sendTransaction === "function"; + } + class PreparedTopicFilter { + #filter; + fragment; + constructor(contract, fragment, args) { + defineProperties(this, { fragment }); + if (fragment.inputs.length < args.length) { + throw new Error("too many arguments"); + } + // Recursively descend into args and resolve any addresses + this.#filter = (async function () { + const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { + const arg = args[index]; + if (arg == null) { + return null; + } + return param.walkAsync(args[index], (type, value) => { + if (type === "address") { + return resolveAddress(value); + } + return value; + }); + })); + return contract.interface.encodeFilterTopics(fragment, resolvedArgs); + })(); + } + getTopicFilter() { + return this.#filter; + } + } + // A = Arguments passed in as a tuple + // R = The result type of the call (i.e. if only one return type, + // the qualified type, otherwise Result) + // D = The type the default call will return (i.e. R for view/pure, + // TransactionResponse otherwise) + //export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { + function getRunner(value, feature) { + if (value == null) { + return null; + } + if (typeof value[feature] === "function") { + return value; + } + if (value.provider && typeof value.provider[feature] === "function") { + return value.provider; + } + return null; + } + function getProvider(value) { + if (value == null) { + return null; + } + return value.provider || null; + } + /** + * @_ignore: + */ + async function copyOverrides(arg, allowed) { + // Create a shallow copy (we'll deep-ify anything needed during normalizing) + const overrides = copyRequest(Typed.dereference(arg, "overrides")); + assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); + assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); + // Resolve any from + if (overrides.from) { + overrides.from = await resolveAddress(overrides.from); + } + return overrides; + } + /** + * @_ignore: + */ + async function resolveArgs(_runner, inputs, args) { + // Recursively descend into args and resolve any addresses + return await Promise.all(inputs.map((param, index) => { + return param.walkAsync(args[index], (type, value) => { + value = Typed.dereference(value, type); + if (type === "address") { + return resolveAddress(value); + } + return value; + }); + })); + } + function buildWrappedFallback(contract) { + const populateTransaction = async function (overrides) { + // If an overrides was passed in, copy it and normalize the values + const tx = (await copyOverrides(overrides, ["data"])); + tx.to = await contract.getAddress(); + const iface = contract.interface; + // Only allow payable contracts to set non-zero value + const payable = iface.receive || (iface.fallback && iface.fallback.payable); + assertArgument(payable || (tx.value || BN_0$1) === BN_0$1, "cannot send value to non-payable contract", "overrides.value", tx.value); + // Only allow fallback contracts to set non-empty data + assertArgument(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data); + return tx; + }; + const staticCall = async function (overrides) { + const runner = getRunner(contract.runner, "call"); + assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); + const tx = await populateTransaction(overrides); + try { + return await runner.call(tx); + } + catch (error) { + if (isCallException(error) && error.data) { + throw contract.interface.makeError(error.data, tx); + } + throw error; + } + }; + const send = async function (overrides) { + const runner = contract.runner; + assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); + const tx = await runner.sendTransaction(await populateTransaction(overrides)); + const provider = getProvider(contract.runner); + // @TODO: the provider can be null; make a custom dummy provider that will throw a + // meaningful error + return new ContractTransactionResponse(contract.interface, provider, tx); + }; + const estimateEnergy = async function (overrides) { + const runner = getRunner(contract.runner, "estimateEnergy"); + assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); + return await runner.estimateEnergy(await populateTransaction(overrides)); + }; + const method = async (overrides) => { + return await send(overrides); + }; + defineProperties(method, { + _contract: contract, + estimateEnergy, + populateTransaction, + send, + staticCall, + }); + return method; + } + function buildWrappedMethod(contract, key) { + const getFragment = function (...args) { + const fragment = contract.interface.getFunction(key, args); + assert(fragment, "no matching fragment in getFragment", "UNSUPPORTED_OPERATION", { + operation: "fragment", + }); + return fragment; + }; + const populateTransaction = async function (...args) { + const fragment = getFragment(...args); + // If an overrides was passed in, copy it and normalize the values + let overrides = {}; + if (fragment.inputs.length + 1 === args.length) { + overrides = await copyOverrides(args.pop()); + } + if (fragment.inputs.length !== args.length) { + throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); + } + const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); + return Object.assign({}, overrides, await resolveProperties({ + to: contract.getAddress(), + data: contract.interface.encodeFunctionData(fragment, resolvedArgs), + })); + }; + const staticCall = async function (...args) { + const result = await staticCallResult(...args); + if (result.length === 1) { + return result[0]; + } + return result; + }; + const send = async function (...args) { + const runner = contract.runner; + assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); + const tx = await runner.sendTransaction(await populateTransaction(...args)); + const provider = getProvider(contract.runner); + // @TODO: the provider can be null; make a custom dummy provider that will throw a + // meaningful error + return new ContractTransactionResponse(contract.interface, provider, tx); + }; + const estimateEnergy = async function (...args) { + const runner = getRunner(contract.runner, "estimateEnergy"); + assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); + return await runner.estimateEnergy(await populateTransaction(...args)); + }; + const staticCallResult = async function (...args) { + const runner = getRunner(contract.runner, "call"); + assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); + const tx = await populateTransaction(...args); + let result = "0x"; + try { + result = await runner.call(tx); + } + catch (error) { + if (isCallException(error) && error.data) { + throw contract.interface.makeError(error.data, tx); + } + throw error; + } + const fragment = getFragment(...args); + return contract.interface.decodeFunctionResult(fragment, result); + }; + const method = async (...args) => { + const fragment = getFragment(...args); + if (fragment.constant) { + return await staticCall(...args); + } + return await send(...args); + }; + defineProperties(method, { + name: contract.interface.getFunctionName(key), + _contract: contract, + _key: key, + getFragment, + estimateEnergy, + populateTransaction, + send, + staticCall, + staticCallResult, + }); + // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) + Object.defineProperty(method, "fragment", { + configurable: false, + enumerable: true, + get: () => { + const fragment = contract.interface.getFunction(key); + assert(fragment, "no matching fragment in defineProperty", "UNSUPPORTED_OPERATION", { + operation: "fragment", + }); + return fragment; + }, + }); + return method; + } + function buildWrappedEvent(contract, key) { + const getFragment = function (...args) { + const fragment = contract.interface.getEvent(key, args); + assert(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { + operation: "fragment", + }); + return fragment; + }; + const method = function (...args) { + return new PreparedTopicFilter(contract, getFragment(...args), args); + }; + defineProperties(method, { + name: contract.interface.getEventName(key), + _contract: contract, + _key: key, + getFragment, + }); + // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) + Object.defineProperty(method, "fragment", { + configurable: false, + enumerable: true, + get: () => { + const fragment = contract.interface.getEvent(key); + assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { + operation: "fragment", + }); + return fragment; + }, + }); + return method; + } + // The combination of TypeScrype, Private Fields and Proxies makes + // the world go boom; so we hide variables with some trickery keeping + // a symbol attached to each BaseContract which its sub-class (even + // via a Proxy) can reach and use to look up its internal values. + const internal = Symbol.for("_corebcInternal_contract"); + const internalValues = new WeakMap(); + function setInternal(contract, values) { + internalValues.set(contract[internal], values); + } + function getInternal(contract) { + return internalValues.get(contract[internal]); + } + function isDeferred(value) { + return (value && + typeof value === "object" && + "getTopicFilter" in value && + typeof value.getTopicFilter === "function" && + value.fragment); + } + async function getSubInfo(contract, event) { + let topics; + let fragment = null; + // Convert named events to topicHash and get the fragment for + // events which need deconstructing. + if (Array.isArray(event)) { + const topicHashify = function (name) { + if (isHexString(name, 32)) { + return name; + } + const fragment = contract.interface.getEvent(name); + assertArgument(fragment, "unknown fragment", "name", name); + return fragment.topicHash; + }; + // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` + topics = event.map((e) => { + if (e == null) { + return null; + } + if (Array.isArray(e)) { + return e.map(topicHashify); + } + return topicHashify(e); + }); + } + else if (event === "*") { + topics = [null]; + } + else if (typeof event === "string") { + if (isHexString(event, 32)) { + // Topic Hash + topics = [event]; + } + else { + // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` + fragment = contract.interface.getEvent(event); + assertArgument(fragment, "unknown fragment", "event", event); + topics = [fragment.topicHash]; + } + } + else if (isDeferred(event)) { + // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` + topics = await event.getTopicFilter(); + } + else if ("fragment" in event) { + // ContractEvent; e.g. `contract.filter.Transfer` + fragment = event.fragment; + topics = [fragment.topicHash]; + } + else { + assertArgument(false, "unknown event name", "event", event); + } + // Normalize topics and sort TopicSets + topics = topics.map((t) => { + if (t == null) { + return null; + } + if (Array.isArray(t)) { + const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); + if (items.length === 1) { + return items[0]; + } + items.sort(); + return items; + } + return t.toLowerCase(); + }); + const tag = topics + .map((t) => { + if (t == null) { + return "null"; + } + if (Array.isArray(t)) { + return t.join("|"); + } + return t; + }) + .join("&"); + return { fragment, tag, topics }; + } + async function hasSub(contract, event) { + const { subs } = getInternal(contract); + return subs.get((await getSubInfo(contract, event)).tag) || null; + } + async function getSub(contract, operation, event) { + // Make sure our runner can actually subscribe to events + const provider = getProvider(contract.runner); + assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); + const { fragment, tag, topics } = await getSubInfo(contract, event); + const { addr, subs } = getInternal(contract); + let sub = subs.get(tag); + if (!sub) { + const address = addr ? addr : contract; + const filter = { address, topics }; + const listener = (log) => { + let foundFragment = fragment; + if (foundFragment == null) { + try { + foundFragment = contract.interface.getEvent(log.topics[0]); + } + catch (error) { } + } + // If fragment is null, we do not deconstruct the args to emit + if (foundFragment) { + const _foundFragment = foundFragment; + const args = fragment + ? contract.interface.decodeEventLog(fragment, log.data, log.topics) + : []; + emit(contract, event, args, (listener) => { + return new ContractEventPayload(contract, listener, event, _foundFragment, log); + }); + } + else { + emit(contract, event, [], (listener) => { + return new ContractUnknownEventPayload(contract, listener, event, log); + }); + } + }; + let starting = []; + const start = () => { + if (starting.length) { + return; + } + starting.push(provider.on(filter, listener)); + }; + const stop = async () => { + if (starting.length == 0) { + return; + } + let started = starting; + starting = []; + await Promise.all(started); + provider.off(filter, listener); + }; + sub = { tag, listeners: [], start, stop }; + subs.set(tag, sub); + } + return sub; + } + // We use this to ensure one emit resolves before firing the next to + // ensure correct ordering (note this cannot throw and just adds the + // notice to the event queu using setTimeout). + let lastEmit = Promise.resolve(); + async function _emit(contract, event, args, payloadFunc) { + await lastEmit; + const sub = await hasSub(contract, event); + if (!sub) { + return false; + } + const count = sub.listeners.length; + sub.listeners = sub.listeners.filter(({ listener, once }) => { + const passArgs = Array.from(args); + if (payloadFunc) { + passArgs.push(payloadFunc(once ? null : listener)); + } + try { + listener.call(contract, ...passArgs); + } + catch (error) { } + return !once; + }); + return count > 0; + } + async function emit(contract, event, args, payloadFunc) { + try { + await lastEmit; + } + catch (error) { } + const resultPromise = _emit(contract, event, args, payloadFunc); + lastEmit = resultPromise; + return await resultPromise; + } + const passProperties = ["then"]; + class BaseContract { + target; + interface; + runner; + filters; + [internal]; + fallback; + constructor(target, abi, runner, _deployTx) { + if (runner == null) { + runner = null; + } + const iface = Interface.from(abi); + defineProperties(this, { target, runner, interface: iface }); + Object.defineProperty(this, internal, { value: {} }); + let addrPromise; + let addr = null; + let deployTx = null; + if (_deployTx) { + const provider = getProvider(runner); + // @TODO: the provider can be null; make a custom dummy provider that will throw a + // meaningful error + deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); + } + let subs = new Map(); + // Resolve the target as the address + if (typeof target === "string") { + if (isHexString(target)) { + addr = target; + addrPromise = Promise.resolve(target); + } + else { + const resolver = getRunner(runner, "resolveName"); + if (!canResolve(resolver)) { + throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { + operation: "resolveName", + }); + } + addrPromise = resolver.resolveName(target).then((addr) => { + if (addr == null) { + throw new Error("TODO"); + } + getInternal(this).addr = addr; + return addr; + }); + } + } + else { + addrPromise = target.getAddress().then((addr) => { + if (addr == null) { + throw new Error("TODO"); + } + getInternal(this).addr = addr; + return addr; + }); + } + // Set our private values + setInternal(this, { addrPromise, addr, deployTx, subs }); + // Add the event filters + const filters = new Proxy({}, { + get: (target, _prop, receiver) => { + // Pass important checks (like `then` for Promise) through + if (passProperties.indexOf(_prop) >= 0) { + return Reflect.get(target, _prop, receiver); + } + const prop = String(_prop); + const result = this.getEvent(prop); + if (result) { + return result; + } + throw new Error(`unknown contract event: ${prop}`); + }, + has: (target, prop) => { + // Pass important checks (like `then` for Promise) through + if (passProperties.indexOf(prop) >= 0) { + return Reflect.has(target, prop); + } + return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop))); + }, + }); + defineProperties(this, { filters }); + defineProperties(this, { + fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null, + }); + // Return a Proxy that will respond to functions + return new Proxy(this, { + get: (target, _prop, receiver) => { + if (_prop in target || passProperties.indexOf(_prop) >= 0) { + return Reflect.get(target, _prop, receiver); + } + const prop = String(_prop); + const result = target.getFunction(prop); + if (result) { + return result; + } + throw new Error(`unknown contract method: ${prop}`); + }, + has: (target, prop) => { + if (prop in target || passProperties.indexOf(prop) >= 0) { + return Reflect.has(target, prop); + } + return target.interface.hasFunction(String(prop)); + }, + }); + } + connect(runner) { + return new BaseContract(this.target, this.interface, runner); + } + async getAddress() { + return await getInternal(this).addrPromise; + } + async getDeployedCode() { + const provider = getProvider(this.runner); + assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); + const code = await provider.getCode(await this.getAddress()); + if (code === "0x") { + return null; + } + return code; + } + async waitForDeployment() { + // We have the deployement transaction; just use that (throws if deployement fails) + const deployTx = this.deploymentTransaction(); + if (deployTx) { + await deployTx.wait(); + return this; + } + // Check for code + const code = await this.getDeployedCode(); + if (code != null) { + return this; + } + // Make sure we can subscribe to a provider event + const provider = getProvider(this.runner); + assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); + return new Promise((resolve, reject) => { + const checkCode = async () => { + try { + const code = await this.getDeployedCode(); + if (code != null) { + return resolve(this); + } + provider.once("block", checkCode); + } + catch (error) { + reject(error); + } + }; + checkCode(); + }); + } + deploymentTransaction() { + return getInternal(this).deployTx; + } + getFunction(key) { + if (typeof key !== "string") { + key = key.format(); + } + const func = buildWrappedMethod(this, key); + return func; + } + getEvent(key) { + if (typeof key !== "string") { + key = key.format(); + } + return buildWrappedEvent(this, key); + } + async queryTransaction(hash) { + // Is this useful? + throw new Error("@TODO"); + } + async queryFilter(event, fromBlock, toBlock) { + if (fromBlock == null) { + fromBlock = 0; + } + if (toBlock == null) { + toBlock = "latest"; + } + const { addr, addrPromise } = getInternal(this); + const address = addr ? addr : await addrPromise; + const { fragment, topics } = await getSubInfo(this, event); + const filter = { address, topics, fromBlock, toBlock }; + const provider = getProvider(this.runner); + assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); + return (await provider.getLogs(filter)).map((log) => { + let foundFragment = fragment; + if (foundFragment == null) { + try { + foundFragment = this.interface.getEvent(log.topics[0]); + } + catch (error) { } + } + if (foundFragment) { + return new EventLog(log, this.interface, foundFragment); + } + else { + return new Log(log, provider); + } + }); + } + async on(event, listener) { + const sub = await getSub(this, "on", event); + sub.listeners.push({ listener, once: false }); + sub.start(); + return this; + } + async once(event, listener) { + const sub = await getSub(this, "once", event); + sub.listeners.push({ listener, once: true }); + sub.start(); + return this; + } + async emit(event, ...args) { + return await emit(this, event, args, null); + } + async listenerCount(event) { + if (event) { + const sub = await hasSub(this, event); + if (!sub) { + return 0; + } + return sub.listeners.length; + } + const { subs } = getInternal(this); + let total = 0; + for (const { listeners } of subs.values()) { + total += listeners.length; + } + return total; + } + async listeners(event) { + if (event) { + const sub = await hasSub(this, event); + if (!sub) { + return []; + } + return sub.listeners.map(({ listener }) => listener); + } + const { subs } = getInternal(this); + let result = []; + for (const { listeners } of subs.values()) { + result = result.concat(listeners.map(({ listener }) => listener)); + } + return result; + } + async off(event, listener) { + const sub = await hasSub(this, event); + if (!sub) { + return this; + } + if (listener) { + const index = sub.listeners + .map(({ listener }) => listener) + .indexOf(listener); + if (index >= 0) { + sub.listeners.splice(index, 1); + } + } + if (listener == null || sub.listeners.length === 0) { + sub.stop(); + getInternal(this).subs.delete(sub.tag); + } + return this; + } + async removeAllListeners(event) { + if (event) { + const sub = await hasSub(this, event); + if (!sub) { + return this; + } + sub.stop(); + getInternal(this).subs.delete(sub.tag); + } + else { + const { subs } = getInternal(this); + for (const { tag, stop } of subs.values()) { + stop(); + subs.delete(tag); + } + } + return this; + } + // Alias for "on" + async addListener(event, listener) { + return await this.on(event, listener); + } + // Alias for "off" + async removeListener(event, listener) { + return await this.off(event, listener); + } + static buildClass(abi) { + class CustomContract extends BaseContract { + constructor(address, runner = null) { + super(address, abi, runner); + } + } + return CustomContract; + } + static from(target, abi, runner) { + if (runner == null) { + runner = null; + } + const contract = new this(target, abi, runner); + return contract; + } + static isIndexed(value) { + return Indexed.isIndexed(value); + } + } + function _ContractBase() { + return BaseContract; + } + class Contract extends _ContractBase() { + } + + // A = Arguments to the constructor + // I = Interface of deployed contracts + class ContractFactory { + interface; + bytecode; + runner; + constructor(abi, bytecode, runner) { + const iface = Interface.from(abi); + // Dereference Solidity bytecode objects and allow a missing `0x`-prefix + if (bytecode instanceof Uint8Array) { + bytecode = hexlify(getBytes(bytecode)); + } + else if (typeof bytecode === "string") { + bytecode = bytecode; + } + else if (isBytes$1(bytecode)) { + bytecode = hexlify(bytecode); + } + else if (bytecode && typeof bytecode.object === "string") { + // Allow the bytecode object from the Solidity compiler + bytecode = bytecode.object; + } + else { + // Crash in the next verification step + bytecode = "!"; + } + defineProperties(this, { + // @ts-ignore + bytecode, + interface: iface, + runner: runner || null, + }); + } + async getDeployTransaction(...args) { + let overrides = {}; + const fragment = this.interface.deploy; + if (fragment.inputs.length + 1 === args.length) { + overrides = await copyOverrides(args.pop()); + } + if (fragment.inputs.length !== args.length) { + throw new Error("incorrect number of arguments to constructor"); + } + const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); + const data = concat([ + this.bytecode, + this.interface.encodeDeploy(resolvedArgs), + ]); + return Object.assign({}, overrides, { data }); + } + async deploy(...args) { + const tx = await this.getDeployTransaction(...args); + assert(this.runner && typeof this.runner.sendTransaction === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { + operation: "sendTransaction", + }); + const sentTx = await this.runner.sendTransaction(tx); + const address = getCreateAddress(sentTx); + return new BaseContract(address, this.interface, this.runner, sentTx); + } + connect(runner) { + return new ContractFactory(this.interface, this.bytecode, runner); + } + static fromSolidity(output, runner) { + assertArgument(output != null, "bad compiler output", "output", output); + if (typeof output === "string") { + output = JSON.parse(output); + } + const abi = output.abi; + let bytecode = ""; + if (output.bytecode) { + bytecode = output.bytecode; + } + else if (output.evm && output.evm.bytecode) { + bytecode = output.evm.bytecode; + } + return new this(abi, bytecode, runner); + } + } + + /** + * @_ignore + */ + const BN_0 = BigInt(0); + function allowNull(format, nullValue) { + return function (value) { + if (value == null) { + return nullValue; + } + return format(value); + }; + } + function arrayOf(format) { + return (array) => { + if (!Array.isArray(array)) { + throw new Error("not an array"); + } + return array.map((i) => format(i)); + }; + } + // Requires an object which matches a fleet of other formatters + // Any FormatFunc may return `undefined` to have the value omitted + // from the result object. Calls preserve `this`. + function object(format, altNames) { + return (value) => { + const result = {}; + for (const key in format) { + let srcKey = key; + if (altNames && key in altNames && !(srcKey in value)) { + for (const altKey of altNames[key]) { + if (altKey in value) { + srcKey = altKey; + break; + } + } + } + try { + const nv = format[key](value[srcKey]); + if (nv !== undefined) { + result[key] = nv; + } + } + catch (error) { + const message = error instanceof Error ? error.message : "not-an-error"; + assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); + } + } + return result; + }; + } + function formatBoolean(value) { + switch (value) { + case true: + case "true": + return true; + case false: + case "false": + return false; + } + assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); + } + function formatData(value) { + assertArgument(isHexString(value, true), "invalid data", "value", value); + return value; + } + function formatHash(value) { + assertArgument(isHexString(value, 32), "invalid hash", "value", value); + return value; + } + const _formatLog = object({ + address: getAddress, + blockHash: formatHash, + blockNumber: getNumber, + data: formatData, + index: getNumber, + removed: allowNull(formatBoolean, false), + topics: arrayOf(formatHash), + transactionHash: formatHash, + transactionIndex: getNumber, + }, { + index: ["logIndex"], + }); + function formatLog(value) { + return _formatLog(value); + } + const _formatBlock = object({ + hash: allowNull(formatHash), + parentHash: formatHash, + number: getNumber, + timestamp: getNumber, + nonce: allowNull(formatData), + difficulty: getBigInt, + energyLimit: getBigInt, + energyUsed: getBigInt, + miner: allowNull(getAddress), + extraData: formatData, + baseFeePerEnergy: allowNull(getBigInt), + }); + function formatBlock(value) { + const result = _formatBlock(value); + result.transactions = value.transactions.map((tx) => { + if (typeof tx === "string") { + return tx; + } + return formatTransactionResponse(tx); + }); + return result; + } + const _formatReceiptLog = object({ + transactionIndex: getNumber, + blockNumber: getNumber, + transactionHash: formatHash, + address: getAddress, + topics: arrayOf(formatHash), + data: formatData, + index: getNumber, + blockHash: formatHash, + }, { + index: ["logIndex"], + }); + function formatReceiptLog(value) { + return _formatReceiptLog(value); + } + const _formatTransactionReceipt = object({ + to: allowNull(getAddress, null), + from: allowNull(getAddress, null), + contractAddress: allowNull(getAddress, null), + // should be allowNull(hash), but broken-EIP-658 support is handled in receipt + index: getNumber, + root: allowNull(hexlify), + energyUsed: getBigInt, + logsBloom: allowNull(formatData), + blockHash: formatHash, + hash: formatHash, + logs: arrayOf(formatReceiptLog), + blockNumber: getNumber, + //confirmations: allowNull(getNumber, null), + cumulativeEnergyUsed: getBigInt, + effectiveEnergyPrice: allowNull(getBigInt), + status: allowNull(getNumber), + type: allowNull(getNumber, 0), + }, { + effectiveEnergyPrice: ["energyPrice"], + hash: ["transactionHash"], + index: ["transactionIndex"], + }); + function formatTransactionReceipt(value) { + return _formatTransactionReceipt(value); + } + function formatTransactionResponse(value) { + // Some clients (TestRPC) do strange things like return 0x0 for the + // 0 address; correct this to be a real address + if (value.to && !getAddress(value.to) && getBigInt(value.to) === BN_0) { + value.to = "0x0000000000000000000000000000000000000000"; + } + const result = object({ + hash: formatHash, + type: (value) => { + if (value === "0x" || value == null) { + return 0; + } + return getNumber(value); + }, + accessList: allowNull(accessListify, null), + blockHash: allowNull(formatHash, null), + blockNumber: allowNull(getNumber, null), + transactionIndex: allowNull(getNumber, null), + //confirmations: allowNull(getNumber, null), + from: getAddress, + maxFeePerEnergy: allowNull(getBigInt), + energyLimit: getBigInt, + to: allowNull(getAddress, null), + value: getBigInt, + nonce: getNumber, + data: formatData, + creates: allowNull(getAddress, null), + networkId: allowNull(getBigInt, null), + }, { + data: ["input"], + energyLimit: ["energy"], + })(value); + // If to and creates are empty, populate the creates from the value + if (result.to == null && result.creates == null) { + result.creates = getCreateAddress(result); + } + // Compute the signature + if (value.signature) { + result.signature = value.signature; + } + else { + result.signature = value; + } + // Some backends omit networkId on legacy transactions, but we can compute it + if (result.networkId == null) { + const networkId = result.signature.legacynetworkId; + if (networkId != null) { + result.networkId = networkId; + } + } + // @TODO: check networkId + /* + if (value.networkId != null) { + let networkId = value.networkId; + + if (isHexString(networkId)) { + networkId = BigNumber.from(networkId).toNumber(); + } + + result.networkId = networkId; + + } else { + let networkId = value.networkId; + + // geth-etc returns networkId + if (networkId == null && result.v == null) { + networkId = value.networkId; + } + + if (isHexString(networkId)) { + networkId = BigNumber.from(networkId).toNumber(); + } + + if (typeof(networkId) !== "number" && result.v != null) { + networkId = (result.v - 35) / 2; + if (networkId < 0) { networkId = 0; } + networkId = parseInt(networkId); + } + + if (typeof(networkId) !== "number") { networkId = 0; } + + result.networkId = networkId; + } + */ + // 0x0000... should actually be null + if (result.blockHash && getBigInt(result.blockHash) === BN_0) { + result.blockHash = null; + } + return result; + } + + class NetworkPlugin { + name; + constructor(name) { + defineProperties(this, { name }); + } + clone() { + return new NetworkPlugin(this.name); + } + } + class EnergyCostPlugin extends NetworkPlugin { + effectiveBlock; + txBase; + txCreate; + txDataZero; + txDataNonzero; + txAccessListStorageKey; + txAccessListAddress; + constructor(effectiveBlock, costs) { + if (effectiveBlock == null) { + effectiveBlock = 0; + } + super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock || 0}`); + const props = { effectiveBlock }; + function set(name, nullish) { + let value = (costs || {})[name]; + if (value == null) { + value = nullish; + } + assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs); + props[name] = value; + } + set("txBase", 21000); + set("txCreate", 32000); + set("txDataZero", 4); + set("txDataNonzero", 16); + set("txAccessListStorageKey", 1900); + set("txAccessListAddress", 2400); + defineProperties(this, props); + } + clone() { + return new EnergyCostPlugin(this.effectiveBlock, this); + } + } + class FeeDataNetworkPlugin extends NetworkPlugin { + #feeDataFunc; + get feeDataFunc() { + return this.#feeDataFunc; + } + constructor(feeDataFunc) { + super("org.corebc.plugins.network.FeeData"); + this.#feeDataFunc = feeDataFunc; + } + async getFeeData(provider) { + return await this.#feeDataFunc(provider); + } + clone() { + return new FeeDataNetworkPlugin(this.#feeDataFunc); + } + } + /* + export class CustomBlockNetworkPlugin extends NetworkPlugin { + readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; + readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; + + async getBlock(provider: Provider, block: BlockParams): Promise> { + return await this.#blockFunc(provider, block); + } + + async getBlockions(provider: Provider, block: BlockParams): Promise> { + return await this.#blockWithTxsFunc(provider, block); + } + + clone(): CustomBlockNetworkPlugin { + return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); + } + } + */ + + /** + * About networks + * + * @_subsection: api/providers:Networks [networks] + */ + /* * * * + // Networks which operation against an L2 can use this plugin to + // specify how to access L1, for the purpose of resolving ENS, + // for example. + export class LayerOneConnectionPlugin extends NetworkPlugin { + readonly provider!: Provider; + */ + // Networks or clients with a higher need for security (such as clients + // that may automatically make CCIP requests without user interaction) + // can use this plugin to anonymize requests or intercept CCIP requests + // to notify and/or receive authorization from the user + const Networks = new Map(); + class Network { + #name; + #networkId; + #plugins; + constructor(name, networkId) { + this.#name = name; + this.#networkId = getBigInt(networkId); + this.#plugins = new Map(); + } + toJSON() { + return { name: this.name, networkId: String(this.networkId) }; + } + /** + * The network common name. + * + * This is the canonical name, as networks migh have multiple + * names. + */ + get name() { + return this.#name; + } + set name(value) { + this.#name = value; + } + /** + * The network chain ID. + */ + get networkId() { + return this.#networkId; + } + set networkId(value) { + this.#networkId = getBigInt(value, "networkId"); + } + /** + * Returns true if %%other%% matches this network. Any chain ID + * must match, and if no chain ID is present, the name must match. + * + * This method does not currently check for additional properties, + * such as ENS address or plug-in compatibility. + */ + matches(other) { + if (other == null) { + return false; + } + if (typeof other === "string") { + try { + return this.networkId === getBigInt(other); + } + catch (error) { } + return this.name === other; + } + if (typeof other === "number" || typeof other === "bigint") { + try { + return this.networkId === getBigInt(other); + } + catch (error) { } + return false; + } + if (typeof other === "object") { + if (other.networkId != null) { + try { + return this.networkId === getBigInt(other.networkId); + } + catch (error) { } + return false; + } + if (other.name != null) { + return this.name === other.name; + } + return false; + } + return false; + } + /** + * Returns the list of plugins currently attached to this Network. + */ + get plugins() { + return Array.from(this.#plugins.values()); + } + /** + * Attach a new %%plugin%% to this Network. The network name + * must be unique, excluding any fragment. + */ + attachPlugin(plugin) { + if (this.#plugins.get(plugin.name)) { + throw new Error(`cannot replace existing plugin: ${plugin.name} `); + } + this.#plugins.set(plugin.name, plugin.clone()); + return this; + } + /** + * Return the plugin, if any, matching %%name%% exactly. Plugins + * with fragments will not be returned unless %%name%% includes + * a fragment. + */ + getPlugin(name) { + return this.#plugins.get(name) || null; + } + /** + * Gets a list of all plugins that match %%name%%, with otr without + * a fragment. + */ + getPlugins(basename) { + return (this.plugins.filter((p) => p.name.split("#")[0] === basename)); + } + /** + * Create a copy of this Network. + */ + clone() { + const clone = new Network(this.name, this.networkId); + this.plugins.forEach((plugin) => { + clone.attachPlugin(plugin.clone()); + }); + return clone; + } + /** + * Compute the intrinsic energy required for a transaction. + * + * A EnergyCostPlugin can be attached to override the default + * values. + */ + computeIntrinsicEnergy(tx) { + const costs = this.getPlugin("org.corebc.plugins.network.EnergyCost") || new EnergyCostPlugin(); + let energy = costs.txBase; + if (tx.to == null) { + energy += costs.txCreate; + } + if (tx.data) { + for (let i = 2; i < tx.data.length; i += 2) { + if (tx.data.substring(i, i + 2) === "00") { + energy += costs.txDataZero; + } + else { + energy += costs.txDataNonzero; + } + } + } + return energy; + } + /** + * Returns a new Network for the %%network%% name or networkId. + */ + static from(network) { + injectCommonNetworks(); + // Default network + if (network == null) { + return Network.from("mainnet"); + } + // Canonical name or chain ID + if (typeof network === "number") { + network = BigInt(network); + } + if (typeof network === "string" || typeof network === "bigint") { + const networkFunc = Networks.get(network); + if (networkFunc) { + return networkFunc(); + } + if (typeof network === "bigint") { + return new Network("unknown", network); + } + assertArgument(false, "unknown network", "network", network); + } + // Clonable with network-like abilities + if (typeof network.clone === "function") { + const clone = network.clone(); + //if (typeof(network.name) !== "string" || typeof(network.networkId) !== "number") { + //} + return clone; + } + // Networkish + if (typeof network === "object") { + assertArgument(typeof network.name === "string" && + typeof network.networkId === "number", "invalid network object name or networkId", "network", network); + const custom = new Network(network.name, network.networkId); + //if ((network).layerOneConnection) { + // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); + //} + return custom; + } + assertArgument(false, "invalid network", "network", network); + } + /** + * Register %%nameOrnetworkId%% with a function which returns + * an instance of a Network representing that chain. + */ + static register(nameOrnetworkId, networkFunc) { + if (typeof nameOrnetworkId === "number") { + nameOrnetworkId = BigInt(nameOrnetworkId); + } + const existing = Networks.get(nameOrnetworkId); + if (existing) { + assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrnetworkId", nameOrnetworkId); + } + Networks.set(nameOrnetworkId, networkFunc); + } + } + // See: https://chainlist.org + let injected = false; + function injectCommonNetworks() { + if (injected) { + return; + } + injected = true; + /// Register popular Core networks + function registerEth(name, networkId, options) { + const func = function () { + const network = new Network(name, networkId); + network.attachPlugin(new EnergyCostPlugin()); + return network; + }; + // Register the network by name and chain ID + Network.register(name, func); + Network.register(networkId, func); + if (options.altNames) { + options.altNames.forEach((name) => { + Network.register(name, func); + }); + } + } + registerEth("mainnet", 1, { altNames: ["homestead"] }); + registerEth("ropsten", 3, { }); + registerEth("rinkeby", 4, { }); + registerEth("goerli", 5, { }); + registerEth("kovan", 42, { }); + registerEth("sepolia", 11155111, {}); + registerEth("classic", 61, {}); + registerEth("classicKotti", 6, {}); + registerEth("xdai", 100, { }); + } + + function copy$2(obj) { + return JSON.parse(JSON.stringify(obj)); + } + // @TODO: refactor this + /** + * @TODO + * + * @_docloc: api/providers/abstract-provider + */ + class PollingBlockSubscriber { + #provider; + #poller; + #interval; + // The most recent block we have scanned for events. The value -2 + // indicates we still need to fetch an initial block number + #blockNumber; + constructor(provider) { + this.#provider = provider; + this.#poller = null; + this.#interval = 4000; + this.#blockNumber = -2; + } + get pollingInterval() { + return this.#interval; + } + set pollingInterval(value) { + this.#interval = value; + } + async #poll() { + try { + const blockNumber = await this.#provider.getBlockNumber(); + // Bootstrap poll to setup our initial block number + if (this.#blockNumber === -2) { + this.#blockNumber = blockNumber; + return; + } + // @TODO: Put a cap on the maximum number of events per loop? + if (blockNumber !== this.#blockNumber) { + for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { + // We have been stopped + if (this.#poller == null) { + return; + } + await this.#provider.emit("block", b); + } + this.#blockNumber = blockNumber; + } + } + catch (error) { + // @TODO: Minor bump, add an "error" event to let subscribers + // know things went awry. + //console.log(error); + } + // We have been stopped + if (this.#poller == null) { + return; + } + this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); + } + start() { + if (this.#poller) { + return; + } + this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); + this.#poll(); + } + stop() { + if (!this.#poller) { + return; + } + this.#provider._clearTimeout(this.#poller); + this.#poller = null; + } + pause(dropWhilePaused) { + this.stop(); + if (dropWhilePaused) { + this.#blockNumber = -2; + } + } + resume() { + this.start(); + } + } + /** + * @TODO + * + * @_docloc: api/providers/abstract-provider + */ + class OnBlockSubscriber { + #provider; + #poll; + #running; + constructor(provider) { + this.#provider = provider; + this.#running = false; + this.#poll = (blockNumber) => { + this._poll(blockNumber, this.#provider); + }; + } + async _poll(blockNumber, provider) { + throw new Error("sub-classes must override this"); + } + start() { + if (this.#running) { + return; + } + this.#running = true; + this.#poll(-2); + this.#provider.on("block", this.#poll); + } + stop() { + if (!this.#running) { + return; + } + this.#running = false; + this.#provider.off("block", this.#poll); + } + pause(dropWhilePaused) { + this.stop(); + } + resume() { + this.start(); + } + } + /** + * @TODO + * + * @_docloc: api/providers/abstract-provider + */ + class PollingOrphanSubscriber extends OnBlockSubscriber { + #filter; + constructor(provider, filter) { + super(provider); + this.#filter = copy$2(filter); + } + async _poll(blockNumber, provider) { + throw new Error("@TODO"); + } + } + /** + * @TODO + * + * @_docloc: api/providers/abstract-provider + */ + class PollingTransactionSubscriber extends OnBlockSubscriber { + #hash; + constructor(provider, hash) { + super(provider); + this.#hash = hash; + } + async _poll(blockNumber, provider) { + const tx = await provider.getTransactionReceipt(this.#hash); + if (tx) { + provider.emit(this.#hash, tx); + } + } + } + /** + * @TODO + * + * @_docloc: api/providers/abstract-provider + */ + class PollingEventSubscriber { + #provider; + #filter; + #poller; + #running; + // The most recent block we have scanned for events. The value -2 + // indicates we still need to fetch an initial block number + #blockNumber; + constructor(provider, filter) { + this.#provider = provider; + this.#filter = copy$2(filter); + this.#poller = this.#poll.bind(this); + this.#running = false; + this.#blockNumber = -2; + } + async #poll(blockNumber) { + // The initial block hasn't been determined yet + if (this.#blockNumber === -2) { + return; + } + const filter = copy$2(this.#filter); + filter.fromBlock = this.#blockNumber + 1; + filter.toBlock = blockNumber; + const logs = await this.#provider.getLogs(filter); + // No logs could just mean the node has not indexed them yet, + // so we keep a sliding window of 60 blocks to keep scanning + if (logs.length === 0) { + if (this.#blockNumber < blockNumber - 60) { + this.#blockNumber = blockNumber - 60; + } + return; + } + this.#blockNumber = blockNumber; + for (const log of logs) { + this.#provider.emit(this.#filter, log); + } + } + start() { + if (this.#running) { + return; + } + this.#running = true; + if (this.#blockNumber === -2) { + this.#provider.getBlockNumber().then((blockNumber) => { + this.#blockNumber = blockNumber; + }); + } + this.#provider.on("block", this.#poller); + } + stop() { + if (!this.#running) { + return; + } + this.#running = false; + this.#provider.off("block", this.#poller); + } + pause(dropWhilePaused) { + this.stop(); + if (dropWhilePaused) { + this.#blockNumber = -2; + } + } + resume() { + this.start(); + } + } + + /** + * About Subclassing the Provider... + * + * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] + */ + // @TODO + // Event coalescence + // When we register an event with an async value (e.g. address is a Signer + // or ENS name), we need to add it immeidately for the Event API, but also + // need time to resolve the address. Upon resolving the address, we need to + // migrate the listener to the static event. We also need to maintain a map + // of Signer/ENS name to address so we can sync respond to listenerCount. + const MAX_CCIP_REDIRECTS = 10; + function isPromise(value) { + return value && typeof value.then === "function"; + } + function getTag(prefix, value) { + return (prefix + + ":" + + JSON.stringify(value, (k, v) => { + if (v == null) { + return "null"; + } + if (typeof v === "bigint") { + return `bigint:${v.toString()}`; + } + if (typeof v === "string") { + return v.toLowerCase(); + } + // Sort object keys + if (typeof v === "object" && !Array.isArray(v)) { + const keys = Object.keys(v); + keys.sort(); + return keys.reduce((accum, key) => { + accum[key] = v[key]; + return accum; + }, {}); + } + return v; + })); + } + class UnmanagedSubscriber { + name; + constructor(name) { + defineProperties(this, { name }); + } + start() { } + stop() { } + pause(dropWhilePaused) { } + resume() { } + } + function copy$1(value) { + return JSON.parse(JSON.stringify(value)); + } + function concisify(items) { + items = Array.from(new Set(items).values()); + items.sort(); + return items; + } + async function getSubscription(_event, provider) { + if (_event == null) { + throw new Error("invalid event"); + } + // Normalize topic array info an EventFilter + if (Array.isArray(_event)) { + _event = { topics: _event }; + } + if (typeof _event === "string") { + switch (_event) { + case "block": + case "pending": + case "debug": + case "error": + case "network": { + return { type: _event, tag: _event }; + } + } + } + if (isHexString(_event, 32)) { + const hash = _event.toLowerCase(); + return { type: "transaction", tag: getTag("tx", { hash }), hash }; + } + if (_event.orphan) { + const event = _event; + // @TODO: Should lowercase and whatnot things here instead of copy... + return { + type: "orphan", + tag: getTag("orphan", event), + filter: copy$1(event), + }; + } + if (_event.address || _event.topics) { + const event = _event; + const filter = { + topics: (event.topics || []).map((t) => { + if (t == null) { + return null; + } + if (Array.isArray(t)) { + return concisify(t.map((t) => t.toLowerCase())); + } + return t.toLowerCase(); + }), + }; + if (event.address) { + const addresses = []; + const promises = []; + const addAddress = (addr) => { + if (isHexString(addr)) { + addresses.push(addr); + } + else { + promises.push((async () => { + addresses.push(await resolveAddress(addr)); + })()); + } + }; + if (Array.isArray(event.address)) { + event.address.forEach(addAddress); + } + else { + addAddress(event.address); + } + if (promises.length) { + await Promise.all(promises); + } + filter.address = concisify(addresses.map((a) => a.toLowerCase())); + } + return { filter, tag: getTag("event", filter), type: "event" }; + } + assertArgument(false, "unknown ProviderEvent", "event", _event); + } + function getTime$1() { + return new Date().getTime(); + } + class AbstractProvider { + #subs; + #plugins; + // null=unpaused, true=paused+dropWhilePaused, false=paused + #pausedState; + #networkPromise; + #anyNetwork; + #performCache; + // The most recent block number if running an event or -1 if no "block" event + #lastBlockNumber; + #nextTimer; + #timers; + #disableCcipRead; + // @TODO: This should be a () => Promise so network can be + // done when needed; or rely entirely on _detectNetwork? + constructor(_network) { + if (_network === "any") { + this.#anyNetwork = true; + this.#networkPromise = null; + } + else if (_network) { + const network = Network.from(_network); + this.#anyNetwork = false; + this.#networkPromise = Promise.resolve(network); + setTimeout(() => { + this.emit("network", network, null); + }, 0); + } + else { + this.#anyNetwork = false; + this.#networkPromise = null; + } + this.#lastBlockNumber = -1; + this.#performCache = new Map(); + this.#subs = new Map(); + this.#plugins = new Map(); + this.#pausedState = null; + this.#nextTimer = 1; + this.#timers = new Map(); + this.#disableCcipRead = false; + } + get provider() { + return this; + } + get plugins() { + return Array.from(this.#plugins.values()); + } + attachPlugin(plugin) { + if (this.#plugins.get(plugin.name)) { + throw new Error(`cannot replace existing plugin: ${plugin.name} `); + } + this.#plugins.set(plugin.name, plugin.connect(this)); + return this; + } + getPlugin(name) { + return this.#plugins.get(name) || null; + } + get disableCcipRead() { + return this.#disableCcipRead; + } + set disableCcipRead(value) { + this.#disableCcipRead = !!value; + } + // Shares multiple identical requests made during the same 250ms + async #perform(req) { + // Create a tag + const tag = getTag(req.method, req); + let perform = this.#performCache.get(tag); + if (!perform) { + perform = this._perform(req); + this.#performCache.set(tag, perform); + setTimeout(() => { + if (this.#performCache.get(tag) === perform) { + this.#performCache.delete(tag); + } + }, 250); + } + return await perform; + } + async ccipReadFetch(tx, calldata, urls) { + if (this.disableCcipRead || urls.length === 0 || tx.to == null) { + return null; + } + const sender = tx.to.toLowerCase(); + const data = calldata.toLowerCase(); + const errorMessages = []; + for (let i = 0; i < urls.length; i++) { + const url = urls[i]; + // URL expansion + const href = url.replace("{sender}", sender).replace("{data}", data); + // If no {data} is present, use POST; otherwise GET + //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); + //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { + // value.status = response.statusCode; + // return value; + //}); + const request = new FetchRequest(href); + if (url.indexOf("{data}") === -1) { + request.body = { data, sender }; + } + this.emit("debug", { + action: "sendCcipReadFetchRequest", + request, + index: i, + urls, + }); + let errorMessage = "unknown error"; + const resp = await request.send(); + try { + const result = resp.bodyJson; + if (result.data) { + this.emit("debug", { + action: "receiveCcipReadFetchResult", + request, + result, + }); + return result.data; + } + if (result.message) { + errorMessage = result.message; + } + this.emit("debug", { + action: "receiveCcipReadFetchError", + request, + result, + }); + } + catch (error) { } + // 4xx indicates the result is not present; stop + 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 }, + }); + // 5xx indicates server issue; try the next url + errorMessages.push(errorMessage); + } + assert(false, `error encountered during CCIP fetch: ${errorMessages .map((m) => JSON.stringify(m)) .join(", ")}`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, - info: { urls, errorMessages }, - }); - } - _wrapBlock(value, network) { - return new Block(formatBlock(value), this); - } - _wrapLog(value, network) { - return new Log(formatLog(value), this); - } - _wrapTransactionReceipt(value, network) { - return new TransactionReceipt(formatTransactionReceipt(value), this); - } - _wrapTransactionResponse(tx, network) { - return new TransactionResponse(formatTransactionResponse(tx), this); - } - _detectNetwork() { - assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork", - }); - } - // Sub-classes should override this and handle PerformActionRequest requests, calling - // the super for any unhandled actions. - async _perform(req) { - assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req, - }); - } - // State - async getBlockNumber() { - const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - _getAddress(address) { - return resolveAddress(address); - } - _getBlockTag(blockTag) { - if (blockTag == null) { - return "latest"; - } - switch (blockTag) { - case "earliest": - return "0x0"; - case "latest": - case "pending": - case "safe": - case "finalized": - return blockTag; - } - if (isHexString(blockTag)) { - if (isHexString(blockTag, 32)) { - return blockTag; - } - return toQuantity(blockTag); - } - if (typeof blockTag === "bigint") { - blockTag = getNumber(blockTag, "blockTag"); - } - if (typeof blockTag === "number") { - if (blockTag >= 0) { - return toQuantity(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return toQuantity(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => toQuantity(b + blockTag)); - } - assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - _getFilter(filter) { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - const blockHash = "blockHash" in filter ? filter.blockHash : undefined; - const resolve = (_address, fromBlock, toBlock) => { - let address = undefined; - switch (_address.length) { - case 0: - break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - return filter; - }; - // Addresses could be async (ENS names or Addressables) - let address = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } - else { - address.push(this._getAddress(filter.address)); - } - } - let fromBlock = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - let toBlock = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - if (address.filter((a) => typeof a !== "string").length || - (fromBlock != null && typeof fromBlock !== "string") || - (toBlock != null && typeof toBlock !== "string")) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - return resolve(address, fromBlock, toBlock); - } - _getTransactionRequest(_request) { - const request = copyRequest(_request); - const promises = []; - ["to", "from"].forEach((key) => { - if (request[key] == null) { - return; - } - const addr = resolveAddress(request[key]); - if (isPromise(addr)) { - promises.push((async function () { - request[key] = await addr; - })()); - } - else { - request[key] = addr; - } - }); - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise(blockTag)) { - promises.push((async function () { - request.blockTag = await blockTag; - })()); - } - else { - request.blockTag = blockTag; - } - } - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - return request; - } - async getNetwork() { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = this._detectNetwork().then((network) => { - this.emit("network", network, null); - return network; - }, (error) => { - // Reset the networkPromise on failure, so we will try again - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - }); - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - const networkPromise = this.#networkPromise; - const [expected, actual] = await Promise.all([ - networkPromise, - this._detectNetwork(), // The actual connected network - ]); - if (expected.networkId !== actual.networkId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } - else { - // Otherwise, we do not allow changes to the underlying network - assert(false, `network changed: ${expected.networkId} => ${actual.networkId} `, "NETWORK_ERROR", { - event: "changed", - }); - } - } - return expected.clone(); - } - async getEnergyPrice() { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new FeeData(energyPrice); - } - async getFeeData() { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new FeeData(energyPrice); - } - async estimateEnergy(_tx) { - let tx = this._getTransactionRequest(_tx); - if (isPromise(tx)) { - tx = await tx; - } - return getBigInt(await this.#perform({ - method: "estimateEnergy", - transaction: tx, - }), "%response"); - } - async #call(tx, blockTag, attempt) { - assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }), - }); - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = copyRequest(tx); - try { - return hexlify(await this._perform({ method: "call", transaction, blockTag })); - } - catch (error) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && - isCallException(error) && - error.data && - attempt >= 0 && - blockTag === "latest" && - transaction.to != null && - dataSlice(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - const txSender = await resolveAddress(transaction.to); - // Parse the CCIP Read Arguments - let ccipArgs; - try { - ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); - } - catch (error) { - assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", - transaction, - info: { data }, - }); - } - // Check the sender of the OffchainLookup matches the transaction - assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs, - }, - }); - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", - transaction, - info: { data: error.data, errorArgs: ccipArgs.errorArgs }, - }); - const tx = { - to: txSender, - data: concat([ - ccipArgs.selector, - encodeBytes([ccipResult, ccipArgs.extraData]), - ]), - }; - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { - action: "receiveCcipReadCallResult", - transaction: Object.assign({}, tx), - result, - }); - return result; - } - catch (error) { - this.emit("debug", { - action: "receiveCcipReadCallError", - transaction: Object.assign({}, tx), - error, - }); - throw error; - } - } - throw error; - } - } - async #checkNetwork(promise) { - const { value } = await resolveProperties({ - network: this.getNetwork(), - value: promise, - }); - return value; - } - async call(_tx) { - const { tx, blockTag } = await resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag), - }); - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); - } - // Account - async #getAccountValue(request, _address, _blockTag) { - let address = this._getAddress(_address); - let blockTag = this._getBlockTag(_blockTag); - if (typeof address !== "string" || typeof blockTag !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - async getBalance(address, blockTag) { - return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - async getTransactionCount(address, blockTag) { - return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - async getCode(address, blockTag) { - return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - async getStorage(address, _position, blockTag) { - const position = getBigInt(_position, "position"); - return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - // Write - async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx, - }), - network: this.getNetwork(), - }); - const tx = Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - async #getBlock(block, includeTransactions) { - // @TODO: Add CustomBlockPlugin check - if (isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", - blockHash: block, - includeTransactions, - }); - } - let blockTag = this._getBlockTag(block); - if (typeof blockTag !== "string") { - blockTag = await blockTag; - } - return await this.#perform({ - method: "getBlock", - blockTag, - includeTransactions, - }); - } - // Queries - async getBlock(block, prefetchTxs) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs), - }); - if (params == null) { - return null; - } - return this._wrapBlock(params, network); - } - async getTransaction(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }), - }); - if (params == null) { - return null; - } - return this._wrapTransactionResponse(params, network); - } - async getTransactionReceipt(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }), - }); - if (params == null) { - return null; - } - // Some backends did not backfill the effectiveEnergyPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.energyPrice == null && params.effectiveEnergyPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error("report this; could not find tx or effectiveEnergyPrice"); - } - params.effectiveEnergyPrice = tx.energyPrice; - } - return this._wrapTransactionReceipt(params, network); - } - async getTransactionResult(hash) { - const { result } = await resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }), - }); - if (result == null) { - return null; - } - return hexlify(result); - } - // Bloom-filter Queries - async getLogs(_filter) { - let filter = this._getFilter(_filter); - if (isPromise(filter)) { - filter = await filter; - } - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getLogs", filter }), - }); - return params.map((p) => this._wrapLog(p, network)); - } - // ENS - _getProvider(networkId) { - assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()", - }); - } - async waitForTransaction(hash, _confirms, timeout) { - const confirms = _confirms != null ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - return new Promise(async (resolve, reject) => { - let timer = null; - const listener = async (blockNumber) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } - catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }; - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - listener(await this.getBlockNumber()); - }); - } - async waitForBlock(blockTag) { - assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock", - }); - } - _clearTimeout(timerId) { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - _setTimeout(_func, timeout) { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } - else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime$1() }); - } - return timerId; - } - _forEachSubscriber(func) { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - // Event API; sub-classes should override this; any supported - // event filter will have been munged into an EventFilter - _getSubscriber(sub) { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": - return new PollingBlockSubscriber(this); - case "event": - return new PollingEventSubscriber(this, sub.filter); - case "transaction": - return new PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new PollingOrphanSubscriber(this, sub.filter); - } - throw new Error(`unsupported event: ${sub.type}`); - } - _recoverSubscriber(oldSub, newSub) { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - async #hasSub(event, emitArgs) { - let sub = await getSubscription(event); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && - emitArgs && - emitArgs.length > 0 && - emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }); - } - return this.#subs.get(sub.tag) || null; - } - async #getSub(event) { - const subscription = await getSubscription(event); - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { - subscriber, - tag, - addressableMap, - nameMap, - started: false, - listeners: [], - }; - this.#subs.set(tag, sub); - } - return sub; - } - async on(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async once(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async emit(event, ...args) { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new EventPayload(this, once ? null : listener, event); - try { - listener.call(this, ...args, payload); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return count > 0; - } - async listenerCount(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return this.off(event, listener); - } - // Sub-classes should override this to shutdown any sockets, etc. - // but MUST call this super.shutdown. - destroy() { - // Stop all listeners - this.removeAllListeners(); - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - } - get paused() { - return this.#pausedState != null; - } - set paused(pause) { - if (!!pause === this.paused) { - return; - } - if (this.paused) { - this.resume(); - } - else { - this.pause(false); - } - } - pause(dropWhilePaused) { - this.#lastBlockNumber = -1; - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause", - }); - } - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - // Remaining time needed for when we become unpaused - timer.time = getTime$1() - timer.time; - } - } - resume() { - if (this.#pausedState == null) { - return; - } - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime$1(); - // Start the timer - setTimeout(timer.func, timeout); - } - } - } - function _parseString(result, start) { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return toUtf8String(bytes); - } - } - catch (error) { } - return null; - } - function _parseBytes(result, start) { - if (result === "0x") { - return null; - } - try { - const offset = getNumber(dataSlice(result, start, start + 32)); - const length = getNumber(dataSlice(result, offset, offset + 32)); - return dataSlice(result, offset + 32, offset + 32 + length); - } - catch (error) { } - return null; - } - function numPad(value) { - const result = toBeArray(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; - } - function bytesPad(value) { - if (value.length % 32 === 0) { - return value; - } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; - } - const empty = new Uint8Array([]); - // ABI Encodes a series of (bytes, bytes, ...) - function encodeBytes(datas) { - const result = []; - let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - for (let i = 0; i < datas.length; i++) { - const data = getBytes(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } - return concat(result); - } - const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; - function parseOffchainLookup(data) { - const result = { - sender: "", - urls: [], - calldata: "", - selector: "", - extraData: "", - errorArgs: [], - }; - assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data", - }); - const sender = dataSlice(data, 0, 32); - assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender", - }); - result.sender = dataSlice(sender, 12); - // Read the URLs from the response - try { - const urls = []; - const urlsOffset = getNumber(dataSlice(data, 32, 64)); - const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); - const urlsData = dataSlice(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } - catch (error) { - assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls", - }); - } - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } - catch (error) { - assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata", - }); - } - // Get the callbackSelector (bytes4) - assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector", - }); - result.selector = dataSlice(data, 96, 100); - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } - catch (error) { - assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData", - }); - } - result.errorArgs = "sender,urls,calldata,selector,extraData" - .split(/,/) - .map((k) => result[k]); - return result; - } - - /** - * About Abstract Signer and subclassing - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ - function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); - } - async function populate(signer, tx) { - let pop = copyRequest(tx); - if (pop.to != null) { - pop.to = resolveAddress(pop.to); - } - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).then(([address, from]) => { - assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); - return address; - }); - } - else { - pop.from = signer.getAddress(); - } - return await resolveProperties(pop); - } - class AbstractSigner { - provider; - constructor(provider) { - defineProperties(this, { provider: provider || null }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.energyLimit == null) { - pop.energyLimit = await this.estimateEnergy(pop); - } - // Populate the chain ID - const network = await this.provider.getNetwork(); - if (pop.networkId != null) { - const networkId = getBigInt(pop.networkId); - assertArgument(networkId === network.networkId, "transaction networkId mismatch", "tx.networkId", tx.networkId); - } - else { - pop.networkId = network.networkId; - } - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - // We need to auto-detect the intended type of this transaction... - if (feeData.energyPrice != null) { - // Network doesn't support EIP-1559... - // Populate missing fee data - if (pop.energyPrice == null) { - pop.energyPrice = feeData.energyPrice; - } - } - else { - // getFeeData has failed us. - assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData", - }); - } - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await resolveProperties(pop); - } - async estimateEnergy(tx) { - return checkProvider(this, "estimateEnergy").estimateEnergy(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name) { - return getAddress(name); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } - } - class VoidSigner extends AbstractSigner { - address; - constructor(address, provider) { - super(provider); - defineProperties(this, { address }); - } - async getAddress() { - return this.address; - } - connect(provider) { - return new VoidSigner(this.address, provider); - } - #throwUnsupported(suffix, operation) { - assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { - operation, - }); - } - async signTransaction(tx) { - this.#throwUnsupported("transactions", "signTransaction"); - } - async signMessage(message) { - this.#throwUnsupported("messages", "signMessage"); - } - async signTypedData(domain, types, value) { - this.#throwUnsupported("typed-data", "signTypedData"); - } - } - - /** - * There are many awesome community services that provide Core - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ - // Show the throttle message only once per service - const shown = new Set(); - /** - * Displays a warning in tht console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ - function showThrottleMessage(service) { - if (shown.has(service)) { - return; - } - shown.add(service); - console.log("========= NOTICE ========="); - console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); - } - - function copy(obj) { - return JSON.parse(JSON.stringify(obj)); - } - /** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ - class FilterIdSubscriber { - #provider; - #filterIdPromise; - #poller; - #running; - #network; - #hault; - constructor(provider) { - this.#provider = provider; - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#network = null; - this.#hault = false; - } - _subscribe(provider) { - throw new Error("subclasses must override this"); - } - _emitResults(provider, result) { - throw new Error("subclasses must override this"); - } - _recover(provider) { - throw new Error("subclasses must override this"); - } - async #poll(blockNumber) { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - // Get the Filter ID - let filterId = null; - try { - filterId = await this.#filterIdPromise; - } - catch (error) { - if (!isError(error, "UNSUPPORTED_OPERATION") || - error.operation !== "xcb_newFilter") { - throw error; - } - } - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - if (this.#network.networkId !== network.networkId) { - throw new Error("chaid changed"); - } - if (this.#hault) { - return; - } - const result = await this.#provider.send("xcb_getFilterChanges", [ - filterId, - ]); - await this._emitResults(this.#provider, result); - } - catch (error) { - console.log("@TODO", error); - } - this.#provider.once("block", this.#poller); - } - #teardown() { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - this.#provider.send("xcb_uninstallFilter", [filterId]); - }); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - resume() { - this.start(); - } - } - /** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ - class FilterIdEventSubscriber extends FilterIdSubscriber { - #event; - constructor(provider, filter) { - super(provider); - this.#event = copy(filter); - } - _recover(provider) { - return new PollingEventSubscriber(provider, this.#event); - } - async _subscribe(provider) { - const filterId = await provider.send("xcb_newFilter", [this.#event]); - return filterId; - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } - } - /** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ - class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider) { - return await provider.send("xcb_newPendingTransactionFilter", []); - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit("pending", result); - } - } - } - - /** - * About JSON-RPC... - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ - // @TODO: - // - Add the batching API - const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); - //const Methods = "getAddress,then".split(/,/g); - function deepCopy(value) { - if (value == null || Primitive.indexOf(typeof value) >= 0) { - return value; - } - // Keep any Addressable - if (typeof value.getAddress === "function") { - return value; - } - if (Array.isArray(value)) { - return value.map(deepCopy); - } - if (typeof value === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = value[key]; - return accum; - }, {}); - } - throw new Error(`should not happen: ${value} (${typeof value})`); - } - function stall$3(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); - } - function getLowerCase(value) { - if (value) { - return value.toLowerCase(); - } - return value; - } - function isPollable(value) { - return value && typeof value.pollingInterval === "number"; - } - const defaultOptions = { - polling: false, - staticNetwork: null, - batchStallTime: 10, - batchMaxSize: 1 << 20, - batchMaxCount: 100, // 100 requests - }; - // @TODO: Unchecked Signers - class JsonRpcSigner extends AbstractSigner { - address; - constructor(provider, address) { - super(provider); - address = getAddress(address); - defineProperties(this, { address }); - } - connect(provider) { - assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect", - }); - } - async getAddress() { - return this.address; - } - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx) { - return await this.populateCall(tx); - } - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx) { - const tx = deepCopy(_tx); - const promises = []; - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await resolveAddress(_from); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } - else { - tx.from = this.address; - } - // The JSON-RPC for xcb_sendTransaction uses 90000 energy; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.energyLimit == null) { - promises.push((async () => { - tx.energyLimit = await this.provider.estimateEnergy({ - ...tx, - from: this.address, - }); - })()); - } - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await resolveAddress(_to); - })()); - } - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - const hexTx = this.provider.getRpcTransaction(tx); - return this.provider.send("xcb_sendTransaction", [hexTx]); - } - async sendTransaction(tx) { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - const checkTx = async () => { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - // Wait another 4 seconds - this.provider._setTimeout(() => { - checkTx(); - }, timeouts.pop() || 4000); - }; - checkTx(); - }); - } - async signTransaction(_tx) { - const tx = deepCopy(_tx); - // Make sure the from matches the sender - if (tx.from) { - const from = await resolveAddress(tx.from); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - } - else { - tx.from = this.address; - } - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("xcb_signTransaction", [hexTx]); - } - async signMessage(_message) { - const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("personal_sign", [ - hexlify(message), - this.address.toLowerCase(), - ]); - } - async signTypedData(domain, types, _value) { - const value = deepCopy(_value); - // Populate any ENS names (in-place) - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await resolveAddress(value); - assertArgument(address != null, "TypedData does not support null address", "value", value); - return address; - }); - return await this.provider.send("xcb_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value)), - ]); - } - async unlock(password) { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), - password, - null, - ]); - } - async _legacySignMessage(_message) { - const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("xcb_sign", [ - this.address.toLowerCase(), - hexlify(message), - ]); - } - } - /** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ - class JsonRpcApiProvider extends AbstractProvider { - #options; - // The next ID to use for the JSON-RPC ID field - #nextId; - // Payloads are queued and triggered in batches using the drainTimer - #payloads; - #drainTimer; - #notReady; - #network; - #scheduleDrain() { - if (this.#drainTimer) { - return; - } - // If we aren't using batching, no hard in sending it immeidately - const stallTime = this._getOption("batchMaxCount") === 1 - ? 0 - : this._getOption("batchStallTime"); - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - const payloads = this.#payloads; - this.#payloads = []; - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [payloads.shift()]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push(payloads.shift()); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift(batch.pop()); - break; - } - } - // Process the result to each payload - (async () => { - const payload = batch.length === 1 ? batch[0].payload : batch.map((p) => p.payload); - this.emit("debug", { action: "sendRpcPayload", payload }); - try { - // console.log({payload}) - const result = await this._send(payload); - // console.log({result}) - this.emit("debug", { action: "receiveRpcResult", result }); - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - // Find the matching result - const resp = result.filter((r) => r.id === payload.id)[0]; - // No result; the node failed us in unexpected ways - if (resp == null) { - return reject(makeError("no response from server", "BAD_DATA", { - value: result, - info: { payload }, - })); - } - // The response is an error - if ("error" in resp) { - return reject(this.getRpcError(payload, resp)); - } - // All good; send the result - resolve(resp.result); - } - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - constructor(network, options) { - super(network); - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - this.#payloads = []; - this.#drainTimer = null; - this.#network = null; - { - let resolve = null; - const promise = new Promise((_resolve) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - // Make sure any static network is compatbile with the provided netwrok - const staticNetwork = this._getOption("staticNetwork"); - if (staticNetwork) { - assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key) { - return this.#options[key]; - } - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network() { - assert(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - /* - { - assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { - operation: "jsonRpcApiProvider._send" - }); - } - */ - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req) { - const request = this.getRpcRequest(req); - if (request != null) { - return await this.send(request.method, request.args); - } - return super._perform(req); - } - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork() { - const network = this._getOption("staticNetwork"); - if (network) { - return network; - } - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - return Network.from(getBigInt(await this.send("xcb_networkId", []))); - } - // We are not ready yet; use the primitive _send - const payload = { - id: this.#nextId++, - method: "xcb_networkId", - params: [], - jsonrpc: "2.0", - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return Network.from(getBigInt(result.result)); - } - throw this.getRpcError(payload, result); - } - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start() { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - this.#notReady.resolve(); - this.#notReady = null; - (async () => { - // Bootstrap the network - while (this.#network == null) { - try { - this.#network = await this._detectNetwork(); - } - catch (error) { - console.log("JsonRpcProvider failed to startup; retry in 1s"); - await stall$3(1000); - } - } - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady() { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub) { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new FilterIdPendingSubscriber(this); - } - if (sub.type === "event") { - if (this._getOption("polling")) { - return new PollingEventSubscriber(this, sub.filter); - } - return new FilterIdEventSubscriber(this, sub.filter); - } - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("orphan"); - } - return super._getSubscriber(sub); - } - /** - * Returns true only if the [[_start]] has been called. - */ - get ready() { - return this.#notReady == null; - } - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx) { - const result = {}; - // JSON-RPC now requires numeric values to be "quantity" values - [ - "networkId", - "energyLimit", - "energyPrice", - "type", - "nonce", - "value", - ].forEach((key) => { - if (tx[key] == null) { - return; - } - let dstKey = key; - if (key === "energyLimit") { - dstKey = "energy"; - } - result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`)); - }); - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if (tx[key] == null) { - return; - } - result[key] = hexlify(tx[key]); - }); - return result; - } - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req) { - switch (req.method) { - case "networkId": - return { method: "xcb_networkId", args: [] }; - case "getBlockNumber": - return { method: "xcb_blockNumber", args: [] }; - case "getEnergyPrice": - return { method: "xcb_energyPrice", args: [] }; - case "getBalance": { - return { - method: "xcb_getBalance", - args: [getLowerCase(req.address), req.blockTag], - }; - } - case "getTransactionCount": - return { - method: "xcb_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getCode": - return { - method: "xcb_getCode", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getStorage": - return { - method: "xcb_getStorageAt", - args: [ - getLowerCase(req.address), - "0x" + req.position.toString(16), - req.blockTag, - ], - }; - case "broadcastTransaction": - return { - method: "xcb_sendRawTransaction", - args: [req.signedTransaction], - }; - case "getBlock": - if ("blockTag" in req) { - return { - method: "xcb_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions], - }; - } - else if ("blockHash" in req) { - return { - method: "xcb_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions], - }; - } - break; - case "getTransaction": - return { - method: "xcb_getTransactionByHash", - args: [req.hash], - }; - case "getTransactionReceipt": - return { - method: "xcb_getTransactionReceipt", - args: [req.hash], - }; - case "call": - return { - method: "xcb_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag], - }; - case "estimateEnergy": { - return { - method: "xcb_estimateEnergy", - args: [this.getRpcTransaction(req.transaction)], - }; - } - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } - else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "xcb_getLogs", args: [req.filter] }; - } - return null; - } - /** - * Returns an CoreBC-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload, _error) { - const { method } = payload; - const { error } = _error; - if (method === "xcb_estimateEnergy" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: payload.params[0], - info: { payload, error }, - }); - } - } - if (method === "xcb_call" || method === "xcb_estimateEnergy") { - const result = spelunkData(error); - const e = AbiCoder.getBuiltinCallException(method === "xcb_call" ? "call" : "estimateEnergy", payload.params[0], result ? result.data : null); - e.info = { error, payload }; - return e; - } - // Only estimateEnergy and call can return arbitrary contract-defined text, so now we - // we can process text safely. - const message = JSON.stringify(spelunkMessage(error)); - if (typeof error.message === "string" && - error.message.match(/user denied|corebc-user-denied/i)) { - const actionMap = { - xcb_sign: "signMessage", - personal_sign: "signMessage", - xcb_signTypedData_v4: "signTypedData", - xcb_signTransaction: "signTransaction", - xcb_sendTransaction: "sendTransaction", - xcb_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - return makeError(`user rejected action`, "ACTION_REJECTED", { - action: actionMap[method] || "unknown", - reason: "rejected", - info: { payload, error }, - }); - } - if (method === "xcb_sendRawTransaction" || - method === "xcb_sendTransaction") { - const transaction = payload.params[0]; - if (message.match(/insufficient funds|base fee exceeds energy limit/i)) { - return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, - info: { error }, - }); - } - if (message.match(/nonce/i) && message.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction, - info: { error }, - }); - } - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && - message.match(/underpriced/i)) { - return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction, - info: { error }, - }); - } - if (message.match(/only replay-protected/i)) { - return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, - info: { transaction, info: { error } }, - }); - } - } - if (message.match(/the method .* does not exist/i)) { - return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, - info: { error }, - }); - } - return makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); - } - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method, params) { - // @TODO: cache networkId?? purge on switch_networks - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, - reject, - payload: { method, params, id, jsonrpc: "2.0" }, - }); - }); - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - return promise; - } - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address) { - if (address == null) { - address = 0; - } - const accountsPromise = this.send("xcb_accounts", []); - // Account index - if (typeof address === "number") { - const accounts = await accountsPromise; - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - const { accounts } = await resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise, - }); - // Account address - address = getAddress(address); - for (const account of accounts) { - if (getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - throw new Error("invalid account"); - } - async listAccounts() { - const accounts = await this.send("xcb_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } - } - class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval; - constructor(network, options) { - super(network, options); - this.#pollingInterval = 4000; - } - _getSubscriber(sub) { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval() { - return this.#pollingInterval; - } - set pollingInterval(value) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } - } - /** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ - class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect; - constructor(url, network, options) { - if (url == null) { - url = "http://localhost:8545"; - } - super(network, options); - if (typeof url === "string") { - this.#connect = new FetchRequest(url); - } - else { - this.#connect = url.clone(); - } - } - _getConnection() { - return this.#connect.clone(); - } - async send(method, params) { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. xcb_networkId) until we absolutely have to. - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - return resp; - } - } - function spelunkData(value) { - if (value == null) { - return null; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string" && - value.message.match("reverted") && - isHexString(value.data)) { - return { message: value.message, data: value.data }; - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return spelunkData(JSON.parse(value)); - } - catch (error) { } - } - return null; - } - function _spelunkMessage(value, result) { - if (value == null) { - return; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string") { - result.push(value.message); - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } - catch (error) { } - } - } - function spelunkMessage(value) { - const result = []; - _spelunkMessage(value, result); - return result; - } - - /** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ - const defaultApiKey$1 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; - function getHost$4(name) { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/xcb_goerli"; - case "matic": - return "rpc.ankr.com/polygon"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ - class AnkrProvider extends JsonRpcProvider { - /** - * The API key for the Ankr connection. - */ - apiKey; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AnkrProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - const request = new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey$1) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("AnkrProvider"); - return true; - }; - } - return request; - } - getRpcError(payload, error) { - if (payload.method === "xcb_sendRawTransaction") { - if (error && - error.error && - error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - return super.getRpcError(payload, error); - } - isCommunityResource() { - return this.apiKey === defaultApiKey$1; - } - } - - /** - * About Alchemy - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ - const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; - function getHost$3(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.alchemyapi.io"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ - class AlchemyProvider extends JsonRpcProvider { - apiKey; - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AlchemyProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - async _perform(req) { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await resolveProperties({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash), - }); - if (trace == null || tx == null) { - return null; - } - let data; - let error = false; - try { - data = trace[0].result.output; - error = trace[0].error === "Reverted"; - } - catch (error) { } - if (data) { - assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null, // @TODO - }); - return data; - } - assert(false, "could not parse trace result", "BAD_DATA", { - value: trace, - }); - } - return await super._perform(req); - } - isCommunityResource() { - return this.apiKey === defaultApiKey; - } - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("alchemy"); - return true; - }; - } - return request; - } - } - - /** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ - /** - * About Cloudflare... - */ - class CloudflareProvider extends JsonRpcProvider { - constructor(_network) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - assertArgument(network.name === "mainnet", "unsupported network", "network", _network); - super("https://cloudflare-eth.com/", network, { staticNetwork: network }); - } - } - - function getGlobal() { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); - } - const _WebSocket = getGlobal().WebSocket; - - /** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider - */ - class SocketSubscriber { - #provider; - #filter; - get filter() { - return JSON.parse(this.#filter); - } - #filterId; - #paused; - #emitPromise; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - start() { - this.#filterId = this.#provider - .send("xcb_subscribe", this.filter) - .then((filterId) => { - this.#provider._register(filterId, this); - return filterId; - }); - } - stop() { - this.#filterId.then((filterId) => { - this.#provider.send("xcb_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused) { - assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - resume() { - this.#paused = null; - } - _handleMessage(message) { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } - else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - async _emit(provider, message) { - throw new Error("sub-classes must implemente this; _emit"); - } - } - class SocketBlockSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newHeads"]); - } - async _emit(provider, message) { - provider.emit("block", parseInt(message.number)); - } - } - class SocketPendingSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newPendingTransactions"]); - } - async _emit(provider, message) { - provider.emit("pending", message); - } - } - class SocketEventSubscriber extends SocketSubscriber { - #logFilter; - get logFilter() { - return JSON.parse(this.#logFilter); - } - constructor(provider, filter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - async _emit(provider, message) { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } - } - /** - * SocketProvider... - * - */ - class SocketProvider extends JsonRpcApiProvider { - #callbacks; - // Maps each filterId to its subscriber - #subs; - // If any events come in before a subscriber has finished - // registering, queue them - #pending; - constructor(network) { - super(network, { batchMaxCount: 1 }); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - _getSubscriber(sub) { - switch (sub.type) { - case "close": - return new UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - _register(filterId, subscriber) { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - async _send(payload) { - // WebSocket provider doesn't accept batches - assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - // @TODO: stringify payloads here and store to prevent mutations - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - // Write the request to the socket - await this._write(JSON.stringify(payload)); - return [await promise]; - } - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - // Sub-classes must call this for each message - async _processMessage(message) { - const result = (JSON.parse(message)); - if ("id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result, - })); - return; - } - this.#callbacks.delete(result.id); - callback.resolve(result); - } - else if (result.method === "xcb_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } - else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - } - async _write(message) { - throw new Error("sub-classes must override this"); - } - } - - class WebSocketProvider extends SocketProvider { - #connect; - #websocket; - get websocket() { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } - constructor(url, network) { - super(network); - if (typeof url === "string") { - this.#connect = () => { - return new _WebSocket(url); - }; - this.#websocket = this.#connect(); - } - else if (typeof url === "function") { - this.#connect = url; - this.#websocket = url(); - } - else { - this.#connect = null; - this.#websocket = url; - } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } - catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - this.websocket.onmessage = (message) => { - this._processMessage(message.data); - }; - /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; - */ - } - async _write(message) { - this.websocket.send(message); - } - async destroy() { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } - } - - /** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ - const defaultProjectId = "84842078b09946638c03157f83405213"; - function getHost$2(name) { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ - class InfuraWebSocketProvider extends WebSocketProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network, projectId) { - const provider = new InfuraProvider(network, projectId); - const req = provider._getConnection(); - assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, network); - defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret, - }); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } - } - /** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ - class InfuraProvider extends JsonRpcProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network, projectId, projectSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - defineProperties(this, { projectId, projectSecret }); - } - _getProvider(networkId) { - try { - return new InfuraProvider(networkId, this.projectId, this.projectSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network, projectId) { - return new InfuraWebSocketProvider(network, projectId); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network, projectId, projectSecret) { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("InfuraProvider"); - return true; - }; - } - return request; - } - } - - /** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ - const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; - function getHost$1(name) { - switch (name) { - case "mainnet": - return "corebc.quiknode.pro"; - case "arbitrum": - return "corebc.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "corebc.arbitrum-goerli.quiknode.pro"; - case "matic": - return "corebc.matic.quiknode.pro"; - case "matic-mumbai": - return "corebc.matic-testnet.quiknode.pro"; - case "optimism": - return "corebc.optimism.quiknode.pro"; - case "optimism-goerli": - return "corebc.optimism-goerli.quiknode.pro"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ - class QuickNodeProvider extends JsonRpcProvider { - /** - * The API token. - */ - token; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network, token) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (token == null) { - token = defaultToken; - } - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - defineProperties(this, { token }); - } - _getProvider(networkId) { - try { - return new QuickNodeProvider(networkId, this.token); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.token === defaultToken; - } - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network, token) { - if (token == null) { - token = defaultToken; - } - const request = new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - return request; - } - } - - /** - * Explain all the nitty-gritty about the **FallbackProvider**. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ - const BN_1 = BigInt("1"); - const BN_2 = BigInt("2"); - function shuffle(array) { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } - } - function stall$2(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); - } - function getTime() { - return new Date().getTime(); - } - function stringify(value) { - return JSON.stringify(value, (key, value) => { - if (typeof value === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); - } - const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; - const defaultState = { - blockNumber: -2, - requests: 0, - lateResponses: 0, - errorResponses: 0, - outOfSync: -1, - unsupportedEvents: 0, - rollingDuration: 0, - score: 0, - _network: null, - _updateNumber: null, - _totalTime: 0, - }; - async function waitForSync(config, blockNumber) { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - } - } - function _normalize(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[" + value.map(_normalize).join(",") + "]"; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return _normalize(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{" + - keys - .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`) - .join(",") + - "}"); - } - } - console.log("Could not serialize", value); - throw new Error("Hmm..."); - } - function normalizeResult(value) { - if ("error" in value) { - const error = value.error; - return { tag: _normalize(error), value: error }; - } - const result = value.result; - return { tag: _normalize(result), value: result }; - } - // This strategy picks the highest weight result, as long as the weight is - // equal to or greater than quorum - function checkQuorum(quorum, results) { - const tally = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - let best = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - if (best) { - return best.value; - } - return undefined; - } - function getMedian(quorum, results) { - let resultWeight = 0; - const errorMap = new Map(); - let bestError = null; - const values = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } - else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - // We do not have quorum for a result - return undefined; - } - // Get the sorted values - values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0)); - const mid = Math.floor(values.length / 2); - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; - } - function getAnyResult(quorum, results) { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - // Nope! - return undefined; - } - function getFuzzyMode(quorum, results) { - if (quorum === 1) { - return getNumber(getMedian(quorum, results), "%internal"); - } - const tally = new Map(); - const add = (result, weight) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - for (const { weight, value } of results) { - const r = getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - let bestWeight = 0; - let bestResult = undefined; - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && - (weight > bestWeight || - (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - return bestResult; - } - /** - * A Fallback Provider. - * - */ - class FallbackProvider extends AbstractProvider { - quorum; - eventQuorum; - eventWorkers; - #configs; - #height; - #initialSyncPromise; - constructor(providers, network) { - super(network); - this.#configs = providers.map((p) => { - if (p instanceof AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } - else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - this.#height = -2; - this.#initialSyncPromise = null; - this.quorum = 2; //Math.ceil(providers.length / 2); - this.eventQuorum = 1; - this.eventWorkers = 1; - assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), "quorum exceed provider wieght", "quorum", this.quorum); - } - get providerConfigs() { - return this.#configs.map((c) => { - const result = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - async _detectNetwork() { - return Network.from(getBigInt(await this._perform({ method: "networkId" }))); - } - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - async _translatePerform(provider, req) { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); - case "networkId": - return (await provider.getNetwork()).networkId; - case "estimateEnergy": - return await provider.estimateEnergy(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = "blockHash" in req ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getEnergyPrice": - return (await provider.getFeeData()).energyPrice; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running) { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - const configs = Array.from(running).map((r) => r.config); - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => b.priority - a.priority); - for (const config of allConfigs) { - if (configs.indexOf(config) === -1) { - return config; - } - } - return null; - } - // Adds a new runner (if available) to running. - #addRunner(running, req) { - const config = this.#getNextConfig(running); - // No runners available - if (config == null) { - return null; - } - // Create a new runner - const runner = { - config, - result: null, - didBump: false, - perform: null, - staller: null, - }; - const now = getTime(); - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } - catch (error) { - config.errorResponses++; - runner.result = { error }; - } - const dt = getTime() - now; - config._totalTime += dt; - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - runner.perform = null; - })(); - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall$2(config.stallTimeout); - runner.staller = null; - })(); - running.add(runner); - return runner; - } - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync() { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises = []; - this.#configs.forEach((config) => { - promises.push(waitForSync(config, 0)); - promises.push((async () => { - config._network = await config.provider.getNetwork(); - })()); - }); - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - // Check all the networks match - let networkId = null; - for (const config of this.#configs) { - const network = config._network; - if (networkId == null) { - networkId = network.networkId; - } - else if (network.networkId !== networkId) { - assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider", - }); - } - } - })(); - } - await initialSync; - } - async #checkQuorum(running, req) { - // Get all the result objects - const results = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) { - return undefined; - } - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({ - value: c.blockNumber, - tag: getNumber(c.blockNumber).toString(), - weight: c.weight, - }))))); - } - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - case "getEnergyPrice": - case "estimateEnergy": - return getMedian(this.quorum, results); - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - case "call": - case "networkId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify(req.method)})`, - }); - } - async #waitForQuorum(running, req) { - if (running.size === 0) { - throw new Error("no runners?!"); - } - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting = []; - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - // All providers have returned, and we have no result - assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { - request: req, - results: Array.from(running).map((r) => stringify(r.result)), - }, - }); - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - async _perform(req) { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => { - try { - const result = await provider._perform(req); - return Object.assign(normalizeResult({ result }), { weight }); - } - catch (error) { - return Object.assign(normalizeResult({ error }), { weight }); - } - })); - const result = getAnyResult(this.quorum, results); - assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) }, - }); - if (result instanceof Error) { - throw result; - } - return result; - } - await this.#initialSync(); - // Bootstrap enough runners to meet quorum - const running = new Set(); - for (let i = 0; i < this.quorum; i++) { - this.#addRunner(running, req); - } - const result = await this.#waitForQuorum(running, req); - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - return result; - } - async destroy() { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } - } - - function isWebSocketLike(value) { - return (value && - typeof value.send === "function" && - typeof value.close === "function"); - } - function getDefaultProvider(network, options) { - if (options == null) { - options = {}; - } - if (typeof network === "string" && network.match(/^https?:/)) { - return new JsonRpcProvider(network); - } - if ((typeof network === "string" && network.match(/^wss?:/)) || - isWebSocketLike(network)) { - return new WebSocketProvider(network); - } - const providers = []; - if (options.alchemy !== "-") { - try { - providers.push(new AlchemyProvider(network, options.alchemy)); - } - catch (error) { - console.log(error); - } - } - if (options.ankr !== "-" && options.ankr != null) { - try { - providers.push(new AnkrProvider(network, options.ankr)); - } - catch (error) { - console.log(error); - } - } - if (options.cloudflare !== "-") { - try { - providers.push(new CloudflareProvider(network)); - } - catch (error) { - console.log(error); - } - } - if (options.infura !== "-") { - try { - let projectId = options.infura; - let projectSecret = undefined; - if (typeof projectId === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new InfuraProvider(network, projectId, projectSecret)); - } - catch (error) { - console.log(error); - } - } - /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } - */ - if (options.quicknode !== "-") { - try { - let token = options.quicknode; - providers.push(new QuickNodeProvider(network, token)); - } - catch (error) { - console.log(error); - } - } - assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider", - }); - if (providers.length === 1) { - return providers[0]; - } - return new FallbackProvider(providers); - } - - class NonceManager extends AbstractSigner { - signer; - #noncePromise; - #delta; - constructor(signer) { - super(signer.provider); - defineProperties(this, { signer }); - this.#noncePromise = null; - this.#delta = 0; - } - async getAddress() { - return this.signer.getAddress(); - } - connect(provider) { - return new NonceManager(this.signer.connect(provider)); - } - async getNonce(blockTag) { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - return super.getNonce(blockTag); - } - increment() { - this.#delta++; - } - reset() { - this.#delta = 0; - this.#noncePromise = null; - } - async sendTransaction(tx) { - const noncePromise = this.getNonce("pending"); - this.increment(); - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - signTransaction(tx) { - return this.signer.signTransaction(tx); - } - signMessage(message) { - return this.signer.signMessage(message); - } - signTypedData(domain, types, value) { - return this.signer.signTypedData(domain, types, value); - } - } - - class BrowserProvider extends JsonRpcApiPollingProvider { - #request; - constructor(core, network) { - super(network, { batchMaxCount: 1 }); - this.#request = async (method, params) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await core.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } - catch (e) { - const error = new Error(e.message); - error.code = e.code; - error.data = e.data; - error.payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - async send(method, params) { - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } - catch (e) { - return [ - { - id: payload.id, - error: { code: e.code, data: e.data, message: e.message }, - }, - ]; - } - } - getRpcError(payload, error) { - error = JSON.parse(JSON.stringify(error)); - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into - switch (error.error.code || -1) { - case 4001: - error.error.message = `corebc-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `corebc-unsupported: ${error.error.message}`; - break; - } - return super.getRpcError(payload, error); - } - async hasSigner(address) { - if (address == null) { - address = 0; - } - const accounts = await this.send("xcb_accounts", []); - if (typeof address === "number") { - return accounts.length > address; - } - address = address.toLowerCase(); - return (accounts.filter((a) => a.toLowerCase() === address).length !== 0); - } - async getSigner(address) { - if (address == null) { - address = 0; - } - if (!(await this.hasSigner(address))) { - try { - //const resp = - await this.#request("xcb_requestAccounts", []); - //console.log("RESP", resp); - } - catch (error) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - return await super.getSigner(address); - } - } - - /** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ - const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; - function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ - class PocketProvider extends JsonRpcProvider { - /** - * The Application ID for the Pocket connection. - */ - applicationId; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - applicationSecret; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, applicationId, applicationSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - const options = { staticNetwork: network }; - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - defineProperties(this, { - applicationId, - applicationSecret, - }); - } - _getProvider(networkId) { - try { - return new PocketProvider(networkId, this.applicationId, this.applicationSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network, applicationId, applicationSecret) { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); - request.allowGzip = true; - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("PocketProvider"); - return true; - }; - } - return request; - } - isCommunityResource() { - return this.applicationId === defaultApplicationId; - } - } - - const IpcSocketProvider = undefined; - - /** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ - class BaseWallet extends AbstractSigner { - /** - * The wallet address. - */ - address; - prefix; - #signingKey; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor({ signingKey, prefix, provider, }) { - super(provider); - this.prefix = prefix; - assertArgument(signingKey && typeof signingKey.sign === "function", "invalid signingKey key", "signingKey", "[ REDACTED ]"); - this.#signingKey = signingKey; - const address = computeAddress(this.#signingKey, prefix); - defineProperties(this, { address }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { - return this.#signingKey; - } - /** - * The private key for this wallet. - */ - get privateKey() { - return this.signingKey.privateKey; - } - async getAddress() { - return this.address; - } - connect(provider) { - return new BaseWallet({ - signingKey: this.#signingKey, - prefix: this.prefix, - provider, - }); - } - async signTransaction(tx) { - // Replace any Addressable or ENS name with an address - const { to, from } = await resolveProperties({ - to: tx.to || undefined, - from: tx.from || undefined, - }); - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - assertArgument(getAddress(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - // Build the transaction - const btx = Transaction.from(tx); - const unSignedSerialized = btx.unsignedSerialized; - const unsignedHash = sha256(unSignedSerialized); - // sha256(btx.unsignedSerialized) - btx.signature = this.signingKey.sign(unsignedHash); - return btx.serialized; - } - async signMessage(message) { - return this.signMessageSync(message); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message) { - return this.signingKey.sign(hashMessage(message)); - } - async signTypedData(domain, types, value) { - // Populate any ENS names - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name }, - }); - const address = getAddress(name); - assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name, - }); - return address; - }); - return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)); - } - } - - const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; - const Word = /^[a-z]*$/i; - function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); - } - /** - * @_ignore - */ - function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); - } - /** - * @_ignore - */ - function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); - } - - /** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ - class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } - static check(wordlist) { - const words = []; - for (let i = 0; i < 2048; i++) { - const word = wordlist.getWord(i); - /* istanbul ignore if */ - if (i !== wordlist.getWordIndex(word)) { - return "0x"; - } - words.push(word); - } - return id(words.join("\n") + "\n"); - } - } - - // Use the encode-latin.js script to create the necessary - // data files to be consumed by this class - /** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ - class WordlistOwl extends Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - get _data() { - return this.#data; - } - _decodeWords() { - return decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n", true); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } - } - - const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?k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Wd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; - const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; - let wordlist = null; - /** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ - class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { - super("en", words, checksum); - } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } - } - - function mnemonicToSeed(mnemonic, password) { - if (!password) { - password = ""; - } - const t = generateSeed(mnemonic, password); - return t.goldilock; - } - const generateSeed = (mnemonic, password) => { - const goldilockSaltPrefix = "mnemonic"; - const aesSaltPrefix = "mnemonicfortheAESkey"; - const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); - const aesSalt = utf8.encode(aesSaltPrefix + password); - const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), goldilockSalt, 2048, 64, "sha512"); - const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), aesSalt, 2048, 64, "sha512"); - return { - aes: aesKeySeed.toString("hex"), - goldilock: goldilockKey.toString("hex"), - }; - }; - - // Returns a byte with the MSB bits set - function getUpperMask(bits) { - return (((1 << bits) - 1) << (8 - bits)) & 0xff; - } - // Returns a byte with the LSB bits set - function getLowerMask(bits) { - return ((1 << bits) - 1) & 0xff; - } - function mnemonicToEntropy(mnemonic, wordlist) { - assertNormalize("NFKD"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const words = wordlist.split(mnemonic); - assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8)); - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= 1 << (7 - (offset % 8)); - } - offset++; - } - } - const entropyBits = (32 * words.length) / 3; - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return hexlify(entropy.slice(0, entropyBits / 8)); - } - function entropyToMnemonic(entropy, wordlist) { - assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - remainingBits -= 8; - // This byte will complete an 11-bit index - } - else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) & - getUpperMask(checksumBits); - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= checksum >> (8 - checksumBits); - return wordlist.join(indices.map((index) => wordlist.getWord(index))); - } - const _guard$1 = {}; - /** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ - class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - phrase; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - password; - /** - * The wordlist for this mnemonic. - */ - wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - entropy; - /** - * @private - */ - constructor(guard, entropy, phrase, password, wordlist) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - assertPrivate(guard, _guard$1, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - return mnemonicToSeed(this.phrase, this.password); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase({ phrase, password, wordlist, }) { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(getBytes(entropy), wordlist); - return new Mnemonic(_guard$1, entropy, phrase, password, wordlist); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard$1, hexlify(entropy), phrase, password, wordlist); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist) { - return mnemonicToEntropy(phrase, wordlist); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist) { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } - catch (error) { } - return false; - } - } - - /** - * @_ignore - */ - function looseArrayify(hexString) { - if (typeof hexString === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return getBytesCopy(hexString); - } - function zpad(value, length) { - value = String(value); - while (value.length < length) { - value = "0" + value; - } - return value; - } - function getPassword(password) { - if (typeof password === "string") { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); - } - function spelunk(object, _path) { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - assertArgument(match != null, "invalid path", "path", _path); - const path = match[1]; - const type = match[3]; - const reqd = match[4] === "!"; - let cur = object; - for (const comp of path.toLowerCase().split(".")) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } - else if (typeof cur === "object") { - let found = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } - else { - cur = null; - } - if (cur == null) { - break; - } - } - assertArgument(!reqd || cur != null, "missing required value", "path", path); - if (type && cur != null) { - if (type === "int") { - if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } - else if (Number.isSafeInteger(cur)) { - return cur; - } - } - if (type === "number") { - if (typeof cur === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - if (type === "data") { - if (typeof cur === "string") { - return looseArrayify(cur); - } - } - if (type === "array" && Array.isArray(cur)) { - return cur; - } - if (type === typeof cur) { - return cur; - } - assertArgument(false, `wrong type found for ${type} `, "path", path); - } - return cur; - } - /* - export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; - } - - // "path/to/something:type!" - export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); - } - */ - // See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - /* - export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); - } - */ - - /** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Core along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ - // @ts-ignore - const { CTR } = pkg; - const defaultPath$1 = "m/44'/60'/0'/0/0"; - /** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ - function isKeystoreJson(json) { - try { - const data = JSON.parse(json); - const version = data.version != null ? parseInt(data.version) : 0; - if (version === 3) { - return true; - } - } - catch (error) { } - return false; - } - function decrypt(data, key, ciphertext) { - const cipher = spelunk(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, iv); - return hexlify(aesCtr.decrypt(ciphertext)); - } - assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt", - }); - } - function getAccount(data, _key) { - const key = getBytes(_key); - const ciphertext = spelunk(data, "crypto.ciphertext:data!"); - const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2); - assertArgument(computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - const address = getAddress(data.address); - const prefix = extractPrefix(address); - if (computeAddress(privateKey, prefix) !== address) { - throw new Error("address mismatch"); - } - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); - } - const account = { address, privateKey }; - // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase - const version = spelunk(data, "x-corebc.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = spelunk(data, "x-corebc.mnemonicCiphertext:data!"); - const mnemonicIv = spelunk(data, "x-corebc.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - account.mnemonic = { - path: spelunk(data, "x-corebc.path:string") || defaultPath$1, - locale: spelunk(data, "x-corebc.locale:string") || "en", - entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))), - }; - } - return account; - } - function getDecryptKdfParams(data) { - const kdf = spelunk(data, "crypto.kdf:string"); - if (kdf && typeof kdf === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const N = spelunk(data, "crypto.kdfparams.n:int!"); - const r = spelunk(data, "crypto.kdfparams.r:int!"); - const p = spelunk(data, "crypto.kdfparams.p:int!"); - // Make sure N is a power of 2 - assertArgument(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - assertArgument(r > 0 && p > 0, "invalid kdf", "kdf", kdf); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } - else if (kdf.toLowerCase() === "pbkdf2") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const prf = spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - assertArgument(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = spelunk(data, "crypto.kdfparams.c:int!"); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { name: "pbkdf2", salt, count, dkLen, algorithm }; - } - } - assertArgument(false, "unsupported key-derivation function", "kdf", kdf); - } - /** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ - function decryptKeystoreJsonSync(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); - } - function stall$1(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); - } - /** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ - async function decryptKeystoreJson(json, _password, progress) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall$1(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall$1(0); - } - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = await scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); - } - function getEncryptKdfParams(options) { - // Check/generate the salt - const salt = options.salt != null - ? getBytes(options.salt, "options.salt") - : randomBytes(32); - // Override the scrypt password-based key derivation function parameters - let N = 1 << 17, r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N) { - N = options.scrypt.N; - } - if (options.scrypt.r) { - r = options.scrypt.r; - } - if (options.scrypt.p) { - p = options.scrypt.p; - } - } - assertArgument(typeof N === "number" && - N > 0 && - Number.isSafeInteger(N) && - (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); - assertArgument(typeof r === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); - assertArgument(typeof p === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); - return { name: "scrypt", dkLen: 32, salt, N, r, p }; - } - function _encryptKeystore(key, kdf, account, options) { - const privateKey = getBytes(account.privateKey, "privateKey"); - // Override initialization vector - const iv = options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); - assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - // Override the uuid - const uuidRandom = options.uuid != null - ? getBytes(options.uuid, "options.uuid") - : randomBytes(16); - assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - // Encrypt the private key - const aesCtr = new CTR(derivedKey, iv); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - // Compute the message authentication code, used to check the password - const mac = sha256(concat([macPrefix, ciphertext])); - const data = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv).substring(2), - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r, - }, - mac: mac.substring(2), - }, - }; - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = options.client != null ? options.client : `corebc/${version}`; - const path = account.mnemonic.path || defaultPath$1; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key.slice(32, 64); - const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - const now = new Date(); - const timestamp = now.getUTCFullYear() + - "-" + - zpad(now.getUTCMonth() + 1, 2) + - "-" + - zpad(now.getUTCDate(), 2) + - "T" + - zpad(now.getUTCHours(), 2) + - "-" + - zpad(now.getUTCMinutes(), 2) + - "-" + - zpad(now.getUTCSeconds(), 2) + - ".0Z"; - const gethFilename = "UTC--" + timestamp + "--" + data.address; - data["x-corebc"] = { - client, - gethFilename, - path, - locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1", - }; - } - return JSON.stringify(data); - } - /** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ - function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key), kdf, account, options); - } - /** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ - async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(getBytes(key), kdf, account, options); - } - - /** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ - // import { arrayify, - // // hexDataSlice - // } from "../utils/data.js"; - // function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array { - // const p = getBytes(password); - // const s = getBytes(salt); - // return getBytes(pbkdf2(p, s, 2048, 57, "sha512")); - // } - /** - * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ - const defaultPath = "m"; - // "Bitcoin seed" - // const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); - const HardenedBit = 0x80000000; - // function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array { - // b = getBytes(concat([b.slice(0, 53), "0x00000000"])); - // b[0] &= 0xfc; - // const c = new Uint8Array(57); - // let hold = 0; - // for (let i = 0; i < 57; i++) { - // hold += a[i] + b[i]; - // c[i] = hold % 256; - // hold = Math.floor(hold / 256); - // } - // return c; - // }; - const _guard = {}; - function derivePath(node, path) { - const components = path.split("/"); - assertArgument(components.length > 0 && (components[0] === "m" || node.depth > 0), "invalid path", "path", path); - if (components[0] === "m") { - components.shift(); - } - let result = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(HardenedBit + index); - } - else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(index); - } - else { - assertArgument(false, "invalid path component", `path[${i}]`, component); - } - } - return result; - } - /** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ - class HDNodeWallet extends BaseWallet { - /** - * The compressed public key. - */ - publicKey; - prefix; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent fingerprint. - */ - parentFingerprint; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - mnemonic; - #seed; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) { - super({ - signingKey, - prefix, - provider, - }); - assertPrivate(guard, _guard, "HDNodeWallet"); - defineProperties(this, { publicKey: signingKey.publicKey }); - this.prefix = prefix; - this.#seed = seed; - const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, - fingerprint, - path, - index, - depth, - }); - defineProperties(this, { mnemonic }); - } - connect(provider) { - return new HDNodeWallet({ - guard: _guard, - signingKey: this.signingKey, - parentFingerprint: this.parentFingerprint, - path: this.path, - index: this.index, - depth: this.depth, - seed: this.#seed, - mnemonic: this.mnemonic, - provider, - prefix: this.prefix, - }); - } - #account() { - const account = { - address: this.address, - privateKey: this.privateKey, - }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy, - }; - } - return account; - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await encryptKeystoreJson(this.#account(), password, { - progressCallback, - }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return encryptKeystoreJsonSync(this.#account(), password); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { - return this.path != null; - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index)); - const newSigningKey = new SigningKey(newPrivateKey); - // Base path - let path = this.path; - if (path) { - path += "/" + (_index & ~HardenedBit); - if (_index & HardenedBit) { - path += "'"; - } - } - return new HDNodeWallet({ - guard: _guard, - signingKey: newSigningKey, - parentFingerprint: this.fingerprint, - path, - index: _index, - seed: this.#seed, - depth: this.depth + 1, - mnemonic: this.mnemonic, - provider: this.provider, - prefix: this.prefix, - }); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - static #fromSeed({ _seed, mnemonic, prefix, path, }) { - const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0); - const signingKey = new SigningKey(extendetPrivateKey); - // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length }) - return new HDNodeWallet({ - seed: _seed, - guard: _guard, - signingKey, - parentFingerprint: "0x00000000", - path: path || defaultPath, - index: 0, - depth: 0, - mnemonic, - provider: null, - prefix, - }); - } - /** - * Creates a new random HDNode. - */ - static createRandom(prefix, password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist); - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - /** - * Create am HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, prefix, path) { - if (!path) { - path = defaultPath; - } - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - static mnemonicToSeed(mnemonic, password) { - const seed = mnemonicToSeed(mnemonic, password); - return seed; - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase({ phrase, prefix, password, path, wordlist, }) { - if (!password) { - password = ""; - } - if (!path) { - path = defaultPath; - } - if (!wordlist) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist }); - const _seed = mnemonic.computeSeed(); - return HDNodeWallet.#fromSeed({ - _seed, - mnemonic, - prefix, - }).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed({ seed, prefix, path, }) { - return HDNodeWallet.#fromSeed({ - _seed: seed, - mnemonic: null, - path: path || defaultPath, - prefix, - }); - } - } - /* - export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } - } - */ - /** - * Returns the [[link-bip-32]] path for the acount at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ - function getAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${index}'/0/0`; - } - /** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ - function getIndexedAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${index}`; - } - - /** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ - // @ts-ignore - const { CBC, pkcs7Strip } = pkg; - /** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ - function isCrowdsaleJson(json) { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } - catch (error) { } - return false; - } - /** - * Before Core launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive xcb - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ - function decryptCrowdsaleJson(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - // Core Address - const address = getAddress(spelunk(data, "ethaddr:string!")); - // Encrypted Seed - const encseed = looseArrayify(spelunk(data, "encseed:string!")); - assertArgument(encseed && encseed.length % 16 === 0, "invalid encseed", "json", json); - const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - return { address, privateKey: id(seedHex) }; - } - - function stall(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); - } - /** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ - class Wallet extends BaseWallet { - /** - * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected - * to %%provider%%. - */ - constructor({ key, prefix, provider, }) { - if (typeof key === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - let signingKey = typeof key === "string" ? new SigningKey(key) : key; - super({ - signingKey, - prefix, - provider, - }); - } - connect(provider) { - return new Wallet({ - key: this.signingKey, - prefix: this.prefix, - provider, - }); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - const account = { address: this.address, privateKey: this.privateKey }; - return await encryptKeystoreJson(account, password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - const account = { address: this.address, privateKey: this.privateKey }; - return encryptKeystoreJsonSync(account, password); - } - static #fromAccount(account) { - assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - const address = account.address; - const prefix = extractPrefix(address); - if ("mnemonic" in account && - account.mnemonic && - account.mnemonic.locale === "en") { - const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path); - if (wallet.address === account.address && - wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - const wallet = new Wallet({ - key: account.privateKey, - prefix, - }); - assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); - return wallet; - } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json, password, progress) { - let account = null; - if (isKeystoreJson(json)) { - account = await decryptKeystoreJson(json, password, progress); - } - else if (isCrowdsaleJson(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = decryptCrowdsaleJson(json, password); - if (progress) { - progress(1); - await stall(0); - } - } - return Wallet.#fromAccount(account); - } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json, password) { - let account = null; - if (isKeystoreJson(json)) { - account = decryptKeystoreJsonSync(json, password); - } - else if (isCrowdsaleJson(json)) { - account = decryptCrowdsaleJson(json, password); - } - else { - assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - return Wallet.#fromAccount(account); - } - /** - * Creates a new random [[HDNodeWallet]] using the avavilable - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(prefix, provider) { - const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase({ phrase, prefix, provider, password, }) { - const wallet = HDNodeWallet.fromPhrase({ - phrase, - prefix, - password, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - static fromSeed({ seed, prefix, provider, path, }) { - const wallet = HDNodeWallet.fromSeed({ - seed, - prefix, - path: path || defaultPath, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - } - - const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; - /** - * @_ignore - */ - function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = (accum << 6) | Base64.indexOf(data[i]); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = accum >> (bits - width); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; - } - - /** - * @_ignore - */ - function decodeOwlA(data, accents) { - let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); - } - - /** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ - class WordlistOwlA extends WordlistOwl { - #accent; - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - get _accent() { - return this.#accent; - } - _decodeWords() { - return decodeOwlA(this._data, this._accent); - } - } - - const wordlists = { - en: LangEn.wordlist(), - }; - - var corebc = /*#__PURE__*/Object.freeze({ - __proto__: null, - AbiCoder: AbiCoder, - AbstractProvider: AbstractProvider, - AbstractSigner: AbstractSigner, - AlchemyProvider: AlchemyProvider, - AnkrProvider: AnkrProvider, - BaseContract: BaseContract, - BaseWallet: BaseWallet, - BigNumber: BigNumber, - Block: Block, - BrowserProvider: BrowserProvider, - CloudflareProvider: CloudflareProvider, - ConstructorFragment: ConstructorFragment, - Contract: Contract, - ContractEventPayload: ContractEventPayload, - ContractFactory: ContractFactory, - ContractTransactionReceipt: ContractTransactionReceipt, - ContractTransactionResponse: ContractTransactionResponse, - ContractUnknownEventPayload: ContractUnknownEventPayload, - CoreSymbol: CoreSymbol, - Ed448Goldilock: Ed448Goldilock, - EnergyCostPlugin: EnergyCostPlugin, - ErrorDescription: ErrorDescription, - ErrorFragment: ErrorFragment, - EventFragment: EventFragment, - EventLog: EventLog, - EventPayload: EventPayload, - FallbackFragment: FallbackFragment, - FallbackProvider: FallbackProvider, - FeeData: FeeData, - FeeDataNetworkPlugin: FeeDataNetworkPlugin, - FetchCancelSignal: FetchCancelSignal, - FetchRequest: FetchRequest, - FetchResponse: FetchResponse, - FixedNumber: FixedNumber, - Fragment: Fragment, - FunctionFragment: FunctionFragment, - HDNodeWallet: HDNodeWallet, - Indexed: Indexed, - InfuraProvider: InfuraProvider, - InfuraWebSocketProvider: InfuraWebSocketProvider, - Interface: Interface, - IpcSocketProvider: IpcSocketProvider, - JsonRpcApiProvider: JsonRpcApiProvider, - JsonRpcProvider: JsonRpcProvider, - JsonRpcSigner: JsonRpcSigner, - LangEn: LangEn, - Log: Log, - LogDescription: LogDescription, - MaxInt256: MaxInt256, - MaxUint256: MaxUint256, - MessagePrefix: MessagePrefix, - MinInt256: MinInt256, - Mnemonic: Mnemonic, - N: N, - NamedFragment: NamedFragment, - Network: Network, - NetworkPlugin: NetworkPlugin, - NonceManager: NonceManager, - OrePerXCB: OrePerXCB, - ParamType: ParamType, - PocketProvider: PocketProvider, - QuickNodeProvider: QuickNodeProvider, - Result: Result, - Signature: Signature, - SigningKey: SigningKey, - SocketBlockSubscriber: SocketBlockSubscriber, - SocketEventSubscriber: SocketEventSubscriber, - SocketPendingSubscriber: SocketPendingSubscriber, - SocketProvider: SocketProvider, - SocketSubscriber: SocketSubscriber, - StructFragment: StructFragment, - Transaction: Transaction, - TransactionDescription: TransactionDescription, - TransactionReceipt: TransactionReceipt, - TransactionResponse: TransactionResponse, - Typed: Typed, - TypedDataEncoder: TypedDataEncoder, - UnmanagedSubscriber: UnmanagedSubscriber, - Utf8ErrorFuncs: Utf8ErrorFuncs, - VoidSigner: VoidSigner, - Wallet: Wallet, - WebSocketProvider: WebSocketProvider, - Wordlist: Wordlist, - WordlistOwl: WordlistOwl, - WordlistOwlA: WordlistOwlA, - ZeroAddress: ZeroAddress, - ZeroHash: ZeroHash, - accessListify: accessListify, - arrayify: arrayify, - assert: assert, - assertArgument: assertArgument, - assertArgumentCount: assertArgumentCount, - assertNormalize: assertNormalize, - assertPrivate: assertPrivate, - checkResultErrors: checkResultErrors, - computeAddress: computeAddress, - computeHmac: computeHmac, - concat: concat, - copyRequest: copyRequest, - dataLength: dataLength, - dataSlice: dataSlice, - decodeBase58: decodeBase58, - decodeBase64: decodeBase64, - decodeBytes32String: decodeBytes32String, - decodeRlp: decodeRlp, - decryptCrowdsaleJson: decryptCrowdsaleJson, - decryptKeystoreJson: decryptKeystoreJson, - decryptKeystoreJsonSync: decryptKeystoreJsonSync, - defaultPath: defaultPath, - defineProperties: defineProperties, - encodeBase58: encodeBase58, - encodeBase64: encodeBase64, - encodeBytes32String: encodeBytes32String, - encodeRlp: encodeRlp, - encryptKeystoreJson: encryptKeystoreJson, - encryptKeystoreJsonSync: encryptKeystoreJsonSync, - formatUnits: formatUnits, - formatXCB: formatXCB, - fromTwos: fromTwos, - getAccountPath: getAccountPath, - getAddress: getAddress, - getBigInt: getBigInt, - getBytes: getBytes, - getBytesCopy: getBytesCopy, - getCreate2Address: getCreate2Address, - getCreateAddress: getCreateAddress, - getDefaultProvider: getDefaultProvider, - getIndexedAccountPath: getIndexedAccountPath, - getNumber: getNumber, - getUint: getUint, - hashMessage: hashMessage, - hexConcat: hexConcat, - hexlify: hexlify, - id: id, - isAddress: isAddress, - isAddressable: isAddressable, - isBytesLike: isBytesLike, - isCallException: isCallException, - isCrowdsaleJson: isCrowdsaleJson, - isError: isError, - isHexString: isHexString, - isKeystoreJson: isKeystoreJson, - keccak256: keccak256, - lock: lock, - makeError: makeError, - mask: mask, - networkIdToPrefix: networkIdToPrefix, - parseUnits: parseUnits, - parseXCB: parseXCB, - pbkdf2: pbkdf2, - publicToAddress: publicToAddress, - randomBytes: randomBytes, - recoverAddress: recoverAddress, - resolveAddress: resolveAddress, - resolveProperties: resolveProperties, - ripemd160: ripemd160, - scrypt: scrypt, - scryptSync: scryptSync, - sha256: sha256, - sha512: sha512, - showThrottleMessage: showThrottleMessage, - solidityPacked: solidityPacked, - solidityPackedSha256: solidityPackedSha256, - stripZerosLeft: stripZerosLeft, - toBeArray: toBeArray, - toBeHex: toBeHex, - toBigInt: toBigInt, - toNumber: toNumber, - toQuantity: toQuantity, - toTwos: toTwos, - toUtf8Bytes: toUtf8Bytes, - toUtf8CodePoints: toUtf8CodePoints, - toUtf8String: toUtf8String, - uuidV4: uuidV4, - verifyMessage: verifyMessage, - verifyTypedData: verifyTypedData, - version: version, - wordlists: wordlists, - zeroPadBytes: zeroPadBytes, - zeroPadValue: zeroPadValue - }); - - Object.defineProperty(exports, 'Buffer', { - enumerable: true, - get: function () { return buffer.Buffer; } - }); - exports.AbiCoder = AbiCoder; - exports.AbstractProvider = AbstractProvider; - exports.AbstractSigner = AbstractSigner; - exports.AlchemyProvider = AlchemyProvider; - exports.AnkrProvider = AnkrProvider; - exports.BaseContract = BaseContract; - exports.BaseWallet = BaseWallet; - exports.BigNumber = BigNumber; - exports.Block = Block; - exports.BrowserProvider = BrowserProvider; - exports.CloudflareProvider = CloudflareProvider; - exports.ConstructorFragment = ConstructorFragment; - exports.Contract = Contract; - exports.ContractEventPayload = ContractEventPayload; - exports.ContractFactory = ContractFactory; - exports.ContractTransactionReceipt = ContractTransactionReceipt; - exports.ContractTransactionResponse = ContractTransactionResponse; - exports.ContractUnknownEventPayload = ContractUnknownEventPayload; - exports.CoreSymbol = CoreSymbol; - exports.Ed448Goldilock = Ed448Goldilock; - exports.EnergyCostPlugin = EnergyCostPlugin; - exports.ErrorDescription = ErrorDescription; - exports.ErrorFragment = ErrorFragment; - exports.EventFragment = EventFragment; - exports.EventLog = EventLog; - exports.EventPayload = EventPayload; - exports.FallbackFragment = FallbackFragment; - exports.FallbackProvider = FallbackProvider; - exports.FeeData = FeeData; - exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin; - exports.FetchCancelSignal = FetchCancelSignal; - exports.FetchRequest = FetchRequest; - exports.FetchResponse = FetchResponse; - exports.FixedNumber = FixedNumber; - exports.Fragment = Fragment; - exports.FunctionFragment = FunctionFragment; - exports.HDNodeWallet = HDNodeWallet; - exports.Indexed = Indexed; - exports.InfuraProvider = InfuraProvider; - exports.InfuraWebSocketProvider = InfuraWebSocketProvider; - exports.Interface = Interface; - exports.IpcSocketProvider = IpcSocketProvider; - exports.JsonRpcApiProvider = JsonRpcApiProvider; - exports.JsonRpcProvider = JsonRpcProvider; - exports.JsonRpcSigner = JsonRpcSigner; - exports.LangEn = LangEn; - exports.Log = Log; - exports.LogDescription = LogDescription; - exports.MaxInt256 = MaxInt256; - exports.MaxUint256 = MaxUint256; - exports.MessagePrefix = MessagePrefix; - exports.MinInt256 = MinInt256; - exports.Mnemonic = Mnemonic; - exports.N = N; - exports.NamedFragment = NamedFragment; - exports.Network = Network; - exports.NetworkPlugin = NetworkPlugin; - exports.NonceManager = NonceManager; - exports.OrePerXCB = OrePerXCB; - exports.ParamType = ParamType; - exports.PocketProvider = PocketProvider; - exports.QuickNodeProvider = QuickNodeProvider; - exports.Result = Result; - exports.Signature = Signature; - exports.SigningKey = SigningKey; - exports.SocketBlockSubscriber = SocketBlockSubscriber; - exports.SocketEventSubscriber = SocketEventSubscriber; - exports.SocketPendingSubscriber = SocketPendingSubscriber; - exports.SocketProvider = SocketProvider; - exports.SocketSubscriber = SocketSubscriber; - exports.StructFragment = StructFragment; - exports.Transaction = Transaction; - exports.TransactionDescription = TransactionDescription; - exports.TransactionReceipt = TransactionReceipt; - exports.TransactionResponse = TransactionResponse; - exports.Typed = Typed; - exports.TypedDataEncoder = TypedDataEncoder; - exports.UnmanagedSubscriber = UnmanagedSubscriber; - exports.Utf8ErrorFuncs = Utf8ErrorFuncs; - exports.VoidSigner = VoidSigner; - exports.Wallet = Wallet; - exports.WebSocketProvider = WebSocketProvider; - exports.Wordlist = Wordlist; - exports.WordlistOwl = WordlistOwl; - exports.WordlistOwlA = WordlistOwlA; - exports.ZeroAddress = ZeroAddress; - exports.ZeroHash = ZeroHash; - exports.accessListify = accessListify; - exports.arrayify = arrayify; - exports.assert = assert; - exports.assertArgument = assertArgument; - exports.assertArgumentCount = assertArgumentCount; - exports.assertNormalize = assertNormalize; - exports.assertPrivate = assertPrivate; - exports.checkResultErrors = checkResultErrors; - exports.computeAddress = computeAddress; - exports.computeHmac = computeHmac; - exports.concat = concat; - exports.copyRequest = copyRequest; - exports.corebc = corebc; - exports.dataLength = dataLength; - exports.dataSlice = dataSlice; - exports.decodeBase58 = decodeBase58; - exports.decodeBase64 = decodeBase64; - exports.decodeBytes32String = decodeBytes32String; - exports.decodeRlp = decodeRlp; - exports.decryptCrowdsaleJson = decryptCrowdsaleJson; - exports.decryptKeystoreJson = decryptKeystoreJson; - exports.decryptKeystoreJsonSync = decryptKeystoreJsonSync; - exports.defaultPath = defaultPath; - exports.defineProperties = defineProperties; - exports.encodeBase58 = encodeBase58; - exports.encodeBase64 = encodeBase64; - exports.encodeBytes32String = encodeBytes32String; - exports.encodeRlp = encodeRlp; - exports.encryptKeystoreJson = encryptKeystoreJson; - exports.encryptKeystoreJsonSync = encryptKeystoreJsonSync; - exports.formatUnits = formatUnits; - exports.formatXCB = formatXCB; - exports.fromTwos = fromTwos; - exports.getAccountPath = getAccountPath; - exports.getAddress = getAddress; - exports.getBigInt = getBigInt; - exports.getBytes = getBytes; - exports.getBytesCopy = getBytesCopy; - exports.getCreate2Address = getCreate2Address; - exports.getCreateAddress = getCreateAddress; - exports.getDefaultProvider = getDefaultProvider; - exports.getIndexedAccountPath = getIndexedAccountPath; - exports.getNumber = getNumber; - exports.getUint = getUint; - exports.hashMessage = hashMessage; - exports.hexConcat = hexConcat; - exports.hexlify = hexlify; - exports.id = id; - exports.isAddress = isAddress; - exports.isAddressable = isAddressable; - exports.isBytesLike = isBytesLike; - exports.isCallException = isCallException; - exports.isCrowdsaleJson = isCrowdsaleJson; - exports.isError = isError; - exports.isHexString = isHexString; - exports.isKeystoreJson = isKeystoreJson; - exports.keccak256 = keccak256; - exports.lock = lock; - exports.makeError = makeError; - exports.mask = mask; - exports.networkIdToPrefix = networkIdToPrefix; - exports.parseUnits = parseUnits; - exports.parseXCB = parseXCB; - exports.pbkdf2 = pbkdf2; - exports.publicToAddress = publicToAddress; - exports.randomBytes = randomBytes; - exports.recoverAddress = recoverAddress; - exports.resolveAddress = resolveAddress; - exports.resolveProperties = resolveProperties; - exports.ripemd160 = ripemd160; - exports.scrypt = scrypt; - exports.scryptSync = scryptSync; - exports.sha256 = sha256; - exports.sha512 = sha512; - exports.showThrottleMessage = showThrottleMessage; - exports.solidityPacked = solidityPacked; - exports.solidityPackedSha256 = solidityPackedSha256; - exports.stripZerosLeft = stripZerosLeft; - exports.toBeArray = toBeArray; - exports.toBeHex = toBeHex; - exports.toBigInt = toBigInt; - exports.toNumber = toNumber; - exports.toQuantity = toQuantity; - exports.toTwos = toTwos; - exports.toUtf8Bytes = toUtf8Bytes; - exports.toUtf8CodePoints = toUtf8CodePoints; - exports.toUtf8String = toUtf8String; - exports.uuidV4 = uuidV4; - exports.verifyMessage = verifyMessage; - exports.verifyTypedData = verifyTypedData; - exports.version = version; - exports.wordlists = wordlists; - exports.zeroPadBytes = zeroPadBytes; - exports.zeroPadValue = zeroPadValue; + reason: "500_SERVER_ERROR", + transaction: tx, + info: { urls, errorMessages }, + }); + } + _wrapBlock(value, network) { + return new Block(formatBlock(value), this); + } + _wrapLog(value, network) { + return new Log(formatLog(value), this); + } + _wrapTransactionReceipt(value, network) { + return new TransactionReceipt(formatTransactionReceipt(value), this); + } + _wrapTransactionResponse(tx, network) { + return new TransactionResponse(formatTransactionResponse(tx), this); + } + _detectNetwork() { + assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { + operation: "_detectNetwork", + }); + } + // Sub-classes should override this and handle PerformActionRequest requests, calling + // the super for any unhandled actions. + async _perform(req) { + assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { + operation: req.method, + info: req, + }); + } + // State + async getBlockNumber() { + const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); + if (this.#lastBlockNumber >= 0) { + this.#lastBlockNumber = blockNumber; + } + return blockNumber; + } + _getAddress(address) { + return resolveAddress(address); + } + _getBlockTag(blockTag) { + if (blockTag == null) { + return "latest"; + } + switch (blockTag) { + case "earliest": + return "0x0"; + case "latest": + case "pending": + case "safe": + case "finalized": + return blockTag; + } + if (isHexString(blockTag)) { + if (isHexString(blockTag, 32)) { + return blockTag; + } + return toQuantity(blockTag); + } + if (typeof blockTag === "bigint") { + blockTag = getNumber(blockTag, "blockTag"); + } + if (typeof blockTag === "number") { + if (blockTag >= 0) { + return toQuantity(blockTag); + } + if (this.#lastBlockNumber >= 0) { + return toQuantity(this.#lastBlockNumber + blockTag); + } + return this.getBlockNumber().then((b) => toQuantity(b + blockTag)); + } + assertArgument(false, "invalid blockTag", "blockTag", blockTag); + } + _getFilter(filter) { + // Create a canonical representation of the topics + const topics = (filter.topics || []).map((t) => { + if (t == null) { + return null; + } + if (Array.isArray(t)) { + return concisify(t.map((t) => t.toLowerCase())); + } + return t.toLowerCase(); + }); + const blockHash = "blockHash" in filter ? filter.blockHash : undefined; + const resolve = (_address, fromBlock, toBlock) => { + let address = undefined; + switch (_address.length) { + case 0: + break; + case 1: + address = _address[0]; + break; + default: + _address.sort(); + address = _address; + } + if (blockHash) { + if (fromBlock != null || toBlock != null) { + throw new Error("invalid filter"); + } + } + const filter = {}; + if (address) { + filter.address = address; + } + if (topics.length) { + filter.topics = topics; + } + if (fromBlock) { + filter.fromBlock = fromBlock; + } + if (toBlock) { + filter.toBlock = toBlock; + } + if (blockHash) { + filter.blockHash = blockHash; + } + return filter; + }; + // Addresses could be async (ENS names or Addressables) + let address = []; + if (filter.address) { + if (Array.isArray(filter.address)) { + for (const addr of filter.address) { + address.push(this._getAddress(addr)); + } + } + else { + address.push(this._getAddress(filter.address)); + } + } + let fromBlock = undefined; + if ("fromBlock" in filter) { + fromBlock = this._getBlockTag(filter.fromBlock); + } + let toBlock = undefined; + if ("toBlock" in filter) { + toBlock = this._getBlockTag(filter.toBlock); + } + if (address.filter((a) => typeof a !== "string").length || + (fromBlock != null && typeof fromBlock !== "string") || + (toBlock != null && typeof toBlock !== "string")) { + return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { + return resolve(result[0], result[1], result[2]); + }); + } + return resolve(address, fromBlock, toBlock); + } + _getTransactionRequest(_request) { + const request = copyRequest(_request); + const promises = []; + ["to", "from"].forEach((key) => { + if (request[key] == null) { + return; + } + const addr = resolveAddress(request[key]); + if (isPromise(addr)) { + promises.push((async function () { + request[key] = await addr; + })()); + } + else { + request[key] = addr; + } + }); + if (request.blockTag != null) { + const blockTag = this._getBlockTag(request.blockTag); + if (isPromise(blockTag)) { + promises.push((async function () { + request.blockTag = await blockTag; + })()); + } + else { + request.blockTag = blockTag; + } + } + if (promises.length) { + return (async function () { + await Promise.all(promises); + return request; + })(); + } + return request; + } + async getNetwork() { + // No explicit network was set and this is our first time + if (this.#networkPromise == null) { + // Detect the current network (shared with all calls) + const detectNetwork = this._detectNetwork().then((network) => { + this.emit("network", network, null); + return network; + }, (error) => { + // Reset the networkPromise on failure, so we will try again + if (this.#networkPromise === detectNetwork) { + this.#networkPromise = null; + } + throw error; + }); + this.#networkPromise = detectNetwork; + return (await detectNetwork).clone(); + } + const networkPromise = this.#networkPromise; + const [expected, actual] = await Promise.all([ + networkPromise, // Possibly an explicit Network + this._detectNetwork(), // The actual connected network + ]); + if (expected.networkId !== actual.networkId) { + if (this.#anyNetwork) { + // The "any" network can change, so notify listeners + this.emit("network", actual, expected); + // Update the network if something else hasn't already changed it + if (this.#networkPromise === networkPromise) { + this.#networkPromise = Promise.resolve(actual); + } + } + else { + // Otherwise, we do not allow changes to the underlying network + assert(false, `network changed: ${expected.networkId} => ${actual.networkId} `, "NETWORK_ERROR", { + event: "changed", + }); + } + } + return expected.clone(); + } + async getEnergyPrice() { + const { energyPrice } = await resolveProperties({ + block: this.getBlock("latest"), + energyPrice: (async () => { + try { + const energyPrice = await this.#perform({ method: "getEnergyPrice" }); + return getBigInt(energyPrice, "%response"); + } + catch (error) { } + return null; + })(), + }); + return new FeeData(energyPrice); + } + async getFeeData() { + const { energyPrice } = await resolveProperties({ + block: this.getBlock("latest"), + energyPrice: (async () => { + try { + const energyPrice = await this.#perform({ method: "getEnergyPrice" }); + return getBigInt(energyPrice, "%response"); + } + catch (error) { } + return null; + })(), + }); + return new FeeData(energyPrice); + } + async estimateEnergy(_tx) { + let tx = this._getTransactionRequest(_tx); + if (isPromise(tx)) { + tx = await tx; + } + return getBigInt(await this.#perform({ + method: "estimateEnergy", + transaction: tx, + }), "%response"); + } + async #call(tx, blockTag, attempt) { + assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { + reason: "TOO_MANY_REDIRECTS", + transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }), + }); + // This came in as a PerformActionTransaction, so to/from are safe; we can cast + const transaction = copyRequest(tx); + try { + return hexlify(await this._perform({ method: "call", transaction, blockTag })); + } + catch (error) { + // CCIP Read OffchainLookup + if (!this.disableCcipRead && + isCallException(error) && + error.data && + attempt >= 0 && + blockTag === "latest" && + transaction.to != null && + dataSlice(error.data, 0, 4) === "0x556f1830") { + const data = error.data; + const txSender = await resolveAddress(transaction.to); + // Parse the CCIP Read Arguments + let ccipArgs; + try { + ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); + } + catch (error) { + assert(false, error.message, "OFFCHAIN_FAULT", { + reason: "BAD_DATA", + transaction, + info: { data }, + }); + } + // Check the sender of the OffchainLookup matches the transaction + assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { + action: "call", + data, + reason: "OffchainLookup", + transaction: transaction, // @TODO: populate data? + invocation: null, + revert: { + signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", + name: "OffchainLookup", + args: ccipArgs.errorArgs, + }, + }); + const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); + assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { + reason: "FETCH_FAILED", + transaction, + info: { data: error.data, errorArgs: ccipArgs.errorArgs }, + }); + const tx = { + to: txSender, + data: concat([ + ccipArgs.selector, + encodeBytes([ccipResult, ccipArgs.extraData]), + ]), + }; + this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); + try { + const result = await this.#call(tx, blockTag, attempt + 1); + this.emit("debug", { + action: "receiveCcipReadCallResult", + transaction: Object.assign({}, tx), + result, + }); + return result; + } + catch (error) { + this.emit("debug", { + action: "receiveCcipReadCallError", + transaction: Object.assign({}, tx), + error, + }); + throw error; + } + } + throw error; + } + } + async #checkNetwork(promise) { + const { value } = await resolveProperties({ + network: this.getNetwork(), + value: promise, + }); + return value; + } + async call(_tx) { + const { tx, blockTag } = await resolveProperties({ + tx: this._getTransactionRequest(_tx), + blockTag: this._getBlockTag(_tx.blockTag), + }); + return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); + } + // Account + async #getAccountValue(request, _address, _blockTag) { + let address = this._getAddress(_address); + let blockTag = this._getBlockTag(_blockTag); + if (typeof address !== "string" || typeof blockTag !== "string") { + [address, blockTag] = await Promise.all([address, blockTag]); + } + return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); + } + async getBalance(address, blockTag) { + return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); + } + async getTransactionCount(address, blockTag) { + return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); + } + async getCode(address, blockTag) { + return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); + } + async getStorage(address, _position, blockTag) { + const position = getBigInt(_position, "position"); + return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); + } + // Write + async broadcastTransaction(signedTx) { + const { blockNumber, hash, network } = await resolveProperties({ + blockNumber: this.getBlockNumber(), + hash: this._perform({ + method: "broadcastTransaction", + signedTransaction: signedTx, + }), + network: this.getNetwork(), + }); + const tx = Transaction.from(signedTx); + if (tx.hash !== hash) { + throw new Error("@TODO: the returned hash did not match"); + } + return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); + } + async #getBlock(block, includeTransactions) { + // @TODO: Add CustomBlockPlugin check + if (isHexString(block, 32)) { + return await this.#perform({ + method: "getBlock", + blockHash: block, + includeTransactions, + }); + } + let blockTag = this._getBlockTag(block); + if (typeof blockTag !== "string") { + blockTag = await blockTag; + } + return await this.#perform({ + method: "getBlock", + blockTag, + includeTransactions, + }); + } + // Queries + async getBlock(block, prefetchTxs) { + const { network, params } = await resolveProperties({ + network: this.getNetwork(), + params: this.#getBlock(block, !!prefetchTxs), + }); + if (params == null) { + return null; + } + return this._wrapBlock(params, network); + } + async getTransaction(hash) { + const { network, params } = await resolveProperties({ + network: this.getNetwork(), + params: this.#perform({ method: "getTransaction", hash }), + }); + if (params == null) { + return null; + } + return this._wrapTransactionResponse(params, network); + } + async getTransactionReceipt(hash) { + const { network, params } = await resolveProperties({ + network: this.getNetwork(), + params: this.#perform({ method: "getTransactionReceipt", hash }), + }); + if (params == null) { + return null; + } + // Some backends did not backfill the effectiveEnergyPrice into old transactions + // in the receipt, so we look it up manually and inject it. + if (params.energyPrice == null && params.effectiveEnergyPrice == null) { + const tx = await this.#perform({ method: "getTransaction", hash }); + if (tx == null) { + throw new Error("report this; could not find tx or effectiveEnergyPrice"); + } + params.effectiveEnergyPrice = tx.energyPrice; + } + return this._wrapTransactionReceipt(params, network); + } + async getTransactionResult(hash) { + const { result } = await resolveProperties({ + network: this.getNetwork(), + result: this.#perform({ method: "getTransactionResult", hash }), + }); + if (result == null) { + return null; + } + return hexlify(result); + } + // Bloom-filter Queries + async getLogs(_filter) { + let filter = this._getFilter(_filter); + if (isPromise(filter)) { + filter = await filter; + } + const { network, params } = await resolveProperties({ + network: this.getNetwork(), + params: this.#perform({ method: "getLogs", filter }), + }); + return params.map((p) => this._wrapLog(p, network)); + } + // ENS + _getProvider(networkId) { + assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { + operation: "_getProvider()", + }); + } + async waitForTransaction(hash, _confirms, timeout) { + const confirms = _confirms != null ? _confirms : 1; + if (confirms === 0) { + return this.getTransactionReceipt(hash); + } + return new Promise(async (resolve, reject) => { + let timer = null; + const listener = async (blockNumber) => { + try { + const receipt = await this.getTransactionReceipt(hash); + if (receipt != null) { + if (blockNumber - receipt.blockNumber + 1 >= confirms) { + resolve(receipt); + //this.off("block", listener); + if (timer) { + clearTimeout(timer); + timer = null; + } + return; + } + } + } + catch (error) { + console.log("EEE", error); + } + this.once("block", listener); + }; + if (timeout != null) { + timer = setTimeout(() => { + if (timer == null) { + return; + } + timer = null; + this.off("block", listener); + reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); + }, timeout); + } + listener(await this.getBlockNumber()); + }); + } + async waitForBlock(blockTag) { + assert(false, "not implemented yet", "NOT_IMPLEMENTED", { + operation: "waitForBlock", + }); + } + _clearTimeout(timerId) { + const timer = this.#timers.get(timerId); + if (!timer) { + return; + } + if (timer.timer) { + clearTimeout(timer.timer); + } + this.#timers.delete(timerId); + } + _setTimeout(_func, timeout) { + if (timeout == null) { + timeout = 0; + } + const timerId = this.#nextTimer++; + const func = () => { + this.#timers.delete(timerId); + _func(); + }; + if (this.paused) { + this.#timers.set(timerId, { timer: null, func, time: timeout }); + } + else { + const timer = setTimeout(func, timeout); + this.#timers.set(timerId, { timer, func, time: getTime$1() }); + } + return timerId; + } + _forEachSubscriber(func) { + for (const sub of this.#subs.values()) { + func(sub.subscriber); + } + } + // Event API; sub-classes should override this; any supported + // event filter will have been munged into an EventFilter + _getSubscriber(sub) { + switch (sub.type) { + case "debug": + case "error": + case "network": + return new UnmanagedSubscriber(sub.type); + case "block": + return new PollingBlockSubscriber(this); + case "event": + return new PollingEventSubscriber(this, sub.filter); + case "transaction": + return new PollingTransactionSubscriber(this, sub.hash); + case "orphan": + return new PollingOrphanSubscriber(this, sub.filter); + } + throw new Error(`unsupported event: ${sub.type}`); + } + _recoverSubscriber(oldSub, newSub) { + for (const sub of this.#subs.values()) { + if (sub.subscriber === oldSub) { + if (sub.started) { + sub.subscriber.stop(); + } + sub.subscriber = newSub; + if (sub.started) { + newSub.start(); + } + if (this.#pausedState != null) { + newSub.pause(this.#pausedState); + } + break; + } + } + } + async #hasSub(event, emitArgs) { + let sub = await getSubscription(event); + // This is a log that is removing an existing log; we actually want + // to emit an orphan event for the removed log + if (sub.type === "event" && + emitArgs && + emitArgs.length > 0 && + emitArgs[0].removed === true) { + sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }); + } + return this.#subs.get(sub.tag) || null; + } + async #getSub(event) { + const subscription = await getSubscription(event); + // Prevent tampering with our tag in any subclass' _getSubscriber + const tag = subscription.tag; + let sub = this.#subs.get(tag); + if (!sub) { + const subscriber = this._getSubscriber(subscription); + const addressableMap = new WeakMap(); + const nameMap = new Map(); + sub = { + subscriber, + tag, + addressableMap, + nameMap, + started: false, + listeners: [], + }; + this.#subs.set(tag, sub); + } + return sub; + } + async on(event, listener) { + const sub = await this.#getSub(event); + sub.listeners.push({ listener, once: false }); + if (!sub.started) { + sub.subscriber.start(); + sub.started = true; + if (this.#pausedState != null) { + sub.subscriber.pause(this.#pausedState); + } + } + return this; + } + async once(event, listener) { + const sub = await this.#getSub(event); + sub.listeners.push({ listener, once: true }); + if (!sub.started) { + sub.subscriber.start(); + sub.started = true; + if (this.#pausedState != null) { + sub.subscriber.pause(this.#pausedState); + } + } + return this; + } + async emit(event, ...args) { + const sub = await this.#hasSub(event, args); + // If there is not subscription or if a recent emit removed + // the last of them (which also deleted the sub) do nothing + if (!sub || sub.listeners.length === 0) { + return false; + } + const count = sub.listeners.length; + sub.listeners = sub.listeners.filter(({ listener, once }) => { + const payload = new EventPayload(this, once ? null : listener, event); + try { + listener.call(this, ...args, payload); + } + catch (error) { } + return !once; + }); + if (sub.listeners.length === 0) { + if (sub.started) { + sub.subscriber.stop(); + } + this.#subs.delete(sub.tag); + } + return count > 0; + } + async listenerCount(event) { + if (event) { + const sub = await this.#hasSub(event); + if (!sub) { + return 0; + } + return sub.listeners.length; + } + let total = 0; + for (const { listeners } of this.#subs.values()) { + total += listeners.length; + } + return total; + } + async listeners(event) { + if (event) { + const sub = await this.#hasSub(event); + if (!sub) { + return []; + } + return sub.listeners.map(({ listener }) => listener); + } + let result = []; + for (const { listeners } of this.#subs.values()) { + result = result.concat(listeners.map(({ listener }) => listener)); + } + return result; + } + async off(event, listener) { + const sub = await this.#hasSub(event); + if (!sub) { + return this; + } + if (listener) { + const index = sub.listeners + .map(({ listener }) => listener) + .indexOf(listener); + if (index >= 0) { + sub.listeners.splice(index, 1); + } + } + if (!listener || sub.listeners.length === 0) { + if (sub.started) { + sub.subscriber.stop(); + } + this.#subs.delete(sub.tag); + } + return this; + } + async removeAllListeners(event) { + if (event) { + const { tag, started, subscriber } = await this.#getSub(event); + if (started) { + subscriber.stop(); + } + this.#subs.delete(tag); + } + else { + for (const [tag, { started, subscriber }] of this.#subs) { + if (started) { + subscriber.stop(); + } + this.#subs.delete(tag); + } + } + return this; + } + // Alias for "on" + async addListener(event, listener) { + return await this.on(event, listener); + } + // Alias for "off" + async removeListener(event, listener) { + return this.off(event, listener); + } + // Sub-classes should override this to shutdown any sockets, etc. + // but MUST call this super.shutdown. + destroy() { + // Stop all listeners + this.removeAllListeners(); + // Shut down all tiemrs + for (const timerId of this.#timers.keys()) { + this._clearTimeout(timerId); + } + } + get paused() { + return this.#pausedState != null; + } + set paused(pause) { + if (!!pause === this.paused) { + return; + } + if (this.paused) { + this.resume(); + } + else { + this.pause(false); + } + } + pause(dropWhilePaused) { + this.#lastBlockNumber = -1; + if (this.#pausedState != null) { + if (this.#pausedState == !!dropWhilePaused) { + return; + } + assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { + operation: "pause", + }); + } + this._forEachSubscriber((s) => s.pause(dropWhilePaused)); + this.#pausedState = !!dropWhilePaused; + for (const timer of this.#timers.values()) { + // Clear the timer + if (timer.timer) { + clearTimeout(timer.timer); + } + // Remaining time needed for when we become unpaused + timer.time = getTime$1() - timer.time; + } + } + resume() { + if (this.#pausedState == null) { + return; + } + this._forEachSubscriber((s) => s.resume()); + this.#pausedState = null; + for (const timer of this.#timers.values()) { + // Remaining time when we were paused + let timeout = timer.time; + if (timeout < 0) { + timeout = 0; + } + // Start time (in cause paused, so we con compute remaininf time) + timer.time = getTime$1(); + // Start the timer + setTimeout(timer.func, timeout); + } + } + } + function _parseString(result, start) { + try { + const bytes = _parseBytes(result, start); + if (bytes) { + return toUtf8String(bytes); + } + } + catch (error) { } + return null; + } + function _parseBytes(result, start) { + if (result === "0x") { + return null; + } + try { + const offset = getNumber(dataSlice(result, start, start + 32)); + const length = getNumber(dataSlice(result, offset, offset + 32)); + return dataSlice(result, offset + 32, offset + 32 + length); + } + catch (error) { } + return null; + } + function numPad(value) { + const result = toBeArray(value); + if (result.length > 32) { + throw new Error("internal; should not happen"); + } + const padded = new Uint8Array(32); + padded.set(result, 32 - result.length); + return padded; + } + function bytesPad(value) { + if (value.length % 32 === 0) { + return value; + } + const result = new Uint8Array(Math.ceil(value.length / 32) * 32); + result.set(value); + return result; + } + const empty = new Uint8Array([]); + // ABI Encodes a series of (bytes, bytes, ...) + function encodeBytes(datas) { + const result = []; + let byteCount = 0; + // Add place-holders for pointers as we add items + for (let i = 0; i < datas.length; i++) { + result.push(empty); + byteCount += 32; + } + for (let i = 0; i < datas.length; i++) { + const data = getBytes(datas[i]); + // Update the bytes offset + result[i] = numPad(byteCount); + // The length and padded value of data + result.push(numPad(data.length)); + result.push(bytesPad(data)); + byteCount += 32 + Math.ceil(data.length / 32) * 32; + } + return concat(result); + } + const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; + function parseOffchainLookup(data) { + const result = { + sender: "", + urls: [], + calldata: "", + selector: "", + extraData: "", + errorArgs: [], + }; + assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { + reason: "insufficient OffchainLookup data", + }); + const sender = dataSlice(data, 0, 32); + assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { + reason: "corrupt OffchainLookup sender", + }); + result.sender = dataSlice(sender, 12); + // Read the URLs from the response + try { + const urls = []; + const urlsOffset = getNumber(dataSlice(data, 32, 64)); + const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); + const urlsData = dataSlice(data, urlsOffset + 32); + for (let u = 0; u < urlsLength; u++) { + const url = _parseString(urlsData, u * 32); + if (url == null) { + throw new Error("abort"); + } + urls.push(url); + } + result.urls = urls; + } + catch (error) { + assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { + reason: "corrupt OffchainLookup urls", + }); + } + // Get the CCIP calldata to forward + try { + const calldata = _parseBytes(data, 64); + if (calldata == null) { + throw new Error("abort"); + } + result.calldata = calldata; + } + catch (error) { + assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { + reason: "corrupt OffchainLookup calldata", + }); + } + // Get the callbackSelector (bytes4) + assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { + reason: "corrupt OffchainLookup callbaackSelector", + }); + result.selector = dataSlice(data, 96, 100); + // Get the extra data to send back to the contract as context + try { + const extraData = _parseBytes(data, 128); + if (extraData == null) { + throw new Error("abort"); + } + result.extraData = extraData; + } + catch (error) { + assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { + reason: "corrupt OffchainLookup extraData", + }); + } + result.errorArgs = "sender,urls,calldata,selector,extraData" + .split(/,/) + .map((k) => result[k]); + return result; + } + + /** + * About Abstract Signer and subclassing + * + * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] + */ + function checkProvider(signer, operation) { + if (signer.provider) { + return signer.provider; + } + assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); + } + async function populate(signer, tx) { + let pop = copyRequest(tx); + if (pop.to != null) { + pop.to = resolveAddress(pop.to); + } + if (pop.from != null) { + const from = pop.from; + pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).then(([address, from]) => { + assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); + return address; + }); + } + else { + pop.from = signer.getAddress(); + } + return await resolveProperties(pop); + } + class AbstractSigner { + provider; + constructor(provider) { + defineProperties(this, { provider: provider || null }); + } + async getNonce(blockTag) { + return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); + } + async populateCall(tx) { + const pop = await populate(this, tx); + return pop; + } + async populateTransaction(tx) { + const provider = checkProvider(this, "populateTransaction"); + const pop = await populate(this, tx); + if (pop.nonce == null) { + pop.nonce = await this.getNonce("pending"); + } + if (pop.energyLimit == null) { + pop.energyLimit = await this.estimateEnergy(pop); + } + // Populate the chain ID + const network = await this.provider.getNetwork(); + if (pop.networkId != null) { + const networkId = getBigInt(pop.networkId); + assertArgument(networkId === network.networkId, "transaction networkId mismatch", "tx.networkId", tx.networkId); + } + else { + pop.networkId = network.networkId; + } + // We need to get fee data to determine things + const feeData = await provider.getFeeData(); + // We need to auto-detect the intended type of this transaction... + if (feeData.energyPrice != null) { + // Network doesn't support EIP-1559... + // Populate missing fee data + if (pop.energyPrice == null) { + pop.energyPrice = feeData.energyPrice; + } + } + else { + // getFeeData has failed us. + assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { + operation: "signer.getFeeData", + }); + } + //@TOOD: Don't await all over the place; save them up for + // the end for better batching + return await resolveProperties(pop); + } + async estimateEnergy(tx) { + return checkProvider(this, "estimateEnergy").estimateEnergy(await this.populateCall(tx)); + } + async call(tx) { + return checkProvider(this, "call").call(await this.populateCall(tx)); + } + async resolveName(name) { + return getAddress(name); + } + async sendTransaction(tx) { + const provider = checkProvider(this, "sendTransaction"); + const pop = await this.populateTransaction(tx); + delete pop.from; + const txObj = Transaction.from(pop); + return await provider.broadcastTransaction(await this.signTransaction(txObj)); + } + } + class VoidSigner extends AbstractSigner { + address; + constructor(address, provider) { + super(provider); + defineProperties(this, { address }); + } + async getAddress() { + return this.address; + } + connect(provider) { + return new VoidSigner(this.address, provider); + } + #throwUnsupported(suffix, operation) { + assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { + operation, + }); + } + async signTransaction(tx) { + this.#throwUnsupported("transactions", "signTransaction"); + } + async signMessage(message) { + this.#throwUnsupported("messages", "signMessage"); + } + async signTypedData(domain, types, value) { + this.#throwUnsupported("typed-data", "signTypedData"); + } + } + + /** + * There are many awesome community services that provide Core + * nodes both for developers just starting out and for large-scale + * communities. + * + * @_section: api/providers/thirdparty: Community Providers [thirdparty] + */ + // Show the throttle message only once per service + const shown = new Set(); + /** + * Displays a warning in tht console when the community resource is + * being used too heavily by the app, recommending the developer + * acquire their own credentials instead of using the community + * credentials. + * + * The notification will only occur once per service. + */ + function showThrottleMessage(service) { + if (shown.has(service)) { + return; + } + shown.add(service); + console.log("========= NOTICE ========="); + console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); + console.log(""); + console.log("The default API keys for each service are provided as a highly-throttled,"); + console.log("community resource for low-traffic projects and early prototyping."); + console.log(""); + console.log("While your application will continue to function, we highly recommended"); + console.log("signing up for your own API keys to improve performance, increase your"); + console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); + console.log(""); + } + + function copy(obj) { + return JSON.parse(JSON.stringify(obj)); + } + /** + * Some backends support subscribing to events using a Filter ID. + * + * When subscribing with this technique, the node issues a unique + * //Filter ID//. At this point the node dedicates resources to + * the filter, so that periodic calls to follow up on the //Filter ID// + * will receive any events since the last call. + * + * @_docloc: api/providers/abstract-provider + */ + class FilterIdSubscriber { + #provider; + #filterIdPromise; + #poller; + #running; + #network; + #hault; + constructor(provider) { + this.#provider = provider; + this.#filterIdPromise = null; + this.#poller = this.#poll.bind(this); + this.#running = false; + this.#network = null; + this.#hault = false; + } + _subscribe(provider) { + throw new Error("subclasses must override this"); + } + _emitResults(provider, result) { + throw new Error("subclasses must override this"); + } + _recover(provider) { + throw new Error("subclasses must override this"); + } + async #poll(blockNumber) { + try { + // Subscribe if necessary + if (this.#filterIdPromise == null) { + this.#filterIdPromise = this._subscribe(this.#provider); + } + // Get the Filter ID + let filterId = null; + try { + filterId = await this.#filterIdPromise; + } + catch (error) { + if (!isError(error, "UNSUPPORTED_OPERATION") || + error.operation !== "xcb_newFilter") { + throw error; + } + } + // The backend does not support Filter ID; downgrade to + // polling + if (filterId == null) { + this.#filterIdPromise = null; + this.#provider._recoverSubscriber(this, this._recover(this.#provider)); + return; + } + const network = await this.#provider.getNetwork(); + if (!this.#network) { + this.#network = network; + } + if (this.#network.networkId !== network.networkId) { + throw new Error("chaid changed"); + } + if (this.#hault) { + return; + } + const result = await this.#provider.send("xcb_getFilterChanges", [ + filterId, + ]); + await this._emitResults(this.#provider, result); + } + catch (error) { + console.log("@TODO", error); + } + this.#provider.once("block", this.#poller); + } + #teardown() { + const filterIdPromise = this.#filterIdPromise; + if (filterIdPromise) { + this.#filterIdPromise = null; + filterIdPromise.then((filterId) => { + this.#provider.send("xcb_uninstallFilter", [filterId]); + }); + } + } + start() { + if (this.#running) { + return; + } + this.#running = true; + this.#poll(-2); + } + stop() { + if (!this.#running) { + return; + } + this.#running = false; + this.#hault = true; + this.#teardown(); + this.#provider.off("block", this.#poller); + } + pause(dropWhilePaused) { + if (dropWhilePaused) { + this.#teardown(); + } + this.#provider.off("block", this.#poller); + } + resume() { + this.start(); + } + } + /** + * A **FilterIdSubscriber** for receiving contract events. + * + * @_docloc: api/providers/abstract-provider + */ + class FilterIdEventSubscriber extends FilterIdSubscriber { + #event; + constructor(provider, filter) { + super(provider); + this.#event = copy(filter); + } + _recover(provider) { + return new PollingEventSubscriber(provider, this.#event); + } + async _subscribe(provider) { + const filterId = await provider.send("xcb_newFilter", [this.#event]); + return filterId; + } + async _emitResults(provider, results) { + for (const result of results) { + provider.emit(this.#event, provider._wrapLog(result, provider._network)); + } + } + } + /** + * A **FilterIdSubscriber** for receiving pending transactions events. + * + * @_docloc: api/providers/abstract-provider + */ + class FilterIdPendingSubscriber extends FilterIdSubscriber { + async _subscribe(provider) { + return await provider.send("xcb_newPendingTransactionFilter", []); + } + async _emitResults(provider, results) { + for (const result of results) { + provider.emit("pending", result); + } + } + } + + /** + * About JSON-RPC... + * + * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] + */ + // @TODO: + // - Add the batching API + const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); + //const Methods = "getAddress,then".split(/,/g); + function deepCopy(value) { + if (value == null || Primitive.indexOf(typeof value) >= 0) { + return value; + } + // Keep any Addressable + if (typeof value.getAddress === "function") { + return value; + } + if (Array.isArray(value)) { + return value.map(deepCopy); + } + if (typeof value === "object") { + return Object.keys(value).reduce((accum, key) => { + accum[key] = value[key]; + return accum; + }, {}); + } + throw new Error(`should not happen: ${value} (${typeof value})`); + } + function stall$3(duration) { + return new Promise((resolve) => { + setTimeout(resolve, duration); + }); + } + function getLowerCase(value) { + if (value) { + return value.toLowerCase(); + } + return value; + } + function isPollable(value) { + return value && typeof value.pollingInterval === "number"; + } + const defaultOptions = { + polling: false, + staticNetwork: null, + batchStallTime: 10, // 10ms + batchMaxSize: 1 << 20, // 1Mb + batchMaxCount: 100, // 100 requests + }; + // @TODO: Unchecked Signers + class JsonRpcSigner extends AbstractSigner { + address; + constructor(provider, address) { + super(provider); + address = getAddress(address); + defineProperties(this, { address }); + } + connect(provider) { + assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { + operation: "signer.connect", + }); + } + async getAddress() { + return this.address; + } + // JSON-RPC will automatially fill in nonce, etc. so we just check from + async populateTransaction(tx) { + return await this.populateCall(tx); + } + // Returns just the hash of the transaction after sent, which is what + // the bare JSON-RPC API does; + async sendUncheckedTransaction(_tx) { + const tx = deepCopy(_tx); + const promises = []; + // Make sure the from matches the sender + if (tx.from) { + const _from = tx.from; + promises.push((async () => { + const from = await resolveAddress(_from); + assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); + tx.from = from; + })()); + } + else { + tx.from = this.address; + } + // The JSON-RPC for xcb_sendTransaction uses 90000 energy; if the user + // wishes to use this, it is easy to specify explicitly, otherwise + // we look it up for them. + if (tx.energyLimit == null) { + promises.push((async () => { + tx.energyLimit = await this.provider.estimateEnergy({ + ...tx, + from: this.address, + }); + })()); + } + // The address may be an ENS name or Addressable + if (tx.to != null) { + const _to = tx.to; + promises.push((async () => { + tx.to = await resolveAddress(_to); + })()); + } + // Wait until all of our properties are filled in + if (promises.length) { + await Promise.all(promises); + } + const hexTx = this.provider.getRpcTransaction(tx); + return this.provider.send("xcb_sendTransaction", [hexTx]); + } + async sendTransaction(tx) { + // This cannot be mined any earlier than any recent block + const blockNumber = await this.provider.getBlockNumber(); + // Send the transaction + const hash = await this.sendUncheckedTransaction(tx); + // Unfortunately, JSON-RPC only provides and opaque transaction hash + // for a response, and we need the actual transaction, so we poll + // for it; it should show up very quickly + return await new Promise((resolve, reject) => { + const timeouts = [1000, 100]; + const checkTx = async () => { + // Try getting the transaction + const tx = await this.provider.getTransaction(hash); + if (tx != null) { + resolve(tx.replaceableTransaction(blockNumber)); + return; + } + // Wait another 4 seconds + this.provider._setTimeout(() => { + checkTx(); + }, timeouts.pop() || 4000); + }; + checkTx(); + }); + } + async signTransaction(_tx) { + const tx = deepCopy(_tx); + // Make sure the from matches the sender + if (tx.from) { + const from = await resolveAddress(tx.from); + assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); + tx.from = from; + } + else { + tx.from = this.address; + } + const hexTx = this.provider.getRpcTransaction(tx); + return await this.provider.send("xcb_signTransaction", [hexTx]); + } + async signMessage(_message) { + const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; + return await this.provider.send("personal_sign", [ + hexlify(message), + this.address.toLowerCase(), + ]); + } + async signTypedData(domain, types, _value) { + const value = deepCopy(_value); + // Populate any ENS names (in-place) + const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => { + const address = await resolveAddress(value); + assertArgument(address != null, "TypedData does not support null address", "value", value); + return address; + }); + return await this.provider.send("xcb_signTypedData_v4", [ + this.address.toLowerCase(), + JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value)), + ]); + } + async unlock(password) { + return this.provider.send("personal_unlockAccount", [ + this.address.toLowerCase(), + password, + null, + ]); + } + async _legacySignMessage(_message) { + const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; + return await this.provider.send("xcb_sign", [ + this.address.toLowerCase(), + hexlify(message), + ]); + } + } + /** + * The JsonRpcApiProvider is an abstract class and **MUST** be + * sub-classed. + * + * It provides the base for all JSON-RPC-based Provider interaction. + * + * Sub-classing Notes: + * - a sub-class MUST override _send + * - a sub-class MUST call the `_start()` method once connected + */ + class JsonRpcApiProvider extends AbstractProvider { + #options; + // The next ID to use for the JSON-RPC ID field + #nextId; + // Payloads are queued and triggered in batches using the drainTimer + #payloads; + #drainTimer; + #notReady; + #network; + #scheduleDrain() { + if (this.#drainTimer) { + return; + } + // If we aren't using batching, no hard in sending it immeidately + const stallTime = this._getOption("batchMaxCount") === 1 + ? 0 + : this._getOption("batchStallTime"); + this.#drainTimer = setTimeout(() => { + this.#drainTimer = null; + const payloads = this.#payloads; + this.#payloads = []; + while (payloads.length) { + // Create payload batches that satisfy our batch constraints + const batch = [payloads.shift()]; + while (payloads.length) { + if (batch.length === this.#options.batchMaxCount) { + break; + } + batch.push(payloads.shift()); + const bytes = JSON.stringify(batch.map((p) => p.payload)); + if (bytes.length > this.#options.batchMaxSize) { + payloads.unshift(batch.pop()); + break; + } + } + // Process the result to each payload + (async () => { + const payload = batch.length === 1 ? batch[0].payload : batch.map((p) => p.payload); + this.emit("debug", { action: "sendRpcPayload", payload }); + try { + // console.log({payload}) + const result = await this._send(payload); + // console.log({result}) + this.emit("debug", { action: "receiveRpcResult", result }); + // Process results in batch order + for (const { resolve, reject, payload } of batch) { + // Find the matching result + const resp = result.filter((r) => r.id === payload.id)[0]; + // No result; the node failed us in unexpected ways + if (resp == null) { + return reject(makeError("no response from server", "BAD_DATA", { + value: result, + info: { payload }, + })); + } + // The response is an error + if ("error" in resp) { + return reject(this.getRpcError(payload, resp)); + } + // All good; send the result + resolve(resp.result); + } + } + catch (error) { + this.emit("debug", { action: "receiveRpcError", error }); + for (const { reject } of batch) { + // @TODO: augment the error with the payload + reject(error); + } + } + })(); + } + }, stallTime); + } + constructor(network, options) { + super(network); + this.#nextId = 1; + this.#options = Object.assign({}, defaultOptions, options || {}); + this.#payloads = []; + this.#drainTimer = null; + this.#network = null; + { + let resolve = null; + const promise = new Promise((_resolve) => { + resolve = _resolve; + }); + this.#notReady = { promise, resolve }; + } + // Make sure any static network is compatbile with the provided netwrok + const staticNetwork = this._getOption("staticNetwork"); + if (staticNetwork) { + assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); + this.#network = staticNetwork; + } + } + /** + * Returns the value associated with the option %%key%%. + * + * Sub-classes can use this to inquire about configuration options. + */ + _getOption(key) { + return this.#options[key]; + } + /** + * Gets the [[Network]] this provider has committed to. On each call, the network + * is detected, and if it has changed, the call will reject. + */ + get _network() { + assert(this.#network, "network is not available yet", "NETWORK_ERROR"); + return this.#network; + } + /* + { + assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { + operation: "jsonRpcApiProvider._send" + }); + } + */ + /** + * Resolves to the non-normalized value by performing %%req%%. + * + * Sub-classes may override this to modify behavior of actions, + * and should generally call ``super._perform`` as a fallback. + */ + async _perform(req) { + const request = this.getRpcRequest(req); + if (request != null) { + return await this.send(request.method, request.args); + } + return super._perform(req); + } + /** + * Sub-classes may override this; it detects the *actual* network that + * we are **currently** connected to. + * + * Keep in mind that [[send]] may only be used once [[ready]], otherwise the + * _send primitive must be used instead. + */ + async _detectNetwork() { + const network = this._getOption("staticNetwork"); + if (network) { + return network; + } + // If we are ready, use ``send``, which enabled requests to be batched + if (this.ready) { + return Network.from(getBigInt(await this.send("xcb_networkId", []))); + } + // We are not ready yet; use the primitive _send + const payload = { + id: this.#nextId++, + method: "xcb_networkId", + params: [], + jsonrpc: "2.0", + }; + this.emit("debug", { action: "sendRpcPayload", payload }); + let result; + try { + result = (await this._send(payload))[0]; + } + catch (error) { + this.emit("debug", { action: "receiveRpcError", error }); + throw error; + } + this.emit("debug", { action: "receiveRpcResult", result }); + if ("result" in result) { + return Network.from(getBigInt(result.result)); + } + throw this.getRpcError(payload, result); + } + /** + * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls + * will be passed to [[_send]] from [[send]]. If it is overridden, then + * ``super._start()`` **MUST** be called. + * + * Calling it multiple times is safe and has no effect. + */ + _start() { + if (this.#notReady == null || this.#notReady.resolve == null) { + return; + } + this.#notReady.resolve(); + this.#notReady = null; + (async () => { + // Bootstrap the network + while (this.#network == null) { + try { + this.#network = await this._detectNetwork(); + } + catch (error) { + console.log("JsonRpcProvider failed to startup; retry in 1s"); + await stall$3(1000); + } + } + // Start dispatching requests + this.#scheduleDrain(); + })(); + } + /** + * Resolves once the [[_start]] has been called. This can be used in + * sub-classes to defer sending data until the connection has been + * established. + */ + async _waitUntilReady() { + if (this.#notReady == null) { + return; + } + return await this.#notReady.promise; + } + /** + * Return a Subscriber that will manage the %%sub%%. + * + * Sub-classes may override this to modify the behavior of + * subscription management. + */ + _getSubscriber(sub) { + // Pending Filters aren't availble via polling + if (sub.type === "pending") { + return new FilterIdPendingSubscriber(this); + } + if (sub.type === "event") { + if (this._getOption("polling")) { + return new PollingEventSubscriber(this, sub.filter); + } + return new FilterIdEventSubscriber(this, sub.filter); + } + // Orphaned Logs are handled automatically, by the filter, since + // logs with removed are emitted by it + if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { + return new UnmanagedSubscriber("orphan"); + } + return super._getSubscriber(sub); + } + /** + * Returns true only if the [[_start]] has been called. + */ + get ready() { + return this.#notReady == null; + } + /** + * Returns %%tx%% as a normalized JSON-RPC transaction request, + * which has all values hexlified and any numeric values converted + * to Quantity values. + */ + getRpcTransaction(tx) { + const result = {}; + // JSON-RPC now requires numeric values to be "quantity" values + [ + "networkId", + "energyLimit", + "energyPrice", + "type", + "nonce", + "value", + ].forEach((key) => { + if (tx[key] == null) { + return; + } + let dstKey = key; + if (key === "energyLimit") { + dstKey = "energy"; + } + result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`)); + }); + // Make sure addresses and data are lowercase + ["from", "to", "data"].forEach((key) => { + if (tx[key] == null) { + return; + } + result[key] = hexlify(tx[key]); + }); + return result; + } + /** + * Returns the request method and arguments required to perform + * %%req%%. + */ + getRpcRequest(req) { + switch (req.method) { + case "networkId": + return { method: "xcb_networkId", args: [] }; + case "getBlockNumber": + return { method: "xcb_blockNumber", args: [] }; + case "getEnergyPrice": + return { method: "xcb_energyPrice", args: [] }; + case "getBalance": { + return { + method: "xcb_getBalance", + args: [getLowerCase(req.address), req.blockTag], + }; + } + case "getTransactionCount": + return { + method: "xcb_getTransactionCount", + args: [getLowerCase(req.address), req.blockTag], + }; + case "getCode": + return { + method: "xcb_getCode", + args: [getLowerCase(req.address), req.blockTag], + }; + case "getStorage": + return { + method: "xcb_getStorageAt", + args: [ + getLowerCase(req.address), + "0x" + req.position.toString(16), + req.blockTag, + ], + }; + case "broadcastTransaction": + return { + method: "xcb_sendRawTransaction", + args: [req.signedTransaction], + }; + case "getBlock": + if ("blockTag" in req) { + return { + method: "xcb_getBlockByNumber", + args: [req.blockTag, !!req.includeTransactions], + }; + } + else if ("blockHash" in req) { + return { + method: "xcb_getBlockByHash", + args: [req.blockHash, !!req.includeTransactions], + }; + } + break; + case "getTransaction": + return { + method: "xcb_getTransactionByHash", + args: [req.hash], + }; + case "getTransactionReceipt": + return { + method: "xcb_getTransactionReceipt", + args: [req.hash], + }; + case "call": + return { + method: "xcb_call", + args: [this.getRpcTransaction(req.transaction), req.blockTag], + }; + case "estimateEnergy": { + return { + method: "xcb_estimateEnergy", + args: [this.getRpcTransaction(req.transaction)], + }; + } + case "getLogs": + if (req.filter && req.filter.address != null) { + if (Array.isArray(req.filter.address)) { + req.filter.address = req.filter.address.map(getLowerCase); + } + else { + req.filter.address = getLowerCase(req.filter.address); + } + } + return { method: "xcb_getLogs", args: [req.filter] }; + } + return null; + } + /** + * Returns an CoreBC-style Error for the given JSON-RPC error + * %%payload%%, coalescing the various strings and error shapes + * that different nodes return, coercing them into a machine-readable + * standardized error. + */ + getRpcError(payload, _error) { + const { method } = payload; + const { error } = _error; + if (method === "xcb_estimateEnergy" && error.message) { + const msg = error.message; + if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { + return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { + transaction: payload.params[0], + info: { payload, error }, + }); + } + } + if (method === "xcb_call" || method === "xcb_estimateEnergy") { + const result = spelunkData(error); + const e = AbiCoder.getBuiltinCallException(method === "xcb_call" ? "call" : "estimateEnergy", payload.params[0], result ? result.data : null); + e.info = { error, payload }; + return e; + } + // Only estimateEnergy and call can return arbitrary contract-defined text, so now we + // we can process text safely. + const message = JSON.stringify(spelunkMessage(error)); + if (typeof error.message === "string" && + error.message.match(/user denied|corebc-user-denied/i)) { + const actionMap = { + xcb_sign: "signMessage", + personal_sign: "signMessage", + xcb_signTypedData_v4: "signTypedData", + xcb_signTransaction: "signTransaction", + xcb_sendTransaction: "sendTransaction", + xcb_requestAccounts: "requestAccess", + wallet_requestAccounts: "requestAccess", + }; + return makeError(`user rejected action`, "ACTION_REJECTED", { + action: actionMap[method] || "unknown", + reason: "rejected", + info: { payload, error }, + }); + } + if (method === "xcb_sendRawTransaction" || + method === "xcb_sendTransaction") { + const transaction = payload.params[0]; + if (message.match(/insufficient funds|base fee exceeds energy limit/i)) { + return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { + transaction, + info: { error }, + }); + } + if (message.match(/nonce/i) && message.match(/too low/i)) { + return makeError("nonce has already been used", "NONCE_EXPIRED", { + transaction, + info: { error }, + }); + } + // "replacement transaction underpriced" + if (message.match(/replacement transaction/i) && + message.match(/underpriced/i)) { + return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { + transaction, + info: { error }, + }); + } + if (message.match(/only replay-protected/i)) { + return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { + operation: method, + info: { transaction, info: { error } }, + }); + } + } + if (message.match(/the method .* does not exist/i)) { + return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { + operation: payload.method, + info: { error }, + }); + } + return makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); + } + /** + * Requests the %%method%% with %%params%% via the JSON-RPC protocol + * over the underlying channel. This can be used to call methods + * on the backend that do not have a high-level API within the Provider + * API. + * + * This method queues requests according to the batch constraints + * in the options, assigns the request a unique ID. + * + * **Do NOT override** this method in sub-classes; instead + * override [[_send]] or force the options values in the + * call to the constructor to modify this method's behavior. + */ + send(method, params) { + // @TODO: cache networkId?? purge on switch_networks + const id = this.#nextId++; + const promise = new Promise((resolve, reject) => { + this.#payloads.push({ + resolve, + reject, + payload: { method, params, id, jsonrpc: "2.0" }, + }); + }); + // If there is not a pending drainTimer, set one + this.#scheduleDrain(); + return promise; + } + /** + * Resolves to the [[Signer]] account for %%address%% managed by + * the client. + * + * If the %%address%% is a number, it is used as an index in the + * the accounts from [[listAccounts]]. + * + * This can only be used on clients which manage accounts (such as + * Geth with imported account or MetaMask). + * + * Throws if the account doesn't exist. + */ + async getSigner(address) { + if (address == null) { + address = 0; + } + const accountsPromise = this.send("xcb_accounts", []); + // Account index + if (typeof address === "number") { + const accounts = await accountsPromise; + if (address >= accounts.length) { + throw new Error("no such account"); + } + return new JsonRpcSigner(this, accounts[address]); + } + const { accounts } = await resolveProperties({ + network: this.getNetwork(), + accounts: accountsPromise, + }); + // Account address + address = getAddress(address); + for (const account of accounts) { + if (getAddress(account) === address) { + return new JsonRpcSigner(this, address); + } + } + throw new Error("invalid account"); + } + async listAccounts() { + const accounts = await this.send("xcb_accounts", []); + return accounts.map((a) => new JsonRpcSigner(this, a)); + } + } + class JsonRpcApiPollingProvider extends JsonRpcApiProvider { + #pollingInterval; + constructor(network, options) { + super(network, options); + this.#pollingInterval = 4000; + } + _getSubscriber(sub) { + const subscriber = super._getSubscriber(sub); + if (isPollable(subscriber)) { + subscriber.pollingInterval = this.#pollingInterval; + } + return subscriber; + } + /** + * The polling interval (default: 4000 ms) + */ + get pollingInterval() { + return this.#pollingInterval; + } + set pollingInterval(value) { + if (!Number.isInteger(value) || value < 0) { + throw new Error("invalid interval"); + } + this.#pollingInterval = value; + this._forEachSubscriber((sub) => { + if (isPollable(sub)) { + sub.pollingInterval = this.#pollingInterval; + } + }); + } + } + /** + * The JsonRpcProvider is one of the most common Providers, + * which performs all operations over HTTP (or HTTPS) requests. + * + * Events are processed by polling the backend for the current block + * number; when it advances, all block-base events are then checked + * for updates. + */ + class JsonRpcProvider extends JsonRpcApiPollingProvider { + #connect; + constructor(url, network, options) { + if (url == null) { + url = "http://localhost:8545"; + } + super(network, options); + if (typeof url === "string") { + this.#connect = new FetchRequest(url); + } + else { + this.#connect = url.clone(); + } + } + _getConnection() { + return this.#connect.clone(); + } + async send(method, params) { + // All requests are over HTTP, so we can just start handling requests + // We do this here rather than the constructor so that we don't send any + // requests to the network (i.e. xcb_networkId) until we absolutely have to. + await this._start(); + return await super.send(method, params); + } + async _send(payload) { + // Configure a POST connection for the requested method + const request = this._getConnection(); + request.body = JSON.stringify(payload); + request.setHeader("content-type", "application/json"); + const response = await request.send(); + response.assertOk(); + let resp = response.bodyJson; + if (!Array.isArray(resp)) { + resp = [resp]; + } + return resp; + } + } + function spelunkData(value) { + if (value == null) { + return null; + } + // These *are* the droids we're looking for. + if (typeof value.message === "string" && + value.message.match("reverted") && + isHexString(value.data)) { + return { message: value.message, data: value.data }; + } + // Spelunk further... + if (typeof value === "object") { + for (const key in value) { + const result = spelunkData(value[key]); + if (result) { + return result; + } + } + return null; + } + // Might be a JSON string we can further descend... + if (typeof value === "string") { + try { + return spelunkData(JSON.parse(value)); + } + catch (error) { } + } + return null; + } + function _spelunkMessage(value, result) { + if (value == null) { + return; + } + // These *are* the droids we're looking for. + if (typeof value.message === "string") { + result.push(value.message); + } + // Spelunk further... + if (typeof value === "object") { + for (const key in value) { + _spelunkMessage(value[key], result); + } + } + // Might be a JSON string we can further descend... + if (typeof value === "string") { + try { + return _spelunkMessage(JSON.parse(value), result); + } + catch (error) { } + } + } + function spelunkMessage(value) { + const result = []; + _spelunkMessage(value, result); + return result; + } + + /** + * [[link-ankr]] provides a third-party service for connecting to + * various blockchains over JSON-RPC. + * + * **Supported Networks** + * + * - Core Mainnet (``mainnet``) + * - Goerli Testnet (``goerli``) + * - Polygon (``matic``) + * - Arbitrum (``arbitrum``) + * + * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] + */ + const defaultApiKey$1 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; + function getHost$4(name) { + switch (name) { + case "mainnet": + return "rpc.ankr.com/eth"; + case "goerli": + return "rpc.ankr.com/xcb_goerli"; + case "matic": + return "rpc.ankr.com/polygon"; + case "arbitrum": + return "rpc.ankr.com/arbitrum"; + } + assertArgument(false, "unsupported network", "network", name); + } + /** + * The **AnkrProvider** connects to the [[link-ankr]] + * JSON-RPC end-points. + * + * By default, a highly-throttled API key is used, which is + * appropriate for quick prototypes and simple scripts. To + * gain access to an increased rate-limit, it is highly + * recommended to [sign up here](link-ankr-signup). + */ + class AnkrProvider extends JsonRpcProvider { + /** + * The API key for the Ankr connection. + */ + apiKey; + /** + * Create a new **AnkrProvider**. + * + * By default connecting to ``mainnet`` with a highly throttled + * API key. + */ + constructor(_network, apiKey) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (apiKey == null) { + apiKey = defaultApiKey$1; + } + // Ankr does not support filterId, so we force polling + const options = { polling: true, staticNetwork: network }; + const request = AnkrProvider.getRequest(network, apiKey); + super(request, network, options); + defineProperties(this, { apiKey }); + } + _getProvider(networkId) { + try { + return new AnkrProvider(networkId, this.apiKey); + } + catch (error) { } + return super._getProvider(networkId); + } + /** + * Returns a prepared request for connecting to %%network%% with + * %%apiKey%%. + */ + static getRequest(network, apiKey) { + if (apiKey == null) { + apiKey = defaultApiKey$1; + } + const request = new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`); + request.allowGzip = true; + if (apiKey === defaultApiKey$1) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("AnkrProvider"); + return true; + }; + } + return request; + } + getRpcError(payload, error) { + if (payload.method === "xcb_sendRawTransaction") { + if (error && + error.error && + error.error.message === "INTERNAL_ERROR: could not replace existing tx") { + error.error.message = "replacement transaction underpriced"; + } + } + return super.getRpcError(payload, error); + } + isCommunityResource() { + return this.apiKey === defaultApiKey$1; + } + } + + /** + * About Alchemy + * + * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] + */ + const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; + function getHost$3(name) { + switch (name) { + case "mainnet": + return "eth-mainnet.alchemyapi.io"; + case "goerli": + return "eth-goerli.g.alchemy.com"; + case "sepolia": + return "eth-sepolia.g.alchemy.com"; + case "arbitrum": + return "arb-mainnet.g.alchemy.com"; + case "arbitrum-goerli": + return "arb-goerli.g.alchemy.com"; + case "matic": + return "polygon-mainnet.g.alchemy.com"; + case "matic-mumbai": + return "polygon-mumbai.g.alchemy.com"; + case "optimism": + return "opt-mainnet.g.alchemy.com"; + case "optimism-goerli": + return "opt-goerli.g.alchemy.com"; + } + assertArgument(false, "unsupported network", "network", name); + } + /** + * The **AlchemyProvider** connects to the [[link-alchemy]] + * JSON-RPC end-points. + * + * By default, a highly-throttled API key is used, which is + * appropriate for quick prototypes and simple scripts. To + * gain access to an increased rate-limit, it is highly + * recommended to [sign up here](link-alchemy-signup). + * + * @_docloc: api/providers/thirdparty + */ + class AlchemyProvider extends JsonRpcProvider { + apiKey; + constructor(_network, apiKey) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (apiKey == null) { + apiKey = defaultApiKey; + } + const request = AlchemyProvider.getRequest(network, apiKey); + super(request, network, { staticNetwork: network }); + defineProperties(this, { apiKey }); + } + _getProvider(networkId) { + try { + return new AlchemyProvider(networkId, this.apiKey); + } + catch (error) { } + return super._getProvider(networkId); + } + async _perform(req) { + // https://docs.alchemy.com/reference/trace-transaction + if (req.method === "getTransactionResult") { + const { trace, tx } = await resolveProperties({ + trace: this.send("trace_transaction", [req.hash]), + tx: this.getTransaction(req.hash), + }); + if (trace == null || tx == null) { + return null; + } + let data; + let error = false; + try { + data = trace[0].result.output; + error = trace[0].error === "Reverted"; + } + catch (error) { } + if (data) { + assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { + action: "getTransactionResult", + data, + reason: null, + transaction: tx, + invocation: null, + revert: null, // @TODO + }); + return data; + } + assert(false, "could not parse trace result", "BAD_DATA", { + value: trace, + }); + } + return await super._perform(req); + } + isCommunityResource() { + return this.apiKey === defaultApiKey; + } + static getRequest(network, apiKey) { + if (apiKey == null) { + apiKey = defaultApiKey; + } + const request = new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`); + request.allowGzip = true; + if (apiKey === defaultApiKey) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("alchemy"); + return true; + }; + } + return request; + } + } + + /** + * About Cloudflare + * + * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] + */ + /** + * About Cloudflare... + */ + class CloudflareProvider extends JsonRpcProvider { + constructor(_network) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + assertArgument(network.name === "mainnet", "unsupported network", "network", _network); + super("https://cloudflare-eth.com/", network, { staticNetwork: network }); + } + } + + function getGlobal() { + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw new Error("unable to locate global object"); + } + const _WebSocket = getGlobal().WebSocket; + + /** + * Generic long-lived socket provider. + * + * Sub-classing notes + * - a sub-class MUST call the `_start()` method once connected + * - a sub-class MUST override the `_write(string)` method + * - a sub-class MUST call `_processMessage(string)` for each message + * + * @_subsection: api/providers/abstract-provider + */ + class SocketSubscriber { + #provider; + #filter; + get filter() { + return JSON.parse(this.#filter); + } + #filterId; + #paused; + #emitPromise; + constructor(provider, filter) { + this.#provider = provider; + this.#filter = JSON.stringify(filter); + this.#filterId = null; + this.#paused = null; + this.#emitPromise = null; + } + start() { + this.#filterId = this.#provider + .send("xcb_subscribe", this.filter) + .then((filterId) => { + this.#provider._register(filterId, this); + return filterId; + }); + } + stop() { + this.#filterId.then((filterId) => { + this.#provider.send("xcb_unsubscribe", [filterId]); + }); + this.#filterId = null; + } + // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs + // and resume + pause(dropWhilePaused) { + assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); + this.#paused = !!dropWhilePaused; + } + resume() { + this.#paused = null; + } + _handleMessage(message) { + if (this.#filterId == null) { + return; + } + if (this.#paused === null) { + let emitPromise = this.#emitPromise; + if (emitPromise == null) { + emitPromise = this._emit(this.#provider, message); + } + else { + emitPromise = emitPromise.then(async () => { + await this._emit(this.#provider, message); + }); + } + this.#emitPromise = emitPromise.then(() => { + if (this.#emitPromise === emitPromise) { + this.#emitPromise = null; + } + }); + } + } + async _emit(provider, message) { + throw new Error("sub-classes must implemente this; _emit"); + } + } + class SocketBlockSubscriber extends SocketSubscriber { + constructor(provider) { + super(provider, ["newHeads"]); + } + async _emit(provider, message) { + provider.emit("block", parseInt(message.number)); + } + } + class SocketPendingSubscriber extends SocketSubscriber { + constructor(provider) { + super(provider, ["newPendingTransactions"]); + } + async _emit(provider, message) { + provider.emit("pending", message); + } + } + class SocketEventSubscriber extends SocketSubscriber { + #logFilter; + get logFilter() { + return JSON.parse(this.#logFilter); + } + constructor(provider, filter) { + super(provider, ["logs", filter]); + this.#logFilter = JSON.stringify(filter); + } + async _emit(provider, message) { + provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); + } + } + /** + * SocketProvider... + * + */ + class SocketProvider extends JsonRpcApiProvider { + #callbacks; + // Maps each filterId to its subscriber + #subs; + // If any events come in before a subscriber has finished + // registering, queue them + #pending; + constructor(network) { + super(network, { batchMaxCount: 1 }); + this.#callbacks = new Map(); + this.#subs = new Map(); + this.#pending = new Map(); + } + // This value is only valid after _start has been called + /* + get _network(): Network { + if (this.#network == null) { + throw new Error("this shouldn't happen"); + } + return this.#network.clone(); + } + */ + _getSubscriber(sub) { + switch (sub.type) { + case "close": + return new UnmanagedSubscriber("close"); + case "block": + return new SocketBlockSubscriber(this); + case "pending": + return new SocketPendingSubscriber(this); + case "event": + return new SocketEventSubscriber(this, sub.filter); + case "orphan": + // Handled auto-matically within AbstractProvider + // when the log.removed = true + if (sub.filter.orphan === "drop-log") { + return new UnmanagedSubscriber("drop-log"); + } + } + return super._getSubscriber(sub); + } + _register(filterId, subscriber) { + this.#subs.set(filterId, subscriber); + const pending = this.#pending.get(filterId); + if (pending) { + for (const message of pending) { + subscriber._handleMessage(message); + } + this.#pending.delete(filterId); + } + } + async _send(payload) { + // WebSocket provider doesn't accept batches + assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); + // @TODO: stringify payloads here and store to prevent mutations + // Prepare a promise to respond to + const promise = new Promise((resolve, reject) => { + this.#callbacks.set(payload.id, { payload, resolve, reject }); + }); + // Wait until the socket is connected before writing to it + await this._waitUntilReady(); + // Write the request to the socket + await this._write(JSON.stringify(payload)); + return [await promise]; + } + // Sub-classes must call this once they are connected + /* + async _start(): Promise { + if (this.#ready) { return; } + + for (const { payload } of this.#callbacks.values()) { + await this._write(JSON.stringify(payload)); + } + + this.#ready = (async function() { + await super._start(); + })(); + } + */ + // Sub-classes must call this for each message + async _processMessage(message) { + const result = (JSON.parse(message)); + if ("id" in result) { + const callback = this.#callbacks.get(result.id); + if (callback == null) { + this.emit("error", makeError("received result for unknown id", "UNKNOWN_ERROR", { + reasonCode: "UNKNOWN_ID", + result, + })); + return; + } + this.#callbacks.delete(result.id); + callback.resolve(result); + } + else if (result.method === "xcb_subscription") { + const filterId = result.params.subscription; + const subscriber = this.#subs.get(filterId); + if (subscriber) { + subscriber._handleMessage(result.params.result); + } + else { + let pending = this.#pending.get(filterId); + if (pending == null) { + pending = []; + this.#pending.set(filterId, pending); + } + pending.push(result.params.result); + } + } + } + async _write(message) { + throw new Error("sub-classes must override this"); + } + } + + class WebSocketProvider extends SocketProvider { + #connect; + #websocket; + get websocket() { + if (this.#websocket == null) { + throw new Error("websocket closed"); + } + return this.#websocket; + } + constructor(url, network) { + super(network); + if (typeof url === "string") { + this.#connect = () => { + return new _WebSocket(url); + }; + this.#websocket = this.#connect(); + } + else if (typeof url === "function") { + this.#connect = url; + this.#websocket = url(); + } + else { + this.#connect = null; + this.#websocket = url; + } + this.websocket.onopen = async () => { + try { + await this._start(); + this.resume(); + } + catch (error) { + console.log("failed to start WebsocketProvider", error); + // @TODO: now what? Attempt reconnect? + } + }; + this.websocket.onmessage = (message) => { + this._processMessage(message.data); + }; + /* + this.websocket.onclose = (event) => { + // @TODO: What event.code should we reconnect on? + const reconnect = false; + if (reconnect) { + this.pause(true); + if (this.#connect) { + this.#websocket = this.#connect(); + this.#websocket.onopen = ... + // @TODO: this requires the super class to rebroadcast; move it there + } + this._reconnect(); + } + }; + */ + } + async _write(message) { + this.websocket.send(message); + } + async destroy() { + if (this.#websocket != null) { + this.#websocket.close(); + this.#websocket = null; + } + super.destroy(); + } + } + + /** + * [[link-infura]] provides a third-party service for connecting to + * various blockchains over JSON-RPC. + * + * **Supported Networks** + * + * - Core Mainnet (``mainnet``) + * - Goerli Testnet (``goerli``) + * - Sepolia Testnet (``sepolia``) + * - Arbitrum (``arbitrum``) + * - Arbitrum Goerli Testnet (``arbitrum-goerli``) + * - Optimism (``optimism``) + * - Optimism Goerli Testnet (``optimism-goerli``) + * - Polygon (``matic``) + * - Polygon Mumbai Testnet (``matic-mumbai``) + * + * @_subsection: api/providers/thirdparty:INFURA [providers-infura] + */ + const defaultProjectId = "84842078b09946638c03157f83405213"; + function getHost$2(name) { + switch (name) { + case "mainnet": + return "mainnet.infura.io"; + case "goerli": + return "goerli.infura.io"; + case "sepolia": + return "sepolia.infura.io"; + case "arbitrum": + return "arbitrum-mainnet.infura.io"; + case "arbitrum-goerli": + return "arbitrum-goerli.infura.io"; + case "matic": + return "polygon-mainnet.infura.io"; + case "matic-mumbai": + return "polygon-mumbai.infura.io"; + case "optimism": + return "optimism-mainnet.infura.io"; + case "optimism-goerli": + return "optimism-goerli.infura.io"; + } + assertArgument(false, "unsupported network", "network", name); + } + /** + * The **InfuraWebSocketProvider** connects to the [[link-infura]] + * WebSocket end-points. + * + * By default, a highly-throttled API key is used, which is + * appropriate for quick prototypes and simple scripts. To + * gain access to an increased rate-limit, it is highly + * recommended to [sign up here](link-infura-signup). + */ + class InfuraWebSocketProvider extends WebSocketProvider { + /** + * The Project ID for the INFURA connection. + */ + projectId; + /** + * The Project Secret. + * + * If null, no authenticated requests are made. This should not + * be used outside of private contexts. + */ + projectSecret; + /** + * Creates a new **InfuraWebSocketProvider**. + */ + constructor(network, projectId) { + const provider = new InfuraProvider(network, projectId); + const req = provider._getConnection(); + assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); + const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); + super(url, network); + defineProperties(this, { + projectId: provider.projectId, + projectSecret: provider.projectSecret, + }); + } + isCommunityResource() { + return this.projectId === defaultProjectId; + } + } + /** + * The **InfuraProvider** connects to the [[link-infura]] + * JSON-RPC end-points. + * + * By default, a highly-throttled API key is used, which is + * appropriate for quick prototypes and simple scripts. To + * gain access to an increased rate-limit, it is highly + * recommended to [sign up here](link-infura-signup). + */ + class InfuraProvider extends JsonRpcProvider { + /** + * The Project ID for the INFURA connection. + */ + projectId; + /** + * The Project Secret. + * + * If null, no authenticated requests are made. This should not + * be used outside of private contexts. + */ + projectSecret; + /** + * Creates a new **InfuraProvider**. + */ + constructor(_network, projectId, projectSecret) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (projectId == null) { + projectId = defaultProjectId; + } + if (projectSecret == null) { + projectSecret = null; + } + const request = InfuraProvider.getRequest(network, projectId, projectSecret); + super(request, network, { staticNetwork: network }); + defineProperties(this, { projectId, projectSecret }); + } + _getProvider(networkId) { + try { + return new InfuraProvider(networkId, this.projectId, this.projectSecret); + } + catch (error) { } + return super._getProvider(networkId); + } + isCommunityResource() { + return this.projectId === defaultProjectId; + } + /** + * Creates a new **InfuraWebSocketProvider**. + */ + static getWebSocketProvider(network, projectId) { + return new InfuraWebSocketProvider(network, projectId); + } + /** + * Returns a prepared request for connecting to %%network%% + * with %%projectId%% and %%projectSecret%%. + */ + static getRequest(network, projectId, projectSecret) { + if (projectId == null) { + projectId = defaultProjectId; + } + if (projectSecret == null) { + projectSecret = null; + } + const request = new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`); + request.allowGzip = true; + if (projectSecret) { + request.setCredentials("", projectSecret); + } + if (projectId === defaultProjectId) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("InfuraProvider"); + return true; + }; + } + return request; + } + } + + /** + * [[link-quicknode]] provides a third-party service for connecting to + * various blockchains over JSON-RPC. + * + * **Supported Networks** + * + * - Core Mainnet (``mainnet``) + * - Goerli Testnet (``goerli``) + * - Arbitrum (``arbitrum``) + * - Arbitrum Goerli Testnet (``arbitrum-goerli``) + * - Optimism (``optimism``) + * - Optimism Goerli Testnet (``optimism-goerli``) + * - Polygon (``matic``) + * - Polygon Mumbai Testnet (``matic-mumbai``) + * + * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] + */ + const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; + function getHost$1(name) { + switch (name) { + case "mainnet": + return "corebc.quiknode.pro"; + case "arbitrum": + return "corebc.arbitrum-mainnet.quiknode.pro"; + case "arbitrum-goerli": + return "corebc.arbitrum-goerli.quiknode.pro"; + case "matic": + return "corebc.matic.quiknode.pro"; + case "matic-mumbai": + return "corebc.matic-testnet.quiknode.pro"; + case "optimism": + return "corebc.optimism.quiknode.pro"; + case "optimism-goerli": + return "corebc.optimism-goerli.quiknode.pro"; + } + assertArgument(false, "unsupported network", "network", name); + } + /** + * The **QuickNodeProvider** connects to the [[link-quicknode]] + * JSON-RPC end-points. + * + * By default, a highly-throttled API token is used, which is + * appropriate for quick prototypes and simple scripts. To + * gain access to an increased rate-limit, it is highly + * recommended to [sign up here](link-quicknode). + */ + class QuickNodeProvider extends JsonRpcProvider { + /** + * The API token. + */ + token; + /** + * Creates a new **QuickNodeProvider**. + */ + constructor(_network, token) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (token == null) { + token = defaultToken; + } + const request = QuickNodeProvider.getRequest(network, token); + super(request, network, { staticNetwork: network }); + defineProperties(this, { token }); + } + _getProvider(networkId) { + try { + return new QuickNodeProvider(networkId, this.token); + } + catch (error) { } + return super._getProvider(networkId); + } + isCommunityResource() { + return this.token === defaultToken; + } + /** + * Returns a new request prepared for %%network%% and the + * %%token%%. + */ + static getRequest(network, token) { + if (token == null) { + token = defaultToken; + } + const request = new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`); + request.allowGzip = true; + //if (projectSecret) { request.setCredentials("", projectSecret); } + if (token === defaultToken) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("QuickNodeProvider"); + return true; + }; + } + return request; + } + } + + /** + * Explain all the nitty-gritty about the **FallbackProvider**. + * + * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] + */ + const BN_1 = BigInt("1"); + const BN_2 = BigInt("2"); + function shuffle(array) { + for (let i = array.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + const tmp = array[i]; + array[i] = array[j]; + array[j] = tmp; + } + } + function stall$2(duration) { + return new Promise((resolve) => { + setTimeout(resolve, duration); + }); + } + function getTime() { + return new Date().getTime(); + } + function stringify(value) { + return JSON.stringify(value, (key, value) => { + if (typeof value === "bigint") { + return { type: "bigint", value: value.toString() }; + } + return value; + }); + } + const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; + const defaultState = { + blockNumber: -2, + requests: 0, + lateResponses: 0, + errorResponses: 0, + outOfSync: -1, + unsupportedEvents: 0, + rollingDuration: 0, + score: 0, + _network: null, + _updateNumber: null, + _totalTime: 0, + }; + async function waitForSync(config, blockNumber) { + while (config.blockNumber < 0 || config.blockNumber < blockNumber) { + if (!config._updateNumber) { + config._updateNumber = (async () => { + const blockNumber = await config.provider.getBlockNumber(); + if (blockNumber > config.blockNumber) { + config.blockNumber = blockNumber; + } + config._updateNumber = null; + })(); + } + await config._updateNumber; + config.outOfSync++; + } + } + function _normalize(value) { + if (value == null) { + return "null"; + } + if (Array.isArray(value)) { + return "[" + value.map(_normalize).join(",") + "]"; + } + if (typeof value === "object" && typeof value.toJSON === "function") { + return _normalize(value.toJSON()); + } + switch (typeof value) { + case "boolean": + case "symbol": + return value.toString(); + case "bigint": + case "number": + return BigInt(value).toString(); + case "string": + return JSON.stringify(value); + case "object": { + const keys = Object.keys(value); + keys.sort(); + return ("{" + + keys + .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`) + .join(",") + + "}"); + } + } + console.log("Could not serialize", value); + throw new Error("Hmm..."); + } + function normalizeResult(value) { + if ("error" in value) { + const error = value.error; + return { tag: _normalize(error), value: error }; + } + const result = value.result; + return { tag: _normalize(result), value: result }; + } + // This strategy picks the highest weight result, as long as the weight is + // equal to or greater than quorum + function checkQuorum(quorum, results) { + const tally = new Map(); + for (const { value, tag, weight } of results) { + const t = tally.get(tag) || { value, weight: 0 }; + t.weight += weight; + tally.set(tag, t); + } + let best = null; + for (const r of tally.values()) { + if (r.weight >= quorum && (!best || r.weight > best.weight)) { + best = r; + } + } + if (best) { + return best.value; + } + return undefined; + } + function getMedian(quorum, results) { + let resultWeight = 0; + const errorMap = new Map(); + let bestError = null; + const values = []; + for (const { value, tag, weight } of results) { + if (value instanceof Error) { + const e = errorMap.get(tag) || { value, weight: 0 }; + e.weight += weight; + errorMap.set(tag, e); + if (bestError == null || e.weight > bestError.weight) { + bestError = e; + } + } + else { + values.push(BigInt(value)); + resultWeight += weight; + } + } + if (resultWeight < quorum) { + // We have quorum for an error + if (bestError && bestError.weight >= quorum) { + return bestError.value; + } + // We do not have quorum for a result + return undefined; + } + // Get the sorted values + values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0)); + const mid = Math.floor(values.length / 2); + // Odd-length; take the middle value + if (values.length % 2) { + return values[mid]; + } + // Even length; take the ceiling of the mean of the center two values + return (values[mid - 1] + values[mid] + BN_1) / BN_2; + } + function getAnyResult(quorum, results) { + // If any value or error meets quorum, that is our preferred result + const result = checkQuorum(quorum, results); + if (result !== undefined) { + return result; + } + // Otherwise, do we have any result? + for (const r of results) { + if (r.value) { + return r.value; + } + } + // Nope! + return undefined; + } + function getFuzzyMode(quorum, results) { + if (quorum === 1) { + return getNumber(getMedian(quorum, results), "%internal"); + } + const tally = new Map(); + const add = (result, weight) => { + const t = tally.get(result) || { result, weight: 0 }; + t.weight += weight; + tally.set(result, t); + }; + for (const { weight, value } of results) { + const r = getNumber(value); + add(r - 1, weight); + add(r, weight); + add(r + 1, weight); + } + let bestWeight = 0; + let bestResult = undefined; + for (const { weight, result } of tally.values()) { + // Use this result, if this result meets quorum and has either: + // - a better weight + // - or equal weight, but the result is larger + if (weight >= quorum && + (weight > bestWeight || + (bestResult != null && weight === bestWeight && result > bestResult))) { + bestWeight = weight; + bestResult = result; + } + } + return bestResult; + } + /** + * A Fallback Provider. + * + */ + class FallbackProvider extends AbstractProvider { + quorum; + eventQuorum; + eventWorkers; + #configs; + #height; + #initialSyncPromise; + constructor(providers, network) { + super(network); + this.#configs = providers.map((p) => { + if (p instanceof AbstractProvider) { + return Object.assign({ provider: p }, defaultConfig, defaultState); + } + else { + return Object.assign({}, defaultConfig, p, defaultState); + } + }); + this.#height = -2; + this.#initialSyncPromise = null; + this.quorum = 2; //Math.ceil(providers.length / 2); + this.eventQuorum = 1; + this.eventWorkers = 1; + assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), "quorum exceed provider wieght", "quorum", this.quorum); + } + get providerConfigs() { + return this.#configs.map((c) => { + const result = Object.assign({}, c); + for (const key in result) { + if (key[0] === "_") { + delete result[key]; + } + } + return result; + }); + } + async _detectNetwork() { + return Network.from(getBigInt(await this._perform({ method: "networkId" }))); + } + // @TODO: Add support to select providers to be the event subscriber + //_getSubscriber(sub: Subscription): Subscriber { + // throw new Error("@TODO"); + //} + async _translatePerform(provider, req) { + switch (req.method) { + case "broadcastTransaction": + return await provider.broadcastTransaction(req.signedTransaction); + case "call": + return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); + case "networkId": + return (await provider.getNetwork()).networkId; + case "estimateEnergy": + return await provider.estimateEnergy(req.transaction); + case "getBalance": + return await provider.getBalance(req.address, req.blockTag); + case "getBlock": { + const block = "blockHash" in req ? req.blockHash : req.blockTag; + return await provider.getBlock(block, req.includeTransactions); + } + case "getBlockNumber": + return await provider.getBlockNumber(); + case "getCode": + return await provider.getCode(req.address, req.blockTag); + case "getEnergyPrice": + return (await provider.getFeeData()).energyPrice; + case "getLogs": + return await provider.getLogs(req.filter); + case "getStorage": + return await provider.getStorage(req.address, req.position, req.blockTag); + case "getTransaction": + return await provider.getTransaction(req.hash); + case "getTransactionCount": + return await provider.getTransactionCount(req.address, req.blockTag); + case "getTransactionReceipt": + return await provider.getTransactionReceipt(req.hash); + case "getTransactionResult": + return await provider.getTransactionResult(req.hash); + } + } + // Grab the next (random) config that is not already part of + // the running set + #getNextConfig(running) { + // @TODO: Maybe do a check here to favour (heavily) providers that + // do not require waitForSync and disfavour providers that + // seem down-ish or are behaving slowly + const configs = Array.from(running).map((r) => r.config); + // Shuffle the states, sorted by priority + const allConfigs = this.#configs.slice(); + shuffle(allConfigs); + allConfigs.sort((a, b) => b.priority - a.priority); + for (const config of allConfigs) { + if (configs.indexOf(config) === -1) { + return config; + } + } + return null; + } + // Adds a new runner (if available) to running. + #addRunner(running, req) { + const config = this.#getNextConfig(running); + // No runners available + if (config == null) { + return null; + } + // Create a new runner + const runner = { + config, + result: null, + didBump: false, + perform: null, + staller: null, + }; + const now = getTime(); + // Start performing this operation + runner.perform = (async () => { + try { + config.requests++; + const result = await this._translatePerform(config.provider, req); + runner.result = { result }; + } + catch (error) { + config.errorResponses++; + runner.result = { error }; + } + const dt = getTime() - now; + config._totalTime += dt; + config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; + runner.perform = null; + })(); + // Start a staller; when this times out, it's time to force + // kicking off another runner because we are taking too long + runner.staller = (async () => { + await stall$2(config.stallTimeout); + runner.staller = null; + })(); + running.add(runner); + return runner; + } + // Initializes the blockNumber and network for each runner and + // blocks until initialized + async #initialSync() { + let initialSync = this.#initialSyncPromise; + if (!initialSync) { + const promises = []; + this.#configs.forEach((config) => { + promises.push(waitForSync(config, 0)); + promises.push((async () => { + config._network = await config.provider.getNetwork(); + })()); + }); + this.#initialSyncPromise = initialSync = (async () => { + // Wait for all providers to have a block number and network + await Promise.all(promises); + // Check all the networks match + let networkId = null; + for (const config of this.#configs) { + const network = config._network; + if (networkId == null) { + networkId = network.networkId; + } + else if (network.networkId !== networkId) { + assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { + operation: "new FallbackProvider", + }); + } + } + })(); + } + await initialSync; + } + async #checkQuorum(running, req) { + // Get all the result objects + const results = []; + for (const runner of running) { + if (runner.result != null) { + const { tag, value } = normalizeResult(runner.result); + results.push({ tag, value, weight: runner.config.weight }); + } + } + // Are there enough results to event meet quorum? + if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) { + return undefined; + } + switch (req.method) { + case "getBlockNumber": { + // We need to get the bootstrap block height + if (this.#height === -2) { + this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({ + value: c.blockNumber, + tag: getNumber(c.blockNumber).toString(), + weight: c.weight, + }))))); + } + // Find the mode across all the providers, allowing for + // a little drift between block heights + const mode = getFuzzyMode(this.quorum, results); + if (mode === undefined) { + return undefined; + } + if (mode > this.#height) { + this.#height = mode; + } + return this.#height; + } + case "getEnergyPrice": + case "estimateEnergy": + return getMedian(this.quorum, results); + case "getBlock": + // Pending blocks are in the mempool and already + // quite untrustworthy; just grab anything + if ("blockTag" in req && req.blockTag === "pending") { + return getAnyResult(this.quorum, results); + } + return checkQuorum(this.quorum, results); + case "call": + case "networkId": + case "getBalance": + case "getTransactionCount": + case "getCode": + case "getStorage": + case "getTransaction": + case "getTransactionReceipt": + case "getLogs": + return checkQuorum(this.quorum, results); + case "broadcastTransaction": + return getAnyResult(this.quorum, results); + } + assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { + operation: `_perform(${stringify(req.method)})`, + }); + } + async #waitForQuorum(running, req) { + if (running.size === 0) { + throw new Error("no runners?!"); + } + // Any promises that are interesting to watch for; an expired stall + // or a successful perform + const interesting = []; + let newRunners = 0; + for (const runner of running) { + // No responses, yet; keep an eye on it + if (runner.perform) { + interesting.push(runner.perform); + } + // Still stalling... + if (runner.staller) { + interesting.push(runner.staller); + continue; + } + // This runner has already triggered another runner + if (runner.didBump) { + continue; + } + // Got a response (result or error) or stalled; kick off another runner + runner.didBump = true; + newRunners++; + } + // Check if we have reached quorum on a result (or error) + const value = await this.#checkQuorum(running, req); + if (value !== undefined) { + if (value instanceof Error) { + throw value; + } + return value; + } + // Add any new runners, because a staller timed out or a result + // or error response came in. + for (let i = 0; i < newRunners; i++) { + this.#addRunner(running, req); + } + // All providers have returned, and we have no result + assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { + request: "%sub-requests", + info: { + request: req, + results: Array.from(running).map((r) => stringify(r.result)), + }, + }); + // Wait for someone to either complete its perform or stall out + await Promise.race(interesting); + // This is recursive, but at worst case the depth is 2x the + // number of providers (each has a perform and a staller) + return await this.#waitForQuorum(running, req); + } + async _perform(req) { + // Broadcasting a transaction is rare (ish) and already incurs + // a cost on the user, so spamming is safe-ish. Just send it to + // every backend. + if (req.method === "broadcastTransaction") { + const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => { + try { + const result = await provider._perform(req); + return Object.assign(normalizeResult({ result }), { weight }); + } + catch (error) { + return Object.assign(normalizeResult({ error }), { weight }); + } + })); + const result = getAnyResult(this.quorum, results); + assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { + request: "%sub-requests", + info: { request: req, results: results.map(stringify) }, + }); + if (result instanceof Error) { + throw result; + } + return result; + } + await this.#initialSync(); + // Bootstrap enough runners to meet quorum + const running = new Set(); + for (let i = 0; i < this.quorum; i++) { + this.#addRunner(running, req); + } + const result = await this.#waitForQuorum(running, req); + // Track requests sent to a provider that are still + // outstanding after quorum has been otherwise found + for (const runner of running) { + if (runner.perform && runner.result == null) { + runner.config.lateResponses++; + } + } + return result; + } + async destroy() { + for (const { provider } of this.#configs) { + provider.destroy(); + } + super.destroy(); + } + } + + function isWebSocketLike(value) { + return (value && + typeof value.send === "function" && + typeof value.close === "function"); + } + function getDefaultProvider(network, options) { + if (options == null) { + options = {}; + } + if (typeof network === "string" && network.match(/^https?:/)) { + return new JsonRpcProvider(network); + } + if ((typeof network === "string" && network.match(/^wss?:/)) || + isWebSocketLike(network)) { + return new WebSocketProvider(network); + } + const providers = []; + if (options.alchemy !== "-") { + try { + providers.push(new AlchemyProvider(network, options.alchemy)); + } + catch (error) { + console.log(error); + } + } + if (options.ankr !== "-" && options.ankr != null) { + try { + providers.push(new AnkrProvider(network, options.ankr)); + } + catch (error) { + console.log(error); + } + } + if (options.cloudflare !== "-") { + try { + providers.push(new CloudflareProvider(network)); + } + catch (error) { + console.log(error); + } + } + if (options.infura !== "-") { + try { + let projectId = options.infura; + let projectSecret = undefined; + if (typeof projectId === "object") { + projectSecret = projectId.projectSecret; + projectId = projectId.projectId; + } + providers.push(new InfuraProvider(network, projectId, projectSecret)); + } + catch (error) { + console.log(error); + } + } + /* + if (options.pocket !== "-") { + try { + let appId = options.pocket; + let secretKey: undefined | string = undefined; + let loadBalancer: undefined | boolean = undefined; + if (typeof(appId) === "object") { + loadBalancer = !!appId.loadBalancer; + secretKey = appId.secretKey; + appId = appId.appId; + } + providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); + } catch (error) { console.log(error); } + } + */ + if (options.quicknode !== "-") { + try { + let token = options.quicknode; + providers.push(new QuickNodeProvider(network, token)); + } + catch (error) { + console.log(error); + } + } + assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { + operation: "getDefaultProvider", + }); + if (providers.length === 1) { + return providers[0]; + } + return new FallbackProvider(providers); + } + + class NonceManager extends AbstractSigner { + signer; + #noncePromise; + #delta; + constructor(signer) { + super(signer.provider); + defineProperties(this, { signer }); + this.#noncePromise = null; + this.#delta = 0; + } + async getAddress() { + return this.signer.getAddress(); + } + connect(provider) { + return new NonceManager(this.signer.connect(provider)); + } + async getNonce(blockTag) { + if (blockTag === "pending") { + if (this.#noncePromise == null) { + this.#noncePromise = super.getNonce("pending"); + } + const delta = this.#delta; + return (await this.#noncePromise) + delta; + } + return super.getNonce(blockTag); + } + increment() { + this.#delta++; + } + reset() { + this.#delta = 0; + this.#noncePromise = null; + } + async sendTransaction(tx) { + const noncePromise = this.getNonce("pending"); + this.increment(); + tx = await this.signer.populateTransaction(tx); + tx.nonce = await noncePromise; + // @TODO: Maybe handle interesting/recoverable errors? + // Like don't increment if the tx was certainly not sent + return await this.signer.sendTransaction(tx); + } + signTransaction(tx) { + return this.signer.signTransaction(tx); + } + signMessage(message) { + return this.signer.signMessage(message); + } + signTypedData(domain, types, value) { + return this.signer.signTypedData(domain, types, value); + } + } + + class BrowserProvider extends JsonRpcApiPollingProvider { + #request; + constructor(core, network) { + super(network, { batchMaxCount: 1 }); + this.#request = async (method, params) => { + const payload = { method, params }; + this.emit("debug", { action: "sendEip1193Request", payload }); + try { + const result = await core.request(payload); + this.emit("debug", { action: "receiveEip1193Result", result }); + return result; + } + catch (e) { + const error = new Error(e.message); + error.code = e.code; + error.data = e.data; + error.payload = payload; + this.emit("debug", { action: "receiveEip1193Error", error }); + throw error; + } + }; + } + async send(method, params) { + await this._start(); + return await super.send(method, params); + } + async _send(payload) { + assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); + try { + const result = await this.#request(payload.method, payload.params || []); + return [{ id: payload.id, result }]; + } + catch (e) { + return [ + { + id: payload.id, + error: { code: e.code, data: e.data, message: e.message }, + }, + ]; + } + } + getRpcError(payload, error) { + error = JSON.parse(JSON.stringify(error)); + // EIP-1193 gives us some machine-readable error codes, so rewrite + // them into + switch (error.error.code || -1) { + case 4001: + error.error.message = `corebc-user-denied: ${error.error.message}`; + break; + case 4200: + error.error.message = `corebc-unsupported: ${error.error.message}`; + break; + } + return super.getRpcError(payload, error); + } + async hasSigner(address) { + if (address == null) { + address = 0; + } + const accounts = await this.send("xcb_accounts", []); + if (typeof address === "number") { + return accounts.length > address; + } + address = address.toLowerCase(); + return (accounts.filter((a) => a.toLowerCase() === address).length !== 0); + } + async getSigner(address) { + if (address == null) { + address = 0; + } + if (!(await this.hasSigner(address))) { + try { + //const resp = + await this.#request("xcb_requestAccounts", []); + //console.log("RESP", resp); + } + catch (error) { + const payload = error.payload; + throw this.getRpcError(payload, { id: payload.id, error }); + } + } + return await super.getSigner(address); + } + } + + /** + * [[link-pocket]] provides a third-party service for connecting to + * various blockchains over JSON-RPC. + * + * **Supported Networks** + * + * - Core Mainnet (``mainnet``) + * - Goerli Testnet (``goerli``) + * - Polygon (``matic``) + * - Arbitrum (``arbitrum``) + * + * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] + */ + const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; + function getHost(name) { + switch (name) { + case "mainnet": + return "eth-mainnet.gateway.pokt.network"; + case "goerli": + return "eth-goerli.gateway.pokt.network"; + case "matic": + return "poly-mainnet.gateway.pokt.network"; + case "matic-mumbai": + return "polygon-mumbai-rpc.gateway.pokt.network"; + } + assertArgument(false, "unsupported network", "network", name); + } + /** + * The **PocketProvider** connects to the [[link-pocket]] + * JSON-RPC end-points. + * + * By default, a highly-throttled API key is used, which is + * appropriate for quick prototypes and simple scripts. To + * gain access to an increased rate-limit, it is highly + * recommended to [sign up here](link-pocket-signup). + */ + class PocketProvider extends JsonRpcProvider { + /** + * The Application ID for the Pocket connection. + */ + applicationId; + /** + * The Application Secret for making authenticated requests + * to the Pocket connection. + */ + applicationSecret; + /** + * Create a new **PocketProvider**. + * + * By default connecting to ``mainnet`` with a highly throttled + * API key. + */ + constructor(_network, applicationId, applicationSecret) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (applicationId == null) { + applicationId = defaultApplicationId; + } + if (applicationSecret == null) { + applicationSecret = null; + } + const options = { staticNetwork: network }; + const request = PocketProvider.getRequest(network, applicationId, applicationSecret); + super(request, network, options); + defineProperties(this, { + applicationId, + applicationSecret, + }); + } + _getProvider(networkId) { + try { + return new PocketProvider(networkId, this.applicationId, this.applicationSecret); + } + catch (error) { } + return super._getProvider(networkId); + } + /** + * Returns a prepared request for connecting to %%network%% with + * %%applicationId%%. + */ + static getRequest(network, applicationId, applicationSecret) { + if (applicationId == null) { + applicationId = defaultApplicationId; + } + const request = new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); + request.allowGzip = true; + if (applicationSecret) { + request.setCredentials("", applicationSecret); + } + if (applicationId === defaultApplicationId) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("PocketProvider"); + return true; + }; + } + return request; + } + isCommunityResource() { + return this.applicationId === defaultApplicationId; + } + } + + const IpcSocketProvider = undefined; + + /** + * The **BaseWallet** is a stream-lined implementation of a + * [[Signer]] that operates with a private key. + * + * It is preferred to use the [[Wallet]] class, as it offers + * additional functionality and simplifies loading a variety + * of JSON formats, Mnemonic Phrases, etc. + * + * This class may be of use for those attempting to implement + * a minimal Signer. + */ + class BaseWallet extends AbstractSigner { + /** + * The wallet address. + */ + address; + prefix; + #signingKey; + /** + * Creates a new BaseWallet for %%privateKey%%, optionally + * connected to %%provider%%. + * + * If %%provider%% is not specified, only offline methods can + * be used. + */ + constructor({ signingKey, prefix, provider, }) { + super(provider); + this.prefix = prefix; + assertArgument(signingKey && typeof signingKey.sign === "function", "invalid signingKey key", "signingKey", "[ REDACTED ]"); + this.#signingKey = signingKey; + const address = computeAddress(this.#signingKey, prefix); + defineProperties(this, { address }); + } + // Store private values behind getters to reduce visibility + // in console.log + /** + * The [[SigningKey]] used for signing payloads. + */ + get signingKey() { + return this.#signingKey; + } + /** + * The private key for this wallet. + */ + get privateKey() { + return this.signingKey.privateKey; + } + async getAddress() { + return this.address; + } + connect(provider) { + return new BaseWallet({ + signingKey: this.#signingKey, + prefix: this.prefix, + provider, + }); + } + async signTransaction(tx) { + // Replace any Addressable or ENS name with an address + const { to, from } = await resolveProperties({ + to: tx.to || undefined, + from: tx.from || undefined, + }); + if (to != null) { + tx.to = to; + } + if (from != null) { + tx.from = from; + } + if (tx.from != null) { + assertArgument(getAddress(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); + delete tx.from; + } + // Build the transaction + const btx = Transaction.from(tx); + const unSignedSerialized = btx.unsignedSerialized; + const unsignedHash = sha256(unSignedSerialized); + // sha256(btx.unsignedSerialized) + btx.signature = this.signingKey.sign(unsignedHash); + return btx.serialized; + } + async signMessage(message) { + return this.signMessageSync(message); + } + // @TODO: Add a secialized signTx and signTyped sync that enforces + // all parameters are known? + /** + * Returns the signature for %%message%% signed with this wallet. + */ + signMessageSync(message) { + return this.signingKey.sign(hashMessage(message)); + } + async signTypedData(domain, types, value) { + // Populate any ENS names + const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => { + // @TODO: this should use resolveName; addresses don't + // need a provider + assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { + operation: "resolveName", + info: { name }, + }); + const address = getAddress(name); + assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { + value: name, + }); + return address; + }); + return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)); + } + } + + const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; + const Word = /^[a-z]*$/i; + function unfold(words, sep) { + let initial = 97; + return words.reduce((accum, word) => { + if (word === sep) { + initial++; + } + else if (word.match(Word)) { + accum.push(String.fromCharCode(initial) + word); + } + else { + initial = 97; + accum.push(word); + } + return accum; + }, []); + } + /** + * @_ignore + */ + function decode(data, subs) { + // Replace all the substitutions with their expanded form + for (let i = subsChrs.length - 1; i >= 0; i--) { + data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); + } + // Get all tle clumps; each suffix, first-increment and second-increment + const clumps = []; + const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { + if (semi) { + for (let i = parseInt(semi); i >= 0; i--) { + clumps.push(";"); + } + } + else { + clumps.push(item.toLowerCase()); + } + return ""; + }); + /* c8 ignore start */ + if (leftover) { + throw new Error(`leftovers: ${JSON.stringify(leftover)}`); + } + /* c8 ignore stop */ + return unfold(unfold(clumps, ";"), ":"); + } + /** + * @_ignore + */ + function decodeOwl(data) { + assertArgument(data[0] === "0", "unsupported auwl data", "data", data); + return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); + } + + /** + * A Wordlist represents a collection of language-specific + * words used to encode and devoce [[link-bip-39]] encoded data + * by mapping words to 11-bit values and vice versa. + */ + class Wordlist { + locale; + /** + * Creates a new Wordlist instance. + * + * Sub-classes MUST call this if they provide their own constructor, + * passing in the locale string of the language. + * + * Generally there is no need to create instances of a Wordlist, + * since each language-specific Wordlist creates an instance and + * there is no state kept internally, so they are safe to share. + */ + constructor(locale) { + defineProperties(this, { locale }); + } + /** + * Sub-classes may override this to provide a language-specific + * method for spliting %%phrase%% into individual words. + * + * By default, %%phrase%% is split using any sequences of + * white-space as defined by regular expressions (i.e. ``/\s+/``). + */ + split(phrase) { + return phrase.toLowerCase().split(/\s+/g); + } + /** + * Sub-classes may override this to provider a language-specific + * method for joining %%words%% into a phrase. + * + * By default, %%words%% are joined by a single space. + */ + join(words) { + return words.join(" "); + } + static check(wordlist) { + const words = []; + for (let i = 0; i < 2048; i++) { + const word = wordlist.getWord(i); + /* istanbul ignore if */ + if (i !== wordlist.getWordIndex(word)) { + return "0x"; + } + words.push(word); + } + return id(words.join("\n") + "\n"); + } + } + + // Use the encode-latin.js script to create the necessary + // data files to be consumed by this class + /** + * An OWL format Wordlist is an encoding method that exploits + * the general locality of alphabetically sorted words to + * achieve a simple but effective means of compression. + * + * This class is generally not useful to most developers as + * it is used mainly internally to keep Wordlists for languages + * based on ASCII-7 small. + * + * If necessary, there are tools within the ``generation/`` folder + * to create these necessary data. + */ + class WordlistOwl extends Wordlist { + #data; + #checksum; + /** + * Creates a new Wordlist for %%locale%% using the OWL %%data%% + * and validated against the %%checksum%%. + */ + constructor(locale, data, checksum) { + super(locale); + this.#data = data; + this.#checksum = checksum; + this.#words = null; + } + get _data() { + return this.#data; + } + _decodeWords() { + return decodeOwl(this.#data); + } + #words; + #loadWords() { + if (this.#words == null) { + const words = this._decodeWords(); + // Verify the computed list matches the official list + const checksum = id(words.join("\n") + "\n", true); + /* c8 ignore start */ + if (checksum !== this.#checksum) { + throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); + } + /* c8 ignore stop */ + this.#words = words; + } + return this.#words; + } + getWord(index) { + const words = this.#loadWords(); + assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); + return words[index]; + } + getWordIndex(word) { + return this.#loadWords().indexOf(word); + } + } + + const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)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k(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; + const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; + let wordlist = null; + /** + * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). + * + * @_docloc: api/wordlists + */ + class LangEn extends WordlistOwl { + /** + * Creates a new instance of the English language Wordlist. + * + * This should be unnecessary most of the time as the exported + * [[langEn]] should suffice. + * + * @_ignore: + */ + constructor() { + super("en", words, checksum); + } + /** + * Returns a singleton instance of a ``LangEn``, creating it + * if this is the first time being called. + */ + static wordlist() { + if (wordlist == null) { + wordlist = new LangEn(); + } + return wordlist; + } + } + + var utf8$1 = {}; + + /*! https://mths.be/utf8js v3.0.0 by @mathias */ + + var hasRequiredUtf8; + + function requireUtf8 () { + if (hasRequiredUtf8) return utf8$1; + hasRequiredUtf8 = 1; + (function (exports) { + (function(root) { + + var stringFromCharCode = String.fromCharCode; + + // Taken from https://mths.be/punycode + function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + var value; + var extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + // Taken from https://mths.be/punycode + function ucs2encode(array) { + var length = array.length; + var index = -1; + var value; + var output = ''; + while (++index < length) { + value = array[index]; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + } + return output; + } + + function checkScalarValue(codePoint) { + if (codePoint >= 0xD800 && codePoint <= 0xDFFF) { + throw Error( + 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() + + ' is not a scalar value' + ); + } + } + /*--------------------------------------------------------------------------*/ + + function createByte(codePoint, shift) { + return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80); + } + + function encodeCodePoint(codePoint) { + if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence + return stringFromCharCode(codePoint); + } + var symbol = ''; + if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence + symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0); + } + else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence + checkScalarValue(codePoint); + symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0); + symbol += createByte(codePoint, 6); + } + else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence + symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0); + symbol += createByte(codePoint, 12); + symbol += createByte(codePoint, 6); + } + symbol += stringFromCharCode((codePoint & 0x3F) | 0x80); + return symbol; + } + + function utf8encode(string) { + var codePoints = ucs2decode(string); + var length = codePoints.length; + var index = -1; + var codePoint; + var byteString = ''; + while (++index < length) { + codePoint = codePoints[index]; + byteString += encodeCodePoint(codePoint); + } + return byteString; + } + + /*--------------------------------------------------------------------------*/ + + function readContinuationByte() { + if (byteIndex >= byteCount) { + throw Error('Invalid byte index'); + } + + var continuationByte = byteArray[byteIndex] & 0xFF; + byteIndex++; + + if ((continuationByte & 0xC0) == 0x80) { + return continuationByte & 0x3F; + } + + // If we end up here, it’s not a continuation byte + throw Error('Invalid continuation byte'); + } + + function decodeSymbol() { + var byte1; + var byte2; + var byte3; + var byte4; + var codePoint; + + if (byteIndex > byteCount) { + throw Error('Invalid byte index'); + } + + if (byteIndex == byteCount) { + return false; + } + + // Read first byte + byte1 = byteArray[byteIndex] & 0xFF; + byteIndex++; + + // 1-byte sequence (no continuation bytes) + if ((byte1 & 0x80) == 0) { + return byte1; + } + + // 2-byte sequence + if ((byte1 & 0xE0) == 0xC0) { + byte2 = readContinuationByte(); + codePoint = ((byte1 & 0x1F) << 6) | byte2; + if (codePoint >= 0x80) { + return codePoint; + } else { + throw Error('Invalid continuation byte'); + } + } + + // 3-byte sequence (may include unpaired surrogates) + if ((byte1 & 0xF0) == 0xE0) { + byte2 = readContinuationByte(); + byte3 = readContinuationByte(); + codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3; + if (codePoint >= 0x0800) { + checkScalarValue(codePoint); + return codePoint; + } else { + throw Error('Invalid continuation byte'); + } + } + + // 4-byte sequence + if ((byte1 & 0xF8) == 0xF0) { + byte2 = readContinuationByte(); + byte3 = readContinuationByte(); + byte4 = readContinuationByte(); + codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) | + (byte3 << 0x06) | byte4; + if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { + return codePoint; + } + } + + throw Error('Invalid UTF-8 detected'); + } + + var byteArray; + var byteCount; + var byteIndex; + function utf8decode(byteString) { + byteArray = ucs2decode(byteString); + byteCount = byteArray.length; + byteIndex = 0; + var codePoints = []; + var tmp; + while ((tmp = decodeSymbol()) !== false) { + codePoints.push(tmp); + } + return ucs2encode(codePoints); + } + + /*--------------------------------------------------------------------------*/ + + root.version = '3.0.0'; + root.encode = utf8encode; + root.decode = utf8decode; + + }(exports)); + } (utf8$1)); + return utf8$1; + } + + var utf8Exports = requireUtf8(); + var utf8 = /*@__PURE__*/getDefaultExportFromCjs(utf8Exports); + + function mnemonicToSeed(mnemonic, password) { + if (!password) { + password = ""; + } + const t = generateSeed(mnemonic, password); + return t.goldilock; + } + const generateSeed = (mnemonic, password) => { + const goldilockSaltPrefix = "mnemonic"; + const aesSaltPrefix = "mnemonicfortheAESkey"; + const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); + const aesSalt = utf8.encode(aesSaltPrefix + password); + const goldilockKey = pbkdf2Sync(bufferExports.Buffer.from(mnemonic), bufferExports.Buffer.from(goldilockSalt), 2048, 64, "sha512"); + const aesKeySeed = pbkdf2Sync(bufferExports.Buffer.from(mnemonic), bufferExports.Buffer.from(aesSalt), 2048, 64, "sha512"); + return { + aes: bufferExports.Buffer.from(aesKeySeed).toString("hex"), + goldilock: bufferExports.Buffer.from(goldilockKey).toString("hex"), + }; + }; + + // Returns a byte with the MSB bits set + function getUpperMask(bits) { + return (((1 << bits) - 1) << (8 - bits)) & 0xff; + } + // Returns a byte with the LSB bits set + function getLowerMask(bits) { + return ((1 << bits) - 1) & 0xff; + } + function mnemonicToEntropy(mnemonic, wordlist) { + assertNormalize("NFKD"); + if (wordlist == null) { + wordlist = LangEn.wordlist(); + } + const words = wordlist.split(mnemonic); + assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); + const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8)); + let offset = 0; + for (let i = 0; i < words.length; i++) { + let index = wordlist.getWordIndex(words[i].normalize("NFKD")); + assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); + for (let bit = 0; bit < 11; bit++) { + if (index & (1 << (10 - bit))) { + entropy[offset >> 3] |= 1 << (7 - (offset % 8)); + } + offset++; + } + } + const entropyBits = (32 * words.length) / 3; + const checksumBits = words.length / 3; + const checksumMask = getUpperMask(checksumBits); + const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; + assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); + return hexlify(entropy.slice(0, entropyBits / 8)); + } + function entropyToMnemonic(entropy, wordlist) { + assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); + if (wordlist == null) { + wordlist = LangEn.wordlist(); + } + const indices = [0]; + let remainingBits = 11; + for (let i = 0; i < entropy.length; i++) { + // Consume the whole byte (with still more to go) + if (remainingBits > 8) { + indices[indices.length - 1] <<= 8; + indices[indices.length - 1] |= entropy[i]; + remainingBits -= 8; + // This byte will complete an 11-bit index + } + else { + indices[indices.length - 1] <<= remainingBits; + indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); + // Start the next word + indices.push(entropy[i] & getLowerMask(8 - remainingBits)); + remainingBits += 3; + } + } + // Compute the checksum bits + const checksumBits = entropy.length / 4; + const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) & + getUpperMask(checksumBits); + // Shift the checksum into the word indices + indices[indices.length - 1] <<= checksumBits; + indices[indices.length - 1] |= checksum >> (8 - checksumBits); + return wordlist.join(indices.map((index) => wordlist.getWord(index))); + } + const _guard$1 = {}; + /** + * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] + * seeds and convert between phrases and entropy. + */ + class Mnemonic { + /** + * The mnemonic phrase of 12, 15, 18, 21 or 24 words. + * + * Use the [[wordlist]] ``split`` method to get the individual words. + */ + phrase; + /** + * The password used for this mnemonic. If no password is used this + * is the empty string (i.e. ``""``) as per the specification. + */ + password; + /** + * The wordlist for this mnemonic. + */ + wordlist; + /** + * The underlying entropy which the mnemonic encodes. + */ + entropy; + /** + * @private + */ + constructor(guard, entropy, phrase, password, wordlist) { + if (password == null) { + password = ""; + } + if (wordlist == null) { + wordlist = LangEn.wordlist(); + } + assertPrivate(guard, _guard$1, "Mnemonic"); + defineProperties(this, { phrase, password, wordlist, entropy }); + } + /** + * Returns the seed for the mnemonic. + */ + computeSeed() { + return mnemonicToSeed(this.phrase, this.password); + } + /** + * Creates a new Mnemonic for the %%phrase%%. + * + * The default %%password%% is the empty string and the default + * wordlist is the [English wordlists](LangEn). + */ + static fromPhrase({ phrase, password, wordlist, }) { + // Normalize the case and space; throws if invalid + const entropy = mnemonicToEntropy(phrase, wordlist); + phrase = entropyToMnemonic(getBytes(entropy), wordlist); + return new Mnemonic(_guard$1, entropy, phrase, password, wordlist); + } + /** + * Create a new **Mnemonic** from the %%entropy%%. + * + * The default %%password%% is the empty string and the default + * wordlist is the [English wordlists](LangEn). + */ + static fromEntropy(_entropy, password, wordlist) { + const entropy = getBytes(_entropy, "entropy"); + const phrase = entropyToMnemonic(entropy, wordlist); + return new Mnemonic(_guard$1, hexlify(entropy), phrase, password, wordlist); + } + /** + * Returns the phrase for %%mnemonic%%. + */ + static entropyToPhrase(_entropy, wordlist) { + const entropy = getBytes(_entropy, "entropy"); + return entropyToMnemonic(entropy, wordlist); + } + /** + * Returns the entropy for %%phrase%%. + */ + static phraseToEntropy(phrase, wordlist) { + return mnemonicToEntropy(phrase, wordlist); + } + /** + * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. + * + * This checks all the provided words belong to the %%wordlist%%, + * that the length is valid and the checksum is correct. + */ + static isValidMnemonic(phrase, wordlist) { + try { + mnemonicToEntropy(phrase, wordlist); + return true; + } + catch (error) { } + return false; + } + } + + var aesJs = {exports: {}}; + + /*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ + + var hasRequiredAesJs; + + function requireAesJs () { + if (hasRequiredAesJs) return aesJs.exports; + hasRequiredAesJs = 1; + (function (module, exports) { + (function(root) { + + function checkInt(value) { + return (parseInt(value) === value); + } + + function checkInts(arrayish) { + if (!checkInt(arrayish.length)) { return false; } + + for (var i = 0; i < arrayish.length; i++) { + if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) { + return false; + } + } + + return true; + } + + function coerceArray(arg, copy) { + + // ArrayBuffer view + if (arg.buffer && arg.name === 'Uint8Array') { + + if (copy) { + if (arg.slice) { + arg = arg.slice(); + } else { + arg = Array.prototype.slice.call(arg); + } + } + + return arg; + } + + // It's an array; check it is a valid representation of a byte + if (Array.isArray(arg)) { + if (!checkInts(arg)) { + throw new Error('Array contains invalid value: ' + arg); + } + + return new Uint8Array(arg); + } + + // Something else, but behaves like an array (maybe a Buffer? Arguments?) + if (checkInt(arg.length) && checkInts(arg)) { + return new Uint8Array(arg); + } + + throw new Error('unsupported array-like object'); + } + + function createArray(length) { + return new Uint8Array(length); + } + + function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) { + if (sourceStart != null || sourceEnd != null) { + if (sourceArray.slice) { + sourceArray = sourceArray.slice(sourceStart, sourceEnd); + } else { + sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd); + } + } + targetArray.set(sourceArray, targetStart); + } + + + + var convertUtf8 = (function() { + function toBytes(text) { + var result = [], i = 0; + text = encodeURI(text); + while (i < text.length) { + var c = text.charCodeAt(i++); + + // if it is a % sign, encode the following 2 bytes as a hex value + if (c === 37) { + result.push(parseInt(text.substr(i, 2), 16)); + i += 2; + + // otherwise, just the actual byte + } else { + result.push(c); + } + } + + return coerceArray(result); + } + + function fromBytes(bytes) { + var result = [], i = 0; + + while (i < bytes.length) { + var c = bytes[i]; + + if (c < 128) { + result.push(String.fromCharCode(c)); + i++; + } else if (c > 191 && c < 224) { + result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f))); + i += 2; + } else { + result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f))); + i += 3; + } + } + + return result.join(''); + } + + return { + toBytes: toBytes, + fromBytes: fromBytes, + } + })(); + + var convertHex = (function() { + function toBytes(text) { + var result = []; + for (var i = 0; i < text.length; i += 2) { + result.push(parseInt(text.substr(i, 2), 16)); + } + + return result; + } + + // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html + var Hex = '0123456789abcdef'; + + function fromBytes(bytes) { + var result = []; + for (var i = 0; i < bytes.length; i++) { + var v = bytes[i]; + result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]); + } + return result.join(''); + } + + return { + toBytes: toBytes, + fromBytes: fromBytes, + } + })(); + + + // Number of rounds by keysize + var numberOfRounds = {16: 10, 24: 12, 32: 14}; + + // Round constant words + var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; + + // S-box and Inverse S-box (S is for Substitution) + var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x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, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; + + // Transformations for encryption + var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; + var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; + var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; + var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; + + // Transformations for decryption + var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; + var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; + var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; + var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; + + // Transformations for decryption key expansion + var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; + var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; + var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; + var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; + + function convertToInt32(bytes) { + var result = []; + for (var i = 0; i < bytes.length; i += 4) { + result.push( + (bytes[i ] << 24) | + (bytes[i + 1] << 16) | + (bytes[i + 2] << 8) | + bytes[i + 3] + ); + } + return result; + } + + var AES = function(key) { + if (!(this instanceof AES)) { + throw Error('AES must be instanitated with `new`'); + } + + Object.defineProperty(this, 'key', { + value: coerceArray(key, true) + }); + + this._prepare(); + }; + + + AES.prototype._prepare = function() { + + var rounds = numberOfRounds[this.key.length]; + if (rounds == null) { + throw new Error('invalid key size (must be 16, 24 or 32 bytes)'); + } + + // encryption round keys + this._Ke = []; + + // decryption round keys + this._Kd = []; + + for (var i = 0; i <= rounds; i++) { + this._Ke.push([0, 0, 0, 0]); + this._Kd.push([0, 0, 0, 0]); + } + + var roundKeyCount = (rounds + 1) * 4; + var KC = this.key.length / 4; + + // convert the key into ints + var tk = convertToInt32(this.key); + + // copy values into round key arrays + var index; + for (var i = 0; i < KC; i++) { + index = i >> 2; + this._Ke[index][i % 4] = tk[i]; + this._Kd[rounds - index][i % 4] = tk[i]; + } + + // key expansion (fips-197 section 5.2) + var rconpointer = 0; + var t = KC, tt; + while (t < roundKeyCount) { + tt = tk[KC - 1]; + tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ + (S[(tt >> 8) & 0xFF] << 16) ^ + (S[ tt & 0xFF] << 8) ^ + S[(tt >> 24) & 0xFF] ^ + (rcon[rconpointer] << 24)); + rconpointer += 1; + + // key expansion (for non-256 bit) + if (KC != 8) { + for (var i = 1; i < KC; i++) { + tk[i] ^= tk[i - 1]; + } + + // key expansion for 256-bit keys is "slightly different" (fips-197) + } else { + for (var i = 1; i < (KC / 2); i++) { + tk[i] ^= tk[i - 1]; + } + tt = tk[(KC / 2) - 1]; + + tk[KC / 2] ^= (S[ tt & 0xFF] ^ + (S[(tt >> 8) & 0xFF] << 8) ^ + (S[(tt >> 16) & 0xFF] << 16) ^ + (S[(tt >> 24) & 0xFF] << 24)); + + for (var i = (KC / 2) + 1; i < KC; i++) { + tk[i] ^= tk[i - 1]; + } + } + + // copy values into round key arrays + var i = 0, r, c; + while (i < KC && t < roundKeyCount) { + r = t >> 2; + c = t % 4; + this._Ke[r][c] = tk[i]; + this._Kd[rounds - r][c] = tk[i++]; + t++; + } + } + + // inverse-cipher-ify the decryption round key (fips-197 section 5.3) + for (var r = 1; r < rounds; r++) { + for (var c = 0; c < 4; c++) { + tt = this._Kd[r][c]; + this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^ + U2[(tt >> 16) & 0xFF] ^ + U3[(tt >> 8) & 0xFF] ^ + U4[ tt & 0xFF]); + } + } + }; + + AES.prototype.encrypt = function(plaintext) { + if (plaintext.length != 16) { + throw new Error('invalid plaintext size (must be 16 bytes)'); + } + + var rounds = this._Ke.length - 1; + var a = [0, 0, 0, 0]; + + // convert plaintext to (ints ^ key) + var t = convertToInt32(plaintext); + for (var i = 0; i < 4; i++) { + t[i] ^= this._Ke[0][i]; + } + + // apply round transforms + for (var r = 1; r < rounds; r++) { + for (var i = 0; i < 4; i++) { + a[i] = (T1[(t[ i ] >> 24) & 0xff] ^ + T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ + T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ + T4[ t[(i + 3) % 4] & 0xff] ^ + this._Ke[r][i]); + } + t = a.slice(); + } + + // the last round is special + var result = createArray(16), tt; + for (var i = 0; i < 4; i++) { + tt = this._Ke[rounds][i]; + result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; + result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; + result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; + result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff; + } + + return result; + }; + + AES.prototype.decrypt = function(ciphertext) { + if (ciphertext.length != 16) { + throw new Error('invalid ciphertext size (must be 16 bytes)'); + } + + var rounds = this._Kd.length - 1; + var a = [0, 0, 0, 0]; + + // convert plaintext to (ints ^ key) + var t = convertToInt32(ciphertext); + for (var i = 0; i < 4; i++) { + t[i] ^= this._Kd[0][i]; + } + + // apply round transforms + for (var r = 1; r < rounds; r++) { + for (var i = 0; i < 4; i++) { + a[i] = (T5[(t[ i ] >> 24) & 0xff] ^ + T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ + T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ + T8[ t[(i + 1) % 4] & 0xff] ^ + this._Kd[r][i]); + } + t = a.slice(); + } + + // the last round is special + var result = createArray(16), tt; + for (var i = 0; i < 4; i++) { + tt = this._Kd[rounds][i]; + result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; + result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; + result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; + result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff; + } + + return result; + }; + + + /** + * Mode Of Operation - Electonic Codebook (ECB) + */ + var ModeOfOperationECB = function(key) { + if (!(this instanceof ModeOfOperationECB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Electronic Code Block"; + this.name = "ecb"; + + this._aes = new AES(key); + }; + + ModeOfOperationECB.prototype.encrypt = function(plaintext) { + plaintext = coerceArray(plaintext); + + if ((plaintext.length % 16) !== 0) { + throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); + } + + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + + for (var i = 0; i < plaintext.length; i += 16) { + copyArray(plaintext, block, 0, i, i + 16); + block = this._aes.encrypt(block); + copyArray(block, ciphertext, i); + } + + return ciphertext; + }; + + ModeOfOperationECB.prototype.decrypt = function(ciphertext) { + ciphertext = coerceArray(ciphertext); + + if ((ciphertext.length % 16) !== 0) { + throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); + } + + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + + for (var i = 0; i < ciphertext.length; i += 16) { + copyArray(ciphertext, block, 0, i, i + 16); + block = this._aes.decrypt(block); + copyArray(block, plaintext, i); + } + + return plaintext; + }; + + + /** + * Mode Of Operation - Cipher Block Chaining (CBC) + */ + var ModeOfOperationCBC = function(key, iv) { + if (!(this instanceof ModeOfOperationCBC)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Cipher Block Chaining"; + this.name = "cbc"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 bytes)'); + } + + this._lastCipherblock = coerceArray(iv, true); + + this._aes = new AES(key); + }; + + ModeOfOperationCBC.prototype.encrypt = function(plaintext) { + plaintext = coerceArray(plaintext); + + if ((plaintext.length % 16) !== 0) { + throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); + } + + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + + for (var i = 0; i < plaintext.length; i += 16) { + copyArray(plaintext, block, 0, i, i + 16); + + for (var j = 0; j < 16; j++) { + block[j] ^= this._lastCipherblock[j]; + } + + this._lastCipherblock = this._aes.encrypt(block); + copyArray(this._lastCipherblock, ciphertext, i); + } + + return ciphertext; + }; + + ModeOfOperationCBC.prototype.decrypt = function(ciphertext) { + ciphertext = coerceArray(ciphertext); + + if ((ciphertext.length % 16) !== 0) { + throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); + } + + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + + for (var i = 0; i < ciphertext.length; i += 16) { + copyArray(ciphertext, block, 0, i, i + 16); + block = this._aes.decrypt(block); + + for (var j = 0; j < 16; j++) { + plaintext[i + j] = block[j] ^ this._lastCipherblock[j]; + } + + copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16); + } + + return plaintext; + }; + + + /** + * Mode Of Operation - Cipher Feedback (CFB) + */ + var ModeOfOperationCFB = function(key, iv, segmentSize) { + if (!(this instanceof ModeOfOperationCFB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Cipher Feedback"; + this.name = "cfb"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 size)'); + } + + if (!segmentSize) { segmentSize = 1; } + + this.segmentSize = segmentSize; + + this._shiftRegister = coerceArray(iv, true); + + this._aes = new AES(key); + }; + + ModeOfOperationCFB.prototype.encrypt = function(plaintext) { + if ((plaintext.length % this.segmentSize) != 0) { + throw new Error('invalid plaintext size (must be segmentSize bytes)'); + } + + var encrypted = coerceArray(plaintext, true); + + var xorSegment; + for (var i = 0; i < encrypted.length; i += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + for (var j = 0; j < this.segmentSize; j++) { + encrypted[i + j] ^= xorSegment[j]; + } + + // Shift the register + copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); + copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); + } + + return encrypted; + }; + + ModeOfOperationCFB.prototype.decrypt = function(ciphertext) { + if ((ciphertext.length % this.segmentSize) != 0) { + throw new Error('invalid ciphertext size (must be segmentSize bytes)'); + } + + var plaintext = coerceArray(ciphertext, true); + + var xorSegment; + for (var i = 0; i < plaintext.length; i += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + + for (var j = 0; j < this.segmentSize; j++) { + plaintext[i + j] ^= xorSegment[j]; + } + + // Shift the register + copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); + copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); + } + + return plaintext; + }; + + /** + * Mode Of Operation - Output Feedback (OFB) + */ + var ModeOfOperationOFB = function(key, iv) { + if (!(this instanceof ModeOfOperationOFB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Output Feedback"; + this.name = "ofb"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 bytes)'); + } + + this._lastPrecipher = coerceArray(iv, true); + this._lastPrecipherIndex = 16; + + this._aes = new AES(key); + }; + + ModeOfOperationOFB.prototype.encrypt = function(plaintext) { + var encrypted = coerceArray(plaintext, true); + + for (var i = 0; i < encrypted.length; i++) { + if (this._lastPrecipherIndex === 16) { + this._lastPrecipher = this._aes.encrypt(this._lastPrecipher); + this._lastPrecipherIndex = 0; + } + encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++]; + } + + return encrypted; + }; + + // Decryption is symetric + ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt; + + + /** + * Counter object for CTR common mode of operation + */ + var Counter = function(initialValue) { + if (!(this instanceof Counter)) { + throw Error('Counter must be instanitated with `new`'); + } + + // We allow 0, but anything false-ish uses the default 1 + if (initialValue !== 0 && !initialValue) { initialValue = 1; } + + if (typeof(initialValue) === 'number') { + this._counter = createArray(16); + this.setValue(initialValue); + + } else { + this.setBytes(initialValue); + } + }; + + Counter.prototype.setValue = function(value) { + if (typeof(value) !== 'number' || parseInt(value) != value) { + throw new Error('invalid counter value (must be an integer)'); + } + + // We cannot safely handle numbers beyond the safe range for integers + if (value > Number.MAX_SAFE_INTEGER) { + throw new Error('integer value out of safe range'); + } + + for (var index = 15; index >= 0; --index) { + this._counter[index] = value % 256; + value = parseInt(value / 256); + } + }; + + Counter.prototype.setBytes = function(bytes) { + bytes = coerceArray(bytes, true); + + if (bytes.length != 16) { + throw new Error('invalid counter bytes size (must be 16 bytes)'); + } + + this._counter = bytes; + }; + + Counter.prototype.increment = function() { + for (var i = 15; i >= 0; i--) { + if (this._counter[i] === 255) { + this._counter[i] = 0; + } else { + this._counter[i]++; + break; + } + } + }; + + + /** + * Mode Of Operation - Counter (CTR) + */ + var ModeOfOperationCTR = function(key, counter) { + if (!(this instanceof ModeOfOperationCTR)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Counter"; + this.name = "ctr"; + + if (!(counter instanceof Counter)) { + counter = new Counter(counter); + } + + this._counter = counter; + + this._remainingCounter = null; + this._remainingCounterIndex = 16; + + this._aes = new AES(key); + }; + + ModeOfOperationCTR.prototype.encrypt = function(plaintext) { + var encrypted = coerceArray(plaintext, true); + + for (var i = 0; i < encrypted.length; i++) { + if (this._remainingCounterIndex === 16) { + this._remainingCounter = this._aes.encrypt(this._counter._counter); + this._remainingCounterIndex = 0; + this._counter.increment(); + } + encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++]; + } + + return encrypted; + }; + + // Decryption is symetric + ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt; + + + /////////////////////// + // Padding + + // See:https://tools.ietf.org/html/rfc2315 + function pkcs7pad(data) { + data = coerceArray(data, true); + var padder = 16 - (data.length % 16); + var result = createArray(data.length + padder); + copyArray(data, result); + for (var i = data.length; i < result.length; i++) { + result[i] = padder; + } + return result; + } + + function pkcs7strip(data) { + data = coerceArray(data, true); + if (data.length < 16) { throw new Error('PKCS#7 invalid length'); } + + var padder = data[data.length - 1]; + if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); } + + var length = data.length - padder; + for (var i = 0; i < padder; i++) { + if (data[length + i] !== padder) { + throw new Error('PKCS#7 invalid padding byte'); + } + } + + var result = createArray(length); + copyArray(data, result, 0, 0, length); + return result; + } + + /////////////////////// + // Exporting + + + // The block cipher + var aesjs = { + AES: AES, + Counter: Counter, + + ModeOfOperation: { + ecb: ModeOfOperationECB, + cbc: ModeOfOperationCBC, + cfb: ModeOfOperationCFB, + ofb: ModeOfOperationOFB, + ctr: ModeOfOperationCTR + }, + + utils: { + hex: convertHex, + utf8: convertUtf8 + }, + + padding: { + pkcs7: { + pad: pkcs7pad, + strip: pkcs7strip + } + }, + + _arrayTest: { + coerceArray: coerceArray, + createArray: createArray, + copyArray: copyArray, + } + }; + + + // node.js + { + module.exports = aesjs; + + // RequireJS/AMD + // http://www.requirejs.org/docs/api.html + // https://github.com/amdjs/amdjs-api/wiki/AMD + } + + + })(); + } (aesJs)); + return aesJs.exports; + } + + var aesJsExports = requireAesJs(); + var pkg = /*@__PURE__*/getDefaultExportFromCjs(aesJsExports); + + /** + * @_ignore + */ + function looseArrayify(hexString) { + if (typeof hexString === "string" && !hexString.startsWith("0x")) { + hexString = "0x" + hexString; + } + return getBytesCopy(hexString); + } + function zpad(value, length) { + value = String(value); + while (value.length < length) { + value = "0" + value; + } + return value; + } + function getPassword(password) { + if (typeof password === "string") { + return toUtf8Bytes(password, "NFKC"); + } + return getBytesCopy(password); + } + function spelunk(object, _path) { + const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); + assertArgument(match != null, "invalid path", "path", _path); + const path = match[1]; + const type = match[3]; + const reqd = match[4] === "!"; + let cur = object; + for (const comp of path.toLowerCase().split(".")) { + // Search for a child object with a case-insensitive matching key + if (Array.isArray(cur)) { + if (!comp.match(/^[0-9]+$/)) { + break; + } + cur = cur[parseInt(comp)]; + } + else if (typeof cur === "object") { + let found = null; + for (const key in cur) { + if (key.toLowerCase() === comp) { + found = cur[key]; + break; + } + } + cur = found; + } + else { + cur = null; + } + if (cur == null) { + break; + } + } + assertArgument(!reqd || cur != null, "missing required value", "path", path); + if (type && cur != null) { + if (type === "int") { + if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { + return parseInt(cur); + } + else if (Number.isSafeInteger(cur)) { + return cur; + } + } + if (type === "number") { + if (typeof cur === "string" && cur.match(/^-?[0-9.]*$/)) { + return parseFloat(cur); + } + } + if (type === "data") { + if (typeof cur === "string") { + return looseArrayify(cur); + } + } + if (type === "array" && Array.isArray(cur)) { + return cur; + } + if (type === typeof cur) { + return cur; + } + assertArgument(false, `wrong type found for ${type} `, "path", path); + } + return cur; + } + /* + export function follow(object: any, path: string): null | string { + let currentChild = object; + + for (const comp of path.toLowerCase().split('/')) { + + // Search for a child object with a case-insensitive matching key + let matchingChild = null; + for (const key in currentChild) { + if (key.toLowerCase() === comp) { + matchingChild = currentChild[key]; + break; + } + } + + if (matchingChild === null) { return null; } + + currentChild = matchingChild; + } + + return currentChild; + } + + // "path/to/something:type!" + export function followRequired(data: any, path: string): string { + const value = follow(data, path); + if (value != null) { return value; } + return logger.throwArgumentError("invalid value", `data:${ path }`, + JSON.stringify(data)); + } + */ + // See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) + /* + export function uuidV4(randomBytes: BytesLike): string { + const bytes = getBytes(randomBytes, "randomBytes"); + + // Section: 4.1.3: + // - time_hi_and_version[12:16] = 0b0100 + bytes[6] = (bytes[6] & 0x0f) | 0x40; + + // Section 4.4 + // - clock_seq_hi_and_reserved[6] = 0b0 + // - clock_seq_hi_and_reserved[7] = 0b1 + bytes[8] = (bytes[8] & 0x3f) | 0x80; + + const value = hexlify(bytes); + + return [ + value.substring(2, 10), + value.substring(10, 14), + value.substring(14, 18), + value.substring(18, 22), + value.substring(22, 34), + ].join("-"); + } + */ + + /** + * The JSON Wallet formats allow a simple way to store the private + * keys needed in Core along with related information and allows + * for extensible forms of encryption. + * + * These utilities facilitate decrypting and encrypting the most common + * JSON Wallet formats. + * + * @_subsection: api/wallet:JSON Wallets [json-wallets] + */ + // @ts-ignore + const { Counter, ModeOfOperation: { ctr: CTR }, } = pkg; + const defaultPath$1 = "m/44'/60'/0'/0/0"; + /** + * Returns true if %%json%% is a valid JSON Keystore Wallet. + */ + function isKeystoreJson(json) { + try { + const data = JSON.parse(json); + const version = data.version != null ? parseInt(data.version) : 0; + if (version === 3) { + return true; + } + } + catch (error) { } + return false; + } + function decrypt(data, key, ciphertext) { + const cipher = spelunk(data, "crypto.cipher:string"); + if (cipher === "aes-128-ctr") { + const iv = spelunk(data, "crypto.cipherparams.iv:data!"); + const aesCtr = new CTR(key, new Counter(iv)); + return hexlify(aesCtr.decrypt(ciphertext)); + } + assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { + operation: "decrypt", + }); + } + function getAccount(data, _key) { + const key = getBytes(_key); + const ciphertext = spelunk(data, "crypto.ciphertext:data!"); + const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2); + const expectedMAC = spelunk(data, "crypto.mac:string!"); + let difference = 0; + const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC); + if (validMAC) { + const actual = getBytes("0x" + computedMAC); + const expected = getBytes("0x" + expectedMAC); + for (let i = 0; i < actual.length; i++) + difference |= actual[i] ^ expected[i]; + } + assertArgument(validMAC && difference === 0, "incorrect password", "password", "[REDACTED]"); + const privateKey = decrypt(data, key.slice(0, 16), ciphertext); + const address = getAddress(data.address); + const prefix = extractPrefix(address); + if (computeAddress(privateKey, prefix) !== address) { + throw new Error("address mismatch"); + } + if (data.address) { + let check = data.address.toLowerCase(); + if (!check.startsWith("0x")) { + check = "0x" + check; + } + assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); + } + const account = { address, privateKey }; + // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase + const version = spelunk(data, "x-corebc.version:string"); + if (version === "0.1") { + const mnemonicKey = key.slice(32, 64); + const mnemonicCiphertext = spelunk(data, "x-corebc.mnemonicCiphertext:data!"); + const mnemonicIv = spelunk(data, "x-corebc.mnemonicCounter:data!"); + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); + account.mnemonic = { + path: spelunk(data, "x-corebc.path:string") || defaultPath$1, + locale: spelunk(data, "x-corebc.locale:string") || "en", + entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))), + }; + } + return account; + } + // Match Core Web3Dart's wallet KDF resource limits. + function validateScrypt(N, r, p) { + assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, "unsafe scrypt N", "kdf.N", N); + assertArgument(Number.isSafeInteger(r) && + Number.isSafeInteger(p) && + r > 0 && + p > 0 && + r * p <= 1048576 && + 128 * N * r <= 256 * 1024 * 1024, "unsafe scrypt work or memory requirement", "kdf", { N, r, p }); + } + function getDecryptKdfParams(data) { + const kdf = spelunk(data, "crypto.kdf:string"); + if (kdf && typeof kdf === "string") { + if (kdf.toLowerCase() === "scrypt") { + const salt = spelunk(data, "crypto.kdfparams.salt:data!"); + const N = spelunk(data, "crypto.kdfparams.n:int!"); + const r = spelunk(data, "crypto.kdfparams.r:int!"); + const p = spelunk(data, "crypto.kdfparams.p:int!"); + validateScrypt(N, r, p); + const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); + assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); + return { name: "scrypt", salt, N, r, p, dkLen: 64 }; + } + else if (kdf.toLowerCase() === "pbkdf2") { + const salt = spelunk(data, "crypto.kdfparams.salt:data!"); + const prf = spelunk(data, "crypto.kdfparams.prf:string!"); + const algorithm = prf.split("-").pop(); + assertArgument(prf === "hmac-sha256" || prf === "hmac-sha512", "invalid kdf.pdf", "kdf.pdf", prf); + const count = spelunk(data, "crypto.kdfparams.c:int!"); + assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, "unsafe PBKDF2 iteration count", "kdf.c", count); + const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); + assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); + return { + name: "pbkdf2", + salt, + count, + dkLen, + algorithm: algorithm, + }; + } + } + assertArgument(false, "unsupported key-derivation function", "kdf", kdf); + } + /** + * Returns the account details for the JSON Keystore Wallet %%json%% + * using %%password%%. + * + * It is preferred to use the [async version](decryptKeystoreJson) + * instead, which allows a [[ProgressCallback]] to keep the user informed + * as to the decryption status. + * + * This method will block the event loop (freezing all UI) until decryption + * is complete, which can take quite some time, depending on the wallet + * paramters and platform. + */ + function decryptKeystoreJsonSync(json, _password) { + const data = JSON.parse(json); + const password = getPassword(_password); + const params = getDecryptKdfParams(data); + if (params.name === "pbkdf2") { + const { salt, count, dkLen, algorithm } = params; + const key = pbkdf2(password, salt, count, dkLen, algorithm); + return getAccount(data, key); + } + assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { + params, + }); + const { salt, N, r, p, dkLen } = params; + const key = scryptSync(password, salt, N, r, p, dkLen); + return getAccount(data, key); + } + function stall$1(duration) { + return new Promise((resolve) => { + setTimeout(() => { + resolve(); + }, duration); + }); + } + /** + * Resolves to the decrypted JSON Keystore Wallet %%json%% using the + * %%password%%. + * + * If provided, %%progress%% will be called periodically during the + * decrpytion to provide feedback, and if the function returns + * ``false`` will halt decryption. + * + * The %%progressCallback%% will **always** receive ``0`` before + * decryption begins and ``1`` when complete. + */ + async function decryptKeystoreJson(json, _password, progress) { + const data = JSON.parse(json); + const password = getPassword(_password); + const params = getDecryptKdfParams(data); + if (params.name === "pbkdf2") { + if (progress) { + progress(0); + await stall$1(0); + } + const { salt, count, dkLen, algorithm } = params; + const key = pbkdf2(password, salt, count, dkLen, algorithm); + if (progress) { + progress(1); + await stall$1(0); + } + return getAccount(data, key); + } + assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { + params, + }); + const { salt, N, r, p, dkLen } = params; + const key = await scrypt(password, salt, N, r, p, dkLen, progress); + return getAccount(data, key); + } + function getEncryptKdfParams(options) { + // Check/generate the salt + const salt = options.salt != null + ? getBytes(options.salt, "options.salt") + : randomBytes(32); + // Override the scrypt password-based key derivation function parameters + let N = 1 << 17, r = 8, p = 1; + if (options.scrypt) { + if (options.scrypt.N != null) { + N = options.scrypt.N; + } + if (options.scrypt.r != null) { + r = options.scrypt.r; + } + if (options.scrypt.p != null) { + p = options.scrypt.p; + } + } + validateScrypt(N, r, p); + return { name: "scrypt", dkLen: 32, salt, N, r, p }; + } + function _encryptKeystore(key, kdf, account, options) { + const privateKey = getBytes(account.privateKey, "privateKey"); + // Override initialization vector + const iv = options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); + assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); + // Override the uuid + const uuidRandom = options.uuid != null + ? getBytes(options.uuid, "options.uuid") + : randomBytes(16); + assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); + // This will be used to encrypt the wallet (as per Web3 secret storage) + // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) + // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet) + const derivedKey = key.slice(0, 16); + const macPrefix = key.slice(16, 32); + // Encrypt the private key + const aesCtr = new CTR(derivedKey, new Counter(iv)); + const ciphertext = getBytes(aesCtr.encrypt(privateKey)); + // Compute the message authentication code, used to check the password + const mac = sha256(concat([macPrefix, ciphertext])); + const data = { + address: account.address.substring(2).toLowerCase(), + id: uuidV4(uuidRandom), + version: 3, + Crypto: { + cipher: "aes-128-ctr", + cipherparams: { + iv: hexlify(iv).substring(2), + }, + ciphertext: hexlify(ciphertext).substring(2), + kdf: "scrypt", + kdfparams: { + salt: hexlify(kdf.salt).substring(2), + n: kdf.N, + dklen: 32, + p: kdf.p, + r: kdf.r, + }, + mac: mac.substring(2), + }, + }; + // If we have a mnemonic, encrypt it into the JSON wallet + if (account.mnemonic) { + const client = options.client != null ? options.client : `corebc/${version}`; + const path = account.mnemonic.path || defaultPath$1; + const locale = account.mnemonic.locale || "en"; + const mnemonicKey = key.slice(32, 64); + const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); + const mnemonicIv = randomBytes(16); + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); + const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); + const now = new Date(); + const timestamp = now.getUTCFullYear() + + "-" + + zpad(now.getUTCMonth() + 1, 2) + + "-" + + zpad(now.getUTCDate(), 2) + + "T" + + zpad(now.getUTCHours(), 2) + + "-" + + zpad(now.getUTCMinutes(), 2) + + "-" + + zpad(now.getUTCSeconds(), 2) + + ".0Z"; + const gethFilename = "UTC--" + timestamp + "--" + data.address; + data["x-corebc"] = { + client, + gethFilename, + path, + locale, + mnemonicCounter: hexlify(mnemonicIv).substring(2), + mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), + version: "0.1", + }; + } + return JSON.stringify(data); + } + /** + * Return the JSON Keystore Wallet for %%account%% encrypted with + * %%password%%. + * + * The %%options%% can be used to tune the password-based key + * derivation function parameters, explicitly set the random values + * used. Any provided [[ProgressCallback]] is ignord. + */ + function encryptKeystoreJsonSync(account, password, options) { + if (options == null) { + options = {}; + } + const passwordBytes = getPassword(password); + const kdf = getEncryptKdfParams(options); + const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); + return _encryptKeystore(getBytes(key), kdf, account, options); + } + /** + * Resolved to the JSON Keystore Wallet for %%account%% encrypted + * with %%password%%. + * + * The %%options%% can be used to tune the password-based key + * derivation function parameters, explicitly set the random values + * used and provide a [[ProgressCallback]] to receive periodic updates + * on the completion status.. + */ + async function encryptKeystoreJson(account, password, options) { + if (options == null) { + options = {}; + } + const passwordBytes = getPassword(password); + const kdf = getEncryptKdfParams(options); + const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); + return _encryptKeystore(getBytes(key), kdf, account, options); + } + + /** + * Explain HD Wallets.. + * + * @_subsection: api/wallet:HD Wallets [hd-wallets] + */ + // import { arrayify, + // // hexDataSlice + // } from "../utils/data.js"; + // function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array { + // const p = getBytes(password); + // const s = getBytes(salt); + // return getBytes(pbkdf2(p, s, 2048, 57, "sha512")); + // } + /** + * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) + */ + const defaultPath = "m"; + // "Bitcoin seed" + // const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); + const HardenedBit = 0x80000000; + // function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array { + // b = getBytes(concat([b.slice(0, 53), "0x00000000"])); + // b[0] &= 0xfc; + // const c = new Uint8Array(57); + // let hold = 0; + // for (let i = 0; i < 57; i++) { + // hold += a[i] + b[i]; + // c[i] = hold % 256; + // hold = Math.floor(hold / 256); + // } + // return c; + // }; + const _guard = {}; + function derivePath(node, path) { + const components = path.split("/"); + assertArgument(components.length > 0 && (components[0] === "m" || node.depth > 0), "invalid path", "path", path); + if (components[0] === "m") { + components.shift(); + } + let result = node; + for (let i = 0; i < components.length; i++) { + const component = components[i]; + if (component.match(/^[0-9]+'$/)) { + const index = parseInt(component.substring(0, component.length - 1)); + assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); + result = result.deriveChild(HardenedBit + index); + } + else if (component.match(/^[0-9]+$/)) { + const index = parseInt(component); + assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); + result = result.deriveChild(index); + } + else { + assertArgument(false, "invalid path component", `path[${i}]`, component); + } + } + return result; + } + /** + * An **HDNodeWallet** is a [[Signer]] backed by the private key derived + * from an HD Node using the [[link-bip-32]] stantard. + * + * An HD Node forms a hierarchal structure with each HD Node having a + * private key and the ability to derive child HD Nodes, defined by + * a path indicating the index of each child. + */ + class HDNodeWallet extends BaseWallet { + /** + * The compressed public key. + */ + publicKey; + prefix; + /** + * The fingerprint. + * + * A fingerprint allows quick qay to detect parent and child nodes, + * but developers should be prepared to deal with collisions as it + * is only 4 bytes. + */ + fingerprint; + /** + * The parent fingerprint. + */ + parentFingerprint; + /** + * The mnemonic used to create this HD Node, if available. + * + * Sources such as extended keys do not encode the mnemonic, in + * which case this will be ``null``. + */ + mnemonic; + #seed; + /** + * The derivation path of this wallet. + * + * Since extended keys do not provider full path details, this + * may be ``null``, if instantiated from a source that does not + * enocde it. + */ + path; + /** + * The child index of this wallet. Values over ``2 *\* 31`` indicate + * the node is hardened. + */ + index; + /** + * The depth of this wallet, which is the number of components + * in its path. + */ + depth; + /** + * @private + */ + constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) { + super({ + signingKey, + prefix, + provider, + }); + assertPrivate(guard, _guard, "HDNodeWallet"); + defineProperties(this, { publicKey: signingKey.publicKey }); + this.prefix = prefix; + this.#seed = seed; + const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); + defineProperties(this, { + parentFingerprint, + fingerprint, + path, + index, + depth, + }); + defineProperties(this, { mnemonic }); + } + connect(provider) { + return new HDNodeWallet({ + guard: _guard, + signingKey: this.signingKey, + parentFingerprint: this.parentFingerprint, + path: this.path, + index: this.index, + depth: this.depth, + seed: this.#seed, + mnemonic: this.mnemonic, + provider, + prefix: this.prefix, + }); + } + #account() { + const account = { + address: this.address, + privateKey: this.privateKey, + }; + const m = this.mnemonic; + if (this.path && m && m.wordlist.locale === "en" && m.password === "") { + account.mnemonic = { + path: this.path, + locale: "en", + entropy: m.entropy, + }; + } + return account; + } + /** + * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with + * %%password%%. + * + * If %%progressCallback%% is specified, it will receive periodic + * updates as the encryption process progreses. + */ + async encrypt(password, progressCallback) { + return await encryptKeystoreJson(this.#account(), password, { + progressCallback, + }); + } + /** + * Returns a [JSON Keystore Wallet](json-wallets) encryped with + * %%password%%. + * + * It is preferred to use the [async version](encrypt) instead, + * which allows a [[ProgressCallback]] to keep the user informed. + * + * This method will block the event loop (freezing all UI) until + * it is complete, which may be a non-trivial duration. + */ + encryptSync(password) { + return encryptKeystoreJsonSync(this.#account(), password); + } + /** + * Returns true if this wallet has a path, providing a Type Guard + * that the path is non-null. + */ + hasPath() { + return this.path != null; + } + /** + * Return the child for %%index%%. + */ + deriveChild(_index) { + const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index)); + const newSigningKey = new SigningKey(newPrivateKey); + // Base path + let path = this.path; + if (path) { + path += "/" + (_index & ~HardenedBit); + if (_index & HardenedBit) { + path += "'"; + } + } + return new HDNodeWallet({ + guard: _guard, + signingKey: newSigningKey, + parentFingerprint: this.fingerprint, + path, + index: _index, + seed: this.#seed, + depth: this.depth + 1, + mnemonic: this.mnemonic, + provider: this.provider, + prefix: this.prefix, + }); + } + /** + * Return the HDNode for %%path%% from this node. + */ + derivePath(path) { + return derivePath(this, path); + } + static #fromSeed({ _seed, mnemonic, prefix, path, }) { + const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0); + const signingKey = new SigningKey(extendetPrivateKey); + // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length }) + return new HDNodeWallet({ + seed: _seed, + guard: _guard, + signingKey, + parentFingerprint: "0x00000000", + path: path || defaultPath, + index: 0, + depth: 0, + mnemonic, + provider: null, + prefix, + }); + } + /** + * Creates a new random HDNode. + */ + static createRandom(prefix, password, path, wordlist) { + if (password == null) { + password = ""; + } + if (path == null) { + path = defaultPath; + } + if (wordlist == null) { + wordlist = LangEn.wordlist(); + } + const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist); + return HDNodeWallet.#fromSeed({ + _seed: mnemonic.computeSeed(), + mnemonic, + prefix, + }).derivePath(path); + } + /** + * Create am HD Node from %%mnemonic%%. + */ + static fromMnemonic(mnemonic, prefix, path) { + if (!path) { + path = defaultPath; + } + return HDNodeWallet.#fromSeed({ + _seed: mnemonic.computeSeed(), + mnemonic, + prefix, + }).derivePath(path); + } + static mnemonicToSeed(mnemonic, password) { + const seed = mnemonicToSeed(mnemonic, password); + return seed; + } + /** + * Creates an HD Node from a mnemonic %%phrase%%. + */ + static fromPhrase({ phrase, prefix, password, path, wordlist, }) { + if (!password) { + password = ""; + } + if (!path) { + path = defaultPath; + } + if (!wordlist) { + wordlist = LangEn.wordlist(); + } + const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist }); + const _seed = mnemonic.computeSeed(); + return HDNodeWallet.#fromSeed({ + _seed, + mnemonic, + prefix, + }).derivePath(path); + } + /** + * Creates an HD Node from a %%seed%%. + */ + static fromSeed({ seed, prefix, path, }) { + return HDNodeWallet.#fromSeed({ + _seed: seed, + mnemonic: null, + path: path || defaultPath, + prefix, + }); + } + } + /* + export class HDNodeWalletManager { + #root: HDNodeWallet; + + constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { + if (password == null) { password = ""; } + if (path == null) { path = "m/44'/60'/0'/0"; } + if (locale == null) { locale = LangEn.wordlist(); } + this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); + } + + getSigner(index?: number): HDNodeWallet { + return this.#root.deriveChild((index == null) ? 0: index); + } + } + */ + /** + * Returns the [[link-bip-32]] path for the acount at %%index%%. + * + * This is the pattern used by wallets like Ledger. + * + * There is also an [alternate pattern](getIndexedAccountPath) used by + * some software. + */ + function getAccountPath(_index) { + const index = getNumber(_index, "index"); + assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); + return `m/44'/60'/${index}'/0/0`; + } + /** + * Returns the path using an alternative pattern for deriving accounts, + * at %%index%%. + * + * This derivation path uses the //index// component rather than the + * //account// component to derive sequential accounts. + * + * This is the pattern used by wallets like MetaMask. + */ + function getIndexedAccountPath(_index) { + const index = getNumber(_index, "index"); + assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); + return `m/44'/60'/0'/0/${index}`; + } + + /** + * @_subsection: api/wallet:JSON Wallets [json-wallets] + */ + // @ts-ignore + const { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg; + /** + * Returns true if %%json%% is a valid JSON Crowdsale wallet. + */ + function isCrowdsaleJson(json) { + try { + const data = JSON.parse(json); + if (data.encseed) { + return true; + } + } + catch (error) { } + return false; + } + /** + * Before Core launched, it was necessary to create a wallet + * format for backers to use, which would be used to receive xcb + * as a reward for contributing to the project. + * + * The [[link-crowdsale]] format is now obsolete, but it is still + * useful to support and the additional code is fairly trivial as + * all the primitives required are used through core portions of + * the library. + */ + function decryptCrowdsaleJson(json, _password) { + const data = JSON.parse(json); + const password = getPassword(_password); + // Core Address + const address = getAddress(spelunk(data, "ethaddr:string!")); + // Encrypted Seed + const encseed = looseArrayify(spelunk(data, "encseed:string!")); + assertArgument(encseed && encseed.length % 16 === 0, "invalid encseed", "json", json); + const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); + const iv = encseed.slice(0, 16); + const encryptedSeed = encseed.slice(16); + // Decrypt the seed + const aesCbc = new CBC(key, iv); + const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); + // This wallet format is weird... Convert the binary encoded hex to a string. + let seedHex = ""; + for (let i = 0; i < seed.length; i++) { + seedHex += String.fromCharCode(seed[i]); + } + return { address, privateKey: id(seedHex) }; + } + + function stall(duration) { + return new Promise((resolve) => { + setTimeout(() => { + resolve(); + }, duration); + }); + } + /** + * A **Wallet** manages a single private key which is used to sign + * transactions, messages and other common payloads. + * + * This class is generally the main entry point for developers + * that wish to use a private key directly, as it can create + * instances from a large variety of common sources, including + * raw private key, [[link-bip-39]] mnemonics and encrypte JSON + * wallets. + */ + class Wallet extends BaseWallet { + /** + * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected + * to %%provider%%. + */ + constructor({ key, prefix, provider, }) { + if (typeof key === "string" && !key.startsWith("0x")) { + key = "0x" + key; + } + let signingKey = typeof key === "string" ? new SigningKey(key) : key; + super({ + signingKey, + prefix, + provider, + }); + } + connect(provider) { + return new Wallet({ + key: this.signingKey, + prefix: this.prefix, + provider, + }); + } + /** + * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with + * %%password%%. + * + * If %%progressCallback%% is specified, it will receive periodic + * updates as the encryption process progreses. + */ + async encrypt(password, progressCallback) { + const account = { address: this.address, privateKey: this.privateKey }; + return await encryptKeystoreJson(account, password, { progressCallback }); + } + /** + * Returns a [JSON Keystore Wallet](json-wallets) encryped with + * %%password%%. + * + * It is preferred to use the [async version](encrypt) instead, + * which allows a [[ProgressCallback]] to keep the user informed. + * + * This method will block the event loop (freezing all UI) until + * it is complete, which may be a non-trivial duration. + */ + encryptSync(password) { + const account = { address: this.address, privateKey: this.privateKey }; + return encryptKeystoreJsonSync(account, password); + } + static #fromAccount(account) { + assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); + const address = account.address; + const prefix = extractPrefix(address); + if ("mnemonic" in account && + account.mnemonic && + account.mnemonic.locale === "en") { + const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); + const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path); + if (wallet.address === account.address && + wallet.privateKey === account.privateKey) { + return wallet; + } + console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); + } + const wallet = new Wallet({ + key: account.privateKey, + prefix, + }); + assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); + return wallet; + } + /** + * Creates (asynchronously) a **Wallet** by decrypting the %%json%% + * with %%password%%. + * + * If %%progress%% is provided, it is called periodically during + * decryption so that any UI can be updated. + */ + static async fromEncryptedJson(json, password, progress) { + let account = null; + if (isKeystoreJson(json)) { + account = await decryptKeystoreJson(json, password, progress); + } + else if (isCrowdsaleJson(json)) { + if (progress) { + progress(0); + await stall(0); + } + account = decryptCrowdsaleJson(json, password); + if (progress) { + progress(1); + await stall(0); + } + } + return Wallet.#fromAccount(account); + } + /** + * Creates a **Wallet** by decrypting the %%json%% with %%password%%. + * + * The [[fromEncryptedJson]] method is preferred, as this method + * will lock up and freeze the UI during decryption, which may take + * some time. + */ + static fromEncryptedJsonSync(json, password) { + let account = null; + if (isKeystoreJson(json)) { + account = decryptKeystoreJsonSync(json, password); + } + else if (isCrowdsaleJson(json)) { + account = decryptCrowdsaleJson(json, password); + } + else { + assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); + } + return Wallet.#fromAccount(account); + } + /** + * Creates a new random [[HDNodeWallet]] using the avavilable + * [cryptographic random source](randomBytes). + * + * If there is no crytographic random source, this will throw. + */ + static createRandom(prefix, provider) { + const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined); + if (provider) { + return wallet.connect(provider); + } + return wallet; + } + /** + * Creates a [[HDNodeWallet]] for %%phrase%%. + */ + static fromPhrase({ phrase, prefix, provider, password, }) { + const wallet = HDNodeWallet.fromPhrase({ + phrase, + prefix, + password, + }); + if (provider) { + return wallet.connect(provider); + } + return wallet; + } + static fromSeed({ seed, prefix, provider, path, }) { + const wallet = HDNodeWallet.fromSeed({ + seed, + prefix, + path: path || defaultPath, + }); + if (provider) { + return wallet.connect(provider); + } + return wallet; + } + } + + const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; + /** + * @_ignore + */ + function decodeBits(width, data) { + const maxValue = (1 << width) - 1; + const result = []; + let accum = 0, bits = 0, flood = 0; + for (let i = 0; i < data.length; i++) { + // Accumulate 6 bits of data + accum = (accum << 6) | Base64.indexOf(data[i]); + bits += 6; + // While we have enough for a word... + while (bits >= width) { + // ...read the word + const value = accum >> (bits - width); + accum &= (1 << (bits - width)) - 1; + bits -= width; + // A value of 0 indicates we exceeded maxValue, it + // floods over into the next value + if (value === 0) { + flood += maxValue; + } + else { + result.push(value + flood); + flood = 0; + } + } + } + return result; + } + + /** + * @_ignore + */ + function decodeOwlA(data, accents) { + let words = decodeOwl(data).join(","); + // Inject the accents + accents.split(/,/g).forEach((accent) => { + const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); + assertArgument(match !== null, "internal error parsing accents", "accents", accents); + let posOffset = 0; + const positions = decodeBits(parseInt(match[3]), match[4]); + const charCode = parseInt(match[2]); + const regex = new RegExp(`([${match[1]}])`, "g"); + words = words.replace(regex, (all, letter) => { + const rem = --positions[posOffset]; + if (rem === 0) { + letter = String.fromCharCode(letter.charCodeAt(0), charCode); + posOffset++; + } + return letter; + }); + }); + return words.split(","); + } + + /** + * An OWL-A format Wordlist extends the OWL format to add an + * overlay onto an OWL format Wordlist to support diacritic + * marks. + * + * This class is generally not useful to most developers as + * it is used mainly internally to keep Wordlists for languages + * based on latin-1 small. + * + * If necessary, there are tools within the ``generation/`` folder + * to create these necessary data. + */ + class WordlistOwlA extends WordlistOwl { + #accent; + constructor(locale, data, accent, checksum) { + super(locale, data, checksum); + this.#accent = accent; + } + get _accent() { + return this.#accent; + } + _decodeWords() { + return decodeOwlA(this._data, this._accent); + } + } + + const wordlists = { + en: LangEn.wordlist(), + }; + + const customUnitAbi = Object.freeze([ + "function supportsUnit(string unit) view returns (bool)", + "function supportedUnits() view returns (string[])", + "function preferredUnit() view returns (string)", + "function balanceOf(address account) view returns (uint256)", + "function balanceOfUnit(address account, string unit) view returns (uint256)", + ]); + class CustomUnitDiscovery { + preferredUnit; + supportedUnits; + constructor(units, preferredUnit) { + this.preferredUnit = preferredUnit; + this.supportedUnits = Object.freeze([...units]); + } + get isValid() { + return (this.supports("units") && + this.preferredUnit !== "" && + this.supports(this.preferredUnit)); + } + supports(unit) { + return this.supportedUnits.includes(unit); + } + } + /** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ + class CustomUnitBalance { + canonicalAmount; + unitAmount; + unit; + constructor(canonicalAmount, unitAmount, unit) { + this.canonicalAmount = canonicalAmount; + this.unitAmount = unitAmount; + this.unit = unit; + } + get multiplierNumerator() { + return this.unitAmount; + } + get multiplierDenominator() { + return this.canonicalAmount; + } + } + /** Core custom-unit contract convention used by Tone and Core API. */ + class CustomUnitToken { + contract; + constructor(address, runner) { + this.contract = new Contract(address, customUnitAbi, runner); + } + async supportsUnit(unit, blockTag) { + return (unit.trim() !== "" && + (await this.contract.supportsUnit(unit.trim(), { blockTag }))); + } + async supportedUnits(blockTag) { + return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag }))); + } + async preferredUnit(blockTag) { + return (await this.contract.preferredUnit({ blockTag })).trim(); + } + async discover(blockTag) { + if (!(await this.supportsUnit("units", blockTag))) + return null; + const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag)); + return discovery.isValid ? discovery : null; + } + canonicalBalance(account, blockTag) { + return this.contract.balanceOf(account, { blockTag }); + } + balanceOfUnit(account, unit, blockTag) { + if (!unit.trim()) + throw new TypeError("unit must not be empty"); + return this.contract.balanceOfUnit(account, unit.trim(), { blockTag }); + } + async balance(account, unit, blockTag) { + const resolved = unit?.trim() || (await this.preferredUnit(blockTag)); + const [canonical, calculated] = await Promise.all([ + this.canonicalBalance(account, blockTag), + this.balanceOfUnit(account, resolved, blockTag), + ]); + return new CustomUnitBalance(canonical, calculated, resolved); + } + } + + /** On-chain interface defined by CIP-150. */ + const cip150Abi = Object.freeze([ + "function getMetadataValue(string key) view returns (string value)", + "function hasMetadataKey(string key) view returns (bool exists)", + "function isMetadataSealed(string key) view returns (bool sealed)", + "function listMetadataKeys() view returns (string[] keys)", + "function getMetadataByIndex(uint256 index) view returns (string key, string value)", + "function metadataCount() view returns (uint256 total)", + "function setMetadataValue(string key, string value)", + "function sealMetadataKey(string key)", + ]); + const cip151TokenExpirationKey = "tokenExpiration"; + const cip151TradingStopKey = "tradingStop"; + const cip152LabKey = "lab"; + /** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ + class Cip151Lifecycle { + tokenExpiration; + tradingStop; + constructor(metadata = {}) { + const parse = (key) => { + const value = metadata[key]; + if (value == null || value === "") + return null; + if (!/^\d+$/.test(value)) + throw new TypeError(`${key} must be a non-negative Unix timestamp`); + return BigInt(value); + }; + this.tokenExpiration = parse(cip151TokenExpirationKey); + this.tradingStop = parse(cip151TradingStopKey); + } + isExpiredAt(seconds) { + return this.tokenExpiration !== null && seconds >= this.tokenExpiration; + } + isTradingStoppedAt(seconds) { + return this.tradingStop !== null && seconds >= this.tradingStop; + } + } + /** Validates certificate structure, not the authenticity of its issuer. */ + class Cip152LabCertificate { + measurements; + constructor(json) { + if (json === null || typeof json !== "object" || Array.isArray(json)) + throw new TypeError("CIP-152 lab.json must be an object"); + const measurements = Object.create(null); + for (const [key, property] of Object.entries(json)) { + if (!property || + typeof property !== "object" || + Array.isArray(property) || + !Object.hasOwn(property, "value")) + throw new TypeError(`CIP-152 property ${key} must contain a value`); + const { value, unit } = property; + if (!(typeof value === "string" || + (typeof value === "number" && Number.isFinite(value)))) + throw new TypeError(`CIP-152 property ${key} has an invalid value`); + if (unit != null && typeof unit !== "string") + throw new TypeError(`CIP-152 property ${key} has an invalid unit`); + measurements[key] = Object.freeze(unit == null ? { value } : { value, unit }); + } + this.measurements = Object.freeze(measurements); + } + } + /** Typed metadata reader and writer. Writes require a signer as runner. */ + class Cip150MetadataContract { + contract; + constructor(address, runner) { + this.contract = new Contract(address, cip150Abi, runner); + } + getValue(key, blockTag) { + return this.contract.getMetadataValue(key, { blockTag }); + } + hasKey(key, blockTag) { + return this.contract.hasMetadataKey(key, { blockTag }); + } + isSealed(key, blockTag) { + return this.contract.isMetadataSealed(key, { blockTag }); + } + async listKeys(blockTag) { + return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag }))); + } + async getByIndex(index, blockTag) { + const [key, value] = await this.contract.getMetadataByIndex(index, { + blockTag, + }); + return Object.freeze({ key, value }); + } + count(blockTag) { + return this.contract.metadataCount({ blockTag }); + } + async readAll(blockTag, includeSealedState = true) { + const entries = []; + for (const key of await this.listKeys(blockTag)) { + const value = await this.getValue(key, blockTag); + entries.push(Object.freeze(includeSealedState + ? { key, value, sealed: await this.isSealed(key, blockTag) } + : { key, value })); + } + return Object.freeze(entries); + } + setValue(key, value, overrides = {}) { + return this.contract.setMetadataValue(key, value, overrides); + } + sealKey(key, overrides = {}) { + return this.contract.sealMetadataKey(key, overrides); + } + async readLifecycle(blockTag) { + const metadata = {}; + for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) { + if (await this.hasKey(key, blockTag)) + metadata[key] = await this.getValue(key, blockTag); + } + return new Cip151Lifecycle(metadata); + } + async readLabCertificate(gateway, blockTag) { + if (!(await this.hasKey(cip152LabKey, blockTag))) + return null; + const reference = await this.getValue(cip152LabKey, blockTag); + if (!gateway.resolve(reference).pathname.endsWith("/lab.json")) + throw new TypeError("CIP-152 reference must point to lab.json"); + return new Cip152LabCertificate(await gateway.readJson(reference)); + } + } + + const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; + /** Configurable IPFS resolution and bounded JSON loading. */ + class IpfsGateway { + template; + maxResponseBytes; + timeoutMs; + #fetch; + constructor(options = {}) { + this.template = options.template ?? defaultIpfsGatewayTemplate; + this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024; + this.timeoutMs = options.timeoutMs ?? 30_000; + this.#fetch = options.fetch ?? globalThis.fetch; + const templateUrl = new URL(this.template.replace("{cid}", "cid")); + if (!/^https?:$/.test(templateUrl.protocol) || + this.template.split("{cid}").length !== 2) + throw new TypeError("gateway template must be HTTP(S) and contain one {cid}"); + for (const value of [this.maxResponseBytes, this.timeoutMs]) + if (!Number.isSafeInteger(value) || value <= 0) + throw new TypeError("gateway limits must be positive safe integers"); + } + resolve(reference) { + const value = reference.trim(); + if (/^https?:\/\//i.test(value)) + return new URL(value); + const path = value.replace(/^ipfs:\/\//, "").replace(/^\/?ipfs\//, ""); + if (!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path) || + path.split("/").some((part) => part === "." || part === "..")) + throw new TypeError("invalid IPFS reference"); + return new URL(this.template.replace("{cid}", path.split("/").map(encodeURIComponent).join("/"))); + } + async readJson(reference) { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), this.timeoutMs); + let reader; + try { + const response = await this.#fetch(this.resolve(reference), { + headers: { accept: "application/json" }, + signal: controller.signal, + }); + if (!response.ok) { + await response.body?.cancel(); + throw new Error(`IPFS gateway returned HTTP ${response.status}`); + } + if (!response.body) + throw new Error("IPFS gateway returned an empty body"); + reader = response.body.getReader(); + const chunks = []; + let length = 0; + while (true) { + const { done, value } = await reader.read(); + if (done) + break; + length += value.length; + if (length > this.maxResponseBytes) + throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`); + chunks.push(value); + } + const bytes = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + bytes.set(chunk, offset); + offset += chunk.length; + } + return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)); + } + finally { + clearTimeout(timer); + await reader?.cancel().catch(() => { }); + reader?.releaseLock(); + } + } + } + + var corebc = /*#__PURE__*/Object.freeze({ + __proto__: null, + AbiCoder: AbiCoder, + AbstractProvider: AbstractProvider, + AbstractSigner: AbstractSigner, + AlchemyProvider: AlchemyProvider, + AnkrProvider: AnkrProvider, + BaseContract: BaseContract, + BaseWallet: BaseWallet, + BigNumber: BigNumber, + Block: Block, + BrowserProvider: BrowserProvider, + Cip150MetadataContract: Cip150MetadataContract, + Cip151Lifecycle: Cip151Lifecycle, + Cip152LabCertificate: Cip152LabCertificate, + CloudflareProvider: CloudflareProvider, + ConstructorFragment: ConstructorFragment, + Contract: Contract, + ContractEventPayload: ContractEventPayload, + ContractFactory: ContractFactory, + ContractTransactionReceipt: ContractTransactionReceipt, + ContractTransactionResponse: ContractTransactionResponse, + ContractUnknownEventPayload: ContractUnknownEventPayload, + CoreSymbol: CoreSymbol, + CustomUnitBalance: CustomUnitBalance, + CustomUnitDiscovery: CustomUnitDiscovery, + CustomUnitToken: CustomUnitToken, + Ed448Goldilock: Ed448Goldilock, + EnergyCostPlugin: EnergyCostPlugin, + ErrorDescription: ErrorDescription, + ErrorFragment: ErrorFragment, + EventFragment: EventFragment, + EventLog: EventLog, + EventPayload: EventPayload, + FallbackFragment: FallbackFragment, + FallbackProvider: FallbackProvider, + FeeData: FeeData, + FeeDataNetworkPlugin: FeeDataNetworkPlugin, + FetchCancelSignal: FetchCancelSignal, + FetchRequest: FetchRequest, + FetchResponse: FetchResponse, + FixedNumber: FixedNumber, + Fragment: Fragment, + FunctionFragment: FunctionFragment, + HDNodeWallet: HDNodeWallet, + Indexed: Indexed, + InfuraProvider: InfuraProvider, + InfuraWebSocketProvider: InfuraWebSocketProvider, + Interface: Interface, + IpcSocketProvider: IpcSocketProvider, + IpfsGateway: IpfsGateway, + JsonRpcApiProvider: JsonRpcApiProvider, + JsonRpcProvider: JsonRpcProvider, + JsonRpcSigner: JsonRpcSigner, + LangEn: LangEn, + Log: Log, + LogDescription: LogDescription, + MaxInt256: MaxInt256, + MaxUint256: MaxUint256, + MessagePrefix: MessagePrefix, + MinInt256: MinInt256, + Mnemonic: Mnemonic, + N: N, + NamedFragment: NamedFragment, + Network: Network, + NetworkPlugin: NetworkPlugin, + NonceManager: NonceManager, + OrePerXCB: OrePerXCB, + ParamType: ParamType, + PocketProvider: PocketProvider, + QuickNodeProvider: QuickNodeProvider, + Result: Result, + Signature: Signature, + SigningKey: SigningKey, + SocketBlockSubscriber: SocketBlockSubscriber, + SocketEventSubscriber: SocketEventSubscriber, + SocketPendingSubscriber: SocketPendingSubscriber, + SocketProvider: SocketProvider, + SocketSubscriber: SocketSubscriber, + StructFragment: StructFragment, + Transaction: Transaction, + TransactionDescription: TransactionDescription, + TransactionReceipt: TransactionReceipt, + TransactionResponse: TransactionResponse, + Typed: Typed, + TypedDataEncoder: TypedDataEncoder, + UnmanagedSubscriber: UnmanagedSubscriber, + Utf8ErrorFuncs: Utf8ErrorFuncs, + VoidSigner: VoidSigner, + Wallet: Wallet, + WebSocketProvider: WebSocketProvider, + Wordlist: Wordlist, + WordlistOwl: WordlistOwl, + WordlistOwlA: WordlistOwlA, + ZeroAddress: ZeroAddress, + ZeroHash: ZeroHash, + accessListify: accessListify, + arrayify: arrayify, + assert: assert, + assertArgument: assertArgument, + assertArgumentCount: assertArgumentCount, + assertNormalize: assertNormalize, + assertPrivate: assertPrivate, + checkResultErrors: checkResultErrors, + cip150Abi: cip150Abi, + cip151TokenExpirationKey: cip151TokenExpirationKey, + cip151TradingStopKey: cip151TradingStopKey, + cip152LabKey: cip152LabKey, + computeAddress: computeAddress, + computeHmac: computeHmac, + concat: concat, + copyRequest: copyRequest, + customUnitAbi: customUnitAbi, + dataLength: dataLength, + dataSlice: dataSlice, + decodeBase58: decodeBase58, + decodeBase64: decodeBase64, + decodeBytes32String: decodeBytes32String, + decodeRlp: decodeRlp, + decryptCrowdsaleJson: decryptCrowdsaleJson, + decryptKeystoreJson: decryptKeystoreJson, + decryptKeystoreJsonSync: decryptKeystoreJsonSync, + defaultIpfsGatewayTemplate: defaultIpfsGatewayTemplate, + defaultPath: defaultPath, + defineProperties: defineProperties, + encodeBase58: encodeBase58, + encodeBase64: encodeBase64, + encodeBytes32String: encodeBytes32String, + encodeRlp: encodeRlp, + encryptKeystoreJson: encryptKeystoreJson, + encryptKeystoreJsonSync: encryptKeystoreJsonSync, + formatUnits: formatUnits, + formatXCB: formatXCB, + fromTwos: fromTwos, + getAccountPath: getAccountPath, + getAddress: getAddress, + getBigInt: getBigInt, + getBytes: getBytes, + getBytesCopy: getBytesCopy, + getCreate2Address: getCreate2Address, + getCreateAddress: getCreateAddress, + getDefaultProvider: getDefaultProvider, + getIndexedAccountPath: getIndexedAccountPath, + getNumber: getNumber, + getUint: getUint, + hashMessage: hashMessage, + hexConcat: hexConcat, + hexlify: hexlify, + id: id, + isAddress: isAddress, + isAddressable: isAddressable, + isBytesLike: isBytesLike, + isCallException: isCallException, + isCrowdsaleJson: isCrowdsaleJson, + isError: isError, + isHexString: isHexString, + isKeystoreJson: isKeystoreJson, + keccak256: keccak256, + lock: lock, + makeError: makeError, + mask: mask, + networkIdToPrefix: networkIdToPrefix, + parseUnits: parseUnits, + parseXCB: parseXCB, + pbkdf2: pbkdf2, + publicToAddress: publicToAddress, + randomBytes: randomBytes, + recoverAddress: recoverAddress, + resolveAddress: resolveAddress, + resolveProperties: resolveProperties, + ripemd160: ripemd160, + scrypt: scrypt, + scryptSync: scryptSync, + sha256: sha256, + sha512: sha512, + showThrottleMessage: showThrottleMessage, + solidityPacked: solidityPacked, + solidityPackedSha256: solidityPackedSha256, + stripZerosLeft: stripZerosLeft, + toBeArray: toBeArray, + toBeHex: toBeHex, + toBigInt: toBigInt, + toNumber: toNumber, + toQuantity: toQuantity, + toTwos: toTwos, + toUtf8Bytes: toUtf8Bytes, + toUtf8CodePoints: toUtf8CodePoints, + toUtf8String: toUtf8String, + uuidV4: uuidV4, + verifyMessage: verifyMessage, + verifyTypedData: verifyTypedData, + version: version, + wordlists: wordlists, + zeroPadBytes: zeroPadBytes, + zeroPadValue: zeroPadValue + }); + + exports.AbiCoder = AbiCoder; + exports.AbstractProvider = AbstractProvider; + exports.AbstractSigner = AbstractSigner; + exports.AlchemyProvider = AlchemyProvider; + exports.AnkrProvider = AnkrProvider; + exports.BaseContract = BaseContract; + exports.BaseWallet = BaseWallet; + exports.BigNumber = BigNumber; + exports.Block = Block; + exports.BrowserProvider = BrowserProvider; + exports.Buffer = bufferExports.Buffer; + exports.Cip150MetadataContract = Cip150MetadataContract; + exports.Cip151Lifecycle = Cip151Lifecycle; + exports.Cip152LabCertificate = Cip152LabCertificate; + exports.CloudflareProvider = CloudflareProvider; + exports.ConstructorFragment = ConstructorFragment; + exports.Contract = Contract; + exports.ContractEventPayload = ContractEventPayload; + exports.ContractFactory = ContractFactory; + exports.ContractTransactionReceipt = ContractTransactionReceipt; + exports.ContractTransactionResponse = ContractTransactionResponse; + exports.ContractUnknownEventPayload = ContractUnknownEventPayload; + exports.CoreSymbol = CoreSymbol; + exports.CustomUnitBalance = CustomUnitBalance; + exports.CustomUnitDiscovery = CustomUnitDiscovery; + exports.CustomUnitToken = CustomUnitToken; + exports.Ed448Goldilock = Ed448Goldilock; + exports.EnergyCostPlugin = EnergyCostPlugin; + exports.ErrorDescription = ErrorDescription; + exports.ErrorFragment = ErrorFragment; + exports.EventFragment = EventFragment; + exports.EventLog = EventLog; + exports.EventPayload = EventPayload; + exports.FallbackFragment = FallbackFragment; + exports.FallbackProvider = FallbackProvider; + exports.FeeData = FeeData; + exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin; + exports.FetchCancelSignal = FetchCancelSignal; + exports.FetchRequest = FetchRequest; + exports.FetchResponse = FetchResponse; + exports.FixedNumber = FixedNumber; + exports.Fragment = Fragment; + exports.FunctionFragment = FunctionFragment; + exports.HDNodeWallet = HDNodeWallet; + exports.Indexed = Indexed; + exports.InfuraProvider = InfuraProvider; + exports.InfuraWebSocketProvider = InfuraWebSocketProvider; + exports.Interface = Interface; + exports.IpcSocketProvider = IpcSocketProvider; + exports.IpfsGateway = IpfsGateway; + exports.JsonRpcApiProvider = JsonRpcApiProvider; + exports.JsonRpcProvider = JsonRpcProvider; + exports.JsonRpcSigner = JsonRpcSigner; + exports.LangEn = LangEn; + exports.Log = Log; + exports.LogDescription = LogDescription; + exports.MaxInt256 = MaxInt256; + exports.MaxUint256 = MaxUint256; + exports.MessagePrefix = MessagePrefix; + exports.MinInt256 = MinInt256; + exports.Mnemonic = Mnemonic; + exports.N = N; + exports.NamedFragment = NamedFragment; + exports.Network = Network; + exports.NetworkPlugin = NetworkPlugin; + exports.NonceManager = NonceManager; + exports.OrePerXCB = OrePerXCB; + exports.ParamType = ParamType; + exports.PocketProvider = PocketProvider; + exports.QuickNodeProvider = QuickNodeProvider; + exports.Result = Result; + exports.Signature = Signature; + exports.SigningKey = SigningKey; + exports.SocketBlockSubscriber = SocketBlockSubscriber; + exports.SocketEventSubscriber = SocketEventSubscriber; + exports.SocketPendingSubscriber = SocketPendingSubscriber; + exports.SocketProvider = SocketProvider; + exports.SocketSubscriber = SocketSubscriber; + exports.StructFragment = StructFragment; + exports.Transaction = Transaction; + exports.TransactionDescription = TransactionDescription; + exports.TransactionReceipt = TransactionReceipt; + exports.TransactionResponse = TransactionResponse; + exports.Typed = Typed; + exports.TypedDataEncoder = TypedDataEncoder; + exports.UnmanagedSubscriber = UnmanagedSubscriber; + exports.Utf8ErrorFuncs = Utf8ErrorFuncs; + exports.VoidSigner = VoidSigner; + exports.Wallet = Wallet; + exports.WebSocketProvider = WebSocketProvider; + exports.Wordlist = Wordlist; + exports.WordlistOwl = WordlistOwl; + exports.WordlistOwlA = WordlistOwlA; + exports.ZeroAddress = ZeroAddress; + exports.ZeroHash = ZeroHash; + exports.accessListify = accessListify; + exports.arrayify = arrayify; + exports.assert = assert; + exports.assertArgument = assertArgument; + exports.assertArgumentCount = assertArgumentCount; + exports.assertNormalize = assertNormalize; + exports.assertPrivate = assertPrivate; + exports.checkResultErrors = checkResultErrors; + exports.cip150Abi = cip150Abi; + exports.cip151TokenExpirationKey = cip151TokenExpirationKey; + exports.cip151TradingStopKey = cip151TradingStopKey; + exports.cip152LabKey = cip152LabKey; + exports.computeAddress = computeAddress; + exports.computeHmac = computeHmac; + exports.concat = concat; + exports.copyRequest = copyRequest; + exports.corebc = corebc; + exports.customUnitAbi = customUnitAbi; + exports.dataLength = dataLength; + exports.dataSlice = dataSlice; + exports.decodeBase58 = decodeBase58; + exports.decodeBase64 = decodeBase64; + exports.decodeBytes32String = decodeBytes32String; + exports.decodeRlp = decodeRlp; + exports.decryptCrowdsaleJson = decryptCrowdsaleJson; + exports.decryptKeystoreJson = decryptKeystoreJson; + exports.decryptKeystoreJsonSync = decryptKeystoreJsonSync; + exports.defaultIpfsGatewayTemplate = defaultIpfsGatewayTemplate; + exports.defaultPath = defaultPath; + exports.defineProperties = defineProperties; + exports.encodeBase58 = encodeBase58; + exports.encodeBase64 = encodeBase64; + exports.encodeBytes32String = encodeBytes32String; + exports.encodeRlp = encodeRlp; + exports.encryptKeystoreJson = encryptKeystoreJson; + exports.encryptKeystoreJsonSync = encryptKeystoreJsonSync; + exports.formatUnits = formatUnits; + exports.formatXCB = formatXCB; + exports.fromTwos = fromTwos; + exports.getAccountPath = getAccountPath; + exports.getAddress = getAddress; + exports.getBigInt = getBigInt; + exports.getBytes = getBytes; + exports.getBytesCopy = getBytesCopy; + exports.getCreate2Address = getCreate2Address; + exports.getCreateAddress = getCreateAddress; + exports.getDefaultProvider = getDefaultProvider; + exports.getIndexedAccountPath = getIndexedAccountPath; + exports.getNumber = getNumber; + exports.getUint = getUint; + exports.hashMessage = hashMessage; + exports.hexConcat = hexConcat; + exports.hexlify = hexlify; + exports.id = id; + exports.isAddress = isAddress; + exports.isAddressable = isAddressable; + exports.isBytesLike = isBytesLike; + exports.isCallException = isCallException; + exports.isCrowdsaleJson = isCrowdsaleJson; + exports.isError = isError; + exports.isHexString = isHexString; + exports.isKeystoreJson = isKeystoreJson; + exports.keccak256 = keccak256; + exports.lock = lock; + exports.makeError = makeError; + exports.mask = mask; + exports.networkIdToPrefix = networkIdToPrefix; + exports.parseUnits = parseUnits; + exports.parseXCB = parseXCB; + exports.pbkdf2 = pbkdf2; + exports.publicToAddress = publicToAddress; + exports.randomBytes = randomBytes; + exports.recoverAddress = recoverAddress; + exports.resolveAddress = resolveAddress; + exports.resolveProperties = resolveProperties; + exports.ripemd160 = ripemd160; + exports.scrypt = scrypt; + exports.scryptSync = scryptSync; + exports.sha256 = sha256; + exports.sha512 = sha512; + exports.showThrottleMessage = showThrottleMessage; + exports.solidityPacked = solidityPacked; + exports.solidityPackedSha256 = solidityPackedSha256; + exports.stripZerosLeft = stripZerosLeft; + exports.toBeArray = toBeArray; + exports.toBeHex = toBeHex; + exports.toBigInt = toBigInt; + exports.toNumber = toNumber; + exports.toQuantity = toQuantity; + exports.toTwos = toTwos; + exports.toUtf8Bytes = toUtf8Bytes; + exports.toUtf8CodePoints = toUtf8CodePoints; + exports.toUtf8String = toUtf8String; + exports.uuidV4 = uuidV4; + exports.verifyMessage = verifyMessage; + exports.verifyTypedData = verifyTypedData; + exports.version = version; + exports.wordlists = wordlists; + exports.zeroPadBytes = zeroPadBytes; + exports.zeroPadValue = zeroPadValue; })); //# sourceMappingURL=corebc.umd.js.map diff --git a/dist/corebc.umd.js.map b/dist/corebc.umd.js.map index 3f31b9535..2e6d2bd6e 100644 --- a/dist/corebc.umd.js.map +++ b/dist/corebc.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"corebc.umd.js","sources":["../lib.esm/_version.js","../lib.esm/logger/logger.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/bigNumber/bigNumber.js","../lib.esm/crypto/rlp.js","../node_modules/@noble/hashes/esm/_assert.js","../node_modules/@noble/hashes/esm/utils.js","../node_modules/@noble/hashes/esm/hmac.js","../node_modules/@noble/hashes/esm/pbkdf2.js","../node_modules/@noble/hashes/esm/_sha2.js","../node_modules/@noble/hashes/esm/sha256.js","../node_modules/@noble/hashes/esm/_u64.js","../node_modules/@noble/hashes/esm/sha512.js","../node_modules/@noble/hashes/esm/sha3.js","../lib.esm/utils/maths.js","../lib.esm/utils/base58.js","../lib.esm/utils/base64-browser.js","../lib.esm/utils/events.js","../lib.esm/utils/utf8.js","../lib.esm/utils/geturl-browser.js","../lib.esm/utils/fetch.js","../lib.esm/utils/fixednumber.js","../lib.esm/utils/rlp-decode.js","../lib.esm/utils/rlp-encode.js","../lib.esm/utils/units.js","../lib.esm/utils/uuid.js","../lib.esm/crypto/ed448goldilock-browser.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/sha3.js","../lib.esm/address/index.js","../lib.esm/crypto/hmac.js","../node_modules/@noble/hashes/esm/ripemd160.js","../lib.esm/crypto/ripemd160.js","../lib.esm/crypto/pbkdf2.js","../lib.esm/crypto/random.js","../node_modules/@noble/hashes/esm/scrypt.js","../lib.esm/crypto/scrypt.js","../lib.esm/crypto/keccak.js","../node_modules/@noble/secp256k1/index.js","../lib.esm/crypto/signing-key.js","../lib.esm/crypto/signature.js","../lib.esm/crypto/index.js","../lib.esm/transaction/address.js","../lib.esm/abi/coders/abstract-coder.js","../lib.esm/abi/typed.js","../lib.esm/abi/coders/address.js","../lib.esm/abi/coders/anonymous.js","../lib.esm/abi/coders/array.js","../lib.esm/abi/coders/boolean.js","../lib.esm/abi/coders/bytes.js","../lib.esm/abi/coders/fixed-bytes.js","../lib.esm/abi/coders/null.js","../lib.esm/abi/coders/number.js","../lib.esm/abi/coders/string.js","../lib.esm/abi/coders/tuple.js","../lib.esm/hash/id.js","../lib.esm/constants/addresses.js","../lib.esm/constants/hashes.js","../lib.esm/constants/numbers.js","../lib.esm/constants/strings.js","../lib.esm/transaction/accesslist.js","../lib.esm/transaction/transaction.js","../lib.esm/hash/message.js","../lib.esm/hash/solidity.js","../lib.esm/hash/typed-data.js","../lib.esm/abi/fragments.js","../lib.esm/abi/abi-coder.js","../lib.esm/abi/bytes32.js","../lib.esm/abi/interface.js","../lib.esm/address/contract-address.js","../lib.esm/address/checks.js","../lib.esm/providers/provider.js","../lib.esm/contract/wrappers.js","../lib.esm/contract/contract.js","../lib.esm/contract/factory.js","../lib.esm/providers/format.js","../lib.esm/providers/plugins-network.js","../lib.esm/providers/network.js","../lib.esm/providers/subscriber-polling.js","../lib.esm/providers/abstract-provider.js","../lib.esm/providers/abstract-signer.js","../lib.esm/providers/community.js","../lib.esm/providers/subscriber-filterid.js","../lib.esm/providers/provider-jsonrpc.js","../lib.esm/providers/provider-ankr.js","../lib.esm/providers/provider-alchemy.js","../lib.esm/providers/provider-cloudflare.js","../lib.esm/providers/ws-browser.js","../lib.esm/providers/provider-socket.js","../lib.esm/providers/provider-websocket.js","../lib.esm/providers/provider-infura.js","../lib.esm/providers/provider-quicknode.js","../lib.esm/providers/provider-fallback.js","../lib.esm/providers/default-provider.js","../lib.esm/providers/signer-noncemanager.js","../lib.esm/providers/provider-browser.js","../lib.esm/providers/provider-pocket.js","../lib.esm/providers/provider-ipcsocket-browser.js","../lib.esm/wallet/base-wallet.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-en.js","../lib.esm/wallet/mnemonicToSeed.js","../lib.esm/wallet/mnemonic.js","../lib.esm/wallet/utils.js","../lib.esm/wallet/json-keystore.js","../lib.esm/wallet/hdwallet.js","../lib.esm/wallet/json-crowdsale.js","../lib.esm/wallet/wallet.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/wordlists-browser.js"],"sourcesContent":["/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */\n/**\n * The current version of corebc.\n */\nexport const version = \"6.4.0\";\n//# sourceMappingURL=_version.js.map","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map","import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map","/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return addSlice(new Uint8Array(result));\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return addSlice(new Uint8Array(result));\n }\n if (isBytes(value)) {\n return addSlice(new Uint8Array(value));\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nfunction addSlice(array) {\n // @ts-ignore\n if (array.slice) {\n return array;\n }\n array.slice = function () {\n const args = Array.prototype.slice.call(arguments);\n return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));\n };\n return array;\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { isBytes, hexlify, isHexString, } from \"../utils/data.js\";\nvar BN = _BN.BN;\nconst logger = new Logger(\"bigNumber/0.0.1\");\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null &&\n (BigNumber.isBigNumber(value) ||\n (typeof value === \"number\" && value % 1 === 0) ||\n (typeof value === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n typeof value === \"bigint\" ||\n isBytes(value)));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n _hex;\n _isBigNumber;\n constructor(constructorGuard, hex) {\n logger.checkNew(new.target, BigNumber);\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\",\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division by zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return this._hex[0] === \"-\";\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n // @ts-ignore\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString(),\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof value === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof value === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof anyValue === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof hex === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof hex === \"string\") {\n if (isHexString(hex) ||\n (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\n// @ts-ignore\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof value !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\n// @ts-ignore\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\n// @ts-ignore\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return new BN(\"-\" + hex.substring(3), 16);\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return new BN(value, 36).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return new BN(value, 16).toString(36);\n}\n//# sourceMappingURL=bigNumber.js.map","\"use strict\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify, isBytesLike } from \"../utils/data.js\";\nconst logger = new Logger(\"rlp/0.0.1\");\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return 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 _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 if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(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}\nexport function encode(object) {\n return hexlify(_encode(object));\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 if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: 1 + length, result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\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 if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: 1 + length, result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=rlp.js.map","function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nfunction bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new Error('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexport { number, bool, bytes, hash, exists, output };\nconst assert = { number, bool, bytes, hash, exists, output };\nexport default assert;\n//# sourceMappingURL=_assert.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\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}\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// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\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/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!u8a(data))\n throw new Error(`expected Uint8Array, got ${typeof data}`);\n return data;\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}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nconst toStr = {}.toString;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.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","import { hash as assertHash, number as assertNumber } from './_assert.js';\nimport { hmac } from './hmac.js';\nimport { createView, toBytes, checkOpts, asyncLoop } from './utils.js';\n// Common prologue and epilogue for sync/async functions\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n assertHash(hash);\n const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);\n const { c, dkLen, asyncTick } = opts;\n assertNumber(c);\n assertNumber(dkLen);\n assertNumber(asyncTick);\n if (c < 1)\n throw new Error('PBKDF2: iterations (c) should be >= 1');\n const password = toBytes(_password);\n const salt = toBytes(_salt);\n // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n const DK = new Uint8Array(dkLen);\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n const PRF = hmac.create(hash, password);\n const PRFSalt = PRF._cloneInto().update(salt);\n return { c, dkLen, asyncTick, DK, PRF, PRFSalt };\n}\nfunction pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {\n PRF.destroy();\n PRFSalt.destroy();\n if (prfW)\n prfW.destroy();\n u.fill(0);\n return DK;\n}\n/**\n * PBKDF2-HMAC: RFC 2898 key derivation function\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated\n * @param salt - cryptographic salt\n * @param opts - {c, dkLen} where c is work factor and dkLen is output message size\n */\nexport function pbkdf2(hash, password, salt, opts) {\n const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = createView(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n for (let ui = 1; ui < c; ui++) {\n // Uc = PRF(Password, Uc−1)\n PRF._cloneInto(prfW).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n }\n }\n return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\nexport async function pbkdf2Async(hash, password, salt, opts) {\n const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);\n let prfW; // Working copy\n const arr = new Uint8Array(4);\n const view = createView(arr);\n const u = new Uint8Array(PRF.outputLen);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {\n // Ti = F(Password, Salt, c, i)\n const Ti = DK.subarray(pos, pos + PRF.outputLen);\n view.setInt32(0, ti, false);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n (prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n await asyncLoop(c - 1, asyncTick, () => {\n // Uc = PRF(Password, Uc−1)\n PRF._cloneInto(prfW).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n });\n }\n return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);\n}\n//# sourceMappingURL=pbkdf2.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","const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","import { SHA2 } from './_sha2.js';\nimport u64 from './_u64.js';\nimport { wrapConstructor } from './utils.js';\n// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409):\n// prettier-ignore\nconst [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\n// Temporary buffer, not used to store anything between runs\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nexport class SHA512 extends SHA2 {\n constructor() {\n super(128, 64, 16, false);\n // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers.\n // Also looks cleaner and easier to verify with spec.\n // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x6a09e667 | 0;\n this.Al = 0xf3bcc908 | 0;\n this.Bh = 0xbb67ae85 | 0;\n this.Bl = 0x84caa73b | 0;\n this.Ch = 0x3c6ef372 | 0;\n this.Cl = 0xfe94f82b | 0;\n this.Dh = 0xa54ff53a | 0;\n this.Dl = 0x5f1d36f1 | 0;\n this.Eh = 0x510e527f | 0;\n this.El = 0xade682d1 | 0;\n this.Fh = 0x9b05688c | 0;\n this.Fl = 0x2b3e6c1f | 0;\n this.Gh = 0x1f83d9ab | 0;\n this.Gl = 0xfb41bd6b | 0;\n this.Hh = 0x5be0cd19 | 0;\n this.Hl = 0x137e2179 | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n SHA512_W_H.fill(0);\n SHA512_W_L.fill(0);\n }\n destroy() {\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\nclass SHA512_224 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x8c3d37c8 | 0;\n this.Al = 0x19544da2 | 0;\n this.Bh = 0x73e19966 | 0;\n this.Bl = 0x89dcd4d6 | 0;\n this.Ch = 0x1dfab7ae | 0;\n this.Cl = 0x32ff9c82 | 0;\n this.Dh = 0x679dd514 | 0;\n this.Dl = 0x582f9fcf | 0;\n this.Eh = 0x0f6d2b69 | 0;\n this.El = 0x7bd44da8 | 0;\n this.Fh = 0x77e36f73 | 0;\n this.Fl = 0x04c48942 | 0;\n this.Gh = 0x3f9d85a8 | 0;\n this.Gl = 0x6a1d36c8 | 0;\n this.Hh = 0x1112e6ad | 0;\n this.Hl = 0x91d692a1 | 0;\n this.outputLen = 28;\n }\n}\nclass SHA512_256 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x22312194 | 0;\n this.Al = 0xfc2bf72c | 0;\n this.Bh = 0x9f555fa3 | 0;\n this.Bl = 0xc84c64c2 | 0;\n this.Ch = 0x2393b86b | 0;\n this.Cl = 0x6f53b151 | 0;\n this.Dh = 0x96387719 | 0;\n this.Dl = 0x5940eabd | 0;\n this.Eh = 0x96283ee2 | 0;\n this.El = 0xa88effe3 | 0;\n this.Fh = 0xbe5e1e25 | 0;\n this.Fl = 0x53863992 | 0;\n this.Gh = 0x2b0199fc | 0;\n this.Gl = 0x2c85b8aa | 0;\n this.Hh = 0x0eb72ddc | 0;\n this.Hl = 0x81c52ca2 | 0;\n this.outputLen = 32;\n }\n}\nclass SHA384 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0xcbbb9d5d | 0;\n this.Al = 0xc1059ed8 | 0;\n this.Bh = 0x629a292a | 0;\n this.Bl = 0x367cd507 | 0;\n this.Ch = 0x9159015a | 0;\n this.Cl = 0x3070dd17 | 0;\n this.Dh = 0x152fecd8 | 0;\n this.Dl = 0xf70e5939 | 0;\n this.Eh = 0x67332667 | 0;\n this.El = 0xffc00b31 | 0;\n this.Fh = 0x8eb44a87 | 0;\n this.Fl = 0x68581511 | 0;\n this.Gh = 0xdb0c2e0d | 0;\n this.Gl = 0x64f98fa7 | 0;\n this.Hh = 0x47b5481d | 0;\n this.Hl = 0xbefa4fa4 | 0;\n this.outputLen = 48;\n }\n}\nexport const sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA512());\nexport const sha512_224 = /* @__PURE__ */ wrapConstructor(() => new SHA512_224());\nexport const sha512_256 = /* @__PURE__ */ wrapConstructor(() => new SHA512_256());\nexport const sha384 = /* @__PURE__ */ wrapConstructor(() => new SHA384());\n//# sourceMappingURL=sha512.js.map","import { bytes, exists, number, output } from './_assert.js';\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js';\nimport { Hash, u32, toBytes, wrapConstructor, wrapXOFConstructorWithOpts, } from './utils.js';\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n number(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n keccak() {\n keccakP(this.state32, this.rounds);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n exists(this);\n const { blockLen, state } = 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 for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n exists(this, false);\n bytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n number(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n output(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\nexport const sha3_224 = /* @__PURE__ */ gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8);\nexport const sha3_384 = /* @__PURE__ */ gen(0x06, 104, 384 / 8);\nexport const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8);\nexport const keccak_224 = /* @__PURE__ */ gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8);\nexport const keccak_384 = /* @__PURE__ */ gen(0x01, 104, 384 / 8);\nexport const keccak_512 = /* @__PURE__ */ gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexport const shake128 = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8);\nexport const shake256 = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert(value >> width === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\",\n fault: \"overflow\",\n value: _value,\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -((~value & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = BN_1 << (width - BN_1);\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n const mask = (BN_1 << width) - BN_1;\n return (~value & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof value) {\n case \"bigint\":\n return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\",\n operation: \"getUint\",\n value,\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof value) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value,\n });\n // Pad the value to the required width\n while (result.length < width * 2) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n return new Uint8Array([]);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map","/**\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 let value = toBigInt(getBytes(_value));\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\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","// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map","/**\n * Explain events...\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map","/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import { assert } from \"./errors.js\";\n// @TODO: timeout is completely ignored; start a Promise.any with a reject?\n// @ts-ignore\nexport async function getUrl(req, _signal) {\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 let signal = undefined;\n if (_signal) {\n const controller = new AbortController();\n signal = controller.signal;\n _signal.addListener(() => {\n controller.abort();\n });\n }\n const init = {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal,\n };\n try {\n const resp = await fetch(req.url, init);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = respBody == null ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers,\n body,\n };\n }\n catch (error) {\n console.log({ error });\n return undefined;\n }\n}\n//# sourceMappingURL=geturl-browser.js.map","/**\n * Explain fetching here...\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 { getUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet getUrlFunc = getUrl;\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(() => {\n listener();\n }, 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() {\n return this.#cancelled;\n }\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 /**\n * The fetch URI to requrest.\n */\n get url() {\n return this.#url;\n }\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``) and the .\n *\n * If %%body%% is a string, the intrincis ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrincis ``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 chnages 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 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]],\n 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 complere response.\n * //(default: 5 minutes)//\n */\n get timeout() {\n return this.#timeout;\n }\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 * 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 }\n toString() {\n return ``;\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\",\n reason: \"timeout\",\n 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\n .makeServerError(\"error in post-processing function\", error)\n .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 getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req\n .redirect(location)\n .#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 ||\n (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof retryAfter === \"string\" &&\n retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req\n .clone()\n .#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\n .makeServerError(\"error in post-processing function\", error)\n .assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req\n .clone()\n .#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 locataions\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" &&\n (current !== \"https\" || target !== \"http\") &&\n 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 = \"GET\";\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 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 getUrlFunc = getUrl;\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 * 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 ``;\n }\n /**\n * The response status code.\n */\n get statusCode() {\n return this.#statusCode;\n }\n /**\n * The response status message.\n */\n get statusMessage() {\n return this.#statusMessage;\n }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() {\n return Object.assign({}, this.#headers);\n }\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\",\n 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\",\n 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]],\n 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 of 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() {\n return this.#request;\n }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" &&\n this.statusCode >= 200 &&\n 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 assert(false, message, \"SERVER_ERROR\", {\n request: this.request || \"unknown request\",\n response: this,\n error,\n });\n }\n}\nfunction getTime() {\n return new Date().getTime();\n}\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","var _a;\n/**\n * About fixed-point math...\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = BN_1 << (width - BN_1);\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = BN_1 << width;\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n val = ((val % limit) + limit) % limit & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof value === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof value === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = match[1] !== \"u\";\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof v[key] === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument(width % 8 === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return negative + str;\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return negative + str;\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, an value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() {\n return this.#format.signed;\n }\n /**\n * The number of bits available to store the value.\n */\n get width() {\n return this.#format.width;\n }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() {\n return this.#format.decimals;\n }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() {\n return this.#val;\n }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n \n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n \n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n */\n val = checkValue(val, this.#format, safeOp);\n return new _a(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) {\n return this.#add(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) {\n return this.#add(other, \"add\");\n }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) {\n return this.#sub(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) {\n return this.#sub(other, \"sub\");\n }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) {\n return this.#mul(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) {\n return this.#mul(other, \"mul\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert(value % this.#tens === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) {\n return this.#div(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) {\n return this.#div(other, \"div\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(other);\n const value = this.#val * this.#tens;\n assert(value % other.#val === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%other%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return -1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) {\n return this.cmp(other) === 0;\n }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) {\n return this.cmp(other) < 0;\n }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) {\n return this.cmp(other) <= 0;\n }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) {\n return this.cmp(other) > 0;\n }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) {\n return this.cmp(other) >= 0;\n }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new _a(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() {\n return this.#val === BN_0;\n }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() {\n return this.#val < BN_0;\n }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() {\n return this._value;\n }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() {\n return parseFloat(this.toString());\n }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return _a.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, decimals, _format) {\n if (decimals == null) {\n decimals = 0;\n }\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert(value % tens === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\",\n fault: \"underflow\",\n value: _value,\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && match[2].length + match[3].length > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = match[2] || \"0\", decimal = match[3] || \"\";\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\",\n fault: \"underflow\",\n value: _value,\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new _a(_guard, value, format);\n }\n}\n_a = FixedNumber;\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","import { 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,\n length,\n 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,\n length: 0,\n offset: 1,\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data,\n length: data.length,\n 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","import { 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","/**\n * Most interactions with Core requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Core, //Core// is divisible to 18 decimal places,\n * where each individual unit is called a //ore//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n ///Ore, the smallest and atomic amount of Core\n \"ore\",\n ///fecore, 1000 ore\n \"fecore\",\n ///Picore, one million ore\n \"picore\",\n ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices.\n \"nacore\",\n ///Μcore, 10^12 ore or 1 μCore\n \"mcore\",\n ///micore, 10^15 ore or 1 mcore\n \"micore\",\n \"core\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit.\n */\nexport const scientificToDecimal = (num) => {\n // @ts-ignore\n var nsign = Math.sign(num);\n //remove the sign\n // @ts-ignore\n num = Math.abs(num);\n //if the number is in scientific notation remove it\n // @ts-ignore\n if (/\\d+\\.?\\d*e[\\+\\-]*\\d+/i.test(num)) {\n var zero = \"0\", \n // @ts-ignore\n parts = String(num).toLowerCase().split(\"e\"), //split into coeff and exponent\n e = parts.pop(), //store the exponential part\n // @ts-ignore\n l = Math.abs(e), //get the number of zeros\n // @ts-ignore\n sign = e / l, coeff_array = parts[0].split(\".\");\n if (sign === -1) {\n l = l - coeff_array[0].length;\n if (l < 0) {\n // @ts-ignore\n num =\n coeff_array[0].slice(0, l) +\n \".\" +\n coeff_array[0].slice(l) +\n (coeff_array.length === 2 ? coeff_array[1] : \"\");\n }\n else {\n // @ts-ignore\n num = zero + \".\" + new Array(l + 1).join(zero) + coeff_array.join(\"\");\n }\n }\n else {\n var dec = coeff_array[1];\n if (dec)\n l = l - dec.length;\n if (l < 0) {\n // @ts-ignore\n num = coeff_array[0] + dec.slice(0, l) + \".\" + dec.slice(l);\n }\n else {\n // @ts-ignore\n num = coeff_array.join(\"\") + new Array(l + 1).join(zero);\n }\n }\n }\n // @ts-ignore\n return nsign < 0 ? \"-\" + num : num;\n};\nexport const trimDecimals = (n, decimals = 18) => {\n n += \"\";\n if (n.indexOf(\".\") === -1)\n return n;\n const arr = n.split(\".\");\n const fraction = arr[1].substr(0, decimals);\n return arr[0] + \".\" + fraction;\n};\nexport function parseUnits(value, unit) {\n assertArgument(typeof value === \"string\", \"value must be a string\", \"value\", value);\n if (value.includes(\"e\")) {\n value = scientificToDecimal(value).toString();\n }\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n value = trimDecimals(value, decimals);\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n value = trimDecimals(value, decimals);\n }\n return FixedNumber.fromString(value, { decimals }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatXCB(ore) {\n return formatUnits(ore, 18);\n}\n/**\n * Converts the //decimal string// %%xcb%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseXCB(xcb) {\n return parseUnits(xcb, 18);\n}\n//# sourceMappingURL=units.js.map","/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map","// @ts-ignore\nimport ed448 from \"./browser-ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"./pbkdf2-browser.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(msgHash, signedMsg, pubKey);\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock-browser.js.map","/* Browser Crypto Shims */\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = function (data) {\n let v = \"0x\" +\n createHash(\"sha3-256\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n return v;\n};\nconst _sha512 = function (data) {\n let v = \"0x\" +\n createHash(\"sha3-512\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n return v;\n};\n// @ts-ignore\nlet __sha256 = _sha256;\n// @ts-ignore\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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n let createdHash = \"0x\" +\n createHash(\"ripemd160\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n const v = \"0x\" + createdHash;\n if (typeof createdHash !== \"string\") {\n createdHash = hexlify(createdHash);\n return createdHash;\n }\n return v;\n}\nexport function sha256(data) {\n let createdHash = createHash(\"sha3-256\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n const v = \"0x\" + createdHash;\n if (typeof createdHash !== \"string\") {\n createdHash = hexlify(createdHash);\n return createdHash;\n }\n return v;\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return \"0x\" + createHmac(\"sha3-256\", k).update(d).digest(\"hex\");\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return \"0x\" + createHmac(\"sha3-512\", k).update(d).digest(\"hex\");\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 let createdHash = createHash(\"sha3-512\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n const v = \"0x\" + createdHash;\n if (typeof createdHash !== \"string\") {\n createdHash = hexlify(createdHash);\n return createdHash;\n }\n return v;\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha256);\n//# sourceMappingURL=sha3.js.map","/**\n * Addresses are a fundamental part of interacting with Core. They\n * represent the gloabal identity of Externally Owned Accounts (accounts\n * backed by a private key) and contracts.\n *\n * The Core Naming Service (CNS) provides an interconnected ecosystem\n * of contracts, standards and libraries which enable looking up an\n * address for an ENS name.\n *\n * These functions help convert between various formats, validate\n * addresses and safely resolve ENS names.\n *\n * @_section: api/address:Addresses [about-addresses]\n */\nnull;\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { encode } from \"../crypto/rlp.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexDataSlice, hexlify, stripZeros, } from \"../utils/data.js\";\nconst logger = new Logger(\"address/0.0.1\");\nconst precompiledAddresses = [\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n \"0000000000000000000000000000000000000000000000000000000000000001\",\n \"0000000000000000000000000000000000000000000000000000000000000002\",\n \"0000000000000000000000000000000000000000000000000000000000000003\",\n \"0000000000000000000000000000000000000000000000000000000000000004\",\n \"0000000000000000000000000000000000000000000000000000000000000005\",\n \"0000000000000000000000000000000000000000000000000000000000000006\",\n \"0000000000000000000000000000000000000000000000000000000000000007\",\n \"0000000000000000000000000000000000000000000000000000000000000008\",\n \"0000000000000000000000000000000000000000000000000000000000000009\",\n];\nfunction removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nfunction calculateCheckSum(_address, _prefix) {\n const address = getBytes(\"0x\" + _address.replace(\"0x\", \"\"));\n const prefix = getBytes(\"0x\" + _prefix.replace(\"0x\", \"\"));\n const tmpConcated = new Uint8Array([...address, ...prefix]);\n const hexedConcat = hexlify(tmpConcated).replace(\"0x\", \"\") + \"00\";\n const mods = Array.from(hexedConcat.toUpperCase(), (c) => {\n const charCode = c.charCodeAt(0);\n return charCode > 64 && charCode < 91\n ? (charCode - 55).toString()\n : (charCode - 48).toString();\n }).join(\"\");\n const bigVal = BigInt(mods);\n const val97 = BigInt(97);\n const val98 = BigInt(98);\n const remainder = bigVal % val97;\n const checkSum = val98 - remainder;\n const result = checkSum > 9 ? checkSum.toString() : \"0\" + checkSum.toString();\n return result;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address\n .split(\"\")\n .map((c) => {\n return ibanLookup[c];\n })\n .join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Core uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nfunction getAddress(address) {\n if (typeof address !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n const raw = removeHexPrefix(address);\n if (precompiledAddresses.includes(raw)) {\n return \"0x\" + raw;\n }\n const prefix = raw.substring(0, 2);\n const val = raw.substring(4);\n const checksum = calculateCheckSum(val, prefix);\n if (checksum !== raw.substring(2, 4)) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n return \"0x\" + prefix + checksum + val;\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nfunction getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\nfunction networkIdToPrefix(networkId) {\n if (networkId == 1) {\n return \"cb\";\n }\n else if (networkId == 3 || networkId == 4) {\n return \"ab\";\n }\n else if (networkId > 10 || networkId == 0) {\n return \"ce\";\n }\n else {\n logger.throwArgumentError(\"bad networkId\", \"networkId\", networkId);\n return \"\";\n }\n}\nfunction getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n const val = hexDataSlice(sha256(encode([from, nonce])), 12);\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, };\n//# sourceMappingURL=index.js.map","/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () {\n locked = true;\n};\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map","import { SHA2 } from './_sha2.js';\nimport { wrapConstructor } from './utils.js';\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf\nconst Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]);\nconst Id = /* @__PURE__ */ Uint8Array.from({ length: 16 }, (_, i) => i);\nconst Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16);\nlet idxL = [Id];\nlet idxR = [Pi];\nfor (let i = 0; i < 4; i++)\n for (let j of [idxL, idxR])\n j.push(j[i].map((k) => Rho[k]));\nconst shifts = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => new Uint8Array(i));\nconst shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst Kl = /* @__PURE__ */ new Uint32Array([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\nconst Kr = /* @__PURE__ */ new Uint32Array([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | (word >>> (32 - shift));\n// It's called f() in spec.\nfunction f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n else if (group === 1)\n return (x & y) | (~x & z);\n else if (group === 2)\n return (x | ~y) ^ z;\n else if (group === 3)\n return (x & z) | (y & ~z);\n else\n return x ^ (y | ~z);\n}\n// Temporary buffer, not used to store anything between runs\nconst BUF = /* @__PURE__ */ new Uint32Array(16);\nexport class RIPEMD160 extends SHA2 {\n constructor() {\n super(64, 20, 8, true);\n this.h0 = 0x67452301 | 0;\n this.h1 = 0xefcdab89 | 0;\n this.h2 = 0x98badcfe | 0;\n this.h3 = 0x10325476 | 0;\n this.h4 = 0xc3d2e1f0 | 0;\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n BUF.fill(0);\n }\n destroy() {\n this.destroyed = true;\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a hash function from 1990s.\n * @param message - msg that would be hashed\n */\nexport const ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());\n//# sourceMappingURL=ripemd160.js.map","import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/ripemd160\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () {\n locked = true;\n};\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map","/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () {\n locked = true;\n};\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map","/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () {\n locked = true;\n};\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map","import { number as assertNumber } from './_assert.js';\nimport { sha256 } from './sha256.js';\nimport { pbkdf2 } from './pbkdf2.js';\nimport { asyncLoop, checkOpts, u32 } from './utils.js';\n// RFC 7914 Scrypt KDF\n// Left rotate for uint32\nconst rotl = (a, b) => (a << b) | (a >>> (32 - b));\n// The main Scrypt loop: uses Salsa extensively.\n// Six versions of the function were tried, this is the fastest one.\n// prettier-ignore\nfunction XorAndSalsa(prev, pi, input, ii, out, oi) {\n // Based on https://cr.yp.to/salsa20.html\n // Xor blocks\n let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];\n let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];\n let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];\n let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];\n let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];\n let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];\n let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];\n let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];\n // Save state to temporary variables (salsa)\n let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n // Main loop (salsa)\n for (let i = 0; i < 8; i += 2) {\n x04 ^= rotl(x00 + x12 | 0, 7);\n x08 ^= rotl(x04 + x00 | 0, 9);\n x12 ^= rotl(x08 + x04 | 0, 13);\n x00 ^= rotl(x12 + x08 | 0, 18);\n x09 ^= rotl(x05 + x01 | 0, 7);\n x13 ^= rotl(x09 + x05 | 0, 9);\n x01 ^= rotl(x13 + x09 | 0, 13);\n x05 ^= rotl(x01 + x13 | 0, 18);\n x14 ^= rotl(x10 + x06 | 0, 7);\n x02 ^= rotl(x14 + x10 | 0, 9);\n x06 ^= rotl(x02 + x14 | 0, 13);\n x10 ^= rotl(x06 + x02 | 0, 18);\n x03 ^= rotl(x15 + x11 | 0, 7);\n x07 ^= rotl(x03 + x15 | 0, 9);\n x11 ^= rotl(x07 + x03 | 0, 13);\n x15 ^= rotl(x11 + x07 | 0, 18);\n x01 ^= rotl(x00 + x03 | 0, 7);\n x02 ^= rotl(x01 + x00 | 0, 9);\n x03 ^= rotl(x02 + x01 | 0, 13);\n x00 ^= rotl(x03 + x02 | 0, 18);\n x06 ^= rotl(x05 + x04 | 0, 7);\n x07 ^= rotl(x06 + x05 | 0, 9);\n x04 ^= rotl(x07 + x06 | 0, 13);\n x05 ^= rotl(x04 + x07 | 0, 18);\n x11 ^= rotl(x10 + x09 | 0, 7);\n x08 ^= rotl(x11 + x10 | 0, 9);\n x09 ^= rotl(x08 + x11 | 0, 13);\n x10 ^= rotl(x09 + x08 | 0, 18);\n x12 ^= rotl(x15 + x14 | 0, 7);\n x13 ^= rotl(x12 + x15 | 0, 9);\n x14 ^= rotl(x13 + x12 | 0, 13);\n x15 ^= rotl(x14 + x13 | 0, 18);\n }\n // Write output (salsa)\n out[oi++] = (y00 + x00) | 0;\n out[oi++] = (y01 + x01) | 0;\n out[oi++] = (y02 + x02) | 0;\n out[oi++] = (y03 + x03) | 0;\n out[oi++] = (y04 + x04) | 0;\n out[oi++] = (y05 + x05) | 0;\n out[oi++] = (y06 + x06) | 0;\n out[oi++] = (y07 + x07) | 0;\n out[oi++] = (y08 + x08) | 0;\n out[oi++] = (y09 + x09) | 0;\n out[oi++] = (y10 + x10) | 0;\n out[oi++] = (y11 + x11) | 0;\n out[oi++] = (y12 + x12) | 0;\n out[oi++] = (y13 + x13) | 0;\n out[oi++] = (y14 + x14) | 0;\n out[oi++] = (y15 + x15) | 0;\n}\nfunction BlockMix(input, ii, out, oi, r) {\n // The block B is r 128-byte chunks (which is equivalent of 2r 64-byte chunks)\n let head = oi + 0;\n let tail = oi + 16 * r;\n for (let i = 0; i < 16; i++)\n out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]\n for (let i = 0; i < r; i++, head += 16, ii += 16) {\n // We write odd & even Yi at same time. Even: 0bXXXXX0 Odd: 0bXXXXX1\n XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])\n if (i > 0)\n tail += 16; // First iteration overwrites tmp value in tail\n XorAndSalsa(out, head, input, (ii += 16), out, tail); // tail[i] = Salsa(blockIn[2*i+1] ^ head[i])\n }\n}\n// Common prologue and epilogue for sync/async functions\nfunction scryptInit(password, salt, _opts) {\n // Maxmem - 1GB+1KB by default\n const opts = checkOpts({\n dkLen: 32,\n asyncTick: 10,\n maxmem: 1024 ** 3 + 1024,\n }, _opts);\n const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;\n assertNumber(N);\n assertNumber(r);\n assertNumber(p);\n assertNumber(dkLen);\n assertNumber(asyncTick);\n assertNumber(maxmem);\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('progressCb should be function');\n const blockSize = 128 * r;\n const blockSize32 = blockSize / 4;\n if (N <= 1 || (N & (N - 1)) !== 0 || N >= 2 ** (blockSize / 8) || N > 2 ** 32) {\n // NOTE: we limit N to be less than 2**32 because of 32 bit variant of Integrify function\n // There is no JS engines that allows alocate more than 4GB per single Uint8Array for now, but can change in future.\n throw new Error('Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32');\n }\n if (p < 0 || p > ((2 ** 32 - 1) * 32) / blockSize) {\n throw new Error('Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)');\n }\n if (dkLen < 0 || dkLen > (2 ** 32 - 1) * 32) {\n throw new Error('Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32');\n }\n const memUsed = blockSize * (N + p);\n if (memUsed > maxmem) {\n throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`);\n }\n // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)\n // Since it has only one iteration there is no reason to use async variant\n const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });\n const B32 = u32(B);\n // Re-used between parallel iterations. Array(iterations) of B\n const V = u32(new Uint8Array(blockSize * N));\n const tmp = u32(new Uint8Array(blockSize));\n let blockMixCb = () => { };\n if (onProgress) {\n const totalBlockMix = 2 * N * p;\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);\n let blockMixCnt = 0;\n blockMixCb = () => {\n blockMixCnt++;\n if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix))\n onProgress(blockMixCnt / totalBlockMix);\n };\n }\n return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };\n}\nfunction scryptOutput(password, dkLen, B, V, tmp) {\n const res = pbkdf2(sha256, password, B, { c: 1, dkLen });\n B.fill(0);\n V.fill(0);\n tmp.fill(0);\n return res;\n}\n/**\n * Scrypt KDF from RFC 7914.\n * @param password - pass\n * @param salt - salt\n * @param opts - parameters\n * - `N` is cpu/mem work factor (power of 2 e.g. 2**18)\n * - `r` is block size (8 is common), fine-tunes sequential memory read size and performance\n * - `p` is parallelization factor (1 is common)\n * - `dkLen` is output key length in bytes e.g. 32.\n * - `asyncTick` - (default: 10) max time in ms for which async function can block execution\n * - `maxmem` - (default: `1024 ** 3 + 1024` aka 1GB+1KB). A limit that the app could use for scrypt\n * - `onProgress` - callback function that would be executed for progress report\n * @returns Derived key\n */\nexport function scrypt(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n for (let i = 0, pos = 0; i < N - 1; i++) {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n for (let i = 0; i < N; i++) {\n // First u32 of the last 64-byte block (u32 is LE)\n const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }\n }\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n/**\n * Scrypt KDF from RFC 7914.\n */\nexport async function scryptAsync(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n let pos = 0;\n await asyncLoop(N - 1, asyncTick, () => {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n });\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n await asyncLoop(N, asyncTick, () => {\n // First u32 of the last 64-byte block (u32 is LE)\n const j = B32[Pi + blockSize32 - 16] % N; // j = Integrify(X) % iterations\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; // tmp = B ^ V[j]\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n });\n }\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n//# sourceMappingURL=scrypt.js.map","import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from \"@noble/hashes/scrypt\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () {\n lockedAsync = true;\n};\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () {\n lockedSync = true;\n};\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */\nconst B256 = 2n ** 256n; // secp256k1 is short weierstrass curve\nconst P = B256 - 0x1000003d1n; // curve's field prime\nconst N = B256 - 0x14551231950b75fc4402da1732fc9bebfn; // curve (group) order\nconst Gx = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798n; // base point x\nconst Gy = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8n; // base point y\nconst CURVE = { p: P, n: N, a: 0n, b: 7n, Gx, Gy }; // exported variables incl. a, b\nconst fLen = 32; // field / group byte length\nconst crv = (x) => mod(mod(x * x) * x + CURVE.b); // x³ + ax + b weierstrass formula; no a\nconst err = (m = '') => { throw new Error(m); }; // error helper, messes-up stack trace\nconst big = (n) => typeof n === 'bigint'; // is big integer\nconst str = (s) => typeof s === 'string'; // is string\nconst fe = (n) => big(n) && 0n < n && n < P; // is field element (invertible)\nconst ge = (n) => big(n) && 0n < n && n < N; // is group element\nconst au8 = (a, l) => // is Uint8Array (of specific length)\n !(a instanceof Uint8Array) || (typeof l === 'number' && l > 0 && a.length !== l) ?\n err('Uint8Array expected') : a;\nconst u8n = (data) => new Uint8Array(data); // creates Uint8Array\nconst toU8 = (a, len) => au8(str(a) ? h2b(a) : u8n(a), len); // norm(hex/u8a) to u8a\nconst mod = (a, b = P) => { let r = a % b; return r >= 0n ? r : b + r; }; // mod division\nconst isPoint = (p) => (p instanceof Point ? p : err('Point expected')); // is 3d point\nlet Gpows = undefined; // precomputes for base point G\nclass Point {\n constructor(px, py, pz) {\n this.px = px;\n this.py = py;\n this.pz = pz;\n } //3d=less inversions\n static fromAffine(p) { return new Point(p.x, p.y, 1n); }\n static fromHex(hex) {\n hex = toU8(hex); // convert hex string to Uint8Array\n let p = undefined;\n const head = hex[0], tail = hex.subarray(1); // first byte is prefix, rest is data\n const x = slcNum(tail, 0, fLen), len = hex.length; // next 32 bytes are x coordinate\n if (len === 33 && [0x02, 0x03].includes(head)) { // compressed points: 33b, start\n if (!fe(x))\n err('Point hex invalid: x not FE'); // with byte 0x02 or 0x03. Check if 0 0n; d = d.double(), n >>= 1n) { // double-and-add ladder\n if (n & 1n)\n p = p.add(d); // if bit is present, add to point\n else if (safe)\n f = f.add(d); // if not, add to fake for timing safety\n }\n return p;\n }\n mulAddQUns(R, u1, u2) {\n return this.mul(u1, false).add(R.mul(u2, false)).ok(); // Unsafe: do NOT use for stuff related\n } // to private keys. Doesn't use Shamir trick\n toAffine() {\n const { px: x, py: y, pz: z } = this; // (x, y, z) ∋ (x=x/z, y=y/z)\n if (this.equals(I))\n return { x: 0n, y: 0n }; // fast-path for zero point\n if (z === 1n)\n return { x, y }; // if z is 1, pass affine coordinates as-is\n const iz = inv(z); // z^-1: invert z\n if (mod(z * iz) !== 1n)\n err('invalid inverse'); // (z * z^-1) must be 1, otherwise bad math\n return { x: mod(x * iz), y: mod(y * iz) }; // x = x*z^-1; y = y*z^-1\n }\n assertValidity() {\n const { x, y } = this.aff(); // convert to 2d xy affine point.\n if (!fe(x) || !fe(y))\n err('Point invalid: x or y'); // x and y must be in range 0 < n < P\n return mod(y * y) === crv(x) ? // y² = x³ + ax + b, must be equal\n this : err('Point invalid: not on curve');\n }\n multiply(n) { return this.mul(n); } // Aliases to compress code\n aff() { return this.toAffine(); }\n ok() { return this.assertValidity(); }\n toHex(isCompressed = true) {\n const { x, y } = this.aff(); // convert to 2d xy affine point\n const head = isCompressed ? ((y & 1n) === 0n ? '02' : '03') : '04'; // 0x02, 0x03, 0x04 prefix\n return head + n2h(x) + (isCompressed ? '' : n2h(y)); // prefix||x and ||y\n }\n toRawBytes(isCompressed = true) {\n return h2b(this.toHex(isCompressed)); // re-use toHex(), convert hex to bytes\n }\n}\nPoint.BASE = new Point(Gx, Gy, 1n); // Generator / base point\nPoint.ZERO = new Point(0n, 1n, 0n); // Identity / zero point\nconst { BASE: G, ZERO: I } = Point; // Generator, identity points\nconst padh = (n, pad) => n.toString(16).padStart(pad, '0');\nconst b2h = (b) => Array.from(b).map(e => padh(e, 2)).join(''); // bytes to hex\nconst h2b = (hex) => {\n const l = hex.length; // error if not string,\n if (!str(hex) || l % 2)\n err('hex invalid 1'); // or has odd length like 3, 5.\n const arr = u8n(l / 2); // create result array\n for (let i = 0; i < arr.length; i++) {\n const j = i * 2;\n const h = hex.slice(j, j + 2); // hexByte. slice is faster than substr\n const b = Number.parseInt(h, 16); // byte, created from string part\n if (Number.isNaN(b) || b < 0)\n err('hex invalid 2'); // byte must be valid 0 <= byte < 256\n arr[i] = b;\n }\n return arr;\n};\nconst b2n = (b) => BigInt('0x' + (b2h(b) || '0')); // bytes to number\nconst slcNum = (b, from, to) => b2n(b.slice(from, to)); // slice bytes num\nconst n2b = (num) => {\n return big(num) && num >= 0n && num < B256 ? h2b(padh(num, 2 * fLen)) : err('bigint expected');\n};\nconst n2h = (num) => b2h(n2b(num)); // number to 32b hex\nconst concatB = (...arrs) => {\n const r = u8n(arrs.reduce((sum, a) => sum + au8(a).length, 0)); // create u8a of summed length\n let pad = 0; // walk through each array,\n arrs.forEach(a => { r.set(a, pad); pad += a.length; }); // ensure they have proper type\n return r;\n};\nconst inv = (num, md = P) => {\n if (num === 0n || md <= 0n)\n err('no inverse n=' + num + ' mod=' + md); // no neg exponent for now\n let a = mod(num, md), b = md, x = 0n, y = 1n, u = 1n, v = 0n;\n while (a !== 0n) { // uses euclidean gcd algorithm\n const q = b / a, r = b % a; // not constant-time\n const m = x - u * q, n = y - v * q;\n b = a, a = r, x = u, y = v, u = m, v = n;\n }\n return b === 1n ? mod(x, md) : err('no inverse'); // b is gcd at this point\n};\nconst sqrt = (n) => {\n let r = 1n; // So, a special, fast case. Paper: \"Square Roots from 1;24,51,10 to Dan Shanks\".\n for (let num = n, e = (P + 1n) / 4n; e > 0n; e >>= 1n) { // powMod: modular exponentiation.\n if (e & 1n)\n r = (r * num) % P; // Uses exponentiation by squaring.\n num = (num * num) % P; // Not constant-time.\n }\n return mod(r * r) === n ? r : err('sqrt invalid'); // check if result is valid\n};\nconst toPriv = (p) => {\n if (!big(p))\n p = b2n(toU8(p, fLen)); // convert to bigint when bytes\n return ge(p) ? p : err('private key out of range'); // check if bigint is in range\n};\nconst moreThanHalfN = (n) => n > (N >> 1n); // if a number is bigger than CURVE.n/2\nfunction getPublicKey(privKey, isCompressed = true) {\n return Point.fromPrivateKey(privKey).toRawBytes(isCompressed); // 33b or 65b output\n}\nclass Signature {\n constructor(r, s, recovery) {\n this.r = r;\n this.s = s;\n this.recovery = recovery;\n this.assertValidity(); // recovery bit is optional when\n } // constructed outside.\n static fromCompact(hex) {\n hex = toU8(hex, 64); // compact repr is (32b r)||(32b s)\n return new Signature(slcNum(hex, 0, fLen), slcNum(hex, fLen, 2 * fLen));\n }\n assertValidity() { return ge(this.r) && ge(this.s) ? this : err(); } // 0 < r or s < CURVE.n\n addRecoveryBit(rec) { return new Signature(this.r, this.s, rec); }\n hasHighS() { return moreThanHalfN(this.s); }\n recoverPublicKey(msgh) {\n const { r, s, recovery: rec } = this; // secg.org/sec1-v2.pdf 4.1.6\n if (![0, 1, 2, 3].includes(rec))\n err('recovery id invalid'); // check recovery id\n const h = bits2int_modN(toU8(msgh, 32)); // Truncate hash\n const radj = rec === 2 || rec === 3 ? r + N : r; // If rec was 2 or 3, q.x is bigger than n\n if (radj >= P)\n err('q.x invalid'); // ensure q.x is still a field element\n const head = (rec & 1) === 0 ? '02' : '03'; // head is 0x02 or 0x03\n const R = Point.fromHex(head + n2h(radj)); // concat head + hex repr of r\n const ir = inv(radj, N); // r^-1\n const u1 = mod(-h * ir, N); // -hr^-1\n const u2 = mod(s * ir, N); // sr^-1\n return G.mulAddQUns(R, u1, u2); // (sr^-1)R-(hr^-1)G = -(hr^-1)G + (sr^-1)\n }\n toCompactRawBytes() { return h2b(this.toCompactHex()); } // Uint8Array 64b compact repr\n toCompactHex() { return n2h(this.r) + n2h(this.s); } // hex 64b compact repr\n}\nconst bits2int = (bytes) => {\n const delta = bytes.length * 8 - 256; // RFC suggests optional truncating via bits2octets\n const num = b2n(bytes); // FIPS 186-4 4.6 suggests the leftmost min(nBitLen, outLen) bits, which\n return delta > 0 ? num >> BigInt(delta) : num; // matches bits2int. bits2int can produce res>N.\n};\nconst bits2int_modN = (bytes) => {\n return mod(bits2int(bytes), N); // with 0: BAD for trunc as per RFC vectors\n};\nconst i2o = (num) => n2b(num); // int to octets\nconst cr = () => // We support: 1) browsers 2) node.js 19+ 3) deno, other envs with crypto\n typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\nlet _hmacSync; // Can be redefined by use in utils; built-ins don't provide it\nconst optS = { lowS: true }; // opts for sign()\nconst optV = { lowS: true }; // standard opts for verify()\nfunction prepSig(msgh, priv, opts = optS) {\n if (['der', 'recovered', 'canonical'].some(k => k in opts)) // Ban legacy options\n err('sign() legacy options not supported');\n let { lowS } = opts; // generates low-s sigs by default\n if (lowS == null)\n lowS = true; // RFC6979 3.2: we skip step A\n const h1i = bits2int_modN(toU8(msgh)); // msg bigint\n const h1o = i2o(h1i); // msg octets\n const d = toPriv(priv); // validate private key, convert to bigint\n const seed = [i2o(d), h1o]; // Step D of RFC6979 3.2\n let ent = opts.extraEntropy; // RFC6979 3.6: additional k' (optional)\n if (ent) { // K = HMAC_K(V || 0x00 || int2octets(x) || bits2octets(h1) || k')\n if (ent === true)\n ent = etc.randomBytes(fLen); // if true, use CSPRNG to generate data\n const e = toU8(ent); // convert Hex|Bytes to Bytes\n if (e.length !== fLen)\n err(); // Expected 32 bytes of extra data\n seed.push(e);\n }\n const m = h1i; // convert msg to bigint\n const k2sig = (kBytes) => {\n const k = bits2int(kBytes); // RFC6979 method.\n if (!ge(k))\n return; // Check 0 < k < CURVE.n\n const ik = inv(k, N); // k^-1 mod n, NOT mod P\n const q = G.mul(k).aff(); // q = Gk\n const r = mod(q.x, N); // r = q.x mod n\n if (r === 0n)\n return; // r=0 invalid\n const s = mod(ik * mod(m + mod(d * r, N), N), N); // s = k^-1(m + rd) mod n\n if (s === 0n)\n return; // s=0 invalid\n let normS = s; // normalized S\n let rec = (q.x === r ? 0 : 2) | Number(q.y & 1n); // recovery bit\n if (lowS && moreThanHalfN(s)) { // if lowS was passed, ensure s is always\n normS = mod(-s, N); // in the bottom half of CURVE.n\n rec ^= 1;\n }\n return new Signature(r, normS, rec); // use normS, not s\n };\n return { seed: concatB(...seed), k2sig };\n}\nfunction hmacDrbg(asynchronous) {\n let v = u8n(fLen); // Minimal non-full-spec HMAC-DRBG from NIST 800-90 for RFC6979 sigs.\n let k = u8n(fLen); // Steps B, 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 = () => { v.fill(1); k.fill(0); i = 0; };\n const _e = 'drbg: tried 1000 values';\n if (asynchronous) { // asynchronous=true\n const h = (...b) => etc.hmacSha256Async(k, v, ...b); // hmac(k)(v, ...values)\n const reseed = async (seed = u8n()) => {\n k = await h(u8n([0x00]), seed); // k = hmac(K || V || 0x00 || seed)\n v = await h(); // v = hmac(K || V)\n if (seed.length === 0)\n return;\n k = await h(u8n([0x01]), seed); // k = hmac(K || V || 0x01 || seed)\n v = await h(); // v = hmac(K || V)\n };\n const gen = async () => {\n if (i++ >= 1000)\n err(_e);\n v = await h(); // v = hmac(K || V)\n return v;\n };\n return async (seed, pred) => {\n reset(); // the returned fn, don't, it's: 1. slower (JIT). 2. unsafe (async race conditions)\n await reseed(seed); // Steps D-G\n let res = undefined; // Step H: grind until k is in [1..n-1]\n while (!(res = pred(await gen())))\n await reseed(); // test predicate until it returns ok\n reset();\n return res;\n };\n }\n else {\n const h = (...b) => {\n const f = _hmacSync;\n if (!f)\n err('etc.hmacSha256Sync not set');\n return f(k, v, ...b); // hmac(k)(v, ...values)\n };\n const reseed = (seed = u8n()) => {\n k = h(u8n([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(u8n([0x01]), seed); // k = hmac(k || v || 0x01 || seed)\n v = h(); // v = hmac(k || v)\n };\n const gen = () => {\n if (i++ >= 1000)\n err(_e);\n v = h(); // v = hmac(k || v)\n return v;\n };\n return (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(); // test predicate until it returns ok\n reset();\n return res;\n };\n }\n}\n// ECDSA signature generation. via secg.org/sec1-v2.pdf 4.1.2 + RFC6979 deterministic k\nasync function signAsync(msgh, priv, opts = optS) {\n const { seed, k2sig } = prepSig(msgh, priv, opts); // Extract arguments for hmac-drbg\n return hmacDrbg(true)(seed, k2sig); // Re-run hmac-drbg until k2sig returns ok\n}\nfunction sign(msgh, priv, opts = optS) {\n const { seed, k2sig } = prepSig(msgh, priv, opts); // Extract arguments for hmac-drbg\n return hmacDrbg(false)(seed, k2sig); // Re-run hmac-drbg until k2sig returns ok\n}\nfunction verify(sig, msgh, pub, opts = optV) {\n let { lowS } = opts; // ECDSA signature verification\n if (lowS == null)\n lowS = true; // Default lowS=true\n if ('strict' in opts)\n err('verify() legacy options not supported'); // legacy param\n let sig_, h, P; // secg.org/sec1-v2.pdf 4.1.4\n const rs = sig && typeof sig === 'object' && 'r' in sig; // Previous ver supported DER sigs. We\n if (!rs && (toU8(sig).length !== 2 * fLen)) // throw error when DER is suspected now.\n err('signature must be 64 bytes');\n try {\n sig_ = rs ? new Signature(sig.r, sig.s).assertValidity() : Signature.fromCompact(sig);\n h = bits2int_modN(toU8(msgh, fLen)); // Truncate hash\n P = pub instanceof Point ? pub.ok() : Point.fromHex(pub); // Validate public key\n }\n catch (e) {\n return false;\n } // Check sig for validity in both cases\n if (!sig_)\n return false;\n const { r, s } = sig_;\n if (lowS && moreThanHalfN(s))\n return false; // lowS bans sig.s >= CURVE.n/2\n let R;\n try {\n const is = inv(s, N); // s^-1\n const u1 = mod(h * is, N); // u1 = hs^-1 mod n\n const u2 = mod(r * is, N); // u2 = rs^-1 mod n\n R = G.mulAddQUns(P, u1, u2).aff(); // R = u1⋅G + u2⋅P\n }\n catch (error) {\n return false;\n }\n if (!R)\n return false; // stop if R is identity / zero point\n const v = mod(R.x, N); // <== The weird ECDSA part. R.x must be in N's field, not P's\n return v === r; // mod(R.x, n) == r\n}\nfunction getSharedSecret(privA, pubB, isCompressed = true) {\n return Point.fromHex(pubB).mul(toPriv(privA)).toRawBytes(isCompressed); // ECDH\n}\nfunction hashToPrivateKey(hash) {\n hash = toU8(hash); // produces private keys with modulo bias\n const minLen = fLen + 8; // being neglible.\n if (hash.length < minLen || hash.length > 1024)\n err('expected proper params');\n const num = mod(b2n(hash), N - 1n) + 1n; // takes at least n+8 bytes\n return n2b(num);\n}\nconst etc = {\n hexToBytes: h2b, bytesToHex: b2h,\n concatBytes: concatB, bytesToNumberBE: b2n, numberToBytesBE: n2b,\n mod, invert: inv,\n hmacSha256Async: async (key, ...msgs) => {\n const crypto = cr(); // HMAC-SHA256 async. No sync built-in!\n if (!crypto)\n return err('etc.hmacSha256Async not set'); // Uses webcrypto: native cryptography.\n const s = crypto.subtle;\n const k = await s.importKey('raw', key, { name: 'HMAC', hash: { name: 'SHA-256' } }, false, ['sign']);\n return u8n(await s.sign('HMAC', k, concatB(...msgs)));\n },\n hmacSha256Sync: _hmacSync,\n hashToPrivateKey,\n randomBytes: (len) => {\n const crypto = cr(); // Can be shimmed in node.js <= 18 to prevent error:\n // import { webcrypto } from 'node:crypto';\n // if (!globalThis.crypto) globalThis.crypto = webcrypto;\n if (!crypto)\n err('crypto.getRandomValues must be defined');\n return crypto.getRandomValues(u8n(len));\n },\n};\nconst utils = {\n normPrivateKeyToScalar: toPriv,\n isValidPrivateKey: (key) => { try {\n return !!toPriv(key);\n }\n catch (e) {\n return false;\n } },\n randomPrivateKey: () => hashToPrivateKey(etc.randomBytes(fLen + 8)),\n precompute(w = 8, p = G) { p.multiply(3n); return p; }, // no-op\n};\nObject.defineProperties(etc, { hmacSha256Sync: {\n configurable: false, get() { return _hmacSync; }, set(f) { if (!_hmacSync)\n _hmacSync = f; },\n } });\nconst W = 8; // Precomputes-related code. W = window size\nconst precompute = () => {\n const points = []; // 10x sign(), 2x verify(). To achieve this,\n const windows = 256 / W + 1; // app needs to spend 40ms+ to calculate\n let p = G, b = p; // a lot of points related to base point G.\n for (let w = 0; w < windows; w++) { // Points are stored in array and used\n b = p; // any time Gx multiplication is done.\n points.push(b); // They consume 16-32 MiB of RAM.\n for (let i = 1; i < 2 ** (W - 1); i++) {\n b = b.add(p);\n points.push(b);\n }\n p = b.double(); // Precomputes don't speed-up getSharedKey,\n } // which multiplies user point by scalar,\n return points; // when precomputes are using base point\n};\nconst wNAF = (n) => {\n // Compared to other point mult methods,\n const comp = Gpows || (Gpows = precompute()); // stores 2x less points using subtraction\n const neg = (cnd, p) => { let n = p.negate(); return cnd ? n : p; }; // negate\n let p = I, f = G; // f must be G, or could become I in the end\n const windows = 1 + 256 / W; // W=8 17 windows\n const wsize = 2 ** (W - 1); // W=8 128 window size\n const mask = BigInt(2 ** W - 1); // W=8 will create mask 0b11111111\n const maxNum = 2 ** W; // W=8 256\n const shiftBy = BigInt(W); // W=8 8\n for (let w = 0; w < windows; w++) {\n const off = w * wsize;\n let wbits = Number(n & mask); // extract W bits.\n n >>= shiftBy; // shift number by W bits.\n if (wbits > wsize) {\n wbits -= maxNum;\n n += 1n;\n } // split if bits > max: +224 => 256-32\n const off1 = off, off2 = off + Math.abs(wbits) - 1; // offsets, evaluate both\n const cnd1 = w % 2 !== 0, cnd2 = wbits < 0; // conditions, evaluate both\n if (wbits === 0) {\n f = f.add(neg(cnd1, comp[off1])); // bits are 0: add garbage to fake point\n }\n else { // ^ can't add off2, off2 = I\n p = p.add(neg(cnd2, comp[off2])); // bits are 1: add to result point\n }\n }\n return { p, f }; // return both real and fake points for JIT\n}; // !! you can disable precomputes by commenting-out call of the wNAF() inside Point#mul()\nexport { getPublicKey, sign, signAsync, verify, CURVE, // Remove the export to easily use in REPL\ngetSharedSecret, etc, utils, Point as ProjectivePoint, Signature }; // envs like browser console\n","/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport * as secp256k1 from \"@noble/secp256k1\";\nimport { dataLength, getBytes, getBytesCopy, hexlify, assertArgument, } from \"../utils/index.js\";\nimport { arrayify, hexConcat } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { ed448 } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"signing-key/0.0.1\");\n//const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n// Make noble-secp256k1 sync\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 let tmp = privateKey;\n if (typeof tmp === \"string\" && tmp.startsWith(\"0x\")) {\n tmp = tmp.replace(\"0x\", \"\");\n }\n assertArgument(dataLength(\"0x\" + tmp) === 57, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(\"0x\" + tmp);\n }\n /**\n * The private key.\n */\n get privateKey() {\n return this.#privateKey;\n }\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() {\n return SigningKey.computePublicKey(this.#privateKey);\n }\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() {\n return SigningKey.computePublicKey(this.#privateKey, true);\n }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n const key = getBytesCopy(this.#privateKey);\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const keyBuffer = new Uint8Array(arrayify(key));\n if (keyBuffer.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n const digestBuffer = new Uint8Array(arrayify(digest));\n if (digestBuffer.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n if (keyBuffer[56] > 127) {\n const prefix = keyBuffer.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[55] |= 0x80;\n prefix[56] = 0;\n const scalar = prefix.slice(0, 56);\n const bufferDigest = Buffer.from(digestBuffer);\n const bufferPrfx = Buffer.from(prefix);\n const bufferScalar = Buffer.from(scalar);\n const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx);\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer));\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\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)));\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 const bytes = Buffer.from(arrayify(key));\n if (bytes.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n if (bytes[56] > 127) {\n const scalar = bytes.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n const pub = ed448.publicKeyFromScalar(scalar);\n return hexlify(pub);\n }\n const pub = ed448.publicKeyCreate(bytes);\n return hexlify(pub);\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 digestBuffer = Buffer.from(arrayify(digest));\n const sigBuffer = Buffer.from(arrayify(signature));\n if (sigBuffer.length !== 171) {\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n }\n const sig = sigBuffer.slice(0, 114);\n const pub = sigBuffer.slice(114);\n if (ed448.verify(digestBuffer, sig, pub)) {\n return hexlify(pub);\n }\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n return \"\";\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 { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate, } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst _guard = {};\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signautre.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() {\n return this.#r;\n }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n const value = hexlify(_value);\n assertArgument(parseInt(value.substring(0, 3)) < 8, \"non-canonical s\", \"value\", value);\n this.#s = value;\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() {\n return this.#v;\n }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() {\n return this.#networkV;\n }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacynetworkId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getnetworkId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return this.v === 27 ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, this.yParity ? \"0x1c\" : \"0x1b\"]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return `Signature { r: \"${this.r}\", s: \"${this.s}\", yParity: ${this.yParity}, networkV: ${this.networkV} }`;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this.s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: networkV != null ? networkV.toString() : null,\n r: this.r,\n s: this.s,\n v: this.v,\n };\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getnetworkId(45)\n * //_result:\n *\n * Signature.getnetworkId(46)\n * //_result:\n */\n static getnetworkId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if (bv == BN_27 || bv == BN_28) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getnetworkIdV(5, 27)\n * //_result:\n *\n * Signature.getnetworkIdV(5, 28)\n * //_result:\n *\n */\n static getnetworkIdV(networkId, v) {\n return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return bv & BN_1 ? 27 : 28;\n }\n}\n//# sourceMappingURL=signature.js.map","/**\n * A fundamental building block of Core is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha3.js\";\nimport { Ed448Goldilock } from \"./crypto.js\";\nimport { keccak256 } from \"./keccak.js\";\nexport { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\nfunction lock() {\n computeHmac.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { arrayify, hexDataSlice } from \"../utils/data.js\";\nimport { calculateCheckSum } from \"../address/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 removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nexport function publicToAddress(key, prefix) {\n const val = hexDataSlice(sha256(key), 12);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport function computeAddress(key, prefix) {\n let pubkey;\n if (typeof key === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return publicToAddress(pubkey, prefix); // getAddress(sha256(\"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, prefix) {\n // return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature);\n return publicToAddress(publicKey, prefix);\n}\nexport function extractPrefix(address) {\n address = getAddress(address);\n return address.substring(2, 4);\n}\n//# sourceMappingURL=address.js.map","import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument, } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => {\n this[index] = item;\n });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof name === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, new Map());\n // Remove any key thats not unique\n this.#names = Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n }));\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof prop === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply(this === receiver ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply(this === receiver ? target : this, [\n prop,\n ]);\n }\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n }\n /**\n * Returns the Result as a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray() {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject() {\n return this.#names.reduce((accum, name, index) => {\n assert(name != null, \"value at index ${ index } unnamed\", \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\",\n });\n // Add values for names that don't conflict\n if (!(name in accum)) {\n accum[name] = this.getValue(name);\n }\n return accum;\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(this.#names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(this.#names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = this.#names.indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: WordSize,\n offset: bytes.length,\n });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\",\n type: \"string\",\n localName: \"string\",\n dynamic: \"boolean\",\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() {\n return this.#dataLength;\n }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n constructor(data, allowLoose) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#offset = 0;\n }\n get data() {\n return hexlify(this.#data);\n }\n get dataLength() {\n return this.#data.length;\n }\n get consumed() {\n return this.#offset;\n }\n get bytes() {\n return new Uint8Array(this.#data);\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose &&\n loose &&\n this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength,\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose);\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, {\n signed,\n width,\n });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${size ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_corebc_typed\");\nexport class Typed {\n type;\n value;\n #options;\n _typedSymbol;\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n defaultValue() {\n return 0;\n }\n minValue() {\n return 0;\n }\n maxValue() {\n return 0;\n }\n isBigInt() {\n return !!this.type.match(/^u?int[0-9]+$/);\n }\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n isString() {\n return this.type === \"string\";\n }\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return this.value.length;\n }\n return null;\n }\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n static uint8(v) {\n return n(v, 8);\n }\n static uint16(v) {\n return n(v, 16);\n }\n static uint24(v) {\n return n(v, 24);\n }\n static uint32(v) {\n return n(v, 32);\n }\n static uint40(v) {\n return n(v, 40);\n }\n static uint48(v) {\n return n(v, 48);\n }\n static uint56(v) {\n return n(v, 56);\n }\n static uint64(v) {\n return n(v, 64);\n }\n static uint72(v) {\n return n(v, 72);\n }\n static uint80(v) {\n return n(v, 80);\n }\n static uint88(v) {\n return n(v, 88);\n }\n static uint96(v) {\n return n(v, 96);\n }\n static uint104(v) {\n return n(v, 104);\n }\n static uint112(v) {\n return n(v, 112);\n }\n static uint120(v) {\n return n(v, 120);\n }\n static uint128(v) {\n return n(v, 128);\n }\n static uint136(v) {\n return n(v, 136);\n }\n static uint144(v) {\n return n(v, 144);\n }\n static uint152(v) {\n return n(v, 152);\n }\n static uint160(v) {\n return n(v, 160);\n }\n static uint168(v) {\n return n(v, 168);\n }\n static uint176(v) {\n return n(v, 176);\n }\n static uint184(v) {\n return n(v, 184);\n }\n static uint192(v) {\n return n(v, 192);\n }\n static uint200(v) {\n return n(v, 200);\n }\n static uint208(v) {\n return n(v, 208);\n }\n static uint216(v) {\n return n(v, 216);\n }\n static uint224(v) {\n return n(v, 224);\n }\n static uint232(v) {\n return n(v, 232);\n }\n static uint240(v) {\n return n(v, 240);\n }\n static uint248(v) {\n return n(v, 248);\n }\n static uint256(v) {\n return n(v, 256);\n }\n static uint(v) {\n return n(v, 256);\n }\n static int8(v) {\n return n(v, -8);\n }\n static int16(v) {\n return n(v, -16);\n }\n static int24(v) {\n return n(v, -24);\n }\n static int32(v) {\n return n(v, -32);\n }\n static int40(v) {\n return n(v, -40);\n }\n static int48(v) {\n return n(v, -48);\n }\n static int56(v) {\n return n(v, -56);\n }\n static int64(v) {\n return n(v, -64);\n }\n static int72(v) {\n return n(v, -72);\n }\n static int80(v) {\n return n(v, -80);\n }\n static int88(v) {\n return n(v, -88);\n }\n static int96(v) {\n return n(v, -96);\n }\n static int104(v) {\n return n(v, -104);\n }\n static int112(v) {\n return n(v, -112);\n }\n static int120(v) {\n return n(v, -120);\n }\n static int128(v) {\n return n(v, -128);\n }\n static int136(v) {\n return n(v, -136);\n }\n static int144(v) {\n return n(v, -144);\n }\n static int152(v) {\n return n(v, -152);\n }\n static int160(v) {\n return n(v, -160);\n }\n static int168(v) {\n return n(v, -168);\n }\n static int176(v) {\n return n(v, -176);\n }\n static int184(v) {\n return n(v, -184);\n }\n static int192(v) {\n return n(v, -192);\n }\n static int200(v) {\n return n(v, -200);\n }\n static int208(v) {\n return n(v, -208);\n }\n static int216(v) {\n return n(v, -216);\n }\n static int224(v) {\n return n(v, -224);\n }\n static int232(v) {\n return n(v, -232);\n }\n static int240(v) {\n return n(v, -240);\n }\n static int248(v) {\n return n(v, -248);\n }\n static int256(v) {\n return n(v, -256);\n }\n static int(v) {\n return n(v, -256);\n }\n static bytes1(v) {\n return b(v, 1);\n }\n static bytes2(v) {\n return b(v, 2);\n }\n static bytes3(v) {\n return b(v, 3);\n }\n static bytes4(v) {\n return b(v, 4);\n }\n static bytes5(v) {\n return b(v, 5);\n }\n static bytes6(v) {\n return b(v, 6);\n }\n static bytes7(v) {\n return b(v, 7);\n }\n static bytes8(v) {\n return b(v, 8);\n }\n static bytes9(v) {\n return b(v, 9);\n }\n static bytes10(v) {\n return b(v, 10);\n }\n static bytes11(v) {\n return b(v, 11);\n }\n static bytes12(v) {\n return b(v, 12);\n }\n static bytes13(v) {\n return b(v, 13);\n }\n static bytes14(v) {\n return b(v, 14);\n }\n static bytes15(v) {\n return b(v, 15);\n }\n static bytes16(v) {\n return b(v, 16);\n }\n static bytes17(v) {\n return b(v, 17);\n }\n static bytes18(v) {\n return b(v, 18);\n }\n static bytes19(v) {\n return b(v, 19);\n }\n static bytes20(v) {\n return b(v, 20);\n }\n static bytes21(v) {\n return b(v, 21);\n }\n static bytes22(v) {\n return b(v, 22);\n }\n static bytes23(v) {\n return b(v, 23);\n }\n static bytes24(v) {\n return b(v, 24);\n }\n static bytes25(v) {\n return b(v, 25);\n }\n static bytes26(v) {\n return b(v, 26);\n }\n static bytes27(v) {\n return b(v, 27);\n }\n static bytes28(v) {\n return b(v, 28);\n }\n static bytes29(v) {\n return b(v, 29);\n }\n static bytes30(v) {\n return b(v, 30);\n }\n static bytes31(v) {\n return b(v, 31);\n }\n static bytes32(v) {\n return b(v, 32);\n }\n static address(v) {\n return new Typed(_gaurd, \"address\", v);\n }\n static bool(v) {\n return new Typed(_gaurd, \"bool\", !!v);\n }\n static bytes(v) {\n return new Typed(_gaurd, \"bytes\", v);\n }\n static string(v) {\n return new Typed(_gaurd, \"string\", v);\n }\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return value && value._typedSymbol === _typedSymbol;\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map","import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 22));\n }\n}\n//# sourceMappingURL=address.js.map","import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","import { defineProperties, isError, assert, assertArgument, assertArgumentCount, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof values === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => {\n func(staticWriter.length);\n });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\";\n const dynamic = length === -1 || coder.dynamic;\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? \" \" + this.localName : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", {\n buffer: reader.bytes,\n offset: count * WordSize,\n length: reader.dataLength,\n });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map","import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map","import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map","import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\".substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map","import { defineProperties, fromTwos, getBigInt, mask, toTwos, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = (signed ? \"int\" : \"uint\") + size * 8;\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, this.size * 8 - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map","import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = \"tuple(\" + types.join(\",\") + \")\";\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, {\n coders: Object.freeze(coders.slice()),\n });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map","import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.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 * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of ore in a single xcb.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const OrePerXCB = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") *\n BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nexport const NegativeOne = /*#__PURE__*/ BigInt(-1);\nexport const Zero = /*#__PURE__*/ BigInt(0);\nexport const One = /*#__PURE__*/ BigInt(1);\nexport const Two = /*#__PURE__*/ BigInt(2);\n//# sourceMappingURL=numbers.js.map","// NFKC (composed) // (decomposed)\n/**\n * A constant for the core symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const CoreSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Core Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Core Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map","import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n }),\n };\n}\n/**\n * Returns a [[AccessList]] from any corebcsupported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof set === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof value === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => a.address.localeCompare(b.address));\n return result;\n}\n//# sourceMappingURL=accesslist.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { recoverAddress } from \"./address.js\";\nimport { checkProperties } from \"../utils/properties.js\";\nimport { arrayify, stripZeros } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport * as RLP from \"../crypto/rlp.js\";\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst logger = new Logger(\"transaction/0.0.1\");\nconst BN_0 = BigInt(0);\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction parse(data) {\n const handleNumber = (value) => {\n // @ts-ignore\n if (value === \"0x\") {\n return BigNumber.from(0);\n }\n return BigNumber.from(value);\n };\n const transaction = RLP.decode(data);\n if (transaction.length !== 7 && transaction.length !== 8) {\n logger.throwArgumentError(\"invalid raw transaction\", \"data\", data);\n }\n const isSigned = transaction.length === 8;\n const tx = {\n nonce: Number(handleNumber(transaction[0])),\n energyPrice: handleNumber(transaction[1]).toBigInt(),\n energyLimit: handleNumber(transaction[2]).toBigInt(),\n networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(),\n to: handleAddress(transaction[isSigned ? 4 : 3]),\n value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(),\n data: transaction[isSigned ? 6 : 5],\n };\n if (transaction.length === 8) {\n const prefix = networkIdToPrefix(Number(tx.networkId));\n const digest = sha256(serialize(tx));\n tx.hash = sha256(serialize(tx, transaction[7]));\n tx.from = recoverAddress(digest, transaction[7], prefix);\n tx.signature = transaction[7];\n }\n return tx;\n}\nconst unsignedTransactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n { name: \"networkId\", maxLength: 32, numeric: true },\n];\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"networkId\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n networkId: true,\n data: true,\n energyLimit: true,\n energyPrice: true,\n nonce: true,\n to: true,\n value: true,\n};\nfunction serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) {\n let value = transaction[name] || [];\n const options = {};\n if (numeric) {\n options.hexPad = \"left\";\n }\n const tmpHexlified = hexlify(value, options);\n value = arrayify(tmpHexlified);\n // Fixed-width field\n if (length && value.length !== length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n // Variable-width (with a maximum)\n if (maxLength) {\n value = stripZeros(value);\n if (value.length > maxLength) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n }\n const hexlified = hexlify(value);\n raw.push(hexlified);\n });\n if (!!signature) {\n raw.push(hexlify(signature));\n }\n const finalValue = RLP.encode(raw);\n return finalValue;\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Core by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in corebc) 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 #to;\n #data;\n #nonce;\n #energyLimit;\n #energyPrice;\n #value;\n #networkId;\n #sig;\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n return this.#to;\n }\n set to(value) {\n this.#to = value == null ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() {\n return this.#nonce;\n }\n set nonce(value) {\n this.#nonce = getNumber(value, \"value\");\n }\n /**\n * The energy limit.\n */\n get energyLimit() {\n return this.#energyLimit;\n }\n set energyLimit(value) {\n this.#energyLimit = getBigInt(value);\n }\n /**\n * The energy 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 energyPrice() {\n const value = this.#energyPrice;\n if (value == null) {\n return BN_0;\n }\n return value;\n }\n set energyPrice(value) {\n this.#energyPrice = value == null ? null : getBigInt(value, \"energyPrice\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() {\n return this.#data;\n }\n set data(value) {\n this.#data = hexlify(value);\n }\n /**\n * The amount of xcb (in ore) to send in this transactions.\n */\n get value() {\n return this.#value;\n }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value);\n }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() {\n return this.#sig || null;\n }\n set signature(value) {\n this.#sig = value == null ? null : value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#to = null;\n this.#nonce = 0;\n this.#energyLimit = BigInt(0);\n this.#energyPrice = null;\n this.#data = \"0x\";\n this.#value = BigInt(0);\n this.#networkId = BigInt(0);\n this.#sig = 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 sha256(this.serialized);\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 sha256(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 const prefix = networkIdToPrefix(Number(this.#networkId));\n return recoverAddress(this.unsignedHash, this.signature, prefix);\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);\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 //isSigned(): this is SignedTransaction {\n return this.signature != null;\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 assert(this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n return serialize(this, this.signature);\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 serialize(this);\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 to: this.to,\n data: this.data,\n nonce: this.nonce,\n energyLimit: s(this.energyLimit),\n energyPrice: s(this.energyPrice),\n value: s(this.value),\n networkId: s(this.networkId),\n sig: this.signature ? this.signature : null,\n };\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 return Transaction.from(parse(payload));\n }\n const result = new Transaction();\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.energyLimit != null) {\n result.energyLimit = tx.energyLimit;\n }\n if (tx.energyPrice != null) {\n result.energyPrice = tx.energyPrice;\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.networkId != null) {\n result.networkId = tx.networkId;\n }\n if (tx.signature != null) {\n result.signature = tx.signature;\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 { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof message === \"string\") {\n message = toUtf8Bytes(message);\n }\n return sha256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message,\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig, prefix) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig, prefix);\n}\n//# sourceMappingURL=message.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument, } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = !!value ? \"0x01\" : \"0x00\";\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = match[1] === \"int\";\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) &&\n size % 8 === 0 &&\n size !== 0 &&\n size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map","import { getAddress } from \"../address/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\";\nimport { sha256 } from \"../crypto/index.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\");\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 networkId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\",\n};\nconst domainFieldNames = [\n \"name\",\n \"version\",\n \"networkId\",\n \"verifyingContract\",\n \"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 networkId: function (_value) {\n const value = getBigInt(_value, \"domain.networkId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.networkId\", _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] || \"256\");\n assertArgument(width % 8 === 0 &&\n width !== 0 &&\n width <= 256 &&\n (match[2] == null || 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\":\n return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\":\n return function (value) {\n return !value ? hexFalse : hexTrue;\n };\n case \"bytes\":\n return function (value) {\n return sha256(value);\n };\n case \"string\":\n return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields\n .map(({ name, type }) => type + \" \" + name)\n .join(\",\")})`;\n}\nexport class TypedDataEncoder {\n primaryType;\n #types;\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n constructor(types) {\n this.#types = JSON.stringify(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 Object.keys(types).forEach((type) => {\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\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 = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1] || null;\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\n .map((t) => JSON.stringify(t))\n .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]) +\n st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(sha256);\n }\n return sha256(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 sha256(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 encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return sha256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n return value.map((v) => this._visit(match[1], 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 visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\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 static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value),\n ]);\n }\n static hash(domain, types, value) {\n return sha256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\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 &&\n !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 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 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, prefix) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix);\n}\n//# sourceMappingURL=typed-data.js.map","/**\n * About frgaments...\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nvar _a;\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\",\n \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\",\n \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\",\n \"@\": \"AT\",\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() {\n return this.#offset;\n }\n get length() {\n return this.#tokens.length - this.#offset;\n }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() {\n return new _a(this.#tokens);\n }\n reset() {\n this.#offset = 0;\n }\n #subTokenString(from = 0, to = 0) {\n return new _a(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: t.match - from,\n linkBack: t.linkBack - from,\n linkNext: t.linkNext - from,\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return top != null && allowed.has(top) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return top.type === type ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\n_a = TokenString;\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = offset < text.length ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = {\n depth: brackets.length,\n linkBack: -1,\n linkNext: -1,\n match: -1,\n type: \"\",\n text: \"\",\n offset,\n value: -1,\n };\n tokens.push(token);\n let type = SimpleTokens[cur[0]] || \"\";\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n tokens[token.match].match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n tokens[tokens.length - 1].value =\n getNumber(value);\n }\n if (tokens.length === 0 ||\n tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n tokens[tokens.length - 1].text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a energy limit, returning a BigNumber or null if none\nfunction consumeEnergy(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid energy\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_corebc_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **PAramType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name,\n type,\n baseType,\n indexed,\n components,\n arrayLength,\n arrayChildren,\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n let result = {\n type: this.baseType === \"tuple\" ? \"tuple\" : this.type,\n name: this.name || undefined,\n };\n if (typeof this.indexed === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${this.arrayLength < 0 ? \"\" : String(this.arrayLength)}]`;\n }\n else {\n if (this.isTuple()) {\n if (format !== \"sighash\") {\n result += this.type;\n }\n result +=\n \"(\" +\n this.components\n .map((comp) => comp.format(format))\n .join(format === \"full\" ? \", \" : \",\") +\n \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /*\n * Returns true if %%value%% is an Array type.\n *\n * This provides a type gaurd ensuring that the\n * [[arrayChildren]] and [[arrayLength]] are non-null.\n */\n //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } {\n // return value && (value.baseType === \"array\")\n //}\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return this.baseType === \"array\";\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return this.baseType === \"tuple\";\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return this.indexed != null;\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => _this.arrayChildren.walk(v, process));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => _this.components[i].walk(v, process));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof value !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () {\n setValue(await result);\n })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS naes by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ParamType.from(lex(obj), allowIndexed);\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") ||\n obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = obj.peekType(\"ID\") ? obj.pop().text : \"\";\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof name === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components,\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" ||\n type.startsWith(\"tuple(\" /* fix: ) */) ||\n type.startsWith(\"(\" /* fix: ) */)) {\n const comps = obj.components != null\n ? obj.components.map((c) => ParamType.from(c))\n : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return value && value[internal] === ParamTypeInternal;\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof obj === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n }\n else if (typeof obj === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\",\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof name === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return (\"(\" +\n params.map((p) => p.format(format)).join(format === \"full\" ? \", \" : \",\") +\n \")\");\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === ErrorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return EventFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n static isFragment(value) {\n return value && value[internal] === EventFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n payable;\n energy;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, energy) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, {\n value: ConstructorFragmentInternal,\n });\n defineProperties(this, { payable, energy });\n }\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: this.payable ? \"payable\" : \"undefined\",\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n result.push(this.payable ? \"payable\" : \"nonpayable\");\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n return result.join(\" \");\n }\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ConstructorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, setify([\"payable\"])).has(\"payable\");\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, energy);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === ConstructorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n format(format) {\n const type = this.inputs.length === 0 ? \"receive\" : \"fallback\";\n if (format === \"json\") {\n const stateMutability = this.payable ? \"payable\" : \"nonpayable\";\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FallbackFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = obj.stateMutability === \"payable\";\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n static isFragment(value) {\n return value && value[internal] === FallbackFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The amount of energy to send when calling this function\n */\n energy;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, energy) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = stateMutability === \"view\" || stateMutability === \"pure\";\n const payable = stateMutability === \"payable\";\n defineProperties(this, {\n constant,\n energy,\n outputs,\n payable,\n stateMutability,\n });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: this.stateMutability !== \"nonpayable\"\n ? this.stateMutability\n : undefined,\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n }\n return result.join(\" \");\n }\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FunctionFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof obj.constant === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === FunctionFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n format() {\n throw new Error(\"@TODO\");\n }\n static from(obj) {\n if (typeof obj === \"string\") {\n return StructFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === StructFragmentInternal;\n }\n}\n//# sourceMappingURL=fragments.js.map","/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason],\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code],\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: tx.to ? getAddress(tx.to) : null,\n data: tx.data || \"0x\",\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action,\n data,\n reason,\n transaction,\n invocation,\n revert,\n });\n}\n/**\n * About AbiCoder\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, match[1] === \"int\", param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose));\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an corebc-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map","/**\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","/**\n * About Interface\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert, } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nexport { checkResultErrors, Result };\nexport class LogDescription {\n fragment;\n name;\n signature;\n topic;\n args;\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n signature,\n topic,\n args,\n });\n }\n}\nexport class TransactionDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n value;\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n value,\n });\n }\n}\nexport class ErrorDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n });\n }\n}\nexport class Indexed {\n hash;\n _isIndexed;\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n },\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n },\n },\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving xcb is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof fragments === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(\"EE\", error);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags),\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, {\n deploy: fragment,\n });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback ||\n fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\"),\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = minimal ? \"minimal\" : \"full\";\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = values.length > 0 ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength &&\n (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 &&\n values &&\n values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null ||\n Array.isArray(lastArg) ||\n typeof lastArg !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#functions.get(name), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#events.get(name), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#errors.get(name), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\n getSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n \n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n \n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n \n fragment = matches[0];\n }\n \n return dataSlice(id(fragment.format()), 0, 4);\n }\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if (bytes.length % 32 === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() },\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name,\n signature: ef.format(),\n args,\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args,\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n \n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n };\n \n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n */\n // Create the filter for the event with search criteria (e.g. for xcb_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return sha256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof value === \"boolean\") {\n value = value ? \"0x01\" : \"0x00\";\n }\n if (param.type.match(/^u?int/)) {\n value = toBeHex(value);\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n //@TOOD should probably be return toHex(value, 32)\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", \"contract.\" + param.name, value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", \"contract.\" + param.name, value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(sha256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics,\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" ||\n param.type === \"bytes\" ||\n param.baseType === \"tuple\" ||\n param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt(tx.value != null ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof value === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // Maybe an interface from an older version, or from a symlinked copy\n if (typeof value.format === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map","import { concat, \n// dataSlice,\ngetBigInt,\n// encodeRlp\n } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { hexDataLength, hexDataSlice } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { removeHexPrefix } from \"../transaction/address.js\";\nimport { calculateCheckSum } from \"./index.js\";\nconst logger = new Logger(\"contract-address/0.0.1\");\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(from);\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\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 * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n const val = hexDataSlice(sha256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12);\n console.log({ \"contract-address/74=>should be string\": val });\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\n//# sourceMappingURL=contract-address.js.map","import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.corebc.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return value && typeof value.getAddress === \"function\";\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null ||\n result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof target !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target) {\n if (typeof target === \"string\") {\n return getAddress(target);\n // assert(resolver != null, \"ENS resolution requires a provider\",\n // \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n // return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof target.then === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map","import { defineProperties, getBigInt, getNumber, hexlify, resolveProperties, assert, assertArgument, isError, makeError, } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The energy price for legacy networks.\n */\n energyPrice;\n constructor(energyPrice) {\n defineProperties(this, {\n energyPrice: getValue(energyPrice),\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { energyPrice } = this;\n return {\n _type: \"FeeData\",\n energyPrice: toJson(energyPrice),\n };\n }\n}\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"networkId,energyLimit,energyPrice,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipReadEnabled = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Core.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total energy limit for this block.\n */\n energyLimit;\n /**\n * The total energy used in this block.\n */\n energyUsed;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per energy that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerEnergy;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof tx !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n nonce: block.nonce,\n difficulty: block.difficulty,\n energyLimit: block.energyLimit,\n energyUsed: block.energyUsed,\n miner: block.miner,\n extraData: block.extraData,\n baseFeePerEnergy: getValue(block.baseFeePerEnergy),\n });\n }\n /**\n * Returns the list of transaction hashes.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof tx === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions for blocks which\n * prefetched them, by passing ``true`` to %%prefetchTxs%%\n * into [[provider_getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof txs[0] === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\",\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this;\n return {\n _type: \"Block\",\n baseFeePerEnergy: toJson(baseFeePerEnergy),\n difficulty: toJson(difficulty),\n extraData,\n energyLimit: toJson(energyLimit),\n energyUsed: toJson(energyUsed),\n hash,\n miner,\n nonce,\n number,\n parentHash,\n timestamp,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++],\n done: false,\n };\n }\n return { value: undefined, done: true };\n },\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() {\n return this.#transactions.length;\n }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof indexOrHash === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof v === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash === hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof tx === \"string\") {\n return await this.provider.getTransaction(tx);\n }\n else {\n return tx;\n }\n }\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof indexOrHash === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Has this block been mined.\n *\n * If true, the block has been typed-gaurded that all mined\n * properties are non-null.\n */\n isMined() {\n return !!this.hash;\n }\n /**\n *\n */\n isLondon() {\n return !!this.baseFeePerEnergy;\n }\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\nexport class Log {\n provider;\n transactionHash;\n blockHash;\n blockNumber;\n removed;\n address;\n data;\n topics;\n index;\n transactionIndex;\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this;\n return {\n _type: \"log\",\n address,\n blockHash,\n blockNumber,\n data,\n index,\n removed,\n topics,\n transactionHash,\n transactionIndex,\n };\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\nexport class TransactionReceipt {\n provider;\n to;\n from;\n contractAddress;\n hash;\n index;\n blockHash;\n blockNumber;\n logsBloom;\n energyUsed;\n cumulativeEnergyUsed;\n energyPrice;\n type;\n //readonly byzantium!: boolean;\n status;\n root;\n #logs;\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n energyUsed: tx.energyUsed,\n cumulativeEnergyUsed: tx.cumulativeEnergyUsed,\n energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice),\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root,\n });\n }\n get logs() {\n return this.#logs;\n }\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,\n status, root, } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash,\n blockNumber,\n //byzantium,\n contractAddress,\n cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed),\n from,\n energyPrice: toJson(this.energyPrice),\n energyUsed: toJson(this.energyUsed),\n hash,\n index,\n logs,\n logsBloom,\n root,\n status,\n to,\n };\n }\n get length() {\n return this.logs.length;\n }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n },\n };\n }\n get fee() {\n return this.energyUsed * this.energyPrice;\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n async getResult() {\n return await this.provider.getTransactionResult(this.hash);\n }\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/*\nexport type ReplacementDetectionSetup = {\n to: string;\n from: string;\n value: bigint;\n data: string;\n nonce: number;\n block: number;\n};\n*/\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of energy this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n energyLimit;\n /**\n * The energy price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective energy price// (the fee per energy that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerEnergy]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of energy the transaction\n * consumes.\n */\n energyPrice;\n /**\n * The data.\n */\n data;\n /**\n * The value, in ore. Use [[formatXCB]] to format this value\n * as xcb.\n */\n value;\n /**\n * The chain ID.\n */\n networkId;\n /**\n * The signature.\n */\n signature;\n #startBlock;\n /**\n * Create a new TransactionResponse with %%tx%% parameters\n * connected to %%provider%%.\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null;\n this.blockHash = tx.blockHash != null ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.from = tx.from;\n this.to = tx.to || null;\n this.energyLimit = tx.energyLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.energyPrice = tx.energyPrice;\n this.networkId = tx.networkId;\n this.signature = tx.signature;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON representation of this transaction.\n */\n toJSON() {\n const { index, hash, type, to, from, nonce, data, signature } = this;\n return {\n _type: \"TransactionReceipt\",\n networkId: toJson(this.networkId),\n data,\n from,\n energyLimit: toJson(this.energyLimit),\n energyPrice: toJson(this.energyPrice),\n hash,\n nonce,\n signature,\n to,\n index,\n type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = _confirms == null ? 1 : _confirms;\n const timeout = _timeout == null ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = startBlock === -1 ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from),\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if (blockNumber - receipt.blockNumber + 1 < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data &&\n tx.to === this.to &&\n tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" &&\n tx.from === tx.to &&\n tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: reason === \"replaced\" || reason === \"cancelled\",\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt,\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (receipt) {\n if ((await receipt.confirmations()) >= confirms) {\n return receipt;\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => {\n cancellers.forEach((c) => c());\n };\n // On cancel, stop scanning for replacements\n cancellers.push(() => {\n stopScanning = true;\n });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => {\n clearTimeout(timer);\n });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n resolve(receipt);\n }\n };\n cancellers.push(() => {\n this.provider.off(this.hash, txListener);\n });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => {\n this.provider.off(\"block\", replaceListener);\n });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return this.blockHash != null;\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return this.type === 0;\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return {\n orphan: \"drop-log\",\n log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index,\n },\n };\n}\n//# sourceMappingURL=provider.js.map","import { Log, TransactionReceipt, TransactionResponse, } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\nexport class EventLog extends Log {\n interface;\n fragment;\n args;\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length\n ? this.#iface.getEvent(log.topics[0])\n : null;\n if (fragment) {\n return new EventLog(log, this.#iface, fragment);\n }\n else {\n return log;\n }\n });\n }\n}\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n async wait(confirms) {\n const receipt = await super.wait();\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\nexport class ContractUnknownEventPayload extends EventPayload {\n log;\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n async getBlock() {\n return await this.log.getBlock();\n }\n async getTransaction() {\n return await this.log.getTransaction();\n }\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map","import { Indexed, Interface, Typed } from \"../abi/index.js\";\nimport { resolveAddress } from \"../address/checks.js\";\nimport { copyRequest, Log, } from \"../providers/provider.js\";\nimport { defineProperties, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument, } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return value && typeof value.call === \"function\";\n}\nfunction canEstimate(value) {\n return value && typeof value.estimateEnergy === \"function\";\n}\nfunction canResolve(value) {\n return value && typeof value.resolveName === \"function\";\n}\nfunction canSend(value) {\n return value && typeof value.sendTransaction === \"function\";\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof value[feature] === \"function\") {\n return value;\n }\n if (value.provider && typeof value.provider[feature] === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(Typed.dereference(arg, \"overrides\"));\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from);\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n const iface = contract.interface;\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || (tx.value || BN_0) === BN_0, \"cannot send value to non-payable contract\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || (tx.data || \"0x\") === \"0x\", \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment in getFragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs),\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract,\n _key: key,\n getFragment,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment in defineProperty\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment in\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract,\n _key: key,\n getFragment,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_corebcInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value &&\n typeof value === \"object\" &&\n \"getTopicFilter\" in value &&\n typeof value.getTopicFilter === \"function\" &&\n value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof event === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics\n .map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n })\n .join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = addr ? addr : contract;\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment\n ? contract.interface.decodeEventLog(fragment, log.data, log.topics)\n : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n return count > 0;\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n target;\n interface;\n runner;\n filters;\n [internal];\n fallback;\n constructor(target, abi, runner, _deployTx) {\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof target === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, _prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = this.getEvent(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract event: ${prop}`);\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop)));\n },\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null,\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, _prop, receiver) => {\n if (_prop in target || passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = target.getFunction(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract method: ${prop}`);\n },\n has: (target, prop) => {\n if (prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(String(prop));\n },\n });\n }\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n async getAddress() {\n return await getInternal(this).addrPromise;\n }\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n async waitForDeployment() {\n // We have the deployement transaction; just use that (throws if deployement fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n getFunction(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n getEvent(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n async queryTransaction(hash) {\n // Is this useful?\n throw new Error(\"@TODO\");\n }\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = addr ? addr : await addrPromise;\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n return new EventLog(log, this.interface, foundFragment);\n }\n else {\n return new Log(log, provider);\n }\n });\n }\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners\n .map(({ listener }) => listener)\n .indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n 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 await this.off(event, listener);\n }\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map","import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\nimport { isBytes } from \"../utils/data.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\nexport class ContractFactory {\n interface;\n bytecode;\n runner;\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else if (typeof bytecode === \"string\") {\n bytecode = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecode = hexlify(bytecode);\n }\n else if (bytecode && typeof bytecode.object === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecode = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecode = \"!\";\n }\n defineProperties(this, {\n // @ts-ignore\n bytecode,\n interface: iface,\n runner: runner || null,\n });\n }\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([\n this.bytecode,\n this.interface.encodeDeploy(resolvedArgs),\n ]);\n return Object.assign({}, overrides, { data });\n }\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof this.runner.sendTransaction === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\",\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof output === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map","/**\n * @_ignore\n */\nimport { getAddress } from \"../address/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.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) {\n return (array) => {\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 number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n energyLimit: getBigInt,\n energyUsed: getBigInt,\n miner: allowNull(getAddress),\n extraData: formatData,\n baseFeePerEnergy: allowNull(getBigInt),\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 energyUsed: getBigInt,\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeEnergyUsed: getBigInt,\n effectiveEnergyPrice: allowNull(getBigInt),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0),\n}, {\n effectiveEnergyPrice: [\"energyPrice\"],\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 && !getAddress(value.to) && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n //confirmations: allowNull(getNumber, null),\n from: getAddress,\n maxFeePerEnergy: allowNull(getBigInt),\n energyLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n networkId: allowNull(getBigInt, null),\n }, {\n data: [\"input\"],\n energyLimit: [\"energy\"],\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 // Compute the signature\n if (value.signature) {\n result.signature = value.signature;\n }\n else {\n result.signature = value;\n }\n // Some backends omit networkId on legacy transactions, but we can compute it\n if (result.networkId == null) {\n const networkId = result.signature.legacynetworkId;\n if (networkId != null) {\n result.networkId = networkId;\n }\n }\n // @TODO: check networkId\n /*\n if (value.networkId != null) {\n let networkId = value.networkId;\n \n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n \n result.networkId = networkId;\n \n } else {\n let networkId = value.networkId;\n \n // geth-etc returns networkId\n if (networkId == null && result.v == null) {\n networkId = value.networkId;\n }\n \n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n \n if (typeof(networkId) !== \"number\" && result.v != null) {\n networkId = (result.v - 35) / 2;\n if (networkId < 0) { networkId = 0; }\n networkId = parseInt(networkId);\n }\n \n if (typeof(networkId) !== \"number\") { networkId = 0; }\n \n result.networkId = networkId;\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 { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nexport class NetworkPlugin {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\nexport class EnergyCostPlugin extends NetworkPlugin {\n effectiveBlock;\n txBase;\n txCreate;\n txDataZero;\n txDataNonzero;\n txAccessListStorageKey;\n txAccessListAddress;\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.corebc.network.plugins.EnergyCost#${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 clone() {\n return new EnergyCostPlugin(this.effectiveBlock, this);\n }\n}\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n constructor(feeDataFunc) {\n super(\"org.corebc.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\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 * About networks\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { getBigInt, assertArgument } from \"../utils/index.js\";\nimport { EnergyCostPlugin } from \"./plugins-network.js\";\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*/\n// Networks or clients with a higher need for security (such as clients\n// that may automatically make CCIP requests without user interaction)\n// can use this plugin to anonymize requests or intercept CCIP requests\n// to notify and/or receive authorization from the user\nconst Networks = new Map();\nexport class Network {\n #name;\n #networkId;\n #plugins;\n constructor(name, networkId) {\n this.#name = name;\n this.#networkId = getBigInt(networkId);\n this.#plugins = new Map();\n }\n toJSON() {\n return { name: this.name, networkId: String(this.networkId) };\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() {\n return this.#name;\n }\n set name(value) {\n this.#name = value;\n }\n /**\n * The network chain ID.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value, \"networkId\");\n }\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.networkId === 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.networkId === getBigInt(other);\n }\n catch (error) { }\n return false;\n }\n if (typeof other === \"object\") {\n if (other.networkId != null) {\n try {\n return this.networkId === getBigInt(other.networkId);\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.networkId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic energy required for a transaction.\n *\n * A EnergyCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicEnergy(tx) {\n const costs = this.getPlugin(\"org.corebc.plugins.network.EnergyCost\") || new EnergyCostPlugin();\n let energy = costs.txBase;\n if (tx.to == null) {\n energy += 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 energy += costs.txDataZero;\n }\n else {\n energy += costs.txDataNonzero;\n }\n }\n }\n return energy;\n }\n /**\n * Returns a new Network for the %%network%% name or networkId.\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.networkId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof network === \"object\") {\n assertArgument(typeof network.name === \"string\" &&\n typeof network.networkId === \"number\", \"invalid network object name or networkId\", \"network\", network);\n const custom = new Network(network.name, network.networkId);\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrnetworkId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrnetworkId, networkFunc) {\n if (typeof nameOrnetworkId === \"number\") {\n nameOrnetworkId = BigInt(nameOrnetworkId);\n }\n const existing = Networks.get(nameOrnetworkId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrnetworkId\", nameOrnetworkId);\n }\n Networks.set(nameOrnetworkId, networkFunc);\n }\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Core networks\n function registerEth(name, networkId, options) {\n const func = function () {\n const network = new Network(name, networkId);\n network.attachPlugin(new EnergyCostPlugin());\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(networkId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\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 registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map","import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * @TODO\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\",\n info: { event },\n });\n}\n// @TODO: refactor this\n/**\n * @TODO\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 constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n get pollingInterval() {\n return this.#interval;\n }\n set pollingInterval(value) {\n this.#interval = value;\n }\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\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) {\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n/**\n * @TODO\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\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 * @TODO\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 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 this.#blockNumber = blockNumber;\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\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 * About Subclassing the Provider...\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/checks.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 { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse, } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse, } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber, } from \"./subscriber-polling.js\";\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return value && typeof value.then === \"function\";\n}\nfunction getTag(prefix, value) {\n return (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 // 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}\nexport class UnmanagedSubscriber {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\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 \"pending\":\n case \"debug\":\n case \"error\":\n case \"network\": {\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 {\n type: \"orphan\",\n tag: getTag(\"orphan\", event),\n filter: copy(event),\n };\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));\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() {\n return new Date().getTime();\n}\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\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 // @TODO: This should be a () => Promise so network can be\n // done when needed; or rely entirely on _detectNetwork?\n constructor(_network) {\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(() => {\n this.emit(\"network\", network, null);\n }, 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.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get provider() {\n return this;\n }\n get plugins() {\n return Array.from(this.#plugins.values());\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 getPlugin(name) {\n return this.#plugins.get(name) || null;\n }\n get disableCcipRead() {\n return this.#disableCcipRead;\n }\n set disableCcipRead(value) {\n this.#disableCcipRead = !!value;\n }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\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 }, 250);\n }\n return await perform;\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\", {\n action: \"sendCcipReadFetchRequest\",\n request,\n index: i,\n urls,\n });\n let errorMessage = \"unknown error\";\n const resp = await request.send();\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchResult\",\n request,\n result,\n });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchError\",\n request,\n result,\n });\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\", {\n reason: \"404_MISSING_RESOURCE\",\n transaction: tx,\n info: { url, errorMessage },\n });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages\n .map((m) => JSON.stringify(m))\n .join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx,\n info: { urls, errorMessages },\n });\n }\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\",\n });\n }\n // Sub-classes should override this and handle PerformActionRequest requests, calling\n // the super for any unhandled actions.\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 _getAddress(address) {\n return resolveAddress(address);\n }\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"latest\":\n case \"pending\":\n case \"safe\":\n case \"finalized\":\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 _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:\n 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 _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]);\n if (isPromise(addr)) {\n promises.push((async function () {\n request[key] = await addr;\n })());\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 () {\n request.blockTag = await blockTag;\n })());\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 = this._detectNetwork().then((network) => {\n this.emit(\"network\", network, null);\n return network;\n }, (error) => {\n // Reset the networkPromise on failure, so we will try again\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\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.networkId !== actual.networkId) {\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.networkId} => ${actual.networkId} `, \"NETWORK_ERROR\", {\n event: \"changed\",\n });\n }\n }\n return expected.clone();\n }\n async getEnergyPrice() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async getFeeData() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async estimateEnergy(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateEnergy\",\n 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 return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead &&\n isCallException(error) &&\n error.data &&\n attempt >= 0 &&\n blockTag === \"latest\" &&\n transaction.to != null &&\n dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to);\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\",\n transaction,\n 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\",\n transaction,\n info: { data: error.data, errorArgs: ccipArgs.errorArgs },\n });\n const tx = {\n to: txSender,\n data: concat([\n ccipArgs.selector,\n encodeBytes([ccipResult, ccipArgs.extraData]),\n ]),\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\", {\n action: \"receiveCcipReadCallResult\",\n transaction: Object.assign({}, tx),\n result,\n });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadCallError\",\n transaction: Object.assign({}, tx),\n error,\n });\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\",\n blockHash: block,\n 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\",\n blockTag,\n 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 effectiveEnergyPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.energyPrice == null && params.effectiveEnergyPrice == 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 effectiveEnergyPrice\");\n }\n params.effectiveEnergyPrice = tx.energyPrice;\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(networkId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\",\n });\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 _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 _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 _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n // Event API; sub-classes should override this; any supported\n // event filter will have been munged into an EventFilter\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 return new PollingBlockSubscriber(this);\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 _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\" &&\n emitArgs &&\n emitArgs.length > 0 &&\n 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 = {\n subscriber,\n tag,\n addressableMap,\n nameMap,\n started: false,\n listeners: [],\n };\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 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\n .map(({ listener }) => listener)\n .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 // Sub-classes should override this to shutdown any sockets, etc.\n // but MUST call this super.shutdown.\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 }\n get paused() {\n return this.#pausedState != null;\n }\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 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 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: \"\",\n urls: [],\n calldata: \"\",\n selector: \"\",\n extraData: \"\",\n 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\"\n .split(/,/)\n .map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map","/**\n * About Abstract Signer and subclassing\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/checks.js\";\nimport { getAddress } 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);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).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}\nexport class AbstractSigner {\n provider;\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.energyLimit == null) {\n pop.energyLimit = await this.estimateEnergy(pop);\n }\n // Populate the chain ID\n const network = await this.provider.getNetwork();\n if (pop.networkId != null) {\n const networkId = getBigInt(pop.networkId);\n assertArgument(networkId === network.networkId, \"transaction networkId mismatch\", \"tx.networkId\", tx.networkId);\n }\n else {\n pop.networkId = network.networkId;\n }\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n // We need to auto-detect the intended type of this transaction...\n if (feeData.energyPrice != null) {\n // Network doesn't support EIP-1559...\n // Populate missing fee data\n if (pop.energyPrice == null) {\n pop.energyPrice = feeData.energyPrice;\n }\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 //@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 estimateEnergy(tx) {\n return checkProvider(this, \"estimateEnergy\").estimateEnergy(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 return getAddress(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}\nexport class VoidSigner extends AbstractSigner {\n address;\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\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","/**\n * There are many awesome community services that provide Core\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in tht console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n}\n//# sourceMappingURL=community.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 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 _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\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\") ||\n error.operation !== \"xcb_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.networkId !== network.networkId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"xcb_getFilterChanges\", [\n filterId,\n ]);\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 this.#provider.send(\"xcb_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() {\n this.start();\n }\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 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(\"xcb_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(\"xcb_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 * About JSON-RPC...\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, 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\";\nimport { resolveAddress } from \"../address/checks.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) => {\n setTimeout(resolve, duration);\n });\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, // 100 requests\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);\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 xcb_sendTransaction uses 90000 energy; 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.energyLimit == null) {\n promises.push((async () => {\n tx.energyLimit = await this.provider.estimateEnergy({\n ...tx,\n from: this.address,\n });\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);\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(\"xcb_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 const checkTx = async () => {\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 // Wait another 4 seconds\n this.provider._setTimeout(() => {\n checkTx();\n }, 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);\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(\"xcb_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),\n 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(\"xcb_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(),\n password,\n null,\n ]);\n }\n async _legacySignMessage(_message) {\n const message = typeof _message === \"string\" ? toUtf8Bytes(_message) : _message;\n return await this.provider.send(\"xcb_sign\", [\n this.address.toLowerCase(),\n 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 #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no hard in sending it immeidately\n const stallTime = this._getOption(\"batchMaxCount\") === 1\n ? 0\n : 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 // console.log({payload})\n const result = await this._send(payload);\n // console.log({result})\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\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 return reject(makeError(\"no response from server\", \"BAD_DATA\", {\n value: result,\n info: { payload },\n }));\n }\n // The response is an error\n if (\"error\" in resp) {\n return reject(this.getRpcError(payload, resp));\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);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n // Make sure any static network is compatbile with the provided netwrok\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (staticNetwork) {\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 {\n assert(false, \"sub-classes must override _send\", \"UNSUPPORTED_OPERATION\", {\n operation: \"jsonRpcApiProvider._send\"\n });\n }\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 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 return network;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n return Network.from(getBigInt(await this.send(\"xcb_networkId\", [])));\n }\n // We are not ready yet; use the primitive _send\n const payload = {\n id: this.#nextId++,\n method: \"xcb_networkId\",\n params: [],\n jsonrpc: \"2.0\",\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n }\n catch (error) {\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 /**\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) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n console.log(\"JsonRpcProvider failed to startup; retry in 1s\");\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() {\n return this.#notReady == null;\n }\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 [\n \"networkId\",\n \"energyLimit\",\n \"energyPrice\",\n \"type\",\n \"nonce\",\n \"value\",\n ].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"energyLimit\") {\n dstKey = \"energy\";\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 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 \"networkId\":\n return { method: \"xcb_networkId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"xcb_blockNumber\", args: [] };\n case \"getEnergyPrice\":\n return { method: \"xcb_energyPrice\", args: [] };\n case \"getBalance\": {\n return {\n method: \"xcb_getBalance\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n }\n case \"getTransactionCount\":\n return {\n method: \"xcb_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getCode\":\n return {\n method: \"xcb_getCode\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getStorage\":\n return {\n method: \"xcb_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: \"xcb_sendRawTransaction\",\n args: [req.signedTransaction],\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"xcb_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions],\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"xcb_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions],\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"xcb_getTransactionByHash\",\n args: [req.hash],\n };\n case \"getTransactionReceipt\":\n return {\n method: \"xcb_getTransactionReceipt\",\n args: [req.hash],\n };\n case \"call\":\n return {\n method: \"xcb_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag],\n };\n case \"estimateEnergy\": {\n return {\n method: \"xcb_estimateEnergy\",\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: \"xcb_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an CoreBC-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 === \"xcb_estimateEnergy\" && 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 }\n if (method === \"xcb_call\" || method === \"xcb_estimateEnergy\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException(method === \"xcb_call\" ? \"call\" : \"estimateEnergy\", payload.params[0], result ? result.data : null);\n e.info = { error, payload };\n return e;\n }\n // Only estimateEnergy 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\" &&\n error.message.match(/user denied|corebc-user-denied/i)) {\n const actionMap = {\n xcb_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n xcb_signTypedData_v4: \"signTypedData\",\n xcb_signTransaction: \"signTransaction\",\n xcb_sendTransaction: \"sendTransaction\",\n xcb_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 === \"xcb_sendRawTransaction\" ||\n method === \"xcb_sendTransaction\") {\n const transaction = payload.params[0];\n if (message.match(/insufficient funds|base fee exceeds energy limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction,\n 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\", {\n transaction,\n info: { error },\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) &&\n message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction,\n info: { error },\n });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method,\n info: { transaction, info: { error } },\n });\n }\n }\n if (message.match(/the method .* does not exist/i)) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method,\n info: { error },\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error });\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 networkId?? purge on switch_networks\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve,\n 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(\"xcb_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(\"xcb_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n}\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n this.#pollingInterval = 4000;\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() {\n return this.#pollingInterval;\n }\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. xcb_networkId) 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\" &&\n value.message.match(\"reverted\") &&\n 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 * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/xcb_goerli\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AnkrProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"xcb_sendRawTransaction\") {\n if (error &&\n error.error &&\n error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n}\n//# sourceMappingURL=provider-ankr.js.map","/**\n * About Alchemy\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.alchemyapi.io\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AlchemyProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash),\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = trace[0].error === \"Reverted\";\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null, // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", {\n value: trace,\n });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map","/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https://cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map","function getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map","/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\nexport class SocketSubscriber {\n #provider;\n #filter;\n get filter() {\n return JSON.parse(this.#filter);\n }\n #filterId;\n #paused;\n #emitPromise;\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider\n .send(\"xcb_subscribe\", this.filter)\n .then((filterId) => {\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n this.#filterId.then((filterId) => {\n this.#provider.send(\"xcb_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\nexport class SocketBlockSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\nexport class SocketPendingSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n get logFilter() {\n return JSON.parse(this.#logFilter);\n }\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * SocketProvider...\n *\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n constructor(network) {\n super(network, { batchMaxCount: 1 });\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n \n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n \n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n // Sub-classes must call this for each message\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (\"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result,\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result.method === \"xcb_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n }\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map","import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network) {\n super(network);\n if (typeof url === \"string\") {\n this.#connect = () => {\n return new _WebSocket(url);\n };\n this.#websocket = this.#connect();\n }\n else if (typeof url === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n */\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map","/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret,\n });\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(networkId) {\n try {\n return new InfuraProvider(networkId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map","/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"corebc.quiknode.pro\";\n case \"arbitrum\":\n return \"corebc.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"corebc.arbitrum-goerli.quiknode.pro\";\n case \"matic\":\n return \"corebc.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"corebc.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"corebc.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"corebc.optimism-goerli.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(networkId) {\n try {\n return new QuickNodeProvider(networkId, this.token);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.token === defaultToken;\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map","/**\n * Explain all the nitty-gritty about the **FallbackProvider**.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { getBigInt, getNumber, assert, assertArgument, } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\nfunction getTime() {\n return new Date().getTime();\n}\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof value === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2,\n requests: 0,\n lateResponses: 0,\n errorResponses: 0,\n outOfSync: -1,\n unsupportedEvents: 0,\n rollingDuration: 0,\n score: 0,\n _network: null,\n _updateNumber: null,\n _totalTime: 0,\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + value.map(_normalize).join(\",\") + \"]\";\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{\" +\n keys\n .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`)\n .join(\",\") +\n \"}\");\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(value) {\n if (\"error\" in value) {\n const error = value.error;\n return { tag: _normalize(error), value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum &&\n (weight > bestWeight ||\n (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A Fallback Provider.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n quorum;\n eventQuorum;\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n constructor(providers, network) {\n super(network);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n this.quorum = 2; //Math.ceil(providers.length / 2);\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), \"quorum exceed provider wieght\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"networkId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"networkId\":\n return (await provider.getNetwork()).networkId;\n case \"estimateEnergy\":\n return await provider.estimateEnergy(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = \"blockHash\" in req ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getEnergyPrice\":\n return (await provider.getFeeData()).energyPrice;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => b.priority - a.priority);\n for (const config of allConfigs) {\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config,\n result: null,\n didBump: false,\n perform: null,\n staller: null,\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = getTime() - now;\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push(waitForSync(config, 0));\n promises.push((async () => {\n config._network = await config.provider.getNetwork();\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let networkId = null;\n for (const config of this.#configs) {\n const network = config._network;\n if (networkId == null) {\n networkId = network.networkId;\n }\n else if (network.networkId !== networkId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\",\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight,\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getEnergyPrice\":\n case \"estimateEnergy\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"networkId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`,\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: {\n request: req,\n results: Array.from(running).map((r) => stringify(r.result)),\n },\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => {\n try {\n const result = await provider._perform(req);\n return Object.assign(normalizeResult({ result }), { weight });\n }\n catch (error) {\n return Object.assign(normalizeResult({ error }), { weight });\n }\n }));\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) },\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n for (let i = 0; i < this.quorum; i++) {\n this.#addRunner(running, req);\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map","import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value &&\n typeof value.send === \"function\" &&\n typeof value.close === \"function\");\n}\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n if (typeof network === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if ((typeof network === \"string\" && network.match(/^wss?:/)) ||\n isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n const providers = [];\n if (options.alchemy !== \"-\") {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.ankr !== \"-\" && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.cloudflare !== \"-\") {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.infura !== \"-\") {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof projectId === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) {\n console.log(error);\n }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n */\n if (options.quicknode !== \"-\") {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) {\n console.log(error);\n }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\",\n });\n if (providers.length === 1) {\n return providers[0];\n }\n return new FallbackProvider(providers);\n}\n//# sourceMappingURL=default-provider.js.map","import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nexport class NonceManager extends AbstractSigner {\n signer;\n #noncePromise;\n #delta;\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n increment() {\n this.#delta++;\n }\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n constructor(core, network) {\n super(network, { batchMaxCount: 1 });\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await core.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [\n {\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message },\n },\n ];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `corebc-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `corebc-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"xcb_accounts\", []);\n if (typeof address === \"number\") {\n return accounts.length > address;\n }\n address = address.toLowerCase();\n return (accounts.filter((a) => a.toLowerCase() === address).length !== 0);\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n //const resp =\n await this.#request(\"xcb_requestAccounts\", []);\n //console.log(\"RESP\", resp);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n}\n//# sourceMappingURL=provider-browser.js.map","/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, {\n applicationId,\n applicationSecret,\n });\n }\n _getProvider(networkId) {\n try {\n return new PocketProvider(networkId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return this.applicationId === defaultApplicationId;\n }\n}\n//# sourceMappingURL=provider-pocket.js.map","const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map","import { getAddress } from \"../address/index.js\";\nimport { hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, resolveProperties, assert, assertArgument, } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n prefix;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor({ signingKey, prefix, provider, }) {\n super(provider);\n this.prefix = prefix;\n assertArgument(signingKey && typeof signingKey.sign === \"function\", \"invalid signingKey key\", \"signingKey\", \"[ REDACTED ]\");\n this.#signingKey = signingKey;\n const address = computeAddress(this.#signingKey, prefix);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() {\n return this.#signingKey;\n }\n /**\n * The private key for this wallet.\n */\n get privateKey() {\n return this.signingKey.privateKey;\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new BaseWallet({\n signingKey: this.#signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n async signTransaction(tx) {\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: tx.to || undefined,\n from: tx.from || undefined,\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress(tx.from) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n const unSignedSerialized = btx.unsignedSerialized;\n const unsignedHash = sha256(unSignedSerialized);\n // sha256(btx.unsignedSerialized)\n btx.signature = this.signingKey.sign(unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name },\n });\n const address = getAddress(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name,\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value));\n }\n}\n//# sourceMappingURL=base-wallet.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?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Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"en\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map","import { pbkdf2Sync } from \"../crypto/crypto.js\";\nimport utf8 from \"utf8\";\nexport function mnemonicToSeed(mnemonic, password) {\n if (!password) {\n password = \"\";\n }\n const t = generateSeed(mnemonic, password);\n return t.goldilock;\n}\nconst generateSeed = (mnemonic, password) => {\n const goldilockSaltPrefix = \"mnemonic\";\n const aesSaltPrefix = \"mnemonicfortheAESkey\";\n const goldilockSalt = utf8.encode(goldilockSaltPrefix + password);\n const aesSalt = utf8.encode(aesSaltPrefix + password);\n const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), goldilockSalt, 2048, 64, \"sha512\");\n const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), aesSalt, 2048, 64, \"sha512\");\n return {\n aes: aesKeySeed.toString(\"hex\"),\n goldilock: goldilockKey.toString(\"hex\"),\n };\n};\n//# sourceMappingURL=mnemonicToSeed.js.map","import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { legacySha256 } from \"../crypto/sha3.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return (((1 << bits) - 1) << (8 - bits)) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset++;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) &\n getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n return mnemonicToSeed(this.phrase, this.password);\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase({ phrase, password, wordlist, }) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingURL=mnemonic.js.map","/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof hexString === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = \"0\" + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof password === \"string\") {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = match[4] === \"!\";\n let cur = object;\n for (const comp of path.toLowerCase().split(\".\")) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof cur === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof cur === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof cur) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map","/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Core along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { CTR } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from \"../crypto/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nimport { computeAddress, extractPrefix } from \"../transaction/address.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = data.version != null ? parseInt(data.version) : 0;\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, iv);\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\",\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n assertArgument(computedMAC === spelunk(data, \"crypto.mac:string!\").toLowerCase(), \"incorrect password\", \"password\", \"[ REDACTED ]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = getAddress(data.address);\n const prefix = extractPrefix(address);\n if (computeAddress(privateKey, prefix) !== address) {\n throw new Error(\"address mismatch\");\n }\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-corebc.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-corebc.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-corebc.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n account.mnemonic = {\n path: spelunk(data, \"x-corebc.path:string\") || defaultPath,\n locale: spelunk(data, \"x-corebc.locale:string\") || \"en\",\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))),\n };\n }\n return account;\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof kdf === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n // Make sure N is a power of 2\n assertArgument(N > 0 && (N & (N - 1)) === 0, \"invalid kdf.N\", \"kdf.N\", N);\n assertArgument(r > 0 && p > 0, \"invalid kdf\", \"kdf\", kdf);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(algorithm === \"sha256\" || algorithm === \"sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return { name: \"pbkdf2\", salt, count, dkLen, algorithm };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = options.salt != null\n ? getBytes(options.salt, \"options.salt\")\n : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = 1 << 17, r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p) {\n p = options.scrypt.p;\n }\n }\n assertArgument(typeof N === \"number\" &&\n N > 0 &&\n Number.isSafeInteger(N) &&\n (BigInt(N) & BigInt(N - 1)) === BigInt(0), \"invalid scrypt N parameter\", \"options.N\", N);\n assertArgument(typeof r === \"number\" && r > 0 && Number.isSafeInteger(r), \"invalid scrypt r parameter\", \"options.r\", r);\n assertArgument(typeof p === \"number\" && p > 0 && Number.isSafeInteger(p), \"invalid scrypt p parameter\", \"options.p\", p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = options.iv != null ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = options.uuid != null\n ? getBytes(options.uuid, \"options.uuid\")\n : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, iv);\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = sha256(concat([macPrefix, ciphertext]));\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r,\n },\n mac: mac.substring(2),\n },\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = options.client != null ? options.client : `corebc/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv);\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = now.getUTCFullYear() +\n \"-\" +\n zpad(now.getUTCMonth() + 1, 2) +\n \"-\" +\n zpad(now.getUTCDate(), 2) +\n \"T\" +\n zpad(now.getUTCHours(), 2) +\n \"-\" +\n zpad(now.getUTCMinutes(), 2) +\n \"-\" +\n zpad(now.getUTCSeconds(), 2) +\n \".0Z\";\n const gethFilename = \"UTC--\" + timestamp + \"--\" + data.address;\n data[\"x-corebc\"] = {\n client,\n gethFilename,\n path,\n locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\",\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map","/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { dataSlice, defineProperties, getNumber, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\nimport { Ed448Goldilock } from \"../crypto/crypto.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// import { arrayify,\n// // hexDataSlice\n// } from \"../utils/data.js\";\n// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array {\n// const p = getBytes(password);\n// const s = getBytes(salt);\n// return getBytes(pbkdf2(p, s, 2048, 57, \"sha512\"));\n// }\n/**\n * The default derivation path for Core HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m\";\n// \"Bitcoin seed\"\n// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\n// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array {\n// b = getBytes(concat([b.slice(0, 53), \"0x00000000\"]));\n// b[0] &= 0xfc;\n// const c = new Uint8Array(57);\n// let hold = 0;\n// for (let i = 0; i < 57; i++) {\n// hold += a[i] + b[i];\n// c[i] = hold % 256;\n// hold = Math.floor(hold / 256);\n// }\n// return c;\n// };\nconst _guard = {};\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0 && (components[0] === \"m\" || node.depth > 0), \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n prefix;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n #seed;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) {\n super({\n signingKey,\n prefix,\n provider,\n });\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.publicKey });\n this.prefix = prefix;\n this.#seed = seed;\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint,\n fingerprint,\n path,\n index,\n depth,\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet({\n guard: _guard,\n signingKey: this.signingKey,\n parentFingerprint: this.parentFingerprint,\n path: this.path,\n index: this.index,\n depth: this.depth,\n seed: this.#seed,\n mnemonic: this.mnemonic,\n provider,\n prefix: this.prefix,\n });\n }\n #account() {\n const account = {\n address: this.address,\n privateKey: this.privateKey,\n };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy,\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, {\n progressCallback,\n });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() {\n return this.path != null;\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index));\n const newSigningKey = new SigningKey(newPrivateKey);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (_index & ~HardenedBit);\n if (_index & HardenedBit) {\n path += \"'\";\n }\n }\n return new HDNodeWallet({\n guard: _guard,\n signingKey: newSigningKey,\n parentFingerprint: this.fingerprint,\n path,\n index: _index,\n seed: this.#seed,\n depth: this.depth + 1,\n mnemonic: this.mnemonic,\n provider: this.provider,\n prefix: this.prefix,\n });\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed({ _seed, mnemonic, prefix, path, }) {\n const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0);\n const signingKey = new SigningKey(extendetPrivateKey);\n // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length })\n return new HDNodeWallet({\n seed: _seed,\n guard: _guard,\n signingKey,\n parentFingerprint: \"0x00000000\",\n path: path || defaultPath,\n index: 0,\n depth: 0,\n mnemonic,\n provider: null,\n prefix,\n });\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(prefix, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist);\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Create am HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, prefix, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n static mnemonicToSeed(mnemonic, password) {\n const seed = mnemonicToSeed(mnemonic, password);\n return seed;\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, password, path, wordlist, }) {\n if (!password) {\n password = \"\";\n }\n if (!path) {\n path = defaultPath;\n }\n if (!wordlist) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist });\n const _seed = mnemonic.computeSeed();\n return HDNodeWallet.#fromSeed({\n _seed,\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed({ seed, prefix, path, }) {\n return HDNodeWallet.#fromSeed({\n _seed: seed,\n mnemonic: null,\n path: path || defaultPath,\n prefix,\n });\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the acount at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map","/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { CBC, pkcs7Strip } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n/**\n * Before Core launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive xcb\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Core Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && encseed.length % 16 === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map","import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { defaultPath, HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson, } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { extractPrefix } from \"../transaction/address.js\";\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected\n * to %%provider%%.\n */\n constructor({ key, prefix, provider, }) {\n if (typeof key === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = typeof key === \"string\" ? new SigningKey(key) : key;\n super({\n signingKey,\n prefix,\n provider,\n });\n }\n connect(provider) {\n return new Wallet({\n key: this.signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n const address = account.address;\n const prefix = extractPrefix(address);\n if (\"mnemonic\" in account &&\n account.mnemonic &&\n account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path);\n if (wallet.address === account.address &&\n wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet({\n key: account.privateKey,\n prefix,\n });\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the avavilable\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(prefix, provider) {\n const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, provider, password, }) {\n const wallet = HDNodeWallet.fromPhrase({\n phrase,\n prefix,\n password,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n static fromSeed({ seed, prefix, provider, path, }) {\n const wallet = HDNodeWallet.fromSeed({\n seed,\n prefix,\n path: path || defaultPath,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map"],"names":["logger","stringify","arrayifyInteger","unarrayifyInteger","_encode","_decodeChildren","_decode","decode","hash","assertHash","assertExists","assertBytes","assertNumber","pbkdf2","sha256","u64","sha512","BN_0","BN_1","locked","getTime","_a","_guard","getGlobal","randomBytes","Buffer","removeHexPrefix","rotl","ripemd160","noble_ripemd160","crypto_random","scrypt","_nobleAsync","_nobleSync","H","N","secp256k1.getSharedSecret","secp256k1.ProjectivePoint","BN_2","passProperties","getValue","BN_MAX_UINT256","RLP.decode","RLP.encode","_sha256","internal","PanicReasons","copy","stall","defaultApiKey","getHost","defaultPath"],"mappings":";;;;;;;IAAA;IACA;IACA;IACA;AACY,UAAC,OAAO,GAAG;;ICHvB,IAAI,sBAAsB,GAAG,KAAK,CAAC;IACnC,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,MAAM,SAAS,GAAG;IAClB,IAAI,KAAK,EAAE,CAAC;IACZ,IAAI,OAAO,EAAE,CAAC;IACd,IAAI,IAAI,EAAE,CAAC;IACX,IAAI,OAAO,EAAE,CAAC;IACd,IAAI,KAAK,EAAE,CAAC;IACZ,IAAI,GAAG,EAAE,CAAC;IACV,CAAC,CAAC;IACF,IAAI,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,IAAI,aAAa,GAAG,IAAI,CAAC;IACzB,SAAS,eAAe,GAAG;IAC3B,IAAI,IAAI;IACR,QAAQ,MAAM,OAAO,GAAG,EAAE,CAAC;IAC3B;IACA,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK;IACzD,YAAY,IAAI;IAChB,gBAAgB,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE;IACvD,oBAAoB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;IACrD,iBAAiB;IACjB,aAAa;IACb,YAAY,OAAO,KAAK,EAAE;IAC1B,gBAAgB,OAAO,CAAC,IAAI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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[7,8,9,10,11,12,13,14,15,33,37,40]} \ No newline at end of file +{"version":3,"file":"corebc.umd.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../lib.esm/_version.js","../node_modules/bn.js/lib/bn.js","../lib.esm/logger/logger.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/bigNumber/bigNumber.js","../lib.esm/crypto/rlp.js","../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/_md.js","../node_modules/@noble/hashes/legacy.js","../node_modules/@noble/hashes/hmac.js","../node_modules/@noble/hashes/pbkdf2.js","../node_modules/@noble/hashes/sha2.js","../node_modules/@noble/hashes/sha3.js","../node_modules/bcrypto/lib/internal/assert.js","../node_modules/bcrypto/lib/internal/custom-browser.js","../node_modules/bcrypto/lib/js/bn.js","../node_modules/bcrypto/lib/bn-browser.js","../node_modules/bcrypto/lib/js/chacha20.js","../node_modules/bcrypto/lib/chacha20-browser.js","../node_modules/bcrypto/lib/internal/hmac.js","../node_modules/bcrypto/lib/js/sha256.js","../node_modules/bcrypto/lib/sha256-browser.js","../node_modules/bcrypto/lib/js/batch-rng.js","../node_modules/bcrypto/lib/js/elliptic.js","../node_modules/bcrypto/lib/js/random.js","../node_modules/bcrypto/lib/random-browser.js","../node_modules/bcrypto/lib/js/eddsa.js","../node_modules/bcrypto/lib/js/keccak.js","../node_modules/bcrypto/lib/keccak-browser.js","../node_modules/bcrypto/lib/shake.js","../node_modules/bcrypto/lib/shake256.js","../node_modules/bcrypto/lib/js/ed448.js","../node_modules/bcrypto/lib/ed448-browser.js","../lib.esm/crypto/browser-ed448.js","../lib.esm/utils/maths.js","../lib.esm/utils/base58.js","../lib.esm/utils/base64-browser.js","../lib.esm/utils/events.js","../lib.esm/utils/utf8.js","../lib.esm/utils/geturl-browser.js","../lib.esm/utils/fetch.js","../lib.esm/utils/fixednumber.js","../lib.esm/utils/rlp-decode.js","../lib.esm/utils/rlp-encode.js","../lib.esm/utils/units.js","../lib.esm/utils/uuid.js","../node_modules/bcrypto/lib/js/pbkdf2.js","../node_modules/bcrypto/lib/pbkdf2-browser.js","../node_modules/bcrypto/lib/js/sha3.js","../node_modules/bcrypto/lib/sha3-browser.js","../node_modules/bcrypto/lib/sha3-512.js","../lib.esm/crypto/ed448goldilock-browser.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/sha3.js","../lib.esm/address/index.js","../lib.esm/crypto/hmac.js","../lib.esm/crypto/ripemd160.js","../lib.esm/crypto/pbkdf2.js","../lib.esm/crypto/random.js","../node_modules/@noble/hashes/scrypt.js","../lib.esm/crypto/scrypt.js","../lib.esm/crypto/keccak.js","../lib.esm/crypto/signing-key.js","../lib.esm/crypto/signature.js","../lib.esm/crypto/index.js","../lib.esm/transaction/address.js","../lib.esm/abi/coders/abstract-coder.js","../lib.esm/abi/typed.js","../lib.esm/abi/coders/address.js","../lib.esm/abi/coders/anonymous.js","../lib.esm/abi/coders/array.js","../lib.esm/abi/coders/boolean.js","../lib.esm/abi/coders/bytes.js","../lib.esm/abi/coders/fixed-bytes.js","../lib.esm/abi/coders/null.js","../lib.esm/abi/coders/number.js","../lib.esm/abi/coders/string.js","../lib.esm/abi/coders/tuple.js","../lib.esm/hash/id.js","../lib.esm/constants/addresses.js","../lib.esm/constants/hashes.js","../lib.esm/constants/numbers.js","../lib.esm/constants/strings.js","../lib.esm/transaction/accesslist.js","../lib.esm/transaction/transaction.js","../lib.esm/hash/message.js","../lib.esm/hash/solidity.js","../lib.esm/hash/typed-data.js","../lib.esm/abi/fragments.js","../lib.esm/abi/abi-coder.js","../lib.esm/abi/bytes32.js","../lib.esm/abi/interface.js","../lib.esm/address/contract-address.js","../lib.esm/address/checks.js","../lib.esm/providers/provider.js","../lib.esm/contract/wrappers.js","../lib.esm/contract/contract.js","../lib.esm/contract/factory.js","../lib.esm/providers/format.js","../lib.esm/providers/plugins-network.js","../lib.esm/providers/network.js","../lib.esm/providers/subscriber-polling.js","../lib.esm/providers/abstract-provider.js","../lib.esm/providers/abstract-signer.js","../lib.esm/providers/community.js","../lib.esm/providers/subscriber-filterid.js","../lib.esm/providers/provider-jsonrpc.js","../lib.esm/providers/provider-ankr.js","../lib.esm/providers/provider-alchemy.js","../lib.esm/providers/provider-cloudflare.js","../lib.esm/providers/ws-browser.js","../lib.esm/providers/provider-socket.js","../lib.esm/providers/provider-websocket.js","../lib.esm/providers/provider-infura.js","../lib.esm/providers/provider-quicknode.js","../lib.esm/providers/provider-fallback.js","../lib.esm/providers/default-provider.js","../lib.esm/providers/signer-noncemanager.js","../lib.esm/providers/provider-browser.js","../lib.esm/providers/provider-pocket.js","../lib.esm/providers/provider-ipcsocket-browser.js","../lib.esm/wallet/base-wallet.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-en.js","../node_modules/utf8/utf8.js","../lib.esm/wallet/mnemonicToSeed.js","../lib.esm/wallet/mnemonic.js","../node_modules/aes-js/index.js","../lib.esm/wallet/utils.js","../lib.esm/wallet/json-keystore.js","../lib.esm/wallet/hdwallet.js","../lib.esm/wallet/json-crowdsale.js","../lib.esm/wallet/wallet.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/wordlists-browser.js","../lib.esm/cip/custom-units.js","../lib.esm/cip/index.js","../lib.esm/ipfs/index.js"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","/** The current version of corebc; keep in sync with package.json. */\nexport const version = \"0.4.1\";\n//# sourceMappingURL=_version.js.map","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n i++;\n }\n\n // Clear words above the requested width so the result stays below 2 ** width\n for (; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n if (num === 0) {\n this.length = 1;\n this._normSign();\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.mod.abs();\n\n var half = num.abs().iushrn(1);\n var r2 = num.words[0] & 1;\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up, away from zero\n var up = new BN(1);\n up.negative = this.negative ^ num.negative;\n return dm.div.iadd(up);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map","import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map","/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return new Uint8Array(result);\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return new Uint8Array(result);\n }\n if (isBytes(value)) {\n return new Uint8Array(value);\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { isBytes, hexlify, isHexString, } from \"../utils/data.js\";\nvar BN = _BN.BN;\nconst logger = new Logger(\"bigNumber/0.0.1\");\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null &&\n (BigNumber.isBigNumber(value) ||\n (typeof value === \"number\" && value % 1 === 0) ||\n (typeof value === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n typeof value === \"bigint\" ||\n isBytes(value)));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n _hex;\n _isBigNumber;\n constructor(constructorGuard, hex) {\n logger.checkNew(new.target, BigNumber);\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\",\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division by zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return this._hex[0] === \"-\";\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n // @ts-ignore\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString(),\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof value === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof value === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof anyValue === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof hex === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof hex === \"string\") {\n if (isHexString(hex) ||\n (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\n// @ts-ignore\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof value !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\n// @ts-ignore\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\n// @ts-ignore\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return new BN(\"-\" + hex.substring(3), 16);\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return new BN(value, 36).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return new BN(value, 16).toString(36);\n}\n//# sourceMappingURL=bigNumber.js.map","\"use strict\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify, isBytesLike } from \"../utils/data.js\";\nconst logger = new Logger(\"rlp/0.0.1\");\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return 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 _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 if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(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}\nexport function encode(object) {\n return hexlify(_encode(object));\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 if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: 1 + length, result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\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 if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: 1 + length, result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=rlp.js.map","const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();\nconst _32n = /* @__PURE__ */ BigInt(32);\n// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high\n// }` to match little-endian word order rather than the property names.\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array\n// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS\n// bitwise results back to uint32 first, and little-endian callers must swap.\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers\n// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below\n// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes).\nconst fromNumH = (n) => (n / 2 ** 32) | 0;\nconst fromNumL = (n) => n >>> 0;\n// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call\n// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`.\nfunction setU64FromNum(view, byteOffset, n, isLE) {\n const h = fromNumH(n);\n const l = fromNumL(n);\n view.setUint32(byteOffset, isLE ? l : h, isLE);\n view.setUint32(byteOffset + 4, isLE ? h : l, isLE);\n}\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s) => h >>> s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.\nconst rotr32H = (_h, l) => l;\n// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.\nconst rotr32L = (h, _l) => h;\n// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps\n// local copies so V8 inlines them into keccakP.\n// Add two split 64-bit words and return the split `{ h, l }` sum.\n// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out\n// of the low sum and instead use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\n// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\n// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\n// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, fromNumH, fromNumL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, setU64FromNum, shrSH, shrSL, split, toBig };\n","/**\n * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.\n * @param a - value to test\n * @returns `true` when the value is a Uint8Array-compatible view.\n * @example\n * Check whether a value is a Uint8Array-compatible view.\n * ```ts\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n// Shared error-message prefix builder. Only called on throw paths, so assert\n// success paths never pay for the string concatenation.\nconst atitle = (title) => (title ? `\"${title}\" ` : '');\n/**\n * Asserts something is a non-negative integer.\n * @param n - number to validate\n * @param title - label included in thrown errors\n * @returns The validated number.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a non-negative integer option.\n * ```ts\n * anumber(32, 'length');\n * ```\n */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number')\n throw new TypeError(atitle(title) + 'expected number, got ' + typeof n);\n if (!Number.isSafeInteger(n) || n < 0)\n throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n);\n return n;\n}\n/**\n * Asserts something is a boolean.\n * @param value - value to validate\n * @param title - label included in thrown errors\n * @returns The validated boolean.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a boolean option.\n * ```ts\n * abool(true, 'enableXOF');\n * ```\n */\nexport function abool(value, title = '') {\n if (typeof value !== 'boolean')\n throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);\n return value;\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - value to validate\n * @param length - optional exact length constraint\n * @param title - label included in thrown errors\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate that a value is a byte array.\n * ```ts\n * abytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function abytes(value, length, title = '') {\n // Success path first: this runs at the start of every update() / digestInto(), and the\n // common `abytes(data)` form must not pay for length handling it does not use.\n if (isBytes(value) && (length === undefined || value.length === length))\n return value;\n // Error path: recompute freely to build the exact message.\n if (length !== undefined)\n anumber(length, 'length');\n const bytes = isBytes(value);\n const ofLen = length !== undefined ? ` of length ${length}` : '';\n const got = bytes ? `length=${value.length}` : `type=${typeof value}`;\n const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Asserts something is a wrapped hash constructor.\n * @param h - hash constructor to validate\n * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}\n * @throws On invalid hash metadata ranges or values. {@link RangeError}\n * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}\n * @example\n * Validate a callable hash wrapper.\n * ```ts\n * import { ahash } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('expected hash wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1 || h.blockLen < 1)\n throw new Error('hash blockLen / outputLen must be >= 1');\n}\nconst aobject = (value, label) => {\n if (value === null || typeof value !== 'object' || Array.isArray(value))\n throw new TypeError((label === 'object' ? '' : `\"${label}\" `) + 'expected object, got type=' + typeof value);\n};\nconst aopts = (value, label) => {\n aobject(value, label);\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null)\n throw new TypeError(`\"${label}\" expected plain object`);\n // Object.assign() treats an own \"__proto__\" source key as a write to the target's legacy\n // prototype setter. Reject it before merging so inherited option values cannot be injected.\n if (Object.hasOwn(value, '__proto__'))\n throw new TypeError(`\"${label}.__proto__\" is not allowed`);\n};\n/**\n * Asserts a hash instance has not been destroyed or finished.\n * @param instance - hash instance to validate\n * @param checkFinished - whether to reject finalized instances\n * @throws If the hash instance has already been destroyed or finalized. {@link Error}\n * @example\n * Validate that a hash instance is still usable.\n * ```ts\n * import { aexists } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aexists(hash);\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their\n // truthiness is checked - re-validating their type per call was pure hot-path overhead.\n if (instance.destroyed)\n throw new Error('hash was destroyed');\n if (checkFinished && instance.finished)\n throw new Error('digest() was already called');\n}\n/**\n * Asserts output is a sufficiently-sized byte array.\n * @param out - destination buffer\n * @param instance - hash instance providing output length\n * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a caller-provided digest buffer.\n * ```ts\n * import { aoutput } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aoutput(new Uint8Array(hash.outputLen), hash);\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast\n // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call.\n const min = instance.outputLen;\n if (!(out.length >= min)) {\n throw new RangeError('\"output\" expected length >= ' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed array view to Uint32Array.\n * `arr.byteOffset` must already be 4-byte aligned or the platform\n * Uint32Array constructor will throw.\n * @param arr - source typed array\n * @returns Uint32Array view over the same buffer.\n * @example\n * Reinterpret a byte array as 32-bit words.\n * ```ts\n * u32(new Uint8Array(8));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Zeroizes typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros\n * @example\n * Zeroize sensitive buffers in place.\n * ```ts\n * clean(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/**\n * Creates a DataView for byte-level manipulation.\n * @param arr - source typed array\n * @returns DataView over the same buffer region.\n * @example\n * Create a DataView over an existing buffer.\n * ```ts\n * createView(new Uint8Array(4));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Rotate-right operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the right.\n * ```ts\n * rotr(0x12345678, 8);\n * ```\n */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Rotate-left operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the left.\n * ```ts\n * rotl(0x12345678, 8);\n * ```\n */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/**\n * Byte-swap operation for uint32 values.\n * @param word - source word\n * @returns Word with reversed byte order.\n * @example\n * Reverse the byte order of a 32-bit word.\n * ```ts\n * byteSwap(0x11223344);\n * ```\n */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\n/**\n * Byte-swaps every word of a Uint32Array in place.\n * @param arr - array to mutate\n * @returns The same array after mutation; callers pass live state arrays here.\n * @example\n * Reverse the byte order of every word in place.\n * ```ts\n * byteSwap32(new Uint32Array([0x11223344]));\n * ```\n */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n/**\n * Conditionally byte-swaps a Uint32Array on big-endian platforms.\n * @param u - array to normalize for host endianness\n * @returns Original or byte-swapped array depending on platform endianness.\n * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.\n * @example\n * Normalize a word array for host endianness.\n * ```ts\n * swap32IfBE(new Uint32Array([0x11223344]));\n * ```\n */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\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}\n// Strict ASCII nibble parser: non-ASCII hex lookalikes are rejected as undefined.\n// ASCII codes: '0'..'9' = 48..57, 'A'..'F' = 65..70, 'a'..'f' = 97..102.\n// prettier-ignore\nfunction asciiToBase16(ch) {\n return ch >= 48 && ch <= 57 ? ch - 48 // '2' => 50-48\n : ch >= 65 && ch <= 70 ? ch - (65 - 10) // 'B' => 66-(65-10)\n : ch >= 97 && ch <= 102 ? ch - (97 - 10) // 'b' => 98-(97-10)\n : undefined;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi)); // parse first char, multiply it by 16\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); // parse second char\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // example: 'A9' => 10*16 + 9\n }\n return array;\n}\n/**\n * Yields to the host task scheduler so timers, I/O, and rendering can make progress.\n * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback.\n * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so\n * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while\n * still allowing other event-loop work to proceed.\n * @param onReject - optional cleanup invoked only if the host yield fails\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport function nextTick(onReject) {\n const host = globalThis;\n if (typeof host.scheduler?.yield === 'function') {\n const promise = host.scheduler.yield();\n // Keep the original scheduler rejection; this handler exists only for cleanup.\n if (onReject)\n promise.catch(onReject);\n return promise;\n }\n return new Promise((resolve) => host.setTimeout(resolve, 0));\n}\n/**\n * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @param onReject - optional cleanup invoked only if a host yield fails\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb, onReject) {\n anumber(iters, 'iters');\n anumber(tick, 'tick');\n if (typeof cb !== 'function')\n throw new TypeError('callback must be a function');\n // Callback is synchronous by contract; asyncLoop only yields between sync work windows.\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick(onReject);\n // Track only synchronous work time; scheduler delay after yielding is outside our budget.\n ts = Date.now();\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n const encoded = new TextEncoder().encode(str);\n try {\n // Copy into the current realm for Firefox extension contexts. Callers that own the returned\n // buffer can then wipe it independently of TextEncoder's temporary result.\n return new Uint8Array(encoded); // https://bugzil.la/1681809\n }\n finally {\n clean(encoded);\n }\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Validates declared required and optional field types on a plain object.\n * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct\n * one-line guards such as `abytes()`, `abool()`, or `anumber()` instead.\n * @param object - object to validate\n * @param fields - map of required field names to expected types\n * @param optFields - map of optional field names to expected types\n * @param title - label included in thrown errors\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate required and optional option fields.\n * ```ts\n * validateObject({ N: 1024, dkLen: 32 }, { N: 'number' }, { dkLen: 'number' });\n * ```\n */\nexport const validateObject = (object, fields = {}, optFields = {}, title = 'object') => {\n aobject(object, title);\n aobject(fields, 'fields');\n aobject(optFields, 'optFields');\n function checkField(fieldName, expectedType, isOpt) {\n const label = title === 'object' ? `param \"${String(fieldName)}\"` : `\"${title}.${String(fieldName)}\"`;\n // Config fields must be explicit own properties. Optional inherited values are rejected too\n // because callers keep reading the same options object after validation.\n const val = object[fieldName];\n // Runtime objects such as Field instances intentionally satisfy required method slots\n // via their shared prototype.\n if (!Object.hasOwn(object, fieldName) &&\n (isOpt ? val !== undefined : expectedType !== 'function')) {\n throw new TypeError(`${label} is invalid: expected own property`);\n }\n if (isOpt && val === undefined)\n return;\n const current = typeof val;\n if (current !== expectedType || val === null)\n throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);\n }\n const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));\n iter(fields, false);\n iter(optFields, true);\n};\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @param title - label included in thrown override errors\n * @returns Fresh merged option object with a null prototype.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts, title = 'opts') {\n aopts(defaults, 'defaults');\n if (opts !== undefined)\n aopts(opts, title);\n // Callers read optional fields directly, so omitted values must not fall through to ambient\n // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).\n const merged = Object.assign(Object.create(null), defaults, opts);\n return merged;\n}\n/**\n * Creates a callable hash function from a stateful class constructor.\n * @param hashCons - hash constructor or factory\n * @param info - optional metadata such as DER OID\n * @returns Frozen callable hash wrapper with `.create()`.\n * Wrapper construction eagerly calls `hashCons(undefined)` once to read\n * `outputLen` / `blockLen`, so constructor side effects happen at module\n * init time.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Wrap a stateful hash constructor into a callable helper.\n * ```ts\n * import { createHasher } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const wrapped = createHasher(sha256.create, { oid: sha256.oid });\n * wrapped(new Uint8Array([1]));\n * ```\n */\nexport function createHasher(hashCons, info = {}) {\n if (typeof hashCons !== 'function')\n throw new TypeError('\"hashCons\" expected function, got type=' + typeof hashCons);\n info = checkOpts({}, info, 'info');\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.canXOF = tmp.canXOF;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 §10.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.\n * @param suffix - final OID byte for the selected hash.\n * The helper accepts any byte even though only the documented NIST hash\n * suffixes are meaningful downstream.\n * @returns Object containing the DER-encoded OID.\n * @example\n * Build OID metadata for a NIST hash.\n * ```ts\n * oidNist(0x01);\n * ```\n */\nexport const oidNist = (suffix) => ({\n // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.\n // Larger suffix values would need base-128 OID encoding and a different length byte.\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { setU64FromNum } from \"./_u64.js\";\nimport { abytes, aexists, aoutput, createView } from \"./utils.js\";\n/**\n * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.\n * Returns bits from `b` when `a` is set, otherwise from `c`.\n * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never\n * set the same bit.\n * @param a - selector word\n * @param b - word chosen when selector bit is set\n * @param c - word chosen when selector bit is clear\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit choice primitive.\n * ```ts\n * Chi(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/**\n * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.\n * Returns bits shared by at least two inputs.\n * @param a - first input word\n * @param b - second input word\n * @param c - third input word\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit majority primitive.\n * ```ts\n * Maj(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit\n * strings with partial-byte tails.\n * @param blockLen - internal block size in bytes\n * @param outputLen - digest size in bytes\n * @param padOffset - trailing length field size in bytes\n * @param isLE - whether length and state words are encoded in little-endian\n * @example\n * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.\n * ```ts\n * import { _SHA1 } from '@noble/hashes/legacy.js';\n * const hash = new _SHA1();\n * hash.update(new Uint8Array([97, 98, 99]));\n * hash.digest();\n * ```\n */\nexport class HashMD {\n blockLen;\n outputLen;\n canXOF = false;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n let processed = false;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path only when there is no buffered partial block: `take === blockLen` implies\n // `this.pos === 0`, so we can process full blocks directly from the input view.\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n processed = true;\n continue;\n }\n // When the whole input is buffered in one go (common for short messages), passing `data`\n // directly avoids allocating a subarray view.\n buffer.set(pos === 0 && take === len ? data : 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 processed = true;\n }\n }\n this.length += data.length;\n // Shared schedule buffers only pick up input-derived words inside process(); if everything\n // was buffered without processing, there is nothing to zero.\n if (processed)\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(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, then zero-pad the rest of the block\n buffer[pos++] = 0b10000000;\n buffer.fill(0, pos);\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n buffer.fill(0);\n }\n // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from\n // the padding fill above, and JS will overflow before user input can make that half non-zero.\n // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an\n // integer below 2**53, so the split inside the helper stays exact).\n setU64FromNum(view, blockLen - 8, this.length * 8, isLE);\n this.process(view, 0);\n // The final block above is processed outside update(), so the shared message-schedule\n // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest().\n this.roundClean();\n // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.\n const oview = out === buffer ? view : createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n const outLen = len / 4;\n const state = this.get();\n // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state.\n if (len % 4 || outLen > state.length)\n throw new Error('invalid outputLen');\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 // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return\n // fresh bytes to the caller.\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneIntoMeta(to) {\n const { buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and\n // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it.\n if (pos)\n to.buffer.set(buffer); // Avoid a hot modulo guard.\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the\n * square roots of the first eight prime numbers. Exported as a shared table; callers must treat\n * it as read-only because constructors copy words from it by index. */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state `H(0)` from RFC 6234 §6.1. Exported as a shared table; callers must\n * treat it as read-only because constructors copy words from it by index. */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the ninth\n * through sixteenth prime numbers. Exported as a shared table; callers must treat it as read-only\n * because constructors copy halves from it by index. */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first\n * eight prime numbers. Exported as a shared table; callers must treat it as read-only because\n * constructors copy halves from it by index. */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n","/**\n\nSHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions.\nRFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors,\nnot the base RIPEMD-160 compression spec.\nDon't use them in a new protocol. What \"weak\" means:\n\n- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.\n- No practical pre-image attacks (only theoretical, 2^123.4)\n- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151\n * @module\n */\nimport { Chi, HashMD, Maj } from \"./_md.js\";\nimport { clean, createHasher, rotl } from \"./utils.js\";\n/** Initial SHA-1 state from RFC 3174 §6.1. */\nconst SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\n// Reusable 80-word SHA-1 message schedule buffer.\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA1 legacy hash class. */\nexport class _SHA1 extends HashMD {\n A = SHA1_IV[0] | 0;\n B = SHA1_IV[1] | 0;\n C = SHA1_IV[2] | 0;\n D = SHA1_IV[3] | 0;\n E = SHA1_IV[4] | 0;\n constructor() {\n super(64, 20, 8, false);\n }\n get() {\n const { A, B, C, D, E } = this;\n return [A, B, C, D, E];\n }\n set(A, B, C, D, E) {\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 }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n SHA1_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 80; i++)\n SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n // Compression function main loop, 80 rounds\n let { A, B, C, D, E } = this;\n for (let i = 0; i < 80; i++) {\n let F, K;\n if (i < 20) {\n F = Chi(B, C, D);\n K = 0x5a827999;\n }\n else if (i < 40) {\n F = B ^ C ^ D;\n K = 0x6ed9eba1;\n }\n else if (i < 60) {\n F = Maj(B, C, D);\n K = 0x8f1bbcdc;\n }\n else {\n F = B ^ C ^ D;\n K = 0xca62c1d6;\n }\n const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0;\n E = D;\n D = C;\n C = rotl(B, 30);\n B = A;\n A = T;\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 this.set(A, B, C, D, E);\n }\n roundClean() {\n clean(SHA1_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA1.\n * ```ts\n * sha1(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha1 = /* @__PURE__ */ createHasher(() => new _SHA1());\n/** RFC 1321 `T[i]` uses `floor(2^32 * abs(sin(i)))`; this is the shared `2^32` scale factor. */\nconst p32 = /* @__PURE__ */ Math.pow(2, 32);\n/** RFC 1321 `T[1..64]` table. */\nconst K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));\n/** MD5 initial state from RFC 1321, stored as 4 u32 words. */\nconst MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);\n// Reusable 16-word MD5 message block buffer.\nconst MD5_W = /* @__PURE__ */ new Uint32Array(16);\n// RFC 1321 §3.4 per-round rotate amounts, flattened to 64 entries so the round loop\n// avoids allocating a 4-element array literal every round (measured ~5% of md5).\nconst MD5_SHIFTS = /* @__PURE__ */ (() => {\n const S = [\n [7, 12, 17, 22],\n [5, 9, 14, 20],\n [4, 11, 16, 23],\n [6, 10, 15, 21],\n ];\n return Uint8Array.from({ length: 64 }, (_, i) => S[Math.floor(i / 16)][i % 4]);\n})();\n/** Internal MD5 legacy hash class. */\nexport class _MD5 extends HashMD {\n A = MD5_IV[0] | 0;\n B = MD5_IV[1] | 0;\n C = MD5_IV[2] | 0;\n D = MD5_IV[3] | 0;\n constructor() {\n super(64, 16, 8, true);\n }\n get() {\n const { A, B, C, D } = this;\n return [A, B, C, D];\n }\n set(A, B, C, D) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n MD5_W[i] = view.getUint32(offset, true);\n // Compression function main loop, 64 rounds\n let { A, B, C, D } = this;\n for (let i = 0; i < 64; i++) {\n let F, g;\n if (i < 16) {\n F = Chi(B, C, D);\n g = i;\n }\n else if (i < 32) {\n // RFC 1321 round 2 uses G(B,C,D) = (B & D) | (C & ~D), which is `Chi(D, B, C)`.\n F = Chi(D, B, C);\n g = (5 * i + 1) % 16;\n }\n else if (i < 48) {\n F = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n }\n else {\n F = C ^ (B | ~D);\n g = (7 * i) % 16;\n }\n F = F + A + K[i] + MD5_W[g];\n A = D;\n D = C;\n C = B;\n B = B + rotl(F, MD5_SHIFTS[i]);\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 this.set(A, B, C, D);\n }\n roundClean() {\n clean(MD5_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.\n * MD5 architecture is similar to SHA1, with some differences:\n * - Reduced output length: 16 bytes (128 bit) instead of 20\n * - 64 rounds, instead of 80\n * - Little-endian: could be faster, but will require more code\n * - Non-linear index selection: huge speed-up for unroll\n * - Per round constants: more memory accesses, additional speed-up for unroll\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with MD5.\n * ```ts\n * md5(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const md5 = /* @__PURE__ */ createHasher(() => new _MD5());\n// RIPEMD-160\n// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables.\nconst Rho160 = /* @__PURE__ */ Uint8Array.from([\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n]);\nconst Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();\nconst Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();\n// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds.\nconst idxLR = /* @__PURE__ */ (() => {\n const L = [Id160];\n const R = [Pi160];\n const res = [L, R];\n for (let i = 0; i < 4; i++)\n for (let j of res)\n j.push(j[i].map((k) => Rho160[k]));\n return res;\n})();\nconst idxL = /* @__PURE__ */ (() => idxLR[0])();\nconst idxR = /* @__PURE__ */ (() => idxLR[1])();\n// const [idxL, idxR] = idxLR;\n// Base per-group shift table before the left/right message-order permutations are applied.\nconst shifts160 = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => Uint8Array.from(i));\nconst shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));\nconst shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));\n// Five left-lane additive constants for RIPEMD-160.\nconst Kl160 = /* @__PURE__ */ Uint32Array.from([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\n// Five right-lane additive constants for RIPEMD-160.\nconst Kr160 = /* @__PURE__ */ Uint32Array.from([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range\n// inputs currently fall through to the group-4 branch.\nfunction ripemd_f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n if (group === 1)\n return (x & y) | (~x & z);\n if (group === 2)\n return (x | ~y) ^ z;\n if (group === 3)\n return (x & z) | (y & ~z);\n return x ^ (y | ~z);\n}\n// Reusable 16-word RIPEMD-160 message block buffer.\nconst BUF_160 = /* @__PURE__ */ new Uint32Array(16);\n/**\n * Internal RIPEMD-160 legacy hash class.\n * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification.\n */\nexport class _RIPEMD160 extends HashMD {\n h0 = 0x67452301 | 0;\n h1 = 0xefcdab89 | 0;\n h2 = 0x98badcfe | 0;\n h3 = 0x10325476 | 0;\n h4 = 0xc3d2e1f0 | 0;\n constructor() {\n super(64, 20, 8, true);\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF_160[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order.\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n clean(BUF_160);\n }\n destroy() {\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a legacy hash function from 1990s.\n * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point\n * at the base RIPEMD-160 references.\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html}\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf}\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with RIPEMD-160.\n * ```ts\n * ripemd160(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160());\n","/**\n * HMAC: RFC2104 message authentication code.\n * @module\n */\nimport { abytes, aexists, ahash, aoutput, clean, } from \"./utils.js\";\n/**\n * Internal class for HMAC.\n * Accepts any byte key, although RFC 2104 §3 recommends keys at least\n * `HashLen` bytes long.\n */\nexport class _HMAC {\n oHash;\n iHash;\n blockLen;\n outputLen;\n canXOF = false;\n finished = false;\n destroyed = false;\n constructor(hash, key) {\n ahash(hash);\n abytes(key, undefined, 'key');\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('expected Hash instance');\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 the first block) of the outer hash here,\n // 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 clean(pad);\n }\n update(buf) {\n aexists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n const buf = out.subarray(0, this.outputLen);\n // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before\n // overwriting that same prefix with the final tag, leaving any oversized tail untouched.\n this.iHash.digestInto(buf);\n this.oHash.update(buf);\n this.oHash.digestInto(buf);\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 the key\n // is already in state and we don't know it.\n to ||= Object.create(Object.getPrototypeOf(this), {});\n const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.canXOF = canXOF;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\nexport const hmac = /* @__PURE__ */ (() => {\n const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest());\n hmac_.create = (hash, key) => new _HMAC(hash, key);\n return hmac_;\n})();\n","/**\n * PBKDF (RFC 2898). Can be used to create a key from password and salt.\n * @module\n */\nimport { hmac } from \"./hmac.js\";\n// prettier-ignore\nimport { ahash, anumber, asyncLoop, checkOpts, clean, createView, kdfInputToBytes } from \"./utils.js\";\n// Common validation and per-call state setup for sync/async functions.\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n ahash(hash);\n const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);\n const { c, dkLen, asyncTick } = opts;\n anumber(c, 'c');\n anumber(dkLen, 'dkLen');\n anumber(asyncTick, 'asyncTick');\n if (c < 1)\n throw new Error('\"c\" (iterations) must be >= 1');\n // RFC 8018 §5.2 defines `dkLen` as \"a positive integer\".\n if (dkLen < 1)\n throw new Error('\"dkLen\" must be >= 1');\n // RFC 8018 §5.2 step 1 requires rejecting oversize `dkLen`\n // before allocating the destination buffer.\n if (dkLen > (2 ** 32 - 1) * hash.outputLen)\n throw new Error('derived key too long');\n const p = kdfInputToBytes(_password, 'password');\n try {\n const s = kdfInputToBytes(_salt, 'salt');\n try {\n // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n const DK = new Uint8Array(dkLen);\n const { iHash, oHash, outputLen } = hmac.create(hash, p);\n // Drive keyed hashes directly; the wrapper is only needed to initialize their HMAC midstates.\n const u = new Uint8Array(outputLen);\n const eng = pbkdf2Engine(iHash, oHash, s, u);\n return { c, dkLen, asyncTick, DK, outputLen, eng };\n }\n finally {\n // Uint8Array inputs belong to the caller; only wipe our UTF-8 conversion.\n if (typeof _salt === 'string')\n clean(s);\n }\n }\n finally {\n if (typeof _password === 'string')\n clean(p);\n }\n}\n// Per-call PRF driver writes U1 into both `u` and `Ti`, then later digests into `u`;\n// shared by the sync and async variants.\nfunction pbkdf2Engine(iHash, oHash, salt, u) {\n const counter = new Uint8Array(4);\n const view = createView(counter);\n // Full clones retain tree/config state; absorb salt before async yields without cloning input.\n const salted = iHash._cloneInto().update(salt);\n // u1() overwrites the worker before reading it. Seed from the outer midstate so a long salt\n // cannot pre-populate a tree stack that the first reset would abandon without wiping.\n const work = oHash._cloneInto();\n const iClone = iHash._cloneInto; // Capture before mixed feedback can materialize state tuples.\n const oClone = oHash._cloneInto;\n return {\n u1: (ti, Ti) => {\n view.setInt32(0, ti, false);\n salted._cloneInto(work).update(counter).digestInto(u);\n oHash._cloneInto(work).update(u).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n },\n // Whole `F` inner loop for the sync variant: one optimized function owns the hot loop.\n rounds: (c, Ti) => {\n for (let ui = 1; ui < c; ui++) {\n iClone.call(iHash, work).update(u).digestInto(u);\n oClone.call(oHash, work).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n }\n },\n output: (DK) => {\n // Keyed templates and derived worker states are secret material.\n iHash.destroy();\n oHash.destroy();\n salted.destroy();\n work.destroy();\n // Shared sync/async cleanup point: wipe transient PRF state\n // while preserving the derived key buffer.\n clean(u);\n return DK;\n },\n };\n}\n/**\n * PBKDF2-HMAC: RFC 8018 key derivation function.\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated;\n * JS string inputs are UTF-8 encoded first\n * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first\n * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,\n * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}.\n * @returns Derived key bytes.\n * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error}\n * @example\n * PBKDF2-HMAC: RFC 2898 key derivation function.\n * ```ts\n * import { pbkdf2 } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });\n * ```\n */\nexport function pbkdf2(hash, password, salt, opts) {\n const { c, dkLen, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) {\n // Ti = F(Password, Salt, c, i)\n // The last Ti view can be shorter than hLen, which applies\n // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies.\n const Ti = DK.subarray(pos, pos + outputLen);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n eng.u1(ti, Ti);\n // Uc = PRF(Password, Uc−1); Ti ^= Uc\n eng.rounds(c, Ti);\n }\n return eng.output(DK);\n}\n/**\n * PBKDF2-HMAC: RFC 8018 key derivation function. Async version.\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated;\n * JS string inputs are UTF-8 encoded first\n * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first\n * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,\n * must be `>= 1` per RFC 8018 §5.2. `asyncTick` is only a local\n * scheduler-yield knob for this JS wrapper, not part of RFC 8018.\n * See {@link Pbkdf2Opt}.\n * @returns Promise resolving to derived key bytes.\n * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error}\n * @example\n * PBKDF2-HMAC: RFC 2898 key derivation function.\n * ```ts\n * import { pbkdf2Async } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 });\n * ```\n * @example\n * Tune the async PBKDF2 scheduler for short UI tasks.\n * ```ts\n * import { pbkdf2Async } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = await pbkdf2Async(sha256, 'password', 'salt', {\n * dkLen: 32,\n * c: 32,\n * asyncTick: 1,\n * });\n * ```\n */\nexport async function pbkdf2Async(hash, password, salt, opts) {\n const { c, dkLen, asyncTick, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts);\n // Reuse normal state destruction, then wipe the incomplete output if a host yield aborts.\n const abort = () => {\n eng.output(DK);\n clean(DK);\n };\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) {\n // Ti = F(Password, Salt, c, i)\n // The last Ti view can be shorter than hLen, which applies\n // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies.\n const Ti = DK.subarray(pos, pos + outputLen);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n eng.u1(ti, Ti);\n await asyncLoop(c - 1, asyncTick, () => {\n // Uc = PRF(Password, Uc−1)\n eng.rounds(2, Ti); // c=2 runs exactly one PRF iteration per callback.\n }, abort);\n }\n return eng.output(DK);\n}\n","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\n/**\n * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits\n * of the cube roots of the first 64 primes (2..311).\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\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/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */\nclass SHA2_32B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and makes sha256 3x slower (measured).\n A = 0;\n B = 0;\n C = 0;\n D = 0;\n E = 0;\n F = 0;\n G = 0;\n H = 0;\n constructor(outputLen, IV) {\n super(64, outputLen, 8, false);\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 _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\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 clean(SHA256_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */\nexport class _SHA256 extends SHA2_32B {\n constructor() {\n super(32, SHA256_IV);\n }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */\nexport class _SHA224 extends SHA2_32B {\n constructor() {\n super(28, SHA224_IV);\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// SHA-384 / SHA-512 round constants from RFC 6234 §5.2:\n// 80 full 64-bit words split into high/low halves.\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\n// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */\nclass SHA2_64B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and slows hashing down (measured on sha256).\n Ah = 0;\n Al = 0;\n Bh = 0;\n Bl = 0;\n Ch = 0;\n Cl = 0;\n Dh = 0;\n Dl = 0;\n Eh = 0;\n El = 0;\n Fh = 0;\n Fl = 0;\n Gh = 0;\n Gl = 0;\n Hh = 0;\n Hl = 0;\n constructor(outputLen, IV) {\n super(128, outputLen, 16, false);\n this.Ah = IV[0] | 0;\n this.Al = IV[1] | 0;\n this.Bh = IV[2] | 0;\n this.Bl = IV[3] | 0;\n this.Ch = IV[4] | 0;\n this.Cl = IV[5] | 0;\n this.Dh = IV[6] | 0;\n this.Dl = IV[7] | 0;\n this.Eh = IV[8] | 0;\n this.El = IV[9] | 0;\n this.Fh = IV[10] | 0;\n this.Fl = IV[11] | 0;\n this.Gh = IV[12] | 0;\n this.Gl = IV[13] | 0;\n this.Hh = IV[14] | 0;\n this.Hl = IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA512 extends SHA2_64B {\n constructor() {\n super(64, SHA512_IV);\n }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA384 extends SHA2_64B {\n constructor() {\n super(48, SHA384_IV);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.\n * These IV literals are checked against that script rather than a dedicated\n * local RFC section.\n */\n/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_224 extends SHA2_64B {\n constructor() {\n super(28, T224_IV);\n }\n}\n/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_256 extends SHA2_64B {\n constructor() {\n super(32, T256_IV);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-256.\n * ```ts\n * sha256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__PURE__ */ oidNist(0x01));\n/**\n * SHA2-224 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-224.\n * ```ts\n * sha224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__PURE__ */ oidNist(0x04));\n/**\n * SHA2-512 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512.\n * ```ts\n * sha512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__PURE__ */ oidNist(0x03));\n/**\n * SHA2-384 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-384.\n * ```ts\n * sha384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/256.\n * ```ts\n * sha512_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/224.\n * ```ts\n * sha512_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202},\n * {@link https://keccak.team/keccak.html | Website}, and\n * {@link https://crypto.stackexchange.com/q/15727 | the differences between\n * SHA-3 and Keccak}.\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { split } from \"./_u64.js\";\n// prettier-ignore\nimport { abool, abytes, aexists, anumber, aoutput, checkOpts, clean, createHasher, oidNist, swap32IfBE, u32 } from \"./utils.js\";\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\n// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors\n// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`.\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = []; // no pure annotation: var is always used\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\n// `split(..., true)` keeps the local little-endian lane-word layout used by\n// `state32`, so these `H` / `L` tables follow the file's first-word /\n// second-word lane slots rather than `_u64.ts`'s usual high/low naming.\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can\n// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only\n// consumer of left-rotates; other hashes use right-rotates from _u64.\n// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64.\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2.\n// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation.\nconst B = new Uint32Array(5 * 2);\n/**\n * `keccakf1600` internal permutation, additionally allows adjusting the round count.\n * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words\n * in this file's local little-endian lane-word order\n * @param rounds - number of rounds to execute\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If `rounds` is outside the supported `1..24` range. {@link Error}\n * @example\n * Permute a Keccak state with the default 24 rounds.\n * ```ts\n * keccakP(new Uint32Array(50));\n * ```\n */\nexport function keccakP(s, rounds = 24) {\n if (!(s instanceof Uint32Array))\n throw new TypeError('\"s\" expected Uint32Array(50), got type=' + typeof s);\n if (s.length !== 50)\n throw new RangeError('\"s\" expected Uint32Array(50), got length=' + s.length);\n anumber(rounds, 'rounds');\n // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table.\n if (rounds < 1 || rounds > 24)\n throw new Error('\"rounds\" expected integer 1..24');\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n // Same as:\n // for (let x = 0; x < 10; x++) B[x] = s[y + x];\n // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n for (let y = 0; y < 50; y += 10) {\n const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3];\n s[y] ^= ~s[y + 2] & s[y + 4];\n s[y + 1] ^= ~s[y + 3] & s[y + 5];\n s[y + 2] ^= ~s[y + 4] & s[y + 6];\n s[y + 3] ^= ~s[y + 5] & s[y + 7];\n s[y + 4] ^= ~s[y + 6] & s[y + 8];\n s[y + 5] ^= ~s[y + 7] & s[y + 9];\n s[y + 6] ^= ~s[y + 8] & b0;\n s[y + 7] ^= ~s[y + 9] & b1;\n s[y + 8] ^= ~b0 & b2;\n s[y + 9] ^= ~b1 & b3;\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n/**\n * Keccak sponge function.\n * @param blockLen - absorb/squeeze rate in bytes\n * @param suffix - domain separation suffix byte\n * @param outputLen - default digest length in bytes. This base sponge only\n * requires a non-negative integer; wrappers that need positive output\n * lengths must enforce that themselves.\n * @param enableXOF - whether XOF output is allowed\n * @param rounds - number of Keccak-f rounds\n * @example\n * Build a sponge state, absorb bytes, then finalize a digest.\n * ```ts\n * const hash = new Keccak(136, 0x06, 32);\n * hash.update(new Uint8Array([1, 2, 3]));\n * hash.digest();\n * ```\n */\nexport class Keccak {\n state;\n pos = 0;\n posOut = 0;\n finished = false;\n state32;\n destroyed = false;\n blockLen;\n suffix;\n outputLen;\n canXOF;\n enableXOF = false;\n rounds;\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n anumber(blockLen, 'blockLen');\n anumber(suffix, 'suffix');\n anumber(rounds, 'rounds');\n abool(enableXOF, 'enableXOF');\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.canXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen, 'outputLen');\n // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state.\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('\"blockLen\" must be 1..199');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone() {\n return this._cloneInto();\n }\n keccak() {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { blockLen, state, state32 } = this;\n const len = data.length;\n // Absorb full blocks with u32 XORs when both sides are 4-byte aligned.\n // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe.\n const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0;\n const blockLen32 = blockLen / 4;\n const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined;\n for (let pos = 0; pos < len;) {\n if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) {\n for (let i = 0, o = pos / 4; i < blockLen32; i++)\n state32[i] ^= data32[o + i];\n pos += blockLen;\n // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override,\n // so it must reflect the fully-absorbed block before the permutation fires.\n this.pos = blockLen;\n this.keccak();\n continue;\n }\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1.\n // These byte values already include the first padding bit, while the\n // final `0x80` below supplies the closing `1` bit in the last rate byte.\n state[pos] ^= suffix;\n // If that combined suffix lands in the last rate byte and already sets\n // bit 7, absorb it first so the final pad10*1 bit can be xored into a\n // fresh block.\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base\n // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/\n // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF.\n if (!this.enableXOF)\n throw new Error('XOF is not enabled');\n return this.writeInto(out);\n }\n xof(bytes) {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n aoutput(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest.\n this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen));\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.outputLen);\n this.digestInto(out);\n return out;\n }\n destroy() {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);\n // Reused destinations can come from a different rate/capacity variant, so clone must rewrite\n // the sponge geometry as well as the state words.\n to.blockLen = blockLen;\n to.state32.set(this.state32);\n // Sponge padding and XOF output are positional, so both offsets are part of the clone state.\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone\n // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie.\n to.canXOF = this.canXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info);\n/**\n * SHA3-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-224.\n * ```ts\n * sha3_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_224 = /* @__PURE__ */ genKeccak(0x06, 144, 28, \n/* @__PURE__ */ oidNist(0x07));\n/**\n * SHA3-256 hash function. Different from keccak-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-256.\n * ```ts\n * sha3_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, \n/* @__PURE__ */ oidNist(0x08));\n/**\n * SHA3-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-384.\n * ```ts\n * sha3_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_384 = /* @__PURE__ */ genKeccak(0x06, 104, 48, \n/* @__PURE__ */ oidNist(0x09));\n/**\n * SHA3-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-512.\n * ```ts\n * sha3_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, \n/* @__PURE__ */ oidNist(0x0a));\n/**\n * Keccak-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-224.\n * ```ts\n * keccak_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_224 = /* @__PURE__ */ genKeccak(0x01, 144, 28);\n/**\n * Keccak-256 hash function. Different from SHA3-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-256.\n * ```ts\n * keccak_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32);\n/**\n * Keccak-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-384.\n * ```ts\n * keccak_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_384 = /* @__PURE__ */ genKeccak(0x01, 104, 48);\n/**\n * Keccak-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-512.\n * ```ts\n * keccak_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_512 = /* @__PURE__ */ genKeccak(0x01, 72, 64);\nconst genShake = (suffix, blockLen, outputLen, info = {}) => createHasher((opts = {}) => {\n opts = checkOpts({}, opts);\n return new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true);\n}, info);\n/**\n * SHAKE128 XOF with 128-bit security and a 16-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128.\n * ```ts\n * shake128(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 16, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 256-bit security and a 32-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256.\n * ```ts\n * shake256(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 32, /* @__PURE__ */ oidNist(0x0c));\n/**\n * SHAKE128 XOF with 256-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128 using a 32-byte default output.\n * ```ts\n * shake128_32(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128_32 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 32, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 512-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256 using a 64-byte default output.\n * ```ts\n * shake256_64(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256_64 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 64, /* @__PURE__ */ oidNist(0x0c));\n","/*!\n * assert.js - assert for bcrypto\n * Copyright (c) 2020, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\n/*\n * Assert\n */\n\nfunction assert(val, msg) {\n if (!val) {\n const err = new Error(msg || 'Assertion failed');\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, assert);\n\n throw err;\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = assert;\n","/*!\n * custom.js - custom inspect symbol for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nexports.custom = 'inspect';\n","/*!\n * bn.js - big numbers for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/bn.js:\n * Copyright (c) 2015, Fedor Indutny (MIT License).\n * https://github.com/indutny/bn.js\n *\n * Parts of this software are based on golang/go:\n * Copyright (c) 2009, The Go Authors. All rights reserved.\n * https://github.com/golang/go\n *\n * Parts of this software are based on openssl/openssl:\n * Copyright (c) 1998-2018, The OpenSSL Project (Apache License v2.0).\n * Copyright (c) 1995-1998, Eric A. Young, Tim J. Hudson. All rights reserved.\n * https://github.com/openssl/openssl\n *\n * Parts of this software are based on libgmp:\n * Copyright (c) 1991-1997, 1999-2014, Free Software Foundation, Inc.\n * https://gmplib.org/\n *\n * Parts of this software are based on v8/v8:\n * Copyright (c) 2017, The V8 Project Authors (BSD-Style License).\n * https://github.com/v8/v8\n *\n * Resources:\n * https://github.com/indutny/bn.js/blob/master/lib/bn.js\n * https://github.com/indutny/miller-rabin/blob/master/lib/mr.js\n * https://github.com/golang/go/blob/master/src/math/big/int.go\n * https://github.com/golang/go/blob/master/src/math/big/nat.go\n * https://github.com/golang/go/blob/master/src/math/big/prime.go\n * https://github.com/openssl/openssl/tree/master/crypto/bn\n * https://github.com/openssl/openssl/blob/master/crypto/bn/bn_kron.c\n * https://github.com/gnutls/nettle/blob/master/mini-gmp.c\n * https://github.com/v8/v8/blob/master/src/objects/bigint.cc\n */\n\n/* eslint valid-typeof: \"off\" */\n\n'use strict';\n\nconst {custom} = require('../internal/custom');\n\n/*\n * Constants\n */\n\nconst zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n];\n\nconst groupSizes = [\n 0x00, 0x19, 0x10, 0x0c, 0x0b, 0x0a,\n 0x09, 0x08, 0x08, 0x07, 0x07, 0x07,\n 0x07, 0x06, 0x06, 0x06, 0x06, 0x06,\n 0x06, 0x06, 0x05, 0x05, 0x05, 0x05,\n 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,\n 0x05, 0x05, 0x05, 0x05, 0x05, 0x05\n];\n\nconst groupBases = [\n 0x00000000, 0x02000000, 0x0290d741, 0x01000000,\n 0x02e90edd, 0x039aa400, 0x0267bf47, 0x01000000,\n 0x0290d741, 0x00989680, 0x012959c3, 0x0222c000,\n 0x03bd7765, 0x0072e440, 0x00adcea1, 0x01000000,\n 0x01704f61, 0x0206fc40, 0x02cddcf9, 0x03d09000,\n 0x003e5185, 0x004ea360, 0x006235f7, 0x00798000,\n 0x009502f9, 0x00b54ba0, 0x00daf26b, 0x01069c00,\n 0x0138f9ad, 0x0172c9e0, 0x01b4d89f, 0x02000000,\n 0x025528a1, 0x02b54a20, 0x03216b93, 0x039aa400\n];\n\nconst primes = {\n p192: null,\n p224: null,\n p521: null,\n k256: null,\n p251: null,\n p25519: null,\n p448: null\n};\n\nconst modes = {\n NONE: 0,\n QUO: 1,\n REM: 2,\n BOTH: 3,\n EUCLID: 4,\n ALL: 7\n};\n\nconst WND_WIDTH = 4;\nconst WND_SIZE = 1 << (WND_WIDTH - 1);\n\nconst HAS_BIGINT = typeof BigInt === 'function';\n\n/**\n * BN\n */\n\nclass BN {\n constructor(num, base, endian) {\n this.words = [0];\n this.length = 1;\n this.negative = 0;\n this.red = null;\n this.from(num, base, endian);\n }\n\n /*\n * Addition Engine\n */\n\n _iadd(a, b) {\n let carry = 0;\n let i = 0;\n\n // a.length > b.length\n if (a.length < b.length)\n [a, b] = [b, a];\n\n if (a !== this)\n this._alloc(a.length);\n\n for (; i < b.length; i++) {\n const r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n\n this.words[i] = r & 0x3ffffff;\n\n carry = r >>> 26;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n const r = (a.words[i] | 0) + carry;\n\n this.words[i] = r & 0x3ffffff;\n\n carry = r >>> 26;\n }\n\n this.length = a.length;\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n } else if (a !== this) {\n // Copy the rest of the words.\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n _iaddn(num) {\n this.words[0] += num;\n\n if (this.words[0] < 0x4000000)\n return this;\n\n // Carry.\n let i = 0;\n\n this._alloc(this.length + 1);\n\n this.words[this.length] = 0;\n\n for (; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n this.words[i + 1] += 1;\n }\n\n this.length = Math.max(this.length, i + 1);\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n /*\n * Addition\n */\n\n iadd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative === num.negative) {\n // x + y == x + y\n // (-x) + (-y) == -(x + y)\n this._iadd(this, num);\n } else {\n // x + (-y) == x - y == -(y - x)\n // (-x) + y == y - x == -(x - y)\n const cmp = this.ucmp(num);\n\n // x + (-x) == (-x) + x == 0\n if (cmp === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n if (cmp < 0) {\n this._isub(num, this);\n this.negative ^= 1;\n } else {\n this._isub(this, num);\n }\n }\n\n return this;\n }\n\n iaddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (negative)\n num = -num;\n\n if (this.negative === negative) {\n // x + y == x + y\n // (-x) + (-y) == -(x + y)\n this._iaddn(num);\n } else {\n // x + (-y) == x - y == -(y - x)\n // (-x) + y == y - x == -(x - y)\n if (this.length === 1 && this.words[0] < num) {\n this.words[0] = num - this.words[0];\n this.negative ^= 1;\n } else {\n this._isubn(num);\n }\n }\n\n return this;\n }\n\n add(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (num.length > this.length)\n return num.clone().iadd(this);\n\n return this.clone().iadd(num);\n }\n\n addn(num) {\n return this.clone().iaddn(num);\n }\n\n /*\n * Subtraction Engine\n */\n\n _isub(a, b) {\n let carry = 0;\n let i = 0;\n\n // a > b\n assert(a.length >= b.length);\n\n if (a !== this)\n this._alloc(a.length);\n\n for (; i < b.length; i++) {\n const r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n\n carry = r >> 26;\n\n this.words[i] = r & 0x3ffffff;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n const r = (a.words[i] | 0) + carry;\n\n carry = r >> 26;\n\n this.words[i] = r & 0x3ffffff;\n }\n\n assert(carry === 0);\n\n // Copy rest of the words.\n if (a !== this) {\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n this.length = Math.max(this.length, i);\n\n return this._strip();\n }\n\n _isubn(num) {\n this.words[0] -= num;\n\n if (this.words[0] >= 0)\n return this._normalize();\n\n assert(this.length !== 1);\n\n // Carry.\n this._alloc(this.length + 1);\n\n for (let i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n\n this.words[this.length] = 0;\n\n return this._strip();\n }\n\n /*\n * Subtraction\n */\n\n isub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative !== num.negative) {\n // x - (-y) == x + y\n // (-x) - y == -(x + y)\n this._iadd(this, num);\n } else {\n // x - y == x - y == -(y - x)\n // (-x) - (-y) == y - x == -(x - y)\n const cmp = this.ucmp(num);\n\n // x - x == 0\n if (cmp === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n if (cmp < 0) {\n this._isub(num, this);\n this.negative ^= 1;\n } else {\n this._isub(this, num);\n }\n }\n\n return this;\n }\n\n isubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (negative)\n num = -num;\n\n if (this.negative !== negative) {\n // x - (-y) == x + y\n // (-x) - y == -(x + y)\n this._iaddn(num);\n } else {\n // x - y == x - y == -(y - x)\n // (-x) - (-y) == y - x == -(x - y)\n if (this.length === 1 && this.words[0] < num) {\n this.words[0] = num - this.words[0];\n this.negative ^= 1;\n } else {\n this._isubn(num);\n }\n }\n\n return this;\n }\n\n sub(num) {\n return this.clone().isub(num);\n }\n\n subn(num) {\n return this.clone().isubn(num);\n }\n\n /*\n * Multiplication Engine\n */\n\n _mul(num, out) {\n enforce(BN.isBN(num), 'num', 'bignum');\n enforce(BN.isBN(out), 'out', 'bignum');\n\n if (this.length === 10 && num.length === 10)\n return comb10MulTo(this, num, out);\n\n const len = this.length + num.length;\n\n if (len < 63)\n return smallMulTo(this, num, out);\n\n if (len < 1024)\n return bigMulTo(this, num, out);\n\n return jumboMulTo(this, num, out);\n }\n\n /*\n * Multiplication\n */\n\n imul(num) {\n return this.mul(num)._move(this);\n }\n\n imuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n // Carry.\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = this.words[i] * num;\n const lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n carry += lo >>> 26;\n\n this.words[i] = lo & 0x3ffffff;\n }\n\n this.negative ^= neg;\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n } else {\n this._strip();\n }\n\n return this;\n }\n\n mul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n const len = this.length + num.length;\n const out = new BN();\n\n out.words = new Array(len);\n\n for (let i = 0; i < len; i ++)\n out.words[i] = 0;\n\n return this._mul(num, out);\n }\n\n muln(num) {\n return this.clone().imuln(num);\n }\n\n /*\n * Multiplication + Shift\n */\n\n mulShift(num, bits) {\n enforce(BN.isBN(num), 'num', 'bignum');\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = this.mul(num);\n const b = r.utestn(bits - 1);\n\n r.iushrn(bits);\n\n if (this.negative ^ num.negative)\n return r.isubn(b);\n\n return r.iaddn(b);\n }\n\n /*\n * Division Engine\n */\n\n _div(num, flags) {\n enforce(BN.isBN(num), 'num', 'bignum');\n assert((flags & modes.ALL) === flags);\n assert(flags !== modes.NONE);\n\n const a = this;\n const b = num;\n\n nonzero(!b.isZero());\n\n if (a.isZero())\n return [new BN(0), new BN(0)];\n\n const as = a.negative;\n const bs = b.negative;\n\n a.negative = 0;\n b.negative = 0;\n\n let q = null;\n let r = null;\n\n if (a.ucmp(b) < 0) {\n if (flags & modes.QUO)\n q = new BN(0);\n\n if (flags & modes.REM)\n r = a.clone();\n } else if (b.length === 1) {\n if (flags & modes.QUO)\n q = a.quon(b.words[0]);\n\n if (flags & modes.REM)\n r = a.remn(b.words[0]);\n } else {\n [q, r] = a._wordDiv(b, flags);\n }\n\n a.negative = as;\n b.negative = bs;\n\n if (flags & modes.QUO) {\n q.negative = a.negative ^ b.negative;\n q._normalize();\n }\n\n if (flags & modes.REM) {\n r.negative = a.negative;\n r._normalize();\n }\n\n if (flags & modes.EUCLID) {\n if (flags & modes.QUO) {\n assert((flags & modes.REM) !== 0);\n\n if (r.negative !== 0) {\n if (b.negative !== 0)\n q.iaddn(1);\n else\n q.isubn(1);\n }\n }\n\n if (flags & modes.REM) {\n if (r.negative !== 0) {\n if (b.negative !== 0)\n r.isub(b);\n else\n r.iadd(b);\n }\n }\n }\n\n return [q, r];\n }\n\n _wordDiv(num, flags) {\n let a = this.clone();\n let b = num;\n let q = null;\n let hi;\n\n // Normalize.\n const word = b.words[b.length - 1] | 0;\n const shift = 26 - countBits(word);\n\n if (shift !== 0) {\n b = b.clone();\n\n a.iushln(shift);\n b.iushln(shift);\n\n hi = b.words[b.length - 1] | 0;\n } else {\n hi = word;\n }\n\n // Initialize quotient.\n const m = a.length - b.length;\n\n assert(m >= 0);\n\n if (flags & modes.QUO) {\n q = new BN(0);\n q.length = m + 1;\n q.words = new Array(q.length);\n\n for (let i = 0; i < q.length; i++)\n q.words[i] = 0;\n }\n\n // Diff.\n const d = a.clone();\n\n d._ishlnsubmul(b, 1, m);\n\n if (d.negative === 0) {\n if (q)\n q.words[m] = 1;\n\n a = d;\n }\n\n // Divide.\n for (let j = m - 1; j >= 0; j--) {\n const ahi = a.words[b.length + j];\n const alo = a.words[b.length + j - 1];\n const quo = ((ahi * 0x4000000 + alo) / hi) | 0;\n\n let qj = Math.min(quo, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n\n while (a.negative !== 0) {\n qj -= 1;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n a.ineg();\n }\n\n if (q)\n q.words[j] = qj;\n }\n\n // Strip.\n if (q)\n q._strip();\n\n // Denormalize.\n // Note: we shouldn't need to strip `a` here.\n if ((flags & modes.REM) && shift !== 0)\n a.iushrn(shift);\n\n return [q, a];\n }\n\n _ishlnsubmul(num, mul, shift) {\n let carry = 0;\n let i = 0;\n\n this._expand(num.length + shift);\n\n for (; i < num.length; i++) {\n const k = (this.words[i + shift] | 0) + carry;\n const r = num.words[i] * mul;\n const w = k - (r & 0x3ffffff);\n\n carry = (w >> 26) - ((r / 0x4000000) | 0);\n\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n for (; i < this.length - shift; i++) {\n const w = (this.words[i + shift] | 0) + carry;\n\n carry = w >> 26;\n\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0)\n return this._strip();\n\n // Subtraction overflow.\n assert(carry === -1);\n\n carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = -(this.words[i] | 0) + carry;\n\n carry = w >> 26;\n\n this.words[i] = w & 0x3ffffff;\n }\n\n this.negative = 1;\n\n return this._strip();\n }\n\n /*\n * Truncation Division + Modulo\n */\n\n quorem(num) {\n return this._div(num, modes.BOTH);\n }\n\n /*\n * Truncation Division\n */\n\n iquo(num) {\n return this.quo(num)._move(this);\n }\n\n iquon(num) {\n enforce(isSMI(num), 'num', 'smi');\n nonzero(num !== 0);\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n let carry = 0;\n\n for (let i = this.length - 1; i >= 0; i--) {\n const w = (this.words[i] | 0) + carry * 0x4000000;\n\n this.words[i] = (w / num) | 0;\n\n carry = w % num;\n }\n\n this.negative ^= neg;\n\n return this._strip();\n }\n\n quo(num) {\n return this._div(num, modes.QUO)[0];\n }\n\n quon(num) {\n return this.clone().iquon(num);\n }\n\n /*\n * Truncation Modulo\n */\n\n irem(num) {\n return this.rem(num)._move(this);\n }\n\n iremn(num) {\n let m = this.remrn(num);\n\n if (m < 0)\n m = -m;\n\n this.words[0] = m;\n this.length = 1;\n\n return this._normalize();\n }\n\n rem(num) {\n return this._div(num, modes.REM)[1];\n }\n\n remn(num) {\n return this.clone().iremn(num);\n }\n\n remrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n nonzero(num !== 0);\n\n if (num < 0)\n num = -num;\n\n const p = (1 << 26) % num;\n\n let acc = 0;\n\n for (let i = this.length - 1; i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n\n return this.negative !== 0 ? (-acc | 0) : acc;\n }\n\n /*\n * Euclidean Division + Modulo\n */\n\n divmod(num) {\n return this._div(num, modes.BOTH | modes.EUCLID);\n }\n\n /*\n * Euclidean Division\n */\n\n idiv(num) {\n return this.div(num)._move(this);\n }\n\n idivn(num) {\n if (this.negative === 0)\n return this.iquon(num);\n\n const r = this.remrn(num);\n\n this.iquon(num);\n\n if (r < 0) {\n if (num < 0)\n this.iaddn(1);\n else\n this.isubn(1);\n }\n\n return this;\n }\n\n div(num) {\n return this._div(num, modes.BOTH | modes.EUCLID)[0];\n }\n\n divn(num) {\n return this.clone().idivn(num);\n }\n\n /*\n * Euclidean Modulo\n */\n\n imod(num) {\n if (this.ucmp(num) < 0) {\n if (this.negative !== 0) {\n this._isub(num, this);\n this.negative = 0;\n }\n return this;\n }\n\n return this.mod(num)._move(this);\n }\n\n imodn(num) {\n this.words[0] = this.modrn(num);\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n mod(num) {\n return this._div(num, modes.REM | modes.EUCLID)[1];\n }\n\n modn(num) {\n return this.clone().imodn(num);\n }\n\n modrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n let r = this.remrn(num);\n\n if (r < 0) {\n if (num < 0)\n r -= num;\n else\n r += num;\n }\n\n return r;\n }\n\n /*\n * Round Division\n */\n\n divRound(num) {\n const [q, r] = this.quorem(num);\n\n // Fast case - exact division.\n if (r.isZero())\n return q;\n\n const bit = num.words[0] & 1;\n\n num.iushrn(1);\n\n const cmp = r.ucmp(num);\n\n num.iushln(1);\n\n num.words[0] |= bit;\n\n // Round down.\n if (cmp < 0 || (num.isOdd() && cmp === 0))\n return q;\n\n // Round up.\n if (this.negative ^ num.negative)\n return q.isubn(1);\n\n return q.iaddn(1);\n }\n\n /*\n * Exponentiation\n */\n\n ipow(num) {\n return this.pow(num)._move(this);\n }\n\n ipown(num) {\n return this.pown(num)._move(this);\n }\n\n pow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let b = countBits(num.words[num.length - 1]);\n let r = new BN(1);\n\n for (let i = num.length - 1; i >= 0; i--) {\n const word = num.words[i];\n\n for (let j = b - 1; j >= 0; j--) {\n r = r.sqr();\n\n if ((word >> j) & 1)\n r = r.mul(this);\n }\n\n b = 26;\n }\n\n return r;\n }\n\n pown(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if (num < 0)\n num = -num;\n\n if (num === 0)\n return new BN(1);\n\n if (num === 1)\n return this.clone();\n\n const bits = countBits(num);\n\n let r = this;\n\n for (let i = bits - 2; i >= 0; i--) {\n r = r.sqr();\n\n if ((num >> i) & 1)\n r = r.mul(this);\n }\n\n return r;\n }\n\n isqr() {\n return this.imul(this);\n }\n\n sqr() {\n return this.mul(this);\n }\n\n /*\n * Roots Engine\n */\n\n _rootrem(pow, rem) {\n enforce((pow >>> 0) === pow, 'num', 'uint32');\n\n if (pow === 0)\n throw new RangeError('Zeroth root.');\n\n if (~pow & this.negative)\n throw new RangeError('Negative with even root.');\n\n if (this.ucmpn(1) <= 0)\n return [this.clone(), new BN(0)];\n\n let u = new BN(0);\n let t = BN.shift(1, this.bitLength() / pow + 1 | 0);\n let v, r;\n\n if (this.negative !== 0)\n t.ineg();\n\n if (pow === 2) {\n do {\n u = t;\n t = this.quo(u);\n t.iadd(u);\n t.iushrn(1);\n } while (t.ucmp(u) < 0);\n } else {\n do {\n u = t;\n t = u.pown(pow - 1);\n t = this.quo(t);\n v = u.muln(pow - 1);\n t.iadd(v);\n t = t.quon(pow);\n } while (t.ucmp(u) < 0);\n }\n\n if (rem) {\n t = u.pown(pow);\n r = this.sub(t);\n }\n\n return [u, r];\n }\n\n /*\n * Roots\n */\n\n rootrem(pow) {\n return this._rootrem(pow, 1);\n }\n\n iroot(pow) {\n return this.root(pow)._move(this);\n }\n\n root(pow) {\n return this._rootrem(pow, 0)[0];\n }\n\n isPower(pow) {\n enforce((pow >>> 0) === pow, 'num', 'uint32');\n\n if (pow === 0 || (~pow & this.negative))\n return false;\n\n const [, r] = this.rootrem(pow);\n\n return r.sign() === 0;\n }\n\n sqrtrem() {\n return this.rootrem(2);\n }\n\n isqrt() {\n return this.sqrt()._move(this);\n }\n\n sqrt() {\n return this.root(2);\n }\n\n isSquare() {\n return this.isPower(2);\n }\n\n /*\n * AND\n */\n\n iand(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y)\n return x;\n\n if ((x.negative | y.negative) === 0)\n return x.iuand(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) & (-y) == ~(x-1) & ~(y-1)\n // == ~((x-1) | (y-1))\n // == -(((x-1) | (y-1)) + 1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuor(y);\n x.isubn(1);\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n if (x.negative !== 0)\n [x, y] = [y.clone(), x];\n\n // x & (-y) == x & ~(y-1)\n // == x & ~(y-1)\n const width = x.bitLength();\n\n y.iaddn(1);\n y.inotn(width);\n x.iuand(y);\n y.inotn(width);\n y.isubn(1);\n\n return x._move(this);\n }\n\n iandn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.iand(new BN(num));\n\n this.words[0] &= num;\n this.length = 1;\n\n return this;\n }\n\n and(num) {\n return this.clone().iand(num);\n }\n\n andn(num) {\n return this.clone().iandn(num);\n }\n\n andrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0) {\n const n = this.iand(new BN(num));\n\n if (n.length > 1)\n throw new RangeError('Number exceeds 26 bits.');\n\n return n.negative !== 0 ? -n.words[0] : n.words[0];\n }\n\n return this.words[0] & num;\n }\n\n /*\n * Unsigned AND\n */\n\n iuand(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this.length = Math.min(this.length, num.length);\n\n for (let i = 0; i < this.length; i++)\n this.words[i] &= num.words[i];\n\n return this._strip();\n }\n\n iuandn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] &= Math.abs(num);\n this.length = 1;\n\n return this._normalize();\n }\n\n uand(num) {\n return this.clone().iuand(num);\n }\n\n uandn(num) {\n return this.clone().iuandn(num);\n }\n\n uandrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const n = this.words[0] & Math.abs(num);\n\n return this.negative !== 0 ? (-n | 0) : n;\n }\n\n /*\n * OR\n */\n\n ior(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y)\n return x;\n\n if ((x.negative | y.negative) === 0)\n return x.iuor(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) | (-y) == ~(x-1) | ~(y-1)\n // == ~((x-1) & (y-1))\n // == -(((x-1) & (y-1)) + 1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuand(y);\n x.isubn(1);\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n y = y.clone();\n\n if (x.negative !== 0)\n [x, y] = [y, x];\n\n // x | (-y) == x | ~(y-1)\n // == ~((y-1) & ~x)\n // == -(((y-1) & ~x) + 1)\n y.iaddn(1);\n x.inotn(y.bitLength());\n y.iuand(x);\n y.isubn(1);\n\n return y._move(this);\n }\n\n iorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.ior(new BN(num));\n\n this.words[0] |= num;\n\n return this;\n }\n\n or(num) {\n return this.clone().ior(num);\n }\n\n orn(num) {\n return this.clone().iorn(num);\n }\n\n /*\n * Unsigned OR\n */\n\n iuor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this._expand(num.length);\n\n for (let i = 0; i < num.length; i++)\n this.words[i] |= num.words[i];\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n iuorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] |= Math.abs(num);\n\n return this;\n }\n\n uor(num) {\n return this.clone().iuor(num);\n }\n\n uorn(num) {\n return this.clone().iuorn(num);\n }\n\n /*\n * XOR\n */\n\n ixor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y) {\n x.words[0] = 0;\n x.length = 1;\n x.negative = 0;\n return x;\n }\n\n if ((x.negative | y.negative) === 0)\n return x.iuxor(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) ^ (-y) == ~(x-1) ^ ~(y-1)\n // == (x-1) ^ (y-1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuxor(y);\n x.ineg();\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n if (x.negative !== 0)\n [x, y] = [y.clone(), x];\n\n // x ^ (-y) == x ^ ~(y-1)\n // == ~(x ^ (y-1))\n // == -((x ^ (y-1)) + 1)\n y.iaddn(1);\n x.iuxor(y);\n x.iaddn(1);\n x.ineg();\n y.isubn(1);\n\n return x._move(this);\n }\n\n ixorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.ixor(new BN(num));\n\n this.words[0] ^= num;\n\n return this;\n }\n\n xor(num) {\n return this.clone().ixor(num);\n }\n\n xorn(num) {\n return this.clone().ixorn(num);\n }\n\n /*\n * Unsigned XOR\n */\n\n iuxor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let a = this;\n let b = num;\n\n if (a.length < b.length)\n [a, b] = [b, a];\n\n let i = 0;\n\n for (; i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n\n if (a !== this) {\n this._alloc(a.length);\n\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n this.length = a.length;\n\n return this._strip();\n }\n\n iuxorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] ^= Math.abs(num);\n\n return this._normalize();\n }\n\n uxor(num) {\n return this.clone().iuxor(num);\n }\n\n uxorn(num) {\n return this.clone().iuxorn(num);\n }\n\n /*\n * NOT\n */\n\n inot() {\n if (this.negative !== 0) {\n // ~(-x) == ~(~(x-1)) == x-1\n this.ineg().isubn(1);\n } else {\n // ~x == -x-1 == -(x+1)\n this.iaddn(1).ineg();\n }\n return this;\n }\n\n not() {\n return this.clone().inot();\n }\n\n inotn(width) {\n enforce((width >>> 0) === width, 'width', 'uint32');\n\n const r = width % 26;\n\n let s = Math.ceil(width / 26);\n let i = 0;\n\n // Extend the buffer with leading zeroes.\n this._expand(s);\n\n if (r > 0)\n s -= 1;\n\n // Handle complete words.\n for (; i < s; i++)\n this.words[i] ^= 0x3ffffff;\n\n // Handle the residue.\n if (r > 0)\n this.words[i] ^= (1 << r) - 1;\n\n // And remove leading zeroes.\n return this._strip();\n }\n\n notn(width) {\n return this.clone().inotn(width);\n }\n\n /*\n * Left Shift\n */\n\n ishl(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.ishln(num.toNumber());\n }\n\n ishln(bits) {\n return this.iushln(bits);\n }\n\n shl(num) {\n return this.clone().ishl(num);\n }\n\n shln(bits) {\n return this.clone().ishln(bits);\n }\n\n /*\n * Unsigned Left Shift\n */\n\n iushl(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.iushln(num.toNumber());\n }\n\n iushln(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = bits % 26;\n const s = (bits - r) / 26;\n const mask = ((1 << r) - 1) << (26 - r);\n\n if (r !== 0) {\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const ncarry = this.words[i] & mask;\n const c = ((this.words[i] | 0) - ncarry) << r;\n\n this.words[i] = c | carry;\n\n carry = ncarry >>> (26 - r);\n }\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n }\n }\n\n if (s !== 0) {\n this._alloc(this.length + s);\n\n for (let i = this.length - 1; i >= 0; i--)\n this.words[i + s] = this.words[i];\n\n for (let i = 0; i < s; i++)\n this.words[i] = 0;\n\n this.length += s;\n }\n\n return this._strip();\n }\n\n ushl(num) {\n return this.clone().iushl(num);\n }\n\n ushln(bits) {\n return this.clone().iushln(bits);\n }\n\n /*\n * Right Shift Engine\n */\n\n _split(bits, output) {\n const r = bits % 26;\n const s = Math.min((bits - r) / 26, this.length);\n const mask = (1 << r) - 1;\n\n // Extended mode, copy masked part.\n if (output) {\n output._alloc(s);\n\n for (let i = 0; i < s; i++)\n output.words[i] = this.words[i];\n\n output.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all.\n } else if (this.length > s) {\n this.length -= s;\n for (let i = 0; i < this.length; i++)\n this.words[i] = this.words[i + s];\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n let carry = 0;\n\n if (r !== 0) {\n for (let i = this.length - 1; i >= 0; i--) {\n const word = this.words[i] | 0;\n\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n\n carry = word & mask;\n }\n }\n\n // Push carried bits as a mask.\n if (output) {\n if (carry !== 0) {\n output._alloc(output.length + 1);\n output.words[output.length++] = carry;\n } else {\n if (output.length === 0)\n output.words[output.length++] = 0;\n\n output._strip();\n }\n }\n\n return this._strip();\n }\n\n /*\n * Right Shift\n */\n\n ishr(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.ishrn(num.toNumber());\n }\n\n ishrn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (this.negative !== 0) {\n // (-x) >> y == ~(x-1) >> y\n // == ~((x-1) >> y)\n // == -(((x-1) >> y) + 1)\n this.iaddn(1);\n this.iushrn(bits);\n this.isubn(1);\n return this;\n }\n\n return this.iushrn(bits);\n }\n\n shr(num) {\n return this.clone().ishr(num);\n }\n\n shrn(bits) {\n return this.clone().ishrn(bits);\n }\n\n /*\n * Unsigned Right Shift\n */\n\n iushr(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.iushrn(num.toNumber());\n }\n\n iushrn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n return this._split(bits, null);\n }\n\n ushr(num) {\n return this.clone().iushr(num);\n }\n\n ushrn(bits) {\n return this.clone().iushrn(bits);\n }\n\n /*\n * Bit Manipulation\n */\n\n setn(bit, val) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n if (this.negative !== 0) {\n this.iaddn(1);\n this.usetn(bit, !val);\n this.isubn(1);\n return this;\n }\n\n return this.usetn(bit, val);\n }\n\n usetn(bit, val) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n this._expand(s + 1);\n\n if (val)\n this.words[s] |= (1 << r);\n else\n this.words[s] &= ~(1 << r);\n\n return this._strip();\n }\n\n testn(bit) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n // Fast case: bit is much higher than all existing words.\n if (this.length <= s)\n return this.negative;\n\n // Check bit and return.\n const w = this.words[s];\n const val = (w >> r) & 1;\n\n if (this.negative !== 0) {\n if (r > 0 && (w & ((1 << r) - 1)))\n return val ^ 1;\n\n let j = s;\n\n while (j--) {\n if (this.words[j] > 0)\n return val ^ 1;\n }\n }\n\n return val;\n }\n\n utestn(bit) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n // Fast case: bit is much higher than all existing words.\n if (this.length <= s)\n return 0;\n\n // Check bit and return.\n return (this.words[s] >> r) & 1;\n }\n\n imaskn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (this.negative !== 0) {\n this.iaddn(1);\n this.inotn(bits + 1);\n this.ineg();\n }\n\n return this.iumaskn(bits);\n }\n\n maskn(bits) {\n return this.clone().imaskn(bits);\n }\n\n iumaskn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = bits % 26;\n\n let s = (bits - r) / 26;\n\n if (this.length <= s)\n return this;\n\n if (r !== 0)\n s += 1;\n\n this.length = Math.min(s, this.length);\n\n if (r !== 0)\n this.words[this.length - 1] &= (1 << r) - 1;\n\n if (this.length === 0)\n this.words[this.length++] = 0;\n\n return this._strip();\n }\n\n umaskn(bits) {\n return this.clone().iumaskn(bits);\n }\n\n andln(num) {\n return this.words[0] & num;\n }\n\n bit(pos) {\n return this.utestn(pos);\n }\n\n bits(pos, width) {\n enforce((pos >>> 0) === pos, 'pos', 'uint32');\n enforce((width >>> 0) === width, 'width', 'uint32');\n enforce(width <= 26, 'width', 'width');\n\n const shift = pos % 26;\n const index = (pos - shift) / 26;\n\n if (index >= this.length)\n return 0;\n\n let bits = (this.words[index] >> shift) & ((1 << width) - 1);\n\n if (shift + width > 26 && index + 1 < this.length) {\n const more = shift + width - 26;\n const next = this.words[index + 1] & ((1 << more) - 1);\n\n bits |= next << (26 - shift);\n }\n\n return bits;\n }\n\n /*\n * Negation\n */\n\n ineg() {\n if (!this.isZero())\n this.negative ^= 1;\n\n return this;\n }\n\n neg() {\n return this.clone().ineg();\n }\n\n iabs() {\n this.negative = 0;\n return this;\n }\n\n abs() {\n return this.clone().iabs();\n }\n\n /*\n * Comparison\n */\n\n cmp(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative !== num.negative)\n return num.negative - this.negative;\n\n const res = this.ucmp(num);\n\n if (this.negative !== 0)\n return -res | 0;\n\n return res;\n }\n\n cmpn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (this.negative !== negative)\n return negative - this.negative;\n\n const res = this.ucmpn(num);\n\n if (this.negative !== 0)\n return -res | 0;\n\n return res;\n }\n\n eq(num) {\n return this.cmp(num) === 0;\n }\n\n eqn(num) {\n return this.cmpn(num) === 0;\n }\n\n gt(num) {\n return this.cmp(num) > 0;\n }\n\n gtn(num) {\n return this.cmpn(num) > 0;\n }\n\n gte(num) {\n return this.cmp(num) >= 0;\n }\n\n gten(num) {\n return this.cmpn(num) >= 0;\n }\n\n lt(num) {\n return this.cmp(num) < 0;\n }\n\n ltn(num) {\n return this.cmpn(num) < 0;\n }\n\n lte(num) {\n return this.cmp(num) <= 0;\n }\n\n lten(num) {\n return this.cmpn(num) <= 0;\n }\n\n sign() {\n if (this.negative !== 0)\n return -1;\n\n if (this.length === 1 && this.words[0] === 0)\n return 0;\n\n return 1;\n }\n\n isZero() {\n return this.length === 1 && this.words[0] === 0;\n }\n\n isNeg() {\n return this.negative !== 0;\n }\n\n isPos() {\n return this.negative === 0;\n }\n\n isOdd() {\n return (this.words[0] & 1) === 1;\n }\n\n isEven() {\n return (this.words[0] & 1) === 0;\n }\n\n /*\n * Unsigned Comparison\n */\n\n ucmp(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.length < num.length)\n return -1;\n\n if (this.length > num.length)\n return 1;\n\n for (let i = this.length - 1; i >= 0; i--) {\n const a = this.words[i] | 0;\n const b = num.words[i] | 0;\n\n if (a === b)\n continue;\n\n return (a > b) - (a < b);\n }\n\n return 0;\n }\n\n ucmpn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if (this.length > 1)\n return 1;\n\n const w = this.words[0] | 0;\n\n if (num < 0)\n num = -num;\n\n return (w > num) - (w < num);\n }\n\n /*\n * Number Theoretic Functions\n */\n\n legendre(num) {\n const red = HAS_BIGINT ? BN.red(num) : BN.mont(num);\n return this.toRed(red).redLegendre();\n }\n\n jacobi(num) {\n // See: A Binary Algorithm for the Jacobi Symbol\n // J. Shallit, J. Sorenson\n // Page 3, Section 3\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (num.isZero() || num.isEven())\n throw new Error('jacobi: `num` must be odd.');\n\n let a = this._cloneNormal();\n let b = num.clone();\n let j = 1;\n\n if (b.isNeg()) {\n if (a.isNeg())\n j = -1;\n b.ineg();\n }\n\n if (a.isNeg() || a.ucmp(b) >= 0)\n a.imod(b);\n\n while (!a.isZero()) {\n const bits = a._makeOdd();\n\n if (bits & 1) {\n const bmod8 = b.andln(7);\n\n if (bmod8 === 3 || bmod8 === 5)\n j = -j;\n }\n\n if (a.ucmp(b) < 0) {\n [a, b] = [b, a];\n\n if (a.andln(3) === 3 && b.andln(3) === 3)\n j = -j;\n }\n\n a._isub(a, b).iushrn(1);\n\n const bmod8 = b.andln(7);\n\n if (bmod8 === 3 || bmod8 === 5)\n j = -j;\n }\n\n if (b.cmpn(1) !== 0)\n return 0;\n\n return j;\n }\n\n kronecker(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero())\n return num.ucmpn(1) === 0 ? 1 : 0;\n\n if (num.isZero())\n return this.ucmpn(1) === 0 ? 1 : 0;\n\n if (((this.words[0] | num.words[0]) & 1) === 0)\n return 0;\n\n const x = this;\n const y = num.clone();\n const bits = y._makeOdd();\n const table = [0, 1, 0, -1, 0, -1, 0, 1];\n\n let k = x.jacobi(y);\n\n if (bits & 1)\n k *= table[x.andln(7)];\n\n return k | 0;\n }\n\n igcd(num) {\n return this.gcd(num)._move(this);\n }\n\n gcd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero())\n return num.abs();\n\n if (num.isZero())\n return this.abs();\n\n let a = this.clone();\n let b = num.clone();\n\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two.\n const shift = a._factor2(b);\n\n if (shift !== 0) {\n a.iushrn(shift);\n b.iushrn(shift);\n }\n\n for (;;) {\n a._makeOdd();\n b._makeOdd();\n\n const cmp = a.ucmp(b);\n\n if (cmp < 0) {\n // a > b\n [a, b] = [b, a];\n } else if (cmp === 0 || b.ucmpn(1) === 0) {\n // Break if a == b.\n // Break if b == 1 to avoid repeated subtraction.\n break;\n }\n\n a._isub(a, b);\n }\n\n return b.iushln(shift);\n }\n\n ilcm(num) {\n return this.lcm(num)._move(this);\n }\n\n lcm(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero() || num.isZero())\n return new BN(0);\n\n return this.quo(this.gcd(num)).mul(num).iabs();\n }\n\n egcd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero()) {\n return [\n new BN(0),\n new BN(num.sign()),\n num.abs()\n ];\n }\n\n if (num.isZero()) {\n return [\n new BN(this.sign()),\n new BN(0),\n this.abs()\n ];\n }\n\n const x = this.clone();\n const y = num.clone();\n\n x.negative = 0;\n y.negative = 0;\n\n // A * x + B * y = x\n const A = new BN(1);\n const B = new BN(0);\n\n // C * x + D * y = y\n const C = new BN(0);\n const D = new BN(1);\n\n // Remove common factor of two.\n const g = x._factor2(y);\n\n if (g > 0) {\n x.iushrn(g);\n y.iushrn(g);\n }\n\n const xp = x.clone();\n const yp = y.clone();\n\n while (!x.isZero()) {\n let i = x._makeOdd();\n let j = y._makeOdd();\n\n while (i--) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n\n while (j--) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n if (this.negative !== 0)\n C.ineg();\n\n if (num.negative !== 0)\n D.ineg();\n\n return [C, D, y.iushln(g)];\n }\n\n iinvert(num) {\n return this.invert(num)._move(this);\n }\n\n invert(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n range(num.sign() > 0, 'invert');\n\n if (num.isOdd())\n return this._invertp(num);\n\n if (num.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n const [s,, g] = this.egcd(num);\n\n if (g.cmpn(1) !== 0)\n throw new RangeError('Not invertible.');\n\n return s.imod(num);\n }\n\n ifermat(num) {\n return this.fermat(num)._move(this);\n }\n\n fermat(num) {\n const red = HAS_BIGINT ? BN.red(num) : BN.mont(num);\n return this.toRed(red).redFermat().fromRed();\n }\n\n ipowm(y, m, mont) {\n return this.powm(y, m, mont)._move(this);\n }\n\n powm(y, m, mont) {\n const red = !HAS_BIGINT && mont ? BN.mont(m) : BN.red(m);\n return this.toRed(red).redPow(y).fromRed();\n }\n\n ipowmn(y, m, mont) {\n return this.powmn(y, m, mont)._move(this);\n }\n\n powmn(y, m, mont) {\n const red = mont ? BN.mont(m) : BN.red(m);\n return this.toRed(red).redPown(y).fromRed();\n }\n\n isqrtm(p) {\n return this.sqrtm(p)._move(this);\n }\n\n sqrtm(p) {\n enforce(BN.isBN(p), 'p', 'bignum');\n\n let red;\n\n if (p.andln(3) === 3 || p.andln(7) === 5) {\n // Probably not worth the setup.\n red = BN.red(p);\n } else {\n red = BN.mont(p);\n }\n\n return this.toRed(red).redSqrt().fromRed();\n }\n\n isqrtpq(p, q) {\n return this.sqrtpq(p, q)._move(this);\n }\n\n sqrtpq(p, q) {\n const sp = this.sqrtm(p);\n const sq = this.sqrtm(q);\n const [mp, mq] = p.egcd(q);\n const lhs = sq.mul(mp).mul(p);\n const rhs = sp.mul(mq).mul(q);\n const n = p.mul(q);\n\n return lhs.iadd(rhs).imod(n);\n }\n\n /*\n * Primality Testing\n */\n\n isPrime(rng, reps, limit) {\n enforce((reps >>> 0) === reps, 'reps', 'uint32');\n\n if (!this.isPrimeMR(rng, reps + 1, true))\n return false;\n\n if (!this.isPrimeLucas(limit))\n return false;\n\n return true;\n }\n\n isPrimeMR(rng, reps, force2 = false) {\n enforce((reps >>> 0) === reps, 'reps', 'uint32');\n enforce(reps > 0, 'reps', 'integer');\n enforce(typeof force2 === 'boolean', 'force2', 'boolean');\n\n const n = this;\n\n if (n.cmpn(7) < 0) {\n return n.cmpn(2) === 0\n || n.cmpn(3) === 0\n || n.cmpn(5) === 0;\n }\n\n if (n.isEven())\n return false;\n\n const nm1 = n.subn(1);\n const nm3 = nm1.subn(2);\n const k = nm1.zeroBits();\n const q = nm1.ushrn(k);\n\n const red = BN.red(n);\n const rnm1 = nm1.toRed(red);\n const rone = new BN(1).toRed(red);\n\nnext:\n for (let i = 0; i < reps; i++) {\n let x;\n\n if (i === reps - 1 && force2) {\n x = new BN(2);\n } else {\n x = BN.random(rng, 0, nm3);\n x.iaddn(2);\n }\n\n let y = x.toRed(red).redPow(q);\n\n if (y.cmp(rone) === 0 || y.cmp(rnm1) === 0)\n continue;\n\n for (let j = 1; j < k; j++) {\n y = y.redSqr();\n\n if (y.cmp(rnm1) === 0)\n continue next;\n\n if (y.cmp(rone) === 0)\n return false;\n }\n\n return false;\n }\n\n return true;\n }\n\n isPrimeLucas(limit = 0) {\n enforce((limit >>> 0) === limit, 'limit', 'uint32');\n\n const n = this;\n\n // Ignore 0 and 1.\n if (n.cmpn(1) <= 0)\n return false;\n\n // Two is the only even prime.\n if (n.isEven())\n return n.cmpn(2) === 0;\n\n let p = 3;\n\n for (;;) {\n if (p > 10000) {\n // Thought to be impossible.\n throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`);\n }\n\n if (limit !== 0 && p > limit) {\n // Optional DoS limit.\n return false;\n }\n\n const d = new BN(p * p - 4);\n const j = d.jacobi(n);\n\n if (j === -1)\n break;\n\n if (j === 0)\n return n.cmpn(p + 2) === 0;\n\n if (p === 40) {\n if (n.isSquare())\n return false;\n }\n\n p += 1;\n }\n\n const s = n.addn(1);\n const r = s._makeOdd();\n\n let vk = new BN(2);\n let vk1 = new BN(p);\n\n for (let i = s.bitLength(); i >= 0; i--) {\n if (s.utestn(i)) {\n vk = vk.mul(vk1).isubn(p).imod(n);\n vk1 = vk1.sqr().isubn(2).imod(n);\n } else {\n vk1 = vk1.mul(vk).isubn(p).imod(n);\n vk = vk.sqr().isubn(2).imod(n);\n }\n }\n\n if (vk.cmpn(2) === 0 || vk.cmp(n.subn(2)) === 0) {\n const a = vk.muln(p).imod(n);\n const b = vk1.ushln(1).imod(n);\n\n if (a.cmp(b) === 0)\n return true;\n }\n\n for (let t = 0; t < r - 1; t++) {\n if (vk.isZero())\n return true;\n\n if (vk.cmpn(2) === 0)\n return false;\n\n vk = vk.sqr().isubn(2).imod(n);\n }\n\n return false;\n }\n\n /*\n * Twos Complement\n */\n\n toTwos(width) {\n if (this.negative !== 0)\n return this.abs().inotn(width).iaddn(1);\n\n return this.clone();\n }\n\n fromTwos(width) {\n enforce((width >>> 0) === width, 'width', 'uint32');\n range(width > 0, 'width');\n\n if (this.testn(width - 1))\n return this.notn(width).iaddn(1).ineg();\n\n return this.clone();\n }\n\n /*\n * Reduction Context\n */\n\n toRed(ctx) {\n enforce(ctx instanceof Red, 'ctx', 'reduction context');\n\n if (this.red)\n throw new Error('Already in reduction context.');\n\n return ctx.convertTo(this);\n }\n\n fromRed() {\n red(this.red, 'fromRed');\n return this.red.convertFrom(this);\n }\n\n forceRed(ctx) {\n enforce(ctx instanceof Red, 'ctx', 'reduction context');\n\n if (this.red) {\n if (!ctx.m.eq(this.red.m) || ctx.mont !== this.red.mont)\n throw new Error('Already in reduction context.');\n } else {\n range(this.negative === 0, 'red');\n range(this.ucmp(ctx.m) < 0, 'red');\n }\n\n return this.clone()._forceRed(ctx);\n }\n\n redIAdd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIAdd');\n return this.red.iadd(this, num);\n }\n\n redAdd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redAdd');\n return this.red.add(this, num);\n }\n\n redIAddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIAddn');\n return this.red.iaddn(this, num);\n }\n\n redAddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redAddn');\n return this.red.addn(this, num);\n }\n\n redISub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redISub');\n return this.red.isub(this, num);\n }\n\n redSub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redSub');\n return this.red.sub(this, num);\n }\n\n redISubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redISubn');\n return this.red.isubn(this, num);\n }\n\n redSubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redSubn');\n return this.red.subn(this, num);\n }\n\n redIMul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIMul');\n return this.red.imul(this, num);\n }\n\n redMul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redMul');\n return this.red.mul(this, num);\n }\n\n redIMuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIMuln');\n return this.red.imuln(this, num);\n }\n\n redMuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redMuln');\n return this.red.muln(this, num);\n }\n\n redIDiv(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIDiv');\n return this.red.idiv(this, num);\n }\n\n redDiv(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redDiv');\n return this.red.div(this, num);\n }\n\n redIDivn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIDivn');\n return this.red.idivn(this, num);\n }\n\n redDivn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redDivn');\n return this.red.divn(this, num);\n }\n\n redIPow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIPow');\n nonred(!num.red, 'redIPow');\n return this.red.ipow(this, num);\n }\n\n redPow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redPow');\n nonred(!num.red, 'redPow');\n return this.red.pow(this, num);\n }\n\n redIPown(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIPown');\n return this.red.ipown(this, num);\n }\n\n redPown(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redPown');\n return this.red.pown(this, num);\n }\n\n redISqr() {\n red(this.red, 'redISqr');\n return this.red.isqr(this);\n }\n\n redSqr() {\n red(this.red, 'redSqr');\n return this.red.sqr(this);\n }\n\n redISqrt() {\n red(this.red, 'redISqrt');\n return this.red.isqrt(this);\n }\n\n redSqrt() {\n red(this.red, 'redSqrt');\n return this.red.sqrt(this);\n }\n\n redIDivSqrt(v) {\n red(this.red, 'redIDivSqrt');\n return this.red.idivsqrt(this, v);\n }\n\n redDivSqrt(v) {\n red(this.red, 'redDivSqrt');\n return this.red.divsqrt(this, v);\n }\n\n redIsSquare() {\n red(this.red, 'redIsSquare');\n return this.red.isSquare(this);\n }\n\n redIShl(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIShl');\n nonred(!num.red, 'redIShl');\n return this.red.ishl(this, num);\n }\n\n redShl(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redShl');\n nonred(!num.red, 'redShl');\n return this.red.shl(this, num);\n }\n\n redIShln(num) {\n enforce((num >>> 0) === num, 'num', 'uint32');\n red(this.red, 'redIShln');\n return this.red.ishln(this, num);\n }\n\n redShln(num) {\n enforce((num >>> 0) === num, 'num', 'uint32');\n red(this.red, 'redShln');\n return this.red.shln(this, num);\n }\n\n redINeg() {\n red(this.red, 'redINeg');\n return this.red.ineg(this);\n }\n\n redNeg() {\n red(this.red, 'redNeg');\n return this.red.neg(this);\n }\n\n redEq(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redEq');\n return this.red.eq(this, num);\n }\n\n redEqn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redEqn');\n return this.red.eqn(this, num);\n }\n\n redIsHigh() {\n red(this.red, 'redIsHigh');\n return this.red.isHigh(this);\n }\n\n redIsLow() {\n red(this.red, 'redIsLow');\n return this.red.isLow(this);\n }\n\n redIsOdd() {\n red(this.red, 'redIsOdd');\n return this.red.isOdd(this);\n }\n\n redIsEven() {\n red(this.red, 'redIsEven');\n return this.red.isEven(this);\n }\n\n redLegendre() {\n red(this.red, 'redLegendre');\n return this.red.legendre(this);\n }\n\n redJacobi() {\n red(this.red, 'redJacobi');\n return this.red.jacobi(this);\n }\n\n redKronecker() {\n red(this.red, 'redKronecker');\n return this.red.kronecker(this);\n }\n\n redIInvert() {\n red(this.red, 'redIInvert');\n return this.red.iinvert(this);\n }\n\n redInvert() {\n red(this.red, 'redInvert');\n return this.red.invert(this);\n }\n\n redIFermat() {\n red(this.red, 'redIFermat');\n return this.red.ifermat(this);\n }\n\n redFermat() {\n red(this.red, 'redFermat');\n return this.red.fermat(this);\n }\n\n /*\n * Internal\n */\n\n _move(dest) {\n dest.words = this.words;\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n return dest;\n }\n\n _alloc(size) {\n while (this.words.length < size)\n this.words.push(0);\n\n return this;\n }\n\n _expand(size) {\n this._alloc(size);\n\n while (this.length < size)\n this.words[this.length++] = 0;\n\n return this;\n }\n\n _strip() {\n while (this.length > 1 && this.words[this.length - 1] === 0)\n this.length -= 1;\n\n return this._normalize();\n }\n\n _normalize() {\n assert(this.length > 0);\n\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0)\n this.negative = 0;\n\n return this;\n }\n\n _check() {\n // We never have a zero length number.\n assert(this.length > 0);\n\n // Cannot exceed array bounds.\n assert(this.length <= this.words.length);\n\n if (this.length === 1) {\n // Must be normalized.\n if (this.words[0] === 0)\n assert(this.negative === 0);\n return this;\n }\n\n // Must be stripped.\n assert(this.words[this.length - 1] !== 0);\n\n return this;\n }\n\n _invertp(p) {\n // Penk's right shift binary EGCD.\n //\n // See: The Art of Computer Programming,\n // Volume 2, Seminumerical Algorithms\n // Donald E. Knuth\n // Exercise 4.5.2.39\n enforce(BN.isBN(p), 'p', 'bignum');\n range(p.sign() > 0, 'invert');\n assert(p.isOdd());\n\n if (p.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n const a = this.clone();\n const b = p.clone();\n const u = new BN(1);\n const v = new BN(0);\n\n if (a.isNeg() || a.ucmp(b) >= 0)\n a.imod(b);\n\n while (!a.isZero()) {\n let i = a._makeOdd();\n let j = b._makeOdd();\n\n while (i--) {\n if (u.isOdd())\n u._iadd(u, p);\n\n u.iushrn(1);\n }\n\n while (j--) {\n if (v.isOdd())\n v._iadd(v, p);\n\n v.iushrn(1);\n }\n\n if (a.ucmp(b) >= 0) {\n a._isub(a, b);\n if (u.ucmp(v) < 0) {\n u._isub(v, u);\n u._isub(p, u);\n } else {\n u._isub(u, v);\n }\n } else {\n b._isub(b, a);\n if (v.ucmp(u) < 0) {\n v._isub(u, v);\n v._isub(p, v);\n } else {\n v._isub(v, u);\n }\n }\n }\n\n if (b.cmpn(1) !== 0)\n throw new RangeError('Not invertible.');\n\n assert(v.negative === 0);\n assert(v.ucmp(p) < 0);\n\n return v;\n }\n\n _makeOdd() {\n const shift = this.zeroBits();\n\n if (shift > 0)\n this.iushrn(shift);\n\n return shift;\n }\n\n _factor2(num) {\n // Find common factor of two.\n // Expects inputs to be non-zero.\n if ((this.words[0] | num.words[0]) & 1)\n return 0;\n\n const len = Math.min(this.length, num.length);\n\n let r = 0;\n\n for (let i = 0; i < len; i++) {\n const b = zeroBits(this.words[i] | num.words[i]);\n\n r += b;\n\n if (b !== 26)\n break;\n }\n\n return r;\n }\n\n _cloneNormal() {\n return this.red ? this.fromRed() : this.clone();\n }\n\n _forceRed(ctx) {\n this.red = ctx;\n return this;\n }\n\n /*\n * Helpers\n */\n\n clone() {\n const copy = new BN();\n\n copy.words = new Array(this.length);\n\n for (let i = 0; i < this.length; i++)\n copy.words[i] = this.words[i];\n\n copy.length = this.length;\n copy.negative = this.negative;\n copy.red = this.red;\n\n return copy;\n }\n\n inject(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this._alloc(num.length);\n\n for (let i = 0; i < num.length; i++)\n this.words[i] = num.words[i];\n\n this.length = num.length;\n this.negative = num.negative;\n this.red = num.red;\n\n return this;\n }\n\n set(num, endian) {\n return this.fromNumber(num, endian);\n }\n\n swap(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n const x = this;\n const y = num;\n\n [x.words, y.words] = [y.words, x.words];\n [x.length, y.length] = [y.length, x.length];\n [x.negative, y.negative] = [y.negative, x.negative];\n [x.red, y.red] = [y.red, x.red];\n\n return x;\n }\n\n reverse() {\n const neg = this.negative;\n\n this.fromBuffer(this.toBuffer('be'), 'le');\n this.negative = neg;\n\n return this;\n }\n\n byteLength() {\n return Math.ceil(this.bitLength() / 8);\n }\n\n bitLength() {\n const w = this.words[this.length - 1];\n const hi = countBits(w);\n return (this.length - 1) * 26 + hi;\n }\n\n zeroBits() {\n if (this.isZero())\n return 0;\n\n if (this.isOdd())\n return 0;\n\n let r = 0;\n\n for (let i = 0; i < this.length; i++) {\n const b = zeroBits(this.words[i]);\n\n r += b;\n\n if (b !== 26)\n break;\n }\n\n return r;\n }\n\n isSafe() {\n if (this.length <= 2)\n return true;\n\n if (this.length === 3 && this.words[2] === 0x01)\n return true;\n\n return false;\n }\n\n word(pos) {\n enforce((pos >>> 0) === pos, 'pos', 'uint32');\n\n if (pos >= this.length)\n return 0;\n\n return this.words[pos];\n }\n\n [custom]() {\n let prefix = 'BN';\n\n if (this.red)\n prefix = 'BN-R';\n\n return `<${prefix}: ${this.toString(10)}>`;\n }\n\n /*\n * Conversion\n */\n\n toNumber() {\n let num = this.words[0];\n\n if (this.length === 2) {\n num += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // Note: at this stage it is known that the top bit is set.\n num += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n throw new RangeError('Number can only safely store up to 53 bits.');\n }\n\n return this.negative !== 0 ? -num : num;\n }\n\n toDouble() {\n let num = 0;\n\n for (let i = this.length - 1; i >= 0; i--)\n num = (num * 0x4000000) + this.words[i];\n\n return this.negative !== 0 ? -num : num;\n }\n\n valueOf() {\n return this.toDouble();\n }\n\n toBigInt() {\n if (!HAS_BIGINT)\n throw new Error('BigInt is not supported!');\n\n const s52 = BigInt(52);\n const s26 = BigInt(26);\n\n let i = this.length - 1;\n let num = BigInt(0);\n\n for (; i >= 1; i -= 2) {\n const hi = this.words[i] * 0x4000000;\n const lo = this.words[i - 1];\n\n num = (num << s52) | BigInt(hi + lo);\n }\n\n if (i >= 0)\n num = (num << s26) | BigInt(this.words[0]);\n\n return this.negative !== 0 ? -num : num;\n }\n\n toBool() {\n return !this.isZero();\n }\n\n toString(base, padding) {\n base = getBase(base);\n\n if (padding == null)\n padding = 0;\n\n if (padding === 0)\n padding = 1;\n\n enforce((base >>> 0) === base, 'base', 'uint32');\n enforce((padding >>> 0) === padding, 'padding', 'uint32');\n\n if (base < 2 || base > 36)\n throw new RangeError('Base ranges between 2 and 36.');\n\n this._check();\n\n if (base === 16) {\n let out = '';\n let off = 0;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = this.words[i];\n const word = (((w << off) | carry) & 0xffffff).toString(16);\n\n carry = (w >>> (24 - off)) & 0xffffff;\n\n if (carry !== 0 || i !== this.length - 1)\n out = zeros[6 - word.length] + word + out;\n else\n out = word + out;\n\n off += 2;\n\n if (off >= 26) {\n off -= 26;\n i -= 1;\n }\n }\n\n if (carry !== 0)\n out = carry.toString(16) + out;\n\n while (out.length % padding !== 0)\n out = '0' + out;\n\n if (this.negative !== 0)\n out = '-' + out;\n\n return out;\n }\n\n const groupSize = groupSizes[base - 1];\n const groupBase = groupBases[base - 1];\n const c = this.clone();\n\n let out = '';\n\n c.negative = 0;\n\n while (!c.isZero()) {\n const r = c.remrn(groupBase).toString(base);\n\n c.iquon(groupBase);\n\n if (!c.isZero())\n out = zeros[groupSize - r.length] + r + out;\n else\n out = r + out;\n }\n\n if (this.isZero())\n out = '0';\n\n while (out.length % padding !== 0)\n out = '0' + out;\n\n if (this.negative !== 0)\n out = '-' + out;\n\n return out;\n }\n\n toJSON() {\n return this.toString(16, 2);\n }\n\n toArray(endian, length) {\n return this.toArrayLike(Array, endian, length);\n }\n\n toBuffer(endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n }\n\n toArrayLike(ArrayType, endian, length) {\n if (endian == null)\n endian = 'be';\n\n if (length == null)\n length = 0;\n\n enforce(typeof ArrayType === 'function', 'ArrayType', 'function');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n enforce((length >>> 0) === length, 'length', 'uint32');\n\n this._check();\n\n const bytes = this.byteLength();\n const size = length || Math.max(1, bytes);\n\n if (bytes > size)\n throw new RangeError('Byte array longer than desired length.');\n\n const res = allocate(ArrayType, size);\n\n // See: https://github.com/indutny/bn.js/pull/222\n if (endian === 'be') {\n let pos = res.length - 1;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const shift = (i & 3) << 1;\n const word = (this.words[i] << shift) | carry;\n\n res[pos--] = word & 0xff;\n\n if (pos >= 0)\n res[pos--] = (word >>> 8) & 0xff;\n\n if (pos >= 0)\n res[pos--] = (word >>> 16) & 0xff;\n\n if (shift === 6) {\n if (pos >= 0)\n res[pos--] = (word >>> 24) & 0xff;\n\n carry = 0;\n } else {\n carry = word >>> 24;\n }\n }\n\n if (pos >= 0) {\n res[pos--] = carry;\n\n while (pos >= 0)\n res[pos--] = 0;\n\n carry = 0;\n }\n\n assert(carry === 0);\n } else {\n let pos = 0;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const shift = (i & 3) << 1;\n const word = (this.words[i] << shift) | carry;\n\n res[pos++] = word & 0xff;\n\n if (pos < res.length)\n res[pos++] = (word >>> 8) & 0xff;\n\n if (pos < res.length)\n res[pos++] = (word >>> 16) & 0xff;\n\n if (shift === 6) {\n if (pos < res.length)\n res[pos++] = (word >>> 24) & 0xff;\n\n carry = 0;\n } else {\n carry = word >>> 24;\n }\n }\n\n if (pos < res.length) {\n res[pos++] = carry;\n\n while (pos < res.length)\n res[pos++] = 0;\n\n carry = 0;\n }\n\n assert(carry === 0);\n }\n\n return res;\n }\n\n encode(endian, length) {\n return this.toBuffer(endian, length);\n }\n\n /*\n * Instantiation\n */\n\n of(num, endian) {\n return this.fromNumber(num, endian);\n }\n\n fromNumber(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(isInteger(num), 'num', 'integer');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n if (num < 0x4000000) {\n this.words[0] = num & 0x3ffffff;\n this.length = 1;\n } else if (num < 0x10000000000000) {\n this.words = [\n num & 0x3ffffff,\n (num / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n this.words = [\n num & 0x3ffffff,\n (num / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n this.negative = neg;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromDouble(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(typeof num === 'number', 'num', 'double');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (!isFinite(num))\n num = 0;\n\n const neg = (num <= -1) | 0;\n\n if (num < 0)\n num = -num;\n\n num = Math.floor(num);\n\n this.words = [];\n\n while (num > 0) {\n const lo = num % 0x4000000;\n const hi = (num - lo) / 0x4000000;\n\n this.words.push(lo);\n\n num = hi;\n }\n\n if (this.words.length === 0)\n this.words.push(0);\n\n this.length = this.words.length;\n this.negative = neg;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromBigInt(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(typeof num === 'bigint', 'num', 'bigint');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (!HAS_BIGINT)\n throw new Error('BigInt is not supported!');\n\n // You know the implementation has a\n // problem when strings are twice\n // as fast as bigints.\n const start = (num < BigInt(0)) | 0;\n\n this._fromHex(num.toString(16), start);\n this.negative = start;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromBool(value) {\n enforce(typeof value === 'boolean', 'value', 'boolean');\n\n this.words[0] = value | 0;\n this.length = 1;\n this.negative = 0;\n\n return this;\n }\n\n fromString(str, base, endian) {\n if (base === 'le' || base === 'be')\n [base, endian] = [endian, base];\n\n base = getBase(base);\n\n if (endian == null)\n endian = 'be';\n\n enforce(typeof str === 'string', 'string', 'string');\n enforce((base >>> 0) === base, 'base', 'uint32');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (base < 2 || base > 36)\n throw new Error('Base ranges between 2 and 36.');\n\n str = str.replace(/\\s+/g, '');\n\n let start = 0;\n\n if (str.length > 0 && str.charCodeAt(0) === 0x2d)\n start = 1;\n\n if (base === 16)\n this._fromHex(str, start);\n else\n this._fromBase(str, base, start);\n\n this.negative = start;\n\n this._normalize();\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n _fromHex(str, start) {\n this.length = Math.max(2, Math.ceil((str.length - start) / 6));\n this.words = new Array(this.length);\n\n for (let i = 0; i < this.length; i++)\n this.words[i] = 0;\n\n // Scan 24-bit chunks and add them to the number.\n let off = 0;\n let i = str.length - 6;\n let j = 0;\n\n for (; i >= start; i -= 6) {\n const w = parseHex(str, i, i + 6);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n\n // `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb.\n this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n if (i + 6 !== start) {\n const w = parseHex(str, start, i + 6);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff;\n }\n\n return this._strip();\n }\n\n _fromBase(str, base, start) {\n // Initialize as zero.\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n\n // Find length of limb in base.\n let limbLen = 0;\n let limbPow = 1;\n\n for (; limbPow <= 0x3ffffff; limbPow *= base)\n limbLen += 1;\n\n limbLen -= 1;\n limbPow = (limbPow / base) | 0;\n\n const total = str.length - start;\n const mod = total % limbLen;\n const end = Math.min(total, total - mod) + start;\n\n let i = start;\n\n for (; i < end; i += limbLen) {\n const word = parseBase(str, i, i + limbLen, base);\n\n this.imuln(limbPow);\n this._iaddn(word);\n }\n\n if (mod !== 0) {\n const pow = Math.pow(base, mod);\n const word = parseBase(str, i, str.length, base);\n\n this.imuln(pow);\n this._iaddn(word);\n }\n\n return this;\n }\n\n fromJSON(json) {\n if (BN.isBN(json)) {\n if (json.red)\n return json.fromRed();\n\n return json.clone();\n }\n\n if (Array.isArray(json)) {\n for (const chunk of json)\n enforce(typeof chunk === 'string', 'chunk', 'string');\n\n json = json.join('');\n }\n\n return this.fromString(json, 16);\n }\n\n fromBN(num) {\n return this.inject(num);\n }\n\n fromArray(data, endian) {\n enforce(Array.isArray(data), 'data', 'array');\n return this.fromArrayLike(data, endian);\n }\n\n fromBuffer(data, endian) {\n enforce(Buffer.isBuffer(data), 'data', 'buffer');\n return this.fromArrayLike(data, endian);\n }\n\n fromArrayLike(data, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(data && (data.length >>> 0) === data.length, 'data', 'array-like');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (data.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n this.length = Math.max(2, Math.ceil(data.length / 3));\n this.words = new Array(this.length);\n this.negative = 0;\n\n for (let i = 0; i < this.length; i++)\n this.words[i] = 0;\n\n const left = data.length % 3;\n\n let off = 0;\n let j = 0;\n let w = 0;\n\n if (endian === 'be') {\n for (let i = data.length - 1; i >= 2; i -= 3) {\n const w = data[i] | (data[i - 1] << 8) | (data[i - 2] << 16);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n switch (left) {\n case 2:\n w = data[1] | (data[0] << 8);\n break;\n case 1:\n w = data[0];\n break;\n }\n } else {\n const len = data.length - left;\n\n for (let i = 0; i < len; i += 3) {\n const w = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n switch (left) {\n case 2:\n w = data[len] | (data[len + 1] << 8);\n break;\n case 1:\n w = data[len];\n break;\n }\n }\n\n if (left > 0) {\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n }\n\n return this._strip();\n }\n\n decode(data, endian) {\n return this.fromBuffer(data, endian);\n }\n\n from(num, base, endian) {\n if (num == null)\n return this;\n\n if (base === 'le' || base === 'be')\n [base, endian] = [endian, base];\n\n if (typeof num === 'number')\n return this.fromNumber(num, endian);\n\n if (typeof num === 'bigint')\n return this.fromBigInt(num, endian);\n\n if (typeof num === 'string')\n return this.fromString(num, base, endian);\n\n if (typeof num === 'object') {\n if (BN.isBN(num))\n return this.fromBN(num, endian);\n\n if ((num.length >>> 0) === num.length)\n return this.fromArrayLike(num, endian);\n }\n\n if (typeof num === 'boolean')\n return this.fromBool(num);\n\n throw new TypeError('Non-numeric object passed to BN.');\n }\n\n /*\n * Static Methods\n */\n\n static min(...args) {\n let min = null;\n\n for (const num of args) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (!min || num.cmp(min) < 0)\n min = num;\n }\n\n return min || new BN(0);\n }\n\n static max(...args) {\n let max = null;\n\n for (const num of args) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (!max || num.cmp(max) > 0)\n max = num;\n }\n\n return max || new BN(0);\n }\n\n static cmp(a, b) {\n enforce(BN.isBN(a), 'a', 'bignum');\n return a.cmp(b);\n }\n\n static ucmp(a, b) {\n enforce(BN.isBN(a), 'a', 'bignum');\n return a.ucmp(b);\n }\n\n static red(num) {\n return new Red(num);\n }\n\n static barrett(num) {\n return new Barrett(num);\n }\n\n static mont(num) {\n return new Mont(num);\n }\n\n static _prime(name) {\n if (primes[name])\n return primes[name];\n\n let prime;\n\n if (name === 'p192')\n prime = new P192();\n else if (name === 'p224')\n prime = new P224();\n else if (name === 'p521')\n prime = new P521();\n else if (name === 'k256')\n prime = new K256();\n else if (name === 'p251')\n prime = new P251();\n else if (name === 'p25519')\n prime = new P25519();\n else if (name === 'p448')\n prime = new P448();\n else\n throw new Error(`Unknown prime: \"${name}\".`);\n\n primes[name] = prime;\n\n return prime;\n }\n\n static prime(name) {\n return BN._prime(name).p.clone();\n }\n\n static pow(num, exp) {\n if (num === 2)\n return BN.shift(1, exp);\n\n return new BN().fromNumber(num).pown(exp);\n }\n\n static shift(num, bits) {\n if (num === 1)\n return new BN(0).usetn(bits, 1);\n\n return new BN().fromNumber(num).ishln(bits);\n }\n\n static mask(bits) {\n return BN.shift(1, bits).isubn(1);\n }\n\n static randomBits(rng, bits) {\n enforce(rng != null, 'rng', 'rng');\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (typeof rng === 'object') {\n enforce(typeof rng.randomBytes === 'function', 'rng', 'rng');\n\n const size = (bits + 7) >>> 3;\n const total = size * 8;\n const bytes = rng.randomBytes(size);\n\n enforce(Buffer.isBuffer(bytes), 'bytes', 'buffer');\n\n if (bytes.length !== size)\n throw new RangeError('Invalid number of bytes returned from RNG.');\n\n const num = BN.fromBuffer(bytes);\n\n if (total > bits)\n num.iushrn(total - bits);\n\n return num;\n }\n\n enforce(typeof rng === 'function', 'rng', 'rng');\n\n const num = rng(bits);\n\n enforce(BN.isBN(num), 'num', 'bignum');\n range(num.negative === 0, 'RNG');\n nonred(!num.red, 'RNG');\n\n if (num.bitLength() > bits)\n throw new RangeError('Invalid number of bits returned from RNG.');\n\n return num;\n }\n\n static random(rng, min, max) {\n min = BN.cast(min, 16);\n max = BN.cast(max, 16);\n\n if (min.cmp(max) > 0)\n throw new RangeError('Minimum cannot be greater than maximum.');\n\n const space = max.sub(min).iabs();\n const bits = space.bitLength();\n\n if (bits === 0)\n return min.clone();\n\n for (;;) {\n const num = BN.randomBits(rng, bits);\n\n // Maximum is _exclusive_!\n if (num.cmp(space) >= 0)\n continue;\n\n // Minimum is _inclusive_!\n num.iadd(min);\n\n return num;\n }\n }\n\n static of(num, endian) {\n return new BN().of(num, endian);\n }\n\n static fromNumber(num, endian) {\n return new BN().fromNumber(num, endian);\n }\n\n static fromDouble(num, endian) {\n return new BN().fromDouble(num, endian);\n }\n\n static fromBigInt(num, endian) {\n return new BN().fromBigInt(num, endian);\n }\n\n static fromBool(value) {\n return new BN().fromBool(value);\n }\n\n static fromString(str, base, endian) {\n return new BN().fromString(str, base, endian);\n }\n\n static fromJSON(json) {\n return new BN().fromJSON(json);\n }\n\n static fromBN(num) {\n return new BN().fromBN(num);\n }\n\n static fromArray(data, endian) {\n return new BN().fromArray(data, endian);\n }\n\n static fromBuffer(data, endian) {\n return new BN().fromBuffer(data, endian);\n }\n\n static fromArrayLike(data, endian) {\n return new BN().fromArrayLike(data, endian);\n }\n\n static decode(data, endian) {\n return new BN().decode(data, endian);\n }\n\n static from(num, base, endian) {\n return new BN().from(num, base, endian);\n }\n\n static cast(num, base, endian) {\n if (BN.isBN(num))\n return num;\n\n return new BN(num, base, endian);\n }\n\n static isBN(obj) {\n return obj instanceof BN;\n }\n}\n\n/*\n * Static\n */\n\nBN.BN = BN;\nBN.wordSize = 26;\nBN.native = 0;\n\n/**\n * Prime\n */\n\nclass Prime {\n constructor(name, p) {\n // P = 2^N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = BN.shift(1, this.n).isub(this.p);\n this.lo = this.p.clone();\n this.one = this.p.clone();\n }\n\n ireduce(num) {\n // Assumes that `num` is less than `P^2`:\n // num = HI * (2^N - K) + HI * K + LO = HI * K + LO (mod P)\n const neg = num.negative !== 0;\n\n // Track bits.\n let bits = num.bitLength();\n\n // Must be less than P^2.\n assert(bits <= this.n * 2);\n\n // Ensure positive.\n num.negative = 0;\n\n // Reduce.\n while (bits > this.n) {\n // lo = num & ((1 << n) - 1)\n // num = num >> n\n this.split(num, this.lo);\n\n // num = num * K\n this.imulK(num);\n\n // num = num + lo\n num._iadd(num, this.lo);\n\n // bits = bitlen(num)\n bits = num.bitLength();\n }\n\n // Final reduction.\n const cmp = bits < this.n ? -1 : num.ucmp(this.p);\n\n if (cmp === 0) {\n num.words[0] = 0;\n num.length = 1;\n } else if (cmp > 0) {\n num._isub(num, this.p);\n } else {\n // Note: we shouldn't need to strip here.\n }\n\n // Adjust sign.\n if (neg && !num.isZero())\n num._isub(this.p, num);\n\n return num;\n }\n\n split(input, out) {\n input._split(this.n, out);\n }\n\n imulK(num) {\n return num.imul(this.k);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n throw new Error('Not implemented.');\n }\n\n fermat(x) {\n return this.pm2(x);\n }\n}\n\n/**\n * Prime (3 mod 4)\n */\n\nclass Prime34 extends Prime {\n constructor(name, p) {\n super(name, p);\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n throw new Error('Not implemented.');\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // r = x^((p + 1) / 4) mod p\n const {red} = x;\n const r = this.pp1d4(x);\n\n if (!red.sqr(r).eq(x))\n throw new SquareRootError(r);\n\n return r;\n }\n\n divsqrt(u, v) {\n // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p\n const {red} = u;\n const u2 = red.sqr(u);\n const u3 = red.mul(u2, u);\n const u5 = red.mul(u3, u2);\n const v3 = red.mul(red.sqr(v), v);\n const p = this.pm3d4(red.mul(u5, v3));\n const x = red.mul(red.mul(u3, v), p);\n const c = red.mul(v, red.sqr(x));\n\n if (c.eq(u))\n return x;\n\n throw new SquareRootError(x);\n }\n}\n\n/**\n * Prime (5 mod 8)\n */\n\nclass Prime58 extends Prime {\n constructor(name, p, sm1) {\n super(name, p);\n\n this.sm1 = new BN(sm1, 16);\n }\n\n pm5d8(x1) {\n // Exponent: (p - 5) / 8\n throw new Error('Not implemented.');\n }\n\n pp3d8(x1) {\n // Exponent: (p + 3) / 8\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // r = x^((p + 3) / 8) mod p\n const {red} = x;\n const sm1 = this.sm1._forceRed(red);\n const r = this.pp3d8(x);\n\n if (red.sqr(r).eq(x))\n return r;\n\n const c = red.mul(r, sm1);\n\n if (red.sqr(c).eq(x))\n return c;\n\n throw new SquareRootError(r);\n }\n\n divsqrt(u, v) {\n // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p\n const {red} = u;\n const sm1 = this.sm1._forceRed(red);\n const v3 = red.mul(red.sqr(v), v);\n const v7 = red.mul(red.sqr(v3), v);\n const p = this.pm5d8(red.mul(u, v7));\n const x = red.mul(red.mul(u, v3), p);\n const c = red.mul(v, red.sqr(x));\n\n if (c.eq(u))\n return x;\n\n const mc = red.ineg(c);\n\n if (mc.eq(u))\n return red.mul(x, sm1);\n\n if (mc.eq(red.mul(u, sm1)))\n throw new SquareRootError(red.mul(x, sm1));\n\n throw new SquareRootError(x);\n }\n}\n\n/**\n * Prime (1 mod 16)\n */\n\nclass Prime116 extends Prime {\n constructor(name, p, g) {\n super(name, p);\n\n this.g = new BN(g, 16);\n this.z = this.p.subn(1).zeroBits();\n }\n\n powS(x1) {\n // Exponent: (p - 1) / 2^k\n throw new Error('Not implemented.');\n }\n\n powE(x1) {\n // Exponent: (s + 1) / 2\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // Tonelli-Shanks (variable time).\n //\n // Constants:\n //\n // k = factors of 2 for (p - 1)\n // s = (p - 1) / 2^k\n // e = (s + 1) / 2\n // n = first non-square in F(p)\n //\n // Algorithm:\n //\n // g = n^s mod p\n // y = x^e mod p\n // b = x^s mod p\n //\n // loop:\n // t = b\n // m = 0\n //\n // while t != 1:\n // t = t^2 mod p\n // m += 1\n //\n // if m == 0:\n // break\n //\n // if m >= k:\n // fail\n //\n // t = g^(2^(k - m - 1)) mod p\n // g = t^2 mod p\n // y = y * t mod p\n // b = b * g mod p\n // k = m\n //\n // return y\n //\n const {red} = x;\n\n switch (red.jacobi(x)) {\n case -1:\n throw new SquareRootError(x);\n case 0:\n return x.clone();\n case 1:\n break;\n }\n\n let g = this.g._forceRed(red);\n let y = this.powE(x);\n let b = this.powS(x);\n let k = this.z;\n\n for (;;) {\n let t = b;\n let m = 0;\n\n while (t.cmpn(1) !== 0 && m < k) {\n t = red.sqr(t);\n m += 1;\n }\n\n if (m === 0)\n break;\n\n assert(m < k);\n\n t = red.sqrn(g, k - m - 1);\n g = red.sqr(t);\n y = red.mul(y, t);\n b = red.mul(b, g);\n k = m;\n }\n\n return y;\n }\n\n divsqrt(u, v) {\n const {red} = u;\n\n if (v.isZero())\n throw new SquareRootError(v);\n\n return this.sqrt(red.div(u, v));\n }\n}\n\n/**\n * P192\n */\n\nclass P192 extends Prime34 {\n constructor() {\n // 2^192 - 2^64 - 1 (= 3 mod 4)\n super('p192', 'ffffffff ffffffff ffffffff fffffffe'\n + 'ffffffff ffffffff');\n }\n\n imulK(num) {\n // K = 0x10000000000000001\n // K = 2^64 + 1\n const one = this.one.inject(num);\n return num.iushln(64)._iadd(num, one);\n }\n\n core(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 127x1 1x0 62x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x30 = red.sqrnmul(x24, 6, x6);\n const x31 = red.sqrnmul(x30, 1, x1);\n const x62 = red.sqrnmul(x31, 31, x31);\n const x124 = red.sqrnmul(x62, 62, x62);\n const x127 = red.sqrnmul(x124, 3, x3);\n const r0 = red.sqrn(x127, 1);\n const r1 = red.sqrnmul(r0, 62, x62);\n\n return r1;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 127x1 1x0 62x1\n return this.core(x1);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 127x1 1x0 62x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 128x1 62x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x4 = red.sqrnmul(x2, 2, x2);\n const x8 = red.sqrnmul(x4, 4, x4);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n const r0 = red.sqrn(x128, 62);\n\n return r0;\n }\n}\n\n/**\n * P224\n */\n\nclass P224 extends Prime116 {\n constructor() {\n // 2^224 - 2^96 + 1 (1 mod 16)\n super('p224', 'ffffffff ffffffff ffffffff ffffffff'\n + '00000000 00000000 00000001',\n '6a0fec67 8598a792 0c55b2d4 0b2d6ffb'\n + 'bea3d8ce f3fb3632 dc691b74');\n }\n\n imulK(num) {\n // K = 0xffffffffffffffffffffffff\n // K = 2^96 - 1\n const one = this.one.inject(num);\n return num.iushln(96)._isub(num, one);\n }\n\n powS(x1) {\n // Exponent: 2^128 - 1\n // Bits: 128x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x4 = red.sqrnmul(x2, 2, x2);\n const x8 = red.sqrnmul(x4, 4, x4);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n\n return x128;\n }\n\n powE(x1) {\n // Exponent: 2^127\n // Bits: 1x1 127x0\n const {red} = x1;\n const r0 = red.sqrn(x1, 127);\n\n return r0;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 127x1 1x0 96x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x48 = red.sqrnmul(x24, 24, x24);\n const x96 = red.sqrnmul(x48, 48, x48);\n const x120 = red.sqrnmul(x96, 24, x24);\n const x126 = red.sqrnmul(x120, 6, x6);\n const x127 = red.sqrnmul(x126, 1, x1);\n const r0 = red.sqrn(x127, 1);\n const r1 = red.sqrnmul(r0, 96, x96);\n\n return r1;\n }\n}\n\n/**\n * P521\n */\n\nclass P521 extends Prime34 {\n constructor() {\n // 2^521 - 1 (= 3 mod 4)\n super('p521', '000001ff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff');\n }\n\n imulK(num) {\n // K = 0x01\n return num;\n }\n\n core(x1) {\n // Exponent: 2^519 - 1\n // Bits: 519x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x7 = red.sqrnmul(x6, 1, x1);\n const x8 = red.sqrnmul(x7, 1, x1);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n const x256 = red.sqrnmul(x128, 128, x128);\n const x512 = red.sqrnmul(x256, 256, x256);\n const x519 = red.sqrnmul(x512, 7, x7);\n\n return x519;\n }\n\n pm3d4(x1) {\n // Exponent: 2^519 - 1\n // Bits: 519x1\n return this.core(x1);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 519x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 1x1 519x0\n const {red} = x1;\n const r0 = red.sqrn(x1, 519);\n\n return r0;\n }\n}\n\n/**\n * K256\n */\n\nclass K256 extends Prime34 {\n constructor() {\n // 2^256 - 2^32 - 977 (= 3 mod 4)\n super('k256', 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff fffffffe fffffc2f');\n }\n\n split(input, output) {\n // 256 = 9 * 26 + 22\n const mask = 0x3fffff;\n const len = Math.min(input.length, 9);\n\n output._alloc(len + 1);\n\n for (let i = 0; i < len; i++)\n output.words[i] = input.words[i];\n\n output.length = len;\n\n if (input.length <= 9) {\n output._strip();\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs.\n let prev = input.words[9];\n let i = 10;\n\n output.words[output.length++] = prev & mask;\n output._strip();\n\n for (; i < input.length; i++) {\n const next = input.words[i] | 0;\n\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n\n prev = next;\n }\n\n prev >>>= 22;\n\n input.words[i - 10] = prev;\n\n if (prev === 0 && input.length > 10)\n input.length -= 10;\n else\n input.length -= 9;\n\n input._strip(); // Unsure if we need this.\n }\n\n imulK(num) {\n // K = 0x1000003d1 = [0x40, 0x3d1]\n // K = 2^32 + 977\n num._expand(num.length + 2);\n\n // Bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n let lo = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i];\n\n lo += w * 0x3d1;\n\n num.words[i] = lo & 0x3ffffff;\n\n lo = w * 0x40 + Math.floor(lo / 0x4000000);\n }\n\n // Fast length reduction.\n if (num.words[num.length - 1] === 0) {\n num.length -= 1;\n if (num.words[num.length - 1] === 0)\n num.length -= 1;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1, x2) {\n // Exponent: (p - 47) / 64\n // Bits: 223x1 1x0 22x1 4x0\n const {red} = x1;\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x9 = red.sqrnmul(x6, 3, x3);\n const x11 = red.sqrnmul(x9, 2, x2);\n const x22 = red.sqrnmul(x11, 11, x11);\n const x44 = red.sqrnmul(x22, 22, x22);\n const x88 = red.sqrnmul(x44, 44, x44);\n const x176 = red.sqrnmul(x88, 88, x88);\n const x220 = red.sqrnmul(x176, 44, x44);\n const x223 = red.sqrnmul(x220, 3, x3);\n const r0 = red.sqrn(x223, 1);\n const r1 = red.sqrnmul(r0, 22, x22);\n const r2 = red.sqrn(r1, 4);\n\n return r2;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 1, x1);\n const r4 = red.sqrn(r3, 1);\n const r5 = red.sqrnmul(r4, 2, x2);\n\n return r5;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 1x0 1x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 1, x1);\n const r4 = red.sqrn(r3, 1);\n const r5 = red.sqrnmul(r4, 2, x2);\n const r6 = red.sqrn(r5, 1);\n const r7 = red.sqrnmul(r6, 1, x1);\n\n return r7;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 223x1 1x0 22x1 4x0 2x1 2x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 2, x2);\n const r4 = red.sqrn(r3, 2);\n\n return r4;\n }\n}\n\n/**\n * P251\n */\n\nclass P251 extends Prime34 {\n constructor() {\n // 2^251 - 9\n super('p251', '07ffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff fffffff7');\n }\n\n imulK(num) {\n // K = 0x09\n if (num.isZero())\n return num;\n\n let carry = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i] * 0x09 + carry;\n\n carry = w >>> 26;\n\n num.words[i] = w & 0x3ffffff;\n }\n\n if (carry !== 0) {\n num._alloc(num.length + 1);\n num.words[num.length++] = carry;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1) {\n // Exponent: 2^247 - 1\n // Bits: 247x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x48 = red.sqrnmul(x24, 24, x24);\n const x96 = red.sqrnmul(x48, 48, x48);\n const x192 = red.sqrnmul(x96, 96, x96);\n const x240 = red.sqrnmul(x192, 48, x48);\n const x246 = red.sqrnmul(x240, 6, x6);\n const x247 = red.sqrnmul(x246, 1, x1);\n\n return x247;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 247x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 247x1 1x0 1x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n const r3 = red.sqrn(r2, 1);\n const r4 = red.sqrnmul(r3, 1, x1);\n\n return r4;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 248x1 1x0\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrnmul(r0, 1, x1);\n const r2 = red.sqrn(r1, 1);\n\n return r2;\n }\n}\n\n/**\n * P25519\n */\n\nclass P25519 extends Prime58 {\n constructor() {\n // 2^255 - 19 (= 5 mod 8)\n super('p25519', '7fffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffed',\n '2b832480 4fc1df0b 2b4d0099 3dfbd7a7'\n + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0');\n }\n\n imulK(num) {\n // K = 0x13\n let carry = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i] * 0x13 + carry;\n\n carry = w >>> 26;\n\n num.words[i] = w & 0x3ffffff;\n }\n\n if (carry !== 0) {\n num._alloc(num.length + 1);\n num.words[num.length++] = carry;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1, x2) {\n // Exponent: 2^250 - 1\n // Bits: 250x1\n const {red} = x1;\n const x4 = red.sqrnmul(x2, 2, x2);\n const x5 = red.sqrnmul(x4, 1, x1);\n const x10 = red.sqrnmul(x5, 5, x5);\n const x20 = red.sqrnmul(x10, 10, x10);\n const x40 = red.sqrnmul(x20, 20, x20);\n const x50 = red.sqrnmul(x40, 10, x10);\n const x100 = red.sqrnmul(x50, 50, x50);\n const x200 = red.sqrnmul(x100, 100, x100);\n const x250 = red.sqrnmul(x200, 50, x50);\n\n return x250;\n }\n\n pm5d8(x1) {\n // Exponent: (p - 5) / 8\n // Bits: 250x1 1x0 1x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 250x1 1x0 1x1 1x0 2x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n const r3 = red.sqrn(r2, 1);\n const r4 = red.sqrnmul(r3, 2, x2);\n\n return r4;\n }\n\n pp3d8(x1) {\n // Exponent: (p + 3) / 8\n // Bits: 251x1 1x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrnmul(r0, 1, x1);\n const r2 = red.sqrn(r1, 1);\n\n return r2;\n }\n}\n\n/**\n * P448\n */\n\nclass P448 extends Prime34 {\n constructor() {\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n super('p448', 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff fffffffe ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff');\n }\n\n imulK(num) {\n // K = 0x100000000000000000000000000000000000000000000000000000001\n // K = 2^224 + 1\n const one = this.one.inject(num);\n return num.iushln(224)._iadd(num, one);\n }\n\n core(x1, x2) {\n // Exponent: 2^222 - 1\n // Bits: 222x1\n const {red} = x1;\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x9 = red.sqrnmul(x6, 3, x3);\n const x11 = red.sqrnmul(x9, 2, x2);\n const x22 = red.sqrnmul(x11, 11, x11);\n const x44 = red.sqrnmul(x22, 22, x22);\n const x88 = red.sqrnmul(x44, 44, x44);\n const x176 = red.sqrnmul(x88, 88, x88);\n const x220 = red.sqrnmul(x176, 44, x44);\n const x222 = red.sqrnmul(x220, 2, x2);\n\n return x222;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 223x1 1x0 222x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x222 = this.core(x1, x2);\n const r0 = red.sqrnmul(x222, 1, x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 222, x222);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 223x1 1x0 222x1 1x0 1x1\n const {red} = x1;\n const r0 = this.pm3d4(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 224x1 222x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrnmul(r0, 2, x2);\n const r2 = red.sqrn(r1, 222);\n\n return r2;\n }\n}\n\n/**\n * Reduction Engine\n */\n\nclass Red {\n constructor(m) {\n let prime = null;\n\n if (typeof m === 'string') {\n prime = BN._prime(m);\n m = prime.p;\n }\n\n enforce(BN.isBN(m), 'm', 'bignum');\n nonred(!m.red, 'reduction');\n range(m.sign() > 0, 'reduction');\n\n this.m = m;\n this.prime = prime;\n this.mb = null;\n this.sm1 = null;\n }\n\n _verify1(a) {\n range(a.negative === 0, 'red');\n red(a.red != null, 'red');\n }\n\n _verify2(a, b) {\n range((a.negative | b.negative) === 0, 'red');\n red(a.red != null && a.red === b.red, 'red');\n }\n\n get mont() {\n return false;\n }\n\n precompute() {\n // Precompute `sqrt(-1)` for primes congruent to 5 mod 8.\n if (this.sm1 === null && this.m.andln(7) === 5) {\n if (this.prime) {\n this.sm1 = this.prime.sm1.clone()._forceRed(this);\n } else {\n const x = new BN(2).toRed(this);\n const e = this.m.subn(1).iushrn(2);\n\n // sqrt(-1) = 2^((p - 1) / 4) mod p\n this.sm1 = this.pow(x, e);\n }\n }\n\n return this;\n }\n\n convertTo(num) {\n const res = num.mod(this.m);\n res.red = this;\n return res;\n }\n\n convertFrom(num) {\n const res = num.clone();\n res.red = null;\n return res;\n }\n\n intTo(a) {\n return a;\n }\n\n intFrom(a) {\n return a;\n }\n\n imod(a) {\n if (this.prime)\n return this.prime.ireduce(a)._forceRed(this);\n\n return a.imod(this.m)._forceRed(this);\n }\n\n iadd(a, b) {\n this._verify2(a, b);\n\n a._iadd(a, b);\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n return a;\n }\n\n add(a, b) {\n if (a.length < b.length)\n return this.iadd(b.clone(), a);\n\n return this.iadd(a.clone(), b);\n }\n\n iaddn(a, num) {\n this._verify1(a);\n\n if (num < 0)\n return this.isubn(a, -num);\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n a._iaddn(num);\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n return a;\n }\n\n addn(a, num) {\n return this.iaddn(a.clone(), num);\n }\n\n isub(a, b) {\n this._verify2(a, b);\n\n // 0: a - a mod m == 0\n // -1: a - b mod m == m - (b - a)\n // +1: a - b mod m == a - b\n const cmp = a.ucmp(b);\n\n if (cmp === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n if (cmp < 0) {\n a._isub(b, a);\n a._isub(this.m, a);\n } else {\n a._isub(a, b);\n }\n\n return a;\n }\n\n sub(a, b) {\n return this.isub(a.clone(), b);\n }\n\n isubn(a, num) {\n this._verify1(a);\n\n if (num < 0)\n return this.iaddn(a, -num);\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n // <: a - b mod m == m - (b - a)\n // >=: a - b mod m == a - b\n if (a.length === 1 && a.words[0] < num) {\n a.words[0] = num - a.words[0];\n a._isub(this.m, a);\n } else {\n a._isubn(num);\n }\n\n return a;\n }\n\n subn(a, num) {\n return this.isubn(a.clone(), num);\n }\n\n imul(a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n }\n\n mul(a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n }\n\n imuln(a, num) {\n this._verify1(a);\n\n if (a.isZero())\n return a;\n\n if (num === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n const neg = num < 0;\n\n if (neg)\n num = -num;\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n a.imuln(num);\n\n if (num <= 16) {\n // Quick reduction.\n while (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n } else {\n this.imod(a);\n }\n\n if (neg)\n this.ineg(a);\n\n return a;\n }\n\n muln(a, num) {\n return this.imuln(a.clone(), num);\n }\n\n idiv(a, b) {\n return this.div(a, b)._move(a);\n }\n\n div(a, b) {\n return this.mul(a, this.invert(b));\n }\n\n idivn(a, num) {\n return this.divn(a, num)._move(a);\n }\n\n divn(a, num) {\n return this.div(a, this.convertTo(new BN(num)));\n }\n\n ipow(a, num) {\n return this.pow(a, num)._move(a);\n }\n\n pow(a, num) {\n this._verify1(a);\n\n if (num.isNeg())\n a = this.invert(a);\n\n // Small exponent.\n if (num.length === 1)\n return this.pown(a, num.words[0]);\n\n // Call out to BigInt.\n if (HAS_BIGINT && !this.prime)\n return this.powInt(a, num);\n\n // Otherwise, a BN implementation.\n return this.powNum(a, num);\n }\n\n powNum(a, num) {\n // Sliding window (odd multiples only).\n const one = new BN(1).toRed(this);\n const wnd = new Array(WND_SIZE);\n const a2 = this.sqr(a);\n\n wnd[0] = a;\n\n for (let i = 1; i < WND_SIZE; i++)\n wnd[i] = this.mul(wnd[i - 1], a2);\n\n let i = num.bitLength();\n let r = one;\n\n while (i >= WND_WIDTH) {\n let width = WND_WIDTH;\n let bits = num.bits(i - width, width);\n\n if (bits < WND_SIZE) {\n r = this.sqr(r);\n i -= 1;\n continue;\n }\n\n while ((bits & 1) === 0) {\n width -= 1;\n bits >>= 1;\n }\n\n if (r === one) {\n r = wnd[bits >> 1].clone();\n } else {\n r = this.sqrn(r, width);\n r = this.mul(r, wnd[bits >> 1]);\n }\n\n i -= width;\n }\n\n if (i > 0) {\n const bits = num.bits(0, i);\n\n while (i--) {\n r = this.sqr(r);\n\n if ((bits >> i) & 1)\n r = this.mul(r, a);\n }\n }\n\n return r;\n }\n\n powInt(a, num) {\n if (this.mb === null)\n this.mb = this.m.toBigInt();\n\n const x = this.intFrom(a.toBigInt());\n const y = powInt(x, num, this.mb);\n const z = this.intTo(y);\n\n return BN.fromBigInt(z)._forceRed(this);\n }\n\n sqrn(a, n) {\n while (n--)\n a = this.sqr(a);\n\n return a;\n }\n\n sqrnmul(a, n, b) {\n return this.mul(this.sqrn(a, n), b);\n }\n\n ipown(a, num) {\n return this.pown(a, num)._move(a);\n }\n\n pown(a, num) {\n this._verify1(a);\n\n if (num < 0) {\n a = this.invert(a);\n num = -num;\n }\n\n if (num === 0)\n return new BN(1).toRed(this);\n\n if (num === 1)\n return a.clone();\n\n const bits = countBits(num);\n\n let r = a;\n\n for (let i = bits - 2; i >= 0; i--) {\n r = this.sqr(r);\n\n if ((num >> i) & 1)\n r = this.mul(r, a);\n }\n\n return r;\n }\n\n isqr(a) {\n return this.imul(a, a);\n }\n\n sqr(a) {\n return this.mul(a, a);\n }\n\n isqrt(x) {\n return this.sqrt(x)._move(x);\n }\n\n sqrt(x) {\n this._verify1(x);\n\n // Optimized square root chain.\n if (this.prime)\n return this.prime.sqrt(x);\n\n // Fast case (p = 3 mod 4).\n if (this.m.andln(3) === 3)\n return this.sqrt3mod4(x);\n\n // Fast case (p = 5 mod 8).\n if (this.m.andln(7) === 5) {\n if (this.sm1 != null)\n return this.sqrt5mod8sm1(x);\n return this.sqrt5mod8(x);\n }\n\n // Slow case (Tonelli-Shanks).\n return this.sqrt0(x);\n }\n\n sqrt3mod4(x) {\n const e = this.m.addn(1).iushrn(2); // (p + 1) / 4\n const b = this.pow(x, e);\n\n if (!this.sqr(b).eq(x))\n throw new SquareRootError(b);\n\n return b;\n }\n\n sqrt5mod8(x) {\n // Atkin's Algorithm.\n const one = new BN(1).toRed(this);\n const e = this.m.ushrn(3); // (p - 5) / 8\n const x2 = this.add(x, x);\n const alpha = this.pow(x2, e);\n const beta = this.mul(x2, this.sqr(alpha));\n const b = this.mul(this.mul(alpha, x), this.isub(beta, one));\n\n if (!this.sqr(b).eq(x))\n throw new SquareRootError(b);\n\n return b;\n }\n\n sqrt5mod8sm1(x) {\n const e = this.m.addn(3).iushrn(3); // (p + 3) / 8\n const b = this.pow(x, e);\n\n if (this.sqr(b).eq(x))\n return b;\n\n const c = this.mul(b, this.sm1);\n\n if (this.sqr(c).eq(x))\n return c;\n\n throw new SquareRootError(b);\n }\n\n sqrt0(x) {\n if (this.m.cmpn(1) === 0 || !this.m.isOdd())\n throw new Error('Invalid prime.');\n\n switch (this.jacobi(x)) {\n case -1:\n throw new SquareRootError(x);\n case 0:\n return x.clone();\n case 1:\n break;\n }\n\n const one = new BN(1).toRed(this);\n const s = this.m.subn(1);\n const e = s._makeOdd();\n const n = new BN(2).toRed(this);\n\n while (this.jacobi(n) !== -1)\n this.iadd(n, one);\n\n let g = this.pow(n, s);\n let b = this.pow(x, s);\n let y = this.pow(x, s.iaddn(1).iushrn(1));\n let k = e;\n\n for (;;) {\n let t = b;\n let m = 0;\n\n while (!t.eq(one) && m < k) {\n t = this.sqr(t);\n m += 1;\n }\n\n if (m === 0)\n break;\n\n assert(m < k);\n\n t = this.sqrn(g, k - m - 1);\n g = this.sqr(t);\n y = this.mul(y, t);\n b = this.mul(b, g);\n k = m;\n }\n\n return y;\n }\n\n idivsqrt(u, v) {\n return this.divsqrt(u, v)._move(u);\n }\n\n divsqrt(u, v) {\n this._verify2(u, v);\n\n // u = 0, v = 0\n if (u.isZero() && v.isZero())\n throw new SquareRootError(v);\n\n // Optimized inverse square root chain.\n if (this.prime)\n return this.prime.divsqrt(u, v);\n\n // p = 3 mod 4\n if (this.m.andln(3) === 3)\n return this.divsqrt3mod4(u, v);\n\n // p = 5 mod 8\n if (this.sm1 != null && this.m.andln(7) === 5)\n return this.divsqrt5mod8(u, v);\n\n // v = 0\n if (v.isZero())\n throw new SquareRootError(v);\n\n return this.sqrt(this.div(u, v));\n }\n\n divsqrt3mod4(u, v) {\n // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p\n const e = this.m.subn(3).iushrn(2);\n const u2 = this.sqr(u);\n const u3 = this.mul(u2, u);\n const u5 = this.mul(u3, u2);\n const v3 = this.mul(this.sqr(v), v);\n const p = this.pow(this.mul(u5, v3), e);\n const x = this.mul(this.mul(u3, v), p);\n const c = this.mul(v, this.sqr(x));\n\n if (c.eq(u))\n return x;\n\n throw new SquareRootError(x);\n }\n\n divsqrt5mod8(u, v) {\n // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p\n const e = this.m.subn(5).iushrn(3);\n const v3 = this.mul(this.sqr(v), v);\n const v7 = this.mul(this.sqr(v3), v);\n const p = this.pow(this.mul(u, v7), e);\n const x = this.mul(this.mul(u, v3), p);\n const c = this.mul(v, this.sqr(x));\n\n if (c.eq(u))\n return x;\n\n const mc = this.ineg(c);\n\n if (mc.eq(u))\n return this.mul(x, this.sm1);\n\n if (mc.eq(this.mul(u, this.sm1)))\n throw new SquareRootError(this.mul(x, this.sm1));\n\n throw new SquareRootError(x);\n }\n\n isSquare(a) {\n if (this.m.isOdd())\n return this.jacobi(a) >= 0;\n\n return this.kronecker(a) >= 0;\n }\n\n ishl(a, num) {\n this._verify1(a);\n return this.imod(a.iushl(num));\n }\n\n shl(a, num) {\n return this.ishl(a.clone(), num);\n }\n\n ishln(a, num) {\n this._verify1(a);\n\n a.iushln(num);\n\n if (num <= 4) {\n // Quick reduction.\n while (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n } else {\n this.imod(a);\n }\n\n return a;\n }\n\n shln(a, num) {\n return this.ishln(a.clone(), num);\n }\n\n ineg(a) {\n this._verify1(a);\n\n if (!a.isZero())\n a._isub(this.m, a);\n\n return a;\n }\n\n neg(a) {\n return this.ineg(a.clone());\n }\n\n eq(a, b) {\n this._verify2(a, b);\n return a.ucmp(b) === 0;\n }\n\n eqn(a, num) {\n this._verify1(a);\n\n if (this.m.length === 1) {\n num %= this.m.words[0];\n\n if (num < 0)\n num += this.m.words[0];\n\n return a.ucmpn(num) === 0;\n }\n\n if (num < 0) {\n this.m._isubn(-num);\n\n const cmp = a.ucmp(this.m);\n\n this.m._iaddn(-num);\n\n return cmp === 0;\n }\n\n return a.ucmpn(num) === 0;\n }\n\n isHigh(a) {\n return !this.isLow(a);\n }\n\n isLow(a) {\n this._verify1(a);\n return a.ucmp(this.m.ushrn(1)) <= 0;\n }\n\n isOdd(a) {\n this._verify1(a);\n return a.isOdd();\n }\n\n isEven(a) {\n this._verify1(a);\n return a.isEven();\n }\n\n legendre(num) {\n this._verify1(num);\n\n if (this.m.isEven())\n throw new Error('legendre: `num` must be odd.');\n\n // Euler's criterion.\n const e = this.m.subn(1).iushrn(1); // (p - 1) / 2\n const symbol = this.pow(num, e);\n\n if (symbol.isZero())\n return 0;\n\n const one = new BN(1).toRed(this);\n\n if (symbol.eq(one))\n return 1;\n\n if (symbol.eq(this.ineg(one)))\n return -1;\n\n throw new Error('Invalid prime.');\n }\n\n jacobi(a) {\n this._verify1(a);\n return a.jacobi(this.m);\n }\n\n kronecker(a) {\n this._verify1(a);\n return a.kronecker(this.m);\n }\n\n iinvert(a) {\n return this.invert(a)._move(a);\n }\n\n invert(a) {\n this._verify1(a);\n return a.invert(this.m)._forceRed(this);\n }\n\n ifermat(a) {\n return this.fermat(a)._move(a);\n }\n\n fermat(a) {\n this._verify1(a);\n\n if (a.isZero() || this.m.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n // Optimized inversion chain.\n if (this.prime)\n return this.prime.fermat(a);\n\n // Invert using fermat's little theorem.\n return this.pow(a, this.m.subn(2));\n }\n\n invertAll(elems) {\n // Montgomery's trick.\n enforce(Array.isArray(elems), 'elems', 'array');\n\n for (const elem of elems) {\n enforce(BN.isBN(elem), 'elem', 'bignum');\n\n this._verify1(elem);\n }\n\n if (this.m.cmpn(1) === 0 || this.m.isEven())\n throw new RangeError('Not invertible.');\n\n const len = elems.length;\n const invs = new Array(len);\n\n if (len === 0)\n return invs;\n\n let acc = new BN(1).toRed(this);\n\n for (let i = 0; i < len; i++) {\n if (elems[i].isZero()) {\n invs[i] = elems[i].clone();\n continue;\n }\n\n invs[i] = acc;\n acc = this.mul(acc, elems[i]);\n }\n\n acc = this.invert(acc);\n\n for (let i = len - 1; i >= 0; i--) {\n if (elems[i].isZero())\n continue;\n\n invs[i] = this.mul(acc, invs[i]);\n acc = this.mul(acc, elems[i]);\n }\n\n return invs;\n }\n\n [custom]() {\n if (this.prime)\n return ``;\n\n return ``;\n }\n}\n\n/**\n * Barrett Engine\n */\n\nclass Barrett extends Red {\n constructor(m) {\n super(m);\n\n this.prime = null;\n this.n = this.m.bitLength();\n\n if ((this.n % 26) !== 0)\n this.n += 26 - (this.n % 26);\n\n this.k = this.n * 2;\n this.w = this.k / 26;\n this.b = BN.shift(1, this.k).div(this.m);\n }\n\n convertTo(num) {\n if (num.length > this.w)\n return super.convertTo(num);\n\n return this.imod(num.clone());\n }\n\n _shift(q) {\n let i = 0;\n let j = this.w;\n\n while (j < q.length)\n q.words[i++] = q.words[j++];\n\n if (i === 0)\n q.words[i++] = 0;\n\n q.length = i;\n }\n\n imod(a) {\n const neg = a.negative;\n\n assert(a.length <= this.w);\n\n a.negative = 0;\n\n const q = a.mul(this.b);\n\n // Shift right by `k` bits.\n this._shift(q);\n\n a._isub(a, q.mul(this.m));\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n if (neg && !a.isZero())\n a._isub(this.m, a);\n\n a.red = this;\n\n return a;\n }\n}\n\n/**\n * Montgomery Engine\n */\n\nclass Mont extends Red {\n constructor(m) {\n super(m);\n\n // Note that:\n //\n // mi = (-m^-1 mod (2^(n * 2))) mod r\n //\n // and:\n //\n // mi = (((2^n)^-1 mod m) * r^-1 - 1) / m\n //\n // are equivalent.\n this.prime = null;\n this.n = this.m.length * 26;\n this.r = BN.shift(1, this.n);\n this.r2 = BN.shift(1, this.n * 2).imod(this.m);\n this.ri = this.r.invert(this.m);\n this.mi = this.r.mul(this.ri).isubn(1).div(this.m);\n this.rib = null;\n }\n\n get mont() {\n return true;\n }\n\n convertTo(num) {\n if (num.isNeg() || num.ucmp(this.m) >= 0)\n return this.imod(num.ushln(this.n));\n\n // Equivalent to: (num * 2^n) mod m\n return this.mul(num, this.r2);\n }\n\n convertFrom(num) {\n // Equivalent to: num * r^-1 mod m\n const r = this.mul(num, new BN(1));\n r.red = null;\n return r;\n }\n\n intTo(a) {\n return (a << BigInt(this.n)) % this.mb;\n }\n\n intFrom(a) {\n if (this.rib === null)\n this.rib = this.ri.toBigInt();\n\n return (a * this.rib) % this.mb;\n }\n\n iaddn(a, num) {\n return this.iadd(a, this.convertTo(new BN(num)));\n }\n\n isubn(a, num) {\n return this.isub(a, this.convertTo(new BN(num)));\n }\n\n imul(a, b) {\n return this.mul(a, b)._move(a);\n }\n\n mul(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n\n const t = a.mul(b);\n const c = t.umaskn(this.n).mul(this.mi).iumaskn(this.n);\n const u = t.iadd(c.mul(this.m)).iushrn(this.n);\n\n if (u.ucmp(this.m) >= 0)\n u._isub(u, this.m);\n\n return u._forceRed(this);\n }\n\n imuln(a, num) {\n this._verify1(a);\n\n if (a.isZero())\n return a;\n\n if (num === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n const neg = num < 0;\n\n if (neg)\n num = -num;\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n const bits = countBits(num);\n\n // Potentially compute with additions.\n // This avoids an expensive division.\n if (bits > 5) {\n // Slow case (num > 31).\n this.imul(a, this.convertTo(new BN(num)));\n } else if ((num & (num - 1)) === 0) {\n // Optimize for powers of two.\n for (let i = 0; i < bits - 1; i++)\n this.iadd(a, a);\n } else {\n // Multiply left to right.\n const c = a.clone();\n\n for (let i = bits - 2; i >= 0; i--) {\n this.iadd(a, a);\n\n if ((num >> i) & 1)\n this.iadd(a, c);\n }\n }\n\n if (neg)\n this.ineg(a);\n\n return a;\n }\n\n eqn(a, num) {\n this._verify1(a);\n\n if (num === 0)\n return a.isZero();\n\n return a.ucmp(this.convertTo(new BN(num))) === 0;\n }\n\n isLow(a) {\n this._verify1(a);\n return this.convertFrom(a).ucmp(this.m.ushrn(1)) <= 0;\n }\n\n isOdd(a) {\n this._verify1(a);\n return this.convertFrom(a).isOdd();\n }\n\n isEven(a) {\n this._verify1(a);\n return this.convertFrom(a).isEven();\n }\n\n invert(a) {\n this._verify1(a);\n\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n return this.imod(a.invert(this.m).mul(this.r2));\n }\n}\n\n/*\n * Helpers\n */\n\nfunction makeError(Error, msg, start) {\n const err = new Error(msg);\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, start);\n\n return err;\n}\n\nfunction assert(value, message) {\n if (!value) {\n const msg = message || 'Assertion failed.';\n throw makeError(Error, msg, assert);\n }\n}\n\nfunction enforce(value, name, type) {\n if (!value) {\n const msg = `\"${name}\" must be a(n) ${type}.`;\n throw makeError(TypeError, msg, enforce);\n }\n}\n\nfunction range(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with positive numbers.`;\n throw makeError(RangeError, msg, range);\n }\n}\n\nfunction red(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with red numbers.`;\n throw makeError(TypeError, msg, red);\n }\n}\n\nfunction nonred(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with normal numbers.`;\n throw makeError(TypeError, msg, nonred);\n }\n}\n\nfunction nonzero(value) {\n if (!value) {\n const msg = 'Cannot divide by zero.';\n throw makeError(RangeError, msg, nonzero);\n }\n}\n\nclass SquareRootError extends Error {\n constructor(result) {\n super();\n\n this.name = 'SquareRootError';\n this.message = 'X is not a square mod P.';\n this.result = result.fromRed();\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, SquareRootError);\n }\n}\n\nfunction isInteger(num) {\n return Number.isSafeInteger(num);\n}\n\nfunction isSMI(num) {\n return isInteger(num)\n && num >= -0x3ffffff\n && num <= 0x3ffffff;\n}\n\nfunction allocate(ArrayType, size) {\n if (ArrayType.allocUnsafeSlow)\n return ArrayType.allocUnsafeSlow(size);\n\n return new ArrayType(size);\n}\n\nfunction getBase(base) {\n if (base == null)\n return 10;\n\n if (typeof base === 'number')\n return base;\n\n switch (base) {\n case 'bin':\n return 2;\n case 'oct':\n return 8;\n case 'dec':\n return 10;\n case 'hex':\n return 16;\n }\n\n return 0;\n}\n\n/*\n * Internal\n */\n\nfunction countBits(w) {\n if (Math.clz32)\n return 32 - Math.clz32(w);\n\n let t = w;\n let r = 0;\n\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n\n return r + t;\n}\n\nfunction zeroBits(w) {\n // Shortcut.\n if (w === 0)\n return 26;\n\n let t = w;\n let r = 0;\n\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n\n if ((t & 0x1) === 0)\n r += 1;\n\n return r;\n}\n\nfunction parseHex(str, start, end) {\n const len = Math.min(str.length, end);\n\n let r = 0;\n let z = 0;\n\n for (let i = start; i < len; i++) {\n const c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n let b;\n\n if (c >= 49 && c <= 54) {\n // 'a' - 'f'\n b = c - 49 + 0xa;\n } else if (c >= 17 && c <= 22) {\n // 'A' - 'F'\n b = c - 17 + 0xa;\n } else {\n // '0' - '9'\n b = c;\n }\n\n r |= b;\n z |= b;\n }\n\n if (z & ~15)\n throw new Error('Invalid string.');\n\n return r;\n}\n\nfunction parseBase(str, start, end, mul) {\n const len = Math.min(str.length, end);\n\n let r = 0;\n\n for (let i = start; i < len; i++) {\n const c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n let b;\n\n if (c >= 49) {\n // 'a'\n b = c - 49 + 0xa;\n } else if (c >= 17) {\n // 'A'\n b = c - 17 + 0xa;\n } else {\n // '0' - '9'\n b = c;\n }\n\n if (c < 0 || c > 207 || b >= mul)\n throw new Error('Invalid string.');\n\n r += b;\n }\n\n return r;\n}\n\n/*\n * Exponentiation (bigint)\n */\n\nfunction powInt(x, e, m) {\n // Sliding window (odd multiples only).\n const one = BigInt(1);\n const wnd = new Array(WND_SIZE);\n const x2 = (x * x) % m;\n\n wnd[0] = x;\n\n for (let i = 1; i < WND_SIZE; i++)\n wnd[i] = (wnd[i - 1] * x2) % m;\n\n let i = e.bitLength();\n let r = one;\n\n while (i >= WND_WIDTH) {\n let width = WND_WIDTH;\n let bits = e.bits(i - width, width);\n\n if (bits < WND_SIZE) {\n r = (r * r) % m;\n i -= 1;\n continue;\n }\n\n while ((bits & 1) === 0) {\n width -= 1;\n bits >>= 1;\n }\n\n if (r === one) {\n r = wnd[bits >> 1];\n } else {\n r = sqrn(r, width, m);\n r = (r * wnd[bits >> 1]) % m;\n }\n\n i -= width;\n }\n\n if (i > 0) {\n const bits = e.bits(0, i);\n\n while (i--) {\n r = (r * r) % m;\n\n if ((bits >> i) & 1)\n r = (r * x) % m;\n }\n }\n\n return r;\n}\n\nfunction sqrn(x, n, m) {\n for (let i = 0; i < n; i++)\n x = (x * x) % m;\n return x;\n}\n\n/*\n * Multiplication\n */\n\nfunction smallMulTo(self, num, out) {\n const len = self.length + num.length;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(len);\n out.length = len;\n\n // Peel one iteration (compiler can't\n // do it, because of code complexity).\n const a = self.words[0];\n const b = num.words[0];\n const r = a * b;\n const lo = r & 0x3ffffff;\n\n let carry = (r / 0x4000000) | 0;\n let k = 1;\n\n out.words[0] = lo;\n\n for (; k < out.length - 1; k++) {\n // Sum all words with the same\n // `i + j = k` and accumulate\n // `ncarry`, note that ncarry\n // could be >= 0x3ffffff.\n let ncarry = carry >>> 26;\n let rword = carry & 0x3ffffff;\n\n const min = Math.max(0, k - self.length + 1);\n const max = Math.min(k, num.length - 1);\n\n for (let j = min; j <= max; j++) {\n const i = k - j;\n const a = self.words[i];\n const b = num.words[j];\n const r = a * b + rword;\n\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n\n if (carry !== 0)\n out.words[k] = carry | 0;\n else\n out.length -= 1;\n\n return out._strip();\n}\n\nfunction bigMulTo(self, num, out) {\n const len = self.length + num.length;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(len);\n out.length = len;\n\n let carry = 0;\n let hncarry = 0;\n let k = 0;\n\n for (; k < out.length - 1; k++) {\n // Sum all words with the same\n // `i + j = k` and accumulate\n // `ncarry`, note that ncarry\n // could be >= 0x3ffffff.\n let ncarry = hncarry;\n\n hncarry = 0;\n\n let rword = carry & 0x3ffffff;\n\n const min = Math.max(0, k - self.length + 1);\n const max = Math.min(k, num.length - 1);\n\n for (let j = min; j <= max; j++) {\n const i = k - j;\n const a = self.words[i];\n const b = num.words[j];\n const r = a * b;\n\n let lo = r & 0x3ffffff;\n\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n\n if (carry !== 0)\n out.words[k] = carry;\n else\n out.length -= 1;\n\n return out._strip();\n}\n\nfunction jumboMulTo(x, y, out) {\n // v8 has a 2147483519 bit max (~256mb).\n if (!HAS_BIGINT || x.length + y.length > 82595519)\n return bigMulTo(x, y, out);\n\n const zero = BigInt(0);\n const mask = BigInt(0x3ffffff);\n const shift = BigInt(26);\n\n let z = x.toBigInt() * y.toBigInt();\n\n const neg = (z < zero) | 0;\n\n if (neg)\n z = -z;\n\n let i = 0;\n\n while (z > zero) {\n out.words[i++] = Number(z & mask);\n z >>= shift;\n }\n\n if (i === 0)\n out.words[i++] = 0;\n\n out.length = i;\n out.negative = neg;\n\n return out;\n}\n\nfunction comb10MulTo(self, num, out) {\n const a = self.words;\n const b = num.words;\n const o = out.words;\n const a0 = a[0] | 0;\n const al0 = a0 & 0x1fff;\n const ah0 = a0 >>> 13;\n const a1 = a[1] | 0;\n const al1 = a1 & 0x1fff;\n const ah1 = a1 >>> 13;\n const a2 = a[2] | 0;\n const al2 = a2 & 0x1fff;\n const ah2 = a2 >>> 13;\n const a3 = a[3] | 0;\n const al3 = a3 & 0x1fff;\n const ah3 = a3 >>> 13;\n const a4 = a[4] | 0;\n const al4 = a4 & 0x1fff;\n const ah4 = a4 >>> 13;\n const a5 = a[5] | 0;\n const al5 = a5 & 0x1fff;\n const ah5 = a5 >>> 13;\n const a6 = a[6] | 0;\n const al6 = a6 & 0x1fff;\n const ah6 = a6 >>> 13;\n const a7 = a[7] | 0;\n const al7 = a7 & 0x1fff;\n const ah7 = a7 >>> 13;\n const a8 = a[8] | 0;\n const al8 = a8 & 0x1fff;\n const ah8 = a8 >>> 13;\n const a9 = a[9] | 0;\n const al9 = a9 & 0x1fff;\n const ah9 = a9 >>> 13;\n const b0 = b[0] | 0;\n const bl0 = b0 & 0x1fff;\n const bh0 = b0 >>> 13;\n const b1 = b[1] | 0;\n const bl1 = b1 & 0x1fff;\n const bh1 = b1 >>> 13;\n const b2 = b[2] | 0;\n const bl2 = b2 & 0x1fff;\n const bh2 = b2 >>> 13;\n const b3 = b[3] | 0;\n const bl3 = b3 & 0x1fff;\n const bh3 = b3 >>> 13;\n const b4 = b[4] | 0;\n const bl4 = b4 & 0x1fff;\n const bh4 = b4 >>> 13;\n const b5 = b[5] | 0;\n const bl5 = b5 & 0x1fff;\n const bh5 = b5 >>> 13;\n const b6 = b[6] | 0;\n const bl6 = b6 & 0x1fff;\n const bh6 = b6 >>> 13;\n const b7 = b[7] | 0;\n const bl7 = b7 & 0x1fff;\n const bh7 = b7 >>> 13;\n const b8 = b[8] | 0;\n const bl8 = b8 & 0x1fff;\n const bh8 = b8 >>> 13;\n const b9 = b[9] | 0;\n const bl9 = b9 & 0x1fff;\n const bh9 = b9 >>> 13;\n\n let c = 0;\n let lo, mid, hi;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(20);\n out.length = 19;\n\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n\n let w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n\n let w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n\n let w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n\n let w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n\n let w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n\n let w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n\n let w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n\n let w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n\n let w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n\n let w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n\n let w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n\n let w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n\n let w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n\n let w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n\n let w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n\n let w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n\n let w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n\n let w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n\n let w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n\n if (c !== 0) {\n o[19] = c;\n out.length += 1;\n }\n\n // Note: we shouldn't need to strip here.\n return out;\n}\n\n// Polyfill comb.\nif (!Math.imul)\n comb10MulTo = smallMulTo;\n\n/*\n * Expose\n */\n\nBN.Red = Red;\n\nmodule.exports = BN;\n","/*!\n * bn.js - big numbers for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/bn');\n","/*!\n * chacha20.js - chacha20 for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources\n * https://en.wikipedia.org/wiki/Chacha20\n * https://tools.ietf.org/html/rfc7539#section-2\n * https://cr.yp.to/chacha.html\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/*\n * Constants\n */\n\nconst BIG_ENDIAN = new Int8Array(new Int16Array([1]).buffer)[0] === 0;\n\n/**\n * ChaCha20\n */\n\nclass ChaCha20 {\n /**\n * Create a ChaCha20 context.\n * @constructor\n */\n\n constructor() {\n this.state = new Uint32Array(16);\n this.stream = new Uint32Array(16);\n this.bytes = new Uint8Array(this.stream.buffer);\n this.pos = -1;\n\n if (BIG_ENDIAN)\n this.bytes = Buffer.alloc(64);\n }\n\n /**\n * Initialize chacha20 with a key, nonce, and counter.\n * @param {Buffer} key\n * @param {Buffer} nonce\n * @param {Number} counter\n */\n\n init(key, nonce, counter) {\n if (counter == null)\n counter = 0;\n\n assert(Buffer.isBuffer(key));\n assert(Buffer.isBuffer(nonce));\n assert(Number.isSafeInteger(counter));\n\n if (key.length !== 16 && key.length !== 32)\n throw new RangeError('Invalid key size.');\n\n if (nonce.length >= 24) {\n key = ChaCha20.derive(key, nonce.slice(0, 16));\n nonce = nonce.slice(16);\n }\n\n this.state[0] = 0x61707865;\n this.state[1] = key.length < 32 ? 0x3120646e : 0x3320646e;\n this.state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32;\n this.state[3] = 0x6b206574;\n this.state[4] = readU32(key, 0);\n this.state[5] = readU32(key, 4);\n this.state[6] = readU32(key, 8);\n this.state[7] = readU32(key, 12);\n this.state[8] = readU32(key, 16 % key.length);\n this.state[9] = readU32(key, 20 % key.length);\n this.state[10] = readU32(key, 24 % key.length);\n this.state[11] = readU32(key, 28 % key.length);\n this.state[12] = counter >>> 0;\n\n if (nonce.length === 8) {\n this.state[13] = (counter / 0x100000000) >>> 0;\n this.state[14] = readU32(nonce, 0);\n this.state[15] = readU32(nonce, 4);\n } else if (nonce.length === 12) {\n this.state[13] = readU32(nonce, 0);\n this.state[14] = readU32(nonce, 4);\n this.state[15] = readU32(nonce, 8);\n } else if (nonce.length === 16) {\n this.state[12] = readU32(nonce, 0);\n this.state[13] = readU32(nonce, 4);\n this.state[14] = readU32(nonce, 8);\n this.state[15] = readU32(nonce, 12);\n } else {\n throw new RangeError('Invalid nonce size.');\n }\n\n this.pos = 0;\n\n return this;\n }\n\n /**\n * Encrypt/decrypt data.\n * @param {Buffer} data - Will be mutated.\n * @returns {Buffer}\n */\n\n encrypt(data) {\n assert(Buffer.isBuffer(data));\n\n if (this.pos === -1)\n throw new Error('Context is not initialized.');\n\n for (let i = 0; i < data.length; i++) {\n if ((this.pos & 63) === 0) {\n this._block();\n this.pos = 0;\n }\n\n data[i] ^= this.bytes[this.pos++];\n }\n\n return data;\n }\n\n /**\n * Stir the stream.\n */\n\n _block() {\n for (let i = 0; i < 16; i++)\n this.stream[i] = this.state[i];\n\n for (let i = 0; i < 10; i++) {\n qround(this.stream, 0, 4, 8, 12);\n qround(this.stream, 1, 5, 9, 13);\n qround(this.stream, 2, 6, 10, 14);\n qround(this.stream, 3, 7, 11, 15);\n qround(this.stream, 0, 5, 10, 15);\n qround(this.stream, 1, 6, 11, 12);\n qround(this.stream, 2, 7, 8, 13);\n qround(this.stream, 3, 4, 9, 14);\n }\n\n for (let i = 0; i < 16; i++)\n this.stream[i] += this.state[i];\n\n if (BIG_ENDIAN) {\n for (let i = 0; i < 16; i++)\n writeU32(this.bytes, this.stream[i], i * 4);\n }\n\n this.state[12] += 1;\n\n if (this.state[12] === 0)\n this.state[13] += 1;\n }\n\n /**\n * Destroy context.\n */\n\n destroy() {\n for (let i = 0; i < 16; i++) {\n this.state[i] = 0;\n this.stream[i] = 0;\n }\n\n if (BIG_ENDIAN) {\n for (let i = 0; i < 64; i++)\n this.bytes[i] = 0;\n }\n\n this.pos = -1;\n\n return this;\n }\n\n /**\n * Derive key with XChaCha20.\n * @param {Buffer} key\n * @param {Buffer} nonce\n * @returns {Buffer}\n */\n\n static derive(key, nonce) {\n assert(Buffer.isBuffer(key));\n assert(Buffer.isBuffer(nonce));\n\n if (key.length !== 16 && key.length !== 32)\n throw new RangeError('Invalid key size.');\n\n if (nonce.length !== 16)\n throw new RangeError('Invalid nonce size.');\n\n const state = new Uint32Array(16);\n\n state[0] = 0x61707865;\n state[1] = key.length < 32 ? 0x3120646e : 0x3320646e;\n state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32;\n state[3] = 0x6b206574;\n state[4] = readU32(key, 0);\n state[5] = readU32(key, 4);\n state[6] = readU32(key, 8);\n state[7] = readU32(key, 12);\n state[8] = readU32(key, 16 % key.length);\n state[9] = readU32(key, 20 % key.length);\n state[10] = readU32(key, 24 % key.length);\n state[11] = readU32(key, 28 % key.length);\n state[12] = readU32(nonce, 0);\n state[13] = readU32(nonce, 4);\n state[14] = readU32(nonce, 8);\n state[15] = readU32(nonce, 12);\n\n for (let i = 0; i < 10; i++) {\n qround(state, 0, 4, 8, 12);\n qround(state, 1, 5, 9, 13);\n qround(state, 2, 6, 10, 14);\n qround(state, 3, 7, 11, 15);\n qround(state, 0, 5, 10, 15);\n qround(state, 1, 6, 11, 12);\n qround(state, 2, 7, 8, 13);\n qround(state, 3, 4, 9, 14);\n }\n\n const out = Buffer.alloc(32);\n\n writeU32(out, state[0], 0);\n writeU32(out, state[1], 4);\n writeU32(out, state[2], 8);\n writeU32(out, state[3], 12);\n writeU32(out, state[12], 16);\n writeU32(out, state[13], 20);\n writeU32(out, state[14], 24);\n writeU32(out, state[15], 28);\n\n return out;\n }\n}\n\n/*\n * Static\n */\n\nChaCha20.native = 0;\n\n/*\n * Helpers\n */\n\nfunction qround(x, a, b, c, d) {\n x[a] += x[b];\n x[d] = rotl32(x[d] ^ x[a], 16);\n\n x[c] += x[d];\n x[b] = rotl32(x[b] ^ x[c], 12);\n\n x[a] += x[b];\n x[d] = rotl32(x[d] ^ x[a], 8);\n\n x[c] += x[d];\n x[b] = rotl32(x[b] ^ x[c], 7);\n}\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\n\nfunction readU32(data, off) {\n return (data[off++]\n + data[off++] * 0x100\n + data[off++] * 0x10000\n + data[off] * 0x1000000);\n}\n\nfunction writeU32(dst, num, off) {\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n return off;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = ChaCha20;\n","/*!\n * chacha20.js - chacha20 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/chacha20');\n","/*!\n * hmac.js - hmac for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/hash.js:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/hash.js\n *\n * Resources:\n * https://en.wikipedia.org/wiki/HMAC\n * https://tools.ietf.org/html/rfc2104\n * https://github.com/indutny/hash.js/blob/master/lib/hash/hmac.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/**\n * HMAC\n */\n\nclass HMAC {\n /**\n * Create an HMAC.\n * @param {Function} Hash\n * @param {Number} size\n * @param {Array} [x=[]]\n * @param {Array} [y=[]]\n */\n\n constructor(Hash, size, x = [], y = []) {\n assert(typeof Hash === 'function');\n assert((size >>> 0) === size);\n assert(Array.isArray(x));\n assert(Array.isArray(y));\n\n this.hash = Hash;\n this.size = size;\n this.x = x;\n this.y = y;\n\n this.inner = new Hash();\n this.outer = new Hash();\n }\n\n /**\n * Initialize HMAC context.\n * @param {Buffer} data\n */\n\n init(key) {\n assert(Buffer.isBuffer(key));\n\n // Shorten key\n if (key.length > this.size) {\n const Hash = this.hash;\n const h = new Hash();\n\n h.init(...this.x);\n h.update(key);\n\n key = h.final(...this.y);\n\n assert(key.length <= this.size);\n }\n\n // Pad key\n const pad = Buffer.alloc(this.size);\n\n for (let i = 0; i < key.length; i++)\n pad[i] = key[i] ^ 0x36;\n\n for (let i = key.length; i < pad.length; i++)\n pad[i] = 0x36;\n\n this.inner.init(...this.x);\n this.inner.update(pad);\n\n for (let i = 0; i < key.length; i++)\n pad[i] = key[i] ^ 0x5c;\n\n for (let i = key.length; i < pad.length; i++)\n pad[i] = 0x5c;\n\n this.outer.init(...this.x);\n this.outer.update(pad);\n\n return this;\n }\n\n /**\n * Update HMAC context.\n * @param {Buffer} data\n */\n\n update(data) {\n this.inner.update(data);\n return this;\n }\n\n /**\n * Finalize HMAC context.\n * @returns {Buffer}\n */\n\n final() {\n this.outer.update(this.inner.final(...this.y));\n return this.outer.final(...this.y);\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = HMAC;\n","/*!\n * sha256.js - SHA256 implementation for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/hash.js:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/hash.js\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-2\n * https://tools.ietf.org/html/rfc4634\n * https://github.com/indutny/hash.js/blob/master/lib/hash/sha/256.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst HMAC = require('../internal/hmac');\n\n/*\n * Constants\n */\n\nconst FINALIZED = -1;\nconst DESC = Buffer.alloc(8, 0x00);\nconst PADDING = Buffer.alloc(64, 0x00);\n\nPADDING[0] = 0x80;\n\nconst K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n/**\n * SHA256\n */\n\nclass SHA256 {\n constructor() {\n this.state = new Uint32Array(8);\n this.msg = new Uint32Array(64);\n this.block = Buffer.alloc(64);\n this.size = FINALIZED;\n }\n\n init() {\n this.state[0] = 0x6a09e667;\n this.state[1] = 0xbb67ae85;\n this.state[2] = 0x3c6ef372;\n this.state[3] = 0xa54ff53a;\n this.state[4] = 0x510e527f;\n this.state[5] = 0x9b05688c;\n this.state[6] = 0x1f83d9ab;\n this.state[7] = 0x5be0cd19;\n this.size = 0;\n return this;\n }\n\n update(data) {\n assert(Buffer.isBuffer(data));\n this._update(data, data.length);\n return this;\n }\n\n final() {\n return this._final(Buffer.alloc(32));\n }\n\n _update(data, len) {\n assert(this.size !== FINALIZED, 'Context is not initialized.');\n\n let pos = this.size & 63;\n let off = 0;\n\n this.size += len;\n\n if (pos > 0) {\n let want = 64 - pos;\n\n if (want > len)\n want = len;\n\n data.copy(this.block, pos, off, off + want);\n\n pos += want;\n len -= want;\n off += want;\n\n if (pos < 64)\n return;\n\n this._transform(this.block, 0);\n }\n\n while (len >= 64) {\n this._transform(data, off);\n off += 64;\n len -= 64;\n }\n\n if (len > 0)\n data.copy(this.block, 0, off, off + len);\n }\n\n _final(out) {\n assert(this.size !== FINALIZED, 'Context is not initialized.');\n\n const pos = this.size & 63;\n const len = this.size * 8;\n\n writeU32(DESC, (len * (1 / 0x100000000)) >>> 0, 0);\n writeU32(DESC, len >>> 0, 4);\n\n this._update(PADDING, 1 + ((119 - pos) & 63));\n this._update(DESC, 8);\n\n for (let i = 0; i < 8; i++) {\n writeU32(out, this.state[i], i * 4);\n this.state[i] = 0;\n }\n\n for (let i = 0; i < 64; i++)\n this.msg[i] = 0;\n\n for (let i = 0; i < 64; i++)\n this.block[i] = 0;\n\n this.size = FINALIZED;\n\n return out;\n }\n\n _transform(chunk, pos) {\n const W = this.msg;\n\n let a = this.state[0];\n let b = this.state[1];\n let c = this.state[2];\n let d = this.state[3];\n let e = this.state[4];\n let f = this.state[5];\n let g = this.state[6];\n let h = this.state[7];\n let i = 0;\n\n for (; i < 16; i++)\n W[i] = readU32(chunk, pos + i * 4);\n\n for (; i < 64; i++)\n W[i] = sigma1(W[i - 2]) + W[i - 7] + sigma0(W[i - 15]) + W[i - 16];\n\n for (i = 0; i < 64; i++) {\n const t1 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i];\n const t2 = Sigma0(a) + Maj(a, b, c);\n\n h = g;\n g = f;\n f = e;\n\n e = (d + t1) >>> 0;\n\n d = c;\n c = b;\n b = a;\n\n a = (t1 + t2) >>> 0;\n }\n\n this.state[0] += a;\n this.state[1] += b;\n this.state[2] += c;\n this.state[3] += d;\n this.state[4] += e;\n this.state[5] += f;\n this.state[6] += g;\n this.state[7] += h;\n }\n\n static hash() {\n return new SHA256();\n }\n\n static hmac() {\n return new HMAC(SHA256, 64);\n }\n\n static digest(data) {\n return SHA256.ctx.init().update(data).final();\n }\n\n static root(left, right) {\n assert(Buffer.isBuffer(left) && left.length === 32);\n assert(Buffer.isBuffer(right) && right.length === 32);\n return SHA256.ctx.init().update(left).update(right).final();\n }\n\n static multi(x, y, z) {\n const {ctx} = SHA256;\n\n ctx.init();\n ctx.update(x);\n ctx.update(y);\n\n if (z)\n ctx.update(z);\n\n return ctx.final();\n }\n\n static mac(data, key) {\n return SHA256.hmac().init(key).update(data).final();\n }\n}\n\n/*\n * Static\n */\n\nSHA256.native = 0;\nSHA256.id = 'SHA256';\nSHA256.size = 32;\nSHA256.bits = 256;\nSHA256.blockSize = 64;\nSHA256.zero = Buffer.alloc(32, 0x00);\nSHA256.ctx = new SHA256();\n\n/*\n * Helpers\n */\n\nfunction Sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n}\n\nfunction Sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n}\n\nfunction sigma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3);\n}\n\nfunction sigma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10);\n}\n\nfunction Ch(x, y, z) {\n return z ^ (x & (y ^ z));\n}\n\nfunction Maj(x, y, z) {\n return (x & y) | (z & (x | y));\n}\n\nfunction readU32(data, off) {\n return (data[off++] * 0x1000000\n + data[off++] * 0x10000\n + data[off++] * 0x100\n + data[off]);\n}\n\nfunction writeU32(data, num, off) {\n data[off++] = num >>> 24;\n data[off++] = num >>> 16;\n data[off++] = num >>> 8;\n data[off++] = num;\n return off;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = SHA256;\n","/*!\n * sha256.js - sha256 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/sha256');\n","/*!\n * batch-rng.js - batch rng for bcrypto\n * Copyright (c) 2019-2020, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on ElementsProject/secp256k1-zkp:\n * Copyright (c) 2013, Pieter Wuille.\n * https://github.com/ElementsProject/secp256k1-zkp\n *\n * Resources:\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/modules/schnorrsig/main_impl.h#L166\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/scalar_4x64_impl.h#L972\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/scalar_8x32_impl.h#L747\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst BN = require('../bn');\nconst ChaCha20 = require('../chacha20');\nconst SHA256 = require('../sha256');\n\n/**\n * BatchRNG\n */\n\nclass BatchRNG {\n constructor(curve, encode = key => key) {\n this.curve = curve;\n this.encode = encode;\n this.hash = new SHA256();\n this.chacha = new ChaCha20();\n this.key = Buffer.alloc(32, 0x00);\n this.iv = Buffer.alloc(8, 0x00);\n this.cache = [new BN(1), new BN(1)];\n }\n\n init(batch) {\n assert(Array.isArray(batch));\n\n this.hash.init();\n\n for (const [msg, sig, key] of batch) {\n this.hash.update(SHA256.digest(msg));\n this.hash.update(sig);\n this.hash.update(this.encode(key));\n }\n\n this.key = this.hash.final();\n this.cache[0] = new BN(1);\n this.cache[1] = new BN(1);\n\n return this;\n }\n\n encrypt(counter) {\n const size = this.curve.scalarSize * 2;\n const data = Buffer.alloc(size, 0x00);\n const left = data.slice(0, this.curve.scalarSize);\n const right = data.slice(this.curve.scalarSize);\n\n this.chacha.init(this.key, this.iv, counter);\n this.chacha.encrypt(data);\n\n return [\n this.curve.decodeScalar(left),\n this.curve.decodeScalar(right)\n ];\n }\n\n refresh(counter) {\n let overflow = 0;\n\n for (;;) {\n // First word is always zero.\n this.iv[4] = overflow;\n this.iv[5] = overflow >>> 8;\n this.iv[6] = overflow >>> 16;\n this.iv[7] = overflow >>> 24;\n\n overflow += 1;\n\n const [s1, s2] = this.encrypt(counter);\n\n if (s1.isZero() || s1.cmp(this.curve.n) >= 0)\n continue;\n\n if (s2.isZero() || s2.cmp(this.curve.n) >= 0)\n continue;\n\n this.cache[0] = s1;\n this.cache[1] = s2;\n\n break;\n }\n }\n\n generate(index) {\n assert((index >>> 0) === index);\n\n if (index & 1)\n this.refresh(index >>> 1);\n\n return this.cache[index & 1];\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = BatchRNG;\n","/*!\n * elliptic.js - elliptic curves for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/elliptic:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/elliptic\n *\n * Formulas from DJB and Tanja Lange [EFD].\n *\n * References:\n *\n * [GECC] Guide to Elliptic Curve Cryptography\n * D. Hankerson, A. Menezes, and S. Vanstone\n * https://tinyurl.com/guide-to-ecc\n *\n * [GLV] Faster Point Multiplication on Elliptic Curves\n * R. Gallant, R. Lambert, and S. Vanstone\n * https://link.springer.com/content/pdf/10.1007/3-540-44647-8_11.pdf\n *\n * [MONT1] Montgomery curves and the Montgomery ladder\n * Daniel J. Bernstein, Tanja Lange\n * https://eprint.iacr.org/2017/293.pdf\n *\n * [SQUARED] Elligator Squared\n * Mehdi Tibouchi\n * https://eprint.iacr.org/2014/043.pdf\n *\n * [SEC1] SEC 1 - Standards for Efficient Cryptography Group\n * Certicom Research\n * https://www.secg.org/sec1-v2.pdf\n *\n * [SEC2] SEC 2: Recommended Elliptic Curve Domain Parameters\n * Certicom Research\n * https://www.secg.org/sec2-v2.pdf\n *\n * [SIDE1] Elliptic Curves and Side-Channel Attacks\n * Marc Joye\n * https://pdfs.semanticscholar.org/8d69/9645033e25d74fcfd4cbf07a770d2e943e14.pdf\n *\n * [BLIND] Side-Channel Analysis on Blinding Regular Scalar Multiplications\n * B. Feix, M. Roussellet, A. Venelli\n * https://eprint.iacr.org/2014/191.pdf\n *\n * [ALT] Alternative Elliptic Curve Representations\n * R. Struik\n * https://tools.ietf.org/id/draft-ietf-lwig-curve-representations-02.html\n *\n * [ARITH1] Arithmetic of Elliptic Curves\n * Christophe Doche, Tanja Lange\n * Handbook of Elliptic and Hyperelliptic Curve Cryptography\n * Page 267, Section 13 (978-1-58488-518-4)\n * https://hyperelliptic.org/HEHCC/index.html\n *\n * [ARITH2] The Arithmetic of Elliptic Curves, 2nd Edition\n * Joseph H. Silverman\n * http://www.pdmi.ras.ru/~lowdimma/BSD/Silverman-Arithmetic_of_EC.pdf\n *\n * [EFD] Explicit-Formulas Database\n * Daniel J. Bernstein, Tanja Lange\n * https://hyperelliptic.org/EFD/index.html\n *\n * [SAFE] SafeCurves: choosing safe curves for elliptic-curve cryptography\n * Daniel J. Bernstein\n * https://safecurves.cr.yp.to/\n *\n * [4GLV] Refinement of the Four-Dimensional GLV Method on Elliptic Curves\n * Hairong Yi, Yuqing Zhu, and Dongdai Lin\n * http://www.site.uottawa.ca/~cadams/papers/prepro/paper_19_slides.pdf\n *\n * [SSWU1] Efficient Indifferentiable Hashing into Ordinary Elliptic Curves\n * E. Brier, J. Coron, T. Icart, D. Madore, H. Randriam, M. Tibouchi\n * https://eprint.iacr.org/2009/340.pdf\n *\n * [SSWU2] Rational points on certain hyperelliptic curves over finite fields\n * Maciej Ulas\n * https://arxiv.org/abs/0706.1448\n *\n * [H2EC] Hashing to Elliptic Curves\n * A. Faz-Hernandez, S. Scott, N. Sullivan, R. S. Wahby, C. A. Wood\n * https://git.io/JeWz6\n * https://github.com/cfrg/draft-irtf-cfrg-hash-to-curve\n *\n * [SVDW1] Construction of Rational Points on Elliptic Curves\n * A. Shallue, C. E. van de Woestijne\n * https://works.bepress.com/andrew_shallue/1/download/\n *\n * [SVDW2] Indifferentiable Hashing to Barreto-Naehrig Curves\n * Pierre-Alain Fouque, Mehdi Tibouchi\n * https://www.di.ens.fr/~fouque/pub/latincrypt12.pdf\n *\n * [SVDW3] Covert ECDH over secp256k1\n * Pieter Wuille\n * https://gist.github.com/sipa/29118d3fcfac69f9930d57433316c039\n *\n * [MONT2] Montgomery Curve (wikipedia)\n * https://en.wikipedia.org/wiki/Montgomery_curve\n *\n * [MONT3] Montgomery Curves and their arithmetic\n * C. Costello, B. Smith\n * https://eprint.iacr.org/2017/212.pdf\n *\n * [ELL2] Elliptic-curve points indistinguishable from uniform random strings\n * D. Bernstein, M. Hamburg, A. Krasnova, T. Lange\n * https://elligator.cr.yp.to/elligator-20130828.pdf\n *\n * [RFC7748] Elliptic Curves for Security\n * A. Langley, M. Hamburg, S. Turner\n * https://tools.ietf.org/html/rfc7748\n *\n * [TWISTED] Twisted Edwards Curves\n * D. Bernstein, P. Birkner, M. Joye, T. Lange, C. Peters\n * https://eprint.iacr.org/2008/013.pdf\n *\n * [ELL1] Injective Encodings to Elliptic Curves\n * P. Fouque, A. Joux, M. Tibouchi\n * https://eprint.iacr.org/2013/373.pdf\n *\n * [ISOGENY] Twisting Edwards curves with isogenies\n * Mike Hamburg\n * https://www.shiftleft.org/papers/isogeny/isogeny.pdf\n *\n * [RFC8032] Edwards-Curve Digital Signature Algorithm (EdDSA)\n * S. Josefsson, SJD AB, I. Liusvaara\n * https://tools.ietf.org/html/rfc8032\n *\n * [SCHNORR] Schnorr Signatures for secp256k1\n * Pieter Wuille\n * https://github.com/sipa/bips/blob/d194620/bip-schnorr.mediawiki\n *\n * [BIP340] Schnorr Signatures for secp256k1\n * Pieter Wuille, Jonas Nick, Tim Ruffing\n * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\n *\n * [JCEN12] Efficient Software Implementation of Public-Key Cryptography\n * on Sensor Networks Using the MSP430X Microcontroller\n * C. P. L. Gouvea, L. B. Oliveira, J. Lopez\n * http://conradoplg.cryptoland.net/files/2010/12/jcen12.pdf\n *\n * [FIPS186] Federal Information Processing Standards Publication\n * National Institute of Standards and Technology\n * https://tinyurl.com/fips-186-3\n *\n * [RFC5639] Elliptic Curve Cryptography (ECC) Brainpool\n * Standard Curves and Curve Generation\n * M. Lochter, BSI, J. Merkle\n * https://tools.ietf.org/html/rfc5639\n *\n * [TWISTEQ] Twisted Edwards & Short Weierstrass Equivalence\n * Christopher Jeffrey\n * https://gist.github.com/chjj/16ba7fa08d64e8dda269a9fe5b2a8bbc\n *\n * [ECPM] Elliptic Curve Point Multiplication (wikipedia)\n * https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication\n */\n\n'use strict';\n\nconst {custom} = require('../internal/custom');\nconst BN = require('../bn');\n\n/*\n * Constants\n */\n\nconst types = {\n AFFINE: 0,\n JACOBIAN: 1,\n PROJECTIVE: 2,\n EXTENDED: 3\n};\n\nconst jsfIndex = [\n -3, // -1 -1\n -1, // -1 0\n -5, // -1 1\n -7, // 0 -1\n 0, // 0 0\n 7, // 0 1\n 5, // 1 -1\n 1, // 1 0\n 3 // 1 1\n];\n\nconst USE_FIXED = false;\n\nlet uid = 0;\n\n/**\n * Curve\n */\n\nclass Curve {\n constructor(Point, type, conf) {\n this.Point = null;\n this.id = null;\n this.uid = uid++;\n this.ossl = null;\n this.type = 'base';\n this.endian = 'be';\n this.hash = null;\n this.prefix = null;\n this.context = false;\n this.prime = null;\n this.p = null;\n this.red = null;\n this.fieldSize = 0;\n this.fieldBits = 0;\n this.adjustedSize = 0;\n this.signBit = 0;\n this.mask = 0;\n this.n = null;\n this.h = null;\n this.q = null;\n this.z = null;\n this.g = null;\n this.nh = null;\n this.scalarSize = 0;\n this.scalarBits = 0;\n this.zero = null;\n this.one = null;\n this.two = null;\n this.three = null;\n this.four = null;\n this.i2 = null;\n this.i3 = null;\n this.i4 = null;\n this.i6 = null;\n this.torsion = null;\n this.endo = null;\n this.hi = null;\n this._init(Point, type, conf);\n }\n\n _init(Point, type, conf) {\n assert(typeof Point === 'function');\n assert(typeof type === 'string');\n assert(conf && typeof conf === 'object');\n assert(conf.red == null || (conf.red instanceof BN.Red));\n assert(conf.p != null, 'Must pass a prime.');\n assert(conf.id == null || typeof conf.id === 'string');\n assert(conf.ossl == null || typeof conf.ossl === 'string');\n assert(conf.endian == null || typeof conf.endian === 'string');\n assert(conf.hash == null || typeof conf.hash === 'string');\n assert(conf.prefix == null || typeof conf.prefix === 'string');\n assert(conf.context == null || typeof conf.context === 'boolean');\n assert(conf.prime == null || typeof conf.prime === 'string');\n assert(conf.torsion == null || Array.isArray(conf.torsion));\n\n // Point class.\n this.Point = Point;\n\n // Meta.\n this.id = conf.id || null;\n this.ossl = conf.ossl || null;\n this.type = type;\n this.endian = conf.endian || (type === 'short' ? 'be' : 'le');\n this.hash = conf.hash || null;\n this.prefix = conf.prefix ? Buffer.from(conf.prefix, 'binary') : null;\n this.context = conf.context || false;\n this.prime = conf.prime || null;\n\n // Prime.\n this.p = BN.fromJSON(conf.p);\n\n // Reduction.\n if (conf.red) {\n this.red = conf.red;\n } else {\n // Use Montgomery when there is no fast reduction for the prime.\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n this.red.precompute();\n }\n\n // Precalculate encoding length.\n this.fieldSize = this.p.byteLength();\n this.fieldBits = this.p.bitLength();\n this.adjustedSize = this.fieldSize + ((this.fieldBits & 7) === 0);\n this.signBit = this.adjustedSize * 8 - 1;\n this.mask = 0xff;\n\n if ((this.fieldBits & 7) !== 0)\n this.mask = (1 << (this.fieldBits & 7)) - 1;\n\n // Curve configuration, optional.\n this.n = BN.fromJSON(conf.n || '0');\n this.h = BN.fromJSON(conf.h || '1');\n this.q = this.n.mul(this.h);\n this.z = BN.fromJSON(conf.z || '0').toRed(this.red);\n this.g = null;\n this.nh = this.n.ushrn(1);\n this.scalarSize = this.n.byteLength();\n this.scalarBits = this.n.bitLength();\n\n // Useful for many curves.\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n this.three = new BN(3).toRed(this.red);\n this.four = new BN(4).toRed(this.red);\n\n // Inverses.\n this.i2 = this.two.redInvert();\n this.i3 = this.three.redInvert();\n this.i4 = this.i2.redSqr();\n this.i6 = this.i2.redMul(this.i3);\n\n // Torsion.\n this.torsion = new Array(this.h.word(0));\n\n for (let i = 0; i < this.torsion.length; i++)\n this.torsion[i] = this.point();\n\n // Endomorphism.\n this.endo = null;\n\n // Cache.\n this.hi = null;\n\n // Memoize.\n this._scale = memoize(this._scale, this);\n this.isIsomorphic = memoize(this.isIsomorphic, this);\n this.isIsogenous = memoize(this.isIsogenous, this);\n\n // Sanity checks.\n assert(this.p.sign() > 0 && this.p.isOdd());\n assert(this.n.sign() >= 0);\n assert(this.h.sign() > 0 && this.h.cmpn(255) <= 0);\n assert(this.endian === 'be' || this.endian === 'le');\n\n return this;\n }\n\n _finalize(conf) {\n assert(conf && typeof conf === 'object');\n\n // Create base point.\n this.g = conf.g ? this.pointFromJSON(conf.g) : this.point();\n\n // Parse small order points.\n if (conf.torsion) {\n assert(conf.torsion.length === this.torsion.length);\n\n for (let i = 0; i < this.torsion.length; i++)\n this.torsion[i] = this.pointFromJSON(conf.torsion[i]);\n }\n\n return this;\n }\n\n _findTorsion() {\n // Find all torsion points by grinding.\n assert(!this.n.isZero());\n\n const h = this.h.word(0);\n const x = this.one.redNeg();\n const out = [this.point()];\n const set = new Set();\n\n let len = h;\n\n while (out.length < len) {\n let p;\n\n x.redIAdd(this.one);\n\n try {\n p = this.pointFromX(x.clone());\n } catch (e) {\n continue;\n }\n\n try {\n p = p.mul(this.n);\n } catch (e) {\n len = 2;\n continue;\n }\n\n if (p.isInfinity())\n continue;\n\n p.normalize();\n\n for (const point of [p, p.neg()]) {\n const key = point.key();\n\n if (!set.has(key)) {\n out.push(point);\n set.add(key);\n }\n }\n }\n\n out.sort((a, b) => a.cmp(b));\n\n while (out.length < h)\n out.push(this.point());\n\n return out;\n }\n\n _fixedMul(p, k) {\n // Fixed-base method for point multiplication.\n //\n // [ECPM] \"Windowed method\".\n // [GECC] Page 95, Section 3.3.\n //\n // Windows are appropriately shifted to avoid any\n // doublings. This reduces a 256 bit multiplication\n // down to 64 additions with a window size of 4.\n assert(p instanceof Point);\n assert(k instanceof BN);\n assert(p.pre && p.pre.windows);\n\n // Get precomputed windows.\n const {width, points} = p._getWindows(0, 0);\n\n // Recompute window size.\n const size = 1 << width;\n\n // Recompute steps.\n const bits = k.bitLength();\n const steps = ((bits + width - 1) / width) >>> 0;\n\n // Multiply.\n let acc = this.jpoint();\n\n for (let i = 0; i < steps; i++) {\n const bits = k.bits(i * width, width);\n\n acc = acc.add(points[i * size + bits]);\n }\n\n // Adjust sign.\n if (k.isNeg())\n acc = acc.neg();\n\n return acc;\n }\n\n _fixedNafMul(p, k) {\n // Fixed-base NAF windowing method for point multiplication.\n //\n // [GECC] Algorithm 3.42, Page 105, Section 3.3.\n assert(p instanceof Point);\n assert(k instanceof BN);\n assert(p.pre && p.pre.doubles);\n\n // Get precomputed doubles.\n const {step, points} = p._getDoubles(0, 0);\n\n // Get fixed NAF (in a more windowed form).\n const naf = getFixedNAF(k, 2, k.bitLength() + 1, step);\n\n // Compute steps.\n const I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3;\n\n // Multiply.\n let a = this.jpoint();\n let b = this.jpoint();\n\n for (let i = I; i > 0; i--) {\n for (let j = 0; j < naf.length; j++) {\n const nafW = naf[j];\n\n if (nafW === i)\n b = b.add(points[j]);\n else if (nafW === -i)\n b = b.sub(points[j]);\n }\n\n a = a.add(b);\n }\n\n return a;\n }\n\n _wnafMul(w, p, k) {\n // Window NAF method for point multiplication.\n //\n // [GECC] Algorithm 3.36, Page 100, Section 3.3.\n assert(p instanceof Point);\n assert(k instanceof BN);\n\n // Precompute window.\n const {width, points} = p._safeNAF(w);\n\n // Get NAF form.\n const naf = getNAF(k, width, k.bitLength() + 1);\n\n // Add `this`*(N+1) for every w-NAF index.\n let acc = this.jpoint();\n\n for (let i = naf.length - 1; i >= 0; i--) {\n const z = naf[i];\n\n if (i !== naf.length - 1)\n acc = acc.dbl();\n\n if (z > 0)\n acc = acc.add(points[(z - 1) >> 1]);\n else if (z < 0)\n acc = acc.sub(points[(-z - 1) >> 1]);\n }\n\n return acc;\n }\n\n _wnafMulAdd(w, points, coeffs) {\n // Multiple point multiplication, also known\n // as \"Shamir's trick\" (with interleaved NAFs).\n //\n // [GECC] Algorithm 3.48, Page 109, Section 3.3.3.\n // Algorithm 3.51, Page 112, Section 3.3.\n //\n // This is particularly useful for signature\n // verifications and mutiplications after an\n // endomorphism split.\n assert((w >>> 0) === w);\n assert(Array.isArray(points));\n assert(Array.isArray(coeffs));\n assert(points.length === coeffs.length);\n\n const length = points.length;\n const wnd = new Array(length);\n const naf = new Array(length);\n\n // Check arrays and calculate size.\n let max = 0;\n\n for (let i = 0; i < length; i++) {\n const point = points[i];\n const coeff = coeffs[i];\n\n assert(point instanceof Point);\n assert(coeff instanceof BN);\n\n if (i > 0 && point.type !== points[i - 1].type)\n throw new Error('Cannot mix points.');\n\n // Avoid sparse arrays.\n wnd[i] = null;\n naf[i] = null;\n\n // Compute max scalar size.\n max = Math.max(max, coeff.bitLength() + 1);\n }\n\n // Compute NAFs.\n let ppoint = null;\n let pcoeff = null;\n let len = 0;\n\n for (let i = 0; i < length; i++) {\n const point = points[i];\n const coeff = coeffs[i];\n const pre = point._getNAF(0);\n\n // Use precomputation if available.\n if (pre) {\n wnd[len] = pre.points;\n naf[len] = getNAF(coeff, pre.width, max);\n len += 1;\n continue;\n }\n\n // Save last non-precomputed point.\n if (!ppoint) {\n ppoint = point;\n pcoeff = coeff;\n continue;\n }\n\n // Compute JSF in NAF form.\n wnd[len] = ppoint._getJNAF(point);\n naf[len] = getJNAF(pcoeff, coeff, max);\n\n ppoint = null;\n pcoeff = null;\n\n len += 1;\n }\n\n // Regular NAF for odd points.\n if (ppoint) {\n const nafw = ppoint._safeNAF(w);\n\n wnd[len] = nafw.points;\n naf[len] = getNAF(pcoeff, nafw.width, max);\n\n len += 1;\n }\n\n // Multiply and add.\n let acc = this.jpoint();\n\n for (let i = max - 1; i >= 0; i--) {\n if (i !== max - 1)\n acc = acc.dbl();\n\n for (let j = 0; j < len; j++) {\n const z = naf[j][i];\n\n if (z > 0)\n acc = acc.add(wnd[j][(z - 1) >> 1]);\n else if (z < 0)\n acc = acc.sub(wnd[j][(-z - 1) >> 1]);\n }\n }\n\n return acc;\n }\n\n _endoWnafMulAdd(points, coeffs) {\n throw new Error('Not implemented.');\n }\n\n _scale(curve, invert) {\n assert(curve instanceof Curve);\n assert(curve.p.eq(this.p));\n\n switch (curve.type) {\n case 'short':\n return this._scaleShort(curve, invert);\n case 'mont':\n return this._scaleMont(curve, invert);\n case 'edwards':\n return this._scaleEdwards(curve, invert);\n default:\n throw new Error('Not implemented.');\n }\n }\n\n _scaleShort(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n _scaleMont(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n _scaleEdwards(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n isElliptic() {\n throw new Error('Not implemented.');\n }\n\n jinv() {\n throw new Error('Not implemented.');\n }\n\n isComplete() {\n return false;\n }\n\n precompute(rng) {\n assert(!this.g.isInfinity(), 'Must have base point.');\n assert(!this.n.isZero(), 'Must have order.');\n\n this.g.precompute(this.n.bitLength(), rng);\n\n return this;\n }\n\n scalar(num, base, endian) {\n const k = new BN(num, base, endian);\n\n assert(!k.red);\n\n if (this.n.isZero())\n return k;\n\n return k.imod(this.n);\n }\n\n field(num, base, endian) {\n const x = BN.cast(num, base, endian);\n\n if (x.red)\n return x.forceRed(this.red);\n\n return x.toRed(this.red);\n }\n\n point(x, y) {\n throw new Error('Not implemented.');\n }\n\n jpoint(x, y, z) {\n throw new Error('Not implemented.');\n }\n\n xpoint(x, z) {\n throw new Error('Not implemented.');\n }\n\n cpoint(xx, xz, yy, yz) {\n assert(xx instanceof BN);\n assert(xz instanceof BN);\n assert(yy instanceof BN);\n assert(yz instanceof BN);\n\n if (xz.isZero() || yz.isZero())\n return this.point();\n\n const z = xz.redMul(yz).redInvert();\n const x = xx.redMul(yz).redMul(z);\n const y = yy.redMul(xz).redMul(z);\n\n return this.point(x, y);\n }\n\n solveX2(y) {\n throw new Error('Not implemented.');\n }\n\n solveX(y) {\n return this.solveX2(y).redSqrt();\n }\n\n solveY2(x) {\n throw new Error('Not implemented.');\n }\n\n solveY(x) {\n return this.solveY2(x).redSqrt();\n }\n\n validate(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromX(x, sign) {\n throw new Error('Not implemented.');\n }\n\n pointFromY(y, sign) {\n throw new Error('Not implemented.');\n }\n\n isIsomorphic(curve) {\n throw new Error('Not implemented.');\n }\n\n isIsogenous(curve) {\n throw new Error('Not implemented.');\n }\n\n pointFromShort(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point, sign) {\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n throw new Error('Not implemented.');\n }\n\n pointToUniform(p) {\n throw new Error('Not implemented.');\n }\n\n pointFromHash(bytes, pake = false) {\n // [H2EC] \"Roadmap\".\n assert(Buffer.isBuffer(bytes));\n assert(typeof pake === 'boolean');\n\n if (bytes.length !== this.fieldSize * 2)\n throw new Error('Invalid hash size.');\n\n // Random oracle encoding.\n // Ensure a proper distribution.\n const s1 = bytes.slice(0, this.fieldSize);\n const s2 = bytes.slice(this.fieldSize);\n const u1 = this.decodeUniform(s1);\n const u2 = this.decodeUniform(s2);\n const p1 = this.pointFromUniform(u1);\n const p2 = this.pointFromUniform(u2);\n const p3 = p1.add(p2);\n\n return pake ? p3.mulH() : p3;\n }\n\n pointToHash(p, subgroup, rng) {\n // [SQUARED] Algorithm 1, Page 8, Section 3.3.\n assert(p instanceof this.Point);\n assert((subgroup >>> 0) === subgroup);\n\n // Add a random torsion component.\n const i = subgroup % this.torsion.length;\n const p0 = p.add(this.torsion[i]);\n\n // Average Cost (R = sqrt):\n //\n // SSWU (~4 iterations) => 8I + 16R\n // SVDW (~4 iterations) => 12I + 28R\n // Elligator 1 (~2 iterations) => 6I + 10R\n // Elligator 2 (~2 iterations) => 4I + 6R\n // Ristretto (~1 iteration) => 1I + 2R + h*1R\n for (;;) {\n const u1 = this.randomField(rng);\n const p1 = this.pointFromUniform(u1);\n\n // Avoid 2-torsion points:\n // Short Weierstrass: ((A / 3) / B, 0)\n // Montgomery: (0, 0)\n // Twisted Edwards: (0, -1)\n if (p1.neg().eq(p1))\n continue;\n\n const p2 = p0.sub(p1);\n const hint = randomInt(rng);\n\n let u2;\n try {\n u2 = this.pointToUniform(p2, hint & 15);\n } catch (e) {\n if (e.message === 'Invalid point.')\n continue;\n throw e;\n }\n\n const s1 = this.encodeUniform(u1, hint >>> 8);\n const s2 = this.encodeUniform(u2, hint >>> 16);\n\n return Buffer.concat([s1, s2]);\n }\n }\n\n randomScalar(rng) {\n const max = this.n.isZero() ? this.p : this.n;\n return BN.random(rng, 1, max);\n }\n\n randomField(rng) {\n return BN.random(rng, 1, this.p).toRed(this.red);\n }\n\n randomPoint(rng) {\n let p;\n\n for (;;) {\n const x = this.randomField(rng);\n const sign = (randomInt(rng) & 1) !== 0;\n\n try {\n p = this.pointFromX(x, sign);\n } catch (e) {\n continue;\n }\n\n assert(p.validate());\n\n return p.mulH();\n }\n }\n\n mulAll(points, coeffs) {\n return this.jmulAll(points, coeffs);\n }\n\n jmulAll(points, coeffs) {\n assert(Array.isArray(points));\n assert(points.length === 0 || (points[0] instanceof Point));\n\n // Multiply with endomorphism if we're using affine points.\n if (this.endo && points.length > 0 && points[0].type === types.AFFINE)\n return this._endoWnafMulAdd(points, coeffs);\n\n // Otherwise, a regular Shamir's trick.\n return this._wnafMulAdd(5, points, coeffs);\n }\n\n mulH(k) {\n assert(k instanceof BN);\n return this.imulH(k.clone());\n }\n\n imulH(k) {\n assert(k instanceof BN);\n assert(!k.red);\n\n const word = this.h.word(0);\n\n // Optimize for powers of two.\n if ((word & (word - 1)) === 0) {\n const bits = this.h.bitLength();\n return k.iushln(bits - 1).imod(this.n);\n }\n\n return k.imuln(word).imod(this.n);\n }\n\n normalizeAll(points) {\n assert(Array.isArray(points));\n\n const len = points.length;\n const z = new Array(len);\n\n for (let i = 0; i < len; i++) {\n const p = points[i];\n\n assert(p instanceof Point);\n assert(p.curve === this);\n\n if (p.type === types.AFFINE) {\n z[i] = this.one;\n continue;\n }\n\n z[i] = p.z;\n }\n\n const zi = this.red.invertAll(z);\n const out = new Array(len);\n\n for (let i = 0; i < len; i++)\n out[i] = points[i].scale(zi[i]);\n\n return out;\n }\n\n affinizeAll(points) {\n return this.normalizeAll(points);\n }\n\n clamp(scalar) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n assert(Buffer.isBuffer(scalar));\n assert(scalar.length === this.scalarSize);\n assert(this.scalarSize <= this.fieldSize);\n\n let top = (this.fieldBits & 7) || 8;\n let lsb = 0;\n let msb = this.scalarSize - 1;\n\n // Swap endianness.\n if (this.endian === 'be')\n [lsb, msb] = [msb, lsb];\n\n // Adjust for low order.\n if (this.scalarSize < this.fieldSize)\n top = 8;\n\n // Ensure a multiple of the cofactor.\n scalar[lsb] &= -this.h.word(0) & 0xff;\n\n // Clamp to the prime.\n scalar[msb] &= (1 << top) - 1;\n\n // Set the high bit.\n scalar[msb] |= 1 << (top - 1);\n\n return scalar;\n }\n\n splitHash(bytes) {\n // [RFC8032] Section 5.1.6 & 5.2.6.\n assert(Buffer.isBuffer(bytes));\n assert(bytes.length === this.adjustedSize * 2);\n assert(this.scalarSize <= this.adjustedSize);\n\n let off = 0;\n\n if (this.endian === 'be')\n off = this.adjustedSize - this.scalarSize;\n\n const scalar = bytes.slice(off, off + this.scalarSize);\n const prefix = bytes.slice(this.adjustedSize);\n\n this.clamp(scalar);\n\n return [scalar, prefix];\n }\n\n encodeField(x) {\n // [SEC1] Page 12, Section 2.3.5.\n assert(x instanceof BN);\n assert(!x.red);\n\n return x.encode(this.endian, this.fieldSize);\n }\n\n decodeField(bytes) {\n // [SEC1] Page 13, Section 2.3.6.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.fieldSize)\n throw new Error('Invalid field element size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeAdjusted(x) {\n assert(x instanceof BN);\n assert(!x.red);\n\n return x.encode(this.endian, this.adjustedSize);\n }\n\n decodeAdjusted(bytes) {\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.adjustedSize)\n throw new Error('Invalid field element size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeScalar(k) {\n // [SEC1] Page 13, Section 2.3.7.\n assert(k instanceof BN);\n assert(!k.red);\n\n return k.encode(this.endian, this.scalarSize);\n }\n\n decodeScalar(bytes) {\n // [SEC1] Page 14, Section 2.3.8.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.scalarSize)\n throw new Error('Invalid scalar size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeClamped(k) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n return this.clamp(this.encodeScalar(k));\n }\n\n decodeClamped(bytes) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.scalarSize)\n throw new Error('Invalid scalar size.');\n\n const clamped = this.clamp(Buffer.from(bytes));\n\n return BN.decode(clamped, this.endian);\n }\n\n encodeUniform(x, bits) {\n assert(x instanceof BN);\n assert((bits >>> 0) === bits);\n\n const msb = this.endian === 'le' ? this.fieldSize - 1 : 0;\n const bytes = x.fromRed().encode(this.endian, this.fieldSize);\n\n bytes[msb] |= (bits & ~this.mask) & 0xff;\n\n return bytes;\n }\n\n decodeUniform(bytes) {\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.fieldSize)\n throw new Error('Invalid field size.');\n\n const x = BN.decode(bytes, this.endian);\n\n x.iumaskn(this.fieldBits);\n\n return x.toRed(this.red);\n }\n\n encodePoint(point, compact) {\n assert(point instanceof Point);\n return point.encode(compact);\n }\n\n decodePoint(bytes) {\n throw new Error('Not implemented.');\n }\n\n encodeX(point) {\n throw new Error('Not implemented.');\n }\n\n decodeX(bytes) {\n throw new Error('Not implemented.');\n }\n\n decodeEven(bytes) {\n throw new Error('Not implemented.');\n }\n\n decodeSquare(bytes) {\n throw new Error('Not implemented.');\n }\n\n toShort() {\n throw new Error('Not implemented.');\n }\n\n toMont(b0) {\n throw new Error('Not implemented.');\n }\n\n toEdwards(a0) {\n throw new Error('Not implemented.');\n }\n\n pointToJSON(point, pre) {\n assert(point instanceof Point);\n return point.toJSON(pre);\n }\n\n pointFromJSON(json) {\n throw new Error('Not implemented.');\n }\n\n toJSON(pre) {\n let prefix, context;\n let n, z, endo;\n\n if (this.type === 'edwards') {\n prefix = this.prefix ? this.prefix.toString() : null;\n context = this.context;\n }\n\n if (!this.n.isZero())\n n = this.n.toJSON();\n\n if (!this.z.isZero()) {\n z = this.z.fromRed();\n\n if (this.z.redIsHigh())\n z.isub(this.p);\n\n z = z.toString(16);\n }\n\n if (this.endo)\n endo = this.endo.toJSON();\n\n return {\n id: this.id,\n ossl: this.ossl,\n type: this.type,\n endian: this.endian,\n hash: this.hash,\n prefix,\n context,\n prime: this.prime,\n p: this.p.toJSON(),\n a: undefined,\n b: undefined,\n d: undefined,\n n,\n h: this.h.toString(16),\n s: undefined,\n z,\n c: undefined,\n g: this.g.toJSON(pre),\n endo\n };\n }\n\n static fromJSON(json) {\n return new this(json);\n }\n}\n\n/**\n * Point\n */\n\nclass Point {\n constructor(curve, type) {\n assert(curve instanceof Curve);\n assert((type >>> 0) === type);\n\n this.curve = curve;\n this.type = type;\n this.pre = null;\n }\n\n _init() {\n throw new Error('Not implemented.');\n }\n\n _safeNAF(width) {\n assert((width >>> 0) === width);\n\n if (this.pre && this.pre.naf)\n return this.pre.naf;\n\n if (width === 0)\n return null;\n\n const size = 1 << (width - 2);\n const points = new Array(size);\n const p = this.toJ();\n const dbl = size === 1 ? null : p.dbl();\n\n points[0] = p;\n\n for (let i = 1; i < size; i++)\n points[i] = points[i - 1].add(dbl);\n\n return new NAF(width, points);\n }\n\n _getNAF(width) {\n assert((width >>> 0) === width);\n\n if (this.pre && this.pre.naf)\n return this.pre.naf;\n\n if (width === 0)\n return null;\n\n const odds = this._safeNAF(width).points;\n const points = this.curve.affinizeAll(odds);\n\n return new NAF(width, points);\n }\n\n _getWindows(width, bits) {\n assert((width >>> 0) === width);\n assert((bits >>> 0) === bits);\n\n if (this.pre && this.pre.windows)\n return this.pre.windows;\n\n if (width === 0)\n return null;\n\n const size = 1 << width;\n const steps = ((bits + width - 1) / width) >>> 0;\n const wnds = new Array(steps * size);\n\n let g = this.toJ();\n\n for (let i = 0; i < steps; i++) {\n wnds[i * size] = this.curve.jpoint();\n\n for (let j = 1; j < size; j++)\n wnds[i * size + j] = wnds[i * size + j - 1].add(g);\n\n g = g.dblp(width);\n }\n\n const points = this.curve.affinizeAll(wnds);\n\n return new Windows(width, bits, points);\n }\n\n _getDoubles(step, power) {\n assert((step >>> 0) === step);\n assert((power >>> 0) === power);\n\n if (this.pre && this.pre.doubles)\n return this.pre.doubles;\n\n if (step === 0)\n return null;\n\n const len = Math.ceil(power / step) + 1;\n const dbls = new Array(len);\n\n let acc = this.toJ();\n let k = 0;\n\n dbls[k++] = acc;\n\n for (let i = 0; i < power; i += step) {\n for (let j = 0; j < step; j++)\n acc = acc.dbl();\n\n dbls[k++] = acc;\n }\n\n assert(k === len);\n\n const points = this.curve.affinizeAll(dbls);\n\n return new Doubles(step, points);\n }\n\n _getBeta() {\n return null;\n }\n\n _getBlinding(rng) {\n if (this.pre && this.pre.blinding)\n return this.pre.blinding;\n\n if (!rng)\n return null;\n\n if (this.curve.n.isZero())\n return null;\n\n // Pregenerate a random blinding value:\n //\n // blind = random integer in [1,n-1]\n // unblind = G * blind\n //\n // We intend to subtract the blinding value\n // from scalars before multiplication. We\n // can add the unblinding point once the\n // multiplication is complete.\n const blind = this.curve.randomScalar(rng);\n const unblind = this.mul(blind);\n\n return new Blinding(blind, unblind);\n }\n\n _hasWindows(k) {\n assert(k instanceof BN);\n\n if (!this.pre || !this.pre.windows)\n return false;\n\n const {width, bits} = this.pre.windows;\n const steps = ((bits + width - 1) / width) >>> 0;\n\n return k.bitLength() <= steps * width;\n }\n\n _hasDoubles(k) {\n assert(k instanceof BN);\n\n if (!this.pre || !this.pre.doubles)\n return false;\n\n const {step, points} = this.pre.doubles;\n const power = k.bitLength() + 1;\n\n return points.length >= Math.ceil(power / step) + 1;\n }\n\n _getJNAF(point) {\n assert(point instanceof Point);\n assert(point.type === this.type);\n\n // Create comb for JSF.\n return [\n this, // 1\n this.add(point), // 3\n this.sub(point), // 5\n point // 7\n ];\n }\n\n _blind(k, rng) {\n // [SIDE1] Page 5, Section 4.\n // [BLIND] Page 20, Section 7.\n assert(k instanceof BN);\n assert(!k.red);\n\n // Scalar splitting (requires precomputation).\n //\n // Blind a multiplication by first subtracting\n // a blinding value from the scalar. Example:\n //\n // b = random integer in [1,n-1]\n // B = P * b (precomputed)\n // Q = P * (k - b) + B\n //\n // Note that Joye describes a different method\n // (multiplier randomization) which computes:\n //\n // B = random point in E\n // Q = (P + B) * k - B * k\n //\n // Our method is more similar to the \"scalar\n // splitting\" technique described in the\n // second source above.\n //\n // The blinding value and its corresponding\n // point are randomly generated and computed\n // on boot. As long as an attacker is not\n // able to observe the boot, this should give\n // a decent bit of protection against various\n // channel attacks.\n if (this.pre && this.pre.blinding) {\n const {blind, unblind} = this.pre.blinding;\n const t = k.sub(blind);\n\n return [this, t, unblind];\n }\n\n // Randomization is not possible without\n // an RNG. Do a normal multiplication.\n if (!rng)\n return [this, k, null];\n\n // If we have no precomputed blinding\n // factor, there are two possibilities\n // for randomization:\n //\n // 1. Randomize the multiplier by adding\n // a random multiple of `n`.\n //\n // 2. Re-scale the point itself by a\n // random factor.\n //\n // The first option can be accomplished\n // with some like:\n //\n // a = random integer in [1,n-1]\n // r = a * n\n // Q = P * (k + r)\n //\n // The second is accomplished with:\n //\n // a = random element in F(p)\n // R = (x * a^2, y * a^3, z * a)\n // Q = R * k\n //\n // If we have precomputed doubles / naf\n // points, we opt for the first method\n // to avoid randomizing everything.\n if (this.pre) {\n if (this.curve.n.isZero())\n return [this, k, null];\n\n const a = this.curve.randomScalar(rng);\n const r = a.mul(this.curve.n);\n const t = r.iadd(k);\n\n return [this, t, null];\n }\n\n // If there is no precomputation _at all_,\n // we opt for the second method.\n const p = this.randomize(rng);\n\n return [p, k, null];\n }\n\n clone() {\n throw new Error('Not implemented.');\n }\n\n precompute(bits, rng) {\n assert((bits >>> 0) === bits);\n\n if (!this.pre)\n this.pre = new Precomp();\n\n if (!this.pre.naf)\n this.pre.naf = this._getNAF(9);\n\n if (USE_FIXED && !this.pre.windows)\n this.pre.windows = this._getWindows(4, bits);\n\n if (!this.pre.doubles)\n this.pre.doubles = this._getDoubles(4, bits + 1);\n\n if (!this.pre.beta)\n this.pre.beta = this._getBeta();\n\n if (!this.pre.blinding)\n this.pre.blinding = this._getBlinding(rng);\n\n return this;\n }\n\n validate() {\n return this.curve.validate(this);\n }\n\n normalize() {\n return this;\n }\n\n scale(a) {\n throw new Error('Not implemented.');\n }\n\n randomize(rng) {\n const z = this.curve.randomField(rng);\n return this.scale(z);\n }\n\n neg() {\n throw new Error('Not implemented.');\n }\n\n add(point) {\n throw new Error('Not implemented.');\n }\n\n sub(point) {\n assert(point instanceof Point);\n return this.add(point.neg());\n }\n\n dbl() {\n throw new Error('Not implemented.');\n }\n\n dblp(pow) {\n // Repeated doubling. This can\n // be optimized by child classes.\n assert((pow >>> 0) === pow);\n\n let r = this;\n\n for (let i = 0; i < pow; i++)\n r = r.dbl();\n\n return r;\n }\n\n diffAddDbl(p, q) {\n throw new Error('Not implemented.');\n }\n\n getX() {\n throw new Error('Not implemented.');\n }\n\n getY() {\n throw new Error('Not implemented.');\n }\n\n eq(point) {\n throw new Error('Not implemented.');\n }\n\n cmp(point) {\n throw new Error('Not implemented.');\n }\n\n isInfinity() {\n throw new Error('Not implemented.');\n }\n\n isOrder2() {\n throw new Error('Not implemented.');\n }\n\n isOdd() {\n throw new Error('Not implemented.');\n }\n\n isEven() {\n throw new Error('Not implemented.');\n }\n\n isSquare() {\n throw new Error('Not implemented.');\n }\n\n eqX(x) {\n throw new Error('Not implemented.');\n }\n\n eqR(x) {\n throw new Error('Not implemented.');\n }\n\n isSmall() {\n // Test whether the point is of small order.\n if (this.isInfinity())\n return false;\n\n // P * h = O\n return this.jmulH().isInfinity();\n }\n\n hasTorsion() {\n // Test whether the point is in another subgroup.\n if (this.isInfinity())\n return false;\n\n // P * n != O\n return !this.jmul(this.curve.n).isInfinity();\n }\n\n order() {\n // Calculate point order.\n const {h, n} = this.curve;\n\n let p = this.toJ();\n let q = new BN(1);\n\n while (!p.isInfinity()) {\n q.iaddn(1);\n\n if (q.cmp(h) > 0) {\n q = n.clone();\n break;\n }\n\n p = p.add(this);\n }\n\n return q;\n }\n\n mul(k) {\n return this.jmul(k);\n }\n\n muln(k) {\n return this.jmuln(k);\n }\n\n mulBlind(k, rng) {\n return this.jmulBlind(k, rng);\n }\n\n mulAdd(k1, p2, k2) {\n return this.jmulAdd(k1, p2, k2);\n }\n\n mulH() {\n return this.jmulH();\n }\n\n div(k) {\n return this.jdiv(k);\n }\n\n divn(k) {\n return this.jdivn(k);\n }\n\n divH() {\n return this.jdivH();\n }\n\n jmul(k) {\n if (USE_FIXED && this._hasWindows(k))\n return this.curve._fixedMul(this, k);\n\n if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n\n if (this.curve.endo && this.type === types.AFFINE)\n return this.curve._endoWnafMulAdd([this], [k]);\n\n return this.curve._wnafMul(5, this, k);\n }\n\n jmuln(k) {\n assert((k | 0) === k);\n return this.jmul(new BN(k));\n }\n\n jmulBlind(k, rng = null) {\n const [p, t, unblind] = this._blind(k, rng);\n const q = p.jmul(t);\n\n if (unblind)\n return q.add(unblind);\n\n return q;\n }\n\n jmulAdd(k1, p2, k2) {\n if (this.curve.endo && this.type === types.AFFINE)\n return this.curve._endoWnafMulAdd([this, p2], [k1, k2]);\n\n return this.curve._wnafMulAdd(5, [this, p2], [k1, k2]);\n }\n\n jmulH() {\n const word = this.curve.h.word(0);\n\n // Optimize for powers of two.\n if ((word & (word - 1)) === 0) {\n const bits = this.curve.h.bitLength();\n return this.toJ().dblp(bits - 1);\n }\n\n return this.jmul(this.curve.h);\n }\n\n jdiv(k) {\n assert(k instanceof BN);\n assert(!k.red);\n\n return this.jmul(k.invert(this.curve.n));\n }\n\n jdivn(k) {\n assert(!this.curve.n.isZero());\n\n if (this.curve.h.cmpn(k) === 0)\n return this.jdivH();\n\n return this.jdiv(new BN(k));\n }\n\n jdivH() {\n if (this.curve.n.isZero())\n return this.toJ();\n\n if (this.curve.h.cmpn(1) === 0)\n return this.toJ();\n\n if (this.curve.hi === null)\n this.curve.hi = this.curve.h.invert(this.curve.n);\n\n return this.jmul(this.curve.hi);\n }\n\n toP() {\n return this.normalize();\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n return this;\n }\n\n key() {\n if (this.isInfinity())\n return `${this.curve.uid}:oo`;\n\n this.normalize();\n\n const x = this.getX().toString(16);\n const y = this.getY().toString(16);\n\n return `${this.curve.uid}:${x},${y}`;\n }\n\n encode(compact) {\n throw new Error('Not implemented.');\n }\n\n static decode(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n encodeX() {\n throw new Error('Not implemented.');\n }\n\n static decodeX(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n static decodeEven(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n static decodeSquare(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n toJSON(pre) {\n throw new Error('Not implemented.');\n }\n\n static fromJSON(curve, json) {\n throw new Error('Not implemented.');\n }\n\n [custom]() {\n return '';\n }\n}\n\n/**\n * ShortCurve\n */\n\nclass ShortCurve extends Curve {\n constructor(conf) {\n super(ShortPoint, 'short', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.b = BN.fromJSON(conf.b).toRed(this.red);\n this.c = BN.fromJSON(conf.c || '0').toRed(this.red);\n this.ai = this.a.isZero() ? this.zero : this.a.redInvert();\n this.zi = this.z.isZero() ? this.zero : this.z.redInvert();\n\n this.zeroA = this.a.isZero();\n this.threeA = this.a.eq(this.three.redNeg());\n this.redN = this.n.toRed(this.red);\n this.pmodn = this.p.clone();\n this.highOrder = this.n.cmp(this.p) >= 0;\n this.smallGap = false;\n\n this._finalize(conf);\n }\n\n _finalize(conf) {\n super._finalize(conf);\n\n // Precalculate endomorphism.\n if (conf.endo != null)\n this.endo = Endo.fromJSON(this, conf.endo);\n else\n this.endo = this._getEndomorphism();\n\n if (!this.n.isZero()) {\n this.pmodn = this.p.mod(this.n);\n\n // Check for Maxwell's trick (see eqR).\n this.smallGap = this.p.div(this.n).cmpn(1) <= 0;\n }\n\n return this;\n }\n\n static _isomorphism(curveA, curveB, custom, odd) {\n // Short Weierstrass Isomorphism.\n //\n // [GECC] Page 84, Section 3.1.5.\n // [ARITH1] Page 274, Section 13.1.5.\n // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves).\n //\n // Find `u` such that `a * u^4 = a'` and `b * u^6 = b'`.\n //\n // Transformation:\n //\n // u4 = a' / a\n // u2 = +-sqrt(u4)\n // u6 = u4 * u2\n // a' = a * u4\n // b' = b * u6\n //\n // Where `u2` is any root that is square.\n //\n // If a = 0, we can do:\n //\n // a' = 0\n // b' = b'\n //\n // Where (b' / b)^(1 / 3) is square.\n //\n // If b = 0, we can do:\n //\n // a' = a'\n // b' = 0\n //\n // Where sqrt(a' / a) is square.\n assert(curveA instanceof BN);\n assert(curveB instanceof BN);\n assert(custom instanceof BN);\n assert(odd == null || typeof odd === 'boolean');\n assert(!curveA.isZero() || !curveB.isZero());\n\n if (custom.isZero())\n throw new Error('Invalid coefficient.');\n\n if (curveA.isZero()) {\n const customB = custom;\n const u6 = customB.redDiv(curveB);\n // Todo: allow index flag.\n const u2 = uncube(u6);\n\n // Already checked in uncube().\n assert(u2.redJacobi() === 1);\n\n return [curveA.clone(), customB.clone()];\n }\n\n if (curveB.isZero()) {\n const customA = custom;\n const u4 = customA.redDiv(curveA);\n const u2 = u4.redSqrt();\n\n // Todo: allow odd flag.\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n\n if (u2.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n return [customA.clone(), curveB.clone()];\n }\n\n const customA = custom;\n const u4 = customA.redDiv(curveA);\n const u2 = u4.redSqrt();\n\n if (odd != null) {\n if (u2.redIsOdd() !== odd)\n u2.redINeg();\n } else {\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n }\n\n if (u2.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n const u6 = u4.redMul(u2);\n const a = curveA.redMul(u4);\n const b = curveB.redMul(u6);\n\n assert(a.eq(customA));\n\n return [a, b];\n }\n\n _short(a0, odd) {\n return ShortCurve._isomorphism(this.a, this.b, a0, odd);\n }\n\n _mont(b0, odd) {\n // Short Weierstrass->Montgomery Equivalence.\n //\n // [ARITH1] Page 286, Section 13.2.3.c.\n // [SAFE] \"Ladders\".\n //\n // Transformation:\n //\n // r = A / (3 * B)\n // s = +-sqrt(3 * r^2 + a)\n // A = 3 * r / s\n // B = 1 / s\n const [r, s] = this._findRS(odd);\n const b = s.redInvert();\n const a = r.redMuln(3).redMul(b);\n\n if (b0 != null)\n return MontCurve._isomorphism(a, b, b0);\n\n return [a, b];\n }\n\n _edwards(a0, odd) {\n // Short Weierstrass->Twisted Edwards Equivalence.\n //\n // [TWISTEQ] Section 1.\n //\n // Transformation:\n //\n // r = (a' + d') / 6\n // s = +-sqrt(3 * r^2 + a)\n // a' = 3 * r + 2 * s\n // d' = 3 * r - 2 * s\n const [r, s] = this._findRS(odd);\n const r3 = r.redMuln(3);\n const s2 = s.redMuln(2);\n const a = r3.redAdd(s2);\n const d = r3.redSub(s2);\n\n if (a0 != null)\n return EdwardsCurve._isomorphism(a, d, a0);\n\n return [a, d];\n }\n\n _findRS(sign) {\n // Find `r` and `s` for equivalence.\n //\n // [ARITH1] Page 286, Section 13.2.3.c.\n // [SAFE] \"Ladders\".\n //\n // Computation:\n //\n // r = solve(r^3 + a * r + b == 0, r)\n // s = +-sqrt(3 * r^2 + a)\n //\n // Computing `r` is non-trivial. We need\n // to solve `r^3 + a * r + b = 0`, but we\n // don't have a polynomial solver, so we\n // loop over random points until we find\n // one with 2-torsion. Multiplying by the\n // subgroup order should yield a point of\n // ((A / 3) / B, 0) which is a solution.\n assert(sign == null || typeof sign === 'boolean');\n assert(this.h.word(0) >= 4);\n assert(!this.n.isZero());\n\n const x = this.one.redNeg();\n\n let p;\n\n for (;;) {\n x.redIAdd(this.one);\n\n try {\n p = this.pointFromX(x.clone());\n } catch (e) {\n continue;\n }\n\n p = p.mul(this.n);\n\n if (p.isInfinity())\n continue;\n\n if (!p.y.isZero())\n continue;\n\n break;\n }\n\n const r = p.x;\n const r2 = r.redSqr();\n const s = r2.redMuln(3).redIAdd(this.a).redSqrt();\n\n if (sign != null) {\n if (s.redIsOdd() !== sign)\n s.redINeg();\n }\n\n return [r, s];\n }\n\n _scale0(a, b) {\n // We can extract the isomorphism factors with:\n //\n // u4 = a' / a\n // u6 = b' / b\n // u2 = +-sqrt(u4)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // `u2` should be picked such that `u4 * u2 = u6`.\n //\n // If a = 0, we can do:\n //\n // u6 = b' / b\n // u2 = u6^(1 / 3)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // Where `u2` is any root that is square.\n //\n // If b = 0, we can do:\n //\n // u4 = a' / a\n // u2 = +-sqrt(u4)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // Where `u2` is any root that is square.\n assert(this.a.isZero() === a.isZero());\n assert(this.b.isZero() === b.isZero());\n\n if (this.a.isZero()) {\n const u6 = this.b.redDiv(this.field(b));\n // Todo: figure out how to check index.\n const u2 = uncube(u6);\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(u3.redSqr().eq(u6));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n if (this.b.isZero()) {\n const u4 = this.a.redDiv(this.field(a));\n const u2 = u4.redSqrt();\n\n // Todo: figure out how to check oddness.\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(u3.redMul(u).eq(u4));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n const u4 = this.a.redDiv(this.field(a));\n const u6 = this.b.redDiv(this.field(b));\n const u2 = u4.redSqrt();\n\n if (!u4.redMul(u2).eq(u6))\n u2.redINeg();\n\n assert(u4.redMul(u2).eq(u6));\n\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n _scale1(x, y) {\n // If base points are available, it is much\n // easier, with:\n //\n // u2 = x' / x\n // u3 = y' / y\n // u = +-sqrt(u2)\n //\n // `u` should be picked such that `u2 * u = u3`.\n const u2 = this.g.x.redDiv(this.field(x));\n const u3 = this.g.y.redDiv(this.field(y));\n const u = u2.redSqrt();\n\n if (!u2.redMul(u).eq(u3))\n u.redINeg();\n\n assert(u2.redMul(u).eq(u3));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this._scale0(curve.a, curve.b);\n\n return this._scale1(curve.g.x, curve.g.y);\n }\n\n _scaleMont(curve) {\n assert(curve instanceof MontCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a, b] = curve._short();\n return this._scale0(a, b);\n }\n\n const {x, y} = curve.g;\n const nx = x.redAdd(curve.a3).redMul(curve.bi);\n const ny = y.redMul(curve.bi);\n\n return this._scale1(nx, ny);\n }\n\n _scaleEdwards(curve) {\n assert(curve instanceof EdwardsCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a, b] = curve._short();\n return this._scale0(a, b);\n }\n\n const {x, y, z} = curve.g;\n const a5 = curve.a.redMuln(5);\n const d5 = curve.d.redMuln(5);\n const dma = curve.d.redSub(curve.a);\n const d5a = d5.redSub(curve.a);\n const da5 = curve.d.redSub(a5);\n const ypz = y.redAdd(z);\n const ymz = y.redSub(z);\n const xx = d5a.redMul(y).redIAdd(da5.redMul(z));\n const xz = ymz.redMuln(12);\n const yy = dma.redMul(ypz).redMul(z);\n const yz = ymz.redMul(x).redIMuln(4);\n const zi = xz.redMul(yz).redInvert();\n const nx = xx.redMul(yz).redMul(zi);\n const ny = yy.redMul(xz).redMul(zi);\n\n return this._scale1(nx, ny);\n }\n\n _getEndomorphism(index = 0) {\n // Compute endomorphism.\n //\n // [GECC] Example 3.76, Page 128, Section 3.5.\n\n // No curve params.\n if (this.n.isZero() || this.g.isInfinity())\n return null;\n\n // No efficient endomorphism.\n if (!this.zeroA || this.p.modrn(3) !== 1 || this.n.modrn(3) !== 1)\n return null;\n\n // Solve beta^3 mod p = 1.\n const [b1, b2] = this._getEndoRoots(this.p);\n\n // Choose the smallest beta by default.\n const beta = [b1, b2][index & 1].toRed(this.red);\n\n // Solve lambda^3 mod n = 1.\n const [l1, l2] = this._getEndoRoots(this.n);\n\n // Choose the lambda matching selected beta.\n // Note that P * lambda = (x * beta, y).\n const p = this.point(this.g.x.redMul(beta), this.g.y);\n\n let lambda;\n\n if (this.g.mul(l1).eq(p)) {\n lambda = l1;\n } else {\n assert(this.g.mul(l2).eq(p));\n lambda = l2;\n }\n\n // Get basis vectors.\n const basis = this._getEndoBasis(lambda);\n\n // Precompute `g1` and `g2`.\n const pre = this._getEndoPrecomp(basis);\n\n return new Endo(beta, lambda, basis, pre);\n }\n\n _getEndoRoots(num) {\n // Find roots for x^2 + x + 1 in F.\n //\n // [GECC] Example 3.76, Page 128, Section 3.5.\n // [GLV] Page 192, Section 2 (Endomorphisms).\n //\n // The above document doesn't fully explain how\n // to derive these and only \"hints\" at it, as\n // mentioned by Hal Finney[1], but we're basically\n // computing two possible cube roots of 1 here.\n //\n // Note that we could also compute[2]:\n //\n // beta = 2^((p - 1) / 3) mod p\n // lambda = 3^((n - 1) / 3) mod n\n //\n // As an extension of Fermat's little theorem:\n //\n // g^(p - 1) mod p == 1\n //\n // It is suspected[3] this is how Hal Finney[4]\n // computed his original endomorphism roots.\n //\n // @indutny's method for computing cube roots\n // of unity[5] appears to be the method described\n // on wikipedia[6][7].\n //\n // Sage produces the same solution:\n //\n // sage: solve(x^2 + x + 1 == 0, x)\n // [x == -1/2*I*sqrt(3) - 1/2, x == 1/2*I*sqrt(3) - 1/2]\n //\n // This can be reduced to:\n //\n // x = (+-sqrt(-3) - 1) / 2\n //\n // [1] https://bitcointalk.org/index.php?topic=3238.msg45565#msg45565\n // [2] https://crypto.stackexchange.com/a/22739\n // [3] https://bitcoin.stackexchange.com/a/35872\n // [4] https://github.com/halfinney/bitcoin/commit/dc411b5\n // [5] https://en.wikipedia.org/wiki/Cube_root_of_unity\n // [6] https://en.wikipedia.org/wiki/Splitting_field#Cubic_example\n // [7] http://mathworld.wolfram.com/SplittingField.html\n const red = num === this.p ? this.red : BN.mont(num);\n const two = new BN(2).toRed(red);\n const three = new BN(3).toRed(red);\n const i2 = two.redInvert();\n\n // S1 = sqrt(-3) / 2\n const s1 = three.redNeg().redSqrt().redMul(i2);\n\n // S2 = -S1\n const s2 = s1.redNeg();\n\n // R1 = S1 - 1 / 2\n const r1 = s1.redSub(i2).fromRed();\n\n // R2 = S2 - 1 / 2\n const r2 = s2.redSub(i2).fromRed();\n\n return [r1, r2].sort(BN.cmp);\n }\n\n _getEndoBasis(lambda) {\n // Compute endomorphic basis.\n //\n // This essentially computes Cornacchia's algorithm\n // for solving x^2 + d * y^2 = m (d = lambda, m = order).\n //\n // https://en.wikipedia.org/wiki/Cornacchia%27s_algorithm\n //\n // [GECC] Algorithm 3.74, Page 127, Section 3.5.\n // [GLV] Page 196, Section 4 (Decomposing K).\n //\n // Balanced length-two representation of a multiplier.\n //\n // 1. Run the extended euclidean algorithm with inputs n\n // and lambda. The algorithm produces a sequence of\n // equations si*n + ti*lam = ri where s0=1, t0=0,\n // r0=n, s1=0, t1=1, r1=lam, and the remainders ri\n // and are non-negative and strictly decreasing. Let\n // l be the greatest index for which rl >= sqrt(n).\n const [rl, tl, rl1, tl1, rl2, tl2] = this._egcdSqrt(lambda);\n\n // 2. Set (a1, b1) <- (rl+1, -tl+1).\n const a1 = rl1;\n const b1 = tl1.neg();\n\n // 3. If (rl^2 + tl^2) <= (rl+2^2 + tl+2^2)\n // then set (a2, b2) <- (rl, -tl).\n // else set (a2, b2) <- (rl+2, -tl+2).\n const lhs = rl.sqr().iadd(tl.sqr());\n const rhs = rl2.sqr().iadd(tl2.sqr());\n\n let a2, b2;\n\n if (lhs.cmp(rhs) <= 0) {\n a2 = rl;\n b2 = tl.neg();\n } else {\n a2 = rl2;\n b2 = tl2.neg();\n }\n\n return [\n new Vector(a1, b1),\n new Vector(a2, b2)\n ];\n }\n\n _egcdSqrt(lambda) {\n // Extended Euclidean algorithm for integers.\n //\n // [GECC] Algorithm 2.19, Page 40, Section 2.2.\n // [GLV] Page 196, Section 4 (Decomposing K).\n assert(lambda instanceof BN);\n assert(!lambda.red);\n assert(lambda.sign() > 0);\n assert(this.n.sign() > 0);\n\n // Note that we insert the approximate square\n // root checks as described in algorithm 3.74.\n //\n // Algorithm 2.19 is defined as:\n //\n // 1. u <- a\n // v <- b\n //\n // 2. x1 <- 1\n // y1 <- 0\n // x2 <- 0\n // y2 <- 1\n //\n // 3. while u != 0 do\n //\n // 3.1. q <- floor(v / u)\n // r <- v - q * u\n // x <- x2 - q * x1\n // y <- y2 - q * y1\n //\n // 3.2. v <- u\n // u <- r\n // x2 <- x1\n // x1 <- x\n // y2 <- y1\n // y1 <- y\n //\n // 4. d <- v\n // x <- x2\n // y <- y2\n //\n // 5. Return (d, x, y).\n\n // Start with an approximate square root of n.\n const sqrtn = this.n.ushrn(this.n.bitLength() >>> 1);\n\n let u = lambda; // r1\n let v = this.n.clone(); // r0\n let x1 = new BN(1); // t1\n let y1 = new BN(0); // t0\n let x2 = new BN(0); // s1\n let y2 = new BN(1); // s0\n\n // All vectors are roots of: a + b * lambda = 0 (mod n).\n let rl, tl;\n\n // First vector.\n let rl1, tl1;\n\n // Inner.\n let i = 0;\n let j = 0;\n let p;\n\n // Compute EGCD.\n while (!u.isZero() && i < 2) {\n const q = v.quo(u);\n const r = v.sub(q.mul(u));\n const x = x2.sub(q.mul(x1));\n const y = y2.sub(q.mul(y1));\n\n // Check for r < sqrt(n).\n if (j === 0 && r.cmp(sqrtn) < 0) {\n rl = p;\n tl = x1;\n rl1 = r;\n tl1 = x;\n j = 1; // 1 more round.\n }\n\n p = r;\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n\n i += j;\n }\n\n // Should never happen.\n assert(j !== 0, 'Could not find r < sqrt(n).');\n\n // Second vector.\n const rl2 = x2;\n const tl2 = x1;\n\n return [\n rl,\n tl,\n rl1,\n tl1,\n rl2,\n tl2\n ];\n }\n\n _getEndoPrecomp(basis) {\n // Precompute `g1` and `g2` to avoid round division.\n //\n // [JCEN12] Page 5, Section 4.3.\n //\n // Computation:\n //\n // d = a1 * b2 - b1 * a2\n // t = ceil(log2(d+1)) + p\n // g1 = round((2^t * b2) / d)\n // g2 = round((2^t * b1) / d)\n //\n // Where:\n //\n // `p` is the number of precision bits.\n // `d` is equal to `n` (the curve order).\n //\n // The paper above uses 2 as the value of `p`,\n // whereas libsecp256k1 uses 128 (total=384).\n //\n // We pick precision for `g1` and `g2` such that:\n //\n // abs(g1) < n\n // abs(g2) < n\n //\n // This ensures maximum precision for the constants\n // while also ensuring they fit into a fixed number\n // of scalar limbs in more optimized implementations.\n //\n // Furthermore, we attempt to align to a limb width\n // of 64 bits. This allows us to optimize the shift,\n // a la libsecp256k1[1].\n //\n // [1] https://github.com/bitcoin-core/secp256k1/pull/822\n assert(Array.isArray(basis));\n assert(basis.length === 2);\n assert(basis[0] instanceof Vector);\n assert(basis[1] instanceof Vector);\n\n const [v1, v2] = basis;\n const d = v1.a.mul(v2.b).isub(v1.b.mul(v2.a));\n const bits = d.bitLength();\n const align = bits >= 160;\n\n assert(d.eq(this.n));\n\n // Start with a rough estimate.\n let shift = bits + Math.ceil(bits / 2) + 1;\n let g1, g2;\n\n if (align)\n shift -= shift & 63;\n\n while (shift > bits) {\n g1 = v2.b.ushln(shift).divRound(d);\n g2 = v1.b.ushln(shift).divRound(d);\n\n if (g1.ucmp(d) < 0 && g2.ucmp(d) < 0)\n break;\n\n if (align)\n shift -= 64;\n else\n shift -= 1;\n }\n\n if (shift <= bits)\n throw new Error('Could not calculate g1 and g2.');\n\n return [shift, g1, g2];\n }\n\n _endoSplit(k) {\n // Balanced length-two representation of a multiplier.\n //\n // [GECC] Algorithm 3.74, Page 127, Section 3.5.\n //\n // Also note that it is possible to precompute[1]\n // values in order to avoid the division[2][3][4].\n //\n // This involves precomputing `g1` and `g2 (see\n // above). `c1` and `c2` can then be computed as\n // follows:\n //\n // t = ceil(log2(n+1)) + p\n // c1 = (k * g1) >> t\n // c2 = -((k * g2) >> t)\n //\n // Where `>>` is an _unsigned_ right shift. Also\n // note that the last bit discarded in the shift\n // must be stored. If it is 1, then add 1 to the\n // scalar (absolute addition).\n //\n // It's worth noting that libsecp256k1 uses a\n // different calculation along the lines of:\n //\n // t = ceil(log2(n+1)) + p\n // c1 = ((k * g1) >> t) * -b1\n // c2 = ((k * -g2) >> t) * -b2\n // k2 = c1 + c2\n // k1 = k2 * -lambda + k\n //\n // So, in the future, we can consider changing\n // step 4 to:\n //\n // 4. Compute c1 = (k * g1) >> t\n // and c2 = -((k * g2) >> t).\n //\n // const [shift, g1, g2] = this.endo.pre;\n // const c1 = k.mulShift(g1, shift);\n // const c2 = k.mulShift(g2, shift).ineg();\n //\n // Once we're brave enough, that is.\n //\n // [1] [JCEN12] Page 5, Section 4.3.\n // [2] https://github.com/bitcoin-core/secp256k1/blob/0b70241/src/scalar_impl.h#L259\n // [3] https://github.com/bitcoin-core/secp256k1/pull/21\n // [4] https://github.com/bitcoin-core/secp256k1/pull/127\n assert(k instanceof BN);\n assert(!k.red);\n assert(!this.n.isZero());\n\n const [v1, v2] = this.endo.basis;\n\n // 4. Compute c1 = round(b2 * k / n)\n // and c2 = round(-b1 * k / n).\n const c1 = v2.b.mul(k).divRound(this.n);\n const c2 = v1.b.neg().mul(k).divRound(this.n);\n\n // 5. Compute k1 = k - c1 * a1 - c2 * a2\n // and k2 = -c1 * b1 - c2 * b2.\n const p1 = c1.mul(v1.a);\n const p2 = c2.mul(v2.a);\n const q1 = c1.ineg().mul(v1.b);\n const q2 = c2.mul(v2.b);\n\n // Calculate answer.\n const k1 = k.sub(p1).isub(p2);\n const k2 = q1.isub(q2);\n\n // 6. Return (k1, k2).\n return [k1, k2];\n }\n\n _endoBeta(point) {\n assert(point instanceof ShortPoint);\n return [point, point._getBeta()];\n }\n\n _endoWnafMulAdd(points, coeffs) {\n // Point multiplication with efficiently computable endomorphisms.\n //\n // [GECC] Algorithm 3.77, Page 129, Section 3.5.\n // [GLV] Page 193, Section 3 (Using Efficient Endomorphisms).\n //\n // Note it may be possible to do this 4-dimensionally [4GLV].\n assert(Array.isArray(points));\n assert(Array.isArray(coeffs));\n assert(points.length === coeffs.length);\n assert(this.endo != null);\n\n const len = points.length;\n const npoints = new Array(len * 2);\n const ncoeffs = new Array(len * 2);\n\n for (let i = 0; i < len; i++) {\n const [p1, p2] = this._endoBeta(points[i]);\n const [k1, k2] = this._endoSplit(coeffs[i]);\n\n npoints[i * 2 + 0] = p1;\n ncoeffs[i * 2 + 0] = k1;\n npoints[i * 2 + 1] = p2;\n ncoeffs[i * 2 + 1] = k2;\n }\n\n return this._wnafMulAdd(5, npoints, ncoeffs);\n }\n\n _sswu(u) {\n // Simplified Shallue-Woestijne-Ulas Method.\n //\n // Distribution: 3/8.\n //\n // [SSWU1] Page 15-16, Section 7. Appendix G.\n // [SSWU2] Page 5, Theorem 2.3.\n // [H2EC] \"Simplified Shallue-van de Woestijne-Ulas Method\".\n //\n // Assumptions:\n //\n // - a != 0, b != 0.\n // - Let z be a non-square in F(p).\n // - z != -1.\n // - The polynomial g(x) - z is irreducible over F(p).\n // - g(b / (z * a)) is square in F(p).\n // - u != 0, u != +-sqrt(-1 / z).\n //\n // Map:\n //\n // g(x) = x^3 + a * x + b\n // t1 = 1 / (z^2 * u^4 + z * u^2)\n // x1 = (-b / a) * (1 + t1)\n // x1 = b / (z * a), if t1 = 0\n // x2 = z * u^2 * x1\n // x = x1, if g(x1) is square\n // = x2, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const {b, z, ai, zi, one} = this;\n const z2 = z.redSqr();\n const ba = b.redNeg().redMul(ai);\n const bza = b.redMul(zi).redMul(ai);\n const u2 = u.redSqr();\n const u4 = u2.redSqr();\n const t0 = z2.redMul(u4).redIAdd(z.redMul(u2));\n const t1 = t0.isZero() ? t0 : t0.redInvert();\n const x1 = t1.isZero() ? bza : ba.redMul(one.redAdd(t1));\n const x2 = z.redMul(u2).redMul(x1);\n const y1 = this.solveY2(x1);\n const y2 = this.solveY2(x2);\n const alpha = y1.redIsSquare() | 0;\n const x = [x1, x2][alpha ^ 1];\n const y = [y1, y2][alpha ^ 1].redSqrt();\n\n if (y.redIsOdd() !== u.redIsOdd())\n y.redINeg();\n\n return this.point(x, y);\n }\n\n _sswui(p, hint) {\n // Inverting the Map (Simplified Shallue-Woestijne-Ulas).\n //\n // Assumptions:\n //\n // - a^2 * x^2 - 2 * a * b * x - 3 * b^2 is square in F(p).\n // - If r < 3 then x != -b / a.\n //\n // Unlike SVDW, the preimages here are evenly\n // distributed (more or less). SSWU covers ~3/8\n // of the curve points. Each preimage has a 1/2\n // chance of mapping to either x1 or x2.\n //\n // Assuming the point is within that set, each\n // point has a 1/4 chance of inverting to any\n // of the preimages. This means we can simply\n // randomly select a preimage if one exists.\n //\n // However, the [SVDW2] sampling method seems\n // slighly faster in practice for [SQUARED].\n //\n // Map:\n //\n // c = sqrt(a^2 * x^2 - 2 * a * b * x - 3 * b^2)\n // u1 = -(a * x + b - c) / (2 * (a * x + b) * z)\n // u2 = -(a * x + b + c) / (2 * (a * x + b) * z)\n // u3 = -(a * x + b - c) / (2 * b * z)\n // u4 = -(a * x + b + c) / (2 * b * z)\n // r = random integer in [1,4]\n // u = sign(y) * abs(sqrt(ur))\n const {a, b, z} = this;\n const {x, y} = p;\n const r = hint & 3;\n const a2x2 = a.redSqr().redMul(x.redSqr());\n const abx2 = a.redMul(b).redMul(x).redIMuln(2);\n const b23 = b.redSqr().redMuln(3);\n const axb = a.redMul(x).redIAdd(b);\n const c = a2x2.redISub(abx2).redISub(b23).redSqrt();\n const n0 = axb.redSub(c).redINeg();\n const n1 = axb.redAdd(c).redINeg();\n const d0 = axb.redMul(z).redIMuln(2);\n const d1 = b.redMul(z).redIMuln(2);\n const n = [n0, n1][r & 1]; // r = 1 or 3\n const d = [d0, d1][r >>> 1]; // r = 2 or 3\n const u = n.redDivSqrt(d);\n\n if (u.redIsOdd() !== y.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n _svdwf(u) {\n // Shallue-van de Woestijne Method.\n //\n // Distribution: 9/16.\n //\n // [SVDW1] Section 5.\n // [SVDW2] Page 8, Section 3.\n // Page 15, Section 6, Algorithm 1.\n // [H2EC] \"Shallue-van de Woestijne Method\".\n //\n // Assumptions:\n //\n // - p = 1 (mod 3).\n // - a = 0, b != 0.\n // - Let z be a unique element in F(p).\n // - g((sqrt(-3 * z^2) - z) / 2) is square in F(p).\n // - u != 0, u != +-sqrt(-g(z)).\n //\n // Map:\n //\n // g(x) = x^3 + b\n // c = sqrt(-3 * z^2)\n // t1 = u^2 + g(z)\n // t2 = 1 / (u^2 * t1)\n // t3 = u^4 * t2 * c\n // x1 = (c - z) / 2 - t3\n // x2 = t3 - (c + z) / 2\n // x3 = z - t1^3 * t2 / (3 * z^2)\n // x = x1, if g(x1) is square\n // = x2, if g(x2) is square\n // = x3, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const {c, z, zi, i2, i3} = this;\n const gz = this.solveY2(z);\n const z3 = i3.redMul(zi.redSqr());\n const u2 = u.redSqr();\n const u4 = u2.redSqr();\n const t1 = u2.redAdd(gz);\n const u2t1 = u2.redMul(t1);\n const t2 = u2t1.isZero() ? u2t1 : u2t1.redInvert();\n const t3 = u4.redMul(t2).redMul(c);\n const t4 = t1.redSqr().redMul(t1);\n const x1 = c.redSub(z).redMul(i2).redISub(t3);\n const x2 = t3.redSub(c.redAdd(z).redMul(i2));\n const x3 = z.redSub(t4.redMul(t2).redMul(z3));\n const y1 = this.solveY2(x1);\n const y2 = this.solveY2(x2);\n const y3 = this.solveY2(x3);\n const alpha = y1.redJacobi() | 1;\n const beta = y2.redJacobi() | 1;\n const i = mod((alpha - 1) * beta, 3);\n const x = [x1, x2, x3][i];\n const y = [y1, y2, y3][i];\n\n return [x, y];\n }\n\n _svdw(u) {\n const [x, yy] = this._svdwf(u);\n const y = yy.redSqrt();\n\n if (y.redIsOdd() !== u.redIsOdd())\n y.redINeg();\n\n return this.point(x, y);\n }\n\n _svdwi(p, hint) {\n // Inverting the Map (Shallue-van de Woestijne).\n //\n // [SQUARED] Algorithm 1, Page 8, Section 3.3.\n // [SVDW2] Page 12, Section 5.\n // [SVDW3] \"Inverting the map\".\n //\n // Assumptions:\n //\n // - If r = 1 then x != -(c + z) / 2.\n // - If r = 2 then x != (c - z) / 2.\n // - If r > 2 then (t0 - t1 + t2) is square in F(p).\n // - f(f^-1(x)) = x where f is the map function.\n //\n // We use the sampling method from [SVDW2],\n // _not_ [SQUARED]. This seems to have a\n // better distribution in practice.\n //\n // Note that [SVDW3] also appears to be\n // incorrect in terms of distribution.\n //\n // The distribution of f(u), assuming u is\n // random, is (1/2, 1/4, 1/4).\n //\n // To mirror this, f^-1(x) should simply\n // pick (1/2, 1/4, 1/8, 1/8).\n //\n // To anyone running the forward map, our\n // strings will appear to be random.\n //\n // Map:\n //\n // g(x) = x^3 + b\n // c = sqrt(-3 * z^2)\n // t0 = 9 * (x^2 * z^2 + z^4)\n // t1 = 18 * x * z^3\n // t2 = 12 * g(z) * (x - z)\n // t3 = sqrt(t0 - t1 + t2)\n // t4 = t3 * z\n // u1 = g(z) * (c - 2 * x - z) / (c + 2 * x + z)\n // u2 = g(z) * (c + 2 * x + z) / (c - 2 * x - z)\n // u3 = (3 * (z^3 - x * z^2) - 2 * g(z) + t4) / 2\n // u4 = (3 * (z^3 - x * z^2) - 2 * g(z) - t4) / 2\n // r = random integer in [1,4]\n // u = sign(y) * abs(sqrt(ur))\n const {b, c, z, zero, two} = this;\n const {x, y} = p;\n const r = hint & 3;\n const z2 = z.redSqr();\n const z3 = z2.redMul(z);\n const z4 = z2.redSqr();\n const gz = z3.redAdd(b);\n const gz2 = gz.redMuln(2);\n const xx = x.redSqr();\n const x2z = x.redMuln(2).redIAdd(z);\n const xz2 = x.redMul(z2);\n const c0 = c.redSub(x2z);\n const c1 = c.redAdd(x2z);\n const t0 = xx.redMul(z2).redIAdd(z4).redIMuln(9);\n const t1 = x.redMul(z3).redIMuln(18);\n const t2 = gz.redMul(x.redSub(z)).redIMuln(12);\n const t3 = r >= 2 ? t0.redISub(t1).redIAdd(t2).redSqrt() : zero;\n const t4 = t3.redMul(z);\n const t5 = z3.redISub(xz2).redIMuln(3).redISub(gz2);\n const n0 = gz.redMul(c0);\n const n1 = gz.redMul(c1);\n const n2 = t5.redAdd(t4);\n const n3 = t5.redSub(t4);\n const d2 = two;\n const n = [n0, n1, n2, n3][r];\n const d = [c1, c0, d2, d2][r];\n const u = n.redDivSqrt(d);\n const [x0] = this._svdwf(u);\n\n if (!x0.eq(x))\n throw new Error('Invalid point.');\n\n if (u.redIsOdd() !== y.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n isElliptic() {\n const {a, b} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const d = b2.redMuln(27).redIAdd(a3.redMuln(4));\n\n // 4 * a^3 + 27 * b^2 != 0\n return !d.isZero();\n }\n\n jinv() {\n // [ARITH1] Page 71, Section 4.4.\n // http://mathworld.wolfram.com/j-Invariant.html\n const {a, b} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const t0 = a3.redMuln(4);\n const lhs = t0.redMuln(1728);\n const rhs = b2.redMuln(27).redIAdd(t0);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // (1728 * 4 * a^3) / (4 * a^3 + 27 * b^2)\n return lhs.redDiv(rhs).fromRed();\n }\n\n point(x, y) {\n return new ShortPoint(this, x, y);\n }\n\n jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n }\n\n solveX(y) {\n assert(y instanceof BN);\n\n if (!this.a.isZero())\n throw new Error('Not implemented.');\n\n // x^3 = y^2 - b\n const y2 = y.redSqr();\n const x3 = y2.redSub(this.b);\n\n return cubeRoots(x3);\n }\n\n solveY2(x) {\n // [GECC] Page 89, Section 3.2.2.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw.html\n assert(x instanceof BN);\n\n // y^2 = x^3 + a * x + b\n const x3 = x.redSqr().redMul(x);\n const y2 = x3.redIAdd(this.b);\n\n if (!this.zeroA) {\n // Save some cycles for a = -3.\n if (this.threeA)\n y2.redIAdd(x.redMuln(-3));\n else\n y2.redIAdd(this.a.redMul(x));\n }\n\n return y2;\n }\n\n validate(point) {\n assert(point instanceof ShortPoint);\n\n if (point.inf)\n return true;\n\n const {x, y} = point;\n const y2 = this.solveY2(x);\n\n return y.redSqr().eq(y2);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (this.h.cmpn(1) > 0) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n }\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n pointFromY(y, index = 0) {\n assert(y instanceof BN);\n assert((index >>> 0) === index);\n\n if (!y.red)\n y = y.toRed(this.red);\n\n const coords = this.solveX(y);\n\n if (index >= coords.length)\n throw new Error('Invalid X coordinate index.');\n\n const x = coords[index];\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve) {\n // [GECC] Page 84, Section 3.1.5.\n // [ARITH1] Page 286, Section 13.2.3.c.\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n let u2, u3;\n try {\n [u2, u3] = this._scale(curve);\n } catch (e) {\n return false;\n }\n\n // E(a,b) <-> E(au^4,bu^6)\n if (curve.type === 'short') {\n // a' = a * u^4, b' = b * u^6\n const a = this.field(curve.a).redMul(u2.redSqr());\n const b = this.field(curve.b).redMul(u3.redSqr());\n\n return this.a.eq(a) && this.b.eq(b);\n }\n\n // E(a,b) <-> M(A,B)\n if (curve.type === 'mont') {\n // (A / (3 * B))^3 + a * (A / (3 * B)) + b = 0\n const {a3, bi} = curve;\n const x = this.field(a3.redMul(bi)).redMul(u2);\n const y2 = this.solveY2(x);\n\n return y2.isZero();\n }\n\n // E(a,b) <-> E(a,d)\n if (curve.type === 'edwards') {\n // ((a' + d') / 6)^3 + a * ((a' + d') / 6) + b = 0\n const x = this.field(curve.ad6).redMul(u2);\n const y2 = this.solveY2(x);\n\n return y2.isZero();\n }\n\n return false;\n }\n\n isIsogenous(curve) {\n assert(curve instanceof Curve);\n return false;\n }\n\n pointFromShort(point) {\n // [GECC] Page 84, Section 3.1.5.\n // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves).\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for E(a,b)<->E(au^4,bu^6):\n //\n // x' = x * u^2\n // y' = y * u^3\n //\n // Where a * u^4 = a' and b * u^6 = b'.\n if (point.isInfinity())\n return this.point();\n\n const [u2, u3] = this._scale(point.curve);\n const x = this.field(point.x);\n const y = this.field(point.y);\n const nx = x.redMul(u2);\n const ny = y.redMul(u3);\n\n return this.point(nx, ny);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [ALT] Appendix E.2 (Switching between Alternative Representations).\n // [MONT2] \"Equivalence with Weierstrass curves\"\n assert(point instanceof MontPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for M(A,B)->E(a,b):\n //\n // x = (u + A / 3) / B\n // y = v / B\n //\n // Undefined if ((u^3 + A * u^2 + u) / B) is not square.\n if (point.isInfinity())\n return this.point();\n\n const {a3, bi} = point.curve;\n const [u2, u3] = this._scale(point.curve);\n const nx = point.x.redAdd(a3).redMul(bi);\n const ny = point.y.redMul(bi);\n\n return this.point(this.field(nx).redMul(u2),\n this.field(ny).redMul(u3));\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [TWISTEQ] Section 2.\n assert(point instanceof EdwardsPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,d)->E(a',b'):\n //\n // x' = ((5 * d - a) * y + d - 5 * a) / (12 * (y - 1))\n // y' = (d - a) * (y + 1) / (4 * x * (y - 1))\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> ((a + d) / 6, 0)\n //\n // Unexceptional Cases:\n // - (sqrt(1 / a), 0) -> ((5 * a - d) / 12, (a - d) / 4 * sqrt(a))\n const {a, d, ad6} = point.curve;\n const [u2, u3] = this._scale(point.curve);\n\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero()) {\n const x = this.field(ad6).redMul(u2);\n return this.point(x, this.zero);\n }\n\n const {x, y, z} = point;\n const a5 = a.redMuln(5);\n const d5 = d.redMuln(5);\n const dma = d.redSub(a);\n const d5a = d5.redSub(a);\n const da5 = d.redSub(a5);\n const ypz = y.redAdd(z);\n const ymz = y.redSub(z);\n const xx = d5a.redMul(y).redIAdd(da5.redMul(z));\n const xz = ymz.redMuln(12);\n const yy = dma.redMul(ypz).redMul(z);\n const yz = ymz.redMul(x).redIMuln(4);\n\n return this.cpoint(this.field(xx).redMul(u2),\n this.field(xz),\n this.field(yy).redMul(u3),\n this.field(yz));\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n assert(u instanceof BN);\n\n // z = 0 or b = 0\n if (this.z.isZero() || this.b.isZero())\n throw new Error('Not implemented.');\n\n // a != 0, b != 0\n if (!this.a.isZero())\n return this._sswu(u);\n\n // p = 1 mod 3, a = 0, b != 0\n if (!this.c.isZero())\n return this._svdw(u);\n\n throw new Error('Not implemented.');\n }\n\n pointToUniform(p, hint) {\n // Convert a short weierstrass point to a field\n // element by inverting either the SSWU or SVDW\n // map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof ShortPoint);\n assert((hint >>> 0) === hint);\n\n // z = 0 or b = 0\n if (this.z.isZero() || this.b.isZero())\n throw new Error('Not implemented.');\n\n // P = O\n if (p.isInfinity())\n throw new Error('Invalid point.');\n\n // Add a random torsion component.\n const i = ((hint >>> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n return wrapErrors(() => {\n // a != 0, b != 0\n if (!this.a.isZero())\n return this._sswui(q, hint);\n\n // p = 1 mod 3, a = 0, b != 0\n if (!this.c.isZero())\n return this._svdwi(q, hint);\n\n throw new Error('Not implemented.');\n });\n }\n\n mulAll(points, coeffs) {\n return super.mulAll(points, coeffs).toP();\n }\n\n affinizeAll(points) {\n const out = this.normalizeAll(points);\n\n for (let i = 0; i < out.length; i++)\n out[i] = out[i].toP();\n\n return out;\n }\n\n decodePoint(bytes) {\n return ShortPoint.decode(this, bytes);\n }\n\n encodeX(point) {\n assert(point instanceof Point);\n return point.encodeX();\n }\n\n decodeEven(bytes) {\n return ShortPoint.decodeEven(this, bytes);\n }\n\n decodeSquare(bytes) {\n return ShortPoint.decodeSquare(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromShort(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, odd, sign = null) {\n const [a, b] = this._mont(b0, odd);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = this._scale(curve);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromShort(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, odd, sign = null) {\n const [a, d] = this._edwards(a0, odd);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = this._scale(curve);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromShort(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return ShortPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n\n json.a = this.a.fromRed().toJSON();\n json.b = this.b.fromRed().toJSON();\n\n if (!this.c.isZero())\n json.c = this.c.fromRed().toJSON();\n\n return json;\n }\n}\n\n/**\n * ShortPoint\n */\n\nclass ShortPoint extends Point {\n constructor(curve, x, y) {\n assert(curve instanceof ShortCurve);\n\n super(curve, types.AFFINE);\n\n this.x = this.curve.zero;\n this.y = this.curve.zero;\n this.inf = true;\n\n if (x != null)\n this._init(x, y);\n }\n\n _init(x, y) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n\n this.x = x;\n this.y = y;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n this.inf = false;\n }\n\n _getBeta() {\n if (!this.curve.endo)\n return null;\n\n if (this.pre && this.pre.beta)\n return this.pre.beta;\n\n // Augment the point with our beta value.\n // This is the counterpart to `k2` after\n // the endomorphism split of `k`.\n //\n // Note that if we have precomputation,\n // we have to clone and update all of the\n // precomputed points below.\n const xb = this.x.redMul(this.curve.endo.beta);\n const beta = this.curve.point(xb, this.y);\n\n if (this.pre) {\n beta.pre = this.pre.map((point) => {\n const xb = point.x.redMul(this.curve.endo.beta);\n return this.curve.point(xb, point.y);\n });\n\n this.pre.beta = beta;\n }\n\n return beta;\n }\n\n _getJNAF(point) {\n assert(point instanceof ShortPoint);\n\n if (this.inf || point.inf)\n return super._getJNAF(point);\n\n // Create comb for JSF.\n const comb = [\n this, // 1\n null, // 3\n null, // 5\n point // 7\n ];\n\n // Try to avoid Jacobian points, if possible.\n if (this.y.eq(point.y)) {\n comb[1] = this.add(point);\n comb[2] = this.toJ().sub(point);\n } else if (this.y.eq(point.y.redNeg())) {\n comb[1] = this.toJ().add(point);\n comb[2] = this.sub(point);\n } else {\n comb[1] = this.toJ().add(point);\n comb[2] = this.toJ().sub(point);\n }\n\n return comb;\n }\n\n clone() {\n if (this.inf)\n return this.curve.point();\n\n return this.curve.point(this.x, this.y);\n }\n\n scale(a) {\n return this.toJ().scale(a);\n }\n\n neg() {\n // P = O\n if (this.inf)\n return this;\n\n // -(X1, Y1) = (X1, -Y1)\n return this.curve.point(this.x, this.y.redNeg());\n }\n\n add(p) {\n // [GECC] Page 80, Section 3.1.2.\n //\n // Addition Law:\n //\n // l = (y1 - y2) / (x1 - x2)\n // x3 = l^2 - x1 - x2\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 1S + 6A\n assert(p instanceof ShortPoint);\n\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P, P + -P\n if (this.x.eq(p.x)) {\n // P + -P = O\n if (!this.y.eq(p.y))\n return this.curve.point();\n\n // P + P = 2P\n return this.dbl();\n }\n\n // X1 != X2, Y1 = Y2\n if (this.y.eq(p.y)) {\n // X3 = -X1 - X2\n const nx = this.x.redNeg().redISub(p.x);\n\n // Y3 = -Y1\n const ny = this.y.redNeg();\n\n // Skip the inverse.\n return this.curve.point(nx, ny);\n }\n\n // H = X1 - X2\n const h = this.x.redSub(p.x);\n\n // R = Y1 - Y2\n const r = this.y.redSub(p.y);\n\n // L = R / H\n const l = r.redDiv(h);\n\n // X3 = L^2 - X1 - X2\n const nx = l.redSqr().redISub(this.x).redISub(p.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dbl() {\n // [GECC] Page 80, Section 3.1.2.\n //\n // Addition Law (doubling):\n //\n // l = (3 * x1^2 + a) / (2 * y1)\n // x3 = l^2 - 2 * x1\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 2S + 3A + 2*2 + 1*3\n\n // P = O\n if (this.inf)\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.point();\n\n // XX = X1^2\n const xx = this.x.redSqr();\n\n // M = 3 * XX + a\n const m = xx.redIMuln(3).redIAdd(this.curve.a);\n\n // Z = 2 * Y1\n const z = this.y.redMuln(2);\n\n // L = M / Z\n const l = m.redDiv(z);\n\n // X3 = L^2 - 2 * X1\n const nx = l.redSqr().redISub(this.x).redISub(this.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dblp(pow) {\n return this.toJ().dblp(pow).toP();\n }\n\n getX() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof ShortPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.inf)\n return p.inf;\n\n // Q = O\n if (p.inf)\n return false;\n\n // X1 = X2, Y1 = Y2\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n cmp(point) {\n assert(point instanceof ShortPoint);\n\n if (this.inf && !point.inf)\n return -1;\n\n if (!this.inf && point.inf)\n return 1;\n\n if (this.inf && point.inf)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Infinity cannot be represented in\n // the affine space, except by a flag.\n return this.inf;\n }\n\n isOrder2() {\n if (this.inf)\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.inf)\n return false;\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.inf)\n return false;\n\n return this.y.redIsEven();\n }\n\n isSquare() {\n if (this.inf)\n return false;\n\n return this.y.redJacobi() !== -1;\n }\n\n eqX(x) {\n assert(x instanceof BN);\n assert(!x.red);\n\n if (this.inf)\n return false;\n\n return this.getX().eq(x);\n }\n\n eqR(x) {\n assert(x instanceof BN);\n assert(!x.red);\n assert(!this.curve.n.isZero());\n\n if (this.inf)\n return false;\n\n return this.getX().imod(this.curve.n).eq(x);\n }\n\n mul(k) {\n return super.mul(k).toP();\n }\n\n muln(k) {\n return super.muln(k).toP();\n }\n\n mulBlind(k, rng) {\n return super.mulBlind(k, rng).toP();\n }\n\n mulAdd(k1, p2, k2) {\n return super.mulAdd(k1, p2, k2).toP();\n }\n\n mulH() {\n return super.mulH().toP();\n }\n\n div(k) {\n return super.div(k).toP();\n }\n\n divn(k) {\n return super.divn(k).toP();\n }\n\n divH() {\n return super.divH().toP();\n }\n\n toP() {\n return this;\n }\n\n toJ() {\n // (X3, Y3, Z3) = (1, 1, 0)\n if (this.inf)\n return this.curve.jpoint();\n\n // (X3, Y3, Z3) = (X1, Y1, 1)\n return this.curve.jpoint(this.x, this.y, this.curve.one);\n }\n\n encode(compact) {\n // [SEC1] Page 10, Section 2.3.3.\n if (compact == null)\n compact = true;\n\n assert(typeof compact === 'boolean');\n\n const {fieldSize} = this.curve;\n\n // We do not serialize points at infinity.\n if (this.inf)\n throw new Error('Invalid point.');\n\n // Compressed form (0x02 = even, 0x03 = odd).\n if (compact) {\n const p = Buffer.alloc(1 + fieldSize);\n const x = this.curve.encodeField(this.getX());\n\n p[0] = 0x02 | this.y.redIsOdd();\n x.copy(p, 1);\n\n return p;\n }\n\n // Uncompressed form (0x04).\n const p = Buffer.alloc(1 + fieldSize * 2);\n const x = this.curve.encodeField(this.getX());\n const y = this.curve.encodeField(this.getY());\n\n p[0] = 0x04;\n x.copy(p, 1);\n y.copy(p, 1 + fieldSize);\n\n return p;\n }\n\n static decode(curve, bytes) {\n // [SEC1] Page 11, Section 2.3.4.\n assert(curve instanceof ShortCurve);\n assert(Buffer.isBuffer(bytes));\n\n const len = curve.fieldSize;\n\n if (bytes.length < 1 + len)\n throw new Error('Not a point.');\n\n // Point forms:\n //\n // 0x00 -> Infinity (openssl, unsupported)\n // 0x02 -> Compressed Even\n // 0x03 -> Compressed Odd\n // 0x04 -> Uncompressed\n // 0x06 -> Hybrid Even (openssl)\n // 0x07 -> Hybrid Odd (openssl)\n //\n // Note that openssl supports serializing points\n // at infinity as {0}. We choose not to support it\n // because it's strange and not terribly useful.\n const form = bytes[0];\n\n switch (form) {\n case 0x02:\n case 0x03: {\n if (bytes.length !== 1 + len)\n throw new Error('Invalid point size for compressed.');\n\n const x = curve.decodeField(bytes.slice(1, 1 + len));\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n const p = curve.pointFromX(x, form === 0x03);\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n case 0x04:\n case 0x06:\n case 0x07: {\n if (bytes.length !== 1 + len * 2)\n throw new Error('Invalid point size for uncompressed.');\n\n const x = curve.decodeField(bytes.slice(1, 1 + len));\n const y = curve.decodeField(bytes.slice(1 + len, 1 + 2 * len));\n\n // [GECC] Algorithm 4.3, Page 180, Section 4.\n if (x.cmp(curve.p) >= 0 || y.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n // OpenSSL hybrid encoding.\n if (form !== 0x04 && form !== (0x06 | y.isOdd()))\n throw new Error('Invalid hybrid encoding.');\n\n const p = curve.point(x, y);\n\n if (!p.validate())\n throw new Error('Invalid point.');\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n default: {\n throw new Error('Unknown point format.');\n }\n }\n }\n\n encodeX() {\n // [SCHNORR] \"Specification\".\n // [BIP340] \"Specification\".\n return this.curve.encodeField(this.getX());\n }\n\n static decodeEven(curve, bytes) {\n // [BIP340] \"Specification\".\n assert(curve instanceof ShortCurve);\n\n const x = curve.decodeField(bytes);\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromX(x, false);\n }\n\n static decodeSquare(curve, bytes) {\n // [SCHNORR] \"Specification\".\n assert(curve instanceof ShortCurve);\n\n const x = curve.decodeField(bytes);\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromX(x);\n }\n\n toJSON(pre) {\n if (this.inf)\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n if (pre === true && this.pre)\n return [x, y, this.pre.toJSON()];\n\n return [x, y];\n }\n\n toPretty() {\n if (this.inf)\n return [];\n\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof ShortCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n const point = curve.point(x, y);\n\n if (json.length > 2 && json[2] != null)\n point.pre = Precomp.fromJSON(point, json[2]);\n\n return point;\n }\n\n [custom]() {\n if (this.inf)\n return '';\n\n return '';\n }\n}\n\n/**\n * JPoint\n */\n\nclass JPoint extends Point {\n constructor(curve, x, y, z) {\n assert(curve instanceof ShortCurve);\n\n super(curve, types.JACOBIAN);\n\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = this.curve.zero;\n this.zOne = false;\n\n if (x != null)\n this._init(x, y, z);\n }\n\n _init(x, y, z) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n assert(z == null || (z instanceof BN));\n\n this.x = x;\n this.y = y;\n this.z = z || this.curve.one;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z.eq(this.curve.one);\n }\n\n clone() {\n return this.curve.jpoint(this.x, this.y, this.z);\n }\n\n validate() {\n // [GECC] Example 3.20, Page 88, Section 3.\n const {a, b} = this.curve;\n\n // P = O\n if (this.isInfinity())\n return true;\n\n // Z1 = 1\n if (this.zOne)\n return this.curve.validate(this.toP());\n\n // y^2 = x^3 + a * x * z^4 + b * z^6\n const lhs = this.y.redSqr();\n const x3 = this.x.redSqr().redMul(this.x);\n const z2 = this.z.redSqr();\n const z4 = z2.redSqr();\n const z6 = z4.redMul(z2);\n const rhs = x3.redIAdd(b.redMul(z6));\n\n if (!this.curve.zeroA) {\n // Save some cycles for a = -3.\n if (this.curve.threeA)\n rhs.redIAdd(z4.redIMuln(-3).redMul(this.x));\n else\n rhs.redIAdd(a.redMul(z4).redMul(this.x));\n }\n\n return lhs.eq(rhs);\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#scaling-z\n // 1I + 3M + 1S\n\n // Z = 1\n if (this.zOne)\n return this;\n\n // P = O\n if (this.isInfinity())\n return this;\n\n // A = 1 / Z1\n const a = this.z.redInvert();\n\n // AA = A^2\n const aa = a.redSqr();\n\n // X3 = X1 * AA\n this.x = this.x.redMul(aa);\n\n // Y3 = Y1 * AA * A\n this.y = this.y.redMul(aa).redMul(a);\n\n // Z3 = 1\n this.z = this.curve.one;\n this.zOne = true;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // P = O\n if (this.isInfinity())\n return this.curve.jpoint();\n\n // AA = A^2\n const aa = a.redSqr();\n\n // X3 = X1 * AA\n const nx = this.x.redMul(aa);\n\n // Y3 = Y1 * AA * A\n const ny = this.y.redMul(aa).redMul(a);\n\n // Z3 = Z1 * A\n const nz = this.z.redMul(a);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n neg() {\n // -(X1, Y1, Z1) = (X1, -Y1, Z1)\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }\n\n add(p) {\n assert(p instanceof Point);\n\n if (p.type === types.AFFINE)\n return this._mixedAdd(p);\n\n return this._add(p);\n }\n\n _add(p) {\n assert(p instanceof JPoint);\n\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.zOne)\n return p._addJA(this);\n\n // Z2 = 1\n if (p.zOne)\n return this._addJA(p);\n\n return this._addJJ(p);\n }\n\n _mixedAdd(p) {\n assert(p instanceof ShortPoint);\n\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n return this._addJA(p);\n }\n\n _addJJ(p) {\n // No assumptions.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-1998-cmo-2\n // 12M + 4S + 6A + 1*2 (implemented as: 12M + 4S + 7A)\n\n // Z1Z1 = Z1^2\n const z1z1 = this.z.redSqr();\n\n // Z2Z2 = Z2^2\n const z2z2 = p.z.redSqr();\n\n // U1 = X1 * Z2Z2\n const u1 = this.x.redMul(z2z2);\n\n // U2 = X2 * Z1Z1\n const u2 = p.x.redMul(z1z1);\n\n // S1 = Y1 * Z2 * Z2Z2\n const s1 = this.y.redMul(p.z).redMul(z2z2);\n\n // S2 = Y2 * Z1 * Z1Z1\n const s2 = p.y.redMul(this.z).redMul(z1z1);\n\n // H = U2 - U1\n const h = u2.redISub(u1);\n\n // r = S2 - S1\n const r = s2.redISub(s1);\n\n // H = 0\n if (h.isZero()) {\n if (!r.isZero())\n return this.curve.jpoint();\n\n return this.dbl();\n }\n\n // HH = H^2\n const hh = h.redSqr();\n\n // HHH = H * HH\n const hhh = h.redMul(hh);\n\n // V = U1 * HH\n const v = u1.redMul(hh);\n\n // X3 = r^2 - HHH - 2 * V\n const nx = r.redSqr().redISub(hhh).redISub(v).redISub(v);\n\n // Y3 = r * (V - X3) - S1 * HHH\n const ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh));\n\n // Z3 = Z1 * Z2 * H\n const nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _addJA(p) {\n // Assumes Z2 = 1.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-madd\n // 8M + 3S + 6A + 5*2 (implemented as: 8M + 3S + 7A + 4*2)\n\n // Z1Z1 = Z1^2\n const z1z1 = this.z.redSqr();\n\n // U2 = X2 * Z1Z1\n const u2 = p.x.redMul(z1z1);\n\n // S2 = Y2 * Z1 * Z1Z1\n const s2 = p.y.redMul(this.z).redMul(z1z1);\n\n // H = U2 - X1\n const h = u2.redISub(this.x);\n\n // r = 2 * (S2 - Y1)\n const r = s2.redISub(this.y).redIMuln(2);\n\n // H = 0\n if (h.isZero()) {\n if (!r.isZero())\n return this.curve.jpoint();\n\n return this.dbl();\n }\n\n // I = (2 * H)^2\n const i = h.redMuln(2).redSqr();\n\n // J = H * I\n const j = h.redMul(i);\n\n // V = X1 * I\n const v = this.x.redMul(i);\n\n // X3 = r^2 - J - 2 * V\n const nx = r.redSqr().redISub(j).redISub(v).redISub(v);\n\n // Y3 = r * (V - X3) - 2 * Y1 * J\n const ny = r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2));\n\n // Z3 = 2 * Z1 * H\n const nz = this.z.redMul(h).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n dbl() {\n // P = O\n if (this.isInfinity())\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.jpoint();\n\n // a = 0\n if (this.curve.zeroA)\n return this._dbl0();\n\n // a = -3\n if (this.curve.threeA)\n return this._dbl3();\n\n return this._dblJ();\n }\n\n _dblJ() {\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-1998-cmo-2\n // 3M + 6S + 4A + 1*a + 2*2 + 1*3 + 1*4 + 1*8\n // (implemented as: 3M + 6S + 5A + 1*a + 1*2 + 1*3 + 1*4 + 1*8)\n\n // XX = X1^2\n const xx = this.x.redSqr();\n\n // YY = Y1^2\n const yy = this.y.redSqr();\n\n // ZZ = Z1^2\n const zz = this.z.redSqr();\n\n // S = 4 * X1 * YY\n const s = this.x.redMul(yy).redIMuln(4);\n\n // M = 3 * XX + a * ZZ^2\n const m = xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr()));\n\n // T = M^2 - 2 * S\n const t = m.redSqr().redISub(s).redISub(s);\n\n // X3 = T\n const nx = t;\n\n // Y3 = M * (S - T) - 8 * YY^2\n const ny = m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8));\n\n // Z3 = 2 * Y1 * Z1\n const nz = this.y.redMul(this.z).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _dbl0() {\n // Assumes a = 0.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l\n // 2M + 5S + 6A + 3*2 + 1*3 + 1*8\n // (implemented as: 2M + 5S + 7A + 2*2 + 1*3 + 1*8)\n\n // A = X1^2\n const a = this.x.redSqr();\n\n // B = Y1^2\n const b = this.y.redSqr();\n\n // C = B^2\n const c = b.redSqr();\n\n // + XB2 = (X1 + B)^2\n const xb2 = b.redIAdd(this.x).redSqr();\n\n // D = 2 * ((X1 + B)^2 - A - C)\n const d = xb2.redISub(a).redISub(c).redIMuln(2);\n\n // E = 3 * A\n const e = a.redIMuln(3);\n\n // F = E^2\n const f = e.redSqr();\n\n // X3 = F - 2 * D\n const nx = f.redISub(d).redISub(d);\n\n // Y3 = E * (D - X3) - 8 * C\n const ny = e.redMul(d.redISub(nx)).redISub(c.redIMuln(8));\n\n // Z3 = 2 * Y1 * Z1\n const nz = this.y.redMul(this.z).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _dbl3() {\n // Assumes a = -3.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S + 8A + 1*3 + 1*4 + 2*8\n // (implemented as: 3M + 5S + 8A + 1*2 + 1*3 + 1*4 + 1*8)\n\n // delta = Z1^2\n const delta = this.z.redSqr();\n\n // gamma = Y1^2\n const gamma = this.y.redSqr();\n\n // beta = X1 * gamma\n const beta = this.x.redMul(gamma);\n\n // + xmdelta = X1 - delta\n const xmdelta = this.x.redSub(delta);\n\n // + xpdelta = X1 + delta\n const xpdelta = this.x.redAdd(delta);\n\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n const alpha = xmdelta.redMul(xpdelta).redIMuln(3);\n\n // + beta4 = 4 * beta\n const beta4 = beta.redIMuln(4);\n\n // + beta8 = 2 * beta4\n const beta8 = beta4.redMuln(2);\n\n // + gamma28 = 8 * gamma^2\n const gamma28 = gamma.redSqr().redIMuln(8);\n\n // X3 = alpha^2 - 8 * beta\n const nx = alpha.redSqr().redISub(beta8);\n\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n const nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n const ny = alpha.redMul(beta4.redISub(nx)).redISub(gamma28);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n getX() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof JPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.isInfinity())\n return p.isInfinity();\n\n // Q = O\n if (p.isInfinity())\n return false;\n\n // Z1 = Z2\n if (this.z.eq(p.z)) {\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n // X1 * Z2^2 = X2 * Z1^2\n const zz1 = this.z.redSqr();\n const zz2 = p.z.redSqr();\n const x1 = this.x.redMul(zz2);\n const x2 = p.x.redMul(zz1);\n\n if (!x1.eq(x2))\n return false;\n\n // Y1 * Z2^3 = Y2 * Z1^3\n const zzz1 = zz1.redMul(this.z);\n const zzz2 = zz2.redMul(p.z);\n const y1 = this.y.redMul(zzz2);\n const y2 = p.y.redMul(zzz1);\n\n return y1.eq(y2);\n }\n\n cmp(point) {\n assert(point instanceof JPoint);\n\n const inf1 = this.isInfinity();\n const inf2 = point.isInfinity();\n\n if (inf1 && !inf2)\n return -1;\n\n if (!inf1 && inf2)\n return 1;\n\n if (inf1 && inf2)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Z1 = 0\n return this.z.isZero();\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.isInfinity())\n return false;\n\n this.normalize();\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.isInfinity())\n return false;\n\n this.normalize();\n\n return this.y.redIsEven();\n }\n\n isSquare() {\n if (this.isInfinity())\n return false;\n\n return this.y.redMul(this.z).redJacobi() !== -1;\n }\n\n eqX(x) {\n // Verify that integer `x` is equal to field\n // element `x` by scaling it by our z coordinate.\n // This optimization is mentioned in and used for\n // bip-schnorr[1]. This avoids having to affinize\n // the resulting point during verification.\n //\n // [1] [SCHNORR] \"Optimizations\".\n assert(x instanceof BN);\n assert(!x.red);\n\n if (this.isInfinity())\n return false;\n\n const zz = this.z.redSqr();\n const rx = x.toRed(this.curve.red).redMul(zz);\n\n return this.x.eq(rx);\n }\n\n eqR(x) {\n // Similar to the optimization above, this\n // optimization, suggested by Maxwell[1],\n // compares an integer to an X coordinate\n // by scaling it.\n //\n // Since a signature's R value is modulo N\n // in ECDSA, we may be dealing with an R\n // value greater than N in actuality.\n //\n // If the equality check fails, we can\n // scale N itself by Z and add it to the\n // X field element.\n //\n // [1] https://github.com/bitcoin-core/secp256k1/commit/ce7eb6f\n assert(x instanceof BN);\n assert(!x.red);\n\n if (!this.curve.smallGap)\n return this.toP().eqR(x);\n\n if (this.isInfinity())\n return false;\n\n if (x.cmp(this.curve.p) >= 0)\n return false;\n\n const zz = this.z.redSqr();\n const rx = x.toRed(this.curve.red).redMul(zz);\n\n if (this.x.eq(rx))\n return true;\n\n if (this.curve.highOrder)\n return false;\n\n if (x.cmp(this.curve.pmodn) >= 0)\n return false;\n\n const rn = this.curve.redN.redMul(zz);\n\n rx.redIAdd(rn);\n\n return this.x.eq(rx);\n }\n\n toP() {\n // P = O\n if (this.isInfinity())\n return this.curve.point();\n\n this.normalize();\n\n // (X3, Y3) = (X1 / Z1^2, Y1 / Z1^3)\n return this.curve.point(this.x, this.y);\n }\n\n toJ() {\n return this;\n }\n\n encode(compact) {\n return this.toP().encode(compact);\n }\n\n static decode(curve, bytes) {\n return ShortPoint.decode(curve, bytes).toJ();\n }\n\n encodeX() {\n return this.toP().encodeX();\n }\n\n static decodeEven(curve, bytes) {\n return ShortPoint.decodeEven(curve, bytes).toJ();\n }\n\n static decodeSquare(curve, bytes) {\n return ShortPoint.decodeSquare(curve, bytes).toJ();\n }\n\n toJSON(pre) {\n return this.toP().toJSON(pre);\n }\n\n toPretty() {\n return this.toP().toPretty();\n }\n\n static fromJSON(curve, json) {\n return ShortPoint.fromJSON(curve, json).toJ();\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * MontCurve\n */\n\nclass MontCurve extends Curve {\n constructor(conf) {\n super(MontPoint, 'mont', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.b = BN.fromJSON(conf.b).toRed(this.red);\n\n this.bi = this.b.redInvert();\n this.a2 = this.a.redAdd(this.two);\n this.a24 = this.a2.redMul(this.i4);\n this.a3 = this.a.redMul(this.i3);\n this.a0 = this.a.redMul(this.bi);\n this.b0 = this.bi.redSqr();\n\n this._finalize(conf);\n }\n\n static _isomorphism(curveA, curveB, customB) {\n // Montgomery Isomorphism.\n //\n // [MONT3] Page 3, Section 2.1.\n //\n // Transformation:\n //\n // A' = A\n // B' = B'\n //\n // Where (B / B') is square.\n assert(curveA instanceof BN);\n assert(curveB instanceof BN);\n assert(customB instanceof BN);\n\n const a = curveA.clone();\n const b = customB.clone();\n const c = curveB.redDiv(customB);\n\n if (c.redJacobi() !== 1)\n throw new Error('Invalid `b` coefficient.');\n\n return [a, b];\n }\n\n _short(a0, odd) {\n // Montgomery->Short Weierstrass Equivalence.\n //\n // [MONT2] \"Equivalence with Weierstrass curves\".\n //\n // Transformation:\n //\n // a = (3 - A^2) / (3 * B^2)\n // b = (2 * A^3 - 9 * A) / (27 * B^3)\n const {a, b, three} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const b3 = b2.redMul(b);\n const n0 = three.redSub(a2);\n const d0 = b2.redMuln(3);\n const n1 = a3.redMuln(2).redISub(a.redMuln(9));\n const d1 = b3.redMuln(27);\n const wa = n0.redDiv(d0);\n const wb = n1.redDiv(d1);\n\n if (a0 != null)\n return ShortCurve._isomorphism(wa, wb, a0, odd);\n\n return [wa, wb];\n }\n\n _mont(b0) {\n return MontCurve._isomorphism(this.a, this.b, b0);\n }\n\n _edwards(a0, invert = false) {\n // Montgomery->Twisted Edwards Transformation.\n //\n // [MONT1] Page 11, Section 4.3.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n //\n // Equivalence:\n //\n // a = (A + 2) / B\n // d = (A - 2) / B\n //\n // Isomorphism:\n //\n // a = a'\n // d = a' * (A - 2) / (A + 2)\n //\n // Where ((A + 2) / (B * a')) is square.\n //\n // If `d` is square, we can usually find\n // a complete curve by using the `invert`\n // option. This will create an isomorphism\n // chain of: M(A,B)->E(a,d)->E(d,a).\n //\n // The equivalence between E(a,d) and\n // E(d,a) is:\n //\n // (x, y) = (x, 1 / y)\n //\n // Meaning our map to E(d,a) is:\n //\n // x = u / v\n // y = 1 / ((u - 1) / (u + 1))\n // = (u + 1) / (u - 1)\n assert(typeof invert === 'boolean');\n\n const {two, bi} = this;\n const a = this.a.redAdd(two).redMul(bi);\n const d = this.a.redSub(two).redMul(bi);\n\n if (invert)\n a.swap(d);\n\n if (a0 != null)\n return EdwardsCurve._isomorphism(a, d, a0);\n\n return [a, d];\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n const [u2, u3] = curve._scale(this);\n\n return [this.field(u2.redInvert()),\n this.field(u3.redInvert())];\n }\n\n _scaleMont(curve) {\n // We can extract the isomorphism factor with:\n //\n // c = +-sqrt(B / B')\n //\n // If base points are available, we can do:\n //\n // c = v' / v\n assert(curve instanceof MontCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this.field(curve.b).redDivSqrt(this.b);\n\n return this.g.y.redDiv(this.field(curve.g.y));\n }\n\n _scaleEdwards(curve, invert) {\n // We _could_ do something like:\n //\n // B = 4 / (a - d)\n // c = +-sqrt(B / B')\n //\n // Which can be reduced to:\n //\n // c = +-sqrt(4 / ((a - d) * B'))\n //\n // If base points are available:\n //\n // v = u' / x\n // c = v' / v\n //\n // Which can be reduced to:\n //\n // c = v' * x / u'\n //\n // However, the way our maps are\n // written, we can re-use the Edwards\n // isomorphism factor when going the\n // other direction.\n assert(curve instanceof EdwardsCurve);\n\n const c = curve._scale(this, invert);\n\n return this.field(c);\n }\n\n _solveY0(x) {\n assert(x instanceof BN);\n\n // y^2 = x^3 + A * x^2 + B * x\n const a = this.a0;\n const b = this.b0;\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const y2 = x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x));\n\n return y2;\n }\n\n _elligator2(u) {\n // Elligator 2.\n //\n // Distribution: 1/2.\n //\n // [ELL2] Page 11, Section 5.2.\n // [H2EC] \"Elligator 2 Method\".\n // \"Mappings for Montgomery curves\".\n // [SAFE] \"Indistinguishability from uniform random strings\".\n //\n // Assumptions:\n //\n // - y^2 = x^3 + A * x^2 + B * x.\n // - A != 0, B != 0.\n // - A^2 - 4 * B is non-zero and non-square in F(p).\n // - Let z be a non-square in F(p).\n // - u != +-sqrt(-1 / z).\n //\n // Note that Elligator 2 is defined over the form:\n //\n // y'^2 = x'^3 + A' * x'^2 + B' * x'\n //\n // Instead of:\n //\n // B * y^2 = x^3 + A * x^2 + x\n //\n // Where:\n //\n // A' = A / B\n // B' = 1 / B^2\n // x' = x / B\n // y' = y / B\n //\n // And:\n //\n // x = B * x'\n // y = B * y'\n //\n // This is presumably the result of Elligator 2\n // being designed in long Weierstrass form. If\n // we want to support B != 1, we need to do the\n // conversion.\n //\n // Map:\n //\n // g(x) = x^3 + A * x^2 + B * x\n // x1 = -A / (1 + z * u^2)\n // x1 = -A, if x1 = 0\n // x2 = -x1 - A\n // x = x1, if g(x1) is square\n // = x2, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const lhs = this.a0.redNeg();\n const rhs = this.one.redAdd(this.z.redMul(u.redSqr()));\n\n if (rhs.isZero())\n rhs.inject(this.one);\n\n const x1 = lhs.redMul(rhs.redInvert());\n const x2 = x1.redNeg().redISub(this.a0);\n const y1 = this._solveY0(x1);\n const y2 = this._solveY0(x2);\n const alpha = y1.redIsSquare() | 0;\n const x0 = [x1, x2][alpha ^ 1];\n const y0 = [y1, y2][alpha ^ 1].redSqrt();\n\n if (y0.redIsOdd() !== u.redIsOdd())\n y0.redINeg();\n\n const x = this.b.redMul(x0);\n const y = this.b.redMul(y0);\n\n return this.point(x, y);\n }\n\n _invert2(p, hint) {\n // Inverting the Map (Elligator 2).\n //\n // [ELL2] Page 12, Section 5.3.\n //\n // Assumptions:\n //\n // - -z * x * (x + A) is square in F(p).\n // - If r = 1 then x != 0.\n // - If r = 2 then x != -A.\n //\n // Map:\n //\n // u1 = -(x + A) / (x * z)\n // u2 = -x / ((x + A) * z)\n // r = random integer in [1,2]\n // u = sign(y) * abs(sqrt(ur))\n //\n // Note that `0 / 0` can only occur if A = 0\n // (this violates the assumptions of Elligator 2).\n const {x, y} = p;\n const r = hint & 1;\n const x0 = x.redMul(this.bi);\n const y0 = y.redMul(this.bi);\n const n = x0.redAdd(this.a0);\n const d = x0;\n const lhs = [n, d][r].redINeg();\n const rhs = [d, n][r].redMul(this.z);\n const u = lhs.redDivSqrt(rhs);\n\n if (u.redIsOdd() !== y0.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n isElliptic() {\n const a2 = this.a.redSqr();\n const d = this.b.redMul(a2.redSub(this.four));\n\n // B * (A^2 - 4) != 0\n return !d.isZero();\n }\n\n jinv() {\n // [MONT3] Page 3, Section 2.\n const {a, three, four} = this;\n const a2 = a.redSqr();\n const t0 = a2.redSub(three);\n const lhs = t0.redPown(3).redIMuln(256);\n const rhs = a2.redSub(four);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // (256 * (A^2 - 3)^3) / (A^2 - 4)\n return lhs.redDiv(rhs).fromRed();\n }\n\n point(x, y) {\n return new MontPoint(this, x, y);\n }\n\n jpoint(x, y, z) {\n assert(x == null && y == null && z == null);\n return this.point();\n }\n\n xpoint(x, z) {\n return new XPoint(this, x, z);\n }\n\n solveY2(x) {\n // [MONT3] Page 3, Section 2.\n // https://hyperelliptic.org/EFD/g1p/auto-montgom.html\n assert(x instanceof BN);\n\n // B * y^2 = x^3 + A * x^2 + x\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const by2 = x3.redIAdd(this.a.redMul(x2)).redIAdd(x);\n const y2 = by2.redMul(this.bi);\n\n return y2;\n }\n\n validate(point) {\n assert(point instanceof MontPoint);\n\n if (point.isInfinity())\n return true;\n\n const {x, y} = point;\n const y2 = this.solveY2(x);\n\n return y.redSqr().eq(y2);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve, invert) {\n // [MONT3] Page 3, Section 2.1.\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n // M(A,B) <-> M(A,B')\n if (curve.type === 'mont') {\n const a = this.field(curve.a);\n const b = this.field(curve.b);\n\n // A' = A\n if (!this.a.eq(a))\n return false;\n\n // B' != 0\n if (this.b.isZero())\n return false;\n\n // jacobi(B / B') = 1\n const c = b.redDiv(this.b);\n\n return c.redJacobi() === 1;\n }\n\n return curve.isIsomorphic(this, invert);\n }\n\n isIsogenous(curve) {\n assert(curve instanceof Curve);\n\n if (curve.type === 'mont')\n return false;\n\n return curve.isIsogenous(this);\n }\n\n pointFromShort(point) {\n // [ALT] Appendix E.2 (Switching between Alternative Representations).\n // [MONT2] \"Equivalence with Weierstrass curves\"\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,b)->M(A,B):\n //\n // u = B * x - A / 3\n // v = B * y\n //\n // Undefined if ((u^3 + A * u^2 + u) / B) is not square.\n if (point.isInfinity())\n return this.point();\n\n const {a3, b} = this;\n const [u2, u3] = this._scale(point.curve);\n const x = this.field(point.x).redMul(u2);\n const y = this.field(point.y).redMul(u3);\n const u = b.redMul(x).redISub(a3);\n const v = b.redMul(y);\n\n return this.point(u, v);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [MONT3] Page 3, Section 2.1.\n assert(point instanceof MontPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for M(A,B)<->M(A,B'):\n //\n // u' = u\n // v' = +-sqrt(B / B') * v\n //\n // Undefined if (B / B') is not square.\n if (point.isInfinity())\n return this.point();\n\n const c = this._scale(point.curve);\n const u = this.field(point.x);\n const v = this.field(point.y);\n const nu = u;\n const nv = c.redMul(v);\n\n return this.point(nu, nv);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [RFC7748] Section 4.1 & 4.2.\n // [MONT3] Page 6, Section 2.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n assert(point instanceof EdwardsPoint);\n assert(point.curve.p.eq(this.p));\n\n // Edwards `x`, `y`, `z`.\n const x = this.field(point.x);\n const y = this.field(point.y);\n const z = this.field(point.z);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for E(1,d)->M(2-4d,1):\n //\n // u = y^2 / x^2\n // v = (2 - x^2 - y^2) * y / x^3\n //\n // Undefined for x = 0.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-1, 0) -> (0, 0)\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = z.redSqr().redIMuln(2);\n const uu = y.redSqr();\n const uz = x.redSqr();\n const vv = c.redISub(uz).redISub(uu).redMul(y);\n const vz = uz.redMul(x);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n if (this.isIsomorphic(point.curve, true)) {\n // Isomorphic maps for E(d,a)->M(A,B):\n //\n // u = (y + 1) / (y - 1)\n // v = +-sqrt((A - 2) / (B * a)) * u / x\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-sqrt(1 / a), 0) -> (-1, +-sqrt((A - 2) / B))\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = this._scale(point.curve, true);\n const uu = y.redAdd(z);\n const uz = y.redSub(z);\n const vv = c.redMul(z).redMul(uu);\n const vz = x.redMul(uz);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n if (this.isIsomorphic(point.curve, false)) {\n // Isomorphic maps for E(a,d)->M(A,B):\n //\n // u = (1 + y) / (1 - y)\n // v = +-sqrt((A + 2) / (B * a)) * u / x\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-sqrt(1 / a), 0) -> (1, +-sqrt((A + 2) / B))\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = this._scale(point.curve, false);\n const uu = z.redAdd(y);\n const uz = z.redSub(y);\n const vv = c.redMul(z).redMul(uu);\n const vz = x.redMul(uz);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n assert(u instanceof BN);\n\n // z = 0 or A = 0\n if (this.z.isZero() || this.a.isZero())\n throw new Error('Not implemented.');\n\n return this._elligator2(u);\n }\n\n pointToUniform(p, hint) {\n // Convert a montgomery point to a field\n // element by inverting the elligator2 map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof MontPoint);\n assert((hint >>> 0) === hint);\n\n // z = 0 or A = 0\n if (this.z.isZero() || this.a.isZero())\n throw new Error('Not implemented.');\n\n // P = O\n if (p.isInfinity())\n throw new Error('Invalid point.');\n\n // Add a random torsion component.\n const i = ((hint >>> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n return wrapErrors(() => {\n return this._invert2(q, hint);\n });\n }\n\n decodePoint(bytes, sign) {\n return MontPoint.decode(this, bytes, sign);\n }\n\n encodeX(point) {\n assert(point instanceof XPoint);\n return point.encode();\n }\n\n decodeX(bytes) {\n return XPoint.decode(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromMont(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, sign = null) {\n const [a, b] = this._mont(b0);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromMont(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, invert, sign = null) {\n const [a, d] = this._edwards(a0, invert);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this, invert);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromMont(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return MontPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n json.a = this.a.fromRed().toJSON();\n json.b = this.b.fromRed().toJSON();\n return json;\n }\n}\n\n/**\n * MontPoint\n */\n\nclass MontPoint extends Point {\n constructor(curve, x, y) {\n assert(curve instanceof MontCurve);\n\n super(curve, types.AFFINE);\n\n this.x = this.curve.zero;\n this.y = this.curve.zero;\n this.inf = true;\n\n if (x != null)\n this._init(x, y);\n }\n\n _init(x, y) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n\n this.x = x;\n this.y = y;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n this.inf = false;\n }\n\n clone() {\n if (this.inf)\n return this.curve.point();\n\n return this.curve.point(this.x, this.y);\n }\n\n scale(a) {\n return this.clone();\n }\n\n randomize(rng) {\n return this.clone();\n }\n\n neg() {\n // P = O\n if (this.inf)\n return this;\n\n // -(X1, Y1) = (X1, -Y1)\n return this.curve.point(this.x, this.y.redNeg());\n }\n\n add(p) {\n // [MONT1] Page 8, Section 4.3.2.\n //\n // Addition Law:\n //\n // l = (y2 - y1) / (x2 - x1)\n // x3 = b * l^2 - a - x1 - x2\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 1S + 7A + 1*b\n assert(p instanceof MontPoint);\n\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P, P + -P\n if (this.x.eq(p.x)) {\n // P + -P = O\n if (!this.y.eq(p.y))\n return this.curve.point();\n\n // P + P = 2P\n return this.dbl();\n }\n\n // H = X2 - X1\n const h = p.x.redSub(this.x);\n\n // R = Y2 - Y1\n const r = p.y.redSub(this.y);\n\n // L = R / H\n const l = r.redDiv(h);\n\n // K = b * L^2\n const k = this.curve.b.redMul(l.redSqr());\n\n // X3 = K - a - X1 - X2\n const nx = k.redISub(this.curve.a).redISub(this.x).redISub(p.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dbl() {\n // [MONT1] Page 8, Section 4.3.2.\n //\n // Addition Law (doubling):\n //\n // l = (3 * x1^2 + 2 * a * x1 + 1) / (2 * b * y1)\n // x3 = b * l^2 - a - 2 * x1\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 3M + 2S + 7A + 1*a + 1*b + 1*b + 2*2 + 1*3\n\n // P = O\n if (this.inf)\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.point();\n\n // M1 = 3 * X1^2\n const m1 = this.x.redSqr().redIMuln(3);\n\n // M2 = 2 * a * X1\n const m2 = this.curve.a.redMul(this.x).redIMuln(2);\n\n // M = M1 + M2 + 1\n const m = m1.redIAdd(m2).redIAdd(this.curve.one);\n\n // Z = 2 * b * Y1\n const z = this.curve.b.redMul(this.y).redIMuln(2);\n\n // L = M / Z\n const l = m.redDiv(z);\n\n // K = b * L^2\n const k = this.curve.b.redMul(l.redSqr());\n\n // X3 = K - a - 2 * X1\n const nx = k.redISub(this.curve.a).redISub(this.x).redISub(this.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n getX() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof MontPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.inf)\n return p.inf;\n\n // Q = O\n if (p.inf)\n return false;\n\n // X1 = X2, Y1 = Y2\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n cmp(point) {\n assert(point instanceof MontPoint);\n\n if (this.inf && !point.inf)\n return -1;\n\n if (!this.inf && point.inf)\n return 1;\n\n if (this.inf && point.inf)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Infinity cannot be represented in\n // the affine space, except by a flag.\n return this.inf;\n }\n\n isOrder2() {\n if (this.inf)\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.inf)\n return false;\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.inf)\n return false;\n\n return this.y.redIsEven();\n }\n\n toP() {\n return this;\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n // (X3, Z3) = (1, 0)\n if (this.inf)\n return this.curve.xpoint();\n\n // (X3, Z3) = (X1, 1)\n return this.curve.xpoint(this.x, this.curve.one);\n }\n\n encode() {\n return this.toX().encode();\n }\n\n static decode(curve, bytes, sign) {\n assert(curve instanceof MontCurve);\n return curve.decodeX(bytes).toP(sign);\n }\n\n toJSON(pre) {\n if (this.inf)\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n return [x, y];\n }\n\n toPretty() {\n if (this.inf)\n return [];\n\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof MontCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n\n return curve.point(x, y);\n }\n\n [custom]() {\n if (this.inf)\n return '';\n\n return '';\n }\n}\n\n/**\n * XPoint\n */\n\nclass XPoint extends Point {\n constructor(curve, x, z) {\n assert(curve instanceof MontCurve);\n\n super(curve, types.PROJECTIVE);\n\n this.x = this.curve.one;\n this.z = this.curve.zero;\n\n if (x != null)\n this._init(x, z);\n }\n\n _init(x, z) {\n assert(x instanceof BN);\n assert(z == null || (z instanceof BN));\n\n this.x = x;\n this.z = z || this.curve.one;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n }\n\n clone() {\n return this.curve.xpoint(this.x, this.z);\n }\n\n precompute(power, rng) {\n // No-op.\n return this;\n }\n\n validate() {\n if (this.isInfinity())\n return true;\n\n // B * y^2 * z = x^3 + A * x^2 * z + x * z^2\n const {x, z} = this;\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const z2 = z.redSqr();\n const ax2 = this.curve.a.redMul(x2).redMul(z);\n const by2 = x3.redIAdd(ax2).redIAdd(x.redMul(z2));\n const y2 = by2.redMul(this.curve.bi);\n\n // sqrt(y^2 * z^4) = y * z^2\n return y2.redMul(z).redJacobi() !== -1;\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#scaling-scale\n // 1I + 1M\n\n // P = O\n if (this.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.z.eq(this.curve.one))\n return this;\n\n // X3 = X1 / Z1\n this.x = this.x.redDiv(this.z);\n\n // Z3 = 1\n this.z = this.curve.one;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // P = O\n if (this.isInfinity())\n return this.curve.xpoint();\n\n // X3 = X1 * A\n const nx = this.x.redMul(a);\n\n // Y3 = Y1 * A\n const nz = this.z.redMul(a);\n\n return this.curve.xpoint(nx, nz);\n }\n\n neg() {\n // -(X1, Z1) = (X1, Z1)\n return this;\n }\n\n dbl() {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n // 2M + 2S + 4A + 1*a24\n\n // A = X1 + Z1\n const a = this.x.redAdd(this.z);\n\n // AA = A^2\n const aa = a.redSqr();\n\n // B = X1 - Z1\n const b = this.x.redSub(this.z);\n\n // BB = B^2\n const bb = b.redSqr();\n\n // C = AA - BB\n const c = aa.redSub(bb);\n\n // X3 = AA * BB\n const nx = aa.redMul(bb);\n\n // Z3 = C * (BB + a24 * C)\n const nz = c.redMul(bb.redIAdd(this.curve.a24.redMul(c)));\n\n return this.curve.xpoint(nx, nz);\n }\n\n diffAddDbl(p2, p3) {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#ladder-ladd-1987-m-3\n // 6M + 4S + 8A + 1*a24\n assert(p2 instanceof XPoint);\n assert(p3 instanceof XPoint);\n\n // A = X2 + Z2\n const a = p2.x.redAdd(p2.z);\n\n // AA = A^2\n const aa = a.redSqr();\n\n // B = X2 - Z2\n const b = p2.x.redSub(p2.z);\n\n // BB = B^2\n const bb = b.redSqr();\n\n // E = AA - BB\n const e = aa.redSub(bb);\n\n // C = X3 + Z3\n const c = p3.x.redAdd(p3.z);\n\n // D = X3 - Z3\n const d = p3.x.redSub(p3.z);\n\n // DA = D * A\n const da = d.redMul(a);\n\n // CB = C * B\n const cb = c.redMul(b);\n\n // X5 = Z1 * (DA + CB)^2\n const x5 = this.z.redMul(da.redAdd(cb).redSqr());\n\n // Z5 = X1 * (DA - CB)^2\n const z5 = this.x.redMul(da.redISub(cb).redSqr());\n\n // X4 = AA * BB\n const x4 = aa.redMul(bb);\n\n // Z4 = E * (BB + a24 * E)\n const z4 = e.redMul(bb.redIAdd(this.curve.a24.redMul(e)));\n\n return [\n this.curve.xpoint(x4, z4),\n this.curve.xpoint(x5, z5)\n ];\n }\n\n getX() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.x.fromRed();\n }\n\n getY(sign) {\n return this.toP(sign).getY();\n }\n\n eq(p) {\n assert(p instanceof XPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.isInfinity())\n return p.isInfinity();\n\n // Q = O\n if (p.isInfinity())\n return false;\n\n // Z1 = Z2\n if (this.z.eq(p.z))\n return this.x.eq(p.x);\n\n // X1 * Z2 = X2 * Z1\n const x1 = this.x.redMul(p.z);\n const x2 = p.x.redMul(this.z);\n\n return x1.eq(x2);\n }\n\n cmp(point) {\n assert(point instanceof XPoint);\n\n const inf1 = this.isInfinity();\n const inf2 = point.isInfinity();\n\n if (inf1 && !inf2)\n return -1;\n\n if (!inf1 && inf2)\n return 1;\n\n if (inf1 && inf2)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX());\n }\n\n isInfinity() {\n // Z1 = 0\n return this.z.isZero();\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.x.isZero();\n }\n\n isOdd() {\n return false;\n }\n\n isEven() {\n return false;\n }\n\n hasTorsion() {\n if (this.isInfinity())\n return false;\n\n // X1 = 0, Z1 != 0 (edge case)\n if (this.x.isZero())\n return true;\n\n return super.hasTorsion();\n }\n\n order() {\n try {\n return this.toP().order();\n } catch (e) {\n return new BN(1);\n }\n }\n\n jmul(k) {\n // Multiply with the Montgomery Ladder.\n //\n // [MONT3] Algorithm 4, Page 12, Section 4.2.\n //\n // Note that any clamping is meant to\n // be done _outside_ of this function.\n assert(k instanceof BN);\n assert(!k.red);\n\n const bits = k.bitLength();\n\n let a = this.curve.xpoint();\n let b = this;\n\n for (let i = bits - 1; i >= 0; i--) {\n const bit = k.bit(i);\n\n if (bit === 0)\n [a, b] = this.diffAddDbl(a, b);\n else\n [b, a] = this.diffAddDbl(b, a);\n }\n\n return a;\n }\n\n jmulBlind(k, rng) {\n if (!rng)\n return this.jmul(k);\n\n // Randomize if available.\n return this.randomize(rng).jmul(k);\n }\n\n jmulAdd(k1, p2, k2) {\n throw new Error('Not implemented.');\n }\n\n toP(sign = null) {\n assert(sign == null || typeof sign === 'boolean');\n\n if (this.isInfinity())\n return this.curve.point();\n\n this.normalize();\n\n return this.curve.pointFromX(this.x, sign);\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n return this;\n }\n\n key() {\n if (this.isInfinity())\n return `${this.curve.uid}:oo`;\n\n this.normalize();\n\n const x = this.getX().toString(16);\n\n return `${this.curve.uid}:${x}`;\n }\n\n encode() {\n // [RFC7748] Section 5.\n return this.curve.encodeField(this.getX());\n }\n\n static decode(curve, bytes) {\n assert(curve instanceof MontCurve);\n\n // [RFC7748] Section 5.\n const x = curve.decodeField(bytes);\n\n // We're supposed to ignore the hi bit\n // on montgomery points... I think. If\n // we don't, the X25519 test vectors\n // break, which is pretty convincing\n // evidence. This is a no-op for X448.\n x.iumaskn(curve.fieldBits);\n\n // Note: montgomery points are meant to be\n // reduced by the prime and do not have to\n // be explicitly validated in order to do\n // the montgomery ladder.\n const p = curve.xpoint(x, curve.one);\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n toJSON(pre) {\n return this.toP().toJSON(pre);\n }\n\n toPretty() {\n return this.toP().toPretty();\n }\n\n static fromJSON(curve, json) {\n return MontPoint.fromJSON(curve, json).toX();\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * EdwardsCurve\n */\n\nclass EdwardsCurve extends Curve {\n constructor(conf) {\n super(EdwardsPoint, 'edwards', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.d = BN.fromJSON(conf.d).toRed(this.red);\n this.s = BN.fromJSON(conf.s || '0').toRed(this.red);\n this.si = this.s.isZero() ? this.zero : this.s.redInvert();\n\n this.k = this.d.redMuln(2);\n this.smi = -this.d.redNeg().word(0);\n this.ad6 = this.a.redAdd(this.d).redMul(this.i6);\n\n this.twisted = !this.a.eq(this.one);\n this.oneA = this.a.eq(this.one);\n this.mOneA = this.a.eq(this.one.redNeg());\n this.smallD = this.prime != null && this.d.redNeg().length === 1;\n this.alt = null;\n\n this._finalize(conf);\n }\n\n static _isomorphism(curveA, curveD, customA) {\n // Twisted Edwards Isomorphism.\n //\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n //\n // Transformation:\n //\n // a' = a'\n // d' = a' * d / a\n //\n // Where (a / a') is square.\n assert(curveA instanceof BN);\n assert(curveD instanceof BN);\n assert(customA instanceof BN);\n\n const a = customA.clone();\n const d = customA.redMul(curveD).redDiv(curveA);\n const c = curveA.redDiv(customA);\n\n if (c.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n return [a, d];\n }\n\n _short(a0, odd) {\n // Twisted Edwards->Short Weierstrass Equivalence.\n //\n // [TWISTEQ] Section 2.\n //\n // Transformation:\n //\n // a' = -(a^2 + 14 * a * d + d^2) / 48\n // b' = (33 * (a^2 * d + a * d^2) - a^3 - d^3) / 864\n const {a, d} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const d2 = d.redSqr();\n const d3 = d2.redMul(d);\n const ad14 = a.redMul(d).redIMuln(14);\n const a2d = a2.redMul(d);\n const ad2 = a.redMul(d2);\n const t0 = a2d.redIAdd(ad2).redIMuln(33);\n const wa = a2.redAdd(ad14).redIAdd(d2).redDivn(-48);\n const wb = t0.redISub(a3).redISub(d3).redDivn(864);\n\n if (a0 != null)\n return ShortCurve._isomorphism(wa, wb, a0, odd);\n\n return [wa, wb];\n }\n\n _mont(b0, invert = false) {\n // Twisted Edwards->Montgomery Transformation.\n //\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n //\n // Equivalence:\n //\n // A = 2 * (a + d) / (a - d)\n // B = 4 / (a - d)\n //\n // Isomorphism:\n //\n // A = 2 * (a + d) / (a - d)\n // B = B'\n //\n // Where ((4 / (a - d)) / B') is square.\n //\n // If `4 / (a - d)` is non-square, we can\n // usually force B=1 by using the `invert`\n // option. This will create an isomorphism\n // chain of: E(a,d)->E(d,a)->M(-A,-B).\n //\n // The equivalence between E(a,d) and E(d,a)\n // is:\n //\n // (x, y) = (x, 1 / y)\n //\n // Meaning our map to M(-A,-B) is:\n //\n // u = (1 + 1 / y) / (1 - 1 / y)\n // = (y + 1) / (y - 1)\n // v = u / x\n assert(typeof invert === 'boolean');\n\n let apd, amd;\n\n if (invert) {\n apd = this.d.redAdd(this.a);\n amd = this.d.redSub(this.a);\n } else {\n apd = this.a.redAdd(this.d);\n amd = this.a.redSub(this.d);\n }\n\n const z = amd.redInvert();\n const a = apd.redMuln(2).redMul(z);\n const b = z.redMuln(4);\n\n if (b0 != null)\n return MontCurve._isomorphism(a, b, b0);\n\n return [a, b];\n }\n\n _edwards(a0) {\n return EdwardsCurve._isomorphism(this.a, this.d, a0);\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n const [u2, u3] = curve._scale(this);\n\n return [this.field(u2.redInvert()),\n this.field(u3.redInvert())];\n }\n\n _scaleMont(curve, invert = false) {\n // Calculate isomorphism factor between\n // Twisted Edwards and Montgomery with:\n //\n // a = (A + 2) / B\n // c = +-sqrt(a / a')\n //\n // Which can be reduced to:\n //\n // c = +-sqrt((A + 2) / (B * a'))\n //\n // If base points are available, we can do:\n //\n // x = u / v\n // c = x' / x\n //\n // Which can be reduced to:\n //\n // c = v * x' / u\n //\n // We can now calculate the Edwards `x` with:\n //\n // x' = c * u / v\n //\n // And likewise, the Montgomery `v`:\n //\n // v = c * u / x'\n assert(curve instanceof MontCurve);\n assert(typeof invert === 'boolean');\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a] = curve._edwards(null, invert);\n\n return this.field(a).redDivSqrt(this.a);\n }\n\n const x = curve.g.x.redDiv(curve.g.y);\n\n return this.g.x.redDiv(this.field(x));\n }\n\n _scaleEdwards(curve) {\n // We can extract the isomorphism factor with:\n //\n // c = +-sqrt(a / a')\n //\n // If base points are available, we can do:\n //\n // c = x' / x\n assert(curve instanceof EdwardsCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this.field(curve.a).redDivSqrt(this.a);\n\n return this.g.x.redDiv(this.field(curve.g.x));\n }\n\n _mulA(num) {\n assert(num instanceof BN);\n\n // n * a = n\n if (this.oneA)\n return num.clone();\n\n // n * a = -n\n if (this.mOneA)\n return num.redNeg();\n\n return this.a.redMul(num);\n }\n\n _mulD(num) {\n assert(num instanceof BN);\n\n // -d < 0x4000000\n if (this.smallD)\n return num.redMuln(this.smi);\n\n return this.d.redMul(num);\n }\n\n _elligator1(t) {\n // Elligator 1.\n //\n // Distribution: 1/2.\n //\n // [ELL1] Page 6, Section 3.\n // Page 15, Appendix A.\n // [ELL2] Page 7, Section 3.2.\n //\n // Assumptions:\n //\n // - Let p be a prime power congruent to 3 mod 4.\n // - Let s be a nonzero element of F(p).\n // - Let c = 2 / s^2.\n // - Let r = c + 1 / c.\n // - Let d = -(c + 1)^2 / (c - 1)^2.\n // - (s^2 - 2) * (s^2 + 2) != 0.\n // - c * (c - 1) * (c + 1) != 0.\n // - r != 0.\n // - d is not square.\n // - x^2 + y^2 = 1 + d * x^2 * y^2.\n // - u * v * X * Y * x * (Y + 1) != 0.\n // - Y^2 = X^5 + (r^2 - 2) * X^3 + X.\n //\n // Elligator 1, as devised by Fouque et al,\n // takes place on the hyperelliptic curve of:\n //\n // y^2 = x^5 + (r^2 - 2) * x^3 + x\n //\n // Not only must our Edwards curve be complete,\n // with a prime congruent to 3 mod 4, and a = 1,\n // our curve must be isomorphic to a hyperelliptic\n // curve of the above form. Roughly one half of\n // all Edwards curves are isomorphic to a curve\n // of said form.\n //\n // We can derive the isomorphism with:\n //\n // c = (d +- 2 * sqrt(-d) - 1) / (d + 1)\n // s = +-sqrt(2 / c)\n // r = c + 1 / c\n //\n // Note that even if your curve is an Elligator 1\n // curve, Elligator 2 is probably still preferable,\n // as it has nearly the same properties (i.e. the\n // same distribution), and is much less complex.\n //\n // Map:\n //\n // f(a) = a^((p - 1) / 2)\n // u = (1 - t) / (1 + t)\n // v = u^5 + (r^2 - 2) * u^3 + u\n // X = f(v) * u\n // Y = (f(v) * v)^((p + 1) / 4) * f(v) * f(u^2 + 1 / c^2)\n // Y = 1, if u = 0\n // x = (c - 1) * s * X * (1 + X) / Y\n // y = (r * X - (1 + X)^2) / (r * X + (1 + X)^2)\n //\n // When t = +-1, we create the hyperelliptic\n // 2-torsion point of (0, 0). This needs to be\n // mapped to (0, -1) in Edwards form, but the x\n // denominator becomes zero. As far as I can\n // tell, this is the only exceptional case.\n //\n // The only other exceptional case initially\n // appears to be when the y denominator sums to\n // zero (when t = sqrt(4 / r + 1)), however, the\n // hyperelliptic `X` is negated by the sign of\n // `v`, making this impossible.\n const {s, si, i2, one, two} = this;\n const c = si.redSqr().redIMuln(2);\n const ci = s.redSqr().redMul(i2);\n const ci2 = ci.redSqr();\n const r = c.redAdd(ci);\n const r2 = r.redSqr().redISub(two);\n const cm1 = c.redSub(one);\n const uu = one.redSub(t);\n const uz = one.redAdd(t);\n const u = uz.isZero() ? uz : uu.redDiv(uz);\n const u2 = u.redSqr();\n const u3 = u2.redMul(u);\n const u5 = u3.redMul(u2);\n const v = u5.redAdd(r2.redMul(u3)).redIAdd(u);\n const f0 = this.field(v.redJacobi());\n const f1 = this.field(u2.redAdd(ci2).redJacobi());\n const f2 = f0.redMul(f1);\n const X = f0.redMul(u);\n const Y = f0.redMul(v).redSqrt().redMul(f2);\n const X1 = one.redAdd(X);\n const rX = r.redMul(X);\n const X12 = X1.redSqr();\n const xx = cm1.redMul(s).redMul(X).redMul(X1);\n const xz = u.isZero() ? this.one : Y;\n const yy = rX.redSub(X12);\n const yz = rX.redAdd(X12);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n _invert1(p, hint) {\n // Inverting the Map (Elligator 1).\n //\n // [ELL1] Page 6, Section 3.\n // Page 15, Appendix A.\n // [ELL2] Page 7, Section 3.3.\n //\n // Assumptions:\n //\n // - y + 1 != 0.\n // - (1 + n * r)^2 - 1 is square in F(p).\n // - If n * r = -2 then x = 2 * s * (c - 1) * f(c) / r.\n // - Y = (c - 1) * s * X * (1 + X) / x.\n //\n // Map:\n //\n // f(a) = a^((p - 1) / 2)\n // n = (y - 1) / (2 * (y + 1))\n // X = -(1 + n * r) + ((1 + n * r)^2 - 1)^((p + 1) / 4)\n // z = f((c - 1) * s * X * (1 + X) * x * (X^2 + 1 / c^2))\n // u = z * X\n // t = (1 - u) / (1 + u)\n const {s, si, i2, one} = this;\n const {x, y, z} = p;\n const sign = hint & 1;\n const c = si.redSqr().redIMuln(2);\n const ci = s.redSqr().redMul(i2);\n const ci2 = ci.redSqr();\n const r = c.redAdd(ci);\n const cm1 = c.redSub(one);\n const nn = y.redSub(z);\n const nz = y.redAdd(z).redIMuln(2);\n const n = nz.isZero() ? nz : nn.redDiv(nz);\n const nr1 = one.redAdd(n.redMul(r));\n const w2 = nr1.redSqr().redISub(one);\n const w = w2.redSqrt();\n const X = w.redSub(nr1);\n const X1 = one.redAdd(X);\n const YY = cm1.redMul(s).redMul(X).redMul(X1);\n const Y = YY.redMul(x.redMul(z));\n const X2 = X.redSqr().redIAdd(ci2);\n const Z = this.field(Y.redMul(X2).redJacobi());\n const u = Z.redMul(X);\n const tt = one.redSub(u);\n const tz = one.redAdd(u);\n const t = tz.isZero() ? tz : tt.redDiv(tz);\n\n if (t.redIsOdd() !== Boolean(sign))\n t.redINeg();\n\n return t;\n }\n\n _alt() {\n if (!this.alt)\n this.alt = this.toMont();\n\n return this.alt;\n }\n\n isElliptic() {\n const ad = this.a.redMul(this.d);\n const amd = this.a.redSub(this.d);\n\n // a * d * (a - d) != 0\n return !ad.redMul(amd).isZero();\n }\n\n jinv() {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n const {a, d} = this;\n const ad = a.redMul(d);\n const amd4 = a.redSub(d).redPown(4);\n const a2 = a.redSqr();\n const d2 = d.redSqr();\n const t0 = a2.redAdd(ad.redMuln(14)).redIAdd(d2);\n const lhs = t0.redPown(3).redIMuln(16);\n const rhs = ad.redMul(amd4);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // 16 * (a^2 + 14 * a * d + d^2)^3 / (a * d * (a - d)^4)\n return lhs.redDiv(rhs).fromRed();\n }\n\n isComplete() {\n return this.a.redJacobi() === 1\n && this.d.redJacobi() === -1;\n }\n\n point(x, y, z, t) {\n return new EdwardsPoint(this, x, y, z, t);\n }\n\n jpoint(x, y, z) {\n assert(x == null && y == null && z == null);\n return this.point();\n }\n\n cpoint(xx, xz, yy, yz) {\n assert(xx instanceof BN);\n assert(xz instanceof BN);\n assert(yy instanceof BN);\n assert(yz instanceof BN);\n\n const x = xx.redMul(yz);\n const y = yy.redMul(xz);\n const z = xz.redMul(yz);\n const t = xx.redMul(yy);\n\n return this.point(x, y, z, t);\n }\n\n solveX2(y) {\n // [RFC8032] Section 5.1.3 & 5.2.3.\n assert(y instanceof BN);\n\n // x^2 = (y^2 - 1) / (d * y^2 - a)\n const y2 = y.redSqr();\n const rhs = this._mulD(y2).redISub(this.a);\n const lhs = y2.redISub(this.one);\n const x2 = lhs.redDiv(rhs);\n\n return x2;\n }\n\n solveX(y) {\n // Optimize with inverse square root trick.\n //\n // Note that `0 / 0` can only occur if\n // `a == d` (i.e. the curve is singular).\n const y2 = y.redSqr();\n const rhs = this._mulD(y2).redISub(this.a);\n const lhs = y2.redISub(this.one);\n\n return lhs.redDivSqrt(rhs);\n }\n\n solveY2(x) {\n assert(x instanceof BN);\n\n // y^2 = (a * x^2 - 1) / (d * x^2 - 1)\n const x2 = x.redSqr();\n const lhs = this._mulA(x2).redISub(this.one);\n const rhs = this._mulD(x2).redISub(this.one);\n const y2 = lhs.redDiv(rhs);\n\n return y2;\n }\n\n solveY(x) {\n // Optimize with inverse square root trick.\n //\n // Note that `0 / 0` can only occur if\n // `a == d` (i.e. the curve is singular).\n const x2 = x.redSqr();\n const lhs = this._mulA(x2).redISub(this.one);\n const rhs = this._mulD(x2).redISub(this.one);\n\n return lhs.redDivSqrt(rhs);\n }\n\n validate(point) {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n // Page 11, Section 6.\n assert(point instanceof EdwardsPoint);\n\n // Z1 = 1\n if (point.zOne) {\n // a * x^2 + y^2 = 1 + d * x^2 * y^2\n const x2 = point.x.redSqr();\n const y2 = point.y.redSqr();\n const dxy = this._mulD(x2).redMul(y2);\n const lhs = this._mulA(x2).redIAdd(y2);\n const rhs = this.one.redAdd(dxy);\n const tz = point.t;\n const xy = point.x.redMul(point.y);\n\n return lhs.eq(rhs) && tz.eq(xy);\n }\n\n // (a * x^2 + y^2) * z^2 = z^4 + d * x^2 * y^2\n const x2 = point.x.redSqr();\n const y2 = point.y.redSqr();\n const z2 = point.z.redSqr();\n const z4 = z2.redSqr();\n const dxy = this._mulD(x2).redMul(y2);\n const lhs = this._mulA(x2).redIAdd(y2).redMul(z2);\n const rhs = z4.redIAdd(dxy);\n const tz = point.t.redMul(point.z);\n const xy = point.x.redMul(point.y);\n\n return lhs.eq(rhs) && tz.eq(xy);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n pointFromY(y, sign = null) {\n assert(y instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!y.red)\n y = y.toRed(this.red);\n\n const x = this.solveX(y);\n\n if (sign != null) {\n if (x.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (x.redIsOdd() !== sign)\n x.redINeg();\n }\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve, invert = false) {\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n // Definition 2.1, Page 3, Section 2.\n assert(curve instanceof Curve);\n assert(typeof invert === 'boolean');\n\n if (!curve.p.eq(this.p))\n return false;\n\n // E(a,d) <-> E(a,b)\n if (curve.type === 'short')\n return curve.isIsomorphic(this);\n\n // E(a,d) <-> M(A,B)\n // E(a,d) <-> M(-A,-B)\n if (curve.type === 'mont') {\n // A * (a - d) = 2 * (a + d)\n const a = this.field(curve.a);\n\n let apd, amd;\n\n if (invert) {\n apd = this.d.redAdd(this.a);\n amd = this.d.redSub(this.a);\n } else {\n apd = this.a.redAdd(this.d);\n amd = this.a.redSub(this.d);\n }\n\n return a.redMul(amd).eq(apd.redIMuln(2));\n }\n\n // E(a,d) <-> E(a',a'd/a)\n if (curve.type === 'edwards') {\n // a' * d = a * d'\n const a = this.field(curve.a);\n const d = this.field(curve.d);\n\n return this.a.redMul(d).eq(a.redMul(this.d));\n }\n\n return false;\n }\n\n isIsogenous(curve) {\n // Check for the 4-isogenies described by Hamburg:\n // https://moderncrypto.org/mail-archive/curves/2016/000806.html\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n // E(1,d) <-> M(2-4d,1)\n if (curve.type === 'mont') {\n if (!this.a.eq(this.one))\n return false;\n\n const a = this.field(curve.a);\n const b = this.field(curve.b);\n const d24 = this.two.redSub(this.d.redMuln(4));\n\n return a.eq(d24) && b.eq(this.one);\n }\n\n // E(a,d) <-> E(-a,d-a)\n if (curve.type === 'edwards') {\n const a = this.field(curve.a);\n const d = this.field(curve.d);\n\n return a.eq(this.a.redNeg())\n && d.eq(this.d.redSub(this.a));\n }\n\n return false;\n }\n\n pointFromShort(point) {\n // [TWISTEQ] Section 1.\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,b)->E(a',d'):\n //\n // x' = (6 * x - a' - d') / (6 * y)\n // y' = (12 * x - 5 * a' + d') / (12 * x + a' - 5 * d')\n //\n // Undefined for x = (5 * d' - a') / 12 or y = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - ((a' + d') / 6, 0) -> (0, -1)\n // - ((5 * d' - a') / 12, (d' - a') / 4 * sqrt(d')) -> (sqrt(1/d'), oo)\n //\n // Unexceptional Cases:\n // - ((5 * a' - d') / 12, (a' - d') / 4 * sqrt(a')) -> (sqrt(1/a'), 0)\n if (point.isInfinity())\n return this.point();\n\n if (point.y.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const {a, d} = this;\n const [u2, u3] = this._scale(point.curve);\n const a5 = a.redMuln(5);\n const d5 = d.redMuln(5);\n const x = this.field(point.x).redMul(u2);\n const y = this.field(point.y).redMul(u3);\n const x6 = x.redMuln(6);\n const x12 = x.redMuln(12);\n const xx = x6.redSub(a).redISub(d);\n const xz = y.redMuln(6);\n const yy = x12.redSub(a5).redIAdd(d);\n const yz = x12.redAdd(a).redISub(d5);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [RFC7748] Section 4.1 & 4.2.\n // [MONT3] Page 6, Section 2.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n assert(point instanceof MontPoint);\n assert(point.curve.p.eq(this.p));\n\n // Montgomery `u`, `v`.\n const u = this.field(point.x);\n const v = this.field(point.y);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for M(2-4d,1)->E(1,d):\n //\n // x = 4 * v * (u^2 - 1) / (u^4 - 2 * u^2 + 4 * v^2 + 1)\n // y = -(u^5 - 2 * u^3 - 4 * u * v^2 + u) /\n // (u^5 - 2 * u^2 * v^2 - 2 * u^3 - 2 * v^2 + u)\n //\n // Undefined for u = 0 and v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, 1)\n //\n // Unexceptional Cases:\n // - (-1, +-sqrt(A - 2)) -> (0, 1)\n // - (1, +-sqrt(A + 2)) -> (0, -1)\n //\n // The point (1, v) is invalid on Curve448.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point();\n\n const u2 = u.redSqr();\n const u3 = u2.redMul(u);\n const u4 = u3.redMul(u);\n const u5 = u4.redMul(u);\n const v2 = v.redSqr();\n const a = v.redMuln(4);\n const b = u2.redSub(this.one);\n const c = u2.redMuln(2);\n const d = v2.redMuln(4);\n const e = u3.redIMuln(2);\n const f = u.redMul(v2).redIMuln(4);\n const g = u2.redMul(v2).redIMuln(2);\n const h = v2.redIMuln(2);\n const xx = a.redMul(b);\n const xz = u4.redISub(c).redIAdd(d).redIAdd(this.one);\n const yy = u5.redSub(e).redISub(f).redIAdd(u).redINeg();\n const yz = u5.redISub(g).redISub(e).redISub(h).redIAdd(u);\n\n return this.cpoint(xx, xz, yy, yz).divn(4);\n }\n\n if (this.isIsomorphic(point.curve, true)) {\n // Isomorphic maps for M(-A,-B)->E(a,d):\n //\n // x = +-sqrt((A - 2) / (B * a)) * u / v\n // y = (u + 1) / (u - 1)\n //\n // Undefined for u = 1 or v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, -1)\n // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / d), oo)\n //\n // Unexceptional Cases:\n // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / a), 0)\n //\n // The point (1, v) is invalid on Curve448.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const c = this._scale(point.curve, true);\n const xx = c.redMul(u);\n const xz = v;\n const yy = u.redAdd(this.one);\n const yz = u.redSub(this.one);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n if (this.isIsomorphic(point.curve, false)) {\n // Isomorphic maps for M(A,B)->E(a,d):\n //\n // x = +-sqrt((A + 2) / (B * a)) * u / v\n // y = (u - 1) / (u + 1)\n //\n // Undefined for u = -1 or v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, -1)\n // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / d), oo)\n //\n // Unexceptional Cases:\n // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / a), 0)\n //\n // The point (-1, v) is invalid on Curve25519.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const c = this._scale(point.curve, false);\n const xx = c.redMul(u);\n const xz = v;\n const yy = u.redSub(this.one);\n const yz = u.redAdd(this.one);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n // [ISOGENY] Page 2, Section 2.\n assert(point instanceof EdwardsPoint);\n assert(point.curve.p.eq(this.p));\n\n // Edwards `x`, `y`, `z`, `t`.\n const a = this.field(point.curve.a);\n const x = this.field(point.x);\n const y = this.field(point.y);\n const z = this.field(point.z);\n const t = this.field(point.t);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for E(a,d)<->E(-a,d-a):\n //\n // x' = (2 * x * y) / (y^2 - a * x^2)\n // y' = (y^2 + a * x^2) / (2 - y^2 - a * x^2)\n //\n // Undefined for y^2 - a * x^2 = 0\n // or y^2 + a * x^2 = 2.\n const xy = x.redMul(y);\n const x2 = x.redSqr();\n const y2 = y.redSqr();\n const z2 = z.redSqr();\n const ax2 = a.redMul(x2);\n const xx = xy.redIMuln(2);\n const xz = y2.redSub(ax2);\n const yy = y2.redAdd(ax2);\n const yz = z2.redIMuln(2).redISub(yy);\n const p = this.cpoint(xx, xz, yy, yz);\n\n return !this.twisted ? p.divn(4) : p;\n }\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for E(a,d)<->E(a',a'd/a):\n //\n // x' = +-sqrt(a / a') * x\n // y' = y\n //\n // Undefined when (a / a') is not square.\n const c = this._scale(point.curve);\n const nx = c.redMul(x);\n const ny = y;\n const nz = z;\n const nt = c.redMul(t);\n\n return this.point(nx, ny, nz, nt);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u, curve = null) {\n assert(u instanceof BN);\n assert(u.red === this.red);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n const u0 = curve.field(u);\n const p0 = curve.pointFromUniform(u0);\n\n return this.pointFromMont(p0);\n }\n\n pointToUniform(p, hint, curve = null) {\n // Convert an edwards point to a field\n // element by inverting the elligator2 map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof EdwardsPoint);\n assert((hint >>> 0) === hint);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n // Add a random torsion component.\n const i = ((hint >> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n // Convert and invert.\n const p0 = curve.pointFromEdwards(q);\n const u0 = curve.pointToUniform(p0, hint & 15);\n\n return this.field(u0);\n }\n\n pointFromHash(bytes, pake, curve = null) {\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n const p0 = curve.pointFromHash(bytes, pake);\n\n return this.pointFromMont(p0);\n }\n\n pointToHash(p, subgroup, rng, curve = null) {\n assert(p instanceof EdwardsPoint);\n assert((subgroup >>> 0) === subgroup);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n // Add a random torsion component.\n const i = subgroup % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n // Convert and invert.\n const p0 = curve.pointFromEdwards(q);\n\n return curve.pointToHash(p0, 0, rng);\n }\n\n decodePoint(bytes) {\n return EdwardsPoint.decode(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromEdwards(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, invert, sign = null) {\n const [a, b] = this._mont(b0, invert);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = this._scale(curve, invert);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromEdwards(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, sign = null) {\n const [a, d] = this._edwards(a0);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromEdwards(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return EdwardsPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n\n json.a = this.a.fromRed().toJSON();\n json.d = this.d.fromRed().toJSON();\n\n if (!this.s.isZero())\n json.s = this.s.fromRed().toJSON();\n\n return json;\n }\n}\n\n/**\n * EdwardsPoint\n */\n\nclass EdwardsPoint extends Point {\n constructor(curve, x, y, z, t) {\n assert(curve instanceof EdwardsCurve);\n\n super(curve, types.EXTENDED);\n\n this.x = this.curve.zero;\n this.y = this.curve.one;\n this.z = this.curve.one;\n this.t = this.curve.zero;\n this.zOne = true;\n\n if (x != null)\n this._init(x, y, z, t);\n }\n\n _init(x, y, z, t) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n assert(z == null || (z instanceof BN));\n assert(t == null || (t instanceof BN));\n\n this.x = x;\n this.y = y;\n this.z = z || this.curve.one;\n this.t = t || null;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n if (this.t && !this.t.red)\n this.t = this.t.toRed(this.curve.red);\n\n this.zOne = this.z.eq(this.curve.one);\n\n this._check();\n\n if (!this.t) {\n this.t = this.x.redMul(this.y);\n if (!this.zOne)\n this.t = this.t.redDiv(this.z);\n }\n }\n\n _check() {\n // In order to achieve complete\n // addition formulas, `a` must\n // be a square (always the case\n // for a=1), and `d` must be a\n // non-square.\n //\n // If this is not the case, the\n // addition formulas may have\n // exceptional cases where Z3=0.\n //\n // In particular, this can occur\n // when: Q*h = -P*h and Q != -P.\n //\n // This is assuming 4-torsion is\n // involved (the 4-torsion point\n // is _not_ representable when\n // `d` is square).\n if (this.z.isZero())\n throw new Error('Invalid point.');\n }\n\n clone() {\n return this.curve.point(this.x, this.y, this.z, this.t);\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#scaling-z\n // 1I + 2M (+ 1M if extended)\n\n // Z1 = 1\n if (this.zOne)\n return this;\n\n // A = 1 / Z1\n const a = this.z.redInvert();\n\n // X3 = X1 * A\n this.x = this.x.redMul(a);\n\n // Y3 = Y1 * A\n this.y = this.y.redMul(a);\n\n // T3 = T1 * A\n this.t = this.t.redMul(a);\n\n // Z3 = 1\n this.z = this.curve.one;\n this.zOne = true;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // X3 = X1 * A\n const nx = this.x.redMul(a);\n\n // Y3 = Y1 * A\n const ny = this.y.redMul(a);\n\n // Z3 = Z1 * A\n const nz = this.z.redMul(a);\n\n // T3 = T1 * A\n const nt = this.t.redMul(a);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n neg() {\n // -(X1, Y1, Z1, T1) = (-X1, Y1, Z1, -T1)\n const nx = this.x.redNeg();\n const ny = this.y;\n const nz = this.z;\n const nt = this.t.redNeg();\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n add(p) {\n assert(p instanceof EdwardsPoint);\n\n // P = O\n if (this.isInfinity())\n return p;\n\n // Q = O\n if (p.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.zOne)\n return p._add(this);\n\n return this._add(p);\n }\n\n _add(p) {\n // a = -1\n if (this.curve.mOneA)\n return this._addM1(p);\n\n return this._addA(p);\n }\n\n _addM1(p) {\n // Assumes a = -1.\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-3\n // 8M + 8A + 1*k + 1*2\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-madd-2008-hwcd-3\n // 7M + 8A + 1*k + 1*2\n\n // A = (Y1 - X1) * (Y2 - X2)\n const a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n\n // B = (Y1 + X1) * (Y2 + X2)\n const b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n\n // C = T1 * k * T2\n const c = this.t.redMul(this.curve.k).redMul(p.t);\n\n // D = Z1 * 2 * Z2\n const d = p.zOne ? this.z.redAdd(this.z) : this.z.redMul(p.z).redIMuln(2);\n\n // E = B - A\n const e = b.redSub(a);\n\n // F = D - C\n const f = d.redSub(c);\n\n // G = D + C\n const g = d.redIAdd(c);\n\n // H = B + A\n const h = b.redIAdd(a);\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n _addA(p) {\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd\n // 9M + 7A + 1*a + 1*d\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-madd-2008-hwcd\n // 8M + 7A + 1*a + 1*d\n\n // A = X1 * X2\n const a = this.x.redMul(p.x);\n\n // B = Y1 * Y2\n const b = this.y.redMul(p.y);\n\n // C = T1 * d * T2\n const c = this.curve._mulD(this.t).redMul(p.t);\n\n // D = Z1 * Z2\n const d = p.zOne ? this.z.clone() : this.z.redMul(p.z);\n\n // + XYXY = (X1 + Y1) * (X2 + Y2)\n const xyxy = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y));\n\n // E = (X1 + Y1) * (X2 + Y2) - A - B\n const e = xyxy.redISub(a).redISub(b);\n\n // F = D - C\n const f = d.redSub(c);\n\n // G = D + C\n const g = d.redIAdd(c);\n\n // H = B - a * A\n const h = b.redISub(this.curve._mulA(a));\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n dbl() {\n // P = O\n if (this.isInfinity())\n return this;\n\n return this._dbl();\n }\n\n _dbl() {\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd\n // 4M + 4S + 6A + 1*a + 1*2\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-mdbl-2008-hwcd\n // 3M + 4S + 7A + 1*a + 1*2\n\n // A = X1^2\n const a = this.x.redSqr();\n\n // B = Y1^2\n const b = this.y.redSqr();\n\n // C = 2 * Z1^2\n const c = this.zOne ? this.curve.two : this.z.redSqr().redIMuln(2);\n\n // D = a * A\n const d = this.curve._mulA(a);\n\n // E = (X1 + Y1)^2 - A - B\n const e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n\n // G = D + B\n const g = d.redAdd(b);\n\n // F = G - C\n const f = g.redSub(c);\n\n // H = D - B\n const h = d.redISub(b);\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n getX() {\n this.normalize();\n return this.x.fromRed();\n }\n\n getY() {\n this.normalize();\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof EdwardsPoint);\n assert(!this.z.isZero());\n assert(!p.z.isZero());\n\n // P = Q\n if (this === p)\n return true;\n\n // Z1 = Z2\n if (this.z.eq(p.z)) {\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n // X1 * Z2 = X2 * Z1\n const x1 = this.x.redMul(p.z);\n const x2 = p.x.redMul(this.z);\n\n if (!x1.eq(x2))\n return false;\n\n const y1 = this.y.redMul(p.z);\n const y2 = p.y.redMul(this.z);\n\n return y1.eq(y2);\n }\n\n cmp(point) {\n assert(point instanceof EdwardsPoint);\n\n return this.order().cmp(point.order())\n || this.getY().cmp(point.getY())\n || this.getX().cmp(point.getX());\n }\n\n isInfinity() {\n assert(!this.z.isZero());\n\n // X1 = 0\n if (!this.x.isZero())\n return false;\n\n // Y1 = Z1\n return this.y.eq(this.z);\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.x.isZero();\n }\n\n isOdd() {\n this.normalize();\n return this.x.redIsOdd();\n }\n\n isEven() {\n this.normalize();\n return this.x.redIsEven();\n }\n\n toP() {\n return this.normalize();\n }\n\n toJ() {\n return this;\n }\n\n encode() {\n // [RFC8032] Section 5.1.2.\n const y = this.getY();\n\n // Note: `x` normalized from `getY()` call.\n y.setn(this.curve.signBit, this.x.redIsOdd());\n\n return this.curve.encodeAdjusted(y);\n }\n\n static decode(curve, bytes) {\n // [RFC8032] Section 5.1.3.\n assert(curve instanceof EdwardsCurve);\n\n const y = curve.decodeAdjusted(bytes);\n const sign = y.testn(curve.signBit) !== 0;\n\n y.setn(curve.signBit, 0);\n\n if (y.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromY(y, sign);\n }\n\n toJSON(pre) {\n if (this.isInfinity())\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n if (pre === true && this.pre)\n return [x, y, this.pre.toJSON()];\n\n return [x, y];\n }\n\n toPretty() {\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof EdwardsCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n const point = curve.point(x, y);\n\n if (json.length > 2 && json[2] != null)\n point.pre = Precomp.fromJSON(point, json[2]);\n\n return point;\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * Precomp\n */\n\nclass Precomp {\n constructor() {\n this.naf = null;\n this.windows = null;\n this.doubles = null;\n this.blinding = null;\n this.beta = null;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const out = new this.constructor();\n\n if (this.naf)\n out.naf = this.naf.map(func);\n\n if (this.doubles)\n out.doubles = this.doubles.map(func);\n\n return out;\n }\n\n toJSON() {\n return {\n naf: this.naf ? this.naf.toJSON() : null,\n windows: this.windows ? this.windows.toJSON() : null,\n doubles: this.doubles ? this.doubles.toJSON() : null,\n blinding: this.blinding ? this.blinding.toJSON() : undefined\n };\n }\n\n fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n\n if (json.naf != null)\n this.naf = NAF.fromJSON(point, json.naf);\n\n if (json.windows != null)\n this.windows = Windows.fromJSON(point, json.windows);\n\n if (json.doubles != null)\n this.doubles = Doubles.fromJSON(point, json.doubles);\n\n if (json.blinding != null)\n this.blinding = Blinding.fromJSON(point, json.blinding);\n\n return this;\n }\n\n static fromJSON(point, json) {\n return new this().fromJSON(point, json);\n }\n}\n\n/**\n * NAF\n */\n\nclass NAF {\n constructor(width, points) {\n this.width = width;\n this.points = points;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const {width} = this;\n const points = [];\n\n for (const point of this.points)\n points.push(func(point));\n\n return new this.constructor(width, points);\n }\n\n toJSON() {\n return {\n width: this.width,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.width >>> 0) === json.width);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {width} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(width, points);\n }\n}\n\n/**\n * Windows\n */\n\nclass Windows {\n constructor(width, bits, points) {\n this.width = width;\n this.bits = bits;\n this.points = points;\n }\n\n toJSON() {\n return {\n width: this.width,\n bits: this.bits,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.width >>> 0) === json.width);\n assert((json.bits >>> 0) === json.bits);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {width, bits} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(width, bits, points);\n }\n}\n\n/**\n * Doubles\n */\n\nclass Doubles {\n constructor(step, points) {\n this.step = step;\n this.points = points;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const {step} = this;\n const points = [];\n\n for (const point of this.points)\n points.push(func(point));\n\n return new this.constructor(step, points);\n }\n\n toJSON() {\n return {\n step: this.step,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.step >>> 0) === json.step);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {step} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(step, points);\n }\n}\n\n/**\n * Blinding\n */\n\nclass Blinding {\n constructor(blind, unblind) {\n this.blind = blind;\n this.unblind = unblind;\n }\n\n toJSON() {\n return {\n blind: this.blind.toJSON(),\n unblind: this.unblind.toJSON()\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n\n const {curve} = point;\n const blind = BN.fromJSON(json.blind);\n const unblind = curve.pointFromJSON(json.unblind);\n\n return new this(blind, unblind);\n }\n}\n\n/**\n * Endo\n */\n\nclass Endo {\n constructor(beta, lambda, basis, pre) {\n this.beta = beta;\n this.lambda = lambda;\n this.basis = basis;\n this.pre = pre;\n }\n\n toJSON() {\n return {\n beta: this.beta.fromRed().toJSON(),\n lambda: this.lambda.toJSON(),\n basis: [\n this.basis[0].toJSON(),\n this.basis[1].toJSON()\n ],\n pre: [\n this.pre[0],\n this.pre[1].toJSON(),\n this.pre[2].toJSON()\n ]\n };\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof Curve);\n assert(json && typeof json === 'object');\n assert(Array.isArray(json.basis));\n assert(Array.isArray(json.pre));\n assert(json.basis.length === 2);\n assert(json.pre.length === 3);\n assert((json.pre[0] >>> 0) === json.pre[0]);\n\n const beta = BN.fromJSON(json.beta).toRed(curve.red);\n const lambda = BN.fromJSON(json.lambda);\n\n const basis = [\n Vector.fromJSON(json.basis[0]),\n Vector.fromJSON(json.basis[1])\n ];\n\n const pre = [\n json.pre[0],\n BN.fromJSON(json.pre[1]),\n BN.fromJSON(json.pre[2])\n ];\n\n return new this(beta, lambda, basis, pre);\n }\n}\n\n/**\n * Vector\n */\n\nclass Vector {\n constructor(a, b) {\n this.a = a;\n this.b = b;\n }\n\n toJSON() {\n return {\n a: this.a.toJSON(),\n b: this.b.toJSON()\n };\n }\n\n static fromJSON(json) {\n assert(json && typeof json === 'object');\n\n const a = BN.fromJSON(json.a);\n const b = BN.fromJSON(json.b);\n\n return new this(a, b);\n }\n}\n\n/**\n * P192\n * https://tinyurl.com/fips-186-2 (page 29)\n * https://tinyurl.com/fips-186-3 (page 88)\n */\n\nclass P192 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P192',\n ossl: 'prime192v1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'p192',\n // 2^192 - 2^64 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff ffffffff'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff fffffffc'],\n b: ['64210519 e59c80e7 0fa7e9ab 72243049',\n 'feb8deec c146b9b1'],\n n: ['ffffffff ffffffff ffffffff 99def836',\n '146bc9b1 b4d22831'],\n h: '1',\n // Icart\n z: '-5',\n g: [\n ['188da80e b03090f6 7cbf20eb 43a18800',\n 'f4ff0afd 82ff1012'],\n ['07192b95 ffc8da78 631011ed 6b24cdd5',\n '73f977a1 1e794811'],\n pre\n ]\n });\n }\n}\n\n/**\n * P224\n * https://tinyurl.com/fips-186-2 (page 30)\n * https://tinyurl.com/fips-186-3 (page 88)\n */\n\nclass P224 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P224',\n ossl: 'secp224r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'p224',\n // 2^224 - 2^96 + 1 (1 mod 16)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n '00000000 00000000 00000001'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff ffffffff fffffffe'],\n b: ['b4050a85 0c04b3ab f5413256 5044b0b7',\n 'd7bfd8ba 270b3943 2355ffb4'],\n n: ['ffffffff ffffffff ffffffff ffff16a2',\n 'e0b8f03e 13dd2945 5c5c2a3d'],\n h: '1',\n // SSWU\n z: '1f',\n g: [\n ['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3',\n '56c21122 343280d6 115c1d21'],\n ['bd376388 b5f723fb 4c22dfe6 cd4375a0',\n '5a074764 44d58199 85007e34'],\n pre\n ]\n });\n }\n}\n\n/**\n * P256\n * https://tinyurl.com/fips-186-2 (page 31)\n * https://tinyurl.com/fips-186-3 (page 89)\n */\n\nclass P256 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P256',\n ossl: 'prime256v1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: null,\n // 2^256 - 2^224 + 2^192 + 2^96 - 1 (= 3 mod 4)\n p: ['ffffffff 00000001 00000000 00000000',\n '00000000 ffffffff ffffffff ffffffff'],\n // -3 mod p\n a: ['ffffffff 00000001 00000000 00000000',\n '00000000 ffffffff ffffffff fffffffc'],\n b: ['5ac635d8 aa3a93e7 b3ebbd55 769886bc',\n '651d06b0 cc53b0f6 3bce3c3e 27d2604b'],\n n: ['ffffffff 00000000 ffffffff ffffffff',\n 'bce6faad a7179e84 f3b9cac2 fc632551'],\n h: '1',\n // SSWU\n z: '-a',\n g: [\n ['6b17d1f2 e12c4247 f8bce6e5 63a440f2',\n '77037d81 2deb33a0 f4a13945 d898c296'],\n ['4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16',\n '2bce3357 6b315ece cbb64068 37bf51f5'],\n pre\n ]\n });\n }\n}\n\n/**\n * P384\n * https://tinyurl.com/fips-186-2 (page 32)\n * https://tinyurl.com/fips-186-3 (page 89)\n */\n\nclass P384 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P384',\n ossl: 'secp384r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA384',\n prime: null,\n // 2^384 - 2^128 - 2^96 + 2^32 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff 00000000 00000000 ffffffff'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff 00000000 00000000 fffffffc'],\n b: ['b3312fa7 e23ee7e4 988e056b e3f82d19',\n '181d9c6e fe814112 0314088f 5013875a',\n 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'],\n n: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff c7634d81 f4372ddf',\n '581a0db2 48b0a77a ecec196a ccc52973'],\n h: '1',\n // Icart\n z: '-c',\n g: [\n ['aa87ca22 be8b0537 8eb1c71e f320ad74',\n '6e1d3b62 8ba79b98 59f741e0 82542a38',\n '5502f25d bf55296c 3a545e38 72760ab7'],\n ['3617de4a 96262c6f 5d9e98bf 9292dc29',\n 'f8f41dbd 289a147c e9da3113 b5f0b8c0',\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'],\n pre\n ]\n });\n }\n}\n\n/**\n * P521\n * https://tinyurl.com/fips-186-2 (page 33)\n * https://tinyurl.com/fips-186-3 (page 90)\n */\n\nclass P521 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P521',\n ossl: 'secp521r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA512',\n prime: 'p521',\n // 2^521 - 1 (= 3 mod 4)\n p: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff'],\n // -3 mod p\n a: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'fffffffc'],\n b: ['00000051 953eb961 8e1c9a1f 929a21a0',\n 'b68540ee a2da725b 99b315f3 b8b48991',\n '8ef109e1 56193951 ec7e937b 1652c0bd',\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4',\n '6b503f00'],\n n: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'fffffffa 51868783 bf2f966b 7fcc0148',\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e',\n '91386409'],\n h: '1',\n // SSWU\n z: '-4',\n g: [\n ['000000c6 858e06b7 0404e9cd 9e3ecb66',\n '2395b442 9c648139 053fb521 f828af60',\n '6b4d3dba a14b5e77 efe75928 fe1dc127',\n 'a2ffa8de 3348b3c1 856a429b f97e7e31',\n 'c2e5bd66'],\n ['00000118 39296a78 9a3bc004 5c8a5fb4',\n '2c7d1bd9 98f54449 579b4468 17afbd17',\n '273e662c 97ee7299 5ef42640 c550b901',\n '3fad0761 353c7086 a272c240 88be9476',\n '9fd16650'],\n pre\n ]\n });\n }\n}\n\n/**\n * SECP256K1\n * https://www.secg.org/SEC2-Ver-1.0.pdf (page 15, section 2.7.1)\n * https://www.secg.org/sec2-v2.pdf (page 9, section 2.4.1)\n */\n\nclass SECP256K1 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'SECP256K1',\n ossl: 'secp256k1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'k256',\n // 2^256 - 2^32 - 977 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe fffffc2f'],\n a: '0',\n b: '7',\n n: ['ffffffff ffffffff ffffffff fffffffe',\n 'baaedce6 af48a03b bfd25e8c d0364141'],\n h: '1',\n // SVDW\n z: '1',\n // sqrt(-3)\n c: ['0a2d2ba9 3507f1df 233770c2 a797962c',\n 'c61f6d15 da14ecd4 7d8d27ae 1cd5f852'],\n g: [\n ['79be667e f9dcbbac 55a06295 ce870b07',\n '029bfcdb 2dce28d9 59f2815b 16f81798'],\n ['483ada77 26a3c465 5da4fbfc 0e1108a8',\n 'fd17b448 a6855419 9c47d08f fb10d4b8'],\n pre\n ],\n // Precomputed endomorphism.\n endo: {\n beta: ['7ae96a2b 657c0710 6e64479e ac3434e9',\n '9cf04975 12f58995 c1396c28 719501ee'],\n lambda: ['5363ad4c c05c30e0 a5261c02 8812645a',\n '122e22ea 20816678 df02967c 1b23bd72'],\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3'\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15'\n }\n ],\n pre: [\n 384,\n ['3086d221 a7d46bcd e86c90e4 9284eb15',\n '3daa8a14 71e8ca7f e893209a 45dbb031'],\n ['-',\n 'e4437ed6 010e8828 6f547fa9 0abfe4c4',\n '221208ac 9df506c6 1571b4ae 8ac47f71']\n ]\n }\n });\n }\n}\n\n/**\n * BRAINPOOLP256\n * https://tools.ietf.org/html/rfc5639#section-3.4\n */\n\nclass BRAINPOOLP256 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP256',\n ossl: 'brainpoolP256r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: null,\n // (= 3 mod 4)\n p: ['a9fb57db a1eea9bc 3e660a90 9d838d72',\n '6e3bf623 d5262028 2013481d 1f6e5377'],\n a: ['7d5a0975 fc2c3057 eef67530 417affe7',\n 'fb8055c1 26dc5c6c e94a4b44 f330b5d9'],\n b: ['26dc5c6c e94a4b44 f330b5d9 bbd77cbf',\n '95841629 5cf7e1ce 6bccdc18 ff8c07b6'],\n n: ['a9fb57db a1eea9bc 3e660a90 9d838d71',\n '8c397aa3 b561a6f7 901e0e82 974856a7'],\n h: '1',\n // Icart\n z: '-2',\n g: [\n ['8bd2aeb9 cb7e57cb 2c4b482f fc81b7af',\n 'b9de27e1 e3bd23c2 3a4453bd 9ace3262'],\n ['547ef835 c3dac4fd 97f8461a 14611dc9',\n 'c2774513 2ded8e54 5c1d54c7 2f046997'],\n pre\n ]\n });\n }\n}\n\n/**\n * BRAINPOOLP384\n * https://tools.ietf.org/html/rfc5639#section-3.6\n */\n\nclass BRAINPOOLP384 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP384',\n ossl: 'brainpoolP384r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA384',\n prime: null,\n // (= 3 mod 4)\n p: ['8cb91e82 a3386d28 0f5d6f7e 50e641df',\n '152f7109 ed5456b4 12b1da19 7fb71123',\n 'acd3a729 901d1a71 87470013 3107ec53'],\n a: ['7bc382c6 3d8c150c 3c72080a ce05afa0',\n 'c2bea28e 4fb22787 139165ef ba91f90f',\n '8aa5814a 503ad4eb 04a8c7dd 22ce2826'],\n b: ['04a8c7dd 22ce2826 8b39b554 16f0447c',\n '2fb77de1 07dcd2a6 2e880ea5 3eeb62d5',\n '7cb43902 95dbc994 3ab78696 fa504c11'],\n n: ['8cb91e82 a3386d28 0f5d6f7e 50e641df',\n '152f7109 ed5456b3 1f166e6c ac0425a7',\n 'cf3ab6af 6b7fc310 3b883202 e9046565'],\n h: '1',\n // SSWU\n z: '-5',\n g: [\n ['1d1c64f0 68cf45ff a2a63a81 b7c13f6b',\n '8847a3e7 7ef14fe3 db7fcafe 0cbd10e8',\n 'e826e034 36d646aa ef87b2e2 47d4af1e'],\n ['8abe1d75 20f9c2a4 5cb1eb8e 95cfd552',\n '62b70b29 feec5864 e19c054f f9912928',\n '0e464621 77918111 42820341 263c5315'],\n pre\n ]\n });\n }\n}\n\n/**\n * BRAINPOOLP512\n * https://tools.ietf.org/html/rfc5639#section-3.7\n */\n\nclass BRAINPOOLP512 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP512',\n ossl: 'brainpoolP512r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA512',\n prime: null,\n // (= 3 mod 4)\n p: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07',\n 'cb308db3 b3c9d20e d6639cca 70330871',\n '7d4d9b00 9bc66842 aecda12a e6a380e6',\n '2881ff2f 2d82c685 28aa6056 583a48f3'],\n a: ['7830a331 8b603b89 e2327145 ac234cc5',\n '94cbdd8d 3df91610 a83441ca ea9863bc',\n '2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5',\n '7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca'],\n b: ['3df91610 a83441ca ea9863bc 2ded5d5a',\n 'a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7',\n '2bf2c7b9 e7c1ac4d 77fc94ca dc083e67',\n '984050b7 5ebae5dd 2809bd63 8016f723'],\n n: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07',\n 'cb308db3 b3c9d20e d6639cca 70330870',\n '553e5c41 4ca92619 41866119 7fac1047',\n '1db1d381 085ddadd b5879682 9ca90069'],\n h: '1',\n // Icart\n z: '7',\n g: [\n ['81aee4bd d82ed964 5a21322e 9c4c6a93',\n '85ed9f70 b5d916c1 b43b62ee f4d0098e',\n 'ff3b1f78 e2d0d48d 50d1687b 93b97d5f',\n '7c6d5047 406a5e68 8b352209 bcb9f822'],\n ['7dde385d 566332ec c0eabfa9 cf7822fd',\n 'f209f700 24a57b1a a000c55b 881f8111',\n 'b2dcde49 4a5f485e 5bca4bd8 8a2763ae',\n 'd1ca2b2f a8f05406 78cd1e0f 3ad80892'],\n pre\n ]\n });\n }\n}\n\n/**\n * X25519\n * https://tools.ietf.org/html/rfc7748#section-4.1\n */\n\nclass X25519 extends MontCurve {\n constructor() {\n super({\n id: 'X25519',\n ossl: 'X25519',\n type: 'mont',\n endian: 'le',\n hash: 'SHA512',\n prime: 'p25519',\n // 2^255 - 19 (= 5 mod 8)\n p: ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffed'],\n // 486662\n a: '76d06',\n b: '1',\n n: ['10000000 00000000 00000000 00000000',\n '14def9de a2f79cd6 5812631a 5cf5d3ed'],\n h: '8',\n // Elligator 2\n z: '2',\n g: [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000009'],\n // See: https://www.rfc-editor.org/errata/eid4730\n ['5f51e65e 475f794b 1fe122d3 88b72eb3',\n '6dc2b281 92839e4d d6163a5d 81312c14']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001'],\n ['6be4f497 f9a9c2af c21fa77a d7f4a6ef',\n '635a11c7 284a9363 e9a248ef 9c884415']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001'],\n ['141b0b68 06563d50 3de05885 280b5910',\n '9ca5ee38 d7b56c9c 165db710 6377bbd8']\n ],\n [\n ['57119fd0 dd4e22d8 868e1c58 c45c4404',\n '5bef839c 55b1d0b1 248c50a3 bc959c5f'],\n ['68c59389 3d458e64 31c6ca00 45fb5015',\n '20a44346 8eaa68dd 0f103842 048065b7']\n ],\n [\n ['57119fd0 dd4e22d8 868e1c58 c45c4404',\n '5bef839c 55b1d0b1 248c50a3 bc959c5f'],\n ['173a6c76 c2ba719b ce3935ff ba04afea',\n 'df5bbcb9 71559722 f0efc7bd fb7f9a36']\n ],\n [\n ['00b8495f 16056286 fdb1329c eb8d09da',\n '6ac49ff1 fae35616 aeb8413b 7c7aebe0'],\n ['3931c129 569e83a5 29482c14 e628b457',\n '933bfc29 ed801b4d 68871483 92507b1a']\n ],\n [\n ['00b8495f 16056286 fdb1329c eb8d09da',\n '6ac49ff1 fae35616 aeb8413b 7c7aebe0'],\n ['46ce3ed6 a9617c5a d6b7d3eb 19d74ba8',\n '6cc403d6 127fe4b2 9778eb7c 6daf84d3']\n ]\n ]\n });\n }\n}\n\n/**\n * X448\n * https://tools.ietf.org/html/rfc7748#section-4.2\n */\n\nclass X448 extends MontCurve {\n constructor() {\n super({\n id: 'X448',\n ossl: 'X448',\n type: 'mont',\n endian: 'le',\n hash: 'SHAKE256',\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n // 156326\n a: '262a6',\n b: '1',\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000005'],\n ['7d235d12 95f5b1f6 6c98ab6e 58326fce',\n 'cbae5d34 f55545d0 60f75dc2 8df3f6ed',\n 'b8027e23 46430d21 1312c4b1 50677af7',\n '6fd7223d 457b5b1a']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['ba4d3a08 29b6112f 8812e51b a0bb2abe',\n 'bc1cb08e b48e5569 36ba50fd d2e7d68a',\n 'f8cb3216 0522425b 3f990812 abbe635a',\n 'd37a21e1 7551b193']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['45b2c5f7 d649eed0 77ed1ae4 5f44d541',\n '43e34f71 4b71aa96 c945af01 2d182975',\n '0734cde9 faddbda4 c066f7ed 54419ca5',\n '2c85de1e 8aae4e6c']\n ]\n ]\n });\n }\n}\n\n/**\n * MONT448\n * Isomorphic to Ed448-Goldilocks.\n */\n\nclass MONT448 extends MontCurve {\n constructor() {\n super({\n id: 'MONT448',\n ossl: null,\n type: 'mont',\n endian: 'le',\n hash: 'SHAKE256',\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n // -78160 / -39082 mod p\n a: ['b2cf97d2 d43459a9 31ed36b1 fc4e3cb5',\n '5d93f8d2 22746997 60ccffc6 49961ed6',\n 'c5b05fca c24864ed 6fb59697 931b78da',\n '84ddecd8 ca2b5cfb'],\n b: '1',\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['ac0d24cc c6c75cb0 eb71f81e 7a6edf51',\n '48e88aee 009a2a24 e795687e c28e125a',\n '3e6730a6 0d46367b aa7fe99d 152128dc',\n '41321bc7 7817f059'],\n ['5a4437f6 80c0d0db 9b061276 d5d0ffcc',\n 'e786ff33 b6a53d30 98746425 82e66f09',\n '4433dae7 7244a6e2 6b11e905 7228f483',\n '556c41a5 913f55fe']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['bec92fd0 6da2acf2 b4e261e8 7cef0d34',\n '22e75c18 3c589857 b71924e5 73c2f9ce',\n 'e18da5f2 466e2f39 3c2eedf0 f105a60a',\n 'b40c717d 4f1e1fd7']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['4136d02f 925d530d 4b1d9e17 8310f2cb',\n 'dd18a3e7 c3a767a8 48e6db19 8c3d0631',\n '1e725a0d b991d0c6 c3d1120f 0efa59f5',\n '4bf38e82 b0e1e028']\n ]\n ]\n });\n }\n}\n\n/**\n * ED25519\n * https://tools.ietf.org/html/rfc8032#section-5.1\n */\n\nclass ED25519 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ED25519',\n ossl: 'ED25519',\n type: 'edwards',\n endian: 'le',\n hash: 'SHA512',\n prefix: 'SigEd25519 no Ed25519 collisions',\n context: false,\n prime: 'p25519',\n // 2^255 - 19 (= 5 mod 8)\n p: ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffed'],\n a: '-1',\n // -121665 / 121666 mod p\n d: ['52036cee 2b6ffe73 8cc74079 7779e898',\n '00700a4d 4141d8ab 75eb4dca 135978a3'],\n n: ['10000000 00000000 00000000 00000000',\n '14def9de a2f79cd6 5812631a 5cf5d3ed'],\n h: '8',\n // Elligator 2\n z: '2',\n g: [\n ['216936d3 cd6e53fe c0a4e231 fdd6dc5c',\n '692cc760 9525a7b2 c9562d60 8f25d51a'],\n // 4/5\n ['66666666 66666666 66666666 66666666',\n '66666666 66666666 66666666 66666658'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffec']\n ],\n [\n ['2b832480 4fc1df0b 2b4d0099 3dfbd7a7',\n '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['547cdb7f b03e20f4 d4b2ff66 c2042858',\n 'd0bce7f9 52d01b87 3b11e4d8 b5f15f3d'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['1fd5b9a0 06394a28 e9339932 38de4abb',\n '5c193c70 13e5e238 dea14646 c545d14a'],\n ['05fc536d 880238b1 3933c6d3 05acdfd5',\n 'f098eff2 89f4c345 b027b2c2 8f95e826']\n ],\n [\n ['602a465f f9c6b5d7 16cc66cd c721b544',\n 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'],\n ['05fc536d 880238b1 3933c6d3 05acdfd5',\n 'f098eff2 89f4c345 b027b2c2 8f95e826']\n ],\n [\n ['1fd5b9a0 06394a28 e9339932 38de4abb',\n '5c193c70 13e5e238 dea14646 c545d14a'],\n ['7a03ac92 77fdc74e c6cc392c fa53202a',\n '0f67100d 760b3cba 4fd84d3d 706a17c7']\n ],\n [\n ['602a465f f9c6b5d7 16cc66cd c721b544',\n 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'],\n ['7a03ac92 77fdc74e c6cc392c fa53202a',\n '0f67100d 760b3cba 4fd84d3d 706a17c7']\n ]\n ]\n });\n }\n}\n\n/**\n * ISO448\n * https://tools.ietf.org/html/rfc7748#section-4.2\n * https://git.zx2c4.com/goldilocks/tree/_aux/ristretto/ristretto.sage#n658\n */\n\nclass ISO448 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ISO448',\n ossl: null,\n type: 'edwards',\n endian: 'le',\n hash: 'SHAKE256',\n prefix: 'SigEd448',\n context: true,\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n a: '1',\n // 39082 / 39081 mod p\n d: ['d78b4bdc 7f0daf19 f24f38c2 9373a2cc',\n 'ad461572 42a50f37 809b1da3 412a12e7',\n '9ccc9c81 264cfe9a d0809970 58fb61c4',\n '243cc32d baa156b9'],\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['79a70b2b 70400553 ae7c9df4 16c792c6',\n '1128751a c9296924 0c25a07d 728bdc93',\n 'e21f7787 ed697224 9de732f3 8496cd11',\n '69871309 3e9c04fc'],\n // Note: the RFC has this wrong.\n ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 80000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ]\n ]\n });\n }\n}\n\n/**\n * ED448\n * https://tools.ietf.org/html/rfc8032#section-5.2\n */\n\nclass ED448 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ED448',\n ossl: 'ED448',\n type: 'edwards',\n endian: 'le',\n hash: 'SHAKE256',\n prefix: 'SigEd448',\n context: true,\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n a: '1',\n // -39081 mod p\n d: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffff6756'],\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['4f1970c6 6bed0ded 221d15a6 22bf36da',\n '9e146570 470f1767 ea6de324 a3d3a464',\n '12ae1af7 2ab66511 433b80e1 8b00938e',\n '2626a82b c70cc05e'],\n ['693f4671 6eb6bc24 88762037 56c9c762',\n '4bea7373 6ca39840 87789c1e 05a0c2d7',\n '3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad',\n '9808795b f230fa14'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ]\n ]\n });\n }\n}\n\n/*\n * Curve Registry\n */\n\nconst curves = {\n __proto__: null,\n P192,\n P224,\n P256,\n P384,\n P521,\n SECP256K1,\n BRAINPOOLP256,\n BRAINPOOLP384,\n BRAINPOOLP512,\n X25519,\n X448,\n MONT448,\n ED25519,\n ISO448,\n ED448\n};\n\nconst cache = {\n __proto__: null,\n P192: null,\n P224: null,\n P256: null,\n P384: null,\n P521: null,\n SECP256K1: null,\n BRAINPOOLP256: null,\n BRAINPOOLP384: null,\n BRAINPOOLP512: null,\n X25519: null,\n X448: null,\n MONT448: null,\n ED25519: null,\n ISO448: null,\n ED448: null\n};\n\nfunction curve(name, ...args) {\n assert(typeof name === 'string');\n\n const key = name.toUpperCase();\n\n let curve = cache[key];\n\n if (!curve) {\n const Curve = curves[key];\n\n if (!Curve)\n throw new Error(`Curve not found: \"${name}\".`);\n\n curve = new Curve(...args);\n cache[key] = curve;\n }\n\n return curve;\n}\n\nfunction register(name, Curve) {\n assert(typeof name === 'string');\n assert(typeof Curve === 'function');\n\n const key = name.toUpperCase();\n\n if (curves[key])\n throw new Error(`Curve already registered: \"${name}\".`);\n\n curves[key] = Curve;\n cache[key] = null;\n}\n\n/*\n * Scalar Recoding\n */\n\nfunction getNAF(k, width, max) {\n // Computing the width-w NAF of a positive integer.\n //\n // [GECC] Algorithm 3.35, Page 100, Section 3.3.\n //\n // The above document describes a rather abstract\n // method of recoding. The more optimal method\n // below was ported from libsecp256k1.\n assert(k instanceof BN);\n assert(!k.red);\n assert((width >>> 0) === width);\n assert((max >>> 0) === max);\n\n const naf = new Array(max);\n const bits = k.bitLength() + 1;\n const sign = k.sign() | 1;\n\n assert(bits <= max);\n\n for (let i = 0; i < max; i++)\n naf[i] = 0;\n\n let i = 0;\n let carry = 0;\n let word;\n\n while (i < bits) {\n if (k.bit(i) === carry) {\n i += 1;\n continue;\n }\n\n word = k.bits(i, width) + carry;\n carry = (word >> (width - 1)) & 1;\n word -= carry << width;\n\n naf[i] = sign * word;\n\n i += width;\n }\n\n assert(carry === 0);\n\n return naf;\n}\n\nfunction getFixedNAF(k, width, max, step) {\n assert((step >>> 0) === step);\n\n // Recode to NAF.\n const naf = getNAF(k, width, max);\n\n // Translate into more windowed form.\n const len = Math.ceil(naf.length / step);\n const repr = new Array(len);\n\n let i = 0;\n\n for (let j = 0; j < naf.length; j += step) {\n let nafW = 0;\n\n for (let k = j + step - 1; k >= j; k--)\n nafW = (nafW << 1) + naf[k];\n\n repr[i++] = nafW;\n }\n\n assert(i === len);\n\n return repr;\n}\n\nfunction getJSF(k1, k2, max) {\n // Joint sparse form.\n //\n // [GECC] Algorithm 3.50, Page 111, Section 3.3.\n assert(k1 instanceof BN);\n assert(k2 instanceof BN);\n assert(!k1.red);\n assert(!k2.red);\n assert((max >>> 0) === max);\n\n const jsf = [new Array(max), new Array(max)];\n const bits = Math.max(k1.bitLength(), k2.bitLength()) + 1;\n const s1 = k1.sign() | 1;\n const s2 = k2.sign() | 1;\n\n assert(bits <= max);\n\n let d1 = 0;\n let d2 = 0;\n\n for (let i = 0; i < bits; i++) {\n const b1 = k1.bits(i, 3);\n const b2 = k2.bits(i, 3);\n\n // First phase.\n let m14 = ((b1 & 3) + d1) & 3;\n let m24 = ((b2 & 3) + d2) & 3;\n let u1 = 0;\n let u2 = 0;\n\n if (m14 === 3)\n m14 = -1;\n\n if (m24 === 3)\n m24 = -1;\n\n if (m14 & 1) {\n const m8 = ((b1 & 7) + d1) & 7;\n\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n\n if (m24 & 1) {\n const m8 = ((b2 & 7) + d2) & 7;\n\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n\n jsf[0][i] = u1 * s1;\n jsf[1][i] = u2 * s2;\n\n // Second phase.\n if (2 * d1 === 1 + u1)\n d1 = 1 - d1;\n\n if (2 * d2 === 1 + u2)\n d2 = 1 - d2;\n }\n\n for (let i = bits; i < max; i++) {\n jsf[0][i] = 0;\n jsf[1][i] = 0;\n }\n\n return jsf;\n}\n\nfunction getJNAF(c1, c2, max) {\n const jsf = getJSF(c1, c2, max);\n const naf = new Array(max);\n\n // JSF -> NAF conversion.\n for (let i = 0; i < max; i++) {\n const ja = jsf[0][i];\n const jb = jsf[1][i];\n\n naf[i] = jsfIndex[(ja + 1) * 3 + (jb + 1)];\n }\n\n return naf;\n}\n\n/*\n * Helpers\n */\n\nfunction assert(val, msg) {\n if (!val) {\n const err = new Error(msg || 'Assertion failed');\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, assert);\n\n throw err;\n }\n}\n\nfunction wrapErrors(fn) {\n assert(typeof fn === 'function');\n\n try {\n return fn();\n } catch (e) {\n if (e.message === 'X is not a square mod P.'\n || e.message === 'Not invertible.') {\n throw new Error('Invalid point.');\n }\n throw e;\n }\n}\n\nfunction mod(x, y) {\n // Euclidean modulo.\n let r = x % y;\n\n if (r < 0) {\n if (y < 0)\n r -= y;\n else\n r += y;\n }\n\n return r;\n}\n\nfunction cubeRoot(x) {\n assert(x instanceof BN);\n assert(x.red);\n\n const p = x.red.m;\n\n if (p.cmpn(3) <= 0)\n return x.clone();\n\n // p = 2 mod 3\n if (p.modrn(3) === 2) {\n // e = (2 * p - 1) / 3\n const e = p.ushln(1).isubn(1).idivn(3);\n return x.redPow(e);\n }\n\n const mod9 = p.modrn(9);\n\n // p = 4 mod 9\n if (mod9 === 4) {\n // e = (2 * p + 1) / 9\n const e = p.ushln(1).iaddn(1).idivn(9);\n const r = x.redPow(e);\n const c = r.redSqr().redMul(r);\n\n if (!c.eq(x))\n throw new Error('X is not a cube mod P.');\n\n return r;\n }\n\n // p = 7 mod 9\n if (mod9 === 7) {\n // e = (p + 2) / 9\n const e = p.addn(2).idivn(9);\n const r = x.redPow(e);\n const c = r.redSqr().redMul(r);\n\n if (!c.eq(x))\n throw new Error('X is not a cube mod P.');\n\n return r;\n }\n\n throw new Error('Not implemented.');\n}\n\nfunction cubeRoots(x) {\n const r0 = cubeRoot(x);\n\n // p = 1 mod 3\n if (x.red.m.modrn(3) === 1) {\n // Multiply by roots of unity to find other roots.\n const two = new BN(2).toRed(x.red);\n const three = new BN(3).toRed(x.red);\n const i2 = two.redInvert();\n const s1 = three.redNeg().redSqrt().redMul(i2);\n const s2 = s1.redNeg();\n const u1 = s1.redSub(i2);\n const u2 = s2.redSub(i2);\n const r1 = r0.redMul(u1);\n const r2 = r0.redMul(u2);\n\n return [r0, r1, r2];\n }\n\n // p = 2 mod 3 guarantees 1 cube root per element.\n return [r0];\n}\n\nfunction uncube(x) {\n // Find a cube root which is also a quadratic residue.\n for (const root of cubeRoots(x)) {\n if (root.redJacobi() >= 0)\n return root;\n }\n\n throw new Error('X^(1/3) is not a square mod P.');\n}\n\nfunction randomInt(rng) {\n return BN.randomBits(rng, 32).toNumber();\n}\n\nfunction memoize(method, self) {\n const cache = new WeakMap();\n\n return function memoized(curve, invert) {\n const i = invert & 1;\n const item = cache.get(curve);\n\n if (item && item[i] !== null)\n return item[i];\n\n const result = method.call(self, curve, invert);\n\n if (!cache.has(curve))\n cache.set(curve, [null, null]);\n\n cache.get(curve)[i] = result;\n\n return result;\n };\n}\n\nfunction toPretty(x, size) {\n assert(x instanceof BN);\n assert((size >>> 0) === size);\n\n if (size & 7)\n size += 8 - (size & 7);\n\n const str = x.toString(16, size);\n const chunks = [];\n const out = [];\n\n assert((str.length & 7) === 0);\n\n for (let i = 0; i < str.length; i += 8)\n chunks.push(str.slice(i, i + 8));\n\n for (let i = 0; i < chunks.length; i += 4)\n out.push(chunks.slice(i, i + 4).join(' '));\n\n return out;\n}\n\n/*\n * Expose\n */\n\nexports.Curve = Curve;\nexports.Point = Point;\nexports.ShortCurve = ShortCurve;\nexports.ShortPoint = ShortPoint;\nexports.JPoint = JPoint;\nexports.MontCurve = MontCurve;\nexports.MontPoint = MontPoint;\nexports.XPoint = XPoint;\nexports.EdwardsCurve = EdwardsCurve;\nexports.EdwardsPoint = EdwardsPoint;\nexports.curves = curves;\nexports.curve = curve;\nexports.register = register;\n","/*!\n * random.js - random number generator for bcrypto\n * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://wiki.openssl.org/index.php/Random_Numbers\n * https://csrc.nist.gov/projects/random-bit-generation/\n * http://www.pcg-random.org/posts/bounded-rands.html\n * https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/*\n * Constants\n */\n\nconst crypto = global.crypto || global.msCrypto;\nconst HAS_CRYPTO = crypto && typeof crypto.getRandomValues === 'function';\nconst randomValues = HAS_CRYPTO ? crypto.getRandomValues.bind(crypto) : null;\nconst pool = new Uint32Array(16);\nconst MAX_BYTES = 65536;\n\nlet poolPos = 0;\n\n/**\n * Generate pseudo-random bytes.\n * @param {Number} size\n * @returns {Buffer}\n */\n\nfunction randomBytes(size) {\n assert((size >>> 0) === size);\n\n const data = Buffer.alloc(size);\n\n randomFillSync(data, 0, size);\n\n return data;\n}\n\n/**\n * Generate pseudo-random bytes.\n * @param {Buffer} data\n * @param {Number} [off=0]\n * @param {Number} [size=data.length-off]\n * @returns {Buffer}\n */\n\nfunction randomFill(data, off, size) {\n assert(Buffer.isBuffer(data));\n\n if (off == null)\n off = 0;\n\n assert((off >>> 0) === off);\n\n if (size == null)\n size = data.length - off;\n\n assert((size >>> 0) === size);\n assert(off + size <= data.length);\n\n randomFillSync(data, off, size);\n\n return data;\n}\n\n/**\n * Generate a random uint32.\n * @returns {Number}\n */\n\nfunction randomInt() {\n if ((poolPos & 15) === 0) {\n getRandomValues(pool);\n poolPos = 0;\n }\n\n return pool[poolPos++];\n}\n\n/**\n * Generate a random uint32 within a range.\n * @param {Number} min - Inclusive.\n * @param {Number} max - Exclusive.\n * @returns {Number}\n */\n\nfunction randomRange(min, max) {\n assert((min >>> 0) === min);\n assert((max >>> 0) === max);\n assert(max >= min);\n\n const space = max - min;\n\n if (space === 0)\n return min;\n\n const top = -space >>> 0;\n\n let x, r;\n\n do {\n x = randomInt();\n r = x % space;\n } while (x - r > top);\n\n return r + min;\n}\n\n/*\n * Helpers\n */\n\nfunction getRandomValues(array) {\n if (!HAS_CRYPTO)\n throw new Error('Entropy source not available.');\n\n return randomValues(array);\n}\n\nfunction randomFillSync(data, off, size) {\n assert(Buffer.isBuffer(data));\n assert(data.buffer instanceof ArrayBuffer);\n assert((data.byteOffset >>> 0) === data.byteOffset);\n assert((data.byteLength >>> 0) === data.byteLength);\n assert((off >>> 0) === off);\n assert((size >>> 0) === size);\n assert(off + size <= data.byteLength);\n\n if (size > 2 ** 31 - 1)\n throw new RangeError('The value \"size\" is out of range.');\n\n const offset = data.byteOffset + off;\n const array = new Uint8Array(data.buffer, offset, size);\n\n if (array.length > MAX_BYTES) {\n for (let i = 0; i < array.length; i += MAX_BYTES) {\n let j = i + MAX_BYTES;\n\n if (j > array.length)\n j = array.length;\n\n getRandomValues(array.subarray(i, j));\n }\n } else {\n if (array.length > 0)\n getRandomValues(array);\n }\n}\n\n/*\n * Expose\n */\n\nexports.native = 0;\nexports.randomBytes = randomBytes;\nexports.randomFill = randomFill;\nexports.randomInt = randomInt;\nexports.randomRange = randomRange;\n","/*!\n * random.js - random for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/random');\n","/*!\n * eddsa.js - EdDSA for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/elliptic:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/elliptic\n *\n * References:\n *\n * [EDDSA] High-speed high-security signatures\n * D. J. Bernstein, N. Duif, T. Lange, P. Schwabe, B. Yang\n * https://ed25519.cr.yp.to/ed25519-20110926.pdf\n *\n * [RFC8032] Edwards-Curve Digital Signature Algorithm (EdDSA)\n * S. Josefsson, I. Liusvaara\n * https://tools.ietf.org/html/rfc8032\n *\n * Implementation Notes:\n *\n * - In contrast to the ECDSA backend, we allow points at\n * infinity (in all functions).\n *\n * - Mike Hamburg's Ed448-Goldilocks rejects both infinity as\n * well as the torsion point (0, -1). We do not replicate\n * this behavior.\n *\n * - For Ed25519, we do \"cofactor-less\" verification by default.\n * This means torsion components will affect the result of the\n * verification.\n *\n * - For Ed448, we do cofactor verification by default to mimic\n * OpenSSL and Mike Hamburg's Ed448-Goldilocks implementation.\n *\n * - `verifySingle`/`verifyBatch` do cofactor verification. Do\n * not use `verifyBatch` expecting the same results as the\n * regular `verify` call[1]. This will not be the case for\n * Ed25519.\n *\n * - All functions are completely unaware of points of small\n * order and torsion components (in other words, points will\n * not be explicitly checked for this, anywhere).\n *\n * - `deriveWithScalar` and `exchangeWithScalar` automatically\n * clamp scalars before multiplying (meaning torsion components\n * are removed from the result and points of small order will\n * be normalized to infinity).\n *\n * - The HD function, `publicKeyTweakMul`, _does not_ clamp\n * automatically. It is possible to end up with a torsion\n * component in the resulting point (assuming the input\n * point had one).\n *\n * - Ed448-Goldilocks is 4-isogenous to Curve448. This means\n * that when converting to Curve448, small order points will\n * be normalized to (0, 0). When converting back to Ed448,\n * any small order points will be normalized to infinity,\n * and any torsion components will be removed completely.\n * Also note that when converting back, the implementation\n * needs to divide the point by 4. This is a major perf hit,\n * so treat `x448.publicKeyConvert` as if it were a point\n * multiplication.\n *\n * - Elligators should not be used with Edwards curves. As\n * Tibouchi notes[2], regular public keys will map to\n * _distinguishable_ field elements as they are always in\n * the primary subgroup. Either the Ristretto Elligator[3],\n * or a prime order curve with an Elligator Squared[2]\n * construction are suitable alternatives here.\n *\n * - These notes also spell out why you should avoid using\n * Edwards curves on a blockchain[4].\n *\n * [1] https://moderncrypto.org/mail-archive/curves/2016/000836.html\n * [2] https://eprint.iacr.org/2014/043.pdf\n * [3] https://ristretto.group/formulas/elligator.html\n * [4] https://src.getmonero.org/2017/05/17/disclosure-of-a-major-bug-in-cryptonote-based-currencies.html\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst BatchRNG = require('./batch-rng');\nconst BN = require('../bn');\nconst elliptic = require('./elliptic');\nconst rng = require('../random');\n\n/*\n * EDDSA\n */\n\nclass EDDSA {\n constructor(id, mid, eid, hash, pre) {\n assert(typeof id === 'string');\n assert(!mid || typeof mid === 'string');\n assert(!eid || typeof eid === 'string');\n assert(hash);\n\n this.id = id;\n this.type = 'eddsa';\n this.mid = mid || null;\n this.eid = eid || null;\n this.hash = hash;\n this.native = 0;\n\n this._pre = pre || null;\n this._curve = null;\n this._mont = null;\n this._iso = null;\n this._rng = null;\n }\n\n get curve() {\n if (!this._curve) {\n this._curve = elliptic.curve(this.id, this._pre);\n this._curve.precompute(rng);\n this._pre = null;\n }\n return this._curve;\n }\n\n get mont() {\n if (this.mid && !this._mont)\n this._mont = elliptic.curve(this.mid);\n return this._mont;\n }\n\n get iso() {\n if (!this.eid)\n return this.mont;\n\n if (!this._iso)\n this._iso = elliptic.curve(this.eid);\n\n return this._iso;\n }\n\n get rng() {\n if (!this._rng)\n this._rng = new BatchRNG(this.curve);\n\n return this._rng;\n }\n\n get size() {\n return this.curve.adjustedSize;\n }\n\n get bits() {\n return this.curve.fieldBits;\n }\n\n hashNonce(prefix, msg, ph, ctx) {\n const hash = new Hash(this);\n\n hash.init(ph, ctx);\n hash.update(prefix);\n hash.update(msg);\n\n return hash.final();\n }\n\n hashChallenge(R, A, m, ph, ctx) {\n const hash = new Hash(this);\n\n hash.init(ph, ctx);\n hash.update(R);\n hash.update(A);\n hash.update(m);\n\n return hash.final();\n }\n\n privateKeyGenerate() {\n return rng.randomBytes(this.curve.adjustedSize);\n }\n\n scalarGenerate() {\n const scalar = rng.randomBytes(this.curve.scalarSize);\n return this.curve.clamp(scalar);\n }\n\n privateKeyExpand(secret) {\n assert(Buffer.isBuffer(secret));\n assert(secret.length === this.curve.adjustedSize);\n\n const hash = this.hash.digest(secret, this.curve.adjustedSize * 2);\n\n return this.curve.splitHash(hash);\n }\n\n privateKeyConvert(secret) {\n const [key] = this.privateKeyExpand(secret);\n return key;\n }\n\n privateKeyVerify(secret) {\n assert(Buffer.isBuffer(secret));\n return secret.length === this.curve.adjustedSize;\n }\n\n scalarVerify(scalar) {\n assert(Buffer.isBuffer(scalar));\n return scalar.length === this.curve.scalarSize;\n }\n\n scalarIsZero(scalar) {\n assert(Buffer.isBuffer(scalar));\n\n let k;\n try {\n k = this.curve.decodeScalar(scalar).imod(this.curve.n);\n } catch (e) {\n return false;\n }\n\n return k.isZero();\n }\n\n scalarClamp(scalar) {\n assert(Buffer.isBuffer(scalar));\n assert(scalar.length === this.curve.scalarSize);\n\n return this.curve.clamp(Buffer.from(scalar));\n }\n\n privateKeyExport(secret) {\n const pub = this.publicKeyCreate(secret);\n const {x, y} = this.publicKeyExport(pub);\n\n return {\n d: Buffer.from(secret),\n x,\n y\n };\n }\n\n privateKeyImport(json) {\n assert(json && typeof json === 'object');\n assert(Buffer.isBuffer(json.d));\n\n if (json.d.length !== this.curve.adjustedSize)\n throw new Error('Invalid private key.');\n\n return Buffer.from(json.d);\n }\n\n scalarTweakAdd(scalar, tweak) {\n const a = this.curve.decodeScalar(scalar);\n const t = this.curve.decodeScalar(tweak);\n const k = a.add(t).imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarTweakMul(scalar, tweak) {\n const a = this.curve.decodeScalar(scalar);\n const t = this.curve.decodeScalar(tweak);\n const k = a.mul(t).imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarReduce(scalar) {\n const a = this.curve.decodeScalar(scalar);\n const k = a.imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarNegate(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n const k = a.neg().imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarInvert(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n\n if (a.isZero())\n return this.curve.encodeScalar(a);\n\n const k = a.invert(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n publicKeyCreate(secret) {\n const key = this.privateKeyConvert(secret);\n return this.publicKeyFromScalar(key);\n }\n\n publicKeyFromScalar(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n const A = this.curve.g.mulBlind(a);\n\n return A.encode();\n }\n\n publicKeyConvert(key) {\n if (!this.mont)\n throw new Error('No equivalent montgomery curve.');\n\n const A = this.curve.decodePoint(key);\n const P = this.mont.pointFromEdwards(A);\n\n return P.encode();\n }\n\n publicKeyFromUniform(bytes) {\n const u = this.curve.decodeUniform(bytes);\n const A = this.curve.pointFromUniform(u, this.iso);\n\n return A.encode();\n }\n\n publicKeyToUniform(key, hint = rng.randomInt()) {\n const A = this.curve.decodePoint(key);\n const u = this.curve.pointToUniform(A, hint, this.iso);\n\n return this.curve.encodeUniform(u, hint >>> 8);\n }\n\n publicKeyFromHash(bytes, pake = false) {\n const A = this.curve.pointFromHash(bytes, pake, this.iso);\n return A.encode();\n }\n\n publicKeyToHash(key, subgroup = rng.randomInt()) {\n const A = this.curve.decodePoint(key);\n return this.curve.pointToHash(A, subgroup, rng, this.iso);\n }\n\n publicKeyVerify(key) {\n assert(Buffer.isBuffer(key));\n\n try {\n this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return true;\n }\n\n publicKeyIsInfinity(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.isInfinity();\n }\n\n publicKeyIsSmall(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.isSmall();\n }\n\n publicKeyHasTorsion(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.hasTorsion();\n }\n\n publicKeyExport(key) {\n const {x, y} = this.curve.decodePoint(key);\n\n return {\n x: this.curve.encodeField(x.fromRed()),\n y: this.curve.encodeField(y.fromRed())\n };\n }\n\n publicKeyImport(json) {\n assert(json && typeof json === 'object');\n\n let x = null;\n let y = null;\n let A;\n\n if (json.x != null) {\n x = BN.decode(json.x, this.curve.endian);\n\n if (x.cmp(this.curve.p) >= 0)\n throw new Error('Invalid point.');\n }\n\n if (json.y != null) {\n y = BN.decode(json.y, this.curve.endian);\n\n if (y.cmp(this.curve.p) >= 0)\n throw new Error('Invalid point.');\n }\n\n if (x && y) {\n A = this.curve.point(x, y);\n\n if (!A.validate())\n throw new Error('Invalid point.');\n } else if (x) {\n A = this.curve.pointFromX(x, json.sign);\n } else if (y) {\n A = this.curve.pointFromY(y, json.sign);\n } else {\n throw new Error('Invalid point.');\n }\n\n return A.encode();\n }\n\n publicKeyTweakAdd(key, tweak) {\n const t = this.curve.decodeScalar(tweak).imod(this.curve.n);\n const A = this.curve.decodePoint(key);\n const T = this.curve.g.mul(t);\n const P = T.add(A);\n\n return P.encode();\n }\n\n publicKeyTweakMul(key, tweak) {\n const t = this.curve.decodeScalar(tweak);\n const A = this.curve.decodePoint(key);\n const P = A.mul(t);\n\n return P.encode();\n }\n\n publicKeyCombine(keys) {\n assert(Array.isArray(keys));\n\n let P = this.curve.point();\n\n for (const key of keys) {\n const A = this.curve.decodePoint(key);\n\n P = P.add(A);\n }\n\n return P.encode();\n }\n\n publicKeyNegate(key) {\n const A = this.curve.decodePoint(key);\n const P = A.neg();\n\n return P.encode();\n }\n\n sign(msg, secret, ph, ctx) {\n const [key, prefix] = this.privateKeyExpand(secret);\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n signWithScalar(msg, scalar, prefix, ph, ctx) {\n // EdDSA Signing.\n //\n // [EDDSA] Page 12, Section 4.\n // [RFC8032] Page 8, Section 3.3.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `a` be a secret scalar.\n // - Let `w` be a secret byte array.\n //\n // Computation:\n //\n // k = H(w, m) mod n\n // R = G * k\n // A = G * a\n // e = H(R, A, m) mod n\n // s = (k + e * a) mod n\n // S = (R, s)\n //\n // Note that `k` must remain secret,\n // otherwise an attacker can compute:\n //\n // a = (s - k) / e mod n\n //\n // The same is true of `w` as `k`\n // can be re-derived as `H(w, m)`.\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(prefix));\n assert(prefix.length === this.curve.adjustedSize);\n\n const {n} = this.curve;\n const G = this.curve.g;\n const k = this.hashNonce(prefix, msg, ph, ctx);\n const Rraw = G.mulBlind(k).encode();\n const a = this.curve.decodeScalar(scalar);\n const Araw = G.mulBlind(a).encode();\n const e = this.hashChallenge(Rraw, Araw, msg, ph, ctx);\n const s = k.add(e.mul(a)).imod(n);\n\n return Buffer.concat([Rraw, this.curve.encodeAdjusted(s)]);\n }\n\n signTweakAdd(msg, secret, tweak, ph, ctx) {\n const [key_, prefix_] = this.privateKeyExpand(secret);\n const key = this.scalarTweakAdd(key_, tweak);\n const expanded = this.hash.multi(prefix_, tweak, null,\n this.curve.adjustedSize * 2);\n const prefix = expanded.slice(0, this.curve.adjustedSize);\n\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n signTweakMul(msg, secret, tweak, ph, ctx) {\n const [key_, prefix_] = this.privateKeyExpand(secret);\n const key = this.scalarTweakMul(key_, tweak);\n const expanded = this.hash.multi(prefix_, tweak, null,\n this.curve.adjustedSize * 2);\n const prefix = expanded.slice(0, this.curve.adjustedSize);\n\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n verify(msg, sig, key, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n\n try {\n return this._verify(msg, sig, key, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verify(msg, sig, key, ph, ctx) {\n // EdDSA Verification.\n //\n // [EDDSA] Page 15, Section 5.\n // [RFC8032] Page 8, Section 3.4.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - s < n.\n //\n // Computation:\n //\n // e = H(R, A, m) mod n\n // G * s == R + A * e\n //\n // Alternatively, we can compute:\n //\n // R == G * s - A * e\n //\n // This allows us to make use of a\n // multi-exponentiation algorithm.\n const {n} = this.curve;\n const G = this.curve.g;\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n\n return G.mulAdd(s, A.neg(), e).eq(R);\n }\n\n verifySingle(msg, sig, key, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n\n try {\n return this._verifySingle(msg, sig, key, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verifySingle(msg, sig, key, ph, ctx) {\n // EdDSA Verification (with cofactor multiplication).\n //\n // [EDDSA] Page 15, Section 5.\n // [RFC8032] Page 8, Section 3.4.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - s < n.\n //\n // Computation:\n //\n // e = H(R, A, m) mod n\n // (G * s) * h == (R + A * e) * h\n //\n // Alternatively, we can compute:\n //\n // R * h == G * (s * h) - (A * h) * e\n //\n // This allows us to make use of a\n // multi-exponentiation algorithm.\n const {n} = this.curve;\n const G = this.curve.g;\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n const sh = this.curve.imulH(s);\n const Ah = A.mulH();\n const Rh = R.mulH();\n\n return G.mulAdd(sh, Ah.neg(), e).eq(Rh);\n }\n\n verifyBatch(batch, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Array.isArray(batch));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n for (const item of batch) {\n assert(Array.isArray(item) && item.length === 3);\n\n const [msg, sig, key] = item;\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n }\n\n try {\n return this._verifyBatch(batch, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verifyBatch(batch, ph, ctx) {\n // EdDSA Batch Verification.\n //\n // [EDDSA] Page 16, Section 5.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - Let `i` be the batch item index.\n // - s < n.\n // - a1 = 1 mod n.\n //\n // Computation:\n //\n // ei = H(Ri, Ai, mi) mod n\n // ai = random integer in [1,n-1]\n // lhs = (si * ai + ...) * h mod n\n // rhs = (Ri * h) * ai + (Ai * h) * (ei * ai mod n) + ...\n // G * -lhs + rhs == O\n const {n} = this.curve;\n const G = this.curve.g;\n const points = new Array(1 + batch.length * 2);\n const coeffs = new Array(1 + batch.length * 2);\n const sum = new BN(0);\n\n this.rng.init(batch);\n\n points[0] = G;\n coeffs[0] = sum;\n\n for (let i = 0; i < batch.length; i++) {\n const [msg, sig, key] = batch[i];\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n const a = this.rng.generate(i);\n const ea = e.mul(a).imod(n);\n\n sum.iadd(s.mul(a)).imod(n);\n\n points[1 + i * 2 + 0] = R.mulH();\n coeffs[1 + i * 2 + 0] = a;\n points[1 + i * 2 + 1] = A.mulH();\n coeffs[1 + i * 2 + 1] = ea;\n }\n\n this.curve.imulH(sum.ineg());\n\n return this.curve.mulAll(points, coeffs).isInfinity();\n }\n\n derive(pub, secret) {\n const scalar = this.privateKeyConvert(secret);\n return this.deriveWithScalar(pub, scalar);\n }\n\n deriveWithScalar(pub, scalar) {\n const A = this.curve.decodePoint(pub);\n const a = this.curve.decodeClamped(scalar);\n const P = A.mulBlind(a, rng);\n\n if (P.isInfinity())\n throw new Error('Invalid point.');\n\n return P.encode();\n }\n}\n\n/*\n * Hash\n */\n\nclass Hash {\n constructor(eddsa) {\n this.curve = eddsa.curve;\n // eslint-disable-next-line\n this.hash = new eddsa.hash();\n }\n\n init(ph, ctx) {\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (ctx.length > 255)\n ctx = ctx.slice(0, 255);\n\n this.hash.init();\n\n if (this.curve.context || ph != null || ctx.length > 0) {\n if (this.curve.prefix)\n this.hash.update(this.curve.prefix);\n\n this.hash.update(byte(ph));\n this.hash.update(byte(ctx.length));\n this.hash.update(ctx);\n }\n\n return this;\n }\n\n update(data) {\n this.hash.update(data);\n return this;\n }\n\n final() {\n const hash = this.hash.final(this.curve.adjustedSize * 2);\n const num = BN.decode(hash, this.curve.endian);\n\n return num.imod(this.curve.n);\n }\n}\n\n/*\n * Helpers\n */\n\nfunction byte(ch) {\n const buf = Buffer.alloc(1);\n buf[0] = ch & 0xff;\n return buf;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = EDDSA;\n","/*!\n * keccak.js - Keccak/SHA3 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on emn178/js-sha3:\n * Copyright (c) 2015-2017, Chen, Yi-Cyuan (MIT License).\n * https://github.com/emn178/js-sha3\n *\n * Parts of this software are based on rhash/RHash:\n * Copyright (c) 2005-2014, Aleksey Kravchenko\n * https://github.com/rhash/RHash\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n * https://github.com/rhash/RHash/blob/master/librhash/sha3.c\n * https://github.com/emn178/js-sha3/blob/master/src/sha3.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst HMAC = require('../internal/hmac');\n\n/*\n * Constants\n */\n\nconst FINALIZED = 0x80000000;\n\nconst ROUND_CONST = new Uint32Array([\n 0x00000001, 0x00000000, 0x00008082, 0x00000000,\n 0x0000808a, 0x80000000, 0x80008000, 0x80000000,\n 0x0000808b, 0x00000000, 0x80000001, 0x00000000,\n 0x80008081, 0x80000000, 0x00008009, 0x80000000,\n 0x0000008a, 0x00000000, 0x00000088, 0x00000000,\n 0x80008009, 0x00000000, 0x8000000a, 0x00000000,\n 0x8000808b, 0x00000000, 0x0000008b, 0x80000000,\n 0x00008089, 0x80000000, 0x00008003, 0x80000000,\n 0x00008002, 0x80000000, 0x00000080, 0x80000000,\n 0x0000800a, 0x00000000, 0x8000000a, 0x80000000,\n 0x80008081, 0x80000000, 0x00008080, 0x80000000,\n 0x80000001, 0x00000000, 0x80008008, 0x80000000\n]);\n\n/**\n * Keccak\n */\n\nclass Keccak {\n constructor() {\n this.state = new Uint32Array(50);\n this.block = Buffer.alloc(200);\n this.bs = 136;\n this.pos = FINALIZED;\n }\n\n init(bits) {\n if (bits == null)\n bits = 256;\n\n assert((bits >>> 0) === bits);\n assert(bits >= 128);\n assert(bits <= 512);\n\n const rate = 1600 - bits * 2;\n\n assert(rate >= 0 && (rate & 63) === 0);\n\n this.bs = rate >>> 3;\n this.pos = 0;\n\n return this;\n }\n\n update(data) {\n assert(Buffer.isBuffer(data));\n assert(!(this.pos & FINALIZED), 'Context is not initialized.');\n\n let len = data.length;\n let pos = this.pos;\n let off = 0;\n\n this.pos = (this.pos + len) % this.bs;\n\n if (pos > 0) {\n let want = this.bs - pos;\n\n if (want > len)\n want = len;\n\n data.copy(this.block, pos, off, off + want);\n\n pos += want;\n len -= want;\n off += want;\n\n if (pos < this.bs)\n return this;\n\n this._transform(this.block, 0);\n }\n\n while (len >= this.bs) {\n this._transform(data, off);\n off += this.bs;\n len -= this.bs;\n }\n\n if (len > 0)\n data.copy(this.block, 0, off, off + len);\n\n return this;\n }\n\n final(pad, len) {\n if (pad == null)\n pad = 0x01;\n\n if (len == null || len === 0)\n len = 100 - (this.bs >>> 1);\n\n assert((pad & 0xff) === pad);\n assert((len >>> 0) === len);\n assert(!(this.pos & FINALIZED), 'Context is not initialized.');\n\n this.block.fill(0, this.pos, this.bs);\n this.block[this.pos] |= pad;\n this.block[this.bs - 1] |= 0x80;\n this._transform(this.block, 0);\n this.pos = FINALIZED;\n\n assert(len <= this.bs);\n\n const out = Buffer.alloc(len);\n\n for (let i = 0; i < len; i++)\n out[i] = this.state[i >>> 2] >>> (8 * (i & 3));\n\n for (let i = 0; i < 50; i++)\n this.state[i] = 0;\n\n for (let i = 0; i < this.bs; i++)\n this.block[i] = 0;\n\n return out;\n }\n\n _transform(block, off) {\n const count = this.bs >>> 2;\n const s = this.state;\n\n for (let i = 0; i < count; i++)\n s[i] ^= readU32(block, off + i * 4);\n\n for (let n = 0; n < 48; n += 2) {\n const c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n const c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n const c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n const c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n const c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n const c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n const c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n const c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n const c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n const c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n const h0 = c8 ^ ((c2 << 1) | (c3 >>> 31));\n const l0 = c9 ^ ((c3 << 1) | (c2 >>> 31));\n const h1 = c0 ^ ((c4 << 1) | (c5 >>> 31));\n const l1 = c1 ^ ((c5 << 1) | (c4 >>> 31));\n const h2 = c2 ^ ((c6 << 1) | (c7 >>> 31));\n const l2 = c3 ^ ((c7 << 1) | (c6 >>> 31));\n const h3 = c4 ^ ((c8 << 1) | (c9 >>> 31));\n const l3 = c5 ^ ((c9 << 1) | (c8 >>> 31));\n const h4 = c6 ^ ((c0 << 1) | (c1 >>> 31));\n const l4 = c7 ^ ((c1 << 1) | (c0 >>> 31));\n\n s[0] ^= h0;\n s[1] ^= l0;\n s[10] ^= h0;\n s[11] ^= l0;\n s[20] ^= h0;\n s[21] ^= l0;\n s[30] ^= h0;\n s[31] ^= l0;\n s[40] ^= h0;\n s[41] ^= l0;\n\n s[2] ^= h1;\n s[3] ^= l1;\n s[12] ^= h1;\n s[13] ^= l1;\n s[22] ^= h1;\n s[23] ^= l1;\n s[32] ^= h1;\n s[33] ^= l1;\n s[42] ^= h1;\n s[43] ^= l1;\n\n s[4] ^= h2;\n s[5] ^= l2;\n s[14] ^= h2;\n s[15] ^= l2;\n s[24] ^= h2;\n s[25] ^= l2;\n s[34] ^= h2;\n s[35] ^= l2;\n s[44] ^= h2;\n s[45] ^= l2;\n\n s[6] ^= h3;\n s[7] ^= l3;\n s[16] ^= h3;\n s[17] ^= l3;\n s[26] ^= h3;\n s[27] ^= l3;\n s[36] ^= h3;\n s[37] ^= l3;\n s[46] ^= h3;\n s[47] ^= l3;\n\n s[8] ^= h4;\n s[9] ^= l4;\n s[18] ^= h4;\n s[19] ^= l4;\n s[28] ^= h4;\n s[29] ^= l4;\n s[38] ^= h4;\n s[39] ^= l4;\n s[48] ^= h4;\n s[49] ^= l4;\n\n const b0 = s[0];\n const b1 = s[1];\n const b32 = (s[11] << 4) | (s[10] >>> 28);\n const b33 = (s[10] << 4) | (s[11] >>> 28);\n const b14 = (s[20] << 3) | (s[21] >>> 29);\n const b15 = (s[21] << 3) | (s[20] >>> 29);\n const b46 = (s[31] << 9) | (s[30] >>> 23);\n const b47 = (s[30] << 9) | (s[31] >>> 23);\n const b28 = (s[40] << 18) | (s[41] >>> 14);\n const b29 = (s[41] << 18) | (s[40] >>> 14);\n const b20 = (s[2] << 1) | (s[3] >>> 31);\n const b21 = (s[3] << 1) | (s[2] >>> 31);\n const b2 = (s[13] << 12) | (s[12] >>> 20);\n const b3 = (s[12] << 12) | (s[13] >>> 20);\n const b34 = (s[22] << 10) | (s[23] >>> 22);\n const b35 = (s[23] << 10) | (s[22] >>> 22);\n const b16 = (s[33] << 13) | (s[32] >>> 19);\n const b17 = (s[32] << 13) | (s[33] >>> 19);\n const b48 = (s[42] << 2) | (s[43] >>> 30);\n const b49 = (s[43] << 2) | (s[42] >>> 30);\n const b40 = (s[5] << 30) | (s[4] >>> 2);\n const b41 = (s[4] << 30) | (s[5] >>> 2);\n const b22 = (s[14] << 6) | (s[15] >>> 26);\n const b23 = (s[15] << 6) | (s[14] >>> 26);\n const b4 = (s[25] << 11) | (s[24] >>> 21);\n const b5 = (s[24] << 11) | (s[25] >>> 21);\n const b36 = (s[34] << 15) | (s[35] >>> 17);\n const b37 = (s[35] << 15) | (s[34] >>> 17);\n const b18 = (s[45] << 29) | (s[44] >>> 3);\n const b19 = (s[44] << 29) | (s[45] >>> 3);\n const b10 = (s[6] << 28) | (s[7] >>> 4);\n const b11 = (s[7] << 28) | (s[6] >>> 4);\n const b42 = (s[17] << 23) | (s[16] >>> 9);\n const b43 = (s[16] << 23) | (s[17] >>> 9);\n const b24 = (s[26] << 25) | (s[27] >>> 7);\n const b25 = (s[27] << 25) | (s[26] >>> 7);\n const b6 = (s[36] << 21) | (s[37] >>> 11);\n const b7 = (s[37] << 21) | (s[36] >>> 11);\n const b38 = (s[47] << 24) | (s[46] >>> 8);\n const b39 = (s[46] << 24) | (s[47] >>> 8);\n const b30 = (s[8] << 27) | (s[9] >>> 5);\n const b31 = (s[9] << 27) | (s[8] >>> 5);\n const b12 = (s[18] << 20) | (s[19] >>> 12);\n const b13 = (s[19] << 20) | (s[18] >>> 12);\n const b44 = (s[29] << 7) | (s[28] >>> 25);\n const b45 = (s[28] << 7) | (s[29] >>> 25);\n const b26 = (s[38] << 8) | (s[39] >>> 24);\n const b27 = (s[39] << 8) | (s[38] >>> 24);\n const b8 = (s[48] << 14) | (s[49] >>> 18);\n const 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] ^= ROUND_CONST[n + 0];\n s[1] ^= ROUND_CONST[n + 1];\n }\n }\n\n static hash() {\n return new Keccak();\n }\n\n static hmac(bits, pad, len) {\n if (bits == null)\n bits = 256;\n\n assert((bits >>> 0) === bits);\n\n const rate = 1600 - bits * 2;\n\n assert(rate >= 0 && (rate & 63) === 0);\n\n return new HMAC(Keccak, rate >>> 3, [bits], [pad, len]);\n }\n\n static digest(data, bits, pad, len) {\n return Keccak.ctx.init(bits).update(data).final(pad, len);\n }\n\n static root(left, right, bits, pad, len) {\n if (bits == null)\n bits = 256;\n\n if (len == null)\n len = 0;\n\n if (len === 0)\n len = bits >>> 3;\n\n assert((bits >>> 0) === bits);\n assert((bits & 7) === 0);\n assert((len >>> 0) === len);\n assert(Buffer.isBuffer(left) && left.length === len);\n assert(Buffer.isBuffer(right) && right.length === len);\n\n return Keccak.ctx.init(bits).update(left).update(right).final(pad, len);\n }\n\n static multi(x, y, z, bits, pad, len) {\n const {ctx} = Keccak;\n\n ctx.init(bits);\n ctx.update(x);\n ctx.update(y);\n\n if (z)\n ctx.update(z);\n\n return ctx.final(pad, len);\n }\n\n static mac(data, key, bits, pad, len) {\n return Keccak.hmac(bits, pad, len).init(key).update(data).final();\n }\n}\n\n/*\n * Static\n */\n\nKeccak.native = 0;\nKeccak.id = 'KECCAK256';\nKeccak.size = 32;\nKeccak.bits = 256;\nKeccak.blockSize = 136;\nKeccak.zero = Buffer.alloc(32, 0x00);\nKeccak.ctx = new Keccak();\n\n/*\n * Helpers\n */\n\nfunction readU32(data, off) {\n return (data[off++]\n + data[off++] * 0x100\n + data[off++] * 0x10000\n + data[off] * 0x1000000);\n}\n\n/*\n * Expose\n */\n\nmodule.exports = Keccak;\n","/*!\n * keccak.js - keccak for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/keccak');\n","/*!\n * shake.js - SHAKE implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n */\n\n'use strict';\n\nconst Keccak = require('./keccak');\n\n/**\n * SHAKE\n */\n\nclass SHAKE extends Keccak {\n /**\n * Create a SHAKE Context.\n * @constructor\n */\n\n constructor() {\n super();\n }\n\n final(len) {\n return super.final(0x1f, len);\n }\n\n static hash() {\n return new SHAKE();\n }\n\n static hmac(bits, len) {\n return super.hmac(bits, 0x1f, len);\n }\n\n static digest(data, bits, len) {\n return super.digest(data, bits, 0x1f, len);\n }\n\n static root(left, right, bits, len) {\n return super.root(left, right, bits, 0x1f, len);\n }\n\n static multi(x, y, z, bits, len) {\n return super.multi(x, y, z, bits, 0x1f, len);\n }\n\n static mac(data, key, bits, len) {\n return super.mac(data, key, bits, 0x1f, len);\n }\n}\n\n/*\n * Static\n */\n\nSHAKE.native = Keccak.native;\nSHAKE.id = 'SHAKE256';\nSHAKE.size = 32;\nSHAKE.bits = 256;\nSHAKE.blockSize = 136;\nSHAKE.zero = Buffer.alloc(32, 0x00);\nSHAKE.ctx = new SHAKE();\n\n/*\n * Expose\n */\n\nmodule.exports = SHAKE;\n","/*!\n * shake256.js - SHAKE256 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nconst SHAKE = require('./shake');\n\n/**\n * SHAKE256\n */\n\nclass SHAKE256 extends SHAKE {\n constructor() {\n super();\n }\n\n init() {\n return super.init(256);\n }\n\n static hash() {\n return new SHAKE256();\n }\n\n static hmac(len) {\n return super.hmac(256, len);\n }\n\n static digest(data, len) {\n return super.digest(data, 256, len);\n }\n\n static root(left, right, len) {\n return super.root(left, right, 256, len);\n }\n\n static multi(x, y, z, len) {\n return super.multi(x, y, z, 256, len);\n }\n\n static mac(data, key, len) {\n return super.mac(data, key, 256, len);\n }\n}\n\n/*\n * Static\n */\n\nSHAKE256.native = SHAKE.native;\nSHAKE256.id = 'SHAKE256';\nSHAKE256.size = 32;\nSHAKE256.bits = 256;\nSHAKE256.blockSize = 136;\nSHAKE256.zero = Buffer.alloc(32, 0x00);\nSHAKE256.ctx = new SHAKE256();\n\n/*\n * Expose\n */\n\nmodule.exports = SHAKE256;\n","/*!\n * ed448.js - ed448 for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://eprint.iacr.org/2015/625.pdf\n * https://tools.ietf.org/html/rfc8032#section-5.2\n */\n\n'use strict';\n\nconst EDDSA = require('./eddsa');\nconst SHAKE256 = require('../shake256');\n\n/*\n * Expose\n */\n\nmodule.exports = new EDDSA('ED448', 'X448', 'MONT448', SHAKE256);\n","/*!\n * ed448.js - ed448 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/ed448');\n","// bcrypto does not ship TypeScript declarations.\n// @ts-ignore\nimport backend from \"bcrypto/lib/ed448-browser.js\";\nconst ed448 = backend;\nexport default ed448;\n//# sourceMappingURL=browser-ed448.js.map","/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert(value >> width === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\",\n fault: \"overflow\",\n value: _value,\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -((~value & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = BN_1 << (width - BN_1);\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n const mask = (BN_1 << width) - BN_1;\n return (~value & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof value) {\n case \"bigint\":\n return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\",\n operation: \"getUint\",\n value,\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof value) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value,\n });\n // Pad the value to the required width\n while (result.length < width * 2) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n return new Uint8Array([]);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map","/**\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 let value = toBigInt(getBytes(_value));\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\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","// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map","/**\n * Explain events...\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map","/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import { assert } from \"./errors.js\";\n// @TODO: timeout is completely ignored; start a Promise.any with a reject?\n// @ts-ignore\nexport async function getUrl(req, _signal) {\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 let signal = undefined;\n if (_signal) {\n const controller = new AbortController();\n signal = controller.signal;\n _signal.addListener(() => {\n controller.abort();\n });\n }\n const init = {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal,\n };\n try {\n const resp = await fetch(req.url, init);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = respBody == null ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers,\n body,\n };\n }\n catch (error) {\n console.log({ error });\n return undefined;\n }\n}\n//# sourceMappingURL=geturl-browser.js.map","/**\n * Explain fetching here...\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 { getUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet getUrlFunc = getUrl;\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(() => {\n listener();\n }, 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() {\n return this.#cancelled;\n }\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 /**\n * The fetch URI to requrest.\n */\n get url() {\n return this.#url;\n }\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``) and the .\n *\n * If %%body%% is a string, the intrincis ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrincis ``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 chnages 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 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]],\n 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 complere response.\n * //(default: 5 minutes)//\n */\n get timeout() {\n return this.#timeout;\n }\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 * 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 }\n toString() {\n return ``;\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\",\n reason: \"timeout\",\n 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\n .makeServerError(\"error in post-processing function\", error)\n .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 getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req\n .redirect(location)\n .#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 ||\n (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof retryAfter === \"string\" &&\n retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req\n .clone()\n .#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\n .makeServerError(\"error in post-processing function\", error)\n .assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req\n .clone()\n .#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 locataions\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" &&\n (current !== \"https\" || target !== \"http\") &&\n 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 = \"GET\";\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 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 getUrlFunc = getUrl;\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 * 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 ``;\n }\n /**\n * The response status code.\n */\n get statusCode() {\n return this.#statusCode;\n }\n /**\n * The response status message.\n */\n get statusMessage() {\n return this.#statusMessage;\n }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() {\n return Object.assign({}, this.#headers);\n }\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\",\n 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\",\n 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]],\n 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 of 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() {\n return this.#request;\n }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" &&\n this.statusCode >= 200 &&\n 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 assert(false, message, \"SERVER_ERROR\", {\n request: this.request || \"unknown request\",\n response: this,\n error,\n });\n }\n}\nfunction getTime() {\n return new Date().getTime();\n}\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","var _a;\n/**\n * About fixed-point math...\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = BN_1 << (width - BN_1);\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = BN_1 << width;\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n val = (((val % limit) + limit) % limit) & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof value === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof value === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = match[1] !== \"u\";\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof v[key] === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument(width % 8 === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return negative + str;\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return negative + str;\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, an value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() {\n return this.#format.signed;\n }\n /**\n * The number of bits available to store the value.\n */\n get width() {\n return this.#format.width;\n }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() {\n return this.#format.decimals;\n }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() {\n return this.#val;\n }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n\n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n*/\n val = checkValue(val, this.#format, safeOp);\n return new _a(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) {\n return this.#add(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) {\n return this.#add(other, \"add\");\n }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) {\n return this.#sub(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) {\n return this.#sub(other, \"sub\");\n }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) {\n return this.#mul(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) {\n return this.#mul(other, \"mul\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert(value % this.#tens === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) {\n return this.#div(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) {\n return this.#div(other, \"div\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(other);\n const value = this.#val * this.#tens;\n assert(value % other.#val === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%other%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return -1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) {\n return this.cmp(other) === 0;\n }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) {\n return this.cmp(other) < 0;\n }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) {\n return this.cmp(other) <= 0;\n }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) {\n return this.cmp(other) > 0;\n }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) {\n return this.cmp(other) >= 0;\n }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new _a(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() {\n return this.#val === BN_0;\n }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() {\n return this.#val < BN_0;\n }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() {\n return this._value;\n }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() {\n return parseFloat(this.toString());\n }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return _a.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, decimals, _format) {\n if (decimals == null) {\n decimals = 0;\n }\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert(value % tens === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\",\n fault: \"underflow\",\n value: _value,\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && match[2].length + match[3].length > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = match[2] || \"0\", decimal = match[3] || \"\";\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\",\n fault: \"underflow\",\n value: _value,\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new _a(_guard, value, format);\n }\n}\n_a = FixedNumber;\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","import { 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,\n length,\n 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,\n length: 0,\n offset: 1,\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data,\n length: data.length,\n 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","import { 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","/**\n * Most interactions with Core requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Core, //Core// is divisible to 18 decimal places,\n * where each individual unit is called a //ore//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n ///Ore, the smallest and atomic amount of Core\n \"ore\",\n ///fecore, 1000 ore\n \"fecore\",\n ///Picore, one million ore\n \"picore\",\n ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices.\n \"nacore\",\n ///Μcore, 10^12 ore or 1 μCore\n \"mcore\",\n ///micore, 10^15 ore or 1 mcore\n \"micore\",\n \"core\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit.\n */\nexport const scientificToDecimal = (num) => {\n // @ts-ignore\n var nsign = Math.sign(num);\n //remove the sign\n // @ts-ignore\n num = Math.abs(num);\n //if the number is in scientific notation remove it\n // @ts-ignore\n if (/\\d+\\.?\\d*e[\\+\\-]*\\d+/i.test(num)) {\n var zero = \"0\", \n // @ts-ignore\n parts = String(num).toLowerCase().split(\"e\"), //split into coeff and exponent\n e = parts.pop(), //store the exponential part\n // @ts-ignore\n l = Math.abs(e), //get the number of zeros\n // @ts-ignore\n sign = e / l, coeff_array = parts[0].split(\".\");\n if (sign === -1) {\n l = l - coeff_array[0].length;\n if (l < 0) {\n // @ts-ignore\n num =\n coeff_array[0].slice(0, l) +\n \".\" +\n coeff_array[0].slice(l) +\n (coeff_array.length === 2 ? coeff_array[1] : \"\");\n }\n else {\n // @ts-ignore\n num = zero + \".\" + new Array(l + 1).join(zero) + coeff_array.join(\"\");\n }\n }\n else {\n var dec = coeff_array[1];\n if (dec)\n l = l - dec.length;\n if (l < 0) {\n // @ts-ignore\n num = coeff_array[0] + dec.slice(0, l) + \".\" + dec.slice(l);\n }\n else {\n // @ts-ignore\n num = coeff_array.join(\"\") + new Array(l + 1).join(zero);\n }\n }\n }\n // @ts-ignore\n return nsign < 0 ? \"-\" + num : num;\n};\nexport const trimDecimals = (n, decimals = 18) => {\n n += \"\";\n if (n.indexOf(\".\") === -1)\n return n;\n const arr = n.split(\".\");\n const fraction = arr[1].substr(0, decimals);\n return arr[0] + \".\" + fraction;\n};\nexport function parseUnits(value, unit) {\n assertArgument(typeof value === \"string\", \"value must be a string\", \"value\", value);\n if (value.includes(\"e\")) {\n value = scientificToDecimal(value).toString();\n }\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n value = trimDecimals(value, decimals);\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n value = trimDecimals(value, decimals);\n }\n return FixedNumber.fromString(value, { decimals }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatXCB(ore) {\n return formatUnits(ore, 18);\n}\n/**\n * Converts the //decimal string// %%xcb%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseXCB(xcb) {\n return parseUnits(xcb, 18);\n}\n//# sourceMappingURL=units.js.map","/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map","/*!\n * pbkdf2.js - pbkdf2 for bcrypto\n * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/PBKDF2\n * https://tools.ietf.org/html/rfc2898\n * https://tools.ietf.org/html/rfc2898#section-5.2\n * https://tools.ietf.org/html/rfc6070\n * https://www.emc.com/collateral/white-papers/h11302-pkcs5v2-1-password-based-cryptography-standard-wp.pdf\n * http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst crypto = global.crypto || global.msCrypto || {};\nconst subtle = crypto.subtle || {};\n\n/**\n * Perform key derivation using PBKDF2.\n * @param {Function} hash\n * @param {Buffer} pass\n * @param {Buffer} salt\n * @param {Number} iter\n * @param {Number} len\n * @returns {Buffer}\n */\n\nfunction derive(hash, pass, salt, iter, len) {\n if (typeof pass === 'string')\n pass = Buffer.from(pass, 'utf8');\n\n if (typeof salt === 'string')\n salt = Buffer.from(salt, 'utf8');\n\n if (salt == null)\n salt = Buffer.alloc(0);\n\n assert(hash && typeof hash.id === 'string');\n assert(Buffer.isBuffer(pass));\n assert(Buffer.isBuffer(salt));\n assert((iter >>> 0) === iter);\n assert((len >>> 0) === len);\n\n const size = hash.size;\n const blocks = Math.ceil(len / size);\n const out = Buffer.alloc(blocks * size);\n const state = Buffer.alloc(salt.length + 4);\n\n salt.copy(state, 0);\n\n // Preemptively shorten key.\n if (pass.length > hash.blockSize) {\n pass = hash.digest(pass);\n assert(pass.length <= hash.blockSize);\n }\n\n for (let i = 0; i < blocks; i++) {\n const round = i + 1;\n\n state[salt.length + 0] = round >>> 24;\n state[salt.length + 1] = round >>> 16;\n state[salt.length + 2] = round >>> 8;\n state[salt.length + 3] = round;\n\n const block = hash.mac(state, pass);\n\n let mac = block;\n\n for (let j = 1; j < iter; j++) {\n mac = hash.mac(mac, pass);\n\n for (let k = 0; k < size; k++)\n block[k] ^= mac[k];\n }\n\n block.copy(out, i * size);\n }\n\n return out.slice(0, len);\n}\n\n/**\n * Execute pbkdf2 asynchronously.\n * @param {Function} hash\n * @param {Buffer} pass\n * @param {Buffer} salt\n * @param {Number} iter\n * @param {Number} len\n * @returns {Promise}\n */\n\nasync function deriveAsync(hash, pass, salt, iter, len) {\n if (typeof pass === 'string')\n pass = Buffer.from(pass, 'utf8');\n\n if (typeof salt === 'string')\n salt = Buffer.from(salt, 'utf8');\n\n if (salt == null)\n salt = Buffer.alloc(0);\n\n assert(hash && typeof hash.id === 'string');\n assert(Buffer.isBuffer(pass));\n assert(Buffer.isBuffer(salt));\n assert((iter >>> 0) === iter);\n assert((len >>> 0) === len);\n\n const name = getHash(hash);\n\n if (!subtle.importKey || !subtle.deriveBits || !name)\n return derive(hash, pass, salt, iter, len);\n\n const algo = { name: 'PBKDF2' };\n const use = ['deriveBits'];\n\n const options = {\n name: 'PBKDF2',\n salt: salt,\n iterations: iter,\n hash: name\n };\n\n const key = await subtle.importKey('raw', pass, algo, false, use);\n const out = await subtle.deriveBits(options, key, len * 8);\n\n return Buffer.from(out);\n}\n\n/*\n * Helpers\n */\n\nfunction getHash(hash) {\n switch (hash.id) {\n case 'SHA1':\n return 'SHA-1';\n case 'SHA256':\n return 'SHA-256';\n case 'SHA384':\n return 'SHA-384';\n case 'SHA512':\n return 'SHA-512';\n default:\n return null;\n }\n}\n\n/*\n * Expose\n */\n\nexports.native = 0;\nexports.derive = derive;\nexports.deriveAsync = deriveAsync;\n","/*!\n * pbkdf2.js - pbkdf2 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/pbkdf2');\n","/*!\n * sha3.js - SHA3 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n */\n\n'use strict';\n\nconst Keccak = require('./keccak');\n\n/**\n * SHA3\n */\n\nclass SHA3 extends Keccak {\n constructor() {\n super();\n }\n\n final() {\n return super.final(0x06, null);\n }\n\n static hash() {\n return new SHA3();\n }\n\n static hmac(bits) {\n return super.hmac(bits, 0x06, null);\n }\n\n static digest(data, bits) {\n return super.digest(data, bits, 0x06, null);\n }\n\n static root(left, right, bits) {\n return super.root(left, right, bits, 0x06, null);\n }\n\n static multi(x, y, z, bits) {\n return super.multi(x, y, z, bits, 0x06, null);\n }\n\n static mac(data, key, bits) {\n return super.mac(data, key, bits, 0x06, null);\n }\n}\n\n/*\n * Static\n */\n\nSHA3.native = 0;\nSHA3.id = 'SHA3_256';\nSHA3.size = 32;\nSHA3.bits = 256;\nSHA3.blockSize = 136;\nSHA3.zero = Buffer.alloc(32, 0x00);\nSHA3.ctx = new SHA3();\n\n/*\n * Expose\n */\n\nmodule.exports = SHA3;\n","/*!\n * sha3.js - sha3 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/sha3');\n","/*!\n * sha3-512.js - sha3-512 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nconst SHA3 = require('./sha3');\n\n/**\n * SHA3-512\n */\n\nclass SHA3_512 extends SHA3 {\n constructor() {\n super();\n }\n\n init() {\n return super.init(512);\n }\n\n static hash() {\n return new SHA3_512();\n }\n\n static hmac() {\n return super.hmac(512);\n }\n\n static digest(data) {\n return super.digest(data, 512);\n }\n\n static root(left, right) {\n return super.root(left, right, 512);\n }\n\n static multi(x, y, z) {\n return super.multi(x, y, z, 512);\n }\n\n static mac(data, key) {\n return super.mac(data, key, 512);\n }\n}\n\n/*\n * Static\n */\n\nSHA3_512.native = SHA3.native;\nSHA3_512.id = 'SHA3_512';\nSHA3_512.size = 64;\nSHA3_512.bits = 512;\nSHA3_512.blockSize = 72;\nSHA3_512.zero = Buffer.alloc(64, 0x00);\nSHA3_512.ctx = new SHA3_512();\n\n/*\n * Expose\n */\n\nmodule.exports = SHA3_512;\n","import { Buffer } from \"buffer\";\n// @ts-ignore\nimport ed448 from \"./browser-ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"./pbkdf2-browser.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(Buffer.from(msgHash, \"hex\"), Buffer.from(signedMsg, \"hex\"), Buffer.from(pubKey, \"hex\"));\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock-browser.js.map","/* Browser Crypto Shims */\nimport { ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"ripemd160\":\n return ripemd160.create();\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512, \"sha3-256\": sha3_256, \"sha3-512\": sha3_512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = (data) => hexlify(createHash(\"sha3-256\").update(data).digest());\nconst _sha512 = (data) => hexlify(createHash(\"sha3-512\").update(data).digest());\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA3-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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n return hexlify(createHash(\"ripemd160\").update(getBytes(data)).digest());\n}\nexport function sha256(data) {\n return hexlify(__sha256(getBytes(data)));\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(createHmac(\"sha3-256\", k).update(d).digest());\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(createHmac(\"sha3-512\", k).update(d).digest());\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 SHA3-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 return hexlify(__sha512(getBytes(data)));\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha512);\n//# sourceMappingURL=sha3.js.map","/**\n * Addresses are a fundamental part of interacting with Core. They\n * represent the gloabal identity of Externally Owned Accounts (accounts\n * backed by a private key) and contracts.\n *\n * The Core Naming Service (CNS) provides an interconnected ecosystem\n * of contracts, standards and libraries which enable looking up an\n * address for an ENS name.\n *\n * These functions help convert between various formats, validate\n * addresses and safely resolve ENS names.\n *\n * @_section: api/address:Addresses [about-addresses]\n */\nnull;\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { encode } from \"../crypto/rlp.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexDataSlice, hexlify, stripZeros, } from \"../utils/data.js\";\nconst logger = new Logger(\"address/0.0.1\");\nconst precompiledAddresses = [\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n \"0000000000000000000000000000000000000000000000000000000000000001\",\n \"0000000000000000000000000000000000000000000000000000000000000002\",\n \"0000000000000000000000000000000000000000000000000000000000000003\",\n \"0000000000000000000000000000000000000000000000000000000000000004\",\n \"0000000000000000000000000000000000000000000000000000000000000005\",\n \"0000000000000000000000000000000000000000000000000000000000000006\",\n \"0000000000000000000000000000000000000000000000000000000000000007\",\n \"0000000000000000000000000000000000000000000000000000000000000008\",\n \"0000000000000000000000000000000000000000000000000000000000000009\",\n];\nfunction removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nfunction calculateCheckSum(_address, _prefix) {\n const address = getBytes(\"0x\" + _address.replace(\"0x\", \"\"));\n const prefix = getBytes(\"0x\" + _prefix.replace(\"0x\", \"\"));\n const tmpConcated = new Uint8Array([...address, ...prefix]);\n const hexedConcat = hexlify(tmpConcated).replace(\"0x\", \"\") + \"00\";\n const mods = Array.from(hexedConcat.toUpperCase(), (c) => {\n const charCode = c.charCodeAt(0);\n return charCode > 64 && charCode < 91\n ? (charCode - 55).toString()\n : (charCode - 48).toString();\n }).join(\"\");\n const bigVal = BigInt(mods);\n const val97 = BigInt(97);\n const val98 = BigInt(98);\n const remainder = bigVal % val97;\n const checkSum = val98 - remainder;\n const result = checkSum > 9 ? checkSum.toString() : \"0\" + checkSum.toString();\n return result;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address\n .split(\"\")\n .map((c) => {\n return ibanLookup[c];\n })\n .join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Core uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nfunction getAddress(address) {\n if (typeof address !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n const raw = removeHexPrefix(address);\n if (precompiledAddresses.includes(raw)) {\n return \"0x\" + raw;\n }\n const prefix = raw.substring(0, 2);\n const val = raw.substring(4);\n const checksum = calculateCheckSum(val, prefix);\n if (checksum !== raw.substring(2, 4)) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n return \"0x\" + prefix + checksum + val;\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nfunction getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\nfunction networkIdToPrefix(networkId) {\n if (networkId == 1) {\n return \"cb\";\n }\n else if (networkId == 3 || networkId == 4) {\n return \"ab\";\n }\n else if (networkId > 10 || networkId == 0) {\n return \"ce\";\n }\n else {\n logger.throwArgumentError(\"bad networkId\", \"networkId\", networkId);\n return \"\";\n }\n}\nfunction getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n const val = hexDataSlice(sha256(encode([from, nonce])), 12);\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, };\n//# sourceMappingURL=index.js.map","/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () {\n locked = true;\n};\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map","import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () {\n locked = true;\n};\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map","/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () {\n locked = true;\n};\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map","/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () {\n locked = true;\n};\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map","/**\n * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt.\n * @module\n */\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { sha256 } from \"./sha2.js\";\n// prettier-ignore\nimport { anumber, asyncLoop, checkOpts, clean, rotl, swap32IfBE, u32 } from \"./utils.js\";\n// The main Scrypt loop: uses Salsa extensively.\n// Six versions of the function were tried, this is the fastest one.\n// RFC 7914 §3 / §4 step 2 applies Salsa20/8 to one 16-word (64-byte) block\n// after xor'ing two such blocks.\n// The local `y*` snapshot keeps the xor input stable even when `out` aliases `prev` or `input`.\n// prettier-ignore\nfunction XorAndSalsa(prev, pi, input, ii, out, oi) {\n // Based on https://cr.yp.to/salsa20.html and RFC 7914's Salsa20/8 core.\n // Xor blocks\n let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];\n let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];\n let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];\n let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];\n let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];\n let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];\n let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];\n let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];\n // Save state to temporary variables (salsa)\n let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n // Main loop (salsa)\n for (let i = 0; i < 8; i += 2) {\n x04 ^= rotl(x00 + x12 | 0, 7);\n x08 ^= rotl(x04 + x00 | 0, 9);\n x12 ^= rotl(x08 + x04 | 0, 13);\n x00 ^= rotl(x12 + x08 | 0, 18);\n x09 ^= rotl(x05 + x01 | 0, 7);\n x13 ^= rotl(x09 + x05 | 0, 9);\n x01 ^= rotl(x13 + x09 | 0, 13);\n x05 ^= rotl(x01 + x13 | 0, 18);\n x14 ^= rotl(x10 + x06 | 0, 7);\n x02 ^= rotl(x14 + x10 | 0, 9);\n x06 ^= rotl(x02 + x14 | 0, 13);\n x10 ^= rotl(x06 + x02 | 0, 18);\n x03 ^= rotl(x15 + x11 | 0, 7);\n x07 ^= rotl(x03 + x15 | 0, 9);\n x11 ^= rotl(x07 + x03 | 0, 13);\n x15 ^= rotl(x11 + x07 | 0, 18);\n x01 ^= rotl(x00 + x03 | 0, 7);\n x02 ^= rotl(x01 + x00 | 0, 9);\n x03 ^= rotl(x02 + x01 | 0, 13);\n x00 ^= rotl(x03 + x02 | 0, 18);\n x06 ^= rotl(x05 + x04 | 0, 7);\n x07 ^= rotl(x06 + x05 | 0, 9);\n x04 ^= rotl(x07 + x06 | 0, 13);\n x05 ^= rotl(x04 + x07 | 0, 18);\n x11 ^= rotl(x10 + x09 | 0, 7);\n x08 ^= rotl(x11 + x10 | 0, 9);\n x09 ^= rotl(x08 + x11 | 0, 13);\n x10 ^= rotl(x09 + x08 | 0, 18);\n x12 ^= rotl(x15 + x14 | 0, 7);\n x13 ^= rotl(x12 + x15 | 0, 9);\n x14 ^= rotl(x13 + x12 | 0, 13);\n x15 ^= rotl(x14 + x13 | 0, 18);\n }\n // Write output (salsa)\n out[oi++] = (y00 + x00) | 0;\n out[oi++] = (y01 + x01) | 0;\n out[oi++] = (y02 + x02) | 0;\n out[oi++] = (y03 + x03) | 0;\n out[oi++] = (y04 + x04) | 0;\n out[oi++] = (y05 + x05) | 0;\n out[oi++] = (y06 + x06) | 0;\n out[oi++] = (y07 + x07) | 0;\n out[oi++] = (y08 + x08) | 0;\n out[oi++] = (y09 + x09) | 0;\n out[oi++] = (y10 + x10) | 0;\n out[oi++] = (y11 + x11) | 0;\n out[oi++] = (y12 + x12) | 0;\n out[oi++] = (y13 + x13) | 0;\n out[oi++] = (y14 + x14) | 0;\n out[oi++] = (y15 + x15) | 0;\n}\nfunction BlockMix(input, ii, out, oi, r) {\n // The block B is `r` 128-byte chunks, i.e. `2r` 16-word (64-byte) Salsa blocks.\n let head = oi + 0;\n let tail = oi + 16 * r;\n for (let i = 0; i < 16; i++)\n out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]\n for (let i = 0; i < r; i++, head += 16, ii += 16) {\n // RFC 7914 §4 step 3 outputs `Y[0], Y[2], ...` first, then `Y[1], Y[3], ...`;\n // `head` and `tail` lay out those even/odd halves in place.\n XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])\n if (i > 0)\n tail += 16; // First iteration overwrites tmp value in tail\n // tail[i] = Salsa(blockIn[2*i+1] ^ head[i])\n XorAndSalsa(out, head, input, (ii += 16), out, tail);\n }\n}\n// 128*r*(N+p+1) for N=2**20, r=8, p=1: 1 GiB main table plus 2 KiB workspace.\nconst SCRYPT_DEFAULT_MAXMEM = 128 * 8 * (2 ** 20 + 1 + 1);\n// Common prologue and epilogue for sync/async functions\nfunction scryptInit(password, salt, _opts) {\n const opts = checkOpts({\n dkLen: 32,\n asyncTick: 10,\n maxmem: SCRYPT_DEFAULT_MAXMEM,\n }, _opts);\n const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;\n anumber(N, 'N');\n anumber(r, 'r');\n anumber(p, 'p');\n anumber(dkLen, 'dkLen');\n anumber(asyncTick, 'asyncTick');\n anumber(maxmem, 'maxmem');\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('\"onProgress\" must be a function');\n // Without this, r=0 slips through: blockSize=0 turns the `p` upper bound into\n // Infinity and the failure surfaces later as a confusing pbkdf2 dkLen error.\n if (r < 1)\n throw new Error('\"r\" expected integer >= 1');\n const blockSize = 128 * r;\n const blockSize32 = blockSize / 4;\n // Max N is 2^32 (Integrify is 32-bit).\n // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB.\n // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs,\n // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error:\n // https://www.rfc-editor.org/errata_search.php?rfc=7914\n const pow32 = Math.pow(2, 32);\n if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32)\n throw new Error('\"N\" expected a power of 2, and 2^1 <= N <= 2^32');\n if (p < 1 || p > ((pow32 - 1) * 32) / blockSize)\n throw new Error('\"p\" expected integer 1..((2^32 - 1) * 32) / (128 * r)');\n // RFC 7914 §2 defines `dkLen` as a positive integer.\n if (dkLen < 1 || dkLen > (pow32 - 1) * 32)\n throw new Error('\"dkLen\" expected integer 1..(2^32 - 1) * 32');\n // Include the shared `tmp` scratch block so `maxmem` matches noble's actual temporary allocation.\n // Node requires more headroom here, so this accounting is intentionally noble-specific.\n const memUsed = blockSize * (N + p + 1);\n if (memUsed > maxmem)\n throw new Error('\"maxmem\" limit was hit: memUsed(128*r*(N+p+1))=' + memUsed + ', maxmem=' + maxmem);\n // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)\n // Since it has only one iteration there is no reason to use async variant\n const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });\n const B32 = u32(B);\n // Re-used between parallel iterations. Array(iterations) of B\n const V = u32(new Uint8Array(blockSize * N));\n const tmp = u32(new Uint8Array(blockSize));\n let blockMixCb = () => { };\n if (onProgress) {\n const totalBlockMix = 2 * N * p;\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);\n let blockMixCnt = 0;\n blockMixCb = () => {\n blockMixCnt++;\n if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) {\n // Wiping here instead of a try/catch around the main loops keeps them\n // try-free: measured ~1% slower at N=2^21 with the loops inside a try.\n // onProgress is the only user code that can throw mid-derivation.\n try {\n onProgress(blockMixCnt / totalBlockMix);\n }\n catch (e) {\n clean(B, V, tmp);\n throw e;\n }\n }\n };\n }\n return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };\n}\nfunction scryptOutput(password, dkLen, B, V, tmp) {\n // Shared final PBKDF2-and-cleanup step: keep the derived key, wipe the scrypt workspace.\n const res = pbkdf2(sha256, password, B, { c: 1, dkLen });\n clean(B, V, tmp);\n return res;\n}\n/**\n * Scrypt KDF from RFC 7914. See {@link ScryptOpts}.\n * @param password - password or key material to derive from;\n * JS string inputs are UTF-8 encoded first\n * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first\n * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,\n * must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}.\n * @returns Derived key bytes.\n * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}\n * @example\n * Derive a key with scrypt.\n * ```ts\n * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });\n * ```\n * @example\n * Derive a key with small demo costs and progress/memory controls.\n * ```ts\n * const progressLog: number[] = [];\n * scrypt('password', 'salt', {\n * N: 16,\n * r: 8,\n * p: 1,\n * dkLen: 32,\n * maxmem: 1024 * 1024,\n * asyncTick: 10,\n * onProgress(progress) {\n * progressLog.push(progress);\n * },\n * });\n * ```\n */\nexport function scrypt(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts);\n swap32IfBE(B32);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n for (let i = 0, pos = 0; i < N - 1; i++) {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n for (let i = 0; i < N; i++) {\n // First u32 of the last 64-byte block (u32 is LE)\n // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N\n // only depends on the low word here because N is a power of two and\n // this implementation caps N at 2^32.\n // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked\n // above; >>> 0 for unsigned, input fits in u32.\n const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations\n // tmp = B ^ V[j]\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }\n }\n swap32IfBE(B32);\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n/**\n * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}.\n * @param password - password or key material to derive from;\n * JS string inputs are UTF-8 encoded first\n * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first\n * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,\n * must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local\n * scheduler-yield control for this JS wrapper, not part of RFC 7914.\n * See {@link ScryptOpts}.\n * @returns Promise resolving to derived key bytes.\n * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}\n * @example\n * Derive a key with scrypt asynchronously.\n * ```ts\n * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });\n * ```\n * @example\n * Derive a key asynchronously with small demo costs and progress/memory controls.\n * ```ts\n * await scryptAsync('password', 'salt', {\n * N: 16,\n * r: 8,\n * p: 1,\n * dkLen: 32,\n * maxmem: 1024 * 1024,\n * asyncTick: 1,\n * onProgress(progress) {\n * if (progress > 1) throw new Error('invalid progress');\n * },\n * });\n * ```\n */\nexport async function scryptAsync(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts);\n // One failure handler covers both yield boundaries without putting the hot loops in a try block.\n const abort = () => clean(B, V, tmp);\n swap32IfBE(B32);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n let pos = 0;\n await asyncLoop(N - 1, asyncTick, () => {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }, abort);\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n await asyncLoop(N, asyncTick, () => {\n // First u32 of the last 64-byte block (u32 is LE)\n // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N\n // only depends on the low word here because N is a power of two and\n // this implementation caps N at 2^32.\n // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked\n // above; >>> 0 for unsigned, input fits in u32.\n const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations\n // tmp = B ^ V[j]\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }, abort);\n }\n swap32IfBE(B32);\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n","import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from \"@noble/hashes/scrypt.js\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () {\n lockedAsync = true;\n};\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () {\n lockedSync = true;\n};\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport { dataLength, getBytesCopy, hexlify, assertArgument, } from \"../utils/index.js\";\nimport { arrayify, hexConcat } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { ed448 } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"signing-key/0.0.1\");\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 const normalized = typeof privateKey === \"string\" && !privateKey.startsWith(\"0x\")\n ? \"0x\" + privateKey\n : privateKey;\n assertArgument(dataLength(normalized) === 57, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(normalized);\n }\n /**\n * The private key.\n */\n get privateKey() {\n return this.#privateKey;\n }\n /** The 57-byte Ed448 public key encoded as hex. */\n get publicKey() {\n return SigningKey.computePublicKey(this.#privateKey);\n }\n /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */\n get compressedPublicKey() {\n return SigningKey.computePublicKey(this.#privateKey, true);\n }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n const key = getBytesCopy(this.#privateKey);\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const keyBuffer = new Uint8Array(arrayify(key));\n if (keyBuffer.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n const digestBuffer = new Uint8Array(arrayify(digest));\n if (digestBuffer.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n if (keyBuffer[56] > 127) {\n const prefix = keyBuffer.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[55] |= 0x80;\n prefix[56] = 0;\n const scalar = prefix.slice(0, 56);\n const bufferDigest = Buffer.from(digestBuffer);\n const bufferPrfx = Buffer.from(prefix);\n const bufferScalar = Buffer.from(scalar);\n const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx);\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer));\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */\n computeSharedSecret(other) {\n const pub = Buffer.from(getBytesCopy(other));\n assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), \"invalid public key\", \"other\", other);\n const key = Buffer.from(getBytesCopy(this.#privateKey));\n if (key[56] > 127) {\n const scalar = key.subarray(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n return hexlify(ed448.deriveWithScalar(pub, scalar));\n }\n return hexlify(ed448.derive(pub, key));\n }\n /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */\n static computePublicKey(key, compressed) {\n const bytes = Buffer.from(arrayify(key));\n if (bytes.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n if (bytes[56] > 127) {\n const scalar = bytes.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n const pub = ed448.publicKeyFromScalar(scalar);\n return hexlify(pub);\n }\n const pub = ed448.publicKeyCreate(bytes);\n return hexlify(pub);\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 digestBuffer = Buffer.from(arrayify(digest));\n const sigBuffer = Buffer.from(arrayify(signature));\n if (sigBuffer.length !== 171) {\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n }\n const sig = sigBuffer.slice(0, 114);\n const pub = sigBuffer.slice(114);\n if (ed448.verify(digestBuffer, sig, pub)) {\n return hexlify(pub);\n }\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n return \"\";\n }\n /** Adds two encoded Ed448 public points. The compression flag is ignored. */\n static addPoints(p0, p1, compressed) {\n const points = [p0, p1].map((point) => {\n const bytes = Buffer.from(getBytesCopy(point));\n assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), \"invalid public key\", \"point\", point);\n return bytes;\n });\n return hexlify(ed448.publicKeyCombine(points));\n }\n}\n//# sourceMappingURL=signing-key.js.map","import { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate, } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst _guard = {};\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signautre.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() {\n return this.#r;\n }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n const value = hexlify(_value);\n assertArgument(parseInt(value.substring(0, 3)) < 8, \"non-canonical s\", \"value\", value);\n this.#s = value;\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() {\n return this.#v;\n }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() {\n return this.#networkV;\n }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacynetworkId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getnetworkId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return this.v === 27 ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, this.yParity ? \"0x1c\" : \"0x1b\"]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return `Signature { r: \"${this.r}\", s: \"${this.s}\", yParity: ${this.yParity}, networkV: ${this.networkV} }`;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this.s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: networkV != null ? networkV.toString() : null,\n r: this.r,\n s: this.s,\n v: this.v,\n };\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getnetworkId(45)\n * //_result:\n *\n * Signature.getnetworkId(46)\n * //_result:\n */\n static getnetworkId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if (bv == BN_27 || bv == BN_28) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getnetworkIdV(5, 27)\n * //_result:\n *\n * Signature.getnetworkIdV(5, 28)\n * //_result:\n *\n */\n static getnetworkIdV(networkId, v) {\n return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return bv & BN_1 ? 27 : 28;\n }\n}\n//# sourceMappingURL=signature.js.map","/**\n * A fundamental building block of Core is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha3.js\";\nimport { Ed448Goldilock } from \"./crypto.js\";\nimport { keccak256 } from \"./keccak.js\";\nexport { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\nfunction lock() {\n computeHmac.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { arrayify, hexDataSlice } from \"../utils/data.js\";\nimport { calculateCheckSum } from \"../address/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 removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nexport function publicToAddress(key, prefix) {\n const val = hexDataSlice(sha256(key), 12);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport function computeAddress(key, prefix) {\n let pubkey;\n if (typeof key === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return publicToAddress(pubkey, prefix); // getAddress(sha256(\"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, prefix) {\n // return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature);\n return publicToAddress(publicKey, prefix);\n}\nexport function extractPrefix(address) {\n address = getAddress(address);\n return address.substring(2, 4);\n}\n//# sourceMappingURL=address.js.map","import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument, } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => {\n this[index] = item;\n });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof name === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, new Map());\n // Remove any key thats not unique\n this.#names = Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n }));\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof prop === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply(this === receiver ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply(this === receiver ? target : this, [\n prop,\n ]);\n }\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n }\n /**\n * Returns the Result as a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray() {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject() {\n return this.#names.reduce((accum, name, index) => {\n assert(name != null, \"value at index ${ index } unnamed\", \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\",\n });\n // Add values for names that don't conflict\n if (!(name in accum)) {\n accum[name] = this.getValue(name);\n }\n return accum;\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(this.#names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(this.#names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = this.#names.indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: WordSize,\n offset: bytes.length,\n });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\",\n type: \"string\",\n localName: \"string\",\n dynamic: \"boolean\",\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() {\n return this.#dataLength;\n }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n constructor(data, allowLoose) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#offset = 0;\n }\n get data() {\n return hexlify(this.#data);\n }\n get dataLength() {\n return this.#data.length;\n }\n get consumed() {\n return this.#offset;\n }\n get bytes() {\n return new Uint8Array(this.#data);\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose &&\n loose &&\n this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength,\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose);\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, {\n signed,\n width,\n });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${size ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_corebc_typed\");\nexport class Typed {\n type;\n value;\n #options;\n _typedSymbol;\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n defaultValue() {\n return 0;\n }\n minValue() {\n return 0;\n }\n maxValue() {\n return 0;\n }\n isBigInt() {\n return !!this.type.match(/^u?int[0-9]+$/);\n }\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n isString() {\n return this.type === \"string\";\n }\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return this.value.length;\n }\n return null;\n }\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n static uint8(v) {\n return n(v, 8);\n }\n static uint16(v) {\n return n(v, 16);\n }\n static uint24(v) {\n return n(v, 24);\n }\n static uint32(v) {\n return n(v, 32);\n }\n static uint40(v) {\n return n(v, 40);\n }\n static uint48(v) {\n return n(v, 48);\n }\n static uint56(v) {\n return n(v, 56);\n }\n static uint64(v) {\n return n(v, 64);\n }\n static uint72(v) {\n return n(v, 72);\n }\n static uint80(v) {\n return n(v, 80);\n }\n static uint88(v) {\n return n(v, 88);\n }\n static uint96(v) {\n return n(v, 96);\n }\n static uint104(v) {\n return n(v, 104);\n }\n static uint112(v) {\n return n(v, 112);\n }\n static uint120(v) {\n return n(v, 120);\n }\n static uint128(v) {\n return n(v, 128);\n }\n static uint136(v) {\n return n(v, 136);\n }\n static uint144(v) {\n return n(v, 144);\n }\n static uint152(v) {\n return n(v, 152);\n }\n static uint160(v) {\n return n(v, 160);\n }\n static uint168(v) {\n return n(v, 168);\n }\n static uint176(v) {\n return n(v, 176);\n }\n static uint184(v) {\n return n(v, 184);\n }\n static uint192(v) {\n return n(v, 192);\n }\n static uint200(v) {\n return n(v, 200);\n }\n static uint208(v) {\n return n(v, 208);\n }\n static uint216(v) {\n return n(v, 216);\n }\n static uint224(v) {\n return n(v, 224);\n }\n static uint232(v) {\n return n(v, 232);\n }\n static uint240(v) {\n return n(v, 240);\n }\n static uint248(v) {\n return n(v, 248);\n }\n static uint256(v) {\n return n(v, 256);\n }\n static uint(v) {\n return n(v, 256);\n }\n static int8(v) {\n return n(v, -8);\n }\n static int16(v) {\n return n(v, -16);\n }\n static int24(v) {\n return n(v, -24);\n }\n static int32(v) {\n return n(v, -32);\n }\n static int40(v) {\n return n(v, -40);\n }\n static int48(v) {\n return n(v, -48);\n }\n static int56(v) {\n return n(v, -56);\n }\n static int64(v) {\n return n(v, -64);\n }\n static int72(v) {\n return n(v, -72);\n }\n static int80(v) {\n return n(v, -80);\n }\n static int88(v) {\n return n(v, -88);\n }\n static int96(v) {\n return n(v, -96);\n }\n static int104(v) {\n return n(v, -104);\n }\n static int112(v) {\n return n(v, -112);\n }\n static int120(v) {\n return n(v, -120);\n }\n static int128(v) {\n return n(v, -128);\n }\n static int136(v) {\n return n(v, -136);\n }\n static int144(v) {\n return n(v, -144);\n }\n static int152(v) {\n return n(v, -152);\n }\n static int160(v) {\n return n(v, -160);\n }\n static int168(v) {\n return n(v, -168);\n }\n static int176(v) {\n return n(v, -176);\n }\n static int184(v) {\n return n(v, -184);\n }\n static int192(v) {\n return n(v, -192);\n }\n static int200(v) {\n return n(v, -200);\n }\n static int208(v) {\n return n(v, -208);\n }\n static int216(v) {\n return n(v, -216);\n }\n static int224(v) {\n return n(v, -224);\n }\n static int232(v) {\n return n(v, -232);\n }\n static int240(v) {\n return n(v, -240);\n }\n static int248(v) {\n return n(v, -248);\n }\n static int256(v) {\n return n(v, -256);\n }\n static int(v) {\n return n(v, -256);\n }\n static bytes1(v) {\n return b(v, 1);\n }\n static bytes2(v) {\n return b(v, 2);\n }\n static bytes3(v) {\n return b(v, 3);\n }\n static bytes4(v) {\n return b(v, 4);\n }\n static bytes5(v) {\n return b(v, 5);\n }\n static bytes6(v) {\n return b(v, 6);\n }\n static bytes7(v) {\n return b(v, 7);\n }\n static bytes8(v) {\n return b(v, 8);\n }\n static bytes9(v) {\n return b(v, 9);\n }\n static bytes10(v) {\n return b(v, 10);\n }\n static bytes11(v) {\n return b(v, 11);\n }\n static bytes12(v) {\n return b(v, 12);\n }\n static bytes13(v) {\n return b(v, 13);\n }\n static bytes14(v) {\n return b(v, 14);\n }\n static bytes15(v) {\n return b(v, 15);\n }\n static bytes16(v) {\n return b(v, 16);\n }\n static bytes17(v) {\n return b(v, 17);\n }\n static bytes18(v) {\n return b(v, 18);\n }\n static bytes19(v) {\n return b(v, 19);\n }\n static bytes20(v) {\n return b(v, 20);\n }\n static bytes21(v) {\n return b(v, 21);\n }\n static bytes22(v) {\n return b(v, 22);\n }\n static bytes23(v) {\n return b(v, 23);\n }\n static bytes24(v) {\n return b(v, 24);\n }\n static bytes25(v) {\n return b(v, 25);\n }\n static bytes26(v) {\n return b(v, 26);\n }\n static bytes27(v) {\n return b(v, 27);\n }\n static bytes28(v) {\n return b(v, 28);\n }\n static bytes29(v) {\n return b(v, 29);\n }\n static bytes30(v) {\n return b(v, 30);\n }\n static bytes31(v) {\n return b(v, 31);\n }\n static bytes32(v) {\n return b(v, 32);\n }\n static address(v) {\n return new Typed(_gaurd, \"address\", v);\n }\n static bool(v) {\n return new Typed(_gaurd, \"bool\", !!v);\n }\n static bytes(v) {\n return new Typed(_gaurd, \"bytes\", v);\n }\n static string(v) {\n return new Typed(_gaurd, \"string\", v);\n }\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return value && value._typedSymbol === _typedSymbol;\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map","import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 22));\n }\n}\n//# sourceMappingURL=address.js.map","import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","import { defineProperties, isError, assert, assertArgument, assertArgumentCount, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof values === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => {\n func(staticWriter.length);\n });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\";\n const dynamic = length === -1 || coder.dynamic;\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? \" \" + this.localName : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", {\n buffer: reader.bytes,\n offset: count * WordSize,\n length: reader.dataLength,\n });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map","import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map","import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map","import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\".substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map","import { defineProperties, fromTwos, getBigInt, mask, toTwos, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = (signed ? \"int\" : \"uint\") + size * 8;\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, this.size * 8 - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map","import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = \"tuple(\" + types.join(\",\") + \")\";\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, {\n coders: Object.freeze(coders.slice()),\n });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map","import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.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 * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of ore in a single xcb.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const OrePerXCB = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") *\n BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nexport const NegativeOne = /*#__PURE__*/ BigInt(-1);\nexport const Zero = /*#__PURE__*/ BigInt(0);\nexport const One = /*#__PURE__*/ BigInt(1);\nexport const Two = /*#__PURE__*/ BigInt(2);\n//# sourceMappingURL=numbers.js.map","// NFKC (composed) // (decomposed)\n/**\n * A constant for the core symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const CoreSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Core Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Core Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map","import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n }),\n };\n}\n/**\n * Returns a [[AccessList]] from any corebcsupported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof set === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof value === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => a.address.localeCompare(b.address));\n return result;\n}\n//# sourceMappingURL=accesslist.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { recoverAddress } from \"./address.js\";\nimport { checkProperties } from \"../utils/properties.js\";\nimport { arrayify, stripZeros } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport * as RLP from \"../crypto/rlp.js\";\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst logger = new Logger(\"transaction/0.0.1\");\nconst BN_0 = BigInt(0);\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction parse(data) {\n const handleNumber = (value) => {\n // @ts-ignore\n if (value === \"0x\") {\n return BigNumber.from(0);\n }\n return BigNumber.from(value);\n };\n const transaction = RLP.decode(data);\n if (transaction.length !== 7 && transaction.length !== 8) {\n logger.throwArgumentError(\"invalid raw transaction\", \"data\", data);\n }\n const isSigned = transaction.length === 8;\n const tx = {\n nonce: Number(handleNumber(transaction[0])),\n energyPrice: handleNumber(transaction[1]).toBigInt(),\n energyLimit: handleNumber(transaction[2]).toBigInt(),\n networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(),\n to: handleAddress(transaction[isSigned ? 4 : 3]),\n value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(),\n data: transaction[isSigned ? 6 : 5],\n };\n if (transaction.length === 8) {\n const prefix = networkIdToPrefix(Number(tx.networkId));\n const digest = sha256(serialize(tx));\n tx.hash = sha256(serialize(tx, transaction[7]));\n tx.from = recoverAddress(digest, transaction[7], prefix);\n tx.signature = transaction[7];\n }\n return tx;\n}\nconst unsignedTransactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n { name: \"networkId\", maxLength: 32, numeric: true },\n];\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"networkId\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n networkId: true,\n data: true,\n energyLimit: true,\n energyPrice: true,\n nonce: true,\n to: true,\n value: true,\n};\nfunction serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) {\n let value = transaction[name] || [];\n const options = {};\n if (numeric) {\n options.hexPad = \"left\";\n }\n const tmpHexlified = hexlify(value, options);\n value = arrayify(tmpHexlified);\n // Fixed-width field\n if (length && value.length !== length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n // Variable-width (with a maximum)\n if (maxLength) {\n value = stripZeros(value);\n if (value.length > maxLength) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n }\n const hexlified = hexlify(value);\n raw.push(hexlified);\n });\n if (!!signature) {\n raw.push(hexlify(signature));\n }\n const finalValue = RLP.encode(raw);\n return finalValue;\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Core by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in corebc) 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 #to;\n #data;\n #nonce;\n #energyLimit;\n #energyPrice;\n #value;\n #networkId;\n #sig;\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n return this.#to;\n }\n set to(value) {\n this.#to = value == null ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() {\n return this.#nonce;\n }\n set nonce(value) {\n this.#nonce = getNumber(value, \"value\");\n }\n /**\n * The energy limit.\n */\n get energyLimit() {\n return this.#energyLimit;\n }\n set energyLimit(value) {\n this.#energyLimit = getBigInt(value);\n }\n /**\n * The energy 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 energyPrice() {\n const value = this.#energyPrice;\n if (value == null) {\n return BN_0;\n }\n return value;\n }\n set energyPrice(value) {\n this.#energyPrice = value == null ? null : getBigInt(value, \"energyPrice\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() {\n return this.#data;\n }\n set data(value) {\n this.#data = hexlify(value);\n }\n /**\n * The amount of xcb (in ore) to send in this transactions.\n */\n get value() {\n return this.#value;\n }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value);\n }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() {\n return this.#sig || null;\n }\n set signature(value) {\n this.#sig = value == null ? null : value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#to = null;\n this.#nonce = 0;\n this.#energyLimit = BigInt(0);\n this.#energyPrice = null;\n this.#data = \"0x\";\n this.#value = BigInt(0);\n this.#networkId = BigInt(0);\n this.#sig = 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 sha256(this.serialized);\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 sha256(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 const prefix = networkIdToPrefix(Number(this.#networkId));\n return recoverAddress(this.unsignedHash, this.signature, prefix);\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);\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 //isSigned(): this is SignedTransaction {\n return this.signature != null;\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 assert(this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n return serialize(this, this.signature);\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 serialize(this);\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 to: this.to,\n data: this.data,\n nonce: this.nonce,\n energyLimit: s(this.energyLimit),\n energyPrice: s(this.energyPrice),\n value: s(this.value),\n networkId: s(this.networkId),\n sig: this.signature ? this.signature : null,\n };\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 return Transaction.from(parse(payload));\n }\n const result = new Transaction();\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.energyLimit != null) {\n result.energyLimit = tx.energyLimit;\n }\n if (tx.energyPrice != null) {\n result.energyPrice = tx.energyPrice;\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.networkId != null) {\n result.networkId = tx.networkId;\n }\n if (tx.signature != null) {\n result.signature = tx.signature;\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 { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof message === \"string\") {\n message = toUtf8Bytes(message);\n }\n return sha256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message,\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig, prefix) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig, prefix);\n}\n//# sourceMappingURL=message.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument, } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = !!value ? \"0x01\" : \"0x00\";\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = match[1] === \"int\";\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) &&\n size % 8 === 0 &&\n size !== 0 &&\n size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map","import { getAddress } from \"../address/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\";\nimport { sha256 } from \"../crypto/index.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\");\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 networkId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\",\n};\nconst domainFieldNames = [\n \"name\",\n \"version\",\n \"networkId\",\n \"verifyingContract\",\n \"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 networkId: function (_value) {\n const value = getBigInt(_value, \"domain.networkId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.networkId\", _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] || \"256\");\n assertArgument(width % 8 === 0 &&\n width !== 0 &&\n width <= 256 &&\n (match[2] == null || 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\":\n return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\":\n return function (value) {\n return !value ? hexFalse : hexTrue;\n };\n case \"bytes\":\n return function (value) {\n return sha256(value);\n };\n case \"string\":\n return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields\n .map(({ name, type }) => type + \" \" + name)\n .join(\",\")})`;\n}\nexport class TypedDataEncoder {\n primaryType;\n #types;\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n constructor(types) {\n this.#types = JSON.stringify(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 Object.keys(types).forEach((type) => {\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\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 = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1] || null;\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\n .map((t) => JSON.stringify(t))\n .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]) +\n st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(sha256);\n }\n return sha256(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 sha256(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 encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return sha256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n return value.map((v) => this._visit(match[1], 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 visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\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 static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value),\n ]);\n }\n static hash(domain, types, value) {\n return sha256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\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 &&\n !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 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 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, prefix) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix);\n}\n//# sourceMappingURL=typed-data.js.map","/**\n * About frgaments...\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nvar _a;\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\",\n \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\",\n \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\",\n \"@\": \"AT\",\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() {\n return this.#offset;\n }\n get length() {\n return this.#tokens.length - this.#offset;\n }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() {\n return new _a(this.#tokens);\n }\n reset() {\n this.#offset = 0;\n }\n #subTokenString(from = 0, to = 0) {\n return new _a(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: t.match - from,\n linkBack: t.linkBack - from,\n linkNext: t.linkNext - from,\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return top != null && allowed.has(top) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return top.type === type ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\n_a = TokenString;\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = offset < text.length ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = {\n depth: brackets.length,\n linkBack: -1,\n linkNext: -1,\n match: -1,\n type: \"\",\n text: \"\",\n offset,\n value: -1,\n };\n tokens.push(token);\n let type = SimpleTokens[cur[0]] || \"\";\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n tokens[token.match].match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n tokens[tokens.length - 1].value =\n getNumber(value);\n }\n if (tokens.length === 0 ||\n tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n tokens[tokens.length - 1].text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a energy limit, returning a BigNumber or null if none\nfunction consumeEnergy(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid energy\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_corebc_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **PAramType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name,\n type,\n baseType,\n indexed,\n components,\n arrayLength,\n arrayChildren,\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n let result = {\n type: this.baseType === \"tuple\" ? \"tuple\" : this.type,\n name: this.name || undefined,\n };\n if (typeof this.indexed === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${this.arrayLength < 0 ? \"\" : String(this.arrayLength)}]`;\n }\n else {\n if (this.isTuple()) {\n if (format !== \"sighash\") {\n result += this.type;\n }\n result +=\n \"(\" +\n this.components\n .map((comp) => comp.format(format))\n .join(format === \"full\" ? \", \" : \",\") +\n \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /*\n * Returns true if %%value%% is an Array type.\n *\n * This provides a type gaurd ensuring that the\n * [[arrayChildren]] and [[arrayLength]] are non-null.\n */\n //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } {\n // return value && (value.baseType === \"array\")\n //}\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return this.baseType === \"array\";\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return this.baseType === \"tuple\";\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return this.indexed != null;\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => _this.arrayChildren.walk(v, process));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => _this.components[i].walk(v, process));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof value !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () {\n setValue(await result);\n })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS naes by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ParamType.from(lex(obj), allowIndexed);\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") ||\n obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = obj.peekType(\"ID\") ? obj.pop().text : \"\";\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof name === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components,\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" ||\n type.startsWith(\"tuple(\" /* fix: ) */) ||\n type.startsWith(\"(\" /* fix: ) */)) {\n const comps = obj.components != null\n ? obj.components.map((c) => ParamType.from(c))\n : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return value && value[internal] === ParamTypeInternal;\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof obj === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n }\n else if (typeof obj === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\",\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof name === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return (\"(\" +\n params.map((p) => p.format(format)).join(format === \"full\" ? \", \" : \",\") +\n \")\");\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === ErrorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return EventFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n static isFragment(value) {\n return value && value[internal] === EventFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n payable;\n energy;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, energy) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, {\n value: ConstructorFragmentInternal,\n });\n defineProperties(this, { payable, energy });\n }\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: this.payable ? \"payable\" : \"undefined\",\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n result.push(this.payable ? \"payable\" : \"nonpayable\");\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n return result.join(\" \");\n }\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ConstructorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, setify([\"payable\"])).has(\"payable\");\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, energy);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === ConstructorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n format(format) {\n const type = this.inputs.length === 0 ? \"receive\" : \"fallback\";\n if (format === \"json\") {\n const stateMutability = this.payable ? \"payable\" : \"nonpayable\";\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FallbackFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = obj.stateMutability === \"payable\";\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n static isFragment(value) {\n return value && value[internal] === FallbackFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The amount of energy to send when calling this function\n */\n energy;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, energy) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = stateMutability === \"view\" || stateMutability === \"pure\";\n const payable = stateMutability === \"payable\";\n defineProperties(this, {\n constant,\n energy,\n outputs,\n payable,\n stateMutability,\n });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: this.stateMutability !== \"nonpayable\"\n ? this.stateMutability\n : undefined,\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n }\n return result.join(\" \");\n }\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FunctionFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof obj.constant === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === FunctionFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n format() {\n throw new Error(\"@TODO\");\n }\n static from(obj) {\n if (typeof obj === \"string\") {\n return StructFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === StructFragmentInternal;\n }\n}\n//# sourceMappingURL=fragments.js.map","/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason],\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code],\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: tx.to ? getAddress(tx.to) : null,\n data: tx.data || \"0x\",\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action,\n data,\n reason,\n transaction,\n invocation,\n revert,\n });\n}\n/**\n * About AbiCoder\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, match[1] === \"int\", param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose));\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an corebc-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map","/**\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","/**\n * About Interface\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert, } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nexport { checkResultErrors, Result };\nexport class LogDescription {\n fragment;\n name;\n signature;\n topic;\n args;\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n signature,\n topic,\n args,\n });\n }\n}\nexport class TransactionDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n value;\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n value,\n });\n }\n}\nexport class ErrorDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n });\n }\n}\nexport class Indexed {\n hash;\n _isIndexed;\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n },\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n },\n },\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving xcb is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof fragments === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(\"EE\", error);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags),\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, {\n deploy: fragment,\n });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback ||\n fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\"),\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = minimal ? \"minimal\" : \"full\";\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = values.length > 0 ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength &&\n (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 &&\n values &&\n values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null ||\n Array.isArray(lastArg) ||\n typeof lastArg !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#functions.get(name), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#events.get(name), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#errors.get(name), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\n getSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n\n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n\n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n\n fragment = matches[0];\n }\n\n return dataSlice(id(fragment.format()), 0, 4);\n }\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if (bytes.length % 32 === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() },\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name,\n signature: ef.format(),\n args,\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args,\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n\n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n };\n\n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n*/\n // Create the filter for the event with search criteria (e.g. for xcb_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return sha256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof value === \"boolean\") {\n value = value ? \"0x01\" : \"0x00\";\n }\n if (param.type.match(/^u?int/)) {\n value = toBeHex(value);\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n //@TOOD should probably be return toHex(value, 32)\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", \"contract.\" + param.name, value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", \"contract.\" + param.name, value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(sha256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics,\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" ||\n param.type === \"bytes\" ||\n param.baseType === \"tuple\" ||\n param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt(tx.value != null ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof value === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // Maybe an interface from an older version, or from a symlinked copy\n if (typeof value.format === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map","import { concat, \n// dataSlice,\ngetBigInt,\n// encodeRlp\n } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { hexDataLength, hexDataSlice } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { removeHexPrefix } from \"../transaction/address.js\";\nimport { calculateCheckSum } from \"./index.js\";\nconst logger = new Logger(\"contract-address/0.0.1\");\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(from);\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\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 * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n const val = hexDataSlice(sha256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12);\n console.log({ \"contract-address/74=>should be string\": val });\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\n//# sourceMappingURL=contract-address.js.map","import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.corebc.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return value && typeof value.getAddress === \"function\";\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null ||\n result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof target !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target) {\n if (typeof target === \"string\") {\n return getAddress(target);\n // assert(resolver != null, \"ENS resolution requires a provider\",\n // \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n // return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof target.then === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map","import { defineProperties, getBigInt, getNumber, hexlify, resolveProperties, assert, assertArgument, isError, makeError, } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The energy price for legacy networks.\n */\n energyPrice;\n constructor(energyPrice) {\n defineProperties(this, {\n energyPrice: getValue(energyPrice),\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { energyPrice } = this;\n return {\n _type: \"FeeData\",\n energyPrice: toJson(energyPrice),\n };\n }\n}\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"networkId,energyLimit,energyPrice,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipReadEnabled = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Core.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total energy limit for this block.\n */\n energyLimit;\n /**\n * The total energy used in this block.\n */\n energyUsed;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per energy that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerEnergy;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof tx !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n nonce: block.nonce,\n difficulty: block.difficulty,\n energyLimit: block.energyLimit,\n energyUsed: block.energyUsed,\n miner: block.miner,\n extraData: block.extraData,\n baseFeePerEnergy: getValue(block.baseFeePerEnergy),\n });\n }\n /**\n * Returns the list of transaction hashes.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof tx === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions for blocks which\n * prefetched them, by passing ``true`` to %%prefetchTxs%%\n * into [[provider_getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof txs[0] === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\",\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this;\n return {\n _type: \"Block\",\n baseFeePerEnergy: toJson(baseFeePerEnergy),\n difficulty: toJson(difficulty),\n extraData,\n energyLimit: toJson(energyLimit),\n energyUsed: toJson(energyUsed),\n hash,\n miner,\n nonce,\n number,\n parentHash,\n timestamp,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++],\n done: false,\n };\n }\n return { value: undefined, done: true };\n },\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() {\n return this.#transactions.length;\n }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof indexOrHash === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof v === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash === hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof tx === \"string\") {\n return await this.provider.getTransaction(tx);\n }\n else {\n return tx;\n }\n }\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof indexOrHash === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Has this block been mined.\n *\n * If true, the block has been typed-gaurded that all mined\n * properties are non-null.\n */\n isMined() {\n return !!this.hash;\n }\n /**\n *\n */\n isLondon() {\n return !!this.baseFeePerEnergy;\n }\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\nexport class Log {\n provider;\n transactionHash;\n blockHash;\n blockNumber;\n removed;\n address;\n data;\n topics;\n index;\n transactionIndex;\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this;\n return {\n _type: \"log\",\n address,\n blockHash,\n blockNumber,\n data,\n index,\n removed,\n topics,\n transactionHash,\n transactionIndex,\n };\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\nexport class TransactionReceipt {\n provider;\n to;\n from;\n contractAddress;\n hash;\n index;\n blockHash;\n blockNumber;\n logsBloom;\n energyUsed;\n cumulativeEnergyUsed;\n energyPrice;\n type;\n //readonly byzantium!: boolean;\n status;\n root;\n #logs;\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n energyUsed: tx.energyUsed,\n cumulativeEnergyUsed: tx.cumulativeEnergyUsed,\n energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice),\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root,\n });\n }\n get logs() {\n return this.#logs;\n }\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,\n status, root, } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash,\n blockNumber,\n //byzantium,\n contractAddress,\n cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed),\n from,\n energyPrice: toJson(this.energyPrice),\n energyUsed: toJson(this.energyUsed),\n hash,\n index,\n logs,\n logsBloom,\n root,\n status,\n to,\n };\n }\n get length() {\n return this.logs.length;\n }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n },\n };\n }\n get fee() {\n return this.energyUsed * this.energyPrice;\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n async getResult() {\n return await this.provider.getTransactionResult(this.hash);\n }\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/*\nexport type ReplacementDetectionSetup = {\n to: string;\n from: string;\n value: bigint;\n data: string;\n nonce: number;\n block: number;\n};\n*/\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of energy this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n energyLimit;\n /**\n * The energy price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective energy price// (the fee per energy that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerEnergy]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of energy the transaction\n * consumes.\n */\n energyPrice;\n /**\n * The data.\n */\n data;\n /**\n * The value, in ore. Use [[formatXCB]] to format this value\n * as xcb.\n */\n value;\n /**\n * The chain ID.\n */\n networkId;\n /**\n * The signature.\n */\n signature;\n #startBlock;\n /**\n * Create a new TransactionResponse with %%tx%% parameters\n * connected to %%provider%%.\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null;\n this.blockHash = tx.blockHash != null ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.from = tx.from;\n this.to = tx.to || null;\n this.energyLimit = tx.energyLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.energyPrice = tx.energyPrice;\n this.networkId = tx.networkId;\n this.signature = tx.signature;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON representation of this transaction.\n */\n toJSON() {\n const { index, hash, type, to, from, nonce, data, signature } = this;\n return {\n _type: \"TransactionReceipt\",\n networkId: toJson(this.networkId),\n data,\n from,\n energyLimit: toJson(this.energyLimit),\n energyPrice: toJson(this.energyPrice),\n hash,\n nonce,\n signature,\n to,\n index,\n type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = _confirms == null ? 1 : _confirms;\n const timeout = _timeout == null ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = startBlock === -1 ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from),\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if (blockNumber - receipt.blockNumber + 1 < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data &&\n tx.to === this.to &&\n tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" &&\n tx.from === tx.to &&\n tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: reason === \"replaced\" || reason === \"cancelled\",\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt,\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (receipt) {\n if ((await receipt.confirmations()) >= confirms) {\n return receipt;\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => {\n cancellers.forEach((c) => c());\n };\n // On cancel, stop scanning for replacements\n cancellers.push(() => {\n stopScanning = true;\n });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => {\n clearTimeout(timer);\n });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n resolve(receipt);\n }\n };\n cancellers.push(() => {\n this.provider.off(this.hash, txListener);\n });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => {\n this.provider.off(\"block\", replaceListener);\n });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return this.blockHash != null;\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return this.type === 0;\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return {\n orphan: \"drop-log\",\n log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index,\n },\n };\n}\n//# sourceMappingURL=provider.js.map","import { Log, TransactionReceipt, TransactionResponse, } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\nexport class EventLog extends Log {\n interface;\n fragment;\n args;\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length\n ? this.#iface.getEvent(log.topics[0])\n : null;\n if (fragment) {\n return new EventLog(log, this.#iface, fragment);\n }\n else {\n return log;\n }\n });\n }\n}\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n async wait(confirms) {\n const receipt = await super.wait();\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\nexport class ContractUnknownEventPayload extends EventPayload {\n log;\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n async getBlock() {\n return await this.log.getBlock();\n }\n async getTransaction() {\n return await this.log.getTransaction();\n }\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map","import { Indexed, Interface, Typed } from \"../abi/index.js\";\nimport { resolveAddress } from \"../address/checks.js\";\nimport { copyRequest, Log, } from \"../providers/provider.js\";\nimport { defineProperties, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument, } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return value && typeof value.call === \"function\";\n}\nfunction canEstimate(value) {\n return value && typeof value.estimateEnergy === \"function\";\n}\nfunction canResolve(value) {\n return value && typeof value.resolveName === \"function\";\n}\nfunction canSend(value) {\n return value && typeof value.sendTransaction === \"function\";\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof value[feature] === \"function\") {\n return value;\n }\n if (value.provider && typeof value.provider[feature] === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(Typed.dereference(arg, \"overrides\"));\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from);\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n const iface = contract.interface;\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || (tx.value || BN_0) === BN_0, \"cannot send value to non-payable contract\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || (tx.data || \"0x\") === \"0x\", \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment in getFragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs),\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract,\n _key: key,\n getFragment,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment in defineProperty\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment in\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract,\n _key: key,\n getFragment,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_corebcInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value &&\n typeof value === \"object\" &&\n \"getTopicFilter\" in value &&\n typeof value.getTopicFilter === \"function\" &&\n value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof event === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics\n .map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n })\n .join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = addr ? addr : contract;\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment\n ? contract.interface.decodeEventLog(fragment, log.data, log.topics)\n : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n return count > 0;\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n target;\n interface;\n runner;\n filters;\n [internal];\n fallback;\n constructor(target, abi, runner, _deployTx) {\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof target === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, _prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = this.getEvent(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract event: ${prop}`);\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop)));\n },\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null,\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, _prop, receiver) => {\n if (_prop in target || passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = target.getFunction(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract method: ${prop}`);\n },\n has: (target, prop) => {\n if (prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(String(prop));\n },\n });\n }\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n async getAddress() {\n return await getInternal(this).addrPromise;\n }\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n async waitForDeployment() {\n // We have the deployement transaction; just use that (throws if deployement fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n getFunction(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n getEvent(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n async queryTransaction(hash) {\n // Is this useful?\n throw new Error(\"@TODO\");\n }\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = addr ? addr : await addrPromise;\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n return new EventLog(log, this.interface, foundFragment);\n }\n else {\n return new Log(log, provider);\n }\n });\n }\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners\n .map(({ listener }) => listener)\n .indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n 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 await this.off(event, listener);\n }\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map","import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\nimport { isBytes } from \"../utils/data.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\nexport class ContractFactory {\n interface;\n bytecode;\n runner;\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else if (typeof bytecode === \"string\") {\n bytecode = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecode = hexlify(bytecode);\n }\n else if (bytecode && typeof bytecode.object === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecode = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecode = \"!\";\n }\n defineProperties(this, {\n // @ts-ignore\n bytecode,\n interface: iface,\n runner: runner || null,\n });\n }\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([\n this.bytecode,\n this.interface.encodeDeploy(resolvedArgs),\n ]);\n return Object.assign({}, overrides, { data });\n }\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof this.runner.sendTransaction === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\",\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof output === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map","/**\n * @_ignore\n */\nimport { getAddress } from \"../address/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.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) {\n return (array) => {\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 number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n energyLimit: getBigInt,\n energyUsed: getBigInt,\n miner: allowNull(getAddress),\n extraData: formatData,\n baseFeePerEnergy: allowNull(getBigInt),\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 energyUsed: getBigInt,\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeEnergyUsed: getBigInt,\n effectiveEnergyPrice: allowNull(getBigInt),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0),\n}, {\n effectiveEnergyPrice: [\"energyPrice\"],\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 && !getAddress(value.to) && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n //confirmations: allowNull(getNumber, null),\n from: getAddress,\n maxFeePerEnergy: allowNull(getBigInt),\n energyLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n networkId: allowNull(getBigInt, null),\n }, {\n data: [\"input\"],\n energyLimit: [\"energy\"],\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 // Compute the signature\n if (value.signature) {\n result.signature = value.signature;\n }\n else {\n result.signature = value;\n }\n // Some backends omit networkId on legacy transactions, but we can compute it\n if (result.networkId == null) {\n const networkId = result.signature.legacynetworkId;\n if (networkId != null) {\n result.networkId = networkId;\n }\n }\n // @TODO: check networkId\n /*\n if (value.networkId != null) {\n let networkId = value.networkId;\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n result.networkId = networkId;\n\n } else {\n let networkId = value.networkId;\n\n // geth-etc returns networkId\n if (networkId == null && result.v == null) {\n networkId = value.networkId;\n }\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n if (typeof(networkId) !== \"number\" && result.v != null) {\n networkId = (result.v - 35) / 2;\n if (networkId < 0) { networkId = 0; }\n networkId = parseInt(networkId);\n }\n\n if (typeof(networkId) !== \"number\") { networkId = 0; }\n\n result.networkId = networkId;\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 { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nexport class NetworkPlugin {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\nexport class EnergyCostPlugin extends NetworkPlugin {\n effectiveBlock;\n txBase;\n txCreate;\n txDataZero;\n txDataNonzero;\n txAccessListStorageKey;\n txAccessListAddress;\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.corebc.network.plugins.EnergyCost#${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 clone() {\n return new EnergyCostPlugin(this.effectiveBlock, this);\n }\n}\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n constructor(feeDataFunc) {\n super(\"org.corebc.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\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 * About networks\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { getBigInt, assertArgument } from \"../utils/index.js\";\nimport { EnergyCostPlugin } from \"./plugins-network.js\";\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*/\n// Networks or clients with a higher need for security (such as clients\n// that may automatically make CCIP requests without user interaction)\n// can use this plugin to anonymize requests or intercept CCIP requests\n// to notify and/or receive authorization from the user\nconst Networks = new Map();\nexport class Network {\n #name;\n #networkId;\n #plugins;\n constructor(name, networkId) {\n this.#name = name;\n this.#networkId = getBigInt(networkId);\n this.#plugins = new Map();\n }\n toJSON() {\n return { name: this.name, networkId: String(this.networkId) };\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() {\n return this.#name;\n }\n set name(value) {\n this.#name = value;\n }\n /**\n * The network chain ID.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value, \"networkId\");\n }\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.networkId === 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.networkId === getBigInt(other);\n }\n catch (error) { }\n return false;\n }\n if (typeof other === \"object\") {\n if (other.networkId != null) {\n try {\n return this.networkId === getBigInt(other.networkId);\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.networkId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic energy required for a transaction.\n *\n * A EnergyCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicEnergy(tx) {\n const costs = this.getPlugin(\"org.corebc.plugins.network.EnergyCost\") || new EnergyCostPlugin();\n let energy = costs.txBase;\n if (tx.to == null) {\n energy += 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 energy += costs.txDataZero;\n }\n else {\n energy += costs.txDataNonzero;\n }\n }\n }\n return energy;\n }\n /**\n * Returns a new Network for the %%network%% name or networkId.\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.networkId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof network === \"object\") {\n assertArgument(typeof network.name === \"string\" &&\n typeof network.networkId === \"number\", \"invalid network object name or networkId\", \"network\", network);\n const custom = new Network(network.name, network.networkId);\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrnetworkId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrnetworkId, networkFunc) {\n if (typeof nameOrnetworkId === \"number\") {\n nameOrnetworkId = BigInt(nameOrnetworkId);\n }\n const existing = Networks.get(nameOrnetworkId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrnetworkId\", nameOrnetworkId);\n }\n Networks.set(nameOrnetworkId, networkFunc);\n }\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Core networks\n function registerEth(name, networkId, options) {\n const func = function () {\n const network = new Network(name, networkId);\n network.attachPlugin(new EnergyCostPlugin());\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(networkId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\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 registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map","import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * @TODO\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\",\n info: { event },\n });\n}\n// @TODO: refactor this\n/**\n * @TODO\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 constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n get pollingInterval() {\n return this.#interval;\n }\n set pollingInterval(value) {\n this.#interval = value;\n }\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\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) {\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n/**\n * @TODO\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\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 * @TODO\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 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 this.#blockNumber = blockNumber;\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\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 * About Subclassing the Provider...\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/checks.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 { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse, } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse, } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber, } from \"./subscriber-polling.js\";\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return value && typeof value.then === \"function\";\n}\nfunction getTag(prefix, value) {\n return (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 // 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}\nexport class UnmanagedSubscriber {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\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 \"pending\":\n case \"debug\":\n case \"error\":\n case \"network\": {\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 {\n type: \"orphan\",\n tag: getTag(\"orphan\", event),\n filter: copy(event),\n };\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));\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() {\n return new Date().getTime();\n}\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\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 // @TODO: This should be a () => Promise so network can be\n // done when needed; or rely entirely on _detectNetwork?\n constructor(_network) {\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(() => {\n this.emit(\"network\", network, null);\n }, 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.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get provider() {\n return this;\n }\n get plugins() {\n return Array.from(this.#plugins.values());\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 getPlugin(name) {\n return this.#plugins.get(name) || null;\n }\n get disableCcipRead() {\n return this.#disableCcipRead;\n }\n set disableCcipRead(value) {\n this.#disableCcipRead = !!value;\n }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\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 }, 250);\n }\n return await perform;\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\", {\n action: \"sendCcipReadFetchRequest\",\n request,\n index: i,\n urls,\n });\n let errorMessage = \"unknown error\";\n const resp = await request.send();\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchResult\",\n request,\n result,\n });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchError\",\n request,\n result,\n });\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\", {\n reason: \"404_MISSING_RESOURCE\",\n transaction: tx,\n info: { url, errorMessage },\n });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages\n .map((m) => JSON.stringify(m))\n .join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx,\n info: { urls, errorMessages },\n });\n }\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\",\n });\n }\n // Sub-classes should override this and handle PerformActionRequest requests, calling\n // the super for any unhandled actions.\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 _getAddress(address) {\n return resolveAddress(address);\n }\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"latest\":\n case \"pending\":\n case \"safe\":\n case \"finalized\":\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 _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:\n 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 _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]);\n if (isPromise(addr)) {\n promises.push((async function () {\n request[key] = await addr;\n })());\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 () {\n request.blockTag = await blockTag;\n })());\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 = this._detectNetwork().then((network) => {\n this.emit(\"network\", network, null);\n return network;\n }, (error) => {\n // Reset the networkPromise on failure, so we will try again\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\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, // Possibly an explicit Network\n this._detectNetwork(), // The actual connected network\n ]);\n if (expected.networkId !== actual.networkId) {\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.networkId} => ${actual.networkId} `, \"NETWORK_ERROR\", {\n event: \"changed\",\n });\n }\n }\n return expected.clone();\n }\n async getEnergyPrice() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async getFeeData() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async estimateEnergy(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateEnergy\",\n 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 return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead &&\n isCallException(error) &&\n error.data &&\n attempt >= 0 &&\n blockTag === \"latest\" &&\n transaction.to != null &&\n dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to);\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\",\n transaction,\n 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, // @TODO: populate data?\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\",\n transaction,\n info: { data: error.data, errorArgs: ccipArgs.errorArgs },\n });\n const tx = {\n to: txSender,\n data: concat([\n ccipArgs.selector,\n encodeBytes([ccipResult, ccipArgs.extraData]),\n ]),\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\", {\n action: \"receiveCcipReadCallResult\",\n transaction: Object.assign({}, tx),\n result,\n });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadCallError\",\n transaction: Object.assign({}, tx),\n error,\n });\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\",\n blockHash: block,\n 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\",\n blockTag,\n 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 effectiveEnergyPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.energyPrice == null && params.effectiveEnergyPrice == 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 effectiveEnergyPrice\");\n }\n params.effectiveEnergyPrice = tx.energyPrice;\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(networkId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\",\n });\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 _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 _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 _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n // Event API; sub-classes should override this; any supported\n // event filter will have been munged into an EventFilter\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 return new PollingBlockSubscriber(this);\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 _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\" &&\n emitArgs &&\n emitArgs.length > 0 &&\n 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 = {\n subscriber,\n tag,\n addressableMap,\n nameMap,\n started: false,\n listeners: [],\n };\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 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\n .map(({ listener }) => listener)\n .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 // Sub-classes should override this to shutdown any sockets, etc.\n // but MUST call this super.shutdown.\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 }\n get paused() {\n return this.#pausedState != null;\n }\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 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 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: \"\",\n urls: [],\n calldata: \"\",\n selector: \"\",\n extraData: \"\",\n 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\"\n .split(/,/)\n .map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map","/**\n * About Abstract Signer and subclassing\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/checks.js\";\nimport { getAddress } 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);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).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}\nexport class AbstractSigner {\n provider;\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.energyLimit == null) {\n pop.energyLimit = await this.estimateEnergy(pop);\n }\n // Populate the chain ID\n const network = await this.provider.getNetwork();\n if (pop.networkId != null) {\n const networkId = getBigInt(pop.networkId);\n assertArgument(networkId === network.networkId, \"transaction networkId mismatch\", \"tx.networkId\", tx.networkId);\n }\n else {\n pop.networkId = network.networkId;\n }\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n // We need to auto-detect the intended type of this transaction...\n if (feeData.energyPrice != null) {\n // Network doesn't support EIP-1559...\n // Populate missing fee data\n if (pop.energyPrice == null) {\n pop.energyPrice = feeData.energyPrice;\n }\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 //@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 estimateEnergy(tx) {\n return checkProvider(this, \"estimateEnergy\").estimateEnergy(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 return getAddress(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}\nexport class VoidSigner extends AbstractSigner {\n address;\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\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","/**\n * There are many awesome community services that provide Core\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in tht console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n}\n//# sourceMappingURL=community.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 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 _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\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\") ||\n error.operation !== \"xcb_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.networkId !== network.networkId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"xcb_getFilterChanges\", [\n filterId,\n ]);\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 this.#provider.send(\"xcb_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() {\n this.start();\n }\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 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(\"xcb_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(\"xcb_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 * About JSON-RPC...\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, 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\";\nimport { resolveAddress } from \"../address/checks.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) => {\n setTimeout(resolve, duration);\n });\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, // 10ms\n batchMaxSize: 1 << 20, // 1Mb\n batchMaxCount: 100, // 100 requests\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);\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 xcb_sendTransaction uses 90000 energy; 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.energyLimit == null) {\n promises.push((async () => {\n tx.energyLimit = await this.provider.estimateEnergy({\n ...tx,\n from: this.address,\n });\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);\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(\"xcb_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 const checkTx = async () => {\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 // Wait another 4 seconds\n this.provider._setTimeout(() => {\n checkTx();\n }, 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);\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(\"xcb_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),\n 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(\"xcb_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(),\n password,\n null,\n ]);\n }\n async _legacySignMessage(_message) {\n const message = typeof _message === \"string\" ? toUtf8Bytes(_message) : _message;\n return await this.provider.send(\"xcb_sign\", [\n this.address.toLowerCase(),\n 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 #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no hard in sending it immeidately\n const stallTime = this._getOption(\"batchMaxCount\") === 1\n ? 0\n : 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 // console.log({payload})\n const result = await this._send(payload);\n // console.log({result})\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\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 return reject(makeError(\"no response from server\", \"BAD_DATA\", {\n value: result,\n info: { payload },\n }));\n }\n // The response is an error\n if (\"error\" in resp) {\n return reject(this.getRpcError(payload, resp));\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);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n // Make sure any static network is compatbile with the provided netwrok\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (staticNetwork) {\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 {\n assert(false, \"sub-classes must override _send\", \"UNSUPPORTED_OPERATION\", {\n operation: \"jsonRpcApiProvider._send\"\n });\n }\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 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 return network;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n return Network.from(getBigInt(await this.send(\"xcb_networkId\", [])));\n }\n // We are not ready yet; use the primitive _send\n const payload = {\n id: this.#nextId++,\n method: \"xcb_networkId\",\n params: [],\n jsonrpc: \"2.0\",\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n }\n catch (error) {\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 /**\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) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n console.log(\"JsonRpcProvider failed to startup; retry in 1s\");\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() {\n return this.#notReady == null;\n }\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 [\n \"networkId\",\n \"energyLimit\",\n \"energyPrice\",\n \"type\",\n \"nonce\",\n \"value\",\n ].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"energyLimit\") {\n dstKey = \"energy\";\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 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 \"networkId\":\n return { method: \"xcb_networkId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"xcb_blockNumber\", args: [] };\n case \"getEnergyPrice\":\n return { method: \"xcb_energyPrice\", args: [] };\n case \"getBalance\": {\n return {\n method: \"xcb_getBalance\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n }\n case \"getTransactionCount\":\n return {\n method: \"xcb_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getCode\":\n return {\n method: \"xcb_getCode\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getStorage\":\n return {\n method: \"xcb_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: \"xcb_sendRawTransaction\",\n args: [req.signedTransaction],\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"xcb_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions],\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"xcb_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions],\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"xcb_getTransactionByHash\",\n args: [req.hash],\n };\n case \"getTransactionReceipt\":\n return {\n method: \"xcb_getTransactionReceipt\",\n args: [req.hash],\n };\n case \"call\":\n return {\n method: \"xcb_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag],\n };\n case \"estimateEnergy\": {\n return {\n method: \"xcb_estimateEnergy\",\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: \"xcb_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an CoreBC-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 === \"xcb_estimateEnergy\" && 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 }\n if (method === \"xcb_call\" || method === \"xcb_estimateEnergy\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException(method === \"xcb_call\" ? \"call\" : \"estimateEnergy\", payload.params[0], result ? result.data : null);\n e.info = { error, payload };\n return e;\n }\n // Only estimateEnergy 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\" &&\n error.message.match(/user denied|corebc-user-denied/i)) {\n const actionMap = {\n xcb_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n xcb_signTypedData_v4: \"signTypedData\",\n xcb_signTransaction: \"signTransaction\",\n xcb_sendTransaction: \"sendTransaction\",\n xcb_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 === \"xcb_sendRawTransaction\" ||\n method === \"xcb_sendTransaction\") {\n const transaction = payload.params[0];\n if (message.match(/insufficient funds|base fee exceeds energy limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction,\n 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\", {\n transaction,\n info: { error },\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) &&\n message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction,\n info: { error },\n });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method,\n info: { transaction, info: { error } },\n });\n }\n }\n if (message.match(/the method .* does not exist/i)) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method,\n info: { error },\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error });\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 networkId?? purge on switch_networks\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve,\n 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(\"xcb_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(\"xcb_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n}\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n this.#pollingInterval = 4000;\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() {\n return this.#pollingInterval;\n }\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. xcb_networkId) 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\" &&\n value.message.match(\"reverted\") &&\n 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 * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/xcb_goerli\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AnkrProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"xcb_sendRawTransaction\") {\n if (error &&\n error.error &&\n error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n}\n//# sourceMappingURL=provider-ankr.js.map","/**\n * About Alchemy\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.alchemyapi.io\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AlchemyProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash),\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = trace[0].error === \"Reverted\";\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null, // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", {\n value: trace,\n });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map","/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https://cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map","function getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map","/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\nexport class SocketSubscriber {\n #provider;\n #filter;\n get filter() {\n return JSON.parse(this.#filter);\n }\n #filterId;\n #paused;\n #emitPromise;\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider\n .send(\"xcb_subscribe\", this.filter)\n .then((filterId) => {\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n this.#filterId.then((filterId) => {\n this.#provider.send(\"xcb_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\nexport class SocketBlockSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\nexport class SocketPendingSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n get logFilter() {\n return JSON.parse(this.#logFilter);\n }\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * SocketProvider...\n *\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n constructor(network) {\n super(network, { batchMaxCount: 1 });\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n\n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n\n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n // Sub-classes must call this for each message\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (\"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result,\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result.method === \"xcb_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n }\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map","import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network) {\n super(network);\n if (typeof url === \"string\") {\n this.#connect = () => {\n return new _WebSocket(url);\n };\n this.#websocket = this.#connect();\n }\n else if (typeof url === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n*/\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map","/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret,\n });\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(networkId) {\n try {\n return new InfuraProvider(networkId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map","/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"corebc.quiknode.pro\";\n case \"arbitrum\":\n return \"corebc.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"corebc.arbitrum-goerli.quiknode.pro\";\n case \"matic\":\n return \"corebc.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"corebc.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"corebc.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"corebc.optimism-goerli.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(networkId) {\n try {\n return new QuickNodeProvider(networkId, this.token);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.token === defaultToken;\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map","/**\n * Explain all the nitty-gritty about the **FallbackProvider**.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { getBigInt, getNumber, assert, assertArgument, } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\nfunction getTime() {\n return new Date().getTime();\n}\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof value === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2,\n requests: 0,\n lateResponses: 0,\n errorResponses: 0,\n outOfSync: -1,\n unsupportedEvents: 0,\n rollingDuration: 0,\n score: 0,\n _network: null,\n _updateNumber: null,\n _totalTime: 0,\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + value.map(_normalize).join(\",\") + \"]\";\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{\" +\n keys\n .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`)\n .join(\",\") +\n \"}\");\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(value) {\n if (\"error\" in value) {\n const error = value.error;\n return { tag: _normalize(error), value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum &&\n (weight > bestWeight ||\n (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A Fallback Provider.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n quorum;\n eventQuorum;\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n constructor(providers, network) {\n super(network);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n this.quorum = 2; //Math.ceil(providers.length / 2);\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), \"quorum exceed provider wieght\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"networkId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"networkId\":\n return (await provider.getNetwork()).networkId;\n case \"estimateEnergy\":\n return await provider.estimateEnergy(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = \"blockHash\" in req ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getEnergyPrice\":\n return (await provider.getFeeData()).energyPrice;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => b.priority - a.priority);\n for (const config of allConfigs) {\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config,\n result: null,\n didBump: false,\n perform: null,\n staller: null,\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = getTime() - now;\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push(waitForSync(config, 0));\n promises.push((async () => {\n config._network = await config.provider.getNetwork();\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let networkId = null;\n for (const config of this.#configs) {\n const network = config._network;\n if (networkId == null) {\n networkId = network.networkId;\n }\n else if (network.networkId !== networkId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\",\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight,\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getEnergyPrice\":\n case \"estimateEnergy\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"networkId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`,\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: {\n request: req,\n results: Array.from(running).map((r) => stringify(r.result)),\n },\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => {\n try {\n const result = await provider._perform(req);\n return Object.assign(normalizeResult({ result }), { weight });\n }\n catch (error) {\n return Object.assign(normalizeResult({ error }), { weight });\n }\n }));\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) },\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n for (let i = 0; i < this.quorum; i++) {\n this.#addRunner(running, req);\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map","import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value &&\n typeof value.send === \"function\" &&\n typeof value.close === \"function\");\n}\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n if (typeof network === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if ((typeof network === \"string\" && network.match(/^wss?:/)) ||\n isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n const providers = [];\n if (options.alchemy !== \"-\") {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.ankr !== \"-\" && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.cloudflare !== \"-\") {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.infura !== \"-\") {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof projectId === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) {\n console.log(error);\n }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n*/\n if (options.quicknode !== \"-\") {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) {\n console.log(error);\n }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\",\n });\n if (providers.length === 1) {\n return providers[0];\n }\n return new FallbackProvider(providers);\n}\n//# sourceMappingURL=default-provider.js.map","import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nexport class NonceManager extends AbstractSigner {\n signer;\n #noncePromise;\n #delta;\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n increment() {\n this.#delta++;\n }\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n constructor(core, network) {\n super(network, { batchMaxCount: 1 });\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await core.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [\n {\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message },\n },\n ];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `corebc-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `corebc-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"xcb_accounts\", []);\n if (typeof address === \"number\") {\n return accounts.length > address;\n }\n address = address.toLowerCase();\n return (accounts.filter((a) => a.toLowerCase() === address).length !== 0);\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n //const resp =\n await this.#request(\"xcb_requestAccounts\", []);\n //console.log(\"RESP\", resp);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n}\n//# sourceMappingURL=provider-browser.js.map","/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, {\n applicationId,\n applicationSecret,\n });\n }\n _getProvider(networkId) {\n try {\n return new PocketProvider(networkId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return this.applicationId === defaultApplicationId;\n }\n}\n//# sourceMappingURL=provider-pocket.js.map","const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map","import { getAddress } from \"../address/index.js\";\nimport { hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, resolveProperties, assert, assertArgument, } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n prefix;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor({ signingKey, prefix, provider, }) {\n super(provider);\n this.prefix = prefix;\n assertArgument(signingKey && typeof signingKey.sign === \"function\", \"invalid signingKey key\", \"signingKey\", \"[ REDACTED ]\");\n this.#signingKey = signingKey;\n const address = computeAddress(this.#signingKey, prefix);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() {\n return this.#signingKey;\n }\n /**\n * The private key for this wallet.\n */\n get privateKey() {\n return this.signingKey.privateKey;\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new BaseWallet({\n signingKey: this.#signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n async signTransaction(tx) {\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: tx.to || undefined,\n from: tx.from || undefined,\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress(tx.from) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n const unSignedSerialized = btx.unsignedSerialized;\n const unsignedHash = sha256(unSignedSerialized);\n // sha256(btx.unsignedSerialized)\n btx.signature = this.signingKey.sign(unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name },\n });\n const address = getAddress(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name,\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value));\n }\n}\n//# sourceMappingURL=base-wallet.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Er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:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"en\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map","/*! https://mths.be/utf8js v3.0.0 by @mathias */\n;(function(root) {\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tthrow Error(\n\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t' is not a scalar value'\n\t\t\t);\n\t\t}\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tcheckScalarValue(codePoint);\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string) {\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol() {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\tcheckScalarValue(codePoint);\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString) {\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol()) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\troot.version = '3.0.0';\n\troot.encode = utf8encode;\n\troot.decode = utf8decode;\n\n}(typeof exports === 'undefined' ? this.utf8 = {} : exports));\n","import { Buffer } from \"buffer\";\nimport { pbkdf2Sync } from \"../crypto/crypto.js\";\nimport utf8 from \"utf8\";\nexport function mnemonicToSeed(mnemonic, password) {\n if (!password) {\n password = \"\";\n }\n const t = generateSeed(mnemonic, password);\n return t.goldilock;\n}\nconst generateSeed = (mnemonic, password) => {\n const goldilockSaltPrefix = \"mnemonic\";\n const aesSaltPrefix = \"mnemonicfortheAESkey\";\n const goldilockSalt = utf8.encode(goldilockSaltPrefix + password);\n const aesSalt = utf8.encode(aesSaltPrefix + password);\n const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(goldilockSalt), 2048, 64, \"sha512\");\n const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(aesSalt), 2048, 64, \"sha512\");\n return {\n aes: Buffer.from(aesKeySeed).toString(\"hex\"),\n goldilock: Buffer.from(goldilockKey).toString(\"hex\"),\n };\n};\n//# sourceMappingURL=mnemonicToSeed.js.map","import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { legacySha256 } from \"../crypto/sha3.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return (((1 << bits) - 1) << (8 - bits)) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset++;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) &\n getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n return mnemonicToSeed(this.phrase, this.password);\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase({ phrase, password, wordlist, }) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingURL=mnemonic.js.map","/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */\n(function(root) {\n \"use strict\";\n\n function checkInt(value) {\n return (parseInt(value) === value);\n }\n\n function checkInts(arrayish) {\n if (!checkInt(arrayish.length)) { return false; }\n\n for (var i = 0; i < arrayish.length; i++) {\n if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {\n return false;\n }\n }\n\n return true;\n }\n\n function coerceArray(arg, copy) {\n\n // ArrayBuffer view\n if (arg.buffer && arg.name === 'Uint8Array') {\n\n if (copy) {\n if (arg.slice) {\n arg = arg.slice();\n } else {\n arg = Array.prototype.slice.call(arg);\n }\n }\n\n return arg;\n }\n\n // It's an array; check it is a valid representation of a byte\n if (Array.isArray(arg)) {\n if (!checkInts(arg)) {\n throw new Error('Array contains invalid value: ' + arg);\n }\n\n return new Uint8Array(arg);\n }\n\n // Something else, but behaves like an array (maybe a Buffer? Arguments?)\n if (checkInt(arg.length) && checkInts(arg)) {\n return new Uint8Array(arg);\n }\n\n throw new Error('unsupported array-like object');\n }\n\n function createArray(length) {\n return new Uint8Array(length);\n }\n\n function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {\n if (sourceStart != null || sourceEnd != null) {\n if (sourceArray.slice) {\n sourceArray = sourceArray.slice(sourceStart, sourceEnd);\n } else {\n sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);\n }\n }\n targetArray.set(sourceArray, targetStart);\n }\n\n\n\n var convertUtf8 = (function() {\n function toBytes(text) {\n var result = [], i = 0;\n text = encodeURI(text);\n while (i < text.length) {\n var c = text.charCodeAt(i++);\n\n // if it is a % sign, encode the following 2 bytes as a hex value\n if (c === 37) {\n result.push(parseInt(text.substr(i, 2), 16))\n i += 2;\n\n // otherwise, just the actual byte\n } else {\n result.push(c)\n }\n }\n\n return coerceArray(result);\n }\n\n function fromBytes(bytes) {\n var result = [], i = 0;\n\n while (i < bytes.length) {\n var c = bytes[i];\n\n if (c < 128) {\n result.push(String.fromCharCode(c));\n i++;\n } else if (c > 191 && c < 224) {\n result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f)));\n i += 2;\n } else {\n result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f)));\n i += 3;\n }\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n var convertHex = (function() {\n function toBytes(text) {\n var result = [];\n for (var i = 0; i < text.length; i += 2) {\n result.push(parseInt(text.substr(i, 2), 16));\n }\n\n return result;\n }\n\n // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html\n var Hex = '0123456789abcdef';\n\n function fromBytes(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i++) {\n var v = bytes[i];\n result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]);\n }\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n\n // Number of rounds by keysize\n var numberOfRounds = {16: 10, 24: 12, 32: 14}\n\n // Round constant words\n var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n\n // S-box and Inverse S-box (S is for Substitution)\n var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x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x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n\n // Transformations for encryption\n var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\n var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\n var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\n var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n\n // Transformations for decryption\n var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\n var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\n var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\n var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n\n // Transformations for decryption key expansion\n var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\n var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\n var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\n var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\n\n function convertToInt32(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i += 4) {\n result.push(\n (bytes[i ] << 24) |\n (bytes[i + 1] << 16) |\n (bytes[i + 2] << 8) |\n bytes[i + 3]\n );\n }\n return result;\n }\n\n var AES = function(key) {\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n Object.defineProperty(this, 'key', {\n value: coerceArray(key, true)\n });\n\n this._prepare();\n }\n\n\n AES.prototype._prepare = function() {\n\n var rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new Error('invalid key size (must be 16, 24 or 32 bytes)');\n }\n\n // encryption round keys\n this._Ke = [];\n\n // decryption round keys\n this._Kd = [];\n\n for (var i = 0; i <= rounds; i++) {\n this._Ke.push([0, 0, 0, 0]);\n this._Kd.push([0, 0, 0, 0]);\n }\n\n var roundKeyCount = (rounds + 1) * 4;\n var KC = this.key.length / 4;\n\n // convert the key into ints\n var tk = convertToInt32(this.key);\n\n // copy values into round key arrays\n var index;\n for (var i = 0; i < KC; i++) {\n index = i >> 2;\n this._Ke[index][i % 4] = tk[i];\n this._Kd[rounds - index][i % 4] = tk[i];\n }\n\n // key expansion (fips-197 section 5.2)\n var rconpointer = 0;\n var t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[ tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (var i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n } else {\n for (var i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n\n tk[KC / 2] ^= (S[ tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n\n for (var i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n\n // copy values into round key arrays\n var i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n this._Ke[r][c] = tk[i];\n this._Kd[rounds - r][c] = tk[i++];\n t++;\n }\n }\n\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (var r = 1; r < rounds; r++) {\n for (var c = 0; c < 4; c++) {\n tt = this._Kd[r][c];\n this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[ tt & 0xFF]);\n }\n }\n }\n\n AES.prototype.encrypt = function(plaintext) {\n if (plaintext.length != 16) {\n throw new Error('invalid plaintext size (must be 16 bytes)');\n }\n\n var rounds = this._Ke.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(plaintext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Ke[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T1[(t[ i ] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[ t[(i + 3) % 4] & 0xff] ^\n this._Ke[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Ke[rounds][i];\n result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n AES.prototype.decrypt = function(ciphertext) {\n if (ciphertext.length != 16) {\n throw new Error('invalid ciphertext size (must be 16 bytes)');\n }\n\n var rounds = this._Kd.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(ciphertext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Kd[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T5[(t[ i ] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[ t[(i + 1) % 4] & 0xff] ^\n this._Kd[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Kd[rounds][i];\n result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n\n /**\n * Mode Of Operation - Electonic Codebook (ECB)\n */\n var ModeOfOperationECB = function(key) {\n if (!(this instanceof ModeOfOperationECB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Electronic Code Block\";\n this.name = \"ecb\";\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationECB.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n block = this._aes.encrypt(block);\n copyArray(block, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationECB.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n copyArray(block, plaintext, i);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Block Chaining (CBC)\n */\n var ModeOfOperationCBC = function(key, iv) {\n if (!(this instanceof ModeOfOperationCBC)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Block Chaining\";\n this.name = \"cbc\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastCipherblock = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCBC.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n\n for (var j = 0; j < 16; j++) {\n block[j] ^= this._lastCipherblock[j];\n }\n\n this._lastCipherblock = this._aes.encrypt(block);\n copyArray(this._lastCipherblock, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n\n for (var j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ this._lastCipherblock[j];\n }\n\n copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Feedback (CFB)\n */\n var ModeOfOperationCFB = function(key, iv, segmentSize) {\n if (!(this instanceof ModeOfOperationCFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Feedback\";\n this.name = \"cfb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 size)');\n }\n\n if (!segmentSize) { segmentSize = 1; }\n\n this.segmentSize = segmentSize;\n\n this._shiftRegister = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCFB.prototype.encrypt = function(plaintext) {\n if ((plaintext.length % this.segmentSize) != 0) {\n throw new Error('invalid plaintext size (must be segmentSize bytes)');\n }\n\n var encrypted = coerceArray(plaintext, true);\n\n var xorSegment;\n for (var i = 0; i < encrypted.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n for (var j = 0; j < this.segmentSize; j++) {\n encrypted[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return encrypted;\n }\n\n ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {\n if ((ciphertext.length % this.segmentSize) != 0) {\n throw new Error('invalid ciphertext size (must be segmentSize bytes)');\n }\n\n var plaintext = coerceArray(ciphertext, true);\n\n var xorSegment;\n for (var i = 0; i < plaintext.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n plaintext[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return plaintext;\n }\n\n /**\n * Mode Of Operation - Output Feedback (OFB)\n */\n var ModeOfOperationOFB = function(key, iv) {\n if (!(this instanceof ModeOfOperationOFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Output Feedback\";\n this.name = \"ofb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastPrecipher = coerceArray(iv, true);\n this._lastPrecipherIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationOFB.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._lastPrecipherIndex === 16) {\n this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);\n this._lastPrecipherIndex = 0;\n }\n encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;\n\n\n /**\n * Counter object for CTR common mode of operation\n */\n var Counter = function(initialValue) {\n if (!(this instanceof Counter)) {\n throw Error('Counter must be instanitated with `new`');\n }\n\n // We allow 0, but anything false-ish uses the default 1\n if (initialValue !== 0 && !initialValue) { initialValue = 1; }\n\n if (typeof(initialValue) === 'number') {\n this._counter = createArray(16);\n this.setValue(initialValue);\n\n } else {\n this.setBytes(initialValue);\n }\n }\n\n Counter.prototype.setValue = function(value) {\n if (typeof(value) !== 'number' || parseInt(value) != value) {\n throw new Error('invalid counter value (must be an integer)');\n }\n\n // We cannot safely handle numbers beyond the safe range for integers\n if (value > Number.MAX_SAFE_INTEGER) {\n throw new Error('integer value out of safe range');\n }\n\n for (var index = 15; index >= 0; --index) {\n this._counter[index] = value % 256;\n value = parseInt(value / 256);\n }\n }\n\n Counter.prototype.setBytes = function(bytes) {\n bytes = coerceArray(bytes, true);\n\n if (bytes.length != 16) {\n throw new Error('invalid counter bytes size (must be 16 bytes)');\n }\n\n this._counter = bytes;\n };\n\n Counter.prototype.increment = function() {\n for (var i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n\n\n /**\n * Mode Of Operation - Counter (CTR)\n */\n var ModeOfOperationCTR = function(key, counter) {\n if (!(this instanceof ModeOfOperationCTR)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Counter\";\n this.name = \"ctr\";\n\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter)\n }\n\n this._counter = counter;\n\n this._remainingCounter = null;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCTR.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = this._aes.encrypt(this._counter._counter);\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;\n\n\n ///////////////////////\n // Padding\n\n // See:https://tools.ietf.org/html/rfc2315\n function pkcs7pad(data) {\n data = coerceArray(data, true);\n var padder = 16 - (data.length % 16);\n var result = createArray(data.length + padder);\n copyArray(data, result);\n for (var i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n }\n\n function pkcs7strip(data) {\n data = coerceArray(data, true);\n if (data.length < 16) { throw new Error('PKCS#7 invalid length'); }\n\n var padder = data[data.length - 1];\n if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); }\n\n var length = data.length - padder;\n for (var i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new Error('PKCS#7 invalid padding byte');\n }\n }\n\n var result = createArray(length);\n copyArray(data, result, 0, 0, length);\n return result;\n }\n\n ///////////////////////\n // Exporting\n\n\n // The block cipher\n var aesjs = {\n AES: AES,\n Counter: Counter,\n\n ModeOfOperation: {\n ecb: ModeOfOperationECB,\n cbc: ModeOfOperationCBC,\n cfb: ModeOfOperationCFB,\n ofb: ModeOfOperationOFB,\n ctr: ModeOfOperationCTR\n },\n\n utils: {\n hex: convertHex,\n utf8: convertUtf8\n },\n\n padding: {\n pkcs7: {\n pad: pkcs7pad,\n strip: pkcs7strip\n }\n },\n\n _arrayTest: {\n coerceArray: coerceArray,\n createArray: createArray,\n copyArray: copyArray,\n }\n };\n\n\n // node.js\n if (typeof exports !== 'undefined') {\n module.exports = aesjs\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define([], function() { return aesjs; });\n\n // Web Browsers\n } else {\n\n // If there was an existing library at \"aesjs\" make sure it's still available\n if (root.aesjs) {\n aesjs._aesjs = root.aesjs;\n }\n\n root.aesjs = aesjs;\n }\n\n\n})(this);\n","/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof hexString === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = \"0\" + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof password === \"string\") {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = match[4] === \"!\";\n let cur = object;\n for (const comp of path.toLowerCase().split(\".\")) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof cur === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof cur === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof cur) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map","/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Core along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { Counter, ModeOfOperation: { ctr: CTR }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from \"../crypto/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nimport { computeAddress, extractPrefix } from \"../transaction/address.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = data.version != null ? parseInt(data.version) : 0;\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, new Counter(iv));\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\",\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n const expectedMAC = spelunk(data, \"crypto.mac:string!\");\n let difference = 0;\n const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC);\n if (validMAC) {\n const actual = getBytes(\"0x\" + computedMAC);\n const expected = getBytes(\"0x\" + expectedMAC);\n for (let i = 0; i < actual.length; i++)\n difference |= actual[i] ^ expected[i];\n }\n assertArgument(validMAC && difference === 0, \"incorrect password\", \"password\", \"[REDACTED]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = getAddress(data.address);\n const prefix = extractPrefix(address);\n if (computeAddress(privateKey, prefix) !== address) {\n throw new Error(\"address mismatch\");\n }\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-corebc.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-corebc.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-corebc.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n account.mnemonic = {\n path: spelunk(data, \"x-corebc.path:string\") || defaultPath,\n locale: spelunk(data, \"x-corebc.locale:string\") || \"en\",\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))),\n };\n }\n return account;\n}\n// Match Core Web3Dart's wallet KDF resource limits.\nfunction validateScrypt(N, r, p) {\n assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, \"unsafe scrypt N\", \"kdf.N\", N);\n assertArgument(Number.isSafeInteger(r) &&\n Number.isSafeInteger(p) &&\n r > 0 &&\n p > 0 &&\n r * p <= 1048576 &&\n 128 * N * r <= 256 * 1024 * 1024, \"unsafe scrypt work or memory requirement\", \"kdf\", { N, r, p });\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof kdf === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n validateScrypt(N, r, p);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(prf === \"hmac-sha256\" || prf === \"hmac-sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, \"unsafe PBKDF2 iteration count\", \"kdf.c\", count);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return {\n name: \"pbkdf2\",\n salt,\n count,\n dkLen,\n algorithm: algorithm,\n };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = options.salt != null\n ? getBytes(options.salt, \"options.salt\")\n : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = 1 << 17, r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N != null) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r != null) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p != null) {\n p = options.scrypt.p;\n }\n }\n validateScrypt(N, r, p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = options.iv != null ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = options.uuid != null\n ? getBytes(options.uuid, \"options.uuid\")\n : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, new Counter(iv));\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = sha256(concat([macPrefix, ciphertext]));\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r,\n },\n mac: mac.substring(2),\n },\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = options.client != null ? options.client : `corebc/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = now.getUTCFullYear() +\n \"-\" +\n zpad(now.getUTCMonth() + 1, 2) +\n \"-\" +\n zpad(now.getUTCDate(), 2) +\n \"T\" +\n zpad(now.getUTCHours(), 2) +\n \"-\" +\n zpad(now.getUTCMinutes(), 2) +\n \"-\" +\n zpad(now.getUTCSeconds(), 2) +\n \".0Z\";\n const gethFilename = \"UTC--\" + timestamp + \"--\" + data.address;\n data[\"x-corebc\"] = {\n client,\n gethFilename,\n path,\n locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\",\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map","/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { dataSlice, defineProperties, getNumber, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\nimport { Ed448Goldilock } from \"../crypto/crypto.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// import { arrayify,\n// // hexDataSlice\n// } from \"../utils/data.js\";\n// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array {\n// const p = getBytes(password);\n// const s = getBytes(salt);\n// return getBytes(pbkdf2(p, s, 2048, 57, \"sha512\"));\n// }\n/**\n * The default derivation path for Core HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m\";\n// \"Bitcoin seed\"\n// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\n// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array {\n// b = getBytes(concat([b.slice(0, 53), \"0x00000000\"]));\n// b[0] &= 0xfc;\n// const c = new Uint8Array(57);\n// let hold = 0;\n// for (let i = 0; i < 57; i++) {\n// hold += a[i] + b[i];\n// c[i] = hold % 256;\n// hold = Math.floor(hold / 256);\n// }\n// return c;\n// };\nconst _guard = {};\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0 && (components[0] === \"m\" || node.depth > 0), \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n prefix;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n #seed;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) {\n super({\n signingKey,\n prefix,\n provider,\n });\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.publicKey });\n this.prefix = prefix;\n this.#seed = seed;\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint,\n fingerprint,\n path,\n index,\n depth,\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet({\n guard: _guard,\n signingKey: this.signingKey,\n parentFingerprint: this.parentFingerprint,\n path: this.path,\n index: this.index,\n depth: this.depth,\n seed: this.#seed,\n mnemonic: this.mnemonic,\n provider,\n prefix: this.prefix,\n });\n }\n #account() {\n const account = {\n address: this.address,\n privateKey: this.privateKey,\n };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy,\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, {\n progressCallback,\n });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() {\n return this.path != null;\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index));\n const newSigningKey = new SigningKey(newPrivateKey);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (_index & ~HardenedBit);\n if (_index & HardenedBit) {\n path += \"'\";\n }\n }\n return new HDNodeWallet({\n guard: _guard,\n signingKey: newSigningKey,\n parentFingerprint: this.fingerprint,\n path,\n index: _index,\n seed: this.#seed,\n depth: this.depth + 1,\n mnemonic: this.mnemonic,\n provider: this.provider,\n prefix: this.prefix,\n });\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed({ _seed, mnemonic, prefix, path, }) {\n const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0);\n const signingKey = new SigningKey(extendetPrivateKey);\n // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length })\n return new HDNodeWallet({\n seed: _seed,\n guard: _guard,\n signingKey,\n parentFingerprint: \"0x00000000\",\n path: path || defaultPath,\n index: 0,\n depth: 0,\n mnemonic,\n provider: null,\n prefix,\n });\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(prefix, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist);\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Create am HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, prefix, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n static mnemonicToSeed(mnemonic, password) {\n const seed = mnemonicToSeed(mnemonic, password);\n return seed;\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, password, path, wordlist, }) {\n if (!password) {\n password = \"\";\n }\n if (!path) {\n path = defaultPath;\n }\n if (!wordlist) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist });\n const _seed = mnemonic.computeSeed();\n return HDNodeWallet.#fromSeed({\n _seed,\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed({ seed, prefix, path, }) {\n return HDNodeWallet.#fromSeed({\n _seed: seed,\n mnemonic: null,\n path: path || defaultPath,\n prefix,\n });\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the acount at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map","/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n/**\n * Before Core launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive xcb\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Core Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && encseed.length % 16 === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map","import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { defaultPath, HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson, } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { extractPrefix } from \"../transaction/address.js\";\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected\n * to %%provider%%.\n */\n constructor({ key, prefix, provider, }) {\n if (typeof key === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = typeof key === \"string\" ? new SigningKey(key) : key;\n super({\n signingKey,\n prefix,\n provider,\n });\n }\n connect(provider) {\n return new Wallet({\n key: this.signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n const address = account.address;\n const prefix = extractPrefix(address);\n if (\"mnemonic\" in account &&\n account.mnemonic &&\n account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path);\n if (wallet.address === account.address &&\n wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet({\n key: account.privateKey,\n prefix,\n });\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the avavilable\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(prefix, provider) {\n const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, provider, password, }) {\n const wallet = HDNodeWallet.fromPhrase({\n phrase,\n prefix,\n password,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n static fromSeed({ seed, prefix, provider, path, }) {\n const wallet = HDNodeWallet.fromSeed({\n seed,\n prefix,\n path: path || defaultPath,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map","import { Contract } from \"../contract/index.js\";\nexport const customUnitAbi = Object.freeze([\n \"function supportsUnit(string unit) view returns (bool)\",\n \"function supportedUnits() view returns (string[])\",\n \"function preferredUnit() view returns (string)\",\n \"function balanceOf(address account) view returns (uint256)\",\n \"function balanceOfUnit(address account, string unit) view returns (uint256)\",\n]);\nexport class CustomUnitDiscovery {\n preferredUnit;\n supportedUnits;\n constructor(units, preferredUnit) {\n this.preferredUnit = preferredUnit;\n this.supportedUnits = Object.freeze([...units]);\n }\n get isValid() {\n return (this.supports(\"units\") &&\n this.preferredUnit !== \"\" &&\n this.supports(this.preferredUnit));\n }\n supports(unit) {\n return this.supportedUnits.includes(unit);\n }\n}\n/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */\nexport class CustomUnitBalance {\n canonicalAmount;\n unitAmount;\n unit;\n constructor(canonicalAmount, unitAmount, unit) {\n this.canonicalAmount = canonicalAmount;\n this.unitAmount = unitAmount;\n this.unit = unit;\n }\n get multiplierNumerator() {\n return this.unitAmount;\n }\n get multiplierDenominator() {\n return this.canonicalAmount;\n }\n}\n/** Core custom-unit contract convention used by Tone and Core API. */\nexport class CustomUnitToken {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, customUnitAbi, runner);\n }\n async supportsUnit(unit, blockTag) {\n return (unit.trim() !== \"\" &&\n (await this.contract.supportsUnit(unit.trim(), { blockTag })));\n }\n async supportedUnits(blockTag) {\n return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag })));\n }\n async preferredUnit(blockTag) {\n return (await this.contract.preferredUnit({ blockTag })).trim();\n }\n async discover(blockTag) {\n if (!(await this.supportsUnit(\"units\", blockTag)))\n return null;\n const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag));\n return discovery.isValid ? discovery : null;\n }\n canonicalBalance(account, blockTag) {\n return this.contract.balanceOf(account, { blockTag });\n }\n balanceOfUnit(account, unit, blockTag) {\n if (!unit.trim())\n throw new TypeError(\"unit must not be empty\");\n return this.contract.balanceOfUnit(account, unit.trim(), { blockTag });\n }\n async balance(account, unit, blockTag) {\n const resolved = unit?.trim() || (await this.preferredUnit(blockTag));\n const [canonical, calculated] = await Promise.all([\n this.canonicalBalance(account, blockTag),\n this.balanceOfUnit(account, resolved, blockTag),\n ]);\n return new CustomUnitBalance(canonical, calculated, resolved);\n }\n}\n//# sourceMappingURL=custom-units.js.map","import { Contract } from \"../contract/index.js\";\n/** On-chain interface defined by CIP-150. */\nexport const cip150Abi = Object.freeze([\n \"function getMetadataValue(string key) view returns (string value)\",\n \"function hasMetadataKey(string key) view returns (bool exists)\",\n \"function isMetadataSealed(string key) view returns (bool sealed)\",\n \"function listMetadataKeys() view returns (string[] keys)\",\n \"function getMetadataByIndex(uint256 index) view returns (string key, string value)\",\n \"function metadataCount() view returns (uint256 total)\",\n \"function setMetadataValue(string key, string value)\",\n \"function sealMetadataKey(string key)\",\n]);\nexport const cip151TokenExpirationKey = \"tokenExpiration\";\nexport const cip151TradingStopKey = \"tradingStop\";\nexport const cip152LabKey = \"lab\";\n/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */\nexport class Cip151Lifecycle {\n tokenExpiration;\n tradingStop;\n constructor(metadata = {}) {\n const parse = (key) => {\n const value = metadata[key];\n if (value == null || value === \"\")\n return null;\n if (!/^\\d+$/.test(value))\n throw new TypeError(`${key} must be a non-negative Unix timestamp`);\n return BigInt(value);\n };\n this.tokenExpiration = parse(cip151TokenExpirationKey);\n this.tradingStop = parse(cip151TradingStopKey);\n }\n isExpiredAt(seconds) {\n return this.tokenExpiration !== null && seconds >= this.tokenExpiration;\n }\n isTradingStoppedAt(seconds) {\n return this.tradingStop !== null && seconds >= this.tradingStop;\n }\n}\n/** Validates certificate structure, not the authenticity of its issuer. */\nexport class Cip152LabCertificate {\n measurements;\n constructor(json) {\n if (json === null || typeof json !== \"object\" || Array.isArray(json))\n throw new TypeError(\"CIP-152 lab.json must be an object\");\n const measurements = Object.create(null);\n for (const [key, property] of Object.entries(json)) {\n if (!property ||\n typeof property !== \"object\" ||\n Array.isArray(property) ||\n !Object.hasOwn(property, \"value\"))\n throw new TypeError(`CIP-152 property ${key} must contain a value`);\n const { value, unit } = property;\n if (!(typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value))))\n throw new TypeError(`CIP-152 property ${key} has an invalid value`);\n if (unit != null && typeof unit !== \"string\")\n throw new TypeError(`CIP-152 property ${key} has an invalid unit`);\n measurements[key] = Object.freeze(unit == null ? { value } : { value, unit });\n }\n this.measurements = Object.freeze(measurements);\n }\n}\n/** Typed metadata reader and writer. Writes require a signer as runner. */\nexport class Cip150MetadataContract {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, cip150Abi, runner);\n }\n getValue(key, blockTag) {\n return this.contract.getMetadataValue(key, { blockTag });\n }\n hasKey(key, blockTag) {\n return this.contract.hasMetadataKey(key, { blockTag });\n }\n isSealed(key, blockTag) {\n return this.contract.isMetadataSealed(key, { blockTag });\n }\n async listKeys(blockTag) {\n return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag })));\n }\n async getByIndex(index, blockTag) {\n const [key, value] = await this.contract.getMetadataByIndex(index, {\n blockTag,\n });\n return Object.freeze({ key, value });\n }\n count(blockTag) {\n return this.contract.metadataCount({ blockTag });\n }\n async readAll(blockTag, includeSealedState = true) {\n const entries = [];\n for (const key of await this.listKeys(blockTag)) {\n const value = await this.getValue(key, blockTag);\n entries.push(Object.freeze(includeSealedState\n ? { key, value, sealed: await this.isSealed(key, blockTag) }\n : { key, value }));\n }\n return Object.freeze(entries);\n }\n setValue(key, value, overrides = {}) {\n return this.contract.setMetadataValue(key, value, overrides);\n }\n sealKey(key, overrides = {}) {\n return this.contract.sealMetadataKey(key, overrides);\n }\n async readLifecycle(blockTag) {\n const metadata = {};\n for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) {\n if (await this.hasKey(key, blockTag))\n metadata[key] = await this.getValue(key, blockTag);\n }\n return new Cip151Lifecycle(metadata);\n }\n async readLabCertificate(gateway, blockTag) {\n if (!(await this.hasKey(cip152LabKey, blockTag)))\n return null;\n const reference = await this.getValue(cip152LabKey, blockTag);\n if (!gateway.resolve(reference).pathname.endsWith(\"/lab.json\"))\n throw new TypeError(\"CIP-152 reference must point to lab.json\");\n return new Cip152LabCertificate(await gateway.readJson(reference));\n }\n}\nexport { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from \"./custom-units.js\";\n//# sourceMappingURL=index.js.map","export const defaultIpfsGatewayTemplate = \"https://ipf.sk/{cid}\";\n/** Configurable IPFS resolution and bounded JSON loading. */\nexport class IpfsGateway {\n template;\n maxResponseBytes;\n timeoutMs;\n #fetch;\n constructor(options = {}) {\n this.template = options.template ?? defaultIpfsGatewayTemplate;\n this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024;\n this.timeoutMs = options.timeoutMs ?? 30_000;\n this.#fetch = options.fetch ?? globalThis.fetch;\n const templateUrl = new URL(this.template.replace(\"{cid}\", \"cid\"));\n if (!/^https?:$/.test(templateUrl.protocol) ||\n this.template.split(\"{cid}\").length !== 2)\n throw new TypeError(\"gateway template must be HTTP(S) and contain one {cid}\");\n for (const value of [this.maxResponseBytes, this.timeoutMs])\n if (!Number.isSafeInteger(value) || value <= 0)\n throw new TypeError(\"gateway limits must be positive safe integers\");\n }\n resolve(reference) {\n const value = reference.trim();\n if (/^https?:\\/\\//i.test(value))\n return new URL(value);\n const path = value.replace(/^ipfs:\\/\\//, \"\").replace(/^\\/?ipfs\\//, \"\");\n if (!/^[A-Za-z0-9]+(?:\\/[^?#]*)?$/.test(path) ||\n path.split(\"/\").some((part) => part === \".\" || part === \"..\"))\n throw new TypeError(\"invalid IPFS reference\");\n return new URL(this.template.replace(\"{cid}\", path.split(\"/\").map(encodeURIComponent).join(\"/\")));\n }\n async readJson(reference) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n let reader;\n try {\n const response = await this.#fetch(this.resolve(reference), {\n headers: { accept: \"application/json\" },\n signal: controller.signal,\n });\n if (!response.ok) {\n await response.body?.cancel();\n throw new Error(`IPFS gateway returned HTTP ${response.status}`);\n }\n if (!response.body)\n throw new Error(\"IPFS gateway returned an empty body\");\n reader = response.body.getReader();\n const chunks = [];\n let length = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done)\n break;\n length += value.length;\n if (length > this.maxResponseBytes)\n throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);\n chunks.push(value);\n }\n const bytes = new Uint8Array(length);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.length;\n }\n return JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes));\n }\n finally {\n clearTimeout(timer);\n await reader?.cancel().catch(() => { });\n reader?.releaseLock();\n }\n }\n}\n//# sourceMappingURL=index.js.map"],"names":["require$$0","require$$1","this","logger","stringify","isBytes","arrayifyInteger","unarrayifyInteger","_encode","_decodeChildren","_decode","decode","ripemd160","hmac","pbkdf2","u64.split","u64.rotrSH","u64.shrSH","u64.rotrSL","u64.shrSL","u64.rotrBH","u64.rotrBL","u64.add4L","u64.add4H","u64.add5L","u64.add5H","u64.add","u64.add3L","u64.add3H","sha256","sha512","Buffer","require$$2","require$$3","global","require$$4","ed448","BN_0","BN_1","locked","getTime","_a","_guard","getGlobal","randomBytes","removeHexPrefix","noble_ripemd160","crypto_random","scrypt","_nobleAsync","_nobleSync","H","BN_2","passProperties","getValue","BN_MAX_UINT256","RLP.decode","RLP.encode","_sha256","internal","PanicReasons","copy","stall","defaultApiKey","getHost","defaultPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEA,CAAA,QAAA,CAAA,UAAkB,GAAG;CACrB,CAAA,QAAA,CAAA,WAAmB,GAAG;CACtB,CAAA,QAAA,CAAA,aAAqB,GAAG;;CAExB,CAAA,IAAI,MAAM,GAAG;CACb,CAAA,IAAI,SAAS,GAAG;EAChB,IAAI,GAAG,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,UAAU,GAAG;;CAE3D,CAAA,IAAI,IAAI,GAAG;CACX,CAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,M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K,CAAC,CAAC;CACtF,QAAQ;CACR,gBAAgB;CAChB,YAAY,YAAY,CAAC,KAAK,CAAC;CAC/B,YAAY,MAAM,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;CACnD,YAAY,MAAM,EAAE,WAAW,EAAE;CACjC,QAAQ;CACR,IAAI;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,4,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,52,53,54,55,56,65,132,135]} \ No newline at end of file diff --git a/dist/corebc.umd.min.js b/dist/corebc.umd.min.js index fd906cc57..1bbbbec8f 100644 --- a/dist/corebc.umd.min.js +++ b/dist/corebc.umd.min.js @@ -1 +1 @@ -const __$G=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports,require("buffer"),require("bcrypto/lib/ed448-browser.js"),require("bn.js"),require("bcrypto/lib/pbkdf2-browser.js"),require("bcrypto/lib/sha3-512.js"),require("utf8"),require("aes-js")):typeof define==="function"&&define.amd?define(["exports","buffer","bcrypto/lib/ed448-browser.js","bn.js","bcrypto/lib/pbkdf2-browser.js","bcrypto/lib/sha3-512.js","utf8","aes-js"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory(global.corebc={},global.buffer,global.ed448,global._BN,global.pbkdf2$2,global.SHA3_512,global.utf8,global.pkg))})(this,function(exports,buffer,ed448,_BN,pbkdf2$2,SHA3_512,utf8,pkg){"use strict";const version="6.4.0";let _permanentCensorErrors=false;let _censorErrors=false;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels["default"];let _globalLogger=null;function _checkNormalize(){try{const missing=[];["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing.push(form)}});if(missing.length){throw new Error("missing "+missing.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"]="UNPREDICTABLE_ENERGY_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{version="0.0.1";static errors=ErrorCode;static levels=LogLevel;constructor(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}_log(logLevel,args){const level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)}debug(...args){this._log(Logger.levels.DEBUG,args)}info(...args){this._log(Logger.levels.INFO,args)}warn(...args){this._log(Logger.levels.WARNING,args)}makeError(message,code,params){if(_censorErrors){return this.makeError("censored error",code,{})}if(!code){code=Logger.errors.UNKNOWN_ERROR}if(!params){params={}}const messageDetails=[];Object.keys(params).forEach(key=>{const value=params[key];try{if(value instanceof Uint8Array){let hex="";for(let i=0;i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push(`code=${code}`);messageDetails.push(`version=${this.version}`);const reason=message;if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}const error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error}throwError(message,code,params){throw this.makeError(message,code,params)}throwArgumentError(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})}assert(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)}assertArgument(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)}checkNormalize(message){if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}}checkSafeUint53(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}}checkArgumentCount(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}}checkNew(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}checkAbstract(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}static globalLogger(){if(!_globalLogger){_globalLogger=new Logger("logger/0.0.1")}return _globalLogger}static setCensorship(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent}static setLogLevel(logLevel){const level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level}static from(version){return new Logger(version)}}const logger$7=new Logger("utils/properties/0.0.1");function checkType(value,type,name){const types=type.split("|").map(t=>t.trim());for(let i=0;iPromise.resolve(value[k])));return results.reduce((accum,v,index)=>{accum[keys[index]]=v;return accum},{})}function defineProperties(target,values,types){for(let key in values){let value=values[key];const type=types?types[key]:null;if(type){checkType(value,type,key)}Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function checkProperties(object,properties){if(!object||typeof object!=="object"){logger$7.throwArgumentError("invalid object","object",object)}Object.keys(object).forEach(key=>{if(!properties[key]){logger$7.throwArgumentError("invalid object key - "+key,"transaction:"+key,object)}})}function stringify$1(value){if(value==null){return"null"}if(Array.isArray(value)){return"[ "+value.map(stringify$1).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify$1(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"number":return value.toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function isError(error,code){return error&&error.code===code}function isCallException(error){return isError(error,"CALL_EXCEPTION")}function makeError(message,code,info){{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify$1(info)}`)}for(const key in info){const value=info[key];details.push(key+"="+stringify$1(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}function assertArgumentCount(count,expectedCount,message){if(message==null){message=""}if(message){message=": "+message}assert(count>=expectedCount,"missing arguemnt"+message,"MISSING_ARGUMENT",{count:count,expectedCount:expectedCount});assert(count<=expectedCount,"too many arguemnts"+message,"UNEXPECTED_ARGUMENT",{count:count,expectedCount:expectedCount})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function assertNormalize(form){assert(_normalizeForms.indexOf(form)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:form}})}function assertPrivate(givenGuard,guard,className){if(className==null){className=""}if(givenGuard!==guard){let method=className,operation="new";if(className){method+=".";operation+=" "+className}assert(false,`private constructor; use ${method}from* methods`,"UNSUPPORTED_OPERATION",{operation:operation})}}const logger$6=new Logger("utils/data/0.0.1");function isHexable(value){return!!value.toHexString}function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(let i=0;i=256){return false}}return true}function _getBytes(value,name,copy){if(value instanceof Uint8Array){if(copy){return new Uint8Array(value)}return value}if(typeof value==="string"&&value.match(/^0x([0-9a-f][0-9a-f])*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;iNumber(item));value=new Uint8Array(v)}}if(typeof value==="number"){logger$6.checkSafeUint53(value,"invalid hexlify value");let hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger$6.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes(value)){let result="0x";for(let i=0;i>4]+HexCharacters[v&15]}return result}return logger$6.throwArgumentError("invalid hexlify value","value",value)}function concat(items){return"0x"+items.map(d=>hexlify(d).substring(2)).join("")}function hexDataSlice(data,offset,endOffset){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){logger$6.throwArgumentError("invalid hexData","value",data)}offset=2+2*offset;if(endOffset!=null){return"0x"+data.substring(offset,2+2*endOffset)}return"0x"+data.substring(offset)}function hexDataLength(data){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){return null}return(data.length-2)/2}function dataLength(data){if(isHexString(data,true)){return(data.length-2)/2}return getBytes(data).length}function dataSlice(data,start,end){const bytes=getBytes(data);if(end!=null&&end>bytes.length){assert(false,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:bytes,length:bytes.length,offset:end})}return hexlify(bytes.slice(start==null?0:start,end==null?bytes.length:end))}function stripZerosLeft(data){let bytes=hexlify(data).substring(2);while(bytes.startsWith("00")){bytes=bytes.substring(2)}return"0x"+bytes}function zeroPad(data,length,left){const bytes=getBytes(data);assert(length>=bytes.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(bytes),length:length,offset:length+1});const result=new Uint8Array(length);result.fill(0);if(left){result.set(bytes,length-bytes.length)}else{result.set(bytes,0)}return hexlify(result)}function zeroPadValue(data,length){return zeroPad(data,length,true)}function zeroPadBytes(data,length){return zeroPad(data,length,false)}function stripZeros(value){let result=arrayify(value);if(result.length===0){return result}let start=0;while(start{result+=hexlify(item).substring(2)});return result}var BN=_BN.BN;const logger$5=new Logger("bigNumber/0.0.1");const _constructorGuard={};const MAX_SAFE=9007199254740991;let _warnedToStringRadix=false;class BigNumber{_hex;_isBigNumber;constructor(constructorGuard,hex){logger$5.checkNew(new.target,BigNumber);if(constructorGuard!==_constructorGuard){logger$5.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"})}this._hex=hex;this._isBigNumber=true;Object.freeze(this)}fromTwos(value){return toBigNumber(toBN(this).fromTwos(value))}toTwos(value){return toBigNumber(toBN(this).toTwos(value))}abs(){if(this._hex[0]==="-"){return BigNumber.from(this._hex.substring(1))}return this}add(other){return toBigNumber(toBN(this).add(toBN(other)))}sub(other){return toBigNumber(toBN(this).sub(toBN(other)))}div(other){const o=BigNumber.from(other);if(o.isZero()){throwFault("division by zero","div")}return toBigNumber(toBN(this).div(toBN(other)))}mul(other){return toBigNumber(toBN(this).mul(toBN(other)))}mod(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot modulo negative values","mod")}return toBigNumber(toBN(this).umod(value))}pow(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot raise to negative values","pow")}return toBigNumber(toBN(this).pow(value))}and(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'and' negative values","and")}return toBigNumber(toBN(this).and(value))}or(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'or' negative values","or")}return toBigNumber(toBN(this).or(value))}xor(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'xor' negative values","xor")}return toBigNumber(toBN(this).xor(value))}mask(value){if(this.isNegative()||value<0){throwFault("cannot mask negative values","mask")}return toBigNumber(toBN(this).maskn(value))}shl(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shl")}return toBigNumber(toBN(this).shln(value))}shr(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shr")}return toBigNumber(toBN(this).shrn(value))}eq(other){return toBN(this).eq(toBN(other))}lt(other){return toBN(this).lt(toBN(other))}lte(other){return toBN(this).lte(toBN(other))}gt(other){return toBN(this).gt(toBN(other))}gte(other){return toBN(this).gte(toBN(other))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch(error){throwFault("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return logger$5.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){if(arguments.length>0){if(arguments[0]===10){if(!_warnedToStringRadix){_warnedToStringRadix=true;logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")}}else if(arguments[0]===16){logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{})}else{logger$5.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})}}return toBN(this).toString(10)}toHexString(){return this._hex}toJSON(key){return{type:"BigNumber",hex:this.toHexString()}}static from(value){if(value instanceof BigNumber){return value}if(typeof value==="string"){if(value.match(/^-?0x[0-9a-f]+$/i)){return new BigNumber(_constructorGuard,toHex(value))}if(value.match(/^-?[0-9]+$/)){return new BigNumber(_constructorGuard,toHex(new BN(value)))}return logger$5.throwArgumentError("invalid BigNumber string","value",value)}if(typeof value==="number"){if(value%1){throwFault("underflow","BigNumber.from",value)}if(value>=MAX_SAFE||value<=-MAX_SAFE){throwFault("overflow","BigNumber.from",value)}return BigNumber.from(String(value))}const anyValue=value;if(typeof anyValue==="bigint"){return BigNumber.from(anyValue.toString())}if(isBytes(anyValue)){return BigNumber.from(hexlify(anyValue))}if(anyValue){if(anyValue.toHexString){const hex=anyValue.toHexString();if(typeof hex==="string"){return BigNumber.from(hex)}}else{let hex=anyValue._hex;if(hex==null&&anyValue.type==="BigNumber"){hex=anyValue.hex}if(typeof hex==="string"){if(isHexString(hex)||hex[0]==="-"&&isHexString(hex.substring(1))){return BigNumber.from(hex)}}}}return logger$5.throwArgumentError("invalid BigNumber value","value",value)}static isBigNumber(value){return!!(value&&value._isBigNumber)}}function toHex(value){if(typeof value!=="string"){return toHex(value.toString(16))}if(value[0]==="-"){value=value.substring(1);if(value[0]==="-"){logger$5.throwArgumentError("invalid hex","value",value)}value=toHex(value);if(value==="0x00"){return value}return"-"+value}if(value.substring(0,2)!=="0x"){value="0x"+value}if(value==="0x"){return"0x00"}if(value.length%2){value="0x0"+value.substring(2)}while(value.length>4&&value.substring(0,4)==="0x00"){value="0x"+value.substring(4)}return value}function toBigNumber(value){return BigNumber.from(toHex(value))}function toBN(value){const hex=BigNumber.from(value).toHexString();if(hex[0]==="-"){return new BN("-"+hex.substring(3),16)}return new BN(hex.substring(2),16)}function throwFault(fault,operation,value){const params={fault:fault,operation:operation};if(value!=null){params.value=value}return logger$5.throwError(fault,Logger.errors.NUMERIC_FAULT,params)}const logger$4=new Logger("rlp/0.0.1");function arrayifyInteger$1(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function unarrayifyInteger$1(data,offset,length){let result=0;for(let i=0;ioffset+1+length){logger$4.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}}return{consumed:1+length,result:result}}function _decode$1(data,offset){if(data.length===0){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}if(data[offset]>=248){const lengthLength=data[offset]-247;if(offset+1+lengthLength>data.length){logger$4.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;if(offset+1+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;if(offset+1+lengthLength>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;if(offset+1+length>data.length){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlify(data[offset])}}function decode$1(data){const bytes=arrayify(data);const decoded=_decode$1(bytes,0);if(decoded.consumed!==bytes.length){logger$4.throwArgumentError("invalid rlp data","data",data)}return decoded.result}function number(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function bytes(b,...lengths){if(!(b instanceof Uint8Array))throw new Error("Expected Uint8Array");if(lengths.length>0&&!lengths.includes(b.length))throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`)}function hash(hash){if(typeof hash!=="function"||typeof hash.create!=="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number(hash.outputLen);number(hash.blockLen)}function exists(instance,checkFinished=true){if(instance.destroyed)throw new Error("Hash instance has been destroyed");if(checkFinished&&instance.finished)throw new Error("Hash#digest() has already been called")}function output(out,instance){bytes(out);const min=instance.outputLen;if(out.lengtha instanceof Uint8Array;const u32=arr=>new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4));const createView=arr=>new DataView(arr.buffer,arr.byteOffset,arr.byteLength);const rotr=(word,shift)=>word<<32-shift|word>>>shift;const isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");const nextTick=async()=>{};async function asyncLoop(iters,tick,cb){let ts=Date.now();for(let i=0;i=0&&diffhashCons().update(toBytes(msg)).digest();const tmp=hashCons();hashC.outputLen=tmp.outputLen;hashC.blockLen=tmp.blockLen;hashC.create=()=>hashCons();return hashC}class HMAC extends Hash{constructor(hash$1,_key){super();this.finished=false;this.destroyed=false;hash(hash$1);const key=toBytes(_key);this.iHash=hash$1.create();if(typeof this.iHash.update!=="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const blockLen=this.blockLen;const pad=new Uint8Array(blockLen);pad.set(key.length>blockLen?hash$1.create().update(key).digest():key);for(let i=0;inew HMAC(hash,key).update(message).digest();hmac.create=(hash,key)=>new HMAC(hash,key);function pbkdf2Init(hash$1,_password,_salt,_opts){hash(hash$1);const opts=checkOpts({dkLen:32,asyncTick:10},_opts);const{c,dkLen,asyncTick}=opts;number(c);number(dkLen);number(asyncTick);if(c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const password=toBytes(_password);const salt=toBytes(_salt);const DK=new Uint8Array(dkLen);const PRF=hmac.create(hash$1,password);const PRFSalt=PRF._cloneInto().update(salt);return{c:c,dkLen:dkLen,asyncTick:asyncTick,DK:DK,PRF:PRF,PRFSalt:PRFSalt}}function pbkdf2Output(PRF,PRFSalt,DK,prfW,u){PRF.destroy();PRFSalt.destroy();if(prfW)prfW.destroy();u.fill(0);return DK}function pbkdf2$1(hash,password,salt,opts){const{c,dkLen,DK,PRF,PRFSalt}=pbkdf2Init(hash,password,salt,opts);let prfW;const arr=new Uint8Array(4);const view=createView(arr);const u=new Uint8Array(PRF.outputLen);for(let ti=1,pos=0;pos>_32n&_u32_max);const wl=Number(value&_u32_max);const h=isLE?4:0;const l=isLE?0:4;view.setUint32(byteOffset+h,wh,isLE);view.setUint32(byteOffset+l,wl,isLE)}class SHA2 extends Hash{constructor(blockLen,outputLen,padOffset,isLE){super();this.blockLen=blockLen;this.outputLen=outputLen;this.padOffset=padOffset;this.isLE=isLE;this.finished=false;this.length=0;this.pos=0;this.destroyed=false;this.buffer=new Uint8Array(blockLen);this.view=createView(this.buffer)}update(data){exists(this);const{view,buffer,blockLen}=this;data=toBytes(data);const len=data.length;for(let pos=0;posblockLen-pos){this.process(view,0);pos=0}for(let i=pos;istate.length)throw new Error("_sha2: outputLen bigger than state");for(let i=0;ia&b^~a&c;const Maj=(a,b,c)=>a&b^a&c^b&c;const SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);const IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);const SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,false);this.A=IV[0]|0;this.B=IV[1]|0;this.C=IV[2]|0;this.D=IV[3]|0;this.E=IV[4]|0;this.F=IV[5]|0;this.G=IV[6]|0;this.H=IV[7]|0}get(){const{A,B,C,D,E,F,G,H}=this;return[A,B,C,D,E,F,G,H]}set(A,B,C,D,E,F,G,H){this.A=A|0;this.B=B|0;this.C=C|0;this.D=D|0;this.E=E|0;this.F=F|0;this.G=G|0;this.H=H|0}process(view,offset){for(let i=0;i<16;i++,offset+=4)SHA256_W[i]=view.getUint32(offset,false);for(let i=16;i<64;i++){const W15=SHA256_W[i-15];const W2=SHA256_W[i-2];const s0=rotr(W15,7)^rotr(W15,18)^W15>>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0);this.buffer.fill(0)}}const sha256$1=wrapConstructor(()=>new SHA256);const U32_MASK64=BigInt(2**32-1);const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){let Ah=new Uint32Array(lst.length);let Al=new Uint32Array(lst.length);for(let i=0;iBigInt(h>>>0)<<_32n|BigInt(l>>>0);const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;const rotr32H=(_h,l)=>l;const rotr32L=(h,_l)=>h;const rotlSH=(h,l,s)=>h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;const u64={fromBig:fromBig,split:split,toBig:toBig,shrSH:shrSH,shrSL:shrSL,rotrSH:rotrSH,rotrSL:rotrSL,rotrBH:rotrBH,rotrBL:rotrBL,rotr32H:rotr32H,rotr32L:rotr32L,rotlSH:rotlSH,rotlSL:rotlSL,rotlBH:rotlBH,rotlBL:rotlBL,add:add,add3L:add3L,add3H:add3H,add4L:add4L,add4H:add4H,add5H:add5H,add5L:add5L};var u64$1=u64;const[SHA512_Kh,SHA512_Kl]=(()=>u64$1.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA512 extends SHA2{constructor(){super(128,64,16,false);this.Ah=1779033703|0;this.Al=4089235720|0;this.Bh=3144134277|0;this.Bl=2227873595|0;this.Ch=1013904242|0;this.Cl=4271175723|0;this.Dh=2773480762|0;this.Dl=1595750129|0;this.Eh=1359893119|0;this.El=2917565137|0;this.Fh=2600822924|0;this.Fl=725511199|0;this.Gh=528734635|0;this.Gl=4215389547|0;this.Hh=1541459225|0;this.Hl=327033209|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=u64$1.rotrSH(W15h,W15l,1)^u64$1.rotrSH(W15h,W15l,8)^u64$1.shrSH(W15h,W15l,7);const s0l=u64$1.rotrSL(W15h,W15l,1)^u64$1.rotrSL(W15h,W15l,8)^u64$1.shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=u64$1.rotrSH(W2h,W2l,19)^u64$1.rotrBH(W2h,W2l,61)^u64$1.shrSH(W2h,W2l,6);const s1l=u64$1.rotrSL(W2h,W2l,19)^u64$1.rotrBL(W2h,W2l,61)^u64$1.shrSL(W2h,W2l,6);const SUMl=u64$1.add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=u64$1.add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=u64$1.rotrSH(Eh,El,14)^u64$1.rotrSH(Eh,El,18)^u64$1.rotrBH(Eh,El,41);const sigma1l=u64$1.rotrSL(Eh,El,14)^u64$1.rotrSL(Eh,El,18)^u64$1.rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=u64$1.add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=u64$1.add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=u64$1.rotrSH(Ah,Al,28)^u64$1.rotrBH(Ah,Al,34)^u64$1.rotrBH(Ah,Al,39);const sigma0l=u64$1.rotrSL(Ah,Al,28)^u64$1.rotrBL(Ah,Al,34)^u64$1.rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=u64$1.add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=u64$1.add3L(T1l,sigma0l,MAJl);Ah=u64$1.add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=u64$1.add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=u64$1.add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=u64$1.add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=u64$1.add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=u64$1.add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=u64$1.add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=u64$1.add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=u64$1.add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){SHA512_W_H.fill(0);SHA512_W_L.fill(0)}destroy(){this.buffer.fill(0);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sha512$1=wrapConstructor(()=>new SHA512);const[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]];const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);function keccakP(s,rounds=24){const B=new Uint32Array(5*2);for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){for(let x=0;x<10;x++)B[x]=s[y+x];for(let x=0;x<10;x++)s[y+x]^=~B[(x+2)%10]&B[(x+4)%10]}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}B.fill(0)}class Keccak extends Hash{constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){super();this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.rounds=rounds;this.pos=0;this.posOut=0;this.finished=false;this.destroyed=false;number(outputLen);if(0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200);this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds);this.posOut=0;this.pos=0}update(data){exists(this);const{blockLen,state}=this;data=toBytes(data);const len=data.length;for(let pos=0;pos=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(out)}xof(bytes){number(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){output(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out);this.destroy();return out}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true;this.state.fill(0)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||(to=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds));to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.destroyed=this.destroyed;return to}}const gen=(suffix,blockLen,outputLen)=>wrapConstructor(()=>new Keccak(blockLen,suffix,outputLen));const sha3_256=gen(6,136,256/8);const sha3_512=gen(6,72,512/8);const keccak_256=gen(1,136,256/8);const BN_0$9=BigInt(0);const BN_1$5=BigInt(1);const maxValue=9007199254740991;function fromTwos(_value,_width){const value=getUint(_value,"value");const width=BigInt(getNumber(_width,"width"));assert(value>>width===BN_0$9,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:_value});if(value>>width-BN_1$5){const mask=(BN_1$5<=-maxValue&&value<=maxValue,"overflow",name||"value",value);return BigInt(value);case"string":try{if(value===""){throw new Error("empty string")}if(value[0]==="-"&&value[1]!=="-"){return-BigInt(value.substring(1))}return BigInt(value)}catch(e){assertArgument(false,`invalid BigNumberish string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid BigNumberish value",name||"value",value)}function getUint(value,name){const result=getBigInt(value,name);assert(result>=BN_0$9,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:value});return result}const Nibbles="0123456789abcdef";function toBigInt(value){if(value instanceof Uint8Array){let result="0x0";for(const v of value){result+=Nibbles[v>>4];result+=Nibbles[v&15]}return BigInt(result)}return getBigInt(value)}function getNumber(value,name){switch(typeof value){case"bigint":assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return Number(value);case"number":assertArgument(Number.isInteger(value),"underflow",name||"value",value);assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return value;case"string":try{if(value===""){throw new Error("empty string")}return getNumber(BigInt(value),name)}catch(e){assertArgument(false,`invalid numeric string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid numeric value",name||"value",value)}function toNumber(value){return getNumber(toBigInt(value))}function toBeHex(_value,_width){const value=getUint(_value,"value");let result=value.toString(16);if(_width==null){if(result.length%2){result="0"+result}}else{const width=getNumber(_width,"width");assert(width*2>=result.length,`value exceeds width (${width} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:_value});while(result.length>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){if(form!=null){assertNormalize(form);str=str.normalize(form)}let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}function toUtf8CodePoints(str,form){return getUtf8CodePoints(toUtf8Bytes(str,form))}async function getUrl(req,_signal){const protocol=req.url.split(":")[0].toLowerCase();assert(protocol==="http"||protocol==="https",`unsupported protocol ${protocol}`,"UNSUPPORTED_OPERATION",{info:{protocol:protocol},operation:"request"});assert(protocol==="https"||!req.credentials||req.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let signal=undefined;if(_signal){const controller=new AbortController;signal=controller.signal;_signal.addListener(()=>{controller.abort()})}const init={method:req.method,headers:new Headers(Array.from(req)),body:req.body||undefined,signal:signal};try{const resp=await fetch(req.url,init);const headers={};resp.headers.forEach((value,key)=>{headers[key.toLowerCase()]=value});const respBody=await resp.arrayBuffer();const body=respBody==null?null:new Uint8Array(respBody);return{statusCode:resp.status,statusMessage:resp.statusText,headers:headers,body:body}}catch(error){console.log({error:error});return undefined}}const MAX_ATTEMPTS=12;const SLOT_INTERVAL=250;let getUrlFunc=getUrl;const reData=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i");const reIpfs=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let locked$5=false;async function dataGatewayFunc(url,signal){try{const match=url.match(reData);if(!match){throw new Error("invalid data")}return new FetchResponse(200,"OK",{"content-type":match[1]||"text/plain"},match[2]?decodeBase64(match[3]):unpercent(match[3]))}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(url))}}function getIpfsGatewayFunc(baseUrl){async function gatewayIpfs(url,signal){try{const match=url.match(reIpfs);if(!match){throw new Error("invalid link")}return new FetchRequest(`${baseUrl}${match[2]}`)}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(url))}}return gatewayIpfs}const Gateways={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")};const fetchSignals=new WeakMap;class FetchCancelSignal{#listeners;#cancelled;constructor(request){this.#listeners=[];this.#cancelled=false;fetchSignals.set(request,()=>{if(this.#cancelled){return}this.#cancelled=true;for(const listener of this.#listeners){setTimeout(()=>{listener()},0)}this.#listeners=[]})}addListener(listener){assert(!this.#cancelled,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"});this.#listeners.push(listener)}get cancelled(){return this.#cancelled}checkSignal(){assert(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(signal){if(signal==null){throw new Error("missing signal; should not happen")}signal.checkSignal();return signal}class FetchRequest{#allowInsecure;#gzip;#headers;#method;#timeout;#url;#body;#bodyType;#creds;#preflight;#process;#retry;#signal;#throttle;get url(){return this.#url}set url(url){this.#url=String(url)}get body(){if(this.#body==null){return null}return new Uint8Array(this.#body)}set body(body){if(body==null){this.#body=undefined;this.#bodyType=undefined}else if(typeof body==="string"){this.#body=toUtf8Bytes(body);this.#bodyType="text/plain"}else if(body instanceof Uint8Array){this.#body=body;this.#bodyType="application/octet-stream"}else if(typeof body==="object"){this.#body=toUtf8Bytes(JSON.stringify(body));this.#bodyType="application/json"}else{throw new Error("invalid body")}}hasBody(){return this.#body!=null}get method(){if(this.#method){return this.#method}if(this.hasBody()){return"POST"}return"GET"}set method(method){if(method==null){method=""}this.#method=String(method).toUpperCase()}get headers(){const headers=Object.assign({},this.#headers);if(this.#creds){headers["authorization"]=`Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`}if(this.allowGzip){headers["accept-encoding"]="gzip"}if(headers["content-type"]==null&&this.#bodyType){headers["content-type"]=this.#bodyType}if(this.body){headers["content-length"]=String(this.body.length)}return headers}getHeader(key){return this.headers[key.toLowerCase()]}setHeader(key,value){this.#headers[String(key).toLowerCase()]=String(value)}clearHeaders(){this.#headers={}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index=0,"timeout must be non-zero","timeout",timeout);this.#timeout=timeout}get preflightFunc(){return this.#preflight||null}set preflightFunc(preflight){this.#preflight=preflight}get processFunc(){return this.#process||null}set processFunc(process){this.#process=process}get retryFunc(){return this.#retry||null}set retryFunc(retry){this.#retry=retry}constructor(url){this.#url=String(url);this.#allowInsecure=false;this.#gzip=true;this.#headers={};this.#method="";this.#timeout=3e5;this.#throttle={slotInterval:SLOT_INTERVAL,maxAttempts:MAX_ATTEMPTS}}toString(){return``}setThrottleParams(params){if(params.slotInterval!=null){this.#throttle.slotInterval=params.slotInterval}if(params.maxAttempts!=null){this.#throttle.maxAttempts=params.maxAttempts}}async#send(attempt,expires,delay,_request,_response){if(attempt>=this.#throttle.maxAttempts){return _response.makeServerError("exceeded maximum retry limit")}assert(getTime$2()<=expires,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:_request});if(delay>0){await wait(delay)}let req=this.clone();const scheme=(req.url.split(":")[0]||"").toLowerCase();if(scheme in Gateways){const result=await Gateways[scheme](req.url,checkSignal(_request.#signal));if(result instanceof FetchResponse){let response=result;if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}}}return response}req=result}if(this.preflightFunc){req=await this.preflightFunc(req)}const resp=await getUrlFunc(req,checkSignal(_request.#signal));let response=new FetchResponse(resp.statusCode,resp.statusMessage,resp.headers,resp.body,_request);if(response.statusCode===301||response.statusCode===302){try{const location=response.headers.location||"";return req.redirect(location).#send(attempt+1,expires,0,_request,response)}catch(error){}return response}else if(response.statusCode===429){if(this.retryFunc==null||await this.retryFunc(req,response,attempt)){const retryAfter=response.headers["retry-after"];let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(typeof retryAfter==="string"&&retryAfter.match(/^[1-9][0-9]*$/)){delay=parseInt(retryAfter)}return req.clone().#send(attempt+1,expires,delay,_request,response)}}if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(error.stall>=0){delay=error.stall}return req.clone().#send(attempt+1,expires,delay,_request,response)}}return response}send(){assert(this.#signal==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"});this.#signal=new FetchCancelSignal(this);return this.#send(0,getTime$2()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){assert(this.#signal!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const signal=fetchSignals.get(this);if(!signal){throw new Error("missing signal; should not happen")}signal()}redirect(location){const current=this.url.split(":")[0].toLowerCase();const target=location.split(":")[0].toLowerCase();assert(this.method==="GET"&&(current!=="https"||target!=="http")&&location.match(/^https?:/),`unsupported redirect`,"UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`});const req=new FetchRequest(location);req.method="GET";req.allowGzip=this.allowGzip;req.timeout=this.timeout;req.#headers=Object.assign({},this.#headers);if(this.#body){req.#body=new Uint8Array(this.#body)}req.#bodyType=this.#bodyType;return req}clone(){const clone=new FetchRequest(this.url);clone.#method=this.#method;if(this.#body){clone.#body=this.#body}clone.#bodyType=this.#bodyType;clone.#headers=Object.assign({},this.#headers);clone.#creds=this.#creds;if(this.allowGzip){clone.allowGzip=true}clone.timeout=this.timeout;if(this.allowInsecureAuthentication){clone.allowInsecureAuthentication=true}clone.#preflight=this.#preflight;clone.#process=this.#process;clone.#retry=this.#retry;return clone}static lockConfig(){locked$5=true}static getGateway(scheme){return Gateways[scheme.toLowerCase()]||null}static registerGateway(scheme,func){scheme=scheme.toLowerCase();if(scheme==="http"||scheme==="https"){throw new Error(`cannot intercept ${scheme}; use registerGetUrl`)}if(locked$5){throw new Error("gateways locked")}Gateways[scheme]=func}static registerGetUrl(getUrl){if(locked$5){throw new Error("gateways locked")}getUrlFunc=getUrl}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(baseUrl){return getIpfsGatewayFunc(baseUrl)}}class FetchResponse{#statusCode;#statusMessage;#headers;#body;#request;#error;toString(){return``}get statusCode(){return this.#statusCode}get statusMessage(){return this.#statusMessage}get headers(){return Object.assign({},this.#headers)}get body(){return this.#body==null?null:new Uint8Array(this.#body)}get bodyText(){try{return this.#body==null?"":toUtf8String(this.#body)}catch(error){assert(false,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(error){assert(false,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index{accum[k.toLowerCase()]=String(headers[k]);return accum},{});this.#body=body==null?null:new Uint8Array(body);this.#request=request||null;this.#error={message:""}}makeServerError(message,error){let statusMessage;if(!message){message=`${this.statusCode} ${this.statusMessage}`;statusMessage=`CLIENT ESCALATED SERVER ERROR (${message})`}else{statusMessage=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`}const response=new FetchResponse(599,statusMessage,this.headers,this.body,this.#request||undefined);response.#error={message:message,error:error};return response}throwThrottleError(message,stall){if(stall==null){stall=-1}else{assertArgument(Number.isInteger(stall)&&stall>=0,"invalid stall timeout","stall",stall)}const error=new Error(message||"throttling requests");defineProperties(error,{stall:stall,throttle:true});throw error}getHeader(key){return this.headers[key.toLowerCase()]}hasBody(){return this.#body!=null}get request(){return this.#request}ok(){return this.#error.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok()){return}let{message,error}=this.#error;if(message===""){message=`server response ${this.statusCode} ${this.statusMessage}`}assert(false,message,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:error})}}function getTime$2(){return(new Date).getTime()}function unpercent(value){return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi,(all,code)=>{return String.fromCharCode(parseInt(code,16))}))}function wait(delay){return new Promise(resolve=>setTimeout(resolve,delay))}var _a$1;const BN_N1=BigInt(-1);const BN_0$7=BigInt(0);const BN_1$4=BigInt(1);const BN_5=BigInt(5);const _guard$5={};let Zeros="0000";while(Zeros.length<80){Zeros+=Zeros}function getTens(decimals){let result=Zeros;while(result.length=-limit&&valBN_0$7){val=fromTwos(mask(val,width),width)}else{val=-fromTwos(mask(-val,width),width)}}else{const limit=BN_1$4<=0&&val{if(v[key]==null){return defaultValue}assertArgument(typeof v[key]===type,"invalid fixed format ("+key+" not "+type+")","format."+key,v[key]);return v[key]};signed=check("signed","boolean",signed);width=check("width","number",width);decimals=check("decimals","number",decimals)}assertArgument(width%8===0,"invalid FixedNumber width (not byte aligned)","format.width",width);assertArgument(decimals<=80,"invalid FixedNumber decimals (too large)","format.decimals",decimals);const name=(signed?"":"u")+"fixed"+String(width)+"x"+String(decimals);return{signed:signed,width:width,decimals:decimals,name:name}}function toString(val,decimals){let negative="";if(val0){b*=getTens(delta)}else if(delta<0){a*=getTens(-delta)}if(ab){return-1}return 0}eq(other){return this.cmp(other)===0}lt(other){return this.cmp(other)<0}lte(other){return this.cmp(other)<=0}gt(other){return this.cmp(other)>0}gte(other){return this.cmp(other)>=0}floor(){let val=this.#val;if(this.#valBN_0$7){val+=this.#tens-BN_1$4}val=this.#val/this.#tens*this.#tens;return this.#checkValue(val,"ceiling")}round(decimals){if(decimals==null){decimals=0}if(decimals>=this.decimals){return this}const delta=this.decimals-decimals;const bump=BN_5*getTens(delta-1);let value=this.value+bump;const tens=getTens(delta);value=value/tens*tens;checkValue(value,this.#format,"round");return new _a$1(_guard$5,value,this.#format)}isZero(){return this.#val===BN_0$7}isNegative(){return this.#val0){const tens=getTens(delta);assert(value%tens===BN_0$7,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:_value});value/=tens}else if(delta<0){value*=getTens(-delta)}checkValue(value,format,"fromValue");return new _a$1(_guard$5,value,format)}static fromString(_value,_format){const match=_value.match(/^(-?)([0-9]*)\.?([0-9]*)$/);assertArgument(match&&match[2].length+match[3].length>0,"invalid FixedNumber string value","value",_value);const format=getFormat(_format);let whole=match[2]||"0",decimal=match[3]||"";while(decimal.length{assert(offset<=data.length,"data short segment too short","BUFFER_OVERRUN",{buffer:data,length:data.length,offset:offset})};if(data[offset]>=248){const lengthLength=data[offset]-247;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);return _decodeChildren(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;checkOffset(offset+1+length);return _decodeChildren(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;checkOffset(offset+1+length);const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlifyByte(data[offset])}}function decodeRlp(_data){const data=getBytes(_data,"data");const decoded=_decode(data,0);assertArgument(decoded.consumed===data.length,"unexpected junk after rlp payload","data",_data);return decoded.result}function arrayifyInteger(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function _encode(object){if(Array.isArray(object)){let payload=[];object.forEach(function(child){payload=payload.concat(_encode(child))});if(payload.length<=55){payload.unshift(192+payload.length);return payload}const length=arrayifyInteger(payload.length);length.unshift(247+length.length);return length.concat(payload)}const data=Array.prototype.slice.call(getBytes(object,"object"));if(data.length===1&&data[0]<=127){return data}else if(data.length<=55){data.unshift(128+data.length);return data}const length=arrayifyInteger(data.length);length.unshift(183+length.length);return length.concat(data)}const nibbles="0123456789abcdef";function encodeRlp(object){let result="0x";for(const v of _encode(object)){result+=nibbles[v>>4];result+=nibbles[v&15]}return result}const names=["ore","fecore","picore","nacore","mcore","micore","core"];function formatUnits(value,unit){let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromValue(value,decimals,{decimals:decimals}).toString()}const scientificToDecimal=num=>{var nsign=Math.sign(num);num=Math.abs(num);if(/\d+\.?\d*e[\+\-]*\d+/i.test(num)){var zero="0",parts=String(num).toLowerCase().split("e"),e=parts.pop(),l=Math.abs(e),sign=e/l,coeff_array=parts[0].split(".");if(sign===-1){l=l-coeff_array[0].length;if(l<0){num=coeff_array[0].slice(0,l)+"."+coeff_array[0].slice(l)+(coeff_array.length===2?coeff_array[1]:"")}else{num=zero+"."+new Array(l+1).join(zero)+coeff_array.join("")}}else{var dec=coeff_array[1];if(dec)l=l-dec.length;if(l<0){num=coeff_array[0]+dec.slice(0,l)+"."+dec.slice(l)}else{num=coeff_array.join("")+new Array(l+1).join(zero)}}}return nsign<0?"-"+num:num};const trimDecimals=(n,decimals=18)=>{n+="";if(n.indexOf(".")===-1)return n;const arr=n.split(".");const fraction=arr[1].substr(0,decimals);return arr[0]+"."+fraction};function parseUnits(value,unit){assertArgument(typeof value==="string","value must be a string","value",value);if(value.includes("e")){value=scientificToDecimal(value).toString()}let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index;value=trimDecimals(value,decimals)}else if(unit!=null){decimals=getNumber(unit,"unit");value=trimDecimals(value,decimals)}return FixedNumber.fromString(value,{decimals:decimals}).value}function formatXCB(ore){return formatUnits(ore,18)}function parseXCB(xcb){return parseUnits(xcb,18)}function uuidV4(randomBytes){const bytes=getBytes(randomBytes,"randomBytes");bytes[6]=bytes[6]&15|64;bytes[8]=bytes[8]&63|128;const value=hexlify(bytes);return[value.substring(2,10),value.substring(10,14),value.substring(14,18),value.substring(18,22),value.substring(22,34)].join("-")}class Ed448Goldilock{static _channel=ed448;static generatePrivateKey(){var privateKey=ed448.privateKeyGenerate();privateKey[56]&=127;return privateKey}static getPublicKeyFromPrivateKey(privateKey){var secret=Buffer.from(privateKey,"hex");if(secret[56]>127){var scalar=secret.slice(0,56);scalar[0]&=252;scalar[55]|=128;var publicKey=this._channel.publicKeyFromScalar(scalar);return Buffer.from(publicKey).toString("hex")}else{var publicKey=this._channel.publicKeyCreate(secret);return Buffer.from(publicKey).toString("hex")}}static signWithPrivateKey(privateKey,msg){var msgToSign=Buffer.from(msg,"hex");var secret=Buffer.from(privateKey,"hex");if(secret[56]>127){var prefix=secret.slice(0,57);prefix[0]&=252;prefix[56]=0;prefix[55]|=128;var scalar=prefix.slice(0,56);var signedMessage=this._channel.signWithScalar(msgToSign,scalar,prefix);return Buffer.from(signedMessage).toString("hex")}else{var signedMessage=this._channel.sign(msgToSign,secret);return Buffer.from(signedMessage).toString("hex")}}static signWithPrivateKeyNConcatPubkey(privateKey,msg){var signedMessage=Ed448Goldilock.signWithPrivateKey(privateKey,msg);var publicKey=Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);return signedMessage+publicKey}static verifySignature(msgHash,signedMsg,pubKey){return this._channel.verify(msgHash,signedMsg,pubKey)}static SHA512Hash(password,salt){var p1=Buffer.from(password,"hex");var s1=Buffer.from(salt,"hex");return Buffer.from(pbkdf2$2.derive(SHA3_512,p1,s1,2048,57)).toString("hex")}static concatenateAndHex(prefix,key,index,salt){var ind=Buffer.alloc(4);var p=Buffer.alloc(1);p[0]=prefix%256;var j=index;for(let i=0;i<4;i++){ind[i]=j%256;j=Math.floor(j/256)}var t=p.toString("hex")+key+ind.toString("hex");return Ed448Goldilock.SHA512Hash(t,salt)}static addScalar(a,b){var a1=Buffer.from(a,"hex");var b1=Buffer.from(b.substr(0,106)+"00000000","hex");b1[0]&=252;var c=Buffer.alloc(57);var hold=0;for(let i=0;i<57;i++){hold+=a1[i]+b1[i];c[i]=hold%256;hold=Math.floor(hold/256)}return c.toString("hex")}static seedToExtendedPrivate(seed){var s1=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f72746865636861696e");var s2=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f727468656b6579");var b=Buffer.from(s2,"hex");b[56]|=128;b[55]|=128;b[55]&=191;var s3=b.toString("hex");return s1+s3}static childPrivateToPrivate(s,index){var s0=s.substr(0,114);var s1=s.substr(114,228);var r0,r1;if(index>=2147483648){r0=Ed448Goldilock.concatenateAndHex(1,s1,index,s0);r1=Ed448Goldilock.concatenateAndHex(0,s1,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}else{var pub=Ed448Goldilock.getPublicKeyFromPrivateKey(s1);r0=Ed448Goldilock.concatenateAndHex(3,pub,index,s0);r1=Ed448Goldilock.concatenateAndHex(2,pub,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}}static HDWalletGenerateKeyFromSeed(seed,index){var m=Ed448Goldilock.seedToExtendedPrivate(seed);var k1=Ed448Goldilock.childPrivateToPrivate(m,2147483648+44);var k2=Ed448Goldilock.childPrivateToPrivate(k1,2147483648+654);var k3=Ed448Goldilock.childPrivateToPrivate(k2,2147483648+0);var k4=Ed448Goldilock.childPrivateToPrivate(k3,2147483648+0);var k5=Ed448Goldilock.childPrivateToPrivate(k4,index);return k5.substr(114,228)}}function getGlobal$1(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal$1();const crypto=anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"sha256":return sha256$1.create();case"sha512":return sha512$1.create();case"sha3-256":return sha3_256.create();case"sha3-512":return sha3_512.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}function createHmac(_algo,key){const algo={sha256:sha256$1,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid hmac algorithm","algorithm",_algo);return hmac.create(algo,key)}function pbkdf2Sync(password,salt,iterations,keylen,_algo){const algo={sha256:sha256$1,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid pbkdf2 algorithm","algorithm",_algo);return pbkdf2$1(algo,password,salt,{c:iterations,dkLen:keylen})}function randomBytes$1(length){assert(crypto!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});assertArgument(Number.isInteger(length)&&length>0&&length<=1024,"invalid length","length",length);const result=new Uint8Array(length);crypto.getRandomValues(result);return result}const _sha256=function(data){let v="0x"+createHash("sha3-256").update(buffer.Buffer.from(arrayify(data))).digest("hex");return v};const _sha512=function(data){let v="0x"+createHash("sha3-512").update(buffer.Buffer.from(arrayify(data))).digest("hex");return v};let locked256=false,locked512=false;var SupportedAlgorithm;(function(SupportedAlgorithm){SupportedAlgorithm["sha256"]="sha256";SupportedAlgorithm["sha512"]="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));function sha256(data){let createdHash=createHash("sha3-256").update(buffer.Buffer.from(arrayify(data))).digest("hex");const v="0x"+createdHash;if(typeof createdHash!=="string"){createdHash=hexlify(createdHash);return createdHash}return v}function legacySha256(data){const _data=getBytes(data,"data");const hexlified=hexlify(createHash("sha256").update(_data).digest());return hexlified}sha256._=_sha256;sha256.lock=function(){locked256=true};sha256.register=function(func){if(locked256){throw new Error("sha256 is locked")}};Object.freeze(sha256);function sha512(data){let createdHash=createHash("sha3-512").update(buffer.Buffer.from(arrayify(data))).digest("hex");const v="0x"+createdHash;if(typeof createdHash!=="string"){createdHash=hexlify(createdHash);return createdHash}return v}sha512._=_sha512;sha512.lock=function(){locked512=true};sha512.register=function(func){if(locked512){throw new Error("sha512 is locked")}};Object.freeze(sha256);const logger$3=new Logger("address/0.0.1");const precompiledAddresses=["0000000000000000000000000000000000000000000000000000000000000000","0000000000000000000000000000000000000000000000000000000000000001","0000000000000000000000000000000000000000000000000000000000000002","0000000000000000000000000000000000000000000000000000000000000003","0000000000000000000000000000000000000000000000000000000000000004","0000000000000000000000000000000000000000000000000000000000000005","0000000000000000000000000000000000000000000000000000000000000006","0000000000000000000000000000000000000000000000000000000000000007","0000000000000000000000000000000000000000000000000000000000000008","0000000000000000000000000000000000000000000000000000000000000009"];function removeHexPrefix$1(val){return val.substring(0,2)==="0x"?val.substring(2):val}function calculateCheckSum(_address,_prefix){const address=getBytes("0x"+_address.replace("0x",""));const prefix=getBytes("0x"+_prefix.replace("0x",""));const tmpConcated=new Uint8Array([...address,...prefix]);const hexedConcat=hexlify(tmpConcated).replace("0x","")+"00";const mods=Array.from(hexedConcat.toUpperCase(),c=>{const charCode=c.charCodeAt(0);return charCode>64&&charCode<91?(charCode-55).toString():(charCode-48).toString()}).join("");const bigVal=BigInt(mods);const val97=BigInt(97);const val98=BigInt(98);const remainder=bigVal%val97;const checkSum=val98-remainder;const result=checkSum>9?checkSum.toString():"0"+checkSum.toString();return result}function getAddress(address){if(typeof address!=="string"){logger$3.throwArgumentError("invalid address","address",address)}if(!address.match(/^(0x)?[0-9a-fA-F]{44}$/)){logger$3.throwArgumentError("invalid address","address",address)}const raw=removeHexPrefix$1(address);if(precompiledAddresses.includes(raw)){return"0x"+raw}const prefix=raw.substring(0,2);const val=raw.substring(4);const checksum=calculateCheckSum(val,prefix);if(checksum!==raw.substring(2,4)){logger$3.throwArgumentError("bad address checksum","address",address)}return"0x"+prefix+checksum+val}function networkIdToPrefix(networkId){if(networkId==1){return"cb"}else if(networkId==3||networkId==4){return"ab"}else if(networkId>10||networkId==0){return"ce"}else{logger$3.throwArgumentError("bad networkId","networkId",networkId);return""}}let locked$4=false;const _computeHmac=function(algorithm,key,data){return createHmac(algorithm,key).update(data).digest()};let __computeHmac=_computeHmac;function computeHmac(algorithm,_key,_data){const key=getBytes(_key,"key");const data=getBytes(_data,"data");return hexlify(__computeHmac(algorithm,key,data))}computeHmac._=_computeHmac;computeHmac.lock=function(){locked$4=true};computeHmac.register=function(func){if(locked$4){throw new Error("computeHmac is locked")}__computeHmac=func};Object.freeze(computeHmac);const Rho=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]);const Id=Uint8Array.from({length:16},(_,i)=>i);const Pi=Id.map(i=>(9*i+5)%16);let idxL=[Id];let idxR=[Pi];for(let i=0;i<4;i++)for(let j of[idxL,idxR])j.push(j[i].map(k=>Rho[k]));const shifts=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(i=>new Uint8Array(i));const shiftsL=idxL.map((idx,i)=>idx.map(j=>shifts[i][j]));const shiftsR=idxR.map((idx,i)=>idx.map(j=>shifts[i][j]));const Kl=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]);const Kr=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);const rotl$1=(word,shift)=>word<>>32-shift;function f(group,x,y,z){if(group===0)return x^y^z;else if(group===1)return x&y|~x&z;else if(group===2)return(x|~y)^z;else if(group===3)return x&z|y&~z;else return x^(y|~z)}const BUF=new Uint32Array(16);class RIPEMD160 extends SHA2{constructor(){super(64,20,8,true);this.h0=1732584193|0;this.h1=4023233417|0;this.h2=2562383102|0;this.h3=271733878|0;this.h4=3285377520|0}get(){const{h0,h1,h2,h3,h4}=this;return[h0,h1,h2,h3,h4]}set(h0,h1,h2,h3,h4){this.h0=h0|0;this.h1=h1|0;this.h2=h2|0;this.h3=h3|0;this.h4=h4|0}process(view,offset){for(let i=0;i<16;i++,offset+=4)BUF[i]=view.getUint32(offset,true);let al=this.h0|0,ar=al,bl=this.h1|0,br=bl,cl=this.h2|0,cr=cl,dl=this.h3|0,dr=dl,el=this.h4|0,er=el;for(let group=0;group<5;group++){const rGroup=4-group;const hbl=Kl[group],hbr=Kr[group];const rl=idxL[group],rr=idxR[group];const sl=shiftsL[group],sr=shiftsR[group];for(let i=0;i<16;i++){const tl=rotl$1(al+f(group,bl,cl,dl)+BUF[rl[i]]+hbl,sl[i])+el|0;al=el,el=dl,dl=rotl$1(cl,10)|0,cl=bl,bl=tl}for(let i=0;i<16;i++){const tr=rotl$1(ar+f(rGroup,br,cr,dr)+BUF[rr[i]]+hbr,sr[i])+er|0;ar=er,er=dr,dr=rotl$1(cr,10)|0,cr=br,br=tr}}this.set(this.h1+cl+dr|0,this.h2+dl+er|0,this.h3+el+ar|0,this.h4+al+br|0,this.h0+bl+cr|0)}roundClean(){BUF.fill(0)}destroy(){this.destroyed=true;this.buffer.fill(0);this.set(0,0,0,0,0)}}const ripemd160$1=wrapConstructor(()=>new RIPEMD160);let locked$3=false;const _ripemd160=function(data){return ripemd160$1(data)};let __ripemd160=_ripemd160;function ripemd160(_data){const data=getBytes(_data,"data");return hexlify(__ripemd160(data))}ripemd160._=_ripemd160;ripemd160.lock=function(){locked$3=true};ripemd160.register=function(func){if(locked$3){throw new TypeError("ripemd160 is locked")}__ripemd160=func};Object.freeze(ripemd160);let locked$2=false;const _pbkdf2=function(password,salt,iterations,keylen,algo){return pbkdf2Sync(password,salt,iterations,keylen,algo)};let __pbkdf2=_pbkdf2;function pbkdf2(_password,_salt,iterations,keylen,algo){const password=getBytes(_password,"password");const salt=getBytes(_salt,"salt");return hexlify(__pbkdf2(password,salt,iterations,keylen,algo))}pbkdf2._=_pbkdf2;pbkdf2.lock=function(){locked$2=true};pbkdf2.register=function(func){if(locked$2){throw new Error("pbkdf2 is locked")}__pbkdf2=func};Object.freeze(pbkdf2);let locked$1=false;const _randomBytes=function(length){return new Uint8Array(randomBytes$1(length))};let __randomBytes=_randomBytes;function randomBytes(length){return __randomBytes(length)}randomBytes._=_randomBytes;randomBytes.lock=function(){locked$1=true};randomBytes.register=function(func){if(locked$1){throw new Error("randomBytes is locked")}__randomBytes=func};Object.freeze(randomBytes);const rotl=(a,b)=>a<>>32-b;function XorAndSalsa(prev,pi,input,ii,out,oi){let y00=prev[pi++]^input[ii++],y01=prev[pi++]^input[ii++];let y02=prev[pi++]^input[ii++],y03=prev[pi++]^input[ii++];let y04=prev[pi++]^input[ii++],y05=prev[pi++]^input[ii++];let y06=prev[pi++]^input[ii++],y07=prev[pi++]^input[ii++];let y08=prev[pi++]^input[ii++],y09=prev[pi++]^input[ii++];let y10=prev[pi++]^input[ii++],y11=prev[pi++]^input[ii++];let y12=prev[pi++]^input[ii++],y13=prev[pi++]^input[ii++];let y14=prev[pi++]^input[ii++],y15=prev[pi++]^input[ii++];let x00=y00,x01=y01,x02=y02,x03=y03,x04=y04,x05=y05,x06=y06,x07=y07,x08=y08,x09=y09,x10=y10,x11=y11,x12=y12,x13=y13,x14=y14,x15=y15;for(let i=0;i<8;i+=2){x04^=rotl(x00+x12|0,7);x08^=rotl(x04+x00|0,9);x12^=rotl(x08+x04|0,13);x00^=rotl(x12+x08|0,18);x09^=rotl(x05+x01|0,7);x13^=rotl(x09+x05|0,9);x01^=rotl(x13+x09|0,13);x05^=rotl(x01+x13|0,18);x14^=rotl(x10+x06|0,7);x02^=rotl(x14+x10|0,9);x06^=rotl(x02+x14|0,13);x10^=rotl(x06+x02|0,18);x03^=rotl(x15+x11|0,7);x07^=rotl(x03+x15|0,9);x11^=rotl(x07+x03|0,13);x15^=rotl(x11+x07|0,18);x01^=rotl(x00+x03|0,7);x02^=rotl(x01+x00|0,9);x03^=rotl(x02+x01|0,13);x00^=rotl(x03+x02|0,18);x06^=rotl(x05+x04|0,7);x07^=rotl(x06+x05|0,9);x04^=rotl(x07+x06|0,13);x05^=rotl(x04+x07|0,18);x11^=rotl(x10+x09|0,7);x08^=rotl(x11+x10|0,9);x09^=rotl(x08+x11|0,13);x10^=rotl(x09+x08|0,18);x12^=rotl(x15+x14|0,7);x13^=rotl(x12+x15|0,9);x14^=rotl(x13+x12|0,13);x15^=rotl(x14+x13|0,18)}out[oi++]=y00+x00|0;out[oi++]=y01+x01|0;out[oi++]=y02+x02|0;out[oi++]=y03+x03|0;out[oi++]=y04+x04|0;out[oi++]=y05+x05|0;out[oi++]=y06+x06|0;out[oi++]=y07+x07|0;out[oi++]=y08+x08|0;out[oi++]=y09+x09|0;out[oi++]=y10+x10|0;out[oi++]=y11+x11|0;out[oi++]=y12+x12|0;out[oi++]=y13+x13|0;out[oi++]=y14+x14|0;out[oi++]=y15+x15|0}function BlockMix(input,ii,out,oi,r){let head=oi+0;let tail=oi+16*r;for(let i=0;i<16;i++)out[tail+i]=input[ii+(2*r-1)*16+i];for(let i=0;i0)tail+=16;XorAndSalsa(out,head,input,ii+=16,out,tail)}}function scryptInit(password,salt,_opts){const opts=checkOpts({dkLen:32,asyncTick:10,maxmem:1024**3+1024},_opts);const{N,r,p,dkLen,asyncTick,maxmem,onProgress}=opts;number(N);number(r);number(p);number(dkLen);number(asyncTick);number(maxmem);if(onProgress!==undefined&&typeof onProgress!=="function")throw new Error("progressCb should be function");const blockSize=128*r;const blockSize32=blockSize/4;if(N<=1||(N&N-1)!==0||N>=2**(blockSize/8)||N>2**32){throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32")}if(p<0||p>(2**32-1)*32/blockSize){throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)")}if(dkLen<0||dkLen>(2**32-1)*32){throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32")}const memUsed=blockSize*(N+p);if(memUsed>maxmem){throw new Error(`Scrypt: parameters too large, ${memUsed} (128 * r * (N + p)) > ${maxmem} (maxmem)`)}const B=pbkdf2$1(sha256$1,password,salt,{c:1,dkLen:blockSize*p});const B32=u32(B);const V=u32(new Uint8Array(blockSize*N));const tmp=u32(new Uint8Array(blockSize));let blockMixCb=()=>{};if(onProgress){const totalBlockMix=2*N*p;const callbackPer=Math.max(Math.floor(totalBlockMix/1e4),1);let blockMixCnt=0;blockMixCb=()=>{blockMixCnt++;if(onProgress&&(!(blockMixCnt%callbackPer)||blockMixCnt===totalBlockMix))onProgress(blockMixCnt/totalBlockMix)}}return{N:N,r:r,p:p,dkLen:dkLen,blockSize32:blockSize32,V:V,B32:B32,B:B,tmp:tmp,blockMixCb:blockMixCb,asyncTick:asyncTick}}function scryptOutput(password,dkLen,B,V,tmp){const res=pbkdf2$1(sha256$1,password,B,{c:1,dkLen:dkLen});B.fill(0);V.fill(0);tmp.fill(0);return res}function scrypt$1(password,salt,opts){const{N,r,p,dkLen,blockSize32,V,B32,B,tmp,blockMixCb}=scryptInit(password,salt,opts);for(let pi=0;pi{BlockMix(V,pos,V,pos+=blockSize32,r);blockMixCb()});BlockMix(V,(N-1)*blockSize32,B32,Pi,r);blockMixCb();await asyncLoop(N,asyncTick,()=>{const j=B32[Pi+blockSize32-16]%N;for(let k=0;kmod(mod(x*x)*x+CURVE.b);const err=(m="")=>{throw new Error(m)};const big=n=>typeof n==="bigint";const str=s=>typeof s==="string";const fe=n=>big(n)&&0nbig(n)&&0n!(a instanceof Uint8Array)||typeof l==="number"&&l>0&&a.length!==l?err("Uint8Array expected"):a;const u8n=data=>new Uint8Array(data);const toU8=(a,len)=>au8(str(a)?h2b(a):u8n(a),len);const mod=(a,b=P)=>{let r=a%b;return r>=0n?r:b+r};const isPoint=p=>p instanceof Point?p:err("Point expected");let Gpows=undefined;class Point{constructor(px,py,pz){this.px=px;this.py=py;this.pz=pz}static fromAffine(p){return new Point(p.x,p.y,1n)}static fromHex(hex){hex=toU8(hex);let p=undefined;const head=hex[0],tail=hex.subarray(1);const x=slcNum(tail,0,fLen),len=hex.length;if(len===33&&[2,3].includes(head)){if(!fe(x))err("Point hex invalid: x not FE");let y=sqrt(crv(x));const isYOdd=(y&1n)===1n;const headOdd=(head&1)===1;if(headOdd!==isYOdd)y=mod(-y);p=new Point(x,y,1n)}if(len===65&&head===4)p=new Point(x,slcNum(tail,fLen,2*fLen),1n);return p?p.ok():err("Point is not on curve")}static fromPrivateKey(k){return G.mul(toPriv(k))}get x(){return this.aff().x}get y(){return this.aff().y}equals(other){const{px:X1,py:Y1,pz:Z1}=this;const{px:X2,py:Y2,pz:Z2}=isPoint(other);const X1Z2=mod(X1*Z2),X2Z1=mod(X2*Z1);const Y1Z2=mod(Y1*Z2),Y2Z1=mod(Y2*Z1);return X1Z2===X2Z1&&Y1Z2===Y2Z1}negate(){return new Point(this.px,mod(-this.py),this.pz)}double(){return this.add(this)}add(other){const{px:X1,py:Y1,pz:Z1}=this;const{px:X2,py:Y2,pz:Z2}=isPoint(other);const{a,b}=CURVE;let X3=0n,Y3=0n,Z3=0n;const b3=mod(b*3n);let t0=mod(X1*X2),t1=mod(Y1*Y2),t2=mod(Z1*Z2),t3=mod(X1+Y1);let t4=mod(X2+Y2);t3=mod(t3*t4);t4=mod(t0+t1);t3=mod(t3-t4);t4=mod(X1+Z1);let t5=mod(X2+Z2);t4=mod(t4*t5);t5=mod(t0+t2);t4=mod(t4-t5);t5=mod(Y1+Z1);X3=mod(Y2+Z2);t5=mod(t5*X3);X3=mod(t1+t2);t5=mod(t5-X3);Z3=mod(a*t4);X3=mod(b3*t2);Z3=mod(X3+Z3);X3=mod(t1-Z3);Z3=mod(t1+Z3);Y3=mod(X3*Z3);t1=mod(t0+t0);t1=mod(t1+t0);t2=mod(a*t2);t4=mod(b3*t4);t1=mod(t1+t2);t2=mod(t0-t2);t2=mod(a*t2);t4=mod(t4+t2);t0=mod(t1*t4);Y3=mod(Y3+t0);t0=mod(t5*t4);X3=mod(t3*X3);X3=mod(X3-t0);t0=mod(t3*t1);Z3=mod(t5*Z3);Z3=mod(Z3+t0);return new Point(X3,Y3,Z3)}mul(n,safe=true){if(!safe&&n===0n)return I;if(!ge(n))err("invalid scalar");if(this.equals(G))return wNAF(n).p;let p=I,f=G;for(let d=this;n>0n;d=d.double(),n>>=1n){if(n&1n)p=p.add(d);else if(safe)f=f.add(d)}return p}mulAddQUns(R,u1,u2){return this.mul(u1,false).add(R.mul(u2,false)).ok()}toAffine(){const{px:x,py:y,pz:z}=this;if(this.equals(I))return{x:0n,y:0n};if(z===1n)return{x:x,y:y};const iz=inv(z);if(mod(z*iz)!==1n)err("invalid inverse");return{x:mod(x*iz),y:mod(y*iz)}}assertValidity(){const{x,y}=this.aff();if(!fe(x)||!fe(y))err("Point invalid: x or y");return mod(y*y)===crv(x)?this:err("Point invalid: not on curve")}multiply(n){return this.mul(n)}aff(){return this.toAffine()}ok(){return this.assertValidity()}toHex(isCompressed=true){const{x,y}=this.aff();const head=isCompressed?(y&1n)===0n?"02":"03":"04";return head+n2h(x)+(isCompressed?"":n2h(y))}toRawBytes(isCompressed=true){return h2b(this.toHex(isCompressed))}}Point.BASE=new Point(Gx,Gy,1n);Point.ZERO=new Point(0n,1n,0n);const{BASE:G,ZERO:I}=Point;const padh=(n,pad)=>n.toString(16).padStart(pad,"0");const b2h=b=>Array.from(b).map(e=>padh(e,2)).join("");const h2b=hex=>{const l=hex.length;if(!str(hex)||l%2)err("hex invalid 1");const arr=u8n(l/2);for(let i=0;iBigInt("0x"+(b2h(b)||"0"));const slcNum=(b,from,to)=>b2n(b.slice(from,to));const n2b=num=>{return big(num)&&num>=0n&&numb2h(n2b(num));const inv=(num,md=P)=>{if(num===0n||md<=0n)err("no inverse n="+num+" mod="+md);let a=mod(num,md),b=md,x=0n,u=1n;while(a!==0n){const q=b/a,r=b%a;const m=x-u*q;b=a,a=r,x=u,u=m}return b===1n?mod(x,md):err("no inverse")};const sqrt=n=>{let r=1n;for(let num=n,e=(P+1n)/4n;e>0n;e>>=1n){if(e&1n)r=r*num%P;num=num*num%P}return mod(r*r)===n?r:err("sqrt invalid")};const toPriv=p=>{if(!big(p))p=b2n(toU8(p,fLen));return ge(p)?p:err("private key out of range")};function getSharedSecret(privA,pubB,isCompressed=true){return Point.fromHex(pubB).mul(toPriv(privA)).toRawBytes(isCompressed)}const W=8;const precompute=()=>{const points=[];const windows=256/W+1;let p=G,b=p;for(let w=0;w{const comp=Gpows||(Gpows=precompute());const neg=(cnd,p)=>{let n=p.negate();return cnd?n:p};let p=I,f=G;const windows=1+256/W;const wsize=2**(W-1);const mask=BigInt(2**W-1);const maxNum=2**W;const shiftBy=BigInt(W);for(let w=0;w>=shiftBy;if(wbits>wsize){wbits-=maxNum;n+=1n}const off1=off,off2=off+Math.abs(wbits)-1;const cnd1=w%2!==0,cnd2=wbits<0;if(wbits===0){f=f.add(neg(cnd1,comp[off1]))}else{p=p.add(neg(cnd2,comp[off2]))}}return{p:p,f:f}};const logger$2=new Logger("signing-key/0.0.1");class SigningKey{#privateKey;constructor(privateKey){let tmp=privateKey;if(typeof tmp==="string"&&tmp.startsWith("0x")){tmp=tmp.replace("0x","")}assertArgument(dataLength("0x"+tmp)===57,"invalid private key","privateKey","[REDACTED]");this.#privateKey=hexlify("0x"+tmp)}get privateKey(){return this.#privateKey}get publicKey(){return SigningKey.computePublicKey(this.#privateKey)}get compressedPublicKey(){return SigningKey.computePublicKey(this.#privateKey,true)}sign(digest){const key=getBytesCopy(this.#privateKey);assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const keyBuffer=new Uint8Array(arrayify(key));if(keyBuffer.length!==57){logger$2.throwArgumentError("invalid private key","key","[REDACTED]")}const digestBuffer=new Uint8Array(arrayify(digest));if(digestBuffer.length!==32){logger$2.throwArgumentError("bad digest length","digest",digest)}if(keyBuffer[56]>127){const prefix=keyBuffer.slice(0,57);prefix[0]&=252;prefix[55]|=128;prefix[56]=0;const scalar=prefix.slice(0,56);const bufferDigest=buffer.Buffer.from(digestBuffer);const bufferPrfx=buffer.Buffer.from(prefix);const bufferScalar=buffer.Buffer.from(scalar);const sig=ed448.signWithScalar(bufferDigest,bufferScalar,bufferPrfx);const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}const sig=ed448.sign(buffer.Buffer.from(digestBuffer),buffer.Buffer.from(keyBuffer));const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}computeSharedSecret(other){const pubKey=SigningKey.computePublicKey(other);return hexlify(getSharedSecret(getBytesCopy(this.#privateKey),getBytes(pubKey)))}static computePublicKey(key,compressed){const bytes=buffer.Buffer.from(arrayify(key));if(bytes.length!==57){logger$2.throwArgumentError("invalid private key","key","[REDACTED]")}if(bytes[56]>127){const scalar=bytes.slice(0,56);scalar[0]&=252;scalar[55]|=128;const pub=ed448.publicKeyFromScalar(scalar);return hexlify(pub)}const pub=ed448.publicKeyCreate(bytes);return hexlify(pub)}static recoverPublicKey(digest,signature){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const digestBuffer=buffer.Buffer.from(arrayify(digest));const sigBuffer=buffer.Buffer.from(arrayify(signature));if(sigBuffer.length!==171){logger$2.throwArgumentError("invalid signature","signature",signature)}const sig=sigBuffer.slice(0,114);const pub=sigBuffer.slice(114);if(ed448.verify(digestBuffer,sig,pub)){return hexlify(pub)}logger$2.throwArgumentError("invalid signature","signature",signature);return""}static addPoints(p0,p1,compressed){const pub0=Point.fromHex(SigningKey.computePublicKey(p0).substring(2));const pub1=Point.fromHex(SigningKey.computePublicKey(p1).substring(2));return"0x"+pub0.add(pub1).toHex(!!compressed)}}const BN_0$6=BigInt(0);const BN_1$3=BigInt(1);const BN_2$1=BigInt(2);const BN_27=BigInt(27);const BN_28=BigInt(28);const BN_35=BigInt(35);const _guard$4={};class Signature{#r;#s;#v;#networkV;get r(){return this.#r}set r(value){assertArgument(dataLength(value)===32,"invalid r","value",value);this.#r=hexlify(value)}get s(){return this.#s}set s(_value){assertArgument(dataLength(_value)===32,"invalid s","value",_value);const value=hexlify(_value);assertArgument(parseInt(value.substring(0,3))<8,"non-canonical s","value",value);this.#s=value}get v(){return this.#v}set v(value){const v=getNumber(value,"value");assertArgument(v===27||v===28,"invalid v","v",value);this.#v=v}get networkV(){return this.#networkV}get legacynetworkId(){const v=this.networkV;if(v==null){return null}return Signature.getnetworkId(v)}get yParity(){return this.v===27?0:1}get yParityAndS(){const yParityAndS=getBytes(this.s);if(this.yParity){yParityAndS[0]|=128}return hexlify(yParityAndS)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(guard,r,s,v){assertPrivate(guard,_guard$4,"Signature");this.#r=r;this.#s=s;this.#v=v;this.#networkV=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const clone=new Signature(_guard$4,this.r,this.s,this.v);if(this.networkV){clone.#networkV=this.networkV}return clone}toJSON(){const networkV=this.networkV;return{_type:"signature",networkV:networkV!=null?networkV.toString():null,r:this.r,s:this.s,v:this.v}}static getnetworkId(v){const bv=getBigInt(v,"v");if(bv==BN_27||bv==BN_28){return BN_0$6}assertArgument(bv>=BN_35,"invalid EIP-155 v","v",v);return(bv-BN_35)/BN_2$1}static getnetworkIdV(networkId,v){return getBigInt(networkId)*BN_2$1+BigInt(35+v-27)}static getNormalizedV(v){const bv=getBigInt(v);if(bv===BN_0$6||bv===BN_27){return 27}if(bv===BN_1$3||bv===BN_28){return 28}assertArgument(bv>=BN_35,"invalid v","v",v);return bv&BN_1$3?27:28}}function lock(){computeHmac.lock();pbkdf2.lock();randomBytes.lock();ripemd160.lock();scrypt.lock();scryptSync.lock();sha256.lock();sha512.lock();randomBytes.lock()}function removeHexPrefix(val){return val.substring(0,2)==="0x"?val.substring(2):val}function publicToAddress(key,prefix){const val=hexDataSlice(sha256(key),12);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function computeAddress(key,prefix){let pubkey;if(typeof key==="string"){pubkey=SigningKey.computePublicKey(key,false)}else{pubkey=key.publicKey}return publicToAddress(pubkey,prefix)}function recoverAddress(digest,signature,prefix){const publicKey=SigningKey.recoverPublicKey(arrayify(digest),signature);return publicToAddress(publicKey,prefix)}function extractPrefix(address){address=getAddress(address);return address.substring(2,4)}const WordSize=32;const Padding=new Uint8Array(WordSize);const passProperties$1=["then"];const _guard$3={};function throwError(name,error){const wrapped=new Error(`deferred error during ABI decoding triggered accessing ${name}`);wrapped.error=error;throw wrapped}class Result extends Array{#names;constructor(...args){const guard=args[0];let items=args[1];let names=(args[2]||[]).slice();let wrap=true;if(guard!==_guard$3){items=args;names=[];wrap=false}super(items.length);items.forEach((item,index)=>{this[index]=item});const nameCounts=names.reduce((accum,name)=>{if(typeof name==="string"){accum.set(name,(accum.get(name)||0)+1)}return accum},new Map);this.#names=Object.freeze(items.map((item,index)=>{const name=names[index];if(name!=null&&nameCounts.get(name)===1){return name}return null}));if(!wrap){return}Object.freeze(this);return new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="string"){if(prop.match(/^[0-9]+$/)){const index=getNumber(prop,"%index");if(index<0||index>=this.length){throw new RangeError("out of result range")}const item=target[index];if(item instanceof Error){throwError(`index ${index}`,item)}return item}if(passProperties$1.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}const value=target[prop];if(value instanceof Function){return function(...args){return value.apply(this===receiver?target:this,args)}}else if(!(prop in target)){return target.getValue.apply(this===receiver?target:this,[prop])}}return Reflect.get(target,prop,receiver)}})}toArray(){const result=[];this.forEach((item,index)=>{if(item instanceof Error){throwError(`index ${index}`,item)}result.push(item)});return result}toObject(){return this.#names.reduce((accum,name,index)=>{assert(name!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"});if(!(name in accum)){accum[name]=this.getValue(name)}return accum},{})}slice(start,end){if(start==null){start=0}if(start<0){start+=this.length;if(start<0){start=0}}if(end==null){end=this.length}if(end<0){end+=this.length;if(end<0){end=0}}if(end>this.length){end=this.length}const result=[],names=[];for(let i=start;i{this.#data[offset]=getValue$1(value)}}}class Reader{allowLoose;#data;#offset;constructor(data,allowLoose){defineProperties(this,{allowLoose:!!allowLoose});this.#data=getBytesCopy(data);this.#offset=0}get data(){return hexlify(this.#data)}get dataLength(){return this.#data.length}get consumed(){return this.#offset}get bytes(){return new Uint8Array(this.#data)}#peekBytes(offset,length,loose){let alignedLength=Math.ceil(length/WordSize)*WordSize;if(this.#offset+alignedLength>this.#data.length){if(this.allowLoose&&loose&&this.#offset+length<=this.#data.length){alignedLength=length}else{assert(false,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),length:this.#data.length,offset:this.#offset+alignedLength})}}return this.#data.slice(this.#offset,this.#offset+alignedLength)}subReader(offset){return new Reader(this.#data.slice(this.#offset+offset),this.allowLoose)}readBytes(length,loose){let bytes=this.#peekBytes(0,length,!!loose);this.#offset+=bytes.length;return bytes.slice(0,length)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}}const _gaurd={};function n(value,width){let signed=false;if(width<0){signed=true;width*=-1}return new Typed(_gaurd,`${signed?"":"u"}int${width}`,value,{signed:signed,width:width})}function b(value,size){return new Typed(_gaurd,`bytes${size?size:""}`,value,{size:size})}const _typedSymbol=Symbol.for("_corebc_typed");class Typed{type;value;#options;_typedSymbol;constructor(gaurd,type,value,options){if(options==null){options=null}assertPrivate(_gaurd,gaurd,"Typed");defineProperties(this,{_typedSymbol:_typedSymbol,type:type,value:value});this.#options=options;this.format()}format(){if(this.type==="array"){throw new Error("")}else if(this.type==="dynamicArray"){throw new Error("")}else if(this.type==="tuple"){return`tuple(${this.value.map(v=>v.format()).join(",")})`}return this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple"){throw TypeError("not a tuple")}return this.#options}get arrayLength(){if(this.type!=="array"){throw TypeError("not an array")}if(this.#options===true){return-1}if(this.#options===false){return this.value.length}return null}static from(type,value){return new Typed(_gaurd,type,value)}static uint8(v){return n(v,8)}static uint16(v){return n(v,16)}static uint24(v){return n(v,24)}static uint32(v){return n(v,32)}static uint40(v){return n(v,40)}static uint48(v){return n(v,48)}static uint56(v){return n(v,56)}static uint64(v){return n(v,64)}static uint72(v){return n(v,72)}static uint80(v){return n(v,80)}static uint88(v){return n(v,88)}static uint96(v){return n(v,96)}static uint104(v){return n(v,104)}static uint112(v){return n(v,112)}static uint120(v){return n(v,120)}static uint128(v){return n(v,128)}static uint136(v){return n(v,136)}static uint144(v){return n(v,144)}static uint152(v){return n(v,152)}static uint160(v){return n(v,160)}static uint168(v){return n(v,168)}static uint176(v){return n(v,176)}static uint184(v){return n(v,184)}static uint192(v){return n(v,192)}static uint200(v){return n(v,200)}static uint208(v){return n(v,208)}static uint216(v){return n(v,216)}static uint224(v){return n(v,224)}static uint232(v){return n(v,232)}static uint240(v){return n(v,240)}static uint248(v){return n(v,248)}static uint256(v){return n(v,256)}static uint(v){return n(v,256)}static int8(v){return n(v,-8)}static int16(v){return n(v,-16)}static int24(v){return n(v,-24)}static int32(v){return n(v,-32)}static int40(v){return n(v,-40)}static int48(v){return n(v,-48)}static int56(v){return n(v,-56)}static int64(v){return n(v,-64)}static int72(v){return n(v,-72)}static int80(v){return n(v,-80)}static int88(v){return n(v,-88)}static int96(v){return n(v,-96)}static int104(v){return n(v,-104)}static int112(v){return n(v,-112)}static int120(v){return n(v,-120)}static int128(v){return n(v,-128)}static int136(v){return n(v,-136)}static int144(v){return n(v,-144)}static int152(v){return n(v,-152)}static int160(v){return n(v,-160)}static int168(v){return n(v,-168)}static int176(v){return n(v,-176)}static int184(v){return n(v,-184)}static int192(v){return n(v,-192)}static int200(v){return n(v,-200)}static int208(v){return n(v,-208)}static int216(v){return n(v,-216)}static int224(v){return n(v,-224)}static int232(v){return n(v,-232)}static int240(v){return n(v,-240)}static int248(v){return n(v,-248)}static int256(v){return n(v,-256)}static int(v){return n(v,-256)}static bytes1(v){return b(v,1)}static bytes2(v){return b(v,2)}static bytes3(v){return b(v,3)}static bytes4(v){return b(v,4)}static bytes5(v){return b(v,5)}static bytes6(v){return b(v,6)}static bytes7(v){return b(v,7)}static bytes8(v){return b(v,8)}static bytes9(v){return b(v,9)}static bytes10(v){return b(v,10)}static bytes11(v){return b(v,11)}static bytes12(v){return b(v,12)}static bytes13(v){return b(v,13)}static bytes14(v){return b(v,14)}static bytes15(v){return b(v,15)}static bytes16(v){return b(v,16)}static bytes17(v){return b(v,17)}static bytes18(v){return b(v,18)}static bytes19(v){return b(v,19)}static bytes20(v){return b(v,20)}static bytes21(v){return b(v,21)}static bytes22(v){return b(v,22)}static bytes23(v){return b(v,23)}static bytes24(v){return b(v,24)}static bytes25(v){return b(v,25)}static bytes26(v){return b(v,26)}static bytes27(v){return b(v,27)}static bytes28(v){return b(v,28)}static bytes29(v){return b(v,29)}static bytes30(v){return b(v,30)}static bytes31(v){return b(v,31)}static bytes32(v){return b(v,32)}static address(v){return new Typed(_gaurd,"address",v)}static bool(v){return new Typed(_gaurd,"bool",!!v)}static bytes(v){return new Typed(_gaurd,"bytes",v)}static string(v){return new Typed(_gaurd,"string",v)}static array(v,dynamic){throw new Error("not implemented yet")}static tuple(v,name){throw new Error("not implemented yet")}static overrides(v){return new Typed(_gaurd,"overrides",Object.assign({},v))}static isTyped(value){return value&&value._typedSymbol===_typedSymbol}static dereference(value,type){if(Typed.isTyped(value)){if(value.type!==type){throw new Error(`invalid type: expecetd ${type}, got ${value.type}`)}return value.value}return value}}class AddressCoder extends Coder{constructor(localName){super("address","address",localName,false)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(writer,_value){let value=Typed.dereference(_value,"string");try{value=getAddress(value)}catch(error){return this._throwError(error.message,_value)}return writer.writeValue(value)}decode(reader){return getAddress(toBeHex(reader.readValue(),22))}}class AnonymousCoder extends Coder{coder;constructor(coder){super(coder.name,coder.type,"_",coder.dynamic);this.coder=coder}defaultValue(){return this.coder.defaultValue()}encode(writer,value){return this.coder.encode(writer,value)}decode(reader){return this.coder.decode(reader)}}function pack(writer,coders,values){let arrayValues=[];if(Array.isArray(values)){arrayValues=values}else if(values&&typeof values==="object"){let unique={};arrayValues=coders.map(coder=>{const name=coder.localName;assert(name,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});assert(!unique[name],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});unique[name]=true;return values[name]})}else{assertArgument(false,"invalid tuple value","tuple",values)}assertArgument(coders.length===arrayValues.length,"types/value length mismatch","tuple",values);let staticWriter=new Writer;let dynamicWriter=new Writer;let updateFuncs=[];coders.forEach((coder,index)=>{let value=arrayValues[index];if(coder.dynamic){let dynamicOffset=dynamicWriter.length;coder.encode(dynamicWriter,value);let updateFunc=staticWriter.writeUpdatableValue();updateFuncs.push(baseOffset=>{updateFunc(baseOffset+dynamicOffset)})}else{coder.encode(staticWriter,value)}});updateFuncs.forEach(func=>{func(staticWriter.length)});let length=writer.appendWriter(staticWriter);length+=writer.appendWriter(dynamicWriter);return length}function unpack(reader,coders){let values=[];let keys=[];let baseReader=reader.subReader(0);coders.forEach(coder=>{let value=null;if(coder.dynamic){let offset=reader.readIndex();let offsetReader=baseReader.subReader(offset);try{value=coder.decode(offsetReader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}else{try{value=coder.decode(reader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}if(value==undefined){throw new Error("investigate")}values.push(value);keys.push(coder.localName||null)});return Result.fromItems(values,keys)}class ArrayCoder extends Coder{coder;length;constructor(coder,length,localName){const type=coder.type+"["+(length>=0?length:"")+"]";const dynamic=length===-1||coder.dynamic;super("array",type,localName,dynamic);defineProperties(this,{coder:coder,length:length})}defaultValue(){const defaultChild=this.coder.defaultValue();const result=[];for(let i=0;ibounds||value<-(bounds+BN_1$2)){this._throwError("value out-of-bounds",_value)}value=toTwos(value,8*WordSize)}else if(valuemask(maxUintValue,this.size*8)){this._throwError("value out-of-bounds",_value)}return writer.writeValue(value)}decode(reader){let value=mask(reader.readValue(),this.size*8);if(this.signed){value=fromTwos(value,this.size*8)}return value}}class StringCoder extends DynamicBytesCoder{constructor(localName){super("string",localName)}defaultValue(){return""}encode(writer,_value){return super.encode(writer,toUtf8Bytes(Typed.dereference(_value,"string")))}decode(reader){return toUtf8String(super.decode(reader))}}class TupleCoder extends Coder{coders;constructor(coders,localName){let dynamic=false;const types=[];coders.forEach(coder=>{if(coder.dynamic){dynamic=true}types.push(coder.type)});const type="tuple("+types.join(",")+")";super("tuple",type,localName,dynamic);defineProperties(this,{coders:Object.freeze(coders.slice())})}defaultValue(){const values=[];this.coders.forEach(coder=>{values.push(coder.defaultValue())});const uniqueNames=this.coders.reduce((accum,coder)=>{const name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});this.coders.forEach((coder,index)=>{let name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}values[name]=values[index]});return Object.freeze(values)}encode(writer,_value){const value=Typed.dereference(_value,"tuple");return pack(writer,this.coders,value)}decode(reader){return unpack(reader,this.coders)}}function id(value,useKeccak){if(useKeccak){return keccak256(toUtf8Bytes(value))}return sha256(toUtf8Bytes(value))}const ZeroAddress="0x0000000000000000000000000000000000000000";const ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000";const N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const OrePerXCB=BigInt("1000000000000000000");const MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);const MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const CoreSymbol="Ξ";const MessagePrefix="Core Signed Message:\n";function accessSetify(addr,storageKeys){return{address:getAddress(addr),storageKeys:storageKeys.map((storageKey,index)=>{assertArgument(isHexString(storageKey,32),"invalid slot",`storageKeys[${index}]`,storageKey);return storageKey.toLowerCase()})}}function accessListify(value){if(Array.isArray(value)){return value.map((set,index)=>{if(Array.isArray(set)){assertArgument(set.length===2,"invalid slot set",`value[${index}]`,set);return accessSetify(set[0],set[1])}assertArgument(set!=null&&typeof set==="object","invalid address-slot set","value",value);return accessSetify(set.address,set.storageKeys)})}assertArgument(value!=null&&typeof value==="object","invalid access list","value",value);const result=Object.keys(value).map(addr=>{const storageKeys=value[addr].reduce((accum,storageKey)=>{accum[storageKey]=true;return accum},{});return accessSetify(addr,Object.keys(storageKeys).sort())});result.sort((a,b)=>a.address.localeCompare(b.address));return result}const logger$1=new Logger("transaction/0.0.1");const BN_0$4=BigInt(0);function handleAddress(value){if(value==="0x"){return null}return getAddress(value)}function parse(data){const handleNumber=value=>{if(value==="0x"){return BigNumber.from(0)}return BigNumber.from(value)};const transaction=decode$1(data);if(transaction.length!==7&&transaction.length!==8){logger$1.throwArgumentError("invalid raw transaction","data",data)}const isSigned=transaction.length===8;const tx={nonce:Number(handleNumber(transaction[0])),energyPrice:handleNumber(transaction[1]).toBigInt(),energyLimit:handleNumber(transaction[2]).toBigInt(),networkId:handleNumber(transaction[isSigned?3:6]).toBigInt(),to:handleAddress(transaction[isSigned?4:3]),value:handleNumber(transaction[isSigned?5:4]).toBigInt(),data:transaction[isSigned?6:5]};if(transaction.length===8){const prefix=networkIdToPrefix(Number(tx.networkId));const digest=sha256(serialize(tx));tx.hash=sha256(serialize(tx,transaction[7]));tx.from=recoverAddress(digest,transaction[7],prefix);tx.signature=transaction[7]}return tx}const unsignedTransactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"},{name:"networkId",maxLength:32,numeric:true}];const transactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"networkId",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"}];const allowedTransactionKeys={networkId:true,data:true,energyLimit:true,energyPrice:true,nonce:true,to:true,value:true};function serialize(transaction,signature){checkProperties(transaction,allowedTransactionKeys);const raw=[];(!!signature?transactionFields:unsignedTransactionFields).forEach(function({numeric,maxLength,name,length}){let value=transaction[name]||[];const options={};if(numeric){options.hexPad="left"}const tmpHexlified=hexlify(value,options);value=arrayify(tmpHexlified);if(length&&value.length!==length&&value.length>0){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}if(maxLength){value=stripZeros(value);if(value.length>maxLength){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}}const hexlified=hexlify(value);raw.push(hexlified)});if(!!signature){raw.push(hexlify(signature))}const finalValue=encode(raw);return finalValue}class Transaction{#to;#data;#nonce;#energyLimit;#energyPrice;#value;#networkId;#sig;get to(){return this.#to}set to(value){this.#to=value==null?null:getAddress(value)}get nonce(){return this.#nonce}set nonce(value){this.#nonce=getNumber(value,"value")}get energyLimit(){return this.#energyLimit}set energyLimit(value){this.#energyLimit=getBigInt(value)}get energyPrice(){const value=this.#energyPrice;if(value==null){return BN_0$4}return value}set energyPrice(value){this.#energyPrice=value==null?null:getBigInt(value,"energyPrice")}get data(){return this.#data}set data(value){this.#data=hexlify(value)}get value(){return this.#value}set value(value){this.#value=getBigInt(value,"value")}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value)}get signature(){return this.#sig||null}set signature(value){this.#sig=value==null?null:value}constructor(){this.#to=null;this.#nonce=0;this.#energyLimit=BigInt(0);this.#energyPrice=null;this.#data="0x";this.#value=BigInt(0);this.#networkId=BigInt(0);this.#sig=null}get hash(){if(this.signature==null){return null}return sha256(this.serialized)}get unsignedHash(){return sha256(this.unsignedSerialized)}get from(){if(this.signature==null){return null}const prefix=networkIdToPrefix(Number(this.#networkId));return recoverAddress(this.unsignedHash,this.signature,prefix)}get fromPublicKey(){if(this.signature==null){return null}return SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){assert(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});return serialize(this,this.signature)}get unsignedSerialized(){return serialize(this)}clone(){return Transaction.from(this)}toJSON(){const s=v=>{if(v==null){return null}return v.toString()};return{to:this.to,data:this.data,nonce:this.nonce,energyLimit:s(this.energyLimit),energyPrice:s(this.energyPrice),value:s(this.value),networkId:s(this.networkId),sig:this.signature?this.signature:null}}static from(tx){if(tx==null){return new Transaction}if(typeof tx==="string"){const payload=getBytes(tx);return Transaction.from(parse(payload))}const result=new Transaction;if(tx.to!=null){result.to=tx.to}if(tx.nonce!=null){result.nonce=tx.nonce}if(tx.energyLimit!=null){result.energyLimit=tx.energyLimit}if(tx.energyPrice!=null){result.energyPrice=tx.energyPrice}if(tx.data!=null){result.data=tx.data}if(tx.value!=null){result.value=tx.value}if(tx.networkId!=null){result.networkId=tx.networkId}if(tx.signature!=null){result.signature=tx.signature}if(tx.hash!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define hash","tx",tx);assertArgument(result.hash===tx.hash,"hash mismatch","tx",tx)}if(tx.from!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define from","tx",tx);assertArgument(result.from.toLowerCase()===(tx.from||"").toLowerCase(),"from mismatch","tx",tx)}return result}}function hashMessage(message){if(typeof message==="string"){message=toUtf8Bytes(message)}return sha256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(message.length)),message]))}function verifyMessage(message,sig,prefix){const digest=hashMessage(message);return recoverAddress(digest,sig,prefix)}const regexBytes=new RegExp("^bytes([0-9]+)$");const regexNumber=new RegExp("^(u?int)([0-9]*)$");const regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$");function _pack(type,value,isArray){switch(type){case"address":if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(getAddress(value));case"string":return toUtf8Bytes(value);case"bytes":return getBytes(value);case"bool":value=!!value?"0x01":"0x00";if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(value)}let match=type.match(regexNumber);if(match){let signed=match[1]==="int";let size=parseInt(match[2]||"256");assertArgument((!match[2]||match[2]===String(size))&&size%8===0&&size!==0&&size<=256,"invalid number type","type",type);if(isArray){size=256}if(signed){value=toTwos(value,size)}return getBytes(zeroPadValue(toBeArray(value),size/8))}match=type.match(regexBytes);if(match){const size=parseInt(match[1]);assertArgument(String(size)===match[1]&&size!==0&&size<=32,"invalid bytes type","type",type);assertArgument(dataLength(value)===size,`invalid value for ${type}`,"value",value);if(isArray){return getBytes(zeroPadBytes(value,32))}return value}match=type.match(regexArray);if(match&&Array.isArray(value)){const baseType=match[1];const count=parseInt(match[2]||String(value.length));assertArgument(count===value.length,`invalid array length for ${type}`,"value",value);const result=[];value.forEach(function(value){result.push(_pack(baseType,value,true))});return getBytes(concat(result))}assertArgument(false,"invalid type","type",type)}function solidityPacked(types,values){assertArgument(types.length===values.length,"wrong number of values; expected ${ types.length }","values",values);const tight=[];types.forEach(function(type,index){tight.push(_pack(type,values[index]))});return hexlify(concat(tight))}function solidityPackedSha256(types,values){return sha256(solidityPacked(types,values))}const padding=new Uint8Array(32);padding.fill(0);const BN__1=BigInt(-1);const BN_0$3=BigInt(0);const BN_1$1=BigInt(1);const BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(value){const bytes=getBytes(value);const padOffset=bytes.length%32;if(padOffset){return concat([bytes,padding.slice(padOffset)])}return hexlify(bytes)}const hexTrue=toBeHex(BN_1$1,32);const hexFalse=toBeHex(BN_0$3,32);const domainFieldTypes={name:"string",version:"string",networkId:"uint256",verifyingContract:"address",salt:"bytes32"};const domainFieldNames=["name","version","networkId","verifyingContract","salt"];function checkString(key){return function(value){assertArgument(typeof value==="string",`invalid domain value for ${JSON.stringify(key)}`,`domain.${key}`,value);return value}}const domainChecks={name:checkString("name"),version:checkString("version"),networkId:function(_value){const value=getBigInt(_value,"domain.networkId");assertArgument(value>=0,"invalid chain ID","domain.networkId",_value);if(Number.isSafeInteger(value)){return Number(value)}return toQuantity(value)},verifyingContract:function(value){try{return getAddress(value).toLowerCase()}catch(error){}assertArgument(false,`invalid domain value "verifyingContract"`,"domain.verifyingContract",value)},salt:function(value){const bytes=getBytes(value,"domain.salt");assertArgument(bytes.length===32,`invalid domain value "salt"`,"domain.salt",value);return hexlify(bytes)}};function getBaseEncoder(type){{const match=type.match(/^(u?)int(\d*)$/);if(match){const signed=match[1]==="";const width=parseInt(match[2]||"256");assertArgument(width%8===0&&width!==0&&width<=256&&(match[2]==null||match[2]===String(width)),"invalid numeric width","type",type);const boundsUpper=mask(BN_MAX_UINT256,signed?width-1:width);const boundsLower=signed?(boundsUpper+BN_1$1)*BN__1:BN_0$3;return function(_value){const value=getBigInt(_value,"value");assertArgument(value>=boundsLower&&value<=boundsUpper,`value out-of-bounds for ${type}`,"value",value);return toBeHex(signed?toTwos(value,256):value,32)}}}{const match=type.match(/^bytes(\d+)$/);if(match){const width=parseInt(match[1]);assertArgument(width!==0&&width<=32&&match[1]===String(width),"invalid bytes width","type",type);return function(value){const bytes=getBytes(value);assertArgument(bytes.length===width,`invalid length for ${type}`,"value",value);return hexPadRight(value)}}}switch(type){case"address":return function(value){return zeroPadValue(getAddress(value),32)};case"bool":return function(value){return!value?hexFalse:hexTrue};case"bytes":return function(value){return sha256(value)};case"string":return function(value){return id(value)}}return null}function encodeType(name,fields){return`${name}(${fields.map(({name,type})=>type+" "+name).join(",")})`}class TypedDataEncoder{primaryType;#types;get types(){return JSON.parse(this.#types)}#fullTypes;#encoderCache;constructor(types){this.#types=JSON.stringify(types);this.#fullTypes=new Map;this.#encoderCache=new Map;const links=new Map;const parents=new Map;const subtypes=new Map;Object.keys(types).forEach(type=>{links.set(type,new Set);parents.set(type,[]);subtypes.set(type,new Set)});for(const name in types){const uniqueNames=new Set;for(const field of types[name]){assertArgument(!uniqueNames.has(field.name),`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`,"types",types);uniqueNames.add(field.name);const baseType=field.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;assertArgument(baseType!==name,`circular type reference to ${JSON.stringify(baseType)}`,"types",types);const encoder=getBaseEncoder(baseType);if(encoder){continue}assertArgument(parents.has(baseType),`unknown type ${JSON.stringify(baseType)}`,"types",types);parents.get(baseType).push(name);links.get(name).add(baseType)}}const primaryTypes=Array.from(parents.keys()).filter(n=>parents.get(n).length===0);assertArgument(primaryTypes.length!==0,"missing primary type","types",types);assertArgument(primaryTypes.length===1,`ambiguous primary types or unused types: ${primaryTypes.map(t=>JSON.stringify(t)).join(", ")}`,"types",types);defineProperties(this,{primaryType:primaryTypes[0]});function checkCircular(type,found){assertArgument(!found.has(type),`circular type reference to ${JSON.stringify(type)}`,"types",types);found.add(type);for(const child of links.get(type)){if(!parents.has(child)){continue}checkCircular(child,found);for(const subtype of found){subtypes.get(subtype).add(child)}}found.delete(type)}checkCircular(this.primaryType,new Set);for(const[name,set]of subtypes){const st=Array.from(set);st.sort();this.#fullTypes.set(name,encodeType(name,types[name])+st.map(t=>encodeType(t,types[t])).join(""))}}getEncoder(type){let encoder=this.#encoderCache.get(type);if(!encoder){encoder=this.#getEncoder(type);this.#encoderCache.set(type,encoder)}return encoder}#getEncoder(type){{const encoder=getBaseEncoder(type);if(encoder){return encoder}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){const subtype=match[1];const subEncoder=this.getEncoder(subtype);return value=>{assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);let result=value.map(subEncoder);if(this.#fullTypes.has(subtype)){result=result.map(sha256)}return sha256(concat(result))}}const fields=this.types[type];if(fields){const encodedType=id(this.#fullTypes.get(type));return value=>{const values=fields.map(({name,type})=>{const result=this.getEncoder(type)(value[name]);if(this.#fullTypes.has(type)){return sha256(result)}return result});values.unshift(encodedType);return concat(values)}}assertArgument(false,`unknown type: ${type}`,"type",type)}encodeType(name){const result=this.#fullTypes.get(name);assertArgument(result,`unknown type: ${JSON.stringify(name)}`,"name",name);return result}encodeData(type,value){return this.getEncoder(type)(value)}hashStruct(name,value){return sha256(this.encodeData(name,value))}encode(value){return this.encodeData(this.primaryType,value)}hash(value){return this.hashStruct(this.primaryType,value)}_visit(type,value,callback){{const encoder=getBaseEncoder(type);if(encoder){return callback(type,value)}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);return value.map(v=>this._visit(match[1],v,callback))}const fields=this.types[type];if(fields){return fields.reduce((accum,{name,type})=>{accum[name]=this._visit(type,value[name],callback);return accum},{})}assertArgument(false,`unknown type: ${type}`,"type",type)}visit(value,callback){return this._visit(this.primaryType,value,callback)}static from(types){return new TypedDataEncoder(types)}static getPrimaryType(types){return TypedDataEncoder.from(types).primaryType}static hashStruct(name,types,value){return TypedDataEncoder.from(types).hashStruct(name,value)}static hashDomain(domain){const domainFields=[];for(const name in domain){if(domain[name]==null){continue}const type=domainFieldTypes[name];assertArgument(type,`invalid typed-data domain key: ${JSON.stringify(name)}`,"domain",domain);domainFields.push({name:name,type:type})}domainFields.sort((a,b)=>{return domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(b.name)});return TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:domainFields},domain)}static encode(domain,types,value){return concat(["0x1901",TypedDataEncoder.hashDomain(domain),TypedDataEncoder.from(types).hash(value)])}static hash(domain,types,value){return sha256(TypedDataEncoder.encode(domain,types,value))}static async resolveNames(domain,types,value,resolveName){domain=Object.assign({},domain);for(const key in domain){if(domain[key]==null){delete domain[key]}}const ensCache={};if(domain.verifyingContract&&!isHexString(domain.verifyingContract,20)){ensCache[domain.verifyingContract]="0x"}const encoder=TypedDataEncoder.from(types);encoder.visit(value,(type,value)=>{if(type==="address"&&!isHexString(value,20)){ensCache[value]="0x"}return value});for(const name in ensCache){ensCache[name]=await resolveName(name)}if(domain.verifyingContract&&ensCache[domain.verifyingContract]){domain.verifyingContract=ensCache[domain.verifyingContract]}value=encoder.visit(value,(type,value)=>{if(type==="address"&&ensCache[value]){return ensCache[value]}return value});return{domain:domain,value:value}}static getPayload(domain,types,value){TypedDataEncoder.hashDomain(domain);const domainValues={};const domainTypes=[];domainFieldNames.forEach(name=>{const value=domain[name];if(value==null){return}domainValues[name]=domainChecks[name](value);domainTypes.push({name:name,type:domainFieldTypes[name]})});const encoder=TypedDataEncoder.from(types);const typesWithDomain=Object.assign({},types);assertArgument(typesWithDomain.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",types);typesWithDomain.EIP712Domain=domainTypes;encoder.encode(value);return{types:typesWithDomain,domain:domainValues,primaryType:encoder.primaryType,message:encoder.visit(value,(type,value)=>{if(type.match(/^bytes(\d*)/)){return hexlify(getBytes(value))}if(type.match(/^u?int/)){return getBigInt(value).toString()}switch(type){case"address":return value.toLowerCase();case"bool":return!!value;case"string":assertArgument(typeof value==="string","invalid string","value",value);return value}assertArgument(false,"unsupported type","type",type)})}}}function verifyTypedData(domain,types,value,signature,prefix){return recoverAddress(TypedDataEncoder.hash(domain,types,value),signature,prefix)}var _a;function setify(items){const result=new Set;items.forEach(k=>result.add(k));return Object.freeze(result)}const _kwVisib="constant external internal payable private public pure view";const KwVisib=setify(_kwVisib.split(" "));const _kwTypes="constructor error event fallback function receive struct";const KwTypes=setify(_kwTypes.split(" "));const _kwModifiers="calldata memory storage payable indexed";const KwModifiers=setify(_kwModifiers.split(" "));const _kwOther="tuple returns";const _keywords=[_kwTypes,_kwModifiers,_kwOther,_kwVisib].join(" ");const Keywords=setify(_keywords.split(" "));const SimpleTokens={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"};const regexWhitespacePrefix=new RegExp("^(\\s*)");const regexNumberPrefix=new RegExp("^([0-9]+)");const regexIdPrefix=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");const regexId=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");const regexType=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class TokenString{#offset;#tokens;get offset(){return this.#offset}get length(){return this.#tokens.length-this.#offset}constructor(tokens){this.#offset=0;this.#tokens=tokens.slice()}clone(){return new _a(this.#tokens)}reset(){this.#offset=0}#subTokenString(from=0,to=0){return new _a(this.#tokens.slice(from,to).map(t=>{return Object.freeze(Object.assign({},t,{match:t.match-from,linkBack:t.linkBack-from,linkNext:t.linkNext-from}))}))}popKeyword(allowed){const top=this.peek();if(top.type!=="KEYWORD"||!allowed.has(top.text)){throw new Error(`expected keyword ${top.text}`)}return this.pop().text}popType(type){if(this.peek().type!==type){throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`)}return this.pop().text}popParen(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=this.#subTokenString(this.#offset+1,top.match+1);this.#offset=top.match+1;return result}popParams(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=[];while(this.#offset=this.#tokens.length){throw new Error("out-of-bounds")}return this.#tokens[this.#offset]}peekKeyword(allowed){const top=this.peekType("KEYWORD");return top!=null&&allowed.has(top)?top:null}peekType(type){if(this.length===0){return null}const top=this.peek();return top.type===type?top.text:null}pop(){const result=this.peek();this.#offset++;return result}toString(){const tokens=[];for(let i=this.#offset;i`}}_a=TokenString;function lex(text){const tokens=[];const throwError=message=>{const token=offset0&&tokens[tokens.length-1].type==="NUMBER"){const value=tokens.pop().text;suffix=value+suffix;tokens[tokens.length-1].value=getNumber(value)}if(tokens.length===0||tokens[tokens.length-1].type!=="BRACKET"){throw new Error("missing opening bracket")}tokens[tokens.length-1].text+=suffix}continue}match=cur.match(regexIdPrefix);if(match){token.text=match[1];offset+=token.text.length;if(Keywords.has(token.text)){token.type="KEYWORD";continue}if(token.text.match(regexType)){token.type="TYPE";continue}token.type="ID";continue}match=cur.match(regexNumberPrefix);if(match){token.text=match[1];token.type="NUMBER";offset+=token.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`)}return new TokenString(tokens.map(t=>Object.freeze(t)))}function allowSingle(set,allowed){let included=[];for(const key in allowed.keys()){if(set.has(key)){included.push(key)}}if(included.length>1){throw new Error(`conflicting types: ${included.join(", ")}`)}}function consumeName(type,tokens){if(tokens.peekKeyword(KwTypes)){const keyword=tokens.pop().text;if(keyword!==type){throw new Error(`expected ${type}, got ${keyword}`)}}return tokens.popType("ID")}function consumeKeywords(tokens,allowed){const keywords=new Set;while(true){const keyword=tokens.peekType("KEYWORD");if(keyword==null||allowed&&!allowed.has(keyword)){break}tokens.pop();if(keywords.has(keyword)){throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`)}keywords.add(keyword)}return Object.freeze(keywords)}function consumeMutability(tokens){let modifiers=consumeKeywords(tokens,KwVisib);allowSingle(modifiers,setify("constant payable nonpayable".split(" ")));allowSingle(modifiers,setify("pure view payable nonpayable".split(" ")));if(modifiers.has("view")){return"view"}if(modifiers.has("pure")){return"pure"}if(modifiers.has("payable")){return"payable"}if(modifiers.has("nonpayable")){return"nonpayable"}if(modifiers.has("constant")){return"view"}return"nonpayable"}function consumeParams(tokens,allowIndexed){return tokens.popParams().map(t=>ParamType.from(t,allowIndexed))}function consumeEnergy(tokens){if(tokens.peekType("AT")){tokens.pop();if(tokens.peekType("NUMBER")){return getBigInt(tokens.pop().text)}throw new Error("invalid energy")}return null}function consumeEoi(tokens){if(tokens.length){throw new Error(`unexpected tokens: ${tokens.toString()}`)}}const regexArrayType=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(type){const match=type.match(regexType);assertArgument(match,"invalid type","type",type);if(type==="uint"){return"uint256"}if(type==="int"){return"int256"}if(match[2]){const length=parseInt(match[2]);assertArgument(length!==0&&length<=32,"invalid bytes length","type",type)}else if(match[3]){const size=parseInt(match[3]);assertArgument(size!==0&&size<=256&&size%8===0,"invalid numeric width","type",type)}return type}const _guard$2={};const internal$1=Symbol.for("_corebc_internal");const ParamTypeInternal="_ParamTypeInternal";const ErrorFragmentInternal="_ErrorInternal";const EventFragmentInternal="_EventInternal";const ConstructorFragmentInternal="_ConstructorInternal";const FallbackFragmentInternal="_FallbackInternal";const FunctionFragmentInternal="_FunctionInternal";const StructFragmentInternal="_StructInternal";class ParamType{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(guard,name,type,baseType,indexed,components,arrayLength,arrayChildren){assertPrivate(guard,_guard$2,"ParamType");Object.defineProperty(this,internal$1,{value:ParamTypeInternal});if(components){components=Object.freeze(components.slice())}if(baseType==="array"){if(arrayLength==null||arrayChildren==null){throw new Error("")}}else if(arrayLength!=null||arrayChildren!=null){throw new Error("")}if(baseType==="tuple"){if(components==null){throw new Error("")}}else if(components!=null){throw new Error("")}defineProperties(this,{name:name,type:type,baseType:baseType,indexed:indexed,components:components,arrayLength:arrayLength,arrayChildren:arrayChildren})}format(format){if(format==null){format="sighash"}if(format==="json"){let result={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||undefined};if(typeof this.indexed==="boolean"){result.indexed=this.indexed}if(this.isTuple()){result.components=this.components.map(c=>JSON.parse(c.format(format)))}return JSON.stringify(result)}let result="";if(this.isArray()){result+=this.arrayChildren.format(format);result+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`}else{if(this.isTuple()){if(format!=="sighash"){result+=this.type}result+="("+this.components.map(comp=>comp.format(format)).join(format==="full"?", ":",")+")"}else{result+=this.type}}if(format!=="sighash"){if(this.indexed===true){result+=" indexed"}if(format==="full"&&this.name){result+=" "+this.name}}return result}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(value,process){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const _this=this;return value.map(v=>_this.arrayChildren.walk(v,process))}if(this.isTuple()){if(!Array.isArray(value)){throw new Error("invalid tuple value")}if(value.length!==this.components.length){throw new Error("array is wrong length")}const _this=this;return value.map((v,i)=>_this.components[i].walk(v,process))}return process(this.type,value)}#walkAsync(promises,value,process,setValue){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const childType=this.arrayChildren;const result=value.slice();result.forEach((value,index)=>{childType.#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}if(this.isTuple()){const components=this.components;let result;if(Array.isArray(value)){result=value.slice()}else{if(value==null||typeof value!=="object"){throw new Error("invalid tuple value")}result=components.map(param=>{if(!param.name){throw new Error("cannot use object value with unnamed components")}if(!(param.name in value)){throw new Error(`missing value for component ${param.name}`)}return value[param.name]})}if(result.length!==this.components.length){throw new Error("array is wrong length")}result.forEach((value,index)=>{components[index].#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}const result=process(this.type,value);if(result.then){promises.push(async function(){setValue(await result)}())}else{setValue(result)}}async walkAsync(value,process){const promises=[];const result=[value];this.#walkAsync(promises,value,process,value=>{result[0]=value});if(promises.length){await Promise.all(promises)}return result[0]}static from(obj,allowIndexed){if(ParamType.isParamType(obj)){return obj}if(typeof obj==="string"){return ParamType.from(lex(obj),allowIndexed)}else if(obj instanceof TokenString){let type="",baseType="";let comps=null;if(consumeKeywords(obj,setify(["tuple"])).has("tuple")||obj.peekType("OPEN_PAREN")){baseType="tuple";comps=obj.popParams().map(t=>ParamType.from(t));type=`tuple(${comps.map(c=>c.format()).join(",")})`}else{type=verifyBasicType(obj.popType("TYPE"));baseType=type}let arrayChildren=null;let arrayLength=null;while(obj.length&&obj.peekType("BRACKET")){const bracket=obj.pop();arrayChildren=new ParamType(_guard$2,"",type,baseType,null,comps,arrayLength,arrayChildren);arrayLength=bracket.value;type+=bracket.text;baseType="array";comps=null}let indexed=null;const keywords=consumeKeywords(obj,KwModifiers);if(keywords.has("indexed")){if(!allowIndexed){throw new Error("")}indexed=true}const name=obj.peekType("ID")?obj.pop().text:"";if(obj.length){throw new Error("leftover tokens")}return new ParamType(_guard$2,name,type,baseType,indexed,comps,arrayLength,arrayChildren)}const name=obj.name;assertArgument(!name||typeof name==="string"&&name.match(regexId),"invalid name","obj.name",name);let indexed=obj.indexed;if(indexed!=null){assertArgument(allowIndexed,"parameter cannot be indexed","obj.indexed",obj.indexed);indexed=!!indexed}let type=obj.type;let arrayMatch=type.match(regexArrayType);if(arrayMatch){const arrayLength=parseInt(arrayMatch[2]||"-1");const arrayChildren=ParamType.from({type:arrayMatch[1],components:obj.components});return new ParamType(_guard$2,name||"",type,"array",indexed,null,arrayLength,arrayChildren)}if(type==="tuple"||type.startsWith("tuple(")||type.startsWith("(")){const comps=obj.components!=null?obj.components.map(c=>ParamType.from(c)):null;const tuple=new ParamType(_guard$2,name||"",type,"tuple",indexed,comps,null,null);return tuple}type=verifyBasicType(obj.type);return new ParamType(_guard$2,name||"",type,type,indexed,null,null,null)}static isParamType(value){return value&&value[internal$1]===ParamTypeInternal}}class Fragment{type;inputs;constructor(guard,type,inputs){assertPrivate(guard,_guard$2,"Fragment");inputs=Object.freeze(inputs.slice());defineProperties(this,{type:type,inputs:inputs})}static from(obj){if(typeof obj==="string"){try{Fragment.from(JSON.parse(obj))}catch(e){}return Fragment.from(lex(obj))}if(obj instanceof TokenString){const type=obj.peekKeyword(KwTypes);switch(type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}}else if(typeof obj==="object"){switch(obj.type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}assert(false,`unsupported type: ${obj.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(false,"unsupported frgament object","obj",obj)}static isConstructor(value){return ConstructorFragment.isFragment(value)}static isError(value){return ErrorFragment.isFragment(value)}static isEvent(value){return EventFragment.isFragment(value)}static isFunction(value){return FunctionFragment.isFragment(value)}static isStruct(value){return StructFragment.isFragment(value)}}class NamedFragment extends Fragment{name;constructor(guard,type,name,inputs){super(guard,type,inputs);assertArgument(typeof name==="string"&&name.match(regexId),"invalid identifier","name",name);inputs=Object.freeze(inputs.slice());defineProperties(this,{name:name})}}function joinParams(format,params){return"("+params.map(p=>p.format(format)).join(format==="full"?", ":",")+")"}class ErrorFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"error",name,inputs);Object.defineProperty(this,internal$1,{value:ErrorFragmentInternal})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(format)))})}const result=[];if(format!=="sighash"){result.push("error")}result.push(this.name+joinParams(format,this.inputs));return result.join(" ")}static from(obj){if(ErrorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ErrorFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("error",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new ErrorFragment(_guard$2,name,inputs)}return new ErrorFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===ErrorFragmentInternal}}class EventFragment extends NamedFragment{anonymous;constructor(guard,name,inputs,anonymous){super(guard,"event",name,inputs);Object.defineProperty(this,internal$1,{value:EventFragmentInternal});defineProperties(this,{anonymous:anonymous})}get topicHash(){return id(this.format("sighash"))}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[];if(format!=="sighash"){result.push("event")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"&&this.anonymous){result.push("anonymous")}return result.join(" ")}static getTopicHash(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new EventFragment(_guard$2,name,params,false);return fragment.topicHash}static from(obj){if(EventFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return EventFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("event",obj);const inputs=consumeParams(obj,true);const anonymous=!!consumeKeywords(obj,setify(["anonymous"])).has("anonymous");consumeEoi(obj);return new EventFragment(_guard$2,name,inputs,anonymous)}return new EventFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(p=>ParamType.from(p,true)):[],!!obj.anonymous)}static isFragment(value){return value&&value[internal$1]===EventFragmentInternal}}class ConstructorFragment extends Fragment{payable;energy;constructor(guard,type,inputs,payable,energy){super(guard,type,inputs);Object.defineProperty(this,internal$1,{value:ConstructorFragmentInternal});defineProperties(this,{payable:payable,energy:energy})}format(format){assert(format!=null&&format!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"});if(format==="json"){return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[`constructor${joinParams(format,this.inputs)}`];result.push(this.payable?"payable":"nonpayable");if(this.energy!=null){result.push(`@${this.energy.toString()}`)}return result.join(" ")}static from(obj){if(ConstructorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ConstructorFragment.from(lex(obj))}else if(obj instanceof TokenString){consumeKeywords(obj,setify(["constructor"]));const inputs=consumeParams(obj);const payable=!!consumeKeywords(obj,setify(["payable"])).has("payable");const energy=consumeEnergy(obj);consumeEoi(obj);return new ConstructorFragment(_guard$2,"constructor",inputs,payable,energy)}return new ConstructorFragment(_guard$2,"constructor",obj.inputs?obj.inputs.map(ParamType.from):[],!!obj.payable,obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===ConstructorFragmentInternal}}class FallbackFragment extends Fragment{payable;constructor(guard,inputs,payable){super(guard,"fallback",inputs);Object.defineProperty(this,internal$1,{value:FallbackFragmentInternal});defineProperties(this,{payable:payable})}format(format){const type=this.inputs.length===0?"receive":"fallback";if(format==="json"){const stateMutability=this.payable?"payable":"nonpayable";return JSON.stringify({type:type,stateMutability:stateMutability})}return`${type}()${this.payable?" payable":""}`}static from(obj){if(FallbackFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FallbackFragment.from(lex(obj))}else if(obj instanceof TokenString){const errorObj=obj.toString();const topIsValid=obj.peekKeyword(setify(["fallback","receive"]));assertArgument(topIsValid,"type must be fallback or receive","obj",errorObj);const type=obj.popKeyword(setify(["fallback","receive"]));if(type==="receive"){const inputs=consumeParams(obj);assertArgument(inputs.length===0,`receive cannot have arguments`,"obj.inputs",inputs);consumeKeywords(obj,setify(["payable"]));consumeEoi(obj);return new FallbackFragment(_guard$2,[],true)}let inputs=consumeParams(obj);if(inputs.length){assertArgument(inputs.length===1&&inputs[0].type==="bytes","invalid fallback inputs","obj.inputs",inputs.map(i=>i.format("minimal")).join(", "))}else{inputs=[ParamType.from("bytes")]}const mutability=consumeMutability(obj);assertArgument(mutability==="nonpayable"||mutability==="payable","fallback cannot be constants","obj.stateMutability",mutability);if(consumeKeywords(obj,setify(["returns"])).has("returns")){const outputs=consumeParams(obj);assertArgument(outputs.length===1&&outputs[0].type==="bytes","invalid fallback outputs","obj.outputs",outputs.map(i=>i.format("minimal")).join(", "))}consumeEoi(obj);return new FallbackFragment(_guard$2,inputs,mutability==="payable")}if(obj.type==="receive"){return new FallbackFragment(_guard$2,[],true)}if(obj.type==="fallback"){const inputs=[ParamType.from("bytes")];const payable=obj.stateMutability==="payable";return new FallbackFragment(_guard$2,inputs,payable)}assertArgument(false,"invalid fallback description","obj",obj)}static isFragment(value){return value&&value[internal$1]===FallbackFragmentInternal}}class FunctionFragment extends NamedFragment{constant;outputs;stateMutability;payable;energy;constructor(guard,name,stateMutability,inputs,outputs,energy){super(guard,"function",name,inputs);Object.defineProperty(this,internal$1,{value:FunctionFragmentInternal});outputs=Object.freeze(outputs.slice());const constant=stateMutability==="view"||stateMutability==="pure";const payable=stateMutability==="payable";defineProperties(this,{constant:constant,energy:energy,outputs:outputs,payable:payable,stateMutability:stateMutability})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format))),outputs:this.outputs.map(o=>JSON.parse(o.format(format)))})}const result=[];if(format!=="sighash"){result.push("function")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"){if(this.stateMutability!=="nonpayable"){result.push(this.stateMutability)}if(this.outputs&&this.outputs.length){result.push("returns");result.push(joinParams(format,this.outputs))}if(this.energy!=null){result.push(`@${this.energy.toString()}`)}}return result.join(" ")}static getSelector(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new FunctionFragment(_guard$2,name,"view",params,[],null);return fragment.selector}static from(obj){if(FunctionFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FunctionFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("function",obj);const inputs=consumeParams(obj);const mutability=consumeMutability(obj);let outputs=[];if(consumeKeywords(obj,setify(["returns"])).has("returns")){outputs=consumeParams(obj)}const energy=consumeEnergy(obj);consumeEoi(obj);return new FunctionFragment(_guard$2,name,mutability,inputs,outputs,energy)}let stateMutability=obj.stateMutability;if(stateMutability==null){stateMutability="payable";if(typeof obj.constant==="boolean"){stateMutability="view";if(!obj.constant){stateMutability="payable";if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}}else if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}return new FunctionFragment(_guard$2,obj.name,stateMutability,obj.inputs?obj.inputs.map(ParamType.from):[],obj.outputs?obj.outputs.map(ParamType.from):[],obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===FunctionFragmentInternal}}class StructFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"struct",name,inputs);Object.defineProperty(this,internal$1,{value:StructFragmentInternal})}format(){throw new Error("@TODO")}static from(obj){if(typeof obj==="string"){return StructFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("struct",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new StructFragment(_guard$2,name,inputs)}return new StructFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===StructFragmentInternal}}const PanicReasons$1=new Map;PanicReasons$1.set(0,"GENERIC_PANIC");PanicReasons$1.set(1,"ASSERT_FALSE");PanicReasons$1.set(17,"OVERFLOW");PanicReasons$1.set(18,"DIVIDE_BY_ZERO");PanicReasons$1.set(33,"ENUM_RANGE_ERROR");PanicReasons$1.set(34,"BAD_STORAGE_DATA");PanicReasons$1.set(49,"STACK_UNDERFLOW");PanicReasons$1.set(50,"ARRAY_RANGE_ERROR");PanicReasons$1.set(65,"OUT_OF_MEMORY");PanicReasons$1.set(81,"UNINITIALIZED_FUNCTION_CALL");const paramTypeBytes=new RegExp(/^bytes([0-9]*)$/);const paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);let defaultCoder=null;function getBuiltinCallException(action,tx,data,abiCoder){let message="missing revert data";let reason=null;const invocation=null;let revert=null;if(data){message="execution reverted";const bytes=getBytes(data);data=hexlify(data);if(bytes.length===0){message+=" (no data present; likely require(false) occurred";reason="require(false)"}else if(bytes.length%32!==4){message+=" (could not decode reason; invalid data length)"}else if(hexlify(bytes.slice(0,4))==="0x08c379a0"){try{reason=abiCoder.decode(["string"],bytes.slice(4))[0];revert={signature:"Error(string)",name:"Error",args:[reason]};message+=`: ${JSON.stringify(reason)}`}catch(error){message+=" (could not decode reason; invalid string data)"}}else if(hexlify(bytes.slice(0,4))==="0x4e487b71"){try{const code=Number(abiCoder.decode(["uint256"],bytes.slice(4))[0]);revert={signature:"Panic(uint256)",name:"Panic",args:[code]};reason=`Panic due to ${PanicReasons$1.get(code)||"UNKNOWN"}(${code})`;message+=`: ${reason}`}catch(error){message+=" (could not decode panic code)"}}else{message+=" (unknown custom error)"}}const transaction={to:tx.to?getAddress(tx.to):null,data:tx.data||"0x"};if(tx.from){transaction.from=getAddress(tx.from)}return makeError(message,"CALL_EXCEPTION",{action:action,data:data,reason:reason,transaction:transaction,invocation:invocation,revert:revert})}class AbiCoder{#getCoder(param){if(param.isArray()){return new ArrayCoder(this.#getCoder(param.arrayChildren),param.arrayLength,param.name)}if(param.isTuple()){return new TupleCoder(param.components.map(c=>this.#getCoder(c)),param.name)}switch(param.baseType){case"address":return new AddressCoder(param.name);case"bool":return new BooleanCoder(param.name);case"string":return new StringCoder(param.name);case"bytes":return new BytesCoder(param.name);case"":return new NullCoder(param.name)}let match=param.type.match(paramTypeNumber);if(match){let size=parseInt(match[2]||"256");assertArgument(size!==0&&size<=256&&size%8===0,"invalid "+match[1]+" bit length","param",param);return new NumberCoder(size/8,match[1]==="int",param.name)}match=param.type.match(paramTypeBytes);if(match){let size=parseInt(match[1]);assertArgument(size!==0&&size<=32,"invalid bytes length","param",param);return new FixedBytesCoder(size,param.name)}assertArgument(false,"invalid type","type",param.type)}getDefaultValue(types){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.defaultValue()}encode(types,values){assertArgumentCount(values.length,types.length,"types/values length mismatch");const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");const writer=new Writer;coder.encode(writer,values);return writer.data}decode(types,data,loose){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.decode(new Reader(data,loose))}static defaultAbiCoder(){if(defaultCoder==null){defaultCoder=new AbiCoder}return defaultCoder}static getBuiltinCallException(action,tx,data){return getBuiltinCallException(action,tx,data,AbiCoder.defaultAbiCoder())}}function encodeBytes32String(text){const bytes=toUtf8Bytes(text);if(bytes.length>31){throw new Error("bytes32 string must be less than 32 bytes")}return zeroPadBytes(bytes,32)}function decodeBytes32String(_bytes){const data=getBytes(_bytes,"bytes");if(data.length!==32){throw new Error("invalid bytes32 - not 32 bytes long")}if(data[31]!==0){throw new Error("invalid bytes32 string - no null terminator")}let length=31;while(data[length-1]===0){length--}return toUtf8String(data.slice(0,length))}class LogDescription{fragment;name;signature;topic;args;constructor(fragment,topic,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,signature:signature,topic:topic,args:args})}}class TransactionDescription{fragment;name;args;signature;selector;value;constructor(fragment,selector,args,value){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector,value:value})}}class ErrorDescription{fragment;name;args;signature;selector;constructor(fragment,selector,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector})}}class Indexed{hash;_isIndexed;static isIndexed(value){return!!(value&&value._isIndexed)}constructor(hash){defineProperties(this,{hash:hash,_isIndexed:true})}}const PanicReasons={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"};const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:message=>{return`reverted with reason string ${JSON.stringify(message)}`}},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:code=>{let reason="unknown panic code";if(code>=0&&code<=255&&PanicReasons[code.toString()]){reason=PanicReasons[code.toString()]}return`reverted with panic code 0x${code.toString(16)} (${reason})`}}};class Interface{fragments;deploy;fallback;receive;#errors;#events;#functions;#abiCoder;constructor(fragments){let abi=[];if(typeof fragments==="string"){abi=JSON.parse(fragments)}else{abi=fragments}this.#functions=new Map;this.#errors=new Map;this.#events=new Map;const frags=[];for(const a of abi){try{frags.push(Fragment.from(a))}catch(error){console.log("EE",error)}}defineProperties(this,{fragments:Object.freeze(frags)});let fallback=null;let receive=false;this.#abiCoder=this.getAbiCoder();this.fragments.forEach((fragment,index)=>{let bucket;switch(fragment.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}defineProperties(this,{deploy:fragment});return;case"fallback":if(fragment.inputs.length===0){receive=true}else{assertArgument(!fallback||fragment.payable!==fallback.payable,"conflicting fallback fragments",`fragments[${index}]`,fragment);fallback=fragment;receive=fallback.payable}return;case"function":bucket=this.#functions;break;case"event":bucket=this.#events;break;case"error":bucket=this.#errors;break;default:return}const signature=fragment.format();if(bucket.has(signature)){return}bucket.set(signature,fragment)});if(!this.deploy){defineProperties(this,{deploy:ConstructorFragment.from("constructor()")})}defineProperties(this,{fallback:fallback,receive:receive})}format(minimal){const format=minimal?"minimal":"full";const abi=this.fragments.map(f=>f.format(format));return abi}formatJson(){const abi=this.fragments.map(f=>f.format("json"));return JSON.stringify(abi.map(j=>JSON.parse(j)))}getAbiCoder(){return AbiCoder.defaultAbiCoder()}#getFunction(key,values,forceUnique){if(isHexString(key)){const selector=key.toLowerCase();for(const fragment of this.#functions.values()){if(selector===fragment.selector){return fragment}}return null}if(key.indexOf("(")===-1){const matching=[];for(const[name,fragment]of this.#functions){if(name.split("(")[0]===key){matching.push(fragment)}}if(values){const lastValue=values.length>0?values[values.length-1]:null;let valueLength=values.length;let allowOptions=true;if(Typed.isTyped(lastValue)&&lastValue.type==="overrides"){allowOptions=false;valueLength--}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs.length;if(inputs!==valueLength&&(!allowOptions||inputs!==valueLength-1)){matching.splice(i,1)}}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs;for(let j=0;j=inputs.length){if(values[j].type==="overrides"){continue}matching.splice(i,1);break}if(values[j].type!==inputs[j].baseType){matching.splice(i,1);break}}}}if(matching.length===1&&values&&values.length!==matching[0].inputs.length){const lastArg=values[values.length-1];if(lastArg==null||Array.isArray(lastArg)||typeof lastArg!=="object"){matching.splice(0,1)}}if(matching.length===0){return null}if(matching.length>1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous function description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#functions.get(FunctionFragment.from(key).format());if(result){return result}return null}getFunctionName(key){const fragment=this.#getFunction(key,null,false);assertArgument(fragment,"no matching function","key",key);return fragment.name}hasFunction(key){return!!this.#getFunction(key,null,false)}getFunction(key,values){return this.#getFunction(key,values||null,true)}forEachFunction(callback){const names=Array.from(this.#functions.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i=0;i--){if(matching[i].inputs.length=0;i--){const inputs=matching[i].inputs;for(let j=0;j1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous event description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#events.get(EventFragment.from(key).format());if(result){return result}return null}getEventName(key){const fragment=this.#getEvent(key,null,false);assertArgument(fragment,"no matching event","key",key);return fragment.name}hasEvent(key){return!!this.#getEvent(key,null,false)}getEvent(key,values){return this.#getEvent(key,values||null,true)}forEachEvent(callback){const names=Array.from(this.#events.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i1){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous error description (i.e. ${matchStr})`,"name",key)}return matching[0]}key=ErrorFragment.from(key).format();if(key==="Error(string)"){return ErrorFragment.from("error Error(string)")}if(key==="Panic(uint256)"){return ErrorFragment.from("error Panic(uint256)")}const result=this.#errors.get(key);if(result){return result}return null}forEachError(callback){const names=Array.from(this.#errors.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i{if(param.type==="string"){return id(value)}else if(param.type==="bytes"){return sha256(hexlify(value))}if(param.type==="bool"&&typeof value==="boolean"){value=value?"0x01":"0x00"}if(param.type.match(/^u?int/)){value=toBeHex(value)}if(param.type==="address"){this.#abiCoder.encode(["address"],[value])}return zeroPadValue(hexlify(value),32)};values.forEach((value,index)=>{const param=fragment.inputs[index];if(!param.indexed){assertArgument(value==null,"cannot filter non-indexed parameters; must be null","contract."+param.name,value);return}if(value==null){topics.push(null)}else if(param.baseType==="array"||param.baseType==="tuple"){assertArgument(false,"filtering with tuples or arrays not supported","contract."+param.name,value)}else if(Array.isArray(value)){topics.push(value.map(value=>encodeTopic(param,value)))}else{topics.push(encodeTopic(param,value))}});while(topics.length&&topics[topics.length-1]===null){topics.pop()}return topics}encodeEventLog(fragment,values){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}const topics=[];const dataTypes=[];const dataValues=[];if(!fragment.anonymous){topics.push(fragment.topicHash)}assertArgument(values.length===fragment.inputs.length,"event arguments/values mismatch","values",values);fragment.inputs.forEach((param,index)=>{const value=values[index];if(param.indexed){if(param.type==="string"){topics.push(id(value))}else if(param.type==="bytes"){topics.push(sha256(value))}else if(param.baseType==="tuple"||param.baseType==="array"){throw new Error("not implemented")}else{topics.push(this.#abiCoder.encode([param.type],[value]))}}else{dataTypes.push(param);dataValues.push(value)}});return{data:this.#abiCoder.encode(dataTypes,dataValues),topics:topics}}decodeEventLog(fragment,data,topics){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}if(topics!=null&&!fragment.anonymous){const eventTopic=fragment.topicHash;assertArgument(isHexString(topics[0],32)&&topics[0].toLowerCase()===eventTopic,"fragment/topic mismatch","topics[0]",topics[0]);topics=topics.slice(1)}const indexed=[];const nonIndexed=[];const dynamic=[];fragment.inputs.forEach((param,index)=>{if(param.indexed){if(param.type==="string"||param.type==="bytes"||param.baseType==="tuple"||param.baseType==="array"){indexed.push(ParamType.from({type:"bytes32",name:param.name}));dynamic.push(true)}else{indexed.push(param);dynamic.push(false)}}else{nonIndexed.push(param);dynamic.push(false)}});const resultIndexed=topics!=null?this.#abiCoder.decode(indexed,concat(topics)):null;const resultNonIndexed=this.#abiCoder.decode(nonIndexed,data,true);const values=[];const keys=[];let nonIndexedIndex=0,indexedIndex=0;fragment.inputs.forEach((param,index)=>{let value=null;if(param.indexed){if(resultIndexed==null){value=new Indexed(null)}else if(dynamic[index]){value=new Indexed(resultIndexed[indexedIndex++])}else{try{value=resultIndexed[indexedIndex++]}catch(error){value=error}}}else{try{value=resultNonIndexed[nonIndexedIndex++]}catch(error){value=error}}values.push(value);keys.push(param.name||null)});return Result.fromItems(values,keys)}parseTransaction(tx){const data=getBytes(tx.data,"tx.data");const value=getBigInt(tx.value!=null?tx.value:0,"tx.value");const fragment=this.getFunction(hexlify(data.slice(0,4)));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,data.slice(4));return new TransactionDescription(fragment,fragment.selector,args,value)}parseCallResult(data){throw new Error("@TODO")}parseLog(log){const fragment=this.getEvent(log.topics[0]);if(!fragment||fragment.anonymous){return null}return new LogDescription(fragment,fragment.topicHash,this.decodeEventLog(fragment,log.data,log.topics))}parseError(data){const hexData=hexlify(data);const fragment=this.getError(dataSlice(hexData,0,4));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,dataSlice(hexData,4));return new ErrorDescription(fragment,fragment.selector,args)}static from(value){if(value instanceof Interface){return value}if(typeof value==="string"){return new Interface(JSON.parse(value))}if(typeof value.format==="function"){return new Interface(value.format("json"))}return new Interface(value)}}const logger=new Logger("contract-address/0.0.1");function getCreateAddress(tx){const from=getAddress(tx.from);const nonce=getBigInt(tx.nonce,"tx.nonce");let nonceHex=nonce.toString(16);if(nonceHex==="0"){nonceHex="0x"}else if(nonceHex.length%2){nonceHex="0x0"+nonceHex}else{nonceHex="0x"+nonceHex}return getAddress(from)}function getCreate2Address(from,salt,initCodeHash){if(hexDataLength(salt)!==32){logger.throwArgumentError("salt must be 32 bytes","salt",salt)}if(hexDataLength(initCodeHash)!==32){logger.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",initCodeHash)}const val=hexDataSlice(sha256(concat(["0xff",getAddress(from),salt,initCodeHash])),12);console.log({"contract-address/74=>should be string":val});const prefix=from.substring(2,4);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function isAddressable(value){return value&&typeof value.getAddress==="function"}function isAddress(value){try{getAddress(value);return true}catch(error){}return false}async function checkAddress(target,promise){const result=await promise;if(result==null||result==="0x0000000000000000000000000000000000000000"){assert(typeof target!=="string","unconfigured name","UNCONFIGURED_NAME",{value:target});assertArgument(false,"invalid AddressLike value; did not resolve to a value address","target",target)}return getAddress(result)}function resolveAddress(target){if(typeof target==="string"){return getAddress(target)}else if(isAddressable(target)){return checkAddress(target,target.getAddress())}else if(target&&typeof target.then==="function"){return checkAddress(target,target)}assertArgument(false,"unsupported addressable value","target",target)}const BN_0$2=BigInt(0);function getValue(value){if(value==null){return null}return value}function toJson(value){if(value==null){return null}return value.toString()}class FeeData{energyPrice;constructor(energyPrice){defineProperties(this,{energyPrice:getValue(energyPrice)})}toJSON(){const{energyPrice}=this;return{_type:"FeeData",energyPrice:toJson(energyPrice)}}}function copyRequest(req){const result={};if(req.to){result.to=req.to}if(req.from){result.from=req.from}if(req.data){result.data=hexlify(req.data)}const bigIntKeys="networkId,energyLimit,energyPrice,value".split(/,/);for(const key of bigIntKeys){if(!(key in req)||req[key]==null){continue}result[key]=getBigInt(req[key],`request.${key}`)}const numberKeys="type,nonce".split(/,/);for(const key of numberKeys){if(!(key in req)||req[key]==null){continue}result[key]=getNumber(req[key],`request.${key}`)}if("blockTag"in req){result.blockTag=req.blockTag}if("enableCcipRead"in req){result.enableCcipReadEnabled=!!req.enableCcipRead}if("customData"in req){result.customData=req.customData}return result}class Block{provider;number;hash;timestamp;parentHash;nonce;difficulty;energyLimit;energyUsed;miner;extraData;baseFeePerEnergy;#transactions;constructor(block,provider){this.#transactions=block.transactions.map(tx=>{if(typeof tx!=="string"){return new TransactionResponse(tx,provider)}return tx});defineProperties(this,{provider:provider,hash:getValue(block.hash),number:block.number,timestamp:block.timestamp,parentHash:block.parentHash,nonce:block.nonce,difficulty:block.difficulty,energyLimit:block.energyLimit,energyUsed:block.energyUsed,miner:block.miner,extraData:block.extraData,baseFeePerEnergy:getValue(block.baseFeePerEnergy)})}get transactions(){return this.#transactions.map(tx=>{if(typeof tx==="string"){return tx}return tx.hash})}get prefetchedTransactions(){const txs=this.#transactions.slice();if(txs.length===0){return[]}assert(typeof txs[0]==="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"});return txs}toJSON(){const{baseFeePerEnergy,difficulty,extraData,energyLimit,energyUsed,hash,miner,nonce,number,parentHash,timestamp,transactions}=this;return{_type:"Block",baseFeePerEnergy:toJson(baseFeePerEnergy),difficulty:toJson(difficulty),extraData:extraData,energyLimit:toJson(energyLimit),energyUsed:toJson(energyUsed),hash:hash,miner:miner,nonce:nonce,number:number,parentHash:parentHash,timestamp:timestamp,transactions:transactions}}[Symbol.iterator](){let index=0;const txs=this.transactions;return{next:()=>{if(index{return new Log(log,provider)}));defineProperties(this,{provider:provider,to:tx.to,from:tx.from,contractAddress:tx.contractAddress,hash:tx.hash,index:tx.index,blockHash:tx.blockHash,blockNumber:tx.blockNumber,logsBloom:tx.logsBloom,energyUsed:tx.energyUsed,cumulativeEnergyUsed:tx.cumulativeEnergyUsed,energyPrice:tx.effectiveEnergyPrice||tx.energyPrice,status:tx.status,root:tx.root})}get logs(){return this.#logs}toJSON(){const{to,from,contractAddress,hash,index,blockHash,blockNumber,logsBloom,logs,status,root}=this;return{_type:"TransactionReceipt",blockHash:blockHash,blockNumber:blockNumber,contractAddress:contractAddress,cumulativeEnergyUsed:toJson(this.cumulativeEnergyUsed),from:from,energyPrice:toJson(this.energyPrice),energyUsed:toJson(this.energyUsed),hash:hash,index:index,logs:logs,logsBloom:logsBloom,root:root,status:status,to:to}}get length(){return this.logs.length}[Symbol.iterator](){let index=0;return{next:()=>{if(index{if(stopScanning){return null}const{blockNumber,nonce}=await resolveProperties({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(nonce=confirms){return receipt}}else{await checkReplacement();if(confirms===0){return null}}const waiter=new Promise((resolve,reject)=>{const cancellers=[];const cancel=()=>{cancellers.forEach(c=>c())};cancellers.push(()=>{stopScanning=true});if(timeout>0){const timer=setTimeout(()=>{cancel();reject(makeError("wait for transaction timeout","TIMEOUT"))},timeout);cancellers.push(()=>{clearTimeout(timer)})}const txListener=async receipt=>{if(await receipt.confirmations()>=confirms){cancel();resolve(receipt)}};cancellers.push(()=>{this.provider.off(this.hash,txListener)});this.provider.on(this.hash,txListener);if(startBlock>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(error){if(isError(error,"TRANSACTION_REPLACED")){cancel();reject(error);return}}if(!stopScanning){this.provider.once("block",replaceListener)}};cancellers.push(()=>{this.provider.off("block",replaceListener)});this.provider.once("block",replaceListener)}});return await waiter}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}removedEvent(){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createRemovedTransactionFilter(this)}reorderedEvent(other){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});assert(!other||other.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createReorderedTransactionFilter(this,other)}replaceableTransaction(startBlock){assertArgument(Number.isInteger(startBlock)&&startBlock>=0,"invalid startBlock","startBlock",startBlock);const tx=new TransactionResponse(this,this.provider);tx.#startBlock=startBlock;return tx}}function createOrphanedBlockFilter(block){return{orphan:"drop-block",hash:block.hash,number:block.number}}function createReorderedTransactionFilter(tx,other){return{orphan:"reorder-transaction",tx:tx,other:other}}function createRemovedTransactionFilter(tx){return{orphan:"drop-transaction",tx:tx}}function createRemovedLogFilter(log){return{orphan:"drop-log",log:{transactionHash:log.transactionHash,blockHash:log.blockHash,blockNumber:log.blockNumber,address:log.address,data:log.data,topics:Object.freeze(log.topics.slice()),index:log.index}}}class EventLog extends Log{interface;fragment;args;constructor(log,iface,fragment){super(log,log.provider);const args=iface.decodeEventLog(fragment,log.data,log.topics);defineProperties(this,{args:args,fragment:fragment,interface:iface})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class ContractTransactionReceipt extends TransactionReceipt{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}get logs(){return super.logs.map(log=>{const fragment=log.topics.length?this.#iface.getEvent(log.topics[0]):null;if(fragment){return new EventLog(log,this.#iface,fragment)}else{return log}})}}class ContractTransactionResponse extends TransactionResponse{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}async wait(confirms){const receipt=await super.wait();if(receipt==null){return null}return new ContractTransactionReceipt(this.#iface,this.provider,receipt)}}class ContractUnknownEventPayload extends EventPayload{log;constructor(contract,listener,filter,log){super(contract,listener,filter);defineProperties(this,{log:log})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class ContractEventPayload extends ContractUnknownEventPayload{constructor(contract,listener,filter,fragment,_log){super(contract,listener,filter,new EventLog(_log,contract.interface,fragment));const args=contract.interface.decodeEventLog(fragment,this.log.data,this.log.topics);defineProperties(this,{args:args,fragment:fragment})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const BN_0$1=BigInt(0);function canCall(value){return value&&typeof value.call==="function"}function canEstimate(value){return value&&typeof value.estimateEnergy==="function"}function canResolve(value){return value&&typeof value.resolveName==="function"}function canSend(value){return value&&typeof value.sendTransaction==="function"}class PreparedTopicFilter{#filter;fragment;constructor(contract,fragment,args){defineProperties(this,{fragment:fragment});if(fragment.inputs.length{const arg=args[index];if(arg==null){return null}return param.walkAsync(args[index],(type,value)=>{if(type==="address"){return resolveAddress(value)}return value})}));return contract.interface.encodeFilterTopics(fragment,resolvedArgs)}()}getTopicFilter(){return this.#filter}}function getRunner(value,feature){if(value==null){return null}if(typeof value[feature]==="function"){return value}if(value.provider&&typeof value.provider[feature]==="function"){return value.provider}return null}function getProvider(value){if(value==null){return null}return value.provider||null}async function copyOverrides(arg,allowed){const overrides=copyRequest(Typed.dereference(arg,"overrides"));assertArgument(overrides.to==null||(allowed||[]).indexOf("to")>=0,"cannot override to","overrides.to",overrides.to);assertArgument(overrides.data==null||(allowed||[]).indexOf("data")>=0,"cannot override data","overrides.data",overrides.data);if(overrides.from){overrides.from=await resolveAddress(overrides.from)}return overrides}async function resolveArgs(_runner,inputs,args){return await Promise.all(inputs.map((param,index)=>{return param.walkAsync(args[index],(type,value)=>{value=Typed.dereference(value,type);if(type==="address"){return resolveAddress(value)}return value})}))}function buildWrappedFallback(contract){const populateTransaction=async function(overrides){const tx=await copyOverrides(overrides,["data"]);tx.to=await contract.getAddress();const iface=contract.interface;const payable=iface.receive||iface.fallback&&iface.fallback.payable;assertArgument(payable||(tx.value||BN_0$1)===BN_0$1,"cannot send value to non-payable contract","overrides.value",tx.value);assertArgument(iface.fallback||(tx.data||"0x")==="0x","cannot send data to receive-only contract","overrides.data",tx.data);return tx};const staticCall=async function(overrides){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(overrides);try{return await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}};const send=async function(overrides){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(overrides));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(overrides){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(overrides))};const method=async overrides=>{return await send(overrides)};defineProperties(method,{_contract:contract,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall});return method}function buildWrappedMethod(contract,key){const getFragment=function(...args){const fragment=contract.interface.getFunction(key,args);assert(fragment,"no matching fragment in getFragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const populateTransaction=async function(...args){const fragment=getFragment(...args);let overrides={};if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("internal error: fragment inputs doesn't match arguments; should not happen")}const resolvedArgs=await resolveArgs(contract.runner,fragment.inputs,args);return Object.assign({},overrides,await resolveProperties({to:contract.getAddress(),data:contract.interface.encodeFunctionData(fragment,resolvedArgs)}))};const staticCall=async function(...args){const result=await staticCallResult(...args);if(result.length===1){return result[0]}return result};const send=async function(...args){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(...args));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(...args){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(...args))};const staticCallResult=async function(...args){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(...args);let result="0x";try{result=await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}const fragment=getFragment(...args);return contract.interface.decodeFunctionResult(fragment,result)};const method=async(...args)=>{const fragment=getFragment(...args);if(fragment.constant){return await staticCall(...args)}return await send(...args)};defineProperties(method,{name:contract.interface.getFunctionName(key),_contract:contract,_key:key,getFragment:getFragment,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getFunction(key);assert(fragment,"no matching fragment in defineProperty","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}function buildWrappedEvent(contract,key){const getFragment=function(...args){const fragment=contract.interface.getEvent(key,args);assert(fragment,"no matching fragment in","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const method=function(...args){return new PreparedTopicFilter(contract,getFragment(...args),args)};defineProperties(method,{name:contract.interface.getEventName(key),_contract:contract,_key:key,getFragment:getFragment});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getEvent(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}const internal=Symbol.for("_corebcInternal_contract");const internalValues=new WeakMap;function setInternal(contract,values){internalValues.set(contract[internal],values)}function getInternal(contract){return internalValues.get(contract[internal])}function isDeferred(value){return value&&typeof value==="object"&&"getTopicFilter"in value&&typeof value.getTopicFilter==="function"&&value.fragment}async function getSubInfo(contract,event){let topics;let fragment=null;if(Array.isArray(event)){const topicHashify=function(name){if(isHexString(name,32)){return name}const fragment=contract.interface.getEvent(name);assertArgument(fragment,"unknown fragment","name",name);return fragment.topicHash};topics=event.map(e=>{if(e==null){return null}if(Array.isArray(e)){return e.map(topicHashify)}return topicHashify(e)})}else if(event==="*"){topics=[null]}else if(typeof event==="string"){if(isHexString(event,32)){topics=[event]}else{fragment=contract.interface.getEvent(event);assertArgument(fragment,"unknown fragment","event",event);topics=[fragment.topicHash]}}else if(isDeferred(event)){topics=await event.getTopicFilter()}else if("fragment"in event){fragment=event.fragment;topics=[fragment.topicHash]}else{assertArgument(false,"unknown event name","event",event)}topics=topics.map(t=>{if(t==null){return null}if(Array.isArray(t)){const items=Array.from(new Set(t.map(t=>t.toLowerCase())).values());if(items.length===1){return items[0]}items.sort();return items}return t.toLowerCase()});const tag=topics.map(t=>{if(t==null){return"null"}if(Array.isArray(t)){return t.join("|")}return t}).join("&");return{fragment:fragment,tag:tag,topics:topics}}async function hasSub(contract,event){const{subs}=getInternal(contract);return subs.get((await getSubInfo(contract,event)).tag)||null}async function getSub(contract,operation,event){const provider=getProvider(contract.runner);assert(provider,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:operation});const{fragment,tag,topics}=await getSubInfo(contract,event);const{addr,subs}=getInternal(contract);let sub=subs.get(tag);if(!sub){const address=addr?addr:contract;const filter={address:address,topics:topics};const listener=log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=contract.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){const _foundFragment=foundFragment;const args=fragment?contract.interface.decodeEventLog(fragment,log.data,log.topics):[];emit(contract,event,args,listener=>{return new ContractEventPayload(contract,listener,event,_foundFragment,log)})}else{emit(contract,event,[],listener=>{return new ContractUnknownEventPayload(contract,listener,event,log)})}};let starting=[];const start=()=>{if(starting.length){return}starting.push(provider.on(filter,listener))};const stop=async()=>{if(starting.length==0){return}let started=starting;starting=[];await Promise.all(started);provider.off(filter,listener)};sub={tag:tag,listeners:[],start:start,stop:stop};subs.set(tag,sub)}return sub}let lastEmit=Promise.resolve();async function _emit(contract,event,args,payloadFunc){await lastEmit;const sub=await hasSub(contract,event);if(!sub){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const passArgs=Array.from(args);if(payloadFunc){passArgs.push(payloadFunc(once?null:listener))}try{listener.call(contract,...passArgs)}catch(error){}return!once});return count>0}async function emit(contract,event,args,payloadFunc){try{await lastEmit}catch(error){}const resultPromise=_emit(contract,event,args,payloadFunc);lastEmit=resultPromise;return await resultPromise}const passProperties=["then"];class BaseContract{target;interface;runner;filters;[internal];fallback;constructor(target,abi,runner,_deployTx){if(runner==null){runner=null}const iface=Interface.from(abi);defineProperties(this,{target:target,runner:runner,interface:iface});Object.defineProperty(this,internal,{value:{}});let addrPromise;let addr=null;let deployTx=null;if(_deployTx){const provider=getProvider(runner);deployTx=new ContractTransactionResponse(this.interface,provider,_deployTx)}let subs=new Map;if(typeof target==="string"){if(isHexString(target)){addr=target;addrPromise=Promise.resolve(target)}else{const resolver=getRunner(runner,"resolveName");if(!canResolve(resolver)){throw makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"})}addrPromise=resolver.resolveName(target).then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}}else{addrPromise=target.getAddress().then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}setInternal(this,{addrPromise:addrPromise,addr:addr,deployTx:deployTx,subs:subs});const filters=new Proxy({},{get:(target,_prop,receiver)=>{if(passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=this.getEvent(prop);if(result){return result}throw new Error(`unknown contract event: ${prop}`)},has:(target,prop)=>{if(passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return Reflect.has(target,prop)||this.interface.hasEvent(String(prop))}});defineProperties(this,{filters:filters});defineProperties(this,{fallback:iface.receive||iface.fallback?buildWrappedFallback(this):null});return new Proxy(this,{get:(target,_prop,receiver)=>{if(_prop in target||passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=target.getFunction(prop);if(result){return result}throw new Error(`unknown contract method: ${prop}`)},has:(target,prop)=>{if(prop in target||passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return target.interface.hasFunction(String(prop))}})}connect(runner){return new BaseContract(this.target,this.interface,runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const provider=getProvider(this.runner);assert(provider,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const code=await provider.getCode(await this.getAddress());if(code==="0x"){return null}return code}async waitForDeployment(){const deployTx=this.deploymentTransaction();if(deployTx){await deployTx.wait();return this}const code=await this.getDeployedCode();if(code!=null){return this}const provider=getProvider(this.runner);assert(provider!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"});return new Promise((resolve,reject)=>{const checkCode=async()=>{try{const code=await this.getDeployedCode();if(code!=null){return resolve(this)}provider.once("block",checkCode)}catch(error){reject(error)}};checkCode()})}deploymentTransaction(){return getInternal(this).deployTx}getFunction(key){if(typeof key!=="string"){key=key.format()}const func=buildWrappedMethod(this,key);return func}getEvent(key){if(typeof key!=="string"){key=key.format()}return buildWrappedEvent(this,key)}async queryTransaction(hash){throw new Error("@TODO")}async queryFilter(event,fromBlock,toBlock){if(fromBlock==null){fromBlock=0}if(toBlock==null){toBlock="latest"}const{addr,addrPromise}=getInternal(this);const address=addr?addr:await addrPromise;const{fragment,topics}=await getSubInfo(this,event);const filter={address:address,topics:topics,fromBlock:fromBlock,toBlock:toBlock};const provider=getProvider(this.runner);assert(provider,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"});return(await provider.getLogs(filter)).map(log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=this.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){return new EventLog(log,this.interface,foundFragment)}else{return new Log(log,provider)}})}async on(event,listener){const sub=await getSub(this,"on",event);sub.listeners.push({listener:listener,once:false});sub.start();return this}async once(event,listener){const sub=await getSub(this,"once",event);sub.listeners.push({listener:listener,once:true});sub.start();return this}async emit(event,...args){return await emit(this,event,args,null)}async listenerCount(event){if(event){const sub=await hasSub(this,event);if(!sub){return 0}return sub.listeners.length}const{subs}=getInternal(this);let total=0;for(const{listeners}of subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}const{subs}=getInternal(this);let result=[];for(const{listeners}of subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await hasSub(this,event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(listener==null||sub.listeners.length===0){sub.stop();getInternal(this).subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return this}sub.stop();getInternal(this).subs.delete(sub.tag)}else{const{subs}=getInternal(this);for(const{tag,stop}of subs.values()){stop();subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return await this.off(event,listener)}static buildClass(abi){class CustomContract extends BaseContract{constructor(address,runner=null){super(address,abi,runner)}}return CustomContract}static from(target,abi,runner){if(runner==null){runner=null}const contract=new this(target,abi,runner);return contract}static isIndexed(value){return Indexed.isIndexed(value)}}function _ContractBase(){return BaseContract}class Contract extends _ContractBase(){}class ContractFactory{interface;bytecode;runner;constructor(abi,bytecode,runner){const iface=Interface.from(abi);if(bytecode instanceof Uint8Array){bytecode=hexlify(getBytes(bytecode))}else if(typeof bytecode==="string"){bytecode=bytecode}else if(isBytes(bytecode)){bytecode=hexlify(bytecode)}else if(bytecode&&typeof bytecode.object==="string"){bytecode=bytecode.object}else{bytecode="!"}defineProperties(this,{bytecode:bytecode,interface:iface,runner:runner||null})}async getDeployTransaction(...args){let overrides={};const fragment=this.interface.deploy;if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("incorrect number of arguments to constructor")}const resolvedArgs=await resolveArgs(this.runner,fragment.inputs,args);const data=concat([this.bytecode,this.interface.encodeDeploy(resolvedArgs)]);return Object.assign({},overrides,{data:data})}async deploy(...args){const tx=await this.getDeployTransaction(...args);assert(this.runner&&typeof this.runner.sendTransaction==="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const sentTx=await this.runner.sendTransaction(tx);const address=getCreateAddress(sentTx);return new BaseContract(address,this.interface,this.runner,sentTx)}connect(runner){return new ContractFactory(this.interface,this.bytecode,runner)}static fromSolidity(output,runner){assertArgument(output!=null,"bad compiler output","output",output);if(typeof output==="string"){output=JSON.parse(output)}const abi=output.abi;let bytecode="";if(output.bytecode){bytecode=output.bytecode}else if(output.evm&&output.evm.bytecode){bytecode=output.evm.bytecode}return new this(abi,bytecode,runner)}}const BN_0=BigInt(0);function allowNull(format,nullValue){return function(value){if(value==null){return nullValue}return format(value)}}function arrayOf(format){return array=>{if(!Array.isArray(array)){throw new Error("not an array")}return array.map(i=>format(i))}}function object(format,altNames){return value=>{const result={};for(const key in format){let srcKey=key;if(altNames&&key in altNames&&!(srcKey in value)){for(const altKey of altNames[key]){if(altKey in value){srcKey=altKey;break}}}try{const nv=format[key](value[srcKey]);if(nv!==undefined){result[key]=nv}}catch(error){const message=error instanceof Error?error.message:"not-an-error";assert(false,`invalid value for value.${key} (${message})`,"BAD_DATA",{value:value})}}return result}}function formatBoolean(value){switch(value){case true:case"true":return true;case false:case"false":return false}assertArgument(false,`invalid boolean; ${JSON.stringify(value)}`,"value",value)}function formatData(value){assertArgument(isHexString(value,true),"invalid data","value",value);return value}function formatHash(value){assertArgument(isHexString(value,32),"invalid hash","value",value);return value}const _formatLog=object({address:getAddress,blockHash:formatHash,blockNumber:getNumber,data:formatData,index:getNumber,removed:allowNull(formatBoolean,false),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:getNumber},{index:["logIndex"]});function formatLog(value){return _formatLog(value)}const _formatBlock=object({hash:allowNull(formatHash),parentHash:formatHash,number:getNumber,timestamp:getNumber,nonce:allowNull(formatData),difficulty:getBigInt,energyLimit:getBigInt,energyUsed:getBigInt,miner:allowNull(getAddress),extraData:formatData,baseFeePerEnergy:allowNull(getBigInt)});function formatBlock(value){const result=_formatBlock(value);result.transactions=value.transactions.map(tx=>{if(typeof tx==="string"){return tx}return formatTransactionResponse(tx)});return result}const _formatReceiptLog=object({transactionIndex:getNumber,blockNumber:getNumber,transactionHash:formatHash,address:getAddress,topics:arrayOf(formatHash),data:formatData,index:getNumber,blockHash:formatHash},{index:["logIndex"]});function formatReceiptLog(value){return _formatReceiptLog(value)}const _formatTransactionReceipt=object({to:allowNull(getAddress,null),from:allowNull(getAddress,null),contractAddress:allowNull(getAddress,null),index:getNumber,root:allowNull(hexlify),energyUsed:getBigInt,logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf(formatReceiptLog),blockNumber:getNumber,cumulativeEnergyUsed:getBigInt,effectiveEnergyPrice:allowNull(getBigInt),status:allowNull(getNumber),type:allowNull(getNumber,0)},{effectiveEnergyPrice:["energyPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionReceipt(value){return _formatTransactionReceipt(value)}function formatTransactionResponse(value){if(value.to&&!getAddress(value.to)&&getBigInt(value.to)===BN_0){value.to="0x0000000000000000000000000000000000000000"}const result=object({hash:formatHash,type:value=>{if(value==="0x"||value==null){return 0}return getNumber(value)},accessList:allowNull(accessListify,null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(getNumber,null),transactionIndex:allowNull(getNumber,null),from:getAddress,maxFeePerEnergy:allowNull(getBigInt),energyLimit:getBigInt,to:allowNull(getAddress,null),value:getBigInt,nonce:getNumber,data:formatData,creates:allowNull(getAddress,null),networkId:allowNull(getBigInt,null)},{data:["input"],energyLimit:["energy"]})(value);if(result.to==null&&result.creates==null){result.creates=getCreateAddress(result)}if(value.signature){result.signature=value.signature}else{result.signature=value}if(result.networkId==null){const networkId=result.signature.legacynetworkId;if(networkId!=null){result.networkId=networkId}}if(result.blockHash&&getBigInt(result.blockHash)===BN_0){result.blockHash=null}return result}class NetworkPlugin{name;constructor(name){defineProperties(this,{name:name})}clone(){return new NetworkPlugin(this.name)}}class EnergyCostPlugin extends NetworkPlugin{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(effectiveBlock,costs){if(effectiveBlock==null){effectiveBlock=0}super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock||0}`);const props={effectiveBlock:effectiveBlock};function set(name,nullish){let value=(costs||{})[name];if(value==null){value=nullish}assertArgument(typeof value==="number",`invalud value for ${name}`,"costs",costs);props[name]=value}set("txBase",21e3);set("txCreate",32e3);set("txDataZero",4);set("txDataNonzero",16);set("txAccessListStorageKey",1900);set("txAccessListAddress",2400);defineProperties(this,props)}clone(){return new EnergyCostPlugin(this.effectiveBlock,this)}}class FeeDataNetworkPlugin extends NetworkPlugin{#feeDataFunc;get feeDataFunc(){return this.#feeDataFunc}constructor(feeDataFunc){super("org.corebc.plugins.network.FeeData");this.#feeDataFunc=feeDataFunc}async getFeeData(provider){return await this.#feeDataFunc(provider)}clone(){return new FeeDataNetworkPlugin(this.#feeDataFunc)}}const Networks=new Map;class Network{#name;#networkId;#plugins;constructor(name,networkId){this.#name=name;this.#networkId=getBigInt(networkId);this.#plugins=new Map}toJSON(){return{name:this.name,networkId:String(this.networkId)}}get name(){return this.#name}set name(value){this.#name=value}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value,"networkId")}matches(other){if(other==null){return false}if(typeof other==="string"){try{return this.networkId===getBigInt(other)}catch(error){}return this.name===other}if(typeof other==="number"||typeof other==="bigint"){try{return this.networkId===getBigInt(other)}catch(error){}return false}if(typeof other==="object"){if(other.networkId!=null){try{return this.networkId===getBigInt(other.networkId)}catch(error){}return false}if(other.name!=null){return this.name===other.name}return false}return false}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.clone());return this}getPlugin(name){return this.#plugins.get(name)||null}getPlugins(basename){return this.plugins.filter(p=>p.name.split("#")[0]===basename)}clone(){const clone=new Network(this.name,this.networkId);this.plugins.forEach(plugin=>{clone.attachPlugin(plugin.clone())});return clone}computeIntrinsicEnergy(tx){const costs=this.getPlugin("org.corebc.plugins.network.EnergyCost")||new EnergyCostPlugin;let energy=costs.txBase;if(tx.to==null){energy+=costs.txCreate}if(tx.data){for(let i=2;i{Network.register(name,func)})}}registerEth("mainnet",1,{ensNetwork:1,altNames:["homestead"]});registerEth("ropsten",3,{ensNetwork:3});registerEth("rinkeby",4,{ensNetwork:4});registerEth("goerli",5,{ensNetwork:5});registerEth("kovan",42,{ensNetwork:42});registerEth("sepolia",11155111,{});registerEth("classic",61,{});registerEth("classicKotti",6,{});registerEth("xdai",100,{ensNetwork:1})}function copy$2(obj){return JSON.parse(JSON.stringify(obj))}class PollingBlockSubscriber{#provider;#poller;#interval;#blockNumber;constructor(provider){this.#provider=provider;this.#poller=null;this.#interval=4e3;this.#blockNumber=-2}get pollingInterval(){return this.#interval}set pollingInterval(value){this.#interval=value}async#poll(){try{const blockNumber=await this.#provider.getBlockNumber();if(this.#blockNumber===-2){this.#blockNumber=blockNumber;return}if(blockNumber!==this.#blockNumber){for(let b=this.#blockNumber+1;b<=blockNumber;b++){if(this.#poller==null){return}await this.#provider.emit("block",b)}this.#blockNumber=blockNumber}}catch(error){}if(this.#poller==null){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval)}start(){if(this.#poller){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval);this.#poll()}stop(){if(!this.#poller){return}this.#provider._clearTimeout(this.#poller);this.#poller=null}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}class OnBlockSubscriber{#provider;#poll;#running;constructor(provider){this.#provider=provider;this.#running=false;this.#poll=blockNumber=>{this._poll(blockNumber,this.#provider)}}async _poll(blockNumber,provider){throw new Error("sub-classes must override this")}start(){if(this.#running){return}this.#running=true;this.#poll(-2);this.#provider.on("block",this.#poll)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poll)}pause(dropWhilePaused){this.stop()}resume(){this.start()}}class PollingOrphanSubscriber extends OnBlockSubscriber{#filter;constructor(provider,filter){super(provider);this.#filter=copy$2(filter)}async _poll(blockNumber,provider){throw new Error("@TODO")}}class PollingTransactionSubscriber extends OnBlockSubscriber{#hash;constructor(provider,hash){super(provider);this.#hash=hash}async _poll(blockNumber,provider){const tx=await provider.getTransactionReceipt(this.#hash);if(tx){provider.emit(this.#hash,tx)}}}class PollingEventSubscriber{#provider;#filter;#poller;#running;#blockNumber;constructor(provider,filter){this.#provider=provider;this.#filter=copy$2(filter);this.#poller=this.#poll.bind(this);this.#running=false;this.#blockNumber=-2}async#poll(blockNumber){if(this.#blockNumber===-2){return}const filter=copy$2(this.#filter);filter.fromBlock=this.#blockNumber+1;filter.toBlock=blockNumber;const logs=await this.#provider.getLogs(filter);if(logs.length===0){if(this.#blockNumber{this.#blockNumber=blockNumber})}this.#provider.on("block",this.#poller)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poller)}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}const MAX_CCIP_REDIRECTS=10;function isPromise(value){return value&&typeof value.then==="function"}function getTag(prefix,value){return prefix+":"+JSON.stringify(value,(k,v)=>{if(v==null){return"null"}if(typeof v==="bigint"){return`bigint:${v.toString()}`}if(typeof v==="string"){return v.toLowerCase()}if(typeof v==="object"&&!Array.isArray(v)){const keys=Object.keys(v);keys.sort();return keys.reduce((accum,key)=>{accum[key]=v[key];return accum},{})}return v})}class UnmanagedSubscriber{name;constructor(name){defineProperties(this,{name:name})}start(){}stop(){}pause(dropWhilePaused){}resume(){}}function copy$1(value){return JSON.parse(JSON.stringify(value))}function concisify(items){items=Array.from(new Set(items).values());items.sort();return items}async function getSubscription(_event,provider){if(_event==null){throw new Error("invalid event")}if(Array.isArray(_event)){_event={topics:_event}}if(typeof _event==="string"){switch(_event){case"block":case"pending":case"debug":case"error":case"network":{return{type:_event,tag:_event}}}}if(isHexString(_event,32)){const hash=_event.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:hash}),hash:hash}}if(_event.orphan){const event=_event;return{type:"orphan",tag:getTag("orphan",event),filter:copy$1(event)}}if(_event.address||_event.topics){const event=_event;const filter={topics:(event.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()})};if(event.address){const addresses=[];const promises=[];const addAddress=addr=>{if(isHexString(addr)){addresses.push(addr)}else{promises.push((async()=>{addresses.push(await resolveAddress(addr))})())}};if(Array.isArray(event.address)){event.address.forEach(addAddress)}else{addAddress(event.address)}if(promises.length){await Promise.all(promises)}filter.address=concisify(addresses.map(a=>a.toLowerCase()))}return{filter:filter,tag:getTag("event",filter),type:"event"}}assertArgument(false,"unknown ProviderEvent","event",_event)}function getTime$1(){return(new Date).getTime()}class AbstractProvider{#subs;#plugins;#pausedState;#networkPromise;#anyNetwork;#performCache;#lastBlockNumber;#nextTimer;#timers;#disableCcipRead;constructor(_network){if(_network==="any"){this.#anyNetwork=true;this.#networkPromise=null}else if(_network){const network=Network.from(_network);this.#anyNetwork=false;this.#networkPromise=Promise.resolve(network);setTimeout(()=>{this.emit("network",network,null)},0)}else{this.#anyNetwork=false;this.#networkPromise=null}this.#lastBlockNumber=-1;this.#performCache=new Map;this.#subs=new Map;this.#plugins=new Map;this.#pausedState=null;this.#nextTimer=1;this.#timers=new Map;this.#disableCcipRead=false}get provider(){return this}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.connect(this));return this}getPlugin(name){return this.#plugins.get(name)||null}get disableCcipRead(){return this.#disableCcipRead}set disableCcipRead(value){this.#disableCcipRead=!!value}async#perform(req){const tag=getTag(req.method,req);let perform=this.#performCache.get(tag);if(!perform){perform=this._perform(req);this.#performCache.set(tag,perform);setTimeout(()=>{if(this.#performCache.get(tag)===perform){this.#performCache.delete(tag)}},250)}return await perform}async ccipReadFetch(tx,calldata,urls){if(this.disableCcipRead||urls.length===0||tx.to==null){return null}const sender=tx.to.toLowerCase();const data=calldata.toLowerCase();const errorMessages=[];for(let i=0;i=500,`response not found during CCIP fetch: ${errorMessage}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:tx,info:{url:url,errorMessage:errorMessage}});errorMessages.push(errorMessage)}assert(false,`error encountered during CCIP fetch: ${errorMessages.map(m=>JSON.stringify(m)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:tx,info:{urls:urls,errorMessages:errorMessages}})}_wrapBlock(value,network){return new Block(formatBlock(value),this)}_wrapLog(value,network){return new Log(formatLog(value),this)}_wrapTransactionReceipt(value,network){return new TransactionReceipt(formatTransactionReceipt(value),this)}_wrapTransactionResponse(tx,network){return new TransactionResponse(formatTransactionResponse(tx),this)}_detectNetwork(){assert(false,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(req){assert(false,`unsupported method: ${req.method}`,"UNSUPPORTED_OPERATION",{operation:req.method,info:req})}async getBlockNumber(){const blockNumber=getNumber(await this.#perform({method:"getBlockNumber"}),"%response");if(this.#lastBlockNumber>=0){this.#lastBlockNumber=blockNumber}return blockNumber}_getAddress(address){return resolveAddress(address)}_getBlockTag(blockTag){if(blockTag==null){return"latest"}switch(blockTag){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return blockTag}if(isHexString(blockTag)){if(isHexString(blockTag,32)){return blockTag}return toQuantity(blockTag)}if(typeof blockTag==="bigint"){blockTag=getNumber(blockTag,"blockTag")}if(typeof blockTag==="number"){if(blockTag>=0){return toQuantity(blockTag)}if(this.#lastBlockNumber>=0){return toQuantity(this.#lastBlockNumber+blockTag)}return this.getBlockNumber().then(b=>toQuantity(b+blockTag))}assertArgument(false,"invalid blockTag","blockTag",blockTag)}_getFilter(filter){const topics=(filter.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()});const blockHash="blockHash"in filter?filter.blockHash:undefined;const resolve=(_address,fromBlock,toBlock)=>{let address=undefined;switch(_address.length){case 0:break;case 1:address=_address[0];break;default:_address.sort();address=_address}if(blockHash){if(fromBlock!=null||toBlock!=null){throw new Error("invalid filter")}}const filter={};if(address){filter.address=address}if(topics.length){filter.topics=topics}if(fromBlock){filter.fromBlock=fromBlock}if(toBlock){filter.toBlock=toBlock}if(blockHash){filter.blockHash=blockHash}return filter};let address=[];if(filter.address){if(Array.isArray(filter.address)){for(const addr of filter.address){address.push(this._getAddress(addr))}}else{address.push(this._getAddress(filter.address))}}let fromBlock=undefined;if("fromBlock"in filter){fromBlock=this._getBlockTag(filter.fromBlock)}let toBlock=undefined;if("toBlock"in filter){toBlock=this._getBlockTag(filter.toBlock)}if(address.filter(a=>typeof a!=="string").length||fromBlock!=null&&typeof fromBlock!=="string"||toBlock!=null&&typeof toBlock!=="string"){return Promise.all([Promise.all(address),fromBlock,toBlock]).then(result=>{return resolve(result[0],result[1],result[2])})}return resolve(address,fromBlock,toBlock)}_getTransactionRequest(_request){const request=copyRequest(_request);const promises=[];["to","from"].forEach(key=>{if(request[key]==null){return}const addr=resolveAddress(request[key]);if(isPromise(addr)){promises.push(async function(){request[key]=await addr}())}else{request[key]=addr}});if(request.blockTag!=null){const blockTag=this._getBlockTag(request.blockTag);if(isPromise(blockTag)){promises.push(async function(){request.blockTag=await blockTag}())}else{request.blockTag=blockTag}}if(promises.length){return async function(){await Promise.all(promises);return request}()}return request}async getNetwork(){if(this.#networkPromise==null){const detectNetwork=this._detectNetwork().then(network=>{this.emit("network",network,null);return network},error=>{if(this.#networkPromise===detectNetwork){this.#networkPromise=null}throw error});this.#networkPromise=detectNetwork;return(await detectNetwork).clone()}const networkPromise=this.#networkPromise;const[expected,actual]=await Promise.all([networkPromise,this._detectNetwork()]);if(expected.networkId!==actual.networkId){if(this.#anyNetwork){this.emit("network",actual,expected);if(this.#networkPromise===networkPromise){this.#networkPromise=Promise.resolve(actual)}}else{assert(false,`network changed: ${expected.networkId} => ${actual.networkId} `,"NETWORK_ERROR",{event:"changed"})}}return expected.clone()}async getEnergyPrice(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async getFeeData(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async estimateEnergy(_tx){let tx=this._getTransactionRequest(_tx);if(isPromise(tx)){tx=await tx}return getBigInt(await this.#perform({method:"estimateEnergy",transaction:tx}),"%response")}async#call(tx,blockTag,attempt){assert(attempt=0&&blockTag==="latest"&&transaction.to!=null&&dataSlice(error.data,0,4)==="0x556f1830"){const data=error.data;const txSender=await resolveAddress(transaction.to);let ccipArgs;try{ccipArgs=parseOffchainLookup(dataSlice(error.data,4))}catch(error){assert(false,error.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:transaction,info:{data:data}})}assert(ccipArgs.sender.toLowerCase()===txSender.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:data,reason:"OffchainLookup",transaction:transaction,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ccipArgs.errorArgs}});const ccipResult=await this.ccipReadFetch(transaction,ccipArgs.calldata,ccipArgs.urls);assert(ccipResult!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:transaction,info:{data:error.data,errorArgs:ccipArgs.errorArgs}});const tx={to:txSender,data:concat([ccipArgs.selector,encodeBytes([ccipResult,ccipArgs.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:tx});try{const result=await this.#call(tx,blockTag,attempt+1);this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},tx),result:result});return result}catch(error){this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},tx),error:error});throw error}}throw error}}async#checkNetwork(promise){const{value}=await resolveProperties({network:this.getNetwork(),value:promise});return value}async call(_tx){const{tx,blockTag}=await resolveProperties({tx:this._getTransactionRequest(_tx),blockTag:this._getBlockTag(_tx.blockTag)});return await this.#checkNetwork(this.#call(tx,blockTag,_tx.enableCcipRead?0:-1))}async#getAccountValue(request,_address,_blockTag){let address=this._getAddress(_address);let blockTag=this._getBlockTag(_blockTag);if(typeof address!=="string"||typeof blockTag!=="string"){[address,blockTag]=await Promise.all([address,blockTag])}return await this.#checkNetwork(this.#perform(Object.assign(request,{address:address,blockTag:blockTag})))}async getBalance(address,blockTag){return getBigInt(await this.#getAccountValue({method:"getBalance"},address,blockTag),"%response")}async getTransactionCount(address,blockTag){return getNumber(await this.#getAccountValue({method:"getTransactionCount"},address,blockTag),"%response")}async getCode(address,blockTag){return hexlify(await this.#getAccountValue({method:"getCode"},address,blockTag))}async getStorage(address,_position,blockTag){const position=getBigInt(_position,"position");return hexlify(await this.#getAccountValue({method:"getStorage",position:position},address,blockTag))}async broadcastTransaction(signedTx){const{blockNumber,hash,network}=await resolveProperties({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:signedTx}),network:this.getNetwork()});const tx=Transaction.from(signedTx);if(tx.hash!==hash){throw new Error("@TODO: the returned hash did not match")}return this._wrapTransactionResponse(tx,network).replaceableTransaction(blockNumber)}async#getBlock(block,includeTransactions){if(isHexString(block,32)){return await this.#perform({method:"getBlock",blockHash:block,includeTransactions:includeTransactions})}let blockTag=this._getBlockTag(block);if(typeof blockTag!=="string"){blockTag=await blockTag}return await this.#perform({method:"getBlock",blockTag:blockTag,includeTransactions:includeTransactions})}async getBlock(block,prefetchTxs){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#getBlock(block,!!prefetchTxs)});if(params==null){return null}return this._wrapBlock(params,network)}async getTransaction(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransaction",hash:hash})});if(params==null){return null}return this._wrapTransactionResponse(params,network)}async getTransactionReceipt(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransactionReceipt",hash:hash})});if(params==null){return null}if(params.energyPrice==null&¶ms.effectiveEnergyPrice==null){const tx=await this.#perform({method:"getTransaction",hash:hash});if(tx==null){throw new Error("report this; could not find tx or effectiveEnergyPrice")}params.effectiveEnergyPrice=tx.energyPrice}return this._wrapTransactionReceipt(params,network)}async getTransactionResult(hash){const{result}=await resolveProperties({network:this.getNetwork(),result:this.#perform({method:"getTransactionResult",hash:hash})});if(result==null){return null}return hexlify(result)}async getLogs(_filter){let filter=this._getFilter(_filter);if(isPromise(filter)){filter=await filter}const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getLogs",filter:filter})});return params.map(p=>this._wrapLog(p,network))}_getProvider(networkId){assert(false,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async waitForTransaction(hash,_confirms,timeout){const confirms=_confirms!=null?_confirms:1;if(confirms===0){return this.getTransactionReceipt(hash)}return new Promise(async(resolve,reject)=>{let timer=null;const listener=async blockNumber=>{try{const receipt=await this.getTransactionReceipt(hash);if(receipt!=null){if(blockNumber-receipt.blockNumber+1>=confirms){resolve(receipt);if(timer){clearTimeout(timer);timer=null}return}}}catch(error){console.log("EEE",error)}this.once("block",listener)};if(timeout!=null){timer=setTimeout(()=>{if(timer==null){return}timer=null;this.off("block",listener);reject(makeError("timeout","TIMEOUT",{reason:"timeout"}))},timeout)}listener(await this.getBlockNumber())})}async waitForBlock(blockTag){assert(false,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(timerId){const timer=this.#timers.get(timerId);if(!timer){return}if(timer.timer){clearTimeout(timer.timer)}this.#timers.delete(timerId)}_setTimeout(_func,timeout){if(timeout==null){timeout=0}const timerId=this.#nextTimer++;const func=()=>{this.#timers.delete(timerId);_func()};if(this.paused){this.#timers.set(timerId,{timer:null,func:func,time:timeout})}else{const timer=setTimeout(func,timeout);this.#timers.set(timerId,{timer:timer,func:func,time:getTime$1()})}return timerId}_forEachSubscriber(func){for(const sub of this.#subs.values()){func(sub.subscriber)}}_getSubscriber(sub){switch(sub.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(sub.type);case"block":return new PollingBlockSubscriber(this);case"event":return new PollingEventSubscriber(this,sub.filter);case"transaction":return new PollingTransactionSubscriber(this,sub.hash);case"orphan":return new PollingOrphanSubscriber(this,sub.filter)}throw new Error(`unsupported event: ${sub.type}`)}_recoverSubscriber(oldSub,newSub){for(const sub of this.#subs.values()){if(sub.subscriber===oldSub){if(sub.started){sub.subscriber.stop()}sub.subscriber=newSub;if(sub.started){newSub.start()}if(this.#pausedState!=null){newSub.pause(this.#pausedState)}break}}}async#hasSub(event,emitArgs){let sub=await getSubscription(event);if(sub.type==="event"&&emitArgs&&emitArgs.length>0&&emitArgs[0].removed===true){sub=await getSubscription({orphan:"drop-log",log:emitArgs[0]})}return this.#subs.get(sub.tag)||null}async#getSub(event){const subscription=await getSubscription(event);const tag=subscription.tag;let sub=this.#subs.get(tag);if(!sub){const subscriber=this._getSubscriber(subscription);const addressableMap=new WeakMap;const nameMap=new Map;sub={subscriber:subscriber,tag:tag,addressableMap:addressableMap,nameMap:nameMap,started:false,listeners:[]};this.#subs.set(tag,sub)}return sub}async on(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:false});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async once(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:true});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async emit(event,...args){const sub=await this.#hasSub(event,args);if(!sub||sub.listeners.length===0){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const payload=new EventPayload(this,once?null:listener,event);try{listener.call(this,...args,payload)}catch(error){}return!once});if(sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return count>0}async listenerCount(event){if(event){const sub=await this.#hasSub(event);if(!sub){return 0}return sub.listeners.length}let total=0;for(const{listeners}of this.#subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await this.#hasSub(event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}let result=[];for(const{listeners}of this.#subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await this.#hasSub(event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(!listener||sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const{tag,started,subscriber}=await this.#getSub(event);if(started){subscriber.stop()}this.#subs.delete(tag)}else{for(const[tag,{started,subscriber}]of this.#subs){if(started){subscriber.stop()}this.#subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return this.off(event,listener)}destroy(){this.removeAllListeners();for(const timerId of this.#timers.keys()){this._clearTimeout(timerId)}}get paused(){return this.#pausedState!=null}set paused(pause){if(!!pause===this.paused){return}if(this.paused){this.resume()}else{this.pause(false)}}pause(dropWhilePaused){this.#lastBlockNumber=-1;if(this.#pausedState!=null){if(this.#pausedState==!!dropWhilePaused){return}assert(false,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(s=>s.pause(dropWhilePaused));this.#pausedState=!!dropWhilePaused;for(const timer of this.#timers.values()){if(timer.timer){clearTimeout(timer.timer)}timer.time=getTime$1()-timer.time}}resume(){if(this.#pausedState==null){return}this._forEachSubscriber(s=>s.resume());this.#pausedState=null;for(const timer of this.#timers.values()){let timeout=timer.time;if(timeout<0){timeout=0}timer.time=getTime$1();setTimeout(timer.func,timeout)}}}function _parseString(result,start){try{const bytes=_parseBytes(result,start);if(bytes){return toUtf8String(bytes)}}catch(error){}return null}function _parseBytes(result,start){if(result==="0x"){return null}try{const offset=getNumber(dataSlice(result,start,start+32));const length=getNumber(dataSlice(result,offset,offset+32));return dataSlice(result,offset+32,offset+32+length)}catch(error){}return null}function numPad(value){const result=toBeArray(value);if(result.length>32){throw new Error("internal; should not happen")}const padded=new Uint8Array(32);padded.set(result,32-result.length);return padded}function bytesPad(value){if(value.length%32===0){return value}const result=new Uint8Array(Math.ceil(value.length/32)*32);result.set(value);return result}const empty=new Uint8Array([]);function encodeBytes(datas){const result=[];let byteCount=0;for(let i=0;i=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const sender=dataSlice(data,0,32);assert(dataSlice(sender,0,12)===dataSlice(zeros,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"});result.sender=dataSlice(sender,12);try{const urls=[];const urlsOffset=getNumber(dataSlice(data,32,64));const urlsLength=getNumber(dataSlice(data,urlsOffset,urlsOffset+32));const urlsData=dataSlice(data,urlsOffset+32);for(let u=0;uresult[k]);return result}function checkProvider(signer,operation){if(signer.provider){return signer.provider}assert(false,"missing provider","UNSUPPORTED_OPERATION",{operation:operation})}async function populate(signer,tx){let pop=copyRequest(tx);if(pop.to!=null){pop.to=resolveAddress(pop.to)}if(pop.from!=null){const from=pop.from;pop.from=Promise.all([signer.getAddress(),resolveAddress(from)]).then(([address,from])=>{assertArgument(address.toLowerCase()===from.toLowerCase(),"transaction from mismatch","tx.from",from);return address})}else{pop.from=signer.getAddress()}return await resolveProperties(pop)}class AbstractSigner{provider;constructor(provider){defineProperties(this,{provider:provider||null})}async getNonce(blockTag){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),blockTag)}async populateCall(tx){const pop=await populate(this,tx);return pop}async populateTransaction(tx){const provider=checkProvider(this,"populateTransaction");const pop=await populate(this,tx);if(pop.nonce==null){pop.nonce=await this.getNonce("pending")}if(pop.energyLimit==null){pop.energyLimit=await this.estimateEnergy(pop)}const network=await this.provider.getNetwork();if(pop.networkId!=null){const networkId=getBigInt(pop.networkId);assertArgument(networkId===network.networkId,"transaction networkId mismatch","tx.networkId",tx.networkId)}else{pop.networkId=network.networkId}const feeData=await provider.getFeeData();if(feeData.energyPrice!=null){if(pop.energyPrice==null){pop.energyPrice=feeData.energyPrice}}else{assert(false,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"})}return await resolveProperties(pop)}async estimateEnergy(tx){return checkProvider(this,"estimateEnergy").estimateEnergy(await this.populateCall(tx))}async call(tx){return checkProvider(this,"call").call(await this.populateCall(tx))}async resolveName(name){return getAddress(name)}async sendTransaction(tx){const provider=checkProvider(this,"sendTransaction");const pop=await this.populateTransaction(tx);delete pop.from;const txObj=Transaction.from(pop);return await provider.broadcastTransaction(await this.signTransaction(txObj))}}class VoidSigner extends AbstractSigner{address;constructor(address,provider){super(provider);defineProperties(this,{address:address})}async getAddress(){return this.address}connect(provider){return new VoidSigner(this.address,provider)}#throwUnsupported(suffix,operation){assert(false,`VoidSigner cannot sign ${suffix}`,"UNSUPPORTED_OPERATION",{operation:operation})}async signTransaction(tx){this.#throwUnsupported("transactions","signTransaction")}async signMessage(message){this.#throwUnsupported("messages","signMessage")}async signTypedData(domain,types,value){this.#throwUnsupported("typed-data","signTypedData")}}const shown=new Set;function showThrottleMessage(service){if(shown.has(service)){return}shown.add(service);console.log("========= NOTICE =========");console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);console.log("");console.log("The default API keys for each service are provided as a highly-throttled,");console.log("community resource for low-traffic projects and early prototyping.");console.log("");console.log("While your application will continue to function, we highly recommended");console.log("signing up for your own API keys to improve performance, increase your");console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");console.log("")}function copy(obj){return JSON.parse(JSON.stringify(obj))}class FilterIdSubscriber{#provider;#filterIdPromise;#poller;#running;#network;#hault;constructor(provider){this.#provider=provider;this.#filterIdPromise=null;this.#poller=this.#poll.bind(this);this.#running=false;this.#network=null;this.#hault=false}_subscribe(provider){throw new Error("subclasses must override this")}_emitResults(provider,result){throw new Error("subclasses must override this")}_recover(provider){throw new Error("subclasses must override this")}async#poll(blockNumber){try{if(this.#filterIdPromise==null){this.#filterIdPromise=this._subscribe(this.#provider)}let filterId=null;try{filterId=await this.#filterIdPromise}catch(error){if(!isError(error,"UNSUPPORTED_OPERATION")||error.operation!=="xcb_newFilter"){throw error}}if(filterId==null){this.#filterIdPromise=null;this.#provider._recoverSubscriber(this,this._recover(this.#provider));return}const network=await this.#provider.getNetwork();if(!this.#network){this.#network=network}if(this.#network.networkId!==network.networkId){throw new Error("chaid changed")}if(this.#hault){return}const result=await this.#provider.send("xcb_getFilterChanges",[filterId]);await this._emitResults(this.#provider,result)}catch(error){console.log("@TODO",error)}this.#provider.once("block",this.#poller)}#teardown(){const filterIdPromise=this.#filterIdPromise;if(filterIdPromise){this.#filterIdPromise=null;filterIdPromise.then(filterId=>{this.#provider.send("xcb_uninstallFilter",[filterId])})}}start(){if(this.#running){return}this.#running=true;this.#poll(-2)}stop(){if(!this.#running){return}this.#running=false;this.#hault=true;this.#teardown();this.#provider.off("block",this.#poller)}pause(dropWhilePaused){if(dropWhilePaused){this.#teardown()}this.#provider.off("block",this.#poller)}resume(){this.start()}}class FilterIdEventSubscriber extends FilterIdSubscriber{#event;constructor(provider,filter){super(provider);this.#event=copy(filter)}_recover(provider){return new PollingEventSubscriber(provider,this.#event)}async _subscribe(provider){const filterId=await provider.send("xcb_newFilter",[this.#event]);return filterId}async _emitResults(provider,results){for(const result of results){provider.emit(this.#event,provider._wrapLog(result,provider._network))}}}class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(provider){return await provider.send("xcb_newPendingTransactionFilter",[])}async _emitResults(provider,results){for(const result of results){provider.emit("pending",result)}}}const Primitive="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy(value){if(value==null||Primitive.indexOf(typeof value)>=0){return value}if(typeof value.getAddress==="function"){return value}if(Array.isArray(value)){return value.map(deepCopy)}if(typeof value==="object"){return Object.keys(value).reduce((accum,key)=>{accum[key]=value[key];return accum},{})}throw new Error(`should not happen: ${value} (${typeof value})`)}function stall$3(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getLowerCase(value){if(value){return value.toLowerCase()}return value}function isPollable(value){return value&&typeof value.pollingInterval==="number"}const defaultOptions={polling:false,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100};class JsonRpcSigner extends AbstractSigner{address;constructor(provider,address){super(provider);address=getAddress(address);defineProperties(this,{address:address})}connect(provider){assert(false,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(tx){return await this.populateCall(tx)}async sendUncheckedTransaction(_tx){const tx=deepCopy(_tx);const promises=[];if(tx.from){const _from=tx.from;promises.push((async()=>{const from=await resolveAddress(_from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from})())}else{tx.from=this.address}if(tx.energyLimit==null){promises.push((async()=>{tx.energyLimit=await this.provider.estimateEnergy({...tx,from:this.address})})())}if(tx.to!=null){const _to=tx.to;promises.push((async()=>{tx.to=await resolveAddress(_to)})())}if(promises.length){await Promise.all(promises)}const hexTx=this.provider.getRpcTransaction(tx);return this.provider.send("xcb_sendTransaction",[hexTx])}async sendTransaction(tx){const blockNumber=await this.provider.getBlockNumber();const hash=await this.sendUncheckedTransaction(tx);return await new Promise((resolve,reject)=>{const timeouts=[1e3,100];const checkTx=async()=>{const tx=await this.provider.getTransaction(hash);if(tx!=null){resolve(tx.replaceableTransaction(blockNumber));return}this.provider._setTimeout(()=>{checkTx()},timeouts.pop()||4e3)};checkTx()})}async signTransaction(_tx){const tx=deepCopy(_tx);if(tx.from){const from=await resolveAddress(tx.from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from}else{tx.from=this.address}const hexTx=this.provider.getRpcTransaction(tx);return await this.provider.send("xcb_signTransaction",[hexTx])}async signMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("personal_sign",[hexlify(message),this.address.toLowerCase()])}async signTypedData(domain,types,_value){const value=deepCopy(_value);const populated=await TypedDataEncoder.resolveNames(domain,types,value,async value=>{const address=await resolveAddress(value);assertArgument(address!=null,"TypedData does not support null address","value",value);return address});return await this.provider.send("xcb_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(populated.domain,types,populated.value))])}async unlock(password){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),password,null])}async _legacySignMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("xcb_sign",[this.address.toLowerCase(),hexlify(message)])}}class JsonRpcApiProvider extends AbstractProvider{#options;#nextId;#payloads;#drainTimer;#notReady;#network;#scheduleDrain(){if(this.#drainTimer){return}const stallTime=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#drainTimer=setTimeout(()=>{this.#drainTimer=null;const payloads=this.#payloads;this.#payloads=[];while(payloads.length){const batch=[payloads.shift()];while(payloads.length){if(batch.length===this.#options.batchMaxCount){break}batch.push(payloads.shift());const bytes=JSON.stringify(batch.map(p=>p.payload));if(bytes.length>this.#options.batchMaxSize){payloads.unshift(batch.pop());break}}(async()=>{const payload=batch.length===1?batch[0].payload:batch.map(p=>p.payload);this.emit("debug",{action:"sendRpcPayload",payload:payload});try{const result=await this._send(payload);this.emit("debug",{action:"receiveRpcResult",result:result});for(const{resolve,reject,payload}of batch){const resp=result.filter(r=>r.id===payload.id)[0];if(resp==null){return reject(makeError("no response from server","BAD_DATA",{value:result,info:{payload:payload}}))}if("error"in resp){return reject(this.getRpcError(payload,resp))}resolve(resp.result)}}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});for(const{reject}of batch){reject(error)}}})()}},stallTime)}constructor(network,options){super(network);this.#nextId=1;this.#options=Object.assign({},defaultOptions,options||{});this.#payloads=[];this.#drainTimer=null;this.#network=null;{let resolve=null;const promise=new Promise(_resolve=>{resolve=_resolve});this.#notReady={promise:promise,resolve:resolve}}const staticNetwork=this._getOption("staticNetwork");if(staticNetwork){assertArgument(network==null||staticNetwork.matches(network),"staticNetwork MUST match network object","options",options);this.#network=staticNetwork}}_getOption(key){return this.#options[key]}get _network(){assert(this.#network,"network is not available yet","NETWORK_ERROR");return this.#network}async _perform(req){const request=this.getRpcRequest(req);if(request!=null){return await this.send(request.method,request.args)}return super._perform(req)}async _detectNetwork(){const network=this._getOption("staticNetwork");if(network){return network}if(this.ready){return Network.from(getBigInt(await this.send("xcb_networkId",[])))}const payload={id:this.#nextId++,method:"xcb_networkId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:payload});let result;try{result=(await this._send(payload))[0]}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});throw error}this.emit("debug",{action:"receiveRpcResult",result:result});if("result"in result){return Network.from(getBigInt(result.result))}throw this.getRpcError(payload,result)}_start(){if(this.#notReady==null||this.#notReady.resolve==null){return}this.#notReady.resolve();this.#notReady=null;(async()=>{while(this.#network==null){try{this.#network=await this._detectNetwork()}catch(error){console.log("JsonRpcProvider failed to startup; retry in 1s");await stall$3(1e3)}}this.#scheduleDrain()})()}async _waitUntilReady(){if(this.#notReady==null){return}return await this.#notReady.promise}_getSubscriber(sub){if(sub.type==="pending"){return new FilterIdPendingSubscriber(this)}if(sub.type==="event"){if(this._getOption("polling")){return new PollingEventSubscriber(this,sub.filter)}return new FilterIdEventSubscriber(this,sub.filter)}if(sub.type==="orphan"&&sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("orphan")}return super._getSubscriber(sub)}get ready(){return this.#notReady==null}getRpcTransaction(tx){const result={};["networkId","energyLimit","energyPrice","type","nonce","value"].forEach(key=>{if(tx[key]==null){return}let dstKey=key;if(key==="energyLimit"){dstKey="energy"}result[dstKey]=toQuantity(getBigInt(tx[key],`tx.${key}`))});["from","to","data"].forEach(key=>{if(tx[key]==null){return}result[key]=hexlify(tx[key])});return result}getRpcRequest(req){switch(req.method){case"networkId":return{method:"xcb_networkId",args:[]};case"getBlockNumber":return{method:"xcb_blockNumber",args:[]};case"getEnergyPrice":return{method:"xcb_energyPrice",args:[]};case"getBalance":{return{method:"xcb_getBalance",args:[getLowerCase(req.address),req.blockTag]}}case"getTransactionCount":return{method:"xcb_getTransactionCount",args:[getLowerCase(req.address),req.blockTag]};case"getCode":return{method:"xcb_getCode",args:[getLowerCase(req.address),req.blockTag]};case"getStorage":return{method:"xcb_getStorageAt",args:[getLowerCase(req.address),"0x"+req.position.toString(16),req.blockTag]};case"broadcastTransaction":return{method:"xcb_sendRawTransaction",args:[req.signedTransaction]};case"getBlock":if("blockTag"in req){return{method:"xcb_getBlockByNumber",args:[req.blockTag,!!req.includeTransactions]}}else if("blockHash"in req){return{method:"xcb_getBlockByHash",args:[req.blockHash,!!req.includeTransactions]}}break;case"getTransaction":return{method:"xcb_getTransactionByHash",args:[req.hash]};case"getTransactionReceipt":return{method:"xcb_getTransactionReceipt",args:[req.hash]};case"call":return{method:"xcb_call",args:[this.getRpcTransaction(req.transaction),req.blockTag]};case"estimateEnergy":{return{method:"xcb_estimateEnergy",args:[this.getRpcTransaction(req.transaction)]}}case"getLogs":if(req.filter&&req.filter.address!=null){if(Array.isArray(req.filter.address)){req.filter.address=req.filter.address.map(getLowerCase)}else{req.filter.address=getLowerCase(req.filter.address)}}return{method:"xcb_getLogs",args:[req.filter]}}return null}getRpcError(payload,_error){const{method}=payload;const{error}=_error;if(method==="xcb_estimateEnergy"&&error.message){const msg=error.message;if(!msg.match(/revert/i)&&msg.match(/insufficient funds/i)){return makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:payload.params[0],info:{payload:payload,error:error}})}}if(method==="xcb_call"||method==="xcb_estimateEnergy"){const result=spelunkData(error);const e=AbiCoder.getBuiltinCallException(method==="xcb_call"?"call":"estimateEnergy",payload.params[0],result?result.data:null);e.info={error:error,payload:payload};return e}const message=JSON.stringify(spelunkMessage(error));if(typeof error.message==="string"&&error.message.match(/user denied|corebc-user-denied/i)){const actionMap={xcb_sign:"signMessage",personal_sign:"signMessage",xcb_signTypedData_v4:"signTypedData",xcb_signTransaction:"signTransaction",xcb_sendTransaction:"sendTransaction",xcb_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return makeError(`user rejected action`,"ACTION_REJECTED",{action:actionMap[method]||"unknown",reason:"rejected",info:{payload:payload,error:error}})}if(method==="xcb_sendRawTransaction"||method==="xcb_sendTransaction"){const transaction=payload.params[0];if(message.match(/insufficient funds|base fee exceeds energy limit/i)){return makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction,info:{error:error}})}if(message.match(/nonce/i)&&message.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:transaction,info:{error:error}})}if(message.match(/replacement transaction/i)&&message.match(/underpriced/i)){return makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction,info:{error:error}})}if(message.match(/only replay-protected/i)){return makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:method,info:{transaction:transaction,info:{error:error}}})}}if(message.match(/the method .* does not exist/i)){return makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:payload.method,info:{error:error}})}return makeError("could not coalesce error","UNKNOWN_ERROR",{error:error})}send(method,params){const id=this.#nextId++;const promise=new Promise((resolve,reject)=>{this.#payloads.push({resolve:resolve,reject:reject,payload:{method:method,params:params,id:id,jsonrpc:"2.0"}})});this.#scheduleDrain();return promise}async getSigner(address){if(address==null){address=0}const accountsPromise=this.send("xcb_accounts",[]);if(typeof address==="number"){const accounts=await accountsPromise;if(address>=accounts.length){throw new Error("no such account")}return new JsonRpcSigner(this,accounts[address])}const{accounts}=await resolveProperties({network:this.getNetwork(),accounts:accountsPromise});address=getAddress(address);for(const account of accounts){if(getAddress(account)===address){return new JsonRpcSigner(this,address)}}throw new Error("invalid account")}async listAccounts(){const accounts=await this.send("xcb_accounts",[]);return accounts.map(a=>new JsonRpcSigner(this,a))}}class JsonRpcApiPollingProvider extends JsonRpcApiProvider{#pollingInterval;constructor(network,options){super(network,options);this.#pollingInterval=4e3}_getSubscriber(sub){const subscriber=super._getSubscriber(sub);if(isPollable(subscriber)){subscriber.pollingInterval=this.#pollingInterval}return subscriber}get pollingInterval(){return this.#pollingInterval}set pollingInterval(value){if(!Number.isInteger(value)||value<0){throw new Error("invalid interval")}this.#pollingInterval=value;this._forEachSubscriber(sub=>{if(isPollable(sub)){sub.pollingInterval=this.#pollingInterval}})}}class JsonRpcProvider extends JsonRpcApiPollingProvider{#connect;constructor(url,network,options){if(url==null){url="http://localhost:8545"}super(network,options);if(typeof url==="string"){this.#connect=new FetchRequest(url)}else{this.#connect=url.clone()}}_getConnection(){return this.#connect.clone()}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){const request=this._getConnection();request.body=JSON.stringify(payload);request.setHeader("content-type","application/json");const response=await request.send();response.assertOk();let resp=response.bodyJson;if(!Array.isArray(resp)){resp=[resp]}return resp}}function spelunkData(value){if(value==null){return null}if(typeof value.message==="string"&&value.message.match("reverted")&&isHexString(value.data)){return{message:value.message,data:value.data}}if(typeof value==="object"){for(const key in value){const result=spelunkData(value[key]);if(result){return result}}return null}if(typeof value==="string"){try{return spelunkData(JSON.parse(value))}catch(error){}}return null}function _spelunkMessage(value,result){if(value==null){return}if(typeof value.message==="string"){result.push(value.message)}if(typeof value==="object"){for(const key in value){_spelunkMessage(value[key],result)}}if(typeof value==="string"){try{return _spelunkMessage(JSON.parse(value),result)}catch(error){}}}function spelunkMessage(value){const result=[];_spelunkMessage(value,result);return result}const defaultApiKey$1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function getHost$4(name){switch(name){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/xcb_goerli";case"matic":return"rpc.ankr.com/polygon";case"arbitrum":return"rpc.ankr.com/arbitrum"}assertArgument(false,"unsupported network","network",name)}class AnkrProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey$1}const options={polling:true,staticNetwork:network};const request=AnkrProvider.getRequest(network,apiKey);super(request,network,options);defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AnkrProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey$1}const request=new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey$1){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("AnkrProvider");return true}}return request}getRpcError(payload,error){if(payload.method==="xcb_sendRawTransaction"){if(error&&error.error&&error.error.message==="INTERNAL_ERROR: could not replace existing tx"){error.error.message="replacement transaction underpriced"}}return super.getRpcError(payload,error)}isCommunityResource(){return this.apiKey===defaultApiKey$1}}const defaultApiKey="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function getHost$3(name){switch(name){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com"}assertArgument(false,"unsupported network","network",name)}class AlchemyProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey}const request=AlchemyProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AlchemyProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}async _perform(req){if(req.method==="getTransactionResult"){const{trace,tx}=await resolveProperties({trace:this.send("trace_transaction",[req.hash]),tx:this.getTransaction(req.hash)});if(trace==null||tx==null){return null}let data;let error=false;try{data=trace[0].result.output;error=trace[0].error==="Reverted"}catch(error){}if(data){assert(!error,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:data,reason:null,transaction:tx,invocation:null,revert:null});return data}assert(false,"could not parse trace result","BAD_DATA",{value:trace})}return await super._perform(req)}isCommunityResource(){return this.apiKey===defaultApiKey}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey}const request=new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("alchemy");return true}}return request}}class CloudflareProvider extends JsonRpcProvider{constructor(_network){if(_network==null){_network="mainnet"}const network=Network.from(_network);assertArgument(network.name==="mainnet","unsupported network","network",_network);super("https://cloudflare-eth.com/",network,{staticNetwork:network})}}function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const _WebSocket=getGlobal().WebSocket;class SocketSubscriber{#provider;#filter;get filter(){return JSON.parse(this.#filter)}#filterId;#paused;#emitPromise;constructor(provider,filter){this.#provider=provider;this.#filter=JSON.stringify(filter);this.#filterId=null;this.#paused=null;this.#emitPromise=null}start(){this.#filterId=this.#provider.send("xcb_subscribe",this.filter).then(filterId=>{this.#provider._register(filterId,this);return filterId})}stop(){this.#filterId.then(filterId=>{this.#provider.send("xcb_unsubscribe",[filterId])});this.#filterId=null}pause(dropWhilePaused){assert(dropWhilePaused,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"});this.#paused=!!dropWhilePaused}resume(){this.#paused=null}_handleMessage(message){if(this.#filterId==null){return}if(this.#paused===null){let emitPromise=this.#emitPromise;if(emitPromise==null){emitPromise=this._emit(this.#provider,message)}else{emitPromise=emitPromise.then(async()=>{await this._emit(this.#provider,message)})}this.#emitPromise=emitPromise.then(()=>{if(this.#emitPromise===emitPromise){this.#emitPromise=null}})}}async _emit(provider,message){throw new Error("sub-classes must implemente this; _emit")}}class SocketBlockSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newHeads"])}async _emit(provider,message){provider.emit("block",parseInt(message.number))}}class SocketPendingSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newPendingTransactions"])}async _emit(provider,message){provider.emit("pending",message)}}class SocketEventSubscriber extends SocketSubscriber{#logFilter;get logFilter(){return JSON.parse(this.#logFilter)}constructor(provider,filter){super(provider,["logs",filter]);this.#logFilter=JSON.stringify(filter)}async _emit(provider,message){provider.emit(this.logFilter,provider._wrapLog(message,provider._network))}}class SocketProvider extends JsonRpcApiProvider{#callbacks;#subs;#pending;constructor(network){super(network,{batchMaxCount:1});this.#callbacks=new Map;this.#subs=new Map;this.#pending=new Map}_getSubscriber(sub){switch(sub.type){case"close":return new UnmanagedSubscriber("close");case"block":return new SocketBlockSubscriber(this);case"pending":return new SocketPendingSubscriber(this);case"event":return new SocketEventSubscriber(this,sub.filter);case"orphan":if(sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("drop-log")}}return super._getSubscriber(sub)}_register(filterId,subscriber){this.#subs.set(filterId,subscriber);const pending=this.#pending.get(filterId);if(pending){for(const message of pending){subscriber._handleMessage(message)}this.#pending.delete(filterId)}}async _send(payload){assertArgument(!Array.isArray(payload),"WebSocket does not support batch send","payload",payload);const promise=new Promise((resolve,reject)=>{this.#callbacks.set(payload.id,{payload:payload,resolve:resolve,reject:reject})});await this._waitUntilReady();await this._write(JSON.stringify(payload));return[await promise]}async _processMessage(message){const result=JSON.parse(message);if("id"in result){const callback=this.#callbacks.get(result.id);if(callback==null){this.emit("error",makeError("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:result}));return}this.#callbacks.delete(result.id);callback.resolve(result)}else if(result.method==="xcb_subscription"){const filterId=result.params.subscription;const subscriber=this.#subs.get(filterId);if(subscriber){subscriber._handleMessage(result.params.result)}else{let pending=this.#pending.get(filterId);if(pending==null){pending=[];this.#pending.set(filterId,pending)}pending.push(result.params.result)}}}async _write(message){throw new Error("sub-classes must override this")}}class WebSocketProvider extends SocketProvider{#connect;#websocket;get websocket(){if(this.#websocket==null){throw new Error("websocket closed")}return this.#websocket}constructor(url,network){super(network);if(typeof url==="string"){this.#connect=()=>{return new _WebSocket(url)};this.#websocket=this.#connect()}else if(typeof url==="function"){this.#connect=url;this.#websocket=url()}else{this.#connect=null;this.#websocket=url}this.websocket.onopen=async()=>{try{await this._start();this.resume()}catch(error){console.log("failed to start WebsocketProvider",error)}};this.websocket.onmessage=message=>{this._processMessage(message.data)}}async _write(message){this.websocket.send(message)}async destroy(){if(this.#websocket!=null){this.#websocket.close();this.#websocket=null}super.destroy()}}const defaultProjectId="84842078b09946638c03157f83405213";function getHost$2(name){switch(name){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io"}assertArgument(false,"unsupported network","network",name)}class InfuraWebSocketProvider extends WebSocketProvider{projectId;projectSecret;constructor(network,projectId){const provider=new InfuraProvider(network,projectId);const req=provider._getConnection();assert(!req.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const url=req.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(url,network);defineProperties(this,{projectId:provider.projectId,projectSecret:provider.projectSecret})}isCommunityResource(){return this.projectId===defaultProjectId}}class InfuraProvider extends JsonRpcProvider{projectId;projectSecret;constructor(_network,projectId,projectSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=InfuraProvider.getRequest(network,projectId,projectSecret);super(request,network,{staticNetwork:network});defineProperties(this,{projectId:projectId,projectSecret:projectSecret})}_getProvider(networkId){try{return new InfuraProvider(networkId,this.projectId,this.projectSecret)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.projectId===defaultProjectId}static getWebSocketProvider(network,projectId){return new InfuraWebSocketProvider(network,projectId)}static getRequest(network,projectId,projectSecret){if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`);request.allowGzip=true;if(projectSecret){request.setCredentials("",projectSecret)}if(projectId===defaultProjectId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("InfuraProvider");return true}}return request}}const defaultToken="919b412a057b5e9c9b6dce193c5a60242d6efadb";function getHost$1(name){switch(name){case"mainnet":return"corebc.quiknode.pro";case"arbitrum":return"corebc.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"corebc.arbitrum-goerli.quiknode.pro";case"matic":return"corebc.matic.quiknode.pro";case"matic-mumbai":return"corebc.matic-testnet.quiknode.pro";case"optimism":return"corebc.optimism.quiknode.pro";case"optimism-goerli":return"corebc.optimism-goerli.quiknode.pro"}assertArgument(false,"unsupported network","network",name)}class QuickNodeProvider extends JsonRpcProvider{token;constructor(_network,token){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(token==null){token=defaultToken}const request=QuickNodeProvider.getRequest(network,token);super(request,network,{staticNetwork:network});defineProperties(this,{token:token})}_getProvider(networkId){try{return new QuickNodeProvider(networkId,this.token)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.token===defaultToken}static getRequest(network,token){if(token==null){token=defaultToken}const request=new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`);request.allowGzip=true;if(token===defaultToken){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("QuickNodeProvider");return true}}return request}}const BN_1=BigInt("1");const BN_2=BigInt("2");function shuffle(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));const tmp=array[i];array[i]=array[j];array[j]=tmp}}function stall$2(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getTime(){return(new Date).getTime()}function stringify(value){return JSON.stringify(value,(key,value)=>{if(typeof value==="bigint"){return{type:"bigint",value:value.toString()}}return value})}const defaultConfig={stallTimeout:400,priority:1,weight:1};const defaultState={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0};async function waitForSync(config,blockNumber){while(config.blockNumber<0||config.blockNumber{const blockNumber=await config.provider.getBlockNumber();if(blockNumber>config.blockNumber){config.blockNumber=blockNumber}config._updateNumber=null})()}await config._updateNumber;config.outOfSync++}}function _normalize(value){if(value==null){return"null"}if(Array.isArray(value)){return"["+value.map(_normalize).join(",")+"]"}if(typeof value==="object"&&typeof value.toJSON==="function"){return _normalize(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":case"number":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{"+keys.map(k=>`${JSON.stringify(k)}:${_normalize(value[k])}`).join(",")+"}"}}console.log("Could not serialize",value);throw new Error("Hmm...")}function normalizeResult(value){if("error"in value){const error=value.error;return{tag:_normalize(error),value:error}}const result=value.result;return{tag:_normalize(result),value:result}}function checkQuorum(quorum,results){const tally=new Map;for(const{value,tag,weight}of results){const t=tally.get(tag)||{value:value,weight:0};t.weight+=weight;tally.set(tag,t)}let best=null;for(const r of tally.values()){if(r.weight>=quorum&&(!best||r.weight>best.weight)){best=r}}if(best){return best.value}return undefined}function getMedian(quorum,results){let resultWeight=0;const errorMap=new Map;let bestError=null;const values=[];for(const{value,tag,weight}of results){if(value instanceof Error){const e=errorMap.get(tag)||{value:value,weight:0};e.weight+=weight;errorMap.set(tag,e);if(bestError==null||e.weight>bestError.weight){bestError=e}}else{values.push(BigInt(value));resultWeight+=weight}}if(resultWeight=quorum){return bestError.value}return undefined}values.sort((a,b)=>aa?1:0);const mid=Math.floor(values.length/2);if(values.length%2){return values[mid]}return(values[mid-1]+values[mid]+BN_1)/BN_2}function getAnyResult(quorum,results){const result=checkQuorum(quorum,results);if(result!==undefined){return result}for(const r of results){if(r.value){return r.value}}return undefined}function getFuzzyMode(quorum,results){if(quorum===1){return getNumber(getMedian(quorum,results),"%internal")}const tally=new Map;const add=(result,weight)=>{const t=tally.get(result)||{result:result,weight:0};t.weight+=weight;tally.set(result,t)};for(const{weight,value}of results){const r=getNumber(value);add(r-1,weight);add(r,weight);add(r+1,weight)}let bestWeight=0;let bestResult=undefined;for(const{weight,result}of tally.values()){if(weight>=quorum&&(weight>bestWeight||bestResult!=null&&weight===bestWeight&&result>bestResult)){bestWeight=weight;bestResult=result}}return bestResult}class FallbackProvider extends AbstractProvider{quorum;eventQuorum;eventWorkers;#configs;#height;#initialSyncPromise;constructor(providers,network){super(network);this.#configs=providers.map(p=>{if(p instanceof AbstractProvider){return Object.assign({provider:p},defaultConfig,defaultState)}else{return Object.assign({},defaultConfig,p,defaultState)}});this.#height=-2;this.#initialSyncPromise=null;this.quorum=2;this.eventQuorum=1;this.eventWorkers=1;assertArgument(this.quorum<=this.#configs.reduce((a,c)=>a+c.weight,0),"quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return this.#configs.map(c=>{const result=Object.assign({},c);for(const key in result){if(key[0]==="_"){delete result[key]}}return result})}async _detectNetwork(){return Network.from(getBigInt(await this._perform({method:"networkId"})))}async _translatePerform(provider,req){switch(req.method){case"broadcastTransaction":return await provider.broadcastTransaction(req.signedTransaction);case"call":return await provider.call(Object.assign({},req.transaction,{blockTag:req.blockTag}));case"networkId":return(await provider.getNetwork()).networkId;case"estimateEnergy":return await provider.estimateEnergy(req.transaction);case"getBalance":return await provider.getBalance(req.address,req.blockTag);case"getBlock":{const block="blockHash"in req?req.blockHash:req.blockTag;return await provider.getBlock(block,req.includeTransactions)}case"getBlockNumber":return await provider.getBlockNumber();case"getCode":return await provider.getCode(req.address,req.blockTag);case"getEnergyPrice":return(await provider.getFeeData()).energyPrice;case"getLogs":return await provider.getLogs(req.filter);case"getStorage":return await provider.getStorage(req.address,req.position,req.blockTag);case"getTransaction":return await provider.getTransaction(req.hash);case"getTransactionCount":return await provider.getTransactionCount(req.address,req.blockTag);case"getTransactionReceipt":return await provider.getTransactionReceipt(req.hash);case"getTransactionResult":return await provider.getTransactionResult(req.hash)}}#getNextConfig(running){const configs=Array.from(running).map(r=>r.config);const allConfigs=this.#configs.slice();shuffle(allConfigs);allConfigs.sort((a,b)=>b.priority-a.priority);for(const config of allConfigs){if(configs.indexOf(config)===-1){return config}}return null}#addRunner(running,req){const config=this.#getNextConfig(running);if(config==null){return null}const runner={config:config,result:null,didBump:false,perform:null,staller:null};const now=getTime();runner.perform=(async()=>{try{config.requests++;const result=await this._translatePerform(config.provider,req);runner.result={result:result}}catch(error){config.errorResponses++;runner.result={error:error}}const dt=getTime()-now;config._totalTime+=dt;config.rollingDuration=.95*config.rollingDuration+.05*dt;runner.perform=null})();runner.staller=(async()=>{await stall$2(config.stallTimeout);runner.staller=null})();running.add(runner);return runner}async#initialSync(){let initialSync=this.#initialSyncPromise;if(!initialSync){const promises=[];this.#configs.forEach(config=>{promises.push(waitForSync(config,0));promises.push((async()=>{config._network=await config.provider.getNetwork()})())});this.#initialSyncPromise=initialSync=(async()=>{await Promise.all(promises);let networkId=null;for(const config of this.#configs){const network=config._network;if(networkId==null){networkId=network.networkId}else if(network.networkId!==networkId){assert(false,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}}})()}await initialSync}async#checkQuorum(running,req){const results=[];for(const runner of running){if(runner.result!=null){const{tag,value}=normalizeResult(runner.result);results.push({tag:tag,value:value,weight:runner.config.weight})}}if(results.reduce((a,r)=>a+r.weight,0)({value:c.blockNumber,tag:getNumber(c.blockNumber).toString(),weight:c.weight})))))}const mode=getFuzzyMode(this.quorum,results);if(mode===undefined){return undefined}if(mode>this.#height){this.#height=mode}return this.#height}case"getEnergyPrice":case"estimateEnergy":return getMedian(this.quorum,results);case"getBlock":if("blockTag"in req&&req.blockTag==="pending"){return getAnyResult(this.quorum,results)}return checkQuorum(this.quorum,results);case"call":case"networkId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return checkQuorum(this.quorum,results);case"broadcastTransaction":return getAnyResult(this.quorum,results)}assert(false,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${stringify(req.method)})`})}async#waitForQuorum(running,req){if(running.size===0){throw new Error("no runners?!")}const interesting=[];let newRunners=0;for(const runner of running){if(runner.perform){interesting.push(runner.perform)}if(runner.staller){interesting.push(runner.staller);continue}if(runner.didBump){continue}runner.didBump=true;newRunners++}const value=await this.#checkQuorum(running,req);if(value!==undefined){if(value instanceof Error){throw value}return value}for(let i=0;i0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:Array.from(running).map(r=>stringify(r.result))}});await Promise.race(interesting);return await this.#waitForQuorum(running,req)}async _perform(req){if(req.method==="broadcastTransaction"){const results=await Promise.all(this.#configs.map(async({provider,weight})=>{try{const result=await provider._perform(req);return Object.assign(normalizeResult({result:result}),{weight:weight})}catch(error){return Object.assign(normalizeResult({error:error}),{weight:weight})}}));const result=getAnyResult(this.quorum,results);assert(result!==undefined,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:results.map(stringify)}});if(result instanceof Error){throw result}return result}await this.#initialSync();const running=new Set;for(let i=0;i{const payload={method:method,params:params};this.emit("debug",{action:"sendEip1193Request",payload:payload});try{const result=await core.request(payload);this.emit("debug",{action:"receiveEip1193Result",result:result});return result}catch(e){const error=new Error(e.message);error.code=e.code;error.data=e.data;error.payload=payload;this.emit("debug",{action:"receiveEip1193Error",error:error});throw error}}}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){assertArgument(!Array.isArray(payload),"EIP-1193 does not support batch request","payload",payload);try{const result=await this.#request(payload.method,payload.params||[]);return[{id:payload.id,result:result}]}catch(e){return[{id:payload.id,error:{code:e.code,data:e.data,message:e.message}}]}}getRpcError(payload,error){error=JSON.parse(JSON.stringify(error));switch(error.error.code||-1){case 4001:error.error.message=`corebc-user-denied: ${error.error.message}`;break;case 4200:error.error.message=`corebc-unsupported: ${error.error.message}`;break}return super.getRpcError(payload,error)}async hasSigner(address){if(address==null){address=0}const accounts=await this.send("xcb_accounts",[]);if(typeof address==="number"){return accounts.length>address}address=address.toLowerCase();return accounts.filter(a=>a.toLowerCase()===address).length!==0}async getSigner(address){if(address==null){address=0}if(!await this.hasSigner(address)){try{await this.#request("xcb_requestAccounts",[])}catch(error){const payload=error.payload;throw this.getRpcError(payload,{id:payload.id,error:error})}}return await super.getSigner(address)}}const defaultApplicationId="62e1ad51b37b8e00394bda3b";function getHost(name){switch(name){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}assertArgument(false,"unsupported network","network",name)}class PocketProvider extends JsonRpcProvider{applicationId;applicationSecret;constructor(_network,applicationId,applicationSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(applicationId==null){applicationId=defaultApplicationId}if(applicationSecret==null){applicationSecret=null}const options={staticNetwork:network};const request=PocketProvider.getRequest(network,applicationId,applicationSecret);super(request,network,options);defineProperties(this,{applicationId:applicationId,applicationSecret:applicationSecret})}_getProvider(networkId){try{return new PocketProvider(networkId,this.applicationId,this.applicationSecret)}catch(error){}return super._getProvider(networkId)}static getRequest(network,applicationId,applicationSecret){if(applicationId==null){applicationId=defaultApplicationId}const request=new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`);request.allowGzip=true;if(applicationSecret){request.setCredentials("",applicationSecret)}if(applicationId===defaultApplicationId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("PocketProvider");return true}}return request}isCommunityResource(){return this.applicationId===defaultApplicationId}}const IpcSocketProvider=undefined;class BaseWallet extends AbstractSigner{address;prefix;#signingKey;constructor({signingKey,prefix,provider}){super(provider);this.prefix=prefix;assertArgument(signingKey&&typeof signingKey.sign==="function","invalid signingKey key","signingKey","[ REDACTED ]");this.#signingKey=signingKey;const address=computeAddress(this.#signingKey,prefix);defineProperties(this,{address:address})}get signingKey(){return this.#signingKey}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(provider){return new BaseWallet({signingKey:this.#signingKey,prefix:this.prefix,provider:provider})}async signTransaction(tx){const{to,from}=await resolveProperties({to:tx.to||undefined,from:tx.from||undefined});if(to!=null){tx.to=to}if(from!=null){tx.from=from}if(tx.from!=null){assertArgument(getAddress(tx.from)===this.address,"transaction from address mismatch","tx.from",tx.from);delete tx.from}const btx=Transaction.from(tx);const unSignedSerialized=btx.unsignedSerialized;const unsignedHash=sha256(unSignedSerialized);btx.signature=this.signingKey.sign(unsignedHash);return btx.serialized}async signMessage(message){return this.signMessageSync(message)}signMessageSync(message){return this.signingKey.sign(hashMessage(message))}async signTypedData(domain,types,value){const populated=await TypedDataEncoder.resolveNames(domain,types,value,async name=>{assert(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:name}});const address=getAddress(name);assert(address!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:name});return address});return this.signingKey.sign(TypedDataEncoder.hash(populated.domain,types,populated.value))}}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}static check(wordlist){const words=[];for(let i=0;i<2048;i++){const word=wordlist.getWord(i);if(i!==wordlist.getWordIndex(word)){return"0x"}words.push(word)}return id(words.join("\n")+"\n")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n",true);if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index{const goldilockSaltPrefix="mnemonic";const aesSaltPrefix="mnemonicfortheAESkey";const goldilockSalt=utf8.encode(goldilockSaltPrefix+password);const aesSalt=utf8.encode(aesSaltPrefix+password);const goldilockKey=pbkdf2Sync(Buffer.from(mnemonic),goldilockSalt,2048,64,"sha512");const aesKeySeed=pbkdf2Sync(Buffer.from(mnemonic),aesSalt,2048,64,"sha512");return{aes:aesKeySeed.toString("hex"),goldilock:goldilockKey.toString("hex")}};function getUpperMask(bits){return(1<=12&&words.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const entropy=new Uint8Array(Math.ceil(11*words.length/8));let offset=0;for(let i=0;i=0,`invalid mnemonic word at index ${i}`,"mnemonic","[ REDACTED ]");for(let bit=0;bit<11;bit++){if(index&1<<10-bit){entropy[offset>>3]|=1<<7-offset%8}offset++}}const entropyBits=32*words.length/3;const checksumBits=words.length/3;const checksumMask=getUpperMask(checksumBits);const checksum=getBytes(legacySha256(entropy.slice(0,entropyBits/8)))[0]&checksumMask;assertArgument(checksum===(entropy[entropy.length-1]&checksumMask),"invalid mnemonic checksum","mnemonic","[ REDACTED ]");return hexlify(entropy.slice(0,entropyBits/8))}function entropyToMnemonic(entropy,wordlist){assertArgument(entropy.length%4===0&&entropy.length>=16&&entropy.length<=32,"invalid entropy size","entropy","[ REDACTED ]");if(wordlist==null){wordlist=LangEn.wordlist()}const indices=[0];let remainingBits=11;for(let i=0;i8){indices[indices.length-1]<<=8;indices[indices.length-1]|=entropy[i];remainingBits-=8}else{indices[indices.length-1]<<=remainingBits;indices[indices.length-1]|=entropy[i]>>8-remainingBits;indices.push(entropy[i]&getLowerMask(8-remainingBits));remainingBits+=3}}const checksumBits=entropy.length/4;const checksum=parseInt(legacySha256(entropy).substring(2,4),16)&getUpperMask(checksumBits);indices[indices.length-1]<<=checksumBits;indices[indices.length-1]|=checksum>>8-checksumBits;return wordlist.join(indices.map(index=>wordlist.getWord(index)))}const _guard$1={};class Mnemonic{phrase;password;wordlist;entropy;constructor(guard,entropy,phrase,password,wordlist){if(password==null){password=""}if(wordlist==null){wordlist=LangEn.wordlist()}assertPrivate(guard,_guard$1,"Mnemonic");defineProperties(this,{phrase:phrase,password:password,wordlist:wordlist,entropy:entropy})}computeSeed(){return mnemonicToSeed(this.phrase,this.password)}static fromPhrase({phrase,password,wordlist}){const entropy=mnemonicToEntropy(phrase,wordlist);phrase=entropyToMnemonic(getBytes(entropy),wordlist);return new Mnemonic(_guard$1,entropy,phrase,password,wordlist)}static fromEntropy(_entropy,password,wordlist){const entropy=getBytes(_entropy,"entropy");const phrase=entropyToMnemonic(entropy,wordlist);return new Mnemonic(_guard$1,hexlify(entropy),phrase,password,wordlist)}static entropyToPhrase(_entropy,wordlist){const entropy=getBytes(_entropy,"entropy");return entropyToMnemonic(entropy,wordlist)}static phraseToEntropy(phrase,wordlist){return mnemonicToEntropy(phrase,wordlist)}static isValidMnemonic(phrase,wordlist){try{mnemonicToEntropy(phrase,wordlist);return true}catch(error){}return false}}function looseArrayify(hexString){if(typeof hexString==="string"&&!hexString.startsWith("0x")){hexString="0x"+hexString}return getBytesCopy(hexString)}function zpad(value,length){value=String(value);while(value.length0&&(N&N-1)===0,"invalid kdf.N","kdf.N",N);assertArgument(r>0&&p>0,"invalid kdf","kdf",kdf);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dflen",dkLen);return{name:"scrypt",salt:salt,N:N,r:r,p:p,dkLen:64}}else if(kdf.toLowerCase()==="pbkdf2"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const prf=spelunk(data,"crypto.kdfparams.prf:string!");const algorithm=prf.split("-").pop();assertArgument(algorithm==="sha256"||algorithm==="sha512","invalid kdf.pdf","kdf.pdf",prf);const count=spelunk(data,"crypto.kdfparams.c:int!");const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dklen",dkLen);return{name:"pbkdf2",salt:salt,count:count,dkLen:dkLen,algorithm:algorithm}}}assertArgument(false,"unsupported key-derivation function","kdf",kdf)}function decryptKeystoreJsonSync(json,_password){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=scryptSync(password,salt,N,r,p,dkLen);return getAccount(data,key)}function stall$1(duration){return new Promise(resolve=>{setTimeout(()=>{resolve()},duration)})}async function decryptKeystoreJson(json,_password,progress){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){if(progress){progress(0);await stall$1(0)}const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);if(progress){progress(1);await stall$1(0)}return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=await scrypt(password,salt,N,r,p,dkLen,progress);return getAccount(data,key)}function getEncryptKdfParams(options){const salt=options.salt!=null?getBytes(options.salt,"options.salt"):randomBytes(32);let N=1<<17,r=8,p=1;if(options.scrypt){if(options.scrypt.N){N=options.scrypt.N}if(options.scrypt.r){r=options.scrypt.r}if(options.scrypt.p){p=options.scrypt.p}}assertArgument(typeof N==="number"&&N>0&&Number.isSafeInteger(N)&&(BigInt(N)&BigInt(N-1))===BigInt(0),"invalid scrypt N parameter","options.N",N);assertArgument(typeof r==="number"&&r>0&&Number.isSafeInteger(r),"invalid scrypt r parameter","options.r",r);assertArgument(typeof p==="number"&&p>0&&Number.isSafeInteger(p),"invalid scrypt p parameter","options.p",p);return{name:"scrypt",dkLen:32,salt:salt,N:N,r:r,p:p}}function _encryptKeystore(key,kdf,account,options){const privateKey=getBytes(account.privateKey,"privateKey");const iv=options.iv!=null?getBytes(options.iv,"options.iv"):randomBytes(16);assertArgument(iv.length===16,"invalid options.iv length","options.iv",options.iv);const uuidRandom=options.uuid!=null?getBytes(options.uuid,"options.uuid"):randomBytes(16);assertArgument(uuidRandom.length===16,"invalid options.uuid length","options.uuid",options.iv);const derivedKey=key.slice(0,16);const macPrefix=key.slice(16,32);const aesCtr=new CTR(derivedKey,iv);const ciphertext=getBytes(aesCtr.encrypt(privateKey));const mac=sha256(concat([macPrefix,ciphertext]));const data={address:account.address.substring(2).toLowerCase(),id:uuidV4(uuidRandom),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(iv).substring(2)},ciphertext:hexlify(ciphertext).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify(kdf.salt).substring(2),n:kdf.N,dklen:32,p:kdf.p,r:kdf.r},mac:mac.substring(2)}};if(account.mnemonic){const client=options.client!=null?options.client:`corebc/${version}`;const path=account.mnemonic.path||defaultPath$1;const locale=account.mnemonic.locale||"en";const mnemonicKey=key.slice(32,64);const entropy=getBytes(account.mnemonic.entropy,"account.mnemonic.entropy");const mnemonicIv=randomBytes(16);const mnemonicAesCtr=new CTR(mnemonicKey,mnemonicIv);const mnemonicCiphertext=getBytes(mnemonicAesCtr.encrypt(entropy));const now=new Date;const timestamp=now.getUTCFullYear()+"-"+zpad(now.getUTCMonth()+1,2)+"-"+zpad(now.getUTCDate(),2)+"T"+zpad(now.getUTCHours(),2)+"-"+zpad(now.getUTCMinutes(),2)+"-"+zpad(now.getUTCSeconds(),2)+".0Z";const gethFilename="UTC--"+timestamp+"--"+data.address;data["x-corebc"]={client:client,gethFilename:gethFilename,path:path,locale:locale,mnemonicCounter:hexlify(mnemonicIv).substring(2),mnemonicCiphertext:hexlify(mnemonicCiphertext).substring(2),version:"0.1"}}return JSON.stringify(data)}function encryptKeystoreJsonSync(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=scryptSync(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64);return _encryptKeystore(getBytes(key),kdf,account,options)}async function encryptKeystoreJson(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=await scrypt(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64,options.progressCallback);return _encryptKeystore(getBytes(key),kdf,account,options)}const defaultPath="m";const HardenedBit=2147483648;const _guard={};function derivePath(node,path){const components=path.split("/");assertArgument(components.length>0&&(components[0]==="m"||node.depth>0),"invalid path","path",path);if(components[0]==="m"){components.shift()}let result=node;for(let i=0;i=0&&index=0&&index{setTimeout(()=>{resolve()},duration)})}class Wallet extends BaseWallet{constructor({key,prefix,provider}){if(typeof key==="string"&&!key.startsWith("0x")){key="0x"+key}let signingKey=typeof key==="string"?new SigningKey(key):key;super({signingKey:signingKey,prefix:prefix,provider:provider})}connect(provider){return new Wallet({key:this.signingKey,prefix:this.prefix,provider:provider})}async encrypt(password,progressCallback){const account={address:this.address,privateKey:this.privateKey};return await encryptKeystoreJson(account,password,{progressCallback:progressCallback})}encryptSync(password){const account={address:this.address,privateKey:this.privateKey};return encryptKeystoreJsonSync(account,password)}static#fromAccount(account){assertArgument(account,"invalid JSON wallet","json","[ REDACTED ]");const address=account.address;const prefix=extractPrefix(address);if("mnemonic"in account&&account.mnemonic&&account.mnemonic.locale==="en"){const mnemonic=Mnemonic.fromEntropy(account.mnemonic.entropy);const wallet=HDNodeWallet.fromMnemonic(mnemonic,prefix,account.mnemonic.path);if(wallet.address===account.address&&wallet.privateKey===account.privateKey){return wallet}console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const wallet=new Wallet({key:account.privateKey,prefix:prefix});assertArgument(wallet.address===account.address,"address/privateKey mismatch","json","[ REDACTED ]");return wallet}static async fromEncryptedJson(json,password,progress){let account=null;if(isKeystoreJson(json)){account=await decryptKeystoreJson(json,password,progress)}else if(isCrowdsaleJson(json)){if(progress){progress(0);await stall(0)}account=decryptCrowdsaleJson(json,password);if(progress){progress(1);await stall(0)}}return Wallet.#fromAccount(account)}static fromEncryptedJsonSync(json,password){let account=null;if(isKeystoreJson(json)){account=decryptKeystoreJsonSync(json,password)}else if(isCrowdsaleJson(json)){account=decryptCrowdsaleJson(json,password)}else{assertArgument(false,"invalid JSON wallet","json","[ REDACTED ]")}return Wallet.#fromAccount(account)}static createRandom(prefix,provider){const wallet=HDNodeWallet.createRandom(prefix,undefined,undefined,undefined);if(provider){return wallet.connect(provider)}return wallet}static fromPhrase({phrase,prefix,provider,password}){const wallet=HDNodeWallet.fromPhrase({phrase:phrase,prefix:prefix,password:password});if(provider){return wallet.connect(provider)}return wallet}static fromSeed({seed,prefix,provider,path}){const wallet=HDNodeWallet.fromSeed({seed:seed,prefix:prefix,path:path||defaultPath});if(provider){return wallet.connect(provider)}return wallet}}const Base64=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function decodeBits(width,data){const maxValue=(1<=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const wordlists={en:LangEn.wordlist()};var corebc=Object.freeze({__proto__:null,AbiCoder:AbiCoder,AbstractProvider:AbstractProvider,AbstractSigner:AbstractSigner,AlchemyProvider:AlchemyProvider,AnkrProvider:AnkrProvider,BaseContract:BaseContract,BaseWallet:BaseWallet,BigNumber:BigNumber,Block:Block,BrowserProvider:BrowserProvider,CloudflareProvider:CloudflareProvider,ConstructorFragment:ConstructorFragment,Contract:Contract,ContractEventPayload:ContractEventPayload,ContractFactory:ContractFactory,ContractTransactionReceipt:ContractTransactionReceipt,ContractTransactionResponse:ContractTransactionResponse,ContractUnknownEventPayload:ContractUnknownEventPayload,CoreSymbol:CoreSymbol,Ed448Goldilock:Ed448Goldilock,EnergyCostPlugin:EnergyCostPlugin,ErrorDescription:ErrorDescription,ErrorFragment:ErrorFragment,EventFragment:EventFragment,EventLog:EventLog,EventPayload:EventPayload,FallbackFragment:FallbackFragment,FallbackProvider:FallbackProvider,FeeData:FeeData,FeeDataNetworkPlugin:FeeDataNetworkPlugin,FetchCancelSignal:FetchCancelSignal,FetchRequest:FetchRequest,FetchResponse:FetchResponse,FixedNumber:FixedNumber,Fragment:Fragment,FunctionFragment:FunctionFragment,HDNodeWallet:HDNodeWallet,Indexed:Indexed,InfuraProvider:InfuraProvider,InfuraWebSocketProvider:InfuraWebSocketProvider,Interface:Interface,IpcSocketProvider:IpcSocketProvider,JsonRpcApiProvider:JsonRpcApiProvider,JsonRpcProvider:JsonRpcProvider,JsonRpcSigner:JsonRpcSigner,LangEn:LangEn,Log:Log,LogDescription:LogDescription,MaxInt256:MaxInt256,MaxUint256:MaxUint256,MessagePrefix:MessagePrefix,MinInt256:MinInt256,Mnemonic:Mnemonic,N:N,NamedFragment:NamedFragment,Network:Network,NetworkPlugin:NetworkPlugin,NonceManager:NonceManager,OrePerXCB:OrePerXCB,ParamType:ParamType,PocketProvider:PocketProvider,QuickNodeProvider:QuickNodeProvider,Result:Result,Signature:Signature,SigningKey:SigningKey,SocketBlockSubscriber:SocketBlockSubscriber,SocketEventSubscriber:SocketEventSubscriber,SocketPendingSubscriber:SocketPendingSubscriber,SocketProvider:SocketProvider,SocketSubscriber:SocketSubscriber,StructFragment:StructFragment,Transaction:Transaction,TransactionDescription:TransactionDescription,TransactionReceipt:TransactionReceipt,TransactionResponse:TransactionResponse,Typed:Typed,TypedDataEncoder:TypedDataEncoder,UnmanagedSubscriber:UnmanagedSubscriber,Utf8ErrorFuncs:Utf8ErrorFuncs,VoidSigner:VoidSigner,Wallet:Wallet,WebSocketProvider:WebSocketProvider,Wordlist:Wordlist,WordlistOwl:WordlistOwl,WordlistOwlA:WordlistOwlA,ZeroAddress:ZeroAddress,ZeroHash:ZeroHash,accessListify:accessListify,arrayify:arrayify,assert:assert,assertArgument:assertArgument,assertArgumentCount:assertArgumentCount,assertNormalize:assertNormalize,assertPrivate:assertPrivate,checkResultErrors:checkResultErrors,computeAddress:computeAddress,computeHmac:computeHmac,concat:concat,copyRequest:copyRequest,dataLength:dataLength,dataSlice:dataSlice,decodeBase58:decodeBase58,decodeBase64:decodeBase64,decodeBytes32String:decodeBytes32String,decodeRlp:decodeRlp,decryptCrowdsaleJson:decryptCrowdsaleJson,decryptKeystoreJson:decryptKeystoreJson,decryptKeystoreJsonSync:decryptKeystoreJsonSync,defaultPath:defaultPath,defineProperties:defineProperties,encodeBase58:encodeBase58,encodeBase64:encodeBase64,encodeBytes32String:encodeBytes32String,encodeRlp:encodeRlp,encryptKeystoreJson:encryptKeystoreJson,encryptKeystoreJsonSync:encryptKeystoreJsonSync,formatUnits:formatUnits,formatXCB:formatXCB,fromTwos:fromTwos,getAccountPath:getAccountPath,getAddress:getAddress,getBigInt:getBigInt,getBytes:getBytes,getBytesCopy:getBytesCopy,getCreate2Address:getCreate2Address,getCreateAddress:getCreateAddress,getDefaultProvider:getDefaultProvider,getIndexedAccountPath:getIndexedAccountPath,getNumber:getNumber,getUint:getUint,hashMessage:hashMessage,hexConcat:hexConcat,hexlify:hexlify,id:id,isAddress:isAddress,isAddressable:isAddressable,isBytesLike:isBytesLike,isCallException:isCallException,isCrowdsaleJson:isCrowdsaleJson,isError:isError,isHexString:isHexString,isKeystoreJson:isKeystoreJson,keccak256:keccak256,lock:lock,makeError:makeError,mask:mask,networkIdToPrefix:networkIdToPrefix,parseUnits:parseUnits,parseXCB:parseXCB,pbkdf2:pbkdf2,publicToAddress:publicToAddress,randomBytes:randomBytes,recoverAddress:recoverAddress,resolveAddress:resolveAddress,resolveProperties:resolveProperties,ripemd160:ripemd160,scrypt:scrypt,scryptSync:scryptSync,sha256:sha256,sha512:sha512,showThrottleMessage:showThrottleMessage,solidityPacked:solidityPacked,solidityPackedSha256:solidityPackedSha256,stripZerosLeft:stripZerosLeft,toBeArray:toBeArray,toBeHex:toBeHex,toBigInt:toBigInt,toNumber:toNumber,toQuantity:toQuantity,toTwos:toTwos,toUtf8Bytes:toUtf8Bytes,toUtf8CodePoints:toUtf8CodePoints,toUtf8String:toUtf8String,uuidV4:uuidV4,verifyMessage:verifyMessage,verifyTypedData:verifyTypedData,version:version,wordlists:wordlists,zeroPadBytes:zeroPadBytes,zeroPadValue:zeroPadValue});Object.defineProperty(exports,"Buffer",{enumerable:true,get:function(){return buffer.Buffer}});exports.AbiCoder=AbiCoder;exports.AbstractProvider=AbstractProvider;exports.AbstractSigner=AbstractSigner;exports.AlchemyProvider=AlchemyProvider;exports.AnkrProvider=AnkrProvider;exports.BaseContract=BaseContract;exports.BaseWallet=BaseWallet;exports.BigNumber=BigNumber;exports.Block=Block;exports.BrowserProvider=BrowserProvider;exports.CloudflareProvider=CloudflareProvider;exports.ConstructorFragment=ConstructorFragment;exports.Contract=Contract;exports.ContractEventPayload=ContractEventPayload;exports.ContractFactory=ContractFactory;exports.ContractTransactionReceipt=ContractTransactionReceipt;exports.ContractTransactionResponse=ContractTransactionResponse;exports.ContractUnknownEventPayload=ContractUnknownEventPayload;exports.CoreSymbol=CoreSymbol;exports.Ed448Goldilock=Ed448Goldilock;exports.EnergyCostPlugin=EnergyCostPlugin;exports.ErrorDescription=ErrorDescription;exports.ErrorFragment=ErrorFragment;exports.EventFragment=EventFragment;exports.EventLog=EventLog;exports.EventPayload=EventPayload;exports.FallbackFragment=FallbackFragment;exports.FallbackProvider=FallbackProvider;exports.FeeData=FeeData;exports.FeeDataNetworkPlugin=FeeDataNetworkPlugin;exports.FetchCancelSignal=FetchCancelSignal;exports.FetchRequest=FetchRequest;exports.FetchResponse=FetchResponse;exports.FixedNumber=FixedNumber;exports.Fragment=Fragment;exports.FunctionFragment=FunctionFragment;exports.HDNodeWallet=HDNodeWallet;exports.Indexed=Indexed;exports.InfuraProvider=InfuraProvider;exports.InfuraWebSocketProvider=InfuraWebSocketProvider;exports.Interface=Interface;exports.IpcSocketProvider=IpcSocketProvider;exports.JsonRpcApiProvider=JsonRpcApiProvider;exports.JsonRpcProvider=JsonRpcProvider;exports.JsonRpcSigner=JsonRpcSigner;exports.LangEn=LangEn;exports.Log=Log;exports.LogDescription=LogDescription;exports.MaxInt256=MaxInt256;exports.MaxUint256=MaxUint256;exports.MessagePrefix=MessagePrefix;exports.MinInt256=MinInt256;exports.Mnemonic=Mnemonic;exports.N=N;exports.NamedFragment=NamedFragment;exports.Network=Network;exports.NetworkPlugin=NetworkPlugin;exports.NonceManager=NonceManager;exports.OrePerXCB=OrePerXCB;exports.ParamType=ParamType;exports.PocketProvider=PocketProvider;exports.QuickNodeProvider=QuickNodeProvider;exports.Result=Result;exports.Signature=Signature;exports.SigningKey=SigningKey;exports.SocketBlockSubscriber=SocketBlockSubscriber;exports.SocketEventSubscriber=SocketEventSubscriber;exports.SocketPendingSubscriber=SocketPendingSubscriber;exports.SocketProvider=SocketProvider;exports.SocketSubscriber=SocketSubscriber;exports.StructFragment=StructFragment;exports.Transaction=Transaction;exports.TransactionDescription=TransactionDescription;exports.TransactionReceipt=TransactionReceipt;exports.TransactionResponse=TransactionResponse;exports.Typed=Typed;exports.TypedDataEncoder=TypedDataEncoder;exports.UnmanagedSubscriber=UnmanagedSubscriber;exports.Utf8ErrorFuncs=Utf8ErrorFuncs;exports.VoidSigner=VoidSigner;exports.Wallet=Wallet;exports.WebSocketProvider=WebSocketProvider;exports.Wordlist=Wordlist;exports.WordlistOwl=WordlistOwl;exports.WordlistOwlA=WordlistOwlA;exports.ZeroAddress=ZeroAddress;exports.ZeroHash=ZeroHash;exports.accessListify=accessListify;exports.arrayify=arrayify;exports.assert=assert;exports.assertArgument=assertArgument;exports.assertArgumentCount=assertArgumentCount;exports.assertNormalize=assertNormalize;exports.assertPrivate=assertPrivate;exports.checkResultErrors=checkResultErrors;exports.computeAddress=computeAddress;exports.computeHmac=computeHmac;exports.concat=concat;exports.copyRequest=copyRequest;exports.corebc=corebc;exports.dataLength=dataLength;exports.dataSlice=dataSlice;exports.decodeBase58=decodeBase58;exports.decodeBase64=decodeBase64;exports.decodeBytes32String=decodeBytes32String;exports.decodeRlp=decodeRlp;exports.decryptCrowdsaleJson=decryptCrowdsaleJson;exports.decryptKeystoreJson=decryptKeystoreJson;exports.decryptKeystoreJsonSync=decryptKeystoreJsonSync;exports.defaultPath=defaultPath;exports.defineProperties=defineProperties;exports.encodeBase58=encodeBase58;exports.encodeBase64=encodeBase64;exports.encodeBytes32String=encodeBytes32String;exports.encodeRlp=encodeRlp;exports.encryptKeystoreJson=encryptKeystoreJson;exports.encryptKeystoreJsonSync=encryptKeystoreJsonSync;exports.formatUnits=formatUnits;exports.formatXCB=formatXCB;exports.fromTwos=fromTwos;exports.getAccountPath=getAccountPath;exports.getAddress=getAddress;exports.getBigInt=getBigInt;exports.getBytes=getBytes;exports.getBytesCopy=getBytesCopy;exports.getCreate2Address=getCreate2Address;exports.getCreateAddress=getCreateAddress;exports.getDefaultProvider=getDefaultProvider;exports.getIndexedAccountPath=getIndexedAccountPath;exports.getNumber=getNumber;exports.getUint=getUint;exports.hashMessage=hashMessage;exports.hexConcat=hexConcat;exports.hexlify=hexlify;exports.id=id;exports.isAddress=isAddress;exports.isAddressable=isAddressable;exports.isBytesLike=isBytesLike;exports.isCallException=isCallException;exports.isCrowdsaleJson=isCrowdsaleJson;exports.isError=isError;exports.isHexString=isHexString;exports.isKeystoreJson=isKeystoreJson;exports.keccak256=keccak256;exports.lock=lock;exports.makeError=makeError;exports.mask=mask;exports.networkIdToPrefix=networkIdToPrefix;exports.parseUnits=parseUnits;exports.parseXCB=parseXCB;exports.pbkdf2=pbkdf2;exports.publicToAddress=publicToAddress;exports.randomBytes=randomBytes;exports.recoverAddress=recoverAddress;exports.resolveAddress=resolveAddress;exports.resolveProperties=resolveProperties;exports.ripemd160=ripemd160;exports.scrypt=scrypt;exports.scryptSync=scryptSync;exports.sha256=sha256;exports.sha512=sha512;exports.showThrottleMessage=showThrottleMessage;exports.solidityPacked=solidityPacked;exports.solidityPackedSha256=solidityPackedSha256;exports.stripZerosLeft=stripZerosLeft;exports.toBeArray=toBeArray;exports.toBeHex=toBeHex;exports.toBigInt=toBigInt;exports.toNumber=toNumber;exports.toQuantity=toQuantity;exports.toTwos=toTwos;exports.toUtf8Bytes=toUtf8Bytes;exports.toUtf8CodePoints=toUtf8CodePoints;exports.toUtf8String=toUtf8String;exports.uuidV4=uuidV4;exports.verifyMessage=verifyMessage;exports.verifyTypedData=verifyTypedData;exports.version=version;exports.wordlists=wordlists;exports.zeroPadBytes=zeroPadBytes;exports.zeroPadValue=zeroPadValue}); \ No newline at end of file +const __$G=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory(global.corebc={}))})(this,function(exports){"use strict";var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x}function getAugmentedNamespace(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var f=n.default;if(typeof f=="function"){var a=function a(){var isInstance=false;try{isInstance=this instanceof a}catch(e){}if(isInstance){return Reflect.construct(f,arguments,this.constructor)}return f.apply(this,arguments)};a.prototype=f.prototype}else a={};Object.defineProperty(a,"__esModule",{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k]}})});return a}var buffer={};var base64Js={};var hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1;base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){if(hasRequiredIeee754)return ieee754;hasRequiredIeee754=1;ieee754.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};ieee754.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128};return ieee754}var hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;(function(exports){const base64=requireBase64Js();const ieee754=requireIeee754();const customInspectSymbol=typeof Symbol==="function"&&typeof Symbol["for"]==="function"?Symbol["for"]("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;const K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{const arr=new Uint8Array(1);const proto={foo:function(){return 42}};Object.setPrototypeOf(proto,Uint8Array.prototype);Object.setPrototypeOf(arr,proto);return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}const buf=new Uint8Array(length);Object.setPrototypeOf(buf,Buffer.prototype);return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayView(value)}if(value==null){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof SharedArrayBuffer!=="undefined"&&(isInstance(value,SharedArrayBuffer)||value&&isInstance(value.buffer,SharedArrayBuffer))){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}const valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}const b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}const length=byteLength(string,encoding)|0;let buf=createBuffer(length);const actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){const length=array.length<0?0:checked(array.length)|0;const buf=createBuffer(length);for(let i=0;i=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;let x=a.length;let y=b.length;for(let i=0,len=Math.min(x,y);ibuffer.length){if(!Buffer.isBuffer(buf))buf=Buffer.from(buf);buf.copy(buffer,pos)}else{Uint8Array.prototype.set.call(buffer,buf,pos)}}else if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}else{buf.copy(buffer,pos)}pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(ArrayBuffer.isView(string)||isInstance(string,ArrayBuffer)){return string.byteLength}if(typeof string!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof string)}const len=string.length;const mustMatch=arguments.length>2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;let loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){let loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){const i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){const len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(let i=0;imax)str+=" ... ";return""};if(customInspectSymbol){Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect}Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;let x=thisEnd-thisStart;let y=end-start;const len=Math.min(x,y);const thisCopy=this.slice(thisStart,thisEnd);const targetCopy=target.slice(start,end);for(let i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){let indexSize=1;let arrLength=arr.length;let valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}let i;if(dir){let foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){let found=true;for(let j=0;jremaining){length=remaining}}const strLen=string.length;if(length>strLen/2){length=strLen/2}let i;for(i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}const remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";let loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":case"latin1":case"binary":return asciiWrite(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);const res=[];let i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){let secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}const MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){const len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}let res="";let i=0;while(ilen)end=len;let out="";for(let i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}let val=this[offset+--byteLength];let mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readBigUInt64LE=defineBigIntMethod(function readBigUInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const lo=first+this[++offset]*2**8+this[++offset]*2**16+this[++offset]*2**24;const hi=this[++offset]+this[++offset]*2**8+this[++offset]*2**16+last*2**24;return BigInt(lo)+(BigInt(hi)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const hi=first*2**24+this[++offset]*2**16+this[++offset]*2**8+this[++offset];const lo=this[++offset]*2**24+this[++offset]*2**16+this[++offset]*2**8+last;return(BigInt(hi)<>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let i=byteLength;let mul=1;let val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readBigInt64LE=defineBigIntMethod(function readBigInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=this[offset+4]+this[offset+5]*2**8+this[offset+6]*2**16+(last<<24);return(BigInt(val)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=(first<<24)+this[++offset]*2**16+this[++offset]*2**8+this[++offset];return(BigInt(val)<>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let mul=1;let i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let i=byteLength-1;let mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function wrtBigUInt64LE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;return offset}function wrtBigUInt64BE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset+7]=lo;lo=lo>>8;buf[offset+6]=lo;lo=lo>>8;buf[offset+5]=lo;lo=lo>>8;buf[offset+4]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset+3]=hi;hi=hi>>8;buf[offset+2]=hi;hi=hi>>8;buf[offset+1]=hi;hi=hi>>8;buf[offset]=hi;return offset+8}Buffer.prototype.writeBigUInt64LE=defineBigIntMethod(function writeBigUInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeBigUInt64BE=defineBigIntMethod(function writeBigUInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=0;let mul=1;let sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=byteLength-1;let mul=1;let sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeBigInt64LE=defineBigIntMethod(function writeBigInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Buffer.prototype.writeBigInt64BE=defineBigIntMethod(function writeBigInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;let i;if(typeof val==="number"){for(i=start;i2**32){received=addNumericalSeparator(String(input))}else if(typeof input==="bigint"){received=String(input);if(input>BigInt(2)**BigInt(32)||input<-(BigInt(2)**BigInt(32))){received=addNumericalSeparator(received)}received+="n"}msg+=` It must be ${range}. Received ${received}`;return msg},RangeError);function addNumericalSeparator(val){let res="";let i=val.length;const start=val[0]==="-"?1:0;for(;i>=start+4;i-=3){res=`_${val.slice(i-3,i)}${res}`}return`${val.slice(0,i)}${res}`}function checkBounds(buf,offset,byteLength){validateNumber(offset,"offset");if(buf[offset]===undefined||buf[offset+byteLength]===undefined){boundsError(offset,buf.length-(byteLength+1))}}function checkIntBI(value,min,max,buf,offset,byteLength){if(value>max||value= 0${n} and < 2${n} ** ${(byteLength+1)*8}${n}`}else{range=`>= -(2${n} ** ${(byteLength+1)*8-1}${n}) and < 2 ** `+`${(byteLength+1)*8-1}${n}`}}throw new errors.ERR_OUT_OF_RANGE("value",range,value)}checkBounds(buf,offset,byteLength)}function validateNumber(value,name){if(typeof value!=="number"){throw new errors.ERR_INVALID_ARG_TYPE(name,"number",value)}}function boundsError(value,length,type){if(Math.floor(value)!==value){validateNumber(value,type);throw new errors.ERR_OUT_OF_RANGE("offset","an integer",value)}if(length<0){throw new errors.ERR_BUFFER_OUT_OF_BOUNDS}throw new errors.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${length}`,value)}const INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(str){str=str.split("=")[0];str=str.trim().replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function utf8ToBytes(string,units){units=units||Infinity;let codePoint;const length=string.length;let leadSurrogate=null;const bytes=[];for(let i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){const byteArray=[];for(let i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){let i;for(i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}const hexSliceLookupTable=function(){const alphabet="0123456789abcdef";const table=new Array(256);for(let i=0;i<16;++i){const i16=i*16;for(let j=0;j<16;++j){table[i16+j]=alphabet[i]+alphabet[j]}}return table}();function defineBigIntMethod(fn){return typeof BigInt==="undefined"?BufferBigIntNotDefined:fn}function BufferBigIntNotDefined(){throw new Error("BigInt not supported")}})(buffer);return buffer}var bufferExports=requireBuffer();const version="0.4.1";var bn$2={exports:{}};var _nodeResolve_empty={};var _nodeResolve_empty$1=Object.freeze({__proto__:null,default:_nodeResolve_empty});var require$$0=getAugmentedNamespace(_nodeResolve_empty$1);var bn$1=bn$2.exports;var hasRequiredBn$1;function requireBn$1(){if(hasRequiredBn$1)return bn$2.exports;hasRequiredBn$1=1;(function(module){(function(module,exports){function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number)){return number}this.negative=0;this.words=null;this.length=0;this.red=null;if(number!==null){if(base==="le"||base==="be"){endian=base;base=10}this._init(number||0,base||10,endian||"be")}}if(typeof module==="object"){module.exports=BN}else{exports.BN=BN}BN.BN=BN;BN.wordSize=26;var Buffer;try{if(typeof window!=="undefined"&&typeof window.Buffer!=="undefined"){Buffer=window.Buffer}else{Buffer=require$$0.Buffer}}catch(e){}BN.isBN=function isBN(num){if(num instanceof BN){return true}return num!==null&&typeof num==="object"&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)};BN.max=function max(left,right){if(left.cmp(right)>0)return left;return right};BN.min=function min(left,right){if(left.cmp(right)<0)return left;return right};BN.prototype._init=function init(number,base,endian){if(typeof number==="number"){return this._initNumber(number,base,endian)}if(typeof number==="object"){return this._initArray(number,base,endian)}if(base==="hex"){base=16}assert(base===(base|0)&&base>=2&&base<=36);number=number.toString().replace(/\s+/g,"");var start=0;if(number[0]==="-"){start++;this.negative=1}if(start=0;i-=3){w=number[i]|number[i-1]<<8|number[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}else if(endian==="le"){for(i=0,j=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}return this._strip()};function parseHex4Bits(string,index){var c=string.charCodeAt(index);if(c>=48&&c<=57){return c-48}else if(c>=65&&c<=70){return c-55}else if(c>=97&&c<=102){return c-87}else{assert(false,"Invalid character in "+string)}}function parseHexByte(string,lowerBound,index){var r=parseHex4Bits(string,index);if(index-1>=lowerBound){r|=parseHex4Bits(string,index-1)<<4}return r}BN.prototype._parseHex=function _parseHex(number,start,endian){this.length=Math.ceil((number.length-start)/6);this.words=new Array(this.length);for(var i=0;i=start;i-=2){w=parseHexByte(number,start,i)<=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}else{var parseLength=number.length-start;for(i=parseLength%2===0?start+1:start;i=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}this._strip()};function parseBase(str,start,end,mul){var r=0;var b=0;var len=Math.min(str.length,end);for(var i=start;i=49){b=c-49+10}else if(c>=17){b=c-17+10}else{b=c}assert(c>=0&&b1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};if(typeof Symbol!=="undefined"&&typeof Symbol.for==="function"){try{BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}catch(e){BN.prototype.inspect=inspect}}else{BN.prototype.inspect=inspect}function inspect(){return(this.red?""}var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(base,padding){base=base||10;padding=padding|0||1;var out;if(base===16||base==="hex"){out="";var off=0;var carry=0;for(var i=0;i>>24-off&16777215;off+=2;if(off>=26){off-=26;i--}if(carry!==0||i!==this.length-1){out=zeros[6-word.length]+word+out}else{out=word+out}}if(carry!==0){out=carry.toString(16)+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}if(base===(base|0)&&base>=2&&base<=36){var groupSize=groupSizes[base];var groupBase=groupBases[base];out="";var c=this.clone();c.negative=0;while(!c.isZero()){var r=c.modrn(groupBase).toString(base);c=c.idivn(groupBase);if(!c.isZero()){out=zeros[groupSize-r.length]+r+out}else{out=r+out}}if(this.isZero()){out="0"+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var ret=this.words[0];if(this.length===2){ret+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){ret+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-ret:ret};BN.prototype.toJSON=function toJSON(){return this.toString(16,2)};if(Buffer){BN.prototype.toBuffer=function toBuffer(endian,length){return this.toArrayLike(Buffer,endian,length)}}BN.prototype.toArray=function toArray(endian,length){return this.toArrayLike(Array,endian,length)};var allocate=function allocate(ArrayType,size){if(ArrayType.allocUnsafe){return ArrayType.allocUnsafe(size)}return new ArrayType(size)};BN.prototype.toArrayLike=function toArrayLike(ArrayType,endian,length){this._strip();var byteLength=this.byteLength();var reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length");assert(reqLength>0,"Requested array length <= 0");var res=allocate(ArrayType,reqLength);var postfix=endian==="le"?"LE":"BE";this["_toArrayLike"+postfix](res,byteLength);return res};BN.prototype._toArrayLikeLE=function _toArrayLikeLE(res,byteLength){var position=0;var carry=0;for(var i=0,shift=0;i>8&255}if(position>16&255}if(shift===6){if(position>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position=0){res[position--]=word>>8&255}if(position>=0){res[position--]=word>>16&255}if(shift===6){if(position>=0){res[position--]=word>>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position>=0){res[position--]=carry;while(position>=0){res[position--]=0}}};if(Math.clz32){BN.prototype._countBits=function _countBits(w){return 32-Math.clz32(w)}}else{BN.prototype._countBits=function _countBits(w){var t=w;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(w){if(w===0)return 26;var t=w;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var w=this.words[this.length-1];var hi=this._countBits(w);return(this.length-1)*26+hi};function toBitArray(num){var w=new Array(num.bitLength());for(var bit=0;bit>>wbit&1}return w}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var r=0;for(var i=0;inum.length)return this.clone().ior(num);return num.clone().ior(this)};BN.prototype.uor=function uor(num){if(this.length>num.length)return this.clone().iuor(num);return num.clone().iuor(this)};BN.prototype.iuand=function iuand(num){var b;if(this.length>num.length){b=num}else{b=this}for(var i=0;inum.length)return this.clone().iand(num);return num.clone().iand(this)};BN.prototype.uand=function uand(num){if(this.length>num.length)return this.clone().iuand(num);return num.clone().iuand(this)};BN.prototype.iuxor=function iuxor(num){var a;var b;if(this.length>num.length){a=this;b=num}else{a=num;b=this}for(var i=0;inum.length)return this.clone().ixor(num);return num.clone().ixor(this)};BN.prototype.uxor=function uxor(num){if(this.length>num.length)return this.clone().iuxor(num);return num.clone().iuxor(this)};BN.prototype.inotn=function inotn(width){assert(typeof width==="number"&&width>=0);var bytesNeeded=Math.ceil(width/26)|0;var bitsLeft=width%26;this._expand(bytesNeeded);if(bitsLeft>0){bytesNeeded--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-bitsLeft;i++}for(;i=0);var off=bit/26|0;var wbit=bit%26;this._expand(off+1);if(val){this.words[off]=this.words[off]|1<num.length){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this.words[this.length]=carry;this.length++}else if(a!==this){for(;inum.length)return this.clone().iadd(num);return num.clone().iadd(this)};BN.prototype.isub=function isub(num){if(num.negative!==0){num.negative=0;var r=this.iadd(num);num.negative=1;return r._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(num);this.negative=1;return this._normSign()}var cmp=this.cmp(num);if(cmp===0){this.negative=0;this.length=1;this.words[0]=0;return this}var a,b;if(cmp>0){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}if(carry===0&&i>>26;var rword=carry&67108863;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=self.words[i]|0;b=num.words[j]|0;r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0){out.words[k]=carry|0}else{out.length--}return out._strip()}var comb10MulTo=function comb10MulTo(self,num,out){var a=self.words;var b=num.words;var o=out.words;var c=0;var lo;var mid;var hi;var a0=a[0]|0;var al0=a0&8191;var ah0=a0>>>13;var a1=a[1]|0;var al1=a1&8191;var ah1=a1>>>13;var a2=a[2]|0;var al2=a2&8191;var ah2=a2>>>13;var a3=a[3]|0;var al3=a3&8191;var ah3=a3>>>13;var a4=a[4]|0;var al4=a4&8191;var ah4=a4>>>13;var a5=a[5]|0;var al5=a5&8191;var ah5=a5>>>13;var a6=a[6]|0;var al6=a6&8191;var ah6=a6>>>13;var a7=a[7]|0;var al7=a7&8191;var ah7=a7>>>13;var a8=a[8]|0;var al8=a8&8191;var ah8=a8>>>13;var a9=a[9]|0;var al9=a9&8191;var ah9=a9>>>13;var b0=b[0]|0;var bl0=b0&8191;var bh0=b0>>>13;var b1=b[1]|0;var bl1=b1&8191;var bh1=b1>>>13;var b2=b[2]|0;var bl2=b2&8191;var bh2=b2>>>13;var b3=b[3]|0;var bl3=b3&8191;var bh3=b3>>>13;var b4=b[4]|0;var bl4=b4&8191;var bh4=b4>>>13;var b5=b[5]|0;var bl5=b5&8191;var bh5=b5>>>13;var b6=b[6]|0;var bl6=b6&8191;var bh6=b6>>>13;var b7=b[7]|0;var bl7=b7&8191;var bh7=b7>>>13;var b8=b[8]|0;var bl8=b8&8191;var bh8=b8>>>13;var b9=b[9]|0;var bl9=b9&8191;var bh9=b9>>>13;out.negative=self.negative^num.negative;out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length++}return out};if(!Math.imul){comb10MulTo=smallMulTo}function bigMulTo(self,num,out){out.negative=num.negative^self.negative;out.length=self.length+num.length;var carry=0;var hncarry=0;for(var k=0;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0){out.words[k]=carry}else{out.length--}return out._strip()}function jumboMulTo(self,num,out){return bigMulTo(self,num,out)}BN.prototype.mulTo=function mulTo(num,out){var res;var len=this.length+num.length;if(this.length===10&&num.length===10){res=comb10MulTo(this,num,out)}else if(len<63){res=smallMulTo(this,num,out)}else if(len<1024){res=bigMulTo(this,num,out)}else{res=jumboMulTo(this,num,out)}return res};BN.prototype.mul=function mul(num){var out=new BN(null);out.words=new Array(this.length+num.length);return this.mulTo(num,out)};BN.prototype.mulf=function mulf(num){var out=new BN(null);out.words=new Array(this.length+num.length);return jumboMulTo(this,num,out)};BN.prototype.imul=function imul(num){return this.clone().mulTo(num,this)};BN.prototype.imuln=function imuln(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(typeof num==="number");assert(num<67108864);var carry=0;for(var i=0;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}if(carry!==0){this.words[i]=carry;this.length++}if(num===0){this.length=1;this._normSign()}return isNegNum?this.ineg():this};BN.prototype.muln=function muln(num){return this.clone().imuln(num)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(num){var w=toBitArray(num);if(w.length===0)return new BN(1);var res=this;for(var i=0;i=0);var r=bits%26;var s=(bits-r)/26;var carryMask=67108863>>>26-r<<26-r;var i;if(r!==0){var carry=0;for(i=0;i>>26-r}if(carry){this.words[i]=carry;this.length++}}if(s!==0){for(i=this.length-1;i>=0;i--){this.words[i+s]=this.words[i]}for(i=0;i=0);var h;if(hint){h=(hint-hint%26)/26}else{h=0}var r=bits%26;var s=Math.min((bits-r)/26,this.length);var mask=67108863^67108863>>>r<s){this.length-=s;for(i=0;i=0&&(carry!==0||i>=h);i--){var word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}if(maskedWords&&carry!==0){maskedWords.words[maskedWords.length++]=carry}if(this.length===0){this.words[0]=0;this.length=1}return this._strip()};BN.prototype.ishrn=function ishrn(bits,hint,extended){assert(this.negative===0);return this.iushrn(bits,hint,extended)};BN.prototype.shln=function shln(bits){return this.clone().ishln(bits)};BN.prototype.ushln=function ushln(bits){return this.clone().iushln(bits)};BN.prototype.shrn=function shrn(bits){return this.clone().ishrn(bits)};BN.prototype.ushrn=function ushrn(bits){return this.clone().iushrn(bits)};BN.prototype.testn=function testn(bit){assert(typeof bit==="number"&&bit>=0);var r=bit%26;var s=(bit-r)/26;var q=1<=0);var r=bits%26;var s=(bits-r)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=s){return this}if(r!==0){s++}this.length=Math.min(s,this.length);if(r!==0){var mask=67108863^67108863>>>r<=67108864;i++){this.words[i]-=67108864;if(i===this.length-1){this.words[i+1]=1}else{this.words[i+1]++}}this.length=Math.max(this.length,i+1);return this};BN.prototype.isubn=function isubn(num){assert(typeof num==="number");assert(num<67108864);if(num<0)return this.iaddn(-num);if(this.negative!==0){this.negative=0;this.iaddn(num);this.negative=1;return this}this.words[0]-=num;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var i=0;i>26)-(right/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this._strip();assert(carry===-1);carry=0;for(i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this._strip()};BN.prototype._wordDiv=function _wordDiv(num,mode){var shift=this.length-num.length;var a=this.clone();var b=num;var bhi=b.words[b.length-1]|0;var bhiBits=this._countBits(bhi);shift=26-bhiBits;if(shift!==0){b=b.ushln(shift);a.iushln(shift);bhi=b.words[b.length-1]|0}var m=a.length-b.length;var q;if(mode!=="mod"){q=new BN(null);q.length=m+1;q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=(a.words[b.length+j]|0)*67108864+(a.words[b.length+j-1]|0);qj=Math.min(qj/bhi|0,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj--;a.negative=0;a._ishlnsubmul(b,1,j);if(!a.isZero()){a.negative^=1}}if(q){q.words[j]=qj}}if(q){q._strip()}a._strip();if(mode!=="div"&&shift!==0){a.iushrn(shift)}return{div:q||null,mod:a}};BN.prototype.divmod=function divmod(num,mode,positive){assert(!num.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var div,mod,res;if(this.negative!==0&&num.negative===0){res=this.neg().divmod(num,mode);if(mode!=="mod"){div=res.div.neg()}if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.iadd(num)}}return{div:div,mod:mod}}if(this.negative===0&&num.negative!==0){res=this.divmod(num.neg(),mode);if(mode!=="mod"){div=res.div.neg()}return{div:div,mod:res.mod}}if((this.negative&num.negative)!==0){res=this.neg().divmod(num.neg(),mode);if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.isub(num)}}return{div:res.div,mod:mod}}if(num.length>this.length||this.cmp(num)<0){return{div:new BN(0),mod:this}}if(num.length===1){if(mode==="div"){return{div:this.divn(num.words[0]),mod:null}}if(mode==="mod"){return{div:null,mod:new BN(this.modrn(num.words[0]))}}return{div:this.divn(num.words[0]),mod:new BN(this.modrn(num.words[0]))}}return this._wordDiv(num,mode)};BN.prototype.div=function div(num){return this.divmod(num,"div",false).div};BN.prototype.mod=function mod(num){return this.divmod(num,"mod",false).mod};BN.prototype.umod=function umod(num){return this.divmod(num,"mod",true).mod};BN.prototype.divRound=function divRound(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=dm.mod.abs();var half=num.abs().iushrn(1);var r2=num.words[0]&1;var cmp=mod.cmp(half);if(cmp<0||r2===1&&cmp===0)return dm.div;var up=new BN(1);up.negative=this.negative^num.negative;return dm.div.iadd(up)};BN.prototype.modrn=function modrn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var p=(1<<26)%num;var acc=0;for(var i=this.length-1;i>=0;i--){acc=(p*acc+(this.words[i]|0))%num}return isNegNum?-acc:acc};BN.prototype.modn=function modn(num){return this.modrn(num)};BN.prototype.idivn=function idivn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var carry=0;for(var i=this.length-1;i>=0;i--){var w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}this._strip();return isNegNum?this.ineg():this};BN.prototype.divn=function divn(num){return this.clone().idivn(num)};BN.prototype.egcd=function egcd(p){assert(p.negative===0);assert(!p.isZero());var x=this;var y=p.clone();if(x.negative!==0){x=x.umod(p)}else{x=x.clone()}var A=new BN(1);var B=new BN(0);var C=new BN(0);var D=new BN(1);var g=0;while(x.isEven()&&y.isEven()){x.iushrn(1);y.iushrn(1);++g}var yp=y.clone();var xp=x.clone();while(!x.isZero()){for(var i=0,im=1;(x.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){x.iushrn(i);while(i-- >0){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}}for(var j=0,jm=1;(y.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){y.iushrn(j);while(j-- >0){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}return{a:C,b:D,gcd:y.iushln(g)}};BN.prototype._invmp=function _invmp(p){assert(p.negative===0);assert(!p.isZero());var a=this;var b=p.clone();if(a.negative!==0){a=a.umod(p)}else{a=a.clone()}var x1=new BN(1);var x2=new BN(0);var delta=b.clone();while(a.cmpn(1)>0&&b.cmpn(1)>0){for(var i=0,im=1;(a.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){a.iushrn(i);while(i-- >0){if(x1.isOdd()){x1.iadd(delta)}x1.iushrn(1)}}for(var j=0,jm=1;(b.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){b.iushrn(j);while(j-- >0){if(x2.isOdd()){x2.iadd(delta)}x2.iushrn(1)}}if(a.cmp(b)>=0){a.isub(b);x1.isub(x2)}else{b.isub(a);x2.isub(x1)}}var res;if(a.cmpn(1)===0){res=x1}else{res=x2}if(res.cmpn(0)<0){res.iadd(p)}return res};BN.prototype.gcd=function gcd(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone();var b=num.clone();a.negative=0;b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++){a.iushrn(1);b.iushrn(1)}do{while(a.isEven()){a.iushrn(1)}while(b.isEven()){b.iushrn(1)}var r=a.cmp(b);if(r<0){var t=a;a=b;b=t}else if(r===0||b.cmpn(1)===0){break}a.isub(b)}while(true);return b.iushln(shift)};BN.prototype.invm=function invm(num){return this.egcd(num).a.umod(num)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(num){return this.words[0]&num};BN.prototype.bincn=function bincn(bit){assert(typeof bit==="number");var r=bit%26;var s=(bit-r)/26;var q=1<>>26;w&=67108863;this.words[i]=w}if(carry!==0){this.words[i]=carry;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(num){var negative=num<0;if(this.negative!==0&&!negative)return-1;if(this.negative===0&&negative)return 1;this._strip();var res;if(this.length>1){res=1}else{if(negative){num=-num}assert(num<=67108863,"Number is too big");var w=this.words[0]|0;res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=this.words[i]|0;var b=num.words[i]|0;if(a===b)continue;if(ab){res=1}break}return res};BN.prototype.gtn=function gtn(num){return this.cmpn(num)===1};BN.prototype.gt=function gt(num){return this.cmp(num)===1};BN.prototype.gten=function gten(num){return this.cmpn(num)>=0};BN.prototype.gte=function gte(num){return this.cmp(num)>=0};BN.prototype.ltn=function ltn(num){return this.cmpn(num)===-1};BN.prototype.lt=function lt(num){return this.cmp(num)===-1};BN.prototype.lten=function lten(num){return this.cmpn(num)<=0};BN.prototype.lte=function lte(num){return this.cmp(num)<=0};BN.prototype.eqn=function eqn(num){return this.cmpn(num)===0};BN.prototype.eq=function eq(num){return this.cmp(num)===0};BN.red=function red(num){return new Red(num)};BN.prototype.toRed=function toRed(ctx){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return ctx.convertTo(this)._forceRed(ctx)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(ctx){this.red=ctx;return this};BN.prototype.forceRed=function forceRed(ctx){assert(!this.red,"Already a number in reduction context");return this._forceRed(ctx)};BN.prototype.redAdd=function redAdd(num){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,num)};BN.prototype.redIAdd=function redIAdd(num){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,num)};BN.prototype.redSub=function redSub(num){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,num)};BN.prototype.redISub=function redISub(num){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,num)};BN.prototype.redShl=function redShl(num){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,num)};BN.prototype.redMul=function redMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.mul(this,num)};BN.prototype.redIMul=function redIMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.imul(this,num)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(num){assert(this.red&&!num.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};function MPrime(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var tmp=new BN(null);tmp.words=new Array(Math.ceil(this.n/13));return tmp};MPrime.prototype.ireduce=function ireduce(num){var r=num;var rlen;do{this.split(r,this.tmp);r=this.imulK(r);r=r.iadd(this.tmp);rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0){r.isub(this.p)}else{if(r.strip!==undefined){r.strip()}else{r._strip()}}return r};MPrime.prototype.split=function split(input,out){input.iushrn(this.n,0,out)};MPrime.prototype.imulK=function imulK(num){return num.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(input,output){var mask=4194303;var outLen=Math.min(input.length,9);for(var i=0;i>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10){input.length-=10}else{input.length-=9}};K256.prototype.imulK=function imulK(num){num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;var lo=0;for(var i=0;i>>=26;num.words[i]=lo;carry=hi}if(carry!==0){num.words[num.length++]=carry}return num};BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if(name==="k256"){prime=new K256}else if(name==="p224"){prime=new P224}else if(name==="p192"){prime=new P192}else if(name==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+name)}primes[name]=prime;return prime};function Red(m){if(typeof m==="string"){var prime=BN._prime(m);this.m=prime.p;this.prime=prime}else{assert(m.gtn(1),"modulus must be greater than 1");this.m=m;this.prime=null}}Red.prototype._verify1=function _verify1(a){assert(a.negative===0,"red works only with positives");assert(a.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(a,b){assert((a.negative|b.negative)===0,"red works only with positives");assert(a.red&&a.red===b.red,"red works only with red numbers")};Red.prototype.imod=function imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);move(a,a.umod(this.m)._forceRed(this));return a};Red.prototype.neg=function neg(a){if(a.isZero()){return a.clone()}return this.m.sub(a)._forceRed(this)};Red.prototype.add=function add(a,b){this._verify2(a,b);var res=a.add(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res._forceRed(this)};Red.prototype.iadd=function iadd(a,b){this._verify2(a,b);var res=a.iadd(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res};Red.prototype.sub=function sub(a,b){this._verify2(a,b);var res=a.sub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res._forceRed(this)};Red.prototype.isub=function isub(a,b){this._verify2(a,b);var res=a.isub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res};Red.prototype.shl=function shl(a,num){this._verify1(a);return this.imod(a.ushln(num))};Red.prototype.imul=function imul(a,b){this._verify2(a,b);return this.imod(a.imul(b))};Red.prototype.mul=function mul(a,b){this._verify2(a,b);return this.imod(a.mul(b))};Red.prototype.isqr=function isqr(a){return this.imul(a,a.clone())};Red.prototype.sqr=function sqr(a){return this.mul(a,a)};Red.prototype.sqrt=function sqrt(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);assert(mod3%2===1);if(mod3===3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}var q=this.m.subn(1);var s=0;while(!q.isZero()&&q.andln(1)===0){s++;q.iushrn(1)}assert(!q.isZero());var one=new BN(1).toRed(this);var nOne=one.redNeg();var lpow=this.m.subn(1).iushrn(1);var z=this.m.bitLength();z=new BN(2*z*z).toRed(this);while(this.pow(z,lpow).cmp(nOne)!==0){z.redIAdd(nOne)}var c=this.pow(z,q);var r=this.pow(a,q.addn(1).iushrn(1));var t=this.pow(a,q);var m=s;while(t.cmp(one)!==0){var tmp=t;for(var i=0;tmp.cmp(one)!==0;i++){tmp=tmp.redSqr()}assert(i=0;i--){var word=num.words[i];for(var j=start-1;j>=0;j--){var bit=word>>j&1;if(res!==wnd[0]){res=this.sqr(res)}if(bit===0&¤t===0){currentLen=0;continue}current<<=1;current|=bit;currentLen++;if(currentLen!==windowSize&&(i!==0||j!==0))continue;res=this.mul(res,wnd[current]);currentLen=0;current=0}start=26}return res};Red.prototype.convertTo=function convertTo(num){var r=num.umod(this.m);return r===num?r.clone():r};Red.prototype.convertFrom=function convertFrom(num){var res=num.clone();res.red=null;return res};BN.mont=function mont(num){return new Mont(num)};function Mont(m){Red.call(this,m);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(num){return this.imod(num.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(num){var r=this.imod(num.mul(this.rinv));r.red=null;return r};Mont.prototype.imul=function imul(a,b){if(a.isZero()||b.isZero()){a.words[0]=0;a.length=1;return a}var t=a.imul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.mul=function mul(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.invm=function invm(a){var res=this.imod(a._invmp(this.m).mul(this.r2));return res._forceRed(this)}})(module,bn$1)})(bn$2);return bn$2.exports}var bnExports=requireBn$1();var _BN=getDefaultExportFromCjs(bnExports);let _permanentCensorErrors=false;let _censorErrors=false;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels["default"];let _globalLogger=null;function _checkNormalize(){try{const missing=[];["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing.push(form)}});if(missing.length){throw new Error("missing "+missing.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"]="UNPREDICTABLE_ENERGY_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{version="0.0.1";static errors=ErrorCode;static levels=LogLevel;constructor(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}_log(logLevel,args){const level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)}debug(...args){this._log(Logger.levels.DEBUG,args)}info(...args){this._log(Logger.levels.INFO,args)}warn(...args){this._log(Logger.levels.WARNING,args)}makeError(message,code,params){if(_censorErrors){return this.makeError("censored error",code,{})}if(!code){code=Logger.errors.UNKNOWN_ERROR}if(!params){params={}}const messageDetails=[];Object.keys(params).forEach(key=>{const value=params[key];try{if(value instanceof Uint8Array){let hex="";for(let i=0;i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push(`code=${code}`);messageDetails.push(`version=${this.version}`);const reason=message;if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}const error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error}throwError(message,code,params){throw this.makeError(message,code,params)}throwArgumentError(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})}assert(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)}assertArgument(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)}checkNormalize(message){if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}}checkSafeUint53(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}}checkArgumentCount(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}}checkNew(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}checkAbstract(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}static globalLogger(){if(!_globalLogger){_globalLogger=new Logger("logger/0.0.1")}return _globalLogger}static setCensorship(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent}static setLogLevel(logLevel){const level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level}static from(version){return new Logger(version)}}const logger$7=new Logger("utils/properties/0.0.1");function checkType(value,type,name){const types=type.split("|").map(t=>t.trim());for(let i=0;iPromise.resolve(value[k])));return results.reduce((accum,v,index)=>{accum[keys[index]]=v;return accum},{})}function defineProperties(target,values,types){for(let key in values){let value=values[key];const type=types?types[key]:null;if(type){checkType(value,type,key)}Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function checkProperties(object,properties){if(!object||typeof object!=="object"){logger$7.throwArgumentError("invalid object","object",object)}Object.keys(object).forEach(key=>{if(!properties[key]){logger$7.throwArgumentError("invalid object key - "+key,"transaction:"+key,object)}})}function stringify$1(value){if(value==null){return"null"}if(Array.isArray(value)){return"[ "+value.map(stringify$1).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify$1(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"number":return value.toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function isError(error,code){return error&&error.code===code}function isCallException(error){return isError(error,"CALL_EXCEPTION")}function makeError(message,code,info){{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify$1(info)}`)}for(const key in info){const value=info[key];details.push(key+"="+stringify$1(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}function assertArgumentCount(count,expectedCount,message){if(message==null){message=""}if(message){message=": "+message}assert(count>=expectedCount,"missing arguemnt"+message,"MISSING_ARGUMENT",{count:count,expectedCount:expectedCount});assert(count<=expectedCount,"too many arguemnts"+message,"UNEXPECTED_ARGUMENT",{count:count,expectedCount:expectedCount})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function assertNormalize(form){assert(_normalizeForms.indexOf(form)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:form}})}function assertPrivate(givenGuard,guard,className){if(className==null){className=""}if(givenGuard!==guard){let method=className,operation="new";if(className){method+=".";operation+=" "+className}assert(false,`private constructor; use ${method}from* methods`,"UNSUPPORTED_OPERATION",{operation:operation})}}const logger$6=new Logger("utils/data/0.0.1");function isHexable(value){return!!value.toHexString}function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes$1(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(let i=0;i=256){return false}}return true}function _getBytes(value,name,copy){if(value instanceof Uint8Array){if(copy){return new Uint8Array(value)}return value}if(typeof value==="string"&&value.match(/^0x([0-9a-f][0-9a-f])*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;iNumber(item));value=new Uint8Array(v)}}if(typeof value==="number"){logger$6.checkSafeUint53(value,"invalid hexlify value");let hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger$6.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes$1(value)){let result="0x";for(let i=0;i>4]+HexCharacters[v&15]}return result}return logger$6.throwArgumentError("invalid hexlify value","value",value)}function concat(items){return"0x"+items.map(d=>hexlify(d).substring(2)).join("")}function hexDataSlice(data,offset,endOffset){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){logger$6.throwArgumentError("invalid hexData","value",data)}offset=2+2*offset;return"0x"+data.substring(offset)}function hexDataLength(data){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){return null}return(data.length-2)/2}function dataLength(data){if(isHexString(data,true)){return(data.length-2)/2}return getBytes(data).length}function dataSlice(data,start,end){const bytes=getBytes(data);if(end!=null&&end>bytes.length){assert(false,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:bytes,length:bytes.length,offset:end})}return hexlify(bytes.slice(start==null?0:start,end==null?bytes.length:end))}function stripZerosLeft(data){let bytes=hexlify(data).substring(2);while(bytes.startsWith("00")){bytes=bytes.substring(2)}return"0x"+bytes}function zeroPad(data,length,left){const bytes=getBytes(data);assert(length>=bytes.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(bytes),length:length,offset:length+1});const result=new Uint8Array(length);result.fill(0);if(left){result.set(bytes,length-bytes.length)}else{result.set(bytes,0)}return hexlify(result)}function zeroPadValue(data,length){return zeroPad(data,length,true)}function zeroPadBytes(data,length){return zeroPad(data,length,false)}function stripZeros(value){let result=arrayify(value);if(result.length===0){return result}let start=0;while(start{result+=hexlify(item).substring(2)});return result}var BN=_BN.BN;const logger$5=new Logger("bigNumber/0.0.1");const _constructorGuard={};const MAX_SAFE=9007199254740991;let _warnedToStringRadix=false;class BigNumber{_hex;_isBigNumber;constructor(constructorGuard,hex){logger$5.checkNew(new.target,BigNumber);if(constructorGuard!==_constructorGuard){logger$5.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"})}this._hex=hex;this._isBigNumber=true;Object.freeze(this)}fromTwos(value){return toBigNumber(toBN(this).fromTwos(value))}toTwos(value){return toBigNumber(toBN(this).toTwos(value))}abs(){if(this._hex[0]==="-"){return BigNumber.from(this._hex.substring(1))}return this}add(other){return toBigNumber(toBN(this).add(toBN(other)))}sub(other){return toBigNumber(toBN(this).sub(toBN(other)))}div(other){const o=BigNumber.from(other);if(o.isZero()){throwFault("division by zero","div")}return toBigNumber(toBN(this).div(toBN(other)))}mul(other){return toBigNumber(toBN(this).mul(toBN(other)))}mod(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot modulo negative values","mod")}return toBigNumber(toBN(this).umod(value))}pow(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot raise to negative values","pow")}return toBigNumber(toBN(this).pow(value))}and(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'and' negative values","and")}return toBigNumber(toBN(this).and(value))}or(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'or' negative values","or")}return toBigNumber(toBN(this).or(value))}xor(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'xor' negative values","xor")}return toBigNumber(toBN(this).xor(value))}mask(value){if(this.isNegative()||value<0){throwFault("cannot mask negative values","mask")}return toBigNumber(toBN(this).maskn(value))}shl(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shl")}return toBigNumber(toBN(this).shln(value))}shr(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shr")}return toBigNumber(toBN(this).shrn(value))}eq(other){return toBN(this).eq(toBN(other))}lt(other){return toBN(this).lt(toBN(other))}lte(other){return toBN(this).lte(toBN(other))}gt(other){return toBN(this).gt(toBN(other))}gte(other){return toBN(this).gte(toBN(other))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch(error){throwFault("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return logger$5.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){if(arguments.length>0){if(arguments[0]===10){if(!_warnedToStringRadix){_warnedToStringRadix=true;logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")}}else if(arguments[0]===16){logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{})}else{logger$5.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})}}return toBN(this).toString(10)}toHexString(){return this._hex}toJSON(key){return{type:"BigNumber",hex:this.toHexString()}}static from(value){if(value instanceof BigNumber){return value}if(typeof value==="string"){if(value.match(/^-?0x[0-9a-f]+$/i)){return new BigNumber(_constructorGuard,toHex(value))}if(value.match(/^-?[0-9]+$/)){return new BigNumber(_constructorGuard,toHex(new BN(value)))}return logger$5.throwArgumentError("invalid BigNumber string","value",value)}if(typeof value==="number"){if(value%1){throwFault("underflow","BigNumber.from",value)}if(value>=MAX_SAFE||value<=-MAX_SAFE){throwFault("overflow","BigNumber.from",value)}return BigNumber.from(String(value))}const anyValue=value;if(typeof anyValue==="bigint"){return BigNumber.from(anyValue.toString())}if(isBytes$1(anyValue)){return BigNumber.from(hexlify(anyValue))}if(anyValue){if(anyValue.toHexString){const hex=anyValue.toHexString();if(typeof hex==="string"){return BigNumber.from(hex)}}else{let hex=anyValue._hex;if(hex==null&&anyValue.type==="BigNumber"){hex=anyValue.hex}if(typeof hex==="string"){if(isHexString(hex)||hex[0]==="-"&&isHexString(hex.substring(1))){return BigNumber.from(hex)}}}}return logger$5.throwArgumentError("invalid BigNumber value","value",value)}static isBigNumber(value){return!!(value&&value._isBigNumber)}}function toHex(value){if(typeof value!=="string"){return toHex(value.toString(16))}if(value[0]==="-"){value=value.substring(1);if(value[0]==="-"){logger$5.throwArgumentError("invalid hex","value",value)}value=toHex(value);if(value==="0x00"){return value}return"-"+value}if(value.substring(0,2)!=="0x"){value="0x"+value}if(value==="0x"){return"0x00"}if(value.length%2){value="0x0"+value.substring(2)}while(value.length>4&&value.substring(0,4)==="0x00"){value="0x"+value.substring(4)}return value}function toBigNumber(value){return BigNumber.from(toHex(value))}function toBN(value){const hex=BigNumber.from(value).toHexString();if(hex[0]==="-"){return new BN("-"+hex.substring(3),16)}return new BN(hex.substring(2),16)}function throwFault(fault,operation,value){const params={fault:fault,operation:operation};if(value!=null){params.value=value}return logger$5.throwError(fault,Logger.errors.NUMERIC_FAULT,params)}const logger$4=new Logger("rlp/0.0.1");function arrayifyInteger$1(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function unarrayifyInteger$1(data,offset,length){let result=0;for(let i=0;ioffset+1+length){logger$4.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}}return{consumed:1+length,result:result}}function _decode$1(data,offset){if(data.length===0){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}if(data[offset]>=248){const lengthLength=data[offset]-247;if(offset+1+lengthLength>data.length){logger$4.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;if(offset+1+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;if(offset+1+lengthLength>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;if(offset+1+length>data.length){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlify(data[offset])}}function decode$1(data){const bytes=arrayify(data);const decoded=_decode$1(bytes,0);if(decoded.consumed!==bytes.length){logger$4.throwArgumentError("invalid rlp data","data",data)}return decoded.result}const U32_MASK64=(()=>BigInt(2**32-1))();const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){const len=lst.length;let Ah=new Uint32Array(len);let Al=new Uint32Array(len);for(let i=0;in/2**32|0;const fromNumL=n=>n>>>0;function setU64FromNum(view,byteOffset,n,isLE){const h=fromNumH(n);const l=fromNumL(n);view.setUint32(byteOffset,isLE?l:h,isLE);view.setUint32(byteOffset+4,isLE?h:l,isLE)}const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;function isBytes(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in a&&a.BYTES_PER_ELEMENT===1}const atitle=title=>title?`"${title}" `:"";function anumber(n,title=""){if(typeof n!=="number")throw new TypeError(atitle(title)+"expected number, got "+typeof n);if(!Number.isSafeInteger(n)||n<0)throw new RangeError(atitle(title)+"expected integer >= 0, got "+n);return n}function abool(value,title=""){if(typeof value!=="boolean")throw new TypeError(atitle(title)+"expected boolean, got type="+typeof value);return value}function abytes(value,length,title=""){if(isBytes(value)&&length===undefined)return value;const bytes=isBytes(value);const ofLen="";const got=bytes?`length=${value.length}`:`type=${typeof value}`;const message=atitle(title)+"expected Uint8Array"+ofLen+", got "+got;if(!bytes)throw new TypeError(message);throw new RangeError(message)}function ahash(h){if(typeof h!=="function"||typeof h.create!=="function")throw new TypeError("expected hash wrapped by utils.createHasher");anumber(h.outputLen);anumber(h.blockLen);if(h.outputLen<1||h.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const aobject=(value,label)=>{if(value===null||typeof value!=="object"||Array.isArray(value))throw new TypeError((label==="object"?"":`"${label}" `)+"expected object, got type="+typeof value)};const aopts=(value,label)=>{aobject(value,label);const proto=Object.getPrototypeOf(value);if(proto!==Object.prototype&&proto!==null)throw new TypeError(`"${label}" expected plain object`);if(Object.hasOwn(value,"__proto__"))throw new TypeError(`"${label}.__proto__" is not allowed`)};function aexists(instance,checkFinished=true){if(instance.destroyed)throw new Error("hash was destroyed");if(checkFinished&&instance.finished)throw new Error("digest() was already called")}function aoutput(out,instance){abytes(out,undefined,"output");const min=instance.outputLen;if(!(out.length>=min)){throw new RangeError('"output" expected length >= '+min)}}function u32(arr){return new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4))}function clean(...arrays){for(let i=0;i>>shift}function rotl(word,shift){return word<>>32-shift>>>0}const isLE=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function byteSwap(word){return word<<24&4278190080|word<<8&16711680|word>>>8&65280|word>>>24&255}function byteSwap32(arr){for(let i=0;iu:byteSwap32;function nextTick(onReject){const host=globalThis;if(typeof host.scheduler?.yield==="function"){const promise=host.scheduler.yield();if(onReject)promise.catch(onReject);return promise}return new Promise(resolve=>host.setTimeout(resolve,0))}async function asyncLoop(iters,tick,cb,onReject){anumber(iters,"iters");anumber(tick,"tick");if(typeof cb!=="function")throw new TypeError("callback must be a function");let ts=Date.now();for(let i=0;i=0&&diff= 1');if(dkLen<1)throw new Error('"dkLen" must be >= 1');if(dkLen>(2**32-1)*hash.outputLen)throw new Error("derived key too long");const p=kdfInputToBytes(_password,"password");try{const s=kdfInputToBytes(_salt,"salt");try{const DK=new Uint8Array(dkLen);const{iHash,oHash,outputLen}=hmac$1.create(hash,p);const u=new Uint8Array(outputLen);const eng=pbkdf2Engine(iHash,oHash,s,u);return{c:c,dkLen:dkLen,asyncTick:asyncTick,DK:DK,outputLen:outputLen,eng:eng}}finally{if(typeof _salt==="string")clean(s)}}finally{if(typeof _password==="string")clean(p)}}function pbkdf2Engine(iHash,oHash,salt,u){const counter=new Uint8Array(4);const view=createView(counter);const salted=iHash._cloneInto().update(salt);const work=oHash._cloneInto();const iClone=iHash._cloneInto;const oClone=oHash._cloneInto;return{u1:(ti,Ti)=>{view.setInt32(0,ti,false);salted._cloneInto(work).update(counter).digestInto(u);oHash._cloneInto(work).update(u).digestInto(u);Ti.set(u.subarray(0,Ti.length))},rounds:(c,Ti)=>{for(let ui=1;ui{iHash.destroy();oHash.destroy();salted.destroy();work.destroy();clean(u);return DK}}}function pbkdf2$3(hash,password,salt,opts){const{c,dkLen,DK,outputLen,eng}=pbkdf2Init(hash,password,salt,opts);for(let ti=1,pos=0;pos>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){clean(SHA256_W)}destroy(){this.destroyed=true;this.set(0,0,0,0,0,0,0,0);clean(this.buffer)}}class _SHA256 extends SHA2_32B{constructor(){super(32,SHA256_IV)}}const K512=(()=>split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_Kh=(()=>K512[0])();const SHA512_Kl=(()=>K512[1])();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA2_64B extends HashMD{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(outputLen,IV){super(128,outputLen,16,false);this.Ah=IV[0]|0;this.Al=IV[1]|0;this.Bh=IV[2]|0;this.Bl=IV[3]|0;this.Ch=IV[4]|0;this.Cl=IV[5]|0;this.Dh=IV[6]|0;this.Dl=IV[7]|0;this.Eh=IV[8]|0;this.El=IV[9]|0;this.Fh=IV[10]|0;this.Fl=IV[11]|0;this.Gh=IV[12]|0;this.Gl=IV[13]|0;this.Hh=IV[14]|0;this.Hl=IV[15]|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=rotrSH(W15h,W15l,1)^rotrSH(W15h,W15l,8)^shrSH(W15h,W15l,7);const s0l=rotrSL(W15h,W15l,1)^rotrSL(W15h,W15l,8)^shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=rotrSH(W2h,W2l,19)^rotrBH(W2h,W2l,61)^shrSH(W2h,W2l,6);const s1l=rotrSL(W2h,W2l,19)^rotrBL(W2h,W2l,61)^shrSL(W2h,W2l,6);const SUMl=add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=rotrSH(Eh,El,14)^rotrSH(Eh,El,18)^rotrBH(Eh,El,41);const sigma1l=rotrSL(Eh,El,14)^rotrSL(Eh,El,18)^rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=rotrSH(Ah,Al,28)^rotrBH(Ah,Al,34)^rotrBH(Ah,Al,39);const sigma0l=rotrSL(Ah,Al,28)^rotrBL(Ah,Al,34)^rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=add3L(T1l,sigma0l,MAJl);Ah=add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){clean(SHA512_W_H,SHA512_W_L)}destroy(){this.destroyed=true;clean(this.buffer);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class _SHA512 extends SHA2_64B{constructor(){super(64,SHA512_IV)}}const sha256$2=createHasher(()=>new _SHA256,oidNist(1));const sha512$1=createHasher(()=>new _SHA512,oidNist(3));const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);const SHA3_PI=[];const SHA3_ROTL=[];const _SHA3_IOTA=[];for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;const rotlH=(h,l,s)=>s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);const B=new Uint32Array(5*2);function keccakP(s,rounds=24){if(!(s instanceof Uint32Array))throw new TypeError('"s" expected Uint32Array(50), got type='+typeof s);if(s.length!==50)throw new RangeError('"s" expected Uint32Array(50), got length='+s.length);anumber(rounds,"rounds");if(rounds<1||rounds>24)throw new Error('"rounds" expected integer 1..24');for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){const b0=s[y],b1=s[y+1],b2=s[y+2],b3=s[y+3];s[y]^=~s[y+2]&s[y+4];s[y+1]^=~s[y+3]&s[y+5];s[y+2]^=~s[y+4]&s[y+6];s[y+3]^=~s[y+5]&s[y+7];s[y+4]^=~s[y+6]&s[y+8];s[y+5]^=~s[y+7]&s[y+9];s[y+6]^=~s[y+8]&b0;s[y+7]^=~s[y+9]&b1;s[y+8]^=~b0&b2;s[y+9]^=~b1&b3}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}clean(B)}class Keccak{state;pos=0;posOut=0;finished=false;state32;destroyed=false;blockLen;suffix;outputLen;canXOF;enableXOF=false;rounds;constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){anumber(blockLen,"blockLen");anumber(suffix,"suffix");anumber(rounds,"rounds");abool(enableXOF,"enableXOF");this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.canXOF=enableXOF;this.rounds=rounds;anumber(outputLen,"outputLen");if(!(0=blockLen?u32(data):undefined;for(let pos=0;pos=blockLen){for(let i=0,o=pos/4;i=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not enabled");return this.writeInto(out)}xof(bytes){anumber(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){aoutput(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out.length===this.outputLen?out:out.subarray(0,this.outputLen));this.destroy()}digest(){const out=new Uint8Array(this.outputLen);this.digestInto(out);return out}destroy(){this.destroyed=true;clean(this.state)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds);to.blockLen=blockLen;to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.canXOF=this.canXOF;to.destroyed=this.destroyed;return to}}const genKeccak=(suffix,blockLen,outputLen,info={})=>createHasher(()=>new Keccak(blockLen,suffix,outputLen),info);const sha3_256=genKeccak(6,136,32,oidNist(8));const sha3_512=genKeccak(6,72,64,oidNist(10));const keccak_256=genKeccak(1,136,32);var assert_1;var hasRequiredAssert;function requireAssert(){if(hasRequiredAssert)return assert_1;hasRequiredAssert=1;function assert(val,msg){if(!val){const err=new Error(msg||"Assertion failed");if(Error.captureStackTrace)Error.captureStackTrace(err,assert);throw err}}assert_1=assert;return assert_1}var customBrowser={};var hasRequiredCustomBrowser;function requireCustomBrowser(){if(hasRequiredCustomBrowser)return customBrowser;hasRequiredCustomBrowser=1;customBrowser.custom="inspect";return customBrowser}var bn;var hasRequiredBn;function requireBn(){if(hasRequiredBn)return bn;hasRequiredBn=1;const{custom}=requireCustomBrowser();const zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];const groupSizes=[0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];const groupBases=[0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];const primes={p192:null,p224:null,p521:null,k256:null,p251:null,p25519:null,p448:null};const modes={NONE:0,QUO:1,REM:2,BOTH:3,EUCLID:4,ALL:7};const WND_WIDTH=4;const WND_SIZE=1<>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}else if(a!==this){for(;i=67108864;i++){this.words[i]-=67108864;this.words[i+1]+=1}this.length=Math.max(this.length,i+1);return this}iadd(num){enforce(BN.isBN(num),"num","bignum");if(this.negative===num.negative){this._iadd(this,num)}else{const cmp=this.ucmp(num);if(cmp===0){this.words[0]=0;this.length=1;this.negative=0;return this}if(cmp<0){this._isub(num,this);this.negative^=1}else{this._isub(this,num)}}return this}iaddn(num){enforce(isSMI(num),"num","smi");const negative=num<0|0;if(negative)num=-num;if(this.negative===negative){this._iaddn(num)}else{if(this.length===1&&this.words[0]this.length)return num.clone().iadd(this);return this.clone().iadd(num)}addn(num){return this.clone().iaddn(num)}_isub(a,b){let carry=0;let i=0;assert(a.length>=b.length);if(a!==this)this._alloc(a.length);for(;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}assert(carry===0);if(a!==this){for(;i=0)return this._normalize();assert(this.length!==1);this._alloc(this.length+1);for(let i=0;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}this.negative^=neg;if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}else{this._strip()}return this}mul(num){enforce(BN.isBN(num),"num","bignum");const len=this.length+num.length;const out=new BN;out.words=new Array(len);for(let i=0;i>>0===bits,"bits","uint32");const r=this.mul(num);const b=r.utestn(bits-1);r.iushrn(bits);if(this.negative^num.negative)return r.isubn(b);return r.iaddn(b)}_div(num,flags){enforce(BN.isBN(num),"num","bignum");assert((flags&modes.ALL)===flags);assert(flags!==modes.NONE);const a=this;const b=num;nonzero(!b.isZero());if(a.isZero())return[new BN(0),new BN(0)];const as=a.negative;const bs=b.negative;a.negative=0;b.negative=0;let q=null;let r=null;if(a.ucmp(b)<0){if(flags&modes.QUO)q=new BN(0);if(flags&modes.REM)r=a.clone()}else if(b.length===1){if(flags&modes.QUO)q=a.quon(b.words[0]);if(flags&modes.REM)r=a.remn(b.words[0])}else{[q,r]=a._wordDiv(b,flags)}a.negative=as;b.negative=bs;if(flags&modes.QUO){q.negative=a.negative^b.negative;q._normalize()}if(flags&modes.REM){r.negative=a.negative;r._normalize()}if(flags&modes.EUCLID){if(flags&modes.QUO){assert((flags&modes.REM)!==0);if(r.negative!==0){if(b.negative!==0)q.iaddn(1);else q.isubn(1)}}if(flags&modes.REM){if(r.negative!==0){if(b.negative!==0)r.isub(b);else r.iadd(b)}}}return[q,r]}_wordDiv(num,flags){let a=this.clone();let b=num;let q=null;let hi;const word=b.words[b.length-1]|0;const shift=26-countBits(word);if(shift!==0){b=b.clone();a.iushln(shift);b.iushln(shift);hi=b.words[b.length-1]|0}else{hi=word}const m=a.length-b.length;assert(m>=0);if(flags&modes.QUO){q=new BN(0);q.length=m+1;q.words=new Array(q.length);for(let i=0;i=0;j--){const ahi=a.words[b.length+j];const alo=a.words[b.length+j-1];const quo=(ahi*67108864+alo)/hi|0;let qj=Math.min(quo,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj-=1;a.negative=0;a._ishlnsubmul(b,1,j);a.ineg()}if(q)q.words[j]=qj}if(q)q._strip();if(flags&modes.REM&&shift!==0)a.iushrn(shift);return[q,a]}_ishlnsubmul(num,mul,shift){let carry=0;let i=0;this._expand(num.length+shift);for(;i>26)-(r/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this._strip();assert(carry===-1);carry=0;for(let i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this._strip()}quorem(num){return this._div(num,modes.BOTH)}iquo(num){return this.quo(num)._move(this)}iquon(num){enforce(isSMI(num),"num","smi");nonzero(num!==0);const neg=num<0|0;if(neg)num=-num;let carry=0;for(let i=this.length-1;i>=0;i--){const w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}this.negative^=neg;return this._strip()}quo(num){return this._div(num,modes.QUO)[0]}quon(num){return this.clone().iquon(num)}irem(num){return this.rem(num)._move(this)}iremn(num){let m=this.remrn(num);if(m<0)m=-m;this.words[0]=m;this.length=1;return this._normalize()}rem(num){return this._div(num,modes.REM)[1]}remn(num){return this.clone().iremn(num)}remrn(num){enforce(isSMI(num),"num","smi");nonzero(num!==0);if(num<0)num=-num;const p=(1<<26)%num;let acc=0;for(let i=this.length-1;i>=0;i--)acc=(p*acc+(this.words[i]|0))%num;return this.negative!==0?-acc|0:acc}divmod(num){return this._div(num,modes.BOTH|modes.EUCLID)}idiv(num){return this.div(num)._move(this)}idivn(num){if(this.negative===0)return this.iquon(num);const r=this.remrn(num);this.iquon(num);if(r<0){if(num<0)this.iaddn(1);else this.isubn(1)}return this}div(num){return this._div(num,modes.BOTH|modes.EUCLID)[0]}divn(num){return this.clone().idivn(num)}imod(num){if(this.ucmp(num)<0){if(this.negative!==0){this._isub(num,this);this.negative=0}return this}return this.mod(num)._move(this)}imodn(num){this.words[0]=this.modrn(num);this.length=1;this.negative=0;return this}mod(num){return this._div(num,modes.REM|modes.EUCLID)[1]}modn(num){return this.clone().imodn(num)}modrn(num){enforce(isSMI(num),"num","smi");let r=this.remrn(num);if(r<0){if(num<0)r-=num;else r+=num}return r}divRound(num){const[q,r]=this.quorem(num);if(r.isZero())return q;const bit=num.words[0]&1;num.iushrn(1);const cmp=r.ucmp(num);num.iushln(1);num.words[0]|=bit;if(cmp<0||num.isOdd()&&cmp===0)return q;if(this.negative^num.negative)return q.isubn(1);return q.iaddn(1)}ipow(num){return this.pow(num)._move(this)}ipown(num){return this.pown(num)._move(this)}pow(num){enforce(BN.isBN(num),"num","bignum");let b=countBits(num.words[num.length-1]);let r=new BN(1);for(let i=num.length-1;i>=0;i--){const word=num.words[i];for(let j=b-1;j>=0;j--){r=r.sqr();if(word>>j&1)r=r.mul(this)}b=26}return r}pown(num){enforce(isSMI(num),"num","smi");if(num<0)num=-num;if(num===0)return new BN(1);if(num===1)return this.clone();const bits=countBits(num);let r=this;for(let i=bits-2;i>=0;i--){r=r.sqr();if(num>>i&1)r=r.mul(this)}return r}isqr(){return this.imul(this)}sqr(){return this.mul(this)}_rootrem(pow,rem){enforce(pow>>>0===pow,"num","uint32");if(pow===0)throw new RangeError("Zeroth root.");if(~pow&this.negative)throw new RangeError("Negative with even root.");if(this.ucmpn(1)<=0)return[this.clone(),new BN(0)];let u=new BN(0);let t=BN.shift(1,this.bitLength()/pow+1|0);let v,r;if(this.negative!==0)t.ineg();if(pow===2){do{u=t;t=this.quo(u);t.iadd(u);t.iushrn(1)}while(t.ucmp(u)<0)}else{do{u=t;t=u.pown(pow-1);t=this.quo(t);v=u.muln(pow-1);t.iadd(v);t=t.quon(pow)}while(t.ucmp(u)<0)}if(rem){t=u.pown(pow);r=this.sub(t)}return[u,r]}rootrem(pow){return this._rootrem(pow,1)}iroot(pow){return this.root(pow)._move(this)}root(pow){return this._rootrem(pow,0)[0]}isPower(pow){enforce(pow>>>0===pow,"num","uint32");if(pow===0||~pow&this.negative)return false;const[,r]=this.rootrem(pow);return r.sign()===0}sqrtrem(){return this.rootrem(2)}isqrt(){return this.sqrt()._move(this)}sqrt(){return this.root(2)}isSquare(){return this.isPower(2)}iand(num){enforce(BN.isBN(num),"num","bignum");let x=this;let y=num;if(x===y)return x;if((x.negative|y.negative)===0)return x.iuand(y);if((x.negative&y.negative)===1){x.iaddn(1);y.iaddn(1);x.iuor(y);x.isubn(1);y.isubn(1);return x}if(x.negative!==0)[x,y]=[y.clone(),x];const width=x.bitLength();y.iaddn(1);y.inotn(width);x.iuand(y);y.inotn(width);y.isubn(1);return x._move(this)}iandn(num){enforce(isSMI(num),"num","smi");if((this.negative|num<0)!==0)return this.iand(new BN(num));this.words[0]&=num;this.length=1;return this}and(num){return this.clone().iand(num)}andn(num){return this.clone().iandn(num)}andrn(num){enforce(isSMI(num),"num","smi");if((this.negative|num<0)!==0){const n=this.iand(new BN(num));if(n.length>1)throw new RangeError("Number exceeds 26 bits.");return n.negative!==0?-n.words[0]:n.words[0]}return this.words[0]&num}iuand(num){enforce(BN.isBN(num),"num","bignum");this.length=Math.min(this.length,num.length);for(let i=0;i>>0===width,"width","uint32");const r=width%26;let s=Math.ceil(width/26);let i=0;this._expand(s);if(r>0)s-=1;for(;i0)this.words[i]^=(1<>>0===bits,"bits","uint32");const r=bits%26;const s=(bits-r)/26;const mask=(1<>>26-r}if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}}if(s!==0){this._alloc(this.length+s);for(let i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(let i=0;is){this.length-=s;for(let i=0;i=0;i--){const word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}}if(output){if(carry!==0){output._alloc(output.length+1);output.words[output.length++]=carry}else{if(output.length===0)output.words[output.length++]=0;output._strip()}}return this._strip()}ishr(num){enforce(BN.isBN(num),"bits","bignum");enforce(num.bitLength()<=32,"bits","uint32");return this.ishrn(num.toNumber())}ishrn(bits){enforce(bits>>>0===bits,"bits","uint32");if(this.negative!==0){this.iaddn(1);this.iushrn(bits);this.isubn(1);return this}return this.iushrn(bits)}shr(num){return this.clone().ishr(num)}shrn(bits){return this.clone().ishrn(bits)}iushr(num){enforce(BN.isBN(num),"bits","bignum");enforce(num.bitLength()<=32,"bits","uint32");return this.iushrn(num.toNumber())}iushrn(bits){enforce(bits>>>0===bits,"bits","uint32");return this._split(bits,null)}ushr(num){return this.clone().iushr(num)}ushrn(bits){return this.clone().iushrn(bits)}setn(bit,val){enforce(bit>>>0===bit,"bit","uint32");if(this.negative!==0){this.iaddn(1);this.usetn(bit,!val);this.isubn(1);return this}return this.usetn(bit,val)}usetn(bit,val){enforce(bit>>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;this._expand(s+1);if(val)this.words[s]|=1<>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;if(this.length<=s)return this.negative;const w=this.words[s];const val=w>>r&1;if(this.negative!==0){if(r>0&&w&(1<0)return val^1}}return val}utestn(bit){enforce(bit>>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;if(this.length<=s)return 0;return this.words[s]>>r&1}imaskn(bits){enforce(bits>>>0===bits,"bits","uint32");if(this.negative!==0){this.iaddn(1);this.inotn(bits+1);this.ineg()}return this.iumaskn(bits)}maskn(bits){return this.clone().imaskn(bits)}iumaskn(bits){enforce(bits>>>0===bits,"bits","uint32");const r=bits%26;let s=(bits-r)/26;if(this.length<=s)return this;if(r!==0)s+=1;this.length=Math.min(s,this.length);if(r!==0)this.words[this.length-1]&=(1<>>0===pos,"pos","uint32");enforce(width>>>0===width,"width","uint32");enforce(width<=26,"width","width");const shift=pos%26;const index=(pos-shift)/26;if(index>=this.length)return 0;let bits=this.words[index]>>shift&(1<26&&index+10}gtn(num){return this.cmpn(num)>0}gte(num){return this.cmp(num)>=0}gten(num){return this.cmpn(num)>=0}lt(num){return this.cmp(num)<0}ltn(num){return this.cmpn(num)<0}lte(num){return this.cmp(num)<=0}lten(num){return this.cmpn(num)<=0}sign(){if(this.negative!==0)return-1;if(this.length===1&&this.words[0]===0)return 0;return 1}isZero(){return this.length===1&&this.words[0]===0}isNeg(){return this.negative!==0}isPos(){return this.negative===0}isOdd(){return(this.words[0]&1)===1}isEven(){return(this.words[0]&1)===0}ucmp(num){enforce(BN.isBN(num),"num","bignum");if(this.lengthnum.length)return 1;for(let i=this.length-1;i>=0;i--){const a=this.words[i]|0;const b=num.words[i]|0;if(a===b)continue;return(a>b)-(a1)return 1;const w=this.words[0]|0;if(num<0)num=-num;return(w>num)-(w=0)a.imod(b);while(!a.isZero()){const bits=a._makeOdd();if(bits&1){const bmod8=b.andln(7);if(bmod8===3||bmod8===5)j=-j}if(a.ucmp(b)<0){[a,b]=[b,a];if(a.andln(3)===3&&b.andln(3)===3)j=-j}a._isub(a,b).iushrn(1);const bmod8=b.andln(7);if(bmod8===3||bmod8===5)j=-j}if(b.cmpn(1)!==0)return 0;return j}kronecker(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero())return num.ucmpn(1)===0?1:0;if(num.isZero())return this.ucmpn(1)===0?1:0;if(((this.words[0]|num.words[0])&1)===0)return 0;const x=this;const y=num.clone();const bits=y._makeOdd();const table=[0,1,0,-1,0,-1,0,1];let k=x.jacobi(y);if(bits&1)k*=table[x.andln(7)];return k|0}igcd(num){return this.gcd(num)._move(this)}gcd(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero())return num.abs();if(num.isZero())return this.abs();let a=this.clone();let b=num.clone();a.negative=0;b.negative=0;const shift=a._factor2(b);if(shift!==0){a.iushrn(shift);b.iushrn(shift)}for(;;){a._makeOdd();b._makeOdd();const cmp=a.ucmp(b);if(cmp<0){[a,b]=[b,a]}else if(cmp===0||b.ucmpn(1)===0){break}a._isub(a,b)}return b.iushln(shift)}ilcm(num){return this.lcm(num)._move(this)}lcm(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero()||num.isZero())return new BN(0);return this.quo(this.gcd(num)).mul(num).iabs()}egcd(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero()){return[new BN(0),new BN(num.sign()),num.abs()]}if(num.isZero()){return[new BN(this.sign()),new BN(0),this.abs()]}const x=this.clone();const y=num.clone();x.negative=0;y.negative=0;const A=new BN(1);const B=new BN(0);const C=new BN(0);const D=new BN(1);const g=x._factor2(y);if(g>0){x.iushrn(g);y.iushrn(g)}const xp=x.clone();const yp=y.clone();while(!x.isZero()){let i=x._makeOdd();let j=y._makeOdd();while(i--){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}while(j--){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}if(this.negative!==0)C.ineg();if(num.negative!==0)D.ineg();return[C,D,y.iushln(g)]}iinvert(num){return this.invert(num)._move(this)}invert(num){enforce(BN.isBN(num),"num","bignum");range(num.sign()>0,"invert");if(num.isOdd())return this._invertp(num);if(num.cmpn(1)===0)throw new RangeError("Not invertible.");const[s,,g]=this.egcd(num);if(g.cmpn(1)!==0)throw new RangeError("Not invertible.");return s.imod(num)}ifermat(num){return this.fermat(num)._move(this)}fermat(num){const red=HAS_BIGINT?BN.red(num):BN.mont(num);return this.toRed(red).redFermat().fromRed()}ipowm(y,m,mont){return this.powm(y,m,mont)._move(this)}powm(y,m,mont){const red=!HAS_BIGINT&&mont?BN.mont(m):BN.red(m);return this.toRed(red).redPow(y).fromRed()}ipowmn(y,m,mont){return this.powmn(y,m,mont)._move(this)}powmn(y,m,mont){const red=mont?BN.mont(m):BN.red(m);return this.toRed(red).redPown(y).fromRed()}isqrtm(p){return this.sqrtm(p)._move(this)}sqrtm(p){enforce(BN.isBN(p),"p","bignum");let red;if(p.andln(3)===3||p.andln(7)===5){red=BN.red(p)}else{red=BN.mont(p)}return this.toRed(red).redSqrt().fromRed()}isqrtpq(p,q){return this.sqrtpq(p,q)._move(this)}sqrtpq(p,q){const sp=this.sqrtm(p);const sq=this.sqrtm(q);const[mp,mq]=p.egcd(q);const lhs=sq.mul(mp).mul(p);const rhs=sp.mul(mq).mul(q);const n=p.mul(q);return lhs.iadd(rhs).imod(n)}isPrime(rng,reps,limit){enforce(reps>>>0===reps,"reps","uint32");if(!this.isPrimeMR(rng,reps+1,true))return false;if(!this.isPrimeLucas(limit))return false;return true}isPrimeMR(rng,reps,force2=false){enforce(reps>>>0===reps,"reps","uint32");enforce(reps>0,"reps","integer");enforce(typeof force2==="boolean","force2","boolean");const n=this;if(n.cmpn(7)<0){return n.cmpn(2)===0||n.cmpn(3)===0||n.cmpn(5)===0}if(n.isEven())return false;const nm1=n.subn(1);const nm3=nm1.subn(2);const k=nm1.zeroBits();const q=nm1.ushrn(k);const red=BN.red(n);const rnm1=nm1.toRed(red);const rone=new BN(1).toRed(red);next:for(let i=0;i>>0===limit,"limit","uint32");const n=this;if(n.cmpn(1)<=0)return false;if(n.isEven())return n.cmpn(2)===0;let p=3;for(;;){if(p>1e4){throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`)}if(limit!==0&&p>limit){return false}const d=new BN(p*p-4);const j=d.jacobi(n);if(j===-1)break;if(j===0)return n.cmpn(p+2)===0;if(p===40){if(n.isSquare())return false}p+=1}const s=n.addn(1);const r=s._makeOdd();let vk=new BN(2);let vk1=new BN(p);for(let i=s.bitLength();i>=0;i--){if(s.utestn(i)){vk=vk.mul(vk1).isubn(p).imod(n);vk1=vk1.sqr().isubn(2).imod(n)}else{vk1=vk1.mul(vk).isubn(p).imod(n);vk=vk.sqr().isubn(2).imod(n)}}if(vk.cmpn(2)===0||vk.cmp(n.subn(2))===0){const a=vk.muln(p).imod(n);const b=vk1.ushln(1).imod(n);if(a.cmp(b)===0)return true}for(let t=0;t>>0===width,"width","uint32");range(width>0,"width");if(this.testn(width-1))return this.notn(width).iaddn(1).ineg();return this.clone()}toRed(ctx){enforce(ctx instanceof Red,"ctx","reduction context");if(this.red)throw new Error("Already in reduction context.");return ctx.convertTo(this)}fromRed(){red(this.red,"fromRed");return this.red.convertFrom(this)}forceRed(ctx){enforce(ctx instanceof Red,"ctx","reduction context");if(this.red){if(!ctx.m.eq(this.red.m)||ctx.mont!==this.red.mont)throw new Error("Already in reduction context.")}else{range(this.negative===0,"red");range(this.ucmp(ctx.m)<0,"red")}return this.clone()._forceRed(ctx)}redIAdd(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIAdd");return this.red.iadd(this,num)}redAdd(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redAdd");return this.red.add(this,num)}redIAddn(num){enforce(isSMI(num),"num","smi");red(this.red,"redIAddn");return this.red.iaddn(this,num)}redAddn(num){enforce(isSMI(num),"num","smi");red(this.red,"redAddn");return this.red.addn(this,num)}redISub(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redISub");return this.red.isub(this,num)}redSub(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redSub");return this.red.sub(this,num)}redISubn(num){enforce(isSMI(num),"num","smi");red(this.red,"redISubn");return this.red.isubn(this,num)}redSubn(num){enforce(isSMI(num),"num","smi");red(this.red,"redSubn");return this.red.subn(this,num)}redIMul(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIMul");return this.red.imul(this,num)}redMul(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redMul");return this.red.mul(this,num)}redIMuln(num){enforce(isSMI(num),"num","smi");red(this.red,"redIMuln");return this.red.imuln(this,num)}redMuln(num){enforce(isSMI(num),"num","smi");red(this.red,"redMuln");return this.red.muln(this,num)}redIDiv(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIDiv");return this.red.idiv(this,num)}redDiv(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redDiv");return this.red.div(this,num)}redIDivn(num){enforce(isSMI(num),"num","smi");red(this.red,"redIDivn");return this.red.idivn(this,num)}redDivn(num){enforce(isSMI(num),"num","smi");red(this.red,"redDivn");return this.red.divn(this,num)}redIPow(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIPow");nonred(!num.red,"redIPow");return this.red.ipow(this,num)}redPow(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redPow");nonred(!num.red,"redPow");return this.red.pow(this,num)}redIPown(num){enforce(isSMI(num),"num","smi");red(this.red,"redIPown");return this.red.ipown(this,num)}redPown(num){enforce(isSMI(num),"num","smi");red(this.red,"redPown");return this.red.pown(this,num)}redISqr(){red(this.red,"redISqr");return this.red.isqr(this)}redSqr(){red(this.red,"redSqr");return this.red.sqr(this)}redISqrt(){red(this.red,"redISqrt");return this.red.isqrt(this)}redSqrt(){red(this.red,"redSqrt");return this.red.sqrt(this)}redIDivSqrt(v){red(this.red,"redIDivSqrt");return this.red.idivsqrt(this,v)}redDivSqrt(v){red(this.red,"redDivSqrt");return this.red.divsqrt(this,v)}redIsSquare(){red(this.red,"redIsSquare");return this.red.isSquare(this)}redIShl(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIShl");nonred(!num.red,"redIShl");return this.red.ishl(this,num)}redShl(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redShl");nonred(!num.red,"redShl");return this.red.shl(this,num)}redIShln(num){enforce(num>>>0===num,"num","uint32");red(this.red,"redIShln");return this.red.ishln(this,num)}redShln(num){enforce(num>>>0===num,"num","uint32");red(this.red,"redShln");return this.red.shln(this,num)}redINeg(){red(this.red,"redINeg");return this.red.ineg(this)}redNeg(){red(this.red,"redNeg");return this.red.neg(this)}redEq(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redEq");return this.red.eq(this,num)}redEqn(num){enforce(isSMI(num),"num","smi");red(this.red,"redEqn");return this.red.eqn(this,num)}redIsHigh(){red(this.red,"redIsHigh");return this.red.isHigh(this)}redIsLow(){red(this.red,"redIsLow");return this.red.isLow(this)}redIsOdd(){red(this.red,"redIsOdd");return this.red.isOdd(this)}redIsEven(){red(this.red,"redIsEven");return this.red.isEven(this)}redLegendre(){red(this.red,"redLegendre");return this.red.legendre(this)}redJacobi(){red(this.red,"redJacobi");return this.red.jacobi(this)}redKronecker(){red(this.red,"redKronecker");return this.red.kronecker(this)}redIInvert(){red(this.red,"redIInvert");return this.red.iinvert(this)}redInvert(){red(this.red,"redInvert");return this.red.invert(this)}redIFermat(){red(this.red,"redIFermat");return this.red.ifermat(this)}redFermat(){red(this.red,"redFermat");return this.red.fermat(this)}_move(dest){dest.words=this.words;dest.length=this.length;dest.negative=this.negative;dest.red=this.red;return dest}_alloc(size){while(this.words.length1&&this.words[this.length-1]===0)this.length-=1;return this._normalize()}_normalize(){assert(this.length>0);if(this.length===1&&this.words[0]===0)this.negative=0;return this}_check(){assert(this.length>0);assert(this.length<=this.words.length);if(this.length===1){if(this.words[0]===0)assert(this.negative===0);return this}assert(this.words[this.length-1]!==0);return this}_invertp(p){enforce(BN.isBN(p),"p","bignum");range(p.sign()>0,"invert");assert(p.isOdd());if(p.cmpn(1)===0)throw new RangeError("Not invertible.");const a=this.clone();const b=p.clone();const u=new BN(1);const v=new BN(0);if(a.isNeg()||a.ucmp(b)>=0)a.imod(b);while(!a.isZero()){let i=a._makeOdd();let j=b._makeOdd();while(i--){if(u.isOdd())u._iadd(u,p);u.iushrn(1)}while(j--){if(v.isOdd())v._iadd(v,p);v.iushrn(1)}if(a.ucmp(b)>=0){a._isub(a,b);if(u.ucmp(v)<0){u._isub(v,u);u._isub(p,u)}else{u._isub(u,v)}}else{b._isub(b,a);if(v.ucmp(u)<0){v._isub(u,v);v._isub(p,v)}else{v._isub(v,u)}}}if(b.cmpn(1)!==0)throw new RangeError("Not invertible.");assert(v.negative===0);assert(v.ucmp(p)<0);return v}_makeOdd(){const shift=this.zeroBits();if(shift>0)this.iushrn(shift);return shift}_factor2(num){if((this.words[0]|num.words[0])&1)return 0;const len=Math.min(this.length,num.length);let r=0;for(let i=0;i>>0===pos,"pos","uint32");if(pos>=this.length)return 0;return this.words[pos]}[custom](){let prefix="BN";if(this.red)prefix="BN-R";return`<${prefix}: ${this.toString(10)}>`}toNumber(){let num=this.words[0];if(this.length===2){num+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){num+=4503599627370496+this.words[1]*67108864}else if(this.length>2){throw new RangeError("Number can only safely store up to 53 bits.")}return this.negative!==0?-num:num}toDouble(){let num=0;for(let i=this.length-1;i>=0;i--)num=num*67108864+this.words[i];return this.negative!==0?-num:num}valueOf(){return this.toDouble()}toBigInt(){if(!HAS_BIGINT)throw new Error("BigInt is not supported!");const s52=BigInt(52);const s26=BigInt(26);let i=this.length-1;let num=BigInt(0);for(;i>=1;i-=2){const hi=this.words[i]*67108864;const lo=this.words[i-1];num=num<=0)num=num<>>0===base,"base","uint32");enforce(padding>>>0===padding,"padding","uint32");if(base<2||base>36)throw new RangeError("Base ranges between 2 and 36.");this._check();if(base===16){let out="";let off=0;let carry=0;for(let i=0;i>>24-off&16777215;if(carry!==0||i!==this.length-1)out=zeros[6-word.length]+word+out;else out=word+out;off+=2;if(off>=26){off-=26;i-=1}}if(carry!==0)out=carry.toString(16)+out;while(out.length%padding!==0)out="0"+out;if(this.negative!==0)out="-"+out;return out}const groupSize=groupSizes[base-1];const groupBase=groupBases[base-1];const c=this.clone();let out="";c.negative=0;while(!c.isZero()){const r=c.remrn(groupBase).toString(base);c.iquon(groupBase);if(!c.isZero())out=zeros[groupSize-r.length]+r+out;else out=r+out}if(this.isZero())out="0";while(out.length%padding!==0)out="0"+out;if(this.negative!==0)out="-"+out;return out}toJSON(){return this.toString(16,2)}toArray(endian,length){return this.toArrayLike(Array,endian,length)}toBuffer(endian,length){return this.toArrayLike(bufferExports.Buffer,endian,length)}toArrayLike(ArrayType,endian,length){if(endian==null)endian="be";if(length==null)length=0;enforce(typeof ArrayType==="function","ArrayType","function");enforce(endian==="be"||endian==="le","endian","endianness");enforce(length>>>0===length,"length","uint32");this._check();const bytes=this.byteLength();const size=length||Math.max(1,bytes);if(bytes>size)throw new RangeError("Byte array longer than desired length.");const res=allocate(ArrayType,size);if(endian==="be"){let pos=res.length-1;let carry=0;for(let i=0;i=0)res[pos--]=word>>>8&255;if(pos>=0)res[pos--]=word>>>16&255;if(shift===6){if(pos>=0)res[pos--]=word>>>24&255;carry=0}else{carry=word>>>24}}if(pos>=0){res[pos--]=carry;while(pos>=0)res[pos--]=0;carry=0}assert(carry===0)}else{let pos=0;let carry=0;for(let i=0;i>>8&255;if(pos>>16&255;if(shift===6){if(pos>>24&255;carry=0}else{carry=word>>>24}}if(pos0){const lo=num%67108864;const hi=(num-lo)/67108864;this.words.push(lo);num=hi}if(this.words.length===0)this.words.push(0);this.length=this.words.length;this.negative=neg;if(endian==="le")this.reverse();return this}fromBigInt(num,endian){if(endian==null)endian="be";enforce(typeof num==="bigint","num","bigint");enforce(endian==="be"||endian==="le","endian","endianness");if(!HAS_BIGINT)throw new Error("BigInt is not supported!");const start=num>>0===base,"base","uint32");enforce(endian==="be"||endian==="le","endian","endianness");if(base<2||base>36)throw new Error("Base ranges between 2 and 36.");str=str.replace(/\s+/g,"");let start=0;if(str.length>0&&str.charCodeAt(0)===45)start=1;if(base===16)this._fromHex(str,start);else this._fromBase(str,base,start);this.negative=start;this._normalize();if(endian==="le")this.reverse();return this}_fromHex(str,start){this.length=Math.max(2,Math.ceil((str.length-start)/6));this.words=new Array(this.length);for(let i=0;i=start;i-=6){const w=parseHex(str,i,i+6);this.words[j]|=w<>>26-off&4194303;off+=24;if(off>=26){off-=26;j+=1}}if(i+6!==start){const w=parseHex(str,start,i+6);this.words[j]|=w<>>26-off&4194303}return this._strip()}_fromBase(str,base,start){this.words[0]=0;this.length=1;this.negative=0;let limbLen=0;let limbPow=1;for(;limbPow<=67108863;limbPow*=base)limbLen+=1;limbLen-=1;limbPow=limbPow/base|0;const total=str.length-start;const mod=total%limbLen;const end=Math.min(total,total-mod)+start;let i=start;for(;i>>0===data.length,"data","array-like");enforce(endian==="be"||endian==="le","endian","endianness");if(data.length===0){this.words[0]=0;this.length=1;this.negative=0;return this}this.length=Math.max(2,Math.ceil(data.length/3));this.words=new Array(this.length);this.negative=0;for(let i=0;i=2;i-=3){const w=data[i]|data[i-1]<<8|data[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j+=1}}switch(left){case 2:w=data[1]|data[0]<<8;break;case 1:w=data[0];break}}else{const len=data.length-left;for(let i=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j+=1}}switch(left){case 2:w=data[len]|data[len+1]<<8;break;case 1:w=data[len];break}}if(left>0){this.words[j]|=w<>>26-off&67108863}return this._strip()}decode(data,endian){return this.fromBuffer(data,endian)}from(num,base,endian){if(num==null)return this;if(base==="le"||base==="be")[base,endian]=[endian,base];if(typeof num==="number")return this.fromNumber(num,endian);if(typeof num==="bigint")return this.fromBigInt(num,endian);if(typeof num==="string")return this.fromString(num,base,endian);if(typeof num==="object"){if(BN.isBN(num))return this.fromBN(num,endian);if(num.length>>>0===num.length)return this.fromArrayLike(num,endian)}if(typeof num==="boolean")return this.fromBool(num);throw new TypeError("Non-numeric object passed to BN.")}static min(...args){let min=null;for(const num of args){enforce(BN.isBN(num),"num","bignum");if(!min||num.cmp(min)<0)min=num}return min||new BN(0)}static max(...args){let max=null;for(const num of args){enforce(BN.isBN(num),"num","bignum");if(!max||num.cmp(max)>0)max=num}return max||new BN(0)}static cmp(a,b){enforce(BN.isBN(a),"a","bignum");return a.cmp(b)}static ucmp(a,b){enforce(BN.isBN(a),"a","bignum");return a.ucmp(b)}static red(num){return new Red(num)}static barrett(num){return new Barrett(num)}static mont(num){return new Mont(num)}static _prime(name){if(primes[name])return primes[name];let prime;if(name==="p192")prime=new P192;else if(name==="p224")prime=new P224;else if(name==="p521")prime=new P521;else if(name==="k256")prime=new K256;else if(name==="p251")prime=new P251;else if(name==="p25519")prime=new P25519;else if(name==="p448")prime=new P448;else throw new Error(`Unknown prime: "${name}".`);primes[name]=prime;return prime}static prime(name){return BN._prime(name).p.clone()}static pow(num,exp){if(num===2)return BN.shift(1,exp);return(new BN).fromNumber(num).pown(exp)}static shift(num,bits){if(num===1)return new BN(0).usetn(bits,1);return(new BN).fromNumber(num).ishln(bits)}static mask(bits){return BN.shift(1,bits).isubn(1)}static randomBits(rng,bits){enforce(rng!=null,"rng","rng");enforce(bits>>>0===bits,"bits","uint32");if(typeof rng==="object"){enforce(typeof rng.randomBytes==="function","rng","rng");const size=bits+7>>>3;const total=size*8;const bytes=rng.randomBytes(size);enforce(bufferExports.Buffer.isBuffer(bytes),"bytes","buffer");if(bytes.length!==size)throw new RangeError("Invalid number of bytes returned from RNG.");const num=BN.fromBuffer(bytes);if(total>bits)num.iushrn(total-bits);return num}enforce(typeof rng==="function","rng","rng");const num=rng(bits);enforce(BN.isBN(num),"num","bignum");range(num.negative===0,"RNG");nonred(!num.red,"RNG");if(num.bitLength()>bits)throw new RangeError("Invalid number of bits returned from RNG.");return num}static random(rng,min,max){min=BN.cast(min,16);max=BN.cast(max,16);if(min.cmp(max)>0)throw new RangeError("Minimum cannot be greater than maximum.");const space=max.sub(min).iabs();const bits=space.bitLength();if(bits===0)return min.clone();for(;;){const num=BN.randomBits(rng,bits);if(num.cmp(space)>=0)continue;num.iadd(min);return num}}static of(num,endian){return(new BN).of(num,endian)}static fromNumber(num,endian){return(new BN).fromNumber(num,endian)}static fromDouble(num,endian){return(new BN).fromDouble(num,endian)}static fromBigInt(num,endian){return(new BN).fromBigInt(num,endian)}static fromBool(value){return(new BN).fromBool(value)}static fromString(str,base,endian){return(new BN).fromString(str,base,endian)}static fromJSON(json){return(new BN).fromJSON(json)}static fromBN(num){return(new BN).fromBN(num)}static fromArray(data,endian){return(new BN).fromArray(data,endian)}static fromBuffer(data,endian){return(new BN).fromBuffer(data,endian)}static fromArrayLike(data,endian){return(new BN).fromArrayLike(data,endian)}static decode(data,endian){return(new BN).decode(data,endian)}static from(num,base,endian){return(new BN).from(num,base,endian)}static cast(num,base,endian){if(BN.isBN(num))return num;return new BN(num,base,endian)}static isBN(obj){return obj instanceof BN}}BN.BN=BN;BN.wordSize=26;BN.native=0;class Prime{constructor(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=BN.shift(1,this.n).isub(this.p);this.lo=this.p.clone();this.one=this.p.clone()}ireduce(num){const neg=num.negative!==0;let bits=num.bitLength();assert(bits<=this.n*2);num.negative=0;while(bits>this.n){this.split(num,this.lo);this.imulK(num);num._iadd(num,this.lo);bits=num.bitLength()}const cmp=bits0){num._isub(num,this.p)}else;if(neg&&!num.isZero())num._isub(this.p,num);return num}split(input,out){input._split(this.n,out)}imulK(num){return num.imul(this.k)}pm2(x1){throw new Error("Not implemented.")}fermat(x){return this.pm2(x)}}class Prime34 extends Prime{constructor(name,p){super(name,p)}pm3d4(x1){throw new Error("Not implemented.")}pp1d4(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;const r=this.pp1d4(x);if(!red.sqr(r).eq(x))throw new SquareRootError(r);return r}divsqrt(u,v){const{red}=u;const u2=red.sqr(u);const u3=red.mul(u2,u);const u5=red.mul(u3,u2);const v3=red.mul(red.sqr(v),v);const p=this.pm3d4(red.mul(u5,v3));const x=red.mul(red.mul(u3,v),p);const c=red.mul(v,red.sqr(x));if(c.eq(u))return x;throw new SquareRootError(x)}}class Prime58 extends Prime{constructor(name,p,sm1){super(name,p);this.sm1=new BN(sm1,16)}pm5d8(x1){throw new Error("Not implemented.")}pp3d8(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;const sm1=this.sm1._forceRed(red);const r=this.pp3d8(x);if(red.sqr(r).eq(x))return r;const c=red.mul(r,sm1);if(red.sqr(c).eq(x))return c;throw new SquareRootError(r)}divsqrt(u,v){const{red}=u;const sm1=this.sm1._forceRed(red);const v3=red.mul(red.sqr(v),v);const v7=red.mul(red.sqr(v3),v);const p=this.pm5d8(red.mul(u,v7));const x=red.mul(red.mul(u,v3),p);const c=red.mul(v,red.sqr(x));if(c.eq(u))return x;const mc=red.ineg(c);if(mc.eq(u))return red.mul(x,sm1);if(mc.eq(red.mul(u,sm1)))throw new SquareRootError(red.mul(x,sm1));throw new SquareRootError(x)}}class Prime116 extends Prime{constructor(name,p,g){super(name,p);this.g=new BN(g,16);this.z=this.p.subn(1).zeroBits()}powS(x1){throw new Error("Not implemented.")}powE(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;switch(red.jacobi(x)){case-1:throw new SquareRootError(x);case 0:return x.clone()}let g=this.g._forceRed(red);let y=this.powE(x);let b=this.powS(x);let k=this.z;for(;;){let t=b;let m=0;while(t.cmpn(1)!==0&&m>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10)input.length-=10;else input.length-=9;input._strip()}imulK(num){num._expand(num.length+2);let lo=0;for(let i=0;i>>26;num.words[i]=w&67108863}if(carry!==0){num._alloc(num.length+1);num.words[num.length++]=carry}return num}core(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const x3=red.sqrnmul(x2,1,x1);const x6=red.sqrnmul(x3,3,x3);const x12=red.sqrnmul(x6,6,x6);const x24=red.sqrnmul(x12,12,x12);const x48=red.sqrnmul(x24,24,x24);const x96=red.sqrnmul(x48,48,x48);const x192=red.sqrnmul(x96,96,x96);const x240=red.sqrnmul(x192,48,x48);const x246=red.sqrnmul(x240,6,x6);const x247=red.sqrnmul(x246,1,x1);return x247}pm3d4(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pm2(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);const r3=red.sqrn(r2,1);const r4=red.sqrnmul(r3,1,x1);return r4}pp1d4(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrnmul(r0,1,x1);const r2=red.sqrn(r1,1);return r2}}class P25519 extends Prime58{constructor(){super("p25519","7fffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff ffffffff ffffffed","2b832480 4fc1df0b 2b4d0099 3dfbd7a7"+"2f431806 ad2fe478 c4ee1b27 4a0ea0b0")}imulK(num){let carry=0;for(let i=0;i>>26;num.words[i]=w&67108863}if(carry!==0){num._alloc(num.length+1);num.words[num.length++]=carry}return num}core(x1,x2){const{red}=x1;const x4=red.sqrnmul(x2,2,x2);const x5=red.sqrnmul(x4,1,x1);const x10=red.sqrnmul(x5,5,x5);const x20=red.sqrnmul(x10,10,x10);const x40=red.sqrnmul(x20,20,x20);const x50=red.sqrnmul(x40,10,x10);const x100=red.sqrnmul(x50,50,x50);const x200=red.sqrnmul(x100,100,x100);const x250=red.sqrnmul(x200,50,x50);return x250}pm5d8(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pm2(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);const r3=red.sqrn(r2,1);const r4=red.sqrnmul(r3,2,x2);return r4}pp3d8(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrnmul(r0,1,x1);const r2=red.sqrn(r1,1);return r2}}class P448 extends Prime34{constructor(){super("p448","ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff fffffffe ffffffff"+"ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff")}imulK(num){const one=this.one.inject(num);return num.iushln(224)._iadd(num,one)}core(x1,x2){const{red}=x1;const x3=red.sqrnmul(x2,1,x1);const x6=red.sqrnmul(x3,3,x3);const x9=red.sqrnmul(x6,3,x3);const x11=red.sqrnmul(x9,2,x2);const x22=red.sqrnmul(x11,11,x11);const x44=red.sqrnmul(x22,22,x22);const x88=red.sqrnmul(x44,44,x44);const x176=red.sqrnmul(x88,88,x88);const x220=red.sqrnmul(x176,44,x44);const x222=red.sqrnmul(x220,2,x2);return x222}pm3d4(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const x222=this.core(x1,x2);const r0=red.sqrnmul(x222,1,x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,222,x222);return r2}pm2(x1){const{red}=x1;const r0=this.pm3d4(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pp1d4(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrnmul(r0,2,x2);const r2=red.sqrn(r1,222);return r2}}class Red{constructor(m){let prime=null;if(typeof m==="string"){prime=BN._prime(m);m=prime.p}enforce(BN.isBN(m),"m","bignum");nonred(!m.red,"reduction");range(m.sign()>0,"reduction");this.m=m;this.prime=prime;this.mb=null;this.sm1=null}_verify1(a){range(a.negative===0,"red");red(a.red!=null,"red")}_verify2(a,b){range((a.negative|b.negative)===0,"red");red(a.red!=null&&a.red===b.red,"red")}get mont(){return false}precompute(){if(this.sm1===null&&this.m.andln(7)===5){if(this.prime){this.sm1=this.prime.sm1.clone()._forceRed(this)}else{const x=new BN(2).toRed(this);const e=this.m.subn(1).iushrn(2);this.sm1=this.pow(x,e)}}return this}convertTo(num){const res=num.mod(this.m);res.red=this;return res}convertFrom(num){const res=num.clone();res.red=null;return res}intTo(a){return a}intFrom(a){return a}imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.imod(this.m)._forceRed(this)}iadd(a,b){this._verify2(a,b);a._iadd(a,b);if(a.ucmp(this.m)>=0)a._isub(a,this.m);return a}add(a,b){if(a.length=0)a._isub(a,this.m);return a}addn(a,num){return this.iaddn(a.clone(),num)}isub(a,b){this._verify2(a,b);const cmp=a.ucmp(b);if(cmp===0){a.words[0]=0;a.length=1;return a}if(cmp<0){a._isub(b,a);a._isub(this.m,a)}else{a._isub(a,b)}return a}sub(a,b){return this.isub(a.clone(),b)}isubn(a,num){this._verify1(a);if(num<0)return this.iaddn(a,-num);if(this.m.length===1)num%=this.m.words[0];if(a.length===1&&a.words[0]=0)a._isub(a,this.m)}else{this.imod(a)}if(neg)this.ineg(a);return a}muln(a,num){return this.imuln(a.clone(),num)}idiv(a,b){return this.div(a,b)._move(a)}div(a,b){return this.mul(a,this.invert(b))}idivn(a,num){return this.divn(a,num)._move(a)}divn(a,num){return this.div(a,this.convertTo(new BN(num)))}ipow(a,num){return this.pow(a,num)._move(a)}pow(a,num){this._verify1(a);if(num.isNeg())a=this.invert(a);if(num.length===1)return this.pown(a,num.words[0]);if(HAS_BIGINT&&!this.prime)return this.powInt(a,num);return this.powNum(a,num)}powNum(a,num){const one=new BN(1).toRed(this);const wnd=new Array(WND_SIZE);const a2=this.sqr(a);wnd[0]=a;for(let i=1;i=WND_WIDTH){let width=WND_WIDTH;let bits=num.bits(i-width,width);if(bits>=1}if(r===one){r=wnd[bits>>1].clone()}else{r=this.sqrn(r,width);r=this.mul(r,wnd[bits>>1])}i-=width}if(i>0){const bits=num.bits(0,i);while(i--){r=this.sqr(r);if(bits>>i&1)r=this.mul(r,a)}}return r}powInt(a,num){if(this.mb===null)this.mb=this.m.toBigInt();const x=this.intFrom(a.toBigInt());const y=powInt(x,num,this.mb);const z=this.intTo(y);return BN.fromBigInt(z)._forceRed(this)}sqrn(a,n){while(n--)a=this.sqr(a);return a}sqrnmul(a,n,b){return this.mul(this.sqrn(a,n),b)}ipown(a,num){return this.pown(a,num)._move(a)}pown(a,num){this._verify1(a);if(num<0){a=this.invert(a);num=-num}if(num===0)return new BN(1).toRed(this);if(num===1)return a.clone();const bits=countBits(num);let r=a;for(let i=bits-2;i>=0;i--){r=this.sqr(r);if(num>>i&1)r=this.mul(r,a)}return r}isqr(a){return this.imul(a,a)}sqr(a){return this.mul(a,a)}isqrt(x){return this.sqrt(x)._move(x)}sqrt(x){this._verify1(x);if(this.prime)return this.prime.sqrt(x);if(this.m.andln(3)===3)return this.sqrt3mod4(x);if(this.m.andln(7)===5){if(this.sm1!=null)return this.sqrt5mod8sm1(x);return this.sqrt5mod8(x)}return this.sqrt0(x)}sqrt3mod4(x){const e=this.m.addn(1).iushrn(2);const b=this.pow(x,e);if(!this.sqr(b).eq(x))throw new SquareRootError(b);return b}sqrt5mod8(x){const one=new BN(1).toRed(this);const e=this.m.ushrn(3);const x2=this.add(x,x);const alpha=this.pow(x2,e);const beta=this.mul(x2,this.sqr(alpha));const b=this.mul(this.mul(alpha,x),this.isub(beta,one));if(!this.sqr(b).eq(x))throw new SquareRootError(b);return b}sqrt5mod8sm1(x){const e=this.m.addn(3).iushrn(3);const b=this.pow(x,e);if(this.sqr(b).eq(x))return b;const c=this.mul(b,this.sm1);if(this.sqr(c).eq(x))return c;throw new SquareRootError(b)}sqrt0(x){if(this.m.cmpn(1)===0||!this.m.isOdd())throw new Error("Invalid prime.");switch(this.jacobi(x)){case-1:throw new SquareRootError(x);case 0:return x.clone()}const one=new BN(1).toRed(this);const s=this.m.subn(1);const e=s._makeOdd();const n=new BN(2).toRed(this);while(this.jacobi(n)!==-1)this.iadd(n,one);let g=this.pow(n,s);let b=this.pow(x,s);let y=this.pow(x,s.iaddn(1).iushrn(1));let k=e;for(;;){let t=b;let m=0;while(!t.eq(one)&&m=0;return this.kronecker(a)>=0}ishl(a,num){this._verify1(a);return this.imod(a.iushl(num))}shl(a,num){return this.ishl(a.clone(),num)}ishln(a,num){this._verify1(a);a.iushln(num);if(num<=4){while(a.ucmp(this.m)>=0)a._isub(a,this.m)}else{this.imod(a)}return a}shln(a,num){return this.ishln(a.clone(),num)}ineg(a){this._verify1(a);if(!a.isZero())a._isub(this.m,a);return a}neg(a){return this.ineg(a.clone())}eq(a,b){this._verify2(a,b);return a.ucmp(b)===0}eqn(a,num){this._verify1(a);if(this.m.length===1){num%=this.m.words[0];if(num<0)num+=this.m.words[0];return a.ucmpn(num)===0}if(num<0){this.m._isubn(-num);const cmp=a.ucmp(this.m);this.m._iaddn(-num);return cmp===0}return a.ucmpn(num)===0}isHigh(a){return!this.isLow(a)}isLow(a){this._verify1(a);return a.ucmp(this.m.ushrn(1))<=0}isOdd(a){this._verify1(a);return a.isOdd()}isEven(a){this._verify1(a);return a.isEven()}legendre(num){this._verify1(num);if(this.m.isEven())throw new Error("legendre: `num` must be odd.");const e=this.m.subn(1).iushrn(1);const symbol=this.pow(num,e);if(symbol.isZero())return 0;const one=new BN(1).toRed(this);if(symbol.eq(one))return 1;if(symbol.eq(this.ineg(one)))return-1;throw new Error("Invalid prime.")}jacobi(a){this._verify1(a);return a.jacobi(this.m)}kronecker(a){this._verify1(a);return a.kronecker(this.m)}iinvert(a){return this.invert(a)._move(a)}invert(a){this._verify1(a);return a.invert(this.m)._forceRed(this)}ifermat(a){return this.fermat(a)._move(a)}fermat(a){this._verify1(a);if(a.isZero()||this.m.cmpn(1)===0)throw new RangeError("Not invertible.");if(this.prime)return this.prime.fermat(a);return this.pow(a,this.m.subn(2))}invertAll(elems){enforce(Array.isArray(elems),"elems","array");for(const elem of elems){enforce(BN.isBN(elem),"elem","bignum");this._verify1(elem)}if(this.m.cmpn(1)===0||this.m.isEven())throw new RangeError("Not invertible.");const len=elems.length;const invs=new Array(len);if(len===0)return invs;let acc=new BN(1).toRed(this);for(let i=0;i=0;i--){if(elems[i].isZero())continue;invs[i]=this.mul(acc,invs[i]);acc=this.mul(acc,elems[i])}return invs}[custom](){if(this.prime)return``;return``}}class Barrett extends Red{constructor(m){super(m);this.prime=null;this.n=this.m.bitLength();if(this.n%26!==0)this.n+=26-this.n%26;this.k=this.n*2;this.w=this.k/26;this.b=BN.shift(1,this.k).div(this.m)}convertTo(num){if(num.length>this.w)return super.convertTo(num);return this.imod(num.clone())}_shift(q){let i=0;let j=this.w;while(j=0)a._isub(a,this.m);if(neg&&!a.isZero())a._isub(this.m,a);a.red=this;return a}}class Mont extends Red{constructor(m){super(m);this.prime=null;this.n=this.m.length*26;this.r=BN.shift(1,this.n);this.r2=BN.shift(1,this.n*2).imod(this.m);this.ri=this.r.invert(this.m);this.mi=this.r.mul(this.ri).isubn(1).div(this.m);this.rib=null}get mont(){return true}convertTo(num){if(num.isNeg()||num.ucmp(this.m)>=0)return this.imod(num.ushln(this.n));return this.mul(num,this.r2)}convertFrom(num){const r=this.mul(num,new BN(1));r.red=null;return r}intTo(a){return(a<=0)u._isub(u,this.m);return u._forceRed(this)}imuln(a,num){this._verify1(a);if(a.isZero())return a;if(num===0){a.words[0]=0;a.length=1;return a}const neg=num<0;if(neg)num=-num;if(this.m.length===1)num%=this.m.words[0];const bits=countBits(num);if(bits>5){this.imul(a,this.convertTo(new BN(num)))}else if((num&num-1)===0){for(let i=0;i=0;i--){this.iadd(a,a);if(num>>i&1)this.iadd(a,c)}}if(neg)this.ineg(a);return a}eqn(a,num){this._verify1(a);if(num===0)return a.isZero();return a.ucmp(this.convertTo(new BN(num)))===0}isLow(a){this._verify1(a);return this.convertFrom(a).ucmp(this.m.ushrn(1))<=0}isOdd(a){this._verify1(a);return this.convertFrom(a).isOdd()}isEven(a){this._verify1(a);return this.convertFrom(a).isEven()}invert(a){this._verify1(a);return this.imod(a.invert(this.m).mul(this.r2))}}function makeError(Error,msg,start){const err=new Error(msg);if(Error.captureStackTrace)Error.captureStackTrace(err,start);return err}function assert(value,message){if(!value){const msg=message||"Assertion failed.";throw makeError(Error,msg,assert)}}function enforce(value,name,type){if(!value){const msg=`"${name}" must be a(n) ${type}.`;throw makeError(TypeError,msg,enforce)}}function range(value,name){if(!value){const msg=`"${name}" only works with positive numbers.`;throw makeError(RangeError,msg,range)}}function red(value,name){if(!value){const msg=`"${name}" only works with red numbers.`;throw makeError(TypeError,msg,red)}}function nonred(value,name){if(!value){const msg=`"${name}" only works with normal numbers.`;throw makeError(TypeError,msg,nonred)}}function nonzero(value){if(!value){const msg="Cannot divide by zero.";throw makeError(RangeError,msg,nonzero)}}class SquareRootError extends Error{constructor(result){super();this.name="SquareRootError";this.message="X is not a square mod P.";this.result=result.fromRed();if(Error.captureStackTrace)Error.captureStackTrace(this,SquareRootError)}}function isInteger(num){return Number.isSafeInteger(num)}function isSMI(num){return isInteger(num)&&num>=-67108863&&num<=67108863}function allocate(ArrayType,size){if(ArrayType.allocUnsafeSlow)return ArrayType.allocUnsafeSlow(size);return new ArrayType(size)}function getBase(base){if(base==null)return 10;if(typeof base==="number")return base;switch(base){case"bin":return 2;case"oct":return 8;case"dec":return 10;case"hex":return 16}return 0}function countBits(w){if(Math.clz32)return 32-Math.clz32(w);let t=w;let r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}function zeroBits(w){if(w===0)return 26;let t=w;let r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0)r+=1;return r}function parseHex(str,start,end){const len=Math.min(str.length,end);let r=0;let z=0;for(let i=start;i=49&&c<=54){b=c-49+10}else if(c>=17&&c<=22){b=c-17+10}else{b=c}r|=b;z|=b}if(z&-16)throw new Error("Invalid string.");return r}function parseBase(str,start,end,mul){const len=Math.min(str.length,end);let r=0;for(let i=start;i=49){b=c-49+10}else if(c>=17){b=c-17+10}else{b=c}if(c<0||c>207||b>=mul)throw new Error("Invalid string.");r+=b}return r}function powInt(x,e,m){const one=BigInt(1);const wnd=new Array(WND_SIZE);const x2=x*x%m;wnd[0]=x;for(let i=1;i=WND_WIDTH){let width=WND_WIDTH;let bits=e.bits(i-width,width);if(bits>=1}if(r===one){r=wnd[bits>>1]}else{r=sqrn(r,width,m);r=r*wnd[bits>>1]%m}i-=width}if(i>0){const bits=e.bits(0,i);while(i--){r=r*r%m;if(bits>>i&1)r=r*x%m}}return r}function sqrn(x,n,m){for(let i=0;i>>26;let rword=carry&67108863;const min=Math.max(0,k-self.length+1);const max=Math.min(k,num.length-1);for(let j=min;j<=max;j++){const i=k-j;const a=self.words[i];const b=num.words[j];const r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0)out.words[k]=carry|0;else out.length-=1;return out._strip()}function bigMulTo(self,num,out){const len=self.length+num.length;out.negative=self.negative^num.negative;out._alloc(len);out.length=len;let carry=0;let hncarry=0;let k=0;for(;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0)out.words[k]=carry;else out.length-=1;return out._strip()}function jumboMulTo(x,y,out){if(!HAS_BIGINT||x.length+y.length>82595519)return bigMulTo(x,y,out);const zero=BigInt(0);const mask=BigInt(67108863);const shift=BigInt(26);let z=x.toBigInt()*y.toBigInt();const neg=zzero){out.words[i++]=Number(z&mask);z>>=shift}if(i===0)out.words[i++]=0;out.length=i;out.negative=neg;return out}function comb10MulTo(self,num,out){const a=self.words;const b=num.words;const o=out.words;const a0=a[0]|0;const al0=a0&8191;const ah0=a0>>>13;const a1=a[1]|0;const al1=a1&8191;const ah1=a1>>>13;const a2=a[2]|0;const al2=a2&8191;const ah2=a2>>>13;const a3=a[3]|0;const al3=a3&8191;const ah3=a3>>>13;const a4=a[4]|0;const al4=a4&8191;const ah4=a4>>>13;const a5=a[5]|0;const al5=a5&8191;const ah5=a5>>>13;const a6=a[6]|0;const al6=a6&8191;const ah6=a6>>>13;const a7=a[7]|0;const al7=a7&8191;const ah7=a7>>>13;const a8=a[8]|0;const al8=a8&8191;const ah8=a8>>>13;const a9=a[9]|0;const al9=a9&8191;const ah9=a9>>>13;const b0=b[0]|0;const bl0=b0&8191;const bh0=b0>>>13;const b1=b[1]|0;const bl1=b1&8191;const bh1=b1>>>13;const b2=b[2]|0;const bl2=b2&8191;const bh2=b2>>>13;const b3=b[3]|0;const bl3=b3&8191;const bh3=b3>>>13;const b4=b[4]|0;const bl4=b4&8191;const bh4=b4>>>13;const b5=b[5]|0;const bl5=b5&8191;const bh5=b5>>>13;const b6=b[6]|0;const bl6=b6&8191;const bh6=b6>>>13;const b7=b[7]|0;const bl7=b7&8191;const bh7=b7>>>13;const b8=b[8]|0;const bl8=b8&8191;const bh8=b8>>>13;const b9=b[9]|0;const bl9=b9&8191;const bh9=b9>>>13;let c=0;let lo,mid,hi;out.negative=self.negative^num.negative;out._alloc(20);out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);let w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;let w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;let w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;let w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;let w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;let w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;let w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;let w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;let w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;let w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;let w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;let w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;let w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;let w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;let w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;let w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;let w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;let w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);let w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length+=1}return out}if(!Math.imul)comb10MulTo=smallMulTo;BN.Red=Red;bn=BN;return bn}var bnBrowser;var hasRequiredBnBrowser;function requireBnBrowser(){if(hasRequiredBnBrowser)return bnBrowser;hasRequiredBnBrowser=1;bnBrowser=requireBn();return bnBrowser}var chacha20;var hasRequiredChacha20;function requireChacha20(){if(hasRequiredChacha20)return chacha20;hasRequiredChacha20=1;const assert=requireAssert();const BIG_ENDIAN=new Int8Array(new Int16Array([1]).buffer)[0]===0;class ChaCha20{constructor(){this.state=new Uint32Array(16);this.stream=new Uint32Array(16);this.bytes=new Uint8Array(this.stream.buffer);this.pos=-1;if(BIG_ENDIAN)this.bytes=bufferExports.Buffer.alloc(64)}init(key,nonce,counter){if(counter==null)counter=0;assert(bufferExports.Buffer.isBuffer(key));assert(bufferExports.Buffer.isBuffer(nonce));assert(Number.isSafeInteger(counter));if(key.length!==16&&key.length!==32)throw new RangeError("Invalid key size.");if(nonce.length>=24){key=ChaCha20.derive(key,nonce.slice(0,16));nonce=nonce.slice(16)}this.state[0]=1634760805;this.state[1]=key.length<32?824206446:857760878;this.state[2]=key.length<32?2036477238:2036477234;this.state[3]=1797285236;this.state[4]=readU32(key,0);this.state[5]=readU32(key,4);this.state[6]=readU32(key,8);this.state[7]=readU32(key,12);this.state[8]=readU32(key,16%key.length);this.state[9]=readU32(key,20%key.length);this.state[10]=readU32(key,24%key.length);this.state[11]=readU32(key,28%key.length);this.state[12]=counter>>>0;if(nonce.length===8){this.state[13]=counter/4294967296>>>0;this.state[14]=readU32(nonce,0);this.state[15]=readU32(nonce,4)}else if(nonce.length===12){this.state[13]=readU32(nonce,0);this.state[14]=readU32(nonce,4);this.state[15]=readU32(nonce,8)}else if(nonce.length===16){this.state[12]=readU32(nonce,0);this.state[13]=readU32(nonce,4);this.state[14]=readU32(nonce,8);this.state[15]=readU32(nonce,12)}else{throw new RangeError("Invalid nonce size.")}this.pos=0;return this}encrypt(data){assert(bufferExports.Buffer.isBuffer(data));if(this.pos===-1)throw new Error("Context is not initialized.");for(let i=0;i>>32-b}function readU32(data,off){return data[off++]+data[off++]*256+data[off++]*65536+data[off]*16777216}function writeU32(dst,num,off){dst[off++]=num;num>>>=8;dst[off++]=num;num>>>=8;dst[off++]=num;num>>>=8;dst[off++]=num;return off}chacha20=ChaCha20;return chacha20}var chacha20Browser;var hasRequiredChacha20Browser;function requireChacha20Browser(){if(hasRequiredChacha20Browser)return chacha20Browser;hasRequiredChacha20Browser=1;chacha20Browser=requireChacha20();return chacha20Browser}var hmac;var hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;const assert=requireAssert();class HMAC{constructor(Hash,size,x=[],y=[]){assert(typeof Hash==="function");assert(size>>>0===size);assert(Array.isArray(x));assert(Array.isArray(y));this.hash=Hash;this.size=size;this.x=x;this.y=y;this.inner=new Hash;this.outer=new Hash}init(key){assert(bufferExports.Buffer.isBuffer(key));if(key.length>this.size){const Hash=this.hash;const h=new Hash;h.init(...this.x);h.update(key);key=h.final(...this.y);assert(key.length<=this.size)}const pad=bufferExports.Buffer.alloc(this.size);for(let i=0;i0){let want=64-pos;if(want>len)want=len;data.copy(this.block,pos,off,off+want);pos+=want;len-=want;off+=want;if(pos<64)return;this._transform(this.block,0)}while(len>=64){this._transform(data,off);off+=64;len-=64}if(len>0)data.copy(this.block,0,off,off+len)}_final(out){assert(this.size!==FINALIZED,"Context is not initialized.");const pos=this.size&63;const len=this.size*8;writeU32(DESC,len*(1/4294967296)>>>0,0);writeU32(DESC,len>>>0,4);this._update(PADDING,1+(119-pos&63));this._update(DESC,8);for(let i=0;i<8;i++){writeU32(out,this.state[i],i*4);this.state[i]=0}for(let i=0;i<64;i++)this.msg[i]=0;for(let i=0;i<64;i++)this.block[i]=0;this.size=FINALIZED;return out}_transform(chunk,pos){const W=this.msg;let a=this.state[0];let b=this.state[1];let c=this.state[2];let d=this.state[3];let e=this.state[4];let f=this.state[5];let g=this.state[6];let h=this.state[7];let i=0;for(;i<16;i++)W[i]=readU32(chunk,pos+i*4);for(;i<64;i++)W[i]=sigma1(W[i-2])+W[i-7]+sigma0(W[i-15])+W[i-16];for(i=0;i<64;i++){const t1=h+Sigma1(e)+Ch(e,f,g)+K[i]+W[i];const t2=Sigma0(a)+Maj(a,b,c);h=g;g=f;f=e;e=d+t1>>>0;d=c;c=b;b=a;a=t1+t2>>>0}this.state[0]+=a;this.state[1]+=b;this.state[2]+=c;this.state[3]+=d;this.state[4]+=e;this.state[5]+=f;this.state[6]+=g;this.state[7]+=h}static hash(){return new SHA256}static hmac(){return new HMAC(SHA256,64)}static digest(data){return SHA256.ctx.init().update(data).final()}static root(left,right){assert(bufferExports.Buffer.isBuffer(left)&&left.length===32);assert(bufferExports.Buffer.isBuffer(right)&&right.length===32);return SHA256.ctx.init().update(left).update(right).final()}static multi(x,y,z){const{ctx}=SHA256;ctx.init();ctx.update(x);ctx.update(y);if(z)ctx.update(z);return ctx.final()}static mac(data,key){return SHA256.hmac().init(key).update(data).final()}}SHA256.native=0;SHA256.id="SHA256";SHA256.size=32;SHA256.bits=256;SHA256.blockSize=64;SHA256.zero=bufferExports.Buffer.alloc(32,0);SHA256.ctx=new SHA256;function Sigma0(x){return(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function Sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function sigma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function sigma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}function Ch(x,y,z){return z^x&(y^z)}function Maj(x,y,z){return x&y|z&(x|y)}function readU32(data,off){return data[off++]*16777216+data[off++]*65536+data[off++]*256+data[off]}function writeU32(data,num,off){data[off++]=num>>>24;data[off++]=num>>>16;data[off++]=num>>>8;data[off++]=num;return off}sha256$1=SHA256;return sha256$1}var sha256Browser;var hasRequiredSha256Browser;function requireSha256Browser(){if(hasRequiredSha256Browser)return sha256Browser;hasRequiredSha256Browser=1;sha256Browser=requireSha256();return sha256Browser}var batchRng;var hasRequiredBatchRng;function requireBatchRng(){if(hasRequiredBatchRng)return batchRng;hasRequiredBatchRng=1;const assert=requireAssert();const BN=requireBnBrowser();const ChaCha20=requireChacha20Browser();const SHA256=requireSha256Browser();class BatchRNG{constructor(curve,encode=key=>key){this.curve=curve;this.encode=encode;this.hash=new SHA256;this.chacha=new ChaCha20;this.key=bufferExports.Buffer.alloc(32,0);this.iv=bufferExports.Buffer.alloc(8,0);this.cache=[new BN(1),new BN(1)]}init(batch){assert(Array.isArray(batch));this.hash.init();for(const[msg,sig,key]of batch){this.hash.update(SHA256.digest(msg));this.hash.update(sig);this.hash.update(this.encode(key))}this.key=this.hash.final();this.cache[0]=new BN(1);this.cache[1]=new BN(1);return this}encrypt(counter){const size=this.curve.scalarSize*2;const data=bufferExports.Buffer.alloc(size,0);const left=data.slice(0,this.curve.scalarSize);const right=data.slice(this.curve.scalarSize);this.chacha.init(this.key,this.iv,counter);this.chacha.encrypt(data);return[this.curve.decodeScalar(left),this.curve.decodeScalar(right)]}refresh(counter){let overflow=0;for(;;){this.iv[4]=overflow;this.iv[5]=overflow>>>8;this.iv[6]=overflow>>>16;this.iv[7]=overflow>>>24;overflow+=1;const[s1,s2]=this.encrypt(counter);if(s1.isZero()||s1.cmp(this.curve.n)>=0)continue;if(s2.isZero()||s2.cmp(this.curve.n)>=0)continue;this.cache[0]=s1;this.cache[1]=s2;break}}generate(index){assert(index>>>0===index);if(index&1)this.refresh(index>>>1);return this.cache[index&1]}}batchRng=BatchRNG;return batchRng}var elliptic={};var hasRequiredElliptic;function requireElliptic(){if(hasRequiredElliptic)return elliptic;hasRequiredElliptic=1;const{custom}=requireCustomBrowser();const BN=requireBnBrowser();const types={AFFINE:0,JACOBIAN:1,PROJECTIVE:2,EXTENDED:3};const jsfIndex=[-3,-1,-5,-7,0,7,5,1,3];let uid=0;class Curve{constructor(Point,type,conf){this.Point=null;this.id=null;this.uid=uid++;this.ossl=null;this.type="base";this.endian="be";this.hash=null;this.prefix=null;this.context=false;this.prime=null;this.p=null;this.red=null;this.fieldSize=0;this.fieldBits=0;this.adjustedSize=0;this.signBit=0;this.mask=0;this.n=null;this.h=null;this.q=null;this.z=null;this.g=null;this.nh=null;this.scalarSize=0;this.scalarBits=0;this.zero=null;this.one=null;this.two=null;this.three=null;this.four=null;this.i2=null;this.i3=null;this.i4=null;this.i6=null;this.torsion=null;this.endo=null;this.hi=null;this._init(Point,type,conf)}_init(Point,type,conf){assert(typeof Point==="function");assert(typeof type==="string");assert(conf&&typeof conf==="object");assert(conf.red==null||conf.red instanceof BN.Red);assert(conf.p!=null,"Must pass a prime.");assert(conf.id==null||typeof conf.id==="string");assert(conf.ossl==null||typeof conf.ossl==="string");assert(conf.endian==null||typeof conf.endian==="string");assert(conf.hash==null||typeof conf.hash==="string");assert(conf.prefix==null||typeof conf.prefix==="string");assert(conf.context==null||typeof conf.context==="boolean");assert(conf.prime==null||typeof conf.prime==="string");assert(conf.torsion==null||Array.isArray(conf.torsion));this.Point=Point;this.id=conf.id||null;this.ossl=conf.ossl||null;this.type=type;this.endian=conf.endian||(type==="short"?"be":"le");this.hash=conf.hash||null;this.prefix=conf.prefix?bufferExports.Buffer.from(conf.prefix,"binary"):null;this.context=conf.context||false;this.prime=conf.prime||null;this.p=BN.fromJSON(conf.p);if(conf.red){this.red=conf.red}else{this.red=conf.prime?BN.red(conf.prime):BN.mont(this.p);this.red.precompute()}this.fieldSize=this.p.byteLength();this.fieldBits=this.p.bitLength();this.adjustedSize=this.fieldSize+((this.fieldBits&7)===0);this.signBit=this.adjustedSize*8-1;this.mask=255;if((this.fieldBits&7)!==0)this.mask=(1<<(this.fieldBits&7))-1;this.n=BN.fromJSON(conf.n||"0");this.h=BN.fromJSON(conf.h||"1");this.q=this.n.mul(this.h);this.z=BN.fromJSON(conf.z||"0").toRed(this.red);this.g=null;this.nh=this.n.ushrn(1);this.scalarSize=this.n.byteLength();this.scalarBits=this.n.bitLength();this.zero=new BN(0).toRed(this.red);this.one=new BN(1).toRed(this.red);this.two=new BN(2).toRed(this.red);this.three=new BN(3).toRed(this.red);this.four=new BN(4).toRed(this.red);this.i2=this.two.redInvert();this.i3=this.three.redInvert();this.i4=this.i2.redSqr();this.i6=this.i2.redMul(this.i3);this.torsion=new Array(this.h.word(0));for(let i=0;i0&&this.p.isOdd());assert(this.n.sign()>=0);assert(this.h.sign()>0&&this.h.cmpn(255)<=0);assert(this.endian==="be"||this.endian==="le");return this}_finalize(conf){assert(conf&&typeof conf==="object");this.g=conf.g?this.pointFromJSON(conf.g):this.point();if(conf.torsion){assert(conf.torsion.length===this.torsion.length);for(let i=0;ia.cmp(b));while(out.length>>0;let acc=this.jpoint();for(let i=0;i0;i--){for(let j=0;j=0;i--){const z=naf[i];if(i!==naf.length-1)acc=acc.dbl();if(z>0)acc=acc.add(points[z-1>>1]);else if(z<0)acc=acc.sub(points[-z-1>>1])}return acc}_wnafMulAdd(w,points,coeffs){assert(w>>>0===w);assert(Array.isArray(points));assert(Array.isArray(coeffs));assert(points.length===coeffs.length);const length=points.length;const wnd=new Array(length);const naf=new Array(length);let max=0;for(let i=0;i0&&point.type!==points[i-1].type)throw new Error("Cannot mix points.");wnd[i]=null;naf[i]=null;max=Math.max(max,coeff.bitLength()+1)}let ppoint=null;let pcoeff=null;let len=0;for(let i=0;i=0;i--){if(i!==max-1)acc=acc.dbl();for(let j=0;j0)acc=acc.add(wnd[j][z-1>>1]);else if(z<0)acc=acc.sub(wnd[j][-z-1>>1])}}return acc}_endoWnafMulAdd(points,coeffs){throw new Error("Not implemented.")}_scale(curve,invert){assert(curve instanceof Curve);assert(curve.p.eq(this.p));switch(curve.type){case"short":return this._scaleShort(curve,invert);case"mont":return this._scaleMont(curve,invert);case"edwards":return this._scaleEdwards(curve,invert);default:throw new Error("Not implemented.")}}_scaleShort(curve,invert){throw new Error("Not implemented.")}_scaleMont(curve,invert){throw new Error("Not implemented.")}_scaleEdwards(curve,invert){throw new Error("Not implemented.")}isElliptic(){throw new Error("Not implemented.")}jinv(){throw new Error("Not implemented.")}isComplete(){return false}precompute(rng){assert(!this.g.isInfinity(),"Must have base point.");assert(!this.n.isZero(),"Must have order.");this.g.precompute(this.n.bitLength(),rng);return this}scalar(num,base,endian){const k=new BN(num,base,endian);assert(!k.red);if(this.n.isZero())return k;return k.imod(this.n)}field(num,base,endian){const x=BN.cast(num,base,endian);if(x.red)return x.forceRed(this.red);return x.toRed(this.red)}point(x,y){throw new Error("Not implemented.")}jpoint(x,y,z){throw new Error("Not implemented.")}xpoint(x,z){throw new Error("Not implemented.")}cpoint(xx,xz,yy,yz){assert(xx instanceof BN);assert(xz instanceof BN);assert(yy instanceof BN);assert(yz instanceof BN);if(xz.isZero()||yz.isZero())return this.point();const z=xz.redMul(yz).redInvert();const x=xx.redMul(yz).redMul(z);const y=yy.redMul(xz).redMul(z);return this.point(x,y)}solveX2(y){throw new Error("Not implemented.")}solveX(y){return this.solveX2(y).redSqrt()}solveY2(x){throw new Error("Not implemented.")}solveY(x){return this.solveY2(x).redSqrt()}validate(point){throw new Error("Not implemented.")}pointFromX(x,sign){throw new Error("Not implemented.")}pointFromY(y,sign){throw new Error("Not implemented.")}isIsomorphic(curve){throw new Error("Not implemented.")}isIsogenous(curve){throw new Error("Not implemented.")}pointFromShort(point){throw new Error("Not implemented.")}pointFromMont(point,sign){throw new Error("Not implemented.")}pointFromEdwards(point){throw new Error("Not implemented.")}pointFromUniform(u){throw new Error("Not implemented.")}pointToUniform(p){throw new Error("Not implemented.")}pointFromHash(bytes,pake=false){assert(bufferExports.Buffer.isBuffer(bytes));assert(typeof pake==="boolean");if(bytes.length!==this.fieldSize*2)throw new Error("Invalid hash size.");const s1=bytes.slice(0,this.fieldSize);const s2=bytes.slice(this.fieldSize);const u1=this.decodeUniform(s1);const u2=this.decodeUniform(s2);const p1=this.pointFromUniform(u1);const p2=this.pointFromUniform(u2);const p3=p1.add(p2);return pake?p3.mulH():p3}pointToHash(p,subgroup,rng){assert(p instanceof this.Point);assert(subgroup>>>0===subgroup);const i=subgroup%this.torsion.length;const p0=p.add(this.torsion[i]);for(;;){const u1=this.randomField(rng);const p1=this.pointFromUniform(u1);if(p1.neg().eq(p1))continue;const p2=p0.sub(p1);const hint=randomInt(rng);let u2;try{u2=this.pointToUniform(p2,hint&15)}catch(e){if(e.message==="Invalid point.")continue;throw e}const s1=this.encodeUniform(u1,hint>>>8);const s2=this.encodeUniform(u2,hint>>>16);return bufferExports.Buffer.concat([s1,s2])}}randomScalar(rng){const max=this.n.isZero()?this.p:this.n;return BN.random(rng,1,max)}randomField(rng){return BN.random(rng,1,this.p).toRed(this.red)}randomPoint(rng){let p;for(;;){const x=this.randomField(rng);const sign=(randomInt(rng)&1)!==0;try{p=this.pointFromX(x,sign)}catch(e){continue}assert(p.validate());return p.mulH()}}mulAll(points,coeffs){return this.jmulAll(points,coeffs)}jmulAll(points,coeffs){assert(Array.isArray(points));assert(points.length===0||points[0]instanceof Point);if(this.endo&&points.length>0&&points[0].type===types.AFFINE)return this._endoWnafMulAdd(points,coeffs);return this._wnafMulAdd(5,points,coeffs)}mulH(k){assert(k instanceof BN);return this.imulH(k.clone())}imulH(k){assert(k instanceof BN);assert(!k.red);const word=this.h.word(0);if((word&word-1)===0){const bits=this.h.bitLength();return k.iushln(bits-1).imod(this.n)}return k.imuln(word).imod(this.n)}normalizeAll(points){assert(Array.isArray(points));const len=points.length;const z=new Array(len);for(let i=0;i>>0===bits);const msb=this.endian==="le"?this.fieldSize-1:0;const bytes=x.fromRed().encode(this.endian,this.fieldSize);bytes[msb]|=bits&~this.mask&255;return bytes}decodeUniform(bytes){assert(bufferExports.Buffer.isBuffer(bytes));if(bytes.length!==this.fieldSize)throw new Error("Invalid field size.");const x=BN.decode(bytes,this.endian);x.iumaskn(this.fieldBits);return x.toRed(this.red)}encodePoint(point,compact){assert(point instanceof Point);return point.encode(compact)}decodePoint(bytes){throw new Error("Not implemented.")}encodeX(point){throw new Error("Not implemented.")}decodeX(bytes){throw new Error("Not implemented.")}decodeEven(bytes){throw new Error("Not implemented.")}decodeSquare(bytes){throw new Error("Not implemented.")}toShort(){throw new Error("Not implemented.")}toMont(b0){throw new Error("Not implemented.")}toEdwards(a0){throw new Error("Not implemented.")}pointToJSON(point,pre){assert(point instanceof Point);return point.toJSON(pre)}pointFromJSON(json){throw new Error("Not implemented.")}toJSON(pre){let prefix,context;let n,z,endo;if(this.type==="edwards"){prefix=this.prefix?this.prefix.toString():null;context=this.context}if(!this.n.isZero())n=this.n.toJSON();if(!this.z.isZero()){z=this.z.fromRed();if(this.z.redIsHigh())z.isub(this.p);z=z.toString(16)}if(this.endo)endo=this.endo.toJSON();return{id:this.id,ossl:this.ossl,type:this.type,endian:this.endian,hash:this.hash,prefix:prefix,context:context,prime:this.prime,p:this.p.toJSON(),a:undefined,b:undefined,d:undefined,n:n,h:this.h.toString(16),s:undefined,z:z,c:undefined,g:this.g.toJSON(pre),endo:endo}}static fromJSON(json){return new this(json)}}class Point{constructor(curve,type){assert(curve instanceof Curve);assert(type>>>0===type);this.curve=curve;this.type=type;this.pre=null}_init(){throw new Error("Not implemented.")}_safeNAF(width){assert(width>>>0===width);if(this.pre&&this.pre.naf)return this.pre.naf;if(width===0)return null;const size=1<>>0===width);if(this.pre&&this.pre.naf)return this.pre.naf;if(width===0)return null;const odds=this._safeNAF(width).points;const points=this.curve.affinizeAll(odds);return new NAF(width,points)}_getWindows(width,bits){assert(width>>>0===width);assert(bits>>>0===bits);if(this.pre&&this.pre.windows)return this.pre.windows;if(width===0)return null;const size=1<>>0;const wnds=new Array(steps*size);let g=this.toJ();for(let i=0;i>>0===step);assert(power>>>0===power);if(this.pre&&this.pre.doubles)return this.pre.doubles;if(step===0)return null;const len=Math.ceil(power/step)+1;const dbls=new Array(len);let acc=this.toJ();let k=0;dbls[k++]=acc;for(let i=0;i>>0;return k.bitLength()<=steps*width}_hasDoubles(k){assert(k instanceof BN);if(!this.pre||!this.pre.doubles)return false;const{step,points}=this.pre.doubles;const power=k.bitLength()+1;return points.length>=Math.ceil(power/step)+1}_getJNAF(point){assert(point instanceof Point);assert(point.type===this.type);return[this,this.add(point),this.sub(point),point]}_blind(k,rng){assert(k instanceof BN);assert(!k.red);if(this.pre&&this.pre.blinding){const{blind,unblind}=this.pre.blinding;const t=k.sub(blind);return[this,t,unblind]}if(!rng)return[this,k,null];if(this.pre){if(this.curve.n.isZero())return[this,k,null];const a=this.curve.randomScalar(rng);const r=a.mul(this.curve.n);const t=r.iadd(k);return[this,t,null]}const p=this.randomize(rng);return[p,k,null]}clone(){throw new Error("Not implemented.")}precompute(bits,rng){assert(bits>>>0===bits);if(!this.pre)this.pre=new Precomp;if(!this.pre.naf)this.pre.naf=this._getNAF(9);if(!this.pre.doubles)this.pre.doubles=this._getDoubles(4,bits+1);if(!this.pre.beta)this.pre.beta=this._getBeta();if(!this.pre.blinding)this.pre.blinding=this._getBlinding(rng);return this}validate(){return this.curve.validate(this)}normalize(){return this}scale(a){throw new Error("Not implemented.")}randomize(rng){const z=this.curve.randomField(rng);return this.scale(z)}neg(){throw new Error("Not implemented.")}add(point){throw new Error("Not implemented.")}sub(point){assert(point instanceof Point);return this.add(point.neg())}dbl(){throw new Error("Not implemented.")}dblp(pow){assert(pow>>>0===pow);let r=this;for(let i=0;i0){q=n.clone();break}p=p.add(this)}return q}mul(k){return this.jmul(k)}muln(k){return this.jmuln(k)}mulBlind(k,rng){return this.jmulBlind(k,rng)}mulAdd(k1,p2,k2){return this.jmulAdd(k1,p2,k2)}mulH(){return this.jmulH()}div(k){return this.jdiv(k)}divn(k){return this.jdivn(k)}divH(){return this.jdivH()}jmul(k){if(this._hasDoubles(k))return this.curve._fixedNafMul(this,k);if(this.curve.endo&&this.type===types.AFFINE)return this.curve._endoWnafMulAdd([this],[k]);return this.curve._wnafMul(5,this,k)}jmuln(k){assert((k|0)===k);return this.jmul(new BN(k))}jmulBlind(k,rng=null){const[p,t,unblind]=this._blind(k,rng);const q=p.jmul(t);if(unblind)return q.add(unblind);return q}jmulAdd(k1,p2,k2){if(this.curve.endo&&this.type===types.AFFINE)return this.curve._endoWnafMulAdd([this,p2],[k1,k2]);return this.curve._wnafMulAdd(5,[this,p2],[k1,k2])}jmulH(){const word=this.curve.h.word(0);if((word&word-1)===0){const bits=this.curve.h.bitLength();return this.toJ().dblp(bits-1)}return this.jmul(this.curve.h)}jdiv(k){assert(k instanceof BN);assert(!k.red);return this.jmul(k.invert(this.curve.n))}jdivn(k){assert(!this.curve.n.isZero());if(this.curve.h.cmpn(k)===0)return this.jdivH();return this.jdiv(new BN(k))}jdivH(){if(this.curve.n.isZero())return this.toJ();if(this.curve.h.cmpn(1)===0)return this.toJ();if(this.curve.hi===null)this.curve.hi=this.curve.h.invert(this.curve.n);return this.jmul(this.curve.hi)}toP(){return this.normalize()}toJ(){return this}toX(){return this}key(){if(this.isInfinity())return`${this.curve.uid}:oo`;this.normalize();const x=this.getX().toString(16);const y=this.getY().toString(16);return`${this.curve.uid}:${x},${y}`}encode(compact){throw new Error("Not implemented.")}static decode(curve,bytes){throw new Error("Not implemented.")}encodeX(){throw new Error("Not implemented.")}static decodeX(curve,bytes){throw new Error("Not implemented.")}static decodeEven(curve,bytes){throw new Error("Not implemented.")}static decodeSquare(curve,bytes){throw new Error("Not implemented.")}toJSON(pre){throw new Error("Not implemented.")}static fromJSON(curve,json){throw new Error("Not implemented.")}[custom](){return""}}class ShortCurve extends Curve{constructor(conf){super(ShortPoint,"short",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.b=BN.fromJSON(conf.b).toRed(this.red);this.c=BN.fromJSON(conf.c||"0").toRed(this.red);this.ai=this.a.isZero()?this.zero:this.a.redInvert();this.zi=this.z.isZero()?this.zero:this.z.redInvert();this.zeroA=this.a.isZero();this.threeA=this.a.eq(this.three.redNeg());this.redN=this.n.toRed(this.red);this.pmodn=this.p.clone();this.highOrder=this.n.cmp(this.p)>=0;this.smallGap=false;this._finalize(conf)}_finalize(conf){super._finalize(conf);if(conf.endo!=null)this.endo=Endo.fromJSON(this,conf.endo);else this.endo=this._getEndomorphism();if(!this.n.isZero()){this.pmodn=this.p.mod(this.n);this.smallGap=this.p.div(this.n).cmpn(1)<=0}return this}static _isomorphism(curveA,curveB,custom,odd){assert(curveA instanceof BN);assert(curveB instanceof BN);assert(custom instanceof BN);assert(odd==null||typeof odd==="boolean");assert(!curveA.isZero()||!curveB.isZero());if(custom.isZero())throw new Error("Invalid coefficient.");if(curveA.isZero()){const customB=custom;const u6=customB.redDiv(curveB);const u2=uncube(u6);assert(u2.redJacobi()===1);return[curveA.clone(),customB.clone()]}if(curveB.isZero()){const customA=custom;const u4=customA.redDiv(curveA);const u2=u4.redSqrt();if(u2.redJacobi()!==1)u2.redINeg();if(u2.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");return[customA.clone(),curveB.clone()]}const customA=custom;const u4=customA.redDiv(curveA);const u2=u4.redSqrt();if(odd!=null){if(u2.redIsOdd()!==odd)u2.redINeg()}else{if(u2.redJacobi()!==1)u2.redINeg()}if(u2.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");const u6=u4.redMul(u2);const a=curveA.redMul(u4);const b=curveB.redMul(u6);assert(a.eq(customA));return[a,b]}_short(a0,odd){return ShortCurve._isomorphism(this.a,this.b,a0,odd)}_mont(b0,odd){const[r,s]=this._findRS(odd);const b=s.redInvert();const a=r.redMuln(3).redMul(b);if(b0!=null)return MontCurve._isomorphism(a,b,b0);return[a,b]}_edwards(a0,odd){const[r,s]=this._findRS(odd);const r3=r.redMuln(3);const s2=s.redMuln(2);const a=r3.redAdd(s2);const d=r3.redSub(s2);if(a0!=null)return EdwardsCurve._isomorphism(a,d,a0);return[a,d]}_findRS(sign){assert(sign==null||typeof sign==="boolean");assert(this.h.word(0)>=4);assert(!this.n.isZero());const x=this.one.redNeg();let p;for(;;){x.redIAdd(this.one);try{p=this.pointFromX(x.clone())}catch(e){continue}p=p.mul(this.n);if(p.isInfinity())continue;if(!p.y.isZero())continue;break}const r=p.x;const r2=r.redSqr();const s=r2.redMuln(3).redIAdd(this.a).redSqrt();if(sign!=null){if(s.redIsOdd()!==sign)s.redINeg()}return[r,s]}_scale0(a,b){assert(this.a.isZero()===a.isZero());assert(this.b.isZero()===b.isZero());if(this.a.isZero()){const u6=this.b.redDiv(this.field(b));const u2=uncube(u6);const u=u2.redSqrt();const u3=u2.redMul(u);assert(u3.redSqr().eq(u6));assert(!u.isZero());return[u2,u3]}if(this.b.isZero()){const u4=this.a.redDiv(this.field(a));const u2=u4.redSqrt();if(u2.redJacobi()!==1)u2.redINeg();const u=u2.redSqrt();const u3=u2.redMul(u);assert(u3.redMul(u).eq(u4));assert(!u.isZero());return[u2,u3]}const u4=this.a.redDiv(this.field(a));const u6=this.b.redDiv(this.field(b));const u2=u4.redSqrt();if(!u4.redMul(u2).eq(u6))u2.redINeg();assert(u4.redMul(u2).eq(u6));const u=u2.redSqrt();const u3=u2.redMul(u);assert(!u.isZero());return[u2,u3]}_scale1(x,y){const u2=this.g.x.redDiv(this.field(x));const u3=this.g.y.redDiv(this.field(y));const u=u2.redSqrt();if(!u2.redMul(u).eq(u3))u.redINeg();assert(u2.redMul(u).eq(u3));assert(!u.isZero());return[u2,u3]}_scaleShort(curve){assert(curve instanceof ShortCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this._scale0(curve.a,curve.b);return this._scale1(curve.g.x,curve.g.y)}_scaleMont(curve){assert(curve instanceof MontCurve);if(this.g.isInfinity()||curve.g.isInfinity()){const[a,b]=curve._short();return this._scale0(a,b)}const{x,y}=curve.g;const nx=x.redAdd(curve.a3).redMul(curve.bi);const ny=y.redMul(curve.bi);return this._scale1(nx,ny)}_scaleEdwards(curve){assert(curve instanceof EdwardsCurve);if(this.g.isInfinity()||curve.g.isInfinity()){const[a,b]=curve._short();return this._scale0(a,b)}const{x,y,z}=curve.g;const a5=curve.a.redMuln(5);const d5=curve.d.redMuln(5);const dma=curve.d.redSub(curve.a);const d5a=d5.redSub(curve.a);const da5=curve.d.redSub(a5);const ypz=y.redAdd(z);const ymz=y.redSub(z);const xx=d5a.redMul(y).redIAdd(da5.redMul(z));const xz=ymz.redMuln(12);const yy=dma.redMul(ypz).redMul(z);const yz=ymz.redMul(x).redIMuln(4);const zi=xz.redMul(yz).redInvert();const nx=xx.redMul(yz).redMul(zi);const ny=yy.redMul(xz).redMul(zi);return this._scale1(nx,ny)}_getEndomorphism(index=0){if(this.n.isZero()||this.g.isInfinity())return null;if(!this.zeroA||this.p.modrn(3)!==1||this.n.modrn(3)!==1)return null;const[b1,b2]=this._getEndoRoots(this.p);const beta=[b1,b2][index&1].toRed(this.red);const[l1,l2]=this._getEndoRoots(this.n);const p=this.point(this.g.x.redMul(beta),this.g.y);let lambda;if(this.g.mul(l1).eq(p)){lambda=l1}else{assert(this.g.mul(l2).eq(p));lambda=l2}const basis=this._getEndoBasis(lambda);const pre=this._getEndoPrecomp(basis);return new Endo(beta,lambda,basis,pre)}_getEndoRoots(num){const red=num===this.p?this.red:BN.mont(num);const two=new BN(2).toRed(red);const three=new BN(3).toRed(red);const i2=two.redInvert();const s1=three.redNeg().redSqrt().redMul(i2);const s2=s1.redNeg();const r1=s1.redSub(i2).fromRed();const r2=s2.redSub(i2).fromRed();return[r1,r2].sort(BN.cmp)}_getEndoBasis(lambda){const[rl,tl,rl1,tl1,rl2,tl2]=this._egcdSqrt(lambda);const a1=rl1;const b1=tl1.neg();const lhs=rl.sqr().iadd(tl.sqr());const rhs=rl2.sqr().iadd(tl2.sqr());let a2,b2;if(lhs.cmp(rhs)<=0){a2=rl;b2=tl.neg()}else{a2=rl2;b2=tl2.neg()}return[new Vector(a1,b1),new Vector(a2,b2)]}_egcdSqrt(lambda){assert(lambda instanceof BN);assert(!lambda.red);assert(lambda.sign()>0);assert(this.n.sign()>0);const sqrtn=this.n.ushrn(this.n.bitLength()>>>1);let u=lambda;let v=this.n.clone();let x1=new BN(1);let y1=new BN(0);let x2=new BN(0);let y2=new BN(1);let rl,tl;let rl1,tl1;let i=0;let j=0;let p;while(!u.isZero()&&i<2){const q=v.quo(u);const r=v.sub(q.mul(u));const x=x2.sub(q.mul(x1));const y=y2.sub(q.mul(y1));if(j===0&&r.cmp(sqrtn)<0){rl=p;tl=x1;rl1=r;tl1=x;j=1}p=r;v=u;u=r;x2=x1;x1=x;y2=y1;y1=y;i+=j}assert(j!==0,"Could not find r < sqrt(n).");const rl2=x2;const tl2=x1;return[rl,tl,rl1,tl1,rl2,tl2]}_getEndoPrecomp(basis){assert(Array.isArray(basis));assert(basis.length===2);assert(basis[0]instanceof Vector);assert(basis[1]instanceof Vector);const[v1,v2]=basis;const d=v1.a.mul(v2.b).isub(v1.b.mul(v2.a));const bits=d.bitLength();const align=bits>=160;assert(d.eq(this.n));let shift=bits+Math.ceil(bits/2)+1;let g1,g2;if(align)shift-=shift&63;while(shift>bits){g1=v2.b.ushln(shift).divRound(d);g2=v1.b.ushln(shift).divRound(d);if(g1.ucmp(d)<0&&g2.ucmp(d)<0)break;if(align)shift-=64;else shift-=1}if(shift<=bits)throw new Error("Could not calculate g1 and g2.");return[shift,g1,g2]}_endoSplit(k){assert(k instanceof BN);assert(!k.red);assert(!this.n.isZero());const[v1,v2]=this.endo.basis;const c1=v2.b.mul(k).divRound(this.n);const c2=v1.b.neg().mul(k).divRound(this.n);const p1=c1.mul(v1.a);const p2=c2.mul(v2.a);const q1=c1.ineg().mul(v1.b);const q2=c2.mul(v2.b);const k1=k.sub(p1).isub(p2);const k2=q1.isub(q2);return[k1,k2]}_endoBeta(point){assert(point instanceof ShortPoint);return[point,point._getBeta()]}_endoWnafMulAdd(points,coeffs){assert(Array.isArray(points));assert(Array.isArray(coeffs));assert(points.length===coeffs.length);assert(this.endo!=null);const len=points.length;const npoints=new Array(len*2);const ncoeffs=new Array(len*2);for(let i=0;i>>1];const u=n.redDivSqrt(d);if(u.redIsOdd()!==y.redIsOdd())u.redINeg();return u}_svdwf(u){const{c,z,zi,i2,i3}=this;const gz=this.solveY2(z);const z3=i3.redMul(zi.redSqr());const u2=u.redSqr();const u4=u2.redSqr();const t1=u2.redAdd(gz);const u2t1=u2.redMul(t1);const t2=u2t1.isZero()?u2t1:u2t1.redInvert();const t3=u4.redMul(t2).redMul(c);const t4=t1.redSqr().redMul(t1);const x1=c.redSub(z).redMul(i2).redISub(t3);const x2=t3.redSub(c.redAdd(z).redMul(i2));const x3=z.redSub(t4.redMul(t2).redMul(z3));const y1=this.solveY2(x1);const y2=this.solveY2(x2);const y3=this.solveY2(x3);const alpha=y1.redJacobi()|1;const beta=y2.redJacobi()|1;const i=mod((alpha-1)*beta,3);const x=[x1,x2,x3][i];const y=[y1,y2,y3][i];return[x,y]}_svdw(u){const[x,yy]=this._svdwf(u);const y=yy.redSqrt();if(y.redIsOdd()!==u.redIsOdd())y.redINeg();return this.point(x,y)}_svdwi(p,hint){const{b,c,z,zero,two}=this;const{x,y}=p;const r=hint&3;const z2=z.redSqr();const z3=z2.redMul(z);const z4=z2.redSqr();const gz=z3.redAdd(b);const gz2=gz.redMuln(2);const xx=x.redSqr();const x2z=x.redMuln(2).redIAdd(z);const xz2=x.redMul(z2);const c0=c.redSub(x2z);const c1=c.redAdd(x2z);const t0=xx.redMul(z2).redIAdd(z4).redIMuln(9);const t1=x.redMul(z3).redIMuln(18);const t2=gz.redMul(x.redSub(z)).redIMuln(12);const t3=r>=2?t0.redISub(t1).redIAdd(t2).redSqrt():zero;const t4=t3.redMul(z);const t5=z3.redISub(xz2).redIMuln(3).redISub(gz2);const n0=gz.redMul(c0);const n1=gz.redMul(c1);const n2=t5.redAdd(t4);const n3=t5.redSub(t4);const d2=two;const n=[n0,n1,n2,n3][r];const d=[c1,c0,d2,d2][r];const u=n.redDivSqrt(d);const[x0]=this._svdwf(u);if(!x0.eq(x))throw new Error("Invalid point.");if(u.redIsOdd()!==y.redIsOdd())u.redINeg();return u}isElliptic(){const{a,b}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const d=b2.redMuln(27).redIAdd(a3.redMuln(4));return!d.isZero()}jinv(){const{a,b}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const t0=a3.redMuln(4);const lhs=t0.redMuln(1728);const rhs=b2.redMuln(27).redIAdd(t0);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}point(x,y){return new ShortPoint(this,x,y)}jpoint(x,y,z){return new JPoint(this,x,y,z)}solveX(y){assert(y instanceof BN);if(!this.a.isZero())throw new Error("Not implemented.");const y2=y.redSqr();const x3=y2.redSub(this.b);return cubeRoots(x3)}solveY2(x){assert(x instanceof BN);const x3=x.redSqr().redMul(x);const y2=x3.redIAdd(this.b);if(!this.zeroA){if(this.threeA)y2.redIAdd(x.redMuln(-3));else y2.redIAdd(this.a.redMul(x))}return y2}validate(point){assert(point instanceof ShortPoint);if(point.inf)return true;const{x,y}=point;const y2=this.solveY2(x);return y.redSqr().eq(y2)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(this.h.cmpn(1)>0){if(y.isZero()&&sign)throw new Error("Invalid point.")}if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}pointFromY(y,index=0){assert(y instanceof BN);assert(index>>>0===index);if(!y.red)y=y.toRed(this.red);const coords=this.solveX(y);if(index>=coords.length)throw new Error("Invalid X coordinate index.");const x=coords[index];return this.point(x,y)}isIsomorphic(curve){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;let u2,u3;try{[u2,u3]=this._scale(curve)}catch(e){return false}if(curve.type==="short"){const a=this.field(curve.a).redMul(u2.redSqr());const b=this.field(curve.b).redMul(u3.redSqr());return this.a.eq(a)&&this.b.eq(b)}if(curve.type==="mont"){const{a3,bi}=curve;const x=this.field(a3.redMul(bi)).redMul(u2);const y2=this.solveY2(x);return y2.isZero()}if(curve.type==="edwards"){const x=this.field(curve.ad6).redMul(u2);const y2=this.solveY2(x);return y2.isZero()}return false}isIsogenous(curve){assert(curve instanceof Curve);return false}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const[u2,u3]=this._scale(point.curve);const x=this.field(point.x);const y=this.field(point.y);const nx=x.redMul(u2);const ny=y.redMul(u3);return this.point(nx,ny)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const{a3,bi}=point.curve;const[u2,u3]=this._scale(point.curve);const nx=point.x.redAdd(a3).redMul(bi);const ny=point.y.redMul(bi);return this.point(this.field(nx).redMul(u2),this.field(ny).redMul(u3))}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);if(this.isIsomorphic(point.curve)){const{a,d,ad6}=point.curve;const[u2,u3]=this._scale(point.curve);if(point.isInfinity())return this.point();if(point.x.isZero()){const x=this.field(ad6).redMul(u2);return this.point(x,this.zero)}const{x,y,z}=point;const a5=a.redMuln(5);const d5=d.redMuln(5);const dma=d.redSub(a);const d5a=d5.redSub(a);const da5=d.redSub(a5);const ypz=y.redAdd(z);const ymz=y.redSub(z);const xx=d5a.redMul(y).redIAdd(da5.redMul(z));const xz=ymz.redMuln(12);const yy=dma.redMul(ypz).redMul(z);const yz=ymz.redMul(x).redIMuln(4);return this.cpoint(this.field(xx).redMul(u2),this.field(xz),this.field(yy).redMul(u3),this.field(yz))}throw new Error("Not implemented.")}pointFromUniform(u){assert(u instanceof BN);if(this.z.isZero()||this.b.isZero())throw new Error("Not implemented.");if(!this.a.isZero())return this._sswu(u);if(!this.c.isZero())return this._svdw(u);throw new Error("Not implemented.")}pointToUniform(p,hint){assert(p instanceof ShortPoint);assert(hint>>>0===hint);if(this.z.isZero()||this.b.isZero())throw new Error("Not implemented.");if(p.isInfinity())throw new Error("Invalid point.");const i=(hint>>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);return wrapErrors(()=>{if(!this.a.isZero())return this._sswui(q,hint);if(!this.c.isZero())return this._svdwi(q,hint);throw new Error("Not implemented.")})}mulAll(points,coeffs){return super.mulAll(points,coeffs).toP()}affinizeAll(points){const out=this.normalizeAll(points);for(let i=0;i{const xb=point.x.redMul(this.curve.endo.beta);return this.curve.point(xb,point.y)});this.pre.beta=beta}return beta}_getJNAF(point){assert(point instanceof ShortPoint);if(this.inf||point.inf)return super._getJNAF(point);const comb=[this,null,null,point];if(this.y.eq(point.y)){comb[1]=this.add(point);comb[2]=this.toJ().sub(point)}else if(this.y.eq(point.y.redNeg())){comb[1]=this.toJ().add(point);comb[2]=this.sub(point)}else{comb[1]=this.toJ().add(point);comb[2]=this.toJ().sub(point)}return comb}clone(){if(this.inf)return this.curve.point();return this.curve.point(this.x,this.y)}scale(a){return this.toJ().scale(a)}neg(){if(this.inf)return this;return this.curve.point(this.x,this.y.redNeg())}add(p){assert(p instanceof ShortPoint);if(this.inf)return p;if(p.inf)return this;if(this.x.eq(p.x)){if(!this.y.eq(p.y))return this.curve.point();return this.dbl()}if(this.y.eq(p.y)){const nx=this.x.redNeg().redISub(p.x);const ny=this.y.redNeg();return this.curve.point(nx,ny)}const h=this.x.redSub(p.x);const r=this.y.redSub(p.y);const l=r.redDiv(h);const nx=l.redSqr().redISub(this.x).redISub(p.x);const ny=l.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)}dbl(){if(this.inf)return this;if(this.y.isZero())return this.curve.point();const xx=this.x.redSqr();const m=xx.redIMuln(3).redIAdd(this.curve.a);const z=this.y.redMuln(2);const l=m.redDiv(z);const nx=l.redSqr().redISub(this.x).redISub(this.x);const ny=l.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)}dblp(pow){return this.toJ().dblp(pow).toP()}getX(){if(this.inf)throw new Error("Invalid point.");return this.x.fromRed()}getY(){if(this.inf)throw new Error("Invalid point.");return this.y.fromRed()}eq(p){assert(p instanceof ShortPoint);if(this===p)return true;if(this.inf)return p.inf;if(p.inf)return false;return this.x.eq(p.x)&&this.y.eq(p.y)}cmp(point){assert(point instanceof ShortPoint);if(this.inf&&!point.inf)return-1;if(!this.inf&&point.inf)return 1;if(this.inf&&point.inf)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())||this.getY().cmp(point.getY())}isInfinity(){return this.inf}isOrder2(){if(this.inf)return false;return this.y.isZero()}isOdd(){if(this.inf)return false;return this.y.redIsOdd()}isEven(){if(this.inf)return false;return this.y.redIsEven()}isSquare(){if(this.inf)return false;return this.y.redJacobi()!==-1}eqX(x){assert(x instanceof BN);assert(!x.red);if(this.inf)return false;return this.getX().eq(x)}eqR(x){assert(x instanceof BN);assert(!x.red);assert(!this.curve.n.isZero());if(this.inf)return false;return this.getX().imod(this.curve.n).eq(x)}mul(k){return super.mul(k).toP()}muln(k){return super.muln(k).toP()}mulBlind(k,rng){return super.mulBlind(k,rng).toP()}mulAdd(k1,p2,k2){return super.mulAdd(k1,p2,k2).toP()}mulH(){return super.mulH().toP()}div(k){return super.div(k).toP()}divn(k){return super.divn(k).toP()}divH(){return super.divH().toP()}toP(){return this}toJ(){if(this.inf)return this.curve.jpoint();return this.curve.jpoint(this.x,this.y,this.curve.one)}encode(compact){if(compact==null)compact=true;assert(typeof compact==="boolean");const{fieldSize}=this.curve;if(this.inf)throw new Error("Invalid point.");if(compact){const p=bufferExports.Buffer.alloc(1+fieldSize);const x=this.curve.encodeField(this.getX());p[0]=2|this.y.redIsOdd();x.copy(p,1);return p}const p=bufferExports.Buffer.alloc(1+fieldSize*2);const x=this.curve.encodeField(this.getX());const y=this.curve.encodeField(this.getY());p[0]=4;x.copy(p,1);y.copy(p,1+fieldSize);return p}static decode(curve,bytes){assert(curve instanceof ShortCurve);assert(bufferExports.Buffer.isBuffer(bytes));const len=curve.fieldSize;if(bytes.length<1+len)throw new Error("Not a point.");const form=bytes[0];switch(form){case 2:case 3:{if(bytes.length!==1+len)throw new Error("Invalid point size for compressed.");const x=curve.decodeField(bytes.slice(1,1+len));if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");const p=curve.pointFromX(x,form===3);assert(!p.isInfinity());return p}case 4:case 6:case 7:{if(bytes.length!==1+len*2)throw new Error("Invalid point size for uncompressed.");const x=curve.decodeField(bytes.slice(1,1+len));const y=curve.decodeField(bytes.slice(1+len,1+2*len));if(x.cmp(curve.p)>=0||y.cmp(curve.p)>=0)throw new Error("Invalid point.");if(form!==4&&form!==(6|y.isOdd()))throw new Error("Invalid hybrid encoding.");const p=curve.point(x,y);if(!p.validate())throw new Error("Invalid point.");assert(!p.isInfinity());return p}default:{throw new Error("Unknown point format.")}}}encodeX(){return this.curve.encodeField(this.getX())}static decodeEven(curve,bytes){assert(curve instanceof ShortCurve);const x=curve.decodeField(bytes);if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");return curve.pointFromX(x,false)}static decodeSquare(curve,bytes){assert(curve instanceof ShortCurve);const x=curve.decodeField(bytes);if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");return curve.pointFromX(x)}toJSON(pre){if(this.inf)return[];const x=this.getX().toJSON();const y=this.getY().toJSON();if(pre===true&&this.pre)return[x,y,this.pre.toJSON()];return[x,y]}toPretty(){if(this.inf)return[];const size=this.curve.fieldSize*2;const x=toPretty(this.getX(),size);const y=toPretty(this.getY(),size);return[x,y]}static fromJSON(curve,json){assert(curve instanceof ShortCurve);assert(Array.isArray(json));assert(json.length===0||json.length===2||json.length===3);if(json.length===0)return curve.point();const x=BN.fromJSON(json[0]);const y=BN.fromJSON(json[1]);const point=curve.point(x,y);if(json.length>2&&json[2]!=null)point.pre=Precomp.fromJSON(point,json[2]);return point}[custom](){if(this.inf)return"";return""}}class JPoint extends Point{constructor(curve,x,y,z){assert(curve instanceof ShortCurve);super(curve,types.JACOBIAN);this.x=this.curve.one;this.y=this.curve.one;this.z=this.curve.zero;this.zOne=false;if(x!=null)this._init(x,y,z)}_init(x,y,z){assert(x instanceof BN);assert(y instanceof BN);assert(z==null||z instanceof BN);this.x=x;this.y=y;this.z=z||this.curve.one;if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z.eq(this.curve.one)}clone(){return this.curve.jpoint(this.x,this.y,this.z)}validate(){const{a,b}=this.curve;if(this.isInfinity())return true;if(this.zOne)return this.curve.validate(this.toP());const lhs=this.y.redSqr();const x3=this.x.redSqr().redMul(this.x);const z2=this.z.redSqr();const z4=z2.redSqr();const z6=z4.redMul(z2);const rhs=x3.redIAdd(b.redMul(z6));if(!this.curve.zeroA){if(this.curve.threeA)rhs.redIAdd(z4.redIMuln(-3).redMul(this.x));else rhs.redIAdd(a.redMul(z4).redMul(this.x))}return lhs.eq(rhs)}normalize(){if(this.zOne)return this;if(this.isInfinity())return this;const a=this.z.redInvert();const aa=a.redSqr();this.x=this.x.redMul(aa);this.y=this.y.redMul(aa).redMul(a);this.z=this.curve.one;this.zOne=true;return this}scale(a){assert(a instanceof BN);if(this.isInfinity())return this.curve.jpoint();const aa=a.redSqr();const nx=this.x.redMul(aa);const ny=this.y.redMul(aa).redMul(a);const nz=this.z.redMul(a);return this.curve.jpoint(nx,ny,nz)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(p){assert(p instanceof Point);if(p.type===types.AFFINE)return this._mixedAdd(p);return this._add(p)}_add(p){assert(p instanceof JPoint);if(this.isInfinity())return p;if(p.isInfinity())return this;if(this.zOne)return p._addJA(this);if(p.zOne)return this._addJA(p);return this._addJJ(p)}_mixedAdd(p){assert(p instanceof ShortPoint);if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;return this._addJA(p)}_addJJ(p){const z1z1=this.z.redSqr();const z2z2=p.z.redSqr();const u1=this.x.redMul(z2z2);const u2=p.x.redMul(z1z1);const s1=this.y.redMul(p.z).redMul(z2z2);const s2=p.y.redMul(this.z).redMul(z1z1);const h=u2.redISub(u1);const r=s2.redISub(s1);if(h.isZero()){if(!r.isZero())return this.curve.jpoint();return this.dbl()}const hh=h.redSqr();const hhh=h.redMul(hh);const v=u1.redMul(hh);const nx=r.redSqr().redISub(hhh).redISub(v).redISub(v);const ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh));const nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)}_addJA(p){const z1z1=this.z.redSqr();const u2=p.x.redMul(z1z1);const s2=p.y.redMul(this.z).redMul(z1z1);const h=u2.redISub(this.x);const r=s2.redISub(this.y).redIMuln(2);if(h.isZero()){if(!r.isZero())return this.curve.jpoint();return this.dbl()}const i=h.redMuln(2).redSqr();const j=h.redMul(i);const v=this.x.redMul(i);const nx=r.redSqr().redISub(j).redISub(v).redISub(v);const ny=r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2));const nz=this.z.redMul(h).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}dbl(){if(this.isInfinity())return this;if(this.y.isZero())return this.curve.jpoint();if(this.curve.zeroA)return this._dbl0();if(this.curve.threeA)return this._dbl3();return this._dblJ()}_dblJ(){const xx=this.x.redSqr();const yy=this.y.redSqr();const zz=this.z.redSqr();const s=this.x.redMul(yy).redIMuln(4);const m=xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr()));const t=m.redSqr().redISub(s).redISub(s);const nx=t;const ny=m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8));const nz=this.y.redMul(this.z).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}_dbl0(){const a=this.x.redSqr();const b=this.y.redSqr();const c=b.redSqr();const xb2=b.redIAdd(this.x).redSqr();const d=xb2.redISub(a).redISub(c).redIMuln(2);const e=a.redIMuln(3);const f=e.redSqr();const nx=f.redISub(d).redISub(d);const ny=e.redMul(d.redISub(nx)).redISub(c.redIMuln(8));const nz=this.y.redMul(this.z).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}_dbl3(){const delta=this.z.redSqr();const gamma=this.y.redSqr();const beta=this.x.redMul(gamma);const xmdelta=this.x.redSub(delta);const xpdelta=this.x.redAdd(delta);const alpha=xmdelta.redMul(xpdelta).redIMuln(3);const beta4=beta.redIMuln(4);const beta8=beta4.redMuln(2);const gamma28=gamma.redSqr().redIMuln(8);const nx=alpha.redSqr().redISub(beta8);const nz=this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);const ny=alpha.redMul(beta4.redISub(nx)).redISub(gamma28);return this.curve.jpoint(nx,ny,nz)}getX(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.x.fromRed()}getY(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.y.fromRed()}eq(p){assert(p instanceof JPoint);if(this===p)return true;if(this.isInfinity())return p.isInfinity();if(p.isInfinity())return false;if(this.z.eq(p.z)){return this.x.eq(p.x)&&this.y.eq(p.y)}const zz1=this.z.redSqr();const zz2=p.z.redSqr();const x1=this.x.redMul(zz2);const x2=p.x.redMul(zz1);if(!x1.eq(x2))return false;const zzz1=zz1.redMul(this.z);const zzz2=zz2.redMul(p.z);const y1=this.y.redMul(zzz2);const y2=p.y.redMul(zzz1);return y1.eq(y2)}cmp(point){assert(point instanceof JPoint);const inf1=this.isInfinity();const inf2=point.isInfinity();if(inf1&&!inf2)return-1;if(!inf1&&inf2)return 1;if(inf1&&inf2)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())||this.getY().cmp(point.getY())}isInfinity(){return this.z.isZero()}isOrder2(){if(this.isInfinity())return false;return this.y.isZero()}isOdd(){if(this.isInfinity())return false;this.normalize();return this.y.redIsOdd()}isEven(){if(this.isInfinity())return false;this.normalize();return this.y.redIsEven()}isSquare(){if(this.isInfinity())return false;return this.y.redMul(this.z).redJacobi()!==-1}eqX(x){assert(x instanceof BN);assert(!x.red);if(this.isInfinity())return false;const zz=this.z.redSqr();const rx=x.toRed(this.curve.red).redMul(zz);return this.x.eq(rx)}eqR(x){assert(x instanceof BN);assert(!x.red);if(!this.curve.smallGap)return this.toP().eqR(x);if(this.isInfinity())return false;if(x.cmp(this.curve.p)>=0)return false;const zz=this.z.redSqr();const rx=x.toRed(this.curve.red).redMul(zz);if(this.x.eq(rx))return true;if(this.curve.highOrder)return false;if(x.cmp(this.curve.pmodn)>=0)return false;const rn=this.curve.redN.redMul(zz);rx.redIAdd(rn);return this.x.eq(rx)}toP(){if(this.isInfinity())return this.curve.point();this.normalize();return this.curve.point(this.x,this.y)}toJ(){return this}encode(compact){return this.toP().encode(compact)}static decode(curve,bytes){return ShortPoint.decode(curve,bytes).toJ()}encodeX(){return this.toP().encodeX()}static decodeEven(curve,bytes){return ShortPoint.decodeEven(curve,bytes).toJ()}static decodeSquare(curve,bytes){return ShortPoint.decodeSquare(curve,bytes).toJ()}toJSON(pre){return this.toP().toJSON(pre)}toPretty(){return this.toP().toPretty()}static fromJSON(curve,json){return ShortPoint.fromJSON(curve,json).toJ()}[custom](){if(this.isInfinity())return"";return""}}class MontCurve extends Curve{constructor(conf){super(MontPoint,"mont",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.b=BN.fromJSON(conf.b).toRed(this.red);this.bi=this.b.redInvert();this.a2=this.a.redAdd(this.two);this.a24=this.a2.redMul(this.i4);this.a3=this.a.redMul(this.i3);this.a0=this.a.redMul(this.bi);this.b0=this.bi.redSqr();this._finalize(conf)}static _isomorphism(curveA,curveB,customB){assert(curveA instanceof BN);assert(curveB instanceof BN);assert(customB instanceof BN);const a=curveA.clone();const b=customB.clone();const c=curveB.redDiv(customB);if(c.redJacobi()!==1)throw new Error("Invalid `b` coefficient.");return[a,b]}_short(a0,odd){const{a,b,three}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const b3=b2.redMul(b);const n0=three.redSub(a2);const d0=b2.redMuln(3);const n1=a3.redMuln(2).redISub(a.redMuln(9));const d1=b3.redMuln(27);const wa=n0.redDiv(d0);const wb=n1.redDiv(d1);if(a0!=null)return ShortCurve._isomorphism(wa,wb,a0,odd);return[wa,wb]}_mont(b0){return MontCurve._isomorphism(this.a,this.b,b0)}_edwards(a0,invert=false){assert(typeof invert==="boolean");const{two,bi}=this;const a=this.a.redAdd(two).redMul(bi);const d=this.a.redSub(two).redMul(bi);if(invert)a.swap(d);if(a0!=null)return EdwardsCurve._isomorphism(a,d,a0);return[a,d]}_scaleShort(curve){assert(curve instanceof ShortCurve);const[u2,u3]=curve._scale(this);return[this.field(u2.redInvert()),this.field(u3.redInvert())]}_scaleMont(curve){assert(curve instanceof MontCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this.field(curve.b).redDivSqrt(this.b);return this.g.y.redDiv(this.field(curve.g.y))}_scaleEdwards(curve,invert){assert(curve instanceof EdwardsCurve);const c=curve._scale(this,invert);return this.field(c)}_solveY0(x){assert(x instanceof BN);const a=this.a0;const b=this.b0;const x2=x.redSqr();const x3=x2.redMul(x);const y2=x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x));return y2}_elligator2(u){const lhs=this.a0.redNeg();const rhs=this.one.redAdd(this.z.redMul(u.redSqr()));if(rhs.isZero())rhs.inject(this.one);const x1=lhs.redMul(rhs.redInvert());const x2=x1.redNeg().redISub(this.a0);const y1=this._solveY0(x1);const y2=this._solveY0(x2);const alpha=y1.redIsSquare()|0;const x0=[x1,x2][alpha^1];const y0=[y1,y2][alpha^1].redSqrt();if(y0.redIsOdd()!==u.redIsOdd())y0.redINeg();const x=this.b.redMul(x0);const y=this.b.redMul(y0);return this.point(x,y)}_invert2(p,hint){const{x,y}=p;const r=hint&1;const x0=x.redMul(this.bi);const y0=y.redMul(this.bi);const n=x0.redAdd(this.a0);const d=x0;const lhs=[n,d][r].redINeg();const rhs=[d,n][r].redMul(this.z);const u=lhs.redDivSqrt(rhs);if(u.redIsOdd()!==y0.redIsOdd())u.redINeg();return u}isElliptic(){const a2=this.a.redSqr();const d=this.b.redMul(a2.redSub(this.four));return!d.isZero()}jinv(){const{a,three,four}=this;const a2=a.redSqr();const t0=a2.redSub(three);const lhs=t0.redPown(3).redIMuln(256);const rhs=a2.redSub(four);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}point(x,y){return new MontPoint(this,x,y)}jpoint(x,y,z){assert(x==null&&y==null&&z==null);return this.point()}xpoint(x,z){return new XPoint(this,x,z)}solveY2(x){assert(x instanceof BN);const x2=x.redSqr();const x3=x2.redMul(x);const by2=x3.redIAdd(this.a.redMul(x2)).redIAdd(x);const y2=by2.redMul(this.bi);return y2}validate(point){assert(point instanceof MontPoint);if(point.isInfinity())return true;const{x,y}=point;const y2=this.solveY2(x);return y.redSqr().eq(y2)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(y.isZero()&&sign)throw new Error("Invalid point.");if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}isIsomorphic(curve,invert){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;if(curve.type==="mont"){const a=this.field(curve.a);const b=this.field(curve.b);if(!this.a.eq(a))return false;if(this.b.isZero())return false;const c=b.redDiv(this.b);return c.redJacobi()===1}return curve.isIsomorphic(this,invert)}isIsogenous(curve){assert(curve instanceof Curve);if(curve.type==="mont")return false;return curve.isIsogenous(this)}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const{a3,b}=this;const[u2,u3]=this._scale(point.curve);const x=this.field(point.x).redMul(u2);const y=this.field(point.y).redMul(u3);const u=b.redMul(x).redISub(a3);const v=b.redMul(y);return this.point(u,v)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const c=this._scale(point.curve);const u=this.field(point.x);const v=this.field(point.y);const nu=u;const nv=c.redMul(v);return this.point(nu,nv)}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);assert(point.curve.p.eq(this.p));const x=this.field(point.x);const y=this.field(point.y);const z=this.field(point.z);if(this.isIsogenous(point.curve)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=z.redSqr().redIMuln(2);const uu=y.redSqr();const uz=x.redSqr();const vv=c.redISub(uz).redISub(uu).redMul(y);const vz=uz.redMul(x);return this.cpoint(uu,uz,vv,vz)}if(this.isIsomorphic(point.curve,true)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=this._scale(point.curve,true);const uu=y.redAdd(z);const uz=y.redSub(z);const vv=c.redMul(z).redMul(uu);const vz=x.redMul(uz);return this.cpoint(uu,uz,vv,vz)}if(this.isIsomorphic(point.curve,false)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=this._scale(point.curve,false);const uu=z.redAdd(y);const uz=z.redSub(y);const vv=c.redMul(z).redMul(uu);const vz=x.redMul(uz);return this.cpoint(uu,uz,vv,vz)}throw new Error("Not implemented.")}pointFromUniform(u){assert(u instanceof BN);if(this.z.isZero()||this.a.isZero())throw new Error("Not implemented.");return this._elligator2(u)}pointToUniform(p,hint){assert(p instanceof MontPoint);assert(hint>>>0===hint);if(this.z.isZero()||this.a.isZero())throw new Error("Not implemented.");if(p.isInfinity())throw new Error("Invalid point.");const i=(hint>>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);return wrapErrors(()=>{return this._invert2(q,hint)})}decodePoint(bytes,sign){return MontPoint.decode(this,bytes,sign)}encodeX(point){assert(point instanceof XPoint);return point.encode()}decodeX(bytes){return XPoint.decode(this,bytes)}toShort(a0,odd,sign=null){const[a,b]=this._short(a0,odd);const curve=new ShortCurve({red:this.red,prime:this.prime,p:this.p,a:a,b:b,n:this.n,h:this.h});if(sign!=null){const[,u3]=curve._scale(this);if(u3.redIsOdd()!==sign)u3.redINeg()}if(!this.g.isInfinity())curve.g=curve.pointFromMont(this.g);for(let i=0;i";return""}}class XPoint extends Point{constructor(curve,x,z){assert(curve instanceof MontCurve);super(curve,types.PROJECTIVE);this.x=this.curve.one;this.z=this.curve.zero;if(x!=null)this._init(x,z)}_init(x,z){assert(x instanceof BN);assert(z==null||z instanceof BN);this.x=x;this.z=z||this.curve.one;if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}clone(){return this.curve.xpoint(this.x,this.z)}precompute(power,rng){return this}validate(){if(this.isInfinity())return true;const{x,z}=this;const x2=x.redSqr();const x3=x2.redMul(x);const z2=z.redSqr();const ax2=this.curve.a.redMul(x2).redMul(z);const by2=x3.redIAdd(ax2).redIAdd(x.redMul(z2));const y2=by2.redMul(this.curve.bi);return y2.redMul(z).redJacobi()!==-1}normalize(){if(this.isInfinity())return this;if(this.z.eq(this.curve.one))return this;this.x=this.x.redDiv(this.z);this.z=this.curve.one;return this}scale(a){assert(a instanceof BN);if(this.isInfinity())return this.curve.xpoint();const nx=this.x.redMul(a);const nz=this.z.redMul(a);return this.curve.xpoint(nx,nz)}neg(){return this}dbl(){const a=this.x.redAdd(this.z);const aa=a.redSqr();const b=this.x.redSub(this.z);const bb=b.redSqr();const c=aa.redSub(bb);const nx=aa.redMul(bb);const nz=c.redMul(bb.redIAdd(this.curve.a24.redMul(c)));return this.curve.xpoint(nx,nz)}diffAddDbl(p2,p3){assert(p2 instanceof XPoint);assert(p3 instanceof XPoint);const a=p2.x.redAdd(p2.z);const aa=a.redSqr();const b=p2.x.redSub(p2.z);const bb=b.redSqr();const e=aa.redSub(bb);const c=p3.x.redAdd(p3.z);const d=p3.x.redSub(p3.z);const da=d.redMul(a);const cb=c.redMul(b);const x5=this.z.redMul(da.redAdd(cb).redSqr());const z5=this.x.redMul(da.redISub(cb).redSqr());const x4=aa.redMul(bb);const z4=e.redMul(bb.redIAdd(this.curve.a24.redMul(e)));return[this.curve.xpoint(x4,z4),this.curve.xpoint(x5,z5)]}getX(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.x.fromRed()}getY(sign){return this.toP(sign).getY()}eq(p){assert(p instanceof XPoint);if(this===p)return true;if(this.isInfinity())return p.isInfinity();if(p.isInfinity())return false;if(this.z.eq(p.z))return this.x.eq(p.x);const x1=this.x.redMul(p.z);const x2=p.x.redMul(this.z);return x1.eq(x2)}cmp(point){assert(point instanceof XPoint);const inf1=this.isInfinity();const inf2=point.isInfinity();if(inf1&&!inf2)return-1;if(!inf1&&inf2)return 1;if(inf1&&inf2)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())}isInfinity(){return this.z.isZero()}isOrder2(){if(this.isInfinity())return false;return this.x.isZero()}isOdd(){return false}isEven(){return false}hasTorsion(){if(this.isInfinity())return false;if(this.x.isZero())return true;return super.hasTorsion()}order(){try{return this.toP().order()}catch(e){return new BN(1)}}jmul(k){assert(k instanceof BN);assert(!k.red);const bits=k.bitLength();let a=this.curve.xpoint();let b=this;for(let i=bits-1;i>=0;i--){const bit=k.bit(i);if(bit===0)[a,b]=this.diffAddDbl(a,b);else[b,a]=this.diffAddDbl(b,a)}return a}jmulBlind(k,rng){if(!rng)return this.jmul(k);return this.randomize(rng).jmul(k)}jmulAdd(k1,p2,k2){throw new Error("Not implemented.")}toP(sign=null){assert(sign==null||typeof sign==="boolean");if(this.isInfinity())return this.curve.point();this.normalize();return this.curve.pointFromX(this.x,sign)}toJ(){return this}toX(){return this}key(){if(this.isInfinity())return`${this.curve.uid}:oo`;this.normalize();const x=this.getX().toString(16);return`${this.curve.uid}:${x}`}encode(){return this.curve.encodeField(this.getX())}static decode(curve,bytes){assert(curve instanceof MontCurve);const x=curve.decodeField(bytes);x.iumaskn(curve.fieldBits);const p=curve.xpoint(x,curve.one);assert(!p.isInfinity());return p}toJSON(pre){return this.toP().toJSON(pre)}toPretty(){return this.toP().toPretty()}static fromJSON(curve,json){return MontPoint.fromJSON(curve,json).toX()}[custom](){if(this.isInfinity())return"";return""}}class EdwardsCurve extends Curve{constructor(conf){super(EdwardsPoint,"edwards",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.d=BN.fromJSON(conf.d).toRed(this.red);this.s=BN.fromJSON(conf.s||"0").toRed(this.red);this.si=this.s.isZero()?this.zero:this.s.redInvert();this.k=this.d.redMuln(2);this.smi=-this.d.redNeg().word(0);this.ad6=this.a.redAdd(this.d).redMul(this.i6);this.twisted=!this.a.eq(this.one);this.oneA=this.a.eq(this.one);this.mOneA=this.a.eq(this.one.redNeg());this.smallD=this.prime!=null&&this.d.redNeg().length===1;this.alt=null;this._finalize(conf)}static _isomorphism(curveA,curveD,customA){assert(curveA instanceof BN);assert(curveD instanceof BN);assert(customA instanceof BN);const a=customA.clone();const d=customA.redMul(curveD).redDiv(curveA);const c=curveA.redDiv(customA);if(c.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");return[a,d]}_short(a0,odd){const{a,d}=this;const a2=a.redSqr();const a3=a2.redMul(a);const d2=d.redSqr();const d3=d2.redMul(d);const ad14=a.redMul(d).redIMuln(14);const a2d=a2.redMul(d);const ad2=a.redMul(d2);const t0=a2d.redIAdd(ad2).redIMuln(33);const wa=a2.redAdd(ad14).redIAdd(d2).redDivn(-48);const wb=t0.redISub(a3).redISub(d3).redDivn(864);if(a0!=null)return ShortCurve._isomorphism(wa,wb,a0,odd);return[wa,wb]}_mont(b0,invert=false){assert(typeof invert==="boolean");let apd,amd;if(invert){apd=this.d.redAdd(this.a);amd=this.d.redSub(this.a)}else{apd=this.a.redAdd(this.d);amd=this.a.redSub(this.d)}const z=amd.redInvert();const a=apd.redMuln(2).redMul(z);const b=z.redMuln(4);if(b0!=null)return MontCurve._isomorphism(a,b,b0);return[a,b]}_edwards(a0){return EdwardsCurve._isomorphism(this.a,this.d,a0)}_scaleShort(curve){assert(curve instanceof ShortCurve);const[u2,u3]=curve._scale(this);return[this.field(u2.redInvert()),this.field(u3.redInvert())]}_scaleMont(curve,invert=false){assert(curve instanceof MontCurve);assert(typeof invert==="boolean");if(this.g.isInfinity()||curve.g.isInfinity()){const[a]=curve._edwards(null,invert);return this.field(a).redDivSqrt(this.a)}const x=curve.g.x.redDiv(curve.g.y);return this.g.x.redDiv(this.field(x))}_scaleEdwards(curve){assert(curve instanceof EdwardsCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this.field(curve.a).redDivSqrt(this.a);return this.g.x.redDiv(this.field(curve.g.x))}_mulA(num){assert(num instanceof BN);if(this.oneA)return num.clone();if(this.mOneA)return num.redNeg();return this.a.redMul(num)}_mulD(num){assert(num instanceof BN);if(this.smallD)return num.redMuln(this.smi);return this.d.redMul(num)}_elligator1(t){const{s,si,i2,one,two}=this;const c=si.redSqr().redIMuln(2);const ci=s.redSqr().redMul(i2);const ci2=ci.redSqr();const r=c.redAdd(ci);const r2=r.redSqr().redISub(two);const cm1=c.redSub(one);const uu=one.redSub(t);const uz=one.redAdd(t);const u=uz.isZero()?uz:uu.redDiv(uz);const u2=u.redSqr();const u3=u2.redMul(u);const u5=u3.redMul(u2);const v=u5.redAdd(r2.redMul(u3)).redIAdd(u);const f0=this.field(v.redJacobi());const f1=this.field(u2.redAdd(ci2).redJacobi());const f2=f0.redMul(f1);const X=f0.redMul(u);const Y=f0.redMul(v).redSqrt().redMul(f2);const X1=one.redAdd(X);const rX=r.redMul(X);const X12=X1.redSqr();const xx=cm1.redMul(s).redMul(X).redMul(X1);const xz=u.isZero()?this.one:Y;const yy=rX.redSub(X12);const yz=rX.redAdd(X12);return this.cpoint(xx,xz,yy,yz)}_invert1(p,hint){const{s,si,i2,one}=this;const{x,y,z}=p;const sign=hint&1;const c=si.redSqr().redIMuln(2);const ci=s.redSqr().redMul(i2);const ci2=ci.redSqr();const r=c.redAdd(ci);const cm1=c.redSub(one);const nn=y.redSub(z);const nz=y.redAdd(z).redIMuln(2);const n=nz.isZero()?nz:nn.redDiv(nz);const nr1=one.redAdd(n.redMul(r));const w2=nr1.redSqr().redISub(one);const w=w2.redSqrt();const X=w.redSub(nr1);const X1=one.redAdd(X);const YY=cm1.redMul(s).redMul(X).redMul(X1);const Y=YY.redMul(x.redMul(z));const X2=X.redSqr().redIAdd(ci2);const Z=this.field(Y.redMul(X2).redJacobi());const u=Z.redMul(X);const tt=one.redSub(u);const tz=one.redAdd(u);const t=tz.isZero()?tz:tt.redDiv(tz);if(t.redIsOdd()!==Boolean(sign))t.redINeg();return t}_alt(){if(!this.alt)this.alt=this.toMont();return this.alt}isElliptic(){const ad=this.a.redMul(this.d);const amd=this.a.redSub(this.d);return!ad.redMul(amd).isZero()}jinv(){const{a,d}=this;const ad=a.redMul(d);const amd4=a.redSub(d).redPown(4);const a2=a.redSqr();const d2=d.redSqr();const t0=a2.redAdd(ad.redMuln(14)).redIAdd(d2);const lhs=t0.redPown(3).redIMuln(16);const rhs=ad.redMul(amd4);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}isComplete(){return this.a.redJacobi()===1&&this.d.redJacobi()===-1}point(x,y,z,t){return new EdwardsPoint(this,x,y,z,t)}jpoint(x,y,z){assert(x==null&&y==null&&z==null);return this.point()}cpoint(xx,xz,yy,yz){assert(xx instanceof BN);assert(xz instanceof BN);assert(yy instanceof BN);assert(yz instanceof BN);const x=xx.redMul(yz);const y=yy.redMul(xz);const z=xz.redMul(yz);const t=xx.redMul(yy);return this.point(x,y,z,t)}solveX2(y){assert(y instanceof BN);const y2=y.redSqr();const rhs=this._mulD(y2).redISub(this.a);const lhs=y2.redISub(this.one);const x2=lhs.redDiv(rhs);return x2}solveX(y){const y2=y.redSqr();const rhs=this._mulD(y2).redISub(this.a);const lhs=y2.redISub(this.one);return lhs.redDivSqrt(rhs)}solveY2(x){assert(x instanceof BN);const x2=x.redSqr();const lhs=this._mulA(x2).redISub(this.one);const rhs=this._mulD(x2).redISub(this.one);const y2=lhs.redDiv(rhs);return y2}solveY(x){const x2=x.redSqr();const lhs=this._mulA(x2).redISub(this.one);const rhs=this._mulD(x2).redISub(this.one);return lhs.redDivSqrt(rhs)}validate(point){assert(point instanceof EdwardsPoint);if(point.zOne){const x2=point.x.redSqr();const y2=point.y.redSqr();const dxy=this._mulD(x2).redMul(y2);const lhs=this._mulA(x2).redIAdd(y2);const rhs=this.one.redAdd(dxy);const tz=point.t;const xy=point.x.redMul(point.y);return lhs.eq(rhs)&&tz.eq(xy)}const x2=point.x.redSqr();const y2=point.y.redSqr();const z2=point.z.redSqr();const z4=z2.redSqr();const dxy=this._mulD(x2).redMul(y2);const lhs=this._mulA(x2).redIAdd(y2).redMul(z2);const rhs=z4.redIAdd(dxy);const tz=point.t.redMul(point.z);const xy=point.x.redMul(point.y);return lhs.eq(rhs)&&tz.eq(xy)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(y.isZero()&&sign)throw new Error("Invalid point.");if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}pointFromY(y,sign=null){assert(y instanceof BN);assert(sign==null||typeof sign==="boolean");if(!y.red)y=y.toRed(this.red);const x=this.solveX(y);if(sign!=null){if(x.isZero()&&sign)throw new Error("Invalid point.");if(x.redIsOdd()!==sign)x.redINeg()}return this.point(x,y)}isIsomorphic(curve,invert=false){assert(curve instanceof Curve);assert(typeof invert==="boolean");if(!curve.p.eq(this.p))return false;if(curve.type==="short")return curve.isIsomorphic(this);if(curve.type==="mont"){const a=this.field(curve.a);let apd,amd;if(invert){apd=this.d.redAdd(this.a);amd=this.d.redSub(this.a)}else{apd=this.a.redAdd(this.d);amd=this.a.redSub(this.d)}return a.redMul(amd).eq(apd.redIMuln(2))}if(curve.type==="edwards"){const a=this.field(curve.a);const d=this.field(curve.d);return this.a.redMul(d).eq(a.redMul(this.d))}return false}isIsogenous(curve){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;if(curve.type==="mont"){if(!this.a.eq(this.one))return false;const a=this.field(curve.a);const b=this.field(curve.b);const d24=this.two.redSub(this.d.redMuln(4));return a.eq(d24)&&b.eq(this.one)}if(curve.type==="edwards"){const a=this.field(curve.a);const d=this.field(curve.d);return a.eq(this.a.redNeg())&&d.eq(this.d.redSub(this.a))}return false}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();if(point.y.isZero())return this.point(this.zero,this.one.redNeg());const{a,d}=this;const[u2,u3]=this._scale(point.curve);const a5=a.redMuln(5);const d5=d.redMuln(5);const x=this.field(point.x).redMul(u2);const y=this.field(point.y).redMul(u3);const x6=x.redMuln(6);const x12=x.redMuln(12);const xx=x6.redSub(a).redISub(d);const xz=y.redMuln(6);const yy=x12.redSub(a5).redIAdd(d);const yz=x12.redAdd(a).redISub(d5);return this.cpoint(xx,xz,yy,yz)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);assert(point.curve.p.eq(this.p));const u=this.field(point.x);const v=this.field(point.y);if(this.isIsogenous(point.curve)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point();const u2=u.redSqr();const u3=u2.redMul(u);const u4=u3.redMul(u);const u5=u4.redMul(u);const v2=v.redSqr();const a=v.redMuln(4);const b=u2.redSub(this.one);const c=u2.redMuln(2);const d=v2.redMuln(4);const e=u3.redIMuln(2);const f=u.redMul(v2).redIMuln(4);const g=u2.redMul(v2).redIMuln(2);const h=v2.redIMuln(2);const xx=a.redMul(b);const xz=u4.redISub(c).redIAdd(d).redIAdd(this.one);const yy=u5.redSub(e).redISub(f).redIAdd(u).redINeg();const yz=u5.redISub(g).redISub(e).redISub(h).redIAdd(u);return this.cpoint(xx,xz,yy,yz).divn(4)}if(this.isIsomorphic(point.curve,true)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.one.redNeg());const c=this._scale(point.curve,true);const xx=c.redMul(u);const xz=v;const yy=u.redAdd(this.one);const yz=u.redSub(this.one);return this.cpoint(xx,xz,yy,yz)}if(this.isIsomorphic(point.curve,false)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.one.redNeg());const c=this._scale(point.curve,false);const xx=c.redMul(u);const xz=v;const yy=u.redSub(this.one);const yz=u.redAdd(this.one);return this.cpoint(xx,xz,yy,yz)}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);assert(point.curve.p.eq(this.p));const a=this.field(point.curve.a);const x=this.field(point.x);const y=this.field(point.y);const z=this.field(point.z);const t=this.field(point.t);if(this.isIsogenous(point.curve)){const xy=x.redMul(y);const x2=x.redSqr();const y2=y.redSqr();const z2=z.redSqr();const ax2=a.redMul(x2);const xx=xy.redIMuln(2);const xz=y2.redSub(ax2);const yy=y2.redAdd(ax2);const yz=z2.redIMuln(2).redISub(yy);const p=this.cpoint(xx,xz,yy,yz);return!this.twisted?p.divn(4):p}if(this.isIsomorphic(point.curve)){const c=this._scale(point.curve);const nx=c.redMul(x);const ny=y;const nz=z;const nt=c.redMul(t);return this.point(nx,ny,nz,nt)}throw new Error("Not implemented.")}pointFromUniform(u,curve=null){assert(u instanceof BN);assert(u.red===this.red);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const u0=curve.field(u);const p0=curve.pointFromUniform(u0);return this.pointFromMont(p0)}pointToUniform(p,hint,curve=null){assert(p instanceof EdwardsPoint);assert(hint>>>0===hint);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const i=(hint>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);const p0=curve.pointFromEdwards(q);const u0=curve.pointToUniform(p0,hint&15);return this.field(u0)}pointFromHash(bytes,pake,curve=null){assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const p0=curve.pointFromHash(bytes,pake);return this.pointFromMont(p0)}pointToHash(p,subgroup,rng,curve=null){assert(p instanceof EdwardsPoint);assert(subgroup>>>0===subgroup);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const i=subgroup%this.torsion.length;const q=p.add(this.torsion[i]);const p0=curve.pointFromEdwards(q);return curve.pointToHash(p0,0,rng)}decodePoint(bytes){return EdwardsPoint.decode(this,bytes)}toShort(a0,odd,sign=null){const[a,b]=this._short(a0,odd);const curve=new ShortCurve({red:this.red,prime:this.prime,p:this.p,a:a,b:b,n:this.n,h:this.h});if(sign!=null){const[,u3]=curve._scale(this);if(u3.redIsOdd()!==sign)u3.redINeg()}if(!this.g.isInfinity())curve.g=curve.pointFromEdwards(this.g);for(let i=0;i=0)throw new Error("Invalid point.");return curve.pointFromY(y,sign)}toJSON(pre){if(this.isInfinity())return[];const x=this.getX().toJSON();const y=this.getY().toJSON();if(pre===true&&this.pre)return[x,y,this.pre.toJSON()];return[x,y]}toPretty(){const size=this.curve.fieldSize*2;const x=toPretty(this.getX(),size);const y=toPretty(this.getY(),size);return[x,y]}static fromJSON(curve,json){assert(curve instanceof EdwardsCurve);assert(Array.isArray(json));assert(json.length===0||json.length===2||json.length===3);if(json.length===0)return curve.point();const x=BN.fromJSON(json[0]);const y=BN.fromJSON(json[1]);const point=curve.point(x,y);if(json.length>2&&json[2]!=null)point.pre=Precomp.fromJSON(point,json[2]);return point}[custom](){if(this.isInfinity())return"";return""}}class Precomp{constructor(){this.naf=null;this.windows=null;this.doubles=null;this.blinding=null;this.beta=null}map(func){assert(typeof func==="function");const out=new this.constructor;if(this.naf)out.naf=this.naf.map(func);if(this.doubles)out.doubles=this.doubles.map(func);return out}toJSON(){return{naf:this.naf?this.naf.toJSON():null,windows:this.windows?this.windows.toJSON():null,doubles:this.doubles?this.doubles.toJSON():null,blinding:this.blinding?this.blinding.toJSON():undefined}}fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");if(json.naf!=null)this.naf=NAF.fromJSON(point,json.naf);if(json.windows!=null)this.windows=Windows.fromJSON(point,json.windows);if(json.doubles!=null)this.doubles=Doubles.fromJSON(point,json.doubles);if(json.blinding!=null)this.blinding=Blinding.fromJSON(point,json.blinding);return this}static fromJSON(point,json){return(new this).fromJSON(point,json)}}class NAF{constructor(width,points){this.width=width;this.points=points}map(func){assert(typeof func==="function");const{width}=this;const points=[];for(const point of this.points)points.push(func(point));return new this.constructor(width,points)}toJSON(){return{width:this.width,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.width>>>0===json.width);assert(Array.isArray(json.points));const{curve}=point;const{width}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(width,points)}}class Windows{constructor(width,bits,points){this.width=width;this.bits=bits;this.points=points}toJSON(){return{width:this.width,bits:this.bits,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.width>>>0===json.width);assert(json.bits>>>0===json.bits);assert(Array.isArray(json.points));const{curve}=point;const{width,bits}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(width,bits,points)}}class Doubles{constructor(step,points){this.step=step;this.points=points}map(func){assert(typeof func==="function");const{step}=this;const points=[];for(const point of this.points)points.push(func(point));return new this.constructor(step,points)}toJSON(){return{step:this.step,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.step>>>0===json.step);assert(Array.isArray(json.points));const{curve}=point;const{step}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(step,points)}}class Blinding{constructor(blind,unblind){this.blind=blind;this.unblind=unblind}toJSON(){return{blind:this.blind.toJSON(),unblind:this.unblind.toJSON()}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");const{curve}=point;const blind=BN.fromJSON(json.blind);const unblind=curve.pointFromJSON(json.unblind);return new this(blind,unblind)}}class Endo{constructor(beta,lambda,basis,pre){this.beta=beta;this.lambda=lambda;this.basis=basis;this.pre=pre}toJSON(){return{beta:this.beta.fromRed().toJSON(),lambda:this.lambda.toJSON(),basis:[this.basis[0].toJSON(),this.basis[1].toJSON()],pre:[this.pre[0],this.pre[1].toJSON(),this.pre[2].toJSON()]}}static fromJSON(curve,json){assert(curve instanceof Curve);assert(json&&typeof json==="object");assert(Array.isArray(json.basis));assert(Array.isArray(json.pre));assert(json.basis.length===2);assert(json.pre.length===3);assert(json.pre[0]>>>0===json.pre[0]);const beta=BN.fromJSON(json.beta).toRed(curve.red);const lambda=BN.fromJSON(json.lambda);const basis=[Vector.fromJSON(json.basis[0]),Vector.fromJSON(json.basis[1])];const pre=[json.pre[0],BN.fromJSON(json.pre[1]),BN.fromJSON(json.pre[2])];return new this(beta,lambda,basis,pre)}}class Vector{constructor(a,b){this.a=a;this.b=b}toJSON(){return{a:this.a.toJSON(),b:this.b.toJSON()}}static fromJSON(json){assert(json&&typeof json==="object");const a=BN.fromJSON(json.a);const b=BN.fromJSON(json.b);return new this(a,b)}}class P192 extends ShortCurve{constructor(pre){super({id:"P192",ossl:"prime192v1",type:"short",endian:"be",hash:"SHA256",prime:"p192",p:["ffffffff ffffffff ffffffff fffffffe","ffffffff ffffffff"],a:["ffffffff ffffffff ffffffff fffffffe","ffffffff fffffffc"],b:["64210519 e59c80e7 0fa7e9ab 72243049","feb8deec c146b9b1"],n:["ffffffff ffffffff ffffffff 99def836","146bc9b1 b4d22831"],h:"1",z:"-5",g:[["188da80e b03090f6 7cbf20eb 43a18800","f4ff0afd 82ff1012"],["07192b95 ffc8da78 631011ed 6b24cdd5","73f977a1 1e794811"],pre]})}}class P224 extends ShortCurve{constructor(pre){super({id:"P224",ossl:"secp224r1",type:"short",endian:"be",hash:"SHA256",prime:"p224",p:["ffffffff ffffffff ffffffff ffffffff","00000000 00000000 00000001"],a:["ffffffff ffffffff ffffffff fffffffe","ffffffff ffffffff fffffffe"],b:["b4050a85 0c04b3ab f5413256 5044b0b7","d7bfd8ba 270b3943 2355ffb4"],n:["ffffffff ffffffff ffffffff ffff16a2","e0b8f03e 13dd2945 5c5c2a3d"],h:"1",z:"1f",g:[["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3","56c21122 343280d6 115c1d21"],["bd376388 b5f723fb 4c22dfe6 cd4375a0","5a074764 44d58199 85007e34"],pre]})}}class P256 extends ShortCurve{constructor(pre){super({id:"P256",ossl:"prime256v1",type:"short",endian:"be",hash:"SHA256",prime:null,p:["ffffffff 00000001 00000000 00000000","00000000 ffffffff ffffffff ffffffff"],a:["ffffffff 00000001 00000000 00000000","00000000 ffffffff ffffffff fffffffc"],b:["5ac635d8 aa3a93e7 b3ebbd55 769886bc","651d06b0 cc53b0f6 3bce3c3e 27d2604b"],n:["ffffffff 00000000 ffffffff ffffffff","bce6faad a7179e84 f3b9cac2 fc632551"],h:"1",z:"-a",g:[["6b17d1f2 e12c4247 f8bce6e5 63a440f2","77037d81 2deb33a0 f4a13945 d898c296"],["4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16","2bce3357 6b315ece cbb64068 37bf51f5"],pre]})}}class P384 extends ShortCurve{constructor(pre){super({id:"P384",ossl:"secp384r1",type:"short",endian:"be",hash:"SHA384",prime:null,p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff fffffffe","ffffffff 00000000 00000000 ffffffff"],a:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff fffffffe","ffffffff 00000000 00000000 fffffffc"],b:["b3312fa7 e23ee7e4 988e056b e3f82d19","181d9c6e fe814112 0314088f 5013875a","c656398d 8a2ed19d 2a85c8ed d3ec2aef"],n:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff c7634d81 f4372ddf","581a0db2 48b0a77a ecec196a ccc52973"],h:"1",z:"-c",g:[["aa87ca22 be8b0537 8eb1c71e f320ad74","6e1d3b62 8ba79b98 59f741e0 82542a38","5502f25d bf55296c 3a545e38 72760ab7"],["3617de4a 96262c6f 5d9e98bf 9292dc29","f8f41dbd 289a147c e9da3113 b5f0b8c0","0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"],pre]})}}class P521 extends ShortCurve{constructor(pre){super({id:"P521",ossl:"secp521r1",type:"short",endian:"be",hash:"SHA512",prime:"p521",p:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff"],a:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","fffffffc"],b:["00000051 953eb961 8e1c9a1f 929a21a0","b68540ee a2da725b 99b315f3 b8b48991","8ef109e1 56193951 ec7e937b 1652c0bd","3bb1bf07 3573df88 3d2c34f1 ef451fd4","6b503f00"],n:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","fffffffa 51868783 bf2f966b 7fcc0148","f709a5d0 3bb5c9b8 899c47ae bb6fb71e","91386409"],h:"1",z:"-4",g:[["000000c6 858e06b7 0404e9cd 9e3ecb66","2395b442 9c648139 053fb521 f828af60","6b4d3dba a14b5e77 efe75928 fe1dc127","a2ffa8de 3348b3c1 856a429b f97e7e31","c2e5bd66"],["00000118 39296a78 9a3bc004 5c8a5fb4","2c7d1bd9 98f54449 579b4468 17afbd17","273e662c 97ee7299 5ef42640 c550b901","3fad0761 353c7086 a272c240 88be9476","9fd16650"],pre]})}}class SECP256K1 extends ShortCurve{constructor(pre){super({id:"SECP256K1",ossl:"secp256k1",type:"short",endian:"be",hash:"SHA256",prime:"k256",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe fffffc2f"],a:"0",b:"7",n:["ffffffff ffffffff ffffffff fffffffe","baaedce6 af48a03b bfd25e8c d0364141"],h:"1",z:"1",c:["0a2d2ba9 3507f1df 233770c2 a797962c","c61f6d15 da14ecd4 7d8d27ae 1cd5f852"],g:[["79be667e f9dcbbac 55a06295 ce870b07","029bfcdb 2dce28d9 59f2815b 16f81798"],["483ada77 26a3c465 5da4fbfc 0e1108a8","fd17b448 a6855419 9c47d08f fb10d4b8"],pre],endo:{beta:["7ae96a2b 657c0710 6e64479e ac3434e9","9cf04975 12f58995 c1396c28 719501ee"],lambda:["5363ad4c c05c30e0 a5261c02 8812645a","122e22ea 20816678 df02967c 1b23bd72"],basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],pre:[384,["3086d221 a7d46bcd e86c90e4 9284eb15","3daa8a14 71e8ca7f e893209a 45dbb031"],["-","e4437ed6 010e8828 6f547fa9 0abfe4c4","221208ac 9df506c6 1571b4ae 8ac47f71"]]}})}}class BRAINPOOLP256 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP256",ossl:"brainpoolP256r1",type:"short",endian:"be",hash:"SHA256",prime:null,p:["a9fb57db a1eea9bc 3e660a90 9d838d72","6e3bf623 d5262028 2013481d 1f6e5377"],a:["7d5a0975 fc2c3057 eef67530 417affe7","fb8055c1 26dc5c6c e94a4b44 f330b5d9"],b:["26dc5c6c e94a4b44 f330b5d9 bbd77cbf","95841629 5cf7e1ce 6bccdc18 ff8c07b6"],n:["a9fb57db a1eea9bc 3e660a90 9d838d71","8c397aa3 b561a6f7 901e0e82 974856a7"],h:"1",z:"-2",g:[["8bd2aeb9 cb7e57cb 2c4b482f fc81b7af","b9de27e1 e3bd23c2 3a4453bd 9ace3262"],["547ef835 c3dac4fd 97f8461a 14611dc9","c2774513 2ded8e54 5c1d54c7 2f046997"],pre]})}}class BRAINPOOLP384 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP384",ossl:"brainpoolP384r1",type:"short",endian:"be",hash:"SHA384",prime:null,p:["8cb91e82 a3386d28 0f5d6f7e 50e641df","152f7109 ed5456b4 12b1da19 7fb71123","acd3a729 901d1a71 87470013 3107ec53"],a:["7bc382c6 3d8c150c 3c72080a ce05afa0","c2bea28e 4fb22787 139165ef ba91f90f","8aa5814a 503ad4eb 04a8c7dd 22ce2826"],b:["04a8c7dd 22ce2826 8b39b554 16f0447c","2fb77de1 07dcd2a6 2e880ea5 3eeb62d5","7cb43902 95dbc994 3ab78696 fa504c11"],n:["8cb91e82 a3386d28 0f5d6f7e 50e641df","152f7109 ed5456b3 1f166e6c ac0425a7","cf3ab6af 6b7fc310 3b883202 e9046565"],h:"1",z:"-5",g:[["1d1c64f0 68cf45ff a2a63a81 b7c13f6b","8847a3e7 7ef14fe3 db7fcafe 0cbd10e8","e826e034 36d646aa ef87b2e2 47d4af1e"],["8abe1d75 20f9c2a4 5cb1eb8e 95cfd552","62b70b29 feec5864 e19c054f f9912928","0e464621 77918111 42820341 263c5315"],pre]})}}class BRAINPOOLP512 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP512",ossl:"brainpoolP512r1",type:"short",endian:"be",hash:"SHA512",prime:null,p:["aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07","cb308db3 b3c9d20e d6639cca 70330871","7d4d9b00 9bc66842 aecda12a e6a380e6","2881ff2f 2d82c685 28aa6056 583a48f3"],a:["7830a331 8b603b89 e2327145 ac234cc5","94cbdd8d 3df91610 a83441ca ea9863bc","2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5","7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca"],b:["3df91610 a83441ca ea9863bc 2ded5d5a","a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7","2bf2c7b9 e7c1ac4d 77fc94ca dc083e67","984050b7 5ebae5dd 2809bd63 8016f723"],n:["aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07","cb308db3 b3c9d20e d6639cca 70330870","553e5c41 4ca92619 41866119 7fac1047","1db1d381 085ddadd b5879682 9ca90069"],h:"1",z:"7",g:[["81aee4bd d82ed964 5a21322e 9c4c6a93","85ed9f70 b5d916c1 b43b62ee f4d0098e","ff3b1f78 e2d0d48d 50d1687b 93b97d5f","7c6d5047 406a5e68 8b352209 bcb9f822"],["7dde385d 566332ec c0eabfa9 cf7822fd","f209f700 24a57b1a a000c55b 881f8111","b2dcde49 4a5f485e 5bca4bd8 8a2763ae","d1ca2b2f a8f05406 78cd1e0f 3ad80892"],pre]})}}class X25519 extends MontCurve{constructor(){super({id:"X25519",ossl:"X25519",type:"mont",endian:"le",hash:"SHA512",prime:"p25519",p:["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffed"],a:"76d06",b:"1",n:["10000000 00000000 00000000 00000000","14def9de a2f79cd6 5812631a 5cf5d3ed"],h:"8",z:"2",g:[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000009"],["5f51e65e 475f794b 1fe122d3 88b72eb3","6dc2b281 92839e4d d6163a5d 81312c14"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"],["6be4f497 f9a9c2af c21fa77a d7f4a6ef","635a11c7 284a9363 e9a248ef 9c884415"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"],["141b0b68 06563d50 3de05885 280b5910","9ca5ee38 d7b56c9c 165db710 6377bbd8"]],[["57119fd0 dd4e22d8 868e1c58 c45c4404","5bef839c 55b1d0b1 248c50a3 bc959c5f"],["68c59389 3d458e64 31c6ca00 45fb5015","20a44346 8eaa68dd 0f103842 048065b7"]],[["57119fd0 dd4e22d8 868e1c58 c45c4404","5bef839c 55b1d0b1 248c50a3 bc959c5f"],["173a6c76 c2ba719b ce3935ff ba04afea","df5bbcb9 71559722 f0efc7bd fb7f9a36"]],[["00b8495f 16056286 fdb1329c eb8d09da","6ac49ff1 fae35616 aeb8413b 7c7aebe0"],["3931c129 569e83a5 29482c14 e628b457","933bfc29 ed801b4d 68871483 92507b1a"]],[["00b8495f 16056286 fdb1329c eb8d09da","6ac49ff1 fae35616 aeb8413b 7c7aebe0"],["46ce3ed6 a9617c5a d6b7d3eb 19d74ba8","6cc403d6 127fe4b2 9778eb7c 6daf84d3"]]]})}}class X448 extends MontCurve{constructor(){super({id:"X448",ossl:"X448",type:"mont",endian:"le",hash:"SHAKE256",prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"262a6",b:"1",n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000005"],["7d235d12 95f5b1f6 6c98ab6e 58326fce","cbae5d34 f55545d0 60f75dc2 8df3f6ed","b8027e23 46430d21 1312c4b1 50677af7","6fd7223d 457b5b1a"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["ba4d3a08 29b6112f 8812e51b a0bb2abe","bc1cb08e b48e5569 36ba50fd d2e7d68a","f8cb3216 0522425b 3f990812 abbe635a","d37a21e1 7551b193"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["45b2c5f7 d649eed0 77ed1ae4 5f44d541","43e34f71 4b71aa96 c945af01 2d182975","0734cde9 faddbda4 c066f7ed 54419ca5","2c85de1e 8aae4e6c"]]]})}}class MONT448 extends MontCurve{constructor(){super({id:"MONT448",ossl:null,type:"mont",endian:"le",hash:"SHAKE256",prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:["b2cf97d2 d43459a9 31ed36b1 fc4e3cb5","5d93f8d2 22746997 60ccffc6 49961ed6","c5b05fca c24864ed 6fb59697 931b78da","84ddecd8 ca2b5cfb"],b:"1",n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["ac0d24cc c6c75cb0 eb71f81e 7a6edf51","48e88aee 009a2a24 e795687e c28e125a","3e6730a6 0d46367b aa7fe99d 152128dc","41321bc7 7817f059"],["5a4437f6 80c0d0db 9b061276 d5d0ffcc","e786ff33 b6a53d30 98746425 82e66f09","4433dae7 7244a6e2 6b11e905 7228f483","556c41a5 913f55fe"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["bec92fd0 6da2acf2 b4e261e8 7cef0d34","22e75c18 3c589857 b71924e5 73c2f9ce","e18da5f2 466e2f39 3c2eedf0 f105a60a","b40c717d 4f1e1fd7"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["4136d02f 925d530d 4b1d9e17 8310f2cb","dd18a3e7 c3a767a8 48e6db19 8c3d0631","1e725a0d b991d0c6 c3d1120f 0efa59f5","4bf38e82 b0e1e028"]]]})}}class ED25519 extends EdwardsCurve{constructor(pre){super({id:"ED25519",ossl:"ED25519",type:"edwards",endian:"le",hash:"SHA512",prefix:"SigEd25519 no Ed25519 collisions",context:false,prime:"p25519",p:["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffed"],a:"-1",d:["52036cee 2b6ffe73 8cc74079 7779e898","00700a4d 4141d8ab 75eb4dca 135978a3"],n:["10000000 00000000 00000000 00000000","14def9de a2f79cd6 5812631a 5cf5d3ed"],h:"8",z:"2",g:[["216936d3 cd6e53fe c0a4e231 fdd6dc5c","692cc760 9525a7b2 c9562d60 8f25d51a"],["66666666 66666666 66666666 66666666","66666666 66666666 66666666 66666658"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffec"]],[["2b832480 4fc1df0b 2b4d0099 3dfbd7a7","2f431806 ad2fe478 c4ee1b27 4a0ea0b0"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["547cdb7f b03e20f4 d4b2ff66 c2042858","d0bce7f9 52d01b87 3b11e4d8 b5f15f3d"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["1fd5b9a0 06394a28 e9339932 38de4abb","5c193c70 13e5e238 dea14646 c545d14a"],["05fc536d 880238b1 3933c6d3 05acdfd5","f098eff2 89f4c345 b027b2c2 8f95e826"]],[["602a465f f9c6b5d7 16cc66cd c721b544","a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3"],["05fc536d 880238b1 3933c6d3 05acdfd5","f098eff2 89f4c345 b027b2c2 8f95e826"]],[["1fd5b9a0 06394a28 e9339932 38de4abb","5c193c70 13e5e238 dea14646 c545d14a"],["7a03ac92 77fdc74e c6cc392c fa53202a","0f67100d 760b3cba 4fd84d3d 706a17c7"]],[["602a465f f9c6b5d7 16cc66cd c721b544","a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3"],["7a03ac92 77fdc74e c6cc392c fa53202a","0f67100d 760b3cba 4fd84d3d 706a17c7"]]]})}}class ISO448 extends EdwardsCurve{constructor(pre){super({id:"ISO448",ossl:null,type:"edwards",endian:"le",hash:"SHAKE256",prefix:"SigEd448",context:true,prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"1",d:["d78b4bdc 7f0daf19 f24f38c2 9373a2cc","ad461572 42a50f37 809b1da3 412a12e7","9ccc9c81 264cfe9a d0809970 58fb61c4","243cc32d baa156b9"],n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["79a70b2b 70400553 ae7c9df4 16c792c6","1128751a c9296924 0c25a07d 728bdc93","e21f7787 ed697224 9de732f3 8496cd11","69871309 3e9c04fc"],["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 80000000","00000000 00000000 00000000 00000000","00000000 00000001"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]]]})}}class ED448 extends EdwardsCurve{constructor(pre){super({id:"ED448",ossl:"ED448",type:"edwards",endian:"le",hash:"SHAKE256",prefix:"SigEd448",context:true,prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"1",d:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffff6756"],n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["4f1970c6 6bed0ded 221d15a6 22bf36da","9e146570 470f1767 ea6de324 a3d3a464","12ae1af7 2ab66511 433b80e1 8b00938e","2626a82b c70cc05e"],["693f4671 6eb6bc24 88762037 56c9c762","4bea7373 6ca39840 87789c1e 05a0c2d7","3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad","9808795b f230fa14"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]]]})}}const curves={__proto__:null,P192:P192,P224:P224,P256:P256,P384:P384,P521:P521,SECP256K1:SECP256K1,BRAINPOOLP256:BRAINPOOLP256,BRAINPOOLP384:BRAINPOOLP384,BRAINPOOLP512:BRAINPOOLP512,X25519:X25519,X448:X448,MONT448:MONT448,ED25519:ED25519,ISO448:ISO448,ED448:ED448};const cache={__proto__:null,P192:null,P224:null,P256:null,P384:null,P521:null,SECP256K1:null,BRAINPOOLP256:null,BRAINPOOLP384:null,BRAINPOOLP512:null,X25519:null,X448:null,MONT448:null,ED25519:null,ISO448:null,ED448:null};function curve(name,...args){assert(typeof name==="string");const key=name.toUpperCase();let curve=cache[key];if(!curve){const Curve=curves[key];if(!Curve)throw new Error(`Curve not found: "${name}".`);curve=new Curve(...args);cache[key]=curve}return curve}function register(name,Curve){assert(typeof name==="string");assert(typeof Curve==="function");const key=name.toUpperCase();if(curves[key])throw new Error(`Curve already registered: "${name}".`);curves[key]=Curve;cache[key]=null}function getNAF(k,width,max){assert(k instanceof BN);assert(!k.red);assert(width>>>0===width);assert(max>>>0===max);const naf=new Array(max);const bits=k.bitLength()+1;const sign=k.sign()|1;assert(bits<=max);for(let i=0;i>width-1&1;word-=carry<>>0===step);const naf=getNAF(k,width,max);const len=Math.ceil(naf.length/step);const repr=new Array(len);let i=0;for(let j=0;j=j;k--)nafW=(nafW<<1)+naf[k];repr[i++]=nafW}assert(i===len);return repr}function getJSF(k1,k2,max){assert(k1 instanceof BN);assert(k2 instanceof BN);assert(!k1.red);assert(!k2.red);assert(max>>>0===max);const jsf=[new Array(max),new Array(max)];const bits=Math.max(k1.bitLength(),k2.bitLength())+1;const s1=k1.sign()|1;const s2=k2.sign()|1;assert(bits<=max);let d1=0;let d2=0;for(let i=0;i=0)return root}throw new Error("X^(1/3) is not a square mod P.")}function randomInt(rng){return BN.randomBits(rng,32).toNumber()}function memoize(method,self){const cache=new WeakMap;return function memoized(curve,invert){const i=invert&1;const item=cache.get(curve);if(item&&item[i]!==null)return item[i];const result=method.call(self,curve,invert);if(!cache.has(curve))cache.set(curve,[null,null]);cache.get(curve)[i]=result;return result}}function toPretty(x,size){assert(x instanceof BN);assert(size>>>0===size);if(size&7)size+=8-(size&7);const str=x.toString(16,size);const chunks=[];const out=[];assert((str.length&7)===0);for(let i=0;i>>0===size);const data=bufferExports.Buffer.alloc(size);randomFillSync(data,0,size);return data}function randomFill(data,off,size){assert(bufferExports.Buffer.isBuffer(data));if(off==null)off=0;assert(off>>>0===off);if(size==null)size=data.length-off;assert(size>>>0===size);assert(off+size<=data.length);randomFillSync(data,off,size);return data}function randomInt(){if((poolPos&15)===0){getRandomValues(pool);poolPos=0}return pool[poolPos++]}function randomRange(min,max){assert(min>>>0===min);assert(max>>>0===max);assert(max>=min);const space=max-min;if(space===0)return min;const top=-space>>>0;let x,r;do{x=randomInt();r=x%space}while(x-r>top);return r+min}function getRandomValues(array){if(!HAS_CRYPTO)throw new Error("Entropy source not available.");return randomValues(array)}function randomFillSync(data,off,size){assert(bufferExports.Buffer.isBuffer(data));assert(data.buffer instanceof ArrayBuffer);assert(data.byteOffset>>>0===data.byteOffset);assert(data.byteLength>>>0===data.byteLength);assert(off>>>0===off);assert(size>>>0===size);assert(off+size<=data.byteLength);if(size>2**31-1)throw new RangeError('The value "size" is out of range.');const offset=data.byteOffset+off;const array=new Uint8Array(data.buffer,offset,size);if(array.length>MAX_BYTES){for(let i=0;iarray.length)j=array.length;getRandomValues(array.subarray(i,j))}}else{if(array.length>0)getRandomValues(array)}}random.native=0;random.randomBytes=randomBytes;random.randomFill=randomFill;random.randomInt=randomInt;random.randomRange=randomRange;return random}var randomBrowser;var hasRequiredRandomBrowser;function requireRandomBrowser(){if(hasRequiredRandomBrowser)return randomBrowser;hasRequiredRandomBrowser=1;randomBrowser=requireRandom();return randomBrowser}var eddsa;var hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;const assert=requireAssert();const BatchRNG=requireBatchRng();const BN=requireBnBrowser();const elliptic=requireElliptic();const rng=requireRandomBrowser();class EDDSA{constructor(id,mid,eid,hash,pre){assert(typeof id==="string");assert(!mid||typeof mid==="string");assert(!eid||typeof eid==="string");assert(hash);this.id=id;this.type="eddsa";this.mid=mid||null;this.eid=eid||null;this.hash=hash;this.native=0;this._pre=pre||null;this._curve=null;this._mont=null;this._iso=null;this._rng=null}get curve(){if(!this._curve){this._curve=elliptic.curve(this.id,this._pre);this._curve.precompute(rng);this._pre=null}return this._curve}get mont(){if(this.mid&&!this._mont)this._mont=elliptic.curve(this.mid);return this._mont}get iso(){if(!this.eid)return this.mont;if(!this._iso)this._iso=elliptic.curve(this.eid);return this._iso}get rng(){if(!this._rng)this._rng=new BatchRNG(this.curve);return this._rng}get size(){return this.curve.adjustedSize}get bits(){return this.curve.fieldBits}hashNonce(prefix,msg,ph,ctx){const hash=new Hash(this);hash.init(ph,ctx);hash.update(prefix);hash.update(msg);return hash.final()}hashChallenge(R,A,m,ph,ctx){const hash=new Hash(this);hash.init(ph,ctx);hash.update(R);hash.update(A);hash.update(m);return hash.final()}privateKeyGenerate(){return rng.randomBytes(this.curve.adjustedSize)}scalarGenerate(){const scalar=rng.randomBytes(this.curve.scalarSize);return this.curve.clamp(scalar)}privateKeyExpand(secret){assert(bufferExports.Buffer.isBuffer(secret));assert(secret.length===this.curve.adjustedSize);const hash=this.hash.digest(secret,this.curve.adjustedSize*2);return this.curve.splitHash(hash)}privateKeyConvert(secret){const[key]=this.privateKeyExpand(secret);return key}privateKeyVerify(secret){assert(bufferExports.Buffer.isBuffer(secret));return secret.length===this.curve.adjustedSize}scalarVerify(scalar){assert(bufferExports.Buffer.isBuffer(scalar));return scalar.length===this.curve.scalarSize}scalarIsZero(scalar){assert(bufferExports.Buffer.isBuffer(scalar));let k;try{k=this.curve.decodeScalar(scalar).imod(this.curve.n)}catch(e){return false}return k.isZero()}scalarClamp(scalar){assert(bufferExports.Buffer.isBuffer(scalar));assert(scalar.length===this.curve.scalarSize);return this.curve.clamp(bufferExports.Buffer.from(scalar))}privateKeyExport(secret){const pub=this.publicKeyCreate(secret);const{x,y}=this.publicKeyExport(pub);return{d:bufferExports.Buffer.from(secret),x:x,y:y}}privateKeyImport(json){assert(json&&typeof json==="object");assert(bufferExports.Buffer.isBuffer(json.d));if(json.d.length!==this.curve.adjustedSize)throw new Error("Invalid private key.");return bufferExports.Buffer.from(json.d)}scalarTweakAdd(scalar,tweak){const a=this.curve.decodeScalar(scalar);const t=this.curve.decodeScalar(tweak);const k=a.add(t).imod(this.curve.n);return this.curve.encodeScalar(k)}scalarTweakMul(scalar,tweak){const a=this.curve.decodeScalar(scalar);const t=this.curve.decodeScalar(tweak);const k=a.mul(t).imod(this.curve.n);return this.curve.encodeScalar(k)}scalarReduce(scalar){const a=this.curve.decodeScalar(scalar);const k=a.imod(this.curve.n);return this.curve.encodeScalar(k)}scalarNegate(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);const k=a.neg().imod(this.curve.n);return this.curve.encodeScalar(k)}scalarInvert(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);if(a.isZero())return this.curve.encodeScalar(a);const k=a.invert(this.curve.n);return this.curve.encodeScalar(k)}publicKeyCreate(secret){const key=this.privateKeyConvert(secret);return this.publicKeyFromScalar(key)}publicKeyFromScalar(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);const A=this.curve.g.mulBlind(a);return A.encode()}publicKeyConvert(key){if(!this.mont)throw new Error("No equivalent montgomery curve.");const A=this.curve.decodePoint(key);const P=this.mont.pointFromEdwards(A);return P.encode()}publicKeyFromUniform(bytes){const u=this.curve.decodeUniform(bytes);const A=this.curve.pointFromUniform(u,this.iso);return A.encode()}publicKeyToUniform(key,hint=rng.randomInt()){const A=this.curve.decodePoint(key);const u=this.curve.pointToUniform(A,hint,this.iso);return this.curve.encodeUniform(u,hint>>>8)}publicKeyFromHash(bytes,pake=false){const A=this.curve.pointFromHash(bytes,pake,this.iso);return A.encode()}publicKeyToHash(key,subgroup=rng.randomInt()){const A=this.curve.decodePoint(key);return this.curve.pointToHash(A,subgroup,rng,this.iso)}publicKeyVerify(key){assert(bufferExports.Buffer.isBuffer(key));try{this.curve.decodePoint(key)}catch(e){return false}return true}publicKeyIsInfinity(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.isInfinity()}publicKeyIsSmall(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.isSmall()}publicKeyHasTorsion(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.hasTorsion()}publicKeyExport(key){const{x,y}=this.curve.decodePoint(key);return{x:this.curve.encodeField(x.fromRed()),y:this.curve.encodeField(y.fromRed())}}publicKeyImport(json){assert(json&&typeof json==="object");let x=null;let y=null;let A;if(json.x!=null){x=BN.decode(json.x,this.curve.endian);if(x.cmp(this.curve.p)>=0)throw new Error("Invalid point.")}if(json.y!=null){y=BN.decode(json.y,this.curve.endian);if(y.cmp(this.curve.p)>=0)throw new Error("Invalid point.")}if(x&&y){A=this.curve.point(x,y);if(!A.validate())throw new Error("Invalid point.")}else if(x){A=this.curve.pointFromX(x,json.sign)}else if(y){A=this.curve.pointFromY(y,json.sign)}else{throw new Error("Invalid point.")}return A.encode()}publicKeyTweakAdd(key,tweak){const t=this.curve.decodeScalar(tweak).imod(this.curve.n);const A=this.curve.decodePoint(key);const T=this.curve.g.mul(t);const P=T.add(A);return P.encode()}publicKeyTweakMul(key,tweak){const t=this.curve.decodeScalar(tweak);const A=this.curve.decodePoint(key);const P=A.mul(t);return P.encode()}publicKeyCombine(keys){assert(Array.isArray(keys));let P=this.curve.point();for(const key of keys){const A=this.curve.decodePoint(key);P=P.add(A)}return P.encode()}publicKeyNegate(key){const A=this.curve.decodePoint(key);const P=A.neg();return P.encode()}sign(msg,secret,ph,ctx){const[key,prefix]=this.privateKeyExpand(secret);return this.signWithScalar(msg,key,prefix,ph,ctx)}signWithScalar(msg,scalar,prefix,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(prefix));assert(prefix.length===this.curve.adjustedSize);const{n}=this.curve;const G=this.curve.g;const k=this.hashNonce(prefix,msg,ph,ctx);const Rraw=G.mulBlind(k).encode();const a=this.curve.decodeScalar(scalar);const Araw=G.mulBlind(a).encode();const e=this.hashChallenge(Rraw,Araw,msg,ph,ctx);const s=k.add(e.mul(a)).imod(n);return bufferExports.Buffer.concat([Rraw,this.curve.encodeAdjusted(s)])}signTweakAdd(msg,secret,tweak,ph,ctx){const[key_,prefix_]=this.privateKeyExpand(secret);const key=this.scalarTweakAdd(key_,tweak);const expanded=this.hash.multi(prefix_,tweak,null,this.curve.adjustedSize*2);const prefix=expanded.slice(0,this.curve.adjustedSize);return this.signWithScalar(msg,key,prefix,ph,ctx)}signTweakMul(msg,secret,tweak,ph,ctx){const[key_,prefix_]=this.privateKeyExpand(secret);const key=this.scalarTweakMul(key_,tweak);const expanded=this.hash.multi(prefix_,tweak,null,this.curve.adjustedSize*2);const prefix=expanded.slice(0,this.curve.adjustedSize);return this.signWithScalar(msg,key,prefix,ph,ctx)}verify(msg,sig,key,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false;try{return this._verify(msg,sig,key,ph,ctx)}catch(e){return false}}_verify(msg,sig,key,ph,ctx){const{n}=this.curve;const G=this.curve.g;const Rraw=sig.slice(0,this.curve.adjustedSize);const sraw=sig.slice(this.curve.adjustedSize);const R=this.curve.decodePoint(Rraw);const s=this.curve.decodeAdjusted(sraw);const A=this.curve.decodePoint(key);if(s.cmp(n)>=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);return G.mulAdd(s,A.neg(),e).eq(R)}verifySingle(msg,sig,key,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false;try{return this._verifySingle(msg,sig,key,ph,ctx)}catch(e){return false}}_verifySingle(msg,sig,key,ph,ctx){const{n}=this.curve;const G=this.curve.g;const Rraw=sig.slice(0,this.curve.adjustedSize);const sraw=sig.slice(this.curve.adjustedSize);const R=this.curve.decodePoint(Rraw);const s=this.curve.decodeAdjusted(sraw);const A=this.curve.decodePoint(key);if(s.cmp(n)>=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);const sh=this.curve.imulH(s);const Ah=A.mulH();const Rh=R.mulH();return G.mulAdd(sh,Ah.neg(),e).eq(Rh)}verifyBatch(batch,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(Array.isArray(batch));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));for(const item of batch){assert(Array.isArray(item)&&item.length===3);const[msg,sig,key]=item;assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false}try{return this._verifyBatch(batch,ph,ctx)}catch(e){return false}}_verifyBatch(batch,ph,ctx){const{n}=this.curve;const G=this.curve.g;const points=new Array(1+batch.length*2);const coeffs=new Array(1+batch.length*2);const sum=new BN(0);this.rng.init(batch);points[0]=G;coeffs[0]=sum;for(let i=0;i=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);const a=this.rng.generate(i);const ea=e.mul(a).imod(n);sum.iadd(s.mul(a)).imod(n);points[1+i*2+0]=R.mulH();coeffs[1+i*2+0]=a;points[1+i*2+1]=A.mulH();coeffs[1+i*2+1]=ea}this.curve.imulH(sum.ineg());return this.curve.mulAll(points,coeffs).isInfinity()}derive(pub,secret){const scalar=this.privateKeyConvert(secret);return this.deriveWithScalar(pub,scalar)}deriveWithScalar(pub,scalar){const A=this.curve.decodePoint(pub);const a=this.curve.decodeClamped(scalar);const P=A.mulBlind(a,rng);if(P.isInfinity())throw new Error("Invalid point.");return P.encode()}}class Hash{constructor(eddsa){this.curve=eddsa.curve;this.hash=new eddsa.hash}init(ph,ctx){assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(ctx.length>255)ctx=ctx.slice(0,255);this.hash.init();if(this.curve.context||ph!=null||ctx.length>0){if(this.curve.prefix)this.hash.update(this.curve.prefix);this.hash.update(byte(ph));this.hash.update(byte(ctx.length));this.hash.update(ctx)}return this}update(data){this.hash.update(data);return this}final(){const hash=this.hash.final(this.curve.adjustedSize*2);const num=BN.decode(hash,this.curve.endian);return num.imod(this.curve.n)}}function byte(ch){const buf=bufferExports.Buffer.alloc(1);buf[0]=ch&255;return buf}eddsa=EDDSA;return eddsa}var keccak;var hasRequiredKeccak;function requireKeccak(){if(hasRequiredKeccak)return keccak;hasRequiredKeccak=1;const assert=requireAssert();const HMAC=requireHmac();const FINALIZED=2147483648;const ROUND_CONST=new Uint32Array([1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648]);class Keccak{constructor(){this.state=new Uint32Array(50);this.block=bufferExports.Buffer.alloc(200);this.bs=136;this.pos=FINALIZED}init(bits){if(bits==null)bits=256;assert(bits>>>0===bits);assert(bits>=128);assert(bits<=512);const rate=1600-bits*2;assert(rate>=0&&(rate&63)===0);this.bs=rate>>>3;this.pos=0;return this}update(data){assert(bufferExports.Buffer.isBuffer(data));assert(!(this.pos&FINALIZED),"Context is not initialized.");let len=data.length;let pos=this.pos;let off=0;this.pos=(this.pos+len)%this.bs;if(pos>0){let want=this.bs-pos;if(want>len)want=len;data.copy(this.block,pos,off,off+want);pos+=want;len-=want;off+=want;if(pos=this.bs){this._transform(data,off);off+=this.bs;len-=this.bs}if(len>0)data.copy(this.block,0,off,off+len);return this}final(pad,len){if(pad==null)pad=1;if(len==null||len===0)len=100-(this.bs>>>1);assert((pad&255)===pad);assert(len>>>0===len);assert(!(this.pos&FINALIZED),"Context is not initialized.");this.block.fill(0,this.pos,this.bs);this.block[this.pos]|=pad;this.block[this.bs-1]|=128;this._transform(this.block,0);this.pos=FINALIZED;assert(len<=this.bs);const out=bufferExports.Buffer.alloc(len);for(let i=0;i>>2]>>>8*(i&3);for(let i=0;i<50;i++)this.state[i]=0;for(let i=0;i>>2;const s=this.state;for(let i=0;i>>31);const l0=c9^(c3<<1|c2>>>31);const h1=c0^(c4<<1|c5>>>31);const l1=c1^(c5<<1|c4>>>31);const h2=c2^(c6<<1|c7>>>31);const l2=c3^(c7<<1|c6>>>31);const h3=c4^(c8<<1|c9>>>31);const l3=c5^(c9<<1|c8>>>31);const h4=c6^(c0<<1|c1>>>31);const l4=c7^(c1<<1|c0>>>31);s[0]^=h0;s[1]^=l0;s[10]^=h0;s[11]^=l0;s[20]^=h0;s[21]^=l0;s[30]^=h0;s[31]^=l0;s[40]^=h0;s[41]^=l0;s[2]^=h1;s[3]^=l1;s[12]^=h1;s[13]^=l1;s[22]^=h1;s[23]^=l1;s[32]^=h1;s[33]^=l1;s[42]^=h1;s[43]^=l1;s[4]^=h2;s[5]^=l2;s[14]^=h2;s[15]^=l2;s[24]^=h2;s[25]^=l2;s[34]^=h2;s[35]^=l2;s[44]^=h2;s[45]^=l2;s[6]^=h3;s[7]^=l3;s[16]^=h3;s[17]^=l3;s[26]^=h3;s[27]^=l3;s[36]^=h3;s[37]^=l3;s[46]^=h3;s[47]^=l3;s[8]^=h4;s[9]^=l4;s[18]^=h4;s[19]^=l4;s[28]^=h4;s[29]^=l4;s[38]^=h4;s[39]^=l4;s[48]^=h4;s[49]^=l4;const b0=s[0];const b1=s[1];const b32=s[11]<<4|s[10]>>>28;const b33=s[10]<<4|s[11]>>>28;const b14=s[20]<<3|s[21]>>>29;const b15=s[21]<<3|s[20]>>>29;const b46=s[31]<<9|s[30]>>>23;const b47=s[30]<<9|s[31]>>>23;const b28=s[40]<<18|s[41]>>>14;const b29=s[41]<<18|s[40]>>>14;const b20=s[2]<<1|s[3]>>>31;const b21=s[3]<<1|s[2]>>>31;const b2=s[13]<<12|s[12]>>>20;const b3=s[12]<<12|s[13]>>>20;const b34=s[22]<<10|s[23]>>>22;const b35=s[23]<<10|s[22]>>>22;const b16=s[33]<<13|s[32]>>>19;const b17=s[32]<<13|s[33]>>>19;const b48=s[42]<<2|s[43]>>>30;const b49=s[43]<<2|s[42]>>>30;const b40=s[5]<<30|s[4]>>>2;const b41=s[4]<<30|s[5]>>>2;const b22=s[14]<<6|s[15]>>>26;const b23=s[15]<<6|s[14]>>>26;const b4=s[25]<<11|s[24]>>>21;const b5=s[24]<<11|s[25]>>>21;const b36=s[34]<<15|s[35]>>>17;const b37=s[35]<<15|s[34]>>>17;const b18=s[45]<<29|s[44]>>>3;const b19=s[44]<<29|s[45]>>>3;const b10=s[6]<<28|s[7]>>>4;const b11=s[7]<<28|s[6]>>>4;const b42=s[17]<<23|s[16]>>>9;const b43=s[16]<<23|s[17]>>>9;const b24=s[26]<<25|s[27]>>>7;const b25=s[27]<<25|s[26]>>>7;const b6=s[36]<<21|s[37]>>>11;const b7=s[37]<<21|s[36]>>>11;const b38=s[47]<<24|s[46]>>>8;const b39=s[46]<<24|s[47]>>>8;const b30=s[8]<<27|s[9]>>>5;const b31=s[9]<<27|s[8]>>>5;const b12=s[18]<<20|s[19]>>>12;const b13=s[19]<<20|s[18]>>>12;const b44=s[29]<<7|s[28]>>>25;const b45=s[28]<<7|s[29]>>>25;const b26=s[38]<<8|s[39]>>>24;const b27=s[39]<<8|s[38]>>>24;const b8=s[48]<<14|s[49]>>>18;const b9=s[49]<<14|s[48]>>>18;s[0]=b0^~b2&b4;s[1]=b1^~b3&b5;s[10]=b10^~b12&b14;s[11]=b11^~b13&b15;s[20]=b20^~b22&b24;s[21]=b21^~b23&b25;s[30]=b30^~b32&b34;s[31]=b31^~b33&b35;s[40]=b40^~b42&b44;s[41]=b41^~b43&b45;s[2]=b2^~b4&b6;s[3]=b3^~b5&b7;s[12]=b12^~b14&b16;s[13]=b13^~b15&b17;s[22]=b22^~b24&b26;s[23]=b23^~b25&b27;s[32]=b32^~b34&b36;s[33]=b33^~b35&b37;s[42]=b42^~b44&b46;s[43]=b43^~b45&b47;s[4]=b4^~b6&b8;s[5]=b5^~b7&b9;s[14]=b14^~b16&b18;s[15]=b15^~b17&b19;s[24]=b24^~b26&b28;s[25]=b25^~b27&b29;s[34]=b34^~b36&b38;s[35]=b35^~b37&b39;s[44]=b44^~b46&b48;s[45]=b45^~b47&b49;s[6]=b6^~b8&b0;s[7]=b7^~b9&b1;s[16]=b16^~b18&b10;s[17]=b17^~b19&b11;s[26]=b26^~b28&b20;s[27]=b27^~b29&b21;s[36]=b36^~b38&b30;s[37]=b37^~b39&b31;s[46]=b46^~b48&b40;s[47]=b47^~b49&b41;s[8]=b8^~b0&b2;s[9]=b9^~b1&b3;s[18]=b18^~b10&b12;s[19]=b19^~b11&b13;s[28]=b28^~b20&b22;s[29]=b29^~b21&b23;s[38]=b38^~b30&b32;s[39]=b39^~b31&b33;s[48]=b48^~b40&b42;s[49]=b49^~b41&b43;s[0]^=ROUND_CONST[n+0];s[1]^=ROUND_CONST[n+1]}}static hash(){return new Keccak}static hmac(bits,pad,len){if(bits==null)bits=256;assert(bits>>>0===bits);const rate=1600-bits*2;assert(rate>=0&&(rate&63)===0);return new HMAC(Keccak,rate>>>3,[bits],[pad,len])}static digest(data,bits,pad,len){return Keccak.ctx.init(bits).update(data).final(pad,len)}static root(left,right,bits,pad,len){if(bits==null)bits=256;if(len==null)len=0;if(len===0)len=bits>>>3;assert(bits>>>0===bits);assert((bits&7)===0);assert(len>>>0===len);assert(bufferExports.Buffer.isBuffer(left)&&left.length===len);assert(bufferExports.Buffer.isBuffer(right)&&right.length===len);return Keccak.ctx.init(bits).update(left).update(right).final(pad,len)}static multi(x,y,z,bits,pad,len){const{ctx}=Keccak;ctx.init(bits);ctx.update(x);ctx.update(y);if(z)ctx.update(z);return ctx.final(pad,len)}static mac(data,key,bits,pad,len){return Keccak.hmac(bits,pad,len).init(key).update(data).final()}}Keccak.native=0;Keccak.id="KECCAK256";Keccak.size=32;Keccak.bits=256;Keccak.blockSize=136;Keccak.zero=bufferExports.Buffer.alloc(32,0);Keccak.ctx=new Keccak;function readU32(data,off){return data[off++]+data[off++]*256+data[off++]*65536+data[off]*16777216}keccak=Keccak;return keccak}var keccakBrowser;var hasRequiredKeccakBrowser;function requireKeccakBrowser(){if(hasRequiredKeccakBrowser)return keccakBrowser;hasRequiredKeccakBrowser=1;keccakBrowser=requireKeccak();return keccakBrowser}var shake;var hasRequiredShake;function requireShake(){if(hasRequiredShake)return shake;hasRequiredShake=1;const Keccak=requireKeccakBrowser();class SHAKE extends Keccak{constructor(){super()}final(len){return super.final(31,len)}static hash(){return new SHAKE}static hmac(bits,len){return super.hmac(bits,31,len)}static digest(data,bits,len){return super.digest(data,bits,31,len)}static root(left,right,bits,len){return super.root(left,right,bits,31,len)}static multi(x,y,z,bits,len){return super.multi(x,y,z,bits,31,len)}static mac(data,key,bits,len){return super.mac(data,key,bits,31,len)}}SHAKE.native=Keccak.native;SHAKE.id="SHAKE256";SHAKE.size=32;SHAKE.bits=256;SHAKE.blockSize=136;SHAKE.zero=bufferExports.Buffer.alloc(32,0);SHAKE.ctx=new SHAKE;shake=SHAKE;return shake}var shake256;var hasRequiredShake256;function requireShake256(){if(hasRequiredShake256)return shake256;hasRequiredShake256=1;const SHAKE=requireShake();class SHAKE256 extends SHAKE{constructor(){super()}init(){return super.init(256)}static hash(){return new SHAKE256}static hmac(len){return super.hmac(256,len)}static digest(data,len){return super.digest(data,256,len)}static root(left,right,len){return super.root(left,right,256,len)}static multi(x,y,z,len){return super.multi(x,y,z,256,len)}static mac(data,key,len){return super.mac(data,key,256,len)}}SHAKE256.native=SHAKE.native;SHAKE256.id="SHAKE256";SHAKE256.size=32;SHAKE256.bits=256;SHAKE256.blockSize=136;SHAKE256.zero=bufferExports.Buffer.alloc(32,0);SHAKE256.ctx=new SHAKE256;shake256=SHAKE256;return shake256}var ed448$1;var hasRequiredEd448;function requireEd448(){if(hasRequiredEd448)return ed448$1;hasRequiredEd448=1;const EDDSA=requireEddsa();const SHAKE256=requireShake256();ed448$1=new EDDSA("ED448","X448","MONT448",SHAKE256);return ed448$1}var ed448Browser;var hasRequiredEd448Browser;function requireEd448Browser(){if(hasRequiredEd448Browser)return ed448Browser;hasRequiredEd448Browser=1;ed448Browser=requireEd448();return ed448Browser}var ed448BrowserExports=requireEd448Browser();var backend=getDefaultExportFromCjs(ed448BrowserExports);const ed448=backend;const BN_0$9=BigInt(0);const BN_1$5=BigInt(1);const maxValue=9007199254740991;function fromTwos(_value,_width){const value=getUint(_value,"value");const width=BigInt(getNumber(_width,"width"));assert(value>>width===BN_0$9,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:_value});if(value>>width-BN_1$5){const mask=(BN_1$5<=-maxValue&&value<=maxValue,"overflow",name||"value",value);return BigInt(value);case"string":try{if(value===""){throw new Error("empty string")}if(value[0]==="-"&&value[1]!=="-"){return-BigInt(value.substring(1))}return BigInt(value)}catch(e){assertArgument(false,`invalid BigNumberish string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid BigNumberish value",name||"value",value)}function getUint(value,name){const result=getBigInt(value,name);assert(result>=BN_0$9,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:value});return result}const Nibbles="0123456789abcdef";function toBigInt(value){if(value instanceof Uint8Array){let result="0x0";for(const v of value){result+=Nibbles[v>>4];result+=Nibbles[v&15]}return BigInt(result)}return getBigInt(value)}function getNumber(value,name){switch(typeof value){case"bigint":assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return Number(value);case"number":assertArgument(Number.isInteger(value),"underflow",name||"value",value);assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return value;case"string":try{if(value===""){throw new Error("empty string")}return getNumber(BigInt(value),name)}catch(e){assertArgument(false,`invalid numeric string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid numeric value",name||"value",value)}function toNumber(value){return getNumber(toBigInt(value))}function toBeHex(_value,_width){const value=getUint(_value,"value");let result=value.toString(16);if(_width==null){if(result.length%2){result="0"+result}}else{const width=getNumber(_width,"width");assert(width*2>=result.length,`value exceeds width (${width} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:_value});while(result.length>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){if(form!=null){assertNormalize(form);str=str.normalize(form)}let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}function toUtf8CodePoints(str,form){return getUtf8CodePoints(toUtf8Bytes(str,form))}async function getUrl(req,_signal){const protocol=req.url.split(":")[0].toLowerCase();assert(protocol==="http"||protocol==="https",`unsupported protocol ${protocol}`,"UNSUPPORTED_OPERATION",{info:{protocol:protocol},operation:"request"});assert(protocol==="https"||!req.credentials||req.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let signal=undefined;if(_signal){const controller=new AbortController;signal=controller.signal;_signal.addListener(()=>{controller.abort()})}const init={method:req.method,headers:new Headers(Array.from(req)),body:req.body||undefined,signal:signal};try{const resp=await fetch(req.url,init);const headers={};resp.headers.forEach((value,key)=>{headers[key.toLowerCase()]=value});const respBody=await resp.arrayBuffer();const body=respBody==null?null:new Uint8Array(respBody);return{statusCode:resp.status,statusMessage:resp.statusText,headers:headers,body:body}}catch(error){console.log({error:error});return undefined}}const MAX_ATTEMPTS=12;const SLOT_INTERVAL=250;let getUrlFunc=getUrl;const reData=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i");const reIpfs=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let locked$5=false;async function dataGatewayFunc(url,signal){try{const match=url.match(reData);if(!match){throw new Error("invalid data")}return new FetchResponse(200,"OK",{"content-type":match[1]||"text/plain"},match[2]?decodeBase64(match[3]):unpercent(match[3]))}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(url))}}function getIpfsGatewayFunc(baseUrl){async function gatewayIpfs(url,signal){try{const match=url.match(reIpfs);if(!match){throw new Error("invalid link")}return new FetchRequest(`${baseUrl}${match[2]}`)}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(url))}}return gatewayIpfs}const Gateways={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")};const fetchSignals=new WeakMap;class FetchCancelSignal{#listeners;#cancelled;constructor(request){this.#listeners=[];this.#cancelled=false;fetchSignals.set(request,()=>{if(this.#cancelled){return}this.#cancelled=true;for(const listener of this.#listeners){setTimeout(()=>{listener()},0)}this.#listeners=[]})}addListener(listener){assert(!this.#cancelled,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"});this.#listeners.push(listener)}get cancelled(){return this.#cancelled}checkSignal(){assert(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(signal){if(signal==null){throw new Error("missing signal; should not happen")}signal.checkSignal();return signal}class FetchRequest{#allowInsecure;#gzip;#headers;#method;#timeout;#url;#body;#bodyType;#creds;#preflight;#process;#retry;#signal;#throttle;get url(){return this.#url}set url(url){this.#url=String(url)}get body(){if(this.#body==null){return null}return new Uint8Array(this.#body)}set body(body){if(body==null){this.#body=undefined;this.#bodyType=undefined}else if(typeof body==="string"){this.#body=toUtf8Bytes(body);this.#bodyType="text/plain"}else if(body instanceof Uint8Array){this.#body=body;this.#bodyType="application/octet-stream"}else if(typeof body==="object"){this.#body=toUtf8Bytes(JSON.stringify(body));this.#bodyType="application/json"}else{throw new Error("invalid body")}}hasBody(){return this.#body!=null}get method(){if(this.#method){return this.#method}if(this.hasBody()){return"POST"}return"GET"}set method(method){if(method==null){method=""}this.#method=String(method).toUpperCase()}get headers(){const headers=Object.assign({},this.#headers);if(this.#creds){headers["authorization"]=`Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`}if(this.allowGzip){headers["accept-encoding"]="gzip"}if(headers["content-type"]==null&&this.#bodyType){headers["content-type"]=this.#bodyType}if(this.body){headers["content-length"]=String(this.body.length)}return headers}getHeader(key){return this.headers[key.toLowerCase()]}setHeader(key,value){this.#headers[String(key).toLowerCase()]=String(value)}clearHeaders(){this.#headers={}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index=0,"timeout must be non-zero","timeout",timeout);this.#timeout=timeout}get preflightFunc(){return this.#preflight||null}set preflightFunc(preflight){this.#preflight=preflight}get processFunc(){return this.#process||null}set processFunc(process){this.#process=process}get retryFunc(){return this.#retry||null}set retryFunc(retry){this.#retry=retry}constructor(url){this.#url=String(url);this.#allowInsecure=false;this.#gzip=true;this.#headers={};this.#method="";this.#timeout=3e5;this.#throttle={slotInterval:SLOT_INTERVAL,maxAttempts:MAX_ATTEMPTS}}toString(){return``}setThrottleParams(params){if(params.slotInterval!=null){this.#throttle.slotInterval=params.slotInterval}if(params.maxAttempts!=null){this.#throttle.maxAttempts=params.maxAttempts}}async#send(attempt,expires,delay,_request,_response){if(attempt>=this.#throttle.maxAttempts){return _response.makeServerError("exceeded maximum retry limit")}assert(getTime$2()<=expires,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:_request});if(delay>0){await wait(delay)}let req=this.clone();const scheme=(req.url.split(":")[0]||"").toLowerCase();if(scheme in Gateways){const result=await Gateways[scheme](req.url,checkSignal(_request.#signal));if(result instanceof FetchResponse){let response=result;if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}}}return response}req=result}if(this.preflightFunc){req=await this.preflightFunc(req)}const resp=await getUrlFunc(req,checkSignal(_request.#signal));let response=new FetchResponse(resp.statusCode,resp.statusMessage,resp.headers,resp.body,_request);if(response.statusCode===301||response.statusCode===302){try{const location=response.headers.location||"";return req.redirect(location).#send(attempt+1,expires,0,_request,response)}catch(error){}return response}else if(response.statusCode===429){if(this.retryFunc==null||await this.retryFunc(req,response,attempt)){const retryAfter=response.headers["retry-after"];let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(typeof retryAfter==="string"&&retryAfter.match(/^[1-9][0-9]*$/)){delay=parseInt(retryAfter)}return req.clone().#send(attempt+1,expires,delay,_request,response)}}if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(error.stall>=0){delay=error.stall}return req.clone().#send(attempt+1,expires,delay,_request,response)}}return response}send(){assert(this.#signal==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"});this.#signal=new FetchCancelSignal(this);return this.#send(0,getTime$2()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){assert(this.#signal!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const signal=fetchSignals.get(this);if(!signal){throw new Error("missing signal; should not happen")}signal()}redirect(location){const current=this.url.split(":")[0].toLowerCase();const target=location.split(":")[0].toLowerCase();assert(this.method==="GET"&&(current!=="https"||target!=="http")&&location.match(/^https?:/),`unsupported redirect`,"UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`});const req=new FetchRequest(location);req.method="GET";req.allowGzip=this.allowGzip;req.timeout=this.timeout;req.#headers=Object.assign({},this.#headers);if(this.#body){req.#body=new Uint8Array(this.#body)}req.#bodyType=this.#bodyType;return req}clone(){const clone=new FetchRequest(this.url);clone.#method=this.#method;if(this.#body){clone.#body=this.#body}clone.#bodyType=this.#bodyType;clone.#headers=Object.assign({},this.#headers);clone.#creds=this.#creds;if(this.allowGzip){clone.allowGzip=true}clone.timeout=this.timeout;if(this.allowInsecureAuthentication){clone.allowInsecureAuthentication=true}clone.#preflight=this.#preflight;clone.#process=this.#process;clone.#retry=this.#retry;return clone}static lockConfig(){locked$5=true}static getGateway(scheme){return Gateways[scheme.toLowerCase()]||null}static registerGateway(scheme,func){scheme=scheme.toLowerCase();if(scheme==="http"||scheme==="https"){throw new Error(`cannot intercept ${scheme}; use registerGetUrl`)}if(locked$5){throw new Error("gateways locked")}Gateways[scheme]=func}static registerGetUrl(getUrl){if(locked$5){throw new Error("gateways locked")}getUrlFunc=getUrl}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(baseUrl){return getIpfsGatewayFunc(baseUrl)}}class FetchResponse{#statusCode;#statusMessage;#headers;#body;#request;#error;toString(){return``}get statusCode(){return this.#statusCode}get statusMessage(){return this.#statusMessage}get headers(){return Object.assign({},this.#headers)}get body(){return this.#body==null?null:new Uint8Array(this.#body)}get bodyText(){try{return this.#body==null?"":toUtf8String(this.#body)}catch(error){assert(false,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(error){assert(false,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index{accum[k.toLowerCase()]=String(headers[k]);return accum},{});this.#body=body==null?null:new Uint8Array(body);this.#request=request||null;this.#error={message:""}}makeServerError(message,error){let statusMessage;if(!message){message=`${this.statusCode} ${this.statusMessage}`;statusMessage=`CLIENT ESCALATED SERVER ERROR (${message})`}else{statusMessage=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`}const response=new FetchResponse(599,statusMessage,this.headers,this.body,this.#request||undefined);response.#error={message:message,error:error};return response}throwThrottleError(message,stall){if(stall==null){stall=-1}else{assertArgument(Number.isInteger(stall)&&stall>=0,"invalid stall timeout","stall",stall)}const error=new Error(message||"throttling requests");defineProperties(error,{stall:stall,throttle:true});throw error}getHeader(key){return this.headers[key.toLowerCase()]}hasBody(){return this.#body!=null}get request(){return this.#request}ok(){return this.#error.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok()){return}let{message,error}=this.#error;if(message===""){message=`server response ${this.statusCode} ${this.statusMessage}`}assert(false,message,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:error})}}function getTime$2(){return(new Date).getTime()}function unpercent(value){return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi,(all,code)=>{return String.fromCharCode(parseInt(code,16))}))}function wait(delay){return new Promise(resolve=>setTimeout(resolve,delay))}var _a$1;const BN_N1=BigInt(-1);const BN_0$7=BigInt(0);const BN_1$4=BigInt(1);const BN_5=BigInt(5);const _guard$5={};let Zeros="0000";while(Zeros.length<80){Zeros+=Zeros}function getTens(decimals){let result=Zeros;while(result.length=-limit&&valBN_0$7){val=fromTwos(mask(val,width),width)}else{val=-fromTwos(mask(-val,width),width)}}else{const limit=BN_1$4<=0&&val{if(v[key]==null){return defaultValue}assertArgument(typeof v[key]===type,"invalid fixed format ("+key+" not "+type+")","format."+key,v[key]);return v[key]};signed=check("signed","boolean",signed);width=check("width","number",width);decimals=check("decimals","number",decimals)}assertArgument(width%8===0,"invalid FixedNumber width (not byte aligned)","format.width",width);assertArgument(decimals<=80,"invalid FixedNumber decimals (too large)","format.decimals",decimals);const name=(signed?"":"u")+"fixed"+String(width)+"x"+String(decimals);return{signed:signed,width:width,decimals:decimals,name:name}}function toString(val,decimals){let negative="";if(val0){b*=getTens(delta)}else if(delta<0){a*=getTens(-delta)}if(ab){return-1}return 0}eq(other){return this.cmp(other)===0}lt(other){return this.cmp(other)<0}lte(other){return this.cmp(other)<=0}gt(other){return this.cmp(other)>0}gte(other){return this.cmp(other)>=0}floor(){let val=this.#val;if(this.#valBN_0$7){val+=this.#tens-BN_1$4}val=this.#val/this.#tens*this.#tens;return this.#checkValue(val,"ceiling")}round(decimals){if(decimals==null){decimals=0}if(decimals>=this.decimals){return this}const delta=this.decimals-decimals;const bump=BN_5*getTens(delta-1);let value=this.value+bump;const tens=getTens(delta);value=value/tens*tens;checkValue(value,this.#format,"round");return new _a$1(_guard$5,value,this.#format)}isZero(){return this.#val===BN_0$7}isNegative(){return this.#val0){const tens=getTens(delta);assert(value%tens===BN_0$7,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:_value});value/=tens}else if(delta<0){value*=getTens(-delta)}checkValue(value,format,"fromValue");return new _a$1(_guard$5,value,format)}static fromString(_value,_format){const match=_value.match(/^(-?)([0-9]*)\.?([0-9]*)$/);assertArgument(match&&match[2].length+match[3].length>0,"invalid FixedNumber string value","value",_value);const format=getFormat(_format);let whole=match[2]||"0",decimal=match[3]||"";while(decimal.length{assert(offset<=data.length,"data short segment too short","BUFFER_OVERRUN",{buffer:data,length:data.length,offset:offset})};if(data[offset]>=248){const lengthLength=data[offset]-247;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);return _decodeChildren(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;checkOffset(offset+1+length);return _decodeChildren(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;checkOffset(offset+1+length);const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlifyByte(data[offset])}}function decodeRlp(_data){const data=getBytes(_data,"data");const decoded=_decode(data,0);assertArgument(decoded.consumed===data.length,"unexpected junk after rlp payload","data",_data);return decoded.result}function arrayifyInteger(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function _encode(object){if(Array.isArray(object)){let payload=[];object.forEach(function(child){payload=payload.concat(_encode(child))});if(payload.length<=55){payload.unshift(192+payload.length);return payload}const length=arrayifyInteger(payload.length);length.unshift(247+length.length);return length.concat(payload)}const data=Array.prototype.slice.call(getBytes(object,"object"));if(data.length===1&&data[0]<=127){return data}else if(data.length<=55){data.unshift(128+data.length);return data}const length=arrayifyInteger(data.length);length.unshift(183+length.length);return length.concat(data)}const nibbles="0123456789abcdef";function encodeRlp(object){let result="0x";for(const v of _encode(object)){result+=nibbles[v>>4];result+=nibbles[v&15]}return result}const names=["ore","fecore","picore","nacore","mcore","micore","core"];function formatUnits(value,unit){let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromValue(value,decimals,{decimals:decimals}).toString()}const scientificToDecimal=num=>{var nsign=Math.sign(num);num=Math.abs(num);if(/\d+\.?\d*e[\+\-]*\d+/i.test(num)){var zero="0",parts=String(num).toLowerCase().split("e"),e=parts.pop(),l=Math.abs(e),sign=e/l,coeff_array=parts[0].split(".");if(sign===-1){l=l-coeff_array[0].length;if(l<0){num=coeff_array[0].slice(0,l)+"."+coeff_array[0].slice(l)+(coeff_array.length===2?coeff_array[1]:"")}else{num=zero+"."+new Array(l+1).join(zero)+coeff_array.join("")}}else{var dec=coeff_array[1];if(dec)l=l-dec.length;if(l<0){num=coeff_array[0]+dec.slice(0,l)+"."+dec.slice(l)}else{num=coeff_array.join("")+new Array(l+1).join(zero)}}}return nsign<0?"-"+num:num};const trimDecimals=(n,decimals=18)=>{n+="";if(n.indexOf(".")===-1)return n;const arr=n.split(".");const fraction=arr[1].substr(0,decimals);return arr[0]+"."+fraction};function parseUnits(value,unit){assertArgument(typeof value==="string","value must be a string","value",value);if(value.includes("e")){value=scientificToDecimal(value).toString()}let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index;value=trimDecimals(value,decimals)}else if(unit!=null){decimals=getNumber(unit,"unit");value=trimDecimals(value,decimals)}return FixedNumber.fromString(value,{decimals:decimals}).value}function formatXCB(ore){return formatUnits(ore,18)}function parseXCB(xcb){return parseUnits(xcb,18)}function uuidV4(randomBytes){const bytes=getBytes(randomBytes,"randomBytes");bytes[6]=bytes[6]&15|64;bytes[8]=bytes[8]&63|128;const value=hexlify(bytes);return[value.substring(2,10),value.substring(10,14),value.substring(14,18),value.substring(18,22),value.substring(22,34)].join("-")}var pbkdf2$2={};var hasRequiredPbkdf2;function requirePbkdf2(){if(hasRequiredPbkdf2)return pbkdf2$2;hasRequiredPbkdf2=1;const assert=requireAssert();const crypto=commonjsGlobal.crypto||commonjsGlobal.msCrypto||{};const subtle=crypto.subtle||{};function derive(hash,pass,salt,iter,len){if(typeof pass==="string")pass=bufferExports.Buffer.from(pass,"utf8");if(typeof salt==="string")salt=bufferExports.Buffer.from(salt,"utf8");if(salt==null)salt=bufferExports.Buffer.alloc(0);assert(hash&&typeof hash.id==="string");assert(bufferExports.Buffer.isBuffer(pass));assert(bufferExports.Buffer.isBuffer(salt));assert(iter>>>0===iter);assert(len>>>0===len);const size=hash.size;const blocks=Math.ceil(len/size);const out=bufferExports.Buffer.alloc(blocks*size);const state=bufferExports.Buffer.alloc(salt.length+4);salt.copy(state,0);if(pass.length>hash.blockSize){pass=hash.digest(pass);assert(pass.length<=hash.blockSize)}for(let i=0;i>>24;state[salt.length+1]=round>>>16;state[salt.length+2]=round>>>8;state[salt.length+3]=round;const block=hash.mac(state,pass);let mac=block;for(let j=1;j>>0===iter);assert(len>>>0===len);const name=getHash(hash);if(!subtle.importKey||!subtle.deriveBits||!name)return derive(hash,pass,salt,iter,len);const algo={name:"PBKDF2"};const use=["deriveBits"];const options={name:"PBKDF2",salt:salt,iterations:iter,hash:name};const key=await subtle.importKey("raw",pass,algo,false,use);const out=await subtle.deriveBits(options,key,len*8);return bufferExports.Buffer.from(out)}function getHash(hash){switch(hash.id){case"SHA1":return"SHA-1";case"SHA256":return"SHA-256";case"SHA384":return"SHA-384";case"SHA512":return"SHA-512";default:return null}}pbkdf2$2.native=0;pbkdf2$2.derive=derive;pbkdf2$2.deriveAsync=deriveAsync;return pbkdf2$2}var pbkdf2Browser;var hasRequiredPbkdf2Browser;function requirePbkdf2Browser(){if(hasRequiredPbkdf2Browser)return pbkdf2Browser;hasRequiredPbkdf2Browser=1;pbkdf2Browser=requirePbkdf2();return pbkdf2Browser}var pbkdf2BrowserExports=requirePbkdf2Browser();var pbkdf2$1=getDefaultExportFromCjs(pbkdf2BrowserExports);var sha3;var hasRequiredSha3;function requireSha3(){if(hasRequiredSha3)return sha3;hasRequiredSha3=1;const Keccak=requireKeccak();class SHA3 extends Keccak{constructor(){super()}final(){return super.final(6,null)}static hash(){return new SHA3}static hmac(bits){return super.hmac(bits,6,null)}static digest(data,bits){return super.digest(data,bits,6,null)}static root(left,right,bits){return super.root(left,right,bits,6,null)}static multi(x,y,z,bits){return super.multi(x,y,z,bits,6,null)}static mac(data,key,bits){return super.mac(data,key,bits,6,null)}}SHA3.native=0;SHA3.id="SHA3_256";SHA3.size=32;SHA3.bits=256;SHA3.blockSize=136;SHA3.zero=bufferExports.Buffer.alloc(32,0);SHA3.ctx=new SHA3;sha3=SHA3;return sha3}var sha3Browser;var hasRequiredSha3Browser;function requireSha3Browser(){if(hasRequiredSha3Browser)return sha3Browser;hasRequiredSha3Browser=1;sha3Browser=requireSha3();return sha3Browser}var sha3512;var hasRequiredSha3512;function requireSha3512(){if(hasRequiredSha3512)return sha3512;hasRequiredSha3512=1;const SHA3=requireSha3Browser();class SHA3_512 extends SHA3{constructor(){super()}init(){return super.init(512)}static hash(){return new SHA3_512}static hmac(){return super.hmac(512)}static digest(data){return super.digest(data,512)}static root(left,right){return super.root(left,right,512)}static multi(x,y,z){return super.multi(x,y,z,512)}static mac(data,key){return super.mac(data,key,512)}}SHA3_512.native=SHA3.native;SHA3_512.id="SHA3_512";SHA3_512.size=64;SHA3_512.bits=512;SHA3_512.blockSize=72;SHA3_512.zero=bufferExports.Buffer.alloc(64,0);SHA3_512.ctx=new SHA3_512;sha3512=SHA3_512;return sha3512}var sha3512Exports=requireSha3512();var SHA3_512=getDefaultExportFromCjs(sha3512Exports);class Ed448Goldilock{static _channel=ed448;static generatePrivateKey(){var privateKey=ed448.privateKeyGenerate();privateKey[56]&=127;return privateKey}static getPublicKeyFromPrivateKey(privateKey){var secret=bufferExports.Buffer.from(privateKey,"hex");if(secret[56]>127){var scalar=secret.slice(0,56);scalar[0]&=252;scalar[55]|=128;var publicKey=this._channel.publicKeyFromScalar(scalar);return bufferExports.Buffer.from(publicKey).toString("hex")}else{var publicKey=this._channel.publicKeyCreate(secret);return bufferExports.Buffer.from(publicKey).toString("hex")}}static signWithPrivateKey(privateKey,msg){var msgToSign=bufferExports.Buffer.from(msg,"hex");var secret=bufferExports.Buffer.from(privateKey,"hex");if(secret[56]>127){var prefix=secret.slice(0,57);prefix[0]&=252;prefix[56]=0;prefix[55]|=128;var scalar=prefix.slice(0,56);var signedMessage=this._channel.signWithScalar(msgToSign,scalar,prefix);return bufferExports.Buffer.from(signedMessage).toString("hex")}else{var signedMessage=this._channel.sign(msgToSign,secret);return bufferExports.Buffer.from(signedMessage).toString("hex")}}static signWithPrivateKeyNConcatPubkey(privateKey,msg){var signedMessage=Ed448Goldilock.signWithPrivateKey(privateKey,msg);var publicKey=Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);return signedMessage+publicKey}static verifySignature(msgHash,signedMsg,pubKey){return this._channel.verify(bufferExports.Buffer.from(msgHash,"hex"),bufferExports.Buffer.from(signedMsg,"hex"),bufferExports.Buffer.from(pubKey,"hex"))}static SHA512Hash(password,salt){var p1=bufferExports.Buffer.from(password,"hex");var s1=bufferExports.Buffer.from(salt,"hex");return bufferExports.Buffer.from(pbkdf2$1.derive(SHA3_512,p1,s1,2048,57)).toString("hex")}static concatenateAndHex(prefix,key,index,salt){var ind=bufferExports.Buffer.alloc(4);var p=bufferExports.Buffer.alloc(1);p[0]=prefix%256;var j=index;for(let i=0;i<4;i++){ind[i]=j%256;j=Math.floor(j/256)}var t=p.toString("hex")+key+ind.toString("hex");return Ed448Goldilock.SHA512Hash(t,salt)}static addScalar(a,b){var a1=bufferExports.Buffer.from(a,"hex");var b1=bufferExports.Buffer.from(b.substr(0,106)+"00000000","hex");b1[0]&=252;var c=bufferExports.Buffer.alloc(57);var hold=0;for(let i=0;i<57;i++){hold+=a1[i]+b1[i];c[i]=hold%256;hold=Math.floor(hold/256)}return c.toString("hex")}static seedToExtendedPrivate(seed){var s1=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f72746865636861696e");var s2=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f727468656b6579");var b=bufferExports.Buffer.from(s2,"hex");b[56]|=128;b[55]|=128;b[55]&=191;var s3=b.toString("hex");return s1+s3}static childPrivateToPrivate(s,index){var s0=s.substr(0,114);var s1=s.substr(114,228);var r0,r1;if(index>=2147483648){r0=Ed448Goldilock.concatenateAndHex(1,s1,index,s0);r1=Ed448Goldilock.concatenateAndHex(0,s1,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}else{var pub=Ed448Goldilock.getPublicKeyFromPrivateKey(s1);r0=Ed448Goldilock.concatenateAndHex(3,pub,index,s0);r1=Ed448Goldilock.concatenateAndHex(2,pub,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}}static HDWalletGenerateKeyFromSeed(seed,index){var m=Ed448Goldilock.seedToExtendedPrivate(seed);var k1=Ed448Goldilock.childPrivateToPrivate(m,2147483648+44);var k2=Ed448Goldilock.childPrivateToPrivate(k1,2147483648+654);var k3=Ed448Goldilock.childPrivateToPrivate(k2,2147483648+0);var k4=Ed448Goldilock.childPrivateToPrivate(k3,2147483648+0);var k5=Ed448Goldilock.childPrivateToPrivate(k4,index);return k5.substr(114,228)}}function getGlobal$1(){if(typeof globalThis!=="undefined")return globalThis;if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal$1();const crypto=anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"ripemd160":return ripemd160$1.create();case"sha256":return sha256$2.create();case"sha512":return sha512$1.create();case"sha3-256":return sha3_256.create();case"sha3-512":return sha3_512.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}function createHmac(_algo,key){const algo={sha256:sha256$2,sha512:sha512$1,"sha3-256":sha3_256,"sha3-512":sha3_512}[_algo];assertArgument(algo!=null,"invalid hmac algorithm","algorithm",_algo);return hmac$1.create(algo,key)}function pbkdf2Sync(password,salt,iterations,keylen,_algo){const algo={sha256:sha256$2,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid pbkdf2 algorithm","algorithm",_algo);return pbkdf2$3(algo,password,salt,{c:iterations,dkLen:keylen})}function randomBytes$1(length){assert(crypto!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});assertArgument(Number.isInteger(length)&&length>0&&length<=1024,"invalid length","length",length);const result=new Uint8Array(length);crypto.getRandomValues(result);return result}const _sha256=data=>hexlify(createHash("sha3-256").update(data).digest());const _sha512=data=>hexlify(createHash("sha3-512").update(data).digest());let __sha256=_sha256;let __sha512=_sha512;let locked256=false,locked512=false;var SupportedAlgorithm;(function(SupportedAlgorithm){SupportedAlgorithm["sha256"]="sha256";SupportedAlgorithm["sha512"]="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));function sha256(data){return hexlify(__sha256(getBytes(data)))}function legacySha256(data){const _data=getBytes(data,"data");const hexlified=hexlify(createHash("sha256").update(_data).digest());return hexlified}sha256._=_sha256;sha256.lock=function(){locked256=true};sha256.register=function(func){if(locked256){throw new Error("sha256 is locked")}__sha256=func};Object.freeze(sha256);function sha512(data){return hexlify(__sha512(getBytes(data)))}sha512._=_sha512;sha512.lock=function(){locked512=true};sha512.register=function(func){if(locked512){throw new Error("sha512 is locked")}__sha512=func};Object.freeze(sha512);const logger$3=new Logger("address/0.0.1");const precompiledAddresses=["0000000000000000000000000000000000000000000000000000000000000000","0000000000000000000000000000000000000000000000000000000000000001","0000000000000000000000000000000000000000000000000000000000000002","0000000000000000000000000000000000000000000000000000000000000003","0000000000000000000000000000000000000000000000000000000000000004","0000000000000000000000000000000000000000000000000000000000000005","0000000000000000000000000000000000000000000000000000000000000006","0000000000000000000000000000000000000000000000000000000000000007","0000000000000000000000000000000000000000000000000000000000000008","0000000000000000000000000000000000000000000000000000000000000009"];function removeHexPrefix$1(val){return val.substring(0,2)==="0x"?val.substring(2):val}function calculateCheckSum(_address,_prefix){const address=getBytes("0x"+_address.replace("0x",""));const prefix=getBytes("0x"+_prefix.replace("0x",""));const tmpConcated=new Uint8Array([...address,...prefix]);const hexedConcat=hexlify(tmpConcated).replace("0x","")+"00";const mods=Array.from(hexedConcat.toUpperCase(),c=>{const charCode=c.charCodeAt(0);return charCode>64&&charCode<91?(charCode-55).toString():(charCode-48).toString()}).join("");const bigVal=BigInt(mods);const val97=BigInt(97);const val98=BigInt(98);const remainder=bigVal%val97;const checkSum=val98-remainder;const result=checkSum>9?checkSum.toString():"0"+checkSum.toString();return result}function getAddress(address){if(typeof address!=="string"){logger$3.throwArgumentError("invalid address","address",address)}if(!address.match(/^(0x)?[0-9a-fA-F]{44}$/)){logger$3.throwArgumentError("invalid address","address",address)}const raw=removeHexPrefix$1(address);if(precompiledAddresses.includes(raw)){return"0x"+raw}const prefix=raw.substring(0,2);const val=raw.substring(4);const checksum=calculateCheckSum(val,prefix);if(checksum!==raw.substring(2,4)){logger$3.throwArgumentError("bad address checksum","address",address)}return"0x"+prefix+checksum+val}function networkIdToPrefix(networkId){if(networkId==1){return"cb"}else if(networkId==3||networkId==4){return"ab"}else if(networkId>10||networkId==0){return"ce"}else{logger$3.throwArgumentError("bad networkId","networkId",networkId);return""}}let locked$4=false;const _computeHmac=function(algorithm,key,data){return createHmac(algorithm,key).update(data).digest()};let __computeHmac=_computeHmac;function computeHmac(algorithm,_key,_data){const key=getBytes(_key,"key");const data=getBytes(_data,"data");return hexlify(__computeHmac(algorithm,key,data))}computeHmac._=_computeHmac;computeHmac.lock=function(){locked$4=true};computeHmac.register=function(func){if(locked$4){throw new Error("computeHmac is locked")}__computeHmac=func};Object.freeze(computeHmac);let locked$3=false;const _ripemd160=function(data){return ripemd160$1(data)};let __ripemd160=_ripemd160;function ripemd160(_data){const data=getBytes(_data,"data");return hexlify(__ripemd160(data))}ripemd160._=_ripemd160;ripemd160.lock=function(){locked$3=true};ripemd160.register=function(func){if(locked$3){throw new TypeError("ripemd160 is locked")}__ripemd160=func};Object.freeze(ripemd160);let locked$2=false;const _pbkdf2=function(password,salt,iterations,keylen,algo){return pbkdf2Sync(password,salt,iterations,keylen,algo)};let __pbkdf2=_pbkdf2;function pbkdf2(_password,_salt,iterations,keylen,algo){const password=getBytes(_password,"password");const salt=getBytes(_salt,"salt");return hexlify(__pbkdf2(password,salt,iterations,keylen,algo))}pbkdf2._=_pbkdf2;pbkdf2.lock=function(){locked$2=true};pbkdf2.register=function(func){if(locked$2){throw new Error("pbkdf2 is locked")}__pbkdf2=func};Object.freeze(pbkdf2);let locked$1=false;const _randomBytes=function(length){return new Uint8Array(randomBytes$1(length))};let __randomBytes=_randomBytes;function randomBytes(length){return __randomBytes(length)}randomBytes._=_randomBytes;randomBytes.lock=function(){locked$1=true};randomBytes.register=function(func){if(locked$1){throw new Error("randomBytes is locked")}__randomBytes=func};Object.freeze(randomBytes);function XorAndSalsa(prev,pi,input,ii,out,oi){let y00=prev[pi++]^input[ii++],y01=prev[pi++]^input[ii++];let y02=prev[pi++]^input[ii++],y03=prev[pi++]^input[ii++];let y04=prev[pi++]^input[ii++],y05=prev[pi++]^input[ii++];let y06=prev[pi++]^input[ii++],y07=prev[pi++]^input[ii++];let y08=prev[pi++]^input[ii++],y09=prev[pi++]^input[ii++];let y10=prev[pi++]^input[ii++],y11=prev[pi++]^input[ii++];let y12=prev[pi++]^input[ii++],y13=prev[pi++]^input[ii++];let y14=prev[pi++]^input[ii++],y15=prev[pi++]^input[ii++];let x00=y00,x01=y01,x02=y02,x03=y03,x04=y04,x05=y05,x06=y06,x07=y07,x08=y08,x09=y09,x10=y10,x11=y11,x12=y12,x13=y13,x14=y14,x15=y15;for(let i=0;i<8;i+=2){x04^=rotl(x00+x12|0,7);x08^=rotl(x04+x00|0,9);x12^=rotl(x08+x04|0,13);x00^=rotl(x12+x08|0,18);x09^=rotl(x05+x01|0,7);x13^=rotl(x09+x05|0,9);x01^=rotl(x13+x09|0,13);x05^=rotl(x01+x13|0,18);x14^=rotl(x10+x06|0,7);x02^=rotl(x14+x10|0,9);x06^=rotl(x02+x14|0,13);x10^=rotl(x06+x02|0,18);x03^=rotl(x15+x11|0,7);x07^=rotl(x03+x15|0,9);x11^=rotl(x07+x03|0,13);x15^=rotl(x11+x07|0,18);x01^=rotl(x00+x03|0,7);x02^=rotl(x01+x00|0,9);x03^=rotl(x02+x01|0,13);x00^=rotl(x03+x02|0,18);x06^=rotl(x05+x04|0,7);x07^=rotl(x06+x05|0,9);x04^=rotl(x07+x06|0,13);x05^=rotl(x04+x07|0,18);x11^=rotl(x10+x09|0,7);x08^=rotl(x11+x10|0,9);x09^=rotl(x08+x11|0,13);x10^=rotl(x09+x08|0,18);x12^=rotl(x15+x14|0,7);x13^=rotl(x12+x15|0,9);x14^=rotl(x13+x12|0,13);x15^=rotl(x14+x13|0,18)}out[oi++]=y00+x00|0;out[oi++]=y01+x01|0;out[oi++]=y02+x02|0;out[oi++]=y03+x03|0;out[oi++]=y04+x04|0;out[oi++]=y05+x05|0;out[oi++]=y06+x06|0;out[oi++]=y07+x07|0;out[oi++]=y08+x08|0;out[oi++]=y09+x09|0;out[oi++]=y10+x10|0;out[oi++]=y11+x11|0;out[oi++]=y12+x12|0;out[oi++]=y13+x13|0;out[oi++]=y14+x14|0;out[oi++]=y15+x15|0}function BlockMix(input,ii,out,oi,r){let head=oi+0;let tail=oi+16*r;for(let i=0;i<16;i++)out[tail+i]=input[ii+(2*r-1)*16+i];for(let i=0;i0)tail+=16;XorAndSalsa(out,head,input,ii+=16,out,tail)}}const SCRYPT_DEFAULT_MAXMEM=128*8*(2**20+1+1);function scryptInit(password,salt,_opts){const opts=checkOpts({dkLen:32,asyncTick:10,maxmem:SCRYPT_DEFAULT_MAXMEM},_opts);const{N,r,p,dkLen,asyncTick,maxmem,onProgress}=opts;anumber(N,"N");anumber(r,"r");anumber(p,"p");anumber(dkLen,"dkLen");anumber(asyncTick,"asyncTick");anumber(maxmem,"maxmem");if(onProgress!==undefined&&typeof onProgress!=="function")throw new Error('"onProgress" must be a function');if(r<1)throw new Error('"r" expected integer >= 1');const blockSize=128*r;const blockSize32=blockSize/4;const pow32=Math.pow(2,32);if(N<=1||(N&N-1)!==0||N>pow32)throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32');if(p<1||p>(pow32-1)*32/blockSize)throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)');if(dkLen<1||dkLen>(pow32-1)*32)throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32');const memUsed=blockSize*(N+p+1);if(memUsed>maxmem)throw new Error('"maxmem" limit was hit: memUsed(128*r*(N+p+1))='+memUsed+", maxmem="+maxmem);const B=pbkdf2$3(sha256$2,password,salt,{c:1,dkLen:blockSize*p});const B32=u32(B);const V=u32(new Uint8Array(blockSize*N));const tmp=u32(new Uint8Array(blockSize));let blockMixCb=()=>{};if(onProgress){const totalBlockMix=2*N*p;const callbackPer=Math.max(Math.floor(totalBlockMix/1e4),1);let blockMixCnt=0;blockMixCb=()=>{blockMixCnt++;if(onProgress&&(!(blockMixCnt%callbackPer)||blockMixCnt===totalBlockMix)){try{onProgress(blockMixCnt/totalBlockMix)}catch(e){clean(B,V,tmp);throw e}}}}return{N:N,r:r,p:p,dkLen:dkLen,blockSize32:blockSize32,V:V,B32:B32,B:B,tmp:tmp,blockMixCb:blockMixCb,asyncTick:asyncTick}}function scryptOutput(password,dkLen,B,V,tmp){const res=pbkdf2$3(sha256$2,password,B,{c:1,dkLen:dkLen});clean(B,V,tmp);return res}function scrypt$1(password,salt,opts){const{N,r,p,dkLen,blockSize32,V,B32,B,tmp,blockMixCb}=scryptInit(password,salt,opts);swap32IfBE(B32);for(let pi=0;pi>>0;for(let k=0;kclean(B,V,tmp);swap32IfBE(B32);for(let pi=0;pi{BlockMix(V,pos,V,pos+=blockSize32,r);blockMixCb()},abort);BlockMix(V,(N-1)*blockSize32,B32,Pi,r);blockMixCb();await asyncLoop(N,asyncTick,()=>{const j=(B32[Pi+blockSize32-16]&N-1)>>>0;for(let k=0;k127){const prefix=keyBuffer.slice(0,57);prefix[0]&=252;prefix[55]|=128;prefix[56]=0;const scalar=prefix.slice(0,56);const bufferDigest=bufferExports.Buffer.from(digestBuffer);const bufferPrfx=bufferExports.Buffer.from(prefix);const bufferScalar=bufferExports.Buffer.from(scalar);const sig=ed448.signWithScalar(bufferDigest,bufferScalar,bufferPrfx);const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}const sig=ed448.sign(bufferExports.Buffer.from(digestBuffer),bufferExports.Buffer.from(keyBuffer));const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}computeSharedSecret(other){const pub=bufferExports.Buffer.from(getBytesCopy(other));assertArgument(pub.length===57&&ed448.publicKeyVerify(pub),"invalid public key","other",other);const key=bufferExports.Buffer.from(getBytesCopy(this.#privateKey));if(key[56]>127){const scalar=key.subarray(0,56);scalar[0]&=252;scalar[55]|=128;return hexlify(ed448.deriveWithScalar(pub,scalar))}return hexlify(ed448.derive(pub,key))}static computePublicKey(key,compressed){const bytes=bufferExports.Buffer.from(arrayify(key));if(bytes.length!==57){logger$2.throwArgumentError("invalid private key","key","[REDACTED]")}if(bytes[56]>127){const scalar=bytes.slice(0,56);scalar[0]&=252;scalar[55]|=128;const pub=ed448.publicKeyFromScalar(scalar);return hexlify(pub)}const pub=ed448.publicKeyCreate(bytes);return hexlify(pub)}static recoverPublicKey(digest,signature){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const digestBuffer=bufferExports.Buffer.from(arrayify(digest));const sigBuffer=bufferExports.Buffer.from(arrayify(signature));if(sigBuffer.length!==171){logger$2.throwArgumentError("invalid signature","signature",signature)}const sig=sigBuffer.slice(0,114);const pub=sigBuffer.slice(114);if(ed448.verify(digestBuffer,sig,pub)){return hexlify(pub)}logger$2.throwArgumentError("invalid signature","signature",signature);return""}static addPoints(p0,p1,compressed){const points=[p0,p1].map(point=>{const bytes=bufferExports.Buffer.from(getBytesCopy(point));assertArgument(bytes.length===57&&ed448.publicKeyVerify(bytes),"invalid public key","point",point);return bytes});return hexlify(ed448.publicKeyCombine(points))}}const BN_0$6=BigInt(0);const BN_1$3=BigInt(1);const BN_2$1=BigInt(2);const BN_27=BigInt(27);const BN_28=BigInt(28);const BN_35=BigInt(35);const _guard$4={};class Signature{#r;#s;#v;#networkV;get r(){return this.#r}set r(value){assertArgument(dataLength(value)===32,"invalid r","value",value);this.#r=hexlify(value)}get s(){return this.#s}set s(_value){assertArgument(dataLength(_value)===32,"invalid s","value",_value);const value=hexlify(_value);assertArgument(parseInt(value.substring(0,3))<8,"non-canonical s","value",value);this.#s=value}get v(){return this.#v}set v(value){const v=getNumber(value,"value");assertArgument(v===27||v===28,"invalid v","v",value);this.#v=v}get networkV(){return this.#networkV}get legacynetworkId(){const v=this.networkV;if(v==null){return null}return Signature.getnetworkId(v)}get yParity(){return this.v===27?0:1}get yParityAndS(){const yParityAndS=getBytes(this.s);if(this.yParity){yParityAndS[0]|=128}return hexlify(yParityAndS)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(guard,r,s,v){assertPrivate(guard,_guard$4,"Signature");this.#r=r;this.#s=s;this.#v=v;this.#networkV=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const clone=new Signature(_guard$4,this.r,this.s,this.v);if(this.networkV){clone.#networkV=this.networkV}return clone}toJSON(){const networkV=this.networkV;return{_type:"signature",networkV:networkV!=null?networkV.toString():null,r:this.r,s:this.s,v:this.v}}static getnetworkId(v){const bv=getBigInt(v,"v");if(bv==BN_27||bv==BN_28){return BN_0$6}assertArgument(bv>=BN_35,"invalid EIP-155 v","v",v);return(bv-BN_35)/BN_2$1}static getnetworkIdV(networkId,v){return getBigInt(networkId)*BN_2$1+BigInt(35+v-27)}static getNormalizedV(v){const bv=getBigInt(v);if(bv===BN_0$6||bv===BN_27){return 27}if(bv===BN_1$3||bv===BN_28){return 28}assertArgument(bv>=BN_35,"invalid v","v",v);return bv&BN_1$3?27:28}}function lock(){computeHmac.lock();pbkdf2.lock();randomBytes.lock();ripemd160.lock();scrypt.lock();scryptSync.lock();sha256.lock();sha512.lock();randomBytes.lock()}function removeHexPrefix(val){return val.substring(0,2)==="0x"?val.substring(2):val}function publicToAddress(key,prefix){const val=hexDataSlice(sha256(key),12);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function computeAddress(key,prefix){let pubkey;if(typeof key==="string"){pubkey=SigningKey.computePublicKey(key,false)}else{pubkey=key.publicKey}return publicToAddress(pubkey,prefix)}function recoverAddress(digest,signature,prefix){const publicKey=SigningKey.recoverPublicKey(arrayify(digest),signature);return publicToAddress(publicKey,prefix)}function extractPrefix(address){address=getAddress(address);return address.substring(2,4)}const WordSize=32;const Padding=new Uint8Array(WordSize);const passProperties$1=["then"];const _guard$3={};function throwError(name,error){const wrapped=new Error(`deferred error during ABI decoding triggered accessing ${name}`);wrapped.error=error;throw wrapped}class Result extends Array{#names;constructor(...args){const guard=args[0];let items=args[1];let names=(args[2]||[]).slice();let wrap=true;if(guard!==_guard$3){items=args;names=[];wrap=false}super(items.length);items.forEach((item,index)=>{this[index]=item});const nameCounts=names.reduce((accum,name)=>{if(typeof name==="string"){accum.set(name,(accum.get(name)||0)+1)}return accum},new Map);this.#names=Object.freeze(items.map((item,index)=>{const name=names[index];if(name!=null&&nameCounts.get(name)===1){return name}return null}));if(!wrap){return}Object.freeze(this);return new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="string"){if(prop.match(/^[0-9]+$/)){const index=getNumber(prop,"%index");if(index<0||index>=this.length){throw new RangeError("out of result range")}const item=target[index];if(item instanceof Error){throwError(`index ${index}`,item)}return item}if(passProperties$1.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}const value=target[prop];if(value instanceof Function){return function(...args){return value.apply(this===receiver?target:this,args)}}else if(!(prop in target)){return target.getValue.apply(this===receiver?target:this,[prop])}}return Reflect.get(target,prop,receiver)}})}toArray(){const result=[];this.forEach((item,index)=>{if(item instanceof Error){throwError(`index ${index}`,item)}result.push(item)});return result}toObject(){return this.#names.reduce((accum,name,index)=>{assert(name!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"});if(!(name in accum)){accum[name]=this.getValue(name)}return accum},{})}slice(start,end){if(start==null){start=0}if(start<0){start+=this.length;if(start<0){start=0}}if(end==null){end=this.length}if(end<0){end+=this.length;if(end<0){end=0}}if(end>this.length){end=this.length}const result=[],names=[];for(let i=start;i{this.#data[offset]=getValue$1(value)}}}class Reader{allowLoose;#data;#offset;constructor(data,allowLoose){defineProperties(this,{allowLoose:!!allowLoose});this.#data=getBytesCopy(data);this.#offset=0}get data(){return hexlify(this.#data)}get dataLength(){return this.#data.length}get consumed(){return this.#offset}get bytes(){return new Uint8Array(this.#data)}#peekBytes(offset,length,loose){let alignedLength=Math.ceil(length/WordSize)*WordSize;if(this.#offset+alignedLength>this.#data.length){if(this.allowLoose&&loose&&this.#offset+length<=this.#data.length){alignedLength=length}else{assert(false,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),length:this.#data.length,offset:this.#offset+alignedLength})}}return this.#data.slice(this.#offset,this.#offset+alignedLength)}subReader(offset){return new Reader(this.#data.slice(this.#offset+offset),this.allowLoose)}readBytes(length,loose){let bytes=this.#peekBytes(0,length,!!loose);this.#offset+=bytes.length;return bytes.slice(0,length)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}}const _gaurd={};function n(value,width){let signed=false;if(width<0){signed=true;width*=-1}return new Typed(_gaurd,`${signed?"":"u"}int${width}`,value,{signed:signed,width:width})}function b(value,size){return new Typed(_gaurd,`bytes${size?size:""}`,value,{size:size})}const _typedSymbol=Symbol.for("_corebc_typed");class Typed{type;value;#options;_typedSymbol;constructor(gaurd,type,value,options){if(options==null){options=null}assertPrivate(_gaurd,gaurd,"Typed");defineProperties(this,{_typedSymbol:_typedSymbol,type:type,value:value});this.#options=options;this.format()}format(){if(this.type==="array"){throw new Error("")}else if(this.type==="dynamicArray"){throw new Error("")}else if(this.type==="tuple"){return`tuple(${this.value.map(v=>v.format()).join(",")})`}return this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple"){throw TypeError("not a tuple")}return this.#options}get arrayLength(){if(this.type!=="array"){throw TypeError("not an array")}if(this.#options===true){return-1}if(this.#options===false){return this.value.length}return null}static from(type,value){return new Typed(_gaurd,type,value)}static uint8(v){return n(v,8)}static uint16(v){return n(v,16)}static uint24(v){return n(v,24)}static uint32(v){return n(v,32)}static uint40(v){return n(v,40)}static uint48(v){return n(v,48)}static uint56(v){return n(v,56)}static uint64(v){return n(v,64)}static uint72(v){return n(v,72)}static uint80(v){return n(v,80)}static uint88(v){return n(v,88)}static uint96(v){return n(v,96)}static uint104(v){return n(v,104)}static uint112(v){return n(v,112)}static uint120(v){return n(v,120)}static uint128(v){return n(v,128)}static uint136(v){return n(v,136)}static uint144(v){return n(v,144)}static uint152(v){return n(v,152)}static uint160(v){return n(v,160)}static uint168(v){return n(v,168)}static uint176(v){return n(v,176)}static uint184(v){return n(v,184)}static uint192(v){return n(v,192)}static uint200(v){return n(v,200)}static uint208(v){return n(v,208)}static uint216(v){return n(v,216)}static uint224(v){return n(v,224)}static uint232(v){return n(v,232)}static uint240(v){return n(v,240)}static uint248(v){return n(v,248)}static uint256(v){return n(v,256)}static uint(v){return n(v,256)}static int8(v){return n(v,-8)}static int16(v){return n(v,-16)}static int24(v){return n(v,-24)}static int32(v){return n(v,-32)}static int40(v){return n(v,-40)}static int48(v){return n(v,-48)}static int56(v){return n(v,-56)}static int64(v){return n(v,-64)}static int72(v){return n(v,-72)}static int80(v){return n(v,-80)}static int88(v){return n(v,-88)}static int96(v){return n(v,-96)}static int104(v){return n(v,-104)}static int112(v){return n(v,-112)}static int120(v){return n(v,-120)}static int128(v){return n(v,-128)}static int136(v){return n(v,-136)}static int144(v){return n(v,-144)}static int152(v){return n(v,-152)}static int160(v){return n(v,-160)}static int168(v){return n(v,-168)}static int176(v){return n(v,-176)}static int184(v){return n(v,-184)}static int192(v){return n(v,-192)}static int200(v){return n(v,-200)}static int208(v){return n(v,-208)}static int216(v){return n(v,-216)}static int224(v){return n(v,-224)}static int232(v){return n(v,-232)}static int240(v){return n(v,-240)}static int248(v){return n(v,-248)}static int256(v){return n(v,-256)}static int(v){return n(v,-256)}static bytes1(v){return b(v,1)}static bytes2(v){return b(v,2)}static bytes3(v){return b(v,3)}static bytes4(v){return b(v,4)}static bytes5(v){return b(v,5)}static bytes6(v){return b(v,6)}static bytes7(v){return b(v,7)}static bytes8(v){return b(v,8)}static bytes9(v){return b(v,9)}static bytes10(v){return b(v,10)}static bytes11(v){return b(v,11)}static bytes12(v){return b(v,12)}static bytes13(v){return b(v,13)}static bytes14(v){return b(v,14)}static bytes15(v){return b(v,15)}static bytes16(v){return b(v,16)}static bytes17(v){return b(v,17)}static bytes18(v){return b(v,18)}static bytes19(v){return b(v,19)}static bytes20(v){return b(v,20)}static bytes21(v){return b(v,21)}static bytes22(v){return b(v,22)}static bytes23(v){return b(v,23)}static bytes24(v){return b(v,24)}static bytes25(v){return b(v,25)}static bytes26(v){return b(v,26)}static bytes27(v){return b(v,27)}static bytes28(v){return b(v,28)}static bytes29(v){return b(v,29)}static bytes30(v){return b(v,30)}static bytes31(v){return b(v,31)}static bytes32(v){return b(v,32)}static address(v){return new Typed(_gaurd,"address",v)}static bool(v){return new Typed(_gaurd,"bool",!!v)}static bytes(v){return new Typed(_gaurd,"bytes",v)}static string(v){return new Typed(_gaurd,"string",v)}static array(v,dynamic){throw new Error("not implemented yet")}static tuple(v,name){throw new Error("not implemented yet")}static overrides(v){return new Typed(_gaurd,"overrides",Object.assign({},v))}static isTyped(value){return value&&value._typedSymbol===_typedSymbol}static dereference(value,type){if(Typed.isTyped(value)){if(value.type!==type){throw new Error(`invalid type: expecetd ${type}, got ${value.type}`)}return value.value}return value}}class AddressCoder extends Coder{constructor(localName){super("address","address",localName,false)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(writer,_value){let value=Typed.dereference(_value,"string");try{value=getAddress(value)}catch(error){return this._throwError(error.message,_value)}return writer.writeValue(value)}decode(reader){return getAddress(toBeHex(reader.readValue(),22))}}class AnonymousCoder extends Coder{coder;constructor(coder){super(coder.name,coder.type,"_",coder.dynamic);this.coder=coder}defaultValue(){return this.coder.defaultValue()}encode(writer,value){return this.coder.encode(writer,value)}decode(reader){return this.coder.decode(reader)}}function pack(writer,coders,values){let arrayValues=[];if(Array.isArray(values)){arrayValues=values}else if(values&&typeof values==="object"){let unique={};arrayValues=coders.map(coder=>{const name=coder.localName;assert(name,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});assert(!unique[name],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});unique[name]=true;return values[name]})}else{assertArgument(false,"invalid tuple value","tuple",values)}assertArgument(coders.length===arrayValues.length,"types/value length mismatch","tuple",values);let staticWriter=new Writer;let dynamicWriter=new Writer;let updateFuncs=[];coders.forEach((coder,index)=>{let value=arrayValues[index];if(coder.dynamic){let dynamicOffset=dynamicWriter.length;coder.encode(dynamicWriter,value);let updateFunc=staticWriter.writeUpdatableValue();updateFuncs.push(baseOffset=>{updateFunc(baseOffset+dynamicOffset)})}else{coder.encode(staticWriter,value)}});updateFuncs.forEach(func=>{func(staticWriter.length)});let length=writer.appendWriter(staticWriter);length+=writer.appendWriter(dynamicWriter);return length}function unpack(reader,coders){let values=[];let keys=[];let baseReader=reader.subReader(0);coders.forEach(coder=>{let value=null;if(coder.dynamic){let offset=reader.readIndex();let offsetReader=baseReader.subReader(offset);try{value=coder.decode(offsetReader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}else{try{value=coder.decode(reader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}if(value==undefined){throw new Error("investigate")}values.push(value);keys.push(coder.localName||null)});return Result.fromItems(values,keys)}class ArrayCoder extends Coder{coder;length;constructor(coder,length,localName){const type=coder.type+"["+(length>=0?length:"")+"]";const dynamic=length===-1||coder.dynamic;super("array",type,localName,dynamic);defineProperties(this,{coder:coder,length:length})}defaultValue(){const defaultChild=this.coder.defaultValue();const result=[];for(let i=0;ibounds||value<-(bounds+BN_1$2)){this._throwError("value out-of-bounds",_value)}value=toTwos(value,8*WordSize)}else if(valuemask(maxUintValue,this.size*8)){this._throwError("value out-of-bounds",_value)}return writer.writeValue(value)}decode(reader){let value=mask(reader.readValue(),this.size*8);if(this.signed){value=fromTwos(value,this.size*8)}return value}}class StringCoder extends DynamicBytesCoder{constructor(localName){super("string",localName)}defaultValue(){return""}encode(writer,_value){return super.encode(writer,toUtf8Bytes(Typed.dereference(_value,"string")))}decode(reader){return toUtf8String(super.decode(reader))}}class TupleCoder extends Coder{coders;constructor(coders,localName){let dynamic=false;const types=[];coders.forEach(coder=>{if(coder.dynamic){dynamic=true}types.push(coder.type)});const type="tuple("+types.join(",")+")";super("tuple",type,localName,dynamic);defineProperties(this,{coders:Object.freeze(coders.slice())})}defaultValue(){const values=[];this.coders.forEach(coder=>{values.push(coder.defaultValue())});const uniqueNames=this.coders.reduce((accum,coder)=>{const name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});this.coders.forEach((coder,index)=>{let name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}values[name]=values[index]});return Object.freeze(values)}encode(writer,_value){const value=Typed.dereference(_value,"tuple");return pack(writer,this.coders,value)}decode(reader){return unpack(reader,this.coders)}}function id(value,useKeccak){if(useKeccak){return keccak256(toUtf8Bytes(value))}return sha256(toUtf8Bytes(value))}const ZeroAddress="0x0000000000000000000000000000000000000000";const ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000";const N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const OrePerXCB=BigInt("1000000000000000000");const MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);const MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const CoreSymbol="Ξ";const MessagePrefix="Core Signed Message:\n";function accessSetify(addr,storageKeys){return{address:getAddress(addr),storageKeys:storageKeys.map((storageKey,index)=>{assertArgument(isHexString(storageKey,32),"invalid slot",`storageKeys[${index}]`,storageKey);return storageKey.toLowerCase()})}}function accessListify(value){if(Array.isArray(value)){return value.map((set,index)=>{if(Array.isArray(set)){assertArgument(set.length===2,"invalid slot set",`value[${index}]`,set);return accessSetify(set[0],set[1])}assertArgument(set!=null&&typeof set==="object","invalid address-slot set","value",value);return accessSetify(set.address,set.storageKeys)})}assertArgument(value!=null&&typeof value==="object","invalid access list","value",value);const result=Object.keys(value).map(addr=>{const storageKeys=value[addr].reduce((accum,storageKey)=>{accum[storageKey]=true;return accum},{});return accessSetify(addr,Object.keys(storageKeys).sort())});result.sort((a,b)=>a.address.localeCompare(b.address));return result}const logger$1=new Logger("transaction/0.0.1");const BN_0$4=BigInt(0);function handleAddress(value){if(value==="0x"){return null}return getAddress(value)}function parse(data){const handleNumber=value=>{if(value==="0x"){return BigNumber.from(0)}return BigNumber.from(value)};const transaction=decode$1(data);if(transaction.length!==7&&transaction.length!==8){logger$1.throwArgumentError("invalid raw transaction","data",data)}const isSigned=transaction.length===8;const tx={nonce:Number(handleNumber(transaction[0])),energyPrice:handleNumber(transaction[1]).toBigInt(),energyLimit:handleNumber(transaction[2]).toBigInt(),networkId:handleNumber(transaction[isSigned?3:6]).toBigInt(),to:handleAddress(transaction[isSigned?4:3]),value:handleNumber(transaction[isSigned?5:4]).toBigInt(),data:transaction[isSigned?6:5]};if(transaction.length===8){const prefix=networkIdToPrefix(Number(tx.networkId));const digest=sha256(serialize(tx));tx.hash=sha256(serialize(tx,transaction[7]));tx.from=recoverAddress(digest,transaction[7],prefix);tx.signature=transaction[7]}return tx}const unsignedTransactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"},{name:"networkId",maxLength:32,numeric:true}];const transactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"networkId",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"}];const allowedTransactionKeys={networkId:true,data:true,energyLimit:true,energyPrice:true,nonce:true,to:true,value:true};function serialize(transaction,signature){checkProperties(transaction,allowedTransactionKeys);const raw=[];(!!signature?transactionFields:unsignedTransactionFields).forEach(function({numeric,maxLength,name,length}){let value=transaction[name]||[];const options={};if(numeric){options.hexPad="left"}const tmpHexlified=hexlify(value,options);value=arrayify(tmpHexlified);if(length&&value.length!==length&&value.length>0){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}if(maxLength){value=stripZeros(value);if(value.length>maxLength){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}}const hexlified=hexlify(value);raw.push(hexlified)});if(!!signature){raw.push(hexlify(signature))}const finalValue=encode(raw);return finalValue}class Transaction{#to;#data;#nonce;#energyLimit;#energyPrice;#value;#networkId;#sig;get to(){return this.#to}set to(value){this.#to=value==null?null:getAddress(value)}get nonce(){return this.#nonce}set nonce(value){this.#nonce=getNumber(value,"value")}get energyLimit(){return this.#energyLimit}set energyLimit(value){this.#energyLimit=getBigInt(value)}get energyPrice(){const value=this.#energyPrice;if(value==null){return BN_0$4}return value}set energyPrice(value){this.#energyPrice=value==null?null:getBigInt(value,"energyPrice")}get data(){return this.#data}set data(value){this.#data=hexlify(value)}get value(){return this.#value}set value(value){this.#value=getBigInt(value,"value")}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value)}get signature(){return this.#sig||null}set signature(value){this.#sig=value==null?null:value}constructor(){this.#to=null;this.#nonce=0;this.#energyLimit=BigInt(0);this.#energyPrice=null;this.#data="0x";this.#value=BigInt(0);this.#networkId=BigInt(0);this.#sig=null}get hash(){if(this.signature==null){return null}return sha256(this.serialized)}get unsignedHash(){return sha256(this.unsignedSerialized)}get from(){if(this.signature==null){return null}const prefix=networkIdToPrefix(Number(this.#networkId));return recoverAddress(this.unsignedHash,this.signature,prefix)}get fromPublicKey(){if(this.signature==null){return null}return SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){assert(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});return serialize(this,this.signature)}get unsignedSerialized(){return serialize(this)}clone(){return Transaction.from(this)}toJSON(){const s=v=>{if(v==null){return null}return v.toString()};return{to:this.to,data:this.data,nonce:this.nonce,energyLimit:s(this.energyLimit),energyPrice:s(this.energyPrice),value:s(this.value),networkId:s(this.networkId),sig:this.signature?this.signature:null}}static from(tx){if(tx==null){return new Transaction}if(typeof tx==="string"){const payload=getBytes(tx);return Transaction.from(parse(payload))}const result=new Transaction;if(tx.to!=null){result.to=tx.to}if(tx.nonce!=null){result.nonce=tx.nonce}if(tx.energyLimit!=null){result.energyLimit=tx.energyLimit}if(tx.energyPrice!=null){result.energyPrice=tx.energyPrice}if(tx.data!=null){result.data=tx.data}if(tx.value!=null){result.value=tx.value}if(tx.networkId!=null){result.networkId=tx.networkId}if(tx.signature!=null){result.signature=tx.signature}if(tx.hash!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define hash","tx",tx);assertArgument(result.hash===tx.hash,"hash mismatch","tx",tx)}if(tx.from!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define from","tx",tx);assertArgument(result.from.toLowerCase()===(tx.from||"").toLowerCase(),"from mismatch","tx",tx)}return result}}function hashMessage(message){if(typeof message==="string"){message=toUtf8Bytes(message)}return sha256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(message.length)),message]))}function verifyMessage(message,sig,prefix){const digest=hashMessage(message);return recoverAddress(digest,sig,prefix)}const regexBytes=new RegExp("^bytes([0-9]+)$");const regexNumber=new RegExp("^(u?int)([0-9]*)$");const regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$");function _pack(type,value,isArray){switch(type){case"address":if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(getAddress(value));case"string":return toUtf8Bytes(value);case"bytes":return getBytes(value);case"bool":value=!!value?"0x01":"0x00";if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(value)}let match=type.match(regexNumber);if(match){let signed=match[1]==="int";let size=parseInt(match[2]||"256");assertArgument((!match[2]||match[2]===String(size))&&size%8===0&&size!==0&&size<=256,"invalid number type","type",type);if(isArray){size=256}if(signed){value=toTwos(value,size)}return getBytes(zeroPadValue(toBeArray(value),size/8))}match=type.match(regexBytes);if(match){const size=parseInt(match[1]);assertArgument(String(size)===match[1]&&size!==0&&size<=32,"invalid bytes type","type",type);assertArgument(dataLength(value)===size,`invalid value for ${type}`,"value",value);if(isArray){return getBytes(zeroPadBytes(value,32))}return value}match=type.match(regexArray);if(match&&Array.isArray(value)){const baseType=match[1];const count=parseInt(match[2]||String(value.length));assertArgument(count===value.length,`invalid array length for ${type}`,"value",value);const result=[];value.forEach(function(value){result.push(_pack(baseType,value,true))});return getBytes(concat(result))}assertArgument(false,"invalid type","type",type)}function solidityPacked(types,values){assertArgument(types.length===values.length,"wrong number of values; expected ${ types.length }","values",values);const tight=[];types.forEach(function(type,index){tight.push(_pack(type,values[index]))});return hexlify(concat(tight))}function solidityPackedSha256(types,values){return sha256(solidityPacked(types,values))}const padding=new Uint8Array(32);padding.fill(0);const BN__1=BigInt(-1);const BN_0$3=BigInt(0);const BN_1$1=BigInt(1);const BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(value){const bytes=getBytes(value);const padOffset=bytes.length%32;if(padOffset){return concat([bytes,padding.slice(padOffset)])}return hexlify(bytes)}const hexTrue=toBeHex(BN_1$1,32);const hexFalse=toBeHex(BN_0$3,32);const domainFieldTypes={name:"string",version:"string",networkId:"uint256",verifyingContract:"address",salt:"bytes32"};const domainFieldNames=["name","version","networkId","verifyingContract","salt"];function checkString(key){return function(value){assertArgument(typeof value==="string",`invalid domain value for ${JSON.stringify(key)}`,`domain.${key}`,value);return value}}const domainChecks={name:checkString("name"),version:checkString("version"),networkId:function(_value){const value=getBigInt(_value,"domain.networkId");assertArgument(value>=0,"invalid chain ID","domain.networkId",_value);if(Number.isSafeInteger(value)){return Number(value)}return toQuantity(value)},verifyingContract:function(value){try{return getAddress(value).toLowerCase()}catch(error){}assertArgument(false,`invalid domain value "verifyingContract"`,"domain.verifyingContract",value)},salt:function(value){const bytes=getBytes(value,"domain.salt");assertArgument(bytes.length===32,`invalid domain value "salt"`,"domain.salt",value);return hexlify(bytes)}};function getBaseEncoder(type){{const match=type.match(/^(u?)int(\d*)$/);if(match){const signed=match[1]==="";const width=parseInt(match[2]||"256");assertArgument(width%8===0&&width!==0&&width<=256&&(match[2]==null||match[2]===String(width)),"invalid numeric width","type",type);const boundsUpper=mask(BN_MAX_UINT256,signed?width-1:width);const boundsLower=signed?(boundsUpper+BN_1$1)*BN__1:BN_0$3;return function(_value){const value=getBigInt(_value,"value");assertArgument(value>=boundsLower&&value<=boundsUpper,`value out-of-bounds for ${type}`,"value",value);return toBeHex(signed?toTwos(value,256):value,32)}}}{const match=type.match(/^bytes(\d+)$/);if(match){const width=parseInt(match[1]);assertArgument(width!==0&&width<=32&&match[1]===String(width),"invalid bytes width","type",type);return function(value){const bytes=getBytes(value);assertArgument(bytes.length===width,`invalid length for ${type}`,"value",value);return hexPadRight(value)}}}switch(type){case"address":return function(value){return zeroPadValue(getAddress(value),32)};case"bool":return function(value){return!value?hexFalse:hexTrue};case"bytes":return function(value){return sha256(value)};case"string":return function(value){return id(value)}}return null}function encodeType(name,fields){return`${name}(${fields.map(({name,type})=>type+" "+name).join(",")})`}class TypedDataEncoder{primaryType;#types;get types(){return JSON.parse(this.#types)}#fullTypes;#encoderCache;constructor(types){this.#types=JSON.stringify(types);this.#fullTypes=new Map;this.#encoderCache=new Map;const links=new Map;const parents=new Map;const subtypes=new Map;Object.keys(types).forEach(type=>{links.set(type,new Set);parents.set(type,[]);subtypes.set(type,new Set)});for(const name in types){const uniqueNames=new Set;for(const field of types[name]){assertArgument(!uniqueNames.has(field.name),`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`,"types",types);uniqueNames.add(field.name);const baseType=field.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;assertArgument(baseType!==name,`circular type reference to ${JSON.stringify(baseType)}`,"types",types);const encoder=getBaseEncoder(baseType);if(encoder){continue}assertArgument(parents.has(baseType),`unknown type ${JSON.stringify(baseType)}`,"types",types);parents.get(baseType).push(name);links.get(name).add(baseType)}}const primaryTypes=Array.from(parents.keys()).filter(n=>parents.get(n).length===0);assertArgument(primaryTypes.length!==0,"missing primary type","types",types);assertArgument(primaryTypes.length===1,`ambiguous primary types or unused types: ${primaryTypes.map(t=>JSON.stringify(t)).join(", ")}`,"types",types);defineProperties(this,{primaryType:primaryTypes[0]});function checkCircular(type,found){assertArgument(!found.has(type),`circular type reference to ${JSON.stringify(type)}`,"types",types);found.add(type);for(const child of links.get(type)){if(!parents.has(child)){continue}checkCircular(child,found);for(const subtype of found){subtypes.get(subtype).add(child)}}found.delete(type)}checkCircular(this.primaryType,new Set);for(const[name,set]of subtypes){const st=Array.from(set);st.sort();this.#fullTypes.set(name,encodeType(name,types[name])+st.map(t=>encodeType(t,types[t])).join(""))}}getEncoder(type){let encoder=this.#encoderCache.get(type);if(!encoder){encoder=this.#getEncoder(type);this.#encoderCache.set(type,encoder)}return encoder}#getEncoder(type){{const encoder=getBaseEncoder(type);if(encoder){return encoder}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){const subtype=match[1];const subEncoder=this.getEncoder(subtype);return value=>{assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);let result=value.map(subEncoder);if(this.#fullTypes.has(subtype)){result=result.map(sha256)}return sha256(concat(result))}}const fields=this.types[type];if(fields){const encodedType=id(this.#fullTypes.get(type));return value=>{const values=fields.map(({name,type})=>{const result=this.getEncoder(type)(value[name]);if(this.#fullTypes.has(type)){return sha256(result)}return result});values.unshift(encodedType);return concat(values)}}assertArgument(false,`unknown type: ${type}`,"type",type)}encodeType(name){const result=this.#fullTypes.get(name);assertArgument(result,`unknown type: ${JSON.stringify(name)}`,"name",name);return result}encodeData(type,value){return this.getEncoder(type)(value)}hashStruct(name,value){return sha256(this.encodeData(name,value))}encode(value){return this.encodeData(this.primaryType,value)}hash(value){return this.hashStruct(this.primaryType,value)}_visit(type,value,callback){{const encoder=getBaseEncoder(type);if(encoder){return callback(type,value)}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);return value.map(v=>this._visit(match[1],v,callback))}const fields=this.types[type];if(fields){return fields.reduce((accum,{name,type})=>{accum[name]=this._visit(type,value[name],callback);return accum},{})}assertArgument(false,`unknown type: ${type}`,"type",type)}visit(value,callback){return this._visit(this.primaryType,value,callback)}static from(types){return new TypedDataEncoder(types)}static getPrimaryType(types){return TypedDataEncoder.from(types).primaryType}static hashStruct(name,types,value){return TypedDataEncoder.from(types).hashStruct(name,value)}static hashDomain(domain){const domainFields=[];for(const name in domain){if(domain[name]==null){continue}const type=domainFieldTypes[name];assertArgument(type,`invalid typed-data domain key: ${JSON.stringify(name)}`,"domain",domain);domainFields.push({name:name,type:type})}domainFields.sort((a,b)=>{return domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(b.name)});return TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:domainFields},domain)}static encode(domain,types,value){return concat(["0x1901",TypedDataEncoder.hashDomain(domain),TypedDataEncoder.from(types).hash(value)])}static hash(domain,types,value){return sha256(TypedDataEncoder.encode(domain,types,value))}static async resolveNames(domain,types,value,resolveName){domain=Object.assign({},domain);for(const key in domain){if(domain[key]==null){delete domain[key]}}const ensCache={};if(domain.verifyingContract&&!isHexString(domain.verifyingContract,20)){ensCache[domain.verifyingContract]="0x"}const encoder=TypedDataEncoder.from(types);encoder.visit(value,(type,value)=>{if(type==="address"&&!isHexString(value,20)){ensCache[value]="0x"}return value});for(const name in ensCache){ensCache[name]=await resolveName(name)}if(domain.verifyingContract&&ensCache[domain.verifyingContract]){domain.verifyingContract=ensCache[domain.verifyingContract]}value=encoder.visit(value,(type,value)=>{if(type==="address"&&ensCache[value]){return ensCache[value]}return value});return{domain:domain,value:value}}static getPayload(domain,types,value){TypedDataEncoder.hashDomain(domain);const domainValues={};const domainTypes=[];domainFieldNames.forEach(name=>{const value=domain[name];if(value==null){return}domainValues[name]=domainChecks[name](value);domainTypes.push({name:name,type:domainFieldTypes[name]})});const encoder=TypedDataEncoder.from(types);const typesWithDomain=Object.assign({},types);assertArgument(typesWithDomain.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",types);typesWithDomain.EIP712Domain=domainTypes;encoder.encode(value);return{types:typesWithDomain,domain:domainValues,primaryType:encoder.primaryType,message:encoder.visit(value,(type,value)=>{if(type.match(/^bytes(\d*)/)){return hexlify(getBytes(value))}if(type.match(/^u?int/)){return getBigInt(value).toString()}switch(type){case"address":return value.toLowerCase();case"bool":return!!value;case"string":assertArgument(typeof value==="string","invalid string","value",value);return value}assertArgument(false,"unsupported type","type",type)})}}}function verifyTypedData(domain,types,value,signature,prefix){return recoverAddress(TypedDataEncoder.hash(domain,types,value),signature,prefix)}var _a;function setify(items){const result=new Set;items.forEach(k=>result.add(k));return Object.freeze(result)}const _kwVisib="constant external internal payable private public pure view";const KwVisib=setify(_kwVisib.split(" "));const _kwTypes="constructor error event fallback function receive struct";const KwTypes=setify(_kwTypes.split(" "));const _kwModifiers="calldata memory storage payable indexed";const KwModifiers=setify(_kwModifiers.split(" "));const _kwOther="tuple returns";const _keywords=[_kwTypes,_kwModifiers,_kwOther,_kwVisib].join(" ");const Keywords=setify(_keywords.split(" "));const SimpleTokens={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"};const regexWhitespacePrefix=new RegExp("^(\\s*)");const regexNumberPrefix=new RegExp("^([0-9]+)");const regexIdPrefix=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");const regexId=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");const regexType=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class TokenString{#offset;#tokens;get offset(){return this.#offset}get length(){return this.#tokens.length-this.#offset}constructor(tokens){this.#offset=0;this.#tokens=tokens.slice()}clone(){return new _a(this.#tokens)}reset(){this.#offset=0}#subTokenString(from=0,to=0){return new _a(this.#tokens.slice(from,to).map(t=>{return Object.freeze(Object.assign({},t,{match:t.match-from,linkBack:t.linkBack-from,linkNext:t.linkNext-from}))}))}popKeyword(allowed){const top=this.peek();if(top.type!=="KEYWORD"||!allowed.has(top.text)){throw new Error(`expected keyword ${top.text}`)}return this.pop().text}popType(type){if(this.peek().type!==type){throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`)}return this.pop().text}popParen(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=this.#subTokenString(this.#offset+1,top.match+1);this.#offset=top.match+1;return result}popParams(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=[];while(this.#offset=this.#tokens.length){throw new Error("out-of-bounds")}return this.#tokens[this.#offset]}peekKeyword(allowed){const top=this.peekType("KEYWORD");return top!=null&&allowed.has(top)?top:null}peekType(type){if(this.length===0){return null}const top=this.peek();return top.type===type?top.text:null}pop(){const result=this.peek();this.#offset++;return result}toString(){const tokens=[];for(let i=this.#offset;i`}}_a=TokenString;function lex(text){const tokens=[];const throwError=message=>{const token=offset0&&tokens[tokens.length-1].type==="NUMBER"){const value=tokens.pop().text;suffix=value+suffix;tokens[tokens.length-1].value=getNumber(value)}if(tokens.length===0||tokens[tokens.length-1].type!=="BRACKET"){throw new Error("missing opening bracket")}tokens[tokens.length-1].text+=suffix}continue}match=cur.match(regexIdPrefix);if(match){token.text=match[1];offset+=token.text.length;if(Keywords.has(token.text)){token.type="KEYWORD";continue}if(token.text.match(regexType)){token.type="TYPE";continue}token.type="ID";continue}match=cur.match(regexNumberPrefix);if(match){token.text=match[1];token.type="NUMBER";offset+=token.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`)}return new TokenString(tokens.map(t=>Object.freeze(t)))}function allowSingle(set,allowed){let included=[];for(const key in allowed.keys()){if(set.has(key)){included.push(key)}}if(included.length>1){throw new Error(`conflicting types: ${included.join(", ")}`)}}function consumeName(type,tokens){if(tokens.peekKeyword(KwTypes)){const keyword=tokens.pop().text;if(keyword!==type){throw new Error(`expected ${type}, got ${keyword}`)}}return tokens.popType("ID")}function consumeKeywords(tokens,allowed){const keywords=new Set;while(true){const keyword=tokens.peekType("KEYWORD");if(keyword==null||allowed&&!allowed.has(keyword)){break}tokens.pop();if(keywords.has(keyword)){throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`)}keywords.add(keyword)}return Object.freeze(keywords)}function consumeMutability(tokens){let modifiers=consumeKeywords(tokens,KwVisib);allowSingle(modifiers,setify("constant payable nonpayable".split(" ")));allowSingle(modifiers,setify("pure view payable nonpayable".split(" ")));if(modifiers.has("view")){return"view"}if(modifiers.has("pure")){return"pure"}if(modifiers.has("payable")){return"payable"}if(modifiers.has("nonpayable")){return"nonpayable"}if(modifiers.has("constant")){return"view"}return"nonpayable"}function consumeParams(tokens,allowIndexed){return tokens.popParams().map(t=>ParamType.from(t,allowIndexed))}function consumeEnergy(tokens){if(tokens.peekType("AT")){tokens.pop();if(tokens.peekType("NUMBER")){return getBigInt(tokens.pop().text)}throw new Error("invalid energy")}return null}function consumeEoi(tokens){if(tokens.length){throw new Error(`unexpected tokens: ${tokens.toString()}`)}}const regexArrayType=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(type){const match=type.match(regexType);assertArgument(match,"invalid type","type",type);if(type==="uint"){return"uint256"}if(type==="int"){return"int256"}if(match[2]){const length=parseInt(match[2]);assertArgument(length!==0&&length<=32,"invalid bytes length","type",type)}else if(match[3]){const size=parseInt(match[3]);assertArgument(size!==0&&size<=256&&size%8===0,"invalid numeric width","type",type)}return type}const _guard$2={};const internal$1=Symbol.for("_corebc_internal");const ParamTypeInternal="_ParamTypeInternal";const ErrorFragmentInternal="_ErrorInternal";const EventFragmentInternal="_EventInternal";const ConstructorFragmentInternal="_ConstructorInternal";const FallbackFragmentInternal="_FallbackInternal";const FunctionFragmentInternal="_FunctionInternal";const StructFragmentInternal="_StructInternal";class ParamType{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(guard,name,type,baseType,indexed,components,arrayLength,arrayChildren){assertPrivate(guard,_guard$2,"ParamType");Object.defineProperty(this,internal$1,{value:ParamTypeInternal});if(components){components=Object.freeze(components.slice())}if(baseType==="array"){if(arrayLength==null||arrayChildren==null){throw new Error("")}}else if(arrayLength!=null||arrayChildren!=null){throw new Error("")}if(baseType==="tuple"){if(components==null){throw new Error("")}}else if(components!=null){throw new Error("")}defineProperties(this,{name:name,type:type,baseType:baseType,indexed:indexed,components:components,arrayLength:arrayLength,arrayChildren:arrayChildren})}format(format){if(format==null){format="sighash"}if(format==="json"){let result={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||undefined};if(typeof this.indexed==="boolean"){result.indexed=this.indexed}if(this.isTuple()){result.components=this.components.map(c=>JSON.parse(c.format(format)))}return JSON.stringify(result)}let result="";if(this.isArray()){result+=this.arrayChildren.format(format);result+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`}else{if(this.isTuple()){if(format!=="sighash"){result+=this.type}result+="("+this.components.map(comp=>comp.format(format)).join(format==="full"?", ":",")+")"}else{result+=this.type}}if(format!=="sighash"){if(this.indexed===true){result+=" indexed"}if(format==="full"&&this.name){result+=" "+this.name}}return result}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(value,process){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const _this=this;return value.map(v=>_this.arrayChildren.walk(v,process))}if(this.isTuple()){if(!Array.isArray(value)){throw new Error("invalid tuple value")}if(value.length!==this.components.length){throw new Error("array is wrong length")}const _this=this;return value.map((v,i)=>_this.components[i].walk(v,process))}return process(this.type,value)}#walkAsync(promises,value,process,setValue){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const childType=this.arrayChildren;const result=value.slice();result.forEach((value,index)=>{childType.#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}if(this.isTuple()){const components=this.components;let result;if(Array.isArray(value)){result=value.slice()}else{if(value==null||typeof value!=="object"){throw new Error("invalid tuple value")}result=components.map(param=>{if(!param.name){throw new Error("cannot use object value with unnamed components")}if(!(param.name in value)){throw new Error(`missing value for component ${param.name}`)}return value[param.name]})}if(result.length!==this.components.length){throw new Error("array is wrong length")}result.forEach((value,index)=>{components[index].#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}const result=process(this.type,value);if(result.then){promises.push(async function(){setValue(await result)}())}else{setValue(result)}}async walkAsync(value,process){const promises=[];const result=[value];this.#walkAsync(promises,value,process,value=>{result[0]=value});if(promises.length){await Promise.all(promises)}return result[0]}static from(obj,allowIndexed){if(ParamType.isParamType(obj)){return obj}if(typeof obj==="string"){return ParamType.from(lex(obj),allowIndexed)}else if(obj instanceof TokenString){let type="",baseType="";let comps=null;if(consumeKeywords(obj,setify(["tuple"])).has("tuple")||obj.peekType("OPEN_PAREN")){baseType="tuple";comps=obj.popParams().map(t=>ParamType.from(t));type=`tuple(${comps.map(c=>c.format()).join(",")})`}else{type=verifyBasicType(obj.popType("TYPE"));baseType=type}let arrayChildren=null;let arrayLength=null;while(obj.length&&obj.peekType("BRACKET")){const bracket=obj.pop();arrayChildren=new ParamType(_guard$2,"",type,baseType,null,comps,arrayLength,arrayChildren);arrayLength=bracket.value;type+=bracket.text;baseType="array";comps=null}let indexed=null;const keywords=consumeKeywords(obj,KwModifiers);if(keywords.has("indexed")){if(!allowIndexed){throw new Error("")}indexed=true}const name=obj.peekType("ID")?obj.pop().text:"";if(obj.length){throw new Error("leftover tokens")}return new ParamType(_guard$2,name,type,baseType,indexed,comps,arrayLength,arrayChildren)}const name=obj.name;assertArgument(!name||typeof name==="string"&&name.match(regexId),"invalid name","obj.name",name);let indexed=obj.indexed;if(indexed!=null){assertArgument(allowIndexed,"parameter cannot be indexed","obj.indexed",obj.indexed);indexed=!!indexed}let type=obj.type;let arrayMatch=type.match(regexArrayType);if(arrayMatch){const arrayLength=parseInt(arrayMatch[2]||"-1");const arrayChildren=ParamType.from({type:arrayMatch[1],components:obj.components});return new ParamType(_guard$2,name||"",type,"array",indexed,null,arrayLength,arrayChildren)}if(type==="tuple"||type.startsWith("tuple(")||type.startsWith("(")){const comps=obj.components!=null?obj.components.map(c=>ParamType.from(c)):null;const tuple=new ParamType(_guard$2,name||"",type,"tuple",indexed,comps,null,null);return tuple}type=verifyBasicType(obj.type);return new ParamType(_guard$2,name||"",type,type,indexed,null,null,null)}static isParamType(value){return value&&value[internal$1]===ParamTypeInternal}}class Fragment{type;inputs;constructor(guard,type,inputs){assertPrivate(guard,_guard$2,"Fragment");inputs=Object.freeze(inputs.slice());defineProperties(this,{type:type,inputs:inputs})}static from(obj){if(typeof obj==="string"){try{Fragment.from(JSON.parse(obj))}catch(e){}return Fragment.from(lex(obj))}if(obj instanceof TokenString){const type=obj.peekKeyword(KwTypes);switch(type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}}else if(typeof obj==="object"){switch(obj.type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}assert(false,`unsupported type: ${obj.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(false,"unsupported frgament object","obj",obj)}static isConstructor(value){return ConstructorFragment.isFragment(value)}static isError(value){return ErrorFragment.isFragment(value)}static isEvent(value){return EventFragment.isFragment(value)}static isFunction(value){return FunctionFragment.isFragment(value)}static isStruct(value){return StructFragment.isFragment(value)}}class NamedFragment extends Fragment{name;constructor(guard,type,name,inputs){super(guard,type,inputs);assertArgument(typeof name==="string"&&name.match(regexId),"invalid identifier","name",name);inputs=Object.freeze(inputs.slice());defineProperties(this,{name:name})}}function joinParams(format,params){return"("+params.map(p=>p.format(format)).join(format==="full"?", ":",")+")"}class ErrorFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"error",name,inputs);Object.defineProperty(this,internal$1,{value:ErrorFragmentInternal})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(format)))})}const result=[];if(format!=="sighash"){result.push("error")}result.push(this.name+joinParams(format,this.inputs));return result.join(" ")}static from(obj){if(ErrorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ErrorFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("error",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new ErrorFragment(_guard$2,name,inputs)}return new ErrorFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===ErrorFragmentInternal}}class EventFragment extends NamedFragment{anonymous;constructor(guard,name,inputs,anonymous){super(guard,"event",name,inputs);Object.defineProperty(this,internal$1,{value:EventFragmentInternal});defineProperties(this,{anonymous:anonymous})}get topicHash(){return id(this.format("sighash"))}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[];if(format!=="sighash"){result.push("event")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"&&this.anonymous){result.push("anonymous")}return result.join(" ")}static getTopicHash(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new EventFragment(_guard$2,name,params,false);return fragment.topicHash}static from(obj){if(EventFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return EventFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("event",obj);const inputs=consumeParams(obj,true);const anonymous=!!consumeKeywords(obj,setify(["anonymous"])).has("anonymous");consumeEoi(obj);return new EventFragment(_guard$2,name,inputs,anonymous)}return new EventFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(p=>ParamType.from(p,true)):[],!!obj.anonymous)}static isFragment(value){return value&&value[internal$1]===EventFragmentInternal}}class ConstructorFragment extends Fragment{payable;energy;constructor(guard,type,inputs,payable,energy){super(guard,type,inputs);Object.defineProperty(this,internal$1,{value:ConstructorFragmentInternal});defineProperties(this,{payable:payable,energy:energy})}format(format){assert(format!=null&&format!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"});if(format==="json"){return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[`constructor${joinParams(format,this.inputs)}`];result.push(this.payable?"payable":"nonpayable");if(this.energy!=null){result.push(`@${this.energy.toString()}`)}return result.join(" ")}static from(obj){if(ConstructorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ConstructorFragment.from(lex(obj))}else if(obj instanceof TokenString){consumeKeywords(obj,setify(["constructor"]));const inputs=consumeParams(obj);const payable=!!consumeKeywords(obj,setify(["payable"])).has("payable");const energy=consumeEnergy(obj);consumeEoi(obj);return new ConstructorFragment(_guard$2,"constructor",inputs,payable,energy)}return new ConstructorFragment(_guard$2,"constructor",obj.inputs?obj.inputs.map(ParamType.from):[],!!obj.payable,obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===ConstructorFragmentInternal}}class FallbackFragment extends Fragment{payable;constructor(guard,inputs,payable){super(guard,"fallback",inputs);Object.defineProperty(this,internal$1,{value:FallbackFragmentInternal});defineProperties(this,{payable:payable})}format(format){const type=this.inputs.length===0?"receive":"fallback";if(format==="json"){const stateMutability=this.payable?"payable":"nonpayable";return JSON.stringify({type:type,stateMutability:stateMutability})}return`${type}()${this.payable?" payable":""}`}static from(obj){if(FallbackFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FallbackFragment.from(lex(obj))}else if(obj instanceof TokenString){const errorObj=obj.toString();const topIsValid=obj.peekKeyword(setify(["fallback","receive"]));assertArgument(topIsValid,"type must be fallback or receive","obj",errorObj);const type=obj.popKeyword(setify(["fallback","receive"]));if(type==="receive"){const inputs=consumeParams(obj);assertArgument(inputs.length===0,`receive cannot have arguments`,"obj.inputs",inputs);consumeKeywords(obj,setify(["payable"]));consumeEoi(obj);return new FallbackFragment(_guard$2,[],true)}let inputs=consumeParams(obj);if(inputs.length){assertArgument(inputs.length===1&&inputs[0].type==="bytes","invalid fallback inputs","obj.inputs",inputs.map(i=>i.format("minimal")).join(", "))}else{inputs=[ParamType.from("bytes")]}const mutability=consumeMutability(obj);assertArgument(mutability==="nonpayable"||mutability==="payable","fallback cannot be constants","obj.stateMutability",mutability);if(consumeKeywords(obj,setify(["returns"])).has("returns")){const outputs=consumeParams(obj);assertArgument(outputs.length===1&&outputs[0].type==="bytes","invalid fallback outputs","obj.outputs",outputs.map(i=>i.format("minimal")).join(", "))}consumeEoi(obj);return new FallbackFragment(_guard$2,inputs,mutability==="payable")}if(obj.type==="receive"){return new FallbackFragment(_guard$2,[],true)}if(obj.type==="fallback"){const inputs=[ParamType.from("bytes")];const payable=obj.stateMutability==="payable";return new FallbackFragment(_guard$2,inputs,payable)}assertArgument(false,"invalid fallback description","obj",obj)}static isFragment(value){return value&&value[internal$1]===FallbackFragmentInternal}}class FunctionFragment extends NamedFragment{constant;outputs;stateMutability;payable;energy;constructor(guard,name,stateMutability,inputs,outputs,energy){super(guard,"function",name,inputs);Object.defineProperty(this,internal$1,{value:FunctionFragmentInternal});outputs=Object.freeze(outputs.slice());const constant=stateMutability==="view"||stateMutability==="pure";const payable=stateMutability==="payable";defineProperties(this,{constant:constant,energy:energy,outputs:outputs,payable:payable,stateMutability:stateMutability})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format))),outputs:this.outputs.map(o=>JSON.parse(o.format(format)))})}const result=[];if(format!=="sighash"){result.push("function")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"){if(this.stateMutability!=="nonpayable"){result.push(this.stateMutability)}if(this.outputs&&this.outputs.length){result.push("returns");result.push(joinParams(format,this.outputs))}if(this.energy!=null){result.push(`@${this.energy.toString()}`)}}return result.join(" ")}static getSelector(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new FunctionFragment(_guard$2,name,"view",params,[],null);return fragment.selector}static from(obj){if(FunctionFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FunctionFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("function",obj);const inputs=consumeParams(obj);const mutability=consumeMutability(obj);let outputs=[];if(consumeKeywords(obj,setify(["returns"])).has("returns")){outputs=consumeParams(obj)}const energy=consumeEnergy(obj);consumeEoi(obj);return new FunctionFragment(_guard$2,name,mutability,inputs,outputs,energy)}let stateMutability=obj.stateMutability;if(stateMutability==null){stateMutability="payable";if(typeof obj.constant==="boolean"){stateMutability="view";if(!obj.constant){stateMutability="payable";if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}}else if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}return new FunctionFragment(_guard$2,obj.name,stateMutability,obj.inputs?obj.inputs.map(ParamType.from):[],obj.outputs?obj.outputs.map(ParamType.from):[],obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===FunctionFragmentInternal}}class StructFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"struct",name,inputs);Object.defineProperty(this,internal$1,{value:StructFragmentInternal})}format(){throw new Error("@TODO")}static from(obj){if(typeof obj==="string"){return StructFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("struct",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new StructFragment(_guard$2,name,inputs)}return new StructFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===StructFragmentInternal}}const PanicReasons$1=new Map;PanicReasons$1.set(0,"GENERIC_PANIC");PanicReasons$1.set(1,"ASSERT_FALSE");PanicReasons$1.set(17,"OVERFLOW");PanicReasons$1.set(18,"DIVIDE_BY_ZERO");PanicReasons$1.set(33,"ENUM_RANGE_ERROR");PanicReasons$1.set(34,"BAD_STORAGE_DATA");PanicReasons$1.set(49,"STACK_UNDERFLOW");PanicReasons$1.set(50,"ARRAY_RANGE_ERROR");PanicReasons$1.set(65,"OUT_OF_MEMORY");PanicReasons$1.set(81,"UNINITIALIZED_FUNCTION_CALL");const paramTypeBytes=new RegExp(/^bytes([0-9]*)$/);const paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);let defaultCoder=null;function getBuiltinCallException(action,tx,data,abiCoder){let message="missing revert data";let reason=null;const invocation=null;let revert=null;if(data){message="execution reverted";const bytes=getBytes(data);data=hexlify(data);if(bytes.length===0){message+=" (no data present; likely require(false) occurred";reason="require(false)"}else if(bytes.length%32!==4){message+=" (could not decode reason; invalid data length)"}else if(hexlify(bytes.slice(0,4))==="0x08c379a0"){try{reason=abiCoder.decode(["string"],bytes.slice(4))[0];revert={signature:"Error(string)",name:"Error",args:[reason]};message+=`: ${JSON.stringify(reason)}`}catch(error){message+=" (could not decode reason; invalid string data)"}}else if(hexlify(bytes.slice(0,4))==="0x4e487b71"){try{const code=Number(abiCoder.decode(["uint256"],bytes.slice(4))[0]);revert={signature:"Panic(uint256)",name:"Panic",args:[code]};reason=`Panic due to ${PanicReasons$1.get(code)||"UNKNOWN"}(${code})`;message+=`: ${reason}`}catch(error){message+=" (could not decode panic code)"}}else{message+=" (unknown custom error)"}}const transaction={to:tx.to?getAddress(tx.to):null,data:tx.data||"0x"};if(tx.from){transaction.from=getAddress(tx.from)}return makeError(message,"CALL_EXCEPTION",{action:action,data:data,reason:reason,transaction:transaction,invocation:invocation,revert:revert})}class AbiCoder{#getCoder(param){if(param.isArray()){return new ArrayCoder(this.#getCoder(param.arrayChildren),param.arrayLength,param.name)}if(param.isTuple()){return new TupleCoder(param.components.map(c=>this.#getCoder(c)),param.name)}switch(param.baseType){case"address":return new AddressCoder(param.name);case"bool":return new BooleanCoder(param.name);case"string":return new StringCoder(param.name);case"bytes":return new BytesCoder(param.name);case"":return new NullCoder(param.name)}let match=param.type.match(paramTypeNumber);if(match){let size=parseInt(match[2]||"256");assertArgument(size!==0&&size<=256&&size%8===0,"invalid "+match[1]+" bit length","param",param);return new NumberCoder(size/8,match[1]==="int",param.name)}match=param.type.match(paramTypeBytes);if(match){let size=parseInt(match[1]);assertArgument(size!==0&&size<=32,"invalid bytes length","param",param);return new FixedBytesCoder(size,param.name)}assertArgument(false,"invalid type","type",param.type)}getDefaultValue(types){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.defaultValue()}encode(types,values){assertArgumentCount(values.length,types.length,"types/values length mismatch");const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");const writer=new Writer;coder.encode(writer,values);return writer.data}decode(types,data,loose){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.decode(new Reader(data,loose))}static defaultAbiCoder(){if(defaultCoder==null){defaultCoder=new AbiCoder}return defaultCoder}static getBuiltinCallException(action,tx,data){return getBuiltinCallException(action,tx,data,AbiCoder.defaultAbiCoder())}}function encodeBytes32String(text){const bytes=toUtf8Bytes(text);if(bytes.length>31){throw new Error("bytes32 string must be less than 32 bytes")}return zeroPadBytes(bytes,32)}function decodeBytes32String(_bytes){const data=getBytes(_bytes,"bytes");if(data.length!==32){throw new Error("invalid bytes32 - not 32 bytes long")}if(data[31]!==0){throw new Error("invalid bytes32 string - no null terminator")}let length=31;while(data[length-1]===0){length--}return toUtf8String(data.slice(0,length))}class LogDescription{fragment;name;signature;topic;args;constructor(fragment,topic,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,signature:signature,topic:topic,args:args})}}class TransactionDescription{fragment;name;args;signature;selector;value;constructor(fragment,selector,args,value){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector,value:value})}}class ErrorDescription{fragment;name;args;signature;selector;constructor(fragment,selector,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector})}}class Indexed{hash;_isIndexed;static isIndexed(value){return!!(value&&value._isIndexed)}constructor(hash){defineProperties(this,{hash:hash,_isIndexed:true})}}const PanicReasons={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"};const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:message=>{return`reverted with reason string ${JSON.stringify(message)}`}},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:code=>{let reason="unknown panic code";if(code>=0&&code<=255&&PanicReasons[code.toString()]){reason=PanicReasons[code.toString()]}return`reverted with panic code 0x${code.toString(16)} (${reason})`}}};class Interface{fragments;deploy;fallback;receive;#errors;#events;#functions;#abiCoder;constructor(fragments){let abi=[];if(typeof fragments==="string"){abi=JSON.parse(fragments)}else{abi=fragments}this.#functions=new Map;this.#errors=new Map;this.#events=new Map;const frags=[];for(const a of abi){try{frags.push(Fragment.from(a))}catch(error){console.log("EE",error)}}defineProperties(this,{fragments:Object.freeze(frags)});let fallback=null;let receive=false;this.#abiCoder=this.getAbiCoder();this.fragments.forEach((fragment,index)=>{let bucket;switch(fragment.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}defineProperties(this,{deploy:fragment});return;case"fallback":if(fragment.inputs.length===0){receive=true}else{assertArgument(!fallback||fragment.payable!==fallback.payable,"conflicting fallback fragments",`fragments[${index}]`,fragment);fallback=fragment;receive=fallback.payable}return;case"function":bucket=this.#functions;break;case"event":bucket=this.#events;break;case"error":bucket=this.#errors;break;default:return}const signature=fragment.format();if(bucket.has(signature)){return}bucket.set(signature,fragment)});if(!this.deploy){defineProperties(this,{deploy:ConstructorFragment.from("constructor()")})}defineProperties(this,{fallback:fallback,receive:receive})}format(minimal){const format=minimal?"minimal":"full";const abi=this.fragments.map(f=>f.format(format));return abi}formatJson(){const abi=this.fragments.map(f=>f.format("json"));return JSON.stringify(abi.map(j=>JSON.parse(j)))}getAbiCoder(){return AbiCoder.defaultAbiCoder()}#getFunction(key,values,forceUnique){if(isHexString(key)){const selector=key.toLowerCase();for(const fragment of this.#functions.values()){if(selector===fragment.selector){return fragment}}return null}if(key.indexOf("(")===-1){const matching=[];for(const[name,fragment]of this.#functions){if(name.split("(")[0]===key){matching.push(fragment)}}if(values){const lastValue=values.length>0?values[values.length-1]:null;let valueLength=values.length;let allowOptions=true;if(Typed.isTyped(lastValue)&&lastValue.type==="overrides"){allowOptions=false;valueLength--}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs.length;if(inputs!==valueLength&&(!allowOptions||inputs!==valueLength-1)){matching.splice(i,1)}}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs;for(let j=0;j=inputs.length){if(values[j].type==="overrides"){continue}matching.splice(i,1);break}if(values[j].type!==inputs[j].baseType){matching.splice(i,1);break}}}}if(matching.length===1&&values&&values.length!==matching[0].inputs.length){const lastArg=values[values.length-1];if(lastArg==null||Array.isArray(lastArg)||typeof lastArg!=="object"){matching.splice(0,1)}}if(matching.length===0){return null}if(matching.length>1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous function description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#functions.get(FunctionFragment.from(key).format());if(result){return result}return null}getFunctionName(key){const fragment=this.#getFunction(key,null,false);assertArgument(fragment,"no matching function","key",key);return fragment.name}hasFunction(key){return!!this.#getFunction(key,null,false)}getFunction(key,values){return this.#getFunction(key,values||null,true)}forEachFunction(callback){const names=Array.from(this.#functions.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i=0;i--){if(matching[i].inputs.length=0;i--){const inputs=matching[i].inputs;for(let j=0;j1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous event description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#events.get(EventFragment.from(key).format());if(result){return result}return null}getEventName(key){const fragment=this.#getEvent(key,null,false);assertArgument(fragment,"no matching event","key",key);return fragment.name}hasEvent(key){return!!this.#getEvent(key,null,false)}getEvent(key,values){return this.#getEvent(key,values||null,true)}forEachEvent(callback){const names=Array.from(this.#events.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i1){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous error description (i.e. ${matchStr})`,"name",key)}return matching[0]}key=ErrorFragment.from(key).format();if(key==="Error(string)"){return ErrorFragment.from("error Error(string)")}if(key==="Panic(uint256)"){return ErrorFragment.from("error Panic(uint256)")}const result=this.#errors.get(key);if(result){return result}return null}forEachError(callback){const names=Array.from(this.#errors.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i{if(param.type==="string"){return id(value)}else if(param.type==="bytes"){return sha256(hexlify(value))}if(param.type==="bool"&&typeof value==="boolean"){value=value?"0x01":"0x00"}if(param.type.match(/^u?int/)){value=toBeHex(value)}if(param.type==="address"){this.#abiCoder.encode(["address"],[value])}return zeroPadValue(hexlify(value),32)};values.forEach((value,index)=>{const param=fragment.inputs[index];if(!param.indexed){assertArgument(value==null,"cannot filter non-indexed parameters; must be null","contract."+param.name,value);return}if(value==null){topics.push(null)}else if(param.baseType==="array"||param.baseType==="tuple"){assertArgument(false,"filtering with tuples or arrays not supported","contract."+param.name,value)}else if(Array.isArray(value)){topics.push(value.map(value=>encodeTopic(param,value)))}else{topics.push(encodeTopic(param,value))}});while(topics.length&&topics[topics.length-1]===null){topics.pop()}return topics}encodeEventLog(fragment,values){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}const topics=[];const dataTypes=[];const dataValues=[];if(!fragment.anonymous){topics.push(fragment.topicHash)}assertArgument(values.length===fragment.inputs.length,"event arguments/values mismatch","values",values);fragment.inputs.forEach((param,index)=>{const value=values[index];if(param.indexed){if(param.type==="string"){topics.push(id(value))}else if(param.type==="bytes"){topics.push(sha256(value))}else if(param.baseType==="tuple"||param.baseType==="array"){throw new Error("not implemented")}else{topics.push(this.#abiCoder.encode([param.type],[value]))}}else{dataTypes.push(param);dataValues.push(value)}});return{data:this.#abiCoder.encode(dataTypes,dataValues),topics:topics}}decodeEventLog(fragment,data,topics){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}if(topics!=null&&!fragment.anonymous){const eventTopic=fragment.topicHash;assertArgument(isHexString(topics[0],32)&&topics[0].toLowerCase()===eventTopic,"fragment/topic mismatch","topics[0]",topics[0]);topics=topics.slice(1)}const indexed=[];const nonIndexed=[];const dynamic=[];fragment.inputs.forEach((param,index)=>{if(param.indexed){if(param.type==="string"||param.type==="bytes"||param.baseType==="tuple"||param.baseType==="array"){indexed.push(ParamType.from({type:"bytes32",name:param.name}));dynamic.push(true)}else{indexed.push(param);dynamic.push(false)}}else{nonIndexed.push(param);dynamic.push(false)}});const resultIndexed=topics!=null?this.#abiCoder.decode(indexed,concat(topics)):null;const resultNonIndexed=this.#abiCoder.decode(nonIndexed,data,true);const values=[];const keys=[];let nonIndexedIndex=0,indexedIndex=0;fragment.inputs.forEach((param,index)=>{let value=null;if(param.indexed){if(resultIndexed==null){value=new Indexed(null)}else if(dynamic[index]){value=new Indexed(resultIndexed[indexedIndex++])}else{try{value=resultIndexed[indexedIndex++]}catch(error){value=error}}}else{try{value=resultNonIndexed[nonIndexedIndex++]}catch(error){value=error}}values.push(value);keys.push(param.name||null)});return Result.fromItems(values,keys)}parseTransaction(tx){const data=getBytes(tx.data,"tx.data");const value=getBigInt(tx.value!=null?tx.value:0,"tx.value");const fragment=this.getFunction(hexlify(data.slice(0,4)));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,data.slice(4));return new TransactionDescription(fragment,fragment.selector,args,value)}parseCallResult(data){throw new Error("@TODO")}parseLog(log){const fragment=this.getEvent(log.topics[0]);if(!fragment||fragment.anonymous){return null}return new LogDescription(fragment,fragment.topicHash,this.decodeEventLog(fragment,log.data,log.topics))}parseError(data){const hexData=hexlify(data);const fragment=this.getError(dataSlice(hexData,0,4));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,dataSlice(hexData,4));return new ErrorDescription(fragment,fragment.selector,args)}static from(value){if(value instanceof Interface){return value}if(typeof value==="string"){return new Interface(JSON.parse(value))}if(typeof value.format==="function"){return new Interface(value.format("json"))}return new Interface(value)}}const logger=new Logger("contract-address/0.0.1");function getCreateAddress(tx){const from=getAddress(tx.from);const nonce=getBigInt(tx.nonce,"tx.nonce");let nonceHex=nonce.toString(16);if(nonceHex==="0"){nonceHex="0x"}else if(nonceHex.length%2){nonceHex="0x0"+nonceHex}else{nonceHex="0x"+nonceHex}return getAddress(from)}function getCreate2Address(from,salt,initCodeHash){if(hexDataLength(salt)!==32){logger.throwArgumentError("salt must be 32 bytes","salt",salt)}if(hexDataLength(initCodeHash)!==32){logger.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",initCodeHash)}const val=hexDataSlice(sha256(concat(["0xff",getAddress(from),salt,initCodeHash])),12);console.log({"contract-address/74=>should be string":val});const prefix=from.substring(2,4);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function isAddressable(value){return value&&typeof value.getAddress==="function"}function isAddress(value){try{getAddress(value);return true}catch(error){}return false}async function checkAddress(target,promise){const result=await promise;if(result==null||result==="0x0000000000000000000000000000000000000000"){assert(typeof target!=="string","unconfigured name","UNCONFIGURED_NAME",{value:target});assertArgument(false,"invalid AddressLike value; did not resolve to a value address","target",target)}return getAddress(result)}function resolveAddress(target){if(typeof target==="string"){return getAddress(target)}else if(isAddressable(target)){return checkAddress(target,target.getAddress())}else if(target&&typeof target.then==="function"){return checkAddress(target,target)}assertArgument(false,"unsupported addressable value","target",target)}const BN_0$2=BigInt(0);function getValue(value){if(value==null){return null}return value}function toJson(value){if(value==null){return null}return value.toString()}class FeeData{energyPrice;constructor(energyPrice){defineProperties(this,{energyPrice:getValue(energyPrice)})}toJSON(){const{energyPrice}=this;return{_type:"FeeData",energyPrice:toJson(energyPrice)}}}function copyRequest(req){const result={};if(req.to){result.to=req.to}if(req.from){result.from=req.from}if(req.data){result.data=hexlify(req.data)}const bigIntKeys="networkId,energyLimit,energyPrice,value".split(/,/);for(const key of bigIntKeys){if(!(key in req)||req[key]==null){continue}result[key]=getBigInt(req[key],`request.${key}`)}const numberKeys="type,nonce".split(/,/);for(const key of numberKeys){if(!(key in req)||req[key]==null){continue}result[key]=getNumber(req[key],`request.${key}`)}if("blockTag"in req){result.blockTag=req.blockTag}if("enableCcipRead"in req){result.enableCcipReadEnabled=!!req.enableCcipRead}if("customData"in req){result.customData=req.customData}return result}class Block{provider;number;hash;timestamp;parentHash;nonce;difficulty;energyLimit;energyUsed;miner;extraData;baseFeePerEnergy;#transactions;constructor(block,provider){this.#transactions=block.transactions.map(tx=>{if(typeof tx!=="string"){return new TransactionResponse(tx,provider)}return tx});defineProperties(this,{provider:provider,hash:getValue(block.hash),number:block.number,timestamp:block.timestamp,parentHash:block.parentHash,nonce:block.nonce,difficulty:block.difficulty,energyLimit:block.energyLimit,energyUsed:block.energyUsed,miner:block.miner,extraData:block.extraData,baseFeePerEnergy:getValue(block.baseFeePerEnergy)})}get transactions(){return this.#transactions.map(tx=>{if(typeof tx==="string"){return tx}return tx.hash})}get prefetchedTransactions(){const txs=this.#transactions.slice();if(txs.length===0){return[]}assert(typeof txs[0]==="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"});return txs}toJSON(){const{baseFeePerEnergy,difficulty,extraData,energyLimit,energyUsed,hash,miner,nonce,number,parentHash,timestamp,transactions}=this;return{_type:"Block",baseFeePerEnergy:toJson(baseFeePerEnergy),difficulty:toJson(difficulty),extraData:extraData,energyLimit:toJson(energyLimit),energyUsed:toJson(energyUsed),hash:hash,miner:miner,nonce:nonce,number:number,parentHash:parentHash,timestamp:timestamp,transactions:transactions}}[Symbol.iterator](){let index=0;const txs=this.transactions;return{next:()=>{if(index{return new Log(log,provider)}));defineProperties(this,{provider:provider,to:tx.to,from:tx.from,contractAddress:tx.contractAddress,hash:tx.hash,index:tx.index,blockHash:tx.blockHash,blockNumber:tx.blockNumber,logsBloom:tx.logsBloom,energyUsed:tx.energyUsed,cumulativeEnergyUsed:tx.cumulativeEnergyUsed,energyPrice:tx.effectiveEnergyPrice||tx.energyPrice,status:tx.status,root:tx.root})}get logs(){return this.#logs}toJSON(){const{to,from,contractAddress,hash,index,blockHash,blockNumber,logsBloom,logs,status,root}=this;return{_type:"TransactionReceipt",blockHash:blockHash,blockNumber:blockNumber,contractAddress:contractAddress,cumulativeEnergyUsed:toJson(this.cumulativeEnergyUsed),from:from,energyPrice:toJson(this.energyPrice),energyUsed:toJson(this.energyUsed),hash:hash,index:index,logs:logs,logsBloom:logsBloom,root:root,status:status,to:to}}get length(){return this.logs.length}[Symbol.iterator](){let index=0;return{next:()=>{if(index{if(stopScanning){return null}const{blockNumber,nonce}=await resolveProperties({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(nonce=confirms){return receipt}}else{await checkReplacement();if(confirms===0){return null}}const waiter=new Promise((resolve,reject)=>{const cancellers=[];const cancel=()=>{cancellers.forEach(c=>c())};cancellers.push(()=>{stopScanning=true});if(timeout>0){const timer=setTimeout(()=>{cancel();reject(makeError("wait for transaction timeout","TIMEOUT"))},timeout);cancellers.push(()=>{clearTimeout(timer)})}const txListener=async receipt=>{if(await receipt.confirmations()>=confirms){cancel();resolve(receipt)}};cancellers.push(()=>{this.provider.off(this.hash,txListener)});this.provider.on(this.hash,txListener);if(startBlock>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(error){if(isError(error,"TRANSACTION_REPLACED")){cancel();reject(error);return}}if(!stopScanning){this.provider.once("block",replaceListener)}};cancellers.push(()=>{this.provider.off("block",replaceListener)});this.provider.once("block",replaceListener)}});return await waiter}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}removedEvent(){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createRemovedTransactionFilter(this)}reorderedEvent(other){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});assert(!other||other.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createReorderedTransactionFilter(this,other)}replaceableTransaction(startBlock){assertArgument(Number.isInteger(startBlock)&&startBlock>=0,"invalid startBlock","startBlock",startBlock);const tx=new TransactionResponse(this,this.provider);tx.#startBlock=startBlock;return tx}}function createOrphanedBlockFilter(block){return{orphan:"drop-block",hash:block.hash,number:block.number}}function createReorderedTransactionFilter(tx,other){return{orphan:"reorder-transaction",tx:tx,other:other}}function createRemovedTransactionFilter(tx){return{orphan:"drop-transaction",tx:tx}}function createRemovedLogFilter(log){return{orphan:"drop-log",log:{transactionHash:log.transactionHash,blockHash:log.blockHash,blockNumber:log.blockNumber,address:log.address,data:log.data,topics:Object.freeze(log.topics.slice()),index:log.index}}}class EventLog extends Log{interface;fragment;args;constructor(log,iface,fragment){super(log,log.provider);const args=iface.decodeEventLog(fragment,log.data,log.topics);defineProperties(this,{args:args,fragment:fragment,interface:iface})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class ContractTransactionReceipt extends TransactionReceipt{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}get logs(){return super.logs.map(log=>{const fragment=log.topics.length?this.#iface.getEvent(log.topics[0]):null;if(fragment){return new EventLog(log,this.#iface,fragment)}else{return log}})}}class ContractTransactionResponse extends TransactionResponse{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}async wait(confirms){const receipt=await super.wait();if(receipt==null){return null}return new ContractTransactionReceipt(this.#iface,this.provider,receipt)}}class ContractUnknownEventPayload extends EventPayload{log;constructor(contract,listener,filter,log){super(contract,listener,filter);defineProperties(this,{log:log})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class ContractEventPayload extends ContractUnknownEventPayload{constructor(contract,listener,filter,fragment,_log){super(contract,listener,filter,new EventLog(_log,contract.interface,fragment));const args=contract.interface.decodeEventLog(fragment,this.log.data,this.log.topics);defineProperties(this,{args:args,fragment:fragment})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const BN_0$1=BigInt(0);function canCall(value){return value&&typeof value.call==="function"}function canEstimate(value){return value&&typeof value.estimateEnergy==="function"}function canResolve(value){return value&&typeof value.resolveName==="function"}function canSend(value){return value&&typeof value.sendTransaction==="function"}class PreparedTopicFilter{#filter;fragment;constructor(contract,fragment,args){defineProperties(this,{fragment:fragment});if(fragment.inputs.length{const arg=args[index];if(arg==null){return null}return param.walkAsync(args[index],(type,value)=>{if(type==="address"){return resolveAddress(value)}return value})}));return contract.interface.encodeFilterTopics(fragment,resolvedArgs)}()}getTopicFilter(){return this.#filter}}function getRunner(value,feature){if(value==null){return null}if(typeof value[feature]==="function"){return value}if(value.provider&&typeof value.provider[feature]==="function"){return value.provider}return null}function getProvider(value){if(value==null){return null}return value.provider||null}async function copyOverrides(arg,allowed){const overrides=copyRequest(Typed.dereference(arg,"overrides"));assertArgument(overrides.to==null||(allowed||[]).indexOf("to")>=0,"cannot override to","overrides.to",overrides.to);assertArgument(overrides.data==null||(allowed||[]).indexOf("data")>=0,"cannot override data","overrides.data",overrides.data);if(overrides.from){overrides.from=await resolveAddress(overrides.from)}return overrides}async function resolveArgs(_runner,inputs,args){return await Promise.all(inputs.map((param,index)=>{return param.walkAsync(args[index],(type,value)=>{value=Typed.dereference(value,type);if(type==="address"){return resolveAddress(value)}return value})}))}function buildWrappedFallback(contract){const populateTransaction=async function(overrides){const tx=await copyOverrides(overrides,["data"]);tx.to=await contract.getAddress();const iface=contract.interface;const payable=iface.receive||iface.fallback&&iface.fallback.payable;assertArgument(payable||(tx.value||BN_0$1)===BN_0$1,"cannot send value to non-payable contract","overrides.value",tx.value);assertArgument(iface.fallback||(tx.data||"0x")==="0x","cannot send data to receive-only contract","overrides.data",tx.data);return tx};const staticCall=async function(overrides){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(overrides);try{return await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}};const send=async function(overrides){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(overrides));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(overrides){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(overrides))};const method=async overrides=>{return await send(overrides)};defineProperties(method,{_contract:contract,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall});return method}function buildWrappedMethod(contract,key){const getFragment=function(...args){const fragment=contract.interface.getFunction(key,args);assert(fragment,"no matching fragment in getFragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const populateTransaction=async function(...args){const fragment=getFragment(...args);let overrides={};if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("internal error: fragment inputs doesn't match arguments; should not happen")}const resolvedArgs=await resolveArgs(contract.runner,fragment.inputs,args);return Object.assign({},overrides,await resolveProperties({to:contract.getAddress(),data:contract.interface.encodeFunctionData(fragment,resolvedArgs)}))};const staticCall=async function(...args){const result=await staticCallResult(...args);if(result.length===1){return result[0]}return result};const send=async function(...args){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(...args));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(...args){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(...args))};const staticCallResult=async function(...args){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(...args);let result="0x";try{result=await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}const fragment=getFragment(...args);return contract.interface.decodeFunctionResult(fragment,result)};const method=async(...args)=>{const fragment=getFragment(...args);if(fragment.constant){return await staticCall(...args)}return await send(...args)};defineProperties(method,{name:contract.interface.getFunctionName(key),_contract:contract,_key:key,getFragment:getFragment,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getFunction(key);assert(fragment,"no matching fragment in defineProperty","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}function buildWrappedEvent(contract,key){const getFragment=function(...args){const fragment=contract.interface.getEvent(key,args);assert(fragment,"no matching fragment in","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const method=function(...args){return new PreparedTopicFilter(contract,getFragment(...args),args)};defineProperties(method,{name:contract.interface.getEventName(key),_contract:contract,_key:key,getFragment:getFragment});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getEvent(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}const internal=Symbol.for("_corebcInternal_contract");const internalValues=new WeakMap;function setInternal(contract,values){internalValues.set(contract[internal],values)}function getInternal(contract){return internalValues.get(contract[internal])}function isDeferred(value){return value&&typeof value==="object"&&"getTopicFilter"in value&&typeof value.getTopicFilter==="function"&&value.fragment}async function getSubInfo(contract,event){let topics;let fragment=null;if(Array.isArray(event)){const topicHashify=function(name){if(isHexString(name,32)){return name}const fragment=contract.interface.getEvent(name);assertArgument(fragment,"unknown fragment","name",name);return fragment.topicHash};topics=event.map(e=>{if(e==null){return null}if(Array.isArray(e)){return e.map(topicHashify)}return topicHashify(e)})}else if(event==="*"){topics=[null]}else if(typeof event==="string"){if(isHexString(event,32)){topics=[event]}else{fragment=contract.interface.getEvent(event);assertArgument(fragment,"unknown fragment","event",event);topics=[fragment.topicHash]}}else if(isDeferred(event)){topics=await event.getTopicFilter()}else if("fragment"in event){fragment=event.fragment;topics=[fragment.topicHash]}else{assertArgument(false,"unknown event name","event",event)}topics=topics.map(t=>{if(t==null){return null}if(Array.isArray(t)){const items=Array.from(new Set(t.map(t=>t.toLowerCase())).values());if(items.length===1){return items[0]}items.sort();return items}return t.toLowerCase()});const tag=topics.map(t=>{if(t==null){return"null"}if(Array.isArray(t)){return t.join("|")}return t}).join("&");return{fragment:fragment,tag:tag,topics:topics}}async function hasSub(contract,event){const{subs}=getInternal(contract);return subs.get((await getSubInfo(contract,event)).tag)||null}async function getSub(contract,operation,event){const provider=getProvider(contract.runner);assert(provider,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:operation});const{fragment,tag,topics}=await getSubInfo(contract,event);const{addr,subs}=getInternal(contract);let sub=subs.get(tag);if(!sub){const address=addr?addr:contract;const filter={address:address,topics:topics};const listener=log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=contract.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){const _foundFragment=foundFragment;const args=fragment?contract.interface.decodeEventLog(fragment,log.data,log.topics):[];emit(contract,event,args,listener=>{return new ContractEventPayload(contract,listener,event,_foundFragment,log)})}else{emit(contract,event,[],listener=>{return new ContractUnknownEventPayload(contract,listener,event,log)})}};let starting=[];const start=()=>{if(starting.length){return}starting.push(provider.on(filter,listener))};const stop=async()=>{if(starting.length==0){return}let started=starting;starting=[];await Promise.all(started);provider.off(filter,listener)};sub={tag:tag,listeners:[],start:start,stop:stop};subs.set(tag,sub)}return sub}let lastEmit=Promise.resolve();async function _emit(contract,event,args,payloadFunc){await lastEmit;const sub=await hasSub(contract,event);if(!sub){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const passArgs=Array.from(args);if(payloadFunc){passArgs.push(payloadFunc(once?null:listener))}try{listener.call(contract,...passArgs)}catch(error){}return!once});return count>0}async function emit(contract,event,args,payloadFunc){try{await lastEmit}catch(error){}const resultPromise=_emit(contract,event,args,payloadFunc);lastEmit=resultPromise;return await resultPromise}const passProperties=["then"];class BaseContract{target;interface;runner;filters;[internal];fallback;constructor(target,abi,runner,_deployTx){if(runner==null){runner=null}const iface=Interface.from(abi);defineProperties(this,{target:target,runner:runner,interface:iface});Object.defineProperty(this,internal,{value:{}});let addrPromise;let addr=null;let deployTx=null;if(_deployTx){const provider=getProvider(runner);deployTx=new ContractTransactionResponse(this.interface,provider,_deployTx)}let subs=new Map;if(typeof target==="string"){if(isHexString(target)){addr=target;addrPromise=Promise.resolve(target)}else{const resolver=getRunner(runner,"resolveName");if(!canResolve(resolver)){throw makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"})}addrPromise=resolver.resolveName(target).then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}}else{addrPromise=target.getAddress().then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}setInternal(this,{addrPromise:addrPromise,addr:addr,deployTx:deployTx,subs:subs});const filters=new Proxy({},{get:(target,_prop,receiver)=>{if(passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=this.getEvent(prop);if(result){return result}throw new Error(`unknown contract event: ${prop}`)},has:(target,prop)=>{if(passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return Reflect.has(target,prop)||this.interface.hasEvent(String(prop))}});defineProperties(this,{filters:filters});defineProperties(this,{fallback:iface.receive||iface.fallback?buildWrappedFallback(this):null});return new Proxy(this,{get:(target,_prop,receiver)=>{if(_prop in target||passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=target.getFunction(prop);if(result){return result}throw new Error(`unknown contract method: ${prop}`)},has:(target,prop)=>{if(prop in target||passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return target.interface.hasFunction(String(prop))}})}connect(runner){return new BaseContract(this.target,this.interface,runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const provider=getProvider(this.runner);assert(provider,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const code=await provider.getCode(await this.getAddress());if(code==="0x"){return null}return code}async waitForDeployment(){const deployTx=this.deploymentTransaction();if(deployTx){await deployTx.wait();return this}const code=await this.getDeployedCode();if(code!=null){return this}const provider=getProvider(this.runner);assert(provider!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"});return new Promise((resolve,reject)=>{const checkCode=async()=>{try{const code=await this.getDeployedCode();if(code!=null){return resolve(this)}provider.once("block",checkCode)}catch(error){reject(error)}};checkCode()})}deploymentTransaction(){return getInternal(this).deployTx}getFunction(key){if(typeof key!=="string"){key=key.format()}const func=buildWrappedMethod(this,key);return func}getEvent(key){if(typeof key!=="string"){key=key.format()}return buildWrappedEvent(this,key)}async queryTransaction(hash){throw new Error("@TODO")}async queryFilter(event,fromBlock,toBlock){if(fromBlock==null){fromBlock=0}if(toBlock==null){toBlock="latest"}const{addr,addrPromise}=getInternal(this);const address=addr?addr:await addrPromise;const{fragment,topics}=await getSubInfo(this,event);const filter={address:address,topics:topics,fromBlock:fromBlock,toBlock:toBlock};const provider=getProvider(this.runner);assert(provider,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"});return(await provider.getLogs(filter)).map(log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=this.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){return new EventLog(log,this.interface,foundFragment)}else{return new Log(log,provider)}})}async on(event,listener){const sub=await getSub(this,"on",event);sub.listeners.push({listener:listener,once:false});sub.start();return this}async once(event,listener){const sub=await getSub(this,"once",event);sub.listeners.push({listener:listener,once:true});sub.start();return this}async emit(event,...args){return await emit(this,event,args,null)}async listenerCount(event){if(event){const sub=await hasSub(this,event);if(!sub){return 0}return sub.listeners.length}const{subs}=getInternal(this);let total=0;for(const{listeners}of subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}const{subs}=getInternal(this);let result=[];for(const{listeners}of subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await hasSub(this,event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(listener==null||sub.listeners.length===0){sub.stop();getInternal(this).subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return this}sub.stop();getInternal(this).subs.delete(sub.tag)}else{const{subs}=getInternal(this);for(const{tag,stop}of subs.values()){stop();subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return await this.off(event,listener)}static buildClass(abi){class CustomContract extends BaseContract{constructor(address,runner=null){super(address,abi,runner)}}return CustomContract}static from(target,abi,runner){if(runner==null){runner=null}const contract=new this(target,abi,runner);return contract}static isIndexed(value){return Indexed.isIndexed(value)}}function _ContractBase(){return BaseContract}class Contract extends _ContractBase(){}class ContractFactory{interface;bytecode;runner;constructor(abi,bytecode,runner){const iface=Interface.from(abi);if(bytecode instanceof Uint8Array){bytecode=hexlify(getBytes(bytecode))}else if(typeof bytecode==="string"){bytecode=bytecode}else if(isBytes$1(bytecode)){bytecode=hexlify(bytecode)}else if(bytecode&&typeof bytecode.object==="string"){bytecode=bytecode.object}else{bytecode="!"}defineProperties(this,{bytecode:bytecode,interface:iface,runner:runner||null})}async getDeployTransaction(...args){let overrides={};const fragment=this.interface.deploy;if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("incorrect number of arguments to constructor")}const resolvedArgs=await resolveArgs(this.runner,fragment.inputs,args);const data=concat([this.bytecode,this.interface.encodeDeploy(resolvedArgs)]);return Object.assign({},overrides,{data:data})}async deploy(...args){const tx=await this.getDeployTransaction(...args);assert(this.runner&&typeof this.runner.sendTransaction==="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const sentTx=await this.runner.sendTransaction(tx);const address=getCreateAddress(sentTx);return new BaseContract(address,this.interface,this.runner,sentTx)}connect(runner){return new ContractFactory(this.interface,this.bytecode,runner)}static fromSolidity(output,runner){assertArgument(output!=null,"bad compiler output","output",output);if(typeof output==="string"){output=JSON.parse(output)}const abi=output.abi;let bytecode="";if(output.bytecode){bytecode=output.bytecode}else if(output.evm&&output.evm.bytecode){bytecode=output.evm.bytecode}return new this(abi,bytecode,runner)}}const BN_0=BigInt(0);function allowNull(format,nullValue){return function(value){if(value==null){return nullValue}return format(value)}}function arrayOf(format){return array=>{if(!Array.isArray(array)){throw new Error("not an array")}return array.map(i=>format(i))}}function object(format,altNames){return value=>{const result={};for(const key in format){let srcKey=key;if(altNames&&key in altNames&&!(srcKey in value)){for(const altKey of altNames[key]){if(altKey in value){srcKey=altKey;break}}}try{const nv=format[key](value[srcKey]);if(nv!==undefined){result[key]=nv}}catch(error){const message=error instanceof Error?error.message:"not-an-error";assert(false,`invalid value for value.${key} (${message})`,"BAD_DATA",{value:value})}}return result}}function formatBoolean(value){switch(value){case true:case"true":return true;case false:case"false":return false}assertArgument(false,`invalid boolean; ${JSON.stringify(value)}`,"value",value)}function formatData(value){assertArgument(isHexString(value,true),"invalid data","value",value);return value}function formatHash(value){assertArgument(isHexString(value,32),"invalid hash","value",value);return value}const _formatLog=object({address:getAddress,blockHash:formatHash,blockNumber:getNumber,data:formatData,index:getNumber,removed:allowNull(formatBoolean,false),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:getNumber},{index:["logIndex"]});function formatLog(value){return _formatLog(value)}const _formatBlock=object({hash:allowNull(formatHash),parentHash:formatHash,number:getNumber,timestamp:getNumber,nonce:allowNull(formatData),difficulty:getBigInt,energyLimit:getBigInt,energyUsed:getBigInt,miner:allowNull(getAddress),extraData:formatData,baseFeePerEnergy:allowNull(getBigInt)});function formatBlock(value){const result=_formatBlock(value);result.transactions=value.transactions.map(tx=>{if(typeof tx==="string"){return tx}return formatTransactionResponse(tx)});return result}const _formatReceiptLog=object({transactionIndex:getNumber,blockNumber:getNumber,transactionHash:formatHash,address:getAddress,topics:arrayOf(formatHash),data:formatData,index:getNumber,blockHash:formatHash},{index:["logIndex"]});function formatReceiptLog(value){return _formatReceiptLog(value)}const _formatTransactionReceipt=object({to:allowNull(getAddress,null),from:allowNull(getAddress,null),contractAddress:allowNull(getAddress,null),index:getNumber,root:allowNull(hexlify),energyUsed:getBigInt,logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf(formatReceiptLog),blockNumber:getNumber,cumulativeEnergyUsed:getBigInt,effectiveEnergyPrice:allowNull(getBigInt),status:allowNull(getNumber),type:allowNull(getNumber,0)},{effectiveEnergyPrice:["energyPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionReceipt(value){return _formatTransactionReceipt(value)}function formatTransactionResponse(value){if(value.to&&!getAddress(value.to)&&getBigInt(value.to)===BN_0){value.to="0x0000000000000000000000000000000000000000"}const result=object({hash:formatHash,type:value=>{if(value==="0x"||value==null){return 0}return getNumber(value)},accessList:allowNull(accessListify,null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(getNumber,null),transactionIndex:allowNull(getNumber,null),from:getAddress,maxFeePerEnergy:allowNull(getBigInt),energyLimit:getBigInt,to:allowNull(getAddress,null),value:getBigInt,nonce:getNumber,data:formatData,creates:allowNull(getAddress,null),networkId:allowNull(getBigInt,null)},{data:["input"],energyLimit:["energy"]})(value);if(result.to==null&&result.creates==null){result.creates=getCreateAddress(result)}if(value.signature){result.signature=value.signature}else{result.signature=value}if(result.networkId==null){const networkId=result.signature.legacynetworkId;if(networkId!=null){result.networkId=networkId}}if(result.blockHash&&getBigInt(result.blockHash)===BN_0){result.blockHash=null}return result}class NetworkPlugin{name;constructor(name){defineProperties(this,{name:name})}clone(){return new NetworkPlugin(this.name)}}class EnergyCostPlugin extends NetworkPlugin{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(effectiveBlock,costs){if(effectiveBlock==null){effectiveBlock=0}super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock||0}`);const props={effectiveBlock:effectiveBlock};function set(name,nullish){let value=(costs||{})[name];if(value==null){value=nullish}assertArgument(typeof value==="number",`invalud value for ${name}`,"costs",costs);props[name]=value}set("txBase",21e3);set("txCreate",32e3);set("txDataZero",4);set("txDataNonzero",16);set("txAccessListStorageKey",1900);set("txAccessListAddress",2400);defineProperties(this,props)}clone(){return new EnergyCostPlugin(this.effectiveBlock,this)}}class FeeDataNetworkPlugin extends NetworkPlugin{#feeDataFunc;get feeDataFunc(){return this.#feeDataFunc}constructor(feeDataFunc){super("org.corebc.plugins.network.FeeData");this.#feeDataFunc=feeDataFunc}async getFeeData(provider){return await this.#feeDataFunc(provider)}clone(){return new FeeDataNetworkPlugin(this.#feeDataFunc)}}const Networks=new Map;class Network{#name;#networkId;#plugins;constructor(name,networkId){this.#name=name;this.#networkId=getBigInt(networkId);this.#plugins=new Map}toJSON(){return{name:this.name,networkId:String(this.networkId)}}get name(){return this.#name}set name(value){this.#name=value}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value,"networkId")}matches(other){if(other==null){return false}if(typeof other==="string"){try{return this.networkId===getBigInt(other)}catch(error){}return this.name===other}if(typeof other==="number"||typeof other==="bigint"){try{return this.networkId===getBigInt(other)}catch(error){}return false}if(typeof other==="object"){if(other.networkId!=null){try{return this.networkId===getBigInt(other.networkId)}catch(error){}return false}if(other.name!=null){return this.name===other.name}return false}return false}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.clone());return this}getPlugin(name){return this.#plugins.get(name)||null}getPlugins(basename){return this.plugins.filter(p=>p.name.split("#")[0]===basename)}clone(){const clone=new Network(this.name,this.networkId);this.plugins.forEach(plugin=>{clone.attachPlugin(plugin.clone())});return clone}computeIntrinsicEnergy(tx){const costs=this.getPlugin("org.corebc.plugins.network.EnergyCost")||new EnergyCostPlugin;let energy=costs.txBase;if(tx.to==null){energy+=costs.txCreate}if(tx.data){for(let i=2;i{Network.register(name,func)})}}registerEth("mainnet",1,{altNames:["homestead"]});registerEth("ropsten",3,{});registerEth("rinkeby",4,{});registerEth("goerli",5,{});registerEth("kovan",42,{});registerEth("sepolia",11155111,{});registerEth("classic",61,{});registerEth("classicKotti",6,{});registerEth("xdai",100,{})}function copy$2(obj){return JSON.parse(JSON.stringify(obj))}class PollingBlockSubscriber{#provider;#poller;#interval;#blockNumber;constructor(provider){this.#provider=provider;this.#poller=null;this.#interval=4e3;this.#blockNumber=-2}get pollingInterval(){return this.#interval}set pollingInterval(value){this.#interval=value}async#poll(){try{const blockNumber=await this.#provider.getBlockNumber();if(this.#blockNumber===-2){this.#blockNumber=blockNumber;return}if(blockNumber!==this.#blockNumber){for(let b=this.#blockNumber+1;b<=blockNumber;b++){if(this.#poller==null){return}await this.#provider.emit("block",b)}this.#blockNumber=blockNumber}}catch(error){}if(this.#poller==null){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval)}start(){if(this.#poller){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval);this.#poll()}stop(){if(!this.#poller){return}this.#provider._clearTimeout(this.#poller);this.#poller=null}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}class OnBlockSubscriber{#provider;#poll;#running;constructor(provider){this.#provider=provider;this.#running=false;this.#poll=blockNumber=>{this._poll(blockNumber,this.#provider)}}async _poll(blockNumber,provider){throw new Error("sub-classes must override this")}start(){if(this.#running){return}this.#running=true;this.#poll(-2);this.#provider.on("block",this.#poll)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poll)}pause(dropWhilePaused){this.stop()}resume(){this.start()}}class PollingOrphanSubscriber extends OnBlockSubscriber{#filter;constructor(provider,filter){super(provider);this.#filter=copy$2(filter)}async _poll(blockNumber,provider){throw new Error("@TODO")}}class PollingTransactionSubscriber extends OnBlockSubscriber{#hash;constructor(provider,hash){super(provider);this.#hash=hash}async _poll(blockNumber,provider){const tx=await provider.getTransactionReceipt(this.#hash);if(tx){provider.emit(this.#hash,tx)}}}class PollingEventSubscriber{#provider;#filter;#poller;#running;#blockNumber;constructor(provider,filter){this.#provider=provider;this.#filter=copy$2(filter);this.#poller=this.#poll.bind(this);this.#running=false;this.#blockNumber=-2}async#poll(blockNumber){if(this.#blockNumber===-2){return}const filter=copy$2(this.#filter);filter.fromBlock=this.#blockNumber+1;filter.toBlock=blockNumber;const logs=await this.#provider.getLogs(filter);if(logs.length===0){if(this.#blockNumber{this.#blockNumber=blockNumber})}this.#provider.on("block",this.#poller)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poller)}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}const MAX_CCIP_REDIRECTS=10;function isPromise(value){return value&&typeof value.then==="function"}function getTag(prefix,value){return prefix+":"+JSON.stringify(value,(k,v)=>{if(v==null){return"null"}if(typeof v==="bigint"){return`bigint:${v.toString()}`}if(typeof v==="string"){return v.toLowerCase()}if(typeof v==="object"&&!Array.isArray(v)){const keys=Object.keys(v);keys.sort();return keys.reduce((accum,key)=>{accum[key]=v[key];return accum},{})}return v})}class UnmanagedSubscriber{name;constructor(name){defineProperties(this,{name:name})}start(){}stop(){}pause(dropWhilePaused){}resume(){}}function copy$1(value){return JSON.parse(JSON.stringify(value))}function concisify(items){items=Array.from(new Set(items).values());items.sort();return items}async function getSubscription(_event,provider){if(_event==null){throw new Error("invalid event")}if(Array.isArray(_event)){_event={topics:_event}}if(typeof _event==="string"){switch(_event){case"block":case"pending":case"debug":case"error":case"network":{return{type:_event,tag:_event}}}}if(isHexString(_event,32)){const hash=_event.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:hash}),hash:hash}}if(_event.orphan){const event=_event;return{type:"orphan",tag:getTag("orphan",event),filter:copy$1(event)}}if(_event.address||_event.topics){const event=_event;const filter={topics:(event.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()})};if(event.address){const addresses=[];const promises=[];const addAddress=addr=>{if(isHexString(addr)){addresses.push(addr)}else{promises.push((async()=>{addresses.push(await resolveAddress(addr))})())}};if(Array.isArray(event.address)){event.address.forEach(addAddress)}else{addAddress(event.address)}if(promises.length){await Promise.all(promises)}filter.address=concisify(addresses.map(a=>a.toLowerCase()))}return{filter:filter,tag:getTag("event",filter),type:"event"}}assertArgument(false,"unknown ProviderEvent","event",_event)}function getTime$1(){return(new Date).getTime()}class AbstractProvider{#subs;#plugins;#pausedState;#networkPromise;#anyNetwork;#performCache;#lastBlockNumber;#nextTimer;#timers;#disableCcipRead;constructor(_network){if(_network==="any"){this.#anyNetwork=true;this.#networkPromise=null}else if(_network){const network=Network.from(_network);this.#anyNetwork=false;this.#networkPromise=Promise.resolve(network);setTimeout(()=>{this.emit("network",network,null)},0)}else{this.#anyNetwork=false;this.#networkPromise=null}this.#lastBlockNumber=-1;this.#performCache=new Map;this.#subs=new Map;this.#plugins=new Map;this.#pausedState=null;this.#nextTimer=1;this.#timers=new Map;this.#disableCcipRead=false}get provider(){return this}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.connect(this));return this}getPlugin(name){return this.#plugins.get(name)||null}get disableCcipRead(){return this.#disableCcipRead}set disableCcipRead(value){this.#disableCcipRead=!!value}async#perform(req){const tag=getTag(req.method,req);let perform=this.#performCache.get(tag);if(!perform){perform=this._perform(req);this.#performCache.set(tag,perform);setTimeout(()=>{if(this.#performCache.get(tag)===perform){this.#performCache.delete(tag)}},250)}return await perform}async ccipReadFetch(tx,calldata,urls){if(this.disableCcipRead||urls.length===0||tx.to==null){return null}const sender=tx.to.toLowerCase();const data=calldata.toLowerCase();const errorMessages=[];for(let i=0;i=500,`response not found during CCIP fetch: ${errorMessage}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:tx,info:{url:url,errorMessage:errorMessage}});errorMessages.push(errorMessage)}assert(false,`error encountered during CCIP fetch: ${errorMessages.map(m=>JSON.stringify(m)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:tx,info:{urls:urls,errorMessages:errorMessages}})}_wrapBlock(value,network){return new Block(formatBlock(value),this)}_wrapLog(value,network){return new Log(formatLog(value),this)}_wrapTransactionReceipt(value,network){return new TransactionReceipt(formatTransactionReceipt(value),this)}_wrapTransactionResponse(tx,network){return new TransactionResponse(formatTransactionResponse(tx),this)}_detectNetwork(){assert(false,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(req){assert(false,`unsupported method: ${req.method}`,"UNSUPPORTED_OPERATION",{operation:req.method,info:req})}async getBlockNumber(){const blockNumber=getNumber(await this.#perform({method:"getBlockNumber"}),"%response");if(this.#lastBlockNumber>=0){this.#lastBlockNumber=blockNumber}return blockNumber}_getAddress(address){return resolveAddress(address)}_getBlockTag(blockTag){if(blockTag==null){return"latest"}switch(blockTag){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return blockTag}if(isHexString(blockTag)){if(isHexString(blockTag,32)){return blockTag}return toQuantity(blockTag)}if(typeof blockTag==="bigint"){blockTag=getNumber(blockTag,"blockTag")}if(typeof blockTag==="number"){if(blockTag>=0){return toQuantity(blockTag)}if(this.#lastBlockNumber>=0){return toQuantity(this.#lastBlockNumber+blockTag)}return this.getBlockNumber().then(b=>toQuantity(b+blockTag))}assertArgument(false,"invalid blockTag","blockTag",blockTag)}_getFilter(filter){const topics=(filter.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()});const blockHash="blockHash"in filter?filter.blockHash:undefined;const resolve=(_address,fromBlock,toBlock)=>{let address=undefined;switch(_address.length){case 0:break;case 1:address=_address[0];break;default:_address.sort();address=_address}if(blockHash){if(fromBlock!=null||toBlock!=null){throw new Error("invalid filter")}}const filter={};if(address){filter.address=address}if(topics.length){filter.topics=topics}if(fromBlock){filter.fromBlock=fromBlock}if(toBlock){filter.toBlock=toBlock}if(blockHash){filter.blockHash=blockHash}return filter};let address=[];if(filter.address){if(Array.isArray(filter.address)){for(const addr of filter.address){address.push(this._getAddress(addr))}}else{address.push(this._getAddress(filter.address))}}let fromBlock=undefined;if("fromBlock"in filter){fromBlock=this._getBlockTag(filter.fromBlock)}let toBlock=undefined;if("toBlock"in filter){toBlock=this._getBlockTag(filter.toBlock)}if(address.filter(a=>typeof a!=="string").length||fromBlock!=null&&typeof fromBlock!=="string"||toBlock!=null&&typeof toBlock!=="string"){return Promise.all([Promise.all(address),fromBlock,toBlock]).then(result=>{return resolve(result[0],result[1],result[2])})}return resolve(address,fromBlock,toBlock)}_getTransactionRequest(_request){const request=copyRequest(_request);const promises=[];["to","from"].forEach(key=>{if(request[key]==null){return}const addr=resolveAddress(request[key]);if(isPromise(addr)){promises.push(async function(){request[key]=await addr}())}else{request[key]=addr}});if(request.blockTag!=null){const blockTag=this._getBlockTag(request.blockTag);if(isPromise(blockTag)){promises.push(async function(){request.blockTag=await blockTag}())}else{request.blockTag=blockTag}}if(promises.length){return async function(){await Promise.all(promises);return request}()}return request}async getNetwork(){if(this.#networkPromise==null){const detectNetwork=this._detectNetwork().then(network=>{this.emit("network",network,null);return network},error=>{if(this.#networkPromise===detectNetwork){this.#networkPromise=null}throw error});this.#networkPromise=detectNetwork;return(await detectNetwork).clone()}const networkPromise=this.#networkPromise;const[expected,actual]=await Promise.all([networkPromise,this._detectNetwork()]);if(expected.networkId!==actual.networkId){if(this.#anyNetwork){this.emit("network",actual,expected);if(this.#networkPromise===networkPromise){this.#networkPromise=Promise.resolve(actual)}}else{assert(false,`network changed: ${expected.networkId} => ${actual.networkId} `,"NETWORK_ERROR",{event:"changed"})}}return expected.clone()}async getEnergyPrice(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async getFeeData(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async estimateEnergy(_tx){let tx=this._getTransactionRequest(_tx);if(isPromise(tx)){tx=await tx}return getBigInt(await this.#perform({method:"estimateEnergy",transaction:tx}),"%response")}async#call(tx,blockTag,attempt){assert(attempt=0&&blockTag==="latest"&&transaction.to!=null&&dataSlice(error.data,0,4)==="0x556f1830"){const data=error.data;const txSender=await resolveAddress(transaction.to);let ccipArgs;try{ccipArgs=parseOffchainLookup(dataSlice(error.data,4))}catch(error){assert(false,error.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:transaction,info:{data:data}})}assert(ccipArgs.sender.toLowerCase()===txSender.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:data,reason:"OffchainLookup",transaction:transaction,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ccipArgs.errorArgs}});const ccipResult=await this.ccipReadFetch(transaction,ccipArgs.calldata,ccipArgs.urls);assert(ccipResult!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:transaction,info:{data:error.data,errorArgs:ccipArgs.errorArgs}});const tx={to:txSender,data:concat([ccipArgs.selector,encodeBytes([ccipResult,ccipArgs.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:tx});try{const result=await this.#call(tx,blockTag,attempt+1);this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},tx),result:result});return result}catch(error){this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},tx),error:error});throw error}}throw error}}async#checkNetwork(promise){const{value}=await resolveProperties({network:this.getNetwork(),value:promise});return value}async call(_tx){const{tx,blockTag}=await resolveProperties({tx:this._getTransactionRequest(_tx),blockTag:this._getBlockTag(_tx.blockTag)});return await this.#checkNetwork(this.#call(tx,blockTag,_tx.enableCcipRead?0:-1))}async#getAccountValue(request,_address,_blockTag){let address=this._getAddress(_address);let blockTag=this._getBlockTag(_blockTag);if(typeof address!=="string"||typeof blockTag!=="string"){[address,blockTag]=await Promise.all([address,blockTag])}return await this.#checkNetwork(this.#perform(Object.assign(request,{address:address,blockTag:blockTag})))}async getBalance(address,blockTag){return getBigInt(await this.#getAccountValue({method:"getBalance"},address,blockTag),"%response")}async getTransactionCount(address,blockTag){return getNumber(await this.#getAccountValue({method:"getTransactionCount"},address,blockTag),"%response")}async getCode(address,blockTag){return hexlify(await this.#getAccountValue({method:"getCode"},address,blockTag))}async getStorage(address,_position,blockTag){const position=getBigInt(_position,"position");return hexlify(await this.#getAccountValue({method:"getStorage",position:position},address,blockTag))}async broadcastTransaction(signedTx){const{blockNumber,hash,network}=await resolveProperties({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:signedTx}),network:this.getNetwork()});const tx=Transaction.from(signedTx);if(tx.hash!==hash){throw new Error("@TODO: the returned hash did not match")}return this._wrapTransactionResponse(tx,network).replaceableTransaction(blockNumber)}async#getBlock(block,includeTransactions){if(isHexString(block,32)){return await this.#perform({method:"getBlock",blockHash:block,includeTransactions:includeTransactions})}let blockTag=this._getBlockTag(block);if(typeof blockTag!=="string"){blockTag=await blockTag}return await this.#perform({method:"getBlock",blockTag:blockTag,includeTransactions:includeTransactions})}async getBlock(block,prefetchTxs){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#getBlock(block,!!prefetchTxs)});if(params==null){return null}return this._wrapBlock(params,network)}async getTransaction(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransaction",hash:hash})});if(params==null){return null}return this._wrapTransactionResponse(params,network)}async getTransactionReceipt(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransactionReceipt",hash:hash})});if(params==null){return null}if(params.energyPrice==null&¶ms.effectiveEnergyPrice==null){const tx=await this.#perform({method:"getTransaction",hash:hash});if(tx==null){throw new Error("report this; could not find tx or effectiveEnergyPrice")}params.effectiveEnergyPrice=tx.energyPrice}return this._wrapTransactionReceipt(params,network)}async getTransactionResult(hash){const{result}=await resolveProperties({network:this.getNetwork(),result:this.#perform({method:"getTransactionResult",hash:hash})});if(result==null){return null}return hexlify(result)}async getLogs(_filter){let filter=this._getFilter(_filter);if(isPromise(filter)){filter=await filter}const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getLogs",filter:filter})});return params.map(p=>this._wrapLog(p,network))}_getProvider(networkId){assert(false,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async waitForTransaction(hash,_confirms,timeout){const confirms=_confirms!=null?_confirms:1;if(confirms===0){return this.getTransactionReceipt(hash)}return new Promise(async(resolve,reject)=>{let timer=null;const listener=async blockNumber=>{try{const receipt=await this.getTransactionReceipt(hash);if(receipt!=null){if(blockNumber-receipt.blockNumber+1>=confirms){resolve(receipt);if(timer){clearTimeout(timer);timer=null}return}}}catch(error){console.log("EEE",error)}this.once("block",listener)};if(timeout!=null){timer=setTimeout(()=>{if(timer==null){return}timer=null;this.off("block",listener);reject(makeError("timeout","TIMEOUT",{reason:"timeout"}))},timeout)}listener(await this.getBlockNumber())})}async waitForBlock(blockTag){assert(false,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(timerId){const timer=this.#timers.get(timerId);if(!timer){return}if(timer.timer){clearTimeout(timer.timer)}this.#timers.delete(timerId)}_setTimeout(_func,timeout){if(timeout==null){timeout=0}const timerId=this.#nextTimer++;const func=()=>{this.#timers.delete(timerId);_func()};if(this.paused){this.#timers.set(timerId,{timer:null,func:func,time:timeout})}else{const timer=setTimeout(func,timeout);this.#timers.set(timerId,{timer:timer,func:func,time:getTime$1()})}return timerId}_forEachSubscriber(func){for(const sub of this.#subs.values()){func(sub.subscriber)}}_getSubscriber(sub){switch(sub.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(sub.type);case"block":return new PollingBlockSubscriber(this);case"event":return new PollingEventSubscriber(this,sub.filter);case"transaction":return new PollingTransactionSubscriber(this,sub.hash);case"orphan":return new PollingOrphanSubscriber(this,sub.filter)}throw new Error(`unsupported event: ${sub.type}`)}_recoverSubscriber(oldSub,newSub){for(const sub of this.#subs.values()){if(sub.subscriber===oldSub){if(sub.started){sub.subscriber.stop()}sub.subscriber=newSub;if(sub.started){newSub.start()}if(this.#pausedState!=null){newSub.pause(this.#pausedState)}break}}}async#hasSub(event,emitArgs){let sub=await getSubscription(event);if(sub.type==="event"&&emitArgs&&emitArgs.length>0&&emitArgs[0].removed===true){sub=await getSubscription({orphan:"drop-log",log:emitArgs[0]})}return this.#subs.get(sub.tag)||null}async#getSub(event){const subscription=await getSubscription(event);const tag=subscription.tag;let sub=this.#subs.get(tag);if(!sub){const subscriber=this._getSubscriber(subscription);const addressableMap=new WeakMap;const nameMap=new Map;sub={subscriber:subscriber,tag:tag,addressableMap:addressableMap,nameMap:nameMap,started:false,listeners:[]};this.#subs.set(tag,sub)}return sub}async on(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:false});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async once(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:true});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async emit(event,...args){const sub=await this.#hasSub(event,args);if(!sub||sub.listeners.length===0){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const payload=new EventPayload(this,once?null:listener,event);try{listener.call(this,...args,payload)}catch(error){}return!once});if(sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return count>0}async listenerCount(event){if(event){const sub=await this.#hasSub(event);if(!sub){return 0}return sub.listeners.length}let total=0;for(const{listeners}of this.#subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await this.#hasSub(event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}let result=[];for(const{listeners}of this.#subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await this.#hasSub(event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(!listener||sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const{tag,started,subscriber}=await this.#getSub(event);if(started){subscriber.stop()}this.#subs.delete(tag)}else{for(const[tag,{started,subscriber}]of this.#subs){if(started){subscriber.stop()}this.#subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return this.off(event,listener)}destroy(){this.removeAllListeners();for(const timerId of this.#timers.keys()){this._clearTimeout(timerId)}}get paused(){return this.#pausedState!=null}set paused(pause){if(!!pause===this.paused){return}if(this.paused){this.resume()}else{this.pause(false)}}pause(dropWhilePaused){this.#lastBlockNumber=-1;if(this.#pausedState!=null){if(this.#pausedState==!!dropWhilePaused){return}assert(false,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(s=>s.pause(dropWhilePaused));this.#pausedState=!!dropWhilePaused;for(const timer of this.#timers.values()){if(timer.timer){clearTimeout(timer.timer)}timer.time=getTime$1()-timer.time}}resume(){if(this.#pausedState==null){return}this._forEachSubscriber(s=>s.resume());this.#pausedState=null;for(const timer of this.#timers.values()){let timeout=timer.time;if(timeout<0){timeout=0}timer.time=getTime$1();setTimeout(timer.func,timeout)}}}function _parseString(result,start){try{const bytes=_parseBytes(result,start);if(bytes){return toUtf8String(bytes)}}catch(error){}return null}function _parseBytes(result,start){if(result==="0x"){return null}try{const offset=getNumber(dataSlice(result,start,start+32));const length=getNumber(dataSlice(result,offset,offset+32));return dataSlice(result,offset+32,offset+32+length)}catch(error){}return null}function numPad(value){const result=toBeArray(value);if(result.length>32){throw new Error("internal; should not happen")}const padded=new Uint8Array(32);padded.set(result,32-result.length);return padded}function bytesPad(value){if(value.length%32===0){return value}const result=new Uint8Array(Math.ceil(value.length/32)*32);result.set(value);return result}const empty=new Uint8Array([]);function encodeBytes(datas){const result=[];let byteCount=0;for(let i=0;i=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const sender=dataSlice(data,0,32);assert(dataSlice(sender,0,12)===dataSlice(zeros,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"});result.sender=dataSlice(sender,12);try{const urls=[];const urlsOffset=getNumber(dataSlice(data,32,64));const urlsLength=getNumber(dataSlice(data,urlsOffset,urlsOffset+32));const urlsData=dataSlice(data,urlsOffset+32);for(let u=0;uresult[k]);return result}function checkProvider(signer,operation){if(signer.provider){return signer.provider}assert(false,"missing provider","UNSUPPORTED_OPERATION",{operation:operation})}async function populate(signer,tx){let pop=copyRequest(tx);if(pop.to!=null){pop.to=resolveAddress(pop.to)}if(pop.from!=null){const from=pop.from;pop.from=Promise.all([signer.getAddress(),resolveAddress(from)]).then(([address,from])=>{assertArgument(address.toLowerCase()===from.toLowerCase(),"transaction from mismatch","tx.from",from);return address})}else{pop.from=signer.getAddress()}return await resolveProperties(pop)}class AbstractSigner{provider;constructor(provider){defineProperties(this,{provider:provider||null})}async getNonce(blockTag){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),blockTag)}async populateCall(tx){const pop=await populate(this,tx);return pop}async populateTransaction(tx){const provider=checkProvider(this,"populateTransaction");const pop=await populate(this,tx);if(pop.nonce==null){pop.nonce=await this.getNonce("pending")}if(pop.energyLimit==null){pop.energyLimit=await this.estimateEnergy(pop)}const network=await this.provider.getNetwork();if(pop.networkId!=null){const networkId=getBigInt(pop.networkId);assertArgument(networkId===network.networkId,"transaction networkId mismatch","tx.networkId",tx.networkId)}else{pop.networkId=network.networkId}const feeData=await provider.getFeeData();if(feeData.energyPrice!=null){if(pop.energyPrice==null){pop.energyPrice=feeData.energyPrice}}else{assert(false,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"})}return await resolveProperties(pop)}async estimateEnergy(tx){return checkProvider(this,"estimateEnergy").estimateEnergy(await this.populateCall(tx))}async call(tx){return checkProvider(this,"call").call(await this.populateCall(tx))}async resolveName(name){return getAddress(name)}async sendTransaction(tx){const provider=checkProvider(this,"sendTransaction");const pop=await this.populateTransaction(tx);delete pop.from;const txObj=Transaction.from(pop);return await provider.broadcastTransaction(await this.signTransaction(txObj))}}class VoidSigner extends AbstractSigner{address;constructor(address,provider){super(provider);defineProperties(this,{address:address})}async getAddress(){return this.address}connect(provider){return new VoidSigner(this.address,provider)}#throwUnsupported(suffix,operation){assert(false,`VoidSigner cannot sign ${suffix}`,"UNSUPPORTED_OPERATION",{operation:operation})}async signTransaction(tx){this.#throwUnsupported("transactions","signTransaction")}async signMessage(message){this.#throwUnsupported("messages","signMessage")}async signTypedData(domain,types,value){this.#throwUnsupported("typed-data","signTypedData")}}const shown=new Set;function showThrottleMessage(service){if(shown.has(service)){return}shown.add(service);console.log("========= NOTICE =========");console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);console.log("");console.log("The default API keys for each service are provided as a highly-throttled,");console.log("community resource for low-traffic projects and early prototyping.");console.log("");console.log("While your application will continue to function, we highly recommended");console.log("signing up for your own API keys to improve performance, increase your");console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");console.log("")}function copy(obj){return JSON.parse(JSON.stringify(obj))}class FilterIdSubscriber{#provider;#filterIdPromise;#poller;#running;#network;#hault;constructor(provider){this.#provider=provider;this.#filterIdPromise=null;this.#poller=this.#poll.bind(this);this.#running=false;this.#network=null;this.#hault=false}_subscribe(provider){throw new Error("subclasses must override this")}_emitResults(provider,result){throw new Error("subclasses must override this")}_recover(provider){throw new Error("subclasses must override this")}async#poll(blockNumber){try{if(this.#filterIdPromise==null){this.#filterIdPromise=this._subscribe(this.#provider)}let filterId=null;try{filterId=await this.#filterIdPromise}catch(error){if(!isError(error,"UNSUPPORTED_OPERATION")||error.operation!=="xcb_newFilter"){throw error}}if(filterId==null){this.#filterIdPromise=null;this.#provider._recoverSubscriber(this,this._recover(this.#provider));return}const network=await this.#provider.getNetwork();if(!this.#network){this.#network=network}if(this.#network.networkId!==network.networkId){throw new Error("chaid changed")}if(this.#hault){return}const result=await this.#provider.send("xcb_getFilterChanges",[filterId]);await this._emitResults(this.#provider,result)}catch(error){console.log("@TODO",error)}this.#provider.once("block",this.#poller)}#teardown(){const filterIdPromise=this.#filterIdPromise;if(filterIdPromise){this.#filterIdPromise=null;filterIdPromise.then(filterId=>{this.#provider.send("xcb_uninstallFilter",[filterId])})}}start(){if(this.#running){return}this.#running=true;this.#poll(-2)}stop(){if(!this.#running){return}this.#running=false;this.#hault=true;this.#teardown();this.#provider.off("block",this.#poller)}pause(dropWhilePaused){if(dropWhilePaused){this.#teardown()}this.#provider.off("block",this.#poller)}resume(){this.start()}}class FilterIdEventSubscriber extends FilterIdSubscriber{#event;constructor(provider,filter){super(provider);this.#event=copy(filter)}_recover(provider){return new PollingEventSubscriber(provider,this.#event)}async _subscribe(provider){const filterId=await provider.send("xcb_newFilter",[this.#event]);return filterId}async _emitResults(provider,results){for(const result of results){provider.emit(this.#event,provider._wrapLog(result,provider._network))}}}class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(provider){return await provider.send("xcb_newPendingTransactionFilter",[])}async _emitResults(provider,results){for(const result of results){provider.emit("pending",result)}}}const Primitive="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy(value){if(value==null||Primitive.indexOf(typeof value)>=0){return value}if(typeof value.getAddress==="function"){return value}if(Array.isArray(value)){return value.map(deepCopy)}if(typeof value==="object"){return Object.keys(value).reduce((accum,key)=>{accum[key]=value[key];return accum},{})}throw new Error(`should not happen: ${value} (${typeof value})`)}function stall$3(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getLowerCase(value){if(value){return value.toLowerCase()}return value}function isPollable(value){return value&&typeof value.pollingInterval==="number"}const defaultOptions={polling:false,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100};class JsonRpcSigner extends AbstractSigner{address;constructor(provider,address){super(provider);address=getAddress(address);defineProperties(this,{address:address})}connect(provider){assert(false,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(tx){return await this.populateCall(tx)}async sendUncheckedTransaction(_tx){const tx=deepCopy(_tx);const promises=[];if(tx.from){const _from=tx.from;promises.push((async()=>{const from=await resolveAddress(_from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from})())}else{tx.from=this.address}if(tx.energyLimit==null){promises.push((async()=>{tx.energyLimit=await this.provider.estimateEnergy({...tx,from:this.address})})())}if(tx.to!=null){const _to=tx.to;promises.push((async()=>{tx.to=await resolveAddress(_to)})())}if(promises.length){await Promise.all(promises)}const hexTx=this.provider.getRpcTransaction(tx);return this.provider.send("xcb_sendTransaction",[hexTx])}async sendTransaction(tx){const blockNumber=await this.provider.getBlockNumber();const hash=await this.sendUncheckedTransaction(tx);return await new Promise((resolve,reject)=>{const timeouts=[1e3,100];const checkTx=async()=>{const tx=await this.provider.getTransaction(hash);if(tx!=null){resolve(tx.replaceableTransaction(blockNumber));return}this.provider._setTimeout(()=>{checkTx()},timeouts.pop()||4e3)};checkTx()})}async signTransaction(_tx){const tx=deepCopy(_tx);if(tx.from){const from=await resolveAddress(tx.from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from}else{tx.from=this.address}const hexTx=this.provider.getRpcTransaction(tx);return await this.provider.send("xcb_signTransaction",[hexTx])}async signMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("personal_sign",[hexlify(message),this.address.toLowerCase()])}async signTypedData(domain,types,_value){const value=deepCopy(_value);const populated=await TypedDataEncoder.resolveNames(domain,types,value,async value=>{const address=await resolveAddress(value);assertArgument(address!=null,"TypedData does not support null address","value",value);return address});return await this.provider.send("xcb_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(populated.domain,types,populated.value))])}async unlock(password){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),password,null])}async _legacySignMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("xcb_sign",[this.address.toLowerCase(),hexlify(message)])}}class JsonRpcApiProvider extends AbstractProvider{#options;#nextId;#payloads;#drainTimer;#notReady;#network;#scheduleDrain(){if(this.#drainTimer){return}const stallTime=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#drainTimer=setTimeout(()=>{this.#drainTimer=null;const payloads=this.#payloads;this.#payloads=[];while(payloads.length){const batch=[payloads.shift()];while(payloads.length){if(batch.length===this.#options.batchMaxCount){break}batch.push(payloads.shift());const bytes=JSON.stringify(batch.map(p=>p.payload));if(bytes.length>this.#options.batchMaxSize){payloads.unshift(batch.pop());break}}(async()=>{const payload=batch.length===1?batch[0].payload:batch.map(p=>p.payload);this.emit("debug",{action:"sendRpcPayload",payload:payload});try{const result=await this._send(payload);this.emit("debug",{action:"receiveRpcResult",result:result});for(const{resolve,reject,payload}of batch){const resp=result.filter(r=>r.id===payload.id)[0];if(resp==null){return reject(makeError("no response from server","BAD_DATA",{value:result,info:{payload:payload}}))}if("error"in resp){return reject(this.getRpcError(payload,resp))}resolve(resp.result)}}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});for(const{reject}of batch){reject(error)}}})()}},stallTime)}constructor(network,options){super(network);this.#nextId=1;this.#options=Object.assign({},defaultOptions,options||{});this.#payloads=[];this.#drainTimer=null;this.#network=null;{let resolve=null;const promise=new Promise(_resolve=>{resolve=_resolve});this.#notReady={promise:promise,resolve:resolve}}const staticNetwork=this._getOption("staticNetwork");if(staticNetwork){assertArgument(network==null||staticNetwork.matches(network),"staticNetwork MUST match network object","options",options);this.#network=staticNetwork}}_getOption(key){return this.#options[key]}get _network(){assert(this.#network,"network is not available yet","NETWORK_ERROR");return this.#network}async _perform(req){const request=this.getRpcRequest(req);if(request!=null){return await this.send(request.method,request.args)}return super._perform(req)}async _detectNetwork(){const network=this._getOption("staticNetwork");if(network){return network}if(this.ready){return Network.from(getBigInt(await this.send("xcb_networkId",[])))}const payload={id:this.#nextId++,method:"xcb_networkId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:payload});let result;try{result=(await this._send(payload))[0]}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});throw error}this.emit("debug",{action:"receiveRpcResult",result:result});if("result"in result){return Network.from(getBigInt(result.result))}throw this.getRpcError(payload,result)}_start(){if(this.#notReady==null||this.#notReady.resolve==null){return}this.#notReady.resolve();this.#notReady=null;(async()=>{while(this.#network==null){try{this.#network=await this._detectNetwork()}catch(error){console.log("JsonRpcProvider failed to startup; retry in 1s");await stall$3(1e3)}}this.#scheduleDrain()})()}async _waitUntilReady(){if(this.#notReady==null){return}return await this.#notReady.promise}_getSubscriber(sub){if(sub.type==="pending"){return new FilterIdPendingSubscriber(this)}if(sub.type==="event"){if(this._getOption("polling")){return new PollingEventSubscriber(this,sub.filter)}return new FilterIdEventSubscriber(this,sub.filter)}if(sub.type==="orphan"&&sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("orphan")}return super._getSubscriber(sub)}get ready(){return this.#notReady==null}getRpcTransaction(tx){const result={};["networkId","energyLimit","energyPrice","type","nonce","value"].forEach(key=>{if(tx[key]==null){return}let dstKey=key;if(key==="energyLimit"){dstKey="energy"}result[dstKey]=toQuantity(getBigInt(tx[key],`tx.${key}`))});["from","to","data"].forEach(key=>{if(tx[key]==null){return}result[key]=hexlify(tx[key])});return result}getRpcRequest(req){switch(req.method){case"networkId":return{method:"xcb_networkId",args:[]};case"getBlockNumber":return{method:"xcb_blockNumber",args:[]};case"getEnergyPrice":return{method:"xcb_energyPrice",args:[]};case"getBalance":{return{method:"xcb_getBalance",args:[getLowerCase(req.address),req.blockTag]}}case"getTransactionCount":return{method:"xcb_getTransactionCount",args:[getLowerCase(req.address),req.blockTag]};case"getCode":return{method:"xcb_getCode",args:[getLowerCase(req.address),req.blockTag]};case"getStorage":return{method:"xcb_getStorageAt",args:[getLowerCase(req.address),"0x"+req.position.toString(16),req.blockTag]};case"broadcastTransaction":return{method:"xcb_sendRawTransaction",args:[req.signedTransaction]};case"getBlock":if("blockTag"in req){return{method:"xcb_getBlockByNumber",args:[req.blockTag,!!req.includeTransactions]}}else if("blockHash"in req){return{method:"xcb_getBlockByHash",args:[req.blockHash,!!req.includeTransactions]}}break;case"getTransaction":return{method:"xcb_getTransactionByHash",args:[req.hash]};case"getTransactionReceipt":return{method:"xcb_getTransactionReceipt",args:[req.hash]};case"call":return{method:"xcb_call",args:[this.getRpcTransaction(req.transaction),req.blockTag]};case"estimateEnergy":{return{method:"xcb_estimateEnergy",args:[this.getRpcTransaction(req.transaction)]}}case"getLogs":if(req.filter&&req.filter.address!=null){if(Array.isArray(req.filter.address)){req.filter.address=req.filter.address.map(getLowerCase)}else{req.filter.address=getLowerCase(req.filter.address)}}return{method:"xcb_getLogs",args:[req.filter]}}return null}getRpcError(payload,_error){const{method}=payload;const{error}=_error;if(method==="xcb_estimateEnergy"&&error.message){const msg=error.message;if(!msg.match(/revert/i)&&msg.match(/insufficient funds/i)){return makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:payload.params[0],info:{payload:payload,error:error}})}}if(method==="xcb_call"||method==="xcb_estimateEnergy"){const result=spelunkData(error);const e=AbiCoder.getBuiltinCallException(method==="xcb_call"?"call":"estimateEnergy",payload.params[0],result?result.data:null);e.info={error:error,payload:payload};return e}const message=JSON.stringify(spelunkMessage(error));if(typeof error.message==="string"&&error.message.match(/user denied|corebc-user-denied/i)){const actionMap={xcb_sign:"signMessage",personal_sign:"signMessage",xcb_signTypedData_v4:"signTypedData",xcb_signTransaction:"signTransaction",xcb_sendTransaction:"sendTransaction",xcb_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return makeError(`user rejected action`,"ACTION_REJECTED",{action:actionMap[method]||"unknown",reason:"rejected",info:{payload:payload,error:error}})}if(method==="xcb_sendRawTransaction"||method==="xcb_sendTransaction"){const transaction=payload.params[0];if(message.match(/insufficient funds|base fee exceeds energy limit/i)){return makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction,info:{error:error}})}if(message.match(/nonce/i)&&message.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:transaction,info:{error:error}})}if(message.match(/replacement transaction/i)&&message.match(/underpriced/i)){return makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction,info:{error:error}})}if(message.match(/only replay-protected/i)){return makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:method,info:{transaction:transaction,info:{error:error}}})}}if(message.match(/the method .* does not exist/i)){return makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:payload.method,info:{error:error}})}return makeError("could not coalesce error","UNKNOWN_ERROR",{error:error})}send(method,params){const id=this.#nextId++;const promise=new Promise((resolve,reject)=>{this.#payloads.push({resolve:resolve,reject:reject,payload:{method:method,params:params,id:id,jsonrpc:"2.0"}})});this.#scheduleDrain();return promise}async getSigner(address){if(address==null){address=0}const accountsPromise=this.send("xcb_accounts",[]);if(typeof address==="number"){const accounts=await accountsPromise;if(address>=accounts.length){throw new Error("no such account")}return new JsonRpcSigner(this,accounts[address])}const{accounts}=await resolveProperties({network:this.getNetwork(),accounts:accountsPromise});address=getAddress(address);for(const account of accounts){if(getAddress(account)===address){return new JsonRpcSigner(this,address)}}throw new Error("invalid account")}async listAccounts(){const accounts=await this.send("xcb_accounts",[]);return accounts.map(a=>new JsonRpcSigner(this,a))}}class JsonRpcApiPollingProvider extends JsonRpcApiProvider{#pollingInterval;constructor(network,options){super(network,options);this.#pollingInterval=4e3}_getSubscriber(sub){const subscriber=super._getSubscriber(sub);if(isPollable(subscriber)){subscriber.pollingInterval=this.#pollingInterval}return subscriber}get pollingInterval(){return this.#pollingInterval}set pollingInterval(value){if(!Number.isInteger(value)||value<0){throw new Error("invalid interval")}this.#pollingInterval=value;this._forEachSubscriber(sub=>{if(isPollable(sub)){sub.pollingInterval=this.#pollingInterval}})}}class JsonRpcProvider extends JsonRpcApiPollingProvider{#connect;constructor(url,network,options){if(url==null){url="http://localhost:8545"}super(network,options);if(typeof url==="string"){this.#connect=new FetchRequest(url)}else{this.#connect=url.clone()}}_getConnection(){return this.#connect.clone()}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){const request=this._getConnection();request.body=JSON.stringify(payload);request.setHeader("content-type","application/json");const response=await request.send();response.assertOk();let resp=response.bodyJson;if(!Array.isArray(resp)){resp=[resp]}return resp}}function spelunkData(value){if(value==null){return null}if(typeof value.message==="string"&&value.message.match("reverted")&&isHexString(value.data)){return{message:value.message,data:value.data}}if(typeof value==="object"){for(const key in value){const result=spelunkData(value[key]);if(result){return result}}return null}if(typeof value==="string"){try{return spelunkData(JSON.parse(value))}catch(error){}}return null}function _spelunkMessage(value,result){if(value==null){return}if(typeof value.message==="string"){result.push(value.message)}if(typeof value==="object"){for(const key in value){_spelunkMessage(value[key],result)}}if(typeof value==="string"){try{return _spelunkMessage(JSON.parse(value),result)}catch(error){}}}function spelunkMessage(value){const result=[];_spelunkMessage(value,result);return result}const defaultApiKey$1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function getHost$4(name){switch(name){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/xcb_goerli";case"matic":return"rpc.ankr.com/polygon";case"arbitrum":return"rpc.ankr.com/arbitrum"}assertArgument(false,"unsupported network","network",name)}class AnkrProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey$1}const options={polling:true,staticNetwork:network};const request=AnkrProvider.getRequest(network,apiKey);super(request,network,options);defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AnkrProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey$1}const request=new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey$1){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("AnkrProvider");return true}}return request}getRpcError(payload,error){if(payload.method==="xcb_sendRawTransaction"){if(error&&error.error&&error.error.message==="INTERNAL_ERROR: could not replace existing tx"){error.error.message="replacement transaction underpriced"}}return super.getRpcError(payload,error)}isCommunityResource(){return this.apiKey===defaultApiKey$1}}const defaultApiKey="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function getHost$3(name){switch(name){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com"}assertArgument(false,"unsupported network","network",name)}class AlchemyProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey}const request=AlchemyProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AlchemyProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}async _perform(req){if(req.method==="getTransactionResult"){const{trace,tx}=await resolveProperties({trace:this.send("trace_transaction",[req.hash]),tx:this.getTransaction(req.hash)});if(trace==null||tx==null){return null}let data;let error=false;try{data=trace[0].result.output;error=trace[0].error==="Reverted"}catch(error){}if(data){assert(!error,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:data,reason:null,transaction:tx,invocation:null,revert:null});return data}assert(false,"could not parse trace result","BAD_DATA",{value:trace})}return await super._perform(req)}isCommunityResource(){return this.apiKey===defaultApiKey}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey}const request=new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("alchemy");return true}}return request}}class CloudflareProvider extends JsonRpcProvider{constructor(_network){if(_network==null){_network="mainnet"}const network=Network.from(_network);assertArgument(network.name==="mainnet","unsupported network","network",_network);super("https://cloudflare-eth.com/",network,{staticNetwork:network})}}function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const _WebSocket=getGlobal().WebSocket;class SocketSubscriber{#provider;#filter;get filter(){return JSON.parse(this.#filter)}#filterId;#paused;#emitPromise;constructor(provider,filter){this.#provider=provider;this.#filter=JSON.stringify(filter);this.#filterId=null;this.#paused=null;this.#emitPromise=null}start(){this.#filterId=this.#provider.send("xcb_subscribe",this.filter).then(filterId=>{this.#provider._register(filterId,this);return filterId})}stop(){this.#filterId.then(filterId=>{this.#provider.send("xcb_unsubscribe",[filterId])});this.#filterId=null}pause(dropWhilePaused){assert(dropWhilePaused,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"});this.#paused=!!dropWhilePaused}resume(){this.#paused=null}_handleMessage(message){if(this.#filterId==null){return}if(this.#paused===null){let emitPromise=this.#emitPromise;if(emitPromise==null){emitPromise=this._emit(this.#provider,message)}else{emitPromise=emitPromise.then(async()=>{await this._emit(this.#provider,message)})}this.#emitPromise=emitPromise.then(()=>{if(this.#emitPromise===emitPromise){this.#emitPromise=null}})}}async _emit(provider,message){throw new Error("sub-classes must implemente this; _emit")}}class SocketBlockSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newHeads"])}async _emit(provider,message){provider.emit("block",parseInt(message.number))}}class SocketPendingSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newPendingTransactions"])}async _emit(provider,message){provider.emit("pending",message)}}class SocketEventSubscriber extends SocketSubscriber{#logFilter;get logFilter(){return JSON.parse(this.#logFilter)}constructor(provider,filter){super(provider,["logs",filter]);this.#logFilter=JSON.stringify(filter)}async _emit(provider,message){provider.emit(this.logFilter,provider._wrapLog(message,provider._network))}}class SocketProvider extends JsonRpcApiProvider{#callbacks;#subs;#pending;constructor(network){super(network,{batchMaxCount:1});this.#callbacks=new Map;this.#subs=new Map;this.#pending=new Map}_getSubscriber(sub){switch(sub.type){case"close":return new UnmanagedSubscriber("close");case"block":return new SocketBlockSubscriber(this);case"pending":return new SocketPendingSubscriber(this);case"event":return new SocketEventSubscriber(this,sub.filter);case"orphan":if(sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("drop-log")}}return super._getSubscriber(sub)}_register(filterId,subscriber){this.#subs.set(filterId,subscriber);const pending=this.#pending.get(filterId);if(pending){for(const message of pending){subscriber._handleMessage(message)}this.#pending.delete(filterId)}}async _send(payload){assertArgument(!Array.isArray(payload),"WebSocket does not support batch send","payload",payload);const promise=new Promise((resolve,reject)=>{this.#callbacks.set(payload.id,{payload:payload,resolve:resolve,reject:reject})});await this._waitUntilReady();await this._write(JSON.stringify(payload));return[await promise]}async _processMessage(message){const result=JSON.parse(message);if("id"in result){const callback=this.#callbacks.get(result.id);if(callback==null){this.emit("error",makeError("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:result}));return}this.#callbacks.delete(result.id);callback.resolve(result)}else if(result.method==="xcb_subscription"){const filterId=result.params.subscription;const subscriber=this.#subs.get(filterId);if(subscriber){subscriber._handleMessage(result.params.result)}else{let pending=this.#pending.get(filterId);if(pending==null){pending=[];this.#pending.set(filterId,pending)}pending.push(result.params.result)}}}async _write(message){throw new Error("sub-classes must override this")}}class WebSocketProvider extends SocketProvider{#connect;#websocket;get websocket(){if(this.#websocket==null){throw new Error("websocket closed")}return this.#websocket}constructor(url,network){super(network);if(typeof url==="string"){this.#connect=()=>{return new _WebSocket(url)};this.#websocket=this.#connect()}else if(typeof url==="function"){this.#connect=url;this.#websocket=url()}else{this.#connect=null;this.#websocket=url}this.websocket.onopen=async()=>{try{await this._start();this.resume()}catch(error){console.log("failed to start WebsocketProvider",error)}};this.websocket.onmessage=message=>{this._processMessage(message.data)}}async _write(message){this.websocket.send(message)}async destroy(){if(this.#websocket!=null){this.#websocket.close();this.#websocket=null}super.destroy()}}const defaultProjectId="84842078b09946638c03157f83405213";function getHost$2(name){switch(name){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io"}assertArgument(false,"unsupported network","network",name)}class InfuraWebSocketProvider extends WebSocketProvider{projectId;projectSecret;constructor(network,projectId){const provider=new InfuraProvider(network,projectId);const req=provider._getConnection();assert(!req.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const url=req.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(url,network);defineProperties(this,{projectId:provider.projectId,projectSecret:provider.projectSecret})}isCommunityResource(){return this.projectId===defaultProjectId}}class InfuraProvider extends JsonRpcProvider{projectId;projectSecret;constructor(_network,projectId,projectSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=InfuraProvider.getRequest(network,projectId,projectSecret);super(request,network,{staticNetwork:network});defineProperties(this,{projectId:projectId,projectSecret:projectSecret})}_getProvider(networkId){try{return new InfuraProvider(networkId,this.projectId,this.projectSecret)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.projectId===defaultProjectId}static getWebSocketProvider(network,projectId){return new InfuraWebSocketProvider(network,projectId)}static getRequest(network,projectId,projectSecret){if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`);request.allowGzip=true;if(projectSecret){request.setCredentials("",projectSecret)}if(projectId===defaultProjectId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("InfuraProvider");return true}}return request}}const defaultToken="919b412a057b5e9c9b6dce193c5a60242d6efadb";function getHost$1(name){switch(name){case"mainnet":return"corebc.quiknode.pro";case"arbitrum":return"corebc.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"corebc.arbitrum-goerli.quiknode.pro";case"matic":return"corebc.matic.quiknode.pro";case"matic-mumbai":return"corebc.matic-testnet.quiknode.pro";case"optimism":return"corebc.optimism.quiknode.pro";case"optimism-goerli":return"corebc.optimism-goerli.quiknode.pro"}assertArgument(false,"unsupported network","network",name)}class QuickNodeProvider extends JsonRpcProvider{token;constructor(_network,token){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(token==null){token=defaultToken}const request=QuickNodeProvider.getRequest(network,token);super(request,network,{staticNetwork:network});defineProperties(this,{token:token})}_getProvider(networkId){try{return new QuickNodeProvider(networkId,this.token)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.token===defaultToken}static getRequest(network,token){if(token==null){token=defaultToken}const request=new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`);request.allowGzip=true;if(token===defaultToken){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("QuickNodeProvider");return true}}return request}}const BN_1=BigInt("1");const BN_2=BigInt("2");function shuffle(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));const tmp=array[i];array[i]=array[j];array[j]=tmp}}function stall$2(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getTime(){return(new Date).getTime()}function stringify(value){return JSON.stringify(value,(key,value)=>{if(typeof value==="bigint"){return{type:"bigint",value:value.toString()}}return value})}const defaultConfig={stallTimeout:400,priority:1,weight:1};const defaultState={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0};async function waitForSync(config,blockNumber){while(config.blockNumber<0||config.blockNumber{const blockNumber=await config.provider.getBlockNumber();if(blockNumber>config.blockNumber){config.blockNumber=blockNumber}config._updateNumber=null})()}await config._updateNumber;config.outOfSync++}}function _normalize(value){if(value==null){return"null"}if(Array.isArray(value)){return"["+value.map(_normalize).join(",")+"]"}if(typeof value==="object"&&typeof value.toJSON==="function"){return _normalize(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":case"number":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{"+keys.map(k=>`${JSON.stringify(k)}:${_normalize(value[k])}`).join(",")+"}"}}console.log("Could not serialize",value);throw new Error("Hmm...")}function normalizeResult(value){if("error"in value){const error=value.error;return{tag:_normalize(error),value:error}}const result=value.result;return{tag:_normalize(result),value:result}}function checkQuorum(quorum,results){const tally=new Map;for(const{value,tag,weight}of results){const t=tally.get(tag)||{value:value,weight:0};t.weight+=weight;tally.set(tag,t)}let best=null;for(const r of tally.values()){if(r.weight>=quorum&&(!best||r.weight>best.weight)){best=r}}if(best){return best.value}return undefined}function getMedian(quorum,results){let resultWeight=0;const errorMap=new Map;let bestError=null;const values=[];for(const{value,tag,weight}of results){if(value instanceof Error){const e=errorMap.get(tag)||{value:value,weight:0};e.weight+=weight;errorMap.set(tag,e);if(bestError==null||e.weight>bestError.weight){bestError=e}}else{values.push(BigInt(value));resultWeight+=weight}}if(resultWeight=quorum){return bestError.value}return undefined}values.sort((a,b)=>aa?1:0);const mid=Math.floor(values.length/2);if(values.length%2){return values[mid]}return(values[mid-1]+values[mid]+BN_1)/BN_2}function getAnyResult(quorum,results){const result=checkQuorum(quorum,results);if(result!==undefined){return result}for(const r of results){if(r.value){return r.value}}return undefined}function getFuzzyMode(quorum,results){if(quorum===1){return getNumber(getMedian(quorum,results),"%internal")}const tally=new Map;const add=(result,weight)=>{const t=tally.get(result)||{result:result,weight:0};t.weight+=weight;tally.set(result,t)};for(const{weight,value}of results){const r=getNumber(value);add(r-1,weight);add(r,weight);add(r+1,weight)}let bestWeight=0;let bestResult=undefined;for(const{weight,result}of tally.values()){if(weight>=quorum&&(weight>bestWeight||bestResult!=null&&weight===bestWeight&&result>bestResult)){bestWeight=weight;bestResult=result}}return bestResult}class FallbackProvider extends AbstractProvider{quorum;eventQuorum;eventWorkers;#configs;#height;#initialSyncPromise;constructor(providers,network){super(network);this.#configs=providers.map(p=>{if(p instanceof AbstractProvider){return Object.assign({provider:p},defaultConfig,defaultState)}else{return Object.assign({},defaultConfig,p,defaultState)}});this.#height=-2;this.#initialSyncPromise=null;this.quorum=2;this.eventQuorum=1;this.eventWorkers=1;assertArgument(this.quorum<=this.#configs.reduce((a,c)=>a+c.weight,0),"quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return this.#configs.map(c=>{const result=Object.assign({},c);for(const key in result){if(key[0]==="_"){delete result[key]}}return result})}async _detectNetwork(){return Network.from(getBigInt(await this._perform({method:"networkId"})))}async _translatePerform(provider,req){switch(req.method){case"broadcastTransaction":return await provider.broadcastTransaction(req.signedTransaction);case"call":return await provider.call(Object.assign({},req.transaction,{blockTag:req.blockTag}));case"networkId":return(await provider.getNetwork()).networkId;case"estimateEnergy":return await provider.estimateEnergy(req.transaction);case"getBalance":return await provider.getBalance(req.address,req.blockTag);case"getBlock":{const block="blockHash"in req?req.blockHash:req.blockTag;return await provider.getBlock(block,req.includeTransactions)}case"getBlockNumber":return await provider.getBlockNumber();case"getCode":return await provider.getCode(req.address,req.blockTag);case"getEnergyPrice":return(await provider.getFeeData()).energyPrice;case"getLogs":return await provider.getLogs(req.filter);case"getStorage":return await provider.getStorage(req.address,req.position,req.blockTag);case"getTransaction":return await provider.getTransaction(req.hash);case"getTransactionCount":return await provider.getTransactionCount(req.address,req.blockTag);case"getTransactionReceipt":return await provider.getTransactionReceipt(req.hash);case"getTransactionResult":return await provider.getTransactionResult(req.hash)}}#getNextConfig(running){const configs=Array.from(running).map(r=>r.config);const allConfigs=this.#configs.slice();shuffle(allConfigs);allConfigs.sort((a,b)=>b.priority-a.priority);for(const config of allConfigs){if(configs.indexOf(config)===-1){return config}}return null}#addRunner(running,req){const config=this.#getNextConfig(running);if(config==null){return null}const runner={config:config,result:null,didBump:false,perform:null,staller:null};const now=getTime();runner.perform=(async()=>{try{config.requests++;const result=await this._translatePerform(config.provider,req);runner.result={result:result}}catch(error){config.errorResponses++;runner.result={error:error}}const dt=getTime()-now;config._totalTime+=dt;config.rollingDuration=.95*config.rollingDuration+.05*dt;runner.perform=null})();runner.staller=(async()=>{await stall$2(config.stallTimeout);runner.staller=null})();running.add(runner);return runner}async#initialSync(){let initialSync=this.#initialSyncPromise;if(!initialSync){const promises=[];this.#configs.forEach(config=>{promises.push(waitForSync(config,0));promises.push((async()=>{config._network=await config.provider.getNetwork()})())});this.#initialSyncPromise=initialSync=(async()=>{await Promise.all(promises);let networkId=null;for(const config of this.#configs){const network=config._network;if(networkId==null){networkId=network.networkId}else if(network.networkId!==networkId){assert(false,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}}})()}await initialSync}async#checkQuorum(running,req){const results=[];for(const runner of running){if(runner.result!=null){const{tag,value}=normalizeResult(runner.result);results.push({tag:tag,value:value,weight:runner.config.weight})}}if(results.reduce((a,r)=>a+r.weight,0)({value:c.blockNumber,tag:getNumber(c.blockNumber).toString(),weight:c.weight})))))}const mode=getFuzzyMode(this.quorum,results);if(mode===undefined){return undefined}if(mode>this.#height){this.#height=mode}return this.#height}case"getEnergyPrice":case"estimateEnergy":return getMedian(this.quorum,results);case"getBlock":if("blockTag"in req&&req.blockTag==="pending"){return getAnyResult(this.quorum,results)}return checkQuorum(this.quorum,results);case"call":case"networkId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return checkQuorum(this.quorum,results);case"broadcastTransaction":return getAnyResult(this.quorum,results)}assert(false,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${stringify(req.method)})`})}async#waitForQuorum(running,req){if(running.size===0){throw new Error("no runners?!")}const interesting=[];let newRunners=0;for(const runner of running){if(runner.perform){interesting.push(runner.perform)}if(runner.staller){interesting.push(runner.staller);continue}if(runner.didBump){continue}runner.didBump=true;newRunners++}const value=await this.#checkQuorum(running,req);if(value!==undefined){if(value instanceof Error){throw value}return value}for(let i=0;i0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:Array.from(running).map(r=>stringify(r.result))}});await Promise.race(interesting);return await this.#waitForQuorum(running,req)}async _perform(req){if(req.method==="broadcastTransaction"){const results=await Promise.all(this.#configs.map(async({provider,weight})=>{try{const result=await provider._perform(req);return Object.assign(normalizeResult({result:result}),{weight:weight})}catch(error){return Object.assign(normalizeResult({error:error}),{weight:weight})}}));const result=getAnyResult(this.quorum,results);assert(result!==undefined,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:results.map(stringify)}});if(result instanceof Error){throw result}return result}await this.#initialSync();const running=new Set;for(let i=0;i{const payload={method:method,params:params};this.emit("debug",{action:"sendEip1193Request",payload:payload});try{const result=await core.request(payload);this.emit("debug",{action:"receiveEip1193Result",result:result});return result}catch(e){const error=new Error(e.message);error.code=e.code;error.data=e.data;error.payload=payload;this.emit("debug",{action:"receiveEip1193Error",error:error});throw error}}}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){assertArgument(!Array.isArray(payload),"EIP-1193 does not support batch request","payload",payload);try{const result=await this.#request(payload.method,payload.params||[]);return[{id:payload.id,result:result}]}catch(e){return[{id:payload.id,error:{code:e.code,data:e.data,message:e.message}}]}}getRpcError(payload,error){error=JSON.parse(JSON.stringify(error));switch(error.error.code||-1){case 4001:error.error.message=`corebc-user-denied: ${error.error.message}`;break;case 4200:error.error.message=`corebc-unsupported: ${error.error.message}`;break}return super.getRpcError(payload,error)}async hasSigner(address){if(address==null){address=0}const accounts=await this.send("xcb_accounts",[]);if(typeof address==="number"){return accounts.length>address}address=address.toLowerCase();return accounts.filter(a=>a.toLowerCase()===address).length!==0}async getSigner(address){if(address==null){address=0}if(!await this.hasSigner(address)){try{await this.#request("xcb_requestAccounts",[])}catch(error){const payload=error.payload;throw this.getRpcError(payload,{id:payload.id,error:error})}}return await super.getSigner(address)}}const defaultApplicationId="62e1ad51b37b8e00394bda3b";function getHost(name){switch(name){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}assertArgument(false,"unsupported network","network",name)}class PocketProvider extends JsonRpcProvider{applicationId;applicationSecret;constructor(_network,applicationId,applicationSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(applicationId==null){applicationId=defaultApplicationId}if(applicationSecret==null){applicationSecret=null}const options={staticNetwork:network};const request=PocketProvider.getRequest(network,applicationId,applicationSecret);super(request,network,options);defineProperties(this,{applicationId:applicationId,applicationSecret:applicationSecret})}_getProvider(networkId){try{return new PocketProvider(networkId,this.applicationId,this.applicationSecret)}catch(error){}return super._getProvider(networkId)}static getRequest(network,applicationId,applicationSecret){if(applicationId==null){applicationId=defaultApplicationId}const request=new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`);request.allowGzip=true;if(applicationSecret){request.setCredentials("",applicationSecret)}if(applicationId===defaultApplicationId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("PocketProvider");return true}}return request}isCommunityResource(){return this.applicationId===defaultApplicationId}}const IpcSocketProvider=undefined;class BaseWallet extends AbstractSigner{address;prefix;#signingKey;constructor({signingKey,prefix,provider}){super(provider);this.prefix=prefix;assertArgument(signingKey&&typeof signingKey.sign==="function","invalid signingKey key","signingKey","[ REDACTED ]");this.#signingKey=signingKey;const address=computeAddress(this.#signingKey,prefix);defineProperties(this,{address:address})}get signingKey(){return this.#signingKey}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(provider){return new BaseWallet({signingKey:this.#signingKey,prefix:this.prefix,provider:provider})}async signTransaction(tx){const{to,from}=await resolveProperties({to:tx.to||undefined,from:tx.from||undefined});if(to!=null){tx.to=to}if(from!=null){tx.from=from}if(tx.from!=null){assertArgument(getAddress(tx.from)===this.address,"transaction from address mismatch","tx.from",tx.from);delete tx.from}const btx=Transaction.from(tx);const unSignedSerialized=btx.unsignedSerialized;const unsignedHash=sha256(unSignedSerialized);btx.signature=this.signingKey.sign(unsignedHash);return btx.serialized}async signMessage(message){return this.signMessageSync(message)}signMessageSync(message){return this.signingKey.sign(hashMessage(message))}async signTypedData(domain,types,value){const populated=await TypedDataEncoder.resolveNames(domain,types,value,async name=>{assert(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:name}});const address=getAddress(name);assert(address!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:name});return address});return this.signingKey.sign(TypedDataEncoder.hash(populated.domain,types,populated.value))}}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}static check(wordlist){const words=[];for(let i=0;i<2048;i++){const word=wordlist.getWord(i);if(i!==wordlist.getWordIndex(word)){return"0x"}words.push(word)}return id(words.join("\n")+"\n")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n",true);if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value)}return output}function checkScalarValue(codePoint){if(codePoint>=55296&&codePoint<=57343){throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value")}}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint){if((codePoint&4294967168)==0){return stringFromCharCode(codePoint)}var symbol="";if((codePoint&4294965248)==0){symbol=stringFromCharCode(codePoint>>6&31|192)}else if((codePoint&4294901760)==0){checkScalarValue(codePoint);symbol=stringFromCharCode(codePoint>>12&15|224);symbol+=createByte(codePoint,6)}else if((codePoint&4292870144)==0){symbol=stringFromCharCode(codePoint>>18&7|240);symbol+=createByte(codePoint,12);symbol+=createByte(codePoint,6)}symbol+=stringFromCharCode(codePoint&63|128);return symbol}function utf8encode(string){var codePoints=ucs2decode(string);var length=codePoints.length;var index=-1;var codePoint;var byteString="";while(++index=byteCount){throw Error("Invalid byte index")}var continuationByte=byteArray[byteIndex]&255;byteIndex++;if((continuationByte&192)==128){return continuationByte&63}throw Error("Invalid continuation byte")}function decodeSymbol(){var byte1;var byte2;var byte3;var byte4;var codePoint;if(byteIndex>byteCount){throw Error("Invalid byte index")}if(byteIndex==byteCount){return false}byte1=byteArray[byteIndex]&255;byteIndex++;if((byte1&128)==0){return byte1}if((byte1&224)==192){byte2=readContinuationByte();codePoint=(byte1&31)<<6|byte2;if(codePoint>=128){return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&240)==224){byte2=readContinuationByte();byte3=readContinuationByte();codePoint=(byte1&15)<<12|byte2<<6|byte3;if(codePoint>=2048){checkScalarValue(codePoint);return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&248)==240){byte2=readContinuationByte();byte3=readContinuationByte();byte4=readContinuationByte();codePoint=(byte1&7)<<18|byte2<<12|byte3<<6|byte4;if(codePoint>=65536&&codePoint<=1114111){return codePoint}}throw Error("Invalid UTF-8 detected")}var byteArray;var byteCount;var byteIndex;function utf8decode(byteString){byteArray=ucs2decode(byteString);byteCount=byteArray.length;byteIndex=0;var codePoints=[];var tmp;while((tmp=decodeSymbol())!==false){codePoints.push(tmp)}return ucs2encode(codePoints)}root.version="3.0.0";root.encode=utf8encode;root.decode=utf8decode})(exports)})(utf8$1);return utf8$1}var utf8Exports=requireUtf8();var utf8=getDefaultExportFromCjs(utf8Exports);function mnemonicToSeed(mnemonic,password){if(!password){password=""}const t=generateSeed(mnemonic,password);return t.goldilock}const generateSeed=(mnemonic,password)=>{const goldilockSaltPrefix="mnemonic";const aesSaltPrefix="mnemonicfortheAESkey";const goldilockSalt=utf8.encode(goldilockSaltPrefix+password);const aesSalt=utf8.encode(aesSaltPrefix+password);const goldilockKey=pbkdf2Sync(bufferExports.Buffer.from(mnemonic),bufferExports.Buffer.from(goldilockSalt),2048,64,"sha512");const aesKeySeed=pbkdf2Sync(bufferExports.Buffer.from(mnemonic),bufferExports.Buffer.from(aesSalt),2048,64,"sha512");return{aes:bufferExports.Buffer.from(aesKeySeed).toString("hex"),goldilock:bufferExports.Buffer.from(goldilockKey).toString("hex")}};function getUpperMask(bits){return(1<=12&&words.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const entropy=new Uint8Array(Math.ceil(11*words.length/8));let offset=0;for(let i=0;i=0,`invalid mnemonic word at index ${i}`,"mnemonic","[ REDACTED ]");for(let bit=0;bit<11;bit++){if(index&1<<10-bit){entropy[offset>>3]|=1<<7-offset%8}offset++}}const entropyBits=32*words.length/3;const checksumBits=words.length/3;const checksumMask=getUpperMask(checksumBits);const checksum=getBytes(legacySha256(entropy.slice(0,entropyBits/8)))[0]&checksumMask;assertArgument(checksum===(entropy[entropy.length-1]&checksumMask),"invalid mnemonic checksum","mnemonic","[ REDACTED ]");return hexlify(entropy.slice(0,entropyBits/8))}function entropyToMnemonic(entropy,wordlist){assertArgument(entropy.length%4===0&&entropy.length>=16&&entropy.length<=32,"invalid entropy size","entropy","[ REDACTED ]");if(wordlist==null){wordlist=LangEn.wordlist()}const indices=[0];let remainingBits=11;for(let i=0;i8){indices[indices.length-1]<<=8;indices[indices.length-1]|=entropy[i];remainingBits-=8}else{indices[indices.length-1]<<=remainingBits;indices[indices.length-1]|=entropy[i]>>8-remainingBits;indices.push(entropy[i]&getLowerMask(8-remainingBits));remainingBits+=3}}const checksumBits=entropy.length/4;const checksum=parseInt(legacySha256(entropy).substring(2,4),16)&getUpperMask(checksumBits);indices[indices.length-1]<<=checksumBits;indices[indices.length-1]|=checksum>>8-checksumBits;return wordlist.join(indices.map(index=>wordlist.getWord(index)))}const _guard$1={};class Mnemonic{phrase;password;wordlist;entropy;constructor(guard,entropy,phrase,password,wordlist){if(password==null){password=""}if(wordlist==null){wordlist=LangEn.wordlist()}assertPrivate(guard,_guard$1,"Mnemonic");defineProperties(this,{phrase:phrase,password:password,wordlist:wordlist,entropy:entropy})}computeSeed(){return mnemonicToSeed(this.phrase,this.password)}static fromPhrase({phrase,password,wordlist}){const entropy=mnemonicToEntropy(phrase,wordlist);phrase=entropyToMnemonic(getBytes(entropy),wordlist);return new Mnemonic(_guard$1,entropy,phrase,password,wordlist)}static fromEntropy(_entropy,password,wordlist){const entropy=getBytes(_entropy,"entropy");const phrase=entropyToMnemonic(entropy,wordlist);return new Mnemonic(_guard$1,hexlify(entropy),phrase,password,wordlist)}static entropyToPhrase(_entropy,wordlist){const entropy=getBytes(_entropy,"entropy");return entropyToMnemonic(entropy,wordlist)}static phraseToEntropy(phrase,wordlist){return mnemonicToEntropy(phrase,wordlist)}static isValidMnemonic(phrase,wordlist){try{mnemonicToEntropy(phrase,wordlist);return true}catch(error){}return false}}var aesJs={exports:{}};var hasRequiredAesJs;function requireAesJs(){if(hasRequiredAesJs)return aesJs.exports;hasRequiredAesJs=1;(function(module,exports){(function(root){function checkInt(value){return parseInt(value)===value}function checkInts(arrayish){if(!checkInt(arrayish.length)){return false}for(var i=0;i255){return false}}return true}function coerceArray(arg,copy){if(arg.buffer&&arg.name==="Uint8Array"){if(copy){if(arg.slice){arg=arg.slice()}else{arg=Array.prototype.slice.call(arg)}}return arg}if(Array.isArray(arg)){if(!checkInts(arg)){throw new Error("Array contains invalid value: "+arg)}return new Uint8Array(arg)}if(checkInt(arg.length)&&checkInts(arg)){return new Uint8Array(arg)}throw new Error("unsupported array-like object")}function createArray(length){return new Uint8Array(length)}function copyArray(sourceArray,targetArray,targetStart,sourceStart,sourceEnd){if(sourceStart!=null||sourceEnd!=null){if(sourceArray.slice){sourceArray=sourceArray.slice(sourceStart,sourceEnd)}else{sourceArray=Array.prototype.slice.call(sourceArray,sourceStart,sourceEnd)}}targetArray.set(sourceArray,targetStart)}var convertUtf8=function(){function toBytes(text){var result=[],i=0;text=encodeURI(text);while(i191&&c<224){result.push(String.fromCharCode((c&31)<<6|bytes[i+1]&63));i+=2}else{result.push(String.fromCharCode((c&15)<<12|(bytes[i+1]&63)<<6|bytes[i+2]&63));i+=3}}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var convertHex=function(){function toBytes(text){var result=[];for(var i=0;i>4]+Hex[v&15])}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var numberOfRounds={16:10,24:12,32:14};var rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];var S=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];var Si=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];var T1=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986];var T2=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766];var T3=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126];var T4=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436];var T5=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890];var T6=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935];var T7=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600];var T8=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480];var U1=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795];var U2=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855];var U3=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150];var U4=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(bytes){var result=[];for(var i=0;i>2;this._Ke[index][i%4]=tk[i];this._Kd[rounds-index][i%4]=tk[i]}var rconpointer=0;var t=KC,tt;while(t>16&255]<<24^S[tt>>8&255]<<16^S[tt&255]<<8^S[tt>>24&255]^rcon[rconpointer]<<24;rconpointer+=1;if(KC!=8){for(var i=1;i>8&255]<<8^S[tt>>16&255]<<16^S[tt>>24&255]<<24;for(var i=KC/2+1;i>2;c=t%4;this._Ke[r][c]=tk[i];this._Kd[rounds-r][c]=tk[i++];t++}}for(var r=1;r>24&255]^U2[tt>>16&255]^U3[tt>>8&255]^U4[tt&255]}}};AES.prototype.encrypt=function(plaintext){if(plaintext.length!=16){throw new Error("invalid plaintext size (must be 16 bytes)")}var rounds=this._Ke.length-1;var a=[0,0,0,0];var t=convertToInt32(plaintext);for(var i=0;i<4;i++){t[i]^=this._Ke[0][i]}for(var r=1;r>24&255]^T2[t[(i+1)%4]>>16&255]^T3[t[(i+2)%4]>>8&255]^T4[t[(i+3)%4]&255]^this._Ke[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Ke[rounds][i];result[4*i]=(S[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(S[t[(i+1)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(S[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(S[t[(i+3)%4]&255]^tt)&255}return result};AES.prototype.decrypt=function(ciphertext){if(ciphertext.length!=16){throw new Error("invalid ciphertext size (must be 16 bytes)")}var rounds=this._Kd.length-1;var a=[0,0,0,0];var t=convertToInt32(ciphertext);for(var i=0;i<4;i++){t[i]^=this._Kd[0][i]}for(var r=1;r>24&255]^T6[t[(i+3)%4]>>16&255]^T7[t[(i+2)%4]>>8&255]^T8[t[(i+1)%4]&255]^this._Kd[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Kd[rounds][i];result[4*i]=(Si[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(Si[t[(i+3)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(Si[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(Si[t[(i+1)%4]&255]^tt)&255}return result};var ModeOfOperationECB=function(key){if(!(this instanceof ModeOfOperationECB)){throw Error("AES must be instanitated with `new`")}this.description="Electronic Code Block";this.name="ecb";this._aes=new AES(key)};ModeOfOperationECB.prototype.encrypt=function(plaintext){plaintext=coerceArray(plaintext);if(plaintext.length%16!==0){throw new Error("invalid plaintext size (must be multiple of 16 bytes)")}var ciphertext=createArray(plaintext.length);var block=createArray(16);for(var i=0;iNumber.MAX_SAFE_INTEGER){throw new Error("integer value out of safe range")}for(var index=15;index>=0;--index){this._counter[index]=value%256;value=parseInt(value/256)}};Counter.prototype.setBytes=function(bytes){bytes=coerceArray(bytes,true);if(bytes.length!=16){throw new Error("invalid counter bytes size (must be 16 bytes)")}this._counter=bytes};Counter.prototype.increment=function(){for(var i=15;i>=0;i--){if(this._counter[i]===255){this._counter[i]=0}else{this._counter[i]++;break}}};var ModeOfOperationCTR=function(key,counter){if(!(this instanceof ModeOfOperationCTR)){throw Error("AES must be instanitated with `new`")}this.description="Counter";this.name="ctr";if(!(counter instanceof Counter)){counter=new Counter(counter)}this._counter=counter;this._remainingCounter=null;this._remainingCounterIndex=16;this._aes=new AES(key)};ModeOfOperationCTR.prototype.encrypt=function(plaintext){var encrypted=coerceArray(plaintext,true);for(var i=0;i16){throw new Error("PKCS#7 padding byte out of range")}var length=data.length-padder;for(var i=0;i1&&N<=1048576&&(N&N-1)===0,"unsafe scrypt N","kdf.N",N);assertArgument(Number.isSafeInteger(r)&&Number.isSafeInteger(p)&&r>0&&p>0&&r*p<=1048576&&128*N*r<=256*1024*1024,"unsafe scrypt work or memory requirement","kdf",{N:N,r:r,p:p})}function getDecryptKdfParams(data){const kdf=spelunk(data,"crypto.kdf:string");if(kdf&&typeof kdf==="string"){if(kdf.toLowerCase()==="scrypt"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const N=spelunk(data,"crypto.kdfparams.n:int!");const r=spelunk(data,"crypto.kdfparams.r:int!");const p=spelunk(data,"crypto.kdfparams.p:int!");validateScrypt(N,r,p);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dflen",dkLen);return{name:"scrypt",salt:salt,N:N,r:r,p:p,dkLen:64}}else if(kdf.toLowerCase()==="pbkdf2"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const prf=spelunk(data,"crypto.kdfparams.prf:string!");const algorithm=prf.split("-").pop();assertArgument(prf==="hmac-sha256"||prf==="hmac-sha512","invalid kdf.pdf","kdf.pdf",prf);const count=spelunk(data,"crypto.kdfparams.c:int!");assertArgument(Number.isSafeInteger(count)&&count>0&&count<=1e7,"unsafe PBKDF2 iteration count","kdf.c",count);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dklen",dkLen);return{name:"pbkdf2",salt:salt,count:count,dkLen:dkLen,algorithm:algorithm}}}assertArgument(false,"unsupported key-derivation function","kdf",kdf)}function decryptKeystoreJsonSync(json,_password){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=scryptSync(password,salt,N,r,p,dkLen);return getAccount(data,key)}function stall$1(duration){return new Promise(resolve=>{setTimeout(()=>{resolve()},duration)})}async function decryptKeystoreJson(json,_password,progress){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){if(progress){progress(0);await stall$1(0)}const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);if(progress){progress(1);await stall$1(0)}return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=await scrypt(password,salt,N,r,p,dkLen,progress);return getAccount(data,key)}function getEncryptKdfParams(options){const salt=options.salt!=null?getBytes(options.salt,"options.salt"):randomBytes(32);let N=1<<17,r=8,p=1;if(options.scrypt){if(options.scrypt.N!=null){N=options.scrypt.N}if(options.scrypt.r!=null){r=options.scrypt.r}if(options.scrypt.p!=null){p=options.scrypt.p}}validateScrypt(N,r,p);return{name:"scrypt",dkLen:32,salt:salt,N:N,r:r,p:p}}function _encryptKeystore(key,kdf,account,options){const privateKey=getBytes(account.privateKey,"privateKey");const iv=options.iv!=null?getBytes(options.iv,"options.iv"):randomBytes(16);assertArgument(iv.length===16,"invalid options.iv length","options.iv",options.iv);const uuidRandom=options.uuid!=null?getBytes(options.uuid,"options.uuid"):randomBytes(16);assertArgument(uuidRandom.length===16,"invalid options.uuid length","options.uuid",options.iv);const derivedKey=key.slice(0,16);const macPrefix=key.slice(16,32);const aesCtr=new CTR(derivedKey,new Counter(iv));const ciphertext=getBytes(aesCtr.encrypt(privateKey));const mac=sha256(concat([macPrefix,ciphertext]));const data={address:account.address.substring(2).toLowerCase(),id:uuidV4(uuidRandom),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(iv).substring(2)},ciphertext:hexlify(ciphertext).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify(kdf.salt).substring(2),n:kdf.N,dklen:32,p:kdf.p,r:kdf.r},mac:mac.substring(2)}};if(account.mnemonic){const client=options.client!=null?options.client:`corebc/${version}`;const path=account.mnemonic.path||defaultPath$1;const locale=account.mnemonic.locale||"en";const mnemonicKey=key.slice(32,64);const entropy=getBytes(account.mnemonic.entropy,"account.mnemonic.entropy");const mnemonicIv=randomBytes(16);const mnemonicAesCtr=new CTR(mnemonicKey,new Counter(mnemonicIv));const mnemonicCiphertext=getBytes(mnemonicAesCtr.encrypt(entropy));const now=new Date;const timestamp=now.getUTCFullYear()+"-"+zpad(now.getUTCMonth()+1,2)+"-"+zpad(now.getUTCDate(),2)+"T"+zpad(now.getUTCHours(),2)+"-"+zpad(now.getUTCMinutes(),2)+"-"+zpad(now.getUTCSeconds(),2)+".0Z";const gethFilename="UTC--"+timestamp+"--"+data.address;data["x-corebc"]={client:client,gethFilename:gethFilename,path:path,locale:locale,mnemonicCounter:hexlify(mnemonicIv).substring(2),mnemonicCiphertext:hexlify(mnemonicCiphertext).substring(2),version:"0.1"}}return JSON.stringify(data)}function encryptKeystoreJsonSync(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=scryptSync(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64);return _encryptKeystore(getBytes(key),kdf,account,options)}async function encryptKeystoreJson(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=await scrypt(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64,options.progressCallback);return _encryptKeystore(getBytes(key),kdf,account,options)}const defaultPath="m";const HardenedBit=2147483648;const _guard={};function derivePath(node,path){const components=path.split("/");assertArgument(components.length>0&&(components[0]==="m"||node.depth>0),"invalid path","path",path);if(components[0]==="m"){components.shift()}let result=node;for(let i=0;i=0&&index=0&&index{setTimeout(()=>{resolve()},duration)})}class Wallet extends BaseWallet{constructor({key,prefix,provider}){if(typeof key==="string"&&!key.startsWith("0x")){key="0x"+key}let signingKey=typeof key==="string"?new SigningKey(key):key;super({signingKey:signingKey,prefix:prefix,provider:provider})}connect(provider){return new Wallet({key:this.signingKey,prefix:this.prefix,provider:provider})}async encrypt(password,progressCallback){const account={address:this.address,privateKey:this.privateKey};return await encryptKeystoreJson(account,password,{progressCallback:progressCallback})}encryptSync(password){const account={address:this.address,privateKey:this.privateKey};return encryptKeystoreJsonSync(account,password)}static#fromAccount(account){assertArgument(account,"invalid JSON wallet","json","[ REDACTED ]");const address=account.address;const prefix=extractPrefix(address);if("mnemonic"in account&&account.mnemonic&&account.mnemonic.locale==="en"){const mnemonic=Mnemonic.fromEntropy(account.mnemonic.entropy);const wallet=HDNodeWallet.fromMnemonic(mnemonic,prefix,account.mnemonic.path);if(wallet.address===account.address&&wallet.privateKey===account.privateKey){return wallet}console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const wallet=new Wallet({key:account.privateKey,prefix:prefix});assertArgument(wallet.address===account.address,"address/privateKey mismatch","json","[ REDACTED ]");return wallet}static async fromEncryptedJson(json,password,progress){let account=null;if(isKeystoreJson(json)){account=await decryptKeystoreJson(json,password,progress)}else if(isCrowdsaleJson(json)){if(progress){progress(0);await stall(0)}account=decryptCrowdsaleJson(json,password);if(progress){progress(1);await stall(0)}}return Wallet.#fromAccount(account)}static fromEncryptedJsonSync(json,password){let account=null;if(isKeystoreJson(json)){account=decryptKeystoreJsonSync(json,password)}else if(isCrowdsaleJson(json)){account=decryptCrowdsaleJson(json,password)}else{assertArgument(false,"invalid JSON wallet","json","[ REDACTED ]")}return Wallet.#fromAccount(account)}static createRandom(prefix,provider){const wallet=HDNodeWallet.createRandom(prefix,undefined,undefined,undefined);if(provider){return wallet.connect(provider)}return wallet}static fromPhrase({phrase,prefix,provider,password}){const wallet=HDNodeWallet.fromPhrase({phrase:phrase,prefix:prefix,password:password});if(provider){return wallet.connect(provider)}return wallet}static fromSeed({seed,prefix,provider,path}){const wallet=HDNodeWallet.fromSeed({seed:seed,prefix:prefix,path:path||defaultPath});if(provider){return wallet.connect(provider)}return wallet}}const Base64=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function decodeBits(width,data){const maxValue=(1<=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const wordlists={en:LangEn.wordlist()};const customUnitAbi=Object.freeze(["function supportsUnit(string unit) view returns (bool)","function supportedUnits() view returns (string[])","function preferredUnit() view returns (string)","function balanceOf(address account) view returns (uint256)","function balanceOfUnit(address account, string unit) view returns (uint256)"]);class CustomUnitDiscovery{preferredUnit;supportedUnits;constructor(units,preferredUnit){this.preferredUnit=preferredUnit;this.supportedUnits=Object.freeze([...units])}get isValid(){return this.supports("units")&&this.preferredUnit!==""&&this.supports(this.preferredUnit)}supports(unit){return this.supportedUnits.includes(unit)}}class CustomUnitBalance{canonicalAmount;unitAmount;unit;constructor(canonicalAmount,unitAmount,unit){this.canonicalAmount=canonicalAmount;this.unitAmount=unitAmount;this.unit=unit}get multiplierNumerator(){return this.unitAmount}get multiplierDenominator(){return this.canonicalAmount}}class CustomUnitToken{contract;constructor(address,runner){this.contract=new Contract(address,customUnitAbi,runner)}async supportsUnit(unit,blockTag){return unit.trim()!==""&&await this.contract.supportsUnit(unit.trim(),{blockTag:blockTag})}async supportedUnits(blockTag){return Object.freeze(Array.from(await this.contract.supportedUnits({blockTag:blockTag})))}async preferredUnit(blockTag){return(await this.contract.preferredUnit({blockTag:blockTag})).trim()}async discover(blockTag){if(!await this.supportsUnit("units",blockTag))return null;const discovery=new CustomUnitDiscovery(await this.supportedUnits(blockTag),await this.preferredUnit(blockTag));return discovery.isValid?discovery:null}canonicalBalance(account,blockTag){return this.contract.balanceOf(account,{blockTag:blockTag})}balanceOfUnit(account,unit,blockTag){if(!unit.trim())throw new TypeError("unit must not be empty");return this.contract.balanceOfUnit(account,unit.trim(),{blockTag:blockTag})}async balance(account,unit,blockTag){const resolved=unit?.trim()||await this.preferredUnit(blockTag);const[canonical,calculated]=await Promise.all([this.canonicalBalance(account,blockTag),this.balanceOfUnit(account,resolved,blockTag)]);return new CustomUnitBalance(canonical,calculated,resolved)}}const cip150Abi=Object.freeze(["function getMetadataValue(string key) view returns (string value)","function hasMetadataKey(string key) view returns (bool exists)","function isMetadataSealed(string key) view returns (bool sealed)","function listMetadataKeys() view returns (string[] keys)","function getMetadataByIndex(uint256 index) view returns (string key, string value)","function metadataCount() view returns (uint256 total)","function setMetadataValue(string key, string value)","function sealMetadataKey(string key)"]);const cip151TokenExpirationKey="tokenExpiration";const cip151TradingStopKey="tradingStop";const cip152LabKey="lab";class Cip151Lifecycle{tokenExpiration;tradingStop;constructor(metadata={}){const parse=key=>{const value=metadata[key];if(value==null||value==="")return null;if(!/^\d+$/.test(value))throw new TypeError(`${key} must be a non-negative Unix timestamp`);return BigInt(value)};this.tokenExpiration=parse(cip151TokenExpirationKey);this.tradingStop=parse(cip151TradingStopKey)}isExpiredAt(seconds){return this.tokenExpiration!==null&&seconds>=this.tokenExpiration}isTradingStoppedAt(seconds){return this.tradingStop!==null&&seconds>=this.tradingStop}}class Cip152LabCertificate{measurements;constructor(json){if(json===null||typeof json!=="object"||Array.isArray(json))throw new TypeError("CIP-152 lab.json must be an object");const measurements=Object.create(null);for(const[key,property]of Object.entries(json)){if(!property||typeof property!=="object"||Array.isArray(property)||!Object.hasOwn(property,"value"))throw new TypeError(`CIP-152 property ${key} must contain a value`);const{value,unit}=property;if(!(typeof value==="string"||typeof value==="number"&&Number.isFinite(value)))throw new TypeError(`CIP-152 property ${key} has an invalid value`);if(unit!=null&&typeof unit!=="string")throw new TypeError(`CIP-152 property ${key} has an invalid unit`);measurements[key]=Object.freeze(unit==null?{value:value}:{value:value,unit:unit})}this.measurements=Object.freeze(measurements)}}class Cip150MetadataContract{contract;constructor(address,runner){this.contract=new Contract(address,cip150Abi,runner)}getValue(key,blockTag){return this.contract.getMetadataValue(key,{blockTag:blockTag})}hasKey(key,blockTag){return this.contract.hasMetadataKey(key,{blockTag:blockTag})}isSealed(key,blockTag){return this.contract.isMetadataSealed(key,{blockTag:blockTag})}async listKeys(blockTag){return Object.freeze(Array.from(await this.contract.listMetadataKeys({blockTag:blockTag})))}async getByIndex(index,blockTag){const[key,value]=await this.contract.getMetadataByIndex(index,{blockTag:blockTag});return Object.freeze({key:key,value:value})}count(blockTag){return this.contract.metadataCount({blockTag:blockTag})}async readAll(blockTag,includeSealedState=true){const entries=[];for(const key of await this.listKeys(blockTag)){const value=await this.getValue(key,blockTag);entries.push(Object.freeze(includeSealedState?{key:key,value:value,sealed:await this.isSealed(key,blockTag)}:{key:key,value:value}))}return Object.freeze(entries)}setValue(key,value,overrides={}){return this.contract.setMetadataValue(key,value,overrides)}sealKey(key,overrides={}){return this.contract.sealMetadataKey(key,overrides)}async readLifecycle(blockTag){const metadata={};for(const key of[cip151TokenExpirationKey,cip151TradingStopKey]){if(await this.hasKey(key,blockTag))metadata[key]=await this.getValue(key,blockTag)}return new Cip151Lifecycle(metadata)}async readLabCertificate(gateway,blockTag){if(!await this.hasKey(cip152LabKey,blockTag))return null;const reference=await this.getValue(cip152LabKey,blockTag);if(!gateway.resolve(reference).pathname.endsWith("/lab.json"))throw new TypeError("CIP-152 reference must point to lab.json");return new Cip152LabCertificate(await gateway.readJson(reference))}}const defaultIpfsGatewayTemplate="https://ipf.sk/{cid}";class IpfsGateway{template;maxResponseBytes;timeoutMs;#fetch;constructor(options={}){this.template=options.template??defaultIpfsGatewayTemplate;this.maxResponseBytes=options.maxResponseBytes??1024*1024;this.timeoutMs=options.timeoutMs??3e4;this.#fetch=options.fetch??globalThis.fetch;const templateUrl=new URL(this.template.replace("{cid}","cid"));if(!/^https?:$/.test(templateUrl.protocol)||this.template.split("{cid}").length!==2)throw new TypeError("gateway template must be HTTP(S) and contain one {cid}");for(const value of[this.maxResponseBytes,this.timeoutMs])if(!Number.isSafeInteger(value)||value<=0)throw new TypeError("gateway limits must be positive safe integers")}resolve(reference){const value=reference.trim();if(/^https?:\/\//i.test(value))return new URL(value);const path=value.replace(/^ipfs:\/\//,"").replace(/^\/?ipfs\//,"");if(!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path)||path.split("/").some(part=>part==="."||part===".."))throw new TypeError("invalid IPFS reference");return new URL(this.template.replace("{cid}",path.split("/").map(encodeURIComponent).join("/")))}async readJson(reference){const controller=new AbortController;const timer=setTimeout(()=>controller.abort(),this.timeoutMs);let reader;try{const response=await this.#fetch(this.resolve(reference),{headers:{accept:"application/json"},signal:controller.signal});if(!response.ok){await response.body?.cancel();throw new Error(`IPFS gateway returned HTTP ${response.status}`)}if(!response.body)throw new Error("IPFS gateway returned an empty body");reader=response.body.getReader();const chunks=[];let length=0;while(true){const{done,value}=await reader.read();if(done)break;length+=value.length;if(length>this.maxResponseBytes)throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);chunks.push(value)}const bytes=new Uint8Array(length);let offset=0;for(const chunk of chunks){bytes.set(chunk,offset);offset+=chunk.length}return JSON.parse(new TextDecoder("utf-8",{fatal:true}).decode(bytes))}finally{clearTimeout(timer);await reader?.cancel().catch(()=>{});reader?.releaseLock()}}}var corebc=Object.freeze({__proto__:null,AbiCoder:AbiCoder,AbstractProvider:AbstractProvider,AbstractSigner:AbstractSigner,AlchemyProvider:AlchemyProvider,AnkrProvider:AnkrProvider,BaseContract:BaseContract,BaseWallet:BaseWallet,BigNumber:BigNumber,Block:Block,BrowserProvider:BrowserProvider,Cip150MetadataContract:Cip150MetadataContract,Cip151Lifecycle:Cip151Lifecycle,Cip152LabCertificate:Cip152LabCertificate,CloudflareProvider:CloudflareProvider,ConstructorFragment:ConstructorFragment,Contract:Contract,ContractEventPayload:ContractEventPayload,ContractFactory:ContractFactory,ContractTransactionReceipt:ContractTransactionReceipt,ContractTransactionResponse:ContractTransactionResponse,ContractUnknownEventPayload:ContractUnknownEventPayload,CoreSymbol:CoreSymbol,CustomUnitBalance:CustomUnitBalance,CustomUnitDiscovery:CustomUnitDiscovery,CustomUnitToken:CustomUnitToken,Ed448Goldilock:Ed448Goldilock,EnergyCostPlugin:EnergyCostPlugin,ErrorDescription:ErrorDescription,ErrorFragment:ErrorFragment,EventFragment:EventFragment,EventLog:EventLog,EventPayload:EventPayload,FallbackFragment:FallbackFragment,FallbackProvider:FallbackProvider,FeeData:FeeData,FeeDataNetworkPlugin:FeeDataNetworkPlugin,FetchCancelSignal:FetchCancelSignal,FetchRequest:FetchRequest,FetchResponse:FetchResponse,FixedNumber:FixedNumber,Fragment:Fragment,FunctionFragment:FunctionFragment,HDNodeWallet:HDNodeWallet,Indexed:Indexed,InfuraProvider:InfuraProvider,InfuraWebSocketProvider:InfuraWebSocketProvider,Interface:Interface,IpcSocketProvider:IpcSocketProvider,IpfsGateway:IpfsGateway,JsonRpcApiProvider:JsonRpcApiProvider,JsonRpcProvider:JsonRpcProvider,JsonRpcSigner:JsonRpcSigner,LangEn:LangEn,Log:Log,LogDescription:LogDescription,MaxInt256:MaxInt256,MaxUint256:MaxUint256,MessagePrefix:MessagePrefix,MinInt256:MinInt256,Mnemonic:Mnemonic,N:N,NamedFragment:NamedFragment,Network:Network,NetworkPlugin:NetworkPlugin,NonceManager:NonceManager,OrePerXCB:OrePerXCB,ParamType:ParamType,PocketProvider:PocketProvider,QuickNodeProvider:QuickNodeProvider,Result:Result,Signature:Signature,SigningKey:SigningKey,SocketBlockSubscriber:SocketBlockSubscriber,SocketEventSubscriber:SocketEventSubscriber,SocketPendingSubscriber:SocketPendingSubscriber,SocketProvider:SocketProvider,SocketSubscriber:SocketSubscriber,StructFragment:StructFragment,Transaction:Transaction,TransactionDescription:TransactionDescription,TransactionReceipt:TransactionReceipt,TransactionResponse:TransactionResponse,Typed:Typed,TypedDataEncoder:TypedDataEncoder,UnmanagedSubscriber:UnmanagedSubscriber,Utf8ErrorFuncs:Utf8ErrorFuncs,VoidSigner:VoidSigner,Wallet:Wallet,WebSocketProvider:WebSocketProvider,Wordlist:Wordlist,WordlistOwl:WordlistOwl,WordlistOwlA:WordlistOwlA,ZeroAddress:ZeroAddress,ZeroHash:ZeroHash,accessListify:accessListify,arrayify:arrayify,assert:assert,assertArgument:assertArgument,assertArgumentCount:assertArgumentCount,assertNormalize:assertNormalize,assertPrivate:assertPrivate,checkResultErrors:checkResultErrors,cip150Abi:cip150Abi,cip151TokenExpirationKey:cip151TokenExpirationKey,cip151TradingStopKey:cip151TradingStopKey,cip152LabKey:cip152LabKey,computeAddress:computeAddress,computeHmac:computeHmac,concat:concat,copyRequest:copyRequest,customUnitAbi:customUnitAbi,dataLength:dataLength,dataSlice:dataSlice,decodeBase58:decodeBase58,decodeBase64:decodeBase64,decodeBytes32String:decodeBytes32String,decodeRlp:decodeRlp,decryptCrowdsaleJson:decryptCrowdsaleJson,decryptKeystoreJson:decryptKeystoreJson,decryptKeystoreJsonSync:decryptKeystoreJsonSync,defaultIpfsGatewayTemplate:defaultIpfsGatewayTemplate,defaultPath:defaultPath,defineProperties:defineProperties,encodeBase58:encodeBase58,encodeBase64:encodeBase64,encodeBytes32String:encodeBytes32String,encodeRlp:encodeRlp,encryptKeystoreJson:encryptKeystoreJson,encryptKeystoreJsonSync:encryptKeystoreJsonSync,formatUnits:formatUnits,formatXCB:formatXCB,fromTwos:fromTwos,getAccountPath:getAccountPath,getAddress:getAddress,getBigInt:getBigInt,getBytes:getBytes,getBytesCopy:getBytesCopy,getCreate2Address:getCreate2Address,getCreateAddress:getCreateAddress,getDefaultProvider:getDefaultProvider,getIndexedAccountPath:getIndexedAccountPath,getNumber:getNumber,getUint:getUint,hashMessage:hashMessage,hexConcat:hexConcat,hexlify:hexlify,id:id,isAddress:isAddress,isAddressable:isAddressable,isBytesLike:isBytesLike,isCallException:isCallException,isCrowdsaleJson:isCrowdsaleJson,isError:isError,isHexString:isHexString,isKeystoreJson:isKeystoreJson,keccak256:keccak256,lock:lock,makeError:makeError,mask:mask,networkIdToPrefix:networkIdToPrefix,parseUnits:parseUnits,parseXCB:parseXCB,pbkdf2:pbkdf2,publicToAddress:publicToAddress,randomBytes:randomBytes,recoverAddress:recoverAddress,resolveAddress:resolveAddress,resolveProperties:resolveProperties,ripemd160:ripemd160,scrypt:scrypt,scryptSync:scryptSync,sha256:sha256,sha512:sha512,showThrottleMessage:showThrottleMessage,solidityPacked:solidityPacked,solidityPackedSha256:solidityPackedSha256,stripZerosLeft:stripZerosLeft,toBeArray:toBeArray,toBeHex:toBeHex,toBigInt:toBigInt,toNumber:toNumber,toQuantity:toQuantity,toTwos:toTwos,toUtf8Bytes:toUtf8Bytes,toUtf8CodePoints:toUtf8CodePoints,toUtf8String:toUtf8String,uuidV4:uuidV4,verifyMessage:verifyMessage,verifyTypedData:verifyTypedData,version:version,wordlists:wordlists,zeroPadBytes:zeroPadBytes,zeroPadValue:zeroPadValue});exports.AbiCoder=AbiCoder;exports.AbstractProvider=AbstractProvider;exports.AbstractSigner=AbstractSigner;exports.AlchemyProvider=AlchemyProvider;exports.AnkrProvider=AnkrProvider;exports.BaseContract=BaseContract;exports.BaseWallet=BaseWallet;exports.BigNumber=BigNumber;exports.Block=Block;exports.BrowserProvider=BrowserProvider;exports.Buffer=bufferExports.Buffer;exports.Cip150MetadataContract=Cip150MetadataContract;exports.Cip151Lifecycle=Cip151Lifecycle;exports.Cip152LabCertificate=Cip152LabCertificate;exports.CloudflareProvider=CloudflareProvider;exports.ConstructorFragment=ConstructorFragment;exports.Contract=Contract;exports.ContractEventPayload=ContractEventPayload;exports.ContractFactory=ContractFactory;exports.ContractTransactionReceipt=ContractTransactionReceipt;exports.ContractTransactionResponse=ContractTransactionResponse;exports.ContractUnknownEventPayload=ContractUnknownEventPayload;exports.CoreSymbol=CoreSymbol;exports.CustomUnitBalance=CustomUnitBalance;exports.CustomUnitDiscovery=CustomUnitDiscovery;exports.CustomUnitToken=CustomUnitToken;exports.Ed448Goldilock=Ed448Goldilock;exports.EnergyCostPlugin=EnergyCostPlugin;exports.ErrorDescription=ErrorDescription;exports.ErrorFragment=ErrorFragment;exports.EventFragment=EventFragment;exports.EventLog=EventLog;exports.EventPayload=EventPayload;exports.FallbackFragment=FallbackFragment;exports.FallbackProvider=FallbackProvider;exports.FeeData=FeeData;exports.FeeDataNetworkPlugin=FeeDataNetworkPlugin;exports.FetchCancelSignal=FetchCancelSignal;exports.FetchRequest=FetchRequest;exports.FetchResponse=FetchResponse;exports.FixedNumber=FixedNumber;exports.Fragment=Fragment;exports.FunctionFragment=FunctionFragment;exports.HDNodeWallet=HDNodeWallet;exports.Indexed=Indexed;exports.InfuraProvider=InfuraProvider;exports.InfuraWebSocketProvider=InfuraWebSocketProvider;exports.Interface=Interface;exports.IpcSocketProvider=IpcSocketProvider;exports.IpfsGateway=IpfsGateway;exports.JsonRpcApiProvider=JsonRpcApiProvider;exports.JsonRpcProvider=JsonRpcProvider;exports.JsonRpcSigner=JsonRpcSigner;exports.LangEn=LangEn;exports.Log=Log;exports.LogDescription=LogDescription;exports.MaxInt256=MaxInt256;exports.MaxUint256=MaxUint256;exports.MessagePrefix=MessagePrefix;exports.MinInt256=MinInt256;exports.Mnemonic=Mnemonic;exports.N=N;exports.NamedFragment=NamedFragment;exports.Network=Network;exports.NetworkPlugin=NetworkPlugin;exports.NonceManager=NonceManager;exports.OrePerXCB=OrePerXCB;exports.ParamType=ParamType;exports.PocketProvider=PocketProvider;exports.QuickNodeProvider=QuickNodeProvider;exports.Result=Result;exports.Signature=Signature;exports.SigningKey=SigningKey;exports.SocketBlockSubscriber=SocketBlockSubscriber;exports.SocketEventSubscriber=SocketEventSubscriber;exports.SocketPendingSubscriber=SocketPendingSubscriber;exports.SocketProvider=SocketProvider;exports.SocketSubscriber=SocketSubscriber;exports.StructFragment=StructFragment;exports.Transaction=Transaction;exports.TransactionDescription=TransactionDescription;exports.TransactionReceipt=TransactionReceipt;exports.TransactionResponse=TransactionResponse;exports.Typed=Typed;exports.TypedDataEncoder=TypedDataEncoder;exports.UnmanagedSubscriber=UnmanagedSubscriber;exports.Utf8ErrorFuncs=Utf8ErrorFuncs;exports.VoidSigner=VoidSigner;exports.Wallet=Wallet;exports.WebSocketProvider=WebSocketProvider;exports.Wordlist=Wordlist;exports.WordlistOwl=WordlistOwl;exports.WordlistOwlA=WordlistOwlA;exports.ZeroAddress=ZeroAddress;exports.ZeroHash=ZeroHash;exports.accessListify=accessListify;exports.arrayify=arrayify;exports.assert=assert;exports.assertArgument=assertArgument;exports.assertArgumentCount=assertArgumentCount;exports.assertNormalize=assertNormalize;exports.assertPrivate=assertPrivate;exports.checkResultErrors=checkResultErrors;exports.cip150Abi=cip150Abi;exports.cip151TokenExpirationKey=cip151TokenExpirationKey;exports.cip151TradingStopKey=cip151TradingStopKey;exports.cip152LabKey=cip152LabKey;exports.computeAddress=computeAddress;exports.computeHmac=computeHmac;exports.concat=concat;exports.copyRequest=copyRequest;exports.corebc=corebc;exports.customUnitAbi=customUnitAbi;exports.dataLength=dataLength;exports.dataSlice=dataSlice;exports.decodeBase58=decodeBase58;exports.decodeBase64=decodeBase64;exports.decodeBytes32String=decodeBytes32String;exports.decodeRlp=decodeRlp;exports.decryptCrowdsaleJson=decryptCrowdsaleJson;exports.decryptKeystoreJson=decryptKeystoreJson;exports.decryptKeystoreJsonSync=decryptKeystoreJsonSync;exports.defaultIpfsGatewayTemplate=defaultIpfsGatewayTemplate;exports.defaultPath=defaultPath;exports.defineProperties=defineProperties;exports.encodeBase58=encodeBase58;exports.encodeBase64=encodeBase64;exports.encodeBytes32String=encodeBytes32String;exports.encodeRlp=encodeRlp;exports.encryptKeystoreJson=encryptKeystoreJson;exports.encryptKeystoreJsonSync=encryptKeystoreJsonSync;exports.formatUnits=formatUnits;exports.formatXCB=formatXCB;exports.fromTwos=fromTwos;exports.getAccountPath=getAccountPath;exports.getAddress=getAddress;exports.getBigInt=getBigInt;exports.getBytes=getBytes;exports.getBytesCopy=getBytesCopy;exports.getCreate2Address=getCreate2Address;exports.getCreateAddress=getCreateAddress;exports.getDefaultProvider=getDefaultProvider;exports.getIndexedAccountPath=getIndexedAccountPath;exports.getNumber=getNumber;exports.getUint=getUint;exports.hashMessage=hashMessage;exports.hexConcat=hexConcat;exports.hexlify=hexlify;exports.id=id;exports.isAddress=isAddress;exports.isAddressable=isAddressable;exports.isBytesLike=isBytesLike;exports.isCallException=isCallException;exports.isCrowdsaleJson=isCrowdsaleJson;exports.isError=isError;exports.isHexString=isHexString;exports.isKeystoreJson=isKeystoreJson;exports.keccak256=keccak256;exports.lock=lock;exports.makeError=makeError;exports.mask=mask;exports.networkIdToPrefix=networkIdToPrefix;exports.parseUnits=parseUnits;exports.parseXCB=parseXCB;exports.pbkdf2=pbkdf2;exports.publicToAddress=publicToAddress;exports.randomBytes=randomBytes;exports.recoverAddress=recoverAddress;exports.resolveAddress=resolveAddress;exports.resolveProperties=resolveProperties;exports.ripemd160=ripemd160;exports.scrypt=scrypt;exports.scryptSync=scryptSync;exports.sha256=sha256;exports.sha512=sha512;exports.showThrottleMessage=showThrottleMessage;exports.solidityPacked=solidityPacked;exports.solidityPackedSha256=solidityPackedSha256;exports.stripZerosLeft=stripZerosLeft;exports.toBeArray=toBeArray;exports.toBeHex=toBeHex;exports.toBigInt=toBigInt;exports.toNumber=toNumber;exports.toQuantity=toQuantity;exports.toTwos=toTwos;exports.toUtf8Bytes=toUtf8Bytes;exports.toUtf8CodePoints=toUtf8CodePoints;exports.toUtf8String=toUtf8String;exports.uuidV4=uuidV4;exports.verifyMessage=verifyMessage;exports.verifyTypedData=verifyTypedData;exports.version=version;exports.wordlists=wordlists;exports.zeroPadBytes=zeroPadBytes;exports.zeroPadValue=zeroPadValue}); \ No newline at end of file diff --git a/dist/wordlists-extra.js b/dist/wordlists-extra.js index f3790aa38..6d4535cdb 100644 --- a/dist/wordlists-extra.js +++ b/dist/wordlists-extra.js @@ -1,153 +1,439 @@ -import { Buffer } from 'buffer'; - -function number(n) { - if (!Number.isSafeInteger(n) || n < 0) - throw new Error(`Wrong positive integer: ${n}`); -} -function bytes(b, ...lengths) { - if (!(b instanceof Uint8Array)) - throw new Error('Expected Uint8Array'); - if (lengths.length > 0 && !lengths.includes(b.length)) - throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`); -} -function exists(instance, checkFinished = true) { - if (instance.destroyed) - throw new Error('Hash instance has been destroyed'); - if (checkFinished && instance.finished) - throw new Error('Hash#digest() has already been called'); -} -function output(out, instance) { - bytes(out); - const min = instance.outputLen; - if (out.length < min) { - throw new Error(`digestInto() expects output buffer of length at least ${min}`); - } -} - -const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1); +const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))(); const _32n = /* @__PURE__ */ BigInt(32); -// We are not using BigUint64Array, because they are extremely slow as per 2022 +// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high +// }` to match little-endian word order rather than the property names. function fromBig(n, le = false) { if (le) return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; } +// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array +// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`. function split(lst, le = false) { - let Ah = new Uint32Array(lst.length); - let Al = new Uint32Array(lst.length); - for (let i = 0; i < lst.length; i++) { + const len = lst.length; + let Ah = new Uint32Array(len); + let Al = new Uint32Array(len); + for (let i = 0; i < len; i++) { const { h, l } = fromBig(lst[i], le); [Ah[i], Al[i]] = [h, l]; } return [Ah, Al]; } -const toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0); -// for Shift in [0, 32) +// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers +// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below +// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes). +const fromNumH = (n) => (n / 2 ** 32) | 0; +const fromNumL = (n) => n >>> 0; +// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call +// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`. +function setU64FromNum(view, byteOffset, n, isLE) { + const h = fromNumH(n); + const l = fromNumL(n); + view.setUint32(byteOffset, isLE ? l : h, isLE); + view.setUint32(byteOffset + 4, isLE ? h : l, isLE); +} +// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`. const shrSH = (h, _l, s) => h >>> s; +// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`. const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in [1, 32) +// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); +// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// Right rotate for Shift in (32, 64), NOTE: 32 is special case. +// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); +// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -// Right rotate for shift===32 (just swaps l&h) -const rotr32H = (_h, l) => l; -const rotr32L = (h, _l) => h; -// Left rotate for Shift in [1, 32) -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -// Left rotate for Shift in (32, 64), NOTE: 32 is special case. -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -// JS uses 32-bit signed integers for bitwise operations which means we cannot -// simple take carry out of low bit sum by shift, we need to use division. +// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps +// local copies so V8 inlines them into keccakP. +// Add two split 64-bit words and return the split `{ h, l }` sum. +// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out +// of the low sum and instead use division. function add(Ah, Al, Bh, Bl) { const l = (Al >>> 0) + (Bl >>> 0); return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; } // Addition with more than 2 elements +// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`. const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); +// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`. const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; +// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`. const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); +// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`. const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; +// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`. const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); +// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`. const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; -// prettier-ignore -const u64 = { - fromBig, split, toBig, - shrSH, shrSL, - rotrSH, rotrSL, rotrBH, rotrBL, - rotr32H, rotr32L, - rotlSH, rotlSL, rotlBH, rotlBL, - add, add3L, add3H, add4L, add4H, add5H, add5L, + +/** + * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. + * @param a - value to test + * @returns `true` when the value is a Uint8Array-compatible view. + * @example + * Check whether a value is a Uint8Array-compatible view. + * ```ts + * isBytes(new Uint8Array([1, 2, 3])); + * ``` + */ +function isBytes$1(a) { + // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases. + // The fallback still requires a real ArrayBuffer view, so plain + // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and + // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views. + return (a instanceof Uint8Array || + (ArrayBuffer.isView(a) && + a.constructor.name === 'Uint8Array' && + 'BYTES_PER_ELEMENT' in a && + a.BYTES_PER_ELEMENT === 1)); +} +// Shared error-message prefix builder. Only called on throw paths, so assert +// success paths never pay for the string concatenation. +const atitle = (title) => (title ? `"${title}" ` : ''); +/** + * Asserts something is a non-negative integer. + * @param n - number to validate + * @param title - label included in thrown errors + * @returns The validated number. + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Validate a non-negative integer option. + * ```ts + * anumber(32, 'length'); + * ``` + */ +function anumber(n, title = '') { + if (typeof n !== 'number') + throw new TypeError(atitle(title) + 'expected number, got ' + typeof n); + if (!Number.isSafeInteger(n) || n < 0) + throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n); + return n; +} +/** + * Asserts something is a boolean. + * @param value - value to validate + * @param title - label included in thrown errors + * @returns The validated boolean. + * @throws On wrong argument types. {@link TypeError} + * @example + * Validate a boolean option. + * ```ts + * abool(true, 'enableXOF'); + * ``` + */ +function abool(value, title = '') { + if (typeof value !== 'boolean') + throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value); + return value; +} +/** + * Asserts something is Uint8Array. + * @param value - value to validate + * @param length - optional exact length constraint + * @param title - label included in thrown errors + * @returns The validated byte array. + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Validate that a value is a byte array. + * ```ts + * abytes(new Uint8Array([1, 2, 3])); + * ``` + */ +function abytes(value, length, title = '') { + // Success path first: this runs at the start of every update() / digestInto(), and the + // common `abytes(data)` form must not pay for length handling it does not use. + if (isBytes$1(value) && (length === undefined)) + return value; + const bytes = isBytes$1(value); + const ofLen = ''; + const got = bytes ? `length=${value.length}` : `type=${typeof value}`; + const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got; + if (!bytes) + throw new TypeError(message); + throw new RangeError(message); +} +const aobject = (value, label) => { + if (value === null || typeof value !== 'object' || Array.isArray(value)) + throw new TypeError((label === 'object' ? '' : `"${label}" `) + 'expected object, got type=' + typeof value); }; -var u64$1 = u64; - -/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */ -// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+. -// node.js versions earlier than v19 don't declare it in global scope. -// For node.js, package.json#exports field mapping rewrites import -// from `crypto` to `cryptoNode`, which imports native module. -// Makes the utils un-importable in browsers without a bundler. -// Once node.js 18 is deprecated, we can just drop the import. -const u8a = (a) => a instanceof Uint8Array; -const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -// Cast array to view -const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -// The rotate right (circular right shift) operation for uint32 -const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift); -// big-endian hardware is rare. Just in case someone still decides to run hashes: -// early-throw an error because we don't support BE yet. -const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44; -if (!isLE) - throw new Error('Non little-endian hardware is not supported'); -/** - * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99]) - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new Error(`utf8ToBytes expected string, got ${typeof str}`); - return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809 -} -/** - * Normalizes (non-hex) string or Uint8Array to Uint8Array. - * Warning: when Uint8Array is passed, it would NOT get copied. - * Keep in mind for future mutable operations. - */ -function toBytes(data) { - if (typeof data === 'string') - data = utf8ToBytes(data); - if (!u8a(data)) - throw new Error(`expected Uint8Array, got ${typeof data}`); - return data; -} -// For runtime check if class implements interface -class Hash { - // Safe version that clones internal state - clone() { - return this._cloneInto(); +const aopts = (value, label) => { + aobject(value, label); + const proto = Object.getPrototypeOf(value); + if (proto !== Object.prototype && proto !== null) + throw new TypeError(`"${label}" expected plain object`); + // Object.assign() treats an own "__proto__" source key as a write to the target's legacy + // prototype setter. Reject it before merging so inherited option values cannot be injected. + if (Object.hasOwn(value, '__proto__')) + throw new TypeError(`"${label}.__proto__" is not allowed`); +}; +/** + * Asserts a hash instance has not been destroyed or finished. + * @param instance - hash instance to validate + * @param checkFinished - whether to reject finalized instances + * @throws If the hash instance has already been destroyed or finalized. {@link Error} + * @example + * Validate that a hash instance is still usable. + * ```ts + * import { aexists } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const hash = sha256.create(); + * aexists(hash); + * ``` + */ +function aexists(instance, checkFinished = true) { + // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their + // truthiness is checked - re-validating their type per call was pure hot-path overhead. + if (instance.destroyed) + throw new Error('hash was destroyed'); + if (checkFinished && instance.finished) + throw new Error('digest() was already called'); +} +/** + * Asserts output is a sufficiently-sized byte array. + * @param out - destination buffer + * @param instance - hash instance providing output length + * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes. + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @example + * Validate a caller-provided digest buffer. + * ```ts + * import { aoutput } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const hash = sha256.create(); + * aoutput(new Uint8Array(hash.outputLen), hash); + * ``` + */ +function aoutput(out, instance) { + abytes(out, undefined, 'output'); + // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast + // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call. + const min = instance.outputLen; + if (!(out.length >= min)) { + throw new RangeError('"output" expected length >= ' + min); + } +} +/** + * Casts a typed array view to Uint32Array. + * `arr.byteOffset` must already be 4-byte aligned or the platform + * Uint32Array constructor will throw. + * @param arr - source typed array + * @returns Uint32Array view over the same buffer. + * @example + * Reinterpret a byte array as 32-bit words. + * ```ts + * u32(new Uint8Array(8)); + * ``` + */ +function u32(arr) { + return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); +} +/** + * Zeroizes typed arrays in place. Warning: JS provides no guarantees. + * @param arrays - arrays to overwrite with zeros + * @example + * Zeroize sensitive buffers in place. + * ```ts + * clean(new Uint8Array([1, 2, 3])); + * ``` + */ +function clean(...arrays) { + for (let i = 0; i < arrays.length; i++) { + arrays[i].fill(0); + } +} +/** + * Creates a DataView for byte-level manipulation. + * @param arr - source typed array + * @returns DataView over the same buffer region. + * @example + * Create a DataView over an existing buffer. + * ```ts + * createView(new Uint8Array(4)); + * ``` + */ +function createView(arr) { + return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); +} +/** + * Rotate-right operation for uint32 values. + * @param word - source word + * @param shift - shift amount in bits + * @returns Rotated word. + * @example + * Rotate a 32-bit word to the right. + * ```ts + * rotr(0x12345678, 8); + * ``` + */ +function rotr(word, shift) { + return (word << (32 - shift)) | (word >>> shift); +} +/** + * Rotate-left operation for uint32 values. + * @param word - source word + * @param shift - shift amount in bits + * @returns Rotated word. + * @example + * Rotate a 32-bit word to the left. + * ```ts + * rotl(0x12345678, 8); + * ``` + */ +function rotl(word, shift) { + return (word << shift) | ((word >>> (32 - shift)) >>> 0); +} +/** Whether the current platform is little-endian. */ +const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); +/** + * Byte-swap operation for uint32 values. + * @param word - source word + * @returns Word with reversed byte order. + * @example + * Reverse the byte order of a 32-bit word. + * ```ts + * byteSwap(0x11223344); + * ``` + */ +function byteSwap(word) { + return (((word << 24) & 0xff000000) | + ((word << 8) & 0xff0000) | + ((word >>> 8) & 0xff00) | + ((word >>> 24) & 0xff)); +} +/** + * Byte-swaps every word of a Uint32Array in place. + * @param arr - array to mutate + * @returns The same array after mutation; callers pass live state arrays here. + * @example + * Reverse the byte order of every word in place. + * ```ts + * byteSwap32(new Uint32Array([0x11223344])); + * ``` + */ +function byteSwap32(arr) { + for (let i = 0; i < arr.length; i++) { + arr[i] = byteSwap(arr[i]); } + return arr; +} +/** + * Conditionally byte-swaps a Uint32Array on big-endian platforms. + * @param u - array to normalize for host endianness + * @returns Original or byte-swapped array depending on platform endianness. + * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`. + * @example + * Normalize a word array for host endianness. + * ```ts + * swap32IfBE(new Uint32Array([0x11223344])); + * ``` + */ +const swap32IfBE = isLE + ? (u) => u + : byteSwap32; +/** + * Merges default options and passed options. + * @param defaults - base option object + * @param opts - user overrides + * @param title - label included in thrown override errors + * @returns Fresh merged option object with a null prototype. + * @throws On wrong argument types. {@link TypeError} + * @example + * Merge user overrides onto default options. + * ```ts + * checkOpts({ dkLen: 32 }, { asyncTick: 10 }); + * ``` + */ +function checkOpts(defaults, opts, title = 'opts') { + aopts(defaults, 'defaults'); + if (opts !== undefined) + aopts(opts, title); + // Callers read optional fields directly, so omitted values must not fall through to ambient + // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output). + const merged = Object.assign(Object.create(null), defaults, opts); + return merged; } -function wrapConstructor(hashCons) { - const hashC = (msg) => hashCons().update(toBytes(msg)).digest(); - const tmp = hashCons(); +/** + * Creates a callable hash function from a stateful class constructor. + * @param hashCons - hash constructor or factory + * @param info - optional metadata such as DER OID + * @returns Frozen callable hash wrapper with `.create()`. + * Wrapper construction eagerly calls `hashCons(undefined)` once to read + * `outputLen` / `blockLen`, so constructor side effects happen at module + * init time. + * @throws On wrong argument types. {@link TypeError} + * @example + * Wrap a stateful hash constructor into a callable helper. + * ```ts + * import { createHasher } from '@noble/hashes/utils.js'; + * import { sha256 } from '@noble/hashes/sha2.js'; + * const wrapped = createHasher(sha256.create, { oid: sha256.oid }); + * wrapped(new Uint8Array([1])); + * ``` + */ +function createHasher(hashCons, info = {}) { + if (typeof hashCons !== 'function') + throw new TypeError('"hashCons" expected function, got type=' + typeof hashCons); + info = checkOpts({}, info, 'info'); + const hashC = (msg, opts) => hashCons(opts) + .update(msg) + .digest(); + const tmp = hashCons(undefined); hashC.outputLen = tmp.outputLen; hashC.blockLen = tmp.blockLen; - hashC.create = () => hashCons(); - return hashC; + hashC.canXOF = tmp.canXOF; + hashC.create = (opts) => hashCons(opts); + Object.assign(hashC, info); + return Object.freeze(hashC); } +/** + * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`. + * @param suffix - final OID byte for the selected hash. + * The helper accepts any byte even though only the documented NIST hash + * suffixes are meaningful downstream. + * @returns Object containing the DER-encoded OID. + * @example + * Build OID metadata for a NIST hash. + * ```ts + * oidNist(0x01); + * ``` + */ +const oidNist = (suffix) => ({ + // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet. + // Larger suffix values would need base-128 OID encoding and a different length byte. + oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]), +}); -// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size. -// It's called a sponge function. +/** + * SHA3 (keccak) hash function, based on a new "Sponge function" design. + * Different from older hashes, the internal state is bigger than output size. + * + * Check out + * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202}, + * {@link https://keccak.team/keccak.html | Website}, and + * {@link https://crypto.stackexchange.com/q/15727 | the differences between + * SHA-3 and Keccak}. + * + * Check out `sha3-addons` module for cSHAKE, k12, and others. + * @module + */ +// No __PURE__ annotations in sha3 header: +// EVERYTHING is in fact used on every export. // Various per round constants calculations -const [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []]; -const _0n = /* @__PURE__ */ BigInt(0); -const _1n = /* @__PURE__ */ BigInt(1); -const _2n = /* @__PURE__ */ BigInt(2); -const _7n = /* @__PURE__ */ BigInt(7); -const _256n = /* @__PURE__ */ BigInt(256); -const _0x71n = /* @__PURE__ */ BigInt(0x71); +const _0n = BigInt(0); +const _1n = BigInt(1); +const _2n = BigInt(2); +const _7n = BigInt(7); +const _256n = BigInt(256); +// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors +// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`. +const _0x71n = BigInt(0x71); +const SHA3_PI = []; +const SHA3_ROTL = []; +const _SHA3_IOTA = []; // no pure annotation: var is always used for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { // Pi [x, y] = [y, (2 * x + 3 * y) % 5]; @@ -159,17 +445,52 @@ for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { for (let j = 0; j < 7; j++) { R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; if (R & _2n) - t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n); + t ^= _1n << ((_1n << BigInt(j)) - _1n); } _SHA3_IOTA.push(t); } -const [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true); -// Left rotation (without 0, 32, 64) +const IOTAS = split(_SHA3_IOTA, true); +// `split(..., true)` keeps the local little-endian lane-word layout used by +// `state32`, so these `H` / `L` tables follow the file's first-word / +// second-word lane slots rather than `_u64.ts`'s usual high/low naming. +const SHA3_IOTA_H = IOTAS[0]; +const SHA3_IOTA_L = IOTAS[1]; +// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can +// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only +// consumer of left-rotates; other hashes use right-rotates from _u64. +// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64. +const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); +const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); +const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); +const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); -// Same as keccakf1600, but allows to skip some rounds +// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2. +// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation. +const B = new Uint32Array(5 * 2); +/** + * `keccakf1600` internal permutation, additionally allows adjusting the round count. + * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words + * in this file's local little-endian lane-word order + * @param rounds - number of rounds to execute + * @throws On wrong argument types. {@link TypeError} + * @throws On wrong argument ranges or values. {@link RangeError} + * @throws If `rounds` is outside the supported `1..24` range. {@link Error} + * @example + * Permute a Keccak state with the default 24 rounds. + * ```ts + * keccakP(new Uint32Array(50)); + * ``` + */ function keccakP(s, rounds = 24) { - const B = new Uint32Array(5 * 2); + if (!(s instanceof Uint32Array)) + throw new TypeError('"s" expected Uint32Array(50), got type=' + typeof s); + if (s.length !== 50) + throw new RangeError('"s" expected Uint32Array(50), got length=' + s.length); + anumber(rounds, 'rounds'); + // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table. + if (rounds < 1 || rounds > 24) + throw new Error('"rounds" expected integer 1..24'); // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) for (let round = 24 - rounds; round < 24; round++) { // Theta θ @@ -201,50 +522,109 @@ function keccakP(s, rounds = 24) { s[PI + 1] = Tl; } // Chi (χ) + // Same as: + // for (let x = 0; x < 10; x++) B[x] = s[y + x]; + // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; for (let y = 0; y < 50; y += 10) { - for (let x = 0; x < 10; x++) - B[x] = s[y + x]; - for (let x = 0; x < 10; x++) - s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; + const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3]; + s[y] ^= ~s[y + 2] & s[y + 4]; + s[y + 1] ^= ~s[y + 3] & s[y + 5]; + s[y + 2] ^= ~s[y + 4] & s[y + 6]; + s[y + 3] ^= ~s[y + 5] & s[y + 7]; + s[y + 4] ^= ~s[y + 6] & s[y + 8]; + s[y + 5] ^= ~s[y + 7] & s[y + 9]; + s[y + 6] ^= ~s[y + 8] & b0; + s[y + 7] ^= ~s[y + 9] & b1; + s[y + 8] ^= ~b0 & b2; + s[y + 9] ^= ~b1 & b3; } // Iota (ι) s[0] ^= SHA3_IOTA_H[round]; s[1] ^= SHA3_IOTA_L[round]; } - B.fill(0); + clean(B); } -class Keccak extends Hash { +/** + * Keccak sponge function. + * @param blockLen - absorb/squeeze rate in bytes + * @param suffix - domain separation suffix byte + * @param outputLen - default digest length in bytes. This base sponge only + * requires a non-negative integer; wrappers that need positive output + * lengths must enforce that themselves. + * @param enableXOF - whether XOF output is allowed + * @param rounds - number of Keccak-f rounds + * @example + * Build a sponge state, absorb bytes, then finalize a digest. + * ```ts + * const hash = new Keccak(136, 0x06, 32); + * hash.update(new Uint8Array([1, 2, 3])); + * hash.digest(); + * ``` + */ +class Keccak { + state; + pos = 0; + posOut = 0; + finished = false; + state32; + destroyed = false; + blockLen; + suffix; + outputLen; + canXOF; + enableXOF = false; + rounds; // NOTE: we accept arguments in bytes instead of bits here. constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - super(); + anumber(blockLen, 'blockLen'); + anumber(suffix, 'suffix'); + anumber(rounds, 'rounds'); + abool(enableXOF, 'enableXOF'); this.blockLen = blockLen; this.suffix = suffix; this.outputLen = outputLen; this.enableXOF = enableXOF; + this.canXOF = enableXOF; this.rounds = rounds; - this.pos = 0; - this.posOut = 0; - this.finished = false; - this.destroyed = false; // Can be passed from user as dkLen - number(outputLen); - // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes - if (0 >= this.blockLen || this.blockLen >= 200) - throw new Error('Sha3 supports only keccak-f1600 function'); + anumber(outputLen, 'outputLen'); + // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state. + if (!(0 < blockLen && blockLen < 200)) + throw new Error('"blockLen" must be 1..199'); this.state = new Uint8Array(200); this.state32 = u32(this.state); } + clone() { + return this._cloneInto(); + } keccak() { + swap32IfBE(this.state32); keccakP(this.state32, this.rounds); + swap32IfBE(this.state32); this.posOut = 0; this.pos = 0; } update(data) { - exists(this); - const { blockLen, state } = this; - data = toBytes(data); + aexists(this); + abytes(data); + const { blockLen, state, state32 } = this; const len = data.length; + // Absorb full blocks with u32 XORs when both sides are 4-byte aligned. + // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe. + const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0; + const blockLen32 = blockLen / 4; + const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined; for (let pos = 0; pos < len;) { + if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) { + for (let i = 0, o = pos / 4; i < blockLen32; i++) + state32[i] ^= data32[o + i]; + pos += blockLen; + // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override, + // so it must reflect the fully-absorbed block before the permutation fires. + this.pos = blockLen; + this.keccak(); + continue; + } const take = Math.min(blockLen - this.pos, len - pos); for (let i = 0; i < take; i++) state[this.pos++] ^= data[pos++]; @@ -258,16 +638,21 @@ class Keccak extends Hash { return; this.finished = true; const { state, suffix, pos, blockLen } = this; - // Do the padding + // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1. + // These byte values already include the first padding bit, while the + // final `0x80` below supplies the closing `1` bit in the last rate byte. state[pos] ^= suffix; + // If that combined suffix lands in the last rate byte and already sets + // bit 7, absorb it first so the final pad10*1 bit can be xored into a + // fresh block. if ((suffix & 0x80) !== 0 && pos === blockLen - 1) this.keccak(); state[blockLen - 1] ^= 0x80; this.keccak(); } writeInto(out) { - exists(this, false); - bytes(out); + aexists(this, false); + abytes(out); this.finish(); const bufferOut = this.state; const { blockLen } = this; @@ -282,34 +667,42 @@ class Keccak extends Hash { return out; } xofInto(out) { - // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF + // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base + // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/ + // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF. if (!this.enableXOF) - throw new Error('XOF is not possible for this instance'); + throw new Error('XOF is not enabled'); return this.writeInto(out); } xof(bytes) { - number(bytes); + anumber(bytes); return this.xofInto(new Uint8Array(bytes)); } digestInto(out) { - output(out, this); + aoutput(out, this); if (this.finished) throw new Error('digest() was already called'); - this.writeInto(out); + // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest. + this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen)); this.destroy(); - return out; } digest() { - return this.digestInto(new Uint8Array(this.outputLen)); + const out = new Uint8Array(this.outputLen); + this.digestInto(out); + return out; } destroy() { this.destroyed = true; - this.state.fill(0); + clean(this.state); } _cloneInto(to) { const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds)); + to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); + // Reused destinations can come from a different rate/capacity variant, so clone must rewrite + // the sponge geometry as well as the state words. + to.blockLen = blockLen; to.state32.set(this.state32); + // Sponge padding and XOF output are positional, so both offsets are part of the clone state. to.pos = this.pos; to.posOut = this.posOut; to.finished = this.finished; @@ -318,22 +711,52 @@ class Keccak extends Hash { to.suffix = suffix; to.outputLen = outputLen; to.enableXOF = enableXOF; + // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone + // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie. + to.canXOF = this.canXOF; to.destroyed = this.destroyed; return to; } } -const gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen)); +const genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info); +/** + * SHA3-256 hash function. Different from keccak-256. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA3-256. + * ```ts + * sha3_256(new Uint8Array([97, 98, 99])); + * ``` + */ +const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, +/* @__PURE__ */ oidNist(0x08)); /** - * SHA3-256 hash function - * @param message - that would be hashed + * SHA3-512 hash function. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA3-512. + * ```ts + * sha3_512(new Uint8Array([97, 98, 99])); + * ``` */ -const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8); -const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8); +const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, +/* @__PURE__ */ oidNist(0x0a)); /** - * keccak-256 hash function. Different from SHA3-256. - * @param message - that would be hashed + * Keccak-256 hash function. Different from SHA3-256. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with Keccak-256. + * ```ts + * keccak_256(new Uint8Array([97, 98, 99])); + * ``` */ -const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8); +const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32); let _permanentCensorErrors = false; let _censorErrors = false; @@ -660,33 +1083,9 @@ class Logger { } } -/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ -/** - * The current version of corebc. - */ -const version = "6.4.0"; +/** The current version of corebc; keep in sync with package.json. */ +const version = "0.4.1"; -function checkType(value, type, name) { - const types = type.split("|").map((t) => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof value === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; -} /** * Assigns the %%values%% to %%target%% as read-only values. * @@ -695,10 +1094,6 @@ function checkType(value, type, name) { function defineProperties(target, values, types) { for (let key in values) { let value = values[key]; - const type = types ? types[key] : null; - if (type) { - checkType(value, type, key); - } Object.defineProperty(target, key, { enumerable: true, value, @@ -823,7 +1218,7 @@ function assert(check, message, code, info) { function assertArgument(check, message, name, value) { assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); } -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { +["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { try { // General test for normalize /* c8 ignore start */ @@ -845,15 +1240,6 @@ const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { catch (error) { } return accum; }, []); -/** - * Throws if the normalization %%form%% is not supported. - */ -function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", - info: { form }, - }); -} /** * Some data helpers. @@ -891,9 +1277,6 @@ function isBytes(value) { } function _getBytes(value, name, copy) { if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } return value; } if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { @@ -915,7 +1298,7 @@ function _getBytes(value, name, copy) { * @see: getBytesCopy */ function getBytes(value, name) { - return _getBytes(value, name, false); + return _getBytes(value, name); } /** * Returns true if %%value%% is a valid [[HexString]]. @@ -928,12 +1311,6 @@ function isHexString(value, length) { if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { return false; } - if (typeof length === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && value.length % 2 !== 0) { - return false; - } return true; } const HexCharacters = "0123456789abcdef"; @@ -1008,67 +1385,6 @@ function hexlify(value, options) { } return logger.throwArgumentError("invalid hexlify value", "value", value); } -function arrayify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "number") { - logger.checkSafeUint53(value, "invalid arrayify value"); - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value = parseInt(String(value / 256)); - } - if (result.length === 0) { - result.push(0); - } - return addSlice(new Uint8Array(result)); - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - value = value.toHexString(); - } - if (isHexString(value)) { - let hex = value.substring(2); - if (hex.length % 2) { - if (options.hexPad === "left") { - hex = "0x0" + hex.substring(2); - } - else if (options.hexPad === "right") { - hex += "0"; - } - else { - logger.throwArgumentError("hex data is odd-length", "value", value); - } - } - const result = []; - for (let i = 0; i < hex.length; i += 2) { - // @ts-ignore - result.push(parseInt(hex.substring(i, i + 2), 16)); - } - return addSlice(new Uint8Array(result)); - } - if (isBytes(value)) { - return addSlice(new Uint8Array(value)); - } - return logger.throwArgumentError("invalid arrayify value", "value", value); -} -function addSlice(array) { - // @ts-ignore - if (array.slice) { - return array; - } - array.slice = function () { - const args = Array.prototype.slice.call(arguments); - return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args))); - }; - return array; -} /** * Using strings in Core (or any security-basd system) requires @@ -1224,10 +1540,6 @@ function getUtf8CodePoints(_bytes, onError) { * If %%form%% is specified, the string is normalized. */ function toUtf8Bytes(str, form) { - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } let result = []; for (let i = 0; i < str.length; i++) { const c = str.charCodeAt(i); @@ -1328,128 +1640,359 @@ keccak256.register = function (func) { }; Object.freeze(keccak256); -// Polyfill for Safari 14 -function setBigUint64(view, byteOffset, value, isLE) { - if (typeof view.setBigUint64 === 'function') - return view.setBigUint64(byteOffset, value, isLE); - const _32n = BigInt(32); - const _u32_max = BigInt(0xffffffff); - const wh = Number((value >> _32n) & _u32_max); - const wl = Number(value & _u32_max); - const h = isLE ? 4 : 0; - const l = isLE ? 0 : 4; - view.setUint32(byteOffset + h, wh, isLE); - view.setUint32(byteOffset + l, wl, isLE); -} -// Base SHA2 class (RFC 6234) -class SHA2 extends Hash { +/** + * Internal Merkle-Damgard hash utils. + * @module + */ +/** + * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`. + * Returns bits from `b` when `a` is set, otherwise from `c`. + * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never + * set the same bit. + * @param a - selector word + * @param b - word chosen when selector bit is set + * @param c - word chosen when selector bit is clear + * @returns Mixed 32-bit word. + * @example + * Combine three words with the shared 32-bit choice primitive. + * ```ts + * Chi(0xffffffff, 0x12345678, 0x87654321); + * ``` + */ +function Chi(a, b, c) { + return (a & b) ^ (~a & c); +} +/** + * Shared 32-bit majority primitive reused by SHA-256 and SHA-1. + * Returns bits shared by at least two inputs. + * @param a - first input word + * @param b - second input word + * @param c - third input word + * @returns Mixed 32-bit word. + * @example + * Combine three words with the shared 32-bit majority primitive. + * ```ts + * Maj(0xffffffff, 0x12345678, 0x87654321); + * ``` + */ +function Maj(a, b, c) { + return (a & b) ^ (a & c) ^ (b & c); +} +/** + * Merkle-Damgard hash construction base class. + * Could be used to create MD5, RIPEMD, SHA1, SHA2. + * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit + * strings with partial-byte tails. + * @param blockLen - internal block size in bytes + * @param outputLen - digest size in bytes + * @param padOffset - trailing length field size in bytes + * @param isLE - whether length and state words are encoded in little-endian + * @example + * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow. + * ```ts + * import { _SHA1 } from '@noble/hashes/legacy.js'; + * const hash = new _SHA1(); + * hash.update(new Uint8Array([97, 98, 99])); + * hash.digest(); + * ``` + */ +class HashMD { + blockLen; + outputLen; + canXOF = false; + padOffset; + isLE; + // For partial updates less than block size + buffer; + view; + finished = false; + length = 0; + pos = 0; + destroyed = false; constructor(blockLen, outputLen, padOffset, isLE) { - super(); this.blockLen = blockLen; this.outputLen = outputLen; this.padOffset = padOffset; this.isLE = isLE; - this.finished = false; - this.length = 0; - this.pos = 0; - this.destroyed = false; this.buffer = new Uint8Array(blockLen); this.view = createView(this.buffer); } update(data) { - exists(this); + aexists(this); + abytes(data); const { view, buffer, blockLen } = this; - data = toBytes(data); const len = data.length; + let processed = false; for (let pos = 0; pos < len;) { const take = Math.min(blockLen - this.pos, len - pos); - // Fast path: we have at least one block in input, cast it to view and process + // Fast path only when there is no buffered partial block: `take === blockLen` implies + // `this.pos === 0`, so we can process full blocks directly from the input view. if (take === blockLen) { const dataView = createView(data); for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos); + processed = true; continue; } - buffer.set(data.subarray(pos, pos + take), this.pos); + // When the whole input is buffered in one go (common for short messages), passing `data` + // directly avoids allocating a subarray view. + buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos); this.pos += take; pos += take; if (this.pos === blockLen) { this.process(view, 0); this.pos = 0; + processed = true; } } this.length += data.length; - this.roundClean(); + // Shared schedule buffers only pick up input-derived words inside process(); if everything + // was buffered without processing, there is nothing to zero. + if (processed) + this.roundClean(); return this; } digestInto(out) { - exists(this); - output(out, this); + aexists(this); + aoutput(out, this); this.finished = true; // Padding // We can avoid allocation of buffer for padding completely if it // was previously not allocated here. But it won't change performance. const { buffer, view, blockLen, isLE } = this; let { pos } = this; - // append the bit '1' to the message + // append the bit '1' to the message, then zero-pad the rest of the block buffer[pos++] = 0b10000000; - this.buffer.subarray(pos).fill(0); - // we have less than padOffset left in buffer, so we cannot put length in current block, need process it and pad again + buffer.fill(0, pos); + // we have less than padOffset left in buffer, so we cannot put length in + // current block, need process it and pad again if (this.padOffset > blockLen - pos) { this.process(view, 0); - pos = 0; - } - // Pad until full block byte with zeros - for (let i = pos; i < blockLen; i++) - buffer[i] = 0; - // Note: sha512 requires length to be 128bit integer, but length in JS will overflow before that - // You need to write around 2 exabytes (u64_max / 8 / (1024**6)) for this to happen. - // So we just write lowest 64 bits of that value. - setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE); + buffer.fill(0); + } + // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from + // the padding fill above, and JS will overflow before user input can make that half non-zero. + // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an + // integer below 2**53, so the split inside the helper stays exact). + setU64FromNum(view, blockLen - 8, this.length * 8, isLE); this.process(view, 0); - const oview = createView(out); + // The final block above is processed outside update(), so the shared message-schedule + // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest(). + this.roundClean(); + // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one. + const oview = out === buffer ? view : createView(out); const len = this.outputLen; - // NOTE: we do division by 4 later, which should be fused in single op with modulo by JIT - if (len % 4) - throw new Error('_sha2: outputLen should be aligned to 32bit'); + // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT const outLen = len / 4; const state = this.get(); - if (outLen > state.length) - throw new Error('_sha2: outputLen bigger than state'); + // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state. + if (len % 4 || outLen > state.length) + throw new Error('invalid outputLen'); for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE); } digest() { const { buffer, outputLen } = this; this.digestInto(buffer); + // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return + // fresh bytes to the caller. const res = buffer.slice(0, outputLen); this.destroy(); return res; } - _cloneInto(to) { - to || (to = new this.constructor()); - to.set(...this.get()); - const { blockLen, buffer, length, finished, destroyed, pos } = this; + _cloneIntoMeta(to) { + const { buffer, length, finished, destroyed, pos } = this; + to.destroyed = destroyed; + to.finished = finished; to.length = length; to.pos = pos; - to.finished = finished; - to.destroyed = destroyed; - if (length % blockLen) - to.buffer.set(buffer); + // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and + // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it. + if (pos) + to.buffer.set(buffer); // Avoid a hot modulo guard. return to; } + clone() { + return this._cloneInto(); + } +} +/** + * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. + * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. + */ +/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the + * square roots of the first eight prime numbers. Exported as a shared table; callers must treat + * it as read-only because constructors copy words from it by index. */ +const SHA256_IV = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, +]); +/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen + * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first + * eight prime numbers. Exported as a shared table; callers must treat it as read-only because + * constructors copy halves from it by index. */ +const SHA512_IV = /* @__PURE__ */ Uint32Array.from([ + 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, + 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, +]); + +/** + +SHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions. +RFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors, +not the base RIPEMD-160 compression spec. +Don't use them in a new protocol. What "weak" means: + +- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. +- No practical pre-image attacks (only theoretical, 2^123.4) +- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151 + * @module + */ +// RIPEMD-160 +// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables. +const Rho160 = /* @__PURE__ */ Uint8Array.from([ + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, +]); +const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); +const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); +// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds. +const idxLR = /* @__PURE__ */ (() => { + const L = [Id160]; + const R = [Pi160]; + const res = [L, R]; + for (let i = 0; i < 4; i++) + for (let j of res) + j.push(j[i].map((k) => Rho160[k])); + return res; +})(); +const idxL = /* @__PURE__ */ (() => idxLR[0])(); +const idxR = /* @__PURE__ */ (() => idxLR[1])(); +// const [idxL, idxR] = idxLR; +// Base per-group shift table before the left/right message-order permutations are applied. +const shifts160 = /* @__PURE__ */ [ + [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], + [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], + [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], + [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], + [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], +].map((i) => Uint8Array.from(i)); +const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); +const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); +// Five left-lane additive constants for RIPEMD-160. +const Kl160 = /* @__PURE__ */ Uint32Array.from([ + 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, +]); +// Five right-lane additive constants for RIPEMD-160. +const Kr160 = /* @__PURE__ */ Uint32Array.from([ + 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, +]); +// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range +// inputs currently fall through to the group-4 branch. +function ripemd_f(group, x, y, z) { + if (group === 0) + return x ^ y ^ z; + if (group === 1) + return (x & y) | (~x & z); + if (group === 2) + return (x | ~y) ^ z; + if (group === 3) + return (x & z) | (y & ~z); + return x ^ (y | ~z); +} +// Reusable 16-word RIPEMD-160 message block buffer. +const BUF_160 = /* @__PURE__ */ new Uint32Array(16); +/** + * Internal RIPEMD-160 legacy hash class. + * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification. + */ +class _RIPEMD160 extends HashMD { + h0 = 0x67452301 | 0; + h1 = 0xefcdab89 | 0; + h2 = 0x98badcfe | 0; + h3 = 0x10325476 | 0; + h4 = 0xc3d2e1f0 | 0; + constructor() { + super(64, 20, 8, true); + } + get() { + const { h0, h1, h2, h3, h4 } = this; + return [h0, h1, h2, h3, h4]; + } + set(h0, h1, h2, h3, h4) { + this.h0 = h0 | 0; + this.h1 = h1 | 0; + this.h2 = h2 | 0; + this.h3 = h3 | 0; + this.h4 = h4 | 0; + } + _cloneInto(to) { + (to ||= new this.constructor()).set(...this.get()); + return this._cloneIntoMeta(to); + } + process(view, offset) { + for (let i = 0; i < 16; i++, offset += 4) + BUF_160[i] = view.getUint32(offset, true); + // prettier-ignore + let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; + // Instead of iterating 0 to 80, we split it into 5 groups + // And use the groups in constants, functions, etc. Much simpler + for (let group = 0; group < 5; group++) { + const rGroup = 4 - group; + const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore + const rl = idxL[group], rr = idxR[group]; // prettier-ignore + const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore + for (let i = 0; i < 16; i++) { + const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; + al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore + } + // 2 loops are 10% faster + for (let i = 0; i < 16; i++) { + const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; + ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore + } + } + // Add the compressed chunk to the current hash value + // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order. + this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); + } + roundClean() { + clean(BUF_160); + } + destroy() { + this.destroyed = true; + clean(this.buffer); + this.set(0, 0, 0, 0, 0); + } } +/** + * RIPEMD-160 - a legacy hash function from 1990s. + * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point + * at the base RIPEMD-160 references. + * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html} + * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf} + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with RIPEMD-160. + * ```ts + * ripemd160(new Uint8Array([97, 98, 99])); + * ``` + */ +const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160()); -// SHA2-256 need to try 2^128 hashes to execute birthday attack. -// BTC network is doing 2^67 hashes/sec as per early 2023. -// Choice: a ? b : c -const Chi = (a, b, c) => (a & b) ^ (~a & c); -// Majority function, true if any two inpust is true -const Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c); -// Round constants: -// first 32 bits of the fractional parts of the cube roots of the first 64 primes 2..311) +/** + * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. + * SHA256 is the fastest hash implementable in JS, even faster than Blake3. + * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and + * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}. + * @module + */ +/** + * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits + * of the cube roots of the first 64 primes (2..311). + */ // prettier-ignore -const SHA256_K = /* @__PURE__ */ new Uint32Array([ +const SHA256_K = /* @__PURE__ */ Uint32Array.from([ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, @@ -1459,19 +2002,24 @@ const SHA256_K = /* @__PURE__ */ new Uint32Array([ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 ]); -// Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): -// prettier-ignore -const IV = /* @__PURE__ */ new Uint32Array([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 -]); -// Temporary buffer, not used to store anything between runs -// Named this way because it matches specification. +/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */ const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -class SHA256 extends SHA2 { - constructor() { - super(64, 32, 8, false); - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. +/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */ +class SHA2_32B extends HashMD { + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + // Numeric initializers matter: starting the fields as `undefined` changes + // V8's field representation and makes sha256 3x slower (measured). + A = 0; + B = 0; + C = 0; + D = 0; + E = 0; + F = 0; + G = 0; + H = 0; + constructor(outputLen, IV) { + super(64, outputLen, 8, false); this.A = IV[0] | 0; this.B = IV[1] | 0; this.C = IV[2] | 0; @@ -1496,6 +2044,10 @@ class SHA256 extends SHA2 { this.G = G | 0; this.H = H | 0; } + _cloneInto(to) { + (to ||= new this.constructor()).set(...this.get()); + return this._cloneIntoMeta(to); + } process(view, offset) { // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array for (let i = 0; i < 16; i++, offset += 4) @@ -1535,22 +2087,27 @@ class SHA256 extends SHA2 { this.set(A, B, C, D, E, F, G, H); } roundClean() { - SHA256_W.fill(0); + clean(SHA256_W); } destroy() { + // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves + // update()/digest() callable on reused instances. + this.destroyed = true; this.set(0, 0, 0, 0, 0, 0, 0, 0); - this.buffer.fill(0); + clean(this.buffer); } } -/** - * SHA2-256 hash function - * @param message - data that would be hashed - */ -const sha256$1 = /* @__PURE__ */ wrapConstructor(() => new SHA256()); - -// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409): +/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */ +class _SHA256 extends SHA2_32B { + constructor() { + super(32, SHA256_IV); + } +} +// SHA2-512 is slower than sha256 in js because u64 operations are slow. +// SHA-384 / SHA-512 round constants from RFC 6234 §5.2: +// 80 full 64-bit words split into high/low halves. // prettier-ignore -const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64$1.split([ +const K512 = /* @__PURE__ */ (() => split([ '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', @@ -1572,32 +2129,53 @@ const [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64$1.split([ '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' ].map(n => BigInt(n))))(); -// Temporary buffer, not used to store anything between runs +const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); +const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); +// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); +// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -class SHA512 extends SHA2 { - constructor() { - super(128, 64, 16, false); - // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers. - // Also looks cleaner and easier to verify with spec. - // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19): - // h -- high 32 bits, l -- low 32 bits - this.Ah = 0x6a09e667 | 0; - this.Al = 0xf3bcc908 | 0; - this.Bh = 0xbb67ae85 | 0; - this.Bl = 0x84caa73b | 0; - this.Ch = 0x3c6ef372 | 0; - this.Cl = 0xfe94f82b | 0; - this.Dh = 0xa54ff53a | 0; - this.Dl = 0x5f1d36f1 | 0; - this.Eh = 0x510e527f | 0; - this.El = 0xade682d1 | 0; - this.Fh = 0x9b05688c | 0; - this.Fl = 0x2b3e6c1f | 0; - this.Gh = 0x1f83d9ab | 0; - this.Gl = 0xfb41bd6b | 0; - this.Hh = 0x5be0cd19 | 0; - this.Hl = 0x137e2179 | 0; +/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */ +class SHA2_64B extends HashMD { + // We cannot use array here since array allows indexing by variable + // which means optimizer/compiler cannot use registers. + // h -- high 32 bits, l -- low 32 bits + // Numeric initializers matter: starting the fields as `undefined` changes + // V8's field representation and slows hashing down (measured on sha256). + Ah = 0; + Al = 0; + Bh = 0; + Bl = 0; + Ch = 0; + Cl = 0; + Dh = 0; + Dl = 0; + Eh = 0; + El = 0; + Fh = 0; + Fl = 0; + Gh = 0; + Gl = 0; + Hh = 0; + Hl = 0; + constructor(outputLen, IV) { + super(128, outputLen, 16, false); + this.Ah = IV[0] | 0; + this.Al = IV[1] | 0; + this.Bh = IV[2] | 0; + this.Bl = IV[3] | 0; + this.Ch = IV[4] | 0; + this.Cl = IV[5] | 0; + this.Dh = IV[6] | 0; + this.Dl = IV[7] | 0; + this.Eh = IV[8] | 0; + this.El = IV[9] | 0; + this.Fh = IV[10] | 0; + this.Fl = IV[11] | 0; + this.Gh = IV[12] | 0; + this.Gl = IV[13] | 0; + this.Hh = IV[14] | 0; + this.Hl = IV[15] | 0; } // prettier-ignore get() { @@ -1623,6 +2201,10 @@ class SHA512 extends SHA2 { this.Hh = Hh | 0; this.Hl = Hl | 0; } + _cloneInto(to) { + (to ||= new this.constructor()).set(...this.get()); + return this._cloneIntoMeta(to); + } process(view, offset) { // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array for (let i = 0; i < 16; i++, offset += 4) { @@ -1633,16 +2215,16 @@ class SHA512 extends SHA2 { // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) const W15h = SHA512_W_H[i - 15] | 0; const W15l = SHA512_W_L[i - 15] | 0; - const s0h = u64$1.rotrSH(W15h, W15l, 1) ^ u64$1.rotrSH(W15h, W15l, 8) ^ u64$1.shrSH(W15h, W15l, 7); - const s0l = u64$1.rotrSL(W15h, W15l, 1) ^ u64$1.rotrSL(W15h, W15l, 8) ^ u64$1.shrSL(W15h, W15l, 7); + const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7); + const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7); // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) const W2h = SHA512_W_H[i - 2] | 0; const W2l = SHA512_W_L[i - 2] | 0; - const s1h = u64$1.rotrSH(W2h, W2l, 19) ^ u64$1.rotrBH(W2h, W2l, 61) ^ u64$1.shrSH(W2h, W2l, 6); - const s1l = u64$1.rotrSL(W2h, W2l, 19) ^ u64$1.rotrBL(W2h, W2l, 61) ^ u64$1.shrSL(W2h, W2l, 6); - // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16]; - const SUMl = u64$1.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = u64$1.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); + const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6); + const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6); + // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16]; + const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); + const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); SHA512_W_H[i] = SUMh | 0; SHA512_W_L[i] = SUMl | 0; } @@ -1650,19 +2232,19 @@ class SHA512 extends SHA2 { // Compression function main loop, 80 rounds for (let i = 0; i < 80; i++) { // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = u64$1.rotrSH(Eh, El, 14) ^ u64$1.rotrSH(Eh, El, 18) ^ u64$1.rotrBH(Eh, El, 41); - const sigma1l = u64$1.rotrSL(Eh, El, 14) ^ u64$1.rotrSL(Eh, El, 18) ^ u64$1.rotrBL(Eh, El, 41); + const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41); + const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41); //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; const CHIh = (Eh & Fh) ^ (~Eh & Gh); const CHIl = (El & Fl) ^ (~El & Gl); // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] // prettier-ignore - const T1ll = u64$1.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = u64$1.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); + const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); + const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); const T1l = T1ll | 0; // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = u64$1.rotrSH(Ah, Al, 28) ^ u64$1.rotrBH(Ah, Al, 34) ^ u64$1.rotrBH(Ah, Al, 39); - const sigma0l = u64$1.rotrSL(Ah, Al, 28) ^ u64$1.rotrBL(Ah, Al, 34) ^ u64$1.rotrBL(Ah, Al, 39); + const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39); + const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39); const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); Hh = Gh | 0; @@ -1671,78 +2253,2488 @@ class SHA512 extends SHA2 { Gl = Fl | 0; Fh = Eh | 0; Fl = El | 0; - ({ h: Eh, l: El } = u64$1.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); + ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); Dh = Ch | 0; Dl = Cl | 0; Ch = Bh | 0; Cl = Bl | 0; Bh = Ah | 0; Bl = Al | 0; - const All = u64$1.add3L(T1l, sigma0l, MAJl); - Ah = u64$1.add3H(All, T1h, sigma0h, MAJh); + const All = add3L(T1l, sigma0l, MAJl); + Ah = add3H(All, T1h, sigma0h, MAJh); Al = All | 0; } // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = u64$1.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = u64$1.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = u64$1.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = u64$1.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = u64$1.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = u64$1.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = u64$1.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = u64$1.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); + ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); + ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); + ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); + ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); + ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); + ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); + ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); + ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); } roundClean() { - SHA512_W_H.fill(0); - SHA512_W_L.fill(0); + clean(SHA512_W_H, SHA512_W_L); } destroy() { - this.buffer.fill(0); + // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves + // update()/digest() callable on reused instances. + this.destroyed = true; + clean(this.buffer); this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } } -const sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA512()); - -/* Browser Crypto Shims */ -function getGlobal() { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; +/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */ +class _SHA512 extends SHA2_64B { + constructor() { + super(64, SHA512_IV); } - throw new Error("unable to locate global object"); } -const anyGlobal = getGlobal(); -anyGlobal.crypto || anyGlobal.msCrypto; -function createHash(algo) { - switch (algo) { - case "sha256": - return sha256$1.create(); - case "sha512": - return sha512.create(); - case "sha3-256": - return sha3_256.create(); - case "sha3-512": - return sha3_512.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); +/** + * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info: + * + * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack. + * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. + * - Each sha256 hash is executing 2^18 bit operations. + * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA2-256. + * ```ts + * sha256(new Uint8Array([97, 98, 99])); + * ``` + */ +const sha256$1 = /* @__PURE__ */ createHasher(() => new _SHA256(), +/* @__PURE__ */ oidNist(0x01)); +/** + * SHA2-512 hash function from RFC 4634. + * @param msg - message bytes to hash + * @param opts - Reserved hash options. + * @returns Digest bytes. + * @example + * Hash a message with SHA2-512. + * ```ts + * sha512(new Uint8Array([97, 98, 99])); + * ``` + */ +const sha512$1 = /* @__PURE__ */ createHasher(() => new _SHA512(), +/* @__PURE__ */ oidNist(0x03)); + +var buffer = {}; + +var base64Js = {}; + +var hasRequiredBase64Js; + +function requireBase64Js () { + if (hasRequiredBase64Js) return base64Js; + hasRequiredBase64Js = 1; + + base64Js.byteLength = byteLength; + base64Js.toByteArray = toByteArray; + base64Js.fromByteArray = fromByteArray; + + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + + // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + + function getLens (b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4); + + return [validLen, placeHoldersLen] + } + + // base64 is 4/3 + up to two characters of the original data + function byteLength (b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen + } + + function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen + } + + function toByteArray (b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + + var curByte = 0; + + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen; + + var i; + for (i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = (tmp >> 16) & 0xFF; + arr[curByte++] = (tmp >> 8) & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4); + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2); + arr[curByte++] = (tmp >> 8) & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr + } + + function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] + } + + function encodeChunk (uint8, start, end) { + var tmp; + var output = []; + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + return output.join('') + } + + function fromByteArray (uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ); + } + + return parts.join('') + } + return base64Js; } -const _sha256 = function (data) { - let v = "0x" + - createHash("sha3-256") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - return v; -}; -let locked256 = false; +var ieee754 = {}; + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + +var hasRequiredIeee754; + +function requireIeee754 () { + if (hasRequiredIeee754) return ieee754; + hasRequiredIeee754 = 1; + ieee754.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = (nBytes * 8) - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? (nBytes - 1) : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + + i += d; + + e = s & ((1 << (-nBits)) - 1); + s >>= (-nBits); + nBits += eLen; + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1); + e >>= (-nBits); + nBits += mLen; + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) + }; + + ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = (nBytes * 8) - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); + var i = isLE ? 0 : (nBytes - 1); + var d = isLE ? 1 : -1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m; + eLen += mLen; + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + }; + return ieee754; +} + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +var hasRequiredBuffer; + +function requireBuffer () { + if (hasRequiredBuffer) return buffer; + hasRequiredBuffer = 1; + (function (exports) { + + const base64 = requireBase64Js(); + const ieee754 = requireIeee754(); + const customInspectSymbol = + (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation + ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + + const K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && + typeof console.error === 'function') { + console.error( + 'This browser lacks typed array (Uint8Array) support which is required by ' + + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' + ); + } + + function typedArraySupport () { + // Can typed array instances can be augmented? + try { + const arr = new Uint8Array(1); + const proto = { foo: function () { return 42 } }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42 + } catch (e) { + return false + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.buffer + } + }); + + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.byteOffset + } + }); + + function createBuffer (length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"') + } + // Return an augmented `Uint8Array` instance + const buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf + } + + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + function Buffer (arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ) + } + return allocUnsafe(arg) + } + return from(arg, encodingOrOffset, length) + } + + Buffer.poolSize = 8192; // not used by this implementation + + function from (value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value) + } + + if (value == null) { + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof SharedArrayBuffer !== 'undefined' && + (isInstance(value, SharedArrayBuffer) || + (value && isInstance(value.buffer, SharedArrayBuffer)))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + const b = fromObject(value); + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length) + }; + + // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number') + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } + } + + function alloc (size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill) + } + return createBuffer(size) + } + + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding) + }; + + function allocUnsafe (size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0) + } + + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size) + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size) + }; + + function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + const length = byteLength(string, encoding) | 0; + let buf = createBuffer(length); + + const actual = buf.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + + return buf + } + + function fromArrayLike (array) { + const length = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length); + for (let i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + return buf + } + + function fromArrayView (arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) + } + return fromArrayLike(arrayView) + } + + function fromArrayBuffer (array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds') + } + + let buf; + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(buf, Buffer.prototype); + + return buf + } + + function fromObject (obj) { + if (Buffer.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + + if (buf.length === 0) { + return buf + } + + obj.copy(buf, 0, 0, len); + return buf + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) + } + return fromArrayLike(obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } + } + + function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 + } + + function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0; + } + return Buffer.alloc(+length) + } + + Buffer.isBuffer = function isBuffer (b) { + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false + }; + + Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) + } + + if (a === b) return 0 + + let x = a.length; + let y = b.length; + + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 + }; + + Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } + }; + + Buffer.concat = function concat (list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + let i; + if (length === undefined) { + length = 0; + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + const buffer = Buffer.allocUnsafe(length); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); + buf.copy(buffer, pos); + } else { + Uint8Array.prototype.set.call( + buffer, + buf, + pos + ); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } else { + buf.copy(buffer, pos); + } + pos += buf.length; + } + return buffer + }; + + function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) + } + + const len = string.length; + const mustMatch = (arguments.length > 2 && arguments[2] === true); + if (!mustMatch && len === 0) return 0 + + // Use a for loop to avoid recursion + let loweredCase = false; + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer.byteLength = byteLength; + + function slowToString (encoding, start, end) { + let loweredCase = false; + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0; + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return '' + } + + // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } + + // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + Buffer.prototype._isBuffer = true; + + function swap (b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16 () { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this + }; + + Buffer.prototype.swap32 = function swap32 () { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this + }; + + Buffer.prototype.swap64 = function swap64 () { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this + }; + + Buffer.prototype.toString = function toString () { + const length = this.length; + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 + }; + + Buffer.prototype.inspect = function inspect () { + let str = ''; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return '' + }; + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) + } + + if (start === undefined) { + start = 0; + } + if (end === undefined) { + end = target ? target.length : 0; + } + if (thisStart === undefined) { + thisStart = 0; + } + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + + if (this === target) return 0 + + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 + }; + + // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1); + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0; + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') + } + + function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break + } + } + if (found) return i + } + } + + return -1 + } + + Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 + }; + + Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) + }; + + function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + + const strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + let i; + for (i = 0; i < length; ++i) { + const parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i + buf[offset + i] = parsed; + } + return i + } + + function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) + } + + function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) + } + + function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) + } + + function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) + } + + Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + const remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8'; + + let loweredCase = false; + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } + }; + + function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } + } + + function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = (firstByte > 0xEF) + ? 4 + : (firstByte > 0xDF) + ? 3 + : (firstByte > 0xBF) + ? 2 + : 1; + + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + break + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + break + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + break + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res) + } + + // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + const MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray (codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + let res = ''; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ); + } + return res + } + + function asciiSlice (buf, start, end) { + let ret = ''; + end = Math.min(buf.length, end); + + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + return ret + } + + function latin1Slice (buf, start, end) { + let ret = ''; + end = Math.min(buf.length, end); + + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret + } + + function hexSlice (buf, start, end) { + const len = buf.length; + + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + + let out = ''; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out + } + + function utf16leSlice (buf, start, end) { + const bytes = buf.slice(start, end); + let res = ''; + // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)); + } + return res + } + + Buffer.prototype.slice = function slice (start, end) { + const len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + + const newBuf = this.subarray(start, end); + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(newBuf, Buffer.prototype); + + return newBuf + }; + + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') + } + + Buffer.prototype.readUintLE = + Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val + }; + + Buffer.prototype.readUintBE = + Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + let val = this[offset + --byteLength]; + let mul = 1; + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val + }; + + Buffer.prototype.readUint8 = + Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset] + }; + + Buffer.prototype.readUint16LE = + Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | (this[offset + 1] << 8) + }; + + Buffer.prototype.readUint16BE = + Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return (this[offset] << 8) | this[offset + 1] + }; + + Buffer.prototype.readUint32LE = + Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) + }; + + Buffer.prototype.readUint32BE = + Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) + }; + + Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const lo = first + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 24; + + const hi = this[++offset] + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + last * 2 ** 24; + + return BigInt(lo) + (BigInt(hi) << BigInt(32)) + }); + + Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const hi = first * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + this[++offset]; + + const lo = this[++offset] * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + last; + + return (BigInt(hi) << BigInt(32)) + BigInt(lo) + }); + + Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + mul *= 0x80; + + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + + return val + }; + + Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + + let i = byteLength; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + mul *= 0x80; + + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + + return val + }; + + Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) + }; + + Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + const val = this[offset] | (this[offset + 1] << 8); + return (val & 0x8000) ? val | 0xFFFF0000 : val + }; + + Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + const val = this[offset + 1] | (this[offset] << 8); + return (val & 0x8000) ? val | 0xFFFF0000 : val + }; + + Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) + }; + + Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) + }; + + Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const val = this[offset + 4] + + this[offset + 5] * 2 ** 8 + + this[offset + 6] * 2 ** 16 + + (last << 24); // Overflow + + return (BigInt(val) << BigInt(32)) + + BigInt(first + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 24) + }); + + Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) { + offset = offset >>> 0; + validateNumber(offset, 'offset'); + const first = this[offset]; + const last = this[offset + 7]; + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8); + } + + const val = (first << 24) + // Overflow + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + this[++offset]; + + return (BigInt(val) << BigInt(32)) + + BigInt(this[++offset] * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + last) + }); + + Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4) + }; + + Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4) + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8) + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8) + }; + + function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') + } + + Buffer.prototype.writeUintLE = + Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + let mul = 1; + let i = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeUintBE = + Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + let i = byteLength - 1; + let mul = 1; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeUint8 = + Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = (value & 0xff); + return offset + 1 + }; + + Buffer.prototype.writeUint16LE = + Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + return offset + 2 + }; + + Buffer.prototype.writeUint16BE = + Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = (value >>> 8); + this[offset + 1] = (value & 0xff); + return offset + 2 + }; + + Buffer.prototype.writeUint32LE = + Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = (value >>> 24); + this[offset + 2] = (value >>> 16); + this[offset + 1] = (value >>> 8); + this[offset] = (value & 0xff); + return offset + 4 + }; + + Buffer.prototype.writeUint32BE = + Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = (value >>> 24); + this[offset + 1] = (value >>> 16); + this[offset + 2] = (value >>> 8); + this[offset + 3] = (value & 0xff); + return offset + 4 + }; + + function wrtBigUInt64LE (buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + + let lo = Number(value & BigInt(0xffffffff)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset + } + + function wrtBigUInt64BE (buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + + let lo = Number(value & BigInt(0xffffffff)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8 + } + + Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) + }); + + Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) + }); + + Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, (8 * byteLength) - 1); + + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 0xFF; + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, (8 * byteLength) - 1); + + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + let i = byteLength - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 0xFF; + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; + } + + return offset + byteLength + }; + + Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128); + if (value < 0) value = 0xff + value + 1; + this[offset] = (value & 0xff); + return offset + 1 + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + return offset + 2 + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); + this[offset] = (value >>> 8); + this[offset + 1] = (value & 0xff); + return offset + 2 + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); + this[offset] = (value & 0xff); + this[offset + 1] = (value >>> 8); + this[offset + 2] = (value >>> 16); + this[offset + 3] = (value >>> 24); + return offset + 4 + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = (value >>> 24); + this[offset + 1] = (value >>> 16); + this[offset + 2] = (value >>> 8); + this[offset + 3] = (value & 0xff); + return offset + 4 + }; + + Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) + }); + + Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) + }); + + function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') + } + + function writeFloat (buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4 + } + + Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) + }; + + function writeDouble (buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8 + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) + }; + + // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + const len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ); + } + + return len + }; + + // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if ((encoding === 'utf8' && code < 128) || + encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + + if (!val) val = 0; + + let i; + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + + '" is invalid for argument "value"') + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this + }; + + // CUSTOM ERRORS + // ============= + + // Simplified versions from Node, changed for Buffer-only usage + const errors = {}; + function E (sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor () { + super(); + + Object.defineProperty(this, 'message', { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + + // Add the error code to the name to include it in the stack trace. + this.name = `${this.name} [${sym}]`; + // Access the stack to generate the error message including the error code + // from the name. + this.stack; // eslint-disable-line no-unused-expressions + // Reset the name to the actual name. + delete this.name; + } + + get code () { + return sym + } + + set code (value) { + Object.defineProperty(this, 'code', { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + + toString () { + return `${this.name} [${sym}]: ${this.message}` + } + }; + } + + E('ERR_BUFFER_OUT_OF_BOUNDS', + function (name) { + if (name) { + return `${name} is outside of buffer bounds` + } + + return 'Attempt to access memory outside buffer bounds' + }, RangeError); + E('ERR_INVALID_ARG_TYPE', + function (name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}` + }, TypeError); + E('ERR_OUT_OF_RANGE', + function (str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === 'bigint') { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += 'n'; + } + msg += ` It must be ${range}. Received ${received}`; + return msg + }, RangeError); + + function addNumericalSeparator (val) { + let res = ''; + let i = val.length; + const start = val[0] === '-' ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}` + } + + // CHECK FUNCTIONS + // =============== + + function checkBounds (buf, offset, byteLength) { + validateNumber(offset, 'offset'); + if (buf[offset] === undefined || buf[offset + byteLength] === undefined) { + boundsError(offset, buf.length - (byteLength + 1)); + } + } + + function checkIntBI (value, min, max, buf, offset, byteLength) { + if (value > max || value < min) { + const n = typeof min === 'bigint' ? 'n' : ''; + let range; + { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + + `${(byteLength + 1) * 8 - 1}${n}`; + } + } + throw new errors.ERR_OUT_OF_RANGE('value', range, value) + } + checkBounds(buf, offset, byteLength); + } + + function validateNumber (value, name) { + if (typeof value !== 'number') { + throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value) + } + } + + function boundsError (value, length, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE('offset', 'an integer', value) + } + + if (length < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS() + } + + throw new errors.ERR_OUT_OF_RANGE('offset', + `>= ${0} and <= ${length}`, + value) + } + + // HELPER FUNCTIONS + // ================ + + const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean (str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, ''); + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '='; + } + return str + } + + function utf8ToBytes (string, units) { + units = units || Infinity; + let codePoint; + const length = string.length; + let leadSurrogate = null; + const bytes = []; + + for (let i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue + } + + // valid lead + leadSurrogate = codePoint; + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ); + } else { + throw new Error('Invalid code point') + } + } + + return bytes + } + + function asciiToBytes (str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + return byteArray + } + + function utf16leToBytes (str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray + } + + function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) + } + + function blitBuffer (src, dst, offset, length) { + let i; + for (i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i]; + } + return i + } + + // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) + } + function numberIsNaN (obj) { + // For IE11 support + return obj !== obj // eslint-disable-line no-self-compare + } + + // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + const hexSliceLookupTable = (function () { + const alphabet = '0123456789abcdef'; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table + })(); + + // Return not function with Error if BigInt not supported + function defineBigIntMethod (fn) { + return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn + } + + function BufferBigIntNotDefined () { + throw new Error('BigInt not supported') + } + } (buffer)); + return buffer; +} + +requireBuffer(); + +/* Browser Crypto Shims */ +function getGlobal() { + if (typeof globalThis !== "undefined") + return globalThis; + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw new Error("unable to locate global object"); +} +const anyGlobal = getGlobal(); +anyGlobal.crypto || anyGlobal.msCrypto; +function createHash(algo) { + switch (algo) { + case "ripemd160": + return ripemd160.create(); + case "sha256": + return sha256$1.create(); + case "sha512": + return sha512$1.create(); + case "sha3-256": + return sha3_256.create(); + case "sha3-512": + return sha3_512.create(); + } + assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); +} + +const _sha256 = (data) => hexlify(createHash("sha3-256").update(data).digest()); +const _sha512 = (data) => hexlify(createHash("sha3-512").update(data).digest()); +let __sha256 = _sha256; +let __sha512 = _sha512; +let locked256 = false, locked512 = false; /** - * Compute the cryptographic SHA2-256 hash of %%data%%. + * Compute the cryptographic SHA3-256 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -1764,15 +4756,7 @@ var SupportedAlgorithm; SupportedAlgorithm["sha512"] = "sha512"; })(SupportedAlgorithm || (SupportedAlgorithm = {})); function sha256(data) { - let createdHash = createHash("sha3-256") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; + return hexlify(__sha256(getBytes(data))); } sha256._ = _sha256; sha256.lock = function () { @@ -1782,9 +4766,39 @@ sha256.register = function (func) { if (locked256) { throw new Error("sha256 is locked"); } + __sha256 = func; }; Object.freeze(sha256); -Object.freeze(sha256); +/** + * Compute the cryptographic SHA3-512 hash of %%data%%. + * + * @_docloc: api/crypto:Hash Functions + * @returns DataHexstring + * + * @example: + * sha512("0x") + * //_result: + * + * sha512("0x1337") + * //_result: + * + * sha512(new Uint8Array([ 0x13, 0x37 ])) + * //_result: + */ +function sha512(data) { + return hexlify(__sha512(getBytes(data))); +} +sha512._ = _sha512; +sha512.lock = function () { + locked512 = true; +}; +sha512.register = function (func) { + if (locked512) { + throw new Error("sha512 is locked"); + } + __sha512 = func; +}; +Object.freeze(sha512); /** * A simple hashing function which operates on UTF-8 strings to diff --git a/dist/wordlists-extra.js.map b/dist/wordlists-extra.js.map index 4bc424516..dd35ccb85 100644 --- a/dist/wordlists-extra.js.map +++ b/dist/wordlists-extra.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlists-extra.js","sources":["../node_modules/@noble/hashes/esm/_assert.js","../node_modules/@noble/hashes/esm/_u64.js","../node_modules/@noble/hashes/esm/utils.js","../node_modules/@noble/hashes/esm/sha3.js","../lib.esm/logger/logger.js","../lib.esm/_version.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/utils/utf8.js","../lib.esm/crypto/keccak.js","../node_modules/@noble/hashes/esm/_sha2.js","../node_modules/@noble/hashes/esm/sha256.js","../node_modules/@noble/hashes/esm/sha512.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/sha3.js","../lib.esm/hash/id.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-cz.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/lang-es.js","../lib.esm/wordlists/lang-fr.js","../lib.esm/wordlists/lang-ja.js","../lib.esm/wordlists/lang-ko.js","../lib.esm/wordlists/lang-it.js","../lib.esm/wordlists/lang-pt.js","../lib.esm/wordlists/lang-zh.js"],"sourcesContent":["function number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`Wrong positive integer: ${n}`);\n}\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`Expected boolean, not ${b}`);\n}\nfunction bytes(b, ...lengths) {\n if (!(b instanceof Uint8Array))\n throw new Error('Expected Uint8Array');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`);\n}\nfunction hash(hash) {\n if (typeof hash !== 'function' || typeof hash.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(hash.outputLen);\n number(hash.blockLen);\n}\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexport { number, bool, bytes, hash, exists, output };\nconst assert = { number, bool, bytes, hash, exists, output };\nexport default assert;\n//# sourceMappingURL=_assert.js.map","const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nconst rotr32L = (h, _l) => h;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { fromBig, split, toBig, shrSH, shrSL, rotrSH, rotrSL, rotrBH, rotrBL, rotr32H, rotr32L, rotlSH, rotlSL, rotlBH, rotlBL, add, add3L, add3H, add4L, add4H, add5H, add5L, };\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexport default u64;\n//# sourceMappingURL=_u64.js.map","/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated, we can just drop the import.\nimport { crypto } from '@noble/hashes/crypto';\nconst u8a = (a) => a instanceof Uint8Array;\n// Cast array to different type\nexport const u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexport const u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n// Cast array to view\nexport const createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n// The rotate right (circular right shift) operation for uint32\nexport const rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\n// big-endian hardware is rare. Just in case someone still decides to run hashes:\n// early-throw an error because we don't support BE yet.\nexport const isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\nif (!isLE)\n throw new Error('Non little-endian hardware is not supported');\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}\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// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nexport const nextTick = async () => { };\n// Returns control to thread each 'tick' ms to avoid blocking\nexport async function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick();\n ts += diff;\n }\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/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nexport function toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n if (!u8a(data))\n throw new Error(`expected Uint8Array, got ${typeof data}`);\n return data;\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}\n// For runtime check if class implements interface\nexport class Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nconst toStr = {}.toString;\nexport function checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexport function wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexport function wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexport function wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nexport function randomBytes(bytesLength = 32) {\n if (crypto && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\n//# sourceMappingURL=utils.js.map","import { bytes, exists, number, output } from './_assert.js';\nimport { rotlBH, rotlBL, rotlSH, rotlSL, split } from './_u64.js';\nimport { Hash, u32, toBytes, wrapConstructor, wrapXOFConstructorWithOpts, } from './utils.js';\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst [SHA3_PI, SHA3_ROTL, _SHA3_IOTA] = [[], [], []];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ split(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nexport function keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexport class Keccak extends Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n number(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n keccak() {\n keccakP(this.state32, this.rounds);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n exists(this);\n const { blockLen, state } = 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 for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n exists(this, false);\n bytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n number(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n output(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst gen = (suffix, blockLen, outputLen) => wrapConstructor(() => new Keccak(blockLen, suffix, outputLen));\nexport const sha3_224 = /* @__PURE__ */ gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexport const sha3_256 = /* @__PURE__ */ gen(0x06, 136, 256 / 8);\nexport const sha3_384 = /* @__PURE__ */ gen(0x06, 104, 384 / 8);\nexport const sha3_512 = /* @__PURE__ */ gen(0x06, 72, 512 / 8);\nexport const keccak_224 = /* @__PURE__ */ gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexport const keccak_256 = /* @__PURE__ */ gen(0x01, 136, 256 / 8);\nexport const keccak_384 = /* @__PURE__ */ gen(0x01, 104, 384 / 8);\nexport const keccak_512 = /* @__PURE__ */ gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexport const shake128 = /* @__PURE__ */ genShake(0x1f, 168, 128 / 8);\nexport const shake256 = /* @__PURE__ */ genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map","/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */\n/**\n * The current version of corebc.\n */\nexport const version = \"6.4.0\";\n//# sourceMappingURL=_version.js.map","import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map","/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return addSlice(new Uint8Array(result));\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return addSlice(new Uint8Array(result));\n }\n if (isBytes(value)) {\n return addSlice(new Uint8Array(value));\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nfunction addSlice(array) {\n // @ts-ignore\n if (array.slice) {\n return array;\n }\n array.slice = function () {\n const args = Array.prototype.slice.call(arguments);\n return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));\n };\n return array;\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map","/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.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","import { SHA2 } from './_sha2.js';\nimport u64 from './_u64.js';\nimport { wrapConstructor } from './utils.js';\n// Round contants (first 32 bits of the fractional parts of the cube roots of the first 80 primes 2..409):\n// prettier-ignore\nconst [SHA512_Kh, SHA512_Kl] = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\n// Temporary buffer, not used to store anything between runs\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\nexport class SHA512 extends SHA2 {\n constructor() {\n super(128, 64, 16, false);\n // We cannot use array here since array allows indexing by variable which means optimizer/compiler cannot use registers.\n // Also looks cleaner and easier to verify with spec.\n // Initial state (first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19):\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x6a09e667 | 0;\n this.Al = 0xf3bcc908 | 0;\n this.Bh = 0xbb67ae85 | 0;\n this.Bl = 0x84caa73b | 0;\n this.Ch = 0x3c6ef372 | 0;\n this.Cl = 0xfe94f82b | 0;\n this.Dh = 0xa54ff53a | 0;\n this.Dl = 0x5f1d36f1 | 0;\n this.Eh = 0x510e527f | 0;\n this.El = 0xade682d1 | 0;\n this.Fh = 0x9b05688c | 0;\n this.Fl = 0x2b3e6c1f | 0;\n this.Gh = 0x1f83d9ab | 0;\n this.Gl = 0xfb41bd6b | 0;\n this.Hh = 0x5be0cd19 | 0;\n this.Hl = 0x137e2179 | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA256_W[i] = s0 + s1 + SHA256_W[i - 7] + SHA256_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n SHA512_W_H.fill(0);\n SHA512_W_L.fill(0);\n }\n destroy() {\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\nclass SHA512_224 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x8c3d37c8 | 0;\n this.Al = 0x19544da2 | 0;\n this.Bh = 0x73e19966 | 0;\n this.Bl = 0x89dcd4d6 | 0;\n this.Ch = 0x1dfab7ae | 0;\n this.Cl = 0x32ff9c82 | 0;\n this.Dh = 0x679dd514 | 0;\n this.Dl = 0x582f9fcf | 0;\n this.Eh = 0x0f6d2b69 | 0;\n this.El = 0x7bd44da8 | 0;\n this.Fh = 0x77e36f73 | 0;\n this.Fl = 0x04c48942 | 0;\n this.Gh = 0x3f9d85a8 | 0;\n this.Gl = 0x6a1d36c8 | 0;\n this.Hh = 0x1112e6ad | 0;\n this.Hl = 0x91d692a1 | 0;\n this.outputLen = 28;\n }\n}\nclass SHA512_256 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0x22312194 | 0;\n this.Al = 0xfc2bf72c | 0;\n this.Bh = 0x9f555fa3 | 0;\n this.Bl = 0xc84c64c2 | 0;\n this.Ch = 0x2393b86b | 0;\n this.Cl = 0x6f53b151 | 0;\n this.Dh = 0x96387719 | 0;\n this.Dl = 0x5940eabd | 0;\n this.Eh = 0x96283ee2 | 0;\n this.El = 0xa88effe3 | 0;\n this.Fh = 0xbe5e1e25 | 0;\n this.Fl = 0x53863992 | 0;\n this.Gh = 0x2b0199fc | 0;\n this.Gl = 0x2c85b8aa | 0;\n this.Hh = 0x0eb72ddc | 0;\n this.Hl = 0x81c52ca2 | 0;\n this.outputLen = 32;\n }\n}\nclass SHA384 extends SHA512 {\n constructor() {\n super();\n // h -- high 32 bits, l -- low 32 bits\n this.Ah = 0xcbbb9d5d | 0;\n this.Al = 0xc1059ed8 | 0;\n this.Bh = 0x629a292a | 0;\n this.Bl = 0x367cd507 | 0;\n this.Ch = 0x9159015a | 0;\n this.Cl = 0x3070dd17 | 0;\n this.Dh = 0x152fecd8 | 0;\n this.Dl = 0xf70e5939 | 0;\n this.Eh = 0x67332667 | 0;\n this.El = 0xffc00b31 | 0;\n this.Fh = 0x8eb44a87 | 0;\n this.Fl = 0x68581511 | 0;\n this.Gh = 0xdb0c2e0d | 0;\n this.Gl = 0x64f98fa7 | 0;\n this.Hh = 0x47b5481d | 0;\n this.Hl = 0xbefa4fa4 | 0;\n this.outputLen = 48;\n }\n}\nexport const sha512 = /* @__PURE__ */ wrapConstructor(() => new SHA512());\nexport const sha512_224 = /* @__PURE__ */ wrapConstructor(() => new SHA512_224());\nexport const sha512_256 = /* @__PURE__ */ wrapConstructor(() => new SHA512_256());\nexport const sha384 = /* @__PURE__ */ wrapConstructor(() => new SHA384());\n//# sourceMappingURL=sha512.js.map","/* Browser Crypto Shims */\nimport { hmac } from \"@noble/hashes/hmac\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2\";\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { sha512 } from \"@noble/hashes/sha512\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = function (data) {\n let v = \"0x\" +\n createHash(\"sha3-256\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n return v;\n};\nconst _sha512 = function (data) {\n let v = \"0x\" +\n createHash(\"sha3-512\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n return v;\n};\n// @ts-ignore\nlet __sha256 = _sha256;\n// @ts-ignore\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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n let createdHash = \"0x\" +\n createHash(\"ripemd160\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n const v = \"0x\" + createdHash;\n if (typeof createdHash !== \"string\") {\n createdHash = hexlify(createdHash);\n return createdHash;\n }\n return v;\n}\nexport function sha256(data) {\n let createdHash = createHash(\"sha3-256\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n const v = \"0x\" + createdHash;\n if (typeof createdHash !== \"string\") {\n createdHash = hexlify(createdHash);\n return createdHash;\n }\n return v;\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return \"0x\" + createHmac(\"sha3-256\", k).update(d).digest(\"hex\");\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return \"0x\" + createHmac(\"sha3-512\", k).update(d).digest(\"hex\");\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 let createdHash = createHash(\"sha3-512\")\n .update(Buffer.from(arrayify(data)))\n .digest(\"hex\");\n const v = \"0x\" + createdHash;\n if (typeof createdHash !== \"string\") {\n createdHash = hexlify(createdHash);\n return createdHash;\n }\n return v;\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha256);\n//# sourceMappingURL=sha3.js.map","import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#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B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk\";\nconst checksum = \"0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a\";\nlet wordlist = null;\n/**\n * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangCz extends WordlistOwl {\n /**\n * Creates a new instance of the Czech language Wordlist.\n *\n * Using the constructor should be unnecessary, instead use the\n * [[wordlist]] singleton method.\n *\n * @_ignore:\n */\n constructor() {\n super(\"cz\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangCz``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangCz();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-cz.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { WordlistOwlA } from \"./wordlist-owla.js\";\nconst words = \"0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>Is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length <= 9; length++) {\n const d = data[length - 3];\n for (let offset = 0; offset < d.length; offset += length) {\n const word = [];\n for (let i = 0; i < length; i++) {\n const k = mapping.indexOf(d[offset + i]);\n word.push(227);\n word.push(k & 0x40 ? 130 : 129);\n word.push((k & 0x3f) + 128);\n }\n wordlist.push(toString(word));\n }\n }\n wordlist.sort(sortJapanese);\n // For some reason kyoku and kiyoku are flipped in node (!!).\n // The order SHOULD be:\n // - kyoku\n // - kiyoku\n // This should ignore \"if\", but that doesn't work here??\n /* c8 ignore start */\n if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {\n const tmp = wordlist[442];\n wordlist[442] = wordlist[443];\n wordlist[443] = tmp;\n }\n /* c8 ignore stop */\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600\") {\n throw new Error(\"BIP39 Wordlist for ja (Japanese) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangJa extends Wordlist {\n /**\n * Creates a new instance of the Japanese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langJa]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ja\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n split(phrase) {\n //logger.assertNormalize();\n return phrase.split(/(?:\\u3000| )+/g);\n }\n join(words) {\n return words.join(\"\\u3000\");\n }\n /**\n * Returns a singleton instance of a ``LangJa``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangJa();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ja.js.map","import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n \"OYAa\",\n \"ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrGgAlrOXAlvKnAlvMTAl3AbAl3MnAnATrAnAcrAnCZ3AnCl8AnDg8AnFboAnFl3AnHX4AnHbrAnHgrAnIl3AnJgvAnLXoAnLX4AnLbrAnLgrAnLhrAnMXoAnMgrAnOn3AnSbrAnSeoAnvLnAn3OnCTGgvCTSlvCTvAUCTvKnCTvNTCT3CZCT3GUCT3MTCT8HnCUCZrCULf8CULnvCU3HnCU3JUCY6NUCbDb8CbFZo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TFg6HT3STJgoMn4STrFTJTrSTrLZFl3ST4FnMXoSUrDlHUoScvHTvSnSfLkvMXo\",\n \"AUoAcrMXoAZ8HboAg8AbOg6ATFgAg8AloMXoAl3AT8JTrAl8MX8MXoCT3SToJU8Cl8Db8MXoDT8HgrATrDboOT8MXoGTOTrATMnGT8LhrAZ8GnvFnGnQXHToGgvAcrHTvAXvLl3HbrAZoMXoHgBlFXLg3HgMnFXrSnHgrSb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg\",\n \"HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb\",\n \"AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl\",\n];\nconst codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*\";\nfunction getHangul(code) {\n if (code >= 40) {\n code = code + 168 - 40;\n }\n else if (code >= 19) {\n code = code + 97 - 19;\n }\n return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128]));\n}\nlet _wordlist = null;\nfunction loadWords() {\n if (_wordlist != null) {\n return _wordlist;\n }\n const wordlist = [];\n data.forEach((data, length) => {\n length += 4;\n for (let i = 0; i < data.length; i += length) {\n let word = \"\";\n for (let j = 0; j < length; j++) {\n word += getHangul(codes.indexOf(data[i + j]));\n }\n wordlist.push(word);\n }\n });\n wordlist.sort();\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a\") {\n throw new Error(\"BIP39 Wordlist for ko (Korean) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangKo extends Wordlist {\n /**\n * Creates a new instance of the Korean language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langKo]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ko\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n /**\n * Returns a singleton instance of a ``LangKo``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangKo();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ko.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0torea noica!iosorolotaleratelanena%oiadoencotivomai t ca%a0A]Bagl'Bin#E.Is(Oli!Rasi_Rog#0Cade!C[$Cus#E Roba+U 0Ag'Deb{DomeEgu#Eri!IpeOtt&Ul&1Fabi,Fe|Fis(F-n Oris`O(R~$0AveEn.E_,Ganc'I!It&OnismoR>*Rume Uzzo4AbardaA Bat)Ber#BoBumeCeCol>E|Ertu-OdePari!Pe^ Pogg'P)@Pun Ri,1Ab~AchideAgos+Ald~Anc'Atu-AzzoBit)Chiv'D{Eni,G[ GiSoTef%eZil*0Ciu|Col EpsiEtt>Fal I$O/Pir#P)Sagg'SeSolu Sur@TaT[u T%eT-|0Av>EismoOm>O$TesaTiv&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il?G< Go!LeL/$MiniNc{!O/Pe-Rgo/Ro*goRu,n S](S'5Cche)Fo*LuPpa\";\nconst checksum = \"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620\";\nlet wordlist = null;\n/**\n * The [[link-bip39-it]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangIt extends WordlistOwl {\n /**\n * Creates a new instance of the Italian language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langIt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"it\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangIt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangIt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-it.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a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D*&Fci&Rd&RedeRtidaSmoSs#S%lTam T-%T* T_noUl^Us 3C~i D& Dest[D@t+D+G^I$r&IxeLeLicplexoRsi<>%nceRucaSc#SquisaS,aTisc 3AdaC#Ed!eGm-$Last+Lh#Lo.M-)Nc`NguimN]No%N.On{oPocaQue%ResRue)Sc S$laTg-$Rje)Tur Ud!eXof}eZ}&3C C~ DaD-$Di#Do,Du$rGm-$G[=Gun=IvaLe$LvagemM<&M-%N?N/rNsu&Nt#P #Rei>*g>+RvoTemb_T|3GiloLhue)Lic}eMetr@Mpat@M~ N&Nc(oNg~ NopseN$ni>-eRiTu#5B(fis)Rp[s>[&Rt'Sp'oS%n$:B`aBle%Bu^C/G `aLh(LoLvezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi=\";\nconst checksum = \"0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac\";\nlet wordlist = null;\n/**\n * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangPt extends WordlistOwl {\n /**\n * Creates a new instance of the Portuguese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langPt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"pt\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangPt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangPt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-pt.js.map","import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = \"}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN?\";\nfunction loadWords(locale) {\n if (_wordlist[locale] != null) {\n return _wordlist[locale];\n }\n const wordlist = [];\n let deltaOffset = 0;\n for (let i = 0; i < 2048; i++) {\n const s = style.indexOf(data[i * 3]);\n const bytes = [\n 228 + (s >> 2),\n 128 + codes.indexOf(data[i * 3 + 1]),\n 128 + codes.indexOf(data[i * 3 + 2]),\n ];\n if (locale === \"zh_tw\") {\n const common = s % 4;\n for (let i = common; i < 3; i++) {\n bytes[i] =\n codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128);\n }\n }\n wordlist.push(toUtf8String(new Uint8Array(bytes)));\n }\n // Verify the computed list matches the official list\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== Checks[locale]) {\n throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`);\n }\n /* c8 ignore stop */\n _wordlist[locale] = wordlist;\n return wordlist;\n}\nconst wordlists = {};\n/**\n * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for\n * [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangZh extends Wordlist {\n /**\n * Creates a new instance of the Chinese language Wordlist for\n * the %%dialect%%, either ``\"cn\"`` or ``\"tw\"`` for simplified\n * or traditional, respectively.\n *\n * This should be unnecessary most of the time as the exported\n * [[langZhCn]] and [[langZhTw]] should suffice.\n *\n * @_ignore:\n */\n constructor(dialect) {\n super(\"zh_\" + dialect);\n }\n getWord(index) {\n const words = loadWords(this.locale);\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords(this.locale).indexOf(word);\n }\n split(phrase) {\n phrase = phrase.replace(/(?:\\u3000| )+/g, \"\");\n return phrase.split(\"\");\n }\n /**\n * Returns a singleton instance of a ``LangZh`` for %%dialect%%,\n * creating it if this is the first time being called.\n *\n * Use the %%dialect%% ``\"cn\"`` or ``\"tw\"`` for simplified or\n * traditional, respectively.\n */\n static wordlist(dialect) {\n if (wordlists[dialect] == null) {\n wordlists[dialect] = new LangZh(dialect);\n }\n return wordlists[dialect];\n }\n}\n//# sourceMappingURL=lang-zh.js.map"],"names":["sha256","u64","words","checksum","wordlist","accents","data","_wordlist","loadWords","codes"],"mappings":";;AAAA,SAAS,MAAM,CAAC,CAAC,EAAE;AACnB,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACzC,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,wBAAwB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAKD,SAAS,KAAK,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE;AAC9B,IAAI,IAAI,EAAE,CAAC,YAAY,UAAU,CAAC;AAClC,QAAQ,MAAM,IAAI,KAAK,C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C,QAAQ,cAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC3G,QAAQ,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;AAC5B,KAAK;AACL,IAAI,YAAY,CAAC,IAAI,EAAE;AACvB,QAAQ,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACpD,KAAK;AACL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,QAAQ,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AACtD,QAAQ,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAChC,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,CAAC,OAAO,EAAE;AAC7B,QAAQ,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE;AACxC,YAAY,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;AACrD,SAAS;AACT,QAAQ,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAClC,KAAK;AACL;;;;","x_google_ignoreList":[0,1,2,3,11,12,13]} \ No newline at end of file +{"version":3,"file":"wordlists-extra.js","sources":["../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/sha3.js","../lib.esm/logger/logger.js","../lib.esm/_version.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/utils/utf8.js","../lib.esm/crypto/keccak.js","../node_modules/@noble/hashes/_md.js","../node_modules/@noble/hashes/legacy.js","../node_modules/@noble/hashes/sha2.js","../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/sha3.js","../lib.esm/hash/id.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-cz.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/lang-es.js","../lib.esm/wordlists/lang-fr.js","../lib.esm/wordlists/lang-ja.js","../lib.esm/wordlists/lang-ko.js","../lib.esm/wordlists/lang-it.js","../lib.esm/wordlists/lang-pt.js","../lib.esm/wordlists/lang-zh.js"],"sourcesContent":["const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();\nconst _32n = /* @__PURE__ */ BigInt(32);\n// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high\n// }` to match little-endian word order rather than the property names.\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array\n// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS\n// bitwise results back to uint32 first, and little-endian callers must swap.\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers\n// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below\n// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes).\nconst fromNumH = (n) => (n / 2 ** 32) | 0;\nconst fromNumL = (n) => n >>> 0;\n// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call\n// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`.\nfunction setU64FromNum(view, byteOffset, n, isLE) {\n const h = fromNumH(n);\n const l = fromNumL(n);\n view.setUint32(byteOffset, isLE ? l : h, isLE);\n view.setUint32(byteOffset + 4, isLE ? h : l, isLE);\n}\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s) => h >>> s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.\nconst rotr32H = (_h, l) => l;\n// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.\nconst rotr32L = (h, _l) => h;\n// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps\n// local copies so V8 inlines them into keccakP.\n// Add two split 64-bit words and return the split `{ h, l }` sum.\n// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out\n// of the low sum and instead use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\n// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\n// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\n// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, fromNumH, fromNumL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, setU64FromNum, shrSH, shrSL, split, toBig };\n","/**\n * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.\n * @param a - value to test\n * @returns `true` when the value is a Uint8Array-compatible view.\n * @example\n * Check whether a value is a Uint8Array-compatible view.\n * ```ts\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n// Shared error-message prefix builder. Only called on throw paths, so assert\n// success paths never pay for the string concatenation.\nconst atitle = (title) => (title ? `\"${title}\" ` : '');\n/**\n * Asserts something is a non-negative integer.\n * @param n - number to validate\n * @param title - label included in thrown errors\n * @returns The validated number.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a non-negative integer option.\n * ```ts\n * anumber(32, 'length');\n * ```\n */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number')\n throw new TypeError(atitle(title) + 'expected number, got ' + typeof n);\n if (!Number.isSafeInteger(n) || n < 0)\n throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n);\n return n;\n}\n/**\n * Asserts something is a boolean.\n * @param value - value to validate\n * @param title - label included in thrown errors\n * @returns The validated boolean.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a boolean option.\n * ```ts\n * abool(true, 'enableXOF');\n * ```\n */\nexport function abool(value, title = '') {\n if (typeof value !== 'boolean')\n throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);\n return value;\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - value to validate\n * @param length - optional exact length constraint\n * @param title - label included in thrown errors\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate that a value is a byte array.\n * ```ts\n * abytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function abytes(value, length, title = '') {\n // Success path first: this runs at the start of every update() / digestInto(), and the\n // common `abytes(data)` form must not pay for length handling it does not use.\n if (isBytes(value) && (length === undefined || value.length === length))\n return value;\n // Error path: recompute freely to build the exact message.\n if (length !== undefined)\n anumber(length, 'length');\n const bytes = isBytes(value);\n const ofLen = length !== undefined ? ` of length ${length}` : '';\n const got = bytes ? `length=${value.length}` : `type=${typeof value}`;\n const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Asserts something is a wrapped hash constructor.\n * @param h - hash constructor to validate\n * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}\n * @throws On invalid hash metadata ranges or values. {@link RangeError}\n * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}\n * @example\n * Validate a callable hash wrapper.\n * ```ts\n * import { ahash } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('expected hash wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1 || h.blockLen < 1)\n throw new Error('hash blockLen / outputLen must be >= 1');\n}\nconst aobject = (value, label) => {\n if (value === null || typeof value !== 'object' || Array.isArray(value))\n throw new TypeError((label === 'object' ? '' : `\"${label}\" `) + 'expected object, got type=' + typeof value);\n};\nconst aopts = (value, label) => {\n aobject(value, label);\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null)\n throw new TypeError(`\"${label}\" expected plain object`);\n // Object.assign() treats an own \"__proto__\" source key as a write to the target's legacy\n // prototype setter. Reject it before merging so inherited option values cannot be injected.\n if (Object.hasOwn(value, '__proto__'))\n throw new TypeError(`\"${label}.__proto__\" is not allowed`);\n};\n/**\n * Asserts a hash instance has not been destroyed or finished.\n * @param instance - hash instance to validate\n * @param checkFinished - whether to reject finalized instances\n * @throws If the hash instance has already been destroyed or finalized. {@link Error}\n * @example\n * Validate that a hash instance is still usable.\n * ```ts\n * import { aexists } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aexists(hash);\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their\n // truthiness is checked - re-validating their type per call was pure hot-path overhead.\n if (instance.destroyed)\n throw new Error('hash was destroyed');\n if (checkFinished && instance.finished)\n throw new Error('digest() was already called');\n}\n/**\n * Asserts output is a sufficiently-sized byte array.\n * @param out - destination buffer\n * @param instance - hash instance providing output length\n * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a caller-provided digest buffer.\n * ```ts\n * import { aoutput } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aoutput(new Uint8Array(hash.outputLen), hash);\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast\n // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call.\n const min = instance.outputLen;\n if (!(out.length >= min)) {\n throw new RangeError('\"output\" expected length >= ' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed array view to Uint32Array.\n * `arr.byteOffset` must already be 4-byte aligned or the platform\n * Uint32Array constructor will throw.\n * @param arr - source typed array\n * @returns Uint32Array view over the same buffer.\n * @example\n * Reinterpret a byte array as 32-bit words.\n * ```ts\n * u32(new Uint8Array(8));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Zeroizes typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros\n * @example\n * Zeroize sensitive buffers in place.\n * ```ts\n * clean(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/**\n * Creates a DataView for byte-level manipulation.\n * @param arr - source typed array\n * @returns DataView over the same buffer region.\n * @example\n * Create a DataView over an existing buffer.\n * ```ts\n * createView(new Uint8Array(4));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Rotate-right operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the right.\n * ```ts\n * rotr(0x12345678, 8);\n * ```\n */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Rotate-left operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the left.\n * ```ts\n * rotl(0x12345678, 8);\n * ```\n */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/**\n * Byte-swap operation for uint32 values.\n * @param word - source word\n * @returns Word with reversed byte order.\n * @example\n * Reverse the byte order of a 32-bit word.\n * ```ts\n * byteSwap(0x11223344);\n * ```\n */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\n/**\n * Byte-swaps every word of a Uint32Array in place.\n * @param arr - array to mutate\n * @returns The same array after mutation; callers pass live state arrays here.\n * @example\n * Reverse the byte order of every word in place.\n * ```ts\n * byteSwap32(new Uint32Array([0x11223344]));\n * ```\n */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n/**\n * Conditionally byte-swaps a Uint32Array on big-endian platforms.\n * @param u - array to normalize for host endianness\n * @returns Original or byte-swapped array depending on platform endianness.\n * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.\n * @example\n * Normalize a word array for host endianness.\n * ```ts\n * swap32IfBE(new Uint32Array([0x11223344]));\n * ```\n */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\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}\n// Strict ASCII nibble parser: non-ASCII hex lookalikes are rejected as undefined.\n// ASCII codes: '0'..'9' = 48..57, 'A'..'F' = 65..70, 'a'..'f' = 97..102.\n// prettier-ignore\nfunction asciiToBase16(ch) {\n return ch >= 48 && ch <= 57 ? ch - 48 // '2' => 50-48\n : ch >= 65 && ch <= 70 ? ch - (65 - 10) // 'B' => 66-(65-10)\n : ch >= 97 && ch <= 102 ? ch - (97 - 10) // 'b' => 98-(97-10)\n : undefined;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi)); // parse first char, multiply it by 16\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); // parse second char\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // example: 'A9' => 10*16 + 9\n }\n return array;\n}\n/**\n * Yields to the host task scheduler so timers, I/O, and rendering can make progress.\n * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback.\n * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so\n * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while\n * still allowing other event-loop work to proceed.\n * @param onReject - optional cleanup invoked only if the host yield fails\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport function nextTick(onReject) {\n const host = globalThis;\n if (typeof host.scheduler?.yield === 'function') {\n const promise = host.scheduler.yield();\n // Keep the original scheduler rejection; this handler exists only for cleanup.\n if (onReject)\n promise.catch(onReject);\n return promise;\n }\n return new Promise((resolve) => host.setTimeout(resolve, 0));\n}\n/**\n * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @param onReject - optional cleanup invoked only if a host yield fails\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb, onReject) {\n anumber(iters, 'iters');\n anumber(tick, 'tick');\n if (typeof cb !== 'function')\n throw new TypeError('callback must be a function');\n // Callback is synchronous by contract; asyncLoop only yields between sync work windows.\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick(onReject);\n // Track only synchronous work time; scheduler delay after yielding is outside our budget.\n ts = Date.now();\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n const encoded = new TextEncoder().encode(str);\n try {\n // Copy into the current realm for Firefox extension contexts. Callers that own the returned\n // buffer can then wipe it independently of TextEncoder's temporary result.\n return new Uint8Array(encoded); // https://bugzil.la/1681809\n }\n finally {\n clean(encoded);\n }\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Validates declared required and optional field types on a plain object.\n * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct\n * one-line guards such as `abytes()`, `abool()`, or `anumber()` instead.\n * @param object - object to validate\n * @param fields - map of required field names to expected types\n * @param optFields - map of optional field names to expected types\n * @param title - label included in thrown errors\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate required and optional option fields.\n * ```ts\n * validateObject({ N: 1024, dkLen: 32 }, { N: 'number' }, { dkLen: 'number' });\n * ```\n */\nexport const validateObject = (object, fields = {}, optFields = {}, title = 'object') => {\n aobject(object, title);\n aobject(fields, 'fields');\n aobject(optFields, 'optFields');\n function checkField(fieldName, expectedType, isOpt) {\n const label = title === 'object' ? `param \"${String(fieldName)}\"` : `\"${title}.${String(fieldName)}\"`;\n // Config fields must be explicit own properties. Optional inherited values are rejected too\n // because callers keep reading the same options object after validation.\n const val = object[fieldName];\n // Runtime objects such as Field instances intentionally satisfy required method slots\n // via their shared prototype.\n if (!Object.hasOwn(object, fieldName) &&\n (isOpt ? val !== undefined : expectedType !== 'function')) {\n throw new TypeError(`${label} is invalid: expected own property`);\n }\n if (isOpt && val === undefined)\n return;\n const current = typeof val;\n if (current !== expectedType || val === null)\n throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);\n }\n const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));\n iter(fields, false);\n iter(optFields, true);\n};\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @param title - label included in thrown override errors\n * @returns Fresh merged option object with a null prototype.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts, title = 'opts') {\n aopts(defaults, 'defaults');\n if (opts !== undefined)\n aopts(opts, title);\n // Callers read optional fields directly, so omitted values must not fall through to ambient\n // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).\n const merged = Object.assign(Object.create(null), defaults, opts);\n return merged;\n}\n/**\n * Creates a callable hash function from a stateful class constructor.\n * @param hashCons - hash constructor or factory\n * @param info - optional metadata such as DER OID\n * @returns Frozen callable hash wrapper with `.create()`.\n * Wrapper construction eagerly calls `hashCons(undefined)` once to read\n * `outputLen` / `blockLen`, so constructor side effects happen at module\n * init time.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Wrap a stateful hash constructor into a callable helper.\n * ```ts\n * import { createHasher } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const wrapped = createHasher(sha256.create, { oid: sha256.oid });\n * wrapped(new Uint8Array([1]));\n * ```\n */\nexport function createHasher(hashCons, info = {}) {\n if (typeof hashCons !== 'function')\n throw new TypeError('\"hashCons\" expected function, got type=' + typeof hashCons);\n info = checkOpts({}, info, 'info');\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.canXOF = tmp.canXOF;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 §10.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.\n * @param suffix - final OID byte for the selected hash.\n * The helper accepts any byte even though only the documented NIST hash\n * suffixes are meaningful downstream.\n * @returns Object containing the DER-encoded OID.\n * @example\n * Build OID metadata for a NIST hash.\n * ```ts\n * oidNist(0x01);\n * ```\n */\nexport const oidNist = (suffix) => ({\n // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.\n // Larger suffix values would need base-128 OID encoding and a different length byte.\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202},\n * {@link https://keccak.team/keccak.html | Website}, and\n * {@link https://crypto.stackexchange.com/q/15727 | the differences between\n * SHA-3 and Keccak}.\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { split } from \"./_u64.js\";\n// prettier-ignore\nimport { abool, abytes, aexists, anumber, aoutput, checkOpts, clean, createHasher, oidNist, swap32IfBE, u32 } from \"./utils.js\";\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\n// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors\n// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`.\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = []; // no pure annotation: var is always used\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\n// `split(..., true)` keeps the local little-endian lane-word layout used by\n// `state32`, so these `H` / `L` tables follow the file's first-word /\n// second-word lane slots rather than `_u64.ts`'s usual high/low naming.\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can\n// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only\n// consumer of left-rotates; other hashes use right-rotates from _u64.\n// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64.\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2.\n// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation.\nconst B = new Uint32Array(5 * 2);\n/**\n * `keccakf1600` internal permutation, additionally allows adjusting the round count.\n * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words\n * in this file's local little-endian lane-word order\n * @param rounds - number of rounds to execute\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If `rounds` is outside the supported `1..24` range. {@link Error}\n * @example\n * Permute a Keccak state with the default 24 rounds.\n * ```ts\n * keccakP(new Uint32Array(50));\n * ```\n */\nexport function keccakP(s, rounds = 24) {\n if (!(s instanceof Uint32Array))\n throw new TypeError('\"s\" expected Uint32Array(50), got type=' + typeof s);\n if (s.length !== 50)\n throw new RangeError('\"s\" expected Uint32Array(50), got length=' + s.length);\n anumber(rounds, 'rounds');\n // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table.\n if (rounds < 1 || rounds > 24)\n throw new Error('\"rounds\" expected integer 1..24');\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n // Same as:\n // for (let x = 0; x < 10; x++) B[x] = s[y + x];\n // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n for (let y = 0; y < 50; y += 10) {\n const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3];\n s[y] ^= ~s[y + 2] & s[y + 4];\n s[y + 1] ^= ~s[y + 3] & s[y + 5];\n s[y + 2] ^= ~s[y + 4] & s[y + 6];\n s[y + 3] ^= ~s[y + 5] & s[y + 7];\n s[y + 4] ^= ~s[y + 6] & s[y + 8];\n s[y + 5] ^= ~s[y + 7] & s[y + 9];\n s[y + 6] ^= ~s[y + 8] & b0;\n s[y + 7] ^= ~s[y + 9] & b1;\n s[y + 8] ^= ~b0 & b2;\n s[y + 9] ^= ~b1 & b3;\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n/**\n * Keccak sponge function.\n * @param blockLen - absorb/squeeze rate in bytes\n * @param suffix - domain separation suffix byte\n * @param outputLen - default digest length in bytes. This base sponge only\n * requires a non-negative integer; wrappers that need positive output\n * lengths must enforce that themselves.\n * @param enableXOF - whether XOF output is allowed\n * @param rounds - number of Keccak-f rounds\n * @example\n * Build a sponge state, absorb bytes, then finalize a digest.\n * ```ts\n * const hash = new Keccak(136, 0x06, 32);\n * hash.update(new Uint8Array([1, 2, 3]));\n * hash.digest();\n * ```\n */\nexport class Keccak {\n state;\n pos = 0;\n posOut = 0;\n finished = false;\n state32;\n destroyed = false;\n blockLen;\n suffix;\n outputLen;\n canXOF;\n enableXOF = false;\n rounds;\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n anumber(blockLen, 'blockLen');\n anumber(suffix, 'suffix');\n anumber(rounds, 'rounds');\n abool(enableXOF, 'enableXOF');\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.canXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen, 'outputLen');\n // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state.\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('\"blockLen\" must be 1..199');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone() {\n return this._cloneInto();\n }\n keccak() {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { blockLen, state, state32 } = this;\n const len = data.length;\n // Absorb full blocks with u32 XORs when both sides are 4-byte aligned.\n // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe.\n const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0;\n const blockLen32 = blockLen / 4;\n const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined;\n for (let pos = 0; pos < len;) {\n if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) {\n for (let i = 0, o = pos / 4; i < blockLen32; i++)\n state32[i] ^= data32[o + i];\n pos += blockLen;\n // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override,\n // so it must reflect the fully-absorbed block before the permutation fires.\n this.pos = blockLen;\n this.keccak();\n continue;\n }\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1.\n // These byte values already include the first padding bit, while the\n // final `0x80` below supplies the closing `1` bit in the last rate byte.\n state[pos] ^= suffix;\n // If that combined suffix lands in the last rate byte and already sets\n // bit 7, absorb it first so the final pad10*1 bit can be xored into a\n // fresh block.\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base\n // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/\n // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF.\n if (!this.enableXOF)\n throw new Error('XOF is not enabled');\n return this.writeInto(out);\n }\n xof(bytes) {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n aoutput(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest.\n this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen));\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.outputLen);\n this.digestInto(out);\n return out;\n }\n destroy() {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);\n // Reused destinations can come from a different rate/capacity variant, so clone must rewrite\n // the sponge geometry as well as the state words.\n to.blockLen = blockLen;\n to.state32.set(this.state32);\n // Sponge padding and XOF output are positional, so both offsets are part of the clone state.\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone\n // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie.\n to.canXOF = this.canXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info);\n/**\n * SHA3-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-224.\n * ```ts\n * sha3_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_224 = /* @__PURE__ */ genKeccak(0x06, 144, 28, \n/* @__PURE__ */ oidNist(0x07));\n/**\n * SHA3-256 hash function. Different from keccak-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-256.\n * ```ts\n * sha3_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, \n/* @__PURE__ */ oidNist(0x08));\n/**\n * SHA3-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-384.\n * ```ts\n * sha3_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_384 = /* @__PURE__ */ genKeccak(0x06, 104, 48, \n/* @__PURE__ */ oidNist(0x09));\n/**\n * SHA3-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-512.\n * ```ts\n * sha3_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, \n/* @__PURE__ */ oidNist(0x0a));\n/**\n * Keccak-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-224.\n * ```ts\n * keccak_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_224 = /* @__PURE__ */ genKeccak(0x01, 144, 28);\n/**\n * Keccak-256 hash function. Different from SHA3-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-256.\n * ```ts\n * keccak_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32);\n/**\n * Keccak-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-384.\n * ```ts\n * keccak_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_384 = /* @__PURE__ */ genKeccak(0x01, 104, 48);\n/**\n * Keccak-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-512.\n * ```ts\n * keccak_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_512 = /* @__PURE__ */ genKeccak(0x01, 72, 64);\nconst genShake = (suffix, blockLen, outputLen, info = {}) => createHasher((opts = {}) => {\n opts = checkOpts({}, opts);\n return new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true);\n}, info);\n/**\n * SHAKE128 XOF with 128-bit security and a 16-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128.\n * ```ts\n * shake128(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 16, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 256-bit security and a 32-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256.\n * ```ts\n * shake256(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 32, /* @__PURE__ */ oidNist(0x0c));\n/**\n * SHAKE128 XOF with 256-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128 using a 32-byte default output.\n * ```ts\n * shake128_32(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128_32 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 32, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 512-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256 using a 64-byte default output.\n * ```ts\n * shake256_64(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256_64 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 64, /* @__PURE__ */ oidNist(0x0c));\n","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map","/** The current version of corebc; keep in sync with package.json. */\nexport const version = \"0.4.1\";\n//# sourceMappingURL=_version.js.map","import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map","/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return new Uint8Array(result);\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return new Uint8Array(result);\n }\n if (isBytes(value)) {\n return new Uint8Array(value);\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map","/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { setU64FromNum } from \"./_u64.js\";\nimport { abytes, aexists, aoutput, createView } from \"./utils.js\";\n/**\n * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.\n * Returns bits from `b` when `a` is set, otherwise from `c`.\n * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never\n * set the same bit.\n * @param a - selector word\n * @param b - word chosen when selector bit is set\n * @param c - word chosen when selector bit is clear\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit choice primitive.\n * ```ts\n * Chi(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/**\n * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.\n * Returns bits shared by at least two inputs.\n * @param a - first input word\n * @param b - second input word\n * @param c - third input word\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit majority primitive.\n * ```ts\n * Maj(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit\n * strings with partial-byte tails.\n * @param blockLen - internal block size in bytes\n * @param outputLen - digest size in bytes\n * @param padOffset - trailing length field size in bytes\n * @param isLE - whether length and state words are encoded in little-endian\n * @example\n * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.\n * ```ts\n * import { _SHA1 } from '@noble/hashes/legacy.js';\n * const hash = new _SHA1();\n * hash.update(new Uint8Array([97, 98, 99]));\n * hash.digest();\n * ```\n */\nexport class HashMD {\n blockLen;\n outputLen;\n canXOF = false;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n let processed = false;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path only when there is no buffered partial block: `take === blockLen` implies\n // `this.pos === 0`, so we can process full blocks directly from the input view.\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n processed = true;\n continue;\n }\n // When the whole input is buffered in one go (common for short messages), passing `data`\n // directly avoids allocating a subarray view.\n buffer.set(pos === 0 && take === len ? data : 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 processed = true;\n }\n }\n this.length += data.length;\n // Shared schedule buffers only pick up input-derived words inside process(); if everything\n // was buffered without processing, there is nothing to zero.\n if (processed)\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(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, then zero-pad the rest of the block\n buffer[pos++] = 0b10000000;\n buffer.fill(0, pos);\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n buffer.fill(0);\n }\n // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from\n // the padding fill above, and JS will overflow before user input can make that half non-zero.\n // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an\n // integer below 2**53, so the split inside the helper stays exact).\n setU64FromNum(view, blockLen - 8, this.length * 8, isLE);\n this.process(view, 0);\n // The final block above is processed outside update(), so the shared message-schedule\n // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest().\n this.roundClean();\n // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.\n const oview = out === buffer ? view : createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n const outLen = len / 4;\n const state = this.get();\n // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state.\n if (len % 4 || outLen > state.length)\n throw new Error('invalid outputLen');\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 // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return\n // fresh bytes to the caller.\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneIntoMeta(to) {\n const { buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and\n // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it.\n if (pos)\n to.buffer.set(buffer); // Avoid a hot modulo guard.\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the\n * square roots of the first eight prime numbers. Exported as a shared table; callers must treat\n * it as read-only because constructors copy words from it by index. */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state `H(0)` from RFC 6234 §6.1. Exported as a shared table; callers must\n * treat it as read-only because constructors copy words from it by index. */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the ninth\n * through sixteenth prime numbers. Exported as a shared table; callers must treat it as read-only\n * because constructors copy halves from it by index. */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first\n * eight prime numbers. Exported as a shared table; callers must treat it as read-only because\n * constructors copy halves from it by index. */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n","/**\n\nSHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions.\nRFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors,\nnot the base RIPEMD-160 compression spec.\nDon't use them in a new protocol. What \"weak\" means:\n\n- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.\n- No practical pre-image attacks (only theoretical, 2^123.4)\n- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151\n * @module\n */\nimport { Chi, HashMD, Maj } from \"./_md.js\";\nimport { clean, createHasher, rotl } from \"./utils.js\";\n/** Initial SHA-1 state from RFC 3174 §6.1. */\nconst SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\n// Reusable 80-word SHA-1 message schedule buffer.\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA1 legacy hash class. */\nexport class _SHA1 extends HashMD {\n A = SHA1_IV[0] | 0;\n B = SHA1_IV[1] | 0;\n C = SHA1_IV[2] | 0;\n D = SHA1_IV[3] | 0;\n E = SHA1_IV[4] | 0;\n constructor() {\n super(64, 20, 8, false);\n }\n get() {\n const { A, B, C, D, E } = this;\n return [A, B, C, D, E];\n }\n set(A, B, C, D, E) {\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 }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n SHA1_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 80; i++)\n SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n // Compression function main loop, 80 rounds\n let { A, B, C, D, E } = this;\n for (let i = 0; i < 80; i++) {\n let F, K;\n if (i < 20) {\n F = Chi(B, C, D);\n K = 0x5a827999;\n }\n else if (i < 40) {\n F = B ^ C ^ D;\n K = 0x6ed9eba1;\n }\n else if (i < 60) {\n F = Maj(B, C, D);\n K = 0x8f1bbcdc;\n }\n else {\n F = B ^ C ^ D;\n K = 0xca62c1d6;\n }\n const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0;\n E = D;\n D = C;\n C = rotl(B, 30);\n B = A;\n A = T;\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 this.set(A, B, C, D, E);\n }\n roundClean() {\n clean(SHA1_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA1.\n * ```ts\n * sha1(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha1 = /* @__PURE__ */ createHasher(() => new _SHA1());\n/** RFC 1321 `T[i]` uses `floor(2^32 * abs(sin(i)))`; this is the shared `2^32` scale factor. */\nconst p32 = /* @__PURE__ */ Math.pow(2, 32);\n/** RFC 1321 `T[1..64]` table. */\nconst K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));\n/** MD5 initial state from RFC 1321, stored as 4 u32 words. */\nconst MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);\n// Reusable 16-word MD5 message block buffer.\nconst MD5_W = /* @__PURE__ */ new Uint32Array(16);\n// RFC 1321 §3.4 per-round rotate amounts, flattened to 64 entries so the round loop\n// avoids allocating a 4-element array literal every round (measured ~5% of md5).\nconst MD5_SHIFTS = /* @__PURE__ */ (() => {\n const S = [\n [7, 12, 17, 22],\n [5, 9, 14, 20],\n [4, 11, 16, 23],\n [6, 10, 15, 21],\n ];\n return Uint8Array.from({ length: 64 }, (_, i) => S[Math.floor(i / 16)][i % 4]);\n})();\n/** Internal MD5 legacy hash class. */\nexport class _MD5 extends HashMD {\n A = MD5_IV[0] | 0;\n B = MD5_IV[1] | 0;\n C = MD5_IV[2] | 0;\n D = MD5_IV[3] | 0;\n constructor() {\n super(64, 16, 8, true);\n }\n get() {\n const { A, B, C, D } = this;\n return [A, B, C, D];\n }\n set(A, B, C, D) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n MD5_W[i] = view.getUint32(offset, true);\n // Compression function main loop, 64 rounds\n let { A, B, C, D } = this;\n for (let i = 0; i < 64; i++) {\n let F, g;\n if (i < 16) {\n F = Chi(B, C, D);\n g = i;\n }\n else if (i < 32) {\n // RFC 1321 round 2 uses G(B,C,D) = (B & D) | (C & ~D), which is `Chi(D, B, C)`.\n F = Chi(D, B, C);\n g = (5 * i + 1) % 16;\n }\n else if (i < 48) {\n F = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n }\n else {\n F = C ^ (B | ~D);\n g = (7 * i) % 16;\n }\n F = F + A + K[i] + MD5_W[g];\n A = D;\n D = C;\n C = B;\n B = B + rotl(F, MD5_SHIFTS[i]);\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 this.set(A, B, C, D);\n }\n roundClean() {\n clean(MD5_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.\n * MD5 architecture is similar to SHA1, with some differences:\n * - Reduced output length: 16 bytes (128 bit) instead of 20\n * - 64 rounds, instead of 80\n * - Little-endian: could be faster, but will require more code\n * - Non-linear index selection: huge speed-up for unroll\n * - Per round constants: more memory accesses, additional speed-up for unroll\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with MD5.\n * ```ts\n * md5(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const md5 = /* @__PURE__ */ createHasher(() => new _MD5());\n// RIPEMD-160\n// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables.\nconst Rho160 = /* @__PURE__ */ Uint8Array.from([\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n]);\nconst Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();\nconst Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();\n// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds.\nconst idxLR = /* @__PURE__ */ (() => {\n const L = [Id160];\n const R = [Pi160];\n const res = [L, R];\n for (let i = 0; i < 4; i++)\n for (let j of res)\n j.push(j[i].map((k) => Rho160[k]));\n return res;\n})();\nconst idxL = /* @__PURE__ */ (() => idxLR[0])();\nconst idxR = /* @__PURE__ */ (() => idxLR[1])();\n// const [idxL, idxR] = idxLR;\n// Base per-group shift table before the left/right message-order permutations are applied.\nconst shifts160 = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => Uint8Array.from(i));\nconst shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));\nconst shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));\n// Five left-lane additive constants for RIPEMD-160.\nconst Kl160 = /* @__PURE__ */ Uint32Array.from([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\n// Five right-lane additive constants for RIPEMD-160.\nconst Kr160 = /* @__PURE__ */ Uint32Array.from([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range\n// inputs currently fall through to the group-4 branch.\nfunction ripemd_f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n if (group === 1)\n return (x & y) | (~x & z);\n if (group === 2)\n return (x | ~y) ^ z;\n if (group === 3)\n return (x & z) | (y & ~z);\n return x ^ (y | ~z);\n}\n// Reusable 16-word RIPEMD-160 message block buffer.\nconst BUF_160 = /* @__PURE__ */ new Uint32Array(16);\n/**\n * Internal RIPEMD-160 legacy hash class.\n * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification.\n */\nexport class _RIPEMD160 extends HashMD {\n h0 = 0x67452301 | 0;\n h1 = 0xefcdab89 | 0;\n h2 = 0x98badcfe | 0;\n h3 = 0x10325476 | 0;\n h4 = 0xc3d2e1f0 | 0;\n constructor() {\n super(64, 20, 8, true);\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF_160[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order.\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n clean(BUF_160);\n }\n destroy() {\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a legacy hash function from 1990s.\n * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point\n * at the base RIPEMD-160 references.\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html}\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf}\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with RIPEMD-160.\n * ```ts\n * ripemd160(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160());\n","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\n/**\n * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits\n * of the cube roots of the first 64 primes (2..311).\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\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/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */\nclass SHA2_32B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and makes sha256 3x slower (measured).\n A = 0;\n B = 0;\n C = 0;\n D = 0;\n E = 0;\n F = 0;\n G = 0;\n H = 0;\n constructor(outputLen, IV) {\n super(64, outputLen, 8, false);\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 _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\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 clean(SHA256_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */\nexport class _SHA256 extends SHA2_32B {\n constructor() {\n super(32, SHA256_IV);\n }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */\nexport class _SHA224 extends SHA2_32B {\n constructor() {\n super(28, SHA224_IV);\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// SHA-384 / SHA-512 round constants from RFC 6234 §5.2:\n// 80 full 64-bit words split into high/low halves.\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\n// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */\nclass SHA2_64B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and slows hashing down (measured on sha256).\n Ah = 0;\n Al = 0;\n Bh = 0;\n Bl = 0;\n Ch = 0;\n Cl = 0;\n Dh = 0;\n Dl = 0;\n Eh = 0;\n El = 0;\n Fh = 0;\n Fl = 0;\n Gh = 0;\n Gl = 0;\n Hh = 0;\n Hl = 0;\n constructor(outputLen, IV) {\n super(128, outputLen, 16, false);\n this.Ah = IV[0] | 0;\n this.Al = IV[1] | 0;\n this.Bh = IV[2] | 0;\n this.Bl = IV[3] | 0;\n this.Ch = IV[4] | 0;\n this.Cl = IV[5] | 0;\n this.Dh = IV[6] | 0;\n this.Dl = IV[7] | 0;\n this.Eh = IV[8] | 0;\n this.El = IV[9] | 0;\n this.Fh = IV[10] | 0;\n this.Fl = IV[11] | 0;\n this.Gh = IV[12] | 0;\n this.Gl = IV[13] | 0;\n this.Hh = IV[14] | 0;\n this.Hl = IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA512 extends SHA2_64B {\n constructor() {\n super(64, SHA512_IV);\n }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA384 extends SHA2_64B {\n constructor() {\n super(48, SHA384_IV);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.\n * These IV literals are checked against that script rather than a dedicated\n * local RFC section.\n */\n/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_224 extends SHA2_64B {\n constructor() {\n super(28, T224_IV);\n }\n}\n/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_256 extends SHA2_64B {\n constructor() {\n super(32, T256_IV);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-256.\n * ```ts\n * sha256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__PURE__ */ oidNist(0x01));\n/**\n * SHA2-224 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-224.\n * ```ts\n * sha224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__PURE__ */ oidNist(0x04));\n/**\n * SHA2-512 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512.\n * ```ts\n * sha512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__PURE__ */ oidNist(0x03));\n/**\n * SHA2-384 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-384.\n * ```ts\n * sha384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/256.\n * ```ts\n * sha512_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/224.\n * ```ts\n * sha512_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","/* Browser Crypto Shims */\nimport { ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"ripemd160\":\n return ripemd160.create();\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512, \"sha3-256\": sha3_256, \"sha3-512\": sha3_512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = (data) => hexlify(createHash(\"sha3-256\").update(data).digest());\nconst _sha512 = (data) => hexlify(createHash(\"sha3-512\").update(data).digest());\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA3-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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n return hexlify(createHash(\"ripemd160\").update(getBytes(data)).digest());\n}\nexport function sha256(data) {\n return hexlify(__sha256(getBytes(data)));\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(createHmac(\"sha3-256\", k).update(d).digest());\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(createHmac(\"sha3-512\", k).update(d).digest());\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 SHA3-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 return hexlify(__sha512(getBytes(data)));\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha512);\n//# sourceMappingURL=sha3.js.map","import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNzZ(2O&2KolivUv!4It_N(0Dn(Ke)KrPot0Ak~AlIkRkot2Kli$a:L-oRe[T_Tum1E,1B!a}'#Cib_Fic Fla%KlKr{Mokr!PreseRbyS#T-tiv3Kob,zKt|O^P]mSkSp+jV`]Vo/2AhaOuhoUhopis1Es0BroByt-C@t}ut DnesH+dHo^H,JemJn?Kl`Kol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0Ova0DroGe)%J%Lbl*dL{rhL _LmocLry[Nk'Ran^RzeS_#SkrzeSn?SpoduS)Ter.Ver#3B,%}rDeoh,D.D+LaN?S{Tal aZeZ #0Ezd0L`Us0Aj#AkAs>EvoHk(IvN'#Oup!1Uc|Uk0DaDiv(Doz&kD$voJ@skyJ&JskoLantL[L LnoSk'#Zid]Z'&0Ravo1Ab>A%tAhA)Ba}o+kH!StvaTu+0Ad T*p Tup0Ip4Bav Br!}|D!D,Fot H+d!H~Hod H,d Hub Jasn J{Jm=K]p Kon!L-!Maz!Mez Miz{Mys+tNe/!Nik!Nut P`!Pl! P,v Pu$ Raz R'n!Rv!Sl' SokoS)v Su~Syp!Tas Tes!Tr! Vi~Vol!Vrh_Zdob Zn!0AduBud }op DJ{Ji$ K+p!K*p Lep Mez Mot!Mys+tNe/!Nik!Pl! Poj Ps!Raz S)v Su~Taj Temn Tk~Ujm=Val Ve+tVin Vol!Vrt!Zvon 0Av RusuUd|Yt-1A+#ArmaAtn(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk\";\nconst checksum = \"0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a\";\nlet wordlist = null;\n/**\n * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangCz extends WordlistOwl {\n /**\n * Creates a new instance of the Czech language Wordlist.\n *\n * Using the constructor should be unnecessary, instead use the\n * [[wordlist]] singleton method.\n *\n * @_ignore:\n */\n constructor() {\n super(\"cz\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangCz``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangCz();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-cz.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { WordlistOwlA } from \"./wordlist-owla.js\";\nconst words = \"0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZo3Bol]D!D+Ld/eb_LoAmpuAnc]ApaAr]I>Is)IvoOqueOzaUle%Up 0Cl.EgoE=EnEr#F[G +M->NeN%P_sR>Rue]SneTaU{d2Am^AnA+AseAveI,)ImaInica2B_Cc~|i'Ci`CoDigoDoF_G!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fai!F#xeForm Fra(Fu.G=+nGi$Gla.Gul>I, Je,Jou La%fLev L+fMar^Me@MiPor,Prie5Che{M/-Mp!N-Nd(Se|S>Ta%fTorTu#U.U`#U#|U%[Y|?5B/BisCheEl#G){In Is<|S S%^3Th?:B]Bo,B!Co~eFariGesRcas?Rd(eT' Ug!nuUm$U,Uva.V/tV$n 1AlpelAnda#E]atEnarioEpt!HemaI_-Ind O!Ru%nUlp,1An-Cab#Ch Cou C!,Da%fDui!Ig['Jo'Lec%fMa(eMb]M_-M(=Na&'Nsib#N&n-Par Q)n-Re(R.ntR+{Rru!RumRvi-Sa?V*Vra.Xtup#3D =Ec#Eg Ff]G#Gn=L_-LiciumMp#Nc eNist!Ph$RopSmi^Tu 1I 3Ci=C#DiumIg[{LdatLe`Litu@Lub#Mb!M?`Mno]N@N.'N[t&No!Rc>R%rS+T%Rfa-Rica&R?n RpriC%#Il]L_tLism/L$n Mbo'Mi}Ngib#PisQu( Rd RifR%[SI$I^Itai!Iv s3AniumBa(Tic/t0A.I[UelU!0I#Op+:Car?Cc(Gab$dG)Ill/tInc!Is<|Lab#LiSe{Ss=S&3C&'Det&Get=Hicu#InardLo-Nd!diN Ng Ni?{Ntou b) {\n return 1;\n }\n return 0;\n }\n // Load all the words\n for (let length = 3; length <= 9; length++) {\n const d = data[length - 3];\n for (let offset = 0; offset < d.length; offset += length) {\n const word = [];\n for (let i = 0; i < length; i++) {\n const k = mapping.indexOf(d[offset + i]);\n word.push(227);\n word.push(k & 0x40 ? 130 : 129);\n word.push((k & 0x3f) + 128);\n }\n wordlist.push(toString(word));\n }\n }\n wordlist.sort(sortJapanese);\n // For some reason kyoku and kiyoku are flipped in node (!!).\n // The order SHOULD be:\n // - kyoku\n // - kiyoku\n // This should ignore \"if\", but that doesn't work here??\n /* c8 ignore start */\n if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {\n const tmp = wordlist[442];\n wordlist[442] = wordlist[443];\n wordlist[443] = tmp;\n }\n /* c8 ignore stop */\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600\") {\n throw new Error(\"BIP39 Wordlist for ja (Japanese) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangJa extends Wordlist {\n /**\n * Creates a new instance of the Japanese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langJa]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ja\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n split(phrase) {\n //logger.assertNormalize();\n return phrase.split(/(?:\\u3000| )+/g);\n }\n join(words) {\n return words.join(\"\\u3000\");\n }\n /**\n * Returns a singleton instance of a ``LangJa``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangJa();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ja.js.map","import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n \"OYAa\",\n \"ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8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LdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg\",\n \"HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb\",\n \"AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl\",\n];\nconst codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*\";\nfunction getHangul(code) {\n if (code >= 40) {\n code = code + 168 - 40;\n }\n else if (code >= 19) {\n code = code + 97 - 19;\n }\n return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128]));\n}\nlet _wordlist = null;\nfunction loadWords() {\n if (_wordlist != null) {\n return _wordlist;\n }\n const wordlist = [];\n data.forEach((data, length) => {\n length += 4;\n for (let i = 0; i < data.length; i += length) {\n let word = \"\";\n for (let j = 0; j < length; j++) {\n word += getHangul(codes.indexOf(data[i + j]));\n }\n wordlist.push(word);\n }\n });\n wordlist.sort();\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a\") {\n throw new Error(\"BIP39 Wordlist for ko (Korean) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangKo extends Wordlist {\n /**\n * Creates a new instance of the Korean language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langKo]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ko\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n /**\n * Returns a singleton instance of a ``LangKo``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangKo();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ko.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0torea noica!iosorolotaleratelanena%oiadoencotivomai t ca%a0A]Bagl'Bin#E.Is(Oli!Rasi_Rog#0Cade!C[$Cus#E Roba+U 0Ag'Deb{DomeEgu#Eri!IpeOtt&Ul&1Fabi,Fe|Fis(F-n Oris`O(R~$0AveEn.E_,Ganc'I!It&OnismoR>*Rume Uzzo4AbardaA Bat)Ber#BoBumeCeCol>E|Ertu-OdePari!Pe^ Pogg'P)@Pun Ri,1Ab~AchideAgos+Ald~Anc'Atu-AzzoBit)Chiv'D{Eni,G[ GiSoTef%eZil*0Ciu|Col EpsiEtt>Fal I$O/Pir#P)Sagg'SeSolu Sur@TaT[u T%eT-|0Av>EismoOm>O$TesaTiv&Tor$Tr{Tua,0Sil'Str?Tis+To$moTun$0Anz#E!V[i!Vi(Volge!3IoS(Tos+Ttu U,VaVosa3C]FfaLg'LvaNdaNe_,Nig$Nzi=ReRli=Ta3Bi+CiDoR@S]Tan>T^$Zzo*2Acc'AdipoA`An}Avu-E.l/Eve|EzzaIgl?Il/n.Ind&Oc]*O@Onzi=Ul*U$2BboT+di$UffoVet+Vi,2Ass>In~O)2C]Dar@D%eE!n.G$meLl&Lm#Lo!Lpo(L^v#LzaMaMe+M`n@Mo@Mpu.rMuS+n.Ttu-V#2A.!Avat+E#Ede!Emo(Esci+E+Ice I=,IsiIt>OceO=}Os++Uc?,Us}2Ci!Cu*Gi$Ll#Po/R#!R(!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/Olp{Ompar Onfor Opri!Or+Os(Mul#Nfon?Ngo*Nist)NoN.siNu(idePar'S`S ,Tu#2It+Ogatu-Ove$0Arr{Emor#En^ E-l@IlzoOnt&Ott#Uss#0Elli!Erv#O@0BbalzoBr'C]r(C?,Da,Ffi|G$Ld#L[M`NdaNe|Nnife)Pi!Ppe(P-Rge!Rpas(Rri(R(R.gg'R_l#Spi)S+T^,0AdaAl/Arge!A /Av[ Azzo/EcieEdi!EgRappoReg#Ridu*Rozz&Ru|Ucc&UfoUp[@0B[t)C](Do!Gger{GoL+$On&PerboPpor Rgel#R)g#Ssur)Tu-0Ag&EdeseEgl'El&Enu Ez?IluppoIs+Izze-Ol+Uot&:Bac]Bul#Cci&Citur$LeLis`$MpoVer=Vo/+Zza3CaCn>Lefo$Me-r'MpoMu N@Pog-foRagg'RoTan'To*Tuban.Z'Zzo<5Cc&L,r&L Mbo/MoNfoNsil/Paz'Po*g?PpaRbaRn&R)L,t+Lo)(Lut&L_/Mpa+Ng&N{(NoN+gg'Nve-Po!Ra$Rc#R?n.S}3Det+DovaDu Ge+,I]*Lc)Li=Llu LoceN#Ndemm?N RaceRba,Rgog=Rif~RoRru}Rt~,Sc~Ssil*S+,Te-$Tri=Tus 3Andan.B-n.C[daChingoCi=nzaDim&Gil?G< Go!LeL/$MiniNc{!O/Pe-Rgo/Ro*goRu,n S](S'5Cche)Fo*LuPpa\";\nconst checksum = \"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620\";\nlet wordlist = null;\n/**\n * The [[link-bip39-it]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangIt extends WordlistOwl {\n /**\n * Creates a new instance of the Italian language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langIt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"it\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangIt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangIt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-it.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi?PoQue%lRagemRdi&Rne)R}h>p|&R[ioR%joRuj>voSs-oS%laT}e%U_UveVilZ*]2A%+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vezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi=\";\nconst checksum = \"0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac\";\nlet wordlist = null;\n/**\n * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangPt extends WordlistOwl {\n /**\n * Creates a new instance of the Portuguese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langPt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"pt\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangPt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangPt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-pt.js.map","import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = \"}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN?\";\nfunction loadWords(locale) {\n if (_wordlist[locale] != null) {\n return _wordlist[locale];\n }\n const wordlist = [];\n let deltaOffset = 0;\n for (let i = 0; i < 2048; i++) {\n const s = style.indexOf(data[i * 3]);\n const bytes = [\n 228 + (s >> 2),\n 128 + codes.indexOf(data[i * 3 + 1]),\n 128 + codes.indexOf(data[i * 3 + 2]),\n ];\n if (locale === \"zh_tw\") {\n const common = s % 4;\n for (let i = common; i < 3; i++) {\n bytes[i] =\n codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128);\n }\n }\n wordlist.push(toUtf8String(new Uint8Array(bytes)));\n }\n // Verify the computed list matches the official list\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== Checks[locale]) {\n throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`);\n }\n /* c8 ignore stop */\n _wordlist[locale] = wordlist;\n return wordlist;\n}\nconst wordlists = {};\n/**\n * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for\n * [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangZh extends Wordlist {\n /**\n * Creates a new instance of the Chinese language Wordlist for\n * the %%dialect%%, either ``\"cn\"`` or ``\"tw\"`` for simplified\n * or traditional, respectively.\n *\n * This should be unnecessary most of the time as the exported\n * [[langZhCn]] and [[langZhTw]] should suffice.\n *\n * @_ignore:\n */\n constructor(dialect) {\n super(\"zh_\" + dialect);\n }\n getWord(index) {\n const words = loadWords(this.locale);\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords(this.locale).indexOf(word);\n }\n split(phrase) {\n phrase = phrase.replace(/(?:\\u3000| )+/g, \"\");\n return phrase.split(\"\");\n }\n /**\n * Returns a singleton instance of a ``LangZh`` for %%dialect%%,\n * creating it if this is the first time being called.\n *\n * Use the %%dialect%% ``\"cn\"`` or ``\"tw\"`` for simplified or\n * traditional, respectively.\n */\n static wordlist(dialect) {\n if (wordlists[dialect] == null) {\n wordlists[dialect] = new LangZh(dialect);\n }\n return wordlists[dialect];\n }\n}\n//# sourceMappingURL=lang-zh.js.map"],"names":["isBytes","u64.split","u64.rotrSH","u64.shrSH","u64.rotrSL","u64.shrSL","u64.rotrBH","u64.rotrBL","u64.add4L","u64.add4H","u64.add5L","u64.add5H","u64.add","u64.add3L","u64.add3H","sha256","sha512","require$$0","require$$1","words","checksum","wordlist","accents","data","_wordlist","loadWords","codes"],"mappings":"AAAA,MAAM,UAAU,mBAAmB,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG;AAChE,MAAM,IAAI,mBAAmB,MAAM,CAAC,EAAE,CAAC;AACvC;AACA;AACA,SAAS,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,KAAK,EAAE;AAChC,IAAI,IAAI,EAAE;AACV,QAAQ,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,UAAU,CAAC,EAAE;AACjF,IAAI,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE;AACrF;AACA;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE;AAChC,IAAI,MAA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,CAAC,OAAO,CAAC;AACpD,QAAQ;AACR,QAAQ,OAAO,SAAS,CAAC,OAAO,CAAC;AACjC,IAAI;AACJ;;","x_google_ignoreList":[0,1,2,10,11,12,13,14,15]} \ No newline at end of file diff --git a/dist/wordlists-extra.min.js b/dist/wordlists-extra.min.js index 65e2c03f8..030d4e30c 100644 --- a/dist/wordlists-extra.min.js +++ b/dist/wordlists-extra.min.js @@ -1 +1 @@ -import{Buffer}from"buffer";function number(n){if(!Number.isSafeInteger(n)||n<0)throw new Error(`Wrong positive integer: ${n}`)}function bytes(b,...lengths){if(!(b instanceof Uint8Array))throw new Error("Expected Uint8Array");if(lengths.length>0&&!lengths.includes(b.length))throw new Error(`Expected Uint8Array of length ${lengths}, not of length=${b.length}`)}function exists(instance,checkFinished=true){if(instance.destroyed)throw new Error("Hash instance has been destroyed");if(checkFinished&&instance.finished)throw new Error("Hash#digest() has already been called")}function output(out,instance){bytes(out);const min=instance.outputLen;if(out.length>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){let Ah=new Uint32Array(lst.length);let Al=new Uint32Array(lst.length);for(let i=0;iBigInt(h>>>0)<<_32n|BigInt(l>>>0);const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;const rotr32H=(_h,l)=>l;const rotr32L=(h,_l)=>h;const rotlSH=(h,l,s)=>h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;const u64={fromBig:fromBig,split:split,toBig:toBig,shrSH:shrSH,shrSL:shrSL,rotrSH:rotrSH,rotrSL:rotrSL,rotrBH:rotrBH,rotrBL:rotrBL,rotr32H:rotr32H,rotr32L:rotr32L,rotlSH:rotlSH,rotlSL:rotlSL,rotlBH:rotlBH,rotlBL:rotlBL,add:add,add3L:add3L,add3H:add3H,add4L:add4L,add4H:add4H,add5H:add5H,add5L:add5L};var u64$1=u64;const u8a=a=>a instanceof Uint8Array;const u32=arr=>new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4));const createView=arr=>new DataView(arr.buffer,arr.byteOffset,arr.byteLength);const rotr=(word,shift)=>word<<32-shift|word>>>shift;const isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes(str){if(typeof str!=="string")throw new Error(`utf8ToBytes expected string, got ${typeof str}`);return new Uint8Array((new TextEncoder).encode(str))}function toBytes(data){if(typeof data==="string")data=utf8ToBytes(data);if(!u8a(data))throw new Error(`expected Uint8Array, got ${typeof data}`);return data}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(hashCons){const hashC=msg=>hashCons().update(toBytes(msg)).digest();const tmp=hashCons();hashC.outputLen=tmp.outputLen;hashC.blockLen=tmp.blockLen;hashC.create=()=>hashCons();return hashC}const[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]];const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);function keccakP(s,rounds=24){const B=new Uint32Array(5*2);for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){for(let x=0;x<10;x++)B[x]=s[y+x];for(let x=0;x<10;x++)s[y+x]^=~B[(x+2)%10]&B[(x+4)%10]}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}B.fill(0)}class Keccak extends Hash{constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){super();this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.rounds=rounds;this.pos=0;this.posOut=0;this.finished=false;this.destroyed=false;number(outputLen);if(0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200);this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds);this.posOut=0;this.pos=0}update(data){exists(this);const{blockLen,state}=this;data=toBytes(data);const len=data.length;for(let pos=0;pos=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(out)}xof(bytes){number(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){output(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out);this.destroy();return out}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=true;this.state.fill(0)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||(to=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds));to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.destroyed=this.destroyed;return to}}const gen=(suffix,blockLen,outputLen)=>wrapConstructor(()=>new Keccak(blockLen,suffix,outputLen));const sha3_256=gen(6,136,256/8);const sha3_512=gen(6,72,512/8);const keccak_256=gen(1,136,256/8);let _permanentCensorErrors=false;let _censorErrors=false;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels["default"];let _globalLogger=null;function _checkNormalize(){try{const missing=[];["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing.push(form)}});if(missing.length){throw new Error("missing "+missing.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"]="UNPREDICTABLE_ENERGY_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{version="0.0.1";static errors=ErrorCode;static levels=LogLevel;constructor(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}_log(logLevel,args){const level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)}debug(...args){this._log(Logger.levels.DEBUG,args)}info(...args){this._log(Logger.levels.INFO,args)}warn(...args){this._log(Logger.levels.WARNING,args)}makeError(message,code,params){if(_censorErrors){return this.makeError("censored error",code,{})}if(!code){code=Logger.errors.UNKNOWN_ERROR}if(!params){params={}}const messageDetails=[];Object.keys(params).forEach(key=>{const value=params[key];try{if(value instanceof Uint8Array){let hex="";for(let i=0;i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push(`code=${code}`);messageDetails.push(`version=${this.version}`);const reason=message;if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}const error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error}throwError(message,code,params){throw this.makeError(message,code,params)}throwArgumentError(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})}assert(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)}assertArgument(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)}checkNormalize(message){if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}}checkSafeUint53(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}}checkArgumentCount(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}}checkNew(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}checkAbstract(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}static globalLogger(){if(!_globalLogger){_globalLogger=new Logger("logger/0.0.1")}return _globalLogger}static setCensorship(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent}static setLogLevel(logLevel){const level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level}static from(version){return new Logger(version)}}const version="6.4.0";function checkType(value,type,name){const types=type.split("|").map(t=>t.trim());for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"number":return value.toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify(k)}: ${stringify(value[k])}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function makeError(message,code,info){{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify(info)}`)}for(const key in info){const value=info[key];details.push(key+"="+stringify(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function assertNormalize(form){assert(_normalizeForms.indexOf(form)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:form}})}const logger=new Logger("utils/data/0.0.1");function isHexable(value){return!!value.toHexString}function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(let i=0;i=256){return false}}return true}function _getBytes(value,name,copy){if(value instanceof Uint8Array){if(copy){return new Uint8Array(value)}return value}if(typeof value==="string"&&value.match(/^0x([0-9a-f][0-9a-f])*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;iNumber(item));value=new Uint8Array(v)}}if(typeof value==="number"){logger.checkSafeUint53(value,"invalid hexlify value");let hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes(value)){let result="0x";for(let i=0;i>4]+HexCharacters[v&15]}return result}return logger.throwArgumentError("invalid hexlify value","value",value)}function arrayify(value,options){if(!options){options={}}if(typeof value==="number"){logger.checkSafeUint53(value,"invalid arrayify value");const result=[];while(value){result.unshift(value&255);value=parseInt(String(value/256))}if(result.length===0){result.push(0)}return addSlice(new Uint8Array(result))}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){value=value.toHexString()}if(isHexString(value)){let hex=value.substring(2);if(hex.length%2){if(options.hexPad==="left"){hex="0x0"+hex.substring(2)}else if(options.hexPad==="right"){hex+="0"}else{logger.throwArgumentError("hex data is odd-length","value",value)}}const result=[];for(let i=0;i>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){if(form!=null){assertNormalize(form);str=str.normalize(form)}let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}let locked=false;const _keccak256=function(data){return keccak_256(data)};let __keccak256=_keccak256;function keccak256(_data){const data=getBytes(_data,"data");return hexlify(__keccak256(data))}keccak256._=_keccak256;keccak256.lock=function(){locked=true};keccak256.register=function(func){if(locked){throw new TypeError("keccak256 is locked")}__keccak256=func};Object.freeze(keccak256);function setBigUint64(view,byteOffset,value,isLE){if(typeof view.setBigUint64==="function")return view.setBigUint64(byteOffset,value,isLE);const _32n=BigInt(32);const _u32_max=BigInt(4294967295);const wh=Number(value>>_32n&_u32_max);const wl=Number(value&_u32_max);const h=isLE?4:0;const l=isLE?0:4;view.setUint32(byteOffset+h,wh,isLE);view.setUint32(byteOffset+l,wl,isLE)}class SHA2 extends Hash{constructor(blockLen,outputLen,padOffset,isLE){super();this.blockLen=blockLen;this.outputLen=outputLen;this.padOffset=padOffset;this.isLE=isLE;this.finished=false;this.length=0;this.pos=0;this.destroyed=false;this.buffer=new Uint8Array(blockLen);this.view=createView(this.buffer)}update(data){exists(this);const{view,buffer,blockLen}=this;data=toBytes(data);const len=data.length;for(let pos=0;posblockLen-pos){this.process(view,0);pos=0}for(let i=pos;istate.length)throw new Error("_sha2: outputLen bigger than state");for(let i=0;ia&b^~a&c;const Maj=(a,b,c)=>a&b^a&c^b&c;const SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);const IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);const SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,false);this.A=IV[0]|0;this.B=IV[1]|0;this.C=IV[2]|0;this.D=IV[3]|0;this.E=IV[4]|0;this.F=IV[5]|0;this.G=IV[6]|0;this.H=IV[7]|0}get(){const{A,B,C,D,E,F,G,H}=this;return[A,B,C,D,E,F,G,H]}set(A,B,C,D,E,F,G,H){this.A=A|0;this.B=B|0;this.C=C|0;this.D=D|0;this.E=E|0;this.F=F|0;this.G=G|0;this.H=H|0}process(view,offset){for(let i=0;i<16;i++,offset+=4)SHA256_W[i]=view.getUint32(offset,false);for(let i=16;i<64;i++){const W15=SHA256_W[i-15];const W2=SHA256_W[i-2];const s0=rotr(W15,7)^rotr(W15,18)^W15>>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0);this.buffer.fill(0)}}const sha256$1=wrapConstructor(()=>new SHA256);const[SHA512_Kh,SHA512_Kl]=(()=>u64$1.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA512 extends SHA2{constructor(){super(128,64,16,false);this.Ah=1779033703|0;this.Al=4089235720|0;this.Bh=3144134277|0;this.Bl=2227873595|0;this.Ch=1013904242|0;this.Cl=4271175723|0;this.Dh=2773480762|0;this.Dl=1595750129|0;this.Eh=1359893119|0;this.El=2917565137|0;this.Fh=2600822924|0;this.Fl=725511199|0;this.Gh=528734635|0;this.Gl=4215389547|0;this.Hh=1541459225|0;this.Hl=327033209|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=u64$1.rotrSH(W15h,W15l,1)^u64$1.rotrSH(W15h,W15l,8)^u64$1.shrSH(W15h,W15l,7);const s0l=u64$1.rotrSL(W15h,W15l,1)^u64$1.rotrSL(W15h,W15l,8)^u64$1.shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=u64$1.rotrSH(W2h,W2l,19)^u64$1.rotrBH(W2h,W2l,61)^u64$1.shrSH(W2h,W2l,6);const s1l=u64$1.rotrSL(W2h,W2l,19)^u64$1.rotrBL(W2h,W2l,61)^u64$1.shrSL(W2h,W2l,6);const SUMl=u64$1.add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=u64$1.add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=u64$1.rotrSH(Eh,El,14)^u64$1.rotrSH(Eh,El,18)^u64$1.rotrBH(Eh,El,41);const sigma1l=u64$1.rotrSL(Eh,El,14)^u64$1.rotrSL(Eh,El,18)^u64$1.rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=u64$1.add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=u64$1.add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=u64$1.rotrSH(Ah,Al,28)^u64$1.rotrBH(Ah,Al,34)^u64$1.rotrBH(Ah,Al,39);const sigma0l=u64$1.rotrSL(Ah,Al,28)^u64$1.rotrBL(Ah,Al,34)^u64$1.rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=u64$1.add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=u64$1.add3L(T1l,sigma0l,MAJl);Ah=u64$1.add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=u64$1.add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=u64$1.add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=u64$1.add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=u64$1.add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=u64$1.add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=u64$1.add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=u64$1.add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=u64$1.add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){SHA512_W_H.fill(0);SHA512_W_L.fill(0)}destroy(){this.buffer.fill(0);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const sha512=wrapConstructor(()=>new SHA512);function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal();anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"sha256":return sha256$1.create();case"sha512":return sha512.create();case"sha3-256":return sha3_256.create();case"sha3-512":return sha3_512.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}const _sha256=function(data){let v="0x"+createHash("sha3-256").update(Buffer.from(arrayify(data))).digest("hex");return v};let locked256=false;var SupportedAlgorithm;(function(SupportedAlgorithm){SupportedAlgorithm["sha256"]="sha256";SupportedAlgorithm["sha512"]="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));function sha256(data){let createdHash=createHash("sha3-256").update(Buffer.from(arrayify(data))).digest("hex");const v="0x"+createdHash;if(typeof createdHash!=="string"){createdHash=hexlify(createdHash);return createdHash}return v}sha256._=_sha256;sha256.lock=function(){locked256=true};sha256.register=function(func){if(locked256){throw new Error("sha256 is locked")}};Object.freeze(sha256);Object.freeze(sha256);function id(value,useKeccak){if(useKeccak){return keccak256(toUtf8Bytes(value))}return sha256(toUtf8Bytes(value))}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}static check(wordlist){const words=[];for(let i=0;i<2048;i++){const word=wordlist.getWord(i);if(i!==wordlist.getWordIndex(word)){return"0x"}words.push(word)}return id(words.join("\n")+"\n")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n",true);if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const words$3="0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%n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m,%RneoRoRpe&R_RS!Xi>2AbajoAc#rA!Afi>AgoAjeAmoAnceA#AumaAz EbolEguaEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv!b){return 1}return 0}for(let length=3;length<=9;length++){const d=data$2[length-3];for(let offset=0;offset=0&&index=40){code=code+168-40}else if(code>=19){code=code+97-19}return toUtf8String(new Uint8Array([225,(code>>6)+132,(code&63)+128]))}let _wordlist$1=null;function loadWords$1(){if(_wordlist$1!=null){return _wordlist$1}const wordlist=[];data$1.forEach((data,length)=>{length+=4;for(let i=0;i=0&&index>2),128+codes.indexOf(data[i*3+1]),128+codes.indexOf(data[i*3+2])];if(locale==="zh_tw"){const common=s%4;for(let i=common;i<3;i++){bytes[i]=codes.indexOf(deltaData[deltaOffset++])+(i==0?228:128)}}wordlist.push(toUtf8String(new Uint8Array(bytes)))}const checksum=id(wordlist.join("\n")+"\n");if(checksum!==Checks[locale]){throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`)}_wordlist[locale]=wordlist;return wordlist}const wordlists={};class LangZh extends Wordlist{constructor(dialect){super("zh_"+dialect)}getWord(index){const words=loadWords(this.locale);assertArgument(index>=0&&indexBigInt(2**32-1))();const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){const len=lst.length;let Ah=new Uint32Array(len);let Al=new Uint32Array(len);for(let i=0;in/2**32|0;const fromNumL=n=>n>>>0;function setU64FromNum(view,byteOffset,n,isLE){const h=fromNumH(n);const l=fromNumL(n);view.setUint32(byteOffset,isLE?l:h,isLE);view.setUint32(byteOffset+4,isLE?h:l,isLE)}const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;function isBytes$1(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in a&&a.BYTES_PER_ELEMENT===1}const atitle=title=>title?`"${title}" `:"";function anumber(n,title=""){if(typeof n!=="number")throw new TypeError(atitle(title)+"expected number, got "+typeof n);if(!Number.isSafeInteger(n)||n<0)throw new RangeError(atitle(title)+"expected integer >= 0, got "+n);return n}function abool(value,title=""){if(typeof value!=="boolean")throw new TypeError(atitle(title)+"expected boolean, got type="+typeof value);return value}function abytes(value,length,title=""){if(isBytes$1(value)&&length===undefined)return value;const bytes=isBytes$1(value);const ofLen="";const got=bytes?`length=${value.length}`:`type=${typeof value}`;const message=atitle(title)+"expected Uint8Array"+ofLen+", got "+got;if(!bytes)throw new TypeError(message);throw new RangeError(message)}const aobject=(value,label)=>{if(value===null||typeof value!=="object"||Array.isArray(value))throw new TypeError((label==="object"?"":`"${label}" `)+"expected object, got type="+typeof value)};const aopts=(value,label)=>{aobject(value,label);const proto=Object.getPrototypeOf(value);if(proto!==Object.prototype&&proto!==null)throw new TypeError(`"${label}" expected plain object`);if(Object.hasOwn(value,"__proto__"))throw new TypeError(`"${label}.__proto__" is not allowed`)};function aexists(instance,checkFinished=true){if(instance.destroyed)throw new Error("hash was destroyed");if(checkFinished&&instance.finished)throw new Error("digest() was already called")}function aoutput(out,instance){abytes(out,undefined,"output");const min=instance.outputLen;if(!(out.length>=min)){throw new RangeError('"output" expected length >= '+min)}}function u32(arr){return new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4))}function clean(...arrays){for(let i=0;i>>shift}function rotl(word,shift){return word<>>32-shift>>>0}const isLE=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function byteSwap(word){return word<<24&4278190080|word<<8&16711680|word>>>8&65280|word>>>24&255}function byteSwap32(arr){for(let i=0;iu:byteSwap32;function checkOpts(defaults,opts,title="opts"){aopts(defaults,"defaults");if(opts!==undefined)aopts(opts,title);const merged=Object.assign(Object.create(null),defaults,opts);return merged}function createHasher(hashCons,info={}){if(typeof hashCons!=="function")throw new TypeError('"hashCons" expected function, got type='+typeof hashCons);info=checkOpts({},info,"info");const hashC=(msg,opts)=>hashCons(opts).update(msg).digest();const tmp=hashCons(undefined);hashC.outputLen=tmp.outputLen;hashC.blockLen=tmp.blockLen;hashC.canXOF=tmp.canXOF;hashC.create=opts=>hashCons(opts);Object.assign(hashC,info);return Object.freeze(hashC)}const oidNist=suffix=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,suffix])});const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);const SHA3_PI=[];const SHA3_ROTL=[];const _SHA3_IOTA=[];for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;const rotlH=(h,l,s)=>s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);const B=new Uint32Array(5*2);function keccakP(s,rounds=24){if(!(s instanceof Uint32Array))throw new TypeError('"s" expected Uint32Array(50), got type='+typeof s);if(s.length!==50)throw new RangeError('"s" expected Uint32Array(50), got length='+s.length);anumber(rounds,"rounds");if(rounds<1||rounds>24)throw new Error('"rounds" expected integer 1..24');for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){const b0=s[y],b1=s[y+1],b2=s[y+2],b3=s[y+3];s[y]^=~s[y+2]&s[y+4];s[y+1]^=~s[y+3]&s[y+5];s[y+2]^=~s[y+4]&s[y+6];s[y+3]^=~s[y+5]&s[y+7];s[y+4]^=~s[y+6]&s[y+8];s[y+5]^=~s[y+7]&s[y+9];s[y+6]^=~s[y+8]&b0;s[y+7]^=~s[y+9]&b1;s[y+8]^=~b0&b2;s[y+9]^=~b1&b3}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}clean(B)}class Keccak{state;pos=0;posOut=0;finished=false;state32;destroyed=false;blockLen;suffix;outputLen;canXOF;enableXOF=false;rounds;constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){anumber(blockLen,"blockLen");anumber(suffix,"suffix");anumber(rounds,"rounds");abool(enableXOF,"enableXOF");this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.canXOF=enableXOF;this.rounds=rounds;anumber(outputLen,"outputLen");if(!(0=blockLen?u32(data):undefined;for(let pos=0;pos=blockLen){for(let i=0,o=pos/4;i=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not enabled");return this.writeInto(out)}xof(bytes){anumber(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){aoutput(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out.length===this.outputLen?out:out.subarray(0,this.outputLen));this.destroy()}digest(){const out=new Uint8Array(this.outputLen);this.digestInto(out);return out}destroy(){this.destroyed=true;clean(this.state)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds);to.blockLen=blockLen;to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.canXOF=this.canXOF;to.destroyed=this.destroyed;return to}}const genKeccak=(suffix,blockLen,outputLen,info={})=>createHasher(()=>new Keccak(blockLen,suffix,outputLen),info);const sha3_256=genKeccak(6,136,32,oidNist(8));const sha3_512=genKeccak(6,72,64,oidNist(10));const keccak_256=genKeccak(1,136,32);let _permanentCensorErrors=false;let _censorErrors=false;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels["default"];let _globalLogger=null;function _checkNormalize(){try{const missing=[];["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing.push(form)}});if(missing.length){throw new Error("missing "+missing.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"]="UNPREDICTABLE_ENERGY_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{version="0.0.1";static errors=ErrorCode;static levels=LogLevel;constructor(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}_log(logLevel,args){const level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)}debug(...args){this._log(Logger.levels.DEBUG,args)}info(...args){this._log(Logger.levels.INFO,args)}warn(...args){this._log(Logger.levels.WARNING,args)}makeError(message,code,params){if(_censorErrors){return this.makeError("censored error",code,{})}if(!code){code=Logger.errors.UNKNOWN_ERROR}if(!params){params={}}const messageDetails=[];Object.keys(params).forEach(key=>{const value=params[key];try{if(value instanceof Uint8Array){let hex="";for(let i=0;i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push(`code=${code}`);messageDetails.push(`version=${this.version}`);const reason=message;if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}const error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error}throwError(message,code,params){throw this.makeError(message,code,params)}throwArgumentError(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})}assert(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)}assertArgument(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)}checkNormalize(message){if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}}checkSafeUint53(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}}checkArgumentCount(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}}checkNew(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}checkAbstract(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}static globalLogger(){if(!_globalLogger){_globalLogger=new Logger("logger/0.0.1")}return _globalLogger}static setCensorship(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent}static setLogLevel(logLevel){const level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level}static from(version){return new Logger(version)}}const version="0.4.1";function defineProperties(target,values,types){for(let key in values){let value=values[key];Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function stringify(value){if(value==null){return"null"}if(Array.isArray(value)){return"[ "+value.map(stringify).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"number":return value.toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify(k)}: ${stringify(value[k])}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function makeError(message,code,info){{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify(info)}`)}for(const key in info){const value=info[key];details.push(key+"="+stringify(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);const logger=new Logger("utils/data/0.0.1");function isHexable(value){return!!value.toHexString}function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(let i=0;i=256){return false}}return true}function _getBytes(value,name,copy){if(value instanceof Uint8Array){return value}if(typeof value==="string"&&value.match(/^0x([0-9a-f][0-9a-f])*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;iNumber(item));value=new Uint8Array(v)}}if(typeof value==="number"){logger.checkSafeUint53(value,"invalid hexlify value");let hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes(value)){let result="0x";for(let i=0;i>4]+HexCharacters[v&15]}return result}return logger.throwArgumentError("invalid hexlify value","value",value)}function errorFunc(reason,offset,bytes,output,badCodepoint){assertArgument(false,`invalid codepoint at offset ${offset}; ${reason}`,"bytes",bytes)}function ignoreFunc(reason,offset,bytes,output,badCodepoint){if(reason==="BAD_PREFIX"||reason==="UNEXPECTED_CONTINUE"){let i=0;for(let o=offset+1;o>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}let locked=false;const _keccak256=function(data){return keccak_256(data)};let __keccak256=_keccak256;function keccak256(_data){const data=getBytes(_data,"data");return hexlify(__keccak256(data))}keccak256._=_keccak256;keccak256.lock=function(){locked=true};keccak256.register=function(func){if(locked){throw new TypeError("keccak256 is locked")}__keccak256=func};Object.freeze(keccak256);function Chi(a,b,c){return a&b^~a&c}function Maj(a,b,c){return a&b^a&c^b&c}class HashMD{blockLen;outputLen;canXOF=false;padOffset;isLE;buffer;view;finished=false;length=0;pos=0;destroyed=false;constructor(blockLen,outputLen,padOffset,isLE){this.blockLen=blockLen;this.outputLen=outputLen;this.padOffset=padOffset;this.isLE=isLE;this.buffer=new Uint8Array(blockLen);this.view=createView(this.buffer)}update(data){aexists(this);abytes(data);const{view,buffer,blockLen}=this;const len=data.length;let processed=false;for(let pos=0;posblockLen-pos){this.process(view,0);buffer.fill(0)}setU64FromNum(view,blockLen-8,this.length*8,isLE);this.process(view,0);this.roundClean();const oview=out===buffer?view:createView(out);const len=this.outputLen;const outLen=len/4;const state=this.get();if(len%4||outLen>state.length)throw new Error("invalid outputLen");for(let i=0;iUint8Array.from(new Array(16).fill(0).map((_,i)=>i)))();const Pi160=(()=>Id160.map(i=>(9*i+5)%16))();const idxLR=(()=>{const L=[Id160];const R=[Pi160];const res=[L,R];for(let i=0;i<4;i++)for(let j of res)j.push(j[i].map(k=>Rho160[k]));return res})();const idxL=(()=>idxLR[0])();const idxR=(()=>idxLR[1])();const shifts160=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(i=>Uint8Array.from(i));const shiftsL160=idxL.map((idx,i)=>idx.map(j=>shifts160[i][j]));const shiftsR160=idxR.map((idx,i)=>idx.map(j=>shifts160[i][j]));const Kl160=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]);const Kr160=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function ripemd_f(group,x,y,z){if(group===0)return x^y^z;if(group===1)return x&y|~x&z;if(group===2)return(x|~y)^z;if(group===3)return x&z|y&~z;return x^(y|~z)}const BUF_160=new Uint32Array(16);class _RIPEMD160 extends HashMD{h0=1732584193|0;h1=4023233417|0;h2=2562383102|0;h3=271733878|0;h4=3285377520|0;constructor(){super(64,20,8,true)}get(){const{h0,h1,h2,h3,h4}=this;return[h0,h1,h2,h3,h4]}set(h0,h1,h2,h3,h4){this.h0=h0|0;this.h1=h1|0;this.h2=h2|0;this.h3=h3|0;this.h4=h4|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4)BUF_160[i]=view.getUint32(offset,true);let al=this.h0|0,ar=al,bl=this.h1|0,br=bl,cl=this.h2|0,cr=cl,dl=this.h3|0,dr=dl,el=this.h4|0,er=el;for(let group=0;group<5;group++){const rGroup=4-group;const hbl=Kl160[group],hbr=Kr160[group];const rl=idxL[group],rr=idxR[group];const sl=shiftsL160[group],sr=shiftsR160[group];for(let i=0;i<16;i++){const tl=rotl(al+ripemd_f(group,bl,cl,dl)+BUF_160[rl[i]]+hbl,sl[i])+el|0;al=el,el=dl,dl=rotl(cl,10)|0,cl=bl,bl=tl}for(let i=0;i<16;i++){const tr=rotl(ar+ripemd_f(rGroup,br,cr,dr)+BUF_160[rr[i]]+hbr,sr[i])+er|0;ar=er,er=dr,dr=rotl(cr,10)|0,cr=br,br=tr}}this.set(this.h1+cl+dr|0,this.h2+dl+er|0,this.h3+el+ar|0,this.h4+al+br|0,this.h0+bl+cr|0)}roundClean(){clean(BUF_160)}destroy(){this.destroyed=true;clean(this.buffer);this.set(0,0,0,0,0)}}const ripemd160=createHasher(()=>new _RIPEMD160);const SHA256_K=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);const SHA256_W=new Uint32Array(64);class SHA2_32B extends HashMD{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(outputLen,IV){super(64,outputLen,8,false);this.A=IV[0]|0;this.B=IV[1]|0;this.C=IV[2]|0;this.D=IV[3]|0;this.E=IV[4]|0;this.F=IV[5]|0;this.G=IV[6]|0;this.H=IV[7]|0}get(){const{A,B,C,D,E,F,G,H}=this;return[A,B,C,D,E,F,G,H]}set(A,B,C,D,E,F,G,H){this.A=A|0;this.B=B|0;this.C=C|0;this.D=D|0;this.E=E|0;this.F=F|0;this.G=G|0;this.H=H|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4)SHA256_W[i]=view.getUint32(offset,false);for(let i=16;i<64;i++){const W15=SHA256_W[i-15];const W2=SHA256_W[i-2];const s0=rotr(W15,7)^rotr(W15,18)^W15>>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){clean(SHA256_W)}destroy(){this.destroyed=true;this.set(0,0,0,0,0,0,0,0);clean(this.buffer)}}class _SHA256 extends SHA2_32B{constructor(){super(32,SHA256_IV)}}const K512=(()=>split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_Kh=(()=>K512[0])();const SHA512_Kl=(()=>K512[1])();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA2_64B extends HashMD{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(outputLen,IV){super(128,outputLen,16,false);this.Ah=IV[0]|0;this.Al=IV[1]|0;this.Bh=IV[2]|0;this.Bl=IV[3]|0;this.Ch=IV[4]|0;this.Cl=IV[5]|0;this.Dh=IV[6]|0;this.Dl=IV[7]|0;this.Eh=IV[8]|0;this.El=IV[9]|0;this.Fh=IV[10]|0;this.Fl=IV[11]|0;this.Gh=IV[12]|0;this.Gl=IV[13]|0;this.Hh=IV[14]|0;this.Hl=IV[15]|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=rotrSH(W15h,W15l,1)^rotrSH(W15h,W15l,8)^shrSH(W15h,W15l,7);const s0l=rotrSL(W15h,W15l,1)^rotrSL(W15h,W15l,8)^shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=rotrSH(W2h,W2l,19)^rotrBH(W2h,W2l,61)^shrSH(W2h,W2l,6);const s1l=rotrSL(W2h,W2l,19)^rotrBL(W2h,W2l,61)^shrSL(W2h,W2l,6);const SUMl=add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=rotrSH(Eh,El,14)^rotrSH(Eh,El,18)^rotrBH(Eh,El,41);const sigma1l=rotrSL(Eh,El,14)^rotrSL(Eh,El,18)^rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=rotrSH(Ah,Al,28)^rotrBH(Ah,Al,34)^rotrBH(Ah,Al,39);const sigma0l=rotrSL(Ah,Al,28)^rotrBL(Ah,Al,34)^rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=add3L(T1l,sigma0l,MAJl);Ah=add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){clean(SHA512_W_H,SHA512_W_L)}destroy(){this.destroyed=true;clean(this.buffer);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class _SHA512 extends SHA2_64B{constructor(){super(64,SHA512_IV)}}const sha256$1=createHasher(()=>new _SHA256,oidNist(1));const sha512$1=createHasher(()=>new _SHA512,oidNist(3));var buffer={};var base64Js={};var hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1;base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){if(hasRequiredIeee754)return ieee754;hasRequiredIeee754=1;ieee754.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};ieee754.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128};return ieee754}var hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;(function(exports){const base64=requireBase64Js();const ieee754=requireIeee754();const customInspectSymbol=typeof Symbol==="function"&&typeof Symbol["for"]==="function"?Symbol["for"]("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;const K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{const arr=new Uint8Array(1);const proto={foo:function(){return 42}};Object.setPrototypeOf(proto,Uint8Array.prototype);Object.setPrototypeOf(arr,proto);return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}const buf=new Uint8Array(length);Object.setPrototypeOf(buf,Buffer.prototype);return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayView(value)}if(value==null){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof SharedArrayBuffer!=="undefined"&&(isInstance(value,SharedArrayBuffer)||value&&isInstance(value.buffer,SharedArrayBuffer))){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}const valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}const b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}const length=byteLength(string,encoding)|0;let buf=createBuffer(length);const actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){const length=array.length<0?0:checked(array.length)|0;const buf=createBuffer(length);for(let i=0;i=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;let x=a.length;let y=b.length;for(let i=0,len=Math.min(x,y);ibuffer.length){if(!Buffer.isBuffer(buf))buf=Buffer.from(buf);buf.copy(buffer,pos)}else{Uint8Array.prototype.set.call(buffer,buf,pos)}}else if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}else{buf.copy(buffer,pos)}pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(ArrayBuffer.isView(string)||isInstance(string,ArrayBuffer)){return string.byteLength}if(typeof string!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof string)}const len=string.length;const mustMatch=arguments.length>2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;let loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){let loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){const i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){const len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(let i=0;imax)str+=" ... ";return""};if(customInspectSymbol){Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect}Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;let x=thisEnd-thisStart;let y=end-start;const len=Math.min(x,y);const thisCopy=this.slice(thisStart,thisEnd);const targetCopy=target.slice(start,end);for(let i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){let indexSize=1;let arrLength=arr.length;let valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}let i;if(dir){let foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){let found=true;for(let j=0;jremaining){length=remaining}}const strLen=string.length;if(length>strLen/2){length=strLen/2}let i;for(i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}const remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";let loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":case"latin1":case"binary":return asciiWrite(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);const res=[];let i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){let secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}const MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){const len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}let res="";let i=0;while(ilen)end=len;let out="";for(let i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}let val=this[offset+--byteLength];let mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readBigUInt64LE=defineBigIntMethod(function readBigUInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const lo=first+this[++offset]*2**8+this[++offset]*2**16+this[++offset]*2**24;const hi=this[++offset]+this[++offset]*2**8+this[++offset]*2**16+last*2**24;return BigInt(lo)+(BigInt(hi)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const hi=first*2**24+this[++offset]*2**16+this[++offset]*2**8+this[++offset];const lo=this[++offset]*2**24+this[++offset]*2**16+this[++offset]*2**8+last;return(BigInt(hi)<>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let i=byteLength;let mul=1;let val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readBigInt64LE=defineBigIntMethod(function readBigInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=this[offset+4]+this[offset+5]*2**8+this[offset+6]*2**16+(last<<24);return(BigInt(val)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=(first<<24)+this[++offset]*2**16+this[++offset]*2**8+this[++offset];return(BigInt(val)<>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let mul=1;let i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let i=byteLength-1;let mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function wrtBigUInt64LE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;return offset}function wrtBigUInt64BE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset+7]=lo;lo=lo>>8;buf[offset+6]=lo;lo=lo>>8;buf[offset+5]=lo;lo=lo>>8;buf[offset+4]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset+3]=hi;hi=hi>>8;buf[offset+2]=hi;hi=hi>>8;buf[offset+1]=hi;hi=hi>>8;buf[offset]=hi;return offset+8}Buffer.prototype.writeBigUInt64LE=defineBigIntMethod(function writeBigUInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeBigUInt64BE=defineBigIntMethod(function writeBigUInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=0;let mul=1;let sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=byteLength-1;let mul=1;let sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeBigInt64LE=defineBigIntMethod(function writeBigInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Buffer.prototype.writeBigInt64BE=defineBigIntMethod(function writeBigInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;let i;if(typeof val==="number"){for(i=start;i2**32){received=addNumericalSeparator(String(input))}else if(typeof input==="bigint"){received=String(input);if(input>BigInt(2)**BigInt(32)||input<-(BigInt(2)**BigInt(32))){received=addNumericalSeparator(received)}received+="n"}msg+=` It must be ${range}. Received ${received}`;return msg},RangeError);function addNumericalSeparator(val){let res="";let i=val.length;const start=val[0]==="-"?1:0;for(;i>=start+4;i-=3){res=`_${val.slice(i-3,i)}${res}`}return`${val.slice(0,i)}${res}`}function checkBounds(buf,offset,byteLength){validateNumber(offset,"offset");if(buf[offset]===undefined||buf[offset+byteLength]===undefined){boundsError(offset,buf.length-(byteLength+1))}}function checkIntBI(value,min,max,buf,offset,byteLength){if(value>max||value= 0${n} and < 2${n} ** ${(byteLength+1)*8}${n}`}else{range=`>= -(2${n} ** ${(byteLength+1)*8-1}${n}) and < 2 ** `+`${(byteLength+1)*8-1}${n}`}}throw new errors.ERR_OUT_OF_RANGE("value",range,value)}checkBounds(buf,offset,byteLength)}function validateNumber(value,name){if(typeof value!=="number"){throw new errors.ERR_INVALID_ARG_TYPE(name,"number",value)}}function boundsError(value,length,type){if(Math.floor(value)!==value){validateNumber(value,type);throw new errors.ERR_OUT_OF_RANGE("offset","an integer",value)}if(length<0){throw new errors.ERR_BUFFER_OUT_OF_BOUNDS}throw new errors.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${length}`,value)}const INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(str){str=str.split("=")[0];str=str.trim().replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function utf8ToBytes(string,units){units=units||Infinity;let codePoint;const length=string.length;let leadSurrogate=null;const bytes=[];for(let i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){const byteArray=[];for(let i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){let i;for(i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}const hexSliceLookupTable=function(){const alphabet="0123456789abcdef";const table=new Array(256);for(let i=0;i<16;++i){const i16=i*16;for(let j=0;j<16;++j){table[i16+j]=alphabet[i]+alphabet[j]}}return table}();function defineBigIntMethod(fn){return typeof BigInt==="undefined"?BufferBigIntNotDefined:fn}function BufferBigIntNotDefined(){throw new Error("BigInt not supported")}})(buffer);return buffer}requireBuffer();function getGlobal(){if(typeof globalThis!=="undefined")return globalThis;if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal();anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"ripemd160":return ripemd160.create();case"sha256":return sha256$1.create();case"sha512":return sha512$1.create();case"sha3-256":return sha3_256.create();case"sha3-512":return sha3_512.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}const _sha256=data=>hexlify(createHash("sha3-256").update(data).digest());const _sha512=data=>hexlify(createHash("sha3-512").update(data).digest());let __sha256=_sha256;let __sha512=_sha512;let locked256=false,locked512=false;var SupportedAlgorithm;(function(SupportedAlgorithm){SupportedAlgorithm["sha256"]="sha256";SupportedAlgorithm["sha512"]="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));function sha256(data){return hexlify(__sha256(getBytes(data)))}sha256._=_sha256;sha256.lock=function(){locked256=true};sha256.register=function(func){if(locked256){throw new Error("sha256 is locked")}__sha256=func};Object.freeze(sha256);function sha512(data){return hexlify(__sha512(getBytes(data)))}sha512._=_sha512;sha512.lock=function(){locked512=true};sha512.register=function(func){if(locked512){throw new Error("sha512 is locked")}__sha512=func};Object.freeze(sha512);function id(value,useKeccak){if(useKeccak){return keccak256(toUtf8Bytes(value))}return sha256(toUtf8Bytes(value))}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}static check(wordlist){const words=[];for(let i=0;i<2048;i++){const word=wordlist.getWord(i);if(i!==wordlist.getWordIndex(word)){return"0x"}words.push(word)}return id(words.join("\n")+"\n")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n",true);if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const words$3="0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc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:Ba&B!B$BleC GazG[&L/&L!oL*Lm.L.Ls/#LudLv Mb-c~Ndi-e Ng_Ni{dN}#PoQueRdin()nSt_TanU`Xof.3Cc~CoC_#C%DGu*IsL=LvaMa`M?l-d-Re'Rg*S#T?:Ba>BiqueB]BuCoC#JoL L>L,#Ll/.Ma'Mb^Ng}quePaPe)P@P.Qu?l(deRe(if(je%RotR+R%TuajeU+ZaZ.3At+|oC]CnicaJa&J!Ji&L/efo'MaM^Mp=NazNd!N!NisNRmi'Rnur(+rSisSo+StigoT!aX#Z3B$Bu+nEmpoEn{Er[EPoR(.TanT!eTu=Za5Al]B?=C Ci'DoG/&M N}#P PeQueRaxR!oRm,%RneoRoRpe&R_RS!Xi>2AbajoAc#rA!Afi>AgoAjeAmoAnceA#AumaAz EbolEguaEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv!b){return 1}return 0}for(let length=3;length<=9;length++){const d=data$2[length-3];for(let offset=0;offset=0&&index=40){code=code+168-40}else if(code>=19){code=code+97-19}return toUtf8String(new Uint8Array([225,(code>>6)+132,(code&63)+128]))}let _wordlist$1=null;function loadWords$1(){if(_wordlist$1!=null){return _wordlist$1}const wordlist=[];data$1.forEach((data,length)=>{length+=4;for(let i=0;i=0&&index>2),128+codes.indexOf(data[i*3+1]),128+codes.indexOf(data[i*3+2])];if(locale==="zh_tw"){const common=s%4;for(let i=common;i<3;i++){bytes[i]=codes.indexOf(deltaData[deltaOffset++])+(i==0?228:128)}}wordlist.push(toUtf8String(new Uint8Array(bytes)))}const checksum=id(wordlist.join("\n")+"\n");if(checksum!==Checks[locale]){throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`)}_wordlist[locale]=wordlist;return wordlist}const wordlists={};class LangZh extends Wordlist{constructor(dialect){super("zh_"+dialect)}getWord(index){const words=loadWords(this.locale);assertArgument(index>=0&&index= 4370000; - default: - break; } throw new Error(`unknown feature: ${feature}`); } + exports.networkFeatureAtBlock = networkFeatureAtBlock; -//# sourceMappingURL=blockchain-data.js.map \ No newline at end of file +exports.networkNames = networkNames; +exports.testAddress = testAddress; +exports.testBlock = testBlock; +exports.testReceipt = testReceipt; +exports.testTransaction = testTransaction; +//# sourceMappingURL=blockchain-data.js.map diff --git a/lib.commonjs/_tests/blockchain-data.js.map b/lib.commonjs/_tests/blockchain-data.js.map index 8e380c7e2..89ea92d35 100644 --- a/lib.commonjs/_tests/blockchain-data.js.map +++ b/lib.commonjs/_tests/blockchain-data.js.map @@ -1 +1 @@ -{"version":3,"file":"blockchain-data.js","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":";;;AAqFa,QAAA,WAAW,GAGpB;IACF,OAAO,EAAE;QACP;YACE,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,4CAA4C;YACrD,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC;YACnC,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,IAAI;SACX;QACD;YACE,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,kdAAkd;YACxd,OAAO,EAAE;gBACP,GAAG,EAAE,oEAAoE;aAC1E;SACF;QACD;YACE,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,oBAAoB;SAC3B;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC;AAEW,QAAA,SAAS,GAGlB;IACF,OAAO,EAAE;QACP;YACE,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,oEAAoE;YAC1E,UAAU,EACR,oEAAoE;YACtE,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,oBAAoB;YAC3B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC;YAC/B,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC;YAC7B,UAA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AE;gBACJ;oBACE,OAAO,EAAE,4CAA4C;oBACrD,SAAS,EACP,oEAAoE;oBACtE,WAAW,EAAE,QAAQ;oBACrB,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE;wBACN,oEAAoE;wBACpE,oEAAoE;qBACrE;oBACD,eAAe,EACb,oEAAoE;oBACtE,gBAAgB,EAAE,IAAI;iBACvB;aACF;YACD,SAAS,EACP,ogBAAogB;YACtgB,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,CAAC;YACT,EAAE,EAAE,4CAA4C;YAChD,IAAI,EAAE,oEAAoE;YAC1E,KAAK,EAAE,IAAI;SACZ;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC;AAEW,QAAA,YAAY,GAAiC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAChF,SAAgB,qBAAqB,CAAC,OAAe,EAAE,KAAa;IAClE,QAAQ,OAAO,EAAE;QACf,KAAK,WAAW;YACd,OAAO,KAAK,IAAI,OAAO,CAAC;QAC1B;YACE,MAAM;KACT;IACD,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC;AARD,sDAQC"} \ No newline at end of file +{"version":3,"file":"blockchain-data.js","sources":["../../lib.esm/_tests/blockchain-data.js"],"sourcesContent":["export const testAddress = {\n mainnet: [\n {\n test: \"old-account\",\n address: \"0xAC1639CF97a3A46D431e6d1216f576622894cBB5\",\n balance: BigInt(\"4813414100000000\"),\n nonce: 3,\n code: \"0x\",\n },\n {\n test: \"TheDAO-splitter-contract\",\n address: \"0x3474627D4F63A678266BC17171D87f8570936622\",\n code: \"0x606060405260e060020a60003504630b3ed5368114602e57806337b0574a14605257806356fa47f0146062575b005b602c6004356000546101009004600160a060020a03908116339091161460bb575b50565b60005460ff166060908152602090f35b602c60043560005460ff1615609657600160a060020a038116600034606082818181858883f193505050501515604f576002565b33600160a060020a0316600034606082818181858883f193505050501515604f576002565b600080546101009004600160a060020a03169082606082818181858883f193505050501515604f57600256\",\n storage: {\n \"0\": \"0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300\",\n },\n },\n {\n test: \"ricmoo.firefly.eth\",\n address: \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\",\n name: \"ricmoo.firefly.eth\",\n },\n ],\n goerli: [],\n};\nexport const testBlock = {\n mainnet: [\n {\n test: \"old-homestead-block\",\n hash: \"0x3d6122660cc824376f11ee842f83addc3525e2dd6756b9bcf0affa6aa88cf741\",\n parentHash: \"0xb495a1d7e6663152ae92708da4843337b958146015a2802f4193a410044698c9\",\n number: 3,\n timestamp: 1438270048,\n nonce: \"0x2e9344e0cbde83ce\",\n difficulty: BigInt(17154715646),\n energyLimit: BigInt(\"0x1388\"),\n energyUsed: BigInt(\"0\"),\n miner: \"0x5088D623ba0fcf0131E0897a91734A4D83596AA0\",\n extraData: \"0x476574682f76312e302e302d66633739643332642f6c696e75782f676f312e34\",\n transactions: [],\n },\n {\n test: \"london-block\",\n number: 14413999,\n hash: \"0x6c79356d40ebb6ed63dc19f5d407f8f1c876047b59dc1a4598cce0e64dcabec5\",\n parentHash: \"0xbf09b0e215f247a5066d19ece5b4c66960771d45fae62985e8d751fb1adcfe2f\",\n timestamp: 1647654576,\n nonce: \"0xb4bc9979af5369fe\",\n difficulty: BigInt(\"12841513359509721\"),\n energyLimit: BigInt(\"30087914\"),\n energyUsed: BigInt(\"2008910\"),\n miner: \"0x2A20380DcA5bC24D052acfbf79ba23e988ad0050\",\n extraData: \"0x706f6f6c696e2e636f6d21f7092f019bb92a76\",\n baseFeePerEnergy: BigInt(\"40911884304\"),\n transactions: [\n \"0x1c3a398933db10634631f54b435c40c8805c13f12bbac7c3dab858ca44213fa2\",\n \"0xd98947cbdd892cc7f679c903903e6d18a5c5afb19e94437beba79372ad71c347\",\n \"0x4d66190deb55b5820cb0ce9adb972f646fa0f3e64eaeee674bbf3d054bf3d883\",\n \"0x9db7bd5f4c91d6103c714bcbc35df3dc708daa668aaef7449b589dbd3be24dac\",\n \"0x126a43ae4ade4b7fc5c8ac9ebd3dbcf7314f63c60f2804fb49aa25b5c7d80bb1\",\n \"0x82a90aa4b3b1b7873b117c3ff1ca7165ae34b2fc0788cc0cbfd41805d588590d\",\n \"0x7f694a6a9972457753ed3dec164f17272b1c8b1da4eab149df95e31a3e72f606\",\n \"0xdce1cba1ff33f0c23881087d49de3b34fe84c8a6883f3edd75b04fc23e458aac\",\n \"0xbe1c69f825279cebef42d1f0e07397dcddef7fb278b0195e295ede3e156836c4\",\n \"0x1d2f007b3c0f894403973a30e5ffaa78589f873d963e9554c6bb1bd7a3127245\",\n \"0x9c8c78191cf4ae9ae8eee1165153eabe24dbd8b9509b83d5f0caeea85251bb2f\",\n \"0x42e956f4b3dd6535359b272a0d2dab995c364cb48baaf8d0a1981995f3f8c808\",\n \"0xdc2c2e99393e24d5dc66e38665fa1d1ff007d92088ef3fd2549545fdbe862ef6\",\n \"0xaad7be28fffd2e77e8e40bf57f2ac140aa8283ec93c7f3f61a82c79405602f53\",\n \"0x4735f1421b7b30283e87e0799e82e54307d3e5ba14cd54ad8420b57577489a71\",\n \"0x0b9d6aa23aa439b41e86595f2ad91f498adffa3e6e7cb26ac7d73252e59fd3de\",\n \"0xcd93e19bd5d5c5a834fec613116fa01f46eddfd2faa20ef302271b874b9d812a\",\n \"0x5bf1976574a637f5ac0b8bda1a792fa16cc7ce9624d32e9bd6bd9aa6a8f19d2f\",\n \"0x2e778da4f66f10f7b681b605635c6599cdbeea167fc1c4396a097aef5d06de61\",\n \"0xd5fd68eebc4c870ccda081786a74c75c250e9e2d8269b8935edb3adb11b80bb2\",\n \"0x2aec42a11c1d8c1e5198d54aacbc6bebb09bcd5e78f6af81ea09d65c9064734a\",\n \"0xbea2e364ea4959ec438d9ccc2d2f7120c7eaba3b177cc0d7df8ff65d866ef89f\",\n \"0xf48bbb0f838353060da4126a555ce532abf497a9d1108001afffaac513a59ddf\",\n \"0xf5664e4372cce62733a6610efb7701a4a0e552d81f8caa764d8474b3070c6617\",\n \"0x9d3732ddbd20610008ff737da2f61120734a1cbfa864374bcbcf10051e6048cb\",\n \"0xc4d0df5bc6fa51b34ac3c898866d779d4e51a6be4d13be1ec3084b7229b03b47\",\n \"0x90c86ec98b8ad98049b4ee54cb3aa72c5ae743077b830e8a294aa5dc47a1fb18\",\n ],\n },\n ],\n goerli: [],\n};\nexport const testTransaction = {\n mainnet: [\n {\n test: \"legacy\",\n hash: \"0xccc90ab97a74c952fb3376c4a3efb566a58a10df62eb4d44a61e106fcf10ec61\",\n blockHash: \"0x9653f180a5720f3634816eb945a6d722adee52cc47526f6357ac10adaf368135\",\n blockNumber: 4097745,\n // index: 18,\n type: 0,\n from: \"0x32DEF047DeFd076DB21A2D759aff2A591c972248\",\n energyPrice: BigInt(\"0x4a817c800\"),\n energyLimit: BigInt(\"0x3d090\"),\n to: \"0x6fC21092DA55B392b045eD78F4732bff3C580e2c\",\n value: BigInt(\"0x186cc6acd4b0000\"),\n nonce: 0,\n data: \"0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067269636d6f6f0000000000000000000000000000000000000000000000000000\",\n signature: {\n r: \"0x1e5605197a03e3f0a168f14749168dfeefc44c9228312dacbffdcbbb13263265\",\n s: \"0x269c3e5b3558267ad91b0a887d51f9f10098771c67b82ea6cb74f29638754f54\",\n yParity: 1,\n v: 28,\n networkV: BigInt(38),\n },\n creates: null,\n networkId: BigInt(1),\n },\n {\n test: \"EIP-1559\",\n hash: \"0x8ff41d0ba5d239acc8c123ff12451a2c15721c838f657e583d355999af4a4349\",\n blockHash: \"0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0\",\n blockNumber: 12966000,\n // index: 185,\n type: 2,\n from: \"0x5afFBa12E9332bbc0E221c8E7BEf7CB7cfB3F281\",\n to: \"0x2258CcD34ae29E6B199b6CD64eb2aEF157df7CdE\",\n energyLimit: BigInt(\"21000\"),\n nonce: 2,\n data: \"0x\",\n value: BigInt(\"1100000000000000\"),\n energyPrice: BigInt(\"70578812137\"),\n networkId: BigInt(1),\n signature: {\n r: \"0xdd26e5478d0aa84e334a0393d335ab24b83de8ecae9290305f15ab884ded246c\",\n s: \"0x6494b4f61b0d9a5a82ecb86d72b301f859f404f0bec9682bbfff619903ecfbe2\",\n yParity: 1,\n v: 28,\n networkV: null,\n },\n creates: null,\n accessList: [],\n },\n ],\n goerli: [],\n};\nexport const testReceipt = {\n mainnet: [\n {\n test: \"legacy\",\n //byzantium: false,\n blockHash: \"0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566\",\n blockNumber: 0x3c92b5,\n type: 0,\n contractAddress: null,\n cumulativeEnergyUsed: BigInt(0x1cca2e),\n from: \"0x18C6045651826824FEBBD39d8560584078d1b247\",\n energyUsed: BigInt(0x14bb7),\n energyPrice: BigInt(4100000000),\n logs: [\n {\n address: \"0x314159265dD8dbb310642f98f50C066173C1259b\",\n blockHash: \"0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566\",\n blockNumber: 0x3c92b5,\n data: \"0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247\",\n index: 0x1a,\n topics: [\n \"0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82\",\n \"0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae\",\n \"0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1\",\n ],\n transactionHash: \"0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616\",\n transactionIndex: 0x39,\n },\n {\n address: \"0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef\",\n blockHash: \"0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566\",\n blockNumber: 0x3c92b5,\n data: \"0x000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000595a32ce\",\n index: 0x1b,\n topics: [\n \"0x0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e670\",\n \"0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1\",\n \"0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247\",\n ],\n transactionHash: \"0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616\",\n transactionIndex: 0x39,\n },\n ],\n logsBloom: \"0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000\",\n root: \"0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590\",\n // Should be null for pre-byzantium, but some nodes have backfilled it\n status: 1,\n to: \"0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef\",\n hash: \"0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616\",\n index: 0x39,\n },\n {\n test: \"byzantium\",\n //byzantium: true,\n blockHash: \"0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9\",\n blockNumber: 0x444f76,\n type: 0,\n contractAddress: null,\n cumulativeEnergyUsed: BigInt(0x15bfe7),\n from: \"0x18C6045651826824FEBBD39d8560584078d1b247\",\n energyUsed: BigInt(0x1b968),\n energyPrice: BigInt(1000000000),\n logs: [\n {\n address: \"0xb90E64082D00437e65A76d4c8187596BC213480a\",\n blockHash: \"0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9\",\n blockNumber: 0x444f76,\n data: \"0x\",\n index: 0x10,\n topics: [\n \"0x748d071d1992ee1bfe7a39058114d0a50d5798fe8eb3a9bfb4687f024629a2ce\",\n \"0x5574aa58f7191ccab6de6cf75fe2ea0484f010b852fdd8c6b7ae151d6c2f4b83\",\n ],\n transactionHash: \"0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac\",\n transactionIndex: 0x1e,\n },\n ],\n logsBloom: \"0x00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000800000000000000000000000000000000000000\",\n root: null,\n status: 1,\n to: \"0xb90E64082D00437e65A76d4c8187596BC213480a\",\n hash: \"0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac\",\n index: 0x1e,\n },\n ],\n goerli: [],\n};\nexport const networkNames = [\"mainnet\", \"goerli\"];\nexport function networkFeatureAtBlock(feature, block) {\n switch (feature) {\n case \"byzantium\":\n return block >= 4370000;\n default:\n break;\n }\n throw new Error(`unknown feature: ${feature}`);\n}\n//# sourceMappingURL=blockchain-data.js.map"],"names":[],"mappings":";;AAAY,MAAC,WAAW,GAAG;AAC3B,IAAI,OAAO,EAAE;AACb,QAAQ;AACR,YAAY,IAAI,EAAE,aAAa;AAC/B,YAAY,OAAO,EAAE,4CAA4C;AACjE,YAAY,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC;AAC/C,YAAY,KAAK,EAAE,CAAC;AACpB,YAAY,IAAI,EAAE,IAAI;AACtB,SAAS;AACT,QAAQ;AACR,YAAY,IAAI,EAAE,0BAA0B;AAC5C,YAAY,OAAO,EAAE,4CAA4C;AACjE,YAAY,IAAI,EAAE,kdAAkd;AACpe,YAAY,OAAO,EAAE;AACrB,gBAAgB,GAAG,EAAE,oEAAoE;AACzF,aAAa;AACb,SAAS;AACT,QAAQ;AACR,YAAY,IAAI,EAAE,oBAAoB;AACtC,YAAY,OAAO,EAAE,4CAA4C;AACjE,YAAY,IAAI,EAAE,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tests/create-provider.d.ts.map index 901738c3a..6a71ec23d 100644 --- a/lib.commonjs/_tests/create-provider.d.ts.map +++ b/lib.commonjs/_tests/create-provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA2EpD,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAED,eAAO,MAAM,aAAa,mBAAqD,CAAC;AAUhF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAMnE;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,IAAI,GAAG,gBAAgB,CAsBzB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAMzD"} \ No newline at end of file +{"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA2EpD,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAED,eAAO,MAAM,aAAa,mBAAqD,CAAC;AAUhF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAMnE;AAED,wBAAgB,WAAW,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACb,IAAI,GAAG,gBAAgB,CAsBzB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAMzD"} \ No newline at end of file diff --git a/lib.commonjs/_tests/create-provider.js b/lib.commonjs/_tests/create-provider.js index aeff79c71..f222839d7 100644 --- a/lib.commonjs/_tests/create-provider.js +++ b/lib.commonjs/_tests/create-provider.js @@ -1,7 +1,48 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.connect = exports.checkProvider = exports.getProvider = exports.getProviderNetworks = exports.providerNames = exports.setupProviders = void 0; -const index_js_1 = require("../index.js"); +'use strict'; + +require('buffer'); +require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../crypto/signature.js'); +require('../abi/abi-coder.js'); +require('../abi/fragments.js'); +require('../constants/numbers.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +require('../contract/contract.js'); +require('../providers/provider.js'); +require('../providers/format.js'); +var providerAlchemy = require('../providers/provider-alchemy.js'); +var providerInfura = require('../providers/provider-infura.js'); +var providerQuicknode = require('../providers/provider-quicknode.js'); +var providerFallback = require('../providers/provider-fallback.js'); +require('ws'); +var providerPocket = require('../providers/provider-pocket.js'); +require('net'); +require('utf8'); +require('../wallet/json-keystore.js'); +require('../wallet/json-crowdsale.js'); +require('../bigNumber/bigNumber.js'); +require('../wordlists/wordlists.js'); + const ethNetworks = ["default", "mainnet", "goerli"]; //const maticNetworks = [ "matic", "maticmum" ]; const ProviderCreators = [ @@ -9,35 +50,35 @@ const ProviderCreators = [ name: "AlchemyProvider", networks: ethNetworks, create: function (network) { - return new index_js_1.AlchemyProvider(network, "YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM"); + return new providerAlchemy.AlchemyProvider(network, "YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM"); }, }, { name: "InfuraProvider", networks: ethNetworks, create: function (network) { - return new index_js_1.InfuraProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); + return new providerInfura.InfuraProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); }, }, { name: "InfuraWebsocketProvider", networks: ethNetworks, create: function (network) { - return index_js_1.InfuraProvider.getWebSocketProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); + return providerInfura.InfuraProvider.getWebSocketProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); }, }, { name: "PocketProvider", networks: ethNetworks, create: function (network) { - return new index_js_1.PocketProvider(network); + return new providerPocket.PocketProvider(network); }, }, { name: "QuickNodeProvider", networks: ethNetworks, create: function (network) { - return new index_js_1.QuickNodeProvider(network); + return new providerQuicknode.QuickNodeProvider(network); }, }, { @@ -58,7 +99,7 @@ const ProviderCreators = [ if (providers.length === 0) { throw new Error("UNSUPPORTED NETWORK"); } - return new index_js_1.FallbackProvider(providers); + return new providerFallback.FallbackProvider(providers); }, }, ]; @@ -72,8 +113,7 @@ function setupProviders() { }); setup = true; } -exports.setupProviders = setupProviders; -exports.providerNames = Object.freeze(ProviderCreators.map((c) => c.name)); +const providerNames = Object.freeze(ProviderCreators.map((c) => c.name)); function getCreator(provider) { const creators = ProviderCreators.filter((c) => c.name === provider); if (creators.length === 1) { @@ -88,7 +128,6 @@ function getProviderNetworks(provider) { } return []; } -exports.getProviderNetworks = getProviderNetworks; function getProvider(provider, network) { if (setup == false) { throw new Error("MUST CALL setupProviders in root context"); @@ -106,18 +145,16 @@ function getProvider(provider, network) { } } catch (error) { - if (!(0, index_js_1.isError)(error, "INVALID_ARGUMENT")) { + if (!errors.isError(error, "INVALID_ARGUMENT")) { throw error; } } return null; } -exports.getProvider = getProvider; function checkProvider(provider, network) { const creator = getCreator(provider); return creator != null; } -exports.checkProvider = checkProvider; function connect(network) { const provider = getProvider("InfuraProvider", network); if (provider == null) { @@ -125,5 +162,11 @@ function connect(network) { } return provider; } + +exports.checkProvider = checkProvider; exports.connect = connect; -//# sourceMappingURL=create-provider.js.map \ No newline at end of file +exports.getProvider = getProvider; +exports.getProviderNetworks = getProviderNetworks; +exports.providerNames = providerNames; +exports.setupProviders = setupProviders; +//# sourceMappingURL=create-provider.js.map diff --git a/lib.commonjs/_tests/create-provider.js.map b/lib.commonjs/_tests/create-provider.js.map index 0d682e419..3530e3799 100644 --- a/lib.commonjs/_tests/create-provider.js.map +++ b/lib.commonjs/_tests/create-provider.js.map @@ -1 +1 @@ -{"version":3,"file":"create-provider.js","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":";;;AAAA,0CAOqB;AAUrB,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACrD,gDAAgD;AAEhD,MAAM,gBAAgB,GAA2B;IAC/C;QACE,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAC/B,OAAO,IAAI,0BAAe,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QAC1E,CAAC;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAC/B,OAAO,IAAI,yBAAc,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QACzE,CAAC;KACF;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAC/B,OAAO,yBAAc,CAAC,oBAAoB,CACxC,OAAO,EACP,kCAAkC,CACnC,CAAC;QACJ,CAAC;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,WAAW;QACrB,MAAM,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B,CAAC;AAHD,sCAGC;AAED,SAAgB,OAAO,CAAC,OAAe;IACrC,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACxD,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;KACpD;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAND,0BAMC"} \ No newline at end of file +{"version":3,"file":"create-provider.js","sources":["../../lib.esm/_tests/create-provider.js"],"sourcesContent":["import { AlchemyProvider, InfuraProvider, PocketProvider, QuickNodeProvider, FallbackProvider, isError, } from \"../index.js\";\nconst ethNetworks = [\"default\", \"mainnet\", \"goerli\"];\n//const maticNetworks = [ \"matic\", \"maticmum\" ];\nconst ProviderCreators = [\n {\n name: \"AlchemyProvider\",\n networks: ethNetworks,\n create: function (network) {\n return new AlchemyProvider(network, \"YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM\");\n },\n },\n {\n name: \"InfuraProvider\",\n networks: ethNetworks,\n create: function (network) {\n return new InfuraProvider(network, \"49a0efa3aaee4fd99797bfa94d8ce2f1\");\n },\n },\n {\n name: \"InfuraWebsocketProvider\",\n networks: ethNetworks,\n create: function (network) {\n return InfuraProvider.getWebSocketProvider(network, \"49a0efa3aaee4fd99797bfa94d8ce2f1\");\n },\n },\n {\n name: \"PocketProvider\",\n networks: ethNetworks,\n create: function (network) {\n return new PocketProvider(network);\n },\n },\n {\n name: \"QuickNodeProvider\",\n networks: ethNetworks,\n create: function (network) {\n return new QuickNodeProvider(network);\n },\n },\n {\n name: \"FallbackProvider\",\n networks: ethNetworks,\n create: function (network) {\n const providers = [];\n for (const providerName of [\n \"AlchemyProvider\",\n \"AnkrProvider\",\n \"InfuraProvider\",\n ]) {\n const provider = getProvider(providerName, network);\n if (provider) {\n providers.push(provider);\n }\n }\n if (providers.length === 0) {\n throw new Error(\"UNSUPPORTED NETWORK\");\n }\n return new FallbackProvider(providers);\n },\n },\n];\nlet setup = false;\nconst cleanup = [];\nexport function setupProviders() {\n after(function () {\n for (const func of cleanup) {\n func();\n }\n });\n setup = true;\n}\nexport const providerNames = Object.freeze(ProviderCreators.map((c) => c.name));\nfunction getCreator(provider) {\n const creators = ProviderCreators.filter((c) => c.name === provider);\n if (creators.length === 1) {\n return creators[0];\n }\n return null;\n}\nexport function getProviderNetworks(provider) {\n const creator = getCreator(provider);\n if (creator) {\n return creator.networks;\n }\n return [];\n}\nexport function getProvider(provider, network) {\n if (setup == false) {\n throw new Error(\"MUST CALL setupProviders in root context\");\n }\n const creator = getCreator(provider);\n try {\n if (creator) {\n const provider = creator.create(network);\n if (provider) {\n cleanup.push(() => {\n provider.destroy();\n });\n }\n return provider;\n }\n }\n catch (error) {\n if (!isError(error, \"INVALID_ARGUMENT\")) {\n throw error;\n }\n }\n return null;\n}\nexport function checkProvider(provider, network) {\n const creator = getCreator(provider);\n return creator != null;\n}\nexport function connect(network) {\n const provider = getProvider(\"InfuraProvider\", network);\n if (provider == null) {\n throw new Error(`could not connect to ${network}`);\n }\n return provider;\n}\n//# sourceMappingURL=create-provider.js.map"],"names":["AlchemyProvider","InfuraProvider","PocketProvider","QuickNodeProvider","FallbackProvider","isError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC;AACpD;AACA,MAAM,gBAAgB,GAAG;AACzB,IAAI;AACJ,QAAQ,IAAI,EAAE,iBAAiB;AAC/B,QAAQ,QAAQ,EAAE,WAAW;AAC7B,QAAQ,MAAM,EAAE,UAAU,OAAO,EAAE;AACnC,YAAY,OAAO,IAAIA,+BAAe,CAAC,OAAO,EAAE,kCAAkC,CAAC;AACnF,QAAQ,CAAC;AACT,KAAK;AACL,IAAI;AACJ,QAAQ,IAAI,EAAE,gBAAgB;AAC9B,QAAQ,QAAQ,EAAE,WAAW;AAC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,IAAI;AACJ,IAAI,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC;AACxC,IAAI,IAAI;AACR,QAAQ,IAAI,OAAO,EAAE;AACrB,YAAY,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;AACpD,YAAY,IAAI,QAAQ,EAAE;AAC1B,gBAAgB,OAAO,CAAC,IAAI,CAAC,MAAM;AACnC,oBAAoB,QAAQ,CAAC,OAAO,EAAE;AACtC,gBAAgB,CAAC,CAAC;AAClB,YAAY;AACZ,YAAY,OAAO,QAAQ;AAC3B,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,IAAI,CAACC,cAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAAE;AACjD,YAAY,MAAM,KAAK;AACvB,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,IAAI;AACf;AACO,SAAS,aAAa,CAAC,QAAQ,EAAE,OAAO,EAAE;AACjD,IAAI,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC;AACxC,IAAI,OAAO,OAAO,IAAI,IAAI;AAC1B;AACO,SAAS,OAAO,CAAC,OAAO,EAAE;AACjC,IAAI,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC;AAC3D,IAAI,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC1B,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1D,IAAI;AACJ,IAAI,OAAO,QAAQ;AACnB;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-cip.d.ts b/lib.commonjs/_tests/test-cip.d.ts new file mode 100644 index 000000000..cc969463b --- /dev/null +++ b/lib.commonjs/_tests/test-cip.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test-cip.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/test-cip.d.ts.map b/lib.commonjs/_tests/test-cip.d.ts.map new file mode 100644 index 000000000..cd282b01e --- /dev/null +++ b/lib.commonjs/_tests/test-cip.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test-cip.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-cip.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-cip.js b/lib.commonjs/_tests/test-cip.js new file mode 100644 index 000000000..415bc0261 --- /dev/null +++ b/lib.commonjs/_tests/test-cip.js @@ -0,0 +1,194 @@ +'use strict'; + +var assert = require('node:assert/strict'); +require('buffer'); +require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../crypto/signature.js'); +require('../abi/abi-coder.js'); +require('../abi/fragments.js'); +var _interface = require('../abi/interface.js'); +require('../constants/numbers.js'); +require('../contract/contract.js'); +require('../providers/provider.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +require('../providers/format.js'); +require('ws'); +require('../providers/provider-fallback.js'); +require('net'); +require('utf8'); +require('../wallet/json-keystore.js'); +require('../wallet/json-crowdsale.js'); +require('../bigNumber/bigNumber.js'); +require('../wordlists/wordlists.js'); +var index = require('../cip/index.js'); +var index$1 = require('../ipfs/index.js'); +var customUnits = require('../cip/custom-units.js'); + +const address = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; +describe("CIP metadata and custom units", () => { + it("uses Unix seconds and exact inclusive lifecycle boundaries", () => { + const lifecycle = new index.Cip151Lifecycle({ + tokenExpiration: "9007199254740993", + tradingStop: "0", + }); + assert.equal(lifecycle.isExpiredAt(9007199254740992n), false); + assert.equal(lifecycle.isExpiredAt(9007199254740993n), true); + assert.equal(lifecycle.isTradingStoppedAt(0n), true); + assert.equal(new index.Cip151Lifecycle().isExpiredAt(1n), false); + for (const value of ["-1", "1.5", "1e3", " 1", "NaN"]) + assert.throws(() => new index.Cip151Lifecycle({ tokenExpiration: value })); + }); + it("validates and copies lab measurements", () => { + const input = { moisture: { value: 12, unit: "%" } }; + const lab = new index.Cip152LabCertificate(input); + input.moisture.value = 99; + assert.equal(lab.measurements.moisture.value, 12); + for (const json of [ + null, + [], + { x: {} }, + { x: { value: true } }, + { x: { value: Infinity } }, + { x: { value: 1, unit: 3 } }, + ]) + assert.throws(() => new index.Cip152LabCertificate(json)); + }); + it("encodes CIP-150 calls and preserves block references", async () => { + const abi = new _interface.Interface(index.cip150Abi); + const values = { + tokenExpiration: "100", + lab: "ipfs://QmExample/lab.json", + }; + const calls = []; + const metadata = new index.Cip150MetadataContract(address, { + provider: null, + call: async (tx) => { + assert.equal(tx.blockTag, 42); + const parsed = abi.parseTransaction({ data: tx.data }); + calls.push(parsed.name); + const key = parsed.args.length ? parsed.args[0] : ""; + const result = { + listMetadataKeys: [Object.keys(values)], + metadataCount: [2n], + getMetadataByIndex: ["tokenExpiration", "100"], + hasMetadataKey: [Object.hasOwn(values, key)], + getMetadataValue: [values[key]], + isMetadataSealed: [true], + }; + return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); + }, + }); + assert.equal(await metadata.count(42), 2n); + assert.deepEqual(await metadata.getByIndex(0n, 42), { + key: "tokenExpiration", + value: "100", + }); + assert.equal((await metadata.readAll(42))[0].sealed, true); + assert.equal((await metadata.readAll(42, false))[0].sealed, undefined); + assert.equal((await metadata.readLifecycle(42)).tokenExpiration, 100n); + const gateway = new index$1.IpfsGateway({ + fetch: async () => new Response('{"pH":{"value":7}}'), + }); + assert.equal((await metadata.readLabCertificate(gateway, 42)).measurements.pH.value, 7); + values.lab = "ipfs://QmExample/wrong.json"; + await assert.rejects(metadata.readLabCertificate(gateway, 42), /lab.json/); + delete values.lab; + assert.equal(await metadata.readLabCertificate(gateway, 42), null); + await assert.rejects(metadata.setValue("x", "y"), /sendTransaction/); + assert.ok(calls.includes("isMetadataSealed")); + }); + it("discovers custom units and retains balances beyond Number precision", async () => { + const abi = new _interface.Interface(customUnits.customUnitAbi); + const canonical = 9007199254740993n; + const token = new customUnits.CustomUnitToken(address, { + provider: null, + call: async (tx) => { + assert.equal(tx.blockTag, 10); + const parsed = abi.parseTransaction({ data: tx.data }); + const result = { + supportsUnit: [parsed.args.length > 0 && parsed.args[0] === "units"], + supportedUnits: [["units", "kg"]], + preferredUnit: ["kg"], + balanceOf: [canonical], + balanceOfUnit: [canonical * 3n], + }; + if (parsed.name === "balanceOfUnit") + assert.equal(parsed.args[1], "kg"); + return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); + }, + }); + assert.equal((await token.discover(10)).supports("kg"), true); + const balance = await token.balance(address, undefined, 10); + assert.equal(balance.multiplierNumerator, canonical * 3n); + assert.equal(balance.multiplierDenominator, canonical); + assert.equal(await token.supportsUnit(" ", 10), false); + assert.throws(() => token.balanceOfUnit(address, " ")); + }); +}); +describe("IPFS gateway", () => { + it("resolves references and rejects unsupported schemes and traversal", () => { + const gateway = new index$1.IpfsGateway(); + for (const ref of [ + "ipfs://QmExample/lab.json", + "/ipfs/QmExample/lab.json", + "QmExample/lab.json", + "ipfs://ipfs/QmExample/lab.json", + ]) + assert.equal(gateway.resolve(ref).href, "https://ipf.sk/QmExample/lab.json"); + assert.equal(gateway.resolve("https://example.com/lab.json").href, "https://example.com/lab.json"); + for (const ref of ["", "file:///tmp/lab.json", "QmExample/../lab.json"]) + assert.throws(() => gateway.resolve(ref)); + assert.throws(() => new index$1.IpfsGateway({ maxResponseBytes: 0 })); + assert.throws(() => new index$1.IpfsGateway({ template: "ftp://example.com/{cid}" })); + }); + it("bounds streamed bodies and cancels oversized responses", async () => { + let cancelled = false; + const gateway = new index$1.IpfsGateway({ + maxResponseBytes: 4, + fetch: async () => new Response(new ReadableStream({ + start(c) { + c.enqueue(new Uint8Array(5)); + }, + cancel() { + cancelled = true; + }, + })), + }); + await assert.rejects(gateway.readJson("QmExample"), /exceeds/); + assert.equal(cancelled, true); + }); + it("rejects HTTP errors and invalid JSON", async () => { + await assert.rejects(new index$1.IpfsGateway({ + fetch: async () => new Response("no", { status: 404 }), + }).readJson("QmExample"), /404/); + await assert.rejects(new index$1.IpfsGateway({ fetch: async () => new Response("not json") }).readJson("QmExample"), SyntaxError); + }); + it("aborts stalled requests", async () => { + const gateway = new index$1.IpfsGateway({ + timeoutMs: 5, + fetch: async (_url, init) => new Promise((_resolve, reject) => init.signal.addEventListener("abort", () => reject(new Error("aborted")))), + }); + await assert.rejects(gateway.readJson("QmExample"), /aborted/); + }); +}); +//# sourceMappingURL=test-cip.js.map diff --git a/lib.commonjs/_tests/test-cip.js.map b/lib.commonjs/_tests/test-cip.js.map new file mode 100644 index 000000000..d9015ecb9 --- /dev/null +++ b/lib.commonjs/_tests/test-cip.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test-cip.js","sources":["../../lib.esm/_tests/test-cip.js"],"sourcesContent":["import assert from \"node:assert/strict\";\nimport { Interface, Cip150MetadataContract, Cip151Lifecycle, Cip152LabCertificate, CustomUnitToken, cip150Abi, customUnitAbi, IpfsGateway, } from \"../index.js\";\nconst address = \"0xab38254e30777140469a3aa168df81182d3d61f9843f\";\ndescribe(\"CIP metadata and custom units\", () => {\n it(\"uses Unix seconds and exact inclusive lifecycle boundaries\", () => {\n const lifecycle = new Cip151Lifecycle({\n tokenExpiration: \"9007199254740993\",\n tradingStop: \"0\",\n });\n assert.equal(lifecycle.isExpiredAt(9007199254740992n), false);\n assert.equal(lifecycle.isExpiredAt(9007199254740993n), true);\n assert.equal(lifecycle.isTradingStoppedAt(0n), true);\n assert.equal(new Cip151Lifecycle().isExpiredAt(1n), false);\n for (const value of [\"-1\", \"1.5\", \"1e3\", \" 1\", \"NaN\"])\n assert.throws(() => new Cip151Lifecycle({ tokenExpiration: value }));\n });\n it(\"validates and copies lab measurements\", () => {\n const input = { moisture: { value: 12, unit: \"%\" } };\n const lab = new Cip152LabCertificate(input);\n input.moisture.value = 99;\n assert.equal(lab.measurements.moisture.value, 12);\n for (const json of [\n null,\n [],\n { x: {} },\n { x: { value: true } },\n { x: { value: Infinity } },\n { x: { value: 1, unit: 3 } },\n ])\n assert.throws(() => new Cip152LabCertificate(json));\n });\n it(\"encodes CIP-150 calls and preserves block references\", async () => {\n const abi = new Interface(cip150Abi);\n const values = {\n tokenExpiration: \"100\",\n lab: \"ipfs://QmExample/lab.json\",\n };\n const calls = [];\n const metadata = new Cip150MetadataContract(address, {\n provider: null,\n call: async (tx) => {\n assert.equal(tx.blockTag, 42);\n const parsed = abi.parseTransaction({ data: tx.data });\n calls.push(parsed.name);\n const key = parsed.args.length ? parsed.args[0] : \"\";\n const result = {\n listMetadataKeys: [Object.keys(values)],\n metadataCount: [2n],\n getMetadataByIndex: [\"tokenExpiration\", \"100\"],\n hasMetadataKey: [Object.hasOwn(values, key)],\n getMetadataValue: [values[key]],\n isMetadataSealed: [true],\n };\n return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]);\n },\n });\n assert.equal(await metadata.count(42), 2n);\n assert.deepEqual(await metadata.getByIndex(0n, 42), {\n key: \"tokenExpiration\",\n value: \"100\",\n });\n assert.equal((await metadata.readAll(42))[0].sealed, true);\n assert.equal((await metadata.readAll(42, false))[0].sealed, undefined);\n assert.equal((await metadata.readLifecycle(42)).tokenExpiration, 100n);\n const gateway = new IpfsGateway({\n fetch: async () => new Response('{\"pH\":{\"value\":7}}'),\n });\n assert.equal((await metadata.readLabCertificate(gateway, 42)).measurements.pH.value, 7);\n values.lab = \"ipfs://QmExample/wrong.json\";\n await assert.rejects(metadata.readLabCertificate(gateway, 42), /lab.json/);\n delete values.lab;\n assert.equal(await metadata.readLabCertificate(gateway, 42), null);\n await assert.rejects(metadata.setValue(\"x\", \"y\"), /sendTransaction/);\n assert.ok(calls.includes(\"isMetadataSealed\"));\n });\n it(\"discovers custom units and retains balances beyond Number precision\", async () => {\n const abi = new Interface(customUnitAbi);\n const canonical = 9007199254740993n;\n const token = new CustomUnitToken(address, {\n provider: null,\n call: async (tx) => {\n assert.equal(tx.blockTag, 10);\n const parsed = abi.parseTransaction({ data: tx.data });\n const result = {\n supportsUnit: [parsed.args.length > 0 && parsed.args[0] === \"units\"],\n supportedUnits: [[\"units\", \"kg\"]],\n preferredUnit: [\"kg\"],\n balanceOf: [canonical],\n balanceOfUnit: [canonical * 3n],\n };\n if (parsed.name === \"balanceOfUnit\")\n assert.equal(parsed.args[1], \"kg\");\n return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]);\n },\n });\n assert.equal((await token.discover(10)).supports(\"kg\"), true);\n const balance = await token.balance(address, undefined, 10);\n assert.equal(balance.multiplierNumerator, canonical * 3n);\n assert.equal(balance.multiplierDenominator, canonical);\n assert.equal(await token.supportsUnit(\" \", 10), false);\n assert.throws(() => token.balanceOfUnit(address, \" \"));\n });\n});\ndescribe(\"IPFS gateway\", () => {\n it(\"resolves references and rejects unsupported schemes and traversal\", () => {\n const gateway = new IpfsGateway();\n for (const ref of [\n \"ipfs://QmExample/lab.json\",\n \"/ipfs/QmExample/lab.json\",\n \"QmExample/lab.json\",\n \"ipfs://ipfs/QmExample/lab.json\",\n ])\n assert.equal(gateway.resolve(ref).href, \"https://ipf.sk/QmExample/lab.json\");\n assert.equal(gateway.resolve(\"https://example.com/lab.json\").href, \"https://example.com/lab.json\");\n for (const ref of [\"\", \"file:///tmp/lab.json\", \"QmExample/../lab.json\"])\n assert.throws(() => gateway.resolve(ref));\n assert.throws(() => new IpfsGateway({ maxResponseBytes: 0 }));\n assert.throws(() => new IpfsGateway({ template: \"ftp://example.com/{cid}\" }));\n });\n it(\"bounds streamed bodies and cancels oversized responses\", async () => {\n let cancelled = false;\n const gateway = new IpfsGateway({\n maxResponseBytes: 4,\n fetch: async () => new Response(new ReadableStream({\n start(c) {\n c.enqueue(new Uint8Array(5));\n },\n cancel() {\n cancelled = true;\n },\n })),\n });\n await assert.rejects(gateway.readJson(\"QmExample\"), /exceeds/);\n assert.equal(cancelled, true);\n });\n it(\"rejects HTTP errors and invalid JSON\", async () => {\n await assert.rejects(new IpfsGateway({\n fetch: async () => new Response(\"no\", { status: 404 }),\n }).readJson(\"QmExample\"), /404/);\n await assert.rejects(new IpfsGateway({ fetch: async () => new Response(\"not json\") }).readJson(\"QmExample\"), SyntaxError);\n });\n it(\"aborts stalled requests\", async () => {\n const gateway = new IpfsGateway({\n timeoutMs: 5,\n fetch: async (_url, init) => new Promise((_resolve, reject) => init.signal.addEventListener(\"abort\", () => reject(new Error(\"aborted\")))),\n });\n await assert.rejects(gateway.readJson(\"QmExample\"), /aborted/);\n });\n});\n//# sourceMappingURL=test-cip.js.map"],"names":["Cip151Lifecycle","Cip152LabCertificate","Interface","cip150Abi","Cip150MetadataContract","IpfsGateway","customUnitAbi","CustomUnitToken"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,OAAO,GAAG,gDAAgD;AAChE,QAAQ,CAAC,+BAA+B,EAAE,MAAM;AAChD,IAAI,EAAE,CAAC,4DAA4D,EAAE,MAAM;AAC3E,QAAQ,MAAM,SAAS,GAAG,IAAIA,qBAAe,CAAC;AAC9C,YAAY,eAAe,EAAE,kBAAkB;AAC/C,YAAY,WAAW,EAAE,GAAG;AAC5B,SAAS,CAAC;AACV,QAAQ,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC;AACrE,QAAQ,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC;AACpE,QAAQ,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,C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IAAI,CAAC,CAAC;AACN,IAAI,EAAE,CAAC,sCAAsC,EAAE,YAAY;AAC3D,QAAQ,MAAM,MAAM,CAAC,OAAO,CAAC,IAAIA,mBAAW,CAAC;AAC7C,YAAY,KAAK,EAAE,YAAY,IAAI,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AAClE,SAAS,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC;AACxC,QAAQ,MAAM,MAAM,CAAC,OAAO,CAAC,IAAIA,mBAAW,CAAC,EAAE,KAAK,EAAE,YAAY,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;AACjI,IAAI,CAAC,CAAC;AACN,IAAI,EAAE,CAAC,yBAAyB,EAAE,YAAY;AAC9C,QAAQ,MAAM,OAAO,GAAG,IAAIA,mBAAW,CAAC;AACxC,YAAY,SAAS,EAAE,CAAC;AACxB,YAAY,KAAK,EAAE,OAAO,IAAI,EAAE,IAAI,KAAK,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrJ,SAAS,CAAC;AACV,QAAQ,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;AACtE,IAAI,CAAC,CAAC;AACN,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-contract.js b/lib.commonjs/_tests/test-contract.js index 829301e88..707d478b9 100644 --- a/lib.commonjs/_tests/test-contract.js +++ b/lib.commonjs/_tests/test-contract.js @@ -1,9 +1,51 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); -const corebc_js_1 = require("../corebc.js"); -const assert_1 = tslib_1.__importDefault(require("assert")); -const index_js_1 = require("../address/index.js"); +'use strict'; + +var index = require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +var signingKey$1 = require('../crypto/signing-key.js'); +require('../crypto/signature.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +require('../abi/abi-coder.js'); +require('../utils/base58.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../abi/fragments.js'); +var message = require('../hash/message.js'); +require('../hash/typed-data.js'); +var checks = require('../address/checks.js'); +require('../constants/numbers.js'); +require('../contract/contract.js'); +require('../providers/provider.js'); +var transaction$1 = require('../transaction/transaction.js'); +require('../providers/format.js'); +var defaultProvider = require('../providers/default-provider.js'); +require('../providers/provider-fallback.js'); +require('ws'); +require('net'); +var baseWallet$1 = require('../wallet/base-wallet.js'); +require('utf8'); +require('../wallet/json-keystore.js'); +require('../wallet/json-crowdsale.js'); +var wallet$1 = require('../wallet/wallet.js'); +require('../bigNumber/bigNumber.js'); +require('../wordlists/wordlists.js'); +var assert = require('assert'); + const TIMEOUT_PERIOD = 120000; const tesSignedTransaction = "0xf8ce800a830f423f0496ce276773ac97d16855a3c8faa45399136b56d419486081c880b8ab54bc60412c90c104a89865a43c33f335836bcb473f0cd477ecb2c82e6310676c87b708e3971d009b4a04e518f12454c3ee1aebc19a6b7df00076b834b692b7432611f3dafff0f422dfbae722ba4b989cfc82fee2e539fbbf21d652ea587df59e8421a3a8bc8ca2ba35033598954c54e10c00315484db568379ce94f9c894e3e6e4c7ee216676b713ca892d9b26746ae902a772e217a6a8bb493ce2bb313cf0cb66e76765d4c45ec6b68600"; const testWalletPhrase = "better artwork flavor fish solve deer orient spread adapt doll attack hour sort copper super income bacon engine skate ill similar wink crack club"; @@ -11,35 +53,34 @@ const testSeed = "ec372b08ffc451a5dd991c68006aa01a033a6a391e0e72d5690c13cff719fd const tesPrivateKey = "69bb68c3a00a0cd9cbf2cab316476228c758329bbfe0b1759e8634694a9497afea05bcbf24e2aa0627eac4240484bb71de646a9296872a3c0e"; const testAddress = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; const testPublicKey = "0x484ed765af56534f1c98c0f3ac9fb460fbf5c3cf582e54a6cdfc319986ce1bb875d3afcc9c336764348c96264dfeef9565364d7e8e14e9aa80"; -const provider = (0, corebc_js_1.getDefaultProvider)("https://xcbapi.corecoin.cc/"); -const mnemonicWallet = corebc_js_1.Wallet.fromPhrase({ +const provider = defaultProvider.getDefaultProvider(process.env.COREBC_RPC_URL || "https://xcbapi.corecoin.cc/"); +const mnemonicWallet = wallet$1.Wallet.fromPhrase({ phrase: testWalletPhrase, password: "111111", - prefix: (0, index_js_1.networkIdToPrefix)(3), + prefix: index.networkIdToPrefix(3), }); -const mnemonicWalletWithoutPassKey = corebc_js_1.Wallet.fromPhrase({ +const mnemonicWalletWithoutPassKey = wallet$1.Wallet.fromPhrase({ phrase: testWalletPhrase, - prefix: (0, index_js_1.networkIdToPrefix)(3), + prefix: index.networkIdToPrefix(3), }); -console.log(mnemonicWalletWithoutPassKey.publicKey); -const wallet = corebc_js_1.Wallet.fromSeed({ - prefix: (0, index_js_1.networkIdToPrefix)(3), +const wallet = wallet$1.Wallet.fromSeed({ + prefix: index.networkIdToPrefix(3), seed: testSeed, provider, }); -const seedWallet = corebc_js_1.Wallet.fromSeed({ - prefix: (0, index_js_1.networkIdToPrefix)(3), +const seedWallet = wallet$1.Wallet.fromSeed({ + prefix: index.networkIdToPrefix(3), seed: testSeed, }); -const signingKey = new corebc_js_1.SigningKey(tesPrivateKey); +const signingKey = new signingKey$1.SigningKey(tesPrivateKey); const baseWalletAddress = "0xab03a5fd22b9bee8b8ab877c86e0a2c21765e1d5bfc5"; -const baseWallet = new corebc_js_1.BaseWallet({ +const baseWallet = new baseWallet$1.BaseWallet({ signingKey, - prefix: (0, index_js_1.networkIdToPrefix)(3), + prefix: index.networkIdToPrefix(3), provider, }); -const randomWallet = corebc_js_1.Wallet.createRandom((0, index_js_1.networkIdToPrefix)(3), provider); -const transaction = corebc_js_1.Transaction.from({ +const randomWallet = wallet$1.Wallet.createRandom(index.networkIdToPrefix(3), provider); +const transaction = transaction$1.Transaction.from({ to: "0xce276773ac97d16855a3c8faa45399136b56d4194860", value: 200n, nonce: 0, @@ -48,39 +89,41 @@ const transaction = corebc_js_1.Transaction.from({ networkId: 4, }); describe("Test wallet creation", function () { + after(() => provider.destroy()); it("can generate a random wallet", function () { - assert_1.default.equal(randomWallet.mnemonic?.phrase.split(" ").length, 24, "mismatch in phrase length"); - assert_1.default.equal((0, corebc_js_1.isAddressable)(randomWallet), true, "random wallet is not addressable"); + assert.equal(mnemonicWalletWithoutPassKey.publicKey.length, 116); + assert.equal(randomWallet.mnemonic?.phrase.split(" ").length, 24, "mismatch in phrase length"); + assert.equal(checks.isAddressable(randomWallet), true, "random wallet is not addressable"); }); }); describe("Test getting data from blockchain and calling smart contract", function () { - it("can currectly sign a transaction", async function () { + it("can correctly sign a transaction", async function () { this.timeout(TIMEOUT_PERIOD); const tx = await baseWallet.signTransaction(transaction); - assert_1.default.equal(tx, tesSignedTransaction, "sign transaction failed"); + assert.equal(tx, tesSignedTransaction, "sign transaction failed"); }); - it("can currectly get signer from signed transaction", async function () { + it("can correctly get signer from signed transaction", async function () { this.timeout(TIMEOUT_PERIOD); - const message = "my message"; - const signedMessage = await baseWallet.signMessage(message); - const address = (0, corebc_js_1.verifyMessage)(message, signedMessage, (0, index_js_1.networkIdToPrefix)(3)); - assert_1.default.equal(address, baseWalletAddress, "get address from signed message failed"); + const message$1 = "my message"; + const signedMessage = await baseWallet.signMessage(message$1); + const address = message.verifyMessage(message$1, signedMessage, index.networkIdToPrefix(3)); + assert.equal(address, baseWalletAddress, "get address from signed message failed"); }); - it("can get feeData ", async function () { + (process.env.COREBC_RPC_URL ? it : it.skip)("can get fee data", async function () { this.timeout(TIMEOUT_PERIOD); const feeData = await provider.getFeeData(); - assert_1.default.equal(feeData.energyPrice, 1000000000n, "mismatch in expected energy price"); + assert.ok(feeData.energyPrice !== null && feeData.energyPrice >= 0n); }); it("can generate wallet", function () { - assert_1.default.equal(mnemonicWallet.address.length, 46, "mismatch in address length"); - assert_1.default.equal(mnemonicWallet.publicKey, testPublicKey, "mismatch in public key"); - assert_1.default.equal(mnemonicWallet.address, testAddress, "mismatch in generated address"); - assert_1.default.equal(seedWallet.address.length, 46, "mismatch in address length for seed wallet"); - assert_1.default.equal(seedWallet.publicKey, testPublicKey, "mismatch in public key for seed wallet"); - assert_1.default.equal(seedWallet.address, testAddress, "mismatch in seed length for seed wallet"); - assert_1.default.equal(wallet.address.length, 46, "mismatch in address length for wallet"); - assert_1.default.equal(wallet.publicKey, testPublicKey, "mismatch in public key for wallet"); - assert_1.default.equal(wallet.address, testAddress, "mismatch in seed length for wallet"); + assert.equal(mnemonicWallet.address.length, 46, "mismatch in address length"); + assert.equal(mnemonicWallet.publicKey, testPublicKey, "mismatch in public key"); + assert.equal(mnemonicWallet.address, testAddress, "mismatch in generated address"); + assert.equal(seedWallet.address.length, 46, "mismatch in address length for seed wallet"); + assert.equal(seedWallet.publicKey, testPublicKey, "mismatch in public key for seed wallet"); + assert.equal(seedWallet.address, testAddress, "mismatch in seed length for seed wallet"); + assert.equal(wallet.address.length, 46, "mismatch in address length for wallet"); + assert.equal(wallet.publicKey, testPublicKey, "mismatch in public key for wallet"); + assert.equal(wallet.address, testAddress, "mismatch in seed length for wallet"); }); }); -//# sourceMappingURL=test-contract.js.map \ No newline at end of file +//# sourceMappingURL=test-contract.js.map diff --git a/lib.commonjs/_tests/test-contract.js.map b/lib.commonjs/_tests/test-contract.js.map index 8ae061013..a04e0464d 100644 --- a/lib.commonjs/_tests/test-contract.js.map +++ b/lib.commonjs/_tests/test-contract.js.map @@ -1 +1 @@ -{"version":3,"file":"test-contract.js","sourceRoot":"","sources":["../../src.ts/_tests/test-contract.ts"],"names":[],"mappings":";;;AAAA,4CAQsB;AACtB,4DAA4B;AAC5B,kDAAwD;AAExD,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,oBAAoB,GACxB,oaAAoa,CAAC;AACva,MAAM,gBAAgB,GACpB,oJAAoJ,CAAC;AACvJ,MAAM,QAAQ,GACZ,kIAAkI,CAAC;AACrI,MAAM,aAAa,GACjB,oHAAoH,CAAC;AACvH,MAAM,WAAW,GAAG,gDAAgD,CAAC;AACrE,MAAM,aAAa,GACjB,sHAAsH,CAAC;AACzH,MAAM,QAAQ,GAAG,IAAA,8BAAkB,EAAC,6BAA6B,CAAC,CAAC;AAEnE,MAAM,cAAc,GAAG,kBAAM,CAAC,UAAU,CAAC;IACvC,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,IAAA,4BAAiB,EAAC,CAAC,CAAC;CAC7B,CAAC,CAAC;AACH,MAAM,4BAA4B,GAAG,kBAAM,CAAC,UAAU,CAAC;IACrD,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,IAAA,4BAAiB,EAAC,CAAC,CAAC;CAC7B,CAAC,CAAC;AACH,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,SAAS,CAAC,CAAC;AACpD,MAAM,MAAM,GAAG,kBAAM,CAAC,QAAQ,CAAC;IAC7B,MAAM,EAAE,IAAA,4BAAiB,EAAC,CAAC,CAAC;IAC5B,IAAI,EAAE,QAAQ;IACd,QAAQ;CACT,CAAC,CAAC;AACH,MAAM,UAAU,GAAG,kBAAM,CAAC,QAAQ,CAAC;IACjC,MAAM,EAAE,IAAA,4BAAiB,EAAC,CAAC,CAAC;IAC5B,IAAI,EAAE,QAAQ;CACf,CAAC,CAAC;AAEH,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AK,CACV,MAAM,CAAC,OAAO,CAAC,MAAM,EACrB,EAAE,EACF,uCAAuC,CACxC,CAAC;QACF,gBAAM,CAAC,KAAK,CACV,MAAM,CAAC,SAAS,EAChB,aAAa,EACb,mCAAmC,CACpC,CAAC;QACF,gBAAM,CAAC,KAAK,CACV,MAAM,CAAC,OAAO,EACd,WAAW,EACX,oCAAoC,CACrC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"test-contract.js","sources":["../../lib.esm/_tests/test-contract.js"],"sourcesContent":["import { getDefaultProvider, Wallet, Transaction, SigningKey, BaseWallet, verifyMessage, isAddressable, } from \"../corebc.js\";\nimport assert from \"assert\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst TIMEOUT_PERIOD = 120000;\nconst tesSignedTransaction = \"0xf8ce800a830f423f0496ce276773ac97d16855a3c8faa45399136b56d419486081c880b8ab54bc60412c90c104a89865a43c33f335836bcb473f0cd477ecb2c82e6310676c87b708e3971d009b4a04e518f12454c3ee1aebc19a6b7df00076b834b692b7432611f3dafff0f422dfbae722ba4b989cfc82fee2e539fbbf21d652ea587df59e8421a3a8bc8ca2ba35033598954c54e10c00315484db568379ce94f9c894e3e6e4c7ee216676b713ca892d9b26746ae902a772e217a6a8bb493ce2bb313cf0cb66e76765d4c45ec6b68600\";\nconst testWalletPhrase = \"better artwork flavor fish solve deer orient spread adapt doll attack hour sort copper super income bacon engine skate ill similar wink crack club\";\nconst testSeed = \"ec372b08ffc451a5dd991c68006aa01a033a6a391e0e72d5690c13cff719fdcb2502812dbf5f32a6df828cd22d77a36405bb15bb2637b7e77f99fa60f00d3560\";\nconst tesPrivateKey = \"69bb68c3a00a0cd9cbf2cab316476228c758329bbfe0b1759e8634694a9497afea05bcbf24e2aa0627eac4240484bb71de646a9296872a3c0e\";\nconst testAddress = \"0xab38254e30777140469a3aa168df81182d3d61f9843f\";\nconst testPublicKey = \"0x484ed765af56534f1c98c0f3ac9fb460fbf5c3cf582e54a6cdfc319986ce1bb875d3afcc9c336764348c96264dfeef9565364d7e8e14e9aa80\";\nconst provider = getDefaultProvider(process.env.COREBC_RPC_URL || \"https://xcbapi.corecoin.cc/\");\nconst mnemonicWallet = Wallet.fromPhrase({\n phrase: testWalletPhrase,\n password: \"111111\",\n prefix: networkIdToPrefix(3),\n});\nconst mnemonicWalletWithoutPassKey = Wallet.fromPhrase({\n phrase: testWalletPhrase,\n prefix: networkIdToPrefix(3),\n});\nconst wallet = Wallet.fromSeed({\n prefix: networkIdToPrefix(3),\n seed: testSeed,\n provider,\n});\nconst seedWallet = Wallet.fromSeed({\n prefix: networkIdToPrefix(3),\n seed: testSeed,\n});\nconst signingKey = new SigningKey(tesPrivateKey);\nconst baseWalletAddress = \"0xab03a5fd22b9bee8b8ab877c86e0a2c21765e1d5bfc5\";\nconst baseWallet = new BaseWallet({\n signingKey,\n prefix: networkIdToPrefix(3),\n provider,\n});\nconst randomWallet = Wallet.createRandom(networkIdToPrefix(3), provider);\nconst transaction = Transaction.from({\n to: \"0xce276773ac97d16855a3c8faa45399136b56d4194860\",\n value: 200n,\n nonce: 0,\n energyLimit: 999999n,\n energyPrice: 10n,\n networkId: 4,\n});\ndescribe(\"Test wallet creation\", function () {\n after(() => provider.destroy());\n it(\"can generate a random wallet\", function () {\n assert.equal(mnemonicWalletWithoutPassKey.publicKey.length, 116);\n assert.equal(randomWallet.mnemonic?.phrase.split(\" \").length, 24, \"mismatch in phrase length\");\n assert.equal(isAddressable(randomWallet), true, \"random wallet is not addressable\");\n });\n});\ndescribe(\"Test getting data from blockchain and calling smart contract\", function () {\n it(\"can correctly sign a transaction\", async function () {\n this.timeout(TIMEOUT_PERIOD);\n const tx = await baseWallet.signTransaction(transaction);\n assert.equal(tx, tesSignedTransaction, \"sign transaction failed\");\n });\n it(\"can correctly get signer from signed transaction\", async function () {\n this.timeout(TIMEOUT_PERIOD);\n const message = \"my message\";\n const signedMessage = await baseWallet.signMessage(message);\n const address = verifyMessage(message, signedMessage, networkIdToPrefix(3));\n assert.equal(address, baseWalletAddress, \"get address from signed message failed\");\n });\n (process.env.COREBC_RPC_URL ? it : it.skip)(\"can get fee data\", async function () {\n this.timeout(TIMEOUT_PERIOD);\n const feeData = await provider.getFeeData();\n assert.ok(feeData.energyPrice !== null && feeData.energyPrice >= 0n);\n });\n it(\"can generate wallet\", function () {\n assert.equal(mnemonicWallet.address.length, 46, \"mismatch in address length\");\n assert.equal(mnemonicWallet.publicKey, testPublicKey, \"mismatch in public key\");\n assert.equal(mnemonicWallet.address, testAddress, \"mismatch in generated address\");\n assert.equal(seedWallet.address.length, 46, \"mismatch in address length for seed wallet\");\n assert.equal(seedWallet.publicKey, testPublicKey, \"mismatch in public key for seed wallet\");\n assert.equal(seedWallet.address, testAddress, \"mismatch in seed length for seed wallet\");\n assert.equal(wallet.address.length, 46, \"mismatch in address length for wallet\");\n assert.equal(wallet.publicKey, testPublicKey, \"mismatch in public key for wallet\");\n assert.equal(wallet.address, testAddress, \"mismatch in seed length for wallet\");\n });\n});\n//# sourceMappingURL=test-contract.js.map"],"names":["getDefaultProvider","Wallet","networkIdToPrefix","SigningKey","BaseWallet","Transaction","isAddressable","message","verifyMessage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,cAAc,GAAG,MAAM;AAC7B,MAAM,oBAAoB,GAAG,oaAAoa;AACjc,MAAM,gBAAgB,GAAG,oJAAoJ;AAC7K,MAAM,QAAQ,GAAG,kIAAkI;AACnJ,MAAM,aAAa,GAAG,oHAAoH;AAC1I,MAAM,WAAW,GAAG,gDAAgD;AACpE,MAAM,aAAa,GAAG,sHAAsH;AAC5I,MAAM,QAAQ,GAAGA,kCAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,6BAA6B,CAAC;AAChG,MAAM,cAAc,GAAGC,eAAM,CAAC,UAAU,CAAC;AACzC,IAAI,MAAM,EAAE,gBAAgB;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/lib.commonjs/_tests/test-crypto.d.ts b/lib.commonjs/_tests/test-crypto.d.ts new file mode 100644 index 000000000..5e2048d9c --- /dev/null +++ b/lib.commonjs/_tests/test-crypto.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test-crypto.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/test-crypto.d.ts.map b/lib.commonjs/_tests/test-crypto.d.ts.map new file mode 100644 index 000000000..bac9d8b06 --- /dev/null +++ b/lib.commonjs/_tests/test-crypto.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test-crypto.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-crypto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-crypto.js b/lib.commonjs/_tests/test-crypto.js new file mode 100644 index 000000000..e2820e927 --- /dev/null +++ b/lib.commonjs/_tests/test-crypto.js @@ -0,0 +1,79 @@ +'use strict'; + +var assert = require('node:assert/strict'); +require('buffer'); +require('../address/index.js'); +require('../crypto/hmac.js'); +var ripemd160 = require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +var scrypt = require('../crypto/scrypt.js'); +var sha3 = require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +var keccak = require('../crypto/keccak.js'); +var signingKey = require('../crypto/signing-key.js'); +require('../crypto/signature.js'); +var data = require('../utils/data.js'); +require('../abi/abi-coder.js'); +require('../utils/base58.js'); +require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../abi/fragments.js'); +require('../constants/numbers.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +require('../contract/contract.js'); +require('../providers/provider.js'); +require('../providers/format.js'); +require('ws'); +require('../providers/provider-fallback.js'); +require('net'); +require('utf8'); +require('../wallet/json-keystore.js'); +require('../wallet/json-crowdsale.js'); +require('../bigNumber/bigNumber.js'); +require('../wordlists/wordlists.js'); +var cryptoBrowser = require('../crypto/crypto-browser.js'); + +describe("updated crypto dependencies", () => { + it("matches standard hash and scrypt vectors", async () => { + assert.equal(sha3.sha256("0x"), "0xa7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"); + assert.equal(ripemd160.ripemd160("0x"), "0x9c1185a5c5e9fc54612808977ee8f548b2258d31"); + assert.equal(keccak.keccak256("0x"), "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"); + const expected = "0x77d6576238657b203b19ca42c18a0497"; + assert.equal(scrypt.scryptSync("0x", "0x", 16, 1, 1, 16), expected); + assert.equal(await scrypt.scrypt("0x", "0x", 16, 1, 1, 16), expected); + assert.deepEqual(cryptoBrowser.createHash("sha256").update(new Uint8Array()).digest(), data.getBytes("0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")); + }); + it("copies byte private keys and validates lengths", () => { + const bytes = new Uint8Array(57).fill(1); + const key = new signingKey.SigningKey(bytes); + bytes.fill(2); + assert.equal(key.privateKey, "0x" + "01".repeat(57)); + for (const length of [0, 32, 56, 58]) + assert.throws(() => new signingKey.SigningKey(new Uint8Array(length))); + assert.throws(() => key.sign("0x00")); + }); + it("signs, rejects tampering and derives symmetric Ed448 secrets in both key modes", () => { + const a = new signingKey.SigningKey("01".repeat(57)); + const b = new signingKey.SigningKey("02".repeat(56) + "80"); + const digest = sha3.sha256("0x1234"); + for (const key of [a, b]) { + const sig = key.sign(digest); + assert.equal(signingKey.SigningKey.recoverPublicKey(digest, sig), key.publicKey); + assert.throws(() => signingKey.SigningKey.recoverPublicKey(sha3.sha256("0x1235"), sig)); + } + assert.equal(a.computeSharedSecret(b.publicKey), b.computeSharedSecret(a.publicKey)); + assert.equal(signingKey.SigningKey.addPoints(a.publicKey, b.publicKey), signingKey.SigningKey.addPoints(b.publicKey, a.publicKey)); + assert.throws(() => a.computeSharedSecret("0x00")); + }); +}); +//# sourceMappingURL=test-crypto.js.map diff --git a/lib.commonjs/_tests/test-crypto.js.map b/lib.commonjs/_tests/test-crypto.js.map new file mode 100644 index 000000000..85c046269 --- /dev/null +++ b/lib.commonjs/_tests/test-crypto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test-crypto.js","sources":["../../lib.esm/_tests/test-crypto.js"],"sourcesContent":["import assert from \"node:assert/strict\";\nimport { SigningKey, getBytes, sha256, ripemd160, scryptSync, scrypt, keccak256, } from \"../index.js\";\nimport { createHash } from \"../crypto/crypto-browser.js\";\ndescribe(\"updated crypto dependencies\", () => {\n it(\"matches standard hash and scrypt vectors\", async () => {\n assert.equal(sha256(\"0x\"), \"0xa7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a\");\n assert.equal(ripemd160(\"0x\"), \"0x9c1185a5c5e9fc54612808977ee8f548b2258d31\");\n assert.equal(keccak256(\"0x\"), \"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\");\n const expected = \"0x77d6576238657b203b19ca42c18a0497\";\n assert.equal(scryptSync(\"0x\", \"0x\", 16, 1, 1, 16), expected);\n assert.equal(await scrypt(\"0x\", \"0x\", 16, 1, 1, 16), expected);\n assert.deepEqual(createHash(\"sha256\").update(new Uint8Array()).digest(), getBytes(\"0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"));\n });\n it(\"copies byte private keys and validates lengths\", () => {\n const bytes = new Uint8Array(57).fill(1);\n const key = new SigningKey(bytes);\n bytes.fill(2);\n assert.equal(key.privateKey, \"0x\" + \"01\".repeat(57));\n for (const length of [0, 32, 56, 58])\n assert.throws(() => new SigningKey(new Uint8Array(length)));\n assert.throws(() => key.sign(\"0x00\"));\n });\n it(\"signs, rejects tampering and derives symmetric Ed448 secrets in both key modes\", () => {\n const a = new SigningKey(\"01\".repeat(57));\n const b = new SigningKey(\"02\".repeat(56) + \"80\");\n const digest = sha256(\"0x1234\");\n for (const key of [a, b]) {\n const sig = key.sign(digest);\n assert.equal(SigningKey.recoverPublicKey(digest, sig), key.publicKey);\n assert.throws(() => SigningKey.recoverPublicKey(sha256(\"0x1235\"), sig));\n }\n assert.equal(a.computeSharedSecret(b.publicKey), b.computeSharedSecret(a.publicKey));\n assert.equal(SigningKey.addPoints(a.publicKey, b.publicKey), SigningKey.addPoints(b.publicKey, a.publicKey));\n assert.throws(() => a.computeSharedSecret(\"0x00\"));\n });\n});\n//# sourceMappingURL=test-crypto.js.map"],"names":["sha256","ripemd160","keccak256","scryptSync","scrypt","createHash","getBytes","SigningKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,QAAQ,CAAC,6BAA6B,EAAE,MAAM;AAC9C,IAAI,EAAE,CAAC,0CAA0C,EAAE,YAAY;AAC/D,QAAQ,MAAM,CAAC,KAAK,CAACA,WAAM,CAAC,IAAI,CAAC,EAAE,oEAAoE,CAAC;AACxG,QAAQ,MAAM,CAAC,KAAK,CAACC,mBAAS,CAAC,IAAI,CAAC,EAAE,4CAA4C,CAAC;AACnF,QAAQ,MAAM,CAAC,KAAK,CAACC,gBAAS,CAAC,IAAI,CAAC,EAAE,oEAAoE,CAAC;AAC3G,QAAQ,MAAM,QAAQ,GAAG,oCAAoC;AAC7D,QAAQ,MAAM,CAAC,KAAK,CAACC,iBAAU,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC;AACpE,QAAQ,MAAM,CAAC,KAAK,CAAC,MAAMC,aAAM,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC;AACtE,QAAQ,MAAM,CAAC,SAAS,CAACC,wBAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,UAAU,EAA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AAK,CAACO,qBAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC;AACjF,YAAY,MAAM,CAAC,MAAM,CAAC,MAAMA,qBAAU,CAAC,gBAAgB,CAACP,WAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;AACnF,QAAQ;AACR,QAAQ,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAC5F,QAAQ,MAAM,CAAC,KAAK,CAACO,qBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EAAEA,qBAAU,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;AACpH,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;AAC1D,IAAI,CAAC,CAAC;AACN,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-keystore.d.ts b/lib.commonjs/_tests/test-keystore.d.ts new file mode 100644 index 000000000..c74023fe2 --- /dev/null +++ b/lib.commonjs/_tests/test-keystore.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test-keystore.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/test-keystore.d.ts.map b/lib.commonjs/_tests/test-keystore.d.ts.map new file mode 100644 index 000000000..f298fe780 --- /dev/null +++ b/lib.commonjs/_tests/test-keystore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-keystore.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-keystore.js b/lib.commonjs/_tests/test-keystore.js new file mode 100644 index 000000000..005b82f35 --- /dev/null +++ b/lib.commonjs/_tests/test-keystore.js @@ -0,0 +1,82 @@ +'use strict'; + +var assert = require('node:assert/strict'); +require('buffer'); +var index = require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../crypto/signature.js'); +require('../abi/abi-coder.js'); +require('../abi/fragments.js'); +require('../constants/numbers.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +require('../contract/contract.js'); +require('../providers/provider.js'); +require('../providers/format.js'); +require('ws'); +require('../providers/provider-fallback.js'); +require('net'); +require('utf8'); +var jsonKeystore = require('../wallet/json-keystore.js'); +require('../wallet/json-crowdsale.js'); +var wallet = require('../wallet/wallet.js'); +require('../bigNumber/bigNumber.js'); +require('../wordlists/wordlists.js'); + +describe("AES keystores", () => { + const wallet$1 = wallet.Wallet.fromSeed({ + seed: "01".repeat(64), + prefix: index.networkIdToPrefix(3), + }); + const account = { address: wallet$1.address, privateKey: wallet$1.privateKey }; + const options = { scrypt: { N: 16, r: 1, p: 1 } }; + it("round-trips Ed448 keys with sync and async encryption", async () => { + for (const json of [ + jsonKeystore.encryptKeystoreJsonSync(account, "test", options), + await jsonKeystore.encryptKeystoreJson(account, "test", options), + ]) { + assert.deepEqual(jsonKeystore.decryptKeystoreJsonSync(json, "test"), account); + assert.deepEqual(await jsonKeystore.decryptKeystoreJson(json, "test"), account); + assert.throws(() => jsonKeystore.decryptKeystoreJsonSync(json, "wrong"), /incorrect password/); + const changed = JSON.parse(json); + changed.Crypto.mac = "00".repeat(32); + await assert.rejects(jsonKeystore.decryptKeystoreJson(JSON.stringify(changed), "test"), /incorrect password/); + } + }); + it("rejects unsafe KDF parameters before allocating work", () => { + for (const scrypt of [ + { N: 0 }, + { N: 1 }, + { N: 2 ** 32 }, + { r: 0 }, + { p: 2 ** 30 }, + { N: 1048576, r: 8 }, + ]) + assert.throws(() => jsonKeystore.encryptKeystoreJsonSync(account, "test", { scrypt }), /unsafe/); + const data = JSON.parse(jsonKeystore.encryptKeystoreJsonSync(account, "test", options)); + data.Crypto.kdfparams.n = 2 ** 32; + assert.throws(() => jsonKeystore.decryptKeystoreJsonSync(JSON.stringify(data), "test"), /unsafe/); + data.Crypto.kdf = "pbkdf2"; + Object.assign(data.Crypto.kdfparams, { c: 10000001, prf: "hmac-sha256" }); + assert.throws(() => jsonKeystore.decryptKeystoreJsonSync(JSON.stringify(data), "test"), /unsafe/); + }); +}); +//# sourceMappingURL=test-keystore.js.map diff --git a/lib.commonjs/_tests/test-keystore.js.map b/lib.commonjs/_tests/test-keystore.js.map new file mode 100644 index 000000000..1d0bcbffb --- /dev/null +++ b/lib.commonjs/_tests/test-keystore.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test-keystore.js","sources":["../../lib.esm/_tests/test-keystore.js"],"sourcesContent":["import assert from \"node:assert/strict\";\nimport { Wallet, networkIdToPrefix, encryptKeystoreJsonSync, encryptKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, } from \"../index.js\";\ndescribe(\"AES keystores\", () => {\n const wallet = Wallet.fromSeed({\n seed: \"01\".repeat(64),\n prefix: networkIdToPrefix(3),\n });\n const account = { address: wallet.address, privateKey: wallet.privateKey };\n const options = { scrypt: { N: 16, r: 1, p: 1 } };\n it(\"round-trips Ed448 keys with sync and async encryption\", async () => {\n for (const json of [\n encryptKeystoreJsonSync(account, \"test\", options),\n await encryptKeystoreJson(account, \"test\", options),\n ]) {\n assert.deepEqual(decryptKeystoreJsonSync(json, \"test\"), account);\n assert.deepEqual(await decryptKeystoreJson(json, \"test\"), account);\n assert.throws(() => decryptKeystoreJsonSync(json, \"wrong\"), /incorrect password/);\n const changed = JSON.parse(json);\n changed.Crypto.mac = \"00\".repeat(32);\n await assert.rejects(decryptKeystoreJson(JSON.stringify(changed), \"test\"), /incorrect password/);\n }\n });\n it(\"rejects unsafe KDF parameters before allocating work\", () => {\n for (const scrypt of [\n { N: 0 },\n { N: 1 },\n { N: 2 ** 32 },\n { r: 0 },\n { p: 2 ** 30 },\n { N: 1048576, r: 8 },\n ])\n assert.throws(() => encryptKeystoreJsonSync(account, \"test\", { scrypt }), /unsafe/);\n const data = JSON.parse(encryptKeystoreJsonSync(account, \"test\", options));\n data.Crypto.kdfparams.n = 2 ** 32;\n assert.throws(() => decryptKeystoreJsonSync(JSON.stringify(data), \"test\"), /unsafe/);\n data.Crypto.kdf = \"pbkdf2\";\n Object.assign(data.Crypto.kdfparams, { c: 10000001, prf: \"hmac-sha256\" });\n assert.throws(() => decryptKeystoreJsonSync(JSON.stringify(data), \"test\"), /unsafe/);\n });\n});\n//# sourceMappingURL=test-keystore.js.map"],"names":["wallet","Wallet","networkIdToPrefix","encryptKeystoreJsonSync","encryptKeystoreJson","decryptKeystoreJsonSync","decryptKeystoreJson"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,QAAQ,CAAC,eAAe,EAAE,MAAM;AAChC,IAAI,MAAMA,QAAM,GAAGC,aAAM,CAAC,QAAQ,CAAC;AACnC,QAAQ,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;AAC7B,QAAQ,MAAM,EAAEC,uBAAiB,CAAC,CAAC,CAAC;AACpC,KAAK,CAAC;AACN,IAAI,MAAM,OAAO,GAAG,EAAE,OAAO,EAAEF,QAAM,CAAC,OAAO,EAAE,UAAU,EAAEA,QAAM,CAAC,UAAU,EAAE;AAC9E,IAAI,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,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Y,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE;AAChC,SAAS;AACT,YAAY,MAAM,CAAC,MAAM,CAAC,MAAMH,oCAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,CAAC;AAC/F,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAACA,oCAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAClF,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE;AACzC,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAME,oCAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC;AAC5F,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,QAAQ;AAClC,QAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC;AACjF,QAAQ,MAAM,CAAC,MAAM,CAAC,MAAMA,oCAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC;AAC5F,IAAI,CAAC,CAAC;AACN,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/_tests/types.d.ts.map b/lib.commonjs/_tests/types.d.ts.map index 6619a1cf6..db09709f7 100644 --- a/lib.commonjs/_tests/types.d.ts.map +++ b/lib.commonjs/_tests/types.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B;IACE,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpD,KAAK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,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB"} \ No newline at end of file +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC3B;IACA,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpD,KAAK,EAAE,MAAM,CAAC;CACb,GACD;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CACd,GACD;IACA,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;CAChC,GACD;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;CAChC,CAAC;AAEL,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CAChB;AAKD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;QACd,IAAI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MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CAChB;AAKD,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB"} \ No newline at end of file diff --git a/lib.commonjs/_tests/types.js b/lib.commonjs/_tests/types.js index 11e638d1e..ed5ab0fb8 100644 --- a/lib.commonjs/_tests/types.js +++ b/lib.commonjs/_tests/types.js @@ -1,3 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file +'use strict'; + +//# sourceMappingURL=types.js.map diff --git a/lib.commonjs/_tests/types.js.map b/lib.commonjs/_tests/types.js.map index 52b4d3276..705032fd5 100644 --- a/lib.commonjs/_tests/types.js.map +++ b/lib.commonjs/_tests/types.js.map @@ -1 +1 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src.ts/_tests/types.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/_version.d.ts b/lib.commonjs/_version.d.ts index ab655b4ad..515a07b59 100644 --- a/lib.commonjs/_version.d.ts +++ b/lib.commonjs/_version.d.ts @@ -1,5 +1,3 @@ -/** - * The current version of corebc. - */ +/** The current version of corebc; keep in sync with package.json. */ export declare const version: string; //# sourceMappingURL=_version.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_version.d.ts.map b/lib.commonjs/_version.d.ts.map index 502b731b4..99992181e 100644 --- a/lib.commonjs/_version.d.ts.map +++ b/lib.commonjs/_version.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/_version.js b/lib.commonjs/_version.js index 62023dc8c..907326743 100644 --- a/lib.commonjs/_version.js +++ b/lib.commonjs/_version.js @@ -1,9 +1,7 @@ -"use strict"; -/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.version = void 0; -/** - * The current version of corebc. - */ -exports.version = "6.4.0"; -//# sourceMappingURL=_version.js.map \ No newline at end of file +'use strict'; + +/** The current version of corebc; keep in sync with package.json. */ +const version = "0.4.1"; + +exports.version = version; +//# sourceMappingURL=_version.js.map diff --git a/lib.commonjs/_version.js.map b/lib.commonjs/_version.js.map index 895e9da44..d21e86ccc 100644 --- a/lib.commonjs/_version.js.map +++ b/lib.commonjs/_version.js.map @@ -1 +1 @@ -{"version":3,"file":"_version.js","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":";AAAA,mEAAmE;;;AAEnE;;GAEG;AACU,QAAA,OAAO,GAAW,OAAO,CAAC"} \ No newline at end of file +{"version":3,"file":"_version.js","sources":["../lib.esm/_version.js"],"sourcesContent":["/** The current version of corebc; keep in sync with package.json. */\nexport const version = \"0.4.1\";\n//# sourceMappingURL=_version.js.map"],"names":[],"mappings":";;AAAA;AACY,MAAC,OAAO,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes.d.ts.map b/lib.commonjs/abi-types/Tes.d.ts.map index 04a5ce028..0c7f7bc42 100644 --- a/lib.commonjs/abi-types/Tes.d.ts.map +++ b/lib.commonjs/abi-types/Tes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACT,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,WAAW,CACT,eAAe,EACX,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,2CAA2C,GAC3C,iDAAiD,GACjD,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,cAAc,GACjB,gBAAgB,CAAC;IAEpB,QAAQ,CACN,sBAAsB,EAAE,UAAU,GAAG,gBAAgB,GAAG,UAAU,GACjE,aAAa,CAAC;IAEjB,kBAAkB,CAChB,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,CAAC,W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,kBAAkB,CACrD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC1B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;KACH,CAAC;CACH"} \ No newline at end of file +{"version":3,"file":"Tes.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC9C,WAAW,CACV,eAAe,EACZ,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,2CAA2C,GAC3C,iDAAiD,GACjD,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,cAAc,GACf,gBAAgB,CAAC;IAEpB,QAAQ,CACP,sBAAsB,EAAE,UAAU,GAAG,gBAAgB,GAAG,UAAU,GAChE,aAAa,CAAC;IAEjB,kBAAkB,CACjB,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,GACjC,MAAM,CAAC;IACV,kBAAkB,CACjB,gBAAgB,EAAE,WAAW,EAC7B,MAAM,EAAE,CAAC,WAAW,CAAC,GACnB,MAAM,CAAC;IACV,kBAAkB,CACjB,gBAAgB,EAAE,cAAc,EAChC,MAAM,EAAE,CAAC,YAAY,EAAE,CAAC,GACtB,MA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;CACF"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes.js b/lib.commonjs/abi-types/Tes.js index 9219b6545..d772fc638 100644 --- a/lib.commonjs/abi-types/Tes.js +++ b/lib.commonjs/abi-types/Tes.js @@ -1,3 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=Tes.js.map \ No newline at end of file +'use strict'; + +//# sourceMappingURL=Tes.js.map diff --git a/lib.commonjs/abi-types/Tes.js.map b/lib.commonjs/abi-types/Tes.js.map index af1f5205d..6a77541be 100644 --- a/lib.commonjs/abi-types/Tes.js.map +++ b/lib.commonjs/abi-types/Tes.js.map @@ -1 +1 @@ -{"version":3,"file":"Tes.js","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"Tes.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes_abi.d.ts.map b/lib.commonjs/abi-types/Tes_abi.d.ts.map index 4d5fd9d95..152cbb189 100644 --- a/lib.commonjs/abi-types/Tes_abi.d.ts.map +++ b/lib.commonjs/abi-types/Tes_abi.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes_abi.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACT,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,WAAW,CACT,eAAe,EACX,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAA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AAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACxD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CACjC,CAAC;QACF,cAAc,EAAE,kBAAkB,CAChC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CACjC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACrD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC1B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;KACH,CAAC;CACH"} \ No newline at end of file +{"version":3,"file":"Tes_abi.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IAClD,WAAW,CACV,eAAe,EACZ,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,2CAA2C,GAC3C,iDAAiD,GACjD,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,cAAc,GACf,gBAAgB,CAAC;IAEpB,QAAQ,CACP,sBAAsB,EAAE,UAAU,GAAG,gBAAgB,GAAG,U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BAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes_abi.js b/lib.commonjs/abi-types/Tes_abi.js index bf10fc829..e632cd515 100644 --- a/lib.commonjs/abi-types/Tes_abi.js +++ b/lib.commonjs/abi-types/Tes_abi.js @@ -1,3 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=Tes_abi.js.map \ No newline at end of file +'use strict'; + +//# sourceMappingURL=Tes_abi.js.map diff --git a/lib.commonjs/abi-types/Tes_abi.js.map b/lib.commonjs/abi-types/Tes_abi.js.map index 062e82f0f..21e338269 100644 --- a/lib.commonjs/abi-types/Tes_abi.js.map +++ b/lib.commonjs/abi-types/Tes_abi.js.map @@ -1 +1 @@ -{"version":3,"file":"Tes_abi.js","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"Tes_abi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/common.d.ts.map b/lib.commonjs/abi-types/common.d.ts.map index 1d45da294..b7d6fe89d 100644 --- a/lib.commonjs/abi-types/common.d.ts.map +++ b/lib.commonjs/abi-types/common.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/common.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,aAAa,EAC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AAC,GAAG,GAAG,EACP,CAAC,SAAS,eAAe,GAAG,SAAS;IAErC,CACC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/B,CAAC,SAAS,MAAM,GAChB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAExC,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,gBAAgB,CAAC;IAE3B,WAAW,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,gBAAgB,CAAC;IAEjE,mBAAmB,CAClB,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,UAAU,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,IAAI,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC9E,WAAW,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,gBAAgB,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChE"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/common.js b/lib.commonjs/abi-types/common.js index 023264ffe..0b4dbc6ce 100644 --- a/lib.commonjs/abi-types/common.js +++ b/lib.commonjs/abi-types/common.js @@ -1,3 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=common.js.map \ No newline at end of file +'use strict'; + +//# sourceMappingURL=common.js.map diff --git a/lib.commonjs/abi-types/common.js.map b/lib.commonjs/abi-types/common.js.map index a8598baee..8d07aa7a3 100644 --- a/lib.commonjs/abi-types/common.js.map +++ b/lib.commonjs/abi-types/common.js.map @@ -1 +1 @@ -{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src.ts/abi-types/common.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"common.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes__factory.d.ts.map b/lib.commonjs/abi-types/factories/Tes__factory.d.ts.map index 9c0f56a13..262b59a93 100644 --- a/lib.commonjs/abi-types/factories/Tes__factory.d.ts.map +++ b/lib.commonjs/abi-types/factories/Tes__factory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuWnD,qBAAa,YAAY;IACvB,MAAM,CAAC,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAQ;IAC3B,MAAM,CAAC,eAAe,IAAI,YAAY;IAGtC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,GAAG;CAGrE"} \ No newline at end of file +{"version":3,"file":"Tes__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuWnD,qBAAa,YAAY;IACxB,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,MAAM;qBACpB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,MAAM;;uBAGR,gBAAgB;uBAChB,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;qBAKX,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV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BACb,IAAI,EAAE,SAAS;;uBAGX,qBAAqB;;qBAGzB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;uBAIV,aAAa;;qBAGjB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,cAAc;;kCAEH,YAAY;uBACvB,UAAU;OAKU;IAC3B,MAAM,CAAC,eAAe,IAAI,YAAY,CAErC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,GAAG,CAEnE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes__factory.js b/lib.commonjs/abi-types/factories/Tes__factory.js index fd589bb96..5a723f0aa 100644 --- a/lib.commonjs/abi-types/factories/Tes__factory.js +++ b/lib.commonjs/abi-types/factories/Tes__factory.js @@ -1,10 +1,48 @@ -"use strict"; +'use strict'; + +require('../../address/index.js'); +require('../../crypto/hmac.js'); +require('../../crypto/ripemd160.js'); +require('../../crypto/pbkdf2.js'); +require('../../crypto/random.js'); +require('../../crypto/scrypt.js'); +require('../../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../../crypto/keccak.js'); +require('../../utils/base58.js'); +require('../../logger/logger.js'); +require('../../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../../utils/fixednumber.js'); +require('../../utils/maths.js'); +require('../../crypto/signature.js'); +require('../../abi/abi-coder.js'); +require('../../abi/fragments.js'); +var _interface = require('../../abi/interface.js'); +require('../../constants/numbers.js'); +var contract = require('../../contract/contract.js'); +require('../../providers/provider.js'); +require('../../transaction/transaction.js'); +require('../../hash/typed-data.js'); +require('../../providers/format.js'); +require('ws'); +require('../../providers/provider-fallback.js'); +require('net'); +require('utf8'); +require('../../wallet/json-keystore.js'); +require('../../wallet/json-crowdsale.js'); +require('../../bigNumber/bigNumber.js'); +require('../../wordlists/wordlists.js'); + /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Tes__factory = void 0; -const corebc_js_1 = require("../../corebc.js"); const _abi = [ { anonymous: false, @@ -364,11 +402,12 @@ const _abi = [ class Tes__factory { static abi = _abi; static createInterface() { - return new corebc_js_1.Interface(_abi); + return new _interface.Interface(_abi); } static connect(address, runner) { - return new corebc_js_1.Contract(address, _abi, runner); + return new contract.Contract(address, _abi, runner); } } + exports.Tes__factory = Tes__factory; -//# sourceMappingURL=Tes__factory.js.map \ No newline at end of file +//# sourceMappingURL=Tes__factory.js.map diff --git a/lib.commonjs/abi-types/factories/Tes__factory.js.map b/lib.commonjs/abi-types/factories/Tes__factory.js.map index 7092d2c05..b862fb40d 100644 --- a/lib.commonjs/abi-types/factories/Tes__factory.js.map +++ b/lib.commonjs/abi-types/factories/Tes__factory.js.map @@ -1 +1 @@ -{"version":3,"file":"Tes__factory.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;;;AAEpB,+CAAsE;AAGtE,MAAM,IAAI,GAAG;IACX;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAA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AAE,SAAS;gBACvB,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,SAAS;aAChB;SACF;QACD,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE;YACP;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,SAAS;aAChB;SACF;QACD,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;CACO,CAAC;AAEX,MAAa,YAAY;IACvB,MAAM,CAAU,GAAG,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,eAAe;QACpB,OAAO,IAAI,qBAAS,CAAC,IAAI,CAAiB,CAAC;IAC7C,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,MAA8B;QAC5D,OAAO,IAAI,oBAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAmB,CAAC;IAC/D,CAAC;;AAPH,oCAQC"} \ No newline at end of file +{"version":3,"file":"Tes__factory.js","sources":["../../../lib.esm/abi-types/factories/Tes__factory.js"],"sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, Interface } from \"../../corebc.js\";\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 inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\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: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"batchOwnerOf\",\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: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\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: \"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 {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\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: \"\",\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: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenByIndex\",\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: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenOfOwnerByIndex\",\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: \"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: \"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];\nexport class Tes__factory {\n static abi = _abi;\n static createInterface() {\n return new Interface(_abi);\n }\n static connect(address, runner) {\n return new Contract(address, _abi, runner);\n }\n}\n//# sourceMappingURL=Tes__factory.js.map"],"names":["Interface","Contract"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA,MAAM,IAAI,GAAG;AACb,IAAI;AACJ,QAAQ,SAAS,EAAE,KAAK;AACxB,QAAQ,MAAM,EAAE;AAChB,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,OAAO;AAC7B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAg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BAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,EAAE;AACxB,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,SAAS;AACT,QAAQ,eAAe,EAAE,MAAM;AAC/B,QAAQ,IAAI,EAAE,UAAU;AACxB,KAAK;AACL,IAAI;AACJ,QAAQ,MAAM,EAAE;AAChB,YAAY;AACZ,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,MAAM;AAC5B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,YAAY;AACZ,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,IAAI;AAC1B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,YAAY;AACZ,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,SAAS;AAC/B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,SAAS;AACT,QAAQ,IAAI,EAAE,cAAc;AAC5B,QAAQ,OAAO,EAAE,EAAE;AACnB,QAAQ,eAAe,EAAE,YAAY;AACrC,QAAQ,IAAI,EAAE,UAAU;AACxB,KAAK;AACL,CAAC;AACM,MAAM,YAAY,CAAC;AAC1B,IAAI,OAAO,GAAG,GAAG,IAAI;AACrB,IAAI,OAAO,eAAe,GAAG;AAC7B,QAAQ,OAAO,IAAIA,oBAAS,CAAC,IAAI,CAAC;AAClC,IAAI;AACJ,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE;AACpC,QAAQ,OAAO,IAAIC,iBAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC;AAClD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts.map b/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts.map index 5abc35679..530a4f795 100644 --- a/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts.map +++ b/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes_abi__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuW/D,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAQ;IAC3B,MAAM,CAAC,eAAe,IAAI,gBAAgB;IAG1C,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO;CAGzE"} \ No newline at end of file +{"version":3,"file":"Tes_abi__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuW/D,qBAAa,gBAAgB;IAC5B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;q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;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,cAAc;;kCAEH,YAAY;uBACvB,UAAU;OAKU;IAC3B,MAAM,CAAC,eAAe,IAAI,gBAAgB,CAEzC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAEvE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes_abi__factory.js b/lib.commonjs/abi-types/factories/Tes_abi__factory.js index 448c01fbe..fb1a9a85d 100644 --- a/lib.commonjs/abi-types/factories/Tes_abi__factory.js +++ b/lib.commonjs/abi-types/factories/Tes_abi__factory.js @@ -1,10 +1,48 @@ -"use strict"; +'use strict'; + +require('../../address/index.js'); +require('../../crypto/hmac.js'); +require('../../crypto/ripemd160.js'); +require('../../crypto/pbkdf2.js'); +require('../../crypto/random.js'); +require('../../crypto/scrypt.js'); +require('../../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../../crypto/keccak.js'); +require('../../utils/base58.js'); +require('../../logger/logger.js'); +require('../../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../../utils/fixednumber.js'); +require('../../utils/maths.js'); +require('../../crypto/signature.js'); +require('../../abi/abi-coder.js'); +require('../../abi/fragments.js'); +var _interface = require('../../abi/interface.js'); +require('../../constants/numbers.js'); +var contract = require('../../contract/contract.js'); +require('../../providers/provider.js'); +require('../../transaction/transaction.js'); +require('../../hash/typed-data.js'); +require('../../providers/format.js'); +require('ws'); +require('../../providers/provider-fallback.js'); +require('net'); +require('utf8'); +require('../../wallet/json-keystore.js'); +require('../../wallet/json-crowdsale.js'); +require('../../bigNumber/bigNumber.js'); +require('../../wordlists/wordlists.js'); + /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Tes_abi__factory = void 0; -const corebc_js_1 = require("../../corebc.js"); const _abi = [ { anonymous: false, @@ -364,11 +402,12 @@ const _abi = [ class Tes_abi__factory { static abi = _abi; static createInterface() { - return new corebc_js_1.Interface(_abi); + return new _interface.Interface(_abi); } static connect(address, runner) { - return new corebc_js_1.Contract(address, _abi, runner); + return new contract.Contract(address, _abi, runner); } } + exports.Tes_abi__factory = Tes_abi__factory; -//# sourceMappingURL=Tes_abi__factory.js.map \ No newline at end of file +//# sourceMappingURL=Tes_abi__factory.js.map diff --git a/lib.commonjs/abi-types/factories/Tes_abi__factory.js.map b/lib.commonjs/abi-types/factories/Tes_abi__factory.js.map index 30434e166..221f43ffd 100644 --- a/lib.commonjs/abi-types/factories/Tes_abi__factory.js.map +++ b/lib.commonjs/abi-types/factories/Tes_abi__factory.js.map @@ -1 +1 @@ -{"version":3,"file":"Tes_abi__factory.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;;;AAEpB,+CAAsE;AAGtE,MAAM,IAAI,GAAG;IACX;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACd;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;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ACN;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;CACO,CAAC;AAEX,MAAa,gBAAgB;IAC3B,MAAM,CAAU,GAAG,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,eAAe;QACpB,OAAO,IAAI,qBAAS,CAAC,IAAI,CAAqB,CAAC;IACjD,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,MAA8B;QAC5D,OAAO,IAAI,oBAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAuB,CAAC;IACnE,CAAC;;AAPH,4CAQC"} \ No newline at end of file +{"version":3,"file":"Tes_abi__factory.js","sources":["../../../lib.esm/abi-types/factories/Tes_abi__factory.js"],"sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, Interface } from \"../../corebc.js\";\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 inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\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: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"batchOwnerOf\",\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: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\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: \"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 {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\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: \"\",\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: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenByIndex\",\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: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenOfOwnerByIndex\",\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: \"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: \"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];\nexport class Tes_abi__factory {\n static abi = _abi;\n static createInterface() {\n return new Interface(_abi);\n }\n static connect(address, runner) {\n return new Contract(address, _abi, runner);\n }\n}\n//# sourceMappingURL=Tes_abi__factory.js.map"],"names":["Interface","Contract"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA,MAAM,IAAI,GAAG;AACb,IAAI;AACJ,QAAQ,SAAS,EAAE,KAAK;AACxB,QAAQ,MAAM,EAAE;AAChB,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,OAAO;AAC7B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,UAAU;AAChC,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,SAAS;AAC/B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,SAAS;AACT,QAAQ,IAAI,EAAE,UAAU;AACxB,QAAQ,IAAI,EAAE,OAAO;AACrB,KAAK;AAC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,aAAa;AACb,YAAY;AACZ,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,IAAI;AAC1B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,YAAY;AACZ,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,SAAS;AAC/B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,SAAS;AACT,QAAQ,IAAI,EAAE,cAAc;AAC5B,QAAQ,OAAO,EAAE,EAAE;AACnB,QAAQ,eAAe,EAAE,YAAY;AACrC,QAAQ,IAAI,EAAE,UAAU;AACxB,KAAK;AACL,CAAC;AACM,MAAM,gBAAgB,CAAC;AAC9B,IAAI,OAAO,GAAG,GAAG,IAAI;AACrB,IAAI,OAAO,eAAe,GAAG;AAC7B,QAAQ,OAAO,IAAIA,oBAAS,CAAC,IAAI,CAAC;AAClC,IAAI;AACJ,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE;AACpC,QAAQ,OAAO,IAAIC,iBAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC;AAClD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/index.js b/lib.commonjs/abi-types/factories/index.js index 82be5be94..15790ca2d 100644 --- a/lib.commonjs/abi-types/factories/index.js +++ b/lib.commonjs/abi-types/factories/index.js @@ -1,9 +1,10 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Tes__factory = void 0; +'use strict'; + +var Tes__factory = require('./Tes__factory.js'); + /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ -var Tes__factory_js_1 = require("./Tes__factory.js"); -Object.defineProperty(exports, "Tes__factory", { enumerable: true, get: function () { return Tes__factory_js_1.Tes__factory; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file + +exports.Tes__factory = Tes__factory.Tes__factory; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/abi-types/factories/index.js.map b/lib.commonjs/abi-types/factories/index.js.map index 7750b2c8c..c7dc844a2 100644 --- a/lib.commonjs/abi-types/factories/index.js.map +++ b/lib.commonjs/abi-types/factories/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/index.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AACpB,qDAAiD;AAAxC,+GAAA,YAAY,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../../../lib.esm/abi-types/factories/index.js"],"sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nexport { Tes__factory } from \"./Tes__factory.js\";\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/index.js b/lib.commonjs/abi-types/index.js index c92186878..49e690ca7 100644 --- a/lib.commonjs/abi-types/index.js +++ b/lib.commonjs/abi-types/index.js @@ -1,8 +1,10 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Tes__factory = exports.factories = void 0; -const tslib_1 = require("tslib"); -exports.factories = tslib_1.__importStar(require("./factories/index.js")); -var Tes__factory_js_1 = require("./factories/Tes__factory.js"); -Object.defineProperty(exports, "Tes__factory", { enumerable: true, get: function () { return Tes__factory_js_1.Tes__factory; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var index = require('./factories/index.js'); +var Tes__factory = require('./factories/Tes__factory.js'); + + + +exports.factories = index; +exports.Tes__factory = Tes__factory.Tes__factory; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/abi-types/index.js.map b/lib.commonjs/abi-types/index.js.map index c8cd9951c..129665d24 100644 --- a/lib.commonjs/abi-types/index.js.map +++ b/lib.commonjs/abi-types/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/abi-types/index.ts"],"names":[],"mappings":";;;;AAIA,0EAAkD;AAClD,+DAA2D;AAAlD,+GAAA,YAAY,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/abi-coder.d.ts.map b/lib.commonjs/abi/abi-coder.d.ts.map index a86e1aca8..ad04d5ac9 100644 --- a/lib.commonjs/abi/abi-coder.d.ts.map +++ b/lib.commonjs/abi/abi-coder.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AA8F3B;;GAEG;AACH,qBAAa,QAAQ;;IA2DnB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM;IAQjE;;;;OAIG;IACH,MAAM,CACJ,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACzB,MAAM;IAeT;;;;;;OAMG;IACH,MAAM,CACJ,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,OAAO,GACd,MAAM;IAQT;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ;IAOlC;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC5B,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/D,IAAI,EAAE,IAAI,GAAG,SAAS,GACrB,kBAAkB;CAQtB"} \ No newline at end of file +{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACX,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAElB,MAAM,mBAAmB,CAAC;AA8F3B;;GAEG;AACH,qBAAa,QAAQ;;IA2DpB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAMhE;IAED;;;;OAIG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;IAED;;;;;;OAMG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,OAAO,GACb,MAAM,CAMR;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ,CAKjC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/D,IAAI,EAAE,IAAI,GAAG,SAAS,GACpB,kBAAkB,CAOpB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/abi-coder.js b/lib.commonjs/abi/abi-coder.js index 5da77fe8b..3981c8d77 100644 --- a/lib.commonjs/abi/abi-coder.js +++ b/lib.commonjs/abi/abi-coder.js @@ -1,4 +1,27 @@ -"use strict"; +'use strict'; + +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var abstractCoder = require('./coders/abstract-coder.js'); +var address = require('./coders/address.js'); +var array = require('./coders/array.js'); +var boolean = require('./coders/boolean.js'); +var bytes = require('./coders/bytes.js'); +var fixedBytes = require('./coders/fixed-bytes.js'); +var _null = require('./coders/null.js'); +var number = require('./coders/number.js'); +var string = require('./coders/string.js'); +var tuple = require('./coders/tuple.js'); +var fragments = require('./fragments.js'); +var index = require('../address/index.js'); + /** * When sending values to or receiving values from a [[Contract]], the * data is generally encoded using the [ABI standard](link-solc-abi). @@ -11,22 +34,6 @@ * * @_section api/abi/abi-coder:ABI Encoding */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AbiCoder = void 0; -const index_js_1 = require("../utils/index.js"); -const abstract_coder_js_1 = require("./coders/abstract-coder.js"); -const address_js_1 = require("./coders/address.js"); -const array_js_1 = require("./coders/array.js"); -const boolean_js_1 = require("./coders/boolean.js"); -const bytes_js_1 = require("./coders/bytes.js"); -const fixed_bytes_js_1 = require("./coders/fixed-bytes.js"); -const null_js_1 = require("./coders/null.js"); -const number_js_1 = require("./coders/number.js"); -const string_js_1 = require("./coders/string.js"); -const tuple_js_1 = require("./coders/tuple.js"); -const fragments_js_1 = require("./fragments.js"); -const index_js_2 = require("../address/index.js"); -const index_js_3 = require("../utils/index.js"); // https://docs.soliditylang.org/en/v0.8.17/control-structures.html const PanicReasons = new Map(); PanicReasons.set(0x00, "GENERIC_PANIC"); @@ -42,15 +49,15 @@ PanicReasons.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); let defaultCoder = null; -function getBuiltinCallException(action, tx, data, abiCoder) { +function getBuiltinCallException(action, tx, data$1, abiCoder) { let message = "missing revert data"; let reason = null; const invocation = null; let revert = null; - if (data) { + if (data$1) { message = "execution reverted"; - const bytes = (0, index_js_3.getBytes)(data); - data = (0, index_js_3.hexlify)(data); + const bytes = data.getBytes(data$1); + data$1 = data.hexlify(data$1); if (bytes.length === 0) { message += " (no data present; likely require(false) occurred"; reason = "require(false)"; @@ -58,7 +65,7 @@ function getBuiltinCallException(action, tx, data, abiCoder) { else if (bytes.length % 32 !== 4) { message += " (could not decode reason; invalid data length)"; } - else if ((0, index_js_3.hexlify)(bytes.slice(0, 4)) === "0x08c379a0") { + else if (data.hexlify(bytes.slice(0, 4)) === "0x08c379a0") { // Error(string) try { reason = abiCoder.decode(["string"], bytes.slice(4))[0]; @@ -73,7 +80,7 @@ function getBuiltinCallException(action, tx, data, abiCoder) { message += " (could not decode reason; invalid string data)"; } } - else if ((0, index_js_3.hexlify)(bytes.slice(0, 4)) === "0x4e487b71") { + else if (data.hexlify(bytes.slice(0, 4)) === "0x4e487b71") { // Panic(uint256) try { const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); @@ -94,15 +101,15 @@ function getBuiltinCallException(action, tx, data, abiCoder) { } } const transaction = { - to: tx.to ? (0, index_js_2.getAddress)(tx.to) : null, + to: tx.to ? index.getAddress(tx.to) : null, data: tx.data || "0x", }; if (tx.from) { - transaction.from = (0, index_js_2.getAddress)(tx.from); + transaction.from = index.getAddress(tx.from); } - return (0, index_js_3.makeError)(message, "CALL_EXCEPTION", { + return errors.makeError(message, "CALL_EXCEPTION", { action, - data, + data: data$1, reason, transaction, invocation, @@ -115,38 +122,38 @@ function getBuiltinCallException(action, tx, data, abiCoder) { class AbiCoder { #getCoder(param) { if (param.isArray()) { - return new array_js_1.ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); + return new array.ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); } if (param.isTuple()) { - return new tuple_js_1.TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); + return new tuple.TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); } switch (param.baseType) { case "address": - return new address_js_1.AddressCoder(param.name); + return new address.AddressCoder(param.name); case "bool": - return new boolean_js_1.BooleanCoder(param.name); + return new boolean.BooleanCoder(param.name); case "string": - return new string_js_1.StringCoder(param.name); + return new string.StringCoder(param.name); case "bytes": - return new bytes_js_1.BytesCoder(param.name); + return new bytes.BytesCoder(param.name); case "": - return new null_js_1.NullCoder(param.name); + return new _null.NullCoder(param.name); } // u?int[0-9]* let match = param.type.match(paramTypeNumber); if (match) { let size = parseInt(match[2] || "256"); - (0, index_js_1.assertArgument)(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param); - return new number_js_1.NumberCoder(size / 8, match[1] === "int", param.name); + errors.assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param); + return new number.NumberCoder(size / 8, match[1] === "int", param.name); } // bytes[0-9]+ match = param.type.match(paramTypeBytes); if (match) { let size = parseInt(match[1]); - (0, index_js_1.assertArgument)(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new fixed_bytes_js_1.FixedBytesCoder(size, param.name); + errors.assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); + return new fixedBytes.FixedBytesCoder(size, param.name); } - (0, index_js_1.assertArgument)(false, "invalid type", "type", param.type); + errors.assertArgument(false, "invalid type", "type", param.type); } /** * Get the default values for the given %%types%%. @@ -155,8 +162,8 @@ class AbiCoder { * is by default ``false``. */ getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(fragments_js_1.ParamType.from(type))); - const coder = new tuple_js_1.TupleCoder(coders, "_"); + const coders = types.map((type) => this.#getCoder(fragments.ParamType.from(type))); + const coder = new tuple.TupleCoder(coders, "_"); return coder.defaultValue(); } /** @@ -165,10 +172,10 @@ class AbiCoder { * @returns DataHexstring */ encode(types, values) { - (0, index_js_1.assertArgumentCount)(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(fragments_js_1.ParamType.from(type))); - const coder = new tuple_js_1.TupleCoder(coders, "_"); - const writer = new abstract_coder_js_1.Writer(); + errors.assertArgumentCount(values.length, types.length, "types/values length mismatch"); + const coders = types.map((type) => this.#getCoder(fragments.ParamType.from(type))); + const coder = new tuple.TupleCoder(coders, "_"); + const writer = new abstractCoder.Writer(); coder.encode(writer, values); return writer.data; } @@ -180,9 +187,9 @@ class AbiCoder { * padded event data emitted from ``external`` functions. */ decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(fragments_js_1.ParamType.from(type))); - const coder = new tuple_js_1.TupleCoder(coders, "_"); - return coder.decode(new abstract_coder_js_1.Reader(data, loose)); + const coders = types.map((type) => this.#getCoder(fragments.ParamType.from(type))); + const coder = new tuple.TupleCoder(coders, "_"); + return coder.decode(new abstractCoder.Reader(data, loose)); } /** * Returns the shared singleton instance of a default [[AbiCoder]]. @@ -204,5 +211,6 @@ class AbiCoder { return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); } } + exports.AbiCoder = AbiCoder; -//# sourceMappingURL=abi-coder.js.map \ No newline at end of file +//# sourceMappingURL=abi-coder.js.map diff --git a/lib.commonjs/abi/abi-coder.js.map b/lib.commonjs/abi/abi-coder.js.map index 64cd2edea..76817af83 100644 --- a/lib.commonjs/abi/abi-coder.js.map +++ b/lib.commonjs/abi/abi-coder.js.map @@ -1 +1 @@ -{"version":3,"file":"abi-coder.js","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,gDAAwE;AAExE,kEAA2E;AAC3E,oDAAmD;AACnD,gDAA+C;AAC/C,oDAAmD;AACnD,gDAA+C;AAC/C,4DAA0D;AAC1D,8CAA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AC9C,IAAI,CAAC,SAAS,CAAC,wBAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CACrC,CAAC;QACF,MAAM,KAAK,GAAG,IAAI,qBAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC1C,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,0BAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe;QACpB,IAAI,YAAY,IAAI,IAAI,EAAE;YACxB,YAAY,GAAG,IAAI,QAAQ,EAAE,CAAC;SAC/B;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC5B,MAA2B,EAC3B,EAA+D,EAC/D,IAAsB;QAEtB,OAAO,uBAAuB,CAC5B,MAAM,EACN,EAAE,EACF,IAAI,EACJ,QAAQ,CAAC,eAAe,EAAE,CAC3B,CAAC;IACJ,CAAC;CACF;AAhJD,4BAgJC"} \ No newline at end of file +{"version":3,"file":"abi-coder.js","sources":["../../lib.esm/abi/abi-coder.js"],"sourcesContent":["/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason],\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code],\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: tx.to ? getAddress(tx.to) : null,\n data: tx.data || \"0x\",\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action,\n data,\n reason,\n transaction,\n invocation,\n revert,\n });\n}\n/**\n * About AbiCoder\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, match[1] === \"int\", param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose));\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an corebc-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map"],"names":["data","getBytes","hexlify","getAddress","makeError","ArrayCoder","TupleCoder","AddressCoder","BooleanCoder","StringCoder","BytesCoder","NullCoder","assertArgument","NumberCoder","FixedBytesCoder","ParamType","assertArgumentCount","Writer","Reader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAeA;AACA,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE;AAC9B,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC;AACvC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC;AACtC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CA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AM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,CAACF,mBAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAChF,QAAQ,MAAM,KAAK,GAAG,IAAIT,gBAAU,CAAC,MAAM,EAAE,GAAG,CAAC;AACjD,QAAQ,OAAO,KAAK,CAAC,MAAM,CAAC,IAAIY,oBAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACpD,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,eAAe,GAAG;AAC7B,QAAQ,IAAI,YAAY,IAAI,IAAI,EAAE;AAClC,YAAY,YAAY,GAAG,IAAI,QAAQ,EAAE;AACzC,QAAQ;AACR,QAAQ,OAAO,YAAY;AAC3B,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,uBAAuB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE;AACrD,QAAQ,OAAO,uBAAuB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,eAAe,EAAE,CAAC;AACpF,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/bytes32.js b/lib.commonjs/abi/bytes32.js index e5c22aa37..2ad1e38e3 100644 --- a/lib.commonjs/abi/bytes32.js +++ b/lib.commonjs/abi/bytes32.js @@ -1,45 +1,55 @@ -"use strict"; +'use strict'; + +require('../utils/base58.js'); +var data = require('../utils/data.js'); +require('../utils/errors.js'); +require('../logger/logger.js'); +var utf8 = require('../utils/utf8.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + /** * About bytes32 strings... * * @_docloc: api/utils:Bytes32 Strings */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeBytes32String = exports.encodeBytes32String = void 0; -const index_js_1 = require("../utils/index.js"); /** * Encodes %%text%% as a Bytes32 string. */ function encodeBytes32String(text) { // Get the bytes - const bytes = (0, index_js_1.toUtf8Bytes)(text); + const bytes = utf8.toUtf8Bytes(text); // Check we have room for null-termination if (bytes.length > 31) { throw new Error("bytes32 string must be less than 32 bytes"); } // Zero-pad (implicitly null-terminates) - return (0, index_js_1.zeroPadBytes)(bytes, 32); + return data.zeroPadBytes(bytes, 32); } -exports.encodeBytes32String = encodeBytes32String; /** * Encodes the Bytes32-encoded %%bytes%% into a string. */ function decodeBytes32String(_bytes) { - const data = (0, index_js_1.getBytes)(_bytes, "bytes"); + const data$1 = data.getBytes(_bytes, "bytes"); // Must be 32 bytes with a null-termination - if (data.length !== 32) { + if (data$1.length !== 32) { throw new Error("invalid bytes32 - not 32 bytes long"); } - if (data[31] !== 0) { + if (data$1[31] !== 0) { throw new Error("invalid bytes32 string - no null terminator"); } // Find the null termination let length = 31; - while (data[length - 1] === 0) { + while (data$1[length - 1] === 0) { length--; } // Determine the string value - return (0, index_js_1.toUtf8String)(data.slice(0, length)); + return utf8.toUtf8String(data$1.slice(0, length)); } + exports.decodeBytes32String = decodeBytes32String; -//# sourceMappingURL=bytes32.js.map \ No newline at end of file +exports.encodeBytes32String = encodeBytes32String; +//# sourceMappingURL=bytes32.js.map diff --git a/lib.commonjs/abi/bytes32.js.map b/lib.commonjs/abi/bytes32.js.map index af74c1571..4fa754cd0 100644 --- a/lib.commonjs/abi/bytes32.js.map +++ b/lib.commonjs/abi/bytes32.js.map @@ -1 +1 @@ -{"version":3,"file":"bytes32.js","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gDAK2B;AAI3B;;GAEG;AACH,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,gBAAgB;IAChB,MAAM,KAAK,GAAG,IAAA,sBAAW,EAAC,IAAI,CAAC,CAAC;IAEhC,0CAA0C;IAC1C,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAC9D;IAED,wCAAwC;IACxC,OAAO,IAAA,uBAAY,EAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAXD,kDAWC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CAAC,MAAiB;IACnD,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC,2CAA2C;IAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;KACxD;IACD,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;KAChE;IAED,4BAA4B;IAC5B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE;QAC7B,MAAM,EAAE,CAAC;KACV;IAED,6BAA6B;IAC7B,OAAO,IAAA,uBAAY,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAC7C,CAAC;AAnBD,kDAmBC"} \ No newline at end of file +{"version":3,"file":"bytes32.js","sources":["../../lib.esm/abi/bytes32.js"],"sourcesContent":["/**\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"],"names":["toUtf8Bytes","zeroPadBytes","data","getBytes","toUtf8String"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,IAAI,EAAE;AAC1C;AACA,IAAI,MAAM,KAAK,GAAGA,gBAAW,CAAC,IAAI,CAAC;AACnC;AACA,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;AAC3B,QAAQ,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC;AACpE,IAAI;AACJ;AACA,IAAI,OAAOC,iBAAY,CAAC,KAAK,EAAE,EAAE,CAAC;AAClC;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,MAAM,EAAE;AAC5C,IAAI,MAAMC,MAAI,GAAGC,aAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;AAC1C;AACA,IAAI,IAAID,MAAI,CAAC,MAAM,KAAK,EAAE,EAAE;AAC5B,QAAQ,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC;AAC9D,IAAI;AACJ,IAAI,IAAIA,MAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;AACxB,QAAQ,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC;AACtE,IAAI;AACJ;AACA,IAAI,IAAI,MAAM,GAAG,EAAE;AACnB,IAAI,OAAOA,MAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE;AACnC,QAAQ,MAAM,EAAE;AAChB,IAAI;AACJ;AACA,IAAI,OAAOE,iBAAY,CAACF,MAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9C;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/abstract-coder.d.ts.map b/lib.commonjs/abi/coders/abstract-coder.d.ts.map index 3141c016e..df211a063 100644 --- a/lib.commonjs/abi/coders/abstract-coder.d.ts.map +++ b/lib.commonjs/abi/coders/abstract-coder.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AAiBnC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAGpC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE1B;;OAEG;gBACS,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAkG/B;;;;;OAKG;IACH,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC;IAWrB;;;;;OAKG;IACH,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAuB/B;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;IAkCnE;;OAEG;IACH,MAAM,CACJ,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EAC5D,OAAO,CAAC,EAAE,GAAG,GACZ,MAAM;IAkBT;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG;IAe3B;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,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,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO;IAQjD,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,UAAU,IAAI,MAAM,CAEvB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,KAAK,IAAI,UAAU,CAEtB;IAuBD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAKjC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU;IAQtD,SAAS,IAAI,MAAM;IAInB,SAAS,IAAI,MAAM;CAGpB"} \ No newline at end of file +{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AAiBnC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAGrC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE1B;;OAEG;IACH,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAgG9B;IAED;;;;;OAKG;IACH,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CASpB;IAED;;;;;OAKG;IACH,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAqB9B;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAgClE;IAED;;OAEG;IACH,MAAM,CACL,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EAC5D,OAAO,CAAC,EAAE,GAAG,G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IAGD,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAOnC;IAGD,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAEtC;IAID,mBAAmB,IAAI,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAOnD;CACD;AAED;;GAEG;AACH,qBAAa,MAAM;;IAKlB,QAAQ,CAAC,UAAU,EAAG,OAAO,CAAC;IAK9B,YAAY,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAMhD;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,UAAU,IAAI,MAAM,CAEvB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,KAAK,IAAI,UAAU,CAEtB;IAuBD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhC;IAGD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,CAKrD;IAGD,SAAS,IAAI,MAAM,CAElB;IAED,SAAS,IAAI,MAAM,CAElB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/abstract-coder.js b/lib.commonjs/abi/coders/abstract-coder.js index 67d44dcc3..55b25fbf3 100644 --- a/lib.commonjs/abi/coders/abstract-coder.js +++ b/lib.commonjs/abi/coders/abstract-coder.js @@ -1,12 +1,20 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Reader = exports.Writer = exports.Coder = exports.checkResultErrors = exports.Result = exports.WordSize = void 0; -const index_js_1 = require("../../utils/index.js"); +'use strict'; + +require('../../utils/base58.js'); +var data = require('../../utils/data.js'); +var errors = require('../../utils/errors.js'); +var properties = require('../../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../../utils/fixednumber.js'); +var maths = require('../../utils/maths.js'); + /** * @_ignore: */ -exports.WordSize = 32; -const Padding = new Uint8Array(exports.WordSize); +const WordSize = 32; +const Padding = new Uint8Array(WordSize); // Properties used to immediate pass through to the underlying object // - `then` is used to detect if an object is a Promise for await const passProperties = ["then"]; @@ -76,7 +84,7 @@ class Result extends Array { if (typeof prop === "string") { // Index accessor if (prop.match(/^[0-9]+$/)) { - const index = (0, index_js_1.getNumber)(prop, "%index"); + const index = maths.getNumber(prop, "%index"); if (index < 0 || index >= this.length) { throw new RangeError("out of result range"); } @@ -133,7 +141,7 @@ class Result extends Array { */ toObject() { return this.#names.reduce((accum, name, index) => { - (0, index_js_1.assert)(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", { + errors.assert(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", { operation: "toObject()", }); // Add values for names that don't conflict @@ -219,7 +227,6 @@ class Result extends Array { return new Result(_guard, items, keys); } } -exports.Result = Result; /** * Returns all errors found in a [[Result]]. * @@ -254,16 +261,15 @@ function checkResultErrors(result) { checkErrors([], result); return errors; } -exports.checkResultErrors = checkResultErrors; function getValue(value) { - let bytes = (0, index_js_1.toBeArray)(value); - (0, index_js_1.assert)(bytes.length <= exports.WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { + let bytes = maths.toBeArray(value); + errors.assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { buffer: bytes, - length: exports.WordSize, + length: WordSize, offset: bytes.length, }); - if (bytes.length !== exports.WordSize) { - bytes = (0, index_js_1.getBytesCopy)((0, index_js_1.concat)([Padding.slice(bytes.length % exports.WordSize), bytes])); + if (bytes.length !== WordSize) { + bytes = data.getBytesCopy(data.concat([Padding.slice(bytes.length % WordSize), bytes])); } return bytes; } @@ -285,7 +291,7 @@ class Coder { // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) dynamic; constructor(name, type, localName, dynamic) { - (0, index_js_1.defineProperties)(this, { name, type, localName, dynamic }, { + properties.defineProperties(this, { name, type, localName, dynamic }, { name: "string", type: "string", localName: "string", @@ -293,10 +299,9 @@ class Coder { }); } _throwError(message, value) { - (0, index_js_1.assertArgument)(false, message, this.localName, value); + errors.assertArgument(false, message, this.localName, value); } } -exports.Coder = Coder; /** * @_ignore */ @@ -309,7 +314,7 @@ class Writer { this.#dataLength = 0; } get data() { - return (0, index_js_1.concat)(this.#data); + return data.concat(this.#data); } get length() { return this.#dataLength; @@ -320,14 +325,14 @@ class Writer { return data.length; } appendWriter(writer) { - return this.#writeData((0, index_js_1.getBytesCopy)(writer.data)); + return this.#writeData(data.getBytesCopy(writer.data)); } // Arrayish item; pad on the right to *nearest* WordSize writeBytes(value) { - let bytes = (0, index_js_1.getBytesCopy)(value); - const paddingOffset = bytes.length % exports.WordSize; + let bytes = data.getBytesCopy(value); + const paddingOffset = bytes.length % WordSize; if (paddingOffset) { - bytes = (0, index_js_1.getBytesCopy)((0, index_js_1.concat)([bytes, Padding.slice(paddingOffset)])); + bytes = data.getBytesCopy(data.concat([bytes, Padding.slice(paddingOffset)])); } return this.#writeData(bytes); } @@ -340,13 +345,12 @@ class Writer { writeUpdatableValue() { const offset = this.#data.length; this.#data.push(Padding); - this.#dataLength += exports.WordSize; + this.#dataLength += WordSize; return (value) => { this.#data[offset] = getValue(value); }; } } -exports.Writer = Writer; /** * @_ignore */ @@ -358,13 +362,13 @@ class Reader { allowLoose; #data; #offset; - constructor(data, allowLoose) { - (0, index_js_1.defineProperties)(this, { allowLoose: !!allowLoose }); - this.#data = (0, index_js_1.getBytesCopy)(data); + constructor(data$1, allowLoose) { + properties.defineProperties(this, { allowLoose: !!allowLoose }); + this.#data = data.getBytesCopy(data$1); this.#offset = 0; } get data() { - return (0, index_js_1.hexlify)(this.#data); + return data.hexlify(this.#data); } get dataLength() { return this.#data.length; @@ -376,7 +380,7 @@ class Reader { return new Uint8Array(this.#data); } #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / exports.WordSize) * exports.WordSize; + let alignedLength = Math.ceil(length / WordSize) * WordSize; if (this.#offset + alignedLength > this.#data.length) { if (this.allowLoose && loose && @@ -384,8 +388,8 @@ class Reader { alignedLength = length; } else { - (0, index_js_1.assert)(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: (0, index_js_1.getBytesCopy)(this.#data), + errors.assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { + buffer: data.getBytesCopy(this.#data), length: this.#data.length, offset: this.#offset + alignedLength, }); @@ -406,11 +410,17 @@ class Reader { } // Read a numeric values readValue() { - return (0, index_js_1.toBigInt)(this.readBytes(exports.WordSize)); + return maths.toBigInt(this.readBytes(WordSize)); } readIndex() { - return (0, index_js_1.toNumber)(this.readBytes(exports.WordSize)); + return maths.toNumber(this.readBytes(WordSize)); } } + +exports.Coder = Coder; exports.Reader = Reader; -//# sourceMappingURL=abstract-coder.js.map \ No newline at end of file +exports.Result = Result; +exports.WordSize = WordSize; +exports.Writer = Writer; +exports.checkResultErrors = checkResultErrors; +//# sourceMappingURL=abstract-coder.js.map diff --git a/lib.commonjs/abi/coders/abstract-coder.js.map b/lib.commonjs/abi/coders/abstract-coder.js.map index f184833ec..ae3831da8 100644 --- a/lib.commonjs/abi/coders/abstract-coder.js.map +++ b/lib.commonjs/abi/coders/abstract-coder.js.map @@ -1 +1 @@ -{"version":3,"file":"abstract-coder.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":";;;AAAA,mDAW8B;AAI9B;;GAEG;AACU,QAAA,QAAQ,GAAW,EAAE,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,gBAAQ,CAAC,CAAC;AAEzC,qEAAqE;AACrE,iEAAiE;AACjE,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;AAEhC,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,UAAU,CAAC,IAAY,EAAE,KAAY;IAC5C,MAAM,OAAO,GAAG,IAAI,KAAK,CACvB,0DAA0D,IAAI,EAAE,CACjE,CAAC;IACI,OAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,MAAM,OAAO,CAAC;AAChB,CAAC;AAED;;;;;;GAM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AAa,CAAC,CAAC;IACtE,CAAC;IAED,gEAAgE;IAChE,SAAS,CAAC,MAAc;QACtB,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC9E,CAAC;IAED,aAAa;IACb,SAAS,CAAC,MAAc,EAAE,KAAe;QACvC,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;QAC7B,oDAAoD;QACpD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,wBAAwB;IACxB,SAAS;QACP,OAAO,IAAA,mBAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,gBAAQ,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED,SAAS;QACP,OAAO,IAAA,mBAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,gBAAQ,CAAC,CAAC,CAAC;IAC5C,CAAC;CACF;AAxED,wBAwEC"} \ No newline at end of file +{"version":3,"file":"abstract-coder.js","sources":["../../../lib.esm/abi/coders/abstract-coder.js"],"sourcesContent":["import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument, } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => {\n this[index] = item;\n });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof name === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, new Map());\n // Remove any key thats not unique\n this.#names = Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n }));\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof prop === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply(this === receiver ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply(this === receiver ? target : this, [\n prop,\n ]);\n }\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n }\n /**\n * Returns the Result as a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray() {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject() {\n return this.#names.reduce((accum, name, index) => {\n assert(name != null, \"value at index ${ index } unnamed\", \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\",\n });\n // Add values for names that don't conflict\n if (!(name in accum)) {\n accum[name] = this.getValue(name);\n }\n return accum;\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(this.#names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(this.#names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = this.#names.indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: WordSize,\n offset: bytes.length,\n });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\",\n type: \"string\",\n localName: \"string\",\n dynamic: \"boolean\",\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() {\n return this.#dataLength;\n }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n constructor(data, allowLoose) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#offset = 0;\n }\n get data() {\n return hexlify(this.#data);\n }\n get dataLength() {\n return this.#data.length;\n }\n get consumed() {\n return this.#offset;\n }\n get bytes() {\n return new Uint8Array(this.#data);\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose &&\n loose &&\n this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength,\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose);\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map"],"names":["getNumber","assert","toBeArray","getBytesCopy","concat","defineProperties","assertArgument","data","hexlify","toBigInt","toNumber"],"mappings":";;;;;;;;;;;;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAG;AACxB,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC;AACxC;AACA;AACA,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC;AAC/B,MAAM,MAAM,GAAG,EAAE;AACjB,SAAS,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE;AACjC,IAAI,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,CAAC,uDAAuD,EAAE,IAAI,CAAC,CAAC,CAAC;AAC/F,IAAI,OAAO,CAAC,KAAK,GAAG,KAAK;AACzB,IAAI,MAAM,OAAO;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAAS,KAAK,CAAC;AAClC,IAAI,MAAM;AACV;AACA;AACA;AACA,IAAI,WAAW,CAAC,GAAG,IAAI,EAAE;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;AAC7B,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;AAC3B,QAAQ,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE;AAC3C,QAAQ,IAAI,IAAI,GAAG,IAAI;AACvB,QAAQ,IAAI,KAAK,KAAK,MAAM,EAAE;AAC9B,YAAY,KAAK,GAAG,IAAI;AACxB,YAA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B,MAAM,EAAE,IAAI,CAAC,OAAO,GAAG,aAAa;AACxD,iBAAiB,CAAC;AAClB,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC;AAC3E,IAAI;AACJ;AACA,IAAI,SAAS,CAAC,MAAM,EAAE;AACtB,QAAQ,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC;AACnF,IAAI;AACJ;AACA,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE;AAC7B,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC;AACvD,QAAQ,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM;AACpC;AACA,QAAQ,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC;AACrC,IAAI;AACJ;AACA,IAAI,SAAS,GAAG;AAChB,QAAQ,OAAOM,cAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjD,IAAI;AACJ,IAAI,SAAS,GAAG;AAChB,QAAQ,OAAOC,cAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjD,IAAI;AACJ;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/address.d.ts.map b/lib.commonjs/abi/coders/address.d.ts.map index 89cabff49..030f77d6d 100644 --- a/lib.commonjs/abi/coders/address.d.ts.map +++ b/lib.commonjs/abi/coders/address.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAUtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAQrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/address.js b/lib.commonjs/abi/coders/address.js index 71d2dea91..be8030cf6 100644 --- a/lib.commonjs/abi/coders/address.js +++ b/lib.commonjs/abi/coders/address.js @@ -1,14 +1,14 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AddressCoder = void 0; -const index_js_1 = require("../../address/index.js"); -const maths_js_1 = require("../../utils/maths.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); +'use strict'; + +var index = require('../../address/index.js'); +var maths = require('../../utils/maths.js'); +var typed = require('../typed.js'); +var abstractCoder = require('./abstract-coder.js'); + /** * @_ignore */ -class AddressCoder extends abstract_coder_js_1.Coder { +class AddressCoder extends abstractCoder.Coder { constructor(localName) { super("address", "address", localName, false); } @@ -16,9 +16,9 @@ class AddressCoder extends abstract_coder_js_1.Coder { return "0x0000000000000000000000000000000000000000"; } encode(writer, _value) { - let value = typed_js_1.Typed.dereference(_value, "string"); + let value = typed.Typed.dereference(_value, "string"); try { - value = (0, index_js_1.getAddress)(value); + value = index.getAddress(value); } catch (error) { return this._throwError(error.message, _value); @@ -26,8 +26,9 @@ class AddressCoder extends abstract_coder_js_1.Coder { return writer.writeValue(value); } decode(reader) { - return (0, index_js_1.getAddress)((0, maths_js_1.toBeHex)(reader.readValue(), 22)); + return index.getAddress(maths.toBeHex(reader.readValue(), 22)); } } + exports.AddressCoder = AddressCoder; -//# sourceMappingURL=address.js.map \ No newline at end of file +//# sourceMappingURL=address.js.map diff --git a/lib.commonjs/abi/coders/address.js.map b/lib.commonjs/abi/coders/address.js.map index 279a8fa8d..a279c2693 100644 --- a/lib.commonjs/abi/coders/address.js.map +++ b/lib.commonjs/abi/coders/address.js.map @@ -1 +1 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,mDAA+C;AAE/C,0CAAoC;AACpC,2DAA4C;AAI5C;;GAEG;AACH,MAAa,YAAa,SAAQ,yBAAK;IACrC,YAAY,SAAiB;QAC3B,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,YAAY;QACV,OAAO,4CAA4C,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QAC3C,IAAI,KAAK,GAAG,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI;YACF,KAAK,GAAG,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC;SAC3B;QAAC,OAAO,KAAU,EAAE;YACnB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAChD;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,IAAA,qBAAU,EAAC,IAAA,kBAAO,EAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACrD,CAAC;CACF;AAtBD,oCAsBC"} \ No newline at end of file +{"version":3,"file":"address.js","sources":["../../../lib.esm/abi/coders/address.js"],"sourcesContent":["import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 22));\n }\n}\n//# sourceMappingURL=address.js.map"],"names":["Coder","Typed","getAddress","toBeHex"],"mappings":";;;;;;;AAIA;AACA;AACA;AACO,MAAM,YAAY,SAASA,mBAAK,CAAC;AACxC,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC;AACrD,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,4CAA4C;AAC3D,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,IAAI,KAAK,GAAGC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;AACvD,QAAQ,IAAI;AACZ,YAAY,KAAK,GAAGC,gBAAU,CAAC,KAAK,CAAC;AACrC,QAAQ;AACR,QAAQ,OAAO,KAAK,EAAE;AACtB,YAAY,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;AAC1D,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACvC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOA,gBAAU,CAACC,aAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1D,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/anonymous.d.ts.map b/lib.commonjs/abi/coders/anonymous.d.ts.map index 75c762afb..d0f9d87cb 100644 --- a/lib.commonjs/abi/coders/anonymous.d.ts.map +++ b/lib.commonjs/abi/coders/anonymous.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,OAAO,CAAC,KAAK,CAAQ;gBAET,KAAK,EAAE,KAAK;IAKxB,YAAY,IAAI,GAAG;IAInB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAI1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACxC,OAAO,CAAC,KAAK,CAAQ;IAErB,YAAY,KAAK,EAAE,KAAK,EAGvB;IAED,YAAY,IAAI,GAAG,CAElB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAEzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/anonymous.js b/lib.commonjs/abi/coders/anonymous.js index cbd655c67..3b1a417c7 100644 --- a/lib.commonjs/abi/coders/anonymous.js +++ b/lib.commonjs/abi/coders/anonymous.js @@ -1,13 +1,13 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AnonymousCoder = void 0; -const abstract_coder_js_1 = require("./abstract-coder.js"); +'use strict'; + +var abstractCoder = require('./abstract-coder.js'); + /** * Clones the functionality of an existing Coder, but without a localName * * @_ignore */ -class AnonymousCoder extends abstract_coder_js_1.Coder { +class AnonymousCoder extends abstractCoder.Coder { coder; constructor(coder) { super(coder.name, coder.type, "_", coder.dynamic); @@ -23,5 +23,6 @@ class AnonymousCoder extends abstract_coder_js_1.Coder { return this.coder.decode(reader); } } + exports.AnonymousCoder = AnonymousCoder; -//# sourceMappingURL=anonymous.js.map \ No newline at end of file +//# sourceMappingURL=anonymous.js.map diff --git a/lib.commonjs/abi/coders/anonymous.js.map b/lib.commonjs/abi/coders/anonymous.js.map index a3ff4490e..5a368b1d8 100644 --- a/lib.commonjs/abi/coders/anonymous.js.map +++ b/lib.commonjs/abi/coders/anonymous.js.map @@ -1 +1 @@ -{"version":3,"file":"anonymous.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAI5C;;;;GAIG;AACH,MAAa,cAAe,SAAQ,yBAAK;IAC/B,KAAK,CAAQ;IAErB,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CACF;AAnBD,wCAmBC"} \ No newline at end of file +{"version":3,"file":"anonymous.js","sources":["../../../lib.esm/abi/coders/anonymous.js"],"sourcesContent":["import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map"],"names":["Coder"],"mappings":";;;;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,cAAc,SAASA,mBAAK,CAAC;AAC1C,IAAI,KAAK;AACT,IAAI,WAAW,CAAC,KAAK,EAAE;AACvB,QAAQ,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;AACzD,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK;AAC1B,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;AACxC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE;AAC1B,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;AAC/C,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;AACxC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/array.d.ts.map b/lib.commonjs/abi/coders/array.d.ts.map index 9875b8e9e..8cdb33a3b 100644 --- a/lib.commonjs/abi/coders/array.d.ts.map +++ b/lib.commonjs/abi/coders/array.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAC5B,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC3C,MAAM,CAuER;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAmD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAA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AE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM,CA0BzD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CA2B1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/array.js b/lib.commonjs/abi/coders/array.js index c2b0c03dc..b076e360f 100644 --- a/lib.commonjs/abi/coders/array.js +++ b/lib.commonjs/abi/coders/array.js @@ -1,10 +1,18 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ArrayCoder = exports.unpack = exports.pack = void 0; -const index_js_1 = require("../../utils/index.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); -const anonymous_js_1 = require("./anonymous.js"); +'use strict'; + +require('../../utils/base58.js'); +require('../../logger/logger.js'); +var errors = require('../../utils/errors.js'); +var properties = require('../../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../../utils/fixednumber.js'); +require('../../utils/maths.js'); +var typed = require('../typed.js'); +var abstractCoder = require('./abstract-coder.js'); +var anonymous = require('./anonymous.js'); + /** * @_ignore */ @@ -17,18 +25,18 @@ function pack(writer, coders, values) { let unique = {}; arrayValues = coders.map((coder) => { const name = coder.localName; - (0, index_js_1.assert)(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - (0, index_js_1.assert)(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); + errors.assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); + errors.assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); unique[name] = true; return values[name]; }); } else { - (0, index_js_1.assertArgument)(false, "invalid tuple value", "tuple", values); + errors.assertArgument(false, "invalid tuple value", "tuple", values); } - (0, index_js_1.assertArgument)(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new abstract_coder_js_1.Writer(); - let dynamicWriter = new abstract_coder_js_1.Writer(); + errors.assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); + let staticWriter = new abstractCoder.Writer(); + let dynamicWriter = new abstractCoder.Writer(); let updateFuncs = []; coders.forEach((coder, index) => { let value = arrayValues[index]; @@ -55,7 +63,6 @@ function pack(writer, coders, values) { length += writer.appendWriter(dynamicWriter); return length; } -exports.pack = pack; /** * @_ignore */ @@ -74,7 +81,7 @@ function unpack(reader, coders) { } catch (error) { // Cannot recover from this - if ((0, index_js_1.isError)(error, "BUFFER_OVERRUN")) { + if (errors.isError(error, "BUFFER_OVERRUN")) { throw error; } value = error; @@ -89,7 +96,7 @@ function unpack(reader, coders) { } catch (error) { // Cannot recover from this - if ((0, index_js_1.isError)(error, "BUFFER_OVERRUN")) { + if (errors.isError(error, "BUFFER_OVERRUN")) { throw error; } value = error; @@ -104,20 +111,19 @@ function unpack(reader, coders) { values.push(value); keys.push(coder.localName || null); }); - return abstract_coder_js_1.Result.fromItems(values, keys); + return abstractCoder.Result.fromItems(values, keys); } -exports.unpack = unpack; /** * @_ignore */ -class ArrayCoder extends abstract_coder_js_1.Coder { +class ArrayCoder extends abstractCoder.Coder { coder; length; constructor(coder, length, localName) { const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; const dynamic = length === -1 || coder.dynamic; super("array", type, localName, dynamic); - (0, index_js_1.defineProperties)(this, { coder, length }); + properties.defineProperties(this, { coder, length }); } defaultValue() { // Verifies the child coder is valid (even if the array is dynamic or 0-length) @@ -129,7 +135,7 @@ class ArrayCoder extends abstract_coder_js_1.Coder { return result; } encode(writer, _value) { - const value = typed_js_1.Typed.dereference(_value, "array"); + const value = typed.Typed.dereference(_value, "array"); if (!Array.isArray(value)) { this._throwError("expected array value", value); } @@ -138,7 +144,7 @@ class ArrayCoder extends abstract_coder_js_1.Coder { count = value.length; writer.writeValue(value.length); } - (0, index_js_1.assertArgumentCount)(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); + errors.assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); let coders = []; for (let i = 0; i < value.length; i++) { coders.push(this.coder); @@ -154,18 +160,21 @@ class ArrayCoder extends abstract_coder_js_1.Coder { // slot requires at least 32 bytes for their value (or 32 // bytes as a link to the data). This could use a much // tighter bound, but we are erroring on the side of safety. - (0, index_js_1.assert)(count * abstract_coder_js_1.WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { + errors.assert(count * abstractCoder.WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { buffer: reader.bytes, - offset: count * abstract_coder_js_1.WordSize, + offset: count * abstractCoder.WordSize, length: reader.dataLength, }); } let coders = []; for (let i = 0; i < count; i++) { - coders.push(new anonymous_js_1.AnonymousCoder(this.coder)); + coders.push(new anonymous.AnonymousCoder(this.coder)); } return unpack(reader, coders); } } + exports.ArrayCoder = ArrayCoder; -//# sourceMappingURL=array.js.map \ No newline at end of file +exports.pack = pack; +exports.unpack = unpack; +//# sourceMappingURL=array.js.map diff --git a/lib.commonjs/abi/coders/array.js.map b/lib.commonjs/abi/coders/array.js.map index a42625d19..1dd3b5069 100644 --- a/lib.commonjs/abi/coders/array.js.map +++ b/lib.commonjs/abi/coders/array.js.map @@ -1 +1 @@ -{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":";;;AAAA,mDAM8B;AAE9B,0CAAoC;AAEpC,2DAAsE;AACtE,iDAAgD;AAIhD;;GAEG;AACH,SAAgB,IAAI,CAClB,MAAc,EACd,MAA4B,EAC5B,MAA4C;IAE5C,IAAI,WAAW,GAAe,EAAE,CAAC;IAEjC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,WAAW,GAAG,MAAM,CAAC;KACtB;SAAM,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC/C,IAAI,MAAM,GAAgC,E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AAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAC7D,CAAC;QAEF,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACzB;QAED,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QACxB,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;YAE3B,sDAAsD;YACtD,wDAAwD;YACxD,yDAAyD;YACzD,sDAAsD;YACtD,4DAA4D;YAC5D,IAAA,iBAAM,EACJ,KAAK,GAAG,4BAAQ,IAAI,MAAM,CAAC,UAAU,EACrC,0BAA0B,EAC1B,gBAAgB,EAChB;gBACE,MAAM,EAAE,MAAM,CAAC,KAAK;gBACpB,MAAM,EAAE,KAAK,GAAG,4BAAQ;gBACxB,MAAM,EAAE,MAAM,CAAC,UAAU;aAC1B,CACF,CAAC;SACH;QACD,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAC9B,MAAM,CAAC,IAAI,CAAC,IAAI,6BAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAC7C;QAED,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;CACF;AA9ED,gCA8EC"} \ No newline at end of file +{"version":3,"file":"array.js","sources":["../../../lib.esm/abi/coders/array.js"],"sourcesContent":["import { defineProperties, isError, assert, assertArgument, assertArgumentCount, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof values === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => {\n func(staticWriter.length);\n });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\";\n const dynamic = length === -1 || coder.dynamic;\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? \" \" + this.localName : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", {\n buffer: reader.bytes,\n offset: count * WordSize,\n length: reader.dataLength,\n });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map"],"names":["assert","assertArgument","Writer","isError","Result","Coder","defineProperties","Typed","assertArgumentCount","WordSize","AnonymousCoder"],"mappings":";;;;;;;;;;;;;;;AAIA;AACA;AACA;AACO,SAAS,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AAC7C,IAAI,IAAI,WAAW,GAAG,EAAE;AACxB,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC/B,QAAQ,WAAW,GAAG,MAAM;AAC5B,IAAI;AACJ,SAAS,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACnD,QAAQ,IAAI,MAAM,GAAG,EAAE;AACvB,QAAQ,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAC5C,YAAY,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS;AACxC,YAAYA,aAAM,CAAC,IAAI,EAAE,uDAAuD,EAAE,kBAAkB,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC7J,YAAYA,aAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,yDAAyD,EAAE,kBAAkB,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACxK,YAAY,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI;AAC/B,YAAY,OAAO,MAAM,CAAC,IAAI,CAAC;AAC/B,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ,SAAS;AACT,QAAQC,qBAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,CAAC;AACrE,IAAI;AACJ,IAAIA,qBAAc,CAAC,MAAM,CAAC,MAAM,KAA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AM,EAAE,MAAM,CAAC,KAAK;AACpC,gBAAgB,MAAM,EAAE,KAAK,GAAGA,sBAAQ;AACxC,gBAAgB,MAAM,EAAE,MAAM,CAAC,UAAU;AACzC,aAAa,CAAC;AACd,QAAQ;AACR,QAAQ,IAAI,MAAM,GAAG,EAAE;AACvB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;AACxC,YAAY,MAAM,CAAC,IAAI,CAAC,IAAIC,wBAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACvD,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;AACrC,IAAI;AACJ;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/boolean.d.ts.map b/lib.commonjs/abi/coders/boolean.d.ts.map index 8f22ce499..f0c2679a1 100644 --- a/lib.commonjs/abi/coders/boolean.d.ts.map +++ b/lib.commonjs/abi/coders/boolean.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,OAAO;IAIvB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM;IAKvD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,OAAO,CAEtB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAGtD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/boolean.js b/lib.commonjs/abi/coders/boolean.js index bc8b50731..77464ef03 100644 --- a/lib.commonjs/abi/coders/boolean.js +++ b/lib.commonjs/abi/coders/boolean.js @@ -1,12 +1,12 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BooleanCoder = void 0; -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); +'use strict'; + +var typed = require('../typed.js'); +var abstractCoder = require('./abstract-coder.js'); + /** * @_ignore */ -class BooleanCoder extends abstract_coder_js_1.Coder { +class BooleanCoder extends abstractCoder.Coder { constructor(localName) { super("bool", "bool", localName, false); } @@ -14,12 +14,13 @@ class BooleanCoder extends abstract_coder_js_1.Coder { return false; } encode(writer, _value) { - const value = typed_js_1.Typed.dereference(_value, "bool"); + const value = typed.Typed.dereference(_value, "bool"); return writer.writeValue(value ? 1 : 0); } decode(reader) { return !!reader.readValue(); } } + exports.BooleanCoder = BooleanCoder; -//# sourceMappingURL=boolean.js.map \ No newline at end of file +//# sourceMappingURL=boolean.js.map diff --git a/lib.commonjs/abi/coders/boolean.js.map b/lib.commonjs/abi/coders/boolean.js.map index 1851d7e96..ee5e26725 100644 --- a/lib.commonjs/abi/coders/boolean.js.map +++ b/lib.commonjs/abi/coders/boolean.js.map @@ -1 +1 @@ -{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":";;;AAAA,0CAAoC;AACpC,2DAA4C;AAI5C;;GAEG;AACH,MAAa,YAAa,SAAQ,yBAAK;IACrC,YAAY,SAAiB;QAC3B,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,YAAY;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAuB;QAC5C,MAAM,KAAK,GAAG,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAC9B,CAAC;CACF;AAjBD,oCAiBC"} \ No newline at end of file +{"version":3,"file":"boolean.js","sources":["../../../lib.esm/abi/coders/boolean.js"],"sourcesContent":["import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map"],"names":["Coder","Typed"],"mappings":";;;;;AAEA;AACA;AACA;AACO,MAAM,YAAY,SAASA,mBAAK,CAAC;AACxC,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;AAC/C,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,MAAM,KAAK,GAAGC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;AACvD,QAAQ,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;AAC/C,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE;AACnC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/bytes.d.ts.map b/lib.commonjs/abi/coders/bytes.d.ts.map index d765084b7..956098f28 100644 --- a/lib.commonjs/abi/coders/bytes.d.ts.map +++ b/lib.commonjs/abi/coders/bytes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAI3C,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;gBACnC,SAAS,EAAE,MAAM;IAI7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAE1C;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;IAChD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/bytes.js b/lib.commonjs/abi/coders/bytes.js index 0788ed622..740aaed9a 100644 --- a/lib.commonjs/abi/coders/bytes.js +++ b/lib.commonjs/abi/coders/bytes.js @@ -1,12 +1,20 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BytesCoder = exports.DynamicBytesCoder = void 0; -const index_js_1 = require("../../utils/index.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); +'use strict'; + +require('../../utils/base58.js'); +var data = require('../../utils/data.js'); +require('../../utils/errors.js'); +require('../../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../../utils/fixednumber.js'); +require('../../utils/maths.js'); +var abstractCoder = require('./abstract-coder.js'); + /** * @_ignore */ -class DynamicBytesCoder extends abstract_coder_js_1.Coder { +class DynamicBytesCoder extends abstractCoder.Coder { constructor(type, localName) { super(type, type, localName, true); } @@ -14,7 +22,7 @@ class DynamicBytesCoder extends abstract_coder_js_1.Coder { return "0x"; } encode(writer, value) { - value = (0, index_js_1.getBytesCopy)(value); + value = data.getBytesCopy(value); let length = writer.writeValue(value.length); length += writer.writeBytes(value); return length; @@ -23,7 +31,6 @@ class DynamicBytesCoder extends abstract_coder_js_1.Coder { return reader.readBytes(reader.readIndex(), true); } } -exports.DynamicBytesCoder = DynamicBytesCoder; /** * @_ignore */ @@ -32,8 +39,10 @@ class BytesCoder extends DynamicBytesCoder { super("bytes", localName); } decode(reader) { - return (0, index_js_1.hexlify)(super.decode(reader)); + return data.hexlify(super.decode(reader)); } } + exports.BytesCoder = BytesCoder; -//# sourceMappingURL=bytes.js.map \ No newline at end of file +exports.DynamicBytesCoder = DynamicBytesCoder; +//# sourceMappingURL=bytes.js.map diff --git a/lib.commonjs/abi/coders/bytes.js.map b/lib.commonjs/abi/coders/bytes.js.map index 4e08c778b..bba4607ca 100644 --- a/lib.commonjs/abi/coders/bytes.js.map +++ b/lib.commonjs/abi/coders/bytes.js.map @@ -1 +1 @@ -{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":";;;AAAA,mDAA6D;AAE7D,2DAA4C;AAI5C;;GAEG;AACH,MAAa,iBAAkB,SAAQ,yBAAK;IAC1C,YAAY,IAAY,EAAE,SAAiB;QACzC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC/B,KAAK,GAAG,IAAA,uBAAY,EAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;CACF;AAnBD,8CAmBC;AAED;;GAEG;AACH,MAAa,UAAW,SAAQ,iBAAiB;IAC/C,YAAY,SAAiB;QAC3B,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACvC,CAAC;CACF;AARD,gCAQC"} \ No newline at end of file +{"version":3,"file":"bytes.js","sources":["../../../lib.esm/abi/coders/bytes.js"],"sourcesContent":["import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map"],"names":["Coder","getBytesCopy","hexlify"],"mappings":";;;;;;;;;;;;;AAEA;AACA;AACA;AACO,MAAM,iBAAiB,SAASA,mBAAK,CAAC;AAC7C,IAAI,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE;AACjC,QAAQ,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC;AAC1C,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE;AAC1B,QAAQ,KAAK,GAAGC,iBAAY,CAAC,KAAK,CAAC;AACnC,QAAQ,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;AACpD,QAAQ,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AAC1C,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC;AACzD,IAAI;AACJ;AACA;AACA;AACA;AACO,MAAM,UAAU,SAAS,iBAAiB,CAAC;AAClD,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC;AACjC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOC,YAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5C,IAAI;AACJ;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/fixed-bytes.d.ts.map b/lib.commonjs/abi/coders/fixed-bytes.d.ts.map index cca02a1ac..9d870c078 100644 --- a/lib.commonjs/abi/coders/fixed-bytes.d.ts.map +++ b/lib.commonjs/abi/coders/fixed-bytes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAM3C,YAAY,IAAI,MAAM;IAOtB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM;IAQzD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAI1C;IAED,YAAY,IAAI,MAAM,CAKrB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/fixed-bytes.js b/lib.commonjs/abi/coders/fixed-bytes.js index 587c79bd4..867c19a79 100644 --- a/lib.commonjs/abi/coders/fixed-bytes.js +++ b/lib.commonjs/abi/coders/fixed-bytes.js @@ -1,32 +1,41 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FixedBytesCoder = void 0; -const index_js_1 = require("../../utils/index.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); +'use strict'; + +require('../../utils/base58.js'); +var data = require('../../utils/data.js'); +require('../../utils/errors.js'); +var properties = require('../../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../../utils/fixednumber.js'); +require('../../utils/maths.js'); +var typed = require('../typed.js'); +var abstractCoder = require('./abstract-coder.js'); + /** * @_ignore */ -class FixedBytesCoder extends abstract_coder_js_1.Coder { +class FixedBytesCoder extends abstractCoder.Coder { size; constructor(size, localName) { let name = "bytes" + String(size); super(name, name, localName, false); - (0, index_js_1.defineProperties)(this, { size }, { size: "number" }); + properties.defineProperties(this, { size }, { size: "number" }); } defaultValue() { return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); } encode(writer, _value) { - let data = (0, index_js_1.getBytesCopy)(typed_js_1.Typed.dereference(_value, this.type)); - if (data.length !== this.size) { + let data$1 = data.getBytesCopy(typed.Typed.dereference(_value, this.type)); + if (data$1.length !== this.size) { this._throwError("incorrect data length", _value); } - return writer.writeBytes(data); + return writer.writeBytes(data$1); } decode(reader) { - return (0, index_js_1.hexlify)(reader.readBytes(this.size)); + return data.hexlify(reader.readBytes(this.size)); } } + exports.FixedBytesCoder = FixedBytesCoder; -//# sourceMappingURL=fixed-bytes.js.map \ No newline at end of file +//# sourceMappingURL=fixed-bytes.js.map diff --git a/lib.commonjs/abi/coders/fixed-bytes.js.map b/lib.commonjs/abi/coders/fixed-bytes.js.map index 062c4f0c6..473ab444c 100644 --- a/lib.commonjs/abi/coders/fixed-bytes.js.map +++ b/lib.commonjs/abi/coders/fixed-bytes.js.map @@ -1 +1 @@ -{"version":3,"file":"fixed-bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":";;;AAAA,mDAA+E;AAE/E,0CAAoC;AACpC,2DAA4C;AAM5C;;GAEG;AACH,MAAa,eAAgB,SAAQ,yBAAK;IAC/B,IAAI,CAAU;IAEvB,YAAY,IAAY,EAAE,SAAiB;QACzC,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACpC,IAAA,2BAAgB,EAAkB,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,YAAY;QACV,OAAO,oEAAoE,CAAC,SAAS,CACnF,CAAC,EACD,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAClB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAyB;QAC9C,IAAI,IAAI,GAAG,IAAA,uBAAY,EAAC,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE;YAC7B,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;SACnD;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,IAAA,kBAAO,EAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;CACF;AA3BD,0CA2BC"} \ No newline at end of file +{"version":3,"file":"fixed-bytes.js","sources":["../../../lib.esm/abi/coders/fixed-bytes.js"],"sourcesContent":["import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\".substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map"],"names":["Coder","defineProperties","data","getBytesCopy","Typed","hexlify"],"mappings":";;;;;;;;;;;;;;AAGA;AACA;AACA;AACO,MAAM,eAAe,SAASA,mBAAK,CAAC;AAC3C,IAAI,IAAI;AACR,IAAI,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE;AACjC,QAAQ,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;AACzC,QAAQ,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC;AAC3C,QAAQC,2BAAgB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC5D,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,oEAAoE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;AACnH,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,IAAIC,MAAI,GAAGC,iBAAY,CAACC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AACrE,QAAQ,IAAIF,MAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE;AACvC,YAAY,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC;AAC7D,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,UAAU,CAACA,MAAI,CAAC;AACtC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOG,YAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/null.d.ts.map b/lib.commonjs/abi/coders/null.d.ts.map index 5b43f1d78..e2ef8ebc5 100644 --- a/lib.commonjs/abi/coders/null.d.ts.map +++ b/lib.commonjs/abi/coders/null.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,IAAI;IAIpB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAI5B"} \ No newline at end of file +{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACnC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,IAAI,CAEnB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAG1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/null.js b/lib.commonjs/abi/coders/null.js index e9af0056f..ac3544de2 100644 --- a/lib.commonjs/abi/coders/null.js +++ b/lib.commonjs/abi/coders/null.js @@ -1,12 +1,12 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NullCoder = void 0; -const abstract_coder_js_1 = require("./abstract-coder.js"); +'use strict'; + +var abstractCoder = require('./abstract-coder.js'); + const Empty = new Uint8Array([]); /** * @_ignore */ -class NullCoder extends abstract_coder_js_1.Coder { +class NullCoder extends abstractCoder.Coder { constructor(localName) { super("null", "", localName, false); } @@ -24,5 +24,6 @@ class NullCoder extends abstract_coder_js_1.Coder { return null; } } + exports.NullCoder = NullCoder; -//# sourceMappingURL=null.js.map \ No newline at end of file +//# sourceMappingURL=null.js.map diff --git a/lib.commonjs/abi/coders/null.js.map b/lib.commonjs/abi/coders/null.js.map index 096a97e2f..a88d3ff33 100644 --- a/lib.commonjs/abi/coders/null.js.map +++ b/lib.commonjs/abi/coders/null.js.map @@ -1 +1 @@ -{"version":3,"file":"null.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":";;;AAAA,2DAA4C;AAG5C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAEjC;;GAEG;AACH,MAAa,SAAU,SAAQ,yBAAK;IAClC,YAAY,SAAiB;QAC3B,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC/B,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;SACrC;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AApBD,8BAoBC"} \ No newline at end of file +{"version":3,"file":"null.js","sources":["../../../lib.esm/abi/coders/null.js"],"sourcesContent":["import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map"],"names":["Coder"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC;AAChC;AACA;AACA;AACO,MAAM,SAAS,SAASA,mBAAK,CAAC;AACrC,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC;AAC3C,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE;AAC1B,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;AAC3B,YAAY,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC;AAC/C,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACvC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAC3B,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/number.d.ts.map b/lib.commonjs/abi/coders/number.d.ts.map index b9ef16d8a..5af9a7edb 100644 --- a/lib.commonjs/abi/coders/number.d.ts.map +++ b/lib.commonjs/abi/coders/number.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAA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AAE,MAAM,GAAG,GAAG,CAQ1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/number.js b/lib.commonjs/abi/coders/number.js index 67000611e..9c5915c6a 100644 --- a/lib.commonjs/abi/coders/number.js +++ b/lib.commonjs/abi/coders/number.js @@ -1,49 +1,58 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NumberCoder = void 0; -const index_js_1 = require("../../utils/index.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); +'use strict'; + +require('../../utils/base58.js'); +require('../../logger/logger.js'); +require('../../utils/errors.js'); +var properties = require('../../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../../utils/fixednumber.js'); +var maths = require('../../utils/maths.js'); +var typed = require('../typed.js'); +var abstractCoder = require('./abstract-coder.js'); + const BN_0 = BigInt(0); const BN_1 = BigInt(1); const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); /** * @_ignore */ -class NumberCoder extends abstract_coder_js_1.Coder { +class NumberCoder extends abstractCoder.Coder { size; signed; constructor(size, signed, localName) { const name = (signed ? "int" : "uint") + size * 8; super(name, name, localName, false); - (0, index_js_1.defineProperties)(this, { size, signed }, { size: "number", signed: "boolean" }); + properties.defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); } defaultValue() { return 0; } encode(writer, _value) { - let value = (0, index_js_1.getBigInt)(typed_js_1.Typed.dereference(_value, this.type)); + let value = maths.getBigInt(typed.Typed.dereference(_value, this.type)); // Check bounds are safe for encoding - let maxUintValue = (0, index_js_1.mask)(BN_MAX_UINT256, abstract_coder_js_1.WordSize * 8); + let maxUintValue = maths.mask(BN_MAX_UINT256, abstractCoder.WordSize * 8); if (this.signed) { - let bounds = (0, index_js_1.mask)(maxUintValue, this.size * 8 - 1); + let bounds = maths.mask(maxUintValue, this.size * 8 - 1); if (value > bounds || value < -(bounds + BN_1)) { this._throwError("value out-of-bounds", _value); } - value = (0, index_js_1.toTwos)(value, 8 * abstract_coder_js_1.WordSize); + value = maths.toTwos(value, 8 * abstractCoder.WordSize); } - else if (value < BN_0 || value > (0, index_js_1.mask)(maxUintValue, this.size * 8)) { + else if (value < BN_0 || value > maths.mask(maxUintValue, this.size * 8)) { this._throwError("value out-of-bounds", _value); } return writer.writeValue(value); } decode(reader) { - let value = (0, index_js_1.mask)(reader.readValue(), this.size * 8); + let value = maths.mask(reader.readValue(), this.size * 8); if (this.signed) { - value = (0, index_js_1.fromTwos)(value, this.size * 8); + value = maths.fromTwos(value, this.size * 8); } return value; } } + exports.NumberCoder = NumberCoder; -//# sourceMappingURL=number.js.map \ No newline at end of file +//# sourceMappingURL=number.js.map diff --git a/lib.commonjs/abi/coders/number.js.map b/lib.commonjs/abi/coders/number.js.map index 84ffee9ed..cc965a5d9 100644 --- a/lib.commonjs/abi/coders/number.js.map +++ b/lib.commonjs/abi/coders/number.js.map @@ -1 +1 @@ -{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":";;;AAAA,mDAM8B;AAE9B,0CAAoC;AACpC,2DAAsD;AAMtD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,cAAc,GAAG,MAAM,CAC3B,oEAAoE,CACrE,CAAC;AAEF;;GAEG;AACH,MAAa,WAAY,SAAQ,yBAAK;IAC3B,IAAI,CAAU;IACd,MAAM,CAAW;IAE1B,YAAY,IAAY,EAAE,MAAe,EAAE,SAAiB;QAC1D,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QAClD,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAEpC,IAAA,2BAAgB,EACd,IAAI,EAC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EAAE;YACf,KAAK,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;SACxC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA9CD,kCA8CC"} \ No newline at end of file +{"version":3,"file":"number.js","sources":["../../../lib.esm/abi/coders/number.js"],"sourcesContent":["import { defineProperties, fromTwos, getBigInt, mask, toTwos, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = (signed ? \"int\" : \"uint\") + size * 8;\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, this.size * 8 - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map"],"names":["Coder","defineProperties","getBigInt","Typed","mask","WordSize","toTwos","fromTwos"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,C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C;AAC/C,QAAQ;AACR,aAAa,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAGD,UAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE;AAC5E,YAAY,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC;AAC3D,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACvC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,IAAI,KAAK,GAAGA,UAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;AAC3D,QAAQ,IAAI,IAAI,CAAC,MAAM,EAAE;AACzB,YAAY,KAAK,GAAGG,cAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;AAClD,QAAQ;AACR,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/string.d.ts.map b/lib.commonjs/abi/coders/string.d.ts.map index 38618a702..d0158dd8b 100644 --- a/lib.commonjs/abi/coders/string.d.ts.map +++ b/lib.commonjs/abi/coders/string.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;gBACpC,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAOtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IACjD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAKrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/string.js b/lib.commonjs/abi/coders/string.js index 7370af011..c48c51379 100644 --- a/lib.commonjs/abi/coders/string.js +++ b/lib.commonjs/abi/coders/string.js @@ -1,13 +1,13 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StringCoder = void 0; -const utf8_js_1 = require("../../utils/utf8.js"); -const typed_js_1 = require("../typed.js"); -const bytes_js_1 = require("./bytes.js"); +'use strict'; + +var utf8 = require('../../utils/utf8.js'); +var typed = require('../typed.js'); +var bytes = require('./bytes.js'); + /** * @_ignore */ -class StringCoder extends bytes_js_1.DynamicBytesCoder { +class StringCoder extends bytes.DynamicBytesCoder { constructor(localName) { super("string", localName); } @@ -15,11 +15,12 @@ class StringCoder extends bytes_js_1.DynamicBytesCoder { return ""; } encode(writer, _value) { - return super.encode(writer, (0, utf8_js_1.toUtf8Bytes)(typed_js_1.Typed.dereference(_value, "string"))); + return super.encode(writer, utf8.toUtf8Bytes(typed.Typed.dereference(_value, "string"))); } decode(reader) { - return (0, utf8_js_1.toUtf8String)(super.decode(reader)); + return utf8.toUtf8String(super.decode(reader)); } } + exports.StringCoder = StringCoder; -//# sourceMappingURL=string.js.map \ No newline at end of file +//# sourceMappingURL=string.js.map diff --git a/lib.commonjs/abi/coders/string.js.map b/lib.commonjs/abi/coders/string.js.map index 141262afb..93654097c 100644 --- a/lib.commonjs/abi/coders/string.js.map +++ b/lib.commonjs/abi/coders/string.js.map @@ -1 +1 @@ -{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":";;;AAAA,iDAAgE;AAEhE,0CAAoC;AACpC,yCAA+C;AAI/C;;GAEG;AACH,MAAa,WAAY,SAAQ,4BAAiB;IAChD,YAAY,SAAiB;QAC3B,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC7B,CAAC;IAED,YAAY;QACV,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QAC3C,OAAO,KAAK,CAAC,MAAM,CACjB,MAAM,EACN,IAAA,qBAAW,EAAC,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CACjD,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,IAAA,sBAAY,EAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC;CACF;AAnBD,kCAmBC"} \ No newline at end of file +{"version":3,"file":"string.js","sources":["../../../lib.esm/abi/coders/string.js"],"sourcesContent":["import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map"],"names":["DynamicBytesCoder","toUtf8Bytes","Typed","toUtf8String"],"mappings":";;;;;;AAGA;AACA;AACA;AACO,MAAM,WAAW,SAASA,uBAAiB,CAAC;AACnD,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC;AAClC,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,EAAE;AACjB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,EAAEC,gBAAW,CAACC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrF,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOC,iBAAY,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACjD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/tuple.d.ts.map b/lib.commonjs/abi/coders/tuple.d.ts.map index de1068222..bc66dc09e 100644 --- a/lib.commonjs/abi/coders/tuple.d.ts.map +++ b/lib.commonjs/abi/coders/tuple.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;gBAE3B,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM;IAiBnD,YAAY,IAAI,GAAG;IA0CnB,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,KAAK,GACnD,MAAM;IAKT,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAEvC,YAAY,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,EAelD;IAED,YAAY,IAAI,GAAG,CAwClB;IAED,MAAM,CACL,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,KAAK,GAClD,MAAM,CAGR;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/tuple.js b/lib.commonjs/abi/coders/tuple.js index d4645f26e..ab807bf65 100644 --- a/lib.commonjs/abi/coders/tuple.js +++ b/lib.commonjs/abi/coders/tuple.js @@ -1,14 +1,14 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TupleCoder = void 0; -const properties_js_1 = require("../../utils/properties.js"); -const typed_js_1 = require("../typed.js"); -const abstract_coder_js_1 = require("./abstract-coder.js"); -const array_js_1 = require("./array.js"); +'use strict'; + +var properties = require('../../utils/properties.js'); +var typed = require('../typed.js'); +var abstractCoder = require('./abstract-coder.js'); +var array = require('./array.js'); + /** * @_ignore */ -class TupleCoder extends abstract_coder_js_1.Coder { +class TupleCoder extends abstractCoder.Coder { coders; constructor(coders, localName) { let dynamic = false; @@ -21,7 +21,7 @@ class TupleCoder extends abstract_coder_js_1.Coder { }); const type = "tuple(" + types.join(",") + ")"; super("tuple", type, localName, dynamic); - (0, properties_js_1.defineProperties)(this, { + properties.defineProperties(this, { coders: Object.freeze(coders.slice()), }); } @@ -58,12 +58,13 @@ class TupleCoder extends abstract_coder_js_1.Coder { return Object.freeze(values); } encode(writer, _value) { - const value = typed_js_1.Typed.dereference(_value, "tuple"); - return (0, array_js_1.pack)(writer, this.coders, value); + const value = typed.Typed.dereference(_value, "tuple"); + return array.pack(writer, this.coders, value); } decode(reader) { - return (0, array_js_1.unpack)(reader, this.coders); + return array.unpack(reader, this.coders); } } + exports.TupleCoder = TupleCoder; -//# sourceMappingURL=tuple.js.map \ No newline at end of file +//# sourceMappingURL=tuple.js.map diff --git a/lib.commonjs/abi/coders/tuple.js.map b/lib.commonjs/abi/coders/tuple.js.map index 679074bb0..d5f995d8f 100644 --- a/lib.commonjs/abi/coders/tuple.js.map +++ b/lib.commonjs/abi/coders/tuple.js.map @@ -1 +1 @@ -{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AAE7D,0CAAoC;AACpC,2DAA4C;AAE5C,yCAA0C;AAI1C;;GAEG;AACH,MAAa,UAAW,SAAQ,yBAAK;IAC1B,MAAM,CAAwB;IAEvC,YAAY,MAAoB,EAAE,SAAiB;QACjD,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,KAAK,GAAkB,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EA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AI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;gBACpC,OAAO;aACR;YAED,IAAI,IAAI,KAAK,QAAQ,EAAE;gBACrB,IAAI,GAAG,SAAS,CAAC;aAClB;YAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE;gBACxB,OAAO;aACR;YAED,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,CACJ,MAAc,EACd,MAAoD;QAEpD,MAAM,KAAK,GAAG,gBAAK,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,IAAA,eAAI,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,IAAA,iBAAM,EAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;CACF;AAzED,gCAyEC"} \ No newline at end of file +{"version":3,"file":"tuple.js","sources":["../../../lib.esm/abi/coders/tuple.js"],"sourcesContent":["import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = \"tuple(\" + types.join(\",\") + \")\";\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, {\n coders: Object.freeze(coders.slice()),\n });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map"],"names":["Coder","defineProperties","Typed","pack","unpack"],"mappings":";;;;;;;AAIA;AACA;AACA;AACO,MAAM,UAAU,SAASA,mBAAK,CAAC;AACtC,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE;AACnC,QAAQ,IAAI,OAAO,GAAG,KAAK;AAC3B,QAAQ,MAAM,KAAK,GAAG,EAAE;AACxB,QAAQ,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK;AAClC,YAAY,IAAI,KAAK,CAAC,OAAO,EAAE;AAC/B,gBAAgB,OAAO,GAAG,IAAI;AAC9B,YAAY;AACZ,YAAY,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AAClC,QAAQ,CAAC,CAAC;AACV,QAAQ,MAAM,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG;AACrD,QAAQ,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;AAChD,QAAQC,2BAAgB,CAAC,IAAI,EAAE;AAC/B,YAAY,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;AACjD,SAAS,CAAC;AACV,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,MAAM,MAAM,GAAG,EAAE;AACzB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CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;AACxD,QAAQ,OAAOC,UAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;AAC/C,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOC,YAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;AAC1C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/fragments.d.ts.map b/lib.commonjs/abi/fragments.d.ts.map index c3f678ffe..b1a1124b4 100644 --- a/lib.commonjs/abi/fragments.d.ts.map +++ b/lib.commonjs/abi/fragments.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC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C3D,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAChC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,EACjC,MAAM,EAAE,IAAI,GAAG,MAAM,EAcrB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CA2ClC;IAED,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAW5D;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB,CA6DtC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAChD;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAGrE;IAED,MAAM,IAAI,MAAM,CAEf;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,CAepC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/fragments.js b/lib.commonjs/abi/fragments.js index 0eaaad046..1488d345f 100644 --- a/lib.commonjs/abi/fragments.js +++ b/lib.commonjs/abi/fragments.js @@ -1,14 +1,39 @@ -"use strict"; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +var id = require('../hash/id.js'); +require('../constants/numbers.js'); +require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); + /** * About frgaments... * * @_subsection api/abi/abi-coder:Fragments [about-fragments] */ var _a; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.StructFragment = exports.FunctionFragment = exports.FallbackFragment = exports.ConstructorFragment = exports.EventFragment = exports.ErrorFragment = exports.NamedFragment = exports.Fragment = exports.ParamType = void 0; -const index_js_1 = require("../utils/index.js"); -const index_js_2 = require("../hash/index.js"); // [ "a", "b" ] => { "a": 1, "b": 1 } function setify(items) { const result = new Set(); @@ -208,7 +233,7 @@ function lex(text) { const value = tokens.pop().text; suffix = value + suffix; tokens[tokens.length - 1].value = - (0, index_js_1.getNumber)(value); + maths.getNumber(value); } if (tokens.length === 0 || tokens[tokens.length - 1].type !== "BRACKET") { @@ -317,7 +342,7 @@ function consumeEnergy(tokens) { if (tokens.peekType("AT")) { tokens.pop(); if (tokens.peekType("NUMBER")) { - return (0, index_js_1.getBigInt)(tokens.pop().text); + return maths.getBigInt(tokens.pop().text); } throw new Error("invalid energy"); } @@ -331,7 +356,7 @@ function consumeEoi(tokens) { const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); function verifyBasicType(type) { const match = type.match(regexType); - (0, index_js_1.assertArgument)(match, "invalid type", "type", type); + errors.assertArgument(match, "invalid type", "type", type); if (type === "uint") { return "uint256"; } @@ -341,12 +366,12 @@ function verifyBasicType(type) { if (match[2]) { // bytesXX const length = parseInt(match[2]); - (0, index_js_1.assertArgument)(length !== 0 && length <= 32, "invalid bytes length", "type", type); + errors.assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); } else if (match[3]) { // intXX or uintXX const size = parseInt(match[3]); - (0, index_js_1.assertArgument)(size !== 0 && size <= 256 && size % 8 === 0, "invalid numeric width", "type", type); + errors.assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid numeric width", "type", type); } return type; } @@ -405,7 +430,7 @@ class ParamType { * @private */ constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - (0, index_js_1.assertPrivate)(guard, _guard, "ParamType"); + errors.assertPrivate(guard, _guard, "ParamType"); Object.defineProperty(this, internal, { value: ParamTypeInternal }); if (components) { components = Object.freeze(components.slice()); @@ -426,7 +451,7 @@ class ParamType { else if (components != null) { throw new Error(""); } - (0, index_js_1.defineProperties)(this, { + properties.defineProperties(this, { name, type, baseType, @@ -691,10 +716,10 @@ class ParamType { return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren); } const name = obj.name; - (0, index_js_1.assertArgument)(!name || (typeof name === "string" && name.match(regexId)), "invalid name", "obj.name", name); + errors.assertArgument(!name || (typeof name === "string" && name.match(regexId)), "invalid name", "obj.name", name); let indexed = obj.indexed; if (indexed != null) { - (0, index_js_1.assertArgument)(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); + errors.assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); indexed = !!indexed; } let type = obj.type; @@ -727,7 +752,6 @@ class ParamType { return value && value[internal] === ParamTypeInternal; } } -exports.ParamType = ParamType; /** * An abstract class to represent An individual fragment from a parse ABI. */ @@ -744,9 +768,9 @@ class Fragment { * @private */ constructor(guard, type, inputs) { - (0, index_js_1.assertPrivate)(guard, _guard, "Fragment"); + errors.assertPrivate(guard, _guard, "Fragment"); inputs = Object.freeze(inputs.slice()); - (0, index_js_1.defineProperties)(this, { type, inputs }); + properties.defineProperties(this, { type, inputs }); } /** * Creates a new **Fragment** for %%obj%%, wich can be any supported @@ -798,11 +822,11 @@ class Fragment { case "struct": return StructFragment.from(obj); } - (0, index_js_1.assert)(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { + errors.assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { operation: "Fragment.from", }); } - (0, index_js_1.assertArgument)(false, "unsupported frgament object", "obj", obj); + errors.assertArgument(false, "unsupported frgament object", "obj", obj); } /** * Returns true if %%value%% is a [[ConstructorFragment]]. @@ -835,7 +859,6 @@ class Fragment { return StructFragment.isFragment(value); } } -exports.Fragment = Fragment; /** * An abstract class to represent An individual fragment * which has a name from a parse ABI. @@ -850,12 +873,11 @@ class NamedFragment extends Fragment { */ constructor(guard, type, name, inputs) { super(guard, type, inputs); - (0, index_js_1.assertArgument)(typeof name === "string" && name.match(regexId), "invalid identifier", "name", name); + errors.assertArgument(typeof name === "string" && name.match(regexId), "invalid identifier", "name", name); inputs = Object.freeze(inputs.slice()); - (0, index_js_1.defineProperties)(this, { name }); + properties.defineProperties(this, { name }); } } -exports.NamedFragment = NamedFragment; function joinParams(format, params) { return ("(" + params.map((p) => p.format(format)).join(format === "full" ? ", " : ",") + @@ -876,7 +898,7 @@ class ErrorFragment extends NamedFragment { * The Custom Error selector. */ get selector() { - return (0, index_js_2.id)(this.format("sighash")).substring(0, 10); + return id.id(this.format("sighash")).substring(0, 10); } format(format) { if (format == null) { @@ -915,7 +937,6 @@ class ErrorFragment extends NamedFragment { return value && value[internal] === ErrorFragmentInternal; } } -exports.ErrorFragment = ErrorFragment; /** * A Fragment which represents an Event. */ @@ -927,13 +948,13 @@ class EventFragment extends NamedFragment { constructor(guard, name, inputs, anonymous) { super(guard, "event", name, inputs); Object.defineProperty(this, internal, { value: EventFragmentInternal }); - (0, index_js_1.defineProperties)(this, { anonymous }); + properties.defineProperties(this, { anonymous }); } /** * The Event topic hash. */ get topicHash() { - return (0, index_js_2.id)(this.format("sighash")); + return id.id(this.format("sighash")); } format(format) { if (format == null) { @@ -982,7 +1003,6 @@ class EventFragment extends NamedFragment { return value && value[internal] === EventFragmentInternal; } } -exports.EventFragment = EventFragment; /** * A Fragment which represents a constructor. */ @@ -997,10 +1017,10 @@ class ConstructorFragment extends Fragment { Object.defineProperty(this, internal, { value: ConstructorFragmentInternal, }); - (0, index_js_1.defineProperties)(this, { payable, energy }); + properties.defineProperties(this, { payable, energy }); } format(format) { - (0, index_js_1.assert)(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); + errors.assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); if (format === "json") { return JSON.stringify({ type: "constructor", @@ -1038,7 +1058,6 @@ class ConstructorFragment extends Fragment { return value && value[internal] === ConstructorFragmentInternal; } } -exports.ConstructorFragment = ConstructorFragment; /** * A Fragment which represents a method. */ @@ -1050,7 +1069,7 @@ class FallbackFragment extends Fragment { constructor(guard, inputs, payable) { super(guard, "fallback", inputs); Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); - (0, index_js_1.defineProperties)(this, { payable }); + properties.defineProperties(this, { payable }); } format(format) { const type = this.inputs.length === 0 ? "receive" : "fallback"; @@ -1070,12 +1089,12 @@ class FallbackFragment extends Fragment { else if (obj instanceof TokenString) { const errorObj = obj.toString(); const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - (0, index_js_1.assertArgument)(topIsValid, "type must be fallback or receive", "obj", errorObj); + errors.assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); const type = obj.popKeyword(setify(["fallback", "receive"])); // receive() if (type === "receive") { const inputs = consumeParams(obj); - (0, index_js_1.assertArgument)(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); + errors.assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); consumeKeywords(obj, setify(["payable"])); consumeEoi(obj); return new FallbackFragment(_guard, [], true); @@ -1084,16 +1103,16 @@ class FallbackFragment extends Fragment { // fallback(bytes) [payable] returns (bytes) let inputs = consumeParams(obj); if (inputs.length) { - (0, index_js_1.assertArgument)(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); + errors.assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); } else { inputs = [ParamType.from("bytes")]; } const mutability = consumeMutability(obj); - (0, index_js_1.assertArgument)(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); + errors.assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); if (consumeKeywords(obj, setify(["returns"])).has("returns")) { const outputs = consumeParams(obj); - (0, index_js_1.assertArgument)(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); + errors.assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); } consumeEoi(obj); return new FallbackFragment(_guard, inputs, mutability === "payable"); @@ -1106,13 +1125,12 @@ class FallbackFragment extends Fragment { const payable = obj.stateMutability === "payable"; return new FallbackFragment(_guard, inputs, payable); } - (0, index_js_1.assertArgument)(false, "invalid fallback description", "obj", obj); + errors.assertArgument(false, "invalid fallback description", "obj", obj); } static isFragment(value) { return value && value[internal] === FallbackFragmentInternal; } } -exports.FallbackFragment = FallbackFragment; /** * A Fragment which represents a method. */ @@ -1147,7 +1165,7 @@ class FunctionFragment extends NamedFragment { outputs = Object.freeze(outputs.slice()); const constant = stateMutability === "view" || stateMutability === "pure"; const payable = stateMutability === "payable"; - (0, index_js_1.defineProperties)(this, { + properties.defineProperties(this, { constant, energy, outputs, @@ -1159,7 +1177,7 @@ class FunctionFragment extends NamedFragment { * The Function selector. */ get selector() { - return (0, index_js_2.id)(this.format("sighash")).substring(0, 10); + return id.id(this.format("sighash")).substring(0, 10); } format(format) { if (format == null) { @@ -1247,7 +1265,6 @@ class FunctionFragment extends NamedFragment { return value && value[internal] === FunctionFragmentInternal; } } -exports.FunctionFragment = FunctionFragment; /** * A Fragment which represents a structure. */ @@ -1278,5 +1295,14 @@ class StructFragment extends NamedFragment { return value && value[internal] === StructFragmentInternal; } } + +exports.ConstructorFragment = ConstructorFragment; +exports.ErrorFragment = ErrorFragment; +exports.EventFragment = EventFragment; +exports.FallbackFragment = FallbackFragment; +exports.Fragment = Fragment; +exports.FunctionFragment = FunctionFragment; +exports.NamedFragment = NamedFragment; +exports.ParamType = ParamType; exports.StructFragment = StructFragment; -//# sourceMappingURL=fragments.js.map \ No newline at end of file +//# sourceMappingURL=fragments.js.map diff --git a/lib.commonjs/abi/fragments.js.map b/lib.commonjs/abi/fragments.js.map index e4c9e6ac9..18d2061ad 100644 --- a/lib.commonjs/abi/fragments.js.map +++ b/lib.commonjs/abi/fragments.js.map @@ -1 +1 @@ -{"version":3,"file":"fragments.js","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,gDAO2B;AAC3B,+CAAsC;AAkGtC,qCAAqC;AACrC,SAAS,MAAM,CAAC,KAAoB;IAClC,MAAM,MAAM,GAAgB,IAAI,GAAG,EAAE,CAAC;IACtC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED,sBAAsB;AACtB,MAAM,QAAQ,GAAG,6DAA6D,CAAC;AAC/E,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE5C,MAAM,QAAQ,GAAG,0DAA0D,CAAC;AAC5E,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;AAE5C,MAAM,YAAY,GAAG,yCAAyC,CAAC;AAC/D,MAAM,WAAW,GAAG,MAAM,C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CAAC,CAAC;YAClC,UAAU,CAAC,GAAG,CAAC,CAAC;YAChB,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;SACjD;QAED,OAAO,IAAI,cAAc,CACvB,MAAM,EACN,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CACjD,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAAU;QAC1B,OAAO,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,sBAAsB,CAAC;IAC7D,CAAC;CACF;AAjCD,wCAiCC"} \ No newline at end of file +{"version":3,"file":"fragments.js","sources":["../../lib.esm/abi/fragments.js"],"sourcesContent":["/**\n * About frgaments...\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nvar _a;\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\",\n \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\",\n \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\",\n \"@\": \"AT\",\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() {\n return this.#offset;\n }\n get length() {\n return this.#tokens.length - this.#offset;\n }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() {\n return new _a(this.#tokens);\n }\n reset() {\n this.#offset = 0;\n }\n #subTokenString(from = 0, to = 0) {\n return new _a(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: t.match - from,\n linkBack: t.linkBack - from,\n linkNext: t.linkNext - from,\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return top != null && allowed.has(top) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return top.type === type ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\n_a = TokenString;\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = offset < text.length ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = {\n depth: brackets.length,\n linkBack: -1,\n linkNext: -1,\n match: -1,\n type: \"\",\n text: \"\",\n offset,\n value: -1,\n };\n tokens.push(token);\n let type = SimpleTokens[cur[0]] || \"\";\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n tokens[token.match].match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n tokens[tokens.length - 1].value =\n getNumber(value);\n }\n if (tokens.length === 0 ||\n tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n tokens[tokens.length - 1].text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a energy limit, returning a BigNumber or null if none\nfunction consumeEnergy(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid energy\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_corebc_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **PAramType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name,\n type,\n baseType,\n indexed,\n components,\n arrayLength,\n arrayChildren,\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n let result = {\n type: this.baseType === \"tuple\" ? \"tuple\" : this.type,\n name: this.name || undefined,\n };\n if (typeof this.indexed === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${this.arrayLength < 0 ? \"\" : String(this.arrayLength)}]`;\n }\n else {\n if (this.isTuple()) {\n if (format !== \"sighash\") {\n result += this.type;\n }\n result +=\n \"(\" +\n this.components\n .map((comp) => comp.format(format))\n .join(format === \"full\" ? \", \" : \",\") +\n \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /*\n * Returns true if %%value%% is an Array type.\n *\n * This provides a type gaurd ensuring that the\n * [[arrayChildren]] and [[arrayLength]] are non-null.\n */\n //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } {\n // return value && (value.baseType === \"array\")\n //}\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return this.baseType === \"array\";\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return this.baseType === \"tuple\";\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return this.indexed != null;\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => _this.arrayChildren.walk(v, process));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => _this.components[i].walk(v, process));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof value !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () {\n setValue(await result);\n })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS naes by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ParamType.from(lex(obj), allowIndexed);\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") ||\n obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = obj.peekType(\"ID\") ? obj.pop().text : \"\";\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof name === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components,\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" ||\n type.startsWith(\"tuple(\" /* fix: ) */) ||\n type.startsWith(\"(\" /* fix: ) */)) {\n const comps = obj.components != null\n ? obj.components.map((c) => ParamType.from(c))\n : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return value && value[internal] === ParamTypeInternal;\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof obj === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n }\n else if (typeof obj === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\",\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof name === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return (\"(\" +\n params.map((p) => p.format(format)).join(format === \"full\" ? \", \" : \",\") +\n \")\");\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === ErrorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return EventFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n static isFragment(value) {\n return value && value[internal] === EventFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n payable;\n energy;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, energy) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, {\n value: ConstructorFragmentInternal,\n });\n defineProperties(this, { payable, energy });\n }\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: this.payable ? \"payable\" : \"undefined\",\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n result.push(this.payable ? \"payable\" : \"nonpayable\");\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n return result.join(\" \");\n }\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ConstructorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, setify([\"payable\"])).has(\"payable\");\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, energy);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === ConstructorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n format(format) {\n const type = this.inputs.length === 0 ? \"receive\" : \"fallback\";\n if (format === \"json\") {\n const stateMutability = this.payable ? \"payable\" : \"nonpayable\";\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FallbackFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = obj.stateMutability === \"payable\";\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n static isFragment(value) {\n return value && value[internal] === FallbackFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The amount of energy to send when calling this function\n */\n energy;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, energy) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = stateMutability === \"view\" || stateMutability === \"pure\";\n const payable = stateMutability === \"payable\";\n defineProperties(this, {\n constant,\n energy,\n outputs,\n payable,\n stateMutability,\n });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: this.stateMutability !== \"nonpayable\"\n ? this.stateMutability\n : undefined,\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n }\n return result.join(\" \");\n }\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FunctionFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof obj.constant === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === FunctionFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n format() {\n throw new Error(\"@TODO\");\n }\n static from(obj) {\n if (typeof obj === \"string\") {\n return StructFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === StructFragmentInternal;\n }\n}\n//# sourceMappingURL=fragments.js.map"],"names":["getNumber","getBigInt","assertArgument","assertPrivate","defineProperties","assert","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,IAAI,EAAE;AAGN;AACA,SAAS,MAAM,CAAC,KAAK,EAAE;AACvB,IAAI,MAAM,MAAM,GAAG,IAAI,GAAG,EAAE;AAC5B,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACvC,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAChC;AACA;AACA,MAAM,QAAQ,GAAG,6DAA6D;AAC9E,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,0DAA0D;AAC3E,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3C,MAAM,YAAY,GAAG,yCAAyC;AAC9D,MAAM,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AC,GAAG,EAAE;AACrB,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AACrC,YAAY,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAChD,QAAQ;AACR,aAAa,IAAI,GAAG,YAAY,WAAW,EAAE;AAC7C,YAAY,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC;AACnD,YAAY,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC;AAC7C,YAAY,UAAU,CAAC,GAAG,CAAC;AAC3B,YAAY,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC;AAC3D,QAAQ;AACR,QAAQ,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AACrG,IAAI;AACJ,IAAI,OAAO,UAAU,CAAC,KAAK,EAAE;AAC7B,QAAQ,OAAO,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,sBAAsB;AAClE,IAAI;AACJ;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/index.d.ts.map b/lib.commonjs/abi/index.d.ts.map index 4eb1a4ab8..a3a6ec0b1 100644 --- a/lib.commonjs/abi/index.d.ts.map +++ b/lib.commonjs/abi/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACP,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/abi/index.js b/lib.commonjs/abi/index.js index 9699edfa4..65a69af46 100644 --- a/lib.commonjs/abi/index.js +++ b/lib.commonjs/abi/index.js @@ -1,36 +1,32 @@ -"use strict"; -/** - * Explain about ABI here... - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Typed = exports.Result = exports.TransactionDescription = exports.LogDescription = exports.ErrorDescription = exports.Interface = exports.Indexed = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.Fragment = exports.FallbackFragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.encodeBytes32String = exports.decodeBytes32String = exports.AbiCoder = void 0; -////// -var abi_coder_js_1 = require("./abi-coder.js"); -Object.defineProperty(exports, "AbiCoder", { enumerable: true, get: function () { return abi_coder_js_1.AbiCoder; } }); -var bytes32_js_1 = require("./bytes32.js"); -Object.defineProperty(exports, "decodeBytes32String", { enumerable: true, get: function () { return bytes32_js_1.decodeBytes32String; } }); -Object.defineProperty(exports, "encodeBytes32String", { enumerable: true, get: function () { return bytes32_js_1.encodeBytes32String; } }); -var fragments_js_1 = require("./fragments.js"); -Object.defineProperty(exports, "ConstructorFragment", { enumerable: true, get: function () { return fragments_js_1.ConstructorFragment; } }); -Object.defineProperty(exports, "ErrorFragment", { enumerable: true, get: function () { return fragments_js_1.ErrorFragment; } }); -Object.defineProperty(exports, "EventFragment", { enumerable: true, get: function () { return fragments_js_1.EventFragment; } }); -Object.defineProperty(exports, "FallbackFragment", { enumerable: true, get: function () { return fragments_js_1.FallbackFragment; } }); -Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return fragments_js_1.Fragment; } }); -Object.defineProperty(exports, "FunctionFragment", { enumerable: true, get: function () { return fragments_js_1.FunctionFragment; } }); -Object.defineProperty(exports, "NamedFragment", { enumerable: true, get: function () { return fragments_js_1.NamedFragment; } }); -Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return fragments_js_1.ParamType; } }); -Object.defineProperty(exports, "StructFragment", { enumerable: true, get: function () { return fragments_js_1.StructFragment; } }); -var interface_js_1 = require("./interface.js"); -Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return interface_js_1.checkResultErrors; } }); -Object.defineProperty(exports, "Indexed", { enumerable: true, get: function () { return interface_js_1.Indexed; } }); -Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return interface_js_1.Interface; } }); -Object.defineProperty(exports, "ErrorDescription", { enumerable: true, get: function () { return interface_js_1.ErrorDescription; } }); -Object.defineProperty(exports, "LogDescription", { enumerable: true, get: function () { return interface_js_1.LogDescription; } }); -Object.defineProperty(exports, "TransactionDescription", { enumerable: true, get: function () { return interface_js_1.TransactionDescription; } }); -Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return interface_js_1.Result; } }); -var typed_js_1 = require("./typed.js"); -Object.defineProperty(exports, "Typed", { enumerable: true, get: function () { return typed_js_1.Typed; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var abiCoder = require('./abi-coder.js'); +var bytes32 = require('./bytes32.js'); +var fragments = require('./fragments.js'); +var _interface = require('./interface.js'); +var typed = require('./typed.js'); +var abstractCoder = require('./coders/abstract-coder.js'); + + + +exports.AbiCoder = abiCoder.AbiCoder; +exports.decodeBytes32String = bytes32.decodeBytes32String; +exports.encodeBytes32String = bytes32.encodeBytes32String; +exports.ConstructorFragment = fragments.ConstructorFragment; +exports.ErrorFragment = fragments.ErrorFragment; +exports.EventFragment = fragments.EventFragment; +exports.FallbackFragment = fragments.FallbackFragment; +exports.Fragment = fragments.Fragment; +exports.FunctionFragment = fragments.FunctionFragment; +exports.NamedFragment = fragments.NamedFragment; +exports.ParamType = fragments.ParamType; +exports.StructFragment = fragments.StructFragment; +exports.ErrorDescription = _interface.ErrorDescription; +exports.Indexed = _interface.Indexed; +exports.Interface = _interface.Interface; +exports.LogDescription = _interface.LogDescription; +exports.TransactionDescription = _interface.TransactionDescription; +exports.Typed = typed.Typed; +exports.Result = abstractCoder.Result; +exports.checkResultErrors = abstractCoder.checkResultErrors; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/abi/index.js.map b/lib.commonjs/abi/index.js.map index 6c03f307a..fee1d887a 100644 --- a/lib.commonjs/abi/index.js.map +++ b/lib.commonjs/abi/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,MAAM;AACN,+CAA0C;AAAjC,wGAAA,QAAQ,OAAA;AAEjB,2CAAwE;AAA/D,iHAAA,mBAAmB,OAAA;AAAE,iHAAA,mBAAmB,OAAA;AAEjD,+CAUwB;AATtB,mHAAA,mBAAmB,OAAA;AACnB,6GAAA,aAAa,OAAA;AACb,6GAAA,aAAa,OAAA;AACb,gHAAA,gBAAgB,OAAA;AAChB,wGAAA,QAAQ,OAAA;AACR,gHAAA,gBAAgB,OAAA;AAChB,6GAAA,aAAa,OAAA;AACb,yGAAA,SAAS,OAAA;AACT,8GAAA,cAAc,OAAA;AAGhB,+CAQwB;AAPtB,iHAAA,iBAAiB,OAAA;AACjB,uGAAA,OAAO,OAAA;AACP,yGAAA,SAAS,OAAA;AACT,gHAAA,gBAAgB,OAAA;AAChB,8GAAA,cAAc,OAAA;AACd,sHAAA,sBAAsB,OAAA;AACtB,sGAAA,MAAM,OAAA;AAGR,uCAAmC;AAA1B,iGAAA,KAAK,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/interface.d.ts.map b/lib.commonjs/abi/interface.d.ts.map index 763cd7ac3..d7d096cce 100644 --- a/lib.commonjs/abi/interface.d.ts.map +++ b/lib.commonjs/abi/interface.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC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CAAC;KACb,GAAG,IAAI,GAAG,cAAc,CAgBxB;IAED;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,gBAAgB,CAWnD;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAkBtD;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/interface.js b/lib.commonjs/abi/interface.js index 8db6100b6..209138071 100644 --- a/lib.commonjs/abi/interface.js +++ b/lib.commonjs/abi/interface.js @@ -1,20 +1,43 @@ -"use strict"; +'use strict'; + +var id = require('../hash/id.js'); +require('../constants/numbers.js'); +require('../address/index.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +var sha3 = require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../logger/logger.js'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +var abiCoder = require('./abi-coder.js'); +var abstractCoder = require('./coders/abstract-coder.js'); +var fragments = require('./fragments.js'); +var typed = require('./typed.js'); + /** * About Interface * * @_subsection api/abi:Interfaces [interfaces] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Interface = exports.Indexed = exports.ErrorDescription = exports.TransactionDescription = exports.LogDescription = exports.Result = exports.checkResultErrors = void 0; -const index_js_1 = require("../hash/index.js"); -const index_js_2 = require("../utils/index.js"); -const abi_coder_js_1 = require("./abi-coder.js"); -const abstract_coder_js_1 = require("./coders/abstract-coder.js"); -Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return abstract_coder_js_1.checkResultErrors; } }); -Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return abstract_coder_js_1.Result; } }); -const fragments_js_1 = require("./fragments.js"); -const typed_js_1 = require("./typed.js"); -const sha3_js_1 = require("../crypto/sha3.js"); class LogDescription { fragment; name; @@ -23,7 +46,7 @@ class LogDescription { args; constructor(fragment, topic, args) { const name = fragment.name, signature = fragment.format(); - (0, index_js_2.defineProperties)(this, { + properties.defineProperties(this, { fragment, name, signature, @@ -32,7 +55,6 @@ class LogDescription { }); } } -exports.LogDescription = LogDescription; class TransactionDescription { fragment; name; @@ -42,7 +64,7 @@ class TransactionDescription { value; constructor(fragment, selector, args, value) { const name = fragment.name, signature = fragment.format(); - (0, index_js_2.defineProperties)(this, { + properties.defineProperties(this, { fragment, name, args, @@ -52,7 +74,6 @@ class TransactionDescription { }); } } -exports.TransactionDescription = TransactionDescription; class ErrorDescription { fragment; name; @@ -61,7 +82,7 @@ class ErrorDescription { selector; constructor(fragment, selector, args) { const name = fragment.name, signature = fragment.format(); - (0, index_js_2.defineProperties)(this, { + properties.defineProperties(this, { fragment, name, args, @@ -70,7 +91,6 @@ class ErrorDescription { }); } } -exports.ErrorDescription = ErrorDescription; class Indexed { hash; _isIndexed; @@ -78,10 +98,9 @@ class Indexed { return !!(value && value._isIndexed); } constructor(hash) { - (0, index_js_2.defineProperties)(this, { hash, _isIndexed: true }); + properties.defineProperties(this, { hash, _isIndexed: true }); } } -exports.Indexed = Indexed; // https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require const PanicReasons = { "0": "generic panic", @@ -152,13 +171,13 @@ class Interface { /** * Create a new Interface for the %%fragments%%. */ - constructor(fragments) { + constructor(fragments$1) { let abi = []; - if (typeof fragments === "string") { - abi = JSON.parse(fragments); + if (typeof fragments$1 === "string") { + abi = JSON.parse(fragments$1); } else { - abi = fragments; + abi = fragments$1; } this.#functions = new Map(); this.#errors = new Map(); @@ -167,13 +186,13 @@ class Interface { const frags = []; for (const a of abi) { try { - frags.push(fragments_js_1.Fragment.from(a)); + frags.push(fragments.Fragment.from(a)); } catch (error) { console.log("EE", error); } } - (0, index_js_2.defineProperties)(this, { + properties.defineProperties(this, { fragments: Object.freeze(frags), }); let fallback = null; @@ -189,7 +208,7 @@ class Interface { return; } //checkNames(fragment, "input", fragment.inputs); - (0, index_js_2.defineProperties)(this, { + properties.defineProperties(this, { deploy: fragment, }); return; @@ -198,7 +217,7 @@ class Interface { receive = true; } else { - (0, index_js_2.assertArgument)(!fallback || + errors.assertArgument(!fallback || fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); fallback = fragment; receive = fallback.payable; @@ -228,11 +247,11 @@ class Interface { }); // If we do not have a constructor add a default if (!this.deploy) { - (0, index_js_2.defineProperties)(this, { - deploy: fragments_js_1.ConstructorFragment.from("constructor()"), + properties.defineProperties(this, { + deploy: fragments.ConstructorFragment.from("constructor()"), }); } - (0, index_js_2.defineProperties)(this, { fallback, receive }); + properties.defineProperties(this, { fallback, receive }); } /** * Returns the entire Human-Readable ABI, as an array of @@ -258,12 +277,12 @@ class Interface { * data. */ getAbiCoder() { - return abi_coder_js_1.AbiCoder.defaultAbiCoder(); + return abiCoder.AbiCoder.defaultAbiCoder(); } // Find a function definition by any means necessary (unless it is ambiguous) #getFunction(key, values, forceUnique) { // Selector - if ((0, index_js_2.isHexString)(key)) { + if (data.isHexString(key)) { const selector = key.toLowerCase(); for (const fragment of this.#functions.values()) { if (selector === fragment.selector) { @@ -284,7 +303,7 @@ class Interface { const lastValue = values.length > 0 ? values[values.length - 1] : null; let valueLength = values.length; let allowOptions = true; - if (typed_js_1.Typed.isTyped(lastValue) && lastValue.type === "overrides") { + if (typed.Typed.isTyped(lastValue) && lastValue.type === "overrides") { allowOptions = false; valueLength--; } @@ -302,7 +321,7 @@ class Interface { const inputs = matching[i].inputs; for (let j = 0; j < values.length; j++) { // Not a typed value - if (!typed_js_1.Typed.isTyped(values[j])) { + if (!typed.Typed.isTyped(values[j])) { continue; } // We are past the inputs @@ -340,12 +359,12 @@ class Interface { const matchStr = matching .map((m) => JSON.stringify(m.format())) .join(", "); - (0, index_js_2.assertArgument)(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); + errors.assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); } return matching[0]; } // Normalize the signature and lookup the function - const result = this.#functions.get(fragments_js_1.FunctionFragment.from(key).format()); + const result = this.#functions.get(fragments.FunctionFragment.from(key).format()); if (result) { return result; } @@ -357,7 +376,7 @@ class Interface { */ getFunctionName(key) { const fragment = this.#getFunction(key, null, false); - (0, index_js_2.assertArgument)(fragment, "no matching function", "key", key); + errors.assertArgument(fragment, "no matching function", "key", key); return fragment.name; } /** @@ -397,7 +416,7 @@ class Interface { // Find an event definition by any means necessary (unless it is ambiguous) #getEvent(key, values, forceUnique) { // EventTopic - if ((0, index_js_2.isHexString)(key)) { + if (data.isHexString(key)) { const eventTopic = key.toLowerCase(); for (const fragment of this.#events.values()) { if (eventTopic === fragment.topicHash) { @@ -426,7 +445,7 @@ class Interface { const inputs = matching[i].inputs; for (let j = 0; j < values.length; j++) { // Not a typed value - if (!typed_js_1.Typed.isTyped(values[j])) { + if (!typed.Typed.isTyped(values[j])) { continue; } // Make sure the value type matches the input type @@ -444,12 +463,12 @@ class Interface { const matchStr = matching .map((m) => JSON.stringify(m.format())) .join(", "); - (0, index_js_2.assertArgument)(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); + errors.assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); } return matching[0]; } // Normalize the signature and lookup the function - const result = this.#events.get(fragments_js_1.EventFragment.from(key).format()); + const result = this.#events.get(fragments.EventFragment.from(key).format()); if (result) { return result; } @@ -461,7 +480,7 @@ class Interface { */ getEventName(key) { const fragment = this.#getEvent(key, null, false); - (0, index_js_2.assertArgument)(fragment, "no matching event", "key", key); + errors.assertArgument(fragment, "no matching event", "key", key); return fragment.name; } /** @@ -509,10 +528,10 @@ class Interface { * the ABI, this will throw. */ getError(key, values) { - if ((0, index_js_2.isHexString)(key)) { + if (data.isHexString(key)) { const selector = key.toLowerCase(); if (BuiltinErrors[selector]) { - return fragments_js_1.ErrorFragment.from(BuiltinErrors[selector].signature); + return fragments.ErrorFragment.from(BuiltinErrors[selector].signature); } for (const fragment of this.#errors.values()) { if (selector === fragment.selector) { @@ -531,10 +550,10 @@ class Interface { } if (matching.length === 0) { if (key === "Error") { - return fragments_js_1.ErrorFragment.from("error Error(string)"); + return fragments.ErrorFragment.from("error Error(string)"); } if (key === "Panic") { - return fragments_js_1.ErrorFragment.from("error Panic(uint256)"); + return fragments.ErrorFragment.from("error Panic(uint256)"); } return null; } @@ -542,17 +561,17 @@ class Interface { const matchStr = matching .map((m) => JSON.stringify(m.format())) .join(", "); - (0, index_js_2.assertArgument)(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); + errors.assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); } return matching[0]; } // Normalize the signature and lookup the function - key = fragments_js_1.ErrorFragment.from(key).format(); + key = fragments.ErrorFragment.from(key).format(); if (key === "Error(string)") { - return fragments_js_1.ErrorFragment.from("error Error(string)"); + return fragments.ErrorFragment.from("error Error(string)"); } if (key === "Panic(uint256)") { - return fragments_js_1.ErrorFragment.from("error Panic(uint256)"); + return fragments.ErrorFragment.from("error Panic(uint256)"); } const result = this.#errors.get(key); if (result) { @@ -573,32 +592,32 @@ class Interface { } // Get the 4-byte selector used by Solidity to identify a function /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ + getSelector(fragment: ErrorFragment | FunctionFragment): string { + if (typeof(fragment) === "string") { + const matches: Array = [ ]; + + try { matches.push(this.getFunction(fragment)); } catch (error) { } + try { matches.push(this.getError(fragment)); } catch (_) { } + + if (matches.length === 0) { + logger.throwArgumentError("unknown fragment", "key", fragment); + } else if (matches.length > 1) { + logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); + } + + fragment = matches[0]; + } + + return dataSlice(id(fragment.format()), 0, 4); + } + */ // Get the 32-byte topic hash used by Solidity to identify an event /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ + getEventTopic(fragment: EventFragment): string { + //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } + return id(fragment.format()); + } + */ _decodeParams(params, data) { return this.#abiCoder.decode(params, data); } @@ -621,14 +640,14 @@ class Interface { * which will automatically detect a ``CALL_EXCEPTION`` and throw the * corresponding error. */ - decodeErrorResult(fragment, data) { + decodeErrorResult(fragment, data$1) { if (typeof fragment === "string") { const f = this.getError(fragment); - (0, index_js_2.assertArgument)(f, "unknown error", "fragment", fragment); + errors.assertArgument(f, "unknown error", "fragment", fragment); fragment = f; } - (0, index_js_2.assertArgument)((0, index_js_2.dataSlice)(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, (0, index_js_2.dataSlice)(data, 4)); + errors.assertArgument(data.dataSlice(data$1, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data$1); + return this._decodeParams(fragment.inputs, data.dataSlice(data$1, 4)); } /** * Encodes the transaction revert data for a call result that @@ -641,10 +660,10 @@ class Interface { encodeErrorResult(fragment, values) { if (typeof fragment === "string") { const f = this.getError(fragment); - (0, index_js_2.assertArgument)(f, "unknown error", "fragment", fragment); + errors.assertArgument(f, "unknown error", "fragment", fragment); fragment = f; } - return (0, index_js_2.concat)([ + return data.concat([ fragment.selector, this._encodeParams(fragment.inputs, values || []), ]); @@ -657,14 +676,14 @@ class Interface { * Most developers should prefer the [[parseTransaction]] method * instead, which will automatically detect the fragment. */ - decodeFunctionData(fragment, data) { + decodeFunctionData(fragment, data$1) { if (typeof fragment === "string") { const f = this.getFunction(fragment); - (0, index_js_2.assertArgument)(f, "unknown function", "fragment", fragment); + errors.assertArgument(f, "unknown function", "fragment", fragment); fragment = f; } - (0, index_js_2.assertArgument)((0, index_js_2.dataSlice)(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, (0, index_js_2.dataSlice)(data, 4)); + errors.assertArgument(data.dataSlice(data$1, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data$1); + return this._decodeParams(fragment.inputs, data.dataSlice(data$1, 4)); } /** * Encodes the ``tx.data`` for a transaction that calls the function @@ -674,10 +693,10 @@ class Interface { encodeFunctionData(fragment, values) { if (typeof fragment === "string") { const f = this.getFunction(fragment); - (0, index_js_2.assertArgument)(f, "unknown function", "fragment", fragment); + errors.assertArgument(f, "unknown function", "fragment", fragment); fragment = f; } - return (0, index_js_2.concat)([ + return data.concat([ fragment.selector, this._encodeParams(fragment.inputs, values || []), ]); @@ -691,14 +710,14 @@ class Interface { * which will automatically detect a ``CALL_EXCEPTION`` and throw the * corresponding error. */ - decodeFunctionResult(fragment, data) { + decodeFunctionResult(fragment, data$1) { if (typeof fragment === "string") { const f = this.getFunction(fragment); - (0, index_js_2.assertArgument)(f, "unknown function", "fragment", fragment); + errors.assertArgument(f, "unknown function", "fragment", fragment); fragment = f; } let message = "invalid length for result data"; - const bytes = (0, index_js_2.getBytesCopy)(data); + const bytes = data.getBytesCopy(data$1); if (bytes.length % 32 === 0) { try { return this.#abiCoder.decode(fragment.outputs, bytes); @@ -708,22 +727,22 @@ class Interface { } } // Call returned data with no error, but the data is junk - (0, index_js_2.assert)(false, message, "BAD_DATA", { - value: (0, index_js_2.hexlify)(bytes), + errors.assert(false, message, "BAD_DATA", { + value: data.hexlify(bytes), info: { method: fragment.name, signature: fragment.format() }, }); } makeError(_data, tx) { - const data = (0, index_js_2.getBytes)(_data, "data"); - const error = abi_coder_js_1.AbiCoder.getBuiltinCallException("call", tx, data); + const data$1 = data.getBytes(_data, "data"); + const error = abiCoder.AbiCoder.getBuiltinCallException("call", tx, data$1); // Not a built-in error; try finding a custom error const customPrefix = "execution reverted (unknown custom error)"; if (error.message.startsWith(customPrefix)) { - const selector = (0, index_js_2.hexlify)(data.slice(0, 4)); + const selector = data.hexlify(data$1.slice(0, 4)); const ef = this.getError(selector); if (ef) { try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); + const args = this.#abiCoder.decode(ef.inputs, data$1.slice(4)); error.revert = { name: ef.name, signature: ef.format(), @@ -759,48 +778,48 @@ class Interface { encodeFunctionResult(fragment, values) { if (typeof fragment === "string") { const f = this.getFunction(fragment); - (0, index_js_2.assertArgument)(f, "unknown function", "fragment", fragment); + errors.assertArgument(f, "unknown function", "fragment", fragment); fragment = f; } - return (0, index_js_2.hexlify)(this.#abiCoder.encode(fragment.outputs, values || [])); + return data.hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); } /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ + spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { + const promises: Array> = [ ]; + const process = function(type: ParamType, value: any): any { + if (type.baseType === "array") { + return descend(type.child + } + if (type. === "address") { + } + }; + + const descend = function (inputs: Array, values: ReadonlyArray) { + if (inputs.length !== values.length) { throw new Error("length mismatch"); } + }; + + const result: Array = [ ]; + values.forEach((value, index) => { + if (value == null) { + topics.push(null); + } else if (param.baseType === "array" || param.baseType === "tuple") { + logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); + } else if (Array.isArray(value)) { + topics.push(value.map((value) => encodeTopic(param, value))); + } else { + topics.push(encodeTopic(param, value)); + } + }); + } +*/ // Create the filter for the event with search criteria (e.g. for xcb_filterLog) encodeFilterTopics(fragment, values) { if (typeof fragment === "string") { const f = this.getEvent(fragment); - (0, index_js_2.assertArgument)(f, "unknown event", "eventFragment", fragment); + errors.assertArgument(f, "unknown event", "eventFragment", fragment); fragment = f; } - (0, index_js_2.assert)(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); + errors.assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); const topics = []; if (!fragment.anonymous) { topics.push(fragment.topicHash); @@ -808,35 +827,35 @@ class Interface { // @TODO: Use the coders for this; to properly support tuples, etc. const encodeTopic = (param, value) => { if (param.type === "string") { - return (0, index_js_1.id)(value); + return id.id(value); } else if (param.type === "bytes") { - return (0, sha3_js_1.sha256)((0, index_js_2.hexlify)(value)); + return sha3.sha256(data.hexlify(value)); } if (param.type === "bool" && typeof value === "boolean") { value = value ? "0x01" : "0x00"; } if (param.type.match(/^u?int/)) { - value = (0, index_js_2.toBeHex)(value); + value = maths.toBeHex(value); } // Check addresses are valid if (param.type === "address") { this.#abiCoder.encode(["address"], [value]); } - return (0, index_js_2.zeroPadValue)((0, index_js_2.hexlify)(value), 32); + return data.zeroPadValue(data.hexlify(value), 32); //@TOOD should probably be return toHex(value, 32) }; values.forEach((value, index) => { const param = fragment.inputs[index]; if (!param.indexed) { - (0, index_js_2.assertArgument)(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); + errors.assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); return; } if (value == null) { topics.push(null); } else if (param.baseType === "array" || param.baseType === "tuple") { - (0, index_js_2.assertArgument)(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); + errors.assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); } else if (Array.isArray(value)) { topics.push(value.map((value) => encodeTopic(param, value))); @@ -854,7 +873,7 @@ class Interface { encodeEventLog(fragment, values) { if (typeof fragment === "string") { const f = this.getEvent(fragment); - (0, index_js_2.assertArgument)(f, "unknown event", "eventFragment", fragment); + errors.assertArgument(f, "unknown event", "eventFragment", fragment); fragment = f; } const topics = []; @@ -863,15 +882,15 @@ class Interface { if (!fragment.anonymous) { topics.push(fragment.topicHash); } - (0, index_js_2.assertArgument)(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); + errors.assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); fragment.inputs.forEach((param, index) => { const value = values[index]; if (param.indexed) { if (param.type === "string") { - topics.push((0, index_js_1.id)(value)); + topics.push(id.id(value)); } else if (param.type === "bytes") { - topics.push((0, sha3_js_1.sha256)(value)); + topics.push(sha3.sha256(value)); } else if (param.baseType === "tuple" || param.baseType === "array") { // @TODO @@ -892,15 +911,15 @@ class Interface { }; } // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { + decodeEventLog(fragment, data$1, topics) { if (typeof fragment === "string") { const f = this.getEvent(fragment); - (0, index_js_2.assertArgument)(f, "unknown event", "eventFragment", fragment); + errors.assertArgument(f, "unknown event", "eventFragment", fragment); fragment = f; } if (topics != null && !fragment.anonymous) { const eventTopic = fragment.topicHash; - (0, index_js_2.assertArgument)((0, index_js_2.isHexString)(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); + errors.assertArgument(data.isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); topics = topics.slice(1); } const indexed = []; @@ -912,7 +931,7 @@ class Interface { param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") { - indexed.push(fragments_js_1.ParamType.from({ type: "bytes32", name: param.name })); + indexed.push(fragments.ParamType.from({ type: "bytes32", name: param.name })); dynamic.push(true); } else { @@ -925,8 +944,8 @@ class Interface { dynamic.push(false); } }); - const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, (0, index_js_2.concat)(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); + const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, data.concat(topics)) : null; + const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data$1, true); //const result: (Array & { [ key: string ]: any }) = [ ]; const values = []; const keys = []; @@ -960,7 +979,7 @@ class Interface { values.push(value); keys.push(param.name || null); }); - return abstract_coder_js_1.Result.fromItems(values, keys); + return abstractCoder.Result.fromItems(values, keys); } /** * Parses a transaction, finding the matching function and extracts @@ -969,13 +988,13 @@ class Interface { * If the matching function cannot be found, return null. */ parseTransaction(tx) { - const data = (0, index_js_2.getBytes)(tx.data, "tx.data"); - const value = (0, index_js_2.getBigInt)(tx.value != null ? tx.value : 0, "tx.value"); - const fragment = this.getFunction((0, index_js_2.hexlify)(data.slice(0, 4))); + const data$1 = data.getBytes(tx.data, "tx.data"); + const value = maths.getBigInt(tx.value != null ? tx.value : 0, "tx.value"); + const fragment = this.getFunction(data.hexlify(data$1.slice(0, 4))); if (!fragment) { return null; } - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); + const args = this.#abiCoder.decode(fragment.inputs, data$1.slice(4)); return new TransactionDescription(fragment, fragment.selector, args, value); } parseCallResult(data) { @@ -1003,13 +1022,13 @@ class Interface { * * If the matching event cannot be found, returns null. */ - parseError(data) { - const hexData = (0, index_js_2.hexlify)(data); - const fragment = this.getError((0, index_js_2.dataSlice)(hexData, 0, 4)); + parseError(data$1) { + const hexData = data.hexlify(data$1); + const fragment = this.getError(data.dataSlice(hexData, 0, 4)); if (!fragment) { return null; } - const args = this.#abiCoder.decode(fragment.inputs, (0, index_js_2.dataSlice)(hexData, 4)); + const args = this.#abiCoder.decode(fragment.inputs, data.dataSlice(hexData, 4)); return new ErrorDescription(fragment, fragment.selector, args); } /** @@ -1035,5 +1054,12 @@ class Interface { return new Interface(value); } } + +exports.Result = abstractCoder.Result; +exports.checkResultErrors = abstractCoder.checkResultErrors; +exports.ErrorDescription = ErrorDescription; +exports.Indexed = Indexed; exports.Interface = Interface; -//# sourceMappingURL=interface.js.map \ No newline at end of file +exports.LogDescription = LogDescription; +exports.TransactionDescription = TransactionDescription; +//# sourceMappingURL=interface.js.map diff --git a/lib.commonjs/abi/interface.js.map b/lib.commonjs/abi/interface.js.map index ec5282318..31727f08e 100644 --- a/lib.commonjs/abi/interface.js.map +++ b/lib.commonjs/abi/interface.js.map @@ -1 +1 @@ -{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+CAAsC;AACtC,gDAa2B;AAE3B,iDAA0C;AAC1C,kEAAuE;AAsB9D,kGAtBA,qCAAiB,OAsBA;AAAE,uFAtBA,0BAAM,OAsBA;AArBlC,iDAQwB;AACxB,yCAAmC;AAUnC,+CAA2C;AAI3C,MAAa,cAAc;IAChB,QAAQ,CAAiB;IACzB,IAAI,CAAU;IACd,SAAS,CAAU;IACnB,KAAK,CAAU;IACf,IAAI,CAAU;IAEvB,YAAY,QAAuB,EAAE,KAAa,EAAE,IAAY;QAC9D,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EACxB,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAChC,IAAA,2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,KAAK,QAAQ,EAAE;YAC7B,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;SACzC;QAED,qEAAqE;QACrE,IAAI,OAAa,KAAM,CAAC,MAAM,KAAK,UAAU,EAAE;YAC7C,OAAO,IAAI,SAAS,CAAO,KAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;SACnD;QAED,qBAAqB;QACrB,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CACF;AAtnCD,8BAsnCC"} \ No newline at end of file +{"version":3,"file":"interface.js","sources":["../../lib.esm/abi/interface.js"],"sourcesContent":["/**\n * About Interface\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert, } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nexport { checkResultErrors, Result };\nexport class LogDescription {\n fragment;\n name;\n signature;\n topic;\n args;\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n signature,\n topic,\n args,\n });\n }\n}\nexport class TransactionDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n value;\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n value,\n });\n }\n}\nexport class ErrorDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n });\n }\n}\nexport class Indexed {\n hash;\n _isIndexed;\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n },\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n },\n },\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving xcb is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof fragments === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(\"EE\", error);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags),\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, {\n deploy: fragment,\n });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback ||\n fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\"),\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = minimal ? \"minimal\" : \"full\";\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = values.length > 0 ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength &&\n (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 &&\n values &&\n values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null ||\n Array.isArray(lastArg) ||\n typeof lastArg !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#functions.get(name), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#events.get(name), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#errors.get(name), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\n getSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n\n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n\n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n\n fragment = matches[0];\n }\n\n return dataSlice(id(fragment.format()), 0, 4);\n }\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if (bytes.length % 32 === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() },\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name,\n signature: ef.format(),\n args,\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args,\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n\n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n };\n\n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n*/\n // Create the filter for the event with search criteria (e.g. for xcb_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return sha256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof value === \"boolean\") {\n value = value ? \"0x01\" : \"0x00\";\n }\n if (param.type.match(/^u?int/)) {\n value = toBeHex(value);\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n //@TOOD should probably be return toHex(value, 32)\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", \"contract.\" + param.name, value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", \"contract.\" + param.name, value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(sha256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics,\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" ||\n param.type === \"bytes\" ||\n param.baseType === \"tuple\" ||\n param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt(tx.value != null ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof value === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // Maybe an interface from an older version, or from a symlinked copy\n if (typeof value.format === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map"],"names":["defineProperties","fragments","Fragment","assertArgument","ConstructorFragment","AbiCoder","isHexString","Typed","FunctionFragment","EventFragment","ErrorFragment","data","dataSlice","concat","getBytesCopy","assert","hexlify","getBytes","id","sha256","toBeHex","zeroPadValue","ParamType","Result","getBigInt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AASO,MAAM,cAAc,CAAC;AAC5B,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,SAAS;AACb,IAAI,KAAK;AACT,IAAI,IAAI;AACR,IAAI,WAAW,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE;AACvC,QAAQ,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE;AACjE,QAAQA,2BAAgB,CAAC,IAAI,EAAE;AAC/B,YAAY,QAAQ;AACpB,YAAY,IAAI;AAChB,YAAY,SAAS;AACrB,YAAY,KAAK;AACjB,YAAY,IAAI;AAChB,SAAS,CAAC;AACV,IAAI;AACJ;AACO,MAAM,sBAAsB,CAAC;AACpC,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,IAAI;AACR,IAAI,SAAS;AACb,IAAI,QAAQ;AACZ,IAAI,KAAK;AACT,IAAI,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;AACjD,QAAQ,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE;AACjE,QAAQA,2BAAgB,CAAC,IAAI,EAAE;AAC/B,YAAY,QAAQ;AACpB,YAAY,IAAI;AAChB,YAAY,IAAI;AAChB,YAAY,SAAS;AACrB,YAAY,QAAQ;AACpB,YAAY,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AC;AACnC,IAAI;AACJ;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/typed.d.ts.map b/lib.commonjs/abi/typed.d.ts.map index 552156f75..80e5667ff 100644 --- a/lib.commonjs/abi/typed.d.ts.map +++ b/lib.commonjs/abi/typed.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAuBzD,MAAM,WAAW,WAAY,SAAQ,KAAK;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;IACvB,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,KAAK;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;IACvB,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAU,SAAQ,KAAK;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,WAAY,SAAQ,KAAK;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;CACxB;AAID,qBAAa,KAAK;;IAChB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAG,GAAG,CAAC;IAIrB,QAAQ,CAAC,YAAY,EAAG,MAAM,CAAC;gBAEnB,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAA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,MAAM,GACX,KAAK,CAGP;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAE9C;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEzC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAQvD;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/typed.js b/lib.commonjs/abi/typed.js index b9cc6915a..20c406ca2 100644 --- a/lib.commonjs/abi/typed.js +++ b/lib.commonjs/abi/typed.js @@ -1,4 +1,15 @@ -"use strict"; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + /** * A Typed object allows a value to have its type explicitly * specified. @@ -13,9 +24,6 @@ * * @_subsection: api/abi:Typed Values */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Typed = void 0; -const index_js_1 = require("../utils/index.js"); const _gaurd = {}; function n(value, width) { let signed = false; @@ -43,8 +51,8 @@ class Typed { if (options == null) { options = null; } - (0, index_js_1.assertPrivate)(_gaurd, gaurd, "Typed"); - (0, index_js_1.defineProperties)(this, { _typedSymbol, type, value }); + errors.assertPrivate(_gaurd, gaurd, "Typed"); + properties.defineProperties(this, { _typedSymbol, type, value }); this.#options = options; // Check the value is valid this.format(); @@ -412,11 +420,9 @@ class Typed { } static array(v, dynamic) { throw new Error("not implemented yet"); - return new Typed(_gaurd, "array", v, dynamic); } static tuple(v, name) { throw new Error("not implemented yet"); - return new Typed(_gaurd, "tuple", v, name); } static overrides(v) { return new Typed(_gaurd, "overrides", Object.assign({}, v)); @@ -444,5 +450,6 @@ class Typed { return value; } } + exports.Typed = Typed; -//# sourceMappingURL=typed.js.map \ No newline at end of file +//# sourceMappingURL=typed.js.map diff --git a/lib.commonjs/abi/typed.js.map b/lib.commonjs/abi/typed.js.map index dd6463d51..179b80a23 100644 --- a/lib.commonjs/abi/typed.js.map +++ b/lib.commonjs/abi/typed.js.map @@ -1 +1 @@ -{"version":3,"file":"typed.js","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,gDAAoE;AAOpE,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,CAAC,CAAC,KAAmB,EAAE,KAAa;IAC3C,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,MAAM,GAAG,IAAI,CAAC;QACd,KAAK,IAAI,CAAC,CAAC,CAAC;KACb;IAED,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,EAAE,EAAE,KAAK,EAAE;QACjE,MAAM;QACN,KAAK;KACN,CAAC,CAAC;AACL,CAAC;AAED,SAAS,CAAC,CAAC,KAAgB,EAAE,IAAa;IACxC,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACxE,CAAC;AA0BD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAEjD,MAAa,KAAK;IACP,IAAI,CAAU;IACd,KAAK,CAAO;IAEZ,QAAQ,CAAM;IAEd,YAAY,CAAU;IAE/B,YAAY,KAAU,EAAE,IAAY,EAAE,KAAU,EAAE,OAAa;QAC7D,IAAI,OAAO,IAAI,IAAI,EAAE;YACn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BAkbC"} \ No newline at end of file +{"version":3,"file":"typed.js","sources":["../../lib.esm/abi/typed.js"],"sourcesContent":["/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, {\n signed,\n width,\n });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${size ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_corebc_typed\");\nexport class Typed {\n type;\n value;\n #options;\n _typedSymbol;\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n defaultValue() {\n return 0;\n }\n minValue() {\n return 0;\n }\n maxValue() {\n return 0;\n }\n isBigInt() {\n return !!this.type.match(/^u?int[0-9]+$/);\n }\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n isString() {\n return this.type === \"string\";\n }\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return this.value.length;\n }\n return null;\n }\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n static uint8(v) {\n return n(v, 8);\n }\n static uint16(v) {\n return n(v, 16);\n }\n static uint24(v) {\n return n(v, 24);\n }\n static uint32(v) {\n return n(v, 32);\n }\n static uint40(v) {\n return n(v, 40);\n }\n static uint48(v) {\n return n(v, 48);\n }\n static uint56(v) {\n return n(v, 56);\n }\n static uint64(v) {\n return n(v, 64);\n }\n static uint72(v) {\n return n(v, 72);\n }\n static uint80(v) {\n return n(v, 80);\n }\n static uint88(v) {\n return n(v, 88);\n }\n static uint96(v) {\n return n(v, 96);\n }\n static uint104(v) {\n return n(v, 104);\n }\n static uint112(v) {\n return n(v, 112);\n }\n static uint120(v) {\n return n(v, 120);\n }\n static uint128(v) {\n return n(v, 128);\n }\n static uint136(v) {\n return n(v, 136);\n }\n static uint144(v) {\n return n(v, 144);\n }\n static uint152(v) {\n return n(v, 152);\n }\n static uint160(v) {\n return n(v, 160);\n }\n static uint168(v) {\n return n(v, 168);\n }\n static uint176(v) {\n return n(v, 176);\n }\n static uint184(v) {\n return n(v, 184);\n }\n static uint192(v) {\n return n(v, 192);\n }\n static uint200(v) {\n return n(v, 200);\n }\n static uint208(v) {\n return n(v, 208);\n }\n static uint216(v) {\n return n(v, 216);\n }\n static uint224(v) {\n return n(v, 224);\n }\n static uint232(v) {\n return n(v, 232);\n }\n static uint240(v) {\n return n(v, 240);\n }\n static uint248(v) {\n return n(v, 248);\n }\n static uint256(v) {\n return n(v, 256);\n }\n static uint(v) {\n return n(v, 256);\n }\n static int8(v) {\n return n(v, -8);\n }\n static int16(v) {\n return n(v, -16);\n }\n static int24(v) {\n return n(v, -24);\n }\n static int32(v) {\n return n(v, -32);\n }\n static int40(v) {\n return n(v, -40);\n }\n static int48(v) {\n return n(v, -48);\n }\n static int56(v) {\n return n(v, -56);\n }\n static int64(v) {\n return n(v, -64);\n }\n static int72(v) {\n return n(v, -72);\n }\n static int80(v) {\n return n(v, -80);\n }\n static int88(v) {\n return n(v, -88);\n }\n static int96(v) {\n return n(v, -96);\n }\n static int104(v) {\n return n(v, -104);\n }\n static int112(v) {\n return n(v, -112);\n }\n static int120(v) {\n return n(v, -120);\n }\n static int128(v) {\n return n(v, -128);\n }\n static int136(v) {\n return n(v, -136);\n }\n static int144(v) {\n return n(v, -144);\n }\n static int152(v) {\n return n(v, -152);\n }\n static int160(v) {\n return n(v, -160);\n }\n static int168(v) {\n return n(v, -168);\n }\n static int176(v) {\n return n(v, -176);\n }\n static int184(v) {\n return n(v, -184);\n }\n static int192(v) {\n return n(v, -192);\n }\n static int200(v) {\n return n(v, -200);\n }\n static int208(v) {\n return n(v, -208);\n }\n static int216(v) {\n return n(v, -216);\n }\n static int224(v) {\n return n(v, -224);\n }\n static int232(v) {\n return n(v, -232);\n }\n static int240(v) {\n return n(v, -240);\n }\n static int248(v) {\n return n(v, -248);\n }\n static int256(v) {\n return n(v, -256);\n }\n static int(v) {\n return n(v, -256);\n }\n static bytes1(v) {\n return b(v, 1);\n }\n static bytes2(v) {\n return b(v, 2);\n }\n static bytes3(v) {\n return b(v, 3);\n }\n static bytes4(v) {\n return b(v, 4);\n }\n static bytes5(v) {\n return b(v, 5);\n }\n static bytes6(v) {\n return b(v, 6);\n }\n static bytes7(v) {\n return b(v, 7);\n }\n static bytes8(v) {\n return b(v, 8);\n }\n static bytes9(v) {\n return b(v, 9);\n }\n static bytes10(v) {\n return b(v, 10);\n }\n static bytes11(v) {\n return b(v, 11);\n }\n static bytes12(v) {\n return b(v, 12);\n }\n static bytes13(v) {\n return b(v, 13);\n }\n static bytes14(v) {\n return b(v, 14);\n }\n static bytes15(v) {\n return b(v, 15);\n }\n static bytes16(v) {\n return b(v, 16);\n }\n static bytes17(v) {\n return b(v, 17);\n }\n static bytes18(v) {\n return b(v, 18);\n }\n static bytes19(v) {\n return b(v, 19);\n }\n static bytes20(v) {\n return b(v, 20);\n }\n static bytes21(v) {\n return b(v, 21);\n }\n static bytes22(v) {\n return b(v, 22);\n }\n static bytes23(v) {\n return b(v, 23);\n }\n static bytes24(v) {\n return b(v, 24);\n }\n static bytes25(v) {\n return b(v, 25);\n }\n static bytes26(v) {\n return b(v, 26);\n }\n static bytes27(v) {\n return b(v, 27);\n }\n static bytes28(v) {\n return b(v, 28);\n }\n static bytes29(v) {\n return b(v, 29);\n }\n static bytes30(v) {\n return b(v, 30);\n }\n static bytes31(v) {\n return b(v, 31);\n }\n static bytes32(v) {\n return b(v, 32);\n }\n static address(v) {\n return new Typed(_gaurd, \"address\", v);\n }\n static bool(v) {\n return new Typed(_gaurd, \"bool\", !!v);\n }\n static bytes(v) {\n return new Typed(_gaurd, \"bytes\", v);\n }\n static string(v) {\n return new Typed(_gaurd, \"string\", v);\n }\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return value && value._typedSymbol === _typedSymbol;\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map"],"names":["assertPrivate","defineProperties"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE;AACpC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAClC,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;AACrC,gBAAgB,MAAM,IAAI,KAAK,CAAC,CAAC,uBAAuB,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACpF,YAAY;AACZ,YAAY,OAAO,KAAK,CAAC,KAAK;AAC9B,QAAQ;AACR,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/address/checks.js b/lib.commonjs/address/checks.js index 135695157..4eaca62e9 100644 --- a/lib.commonjs/address/checks.js +++ b/lib.commonjs/address/checks.js @@ -1,8 +1,15 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.resolveAddress = exports.isAddress = exports.isAddressable = void 0; -const index_js_1 = require("../utils/index.js"); -const index_js_2 = require("./index.js"); +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var index = require('./index.js'); + /** * Returns true if %%value%% is an object which implements the * [[Addressable]] interface. @@ -20,7 +27,6 @@ const index_js_2 = require("./index.js"); function isAddressable(value) { return value && typeof value.getAddress === "function"; } -exports.isAddressable = isAddressable; /** * Returns true if %%value%% is a valid address. * @@ -48,21 +54,20 @@ exports.isAddressable = isAddressable; */ function isAddress(value) { try { - (0, index_js_2.getAddress)(value); + index.getAddress(value); return true; } catch (error) { } return false; } -exports.isAddress = isAddress; async function checkAddress(target, promise) { const result = await promise; if (result == null || result === "0x0000000000000000000000000000000000000000") { - (0, index_js_1.assert)(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - (0, index_js_1.assertArgument)(false, "invalid AddressLike value; did not resolve to a value address", "target", target); + errors.assert(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); + errors.assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); } - return (0, index_js_2.getAddress)(result); + return index.getAddress(result); } /** * Resolves to an address for the %%target%%, which may be any @@ -100,7 +105,7 @@ async function checkAddress(target, promise) { */ function resolveAddress(target) { if (typeof target === "string") { - return (0, index_js_2.getAddress)(target); + return index.getAddress(target); // assert(resolver != null, "ENS resolution requires a provider", // "UNSUPPORTED_OPERATION", { operation: "resolveName" }); // return checkAddress(target, resolver.resolveName(target)); @@ -111,7 +116,10 @@ function resolveAddress(target) { else if (target && typeof target.then === "function") { return checkAddress(target, target); } - (0, index_js_1.assertArgument)(false, "unsupported addressable value", "target", target); + errors.assertArgument(false, "unsupported addressable value", "target", target); } + +exports.isAddress = isAddress; +exports.isAddressable = isAddressable; exports.resolveAddress = resolveAddress; -//# sourceMappingURL=checks.js.map \ No newline at end of file +//# sourceMappingURL=checks.js.map diff --git a/lib.commonjs/address/checks.js.map b/lib.commonjs/address/checks.js.map index 149c9fe76..5ce9ae069 100644 --- a/lib.commonjs/address/checks.js.map +++ b/lib.commonjs/address/checks.js.map @@ -1 +1 @@ -{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":";;;AAAA,gDAA2D;AAE3D,yCAAkE;AAElE;;;;;;;;;;;;;GAaG;AACH,SAAgB,aAAa,CAAC,KAAU;IACtC,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,CAAC;AACzD,CAAC;AAFD,sCAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,SAAS,CAAC,KAAU;IAClC,IAAI;QACF,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,KAAK,EAAE,GAAE;IAClB,OAAO,KAAK,CAAC;AACf,CAAC;AAND,8BAMC;AAED,KAAK,UAAU,YAAY,CACzB,MAAW,EACX,OAA+B;IAE/B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;IAC7B,IACE,MAAM,IAAI,IAAI;QACd,MAAM,KAAK,4CAA4C,EACvD;QACA,IAAA,iBAAM,EACJ,OAAO,MAAM,KAAK,QAAQ,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;QACF,IAAA,yBAAc,EACZ,KAAK,EACL,+DAA+D,EAC/D,QAAQ,EACR,MAAM,CACP,CAAC;KACH;IACD,OAAO,IAAA,qBAAU,EAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,SAAgB,cAAc,CAAC,MAAmB;IAChD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC9B,OAAO,IAAA,qBAAU,EAAC,MAAM,CAAC,CAAC;QAE1B,iEAAiE;QACjE,8DAA8D;QAE9D,6DAA6D;KAC9D;SAAM,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;QAChC,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;KAClD;SAAM,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;QACtD,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACrC;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,+BAA+B,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC3E,CAAC;AAfD,wCAeC"} \ No newline at end of file +{"version":3,"file":"checks.js","sources":["../../lib.esm/address/checks.js"],"sourcesContent":["import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.corebc.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return value && typeof value.getAddress === \"function\";\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null ||\n result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof target !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target) {\n if (typeof target === \"string\") {\n return getAddress(target);\n // assert(resolver != null, \"ENS resolution requires a provider\",\n // \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n // return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof target.then === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map"],"names":["getAddress","assert","assertArgument"],"mappings":";;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,KAAK,EAAE;AACrC,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,IAAI;AACR,QAAQA,gBAAU,CAAC,KAAK,CAAC;AACzB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE,EAAE;AACpB,IAAI,OAAO,KAAK;AAChB;AACA,eAAe,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE;AAC7C,IAAI,MAAM,MAAM,GAAG,MAAM,OAAO;AAChC,IAAI,IAAI,MAAM,IAAI,IAAI;AACtB,QAAQ,MAAM,KAAK,4CAA4C,EAAE;AACjE,QAAQC,aAAM,CAAC,OAAO,MAAM,KAAK,QAAQ,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACvG,QAAQC,qBAAc,CAAC,KAAK,EAAE,+DAA+D,EAAE,QAAQ,EAAE,MAAM,CAAC;AAChH,IAAI;AACJ,IAAI,OAAOF,gBAAU,CAAC,MAAM,CAAC;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,MAAM,EAAE;AACvC,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACpC,QAAQ,OAAOA,gBAAU,CAAC,MAAM,CAAC;AACjC;AACA;AACA;AACA,IAAI;AACJ,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;AACpC,QAAQ,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;AACxD,IAAI;AACJ,SAAS,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC1D,QAAQ,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;AAC3C,IAAI;AACJ,IAAIE,qBAAc,CAAC,KAAK,EAAE,+BAA+B,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC5E;;;;"} \ No newline at end of file diff --git a/lib.commonjs/address/contract-address.d.ts.map b/lib.commonjs/address/contract-address.d.ts.map index 8511ac269..c9b527dd2 100644 --- a/lib.commonjs/address/contract-address.d.ts.map +++ b/lib.commonjs/address/contract-address.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACrB,GAAG,MAAM,CAcT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,SAAS,GACtB,MAAM,CAoBR"} \ No newline at end of file +{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,GAAG,MAAM,CAcT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,SAAS,GACrB,MAAM,CAoBR"} \ No newline at end of file diff --git a/lib.commonjs/address/contract-address.js b/lib.commonjs/address/contract-address.js index dde55c473..22c883e0e 100644 --- a/lib.commonjs/address/contract-address.js +++ b/lib.commonjs/address/contract-address.js @@ -1,14 +1,19 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getCreate2Address = exports.getCreateAddress = void 0; -const index_js_1 = require("../utils/index.js"); -const index_js_2 = require("./index.js"); -const sha3_js_1 = require("../crypto/sha3.js"); -const data_js_1 = require("../utils/data.js"); -const logger_js_1 = require("../logger/logger.js"); -const address_js_1 = require("../transaction/address.js"); -const index_js_3 = require("./index.js"); -const logger = new logger_js_1.Logger("contract-address/0.0.1"); +'use strict'; + +require('../utils/base58.js'); +var data = require('../utils/data.js'); +require('../utils/errors.js'); +var logger$1 = require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +var index = require('./index.js'); +var sha3 = require('../crypto/sha3.js'); +var address = require('../transaction/address.js'); + +const logger = new logger$1.Logger("contract-address/0.0.1"); /** * Returns the address that would result from a ``CREATE`` for %%tx%%. * @@ -28,8 +33,8 @@ const logger = new logger_js_1.Logger("contract-address/0.0.1"); * //_result: */ function getCreateAddress(tx) { - const from = (0, index_js_2.getAddress)(tx.from); - const nonce = (0, index_js_1.getBigInt)(tx.nonce, "tx.nonce"); + const from = index.getAddress(tx.from); + const nonce = maths.getBigInt(tx.nonce, "tx.nonce"); let nonceHex = nonce.toString(16); if (nonceHex === "0") { nonceHex = "0x"; @@ -40,9 +45,8 @@ function getCreateAddress(tx) { else { nonceHex = "0x" + nonceHex; } - return (0, index_js_2.getAddress)(from); + return index.getAddress(from); } -exports.getCreateAddress = getCreateAddress; /** * Returns the address that would result from a ``CREATE2`` operation * with the given %%from%%, %%salt%% and %%initCodeHash%%. @@ -60,17 +64,19 @@ exports.getCreateAddress = getCreateAddress; * //_result: */ function getCreate2Address(from, salt, initCodeHash) { - if ((0, data_js_1.hexDataLength)(salt) !== 32) { + if (data.hexDataLength(salt) !== 32) { logger.throwArgumentError("salt must be 32 bytes", "salt", salt); } - if ((0, data_js_1.hexDataLength)(initCodeHash) !== 32) { + if (data.hexDataLength(initCodeHash) !== 32) { logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash); } - const val = (0, data_js_1.hexDataSlice)((0, sha3_js_1.sha256)((0, index_js_1.concat)(["0xff", (0, index_js_2.getAddress)(from), salt, initCodeHash])), 12); + const val = data.hexDataSlice(sha3.sha256(data.concat(["0xff", index.getAddress(from), salt, initCodeHash])), 12); console.log({ "contract-address/74=>should be string": val }); const prefix = from.substring(2, 4); - const checksum = (0, index_js_3.calculateCheckSum)(val, prefix); - return "0x" + prefix + checksum + (0, address_js_1.removeHexPrefix)(val); + const checksum = index.calculateCheckSum(val, prefix); + return "0x" + prefix + checksum + address.removeHexPrefix(val); } + exports.getCreate2Address = getCreate2Address; -//# sourceMappingURL=contract-address.js.map \ No newline at end of file +exports.getCreateAddress = getCreateAddress; +//# sourceMappingURL=contract-address.js.map diff --git a/lib.commonjs/address/contract-address.js.map b/lib.commonjs/address/contract-address.js.map index 6942f9d99..ebc6c8aae 100644 --- a/lib.commonjs/address/contract-address.js.map +++ b/lib.commonjs/address/contract-address.js.map @@ -1 +1 @@ -{"version":3,"file":"contract-address.js","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":";;;AAAA,gDAK2B;AAE3B,yCAAwC;AAGxC,+CAA2C;AAC3C,8CAA+D;AAC/D,mDAA6C;AAC7C,0DAA4D;AAC5D,yCAA+C;AAC/C,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,wBAAwB,CAAC,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,gBAAgB,CAAC,EAGhC;IACC,MAAM,IAAI,GAAG,IAAA,qBAAU,EAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAE9C,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,QAAQ,KAAK,GAAG,EAAE;QACpB,QAAQ,GAAG,IAAI,CAAC;KACjB;SAAM,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QAC9B,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;KAC7B;SAAM;QACL,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC;KAC5B;IAED,OAAO,IAAA,qBAAU,EAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAjBD,4CAiBC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,iBAAiB,CAC/B,IAAY,EACZ,IAAe,EACf,YAAuB;IAEvB,IAAI,IAAA,uBAAa,EAAC,IAAI,CAAC,KAAK,EAAE,EAAE;QAC9B,MAAM,CAAC,kBAAkB,CAAC,uBAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;KAClE;IACD,IAAI,IAAA,uBAAa,EAAC,YAAY,CAAC,KAAK,EAAE,EAAE;QACtC,MAAM,CAAC,kBAAkB,CACvB,+BAA+B,EAC/B,cAAc,EACd,YAAY,CACb,CAAC;KACH;IAED,MAAM,GAAG,GAAG,IAAA,sBAAY,EACtB,IAAA,gBAAM,EAAC,IAAA,iBAAM,EAAC,CAAC,MAAM,EAAE,IAAA,qBAAU,EAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAC9D,EAAE,CACH,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,uCAAuC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,IAAA,4BAAiB,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAA,4BAAe,EAAC,GAAG,CAAC,CAAC;AACzD,CAAC;AAxBD,8CAwBC"} \ No newline at end of file +{"version":3,"file":"contract-address.js","sources":["../../lib.esm/address/contract-address.js"],"sourcesContent":["import { concat, \n// dataSlice,\ngetBigInt,\n// encodeRlp\n } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { hexDataLength, hexDataSlice } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { removeHexPrefix } from \"../transaction/address.js\";\nimport { calculateCheckSum } from \"./index.js\";\nconst logger = new Logger(\"contract-address/0.0.1\");\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(from);\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\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 * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n const val = hexDataSlice(sha256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12);\n console.log({ \"contract-address/74=>should be string\": val });\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\n//# sourceMappingURL=contract-address.js.map"],"names":["Logger","getAddress","getBigInt","hexDataLength","hexDataSlice","sha256","concat","calculateCheckSum","removeHexPrefix"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,wBA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EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAChG,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,uCAAuC,EAAE,GAAG,EAAE,CAAC;AACjE,IAAI,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AACvC,IAAI,MAAM,QAAQ,GAAGM,uBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC;AACnD,IAAI,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAGC,uBAAe,CAAC,GAAG,CAAC;AAC1D;;;"} \ No newline at end of file diff --git a/lib.commonjs/address/index.d.ts.map b/lib.commonjs/address/index.d.ts.map index 3dc38445f..86a6e44f8 100644 --- a/lib.commonjs/address/index.d.ts.map +++ b/lib.commonjs/address/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;CAQ5B;AAED,OAAO,EAAa,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA8BpE,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBpE;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoB3C;AACD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACrB,UAmBA;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;CAQ5B;AAED,OAAO,EAAa,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA8BpE,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBpE;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoB3C;AACD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,UAmBA;AAED,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GAClB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/address/index.js b/lib.commonjs/address/index.js index e48403b07..98d960fac 100644 --- a/lib.commonjs/address/index.js +++ b/lib.commonjs/address/index.js @@ -1,4 +1,11 @@ -"use strict"; +'use strict'; + +var bigNumber = require('../bigNumber/bigNumber.js'); +var rlp = require('../crypto/rlp.js'); +var sha3 = require('../crypto/sha3.js'); +var logger$1 = require('../logger/logger.js'); +var data = require('../utils/data.js'); + /** * Addresses are a fundamental part of interacting with Core. They * represent the gloabal identity of Externally Owned Accounts (accounts @@ -13,15 +20,7 @@ * * @_section: api/address:Addresses [about-addresses] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getContractAddress = exports.networkIdToPrefix = exports.calculateCheckSum = exports.getIcapAddress = exports.getAddress = void 0; -null; -const bigNumber_js_1 = require("../bigNumber/bigNumber.js"); -const rlp_js_1 = require("../crypto/rlp.js"); -const sha3_js_1 = require("../crypto/sha3.js"); -const logger_js_1 = require("../logger/logger.js"); -const data_js_1 = require("../utils/data.js"); -const logger = new logger_js_1.Logger("address/0.0.1"); +const logger = new logger$1.Logger("address/0.0.1"); const precompiledAddresses = [ "0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000001", @@ -38,10 +37,10 @@ function removeHexPrefix(val) { return val.substring(0, 2) === "0x" ? val.substring(2) : val; } function calculateCheckSum(_address, _prefix) { - const address = (0, data_js_1.getBytes)("0x" + _address.replace("0x", "")); - const prefix = (0, data_js_1.getBytes)("0x" + _prefix.replace("0x", "")); + const address = data.getBytes("0x" + _address.replace("0x", "")); + const prefix = data.getBytes("0x" + _prefix.replace("0x", "")); const tmpConcated = new Uint8Array([...address, ...prefix]); - const hexedConcat = (0, data_js_1.hexlify)(tmpConcated).replace("0x", "") + "00"; + const hexedConcat = data.hexlify(tmpConcated).replace("0x", "") + "00"; const mods = Array.from(hexedConcat.toUpperCase(), (c) => { const charCode = c.charCodeAt(0); return charCode > 64 && charCode < 91 @@ -56,7 +55,6 @@ function calculateCheckSum(_address, _prefix) { const result = checkSum > 9 ? checkSum.toString() : "0" + checkSum.toString(); return result; } -exports.calculateCheckSum = calculateCheckSum; // See: https://en.wikipedia.org/wiki/International_Bank_Account_Number // Create lookup table const ibanLookup = {}; @@ -143,7 +141,6 @@ function getAddress(address) { } return "0x" + prefix + checksum + val; } -exports.getAddress = getAddress; /** * The [ICAP Address format](link-icap) format is an early checksum * format which attempts to be compatible with the banking @@ -170,7 +167,6 @@ function getIcapAddress(address) { } return "XE" + ibanChecksum("XE00" + base36) + base36; } -exports.getIcapAddress = getIcapAddress; function networkIdToPrefix(networkId) { if (networkId == 1) { return "cb"; @@ -186,7 +182,6 @@ function networkIdToPrefix(networkId) { return ""; } } -exports.networkIdToPrefix = networkIdToPrefix; function getContractAddress(transaction) { let from = null; try { @@ -195,11 +190,16 @@ function getContractAddress(transaction) { catch (error) { logger.throwArgumentError("missing from address", "transaction", transaction); } - const nonce = (0, data_js_1.stripZeros)((0, data_js_1.arrayify)(bigNumber_js_1.BigNumber.from(transaction.nonce).toHexString())); - const val = (0, data_js_1.hexDataSlice)((0, sha3_js_1.sha256)((0, rlp_js_1.encode)([from, nonce])), 12); + const nonce = data.stripZeros(data.arrayify(bigNumber.BigNumber.from(transaction.nonce).toHexString())); + const val = data.hexDataSlice(sha3.sha256(rlp.encode([from, nonce])), 12); const prefix = from.substring(2, 4); const checksum = calculateCheckSum(val, prefix); return "0x" + prefix + checksum + removeHexPrefix(val); } + +exports.calculateCheckSum = calculateCheckSum; +exports.getAddress = getAddress; exports.getContractAddress = getContractAddress; -//# sourceMappingURL=index.js.map \ No newline at end of file +exports.getIcapAddress = getIcapAddress; +exports.networkIdToPrefix = networkIdToPrefix; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/address/index.js.map b/lib.commonjs/address/index.js.map index f538e9942..28cefeeff 100644 --- a/lib.commonjs/address/index.js.map +++ b/lib.commonjs/address/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sour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B,OAAO,IAAI,CAAC;KACb;SAAM,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,IAAI,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;SAAM,IAAI,SAAS,GAAG,EAAE,IAAI,SAAS,IAAI,CAAC,EAAE;QAC3C,OAAO,IAAI,CAAC;KACb;SAAM;QACL,MAAM,CAAC,kBAAkB,CAAC,eAAe,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AA8BC,8CAAiB;AA5BnB,SAAS,kBAAkB,CAAC,WAG3B;IACC,IAAI,IAAI,GAAQ,IAAI,CAAC;IACrB,IAAI;QACF,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;KACrC;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,CAAC,kBAAkB,CACvB,sBAAsB,EACtB,aAAa,EACb,WAAW,CACZ,CAAC;KACH;IAED,MAAM,KAAK,GAAG,IAAA,oBAAU,EACtB,IAAA,kBAAQ,EAAC,wBAAS,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAC1D,CAAC;IACF,MAAM,GAAG,GAAG,IAAA,sBAAY,EAAC,IAAA,gBAAM,EAAC,IAAA,eAAM,EAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;AACzD,CAAC;AAOC,gDAAkB"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../../lib.esm/address/index.js"],"sourcesContent":["/**\n * Addresses are a fundamental part of interacting with Core. They\n * represent the gloabal identity of Externally Owned Accounts (accounts\n * backed by a private key) and contracts.\n *\n * The Core Naming Service (CNS) provides an interconnected ecosystem\n * of contracts, standards and libraries which enable looking up an\n * address for an ENS name.\n *\n * These functions help convert between various formats, validate\n * addresses and safely resolve ENS names.\n *\n * @_section: api/address:Addresses [about-addresses]\n */\nnull;\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { encode } from \"../crypto/rlp.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexDataSlice, hexlify, stripZeros, } from \"../utils/data.js\";\nconst logger = new Logger(\"address/0.0.1\");\nconst precompiledAddresses = [\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n \"0000000000000000000000000000000000000000000000000000000000000001\",\n \"0000000000000000000000000000000000000000000000000000000000000002\",\n \"0000000000000000000000000000000000000000000000000000000000000003\",\n \"0000000000000000000000000000000000000000000000000000000000000004\",\n \"0000000000000000000000000000000000000000000000000000000000000005\",\n \"0000000000000000000000000000000000000000000000000000000000000006\",\n \"0000000000000000000000000000000000000000000000000000000000000007\",\n \"0000000000000000000000000000000000000000000000000000000000000008\",\n \"0000000000000000000000000000000000000000000000000000000000000009\",\n];\nfunction removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nfunction calculateCheckSum(_address, _prefix) {\n const address = getBytes(\"0x\" + _address.replace(\"0x\", \"\"));\n const prefix = getBytes(\"0x\" + _prefix.replace(\"0x\", \"\"));\n const tmpConcated = new Uint8Array([...address, ...prefix]);\n const hexedConcat = hexlify(tmpConcated).replace(\"0x\", \"\") + \"00\";\n const mods = Array.from(hexedConcat.toUpperCase(), (c) => {\n const charCode = c.charCodeAt(0);\n return charCode > 64 && charCode < 91\n ? (charCode - 55).toString()\n : (charCode - 48).toString();\n }).join(\"\");\n const bigVal = BigInt(mods);\n const val97 = BigInt(97);\n const val98 = BigInt(98);\n const remainder = bigVal % val97;\n const checkSum = val98 - remainder;\n const result = checkSum > 9 ? checkSum.toString() : \"0\" + checkSum.toString();\n return result;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address\n .split(\"\")\n .map((c) => {\n return ibanLookup[c];\n })\n .join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Core uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nfunction getAddress(address) {\n if (typeof address !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n const raw = removeHexPrefix(address);\n if (precompiledAddresses.includes(raw)) {\n return \"0x\" + raw;\n }\n const prefix = raw.substring(0, 2);\n const val = raw.substring(4);\n const checksum = calculateCheckSum(val, prefix);\n if (checksum !== raw.substring(2, 4)) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n return \"0x\" + prefix + checksum + val;\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nfunction getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\nfunction networkIdToPrefix(networkId) {\n if (networkId == 1) {\n return \"cb\";\n }\n else if (networkId == 3 || networkId == 4) {\n return \"ab\";\n }\n else if (networkId > 10 || networkId == 0) {\n return \"ce\";\n }\n else {\n logger.throwArgumentError(\"bad networkId\", \"networkId\", networkId);\n return \"\";\n }\n}\nfunction getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n const val = hexDataSlice(sha256(encode([from, nonce])), 12);\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, };\n//# sourceMappingURL=index.js.map"],"names":["Logger","getBytes","hexlify","stripZeros","arrayify","BigNumber","hexDataSlice","sha256","encode"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,eAAe,CAAC;AAC1C,MAAM,oBAAoB,GAAG;AAC7B,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,CAAC;AACD,SAAS,eAAe,CAAC,GAAG,EAAE;AAC9B,IAAI,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG;AAChE;AACA,SAAS,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE;AAC9C,IAAI,MAAM,OAAO,GAAGC,aAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC/D,IAAI,MAAM,MAAM,GAAGA,aAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,E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AAI,MAAM,GAAG,GAAGC,iBAAY,CAACC,WAAM,CAACC,UAAM,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC/D,IAAI,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AACvC,IAAI,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC;AACnD,IAAI,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC;AAC1D;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/bigNumber/bigNumber.d.ts.map b/lib.commonjs/bigNumber/bigNumber.d.ts.map index d71c9db78..5dcf4c8f7 100644 --- a/lib.commonjs/bigNumber/bigNumber.d.ts.map +++ b/lib.commonjs/bigNumber/bigNumber.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"bigNumber.d.ts","sourceRoot":"","sources":["../../src.ts/bigNumber/bigNumber.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,EACL,OAAO,EAIR,MAAM,kBAAkB,CAAC;AAS1B,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAExE,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,YAAY,CAUhE;AAKD,qBAAa,SAAU,YAAW,OAAO;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;gBAEnB,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM;IAmB9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIlC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIhC,GAAG,IAAI,SAAS;IAOhB,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAInC,GAAG,C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,MAAM,GAAG,SAAS,CAK5B;IAED,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAK5B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,MAAM,IAAI,OAAO,CAEhB;IAED,QAAQ,IAAI,MAAM,CAQjB;IAED,QAAQ,IAAI,MAAM,CAYjB;IAED,QAAQ,IAAI,MAAM,CAyBjB;IAED,WAAW,IAAI,MAAM,CAEpB;IAED,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAExB;IAED,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAuEjC;IAED,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAEjD;CACD;AA6ED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"} \ No newline at end of file diff --git a/lib.commonjs/bigNumber/bigNumber.js b/lib.commonjs/bigNumber/bigNumber.js index ee55f18fe..75ec96f44 100644 --- a/lib.commonjs/bigNumber/bigNumber.js +++ b/lib.commonjs/bigNumber/bigNumber.js @@ -1,19 +1,11 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports._base16To36 = exports._base36To16 = exports.BigNumber = exports.isBigNumberish = void 0; -const tslib_1 = require("tslib"); -/** - * BigNumber - * - * A wrapper around the BN.js object. We use the BN.js library - * because it is used by elliptic, so it is required regardless. - * - */ -const bn_js_1 = tslib_1.__importDefault(require("bn.js")); -const logger_js_1 = require("../logger/logger.js"); -const data_js_1 = require("../utils/data.js"); -var BN = bn_js_1.default.BN; -const logger = new logger_js_1.Logger("bigNumber/0.0.1"); +'use strict'; + +var _BN = require('bn.js'); +var logger$1 = require('../logger/logger.js'); +var data = require('../utils/data.js'); + +var BN = _BN.BN; +const logger = new logger$1.Logger("bigNumber/0.0.1"); const _constructorGuard = {}; const MAX_SAFE = 0x1fffffffffffff; function isBigNumberish(value) { @@ -21,11 +13,10 @@ function isBigNumberish(value) { (BigNumber.isBigNumber(value) || (typeof value === "number" && value % 1 === 0) || (typeof value === "string" && !!value.match(/^-?[0-9]+$/)) || - (0, data_js_1.isHexString)(value) || + data.isHexString(value) || typeof value === "bigint" || - (0, data_js_1.isBytes)(value))); + data.isBytes(value))); } -exports.isBigNumberish = isBigNumberish; // Only warn about passing 10 into radix once let _warnedToStringRadix = false; class BigNumber { @@ -34,7 +25,7 @@ class BigNumber { constructor(constructorGuard, hex) { logger.checkNew(new.target, BigNumber); if (constructorGuard !== _constructorGuard) { - logger.throwError("cannot call constructor directly; use BigNumber.from", logger_js_1.Logger.errors.UNSUPPORTED_OPERATION, { + logger.throwError("cannot call constructor directly; use BigNumber.from", logger$1.Logger.errors.UNSUPPORTED_OPERATION, { operation: "new (BigNumber)", }); } @@ -159,7 +150,7 @@ class BigNumber { return BigInt(this.toString()); } catch (e) { } - return logger.throwError("this platform does not support BigInt", logger_js_1.Logger.errors.UNSUPPORTED_OPERATION, { + return logger.throwError("this platform does not support BigInt", logger$1.Logger.errors.UNSUPPORTED_OPERATION, { value: this.toString(), }); } @@ -173,10 +164,10 @@ class BigNumber { } } else if (arguments[0] === 16) { - logger.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", logger_js_1.Logger.errors.UNEXPECTED_ARGUMENT, {}); + logger.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", logger$1.Logger.errors.UNEXPECTED_ARGUMENT, {}); } else { - logger.throwError("BigNumber.toString does not accept parameters", logger_js_1.Logger.errors.UNEXPECTED_ARGUMENT, {}); + logger.throwError("BigNumber.toString does not accept parameters", logger$1.Logger.errors.UNEXPECTED_ARGUMENT, {}); } } return toBN(this).toString(10); @@ -213,8 +204,8 @@ class BigNumber { if (typeof anyValue === "bigint") { return BigNumber.from(anyValue.toString()); } - if ((0, data_js_1.isBytes)(anyValue)) { - return BigNumber.from((0, data_js_1.hexlify)(anyValue)); + if (data.isBytes(anyValue)) { + return BigNumber.from(data.hexlify(anyValue)); } if (anyValue) { // Hexable interface (takes priority) @@ -232,8 +223,8 @@ class BigNumber { hex = anyValue.hex; } if (typeof hex === "string") { - if ((0, data_js_1.isHexString)(hex) || - (hex[0] === "-" && (0, data_js_1.isHexString)(hex.substring(1)))) { + if (data.isHexString(hex) || + (hex[0] === "-" && data.isHexString(hex.substring(1)))) { return BigNumber.from(hex); } } @@ -245,7 +236,6 @@ class BigNumber { return !!(value && value._isBigNumber); } } -exports.BigNumber = BigNumber; // Normalize the hex string // @ts-ignore function toHex(value) { @@ -305,16 +295,19 @@ function throwFault(fault, operation, value) { if (value != null) { params.value = value; } - return logger.throwError(fault, logger_js_1.Logger.errors.NUMERIC_FAULT, params); + return logger.throwError(fault, logger$1.Logger.errors.NUMERIC_FAULT, params); } // value should have no prefix function _base36To16(value) { return new BN(value, 36).toString(16); } -exports._base36To16 = _base36To16; // value should have no prefix function _base16To36(value) { return new BN(value, 16).toString(36); } + +exports.BigNumber = BigNumber; exports._base16To36 = _base16To36; -//# sourceMappingURL=bigNumber.js.map \ No newline at end of file +exports._base36To16 = _base36To16; +exports.isBigNumberish = isBigNumberish; +//# sourceMappingURL=bigNumber.js.map diff --git a/lib.commonjs/bigNumber/bigNumber.js.map b/lib.commonjs/bigNumber/bigNumber.js.map index e462166ef..4048029b7 100644 --- a/lib.commonjs/bigNumber/bigNumber.js.map +++ b/lib.commonjs/bigNumber/bigNumber.js.map @@ -1 +1 @@ -{"version":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QACjB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;KACtB;IAED,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,kBAAM,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACvE,CAAC;AAED,8BAA8B;AAC9B,SAAgB,WAAW,CAAC,KAAa;IACvC,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACxC,CAAC;AAFD,kCAEC;AAED,8BAA8B;AAC9B,SAAgB,WAAW,CAAC,KAAa;IACvC,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACxC,CAAC;AAFD,kCAEC"} \ No newline at end of file +{"version":3,"file":"bigNumber.js","sources":["../../lib.esm/bigNumber/bigNumber.js"],"sourcesContent":["\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { isBytes, hexlify, isHexString, } from \"../utils/data.js\";\nvar BN = _BN.BN;\nconst logger = new Logger(\"bigNumber/0.0.1\");\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null &&\n (BigNumber.isBigNumber(value) ||\n (typeof value === \"number\" && value % 1 === 0) ||\n (typeof value === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n typeof value === \"bigint\" ||\n isBytes(value)));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n _hex;\n _isBigNumber;\n constructor(constructorGuard, hex) {\n logger.checkNew(new.target, BigNumber);\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\",\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division by zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return this._hex[0] === \"-\";\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n // @ts-ignore\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString(),\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof value === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof value === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof anyValue === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof hex === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof hex === \"string\") {\n if (isHexString(hex) ||\n (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\n// @ts-ignore\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof value !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\n// @ts-ignore\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\n// @ts-ignore\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return new BN(\"-\" + hex.substring(3), 16);\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return new BN(value, 36).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return new BN(value, 16).toString(36);\n}\n//# sourceMappingURL=bigNumber.js.map"],"names":["Logger","isHexString","isBytes","hexlify"],"mappings":";;;;;;AAWA,IAAI,EAAE,GAAG,GAAG,CAAC,EAAE;AACf,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,iBAAiB,CAAC;AAC5C,MAAM,iBAAiB,GAAG,EAAE;AAC5B,MAAM,QAAQ,GAAG,gBAAgB;AAC1B,SAAS,cAAc,CAAC,KAAK,EAAE;AACtC,IAAI,QAAQ,KAAK,IAAI,IAAI;AACzB,SAAS,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;AACrC,aAAa,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;AAC1D,aAAa,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACtE,YAAYC,gBAAW,CAAC,KAAK,CAAC;AAC9B,YAAY,OAAO,KAAK,KAAK,QAAQ;AACrC,YAAYC,YAAO,CAAC,KAAK,CAAC,CAAC;AAC3B;AACA;AACA,IAAI,oBAAoB,GAAG,KAAK;AACzB,MAAM,SAAS,CAAC;AACvB,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,IAAI,WAAW,CAAC,gBAAgB,EAAE,GAAG,EAAE;AACvC,QAAQ,M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M,CAAC,UAAU,CAAC,KAAK,EAAED,eAAM,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC;AACxE;AACA;AACO,SAAS,WAAW,CAAC,KAAK,EAAE;AACnC,IAAI,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AACzC;AACA;AACO,SAAS,WAAW,CAAC,KAAK,EAAE;AACnC,IAAI,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AACzC;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/cip/custom-units.d.ts b/lib.commonjs/cip/custom-units.d.ts new file mode 100644 index 000000000..58031982f --- /dev/null +++ b/lib.commonjs/cip/custom-units.d.ts @@ -0,0 +1,33 @@ +import type { AddressLike } from "../address/index.js"; +import { Contract } from "../contract/index.js"; +import type { BlockTag, ContractRunner } from "../providers/index.js"; +export declare const customUnitAbi: readonly string[]; +export declare class CustomUnitDiscovery { + readonly preferredUnit: string; + readonly supportedUnits: readonly string[]; + constructor(units: readonly string[], preferredUnit: string); + get isValid(): boolean; + supports(unit: string): boolean; +} +/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ +export declare class CustomUnitBalance { + readonly canonicalAmount: bigint; + readonly unitAmount: bigint; + readonly unit: string; + constructor(canonicalAmount: bigint, unitAmount: bigint, unit: string); + get multiplierNumerator(): bigint; + get multiplierDenominator(): bigint; +} +/** Core custom-unit contract convention used by Tone and Core API. */ +export declare class CustomUnitToken { + readonly contract: Contract; + constructor(address: string, runner: ContractRunner); + supportsUnit(unit: string, blockTag?: BlockTag): Promise; + supportedUnits(blockTag?: BlockTag): Promise; + preferredUnit(blockTag?: BlockTag): Promise; + discover(blockTag?: BlockTag): Promise; + canonicalBalance(account: AddressLike, blockTag?: BlockTag): Promise; + balanceOfUnit(account: AddressLike, unit: string, blockTag?: BlockTag): Promise; + balance(account: AddressLike, unit?: string, blockTag?: BlockTag): Promise; +} +//# sourceMappingURL=custom-units.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/cip/custom-units.d.ts.map b/lib.commonjs/cip/custom-units.d.ts.map new file mode 100644 index 000000000..69faaea75 --- /dev/null +++ b/lib.commonjs/cip/custom-units.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"custom-units.d.ts","sourceRoot":"","sources":["../../src.ts/cip/custom-units.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,eAAO,MAAM,aAAa,mBAMxB,CAAC;AACH,qBAAa,mBAAmB;IAI9B,QAAQ,CAAC,aAAa,EAAE,MAAM;IAH/B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,YACC,KAAK,EAAE,SAAS,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,EAG9B;IACD,IAAI,OAAO,IAAI,OAAO,CAMrB;IACD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9B;CACD;AACD,iFAAiF;AACjF,qBAAa,iBAAiB;IAE5B,QAAQ,CAAC,eAAe,EAAE,MAAM;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM;IAHtB,YACU,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAClB;IACJ,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IACD,IAAI,qBAAqB,IAAI,MAAM,CAElC;CACD;AACD,sEAAsE;AACtE,qBAAa,eAAe;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,YAAY,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAElD;IACK,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAKtE;IACK,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAIpE;IACK,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAExD;IACK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAOvE;IACD,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3E;IACD,aAAa,CACZ,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,CAAC,CAGjB;IACK,OAAO,CACZ,OAAO,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAO5B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/cip/custom-units.js b/lib.commonjs/cip/custom-units.js new file mode 100644 index 000000000..483a9ed29 --- /dev/null +++ b/lib.commonjs/cip/custom-units.js @@ -0,0 +1,117 @@ +'use strict'; + +var contract = require('../contract/contract.js'); +require('../abi/abi-coder.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../abi/fragments.js'); +require('../crypto/keccak.js'); +require('../crypto/sha3.js'); +require('../constants/numbers.js'); +require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +require('../providers/provider.js'); + +const customUnitAbi = Object.freeze([ + "function supportsUnit(string unit) view returns (bool)", + "function supportedUnits() view returns (string[])", + "function preferredUnit() view returns (string)", + "function balanceOf(address account) view returns (uint256)", + "function balanceOfUnit(address account, string unit) view returns (uint256)", +]); +class CustomUnitDiscovery { + preferredUnit; + supportedUnits; + constructor(units, preferredUnit) { + this.preferredUnit = preferredUnit; + this.supportedUnits = Object.freeze([...units]); + } + get isValid() { + return (this.supports("units") && + this.preferredUnit !== "" && + this.supports(this.preferredUnit)); + } + supports(unit) { + return this.supportedUnits.includes(unit); + } +} +/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ +class CustomUnitBalance { + canonicalAmount; + unitAmount; + unit; + constructor(canonicalAmount, unitAmount, unit) { + this.canonicalAmount = canonicalAmount; + this.unitAmount = unitAmount; + this.unit = unit; + } + get multiplierNumerator() { + return this.unitAmount; + } + get multiplierDenominator() { + return this.canonicalAmount; + } +} +/** Core custom-unit contract convention used by Tone and Core API. */ +class CustomUnitToken { + contract; + constructor(address, runner) { + this.contract = new contract.Contract(address, customUnitAbi, runner); + } + async supportsUnit(unit, blockTag) { + return (unit.trim() !== "" && + (await this.contract.supportsUnit(unit.trim(), { blockTag }))); + } + async supportedUnits(blockTag) { + return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag }))); + } + async preferredUnit(blockTag) { + return (await this.contract.preferredUnit({ blockTag })).trim(); + } + async discover(blockTag) { + if (!(await this.supportsUnit("units", blockTag))) + return null; + const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag)); + return discovery.isValid ? discovery : null; + } + canonicalBalance(account, blockTag) { + return this.contract.balanceOf(account, { blockTag }); + } + balanceOfUnit(account, unit, blockTag) { + if (!unit.trim()) + throw new TypeError("unit must not be empty"); + return this.contract.balanceOfUnit(account, unit.trim(), { blockTag }); + } + async balance(account, unit, blockTag) { + const resolved = unit?.trim() || (await this.preferredUnit(blockTag)); + const [canonical, calculated] = await Promise.all([ + this.canonicalBalance(account, blockTag), + this.balanceOfUnit(account, resolved, blockTag), + ]); + return new CustomUnitBalance(canonical, calculated, resolved); + } +} + +exports.CustomUnitBalance = CustomUnitBalance; +exports.CustomUnitDiscovery = CustomUnitDiscovery; +exports.CustomUnitToken = CustomUnitToken; +exports.customUnitAbi = customUnitAbi; +//# sourceMappingURL=custom-units.js.map diff --git a/lib.commonjs/cip/custom-units.js.map b/lib.commonjs/cip/custom-units.js.map new file mode 100644 index 000000000..33da55ab8 --- /dev/null +++ b/lib.commonjs/cip/custom-units.js.map @@ -0,0 +1 @@ +{"version":3,"file":"custom-units.js","sources":["../../lib.esm/cip/custom-units.js"],"sourcesContent":["import { Contract } from \"../contract/index.js\";\nexport const customUnitAbi = Object.freeze([\n \"function supportsUnit(string unit) view returns (bool)\",\n \"function supportedUnits() view returns (string[])\",\n \"function preferredUnit() view returns (string)\",\n \"function balanceOf(address account) view returns (uint256)\",\n \"function balanceOfUnit(address account, string unit) view returns (uint256)\",\n]);\nexport class CustomUnitDiscovery {\n preferredUnit;\n supportedUnits;\n constructor(units, preferredUnit) {\n this.preferredUnit = preferredUnit;\n this.supportedUnits = Object.freeze([...units]);\n }\n get isValid() {\n return (this.supports(\"units\") &&\n this.preferredUnit !== \"\" &&\n this.supports(this.preferredUnit));\n }\n supports(unit) {\n return this.supportedUnits.includes(unit);\n }\n}\n/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */\nexport class CustomUnitBalance {\n canonicalAmount;\n unitAmount;\n unit;\n constructor(canonicalAmount, unitAmount, unit) {\n this.canonicalAmount = canonicalAmount;\n this.unitAmount = unitAmount;\n this.unit = unit;\n }\n get multiplierNumerator() {\n return this.unitAmount;\n }\n get multiplierDenominator() {\n return this.canonicalAmount;\n }\n}\n/** Core custom-unit contract convention used by Tone and Core API. */\nexport class CustomUnitToken {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, customUnitAbi, runner);\n }\n async supportsUnit(unit, blockTag) {\n return (unit.trim() !== \"\" &&\n (await this.contract.supportsUnit(unit.trim(), { blockTag })));\n }\n async supportedUnits(blockTag) {\n return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag })));\n }\n async preferredUnit(blockTag) {\n return (await this.contract.preferredUnit({ blockTag })).trim();\n }\n async discover(blockTag) {\n if (!(await this.supportsUnit(\"units\", blockTag)))\n return null;\n const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag));\n return discovery.isValid ? discovery : null;\n }\n canonicalBalance(account, blockTag) {\n return this.contract.balanceOf(account, { blockTag });\n }\n balanceOfUnit(account, unit, blockTag) {\n if (!unit.trim())\n throw new TypeError(\"unit must not be empty\");\n return this.contract.balanceOfUnit(account, unit.trim(), { blockTag });\n }\n async balance(account, unit, blockTag) {\n const resolved = unit?.trim() || (await this.preferredUnit(blockTag));\n const [canonical, calculated] = await Promise.all([\n this.canonicalBalance(account, blockTag),\n this.balanceOfUnit(account, resolved, blockTag),\n ]);\n return new CustomUnitBalance(canonical, calculated, resolved);\n }\n}\n//# sourceMappingURL=custom-units.js.map"],"names":["Contract"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACY,MAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;AAC3C,IAAI,wDAAwD;AAC5D,IAAI,mDAAmD;AACvD,IAAI,gDAAgD;AACpD,IAAI,4DAA4D;AAChE,IAAI,6EAA6E;AACjF,CAAC;AACM,MAAM,mBAAmB,CAAC;AACjC,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,IAAI,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE;AACtC,QAAQ,IAAI,CAAC,aAAa,GAAG,aAAa;AAC1C,QAAQ,IAAI,CAAC,cAAc,GAAG,MAAM,CA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AAE,QAAQ,EAAE,CAAC;AAC9E,IAAI;AACJ,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC3C,QAAQ,MAAM,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAC7E,QAAQ,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;AAC1D,YAAY,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC;AACpD,YAAY,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;AAC3D,SAAS,CAAC;AACV,QAAQ,OAAO,IAAI,iBAAiB,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC;AACrE,IAAI;AACJ;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/cip/index.d.ts b/lib.commonjs/cip/index.d.ts new file mode 100644 index 000000000..cdd86e31b --- /dev/null +++ b/lib.commonjs/cip/index.d.ts @@ -0,0 +1,49 @@ +import { Contract } from "../contract/index.js"; +import type { Overrides, ContractTransactionResponse } from "../contract/index.js"; +import type { BlockTag, ContractRunner } from "../providers/index.js"; +import { IpfsGateway } from "../ipfs/index.js"; +/** On-chain interface defined by CIP-150. */ +export declare const cip150Abi: readonly string[]; +export interface Cip150MetadataEntry { + readonly key: string; + readonly value: string; + readonly sealed?: boolean; +} +export declare const cip151TokenExpirationKey = "tokenExpiration"; +export declare const cip151TradingStopKey = "tradingStop"; +export declare const cip152LabKey = "lab"; +/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ +export declare class Cip151Lifecycle { + readonly tokenExpiration: bigint | null; + readonly tradingStop: bigint | null; + constructor(metadata?: Readonly>); + isExpiredAt(seconds: bigint): boolean; + isTradingStoppedAt(seconds: bigint): boolean; +} +export interface Cip152LabMeasurement { + readonly value: string | number; + readonly unit?: string; +} +/** Validates certificate structure, not the authenticity of its issuer. */ +export declare class Cip152LabCertificate { + readonly measurements: Readonly>; + constructor(json: unknown); +} +/** Typed metadata reader and writer. Writes require a signer as runner. */ +export declare class Cip150MetadataContract { + readonly contract: Contract; + constructor(address: string, runner: ContractRunner); + getValue(key: string, blockTag?: BlockTag): Promise; + hasKey(key: string, blockTag?: BlockTag): Promise; + isSealed(key: string, blockTag?: BlockTag): Promise; + listKeys(blockTag?: BlockTag): Promise; + getByIndex(index: bigint, blockTag?: BlockTag): Promise; + count(blockTag?: BlockTag): Promise; + readAll(blockTag?: BlockTag, includeSealedState?: boolean): Promise; + setValue(key: string, value: string, overrides?: Overrides): Promise; + sealKey(key: string, overrides?: Overrides): Promise; + readLifecycle(blockTag?: BlockTag): Promise; + readLabCertificate(gateway: IpfsGateway, blockTag?: BlockTag): Promise; +} +export { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from "./custom-units.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/cip/index.d.ts.map b/lib.commonjs/cip/index.d.ts.map new file mode 100644 index 000000000..d0120ee3c --- /dev/null +++ b/lib.commonjs/cip/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/cip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EACX,SAAS,EACT,2BAA2B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,6CAA6C;AAC7C,eAAO,MAAM,SAAS,mBASpB,CAAC;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,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AAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAE3D;IACK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAI9D;IACK,UAAU,CACf,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAK9B;IACD,KAAK,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1C;IACK,OAAO,CACZ,QAAQ,CAAC,EAAE,QAAQ,EACnB,kBAAkB,UAAO,GACvB,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC,CAazC;IACD,QAAQ,CACP,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,SAAc,GACvB,OAAO,CAAC,2BAA2B,CAAC,CAEtC;IACD,OAAO,CACN,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,SAAc,GACvB,OAAO,CAAC,2BAA2B,CAAC,CAEtC;IACK,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAOjE;IACK,kBAAkB,CACvB,OAAO,EAAE,WAAW,EACpB,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAMtC;CACD;AACD,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACb,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/cip/index.js b/lib.commonjs/cip/index.js new file mode 100644 index 000000000..0178da54f --- /dev/null +++ b/lib.commonjs/cip/index.js @@ -0,0 +1,167 @@ +'use strict'; + +var contract = require('../contract/contract.js'); +require('../abi/abi-coder.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../abi/fragments.js'); +require('../crypto/keccak.js'); +require('../crypto/sha3.js'); +require('../constants/numbers.js'); +require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +require('../providers/provider.js'); +var customUnits = require('./custom-units.js'); + +/** On-chain interface defined by CIP-150. */ +const cip150Abi = Object.freeze([ + "function getMetadataValue(string key) view returns (string value)", + "function hasMetadataKey(string key) view returns (bool exists)", + "function isMetadataSealed(string key) view returns (bool sealed)", + "function listMetadataKeys() view returns (string[] keys)", + "function getMetadataByIndex(uint256 index) view returns (string key, string value)", + "function metadataCount() view returns (uint256 total)", + "function setMetadataValue(string key, string value)", + "function sealMetadataKey(string key)", +]); +const cip151TokenExpirationKey = "tokenExpiration"; +const cip151TradingStopKey = "tradingStop"; +const cip152LabKey = "lab"; +/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ +class Cip151Lifecycle { + tokenExpiration; + tradingStop; + constructor(metadata = {}) { + const parse = (key) => { + const value = metadata[key]; + if (value == null || value === "") + return null; + if (!/^\d+$/.test(value)) + throw new TypeError(`${key} must be a non-negative Unix timestamp`); + return BigInt(value); + }; + this.tokenExpiration = parse(cip151TokenExpirationKey); + this.tradingStop = parse(cip151TradingStopKey); + } + isExpiredAt(seconds) { + return this.tokenExpiration !== null && seconds >= this.tokenExpiration; + } + isTradingStoppedAt(seconds) { + return this.tradingStop !== null && seconds >= this.tradingStop; + } +} +/** Validates certificate structure, not the authenticity of its issuer. */ +class Cip152LabCertificate { + measurements; + constructor(json) { + if (json === null || typeof json !== "object" || Array.isArray(json)) + throw new TypeError("CIP-152 lab.json must be an object"); + const measurements = Object.create(null); + for (const [key, property] of Object.entries(json)) { + if (!property || + typeof property !== "object" || + Array.isArray(property) || + !Object.hasOwn(property, "value")) + throw new TypeError(`CIP-152 property ${key} must contain a value`); + const { value, unit } = property; + if (!(typeof value === "string" || + (typeof value === "number" && Number.isFinite(value)))) + throw new TypeError(`CIP-152 property ${key} has an invalid value`); + if (unit != null && typeof unit !== "string") + throw new TypeError(`CIP-152 property ${key} has an invalid unit`); + measurements[key] = Object.freeze(unit == null ? { value } : { value, unit }); + } + this.measurements = Object.freeze(measurements); + } +} +/** Typed metadata reader and writer. Writes require a signer as runner. */ +class Cip150MetadataContract { + contract; + constructor(address, runner) { + this.contract = new contract.Contract(address, cip150Abi, runner); + } + getValue(key, blockTag) { + return this.contract.getMetadataValue(key, { blockTag }); + } + hasKey(key, blockTag) { + return this.contract.hasMetadataKey(key, { blockTag }); + } + isSealed(key, blockTag) { + return this.contract.isMetadataSealed(key, { blockTag }); + } + async listKeys(blockTag) { + return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag }))); + } + async getByIndex(index, blockTag) { + const [key, value] = await this.contract.getMetadataByIndex(index, { + blockTag, + }); + return Object.freeze({ key, value }); + } + count(blockTag) { + return this.contract.metadataCount({ blockTag }); + } + async readAll(blockTag, includeSealedState = true) { + const entries = []; + for (const key of await this.listKeys(blockTag)) { + const value = await this.getValue(key, blockTag); + entries.push(Object.freeze(includeSealedState + ? { key, value, sealed: await this.isSealed(key, blockTag) } + : { key, value })); + } + return Object.freeze(entries); + } + setValue(key, value, overrides = {}) { + return this.contract.setMetadataValue(key, value, overrides); + } + sealKey(key, overrides = {}) { + return this.contract.sealMetadataKey(key, overrides); + } + async readLifecycle(blockTag) { + const metadata = {}; + for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) { + if (await this.hasKey(key, blockTag)) + metadata[key] = await this.getValue(key, blockTag); + } + return new Cip151Lifecycle(metadata); + } + async readLabCertificate(gateway, blockTag) { + if (!(await this.hasKey(cip152LabKey, blockTag))) + return null; + const reference = await this.getValue(cip152LabKey, blockTag); + if (!gateway.resolve(reference).pathname.endsWith("/lab.json")) + throw new TypeError("CIP-152 reference must point to lab.json"); + return new Cip152LabCertificate(await gateway.readJson(reference)); + } +} + +exports.CustomUnitBalance = customUnits.CustomUnitBalance; +exports.CustomUnitDiscovery = customUnits.CustomUnitDiscovery; +exports.CustomUnitToken = customUnits.CustomUnitToken; +exports.customUnitAbi = customUnits.customUnitAbi; +exports.Cip150MetadataContract = Cip150MetadataContract; +exports.Cip151Lifecycle = Cip151Lifecycle; +exports.Cip152LabCertificate = Cip152LabCertificate; +exports.cip150Abi = cip150Abi; +exports.cip151TokenExpirationKey = cip151TokenExpirationKey; +exports.cip151TradingStopKey = cip151TradingStopKey; +exports.cip152LabKey = cip152LabKey; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/cip/index.js.map b/lib.commonjs/cip/index.js.map new file mode 100644 index 000000000..726708259 --- /dev/null +++ b/lib.commonjs/cip/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../lib.esm/cip/index.js"],"sourcesContent":["import { Contract } from \"../contract/index.js\";\n/** On-chain interface defined by CIP-150. */\nexport const cip150Abi = Object.freeze([\n \"function getMetadataValue(string key) view returns (string value)\",\n \"function hasMetadataKey(string key) view returns (bool exists)\",\n \"function isMetadataSealed(string key) view returns (bool sealed)\",\n \"function listMetadataKeys() view returns (string[] keys)\",\n \"function getMetadataByIndex(uint256 index) view returns (string key, string value)\",\n \"function metadataCount() view returns (uint256 total)\",\n \"function setMetadataValue(string key, string value)\",\n \"function sealMetadataKey(string key)\",\n]);\nexport const cip151TokenExpirationKey = \"tokenExpiration\";\nexport const cip151TradingStopKey = \"tradingStop\";\nexport const cip152LabKey = \"lab\";\n/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */\nexport class Cip151Lifecycle {\n tokenExpiration;\n tradingStop;\n constructor(metadata = {}) {\n const parse = (key) => {\n const value = metadata[key];\n if (value == null || value === \"\")\n return null;\n if (!/^\\d+$/.test(value))\n throw new TypeError(`${key} must be a non-negative Unix timestamp`);\n return BigInt(value);\n };\n this.tokenExpiration = parse(cip151TokenExpirationKey);\n this.tradingStop = parse(cip151TradingStopKey);\n }\n isExpiredAt(seconds) {\n return this.tokenExpiration !== null && seconds >= this.tokenExpiration;\n }\n isTradingStoppedAt(seconds) {\n return this.tradingStop !== null && seconds >= this.tradingStop;\n }\n}\n/** Validates certificate structure, not the authenticity of its issuer. */\nexport class Cip152LabCertificate {\n measurements;\n constructor(json) {\n if (json === null || typeof json !== \"object\" || Array.isArray(json))\n throw new TypeError(\"CIP-152 lab.json must be an object\");\n const measurements = Object.create(null);\n for (const [key, property] of Object.entries(json)) {\n if (!property ||\n typeof property !== \"object\" ||\n Array.isArray(property) ||\n !Object.hasOwn(property, \"value\"))\n throw new TypeError(`CIP-152 property ${key} must contain a value`);\n const { value, unit } = property;\n if (!(typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value))))\n throw new TypeError(`CIP-152 property ${key} has an invalid value`);\n if (unit != null && typeof unit !== \"string\")\n throw new TypeError(`CIP-152 property ${key} has an invalid unit`);\n measurements[key] = Object.freeze(unit == null ? { value } : { value, unit });\n }\n this.measurements = Object.freeze(measurements);\n }\n}\n/** Typed metadata reader and writer. Writes require a signer as runner. */\nexport class Cip150MetadataContract {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, cip150Abi, runner);\n }\n getValue(key, blockTag) {\n return this.contract.getMetadataValue(key, { blockTag });\n }\n hasKey(key, blockTag) {\n return this.contract.hasMetadataKey(key, { blockTag });\n }\n isSealed(key, blockTag) {\n return this.contract.isMetadataSealed(key, { blockTag });\n }\n async listKeys(blockTag) {\n return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag })));\n }\n async getByIndex(index, blockTag) {\n const [key, value] = await this.contract.getMetadataByIndex(index, {\n blockTag,\n });\n return Object.freeze({ key, value });\n }\n count(blockTag) {\n return this.contract.metadataCount({ blockTag });\n }\n async readAll(blockTag, includeSealedState = true) {\n const entries = [];\n for (const key of await this.listKeys(blockTag)) {\n const value = await this.getValue(key, blockTag);\n entries.push(Object.freeze(includeSealedState\n ? { key, value, sealed: await this.isSealed(key, blockTag) }\n : { key, value }));\n }\n return Object.freeze(entries);\n }\n setValue(key, value, overrides = {}) {\n return this.contract.setMetadataValue(key, value, overrides);\n }\n sealKey(key, overrides = {}) {\n return this.contract.sealMetadataKey(key, overrides);\n }\n async readLifecycle(blockTag) {\n const metadata = {};\n for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) {\n if (await this.hasKey(key, blockTag))\n metadata[key] = await this.getValue(key, blockTag);\n }\n return new Cip151Lifecycle(metadata);\n }\n async readLabCertificate(gateway, blockTag) {\n if (!(await this.hasKey(cip152LabKey, blockTag)))\n return null;\n const reference = await this.getValue(cip152LabKey, blockTag);\n if (!gateway.resolve(reference).pathname.endsWith(\"/lab.json\"))\n throw new TypeError(\"CIP-152 reference must point to lab.json\");\n return new Cip152LabCertificate(await gateway.readJson(reference));\n }\n}\nexport { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from \"./custom-units.js\";\n//# sourceMappingURL=index.js.map"],"names":["Contract"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACY,MAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;AACvC,IAAI,mEAAmE;AACvE,IAAI,gEAAgE;AACpE,IAAI,kEAAkE;AACtE,IAAI,0DAA0D;AAC9D,IAAI,oFAAoF;AACxF,IAAI,uDAAuD;AAC3D,IAAI,qDAAqD;AACzD,IAAI,sCAAsC;AAC1C,CAAC;AACW,MAAC,wBAAwB,GAAG;AAC5B,MAAC,oBAAoB,GAAG;AACxB,MAAC,YAAY,GAAG;AAC5B;AACO,MAAM,eAAe,CAAC;AAC7B,IAAI,eAAe;AACnB,IAAI,WAAW;AACf,IAAI,WAAW,CAAC,QAAQ,GAAG,EAAE,EAAE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CAAC,OAAO,EAAE,QAAQ,EAAE;AAChD,QAAQ,IAAI,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AACxD,YAAY,OAAO,IAAI;AACvB,QAAQ,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;AACrE,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC;AACtE,YAAY,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC;AAC3E,QAAQ,OAAO,IAAI,oBAAoB,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC1E,IAAI;AACJ;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/addresses.js b/lib.commonjs/constants/addresses.js index ff4fb40a5..3b1640315 100644 --- a/lib.commonjs/constants/addresses.js +++ b/lib.commonjs/constants/addresses.js @@ -1,10 +1,11 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ZeroAddress = void 0; +'use strict'; + /** * A constant for the zero address. * * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) */ -exports.ZeroAddress = "0x0000000000000000000000000000000000000000"; -//# sourceMappingURL=addresses.js.map \ No newline at end of file +const ZeroAddress = "0x0000000000000000000000000000000000000000"; + +exports.ZeroAddress = ZeroAddress; +//# sourceMappingURL=addresses.js.map diff --git a/lib.commonjs/constants/addresses.js.map b/lib.commonjs/constants/addresses.js.map index e6f9509d5..7d6277974 100644 --- a/lib.commonjs/constants/addresses.js.map +++ b/lib.commonjs/constants/addresses.js.map @@ -1 +1 @@ -{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../src.ts/constants/addresses.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,WAAW,GAAW,4CAA4C,CAAC"} \ No newline at end of file +{"version":3,"file":"addresses.js","sources":["../../lib.esm/constants/addresses.js"],"sourcesContent":["/**\n * A constant for the zero address.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000\"``)\n */\nexport const ZeroAddress = \"0x0000000000000000000000000000000000000000\";\n//# sourceMappingURL=addresses.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACY,MAAC,WAAW,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/hashes.d.ts.map b/lib.commonjs/constants/hashes.d.ts.map index ef1df7d58..225420a8c 100644 --- a/lib.commonjs/constants/hashes.d.ts.map +++ b/lib.commonjs/constants/hashes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAC+C,CAAC"} \ No newline at end of file +{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAC8C,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/constants/hashes.js b/lib.commonjs/constants/hashes.js index fbcd74c86..a6d63f064 100644 --- a/lib.commonjs/constants/hashes.js +++ b/lib.commonjs/constants/hashes.js @@ -1,10 +1,11 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ZeroHash = void 0; +'use strict'; + /** * A constant for the zero hash. * * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) */ -exports.ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; -//# sourceMappingURL=hashes.js.map \ No newline at end of file +const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; + +exports.ZeroHash = ZeroHash; +//# sourceMappingURL=hashes.js.map diff --git a/lib.commonjs/constants/hashes.js.map b/lib.commonjs/constants/hashes.js.map index d2ccd4b9d..074999b16 100644 --- a/lib.commonjs/constants/hashes.js.map +++ b/lib.commonjs/constants/hashes.js.map @@ -1 +1 @@ -{"version":3,"file":"hashes.js","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,QAAQ,GACnB,oEAAoE,CAAC"} \ No newline at end of file +{"version":3,"file":"hashes.js","sources":["../../lib.esm/constants/hashes.js"],"sourcesContent":["/**\n * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/index.d.ts.map b/lib.commonjs/constants/index.d.ts.map index 0c26e029d..d703c7245 100644 --- a/lib.commonjs/constants/index.d.ts.map +++ b/lib.commonjs/constants/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/constants/index.js b/lib.commonjs/constants/index.js index a8e8a6b27..afd46fd37 100644 --- a/lib.commonjs/constants/index.js +++ b/lib.commonjs/constants/index.js @@ -1,26 +1,23 @@ -"use strict"; -/** - * Some common constants useful for Core. - * - * @_section: api/constants: Constants [about-constants] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MessagePrefix = exports.CoreSymbol = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.OrePerXCB = exports.Two = exports.One = exports.Zero = exports.NegativeOne = exports.N = exports.ZeroHash = exports.ZeroAddress = void 0; -var addresses_js_1 = require("./addresses.js"); -Object.defineProperty(exports, "ZeroAddress", { enumerable: true, get: function () { return addresses_js_1.ZeroAddress; } }); -var hashes_js_1 = require("./hashes.js"); -Object.defineProperty(exports, "ZeroHash", { enumerable: true, get: function () { return hashes_js_1.ZeroHash; } }); -var numbers_js_1 = require("./numbers.js"); -Object.defineProperty(exports, "N", { enumerable: true, get: function () { return numbers_js_1.N; } }); -Object.defineProperty(exports, "NegativeOne", { enumerable: true, get: function () { return numbers_js_1.NegativeOne; } }); -Object.defineProperty(exports, "Zero", { enumerable: true, get: function () { return numbers_js_1.Zero; } }); -Object.defineProperty(exports, "One", { enumerable: true, get: function () { return numbers_js_1.One; } }); -Object.defineProperty(exports, "Two", { enumerable: true, get: function () { return numbers_js_1.Two; } }); -Object.defineProperty(exports, "OrePerXCB", { enumerable: true, get: function () { return numbers_js_1.OrePerXCB; } }); -Object.defineProperty(exports, "MaxUint256", { enumerable: true, get: function () { return numbers_js_1.MaxUint256; } }); -Object.defineProperty(exports, "MinInt256", { enumerable: true, get: function () { return numbers_js_1.MinInt256; } }); -Object.defineProperty(exports, "MaxInt256", { enumerable: true, get: function () { return numbers_js_1.MaxInt256; } }); -var strings_js_1 = require("./strings.js"); -Object.defineProperty(exports, "CoreSymbol", { enumerable: true, get: function () { return strings_js_1.CoreSymbol; } }); -Object.defineProperty(exports, "MessagePrefix", { enumerable: true, get: function () { return strings_js_1.MessagePrefix; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var addresses = require('./addresses.js'); +var hashes = require('./hashes.js'); +var numbers = require('./numbers.js'); +var strings = require('./strings.js'); + + + +exports.ZeroAddress = addresses.ZeroAddress; +exports.ZeroHash = hashes.ZeroHash; +exports.MaxInt256 = numbers.MaxInt256; +exports.MaxUint256 = numbers.MaxUint256; +exports.MinInt256 = numbers.MinInt256; +exports.N = numbers.N; +exports.NegativeOne = numbers.NegativeOne; +exports.One = numbers.One; +exports.OrePerXCB = numbers.OrePerXCB; +exports.Two = numbers.Two; +exports.Zero = numbers.Zero; +exports.CoreSymbol = strings.CoreSymbol; +exports.MessagePrefix = strings.MessagePrefix; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/constants/index.js.map b/lib.commonjs/constants/index.js.map index e9bc2ce70..3509b69b8 100644 --- a/lib.commonjs/constants/index.js.map +++ b/lib.commonjs/constants/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AACjB,2CAUsB;AATpB,+FAAA,CAAC,OAAA;AACD,yGAAA,WAAW,OAAA;AACX,kGAAA,IAAI,OAAA;AACJ,iGAAA,GAAG,OAAA;AACH,iGAAA,GAAG,OAAA;AACH,uGAAA,SAAS,OAAA;AACT,wGAAA,UAAU,OAAA;AACV,uGAAA,SAAS,OAAA;AACT,uGAAA,SAAS,OAAA;AAEX,2CAAyD;AAAhD,wGAAA,UAAU,OAAA;AAAE,2GAAA,aAAa,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/numbers.d.ts.map b/lib.commonjs/constants/numbers.d.ts.map index 7e7f487f7..927678af4 100644 --- a/lib.commonjs/constants/numbers.d.ts.map +++ b/lib.commonjs/constants/numbers.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAEf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEZ,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAiC,CAAC;AAC5D,eAAO,MAAM,IAAI,EAAE,MAAgC,CAAC;AACpD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC;AACnD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC"} \ No newline at end of file +{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAEf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEb,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAiC,CAAC;AAC5D,eAAO,MAAM,IAAI,EAAE,MAAgC,CAAC;AACpD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC;AACnD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/constants/numbers.js b/lib.commonjs/constants/numbers.js index 4ace3630f..740548101 100644 --- a/lib.commonjs/constants/numbers.js +++ b/lib.commonjs/constants/numbers.js @@ -1,39 +1,48 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Two = exports.One = exports.Zero = exports.NegativeOne = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.OrePerXCB = exports.N = void 0; +'use strict'; + /** * A constant for the order N for the secp256k1 curve. * * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) */ -exports.N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); +const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); /** * A constant for the number of ore in a single xcb. * * (**i.e.** ``1000000000000000000n``) */ -exports.OrePerXCB = BigInt("1000000000000000000"); +const OrePerXCB = BigInt("1000000000000000000"); /** * A constant for the maximum value for a ``uint256``. * * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) */ -exports.MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); +const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); /** * A constant for the minimum value for an ``int256``. * * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) */ -exports.MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * +const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * BigInt(-1); /** * A constant for the maximum value for an ``int256``. * * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) */ -exports.MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -exports.NegativeOne = BigInt(-1); -exports.Zero = BigInt(0); -exports.One = BigInt(1); -exports.Two = BigInt(2); -//# sourceMappingURL=numbers.js.map \ No newline at end of file +const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); +const NegativeOne = /*#__PURE__*/ BigInt(-1); +const Zero = /*#__PURE__*/ BigInt(0); +const One = /*#__PURE__*/ BigInt(1); +const Two = /*#__PURE__*/ BigInt(2); + +exports.MaxInt256 = MaxInt256; +exports.MaxUint256 = MaxUint256; +exports.MinInt256 = MinInt256; +exports.N = N; +exports.NegativeOne = NegativeOne; +exports.One = One; +exports.OrePerXCB = OrePerXCB; +exports.Two = Two; +exports.Zero = Zero; +//# sourceMappingURL=numbers.js.map diff --git a/lib.commonjs/constants/numbers.js.map b/lib.commonjs/constants/numbers.js.map index bded42aec..c81780848 100644 --- a/lib.commonjs/constants/numbers.js.map +++ b/lib.commonjs/constants/numbers.js.map @@ -1 +1 @@ -{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,CAAC,GAAW,MAAM,CAC7B,oEAAoE,CACrE,CAAC;AAEF;;;;GAIG;AACU,QAAA,SAAS,GAAW,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAE/D;;;;GAIG;AACU,QAAA,UAAU,GAAW,MAAM,CACtC,oEAAoE,CACrE,CAAC;AAEF;;;;GAIG;AACU,QAAA,SAAS,GACpB,MAAM,CAAC,oEAAoE,CAAC;IAC5E,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEb;;;;GAIG;AACU,QAAA,SAAS,GAAW,MAAM,CACrC,oEAAoE,CACrE,CAAC;AAEW,QAAA,WAAW,GAAyB,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,QAAA,IAAI,GAAyB,MAAM,CAAC,CAAC,CAAC,CAAC;AACvC,QAAA,GAAG,GAAyB,MAAM,CAAC,CAAC,CAAC,CAAC;AACtC,QAAA,GAAG,GAAyB,MAAM,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"numbers.js","sources":["../../lib.esm/constants/numbers.js"],"sourcesContent":["/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of ore in a single xcb.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const OrePerXCB = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") *\n BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nexport const NegativeOne = /*#__PURE__*/ BigInt(-1);\nexport const Zero = /*#__PURE__*/ BigInt(0);\nexport const One = /*#__PURE__*/ BigInt(1);\nexport const Two = /*#__PURE__*/ BigInt(2);\n//# sourceMappingURL=numbers.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACY,MAAC,CAAC,GAAG,MAAM,CAAC,oEAAoE;AAC5F;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG,MAAM,CAAC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAG,MAAM,CAAC,oEAAoE;AACrG;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG,MAAM,CAAC,oEAAoE,CAAC;AACrG,IAAI,MAAM,CAAC,EAAE;AACb;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG,MAAM,CAAC,oEAAoE;AACxF,MAAC,WAAW,iBAAiB,MAAM,CAAC,EAAE;AACtC,MAAC,IAAI,iBAAiB,MAAM,CAAC,CAAC;AAC9B,MAAC,GAAG,iBAAiB,MAAM,CAAC,CAAC;AAC7B,MAAC,GAAG,iBAAiB,MAAM,CAAC,CAAC;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/strings.js b/lib.commonjs/constants/strings.js index 6bd80541f..fd997324c 100644 --- a/lib.commonjs/constants/strings.js +++ b/lib.commonjs/constants/strings.js @@ -1,17 +1,19 @@ -"use strict"; +'use strict'; + // NFKC (composed) // (decomposed) -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MessagePrefix = exports.CoreSymbol = void 0; /** * A constant for the core symbol (normalized using NFKC). * * (**i.e.** ``"\\u039e"``) */ -exports.CoreSymbol = "\u039e"; // "\uD835\uDF63"; +const CoreSymbol = "\u039e"; // "\uD835\uDF63"; /** * A constant for the [[link-eip-191]] personal message prefix. * * (**i.e.** ``"\\x19Core Signed Message:\\n"``) */ -exports.MessagePrefix = "\x19Core Signed Message:\n"; -//# sourceMappingURL=strings.js.map \ No newline at end of file +const MessagePrefix = "\x19Core Signed Message:\n"; + +exports.CoreSymbol = CoreSymbol; +exports.MessagePrefix = MessagePrefix; +//# sourceMappingURL=strings.js.map diff --git a/lib.commonjs/constants/strings.js.map b/lib.commonjs/constants/strings.js.map index e12c6ebda..f48393eb1 100644 --- a/lib.commonjs/constants/strings.js.map +++ b/lib.commonjs/constants/strings.js.map @@ -1 +1 @@ -{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../src.ts/constants/strings.ts"],"names":[],"mappings":";AAAA,8CAA8C;;;AAE9C;;;;GAIG;AACU,QAAA,UAAU,GAAW,QAAQ,CAAC,CAAC,kBAAkB;AAE9D;;;;GAIG;AACU,QAAA,aAAa,GAAW,4BAA4B,CAAC"} \ No newline at end of file +{"version":3,"file":"strings.js","sources":["../../lib.esm/constants/strings.js"],"sourcesContent":["// NFKC (composed) // (decomposed)\n/**\n * A constant for the core symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const CoreSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Core Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Core Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAG,SAAS;AACnC;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG;;;"} \ No newline at end of file diff --git a/lib.commonjs/contract/contract.d.ts b/lib.commonjs/contract/contract.d.ts index b7a2cd009..637e513de 100644 --- a/lib.commonjs/contract/contract.d.ts +++ b/lib.commonjs/contract/contract.d.ts @@ -45,7 +45,7 @@ export declare class BaseContract implements Addressable, EventEmitterable(target: string, abi: InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit; static isIndexed(value: any): value is Indexed; } -declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: ContractRunner | null | undefined) => BaseContract & Omit; +declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: null | ContractRunner) => BaseContract & Omit; export declare class Contract extends Contract_base { } export {}; diff --git a/lib.commonjs/contract/contract.d.ts.map b/lib.commonjs/contract/contract.d.ts.map index d2114f9d0..93e959992 100644 --- a/lib.commonjs/contract/contract.d.ts.map +++ b/lib.commonjs/contract/contract.d.ts.map @@ -1 +1 @@ -{"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EAAE,GAAG,GAAG,KAAK,IAAI,OAAO;CAG/C;;AAUD,qBAAa,QAAS,SAAQ,aAAe;CAAG"} \ No newline at end of file +{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAEN,GAAG,EACH,mBAAmB,EACnB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAGN,2BAA2B,EAC3B,QAAQ,EACR,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACX,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,SAAS,EAET,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACX,QAAQ,EACR,cAAc,EAId,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAEX,iBAAiB,EACjB,iBAAiB,EAEjB,cAAc,EAEd,aAAa,EACb,mBAAmB,EAEnB,eAAe,EACf,MAAM,YAAY,CAAC;AA2GpB;;GAEG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EACnE,GAAG,EAAE,GAAG,EACR,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GACrB,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,CAuBvC;AAED;;GAEG;AACH,wBAAsB,WAAW,CAChC,OAAO,EAAE,IAAI,GAAG,cAAc,EAC9B,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAChC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GACd,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAarB;AAmVD,QAAA,MAAM,QAAQ,eAAy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AC,GAAG,iBAAiB,EAChC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,GAC5B,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAM5C;IACD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAE7C;CACD;0CAGQ,MAAM,OACT,YAAY,WACR,IAAI,GAAG,cAAc,KAC1B,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/D,qBAAa,QAAS,SAAQ,aAAe;CAAG"} \ No newline at end of file diff --git a/lib.commonjs/contract/contract.js b/lib.commonjs/contract/contract.js index 4dc00baa9..9aae2ac98 100644 --- a/lib.commonjs/contract/contract.js +++ b/lib.commonjs/contract/contract.js @@ -1,11 +1,22 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Contract = exports.BaseContract = exports.resolveArgs = exports.copyOverrides = void 0; -const index_js_1 = require("../abi/index.js"); -const checks_js_1 = require("../address/checks.js"); -const provider_js_1 = require("../providers/provider.js"); -const index_js_2 = require("../utils/index.js"); -const wrappers_js_1 = require("./wrappers.js"); +'use strict'; + +require('../abi/abi-coder.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../abi/fragments.js'); +var _interface = require('../abi/interface.js'); +var typed = require('../abi/typed.js'); +var checks = require('../address/checks.js'); +var provider = require('../providers/provider.js'); +var wrappers = require('./wrappers.js'); + const BN_0 = BigInt(0); function canCall(value) { return value && typeof value.call === "function"; @@ -23,7 +34,7 @@ class PreparedTopicFilter { #filter; fragment; constructor(contract, fragment, args) { - (0, index_js_2.defineProperties)(this, { fragment }); + properties.defineProperties(this, { fragment }); if (fragment.inputs.length < args.length) { throw new Error("too many arguments"); } @@ -36,7 +47,7 @@ class PreparedTopicFilter { } return param.walkAsync(args[index], (type, value) => { if (type === "address") { - return (0, checks_js_1.resolveAddress)(value); + return checks.resolveAddress(value); } return value; }); @@ -77,16 +88,15 @@ function getProvider(value) { */ async function copyOverrides(arg, allowed) { // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = (0, provider_js_1.copyRequest)(index_js_1.Typed.dereference(arg, "overrides")); - (0, index_js_2.assertArgument)(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - (0, index_js_2.assertArgument)(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); + const overrides = provider.copyRequest(typed.Typed.dereference(arg, "overrides")); + errors.assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); + errors.assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); // Resolve any from if (overrides.from) { - overrides.from = await (0, checks_js_1.resolveAddress)(overrides.from); + overrides.from = await checks.resolveAddress(overrides.from); } return overrides; } -exports.copyOverrides = copyOverrides; /** * @_ignore: */ @@ -94,15 +104,14 @@ async function resolveArgs(_runner, inputs, args) { // Recursively descend into args and resolve any addresses return await Promise.all(inputs.map((param, index) => { return param.walkAsync(args[index], (type, value) => { - value = index_js_1.Typed.dereference(value, type); + value = typed.Typed.dereference(value, type); if (type === "address") { - return (0, checks_js_1.resolveAddress)(value); + return checks.resolveAddress(value); } return value; }); })); } -exports.resolveArgs = resolveArgs; function buildWrappedFallback(contract) { const populateTransaction = async function (overrides) { // If an overrides was passed in, copy it and normalize the values @@ -111,20 +120,20 @@ function buildWrappedFallback(contract) { const iface = contract.interface; // Only allow payable contracts to set non-zero value const payable = iface.receive || (iface.fallback && iface.fallback.payable); - (0, index_js_2.assertArgument)(payable || (tx.value || BN_0) === BN_0, "cannot send value to non-payable contract", "overrides.value", tx.value); + errors.assertArgument(payable || (tx.value || BN_0) === BN_0, "cannot send value to non-payable contract", "overrides.value", tx.value); // Only allow fallback contracts to set non-empty data - (0, index_js_2.assertArgument)(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data); + errors.assertArgument(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data); return tx; }; const staticCall = async function (overrides) { const runner = getRunner(contract.runner, "call"); - (0, index_js_2.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); + errors.assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); const tx = await populateTransaction(overrides); try { return await runner.call(tx); } catch (error) { - if ((0, index_js_2.isCallException)(error) && error.data) { + if (errors.isCallException(error) && error.data) { throw contract.interface.makeError(error.data, tx); } throw error; @@ -132,22 +141,22 @@ function buildWrappedFallback(contract) { }; const send = async function (overrides) { const runner = contract.runner; - (0, index_js_2.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); + errors.assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); const tx = await runner.sendTransaction(await populateTransaction(overrides)); const provider = getProvider(contract.runner); // @TODO: the provider can be null; make a custom dummy provider that will throw a // meaningful error - return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx); + return new wrappers.ContractTransactionResponse(contract.interface, provider, tx); }; const estimateEnergy = async function (overrides) { const runner = getRunner(contract.runner, "estimateEnergy"); - (0, index_js_2.assert)(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); + errors.assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); return await runner.estimateEnergy(await populateTransaction(overrides)); }; const method = async (overrides) => { return await send(overrides); }; - (0, index_js_2.defineProperties)(method, { + properties.defineProperties(method, { _contract: contract, estimateEnergy, populateTransaction, @@ -159,7 +168,7 @@ function buildWrappedFallback(contract) { function buildWrappedMethod(contract, key) { const getFragment = function (...args) { const fragment = contract.interface.getFunction(key, args); - (0, index_js_2.assert)(fragment, "no matching fragment in getFragment", "UNSUPPORTED_OPERATION", { + errors.assert(fragment, "no matching fragment in getFragment", "UNSUPPORTED_OPERATION", { operation: "fragment", }); return fragment; @@ -175,7 +184,7 @@ function buildWrappedMethod(contract, key) { throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); } const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await (0, index_js_2.resolveProperties)({ + return Object.assign({}, overrides, await properties.resolveProperties({ to: contract.getAddress(), data: contract.interface.encodeFunctionData(fragment, resolvedArgs), })); @@ -189,28 +198,28 @@ function buildWrappedMethod(contract, key) { }; const send = async function (...args) { const runner = contract.runner; - (0, index_js_2.assert)(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); + errors.assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); const tx = await runner.sendTransaction(await populateTransaction(...args)); const provider = getProvider(contract.runner); // @TODO: the provider can be null; make a custom dummy provider that will throw a // meaningful error - return new wrappers_js_1.ContractTransactionResponse(contract.interface, provider, tx); + return new wrappers.ContractTransactionResponse(contract.interface, provider, tx); }; const estimateEnergy = async function (...args) { const runner = getRunner(contract.runner, "estimateEnergy"); - (0, index_js_2.assert)(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); + errors.assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); return await runner.estimateEnergy(await populateTransaction(...args)); }; const staticCallResult = async function (...args) { const runner = getRunner(contract.runner, "call"); - (0, index_js_2.assert)(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); + errors.assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); const tx = await populateTransaction(...args); let result = "0x"; try { result = await runner.call(tx); } catch (error) { - if ((0, index_js_2.isCallException)(error) && error.data) { + if (errors.isCallException(error) && error.data) { throw contract.interface.makeError(error.data, tx); } throw error; @@ -225,7 +234,7 @@ function buildWrappedMethod(contract, key) { } return await send(...args); }; - (0, index_js_2.defineProperties)(method, { + properties.defineProperties(method, { name: contract.interface.getFunctionName(key), _contract: contract, _key: key, @@ -242,7 +251,7 @@ function buildWrappedMethod(contract, key) { enumerable: true, get: () => { const fragment = contract.interface.getFunction(key); - (0, index_js_2.assert)(fragment, "no matching fragment in defineProperty", "UNSUPPORTED_OPERATION", { + errors.assert(fragment, "no matching fragment in defineProperty", "UNSUPPORTED_OPERATION", { operation: "fragment", }); return fragment; @@ -253,7 +262,7 @@ function buildWrappedMethod(contract, key) { function buildWrappedEvent(contract, key) { const getFragment = function (...args) { const fragment = contract.interface.getEvent(key, args); - (0, index_js_2.assert)(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { + errors.assert(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { operation: "fragment", }); return fragment; @@ -261,7 +270,7 @@ function buildWrappedEvent(contract, key) { const method = function (...args) { return new PreparedTopicFilter(contract, getFragment(...args), args); }; - (0, index_js_2.defineProperties)(method, { + properties.defineProperties(method, { name: contract.interface.getEventName(key), _contract: contract, _key: key, @@ -273,7 +282,7 @@ function buildWrappedEvent(contract, key) { enumerable: true, get: () => { const fragment = contract.interface.getEvent(key); - (0, index_js_2.assert)(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { + errors.assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { operation: "fragment", }); return fragment; @@ -307,11 +316,11 @@ async function getSubInfo(contract, event) { // events which need deconstructing. if (Array.isArray(event)) { const topicHashify = function (name) { - if ((0, index_js_2.isHexString)(name, 32)) { + if (data.isHexString(name, 32)) { return name; } const fragment = contract.interface.getEvent(name); - (0, index_js_2.assertArgument)(fragment, "unknown fragment", "name", name); + errors.assertArgument(fragment, "unknown fragment", "name", name); return fragment.topicHash; }; // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` @@ -329,14 +338,14 @@ async function getSubInfo(contract, event) { topics = [null]; } else if (typeof event === "string") { - if ((0, index_js_2.isHexString)(event, 32)) { + if (data.isHexString(event, 32)) { // Topic Hash topics = [event]; } else { // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` fragment = contract.interface.getEvent(event); - (0, index_js_2.assertArgument)(fragment, "unknown fragment", "event", event); + errors.assertArgument(fragment, "unknown fragment", "event", event); topics = [fragment.topicHash]; } } @@ -350,7 +359,7 @@ async function getSubInfo(contract, event) { topics = [fragment.topicHash]; } else { - (0, index_js_2.assertArgument)(false, "unknown event name", "event", event); + errors.assertArgument(false, "unknown event name", "event", event); } // Normalize topics and sort TopicSets topics = topics.map((t) => { @@ -387,7 +396,7 @@ async function hasSub(contract, event) { async function getSub(contract, operation, event) { // Make sure our runner can actually subscribe to events const provider = getProvider(contract.runner); - (0, index_js_2.assert)(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); + errors.assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); const { fragment, tag, topics } = await getSubInfo(contract, event); const { addr, subs } = getInternal(contract); let sub = subs.get(tag); @@ -409,12 +418,12 @@ async function getSub(contract, operation, event) { ? contract.interface.decodeEventLog(fragment, log.data, log.topics) : []; emit(contract, event, args, (listener) => { - return new wrappers_js_1.ContractEventPayload(contract, listener, event, _foundFragment, log); + return new wrappers.ContractEventPayload(contract, listener, event, _foundFragment, log); }); } else { emit(contract, event, [], (listener) => { - return new wrappers_js_1.ContractUnknownEventPayload(contract, listener, event, log); + return new wrappers.ContractUnknownEventPayload(contract, listener, event, log); }); } }; @@ -484,8 +493,8 @@ class BaseContract { if (runner == null) { runner = null; } - const iface = index_js_1.Interface.from(abi); - (0, index_js_2.defineProperties)(this, { target, runner, interface: iface }); + const iface = _interface.Interface.from(abi); + properties.defineProperties(this, { target, runner, interface: iface }); Object.defineProperty(this, internal, { value: {} }); let addrPromise; let addr = null; @@ -494,19 +503,19 @@ class BaseContract { const provider = getProvider(runner); // @TODO: the provider can be null; make a custom dummy provider that will throw a // meaningful error - deployTx = new wrappers_js_1.ContractTransactionResponse(this.interface, provider, _deployTx); + deployTx = new wrappers.ContractTransactionResponse(this.interface, provider, _deployTx); } let subs = new Map(); // Resolve the target as the address if (typeof target === "string") { - if ((0, index_js_2.isHexString)(target)) { + if (data.isHexString(target)) { addr = target; addrPromise = Promise.resolve(target); } else { const resolver = getRunner(runner, "resolveName"); if (!canResolve(resolver)) { - throw (0, index_js_2.makeError)("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { + throw errors.makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { operation: "resolveName", }); } @@ -552,8 +561,8 @@ class BaseContract { return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop))); }, }); - (0, index_js_2.defineProperties)(this, { filters }); - (0, index_js_2.defineProperties)(this, { + properties.defineProperties(this, { filters }); + properties.defineProperties(this, { fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null, }); // Return a Proxy that will respond to functions @@ -585,7 +594,7 @@ class BaseContract { } async getDeployedCode() { const provider = getProvider(this.runner); - (0, index_js_2.assert)(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); + errors.assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); const code = await provider.getCode(await this.getAddress()); if (code === "0x") { return null; @@ -606,7 +615,7 @@ class BaseContract { } // Make sure we can subscribe to a provider event const provider = getProvider(this.runner); - (0, index_js_2.assert)(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); + errors.assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); return new Promise((resolve, reject) => { const checkCode = async () => { try { @@ -654,9 +663,9 @@ class BaseContract { const address = addr ? addr : await addrPromise; const { fragment, topics } = await getSubInfo(this, event); const filter = { address, topics, fromBlock, toBlock }; - const provider = getProvider(this.runner); - (0, index_js_2.assert)(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider.getLogs(filter)).map((log) => { + const provider$1 = getProvider(this.runner); + errors.assert(provider$1, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); + return (await provider$1.getLogs(filter)).map((log) => { let foundFragment = fragment; if (foundFragment == null) { try { @@ -665,10 +674,10 @@ class BaseContract { catch (error) { } } if (foundFragment) { - return new wrappers_js_1.EventLog(log, this.interface, foundFragment); + return new wrappers.EventLog(log, this.interface, foundFragment); } else { - return new provider_js_1.Log(log, provider); + return new provider.Log(log, provider$1); } }); } @@ -778,14 +787,17 @@ class BaseContract { return contract; } static isIndexed(value) { - return index_js_1.Indexed.isIndexed(value); + return _interface.Indexed.isIndexed(value); } } -exports.BaseContract = BaseContract; function _ContractBase() { return BaseContract; } class Contract extends _ContractBase() { } + +exports.BaseContract = BaseContract; exports.Contract = Contract; -//# sourceMappingURL=contract.js.map \ No newline at end of file +exports.copyOverrides = copyOverrides; +exports.resolveArgs = resolveArgs; +//# sourceMappingURL=contract.js.map diff --git a/lib.commonjs/contract/contract.js.map b/lib.commonjs/contract/contract.js.map index 6a0b4482b..8f5aba91f 100644 --- a/lib.commonjs/contract/contract.js.map +++ b/lib.commonjs/contract/contract.js.map @@ -1 +1 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":";;;AAAA,8CAA4D;AAC5D,oDAAsD;AACtD,0DAIkC;AAClC,gDAQ2B;AAE3B,+CAKuB;AAgCvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAkBvB,SAAS,OAAO,CAAC,KAAU;IACzB,OAAO,KAAK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P,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aAClB;SACF;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iBAAiB;IACjB,KAAK,CAAC,WAAW,CACf,KAAwB,EACxB,QAAkB;QAElB,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,cAAc,CAClB,KAAwB,EACxB,QAAkB;QAElB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,UAAU,CACf,GAAiB;QAKjB,MAAM,cAAe,SAAQ,YAAY;YACvC,YAAY,OAAe,EAAE,SAAgC,IAAI;gBAC/D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;YAC9B,CAAC;SACF;QACD,OAAO,cAAqB,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,IAAI,CACT,MAAc,EACd,GAAiB,EACjB,MAA8B;QAE9B,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,GAAG,IAAI,CAAC;SACf;QACD,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,QAAe,CAAC;IACzB,CAAC;IACD,MAAM,CAAC,SAAS,CAAC,KAAU;QACzB,OAAO,kBAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACF;AA9ZD,oCA8ZC;AAED,SAAS,aAAa;IAKpB,OAAO,YAAmB,CAAC;AAC7B,CAAC;AAED,MAAa,QAAS,SAAQ,aAAa,EAAE;CAAG;AAAhD,4BAAgD"} \ No newline at end of file +{"version":3,"file":"contract.js","sources":["../../lib.esm/contract/contract.js"],"sourcesContent":["import { Indexed, Interface, Typed } from \"../abi/index.js\";\nimport { resolveAddress } from \"../address/checks.js\";\nimport { copyRequest, Log, } from \"../providers/provider.js\";\nimport { defineProperties, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument, } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return value && typeof value.call === \"function\";\n}\nfunction canEstimate(value) {\n return value && typeof value.estimateEnergy === \"function\";\n}\nfunction canResolve(value) {\n return value && typeof value.resolveName === \"function\";\n}\nfunction canSend(value) {\n return value && typeof value.sendTransaction === \"function\";\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof value[feature] === \"function\") {\n return value;\n }\n if (value.provider && typeof value.provider[feature] === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(Typed.dereference(arg, \"overrides\"));\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from);\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n const iface = contract.interface;\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || (tx.value || BN_0) === BN_0, \"cannot send value to non-payable contract\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || (tx.data || \"0x\") === \"0x\", \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment in getFragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs),\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract,\n _key: key,\n getFragment,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment in defineProperty\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment in\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract,\n _key: key,\n getFragment,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_corebcInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value &&\n typeof value === \"object\" &&\n \"getTopicFilter\" in value &&\n typeof value.getTopicFilter === \"function\" &&\n value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof event === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics\n .map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n })\n .join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = addr ? addr : contract;\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment\n ? contract.interface.decodeEventLog(fragment, log.data, log.topics)\n : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n return count > 0;\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n target;\n interface;\n runner;\n filters;\n [internal];\n fallback;\n constructor(target, abi, runner, _deployTx) {\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof target === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, _prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = this.getEvent(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract event: ${prop}`);\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop)));\n },\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null,\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, _prop, receiver) => {\n if (_prop in target || passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = target.getFunction(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract method: ${prop}`);\n },\n has: (target, prop) => {\n if (prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(String(prop));\n },\n });\n }\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n async getAddress() {\n return await getInternal(this).addrPromise;\n }\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n async waitForDeployment() {\n // We have the deployement transaction; just use that (throws if deployement fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n getFunction(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n getEvent(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n async queryTransaction(hash) {\n // Is this useful?\n throw new Error(\"@TODO\");\n }\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = addr ? addr : await addrPromise;\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n return new EventLog(log, this.interface, foundFragment);\n }\n else {\n return new Log(log, provider);\n }\n });\n }\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners\n .map(({ listener }) => listener)\n .indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n 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 await this.off(event, listener);\n }\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map"],"names":["defineProperties","resolveAddress","copyRequest","Typed","assertArgument","assert","isCallException","ContractTransactionResponse","resolveProperties","isHexString","ContractEventPayload","ContractUnknownEventPayload","Interface","makeError","provider","EventLog","Log","Indexed"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,SAAS,OAAO,CAAC,KAAK,EAAE;AACxB,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;AACpD;AACA,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,cAAc,KAAK,UAAU;AAC9D;AACA,SAAS,UAAU,CA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EAAE,QAAQ,CAAC;AAC7C,IAAI;AACJ;AACA,IAAI,MAAM,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE;AAC1C,QAAQ,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC9C,IAAI;AACJ,IAAI,OAAO,UAAU,CAAC,GAAG,EAAE;AAC3B,QAAQ,MAAM,cAAc,SAAS,YAAY,CAAC;AAClD,YAAY,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE;AAChD,gBAAgB,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC;AAC3C,YAAY;AACZ;AACA,QAAQ,OAAO,cAAc;AAC7B,IAAI;AACJ,IAAI,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE;AACrC,QAAQ,IAAI,MAAM,IAAI,IAAI,EAAE;AAC5B,YAAY,MAAM,GAAG,IAAI;AACzB,QAAQ;AACR,QAAQ,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC;AACtD,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ,IAAI,OAAO,SAAS,CAAC,KAAK,EAAE;AAC5B,QAAQ,OAAOG,kBAAO,CAAC,SAAS,CAAC,KAAK,CAAC;AACvC,IAAI;AACJ;AACA,SAAS,aAAa,GAAG;AACzB,IAAI,OAAO,YAAY;AACvB;AACO,MAAM,QAAQ,SAAS,aAAa,EAAE,CAAC;AAC9C;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/contract/factory.d.ts.map b/lib.commonjs/contract/factory.d.ts.map index 600026a1b..e49bf553e 100644 --- a/lib.commonjs/contract/factory.d.ts.map +++ b/lib.commonjs/contract/factory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAi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,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CACpD,YAAY,GAAG;QACd,qBAAqB,IAAI,2BAA2B,CAAC;KACrD,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAC/B,CAoBA;IAED,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAE5D;IAED,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAC3E,MAAM,EAAE,GAAG,EACX,MAAM,CAAC,EAAE,cAAc,GACrB,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAiBvB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/contract/factory.js b/lib.commonjs/contract/factory.js index f472c926d..aed43aed8 100644 --- a/lib.commonjs/contract/factory.js +++ b/lib.commonjs/contract/factory.js @@ -1,11 +1,20 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ContractFactory = void 0; -const index_js_1 = require("../abi/index.js"); -const contract_address_js_1 = require("../address/contract-address.js"); -const index_js_2 = require("../utils/index.js"); -const contract_js_1 = require("./contract.js"); -const data_js_1 = require("../utils/data.js"); +'use strict'; + +require('../abi/abi-coder.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../abi/fragments.js'); +var _interface = require('../abi/interface.js'); +var contractAddress = require('../address/contract-address.js'); +var contract = require('./contract.js'); + // A = Arguments to the constructor // I = Interface of deployed contracts class ContractFactory { @@ -13,16 +22,16 @@ class ContractFactory { bytecode; runner; constructor(abi, bytecode, runner) { - const iface = index_js_1.Interface.from(abi); + const iface = _interface.Interface.from(abi); // Dereference Solidity bytecode objects and allow a missing `0x`-prefix if (bytecode instanceof Uint8Array) { - bytecode = (0, index_js_2.hexlify)((0, index_js_2.getBytes)(bytecode)); + bytecode = data.hexlify(data.getBytes(bytecode)); } else if (typeof bytecode === "string") { bytecode = bytecode; } - else if ((0, data_js_1.isBytes)(bytecode)) { - bytecode = (0, index_js_2.hexlify)(bytecode); + else if (data.isBytes(bytecode)) { + bytecode = data.hexlify(bytecode); } else if (bytecode && typeof bytecode.object === "string") { // Allow the bytecode object from the Solidity compiler @@ -32,7 +41,7 @@ class ContractFactory { // Crash in the next verification step bytecode = "!"; } - (0, index_js_2.defineProperties)(this, { + properties.defineProperties(this, { // @ts-ignore bytecode, interface: iface, @@ -43,32 +52,32 @@ class ContractFactory { let overrides = {}; const fragment = this.interface.deploy; if (fragment.inputs.length + 1 === args.length) { - overrides = await (0, contract_js_1.copyOverrides)(args.pop()); + overrides = await contract.copyOverrides(args.pop()); } if (fragment.inputs.length !== args.length) { throw new Error("incorrect number of arguments to constructor"); } - const resolvedArgs = await (0, contract_js_1.resolveArgs)(this.runner, fragment.inputs, args); - const data = (0, index_js_2.concat)([ + const resolvedArgs = await contract.resolveArgs(this.runner, fragment.inputs, args); + const data$1 = data.concat([ this.bytecode, this.interface.encodeDeploy(resolvedArgs), ]); - return Object.assign({}, overrides, { data }); + return Object.assign({}, overrides, { data: data$1 }); } async deploy(...args) { const tx = await this.getDeployTransaction(...args); - (0, index_js_2.assert)(this.runner && typeof this.runner.sendTransaction === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { + errors.assert(this.runner && typeof this.runner.sendTransaction === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction", }); const sentTx = await this.runner.sendTransaction(tx); - const address = (0, contract_address_js_1.getCreateAddress)(sentTx); - return new contract_js_1.BaseContract(address, this.interface, this.runner, sentTx); + const address = contractAddress.getCreateAddress(sentTx); + return new contract.BaseContract(address, this.interface, this.runner, sentTx); } connect(runner) { return new ContractFactory(this.interface, this.bytecode, runner); } static fromSolidity(output, runner) { - (0, index_js_2.assertArgument)(output != null, "bad compiler output", "output", output); + errors.assertArgument(output != null, "bad compiler output", "output", output); if (typeof output === "string") { output = JSON.parse(output); } @@ -83,5 +92,6 @@ class ContractFactory { return new this(abi, bytecode, runner); } } + exports.ContractFactory = ContractFactory; -//# sourceMappingURL=factory.js.map \ No newline at end of file +//# sourceMappingURL=factory.js.map diff --git a/lib.commonjs/contract/factory.js.map b/lib.commonjs/contract/factory.js.map index 00a14902b..f120cf7d9 100644 --- a/lib.commonjs/contract/factory.js.map +++ b/lib.commonjs/contract/factory.js.map @@ -1 +1 @@ -{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":";;;AAAA,8CAA4C;AAC5C,wEAAkE;AAClE,gDAO2B;AAE3B,+CAAyE;AAYzE,8CAA2C;AAE3C,mCAAmC;AACnC,sCAAsC;AACtC,MAAa,eAAe;IAIjB,SAAS,CAAa;IACtB,QAAQ,CAAU;IAClB,MAAM,CAAyB;IAExC,YACE,GAA6B,EAC7B,QAAwC,EACxC,MAA8B;QAE9B,MAAM,KAAK,GAAG,oBAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAElC,wEAAwE;QACxE,IAAI,QAAQ,YAAY,UAAU,EAAE;YAClC,QAAQ,GAAG,IAAA,kBAAO,EAAC,IAAA,mBAAQ,EAAC,QAAQ,CAAC,CAAC,CAAC;SACxC;aAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YACvC,QAAQ,GAAG,QAAQ,CAAC;SACrB;aAAM,IAAI,IAAA,iBAAO,EAAC,QAAQ,CAAC,EAAE;YAC5B,QAAQ,GAAG,IAAA,kBAAO,EAAC,QAAQ,CAAC,CAAC;SAC9B;aAAM,IAAI,QAAQ,IAAI,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;YAC1D,uDAAuD;YACvD,QAAQ,GAAS,QAAS,CAAC,MAAM,CAAC;SACnC;aA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AU,EAChE,sDAAsD,EACtD,uBAAuB,EACvB;YACE,SAAS,EAAE,iBAAiB;SAC7B,CACF,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,IAAA,sCAAgB,EAAC,MAAM,CAAC,CAAC;QACzC,OAAO,IAAU,0BAAa,CAC5B,OAAO,EACP,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,MAAM,EACX,MAAM,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,MAA6B;QACnC,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,YAAY,CACjB,MAAW,EACX,MAAuB;QAEvB,IAAA,yBAAc,EAAC,MAAM,IAAI,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAExE,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAC9B,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAC7B;QAED,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QAEvB,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,IAAI,MAAM,CAAC,QAAQ,EAAE;YACnB,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;SAC5B;aAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;YAC5C,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;SAChC;QAED,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzC,CAAC;CACF;AAjHD,0CAiHC"} \ No newline at end of file +{"version":3,"file":"factory.js","sources":["../../lib.esm/contract/factory.js"],"sourcesContent":["import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\nimport { isBytes } from \"../utils/data.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\nexport class ContractFactory {\n interface;\n bytecode;\n runner;\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else if (typeof bytecode === \"string\") {\n bytecode = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecode = hexlify(bytecode);\n }\n else if (bytecode && typeof bytecode.object === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecode = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecode = \"!\";\n }\n defineProperties(this, {\n // @ts-ignore\n bytecode,\n interface: iface,\n runner: runner || null,\n });\n }\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([\n this.bytecode,\n this.interface.encodeDeploy(resolvedArgs),\n ]);\n return Object.assign({}, overrides, { data });\n }\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof this.runner.sendTransaction === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\",\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof output === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map"],"names":["Interface","hexlify","getBytes","isBytes","defineProperties","copyOverrides","resolveArgs","data","concat","assert","getCreateAddress","BaseContract","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;AAKA;AACA;AACO,MAAM,eAAe,CAAC;AAC7B,IAAI,SAAS;AACb,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE;AACvC,QAAQ,MAAM,KAAK,GAAGA,oBAAS,CAAC,IAAI,CAAC,GAAG,CAAC;AACzC;AACA,QAAQ,IAAI,QAAQ,YAAY,UAAU,EAAE;AAC5C,YAAY,QAAQ,GAAGC,YAAO,CAACC,aAAQ,CAAC,QAAQ,CAAC,CAAC;AAClD,QAAQ;AACR,aAAa,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AAC/C,YAAY,QAAQ,GAAG,QAAQ;AAC/B,QAAQ;AACR,aAAa,IAAIC,YAAO,CAAC,QAAQ,CAAC,EAAE;AACpC,YAAY,QAAQ,GAAGF,YAAO,CAAC,QAAQ,CAAC;AACxC,QAAQ;AACR,aAAa,IAAI,QAAQ,IAAI,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,EAAE;AAClE;AACA,YAAY,QAAQ,GAAG,QAAQ,CAAC,MAAM;AACtC,QAAQ;AACR,aAAa;AACb;AACA,YAAY,QAAQ,GAAG,GAAG;AAC1B,QAAQ;AACR,QAAQG,2BAAgB,CAAC,IAAI,EAAE;AAC/B;AACA,YAAY,QAAQ;AACpB,YAAY,SAAS,EAAE,KAAK;AAC5B,YAAY,MAAM,EAAE,MAAM,IAAI,IAAI;AAClC,SAAS,C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,CAAC,eAAe,CAAC,EAAE,CAAC;AAC5D,QAAQ,MAAM,OAAO,GAAGC,gCAAgB,CAAC,MAAM,CAAC;AAChD,QAAQ,OAAO,IAAIC,qBAAY,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC;AAC7E,IAAI;AACJ,IAAI,OAAO,CAAC,MAAM,EAAE;AACpB,QAAQ,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC;AACzE,IAAI;AACJ,IAAI,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE;AACxC,QAAQC,qBAAc,CAAC,MAAM,IAAI,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC/E,QAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACxC,YAAY,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;AACvC,QAAQ;AACR,QAAQ,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG;AAC9B,QAAQ,IAAI,QAAQ,GAAG,EAAE;AACzB,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE;AAC7B,YAAY,QAAQ,GAAG,MAAM,CAAC,QAAQ;AACtC,QAAQ;AACR,aAAa,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;AACpD,YAAY,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ;AAC1C,QAAQ;AACR,QAAQ,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC9C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/contract/index.d.ts.map b/lib.commonjs/contract/index.d.ts.map index ce8d05bb5..a5098a449 100644 --- a/lib.commonjs/contract/index.d.ts.map +++ b/lib.commonjs/contract/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,GAChB,MAAM,YAAY,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/contract/index.js b/lib.commonjs/contract/index.js index 9c890164c..309b3068e 100644 --- a/lib.commonjs/contract/index.js +++ b/lib.commonjs/contract/index.js @@ -1,20 +1,17 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.EventLog = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractUnknownEventPayload = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = void 0; -/** - * About contracts... - * - * @_section: api/contract:Contracts [about-contracts] - */ -var contract_js_1 = require("./contract.js"); -Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return contract_js_1.BaseContract; } }); -Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return contract_js_1.Contract; } }); -var factory_js_1 = require("./factory.js"); -Object.defineProperty(exports, "ContractFactory", { enumerable: true, get: function () { return factory_js_1.ContractFactory; } }); -var wrappers_js_1 = require("./wrappers.js"); -Object.defineProperty(exports, "ContractEventPayload", { enumerable: true, get: function () { return wrappers_js_1.ContractEventPayload; } }); -Object.defineProperty(exports, "ContractUnknownEventPayload", { enumerable: true, get: function () { return wrappers_js_1.ContractUnknownEventPayload; } }); -Object.defineProperty(exports, "ContractTransactionReceipt", { enumerable: true, get: function () { return wrappers_js_1.ContractTransactionReceipt; } }); -Object.defineProperty(exports, "ContractTransactionResponse", { enumerable: true, get: function () { return wrappers_js_1.ContractTransactionResponse; } }); -Object.defineProperty(exports, "EventLog", { enumerable: true, get: function () { return wrappers_js_1.EventLog; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var contract = require('./contract.js'); +var factory = require('./factory.js'); +var wrappers = require('./wrappers.js'); + + + +exports.BaseContract = contract.BaseContract; +exports.Contract = contract.Contract; +exports.ContractFactory = factory.ContractFactory; +exports.ContractEventPayload = wrappers.ContractEventPayload; +exports.ContractTransactionReceipt = wrappers.ContractTransactionReceipt; +exports.ContractTransactionResponse = wrappers.ContractTransactionResponse; +exports.ContractUnknownEventPayload = wrappers.ContractUnknownEventPayload; +exports.EventLog = wrappers.EventLog; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/contract/index.js.map b/lib.commonjs/contract/index.js.map index 68b5e2805..c290a0fe8 100644 --- a/lib.commonjs/contract/index.js.map +++ b/lib.commonjs/contract/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,6CAAuD;AAA9C,2GAAA,YAAY,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAE/B,2CAA+C;AAAtC,6GAAA,eAAe,OAAA;AAExB,6CAMuB;AALrB,mHAAA,oBAAoB,OAAA;AACpB,0HAAA,2BAA2B,OAAA;AAC3B,yHAAA,0BAA0B,OAAA;AAC1B,0HAAA,2BAA2B,OAAA;AAC3B,uGAAA,QAAQ,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/contract/types.d.ts.map b/lib.commonjs/contract/types.d.ts.map index d0dd8e022..d356fb5ec 100644 --- a/lib.commonjs/contract/types.d.ts.map +++ b/lib.commonjs/contract/types.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,KAAK,EACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAGjE,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN,aAAa,GACb,WAAW,GACX,mBAAmB,CAAC;AAExB,MAAM,WAAW,iBAAiB;IAChC,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACpC;AAED,MAAM,WAAW,mBAAmB;IAClC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAA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a,CAAC;CAC3D;AAED,MAAM,WAAW,eAAe;IAC9B,CACE,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACzC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAExC,mBAAmB,CACjB,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACzC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxE,IAAI,CACF,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACzC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7E"} \ No newline at end of file +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,KAAK,EACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAGjE,MAAM,MAAM,iBAAiB,GAC5B,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,mBAAmB,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IACjC,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IACnC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,mBAAoB,SAAQ,0BA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,MAAM,WAAW,eAAe;IAC/B,CACC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACxC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAExC,mBAAmB,CAClB,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACxC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxE,IAAI,CACH,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACxC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5E"} \ No newline at end of file diff --git a/lib.commonjs/contract/types.js b/lib.commonjs/contract/types.js index 11e638d1e..ed5ab0fb8 100644 --- a/lib.commonjs/contract/types.js +++ b/lib.commonjs/contract/types.js @@ -1,3 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=types.js.map \ No newline at end of file +'use strict'; + +//# sourceMappingURL=types.js.map diff --git a/lib.commonjs/contract/types.js.map b/lib.commonjs/contract/types.js.map index 595591811..705032fd5 100644 --- a/lib.commonjs/contract/types.js.map +++ b/lib.commonjs/contract/types.js.map @@ -1 +1 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/contract/wrappers.d.ts.map b/lib.commonjs/contract/wrappers.d.ts.map index aa2542479..4538896c6 100644 --- a/lib.commonjs/contract/wrappers.d.ts.map +++ b/lib.commonjs/contract/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;AAED,qBAAa,oBAAqB,SAAQ,2BAA2B;IACpE,SAAiB,QAAQ,EAAE,aAAa,CAAC;IACzC,SAAiB,GAAG,EAAE,QAAQ,CAAC;IAC/B,SAAiB,IAAI,EAAE,MAAM,CAAC;IAE9B,YACC,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,GAAG,EAcT;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/contract/wrappers.js b/lib.commonjs/contract/wrappers.js index df5640b3b..d28e5f1b4 100644 --- a/lib.commonjs/contract/wrappers.js +++ b/lib.commonjs/contract/wrappers.js @@ -1,16 +1,25 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ContractEventPayload = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.EventLog = void 0; -const provider_js_1 = require("../providers/provider.js"); -const index_js_1 = require("../utils/index.js"); -class EventLog extends provider_js_1.Log { +'use strict'; + +var provider = require('../providers/provider.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +var events = require('../utils/events.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + +class EventLog extends provider.Log { interface; fragment; args; constructor(log, iface, fragment) { super(log, log.provider); const args = iface.decodeEventLog(fragment, log.data, log.topics); - (0, index_js_1.defineProperties)(this, { args, fragment, interface: iface }); + properties.defineProperties(this, { args, fragment, interface: iface }); } get eventName() { return this.fragment.name; @@ -19,8 +28,7 @@ class EventLog extends provider_js_1.Log { return this.fragment.format(); } } -exports.EventLog = EventLog; -class ContractTransactionReceipt extends provider_js_1.TransactionReceipt { +class ContractTransactionReceipt extends provider.TransactionReceipt { #iface; constructor(iface, provider, tx) { super(tx, provider); @@ -40,8 +48,7 @@ class ContractTransactionReceipt extends provider_js_1.TransactionReceipt { }); } } -exports.ContractTransactionReceipt = ContractTransactionReceipt; -class ContractTransactionResponse extends provider_js_1.TransactionResponse { +class ContractTransactionResponse extends provider.TransactionResponse { #iface; constructor(iface, provider, tx) { super(tx, provider); @@ -55,12 +62,11 @@ class ContractTransactionResponse extends provider_js_1.TransactionResponse { return new ContractTransactionReceipt(this.#iface, this.provider, receipt); } } -exports.ContractTransactionResponse = ContractTransactionResponse; -class ContractUnknownEventPayload extends index_js_1.EventPayload { +class ContractUnknownEventPayload extends events.EventPayload { log; constructor(contract, listener, filter, log) { super(contract, listener, filter); - (0, index_js_1.defineProperties)(this, { log }); + properties.defineProperties(this, { log }); } async getBlock() { return await this.log.getBlock(); @@ -72,12 +78,11 @@ class ContractUnknownEventPayload extends index_js_1.EventPayload { return await this.log.getTransactionReceipt(); } } -exports.ContractUnknownEventPayload = ContractUnknownEventPayload; class ContractEventPayload extends ContractUnknownEventPayload { constructor(contract, listener, filter, fragment, _log) { super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - (0, index_js_1.defineProperties)(this, { args, fragment }); + properties.defineProperties(this, { args, fragment }); } get eventName() { return this.fragment.name; @@ -86,5 +91,10 @@ class ContractEventPayload extends ContractUnknownEventPayload { return this.fragment.format(); } } + exports.ContractEventPayload = ContractEventPayload; -//# sourceMappingURL=wrappers.js.map \ No newline at end of file +exports.ContractTransactionReceipt = ContractTransactionReceipt; +exports.ContractTransactionResponse = ContractTransactionResponse; +exports.ContractUnknownEventPayload = ContractUnknownEventPayload; +exports.EventLog = EventLog; +//# sourceMappingURL=wrappers.js.map diff --git a/lib.commonjs/contract/wrappers.js.map b/lib.commonjs/contract/wrappers.js.map index 818df92c7..7a91acafc 100644 --- a/lib.commonjs/contract/wrappers.js.map +++ b/lib.commonjs/contract/wrappers.js.map @@ -1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AxBD,kEAwBC;AAED,MAAa,oBAAqB,SAAQ,2BAA2B;IAKnE,YACE,QAAsB,EACtB,QAAyB,EACzB,MAAyB,EACzB,QAAuB,EACvB,IAAS;QAET,KAAK,CACH,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,IAAI,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CACjD,CAAC;QACF,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,cAAc,CAC5C,QAAQ,EACR,IAAI,CAAC,GAAG,CAAC,IAAI,EACb,IAAI,CAAC,GAAG,CAAC,MAAM,CAChB,CAAC;QACF,IAAA,2BAAgB,EAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAChC,CAAC;CACF;AAjCD,oDAiCC"} \ No newline at end of file +{"version":3,"file":"wrappers.js","sources":["../../lib.esm/contract/wrappers.js"],"sourcesContent":["import { Log, TransactionReceipt, TransactionResponse, } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\nexport class EventLog extends Log {\n interface;\n fragment;\n args;\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length\n ? this.#iface.getEvent(log.topics[0])\n : null;\n if (fragment) {\n return new EventLog(log, this.#iface, fragment);\n }\n else {\n return log;\n }\n });\n }\n}\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n async wait(confirms) {\n const receipt = await super.wait();\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\nexport class ContractUnknownEventPayload extends EventPayload {\n log;\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n async getBlock() {\n return await this.log.getBlock();\n }\n async getTransaction() {\n return await this.log.getTransaction();\n }\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map"],"names":["Log","defineProperties","TransactionReceipt","TransactionResponse","EventPayload"],"mappings":";;;;;;;;;;;;;;AAEO,MAAM,QAAQ,SAASA,YAAG,CAAC;AAClC,IAAI,SAAS;AACb,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE;AACtC,QAAQ,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AAChC,QAAQ,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC;AACzE,QAAQC,2BAAgB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACpE,IAAI;AACJ,IAAI,IAAI,SAAS,GAAG;AACpB,QAAQ,OAAO,IAAI,CAAC,QAAQ,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AQ,EAAE,CAAC;AAClD,IAAI;AACJ,IAAI,IAAI,SAAS,GAAG;AACpB,QAAQ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI;AACjC,IAAI;AACJ,IAAI,IAAI,cAAc,GAAG;AACzB,QAAQ,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;AACrC,IAAI;AACJ;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/corebc.d.ts b/lib.commonjs/corebc.d.ts index 04ae175d8..1dede3269 100644 --- a/lib.commonjs/corebc.d.ts +++ b/lib.commonjs/corebc.d.ts @@ -23,4 +23,6 @@ export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, C export type { AccessList, AccessListish, AccessListEntry, TransactionLike, } from "./transaction/index.js"; export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, CoreBCError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedCoreBCError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener, } from "./utils/index.js"; export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions, } from "./wallet/index.js"; +export * from "./cip/index.js"; +export * from "./ipfs/index.js"; //# sourceMappingURL=corebc.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/corebc.d.ts.map b/lib.commonjs/corebc.d.ts.map index d023fbd11..c9c604763 100644 --- a/lib.commonjs/corebc.d.ts.map +++ b/lib.commonjs/corebc.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"corebc.d.ts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EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,EACX,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,EAChB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,SAAS,EACT,YAAY,EACZ,OAAO,EACP,SAAS,EACT,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,GACf,MAAM,mBAAmB,CAAC"} \ No newline at end of file +{"version":3,"file":"corebc.d.ts","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,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Y,EACZ,OAAO,EACP,SAAS,EACT,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,GACR,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACX,gBAAgB,EAChB,eAAe,EACf,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/corebc.js b/lib.commonjs/corebc.js index 5f41c1d4a..3f53d34d5 100644 --- a/lib.commonjs/corebc.js +++ b/lib.commonjs/corebc.js @@ -1,203 +1,283 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha256 = exports.ripemd160 = exports.randomBytes = exports.computeHmac = exports.EventLog = exports.ContractUnknownEventPayload = exports.ContractTransactionResponse = exports.ContractTransactionReceipt = exports.ContractEventPayload = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.MessagePrefix = exports.CoreSymbol = exports.ZeroHash = exports.N = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.OrePerXCB = exports.ZeroAddress = exports.resolveAddress = exports.isAddress = exports.isAddressable = exports.getCreateAddress = exports.getCreate2Address = exports.networkIdToPrefix = exports.getAddress = exports.Typed = exports.TransactionDescription = exports.Result = exports.LogDescription = exports.Interface = exports.Indexed = exports.ErrorDescription = exports.checkResultErrors = exports.StructFragment = exports.ParamType = exports.NamedFragment = exports.FunctionFragment = exports.FallbackFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.AbiCoder = exports.encodeBytes32String = exports.decodeBytes32String = exports.publicToAddress = exports.version = void 0; -exports.UnmanagedSubscriber = exports.SocketSubscriber = exports.SocketPendingSubscriber = exports.SocketEventSubscriber = exports.SocketBlockSubscriber = exports.NetworkPlugin = exports.EnergyCostPlugin = exports.FeeDataNetworkPlugin = exports.Network = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.AbstractProvider = exports.VoidSigner = exports.NonceManager = exports.AbstractSigner = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.getDefaultProvider = exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.id = exports.keccak256 = exports.SigningKey = exports.Signature = exports.Ed448Goldilock = exports.lock = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = void 0; -exports.formatUnits = exports.parseXCB = exports.formatXCB = exports.mask = exports.toTwos = exports.fromTwos = exports.toQuantity = exports.toNumber = exports.toBeHex = exports.toBigInt = exports.toBeArray = exports.getUint = exports.getNumber = exports.getBigInt = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.isError = exports.isCallException = exports.makeError = exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.resolveProperties = exports.defineProperties = exports.zeroPadValue = exports.zeroPadBytes = exports.stripZerosLeft = exports.isBytesLike = exports.isHexString = exports.hexlify = exports.getBytesCopy = exports.getBytes = exports.dataSlice = exports.dataLength = exports.concat = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = exports.showThrottleMessage = exports.copyRequest = void 0; -exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = exports.BigNumber = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.decryptCrowdsaleJson = exports.isKeystoreJson = exports.isCrowdsaleJson = exports.getIndexedAccountPath = exports.getAccountPath = exports.defaultPath = exports.Wallet = exports.HDNodeWallet = exports.BaseWallet = exports.Mnemonic = exports.hexConcat = exports.arrayify = exports.uuidV4 = exports.encodeRlp = exports.decodeRlp = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports.parseUnits = void 0; -var _version_js_1 = require("./_version.js"); -Object.defineProperty(exports, "version", { enumerable: true, get: function () { return _version_js_1.version; } }); -var address_js_1 = require("./transaction/address.js"); -Object.defineProperty(exports, "publicToAddress", { enumerable: true, get: function () { return address_js_1.publicToAddress; } }); -var index_js_1 = require("./abi/index.js"); -Object.defineProperty(exports, "decodeBytes32String", { enumerable: true, get: function () { return index_js_1.decodeBytes32String; } }); -Object.defineProperty(exports, "encodeBytes32String", { enumerable: true, get: function () { return index_js_1.encodeBytes32String; } }); -Object.defineProperty(exports, "AbiCoder", { enumerable: true, get: function () { return index_js_1.AbiCoder; } }); -Object.defineProperty(exports, "ConstructorFragment", { enumerable: true, get: function () { return index_js_1.ConstructorFragment; } }); -Object.defineProperty(exports, "ErrorFragment", { enumerable: true, get: function () { return index_js_1.ErrorFragment; } }); -Object.defineProperty(exports, "EventFragment", { enumerable: true, get: function () { return index_js_1.EventFragment; } }); -Object.defineProperty(exports, "Fragment", { enumerable: true, get: function () { return index_js_1.Fragment; } }); -Object.defineProperty(exports, "FallbackFragment", { enumerable: true, get: function () { return index_js_1.FallbackFragment; } }); -Object.defineProperty(exports, "FunctionFragment", { enumerable: true, get: function () { return index_js_1.FunctionFragment; } }); -Object.defineProperty(exports, "NamedFragment", { enumerable: true, get: function () { return index_js_1.NamedFragment; } }); -Object.defineProperty(exports, "ParamType", { enumerable: true, get: function () { return index_js_1.ParamType; } }); -Object.defineProperty(exports, "StructFragment", { enumerable: true, get: function () { return index_js_1.StructFragment; } }); -Object.defineProperty(exports, "checkResultErrors", { enumerable: true, get: function () { return index_js_1.checkResultErrors; } }); -Object.defineProperty(exports, "ErrorDescription", { enumerable: true, get: function () { return index_js_1.ErrorDescription; } }); -Object.defineProperty(exports, "Indexed", { enumerable: true, get: function () { return index_js_1.Indexed; } }); -Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return index_js_1.Interface; } }); -Object.defineProperty(exports, "LogDescription", { enumerable: true, get: function () { return index_js_1.LogDescription; } }); -Object.defineProperty(exports, "Result", { enumerable: true, get: function () { return index_js_1.Result; } }); -Object.defineProperty(exports, "TransactionDescription", { enumerable: true, get: function () { return index_js_1.TransactionDescription; } }); -Object.defineProperty(exports, "Typed", { enumerable: true, get: function () { return index_js_1.Typed; } }); -var index_js_2 = require("./address/index.js"); -Object.defineProperty(exports, "getAddress", { enumerable: true, get: function () { return index_js_2.getAddress; } }); -Object.defineProperty(exports, "networkIdToPrefix", { enumerable: true, get: function () { return index_js_2.networkIdToPrefix; } }); -var contract_address_js_1 = require("./address/contract-address.js"); -Object.defineProperty(exports, "getCreate2Address", { enumerable: true, get: function () { return contract_address_js_1.getCreate2Address; } }); -Object.defineProperty(exports, "getCreateAddress", { enumerable: true, get: function () { return contract_address_js_1.getCreateAddress; } }); -var checks_js_1 = require("./address/checks.js"); -Object.defineProperty(exports, "isAddressable", { enumerable: true, get: function () { return checks_js_1.isAddressable; } }); -Object.defineProperty(exports, "isAddress", { enumerable: true, get: function () { return checks_js_1.isAddress; } }); -Object.defineProperty(exports, "resolveAddress", { enumerable: true, get: function () { return checks_js_1.resolveAddress; } }); -var index_js_3 = require("./constants/index.js"); -Object.defineProperty(exports, "ZeroAddress", { enumerable: true, get: function () { return index_js_3.ZeroAddress; } }); -Object.defineProperty(exports, "OrePerXCB", { enumerable: true, get: function () { return index_js_3.OrePerXCB; } }); -Object.defineProperty(exports, "MaxUint256", { enumerable: true, get: function () { return index_js_3.MaxUint256; } }); -Object.defineProperty(exports, "MinInt256", { enumerable: true, get: function () { return index_js_3.MinInt256; } }); -Object.defineProperty(exports, "MaxInt256", { enumerable: true, get: function () { return index_js_3.MaxInt256; } }); -Object.defineProperty(exports, "N", { enumerable: true, get: function () { return index_js_3.N; } }); -Object.defineProperty(exports, "ZeroHash", { enumerable: true, get: function () { return index_js_3.ZeroHash; } }); -Object.defineProperty(exports, "CoreSymbol", { enumerable: true, get: function () { return index_js_3.CoreSymbol; } }); -Object.defineProperty(exports, "MessagePrefix", { enumerable: true, get: function () { return index_js_3.MessagePrefix; } }); -var index_js_4 = require("./contract/index.js"); -Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return index_js_4.BaseContract; } }); -Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return index_js_4.Contract; } }); -Object.defineProperty(exports, "ContractFactory", { enumerable: true, get: function () { return index_js_4.ContractFactory; } }); -Object.defineProperty(exports, "ContractEventPayload", { enumerable: true, get: function () { return index_js_4.ContractEventPayload; } }); -Object.defineProperty(exports, "ContractTransactionReceipt", { enumerable: true, get: function () { return index_js_4.ContractTransactionReceipt; } }); -Object.defineProperty(exports, "ContractTransactionResponse", { enumerable: true, get: function () { return index_js_4.ContractTransactionResponse; } }); -Object.defineProperty(exports, "ContractUnknownEventPayload", { enumerable: true, get: function () { return index_js_4.ContractUnknownEventPayload; } }); -Object.defineProperty(exports, "EventLog", { enumerable: true, get: function () { return index_js_4.EventLog; } }); -var index_js_5 = require("./crypto/index.js"); -Object.defineProperty(exports, "computeHmac", { enumerable: true, get: function () { return index_js_5.computeHmac; } }); -Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return index_js_5.randomBytes; } }); -Object.defineProperty(exports, "ripemd160", { enumerable: true, get: function () { return index_js_5.ripemd160; } }); -Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return index_js_5.sha256; } }); -Object.defineProperty(exports, "sha512", { enumerable: true, get: function () { return index_js_5.sha512; } }); -Object.defineProperty(exports, "pbkdf2", { enumerable: true, get: function () { return index_js_5.pbkdf2; } }); -Object.defineProperty(exports, "scrypt", { enumerable: true, get: function () { return index_js_5.scrypt; } }); -Object.defineProperty(exports, "scryptSync", { enumerable: true, get: function () { return index_js_5.scryptSync; } }); -Object.defineProperty(exports, "lock", { enumerable: true, get: function () { return index_js_5.lock; } }); -Object.defineProperty(exports, "Ed448Goldilock", { enumerable: true, get: function () { return index_js_5.Ed448Goldilock; } }); -Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return index_js_5.Signature; } }); -Object.defineProperty(exports, "SigningKey", { enumerable: true, get: function () { return index_js_5.SigningKey; } }); -Object.defineProperty(exports, "keccak256", { enumerable: true, get: function () { return index_js_5.keccak256; } }); -var index_js_6 = require("./hash/index.js"); -Object.defineProperty(exports, "id", { enumerable: true, get: function () { return index_js_6.id; } }); -Object.defineProperty(exports, "hashMessage", { enumerable: true, get: function () { return index_js_6.hashMessage; } }); -Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return index_js_6.verifyMessage; } }); -Object.defineProperty(exports, "solidityPacked", { enumerable: true, get: function () { return index_js_6.solidityPacked; } }); -Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return index_js_6.solidityPackedSha256; } }); -Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return index_js_6.TypedDataEncoder; } }); -Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return index_js_6.verifyTypedData; } }); -var index_js_7 = require("./providers/index.js"); -Object.defineProperty(exports, "getDefaultProvider", { enumerable: true, get: function () { return index_js_7.getDefaultProvider; } }); -Object.defineProperty(exports, "Block", { enumerable: true, get: function () { return index_js_7.Block; } }); -Object.defineProperty(exports, "FeeData", { enumerable: true, get: function () { return index_js_7.FeeData; } }); -Object.defineProperty(exports, "Log", { enumerable: true, get: function () { return index_js_7.Log; } }); -Object.defineProperty(exports, "TransactionReceipt", { enumerable: true, get: function () { return index_js_7.TransactionReceipt; } }); -Object.defineProperty(exports, "TransactionResponse", { enumerable: true, get: function () { return index_js_7.TransactionResponse; } }); -Object.defineProperty(exports, "AbstractSigner", { enumerable: true, get: function () { return index_js_7.AbstractSigner; } }); -Object.defineProperty(exports, "NonceManager", { enumerable: true, get: function () { return index_js_7.NonceManager; } }); -Object.defineProperty(exports, "VoidSigner", { enumerable: true, get: function () { return index_js_7.VoidSigner; } }); -Object.defineProperty(exports, "AbstractProvider", { enumerable: true, get: function () { return index_js_7.AbstractProvider; } }); -Object.defineProperty(exports, "FallbackProvider", { enumerable: true, get: function () { return index_js_7.FallbackProvider; } }); -Object.defineProperty(exports, "JsonRpcApiProvider", { enumerable: true, get: function () { return index_js_7.JsonRpcApiProvider; } }); -Object.defineProperty(exports, "JsonRpcProvider", { enumerable: true, get: function () { return index_js_7.JsonRpcProvider; } }); -Object.defineProperty(exports, "JsonRpcSigner", { enumerable: true, get: function () { return index_js_7.JsonRpcSigner; } }); -Object.defineProperty(exports, "BrowserProvider", { enumerable: true, get: function () { return index_js_7.BrowserProvider; } }); -Object.defineProperty(exports, "AlchemyProvider", { enumerable: true, get: function () { return index_js_7.AlchemyProvider; } }); -Object.defineProperty(exports, "AnkrProvider", { enumerable: true, get: function () { return index_js_7.AnkrProvider; } }); -Object.defineProperty(exports, "CloudflareProvider", { enumerable: true, get: function () { return index_js_7.CloudflareProvider; } }); -Object.defineProperty(exports, "InfuraProvider", { enumerable: true, get: function () { return index_js_7.InfuraProvider; } }); -Object.defineProperty(exports, "InfuraWebSocketProvider", { enumerable: true, get: function () { return index_js_7.InfuraWebSocketProvider; } }); -Object.defineProperty(exports, "PocketProvider", { enumerable: true, get: function () { return index_js_7.PocketProvider; } }); -Object.defineProperty(exports, "QuickNodeProvider", { enumerable: true, get: function () { return index_js_7.QuickNodeProvider; } }); -Object.defineProperty(exports, "IpcSocketProvider", { enumerable: true, get: function () { return index_js_7.IpcSocketProvider; } }); -Object.defineProperty(exports, "SocketProvider", { enumerable: true, get: function () { return index_js_7.SocketProvider; } }); -Object.defineProperty(exports, "WebSocketProvider", { enumerable: true, get: function () { return index_js_7.WebSocketProvider; } }); -Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return index_js_7.Network; } }); -Object.defineProperty(exports, "FeeDataNetworkPlugin", { enumerable: true, get: function () { return index_js_7.FeeDataNetworkPlugin; } }); -Object.defineProperty(exports, "EnergyCostPlugin", { enumerable: true, get: function () { return index_js_7.EnergyCostPlugin; } }); -Object.defineProperty(exports, "NetworkPlugin", { enumerable: true, get: function () { return index_js_7.NetworkPlugin; } }); -Object.defineProperty(exports, "SocketBlockSubscriber", { enumerable: true, get: function () { return index_js_7.SocketBlockSubscriber; } }); -Object.defineProperty(exports, "SocketEventSubscriber", { enumerable: true, get: function () { return index_js_7.SocketEventSubscriber; } }); -Object.defineProperty(exports, "SocketPendingSubscriber", { enumerable: true, get: function () { return index_js_7.SocketPendingSubscriber; } }); -Object.defineProperty(exports, "SocketSubscriber", { enumerable: true, get: function () { return index_js_7.SocketSubscriber; } }); -Object.defineProperty(exports, "UnmanagedSubscriber", { enumerable: true, get: function () { return index_js_7.UnmanagedSubscriber; } }); -Object.defineProperty(exports, "copyRequest", { enumerable: true, get: function () { return index_js_7.copyRequest; } }); -Object.defineProperty(exports, "showThrottleMessage", { enumerable: true, get: function () { return index_js_7.showThrottleMessage; } }); -var index_js_8 = require("./transaction/index.js"); -Object.defineProperty(exports, "accessListify", { enumerable: true, get: function () { return index_js_8.accessListify; } }); -Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return index_js_8.computeAddress; } }); -Object.defineProperty(exports, "recoverAddress", { enumerable: true, get: function () { return index_js_8.recoverAddress; } }); -Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return index_js_8.Transaction; } }); -var index_js_9 = require("./utils/index.js"); -Object.defineProperty(exports, "decodeBase58", { enumerable: true, get: function () { return index_js_9.decodeBase58; } }); -Object.defineProperty(exports, "encodeBase58", { enumerable: true, get: function () { return index_js_9.encodeBase58; } }); -Object.defineProperty(exports, "decodeBase64", { enumerable: true, get: function () { return index_js_9.decodeBase64; } }); -Object.defineProperty(exports, "encodeBase64", { enumerable: true, get: function () { return index_js_9.encodeBase64; } }); -Object.defineProperty(exports, "concat", { enumerable: true, get: function () { return index_js_9.concat; } }); -Object.defineProperty(exports, "dataLength", { enumerable: true, get: function () { return index_js_9.dataLength; } }); -Object.defineProperty(exports, "dataSlice", { enumerable: true, get: function () { return index_js_9.dataSlice; } }); -Object.defineProperty(exports, "getBytes", { enumerable: true, get: function () { return index_js_9.getBytes; } }); -Object.defineProperty(exports, "getBytesCopy", { enumerable: true, get: function () { return index_js_9.getBytesCopy; } }); -Object.defineProperty(exports, "hexlify", { enumerable: true, get: function () { return index_js_9.hexlify; } }); -Object.defineProperty(exports, "isHexString", { enumerable: true, get: function () { return index_js_9.isHexString; } }); -Object.defineProperty(exports, "isBytesLike", { enumerable: true, get: function () { return index_js_9.isBytesLike; } }); -Object.defineProperty(exports, "stripZerosLeft", { enumerable: true, get: function () { return index_js_9.stripZerosLeft; } }); -Object.defineProperty(exports, "zeroPadBytes", { enumerable: true, get: function () { return index_js_9.zeroPadBytes; } }); -Object.defineProperty(exports, "zeroPadValue", { enumerable: true, get: function () { return index_js_9.zeroPadValue; } }); -Object.defineProperty(exports, "defineProperties", { enumerable: true, get: function () { return index_js_9.defineProperties; } }); -Object.defineProperty(exports, "resolveProperties", { enumerable: true, get: function () { return index_js_9.resolveProperties; } }); -Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return index_js_9.assert; } }); -Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return index_js_9.assertArgument; } }); -Object.defineProperty(exports, "assertArgumentCount", { enumerable: true, get: function () { return index_js_9.assertArgumentCount; } }); -Object.defineProperty(exports, "assertNormalize", { enumerable: true, get: function () { return index_js_9.assertNormalize; } }); -Object.defineProperty(exports, "assertPrivate", { enumerable: true, get: function () { return index_js_9.assertPrivate; } }); -Object.defineProperty(exports, "makeError", { enumerable: true, get: function () { return index_js_9.makeError; } }); -Object.defineProperty(exports, "isCallException", { enumerable: true, get: function () { return index_js_9.isCallException; } }); -Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return index_js_9.isError; } }); -Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return index_js_9.EventPayload; } }); -Object.defineProperty(exports, "FetchRequest", { enumerable: true, get: function () { return index_js_9.FetchRequest; } }); -Object.defineProperty(exports, "FetchResponse", { enumerable: true, get: function () { return index_js_9.FetchResponse; } }); -Object.defineProperty(exports, "FetchCancelSignal", { enumerable: true, get: function () { return index_js_9.FetchCancelSignal; } }); -Object.defineProperty(exports, "FixedNumber", { enumerable: true, get: function () { return index_js_9.FixedNumber; } }); -Object.defineProperty(exports, "getBigInt", { enumerable: true, get: function () { return index_js_9.getBigInt; } }); -Object.defineProperty(exports, "getNumber", { enumerable: true, get: function () { return index_js_9.getNumber; } }); -Object.defineProperty(exports, "getUint", { enumerable: true, get: function () { return index_js_9.getUint; } }); -Object.defineProperty(exports, "toBeArray", { enumerable: true, get: function () { return index_js_9.toBeArray; } }); -Object.defineProperty(exports, "toBigInt", { enumerable: true, get: function () { return index_js_9.toBigInt; } }); -Object.defineProperty(exports, "toBeHex", { enumerable: true, get: function () { return index_js_9.toBeHex; } }); -Object.defineProperty(exports, "toNumber", { enumerable: true, get: function () { return index_js_9.toNumber; } }); -Object.defineProperty(exports, "toQuantity", { enumerable: true, get: function () { return index_js_9.toQuantity; } }); -Object.defineProperty(exports, "fromTwos", { enumerable: true, get: function () { return index_js_9.fromTwos; } }); -Object.defineProperty(exports, "toTwos", { enumerable: true, get: function () { return index_js_9.toTwos; } }); -Object.defineProperty(exports, "mask", { enumerable: true, get: function () { return index_js_9.mask; } }); -Object.defineProperty(exports, "formatXCB", { enumerable: true, get: function () { return index_js_9.formatXCB; } }); -Object.defineProperty(exports, "parseXCB", { enumerable: true, get: function () { return index_js_9.parseXCB; } }); -Object.defineProperty(exports, "formatUnits", { enumerable: true, get: function () { return index_js_9.formatUnits; } }); -Object.defineProperty(exports, "parseUnits", { enumerable: true, get: function () { return index_js_9.parseUnits; } }); -Object.defineProperty(exports, "toUtf8Bytes", { enumerable: true, get: function () { return index_js_9.toUtf8Bytes; } }); -Object.defineProperty(exports, "toUtf8CodePoints", { enumerable: true, get: function () { return index_js_9.toUtf8CodePoints; } }); -Object.defineProperty(exports, "toUtf8String", { enumerable: true, get: function () { return index_js_9.toUtf8String; } }); -Object.defineProperty(exports, "Utf8ErrorFuncs", { enumerable: true, get: function () { return index_js_9.Utf8ErrorFuncs; } }); -Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return index_js_9.decodeRlp; } }); -Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return index_js_9.encodeRlp; } }); -Object.defineProperty(exports, "uuidV4", { enumerable: true, get: function () { return index_js_9.uuidV4; } }); -Object.defineProperty(exports, "arrayify", { enumerable: true, get: function () { return index_js_9.arrayify; } }); -Object.defineProperty(exports, "hexConcat", { enumerable: true, get: function () { return index_js_9.hexConcat; } }); -var index_js_10 = require("./wallet/index.js"); -Object.defineProperty(exports, "Mnemonic", { enumerable: true, get: function () { return index_js_10.Mnemonic; } }); -Object.defineProperty(exports, "BaseWallet", { enumerable: true, get: function () { return index_js_10.BaseWallet; } }); -Object.defineProperty(exports, "HDNodeWallet", { enumerable: true, get: function () { return index_js_10.HDNodeWallet; } }); -Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return index_js_10.Wallet; } }); -Object.defineProperty(exports, "defaultPath", { enumerable: true, get: function () { return index_js_10.defaultPath; } }); -Object.defineProperty(exports, "getAccountPath", { enumerable: true, get: function () { return index_js_10.getAccountPath; } }); -Object.defineProperty(exports, "getIndexedAccountPath", { enumerable: true, get: function () { return index_js_10.getIndexedAccountPath; } }); -Object.defineProperty(exports, "isCrowdsaleJson", { enumerable: true, get: function () { return index_js_10.isCrowdsaleJson; } }); -Object.defineProperty(exports, "isKeystoreJson", { enumerable: true, get: function () { return index_js_10.isKeystoreJson; } }); -Object.defineProperty(exports, "decryptCrowdsaleJson", { enumerable: true, get: function () { return index_js_10.decryptCrowdsaleJson; } }); -Object.defineProperty(exports, "decryptKeystoreJsonSync", { enumerable: true, get: function () { return index_js_10.decryptKeystoreJsonSync; } }); -Object.defineProperty(exports, "decryptKeystoreJson", { enumerable: true, get: function () { return index_js_10.decryptKeystoreJson; } }); -Object.defineProperty(exports, "encryptKeystoreJson", { enumerable: true, get: function () { return index_js_10.encryptKeystoreJson; } }); -Object.defineProperty(exports, "encryptKeystoreJsonSync", { enumerable: true, get: function () { return index_js_10.encryptKeystoreJsonSync; } }); -var bigNumber_js_1 = require("./bigNumber/bigNumber.js"); -Object.defineProperty(exports, "BigNumber", { enumerable: true, get: function () { return bigNumber_js_1.BigNumber; } }); -var index_js_11 = require("./wordlists/index.js"); -Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return index_js_11.Wordlist; } }); -Object.defineProperty(exports, "LangEn", { enumerable: true, get: function () { return index_js_11.LangEn; } }); -Object.defineProperty(exports, "WordlistOwl", { enumerable: true, get: function () { return index_js_11.WordlistOwl; } }); -Object.defineProperty(exports, "WordlistOwlA", { enumerable: true, get: function () { return index_js_11.WordlistOwlA; } }); -Object.defineProperty(exports, "wordlists", { enumerable: true, get: function () { return index_js_11.wordlists; } }); -//# sourceMappingURL=corebc.js.map \ No newline at end of file +'use strict'; + +var _version = require('./_version.js'); +var address = require('./transaction/address.js'); +var abiCoder = require('./abi/abi-coder.js'); +var bytes32 = require('./abi/bytes32.js'); +var fragments = require('./abi/fragments.js'); +var _interface = require('./abi/interface.js'); +var typed = require('./abi/typed.js'); +var index$2 = require('./address/index.js'); +var contractAddress = require('./address/contract-address.js'); +var checks = require('./address/checks.js'); +var addresses = require('./constants/addresses.js'); +var hashes = require('./constants/hashes.js'); +var numbers = require('./constants/numbers.js'); +var strings = require('./constants/strings.js'); +var contract = require('./contract/contract.js'); +var factory = require('./contract/factory.js'); +var wrappers = require('./contract/wrappers.js'); +var index$3 = require('./crypto/index.js'); +var id = require('./hash/id.js'); +var message = require('./hash/message.js'); +var solidity = require('./hash/solidity.js'); +var typedData = require('./hash/typed-data.js'); +var abstractProvider = require('./providers/abstract-provider.js'); +var abstractSigner = require('./providers/abstract-signer.js'); +var community = require('./providers/community.js'); +var defaultProvider = require('./providers/default-provider.js'); +var network = require('./providers/network.js'); +var signerNoncemanager = require('./providers/signer-noncemanager.js'); +var pluginsNetwork = require('./providers/plugins-network.js'); +var provider = require('./providers/provider.js'); +var providerFallback = require('./providers/provider-fallback.js'); +var providerJsonrpc = require('./providers/provider-jsonrpc.js'); +var providerBrowser = require('./providers/provider-browser.js'); +var providerAlchemy = require('./providers/provider-alchemy.js'); +var providerAnkr = require('./providers/provider-ankr.js'); +var providerCloudflare = require('./providers/provider-cloudflare.js'); +var providerInfura = require('./providers/provider-infura.js'); +var providerPocket = require('./providers/provider-pocket.js'); +var providerQuicknode = require('./providers/provider-quicknode.js'); +var providerIpcsocket = require('./providers/provider-ipcsocket.js'); +var providerSocket = require('./providers/provider-socket.js'); +var providerWebsocket = require('./providers/provider-websocket.js'); +var accesslist = require('./transaction/accesslist.js'); +var transaction = require('./transaction/transaction.js'); +var base58 = require('./utils/base58.js'); +var base64 = require('./utils/base64.js'); +var data = require('./utils/data.js'); +var errors = require('./utils/errors.js'); +var events = require('./utils/events.js'); +var fetch = require('./utils/fetch.js'); +var fixednumber = require('./utils/fixednumber.js'); +var maths = require('./utils/maths.js'); +var properties = require('./utils/properties.js'); +var rlpDecode = require('./utils/rlp-decode.js'); +var rlpEncode = require('./utils/rlp-encode.js'); +var units = require('./utils/units.js'); +var utf8 = require('./utils/utf8.js'); +var uuid = require('./utils/uuid.js'); +var baseWallet = require('./wallet/base-wallet.js'); +var hdwallet = require('./wallet/hdwallet.js'); +var jsonCrowdsale = require('./wallet/json-crowdsale.js'); +var jsonKeystore = require('./wallet/json-keystore.js'); +var mnemonic = require('./wallet/mnemonic.js'); +var wallet = require('./wallet/wallet.js'); +var bigNumber = require('./bigNumber/bigNumber.js'); +var wordlist = require('./wordlists/wordlist.js'); +var langEn = require('./wordlists/lang-en.js'); +var wordlistOwl = require('./wordlists/wordlist-owl.js'); +var wordlistOwla = require('./wordlists/wordlist-owla.js'); +var wordlists = require('./wordlists/wordlists.js'); +var index = require('./cip/index.js'); +var index$1 = require('./ipfs/index.js'); +var customUnits = require('./cip/custom-units.js'); +var ed448goldilock = require('./crypto/ed448goldilock.js'); +var abstractCoder = require('./abi/coders/abstract-coder.js'); +var signature = require('./crypto/signature.js'); +var signingKey = require('./crypto/signing-key.js'); +var hmac = require('./crypto/hmac.js'); +var keccak = require('./crypto/keccak.js'); +var pbkdf2 = require('./crypto/pbkdf2.js'); +var random = require('./crypto/random.js'); +var ripemd160 = require('./crypto/ripemd160.js'); +var scrypt = require('./crypto/scrypt.js'); +var sha3 = require('./crypto/sha3.js'); + + + +exports.version = _version.version; +exports.computeAddress = address.computeAddress; +exports.publicToAddress = address.publicToAddress; +exports.recoverAddress = address.recoverAddress; +exports.AbiCoder = abiCoder.AbiCoder; +exports.decodeBytes32String = bytes32.decodeBytes32String; +exports.encodeBytes32String = bytes32.encodeBytes32String; +exports.ConstructorFragment = fragments.ConstructorFragment; +exports.ErrorFragment = fragments.ErrorFragment; +exports.EventFragment = fragments.EventFragment; +exports.FallbackFragment = fragments.FallbackFragment; +exports.Fragment = fragments.Fragment; +exports.FunctionFragment = fragments.FunctionFragment; +exports.NamedFragment = fragments.NamedFragment; +exports.ParamType = fragments.ParamType; +exports.StructFragment = fragments.StructFragment; +exports.ErrorDescription = _interface.ErrorDescription; +exports.Indexed = _interface.Indexed; +exports.Interface = _interface.Interface; +exports.LogDescription = _interface.LogDescription; +exports.TransactionDescription = _interface.TransactionDescription; +exports.Typed = typed.Typed; +exports.getAddress = index$2.getAddress; +exports.networkIdToPrefix = index$2.networkIdToPrefix; +exports.getCreate2Address = contractAddress.getCreate2Address; +exports.getCreateAddress = contractAddress.getCreateAddress; +exports.isAddress = checks.isAddress; +exports.isAddressable = checks.isAddressable; +exports.resolveAddress = checks.resolveAddress; +exports.ZeroAddress = addresses.ZeroAddress; +exports.ZeroHash = hashes.ZeroHash; +exports.MaxInt256 = numbers.MaxInt256; +exports.MaxUint256 = numbers.MaxUint256; +exports.MinInt256 = numbers.MinInt256; +exports.N = numbers.N; +exports.OrePerXCB = numbers.OrePerXCB; +exports.CoreSymbol = strings.CoreSymbol; +exports.MessagePrefix = strings.MessagePrefix; +exports.BaseContract = contract.BaseContract; +exports.Contract = contract.Contract; +exports.ContractFactory = factory.ContractFactory; +exports.ContractEventPayload = wrappers.ContractEventPayload; +exports.ContractTransactionReceipt = wrappers.ContractTransactionReceipt; +exports.ContractTransactionResponse = wrappers.ContractTransactionResponse; +exports.ContractUnknownEventPayload = wrappers.ContractUnknownEventPayload; +exports.EventLog = wrappers.EventLog; +exports.lock = index$3.lock; +exports.id = id.id; +exports.hashMessage = message.hashMessage; +exports.verifyMessage = message.verifyMessage; +exports.solidityPacked = solidity.solidityPacked; +exports.solidityPackedSha256 = solidity.solidityPackedSha256; +exports.TypedDataEncoder = typedData.TypedDataEncoder; +exports.verifyTypedData = typedData.verifyTypedData; +exports.AbstractProvider = abstractProvider.AbstractProvider; +exports.UnmanagedSubscriber = abstractProvider.UnmanagedSubscriber; +exports.AbstractSigner = abstractSigner.AbstractSigner; +exports.VoidSigner = abstractSigner.VoidSigner; +exports.showThrottleMessage = community.showThrottleMessage; +exports.getDefaultProvider = defaultProvider.getDefaultProvider; +exports.Network = network.Network; +exports.NonceManager = signerNoncemanager.NonceManager; +exports.EnergyCostPlugin = pluginsNetwork.EnergyCostPlugin; +exports.FeeDataNetworkPlugin = pluginsNetwork.FeeDataNetworkPlugin; +exports.NetworkPlugin = pluginsNetwork.NetworkPlugin; +exports.Block = provider.Block; +exports.FeeData = provider.FeeData; +exports.Log = provider.Log; +exports.TransactionReceipt = provider.TransactionReceipt; +exports.TransactionResponse = provider.TransactionResponse; +exports.copyRequest = provider.copyRequest; +exports.FallbackProvider = providerFallback.FallbackProvider; +exports.JsonRpcApiProvider = providerJsonrpc.JsonRpcApiProvider; +exports.JsonRpcProvider = providerJsonrpc.JsonRpcProvider; +exports.JsonRpcSigner = providerJsonrpc.JsonRpcSigner; +exports.BrowserProvider = providerBrowser.BrowserProvider; +exports.AlchemyProvider = providerAlchemy.AlchemyProvider; +exports.AnkrProvider = providerAnkr.AnkrProvider; +exports.CloudflareProvider = providerCloudflare.CloudflareProvider; +exports.InfuraProvider = providerInfura.InfuraProvider; +exports.InfuraWebSocketProvider = providerInfura.InfuraWebSocketProvider; +exports.PocketProvider = providerPocket.PocketProvider; +exports.QuickNodeProvider = providerQuicknode.QuickNodeProvider; +exports.IpcSocketProvider = providerIpcsocket.IpcSocketProvider; +exports.SocketBlockSubscriber = providerSocket.SocketBlockSubscriber; +exports.SocketEventSubscriber = providerSocket.SocketEventSubscriber; +exports.SocketPendingSubscriber = providerSocket.SocketPendingSubscriber; +exports.SocketProvider = providerSocket.SocketProvider; +exports.SocketSubscriber = providerSocket.SocketSubscriber; +exports.WebSocketProvider = providerWebsocket.WebSocketProvider; +exports.accessListify = accesslist.accessListify; +exports.Transaction = transaction.Transaction; +exports.decodeBase58 = base58.decodeBase58; +exports.encodeBase58 = base58.encodeBase58; +exports.decodeBase64 = base64.decodeBase64; +exports.encodeBase64 = base64.encodeBase64; +exports.arrayify = data.arrayify; +exports.concat = data.concat; +exports.dataLength = data.dataLength; +exports.dataSlice = data.dataSlice; +exports.getBytes = data.getBytes; +exports.getBytesCopy = data.getBytesCopy; +exports.hexConcat = data.hexConcat; +exports.hexlify = data.hexlify; +exports.isBytesLike = data.isBytesLike; +exports.isHexString = data.isHexString; +exports.stripZerosLeft = data.stripZerosLeft; +exports.zeroPadBytes = data.zeroPadBytes; +exports.zeroPadValue = data.zeroPadValue; +exports.assert = errors.assert; +exports.assertArgument = errors.assertArgument; +exports.assertArgumentCount = errors.assertArgumentCount; +exports.assertNormalize = errors.assertNormalize; +exports.assertPrivate = errors.assertPrivate; +exports.isCallException = errors.isCallException; +exports.isError = errors.isError; +exports.makeError = errors.makeError; +exports.EventPayload = events.EventPayload; +exports.FetchCancelSignal = fetch.FetchCancelSignal; +exports.FetchRequest = fetch.FetchRequest; +exports.FetchResponse = fetch.FetchResponse; +exports.FixedNumber = fixednumber.FixedNumber; +exports.fromTwos = maths.fromTwos; +exports.getBigInt = maths.getBigInt; +exports.getNumber = maths.getNumber; +exports.getUint = maths.getUint; +exports.mask = maths.mask; +exports.toBeArray = maths.toBeArray; +exports.toBeHex = maths.toBeHex; +exports.toBigInt = maths.toBigInt; +exports.toNumber = maths.toNumber; +exports.toQuantity = maths.toQuantity; +exports.toTwos = maths.toTwos; +exports.defineProperties = properties.defineProperties; +exports.resolveProperties = properties.resolveProperties; +exports.decodeRlp = rlpDecode.decodeRlp; +exports.encodeRlp = rlpEncode.encodeRlp; +exports.formatUnits = units.formatUnits; +exports.formatXCB = units.formatXCB; +exports.parseUnits = units.parseUnits; +exports.parseXCB = units.parseXCB; +exports.Utf8ErrorFuncs = utf8.Utf8ErrorFuncs; +exports.toUtf8Bytes = utf8.toUtf8Bytes; +exports.toUtf8CodePoints = utf8.toUtf8CodePoints; +exports.toUtf8String = utf8.toUtf8String; +exports.uuidV4 = uuid.uuidV4; +exports.BaseWallet = baseWallet.BaseWallet; +exports.HDNodeWallet = hdwallet.HDNodeWallet; +exports.defaultPath = hdwallet.defaultPath; +exports.getAccountPath = hdwallet.getAccountPath; +exports.getIndexedAccountPath = hdwallet.getIndexedAccountPath; +exports.decryptCrowdsaleJson = jsonCrowdsale.decryptCrowdsaleJson; +exports.isCrowdsaleJson = jsonCrowdsale.isCrowdsaleJson; +exports.decryptKeystoreJson = jsonKeystore.decryptKeystoreJson; +exports.decryptKeystoreJsonSync = jsonKeystore.decryptKeystoreJsonSync; +exports.encryptKeystoreJson = jsonKeystore.encryptKeystoreJson; +exports.encryptKeystoreJsonSync = jsonKeystore.encryptKeystoreJsonSync; +exports.isKeystoreJson = jsonKeystore.isKeystoreJson; +exports.Mnemonic = mnemonic.Mnemonic; +exports.Wallet = wallet.Wallet; +exports.BigNumber = bigNumber.BigNumber; +exports.Wordlist = wordlist.Wordlist; +exports.LangEn = langEn.LangEn; +exports.WordlistOwl = wordlistOwl.WordlistOwl; +exports.WordlistOwlA = wordlistOwla.WordlistOwlA; +exports.wordlists = wordlists.wordlists; +exports.Cip150MetadataContract = index.Cip150MetadataContract; +exports.Cip151Lifecycle = index.Cip151Lifecycle; +exports.Cip152LabCertificate = index.Cip152LabCertificate; +exports.cip150Abi = index.cip150Abi; +exports.cip151TokenExpirationKey = index.cip151TokenExpirationKey; +exports.cip151TradingStopKey = index.cip151TradingStopKey; +exports.cip152LabKey = index.cip152LabKey; +exports.IpfsGateway = index$1.IpfsGateway; +exports.defaultIpfsGatewayTemplate = index$1.defaultIpfsGatewayTemplate; +exports.CustomUnitBalance = customUnits.CustomUnitBalance; +exports.CustomUnitDiscovery = customUnits.CustomUnitDiscovery; +exports.CustomUnitToken = customUnits.CustomUnitToken; +exports.customUnitAbi = customUnits.customUnitAbi; +exports.Ed448Goldilock = ed448goldilock.Ed448Goldilock; +exports.Result = abstractCoder.Result; +exports.checkResultErrors = abstractCoder.checkResultErrors; +exports.Signature = signature.Signature; +exports.SigningKey = signingKey.SigningKey; +exports.computeHmac = hmac.computeHmac; +exports.keccak256 = keccak.keccak256; +exports.pbkdf2 = pbkdf2.pbkdf2; +exports.randomBytes = random.randomBytes; +exports.ripemd160 = ripemd160.ripemd160; +exports.scrypt = scrypt.scrypt; +exports.scryptSync = scrypt.scryptSync; +exports.sha256 = sha3.sha256; +exports.sha512 = sha3.sha512; +//# sourceMappingURL=corebc.js.map diff --git a/lib.commonjs/corebc.js.map b/lib.commonjs/corebc.js.map index 0f4909326..64171a01f 100644 --- a/lib.commonjs/corebc.js.map +++ b/lib.commonjs/corebc.js.map @@ -1 +1 @@ -{"version":3,"file":"corebc.js","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAwC;AAA/B,sGAAA,OAAO,OAAA;AAChB,uDAA2D;AAAlD,6GAAA,eAAe,OAAA;AAExB,2CAqBwB;AApBtB,+GAAA,mBAAmB,OAAA;AACnB,+GAAA,mBAAmB,OAAA;AACnB,oGAAA,QAAQ,OAAA;AACR,+GAAA,mBAAmB,OAAA;AACnB,yGAAA,aAAa,OAAA;AACb,yGAAA,aAAa,OAAA;AACb,oGAAA,QAAQ,OAAA;AACR,4GAAA,gBAAgB,OAAA;AAChB,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AACb,qGAAA,SAAS,OAAA;AACT,0GAAA,cAAc,OAAA;AACd,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAChB,mGAAA,OAAO,OAAA;AACP,qGAAA,SAAS,OAAA;AACT,0GAAA,cAAc,OAAA;AACd,kGAAA,MAAM,OAAA;AACN,kHAAA,sBAAsB,OAAA;AACtB,iGAAA,KAAK,OAAA;AAGP,+CAAmE;AAA1D,sGAAA,UAAU,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAEtC,qEAGuC;AAFrC,wHAAA,iBAAiB,OAAA;AACjB,uHAAA,gBAAgB,OAAA;AAGlB,iDAA+E;AAAtE,0GAAA,aAAa,OAAA;AAAE,sGAAA,SAAS,OAAA;AAAE,2GAAA,cAAc,OAAA;AAEjD,iDAU8B;AAT5B,uGAAA,WAAW,OAAA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A;AACnB,gHAAA,mBAAmB,OAAA;AACnB,oHAAA,uBAAuB,OAAA;AAGzB,yDAAqD;AAA5C,yGAAA,SAAS,OAAA;AAElB,kDAM8B;AAL5B,qGAAA,QAAQ,OAAA;AACR,mGAAA,MAAM,OAAA;AACN,wGAAA,WAAW,OAAA;AACX,yGAAA,YAAY,OAAA;AACZ,sGAAA,SAAS,OAAA"} \ No newline at end of file +{"version":3,"file":"corebc.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-ed448.d.ts b/lib.commonjs/crypto/browser-ed448.d.ts index 7aee3772e..7b2b7d29a 100644 --- a/lib.commonjs/crypto/browser-ed448.d.ts +++ b/lib.commonjs/crypto/browser-ed448.d.ts @@ -1,3 +1,4 @@ -import ed448 from "bcrypto/lib/ed448-browser.js"; +import type { Ed448Backend } from "./ed448-types.js"; +declare const ed448: Ed448Backend; export default ed448; //# sourceMappingURL=browser-ed448.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-ed448.d.ts.map b/lib.commonjs/crypto/browser-ed448.d.ts.map index ac87af8f7..33a4fd898 100644 --- a/lib.commonjs/crypto/browser-ed448.d.ts.map +++ b/lib.commonjs/crypto/browser-ed448.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"browser-ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,8BAA8B,CAAC;AACjD,eAAe,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"browser-ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-ed448.js b/lib.commonjs/crypto/browser-ed448.js index 254e69ad2..ad139a761 100644 --- a/lib.commonjs/crypto/browser-ed448.js +++ b/lib.commonjs/crypto/browser-ed448.js @@ -1,7 +1,12 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var backend = require('bcrypto/lib/ed448-browser.js'); + +// bcrypto does not ship TypeScript declarations. // @ts-ignore -const ed448_browser_js_1 = tslib_1.__importDefault(require("bcrypto/lib/ed448-browser.js")); -exports.default = ed448_browser_js_1.default; -//# sourceMappingURL=browser-ed448.js.map \ No newline at end of file +const ed448 = backend; + +exports.default = ed448; +//# sourceMappingURL=browser-ed448.js.map diff --git a/lib.commonjs/crypto/browser-ed448.js.map b/lib.commonjs/crypto/browser-ed448.js.map index fe53b4ee8..0e2ad36d4 100644 --- a/lib.commonjs/crypto/browser-ed448.js.map +++ b/lib.commonjs/crypto/browser-ed448.js.map @@ -1 +1 @@ -{"version":3,"file":"browser-ed448.js","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,aAAa;AACb,4FAAiD;AACjD,kBAAe,0BAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"browser-ed448.js","sources":["../../lib.esm/crypto/browser-ed448.js"],"sourcesContent":["// bcrypto does not ship TypeScript declarations.\n// @ts-ignore\nimport backend from \"bcrypto/lib/ed448-browser.js\";\nconst ed448 = backend;\nexport default ed448;\n//# sourceMappingURL=browser-ed448.js.map"],"names":[],"mappings":";;;;;;AAAA;AACA;AAEK,MAAC,KAAK,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-sha3.d.ts.map b/lib.commonjs/crypto/browser-sha3.d.ts.map index e40fa9ffd..61f4a3fba 100644 --- a/lib.commonjs/crypto/browser-sha3.d.ts.map +++ b/lib.commonjs/crypto/browser-sha3.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"browser-sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AAQA,OAAO,EAAY,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACd,MAAM,CAkBR"} \ No newline at end of file +{"version":3,"file":"browser-sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AASA,OAAO,EAAY,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR"} \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-sha3.js b/lib.commonjs/crypto/browser-sha3.js index 3a21eb73f..4c1ecb23e 100644 --- a/lib.commonjs/crypto/browser-sha3.js +++ b/lib.commonjs/crypto/browser-sha3.js @@ -1,47 +1,46 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.computeHmac = exports.sha512 = exports.sha256 = exports.ripemd160 = void 0; -const tslib_1 = require("tslib"); -// @ts-ignore -const ripemd160_browser_1 = tslib_1.__importDefault(require("bcrypto/lib/ripemd160-browser")); -// @ts-ignore -const sha3_browser_js_1 = tslib_1.__importDefault(require("bcrypto/lib/sha3-browser.js")); -const logger_js_1 = require("../logger/logger.js"); -const data_js_1 = require("../utils/data.js"); -const sha3_js_1 = require("./sha3.js"); -const logger = new logger_js_1.Logger("corebc-crypto/browser-sha3/0.0.1"); -function ripemd160(data) { - const d = Buffer.from((0, data_js_1.arrayify)(data)); - const h = ripemd160_browser_1.default.digest(d); - return (0, data_js_1.hexlify)(h); +'use strict'; + +var buffer = require('buffer'); +var _ripemd160 = require('bcrypto/lib/ripemd160-browser'); +var sha3$1 = require('bcrypto/lib/sha3-browser.js'); +var logger$1 = require('../logger/logger.js'); +var data = require('../utils/data.js'); +var sha3 = require('./sha3.js'); + +const logger = new logger$1.Logger("corebc-crypto/browser-sha3/0.0.1"); +function ripemd160(data$1) { + const d = buffer.Buffer.from(data.arrayify(data$1)); + const h = _ripemd160.digest(d); + return data.hexlify(h); } -exports.ripemd160 = ripemd160; -function sha256(data) { - const d = Buffer.from((0, data_js_1.arrayify)(data)); - const h = sha3_browser_js_1.default.digest(d, 256); - return (0, data_js_1.hexlify)(h); +function sha256(data$1) { + const d = buffer.Buffer.from(data.arrayify(data$1)); + const h = sha3$1.digest(d, 256); + return data.hexlify(h); } -exports.sha256 = sha256; -function sha512(data) { - const d = Buffer.from((0, data_js_1.arrayify)(data)); - const h = sha3_browser_js_1.default.digest(d, 512); - return (0, data_js_1.hexlify)(h); +function sha512(data$1) { + const d = buffer.Buffer.from(data.arrayify(data$1)); + const h = sha3$1.digest(d, 512); + return data.hexlify(h); } -exports.sha512 = sha512; -function computeHmac(algorithm, key, data) { - const d = Buffer.from((0, data_js_1.arrayify)(data)); - const k = Buffer.from((0, data_js_1.arrayify)(key)); - if (algorithm === sha3_js_1.SupportedAlgorithm.sha256) { - return (0, data_js_1.hexlify)(sha3_browser_js_1.default.mac(d, k, 256)); +function computeHmac(algorithm, key, data$1) { + const d = buffer.Buffer.from(data.arrayify(data$1)); + const k = buffer.Buffer.from(data.arrayify(key)); + if (algorithm === sha3.SupportedAlgorithm.sha256) { + return data.hexlify(sha3$1.mac(d, k, 256)); } - else if (algorithm === sha3_js_1.SupportedAlgorithm.sha512) { - return (0, data_js_1.hexlify)(sha3_browser_js_1.default.mac(d, k, 512)); + else if (algorithm === sha3.SupportedAlgorithm.sha512) { + return data.hexlify(sha3$1.mac(d, k, 512)); } - logger.throwError("unsupported algorithm - " + algorithm, logger_js_1.Logger.errors.UNSUPPORTED_OPERATION, { + logger.throwError("unsupported algorithm - " + algorithm, logger$1.Logger.errors.UNSUPPORTED_OPERATION, { operation: "computeHmac", algorithm: algorithm, }); return ""; } + exports.computeHmac = computeHmac; -//# sourceMappingURL=browser-sha3.js.map \ No newline at end of file +exports.ripemd160 = ripemd160; +exports.sha256 = sha256; +exports.sha512 = sha512; +//# sourceMappingURL=browser-sha3.js.map diff --git a/lib.commonjs/crypto/browser-sha3.js.map b/lib.commonjs/crypto/browser-sha3.js.map index 8f943a180..983fea18b 100644 --- a/lib.commonjs/crypto/browser-sha3.js.map +++ b/lib.commonjs/crypto/browser-sha3.js.map @@ -1 +1 @@ -{"version":3,"file":"browser-sha3.js","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;AAEb,aAAa;AACb,8FAAuD;AACvD,aAAa;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,EAAE;QAC3C,OAAO,IAAA,iBAAO,EAAC,yBAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;KACrC;SAAM,IAAI,SAAS,KAAK,4BAAkB,CAAC,MAAM,EAAE;QAClD,OAAO,IAAA,iBAAO,EAAC,yBAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;KACrC;IAED,MAAM,CAAC,UAAU,CACf,0BAA0B,GAAG,SAAS,EACtC,kBAAM,CAAC,MAAM,CAAC,qBAAqB,EACnC;QACE,SAAS,EAAE,aAAa;QACxB,SAAS,EAAE,SAAS;KACrB,CACF,CAAC;IACF,OAAO,EAAE,CAAC;AACZ,CAAC;AAtBD,kCAsBC"} \ No newline at end of file +{"version":3,"file":"browser-sha3.js","sources":["../../lib.esm/crypto/browser-sha3.js"],"sourcesContent":["import { Buffer } from \"buffer\";\n(\"use strict\");\n// @ts-ignore\nimport _ripemd160 from \"bcrypto/lib/ripemd160-browser\";\n// @ts-ignore\nimport sha3 from \"bcrypto/lib/sha3-browser.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify } from \"../utils/data.js\";\nimport { SupportedAlgorithm } from \"./sha3.js\";\nconst logger = new Logger(\"corebc-crypto/browser-sha3/0.0.1\");\nexport function ripemd160(data) {\n const d = Buffer.from(arrayify(data));\n const h = _ripemd160.digest(d);\n return hexlify(h);\n}\nexport function sha256(data) {\n const d = Buffer.from(arrayify(data));\n const h = sha3.digest(d, 256);\n return hexlify(h);\n}\nexport function sha512(data) {\n const d = Buffer.from(arrayify(data));\n const h = sha3.digest(d, 512);\n return hexlify(h);\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(sha3.mac(d, k, 256));\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(sha3.mac(d, k, 512));\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\n//# sourceMappingURL=browser-sha3.js.map"],"names":["Logger","data","Buffer","arrayify","hexlify","sha3","SupportedAlgorithm"],"mappings":";;;;;;;;;AASA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,kCAAkC,CAAC;AACtD,SAAS,SAAS,CAACC,MAAI,EAAE;AAChC,IAAI,MAAM,CAAC,GAAGC,aAAM,CAAC,IAAI,CAACC,aAAQ,CAACF,MAAI,CAAC,CAAC;AACzC,IAAI,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AAClC,IAAI,OAAOG,YAAO,CAAC,CAAC,CAAC;AACrB;AACO,SAAS,MAAM,CAACH,MAAI,EAAE;AAC7B,IAAI,MAAM,CAAC,GAAGC,aAAM,CAAC,IAAI,CAACC,aAAQ,CAACF,MAAI,CAAC,CAAC;AACzC,IAAI,MAAM,CAAC,GAAGI,MAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC;AACjC,IAAI,OAAOD,YAAO,CAAC,CAAC,CAAC;AACrB;AACO,SAAS,MAAM,CAACH,MAAI,EAAE;AAC7B,IAAI,MAAM,CAAC,GAAGC,aAAM,CAAC,IAAI,CAACC,aAAQ,CAACF,MAAI,CAAC,CAAC;AACzC,IAAI,MAAM,CAAC,GAAGI,MAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC;AACjC,IAAI,OAAOD,YAAO,CAAC,CAAC,CAAC;AACrB;AACO,SAAS,WAAW,CAAC,SAAS,EAAE,GAAG,EAAEH,MAAI,EAAE;AAClD,IAAI,MAAM,CAAC,GAAGC,aAAM,CAAC,IAAI,CAACC,aAAQ,CAACF,MAAI,CAAC,CAAC;AACzC,IAAI,MAAM,CAAC,GAAGC,aAAM,CAAC,IAAI,CAACC,aAAQ,CAAC,GAAG,CAAC,CAAC;AACxC,IAAI,IAAI,SAAS,KAAKG,uBAAkB,CAAC,MAAM,EAAE;AACjD,QAAQ,OAAOF,YAAO,CAACC,MAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3C,IAAI;AACJ,SAAS,IAAI,SAAS,KAAKC,uBAAkB,CAAC,MAAM,EAAE;AACtD,QAAQ,OAAOF,YAAO,CAACC,MAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3C,IAAI;AACJ,IAAI,MAAM,CAAC,UAAU,CAAC,0BAA0B,GAAG,SAAS,EAAEL,eAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;AACnG,QAAQ,SAAS,EAAE,aAAa;AAChC,QAAQ,SAAS,EAAE,SAAS;AAC5B,KAAK,CAAC;AACN,IAAI,OAAO,EAAE;AACb;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto-browser.d.ts.map b/lib.commonjs/crypto/crypto-browser.d.ts.map index 74fb87c78..96b1570a8 100644 --- a/lib.commonjs/crypto/crypto-browser.d.ts.map +++ b/lib.commonjs/crypto/crypto-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;KAAG;IAEnB,MAAM,MAAM,EAAE,MAAM,CAAC;IAErB,MAAM,IAAI,EAAE,MAAM,CAAC;CACpB;AAkBD,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACtB;AAED,w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oBtD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto-browser.js b/lib.commonjs/crypto/crypto-browser.js index 3216f9182..c9ae3fb7e 100644 --- a/lib.commonjs/crypto/crypto-browser.js +++ b/lib.commonjs/crypto/crypto-browser.js @@ -1,19 +1,25 @@ -"use strict"; +'use strict'; + +var legacy_js = require('@noble/hashes/legacy.js'); +var hmac_js = require('@noble/hashes/hmac.js'); +var pbkdf2_js = require('@noble/hashes/pbkdf2.js'); +var sha2_js = require('@noble/hashes/sha2.js'); +var sha3_js = require('@noble/hashes/sha3.js'); +var browserEd448 = require('./browser-ed448.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var ed448goldilockBrowser = require('./ed448goldilock-browser.js'); + /* Browser Crypto Shims */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.randomBytes = exports.pbkdf2Sync = exports.createHmac = exports.createHash = exports.Ed448Goldilock = exports.ed448 = void 0; -const tslib_1 = require("tslib"); -const hmac_1 = require("@noble/hashes/hmac"); -const pbkdf2_1 = require("@noble/hashes/pbkdf2"); -const sha256_1 = require("@noble/hashes/sha256"); -const sha512_1 = require("@noble/hashes/sha512"); -const sha3_1 = require("@noble/hashes/sha3"); -const browser_ed448_js_1 = tslib_1.__importDefault(require("./browser-ed448.js")); -exports.ed448 = browser_ed448_js_1.default; -const index_js_1 = require("../utils/index.js"); -var ed448goldilock_browser_js_1 = require("./ed448goldilock-browser.js"); -Object.defineProperty(exports, "Ed448Goldilock", { enumerable: true, get: function () { return ed448goldilock_browser_js_1.Ed448Goldilock; } }); function getGlobal() { + if (typeof globalThis !== "undefined") + return globalThis; if (typeof self !== "undefined") { return self; } @@ -29,38 +35,43 @@ const anyGlobal = getGlobal(); const crypto = anyGlobal.crypto || anyGlobal.msCrypto; function createHash(algo) { switch (algo) { + case "ripemd160": + return legacy_js.ripemd160.create(); case "sha256": - return sha256_1.sha256.create(); + return sha2_js.sha256.create(); case "sha512": - return sha512_1.sha512.create(); + return sha2_js.sha512.create(); case "sha3-256": - return sha3_1.sha3_256.create(); + return sha3_js.sha3_256.create(); case "sha3-512": - return sha3_1.sha3_512.create(); + return sha3_js.sha3_512.create(); } - (0, index_js_1.assertArgument)(false, "invalid hashing algorithm name", "algorithm", algo); + errors.assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); } -exports.createHash = createHash; function createHmac(_algo, key) { - const algo = { sha256: sha256_1.sha256, sha512: sha512_1.sha512 }[_algo]; - (0, index_js_1.assertArgument)(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac_1.hmac.create(algo, key); + const algo = { sha256: sha2_js.sha256, sha512: sha2_js.sha512, "sha3-256": sha3_js.sha3_256, "sha3-512": sha3_js.sha3_512 }[_algo]; + errors.assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); + return hmac_js.hmac.create(algo, key); } -exports.createHmac = createHmac; function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = { sha256: sha256_1.sha256, sha512: sha512_1.sha512 }[_algo]; - (0, index_js_1.assertArgument)(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return (0, pbkdf2_1.pbkdf2)(algo, password, salt, { c: iterations, dkLen: keylen }); + const algo = { sha256: sha2_js.sha256, sha512: sha2_js.sha512 }[_algo]; + errors.assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); + return pbkdf2_js.pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen }); } -exports.pbkdf2Sync = pbkdf2Sync; function randomBytes(length) { - (0, index_js_1.assert)(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { + errors.assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { operation: "randomBytes", }); - (0, index_js_1.assertArgument)(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); + errors.assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); const result = new Uint8Array(length); crypto.getRandomValues(result); return result; } + +exports.ed448 = browserEd448.default; +exports.Ed448Goldilock = ed448goldilockBrowser.Ed448Goldilock; +exports.createHash = createHash; +exports.createHmac = createHmac; +exports.pbkdf2Sync = pbkdf2Sync; exports.randomBytes = randomBytes; -//# sourceMappingURL=crypto-browser.js.map \ No newline at end of file +//# sourceMappingURL=crypto-browser.js.map diff --git a/lib.commonjs/crypto/crypto-browser.js.map b/lib.commonjs/crypto/crypto-browser.js.map index aff74ccd0..6fbce7686 100644 --- a/lib.commonjs/crypto/crypto-browser.js.map +++ b/lib.commonjs/crypto/crypto-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"crypto-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;;AAE1B,6CAA0C;AAC1C,iDAA8C;AAC9C,iDAA8C;AAC9C,iDAA8C;AAC9C,6CAAwD;AACxD,kFAAuC;AAG9B,gBAHF,0BAAK,CAGE;AAFd,gDAA2D;AAG3D,yEAA6D;AAApD,2HAAA,cAAc,OAAA;AAUvB,SAAS,SAAS;IAChB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AAC9B,MAAM,MAAM,GAAQ,SAAS,CAAC,MAAM,IAAI,SAAS,CAAC,QAAQ,CAAC;AAO3D,SAAgB,UAAU,CAAC,IAAY;IACrC,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ;YACX,OAAO,eAAM,CAAC,MAAM,EAAE,CAAC;QACzB,KAAK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,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,EACxD,gBAAgB,EAChB,QAAQ,EACR,MAAM,CACP,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAChB,CAAC;AApBD,kCAoBC"} \ No newline at end of file +{"version":3,"file":"crypto-browser.js","sources":["../../lib.esm/crypto/crypto-browser.js"],"sourcesContent":["/* Browser Crypto Shims */\nimport { ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"ripemd160\":\n return ripemd160.create();\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512, \"sha3-256\": sha3_256, \"sha3-512\": sha3_512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map"],"names":["ripemd160","sha256","sha512","sha3_256","sha3_512","assertArgument","hmac","pbkdf2","assert"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAWA,SAAS,SAAS,GAAG;AACrB,IAAI,IAAI,OAAO,UAAU,KAAK,WAAW;AACzC,QAAQ,OAAO,UAAU;AACzB,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AACrC,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;AACrD;AACA,MAAM,SAAS,GAAG,SAAS,EAAE;AAC7B,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,IAAI,SAAS,CAAC,QAAQ;AAC9C,SAAS,UAAU,CAAC,IAAI,EAAE;AACjC,IAAI,QAAQ,IAAI;AAChB,QAAQ,KAAK,WAAW;AACxB,YAAY,OAAOA,mBAAS,CAAC,MAAM,EAAE;AACrC,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAOC,cA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IH,qBAAc,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC;AAChH,IAAI,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC;AACzC,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC;AAClC,IAAI,OAAO,MAAM;AACjB;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto.d.ts b/lib.commonjs/crypto/crypto.d.ts index 56e369d6c..67011fd36 100644 --- a/lib.commonjs/crypto/crypto.d.ts +++ b/lib.commonjs/crypto/crypto.d.ts @@ -1,3 +1,4 @@ +/// import ed448 from "./ed448.js"; export { ed448 }; export { Ed448Goldilock } from "./ed448goldilock.js"; diff --git a/lib.commonjs/crypto/crypto.d.ts.map b/lib.commonjs/crypto/crypto.d.ts.map index a472d84a5..551ce5172 100644 --- a/lib.commonjs/crypto/crypto.d.ts.map +++ b/lib.commonjs/crypto/crypto.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file +{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto.js b/lib.commonjs/crypto/crypto.js index a87aabdf0..9cac1a015 100644 --- a/lib.commonjs/crypto/crypto.js +++ b/lib.commonjs/crypto/crypto.js @@ -1,14 +1,27 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.randomBytes = exports.pbkdf2Sync = exports.createHmac = exports.createHash = exports.Ed448Goldilock = exports.ed448 = void 0; -const tslib_1 = require("tslib"); -const ed448_js_1 = tslib_1.__importDefault(require("./ed448.js")); -exports.ed448 = ed448_js_1.default; -var ed448goldilock_js_1 = require("./ed448goldilock.js"); -Object.defineProperty(exports, "Ed448Goldilock", { enumerable: true, get: function () { return ed448goldilock_js_1.Ed448Goldilock; } }); -var crypto_1 = require("crypto"); -Object.defineProperty(exports, "createHash", { enumerable: true, get: function () { return crypto_1.createHash; } }); -Object.defineProperty(exports, "createHmac", { enumerable: true, get: function () { return crypto_1.createHmac; } }); -Object.defineProperty(exports, "pbkdf2Sync", { enumerable: true, get: function () { return crypto_1.pbkdf2Sync; } }); -Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return crypto_1.randomBytes; } }); -//# sourceMappingURL=crypto.js.map \ No newline at end of file +'use strict'; + +var ed448 = require('./ed448.js'); +var ed448goldilock = require('./ed448goldilock.js'); +var crypto = require('crypto'); + + + +exports.ed448 = ed448.default; +exports.Ed448Goldilock = ed448goldilock.Ed448Goldilock; +Object.defineProperty(exports, "createHash", { + enumerable: true, + get: function () { return crypto.createHash; } +}); +Object.defineProperty(exports, "createHmac", { + enumerable: true, + get: function () { return crypto.createHmac; } +}); +Object.defineProperty(exports, "pbkdf2Sync", { + enumerable: true, + get: function () { return crypto.pbkdf2Sync; } +}); +Object.defineProperty(exports, "randomBytes", { + enumerable: true, + get: function () { return crypto.randomBytes; } +}); +//# sourceMappingURL=crypto.js.map diff --git a/lib.commonjs/crypto/crypto.js.map b/lib.commonjs/crypto/crypto.js.map index 9c6cefb24..a098d9444 100644 --- a/lib.commonjs/crypto/crypto.js.map +++ b/lib.commonjs/crypto/crypto.js.map @@ -1 +1 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AACtB,gBADF,kBAAK,CACE;AACd,yDAAqD;AAA5C,mHAAA,cAAc,OAAA;AAEvB,iCAAyE;AAAhE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,oGAAA,UAAU,OAAA;AAAE,qGAAA,WAAW,OAAA"} \ No newline at end of file +{"version":3,"file":"crypto.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448-types.d.ts b/lib.commonjs/crypto/ed448-types.d.ts new file mode 100644 index 000000000..705f54df5 --- /dev/null +++ b/lib.commonjs/crypto/ed448-types.d.ts @@ -0,0 +1,15 @@ +import type { Buffer } from "buffer"; +/** Buffer-based bcrypto Ed448 operations used by Core signing. */ +export interface Ed448Backend { + privateKeyGenerate(): Buffer; + publicKeyCreate(key: Buffer): Buffer; + publicKeyFromScalar(scalar: Buffer): Buffer; + publicKeyVerify(key: Buffer): boolean; + publicKeyCombine(keys: Buffer[]): Buffer; + sign(message: Buffer, key: Buffer): Buffer; + signWithScalar(message: Buffer, scalar: Buffer, prefix: Buffer): Buffer; + verify(message: Buffer, signature: Buffer, publicKey: Buffer): boolean; + derive(publicKey: Buffer, key: Buffer): Buffer; + deriveWithScalar(publicKey: Buffer, scalar: Buffer): Buffer; +} +//# sourceMappingURL=ed448-types.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448-types.d.ts.map b/lib.commonjs/crypto/ed448-types.d.ts.map new file mode 100644 index 000000000..209f88584 --- /dev/null +++ b/lib.commonjs/crypto/ed448-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ed448-types.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC5B,kBAAkB,IAAI,MAAM,CAAC;IAC7B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5D"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448-types.js b/lib.commonjs/crypto/ed448-types.js new file mode 100644 index 000000000..d036b4192 --- /dev/null +++ b/lib.commonjs/crypto/ed448-types.js @@ -0,0 +1,3 @@ +'use strict'; + +//# sourceMappingURL=ed448-types.js.map diff --git a/lib.commonjs/crypto/ed448-types.js.map b/lib.commonjs/crypto/ed448-types.js.map new file mode 100644 index 000000000..387505732 --- /dev/null +++ b/lib.commonjs/crypto/ed448-types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ed448-types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448.d.ts b/lib.commonjs/crypto/ed448.d.ts index 5dfe597f9..fd3e5a866 100644 --- a/lib.commonjs/crypto/ed448.d.ts +++ b/lib.commonjs/crypto/ed448.d.ts @@ -1,3 +1,4 @@ -import ed448 from "bcrypto/lib/ed448.js"; +import type { Ed448Backend } from "./ed448-types.js"; +declare const ed448: Ed448Backend; export default ed448; //# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448.d.ts.map b/lib.commonjs/crypto/ed448.d.ts.map index 19085a96e..7ea835437 100644 --- a/lib.commonjs/crypto/ed448.d.ts.map +++ b/lib.commonjs/crypto/ed448.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,sBAAsB,CAAC;AAEzC,eAAe,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448.js b/lib.commonjs/crypto/ed448.js index 3f0eeead6..13ed9d94f 100644 --- a/lib.commonjs/crypto/ed448.js +++ b/lib.commonjs/crypto/ed448.js @@ -1,7 +1,12 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var backend = require('bcrypto/lib/ed448.js'); + +// bcrypto does not ship TypeScript declarations. // @ts-ignore -const ed448_js_1 = tslib_1.__importDefault(require("bcrypto/lib/ed448.js")); -exports.default = ed448_js_1.default; -//# sourceMappingURL=ed448.js.map \ No newline at end of file +const ed448 = backend; + +exports.default = ed448; +//# sourceMappingURL=ed448.js.map diff --git a/lib.commonjs/crypto/ed448.js.map b/lib.commonjs/crypto/ed448.js.map index 54ebb326a..83df9098a 100644 --- a/lib.commonjs/crypto/ed448.js.map +++ b/lib.commonjs/crypto/ed448.js.map @@ -1 +1 @@ -{"version":3,"file":"ed448.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,aAAa;AACb,4EAAyC;AAEzC,kBAAe,kBAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"ed448.js","sources":["../../lib.esm/crypto/ed448.js"],"sourcesContent":["// bcrypto does not ship TypeScript declarations.\n// @ts-ignore\nimport backend from \"bcrypto/lib/ed448.js\";\nconst ed448 = backend;\nexport default ed448;\n//# sourceMappingURL=ed448.js.map"],"names":[],"mappings":";;;;;;AAAA;AACA;AAEK,MAAC,KAAK,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock-browser.d.ts b/lib.commonjs/crypto/ed448goldilock-browser.d.ts index 675f772fa..58df73a6f 100644 --- a/lib.commonjs/crypto/ed448goldilock-browser.d.ts +++ b/lib.commonjs/crypto/ed448goldilock-browser.d.ts @@ -1,6 +1,7 @@ +import { Buffer } from "buffer"; export declare class Ed448Goldilock { - static _channel: any; - static generatePrivateKey(): any; + static _channel: import("./ed448-types.js").Ed448Backend; + static generatePrivateKey(): Buffer; static getPublicKeyFromPrivateKey(privateKey: string): string; static signWithPrivateKey(privateKey: string, msg: string): string; static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; diff --git a/lib.commonjs/crypto/ed448goldilock-browser.d.ts.map b/lib.commonjs/crypto/ed448goldilock-browser.d.ts.map index 754f2764a..976a9855d 100644 --- a/lib.commonjs/crypto/ed448goldilock-browser.d.ts.map +++ b/lib.commonjs/crypto/ed448goldilock-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAOA,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,MAAS;IAExB,MAAM,CAAC,kBAAkB;IAMzB,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAc7D,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAqBlE,MAAM,CAAC,+BAA+B,CACpC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,MAAM;IAMT,MAAM,CAAC,eAAe,CACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO;IAIV,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAQzD,MAAM,CAAC,iBAAiB,CACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,MAAM;IAaT,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAc9C,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAiBlD,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAgBrD,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CASxE"} \ No newline at end of file +{"version":3,"file":"ed448goldilock-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock-browser.js b/lib.commonjs/crypto/ed448goldilock-browser.js index 9dc555f30..f8e8e7229 100644 --- a/lib.commonjs/crypto/ed448goldilock-browser.js +++ b/lib.commonjs/crypto/ed448goldilock-browser.js @@ -1,37 +1,34 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Ed448Goldilock = void 0; -const tslib_1 = require("tslib"); -// @ts-ignore -const browser_ed448_js_1 = tslib_1.__importDefault(require("./browser-ed448.js")); -// @ts-ignore -const pbkdf2_browser_js_1 = tslib_1.__importDefault(require("./pbkdf2-browser.js")); -// @ts-ignore -const sha3_512_js_1 = tslib_1.__importDefault(require("bcrypto/lib/sha3-512.js")); +'use strict'; + +var buffer = require('buffer'); +var browserEd448 = require('./browser-ed448.js'); +var pbkdf2 = require('bcrypto/lib/pbkdf2-browser.js'); +var SHA3_512 = require('bcrypto/lib/sha3-512.js'); + class Ed448Goldilock { - static _channel = browser_ed448_js_1.default; + static _channel = browserEd448.default; static generatePrivateKey() { - var privateKey = browser_ed448_js_1.default.privateKeyGenerate(); + var privateKey = browserEd448.default.privateKeyGenerate(); privateKey[56] &= 0x7f; return privateKey; } static getPublicKeyFromPrivateKey(privateKey) { - var secret = Buffer.from(privateKey, "hex"); + var secret = buffer.Buffer.from(privateKey, "hex"); if (secret[56] > 127) { var scalar = secret.slice(0, 56); scalar[0] &= 0xfc; scalar[55] |= 0x80; var publicKey = this._channel.publicKeyFromScalar(scalar); - return Buffer.from(publicKey).toString("hex"); + return buffer.Buffer.from(publicKey).toString("hex"); } else { var publicKey = this._channel.publicKeyCreate(secret); - return Buffer.from(publicKey).toString("hex"); + return buffer.Buffer.from(publicKey).toString("hex"); } } static signWithPrivateKey(privateKey, msg) { - var msgToSign = Buffer.from(msg, "hex"); - var secret = Buffer.from(privateKey, "hex"); + var msgToSign = buffer.Buffer.from(msg, "hex"); + var secret = buffer.Buffer.from(privateKey, "hex"); if (secret[56] > 127) { var prefix = secret.slice(0, 57); prefix[0] &= 0xfc; @@ -39,11 +36,11 @@ class Ed448Goldilock { prefix[55] |= 0x80; var scalar = prefix.slice(0, 56); var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return Buffer.from(signedMessage).toString("hex"); + return buffer.Buffer.from(signedMessage).toString("hex"); } else { var signedMessage = this._channel.sign(msgToSign, secret); - return Buffer.from(signedMessage).toString("hex"); + return buffer.Buffer.from(signedMessage).toString("hex"); } } static signWithPrivateKeyNConcatPubkey(privateKey, msg) { @@ -52,16 +49,16 @@ class Ed448Goldilock { return signedMessage + publicKey; } static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(msgHash, signedMsg, pubKey); + return this._channel.verify(buffer.Buffer.from(msgHash, "hex"), buffer.Buffer.from(signedMsg, "hex"), buffer.Buffer.from(pubKey, "hex")); } static SHA512Hash(password, salt) { - var p1 = Buffer.from(password, "hex"); - var s1 = Buffer.from(salt, "hex"); - return Buffer.from(pbkdf2_browser_js_1.default.derive(sha3_512_js_1.default, p1, s1, 2048, 57)).toString("hex"); + var p1 = buffer.Buffer.from(password, "hex"); + var s1 = buffer.Buffer.from(salt, "hex"); + return buffer.Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); } static concatenateAndHex(prefix, key, index, salt) { - var ind = Buffer.alloc(4); - var p = Buffer.alloc(1); + var ind = buffer.Buffer.alloc(4); + var p = buffer.Buffer.alloc(1); p[0] = prefix % 256; var j = index; for (let i = 0; i < 4; i++) { @@ -72,10 +69,10 @@ class Ed448Goldilock { return Ed448Goldilock.SHA512Hash(t, salt); } static addScalar(a, b) { - var a1 = Buffer.from(a, "hex"); - var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); + var a1 = buffer.Buffer.from(a, "hex"); + var b1 = buffer.Buffer.from(b.substr(0, 106) + "00000000", "hex"); b1[0] &= 0xfc; - var c = Buffer.alloc(57); + var c = buffer.Buffer.alloc(57); var hold = 0; for (let i = 0; i < 57; i++) { hold += a1[i] + b1[i]; @@ -87,7 +84,7 @@ class Ed448Goldilock { static seedToExtendedPrivate(seed) { var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = Buffer.from(s2, "hex"); + var b = buffer.Buffer.from(s2, "hex"); b[56] |= 0x80; b[55] |= 0x80; b[55] &= 0xbf; @@ -120,5 +117,6 @@ class Ed448Goldilock { return k5.substr(114, 228); } } + exports.Ed448Goldilock = Ed448Goldilock; -//# sourceMappingURL=ed448goldilock-browser.js.map \ No newline at end of file +//# sourceMappingURL=ed448goldilock-browser.js.map diff --git a/lib.commonjs/crypto/ed448goldilock-browser.js.map b/lib.commonjs/crypto/ed448goldilock-browser.js.map index 588973450..0e87b2453 100644 --- a/lib.commonjs/crypto/ed448goldilock-browser.js.map +++ b/lib.commonjs/crypto/ed448goldilock-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":";;;;AAAA,aAAa;AACb,kFAAuC;AACvC,aAAa;AACb,oFAAyC;AACzC,aAAa;AACb,kFAA+C;AAE/C,MAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,GAAG,0BAAK,CAAC;IAExB,MAAM,CAAC,kBAAkB;QACvB,IAAI,UAAU,GAAG,0BAAK,CAAC,kBAAkB,EAAE,CAAC;QAC5C,UAAU,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QACvB,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAkB;QAClD,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE;YACpB,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;YAClB,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;YACnB,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAC1D,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAA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9C;IACH,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAY,EAAE,KAAa;QAC5D,IAAI,CAAC,GAAG,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,EAAE,UAAU,GAAG,EAAE,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,CAAC;QACpE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7B,CAAC;;AA9IH,wCA+IC"} \ No newline at end of file +{"version":3,"file":"ed448goldilock-browser.js","sources":["../../lib.esm/crypto/ed448goldilock-browser.js"],"sourcesContent":["import { Buffer } from \"buffer\";\n// @ts-ignore\nimport ed448 from \"./browser-ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"./pbkdf2-browser.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(Buffer.from(msgHash, \"hex\"), Buffer.from(signedMsg, \"hex\"), Buffer.from(pubKey, \"hex\"));\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock-browser.js.map"],"names":["ed448","Buffer"],"mappings":";;;;;;;AAOO,MAAM,cAAc,CAAC;AAC5B,IAAI,OAAO,QAAQ,GAAGA,oBAAK;AAC3B,IAAI,OAAO,kBAAkB,GAAG;AAChC,QAAQ,IAAI,UAAU,GAAGA,o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AAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC;AAC3E,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC;AACzE,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC;AACzE,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC;AAChE,QAAQ,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock.d.ts b/lib.commonjs/crypto/ed448goldilock.d.ts index 737cae0a1..3dff60994 100644 --- a/lib.commonjs/crypto/ed448goldilock.d.ts +++ b/lib.commonjs/crypto/ed448goldilock.d.ts @@ -1,6 +1,7 @@ +import { Buffer } from "buffer"; export declare class Ed448Goldilock { - static _channel: any; - static generatePrivateKey(): any; + static _channel: import("./ed448-types.js").Ed448Backend; + static generatePrivateKey(): Buffer; static getPublicKeyFromPrivateKey(privateKey: string): string; static signWithPrivateKey(privateKey: string, msg: string): string; static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; diff --git a/lib.commonjs/crypto/ed448goldilock.d.ts.map b/lib.commonjs/crypto/ed448goldilock.d.ts.map index 34092c2fe..7cd4dfaca 100644 --- a/lib.commonjs/crypto/ed448goldilock.d.ts.map +++ b/lib.commonjs/crypto/ed448goldilock.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":"AAOA,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,MAAS;IAExB,MAAM,CAAC,kBAAkB;IAMzB,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAA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AED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock.js b/lib.commonjs/crypto/ed448goldilock.js index c3c7be47c..895d79902 100644 --- a/lib.commonjs/crypto/ed448goldilock.js +++ b/lib.commonjs/crypto/ed448goldilock.js @@ -1,37 +1,34 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Ed448Goldilock = void 0; -const tslib_1 = require("tslib"); -// @ts-ignore -const ed448_js_1 = tslib_1.__importDefault(require("bcrypto/lib/ed448.js")); -// @ts-ignore -const pbkdf2_js_1 = tslib_1.__importDefault(require("bcrypto/lib/pbkdf2.js")); -// @ts-ignore -const sha3_512_js_1 = tslib_1.__importDefault(require("bcrypto/lib/sha3-512.js")); +'use strict'; + +var buffer = require('buffer'); +var ed448 = require('./ed448.js'); +var pbkdf2 = require('bcrypto/lib/pbkdf2.js'); +var SHA3_512 = require('bcrypto/lib/sha3-512.js'); + class Ed448Goldilock { - static _channel = ed448_js_1.default; + static _channel = ed448.default; static generatePrivateKey() { - var privateKey = ed448_js_1.default.privateKeyGenerate(); + var privateKey = ed448.default.privateKeyGenerate(); privateKey[56] &= 0x7f; return privateKey; } static getPublicKeyFromPrivateKey(privateKey) { - var secret = Buffer.from(privateKey, "hex"); + var secret = buffer.Buffer.from(privateKey, "hex"); if (secret[56] > 127) { var scalar = secret.slice(0, 56); scalar[0] &= 0xfc; scalar[55] |= 0x80; var publicKey = this._channel.publicKeyFromScalar(scalar); - return Buffer.from(publicKey).toString("hex"); + return buffer.Buffer.from(publicKey).toString("hex"); } else { var publicKey = this._channel.publicKeyCreate(secret); - return Buffer.from(publicKey).toString("hex"); + return buffer.Buffer.from(publicKey).toString("hex"); } } static signWithPrivateKey(privateKey, msg) { - var msgToSign = Buffer.from(msg, "hex"); - var secret = Buffer.from(privateKey, "hex"); + var msgToSign = buffer.Buffer.from(msg, "hex"); + var secret = buffer.Buffer.from(privateKey, "hex"); if (secret[56] > 127) { var prefix = secret.slice(0, 57); prefix[0] &= 0xfc; @@ -39,11 +36,11 @@ class Ed448Goldilock { prefix[55] |= 0x80; var scalar = prefix.slice(0, 56); var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return Buffer.from(signedMessage).toString("hex"); + return buffer.Buffer.from(signedMessage).toString("hex"); } else { var signedMessage = this._channel.sign(msgToSign, secret); - return Buffer.from(signedMessage).toString("hex"); + return buffer.Buffer.from(signedMessage).toString("hex"); } } static signWithPrivateKeyNConcatPubkey(privateKey, msg) { @@ -52,16 +49,16 @@ class Ed448Goldilock { return signedMessage + publicKey; } static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(msgHash, signedMsg, pubKey); + return this._channel.verify(buffer.Buffer.from(msgHash, "hex"), buffer.Buffer.from(signedMsg, "hex"), buffer.Buffer.from(pubKey, "hex")); } static SHA512Hash(password, salt) { - var p1 = Buffer.from(password, "hex"); - var s1 = Buffer.from(salt, "hex"); - return Buffer.from(pbkdf2_js_1.default.derive(sha3_512_js_1.default, p1, s1, 2048, 57)).toString("hex"); + var p1 = buffer.Buffer.from(password, "hex"); + var s1 = buffer.Buffer.from(salt, "hex"); + return buffer.Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); } static concatenateAndHex(prefix, key, index, salt) { - var ind = Buffer.alloc(4); - var p = Buffer.alloc(1); + var ind = buffer.Buffer.alloc(4); + var p = buffer.Buffer.alloc(1); p[0] = prefix % 256; var j = index; for (let i = 0; i < 4; i++) { @@ -72,10 +69,10 @@ class Ed448Goldilock { return Ed448Goldilock.SHA512Hash(t, salt); } static addScalar(a, b) { - var a1 = Buffer.from(a, "hex"); - var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); + var a1 = buffer.Buffer.from(a, "hex"); + var b1 = buffer.Buffer.from(b.substr(0, 106) + "00000000", "hex"); b1[0] &= 0xfc; - var c = Buffer.alloc(57); + var c = buffer.Buffer.alloc(57); var hold = 0; for (let i = 0; i < 57; i++) { hold += a1[i] + b1[i]; @@ -87,7 +84,7 @@ class Ed448Goldilock { static seedToExtendedPrivate(seed) { var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = Buffer.from(s2, "hex"); + var b = buffer.Buffer.from(s2, "hex"); b[56] |= 0x80; b[55] |= 0x80; b[55] &= 0xbf; @@ -120,5 +117,6 @@ class Ed448Goldilock { return k5.substr(114, 228); } } + exports.Ed448Goldilock = Ed448Goldilock; -//# sourceMappingURL=ed448goldilock.js.map \ No newline at end of file +//# sourceMappingURL=ed448goldilock.js.map diff --git a/lib.commonjs/crypto/ed448goldilock.js.map b/lib.commonjs/crypto/ed448goldilock.js.map index 37cd1f147..76a3dc398 100644 --- a/lib.commonjs/crypto/ed448goldilock.js.map +++ b/lib.commonjs/crypto/ed448goldilock.js.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":";;;;AAAA,aAAa;AACb,4EAAyC;AACzC,aAAa;AACb,8EAA2C;AAC3C,aAAa;AACb,kFAA+C;AAE/C,MAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,GAAG,kBAAK,CAAC;IAExB,MAAM,CAAC,kBAAkB;QACvB,IAAI,UAAU,GAAG,kBAAK,CAAC,kBAAkB,EAAE,CAAC;QAC5C,UAAU,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QACvB,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAkB;QAClD,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE;YACpB,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;YAClB,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;YACnB,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAC1D,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC/C;aAAM;YACL,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YACtD,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC/C;IACH,CAAC;IAED,MAAM,CAAC,kBAAkB,CA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CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,CAAC;QACpE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7B,CAAC;;AA9IH,wCA+IC"} \ No newline at end of file +{"version":3,"file":"ed448goldilock.js","sources":["../../lib.esm/crypto/ed448goldilock.js"],"sourcesContent":["import { Buffer } from \"buffer\";\n// @ts-ignore\nimport ed448 from \"./ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"bcrypto/lib/pbkdf2.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(Buffer.from(msgHash, \"hex\"), Buffer.from(signedMsg, \"hex\"), Buffer.from(pubKey, \"hex\"));\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock.js.map"],"names":["ed448","Buffer"],"mappings":";;;;;;;AAOO,MAAM,cAAc,CAAC;AAC5B,IAAI,OAAO,QAAQ,GAAGA,aAAK;AAC3B,IAAI,OAAO,kBAAkB,GAAG;AAChC,QAAQ,IAAI,UAAU,GAAGA,aAAK,CAAC,kBAAkB,EAAE;AACnD,QAAQ,UAAU,CAAC,EAAE,CAAC,IAAI,IAAI;AAC9B,QAAQ,OAAO,UAAU;AACzB,IAAI;AACJ,IAAI,OAAO,0BAA0B,CAAC,UAAU,EAAE;AAClD,QAAQ,IAAI,MAAM,GAAGC,aAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;AACnD,QAAQ,IAAI,MAAM,CA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,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC;AAChE,QAAQ,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/hmac.d.ts b/lib.commonjs/crypto/hmac.d.ts index 4c5e3227d..902055c49 100644 --- a/lib.commonjs/crypto/hmac.d.ts +++ b/lib.commonjs/crypto/hmac.d.ts @@ -1,4 +1,5 @@ import type { BytesLike } from "../utils/index.js"; +declare const _computeHmac: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; /** * Return the HMAC for %%data%% using the %%key%% key with the underlying * %%algo%% used for compression. @@ -18,8 +19,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string; export declare namespace computeHmac { - var _: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; - var lock: () => void; - var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; + export { _computeHmac as _ }; + export var lock: () => void; + export var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/hmac.d.ts.map b/lib.commonjs/crypto/hmac.d.ts.map index 49d9b637c..b5c8a51d9 100644 --- a/lib.commonjs/crypto/hmac.d.ts.map +++ b/lib.commonjs/crypto/hmac.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,GACf,MAAM,CAIR;yBARe,WAAW"} \ No newline at end of file +{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,YAAY,cACN,QAAQ,GAAG,QAAQ,OACzB,UAAU,QACT,UAAU,KACd,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAC1B,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,GACd,MAAM,CAIR;yBARe,WAAW;aASX,YAAY;;gCAKrB,CACL,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,UAAU,KACZ,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/hmac.js b/lib.commonjs/crypto/hmac.js index 6cd179766..1a78b028a 100644 --- a/lib.commonjs/crypto/hmac.js +++ b/lib.commonjs/crypto/hmac.js @@ -1,6 +1,20 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.computeHmac = void 0; +'use strict'; + +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +var crypto = require('crypto'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + /** * An **HMAC** enables verification that a given key was used * to authenticate a payload. @@ -9,11 +23,9 @@ exports.computeHmac = void 0; * * @_subsection: api/crypto:HMAC [about-hmac] */ -const crypto_js_1 = require("./crypto.js"); -const index_js_1 = require("../utils/index.js"); let locked = false; const _computeHmac = function (algorithm, key, data) { - return (0, crypto_js_1.createHmac)(algorithm, key).update(data).digest(); + return crypto.createHmac(algorithm, key).update(data).digest(); }; let __computeHmac = _computeHmac; /** @@ -34,11 +46,10 @@ let __computeHmac = _computeHmac; * */ function computeHmac(algorithm, _key, _data) { - const key = (0, index_js_1.getBytes)(_key, "key"); - const data = (0, index_js_1.getBytes)(_data, "data"); - return (0, index_js_1.hexlify)(__computeHmac(algorithm, key, data)); + const key = data.getBytes(_key, "key"); + const data$1 = data.getBytes(_data, "data"); + return data.hexlify(__computeHmac(algorithm, key, data$1)); } -exports.computeHmac = computeHmac; computeHmac._ = _computeHmac; computeHmac.lock = function () { locked = true; @@ -50,4 +61,6 @@ computeHmac.register = function (func) { __computeHmac = func; }; Object.freeze(computeHmac); -//# sourceMappingURL=hmac.js.map \ No newline at end of file + +exports.computeHmac = computeHmac; +//# sourceMappingURL=hmac.js.map diff --git a/lib.commonjs/crypto/hmac.js.map b/lib.commonjs/crypto/hmac.js.map index 4c2a90a61..f426aca63 100644 --- a/lib.commonjs/crypto/hmac.js.map +++ b/lib.commonjs/crypto/hmac.js.map @@ -1 +1 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,2CAAyC;AACzC,gDAAsD;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UACnB,SAA8B,EAC9B,GAAe,EACf,IAAgB;IAEhB,OAAO,IAAA,sBAAU,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC1D,CAAC,CAAC;AAEF,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,WAAW,CACzB,SAA8B,EAC9B,IAAe,EACf,KAAgB;IAEhB,MAAM,GAAG,GAAG,IAAA,mBAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AARD,kCAQC;AACD,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAG;IACjB,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC,CAAC;AACF,WAAW,CAAC,QAAQ,GAAG,UACrB,IAIc;IAEd,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAC1C;IACD,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"hmac.js","sources":["../../lib.esm/crypto/hmac.js"],"sourcesContent":["/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () {\n locked = true;\n};\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map"],"names":["createHmac","getBytes","data","hexlify"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,YAAY,GAAG,UAAU,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE;AACrD,IAAI,OAAOA,iBAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE;AAC3D,CAAC;AACD,IAAI,aAAa,GAAG,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE;AACpD,IAAI,MAAM,GAAG,GAAGC,aAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;AACrC,IAAI,MAAMC,MAAI,GAAGD,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,OAAOE,YAAO,CAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAED,MAAI,CAAC,CAAC;AACvD;AACA,WAAW,CAAC,CAAC,GAAG,YAAY;AAC5B,WAAW,CAAC,IAAI,GAAG,YAAY;AAC/B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,WAAW,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACvC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC;AAChD,IAAI;AACJ,IAAI,aAAa,GAAG,IAAI;AACxB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/index.d.ts.map b/lib.commonjs/crypto/index.d.ts.map index 153bb6fd7..76d2d37f8 100644 --- a/lib.commonjs/crypto/index.d.ts.map +++ b/lib.commonjs/crypto/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,iBAAS,IAAI,IAAI,IAAI,CAUpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,iBAAS,IAAI,IAAI,IAAI,CAUpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/crypto/index.js b/lib.commonjs/crypto/index.js index e3bff558b..281f2f81f 100644 --- a/lib.commonjs/crypto/index.js +++ b/lib.commonjs/crypto/index.js @@ -1,46 +1,47 @@ -"use strict"; +'use strict'; + +var hmac = require('./hmac.js'); +var ripemd160 = require('./ripemd160.js'); +var pbkdf2 = require('./pbkdf2.js'); +var random = require('./random.js'); +var scrypt = require('./scrypt.js'); +var sha3 = require('./sha3.js'); +require('bcrypto/lib/ed448.js'); +var ed448goldilock = require('./ed448goldilock.js'); +require('crypto'); +var keccak = require('./keccak.js'); +var signingKey = require('./signing-key.js'); +var signature = require('./signature.js'); + /** * A fundamental building block of Core is the underlying * cryptographic primitives. * * @_section: api/crypto:Cryptographic Functions [about-crypto] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.lock = exports.Signature = exports.SigningKey = exports.Ed448Goldilock = exports.keccak256 = exports.scryptSync = exports.scrypt = exports.pbkdf2 = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.randomBytes = exports.computeHmac = void 0; -null; -// We import all these so we can export lock() -const hmac_js_1 = require("./hmac.js"); -Object.defineProperty(exports, "computeHmac", { enumerable: true, get: function () { return hmac_js_1.computeHmac; } }); -const ripemd160_js_1 = require("./ripemd160.js"); -Object.defineProperty(exports, "ripemd160", { enumerable: true, get: function () { return ripemd160_js_1.ripemd160; } }); -const pbkdf2_js_1 = require("./pbkdf2.js"); -Object.defineProperty(exports, "pbkdf2", { enumerable: true, get: function () { return pbkdf2_js_1.pbkdf2; } }); -const random_js_1 = require("./random.js"); -Object.defineProperty(exports, "randomBytes", { enumerable: true, get: function () { return random_js_1.randomBytes; } }); -const scrypt_js_1 = require("./scrypt.js"); -Object.defineProperty(exports, "scrypt", { enumerable: true, get: function () { return scrypt_js_1.scrypt; } }); -Object.defineProperty(exports, "scryptSync", { enumerable: true, get: function () { return scrypt_js_1.scryptSync; } }); -const sha3_js_1 = require("./sha3.js"); -Object.defineProperty(exports, "sha256", { enumerable: true, get: function () { return sha3_js_1.sha256; } }); -Object.defineProperty(exports, "sha512", { enumerable: true, get: function () { return sha3_js_1.sha512; } }); -const crypto_js_1 = require("./crypto.js"); -Object.defineProperty(exports, "Ed448Goldilock", { enumerable: true, get: function () { return crypto_js_1.Ed448Goldilock; } }); -const keccak_js_1 = require("./keccak.js"); -Object.defineProperty(exports, "keccak256", { enumerable: true, get: function () { return keccak_js_1.keccak256; } }); -var signing_key_js_1 = require("./signing-key.js"); -Object.defineProperty(exports, "SigningKey", { enumerable: true, get: function () { return signing_key_js_1.SigningKey; } }); -var signature_js_1 = require("./signature.js"); -Object.defineProperty(exports, "Signature", { enumerable: true, get: function () { return signature_js_1.Signature; } }); function lock() { - hmac_js_1.computeHmac.lock(); - pbkdf2_js_1.pbkdf2.lock(); - random_js_1.randomBytes.lock(); - ripemd160_js_1.ripemd160.lock(); - scrypt_js_1.scrypt.lock(); - scrypt_js_1.scryptSync.lock(); - sha3_js_1.sha256.lock(); - sha3_js_1.sha512.lock(); - random_js_1.randomBytes.lock(); + hmac.computeHmac.lock(); + pbkdf2.pbkdf2.lock(); + random.randomBytes.lock(); + ripemd160.ripemd160.lock(); + scrypt.scrypt.lock(); + scrypt.scryptSync.lock(); + sha3.sha256.lock(); + sha3.sha512.lock(); + random.randomBytes.lock(); } + +exports.computeHmac = hmac.computeHmac; +exports.ripemd160 = ripemd160.ripemd160; +exports.pbkdf2 = pbkdf2.pbkdf2; +exports.randomBytes = random.randomBytes; +exports.scrypt = scrypt.scrypt; +exports.scryptSync = scrypt.scryptSync; +exports.sha256 = sha3.sha256; +exports.sha512 = sha3.sha512; +exports.Ed448Goldilock = ed448goldilock.Ed448Goldilock; +exports.keccak256 = keccak.keccak256; +exports.SigningKey = signingKey.SigningKey; +exports.Signature = signature.Signature; exports.lock = lock; -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/crypto/index.js.map b/lib.commonjs/crypto/index.js.map index 9007d9409..a0a1a2c5f 100644 --- a/lib.commonjs/crypto/index.js.map +++ b/lib.commonjs/crypto/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,IAAI,CAAC;AAEL,8CAA8C;AAC9C,uCAAwC;AAUtC,4FAVO,qBAAW,OAUP;AATb,iDAA2C;AAWzC,0FAXO,wBAAS,OAWP;AAVX,2CAAqC;AAanC,uFAbO,kBAAM,OAaP;AAZR,2CAA0C;AAQxC,4FARO,uBAAW,OAQP;AAPb,2CAAiD;AAY/C,uFAZO,kBAAM,OAYP;AACN,2FAbe,sBAAU,OAaf;AAZZ,uCAA2C;AAQzC,uFARO,gBAAM,OAQP;AACN,uFATe,gBAAM,OASf;AARR,2CAA6C;AAa3C,+FAbO,0BAAc,OAaP;AAZhB,2CAAwC;AAWtC,0FAXO,qBAAS,OAWP;AAIX,mDAA8C;AAArC,4GAAA,UAAU,OAAA;AACnB,+CAA2C;AAAlC,yGAAA,SAAS,OAAA;AAElB,SAAS,IAAI;IACX,qBAAW,CAAC,IAAI,EAAE,CAAC;IACnB,kBAAM,CAAC,IAAI,EAAE,CAAC;IACd,uBAAW,CAAC,IAAI,EAAE,CAAC;IACnB,wBAAS,CAAC,IAAI,EAAE,CAAC;IACjB,kBAAM,CAAC,IAAI,EAAE,CAAC;IACd,sBAAU,CAAC,IAAI,EAAE,CAAC;IAClB,gBAAM,CAAC,IAAI,EAAE,CAAC;IACd,gBAAM,CAAC,IAAI,EAAE,CAAC;IACd,uBAAW,CAAC,IAAI,EAAE,CAAC;AACrB,CAAC;AAEQ,oBAAI"} \ No newline at end of file +{"version":3,"file":"index.js","sources":["../../lib.esm/crypto/index.js"],"sourcesContent":["/**\n * A fundamental building block of Core is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha3.js\";\nimport { Ed448Goldilock } from \"./crypto.js\";\nimport { keccak256 } from \"./keccak.js\";\nexport { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\nfunction lock() {\n computeHmac.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map"],"names":["computeHmac","pbkdf2","randomBytes","ripemd160","scrypt","scryptSync","sha256","sha512"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAcA,SAAS,IAAI,GAAG;AAChB,IAAIA,gBAAW,CAAC,IAAI,EAAE;AACtB,IAAIC,aAAM,CAAC,IAAI,EAAE;AACjB,IAAIC,kBAAW,CAAC,IAAI,EAAE;AACtB,IAAIC,mBAAS,CAAC,IAAI,EAAE;AACpB,IAAIC,aAAM,CAAC,IAAI,EAAE;AACjB,IAAIC,iBAAU,CAAC,IAAI,EAAE;AACrB,IAAIC,WAAM,CAAC,IAAI,EAAE;AACjB,IAAIC,WAAM,CAAC,IAAI,EAAE;AACjB,IAAIL,kBAAW,CAAC,IAAI,EAAE;AACtB;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/keccak.d.ts b/lib.commonjs/crypto/keccak.d.ts index 533f46dc6..a2b3dd879 100644 --- a/lib.commonjs/crypto/keccak.d.ts +++ b/lib.commonjs/crypto/keccak.d.ts @@ -4,6 +4,7 @@ * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] */ import type { BytesLike } from "../utils/index.js"; +declare const _keccak256: (data: Uint8Array) => Uint8Array; /** * Compute the cryptographic KECCAK256 hash of %%data%%. * @@ -28,8 +29,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function keccak256(_data: BytesLike): string; export declare namespace keccak256 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _keccak256 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=keccak.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/keccak.d.ts.map b/lib.commonjs/crypto/keccak.d.ts.map index 2f0a88fb1..dfe4be3ef 100644 --- a/lib.commonjs/crypto/keccak.d.ts.map +++ b/lib.commonjs/crypto/keccak.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAUnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file +{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/keccak.js b/lib.commonjs/crypto/keccak.js index c0bb82ec9..c2ce1cb0c 100644 --- a/lib.commonjs/crypto/keccak.js +++ b/lib.commonjs/crypto/keccak.js @@ -1,16 +1,24 @@ -"use strict"; +'use strict'; + +var sha3_js = require('@noble/hashes/sha3.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + /** * Cryptographic hashing functions * * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.keccak256 = void 0; -const sha3_1 = require("@noble/hashes/sha3"); -const index_js_1 = require("../utils/index.js"); let locked = false; const _keccak256 = function (data) { - return (0, sha3_1.keccak_256)(data); + return sha3_js.keccak_256(data); }; let __keccak256 = _keccak256; /** @@ -36,10 +44,9 @@ let __keccak256 = _keccak256; * //_error: */ function keccak256(_data) { - const data = (0, index_js_1.getBytes)(_data, "data"); - return (0, index_js_1.hexlify)(__keccak256(data)); + const data$1 = data.getBytes(_data, "data"); + return data.hexlify(__keccak256(data$1)); } -exports.keccak256 = keccak256; keccak256._ = _keccak256; keccak256.lock = function () { locked = true; @@ -51,4 +58,6 @@ keccak256.register = function (func) { __keccak256 = func; }; Object.freeze(keccak256); -//# sourceMappingURL=keccak.js.map \ No newline at end of file + +exports.keccak256 = keccak256; +//# sourceMappingURL=keccak.js.map diff --git a/lib.commonjs/crypto/keccak.js.map b/lib.commonjs/crypto/keccak.js.map index 23a587fd7..32246deff 100644 --- a/lib.commonjs/crypto/keccak.js.map +++ b/lib.commonjs/crypto/keccak.js.map @@ -1 +1 @@ -{"version":3,"file":"keccak.js","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,6CAAgD;AAEhD,gDAAsD;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAU,IAAgB;IAC3C,OAAO,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,SAAS,CAAC,KAAgB;IACxC,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC;AAHD,8BAGC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG;IACf,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC,CAAC;AACF,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAqC;IAClE,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAC5C;IACD,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"keccak.js","sources":["../../lib.esm/crypto/keccak.js"],"sourcesContent":["/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map"],"names":["keccak_256","data","getBytes","hexlify"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAGA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,UAAU,GAAG,UAAU,IAAI,EAAE;AACnC,IAAI,OAAOA,kBAAU,CAAC,IAAI,CAAC;AAC3B,CAAC;AACD,IAAI,WAAW,GAAG,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,MAAMC,MAAI,GAAGC,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,OAAOC,YAAO,CAAC,WAAW,CAACF,MAAI,CAAC,CAAC;AACrC;AACA,SAAS,CAAC,CAAC,GAAG,UAAU;AACxB,SAAS,CAAC,IAAI,GAAG,YAAY;AAC7B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACrC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC;AAClD,IAAI;AACJ,IAAI,WAAW,GAAG,IAAI;AACtB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2-browser.d.ts.map b/lib.commonjs/crypto/pbkdf2-browser.d.ts.map index a7519b4b4..97bf68048 100644 --- a/lib.commonjs/crypto/pbkdf2-browser.d.ts.map +++ b/lib.commonjs/crypto/pbkdf2-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pbkdf2-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,+BAA+B,CAAC;AACnD,eAAe,MAAM,CAAC"} \ No newline at end of file +{"version":3,"file":"pbkdf2-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,+BAA+B,CAAC;eACpC,MAAM"} \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2-browser.js b/lib.commonjs/crypto/pbkdf2-browser.js index 373709aef..baea974bd 100644 --- a/lib.commonjs/crypto/pbkdf2-browser.js +++ b/lib.commonjs/crypto/pbkdf2-browser.js @@ -1,7 +1,10 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const tslib_1 = require("tslib"); +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var pbkdf2 = require('bcrypto/lib/pbkdf2-browser.js'); + // @ts-ignore -const pbkdf2_browser_js_1 = tslib_1.__importDefault(require("bcrypto/lib/pbkdf2-browser.js")); -exports.default = pbkdf2_browser_js_1.default; -//# sourceMappingURL=pbkdf2-browser.js.map \ No newline at end of file + +exports.default = pbkdf2; +//# sourceMappingURL=pbkdf2-browser.js.map diff --git a/lib.commonjs/crypto/pbkdf2-browser.js.map b/lib.commonjs/crypto/pbkdf2-browser.js.map index dfb41ea64..007d860a6 100644 --- a/lib.commonjs/crypto/pbkdf2-browser.js.map +++ b/lib.commonjs/crypto/pbkdf2-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"pbkdf2-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":";;;AAAA,aAAa;AACb,8FAAmD;AACnD,kBAAe,2BAAM,CAAC"} \ No newline at end of file +{"version":3,"file":"pbkdf2-browser.js","sources":["../../lib.esm/crypto/pbkdf2-browser.js"],"sourcesContent":["// @ts-ignore\nimport pbkdf2 from \"bcrypto/lib/pbkdf2-browser.js\";\nexport default pbkdf2;\n//# sourceMappingURL=pbkdf2-browser.js.map"],"names":[],"mappings":";;;;;;AAAA;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2.d.ts b/lib.commonjs/crypto/pbkdf2.d.ts index 400e9744f..c2da81c40 100644 --- a/lib.commonjs/crypto/pbkdf2.d.ts +++ b/lib.commonjs/crypto/pbkdf2.d.ts @@ -6,6 +6,7 @@ * @_subsection: api/crypto:Passwords [about-pbkdf] */ import type { BytesLike } from "../utils/index.js"; +declare const _pbkdf2: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; /** * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using * the %%salt%% and using %%iterations%% of %%algo%%. @@ -28,8 +29,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string; export declare namespace pbkdf2 { - var _: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; - var lock: () => void; - var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; + export { _pbkdf2 as _ }; + export var lock: () => void; + export var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; } +export {}; //# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2.d.ts.map b/lib.commonjs/crypto/pbkdf2.d.ts.map index 99323c18c..fc5ad966d 100644 --- a/lib.commonjs/crypto/pbkdf2.d.ts.map +++ b/lib.commonjs/crypto/pbkdf2.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAgBnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACpB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GACxB,MAAM,CAIR;yBAVe,MAAM"} \ No newline at end of file +{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,OAAO,aACF,UAAU,QACd,UAAU,cACJ,MAAM,UACV,MAAM,QACR,QAAQ,GAAG,QAAQ,KACvB,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACrB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GACvB,MAAM,CAIR;yBAVe,MAAM;aAWX,OAAO;2BACS,IAAI;gCAIxB,CACL,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,KACrB,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2.js b/lib.commonjs/crypto/pbkdf2.js index 499f120d6..c1da63367 100644 --- a/lib.commonjs/crypto/pbkdf2.js +++ b/lib.commonjs/crypto/pbkdf2.js @@ -1,4 +1,20 @@ -"use strict"; +'use strict'; + +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +var crypto = require('crypto'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + /** * A **Password-Based Key-Derivation Function** is designed to create * a sequence of bytes suitible as a **key** from a human-rememberable @@ -6,13 +22,9 @@ * * @_subsection: api/crypto:Passwords [about-pbkdf] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.pbkdf2 = void 0; -const crypto_js_1 = require("./crypto.js"); -const index_js_1 = require("../utils/index.js"); let locked = false; const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return (0, crypto_js_1.pbkdf2Sync)(password, salt, iterations, keylen, algo); + return crypto.pbkdf2Sync(password, salt, iterations, keylen, algo); }; let __pbkdf2 = _pbkdf2; /** @@ -36,11 +48,10 @@ let __pbkdf2 = _pbkdf2; * //_result: */ function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = (0, index_js_1.getBytes)(_password, "password"); - const salt = (0, index_js_1.getBytes)(_salt, "salt"); - return (0, index_js_1.hexlify)(__pbkdf2(password, salt, iterations, keylen, algo)); + const password = data.getBytes(_password, "password"); + const salt = data.getBytes(_salt, "salt"); + return data.hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); } -exports.pbkdf2 = pbkdf2; pbkdf2._ = _pbkdf2; pbkdf2.lock = function () { locked = true; @@ -52,4 +63,6 @@ pbkdf2.register = function (func) { __pbkdf2 = func; }; Object.freeze(pbkdf2); -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file + +exports.pbkdf2 = pbkdf2; +//# sourceMappingURL=pbkdf2.js.map diff --git a/lib.commonjs/crypto/pbkdf2.js.map b/lib.commonjs/crypto/pbkdf2.js.map index 99339c314..5eb672f83 100644 --- a/lib.commonjs/crypto/pbkdf2.js.map +++ b/lib.commonjs/crypto/pbkdf2.js.map @@ -1 +1 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2CAAyC;AAEzC,gDAAsD;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,OAAO,GAAG,UACd,QAAoB,EACpB,IAAgB,EAChB,UAAkB,EAClB,MAAc,EACd,IAAyB;IAEzB,OAAO,IAAA,sBAAU,EAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,IAAI,QAAQ,GAAG,OAAO,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,MAAM,CACpB,SAAoB,EACpB,KAAgB,EAChB,UAAkB,EAClB,MAAc,EACd,IAAyB;IAEzB,MAAM,QAAQ,GAAG,IAAA,mBAAQ,EAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACrE,CAAC;AAVD,wBAUC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG;IACZ,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC,CAAC;AACF,MAAM,CAAC,QAAQ,GAAG,UAChB,IAMc;IAEd,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KACrC;IACD,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"pbkdf2.js","sources":["../../lib.esm/crypto/pbkdf2.js"],"sourcesContent":["/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () {\n locked = true;\n};\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map"],"names":["pbkdf2Sync","getBytes","hexlify"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,OAAO,GAAG,UAAU,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;AACpE,IAAI,OAAOA,iBAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC;AAC/D,CAAC;AACD,IAAI,QAAQ,GAAG,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;AACnE,IAAI,MAAM,QAAQ,GAAGC,aAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;AACpD,IAAI,MAAM,IAAI,GAAGA,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,OAAOC,YAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACtE;AACA,MAAM,CAAC,CAAC,GAAG,OAAO;AAClB,MAAM,CAAC,IAAI,GAAG,YAAY;AAC1B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,MAAM,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AAClC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC;AAC3C,IAAI;AACJ,IAAI,QAAQ,GAAG,IAAI;AACnB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/random.d.ts b/lib.commonjs/crypto/random.d.ts index fd9378000..609ec0ec0 100644 --- a/lib.commonjs/crypto/random.d.ts +++ b/lib.commonjs/crypto/random.d.ts @@ -1,3 +1,4 @@ +declare const _randomBytes: (length: number) => Uint8Array; /** * Return %%length%% bytes of cryptographically secure random data. * @@ -7,8 +8,9 @@ */ export declare function randomBytes(length: number): Uint8Array; export declare namespace randomBytes { - var _: (length: number) => Uint8Array; - var lock: () => void; - var register: (func: (length: number) => Uint8Array) => void; + export { _randomBytes as _ }; + export var lock: () => void; + export var register: (func: (length: number) => Uint8Array) => void; } +export {}; //# sourceMappingURL=random.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/random.d.ts.map b/lib.commonjs/crypto/random.d.ts.map index a907fd7ef..0e9d29e7b 100644 --- a/lib.commonjs/crypto/random.d.ts.map +++ b/lib.commonjs/crypto/random.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW"} \ No newline at end of file +{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY,WAAqB,MAAM,KAAG,UAE/C,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW;aAIX,YAAY;2BACI,IAAI;gCAGG,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU"} \ No newline at end of file diff --git a/lib.commonjs/crypto/random.js b/lib.commonjs/crypto/random.js index f8f60ea1d..7bfad060b 100644 --- a/lib.commonjs/crypto/random.js +++ b/lib.commonjs/crypto/random.js @@ -1,6 +1,11 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.randomBytes = void 0; +'use strict'; + +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +var crypto = require('crypto'); + /** * A **Cryptographically Secure Random Value** is one that has been * generated with additional care take to prevent side-channels @@ -9,10 +14,9 @@ exports.randomBytes = void 0; * * @_subsection: api/crypto:Random Values [about-crypto-random] */ -const crypto_js_1 = require("./crypto.js"); let locked = false; const _randomBytes = function (length) { - return new Uint8Array((0, crypto_js_1.randomBytes)(length)); + return new Uint8Array(crypto.randomBytes(length)); }; let __randomBytes = _randomBytes; /** @@ -25,7 +29,6 @@ let __randomBytes = _randomBytes; function randomBytes(length) { return __randomBytes(length); } -exports.randomBytes = randomBytes; randomBytes._ = _randomBytes; randomBytes.lock = function () { locked = true; @@ -37,4 +40,6 @@ randomBytes.register = function (func) { __randomBytes = func; }; Object.freeze(randomBytes); -//# sourceMappingURL=random.js.map \ No newline at end of file + +exports.randomBytes = randomBytes; +//# sourceMappingURL=random.js.map diff --git a/lib.commonjs/crypto/random.js.map b/lib.commonjs/crypto/random.js.map index 052be12bb..842f2fcee 100644 --- a/lib.commonjs/crypto/random.js.map +++ b/lib.commonjs/crypto/random.js.map @@ -1 +1 @@ -{"version":3,"file":"random.js","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,2CAA2D;AAE3D,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UAAU,MAAc;IAC3C,OAAO,IAAI,UAAU,CAAC,IAAA,uBAAa,EAAC,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;GAMG;AACH,SAAgB,WAAW,CAAC,MAAc;IACxC,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAFD,kCAEC;AAED,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAG;IACjB,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC,CAAC;AACF,WAAW,CAAC,QAAQ,GAAG,UAAU,IAAoC;IACnE,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAC1C;IACD,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"random.js","sources":["../../lib.esm/crypto/random.js"],"sourcesContent":["/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () {\n locked = true;\n};\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map"],"names":["crypto_random"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,YAAY,GAAG,UAAU,MAAM,EAAE;AACvC,IAAI,OAAO,IAAI,UAAU,CAACA,kBAAa,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AACD,IAAI,aAAa,GAAG,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,MAAM,EAAE;AACpC,IAAI,OAAO,aAAa,CAAC,MAAM,CAAC;AAChC;AACA,WAAW,CAAC,CAAC,GAAG,YAAY;AAC5B,WAAW,CAAC,IAAI,GAAG,YAAY;AAC/B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,WAAW,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACvC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC;AAChD,IAAI;AACJ,IAAI,aAAa,GAAG,IAAI;AACxB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ripemd160.d.ts b/lib.commonjs/crypto/ripemd160.d.ts index 27b7b4a1c..a38b5f516 100644 --- a/lib.commonjs/crypto/ripemd160.d.ts +++ b/lib.commonjs/crypto/ripemd160.d.ts @@ -1,4 +1,5 @@ import type { BytesLike } from "../utils/index.js"; +declare const _ripemd160: (data: Uint8Array) => Uint8Array; /** * Compute the cryptographic RIPEMD-160 hash of %%data%%. * @@ -18,8 +19,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function ripemd160(_data: BytesLike): string; export declare namespace ripemd160 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _ripemd160 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/ripemd160.d.ts.map b/lib.commonjs/crypto/ripemd160.d.ts.map index 2eb29db41..68683ca8b 100644 --- a/lib.commonjs/crypto/ripemd160.d.ts.map +++ b/lib.commonjs/crypto/ripemd160.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAUnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file +{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ripemd160.js b/lib.commonjs/crypto/ripemd160.js index a3f656010..300a4a960 100644 --- a/lib.commonjs/crypto/ripemd160.js +++ b/lib.commonjs/crypto/ripemd160.js @@ -1,11 +1,19 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ripemd160 = void 0; -const ripemd160_1 = require("@noble/hashes/ripemd160"); -const index_js_1 = require("../utils/index.js"); +'use strict'; + +var legacy_js = require('@noble/hashes/legacy.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + let locked = false; const _ripemd160 = function (data) { - return (0, ripemd160_1.ripemd160)(data); + return legacy_js.ripemd160(data); }; let __ripemd160 = _ripemd160; /** @@ -26,10 +34,9 @@ let __ripemd160 = _ripemd160; * */ function ripemd160(_data) { - const data = (0, index_js_1.getBytes)(_data, "data"); - return (0, index_js_1.hexlify)(__ripemd160(data)); + const data$1 = data.getBytes(_data, "data"); + return data.hexlify(__ripemd160(data$1)); } -exports.ripemd160 = ripemd160; ripemd160._ = _ripemd160; ripemd160.lock = function () { locked = true; @@ -41,4 +48,6 @@ ripemd160.register = function (func) { __ripemd160 = func; }; Object.freeze(ripemd160); -//# sourceMappingURL=ripemd160.js.map \ No newline at end of file + +exports.ripemd160 = ripemd160; +//# sourceMappingURL=ripemd160.js.map diff --git a/lib.commonjs/crypto/ripemd160.js.map b/lib.commonjs/crypto/ripemd160.js.map index a274f81ce..18be84c0d 100644 --- a/lib.commonjs/crypto/ripemd160.js.map +++ b/lib.commonjs/crypto/ripemd160.js.map @@ -1 +1 @@ -{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":";;;AAAA,uDAAuE;AAEvE,gDAAsD;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAU,IAAgB;IAC3C,OAAO,IAAA,qBAAe,EAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,SAAS,CAAC,KAAgB;IACxC,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAO,EAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC;AAHD,8BAGC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG;IACf,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC,CAAC;AACF,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAqC;IAClE,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAC5C;IACD,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"ripemd160.js","sources":["../../lib.esm/crypto/ripemd160.js"],"sourcesContent":["import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () {\n locked = true;\n};\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map"],"names":["noble_ripemd160","data","getBytes","hexlify"],"mappings":";;;;;;;;;;;;;AAEA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,UAAU,GAAG,UAAU,IAAI,EAAE;AACnC,IAAI,OAAOA,mBAAe,CAAC,IAAI,CAAC;AAChC,CAAC;AACD,IAAI,WAAW,GAAG,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,MAAMC,MAAI,GAAGC,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,OAAOC,YAAO,CAAC,WAAW,CAACF,MAAI,CAAC,CAAC;AACrC;AACA,SAAS,CAAC,CAAC,GAAG,UAAU;AACxB,SAAS,CAAC,IAAI,GAAG,YAAY;AAC7B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACrC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC;AAClD,IAAI;AACJ,IAAI,WAAW,GAAG,IAAI;AACtB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/rlp.js b/lib.commonjs/crypto/rlp.js index 8d8da6354..98b66fc9b 100644 --- a/lib.commonjs/crypto/rlp.js +++ b/lib.commonjs/crypto/rlp.js @@ -1,9 +1,9 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decode = exports.encode = void 0; -const logger_js_1 = require("../logger/logger.js"); -const data_js_1 = require("../utils/data.js"); -const logger = new logger_js_1.Logger("rlp/0.0.1"); +'use strict'; + +var logger$1 = require('../logger/logger.js'); +var data = require('../utils/data.js'); + +const logger = new logger$1.Logger("rlp/0.0.1"); function arrayifyInteger(value) { const result = []; while (value) { @@ -34,25 +34,24 @@ function _encode(object) { length.unshift(0xf7 + length.length); return length.concat(payload); } - if (!(0, data_js_1.isBytesLike)(object)) { + if (!data.isBytesLike(object)) { logger.throwArgumentError("RLP object must be BytesLike", "object", object); } - const data = Array.prototype.slice.call((0, data_js_1.arrayify)(object)); - if (data.length === 1 && data[0] <= 0x7f) { - return data; + const data$1 = Array.prototype.slice.call(data.arrayify(object)); + if (data$1.length === 1 && data$1[0] <= 0x7f) { + return data$1; } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; + else if (data$1.length <= 55) { + data$1.unshift(0x80 + data$1.length); + return data$1; } - const length = arrayifyInteger(data.length); + const length = arrayifyInteger(data$1.length); length.unshift(0xb7 + length.length); - return length.concat(data); + return length.concat(data$1); } function encode(object) { - return (0, data_js_1.hexlify)(_encode(object)); + return data.hexlify(_encode(object)); } -exports.encode = encode; function _decodeChildren(data, offset, childOffset, length) { const result = []; while (childOffset < offset + 1 + length) { @@ -60,64 +59,66 @@ function _decodeChildren(data, offset, childOffset, length) { result.push(decoded.result); childOffset += decoded.consumed; if (childOffset > offset + 1 + length) { - logger.throwError("child data too short", logger_js_1.Logger.errors.BUFFER_OVERRUN, {}); + logger.throwError("child data too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); } } return { consumed: 1 + length, result: result }; } // returns { consumed: number, result: Object } -function _decode(data, offset) { - if (data.length === 0) { - logger.throwError("data too short", logger_js_1.Logger.errors.BUFFER_OVERRUN, {}); +function _decode(data$1, offset) { + if (data$1.length === 0) { + logger.throwError("data too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); } // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - if (offset + 1 + lengthLength > data.length) { - logger.throwError("data short segment too short", logger_js_1.Logger.errors.BUFFER_OVERRUN, {}); + if (data$1[offset] >= 0xf8) { + const lengthLength = data$1[offset] - 0xf7; + if (offset + 1 + lengthLength > data$1.length) { + logger.throwError("data short segment too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); } - const length = unarrayifyInteger(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger.throwError("data long segment too short", logger_js_1.Logger.errors.BUFFER_OVERRUN, {}); + const length = unarrayifyInteger(data$1, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data$1.length) { + logger.throwError("data long segment too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); } - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); + return _decodeChildren(data$1, offset, offset + 1 + lengthLength, lengthLength + length); } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - if (offset + 1 + length > data.length) { - logger.throwError("data array too short", logger_js_1.Logger.errors.BUFFER_OVERRUN, {}); + else if (data$1[offset] >= 0xc0) { + const length = data$1[offset] - 0xc0; + if (offset + 1 + length > data$1.length) { + logger.throwError("data array too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); } - return _decodeChildren(data, offset, offset + 1, length); + return _decodeChildren(data$1, offset, offset + 1, length); } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - if (offset + 1 + lengthLength > data.length) { - logger.throwError("data array too short", logger_js_1.Logger.errors.BUFFER_OVERRUN, {}); + else if (data$1[offset] >= 0xb8) { + const lengthLength = data$1[offset] - 0xb7; + if (offset + 1 + lengthLength > data$1.length) { + logger.throwError("data array too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); } - const length = unarrayifyInteger(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger.throwError("data array too short", logger_js_1.Logger.errors.BUFFER_OVERRUN, {}); + const length = unarrayifyInteger(data$1, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data$1.length) { + logger.throwError("data array too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); } - const result = (0, data_js_1.hexlify)(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); + const result = data.hexlify(data$1.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); return { consumed: 1 + lengthLength + length, result: result }; } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - if (offset + 1 + length > data.length) { - logger.throwError("data too short", logger_js_1.Logger.errors.BUFFER_OVERRUN, {}); + else if (data$1[offset] >= 0x80) { + const length = data$1[offset] - 0x80; + if (offset + 1 + length > data$1.length) { + logger.throwError("data too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); } - const result = (0, data_js_1.hexlify)(data.slice(offset + 1, offset + 1 + length)); + const result = data.hexlify(data$1.slice(offset + 1, offset + 1 + length)); return { consumed: 1 + length, result: result }; } - return { consumed: 1, result: (0, data_js_1.hexlify)(data[offset]) }; + return { consumed: 1, result: data.hexlify(data$1[offset]) }; } -function decode(data) { - const bytes = (0, data_js_1.arrayify)(data); +function decode(data$1) { + const bytes = data.arrayify(data$1); const decoded = _decode(bytes, 0); if (decoded.consumed !== bytes.length) { - logger.throwArgumentError("invalid rlp data", "data", data); + logger.throwArgumentError("invalid rlp data", "data", data$1); } return decoded.result; } + exports.decode = decode; -//# sourceMappingURL=rlp.js.map \ No newline at end of file +exports.encode = encode; +//# sourceMappingURL=rlp.js.map diff --git a/lib.commonjs/crypto/rlp.js.map b/lib.commonjs/crypto/rlp.js.map index 295290e97..7cb058d00 100644 --- a/lib.commonjs/crypto/rlp.js.map +++ b/lib.commonjs/crypto/rlp.js.map @@ -1 +1 @@ -{"version":3,"file":"rlp.js","sourceRoot":"","sources":["../../src.ts/crypto/rlp.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,mDAA6C;AAC7C,8CAA6E;AAE7E,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,WAAW,CAAC,CAAC;AAEvC,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,OAAO,KAAK,EAAE;QACZ,aAAa;QACb,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;QAC7B,KAAK,KAAK,CAAC,CAAC;KACb;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CACxB,IAAgB,EAChB,MAAc,EACd,MAAc;IAEd,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,C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,EAAE,CAAC,EAAE,MAAM,EAAE,IAAA,iBAAO,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AACxD,CAAC;AAED,SAAgB,MAAM,CAAC,IAAe;IACpC,MAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC;IAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAClC,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,EAAE;QACrC,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;KAC7D;IACD,OAAO,OAAO,CAAC,MAAM,CAAC;AACxB,CAAC;AAPD,wBAOC"} \ No newline at end of file +{"version":3,"file":"rlp.js","sources":["../../lib.esm/crypto/rlp.js"],"sourcesContent":["\"use strict\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify, isBytesLike } from \"../utils/data.js\";\nconst logger = new Logger(\"rlp/0.0.1\");\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return 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 _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 if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(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}\nexport function encode(object) {\n return hexlify(_encode(object));\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 if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: 1 + length, result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\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 if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: 1 + length, result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=rlp.js.map"],"names":["Logger","isBytesLike","data","arrayify","hexlify"],"mappings":";;;;;AAGA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,WAAW,CAAC;AACtC,SAAS,eAAe,CAAC,KAAK,EAAE;AAChC,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,OAAO,KAAK,EAAE;AAClB;AACA,QAAQ,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;AACpC,QAAQ,KAAK,KAAK,CAAC;AACnB,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;AACA,SAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACjD,IAAI,IAAI,MAAM,GAAG,CAAC;AAClB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,QAAQ,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;AAChD,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;AACA,SAAS,OAAO,CAAC,MAAM,EAAE;AACzB,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC/B,QAAQ,IAAI,OAAO,GAAG,EAAE;AACxB,QAAQ,MAAM,CAAC,OAAO,CAAC,UAAU,KAAK,EAAE;AACxC,YAAY,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACpD,Q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KAAK,GAAGC,aAAQ,CAACD,MAAI,CAAC;AAChC,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;AACrC,IAAI,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,EAAE;AAC3C,QAAQ,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,EAAEA,MAAI,CAAC;AACnE,IAAI;AACJ,IAAI,OAAO,OAAO,CAAC,MAAM;AACzB;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/scrypt.d.ts b/lib.commonjs/crypto/scrypt.d.ts index b0e678f52..a00b5a43b 100644 --- a/lib.commonjs/crypto/scrypt.d.ts +++ b/lib.commonjs/crypto/scrypt.d.ts @@ -8,6 +8,8 @@ import type { BytesLike } from "../utils/index.js"; * @_docloc: api/crypto:Passwords */ export type ProgressCallback = (percent: number) => void; +declare const _scryptAsync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback) => Promise & Uint8Array>; +declare const _scryptSync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array & Uint8Array; /** * The [[link-wiki-scrypt]] uses a memory and cpu hard method of * derivation to increase the resource cost to brute-force a password @@ -47,9 +49,9 @@ export type ProgressCallback = (percent: number) => void; */ export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise; export declare namespace scrypt { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback | undefined) => Promise; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback | undefined) => Promise) => void; + export { _scryptAsync as _ }; + export var lock: () => void; + export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback) => Promise) => void; } /** * Provides a synchronous variant of [[scrypt]]. @@ -75,8 +77,9 @@ export declare namespace scrypt { */ export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string; export declare namespace scryptSync { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; + export { _scryptSync as _ }; + export var lock: () => void; + export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; } +export {}; //# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/scrypt.d.ts.map b/lib.commonjs/crypto/scrypt.d.ts.map index b8a706e0e..23c428160 100644 --- a/lib.commonjs/crypto/scrypt.d.ts.map +++ b/lib.commonjs/crypto/scrypt.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AA6CzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,MAAM,CAC1B,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAIjB;yBAZqB,MAAM;;;;;AAmC5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,GACZ,MAAM,CAIR;yBAXe,UAAU"} \ No newline at end of file +{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAKzD,QAAA,MAAM,YAAY,WACT,UAAU,QACZ,UAAU,KACb,MAAM,KACN,MAAM,KACN,MAAM,SACF,MAAM,eACA,gBAAgB,mEAG7B,CAAC;AACF,QAAA,MAAM,WAAW,WACR,UAAU,QACZ,UAAU,KACb,MAAM,KACN,MAAM,KACN,MAAM,SACF,MAAM,0DAGb,CAAC;AAoBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,MAAM,CAC3B,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,MAAM,CAAC,CAIjB;yBAZqB,MAAM;aAajB,YAAY;2BACI,IAAI;gCAIxB,CACL,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,gBAAgB,KACvB,OAAO,CAAC,SAAS,CAAC;;AASxB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CACzB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,GACX,MAAM,CAIR;yBAXe,UAAU;aAYX,WAAW;2BACK,IAAI;gCAI5B,CACL,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,KACT,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/scrypt.js b/lib.commonjs/crypto/scrypt.js index fbb2202d2..934021e9e 100644 --- a/lib.commonjs/crypto/scrypt.js +++ b/lib.commonjs/crypto/scrypt.js @@ -1,14 +1,22 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.scryptSync = exports.scrypt = void 0; -const scrypt_1 = require("@noble/hashes/scrypt"); -const index_js_1 = require("../utils/index.js"); +'use strict'; + +var scrypt_js = require('@noble/hashes/scrypt.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + let lockedSync = false, lockedAsync = false; const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await (0, scrypt_1.scryptAsync)(passwd, salt, { N, r, p, dkLen, onProgress }); + return await scrypt_js.scryptAsync(passwd, salt, { N, r, p, dkLen, onProgress }); }; const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return (0, scrypt_1.scrypt)(passwd, salt, { N, r, p, dkLen }); + return scrypt_js.scrypt(passwd, salt, { N, r, p, dkLen }); }; let __scryptAsync = _scryptAsync; let __scryptSync = _scryptSync; @@ -50,11 +58,10 @@ let __scryptSync = _scryptSync; * //_result: */ async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = (0, index_js_1.getBytes)(_passwd, "passwd"); - const salt = (0, index_js_1.getBytes)(_salt, "salt"); - return (0, index_js_1.hexlify)(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); + const passwd = data.getBytes(_passwd, "passwd"); + const salt = data.getBytes(_salt, "salt"); + return data.hexlify(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); } -exports.scrypt = scrypt; scrypt._ = _scryptAsync; scrypt.lock = function () { lockedAsync = true; @@ -89,11 +96,10 @@ Object.freeze(scrypt); * //_result: */ function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = (0, index_js_1.getBytes)(_passwd, "passwd"); - const salt = (0, index_js_1.getBytes)(_salt, "salt"); - return (0, index_js_1.hexlify)(__scryptSync(passwd, salt, N, r, p, dkLen)); + const passwd = data.getBytes(_passwd, "passwd"); + const salt = data.getBytes(_salt, "salt"); + return data.hexlify(__scryptSync(passwd, salt, N, r, p, dkLen)); } -exports.scryptSync = scryptSync; scryptSync._ = _scryptSync; scryptSync.lock = function () { lockedSync = true; @@ -105,4 +111,7 @@ scryptSync.register = function (func) { __scryptSync = func; }; Object.freeze(scryptSync); -//# sourceMappingURL=scrypt.js.map \ No newline at end of file + +exports.scrypt = scrypt; +exports.scryptSync = scryptSync; +//# sourceMappingURL=scrypt.js.map diff --git a/lib.commonjs/crypto/scrypt.js.map b/lib.commonjs/crypto/scrypt.js.map index fe14e9403..e8b48e979 100644 --- a/lib.commonjs/crypto/scrypt.js.map +++ b/lib.commonjs/crypto/scrypt.js.map @@ -1 +1 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":";;;AAAA,iDAG8B;AAE9B,gDAA2D;AAc3D,IAAI,UAAU,GAAG,KAAK,EACpB,WAAW,GAAG,KAAK,CAAC;AAEtB,MAAM,YAAY,GAAG,KAAK,WACxB,MAAkB,EAClB,IAAgB,EAChB,CAAS,EACT,CAAS,EACT,CAAS,EACT,KAAa,EACb,UAA6B;IAE7B,OAAO,MAAM,IAAA,oBAAW,EAAC,MAAM,EAAE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,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,UAAU,CACxB,OAAkB,EAClB,KAAgB,EAChB,CAAS,EACT,CAAS,EACT,CAAS,EACT,KAAa;IAEb,MAAM,MAAM,GAAG,IAAA,mBAAQ,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,IAAA,kBAAC,EAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACvD,CAAC;AAXD,gCAWC;AACD,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC;AAC3B,UAAU,CAAC,IAAI,GAAG;IAChB,UAAU,GAAG,IAAI,CAAC;AACpB,CAAC,CAAC;AACF,UAAU,CAAC,QAAQ,GAAG,UACpB,IAOc;IAEd,IAAI,UAAU,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,YAAY,GAAG,IAAI,CAAC;AACtB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"scrypt.js","sources":["../../lib.esm/crypto/scrypt.js"],"sourcesContent":["import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from \"@noble/hashes/scrypt.js\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () {\n lockedAsync = true;\n};\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () {\n lockedSync = true;\n};\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map"],"names":["_nobleAsync","_nobleSync","getBytes","H"],"mappings":";;;;;;;;;;;;;AAEA,IAAI,UAAU,GAAG,KAAK,EAAE,WAAW,GAAG,KAAK;AAC3C,MAAM,YAAY,GAAG,gBAAgB,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE;AAC/E,IAAI,OAAO,MAAMA,qBAAW,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC1E,CAAC;AACD,MAAM,WAAW,GAAG,UAAU,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE;AAC5D,IAAI,OAAOC,gBAAU,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC;AACvD,CAAC;AACD,IAAI,aAAa,GAAG,YAAY;AAChC,IAAI,YAAY,GAAG,WAAW;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AC;AACxD;AACA,UAAU,CAAC,CAAC,GAAG,WAAW;AAC1B,UAAU,CAAC,IAAI,GAAG,YAAY;AAC9B,IAAI,UAAU,GAAG,IAAI;AACrB,CAAC;AACD,UAAU,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACtC,IAAI,IAAI,UAAU,EAAE;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC;AAC/C,IAAI;AACJ,IAAI,YAAY,GAAG,IAAI;AACvB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/sha3.d.ts b/lib.commonjs/crypto/sha3.d.ts index e9130d128..34e1d42f6 100644 --- a/lib.commonjs/crypto/sha3.d.ts +++ b/lib.commonjs/crypto/sha3.d.ts @@ -1,6 +1,8 @@ import { BytesLike } from "../utils/data.js"; +declare const _sha256: (data: Uint8Array) => string; +declare const _sha512: (data: Uint8Array) => string; /** - * Compute the cryptographic SHA2-256 hash of %%data%%. + * Compute the cryptographic SHA3-256 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -23,14 +25,14 @@ export declare enum SupportedAlgorithm { export declare function ripemd160(data: BytesLike): string; export declare function sha256(data: BytesLike): string; export declare namespace sha256 { - var _: (data: Uint8Array) => string; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _sha256 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } export declare function legacySha256(data: BytesLike): string; export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string; /** - * Compute the cryptographic SHA2-512 hash of %%data%%. + * Compute the cryptographic SHA3-512 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -47,8 +49,9 @@ export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLik */ export declare function sha512(data: BytesLike): string; export declare namespace sha512 { - var _: (data: Uint8Array) => string; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _sha512 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/sha3.d.ts.map b/lib.commonjs/crypto/sha3.d.ts.map index 62d2f90aa..d71f0360e 100644 --- a/lib.commonjs/crypto/sha3.d.ts.map +++ b/lib.commonjs/crypto/sha3.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAqB,MAAM,kBAAkB,CAAC;AAgC1E;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAYjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAU9C;yBAVe,MAAM;;;;;AAYtB,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIpD;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACd,MAAM,CAkBR;AAcD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAU9C;yBAVe,MAAM"} \ No newline at end of file +{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAqB,MAAM,kBAAkB,CAAC;AAM1E,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AACvD,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AAOvD;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,kBAAkB;IAC7B,MAAM,WAAW;IACjB,MAAM,WAAW;CACjB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAkCX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI;;AAlCxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIpD;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR;AAcD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAGX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI"} \ No newline at end of file diff --git a/lib.commonjs/crypto/sha3.js b/lib.commonjs/crypto/sha3.js index 457bf37a5..5dcf3b220 100644 --- a/lib.commonjs/crypto/sha3.js +++ b/lib.commonjs/crypto/sha3.js @@ -1,32 +1,21 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sha512 = exports.computeHmac = exports.legacySha256 = exports.sha256 = exports.ripemd160 = exports.SupportedAlgorithm = void 0; -const logger_js_1 = require("../logger/logger.js"); -const data_js_1 = require("../utils/data.js"); -const crypto_js_1 = require("./crypto.js"); -const buffer_1 = require("buffer"); -const logger = new logger_js_1.Logger("sha3/0.0.1"); -const _sha256 = function (data) { - let v = "0x" + - (0, crypto_js_1.createHash)("sha3-256") - .update(buffer_1.Buffer.from((0, data_js_1.arrayify)(data))) - .digest("hex"); - return v; -}; -const _sha512 = function (data) { - let v = "0x" + - (0, crypto_js_1.createHash)("sha3-512") - .update(buffer_1.Buffer.from((0, data_js_1.arrayify)(data))) - .digest("hex"); - return v; -}; -// @ts-ignore +'use strict'; + +var logger$1 = require('../logger/logger.js'); +var data = require('../utils/data.js'); +require('bcrypto/lib/ed448.js'); +var buffer = require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +var crypto = require('crypto'); + +const logger = new logger$1.Logger("sha3/0.0.1"); +const _sha256 = (data$1) => data.hexlify(crypto.createHash("sha3-256").update(data$1).digest()); +const _sha512 = (data$1) => data.hexlify(crypto.createHash("sha3-512").update(data$1).digest()); let __sha256 = _sha256; -// @ts-ignore let __sha512 = _sha512; let locked256 = false, locked512 = false; /** - * Compute the cryptographic SHA2-256 hash of %%data%%. + * Compute the cryptographic SHA3-256 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -42,58 +31,37 @@ let locked256 = false, locked512 = false; * //_result: * */ -var SupportedAlgorithm; +exports.SupportedAlgorithm = void 0; (function (SupportedAlgorithm) { SupportedAlgorithm["sha256"] = "sha256"; SupportedAlgorithm["sha512"] = "sha512"; -})(SupportedAlgorithm || (exports.SupportedAlgorithm = SupportedAlgorithm = {})); -function ripemd160(data) { - let createdHash = "0x" + - (0, crypto_js_1.createHash)("ripemd160") - .update(buffer_1.Buffer.from((0, data_js_1.arrayify)(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = (0, data_js_1.hexlify)(createdHash); - return createdHash; - } - return v; +})(exports.SupportedAlgorithm || (exports.SupportedAlgorithm = {})); +function ripemd160(data$1) { + return data.hexlify(crypto.createHash("ripemd160").update(data.getBytes(data$1)).digest()); } -exports.ripemd160 = ripemd160; -function sha256(data) { - let createdHash = (0, crypto_js_1.createHash)("sha3-256") - .update(buffer_1.Buffer.from((0, data_js_1.arrayify)(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = (0, data_js_1.hexlify)(createdHash); - return createdHash; - } - return v; +function sha256(data$1) { + return data.hexlify(__sha256(data.getBytes(data$1))); } -exports.sha256 = sha256; -function legacySha256(data) { - const _data = (0, data_js_1.getBytes)(data, "data"); - const hexlified = (0, data_js_1.hexlify)((0, crypto_js_1.createHash)("sha256").update(_data).digest()); +function legacySha256(data$1) { + const _data = data.getBytes(data$1, "data"); + const hexlified = data.hexlify(crypto.createHash("sha256").update(_data).digest()); return hexlified; } -exports.legacySha256 = legacySha256; -function computeHmac(algorithm, key, data) { - const d = buffer_1.Buffer.from((0, data_js_1.arrayify)(data)); - const k = buffer_1.Buffer.from((0, data_js_1.arrayify)(key)); - if (algorithm === SupportedAlgorithm.sha256) { - return "0x" + (0, crypto_js_1.createHmac)("sha3-256", k).update(d).digest("hex"); +function computeHmac(algorithm, key, data$1) { + const d = buffer.Buffer.from(data.arrayify(data$1)); + const k = buffer.Buffer.from(data.arrayify(key)); + if (algorithm === exports.SupportedAlgorithm.sha256) { + return data.hexlify(crypto.createHmac("sha3-256", k).update(d).digest()); } - else if (algorithm === SupportedAlgorithm.sha512) { - return "0x" + (0, crypto_js_1.createHmac)("sha3-512", k).update(d).digest("hex"); + else if (algorithm === exports.SupportedAlgorithm.sha512) { + return data.hexlify(crypto.createHmac("sha3-512", k).update(d).digest()); } - logger.throwError("unsupported algorithm - " + algorithm, logger_js_1.Logger.errors.UNSUPPORTED_OPERATION, { + logger.throwError("unsupported algorithm - " + algorithm, logger$1.Logger.errors.UNSUPPORTED_OPERATION, { operation: "computeHmac", algorithm: algorithm, }); return ""; } -exports.computeHmac = computeHmac; sha256._ = _sha256; sha256.lock = function () { locked256 = true; @@ -106,7 +74,7 @@ sha256.register = function (func) { }; Object.freeze(sha256); /** - * Compute the cryptographic SHA2-512 hash of %%data%%. + * Compute the cryptographic SHA3-512 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -121,18 +89,9 @@ Object.freeze(sha256); * sha512(new Uint8Array([ 0x13, 0x37 ])) * //_result: */ -function sha512(data) { - let createdHash = (0, crypto_js_1.createHash)("sha3-512") - .update(buffer_1.Buffer.from((0, data_js_1.arrayify)(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = (0, data_js_1.hexlify)(createdHash); - return createdHash; - } - return v; +function sha512(data$1) { + return data.hexlify(__sha512(data.getBytes(data$1))); } -exports.sha512 = sha512; sha512._ = _sha512; sha512.lock = function () { locked512 = true; @@ -143,5 +102,11 @@ sha512.register = function (func) { } __sha512 = func; }; -Object.freeze(sha256); -//# sourceMappingURL=sha3.js.map \ No newline at end of file +Object.freeze(sha512); + +exports.computeHmac = computeHmac; +exports.legacySha256 = legacySha256; +exports.ripemd160 = ripemd160; +exports.sha256 = sha256; +exports.sha512 = sha512; +//# sourceMappingURL=sha3.js.map diff --git a/lib.commonjs/crypto/sha3.js.map b/lib.commonjs/crypto/sha3.js.map index 0b83136e6..b1ff02c47 100644 --- a/lib.commonjs/crypto/sha3.js.map +++ b/lib.commonjs/crypto/sha3.js.map @@ -1 +1 @@ -{"version":3,"file":"sha3.js","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAC7C,8CAA0E;AAC1E,2CAAqD;AACrD,mCAAgC;AAEhC,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,YAAY,CAAC,CAAC;AAExC,MAAM,OAAO,GAAG,UAAU,IAAgB;IACxC,IAAI,CAAC,GACH,IAAI;QACJ,IAAA,sBAAU,EAAC,UAAU,CAAC;aACnB,MAAM,CAAC,eAAM,CAAC,IAAI,CAAC,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC;aACnC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,UAAU,IAAgB;IACxC,IAAI,CAAC,GACH,IAAI;QACJ,IAAA,sBAAU,EAAC,UAAU,CAAC;aACnB,MAAM,CAAC,eAAM,CAA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AM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG;IACZ,SAAS,GAAG,IAAI,CAAC;AACnB,CAAC,CAAC;AACF,MAAM,CAAC,QAAQ,GAAG,UAAU,IAAqC;IAC/D,IAAI,SAAS,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KACrC;IACD,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;GAeG;AAEH,SAAgB,MAAM,CAAC,IAAe;IACpC,IAAI,WAAW,GAAG,IAAA,sBAAU,EAAC,UAAU,CAAC;SACrC,MAAM,CAAC,eAAM,CAAC,IAAI,CAAC,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC;SACnC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjB,MAAM,CAAC,GAAG,IAAI,GAAG,WAAW,CAAC;IAC7B,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;QACnC,WAAW,GAAG,IAAA,iBAAO,EAAC,WAAW,CAAC,CAAC;QACnC,OAAO,WAAW,CAAC;KACpB;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAVD,wBAUC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG;IACZ,SAAS,GAAG,IAAI,CAAC;AACnB,CAAC,CAAC;AACF,MAAM,CAAC,QAAQ,GAAG,UAAU,IAAqC;IAC/D,IAAI,SAAS,EAAE;QACb,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;KACrC;IACD,QAAQ,GAAG,IAAI,CAAC;AAClB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"sha3.js","sources":["../../lib.esm/crypto/sha3.js"],"sourcesContent":["import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = (data) => hexlify(createHash(\"sha3-256\").update(data).digest());\nconst _sha512 = (data) => hexlify(createHash(\"sha3-512\").update(data).digest());\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA3-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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n return hexlify(createHash(\"ripemd160\").update(getBytes(data)).digest());\n}\nexport function sha256(data) {\n return hexlify(__sha256(getBytes(data)));\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(createHmac(\"sha3-256\", k).update(d).digest());\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(createHmac(\"sha3-512\", k).update(d).digest());\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 SHA3-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 return hexlify(__sha512(getBytes(data)));\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha512);\n//# sourceMappingURL=sha3.js.map"],"names":["Logger","data","hexlify","createHash","SupportedAlgorithm","getBytes","Buffer","arrayify","createHmac"],"mappings":";;;;;;;;;;AAIA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,YAAY,CAAC;AACvC,MAAM,OAAO,GAAG,CAACC,MAAI,KAAKC,YAAO,CAACC,iBAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAACF,MAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC/E,MAAM,OAAO,GAAG,CAACA,MAAI,KAAKC,YAAO,CAACC,iBAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAACF,MAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC/E,IAAI,QAAQ,GAAG,OAAO;AACtB,IAAI,QAAQ,GAAG,OAAO;AACtB,IAAI,SAAS,GAAG,KAAK,EAAE,SAAS,GAAG,KAAK;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACWG;AACX,CAAC,UAAU,kBAAkB,EAAE;AAC/B,IAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG,QAAQ;AAC3C,IAAI,kBAAkB,CAAC,QAAQ,CAAC,GAAG,QAAQ;AAC3C,CAAC,EAAEA,0BAAkB,KAAKA,0BAAkB,GAAG,EAAE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,0BAA0B,GAAG,SAAS,EAAER,eAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;AACnG,QAAQ,SAAS,EAAE,aAAa;AAChC,QAAQ,SAAS,EAAE,SAAS;AAC5B,KAAK,CAAC;AACN,IAAI,OAAO,EAAE;AACb;AACA,MAAM,CAAC,CAAC,GAAG,OAAO;AAClB,MAAM,CAAC,IAAI,GAAG,YAAY;AAC1B,IAAI,SAAS,GAAG,IAAI;AACpB,CAAC;AACD,MAAM,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AAClC,IAAI,IAAI,SAAS,EAAE;AACnB,QAAQ,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC;AAC3C,IAAI;AACJ,IAAI,QAAQ,GAAG,IAAI;AACnB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAACC,MAAI,EAAE;AAC7B,IAAI,OAAOC,YAAO,CAAC,QAAQ,CAACG,aAAQ,CAACJ,MAAI,CAAC,CAAC,CAAC;AAC5C;AACA,MAAM,CAAC,CAAC,GAAG,OAAO;AAClB,MAAM,CAAC,IAAI,GAAG,YAAY;AAC1B,IAAI,SAAS,GAAG,IAAI;AACpB,CAAC;AACD,MAAM,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AAClC,IAAI,IAAI,SAAS,EAAE;AACnB,QAAQ,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC;AAC3C,IAAI;AACJ,IAAI,QAAQ,GAAG,IAAI;AACnB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/signature.d.ts.map b/lib.commonjs/crypto/signature.d.ts.map index 83d7e9f37..cf72d7bd1 100644 --- a/lib.commonjs/crypto/signature.d.ts.map +++ b/lib.commonjs/crypto/signature.d.ts.map @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EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM;IAIjE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE;CAwBhD"} \ No newline at end of file +{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcjE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,SAAS;;IAMrB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAGrB;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAUtB;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAEf;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,YAAY,EAIxB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,IAAI,GAAG,MAAM,CAE5B;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,IAAI,GAAG,MAAM,CAMnC;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAOxB;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAMvD;IAMD;;OAEG;IACH,KAAK,IAAI,SAAS,CAMjB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CASZ;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAY3C;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM,CAEhE;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE,CAc9C;CAUD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/signature.js b/lib.commonjs/crypto/signature.js index f3e24c859..973f9dca2 100644 --- a/lib.commonjs/crypto/signature.js +++ b/lib.commonjs/crypto/signature.js @@ -1,7 +1,15 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Signature = void 0; -const index_js_1 = require("../utils/index.js"); +'use strict'; + +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); + // Constants const BN_0 = BigInt(0); const BN_1 = BigInt(1); @@ -31,8 +39,8 @@ class Signature { return this.#r; } set r(value) { - (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(value) === 32, "invalid r", "value", value); - this.#r = (0, index_js_1.hexlify)(value); + errors.assertArgument(data.dataLength(value) === 32, "invalid r", "value", value); + this.#r = data.hexlify(value); } /** * The ``s`` value for a signature. @@ -41,9 +49,9 @@ class Signature { return this.#s; } set s(_value) { - (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(_value) === 32, "invalid s", "value", _value); - const value = (0, index_js_1.hexlify)(_value); - (0, index_js_1.assertArgument)(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); + errors.assertArgument(data.dataLength(_value) === 32, "invalid s", "value", _value); + const value = data.hexlify(_value); + errors.assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); this.#s = value; } /** @@ -60,8 +68,8 @@ class Signature { return this.#v; } set v(value) { - const v = (0, index_js_1.getNumber)(value, "value"); - (0, index_js_1.assertArgument)(v === 27 || v === 28, "invalid v", "v", value); + const v = maths.getNumber(value, "value"); + errors.assertArgument(v === 27 || v === 28, "invalid v", "v", value); this.#v = v; } /** @@ -96,29 +104,29 @@ class Signature { */ get yParityAndS() { // The EIP-2098 compact representation - const yParityAndS = (0, index_js_1.getBytes)(this.s); + const yParityAndS = data.getBytes(this.s); if (this.yParity) { yParityAndS[0] |= 0x80; } - return (0, index_js_1.hexlify)(yParityAndS); + return data.hexlify(yParityAndS); } /** * The [[link-eip-2098]] compact representation. */ get compactSerialized() { - return (0, index_js_1.concat)([this.r, this.yParityAndS]); + return data.concat([this.r, this.yParityAndS]); } /** * The serialized representation. */ get serialized() { - return (0, index_js_1.concat)([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); + return data.concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); } /** * @private */ constructor(guard, r, s, v) { - (0, index_js_1.assertPrivate)(guard, _guard, "Signature"); + errors.assertPrivate(guard, _guard, "Signature"); this.#r = r; this.#s = s; this.#v = v; @@ -161,13 +169,13 @@ class Signature { * //_result: */ static getnetworkId(v) { - const bv = (0, index_js_1.getBigInt)(v, "v"); + const bv = maths.getBigInt(v, "v"); // The v is not an EIP-155 v, so it is the unspecified chain ID if (bv == BN_27 || bv == BN_28) { return BN_0; } // Bad value for an EIP-155 v - (0, index_js_1.assertArgument)(bv >= BN_35, "invalid EIP-155 v", "v", v); + errors.assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); return (bv - BN_35) / BN_2; } /** @@ -185,7 +193,7 @@ class Signature { * */ static getnetworkIdV(networkId, v) { - return (0, index_js_1.getBigInt)(networkId) * BN_2 + BigInt(35 + v - 27); + return maths.getBigInt(networkId) * BN_2 + BigInt(35 + v - 27); } /** * Compute the normalized legacy transaction ``v`` from a ``yParirty``, @@ -209,17 +217,18 @@ class Signature { * //_error: */ static getNormalizedV(v) { - const bv = (0, index_js_1.getBigInt)(v); + const bv = maths.getBigInt(v); if (bv === BN_0 || bv === BN_27) { return 27; } if (bv === BN_1 || bv === BN_28) { return 28; } - (0, index_js_1.assertArgument)(bv >= BN_35, "invalid v", "v", v); + errors.assertArgument(bv >= BN_35, "invalid v", "v", v); // Otherwise, EIP-155 v means odd is 27 and even is 28 return bv & BN_1 ? 27 : 28; } } + exports.Signature = Signature; -//# sourceMappingURL=signature.js.map \ No newline at end of file +//# sourceMappingURL=signature.js.map diff --git a/lib.commonjs/crypto/signature.js.map b/lib.commonjs/crypto/signature.js.map index 0a50ae988..fd22ccb6c 100644 --- a/lib.commonjs/crypto/signature.js.map +++ b/lib.commonjs/crypto/signature.js.map @@ -1 +1 @@ -{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":";;;AAAA,gDAS2B;AAI3B,YAAY;AACZ,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAEzB,MAAM,MAAM,GAAG,EAAE,CAAC;AAWlB;;;;;GAKG;AACH,MAAa,SAAS;IACpB,EAAE,CAAS;IACX,EAAE,CAAS;IACX,EAAE,CAAU;IACZ,SAAS,CAAgB;IAEzB;;;;;OAKG;IACH,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IACD,IAAI,CAAC,CAAC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AC,aAAa,CAAC,SAAuB,EAAE,CAAU;QACtD,OAAO,IAAA,oBAAS,EAAC,SAAS,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAe;QACnC,MAAM,EAAE,GAAG,IAAA,oBAAS,EAAC,CAAC,CAAC,CAAC;QAExB,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE;YAC/B,OAAO,EAAE,CAAC;SACX;QACD,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE;YAC/B,OAAO,EAAE,CAAC;SACX;QAED,IAAA,yBAAc,EAAC,EAAE,IAAI,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QAEjD,sDAAsD;QACtD,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7B,CAAC;CAUF;AAhPD,8BAgPC"} \ No newline at end of file +{"version":3,"file":"signature.js","sources":["../../lib.esm/crypto/signature.js"],"sourcesContent":["import { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate, } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst _guard = {};\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signautre.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() {\n return this.#r;\n }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n const value = hexlify(_value);\n assertArgument(parseInt(value.substring(0, 3)) < 8, \"non-canonical s\", \"value\", value);\n this.#s = value;\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() {\n return this.#v;\n }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() {\n return this.#networkV;\n }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacynetworkId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getnetworkId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return this.v === 27 ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, this.yParity ? \"0x1c\" : \"0x1b\"]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return `Signature { r: \"${this.r}\", s: \"${this.s}\", yParity: ${this.yParity}, networkV: ${this.networkV} }`;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this.s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: networkV != null ? networkV.toString() : null,\n r: this.r,\n s: this.s,\n v: this.v,\n };\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getnetworkId(45)\n * //_result:\n *\n * Signature.getnetworkId(46)\n * //_result:\n */\n static getnetworkId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if (bv == BN_27 || bv == BN_28) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getnetworkIdV(5, 27)\n * //_result:\n *\n * Signature.getnetworkIdV(5, 28)\n * //_result:\n *\n */\n static getnetworkIdV(networkId, v) {\n return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return bv & BN_1 ? 27 : 28;\n }\n}\n//# sourceMappingURL=signature.js.map"],"names":["assertArgument","dataLength","hexlify","getNumber","getBytes","concat","assertPrivate","getBigInt"],"mappings":";;;;;;;;;;;;AACA;AACA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,MAAM,MAAM,GAAG,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,SAAS,CAAC;AACvB,IAAI,EAAE;AACN,IAAI,EAAE;AACN,IAAI,EAAE;AACN,IAAI,SAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC,GAAG;AACZ,QAAQ,OAAO,IAAI,CAAC,EAAE;AACtB,IAAI;AACJ,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE;AACjB,QAAQA,qBAAc,CAACC,eAAU,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,CAAC;AAC7E,QAAQ,IAAI,CAAC,EAAE,GAAGC,YAAO,CAAC,KAAK,CAAC;AAChC,IAAI;AACJ;AACA;AACA;AACA,IAAI,IAAI,CAAC,GAAG;AACZ,QAAQ,OAAO,IAAI,CAAC,EAAE;AACtB,IAAI;AACJ,IAAI,IAAI,CAAC,CA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;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,aAAa,CAAC,SAAS,EAAE,CAAC,EAAE;AACvC,QAAQ,OAAOO,eAAS,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;AAChE,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,cAAc,CAAC,CAAC,EAAE;AAC7B,QAAQ,MAAM,EAAE,GAAGA,eAAS,CAAC,CAAC,CAAC;AAC/B,QAAQ,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE;AACzC,YAAY,OAAO,EAAE;AACrB,QAAQ;AACR,QAAQ,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE;AACzC,YAAY,OAAO,EAAE;AACrB,QAAQ;AACR,QAAQP,qBAAc,CAAC,EAAE,IAAI,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;AACxD;AACA,QAAQ,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/signing-key.d.ts b/lib.commonjs/crypto/signing-key.d.ts index a030dac26..3ce0c2ea0 100644 --- a/lib.commonjs/crypto/signing-key.d.ts +++ b/lib.commonjs/crypto/signing-key.d.ts @@ -19,73 +19,17 @@ export declare class SigningKey { * The private key. */ get privateKey(): string; - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ + /** The 57-byte Ed448 public key encoded as hex. */ get publicKey(): string; - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ + /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ get compressedPublicKey(): string; /** * Return the signature of the signed %%digest%%. */ sign(digest: BytesLike): string; - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ + /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ computeSharedSecret(other: BytesLike): string; - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ + /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ static computePublicKey(key: BytesLike, compressed?: boolean): string; /** * Returns the public key for the private key which produced the @@ -106,16 +50,7 @@ export declare class SigningKey { * */ static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string; - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ + /** Adds two encoded Ed448 public points. The compression flag is ignored. */ static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string; } //# sourceMappingURL=signing-key.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/signing-key.d.ts.map b/lib.commonjs/crypto/signing-key.d.ts.map index b5aea9127..1185a52a8 100644 --- a/lib.commonjs/crypto/signing-key.d.ts.map +++ b/lib.commonjs/crypto/signing-key.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAYhD;;;GAGG;AACH,qBAAa,UAAU;;IAGrB;;OAEG;gBACS,UAAU,EAAE,SAAS;IAcjC;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;;;;OAKG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;;;;OAMG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM;IAmC/B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAU7C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;IAkBrE;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM;IAqB5E;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;CAS7E"} \ No newline at end of file +{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD;;;GAGG;AACH,qBAAa,UAAU;;IAGtB;;OAEG;IACH,YAAY,UAAU,EAAE,SAAS,EAYhC;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,mDAAmD;IACnD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,sEAAsE;IACtE,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAiC9B;IAED,uGAAuG;IACvG,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAgB5C;IAED,gGAAgG;IAChG,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAgBpE;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAmB3E;IAED,6EAA6E;IAC7E,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAY3E;CACD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/signing-key.js b/lib.commonjs/crypto/signing-key.js index d819085d9..8d03db6c2 100644 --- a/lib.commonjs/crypto/signing-key.js +++ b/lib.commonjs/crypto/signing-key.js @@ -1,21 +1,26 @@ -"use strict"; +'use strict'; + +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var logger$1 = require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var ed448 = require('./ed448.js'); +var buffer = require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); + /** * Add details about signing here. * * @_subsection: api/crypto:Signing [about-signing] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SigningKey = void 0; -const tslib_1 = require("tslib"); -const secp256k1 = tslib_1.__importStar(require("@noble/secp256k1")); -const index_js_1 = require("../utils/index.js"); -const data_js_1 = require("../utils/data.js"); -const logger_js_1 = require("../logger/logger.js"); -const crypto_js_1 = require("./crypto.js"); -const buffer_1 = require("buffer"); -const logger = new logger_js_1.Logger("signing-key/0.0.1"); -//const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -// Make noble-secp256k1 sync +const logger = new logger$1.Logger("signing-key/0.0.1"); /** * A **SigningKey** provides high-level access to the elliptic curve * cryptography (ECC) operations and key management. @@ -26,12 +31,11 @@ class SigningKey { * Creates a new **SigningKey** for %%privateKey%%. */ constructor(privateKey) { - let tmp = privateKey; - if (typeof tmp === "string" && tmp.startsWith("0x")) { - tmp = tmp.replace("0x", ""); - } - (0, index_js_1.assertArgument)((0, index_js_1.dataLength)("0x" + tmp) === 57, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = (0, index_js_1.hexlify)("0x" + tmp); + const normalized = typeof privateKey === "string" && !privateKey.startsWith("0x") + ? "0x" + privateKey + : privateKey; + errors.assertArgument(data.dataLength(normalized) === 57, "invalid private key", "privateKey", "[REDACTED]"); + this.#privateKey = data.hexlify(normalized); } /** * The private key. @@ -39,22 +43,11 @@ class SigningKey { get privateKey() { return this.#privateKey; } - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ + /** The 57-byte Ed448 public key encoded as hex. */ get publicKey() { return SigningKey.computePublicKey(this.#privateKey); } - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ + /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); } @@ -62,13 +55,13 @@ class SigningKey { * Return the signature of the signed %%digest%%. */ sign(digest) { - const key = (0, index_js_1.getBytesCopy)(this.#privateKey); - (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(digest) === 32, "invalid digest length", "digest", digest); - const keyBuffer = new Uint8Array((0, data_js_1.arrayify)(key)); + const key = data.getBytesCopy(this.#privateKey); + errors.assertArgument(data.dataLength(digest) === 32, "invalid digest length", "digest", digest); + const keyBuffer = new Uint8Array(data.arrayify(key)); if (keyBuffer.length !== 57) { logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); } - const digestBuffer = new Uint8Array((0, data_js_1.arrayify)(digest)); + const digestBuffer = new Uint8Array(data.arrayify(digest)); if (digestBuffer.length !== 32) { logger.throwArgumentError("bad digest length", "digest", digest); } @@ -78,70 +71,33 @@ class SigningKey { prefix[55] |= 0x80; prefix[56] = 0; const scalar = prefix.slice(0, 56); - const bufferDigest = buffer_1.Buffer.from(digestBuffer); - const bufferPrfx = buffer_1.Buffer.from(prefix); - const bufferScalar = buffer_1.Buffer.from(scalar); - const sig = crypto_js_1.ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); - const hexlified = (0, index_js_1.hexlify)(sig); - return (0, data_js_1.hexConcat)([hexlified, this.publicKey]); + const bufferDigest = buffer.Buffer.from(digestBuffer); + const bufferPrfx = buffer.Buffer.from(prefix); + const bufferScalar = buffer.Buffer.from(scalar); + const sig = ed448.default.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); + const hexlified = data.hexlify(sig); + return data.hexConcat([hexlified, this.publicKey]); } - const sig = crypto_js_1.ed448.sign(buffer_1.Buffer.from(digestBuffer), buffer_1.Buffer.from(keyBuffer)); - const hexlified = (0, index_js_1.hexlify)(sig); - return (0, data_js_1.hexConcat)([hexlified, this.publicKey]); + const sig = ed448.default.sign(buffer.Buffer.from(digestBuffer), buffer.Buffer.from(keyBuffer)); + const hexlified = data.hexlify(sig); + return data.hexConcat([hexlified, this.publicKey]); } - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ + /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ computeSharedSecret(other) { - const pubKey = SigningKey.computePublicKey(other); - return (0, index_js_1.hexlify)(secp256k1.getSharedSecret((0, index_js_1.getBytesCopy)(this.#privateKey), (0, index_js_1.getBytes)(pubKey))); + const pub = buffer.Buffer.from(data.getBytesCopy(other)); + errors.assertArgument(pub.length === 57 && ed448.default.publicKeyVerify(pub), "invalid public key", "other", other); + const key = buffer.Buffer.from(data.getBytesCopy(this.#privateKey)); + if (key[56] > 127) { + const scalar = key.subarray(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + return data.hexlify(ed448.default.deriveWithScalar(pub, scalar)); + } + return data.hexlify(ed448.default.derive(pub, key)); } - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ + /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ static computePublicKey(key, compressed) { - const bytes = buffer_1.Buffer.from((0, data_js_1.arrayify)(key)); + const bytes = buffer.Buffer.from(data.arrayify(key)); if (bytes.length !== 57) { logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); } @@ -149,11 +105,11 @@ class SigningKey { const scalar = bytes.slice(0, 56); scalar[0] &= 0xfc; scalar[55] |= 0x80; - const pub = crypto_js_1.ed448.publicKeyFromScalar(scalar); - return (0, index_js_1.hexlify)(pub); + const pub = ed448.default.publicKeyFromScalar(scalar); + return data.hexlify(pub); } - const pub = crypto_js_1.ed448.publicKeyCreate(bytes); - return (0, index_js_1.hexlify)(pub); + const pub = ed448.default.publicKeyCreate(bytes); + return data.hexlify(pub); } /** * Returns the public key for the private key which produced the @@ -174,35 +130,30 @@ class SigningKey { * */ static recoverPublicKey(digest, signature) { - (0, index_js_1.assertArgument)((0, index_js_1.dataLength)(digest) === 32, "invalid digest length", "digest", digest); - const digestBuffer = buffer_1.Buffer.from((0, data_js_1.arrayify)(digest)); - const sigBuffer = buffer_1.Buffer.from((0, data_js_1.arrayify)(signature)); + errors.assertArgument(data.dataLength(digest) === 32, "invalid digest length", "digest", digest); + const digestBuffer = buffer.Buffer.from(data.arrayify(digest)); + const sigBuffer = buffer.Buffer.from(data.arrayify(signature)); if (sigBuffer.length !== 171) { logger.throwArgumentError("invalid signature", "signature", signature); } const sig = sigBuffer.slice(0, 114); const pub = sigBuffer.slice(114); - if (crypto_js_1.ed448.verify(digestBuffer, sig, pub)) { - return (0, index_js_1.hexlify)(pub); + if (ed448.default.verify(digestBuffer, sig, pub)) { + return data.hexlify(pub); } logger.throwArgumentError("invalid signature", "signature", signature); return ""; } - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ + /** Adds two encoded Ed448 public points. The compression flag is ignored. */ static addPoints(p0, p1, compressed) { - const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2)); - const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed); + const points = [p0, p1].map((point) => { + const bytes = buffer.Buffer.from(data.getBytesCopy(point)); + errors.assertArgument(bytes.length === 57 && ed448.default.publicKeyVerify(bytes), "invalid public key", "point", point); + return bytes; + }); + return data.hexlify(ed448.default.publicKeyCombine(points)); } } + exports.SigningKey = SigningKey; -//# sourceMappingURL=signing-key.js.map \ No newline at end of file +//# sourceMappingURL=signing-key.js.map diff --git a/lib.commonjs/crypto/signing-key.js.map b/lib.commonjs/crypto/signing-key.js.map index 8d36adb76..58d1a543d 100644 --- a/lib.commonjs/crypto/signing-key.js.map +++ b/lib.commonjs/crypto/signing-key.js.map @@ -1 +1 @@ -{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;AAEH,oEAA8C;AAE9C,gDAM2B;AAK3B,8CAAuD;AACvD,mDAA6C;AAC7C,2CAAoC;AACpC,mCAAgC;AAEhC,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,mBAAmB,CAAC,CAAC;AAE/C,yFAAyF;AAEzF,4BAA4B;AAE5B;;;GAGG;AACH,MAAa,UAAU;IACrB,WAAW,CAAS;IAEpB;;OAEG;IACH,YAAY,UAAqB;QAC/B,IAAI,GAAG,GAAC,UAAU,CAAA;QAClB,IAAG,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAC;YACjD,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EA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MAAM,CAAC,CAAC,CAAC;QACnD,MAAM,SAAS,GAAG,eAAM,CAAC,IAAI,CAAC,IAAA,kBAAQ,EAAC,SAAS,CAAC,CAAC,CAAC;QACnD,IAAI,SAAS,CAAC,MAAM,KAAK,GAAG,EAAE;YAC5B,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;SACxE;QACD,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACpC,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,iBAAK,CAAC,MAAM,CAAC,YAAY,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE;YACxC,OAAO,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC;SACrB;QACD,MAAM,CAAC,kBAAkB,CAAC,mBAAmB,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QACvE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAa,EAAE,EAAa,EAAE,UAAoB;QACjE,MAAM,IAAI,GAAG,SAAS,CAAC,eAAe,CAAC,OAAO,CAC5C,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAC7C,CAAC;QACF,MAAM,IAAI,GAAG,SAAS,CAAC,eAAe,CAAC,OAAO,CAC5C,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAC7C,CAAC;QACF,OAAO,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;CACF;AA3ND,gCA2NC"} \ No newline at end of file +{"version":3,"file":"signing-key.js","sources":["../../lib.esm/crypto/signing-key.js"],"sourcesContent":["/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport { dataLength, getBytesCopy, hexlify, assertArgument, } from \"../utils/index.js\";\nimport { arrayify, hexConcat } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { ed448 } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"signing-key/0.0.1\");\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 const normalized = typeof privateKey === \"string\" && !privateKey.startsWith(\"0x\")\n ? \"0x\" + privateKey\n : privateKey;\n assertArgument(dataLength(normalized) === 57, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(normalized);\n }\n /**\n * The private key.\n */\n get privateKey() {\n return this.#privateKey;\n }\n /** The 57-byte Ed448 public key encoded as hex. */\n get publicKey() {\n return SigningKey.computePublicKey(this.#privateKey);\n }\n /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */\n get compressedPublicKey() {\n return SigningKey.computePublicKey(this.#privateKey, true);\n }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n const key = getBytesCopy(this.#privateKey);\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const keyBuffer = new Uint8Array(arrayify(key));\n if (keyBuffer.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n const digestBuffer = new Uint8Array(arrayify(digest));\n if (digestBuffer.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n if (keyBuffer[56] > 127) {\n const prefix = keyBuffer.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[55] |= 0x80;\n prefix[56] = 0;\n const scalar = prefix.slice(0, 56);\n const bufferDigest = Buffer.from(digestBuffer);\n const bufferPrfx = Buffer.from(prefix);\n const bufferScalar = Buffer.from(scalar);\n const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx);\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer));\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */\n computeSharedSecret(other) {\n const pub = Buffer.from(getBytesCopy(other));\n assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), \"invalid public key\", \"other\", other);\n const key = Buffer.from(getBytesCopy(this.#privateKey));\n if (key[56] > 127) {\n const scalar = key.subarray(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n return hexlify(ed448.deriveWithScalar(pub, scalar));\n }\n return hexlify(ed448.derive(pub, key));\n }\n /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */\n static computePublicKey(key, compressed) {\n const bytes = Buffer.from(arrayify(key));\n if (bytes.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n if (bytes[56] > 127) {\n const scalar = bytes.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n const pub = ed448.publicKeyFromScalar(scalar);\n return hexlify(pub);\n }\n const pub = ed448.publicKeyCreate(bytes);\n return hexlify(pub);\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 digestBuffer = Buffer.from(arrayify(digest));\n const sigBuffer = Buffer.from(arrayify(signature));\n if (sigBuffer.length !== 171) {\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n }\n const sig = sigBuffer.slice(0, 114);\n const pub = sigBuffer.slice(114);\n if (ed448.verify(digestBuffer, sig, pub)) {\n return hexlify(pub);\n }\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n return \"\";\n }\n /** Adds two encoded Ed448 public points. The compression flag is ignored. */\n static addPoints(p0, p1, compressed) {\n const points = [p0, p1].map((point) => {\n const bytes = Buffer.from(getBytesCopy(point));\n assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), \"invalid public key\", \"point\", point);\n return bytes;\n });\n return hexlify(ed448.publicKeyCombine(points));\n }\n}\n//# sourceMappingURL=signing-key.js.map"],"names":["Logger","assertArgument","dataLength","hexlify","getBytesCopy","arrayify","Buffer","ed448","hexConcat"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAMA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,mBAAmB,CAAC;AAC9C;AACA;AACA;AACA;AACO,MAAM,UAAU,CAAC;AACxB,IAAI,WAAW;AACf;AACA;AACA;AACA,IAAI,WAAW,CAAC,UAAU,EAAE;AAC5B,QAAQ,MAAM,UAAU,GAAG,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI;AACxF,cAAc,IAAI,GAAG;AACrB,cAAc,UAAU;AACxB,QAAQC,qBAAc,CAACC,eAAU,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,CAAC;AACxG,QAAQ,IAAI,CAAC,WAAW,GAAGC,YAAO,CAAC,UAAU,CAAC;AAC9C,IAAI;AACJ;AACA;AACA;AACA,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW;AAC/B,IAAI;AACJ;AACA,IAAI,IAAI,SAAS,GAAG;AACpB,QAAQ,OAAO,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,W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E,KAAK,CAAC;AACrH,YAAY,OAAO,KAAK;AACxB,QAAQ,CAAC,CAAC;AACV,QAAQ,OAAOJ,YAAO,CAACI,aAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACtD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/hash/id.js b/lib.commonjs/hash/id.js index 1f1489c37..f0bfb4d35 100644 --- a/lib.commonjs/hash/id.js +++ b/lib.commonjs/hash/id.js @@ -1,9 +1,17 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.id = void 0; -const keccak_js_1 = require("../crypto/keccak.js"); -const sha3_js_1 = require("../crypto/sha3.js"); -const index_js_1 = require("../utils/index.js"); +'use strict'; + +var keccak = require('../crypto/keccak.js'); +var sha3 = require('../crypto/sha3.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +var utf8 = require('../utils/utf8.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + /** * A simple hashing function which operates on UTF-8 strings to * compute an 32-byte identifier. @@ -15,9 +23,10 @@ const index_js_1 = require("../utils/index.js"); */ function id(value, useKeccak) { if (useKeccak) { - return (0, keccak_js_1.keccak256)((0, index_js_1.toUtf8Bytes)(value)); + return keccak.keccak256(utf8.toUtf8Bytes(value)); } - return (0, sha3_js_1.sha256)((0, index_js_1.toUtf8Bytes)(value)); + return sha3.sha256(utf8.toUtf8Bytes(value)); } + exports.id = id; -//# sourceMappingURL=id.js.map \ No newline at end of file +//# sourceMappingURL=id.js.map diff --git a/lib.commonjs/hash/id.js.map b/lib.commonjs/hash/id.js.map index 129cf8f51..93d75d68e 100644 --- a/lib.commonjs/hash/id.js.map +++ b/lib.commonjs/hash/id.js.map @@ -1 +1 @@ -{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAChD,+CAA2C;AAC3C,gDAAgD;AAEhD;;;;;;;;GAQG;AACH,SAAgB,EAAE,CAAC,KAAa,EAAE,SAAmB;IACnD,IAAI,SAAS,EAAE;QACb,OAAO,IAAA,qBAAS,EAAC,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC,CAAC;KACtC;IACD,OAAO,IAAA,gBAAM,EAAC,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC,CAAC;AACpC,CAAC;AALD,gBAKC"} \ No newline at end of file +{"version":3,"file":"id.js","sources":["../../lib.esm/hash/id.js"],"sourcesContent":["import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.js.map"],"names":["keccak256","toUtf8Bytes","sha256"],"mappings":";;;;;;;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE;AACrC,IAAI,IAAI,SAAS,EAAE;AACnB,QAAQ,OAAOA,gBAAS,CAACC,gBAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,IAAI;AACJ,IAAI,OAAOC,WAAM,CAACD,gBAAW,CAAC,KAAK,CAAC,CAAC;AACrC;;"} \ No newline at end of file diff --git a/lib.commonjs/hash/index.js b/lib.commonjs/hash/index.js index 8ce260a85..cfb8541ba 100644 --- a/lib.commonjs/hash/index.js +++ b/lib.commonjs/hash/index.js @@ -1,20 +1,17 @@ -"use strict"; -/** - * About hashing here... - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.verifyTypedData = exports.TypedDataEncoder = exports.solidityPackedSha256 = exports.solidityPacked = exports.verifyMessage = exports.hashMessage = exports.id = void 0; -var id_js_1 = require("./id.js"); -Object.defineProperty(exports, "id", { enumerable: true, get: function () { return id_js_1.id; } }); -var message_js_1 = require("./message.js"); -Object.defineProperty(exports, "hashMessage", { enumerable: true, get: function () { return message_js_1.hashMessage; } }); -Object.defineProperty(exports, "verifyMessage", { enumerable: true, get: function () { return message_js_1.verifyMessage; } }); -var solidity_js_1 = require("./solidity.js"); -Object.defineProperty(exports, "solidityPacked", { enumerable: true, get: function () { return solidity_js_1.solidityPacked; } }); -Object.defineProperty(exports, "solidityPackedSha256", { enumerable: true, get: function () { return solidity_js_1.solidityPackedSha256; } }); -var typed_data_js_1 = require("./typed-data.js"); -Object.defineProperty(exports, "TypedDataEncoder", { enumerable: true, get: function () { return typed_data_js_1.TypedDataEncoder; } }); -Object.defineProperty(exports, "verifyTypedData", { enumerable: true, get: function () { return typed_data_js_1.verifyTypedData; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var id = require('./id.js'); +var message = require('./message.js'); +var solidity = require('./solidity.js'); +var typedData = require('./typed-data.js'); + + + +exports.id = id.id; +exports.hashMessage = message.hashMessage; +exports.verifyMessage = message.verifyMessage; +exports.solidityPacked = solidity.solidityPacked; +exports.solidityPackedSha256 = solidity.solidityPackedSha256; +exports.TypedDataEncoder = typedData.TypedDataEncoder; +exports.verifyTypedData = typedData.verifyTypedData; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/hash/index.js.map b/lib.commonjs/hash/index.js.map index 7d729b70d..c290a0fe8 100644 --- a/lib.commonjs/hash/index.js.map +++ b/lib.commonjs/hash/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,iCAA6B;AAApB,2FAAA,EAAE,OAAA;AACX,2CAA0D;AAAjD,yGAAA,WAAW,OAAA;AAAE,2GAAA,aAAa,OAAA;AACnC,6CAAqE;AAA5D,6GAAA,cAAc,OAAA;AAAE,mHAAA,oBAAoB,OAAA;AAC7C,iDAAoE;AAA3D,iHAAA,gBAAgB,OAAA;AAAE,gHAAA,eAAe,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/hash/message.d.ts.map b/lib.commonjs/hash/message.d.ts.map index 76c7dfa70..8c0421a97 100644 --- a/lib.commonjs/hash/message.d.ts.map +++ b/lib.commonjs/hash/message.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAWhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAGR"} \ No newline at end of file +{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAWhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,GACZ,MAAM,CAGR"} \ No newline at end of file diff --git a/lib.commonjs/hash/message.js b/lib.commonjs/hash/message.js index 4fcc140a5..b7090a9ac 100644 --- a/lib.commonjs/hash/message.js +++ b/lib.commonjs/hash/message.js @@ -1,10 +1,34 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.verifyMessage = exports.hashMessage = void 0; -const index_js_1 = require("../constants/index.js"); -const index_js_2 = require("../transaction/index.js"); -const index_js_3 = require("../utils/index.js"); -const index_js_4 = require("../crypto/index.js"); +'use strict'; + +require('../constants/numbers.js'); +var strings = require('../constants/strings.js'); +require('../address/index.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +require('../utils/errors.js'); +require('../logger/logger.js'); +var utf8 = require('../utils/utf8.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var address = require('../transaction/address.js'); +require('../transaction/transaction.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +var sha3 = require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../crypto/signature.js'); + /** * Computes the [[link-eip-191]] personal-sign message digest to sign. * @@ -33,22 +57,23 @@ const index_js_4 = require("../crypto/index.js"); */ function hashMessage(message) { if (typeof message === "string") { - message = (0, index_js_3.toUtf8Bytes)(message); + message = utf8.toUtf8Bytes(message); } - return (0, index_js_4.sha256)((0, index_js_3.concat)([ - (0, index_js_3.toUtf8Bytes)(index_js_1.MessagePrefix), - (0, index_js_3.toUtf8Bytes)(String(message.length)), + return sha3.sha256(data.concat([ + utf8.toUtf8Bytes(strings.MessagePrefix), + utf8.toUtf8Bytes(String(message.length)), message, ])); } -exports.hashMessage = hashMessage; /** * Return the address of the private key that produced * the signature %%sig%% during signing for %%message%%. */ function verifyMessage(message, sig, prefix) { const digest = hashMessage(message); - return (0, index_js_2.recoverAddress)(digest, sig, prefix); + return address.recoverAddress(digest, sig, prefix); } + +exports.hashMessage = hashMessage; exports.verifyMessage = verifyMessage; -//# sourceMappingURL=message.js.map \ No newline at end of file +//# sourceMappingURL=message.js.map diff --git a/lib.commonjs/hash/message.js.map b/lib.commonjs/hash/message.js.map index 479763109..bc8a80bbb 100644 --- a/lib.commonjs/hash/message.js.map +++ b/lib.commonjs/hash/message.js.map @@ -1 +1 @@ -{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":";;;AAAA,oDAAsD;AACtD,sDAAyD;AACzD,gDAAwD;AAExD,iDAA2D;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,WAAW,CAAC,OAA4B;IACtD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO,GAAG,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC;KAChC;IACD,OAAO,IAAA,iBAAM,EACX,IAAA,iBAAM,EAAC;QACL,IAAA,sBAAW,EAAC,wBAAa,CAAC;QAC1B,IAAA,sBAAW,EAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO;KACR,CAAC,CACH,CAAC;AACJ,CAAC;AAXD,kCAWC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAC3B,OAA4B,EAC5B,GAAkB,EAClB,MAAc;IAEd,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,IAAA,yBAAc,EAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC;AAPD,sCAOC"} \ No newline at end of file +{"version":3,"file":"message.js","sources":["../../lib.esm/hash/message.js"],"sourcesContent":["import { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof message === \"string\") {\n message = toUtf8Bytes(message);\n }\n return sha256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message,\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig, prefix) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig, prefix);\n}\n//# sourceMappingURL=message.js.map"],"names":["toUtf8Bytes","sha256","concat","MessagePrefix","recoverAddress"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,OAAO,EAAE;AACrC,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACrC,QAAQ,OAAO,GAAGA,gBAAW,CAAC,OAAO,CAAC;AACtC,IAAI;AACJ,IAAI,OAAOC,WAAM,CAACC,WAAM,CAAC;AACzB,QAAQF,gBAAW,CAACG,qBAAa,CAAC;AAClC,QAAQH,gBAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3C,QAAQ,OAAO;AACf,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE;AACpD,IAAI,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;AACvC,IAAI,OAAOI,sBAAc,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC;AAC9C;;;"} \ No newline at end of file diff --git a/lib.commonjs/hash/solidity.d.ts.map b/lib.commonjs/hash/solidity.d.ts.map index 251b44140..8a06af8f2 100644 --- a/lib.commonjs/hash/solidity.d.ts.map +++ b/lib.commonjs/hash/solidity.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACzB,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACzB,MAAM,CAER"} \ No newline at end of file +{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAER"} \ No newline at end of file diff --git a/lib.commonjs/hash/solidity.js b/lib.commonjs/hash/solidity.js index 3667dcd00..1994777d8 100644 --- a/lib.commonjs/hash/solidity.js +++ b/lib.commonjs/hash/solidity.js @@ -1,9 +1,30 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.solidityPackedSha256 = exports.solidityPacked = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../utils/index.js"); +'use strict'; + +var index = require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +var sha3 = require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +var utf8 = require('../utils/utf8.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +require('../crypto/signature.js'); + const regexBytes = new RegExp("^bytes([0-9]+)$"); const regexNumber = new RegExp("^(u?int)([0-9]*)$"); const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); @@ -11,25 +32,25 @@ function _pack(type, value, isArray) { switch (type) { case "address": if (isArray) { - return (0, index_js_3.getBytes)((0, index_js_3.zeroPadValue)(value, 32)); + return data.getBytes(data.zeroPadValue(value, 32)); } - return (0, index_js_3.getBytes)((0, index_js_1.getAddress)(value)); + return data.getBytes(index.getAddress(value)); case "string": - return (0, index_js_3.toUtf8Bytes)(value); + return utf8.toUtf8Bytes(value); case "bytes": - return (0, index_js_3.getBytes)(value); + return data.getBytes(value); case "bool": value = !!value ? "0x01" : "0x00"; if (isArray) { - return (0, index_js_3.getBytes)((0, index_js_3.zeroPadValue)(value, 32)); + return data.getBytes(data.zeroPadValue(value, 32)); } - return (0, index_js_3.getBytes)(value); + return data.getBytes(value); } let match = type.match(regexNumber); if (match) { let signed = match[1] === "int"; let size = parseInt(match[2] || "256"); - (0, index_js_3.assertArgument)((!match[2] || match[2] === String(size)) && + errors.assertArgument((!match[2] || match[2] === String(size)) && size % 8 === 0 && size !== 0 && size <= 256, "invalid number type", "type", type); @@ -37,17 +58,17 @@ function _pack(type, value, isArray) { size = 256; } if (signed) { - value = (0, index_js_3.toTwos)(value, size); + value = maths.toTwos(value, size); } - return (0, index_js_3.getBytes)((0, index_js_3.zeroPadValue)((0, index_js_3.toBeArray)(value), size / 8)); + return data.getBytes(data.zeroPadValue(maths.toBeArray(value), size / 8)); } match = type.match(regexBytes); if (match) { const size = parseInt(match[1]); - (0, index_js_3.assertArgument)(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - (0, index_js_3.assertArgument)((0, index_js_3.dataLength)(value) === size, `invalid value for ${type}`, "value", value); + errors.assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); + errors.assertArgument(data.dataLength(value) === size, `invalid value for ${type}`, "value", value); if (isArray) { - return (0, index_js_3.getBytes)((0, index_js_3.zeroPadBytes)(value, 32)); + return data.getBytes(data.zeroPadBytes(value, 32)); } return value; } @@ -55,14 +76,14 @@ function _pack(type, value, isArray) { if (match && Array.isArray(value)) { const baseType = match[1]; const count = parseInt(match[2] || String(value.length)); - (0, index_js_3.assertArgument)(count === value.length, `invalid array length for ${type}`, "value", value); + errors.assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); const result = []; value.forEach(function (value) { result.push(_pack(baseType, value, true)); }); - return (0, index_js_3.getBytes)((0, index_js_3.concat)(result)); + return data.getBytes(data.concat(result)); } - (0, index_js_3.assertArgument)(false, "invalid type", "type", type); + errors.assertArgument(false, "invalid type", "type", type); } // @TODO: Array Enum /** @@ -75,14 +96,13 @@ function _pack(type, value, isArray) { * //_result: */ function solidityPacked(types, values) { - (0, index_js_3.assertArgument)(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); + errors.assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); const tight = []; types.forEach(function (type, index) { tight.push(_pack(type, values[index])); }); - return (0, index_js_3.hexlify)((0, index_js_3.concat)(tight)); + return data.hexlify(data.concat(tight)); } -exports.solidityPacked = solidityPacked; /** * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% * respectively to their %%types%%. @@ -93,7 +113,9 @@ exports.solidityPacked = solidityPacked; * //_result: */ function solidityPackedSha256(types, values) { - return (0, index_js_2.sha256)(solidityPacked(types, values)); + return sha3.sha256(solidityPacked(types, values)); } + +exports.solidityPacked = solidityPacked; exports.solidityPackedSha256 = solidityPackedSha256; -//# sourceMappingURL=solidity.js.map \ No newline at end of file +//# sourceMappingURL=solidity.js.map diff --git a/lib.commonjs/hash/solidity.js.map b/lib.commonjs/hash/solidity.js.map index bd70a7127..4907fcfa1 100644 --- a/lib.commonjs/hash/solidity.js.map +++ b/lib.commonjs/hash/solidity.js.map @@ -1 +1 @@ -{"version":3,"file":"solidity.js","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,iDAAuD;AACvD,gDAW2B;AAE3B,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACpD,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAEtD,SAAS,KAAK,CAAC,IAAY,EAAE,KAAU,EAAE,OAAiB;IACxD,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,IAAI,OAAO,EAAE;gBACX,OAAO,IAAA,mBAAQ,EAAC,IAAA,uBAAY,EAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;aAC1C;YACD,OAAO,IAAA,mBAAQ,EAAC,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC,CAAC;QACrC,KAAK,QAAQ;YACX,OAAO,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC;QAC5B,KAAK,OAAO;YACV,OAAO,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC;QACzB,KAA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pB;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC5B,KAA4B,EAC5B,MAA0B;IAE1B,IAAA,yBAAc,EACZ,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAC9B,oDAAoD,EACpD,QAAQ,EACR,MAAM,CACP,CAAC;IAEF,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,KAAK,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,KAAK;QACjC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IACH,OAAO,IAAA,kBAAO,EAAC,IAAA,iBAAM,EAAC,KAAK,CAAC,CAAC,CAAC;AAChC,CAAC;AAhBD,wCAgBC;AAED;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAClC,KAA4B,EAC5B,MAA0B;IAE1B,OAAO,IAAA,iBAAO,EAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAChD,CAAC;AALD,oDAKC"} \ No newline at end of file +{"version":3,"file":"solidity.js","sources":["../../lib.esm/hash/solidity.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument, } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = !!value ? \"0x01\" : \"0x00\";\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = match[1] === \"int\";\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) &&\n size % 8 === 0 &&\n size !== 0 &&\n size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map"],"names":["getBytes","zeroPadValue","getAddress","toUtf8Bytes","assertArgument","toTwos","toBeArray","dataLength","zeroPadBytes","concat","hexlify","_sha256"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC;AAChD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC;AACnD,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,sBAAsB,CAAC;AACrD,SAAS,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE;AACrC,IAAI,QAAQ,IAAI;AAChB,QAAQ,KAAK,SAAS;AACtB,YAAY,IAAI,OAAO,EAAE;AACzB,gBAAgB,OAAOA,aAAQ,CAACC,iBAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACxD,YAAY;AACZ,YAAY,OAAOD,aAAQ,CAACE,gBAAU,CAAC,KAAK,CAAC,CAAC;AAC9C,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAOC,gBAAW,CAAC,KAAK,CAAC;AACrC,QAAQ,KAAK,OAAO;AACpB,YAAY,OAAOH,aAAQ,CAAC,KAAK,CAAC;AAClC,QAAQ,KAAK,MAAM;AACnB,YAAY,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM;AAC7C,YAAY,IAAI,OAAO,EAAE;AACzB,gBAAgB,OAAOA,aAAQ,CAACC,iBAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACxD,YAAY;AACZ,YAAY,OAAOD,aAAQ,CAAC,KAAK,CAAC;AAClC;AACA,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;AACvC,IAAI,IAAI,KAAK,EAAE;AACf,QAAQ,IAAI,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK;AACvC,QAAQ,IAAI,IAAI,GAAG,QA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C,CAAC;AAC9C,IAAI,CAAC,CAAC;AACN,IAAI,OAAOM,YAAO,CAACD,WAAM,CAAC,KAAK,CAAC,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE;AACpD,IAAI,OAAOE,WAAO,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACjD;;;"} \ No newline at end of file diff --git a/lib.commonjs/hash/typed-data.d.ts.map b/lib.commonjs/hash/typed-data.d.ts.map index fc4135d06..27a189723 100644 --- a/lib.commonjs/hash/typed-data.d.ts.map +++ b/lib.commonjs/hash/typed-data.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"typed-data.d.ts","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAYjE,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAChC,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAqKD,qBAAa,gBAAgB;;IAC3B,QAAQ,CAAC,WAAW,EAAG,MAAM,CAAC;IAG9B,IAAI,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAEjD;gBAMW,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IA8HxD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,C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EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAC5C,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC,CAoDlD;IAED,MAAM,CAAC,UAAU,CAChB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,GAAG,CAiEL;CACD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,MAAM,CAMR"} \ No newline at end of file diff --git a/lib.commonjs/hash/typed-data.js b/lib.commonjs/hash/typed-data.js index 5b41d37ec..66b24a7e9 100644 --- a/lib.commonjs/hash/typed-data.js +++ b/lib.commonjs/hash/typed-data.js @@ -1,11 +1,33 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.verifyTypedData = exports.TypedDataEncoder = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../transaction/index.js"); -const index_js_3 = require("../utils/index.js"); -const id_js_1 = require("./id.js"); -const index_js_4 = require("../crypto/index.js"); +'use strict'; + +var index = require('../address/index.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +var address = require('../transaction/address.js'); +require('../transaction/transaction.js'); +var id = require('./id.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +var sha3 = require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../logger/logger.js'); +require('../crypto/signature.js'); + const padding = new Uint8Array(32); padding.fill(0); const BN__1 = BigInt(-1); @@ -13,15 +35,15 @@ const BN_0 = BigInt(0); const BN_1 = BigInt(1); const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); function hexPadRight(value) { - const bytes = (0, index_js_3.getBytes)(value); + const bytes = data.getBytes(value); const padOffset = bytes.length % 32; if (padOffset) { - return (0, index_js_3.concat)([bytes, padding.slice(padOffset)]); + return data.concat([bytes, padding.slice(padOffset)]); } - return (0, index_js_3.hexlify)(bytes); + return data.hexlify(bytes); } -const hexTrue = (0, index_js_3.toBeHex)(BN_1, 32); -const hexFalse = (0, index_js_3.toBeHex)(BN_0, 32); +const hexTrue = maths.toBeHex(BN_1, 32); +const hexFalse = maths.toBeHex(BN_0, 32); const domainFieldTypes = { name: "string", version: "string", @@ -38,7 +60,7 @@ const domainFieldNames = [ ]; function checkString(key) { return function (value) { - (0, index_js_3.assertArgument)(typeof value === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); + errors.assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); return value; }; } @@ -46,24 +68,24 @@ const domainChecks = { name: checkString("name"), version: checkString("version"), networkId: function (_value) { - const value = (0, index_js_3.getBigInt)(_value, "domain.networkId"); - (0, index_js_3.assertArgument)(value >= 0, "invalid chain ID", "domain.networkId", _value); + const value = maths.getBigInt(_value, "domain.networkId"); + errors.assertArgument(value >= 0, "invalid chain ID", "domain.networkId", _value); if (Number.isSafeInteger(value)) { return Number(value); } - return (0, index_js_3.toQuantity)(value); + return maths.toQuantity(value); }, verifyingContract: function (value) { try { - return (0, index_js_1.getAddress)(value).toLowerCase(); + return index.getAddress(value).toLowerCase(); } catch (error) { } - (0, index_js_3.assertArgument)(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); + errors.assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); }, salt: function (value) { - const bytes = (0, index_js_3.getBytes)(value, "domain.salt"); - (0, index_js_3.assertArgument)(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return (0, index_js_3.hexlify)(bytes); + const bytes = data.getBytes(value, "domain.salt"); + errors.assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); + return data.hexlify(bytes); }, }; function getBaseEncoder(type) { @@ -73,16 +95,16 @@ function getBaseEncoder(type) { if (match) { const signed = match[1] === ""; const width = parseInt(match[2] || "256"); - (0, index_js_3.assertArgument)(width % 8 === 0 && + errors.assertArgument(width % 8 === 0 && width !== 0 && width <= 256 && (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type); - const boundsUpper = (0, index_js_3.mask)(BN_MAX_UINT256, signed ? width - 1 : width); + const boundsUpper = maths.mask(BN_MAX_UINT256, signed ? width - 1 : width); const boundsLower = signed ? (boundsUpper + BN_1) * BN__1 : BN_0; return function (_value) { - const value = (0, index_js_3.getBigInt)(_value, "value"); - (0, index_js_3.assertArgument)(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return (0, index_js_3.toBeHex)(signed ? (0, index_js_3.toTwos)(value, 256) : value, 32); + const value = maths.getBigInt(_value, "value"); + errors.assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); + return maths.toBeHex(signed ? maths.toTwos(value, 256) : value, 32); }; } } @@ -91,10 +113,10 @@ function getBaseEncoder(type) { const match = type.match(/^bytes(\d+)$/); if (match) { const width = parseInt(match[1]); - (0, index_js_3.assertArgument)(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); + errors.assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); return function (value) { - const bytes = (0, index_js_3.getBytes)(value); - (0, index_js_3.assertArgument)(bytes.length === width, `invalid length for ${type}`, "value", value); + const bytes = data.getBytes(value); + errors.assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); return hexPadRight(value); }; } @@ -102,7 +124,7 @@ function getBaseEncoder(type) { switch (type) { case "address": return function (value) { - return (0, index_js_3.zeroPadValue)((0, index_js_1.getAddress)(value), 32); + return data.zeroPadValue(index.getAddress(value), 32); }; case "bool": return function (value) { @@ -110,11 +132,11 @@ function getBaseEncoder(type) { }; case "bytes": return function (value) { - return (0, index_js_4.sha256)(value); + return sha3.sha256(value); }; case "string": return function (value) { - return (0, id_js_1.id)(value); + return id.id(value); }; } return null; @@ -151,17 +173,17 @@ class TypedDataEncoder { const uniqueNames = new Set(); for (const field of types[name]) { // Check each field has a unique name - (0, index_js_3.assertArgument)(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types); + errors.assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types); uniqueNames.add(field.name); // Get the base type (drop any array specifiers) const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1] || null; - (0, index_js_3.assertArgument)(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types); + errors.assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types); // Is this a base encoding type? const encoder = getBaseEncoder(baseType); if (encoder) { continue; } - (0, index_js_3.assertArgument)(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types); + errors.assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types); // Add linkage parents.get(baseType).push(name); links.get(name).add(baseType); @@ -169,14 +191,14 @@ class TypedDataEncoder { } // Deduce the primary type const primaryTypes = Array.from(parents.keys()).filter((n) => parents.get(n).length === 0); - (0, index_js_3.assertArgument)(primaryTypes.length !== 0, "missing primary type", "types", types); - (0, index_js_3.assertArgument)(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes + errors.assertArgument(primaryTypes.length !== 0, "missing primary type", "types", types); + errors.assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes .map((t) => JSON.stringify(t)) .join(", ")}`, "types", types); - (0, index_js_3.defineProperties)(this, { primaryType: primaryTypes[0] }); + properties.defineProperties(this, { primaryType: primaryTypes[0] }); // Check for circular type references function checkCircular(type, found) { - (0, index_js_3.assertArgument)(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types); + errors.assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types); found.add(type); for (const child of links.get(type)) { if (!parents.has(child)) { @@ -222,42 +244,42 @@ class TypedDataEncoder { const subtype = match[1]; const subEncoder = this.getEncoder(subtype); return (value) => { - (0, index_js_3.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); + errors.assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); let result = value.map(subEncoder); if (this.#fullTypes.has(subtype)) { - result = result.map(index_js_4.sha256); + result = result.map(sha3.sha256); } - return (0, index_js_4.sha256)((0, index_js_3.concat)(result)); + return sha3.sha256(data.concat(result)); }; } // Struct const fields = this.types[type]; if (fields) { - const encodedType = (0, id_js_1.id)(this.#fullTypes.get(type)); + const encodedType = id.id(this.#fullTypes.get(type)); return (value) => { const values = fields.map(({ name, type }) => { const result = this.getEncoder(type)(value[name]); if (this.#fullTypes.has(type)) { - return (0, index_js_4.sha256)(result); + return sha3.sha256(result); } return result; }); values.unshift(encodedType); - return (0, index_js_3.concat)(values); + return data.concat(values); }; } - (0, index_js_3.assertArgument)(false, `unknown type: ${type}`, "type", type); + errors.assertArgument(false, `unknown type: ${type}`, "type", type); } encodeType(name) { const result = this.#fullTypes.get(name); - (0, index_js_3.assertArgument)(result, `unknown type: ${JSON.stringify(name)}`, "name", name); + errors.assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); return result; } encodeData(type, value) { return this.getEncoder(type)(value); } hashStruct(name, value) { - return (0, index_js_4.sha256)(this.encodeData(name, value)); + return sha3.sha256(this.encodeData(name, value)); } encode(value) { return this.encodeData(this.primaryType, value); @@ -276,7 +298,7 @@ class TypedDataEncoder { // Array const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); if (match) { - (0, index_js_3.assertArgument)(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); + errors.assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); return value.map((v) => this._visit(match[1], v, callback)); } // Struct @@ -287,7 +309,7 @@ class TypedDataEncoder { return accum; }, {}); } - (0, index_js_3.assertArgument)(false, `unknown type: ${type}`, "type", type); + errors.assertArgument(false, `unknown type: ${type}`, "type", type); } visit(value, callback) { return this._visit(this.primaryType, value, callback); @@ -308,7 +330,7 @@ class TypedDataEncoder { continue; } const type = domainFieldTypes[name]; - (0, index_js_3.assertArgument)(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); + errors.assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); domainFields.push({ name, type }); } domainFields.sort((a, b) => { @@ -317,14 +339,14 @@ class TypedDataEncoder { return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); } static encode(domain, types, value) { - return (0, index_js_3.concat)([ + return data.concat([ "0x1901", TypedDataEncoder.hashDomain(domain), TypedDataEncoder.from(types).hash(value), ]); } static hash(domain, types, value) { - return (0, index_js_4.sha256)(TypedDataEncoder.encode(domain, types, value)); + return sha3.sha256(TypedDataEncoder.encode(domain, types, value)); } // Replaces all address types with ENS names with their looked up address static async resolveNames(domain, types, value, resolveName) { @@ -340,14 +362,14 @@ class TypedDataEncoder { const ensCache = {}; // Do we need to look up the domain's verifyingContract? if (domain.verifyingContract && - !(0, index_js_3.isHexString)(domain.verifyingContract, 20)) { + !data.isHexString(domain.verifyingContract, 20)) { ensCache[domain.verifyingContract] = "0x"; } // We are going to use the encoder to visit all the base values const encoder = TypedDataEncoder.from(types); // Get a list of all the addresses encoder.visit(value, (type, value) => { - if (type === "address" && !(0, index_js_3.isHexString)(value, 20)) { + if (type === "address" && !data.isHexString(value, 20)) { ensCache[value] = "0x"; } return value; @@ -385,7 +407,7 @@ class TypedDataEncoder { }); const encoder = TypedDataEncoder.from(types); const typesWithDomain = Object.assign({}, types); - (0, index_js_3.assertArgument)(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); + errors.assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); typesWithDomain.EIP712Domain = domainTypes; // Validate the data structures and types encoder.encode(value); @@ -396,11 +418,11 @@ class TypedDataEncoder { message: encoder.visit(value, (type, value) => { // bytes if (type.match(/^bytes(\d*)/)) { - return (0, index_js_3.hexlify)((0, index_js_3.getBytes)(value)); + return data.hexlify(data.getBytes(value)); } // uint or int if (type.match(/^u?int/)) { - return (0, index_js_3.getBigInt)(value).toString(); + return maths.getBigInt(value).toString(); } switch (type) { case "address": @@ -408,20 +430,21 @@ class TypedDataEncoder { case "bool": return !!value; case "string": - (0, index_js_3.assertArgument)(typeof value === "string", "invalid string", "value", value); + errors.assertArgument(typeof value === "string", "invalid string", "value", value); return value; } - (0, index_js_3.assertArgument)(false, "unsupported type", "type", type); + errors.assertArgument(false, "unsupported type", "type", type); }), }; } } -exports.TypedDataEncoder = TypedDataEncoder; /** * Compute the address used to sign the typed data for the %%signature%%. */ function verifyTypedData(domain, types, value, signature, prefix) { - return (0, index_js_2.recoverAddress)(TypedDataEncoder.hash(domain, types, value), signature, prefix); + return address.recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix); } + +exports.TypedDataEncoder = TypedDataEncoder; exports.verifyTypedData = verifyTypedData; -//# sourceMappingURL=typed-data.js.map \ No newline at end of file +//# sourceMappingURL=typed-data.js.map diff --git a/lib.commonjs/hash/typed-data.js.map b/lib.commonjs/hash/typed-data.js.map index 49aa14550..078a523e3 100644 --- a/lib.commonjs/hash/typed-data.js.map +++ b/lib.commonjs/hash/typed-data.js.map @@ -1 +1 @@ -{"version":3,"file":"typed-data.js","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,sDAAyD;AACzD,gDAa2B;AAE3B,mCAA6B;AAE7B,iDAA4C;AAG5C,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEhB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,cAAc,GAAG,MAAM,CAC3B,oEAAoE,CACrE,CAAC;AAeF,SAAS,WAAW,CAAC,KAAgB;IACnC,MAAM,KAAK,GAAG,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;IACpC,IAAI,SAAS,EAAE;QACb,OAAO,IAAA,iBAAM,EAAC,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAW,CAAC;KAC5D;IACD,OAAO,IAAA,kBAAO,EAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,OAAO,GAAG,IAAA,kBAAO,EAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAClC,MAAM,QAAQ,GAAG,IAAA,kBAAO,EAA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AK,QAAQ;wBACX,IAAA,yBAAc,EACZ,OAAO,KAAK,KAAK,QAAQ,EACzB,gBAAgB,EAChB,OAAO,EACP,KAAK,CACN,CAAC;wBACF,OAAO,KAAK,CAAC;iBAChB;gBAED,IAAA,yBAAc,EAAC,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YAC1D,CAAC,CAAC;SACH,CAAC;IACJ,CAAC;CACF;AAndD,4CAmdC;AAED;;GAEG;AACH,SAAgB,eAAe,CAC7B,MAAuB,EACvB,KAA4C,EAC5C,KAA0B,EAC1B,SAAiB,EACjB,MAAc;IAEd,OAAO,IAAA,yBAAc,EACnB,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,EAC3C,SAAS,EACT,MAAM,CACP,CAAC;AACJ,CAAC;AAZD,0CAYC"} \ No newline at end of file +{"version":3,"file":"typed-data.js","sources":["../../lib.esm/hash/typed-data.js"],"sourcesContent":["import { getAddress } from \"../address/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\";\nimport { sha256 } from \"../crypto/index.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\");\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 networkId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\",\n};\nconst domainFieldNames = [\n \"name\",\n \"version\",\n \"networkId\",\n \"verifyingContract\",\n \"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 networkId: function (_value) {\n const value = getBigInt(_value, \"domain.networkId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.networkId\", _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] || \"256\");\n assertArgument(width % 8 === 0 &&\n width !== 0 &&\n width <= 256 &&\n (match[2] == null || 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\":\n return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\":\n return function (value) {\n return !value ? hexFalse : hexTrue;\n };\n case \"bytes\":\n return function (value) {\n return sha256(value);\n };\n case \"string\":\n return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields\n .map(({ name, type }) => type + \" \" + name)\n .join(\",\")})`;\n}\nexport class TypedDataEncoder {\n primaryType;\n #types;\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n constructor(types) {\n this.#types = JSON.stringify(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 Object.keys(types).forEach((type) => {\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\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 = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1] || null;\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\n .map((t) => JSON.stringify(t))\n .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]) +\n st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(sha256);\n }\n return sha256(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 sha256(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 encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return sha256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n return value.map((v) => this._visit(match[1], 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 visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\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 static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value),\n ]);\n }\n static hash(domain, types, value) {\n return sha256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\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 &&\n !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 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 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, prefix) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix);\n}\n//# sourceMappingURL=typed-data.js.map"],"names":["getBytes","concat","hexlify","toBeHex","assertArgument","getBigInt","toQuantity","getAddress","mask","toTwos","zeroPadValue","sha256","id","defineProperties","isHexString","recoverAddress"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACf,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,cAAc,GAAG,MAAM,CAAC,oEAAoE,CAAC;AACnG,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,IAAI,MAAM,KAAK,GAAGA,aAAQ,CAAC,KAAK,CAAC;AACjC,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,EAAE;AACvC,IAAI,IAAI,SAAS,EAAE;AACnB,QAAQ,OAAOC,WAAM,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACxD,IAAI;AACJ,IAAI,OAAOC,YAAO,CAAC,KAAK,CAAC;AACzB;AACA,MAAM,OAAO,GAAGC,aAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AACjC,MAAM,QAAQ,GAAGA,aAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AAClC,MAAM,gBAAgB,GAAG;AACzB,IAAI,IAAI,EA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b9a3516bd..afeb7ca2a 100644 --- a/lib.commonjs/index.js +++ b/lib.commonjs/index.js @@ -1,17 +1,290 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.corebc = exports.Buffer = void 0; -const tslib_1 = require("tslib"); -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the CoreBC library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -const buffer_1 = require("buffer"); -Object.defineProperty(exports, "Buffer", { enumerable: true, get: function () { return buffer_1.Buffer; } }); -const corebc = tslib_1.__importStar(require("./corebc.js")); +'use strict'; + +var buffer = require('buffer'); +var corebc = require('./corebc.js'); +var abiCoder = require('./abi/abi-coder.js'); +var abstractProvider = require('./providers/abstract-provider.js'); +var abstractSigner = require('./providers/abstract-signer.js'); +var providerAlchemy = require('./providers/provider-alchemy.js'); +var providerAnkr = require('./providers/provider-ankr.js'); +var contract = require('./contract/contract.js'); +var baseWallet = require('./wallet/base-wallet.js'); +var bigNumber = require('./bigNumber/bigNumber.js'); +var provider = require('./providers/provider.js'); +var providerBrowser = require('./providers/provider-browser.js'); +var index = require('./cip/index.js'); +var providerCloudflare = require('./providers/provider-cloudflare.js'); +var fragments = require('./abi/fragments.js'); +var wrappers = require('./contract/wrappers.js'); +var factory = require('./contract/factory.js'); +var strings = require('./constants/strings.js'); +var customUnits = require('./cip/custom-units.js'); +var ed448goldilock = require('./crypto/ed448goldilock.js'); +var pluginsNetwork = require('./providers/plugins-network.js'); +var _interface = require('./abi/interface.js'); +var events = require('./utils/events.js'); +var providerFallback = require('./providers/provider-fallback.js'); +var fetch = require('./utils/fetch.js'); +var fixednumber = require('./utils/fixednumber.js'); +var hdwallet = require('./wallet/hdwallet.js'); +var providerInfura = require('./providers/provider-infura.js'); +var providerIpcsocket = require('./providers/provider-ipcsocket.js'); +var index$1 = require('./ipfs/index.js'); +var providerJsonrpc = require('./providers/provider-jsonrpc.js'); +var langEn = require('./wordlists/lang-en.js'); +var numbers = require('./constants/numbers.js'); +var mnemonic = require('./wallet/mnemonic.js'); +var network = require('./providers/network.js'); +var signerNoncemanager = require('./providers/signer-noncemanager.js'); +var providerPocket = require('./providers/provider-pocket.js'); +var providerQuicknode = require('./providers/provider-quicknode.js'); +var abstractCoder = require('./abi/coders/abstract-coder.js'); +var signature = require('./crypto/signature.js'); +var signingKey = require('./crypto/signing-key.js'); +var providerSocket = require('./providers/provider-socket.js'); +var transaction = require('./transaction/transaction.js'); +var typed = require('./abi/typed.js'); +var typedData = require('./hash/typed-data.js'); +var utf8 = require('./utils/utf8.js'); +var wallet = require('./wallet/wallet.js'); +var providerWebsocket = require('./providers/provider-websocket.js'); +var wordlist = require('./wordlists/wordlist.js'); +var wordlistOwl = require('./wordlists/wordlist-owl.js'); +var wordlistOwla = require('./wordlists/wordlist-owla.js'); +var addresses = require('./constants/addresses.js'); +var hashes = require('./constants/hashes.js'); +var accesslist = require('./transaction/accesslist.js'); +var data = require('./utils/data.js'); +var errors = require('./utils/errors.js'); +var address = require('./transaction/address.js'); +var hmac = require('./crypto/hmac.js'); +var base58 = require('./utils/base58.js'); +var base64 = require('./utils/base64.js'); +var bytes32 = require('./abi/bytes32.js'); +var rlpDecode = require('./utils/rlp-decode.js'); +var jsonCrowdsale = require('./wallet/json-crowdsale.js'); +var jsonKeystore = require('./wallet/json-keystore.js'); +var properties = require('./utils/properties.js'); +var rlpEncode = require('./utils/rlp-encode.js'); +var units = require('./utils/units.js'); +var maths = require('./utils/maths.js'); +var index$2 = require('./address/index.js'); +var contractAddress = require('./address/contract-address.js'); +var defaultProvider = require('./providers/default-provider.js'); +var message = require('./hash/message.js'); +var id = require('./hash/id.js'); +var checks = require('./address/checks.js'); +var keccak = require('./crypto/keccak.js'); +var index$3 = require('./crypto/index.js'); +var pbkdf2 = require('./crypto/pbkdf2.js'); +var random = require('./crypto/random.js'); +var ripemd160 = require('./crypto/ripemd160.js'); +var scrypt = require('./crypto/scrypt.js'); +var sha3 = require('./crypto/sha3.js'); +var community = require('./providers/community.js'); +var solidity = require('./hash/solidity.js'); +var uuid = require('./utils/uuid.js'); +var _version = require('./_version.js'); +var wordlists = require('./wordlists/wordlists.js'); + + + +Object.defineProperty(exports, "Buffer", { + enumerable: true, + get: function () { return buffer.Buffer; } +}); exports.corebc = corebc; -tslib_1.__exportStar(require("./corebc.js"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file +exports.AbiCoder = abiCoder.AbiCoder; +exports.AbstractProvider = abstractProvider.AbstractProvider; +exports.UnmanagedSubscriber = abstractProvider.UnmanagedSubscriber; +exports.AbstractSigner = abstractSigner.AbstractSigner; +exports.VoidSigner = abstractSigner.VoidSigner; +exports.AlchemyProvider = providerAlchemy.AlchemyProvider; +exports.AnkrProvider = providerAnkr.AnkrProvider; +exports.BaseContract = contract.BaseContract; +exports.Contract = contract.Contract; +exports.BaseWallet = baseWallet.BaseWallet; +exports.BigNumber = bigNumber.BigNumber; +exports.Block = provider.Block; +exports.FeeData = provider.FeeData; +exports.Log = provider.Log; +exports.TransactionReceipt = provider.TransactionReceipt; +exports.TransactionResponse = provider.TransactionResponse; +exports.copyRequest = provider.copyRequest; +exports.BrowserProvider = providerBrowser.BrowserProvider; +exports.Cip150MetadataContract = index.Cip150MetadataContract; +exports.Cip151Lifecycle = index.Cip151Lifecycle; +exports.Cip152LabCertificate = index.Cip152LabCertificate; +exports.cip150Abi = index.cip150Abi; +exports.cip151TokenExpirationKey = index.cip151TokenExpirationKey; +exports.cip151TradingStopKey = index.cip151TradingStopKey; +exports.cip152LabKey = index.cip152LabKey; +exports.CloudflareProvider = providerCloudflare.CloudflareProvider; +exports.ConstructorFragment = fragments.ConstructorFragment; +exports.ErrorFragment = fragments.ErrorFragment; +exports.EventFragment = fragments.EventFragment; +exports.FallbackFragment = fragments.FallbackFragment; +exports.Fragment = fragments.Fragment; +exports.FunctionFragment = fragments.FunctionFragment; +exports.NamedFragment = fragments.NamedFragment; +exports.ParamType = fragments.ParamType; +exports.StructFragment = fragments.StructFragment; +exports.ContractEventPayload = wrappers.ContractEventPayload; +exports.ContractTransactionReceipt = wrappers.ContractTransactionReceipt; +exports.ContractTransactionResponse = wrappers.ContractTransactionResponse; +exports.ContractUnknownEventPayload = wrappers.ContractUnknownEventPayload; +exports.EventLog = wrappers.EventLog; +exports.ContractFactory = factory.ContractFactory; +exports.CoreSymbol = strings.CoreSymbol; +exports.MessagePrefix = strings.MessagePrefix; +exports.CustomUnitBalance = customUnits.CustomUnitBalance; +exports.CustomUnitDiscovery = customUnits.CustomUnitDiscovery; +exports.CustomUnitToken = customUnits.CustomUnitToken; +exports.customUnitAbi = customUnits.customUnitAbi; +exports.Ed448Goldilock = ed448goldilock.Ed448Goldilock; +exports.EnergyCostPlugin = pluginsNetwork.EnergyCostPlugin; +exports.FeeDataNetworkPlugin = pluginsNetwork.FeeDataNetworkPlugin; +exports.NetworkPlugin = pluginsNetwork.NetworkPlugin; +exports.ErrorDescription = _interface.ErrorDescription; +exports.Indexed = _interface.Indexed; +exports.Interface = _interface.Interface; +exports.LogDescription = _interface.LogDescription; +exports.TransactionDescription = _interface.TransactionDescription; +exports.EventPayload = events.EventPayload; +exports.FallbackProvider = providerFallback.FallbackProvider; +exports.FetchCancelSignal = fetch.FetchCancelSignal; +exports.FetchRequest = fetch.FetchRequest; +exports.FetchResponse = fetch.FetchResponse; +exports.FixedNumber = fixednumber.FixedNumber; +exports.HDNodeWallet = hdwallet.HDNodeWallet; +exports.defaultPath = hdwallet.defaultPath; +exports.getAccountPath = hdwallet.getAccountPath; +exports.getIndexedAccountPath = hdwallet.getIndexedAccountPath; +exports.InfuraProvider = providerInfura.InfuraProvider; +exports.InfuraWebSocketProvider = providerInfura.InfuraWebSocketProvider; +exports.IpcSocketProvider = providerIpcsocket.IpcSocketProvider; +exports.IpfsGateway = index$1.IpfsGateway; +exports.defaultIpfsGatewayTemplate = index$1.defaultIpfsGatewayTemplate; +exports.JsonRpcApiProvider = providerJsonrpc.JsonRpcApiProvider; +exports.JsonRpcProvider = providerJsonrpc.JsonRpcProvider; +exports.JsonRpcSigner = providerJsonrpc.JsonRpcSigner; +exports.LangEn = langEn.LangEn; +exports.MaxInt256 = numbers.MaxInt256; +exports.MaxUint256 = numbers.MaxUint256; +exports.MinInt256 = numbers.MinInt256; +exports.N = numbers.N; +exports.OrePerXCB = numbers.OrePerXCB; +exports.Mnemonic = mnemonic.Mnemonic; +exports.Network = network.Network; +exports.NonceManager = signerNoncemanager.NonceManager; +exports.PocketProvider = providerPocket.PocketProvider; +exports.QuickNodeProvider = providerQuicknode.QuickNodeProvider; +exports.Result = abstractCoder.Result; +exports.checkResultErrors = abstractCoder.checkResultErrors; +exports.Signature = signature.Signature; +exports.SigningKey = signingKey.SigningKey; +exports.SocketBlockSubscriber = providerSocket.SocketBlockSubscriber; +exports.SocketEventSubscriber = providerSocket.SocketEventSubscriber; +exports.SocketPendingSubscriber = providerSocket.SocketPendingSubscriber; +exports.SocketProvider = providerSocket.SocketProvider; +exports.SocketSubscriber = providerSocket.SocketSubscriber; +exports.Transaction = transaction.Transaction; +exports.Typed = typed.Typed; +exports.TypedDataEncoder = typedData.TypedDataEncoder; +exports.verifyTypedData = typedData.verifyTypedData; +exports.Utf8ErrorFuncs = utf8.Utf8ErrorFuncs; +exports.toUtf8Bytes = utf8.toUtf8Bytes; +exports.toUtf8CodePoints = utf8.toUtf8CodePoints; +exports.toUtf8String = utf8.toUtf8String; +exports.Wallet = wallet.Wallet; +exports.WebSocketProvider = providerWebsocket.WebSocketProvider; +exports.Wordlist = wordlist.Wordlist; +exports.WordlistOwl = wordlistOwl.WordlistOwl; +exports.WordlistOwlA = wordlistOwla.WordlistOwlA; +exports.ZeroAddress = addresses.ZeroAddress; +exports.ZeroHash = hashes.ZeroHash; +exports.accessListify = accesslist.accessListify; +exports.arrayify = data.arrayify; +exports.concat = data.concat; +exports.dataLength = data.dataLength; +exports.dataSlice = data.dataSlice; +exports.getBytes = data.getBytes; +exports.getBytesCopy = data.getBytesCopy; +exports.hexConcat = data.hexConcat; +exports.hexlify = data.hexlify; +exports.isBytesLike = data.isBytesLike; +exports.isHexString = data.isHexString; +exports.stripZerosLeft = data.stripZerosLeft; +exports.zeroPadBytes = data.zeroPadBytes; +exports.zeroPadValue = data.zeroPadValue; +exports.assert = errors.assert; +exports.assertArgument = errors.assertArgument; +exports.assertArgumentCount = errors.assertArgumentCount; +exports.assertNormalize = errors.assertNormalize; +exports.assertPrivate = errors.assertPrivate; +exports.isCallException = errors.isCallException; +exports.isError = errors.isError; +exports.makeError = errors.makeError; +exports.computeAddress = address.computeAddress; +exports.publicToAddress = address.publicToAddress; +exports.recoverAddress = address.recoverAddress; +exports.computeHmac = hmac.computeHmac; +exports.decodeBase58 = base58.decodeBase58; +exports.encodeBase58 = base58.encodeBase58; +exports.decodeBase64 = base64.decodeBase64; +exports.encodeBase64 = base64.encodeBase64; +exports.decodeBytes32String = bytes32.decodeBytes32String; +exports.encodeBytes32String = bytes32.encodeBytes32String; +exports.decodeRlp = rlpDecode.decodeRlp; +exports.decryptCrowdsaleJson = jsonCrowdsale.decryptCrowdsaleJson; +exports.isCrowdsaleJson = jsonCrowdsale.isCrowdsaleJson; +exports.decryptKeystoreJson = jsonKeystore.decryptKeystoreJson; +exports.decryptKeystoreJsonSync = jsonKeystore.decryptKeystoreJsonSync; +exports.encryptKeystoreJson = jsonKeystore.encryptKeystoreJson; +exports.encryptKeystoreJsonSync = jsonKeystore.encryptKeystoreJsonSync; +exports.isKeystoreJson = jsonKeystore.isKeystoreJson; +exports.defineProperties = properties.defineProperties; +exports.resolveProperties = properties.resolveProperties; +exports.encodeRlp = rlpEncode.encodeRlp; +exports.formatUnits = units.formatUnits; +exports.formatXCB = units.formatXCB; +exports.parseUnits = units.parseUnits; +exports.parseXCB = units.parseXCB; +exports.fromTwos = maths.fromTwos; +exports.getBigInt = maths.getBigInt; +exports.getNumber = maths.getNumber; +exports.getUint = maths.getUint; +exports.mask = maths.mask; +exports.toBeArray = maths.toBeArray; +exports.toBeHex = maths.toBeHex; +exports.toBigInt = maths.toBigInt; +exports.toNumber = maths.toNumber; +exports.toQuantity = maths.toQuantity; +exports.toTwos = maths.toTwos; +exports.getAddress = index$2.getAddress; +exports.networkIdToPrefix = index$2.networkIdToPrefix; +exports.getCreate2Address = contractAddress.getCreate2Address; +exports.getCreateAddress = contractAddress.getCreateAddress; +exports.getDefaultProvider = defaultProvider.getDefaultProvider; +exports.hashMessage = message.hashMessage; +exports.verifyMessage = message.verifyMessage; +exports.id = id.id; +exports.isAddress = checks.isAddress; +exports.isAddressable = checks.isAddressable; +exports.resolveAddress = checks.resolveAddress; +exports.keccak256 = keccak.keccak256; +exports.lock = index$3.lock; +exports.pbkdf2 = pbkdf2.pbkdf2; +exports.randomBytes = random.randomBytes; +exports.ripemd160 = ripemd160.ripemd160; +exports.scrypt = scrypt.scrypt; +exports.scryptSync = scrypt.scryptSync; +exports.sha256 = sha3.sha256; +exports.sha512 = sha3.sha512; +exports.showThrottleMessage = community.showThrottleMessage; +exports.solidityPacked = solidity.solidityPacked; +exports.solidityPackedSha256 = solidity.solidityPackedSha256; +exports.uuidV4 = uuid.uuidV4; +exports.version = _version.version; +exports.wordlists = wordlists.wordlists; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/index.js.map b/lib.commonjs/index.js.map index 26921c071..82081e26c 100644 --- a/lib.commonjs/index.js.map +++ b/lib.commonjs/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":";;;;AAAA;;;;;;GAMG;AACH,mCAAgC;AACvB,uFADA,eAAM,OACA;AAEf,4DAAsC;AAE7B,wBAAM;AAEf,sDAA4B"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/ipfs/index.d.ts b/lib.commonjs/ipfs/index.d.ts new file mode 100644 index 000000000..e1bf33eb0 --- /dev/null +++ b/lib.commonjs/ipfs/index.d.ts @@ -0,0 +1,18 @@ +export declare const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; +export interface IpfsGatewayOptions { + template?: string; + maxResponseBytes?: number; + timeoutMs?: number; + fetch?: typeof globalThis.fetch; +} +/** Configurable IPFS resolution and bounded JSON loading. */ +export declare class IpfsGateway { + #private; + readonly template: string; + readonly maxResponseBytes: number; + readonly timeoutMs: number; + constructor(options?: IpfsGatewayOptions); + resolve(reference: string): URL; + readJson(reference: string): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/ipfs/index.d.ts.map b/lib.commonjs/ipfs/index.d.ts.map new file mode 100644 index 000000000..baabf24dc --- /dev/null +++ b/lib.commonjs/ipfs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/ipfs/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CAChC;AACD,6DAA6D;AAC7D,qBAAa,WAAW;;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,YAAY,OAAO,GAAE,kBAAuB,EAgB3C;IACD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAe9B;IACK,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0ClD;CACD"} \ No newline at end of file diff --git a/lib.commonjs/ipfs/index.js b/lib.commonjs/ipfs/index.js new file mode 100644 index 000000000..55be65f85 --- /dev/null +++ b/lib.commonjs/ipfs/index.js @@ -0,0 +1,78 @@ +'use strict'; + +const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; +/** Configurable IPFS resolution and bounded JSON loading. */ +class IpfsGateway { + template; + maxResponseBytes; + timeoutMs; + #fetch; + constructor(options = {}) { + this.template = options.template ?? defaultIpfsGatewayTemplate; + this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024; + this.timeoutMs = options.timeoutMs ?? 30_000; + this.#fetch = options.fetch ?? globalThis.fetch; + const templateUrl = new URL(this.template.replace("{cid}", "cid")); + if (!/^https?:$/.test(templateUrl.protocol) || + this.template.split("{cid}").length !== 2) + throw new TypeError("gateway template must be HTTP(S) and contain one {cid}"); + for (const value of [this.maxResponseBytes, this.timeoutMs]) + if (!Number.isSafeInteger(value) || value <= 0) + throw new TypeError("gateway limits must be positive safe integers"); + } + resolve(reference) { + const value = reference.trim(); + if (/^https?:\/\//i.test(value)) + return new URL(value); + const path = value.replace(/^ipfs:\/\//, "").replace(/^\/?ipfs\//, ""); + if (!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path) || + path.split("/").some((part) => part === "." || part === "..")) + throw new TypeError("invalid IPFS reference"); + return new URL(this.template.replace("{cid}", path.split("/").map(encodeURIComponent).join("/"))); + } + async readJson(reference) { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), this.timeoutMs); + let reader; + try { + const response = await this.#fetch(this.resolve(reference), { + headers: { accept: "application/json" }, + signal: controller.signal, + }); + if (!response.ok) { + await response.body?.cancel(); + throw new Error(`IPFS gateway returned HTTP ${response.status}`); + } + if (!response.body) + throw new Error("IPFS gateway returned an empty body"); + reader = response.body.getReader(); + const chunks = []; + let length = 0; + while (true) { + const { done, value } = await reader.read(); + if (done) + break; + length += value.length; + if (length > this.maxResponseBytes) + throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`); + chunks.push(value); + } + const bytes = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + bytes.set(chunk, offset); + offset += chunk.length; + } + return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)); + } + finally { + clearTimeout(timer); + await reader?.cancel().catch(() => { }); + reader?.releaseLock(); + } + } +} + +exports.IpfsGateway = IpfsGateway; +exports.defaultIpfsGatewayTemplate = defaultIpfsGatewayTemplate; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/ipfs/index.js.map b/lib.commonjs/ipfs/index.js.map new file mode 100644 index 000000000..8ea032c86 --- /dev/null +++ b/lib.commonjs/ipfs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../../lib.esm/ipfs/index.js"],"sourcesContent":["export const defaultIpfsGatewayTemplate = \"https://ipf.sk/{cid}\";\n/** Configurable IPFS resolution and bounded JSON loading. */\nexport class IpfsGateway {\n template;\n maxResponseBytes;\n timeoutMs;\n #fetch;\n constructor(options = {}) {\n this.template = options.template ?? defaultIpfsGatewayTemplate;\n this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024;\n this.timeoutMs = options.timeoutMs ?? 30_000;\n this.#fetch = options.fetch ?? globalThis.fetch;\n const templateUrl = new URL(this.template.replace(\"{cid}\", \"cid\"));\n if (!/^https?:$/.test(templateUrl.protocol) ||\n this.template.split(\"{cid}\").length !== 2)\n throw new TypeError(\"gateway template must be HTTP(S) and contain one {cid}\");\n for (const value of [this.maxResponseBytes, this.timeoutMs])\n if (!Number.isSafeInteger(value) || value <= 0)\n throw new TypeError(\"gateway limits must be positive safe integers\");\n }\n resolve(reference) {\n const value = reference.trim();\n if (/^https?:\\/\\//i.test(value))\n return new URL(value);\n const path = value.replace(/^ipfs:\\/\\//, \"\").replace(/^\\/?ipfs\\//, \"\");\n if (!/^[A-Za-z0-9]+(?:\\/[^?#]*)?$/.test(path) ||\n path.split(\"/\").some((part) => part === \".\" || part === \"..\"))\n throw new TypeError(\"invalid IPFS reference\");\n return new URL(this.template.replace(\"{cid}\", path.split(\"/\").map(encodeURIComponent).join(\"/\")));\n }\n async readJson(reference) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n let reader;\n try {\n const response = await this.#fetch(this.resolve(reference), {\n headers: { accept: \"application/json\" },\n signal: controller.signal,\n });\n if (!response.ok) {\n await response.body?.cancel();\n throw new Error(`IPFS gateway returned HTTP ${response.status}`);\n }\n if (!response.body)\n throw new Error(\"IPFS gateway returned an empty body\");\n reader = response.body.getReader();\n const chunks = [];\n let length = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done)\n break;\n length += value.length;\n if (length > this.maxResponseBytes)\n throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);\n chunks.push(value);\n }\n const bytes = new Uint8Array(length);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.length;\n }\n return JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes));\n }\n finally {\n clearTimeout(timer);\n await reader?.cancel().catch(() => { });\n reader?.releaseLock();\n }\n }\n}\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;AAAY,MAAC,0BAA0B,GAAG;AAC1C;AACO,MAAM,WAAW,CAAC;AACzB,IAAI,QAAQ;AACZ,IAAI,gBAAgB;AACpB,IAAI,SAAS;AACb,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,OAAO,GAAG,EAAE,EAAE;AAC9B,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,0BAA0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7B,YAAY,IAAI,MAAM,GAAG,CAAC;AAC1B,YAAY,OAAO,IAAI,EAAE;AACzB,gBAAgB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE;AAC3D,gBAAgB,IAAI,IAAI;AACxB,oBAAoB;AACpB,gBAAgB,MAAM,IAAI,KAAK,CAAC,MAAM;AACtC,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAAC,gBAAgB;AAClD,oBAAoB,MAAM,IAAI,KAAK,CAAC,CAAC,sBAAsB,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAC3F,gBAAgB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AAClC,YAAY;AACZ,YAAY,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC;AAChD,YAAY,IAAI,MAAM,GAAG,CAAC;AAC1B,YAAY,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;AACxC,gBAAgB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,gBAAgB,MAAM,IAAI,KAAK,CAAC,MAAM;AACtC,YAAY;AACZ,YAAY,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtF,QAAQ;AACR,gBAAgB;AAChB,YAAY,YAAY,CAAC,KAAK,CAAC;AAC/B,YAAY,MAAM,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACnD,YAAY,MAAM,EAAE,WAAW,EAAE;AACjC,QAAQ;AACR,IAAI;AACJ;;;"} \ No newline at end of file diff --git a/lib.commonjs/logger/logger.d.ts.map b/lib.commonjs/logger/logger.d.ts.map index f1ca4504f..1880f0d16 100644 --- a/lib.commonjs/logger/logger.d.ts.map +++ b/lib.commonjs/logger/logger.d.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OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,CAKnE;IAED,MAAM,CACL,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,SAAS,EAChB,MAAM,CAAC,EAAE,GAAG,GACV,IAAI,CAKN;IAED,cAAc,CACb,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,GACR,IAAI,CAKN;IAED,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAcrC;IAED,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAwBrD;IAED,kBAAkB,CACjB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CA4BN;IAED,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAMrC;IAED,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAc1C;IAED,MAAM,CAAC,YAAY,IAAI,MAAM,CAK5B;IAED,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CA0BnE;IAED,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAO3C;IAED,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/logger/logger.js b/lib.commonjs/logger/logger.js index 9147d093e..3f30402be 100644 --- a/lib.commonjs/logger/logger.js +++ b/lib.commonjs/logger/logger.js @@ -1,6 +1,5 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Logger = exports.ErrorCode = exports.LogLevel = void 0; +'use strict'; + let _permanentCensorErrors = false; let _censorErrors = false; const LogLevels = { @@ -41,15 +40,15 @@ function _checkNormalize() { return null; } const _normalizeError = _checkNormalize(); -var LogLevel; +exports.LogLevel = void 0; (function (LogLevel) { LogLevel["DEBUG"] = "DEBUG"; LogLevel["INFO"] = "INFO"; LogLevel["WARNING"] = "WARNING"; LogLevel["ERROR"] = "ERROR"; LogLevel["OFF"] = "OFF"; -})(LogLevel || (exports.LogLevel = LogLevel = {})); -var ErrorCode; +})(exports.LogLevel || (exports.LogLevel = {})); +exports.ErrorCode = void 0; (function (ErrorCode) { /////////////////// // Generic Errors @@ -122,12 +121,12 @@ var ErrorCode; // - replacement: the full TransactionsResponse for the replacement // - receipt: the receipt of the replacement ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; -})(ErrorCode || (exports.ErrorCode = ErrorCode = {})); +})(exports.ErrorCode || (exports.ErrorCode = {})); const HEX = "0123456789abcdef"; class Logger { version = "0.0.1"; - static errors = ErrorCode; - static levels = LogLevel; + static errors = exports.ErrorCode; + static levels = exports.LogLevel; constructor(version) { Object.defineProperty(this, "version", { enumerable: true, @@ -222,9 +221,6 @@ class Logger { this.throwArgumentError(message, name, value); } checkNormalize(message) { - if (message == null) { - message = "platform missing String.prototype.normalize"; - } if (_normalizeError) { this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { operation: "String.prototype.normalize", @@ -328,5 +324,6 @@ class Logger { return new Logger(version); } } + exports.Logger = Logger; -//# sourceMappingURL=logger.js.map \ No newline at end of file +//# sourceMappingURL=logger.js.map diff --git a/lib.commonjs/logger/logger.js.map b/lib.commonjs/logger/logger.js.map index c7cfb4eff..29afbfaa1 100644 --- a/lib.commonjs/logger/logger.js.map +++ b/lib.commonjs/logger/logger.js.map @@ -1 +1 @@ -{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src.ts/logger/logger.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;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logger.js","sources":["../../lib.esm/logger/logger.js"],"sourcesContent":["\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map"],"names":["LogLevel","ErrorCode"],"mappings":";;AACA,IAAI,sBAAsB,GAAG,KAAK;AAClC,IAAI,aAAa,GAAG,KAAK;AACzB,MAAM,SAAS,GAAG;AAClB,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,GAAG,EAAE,CAAC;AACV,CAAC;AACD,IAAI,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;AACpC,IAAI,aAAa,GAAG,IAAI;AACxB,SAAS,eAAe,GAAG;AAC3B,IAAI,IAAI;AACR,QAAQ,MAAM,OAAO,GAAG,EAAE;AAC1B;AACA,QAAQ,CAAC,KAAK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AC,UAAU,EAAE;AAC7B,gBAAgB;AAChB,YAAY;AACZ,YAAY,IAAI,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,4BAA4B,EAAE,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;AAC9G,gBAAgB,SAAS,EAAE,eAAe;AAC1C,aAAa,CAAC;AACd,QAAQ;AACR,QAAQ,aAAa,GAAG,CAAC,CAAC,UAAU;AACpC,QAAQ,sBAAsB,GAAG,CAAC,CAAC,SAAS;AAC5C,IAAI;AACJ,IAAI,OAAO,WAAW,CAAC,QAAQ,EAAE;AACjC,QAAQ,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;AACvD,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;AAC3B,YAAY,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,sBAAsB,GAAG,QAAQ,CAAC;AACzE,YAAY;AACZ,QAAQ;AACR,QAAQ,SAAS,GAAG,KAAK;AACzB,IAAI;AACJ,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE;AACzB,QAAQ,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/package.json b/lib.commonjs/package.json index 0e2116858..0292b9956 100644 --- a/lib.commonjs/package.json +++ b/lib.commonjs/package.json @@ -1,12 +1 @@ -{ - "browser": { - "./crypto/crypto.js": "./crypto/crypto-browser.js", - "./providers/provider-ipcsocket.js": "./providers/provider-ipcsocket-browser.js", - "./providers/ws.js": "./providers/ws-browser.js", - "./utils/base64.js": "./utils/base64-browser.js", - "./utils/geturl.js": "./utils/geturl-browser.js", - "./wordlists/wordlists.js": "./wordlists/wordlists-browser.js" - }, - "sideEffects": false, - "type": "commonjs" -} +{"type":"commonjs"} \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-provider.d.ts.map b/lib.commonjs/providers/abstract-provider.d.ts.map index ca3a7ea53..b293b4e8f 100644 --- a/lib.commonjs/providers/abstract-provider.d.ts.map +++ b/lib.commonjs/providers/abstract-provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAaL,YAAY,EAOb,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAEL,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,kBAAkB,EACnB,MAAM,eAAe,CAAC;AA2CvB,MAAM,MAAM,0BAA0B,GAClC;IACE,MAAM,EAAE,0BAA0B,CAAC;IACnC,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,GACD;IACE,MAAM,EAAE,4BAA4B,CAAC;IACrC,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC;CACb,GACD;IACE,MAAM,EAAE,2BAA2B,CAAC;IACpC,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC;CAC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AAG,OAAO,CAAC,IAAI,CAAC;IAmBxD,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpE,cAAc,CAClB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,IAAI,CAAC;IAMhB,OAAO,IAAI,IAAI;IAUf,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAUxB;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IA+BtC,MAAM,IAAI,IAAI;CAqBf"} \ No newline at end of file +{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAaN,YAAY,EAOZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAEN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACX,QAAQ,EACR,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,MAAM,eAAe,CAAC;AA2CvB,MAAM,MAAM,0BAA0B,GAC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,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWhE;IAEK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWlE;IAEK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBtE;IAEK,aAAa,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAc1D;IAEK,SAAS,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAa/D;IAEK,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBlE;IAEK,kBAAkB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB7D;IAGK,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;IAGK,cAAc,CACnB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;IAID,OAAO,IAAI,IAAI,CAQd;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAUxB;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CA6BrC;IAED,MAAM,IAAI,IAAI,CAoBb;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-provider.js b/lib.commonjs/providers/abstract-provider.js index eee42c067..1d5ca8c82 100644 --- a/lib.commonjs/providers/abstract-provider.js +++ b/lib.commonjs/providers/abstract-provider.js @@ -1,11 +1,41 @@ -"use strict"; +'use strict'; + +var checks = require('../address/checks.js'); +require('../address/index.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var events = require('../utils/events.js'); +var fetch = require('../utils/fetch.js'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +var properties = require('../utils/properties.js'); +var utf8 = require('../utils/utf8.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../logger/logger.js'); +require('../crypto/signature.js'); +var transaction = require('../transaction/transaction.js'); +var format = require('./format.js'); +var network = require('./network.js'); +var provider = require('./provider.js'); +var subscriberPolling = require('./subscriber-polling.js'); + /** * About Subclassing the Provider... * * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AbstractProvider = exports.UnmanagedSubscriber = void 0; // @TODO // Event coalescence // When we register an event with an async value (e.g. address is a Signer @@ -13,13 +43,6 @@ exports.AbstractProvider = exports.UnmanagedSubscriber = void 0; // need time to resolve the address. Upon resolving the address, we need to // migrate the listener to the static event. We also need to maintain a map // of Signer/ENS name to address so we can sync respond to listenerCount. -const checks_js_1 = require("../address/checks.js"); -const index_js_1 = require("../transaction/index.js"); -const index_js_2 = require("../utils/index.js"); -const format_js_1 = require("./format.js"); -const network_js_1 = require("./network.js"); -const provider_js_1 = require("./provider.js"); -const subscriber_polling_js_1 = require("./subscriber-polling.js"); const MAX_CCIP_REDIRECTS = 10; function isPromise(value) { return value && typeof value.then === "function"; @@ -52,14 +75,13 @@ function getTag(prefix, value) { class UnmanagedSubscriber { name; constructor(name) { - (0, index_js_2.defineProperties)(this, { name }); + properties.defineProperties(this, { name }); } start() { } stop() { } pause(dropWhilePaused) { } resume() { } } -exports.UnmanagedSubscriber = UnmanagedSubscriber; function copy(value) { return JSON.parse(JSON.stringify(value)); } @@ -87,7 +109,7 @@ async function getSubscription(_event, provider) { } } } - if ((0, index_js_2.isHexString)(_event, 32)) { + if (data.isHexString(_event, 32)) { const hash = _event.toLowerCase(); return { type: "transaction", tag: getTag("tx", { hash }), hash }; } @@ -117,12 +139,12 @@ async function getSubscription(_event, provider) { const addresses = []; const promises = []; const addAddress = (addr) => { - if ((0, index_js_2.isHexString)(addr)) { + if (data.isHexString(addr)) { addresses.push(addr); } else { promises.push((async () => { - addresses.push(await (0, checks_js_1.resolveAddress)(addr)); + addresses.push(await checks.resolveAddress(addr)); })()); } }; @@ -139,7 +161,7 @@ async function getSubscription(_event, provider) { } return { filter, tag: getTag("event", filter), type: "event" }; } - (0, index_js_2.assertArgument)(false, "unknown ProviderEvent", "event", _event); + errors.assertArgument(false, "unknown ProviderEvent", "event", _event); } function getTime() { return new Date().getTime(); @@ -165,11 +187,11 @@ class AbstractProvider { this.#networkPromise = null; } else if (_network) { - const network = network_js_1.Network.from(_network); + const network$1 = network.Network.from(_network); this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); + this.#networkPromise = Promise.resolve(network$1); setTimeout(() => { - this.emit("network", network, null); + this.emit("network", network$1, null); }, 0); } else { @@ -240,7 +262,7 @@ class AbstractProvider { // value.status = response.statusCode; // return value; //}); - const request = new index_js_2.FetchRequest(href); + const request = new fetch.FetchRequest(href); if (url.indexOf("{data}") === -1) { request.body = { data, sender }; } @@ -273,7 +295,7 @@ class AbstractProvider { } catch (error) { } // 4xx indicates the result is not present; stop - (0, index_js_2.assert)(resp.statusCode < 400 || resp.statusCode >= 500, `response not found during CCIP fetch: ${errorMessage}`, "OFFCHAIN_FAULT", { + errors.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 }, @@ -281,7 +303,7 @@ class AbstractProvider { // 5xx indicates server issue; try the next url errorMessages.push(errorMessage); } - (0, index_js_2.assert)(false, `error encountered during CCIP fetch: ${errorMessages + errors.assert(false, `error encountered during CCIP fetch: ${errorMessages .map((m) => JSON.stringify(m)) .join(", ")}`, "OFFCHAIN_FAULT", { reason: "500_SERVER_ERROR", @@ -290,40 +312,40 @@ class AbstractProvider { }); } _wrapBlock(value, network) { - return new provider_js_1.Block((0, format_js_1.formatBlock)(value), this); + return new provider.Block(format.formatBlock(value), this); } _wrapLog(value, network) { - return new provider_js_1.Log((0, format_js_1.formatLog)(value), this); + return new provider.Log(format.formatLog(value), this); } _wrapTransactionReceipt(value, network) { - return new provider_js_1.TransactionReceipt((0, format_js_1.formatTransactionReceipt)(value), this); + return new provider.TransactionReceipt(format.formatTransactionReceipt(value), this); } _wrapTransactionResponse(tx, network) { - return new provider_js_1.TransactionResponse((0, format_js_1.formatTransactionResponse)(tx), this); + return new provider.TransactionResponse(format.formatTransactionResponse(tx), this); } _detectNetwork() { - (0, index_js_2.assert)(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { + errors.assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { operation: "_detectNetwork", }); } // Sub-classes should override this and handle PerformActionRequest requests, calling // the super for any unhandled actions. async _perform(req) { - (0, index_js_2.assert)(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { + errors.assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { operation: req.method, info: req, }); } // State async getBlockNumber() { - const blockNumber = (0, index_js_2.getNumber)(await this.#perform({ method: "getBlockNumber" }), "%response"); + const blockNumber = maths.getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); if (this.#lastBlockNumber >= 0) { this.#lastBlockNumber = blockNumber; } return blockNumber; } _getAddress(address) { - return (0, checks_js_1.resolveAddress)(address); + return checks.resolveAddress(address); } _getBlockTag(blockTag) { if (blockTag == null) { @@ -338,25 +360,25 @@ class AbstractProvider { case "finalized": return blockTag; } - if ((0, index_js_2.isHexString)(blockTag)) { - if ((0, index_js_2.isHexString)(blockTag, 32)) { + if (data.isHexString(blockTag)) { + if (data.isHexString(blockTag, 32)) { return blockTag; } - return (0, index_js_2.toQuantity)(blockTag); + return maths.toQuantity(blockTag); } if (typeof blockTag === "bigint") { - blockTag = (0, index_js_2.getNumber)(blockTag, "blockTag"); + blockTag = maths.getNumber(blockTag, "blockTag"); } if (typeof blockTag === "number") { if (blockTag >= 0) { - return (0, index_js_2.toQuantity)(blockTag); + return maths.toQuantity(blockTag); } if (this.#lastBlockNumber >= 0) { - return (0, index_js_2.toQuantity)(this.#lastBlockNumber + blockTag); + return maths.toQuantity(this.#lastBlockNumber + blockTag); } - return this.getBlockNumber().then((b) => (0, index_js_2.toQuantity)(b + blockTag)); + return this.getBlockNumber().then((b) => maths.toQuantity(b + blockTag)); } - (0, index_js_2.assertArgument)(false, "invalid blockTag", "blockTag", blockTag); + errors.assertArgument(false, "invalid blockTag", "blockTag", blockTag); } _getFilter(filter) { // Create a canonical representation of the topics @@ -435,13 +457,13 @@ class AbstractProvider { return resolve(address, fromBlock, toBlock); } _getTransactionRequest(_request) { - const request = (0, provider_js_1.copyRequest)(_request); + const request = provider.copyRequest(_request); const promises = []; ["to", "from"].forEach((key) => { if (request[key] == null) { return; } - const addr = (0, checks_js_1.resolveAddress)(request[key]); + const addr = checks.resolveAddress(request[key]); if (isPromise(addr)) { promises.push((async function () { request[key] = await addr; @@ -489,7 +511,7 @@ class AbstractProvider { } const networkPromise = this.#networkPromise; const [expected, actual] = await Promise.all([ - networkPromise, + networkPromise, // Possibly an explicit Network this._detectNetwork(), // The actual connected network ]); if (expected.networkId !== actual.networkId) { @@ -503,7 +525,7 @@ class AbstractProvider { } else { // Otherwise, we do not allow changes to the underlying network - (0, index_js_2.assert)(false, `network changed: ${expected.networkId} => ${actual.networkId} `, "NETWORK_ERROR", { + errors.assert(false, `network changed: ${expected.networkId} => ${actual.networkId} `, "NETWORK_ERROR", { event: "changed", }); } @@ -511,82 +533,82 @@ class AbstractProvider { return expected.clone(); } async getEnergyPrice() { - const { energyPrice } = await (0, index_js_2.resolveProperties)({ + const { energyPrice } = await properties.resolveProperties({ block: this.getBlock("latest"), energyPrice: (async () => { try { const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return (0, index_js_2.getBigInt)(energyPrice, "%response"); + return maths.getBigInt(energyPrice, "%response"); } catch (error) { } return null; })(), }); - return new provider_js_1.FeeData(energyPrice); + return new provider.FeeData(energyPrice); } async getFeeData() { - const { energyPrice } = await (0, index_js_2.resolveProperties)({ + const { energyPrice } = await properties.resolveProperties({ block: this.getBlock("latest"), energyPrice: (async () => { try { const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return (0, index_js_2.getBigInt)(energyPrice, "%response"); + return maths.getBigInt(energyPrice, "%response"); } catch (error) { } return null; })(), }); - return new provider_js_1.FeeData(energyPrice); + return new provider.FeeData(energyPrice); } async estimateEnergy(_tx) { let tx = this._getTransactionRequest(_tx); if (isPromise(tx)) { tx = await tx; } - return (0, index_js_2.getBigInt)(await this.#perform({ + return maths.getBigInt(await this.#perform({ method: "estimateEnergy", transaction: tx, }), "%response"); } async #call(tx, blockTag, attempt) { - (0, index_js_2.assert)(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { + errors.assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { reason: "TOO_MANY_REDIRECTS", transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }), }); // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = (0, provider_js_1.copyRequest)(tx); + const transaction = provider.copyRequest(tx); try { - return (0, index_js_2.hexlify)(await this._perform({ method: "call", transaction, blockTag })); + return data.hexlify(await this._perform({ method: "call", transaction, blockTag })); } catch (error) { // CCIP Read OffchainLookup if (!this.disableCcipRead && - (0, index_js_2.isCallException)(error) && + errors.isCallException(error) && error.data && attempt >= 0 && blockTag === "latest" && transaction.to != null && - (0, index_js_2.dataSlice)(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - const txSender = await (0, checks_js_1.resolveAddress)(transaction.to); + data.dataSlice(error.data, 0, 4) === "0x556f1830") { + const data$1 = error.data; + const txSender = await checks.resolveAddress(transaction.to); // Parse the CCIP Read Arguments let ccipArgs; try { - ccipArgs = parseOffchainLookup((0, index_js_2.dataSlice)(error.data, 4)); + ccipArgs = parseOffchainLookup(data.dataSlice(error.data, 4)); } catch (error) { - (0, index_js_2.assert)(false, error.message, "OFFCHAIN_FAULT", { + errors.assert(false, error.message, "OFFCHAIN_FAULT", { reason: "BAD_DATA", transaction, - info: { data }, + info: { data: data$1 }, }); } // Check the sender of the OffchainLookup matches the transaction - (0, index_js_2.assert)(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { + errors.assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { action: "call", - data, + data: data$1, reason: "OffchainLookup", - transaction: transaction, + transaction: transaction, // @TODO: populate data? invocation: null, revert: { signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", @@ -595,14 +617,14 @@ class AbstractProvider { }, }); const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - (0, index_js_2.assert)(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { + errors.assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { reason: "FETCH_FAILED", transaction, info: { data: error.data, errorArgs: ccipArgs.errorArgs }, }); const tx = { to: txSender, - data: (0, index_js_2.concat)([ + data: data.concat([ ccipArgs.selector, encodeBytes([ccipResult, ccipArgs.extraData]), ]), @@ -630,14 +652,14 @@ class AbstractProvider { } } async #checkNetwork(promise) { - const { value } = await (0, index_js_2.resolveProperties)({ + const { value } = await properties.resolveProperties({ network: this.getNetwork(), value: promise, }); return value; } async call(_tx) { - const { tx, blockTag } = await (0, index_js_2.resolveProperties)({ + const { tx, blockTag } = await properties.resolveProperties({ tx: this._getTransactionRequest(_tx), blockTag: this._getBlockTag(_tx.blockTag), }); @@ -653,21 +675,21 @@ class AbstractProvider { return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); } async getBalance(address, blockTag) { - return (0, index_js_2.getBigInt)(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); + return maths.getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); } async getTransactionCount(address, blockTag) { - return (0, index_js_2.getNumber)(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); + return maths.getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); } async getCode(address, blockTag) { - return (0, index_js_2.hexlify)(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); + return data.hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); } async getStorage(address, _position, blockTag) { - const position = (0, index_js_2.getBigInt)(_position, "position"); - return (0, index_js_2.hexlify)(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); + const position = maths.getBigInt(_position, "position"); + return data.hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); } // Write async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await (0, index_js_2.resolveProperties)({ + const { blockNumber, hash, network } = await properties.resolveProperties({ blockNumber: this.getBlockNumber(), hash: this._perform({ method: "broadcastTransaction", @@ -675,7 +697,7 @@ class AbstractProvider { }), network: this.getNetwork(), }); - const tx = index_js_1.Transaction.from(signedTx); + const tx = transaction.Transaction.from(signedTx); if (tx.hash !== hash) { throw new Error("@TODO: the returned hash did not match"); } @@ -683,7 +705,7 @@ class AbstractProvider { } async #getBlock(block, includeTransactions) { // @TODO: Add CustomBlockPlugin check - if ((0, index_js_2.isHexString)(block, 32)) { + if (data.isHexString(block, 32)) { return await this.#perform({ method: "getBlock", blockHash: block, @@ -702,7 +724,7 @@ class AbstractProvider { } // Queries async getBlock(block, prefetchTxs) { - const { network, params } = await (0, index_js_2.resolveProperties)({ + const { network, params } = await properties.resolveProperties({ network: this.getNetwork(), params: this.#getBlock(block, !!prefetchTxs), }); @@ -712,7 +734,7 @@ class AbstractProvider { return this._wrapBlock(params, network); } async getTransaction(hash) { - const { network, params } = await (0, index_js_2.resolveProperties)({ + const { network, params } = await properties.resolveProperties({ network: this.getNetwork(), params: this.#perform({ method: "getTransaction", hash }), }); @@ -722,7 +744,7 @@ class AbstractProvider { return this._wrapTransactionResponse(params, network); } async getTransactionReceipt(hash) { - const { network, params } = await (0, index_js_2.resolveProperties)({ + const { network, params } = await properties.resolveProperties({ network: this.getNetwork(), params: this.#perform({ method: "getTransactionReceipt", hash }), }); @@ -741,14 +763,14 @@ class AbstractProvider { return this._wrapTransactionReceipt(params, network); } async getTransactionResult(hash) { - const { result } = await (0, index_js_2.resolveProperties)({ + const { result } = await properties.resolveProperties({ network: this.getNetwork(), result: this.#perform({ method: "getTransactionResult", hash }), }); if (result == null) { return null; } - return (0, index_js_2.hexlify)(result); + return data.hexlify(result); } // Bloom-filter Queries async getLogs(_filter) { @@ -756,7 +778,7 @@ class AbstractProvider { if (isPromise(filter)) { filter = await filter; } - const { network, params } = await (0, index_js_2.resolveProperties)({ + const { network, params } = await properties.resolveProperties({ network: this.getNetwork(), params: this.#perform({ method: "getLogs", filter }), }); @@ -764,7 +786,7 @@ class AbstractProvider { } // ENS _getProvider(networkId) { - (0, index_js_2.assert)(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { + errors.assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { operation: "_getProvider()", }); } @@ -802,14 +824,14 @@ class AbstractProvider { } timer = null; this.off("block", listener); - reject((0, index_js_2.makeError)("timeout", "TIMEOUT", { reason: "timeout" })); + reject(errors.makeError("timeout", "TIMEOUT", { reason: "timeout" })); }, timeout); } listener(await this.getBlockNumber()); }); } async waitForBlock(blockTag) { - (0, index_js_2.assert)(false, "not implemented yet", "NOT_IMPLEMENTED", { + errors.assert(false, "not implemented yet", "NOT_IMPLEMENTED", { operation: "waitForBlock", }); } @@ -855,13 +877,13 @@ class AbstractProvider { case "network": return new UnmanagedSubscriber(sub.type); case "block": - return new subscriber_polling_js_1.PollingBlockSubscriber(this); + return new subscriberPolling.PollingBlockSubscriber(this); case "event": - return new subscriber_polling_js_1.PollingEventSubscriber(this, sub.filter); + return new subscriberPolling.PollingEventSubscriber(this, sub.filter); case "transaction": - return new subscriber_polling_js_1.PollingTransactionSubscriber(this, sub.hash); + return new subscriberPolling.PollingTransactionSubscriber(this, sub.hash); case "orphan": - return new subscriber_polling_js_1.PollingOrphanSubscriber(this, sub.filter); + return new subscriberPolling.PollingOrphanSubscriber(this, sub.filter); } throw new Error(`unsupported event: ${sub.type}`); } @@ -883,19 +905,19 @@ class AbstractProvider { } } async #hasSub(event, emitArgs) { - let sub = await getSubscription(event, this); + let sub = await getSubscription(event); // This is a log that is removing an existing log; we actually want // to emit an orphan event for the removed log if (sub.type === "event" && emitArgs && emitArgs.length > 0 && emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }, this); + sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }); } return this.#subs.get(sub.tag) || null; } async #getSub(event) { - const subscription = await getSubscription(event, this); + const subscription = await getSubscription(event); // Prevent tampering with our tag in any subclass' _getSubscriber const tag = subscription.tag; let sub = this.#subs.get(tag); @@ -948,7 +970,7 @@ class AbstractProvider { } const count = sub.listeners.length; sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new index_js_2.EventPayload(this, once ? null : listener, event); + const payload = new events.EventPayload(this, once ? null : listener, event); try { listener.call(this, ...args, payload); } @@ -1068,7 +1090,7 @@ class AbstractProvider { if (this.#pausedState == !!dropWhilePaused) { return; } - (0, index_js_2.assert)(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { + errors.assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { operation: "pause", }); } @@ -1102,12 +1124,11 @@ class AbstractProvider { } } } -exports.AbstractProvider = AbstractProvider; function _parseString(result, start) { try { const bytes = _parseBytes(result, start); if (bytes) { - return (0, index_js_2.toUtf8String)(bytes); + return utf8.toUtf8String(bytes); } } catch (error) { } @@ -1118,15 +1139,15 @@ function _parseBytes(result, start) { return null; } try { - const offset = (0, index_js_2.getNumber)((0, index_js_2.dataSlice)(result, start, start + 32)); - const length = (0, index_js_2.getNumber)((0, index_js_2.dataSlice)(result, offset, offset + 32)); - return (0, index_js_2.dataSlice)(result, offset + 32, offset + 32 + length); + const offset = maths.getNumber(data.dataSlice(result, start, start + 32)); + const length = maths.getNumber(data.dataSlice(result, offset, offset + 32)); + return data.dataSlice(result, offset + 32, offset + 32 + length); } catch (error) { } return null; } function numPad(value) { - const result = (0, index_js_2.toBeArray)(value); + const result = maths.toBeArray(value); if (result.length > 32) { throw new Error("internal; should not happen"); } @@ -1153,18 +1174,18 @@ function encodeBytes(datas) { byteCount += 32; } for (let i = 0; i < datas.length; i++) { - const data = (0, index_js_2.getBytes)(datas[i]); + const data$1 = data.getBytes(datas[i]); // Update the bytes offset result[i] = numPad(byteCount); // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; + result.push(numPad(data$1.length)); + result.push(bytesPad(data$1)); + byteCount += 32 + Math.ceil(data$1.length / 32) * 32; } - return (0, index_js_2.concat)(result); + return data.concat(result); } const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; -function parseOffchainLookup(data) { +function parseOffchainLookup(data$1) { const result = { sender: "", urls: [], @@ -1173,20 +1194,20 @@ function parseOffchainLookup(data) { extraData: "", errorArgs: [], }; - (0, index_js_2.assert)((0, index_js_2.dataLength)(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { + errors.assert(data.dataLength(data$1) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { reason: "insufficient OffchainLookup data", }); - const sender = (0, index_js_2.dataSlice)(data, 0, 32); - (0, index_js_2.assert)((0, index_js_2.dataSlice)(sender, 0, 12) === (0, index_js_2.dataSlice)(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { + const sender = data.dataSlice(data$1, 0, 32); + errors.assert(data.dataSlice(sender, 0, 12) === data.dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup sender", }); - result.sender = (0, index_js_2.dataSlice)(sender, 12); + result.sender = data.dataSlice(sender, 12); // Read the URLs from the response try { const urls = []; - const urlsOffset = (0, index_js_2.getNumber)((0, index_js_2.dataSlice)(data, 32, 64)); - const urlsLength = (0, index_js_2.getNumber)((0, index_js_2.dataSlice)(data, urlsOffset, urlsOffset + 32)); - const urlsData = (0, index_js_2.dataSlice)(data, urlsOffset + 32); + const urlsOffset = maths.getNumber(data.dataSlice(data$1, 32, 64)); + const urlsLength = maths.getNumber(data.dataSlice(data$1, urlsOffset, urlsOffset + 32)); + const urlsData = data.dataSlice(data$1, urlsOffset + 32); for (let u = 0; u < urlsLength; u++) { const url = _parseString(urlsData, u * 32); if (url == null) { @@ -1197,38 +1218,38 @@ function parseOffchainLookup(data) { result.urls = urls; } catch (error) { - (0, index_js_2.assert)(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { + errors.assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup urls", }); } // Get the CCIP calldata to forward try { - const calldata = _parseBytes(data, 64); + const calldata = _parseBytes(data$1, 64); if (calldata == null) { throw new Error("abort"); } result.calldata = calldata; } catch (error) { - (0, index_js_2.assert)(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { + errors.assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup calldata", }); } // Get the callbackSelector (bytes4) - (0, index_js_2.assert)((0, index_js_2.dataSlice)(data, 100, 128) === (0, index_js_2.dataSlice)(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { + errors.assert(data.dataSlice(data$1, 100, 128) === data.dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup callbaackSelector", }); - result.selector = (0, index_js_2.dataSlice)(data, 96, 100); + result.selector = data.dataSlice(data$1, 96, 100); // Get the extra data to send back to the contract as context try { - const extraData = _parseBytes(data, 128); + const extraData = _parseBytes(data$1, 128); if (extraData == null) { throw new Error("abort"); } result.extraData = extraData; } catch (error) { - (0, index_js_2.assert)(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { + errors.assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { reason: "corrupt OffchainLookup extraData", }); } @@ -1237,4 +1258,7 @@ function parseOffchainLookup(data) { .map((k) => result[k]); return result; } -//# sourceMappingURL=abstract-provider.js.map \ No newline at end of file + +exports.AbstractProvider = AbstractProvider; +exports.UnmanagedSubscriber = UnmanagedSubscriber; +//# sourceMappingURL=abstract-provider.js.map diff --git a/lib.commonjs/providers/abstract-provider.js.map b/lib.commonjs/providers/abstract-provider.js.map index 033abdb45..986d3f7f5 100644 --- a/lib.commonjs/providers/abstract-provider.js.map +++ b/lib.commonjs/providers/abstract-provider.js.map @@ -1 +1 @@ -{"version":3,"file":"abstract-provider.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,QAAQ;AACR,oBAAoB;AACpB,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAE3E,oDAAsD;AACtD,sDAAsD;AACtD,gDAoB2B;AAE3B,2CAKqB;AACrB,6CAAuC;AACvC,+CAOuB;AACvB,mEAKiC;AA4BjC,MAAM,kBAAkB,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IAAA,iBAAM,EACJ,IAAA,oBAAS,EAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,IAAA,oBAAS,EAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EACrD,0CAA0C,EAC1C,gBAAgB,EAChB;QACE,MAAM,EAAE,0CAA0C;KACnD,CACF,CAAC;IACF,MAAM,CAAC,QAAQ,GAAG,IAAA,oBAAS,EAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;IAE3C,6DAA6D;IAC7D,IAAI;QACF,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzC,IAAI,SAAS,IAAI,IAAI,EAAE;YACrB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;SAC1B;QACD,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;KAC9B;IAAC,OAAO,KAAK,EAAE;QACd,IAAA,iBAAM,EAAC,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE;YAClE,MAAM,EAAE,kCAAkC;SAC3C,CAAC,CAAC;KACJ;IAED,MAAM,CAAC,SAAS,GAAG,yCAAyC;SACzD,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAO,MAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhC,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"abstract-provider.js","sources":["../../lib.esm/providers/abstract-provider.js"],"sourcesContent":["/**\n * About Subclassing the Provider...\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/checks.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 { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse, } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse, } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber, } from \"./subscriber-polling.js\";\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return value && typeof value.then === \"function\";\n}\nfunction getTag(prefix, value) {\n return (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 // 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}\nexport class UnmanagedSubscriber {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\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 \"pending\":\n case \"debug\":\n case \"error\":\n case \"network\": {\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 {\n type: \"orphan\",\n tag: getTag(\"orphan\", event),\n filter: copy(event),\n };\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));\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() {\n return new Date().getTime();\n}\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\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 // @TODO: This should be a () => Promise so network can be\n // done when needed; or rely entirely on _detectNetwork?\n constructor(_network) {\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(() => {\n this.emit(\"network\", network, null);\n }, 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.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get provider() {\n return this;\n }\n get plugins() {\n return Array.from(this.#plugins.values());\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 getPlugin(name) {\n return this.#plugins.get(name) || null;\n }\n get disableCcipRead() {\n return this.#disableCcipRead;\n }\n set disableCcipRead(value) {\n this.#disableCcipRead = !!value;\n }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\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 }, 250);\n }\n return await perform;\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\", {\n action: \"sendCcipReadFetchRequest\",\n request,\n index: i,\n urls,\n });\n let errorMessage = \"unknown error\";\n const resp = await request.send();\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchResult\",\n request,\n result,\n });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchError\",\n request,\n result,\n });\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\", {\n reason: \"404_MISSING_RESOURCE\",\n transaction: tx,\n info: { url, errorMessage },\n });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages\n .map((m) => JSON.stringify(m))\n .join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx,\n info: { urls, errorMessages },\n });\n }\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\",\n });\n }\n // Sub-classes should override this and handle PerformActionRequest requests, calling\n // the super for any unhandled actions.\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 _getAddress(address) {\n return resolveAddress(address);\n }\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"latest\":\n case \"pending\":\n case \"safe\":\n case \"finalized\":\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 _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:\n 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 _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]);\n if (isPromise(addr)) {\n promises.push((async function () {\n request[key] = await addr;\n })());\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 () {\n request.blockTag = await blockTag;\n })());\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 = this._detectNetwork().then((network) => {\n this.emit(\"network\", network, null);\n return network;\n }, (error) => {\n // Reset the networkPromise on failure, so we will try again\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\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, // Possibly an explicit Network\n this._detectNetwork(), // The actual connected network\n ]);\n if (expected.networkId !== actual.networkId) {\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.networkId} => ${actual.networkId} `, \"NETWORK_ERROR\", {\n event: \"changed\",\n });\n }\n }\n return expected.clone();\n }\n async getEnergyPrice() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async getFeeData() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async estimateEnergy(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateEnergy\",\n 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 return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead &&\n isCallException(error) &&\n error.data &&\n attempt >= 0 &&\n blockTag === \"latest\" &&\n transaction.to != null &&\n dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to);\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\",\n transaction,\n 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, // @TODO: populate data?\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\",\n transaction,\n info: { data: error.data, errorArgs: ccipArgs.errorArgs },\n });\n const tx = {\n to: txSender,\n data: concat([\n ccipArgs.selector,\n encodeBytes([ccipResult, ccipArgs.extraData]),\n ]),\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\", {\n action: \"receiveCcipReadCallResult\",\n transaction: Object.assign({}, tx),\n result,\n });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadCallError\",\n transaction: Object.assign({}, tx),\n error,\n });\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\",\n blockHash: block,\n 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\",\n blockTag,\n 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 effectiveEnergyPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.energyPrice == null && params.effectiveEnergyPrice == 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 effectiveEnergyPrice\");\n }\n params.effectiveEnergyPrice = tx.energyPrice;\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(networkId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\",\n });\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 _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 _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 _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n // Event API; sub-classes should override this; any supported\n // event filter will have been munged into an EventFilter\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 return new PollingBlockSubscriber(this);\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 _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\" &&\n emitArgs &&\n emitArgs.length > 0 &&\n 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 = {\n subscriber,\n tag,\n addressableMap,\n nameMap,\n started: false,\n listeners: [],\n };\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 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\n .map(({ listener }) => listener)\n .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 // Sub-classes should override this to shutdown any sockets, etc.\n // but MUST call this super.shutdown.\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 }\n get paused() {\n return this.#pausedState != null;\n }\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 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 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: \"\",\n urls: [],\n calldata: \"\",\n selector: \"\",\n extraData: \"\",\n 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\"\n .split(/,/)\n .map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map"],"names":["defineProperties","isHexString","resolveAddress","assertArgument","network","Network","FetchRequest","assert","Block","formatBlock","Log","formatLog","TransactionReceipt","formatTransactionReceipt","TransactionResponse","formatTransactionResponse","getNumber","toQuantity","copyRequest","resolveProperties","getBigInt","FeeData","hexlify","isCallException","dataSlice","data","concat","Transaction","makeError","PollingBlockSubscriber","PollingEventSubscriber","PollingTransactionSubscriber","PollingOrphanSubscriber","EventPayload","toUtf8String","toBeArray","getBytes","dataLength"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;A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,EAAE,GAAG,CAAC;AAChD,QAAQ,IAAI,SAAS,IAAI,IAAI,EAAE;AAC/B,YAAY,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AACpC,QAAQ;AACR,QAAQ,MAAM,CAAC,SAAS,GAAG,SAAS;AACpC,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQlB,aAAM,CAAC,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE;AAC5E,YAAY,MAAM,EAAE,kCAAkC;AACtD,SAAS,CAAC;AACV,IAAI;AACJ,IAAI,MAAM,CAAC,SAAS,GAAG;AACvB,SAAS,KAAK,CAAC,GAAG;AAClB,SAAS,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,IAAI,OAAO,MAAM;AACjB;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-signer.d.ts.map b/lib.commonjs/providers/abstract-signer.d.ts.map index 41b30b933..35aaa1ca6 100644 --- a/lib.commonjs/providers/abstract-signer.d.ts.map +++ b/lib.commonjs/providers/abstract-signer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abstract-signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuC1C,8BAAsB,cAAc,CAClC,CAAC,SAAS,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAC3C,YAAW,MAAM;IAEjB,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAC;gBAEV,QAAQ,CAAC,EAAE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G,OAAO,CAAC,MAAM,CAAC,CAE7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-signer.js b/lib.commonjs/providers/abstract-signer.js index 2355b41ba..9d341617d 100644 --- a/lib.commonjs/providers/abstract-signer.js +++ b/lib.commonjs/providers/abstract-signer.js @@ -1,43 +1,64 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.VoidSigner = exports.AbstractSigner = void 0; +'use strict'; + +var checks = require('../address/checks.js'); +var index = require('../address/index.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../crypto/signature.js'); +var transaction = require('../transaction/transaction.js'); +var provider = require('./provider.js'); + /** * About Abstract Signer and subclassing * * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] */ -const checks_js_1 = require("../address/checks.js"); -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../transaction/index.js"); -const index_js_3 = require("../utils/index.js"); -const provider_js_1 = require("./provider.js"); function checkProvider(signer, operation) { if (signer.provider) { return signer.provider; } - (0, index_js_3.assert)(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); + errors.assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); } async function populate(signer, tx) { - let pop = (0, provider_js_1.copyRequest)(tx); + let pop = provider.copyRequest(tx); if (pop.to != null) { - pop.to = (0, checks_js_1.resolveAddress)(pop.to); + pop.to = checks.resolveAddress(pop.to); } if (pop.from != null) { const from = pop.from; - pop.from = Promise.all([signer.getAddress(), (0, checks_js_1.resolveAddress)(from)]).then(([address, from]) => { - (0, index_js_3.assertArgument)(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); + pop.from = Promise.all([signer.getAddress(), checks.resolveAddress(from)]).then(([address, from]) => { + errors.assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); return address; }); } else { pop.from = signer.getAddress(); } - return await (0, index_js_3.resolveProperties)(pop); + return await properties.resolveProperties(pop); } class AbstractSigner { provider; constructor(provider) { - (0, index_js_3.defineProperties)(this, { provider: provider || null }); + properties.defineProperties(this, { provider: provider || null }); } async getNonce(blockTag) { return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); @@ -58,8 +79,8 @@ class AbstractSigner { // Populate the chain ID const network = await this.provider.getNetwork(); if (pop.networkId != null) { - const networkId = (0, index_js_3.getBigInt)(pop.networkId); - (0, index_js_3.assertArgument)(networkId === network.networkId, "transaction networkId mismatch", "tx.networkId", tx.networkId); + const networkId = maths.getBigInt(pop.networkId); + errors.assertArgument(networkId === network.networkId, "transaction networkId mismatch", "tx.networkId", tx.networkId); } else { pop.networkId = network.networkId; @@ -76,13 +97,13 @@ class AbstractSigner { } else { // getFeeData has failed us. - (0, index_js_3.assert)(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { + errors.assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { operation: "signer.getFeeData", }); } //@TOOD: Don't await all over the place; save them up for // the end for better batching - return await (0, index_js_3.resolveProperties)(pop); + return await properties.resolveProperties(pop); } async estimateEnergy(tx) { return checkProvider(this, "estimateEnergy").estimateEnergy(await this.populateCall(tx)); @@ -91,22 +112,21 @@ class AbstractSigner { return checkProvider(this, "call").call(await this.populateCall(tx)); } async resolveName(name) { - return (0, index_js_1.getAddress)(name); + return index.getAddress(name); } async sendTransaction(tx) { const provider = checkProvider(this, "sendTransaction"); const pop = await this.populateTransaction(tx); delete pop.from; - const txObj = index_js_2.Transaction.from(pop); + const txObj = transaction.Transaction.from(pop); return await provider.broadcastTransaction(await this.signTransaction(txObj)); } } -exports.AbstractSigner = AbstractSigner; class VoidSigner extends AbstractSigner { address; constructor(address, provider) { super(provider); - (0, index_js_3.defineProperties)(this, { address }); + properties.defineProperties(this, { address }); } async getAddress() { return this.address; @@ -115,7 +135,7 @@ class VoidSigner extends AbstractSigner { return new VoidSigner(this.address, provider); } #throwUnsupported(suffix, operation) { - (0, index_js_3.assert)(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { + errors.assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { operation, }); } @@ -129,5 +149,7 @@ class VoidSigner extends AbstractSigner { this.#throwUnsupported("typed-data", "signTypedData"); } } + +exports.AbstractSigner = AbstractSigner; exports.VoidSigner = VoidSigner; -//# sourceMappingURL=abstract-signer.js.map \ No newline at end of file +//# sourceMappingURL=abstract-signer.js.map diff --git a/lib.commonjs/providers/abstract-signer.js.map b/lib.commonjs/providers/abstract-signer.js.map index a68aae586..fc4347d41 100644 --- a/lib.commonjs/providers/abstract-signer.js.map +++ b/lib.commonjs/providers/abstract-signer.js.map @@ -1 +1 @@ -{"version":3,"file":"abstract-signer.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,oDAAsD;AACtD,kDAAiD;AACjD,sDAAsD;AACtD,gDAM2B;AAE3B,+CAA4C;AAa5C,SAAS,aAAa,CAAC,MAAs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AM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAClC,CAAC;IACJ,CAAC;CASF;AAjHD,wCAiHC;AAED,MAAa,UAAW,SAAQ,cAAc;IACnC,OAAO,CAAU;IAE1B,YAAY,OAAe,EAAE,QAA0B;QACrD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAA,2BAAgB,EAAa,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,OAAO,CAAC,QAAyB;QAC/B,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED,iBAAiB,CAAC,MAAc,EAAE,SAAiB;QACjD,IAAA,iBAAM,EAAC,KAAK,EAAE,0BAA0B,MAAM,EAAE,EAAE,uBAAuB,EAAE;YACzE,SAAS;SACV,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAsB;QAC1C,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAA4B;QAC5C,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;QAE1B,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACxD,CAAC;CACF;AArCD,gCAqCC"} \ No newline at end of file +{"version":3,"file":"abstract-signer.js","sources":["../../lib.esm/providers/abstract-signer.js"],"sourcesContent":["/**\n * About Abstract Signer and subclassing\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/checks.js\";\nimport { getAddress } 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);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).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}\nexport class AbstractSigner {\n provider;\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.energyLimit == null) {\n pop.energyLimit = await this.estimateEnergy(pop);\n }\n // Populate the chain ID\n const network = await this.provider.getNetwork();\n if (pop.networkId != null) {\n const networkId = getBigInt(pop.networkId);\n assertArgument(networkId === network.networkId, \"transaction networkId mismatch\", \"tx.networkId\", tx.networkId);\n }\n else {\n pop.networkId = network.networkId;\n }\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n // We need to auto-detect the intended type of this transaction...\n if (feeData.energyPrice != null) {\n // Network doesn't support EIP-1559...\n // Populate missing fee data\n if (pop.energyPrice == null) {\n pop.energyPrice = feeData.energyPrice;\n }\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 //@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 estimateEnergy(tx) {\n return checkProvider(this, \"estimateEnergy\").estimateEnergy(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 return getAddress(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}\nexport class VoidSigner extends AbstractSigner {\n address;\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\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"],"names":["assert","copyRequest","resolveAddress","assertArgument","resolveProperties","defineProperties","getBigInt","getAddress","Transaction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAMA,SAAS,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE;AAC1C,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE;AACzB,QAAQ,OAAO,MAAM,CAAC,QAAQ;AAC9B,IAAI;AACJ,IAAIA,aAAM,CAAC,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,CAAC;AAC7E;AACA,eAAe,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE;AACpC,IAAI,IAAI,GAAG,GAAGC,oBAAW,CA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KAAK,CAAC,QAAQ,CAAC;AACvB,QAAQH,2BAAgB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC;AAC3C,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,IAAI,CAAC,OAAO;AAC3B,IAAI;AACJ,IAAI,OAAO,CAAC,QAAQ,EAAE;AACtB,QAAQ,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;AACrD,IAAI;AACJ,IAAI,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE;AACzC,QAAQL,aAAM,CAAC,KAAK,EAAE,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC,EAAE,uBAAuB,EAAE;AACnF,YAAY,SAAS;AACrB,SAAS,CAAC;AACV,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,EAAE,EAAE;AAC9B,QAAQ,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC;AACjE,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC;AACzD,IAAI;AACJ,IAAI,MAAM,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;AAC9C,QAAQ,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,eAAe,CAAC;AAC7D,IAAI;AACJ;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/community.d.ts.map b/lib.commonjs/providers/community.d.ts.map index f8a2a68bc..e36ebbacf 100644 --- a/lib.commonjs/providers/community.d.ts.map +++ b/lib.commonjs/providers/community.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAChC;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA4BzD"} \ No newline at end of file +{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAC/B;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA4BzD"} \ No newline at end of file diff --git a/lib.commonjs/providers/community.js b/lib.commonjs/providers/community.js index 68d332987..f46e060ae 100644 --- a/lib.commonjs/providers/community.js +++ b/lib.commonjs/providers/community.js @@ -1,4 +1,5 @@ -"use strict"; +'use strict'; + /** * There are many awesome community services that provide Core * nodes both for developers just starting out and for large-scale @@ -6,8 +7,6 @@ * * @_section: api/providers/thirdparty: Community Providers [thirdparty] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.showThrottleMessage = void 0; // Show the throttle message only once per service const shown = new Set(); /** @@ -34,5 +33,6 @@ function showThrottleMessage(service) { console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); console.log(""); } + exports.showThrottleMessage = showThrottleMessage; -//# sourceMappingURL=community.js.map \ No newline at end of file +//# sourceMappingURL=community.js.map diff --git a/lib.commonjs/providers/community.js.map b/lib.commonjs/providers/community.js.map index 59ada24ff..6c088f295 100644 --- a/lib.commonjs/providers/community.js.map +++ b/lib.commonjs/providers/community.js.map @@ -1 +1 @@ -{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,OAAe;IACjD,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QACtB,OAAO;KACR;IACD,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CACT,6BAA6B,OAAO,sCAAsC,CAC3E,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACT,2EAA2E,CAC5E,CAAC;IACF,OAAO,CAAC,GAAG,CACT,oEAAoE,CACrE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACT,yEAAyE,CAC1E,CAAC;IACF,OAAO,CAAC,GAAG,CACT,wEAAwE,CACzE,CAAC;IACF,OAAO,CAAC,GAAG,CACT,+EAA+E,CAChF,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC;AA5BD,kDA4BC"} \ No newline at end of file +{"version":3,"file":"community.js","sources":["../../lib.esm/providers/community.js"],"sourcesContent":["/**\n * There are many awesome community services that provide Core\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in tht console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n}\n//# sourceMappingURL=community.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,OAAO,EAAE;AAC7C,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;AAC5B,QAAQ;AACR,IAAI;AACJ,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;AACtB,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;AAC7C,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,0BAA0B,EAAE,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AACnB,IAAI,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC;AAC5F,IAAI,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC;AACrF,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AACnB,IAAI,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC;AAC1F,IAAI,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC;AACzF,IAAI,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC;AAChG,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AACnB;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/contracts.d.ts.map b/lib.commonjs/providers/contracts.d.ts.map index 085cff0c7..29a278289 100644 --- a/lib.commonjs/providers/contracts.d.ts.map +++ b/lib.commonjs/providers/contracts.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAG1B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7D,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAGvD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC5E"} \ No newline at end of file +{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAG1B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7D,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAGvD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC3E"} \ No newline at end of file diff --git a/lib.commonjs/providers/contracts.js b/lib.commonjs/providers/contracts.js index 705cd38a9..7cd373ee0 100644 --- a/lib.commonjs/providers/contracts.js +++ b/lib.commonjs/providers/contracts.js @@ -1,3 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=contracts.js.map \ No newline at end of file +'use strict'; + +//# sourceMappingURL=contracts.js.map diff --git a/lib.commonjs/providers/contracts.js.map b/lib.commonjs/providers/contracts.js.map index 42ac4de89..749bf4924 100644 --- a/lib.commonjs/providers/contracts.js.map +++ b/lib.commonjs/providers/contracts.js.map @@ -1 +1 @@ -{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"contracts.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/providers/default-provider.d.ts.map b/lib.commonjs/providers/default-provider.d.ts.map index a7b02c6c0..6e1d55294 100644 --- a/lib.commonjs/providers/default-provider.d.ts.map +++ b/lib.commonjs/providers/default-provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAC5C,OAAO,CAAC,EAAE,GAAG,GACZ,gBAAgB,CA6FlB"} \ No newline at end of file +{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxD,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAC5C,OAAO,CAAC,EAAE,GAAG,GACX,gBAAgB,CA6FlB"} \ No newline at end of file diff --git a/lib.commonjs/providers/default-provider.js b/lib.commonjs/providers/default-provider.js index c2e69a8f4..0fa81d2d9 100644 --- a/lib.commonjs/providers/default-provider.js +++ b/lib.commonjs/providers/default-provider.js @@ -1,16 +1,22 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getDefaultProvider = void 0; -const index_js_1 = require("../utils/index.js"); -const provider_ankr_js_1 = require("./provider-ankr.js"); -const provider_alchemy_js_1 = require("./provider-alchemy.js"); -const provider_cloudflare_js_1 = require("./provider-cloudflare.js"); -const provider_infura_js_1 = require("./provider-infura.js"); -//import { PocketProvider } from "./provider-pocket.js"; -const provider_quicknode_js_1 = require("./provider-quicknode.js"); -const provider_fallback_js_1 = require("./provider-fallback.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -const provider_websocket_js_1 = require("./provider-websocket.js"); +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var providerAnkr = require('./provider-ankr.js'); +var providerAlchemy = require('./provider-alchemy.js'); +var providerCloudflare = require('./provider-cloudflare.js'); +var providerInfura = require('./provider-infura.js'); +var providerQuicknode = require('./provider-quicknode.js'); +var providerFallback = require('./provider-fallback.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); +var providerWebsocket = require('./provider-websocket.js'); + function isWebSocketLike(value) { return (value && typeof value.send === "function" && @@ -21,16 +27,16 @@ function getDefaultProvider(network, options) { options = {}; } if (typeof network === "string" && network.match(/^https?:/)) { - return new provider_jsonrpc_js_1.JsonRpcProvider(network); + return new providerJsonrpc.JsonRpcProvider(network); } if ((typeof network === "string" && network.match(/^wss?:/)) || isWebSocketLike(network)) { - return new provider_websocket_js_1.WebSocketProvider(network); + return new providerWebsocket.WebSocketProvider(network); } const providers = []; if (options.alchemy !== "-") { try { - providers.push(new provider_alchemy_js_1.AlchemyProvider(network, options.alchemy)); + providers.push(new providerAlchemy.AlchemyProvider(network, options.alchemy)); } catch (error) { console.log(error); @@ -38,7 +44,7 @@ function getDefaultProvider(network, options) { } if (options.ankr !== "-" && options.ankr != null) { try { - providers.push(new provider_ankr_js_1.AnkrProvider(network, options.ankr)); + providers.push(new providerAnkr.AnkrProvider(network, options.ankr)); } catch (error) { console.log(error); @@ -46,7 +52,7 @@ function getDefaultProvider(network, options) { } if (options.cloudflare !== "-") { try { - providers.push(new provider_cloudflare_js_1.CloudflareProvider(network)); + providers.push(new providerCloudflare.CloudflareProvider(network)); } catch (error) { console.log(error); @@ -60,43 +66,44 @@ function getDefaultProvider(network, options) { projectSecret = projectId.projectSecret; projectId = projectId.projectId; } - providers.push(new provider_infura_js_1.InfuraProvider(network, projectId, projectSecret)); + providers.push(new providerInfura.InfuraProvider(network, projectId, projectSecret)); } catch (error) { console.log(error); } } /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } - */ + if (options.pocket !== "-") { + try { + let appId = options.pocket; + let secretKey: undefined | string = undefined; + let loadBalancer: undefined | boolean = undefined; + if (typeof(appId) === "object") { + loadBalancer = !!appId.loadBalancer; + secretKey = appId.secretKey; + appId = appId.appId; + } + providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); + } catch (error) { console.log(error); } + } +*/ if (options.quicknode !== "-") { try { let token = options.quicknode; - providers.push(new provider_quicknode_js_1.QuickNodeProvider(network, token)); + providers.push(new providerQuicknode.QuickNodeProvider(network, token)); } catch (error) { console.log(error); } } - (0, index_js_1.assert)(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { + errors.assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { operation: "getDefaultProvider", }); if (providers.length === 1) { return providers[0]; } - return new provider_fallback_js_1.FallbackProvider(providers); + return new providerFallback.FallbackProvider(providers); } + exports.getDefaultProvider = getDefaultProvider; -//# sourceMappingURL=default-provider.js.map \ No newline at end of file +//# sourceMappingURL=default-provider.js.map diff --git a/lib.commonjs/providers/default-provider.js.map b/lib.commonjs/providers/default-provider.js.map index efb7dce63..445a2268f 100644 --- a/lib.commonjs/providers/default-provider.js.map +++ b/lib.commonjs/providers/default-provider.js.map @@ -1 +1 @@ -{"version":3,"file":"default-provider.js","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":";;;AAAA,gDAA2C;AAE3C,yDAAkD;AAClD,+DAAwD;AACxD,qEAA8D;AAC9D,6DAAsD;AACtD,wDAAwD;AACxD,mEAA4D;AAE5D,iEAA0D;AAC1D,+DAAwD;AACxD,mEAA4D;AAM5D,SAAS,eAAe,CAAC,KAAU;IACjC,OAAO,CACL,KAAK;QACL,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;QAChC,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU,CAClC,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAChC,OAA4C,EAC5C,OAAa;IAEb,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,GAAG,EAAE,CAAC;KACd;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;QAC5D,OAAO,IAAI,qCAAe,CAAC,OAAO,CAAC,CAAC;KACrC;IAED,IACE,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxD,eAAe,CAAC,OAAO,CAAC,EACxB;QACA,OAAO,IAAI,yCAAiB,CAAC,OAAO,CAAC,CAAC;KACvC;IAED,MAAM,SAAS,GAA4B,EAAE,CAAC;IAE9C,IAAI,OAAO,C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AAO,CAAC,SAAS,KAAK,GAAG,EAAE;QAC7B,IAAI;YACF,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC;YAC9B,SAAS,CAAC,IAAI,CAAC,IAAI,yCAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;SACvD;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACpB;KACF;IAED,IAAA,iBAAM,EACJ,SAAS,CAAC,MAAM,EAChB,6BAA6B,EAC7B,uBAAuB,EACvB;QACE,SAAS,EAAE,oBAAoB;KAChC,CACF,CAAC;IAEF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1B,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;KACrB;IAED,OAAO,IAAI,uCAAgB,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAhGD,gDAgGC"} \ No newline at end of file +{"version":3,"file":"default-provider.js","sources":["../../lib.esm/providers/default-provider.js"],"sourcesContent":["import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value &&\n typeof value.send === \"function\" &&\n typeof value.close === \"function\");\n}\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n if (typeof network === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if ((typeof network === \"string\" && network.match(/^wss?:/)) ||\n isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n const providers = [];\n if (options.alchemy !== \"-\") {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.ankr !== \"-\" && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.cloudflare !== \"-\") {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.infura !== \"-\") {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof projectId === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) {\n console.log(error);\n }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n*/\n if (options.quicknode !== \"-\") {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) {\n console.log(error);\n }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\",\n });\n if (providers.length === 1) {\n return providers[0];\n }\n return new FallbackProvider(providers);\n}\n//# sourceMappingURL=default-provider.js.map"],"names":["JsonRpcProvider","WebSocketProvider","AlchemyProvider","AnkrProvider","CloudflareProvider","InfuraProvider","QuickNodeProvider","assert","FallbackProvider"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,SAAS,eAAe,CAAC,KAAK,EAAE;AAChC,IAAI,QAAQ,KAAK;AACjB,QAAQ,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;AACxC,QAAQ,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU;AACzC;AACO,SAAS,kBAAkB,C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AAS,CAAC,MAAM,KAAK,CAAC,EAAE;AAChC,QAAQ,OAAO,SAAS,CAAC,CAAC,CAAC;AAC3B,IAAI;AACJ,IAAI,OAAO,IAAIC,iCAAgB,CAAC,SAAS,CAAC;AAC1C;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/format.d.ts.map b/lib.commonjs/providers/format.d.ts.map index da5b2ee35..1c35b4b35 100644 --- a/lib.commonjs/providers/format.d.ts.map +++ b/lib.commonjs/providers/format.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAIzB,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAOzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAOtD;AAKD,wBAAgB,MAAM,CACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GACvC,UAAU,CA+BZ;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAejD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAG7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAmBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAE/C;AAoBD,wBAAgB,WAAW,CAAC,KAA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AK,EAAE,GAAG,GAAG,SAAS,CAEtD;AA6BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,wBAAwB,CAE7E;AAED,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,GAAG,GACR,yBAAyB,CA0G3B"} \ No newline at end of file diff --git a/lib.commonjs/providers/format.js b/lib.commonjs/providers/format.js index 061ec8057..77f4b533b 100644 --- a/lib.commonjs/providers/format.js +++ b/lib.commonjs/providers/format.js @@ -1,13 +1,35 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.formatTransactionResponse = exports.formatTransactionReceipt = exports.formatReceiptLog = exports.formatBlock = exports.formatLog = exports.formatUint256 = exports.formatHash = exports.formatData = exports.formatBoolean = exports.object = exports.arrayOf = exports.allowNull = void 0; +'use strict'; + +var index = require('../address/index.js'); +var contractAddress = require('../address/contract-address.js'); +var accesslist = require('../transaction/accesslist.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); + /** * @_ignore */ -const index_js_1 = require("../address/index.js"); -const contract_address_js_1 = require("../address/contract-address.js"); -const index_js_2 = require("../transaction/index.js"); -const index_js_3 = require("../utils/index.js"); const BN_0 = BigInt(0); function allowNull(format, nullValue) { return function (value) { @@ -17,7 +39,6 @@ function allowNull(format, nullValue) { return format(value); }; } -exports.allowNull = allowNull; function arrayOf(format) { return (array) => { if (!Array.isArray(array)) { @@ -26,7 +47,6 @@ function arrayOf(format) { return array.map((i) => format(i)); }; } -exports.arrayOf = arrayOf; // Requires an object which matches a fleet of other formatters // Any FormatFunc may return `undefined` to have the value omitted // from the result object. Calls preserve `this`. @@ -51,13 +71,12 @@ function object(format, altNames) { } catch (error) { const message = error instanceof Error ? error.message : "not-an-error"; - (0, index_js_3.assert)(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); + errors.assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); } } return result; }; } -exports.object = object; function formatBoolean(value) { switch (value) { case true: @@ -67,55 +86,50 @@ function formatBoolean(value) { case "false": return false; } - (0, index_js_3.assertArgument)(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); + errors.assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); } -exports.formatBoolean = formatBoolean; function formatData(value) { - (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(value, true), "invalid data", "value", value); + errors.assertArgument(data.isHexString(value, true), "invalid data", "value", value); return value; } -exports.formatData = formatData; function formatHash(value) { - (0, index_js_3.assertArgument)((0, index_js_3.isHexString)(value, 32), "invalid hash", "value", value); + errors.assertArgument(data.isHexString(value, 32), "invalid hash", "value", value); return value; } -exports.formatHash = formatHash; function formatUint256(value) { - if (!(0, index_js_3.isHexString)(value)) { + if (!data.isHexString(value)) { throw new Error("invalid uint256"); } - return (0, index_js_3.zeroPadValue)(value, 32); + return data.zeroPadValue(value, 32); } -exports.formatUint256 = formatUint256; const _formatLog = object({ - address: index_js_1.getAddress, + address: index.getAddress, blockHash: formatHash, - blockNumber: index_js_3.getNumber, + blockNumber: maths.getNumber, data: formatData, - index: index_js_3.getNumber, + index: maths.getNumber, removed: allowNull(formatBoolean, false), topics: arrayOf(formatHash), transactionHash: formatHash, - transactionIndex: index_js_3.getNumber, + transactionIndex: maths.getNumber, }, { index: ["logIndex"], }); function formatLog(value) { return _formatLog(value); } -exports.formatLog = formatLog; const _formatBlock = object({ hash: allowNull(formatHash), parentHash: formatHash, - number: index_js_3.getNumber, - timestamp: index_js_3.getNumber, + number: maths.getNumber, + timestamp: maths.getNumber, nonce: allowNull(formatData), - difficulty: index_js_3.getBigInt, - energyLimit: index_js_3.getBigInt, - energyUsed: index_js_3.getBigInt, - miner: allowNull(index_js_1.getAddress), + difficulty: maths.getBigInt, + energyLimit: maths.getBigInt, + energyUsed: maths.getBigInt, + miner: allowNull(index.getAddress), extraData: formatData, - baseFeePerEnergy: allowNull(index_js_3.getBigInt), + baseFeePerEnergy: allowNull(maths.getBigInt), }); function formatBlock(value) { const result = _formatBlock(value); @@ -127,15 +141,14 @@ function formatBlock(value) { }); return result; } -exports.formatBlock = formatBlock; const _formatReceiptLog = object({ - transactionIndex: index_js_3.getNumber, - blockNumber: index_js_3.getNumber, + transactionIndex: maths.getNumber, + blockNumber: maths.getNumber, transactionHash: formatHash, - address: index_js_1.getAddress, + address: index.getAddress, topics: arrayOf(formatHash), data: formatData, - index: index_js_3.getNumber, + index: maths.getNumber, blockHash: formatHash, }, { index: ["logIndex"], @@ -143,25 +156,24 @@ const _formatReceiptLog = object({ function formatReceiptLog(value) { return _formatReceiptLog(value); } -exports.formatReceiptLog = formatReceiptLog; const _formatTransactionReceipt = object({ - to: allowNull(index_js_1.getAddress, null), - from: allowNull(index_js_1.getAddress, null), - contractAddress: allowNull(index_js_1.getAddress, null), + to: allowNull(index.getAddress, null), + from: allowNull(index.getAddress, null), + contractAddress: allowNull(index.getAddress, null), // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: index_js_3.getNumber, - root: allowNull(index_js_3.hexlify), - energyUsed: index_js_3.getBigInt, + index: maths.getNumber, + root: allowNull(data.hexlify), + energyUsed: maths.getBigInt, logsBloom: allowNull(formatData), blockHash: formatHash, hash: formatHash, logs: arrayOf(formatReceiptLog), - blockNumber: index_js_3.getNumber, + blockNumber: maths.getNumber, //confirmations: allowNull(getNumber, null), - cumulativeEnergyUsed: index_js_3.getBigInt, - effectiveEnergyPrice: allowNull(index_js_3.getBigInt), - status: allowNull(index_js_3.getNumber), - type: allowNull(index_js_3.getNumber, 0), + cumulativeEnergyUsed: maths.getBigInt, + effectiveEnergyPrice: allowNull(maths.getBigInt), + status: allowNull(maths.getNumber), + type: allowNull(maths.getNumber, 0), }, { effectiveEnergyPrice: ["energyPrice"], hash: ["transactionHash"], @@ -170,11 +182,10 @@ const _formatTransactionReceipt = object({ function formatTransactionReceipt(value) { return _formatTransactionReceipt(value); } -exports.formatTransactionReceipt = formatTransactionReceipt; function formatTransactionResponse(value) { // Some clients (TestRPC) do strange things like return 0x0 for the // 0 address; correct this to be a real address - if (value.to && !(0, index_js_1.getAddress)(value.to) && (0, index_js_3.getBigInt)(value.to) === BN_0) { + if (value.to && !index.getAddress(value.to) && maths.getBigInt(value.to) === BN_0) { value.to = "0x0000000000000000000000000000000000000000"; } const result = object({ @@ -183,29 +194,29 @@ function formatTransactionResponse(value) { if (value === "0x" || value == null) { return 0; } - return (0, index_js_3.getNumber)(value); + return maths.getNumber(value); }, - accessList: allowNull(index_js_2.accessListify, null), + accessList: allowNull(accesslist.accessListify, null), blockHash: allowNull(formatHash, null), - blockNumber: allowNull(index_js_3.getNumber, null), - transactionIndex: allowNull(index_js_3.getNumber, null), + blockNumber: allowNull(maths.getNumber, null), + transactionIndex: allowNull(maths.getNumber, null), //confirmations: allowNull(getNumber, null), - from: index_js_1.getAddress, - maxFeePerEnergy: allowNull(index_js_3.getBigInt), - energyLimit: index_js_3.getBigInt, - to: allowNull(index_js_1.getAddress, null), - value: index_js_3.getBigInt, - nonce: index_js_3.getNumber, + from: index.getAddress, + maxFeePerEnergy: allowNull(maths.getBigInt), + energyLimit: maths.getBigInt, + to: allowNull(index.getAddress, null), + value: maths.getBigInt, + nonce: maths.getNumber, data: formatData, - creates: allowNull(index_js_1.getAddress, null), - networkId: allowNull(index_js_3.getBigInt, null), + creates: allowNull(index.getAddress, null), + networkId: allowNull(maths.getBigInt, null), }, { data: ["input"], energyLimit: ["energy"], })(value); // If to and creates are empty, populate the creates from the value if (result.to == null && result.creates == null) { - result.creates = (0, contract_address_js_1.getCreateAddress)(result); + result.creates = contractAddress.getCreateAddress(result); } // Compute the signature if (value.signature) { @@ -223,43 +234,55 @@ function formatTransactionResponse(value) { } // @TODO: check networkId /* - if (value.networkId != null) { - let networkId = value.networkId; - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - result.networkId = networkId; - - } else { - let networkId = value.networkId; - - // geth-etc returns networkId - if (networkId == null && result.v == null) { - networkId = value.networkId; - } - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - if (typeof(networkId) !== "number" && result.v != null) { - networkId = (result.v - 35) / 2; - if (networkId < 0) { networkId = 0; } - networkId = parseInt(networkId); - } - - if (typeof(networkId) !== "number") { networkId = 0; } - - result.networkId = networkId; - } - */ + if (value.networkId != null) { + let networkId = value.networkId; + + if (isHexString(networkId)) { + networkId = BigNumber.from(networkId).toNumber(); + } + + result.networkId = networkId; + + } else { + let networkId = value.networkId; + + // geth-etc returns networkId + if (networkId == null && result.v == null) { + networkId = value.networkId; + } + + if (isHexString(networkId)) { + networkId = BigNumber.from(networkId).toNumber(); + } + + if (typeof(networkId) !== "number" && result.v != null) { + networkId = (result.v - 35) / 2; + if (networkId < 0) { networkId = 0; } + networkId = parseInt(networkId); + } + + if (typeof(networkId) !== "number") { networkId = 0; } + + result.networkId = networkId; + } + */ // 0x0000... should actually be null - if (result.blockHash && (0, index_js_3.getBigInt)(result.blockHash) === BN_0) { + if (result.blockHash && maths.getBigInt(result.blockHash) === BN_0) { result.blockHash = null; } return result; } + +exports.allowNull = allowNull; +exports.arrayOf = arrayOf; +exports.formatBlock = formatBlock; +exports.formatBoolean = formatBoolean; +exports.formatData = formatData; +exports.formatHash = formatHash; +exports.formatLog = formatLog; +exports.formatReceiptLog = formatReceiptLog; +exports.formatTransactionReceipt = formatTransactionReceipt; exports.formatTransactionResponse = formatTransactionResponse; -//# sourceMappingURL=format.js.map \ No newline at end of file +exports.formatUint256 = formatUint256; +exports.object = object; +//# sourceMappingURL=format.js.map diff --git a/lib.commonjs/providers/format.js.map b/lib.commonjs/providers/format.js.map index ee93c25ce..30eb78244 100644 --- a/lib.commonjs/providers/format.js.map +++ b/lib.commonjs/providers/format.js.map @@ -1 +1 @@ -{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,kDAAiD;AACjD,wEAAkE;AAClE,sDAAwD;AACxD,gDAQ2B;AAS3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAIvB,SAAgB,SAAS,CAAC,MAAkB,EAAE,SAAe;IAC3D,OAAO,UAAU,KAAU;QACzB,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC;AAPD,8BAOC;AAED,SAAgB,OAAO,CAAC,MAAkB;IACxC,OAAO,CAAC,KAAU,EAAE,EAAE;QACpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;SACjC;QACD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC;AACJ,CAAC;AAPD,0BAOC;AAED,+DAA+D;AAC/D,kEAAkE;AAClE,iDAAiD;AACjD,SAAgB,MAAM,CACpB,MAAkC,EAClC,QAAwC;IAExC,OAAO,CAAC,KAAU,EAAE,EAAE;QACpB,MAAM,MAAM,GAAQ,EAAE,CAAC;QACvB,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACxB,IAAI,MAAM,GAAG,GAAG,CAAC;YACjB,IAAI,QAAQ,IAAI,GAAG,IAAI,QAAQ,IAAI,CAAC,CAAC,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AC,SAAS,CAAC,KAAK,IAAI,EAAE;QAC5D,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;KACzB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA5GD,8DA4GC"} \ No newline at end of file +{"version":3,"file":"format.js","sources":["../../lib.esm/providers/format.js"],"sourcesContent":["/**\n * @_ignore\n */\nimport { getAddress } from \"../address/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.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) {\n return (array) => {\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 number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n energyLimit: getBigInt,\n energyUsed: getBigInt,\n miner: allowNull(getAddress),\n extraData: formatData,\n baseFeePerEnergy: allowNull(getBigInt),\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 energyUsed: getBigInt,\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeEnergyUsed: getBigInt,\n effectiveEnergyPrice: allowNull(getBigInt),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0),\n}, {\n effectiveEnergyPrice: [\"energyPrice\"],\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 && !getAddress(value.to) && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n //confirmations: allowNull(getNumber, null),\n from: getAddress,\n maxFeePerEnergy: allowNull(getBigInt),\n energyLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n networkId: allowNull(getBigInt, null),\n }, {\n data: [\"input\"],\n energyLimit: [\"energy\"],\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 // Compute the signature\n if (value.signature) {\n result.signature = value.signature;\n }\n else {\n result.signature = value;\n }\n // Some backends omit networkId on legacy transactions, but we can compute it\n if (result.networkId == null) {\n const networkId = result.signature.legacynetworkId;\n if (networkId != null) {\n result.networkId = networkId;\n }\n }\n // @TODO: check networkId\n /*\n if (value.networkId != null) {\n let networkId = value.networkId;\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n result.networkId = networkId;\n\n } else {\n let networkId = value.networkId;\n\n // geth-etc returns networkId\n if (networkId == null && result.v == null) {\n networkId = value.networkId;\n }\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n if (typeof(networkId) !== \"number\" && result.v != null) {\n networkId = (result.v - 35) / 2;\n if (networkId < 0) { networkId = 0; }\n networkId = parseInt(networkId);\n }\n\n if (typeof(networkId) !== \"number\") { networkId = 0; }\n\n result.networkId = networkId;\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"],"names":["assert","assertArgument","isHexString","zeroPadValue","getAddress","getNumber","getBigInt","hexlify","accessListify","getCreateAddress"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAKA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACf,SAAS,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE;AAC7C,IAAI,OAAO,UAAU,KAAK,EAAE;AAC5B,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;AAC3B,YAAY,OAAO,SAAS;AAC5B,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,KAAK,CAAC;AAC5B,IAAI,CAAC;AACL;AACO,SAAS,OAAO,CAAC,MAAM,EAAE;AAChC,IAAI,OAAO,CAAC,KAAK,KAAK;AACtB,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACnC,YAAY,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC;AAC3C,QAAQ;AACR,QAAQ,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;AAC1C,IAAI,CAAC;AACL;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE;AACzC,IAAI,OAAO,CAAC,KAAK,KAAK;AACtB,QAAQ,MAAM,MAAM,GAAG,EAAE;AACzB,QAAQ,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;AAClC,YAAY,IAAI,MAAM,GAAG,GAAG;AAC5B,YAAY,IAAI,QAAQ,IAAI,GAAG,IAAI,QAAQ,IAAI,EAAE,MAAM,IAAI,KAAK,CAAC,EAAE;AACnE,gBAAgB,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE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I,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE;AAClC,QAAQ,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,eAAe;AAC1D,QAAQ,IAAI,SAAS,IAAI,IAAI,EAAE;AAC/B,YAAY,MAAM,CAAC,SAAS,GAAG,SAAS;AACxC,QAAQ;AACR,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAI,IAAI,MAAM,CAAC,SAAS,IAAIH,eAAS,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;AAClE,QAAQ,MAAM,CAAC,SAAS,GAAG,IAAI;AAC/B,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/formatting.d.ts.map b/lib.commonjs/providers/formatting.d.ts.map index 65b377ed3..5d7ddfb6b 100644 --- a/lib.commonjs/providers/formatting.d.ts.map +++ b/lib.commonjs/providers/formatting.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwDH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;IAEhC,YAAY,EAA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AG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CACnB"} \ No newline at end of file +{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwDH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;IAEhC,YAAY,EAAE,aAAa,CAAC,MAAM,GAAG,yBAAyB,CAAC,CAAC;CAChE;AAKD,MAAM,WAAW,SAAS;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE9B,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAKD,MAAM,WAAW,wBAAwB;IACxC,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,IAAI,GAAG,MAAM,CAAC;IAE/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAE/B,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErC,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;CACpB;AAmBD,MAAM,WAAW,yBAAyB;IACzC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CAClB"} \ No newline at end of file diff --git a/lib.commonjs/providers/formatting.js b/lib.commonjs/providers/formatting.js index e8f629d94..f393db163 100644 --- a/lib.commonjs/providers/formatting.js +++ b/lib.commonjs/providers/formatting.js @@ -1,8 +1,3 @@ -"use strict"; -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=formatting.js.map \ No newline at end of file +'use strict'; + +//# sourceMappingURL=formatting.js.map diff --git a/lib.commonjs/providers/formatting.js.map b/lib.commonjs/providers/formatting.js.map index 4eb88d886..b33094d3d 100644 --- a/lib.commonjs/providers/formatting.js.map +++ b/lib.commonjs/providers/formatting.js.map @@ -1 +1 @@ -{"version":3,"file":"formatting.js","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":";AAAA;;;;GAIG"} \ No newline at end of file +{"version":3,"file":"formatting.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/providers/index.d.ts.map b/lib.commonjs/providers/index.d.ts.map index 206142646..25fe43a45 100644 --- a/lib.commonjs/providers/index.d.ts.map +++ b/lib.commonjs/providers/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,GAEZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D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,QAAQ,EACR,UAAU,EACV,wBAAwB,GACzB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,yBAAyB,EACzB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE/E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,GAEX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,aAAa,GACb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBA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uB,CAAC;AAE/B,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE/E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/providers/index.js b/lib.commonjs/providers/index.js index 739152e2e..c2acec377 100644 --- a/lib.commonjs/providers/index.js +++ b/lib.commonjs/providers/index.js @@ -1,66 +1,62 @@ -"use strict"; -/** - * About providers. - * - * @_section: api/providers:Providers [about-providers] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = exports.WebSocketProvider = exports.SocketProvider = exports.IpcSocketProvider = exports.QuickNodeProvider = exports.PocketProvider = exports.InfuraWebSocketProvider = exports.InfuraProvider = exports.CloudflareProvider = exports.AnkrProvider = exports.AlchemyProvider = exports.BrowserProvider = exports.JsonRpcSigner = exports.JsonRpcProvider = exports.JsonRpcApiProvider = exports.FallbackProvider = exports.copyRequest = exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.FeeData = exports.Block = exports.FeeDataNetworkPlugin = exports.EnergyCostPlugin = exports.NetworkPlugin = exports.NonceManager = exports.Network = exports.getDefaultProvider = exports.showThrottleMessage = exports.VoidSigner = exports.AbstractSigner = exports.UnmanagedSubscriber = exports.AbstractProvider = void 0; -var abstract_provider_js_1 = require("./abstract-provider.js"); -Object.defineProperty(exports, "AbstractProvider", { enumerable: true, get: function () { return abstract_provider_js_1.AbstractProvider; } }); -Object.defineProperty(exports, "UnmanagedSubscriber", { enumerable: true, get: function () { return abstract_provider_js_1.UnmanagedSubscriber; } }); -var abstract_signer_js_1 = require("./abstract-signer.js"); -Object.defineProperty(exports, "AbstractSigner", { enumerable: true, get: function () { return abstract_signer_js_1.AbstractSigner; } }); -Object.defineProperty(exports, "VoidSigner", { enumerable: true, get: function () { return abstract_signer_js_1.VoidSigner; } }); -var community_js_1 = require("./community.js"); -Object.defineProperty(exports, "showThrottleMessage", { enumerable: true, get: function () { return community_js_1.showThrottleMessage; } }); -var default_provider_js_1 = require("./default-provider.js"); -Object.defineProperty(exports, "getDefaultProvider", { enumerable: true, get: function () { return default_provider_js_1.getDefaultProvider; } }); -var network_js_1 = require("./network.js"); -Object.defineProperty(exports, "Network", { enumerable: true, get: function () { return network_js_1.Network; } }); -var signer_noncemanager_js_1 = require("./signer-noncemanager.js"); -Object.defineProperty(exports, "NonceManager", { enumerable: true, get: function () { return signer_noncemanager_js_1.NonceManager; } }); -var plugins_network_js_1 = require("./plugins-network.js"); -Object.defineProperty(exports, "NetworkPlugin", { enumerable: true, get: function () { return plugins_network_js_1.NetworkPlugin; } }); -Object.defineProperty(exports, "EnergyCostPlugin", { enumerable: true, get: function () { return plugins_network_js_1.EnergyCostPlugin; } }); -Object.defineProperty(exports, "FeeDataNetworkPlugin", { enumerable: true, get: function () { return plugins_network_js_1.FeeDataNetworkPlugin; } }); -var provider_js_1 = require("./provider.js"); -Object.defineProperty(exports, "Block", { enumerable: true, get: function () { return provider_js_1.Block; } }); -Object.defineProperty(exports, "FeeData", { enumerable: true, get: function () { return provider_js_1.FeeData; } }); -Object.defineProperty(exports, "Log", { enumerable: true, get: function () { return provider_js_1.Log; } }); -Object.defineProperty(exports, "TransactionReceipt", { enumerable: true, get: function () { return provider_js_1.TransactionReceipt; } }); -Object.defineProperty(exports, "TransactionResponse", { enumerable: true, get: function () { return provider_js_1.TransactionResponse; } }); -Object.defineProperty(exports, "copyRequest", { enumerable: true, get: function () { return provider_js_1.copyRequest; } }); -var provider_fallback_js_1 = require("./provider-fallback.js"); -Object.defineProperty(exports, "FallbackProvider", { enumerable: true, get: function () { return provider_fallback_js_1.FallbackProvider; } }); -var provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -Object.defineProperty(exports, "JsonRpcApiProvider", { enumerable: true, get: function () { return provider_jsonrpc_js_1.JsonRpcApiProvider; } }); -Object.defineProperty(exports, "JsonRpcProvider", { enumerable: true, get: function () { return provider_jsonrpc_js_1.JsonRpcProvider; } }); -Object.defineProperty(exports, "JsonRpcSigner", { enumerable: true, get: function () { return provider_jsonrpc_js_1.JsonRpcSigner; } }); -var provider_browser_js_1 = require("./provider-browser.js"); -Object.defineProperty(exports, "BrowserProvider", { enumerable: true, get: function () { return provider_browser_js_1.BrowserProvider; } }); -var provider_alchemy_js_1 = require("./provider-alchemy.js"); -Object.defineProperty(exports, "AlchemyProvider", { enumerable: true, get: function () { return provider_alchemy_js_1.AlchemyProvider; } }); -var provider_ankr_js_1 = require("./provider-ankr.js"); -Object.defineProperty(exports, "AnkrProvider", { enumerable: true, get: function () { return provider_ankr_js_1.AnkrProvider; } }); -var provider_cloudflare_js_1 = require("./provider-cloudflare.js"); -Object.defineProperty(exports, "CloudflareProvider", { enumerable: true, get: function () { return provider_cloudflare_js_1.CloudflareProvider; } }); -var provider_infura_js_1 = require("./provider-infura.js"); -Object.defineProperty(exports, "InfuraProvider", { enumerable: true, get: function () { return provider_infura_js_1.InfuraProvider; } }); -Object.defineProperty(exports, "InfuraWebSocketProvider", { enumerable: true, get: function () { return provider_infura_js_1.InfuraWebSocketProvider; } }); -var provider_pocket_js_1 = require("./provider-pocket.js"); -Object.defineProperty(exports, "PocketProvider", { enumerable: true, get: function () { return provider_pocket_js_1.PocketProvider; } }); -var provider_quicknode_js_1 = require("./provider-quicknode.js"); -Object.defineProperty(exports, "QuickNodeProvider", { enumerable: true, get: function () { return provider_quicknode_js_1.QuickNodeProvider; } }); -const provider_ipcsocket_js_1 = require("./provider-ipcsocket.js"); /*-browser*/ -Object.defineProperty(exports, "IpcSocketProvider", { enumerable: true, get: function () { return provider_ipcsocket_js_1.IpcSocketProvider; } }); -var provider_socket_js_1 = require("./provider-socket.js"); -Object.defineProperty(exports, "SocketProvider", { enumerable: true, get: function () { return provider_socket_js_1.SocketProvider; } }); -var provider_websocket_js_1 = require("./provider-websocket.js"); -Object.defineProperty(exports, "WebSocketProvider", { enumerable: true, get: function () { return provider_websocket_js_1.WebSocketProvider; } }); -var provider_socket_js_2 = require("./provider-socket.js"); -Object.defineProperty(exports, "SocketSubscriber", { enumerable: true, get: function () { return provider_socket_js_2.SocketSubscriber; } }); -Object.defineProperty(exports, "SocketBlockSubscriber", { enumerable: true, get: function () { return provider_socket_js_2.SocketBlockSubscriber; } }); -Object.defineProperty(exports, "SocketPendingSubscriber", { enumerable: true, get: function () { return provider_socket_js_2.SocketPendingSubscriber; } }); -Object.defineProperty(exports, "SocketEventSubscriber", { enumerable: true, get: function () { return provider_socket_js_2.SocketEventSubscriber; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var abstractProvider = require('./abstract-provider.js'); +var abstractSigner = require('./abstract-signer.js'); +var community = require('./community.js'); +var defaultProvider = require('./default-provider.js'); +var network = require('./network.js'); +var signerNoncemanager = require('./signer-noncemanager.js'); +var pluginsNetwork = require('./plugins-network.js'); +var provider = require('./provider.js'); +var providerFallback = require('./provider-fallback.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); +var providerBrowser = require('./provider-browser.js'); +var providerAlchemy = require('./provider-alchemy.js'); +var providerAnkr = require('./provider-ankr.js'); +var providerCloudflare = require('./provider-cloudflare.js'); +var providerInfura = require('./provider-infura.js'); +var providerPocket = require('./provider-pocket.js'); +var providerQuicknode = require('./provider-quicknode.js'); +var providerIpcsocket = require('./provider-ipcsocket.js'); +var providerSocket = require('./provider-socket.js'); +var providerWebsocket = require('./provider-websocket.js'); + + + +exports.AbstractProvider = abstractProvider.AbstractProvider; +exports.UnmanagedSubscriber = abstractProvider.UnmanagedSubscriber; +exports.AbstractSigner = abstractSigner.AbstractSigner; +exports.VoidSigner = abstractSigner.VoidSigner; +exports.showThrottleMessage = community.showThrottleMessage; +exports.getDefaultProvider = defaultProvider.getDefaultProvider; +exports.Network = network.Network; +exports.NonceManager = signerNoncemanager.NonceManager; +exports.EnergyCostPlugin = pluginsNetwork.EnergyCostPlugin; +exports.FeeDataNetworkPlugin = pluginsNetwork.FeeDataNetworkPlugin; +exports.NetworkPlugin = pluginsNetwork.NetworkPlugin; +exports.Block = provider.Block; +exports.FeeData = provider.FeeData; +exports.Log = provider.Log; +exports.TransactionReceipt = provider.TransactionReceipt; +exports.TransactionResponse = provider.TransactionResponse; +exports.copyRequest = provider.copyRequest; +exports.FallbackProvider = providerFallback.FallbackProvider; +exports.JsonRpcApiProvider = providerJsonrpc.JsonRpcApiProvider; +exports.JsonRpcProvider = providerJsonrpc.JsonRpcProvider; +exports.JsonRpcSigner = providerJsonrpc.JsonRpcSigner; +exports.BrowserProvider = providerBrowser.BrowserProvider; +exports.AlchemyProvider = providerAlchemy.AlchemyProvider; +exports.AnkrProvider = providerAnkr.AnkrProvider; +exports.CloudflareProvider = providerCloudflare.CloudflareProvider; +exports.InfuraProvider = providerInfura.InfuraProvider; +exports.InfuraWebSocketProvider = providerInfura.InfuraWebSocketProvider; +exports.PocketProvider = providerPocket.PocketProvider; +exports.QuickNodeProvider = providerQuicknode.QuickNodeProvider; +exports.IpcSocketProvider = providerIpcsocket.IpcSocketProvider; +exports.SocketBlockSubscriber = providerSocket.SocketBlockSubscriber; +exports.SocketEventSubscriber = providerSocket.SocketEventSubscriber; +exports.SocketPendingSubscriber = providerSocket.SocketPendingSubscriber; +exports.SocketProvider = providerSocket.SocketProvider; +exports.SocketSubscriber = providerSocket.SocketSubscriber; +exports.WebSocketProvider = providerWebsocket.WebSocketProvider; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/providers/index.js.map b/lib.commonjs/providers/index.js.map index f87938ea5..3a027fdd6 100644 --- a/lib.commonjs/providers/index.js.map +++ b/lib.commonjs/providers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,+DAA+E;AAAtE,wHAAA,gBAAgB,OAAA;AAAE,2HAAA,mBAAmB,OAAA;AAE9C,2DAAkE;AAAzD,oHAAA,cA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sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/network.d.ts.map b/lib.commonjs/providers/network.d.ts.map index a62904576..639456c16 100644 --- a/lib.commonjs/providers/network.d.ts.map +++ b/lib.commonjs/providers/network.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAiBN,qBAAa,OAAO;;gBAMN,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY;IAMjD,MAAM,IAAI,GAAG;IAIb;;;;;OAKG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,EAEhC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IAmCnC;;OAEG;IACH,IAAI,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,CAElC;IAED;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAQzC;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC;IAI1E;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAChD,QAAQ,EAAE,MAAM,GACf,KAAK,CAAC,CAAC,CAAC;IAMX;;OAEG;IACH,KAAK,IAAI,OAAO;IAQhB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM;IAuBnD;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO;IAyD1C;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACb,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,WAAW,EAAE,MAAM,OAAO,GACzB,IAAI;CAeR"} \ No newline at end of file +{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GACnB,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN;IACA,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBL,qBAAa,OAAO;;IAMnB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAIhD;IAED,MAAM,IAAI,GAAG,CAEZ;IAED;;;;;OAKG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,EAEhC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAiClC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,CAElC;IAED;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAMxC;IAED;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,CAEzE;IAED;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EACjD,QAAQ,EAAE,MAAM,GACd,KAAK,CAAC,CAAC,CAAC,CAIV;IAED;;OAEG;IACH,KAAK,IAAI,OAAO,CAMf;IAED;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,CAqBlD;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAuDzC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,WAAW,EAAE,MAAM,OAAO,GACxB,IAAI,CAcN;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/network.js b/lib.commonjs/providers/network.js index c3a52c39e..a45404fad 100644 --- a/lib.commonjs/providers/network.js +++ b/lib.commonjs/providers/network.js @@ -1,13 +1,20 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Network = void 0; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +var pluginsNetwork = require('./plugins-network.js'); + /** * About networks * * @_subsection: api/providers:Networks [networks] */ -const index_js_1 = require("../utils/index.js"); -const plugins_network_js_1 = require("./plugins-network.js"); /* * * * // Networks which operation against an L2 can use this plugin to // specify how to access L1, for the purpose of resolving ENS, @@ -26,7 +33,7 @@ class Network { #plugins; constructor(name, networkId) { this.#name = name; - this.#networkId = (0, index_js_1.getBigInt)(networkId); + this.#networkId = maths.getBigInt(networkId); this.#plugins = new Map(); } toJSON() { @@ -51,7 +58,7 @@ class Network { return this.#networkId; } set networkId(value) { - this.#networkId = (0, index_js_1.getBigInt)(value, "networkId"); + this.#networkId = maths.getBigInt(value, "networkId"); } /** * Returns true if %%other%% matches this network. Any chain ID @@ -66,14 +73,14 @@ class Network { } if (typeof other === "string") { try { - return this.networkId === (0, index_js_1.getBigInt)(other); + return this.networkId === maths.getBigInt(other); } catch (error) { } return this.name === other; } if (typeof other === "number" || typeof other === "bigint") { try { - return this.networkId === (0, index_js_1.getBigInt)(other); + return this.networkId === maths.getBigInt(other); } catch (error) { } return false; @@ -81,7 +88,7 @@ class Network { if (typeof other === "object") { if (other.networkId != null) { try { - return this.networkId === (0, index_js_1.getBigInt)(other.networkId); + return this.networkId === maths.getBigInt(other.networkId); } catch (error) { } return false; @@ -142,7 +149,7 @@ class Network { * values. */ computeIntrinsicEnergy(tx) { - const costs = this.getPlugin("org.corebc.plugins.network.EnergyCost") || new plugins_network_js_1.EnergyCostPlugin(); + const costs = this.getPlugin("org.corebc.plugins.network.EnergyCost") || new pluginsNetwork.EnergyCostPlugin(); let energy = costs.txBase; if (tx.to == null) { energy += costs.txCreate; @@ -180,7 +187,7 @@ class Network { if (typeof network === "bigint") { return new Network("unknown", network); } - (0, index_js_1.assertArgument)(false, "unknown network", "network", network); + errors.assertArgument(false, "unknown network", "network", network); } // Clonable with network-like abilities if (typeof network.clone === "function") { @@ -191,7 +198,7 @@ class Network { } // Networkish if (typeof network === "object") { - (0, index_js_1.assertArgument)(typeof network.name === "string" && + errors.assertArgument(typeof network.name === "string" && typeof network.networkId === "number", "invalid network object name or networkId", "network", network); const custom = new Network(network.name, network.networkId); //if ((network).layerOneConnection) { @@ -199,7 +206,7 @@ class Network { //} return custom; } - (0, index_js_1.assertArgument)(false, "invalid network", "network", network); + errors.assertArgument(false, "invalid network", "network", network); } /** * Register %%nameOrnetworkId%% with a function which returns @@ -211,12 +218,11 @@ class Network { } const existing = Networks.get(nameOrnetworkId); if (existing) { - (0, index_js_1.assertArgument)(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrnetworkId", nameOrnetworkId); + errors.assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrnetworkId", nameOrnetworkId); } Networks.set(nameOrnetworkId, networkFunc); } } -exports.Network = Network; // See: https://chainlist.org let injected = false; function injectCommonNetworks() { @@ -228,7 +234,7 @@ function injectCommonNetworks() { function registerEth(name, networkId, options) { const func = function () { const network = new Network(name, networkId); - network.attachPlugin(new plugins_network_js_1.EnergyCostPlugin()); + network.attachPlugin(new pluginsNetwork.EnergyCostPlugin()); return network; }; // Register the network by name and chain ID @@ -240,14 +246,16 @@ function injectCommonNetworks() { }); } } - registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); + registerEth("mainnet", 1, { altNames: ["homestead"] }); + registerEth("ropsten", 3, { }); + registerEth("rinkeby", 4, { }); + registerEth("goerli", 5, { }); + registerEth("kovan", 42, { }); registerEth("sepolia", 11155111, {}); registerEth("classic", 61, {}); registerEth("classicKotti", 6, {}); - registerEth("xdai", 100, { ensNetwork: 1 }); + registerEth("xdai", 100, { }); } -//# sourceMappingURL=network.js.map \ No newline at end of file + +exports.Network = Network; +//# sourceMappingURL=network.js.map diff --git a/lib.commonjs/providers/network.js.map b/lib.commonjs/providers/network.js.map index 9a4f7ceed..1c247bfde 100644 --- a/lib.commonjs/providers/network.js.map +++ b/lib.commonjs/providers/network.js.map @@ -1 +1 @@ -{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,gDAA8D;AAE9D,6DAAwD;AA2BxD;;;;;;EAME;AAEF,uEAAuE;AACvE,sEAAsE;AACtE,uEAAuE;AACvE,uDAAuD;AAEvD,MAAM,QAAQ,GAAwC,IAAI,GAAG,EAAE,CAAC;AAEhE,MAAa,OAAO;IAClB,KAAK,CAAS;IACd,UAAU,CAAS;IAEnB,QAAQ,CAA6B;IAErC,YAAY,IAAY,EAAE,SAAuB;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAS,EAAC,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,MAAM;QACJ,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;IAChE,CAAC;IAED;;;;;OAKG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IACD,IAAI,IAAI,CAAC,KAAa;QACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IACD,IAAI,SAAS,CAAC,KAAmB;QAC/B,IAAI,CAAC,UAAU,GAAG,IAAA,oBAAS,EAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,KAAiB;QACvB,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,KAAK,CAAC;SACd;QAED,IAAI,OAAO,KAAK,KA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O,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,4CAA4C;QAC5C,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAElC,IAAI,OAAO,CAAC,QAAQ,EAAE;YACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;SACJ;IACH,CAAC;IAED,WAAW,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACtE,WAAW,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7C,WAAW,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7C,WAAW,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;IAC5C,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7C,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IAErC,WAAW,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/B,WAAW,CAAC,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEnC,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;AAC9C,CAAC"} \ No newline at end of file +{"version":3,"file":"network.js","sources":["../../lib.esm/providers/network.js"],"sourcesContent":["/**\n * About networks\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { getBigInt, assertArgument } from \"../utils/index.js\";\nimport { EnergyCostPlugin } from \"./plugins-network.js\";\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*/\n// Networks or clients with a higher need for security (such as clients\n// that may automatically make CCIP requests without user interaction)\n// can use this plugin to anonymize requests or intercept CCIP requests\n// to notify and/or receive authorization from the user\nconst Networks = new Map();\nexport class Network {\n #name;\n #networkId;\n #plugins;\n constructor(name, networkId) {\n this.#name = name;\n this.#networkId = getBigInt(networkId);\n this.#plugins = new Map();\n }\n toJSON() {\n return { name: this.name, networkId: String(this.networkId) };\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() {\n return this.#name;\n }\n set name(value) {\n this.#name = value;\n }\n /**\n * The network chain ID.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value, \"networkId\");\n }\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.networkId === 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.networkId === getBigInt(other);\n }\n catch (error) { }\n return false;\n }\n if (typeof other === \"object\") {\n if (other.networkId != null) {\n try {\n return this.networkId === getBigInt(other.networkId);\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.networkId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic energy required for a transaction.\n *\n * A EnergyCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicEnergy(tx) {\n const costs = this.getPlugin(\"org.corebc.plugins.network.EnergyCost\") || new EnergyCostPlugin();\n let energy = costs.txBase;\n if (tx.to == null) {\n energy += 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 energy += costs.txDataZero;\n }\n else {\n energy += costs.txDataNonzero;\n }\n }\n }\n return energy;\n }\n /**\n * Returns a new Network for the %%network%% name or networkId.\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.networkId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof network === \"object\") {\n assertArgument(typeof network.name === \"string\" &&\n typeof network.networkId === \"number\", \"invalid network object name or networkId\", \"network\", network);\n const custom = new Network(network.name, network.networkId);\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrnetworkId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrnetworkId, networkFunc) {\n if (typeof nameOrnetworkId === \"number\") {\n nameOrnetworkId = BigInt(nameOrnetworkId);\n }\n const existing = Networks.get(nameOrnetworkId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrnetworkId\", nameOrnetworkId);\n }\n Networks.set(nameOrnetworkId, networkFunc);\n }\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Core networks\n function registerEth(name, networkId, options) {\n const func = function () {\n const network = new Network(name, networkId);\n network.attachPlugin(new EnergyCostPlugin());\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(networkId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\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 registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map"],"names":["getBigInt","EnergyCostPlugin","assertArgument"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,Q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,CAAC,MAAM,EAAE,GAAG,EAAE,EAAgB,CAAC,CAAC;AAC/C;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/pagination.d.ts.map b/lib.commonjs/providers/pagination.d.ts.map index 5479c9c0a..8ff265391 100644 --- a/lib.commonjs/providers/pagination.d.ts.map +++ b/lib.commonjs/providers/pagination.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACnD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACf"} \ No newline at end of file +{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACpD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACd"} \ No newline at end of file diff --git a/lib.commonjs/providers/pagination.js b/lib.commonjs/providers/pagination.js index 7696f1a42..147dfd614 100644 --- a/lib.commonjs/providers/pagination.js +++ b/lib.commonjs/providers/pagination.js @@ -1,3 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=pagination.js.map \ No newline at end of file +'use strict'; + +//# sourceMappingURL=pagination.js.map diff --git a/lib.commonjs/providers/pagination.js.map b/lib.commonjs/providers/pagination.js.map index d08e925cb..baaa1402a 100644 --- a/lib.commonjs/providers/pagination.js.map +++ b/lib.commonjs/providers/pagination.js.map @@ -1 +1 @@ -{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"pagination.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/providers/plugin-fallback.d.ts.map b/lib.commonjs/providers/plugin-fallback.d.ts.map index 6d2023762..d639bafb3 100644 --- a/lib.commonjs/providers/plugin-fallback.d.ts.map +++ b/lib.commonjs/providers/plugin-fallback.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,wBAAwB,gDACU,CAAC;AAEhD,qBAAa,oBAAqB,YAAW,sBAAsB;IACzD,IAAI,EAAE,MAAM,CAAC;;IAQrB,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB;IAMzD,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAGhE;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACvE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAWhE"} \ No newline at end of file +{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,wBAAwB,gDACS,CAAC;AAE/C,qBAAa,oBAAqB,YAAW,sBAAsB;IAC1D,IAAI,EAAE,MAAM,CAAC;IAErB,cAIC;IAED,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB,CAExD;IAID,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAE9D;CACD;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACxE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAU9D;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/plugin-fallback.js b/lib.commonjs/providers/plugin-fallback.js index bc707b885..ce1487ef2 100644 --- a/lib.commonjs/providers/plugin-fallback.js +++ b/lib.commonjs/providers/plugin-fallback.js @@ -1,12 +1,20 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PossiblyPrunedTransactionPlugin = exports.CheckQualifiedPlugin = exports.PluginIdFallbackProvider = void 0; -const index_js_1 = require("../utils/index.js"); -exports.PluginIdFallbackProvider = "org.corebc.plugins.provider.QualifiedPlugin"; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + +const PluginIdFallbackProvider = "org.corebc.plugins.provider.QualifiedPlugin"; class CheckQualifiedPlugin { constructor() { - (0, index_js_1.defineProperties)(this, { - name: exports.PluginIdFallbackProvider, + properties.defineProperties(this, { + name: PluginIdFallbackProvider, }); } connect(provider) { @@ -18,7 +26,6 @@ class CheckQualifiedPlugin { return true; } } -exports.CheckQualifiedPlugin = CheckQualifiedPlugin; class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { isQualified(action, result) { if (action.method === "getTransaction" || @@ -30,5 +37,8 @@ class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { return super.isQualified(action, result); } } + +exports.CheckQualifiedPlugin = CheckQualifiedPlugin; +exports.PluginIdFallbackProvider = PluginIdFallbackProvider; exports.PossiblyPrunedTransactionPlugin = PossiblyPrunedTransactionPlugin; -//# sourceMappingURL=plugin-fallback.js.map \ No newline at end of file +//# sourceMappingURL=plugin-fallback.js.map diff --git a/lib.commonjs/providers/plugin-fallback.js.map b/lib.commonjs/providers/plugin-fallback.js.map index 4112d5803..d33011698 100644 --- a/lib.commonjs/providers/plugin-fallback.js.map +++ b/lib.commonjs/providers/plugin-fallback.js.map @@ -1 +1 @@ -{"version":3,"file":"plugin-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":";;;AACA,gDAAqD;AAOxC,QAAA,wBAAwB,GACnC,6CAA6C,CAAC;AAEhD,MAAa,oBAAoB;IAG/B;QACE,IAAA,2BAAgB,EAAuB,IAAI,EAAE;YAC3C,IAAI,EAAE,gCAAwB;SAC/B,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,QAA0B;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gEAAgE;IAChE,2BAA2B;IAC3B,WAAW,CAAC,MAA4B,EAAE,MAAW;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlBD,oDAkBC;AAED,MAAa,+BAAgC,SAAQ,oBAAoB;IACvE,WAAW,CAAC,MAA4B,EAAE,MAAW;QACnD,IACE,MAAM,CAAC,MAAM,KAAK,gBAAgB;YAClC,MAAM,CAAC,MAAM,KAAK,uBAAuB,EACzC;YACA,IAAI,MAAM,IAAI,IAAI,EAAE;gBAClB,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;CACF;AAZD,0EAYC"} \ No newline at end of file +{"version":3,"file":"plugin-fallback.js","sources":["../../lib.esm/providers/plugin-fallback.js"],"sourcesContent":["import { defineProperties } from \"../utils/index.js\";\nexport const PluginIdFallbackProvider = \"org.corebc.plugins.provider.QualifiedPlugin\";\nexport class CheckQualifiedPlugin {\n constructor() {\n defineProperties(this, {\n name: PluginIdFallbackProvider,\n });\n }\n connect(provider) {\n return this;\n }\n // Retruns true if this value should be considered qualified for\n // inclusion in the quorum.\n isQualified(action, result) {\n return true;\n }\n}\nexport class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin {\n isQualified(action, result) {\n if (action.method === \"getTransaction\" ||\n action.method === \"getTransactionReceipt\") {\n if (result == null) {\n return false;\n }\n }\n return super.isQualified(action, result);\n }\n}\n//# sourceMappingURL=plugin-fallback.js.map"],"names":["defineProperties"],"mappings":";;;;;;;;;;;;AACY,MAAC,wBAAwB,GAAG;AACjC,MAAM,oBAAoB,CAAC;AAClC,IAAI,WAAW,GAAG;AAClB,QAAQA,2BAAgB,CAAC,IAAI,EAAE;AAC/B,YAAY,IAAI,EAAE,wBAAwB;AAC1C,SAAS,CAAC;AACV,IAAI;AACJ,IAAI,OAAO,CAAC,QAAQ,EAAE;AACtB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE;AAChC,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ;AACO,MAAM,+BAA+B,SAAS,oBAAoB,CAAC;AAC1E,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE;AAChC,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,gBAAgB;AAC9C,YAAY,MAAM,CAAC,MAAM,KAAK,uBAAuB,EAAE;AACvD,YAAY,IAAI,MAAM,IAAI,IAAI,EAAE;AAChC,gBAAgB,OAAO,KAAK;AAC5B,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;AAChD,IAAI;AACJ;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/plugins-network.d.ts.map b/lib.commonjs/providers/plugins-network.d.ts.map index 7c9b9b3c7..bcea34835 100644 --- a/lib.commonjs/providers/plugins-network.d.ts.map +++ b/lib.commonjs/providers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O,CAAC,OAAO,CAAC,CAE1D;IAED,YAAY,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,EAGhE;IAEK,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAErD;IAED,KAAK,IAAI,oBAAoB,CAE5B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/plugins-network.js b/lib.commonjs/providers/plugins-network.js index 3097e4f50..388c0ec26 100644 --- a/lib.commonjs/providers/plugins-network.js +++ b/lib.commonjs/providers/plugins-network.js @@ -1,18 +1,24 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FeeDataNetworkPlugin = exports.EnergyCostPlugin = exports.NetworkPlugin = void 0; -const properties_js_1 = require("../utils/properties.js"); -const index_js_1 = require("../utils/index.js"); +'use strict'; + +var properties = require('../utils/properties.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + class NetworkPlugin { name; constructor(name) { - (0, properties_js_1.defineProperties)(this, { name }); + properties.defineProperties(this, { name }); } clone() { return new NetworkPlugin(this.name); } } -exports.NetworkPlugin = NetworkPlugin; class EnergyCostPlugin extends NetworkPlugin { effectiveBlock; txBase; @@ -32,7 +38,7 @@ class EnergyCostPlugin extends NetworkPlugin { if (value == null) { value = nullish; } - (0, index_js_1.assertArgument)(typeof value === "number", `invalud value for ${name}`, "costs", costs); + errors.assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs); props[name] = value; } set("txBase", 21000); @@ -41,13 +47,12 @@ class EnergyCostPlugin extends NetworkPlugin { set("txDataNonzero", 16); set("txAccessListStorageKey", 1900); set("txAccessListAddress", 2400); - (0, properties_js_1.defineProperties)(this, props); + properties.defineProperties(this, props); } clone() { return new EnergyCostPlugin(this.effectiveBlock, this); } } -exports.EnergyCostPlugin = EnergyCostPlugin; class FeeDataNetworkPlugin extends NetworkPlugin { #feeDataFunc; get feeDataFunc() { @@ -64,7 +69,6 @@ class FeeDataNetworkPlugin extends NetworkPlugin { return new FeeDataNetworkPlugin(this.#feeDataFunc); } } -exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin; /* export class CustomBlockNetworkPlugin extends NetworkPlugin { readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; @@ -83,4 +87,8 @@ export class CustomBlockNetworkPlugin extends NetworkPlugin { } } */ -//# sourceMappingURL=plugins-network.js.map \ No newline at end of file + +exports.EnergyCostPlugin = EnergyCostPlugin; +exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin; +exports.NetworkPlugin = NetworkPlugin; +//# sourceMappingURL=plugins-network.js.map diff --git a/lib.commonjs/providers/plugins-network.js.map b/lib.commonjs/providers/plugins-network.js.map index 87a365b2e..1a683d59e 100644 --- a/lib.commonjs/providers/plugins-network.js.map +++ b/lib.commonjs/providers/plugins-network.js.map @@ -1 +1 @@ -{"version":3,"file":"plugins-network.js","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":";;;AAAA,0DAA0D;AAE1D,gDAAmD;AAGnD,MAAa,aAAa;IACf,IAAI,CAAU;IAEvB,YAAY,IAAY;QACtB,IAAA,gCAAgB,EAAgB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,KAAK;QACH,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CAKF;AAdD,sCAcC;AAcD,MAAa,gBACX,SAAQ,aAAa;IAGZ,cAAc,CAAU;IAExB,MAAM,CAAU;IAChB,QAAQ,CAAU;IAClB,UAAU,CAAU;IACpB,aAAa,CAAU;IACvB,sBAAsB,CAAU;IAChC,mBAAmB,CAAU;IAEtC,YAAY,cAAuB,EAAE,KAA4B;QAC/D,IAAI,cAAc,IAAI,IAAI,EAAE;YAC1B,cAAc,GAAG,CAAC,CAAC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kB;QACjC,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK;QACH,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACrD,CAAC;CACF;AAnBD,oDAmBC;AAED;;;;;;;;;;;;;;;;;EAiBE"} \ No newline at end of file +{"version":3,"file":"plugins-network.js","sources":["../../lib.esm/providers/plugins-network.js"],"sourcesContent":["import { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nexport class NetworkPlugin {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\nexport class EnergyCostPlugin extends NetworkPlugin {\n effectiveBlock;\n txBase;\n txCreate;\n txDataZero;\n txDataNonzero;\n txAccessListStorageKey;\n txAccessListAddress;\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.corebc.network.plugins.EnergyCost#${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 clone() {\n return new EnergyCostPlugin(this.effectiveBlock, this);\n }\n}\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n constructor(feeDataFunc) {\n super(\"org.corebc.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\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"],"names":["defineProperties","assertArgument"],"mappings":";;;;;;;;;;;;AAEO,MAAM,aAAa,CAAC;AAC3B,IAAI,IAAI;AACR,IAAI,WAAW,CAAC,IAAI,EAAE;AACtB,QAAQA,2BAAgB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;AACxC,IAAI;AACJ,IAAI,KAAK,GAAG;AACZ,QAAQ,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;AAC3C,IAAI;AACJ;AACO,MAAM,gBAAgB,SAAS,aAAa,CAAC;AACpD,IAAI,cAAc;AAClB,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,UAAU;AACd,IAAI,aAAa;AACjB,IAAI,sBAAsB;AAC1B,IAAI,mBAAmB;AACvB,IAAI,WAAW,CAAC,cAAc,EAAE,KAAK,EAAE;AACvC,QAAQ,IAAI,cAAc,IAAI,IAAI,EAAE;AACpC,YAAY,cAAc,GAAG,CAAC;AAC9B,QAAQ;AACR,QAAQ,KAAK,CAAC,CAAC,sCAAsC,EAAE,cAAc,IAAI,CAAC,CAAC,CAAC,CAAC;AAC7E,QAAQ,MAAM,KAAK,GAAG,EAAE,cAAc,EAAE;AACxC,QAAQ,SAAS,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE;AACpC,YAAY,IAAI,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC;AAC3C,YA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AAC1D,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-alchemy.d.ts.map b/lib.commonjs/providers/provider-alchemy.d.ts.map index f2eec176b..4e4c121cd 100644 --- a/lib.commonjs/providers/provider-alchemy.d.ts.map +++ b/lib.commonjs/providers/provider-alchemy.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKL,YAAY,EACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;;;GAUG;AACH,qBAAa,eACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAezD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAO3C,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IA2CvD,mBAAmB,IAAI,OAAO;IAI9B,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY;CAmBnE"} \ No newline at end of file +{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKN,YAAY,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;;;GAUG;AACH,qBAAa,eACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAaxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAEK,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,CAyCtD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAkBjE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-alchemy.js b/lib.commonjs/providers/provider-alchemy.js index 45a21abf1..aaafca3be 100644 --- a/lib.commonjs/providers/provider-alchemy.js +++ b/lib.commonjs/providers/provider-alchemy.js @@ -1,15 +1,21 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AlchemyProvider = void 0; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +var fetch = require('../utils/fetch.js'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var community = require('./community.js'); +var network = require('./network.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); + /** * About Alchemy * * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] */ -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; function getHost(name) { switch (name) { @@ -32,7 +38,7 @@ function getHost(name) { case "optimism-goerli": return "opt-goerli.g.alchemy.com"; } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); + errors.assertArgument(false, "unsupported network", "network", name); } /** * The **AlchemyProvider** connects to the [[link-alchemy]] @@ -45,19 +51,19 @@ function getHost(name) { * * @_docloc: api/providers/thirdparty */ -class AlchemyProvider extends provider_jsonrpc_js_1.JsonRpcProvider { +class AlchemyProvider extends providerJsonrpc.JsonRpcProvider { apiKey; constructor(_network, apiKey) { if (_network == null) { _network = "mainnet"; } - const network = network_js_1.Network.from(_network); + const network$1 = network.Network.from(_network); if (apiKey == null) { apiKey = defaultApiKey; } - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - (0, index_js_1.defineProperties)(this, { apiKey }); + const request = AlchemyProvider.getRequest(network$1, apiKey); + super(request, network$1, { staticNetwork: network$1 }); + properties.defineProperties(this, { apiKey }); } _getProvider(networkId) { try { @@ -69,7 +75,7 @@ class AlchemyProvider extends provider_jsonrpc_js_1.JsonRpcProvider { async _perform(req) { // https://docs.alchemy.com/reference/trace-transaction if (req.method === "getTransactionResult") { - const { trace, tx } = await (0, index_js_1.resolveProperties)({ + const { trace, tx } = await properties.resolveProperties({ trace: this.send("trace_transaction", [req.hash]), tx: this.getTransaction(req.hash), }); @@ -84,7 +90,7 @@ class AlchemyProvider extends provider_jsonrpc_js_1.JsonRpcProvider { } catch (error) { } if (data) { - (0, index_js_1.assert)(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { + errors.assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { action: "getTransactionResult", data, reason: null, @@ -94,7 +100,7 @@ class AlchemyProvider extends provider_jsonrpc_js_1.JsonRpcProvider { }); return data; } - (0, index_js_1.assert)(false, "could not parse trace result", "BAD_DATA", { + errors.assert(false, "could not parse trace result", "BAD_DATA", { value: trace, }); } @@ -107,16 +113,17 @@ class AlchemyProvider extends provider_jsonrpc_js_1.JsonRpcProvider { if (apiKey == null) { apiKey = defaultApiKey; } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/v2/${apiKey}`); + const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/v2/${apiKey}`); request.allowGzip = true; if (apiKey === defaultApiKey) { request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("alchemy"); + community.showThrottleMessage("alchemy"); return true; }; } return request; } } + exports.AlchemyProvider = AlchemyProvider; -//# sourceMappingURL=provider-alchemy.js.map \ No newline at end of file +//# sourceMappingURL=provider-alchemy.js.map diff --git a/lib.commonjs/providers/provider-alchemy.js.map b/lib.commonjs/providers/provider-alchemy.js.map index 30555b7a9..90267243c 100644 --- a/lib.commonjs/providers/provider-alchemy.js.map +++ b/lib.commonjs/providers/provider-alchemy.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,gDAM2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AASxD,MAAM,aAAa,GAAG,kCAAkC,CAAC;AAEzD,SAAS,OAAO,CAAC,IAAY;IAC3B,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,2BAA2B,CAAC;QACrC,KAAK,QAAQ;YACX,OAAO,0BAA0B,CAAC;QACpC,KAAK,SAAS;YACZ,OAAO,2BAA2B,CAAC;QAErC,KAAK,UAAU;YACb,OAAO,2BAA2B,CAAC;QACrC,KA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;QAED,MAAM,OAAO,GAAG,IAAI,uBAAY,CAC9B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,MAAM,EAAE,CACjD,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE;YAC5B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACvD,IAAA,kCAAmB,EAAC,SAAS,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA9FD,0CA8FC"} \ No newline at end of file +{"version":3,"file":"provider-alchemy.js","sources":["../../lib.esm/providers/provider-alchemy.js"],"sourcesContent":["/**\n * About Alchemy\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.alchemyapi.io\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AlchemyProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash),\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = trace[0].error === \"Reverted\";\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null, // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", {\n value: trace,\n });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map"],"names":["assertArgument","JsonRpcProvider","network","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d.ts.map b/lib.commonjs/providers/provider-ankr.d.ts.map index 45cfc5423..d0704e281 100644 --- a/lib.commonjs/providers/provider-ankr.d.ts.map +++ b/lib.commonjs/providers/provider-ankr.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoB1E;;;;;;;;GAQG;AACH,qBAAa,YACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAkBzD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAOjD;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAoBzE,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAchE,mBAAmB,IAAI,OAAO;CAG/B"} \ No newline at end of file +{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoB1E;;;;;;;;GAQG;AACH,qBAAa,YACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAgBxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAkBxE;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAY/D;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ankr.js b/lib.commonjs/providers/provider-ankr.js index 563b9ea65..f1823acf4 100644 --- a/lib.commonjs/providers/provider-ankr.js +++ b/lib.commonjs/providers/provider-ankr.js @@ -1,6 +1,16 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AnkrProvider = void 0; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +var fetch = require('../utils/fetch.js'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var community = require('./community.js'); +var network = require('./network.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); + /** * [[link-ankr]] provides a third-party service for connecting to * various blockchains over JSON-RPC. @@ -14,10 +24,6 @@ exports.AnkrProvider = void 0; * * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] */ -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); const defaultApiKey = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; function getHost(name) { switch (name) { @@ -30,7 +36,7 @@ function getHost(name) { case "arbitrum": return "rpc.ankr.com/arbitrum"; } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); + errors.assertArgument(false, "unsupported network", "network", name); } /** * The **AnkrProvider** connects to the [[link-ankr]] @@ -41,7 +47,7 @@ function getHost(name) { * gain access to an increased rate-limit, it is highly * recommended to [sign up here](link-ankr-signup). */ -class AnkrProvider extends provider_jsonrpc_js_1.JsonRpcProvider { +class AnkrProvider extends providerJsonrpc.JsonRpcProvider { /** * The API key for the Ankr connection. */ @@ -56,15 +62,15 @@ class AnkrProvider extends provider_jsonrpc_js_1.JsonRpcProvider { if (_network == null) { _network = "mainnet"; } - const network = network_js_1.Network.from(_network); + const network$1 = network.Network.from(_network); if (apiKey == null) { apiKey = defaultApiKey; } // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - (0, index_js_1.defineProperties)(this, { apiKey }); + const options = { polling: true, staticNetwork: network$1 }; + const request = AnkrProvider.getRequest(network$1, apiKey); + super(request, network$1, options); + properties.defineProperties(this, { apiKey }); } _getProvider(networkId) { try { @@ -81,11 +87,11 @@ class AnkrProvider extends provider_jsonrpc_js_1.JsonRpcProvider { if (apiKey == null) { apiKey = defaultApiKey; } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/${apiKey}`); + const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/${apiKey}`); request.allowGzip = true; if (apiKey === defaultApiKey) { request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("AnkrProvider"); + community.showThrottleMessage("AnkrProvider"); return true; }; } @@ -105,5 +111,6 @@ class AnkrProvider extends provider_jsonrpc_js_1.JsonRpcProvider { return this.apiKey === defaultApiKey; } } + exports.AnkrProvider = AnkrProvider; -//# sourceMappingURL=provider-ankr.js.map \ No newline at end of file +//# sourceMappingURL=provider-ankr.js.map diff --git a/lib.commonjs/providers/provider-ankr.js.map b/lib.commonjs/providers/provider-ankr.js.map index 8e0719c0a..e22badaaf 100644 --- a/lib.commonjs/providers/provider-ankr.js.map +++ b/lib.commonjs/providers/provider-ankr.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-ankr.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,gDAI2B;AAG3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAMxD,MAAM,aAAa,GACjB,kEAAkE,CAAC;AAErE,SAAS,OAAO,CAAC,IAAY;IAC3B,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,kBAAkB,CAAC;QAC5B,KAAK,QAAQ;YACX,OAAO,yBAAyB,CAAC;QACnC,KAAK,OAAO;YACV,OAAO,sBAAsB,CAAC;QAChC,KAAK,UAAU;YACb,OAAO,uBAAuB,CAAC;KAClC;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAa,YACX,SAAQ,qCAAe;IAGvB;;OAEG;IACM,MAAM,CAAU;IAEzB;;;;;OAKG;IACH,YAAY,QAAqB,EAAE,MAAsB;QACvD,IAAI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AAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,WAAW,CAAC,OAAuB,EAAE,KAAmB;QACtD,IAAI,OAAO,CAAC,MAAM,KAAK,wBAAwB,EAAE;YAC/C,IACE,KAAK;gBACL,KAAK,CAAC,KAAK;gBACX,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,+CAA+C,EACvE;gBACA,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,qCAAqC,CAAC;aAC7D;SACF;QAED,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC;IACvC,CAAC;CACF;AAjFD,oCAiFC"} \ No newline at end of file +{"version":3,"file":"provider-ankr.js","sources":["../../lib.esm/providers/provider-ankr.js"],"sourcesContent":["/**\n * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/xcb_goerli\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AnkrProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"xcb_sendRawTransaction\") {\n if (error &&\n error.error &&\n error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n}\n//# sourceMappingURL=provider-ankr.js.map"],"names":["assertArgument","JsonRpcProvider","network","Network","defineProperties","FetchRequest","showThrottleMessage"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,MAAM,aAAa,GAAG,kEAAkE;AACxF,SAAS,OAAO,CAAC,IAAI,EAAE;AACv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lib.commonjs/providers/provider-browser.d.ts.map index cf224c60e..890c4678c 100644 --- a/lib.commonjs/providers/provider-browser.d.ts.map +++ b/lib.commonjs/providers/provider-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,OAAO,EAAE;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC3C,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAClB;AAED,MAAM,MAAM,yBAAyB,GACjC;IACE,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;CACjD,GACD;IACE,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAC;CACb,GACD;IACE,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEN,qBAAa,eAAgB,SAAQ,yBAAyB;;gBAMhD,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,UAAU;IAwBjD,IAAI,CACR,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACvC,OAAO,CAAC,GAAG,CAAC;IAMT,KAAK,CACT,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC9C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC;IAqB/C,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAiB1D,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgBrD,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAkBnE"} \ No newline at end of file +{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC/B,OAAO,CAAC,OAAO,EAAE;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC1C,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,MAAM,MAAM,yBAAyB,GAClC;IACA,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;CAC/C,GACD;IACA,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAC;CACX,GACD;IACA,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;CACZ,CAAC;AAEL,qBAAa,eAAgB,SAAQ,yBAAyB;;IAM7D,YAAY,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,UAAU,EAsBtD;IAEK,IAAI,CACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACtC,OAAO,CAAC,GAAG,CAAC,CAId;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAmB9C;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAe/D;IAEK,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAc1D;IAEK,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiBjE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-browser.js b/lib.commonjs/providers/provider-browser.js index 696d96d90..dd5b61b7d 100644 --- a/lib.commonjs/providers/provider-browser.js +++ b/lib.commonjs/providers/provider-browser.js @@ -1,9 +1,16 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BrowserProvider = void 0; -const index_js_1 = require("../utils/index.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -class BrowserProvider extends provider_jsonrpc_js_1.JsonRpcApiPollingProvider { +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); + +class BrowserProvider extends providerJsonrpc.JsonRpcApiPollingProvider { #request; constructor(core, network) { super(network, { batchMaxCount: 1 }); @@ -30,7 +37,7 @@ class BrowserProvider extends provider_jsonrpc_js_1.JsonRpcApiPollingProvider { return await super.send(method, params); } async _send(payload) { - (0, index_js_1.assertArgument)(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); + errors.assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); try { const result = await this.#request(payload.method, payload.params || []); return [{ id: payload.id, result }]; @@ -87,5 +94,6 @@ class BrowserProvider extends provider_jsonrpc_js_1.JsonRpcApiPollingProvider { return await super.getSigner(address); } } + exports.BrowserProvider = BrowserProvider; -//# sourceMappingURL=provider-browser.js.map \ No newline at end of file +//# sourceMappingURL=provider-browser.js.map diff --git a/lib.commonjs/providers/provider-browser.js.map b/lib.commonjs/providers/provider-browser.js.map index 2f27405dd..41f6c99c0 100644 --- a/lib.commonjs/providers/provider-browser.js.map +++ b/lib.commonjs/providers/provider-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":";;;AAAA,gDAAmD;AAEnD,+DAAkE;AA+BlE,MAAa,eAAgB,SAAQ,+CAAyB;IAC5D,QAAQ,CAGU;IAElB,YAAY,IAAqB,EAAE,OAAoB;QACrD,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,KAAK,EACnB,MAAc,EACd,MAAwC,EACxC,EAAE;YACF,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC3C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC/D,OAAO,MAA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AAI;gBACF,cAAc;gBACd,MAAM,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;gBAC/C,4BAA4B;aAC7B;YAAC,OAAO,KAAU,EAAE;gBACnB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;gBAC9B,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;aAC5D;SACF;QAED,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;CACF;AAjHD,0CAiHC"} \ No newline at end of file +{"version":3,"file":"provider-browser.js","sources":["../../lib.esm/providers/provider-browser.js"],"sourcesContent":["import { assertArgument } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n constructor(core, network) {\n super(network, { batchMaxCount: 1 });\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await core.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [\n {\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message },\n },\n ];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `corebc-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `corebc-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"xcb_accounts\", []);\n if (typeof address === \"number\") {\n return accounts.length > address;\n }\n address = address.toLowerCase();\n return (accounts.filter((a) => a.toLowerCase() === address).length !== 0);\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n //const resp =\n await this.#request(\"xcb_requestAccounts\", []);\n //console.log(\"RESP\", resp);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n}\n//# sourceMappingURL=provider-browser.js.map"],"names":["JsonRpcApiPollingProvider","assertArgument"],"mappings":";;;;;;;;;;;;AAEO,MAAM,eAAe,SAASA,yCAAyB,CAAC;AAC/D,IAAI,QAAQ;AACZ,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE;AAC/B,QAAQ,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;AAC5C,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO,MAAM,EAAE,MAAM,KAAK;AAClD,YAAY,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;AAC9C,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC;AACzE,YAAY,IAAI;AAChB,gBAAgB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;AAC1D,gBAAgB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,CAAC;AAC9E,gBAAgB,OAAO,MAAM;AAC7B,YAAY;AACZ,YAAY,OAAO,CAAC,EAAE;AACtB,gB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O,IAAI,IAAI,EAAE;AAC7B,YAAY,OAAO,GAAG,CAAC;AACvB,QAAQ;AACR,QAAQ,IAAI,EAAE,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;AAC9C,YAAY,IAAI;AAChB;AACA,gBAAgB,MAAM,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,CAAC;AAC9D;AACA,YAAY;AACZ,YAAY,OAAO,KAAK,EAAE;AAC1B,gBAAgB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;AAC7C,gBAAgB,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC;AAC1E,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;AAC7C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-cloudflare.d.ts.map b/lib.commonjs/providers/provider-cloudflare.d.ts.map index e70790a60..8dbb47f78 100644 --- a/lib.commonjs/providers/provider-cloudflare.d.ts.map +++ b/lib.commonjs/providers/provider-cloudflare.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;gBACzC,QAAQ,CAAC,EAAE,UAAU;CAalC"} \ No newline at end of file +{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACtD,YAAY,QAAQ,CAAC,EAAE,UAAU,EAYhC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-cloudflare.js b/lib.commonjs/providers/provider-cloudflare.js index f519bef45..eeee0f71a 100644 --- a/lib.commonjs/providers/provider-cloudflare.js +++ b/lib.commonjs/providers/provider-cloudflare.js @@ -1,26 +1,34 @@ -"use strict"; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var network = require('./network.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); + /** * About Cloudflare * * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.CloudflareProvider = void 0; -const index_js_1 = require("../utils/index.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); /** * About Cloudflare... */ -class CloudflareProvider extends provider_jsonrpc_js_1.JsonRpcProvider { +class CloudflareProvider extends providerJsonrpc.JsonRpcProvider { constructor(_network) { if (_network == null) { _network = "mainnet"; } - const network = network_js_1.Network.from(_network); - (0, index_js_1.assertArgument)(network.name === "mainnet", "unsupported network", "network", _network); - super("https://cloudflare-eth.com/", network, { staticNetwork: network }); + const network$1 = network.Network.from(_network); + errors.assertArgument(network$1.name === "mainnet", "unsupported network", "network", _network); + super("https://cloudflare-eth.com/", network$1, { staticNetwork: network$1 }); } } + exports.CloudflareProvider = CloudflareProvider; -//# sourceMappingURL=provider-cloudflare.js.map \ No newline at end of file +//# sourceMappingURL=provider-cloudflare.js.map diff --git a/lib.commonjs/providers/provider-cloudflare.js.map b/lib.commonjs/providers/provider-cloudflare.js.map index fe7209db0..f545506a1 100644 --- a/lib.commonjs/providers/provider-cloudflare.js.map +++ b/lib.commonjs/providers/provider-cloudflare.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gDAAmD;AAEnD,6CAAuC;AACvC,+DAAwD;AAIxD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,qCAAe;IACrD,YAAY,QAAqB;QAC/B,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,SAAS,CAAC;SACtB;QACD,MAAM,OAAO,GAAG,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAA,yBAAc,EACZ,OAAO,CAAC,IAAI,KAAK,SAAS,EAC1B,qBAAqB,EACrB,SAAS,EACT,QAAQ,CACT,CAAC;QACF,KAAK,CAAC,6BAA6B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF;AAdD,gDAcC"} \ No newline at end of file +{"version":3,"file":"provider-cloudflare.js","sources":["../../lib.esm/providers/provider-cloudflare.js"],"sourcesContent":["/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https://cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map"],"names":["JsonRpcProvider","network","Network","assertArgument"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACO,MAAM,kBAAkB,SAASA,+BAAe,CAAC;AACxD,IAAI,WAAW,CAAC,QAAQ,EAAE;AAC1B,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,SAAS;AAChC,QAAQ;AACR,QAAQ,MAAMC,SAAO,GAAGC,eAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC9C,QAAQC,qBAAc,CAACF,SAAO,CAAC,IAAI,KAAK,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC;AAC9F,QAAQ,KAAK,CAAC,6BAA6B,EAAEA,SAAO,EAAE,EAAE,aAAa,EAAEA,SAAO,EAAE,CAAC;AACjF,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-fallback.d.ts.map b/lib.commonjs/providers/provider-fallback.d.ts.map index 16b3b607f..95bda52bd 100644 --- a/lib.commonjs/providers/provider-fallback.d.ts.map +++ b/lib.commonjs/providers/provider-fallback.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiC/C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAErC,QAAQ,EAAE,gBAAgB,CAAC;IAI3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD;;GAEG;AACH,MAAM,WAAW,qBACf,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IAExC,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,cA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Q,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,CAAC,CAmD7D;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAK7B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-fallback.js b/lib.commonjs/providers/provider-fallback.js index d5743d99a..e12b96674 100644 --- a/lib.commonjs/providers/provider-fallback.js +++ b/lib.commonjs/providers/provider-fallback.js @@ -1,14 +1,21 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FallbackProvider = void 0; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +var abstractProvider = require('./abstract-provider.js'); +var network = require('./network.js'); + /** * Explain all the nitty-gritty about the **FallbackProvider**. * * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] */ -const index_js_1 = require("../utils/index.js"); -const abstract_provider_js_1 = require("./abstract-provider.js"); -const network_js_1 = require("./network.js"); const BN_1 = BigInt("1"); const BN_2 = BigInt("2"); function shuffle(array) { @@ -178,7 +185,7 @@ function getAnyResult(quorum, results) { } function getFuzzyMode(quorum, results) { if (quorum === 1) { - return (0, index_js_1.getNumber)(getMedian(quorum, results), "%internal"); + return maths.getNumber(getMedian(quorum, results), "%internal"); } const tally = new Map(); const add = (result, weight) => { @@ -187,7 +194,7 @@ function getFuzzyMode(quorum, results) { tally.set(result, t); }; for (const { weight, value } of results) { - const r = (0, index_js_1.getNumber)(value); + const r = maths.getNumber(value); add(r - 1, weight); add(r, weight); add(r + 1, weight); @@ -211,7 +218,7 @@ function getFuzzyMode(quorum, results) { * A Fallback Provider. * */ -class FallbackProvider extends abstract_provider_js_1.AbstractProvider { +class FallbackProvider extends abstractProvider.AbstractProvider { quorum; eventQuorum; eventWorkers; @@ -221,7 +228,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { constructor(providers, network) { super(network); this.#configs = providers.map((p) => { - if (p instanceof abstract_provider_js_1.AbstractProvider) { + if (p instanceof abstractProvider.AbstractProvider) { return Object.assign({ provider: p }, defaultConfig, defaultState); } else { @@ -233,7 +240,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { this.quorum = 2; //Math.ceil(providers.length / 2); this.eventQuorum = 1; this.eventWorkers = 1; - (0, index_js_1.assertArgument)(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), "quorum exceed provider wieght", "quorum", this.quorum); + errors.assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), "quorum exceed provider wieght", "quorum", this.quorum); } get providerConfigs() { return this.#configs.map((c) => { @@ -247,7 +254,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { }); } async _detectNetwork() { - return network_js_1.Network.from((0, index_js_1.getBigInt)(await this._perform({ method: "networkId" }))); + return network.Network.from(maths.getBigInt(await this._perform({ method: "networkId" }))); } // @TODO: Add support to select providers to be the event subscriber //_getSubscriber(sub: Subscription): Subscriber { @@ -371,7 +378,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { networkId = network.networkId; } else if (network.networkId !== networkId) { - (0, index_js_1.assert)(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { + errors.assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { operation: "new FallbackProvider", }); } @@ -397,9 +404,9 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { case "getBlockNumber": { // We need to get the bootstrap block height if (this.#height === -2) { - this.#height = Math.ceil((0, index_js_1.getNumber)(getMedian(this.quorum, this.#configs.map((c) => ({ + this.#height = Math.ceil(maths.getNumber(getMedian(this.quorum, this.#configs.map((c) => ({ value: c.blockNumber, - tag: (0, index_js_1.getNumber)(c.blockNumber).toString(), + tag: maths.getNumber(c.blockNumber).toString(), weight: c.weight, }))))); } @@ -437,7 +444,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { case "broadcastTransaction": return getAnyResult(this.quorum, results); } - (0, index_js_1.assert)(false, "unsupported method", "UNSUPPORTED_OPERATION", { + errors.assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { operation: `_perform(${stringify(req.method)})`, }); } @@ -481,7 +488,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { this.#addRunner(running, req); } // All providers have returned, and we have no result - (0, index_js_1.assert)(interesting.length > 0, "quorum not met", "SERVER_ERROR", { + errors.assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { request: "%sub-requests", info: { request: req, @@ -509,7 +516,7 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { } })); const result = getAnyResult(this.quorum, results); - (0, index_js_1.assert)(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { + errors.assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { request: "%sub-requests", info: { request: req, results: results.map(stringify) }, }); @@ -541,5 +548,6 @@ class FallbackProvider extends abstract_provider_js_1.AbstractProvider { super.destroy(); } } + exports.FallbackProvider = FallbackProvider; -//# sourceMappingURL=provider-fallback.js.map \ No newline at end of file +//# sourceMappingURL=provider-fallback.js.map diff --git a/lib.commonjs/providers/provider-fallback.js.map b/lib.commonjs/providers/provider-fallback.js.map index e42596793..5d06421f5 100644 --- a/lib.commonjs/providers/provider-fallback.js.map +++ b/lib.commonjs/providers/provider-fallback.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,gDAK2B;AAE3B,iEAA0D;AAC1D,6CAAuC;AAKvC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAEzB,SAAS,OAAO,CAAU,KAAe;IACvC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,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C;QAEvD,mDAAmD;QACnD,oDAAoD;QACpD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;gBAC3C,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;aAC/B;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,OAAO;QACX,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE;YACxC,QAAQ,CAAC,OAAO,EAAE,CAAC;SACpB;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF;AAhbD,4CAgbC"} \ No newline at end of file +{"version":3,"file":"provider-fallback.js","sources":["../../lib.esm/providers/provider-fallback.js"],"sourcesContent":["/**\n * Explain all the nitty-gritty about the **FallbackProvider**.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { getBigInt, getNumber, assert, assertArgument, } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\nfunction getTime() {\n return new Date().getTime();\n}\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof value === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2,\n requests: 0,\n lateResponses: 0,\n errorResponses: 0,\n outOfSync: -1,\n unsupportedEvents: 0,\n rollingDuration: 0,\n score: 0,\n _network: null,\n _updateNumber: null,\n _totalTime: 0,\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + value.map(_normalize).join(\",\") + \"]\";\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{\" +\n keys\n .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`)\n .join(\",\") +\n \"}\");\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(value) {\n if (\"error\" in value) {\n const error = value.error;\n return { tag: _normalize(error), value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum &&\n (weight > bestWeight ||\n (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A Fallback Provider.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n quorum;\n eventQuorum;\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n constructor(providers, network) {\n super(network);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n this.quorum = 2; //Math.ceil(providers.length / 2);\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), \"quorum exceed provider wieght\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"networkId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"networkId\":\n return (await provider.getNetwork()).networkId;\n case \"estimateEnergy\":\n return await provider.estimateEnergy(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = \"blockHash\" in req ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getEnergyPrice\":\n return (await provider.getFeeData()).energyPrice;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => b.priority - a.priority);\n for (const config of allConfigs) {\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config,\n result: null,\n didBump: false,\n perform: null,\n staller: null,\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = getTime() - now;\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push(waitForSync(config, 0));\n promises.push((async () => {\n config._network = await config.provider.getNetwork();\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let networkId = null;\n for (const config of this.#configs) {\n const network = config._network;\n if (networkId == null) {\n networkId = network.networkId;\n }\n else if (network.networkId !== networkId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\",\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight,\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getEnergyPrice\":\n case \"estimateEnergy\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"networkId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`,\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: {\n request: req,\n results: Array.from(running).map((r) => stringify(r.result)),\n },\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => {\n try {\n const result = await provider._perform(req);\n return Object.assign(normalizeResult({ result }), { weight });\n }\n catch (error) {\n return Object.assign(normalizeResult({ error }), { weight });\n }\n }));\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) },\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n for (let i = 0; i < this.quorum; i++) {\n this.#addRunner(running, req);\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map"],"names":["getNumber","AbstractProvider","assertArgument","Network","getBigInt","assert"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAIA,MAAM,IAAI,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\ No newline at end of file diff --git a/lib.commonjs/providers/provider-infura.d.ts.map b/lib.commonjs/providers/provider-infura.d.ts.map index cc3baf59e..2d942d185 100644 --- a/lib.commonjs/providers/provider-infura.d.ts.map +++ b/lib.commonjs/providers/provider-infura.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAEL,YAAY,EAGb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;GAQG;AACH,qBAAa,uBACX,SAAQ,iBACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBACS,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM;IAoBpD,mBAAmB,IAAI,OAAO;CAG/B;AAED;;;;;;;;GAQG;AACH,qBAAa,cACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBAED,QAAQ,CAAC,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM;IAuB/B,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAOjD,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,MAAM,CAAC,oBAAoB,CACzB,OAAO,CAAC,EAAE,UAAU,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,uBAAuB;IAI1B;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC5B,YAAY;CAyBhB"} \ No newline at end of file +{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAEN,YAAY,EAGZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;GAQG;AACH,qBAAa,uBACZ,SAAQ,iBACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,YAAY,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,EAkBnD;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD;AAED;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAqB7B;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAC1B,OAAO,CAAC,EAAE,UAAU,EACpB,SAAS,CAAC,EAAE,MAAM,GAChB,uBAAuB,CAEzB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC3B,YAAY,CAwBd;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-infura.js b/lib.commonjs/providers/provider-infura.js index 512a67732..139cfb4f9 100644 --- a/lib.commonjs/providers/provider-infura.js +++ b/lib.commonjs/providers/provider-infura.js @@ -1,6 +1,17 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.InfuraProvider = exports.InfuraWebSocketProvider = void 0; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +var fetch = require('../utils/fetch.js'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var community = require('./community.js'); +var network = require('./network.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); +var providerWebsocket = require('./provider-websocket.js'); + /** * [[link-infura]] provides a third-party service for connecting to * various blockchains over JSON-RPC. @@ -19,11 +30,6 @@ exports.InfuraProvider = exports.InfuraWebSocketProvider = void 0; * * @_subsection: api/providers/thirdparty:INFURA [providers-infura] */ -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); -const provider_websocket_js_1 = require("./provider-websocket.js"); const defaultProjectId = "84842078b09946638c03157f83405213"; function getHost(name) { switch (name) { @@ -46,7 +52,7 @@ function getHost(name) { case "optimism-goerli": return "optimism-goerli.infura.io"; } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); + errors.assertArgument(false, "unsupported network", "network", name); } /** * The **InfuraWebSocketProvider** connects to the [[link-infura]] @@ -57,7 +63,7 @@ function getHost(name) { * gain access to an increased rate-limit, it is highly * recommended to [sign up here](link-infura-signup). */ -class InfuraWebSocketProvider extends provider_websocket_js_1.WebSocketProvider { +class InfuraWebSocketProvider extends providerWebsocket.WebSocketProvider { /** * The Project ID for the INFURA connection. */ @@ -75,10 +81,10 @@ class InfuraWebSocketProvider extends provider_websocket_js_1.WebSocketProvider constructor(network, projectId) { const provider = new InfuraProvider(network, projectId); const req = provider._getConnection(); - (0, index_js_1.assert)(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); + errors.assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); super(url, network); - (0, index_js_1.defineProperties)(this, { + properties.defineProperties(this, { projectId: provider.projectId, projectSecret: provider.projectSecret, }); @@ -87,7 +93,6 @@ class InfuraWebSocketProvider extends provider_websocket_js_1.WebSocketProvider return this.projectId === defaultProjectId; } } -exports.InfuraWebSocketProvider = InfuraWebSocketProvider; /** * The **InfuraProvider** connects to the [[link-infura]] * JSON-RPC end-points. @@ -97,7 +102,7 @@ exports.InfuraWebSocketProvider = InfuraWebSocketProvider; * gain access to an increased rate-limit, it is highly * recommended to [sign up here](link-infura-signup). */ -class InfuraProvider extends provider_jsonrpc_js_1.JsonRpcProvider { +class InfuraProvider extends providerJsonrpc.JsonRpcProvider { /** * The Project ID for the INFURA connection. */ @@ -116,16 +121,16 @@ class InfuraProvider extends provider_jsonrpc_js_1.JsonRpcProvider { if (_network == null) { _network = "mainnet"; } - const network = network_js_1.Network.from(_network); + const network$1 = network.Network.from(_network); if (projectId == null) { projectId = defaultProjectId; } if (projectSecret == null) { projectSecret = null; } - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - (0, index_js_1.defineProperties)(this, { projectId, projectSecret }); + const request = InfuraProvider.getRequest(network$1, projectId, projectSecret); + super(request, network$1, { staticNetwork: network$1 }); + properties.defineProperties(this, { projectId, projectSecret }); } _getProvider(networkId) { try { @@ -154,19 +159,21 @@ class InfuraProvider extends provider_jsonrpc_js_1.JsonRpcProvider { if (projectSecret == null) { projectSecret = null; } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/v3/${projectId}`); + const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/v3/${projectId}`); request.allowGzip = true; if (projectSecret) { request.setCredentials("", projectSecret); } if (projectId === defaultProjectId) { request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("InfuraProvider"); + community.showThrottleMessage("InfuraProvider"); return true; }; } return request; } } + exports.InfuraProvider = InfuraProvider; -//# sourceMappingURL=provider-infura.js.map \ No newline at end of file +exports.InfuraWebSocketProvider = InfuraWebSocketProvider; +//# sourceMappingURL=provider-infura.js.map diff --git a/lib.commonjs/providers/provider-infura.js.map b/lib.commonjs/providers/provider-infura.js.map index 100aef685..c805e87ac 100644 --- a/lib.commonjs/providers/provider-infura.js.map +++ b/lib.commonjs/providers/provider-infura.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-infura.js","sourceRo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AC;SAC1E;QAAC,OAAO,KAAK,EAAE,GAAE;QAClB,OAAO,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,SAAS,KAAK,gBAAgB,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB,CACzB,OAAoB,EACpB,SAAkB;QAElB,OAAO,IAAI,uBAAuB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACzD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAgB,EAChB,SAAyB,EACzB,aAA6B;QAE7B,IAAI,SAAS,IAAI,IAAI,EAAE;YACrB,SAAS,GAAG,gBAAgB,CAAC;SAC9B;QACD,IAAI,aAAa,IAAI,IAAI,EAAE;YACzB,aAAa,GAAG,IAAI,CAAC;SACtB;QAED,MAAM,OAAO,GAAG,IAAI,uBAAY,CAC9B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,SAAS,EAAE,CACpD,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,IAAI,aAAa,EAAE;YACjB,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;SAC3C;QAED,IAAI,SAAS,KAAK,gBAAgB,EAAE;YAClC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACvD,IAAA,kCAAmB,EAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AApGD,wCAoGC"} \ No newline at end of file +{"version":3,"file":"provider-infura.js","sources":["../../lib.esm/providers/provider-infura.js"],"sourcesContent":["/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret,\n });\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(networkId) {\n try {\n return new InfuraProvider(networkId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map"],"names":["assertArgument","WebSocketProvider","assert","defineProperties","JsonRpcProvider","network","Network","FetchRequest","showThrottleMessage"],"mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,MAAM,gBAAgB,GAAG,kCAAkC;AAC3D,SAAS,OAAO,CAAC,IAAI,EAAE;AACvB,IAAI,QAAQ,IAAI;AAChB,QAAQ,KAAK,SAAS;AACtB,YAAY,OAAO,mBAAmB;AACtC,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAO,kBAAkB;AACrC,QAAQ,KAAK,SAAS;AACtB,YAAY,OAAO,mBAAmB;AACtC,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAO,4BAA4B;AAC/C,QAAQ,KAAK,iBAAiB;AAC9B,YAAY,OAAO,2BAA2B;AAC9C,QAAQ,KAAK,OAAO;AACpB,YAAY,OAAO,2BAA2B;AAC9C,QAAQ,KAAK,cAAc;AAC3B,YAAY,OAAO,0BAA0B;AAC7C,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAO,4BAA4B;AAC/C,QAAQ,KAAK,iBAAiB;AAC9B,YAAY,OAAO,2BAA2B;AAC9C;AACA,IAAIA,qBAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,uBAAuB,SAASC,mCAAiB,CAAC;AAC/D;AACA;AACA;AACA,IAAI,SAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa;AACjB;AACA;AACA;AACA,I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AAE,SAAS,CAAC,CAAC,CAAC;AAC7F,QAAQ,OAAO,CAAC,SAAS,GAAG,IAAI;AAChC,QAAQ,IAAI,aAAa,EAAE;AAC3B,YAAY,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,CAAC;AACrD,QAAQ;AACR,QAAQ,IAAI,SAAS,KAAK,gBAAgB,EAAE;AAC5C,YAAY,OAAO,CAAC,SAAS,GAAG,OAAO,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK;AACtE,gBAAgBC,6BAAmB,CAAC,gBAAgB,CAAC;AACrD,gBAAgB,OAAO,IAAI;AAC3B,YAAY,CAAC;AACb,QAAQ;AACR,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ipcsocket-browser.js b/lib.commonjs/providers/provider-ipcsocket-browser.js index 7a8728ff4..08c2dad76 100644 --- a/lib.commonjs/providers/provider-ipcsocket-browser.js +++ b/lib.commonjs/providers/provider-ipcsocket-browser.js @@ -1,6 +1,6 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IpcSocketProvider = void 0; +'use strict'; + const IpcSocketProvider = undefined; + exports.IpcSocketProvider = IpcSocketProvider; -//# sourceMappingURL=provider-ipcsocket-browser.js.map \ No newline at end of file +//# sourceMappingURL=provider-ipcsocket-browser.js.map diff --git a/lib.commonjs/providers/provider-ipcsocket-browser.js.map b/lib.commonjs/providers/provider-ipcsocket-browser.js.map index a4527c7ae..c2341764b 100644 --- a/lib.commonjs/providers/provider-ipcsocket-browser.js.map +++ b/lib.commonjs/providers/provider-ipcsocket-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-ipcsocket-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket-browser.ts"],"names":[],"mappings":";;;AAAA,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAE3B,8CAAiB"} \ No newline at end of file +{"version":3,"file":"provider-ipcsocket-browser.js","sources":["../../lib.esm/providers/provider-ipcsocket-browser.js"],"sourcesContent":["const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map"],"names":[],"mappings":";;AAAK,MAAC,iBAAiB,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ipcsocket.d.ts b/lib.commonjs/providers/provider-ipcsocket.d.ts index a9ee3bfc9..9f92c9d4f 100644 --- a/lib.commonjs/providers/provider-ipcsocket.d.ts +++ b/lib.commonjs/providers/provider-ipcsocket.d.ts @@ -1,4 +1,4 @@ -/// +/// import { SocketProvider } from "./provider-socket.js"; import type { Socket } from "net"; import type { Networkish } from "./network.js"; diff --git a/lib.commonjs/providers/provider-ipcsocket.d.ts.map b/lib.commonjs/providers/provider-ipcsocket.d.ts.map index 91d6287d7..93bec7dd7 100644 --- a/lib.commonjs/providers/provider-ipcsocket.d.ts.map +++ b/lib.commonjs/providers/provider-ipcsocket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB/C,qBAAa,iBAAkB,SAAQ,cAAc;;IAEnD,IAAI,MAAM,IAAI,MAAM,CAEnB;gBAEW,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU;IA8B9C,OAAO,IAAI,IAAI;IAOT,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C"} \ No newline at end of file +{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB/C,qBAAa,iBAAkB,SAAQ,cAAc;;IAEpD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EA+B7C;IAED,OAAO,IAAI,IAAI,CAKd;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ipcsocket.js b/lib.commonjs/providers/provider-ipcsocket.js index a7ca9dedf..6928129ec 100644 --- a/lib.commonjs/providers/provider-ipcsocket.js +++ b/lib.commonjs/providers/provider-ipcsocket.js @@ -1,8 +1,9 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IpcSocketProvider = void 0; -const net_1 = require("net"); -const provider_socket_js_1 = require("./provider-socket.js"); +'use strict'; + +var net = require('net'); +var providerSocket = require('./provider-socket.js'); + +/// // @TODO: Is this sufficient? Is this robust? Will newlines occur between // all payloads and only between payloads? function splitBuffer(data) { @@ -18,14 +19,14 @@ function splitBuffer(data) { } return { messages, remaining: data.subarray(lastStart) }; } -class IpcSocketProvider extends provider_socket_js_1.SocketProvider { +class IpcSocketProvider extends providerSocket.SocketProvider { #socket; get socket() { return this.#socket; } constructor(path, network) { super(network); - this.#socket = (0, net_1.connect)(path); + this.#socket = net.connect(path); this.socket.on("ready", async () => { try { await this._start(); @@ -37,7 +38,10 @@ class IpcSocketProvider extends provider_socket_js_1.SocketProvider { }); let response = Buffer.alloc(0); this.socket.on("data", (data) => { - response = Buffer.concat([response, data]); + response = Buffer.concat([ + response, + typeof data === "string" ? Buffer.from(data) : data, + ]); const { messages, remaining } = splitBuffer(response); messages.forEach((message) => { this._processMessage(message); @@ -59,5 +63,6 @@ class IpcSocketProvider extends provider_socket_js_1.SocketProvider { this.socket.write(message); } } + exports.IpcSocketProvider = IpcSocketProvider; -//# sourceMappingURL=provider-ipcsocket.js.map \ No newline at end of file +//# sourceMappingURL=provider-ipcsocket.js.map diff --git a/lib.commonjs/providers/provider-ipcsocket.js.map b/lib.commonjs/providers/provider-ipcsocket.js.map index 5b55fb309..aac21cc46 100644 --- a/lib.commonjs/providers/provider-ipcsocket.js.map +++ b/lib.commonjs/providers/provider-ipcsocket.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-ipcsocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";;;AAAA,6BAA8B;AAC9B,6DAAsD;AAKtD,yEAAyE;AACzE,0CAA0C;AAC1C,SAAS,WAAW,CAAC,IAAY;IAI/B,MAAM,QAAQ,GAAkB,EAAE,CAAC;IAEnC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,OAAO,IAAI,EAAE;QACX,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE;YACb,MAAM;SACP;QACD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9D,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC;KACpB;IAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;AAC3D,CAAC;AAED,MAAa,iBAAkB,SAAQ,mCAAc;IACnD,OAAO,CAAS;IAChB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,YAAY,IAAY,EAAE,OAAoB;QAC5C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,IAAA,a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C1B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AA9CD,8CA8CC"} \ No newline at end of file +{"version":3,"file":"provider-ipcsocket.js","sources":["../../lib.esm/providers/provider-ipcsocket.js"],"sourcesContent":["/// \nimport { connect } from \"net\";\nimport { SocketProvider } from \"./provider-socket.js\";\n// @TODO: Is this sufficient? Is this robust? Will newlines occur between\n// all payloads and only between payloads?\nfunction splitBuffer(data) {\n const messages = [];\n let lastStart = 0;\n while (true) {\n const nl = data.indexOf(10, lastStart);\n if (nl === -1) {\n break;\n }\n messages.push(data.subarray(lastStart, nl).toString().trim());\n lastStart = nl + 1;\n }\n return { messages, remaining: data.subarray(lastStart) };\n}\nexport class IpcSocketProvider extends SocketProvider {\n #socket;\n get socket() {\n return this.#socket;\n }\n constructor(path, network) {\n super(network);\n this.#socket = connect(path);\n this.socket.on(\"ready\", async () => {\n try {\n await this._start();\n }\n catch (error) {\n console.log(\"failed to start IpcSocketProvider\", error);\n // @TODO: Now what? Restart?\n }\n });\n let response = Buffer.alloc(0);\n this.socket.on(\"data\", (data) => {\n response = Buffer.concat([\n response,\n typeof data === \"string\" ? Buffer.from(data) : data,\n ]);\n const { messages, remaining } = splitBuffer(response);\n messages.forEach((message) => {\n this._processMessage(message);\n });\n response = remaining;\n });\n this.socket.on(\"end\", () => {\n this.emit(\"close\");\n this.socket.destroy();\n this.socket.end();\n });\n }\n destroy() {\n this.socket.destroy();\n this.socket.end();\n super.destroy();\n }\n async _write(message) {\n this.socket.write(message);\n }\n}\n//# sourceMappingURL=provider-ipcsocket.js.map"],"names":["SocketProvider","connect"],"mappings":";;;;;AAAA;AAGA;AACA;AACA,SAAS,WAAW,CAAC,IAAI,EAAE;AAC3B,IAAI,MAAM,QAAQ,GAAG,EAAE;AACvB,IAAI,IAAI,SAAS,GAAG,CAAC;AACrB,IAAI,OAAO,IAAI,EAAE;AACjB,QAAQ,MAAM,EAAE,GAAG,IAAI,CAAC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AC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI;AACnE,aAAa,CAAC;AACd,YAAY,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,QAAQ,CAAC;AACjE,YAAY,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAK;AAC1C,gBAAgB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;AAC7C,YAAY,CAAC,CAAC;AACd,YAAY,QAAQ,GAAG,SAAS;AAChC,QAAQ,CAAC,CAAC;AACV,QAAQ,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM;AACpC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;AAC9B,YAAY,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;AACjC,YAAY,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;AAC7B,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ,IAAI,OAAO,GAAG;AACd,QAAQ,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;AAC7B,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;AACzB,QAAQ,KAAK,CAAC,OAAO,EAAE;AACvB,IAAI;AACJ,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-jsonrpc.d.ts.map b/lib.commonjs/providers/provider-jsonrpc.d.ts.map index 5e8ed8fa0..0635f491a 100644 --- a/lib.commonjs/providers/provider-jsonrpc.d.ts.map +++ b/lib.commonjs/providers/provider-jsonrpc.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAUL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3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;CACF;AAED;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,yBAAyB;;gBAI1D,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,EAC3B,OAAO,CAAC,EAAE,UAAU,EACpB,OAAO,CAAC,EAAE,yBAAyB;IAcrC,cAAc,IAAI,YAAY;IAIxB,IAAI,CACR,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACvC,OAAO,CAAC,GAAG,CAAC;IAST,KAAK,CACT,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC9C,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;CAgBjC"} \ No newline at end of file +{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAUN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOvC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACX,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuD1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;I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O,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAe/B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-jsonrpc.js b/lib.commonjs/providers/provider-jsonrpc.js index 5cb92bc55..0c81c651c 100644 --- a/lib.commonjs/providers/provider-jsonrpc.js +++ b/lib.commonjs/providers/provider-jsonrpc.js @@ -1,23 +1,47 @@ -"use strict"; +'use strict'; + +var abiCoder = require('../abi/abi-coder.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +var fetch = require('../utils/fetch.js'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +var utf8 = require('../utils/utf8.js'); +require('../abi/fragments.js'); +require('../crypto/keccak.js'); +require('../crypto/sha3.js'); +require('../constants/numbers.js'); +var index = require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../logger/logger.js'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); +var typedData = require('../hash/typed-data.js'); +var abstractProvider = require('./abstract-provider.js'); +var abstractSigner = require('./abstract-signer.js'); +var network = require('./network.js'); +var subscriberFilterid = require('./subscriber-filterid.js'); +var subscriberPolling = require('./subscriber-polling.js'); +var checks = require('../address/checks.js'); + /** * About JSON-RPC... * * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.JsonRpcProvider = exports.JsonRpcApiPollingProvider = exports.JsonRpcApiProvider = exports.JsonRpcSigner = void 0; // @TODO: // - Add the batching API -const index_js_1 = require("../abi/index.js"); -const index_js_2 = require("../address/index.js"); -const index_js_3 = require("../hash/index.js"); -const index_js_4 = require("../utils/index.js"); -const abstract_provider_js_1 = require("./abstract-provider.js"); -const abstract_signer_js_1 = require("./abstract-signer.js"); -const network_js_1 = require("./network.js"); -const subscriber_filterid_js_1 = require("./subscriber-filterid.js"); -const subscriber_polling_js_1 = require("./subscriber-polling.js"); -const checks_js_1 = require("../address/checks.js"); const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); //const Methods = "getAddress,then".split(/,/g); function deepCopy(value) { @@ -56,20 +80,20 @@ function isPollable(value) { const defaultOptions = { polling: false, staticNetwork: null, - batchStallTime: 10, - batchMaxSize: 1 << 20, + batchStallTime: 10, // 10ms + batchMaxSize: 1 << 20, // 1Mb batchMaxCount: 100, // 100 requests }; // @TODO: Unchecked Signers -class JsonRpcSigner extends abstract_signer_js_1.AbstractSigner { +class JsonRpcSigner extends abstractSigner.AbstractSigner { address; constructor(provider, address) { super(provider); - address = (0, index_js_2.getAddress)(address); - (0, index_js_4.defineProperties)(this, { address }); + address = index.getAddress(address); + properties.defineProperties(this, { address }); } connect(provider) { - (0, index_js_4.assert)(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { + errors.assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { operation: "signer.connect", }); } @@ -89,8 +113,8 @@ class JsonRpcSigner extends abstract_signer_js_1.AbstractSigner { if (tx.from) { const _from = tx.from; promises.push((async () => { - const from = await (0, checks_js_1.resolveAddress)(_from); - (0, index_js_4.assertArgument)(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); + const from = await checks.resolveAddress(_from); + errors.assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); tx.from = from; })()); } @@ -112,7 +136,7 @@ class JsonRpcSigner extends abstract_signer_js_1.AbstractSigner { if (tx.to != null) { const _to = tx.to; promises.push((async () => { - tx.to = await (0, checks_js_1.resolveAddress)(_to); + tx.to = await checks.resolveAddress(_to); })()); } // Wait until all of our properties are filled in @@ -151,8 +175,8 @@ class JsonRpcSigner extends abstract_signer_js_1.AbstractSigner { const tx = deepCopy(_tx); // Make sure the from matches the sender if (tx.from) { - const from = await (0, checks_js_1.resolveAddress)(tx.from); - (0, index_js_4.assertArgument)(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); + const from = await checks.resolveAddress(tx.from); + errors.assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); tx.from = from; } else { @@ -162,23 +186,23 @@ class JsonRpcSigner extends abstract_signer_js_1.AbstractSigner { return await this.provider.send("xcb_signTransaction", [hexTx]); } async signMessage(_message) { - const message = typeof _message === "string" ? (0, index_js_4.toUtf8Bytes)(_message) : _message; + const message = typeof _message === "string" ? utf8.toUtf8Bytes(_message) : _message; return await this.provider.send("personal_sign", [ - (0, index_js_4.hexlify)(message), + data.hexlify(message), this.address.toLowerCase(), ]); } async signTypedData(domain, types, _value) { const value = deepCopy(_value); // Populate any ENS names (in-place) - const populated = await index_js_3.TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await (0, checks_js_1.resolveAddress)(value); - (0, index_js_4.assertArgument)(address != null, "TypedData does not support null address", "value", value); + const populated = await typedData.TypedDataEncoder.resolveNames(domain, types, value, async (value) => { + const address = await checks.resolveAddress(value); + errors.assertArgument(address != null, "TypedData does not support null address", "value", value); return address; }); return await this.provider.send("xcb_signTypedData_v4", [ this.address.toLowerCase(), - JSON.stringify(index_js_3.TypedDataEncoder.getPayload(populated.domain, types, populated.value)), + JSON.stringify(typedData.TypedDataEncoder.getPayload(populated.domain, types, populated.value)), ]); } async unlock(password) { @@ -189,14 +213,13 @@ class JsonRpcSigner extends abstract_signer_js_1.AbstractSigner { ]); } async _legacySignMessage(_message) { - const message = typeof _message === "string" ? (0, index_js_4.toUtf8Bytes)(_message) : _message; + const message = typeof _message === "string" ? utf8.toUtf8Bytes(_message) : _message; return await this.provider.send("xcb_sign", [ this.address.toLowerCase(), - (0, index_js_4.hexlify)(message), + data.hexlify(message), ]); } } -exports.JsonRpcSigner = JsonRpcSigner; /** * The JsonRpcApiProvider is an abstract class and **MUST** be * sub-classed. @@ -207,7 +230,7 @@ exports.JsonRpcSigner = JsonRpcSigner; * - a sub-class MUST override _send * - a sub-class MUST call the `_start()` method once connected */ -class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { +class JsonRpcApiProvider extends abstractProvider.AbstractProvider { #options; // The next ID to use for the JSON-RPC ID field #nextId; @@ -257,7 +280,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { const resp = result.filter((r) => r.id === payload.id)[0]; // No result; the node failed us in unexpected ways if (resp == null) { - return reject((0, index_js_4.makeError)("no response from server", "BAD_DATA", { + return reject(errors.makeError("no response from server", "BAD_DATA", { value: result, info: { payload }, })); @@ -298,7 +321,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { // Make sure any static network is compatbile with the provided netwrok const staticNetwork = this._getOption("staticNetwork"); if (staticNetwork) { - (0, index_js_4.assertArgument)(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); + errors.assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); this.#network = staticNetwork; } } @@ -315,16 +338,16 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { * is detected, and if it has changed, the call will reject. */ get _network() { - (0, index_js_4.assert)(this.#network, "network is not available yet", "NETWORK_ERROR"); + errors.assert(this.#network, "network is not available yet", "NETWORK_ERROR"); return this.#network; } /* - { - assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { - operation: "jsonRpcApiProvider._send" - }); - } - */ + { + assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { + operation: "jsonRpcApiProvider._send" + }); + } + */ /** * Resolves to the non-normalized value by performing %%req%%. * @@ -346,13 +369,13 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { * _send primitive must be used instead. */ async _detectNetwork() { - const network = this._getOption("staticNetwork"); - if (network) { - return network; + const network$1 = this._getOption("staticNetwork"); + if (network$1) { + return network$1; } // If we are ready, use ``send``, which enabled requests to be batched if (this.ready) { - return network_js_1.Network.from((0, index_js_4.getBigInt)(await this.send("xcb_networkId", []))); + return network.Network.from(maths.getBigInt(await this.send("xcb_networkId", []))); } // We are not ready yet; use the primitive _send const payload = { @@ -372,7 +395,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { } this.emit("debug", { action: "receiveRpcResult", result }); if ("result" in result) { - return network_js_1.Network.from((0, index_js_4.getBigInt)(result.result)); + return network.Network.from(maths.getBigInt(result.result)); } throw this.getRpcError(payload, result); } @@ -424,18 +447,18 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { _getSubscriber(sub) { // Pending Filters aren't availble via polling if (sub.type === "pending") { - return new subscriber_filterid_js_1.FilterIdPendingSubscriber(this); + return new subscriberFilterid.FilterIdPendingSubscriber(this); } if (sub.type === "event") { if (this._getOption("polling")) { - return new subscriber_polling_js_1.PollingEventSubscriber(this, sub.filter); + return new subscriberPolling.PollingEventSubscriber(this, sub.filter); } - return new subscriber_filterid_js_1.FilterIdEventSubscriber(this, sub.filter); + return new subscriberFilterid.FilterIdEventSubscriber(this, sub.filter); } // Orphaned Logs are handled automatically, by the filter, since // logs with removed are emitted by it if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new abstract_provider_js_1.UnmanagedSubscriber("orphan"); + return new abstractProvider.UnmanagedSubscriber("orphan"); } return super._getSubscriber(sub); } @@ -468,14 +491,14 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { if (key === "energyLimit") { dstKey = "energy"; } - result[dstKey] = (0, index_js_4.toQuantity)((0, index_js_4.getBigInt)(tx[key], `tx.${key}`)); + result[dstKey] = maths.toQuantity(maths.getBigInt(tx[key], `tx.${key}`)); }); // Make sure addresses and data are lowercase ["from", "to", "data"].forEach((key) => { if (tx[key] == null) { return; } - result[key] = (0, index_js_4.hexlify)(tx[key]); + result[key] = data.hexlify(tx[key]); }); return result; } @@ -581,7 +604,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { if (method === "xcb_estimateEnergy" && error.message) { const msg = error.message; if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return (0, index_js_4.makeError)("insufficient funds", "INSUFFICIENT_FUNDS", { + return errors.makeError("insufficient funds", "INSUFFICIENT_FUNDS", { transaction: payload.params[0], info: { payload, error }, }); @@ -589,7 +612,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { } if (method === "xcb_call" || method === "xcb_estimateEnergy") { const result = spelunkData(error); - const e = index_js_1.AbiCoder.getBuiltinCallException(method === "xcb_call" ? "call" : "estimateEnergy", payload.params[0], result ? result.data : null); + const e = abiCoder.AbiCoder.getBuiltinCallException(method === "xcb_call" ? "call" : "estimateEnergy", payload.params[0], result ? result.data : null); e.info = { error, payload }; return e; } @@ -607,7 +630,7 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { xcb_requestAccounts: "requestAccess", wallet_requestAccounts: "requestAccess", }; - return (0, index_js_4.makeError)(`user rejected action`, "ACTION_REJECTED", { + return errors.makeError(`user rejected action`, "ACTION_REJECTED", { action: actionMap[method] || "unknown", reason: "rejected", info: { payload, error }, @@ -617,13 +640,13 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { method === "xcb_sendTransaction") { const transaction = payload.params[0]; if (message.match(/insufficient funds|base fee exceeds energy limit/i)) { - return (0, index_js_4.makeError)("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { + return errors.makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { transaction, info: { error }, }); } if (message.match(/nonce/i) && message.match(/too low/i)) { - return (0, index_js_4.makeError)("nonce has already been used", "NONCE_EXPIRED", { + return errors.makeError("nonce has already been used", "NONCE_EXPIRED", { transaction, info: { error }, }); @@ -631,25 +654,25 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { // "replacement transaction underpriced" if (message.match(/replacement transaction/i) && message.match(/underpriced/i)) { - return (0, index_js_4.makeError)("replacement fee too low", "REPLACEMENT_UNDERPRICED", { + return errors.makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { transaction, info: { error }, }); } if (message.match(/only replay-protected/i)) { - return (0, index_js_4.makeError)("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { + return errors.makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { operation: method, info: { transaction, info: { error } }, }); } } if (message.match(/the method .* does not exist/i)) { - return (0, index_js_4.makeError)("unsupported operation", "UNSUPPORTED_OPERATION", { + return errors.makeError("unsupported operation", "UNSUPPORTED_OPERATION", { operation: payload.method, info: { error }, }); } - return (0, index_js_4.makeError)("could not coalesce error", "UNKNOWN_ERROR", { error }); + return errors.makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); } /** * Requests the %%method%% with %%params%% via the JSON-RPC protocol @@ -703,14 +726,14 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { } return new JsonRpcSigner(this, accounts[address]); } - const { accounts } = await (0, index_js_4.resolveProperties)({ + const { accounts } = await properties.resolveProperties({ network: this.getNetwork(), accounts: accountsPromise, }); // Account address - address = (0, index_js_2.getAddress)(address); + address = index.getAddress(address); for (const account of accounts) { - if ((0, index_js_2.getAddress)(account) === address) { + if (index.getAddress(account) === address) { return new JsonRpcSigner(this, address); } } @@ -721,7 +744,6 @@ class JsonRpcApiProvider extends abstract_provider_js_1.AbstractProvider { return accounts.map((a) => new JsonRpcSigner(this, a)); } } -exports.JsonRpcApiProvider = JsonRpcApiProvider; class JsonRpcApiPollingProvider extends JsonRpcApiProvider { #pollingInterval; constructor(network, options) { @@ -753,7 +775,6 @@ class JsonRpcApiPollingProvider extends JsonRpcApiProvider { }); } } -exports.JsonRpcApiPollingProvider = JsonRpcApiPollingProvider; /** * The JsonRpcProvider is one of the most common Providers, * which performs all operations over HTTP (or HTTPS) requests. @@ -770,7 +791,7 @@ class JsonRpcProvider extends JsonRpcApiPollingProvider { } super(network, options); if (typeof url === "string") { - this.#connect = new index_js_4.FetchRequest(url); + this.#connect = new fetch.FetchRequest(url); } else { this.#connect = url.clone(); @@ -800,7 +821,6 @@ class JsonRpcProvider extends JsonRpcApiPollingProvider { return resp; } } -exports.JsonRpcProvider = JsonRpcProvider; function spelunkData(value) { if (value == null) { return null; @@ -808,7 +828,7 @@ function spelunkData(value) { // These *are* the droids we're looking for. if (typeof value.message === "string" && value.message.match("reverted") && - (0, index_js_4.isHexString)(value.data)) { + data.isHexString(value.data)) { return { message: value.message, data: value.data }; } // Spelunk further... @@ -857,4 +877,9 @@ function spelunkMessage(value) { _spelunkMessage(value, result); return result; } -//# sourceMappingURL=provider-jsonrpc.js.map \ No newline at end of file + +exports.JsonRpcApiPollingProvider = JsonRpcApiPollingProvider; +exports.JsonRpcApiProvider = JsonRpcApiProvider; +exports.JsonRpcProvider = JsonRpcProvider; +exports.JsonRpcSigner = JsonRpcSigner; +//# sourceMappingURL=provider-jsonrpc.js.map diff --git a/lib.commonjs/providers/provider-jsonrpc.js.map b/lib.commonjs/providers/provider-jsonrpc.js.map index f3641223c..93cbf8b8e 100644 --- a/lib.commonjs/providers/provider-jsonrpc.js.map +++ b/lib.commonjs/providers/provider-jsonrpc.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-jsonrpc.js","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,SAAS;AACT,yBAAyB;AAEzB,8CAA2C;AAC3C,kDAAiD;AAEjD,+CAAoD;AACpD,gDAY2B;AAE3B,iEAA+E;AAC/E,6DAAsD;AACtD,6CAAuC;AACvC,qEAGkC;AAClC,mEAAiE;AAiBjE,oDAAsD;AAItD,MAAM,SAAS,GAAG,8CAA8C,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7E,gDAAgD;AAChD,SAAS,QAAQ,CAAU,KAAQ;I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mDAAmD;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,IAAI;YACF,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;SACnD;QAAC,OAAO,KAAK,EAAE,GAAE;KACnB;AACH,CAAC;AAED,SAAS,cAAc,CAAC,KAAU;IAChC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"provider-jsonrpc.js","sources":["../../lib.esm/providers/provider-jsonrpc.js"],"sourcesContent":["/**\n * About JSON-RPC...\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, 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\";\nimport { resolveAddress } from \"../address/checks.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) => {\n setTimeout(resolve, duration);\n });\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, // 10ms\n batchMaxSize: 1 << 20, // 1Mb\n batchMaxCount: 100, // 100 requests\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);\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 xcb_sendTransaction uses 90000 energy; 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.energyLimit == null) {\n promises.push((async () => {\n tx.energyLimit = await this.provider.estimateEnergy({\n ...tx,\n from: this.address,\n });\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);\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(\"xcb_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 const checkTx = async () => {\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 // Wait another 4 seconds\n this.provider._setTimeout(() => {\n checkTx();\n }, 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);\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(\"xcb_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),\n 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(\"xcb_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(),\n password,\n null,\n ]);\n }\n async _legacySignMessage(_message) {\n const message = typeof _message === \"string\" ? toUtf8Bytes(_message) : _message;\n return await this.provider.send(\"xcb_sign\", [\n this.address.toLowerCase(),\n 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 #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no hard in sending it immeidately\n const stallTime = this._getOption(\"batchMaxCount\") === 1\n ? 0\n : 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 // console.log({payload})\n const result = await this._send(payload);\n // console.log({result})\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\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 return reject(makeError(\"no response from server\", \"BAD_DATA\", {\n value: result,\n info: { payload },\n }));\n }\n // The response is an error\n if (\"error\" in resp) {\n return reject(this.getRpcError(payload, resp));\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);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n // Make sure any static network is compatbile with the provided netwrok\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (staticNetwork) {\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 {\n assert(false, \"sub-classes must override _send\", \"UNSUPPORTED_OPERATION\", {\n operation: \"jsonRpcApiProvider._send\"\n });\n }\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 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 return network;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n return Network.from(getBigInt(await this.send(\"xcb_networkId\", [])));\n }\n // We are not ready yet; use the primitive _send\n const payload = {\n id: this.#nextId++,\n method: \"xcb_networkId\",\n params: [],\n jsonrpc: \"2.0\",\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n }\n catch (error) {\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 /**\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) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n console.log(\"JsonRpcProvider failed to startup; retry in 1s\");\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() {\n return this.#notReady == null;\n }\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 [\n \"networkId\",\n \"energyLimit\",\n \"energyPrice\",\n \"type\",\n \"nonce\",\n \"value\",\n ].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"energyLimit\") {\n dstKey = \"energy\";\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 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 \"networkId\":\n return { method: \"xcb_networkId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"xcb_blockNumber\", args: [] };\n case \"getEnergyPrice\":\n return { method: \"xcb_energyPrice\", args: [] };\n case \"getBalance\": {\n return {\n method: \"xcb_getBalance\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n }\n case \"getTransactionCount\":\n return {\n method: \"xcb_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getCode\":\n return {\n method: \"xcb_getCode\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getStorage\":\n return {\n method: \"xcb_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: \"xcb_sendRawTransaction\",\n args: [req.signedTransaction],\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"xcb_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions],\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"xcb_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions],\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"xcb_getTransactionByHash\",\n args: [req.hash],\n };\n case \"getTransactionReceipt\":\n return {\n method: \"xcb_getTransactionReceipt\",\n args: [req.hash],\n };\n case \"call\":\n return {\n method: \"xcb_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag],\n };\n case \"estimateEnergy\": {\n return {\n method: \"xcb_estimateEnergy\",\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: \"xcb_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an CoreBC-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 === \"xcb_estimateEnergy\" && 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 }\n if (method === \"xcb_call\" || method === \"xcb_estimateEnergy\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException(method === \"xcb_call\" ? \"call\" : \"estimateEnergy\", payload.params[0], result ? result.data : null);\n e.info = { error, payload };\n return e;\n }\n // Only estimateEnergy 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\" &&\n error.message.match(/user denied|corebc-user-denied/i)) {\n const actionMap = {\n xcb_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n xcb_signTypedData_v4: \"signTypedData\",\n xcb_signTransaction: \"signTransaction\",\n xcb_sendTransaction: \"sendTransaction\",\n xcb_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 === \"xcb_sendRawTransaction\" ||\n method === \"xcb_sendTransaction\") {\n const transaction = payload.params[0];\n if (message.match(/insufficient funds|base fee exceeds energy limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction,\n 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\", {\n transaction,\n info: { error },\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) &&\n message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction,\n info: { error },\n });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method,\n info: { transaction, info: { error } },\n });\n }\n }\n if (message.match(/the method .* does not exist/i)) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method,\n info: { error },\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error });\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 networkId?? purge on switch_networks\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve,\n 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(\"xcb_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(\"xcb_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n}\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n this.#pollingInterval = 4000;\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() {\n return this.#pollingInterval;\n }\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. xcb_networkId) 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\" &&\n value.message.match(\"reverted\") &&\n 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"],"names":["AbstractSigner","getAddress","defineProperties","assert","resolveAddress","assertArgument","toUtf8Bytes","hexlify","TypedDataEncoder","AbstractProvider","makeError","network","Network","getBigInt","FilterIdPendingSubscriber","PollingEventSubscriber","FilterIdEventSubscriber","UnmanagedSubscri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B,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC;AAClC,IAAI,OAAO,MAAM;AACjB;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-pocket.d.ts.map b/lib.commonjs/providers/provider-pocket.d.ts.map index fc500ed76..aaf617488 100644 --- a/lib.commonjs/providers/provider-pocket.d.ts.map +++ b/lib.commonjs/providers/provider-pocket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB/C;;;;;;;;GAQG;AACH,qBAAa,cACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;gBAED,QAAQ,CAAC,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM;IA4BnC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAWjD;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAChC,YAAY;IAwBf,mBAAmB,IAAI,OAAO;CAG/B"} \ No newline at end of file +{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB/C;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,EA0BjC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAShD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAC/B,YAAY,CAsBd;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-pocket.js b/lib.commonjs/providers/provider-pocket.js index 30b43b67f..abfab147f 100644 --- a/lib.commonjs/providers/provider-pocket.js +++ b/lib.commonjs/providers/provider-pocket.js @@ -1,6 +1,16 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PocketProvider = void 0; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +var fetch = require('../utils/fetch.js'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var community = require('./community.js'); +var network = require('./network.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); + /** * [[link-pocket]] provides a third-party service for connecting to * various blockchains over JSON-RPC. @@ -14,10 +24,6 @@ exports.PocketProvider = void 0; * * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] */ -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; function getHost(name) { switch (name) { @@ -30,7 +36,7 @@ function getHost(name) { case "matic-mumbai": return "polygon-mumbai-rpc.gateway.pokt.network"; } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); + errors.assertArgument(false, "unsupported network", "network", name); } /** * The **PocketProvider** connects to the [[link-pocket]] @@ -41,7 +47,7 @@ function getHost(name) { * gain access to an increased rate-limit, it is highly * recommended to [sign up here](link-pocket-signup). */ -class PocketProvider extends provider_jsonrpc_js_1.JsonRpcProvider { +class PocketProvider extends providerJsonrpc.JsonRpcProvider { /** * The Application ID for the Pocket connection. */ @@ -61,17 +67,17 @@ class PocketProvider extends provider_jsonrpc_js_1.JsonRpcProvider { if (_network == null) { _network = "mainnet"; } - const network = network_js_1.Network.from(_network); + const network$1 = network.Network.from(_network); if (applicationId == null) { applicationId = defaultApplicationId; } if (applicationSecret == null) { applicationSecret = null; } - const options = { staticNetwork: network }; - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - (0, index_js_1.defineProperties)(this, { + const options = { staticNetwork: network$1 }; + const request = PocketProvider.getRequest(network$1, applicationId, applicationSecret); + super(request, network$1, options); + properties.defineProperties(this, { applicationId, applicationSecret, }); @@ -91,14 +97,14 @@ class PocketProvider extends provider_jsonrpc_js_1.JsonRpcProvider { if (applicationId == null) { applicationId = defaultApplicationId; } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); + const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); request.allowGzip = true; if (applicationSecret) { request.setCredentials("", applicationSecret); } if (applicationId === defaultApplicationId) { request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("PocketProvider"); + community.showThrottleMessage("PocketProvider"); return true; }; } @@ -108,5 +114,6 @@ class PocketProvider extends provider_jsonrpc_js_1.JsonRpcProvider { return this.applicationId === defaultApplicationId; } } + exports.PocketProvider = PocketProvider; -//# sourceMappingURL=provider-pocket.js.map \ No newline at end of file +//# sourceMappingURL=provider-pocket.js.map diff --git a/lib.commonjs/providers/provider-pocket.js.map b/lib.commonjs/providers/provider-pocket.js.map index 59750bc71..3a527d6c1 100644 --- a/lib.commonjs/providers/provider-pocket.js.map +++ b/lib.commonjs/providers/provider-pocket.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-pocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;GAYG;AACH,gDAI2B;AAG3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAKxD,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAExD,SAAS,OAAO,CAAC,IAAY;IAC3B,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,kCAAkC,CAAC;QAC5C,KAAK,QAAQ;YACX,OAAO,iCAAiC,CAAC;QAE3C,KAAK,OAAO;YACV,OAAO,mCAAmC,CAAC;QAC7C,KAAK,cAAc;YACjB,OAAO,yCAAyC,CAAC;KACpD;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS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I,uBAAY,CAC9B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,aAAa,EAAE,CAC3D,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,iBAAiB,EAAE;YACrB,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;SAC/C;QAED,IAAI,aAAa,KAAK,oBAAoB,EAAE;YAC1C,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACvD,IAAA,kCAAmB,EAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,aAAa,KAAK,oBAAoB,CAAC;IACrD,CAAC;CACF;AAlGD,wCAkGC"} \ No newline at end of file +{"version":3,"file":"provider-pocket.js","sources":["../../lib.esm/providers/provider-pocket.js"],"sourcesContent":["/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, {\n applicationId,\n applicationSecret,\n });\n }\n _getProvider(networkId) {\n try {\n return new PocketProvider(networkId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return this.applicationId === defaultApplicationId;\n }\n}\n//# sourceMappingURL=provider-pocket.js.map"],"names":["assertArgument","JsonRpcProvider","network","Network","defineProperties","FetchRequest","showThrottleMessage"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;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at end of file diff --git a/lib.commonjs/providers/provider-quicknode.d.ts.map b/lib.commonjs/providers/provider-quicknode.d.ts.map index 8b27f9f9d..f3be4df32 100644 --- a/lib.commonjs/providers/provider-quicknode.d.ts.map +++ b/lib.commonjs/providers/provider-quicknode.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B/C;;;;;;;;GAQG;AACH,qBAAa,iBACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM;IAexD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAOjD,mBAAmB,IAAI,OAAO;IAI9B;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAoBzE"} \ No newline at end of file +{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B/C;;;;;;;;GAQG;AACH,qBAAa,iBACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,EAavD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAmBvE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-quicknode.js b/lib.commonjs/providers/provider-quicknode.js index 517feb28c..34dc92116 100644 --- a/lib.commonjs/providers/provider-quicknode.js +++ b/lib.commonjs/providers/provider-quicknode.js @@ -1,4 +1,16 @@ -"use strict"; +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +var fetch = require('../utils/fetch.js'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var community = require('./community.js'); +var network = require('./network.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); + /** * [[link-quicknode]] provides a third-party service for connecting to * various blockchains over JSON-RPC. @@ -16,12 +28,6 @@ * * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.QuickNodeProvider = void 0; -const index_js_1 = require("../utils/index.js"); -const community_js_1 = require("./community.js"); -const network_js_1 = require("./network.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; function getHost(name) { switch (name) { @@ -40,7 +46,7 @@ function getHost(name) { case "optimism-goerli": return "corebc.optimism-goerli.quiknode.pro"; } - (0, index_js_1.assertArgument)(false, "unsupported network", "network", name); + errors.assertArgument(false, "unsupported network", "network", name); } /** * The **QuickNodeProvider** connects to the [[link-quicknode]] @@ -51,7 +57,7 @@ function getHost(name) { * gain access to an increased rate-limit, it is highly * recommended to [sign up here](link-quicknode). */ -class QuickNodeProvider extends provider_jsonrpc_js_1.JsonRpcProvider { +class QuickNodeProvider extends providerJsonrpc.JsonRpcProvider { /** * The API token. */ @@ -63,13 +69,13 @@ class QuickNodeProvider extends provider_jsonrpc_js_1.JsonRpcProvider { if (_network == null) { _network = "mainnet"; } - const network = network_js_1.Network.from(_network); + const network$1 = network.Network.from(_network); if (token == null) { token = defaultToken; } - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - (0, index_js_1.defineProperties)(this, { token }); + const request = QuickNodeProvider.getRequest(network$1, token); + super(request, network$1, { staticNetwork: network$1 }); + properties.defineProperties(this, { token }); } _getProvider(networkId) { try { @@ -89,17 +95,18 @@ class QuickNodeProvider extends provider_jsonrpc_js_1.JsonRpcProvider { if (token == null) { token = defaultToken; } - const request = new index_js_1.FetchRequest(`https:/\/${getHost(network.name)}/${token}`); + const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/${token}`); request.allowGzip = true; //if (projectSecret) { request.setCredentials("", projectSecret); } if (token === defaultToken) { request.retryFunc = async (request, response, attempt) => { - (0, community_js_1.showThrottleMessage)("QuickNodeProvider"); + community.showThrottleMessage("QuickNodeProvider"); return true; }; } return request; } } + exports.QuickNodeProvider = QuickNodeProvider; -//# sourceMappingURL=provider-quicknode.js.map \ No newline at end of file +//# sourceMappingURL=provider-quicknode.js.map diff --git a/lib.commonjs/providers/provider-quicknode.js.map b/lib.commonjs/providers/provider-quicknode.js.map index 102684f56..8bd5bb1e8 100644 --- a/lib.commonjs/providers/provider-quicknode.js.map +++ b/lib.commonjs/providers/provider-quicknode.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,gDAI2B;AAE3B,iDAAqD;AACrD,6CAAuC;AACvC,+DAAwD;AAMxD,MAAM,YAAY,GAAG,0CAA0C,CAAC;AAEhE,SAAS,OAAO,CAAC,IAAY;IAC3B,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,qBAAqB,CAAC;QAE/B,KAAK,UAAU;YACb,OAAO,sCAAsC,CAAC;QAChD,KAAK,iBAAiB;YACpB,OAAO,qCAAqC,CAAC;QAC/C,KAAK,OAAO;YACV,OAAO,2BAA2B,CAAC;QACrC,KAAK,cAAc;YACjB,OAAO,mCAAmC,CAAC;QAC7C,KAAK,UAAU;YACb,OAAO,8BAA8B,CAAC;QACxC,KAAK,iBAAiB;YACpB,OAAO,qCAAqC,CAAC;KAChD;IAED,IAAA,yBAAc,EAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAa,iBACX,SAAQ,qCAAe;IAGvB;;OAEG;IACM,KAAK,CAAU;IAExB;;OAEG;IACH,YAAY,QAAqB,EAAE,KAAqB;QACtD,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,SAAS,CAAC;SACtB;QACD,MAAM,OAAO,GAAG,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,KAAK,GAAG,YAAY,CAAC;SACtB;QAED,MAAM,OAAO,GAAG,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC7D,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;QAEpD,IAAA,2BAAgB,EAAoB,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,IAAI;YACF,OAAO,IAAI,iBAAiB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;SACrD;QAAC,OAAO,KAAK,EAAE,GAAE;QAClB,OAAO,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,KAAqB;QACvD,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,KAAK,GAAG,YAAY,CAAC;SACtB;QAED,MAAM,OAAO,GAAG,IAAI,uBAAY,CAC9B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAC7C,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,mEAAmE;QAEnE,IAAI,KAAK,KAAK,YAAY,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACvD,IAAA,kCAAmB,EAAC,mBAAmB,CAAC,CAAC;gBACzC,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AA9DD,8CA8DC"} \ No newline at end of file +{"version":3,"file":"provider-quicknode.js","sources":["../../lib.esm/providers/provider-quicknode.js"],"sourcesContent":["/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"corebc.quiknode.pro\";\n case \"arbitrum\":\n return \"corebc.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"corebc.arbitrum-goerli.quiknode.pro\";\n case \"matic\":\n return \"corebc.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"corebc.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"corebc.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"corebc.optimism-goerli.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(networkId) {\n try {\n return new QuickNodeProvider(networkId, this.token);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.token === defaultToken;\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map"],"names":["assertArgument","JsonRpcProvider","network","Network","defineProperties","FetchRequest","showThrottleMessage"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,MAAM,YAAY,GAAG,0CAA0C;AAC/D,SAAS,OAAO,CAAC,IAAI,EAAE;AACvB,IAAI,QAAQ,IAAI;AAChB,QAAQ,KAAK,SAAS;AACtB,YAAY,OAAO,qBAAqB;AACxC,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAO,sCAAsC;AACzD,QAAQ,KAAK,iBAAiB;AAC9B,YAAY,OAAO,qCAAqC;AACxD,QAAQ,KAAK,OAAO;AACpB,YAAY,OAAO,2BAA2B;AAC9C,QAAQ,KAAK,cAAc;AAC3B,YAAY,OAAO,mCAAmC;AACtD,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAO,8BAA8B;AACjD,QAAQ,KAAK,iBAAiB;AAC9B,YAAY,OAAO,qCAAqC;AACxD;AACA,IAAIA,qBAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iBAAiB,SAASC,+BAAe,CAAC;AACvD;AAC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tF,QAAQ,OAAO,CAAC,SAAS,GAAG,IAAI;AAChC;AACA,QAAQ,IAAI,KAAK,KAAK,YAAY,EAAE;AACpC,YAAY,OAAO,CAAC,SAAS,GAAG,OAAO,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK;AACtE,gBAAgBC,6BAAmB,CAAC,mBAAmB,CAAC;AACxD,gBAAgB,OAAO,IAAI;AAC3B,YAAY,CAAC;AACb,QAAQ;AACR,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-socket.d.ts.map b/lib.commonjs/providers/provider-socket.d.ts.map index bdbc5029a..e919560e4 100644 --- a/lib.commonjs/providers/provider-socket.d.ts.map +++ b/lib.commonjs/providers/provider-socket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-socket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU/C,qBAAa,gBAAiB,YAAW,UAAU;;IAIjD,IAAI,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAEvB;gBAOW,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC;IAQxD,KAAK,IAAI,IAAI;IASb,IAAI,IAAI,IAAI;IASZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAUtC,MAAM,IAAI,IAAI;IAId,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG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I,SAAS,IAAI,WAAW,CAE3B;IAED,YAAY,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAGxD;IAEK,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjE;CACD;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;;IAiBrD,YAAY,OAAO,CAAC,EAAE,UAAU,EAK/B;IAYD,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAkB5C;IAED,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI,CASvE;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAuB9C;IAkBK,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCpD;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-socket.js b/lib.commonjs/providers/provider-socket.js index ad8dfce7a..b6868ff7c 100644 --- a/lib.commonjs/providers/provider-socket.js +++ b/lib.commonjs/providers/provider-socket.js @@ -1,4 +1,16 @@ -"use strict"; +'use strict'; + +var abstractProvider = require('./abstract-provider.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var providerJsonrpc = require('./provider-jsonrpc.js'); + /** * Generic long-lived socket provider. * @@ -9,11 +21,6 @@ * * @_subsection: api/providers/abstract-provider */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SocketProvider = exports.SocketEventSubscriber = exports.SocketPendingSubscriber = exports.SocketBlockSubscriber = exports.SocketSubscriber = void 0; -const abstract_provider_js_1 = require("./abstract-provider.js"); -const index_js_1 = require("../utils/index.js"); -const provider_jsonrpc_js_1 = require("./provider-jsonrpc.js"); class SocketSubscriber { #provider; #filter; @@ -47,7 +54,7 @@ class SocketSubscriber { // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs // and resume pause(dropWhilePaused) { - (0, index_js_1.assert)(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); + errors.assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); this.#paused = !!dropWhilePaused; } resume() { @@ -78,7 +85,6 @@ class SocketSubscriber { throw new Error("sub-classes must implemente this; _emit"); } } -exports.SocketSubscriber = SocketSubscriber; class SocketBlockSubscriber extends SocketSubscriber { constructor(provider) { super(provider, ["newHeads"]); @@ -87,7 +93,6 @@ class SocketBlockSubscriber extends SocketSubscriber { provider.emit("block", parseInt(message.number)); } } -exports.SocketBlockSubscriber = SocketBlockSubscriber; class SocketPendingSubscriber extends SocketSubscriber { constructor(provider) { super(provider, ["newPendingTransactions"]); @@ -96,7 +101,6 @@ class SocketPendingSubscriber extends SocketSubscriber { provider.emit("pending", message); } } -exports.SocketPendingSubscriber = SocketPendingSubscriber; class SocketEventSubscriber extends SocketSubscriber { #logFilter; get logFilter() { @@ -110,12 +114,11 @@ class SocketEventSubscriber extends SocketSubscriber { provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); } } -exports.SocketEventSubscriber = SocketEventSubscriber; /** * SocketProvider... * */ -class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider { +class SocketProvider extends providerJsonrpc.JsonRpcApiProvider { #callbacks; // Maps each filterId to its subscriber #subs; @@ -130,17 +133,17 @@ class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider { } // This value is only valid after _start has been called /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ + get _network(): Network { + if (this.#network == null) { + throw new Error("this shouldn't happen"); + } + return this.#network.clone(); + } + */ _getSubscriber(sub) { switch (sub.type) { case "close": - return new abstract_provider_js_1.UnmanagedSubscriber("close"); + return new abstractProvider.UnmanagedSubscriber("close"); case "block": return new SocketBlockSubscriber(this); case "pending": @@ -151,7 +154,7 @@ class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider { // Handled auto-matically within AbstractProvider // when the log.removed = true if (sub.filter.orphan === "drop-log") { - return new abstract_provider_js_1.UnmanagedSubscriber("drop-log"); + return new abstractProvider.UnmanagedSubscriber("drop-log"); } } return super._getSubscriber(sub); @@ -168,7 +171,7 @@ class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider { } async _send(payload) { // WebSocket provider doesn't accept batches - (0, index_js_1.assertArgument)(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); + errors.assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); // @TODO: stringify payloads here and store to prevent mutations // Prepare a promise to respond to const promise = new Promise((resolve, reject) => { @@ -182,25 +185,25 @@ class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider { } // Sub-classes must call this once they are connected /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ + async _start(): Promise { + if (this.#ready) { return; } + + for (const { payload } of this.#callbacks.values()) { + await this._write(JSON.stringify(payload)); + } + + this.#ready = (async function() { + await super._start(); + })(); + } + */ // Sub-classes must call this for each message async _processMessage(message) { const result = (JSON.parse(message)); if ("id" in result) { const callback = this.#callbacks.get(result.id); if (callback == null) { - this.emit("error", (0, index_js_1.makeError)("received result for unknown id", "UNKNOWN_ERROR", { + this.emit("error", errors.makeError("received result for unknown id", "UNKNOWN_ERROR", { reasonCode: "UNKNOWN_ID", result, })); @@ -229,5 +232,10 @@ class SocketProvider extends provider_jsonrpc_js_1.JsonRpcApiProvider { throw new Error("sub-classes must override this"); } } + +exports.SocketBlockSubscriber = SocketBlockSubscriber; +exports.SocketEventSubscriber = SocketEventSubscriber; +exports.SocketPendingSubscriber = SocketPendingSubscriber; exports.SocketProvider = SocketProvider; -//# sourceMappingURL=provider-socket.js.map \ No newline at end of file +exports.SocketSubscriber = SocketSubscriber; +//# sourceMappingURL=provider-socket.js.map diff --git a/lib.commonjs/providers/provider-socket.js.map b/lib.commonjs/providers/provider-socket.js.map index a62d20d14..8330a7e9b 100644 --- a/lib.commonjs/providers/provider-socket.js.map +++ b/lib.commonjs/providers/provider-socket.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-socket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,iEAA6D;AAC7D,gDAAsE;AACtE,+DAA2D;AAmB3D,MAAa,gBAAgB;IAC3B,SAAS,CAAiB;IAE1B,OAAO,CAAS;IAChB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,SAAS,CAAkC;IAC3C,OAAO,CAAiB;IAExB,YAAY,CAAuB;IAEnC,YAAY,QAAwB,EAAE,MAAkB;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS;aAC5B,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC;aAClC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;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Content":["/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\nexport class SocketSubscriber {\n #provider;\n #filter;\n get filter() {\n return JSON.parse(this.#filter);\n }\n #filterId;\n #paused;\n #emitPromise;\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider\n .send(\"xcb_subscribe\", this.filter)\n .then((filterId) => {\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n this.#filterId.then((filterId) => {\n this.#provider.send(\"xcb_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\nexport class SocketBlockSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\nexport class SocketPendingSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n get logFilter() {\n return JSON.parse(this.#logFilter);\n }\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * SocketProvider...\n *\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n constructor(network) {\n super(network, { batchMaxCount: 1 });\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n\n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n\n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n // Sub-classes must call this for each message\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (\"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result,\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result.method === \"xcb_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n }\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map"],"names":["assert","JsonRpcApiProvider","UnmanagedSubscriber","assertArgument","makeError"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIO,MAAM,gBAAgB,CAAC;AAC9B,IAAI,SAAS;AACb,IAAI,OAAO;AACX,IAAI,IAAI,MAAM,GAAG;AACjB,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;AACvC,IAAI;AACJ,IAAI,SAAS;AACb,IAAI,OAAO;AACX,IAAI,YAAY;AAChB,IAAI,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE;AAClC,QAAQ,IAAI,CAAC,SAAS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,YAAY;AACvD,YAAY,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;AACvD,YAAY,IAAI,UAAU,EAAE;AAC5B,gBAAgB,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAC/D,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;AACzD,gBAAgB,IAAI,OAAO,IAAI,IAAI,EAAE;AACrC,oBAAoB,OAAO,GAAG,EAAE;AAChC,oBAAoB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC;AACxD,gBAAgB;AAChB,gBAAgB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAClD,YAAY;AACZ,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;AACzD,IAAI;AACJ;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-websocket.d.ts.map b/lib.commonjs/providers/provider-websocket.d.ts.map index a60b262ca..57f785f9c 100644 --- a/lib.commonjs/providers/provider-websocket.d.ts.map +++ b/lib.commonjs/providers/provider-websocket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-websocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9C,SAAS,EAAE,IAA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KAAK,GAAG,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD,qBAAa,iBAAkB,SAAQ,cAAc;;IAIpD,IAAI,SAAS,IAAI,aAAa,CAK7B;IAED,YACC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,gBAAgB,EAC9C,OAAO,CAAC,EAAE,UAAU,EA4CpB;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAM7B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-websocket.js b/lib.commonjs/providers/provider-websocket.js index 182470c1f..6c5370958 100644 --- a/lib.commonjs/providers/provider-websocket.js +++ b/lib.commonjs/providers/provider-websocket.js @@ -1,9 +1,9 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WebSocketProvider = void 0; -const ws_js_1 = require("./ws.js"); /*-browser*/ -const provider_socket_js_1 = require("./provider-socket.js"); -class WebSocketProvider extends provider_socket_js_1.SocketProvider { +'use strict'; + +var ws = require('ws'); +var providerSocket = require('./provider-socket.js'); + +class WebSocketProvider extends providerSocket.SocketProvider { #connect; #websocket; get websocket() { @@ -16,7 +16,7 @@ class WebSocketProvider extends provider_socket_js_1.SocketProvider { super(network); if (typeof url === "string") { this.#connect = () => { - return new ws_js_1.WebSocket(url); + return new ws.WebSocket(url); }; this.#websocket = this.#connect(); } @@ -42,20 +42,20 @@ class WebSocketProvider extends provider_socket_js_1.SocketProvider { this._processMessage(message.data); }; /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); + this.websocket.onclose = (event) => { + // @TODO: What event.code should we reconnect on? + const reconnect = false; + if (reconnect) { + this.pause(true); + if (this.#connect) { + this.#websocket = this.#connect(); + this.#websocket.onopen = ... + // @TODO: this requires the super class to rebroadcast; move it there } - }; - */ + this._reconnect(); + } + }; +*/ } async _write(message) { this.websocket.send(message); @@ -68,5 +68,6 @@ class WebSocketProvider extends provider_socket_js_1.SocketProvider { super.destroy(); } } + exports.WebSocketProvider = WebSocketProvider; -//# sourceMappingURL=provider-websocket.js.map \ No newline at end of file +//# sourceMappingURL=provider-websocket.js.map diff --git a/lib.commonjs/providers/provider-websocket.js.map b/lib.commonjs/providers/provider-websocket.js.map index ddeb9c7fc..3c41971ed 100644 --- a/lib.commonjs/providers/provider-websocket.js.map +++ b/lib.commonjs/providers/provider-websocket.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-websocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":";;;AAAA,mCAAkD,CAAC,YAAY;AAE/D,6DAAsD;AAiBtD,MAAa,iBAAkB,SAAQ,mCAAc;IACnD,QAAQ,CAA0B;IAElC,UAAU,CAAuB;IACjC,IAAI,SAAS;QACX,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;SACrC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,YACE,GAA8C,EAC9C,OAAoB;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE;gBACnB,OAAO,IAAI,iBAAU,CAAC,GAAG,CAAC,CAAC;YAC7B,CAAC,CAAC;YACF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;SACnC;aAAM,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;YACpC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;YACpB,IAAI,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC;SACzB;aAAM;YACL,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;SACvB;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE;YACjC,IAAI;gBACF,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;gBACpB,IAAI,CAAC,MAAM,EAAE,CAAC;aACf;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;gBACxD,sCAAsC;aACvC;QACH,CAAC,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,OAAyB,EAAE,EAAE;YACvD,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC,CAAC;QACF;;;;;;;;;;;;;;MAcF;IACA,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QAC1B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YAC3B,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SACxB;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF;AAtED,8CAsEC"} \ No newline at end of file +{"version":3,"file":"provider-websocket.js","sources":["../../lib.esm/providers/provider-websocket.js"],"sourcesContent":["import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network) {\n super(network);\n if (typeof url === \"string\") {\n this.#connect = () => {\n return new _WebSocket(url);\n };\n this.#websocket = this.#connect();\n }\n else if (typeof url === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n*/\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map"],"names":["SocketProvider","_WebSocket"],"mappings":";;;;;AAEO,MAAM,iBAAiB,SAASA,6BAAc,CAAC;AACtD,IAAI,QAAQ;AACZ,IAAI,UAAU;AACd,IAAI,IAAI,SAAS,GAAG;AACpB,QAAQ,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;AACrC,YAAY,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC;AAC/C,QAAQ;AACR,QAAQ,OAAO,IAAI,CAAC,UAAU;AAC9B,IAAI;AACJ,IAAI,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE;AAC9B,QAAQ,KAAK,CAAC,OAAO,CAAC;AACtB,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AACrC,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,YAAY,IAAI,CAAC,UAAU,GAAG,IAAI;AAClC,QAAQ;AACR,QAAQ,KAAK,CAAC,OAAO,EAAE;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider.d.ts.map b/lib.commonjs/providers/provider.d.ts.map index fdfa52655..5f7427dc0 100644 --- a/lib.commonjs/providers/provider.d.ts.map +++ b/lib.commonjs/providers/provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAE7C,OAAO,EACL,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAoBzB;;;GAGG;AACH,qBAAa,OAAO;IAClB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAG,IAAI,GAAG,MAAM,CAAC;gBAEzB,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM;IAMvC;;OAEG;IACH,MAAM,IAAI,GAAG;CAOd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,EAAE,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC;IAE1B,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtB,WAAW,CAAC,EAA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oB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAK3D;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAKjE;;;OAGG;IAEH;;;OAGG;IACH,kBAAkB,CAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CACnD"} \ No newline at end of file +{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAE7C,OAAO,EACN,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAoBzB;;;GAGG;AACH,qBAAa,OAAO;IACnB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAG,IAAI,GAAG,MAAM,CAAC;IAErC,YAAY,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,EAItC;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CAMZ;CACD;AAED,MAAM,WAAW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G,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAKrE;;;;;;;OAOG;IACH,QAAQ,CACP,mBAAmB,EAAE,QAAQ,GAAG,MAAM,EACtC,WAAW,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;IAEzB;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,mBAAmB,CAAC,CAAC;IAElE;;;;;;OAMG;IACH,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAExE;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAK3D;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAKjE;;;OAGG;IAEH;;;OAGG;IACH,kBAAkB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAClD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider.js b/lib.commonjs/providers/provider.js index b03c16be5..efd1914eb 100644 --- a/lib.commonjs/providers/provider.js +++ b/lib.commonjs/providers/provider.js @@ -1,7 +1,15 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.TransactionResponse = exports.TransactionReceipt = exports.Log = exports.Block = exports.copyRequest = exports.FeeData = void 0; -const index_js_1 = require("../utils/index.js"); +'use strict'; + +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); + const BN_0 = BigInt(0); // ----------------------- function getValue(value) { @@ -27,7 +35,7 @@ class FeeData { */ energyPrice; constructor(energyPrice) { - (0, index_js_1.defineProperties)(this, { + properties.defineProperties(this, { energyPrice: getValue(energyPrice), }); } @@ -42,7 +50,6 @@ class FeeData { }; } } -exports.FeeData = FeeData; function copyRequest(req) { const result = {}; // These could be addresses, ENS names or Addressables @@ -53,21 +60,21 @@ function copyRequest(req) { result.from = req.from; } if (req.data) { - result.data = (0, index_js_1.hexlify)(req.data); + result.data = data.hexlify(req.data); } const bigIntKeys = "networkId,energyLimit,energyPrice,value".split(/,/); for (const key of bigIntKeys) { if (!(key in req) || req[key] == null) { continue; } - result[key] = (0, index_js_1.getBigInt)(req[key], `request.${key}`); + result[key] = maths.getBigInt(req[key], `request.${key}`); } const numberKeys = "type,nonce".split(/,/); for (const key of numberKeys) { if (!(key in req) || req[key] == null) { continue; } - result[key] = (0, index_js_1.getNumber)(req[key], `request.${key}`); + result[key] = maths.getNumber(req[key], `request.${key}`); } if ("blockTag" in req) { result.blockTag = req.blockTag; @@ -80,7 +87,6 @@ function copyRequest(req) { } return result; } -exports.copyRequest = copyRequest; /** * A **Block** represents the data associated with a full block on * Core. @@ -165,7 +171,7 @@ class Block { } return tx; }); - (0, index_js_1.defineProperties)(this, { + properties.defineProperties(this, { provider, hash: getValue(block.hash), number: block.number, @@ -203,7 +209,7 @@ class Block { return []; } // Make sure we prefetched the transactions - (0, index_js_1.assert)(typeof txs[0] === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { + errors.assert(typeof txs[0] === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { operation: "transactionResponses()", }); return txs; @@ -308,7 +314,7 @@ class Block { return tx; } } - (0, index_js_1.assertArgument)(false, "no matching transaction", "indexOrHash", indexOrHash); + errors.assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); } /** * Has this block been mined. @@ -332,7 +338,6 @@ class Block { return createOrphanedBlockFilter(this); } } -exports.Block = Block; ////////////////////// // Log class Log { @@ -349,7 +354,7 @@ class Log { constructor(log, provider) { this.provider = provider; const topics = Object.freeze(log.topics.slice()); - (0, index_js_1.defineProperties)(this, { + properties.defineProperties(this, { transactionHash: log.transactionHash, blockHash: log.blockHash, blockNumber: log.blockNumber, @@ -378,24 +383,23 @@ class Log { } async getBlock() { const block = await this.provider.getBlock(this.blockHash); - (0, index_js_1.assert)(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); + errors.assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); return block; } async getTransaction() { const tx = await this.provider.getTransaction(this.transactionHash); - (0, index_js_1.assert)(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); + errors.assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); return tx; } async getTransactionReceipt() { const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - (0, index_js_1.assert)(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); + errors.assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); return receipt; } removedEvent() { return createRemovedLogFilter(this); } } -exports.Log = Log; ////////////////////// // Transaction Receipt /* @@ -433,7 +437,7 @@ class TransactionReceipt { this.#logs = Object.freeze(tx.logs.map((log) => { return new Log(log, provider); })); - (0, index_js_1.defineProperties)(this, { + properties.defineProperties(this, { provider, to: tx.to, from: tx.from, @@ -517,11 +521,10 @@ class TransactionReceipt { return createRemovedTransactionFilter(this); } reorderedEvent(other) { - (0, index_js_1.assert)(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); + errors.assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); return createReorderedTransactionFilter(this, other); } } -exports.TransactionReceipt = TransactionReceipt; /* export type ReplacementDetectionSetup = { to: string; @@ -716,7 +719,7 @@ class TransactionResponse { if (stopScanning) { return null; } - const { blockNumber, nonce } = await (0, index_js_1.resolveProperties)({ + const { blockNumber, nonce } = await properties.resolveProperties({ blockNumber: this.provider.getBlockNumber(), nonce: this.provider.getTransactionCount(this.from), }); @@ -787,7 +790,7 @@ class TransactionResponse { tx.value === BN_0) { reason = "cancelled"; } - (0, index_js_1.assert)(false, "transaction was replaced", "TRANSACTION_REPLACED", { + errors.assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { cancelled: reason === "replaced" || reason === "cancelled", reason, replacement: tx.replaceableTransaction(startBlock), @@ -828,7 +831,7 @@ class TransactionResponse { if (timeout > 0) { const timer = setTimeout(() => { cancel(); - reject((0, index_js_1.makeError)("wait for transaction timeout", "TIMEOUT")); + reject(errors.makeError("wait for transaction timeout", "TIMEOUT")); }, timeout); cancellers.push(() => { clearTimeout(timer); @@ -854,7 +857,7 @@ class TransactionResponse { } catch (error) { // We were replaced (with enough confirms); re-throw the error - if ((0, index_js_1.isError)(error, "TRANSACTION_REPLACED")) { + if (errors.isError(error, "TRANSACTION_REPLACED")) { cancel(); reject(error); return; @@ -902,7 +905,7 @@ class TransactionResponse { * that evict this transaction. */ removedEvent() { - (0, index_js_1.assert)(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); + errors.assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); return createRemovedTransactionFilter(this); } /** @@ -910,8 +913,8 @@ class TransactionResponse { * that re-order this event against %%other%%. */ reorderedEvent(other) { - (0, index_js_1.assert)(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - (0, index_js_1.assert)(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); + errors.assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); + errors.assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); return createReorderedTransactionFilter(this, other); } /** @@ -924,13 +927,12 @@ class TransactionResponse { * have devastating performance consequences if used incorrectly. */ replaceableTransaction(startBlock) { - (0, index_js_1.assertArgument)(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); + errors.assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); const tx = new TransactionResponse(this, this.provider); tx.#startBlock = startBlock; return tx; } } -exports.TransactionResponse = TransactionResponse; function createOrphanedBlockFilter(block) { return { orphan: "drop-block", hash: block.hash, number: block.number }; } @@ -954,4 +956,11 @@ function createRemovedLogFilter(log) { }, }; } -//# sourceMappingURL=provider.js.map \ No newline at end of file + +exports.Block = Block; +exports.FeeData = FeeData; +exports.Log = Log; +exports.TransactionReceipt = TransactionReceipt; +exports.TransactionResponse = TransactionResponse; +exports.copyRequest = copyRequest; +//# sourceMappingURL=provider.js.map diff --git a/lib.commonjs/providers/provider.js.map b/lib.commonjs/providers/provider.js.map index b2619baf1..00a976d6d 100644 --- a/lib.commonjs/providers/provider.js.map +++ b/lib.commonjs/providers/provider.js.map @@ -1 +1 @@ -{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":";;;AAAA,gDAU2B;AAS3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAWvB,0BAA0B;AAE1B,SAAS,QAAQ,CAAI,KAA2B;IAC9C,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,MAAM,CAAC,KAAoB;IAClC,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC,QAAQ,EA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O;YACpB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACzC,KAAK,EAAE,GAAG,CAAC,KAAK;SACjB;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"provider.js","sources":["../../lib.esm/providers/provider.js"],"sourcesContent":["import { defineProperties, getBigInt, getNumber, hexlify, resolveProperties, assert, assertArgument, isError, makeError, } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The energy price for legacy networks.\n */\n energyPrice;\n constructor(energyPrice) {\n defineProperties(this, {\n energyPrice: getValue(energyPrice),\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { energyPrice } = this;\n return {\n _type: \"FeeData\",\n energyPrice: toJson(energyPrice),\n };\n }\n}\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"networkId,energyLimit,energyPrice,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipReadEnabled = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Core.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total energy limit for this block.\n */\n energyLimit;\n /**\n * The total energy used in this block.\n */\n energyUsed;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per energy that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerEnergy;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof tx !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n nonce: block.nonce,\n difficulty: block.difficulty,\n energyLimit: block.energyLimit,\n energyUsed: block.energyUsed,\n miner: block.miner,\n extraData: block.extraData,\n baseFeePerEnergy: getValue(block.baseFeePerEnergy),\n });\n }\n /**\n * Returns the list of transaction hashes.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof tx === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions for blocks which\n * prefetched them, by passing ``true`` to %%prefetchTxs%%\n * into [[provider_getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof txs[0] === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\",\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this;\n return {\n _type: \"Block\",\n baseFeePerEnergy: toJson(baseFeePerEnergy),\n difficulty: toJson(difficulty),\n extraData,\n energyLimit: toJson(energyLimit),\n energyUsed: toJson(energyUsed),\n hash,\n miner,\n nonce,\n number,\n parentHash,\n timestamp,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++],\n done: false,\n };\n }\n return { value: undefined, done: true };\n },\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() {\n return this.#transactions.length;\n }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof indexOrHash === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof v === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash === hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof tx === \"string\") {\n return await this.provider.getTransaction(tx);\n }\n else {\n return tx;\n }\n }\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof indexOrHash === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Has this block been mined.\n *\n * If true, the block has been typed-gaurded that all mined\n * properties are non-null.\n */\n isMined() {\n return !!this.hash;\n }\n /**\n *\n */\n isLondon() {\n return !!this.baseFeePerEnergy;\n }\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\nexport class Log {\n provider;\n transactionHash;\n blockHash;\n blockNumber;\n removed;\n address;\n data;\n topics;\n index;\n transactionIndex;\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this;\n return {\n _type: \"log\",\n address,\n blockHash,\n blockNumber,\n data,\n index,\n removed,\n topics,\n transactionHash,\n transactionIndex,\n };\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\nexport class TransactionReceipt {\n provider;\n to;\n from;\n contractAddress;\n hash;\n index;\n blockHash;\n blockNumber;\n logsBloom;\n energyUsed;\n cumulativeEnergyUsed;\n energyPrice;\n type;\n //readonly byzantium!: boolean;\n status;\n root;\n #logs;\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n energyUsed: tx.energyUsed,\n cumulativeEnergyUsed: tx.cumulativeEnergyUsed,\n energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice),\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root,\n });\n }\n get logs() {\n return this.#logs;\n }\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,\n status, root, } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash,\n blockNumber,\n //byzantium,\n contractAddress,\n cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed),\n from,\n energyPrice: toJson(this.energyPrice),\n energyUsed: toJson(this.energyUsed),\n hash,\n index,\n logs,\n logsBloom,\n root,\n status,\n to,\n };\n }\n get length() {\n return this.logs.length;\n }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n },\n };\n }\n get fee() {\n return this.energyUsed * this.energyPrice;\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n async getResult() {\n return await this.provider.getTransactionResult(this.hash);\n }\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/*\nexport type ReplacementDetectionSetup = {\n to: string;\n from: string;\n value: bigint;\n data: string;\n nonce: number;\n block: number;\n};\n*/\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of energy this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n energyLimit;\n /**\n * The energy price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective energy price// (the fee per energy that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerEnergy]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of energy the transaction\n * consumes.\n */\n energyPrice;\n /**\n * The data.\n */\n data;\n /**\n * The value, in ore. Use [[formatXCB]] to format this value\n * as xcb.\n */\n value;\n /**\n * The chain ID.\n */\n networkId;\n /**\n * The signature.\n */\n signature;\n #startBlock;\n /**\n * Create a new TransactionResponse with %%tx%% parameters\n * connected to %%provider%%.\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null;\n this.blockHash = tx.blockHash != null ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.from = tx.from;\n this.to = tx.to || null;\n this.energyLimit = tx.energyLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.energyPrice = tx.energyPrice;\n this.networkId = tx.networkId;\n this.signature = tx.signature;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON representation of this transaction.\n */\n toJSON() {\n const { index, hash, type, to, from, nonce, data, signature } = this;\n return {\n _type: \"TransactionReceipt\",\n networkId: toJson(this.networkId),\n data,\n from,\n energyLimit: toJson(this.energyLimit),\n energyPrice: toJson(this.energyPrice),\n hash,\n nonce,\n signature,\n to,\n index,\n type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = _confirms == null ? 1 : _confirms;\n const timeout = _timeout == null ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = startBlock === -1 ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from),\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if (blockNumber - receipt.blockNumber + 1 < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data &&\n tx.to === this.to &&\n tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" &&\n tx.from === tx.to &&\n tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: reason === \"replaced\" || reason === \"cancelled\",\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt,\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (receipt) {\n if ((await receipt.confirmations()) >= confirms) {\n return receipt;\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => {\n cancellers.forEach((c) => c());\n };\n // On cancel, stop scanning for replacements\n cancellers.push(() => {\n stopScanning = true;\n });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => {\n clearTimeout(timer);\n });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n resolve(receipt);\n }\n };\n cancellers.push(() => {\n this.provider.off(this.hash, txListener);\n });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => {\n this.provider.off(\"block\", replaceListener);\n });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return this.blockHash != null;\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return this.type === 0;\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return {\n orphan: \"drop-log\",\n log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index,\n },\n };\n}\n//# sourceMappingURL=provider.js.map"],"names":["defineProperties","hexlify","getBigInt","getNumber","assert","assertArgument","resolveProperties","makeError","isError"],"mappings":";;;;;;;;;;;;AACA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB;AACA,SAAS,QAAQ,CAAC,KAAK,EAAE;AACzB,IAAI,IAAI,KAAK,IAAI,IAAI,EAAE;AACvB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,OAAO,KAAK;AAChB;AACA,SAAS,MAAM,CAAC,KAAK,EAAE;AACvB,IAAI,IAAI,KAAK,IAAI,IAAI,EAAE;AACvB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,OAAO,KAAK,CAAC,QAAQ,EAAE;AAC3B;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,OAAO,CAAC;AACrB;AACA;AACA;AACA,IAAI,WAAW;AACf,IAAI,WAAW,CAAC,WAAW,EAAE;AAC7B,QAAQA,2BAAgB,CAAC,IAAI,EAAE;AAC/B,YAAY,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC;AAC9C,SAAS,CAAC;AACV,IAAI;AACJ;AACA;AACA;AACA,IAAI,MAAM,GAAG;AACb,QAAQ,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI;AACpC,QAAQ,OAAO;AACf,YAAY,KAAK,EAAE,SAAS;AAC5B,YAAY,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC;AAC5C,SAAS;AACT,IAAI;AACJ;AACO,SAAS,WAAW,CAAC,GAAG,EAAE;AACjC,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB;AACA,IAAI,IAAI,GAAG,CAAC,EAAE,EAAE;AAChB,QAAQ,MAAM,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE;AAC1B,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BAA8B,CAAC,EAAE,EAAE;AAC5C,IAAI,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,EAAE;AAC7C;AACA,SAAS,sBAAsB,CAAC,GAAG,EAAE;AACrC,IAAI,OAAO;AACX,QAAQ,MAAM,EAAE,UAAU;AAC1B,QAAQ,GAAG,EAAE;AACb,YAAY,eAAe,EAAE,GAAG,CAAC,eAAe;AAChD,YAAY,SAAS,EAAE,GAAG,CAAC,SAAS;AACpC,YAAY,WAAW,EAAE,GAAG,CAAC,WAAW;AACxC,YAAY,OAAO,EAAE,GAAG,CAAC,OAAO;AAChC,YAAY,IAAI,EAAE,GAAG,CAAC,IAAI;AAC1B,YAAY,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;AACrD,YAAY,KAAK,EAAE,GAAG,CAAC,KAAK;AAC5B,SAAS;AACT,KAAK;AACL;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/signer-noncemanager.d.ts.map b/lib.commonjs/providers/signer-noncemanager.d.ts.map index 9f69385c3..ccd407c82 100644 --- a/lib.commonjs/providers/signer-noncemanager.d.ts.map +++ b/lib.commonjs/providers/signer-noncemanager.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signer-noncemanager.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,YAAa,SAAQ,cAAc;;IAC9C,MAAM,EAAG,MAAM,CAAC;gBAKJ,MAAM,EAAE,MAAM;IA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AE/C;IAEK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAWnD;IAED,SAAS,IAAI,IAAI,CAEhB;IAED,KAAK,IAAI,IAAI,CAGZ;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAU1E;IAED,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvD;IAED,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzD;IAED,aAAa,CACZ,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/signer-noncemanager.js b/lib.commonjs/providers/signer-noncemanager.js index 477bdb636..e5114586c 100644 --- a/lib.commonjs/providers/signer-noncemanager.js +++ b/lib.commonjs/providers/signer-noncemanager.js @@ -1,15 +1,23 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.NonceManager = void 0; -const index_js_1 = require("../utils/index.js"); -const abstract_signer_js_1 = require("./abstract-signer.js"); -class NonceManager extends abstract_signer_js_1.AbstractSigner { +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var abstractSigner = require('./abstract-signer.js'); + +class NonceManager extends abstractSigner.AbstractSigner { signer; #noncePromise; #delta; constructor(signer) { super(signer.provider); - (0, index_js_1.defineProperties)(this, { signer }); + properties.defineProperties(this, { signer }); this.#noncePromise = null; this.#delta = 0; } @@ -55,5 +63,6 @@ class NonceManager extends abstract_signer_js_1.AbstractSigner { return this.signer.signTypedData(domain, types, value); } } + exports.NonceManager = NonceManager; -//# sourceMappingURL=signer-noncemanager.js.map \ No newline at end of file +//# sourceMappingURL=signer-noncemanager.js.map diff --git a/lib.commonjs/providers/signer-noncemanager.js.map b/lib.commonjs/providers/signer-noncemanager.js.map index 267ba9ef3..aea6b9033 100644 --- a/lib.commonjs/providers/signer-noncemanager.js.map +++ b/lib.commonjs/providers/signer-noncemanager.js.map @@ -1 +1 @@ -{"version":3,"file":"signer-noncemanager.js","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":";;;AAAA,gDAAqD;AACrD,6DAAsD;AAYtD,MAAa,YAAa,SAAQ,mCAAc;IAC9C,MAAM,CAAU;IAEhB,aAAa,CAAyB;IACtC,MAAM,CAAS;IAEf,YAAY,MAAc;QACxB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,IAAA,2BAAgB,EAAe,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IAClC,CAAC;IAED,OAAO,CAAC,QAAyB;QAC/B,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAmB;QAChC,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,EAAE;gBAC9B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;aAChD;YAED,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;YAC1B,OAAO,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;SAC3C;QAED,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED,SAAS;QACP,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAsB;QAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;QAEjB,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;QAC/C,EAAE,CAAC,KAAK,GAAG,MAAM,YAAY,CAAC;QAE9B,sDAAsD;QACtD,wDAAwD;QACxD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,eAAe,CAAC,EAAsB;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,WAAW,CAAC,OAA4B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,aAAa,CACX,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;QAE1B,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC;CACF;AAvED,oCAuEC"} \ No newline at end of file +{"version":3,"file":"signer-noncemanager.js","sources":["../../lib.esm/providers/signer-noncemanager.js"],"sourcesContent":["import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nexport class NonceManager extends AbstractSigner {\n signer;\n #noncePromise;\n #delta;\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n increment() {\n this.#delta++;\n }\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map"],"names":["AbstractSigner","defineProperties"],"mappings":";;;;;;;;;;;;;AAEO,MAAM,YAAY,SAASA,6BAAc,CAAC;AACjD,IAAI,MAAM;AACV,IAAI,aAAa;AACjB,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC9B,QAAQC,2BAAgB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC;AAC1C,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI;AACjC,QAAQ,IAAI,CAAC,MAAM,GAAG,CAAC;AACvB,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;AACvC,IAAI;AACJ,IAAI,OAAO,CAAC,QAAQ,EAAE;AACt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,CAAC,OAAO,EAAE;AACzB,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;AAC/C,IAAI;AACJ,IAAI,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;AACxC,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;AAC9D,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/signer.d.ts.map b/lib.commonjs/providers/signer.d.ts.map index 4dff87bbe..d5935e8bb 100644 --- a/lib.commonjs/providers/signer.d.ts.map +++ b/lib.commonjs/providers/signer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,WAAW,EAAE,cAAc,EAAE,YAAY;IACvE;;OAEG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IAK3C;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC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,CAAC;IAEzD;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEtE;;;;;;;;;OASG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3D;;OAEG;IACH,aAAa,CACZ,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/lib.commonjs/providers/signer.js b/lib.commonjs/providers/signer.js index c73406acc..020fda188 100644 --- a/lib.commonjs/providers/signer.js +++ b/lib.commonjs/providers/signer.js @@ -1,3 +1,3 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=signer.js.map \ No newline at end of file +'use strict'; + +//# sourceMappingURL=signer.js.map diff --git a/lib.commonjs/providers/signer.js.map b/lib.commonjs/providers/signer.js.map index 68d48a837..96c6deffe 100644 --- a/lib.commonjs/providers/signer.js.map +++ b/lib.commonjs/providers/signer.js.map @@ -1 +1 @@ -{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":""} \ No newline at end of file +{"version":3,"file":"signer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-connection.d.ts.map b/lib.commonjs/providers/subscriber-connection.d.ts.map index 2f88c6893..baef99405 100644 --- a/lib.commonjs/providers/subscriber-connection.d.ts.map +++ b/lib.commonjs/providers/subscriber-connection.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EA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IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-connection.js b/lib.commonjs/providers/subscriber-connection.js index b5fe46d6a..08970fdf2 100644 --- a/lib.commonjs/providers/subscriber-connection.js +++ b/lib.commonjs/providers/subscriber-connection.js @@ -1,7 +1,14 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BlockConnectionSubscriber = void 0; -const index_js_1 = require("../utils/index.js"); +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); + /** * @TODO * @@ -24,7 +31,7 @@ class BlockConnectionSubscriber { } this.#running = true; this.#filterId = this.#provider._subscribe(["newHeads"], (result) => { - const blockNumber = (0, index_js_1.getNumber)(result.number); + const blockNumber = maths.getNumber(result.number); const initial = this.#blockNumber === -2 ? blockNumber : this.#blockNumber + 1; for (let b = initial; b <= blockNumber; b++) { this.#provider.emit("block", b); @@ -52,5 +59,6 @@ class BlockConnectionSubscriber { this.start(); } } + exports.BlockConnectionSubscriber = BlockConnectionSubscriber; -//# sourceMappingURL=subscriber-connection.js.map \ No newline at end of file +//# sourceMappingURL=subscriber-connection.js.map diff --git a/lib.commonjs/providers/subscriber-connection.js.map b/lib.commonjs/providers/subscriber-connection.js.map index 61ac5b476..5368de059 100644 --- a/lib.commonjs/providers/subscriber-connection.js.map +++ b/lib.commonjs/providers/subscriber-connection.js.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":";;;AAAA,gDAA8C;AAkB9C;;;;GAIG;AACH,MAAa,yBAAyB;IACpC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,QAAQ,CAAU;IAElB,SAAS,CAAgB;IAEzB,YAAY,QAA+B;QACzC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,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,CAAC;IACd,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF;AAtDD,8DAsDC"} \ No newline at end of file +{"version":3,"file":"subscriber-connection.js","sources":["../../lib.esm/providers/subscriber-connection.js"],"sourcesContent":["import { getNumber } from \"../utils/index.js\";\n/**\n * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class BlockConnectionSubscriber {\n #provider;\n #blockNumber;\n #running;\n #filterId;\n constructor(provider) {\n this.#provider = provider;\n this.#blockNumber = -2;\n this.#running = false;\n this.#filterId = null;\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n this.#filterId = this.#provider._subscribe([\"newHeads\"], (result) => {\n const blockNumber = getNumber(result.number);\n const initial = this.#blockNumber === -2 ? blockNumber : this.#blockNumber + 1;\n for (let b = initial; b <= blockNumber; b++) {\n this.#provider.emit(\"block\", b);\n }\n this.#blockNumber = blockNumber;\n });\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n if (this.#filterId != null) {\n this.#provider._unsubscribe(this.#filterId);\n this.#filterId = null;\n }\n }\n pause(dropWhilePaused) {\n if (dropWhilePaused) {\n this.#blockNumber = -2;\n }\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n//# sourceMappingURL=subscriber-connection.js.map"],"names":["getNumber"],"mappings":";;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,CAAC;AACvC,IAAI,SAAS;AACb,IAAI,YAAY;AAChB,IAAI,QAAQ;AACZ,IAAI,SAAS;AACb,IAAI,WAAW,CAAC,QAAQ,EAAE;AAC1B,QAAQ,IAAI,CAAC,SAAS,GAAG,QAAQ;AACjC,QAAQ,IAAI,CAAC,YAAY,GAAG,EAAE;AAC9B,QAAQ,IAAI,CAAC,QAAQ,GAAG,KAAK;AAC7B,QAAQ,IAAI,CAAC,SAAS,GAAG,IAAI;AAC7B,IAAI;AACJ,IAAI,KAAK,GAAG;AACZ,QAA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B,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-filterid.d.ts.map b/lib.commonjs/providers/subscriber-filterid.d.ts.map index b2d81a26c..957e1320c 100644 --- a/lib.commonjs/providers/subscriber-filterid.d.ts.map +++ b/lib.commonjs/providers/subscriber-filterid.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,YAAW,UAAU;;gBAYvC,QAAQ,EAAE,kBAAkB;IAaxC,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU;IAkEhD,KAAK,IAAI,IAAI;IASb,IAAI,IAAI,IAAI;IAWZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAOtC,MAAM,IAAI,IAAI;CAGf;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;;gBAGjD,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW;IAK7D,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU;IAI1C,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKzD,YAAY,CAChB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAClB,OAAO,CAAC,IAAI,CAAC;CAKjB;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,kBAAkB;IACzD,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD,YAAY,CAChB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAClB,OAAO,CAAC,IAAI,CAAC;CAKjB"} \ No newline at end of file +{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,YAAW,UAAU;;IAYpD,YAAY,QAAQ,EAAE,kBAAkB,EAWvC;IAED,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAExD;IAED,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E;IAED,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAE/C;IAgED,KAAK,IAAI,IAAI,CAOZ;IAED,IAAI,IAAI,IAAI,CASX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;;IAG9D,YAAY,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAG5D;IAED,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAE/C;IAEK,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAG9D;IAEK,YAAY,CACjB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;CACD;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,kBAAkB;IAC1D,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D;IAEK,YAAY,CACjB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-filterid.js b/lib.commonjs/providers/subscriber-filterid.js index 8618304de..fbb13cf29 100644 --- a/lib.commonjs/providers/subscriber-filterid.js +++ b/lib.commonjs/providers/subscriber-filterid.js @@ -1,8 +1,15 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FilterIdPendingSubscriber = exports.FilterIdEventSubscriber = exports.FilterIdSubscriber = void 0; -const index_js_1 = require("../utils/index.js"); -const subscriber_polling_js_1 = require("./subscriber-polling.js"); +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var subscriberPolling = require('./subscriber-polling.js'); + function copy(obj) { return JSON.parse(JSON.stringify(obj)); } @@ -52,7 +59,7 @@ class FilterIdSubscriber { filterId = await this.#filterIdPromise; } catch (error) { - if (!(0, index_js_1.isError)(error, "UNSUPPORTED_OPERATION") || + if (!errors.isError(error, "UNSUPPORTED_OPERATION") || error.operation !== "xcb_newFilter") { throw error; } @@ -119,7 +126,6 @@ class FilterIdSubscriber { this.start(); } } -exports.FilterIdSubscriber = FilterIdSubscriber; /** * A **FilterIdSubscriber** for receiving contract events. * @@ -132,7 +138,7 @@ class FilterIdEventSubscriber extends FilterIdSubscriber { this.#event = copy(filter); } _recover(provider) { - return new subscriber_polling_js_1.PollingEventSubscriber(provider, this.#event); + return new subscriberPolling.PollingEventSubscriber(provider, this.#event); } async _subscribe(provider) { const filterId = await provider.send("xcb_newFilter", [this.#event]); @@ -144,7 +150,6 @@ class FilterIdEventSubscriber extends FilterIdSubscriber { } } } -exports.FilterIdEventSubscriber = FilterIdEventSubscriber; /** * A **FilterIdSubscriber** for receiving pending transactions events. * @@ -160,5 +165,8 @@ class FilterIdPendingSubscriber extends FilterIdSubscriber { } } } + +exports.FilterIdEventSubscriber = FilterIdEventSubscriber; exports.FilterIdPendingSubscriber = FilterIdPendingSubscriber; -//# sourceMappingURL=subscriber-filterid.js.map \ No newline at end of file +exports.FilterIdSubscriber = FilterIdSubscriber; +//# sourceMappingURL=subscriber-filterid.js.map diff --git a/lib.commonjs/providers/subscriber-filterid.js.map b/lib.commonjs/providers/subscriber-filterid.js.map index 0605e1c06..70d85f1fb 100644 --- a/lib.commonjs/providers/subscriber-filterid.js.map +++ b/lib.commonjs/providers/subscriber-filterid.js.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":";;;AAAA,gDAA4C;AAE5C,mEAAiE;AAOjE,SAAS,IAAI,CAAC,GAAQ;IACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAa,kBAAkB;IAC7B,SAAS,CAAqB;IAE9B,gBAAgB,CAAyB;IACzC,OAAO,CAA+B;IAEtC,QAAQ,CAAU;IAElB,QAAQ,CAAiB;IAEzB,MAAM,CAAU;IAEhB,YAAY,QAA4B;QACtC,IAAI,CAAC,SAAS,GAAG,QAAQ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CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC1E;IACH,CAAC;CACF;AAzBD,0DAyBC;AAED;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,kBAAkB;IAC/D,KAAK,CAAC,UAAU,CAAC,QAA4B;QAC3C,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,QAA4B,EAC5B,OAAmB;QAEnB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SAClC;IACH,CAAC;CACF;AAbD,8DAaC"} \ No newline at end of file +{"version":3,"file":"subscriber-filterid.js","sources":["../../lib.esm/providers/subscriber-filterid.js"],"sourcesContent":["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 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 _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\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\") ||\n error.operation !== \"xcb_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.networkId !== network.networkId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"xcb_getFilterChanges\", [\n filterId,\n ]);\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 this.#provider.send(\"xcb_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() {\n this.start();\n }\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 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(\"xcb_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(\"xcb_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"],"names":["isError","PollingEventSubscriber"],"mappings":";;;;;;;;;;;;AAEA,SAAS,IAAI,CAAC,GAAG,EAAE;AACnB,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAkB,CAAC;AAChC,IAAI,SAAS;AACb,IAAI,gBAAgB;AACpB,IAAI,OAAO;AACX,IAAI,QAAQ;AACZ,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,QAAQ,EAAE;AAC1B,QAAQ,IAAI,CAAC,SAAS,GAAG,QAAQ;AACjC,QAAQ,IAAI,CAAC,gBAAgB,GAAG,IAAI;AACpC,QAAQ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5C,QAAQ,IAAI,CAAC,QAAQ,GAAG,KAAK;AAC7B,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI;AAC5B,QAAQ,IAAI,CAAC,MAAM,GAAG,KAAK;AAC3B,IAAI;AACJ,IAAI,UAAU,CAAC,QAAQ,EAAE;AACzB,QAAQ,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC;AACxD,IAAI;AACJ,IAAI,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE;AACnC,QAAQ,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC;AACxD,IAAI;AACJ,IAAI,QAAQ,CAAC,QAAQ,EAAE;A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A;AACA;AACO,MAAM,yBAAyB,SAAS,kBAAkB,CAAC;AAClE,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAE,CAAC;AACzE,IAAI;AACJ,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE;AAC1C,QAAQ,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;AACtC,YAAY,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC;AAC5C,QAAQ;AACR,IAAI;AACJ;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-polling.d.ts.map b/lib.commonjs/providers/subscriber-polling.d.ts.map index 9082a53d0..9fd6aa7aa 100644 --- a/lib.commonjs/providers/subscriber-polling.d.ts.map +++ b/lib.commonjs/providers/subscriber-polling.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-polling.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9E;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,aAAa,GACnB,UAAU,CAYZ;AAID;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;gBAU3C,QAAQ,EAAE,gBAAgB;IAQtC,IAAI,eAAe,IAAI,MAAM,CAE5B;IACD,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAEhC;IA2CD,KAAK,IAAI,IAAI;IAWb,IAAI,IAAI,IAAI;IAQZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAOtC,MAAM,IAAI,IAAI;CAGf;AAED;;;;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,YAAW,UAAU;;IAWxD,YAAY,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAM1D;IA6BD,KAAK,IAAI,IAAI,CAYZ;IAED,IAAI,IAAI,IAAI,CAOX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-polling.js b/lib.commonjs/providers/subscriber-polling.js index a07025304..4794c69ec 100644 --- a/lib.commonjs/providers/subscriber-polling.js +++ b/lib.commonjs/providers/subscriber-polling.js @@ -1,7 +1,15 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.PollingEventSubscriber = exports.PollingTransactionSubscriber = exports.PollingOrphanSubscriber = exports.OnBlockSubscriber = exports.PollingBlockSubscriber = exports.getPollingSubscriber = void 0; -const index_js_1 = require("../utils/index.js"); +'use strict'; + +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + function copy(obj) { return JSON.parse(JSON.stringify(obj)); } @@ -14,15 +22,14 @@ function getPollingSubscriber(provider, event) { if (event === "block") { return new PollingBlockSubscriber(provider); } - if ((0, index_js_1.isHexString)(event, 32)) { + if (data.isHexString(event, 32)) { return new PollingTransactionSubscriber(provider, event); } - (0, index_js_1.assert)(false, "unsupported polling event", "UNSUPPORTED_OPERATION", { + errors.assert(false, "unsupported polling event", "UNSUPPORTED_OPERATION", { operation: "getPollingSubscriber", info: { event }, }); } -exports.getPollingSubscriber = getPollingSubscriber; // @TODO: refactor this /** * @TODO @@ -103,7 +110,6 @@ class PollingBlockSubscriber { this.start(); } } -exports.PollingBlockSubscriber = PollingBlockSubscriber; /** * @TODO * @@ -145,7 +151,6 @@ class OnBlockSubscriber { this.start(); } } -exports.OnBlockSubscriber = OnBlockSubscriber; /** * @TODO * @@ -159,10 +164,8 @@ class PollingOrphanSubscriber extends OnBlockSubscriber { } async _poll(blockNumber, provider) { throw new Error("@TODO"); - console.log(this.#filter); } } -exports.PollingOrphanSubscriber = PollingOrphanSubscriber; /** * @TODO * @@ -181,7 +184,6 @@ class PollingTransactionSubscriber extends OnBlockSubscriber { } } } -exports.PollingTransactionSubscriber = PollingTransactionSubscriber; /** * @TODO * @@ -253,5 +255,11 @@ class PollingEventSubscriber { this.start(); } } + +exports.OnBlockSubscriber = OnBlockSubscriber; +exports.PollingBlockSubscriber = PollingBlockSubscriber; exports.PollingEventSubscriber = PollingEventSubscriber; -//# sourceMappingURL=subscriber-polling.js.map \ No newline at end of file +exports.PollingOrphanSubscriber = PollingOrphanSubscriber; +exports.PollingTransactionSubscriber = PollingTransactionSubscriber; +exports.getPollingSubscriber = getPollingSubscriber; +//# sourceMappingURL=subscriber-polling.js.map diff --git a/lib.commonjs/providers/subscriber-polling.js.map b/lib.commonjs/providers/subscriber-polling.js.map index c73438137..8f9ba73e0 100644 --- a/lib.commonjs/providers/subscriber-polling.js.map +++ b/lib.commonjs/providers/subscriber-polling.js.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-polling.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":";;;AAAA,gDAAwD;AAKxD,SAAS,IAAI,CAAC,GAAQ;IACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAClC,QAA0B,EAC1B,KAAoB;IAEpB,IAAI,KAAK,KAAK,OAAO,EAAE;QACrB,OAAO,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC;KAC7C;IACD,IAAI,IAAA,sBAAW,EAAC,KAAK,EAAE,EAAE,CAAC,EAAE;QAC1B,OAAO,IAAI,4BAA4B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;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AAC;IAED,KAAK,CAAC,eAAyB;QAC7B,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SACxB;IACH,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF;AA/ED,wDA+EC"} \ No newline at end of file +{"version":3,"file":"subscriber-polling.js","sources":["../../lib.esm/providers/subscriber-polling.js"],"sourcesContent":["import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * @TODO\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\",\n info: { event },\n });\n}\n// @TODO: refactor this\n/**\n * @TODO\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 constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n get pollingInterval() {\n return this.#interval;\n }\n set pollingInterval(value) {\n this.#interval = value;\n }\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\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) {\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n/**\n * @TODO\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\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 * @TODO\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 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 this.#blockNumber = blockNumber;\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\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"],"names":["isHexString","assert"],"mappings":";;;;;;;;;;;;AACA,SAAS,IAAI,CAAC,GAAG,EAAE;AACnB,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE;AACtD,IAAI,IAAI,KAAK,KAAK,OAAO,EAAE;AAC3B,QAAQ,OAAO,IAAI,sBAAsB,CA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G,IAAI;AAC5B,QAAQ,IAAI,IAAI,CAAC,YAAY,KAAK,EAAE,EAAE;AACtC,YAAY,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK;AAClE,gBAAgB,IAAI,CAAC,YAAY,GAAG,WAAW;AAC/C,YAAY,CAAC,CAAC;AACd,QAAQ;AACR,QAAQ,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;AAChD,IAAI;AACJ,IAAI,IAAI,GAAG;AACX,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC5B,YAAY;AACZ,QAAQ;AACR,QAAQ,IAAI,CAAC,QAAQ,GAAG,KAAK;AAC7B,QAAQ,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;AACjD,IAAI;AACJ,IAAI,KAAK,CAAC,eAAe,EAAE;AAC3B,QAAQ,IAAI,CAAC,IAAI,EAAE;AACnB,QAAQ,IAAI,eAAe,EAAE;AAC7B,YAAY,IAAI,CAAC,YAAY,GAAG,EAAE;AAClC,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,GAAG;AACb,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,IAAI;AACJ;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/ws-browser.js b/lib.commonjs/providers/ws-browser.js index 88df45b31..57a37406f 100644 --- a/lib.commonjs/providers/ws-browser.js +++ b/lib.commonjs/providers/ws-browser.js @@ -1,6 +1,5 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WebSocket = void 0; +'use strict'; + function getGlobal() { if (typeof self !== "undefined") { return self; @@ -14,5 +13,6 @@ function getGlobal() { throw new Error("unable to locate global object"); } const _WebSocket = getGlobal().WebSocket; + exports.WebSocket = _WebSocket; -//# sourceMappingURL=ws-browser.js.map \ No newline at end of file +//# sourceMappingURL=ws-browser.js.map diff --git a/lib.commonjs/providers/ws-browser.js.map b/lib.commonjs/providers/ws-browser.js.map index 36e022e9b..d61cc0e44 100644 --- a/lib.commonjs/providers/ws-browser.js.map +++ b/lib.commonjs/providers/ws-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"ws-browser.js","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":";;;AAAA,SAAS,SAAS;IAChB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,GAAG,SAAS,EAAE,CAAC,SAAS,CAAC;AAElB,+BAAS"} \ No newline at end of file +{"version":3,"file":"ws-browser.js","sources":["../../lib.esm/providers/ws-browser.js"],"sourcesContent":["function getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map"],"names":[],"mappings":";;AAAA,SAAS,SAAS,GAAG;AACrB,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AACrC,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;AACrD;AACK,MAAC,UAAU,GAAG,SAAS,EAAE,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/ws.js b/lib.commonjs/providers/ws.js index c06b35808..9c02ea4db 100644 --- a/lib.commonjs/providers/ws.js +++ b/lib.commonjs/providers/ws.js @@ -1,6 +1,11 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WebSocket = void 0; -var ws_1 = require("ws"); -Object.defineProperty(exports, "WebSocket", { enumerable: true, get: function () { return ws_1.WebSocket; } }); -//# sourceMappingURL=ws.js.map \ No newline at end of file +'use strict'; + +var ws = require('ws'); + + + +Object.defineProperty(exports, "WebSocket", { + enumerable: true, + get: function () { return ws.WebSocket; } +}); +//# sourceMappingURL=ws.js.map diff --git a/lib.commonjs/providers/ws.js.map b/lib.commonjs/providers/ws.js.map index 15568f152..b0586736c 100644 --- a/lib.commonjs/providers/ws.js.map +++ b/lib.commonjs/providers/ws.js.map @@ -1 +1 @@ -{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../src.ts/providers/ws.ts"],"names":[],"mappings":";;;AAAA,yBAA+B;AAAtB,+FAAA,SAAS,OAAA"} \ No newline at end of file +{"version":3,"file":"ws.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/transaction/accesslist.js b/lib.commonjs/transaction/accesslist.js index bf6e4fe5e..41aafeeb2 100644 --- a/lib.commonjs/transaction/accesslist.js +++ b/lib.commonjs/transaction/accesslist.js @@ -1,13 +1,21 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.accessListify = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../utils/index.js"); +'use strict'; + +var index = require('../address/index.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + function accessSetify(addr, storageKeys) { return { - address: (0, index_js_1.getAddress)(addr), + address: index.getAddress(addr), storageKeys: storageKeys.map((storageKey, index) => { - (0, index_js_2.assertArgument)((0, index_js_2.isHexString)(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); + errors.assertArgument(data.isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); return storageKey.toLowerCase(); }), }; @@ -19,14 +27,14 @@ function accessListify(value) { if (Array.isArray(value)) { return value.map((set, index) => { if (Array.isArray(set)) { - (0, index_js_2.assertArgument)(set.length === 2, "invalid slot set", `value[${index}]`, set); + errors.assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); return accessSetify(set[0], set[1]); } - (0, index_js_2.assertArgument)(set != null && typeof set === "object", "invalid address-slot set", "value", value); + errors.assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value); return accessSetify(set.address, set.storageKeys); }); } - (0, index_js_2.assertArgument)(value != null && typeof value === "object", "invalid access list", "value", value); + errors.assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); const result = Object.keys(value).map((addr) => { const storageKeys = value[addr].reduce((accum, storageKey) => { accum[storageKey] = true; @@ -37,5 +45,6 @@ function accessListify(value) { result.sort((a, b) => a.address.localeCompare(b.address)); return result; } + exports.accessListify = accessListify; -//# sourceMappingURL=accesslist.js.map \ No newline at end of file +//# sourceMappingURL=accesslist.js.map diff --git a/lib.commonjs/transaction/accesslist.js.map b/lib.commonjs/transaction/accesslist.js.map index 2e6dad05b..ff9c42d42 100644 --- a/lib.commonjs/transaction/accesslist.js.map +++ b/lib.commonjs/transaction/accesslist.js.map @@ -1 +1 @@ -{"version":3,"file":"accesslist.js","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,gDAAgE;AAIhE,SAAS,YAAY,CACnB,IAAY,EACZ,WAA0B;IAE1B,OAAO;QACL,OAAO,EAAE,IAAA,qBAAU,EAAC,IAAI,CAAC;QACzB,WAAW,EAAE,WAAW,CAAC,GAAG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,UAAU,EAAE,EAAE;YACpB,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;YACzB,OAAO,KAAK,CAAC;QACf,CAAC,EACqB,EAAE,CACzB,CAAC;QACF,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IACL,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC;AAChB,CAAC;AA/CD,sCA+CC"} \ No newline at end of file +{"version":3,"file":"accesslist.js","sources":["../../lib.esm/transaction/accesslist.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n }),\n };\n}\n/**\n * Returns a [[AccessList]] from any corebcsupported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof set === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof value === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => a.address.localeCompare(b.address));\n return result;\n}\n//# sourceMappingURL=accesslist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KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,qBAAqB,EAAE,OAAO,EAAE,KAAK,CAAC;AACrG,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK;AACpD,QAAQ,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,UAAU,KAAK;AACtE,YAAY,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI;AACpC,YAAY,OAAO,KAAK;AACxB,QAAQ,CAAC,EAAE,EAAE,CAAC;AACd,QAAQ,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;AAClE,IAAI,CAAC,CAAC;AACN,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC7D,IAAI,OAAO,MAAM;AACjB;;"} \ No newline at end of file diff --git a/lib.commonjs/transaction/address.d.ts.map b/lib.commonjs/transaction/address.d.ts.map index 620aa31e9..48e65cc8e 100644 --- a/lib.commonjs/transaction/address.d.ts.map +++ b/lib.commonjs/transaction/address.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EAAE,MAAM,GACb,MAAM,CAIR;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,MAAM,EAAE,MAAM,GACb,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACb,MAAM,CAIR;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"} \ No newline at end of file +{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAC9B,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AAED,wBAAgB,cAAc,CAC7B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"} \ No newline at end of file diff --git a/lib.commonjs/transaction/address.js b/lib.commonjs/transaction/address.js index 3f436b5fd..f3766a262 100644 --- a/lib.commonjs/transaction/address.js +++ b/lib.commonjs/transaction/address.js @@ -1,10 +1,22 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.extractPrefix = exports.recoverAddress = exports.computeAddress = exports.publicToAddress = exports.removeHexPrefix = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const data_js_1 = require("../utils/data.js"); -const index_js_3 = require("../address/index.js"); +'use strict'; + +var index = require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +var sha3 = require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +var signingKey = require('../crypto/signing-key.js'); +require('../crypto/signature.js'); +var data = require('../utils/data.js'); + /** * Returns the address for the %%key%%. * @@ -13,37 +25,38 @@ const index_js_3 = require("../address/index.js"); function removeHexPrefix(val) { return val.substring(0, 2) === "0x" ? val.substring(2) : val; } -exports.removeHexPrefix = removeHexPrefix; function publicToAddress(key, prefix) { - const val = (0, data_js_1.hexDataSlice)((0, index_js_2.sha256)(key), 12); - const checksum = (0, index_js_3.calculateCheckSum)(val, prefix); + const val = data.hexDataSlice(sha3.sha256(key), 12); + const checksum = index.calculateCheckSum(val, prefix); return "0x" + prefix + checksum + removeHexPrefix(val); } -exports.publicToAddress = publicToAddress; function computeAddress(key, prefix) { let pubkey; if (typeof key === "string") { - pubkey = index_js_2.SigningKey.computePublicKey(key, false); + pubkey = signingKey.SigningKey.computePublicKey(key, false); } else { pubkey = key.publicKey; } return publicToAddress(pubkey, prefix); // getAddress(sha256("0x" + pubkey.substring(4)).substring(26)); } -exports.computeAddress = computeAddress; /** * Returns the recovered address for the private key that was * used to sign %%digest%% that resulted in %%signature%%. */ function recoverAddress(digest, signature, prefix) { // return computeAddress(SigningKey.recoverPublicKey(digest, signature)); - const publicKey = index_js_2.SigningKey.recoverPublicKey((0, data_js_1.arrayify)(digest), signature); + const publicKey = signingKey.SigningKey.recoverPublicKey(data.arrayify(digest), signature); return publicToAddress(publicKey, prefix); } -exports.recoverAddress = recoverAddress; function extractPrefix(address) { - address = (0, index_js_1.getAddress)(address); + address = index.getAddress(address); return address.substring(2, 4); } + +exports.computeAddress = computeAddress; exports.extractPrefix = extractPrefix; -//# sourceMappingURL=address.js.map \ No newline at end of file +exports.publicToAddress = publicToAddress; +exports.recoverAddress = recoverAddress; +exports.removeHexPrefix = removeHexPrefix; +//# sourceMappingURL=address.js.map diff --git a/lib.commonjs/transaction/address.js.map b/lib.commonjs/transaction/address.js.map index 6accac4d3..0e89db281 100644 --- a/lib.commonjs/transaction/address.js.map +++ b/lib.commonjs/transaction/address.js.map @@ -1 +1 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,iDAAwD;AAIxD,8CAA0D;AAC1D,kDAAwD;AAExD;;;;GAIG;AAEH,SAAgB,eAAe,CAAC,GAAW;IACzC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC/D,CAAC;AAFD,0CAEC;AAED,SAAgB,eAAe,CAC7B,GAAuB,EACvB,MAAc;IAEd,MAAM,GAAG,GAAG,IAAA,sBAAY,EAAC,IAAA,iBAAM,EAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAA,4BAAiB,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;AACzD,CAAC;AAPD,0CAOC;AAED,SAAgB,cAAc,CAC5B,GAAwB,EACxB,MAAc;IAEd,IAAI,MAAc,CAAC;IACnB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,MAAM,GAAG,qBAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KAClD;SAAM;QACL,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC;KACxB;IACD,OAAO,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,gEAAgE;AAC1G,CAAC;AAXD,wCAWC;AAED;;;GAGG;AACH,SAAgB,cAAc,CAC5B,MAAiB,EACjB,SAAwB,EACxB,MAAc;IAEd,yEAAyE;IACzE,MAAM,SAAS,GAAG,qBAAU,CAAC,gBAAgB,CAAC,IAAA,kBAAQ,EAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IAC3E,OAAO,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AARD,wCAQC;AACD,SAAgB,aAAa,CAAC,OAAe;IAC3C,OAAO,GAAG,IAAA,qBAAU,EAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjC,CAAC;AAHD,sCAGC"} \ No newline at end of file +{"version":3,"file":"address.js","sources":["../../lib.esm/transaction/address.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { arrayify, hexDataSlice } from \"../utils/data.js\";\nimport { calculateCheckSum } from \"../address/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 removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nexport function publicToAddress(key, prefix) {\n const val = hexDataSlice(sha256(key), 12);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport function computeAddress(key, prefix) {\n let pubkey;\n if (typeof key === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return publicToAddress(pubkey, prefix); // getAddress(sha256(\"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, prefix) {\n // return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature);\n return publicToAddress(publicKey, prefix);\n}\nexport function extractPrefix(address) {\n address = getAddress(address);\n return address.substring(2, 4);\n}\n//# sourceMappingURL=address.js.map"],"names":["hexDataSlice","sha256","calculateCheckSum","SigningKey","arrayify","getAddress"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,GAAG,EAAE;AACrC,IAAI,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG;AAChE;AACO,SAAS,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE;AAC7C,IAAI,MAAM,GAAG,GAAGA,iBAAY,CAACC,WAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AAC7C,IAAI,MAAM,QAAQ,GAAGC,uBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC;AACnD,IAAI,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC;AAC1D;AACO,SAAS,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE;AAC5C,IAAI,IAAI,MAAM;AACd,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AACjC,QAAQ,MAAM,GAAGC,qBAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC;AACxD,IAAI;AACJ,SAAS;AACT,QAAQ,MAAM,GAAG,GAAG,CAAC,SAAS;AAC9B,IAAI;AACJ,IAAI,OAAO,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;AAC1D;AACA,IAAI,MAAM,SAAS,GAAGA,qBAAU,CAAC,gBAAgB,CAACC,aAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;AAC9E,IAAI,OAAO,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC;AAC7C;AACO,SAAS,aAAa,CAAC,OAAO,EAAE;AACvC,IAAI,OAAO,GAAGC,gBAAU,CAAC,OAAO,CAAC;AACjC,IAAI,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AAClC;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/transaction/index.d.ts.map b/lib.commonjs/transaction/index.d.ts.map index 304612964..4c5a4305f 100644 --- a/lib.commonjs/transaction/index.d.ts.map +++ b/lib.commonjs/transaction/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GACxB,UAAU,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/transaction/index.js b/lib.commonjs/transaction/index.js index 7257a75d1..fe5bd1c87 100644 --- a/lib.commonjs/transaction/index.js +++ b/lib.commonjs/transaction/index.js @@ -1,17 +1,13 @@ -"use strict"; -/** - * Transactions.. - * - * @_section api/transaction:Transactions [about-transactions] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Transaction = exports.recoverAddress = exports.computeAddress = exports.accessListify = void 0; -null; -var accesslist_js_1 = require("./accesslist.js"); -Object.defineProperty(exports, "accessListify", { enumerable: true, get: function () { return accesslist_js_1.accessListify; } }); -var address_js_1 = require("./address.js"); -Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return address_js_1.computeAddress; } }); -Object.defineProperty(exports, "recoverAddress", { enumerable: true, get: function () { return address_js_1.recoverAddress; } }); -var transaction_js_1 = require("./transaction.js"); -Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return transaction_js_1.Transaction; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var accesslist = require('./accesslist.js'); +var address = require('./address.js'); +var transaction = require('./transaction.js'); + + + +exports.accessListify = accesslist.accessListify; +exports.computeAddress = address.computeAddress; +exports.recoverAddress = address.recoverAddress; +exports.Transaction = transaction.Transaction; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/transaction/index.js.map b/lib.commonjs/transaction/index.js.map index cc167e391..7d4da4a80 100644 --- a/lib.commonjs/transaction/index.js.map +++ b/lib.commonjs/transaction/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,IAAI,CAAC;AAoBL,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,2CAA8D;AAArD,4GAAA,cAAc,OAAA;AAAE,4GAAA,cAAc,OAAA;AACvC,mDAA+C;AAAtC,6GAAA,WAAW,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/transaction/transaction.d.ts.map b/lib.commonjs/transaction/transaction.d.ts.map index f298b00da..e3c637686 100644 --- a/lib.commonjs/transaction/transaction.d.ts.map +++ b/lib.commonjs/transaction/transaction.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,eAAe,CAAC,CAAC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B;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IACD,IAAI,KAAK,CAAC,KAAK,EAAE,YAAY,EAE5B;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,EAEhC;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,IAAI,GAAG,MAAM,CAE7B;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,IAAI,GAAG,aAAa,EAExC;IAED;;OAEG;;IAYH;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,CAKxB;IAED;;;;;OAKG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,CAMxB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,IAAI,GAAG,MAAM,CAKjC;IAED;;;;;OAKG;IACH,QAAQ,IAAI,IAAI,IAAI,WAAW,GAAG;QAChC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,SAAS,CAAC;KACtB;IAKD;;;;;OAKG;IACH,IAAI,UAAU,IAAI,MAAM,CAQvB;IAED;;;;;OAKG;IACH,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,KAAK,IAAI,WAAW;IAIpB;;OAEG;IACH,MAAM,IAAI,GAAG;IAoBb;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW;CA6DhE"} \ No newline at end of file +{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM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ction/transaction.js index 4b959a0f4..45347c2d4 100644 --- a/lib.commonjs/transaction/transaction.js +++ b/lib.commonjs/transaction/transaction.js @@ -1,34 +1,51 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Transaction = void 0; -const tslib_1 = require("tslib"); -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../utils/index.js"); -const address_js_1 = require("./address.js"); -const properties_js_1 = require("../utils/properties.js"); -const data_js_1 = require("../utils/data.js"); -const logger_js_1 = require("../logger/logger.js"); -const RLP = tslib_1.__importStar(require("../crypto/rlp.js")); -const bigNumber_js_1 = require("../bigNumber/bigNumber.js"); -const index_js_4 = require("../address/index.js"); -const logger = new logger_js_1.Logger("transaction/0.0.1"); +'use strict'; + +var index = require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +var sha3 = require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +var signingKey = require('../crypto/signing-key.js'); +require('../crypto/signature.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +var address = require('./address.js'); +var logger$1 = require('../logger/logger.js'); +var rlp = require('../crypto/rlp.js'); +var bigNumber = require('../bigNumber/bigNumber.js'); + +const logger = new logger$1.Logger("transaction/0.0.1"); const BN_0 = BigInt(0); function handleAddress(value) { if (value === "0x") { return null; } - return (0, index_js_1.getAddress)(value); + return index.getAddress(value); } function parse(data) { const handleNumber = (value) => { // @ts-ignore if (value === "0x") { - return bigNumber_js_1.BigNumber.from(0); + return bigNumber.BigNumber.from(0); } - return bigNumber_js_1.BigNumber.from(value); + return bigNumber.BigNumber.from(value); }; - const transaction = RLP.decode(data); + const transaction = rlp.decode(data); if (transaction.length !== 7 && transaction.length !== 8) { logger.throwArgumentError("invalid raw transaction", "data", data); } @@ -43,10 +60,10 @@ function parse(data) { data: transaction[isSigned ? 6 : 5], }; if (transaction.length === 8) { - const prefix = (0, index_js_4.networkIdToPrefix)(Number(tx.networkId)); - const digest = (0, index_js_2.sha256)(serialize(tx)); - tx.hash = (0, index_js_2.sha256)(serialize(tx, transaction[7])); - tx.from = (0, address_js_1.recoverAddress)(digest, transaction[7], prefix); + const prefix = index.networkIdToPrefix(Number(tx.networkId)); + const digest = sha3.sha256(serialize(tx)); + tx.hash = sha3.sha256(serialize(tx, transaction[7])); + tx.from = address.recoverAddress(digest, transaction[7], prefix); tx.signature = transaction[7]; } return tx; @@ -79,7 +96,7 @@ const allowedTransactionKeys = { value: true, }; function serialize(transaction, signature) { - (0, properties_js_1.checkProperties)(transaction, allowedTransactionKeys); + properties.checkProperties(transaction, allowedTransactionKeys); const raw = []; (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) { let value = transaction[name] || []; @@ -87,26 +104,26 @@ function serialize(transaction, signature) { if (numeric) { options.hexPad = "left"; } - const tmpHexlified = (0, index_js_3.hexlify)(value, options); - value = (0, data_js_1.arrayify)(tmpHexlified); + const tmpHexlified = data.hexlify(value, options); + value = data.arrayify(tmpHexlified); // Fixed-width field if (length && value.length !== length && value.length > 0) { logger.throwArgumentError("invalid length for " + name, "transaction:" + name, value); } // Variable-width (with a maximum) if (maxLength) { - value = (0, data_js_1.stripZeros)(value); + value = data.stripZeros(value); if (value.length > maxLength) { logger.throwArgumentError("invalid length for " + name, "transaction:" + name, value); } } - const hexlified = (0, index_js_3.hexlify)(value); + const hexlified = data.hexlify(value); raw.push(hexlified); }); if (!!signature) { - raw.push((0, index_js_3.hexlify)(signature)); + raw.push(data.hexlify(signature)); } - const finalValue = RLP.encode(raw); + const finalValue = rlp.encode(raw); return finalValue; } /** @@ -139,7 +156,7 @@ class Transaction { return this.#to; } set to(value) { - this.#to = value == null ? null : (0, index_js_1.getAddress)(value); + this.#to = value == null ? null : index.getAddress(value); } /** * The transaction nonce. @@ -148,7 +165,7 @@ class Transaction { return this.#nonce; } set nonce(value) { - this.#nonce = (0, index_js_3.getNumber)(value, "value"); + this.#nonce = maths.getNumber(value, "value"); } /** * The energy limit. @@ -157,7 +174,7 @@ class Transaction { return this.#energyLimit; } set energyLimit(value) { - this.#energyLimit = (0, index_js_3.getBigInt)(value); + this.#energyLimit = maths.getBigInt(value); } /** * The energy price. @@ -173,7 +190,7 @@ class Transaction { return value; } set energyPrice(value) { - this.#energyPrice = value == null ? null : (0, index_js_3.getBigInt)(value, "energyPrice"); + this.#energyPrice = value == null ? null : maths.getBigInt(value, "energyPrice"); } /** * The transaction data. For ``init`` transactions this is the @@ -183,7 +200,7 @@ class Transaction { return this.#data; } set data(value) { - this.#data = (0, index_js_3.hexlify)(value); + this.#data = data.hexlify(value); } /** * The amount of xcb (in ore) to send in this transactions. @@ -192,7 +209,7 @@ class Transaction { return this.#value; } set value(value) { - this.#value = (0, index_js_3.getBigInt)(value, "value"); + this.#value = maths.getBigInt(value, "value"); } /** * The chain ID this transaction is valid on. @@ -201,7 +218,7 @@ class Transaction { return this.#networkId; } set networkId(value) { - this.#networkId = (0, index_js_3.getBigInt)(value); + this.#networkId = maths.getBigInt(value); } /** * If signed, the signature for this transaction. @@ -232,7 +249,7 @@ class Transaction { if (this.signature == null) { return null; } - return (0, index_js_2.sha256)(this.serialized); + return sha3.sha256(this.serialized); } /** * The pre-image hash of this transaction. @@ -241,7 +258,7 @@ class Transaction { * this transaction. */ get unsignedHash() { - return (0, index_js_2.sha256)(this.unsignedSerialized); + return sha3.sha256(this.unsignedSerialized); } /** * The sending address, if signed. Otherwise, ``null``. @@ -250,8 +267,8 @@ class Transaction { if (this.signature == null) { return null; } - const prefix = (0, index_js_4.networkIdToPrefix)(Number(this.#networkId)); - return (0, address_js_1.recoverAddress)(this.unsignedHash, this.signature, prefix); + const prefix = index.networkIdToPrefix(Number(this.#networkId)); + return address.recoverAddress(this.unsignedHash, this.signature, prefix); } /** * The public key of the sender, if signed. Otherwise, ``null``. @@ -260,7 +277,7 @@ class Transaction { if (this.signature == null) { return null; } - return index_js_2.SigningKey.recoverPublicKey(this.unsignedHash, this.signature); + return signingKey.SigningKey.recoverPublicKey(this.unsignedHash, this.signature); } /** * Returns true if signed. @@ -279,7 +296,7 @@ class Transaction { * use [[unsignedSerialized]]. */ get serialized() { - (0, index_js_3.assert)(this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); + errors.assert(this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); return serialize(this, this.signature); } /** @@ -327,7 +344,7 @@ class Transaction { return new Transaction(); } if (typeof tx === "string") { - const payload = (0, index_js_3.getBytes)(tx); + const payload = data.getBytes(tx); return Transaction.from(parse(payload)); } const result = new Transaction(); @@ -356,15 +373,16 @@ class Transaction { result.signature = tx.signature; } if (tx.hash != null) { - (0, index_js_3.assertArgument)(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); - (0, index_js_3.assertArgument)(result.hash === tx.hash, "hash mismatch", "tx", tx); + errors.assertArgument(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); + errors.assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); } if (tx.from != null) { - (0, index_js_3.assertArgument)(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); - (0, index_js_3.assertArgument)(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); + errors.assertArgument(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); + errors.assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); } return result; } } + exports.Transaction = Transaction; -//# sourceMappingURL=transaction.js.map \ No newline at end of file +//# sourceMappingURL=transaction.js.map diff --git a/lib.commonjs/transaction/transaction.js.map b/lib.commonjs/transaction/transaction.js.map index 675e20705..34d58270c 100644 --- a/lib.commonjs/transaction/transaction.js.map +++ b/lib.commonjs/transaction/transaction.js.map @@ -1 +1 @@ -{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":";;;;AAAA,kDAAiD;AACjD,iDAAmE;AACnE,gDAO2B;AAE3B,6CAA8C;AAI9C,0DAAyD;AACzD,8CAAqE;AACrE,mDAA6C;AAC7C,8DAAwC;AACxC,4DAAsD;AACtD,kDAAwD;AAExD,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,mBAAmB,CAAC,CAAC;AAE/C,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAqDvB,SAAS,aAAa,CAAC,KAAa;IAClC,IAAI,KAAK,KAAK,IAAI,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,IAAA,qBAAU,EAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,KAAK,CAAC,IAAe;IAC5B,MAAM,YAAY,GAAG,CAAC,KAAa,EAAa,EAAE;QAChD,aAAa;QACb,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,OAAO,wBAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC1B;QACD,OAAO,wBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAErC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QACxD,MAAM,CAAC,kBAAkB,CAAC,yBAAyB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;KACpE;IAED,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,KAAK,C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,KAAK,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;SACpE;QAED,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,EAAE;YACnB,IAAA,yBAAc,EACZ,MAAM,CAAC,QAAQ,EAAE,EACjB,yCAAyC,EACzC,IAAI,EACJ,EAAE,CACH,CAAC;YACF,IAAA,yBAAc,EACZ,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAC3D,eAAe,EACf,IAAI,EACJ,EAAE,CACH,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAnSD,kCAmSC"} \ No newline at end of file +{"version":3,"file":"transaction.js","sources":["../../lib.esm/transaction/transaction.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { recoverAddress } from \"./address.js\";\nimport { checkProperties } from \"../utils/properties.js\";\nimport { arrayify, stripZeros } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport * as RLP from \"../crypto/rlp.js\";\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst logger = new Logger(\"transaction/0.0.1\");\nconst BN_0 = BigInt(0);\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction parse(data) {\n const handleNumber = (value) => {\n // @ts-ignore\n if (value === \"0x\") {\n return BigNumber.from(0);\n }\n return BigNumber.from(value);\n };\n const transaction = RLP.decode(data);\n if (transaction.length !== 7 && transaction.length !== 8) {\n logger.throwArgumentError(\"invalid raw transaction\", \"data\", data);\n }\n const isSigned = transaction.length === 8;\n const tx = {\n nonce: Number(handleNumber(transaction[0])),\n energyPrice: handleNumber(transaction[1]).toBigInt(),\n energyLimit: handleNumber(transaction[2]).toBigInt(),\n networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(),\n to: handleAddress(transaction[isSigned ? 4 : 3]),\n value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(),\n data: transaction[isSigned ? 6 : 5],\n };\n if (transaction.length === 8) {\n const prefix = networkIdToPrefix(Number(tx.networkId));\n const digest = sha256(serialize(tx));\n tx.hash = sha256(serialize(tx, transaction[7]));\n tx.from = recoverAddress(digest, transaction[7], prefix);\n tx.signature = transaction[7];\n }\n return tx;\n}\nconst unsignedTransactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n { name: \"networkId\", maxLength: 32, numeric: true },\n];\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"networkId\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n networkId: true,\n data: true,\n energyLimit: true,\n energyPrice: true,\n nonce: true,\n to: true,\n value: true,\n};\nfunction serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) {\n let value = transaction[name] || [];\n const options = {};\n if (numeric) {\n options.hexPad = \"left\";\n }\n const tmpHexlified = hexlify(value, options);\n value = arrayify(tmpHexlified);\n // Fixed-width field\n if (length && value.length !== length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n // Variable-width (with a maximum)\n if (maxLength) {\n value = stripZeros(value);\n if (value.length > maxLength) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n }\n const hexlified = hexlify(value);\n raw.push(hexlified);\n });\n if (!!signature) {\n raw.push(hexlify(signature));\n }\n const finalValue = RLP.encode(raw);\n return finalValue;\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Core by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in corebc) 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 #to;\n #data;\n #nonce;\n #energyLimit;\n #energyPrice;\n #value;\n #networkId;\n #sig;\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n return this.#to;\n }\n set to(value) {\n this.#to = value == null ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() {\n return this.#nonce;\n }\n set nonce(value) {\n this.#nonce = getNumber(value, \"value\");\n }\n /**\n * The energy limit.\n */\n get energyLimit() {\n return this.#energyLimit;\n }\n set energyLimit(value) {\n this.#energyLimit = getBigInt(value);\n }\n /**\n * The energy 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 energyPrice() {\n const value = this.#energyPrice;\n if (value == null) {\n return BN_0;\n }\n return value;\n }\n set energyPrice(value) {\n this.#energyPrice = value == null ? null : getBigInt(value, \"energyPrice\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() {\n return this.#data;\n }\n set data(value) {\n this.#data = hexlify(value);\n }\n /**\n * The amount of xcb (in ore) to send in this transactions.\n */\n get value() {\n return this.#value;\n }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value);\n }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() {\n return this.#sig || null;\n }\n set signature(value) {\n this.#sig = value == null ? null : value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#to = null;\n this.#nonce = 0;\n this.#energyLimit = BigInt(0);\n this.#energyPrice = null;\n this.#data = \"0x\";\n this.#value = BigInt(0);\n this.#networkId = BigInt(0);\n this.#sig = 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 sha256(this.serialized);\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 sha256(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 const prefix = networkIdToPrefix(Number(this.#networkId));\n return recoverAddress(this.unsignedHash, this.signature, prefix);\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);\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 //isSigned(): this is SignedTransaction {\n return this.signature != null;\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 assert(this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n return serialize(this, this.signature);\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 serialize(this);\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 to: this.to,\n data: this.data,\n nonce: this.nonce,\n energyLimit: s(this.energyLimit),\n energyPrice: s(this.energyPrice),\n value: s(this.value),\n networkId: s(this.networkId),\n sig: this.signature ? this.signature : null,\n };\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 return Transaction.from(parse(payload));\n }\n const result = new Transaction();\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.energyLimit != null) {\n result.energyLimit = tx.energyLimit;\n }\n if (tx.energyPrice != null) {\n result.energyPrice = tx.energyPrice;\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.networkId != null) {\n result.networkId = tx.networkId;\n }\n if (tx.signature != null) {\n result.signature = tx.signature;\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"],"names":["Logger","getAddress","BigNumber","RLP.decode","networkIdToPrefix","sha256","recoverAddress","checkProperties","hexlify","arrayify","stripZeros","RLP.encode","getNumber","getBigInt","SigningKey","assert","getBytes","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,mBAAmB,CAAC;AAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE;AACxB,QAAQ,OAAO,IAAI;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,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,yCAAyC,EAAE,IAAI,EAAE,EAAE,CAAC;AAClG,YAAYA,qBAAc,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC;AAC9E,QAAQ;AACR,QAAQ,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,EAAE;AAC7B,YAAYA,qBAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,yCAAyC,EAAE,IAAI,EAAE,EAAE,CAAC;AAClG,YAAYA,qBAAc,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,EAAE,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC;AAClH,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/base58.js b/lib.commonjs/utils/base58.js index 16f4c2404..c284b7f66 100644 --- a/lib.commonjs/utils/base58.js +++ b/lib.commonjs/utils/base58.js @@ -1,4 +1,9 @@ -"use strict"; +'use strict'; + +var data = require('./data.js'); +var errors = require('./errors.js'); +var maths = require('./maths.js'); + /** * The [Base58 Encoding](link-base58) scheme allows a **numeric** value * to be encoded as a compact string using a radix of 58 using only @@ -12,11 +17,6 @@ * * @_subsection: api/utils:Base58 Encoding [about-base58] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeBase58 = exports.encodeBase58 = void 0; -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -const maths_js_1 = require("./maths.js"); const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; let Lookup = null; function getAlpha(letter) { @@ -27,7 +27,7 @@ function getAlpha(letter) { } } const result = Lookup[letter]; - (0, errors_js_1.assertArgument)(result != null, `invalid base58 value`, "letter", letter); + errors.assertArgument(result != null, `invalid base58 value`, "letter", letter); return result; } const BN_0 = BigInt(0); @@ -36,7 +36,7 @@ const BN_58 = BigInt(58); * Encode %%value%% as a Base58-encoded string. */ function encodeBase58(_value) { - let value = (0, maths_js_1.toBigInt)((0, data_js_1.getBytes)(_value)); + let value = maths.toBigInt(data.getBytes(_value)); let result = ""; while (value) { result = Alphabet[Number(value % BN_58)] + result; @@ -44,7 +44,6 @@ function encodeBase58(_value) { } return result; } -exports.encodeBase58 = encodeBase58; /** * Decode the Base58-encoded %%value%%. */ @@ -56,5 +55,7 @@ function decodeBase58(value) { } return result; } + exports.decodeBase58 = decodeBase58; -//# sourceMappingURL=base58.js.map \ No newline at end of file +exports.encodeBase58 = encodeBase58; +//# sourceMappingURL=base58.js.map diff --git a/lib.commonjs/utils/base58.js.map b/lib.commonjs/utils/base58.js.map index db61f2d9e..197acb146 100644 --- a/lib.commonjs/utils/base58.js.map +++ b/lib.commonjs/utils/base58.js.map @@ -1 +1 @@ -{"version":3,"file":"base58.js","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,uCAAqC;AACrC,2CAA6C;AAC7C,yCAAsC;AAItC,MAAM,QAAQ,GAAG,4DAA4D,CAAC;AAC9E,IAAI,MAAM,GAAkC,IAAI,CAAC;AAEjD,SAAS,QAAQ,CAAC,MAAc;IAC9B,IAAI,MAAM,IAAI,IAAI,EAAE;QAClB,MAAM,GAAG,EAAE,CAAC;QACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;SACjC;KACF;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,IAAA,0BAAc,EAAC,MAAM,IAAI,IAAI,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,SAAgB,YAAY,CAAC,MAAiB;IAC5C,IAAI,KAAK,GAAG,IAAA,mBAAQ,EAAC,IAAA,kBAAQ,EAAC,MAAM,CAAC,CAAC,CAAC;IACvC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,KAAK,EAAE;QACZ,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC;QAClD,KAAK,IAAI,KAAK,CAAC;KAChB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AARD,oCAQC;AAED;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAa;IACxC,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,MAAM,IAAI,KAAK,CAAC;QAChB,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC9B;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAPD,oCAOC"} \ No newline at end of file +{"version":3,"file":"base58.js","sources":["../../lib.esm/utils/base58.js"],"sourcesContent":["/**\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 let value = toBigInt(getBytes(_value));\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\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"],"names":["assertArgument","toBigInt","getBytes"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,MAAM,QAAQ,GAAG,4DAA4D;AAC7E,IAAI,MAAM,GAAG,IAAI;AACjB,SAAS,QAAQ,CAAC,MAAM,EAAE;AAC1B,IAAI,IAAI,MAAM,IAAI,IAAI,EAAE;AACxB,QAAQ,MAAM,GAAG,EAAE;AACnB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAClD,YAAY,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AAC3C,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACjC,IAAIA,qBAAc,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC5E,IAAI,OAAO,MAAM;AACjB;AACA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB;AACA;AACA;AACO,SAAS,YAAY,CAAC,MAAM,EAAE;AACrC,IAAI,IAAI,KAAK,GAAGC,cAAQ,CAACC,aAAQ,CAAC,MAAM,CAAC,CAAC;AAC1C,IAAI,IAAI,MAAM,GAAG,EAAE;AACnB,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,MAAM;AACzD,QAAQ,KAAK,IAAI,KAAK;AACtB,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,IAAI,MAAM,GAAG,IAAI;AACrB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC3C,QAAQ,MAAM,IAAI,KAAK;AACvB,QAAQ,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpC,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/base64-browser.js b/lib.commonjs/utils/base64-browser.js index ecab4a50a..233688182 100644 --- a/lib.commonjs/utils/base64-browser.js +++ b/lib.commonjs/utils/base64-browser.js @@ -1,24 +1,25 @@ -"use strict"; +'use strict'; + +var data = require('./data.js'); + // utils/base64-browser -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeBase64 = exports.decodeBase64 = void 0; -const data_js_1 = require("./data.js"); function decodeBase64(textData) { textData = atob(textData); - const data = new Uint8Array(textData.length); + const data$1 = new Uint8Array(textData.length); for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); + data$1[i] = textData.charCodeAt(i); } - return (0, data_js_1.getBytes)(data); + return data.getBytes(data$1); } -exports.decodeBase64 = decodeBase64; function encodeBase64(_data) { - const data = (0, data_js_1.getBytes)(_data); + const data$1 = data.getBytes(_data); let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); + for (let i = 0; i < data$1.length; i++) { + textData += String.fromCharCode(data$1[i]); } return btoa(textData); } + +exports.decodeBase64 = decodeBase64; exports.encodeBase64 = encodeBase64; -//# sourceMappingURL=base64-browser.js.map \ No newline at end of file +//# sourceMappingURL=base64-browser.js.map diff --git a/lib.commonjs/utils/base64-browser.js.map b/lib.commonjs/utils/base64-browser.js.map index 184743902..0268d48b0 100644 --- a/lib.commonjs/utils/base64-browser.js.map +++ b/lib.commonjs/utils/base64-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"base64-browser.js","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":";AAAA,uBAAuB;;;AAEvB,uCAAqC;AAIrC,SAAgB,YAAY,CAAC,QAAgB;IAC3C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KAClC;IACD,OAAO,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAPD,oCAOC;AAED,SAAgB,YAAY,CAAC,KAAgB;IAC3C,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,QAAQ,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1C;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC;AAPD,oCAOC"} \ No newline at end of file +{"version":3,"file":"base64-browser.js","sources":["../../lib.esm/utils/base64-browser.js"],"sourcesContent":["// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map"],"names":["data","getBytes"],"mappings":";;;;AAAA;AAEO,SAAS,YAAY,CAAC,QAAQ,EAAE;AACvC,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;AAC7B,IAAI,MAAMA,MAAI,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChD,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC9C,QAAQA,MAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;AACxC,IAAI;AACJ,IAAI,OAAOC,aAAQ,CAACD,MAAI,CAAC;AACzB;AACO,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,MAAMA,MAAI,GAAGC,aAAQ,CAAC,KAAK,CAAC;AAChC,IAAI,IAAI,QAAQ,GAAG,EAAE;AACrB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAGD,MAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1C,QAAQ,QAAQ,IAAI,MAAM,CAAC,YAAY,CAACA,MAAI,CAAC,CAAC,CAAC,CAAC;AAChD,IAAI;AACJ,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC;AACzB;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/base64.js b/lib.commonjs/utils/base64.js index 73d372770..c3d3c8b92 100644 --- a/lib.commonjs/utils/base64.js +++ b/lib.commonjs/utils/base64.js @@ -1,6 +1,7 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeBase64 = exports.decodeBase64 = void 0; +'use strict'; + +var data = require('./data.js'); + /** * [Base64 encoding](link-wiki-base64) using 6-bit words to encode * arbitrary bytes into a string using 65 printable symbols, the @@ -9,7 +10,6 @@ exports.encodeBase64 = exports.decodeBase64 = void 0; * * @_subsection: api/utils:Base64 Encoding [about-base64] */ -const data_js_1 = require("./data.js"); /** * Decodes the base-64 encoded %%value%%. * @@ -27,9 +27,8 @@ const data_js_1 = require("./data.js"); * //_result: */ function decodeBase64(value) { - return (0, data_js_1.getBytesCopy)(Buffer.from(value, "base64")); + return data.getBytesCopy(Buffer.from(value, "base64")); } -exports.decodeBase64 = decodeBase64; /** * Encodes %%data%% as a base-64 encoded string. * @@ -50,8 +49,10 @@ exports.decodeBase64 = decodeBase64; * encodeBase64(toUtf8Bytes("Hello World!!")) * //_result: */ -function encodeBase64(data) { - return Buffer.from((0, data_js_1.getBytes)(data)).toString("base64"); +function encodeBase64(data$1) { + return Buffer.from(data.getBytes(data$1)).toString("base64"); } + +exports.decodeBase64 = decodeBase64; exports.encodeBase64 = encodeBase64; -//# sourceMappingURL=base64.js.map \ No newline at end of file +//# sourceMappingURL=base64.js.map diff --git a/lib.commonjs/utils/base64.js.map b/lib.commonjs/utils/base64.js.map index f42d22710..d530da897 100644 --- a/lib.commonjs/utils/base64.js.map +++ b/lib.commonjs/utils/base64.js.map @@ -1 +1 @@ -{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCAAmD;AAInD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,YAAY,CAAC,KAAa;IACxC,OAAO,IAAA,sBAAY,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpD,CAAC;AAFD,oCAEC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,YAAY,CAAC,IAAe;IAC1C,OAAO,MAAM,CAAC,IAAI,CAAC,IAAA,kBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACxD,CAAC;AAFD,oCAEC"} \ No newline at end of file +{"version":3,"file":"base64.js","sources":["../../lib.esm/utils/base64.js"],"sourcesContent":["/**\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 * 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"],"names":["getBytesCopy","data","getBytes"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,OAAOA,iBAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAACC,MAAI,EAAE;AACnC,IAAI,OAAO,MAAM,CAAC,IAAI,CAACC,aAAQ,CAACD,MAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACzD;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/data.d.ts.map b/lib.commonjs/utils/data.d.ts.map index b82bf731e..3b65817ca 100644 --- a/lib.commonjs/utils/data.d.ts.map +++ b/lib.commonjs/utils/data.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM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AAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAmBvD;AAED,wBAAgB,QAAQ,CACvB,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,EACnC,OAAO,CAAC,EAAE,WAAW,GACnB,UAAU,CAuDZ;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAMjE"} \ No newline at end of file diff --git a/lib.commonjs/utils/data.js b/lib.commonjs/utils/data.js index 4d0fb3a5d..525dd8821 100644 --- a/lib.commonjs/utils/data.js +++ b/lib.commonjs/utils/data.js @@ -1,15 +1,15 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hexConcat = exports.arrayify = exports.stripZeros = exports.zeroPadBytes = exports.zeroPadValue = exports.stripZerosLeft = exports.dataSlice = exports.dataLength = exports.hexDataLength = exports.hexDataSlice = exports.concat = exports.hexlify = exports.isBytesLike = exports.isHexString = exports.getBytesCopy = exports.getBytes = exports.isBytes = void 0; +'use strict'; + +var logger$1 = require('../logger/logger.js'); +var errors = require('./errors.js'); + /** * Some data helpers. * * * @_subsection api/utils:Data Helpers [about-data] */ -const logger_js_1 = require("../logger/logger.js"); -const errors_js_1 = require("./errors.js"); -const logger = new logger_js_1.Logger("utils/data/0.0.1"); +const logger = new logger$1.Logger("utils/data/0.0.1"); function isHexable(value) { return !!value.toHexString; } @@ -37,7 +37,6 @@ function isBytes(value) { } return true; } -exports.isBytes = isBytes; function _getBytes(value, name, copy) { if (value instanceof Uint8Array) { if (copy) { @@ -54,7 +53,7 @@ function _getBytes(value, name, copy) { } return result; } - (0, errors_js_1.assertArgument)(false, "invalid BytesLike value", name || "value", value); + errors.assertArgument(false, "invalid BytesLike value", name || "value", value); } /** * Get a typed Uint8Array for %%value%%. If already a Uint8Array @@ -66,7 +65,6 @@ function _getBytes(value, name, copy) { function getBytes(value, name) { return _getBytes(value, name, false); } -exports.getBytes = getBytes; /** * Get a typed Uint8Array for %%value%%, creating a copy if necessary * to prevent any modifications of the returned value from being @@ -77,7 +75,6 @@ exports.getBytes = getBytes; function getBytesCopy(value, name) { return _getBytes(value, name, true); } -exports.getBytesCopy = getBytesCopy; /** * Returns true if %%value%% is a valid [[HexString]]. * @@ -97,7 +94,6 @@ function isHexString(value, length) { } return true; } -exports.isHexString = isHexString; /** * Returns true if %%value%% is a valid representation of arbitrary * data (i.e. a valid [[DataHexString]] or a Uint8Array). @@ -105,7 +101,6 @@ exports.isHexString = isHexString; function isBytesLike(value) { return isHexString(value, true) || value instanceof Uint8Array; } -exports.isBytesLike = isBytesLike; const HexCharacters = "0123456789abcdef"; /** * Returns a [[DataHexString]] representation of %%data%%. @@ -178,7 +173,6 @@ function hexlify(value, options) { } return logger.throwArgumentError("invalid hexlify value", "value", value); } -exports.hexlify = hexlify; /** * Returns a [[DataHexString]] by concatenating all values * within %%data%%. @@ -186,7 +180,6 @@ exports.hexlify = hexlify; function concat(items) { return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); } -exports.concat = concat; function hexDataSlice(data, offset, endOffset) { if (typeof data !== "string") { data = hexlify(data); @@ -200,7 +193,6 @@ function hexDataSlice(data, offset, endOffset) { } return "0x" + data.substring(offset); } -exports.hexDataSlice = hexDataSlice; function hexDataLength(data) { if (typeof data !== "string") { data = hexlify(data); @@ -210,7 +202,6 @@ function hexDataLength(data) { } return (data.length - 2) / 2; } -exports.hexDataLength = hexDataLength; /** * Returns the length of %%data%%, in bytes. */ @@ -220,7 +211,6 @@ function dataLength(data) { } return getBytes(data).length; } -exports.dataLength = dataLength; /** * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% * offset to the %%end%% offset. @@ -230,7 +220,7 @@ exports.dataLength = dataLength; function dataSlice(data, start, end) { const bytes = getBytes(data); if (end != null && end > bytes.length) { - (0, errors_js_1.assert)(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { + errors.assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { buffer: bytes, length: bytes.length, offset: end, @@ -238,7 +228,6 @@ function dataSlice(data, start, end) { } return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); } -exports.dataSlice = dataSlice; /** * Return the [[DataHexString]] result by stripping all **leading** ** zero bytes from %%data%%. @@ -250,10 +239,9 @@ function stripZerosLeft(data) { } return "0x" + bytes; } -exports.stripZerosLeft = stripZerosLeft; function zeroPad(data, length, left) { const bytes = getBytes(data); - (0, errors_js_1.assert)(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { + errors.assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { buffer: new Uint8Array(bytes), length: length, offset: length + 1, @@ -281,7 +269,6 @@ function zeroPad(data, length, left) { function zeroPadValue(data, length) { return zeroPad(data, length, true); } -exports.zeroPadValue = zeroPadValue; /** * Return the [[DataHexString]] of %%data%% padded on the **right** * to %%length%% bytes. @@ -295,7 +282,6 @@ exports.zeroPadValue = zeroPadValue; function zeroPadBytes(data, length) { return zeroPad(data, length, false); } -exports.zeroPadBytes = zeroPadBytes; function stripZeros(value) { let result = arrayify(value); if (result.length === 0) { @@ -312,7 +298,6 @@ function stripZeros(value) { } return result; } -exports.stripZeros = stripZeros; function arrayify(value, options) { if (!options) { options = {}; @@ -328,7 +313,7 @@ function arrayify(value, options) { if (result.length === 0) { result.push(0); } - return addSlice(new Uint8Array(result)); + return new Uint8Array(result); } if (options.allowMissingPrefix && typeof value === "string" && @@ -356,25 +341,13 @@ function arrayify(value, options) { // @ts-ignore result.push(parseInt(hex.substring(i, i + 2), 16)); } - return addSlice(new Uint8Array(result)); + return new Uint8Array(result); } if (isBytes(value)) { - return addSlice(new Uint8Array(value)); + return new Uint8Array(value); } return logger.throwArgumentError("invalid arrayify value", "value", value); } -exports.arrayify = arrayify; -function addSlice(array) { - // @ts-ignore - if (array.slice) { - return array; - } - array.slice = function () { - const args = Array.prototype.slice.call(arguments); - return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args))); - }; - return array; -} function hexConcat(items) { let result = "0x"; items.forEach((item) => { @@ -382,5 +355,22 @@ function hexConcat(items) { }); return result; } + +exports.arrayify = arrayify; +exports.concat = concat; +exports.dataLength = dataLength; +exports.dataSlice = dataSlice; +exports.getBytes = getBytes; +exports.getBytesCopy = getBytesCopy; exports.hexConcat = hexConcat; -//# sourceMappingURL=data.js.map \ No newline at end of file +exports.hexDataLength = hexDataLength; +exports.hexDataSlice = hexDataSlice; +exports.hexlify = hexlify; +exports.isBytes = isBytes; +exports.isBytesLike = isBytesLike; +exports.isHexString = isHexString; +exports.stripZeros = stripZeros; +exports.stripZerosLeft = stripZerosLeft; +exports.zeroPadBytes = zeroPadBytes; +exports.zeroPadValue = zeroPadValue; +//# sourceMappingURL=data.js.map diff --git a/lib.commonjs/utils/data.js.map b/lib.commonjs/utils/data.js.map index 9aa67c61f..03d881026 100644 --- a/lib.commonjs/utils/data.js.map +++ b/lib.commonjs/utils/data.js.map @@ -1 +1 @@ -{"version":3,"file":"data.js","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,mDAA6C;AAC7C,2CAAqD;AACrD,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,kBAAkB,CAAC,CAAC;AA8B9C,SAAS,SAAS,CAAC,KAAU;IAC3B,OAAO,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;AAC7B,CAAC;AACD,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC;AAED,SAAgB,OAAO,CAAC,KAAU;IAChC,IAAI,KA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AC5E,CAAC,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,SAAS,CAAC,KAA+B;IACvD,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAND,8BAMC"} \ No newline at end of file +{"version":3,"file":"data.js","sources":["../../lib.esm/utils/data.js"],"sourcesContent":["/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return new Uint8Array(result);\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return new Uint8Array(result);\n }\n if (isBytes(value)) {\n return new Uint8Array(value);\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map"],"names":["Logger","assertArgument","assert"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,kBAAkB,CAAC;AAC7C,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,OAAO,CAAC,CAAC,KAAK,CAAC,WAAW;AAC9B;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC;AACzE;AACO,SAAS,OAAO,CAAC,KAAK,EAAE;AAC/B,IAAI,IAAI,KAAK,IAAI,IAAI,EAAE;AACvB,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ,IAAI,IAAI,KAAK,CAAC,WAAW,KAAK,UAAU,EAAE;AAC1C,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACnC,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ,IAAI,IAAI,C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E;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,IAAI,MAAM,GAAG,IAAI;AACrB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK;AAC5B,QAAQ,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5C,IAAI,CAAC,CAAC;AACN,IAAI,OAAO,MAAM;AACjB;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/errors.d.ts.map b/lib.commonjs/utils/errors.d.ts.map index de9bc0ec5..b9eff4781 100644 --- a/lib.commonjs/utils/errors.d.ts.map +++ b/lib.commonjs/utils/errors.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAiDhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,SAAS,GAEjB,eAAe,GACf,iBAAiB,GACjB,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,SAAS,GACT,UAAU,GACV,WAAW,GAGX,gBAAgB,GAChB,eAAe,GAGf,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,GACrB,gBAAgB,GAGhB,gBAAgB,GAChB,oBAAoB,GACpB,eAAe,GACf,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,gBAAgB,GAGhB,iBAAiB,CAAC;AAEtB;;;GAGG;AACH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AAO,CAAC,KAAK,CAEf;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CA2BN;AA8BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,GAAG,EACf,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAoBN"} \ No newline at end of file +{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACX,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAiDhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,SAAS,GAElB,eAAe,GACf,iBAAiB,GACjB,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,SAAS,GACT,UAAU,GACV,WAAW,GAGX,gBAAgB,GAChB,eAAe,GAGf,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,GACrB,gBAAgB,GAGhB,gBAAgB,GAChB,oBAAoB,GACpB,eAAe,GACf,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,gBAAgB,GAGhB,iBAAiB,CAAC;AAErB;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,KAAK;IAC1E;;OAEG;IACH,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AE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CA2BN;AA8BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,UAAU,EAAE,GAAG,EACf,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,MAAM,GAChB,IAAI,CAoBN"} \ No newline at end of file diff --git a/lib.commonjs/utils/errors.js b/lib.commonjs/utils/errors.js index af2744803..4511ea4fd 100644 --- a/lib.commonjs/utils/errors.js +++ b/lib.commonjs/utils/errors.js @@ -1,13 +1,13 @@ -"use strict"; +'use strict'; + +var _version = require('../_version.js'); +var properties = require('./properties.js'); + /** * About Errors. * * @_section: api/utils/errors:Errors [about-errors] */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.assertPrivate = exports.assertNormalize = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.makeError = exports.isCallException = exports.isError = void 0; -const _version_js_1 = require("../_version.js"); -const properties_js_1 = require("./properties.js"); function stringify(value) { if (value == null) { return "null"; @@ -69,14 +69,12 @@ function stringify(value) { function isError(error, code) { return error && error.code === code; } -exports.isError = isError; /** * Returns true if %%error%% is a [[CallExceptionError]. */ function isCallException(error) { return isError(error, "CALL_EXCEPTION"); } -exports.isCallException = isCallException; /** * Returns a new Error configured to the format corebc emits errors, with * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties @@ -105,7 +103,7 @@ function makeError(message, code, info) { } } details.push(`code=${code}`); - details.push(`version=${_version_js_1.version}`); + details.push(`version=${_version.version}`); if (details.length) { message += " (" + details.join(", ") + ")"; } @@ -122,13 +120,12 @@ function makeError(message, code, info) { default: error = new Error(message); } - (0, properties_js_1.defineProperties)(error, { code }); + properties.defineProperties(error, { code }); if (info) { Object.assign(error, info); } return error; } -exports.makeError = makeError; /** * Throws an corebcError with %%message%%, %%code%% and additional error * %%info%% when %%check%% is falsish.. @@ -140,7 +137,6 @@ function assert(check, message, code, info) { throw makeError(message, code, info); } } -exports.assert = assert; /** * A simple helper to simply ensuring provided arguments match expected * constraints, throwing if not. @@ -151,7 +147,6 @@ exports.assert = assert; function assertArgument(check, message, name, value) { assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); } -exports.assertArgument = assertArgument; function assertArgumentCount(count, expectedCount, message) { if (message == null) { message = ""; @@ -168,7 +163,6 @@ function assertArgumentCount(count, expectedCount, message) { expectedCount: expectedCount, }); } -exports.assertArgumentCount = assertArgumentCount; const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { try { // General test for normalize @@ -200,7 +194,6 @@ function assertNormalize(form) { info: { form }, }); } -exports.assertNormalize = assertNormalize; /** * Many classes use file-scoped values to guard the constructor, * making it effectively private. This facilitates that pattern @@ -222,5 +215,13 @@ function assertPrivate(givenGuard, guard, className) { }); } } + +exports.assert = assert; +exports.assertArgument = assertArgument; +exports.assertArgumentCount = assertArgumentCount; +exports.assertNormalize = assertNormalize; exports.assertPrivate = assertPrivate; -//# sourceMappingURL=errors.js.map \ No newline at end of file +exports.isCallException = isCallException; +exports.isError = isError; +exports.makeError = makeError; +//# sourceMappingURL=errors.js.map diff --git a/lib.commonjs/utils/errors.js.map b/lib.commonjs/utils/errors.js.map index e3e20c719..8e7fb6035 100644 --- a/lib.commonjs/utils/errors.js.map +++ b/lib.commonjs/utils/errors.js.map @@ -1 +1 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gDAAyC;AAEzC,mDAAmD;AAYnD,SAAS,SAAS,CAAC,KAAU;IAC3B,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,MAAM,CAAC;KACf;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,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AE,IAAI,EAAE;KACf,CACF,CAAC;AACJ,CAAC;AAVD,0CAUC;AAED;;;;;GAKG;AACH,SAAgB,aAAa,CAC3B,UAAe,EACf,KAAU,EACV,SAAkB;IAElB,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,SAAS,GAAG,EAAE,CAAC;KAChB;IACD,IAAI,UAAU,KAAK,KAAK,EAAE;QACxB,IAAI,MAAM,GAAG,SAAS,EACpB,SAAS,GAAG,KAAK,CAAC;QACpB,IAAI,SAAS,EAAE;YACb,MAAM,IAAI,GAAG,CAAC;YACd,SAAS,IAAI,GAAG,GAAG,SAAS,CAAC;SAC9B;QACD,MAAM,CACJ,KAAK,EACL,4BAA4B,MAAM,eAAe,EACjD,uBAAuB,EACvB;YACE,SAAS;SACV,CACF,CAAC;KACH;AACH,CAAC;AAxBD,sCAwBC"} \ No newline at end of file +{"version":3,"file":"errors.js","sources":["../../lib.esm/utils/errors.js"],"sourcesContent":["/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${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E,CAAC,yBAAyB,EAAE,MAAM,CAAC,aAAa,CAAC,EAAE,uBAAuB,EAAE;AAClG,YAAY,SAAS;AACrB,SAAS,CAAC;AACV,IAAI;AACJ;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/events.d.ts.map b/lib.commonjs/utils/events.d.ts.map index 13c18f4ef..140670f11 100644 --- a/lib.commonjs/utils/events.d.ts.map +++ b/lib.commonjs/utils/events.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC;;;OAGG;IACH,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtD;;OAEG;IACH,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,kBAAkB,CA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AAO,CAAC,OAAO,CAAC,CAAC;IAEtD;;OAEG;IACH,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,qBAAa,YAAY,CAAC,CAAC;;IAC1B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,CAAC,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAIvC;;;OAGG;IACH,YACC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC5B,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,CAAC,EAIT;IAED;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/utils/events.js b/lib.commonjs/utils/events.js index 44e6a210c..fd70774f2 100644 --- a/lib.commonjs/utils/events.js +++ b/lib.commonjs/utils/events.js @@ -1,12 +1,12 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.EventPayload = void 0; +'use strict'; + +var properties = require('./properties.js'); + /** * Explain events... * * @_section api/utils/events:Events [about-events] */ -const properties_js_1 = require("./properties.js"); /** * When an [[EventEmitterable]] triggers a [[Listener]], the * callback always ahas one additional argument passed, which is @@ -28,7 +28,7 @@ class EventPayload { */ constructor(emitter, listener, filter) { this.#listener = listener; - (0, properties_js_1.defineProperties)(this, { emitter, filter }); + properties.defineProperties(this, { emitter, filter }); } /** * Unregister the triggered listener for future events. @@ -40,5 +40,6 @@ class EventPayload { await this.emitter.off(this.filter, this.#listener); } } + exports.EventPayload = EventPayload; -//# sourceMappingURL=events.js.map \ No newline at end of file +//# sourceMappingURL=events.js.map diff --git a/lib.commonjs/utils/events.js.map b/lib.commonjs/utils/events.js.map index 04dc60079..8a2cc35f0 100644 --- a/lib.commonjs/utils/events.js.map +++ b/lib.commonjs/utils/events.js.map @@ -1 +1 @@ -{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,mDAAmD;AA+DnD;;;;GAIG;AACH,MAAa,YAAY;IACvB;;OAEG;IACM,MAAM,CAAK;IAEpB;;OAEG;IACM,OAAO,CAAuB;IAE9B,SAAS,CAAkB;IAEpC;;;OAGG;IACH,YACE,OAA4B,EAC5B,QAAyB,EACzB,MAAS;QAET,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAA,gCAAgB,EAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAClB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAC1B,OAAO;SACR;QACD,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACF;AAnCD,oCAmCC"} \ No newline at end of file +{"version":3,"file":"events.js","sources":["../../lib.esm/utils/events.js"],"sourcesContent":["/**\n * Explain events...\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map"],"names":["defineProperties"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,CAAC;AAC1B;AACA;AACA;AACA,IAAI,MAAM;AACV;AACA;AACA;AACA,IAAI,OAAO;AACX,IAAI,SAAS;AACb;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC3C,QAAQ,IAAI,CAAC,SAAS,GAAG,QAAQ;AACjC,QAAQA,2BAAgB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACnD,IAAI;AACJ;AACA;AACA;AACA,IAAI,MAAM,cAAc,GAAG;AAC3B,QAAQ,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;AACpC,YAAY;AACZ,QAAQ;AACR,QAAQ,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC;AAC3D,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/fetch.d.ts.map b/lib.commonjs/utils/fetch.d.ts.map index 1319c39a1..59bbdc142 100644 --- a/lib.commonjs/utils/fetch.d.ts.map +++ b/lib.commonjs/utils/fetch.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,IAAI,GAAG,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,KAChB,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,iBAAiB,KACvB,OAAO,CAAC,YAAY,GAAG,aAAa,CAAC,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,KACvB,OAAO,CAAC,cAAc,CAAC,CAAC;AA+E7B;;GAEG;AACH,qBAAa,iBAAiB;;gBAIhB,OAAO,EAAE,YAAY;IAmBjC,W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,QAAQ,IAAI,GAAG,CAclB;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAgB1D;IAED,YACC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,CAAC,EAAE,YAAY,EAetB;IAED;;;;OAIG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,aAAa,CAiB9D;IAED;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAiB1D;IAED;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7B;IAED;;OAEG;IACH,OAAO,IAAI,IAAI,IAAI,aAAa,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAEtD;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,IAAI,GAAG,YAAY,CAEjC;IAED;;OAEG;IACH,EAAE,IAAI,OAAO,CAMZ;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAaf;CACD"} \ No newline at end of file diff --git a/lib.commonjs/utils/fetch.js b/lib.commonjs/utils/fetch.js index cf0b195da..dffad454b 100644 --- a/lib.commonjs/utils/fetch.js +++ b/lib.commonjs/utils/fetch.js @@ -1,21 +1,21 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FetchResponse = exports.FetchRequest = exports.FetchCancelSignal = void 0; +'use strict'; + +var base64 = require('./base64.js'); +var data = require('./data.js'); +var errors = require('./errors.js'); +var properties = require('./properties.js'); +var utf8 = require('./utf8.js'); +var geturl = require('./geturl.js'); + /** * Explain fetching here... * * @_section api/utils/fetching:Fetching Web Content [about-fetch] */ -const base64_js_1 = require("./base64.js"); -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -const properties_js_1 = require("./properties.js"); -const utf8_js_1 = require("./utf8.js"); -const geturl_js_1 = require("./geturl.js"); const MAX_ATTEMPTS = 12; const SLOT_INTERVAL = 250; // The global FetchGetUrlFunc implementation. -let getUrlFunc = geturl_js_1.getUrl; +let getUrlFunc = geturl.getUrl; const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); const reIpfs = new RegExp("^ipfs://(ipfs/)?(.*)$", "i"); // If locked, new Gateways cannot be added @@ -29,7 +29,7 @@ async function dataGatewayFunc(url, signal) { } return new FetchResponse(200, "OK", { "content-type": match[1] || "text/plain", - }, match[2] ? (0, base64_js_1.decodeBase64)(match[3]) : unpercent(match[3])); + }, match[2] ? base64.decodeBase64(match[3]) : unpercent(match[3])); } catch (error) { return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); @@ -82,7 +82,7 @@ class FetchCancelSignal { }); } addListener(listener) { - (0, errors_js_1.assert)(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { + errors.assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { operation: "fetchCancelSignal.addCancelListener", }); this.#listeners.push(listener); @@ -91,10 +91,9 @@ class FetchCancelSignal { return this.#cancelled; } checkSignal() { - (0, errors_js_1.assert)(!this.cancelled, "cancelled", "CANCELLED", {}); + errors.assert(!this.cancelled, "cancelled", "CANCELLED", {}); } } -exports.FetchCancelSignal = FetchCancelSignal; // Check the signal, throwing if it is cancelled function checkSignal(signal) { if (signal == null) { @@ -173,7 +172,7 @@ class FetchRequest { this.#bodyType = undefined; } else if (typeof body === "string") { - this.#body = (0, utf8_js_1.toUtf8Bytes)(body); + this.#body = utf8.toUtf8Bytes(body); this.#bodyType = "text/plain"; } else if (body instanceof Uint8Array) { @@ -181,7 +180,7 @@ class FetchRequest { this.#bodyType = "application/octet-stream"; } else if (typeof body === "object") { - this.#body = (0, utf8_js_1.toUtf8Bytes)(JSON.stringify(body)); + this.#body = utf8.toUtf8Bytes(JSON.stringify(body)); this.#bodyType = "application/json"; } else { @@ -226,7 +225,7 @@ class FetchRequest { get headers() { const headers = Object.assign({}, this.#headers); if (this.#creds) { - headers["authorization"] = `Basic ${(0, base64_js_1.encodeBase64)((0, utf8_js_1.toUtf8Bytes)(this.#creds))}`; + headers["authorization"] = `Basic ${base64.encodeBase64(utf8.toUtf8Bytes(this.#creds))}`; } if (this.allowGzip) { headers["accept-encoding"] = "gzip"; @@ -287,7 +286,7 @@ class FetchRequest { * Sets an ``Authorization`` for %%username%% with %%password%%. */ setCredentials(username, password) { - (0, errors_js_1.assertArgument)(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); + errors.assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); this.#creds = `${username}:${password}`; } /** @@ -318,7 +317,7 @@ class FetchRequest { return this.#timeout; } set timeout(timeout) { - (0, errors_js_1.assertArgument)(timeout >= 0, "timeout must be non-zero", "timeout", timeout); + errors.assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); this.#timeout = timeout; } /** @@ -378,7 +377,7 @@ class FetchRequest { }; } toString() { - return ``; + return ``; } /** * Update the throttle parameters used to determine maximum @@ -396,7 +395,7 @@ class FetchRequest { if (attempt >= this.#throttle.maxAttempts) { return _response.makeServerError("exceeded maximum retry limit"); } - (0, errors_js_1.assert)(getTime() <= expires, "timeout", "TIMEOUT", { + errors.assert(getTime() <= expires, "timeout", "TIMEOUT", { operation: "request.send", reason: "timeout", request: _request, @@ -493,7 +492,7 @@ class FetchRequest { * Resolves to the response by sending the request. */ send() { - (0, errors_js_1.assert)(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); + errors.assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); this.#signal = new FetchCancelSignal(this); return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); } @@ -502,7 +501,7 @@ class FetchRequest { * error to be rejected from the [[send]]. */ cancel() { - (0, errors_js_1.assert)(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); + errors.assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); const signal = fetchSignals.get(this); if (!signal) { throw new Error("missing signal; should not happen"); @@ -521,7 +520,7 @@ class FetchRequest { // - non-GET requests // - downgrading the security (e.g. https => http) // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - (0, errors_js_1.assert)(this.method === "GET" && + errors.assert(this.method === "GET" && (current !== "https" || target !== "http") && location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`, @@ -638,7 +637,6 @@ class FetchRequest { return getIpfsGatewayFunc(baseUrl); } } -exports.FetchRequest = FetchRequest; /** * The response for a FetchREquest. */ @@ -650,7 +648,7 @@ class FetchResponse { #request; #error; toString() { - return ``; + return ``; } /** * The response status code. @@ -684,10 +682,10 @@ class FetchResponse { */ get bodyText() { try { - return this.#body == null ? "" : (0, utf8_js_1.toUtf8String)(this.#body); + return this.#body == null ? "" : utf8.toUtf8String(this.#body); } catch (error) { - (0, errors_js_1.assert)(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { + errors.assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { operation: "bodyText", info: { response: this }, }); @@ -704,7 +702,7 @@ class FetchResponse { return JSON.parse(this.bodyText); } catch (error) { - (0, errors_js_1.assert)(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { + errors.assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { operation: "bodyJson", info: { response: this }, }); @@ -766,10 +764,10 @@ class FetchResponse { stall = -1; } else { - (0, errors_js_1.assertArgument)(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); + errors.assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); } const error = new Error(message || "throttling requests"); - (0, properties_js_1.defineProperties)(error, { stall, throttle: true }); + properties.defineProperties(error, { stall, throttle: true }); throw error; } /** @@ -809,23 +807,26 @@ class FetchResponse { if (message === "") { message = `server response ${this.statusCode} ${this.statusMessage}`; } - (0, errors_js_1.assert)(false, message, "SERVER_ERROR", { + errors.assert(false, message, "SERVER_ERROR", { request: this.request || "unknown request", response: this, error, }); } } -exports.FetchResponse = FetchResponse; function getTime() { return new Date().getTime(); } function unpercent(value) { - return (0, utf8_js_1.toUtf8Bytes)(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { + return utf8.toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { return String.fromCharCode(parseInt(code, 16)); })); } function wait(delay) { return new Promise((resolve) => setTimeout(resolve, delay)); } -//# sourceMappingURL=fetch.js.map \ No newline at end of file + +exports.FetchCancelSignal = FetchCancelSignal; +exports.FetchRequest = FetchRequest; +exports.FetchResponse = FetchResponse; +//# sourceMappingURL=fetch.js.map diff --git a/lib.commonjs/utils/fetch.js.map b/lib.commonjs/utils/fetch.js.map index 72a94f05e..6704ea6b4 100644 --- a/lib.commonjs/utils/fetch.js.map +++ b/lib.commonjs/utils/fetch.js.map @@ -1 +1 @@ -{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,2CAAyD;AACzD,uCAAoC;AACpC,2CAAqD;AACrD,mDAAmD;AACnD,uCAAsD;AAEtD,2CAAqC;AAsDrC,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,6CAA6C;AAC7C,IAAI,UAAU,GAAoB,kBAAM,CAAC;AAEzC,MAAM,MAAM,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Q;QACN,IAAI,IAAI,CAAC,EAAE,EAAE,EAAE;YACb,OAAO;SACR;QACD,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QACrC,IAAI,OAAO,KAAK,EAAE,EAAE;YAClB,OAAO,GAAG,mBAAmB,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;SACtE;QACD,IAAA,kBAAM,EAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE;YACrC,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,iBAAiB;YAC1C,QAAQ,EAAE,IAAI;YACd,KAAK;SACN,CAAC,CAAC;IACL,CAAC;CACF;AAhOD,sCAgOC;AAED,SAAS,OAAO;IACd,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,IAAA,qBAAW,EAChB,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACnD,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,KAAa;IACzB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAC9D,CAAC"} \ No newline at end of file +{"version":3,"file":"fetch.js","sources":["../../lib.esm/utils/fetch.js"],"sourcesContent":["/**\n * Explain fetching here...\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 { getUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet getUrlFunc = getUrl;\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(() => {\n listener();\n }, 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() {\n return this.#cancelled;\n }\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 /**\n * The fetch URI to requrest.\n */\n get url() {\n return this.#url;\n }\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``) and the .\n *\n * If %%body%% is a string, the intrincis ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrincis ``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 chnages 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 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]],\n 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 complere response.\n * //(default: 5 minutes)//\n */\n get timeout() {\n return this.#timeout;\n }\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 * 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 }\n toString() {\n return ``;\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\",\n reason: \"timeout\",\n 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\n .makeServerError(\"error in post-processing function\", error)\n .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 getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req\n .redirect(location)\n .#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 ||\n (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof retryAfter === \"string\" &&\n retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req\n .clone()\n .#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\n .makeServerError(\"error in post-processing function\", error)\n .assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req\n .clone()\n .#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 locataions\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" &&\n (current !== \"https\" || target !== \"http\") &&\n 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 = \"GET\";\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 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 getUrlFunc = getUrl;\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 * 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 ``;\n }\n /**\n * The response status code.\n */\n get statusCode() {\n return this.#statusCode;\n }\n /**\n * The response status message.\n */\n get statusMessage() {\n return this.#statusMessage;\n }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() {\n return Object.assign({}, this.#headers);\n }\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\",\n 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\",\n 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]],\n 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 of 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() {\n return this.#request;\n }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" &&\n this.statusCode >= 200 &&\n 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 assert(false, message, \"SERVER_ERROR\", {\n request: this.request || \"unknown request\",\n response: this,\n error,\n });\n }\n}\nfunction getTime() {\n return new Date().getTime();\n}\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"],"names":["getUrl","decodeBase64","assert","toUtf8Bytes","encodeBase64","assertArgument","hexlify","toUtf8String","defineProperties"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAOA,MAAM,YAAY,GAAG,EAAE;AACvB,MAAM,aAAa,GAAG,GAAG;AACzB;AACA,IAAI,UAAU,GAAGA,aAAM;AACvB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,iCAAiC,EAAE,GAAG,CAAC;AACjE,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,uBAAuB,EAAE,GAAG,CAAC;AACvD;AACA,IAAI,MAAM,GAAG,KAAK;AAClB;AACA,eAAe,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE;AAC5C,IAAI,IAAI;AACR,QAAQ,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC;AACvC,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,YAAY,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC;AAC3C,QAAQ;AACR,QAAQ,OAAO,IAAI,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE;AAC5C,YAAY,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,YAAY;AACpD,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,GAAGC,mBAAY,CAAC,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,EAAE,IAAI,KAAK;AAC7E,QAAQ,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACtD,IAAI,CAAC,CAAC,CAAC;AACP;AACA,SAAS,IAAI,CAAC,KAAK,EAAE;AACrB,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC/D;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/fixednumber.d.ts.map b/lib.commonjs/utils/fixednumber.d.ts.map index 2f8afd8ab..0acb110cb 100644 --- a/lib.commonjs/utils/fixednumber.d.ts.map +++ b/lib.commonjs/utils/fixednumber.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4C1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,MAAM,GACN;IACE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAoJN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,WAAW;;IACtB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAUzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAMzB;;OAEG;gBACS,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG;IAclD;;;OAGG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAA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C,KAAK,EAAE,WAAW,GAAG,OAAO,CAE/B;IAED;;;;;OAKG;IACH,KAAK,IAAI,WAAW,CAOnB;IAED;;;;;OAKG;IACH,OAAO,IAAI,WAAW,CAOrB;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAoBpC;IAED;;OAEG;IACH,MAAM,IAAI,OAAO,CAEhB;IAED;;OAEG;IACH,UAAU,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,QAAQ,IAAI,MAAM,CAEjB;IAED;;;;;;OAMG;IACH,aAAa,IAAI,MAAM,CAEtB;IAED;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAEzC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,CACf,MAAM,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,WAAW,GACnB,WAAW,CA4Bb;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAuCpE;IAED;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAWtE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/utils/fixednumber.js b/lib.commonjs/utils/fixednumber.js index 44be83fe6..e74e6dfd9 100644 --- a/lib.commonjs/utils/fixednumber.js +++ b/lib.commonjs/utils/fixednumber.js @@ -1,16 +1,11 @@ -"use strict"; +'use strict'; + +var data = require('./data.js'); +var errors = require('./errors.js'); +var maths = require('./maths.js'); +var properties = require('./properties.js'); + var _a; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FixedNumber = void 0; -/** - * About fixed-point math... - * - * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math] - */ -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -const maths_js_1 = require("./maths.js"); -const properties_js_1 = require("./properties.js"); const BN_N1 = BigInt(-1); const BN_0 = BigInt(0); const BN_1 = BigInt(1); @@ -33,26 +28,26 @@ function checkValue(val, format, safeOp) { const width = BigInt(format.width); if (format.signed) { const limit = BN_1 << (width - BN_1); - (0, errors_js_1.assert)(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { + errors.assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { operation: safeOp, fault: "overflow", value: val, }); if (val > BN_0) { - val = (0, maths_js_1.fromTwos)((0, maths_js_1.mask)(val, width), width); + val = maths.fromTwos(maths.mask(val, width), width); } else { - val = -(0, maths_js_1.fromTwos)((0, maths_js_1.mask)(-val, width), width); + val = -maths.fromTwos(maths.mask(-val, width), width); } } else { const limit = BN_1 << width; - (0, errors_js_1.assert)(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { + errors.assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { operation: safeOp, fault: "overflow", value: val, }); - val = ((val % limit) + limit) % limit & (limit - BN_1); + val = (((val % limit) + limit) % limit) & (limit - BN_1); } return val; } @@ -65,15 +60,13 @@ function getFormat(value) { let decimals = 18; if (typeof value === "string") { // Parse the format string - if (value === "fixed") { - // defaults... - } + if (value === "fixed") ; else if (value === "ufixed") { signed = false; } else { const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - (0, errors_js_1.assertArgument)(match, "invalid fixed format", "format", value); + errors.assertArgument(match, "invalid fixed format", "format", value); signed = match[1] !== "u"; width = parseInt(match[2]); decimals = parseInt(match[3]); @@ -86,15 +79,15 @@ function getFormat(value) { if (v[key] == null) { return defaultValue; } - (0, errors_js_1.assertArgument)(typeof v[key] === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); + errors.assertArgument(typeof v[key] === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); return v[key]; }; signed = check("signed", "boolean", signed); width = check("width", "number", width); decimals = check("decimals", "number", decimals); } - (0, errors_js_1.assertArgument)(width % 8 === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - (0, errors_js_1.assertArgument)(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); + errors.assertArgument(width % 8 === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); + errors.assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); return { signed, width, decimals, name }; } @@ -184,11 +177,11 @@ class FixedNumber { * @private */ constructor(guard, value, format) { - (0, errors_js_1.assertPrivate)(guard, _guard, "FixedNumber"); + errors.assertPrivate(guard, _guard, "FixedNumber"); this.#val = value; this.#format = format; const _value = toString(value, format.decimals); - (0, properties_js_1.defineProperties)(this, { format: format.name, _value }); + properties.defineProperties(this, { format: format.name, _value }); this.#tens = getTens(format.decimals); } /** @@ -218,31 +211,31 @@ class FixedNumber { return this.#val; } #checkFormat(other) { - (0, errors_js_1.assertArgument)(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); + errors.assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); } #checkValue(val, safeOp) { /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - + const width = BigInt(this.width); + if (this.signed) { + const limit = (BN_1 << (width - BN_1)); + assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { + operation: safeOp, fault: "overflow", value: val + }); + + if (val > BN_0) { + val = fromTwos(mask(val, width), width); } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; + val = -fromTwos(mask(-val, width), width); } - */ + + } else { + const masked = mask(val, width); + assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { + operation: safeOp, fault: "overflow", value: val + }); + val = masked; + } +*/ val = checkValue(val, this.#format, safeOp); return new _a(_guard, val, this.#format); } @@ -311,7 +304,7 @@ class FixedNumber { mulSignal(other) { this.#checkFormat(other); const value = this.#val * other.#val; - (0, errors_js_1.assert)(value % this.#tens === BN_0, "precision lost during signalling mul", "NUMERIC_FAULT", { + errors.assert(value % this.#tens === BN_0, "precision lost during signalling mul", "NUMERIC_FAULT", { operation: "mulSignal", fault: "underflow", value: this, @@ -319,7 +312,7 @@ class FixedNumber { return this.#checkValue(value / this.#tens, "mulSignal"); } #div(o, safeOp) { - (0, errors_js_1.assert)(o.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { + errors.assert(o.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { operation: "div", fault: "divide-by-zero", value: this, @@ -349,14 +342,14 @@ class FixedNumber { * (precision loss) occurs. */ divSignal(other) { - (0, errors_js_1.assert)(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { + errors.assert(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { operation: "div", fault: "divide-by-zero", value: this, }); this.#checkFormat(other); const value = this.#val * this.#tens; - (0, errors_js_1.assert)(value % other.#val === BN_0, "precision lost during signalling div", "NUMERIC_FAULT", { + errors.assert(value % other.#val === BN_0, "precision lost during signalling div", "NUMERIC_FAULT", { operation: "divSignal", fault: "underflow", value: this, @@ -517,11 +510,11 @@ class FixedNumber { decimals = 0; } const format = getFormat(_format); - let value = (0, maths_js_1.getBigInt)(_value, "value"); + let value = maths.getBigInt(_value, "value"); const delta = decimals - format.decimals; if (delta > 0) { const tens = getTens(delta); - (0, errors_js_1.assert)(value % tens === BN_0, "value loses precision for format", "NUMERIC_FAULT", { + errors.assert(value % tens === BN_0, "value loses precision for format", "NUMERIC_FAULT", { operation: "fromValue", fault: "underflow", value: _value, @@ -542,7 +535,7 @@ class FixedNumber { */ static fromString(_value, _format) { const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - (0, errors_js_1.assertArgument)(match && match[2].length + match[3].length > 0, "invalid FixedNumber string value", "value", _value); + errors.assertArgument(match && match[2].length + match[3].length > 0, "invalid FixedNumber string value", "value", _value); const format = getFormat(_format); let whole = match[2] || "0", decimal = match[3] || ""; // Pad out the decimals @@ -550,7 +543,7 @@ class FixedNumber { decimal += Zeros; } // Check precision is safe - (0, errors_js_1.assert)(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { + errors.assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { operation: "fromString", fault: "underflow", value: _value, @@ -569,19 +562,20 @@ class FixedNumber { * in %%format%% due to overflow. */ static fromBytes(_value, _format) { - let value = (0, maths_js_1.toBigInt)((0, data_js_1.getBytes)(_value, "value")); + let value = maths.toBigInt(data.getBytes(_value, "value")); const format = getFormat(_format); if (format.signed) { - value = (0, maths_js_1.fromTwos)(value, format.width); + value = maths.fromTwos(value, format.width); } checkValue(value, format, "fromBytes"); return new _a(_guard, value, format); } } -exports.FixedNumber = FixedNumber; _a = FixedNumber; //const f1 = FixedNumber.fromString("12.56", "fixed16x2"); //const f2 = FixedNumber.fromString("0.3", "fixed16x2"); //console.log(f1.divSignal(f2)); //const BUMP = FixedNumber.from("0.5"); -//# sourceMappingURL=fixednumber.js.map \ No newline at end of file + +exports.FixedNumber = FixedNumber; +//# sourceMappingURL=fixednumber.js.map diff --git a/lib.commonjs/utils/fixednumber.js.map b/lib.commonjs/utils/fixednumber.js.map index c425f9095..f9cc02319 100644 --- a/lib.commonjs/utils/fixednumber.js.map +++ b/lib.commonjs/utils/fixednumber.js.map @@ -1 +1 @@ -{"version":3,"file":"fixednumber.js","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":";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AAQ,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAElC,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,KAAK,GAAG,IAAA,mBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;SACvC;QAED,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QAEvC,OAAO,IAAI,EAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;CACF;AAvgBD,kCAugBC;;AAED,0DAA0D;AAC1D,wDAAwD;AACxD,gCAAgC;AAChC,uCAAuC"} \ No newline at end of file +{"version":3,"file":"fixednumber.js","sources":["../../lib.esm/utils/fixednumber.js"],"sourcesContent":["var _a;\n/**\n * About fixed-point math...\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = BN_1 << (width - BN_1);\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = BN_1 << width;\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n val = (((val % limit) + limit) % limit) & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof value === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof value === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = match[1] !== \"u\";\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof v[key] === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument(width % 8 === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return negative + str;\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return negative + str;\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, an value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() {\n return this.#format.signed;\n }\n /**\n * The number of bits available to store the value.\n */\n get width() {\n return this.#format.width;\n }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() {\n return this.#format.decimals;\n }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() {\n return this.#val;\n }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n\n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n*/\n val = checkValue(val, this.#format, safeOp);\n return new _a(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) {\n return this.#add(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) {\n return this.#add(other, \"add\");\n }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) {\n return this.#sub(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) {\n return this.#sub(other, \"sub\");\n }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) {\n return this.#mul(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) {\n return this.#mul(other, \"mul\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert(value % this.#tens === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) {\n return this.#div(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) {\n return this.#div(other, \"div\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(other);\n const value = this.#val * this.#tens;\n assert(value % other.#val === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%other%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return -1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) {\n return this.cmp(other) === 0;\n }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) {\n return this.cmp(other) < 0;\n }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) {\n return this.cmp(other) <= 0;\n }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) {\n return this.cmp(other) > 0;\n }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) {\n return this.cmp(other) >= 0;\n }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new _a(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() {\n return this.#val === BN_0;\n }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() {\n return this.#val < BN_0;\n }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() {\n return this._value;\n }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() {\n return parseFloat(this.toString());\n }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return _a.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, decimals, _format) {\n if (decimals == null) {\n decimals = 0;\n }\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert(value % tens === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\",\n fault: \"underflow\",\n value: _value,\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && match[2].length + match[3].length > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = match[2] || \"0\", decimal = match[3] || \"\";\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\",\n fault: \"underflow\",\n value: _value,\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new _a(_guard, value, format);\n }\n}\n_a = FixedNumber;\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map"],"names":["assert","fromTwos","mask","assertArgument","assertPrivate","defineProperties","getBigInt","toBigInt","getBytes"],"mappings":";;;;;;;AAAA,IAAI,EAAE;AAUN,MAAM,KAAK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KAAK,GAAGP,cAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;AACjD,QAAQ;AACR,QAAQ,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC;AAC9C,QAAQ,OAAO,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;AAC5C,IAAI;AACJ;AACA,EAAE,GAAG,WAAW;AAChB;AACA;AACA;AACA;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/geturl-browser.d.ts b/lib.commonjs/utils/geturl-browser.d.ts index 133a13813..29cebe088 100644 --- a/lib.commonjs/utils/geturl-browser.d.ts +++ b/lib.commonjs/utils/geturl-browser.d.ts @@ -1,21 +1,3 @@ import type { FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -declare global { - class Headers { - constructor(values: Array<[string, string]>); - forEach(func: (v: string, k: string) => void): void; - } - class Response { - status: number; - statusText: string; - headers: Headers; - arrayBuffer(): Promise; - } - type FetchInit = { - method?: string; - headers?: Headers; - body?: Uint8Array; - }; - function fetch(url: string, init: FetchInit): Promise; -} export declare function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise; //# sourceMappingURL=geturl-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/geturl-browser.d.ts.map b/lib.commonjs/utils/geturl-browser.d.ts.map index 852575bca..3190d62cc 100644 --- a/lib.commonjs/utils/geturl-browser.d.ts.map +++ b/lib.commonjs/utils/geturl-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IAEb,MAAM,OAAO;oBACC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;KACpD;IAGD,MAAM,QAAQ;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;KACpC;IAED,KAAK,SAAS,GAAG;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,UAAU,CAAC;KACnB,CAAC;IAEF,SAAS,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACjE;AAID,wBAAsB,MAAM,CAC1B,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA0DrC"} \ No newline at end of file +{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAIpB,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA0DrC"} \ No newline at end of file diff --git a/lib.commonjs/utils/geturl-browser.js b/lib.commonjs/utils/geturl-browser.js index d620b6b92..fa82088d1 100644 --- a/lib.commonjs/utils/geturl-browser.js +++ b/lib.commonjs/utils/geturl-browser.js @@ -1,16 +1,16 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getUrl = void 0; -const errors_js_1 = require("./errors.js"); +'use strict'; + +var errors = require('./errors.js'); + // @TODO: timeout is completely ignored; start a Promise.any with a reject? // @ts-ignore async function getUrl(req, _signal) { const protocol = req.url.split(":")[0].toLowerCase(); - (0, errors_js_1.assert)(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { + errors.assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { info: { protocol }, operation: "request", }); - (0, errors_js_1.assert)(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { + errors.assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { operation: "request", }); let signal = undefined; @@ -47,5 +47,6 @@ async function getUrl(req, _signal) { return undefined; } } + exports.getUrl = getUrl; -//# sourceMappingURL=geturl-browser.js.map \ No newline at end of file +//# sourceMappingURL=geturl-browser.js.map diff --git a/lib.commonjs/utils/geturl-browser.js.map b/lib.commonjs/utils/geturl-browser.js.map index cd677004f..94eb56af8 100644 --- a/lib.commonjs/utils/geturl-browser.js.map +++ b/lib.commonjs/utils/geturl-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"geturl-browser.js","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":";;;AAAA,2CAAqC;AAgCrC,2EAA2E;AAC3E,aAAa;AACN,KAAK,UAAU,MAAM,CAC1B,GAAiB,EACjB,OAA2B;IAE3B,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAErD,IAAA,kBAAM,EACJ,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,OAAO,EAC3C,wBAAwB,QAAQ,EAAE,EAClC,uBAAuB,EACvB;QACE,IAAI,EAAE,EAAE,QAAQ,EAAE;QAClB,SAAS,EAAE,SAAS;KACrB,CACF,CAAC;IAEF,IAAA,kBAAM,EACJ,QAAQ,KAAK,OAAO,IAA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QACnB,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACvB,OAAO,SAAS,CAAC;KAClB;AACH,CAAC;AA7DD,wBA6DC"} \ No newline at end of file +{"version":3,"file":"geturl-browser.js","sources":["../../lib.esm/utils/geturl-browser.js"],"sourcesContent":["import { assert } from \"./errors.js\";\n// @TODO: timeout is completely ignored; start a Promise.any with a reject?\n// @ts-ignore\nexport async function getUrl(req, _signal) {\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 let signal = undefined;\n if (_signal) {\n const controller = new AbortController();\n signal = controller.signal;\n _signal.addListener(() => {\n controller.abort();\n });\n }\n const init = {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal,\n };\n try {\n const resp = await fetch(req.url, init);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = respBody == null ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers,\n body,\n };\n }\n catch (error) {\n console.log({ error });\n return undefined;\n }\n}\n//# sourceMappingURL=geturl-browser.js.map"],"names":["assert"],"mappings":";;;;AACA;AACA;AACO,eAAe,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE;AAC3C,IAAI,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;AACxD,IAAIA,aAAM,CAAC,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC,EAAE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,IAAI,IAAI,GAAG,IAAI,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC;AACvE,QAAQ,OAAO;AACf,YAAY,UAAU,EAAE,IAAI,CAAC,MAAM;AACnC,YAAY,aAAa,EAAE,IAAI,CAAC,UAAU;AAC1C,YAAY,OAAO;AACnB,YAAY,IAAI;AAChB,SAAS;AACT,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;AAC9B,QAAQ,OAAO,SAAS;AACxB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/geturl.d.ts.map b/lib.commonjs/utils/geturl.d.ts.map index 8cde884db..7728357a3 100644 --- a/lib.commonjs/utils/geturl.d.ts.map +++ b/lib.commonjs/utils/geturl.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,MAAM,CAC1B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,cAAc,CAAC,CAqGzB"} \ No newline at end of file +{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,cAAc,CAAC,CAqGzB"} \ No newline at end of file diff --git a/lib.commonjs/utils/geturl.js b/lib.commonjs/utils/geturl.js index c12535f91..e072214ff 100644 --- a/lib.commonjs/utils/geturl.js +++ b/lib.commonjs/utils/geturl.js @@ -1,28 +1,27 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getUrl = void 0; -const tslib_1 = require("tslib"); -const http_1 = tslib_1.__importDefault(require("http")); -const https_1 = tslib_1.__importDefault(require("https")); -const zlib_1 = require("zlib"); -const errors_js_1 = require("./errors.js"); -const data_js_1 = require("./data.js"); +'use strict'; + +var http = require('http'); +var https = require('https'); +var zlib = require('zlib'); +var errors = require('./errors.js'); +var data = require('./data.js'); + /** * @_ignore: */ async function getUrl(req, signal) { const protocol = req.url.split(":")[0].toLowerCase(); - (0, errors_js_1.assert)(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { + errors.assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { info: { protocol }, operation: "request", }); - (0, errors_js_1.assert)(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { + errors.assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { operation: "request", }); const method = req.method; const headers = Object.assign({}, req.headers); const options = { method, headers }; - const request = (protocol === "http" ? http_1.default : https_1.default).request(req.url, options); + const request = (protocol === "http" ? http : https).request(req.url, options); request.setTimeout(req.timeout); const body = req.body; if (body) { @@ -66,7 +65,7 @@ async function getUrl(req, signal) { }); resp.on("end", () => { if (headers["content-encoding"] === "gzip" && body) { - body = (0, data_js_1.getBytes)((0, zlib_1.gunzipSync)(body)); + body = data.getBytes(zlib.gunzipSync(body)); } resolve({ statusCode, statusMessage, headers, body }); }); @@ -81,5 +80,6 @@ async function getUrl(req, signal) { }); }); } + exports.getUrl = getUrl; -//# sourceMappingURL=geturl.js.map \ No newline at end of file +//# sourceMappingURL=geturl.js.map diff --git a/lib.commonjs/utils/geturl.js.map b/lib.commonjs/utils/geturl.js.map index 32f47f1bf..42cf86ed3 100644 --- a/lib.commonjs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iBACd;qBAAM;oBACL,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;oBAC3D,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;oBACrB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;oBAChC,IAAI,GAAG,OAAO,CAAC;iBAChB;YACH,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBAClB,IAAI,OAAO,CAAC,kBAAkB,CAAC,KAAK,MAAM,IAAI,IAAI,EAAE;oBAClD,IAAI,GAAG,IAAA,kBAAQ,EAAC,IAAA,iBAAU,EAAC,IAAI,CAAC,CAAC,CAAC;iBACnC;gBAED,OAAO,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACxD,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACzB,qEAAqE;gBAC/D,KAAM,CAAC,QAAQ,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gBACrE,MAAM,CAAC,KAAK,CAAC,CAAC;YAChB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC5B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAxGD,wBAwGC"} \ No newline at end of file +{"version":3,"file":"geturl.js","sources":["../../lib.esm/utils/geturl.js"],"sourcesContent":["import http from \"http\";\nimport https from \"https\";\nimport { gunzipSync } from \"zlib\";\nimport { assert } from \"./errors.js\";\nimport { getBytes } from \"./data.js\";\n/**\n * @_ignore:\n */\nexport async function getUrl(req, signal) {\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 options = { method, headers };\n const request = (protocol === \"http\" ? http : https).request(req.url, options);\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 // @TODO: Node 15 added AbortSignal; once we drop support for\n // Node14, we can add that in here too\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 if (headers[\"content-encoding\"] === \"gzip\" && body) {\n body = getBytes(gunzipSync(body));\n }\n resolve({ statusCode, statusMessage, headers, body });\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) => {\n reject(error);\n });\n });\n}\n//# sourceMappingURL=geturl.js.map"],"names":["assert","getBytes","gunzipSync"],"mappings":";;;;;;;;AAKA;AACA;AACA;AACO,eAAe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C,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;AACxC,oBAAoB,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC;AACnD,oBAAoB,IAAI,GAAG,OAAO;AAClC,gBAAgB;AAChB,YAAY,CAAC,CAAC;AACd,YAAY,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM;AACjC,gBAAgB,IAAI,OAAO,CAAC,kBAAkB,CAAC,KAAK,MAAM,IAAI,IAAI,EAAE;AACpE,oBAAoB,IAAI,GAAGC,aAAQ,CAACC,eAAU,CAAC,IAAI,CAAC,CAAC;AACrD,gBAAgB;AAChB,gBAAgB,OAAO,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACrE,YAAY,CAAC,CAAC;AACd,YAAY,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,KAAK;AACxC;AACA,gBAAgB,KAAK,CAAC,QAAQ,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE;AAC7E,gBAAgB,MAAM,CAAC,KAAK,CAAC;AAC7B,YAAY,CAAC,CAAC;AACd,QAAQ,CAAC,CAAC;AACV,QAAQ,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,KAAK;AACvC,YAAY,MAAM,CAAC,KAAK,CAAC;AACzB,QAAQ,CAAC,CAAC;AACV,IAAI,CAAC,CAAC;AACN;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/index.d.ts.map b/lib.commonjs/utils/index.d.ts.map index 2efd33012..2be8f026a 100644 --- a/lib.commonjs/utils/index.d.ts.map +++ b/lib.commonjs/utils/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE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EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9D,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EACV,aAAa,EACb,wBAAwB,EACxB,eAAe,GAChB,MAAM,WAAW,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,GACT,MAAM,WAAW,CAAC;AAEnB,OAAO,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,SAAS,GACT,MAAM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aAAa,CAAC;AAE9D,YAAY,EACX,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,GACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EACX,aAAa,EACb,wBAAwB,EACxB,eAAe,GACf,MAAM,WAAW,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/utils/index.js b/lib.commonjs/utils/index.js index 418c77a7e..ab2efdadf 100644 --- a/lib.commonjs/utils/index.js +++ b/lib.commonjs/utils/index.js @@ -1,80 +1,74 @@ -"use strict"; -/** - * There are many simple utilities required to interact with - * Core and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toUtf8Bytes = exports.parseUnits = exports.formatUnits = exports.parseXCB = exports.formatXCB = exports.encodeRlp = exports.decodeRlp = exports.defineProperties = exports.resolveProperties = exports.toQuantity = exports.toBeArray = exports.toBeHex = exports.toNumber = exports.toBigInt = exports.getUint = exports.getNumber = exports.getBigInt = exports.mask = exports.toTwos = exports.fromTwos = exports.FixedNumber = exports.FetchCancelSignal = exports.FetchResponse = exports.FetchRequest = exports.EventPayload = exports.makeError = exports.assertNormalize = exports.assertPrivate = exports.assertArgumentCount = exports.assertArgument = exports.assert = exports.isError = exports.isCallException = exports.hexConcat = exports.arrayify = exports.zeroPadBytes = exports.zeroPadValue = exports.stripZerosLeft = exports.dataSlice = exports.dataLength = exports.concat = exports.hexlify = exports.isBytesLike = exports.isHexString = exports.getBytesCopy = exports.getBytes = exports.encodeBase64 = exports.decodeBase64 = exports.encodeBase58 = exports.decodeBase58 = void 0; -exports.uuidV4 = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = void 0; -var base58_js_1 = require("./base58.js"); -Object.defineProperty(exports, "decodeBase58", { enumerable: true, get: function () { return base58_js_1.decodeBase58; } }); -Object.defineProperty(exports, "encodeBase58", { enumerable: true, get: function () { return base58_js_1.encodeBase58; } }); -var base64_js_1 = require("./base64.js"); -Object.defineProperty(exports, "decodeBase64", { enumerable: true, get: function () { return base64_js_1.decodeBase64; } }); -Object.defineProperty(exports, "encodeBase64", { enumerable: true, get: function () { return base64_js_1.encodeBase64; } }); -var data_js_1 = require("./data.js"); -Object.defineProperty(exports, "getBytes", { enumerable: true, get: function () { return data_js_1.getBytes; } }); -Object.defineProperty(exports, "getBytesCopy", { enumerable: true, get: function () { return data_js_1.getBytesCopy; } }); -Object.defineProperty(exports, "isHexString", { enumerable: true, get: function () { return data_js_1.isHexString; } }); -Object.defineProperty(exports, "isBytesLike", { enumerable: true, get: function () { return data_js_1.isBytesLike; } }); -Object.defineProperty(exports, "hexlify", { enumerable: true, get: function () { return data_js_1.hexlify; } }); -Object.defineProperty(exports, "concat", { enumerable: true, get: function () { return data_js_1.concat; } }); -Object.defineProperty(exports, "dataLength", { enumerable: true, get: function () { return data_js_1.dataLength; } }); -Object.defineProperty(exports, "dataSlice", { enumerable: true, get: function () { return data_js_1.dataSlice; } }); -Object.defineProperty(exports, "stripZerosLeft", { enumerable: true, get: function () { return data_js_1.stripZerosLeft; } }); -Object.defineProperty(exports, "zeroPadValue", { enumerable: true, get: function () { return data_js_1.zeroPadValue; } }); -Object.defineProperty(exports, "zeroPadBytes", { enumerable: true, get: function () { return data_js_1.zeroPadBytes; } }); -Object.defineProperty(exports, "arrayify", { enumerable: true, get: function () { return data_js_1.arrayify; } }); -Object.defineProperty(exports, "hexConcat", { enumerable: true, get: function () { return data_js_1.hexConcat; } }); -var errors_js_1 = require("./errors.js"); -Object.defineProperty(exports, "isCallException", { enumerable: true, get: function () { return errors_js_1.isCallException; } }); -Object.defineProperty(exports, "isError", { enumerable: true, get: function () { return errors_js_1.isError; } }); -Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return errors_js_1.assert; } }); -Object.defineProperty(exports, "assertArgument", { enumerable: true, get: function () { return errors_js_1.assertArgument; } }); -Object.defineProperty(exports, "assertArgumentCount", { enumerable: true, get: function () { return errors_js_1.assertArgumentCount; } }); -Object.defineProperty(exports, "assertPrivate", { enumerable: true, get: function () { return errors_js_1.assertPrivate; } }); -Object.defineProperty(exports, "assertNormalize", { enumerable: true, get: function () { return errors_js_1.assertNormalize; } }); -Object.defineProperty(exports, "makeError", { enumerable: true, get: function () { return errors_js_1.makeError; } }); -var events_js_1 = require("./events.js"); -Object.defineProperty(exports, "EventPayload", { enumerable: true, get: function () { return events_js_1.EventPayload; } }); -var fetch_js_1 = require("./fetch.js"); -Object.defineProperty(exports, "FetchRequest", { enumerable: true, get: function () { return fetch_js_1.FetchRequest; } }); -Object.defineProperty(exports, "FetchResponse", { enumerable: true, get: function () { return fetch_js_1.FetchResponse; } }); -Object.defineProperty(exports, "FetchCancelSignal", { enumerable: true, get: function () { return fetch_js_1.FetchCancelSignal; } }); -var fixednumber_js_1 = require("./fixednumber.js"); -Object.defineProperty(exports, "FixedNumber", { enumerable: true, get: function () { return fixednumber_js_1.FixedNumber; } }); -var maths_js_1 = require("./maths.js"); -Object.defineProperty(exports, "fromTwos", { enumerable: true, get: function () { return maths_js_1.fromTwos; } }); -Object.defineProperty(exports, "toTwos", { enumerable: true, get: function () { return maths_js_1.toTwos; } }); -Object.defineProperty(exports, "mask", { enumerable: true, get: function () { return maths_js_1.mask; } }); -Object.defineProperty(exports, "getBigInt", { enumerable: true, get: function () { return maths_js_1.getBigInt; } }); -Object.defineProperty(exports, "getNumber", { enumerable: true, get: function () { return maths_js_1.getNumber; } }); -Object.defineProperty(exports, "getUint", { enumerable: true, get: function () { return maths_js_1.getUint; } }); -Object.defineProperty(exports, "toBigInt", { enumerable: true, get: function () { return maths_js_1.toBigInt; } }); -Object.defineProperty(exports, "toNumber", { enumerable: true, get: function () { return maths_js_1.toNumber; } }); -Object.defineProperty(exports, "toBeHex", { enumerable: true, get: function () { return maths_js_1.toBeHex; } }); -Object.defineProperty(exports, "toBeArray", { enumerable: true, get: function () { return maths_js_1.toBeArray; } }); -Object.defineProperty(exports, "toQuantity", { enumerable: true, get: function () { return maths_js_1.toQuantity; } }); -var properties_js_1 = require("./properties.js"); -Object.defineProperty(exports, "resolveProperties", { enumerable: true, get: function () { return properties_js_1.resolveProperties; } }); -Object.defineProperty(exports, "defineProperties", { enumerable: true, get: function () { return properties_js_1.defineProperties; } }); -var rlp_decode_js_1 = require("./rlp-decode.js"); -Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return rlp_decode_js_1.decodeRlp; } }); -var rlp_encode_js_1 = require("./rlp-encode.js"); -Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return rlp_encode_js_1.encodeRlp; } }); -var units_js_1 = require("./units.js"); -Object.defineProperty(exports, "formatXCB", { enumerable: true, get: function () { return units_js_1.formatXCB; } }); -Object.defineProperty(exports, "parseXCB", { enumerable: true, get: function () { return units_js_1.parseXCB; } }); -Object.defineProperty(exports, "formatUnits", { enumerable: true, get: function () { return units_js_1.formatUnits; } }); -Object.defineProperty(exports, "parseUnits", { enumerable: true, get: function () { return units_js_1.parseUnits; } }); -var utf8_js_1 = require("./utf8.js"); -Object.defineProperty(exports, "toUtf8Bytes", { enumerable: true, get: function () { return utf8_js_1.toUtf8Bytes; } }); -Object.defineProperty(exports, "toUtf8CodePoints", { enumerable: true, get: function () { return utf8_js_1.toUtf8CodePoints; } }); -Object.defineProperty(exports, "toUtf8String", { enumerable: true, get: function () { return utf8_js_1.toUtf8String; } }); -Object.defineProperty(exports, "Utf8ErrorFuncs", { enumerable: true, get: function () { return utf8_js_1.Utf8ErrorFuncs; } }); -var uuid_js_1 = require("./uuid.js"); -Object.defineProperty(exports, "uuidV4", { enumerable: true, get: function () { return uuid_js_1.uuidV4; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var base58 = require('./base58.js'); +var base64 = require('./base64.js'); +var data = require('./data.js'); +var errors = require('./errors.js'); +var events = require('./events.js'); +var fetch = require('./fetch.js'); +var fixednumber = require('./fixednumber.js'); +var maths = require('./maths.js'); +var properties = require('./properties.js'); +var rlpDecode = require('./rlp-decode.js'); +var rlpEncode = require('./rlp-encode.js'); +var units = require('./units.js'); +var utf8 = require('./utf8.js'); +var uuid = require('./uuid.js'); + + + +exports.decodeBase58 = base58.decodeBase58; +exports.encodeBase58 = base58.encodeBase58; +exports.decodeBase64 = base64.decodeBase64; +exports.encodeBase64 = base64.encodeBase64; +exports.arrayify = data.arrayify; +exports.concat = data.concat; +exports.dataLength = data.dataLength; +exports.dataSlice = data.dataSlice; +exports.getBytes = data.getBytes; +exports.getBytesCopy = data.getBytesCopy; +exports.hexConcat = data.hexConcat; +exports.hexlify = data.hexlify; +exports.isBytesLike = data.isBytesLike; +exports.isHexString = data.isHexString; +exports.stripZerosLeft = data.stripZerosLeft; +exports.zeroPadBytes = data.zeroPadBytes; +exports.zeroPadValue = data.zeroPadValue; +exports.assert = errors.assert; +exports.assertArgument = errors.assertArgument; +exports.assertArgumentCount = errors.assertArgumentCount; +exports.assertNormalize = errors.assertNormalize; +exports.assertPrivate = errors.assertPrivate; +exports.isCallException = errors.isCallException; +exports.isError = errors.isError; +exports.makeError = errors.makeError; +exports.EventPayload = events.EventPayload; +exports.FetchCancelSignal = fetch.FetchCancelSignal; +exports.FetchRequest = fetch.FetchRequest; +exports.FetchResponse = fetch.FetchResponse; +exports.FixedNumber = fixednumber.FixedNumber; +exports.fromTwos = maths.fromTwos; +exports.getBigInt = maths.getBigInt; +exports.getNumber = maths.getNumber; +exports.getUint = maths.getUint; +exports.mask = maths.mask; +exports.toBeArray = maths.toBeArray; +exports.toBeHex = maths.toBeHex; +exports.toBigInt = maths.toBigInt; +exports.toNumber = maths.toNumber; +exports.toQuantity = maths.toQuantity; +exports.toTwos = maths.toTwos; +exports.defineProperties = properties.defineProperties; +exports.resolveProperties = properties.resolveProperties; +exports.decodeRlp = rlpDecode.decodeRlp; +exports.encodeRlp = rlpEncode.encodeRlp; +exports.formatUnits = units.formatUnits; +exports.formatXCB = units.formatXCB; +exports.parseUnits = units.parseUnits; +exports.parseXCB = units.parseXCB; +exports.Utf8ErrorFuncs = utf8.Utf8ErrorFuncs; +exports.toUtf8Bytes = utf8.toUtf8Bytes; +exports.toUtf8CodePoints = utf8.toUtf8CodePoints; +exports.toUtf8String = utf8.toUtf8String; +exports.uuidV4 = uuid.uuidV4; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/utils/index.js.map b/lib.commonjs/utils/index.js.map index 3c7c5dfbd..3a142573c 100644 --- a/lib.commonjs/utils/index.js.map +++ b/lib.commonjs/utils/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,yCAAyD;AAAhD,yGAAA,YAAY,OAAA;AAAE,yGAAA,YAAY,OAAA;AAEnC,yCAAyD;AAAhD,yGAAA,YAAY,OAAA;AAAE,yGAAA,YAAY,OAAA;AAEnC,qCAcmB;AAbjB,mGAAA,QAAQ,OAAA;AACR,uGAAA,YAAY,OAAA;AACZ,sGAAA,WAAW,OAAA;AACX,sGAAA,WAAW,OAAA;AACX,kGAAA,OAAO,OAAA;AACP,iGAAA,MAAM,OAAA;AACN,qGAAA,UAAU,OAAA;AACV,oGAAA,SAAS,OAAA;AACT,yGAAA,cAAc,OAAA;AACd,uGAAA,YAAY,OAAA;AACZ,uGAAA,YAAY,OAAA;AACZ,mGAAA,QAAQ,OAAA;AACR,oGAAA,SAAS,OAAA;AAGX,yCASqB;AARnB,4GAAA,eAAe,OAAA;AACf,oGAAA,OAAO,OAAA;AACP,mGAAA,MAAM,OAAA;AACN,2GAAA,cAAc,OAAA;AACd,gHAAA,mBAAmB,OAAA;AACnB,0GAAA,aAAa,OAAA;AACb,4GAAA,eAAe,OAAA;AACf,sGAAA,SAAS,OAAA;AAGX,yCAA2C;AAAlC,yGAAA,YAAY,OAAA;AAErB,uCAA4E;AAAnE,wGAAA,YAAY,OAAA;AAAE,yGAAA,aAAa,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAEvD,mDAA+C;AAAtC,6GAAA,WAAW,OAAA;AAEpB,uCAYoB;AAXlB,oGAAA,QAAQ,OAAA;AACR,kGAAA,MAAM,OAAA;AACN,gGAAA,IAAI,OAAA;AACJ,qGAAA,SAAS,OAAA;AACT,qGAAA,SAAS,OAAA;AACT,mGAAA,OAAO,OAAA;AACP,oGAAA,QAAQ,OAAA;AACR,oGAAA,QAAQ,OAAA;AACR,mGAAA,OAAO,OAAA;AACP,qGAAA,SAAS,OAAA;AACT,sGAAA,UAAU,OAAA;AAGZ,iDAAsE;AAA7D,kHAAA,iBAAiB,OAAA;AAAE,iHAAA,gBAAgB,OAAA;AAE5C,iDAA4C;AAAnC,0GAAA,SAAS,OAAA;AAClB,iDAA4C;AAAnC,0GAAA,SAAS,OAAA;AAElB,uCAA0E;AAAjE,qGAAA,SAAS,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAAE,uGAAA,WAAW,OAAA;AAAE,sGAAA,UAAU,OAAA;AAErD,qCAKmB;AAJjB,sGAAA,WAAW,OAAA;AACX,2GAAA,gBAAgB,OAAA;AAChB,uGAAA,YAAY,OAAA;AACZ,yGAAA,cAAc,OAAA;AAGhB,qCAAmC;AAA1B,iGAAA,MAAM,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/maths.js b/lib.commonjs/utils/maths.js index 4e6b1e8a3..f54d2d173 100644 --- a/lib.commonjs/utils/maths.js +++ b/lib.commonjs/utils/maths.js @@ -1,13 +1,13 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toQuantity = exports.toBeArray = exports.toBeHex = exports.toNumber = exports.getNumber = exports.toBigInt = exports.getUint = exports.getBigInt = exports.mask = exports.toTwos = exports.fromTwos = void 0; +'use strict'; + +var data = require('./data.js'); +var errors = require('./errors.js'); + /** * Some mathematic operations. * * @_subsection: api/utils:Math Helpers [about-maths] */ -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); const BN_0 = BigInt(0); const BN_1 = BigInt(1); //const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; @@ -22,7 +22,7 @@ const maxValue = 0x1fffffffffffff; function fromTwos(_value, _width) { const value = getUint(_value, "value"); const width = BigInt(getNumber(_width, "width")); - (0, errors_js_1.assert)(value >> width === BN_0, "overflow", "NUMERIC_FAULT", { + errors.assert(value >> width === BN_0, "overflow", "NUMERIC_FAULT", { operation: "fromTwos", fault: "overflow", value: _value, @@ -34,7 +34,6 @@ function fromTwos(_value, _width) { } return value; } -exports.fromTwos = fromTwos; /** * Convert %%value%% to a twos-compliment representation of * %%width%% bits. @@ -47,7 +46,7 @@ function toTwos(_value, _width) { const limit = BN_1 << (width - BN_1); if (value < BN_0) { value = -value; - (0, errors_js_1.assert)(value <= limit, "too low", "NUMERIC_FAULT", { + errors.assert(value <= limit, "too low", "NUMERIC_FAULT", { operation: "toTwos", fault: "overflow", value: _value, @@ -56,7 +55,7 @@ function toTwos(_value, _width) { return (~value & mask) + BN_1; } else { - (0, errors_js_1.assert)(value < limit, "too high", "NUMERIC_FAULT", { + errors.assert(value < limit, "too high", "NUMERIC_FAULT", { operation: "toTwos", fault: "overflow", value: _value, @@ -64,7 +63,6 @@ function toTwos(_value, _width) { } return value; } -exports.toTwos = toTwos; /** * Mask %%value%% with a bitmask of %%bits%% ones. */ @@ -73,7 +71,6 @@ function mask(_value, _bits) { const bits = BigInt(getNumber(_bits, "bits")); return value & ((BN_1 << bits) - BN_1); } -exports.mask = mask; /** * Gets a BigInt from %%value%%. If it is an invalid value for * a BigInt, then an ArgumentError will be thrown for %%name%%. @@ -83,8 +80,8 @@ function getBigInt(value, name) { case "bigint": return value; case "number": - (0, errors_js_1.assertArgument)(Number.isInteger(value), "underflow", name || "value", value); - (0, errors_js_1.assertArgument)(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); + errors.assertArgument(Number.isInteger(value), "underflow", name || "value", value); + errors.assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); return BigInt(value); case "string": try { @@ -97,22 +94,20 @@ function getBigInt(value, name) { return BigInt(value); } catch (e) { - (0, errors_js_1.assertArgument)(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); + errors.assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); } } - (0, errors_js_1.assertArgument)(false, "invalid BigNumberish value", name || "value", value); + errors.assertArgument(false, "invalid BigNumberish value", name || "value", value); } -exports.getBigInt = getBigInt; function getUint(value, name) { const result = getBigInt(value, name); - (0, errors_js_1.assert)(result >= BN_0, "unsigned value cannot be negative", "NUMERIC_FAULT", { + errors.assert(result >= BN_0, "unsigned value cannot be negative", "NUMERIC_FAULT", { fault: "overflow", operation: "getUint", value, }); return result; } -exports.getUint = getUint; const Nibbles = "0123456789abcdef"; /* * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it @@ -129,7 +124,6 @@ function toBigInt(value) { } return getBigInt(value); } -exports.toBigInt = toBigInt; /** * Gets a //number// from %%value%%. If it is an invalid value for * a //number//, then an ArgumentError will be thrown for %%name%%. @@ -137,11 +131,11 @@ exports.toBigInt = toBigInt; function getNumber(value, name) { switch (typeof value) { case "bigint": - (0, errors_js_1.assertArgument)(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); + errors.assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); return Number(value); case "number": - (0, errors_js_1.assertArgument)(Number.isInteger(value), "underflow", name || "value", value); - (0, errors_js_1.assertArgument)(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); + errors.assertArgument(Number.isInteger(value), "underflow", name || "value", value); + errors.assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); return value; case "string": try { @@ -151,12 +145,11 @@ function getNumber(value, name) { return getNumber(BigInt(value), name); } catch (e) { - (0, errors_js_1.assertArgument)(false, `invalid numeric string: ${e.message}`, name || "value", value); + errors.assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); } } - (0, errors_js_1.assertArgument)(false, "invalid numeric value", name || "value", value); + errors.assertArgument(false, "invalid numeric value", name || "value", value); } -exports.getNumber = getNumber; /** * Converts %%value%% to a number. If %%value%% is a Uint8Array, it * is treated as Big Endian data. Throws if the value is not safe. @@ -164,7 +157,6 @@ exports.getNumber = getNumber; function toNumber(value) { return getNumber(toBigInt(value)); } -exports.toNumber = toNumber; /** * Converts %%value%% to a Big Endian hexstring, optionally padded to * %%width%% bytes. @@ -180,7 +172,7 @@ function toBeHex(_value, _width) { } else { const width = getNumber(_width, "width"); - (0, errors_js_1.assert)(width * 2 >= result.length, `value exceeds width (${width} bits)`, "NUMERIC_FAULT", { + errors.assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, "NUMERIC_FAULT", { operation: "toBeHex", fault: "overflow", value: _value, @@ -192,7 +184,6 @@ function toBeHex(_value, _width) { } return "0x" + result; } -exports.toBeHex = toBeHex; /** * Converts %%value%% to a Big Endian Uint8Array. */ @@ -212,7 +203,6 @@ function toBeArray(_value) { } return result; } -exports.toBeArray = toBeArray; /** * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. * @@ -221,7 +211,7 @@ exports.toBeArray = toBeArray; * numeric values. */ function toQuantity(value) { - let result = (0, data_js_1.hexlify)((0, data_js_1.isBytesLike)(value) ? value : toBeArray(value)).substring(2); + let result = data.hexlify(data.isBytesLike(value) ? value : toBeArray(value)).substring(2); while (result.startsWith("0")) { result = result.substring(1); } @@ -230,5 +220,16 @@ function toQuantity(value) { } return "0x" + result; } + +exports.fromTwos = fromTwos; +exports.getBigInt = getBigInt; +exports.getNumber = getNumber; +exports.getUint = getUint; +exports.mask = mask; +exports.toBeArray = toBeArray; +exports.toBeHex = toBeHex; +exports.toBigInt = toBigInt; +exports.toNumber = toNumber; exports.toQuantity = toQuantity; -//# sourceMappingURL=maths.js.map \ No newline at end of file +exports.toTwos = toTwos; +//# sourceMappingURL=maths.js.map diff --git a/lib.commonjs/utils/maths.js.map b/lib.commonjs/utils/maths.js.map index 39f57c95a..951eb3710 100644 --- a/lib.commonjs/utils/maths.js.map +++ b/lib.commonjs/utils/maths.js.map @@ -1 +1 @@ -{"version":3,"file":"maths.js","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,uCAAiD;AACjD,2CAAqD;AAcrD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,iDAAiD;AAEjD,uCAAuC;AACvC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AAElC;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,MAAoB,EAAE,MAAe;IAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjD,IAAA,kBAAM,EAAC,KAAK,IAAI,KAAK,KAAK,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE;QAC3D,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,MAAM;KACd,CAAC,CAAC;IAEH,yCAAyC;IACzC,IAAI,KAAK,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE;QAC3B,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC;QACpC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,G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EAAE;QAC7B,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;KAC9B;IACD,IAAI,MAAM,KAAK,EAAE,EAAE;QACjB,MAAM,GAAG,GAAG,CAAC;KACd;IACD,OAAO,IAAI,GAAG,MAAM,CAAC;AACvB,CAAC;AAXD,gCAWC"} \ No newline at end of file +{"version":3,"file":"maths.js","sources":["../../lib.esm/utils/maths.js"],"sourcesContent":["/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert(value >> width === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\",\n fault: \"overflow\",\n value: _value,\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -((~value & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = BN_1 << (width - BN_1);\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n const mask = (BN_1 << width) - BN_1;\n return (~value & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof value) {\n case \"bigint\":\n return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\",\n operation: \"getUint\",\n value,\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof value) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value,\n });\n // Pad the value to the required width\n while (result.length < width * 2) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n return new Uint8Array([]);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map"],"names":["assert","assertArgument","hexlify","isBytesLike"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AAGA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB;AACA;AACA,MAAM,QAAQ,GAAG,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE;AACzC,IAAI,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC;AAC1C,IAAI,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,IAAIA,aAAM,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE;AACjE,QAAQ,SAAS,EAAE,UAAU;AAC7B,QAAQ,KAAK,EAAE,UAAU;AACzB,QAAQ,KAAK,EAAE,MAAM;AACrB,KAAK,CAAC;AACN;AACA,IAAI,IAAI,KAAK,KAAK,KAAK,GAAG,IAAI,CAAC,EAAE;AACjC,QAAQ,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,KAAK,IAAI,IAAI;AAC3C,QAAQ,OAAO,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC;AACxC,IAAI;AACJ,IAAI,OAAO,KAAK;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AACvC,IAAI,IAAI,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;AAC1C,IAAI,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,IAAI,MAAM,KAAK,GAAG,IAAI,KAAK,KAAK,GA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AI,IAAI,MAAM,KAAK,EAAE,EAAE;AACvB,QAAQ,MAAM,GAAG,GAAG;AACpB,IAAI;AACJ,IAAI,OAAO,IAAI,GAAG,MAAM;AACxB;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/properties.d.ts.map b/lib.commonjs/utils/properties.d.ts.map index 2520af8fb..b675427ea 100644 --- a/lib.commonjs/utils/properties.d.ts.map +++ b/lib.commonjs/utils/properties.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAC/C,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACrC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACjC,KAAK,CAAC,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAAE,GAClC,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,EACX,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACtC,IAAI,CAcN"} \ No newline at end of file +{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAChD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACjC,KAAK,CAAC,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAAE,GACjC,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC9B,MAAM,EAAE,GAAG,EACX,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACrC,IAAI,CAcN"} \ No newline at end of file diff --git a/lib.commonjs/utils/properties.js b/lib.commonjs/utils/properties.js index 10cdf2f4a..97ef50637 100644 --- a/lib.commonjs/utils/properties.js +++ b/lib.commonjs/utils/properties.js @@ -1,13 +1,13 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkProperties = exports.defineProperties = exports.resolveProperties = void 0; -const logger_js_1 = require("../logger/logger.js"); +'use strict'; + +var logger$1 = require('../logger/logger.js'); + /** * Property helper functions. * * @_subsection api/utils:Properties [about-properties] */ -const logger = new logger_js_1.Logger("utils/properties/0.0.1"); +const logger = new logger$1.Logger("utils/properties/0.0.1"); function checkType(value, type, name) { const types = type.split("|").map((t) => t.trim()); for (let i = 0; i < types.length; i++) { @@ -41,7 +41,6 @@ async function resolveProperties(value) { return accum; }, {}); } -exports.resolveProperties = resolveProperties; /** * Assigns the %%values%% to %%target%% as read-only values. * @@ -61,7 +60,6 @@ function defineProperties(target, values, types) { }); } } -exports.defineProperties = defineProperties; function checkProperties(object, properties) { if (!object || typeof object !== "object") { logger.throwArgumentError("invalid object", "object", object); @@ -72,5 +70,8 @@ function checkProperties(object, properties) { } }); } + exports.checkProperties = checkProperties; -//# sourceMappingURL=properties.js.map \ No newline at end of file +exports.defineProperties = defineProperties; +exports.resolveProperties = resolveProperties; +//# sourceMappingURL=properties.js.map diff --git a/lib.commonjs/utils/properties.js.map b/lib.commonjs/utils/properties.js.map index 676a5c087..89bdce968 100644 --- a/lib.commonjs/utils/properties.js.map +++ b/lib.commonjs/utils/properties.js.map @@ -1 +1 @@ -{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":";;;AAAA,mDAA6C;AAE7C;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAI,kBAAM,CAAC,wBAAwB,CAAC,CAAC;AAEpD,SAAS,SAAS,CAAC,KAAU,EAAE,IAAY,EAAE,IAAY;IACvD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,QAAQ,IAAI,EAAE;YACZ,KAAK,KAAK;gBACR,OAAO;YACT,KAAK,QAAQ,CAAC;YACd,KAAK,SAAS,CAAC;YACf,KAAK,QAAQ,CAAC;YACd,KAAK,QAAQ;gBACX,IAAI,OAAO,KAAK,KAAK,IAAI,EAAE;oBACzB,OAAO;iBACR;SACJ;KACF;IAED,MAAM,KAAK,GAAQ,IAAI,KAAK,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;IAC/D,KAAK,CAAC,IAAI,GAAG,kBAAkB,CAAC;IAChC,KAAK,CAAC,QAAQ,GAAG,SAAS,IAAI,EAAE,CAAC;IACjC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IAEpB,MAAM,KAAK,CAAC;AACd,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,iBAAiB,CAAI,KAE1C;IACC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KA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;QAClC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACpB,MAAM,CAAC,kBAAkB,CACvB,uBAAuB,GAAG,GAAG,EAC7B,cAAc,GAAG,GAAG,EACpB,MAAM,CACP,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAjBD,0CAiBC"} \ No newline at end of file +{"version":3,"file":"properties.js","sources":["../../lib.esm/utils/properties.js"],"sourcesContent":["import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map"],"names":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AAQ;AACR,IAAI,CAAC,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/rlp-decode.js b/lib.commonjs/utils/rlp-decode.js index cacc3f487..cadf9dc7e 100644 --- a/lib.commonjs/utils/rlp-decode.js +++ b/lib.commonjs/utils/rlp-decode.js @@ -1,9 +1,8 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeRlp = void 0; -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); -const data_js_2 = require("./data.js"); +'use strict'; + +var data = require('./data.js'); +var errors = require('./errors.js'); + function hexlifyByte(value) { let result = value.toString(16); while (result.length < 2) { @@ -24,7 +23,7 @@ function _decodeChildren(data, offset, childOffset, length) { const decoded = _decode(data, childOffset); result.push(decoded.result); childOffset += decoded.consumed; - (0, errors_js_1.assert)(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { + errors.assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { buffer: data, length, offset, @@ -33,56 +32,57 @@ function _decodeChildren(data, offset, childOffset, length) { return { consumed: 1 + length, result: result }; } // returns { consumed: number, result: Object } -function _decode(data, offset) { - (0, errors_js_1.assert)(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, +function _decode(data$1, offset) { + errors.assert(data$1.length !== 0, "data too short", "BUFFER_OVERRUN", { + buffer: data$1, length: 0, offset: 1, }); const checkOffset = (offset) => { - (0, errors_js_1.assert)(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, - length: data.length, + errors.assert(offset <= data$1.length, "data short segment too short", "BUFFER_OVERRUN", { + buffer: data$1, + length: data$1.length, offset, }); }; // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; + if (data$1[offset] >= 0xf8) { + const lengthLength = data$1[offset] - 0xf7; checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); + const length = unarrayifyInteger(data$1, offset + 1, lengthLength); checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); + return _decodeChildren(data$1, offset, offset + 1 + lengthLength, lengthLength + length); } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; + else if (data$1[offset] >= 0xc0) { + const length = data$1[offset] - 0xc0; checkOffset(offset + 1 + length); - return _decodeChildren(data, offset, offset + 1, length); + return _decodeChildren(data$1, offset, offset + 1, length); } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; + else if (data$1[offset] >= 0xb8) { + const lengthLength = data$1[offset] - 0xb7; checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); + const length = unarrayifyInteger(data$1, offset + 1, lengthLength); checkOffset(offset + 1 + lengthLength + length); - const result = (0, data_js_1.hexlify)(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); + const result = data.hexlify(data$1.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); return { consumed: 1 + lengthLength + length, result: result }; } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; + else if (data$1[offset] >= 0x80) { + const length = data$1[offset] - 0x80; checkOffset(offset + 1 + length); - const result = (0, data_js_1.hexlify)(data.slice(offset + 1, offset + 1 + length)); + const result = data.hexlify(data$1.slice(offset + 1, offset + 1 + length)); return { consumed: 1 + length, result: result }; } - return { consumed: 1, result: hexlifyByte(data[offset]) }; + return { consumed: 1, result: hexlifyByte(data$1[offset]) }; } /** * Decodes %%data%% into the structured data it represents. */ function decodeRlp(_data) { - const data = (0, data_js_2.getBytes)(_data, "data"); - const decoded = _decode(data, 0); - (0, errors_js_1.assertArgument)(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); + const data$1 = data.getBytes(_data, "data"); + const decoded = _decode(data$1, 0); + errors.assertArgument(decoded.consumed === data$1.length, "unexpected junk after rlp payload", "data", _data); return decoded.result; } + exports.decodeRlp = decodeRlp; -//# sourceMappingURL=rlp-decode.js.map \ No newline at end of file +//# sourceMappingURL=rlp-decode.js.map diff --git a/lib.commonjs/utils/rlp-decode.js.map b/lib.commonjs/utils/rlp-decode.js.map index 25b638083..9f33278b8 100644 --- a/lib.commonjs/utils/rlp-decode.js.map +++ b/lib.commonjs/utils/rlp-decode.js.map @@ -1 +1 @@ -{"version":3,"file":"rlp-decode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AACpC,2CAAqD;AACrD,uCAAqC;AAIrC,SAAS,WAAW,CAAC,KAAa;IAChC,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACxB,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;KACvB;IACD,OAAO,IAAI,GAAG,MAAM,CAAC;AACvB,CAAC;AAED,SAAS,iBAAiB,CACxB,IAAgB,EAChB,MAAc,EACd,MAAc;IAEd,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAC1C;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAOD,SAAS,eAAe,CACtB,IAAgB,EAChB,MAAc,EACd,WAAmB,EACnB,MAAc;IAEd,MAAM,MAAM,GAAQ,EAAE,CAAC;IAEvB,OAAO,WAAW,GAAG,MAAM,GAAG,CAAC,GAAG,MAAM,EAAE;QACxC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAE3C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAE5B,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC;QAChC,IAAA,kBAAM,EACJ,W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M,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;KACjD;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,KAAgB;IACxC,MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjC,IAAA,0BAAc,EACZ,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,MAAM,EAChC,mCAAmC,EACnC,MAAM,EACN,KAAK,CACN,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,CAAC;AACxB,CAAC;AAVD,8BAUC"} \ No newline at end of file +{"version":3,"file":"rlp-decode.js","sources":["../../lib.esm/utils/rlp-decode.js"],"sourcesContent":["import { 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,\n length,\n 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,\n length: 0,\n offset: 1,\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data,\n length: data.length,\n 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"],"names":["assert","data","hexlify","getBytes","assertArgument"],"mappings":";;;;;AAGA,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,IAAI,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;AACnC,IAAI,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AAC9B,QAAQ,MAAM,GAAG,GAAG,GAAG,MAAM;AAC7B,IAAI;AACJ,IAAI,OAAO,IAAI,GAAG,MAAM;AACxB;AACA,SAA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AmC,EAAE,MAAM,EAAE,KAAK,CAAC;AACxG,IAAI,OAAO,OAAO,CAAC,MAAM;AACzB;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/rlp-encode.js b/lib.commonjs/utils/rlp-encode.js index 63a001ccd..c3516d8f0 100644 --- a/lib.commonjs/utils/rlp-encode.js +++ b/lib.commonjs/utils/rlp-encode.js @@ -1,7 +1,7 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeRlp = void 0; -const data_js_1 = require("./data.js"); +'use strict'; + +var data = require('./data.js'); + function arrayifyInteger(value) { const result = []; while (value) { @@ -24,17 +24,17 @@ function _encode(object) { length.unshift(0xf7 + length.length); return length.concat(payload); } - const data = Array.prototype.slice.call((0, data_js_1.getBytes)(object, "object")); - if (data.length === 1 && data[0] <= 0x7f) { - return data; + const data$1 = Array.prototype.slice.call(data.getBytes(object, "object")); + if (data$1.length === 1 && data$1[0] <= 0x7f) { + return data$1; } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; + else if (data$1.length <= 55) { + data$1.unshift(0x80 + data$1.length); + return data$1; } - const length = arrayifyInteger(data.length); + const length = arrayifyInteger(data$1.length); length.unshift(0xb7 + length.length); - return length.concat(data); + return length.concat(data$1); } const nibbles = "0123456789abcdef"; /** @@ -48,5 +48,6 @@ function encodeRlp(object) { } return result; } + exports.encodeRlp = encodeRlp; -//# sourceMappingURL=rlp-encode.js.map \ No newline at end of file +//# sourceMappingURL=rlp-encode.js.map diff --git a/lib.commonjs/utils/rlp-encode.js.map b/lib.commonjs/utils/rlp-encode.js.map index 122b77431..401871b88 100644 --- a/lib.commonjs/utils/rlp-encode.js.map +++ b/lib.commonjs/utils/rlp-encode.js.map @@ -1 +1 @@ -{"version":3,"file":"rlp-encode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AAIrC,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,MAAM,GAAQ,EAAE,C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,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAEnC;;GAEG;AACH,SAAgB,SAAS,CAAC,MAAyB;IACjD,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;QAC/B,MAAM,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1B,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;KAC5B;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAPD,8BAOC"} \ No newline at end of file +{"version":3,"file":"rlp-encode.js","sources":["../../lib.esm/utils/rlp-encode.js"],"sourcesContent":["import { 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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AAIA,MAAI,CAAC,MAAM,IAAI,EAAE,EAAE;AAChC,QAAQA,MAAI,CAAC,OAAO,CAAC,IAAI,GAAGA,MAAI,CAAC,MAAM,CAAC;AACxC,QAAQ,OAAOA,MAAI;AACnB,IAAI;AACJ,IAAI,MAAM,MAAM,GAAG,eAAe,CAACA,MAAI,CAAC,MAAM,CAAC;AAC/C,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACxC,IAAI,OAAO,MAAM,CAAC,MAAM,CAACA,MAAI,CAAC;AAC9B;AACA,MAAM,OAAO,GAAG,kBAAkB;AAClC;AACA;AACA;AACO,SAAS,SAAS,CAAC,MAAM,EAAE;AAClC,IAAI,IAAI,MAAM,GAAG,IAAI;AACrB,IAAI,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;AACrC,QAAQ,MAAM,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACjC,QAAQ,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC;AAClC,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/rlp.js b/lib.commonjs/utils/rlp.js index 48eea0d36..9ef537190 100644 --- a/lib.commonjs/utils/rlp.js +++ b/lib.commonjs/utils/rlp.js @@ -1,14 +1,10 @@ -"use strict"; -/** - * The [[link-rlp]] (RLP) encoding is used throughout Core - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeRlp = exports.decodeRlp = void 0; -var rlp_decode_js_1 = require("./rlp-decode.js"); -Object.defineProperty(exports, "decodeRlp", { enumerable: true, get: function () { return rlp_decode_js_1.decodeRlp; } }); -var rlp_encode_js_1 = require("./rlp-encode.js"); -Object.defineProperty(exports, "encodeRlp", { enumerable: true, get: function () { return rlp_encode_js_1.encodeRlp; } }); -//# sourceMappingURL=rlp.js.map \ No newline at end of file +'use strict'; + +var rlpDecode = require('./rlp-decode.js'); +var rlpEncode = require('./rlp-encode.js'); + + + +exports.decodeRlp = rlpDecode.decodeRlp; +exports.encodeRlp = rlpEncode.encodeRlp; +//# sourceMappingURL=rlp.js.map diff --git a/lib.commonjs/utils/rlp.js.map b/lib.commonjs/utils/rlp.js.map index 4e95eb341..96c115a36 100644 --- a/lib.commonjs/utils/rlp.js.map +++ b/lib.commonjs/utils/rlp.js.map @@ -1 +1 @@ -{"version":3,"file":"rlp.js","sourceRoot":"","sources":["../../src.ts/utils/rlp.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,iDAA4C;AAAnC,0GAAA,SAAS,OAAA;AAClB,iDAA4C;AAAnC,0GAAA,SAAS,OAAA"} \ No newline at end of file +{"version":3,"file":"rlp.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/units.d.ts.map b/lib.commonjs/utils/units.d.ts.map index 3db242e6c..fef9d60bc 100644 --- a/lib.commonjs/utils/units.d.ts.map +++ b/lib.commonjs/utils/units.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB/D;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,YAAY,EACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GACtB,MAAM,CAWR;AAED;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,QAAS,MAAM,GAAG,MAAM,oBA6CvD,CAAC;AACF,eAAO,MAAM,YAAY,MAAO,MAAM,8BAQrC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAsBzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"} \ No newline at end of file +{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,YAAY,EACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GACrB,MAAM,CAWR;AAED;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,QAAS,MAAM,GAAG,MAAM,oBA6CvD,CAAC;AACF,eAAO,MAAM,YAAY,MAAO,MAAM,8BAQrC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAsBzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"} \ No newline at end of file diff --git a/lib.commonjs/utils/units.js b/lib.commonjs/utils/units.js index 7dfd6c321..73d396a2e 100644 --- a/lib.commonjs/utils/units.js +++ b/lib.commonjs/utils/units.js @@ -1,6 +1,9 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.parseXCB = exports.formatXCB = exports.parseUnits = exports.trimDecimals = exports.scientificToDecimal = exports.formatUnits = void 0; +'use strict'; + +var errors = require('./errors.js'); +var fixednumber = require('./fixednumber.js'); +var maths = require('./maths.js'); + /** * Most interactions with Core requires integer values, which use * the smallest magnitude unit. @@ -22,9 +25,6 @@ exports.parseXCB = exports.formatXCB = exports.parseUnits = exports.trimDecimals * * @_subsection api/utils:Unit Conversion [about-units] */ -const errors_js_1 = require("./errors.js"); -const fixednumber_js_1 = require("./fixednumber.js"); -const maths_js_1 = require("./maths.js"); const names = [ ///Ore, the smallest and atomic amount of Core "ore", @@ -50,15 +50,14 @@ function formatUnits(value, unit) { let decimals = 18; if (typeof unit === "string") { const index = names.indexOf(unit); - (0, errors_js_1.assertArgument)(index >= 0, "invalid unit", "unit", unit); + errors.assertArgument(index >= 0, "invalid unit", "unit", unit); decimals = 3 * index; } else if (unit != null) { - decimals = (0, maths_js_1.getNumber)(unit, "unit"); + decimals = maths.getNumber(unit, "unit"); } - return fixednumber_js_1.FixedNumber.fromValue(value, decimals, { decimals }).toString(); + return fixednumber.FixedNumber.fromValue(value, decimals, { decimals }).toString(); } -exports.formatUnits = formatUnits; /** * Converts the //decimal string// %%value%% to a BigInt, assuming * %%unit%% decimal places. The %%unit%% may the number of decimal places @@ -113,7 +112,6 @@ const scientificToDecimal = (num) => { // @ts-ignore return nsign < 0 ? "-" + num : num; }; -exports.scientificToDecimal = scientificToDecimal; const trimDecimals = (n, decimals = 18) => { n += ""; if (n.indexOf(".") === -1) @@ -122,33 +120,30 @@ const trimDecimals = (n, decimals = 18) => { const fraction = arr[1].substr(0, decimals); return arr[0] + "." + fraction; }; -exports.trimDecimals = trimDecimals; function parseUnits(value, unit) { - (0, errors_js_1.assertArgument)(typeof value === "string", "value must be a string", "value", value); + errors.assertArgument(typeof value === "string", "value must be a string", "value", value); if (value.includes("e")) { - value = (0, exports.scientificToDecimal)(value).toString(); + value = scientificToDecimal(value).toString(); } let decimals = 18; if (typeof unit === "string") { const index = names.indexOf(unit); - (0, errors_js_1.assertArgument)(index >= 0, "invalid unit", "unit", unit); + errors.assertArgument(index >= 0, "invalid unit", "unit", unit); decimals = 3 * index; - value = (0, exports.trimDecimals)(value, decimals); + value = trimDecimals(value, decimals); } else if (unit != null) { - decimals = (0, maths_js_1.getNumber)(unit, "unit"); - value = (0, exports.trimDecimals)(value, decimals); + decimals = maths.getNumber(unit, "unit"); + value = trimDecimals(value, decimals); } - return fixednumber_js_1.FixedNumber.fromString(value, { decimals }).value; + return fixednumber.FixedNumber.fromString(value, { decimals }).value; } -exports.parseUnits = parseUnits; /** * Converts %%value%% into a //decimal string// using 18 decimal places. */ function formatXCB(ore) { return formatUnits(ore, 18); } -exports.formatXCB = formatXCB; /** * Converts the //decimal string// %%xcb%% to a BigInt, using 18 * decimal places. @@ -156,5 +151,11 @@ exports.formatXCB = formatXCB; function parseXCB(xcb) { return parseUnits(xcb, 18); } + +exports.formatUnits = formatUnits; +exports.formatXCB = formatXCB; +exports.parseUnits = parseUnits; exports.parseXCB = parseXCB; -//# sourceMappingURL=units.js.map \ No newline at end of file +exports.scientificToDecimal = scientificToDecimal; +exports.trimDecimals = trimDecimals; +//# sourceMappingURL=units.js.map diff --git a/lib.commonjs/utils/units.js.map b/lib.commonjs/utils/units.js.map index 5787d59c9..936c8a909 100644 --- a/lib.commonjs/utils/units.js.map +++ b/lib.commonjs/utils/units.js.map @@ -1 +1 @@ -{"version":3,"file":"units.js","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,2CAA6C;AAC7C,qDAA+C;AAC/C,yCAAuC;AAIvC,MAAM,KAAK,GAAG;IACZ,8CAA8C;IAC9C,KAAK;IAEL,mBAAmB;IACnB,QAAQ;IAER,0BAA0B;IAC1B,QAAQ;IAER,iFAAiF;IACjF,QAAQ;IAER,8BAA8B;IAC9B,OAAO;IAEP,+BAA+B;IAC/B,QAAQ;IAER,MAAM;CACP,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,WAAW,CACzB,KAAmB,EACnB,IAAuB;IAEvB,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClC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,CAAC;KACvC;IAED,OAAO,4BAAW,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC;AAC3D,CAAC;AAtBD,gCAsBC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,GAAiB;IACzC,OAAO,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC9B,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,QAAQ,CAAC,GAAW;IAClC,OAAO,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAFD,4BAEC"} \ No newline at end of file +{"version":3,"file":"units.js","sources":["../../lib.esm/utils/units.js"],"sourcesContent":["/**\n * Most interactions with Core requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Core, //Core// is divisible to 18 decimal places,\n * where each individual unit is called a //ore//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n ///Ore, the smallest and atomic amount of Core\n \"ore\",\n ///fecore, 1000 ore\n \"fecore\",\n ///Picore, one million ore\n \"picore\",\n ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices.\n \"nacore\",\n ///Μcore, 10^12 ore or 1 μCore\n \"mcore\",\n ///micore, 10^15 ore or 1 mcore\n \"micore\",\n \"core\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit.\n */\nexport const scientificToDecimal = (num) => {\n // @ts-ignore\n var nsign = Math.sign(num);\n //remove the sign\n // @ts-ignore\n num = Math.abs(num);\n //if the number is in scientific notation remove it\n // @ts-ignore\n if (/\\d+\\.?\\d*e[\\+\\-]*\\d+/i.test(num)) {\n var zero = \"0\", \n // @ts-ignore\n parts = String(num).toLowerCase().split(\"e\"), //split into coeff and exponent\n e = parts.pop(), //store the exponential part\n // @ts-ignore\n l = Math.abs(e), //get the number of zeros\n // @ts-ignore\n sign = e / l, coeff_array = parts[0].split(\".\");\n if (sign === -1) {\n l = l - coeff_array[0].length;\n if (l < 0) {\n // @ts-ignore\n num =\n coeff_array[0].slice(0, l) +\n \".\" +\n coeff_array[0].slice(l) +\n (coeff_array.length === 2 ? coeff_array[1] : \"\");\n }\n else {\n // @ts-ignore\n num = zero + \".\" + new Array(l + 1).join(zero) + coeff_array.join(\"\");\n }\n }\n else {\n var dec = coeff_array[1];\n if (dec)\n l = l - dec.length;\n if (l < 0) {\n // @ts-ignore\n num = coeff_array[0] + dec.slice(0, l) + \".\" + dec.slice(l);\n }\n else {\n // @ts-ignore\n num = coeff_array.join(\"\") + new Array(l + 1).join(zero);\n }\n }\n }\n // @ts-ignore\n return nsign < 0 ? \"-\" + num : num;\n};\nexport const trimDecimals = (n, decimals = 18) => {\n n += \"\";\n if (n.indexOf(\".\") === -1)\n return n;\n const arr = n.split(\".\");\n const fraction = arr[1].substr(0, decimals);\n return arr[0] + \".\" + fraction;\n};\nexport function parseUnits(value, unit) {\n assertArgument(typeof value === \"string\", \"value must be a string\", \"value\", value);\n if (value.includes(\"e\")) {\n value = scientificToDecimal(value).toString();\n }\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n value = trimDecimals(value, decimals);\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n value = trimDecimals(value, decimals);\n }\n return FixedNumber.fromString(value, { decimals }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatXCB(ore) {\n return formatUnits(ore, 18);\n}\n/**\n * Converts the //decimal string// %%xcb%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseXCB(xcb) {\n return parseUnits(xcb, 18);\n}\n//# sourceMappingURL=units.js.map"],"names":["assertArgument","getNumber","FixedNumber"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,MAAM,KAAK,GAAG;AACd;AACA,IAAI,KAAK;AACT;AACA,IAAI,QAAQ;AACZ;AACA,IAAI,QAAQ;AACZ;AACA,IAAI,QAAQ;AACZ;AACA,IAAI,OAAO;AACX;AACA,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE;AACzC,IAAI,IAAI,QAAQ,GAAG,EAAE;AACrB,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAClC,QAAQ,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;AACzC,QAAQA,qBAAc,CAAC,KAAK,IAAI,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC;AAChE,QAAQ,QAAQ,GAAG,CAAC,GAAG,KAAK;AAC5B,IAAI;AACJ,SAAS,IAAI,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SAAS,QAAQ,CAAC,GAAG,EAAE;AAC9B,IAAI,OAAO,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;AAC9B;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/utf8.d.ts.map b/lib.commonjs/utils/utf8.d.ts.map index f79c87b2e..febc8e114 100644 --- a/lib.commonjs/utils/utf8.d.ts.map +++ b/lib.commonjs/utils/utf8.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"utf8.d.ts","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,eAAe,GACvB,qBAAqB,GACrB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,UAAU,CAAC;AAEf;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EACrB,YAAY,CAAC,EAAE,MAAM,KAClB,MAAM,CAAC;AAwEZ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,aAAa,CAAC,CAKrD,CAAC;AA2GH;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC9B,UAAU,CAwCZ;AAkBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,E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AAC,EAAE,wBAAwB,GAC7B,KAAK,CAAC,MAAM,CAAC,CAEf"} \ No newline at end of file diff --git a/lib.commonjs/utils/utf8.js b/lib.commonjs/utils/utf8.js index 935ce193d..97cc256e9 100644 --- a/lib.commonjs/utils/utf8.js +++ b/lib.commonjs/utils/utf8.js @@ -1,6 +1,8 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toUtf8CodePoints = exports.toUtf8String = exports.toUtf8Bytes = exports.Utf8ErrorFuncs = void 0; +'use strict'; + +var data = require('./data.js'); +var errors = require('./errors.js'); + /** * Using strings in Core (or any security-basd system) requires * additional care. These utilities attempt to mitigate some of the @@ -9,10 +11,8 @@ exports.toUtf8CodePoints = exports.toUtf8String = exports.toUtf8Bytes = exports. * * @_subsection api/utils:Strings and UTF-8 [about-strings] */ -const data_js_1 = require("./data.js"); -const errors_js_1 = require("./errors.js"); function errorFunc(reason, offset, bytes, output, badCodepoint) { - (0, errors_js_1.assertArgument)(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); + errors.assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); } function ignoreFunc(reason, offset, bytes, output, badCodepoint) { // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes @@ -37,14 +37,14 @@ function ignoreFunc(reason, offset, bytes, output, badCodepoint) { function replaceFunc(reason, offset, bytes, output, badCodepoint) { // Overlong representations are otherwise "valid" code points; just non-deistingtished if (reason === "OVERLONG") { - (0, errors_js_1.assertArgument)(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); + errors.assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); output.push(badCodepoint); return 0; } // Put the replacement character into the output output.push(0xfffd); // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes, output, badCodepoint); + return ignoreFunc(reason, offset, bytes); } /** * A handful of popular, built-in UTF-8 error handling strategies. @@ -61,7 +61,7 @@ function replaceFunc(reason, offset, bytes, output, badCodepoint) { * * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> */ -exports.Utf8ErrorFuncs = Object.freeze({ +const Utf8ErrorFuncs = Object.freeze({ error: errorFunc, ignore: ignoreFunc, replace: replaceFunc, @@ -69,9 +69,9 @@ exports.Utf8ErrorFuncs = Object.freeze({ // http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 function getUtf8CodePoints(_bytes, onError) { if (onError == null) { - onError = exports.Utf8ErrorFuncs.error; + onError = Utf8ErrorFuncs.error; } - const bytes = (0, data_js_1.getBytes)(_bytes, "bytes"); + const bytes = data.getBytes(_bytes, "bytes"); const result = []; let i = 0; // Invalid bytes are ignored @@ -158,7 +158,7 @@ function getUtf8CodePoints(_bytes, onError) { */ function toUtf8Bytes(str, form) { if (form != null) { - (0, errors_js_1.assertNormalize)(form); + errors.assertNormalize(form); str = str.normalize(form); } let result = []; @@ -174,7 +174,7 @@ function toUtf8Bytes(str, form) { else if ((c & 0xfc00) == 0xd800) { i++; const c2 = str.charCodeAt(i); - (0, errors_js_1.assertArgument)(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); + errors.assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); // Surrogate Pair const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); result.push((pair >> 18) | 0xf0); @@ -190,7 +190,6 @@ function toUtf8Bytes(str, form) { } return new Uint8Array(result); } -exports.toUtf8Bytes = toUtf8Bytes; //export function _toUtf8String(codePoints) { return codePoints @@ -213,7 +212,6 @@ function _toUtf8String(codePoints) { function toUtf8String(bytes, onError) { return _toUtf8String(getUtf8CodePoints(bytes, onError)); } -exports.toUtf8String = toUtf8String; /** * Returns the UTF-8 code-points for %%str%%. * @@ -222,5 +220,9 @@ exports.toUtf8String = toUtf8String; function toUtf8CodePoints(str, form) { return getUtf8CodePoints(toUtf8Bytes(str, form)); } + +exports.Utf8ErrorFuncs = Utf8ErrorFuncs; +exports.toUtf8Bytes = toUtf8Bytes; exports.toUtf8CodePoints = toUtf8CodePoints; -//# sourceMappingURL=utf8.js.map \ No newline at end of file +exports.toUtf8String = toUtf8String; +//# sourceMappingURL=utf8.js.map diff --git a/lib.commonjs/utils/utf8.js.map b/lib.commonjs/utils/utf8.js.map index 2a9697302..8f0a35e66 100644 --- a/lib.commonjs/utils/utf8.js.map +++ b/lib.commonjs/utils/utf8.js.map @@ -1 +1 @@ -{"version":3,"file":"utf8.js","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,uCAAqC;AACrC,2CAA8D;AAgF9D,SAAS,SAAS,CAChB,MAAuB,EACvB,MAAc,EACd,KAAiB,EACjB,MAAqB,EACrB,YAAqB;IAErB,IAAA,0BAAc,EACZ,KAAK,EACL,+BAA+B,MAAM,KAAK,MAAM,EAAE,EAClD,OAAO,EACP,KAAK,CACN,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CACjB,MAAuB,EACvB,MAAc,EACd,KAAiB,EACjB,MAAqB,EACrB,YAAqB;IAErB,uGAAuG;IACvG,IAAI,MAAM,KAAK,YAAY,IAAI,MAAM,KAAK,qBAAqB,EAAE;QAC/D,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,KAAK,IAAI,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC9C,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;gBAC1B,MAAM;aACP;YACD,CAAC,EAAE,CAAC;SACL;QACD,OAAO,CAAC,CAAC;KACV;IAED,wEAAwE;IACxE,mEAAmE;IACnE,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC;KAClC;IAED,kBAAkB;IAClB,OAAO,CAAC,CAAC;A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B,gBAAgB,CAC9B,GAAW,EACX,IAA+B;IAE/B,OAAO,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACnD,CAAC;AALD,4CAKC"} \ No newline at end of file +{"version":3,"file":"utf8.js","sources":["../../lib.esm/utils/utf8.js"],"sourcesContent":["/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map"],"names":["assertArgument","getBytes","assertNormalize"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAAS,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE;AAChE,IAAIA,qBAAc,CAAC,KAAK,EAAE,CAAC,4BAA4B,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC;AAC7F;AACA,SAAS,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE;AACjE;AACA,IAAI,IAAI,MAAM,KAAK,YAAY,IAAI,MAAM,KAAK,qBAAqB,EAAE;AACrE,QAAQ,IAAI,CAAC,GAAG,CAAC;AACjB,QAAQ,KAAK,IAAI,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACxD,YAAY,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;AACxC,gBAAgB;AAChB,YAAY;AACZ,YAAY,CA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;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE;AAC7C,IAAI,OAAO,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE;AAC5C,IAAI,OAAO,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACpD;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/uuid.js b/lib.commonjs/utils/uuid.js index b02f3b6cd..865e3d08d 100644 --- a/lib.commonjs/utils/uuid.js +++ b/lib.commonjs/utils/uuid.js @@ -1,19 +1,19 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.uuidV4 = void 0; +'use strict'; + +var data = require('./data.js'); + /** * Explain UUID and link to RFC here. * * @_subsection: api/utils:UUID [about-uuid] */ -const data_js_1 = require("./data.js"); /** * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. * * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) */ function uuidV4(randomBytes) { - const bytes = (0, data_js_1.getBytes)(randomBytes, "randomBytes"); + const bytes = data.getBytes(randomBytes, "randomBytes"); // Section: 4.1.3: // - time_hi_and_version[12:16] = 0b0100 bytes[6] = (bytes[6] & 0x0f) | 0x40; @@ -21,7 +21,7 @@ function uuidV4(randomBytes) { // - clock_seq_hi_and_reserved[6] = 0b0 // - clock_seq_hi_and_reserved[7] = 0b1 bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = (0, data_js_1.hexlify)(bytes); + const value = data.hexlify(bytes); return [ value.substring(2, 10), value.substring(10, 14), @@ -30,5 +30,6 @@ function uuidV4(randomBytes) { value.substring(22, 34), ].join("-"); } + exports.uuidV4 = uuidV4; -//# sourceMappingURL=uuid.js.map \ No newline at end of file +//# sourceMappingURL=uuid.js.map diff --git a/lib.commonjs/utils/uuid.js.map b/lib.commonjs/utils/uuid.js.map index 5d654455a..b87f40c09 100644 --- a/lib.commonjs/utils/uuid.js.map +++ b/lib.commonjs/utils/uuid.js.map @@ -1 +1 @@ -{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,uCAA8C;AAI9C;;;;GAIG;AACH,SAAgB,MAAM,CAAC,WAAsB;IAC3C,MAAM,KAAK,GAAG,IAAA,kBAAQ,EAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEnD,kBAAkB;IAClB,wCAAwC;IACxC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,cAAc;IACd,uCAAuC;IACvC,uCAAuC;IACvC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,MAAM,KAAK,GAAG,IAAA,iBAAO,EAAC,KAAK,CAAC,CAAC;IAE7B,OAAO;QACL,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;QACtB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;KACxB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AArBD,wBAqBC"} \ No newline at end of file +{"version":3,"file":"uuid.js","sources":["../../lib.esm/utils/uuid.js"],"sourcesContent":["/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map"],"names":["getBytes","hexlify"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,WAAW,EAAE;AACpC,IAAI,MAAM,KAAK,GAAGA,aAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;AACtD;AACA;AACA,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI;AACvC;AACA;AACA;AACA,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI;AACvC,IAAI,MAAM,KAAK,GAAGC,YAAO,CAAC,KAAK,CAAC;AAChC,IAAI,OAAO;AACX,QAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;AAC9B,QAAQ,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AAC/B,QAAQ,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AAC/B,QAAQ,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AAC/B,QAAQ,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACf;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/base-wallet.d.ts.map b/lib.commonjs/wallet/base-wallet.d.ts.map index dc25c591a..9b7a9bb96 100644 --- a/lib.commonjs/wallet/base-wallet.d.ts.map +++ b/lib.commonjs/wallet/base-wallet.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"base-wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AASvD,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG1E;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,cAAc;;IAC5C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAIxB;;;;;;OAMG;gBACS,EACV,UAAU,EACV,MAAM,EACN,QAAQ,GACT,EAAE;QACD,UAAU,EAAE,UAAU,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC5B;IAmBD;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU;IAQxC,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAgCxD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO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AkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAID;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAEpD;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAgCjB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wallet/base-wallet.js b/lib.commonjs/wallet/base-wallet.js index 04918dc0b..7e35967e6 100644 --- a/lib.commonjs/wallet/base-wallet.js +++ b/lib.commonjs/wallet/base-wallet.js @@ -1,12 +1,41 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BaseWallet = void 0; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../hash/index.js"); -const index_js_3 = require("../providers/index.js"); -const index_js_4 = require("../transaction/index.js"); -const index_js_5 = require("../utils/index.js"); -const index_js_6 = require("../crypto/index.js"); +'use strict'; + +var index = require('../address/index.js'); +require('../crypto/keccak.js'); +var sha3 = require('../crypto/sha3.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var message = require('../hash/message.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/signature.js'); +var typedData = require('../hash/typed-data.js'); +var address = require('../transaction/address.js'); +var transaction = require('../transaction/transaction.js'); +require('../providers/format.js'); +require('../providers/provider.js'); +var abstractSigner = require('../providers/abstract-signer.js'); +require('../abi/abi-coder.js'); +require('../abi/fragments.js'); +require('ws'); +require('../providers/provider-fallback.js'); +require('net'); + /** * The **BaseWallet** is a stream-lined implementation of a * [[Signer]] that operates with a private key. @@ -18,7 +47,7 @@ const index_js_6 = require("../crypto/index.js"); * This class may be of use for those attempting to implement * a minimal Signer. */ -class BaseWallet extends index_js_3.AbstractSigner { +class BaseWallet extends abstractSigner.AbstractSigner { /** * The wallet address. */ @@ -35,10 +64,10 @@ class BaseWallet extends index_js_3.AbstractSigner { constructor({ signingKey, prefix, provider, }) { super(provider); this.prefix = prefix; - (0, index_js_5.assertArgument)(signingKey && typeof signingKey.sign === "function", "invalid signingKey key", "signingKey", "[ REDACTED ]"); + errors.assertArgument(signingKey && typeof signingKey.sign === "function", "invalid signingKey key", "signingKey", "[ REDACTED ]"); this.#signingKey = signingKey; - const address = (0, index_js_4.computeAddress)(this.#signingKey, prefix); - (0, index_js_5.defineProperties)(this, { address }); + const address$1 = address.computeAddress(this.#signingKey, prefix); + properties.defineProperties(this, { address: address$1 }); } // Store private values behind getters to reduce visibility // in console.log @@ -66,7 +95,7 @@ class BaseWallet extends index_js_3.AbstractSigner { } async signTransaction(tx) { // Replace any Addressable or ENS name with an address - const { to, from } = await (0, index_js_5.resolveProperties)({ + const { to, from } = await properties.resolveProperties({ to: tx.to || undefined, from: tx.from || undefined, }); @@ -77,13 +106,13 @@ class BaseWallet extends index_js_3.AbstractSigner { tx.from = from; } if (tx.from != null) { - (0, index_js_5.assertArgument)((0, index_js_1.getAddress)(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); + errors.assertArgument(index.getAddress(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); delete tx.from; } // Build the transaction - const btx = index_js_4.Transaction.from(tx); + const btx = transaction.Transaction.from(tx); const unSignedSerialized = btx.unsignedSerialized; - const unsignedHash = (0, index_js_6.sha256)(unSignedSerialized); + const unsignedHash = sha3.sha256(unSignedSerialized); // sha256(btx.unsignedSerialized) btx.signature = this.signingKey.sign(unsignedHash); return btx.serialized; @@ -96,26 +125,27 @@ class BaseWallet extends index_js_3.AbstractSigner { /** * Returns the signature for %%message%% signed with this wallet. */ - signMessageSync(message) { - return this.signingKey.sign((0, index_js_2.hashMessage)(message)); + signMessageSync(message$1) { + return this.signingKey.sign(message.hashMessage(message$1)); } async signTypedData(domain, types, value) { // Populate any ENS names - const populated = await index_js_2.TypedDataEncoder.resolveNames(domain, types, value, async (name) => { + const populated = await typedData.TypedDataEncoder.resolveNames(domain, types, value, async (name) => { // @TODO: this should use resolveName; addresses don't // need a provider - (0, index_js_5.assert)(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { + errors.assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { operation: "resolveName", info: { name }, }); - const address = (0, index_js_1.getAddress)(name); - (0, index_js_5.assert)(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { + const address = index.getAddress(name); + errors.assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { value: name, }); return address; }); - return this.signingKey.sign(index_js_2.TypedDataEncoder.hash(populated.domain, types, populated.value)); + return this.signingKey.sign(typedData.TypedDataEncoder.hash(populated.domain, types, populated.value)); } } + exports.BaseWallet = BaseWallet; -//# sourceMappingURL=base-wallet.js.map \ No newline at end of file +//# sourceMappingURL=base-wallet.js.map diff --git a/lib.commonjs/wallet/base-wallet.js.map b/lib.commonjs/wallet/base-wallet.js.map index c148eff0e..77e7e19e5 100644 --- a/lib.commonjs/wallet/base-wallet.js.map +++ b/lib.commonjs/wallet/base-wallet.js.map @@ -1 +1 @@ -{"version":3,"file":"base-wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":";;;AAAA,kDAAiD;AACjD,+CAAiE;AACjE,oDAAuD;AACv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BAAgB,CAAC,YAAY,CACnD,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EAAE,IAAY,EAAE,EAAE;YACrB,sDAAsD;YACtD,yBAAyB;YAEzB,IAAA,iBAAM,EACJ,IAAI,CAAC,QAAQ,IAAI,IAAI,EACrB,6CAA6C,EAC7C,uBAAuB,EACvB;gBACE,SAAS,EAAE,aAAa;gBACxB,IAAI,EAAE,EAAE,IAAI,EAAE;aACf,CACF,CAAC;YAEF,MAAM,OAAO,GAAG,IAAA,qBAAU,EAAC,IAAI,CAAC,CAAC;YACjC,IAAA,iBAAM,EAAC,OAAO,IAAI,IAAI,EAAE,uBAAuB,EAAE,mBAAmB,EAAE;gBACpE,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC;QACjB,CAAC,CACF,CAAC;QAEF,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CACzB,2BAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAChE,CAAC;IACJ,CAAC;CACF;AAvJD,gCAuJC"} \ No newline at end of file +{"version":3,"file":"base-wallet.js","sources":["../../lib.esm/wallet/base-wallet.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, resolveProperties, assert, assertArgument, } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n prefix;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor({ signingKey, prefix, provider, }) {\n super(provider);\n this.prefix = prefix;\n assertArgument(signingKey && typeof signingKey.sign === \"function\", \"invalid signingKey key\", \"signingKey\", \"[ REDACTED ]\");\n this.#signingKey = signingKey;\n const address = computeAddress(this.#signingKey, prefix);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() {\n return this.#signingKey;\n }\n /**\n * The private key for this wallet.\n */\n get privateKey() {\n return this.signingKey.privateKey;\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new BaseWallet({\n signingKey: this.#signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n async signTransaction(tx) {\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: tx.to || undefined,\n from: tx.from || undefined,\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress(tx.from) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n const unSignedSerialized = btx.unsignedSerialized;\n const unsignedHash = sha256(unSignedSerialized);\n // sha256(btx.unsignedSerialized)\n btx.signature = this.signingKey.sign(unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name },\n });\n const address = getAddress(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name,\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value));\n }\n}\n//# sourceMappingURL=base-wallet.js.map"],"names":["AbstractSigner","assertArgument","address","computeAddress","defineProperties","resolveProperties","getAddress","Transaction","sha256","message","hashMessage","TypedDataEncoder","assert"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,UAAU,SAASA,6BAAc,CAAC;AAC/C;AACA;AACA;AACA,IAAI,OAAO;AACX,IAAI,MAAM;AACV,IAAI,WAAW;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,GAAG,EAAE;AACnD,QAAQ,KAAK,CAAC,QAAQ,CAAC;AACvB,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM;AAC5B,QAAQC,qBAAc,CAAC,UAAU,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,UAAU,EAAE,wBAAwB,EAAE,YAAY,EAAE,cAAc,CAAC;AACnI,QAAQ,IAAI,CAAC,WAAW,GAAG,UAAU;AACrC,QAAQ,MAAMC,SAAO,GAAGC,sBAAc,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;AAChE,QAAQC,2BAAgB,CAAC,IAAI,EAAE,WAAEF,SAAO,EAAE,CAAC;AAC3C,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW;AAC/B,IAAI;AACJ;AACA;AACA;AACA,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU;AACzC,IAAI;AACJ,IAAI,MAAM,UA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/lib.commonjs/wallet/english_words.d.ts.map +++ b/lib.commonjs/wallet/english_words.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"english_words.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,i0VACuyV,CAAC"} \ No newline at end of file +{"version":3,"file":"english_words.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,i0VACsyV,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wallet/english_words.js b/lib.commonjs/wallet/english_words.js index 0b1a3d3f9..bef513a7d 100644 --- a/lib.commonjs/wallet/english_words.js +++ b/lib.commonjs/wallet/english_words.js @@ -1,5 +1,6 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.englishWords = void 0; -exports.englishWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=english_words.js.map \ No newline at end of file +'use strict'; + +const englishWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; + +exports.englishWords = englishWords; +//# sourceMappingURL=english_words.js.map diff --git a/lib.commonjs/wallet/english_words.js.map b/lib.commonjs/wallet/english_words.js.map index c6e825f0f..8e1a05059 100644 --- a/lib.commonjs/wallet/english_words.js.map +++ b/lib.commonjs/wallet/english_words.js.map @@ -1 +1 @@ -{"version":3,"file":"english_words.js","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GACvB,8zVAA8zV,CAAC"} \ No newline at end of file +{"version":3,"file":"english_words.js","sources":["../../lib.esm/wallet/english_words.js"],"sourcesContent":["export const englishWords = \"AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo\";\n//# sourceMappingURL=english_words.js.map"],"names":[],"mappings":";;AAAY,MAAC,YAAY,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/hdwallet.d.ts.map b/lib.commonjs/wallet/hdwallet.d.ts.map index cc249d4de..6ff875955 100644 --- a/lib.commonjs/wallet/hdwallet.d.ts.map +++ b/lib.commonjs/wallet/hdwallet.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hdw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AED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAS7D"} \ No newline at end of file diff --git a/lib.commonjs/wallet/hdwallet.js b/lib.commonjs/wallet/hdwallet.js index 4d09e8a58..96a7900c5 100644 --- a/lib.commonjs/wallet/hdwallet.js +++ b/lib.commonjs/wallet/hdwallet.js @@ -1,19 +1,37 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getIndexedAccountPath = exports.getAccountPath = exports.HDNodeWallet = exports.defaultPath = void 0; +'use strict'; + +require('../crypto/hmac.js'); +var ripemd160 = require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +var random = require('../crypto/random.js'); +require('../crypto/scrypt.js'); +var sha3 = require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +var ed448goldilock = require('../crypto/ed448goldilock.js'); +require('crypto'); +require('../crypto/keccak.js'); +var signingKey = require('../crypto/signing-key.js'); +require('../crypto/signature.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +var maths = require('../utils/maths.js'); +var langEn = require('../wordlists/lang-en.js'); +var baseWallet = require('./base-wallet.js'); +var mnemonic = require('./mnemonic.js'); +var jsonKeystore = require('./json-keystore.js'); +var mnemonicToSeed = require('./mnemonicToSeed.js'); + /** * Explain HD Wallets.. * * @_subsection: api/wallet:HD Wallets [hd-wallets] */ -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../utils/index.js"); -const lang_en_js_1 = require("../wordlists/lang-en.js"); -const base_wallet_js_1 = require("./base-wallet.js"); -const mnemonic_js_1 = require("./mnemonic.js"); -const json_keystore_js_1 = require("./json-keystore.js"); -const crypto_js_1 = require("../crypto/crypto.js"); -const mnemonicToSeed_js_1 = require("./mnemonicToSeed.js"); // import { arrayify, // // hexDataSlice // } from "../utils/data.js"; @@ -25,7 +43,7 @@ const mnemonicToSeed_js_1 = require("./mnemonicToSeed.js"); /** * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) */ -exports.defaultPath = "m"; +const defaultPath = "m"; // "Bitcoin seed" // const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); const HardenedBit = 0x80000000; @@ -44,7 +62,7 @@ const HardenedBit = 0x80000000; const _guard = {}; function derivePath(node, path) { const components = path.split("/"); - (0, index_js_2.assertArgument)(components.length > 0 && (components[0] === "m" || node.depth > 0), "invalid path", "path", path); + errors.assertArgument(components.length > 0 && (components[0] === "m" || node.depth > 0), "invalid path", "path", path); if (components[0] === "m") { components.shift(); } @@ -53,16 +71,16 @@ function derivePath(node, path) { const component = components[i]; if (component.match(/^[0-9]+'$/)) { const index = parseInt(component.substring(0, component.length - 1)); - (0, index_js_2.assertArgument)(index < HardenedBit, "invalid path index", `path[${i}]`, component); + errors.assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); result = result.deriveChild(HardenedBit + index); } else if (component.match(/^[0-9]+$/)) { const index = parseInt(component); - (0, index_js_2.assertArgument)(index < HardenedBit, "invalid path index", `path[${i}]`, component); + errors.assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); result = result.deriveChild(index); } else { - (0, index_js_2.assertArgument)(false, "invalid path component", `path[${i}]`, component); + errors.assertArgument(false, "invalid path component", `path[${i}]`, component); } } return result; @@ -75,7 +93,7 @@ function derivePath(node, path) { * private key and the ability to derive child HD Nodes, defined by * a path indicating the index of each child. */ -class HDNodeWallet extends base_wallet_js_1.BaseWallet { +class HDNodeWallet extends baseWallet.BaseWallet { /** * The compressed public key. */ @@ -128,19 +146,19 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { prefix, provider, }); - (0, index_js_2.assertPrivate)(guard, _guard, "HDNodeWallet"); - (0, index_js_2.defineProperties)(this, { publicKey: signingKey.publicKey }); + errors.assertPrivate(guard, _guard, "HDNodeWallet"); + properties.defineProperties(this, { publicKey: signingKey.publicKey }); this.prefix = prefix; this.#seed = seed; - const fingerprint = (0, index_js_2.dataSlice)((0, index_js_1.ripemd160)((0, index_js_1.sha256)(this.publicKey)), 0, 4); - (0, index_js_2.defineProperties)(this, { + const fingerprint = data.dataSlice(ripemd160.ripemd160(sha3.sha256(this.publicKey)), 0, 4); + properties.defineProperties(this, { parentFingerprint, fingerprint, path, index, depth, }); - (0, index_js_2.defineProperties)(this, { mnemonic }); + properties.defineProperties(this, { mnemonic }); } connect(provider) { return new HDNodeWallet({ @@ -179,7 +197,7 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { * updates as the encryption process progreses. */ async encrypt(password, progressCallback) { - return await (0, json_keystore_js_1.encryptKeystoreJson)(this.#account(), password, { + return await jsonKeystore.encryptKeystoreJson(this.#account(), password, { progressCallback, }); } @@ -194,7 +212,7 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { * it is complete, which may be a non-trivial duration. */ encryptSync(password) { - return (0, json_keystore_js_1.encryptKeystoreJsonSync)(this.#account(), password); + return jsonKeystore.encryptKeystoreJsonSync(this.#account(), password); } /** * Returns true if this wallet has a path, providing a Type Guard @@ -207,8 +225,8 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { * Return the child for %%index%%. */ deriveChild(_index) { - const newPrivateKey = crypto_js_1.Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index)); - const newSigningKey = new index_js_1.SigningKey(newPrivateKey); + const newPrivateKey = ed448goldilock.Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index)); + const newSigningKey = new signingKey.SigningKey(newPrivateKey); // Base path let path = this.path; if (path) { @@ -237,15 +255,15 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { return derivePath(this, path); } static #fromSeed({ _seed, mnemonic, prefix, path, }) { - const extendetPrivateKey = crypto_js_1.Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0); - const signingKey = new index_js_1.SigningKey(extendetPrivateKey); + const extendetPrivateKey = ed448goldilock.Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0); + const signingKey$1 = new signingKey.SigningKey(extendetPrivateKey); // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length }) return new HDNodeWallet({ seed: _seed, guard: _guard, - signingKey, + signingKey: signingKey$1, parentFingerprint: "0x00000000", - path: path || exports.defaultPath, + path: path || defaultPath, index: 0, depth: 0, mnemonic, @@ -261,15 +279,15 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { password = ""; } if (path == null) { - path = exports.defaultPath; + path = defaultPath; } if (wordlist == null) { - wordlist = lang_en_js_1.LangEn.wordlist(); + wordlist = langEn.LangEn.wordlist(); } - const mnemonic = mnemonic_js_1.Mnemonic.fromEntropy((0, index_js_1.randomBytes)(32), password, wordlist); + const mnemonic$1 = mnemonic.Mnemonic.fromEntropy(random.randomBytes(32), password, wordlist); return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, + _seed: mnemonic$1.computeSeed(), + mnemonic: mnemonic$1, prefix, }).derivePath(path); } @@ -278,7 +296,7 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { */ static fromMnemonic(mnemonic, prefix, path) { if (!path) { - path = exports.defaultPath; + path = defaultPath; } return HDNodeWallet.#fromSeed({ _seed: mnemonic.computeSeed(), @@ -287,7 +305,7 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { }).derivePath(path); } static mnemonicToSeed(mnemonic, password) { - const seed = (0, mnemonicToSeed_js_1.mnemonicToSeed)(mnemonic, password); + const seed = mnemonicToSeed.mnemonicToSeed(mnemonic, password); return seed; } /** @@ -298,16 +316,16 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { password = ""; } if (!path) { - path = exports.defaultPath; + path = defaultPath; } if (!wordlist) { - wordlist = lang_en_js_1.LangEn.wordlist(); + wordlist = langEn.LangEn.wordlist(); } - const mnemonic = mnemonic_js_1.Mnemonic.fromPhrase({ phrase, password, wordlist }); - const _seed = mnemonic.computeSeed(); + const mnemonic$1 = mnemonic.Mnemonic.fromPhrase({ phrase, password, wordlist }); + const _seed = mnemonic$1.computeSeed(); return HDNodeWallet.#fromSeed({ _seed, - mnemonic, + mnemonic: mnemonic$1, prefix, }).derivePath(path); } @@ -318,12 +336,11 @@ class HDNodeWallet extends base_wallet_js_1.BaseWallet { return HDNodeWallet.#fromSeed({ _seed: seed, mnemonic: null, - path: path || exports.defaultPath, + path: path || defaultPath, prefix, }); } } -exports.HDNodeWallet = HDNodeWallet; /* export class HDNodeWalletManager { #root: HDNodeWallet; @@ -349,11 +366,10 @@ export class HDNodeWalletManager { * some software. */ function getAccountPath(_index) { - const index = (0, index_js_2.getNumber)(_index, "index"); - (0, index_js_2.assertArgument)(index >= 0 && index < HardenedBit, "invalid account index", "index", index); + const index = maths.getNumber(_index, "index"); + errors.assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); return `m/44'/60'/${index}'/0/0`; } -exports.getAccountPath = getAccountPath; /** * Returns the path using an alternative pattern for deriving accounts, * at %%index%%. @@ -364,9 +380,13 @@ exports.getAccountPath = getAccountPath; * This is the pattern used by wallets like MetaMask. */ function getIndexedAccountPath(_index) { - const index = (0, index_js_2.getNumber)(_index, "index"); - (0, index_js_2.assertArgument)(index >= 0 && index < HardenedBit, "invalid account index", "index", index); + const index = maths.getNumber(_index, "index"); + errors.assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); return `m/44'/60'/0'/0/${index}`; } + +exports.HDNodeWallet = HDNodeWallet; +exports.defaultPath = defaultPath; +exports.getAccountPath = getAccountPath; exports.getIndexedAccountPath = getIndexedAccountPath; -//# sourceMappingURL=hdwallet.js.map \ No newline at end of file +//# sourceMappingURL=hdwallet.js.map diff --git a/lib.commonjs/wallet/hdwallet.js.map b/lib.commonjs/wallet/hdwallet.js.map index a607be3b9..5f1d3e330 100644 --- a/lib.commonjs/wallet/hdwallet.js.map +++ b/lib.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E,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrE,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;QACrC,OAAO,YAAY,CAAC,SAAS,CAAC;YAC5B,KAAK;YACL,QAAQ;YACR,MAAM;SACP,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EACd,IAAI,EACJ,MAAM,EACN,IAAI,GAKL;QACC,OAAO,YAAY,CAAC,SAAS,CAAC;YAC5B,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,IAAI,IAAI,mBAAW;YACzB,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF;AArVD,oCAqVC;AAED;;;;;;;;;;;;;;;EAeE;AAEF;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,MAAe;IAC5C,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,IAAA,yBAAc,EACZ,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EACjC,uBAAuB,EACvB,OAAO,EACP,KAAK,CACN,CAAC;IACF,OAAO,aAAa,KAAK,OAAO,CAAC;AACnC,CAAC;AATD,wCASC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CAAC,MAAe;IACnD,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,IAAA,yBAAc,EACZ,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EACjC,uBAAuB,EACvB,OAAO,EACP,KAAK,CACN,CAAC;IACF,OAAO,kBAAkB,KAAK,EAAE,CAAC;AACnC,CAAC;AATD,sDASC"} \ No newline at end of file +{"version":3,"file":"hdwallet.js","sources":["../../lib.esm/wallet/hdwallet.js"],"sourcesContent":["/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { dataSlice, defineProperties, getNumber, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\nimport { Ed448Goldilock } from \"../crypto/crypto.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// import { arrayify,\n// // hexDataSlice\n// } from \"../utils/data.js\";\n// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array {\n// const p = getBytes(password);\n// const s = getBytes(salt);\n// return getBytes(pbkdf2(p, s, 2048, 57, \"sha512\"));\n// }\n/**\n * The default derivation path for Core HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m\";\n// \"Bitcoin seed\"\n// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\n// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array {\n// b = getBytes(concat([b.slice(0, 53), \"0x00000000\"]));\n// b[0] &= 0xfc;\n// const c = new Uint8Array(57);\n// let hold = 0;\n// for (let i = 0; i < 57; i++) {\n// hold += a[i] + b[i];\n// c[i] = hold % 256;\n// hold = Math.floor(hold / 256);\n// }\n// return c;\n// };\nconst _guard = {};\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0 && (components[0] === \"m\" || node.depth > 0), \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n prefix;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n #seed;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) {\n super({\n signingKey,\n prefix,\n provider,\n });\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.publicKey });\n this.prefix = prefix;\n this.#seed = seed;\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint,\n fingerprint,\n path,\n index,\n depth,\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet({\n guard: _guard,\n signingKey: this.signingKey,\n parentFingerprint: this.parentFingerprint,\n path: this.path,\n index: this.index,\n depth: this.depth,\n seed: this.#seed,\n mnemonic: this.mnemonic,\n provider,\n prefix: this.prefix,\n });\n }\n #account() {\n const account = {\n address: this.address,\n privateKey: this.privateKey,\n };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy,\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, {\n progressCallback,\n });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() {\n return this.path != null;\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index));\n const newSigningKey = new SigningKey(newPrivateKey);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (_index & ~HardenedBit);\n if (_index & HardenedBit) {\n path += \"'\";\n }\n }\n return new HDNodeWallet({\n guard: _guard,\n signingKey: newSigningKey,\n parentFingerprint: this.fingerprint,\n path,\n index: _index,\n seed: this.#seed,\n depth: this.depth + 1,\n mnemonic: this.mnemonic,\n provider: this.provider,\n prefix: this.prefix,\n });\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed({ _seed, mnemonic, prefix, path, }) {\n const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0);\n const signingKey = new SigningKey(extendetPrivateKey);\n // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length })\n return new HDNodeWallet({\n seed: _seed,\n guard: _guard,\n signingKey,\n parentFingerprint: \"0x00000000\",\n path: path || defaultPath,\n index: 0,\n depth: 0,\n mnemonic,\n provider: null,\n prefix,\n });\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(prefix, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist);\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Create am HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, prefix, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n static mnemonicToSeed(mnemonic, password) {\n const seed = mnemonicToSeed(mnemonic, password);\n return seed;\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, password, path, wordlist, }) {\n if (!password) {\n password = \"\";\n }\n if (!path) {\n path = defaultPath;\n }\n if (!wordlist) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist });\n const _seed = mnemonic.computeSeed();\n return HDNodeWallet.#fromSeed({\n _seed,\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed({ seed, prefix, path, }) {\n return HDNodeWallet.#fromSeed({\n _seed: seed,\n mnemonic: null,\n path: path || defaultPath,\n prefix,\n });\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the acount at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map"],"names":["assertArgument","BaseWallet","assertPrivate","defineProperties","dataSlice","ripemd160","sha256","encryptKeystoreJson","encryptKeystoreJsonSync","Ed448Goldilock","SigningKey","signingKey","LangEn","mnemonic","Mnemonic","randomBytes","mnemonicToSeed","getNumber"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,WAAW,GAAG;AAC3B;AACA;AACA,MAAM,WAAW,GAAG,UAAU;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,EAAE;AACjB,SAAS,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE;AAChC,IA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AAqB,CAAC,MAAM,EAAE;AAC9C,IAAI,MAAM,KAAK,GAAGiB,eAAS,CAAC,MAAM,EAAE,OAAO,CAAC;AAC5C,IAAIjB,qBAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,KAAK,CAAC;AAC9F,IAAI,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AACpC;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/index.d.ts.map b/lib.commonjs/wallet/index.d.ts.map index fc93212da..f380a0adc 100644 --- a/lib.commonjs/wallet/index.d.ts.map +++ b/lib.commonjs/wallet/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wallet/index.js b/lib.commonjs/wallet/index.js index e7f068639..5010e79fb 100644 --- a/lib.commonjs/wallet/index.js +++ b/lib.commonjs/wallet/index.js @@ -1,42 +1,26 @@ -"use strict"; -/** - * When interacting with Core, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Wallet = exports.Mnemonic = exports.encryptKeystoreJsonSync = exports.encryptKeystoreJson = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.isKeystoreJson = exports.decryptCrowdsaleJson = exports.isCrowdsaleJson = exports.HDNodeWallet = exports.getIndexedAccountPath = exports.getAccountPath = exports.defaultPath = exports.BaseWallet = void 0; -var base_wallet_js_1 = require("./base-wallet.js"); -Object.defineProperty(exports, "BaseWallet", { enumerable: true, get: function () { return base_wallet_js_1.BaseWallet; } }); -var hdwallet_js_1 = require("./hdwallet.js"); -Object.defineProperty(exports, "defaultPath", { enumerable: true, get: function () { return hdwallet_js_1.defaultPath; } }); -Object.defineProperty(exports, "getAccountPath", { enumerable: true, get: function () { return hdwallet_js_1.getAccountPath; } }); -Object.defineProperty(exports, "getIndexedAccountPath", { enumerable: true, get: function () { return hdwallet_js_1.getIndexedAccountPath; } }); -Object.defineProperty(exports, "HDNodeWallet", { enumerable: true, get: function () { return hdwallet_js_1.HDNodeWallet; } }); -var json_crowdsale_js_1 = require("./json-crowdsale.js"); -Object.defineProperty(exports, "isCrowdsaleJson", { enumerable: true, get: function () { return json_crowdsale_js_1.isCrowdsaleJson; } }); -Object.defineProperty(exports, "decryptCrowdsaleJson", { enumerable: true, get: function () { return json_crowdsale_js_1.decryptCrowdsaleJson; } }); -var json_keystore_js_1 = require("./json-keystore.js"); -Object.defineProperty(exports, "isKeystoreJson", { enumerable: true, get: function () { return json_keystore_js_1.isKeystoreJson; } }); -Object.defineProperty(exports, "decryptKeystoreJsonSync", { enumerable: true, get: function () { return json_keystore_js_1.decryptKeystoreJsonSync; } }); -Object.defineProperty(exports, "decryptKeystoreJson", { enumerable: true, get: function () { return json_keystore_js_1.decryptKeystoreJson; } }); -Object.defineProperty(exports, "encryptKeystoreJson", { enumerable: true, get: function () { return json_keystore_js_1.encryptKeystoreJson; } }); -Object.defineProperty(exports, "encryptKeystoreJsonSync", { enumerable: true, get: function () { return json_keystore_js_1.encryptKeystoreJsonSync; } }); -var mnemonic_js_1 = require("./mnemonic.js"); -Object.defineProperty(exports, "Mnemonic", { enumerable: true, get: function () { return mnemonic_js_1.Mnemonic; } }); -var wallet_js_1 = require("./wallet.js"); -Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return wallet_js_1.Wallet; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var baseWallet = require('./base-wallet.js'); +var hdwallet = require('./hdwallet.js'); +var jsonCrowdsale = require('./json-crowdsale.js'); +var jsonKeystore = require('./json-keystore.js'); +var mnemonic = require('./mnemonic.js'); +var wallet = require('./wallet.js'); + + + +exports.BaseWallet = baseWallet.BaseWallet; +exports.HDNodeWallet = hdwallet.HDNodeWallet; +exports.defaultPath = hdwallet.defaultPath; +exports.getAccountPath = hdwallet.getAccountPath; +exports.getIndexedAccountPath = hdwallet.getIndexedAccountPath; +exports.decryptCrowdsaleJson = jsonCrowdsale.decryptCrowdsaleJson; +exports.isCrowdsaleJson = jsonCrowdsale.isCrowdsaleJson; +exports.decryptKeystoreJson = jsonKeystore.decryptKeystoreJson; +exports.decryptKeystoreJsonSync = jsonKeystore.decryptKeystoreJsonSync; +exports.encryptKeystoreJson = jsonKeystore.encryptKeystoreJson; +exports.encryptKeystoreJsonSync = jsonKeystore.encryptKeystoreJsonSync; +exports.isKeystoreJson = jsonKeystore.isKeystoreJson; +exports.Mnemonic = mnemonic.Mnemonic; +exports.Wallet = wallet.Wallet; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/wallet/index.js.map b/lib.commonjs/wallet/index.js.map index 8985d9fbd..cea46236a 100644 --- a/lib.commonjs/wallet/index.js.map +++ b/lib.commonjs/wallet/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,mDAA8C;AAArC,4GAAA,UAAU,OAAA;AAEnB,6CAKuB;AAJrB,0GAAA,WAAW,OAAA;AACX,6GAAA,cAAc,OAAA;AACd,oHAAA,qBAAqB,OAAA;AACrB,2GAAA,YAAY,OAAA;AAGd,yDAA4E;AAAnE,oHAAA,eAAe,OAAA;AAAE,yHAAA,oBAAoB,OAAA;AAE9C,uDAM4B;AAL1B,kHAAA,cAAc,OAAA;AACd,2HAAA,uBAAuB,OAAA;AACvB,uHAAA,mBAAmB,OAAA;AACnB,uHAAA,mBAAmB,OAAA;AACnB,2HAAA,uBAAuB,OAAA;AAGzB,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AAEjB,yCAAqC;AAA5B,mGAAA,MAAM,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/json-crowdsale.d.ts.map b/lib.commonjs/wallet/json-crowdsale.d.ts.map index 4514aef1b..db8057554 100644 --- a/lib.commonjs/wallet/json-crowdsale.d.ts.map +++ b/lib.commonjs/wallet/json-crowdsale.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC7B,gBAAgB,CAmClB"} \ No newline at end of file +{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,gBAAgB,CAmClB"} \ No newline at end of file diff --git a/lib.commonjs/wallet/json-crowdsale.js b/lib.commonjs/wallet/json-crowdsale.js index e2e4004d1..0f3e1b48c 100644 --- a/lib.commonjs/wallet/json-crowdsale.js +++ b/lib.commonjs/wallet/json-crowdsale.js @@ -1,18 +1,40 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decryptCrowdsaleJson = exports.isCrowdsaleJson = void 0; -const tslib_1 = require("tslib"); +'use strict'; + +var pkg = require('aes-js'); +var index = require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +var pbkdf2 = require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../crypto/signature.js'); +var id = require('../hash/id.js'); +require('../constants/numbers.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +var utils = require('./utils.js'); + /** * @_subsection: api/wallet:JSON Wallets [json-wallets] */ // @ts-ignore -const aes_js_1 = tslib_1.__importDefault(require("aes-js")); -const { CBC, pkcs7Strip } = aes_js_1.default; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../hash/index.js"); -const index_js_4 = require("../utils/index.js"); -const utils_js_1 = require("./utils.js"); +const { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg; /** * Returns true if %%json%% is a valid JSON Crowdsale wallet. */ @@ -26,7 +48,6 @@ function isCrowdsaleJson(json) { catch (error) { } return false; } -exports.isCrowdsaleJson = isCrowdsaleJson; /** * Before Core launched, it was necessary to create a wallet * format for backers to use, which would be used to receive xcb @@ -38,25 +59,27 @@ exports.isCrowdsaleJson = isCrowdsaleJson; * the library. */ function decryptCrowdsaleJson(json, _password) { - const data = JSON.parse(json); - const password = (0, utils_js_1.getPassword)(_password); + const data$1 = JSON.parse(json); + const password = utils.getPassword(_password); // Core Address - const address = (0, index_js_1.getAddress)((0, utils_js_1.spelunk)(data, "ethaddr:string!")); + const address = index.getAddress(utils.spelunk(data$1, "ethaddr:string!")); // Encrypted Seed - const encseed = (0, utils_js_1.looseArrayify)((0, utils_js_1.spelunk)(data, "encseed:string!")); - (0, index_js_4.assertArgument)(encseed && encseed.length % 16 === 0, "invalid encseed", "json", json); - const key = (0, index_js_4.getBytes)((0, index_js_2.pbkdf2)(password, password, 2000, 32, "sha256")).slice(0, 16); + const encseed = utils.looseArrayify(utils.spelunk(data$1, "encseed:string!")); + errors.assertArgument(encseed && encseed.length % 16 === 0, "invalid encseed", "json", json); + const key = data.getBytes(pbkdf2.pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); const iv = encseed.slice(0, 16); const encryptedSeed = encseed.slice(16); // Decrypt the seed const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip((0, index_js_4.getBytes)(aesCbc.decrypt(encryptedSeed))); + const seed = pkcs7Strip(data.getBytes(aesCbc.decrypt(encryptedSeed))); // This wallet format is weird... Convert the binary encoded hex to a string. let seedHex = ""; for (let i = 0; i < seed.length; i++) { seedHex += String.fromCharCode(seed[i]); } - return { address, privateKey: (0, index_js_3.id)(seedHex) }; + return { address, privateKey: id.id(seedHex) }; } + exports.decryptCrowdsaleJson = decryptCrowdsaleJson; -//# sourceMappingURL=json-crowdsale.js.map \ No newline at end of file +exports.isCrowdsaleJson = isCrowdsaleJson; +//# sourceMappingURL=json-crowdsale.js.map diff --git a/lib.commonjs/wallet/json-crowdsale.js.map b/lib.commonjs/wallet/json-crowdsale.js.map index a26951158..b16e7b32a 100644 --- a/lib.commonjs/wallet/json-crowdsale.js.map +++ b/lib.commonjs/wallet/json-crowdsale.js.map @@ -1 +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,CACxE,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAExC,mBAAmB;IACnB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAA,mBAAQ,EAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAEjE,6EAA6E;IAC7E,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KACzC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAA,aAAE,EAAC,OAAO,CAAC,EAAE,CAAC;AAC9C,CAAC;AAtCD,oDAsCC"} \ No newline at end of file +{"version":3,"file":"json-crowdsale.js","sources":["../../lib.esm/wallet/json-crowdsale.js"],"sourcesContent":["/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n/**\n * Before Core launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive xcb\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Core Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && encseed.length % 16 === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map"],"names":["data","getPassword","getAddress","spelunk","looseArrayify","assertArgument","getBytes","pbkdf2","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA,MAAM,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,GAAG,GAAG,GAAG;AAM1F;AACA;AACA;AACO,SAAS,eAAe,CAAC,IAAI,EAAE;AACtC,IAAI,IAAI;AACR,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AACrC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;AAC1B,YAAY,OAAO,IAAI;AACvB,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,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AQ,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/C,IAAI;AACJ,IAAI,OAAO,EAAE,OAAO,EAAE,UAAU,EAAEE,KAAE,CAAC,OAAO,CAAC,EAAE;AAC/C;;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/json-keystore.d.ts.map b/lib.commonjs/wallet/json-keystore.d.ts.map index a56cc644a..742508cc1 100644 --- a/lib.commonjs/wallet/json-keystore.d.ts.map +++ b/lib.commonjs/wallet/json-keystore.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACP,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACZ,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASpD;AA0ID;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC7B,eAAe,CAmBjB;AAUD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,EAC9B,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,OAAO,CAAC,eAAe,CAAC,CA2B1B;AAkKD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,MAAM,CASR;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,CAiBjB"} \ No newline at end of file +{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACR,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASpD;AAkLD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,eAAe,CAmBjB;AAUD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,EAC9B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,eAAe,CAAC,CA2B1B;AA8ID;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,MAAM,CASR;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,MAAM,CAAC,CAiBjB"} \ No newline at end of file diff --git a/lib.commonjs/wallet/json-keystore.js b/lib.commonjs/wallet/json-keystore.js index f173c36fd..bcd249090 100644 --- a/lib.commonjs/wallet/json-keystore.js +++ b/lib.commonjs/wallet/json-keystore.js @@ -1,7 +1,34 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encryptKeystoreJson = exports.encryptKeystoreJsonSync = exports.decryptKeystoreJson = exports.decryptKeystoreJsonSync = exports.isKeystoreJson = void 0; -const tslib_1 = require("tslib"); +'use strict'; + +var pkg = require('aes-js'); +var index = require('../address/index.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +var pbkdf2 = require('../crypto/pbkdf2.js'); +var random = require('../crypto/random.js'); +var scrypt = require('../crypto/scrypt.js'); +var sha3 = require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var uuid = require('../utils/uuid.js'); +require('../crypto/signature.js'); +var utils = require('./utils.js'); +var _version = require('../_version.js'); +var address = require('../transaction/address.js'); + /** * The JSON Wallet formats allow a simple way to store the private * keys needed in Core along with related information and allows @@ -13,14 +40,7 @@ const tslib_1 = require("tslib"); * @_subsection: api/wallet:JSON Wallets [json-wallets] */ // @ts-ignore -const aes_js_1 = tslib_1.__importDefault(require("aes-js")); -const { CTR } = aes_js_1.default; -const index_js_1 = require("../address/index.js"); -const index_js_2 = require("../crypto/index.js"); -const index_js_3 = require("../utils/index.js"); -const utils_js_1 = require("./utils.js"); -const _version_js_1 = require("../_version.js"); -const address_js_1 = require("../transaction/address.js"); +const { Counter, ModeOfOperation: { ctr: CTR }, } = pkg; const defaultPath = "m/44'/60'/0'/0/0"; /** * Returns true if %%json%% is a valid JSON Keystore Wallet. @@ -36,79 +56,102 @@ function isKeystoreJson(json) { catch (error) { } return false; } -exports.isKeystoreJson = isKeystoreJson; -function decrypt(data, key, ciphertext) { - const cipher = (0, utils_js_1.spelunk)(data, "crypto.cipher:string"); +function decrypt(data$1, key, ciphertext) { + const cipher = utils.spelunk(data$1, "crypto.cipher:string"); if (cipher === "aes-128-ctr") { - const iv = (0, utils_js_1.spelunk)(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, iv); - return (0, index_js_3.hexlify)(aesCtr.decrypt(ciphertext)); + const iv = utils.spelunk(data$1, "crypto.cipherparams.iv:data!"); + const aesCtr = new CTR(key, new Counter(iv)); + return data.hexlify(aesCtr.decrypt(ciphertext)); } - (0, index_js_3.assert)(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { + errors.assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { operation: "decrypt", }); } -function getAccount(data, _key) { - const key = (0, index_js_3.getBytes)(_key); - const ciphertext = (0, utils_js_1.spelunk)(data, "crypto.ciphertext:data!"); - const computedMAC = (0, index_js_3.hexlify)((0, index_js_2.sha256)((0, index_js_3.concat)([key.slice(16, 32), ciphertext]))).substring(2); - (0, index_js_3.assertArgument)(computedMAC === (0, utils_js_1.spelunk)(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - const address = (0, index_js_1.getAddress)(data.address); - const prefix = (0, address_js_1.extractPrefix)(address); - if ((0, address_js_1.computeAddress)(privateKey, prefix) !== address) { +function getAccount(data$1, _key) { + const key = data.getBytes(_key); + const ciphertext = utils.spelunk(data$1, "crypto.ciphertext:data!"); + const computedMAC = data.hexlify(sha3.sha256(data.concat([key.slice(16, 32), ciphertext]))).substring(2); + const expectedMAC = utils.spelunk(data$1, "crypto.mac:string!"); + let difference = 0; + const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC); + if (validMAC) { + const actual = data.getBytes("0x" + computedMAC); + const expected = data.getBytes("0x" + expectedMAC); + for (let i = 0; i < actual.length; i++) + difference |= actual[i] ^ expected[i]; + } + errors.assertArgument(validMAC && difference === 0, "incorrect password", "password", "[REDACTED]"); + const privateKey = decrypt(data$1, key.slice(0, 16), ciphertext); + const address$1 = index.getAddress(data$1.address); + const prefix = address.extractPrefix(address$1); + if (address.computeAddress(privateKey, prefix) !== address$1) { throw new Error("address mismatch"); } - if (data.address) { - let check = data.address.toLowerCase(); + if (data$1.address) { + let check = data$1.address.toLowerCase(); if (!check.startsWith("0x")) { check = "0x" + check; } - (0, index_js_3.assertArgument)((0, index_js_1.getAddress)(check) === address, "keystore address/privateKey mismatch", "address", data.address); + errors.assertArgument(index.getAddress(check) === address$1, "keystore address/privateKey mismatch", "address", data$1.address); } - const account = { address, privateKey }; + const account = { address: address$1, privateKey }; // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase - const version = (0, utils_js_1.spelunk)(data, "x-corebc.version:string"); + const version = utils.spelunk(data$1, "x-corebc.version:string"); if (version === "0.1") { const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = (0, utils_js_1.spelunk)(data, "x-corebc.mnemonicCiphertext:data!"); - const mnemonicIv = (0, utils_js_1.spelunk)(data, "x-corebc.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); + const mnemonicCiphertext = utils.spelunk(data$1, "x-corebc.mnemonicCiphertext:data!"); + const mnemonicIv = utils.spelunk(data$1, "x-corebc.mnemonicCounter:data!"); + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); account.mnemonic = { - path: (0, utils_js_1.spelunk)(data, "x-corebc.path:string") || defaultPath, - locale: (0, utils_js_1.spelunk)(data, "x-corebc.locale:string") || "en", - entropy: (0, index_js_3.hexlify)((0, index_js_3.getBytes)(mnemonicAesCtr.decrypt(mnemonicCiphertext))), + path: utils.spelunk(data$1, "x-corebc.path:string") || defaultPath, + locale: utils.spelunk(data$1, "x-corebc.locale:string") || "en", + entropy: data.hexlify(data.getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))), }; } return account; } +// Match Core Web3Dart's wallet KDF resource limits. +function validateScrypt(N, r, p) { + errors.assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, "unsafe scrypt N", "kdf.N", N); + errors.assertArgument(Number.isSafeInteger(r) && + Number.isSafeInteger(p) && + r > 0 && + p > 0 && + r * p <= 1048576 && + 128 * N * r <= 256 * 1024 * 1024, "unsafe scrypt work or memory requirement", "kdf", { N, r, p }); +} function getDecryptKdfParams(data) { - const kdf = (0, utils_js_1.spelunk)(data, "crypto.kdf:string"); + const kdf = utils.spelunk(data, "crypto.kdf:string"); if (kdf && typeof kdf === "string") { if (kdf.toLowerCase() === "scrypt") { - const salt = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.salt:data!"); - const N = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.n:int!"); - const r = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.r:int!"); - const p = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.p:int!"); - // Make sure N is a power of 2 - (0, index_js_3.assertArgument)(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - (0, index_js_3.assertArgument)(r > 0 && p > 0, "invalid kdf", "kdf", kdf); - const dkLen = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.dklen:int!"); - (0, index_js_3.assertArgument)(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); + const salt = utils.spelunk(data, "crypto.kdfparams.salt:data!"); + const N = utils.spelunk(data, "crypto.kdfparams.n:int!"); + const r = utils.spelunk(data, "crypto.kdfparams.r:int!"); + const p = utils.spelunk(data, "crypto.kdfparams.p:int!"); + validateScrypt(N, r, p); + const dkLen = utils.spelunk(data, "crypto.kdfparams.dklen:int!"); + errors.assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); return { name: "scrypt", salt, N, r, p, dkLen: 64 }; } else if (kdf.toLowerCase() === "pbkdf2") { - const salt = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.salt:data!"); - const prf = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.prf:string!"); + const salt = utils.spelunk(data, "crypto.kdfparams.salt:data!"); + const prf = utils.spelunk(data, "crypto.kdfparams.prf:string!"); const algorithm = prf.split("-").pop(); - (0, index_js_3.assertArgument)(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.c:int!"); - const dkLen = (0, utils_js_1.spelunk)(data, "crypto.kdfparams.dklen:int!"); - (0, index_js_3.assertArgument)(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { name: "pbkdf2", salt, count, dkLen, algorithm }; + errors.assertArgument(prf === "hmac-sha256" || prf === "hmac-sha512", "invalid kdf.pdf", "kdf.pdf", prf); + const count = utils.spelunk(data, "crypto.kdfparams.c:int!"); + errors.assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, "unsafe PBKDF2 iteration count", "kdf.c", count); + const dkLen = utils.spelunk(data, "crypto.kdfparams.dklen:int!"); + errors.assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); + return { + name: "pbkdf2", + salt, + count, + dkLen, + algorithm: algorithm, + }; } } - (0, index_js_3.assertArgument)(false, "unsupported key-derivation function", "kdf", kdf); + errors.assertArgument(false, "unsupported key-derivation function", "kdf", kdf); } /** * Returns the account details for the JSON Keystore Wallet %%json%% @@ -124,21 +167,20 @@ function getDecryptKdfParams(data) { */ function decryptKeystoreJsonSync(json, _password) { const data = JSON.parse(json); - const password = (0, utils_js_1.getPassword)(_password); + const password = utils.getPassword(_password); const params = getDecryptKdfParams(data); if (params.name === "pbkdf2") { const { salt, count, dkLen, algorithm } = params; - const key = (0, index_js_2.pbkdf2)(password, salt, count, dkLen, algorithm); + const key = pbkdf2.pbkdf2(password, salt, count, dkLen, algorithm); return getAccount(data, key); } - (0, index_js_3.assert)(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { + errors.assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params, }); const { salt, N, r, p, dkLen } = params; - const key = (0, index_js_2.scryptSync)(password, salt, N, r, p, dkLen); + const key = scrypt.scryptSync(password, salt, N, r, p, dkLen); return getAccount(data, key); } -exports.decryptKeystoreJsonSync = decryptKeystoreJsonSync; function stall(duration) { return new Promise((resolve) => { setTimeout(() => { @@ -159,7 +201,7 @@ function stall(duration) { */ async function decryptKeystoreJson(json, _password, progress) { const data = JSON.parse(json); - const password = (0, utils_js_1.getPassword)(_password); + const password = utils.getPassword(_password); const params = getDecryptKdfParams(data); if (params.name === "pbkdf2") { if (progress) { @@ -167,80 +209,74 @@ async function decryptKeystoreJson(json, _password, progress) { await stall(0); } const { salt, count, dkLen, algorithm } = params; - const key = (0, index_js_2.pbkdf2)(password, salt, count, dkLen, algorithm); + const key = pbkdf2.pbkdf2(password, salt, count, dkLen, algorithm); if (progress) { progress(1); await stall(0); } return getAccount(data, key); } - (0, index_js_3.assert)(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { + errors.assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { params, }); const { salt, N, r, p, dkLen } = params; - const key = await (0, index_js_2.scrypt)(password, salt, N, r, p, dkLen, progress); + const key = await scrypt.scrypt(password, salt, N, r, p, dkLen, progress); return getAccount(data, key); } -exports.decryptKeystoreJson = decryptKeystoreJson; function getEncryptKdfParams(options) { // Check/generate the salt const salt = options.salt != null - ? (0, index_js_3.getBytes)(options.salt, "options.salt") - : (0, index_js_2.randomBytes)(32); + ? data.getBytes(options.salt, "options.salt") + : random.randomBytes(32); // Override the scrypt password-based key derivation function parameters let N = 1 << 17, r = 8, p = 1; if (options.scrypt) { - if (options.scrypt.N) { + if (options.scrypt.N != null) { N = options.scrypt.N; } - if (options.scrypt.r) { + if (options.scrypt.r != null) { r = options.scrypt.r; } - if (options.scrypt.p) { + if (options.scrypt.p != null) { p = options.scrypt.p; } } - (0, index_js_3.assertArgument)(typeof N === "number" && - N > 0 && - Number.isSafeInteger(N) && - (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); - (0, index_js_3.assertArgument)(typeof r === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); - (0, index_js_3.assertArgument)(typeof p === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); + validateScrypt(N, r, p); return { name: "scrypt", dkLen: 32, salt, N, r, p }; } function _encryptKeystore(key, kdf, account, options) { - const privateKey = (0, index_js_3.getBytes)(account.privateKey, "privateKey"); + const privateKey = data.getBytes(account.privateKey, "privateKey"); // Override initialization vector - const iv = options.iv != null ? (0, index_js_3.getBytes)(options.iv, "options.iv") : (0, index_js_2.randomBytes)(16); - (0, index_js_3.assertArgument)(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); + const iv = options.iv != null ? data.getBytes(options.iv, "options.iv") : random.randomBytes(16); + errors.assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); // Override the uuid const uuidRandom = options.uuid != null - ? (0, index_js_3.getBytes)(options.uuid, "options.uuid") - : (0, index_js_2.randomBytes)(16); - (0, index_js_3.assertArgument)(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); + ? data.getBytes(options.uuid, "options.uuid") + : random.randomBytes(16); + errors.assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); // This will be used to encrypt the wallet (as per Web3 secret storage) // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet) const derivedKey = key.slice(0, 16); const macPrefix = key.slice(16, 32); // Encrypt the private key - const aesCtr = new CTR(derivedKey, iv); - const ciphertext = (0, index_js_3.getBytes)(aesCtr.encrypt(privateKey)); + const aesCtr = new CTR(derivedKey, new Counter(iv)); + const ciphertext = data.getBytes(aesCtr.encrypt(privateKey)); // Compute the message authentication code, used to check the password - const mac = (0, index_js_2.sha256)((0, index_js_3.concat)([macPrefix, ciphertext])); - const data = { + const mac = sha3.sha256(data.concat([macPrefix, ciphertext])); + const data$1 = { address: account.address.substring(2).toLowerCase(), - id: (0, index_js_3.uuidV4)(uuidRandom), + id: uuid.uuidV4(uuidRandom), version: 3, Crypto: { cipher: "aes-128-ctr", cipherparams: { - iv: (0, index_js_3.hexlify)(iv).substring(2), + iv: data.hexlify(iv).substring(2), }, - ciphertext: (0, index_js_3.hexlify)(ciphertext).substring(2), + ciphertext: data.hexlify(ciphertext).substring(2), kdf: "scrypt", kdfparams: { - salt: (0, index_js_3.hexlify)(kdf.salt).substring(2), + salt: data.hexlify(kdf.salt).substring(2), n: kdf.N, dklen: 32, p: kdf.p, @@ -251,39 +287,39 @@ function _encryptKeystore(key, kdf, account, options) { }; // If we have a mnemonic, encrypt it into the JSON wallet if (account.mnemonic) { - const client = options.client != null ? options.client : `corebc/${_version_js_1.version}`; + const client = options.client != null ? options.client : `corebc/${_version.version}`; const path = account.mnemonic.path || defaultPath; const locale = account.mnemonic.locale || "en"; const mnemonicKey = key.slice(32, 64); - const entropy = (0, index_js_3.getBytes)(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = (0, index_js_2.randomBytes)(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - const mnemonicCiphertext = (0, index_js_3.getBytes)(mnemonicAesCtr.encrypt(entropy)); + const entropy = data.getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); + const mnemonicIv = random.randomBytes(16); + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); + const mnemonicCiphertext = data.getBytes(mnemonicAesCtr.encrypt(entropy)); const now = new Date(); const timestamp = now.getUTCFullYear() + "-" + - (0, utils_js_1.zpad)(now.getUTCMonth() + 1, 2) + + utils.zpad(now.getUTCMonth() + 1, 2) + "-" + - (0, utils_js_1.zpad)(now.getUTCDate(), 2) + + utils.zpad(now.getUTCDate(), 2) + "T" + - (0, utils_js_1.zpad)(now.getUTCHours(), 2) + + utils.zpad(now.getUTCHours(), 2) + "-" + - (0, utils_js_1.zpad)(now.getUTCMinutes(), 2) + + utils.zpad(now.getUTCMinutes(), 2) + "-" + - (0, utils_js_1.zpad)(now.getUTCSeconds(), 2) + + utils.zpad(now.getUTCSeconds(), 2) + ".0Z"; - const gethFilename = "UTC--" + timestamp + "--" + data.address; - data["x-corebc"] = { + const gethFilename = "UTC--" + timestamp + "--" + data$1.address; + data$1["x-corebc"] = { client, gethFilename, path, locale, - mnemonicCounter: (0, index_js_3.hexlify)(mnemonicIv).substring(2), - mnemonicCiphertext: (0, index_js_3.hexlify)(mnemonicCiphertext).substring(2), + mnemonicCounter: data.hexlify(mnemonicIv).substring(2), + mnemonicCiphertext: data.hexlify(mnemonicCiphertext).substring(2), version: "0.1", }; } - return JSON.stringify(data); + return JSON.stringify(data$1); } /** * Return the JSON Keystore Wallet for %%account%% encrypted with @@ -297,12 +333,11 @@ function encryptKeystoreJsonSync(account, password, options) { if (options == null) { options = {}; } - const passwordBytes = (0, utils_js_1.getPassword)(password); + const passwordBytes = utils.getPassword(password); const kdf = getEncryptKdfParams(options); - const key = (0, index_js_2.scryptSync)(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore((0, index_js_3.getBytes)(key), kdf, account, options); + const key = scrypt.scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); + return _encryptKeystore(data.getBytes(key), kdf, account, options); } -exports.encryptKeystoreJsonSync = encryptKeystoreJsonSync; /** * Resolved to the JSON Keystore Wallet for %%account%% encrypted * with %%password%%. @@ -316,10 +351,15 @@ async function encryptKeystoreJson(account, password, options) { if (options == null) { options = {}; } - const passwordBytes = (0, utils_js_1.getPassword)(password); + const passwordBytes = utils.getPassword(password); const kdf = getEncryptKdfParams(options); - const key = await (0, index_js_2.scrypt)(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore((0, index_js_3.getBytes)(key), kdf, account, options); + const key = await scrypt.scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); + return _encryptKeystore(data.getBytes(key), kdf, account, options); } + +exports.decryptKeystoreJson = decryptKeystoreJson; +exports.decryptKeystoreJsonSync = decryptKeystoreJsonSync; exports.encryptKeystoreJson = encryptKeystoreJson; -//# sourceMappingURL=json-keystore.js.map \ No newline at end of file +exports.encryptKeystoreJsonSync = encryptKeystoreJsonSync; +exports.isKeystoreJson = isKeystoreJson; +//# sourceMappingURL=json-keystore.js.map diff --git a/lib.commonjs/wallet/json-keystore.js.map b/lib.commonjs/wallet/json-keystore.js.map index e1d482fc7..9e13218bd 100644 --- a/lib.commonjs/wallet/json-keystore.js.map +++ b/lib.commonjs/wallet/json-keystore.js.map @@ -1 +1 @@ -{"version":3,"file":"json-keystore.js","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":";;;;AAAA;;;;;;;;;GASG;AACH,aAAa;AACb,4DAAyB;AACzB,MAAM,EAAE,GAAG,EAAE,GAAG,gBAAG,CAAC;AAEpB,kDAAiD;AACjD,iDAM4B;AAC5B,gDAO2B;AAE3B,yCAAwD;AAKxD,gDAAyC;AACzC,0DAA0E;AAE1E,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAgCvC;;GAEG;AACH,SAAgB,cAAc,CAAC,IAAY;IACzC,IAAI;QACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClE,IAAI,OAAO,KAAK,CAAC,EAAE;YACjB,OAAO,IAAI,CAAC;SACb;KACF;IAAC,OAAO,KAAK,EAAE,GAAE;IAClB,OAAO,KAAK,CAAC;AACf,CAAC;AATD,wCASC;AAED,SAAS,OAAO,CAAC,IAAS,EAAE,GAAe,EAAE,UAAsB;IACjE,MAAM,MAAM,GAAG,IAAA,kBAAO,EAA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BAAW,EAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,GAAG,GAAG,IAAA,qBAAU,EAAC,aAAa,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACzE,OAAO,gBAAgB,CAAC,IAAA,mBAAQ,EAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AAbD,0DAaC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,mBAAmB,CACvC,OAAwB,EACxB,QAA6B,EAC7B,OAAwB;IAExB,IAAI,OAAO,IAAI,IAAI,EAAE;QACnB,OAAO,GAAG,EAAE,CAAC;KACd;IAED,MAAM,aAAa,GAAG,IAAA,sBAAW,EAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,GAAG,GAAG,MAAM,IAAA,iBAAM,EACtB,aAAa,EACb,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,CAAC,EACL,GAAG,CAAC,CAAC,EACL,GAAG,CAAC,CAAC,EACL,EAAE,EACF,OAAO,CAAC,gBAAgB,CACzB,CAAC;IACF,OAAO,gBAAgB,CAAC,IAAA,mBAAQ,EAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AArBD,kDAqBC"} \ No newline at end of file +{"version":3,"file":"json-keystore.js","sources":["../../lib.esm/wallet/json-keystore.js"],"sourcesContent":["/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Core along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { Counter, ModeOfOperation: { ctr: CTR }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from \"../crypto/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nimport { computeAddress, extractPrefix } from \"../transaction/address.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = data.version != null ? parseInt(data.version) : 0;\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, new Counter(iv));\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\",\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n const expectedMAC = spelunk(data, \"crypto.mac:string!\");\n let difference = 0;\n const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC);\n if (validMAC) {\n const actual = getBytes(\"0x\" + computedMAC);\n const expected = getBytes(\"0x\" + expectedMAC);\n for (let i = 0; i < actual.length; i++)\n difference |= actual[i] ^ expected[i];\n }\n assertArgument(validMAC && difference === 0, \"incorrect password\", \"password\", \"[REDACTED]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = getAddress(data.address);\n const prefix = extractPrefix(address);\n if (computeAddress(privateKey, prefix) !== address) {\n throw new Error(\"address mismatch\");\n }\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-corebc.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-corebc.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-corebc.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n account.mnemonic = {\n path: spelunk(data, \"x-corebc.path:string\") || defaultPath,\n locale: spelunk(data, \"x-corebc.locale:string\") || \"en\",\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))),\n };\n }\n return account;\n}\n// Match Core Web3Dart's wallet KDF resource limits.\nfunction validateScrypt(N, r, p) {\n assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, \"unsafe scrypt N\", \"kdf.N\", N);\n assertArgument(Number.isSafeInteger(r) &&\n Number.isSafeInteger(p) &&\n r > 0 &&\n p > 0 &&\n r * p <= 1048576 &&\n 128 * N * r <= 256 * 1024 * 1024, \"unsafe scrypt work or memory requirement\", \"kdf\", { N, r, p });\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof kdf === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n validateScrypt(N, r, p);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(prf === \"hmac-sha256\" || prf === \"hmac-sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, \"unsafe PBKDF2 iteration count\", \"kdf.c\", count);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return {\n name: \"pbkdf2\",\n salt,\n count,\n dkLen,\n algorithm: algorithm,\n };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = options.salt != null\n ? getBytes(options.salt, \"options.salt\")\n : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = 1 << 17, r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N != null) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r != null) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p != null) {\n p = options.scrypt.p;\n }\n }\n validateScrypt(N, r, p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = options.iv != null ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = options.uuid != null\n ? getBytes(options.uuid, \"options.uuid\")\n : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, new Counter(iv));\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = sha256(concat([macPrefix, ciphertext]));\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r,\n },\n mac: mac.substring(2),\n },\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = options.client != null ? options.client : `corebc/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = now.getUTCFullYear() +\n \"-\" +\n zpad(now.getUTCMonth() + 1, 2) +\n \"-\" +\n zpad(now.getUTCDate(), 2) +\n \"T\" +\n zpad(now.getUTCHours(), 2) +\n \"-\" +\n zpad(now.getUTCMinutes(), 2) +\n \"-\" +\n zpad(now.getUTCSeconds(), 2) +\n \".0Z\";\n const gethFilename = \"UTC--\" + timestamp + \"--\" + data.address;\n data[\"x-corebc\"] = {\n client,\n gethFilename,\n path,\n locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\",\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map"],"names":["data","spelunk","hexlify","assert","getBytes","sha256","concat","assertArgument","address","getAddress","extractPrefix","computeAddress","getPassword","pbkdf2","scryptSync","scrypt","randomBytes","uuidV4","version","zpad"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG;AAOvD,MAAM,WAAW,GAAG,kBAAkB;AACtC;AACA;AACA;AACO,SAAS,cAAc,CAAC,IAAI,EAAE;AACrC,IAAI,IAAI;AACR,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,C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M,GAAG,GAAG,mBAAmB,CAAC,OAAO,CAAC;AAC5C,IAAI,MAAM,GAAG,GAAGE,iBAAU,CAAC,aAAa,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC;AAC5E,IAAI,OAAO,gBAAgB,CAACV,aAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe,mBAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE;AACtE,IAAI,IAAI,OAAO,IAAI,IAAI,EAAE;AACzB,QAAQ,OAAO,GAAG,EAAE;AACpB,IAAI;AACJ,IAAI,MAAM,aAAa,GAAGQ,iBAAW,CAAC,QAAQ,CAAC;AAC/C,IAAI,MAAM,GAAG,GAAG,mBAAmB,CAAC,OAAO,CAAC;AAC5C,IAAI,MAAM,GAAG,GAAG,MAAMG,aAAM,CAAC,aAAa,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,gBAAgB,CAAC;AACxG,IAAI,OAAO,gBAAgB,CAACX,aAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC;AACjE;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonic.d.ts.map b/lib.commonjs/wallet/mnemonic.d.ts.map index 82d411a3d..1f5e4541d 100644 --- a/lib.commonjs/wallet/mnemonic.d.ts.map +++ b/lib.commonjs/wallet/mnemonic.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EA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AAM,CAAC,eAAe,CACrB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,MAAM,CAGR;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAEzE;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,OAAO,CAM1E;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonic.js b/lib.commonjs/wallet/mnemonic.js index 8daf343c0..e134591c9 100644 --- a/lib.commonjs/wallet/mnemonic.js +++ b/lib.commonjs/wallet/mnemonic.js @@ -1,10 +1,18 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Mnemonic = void 0; -const index_js_1 = require("../utils/index.js"); -const lang_en_js_1 = require("../wordlists/lang-en.js"); -const sha3_js_1 = require("../crypto/sha3.js"); -const mnemonicToSeed_js_1 = require("./mnemonicToSeed.js"); +'use strict'; + +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var langEn = require('../wordlists/lang-en.js'); +var sha3 = require('../crypto/sha3.js'); +var mnemonicToSeed = require('./mnemonicToSeed.js'); + // Returns a byte with the MSB bits set function getUpperMask(bits) { return (((1 << bits) - 1) << (8 - bits)) & 0xff; @@ -14,17 +22,17 @@ function getLowerMask(bits) { return ((1 << bits) - 1) & 0xff; } function mnemonicToEntropy(mnemonic, wordlist) { - (0, index_js_1.assertNormalize)("NFKD"); + errors.assertNormalize("NFKD"); if (wordlist == null) { - wordlist = lang_en_js_1.LangEn.wordlist(); + wordlist = langEn.LangEn.wordlist(); } const words = wordlist.split(mnemonic); - (0, index_js_1.assertArgument)(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); + errors.assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8)); let offset = 0; for (let i = 0; i < words.length; i++) { let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - (0, index_js_1.assertArgument)(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); + errors.assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); for (let bit = 0; bit < 11; bit++) { if (index & (1 << (10 - bit))) { entropy[offset >> 3] |= 1 << (7 - (offset % 8)); @@ -35,14 +43,14 @@ function mnemonicToEntropy(mnemonic, wordlist) { const entropyBits = (32 * words.length) / 3; const checksumBits = words.length / 3; const checksumMask = getUpperMask(checksumBits); - const checksum = (0, index_js_1.getBytes)((0, sha3_js_1.legacySha256)(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - (0, index_js_1.assertArgument)(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return (0, index_js_1.hexlify)(entropy.slice(0, entropyBits / 8)); + const checksum = data.getBytes(sha3.legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; + errors.assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); + return data.hexlify(entropy.slice(0, entropyBits / 8)); } function entropyToMnemonic(entropy, wordlist) { - (0, index_js_1.assertArgument)(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); + errors.assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); if (wordlist == null) { - wordlist = lang_en_js_1.LangEn.wordlist(); + wordlist = langEn.LangEn.wordlist(); } const indices = [0]; let remainingBits = 11; @@ -64,7 +72,7 @@ function entropyToMnemonic(entropy, wordlist) { } // Compute the checksum bits const checksumBits = entropy.length / 4; - const checksum = parseInt((0, sha3_js_1.legacySha256)(entropy).substring(2, 4), 16) & + const checksum = parseInt(sha3.legacySha256(entropy).substring(2, 4), 16) & getUpperMask(checksumBits); // Shift the checksum into the word indices indices[indices.length - 1] <<= checksumBits; @@ -104,16 +112,16 @@ class Mnemonic { password = ""; } if (wordlist == null) { - wordlist = lang_en_js_1.LangEn.wordlist(); + wordlist = langEn.LangEn.wordlist(); } - (0, index_js_1.assertPrivate)(guard, _guard, "Mnemonic"); - (0, index_js_1.defineProperties)(this, { phrase, password, wordlist, entropy }); + errors.assertPrivate(guard, _guard, "Mnemonic"); + properties.defineProperties(this, { phrase, password, wordlist, entropy }); } /** * Returns the seed for the mnemonic. */ computeSeed() { - return (0, mnemonicToSeed_js_1.mnemonicToSeed)(this.phrase, this.password); + return mnemonicToSeed.mnemonicToSeed(this.phrase, this.password); } /** * Creates a new Mnemonic for the %%phrase%%. @@ -124,7 +132,7 @@ class Mnemonic { static fromPhrase({ phrase, password, wordlist, }) { // Normalize the case and space; throws if invalid const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic((0, index_js_1.getBytes)(entropy), wordlist); + phrase = entropyToMnemonic(data.getBytes(entropy), wordlist); return new Mnemonic(_guard, entropy, phrase, password, wordlist); } /** @@ -134,15 +142,15 @@ class Mnemonic { * wordlist is the [English wordlists](LangEn). */ static fromEntropy(_entropy, password, wordlist) { - const entropy = (0, index_js_1.getBytes)(_entropy, "entropy"); + const entropy = data.getBytes(_entropy, "entropy"); const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard, (0, index_js_1.hexlify)(entropy), phrase, password, wordlist); + return new Mnemonic(_guard, data.hexlify(entropy), phrase, password, wordlist); } /** * Returns the phrase for %%mnemonic%%. */ static entropyToPhrase(_entropy, wordlist) { - const entropy = (0, index_js_1.getBytes)(_entropy, "entropy"); + const entropy = data.getBytes(_entropy, "entropy"); return entropyToMnemonic(entropy, wordlist); } /** @@ -166,5 +174,6 @@ class Mnemonic { return false; } } + exports.Mnemonic = Mnemonic; -//# sourceMappingURL=mnemonic.js.map \ No newline at end of file +//# sourceMappingURL=mnemonic.js.map diff --git a/lib.commonjs/wallet/mnemonic.js.map b/lib.commonjs/wallet/mnemonic.js.map index fbac6eb33..cc4b3bb26 100644 --- a/lib.commonjs/wallet/mnemonic.js.map +++ b/lib.commonjs/wallet/mnemonic.js.map @@ -1 +1 @@ -{"version":3,"file":"mnemonic.js","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":";;;AAAA,gDAO2B;AAC3B,wDAAiD;AAIjD,+CAAiD;AACjD,2DAAqD;AAErD,uCAAuC;AACvC,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;AAClD,CAAC;AAED,uCAAuC;AACvC,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;AAClC,CAAC;AAED,SAAS,iBAAiB,CACxB,QAAgB,EAChB,QAA0B;IAE1B,IAAA,0BAAe,EAAC,MAAM,CAAC,CAAC;IAExB,IAAI,QAAQ,IAAI,IAAI,EAAE;QACpB,QAAQ,GAAG,mBAAM,CAAC,QAAQ,EAAE,CAAC;KAC9B;IAED,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAA,yBAAc,EACZ,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE,IAAI,KAAK,CAAC,M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iB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,QAA0B;QAC/D,OAAO,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,QAA0B;QAC/D,IAAI;YACF,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC;SACb;QAAC,OAAO,KAAK,EAAE,GAAE;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAvHD,4BAuHC"} \ No newline at end of file +{"version":3,"file":"mnemonic.js","sources":["../../lib.esm/wallet/mnemonic.js"],"sourcesContent":["import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { legacySha256 } from \"../crypto/sha3.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return (((1 << bits) - 1) << (8 - bits)) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset++;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) &\n getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n return mnemonicToSeed(this.phrase, this.password);\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase({ phrase, password, wordlist, }) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingUR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AACvB,QAAQ;AACR,QAAQ,OAAO,KAAK,EAAE,EAAE;AACxB,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonicToSeed.d.ts.map b/lib.commonjs/wallet/mnemonicToSeed.d.ts.map index fa7e673dc..87afb28cf 100644 --- a/lib.commonjs/wallet/mnemonicToSeed.d.ts.map +++ b/lib.commonjs/wallet/mnemonicToSeed.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"mnemonicToSeed.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E"} \ No newline at end of file +{"version":3,"file":"mnemonicToSeed.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E"} \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonicToSeed.js b/lib.commonjs/wallet/mnemonicToSeed.js index d5135ede3..aaf1b49f5 100644 --- a/lib.commonjs/wallet/mnemonicToSeed.js +++ b/lib.commonjs/wallet/mnemonicToSeed.js @@ -1,9 +1,12 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mnemonicToSeed = void 0; -const tslib_1 = require("tslib"); -const crypto_js_1 = require("../crypto/crypto.js"); -const utf8_1 = tslib_1.__importDefault(require("utf8")); +'use strict'; + +var buffer = require('buffer'); +require('bcrypto/lib/ed448.js'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +var crypto = require('crypto'); +var utf8 = require('utf8'); + function mnemonicToSeed(mnemonic, password) { if (!password) { password = ""; @@ -11,17 +14,18 @@ function mnemonicToSeed(mnemonic, password) { const t = generateSeed(mnemonic, password); return t.goldilock; } -exports.mnemonicToSeed = mnemonicToSeed; const generateSeed = (mnemonic, password) => { const goldilockSaltPrefix = "mnemonic"; const aesSaltPrefix = "mnemonicfortheAESkey"; - const goldilockSalt = utf8_1.default.encode(goldilockSaltPrefix + password); - const aesSalt = utf8_1.default.encode(aesSaltPrefix + password); - const goldilockKey = (0, crypto_js_1.pbkdf2Sync)(Buffer.from(mnemonic), goldilockSalt, 2048, 64, "sha512"); - const aesKeySeed = (0, crypto_js_1.pbkdf2Sync)(Buffer.from(mnemonic), aesSalt, 2048, 64, "sha512"); + const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); + const aesSalt = utf8.encode(aesSaltPrefix + password); + const goldilockKey = crypto.pbkdf2Sync(buffer.Buffer.from(mnemonic), buffer.Buffer.from(goldilockSalt), 2048, 64, "sha512"); + const aesKeySeed = crypto.pbkdf2Sync(buffer.Buffer.from(mnemonic), buffer.Buffer.from(aesSalt), 2048, 64, "sha512"); return { - aes: aesKeySeed.toString("hex"), - goldilock: goldilockKey.toString("hex"), + aes: buffer.Buffer.from(aesKeySeed).toString("hex"), + goldilock: buffer.Buffer.from(goldilockKey).toString("hex"), }; }; -//# sourceMappingURL=mnemonicToSeed.js.map \ No newline at end of file + +exports.mnemonicToSeed = mnemonicToSeed; +//# sourceMappingURL=mnemonicToSeed.js.map diff --git a/lib.commonjs/wallet/mnemonicToSeed.js.map b/lib.commonjs/wallet/mnemonicToSeed.js.map index 47084e866..76cbbe0f3 100644 --- a/lib.commonjs/wallet/mnemonicToSeed.js.map +++ b/lib.commonjs/wallet/mnemonicToSeed.js.map @@ -1 +1 @@ -{"version":3,"file":"mnemonicToSeed.js","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":";;;;AAAA,mDAAiD;AACjD,wDAAwB;AACxB,SAAgB,cAAc,CAAC,QAAgB,EAAE,QAAiB;IAChE,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,EAAE,CAAC;KACf;IACD,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,CAAC,CAAC,SAAS,CAAC;AACrB,CAAC;AAND,wCAMC;AAED,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,QAAiB,EAAE,EAAE;IAC3D,MAAM,mBAAmB,GAAG,UAAU,CAAC;IACvC,MAAM,aAAa,GAAG,sBAAsB,CAAC;IAE7C,MAAM,aAAa,GAAG,cAAI,CAAC,MAAM,CAAC,mBAAmB,GAAG,QAAQ,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,cAAI,CAAC,MAAM,CAAC,aAAa,GAAG,QAAQ,CAAC,CAAC;IAEtD,MAAM,YAAY,GAAG,IAAA,sBAAU,EAC7B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EACrB,aAAa,EACb,IAAI,EACJ,EAAE,EACF,QAAQ,CACT,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,sBAAU,EAC3B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EACrB,OAAO,EACP,IAAI,EACJ,EAAE,EACF,QAAQ,CACT,CAAC;IAEF,OAAO;QACL,GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC/B,SAAS,EAAE,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC;KACxC,CAAC;AACJ,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"mnemonicToSeed.js","sources":["../../lib.esm/wallet/mnemonicToSeed.js"],"sourcesContent":["import { Buffer } from \"buffer\";\nimport { pbkdf2Sync } from \"../crypto/crypto.js\";\nimport utf8 from \"utf8\";\nexport function mnemonicToSeed(mnemonic, password) {\n if (!password) {\n password = \"\";\n }\n const t = generateSeed(mnemonic, password);\n return t.goldilock;\n}\nconst generateSeed = (mnemonic, password) => {\n const goldilockSaltPrefix = \"mnemonic\";\n const aesSaltPrefix = \"mnemonicfortheAESkey\";\n const goldilockSalt = utf8.encode(goldilockSaltPrefix + password);\n const aesSalt = utf8.encode(aesSaltPrefix + password);\n const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(goldilockSalt), 2048, 64, \"sha512\");\n const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(aesSalt), 2048, 64, \"sha512\");\n return {\n aes: Buffer.from(aesKeySeed).toString(\"hex\"),\n goldilock: Buffer.from(goldilockKey).toString(\"hex\"),\n };\n};\n//# sourceMappingURL=mnemonicToSeed.js.map"],"names":["pbkdf2Sync","Buffer"],"mappings":";;;;;;;;;AAGO,SAAS,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE;AACnD,IAAI,IAAI,CAAC,QAAQ,EAAE;AACnB,QAAQ,QAAQ,GAAG,EAAE;AACrB,IAAI;AACJ,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAC9C,IAAI,OAAO,CAAC,CAAC,SAAS;AACtB;AACA,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK;AAC7C,IAAI,MAAM,mBAAmB,GAAG,UAAU;AAC1C,IAAI,MAAM,aAAa,GAAG,sBAAsB;AAChD,IAAI,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,mBAAmB,GAAG,QAAQ,CAAC;AACrE,IAAI,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,GAAG,QAAQ,CAAC;AACzD,IAAI,MAAM,YAAY,GAAGA,iBAAU,CAACC,aAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAEA,aAAM,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,CAAC;AAC1G,IAAI,MAAM,UAAU,GAAGD,iBAAU,CAACC,aAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAEA,aAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,CAAC;AAClG,IAAI,OAAO;AACX,QAAQ,GAAG,EAAEA,aAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;AACpD,QAAQ,SAAS,EAAEA,aAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC5D,KAAK;AACL,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/utils.js b/lib.commonjs/wallet/utils.js index d47899df9..3ea3315e8 100644 --- a/lib.commonjs/wallet/utils.js +++ b/lib.commonjs/wallet/utils.js @@ -1,17 +1,25 @@ -"use strict"; +'use strict'; + +require('../utils/base58.js'); +var data = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +var utf8 = require('../utils/utf8.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + /** * @_ignore */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.spelunk = exports.getPassword = exports.zpad = exports.looseArrayify = void 0; -const index_js_1 = require("../utils/index.js"); function looseArrayify(hexString) { if (typeof hexString === "string" && !hexString.startsWith("0x")) { hexString = "0x" + hexString; } - return (0, index_js_1.getBytesCopy)(hexString); + return data.getBytesCopy(hexString); } -exports.looseArrayify = looseArrayify; function zpad(value, length) { value = String(value); while (value.length < length) { @@ -19,17 +27,15 @@ function zpad(value, length) { } return value; } -exports.zpad = zpad; function getPassword(password) { if (typeof password === "string") { - return (0, index_js_1.toUtf8Bytes)(password, "NFKC"); + return utf8.toUtf8Bytes(password, "NFKC"); } - return (0, index_js_1.getBytesCopy)(password); + return data.getBytesCopy(password); } -exports.getPassword = getPassword; function spelunk(object, _path) { const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - (0, index_js_1.assertArgument)(match != null, "invalid path", "path", _path); + errors.assertArgument(match != null, "invalid path", "path", _path); const path = match[1]; const type = match[3]; const reqd = match[4] === "!"; @@ -59,7 +65,7 @@ function spelunk(object, _path) { break; } } - (0, index_js_1.assertArgument)(!reqd || cur != null, "missing required value", "path", path); + errors.assertArgument(!reqd || cur != null, "missing required value", "path", path); if (type && cur != null) { if (type === "int") { if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { @@ -85,11 +91,10 @@ function spelunk(object, _path) { if (type === typeof cur) { return cur; } - (0, index_js_1.assertArgument)(false, `wrong type found for ${type} `, "path", path); + errors.assertArgument(false, `wrong type found for ${type} `, "path", path); } return cur; } -exports.spelunk = spelunk; /* export function follow(object: any, path: string): null | string { let currentChild = object; @@ -146,4 +151,9 @@ export function uuidV4(randomBytes: BytesLike): string { ].join("-"); } */ -//# sourceMappingURL=utils.js.map \ No newline at end of file + +exports.getPassword = getPassword; +exports.looseArrayify = looseArrayify; +exports.spelunk = spelunk; +exports.zpad = zpad; +//# sourceMappingURL=utils.js.map diff --git a/lib.commonjs/wallet/utils.js.map b/lib.commonjs/wallet/utils.js.map index eaebe84aa..672ea113f 100644 --- a/lib.commonjs/wallet/utils.js.map +++ b/lib.commonjs/wallet/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src.ts/wallet/utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,gDAA8E;AAE9E,SAAgB,aAAa,CAAC,SAAiB;IAC7C,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAChE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;KAC9B;IACD,OAAO,IAAA,uBAAY,EAAC,SAAS,CAAC,CAAC;AACjC,CAAC;AALD,sCAKC;AAED,SAAgB,IAAI,CAAC,KAAsB,EAAE,MAAc;IACzD,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE;QAC5B,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;KACrB;IACD,O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;;;;;EA8BE;AACF,0DAA0D;AAC1D;;;;;;;;;;;;;;;;;;;;;;;EAuBE"} \ No newline at end of file +{"version":3,"file":"utils.js","sources":["../../lib.esm/wallet/utils.js"],"sourcesContent":["/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof hexString === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = \"0\" + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof password === \"string\") {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = match[4] === \"!\";\n let cur = object;\n for (const comp of path.toLowerCase().split(\".\")) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof cur === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof cur === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof cur) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map"],"names":["getBytesCopy","toUtf8Bytes","assertArgument"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AAEO,SAAS,aAAa,CAAC,SAAS,EAAE;AACzC,IAAI,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AACtE,QAAQ,SAAS,GAAG,IAAI,GAAG,SAAS;AACpC,IAAI;AACJ,IAAI,OAAOA,iBAAY,CAAC,SAAS,CAAC;AAClC;AACO,SAAS,IAAI,CA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;AACZ,QAAQ;AACR,QAAQ,IAAI,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;AACpD,YAAY,OAAO,GAAG;AACtB,QAAQ;AACR,QAAQ,IAAI,IAAI,KAAK,OAAO,GAAG,EAAE;AACjC,YAAY,OAAO,GAAG;AACtB,QAAQ;AACR,QAAQA,qBAAc,CAAC,KAAK,EAAE,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC;AAC5E,IAAI;AACJ,IAAI,OAAO,GAAG;AACd;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/wallet.d.ts.map b/lib.commonjs/wallet/wallet.d.ts.map index edbeaa1bd..b640b9ef5 100644 --- a/lib.commonjs/wallet/wallet.d.ts.map +++ b/lib.commonjs/wallet/wallet.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAe,YAAY,EAAE,MAAM,eAAe,CAAC;AAW1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AActD;;;;;;;;;GASG;AACH,qBAAa,MAAO,SAAQ,UAAU;;IACpC;;;OAGG;gBACS,EACV,GAA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;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,GAC3B,YAAY,GAAG,MAAM,CAWvB;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAClB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,YAAY,CAWd;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,YAAY,CAUf;IACD,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAUf;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wallet/wallet.js b/lib.commonjs/wallet/wallet.js index 01aafa681..be82fe7db 100644 --- a/lib.commonjs/wallet/wallet.js +++ b/lib.commonjs/wallet/wallet.js @@ -1,14 +1,34 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Wallet = void 0; -const index_js_1 = require("../crypto/index.js"); -const index_js_2 = require("../utils/index.js"); -const base_wallet_js_1 = require("./base-wallet.js"); -const hdwallet_js_1 = require("./hdwallet.js"); -const json_crowdsale_js_1 = require("./json-crowdsale.js"); -const json_keystore_js_1 = require("./json-keystore.js"); -const mnemonic_js_1 = require("./mnemonic.js"); -const address_js_1 = require("../transaction/address.js"); +'use strict'; + +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +var signingKey = require('../crypto/signing-key.js'); +require('../crypto/signature.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var baseWallet = require('./base-wallet.js'); +var hdwallet = require('./hdwallet.js'); +var jsonCrowdsale = require('./json-crowdsale.js'); +var jsonKeystore = require('./json-keystore.js'); +var mnemonic = require('./mnemonic.js'); +var address = require('../transaction/address.js'); + function stall(duration) { return new Promise((resolve) => { setTimeout(() => { @@ -26,7 +46,7 @@ function stall(duration) { * raw private key, [[link-bip-39]] mnemonics and encrypte JSON * wallets. */ -class Wallet extends base_wallet_js_1.BaseWallet { +class Wallet extends baseWallet.BaseWallet { /** * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected * to %%provider%%. @@ -35,9 +55,9 @@ class Wallet extends base_wallet_js_1.BaseWallet { if (typeof key === "string" && !key.startsWith("0x")) { key = "0x" + key; } - let signingKey = typeof key === "string" ? new index_js_1.SigningKey(key) : key; + let signingKey$1 = typeof key === "string" ? new signingKey.SigningKey(key) : key; super({ - signingKey, + signingKey: signingKey$1, prefix, provider, }); @@ -58,7 +78,7 @@ class Wallet extends base_wallet_js_1.BaseWallet { */ async encrypt(password, progressCallback) { const account = { address: this.address, privateKey: this.privateKey }; - return await (0, json_keystore_js_1.encryptKeystoreJson)(account, password, { progressCallback }); + return await jsonKeystore.encryptKeystoreJson(account, password, { progressCallback }); } /** * Returns a [JSON Keystore Wallet](json-wallets) encryped with @@ -72,17 +92,17 @@ class Wallet extends base_wallet_js_1.BaseWallet { */ encryptSync(password) { const account = { address: this.address, privateKey: this.privateKey }; - return (0, json_keystore_js_1.encryptKeystoreJsonSync)(account, password); + return jsonKeystore.encryptKeystoreJsonSync(account, password); } static #fromAccount(account) { - (0, index_js_2.assertArgument)(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - const address = account.address; - const prefix = (0, address_js_1.extractPrefix)(address); + errors.assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); + const address$1 = account.address; + const prefix = address.extractPrefix(address$1); if ("mnemonic" in account && account.mnemonic && account.mnemonic.locale === "en") { - const mnemonic = mnemonic_js_1.Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = hdwallet_js_1.HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path); + const mnemonic$1 = mnemonic.Mnemonic.fromEntropy(account.mnemonic.entropy); + const wallet = hdwallet.HDNodeWallet.fromMnemonic(mnemonic$1, prefix, account.mnemonic.path); if (wallet.address === account.address && wallet.privateKey === account.privateKey) { return wallet; @@ -93,7 +113,7 @@ class Wallet extends base_wallet_js_1.BaseWallet { key: account.privateKey, prefix, }); - (0, index_js_2.assertArgument)(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); + errors.assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); return wallet; } /** @@ -105,15 +125,15 @@ class Wallet extends base_wallet_js_1.BaseWallet { */ static async fromEncryptedJson(json, password, progress) { let account = null; - if ((0, json_keystore_js_1.isKeystoreJson)(json)) { - account = await (0, json_keystore_js_1.decryptKeystoreJson)(json, password, progress); + if (jsonKeystore.isKeystoreJson(json)) { + account = await jsonKeystore.decryptKeystoreJson(json, password, progress); } - else if ((0, json_crowdsale_js_1.isCrowdsaleJson)(json)) { + else if (jsonCrowdsale.isCrowdsaleJson(json)) { if (progress) { progress(0); await stall(0); } - account = (0, json_crowdsale_js_1.decryptCrowdsaleJson)(json, password); + account = jsonCrowdsale.decryptCrowdsaleJson(json, password); if (progress) { progress(1); await stall(0); @@ -130,14 +150,14 @@ class Wallet extends base_wallet_js_1.BaseWallet { */ static fromEncryptedJsonSync(json, password) { let account = null; - if ((0, json_keystore_js_1.isKeystoreJson)(json)) { - account = (0, json_keystore_js_1.decryptKeystoreJsonSync)(json, password); + if (jsonKeystore.isKeystoreJson(json)) { + account = jsonKeystore.decryptKeystoreJsonSync(json, password); } - else if ((0, json_crowdsale_js_1.isCrowdsaleJson)(json)) { - account = (0, json_crowdsale_js_1.decryptCrowdsaleJson)(json, password); + else if (jsonCrowdsale.isCrowdsaleJson(json)) { + account = jsonCrowdsale.decryptCrowdsaleJson(json, password); } else { - (0, index_js_2.assertArgument)(false, "invalid JSON wallet", "json", "[ REDACTED ]"); + errors.assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); } return Wallet.#fromAccount(account); } @@ -148,7 +168,7 @@ class Wallet extends base_wallet_js_1.BaseWallet { * If there is no crytographic random source, this will throw. */ static createRandom(prefix, provider) { - const wallet = hdwallet_js_1.HDNodeWallet.createRandom(prefix, undefined, undefined, undefined); + const wallet = hdwallet.HDNodeWallet.createRandom(prefix, undefined, undefined, undefined); if (provider) { return wallet.connect(provider); } @@ -158,7 +178,7 @@ class Wallet extends base_wallet_js_1.BaseWallet { * Creates a [[HDNodeWallet]] for %%phrase%%. */ static fromPhrase({ phrase, prefix, provider, password, }) { - const wallet = hdwallet_js_1.HDNodeWallet.fromPhrase({ + const wallet = hdwallet.HDNodeWallet.fromPhrase({ phrase, prefix, password, @@ -169,10 +189,10 @@ class Wallet extends base_wallet_js_1.BaseWallet { return wallet; } static fromSeed({ seed, prefix, provider, path, }) { - const wallet = hdwallet_js_1.HDNodeWallet.fromSeed({ + const wallet = hdwallet.HDNodeWallet.fromSeed({ seed, prefix, - path: path || hdwallet_js_1.defaultPath, + path: path || hdwallet.defaultPath, }); if (provider) { return wallet.connect(provider); @@ -180,5 +200,6 @@ class Wallet extends base_wallet_js_1.BaseWallet { return wallet; } } + exports.Wallet = Wallet; -//# sourceMappingURL=wallet.js.map \ No newline at end of file +//# sourceMappingURL=wallet.js.map diff --git a/lib.commonjs/wallet/wallet.js.map b/lib.commonjs/wallet/wallet.js.map index ee53ec8e9..d8a64e95d 100644 --- a/lib.commonjs/wallet/wallet.js.map +++ b/lib.commonjs/wallet/wallet.js.map @@ -1 +1 @@ -{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":";;;AAAA,iDAAgD;AAChD,gDAAmD;AAEnD,qDAA8C;AAC9C,+CAA0D;AAC1D,2DAA4E;AAC5E,yDAM4B;AAC5B,+CAAyC;AAOzC,0DAA0D;AAE1D,SAAS,KAAK,CAAC,QAAgB;IAC7B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,EAAE,CAAC;QACZ,CAAC,EAAE,QAAQ,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;GASG;AACH,MAAa,MAAO,SAAQ,2BAAU;IACpC;;;OAGG;IACH,YAAY,EACV,GAAG,EACH,MAAM,EACN,QAAQ,GAKT;QACC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YACpD,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;SAClB;QAED,IAAI,UAAU,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,qBAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QACrE,KAAK,CAAC;YACJ,UAAU;YACV,MAAM;YACN,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,QAAyB;QAC/B,OAAO,IAAI,MAAM,CAAC;YAChB,GAAG,EAAE,IAAI,CAAC,UAAU;YACpB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAM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m/wallet/wallet.js"],"sourcesContent":["import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { defaultPath, HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson, } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { extractPrefix } from \"../transaction/address.js\";\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected\n * to %%provider%%.\n */\n constructor({ key, prefix, provider, }) {\n if (typeof key === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = typeof key === \"string\" ? new SigningKey(key) : key;\n super({\n signingKey,\n prefix,\n provider,\n });\n }\n connect(provider) {\n return new Wallet({\n key: this.signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n const address = account.address;\n const prefix = extractPrefix(address);\n if (\"mnemonic\" in account &&\n account.mnemonic &&\n account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path);\n if (wallet.address === account.address &&\n wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet({\n key: account.privateKey,\n prefix,\n });\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the avavilable\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(prefix, provider) {\n const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, provider, password, }) {\n const wallet = HDNodeWallet.fromPhrase({\n phrase,\n prefix,\n password,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n static fromSeed({ seed, prefix, provider, path, }) {\n const wallet = HDNodeWallet.fromSeed({\n seed,\n prefix,\n path: path || defaultPath,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map"],"names":["BaseWallet","signingKey","SigningKey","encryptKeystoreJson","encryptKeystoreJsonSync","assertArgument","address","extractPrefix","mnemonic","Mnemonic","HDNodeWallet","isKeystoreJson","decryptKeystoreJson","isCrowdsaleJson","decryptCrowdsaleJson","decryptKeystoreJsonSync","defaultPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,KAAK,CAAC,QAAQ,EAAE;AACzB,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK;AACpC,QAAQ,UAAU,CAAC,MAAM;AACzB,YAAY,OAAO,EAAE;AACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;AACpB,IAAI,CAAC,CAAC;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,qBAAU,CAAC;AACvC;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAG,EAAE;AAC5C,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC9D,YAAY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,OAAO,CAAC,QAAQ,CAAC;AAC3C,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ;AACA;AACA;AACA,IAAI,OAAO,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,EAAE;AAC/D,QAAQ,MAAM,MAAM,GAAGA,qBAAY,CAAC,UAAU,CAAC;AAC/C,YAAY,MAAM;AAClB,YAAY,MAAM;AAClB,YAAY,QAAQ;AACpB,SAAS,CAAC;AACV,QAAQ,IAAI,QAAQ,EAAE;AACtB,YAAY,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC3C,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,OAAO,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE;AACvD,QAAQ,MAAM,MAAM,GAAGA,qBAAY,CAAC,QAAQ,CAAC;AAC7C,YAAY,IAAI;AAChB,YAAY,MAAM;AAClB,YAAY,IAAI,EAAE,IAAI,IAAIM,oBAAW;AACrC,SAAS,CAAC;AACV,QAAQ,IAAI,QAAQ,EAAE;AACtB,YAAY,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC3C,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/bit-reader.js b/lib.commonjs/wordlists/bit-reader.js index 81e244227..caa2888de 100644 --- a/lib.commonjs/wordlists/bit-reader.js +++ b/lib.commonjs/wordlists/bit-reader.js @@ -1,6 +1,5 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeBits = void 0; +'use strict'; + const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; /** * @_ignore @@ -32,5 +31,6 @@ function decodeBits(width, data) { } return result; } + exports.decodeBits = decodeBits; -//# sourceMappingURL=bit-reader.js.map \ No newline at end of file +//# sourceMappingURL=bit-reader.js.map diff --git a/lib.commonjs/wordlists/bit-reader.js.map b/lib.commonjs/wordlists/bit-reader.js.map index 9a1ae1127..28b3137a2 100644 --- a/lib.commonjs/wordlists/bit-reader.js.map +++ b/lib.commonjs/wordlists/bit-reader.js.map @@ -1 +1 @@ -{"version":3,"file":"bit-reader.js","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":";;;AAAA,MAAM,MAAM,GACV,kEAAkE,CAAC;AAErE;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAa,EAAE,IAAY;IACpD,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,IAAI,KAAK,GAAG,CAAC,EACX,IAAI,GAAG,CAAC,EACR,KAAK,GAAG,CAAC,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,4BAA4B;QAC5B,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,CAAC;QAEV,qCAAqC;QACrC,OAAO,IAAI,IAAI,KAAK,EAAE;YACpB,mBAAmB;YACnB,MAAM,KAAK,GAAG,KAAK,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;YACtC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,IAAI,KAAK,CAAC;YAEd,kDAAkD;YAClD,kCAAkC;YAClC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,KAAK,IAAI,QAAQ,CAAC;aACnB;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;gBAC3B,KAAK,GAAG,CAAC,CAAC;aACX;SACF;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA9BD,gCA8BC"} \ No newline at end of file +{"version":3,"file":"bit-reader.js","sources":["../../lib.esm/wordlists/bit-reader.js"],"sourcesContent":["const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map"],"names":[],"mappings":";;AAAA,MAAM,MAAM,GAAG,kEAAkE;AACjF;AACA;AACA;AACO,SAAS,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE;AACxC,IAAI,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC;AACrC,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC;AACtC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1C;AACA,QAAQ,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtD,QAAQ,IAAI,IAAI,CAAC;AACjB;AACA,QAAQ,OAAO,IAAI,IAAI,KAAK,EAAE;AAC9B;AACA,YAAY,MAAM,KAAK,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC;AACjD,YAAY,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AAC9C,YAAY,IAAI,IAAI,KAAK;AACzB;AACA;AACA,YAAY,IAAI,KAAK,KAAK,CAAC,EAAE;AAC7B,gBAAgB,KAAK,IAAI,QAAQ;AACjC,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAC1C,gBAAgB,KAAK,GAAG,CAAC;AACzB,YAAY;AACZ,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/decode-owl.js b/lib.commonjs/wordlists/decode-owl.js index 9ee1c18b6..7c3e1ec98 100644 --- a/lib.commonjs/wordlists/decode-owl.js +++ b/lib.commonjs/wordlists/decode-owl.js @@ -1,7 +1,14 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeOwl = exports.decode = void 0; -const index_js_1 = require("../utils/index.js"); +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; const Word = /^[a-z]*$/i; function unfold(words, sep) { @@ -48,13 +55,14 @@ function decode(data, subs) { /* c8 ignore stop */ return unfold(unfold(clumps, ";"), ":"); } -exports.decode = decode; /** * @_ignore */ function decodeOwl(data) { - (0, index_js_1.assertArgument)(data[0] === "0", "unsupported auwl data", "data", data); + errors.assertArgument(data[0] === "0", "unsupported auwl data", "data", data); return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); } + +exports.decode = decode; exports.decodeOwl = decodeOwl; -//# sourceMappingURL=decode-owl.js.map \ No newline at end of file +//# sourceMappingURL=decode-owl.js.map diff --git a/lib.commonjs/wordlists/decode-owl.js.map b/lib.commonjs/wordlists/decode-owl.js.map index 731a6bba5..4b334abef 100644 --- a/lib.commonjs/wordlists/decode-owl.js.map +++ b/lib.commonjs/wordlists/decode-owl.js.map @@ -1 +1 @@ -{"version":3,"file":"decode-owl.js","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owl.ts"],"names":[],"mappings":";;;AAAA,gDAAmD;AAEnD,MAAM,QAAQ,GAAG,+BAA+B,CAAC;AACjD,MAAM,IAAI,GAAG,WAAW,CAAC;AAEzB,SAAS,MAAM,CAAC,KAAoB,EAAE,GAAW;IAC/C,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,OAAO,KA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CAAC;SACjC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CACF,CAAC;IACF,qBAAqB;IACrB,IAAI,QAAQ,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;KAC3D;IACD,oBAAoB;IAEpB,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC1C,CAAC;AA5BD,wBA4BC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,IAAY;IACpC,IAAA,yBAAc,EAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,uBAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAEvE,OAAO,MAAM,CACX,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,EACvC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAC3C,CAAC;AACJ,CAAC;AAPD,8BAOC"} \ No newline at end of file +{"version":3,"file":"decode-owl.js","sources":["../../lib.esm/wordlists/decode-owl.js"],"sourcesContent":["import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map"],"names":["assertArgument"],"mappings":";;;;;;;;;;;AACA,MAAM,QAAQ,GAAG,+BAA+B;AAChD,MAAM,IAAI,GAAG,WAAW;AACxB,SAAS,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE;AAC5B,IAAI,IAAI,OAAO,GAAG,EAAE;AACpB,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK;AACzC,QAAQ,IAAI,IAAI,KAAK,GAAG,EAAE;AAC1B,YAAY,OAAO,EAAE;AACrB,QAAQ;AACR,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;AACnC,YAAY,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAC3D,QAAQ;AACR,aAAa;AACb,YAAY,OAAO,GAAG,EAAE;AACxB,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5B,QAAQ;AACR,QAAQ,OAAO,KAAK;AACpB,IAAI,CAAC,EAAE,EAAE,CAAC;AACV;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE;AACnC;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,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AAS,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;AACtG;;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/decode-owla.js b/lib.commonjs/wordlists/decode-owla.js index 59dab2985..18ad0d1be 100644 --- a/lib.commonjs/wordlists/decode-owla.js +++ b/lib.commonjs/wordlists/decode-owla.js @@ -1,20 +1,27 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeOwlA = void 0; -const index_js_1 = require("../utils/index.js"); -const bit_reader_js_1 = require("./bit-reader.js"); -const decode_owl_js_1 = require("./decode-owl.js"); +'use strict'; + +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +var bitReader = require('./bit-reader.js'); +var decodeOwl = require('./decode-owl.js'); + /** * @_ignore */ function decodeOwlA(data, accents) { - let words = (0, decode_owl_js_1.decodeOwl)(data).join(","); + let words = decodeOwl.decodeOwl(data).join(","); // Inject the accents accents.split(/,/g).forEach((accent) => { const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - (0, index_js_1.assertArgument)(match !== null, "internal error parsing accents", "accents", accents); + errors.assertArgument(match !== null, "internal error parsing accents", "accents", accents); let posOffset = 0; - const positions = (0, bit_reader_js_1.decodeBits)(parseInt(match[3]), match[4]); + const positions = bitReader.decodeBits(parseInt(match[3]), match[4]); const charCode = parseInt(match[2]); const regex = new RegExp(`([${match[1]}])`, "g"); words = words.replace(regex, (all, letter) => { @@ -28,5 +35,6 @@ function decodeOwlA(data, accents) { }); return words.split(","); } + exports.decodeOwlA = decodeOwlA; -//# sourceMappingURL=decode-owla.js.map \ No newline at end of file +//# sourceMappingURL=decode-owla.js.map diff --git a/lib.commonjs/wordlists/decode-owla.js.map b/lib.commonjs/wordlists/decode-owla.js.map index e6eca1730..9005a9f01 100644 --- a/lib.commonjs/wordlists/decode-owla.js.map +++ b/lib.commonjs/wordlists/decode-owla.js.map @@ -1 +1 @@ -{"version":3,"file":"decode-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],"names":[],"mappings":";;;AAAA,gDAAmD;AAEnD,mDAA6C;AAC7C,mDAA4C;AAE5C;;GAEG;AACH,SAAgB,UAAU,CAAC,IAAY,EAAE,OAAe;IACtD,IAAI,KAAK,GAAG,IAAA,yBAAS,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEtC,qBAAqB;IACrB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC5D,IAAA,yBAAc,EACZ,KAAK,KAAK,IAAI,EACd,gCAAgC,EAChC,SAAS,EACT,OAAO,CACR,CAAC;QAEF,IAAI,SAAS,GAAG,CAAC,CAAC;QAClB,MAAM,SAAS,GAAG,IAAA,0BAAU,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3D,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACjD,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YAC3C,MAAM,GAAG,GAAG,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;YACnC,IAAI,GAAG,KAAK,CAAC,EAAE;gBACb,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;gBAC7D,SAAS,EAAE,CAAC;aACb;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1B,CAAC;AA5BD,gCA4BC"} \ No newline at end of file +{"version":3,"file":"decode-owla.js","sources":["../../lib.esm/wordlists/decode-owla.js"],"sourcesContent":["import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map"],"names":["decodeOwl","assertArgument","decodeBits"],"mappings":";;;;;;;;;;;;;AAGA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE;AAC1C,IAAI,IAAI,KAAK,GAAGA,mBAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACzC;AACA,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK;AAC5C,QAAQ,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC;AACnE,QAAQC,qBAAc,CAAC,KAAK,KAAK,IAAI,EAAE,gCAAgC,EAAE,SAAS,EAAE,OAAO,CAAC;AAC5F,QAAQ,IAAI,SAAS,GAAG,CAAC;AACzB,QAAQ,MAAM,SAAS,GAAGC,oBAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAClE,QAAQ,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3C,QAAQ,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC;AACxD,QAAQ,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK;AACtD,YAAY,MAAM,GAAG,GAAG,EAAE,SAAS,CAAC,SAAS,CAAC;AAC9C,YAAY,IAAI,GAAG,KAAK,CAAC,EAAE;AAC3B,gBAAgB,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC;AAC5E,gBAAgB,SAAS,EAAE;AAC3B,YAAY;AACZ,YAAY,OAAO,MAAM;AACzB,QAAQ,CAAC,CAAC;AACV,IAAI,CAAC,CAAC;AACN,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC3B;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/enwords.d.ts.map b/lib.commonjs/wordlists/enwords.d.ts.map index 95d94c6d6..ff2c89431 100644 --- a/lib.commonjs/wordlists/enwords.d.ts.map +++ b/lib.commonjs/wordlists/enwords.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"enwords.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,i0VAC4yV,CAAC"} \ No newline at end of file +{"version":3,"file":"enwords.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,i0VAC2yV,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/enwords.js b/lib.commonjs/wordlists/enwords.js index 29672cf0e..1ddd20b6d 100644 --- a/lib.commonjs/wordlists/enwords.js +++ b/lib.commonjs/wordlists/enwords.js @@ -1,5 +1,6 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.enWords = void 0; -exports.enWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=enwords.js.map \ No newline at end of file +'use strict'; + +const enWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; + +exports.enWords = enWords; +//# sourceMappingURL=enwords.js.map diff --git a/lib.commonjs/wordlists/enwords.js.map b/lib.commonjs/wordlists/enwords.js.map index 854fe5937..e800acf26 100644 --- a/lib.commonjs/wordlists/enwords.js.map +++ b/lib.commonjs/wordlists/enwords.js.map @@ -1 +1 @@ -{"version":3,"file":"enwords.js","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAClB,8zVAA8zV,CAAC"} \ No newline at end of file +{"version":3,"file":"enwords.js","sources":["../../lib.esm/wordlists/enwords.js"],"sourcesContent":["export const enWords = \"AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo\";\n//# sourceMappingURL=enwords.js.map"],"names":[],"mappings":";;AAAY,MAAC,OAAO,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/generation/encode-latin.d.ts.map b/lib.commonjs/wordlists/generation/encode-latin.d.ts.map index 87eca3714..0a1f29f5d 100644 --- a/lib.commonjs/wordlists/generation/encode-latin.d.ts.map +++ b/lib.commonjs/wordlists/generation/encode-latin.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAyIA,qBAAa,SAAS;;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAKX,KAAK,EAAE,MAAM;IAMzB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAW1B,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA8BjB;CACF;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IACpD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB,CA+FA;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAmDA"} \ No newline at end of file +{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAyIA,qBAAa,SAAS;;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAKvB,YAAY,KAAK,EAAE,MAAM,EAIxB;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CASzB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA8BjB;CACD;AAED,MAAM,WAAW,SAAS;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IACrD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,CA+FA;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb,CAmDA"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/generation/encode-latin.js b/lib.commonjs/wordlists/generation/encode-latin.js index 23f41af88..c79ba11ad 100644 --- a/lib.commonjs/wordlists/generation/encode-latin.js +++ b/lib.commonjs/wordlists/generation/encode-latin.js @@ -1,4 +1,10 @@ -"use strict"; +'use strict'; + +var fs = require('fs'); +var id = require('../../hash/id.js'); +var decodeOwl = require('../decode-owl.js'); +var decodeOwla = require('../decode-owla.js'); + // OWL Data Format // // The Official WordList data format exported by this encoder @@ -57,13 +63,6 @@ // The base-64 set used has all number replaced with their // shifted-counterparts to prevent comflicting with the numbers used in // the fold operation to indicate the number of ";". -Object.defineProperty(exports, "__esModule", { value: true }); -exports.encodeOwl = exports.extractAccents = exports.BitWriter = void 0; -const tslib_1 = require("tslib"); -const fs_1 = tslib_1.__importDefault(require("fs")); -const id_js_1 = require("../../hash/id.js"); -const decode_owl_js_1 = require("../decode-owl.js"); -const decode_owla_js_1 = require("../decode-owla.js"); const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; const Word = /^[a-z'`]*$/i; function fold(words, sep) { @@ -178,7 +177,6 @@ class BitWriter { return result; } } -exports.BitWriter = BitWriter; function sorted(text) { const letters = text.split(""); letters.sort(); @@ -273,7 +271,6 @@ function extractAccents(words) { }); return { accents, words }; } -exports.extractAccents = extractAccents; // Encode Official WordList function encodeOwl(words) { // Fold the sorted words by indicating delta for the first 2 letters @@ -319,7 +316,6 @@ function encodeOwl(words) { } return { data, subs }; } -exports.encodeOwl = encodeOwl; // Returns either: // - OWL data for accent-free latin-1: { data, accentds: "" } // - OWLA data for accented latin-1: { data, accents } @@ -337,28 +333,32 @@ function encodeWords(_words) { }; } // CLI -const content = fs_1.default.readFileSync(process.argv[2]).toString(); +const content = fs.readFileSync(process.argv[2]).toString(); const words = content.split("\n").filter(Boolean); const { data, accents } = encodeWords(words); if (accents) { - const rec = (0, decode_owla_js_1.decodeOwlA)(data, accents); + const rec = decodeOwla.decodeOwlA(data, accents); console.log("DATA: ", JSON.stringify(data)); console.log("ACCENTS: ", JSON.stringify(accents)); console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", (0, id_js_1.id)(content)); + console.log("CHECKSUM: ", id.id(content)); console.log("RATIO: ", Math.trunc((100 * data.length) / content.length) + "%"); if (rec.join("\n") !== words.join("\n")) { throw new Error("no match!"); } } else { - const rec = (0, decode_owl_js_1.decodeOwl)(data); + const rec = decodeOwl.decodeOwl(data); console.log("DATA: ", JSON.stringify(data)); console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", (0, id_js_1.id)(content)); + console.log("CHECKSUM: ", id.id(content)); console.log("RATIO: ", Math.trunc((100 * data.length) / content.length) + "%"); if (rec.join("\n") !== words.join("\n")) { throw new Error("no match!"); } } -//# sourceMappingURL=encode-latin.js.map \ No newline at end of file + +exports.BitWriter = BitWriter; +exports.encodeOwl = encodeOwl; +exports.extractAccents = extractAccents; +//# sourceMappingURL=encode-latin.js.map diff --git a/lib.commonjs/wordlists/generation/encode-latin.js.map b/lib.commonjs/wordlists/generation/encode-latin.js.map index 1f75bb288..967dac258 100644 --- a/lib.commonjs/wordlists/generation/encode-latin.js.map +++ b/lib.commonjs/wordlists/generation/encode-latin.js.map @@ -1 +1 @@ -{"version":3,"file":"encode-latin.js","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":";AAAA,kBAAkB;AAClB,EAAE;AACF,6DAA6D;AAC7D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AC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAA,UAAE,EAAC,OAAO,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CACT,YAAY,EACZ,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CACvD,CAAC;IACF,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;KAC9B;CACF"} \ No newline at end of file +{"version":3,"file":"encode-latin.js","sources":["../../../lib.esm/wordlists/generation/encode-latin.js"],"sourcesContent":["// OWL Data Format\n//\n// The Official WordList data format exported by this encoder\n// encodes sorted latin-1 words (letters only) based on the\n// fact that sorted words have prefixes with substantial\n// overlap.\n//\n// For example, the words:\n// [ Another, Apple, Apricot, Bread ]\n// could be folded once with a single special character, such\n// as \":\" to yield:\n// [ nother, pple, pricot, :, read ].\n// The First letter has been removed, but can be inferred by\n// starting at A and incrementing to the next letter when \":\"\n// is encountered.\n//\n// The fold operation can be repeated for large sets as even within\n// each folded set, there is substatial overlap in prefix. With the\n// second special symbol \";\", we get:\n// [ ; x 13, other, :, ple, ricot, :, ; x 18, ead ]\n// which can be further compressed by using numbers instead of the\n// special character:\n// [ 13, other, :, ple, ricot, :, 18, ead ]\n// and to keep all values within a single byte, we only allow a\n// maximum value of 10 (using 0 through 9 to represent 1 through 10),\n// we get:\n// [ 9, 2, other, :, ple, ricot, :, 9, 7, ead ]\n// and we use camel-case to imply the bounrary, giving the final string:\n// \"92Other:PleRicot:97Ead\"\n//\n// Once the entire latin-1 set has been collapsed, we use the remaining\n// printable characters (except \" and \\, which require 2 bytes to represent\n// in string) to substiture for the most common 2-letter pairs of letters\n// in the string.\n//\n// OWLA Accent Format\n//\n// OWLA first removes all accents, and encodes that data using the OWL\n// data format and encodes the accents as a base-64 series of 6-bit\n// packed bits representing the distance from one followed letter to the\n// next.\n//\n// For example, the acute accent in a given language may follow either\n// a or e, in which case the follow-set is \"ae\". Each letter in the entire\n// set is indexed, so the set of words with the accents:\n// \"thisA/ppleDoe/sNotMa/tterToMe/\"\n// \" 1^ 2^ 3^ 4^ 5^ 6^ \" <-- follow-set members, ALL a's and e's\n// which gives the positions:\n// [ 0, 2, 3, 4, 6 ]\n// which then reduce to the distances\n// [ 0, 2, 1, 1, 2 ]\n// each of which fit into a 2-bit value, so this can be encoded as the\n// base-64 encoded string:\n// 00 10 01 01 10 = 001001 1010xx\n//\n// The base-64 set used has all number replaced with their\n// shifted-counterparts to prevent comflicting with the numbers used in\n// the fold operation to indicate the number of \";\".\nimport fs from \"fs\";\nimport { id } from \"../../hash/id.js\";\nimport { decodeOwl } from \"../decode-owl.js\";\nimport { decodeOwlA } from \"../decode-owla.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z'`]*$/i;\nfunction fold(words, sep) {\n const output = [];\n let initial = 97;\n for (const word of words) {\n if (word.match(Word)) {\n while (initial < word.charCodeAt(0)) {\n initial++;\n output.push(sep);\n }\n output.push(word.substring(1));\n }\n else {\n initial = 97;\n output.push(word);\n }\n }\n return output;\n}\nfunction camelcase(words) {\n return words\n .map((word) => {\n if (word.match(Word)) {\n return word[0].toUpperCase() + word.substring(1);\n }\n else {\n return word;\n }\n })\n .join(\"\");\n}\n//let cc = 0, ce = 0;\n/*\nfunction getChar(c: string): string {\n //if (c === \"e\") { ce++; }\n if (c >= 'a' && c <= 'z') { return c; }\n if (c.charCodeAt(1)) {\n throw new Error(`bad char: \"${ c }\"`);\n }\n //cc++;\n return \"\";\n if (c.charCodeAt(0) === 768) { return \"`\"; }\n if (c.charCodeAt(0) === 769) { return \"'\"; }\n if (c.charCodeAt(0) === 771) { return \"~\"; }\n throw new Error(`Unsupported character: ${ c } (${ c.charCodeAt(0) }, ${ c.charCodeAt(1) })`);\n}\nfunction mangle(text: string): { word: string, special: string } {\n const result: Array = [ ];\n for (let i = 0; i < text.length; i++) {\n const c = getChar(text[i]);\n result.push(c);\n }\n\n const word = result.join(\"\");\n if (word[1] >= 'a' && word[1] <= 'z') { return { word, special: \" \" }; }\n return { word: word[0] + word.substring(2), special: word[1] };\n}\n*/\n/*\n Store: [ accent ][ targets ][ rle data; base64-tail ]\n ` ae 3, 100 = (63, 37), 15\n ~ n 63, 64 = (63, 1), 27\n*/\nconst Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\nexport class BitWriter {\n width;\n #data;\n #bitLength;\n constructor(width) {\n this.width = width;\n this.#data = [];\n this.#bitLength = 0;\n }\n write(value) {\n const maxValue = (1 << this.width) - 1;\n while (value > maxValue) {\n this.#data.push(0);\n this.#bitLength += this.width;\n value -= maxValue;\n }\n this.#data.push(value);\n this.#bitLength += this.width;\n }\n get length() {\n return 1 + Math.trunc((this.#bitLength + 5) / 6);\n }\n get data() {\n let result = String(this.width);\n let bits = 0;\n let accum = 0;\n const data = this.#data.slice();\n let bitMod = this.#bitLength % 6;\n while (bitMod !== 0 && bitMod < 6) {\n data.push(0);\n bitMod += this.width;\n }\n for (const value of data) {\n accum <<= this.width;\n accum |= value;\n bits += this.width;\n if (bits < 6) {\n continue;\n }\n result += Base64[accum >> (bits - 6)];\n bits -= 6;\n accum &= (1 << bits) - 1;\n }\n if (result.length !== this.length) {\n throw new Error(`Hmm: ${this.length} ${result.length} ${result}`);\n }\n return result;\n }\n}\nfunction sorted(text) {\n const letters = text.split(\"\");\n letters.sort();\n return letters.join(\"\");\n}\n// if (c.charCodeAt(0) === 768) { return \"`\"; }\n// if (c.charCodeAt(0) === 769) { return \"'\"; }\n// if (c.charCodeAt(0) === 771) { return \"~\"; }\nexport function extractAccents(words) {\n // Build a list that maps accents to the letters it can follow\n const followsMap = new Map();\n for (const word of words) {\n for (let i = 0; i < word.length; i++) {\n const c = word[i];\n if (c >= \"a\" && c <= \"z\") {\n continue;\n }\n // Make sure this positions and codepoint make sense\n if (c.charCodeAt(1)) {\n throw new Error(`unsupported codepoint: \"${c}\"`);\n }\n if (i === 0) {\n throw new Error(`unmatched accent: ${c}`);\n }\n const ac = c.charCodeAt(0), lastLetter = word[i - 1];\n const follows = followsMap.get(ac) || \"\";\n if (follows.indexOf(lastLetter) === -1) {\n followsMap.set(ac, sorted(follows + lastLetter));\n }\n }\n }\n // Build the positions of each follow-set for those accents\n const positionsMap = new Map();\n for (const [accent, follows] of followsMap) {\n let count = 0;\n for (const word of words) {\n for (let i = 0; i < word.length; i++) {\n const c = word[i], ac = c.charCodeAt(0);\n if (follows.indexOf(c) >= 0) {\n count++;\n }\n if (ac === accent) {\n const pos = positionsMap.get(ac) || [];\n pos.push(count);\n positionsMap.set(ac, pos);\n }\n }\n }\n }\n const accents = [];\n for (const [accent, follows] of followsMap) {\n let last = -1;\n const positions = (positionsMap.get(accent) || []).map((value, index) => {\n const delta = value - last;\n last = value;\n if (index === 0) {\n return value;\n }\n return delta;\n });\n // Find the best encoding of the position data\n let positionData = \"\";\n for (let i = 2; i < 7; i++) {\n const bitWriter = new BitWriter(i);\n for (const p of positions) {\n bitWriter.write(p);\n }\n if (positionData === \"\" || bitWriter.length < positionData.length) {\n positionData = bitWriter.data;\n }\n }\n const positionsLength = positions.length;\n const positionDataLength = positionData.length;\n accents.push({\n accent,\n follows,\n positions,\n positionsLength,\n positionData,\n positionDataLength,\n });\n }\n words = words.map((word) => {\n let result = \"\";\n for (let i = 0; i < word.length; i++) {\n const c = word[i];\n if (c >= \"a\" && c <= \"z\") {\n result += c;\n }\n }\n return result;\n });\n return { accents, words };\n}\n// Encode Official WordList\nexport function encodeOwl(words) {\n // Fold the sorted words by indicating delta for the first 2 letters\n let data = camelcase(fold(fold(words, \":\"), \";\"));\n // Replace semicolons with counts (e.g. \";;;\" with \"3\")\n data = data.replace(/(;+)/g, (all, semis) => {\n let result = \"\";\n while (semis.length) {\n let count = semis.length;\n if (count > 10) {\n count = 10;\n }\n result += String(count - 1);\n semis = semis.substring(count);\n }\n return result;\n });\n // Finds the best option for a shortcut replacement using the\n // unused ascii7 characters\n function findBest() {\n const tally = {};\n const l = 2;\n for (let i = l; i < data.length; i++) {\n const key = data.substring(i - l, i);\n tally[key] = (tally[key] || 0) + 1;\n }\n const sorted = Object.keys(tally).map((text) => {\n return {\n text,\n count: tally[text],\n save: tally[text] * (text.length - 1),\n };\n });\n sorted.sort((a, b) => b.save - a.save);\n return sorted[0].text;\n }\n // Make substitutions\n let subs = \"\";\n for (let i = 0; i < subsChrs.length; i++) {\n const n = subsChrs[i], o = findBest();\n subs += o;\n data = data.split(o).join(n);\n }\n return { data, subs };\n}\n// Returns either:\n// - OWL data for accent-free latin-1: { data, accentds: \"\" }\n// - OWLA data for accented latin-1: { data, accents }\nfunction encodeWords(_words) {\n const { accents, words } = extractAccents(_words);\n const { data, subs } = encodeOwl(words);\n const accentData = accents\n .map(({ accent, follows, positionData }) => {\n return `${follows}${accent}${positionData}`;\n })\n .join(\",\");\n return {\n data: `0${subs}${data}`,\n accents: accentData,\n };\n}\n// CLI\nconst content = fs.readFileSync(process.argv[2]).toString();\nconst words = content.split(\"\\n\").filter(Boolean);\nconst { data, accents } = encodeWords(words);\nif (accents) {\n const rec = decodeOwlA(data, accents);\n console.log(\"DATA: \", JSON.stringify(data));\n console.log(\"ACCENTS: \", JSON.stringify(accents));\n console.log(\"LENGTH: \", data.length);\n console.log(\"CHECKSUM: \", id(content));\n console.log(\"RATIO: \", Math.trunc((100 * data.length) / content.length) + \"%\");\n if (rec.join(\"\\n\") !== words.join(\"\\n\")) {\n throw new Error(\"no match!\");\n }\n}\nelse {\n const rec = decodeOwl(data);\n console.log(\"DATA: \", JSON.stringify(data));\n console.log(\"LENGTH: \", data.length);\n console.log(\"CHECKSUM: \", id(content));\n console.log(\"RATIO: \", Math.trunc((100 * data.length) / content.length) + \"%\");\n if (rec.join(\"\\n\") !== words.join(\"\\n\")) {\n throw new Error(\"no match!\");\n }\n}\n//# sourceMappingURL=encode-latin.js.map"],"names":["decodeOwlA","id","decodeOwl"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,MAAM,QAAQ,GAAG,+BAA+B;AAChD,MAAM,IAAI,GAAG,aAAa;AAC1B,SAAS,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;AAC1B,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,IAAI,OAAO,GAAG,EAAE;AACpB,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;AAC9B,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;AAC9B,YAAY,OAAO,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;AACjD,gBAAgB,OAAO,EAAE;AACzB,gBAAgB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AAChC,YAAY;AACZ,YAAY,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC1C,QAAQ;AACR,aAAa;AACb,YAAY,OAAO,GAAG,EAAE;AACxB,YAAY,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;AAC7B,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,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GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AACrF,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC7C,QAAQ,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC;AACpC,IAAI;AACJ;AACA,KAAK;AACL,IAAI,MAAM,GAAG,GAAGC,mBAAS,CAAC,IAAI,CAAC;AAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACnD,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC;AAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAED,KAAE,CAAC,OAAO,CAAC,CAAC;AAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AACrF,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC7C,QAAQ,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC;AACpC,IAAI;AACJ;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/index.js b/lib.commonjs/wordlists/index.js index 26e29cf5f..4b079f673 100644 --- a/lib.commonjs/wordlists/index.js +++ b/lib.commonjs/wordlists/index.js @@ -1,33 +1,16 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlists = exports.WordlistOwlA = exports.WordlistOwl = exports.LangEn = exports.Wordlist = void 0; -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -var wordlist_js_1 = require("./wordlist.js"); -Object.defineProperty(exports, "Wordlist", { enumerable: true, get: function () { return wordlist_js_1.Wordlist; } }); -var lang_en_js_1 = require("./lang-en.js"); -Object.defineProperty(exports, "LangEn", { enumerable: true, get: function () { return lang_en_js_1.LangEn; } }); -var wordlist_owl_js_1 = require("./wordlist-owl.js"); -Object.defineProperty(exports, "WordlistOwl", { enumerable: true, get: function () { return wordlist_owl_js_1.WordlistOwl; } }); -var wordlist_owla_js_1 = require("./wordlist-owla.js"); -Object.defineProperty(exports, "WordlistOwlA", { enumerable: true, get: function () { return wordlist_owla_js_1.WordlistOwlA; } }); -var wordlists_js_1 = require("./wordlists.js"); -Object.defineProperty(exports, "wordlists", { enumerable: true, get: function () { return wordlists_js_1.wordlists; } }); -//# sourceMappingURL=index.js.map \ No newline at end of file +'use strict'; + +var wordlist = require('./wordlist.js'); +var langEn = require('./lang-en.js'); +var wordlistOwl = require('./wordlist-owl.js'); +var wordlistOwla = require('./wordlist-owla.js'); +var wordlists = require('./wordlists.js'); + + + +exports.Wordlist = wordlist.Wordlist; +exports.LangEn = langEn.LangEn; +exports.WordlistOwl = wordlistOwl.WordlistOwl; +exports.WordlistOwlA = wordlistOwla.WordlistOwlA; +exports.wordlists = wordlists.wordlists; +//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/wordlists/index.js.map b/lib.commonjs/wordlists/index.js.map index fe47560b2..7d29fe54e 100644 --- a/lib.commonjs/wordlists/index.js.map +++ b/lib.commonjs/wordlists/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wordlists/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,6CAAyC;AAAhC,uGAAA,QAAQ,OAAA;AACjB,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AAEf,qDAAgD;AAAvC,8GAAA,WAAW,OAAA;AACpB,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AAErB,+CAA2C;AAAlC,yGAAA,SAAS,OAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-cz.d.ts.map b/lib.commonjs/wordlists/lang-cz.d.ts.map index 0db7b336b..344196e7e 100644 --- a/lib.commonjs/wordlists/lang-cz.d.ts.map +++ b/lib.commonjs/wordlists/lang-cz.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-cz.js b/lib.commonjs/wordlists/lang-cz.js index 89f71c683..89d81d54f 100644 --- a/lib.commonjs/wordlists/lang-cz.js +++ b/lib.commonjs/wordlists/lang-cz.js @@ -1,7 +1,7 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangCz = void 0; -const wordlist_owl_js_1 = require("./wordlist-owl.js"); +'use strict'; + +var wordlistOwl = require('./wordlist-owl.js'); + const words = "0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNzZ(2O&2KolivUv!4It_N(0Dn(Ke)KrPot0Ak~AlIkRkot2Kli$a:L-oRe[T_Tum1E,1B!a}'#Cib_Fic Fla%KlKr{Mokr!PreseRbyS#T-tiv3Kob,zKt|O^P]mSkSp+jV`]Vo/2AhaOuhoUhopis1Es0BroByt-C@t}ut DnesH+dHo^H,JemJn?Kl`KolaKtAzeDolObn(OgerieOzdSn(T Z(2B@}'noD-HaH'#S SnoT(0Oj?Or>2Nam :9O]gOnomie0EktronIpsa0AilIseO%P!ie2Izo^O/aOpejOs2EjEn%K<)Kymo0Ike)0FR&S]Zky3StOhOup(T!Ub.U/o)0AtO)Yz0IsOjivoOut0Bl.Boj}DinyDl!Dno)D|Jn(KejLin#L#LubMo+N [No,%RalR^RizontRkoRliv>RmonRn.RoskopR$voSpo^St.T'(U[UfUp!Us#V<2Ad[An?Av(Az^Bo+kD.D]D(N-Ob#Oma^OtOu^Oz@St#Ub(Yz!2B@(B~D[KotMrS aSto)0Ozd2Bn(D,ntGie&M&Sterik:2Yl#3Ned2O&0Uze0Un a0F-%Fla%KasoOva%Sp-%Tern{Vali^Ve$N)r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Ji$ K+p!K*p Lep Mez Mot!Mys+tNe/!Nik!Pl! Poj Ps!Raz S)v Su~Taj Temn Tk~Ujm=Val Ve+tVin Vol!Vrt!Zvon 0Av RusuUd|Yt-1A+#ArmaAtn(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk"; const checksum = "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; let wordlist = null; @@ -10,7 +10,7 @@ let wordlist = null; * * @_docloc: api/wordlists */ -class LangCz extends wordlist_owl_js_1.WordlistOwl { +class LangCz extends wordlistOwl.WordlistOwl { /** * Creates a new instance of the Czech language Wordlist. * @@ -33,5 +33,6 @@ class LangCz extends wordlist_owl_js_1.WordlistOwl { return wordlist; } } + exports.LangCz = LangCz; -//# sourceMappingURL=lang-cz.js.map \ No newline at end of file +//# sourceMappingURL=lang-cz.js.map diff --git a/lib.commonjs/wordlists/lang-cz.js.map b/lib.commonjs/wordlists/lang-cz.js.map index 5a2cb0aae..1d980703a 100644 --- a/lib.commonjs/wordlists/lang-cz.js.map +++ b/lib.commonjs/wordlists/lang-cz.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-cz.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":";;;AAAA,uDAAgD;AAEhD,MAAM,KAAK,GACT,q9NAAq9N,CAAC;AACx9N,MAAM,QAAQ,GACZ,oEAAoE,CAAC;AAEvE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAa,MAAO,SAAQ,6BAAW;IACrC;;;;;;;OAOG;IACH;QACE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAvBD,wBAuBC"} \ No newline at end of file +{"version":3,"file":"lang-cz.js","sources":["../../lib.esm/wordlists/lang-cz.js"],"sourcesContent":["import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNzZ(2O&2KolivUv!4It_N(0Dn(Ke)KrPot0Ak~AlIkRkot2Kli$a:L-oRe[T_Tum1E,1B!a}'#Cib_Fic Fla%KlKr{Mokr!PreseRbyS#T-tiv3Kob,zKt|O^P]mSkSp+jV`]Vo/2AhaOuhoUhopis1Es0BroByt-C@t}ut DnesH+dHo^H,JemJn?Kl`KolaKtAzeDolObn(OgerieOzdSn(T Z(2B@}'noD-HaH'#S SnoT(0Oj?Or>2Nam :9O]gOnomie0EktronIpsa0AilIseO%P!ie2Izo^O/aOpejOs2EjEn%K<)Kymo0Ike)0FR&S]Zky3StOhOup(T!Ub.U/o)0AtO)Yz0IsOjivoOut0Bl.Boj}DinyDl!Dno)D|Jn(KejLin#L#LubMo+N [No,%RalR^RizontRkoRliv>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aTu+0Ad T*p Tup0Ip4Bav Br!}|D!D,Fot H+d!H~Hod H,d Hub Jasn J{Jm=K]p Kon!L-!Maz!Mez Miz{Mys+tNe/!Nik!Nut P`!Pl! P,v Pu$ Raz R'n!Rv!Sl' SokoS)v Su~Syp!Tas Tes!Tr! Vi~Vol!Vrh_Zdob Zn!0AduBud }op DJ{Ji$ K+p!K*p Lep Mez Mot!Mys+tNe/!Nik!Pl! Poj Ps!Raz S)v Su~Taj Temn Tk~Ujm=Val Ve+tVin Vol!Vrt!Zvon 0Av RusuUd|Yt-1A+#ArmaAtn(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk\";\nconst checksum = \"0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a\";\nlet wordlist = null;\n/**\n * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangCz extends WordlistOwl {\n /**\n * Creates a new instance of the Czech language Wordlist.\n *\n * Using the constructor should be unnecessary, instead use the\n * [[wordlist]] singleton method.\n *\n * @_ignore:\n */\n constructor() {\n super(\"cz\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangCz``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangCz();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-cz.js.map"],"names":["WordlistOwl"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,q9NAAq9N;AACn+N,MAAM,QAAQ,GAAG,oEAAoE;AACrF,IAAI,QAAQ,GAAG,IAAI;AACnB;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,uBAAW,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-en.d.ts.map b/lib.commonjs/wordlists/lang-en.d.ts.map index c43c99b64..bcff43d4d 100644 --- a/lib.commonjs/wordlists/lang-en.d.ts.map +++ b/lib.commonjs/wordlists/lang-en.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-en.js b/lib.commonjs/wordlists/lang-en.js index 960dc39b9..fa2429b53 100644 --- a/lib.commonjs/wordlists/lang-en.js +++ b/lib.commonjs/wordlists/lang-en.js @@ -1,7 +1,7 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangEn = void 0; -const wordlist_owl_js_1 = require("./wordlist-owl.js"); +'use strict'; + +var wordlistOwl = require('./wordlist-owl.js'); + const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+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Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; let wordlist = null; @@ -10,7 +10,7 @@ let wordlist = null; * * @_docloc: api/wordlists */ -class LangEn extends wordlist_owl_js_1.WordlistOwl { +class LangEn extends wordlistOwl.WordlistOwl { /** * Creates a new instance of the English language Wordlist. * @@ -33,5 +33,6 @@ class LangEn extends wordlist_owl_js_1.WordlistOwl { return wordlist; } } + exports.LangEn = LangEn; -//# sourceMappingURL=lang-en.js.map \ No newline at end of file +//# sourceMappingURL=lang-en.js.map diff --git a/lib.commonjs/wordlists/lang-en.js.map b/lib.commonjs/wordlists/lang-en.js.map index 4d36d6979..e64a93b2e 100644 --- a/lib.commonjs/wordlists/lang-en.js.map +++ b/lib.commonjs/wordlists/lang-en.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-en.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":";;;AAAA,uDAAgD;AAEhD,MAAM,KAAK,GACT,u3LAAu3L,CAAC;AAC13L,MAAM,QAAQ,GACZ,oEAAoE,CAAC;AAEvE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAa,MAAO,SAAQ,6BAAW;IACrC;;;;;;;OAOG;IACH;QACE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAvBD,wBAuBC"} \ No newline at end of file +{"version":3,"file":"lang-en.js","sources":["../../lib.esm/wordlists/lang-en.js"],"sourcesContent":["import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em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Fu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"en\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map"],"names":["WordlistOwl"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,u3LAAu3L;AACr4L,MAAM,QAAQ,GAAG,oEAAoE;AACrF,IAAI,QAAQ,GAAG,IAAI;AACnB;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,uBAAW,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-es.d.ts.map b/lib.commonjs/wordlists/lang-es.d.ts.map index 1f4b7bb34..e52928599 100644 --- a/lib.commonjs/wordlists/lang-es.d.ts.map +++ b/lib.commonjs/wordlists/lang-es.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACtC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-es.js b/lib.commonjs/wordlists/lang-es.js index be6decdb1..e861d2758 100644 --- a/lib.commonjs/wordlists/lang-es.js +++ b/lib.commonjs/wordlists/lang-es.js @@ -1,7 +1,7 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangEs = void 0; -const wordlist_owla_js_1 = require("./wordlist-owla.js"); +'use strict'; + +var wordlistOwla = require('./wordlist-owla.js'); + const words = "0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZo3Bol]D!D+Ld/eb_LoAmpuAnc]ApaAr]I>Is)IvoOqueOzaUle%Up 0Cl.EgoE=EnEr#F[G +M->NeN%P_sR>Rue]SneTaU{d2Am^AnA+AseAveI,)ImaInica2B_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,Ffi|G$Ld#L[M`NdaNe|Nnife)Pi!Ppe(P-Rge!Rpas(Rri(R(R.gg'R_l#Spi)S+T^,0AdaAl/Arge!A /Av[ Azzo/EcieEdi!EgRappoReg#Ridu*Rozz&Ru|Ucc&UfoUp[@0B[t)C](Do!Gger{GoL+$On&PerboPpor Rgel#R)g#Ssur)Tu-0Ag&EdeseEgl'El&Enu Ez?IluppoIs+Izze-Ol+Uot&:Bac]Bul#Cci&Citur$LeLis`$MpoVer=Vo/+Zza3CaCn>Lefo$Me-r'MpoMu N@Pog-foRagg'RoTan'To*Tuban.Z'Zzo<5Cc&L,r&L Mbo/MoNfoNsil/Paz'Po*g?PpaRbaRn&R)L,t+Lo)(Lut&L_/Mpa+Ng&N{(NoN+gg'Nve-Po!Ra$Rc#R?n.S}3Det+DovaDu Ge+,I]*Lc)Li=Llu LoceN#Ndemm?N RaceRba,Rgog=Rif~RoRru}Rt~,Sc~Ssil*S+,Te-$Tri=Tus 3Andan.B-n.C[daChingoCi=nzaDim&Gil?G< Go!LeL/$MiniNc{!O/Pe-Rgo/Ro*goRu,n S](S'5Cche)Fo*LuPpa\";\nconst checksum = \"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620\";\nlet wordlist = null;\n/**\n * The [[link-bip39-it]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangIt extends WordlistOwl {\n /**\n * Creates a new instance of the Italian language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langIt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"it\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangIt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangIt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-it.js.map"],"names":["WordlistOwl"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,0+OAA0+O;AACx/O,MAAM,QAAQ,GAAG,oEAAoE;AACrF,IAAI,QAAQ,GAAG,IAAI;AACnB;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,uBAAW,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ja.d.ts.map b/lib.commonjs/wordlists/lang-ja.d.ts.map index f4acbfdf3..82a3ec1e4 100644 --- a/lib.commonjs/wordlists/lang-ja.d.ts.map +++ b/lib.commonjs/wordlists/lang-ja.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6IzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC;;;;;;;OAOG;;IAKH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6IzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ja.js b/lib.commonjs/wordlists/lang-ja.js index 288ec3a6d..6eecae492 100644 --- a/lib.commonjs/wordlists/lang-ja.js +++ b/lib.commonjs/wordlists/lang-ja.js @@ -1,9 +1,35 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangJa = void 0; -const index_js_1 = require("../hash/index.js"); -const index_js_2 = require("../utils/index.js"); -const wordlist_js_1 = require("./wordlist.js"); +'use strict'; + +var id = require('../hash/id.js'); +require('../constants/numbers.js'); +require('../address/index.js'); +require('../utils/base58.js'); +var data$1 = require('../utils/data.js'); +var errors = require('../utils/errors.js'); +require('../logger/logger.js'); +var utf8 = require('../utils/utf8.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +var wordlist$1 = require('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SBwGFwLXwLDweNwgBwuHwjDwnXMBXMpFMIBMeNMTHcaQcNBcDHcSFcCXcpBcLXcLDcgFcuFcnXcwXccDcTQcrFTQErXNrCHrpFrgFrbFrTHrFcWNYWNbWEHWMXWTR", @@ -24,12 +50,12 @@ const data = [ const mapping = "~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt"; let _wordlist = null; function hex(word) { - return (0, index_js_2.hexlify)((0, index_js_2.toUtf8Bytes)(word)); + return data$1.hexlify(utf8.toUtf8Bytes(word)); } const KiYoKu = "0xe3818de38284e3818f"; const KyoKu = "0xe3818de38283e3818f"; function toString(data) { - return (0, index_js_2.toUtf8String)(new Uint8Array(data)); + return utf8.toUtf8String(new Uint8Array(data)); } function loadWords() { if (_wordlist !== null) { @@ -103,7 +129,7 @@ function loadWords() { /* c8 ignore stop */ // Verify the computed list matches the official list /* istanbul ignore if */ - const checksum = (0, index_js_1.id)(wordlist.join("\n") + "\n"); + const checksum = id.id(wordlist.join("\n") + "\n"); /* c8 ignore start */ if (checksum !== "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600") { @@ -119,7 +145,7 @@ let wordlist = null; * * @_docloc: api/wordlists */ -class LangJa extends wordlist_js_1.Wordlist { +class LangJa extends wordlist$1.Wordlist { /** * Creates a new instance of the Japanese language Wordlist. * @@ -133,7 +159,7 @@ class LangJa extends wordlist_js_1.Wordlist { } getWord(index) { const words = loadWords(); - (0, index_js_2.assertArgument)(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); + errors.assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); return words[index]; } getWordIndex(word) { @@ -157,5 +183,6 @@ class LangJa extends wordlist_js_1.Wordlist { return wordlist; } } + exports.LangJa = LangJa; -//# sourceMappingURL=lang-ja.js.map \ No newline at end of file +//# sourceMappingURL=lang-ja.js.map diff --git a/lib.commonjs/wordlists/lang-ja.js.map b/lib.commonjs/wordlists/lang-ja.js.map index 2d6d6b321..55e75d39b 100644 --- a/lib.commonjs/wordlists/lang-ja.js.map +++ b/lib.commonjs/wordlists/lang-ja.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-ja.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AACtC,gDAK2B;AAE3B,+CAAyC;AAEzC,MAAM,IAAI,GAAG;IACX,eAAe;IACf,orEAAorE;IAEprE,eAAe;IACf,ssGAAssG;IAEtsG,eAAe;IACf,4uDAA4uD;IAE5uD,eAAe;IACf,olBAAolB;IAEplB,eAAe;IACf,4JAA4J;IAE5J,eAAe;IACf,0GAA0G;IAE1G,gBAAgB;IAChB,WAAW;CACZ,CAAC;AAEF,sDAAsD;AACtD,MAAM,OAAO,GACX,6FAA6F,CAAC;AAEhG,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,SAAS,GAAG,CAAC,IAAY;IACvB,OAAO,IAAA,kBAAO,EAAC,IAAA,sBAAW,EAAC,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,MAAM,GAAG,sBAAsB,CAAC;AACtC,MAAM,KAAK,GAAG,sBAAsB,CAAC;AAErC,SAAS,QAAQ,CAAC,IAAmB;IACnC,OAAO,IAAA,uBAAY,EAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,SAAS;IAChB,IAAI,SAAS,KAAK,IAAI,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,QAAQ,GAAG,EAAE,CAAC;IAEpB,yDAAyD;IACzD,MAAM,SAAS,GAAwC,EAAE,CAAC;IAE1D,6BAA6B;IAC7B,SAAS,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;IAC7C,SAAS,CAAC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AM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,CAAC,KAAoB;QACvB,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA/CD,wBA+CC"} \ No newline at end of file +{"version":3,"file":"lang-ja.js","sources":["../../lib.esm/wordlists/lang-ja.js"],"sourcesContent":["import { id } from \"../hash/index.js\";\nimport { hexlify, assertArgument, toUtf8Bytes, toUtf8String, } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n // 4-kana words\n \"AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQCXQCDQGBQGDQGdQYXQpBQpQQpHQLXQHuQgBQhBQhCQuFQmXQiDQUFQZDQsFQdRQkHQbRQlOQlmQPDQjDQwXQMBQMDQcFQTBQTHQrDDXQDNFDGBDGQDGRDpFDhFDmXDZXDbRDMYDRdDTRDrXSAhSBCSBrSGQSEQSHBSVRShYShkSyQSuFSiBSdcSoESocSlmSMBSFBSFKSFNSFdSFcCByCaRCKcCSBCSRCCrCGbCEHCYXCpBCpQC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AZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD\",\n // 9-kana words\n \"QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD\",\n // 10-kana words\n \"IJBEJqXZJ\",\n];\n// Maps each character into its kana value (the index)\nconst mapping = \"~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt\";\nlet _wordlist = null;\nfunction hex(word) {\n return hexlify(toUtf8Bytes(word));\n}\nconst KiYoKu = \"0xe3818de38284e3818f\";\nconst KyoKu = \"0xe3818de38283e3818f\";\nfunction toString(data) {\n return toUtf8String(new Uint8Array(data));\n}\nfunction loadWords() {\n if (_wordlist !== null) {\n return _wordlist;\n }\n const wordlist = [];\n // Transforms for normalizing (sort is a not quite UTF-8)\n const transform = {};\n // Delete the diacritic marks\n transform[toString([227, 130, 154])] = false;\n transform[toString([227, 130, 153])] = false;\n // Some simple transforms that sort out most of the order\n transform[toString([227, 130, 133])] = toString([227, 130, 134]);\n transform[toString([227, 129, 163])] = toString([227, 129, 164]);\n transform[toString([227, 130, 131])] = toString([227, 130, 132]);\n transform[toString([227, 130, 135])] = toString([227, 130, 136]);\n // Normalize words using the transform\n function normalize(word) {\n let result = \"\";\n for (let i = 0; i < word.length; i++) {\n let kana = word[i];\n const target = transform[kana];\n if (target === false) {\n continue;\n }\n if (target) {\n kana = target;\n }\n result += kana;\n }\n return result;\n }\n // Sort how the Japanese list is sorted\n function sortJapanese(a, b) {\n a = normalize(a);\n b = normalize(b);\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }\n // Load all the words\n for (let length = 3; length <= 9; length++) {\n const d = data[length - 3];\n for (let offset = 0; offset < d.length; offset += length) {\n const word = [];\n for (let i = 0; i < length; i++) {\n const k = mapping.indexOf(d[offset + i]);\n word.push(227);\n word.push(k & 0x40 ? 130 : 129);\n word.push((k & 0x3f) + 128);\n }\n wordlist.push(toString(word));\n }\n }\n wordlist.sort(sortJapanese);\n // For some reason kyoku and kiyoku are flipped in node (!!).\n // The order SHOULD be:\n // - kyoku\n // - kiyoku\n // This should ignore \"if\", but that doesn't work here??\n /* c8 ignore start */\n if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {\n const tmp = wordlist[442];\n wordlist[442] = wordlist[443];\n wordlist[443] = tmp;\n }\n /* c8 ignore stop */\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600\") {\n throw new Error(\"BIP39 Wordlist for ja (Japanese) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangJa extends Wordlist {\n /**\n * Creates a new instance of the Japanese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langJa]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ja\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n split(phrase) {\n //logger.assertNormalize();\n return phrase.split(/(?:\\u3000| )+/g);\n }\n join(words) {\n return words.join(\"\\u3000\");\n }\n /**\n * Returns a singleton instance of a ``LangJa``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangJa();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ja.js.map"],"names":["hexlify","toUtf8Bytes","toUtf8String","id","Wordlist","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,IAAI,GAAG;AACb;AACA,IAAI,orEAAorE;AACxrE;AACA,IAAI,ssGAAssG;AAC1sG;AACA,IAAI,4uDAA4uD;AAChvD;AACA,IAAI,olBAAolB;AACxlB;AACA,IAAI,4JAA4J;AAChK;AACA,IAAI,0GAA0G;AAC9G;AACA,IAAI,WAAW;AACf,CAAC;AACD;AACA,MAAM,OAAO,GAAG,6FAA6F;AAC7G,IAAI,SAAS,GAAG,IAAI;AACpB,SAAS,GAAG,CAAC,IAAI,EAAE;AACnB,IAAI,OAAOA,cAAO,CAACC,gBAAW,CAAC,IAAI,CAAC,CAAC;AACrC;AACA,MAAM,MAAM,GAAG,sBAAsB;AACrC,MAAM,KAAK,GAAG,sBAAsB;AACpC,SAAS,QAAQ,CAAC,IAAI,EAAE;AACxB,IAAI,OAAOC,iBAAY,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAC7C;AACA,SAAS,SAAS,GAAG;AACrB,IAAI,IAAI,SAAS,KAAK,IAAI,EAAE;AAC5B,QAAQ,OAAO,SAAS;AACxB,IAAI;AACJ,IAAI,MAAM,QAAQ,GAAG,EAAE;AACvB;AACA,IAAI,MAAM,SAAS,GAAG,EAAE;AACxB;AACA,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK;AAChD,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK;AAChD;AACA,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,EAAE,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AO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;AACnC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ko.d.ts.map b/lib.commonjs/wordlists/lang-ko.d.ts.map index 8b8d34088..4e6fdeecb 100644 --- a/lib.commonjs/wordlists/lang-ko.d.ts.map +++ b/lib.commonjs/wordlists/lang-ko.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC;;;;;;;OAOG;;IAKH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ko.js b/lib.commonjs/wordlists/lang-ko.js index e9ce19f26..9fb6dc3f2 100644 --- a/lib.commonjs/wordlists/lang-ko.js +++ b/lib.commonjs/wordlists/lang-ko.js @@ -1,9 +1,34 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangKo = void 0; -const index_js_1 = require("../hash/index.js"); -const index_js_2 = require("../utils/index.js"); -const wordlist_js_1 = require("./wordlist.js"); +'use strict'; + +var id = require('../hash/id.js'); +require('../constants/numbers.js'); +require('../address/index.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var utf8 = require('../utils/utf8.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +var wordlist$1 = require('./wordlist.js'); + const data = [ "OYAa", "ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb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RZrLmRZrMnRZrSnRZ8ATRZ8JbRZ8ScRbMT8RbST3RfGZrRfMX8RfMgrRfSZrRnAbrRnGT8RnvJgRnvLfRnvMTRn8AaSTClvSTJgrSTOXrSTRg3STRnvSToAcSToAfSToAnSToHnSToLjSToMTSTrAaSTrEUST3BYST8AgST8LmSUAZvSUAgrSUDT4SUDT8SUGgvSUJXoSUJXvSULTrSU8JTSU8LjSV8AnSV8JgSXFToSXLf8SYvAnSZrDUSZrMUSZrMnSZ8HgSZ8JTSZ8JgSZ8MYSZ8QUSaQUoSbCT3SbHToSbQYvSbSl4SboJnSbvFbSb8HbSb8JgSb8OTScGZrScHgrScJTvScMT8ScSToScoHbScrMTScvAnSeAZrSeAcrSeHboSeJUoSeLhrSeMT8SeMXrSe6JgSgHTrSkJnoSkLnvSk8CUSlFl3SlrSnSl8GnSmAboSmGT8SmJU8", @@ -22,7 +47,7 @@ function getHangul(code) { else if (code >= 19) { code = code + 97 - 19; } - return (0, index_js_2.toUtf8String)(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128])); + return utf8.toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128])); } let _wordlist = null; function loadWords() { @@ -43,7 +68,7 @@ function loadWords() { wordlist.sort(); // Verify the computed list matches the official list /* istanbul ignore if */ - const checksum = (0, index_js_1.id)(wordlist.join("\n") + "\n"); + const checksum = id.id(wordlist.join("\n") + "\n"); /* c8 ignore start */ if (checksum !== "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a") { @@ -59,7 +84,7 @@ let wordlist = null; * * @_docloc: api/wordlists */ -class LangKo extends wordlist_js_1.Wordlist { +class LangKo extends wordlist$1.Wordlist { /** * Creates a new instance of the Korean language Wordlist. * @@ -73,7 +98,7 @@ class LangKo extends wordlist_js_1.Wordlist { } getWord(index) { const words = loadWords(); - (0, index_js_2.assertArgument)(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); + errors.assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); return words[index]; } getWordIndex(word) { @@ -90,5 +115,6 @@ class LangKo extends wordlist_js_1.Wordlist { return wordlist; } } + exports.LangKo = LangKo; -//# sourceMappingURL=lang-ko.js.map \ No newline at end of file +//# sourceMappingURL=lang-ko.js.map diff --git a/lib.commonjs/wordlists/lang-ko.js.map b/lib.commonjs/wordlists/lang-ko.js.map index 00050a1a2..2f7f8878e 100644 --- a/lib.commonjs/wordlists/lang-ko.js.map +++ b/lib.commonjs/wordlists/lang-ko.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-ko.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AACtC,gDAAiE;AAEjE,+CAAyC;AAEzC,MAAM,IAAI,GAAG;IACX,MAAM;IACN,y5JAAy5J;IACz5J,8lIAA8lI;IAC9lI,i8BAAi8B;IACj8B,koCAAkoC;IACloC,yaAAya;IACza,gHAAgH;IAChH,+EAA+E;CAChF,CAAC;AAEF,MAAM,KAAK,GACT,wEAAwE,CAAC;AAE3E,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,IAAI,IAAI,EAAE,EAAE;QACd,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;KACxB;SAAM,IAAI,IAAI,IAAI,EAAE,EAAE;QACrB,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;KACvB;IAED,OAAO,IAAA,uBAAY,EACjB,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAC9D,CAAC;AACJ,CAAC;AAED,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,SAAS,SAAS;IAChB,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,QAAQ,GA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OAAO,EACP,KAAK,CACN,CAAC;QACF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,YAAY,CAAC,IAAY;QACvB,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAtCD,wBAsCC"} \ No newline at end of file +{"version":3,"file":"lang-ko.js","sources":["../../lib.esm/wordlists/lang-ko.js"],"sourcesContent":["import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n \"OYAa\",\n \"ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTA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PQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*\";\nfunction getHangul(code) {\n if (code >= 40) {\n code = code + 168 - 40;\n }\n else if (code >= 19) {\n code = code + 97 - 19;\n }\n return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128]));\n}\nlet _wordlist = null;\nfunction loadWords() {\n if (_wordlist != null) {\n return _wordlist;\n }\n const wordlist = [];\n data.forEach((data, length) => {\n length += 4;\n for (let i = 0; i < data.length; i += length) {\n let word = \"\";\n for (let j = 0; j < length; j++) {\n word += getHangul(codes.indexOf(data[i + j]));\n }\n wordlist.push(word);\n }\n });\n wordlist.sort();\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a\") {\n throw new Error(\"BIP39 Wordlist for ko (Korean) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangKo extends Wordlist {\n /**\n * Creates a new instance of the Korean language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langKo]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ko\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n /**\n * Returns a singleton instance of a ``LangKo``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangKo();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ko.js.map"],"names":["toUtf8String","id","Wordlist","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAA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AQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-pt.d.ts.map b/lib.commonjs/wordlists/lang-pt.d.ts.map index c979f9c09..024c97c03 100644 --- a/lib.commonjs/wordlists/lang-pt.d.ts.map +++ b/lib.commonjs/wordlists/lang-pt.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-pt.js b/lib.commonjs/wordlists/lang-pt.js index ad13dc227..c326fefba 100644 --- a/lib.commonjs/wordlists/lang-pt.js +++ b/lib.commonjs/wordlists/lang-pt.js @@ -1,7 +1,7 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangPt = void 0; -const wordlist_owl_js_1 = require("./wordlist-owl.js"); +'use strict'; + +var wordlistOwl = require('./wordlist-owl.js'); + const words = "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi?PoQue%lRagemRdi&Rne)R}h>p|&R[ioR%joRuj>voSs-oS%laT}e%U_UveVilZ*]2A%+AvoEcheE=rEmeErEspoI^Im*&Io~oIseItic Os)UaUz{o2B+m SafioSbo.Sc<,S-/Sfi#Sgas%Sigu&SlizeSmam SovaSpesaS)queSvi T&h T-$rT} Tri$UsaV(Vi=Vot#Z-a3Ag+maAle$Da)Fu,Gi.Lat#Lu-%M*u'Nast@Nh{oOceseRe$Sc[)Sf ceSp oSque%Ssip S)n%T?UrnoV(,Vi,rV~g Z(5Br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{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi="; const checksum = "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; let wordlist = null; @@ -10,7 +10,7 @@ let wordlist = null; * * @_docloc: api/wordlists */ -class LangPt extends wordlist_owl_js_1.WordlistOwl { +class LangPt extends wordlistOwl.WordlistOwl { /** * Creates a new instance of the Portuguese language Wordlist. * @@ -33,5 +33,6 @@ class LangPt extends wordlist_owl_js_1.WordlistOwl { return wordlist; } } + exports.LangPt = LangPt; -//# sourceMappingURL=lang-pt.js.map \ No newline at end of file +//# sourceMappingURL=lang-pt.js.map diff --git a/lib.commonjs/wordlists/lang-pt.js.map b/lib.commonjs/wordlists/lang-pt.js.map index c1b117f0a..4bb2dd45a 100644 --- a/lib.commonjs/wordlists/lang-pt.js.map +++ b/lib.commonjs/wordlists/lang-pt.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-pt.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":";;;AAAA,uDAAgD;AAEhD,MAAM,KAAK,GACT,s0OAAs0O,CAAC;AACz0O,MAAM,QAAQ,GACZ,oEAAoE,CAAC;AAEvE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAa,MAAO,SAAQ,6BAAW;IACrC;;;;;;;OAOG;IACH;QACE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAvBD,wBAuBC"} \ No newline at end of file +{"version":3,"file":"lang-pt.js","sources":["../../lib.esm/wordlists/lang-pt.js"],"sourcesContent":["import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAve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SquisaS,aTisc 3AdaC#Ed!eGm-$Last+Lh#Lo.M-)Nc`NguimN]No%N.On{oPocaQue%ResRue)Sc S$laTg-$Rje)Tur Ud!eXof}eZ}&3C C~ DaD-$Di#Do,Du$rGm-$G[=Gun=IvaLe$LvagemM<&M-%N?N/rNsu&Nt#P #Rei>*g>+RvoTemb_T|3GiloLhue)Lic}eMetr@Mpat@M~ N&Nc(oNg~ NopseN$ni>-eRiTu#5B(fis)Rp[s>[&Rt'Sp'oS%n$:B`aBle%Bu^C/G `aLh(LoLvezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi=\";\nconst checksum = \"0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac\";\nlet wordlist = null;\n/**\n * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangPt extends WordlistOwl {\n /**\n * Creates a new instance of the Portuguese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langPt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"pt\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangPt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangPt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-pt.js.map"],"names":["WordlistOwl"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,s0OAAs0O;AACp1O,MAAM,QAAQ,GAAG,oEAAoE;AACrF,IAAI,QAAQ,GAAG,IAAI;AACnB;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,uBAAW,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-zh.d.ts.map b/lib.commonjs/wordlists/lang-zh.d.ts.map index 8dd1943aa..06d1b5870 100644 --- a/lib.commonjs/wordlists/lang-zh.d.ts.map +++ b/lib.commonjs/wordlists/lang-zh.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC;;;;;;;;;OASG;gBACS,OAAO,EAAE,MAAM;IAI3B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAMzC"} \ No newline at end of file +{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;;;OASG;IACH,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKvC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-zh.js b/lib.commonjs/wordlists/lang-zh.js index 767d0d5d0..401c00806 100644 --- a/lib.commonjs/wordlists/lang-zh.js +++ b/lib.commonjs/wordlists/lang-zh.js @@ -1,9 +1,34 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangZh = void 0; -const index_js_1 = require("../hash/index.js"); -const index_js_2 = require("../utils/index.js"); -const wordlist_js_1 = require("./wordlist.js"); +'use strict'; + +var id = require('../hash/id.js'); +require('../constants/numbers.js'); +require('../address/index.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +var utf8 = require('../utils/utf8.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +var wordlist = require('./wordlist.js'); + const data = "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN= 0 && index < words.length, `invalid word index: ${index}`, "index", index); + errors.assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); return words[index]; } getWordIndex(word) { @@ -95,5 +120,6 @@ class LangZh extends wordlist_js_1.Wordlist { return wordlists[dialect]; } } + exports.LangZh = LangZh; -//# sourceMappingURL=lang-zh.js.map \ No newline at end of file +//# sourceMappingURL=lang-zh.js.map diff --git a/lib.commonjs/wordlists/lang-zh.js.map b/lib.commonjs/wordlists/lang-zh.js.map index efa6f4a2b..d106a888f 100644 --- a/lib.commonjs/wordlists/lang-zh.js.map +++ b/lib.commonjs/wordlists/lang-zh.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-zh.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":";;;AAAA,+CAAsC;AACtC,gDAAiE;AAEjE,+CAAyC;AAEzC,MAAM,IAAI,GACR,kgMAAkgM,CAAC;AACrgM,MAAM,SAAS,GACb,6lDAA6lD,CAAC;AAEhmD,MAAM,SAAS,GAAyC;IACtD,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;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CAAC,QAAQ,CAAC,OAAe;QAC7B,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE;YAC9B,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;SAC1C;QACD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;CACF;AAhDD,wBAgDC"} \ No newline at end of file +{"version":3,"file":"lang-zh.js","sources":["../../lib.esm/wordlists/lang-zh.js"],"sourcesContent":["import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = \"}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN?\";\nfunction loadWords(locale) {\n if (_wordlist[locale] != null) {\n return _wordlist[locale];\n }\n const wordlist = [];\n let deltaOffset = 0;\n for (let i = 0; i < 2048; i++) {\n const s = style.indexOf(data[i * 3]);\n const bytes = [\n 228 + (s >> 2),\n 128 + codes.indexOf(data[i * 3 + 1]),\n 128 + codes.indexOf(data[i * 3 + 2]),\n ];\n if (locale === \"zh_tw\") {\n const common = s % 4;\n for (let i = common; i < 3; i++) {\n bytes[i] =\n codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128);\n }\n }\n wordlist.push(toUtf8String(new Uint8Array(bytes)));\n }\n // Verify the computed list matches the official list\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== Checks[locale]) {\n throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`);\n }\n /* c8 ignore stop */\n _wordlist[locale] = wordlist;\n return wordlist;\n}\nconst wordlists = {};\n/**\n * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for\n * [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangZh extends Wordlist {\n /**\n * Creates a new instance of the Chinese language Wordlist for\n * the %%dialect%%, either ``\"cn\"`` or ``\"tw\"`` for simplified\n * or traditional, respectively.\n *\n * This should be unnecessary most of the time as the exported\n * [[langZhCn]] and [[langZhTw]] should suffice.\n *\n * @_ignore:\n */\n constructor(dialect) {\n super(\"zh_\" + dialect);\n }\n getWord(index) {\n const words = loadWords(this.locale);\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords(this.locale).indexOf(word);\n }\n split(phrase) {\n phrase = phrase.replace(/(?:\\u3000| )+/g, \"\");\n return phrase.split(\"\");\n }\n /**\n * Returns a singleton instance of a ``LangZh`` for %%dialect%%,\n * creating it if this is the first time being called.\n *\n * Use the %%dialect%% ``\"cn\"`` or ``\"tw\"`` for simplified or\n * traditional, respectively.\n */\n static wordlist(dialect) {\n if (wordlists[dialect] == null) {\n wordlists[dialect] = new LangZh(dialect);\n }\n return wordlists[dialect];\n }\n}\n//# sourceMappingURL=lang-zh.js.map"],"names":["toUtf8String","id","Wordlist","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,IAAI,GAAG,kgMAAkgM;AAC/gM,MAAM,SAAS,GAAG,6lDAA6lD;AAC/mD,MAAM,SAAS,GAAG;AAClB,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,KAAK,EAAE,IAAI;AACf,CAAC;AACD,MAAM,MAAM,GAAG;AACf,IAAI,KAAK,EAAE,oEAAoE;AAC/E,IAAI,KAAK,EAAE,oEAAoE;AAC/E,CAAC;AACD,MAAM,KAAK,GAAG,kEAAkE;AAChF,MAAM,KAAK,GAAG,4BAA4B;AAC1C,SAAS,SAAS,CAAC,MAAM,EAAE;AAC3B,IAAI,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;AACnC,QA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,YAAY,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC;AACpD,QAAQ;AACR,QAAQ,OAAO,SAAS,CAAC,OAAO,CAAC;AACjC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owl.d.ts.map b/lib.commonjs/wordlists/wordlist-owl.d.ts.map index c0dcec9e9..cb5198fb8 100644 --- a/lib.commonjs/wordlists/wordlist-owl.d.ts.map +++ b/lib.commonjs/wordlists/wordlist-owl.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIvC;;;OAGG;gBACS,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAO1D,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;IAsB7B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGnC"} \ No newline at end of file +{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIxC;;;OAGG;IACH,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAKzD;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;IAoBD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owl.js b/lib.commonjs/wordlists/wordlist-owl.js index 9b749e8de..e743232ea 100644 --- a/lib.commonjs/wordlists/wordlist-owl.js +++ b/lib.commonjs/wordlists/wordlist-owl.js @@ -1,12 +1,36 @@ -"use strict"; +'use strict'; + +var id = require('../hash/id.js'); +require('../constants/numbers.js'); +require('../address/index.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +var errors = require('../utils/errors.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); +require('../crypto/hmac.js'); +require('../crypto/ripemd160.js'); +require('../crypto/pbkdf2.js'); +require('../crypto/random.js'); +require('../crypto/scrypt.js'); +require('../crypto/sha3.js'); +require('bcrypto/lib/ed448.js'); +require('buffer'); +require('bcrypto/lib/pbkdf2.js'); +require('bcrypto/lib/sha3-512.js'); +require('crypto'); +require('../crypto/keccak.js'); +require('../crypto/signature.js'); +require('../transaction/transaction.js'); +require('../hash/typed-data.js'); +var decodeOwl = require('./decode-owl.js'); +var wordlist = require('./wordlist.js'); + // Use the encode-latin.js script to create the necessary // data files to be consumed by this class -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WordlistOwl = void 0; -const index_js_1 = require("../hash/index.js"); -const index_js_2 = require("../utils/index.js"); -const decode_owl_js_1 = require("./decode-owl.js"); -const wordlist_js_1 = require("./wordlist.js"); /** * An OWL format Wordlist is an encoding method that exploits * the general locality of alphabetically sorted words to @@ -19,7 +43,7 @@ const wordlist_js_1 = require("./wordlist.js"); * If necessary, there are tools within the ``generation/`` folder * to create these necessary data. */ -class WordlistOwl extends wordlist_js_1.Wordlist { +class WordlistOwl extends wordlist.Wordlist { #data; #checksum; /** @@ -36,14 +60,14 @@ class WordlistOwl extends wordlist_js_1.Wordlist { return this.#data; } _decodeWords() { - return (0, decode_owl_js_1.decodeOwl)(this.#data); + return decodeOwl.decodeOwl(this.#data); } #words; #loadWords() { if (this.#words == null) { const words = this._decodeWords(); // Verify the computed list matches the official list - const checksum = (0, index_js_1.id)(words.join("\n") + "\n", true); + const checksum = id.id(words.join("\n") + "\n", true); /* c8 ignore start */ if (checksum !== this.#checksum) { throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); @@ -55,12 +79,13 @@ class WordlistOwl extends wordlist_js_1.Wordlist { } getWord(index) { const words = this.#loadWords(); - (0, index_js_2.assertArgument)(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); + errors.assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); return words[index]; } getWordIndex(word) { return this.#loadWords().indexOf(word); } } + exports.WordlistOwl = WordlistOwl; -//# sourceMappingURL=wordlist-owl.js.map \ No newline at end of file +//# sourceMappingURL=wordlist-owl.js.map diff --git a/lib.commonjs/wordlists/wordlist-owl.js.map b/lib.commonjs/wordlists/wordlist-owl.js.map index 807eef1ca..3b3a1c8c0 100644 --- a/lib.commonjs/wordlists/wordlist-owl.js.map +++ b/lib.commonjs/wordlists/wordlist-owl.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owl.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,0CAA0C;;;AAE1C,+CAAsC;AACtC,gDAAmD;AAEnD,mDAA4C;AAC5C,+CAAyC;AAEzC;;;;;;;;;;;GAWG;AACH,MAAa,WAAY,SAAQ,sBAAQ;IACvC,KAAK,CAAS;IACd,SAAS,CAAS;IAElB;;;OAGG;IACH,YAAY,MAAc,EAAE,IAAY,EAAE,QAAgB;QACxD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,YAAY;QACV,OAAO,IAAA,yBAAS,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,CAAuB;IAC7B,UAAU;QACR,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YACvB,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YAElC,qDAAqD;YACrD,MAAM,QAAQ,GAAG,IAAA,aAAE,EAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC;YACnD,qBAAqB;YACrB,IAAI,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;gBAC/B,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,MAAM,aAAa,CAAC,CAAC;aACjE;YACD,oBAAoB;YAEpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACrB;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChC,IAAA,yBAAc,EACZ,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAClC,uBAAuB,KAAK,EAAE,EAC9B,OAAO,EACP,KAAK,CACN,CAAC;QACF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,YAAY,CAAC,IAAY;QACvB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AAvDD,kCAuDC"} \ No newline at end of file +{"version":3,"file":"wordlist-owl.js","sources":["../../lib.esm/wordlists/wordlist-owl.js"],"sourcesContent":["// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map"],"names":["Wordlist","decodeOwl","id","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAW,SAASA,iBAAQ,CAAC;AAC1C,IAAI,KAAK;AACT,IAAI,SAAS;AACb;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;AACxC,QAAQ,KAAK,CAAC,MAAM,CAAC;AACrB,QAAQ,IAAI,CAAC,K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AC,OAAO,CAAC,IAAI,CAAC;AAC9C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owla.d.ts.map b/lib.commonjs/wordlists/wordlist-owla.d.ts.map index a02c1dff5..ed20b28e0 100644 --- a/lib.commonjs/wordlists/wordlist-owla.d.ts.map +++ b/lib.commonjs/wordlists/wordlist-owla.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;gBAG/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAK1E,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;CAG9B"} \ No newline at end of file +{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;IAG5C,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAGzE;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owla.js b/lib.commonjs/wordlists/wordlist-owla.js index bf699b2ca..ab781d015 100644 --- a/lib.commonjs/wordlists/wordlist-owla.js +++ b/lib.commonjs/wordlists/wordlist-owla.js @@ -1,8 +1,8 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.WordlistOwlA = void 0; -const wordlist_owl_js_1 = require("./wordlist-owl.js"); -const decode_owla_js_1 = require("./decode-owla.js"); +'use strict'; + +var wordlistOwl = require('./wordlist-owl.js'); +var decodeOwla = require('./decode-owla.js'); + /** * An OWL-A format Wordlist extends the OWL format to add an * overlay onto an OWL format Wordlist to support diacritic @@ -15,7 +15,7 @@ const decode_owla_js_1 = require("./decode-owla.js"); * If necessary, there are tools within the ``generation/`` folder * to create these necessary data. */ -class WordlistOwlA extends wordlist_owl_js_1.WordlistOwl { +class WordlistOwlA extends wordlistOwl.WordlistOwl { #accent; constructor(locale, data, accent, checksum) { super(locale, data, checksum); @@ -25,8 +25,9 @@ class WordlistOwlA extends wordlist_owl_js_1.WordlistOwl { return this.#accent; } _decodeWords() { - return (0, decode_owla_js_1.decodeOwlA)(this._data, this._accent); + return decodeOwla.decodeOwlA(this._data, this._accent); } } + exports.WordlistOwlA = WordlistOwlA; -//# sourceMappingURL=wordlist-owla.js.map \ No newline at end of file +//# sourceMappingURL=wordlist-owla.js.map diff --git a/lib.commonjs/wordlists/wordlist-owla.js.map b/lib.commonjs/wordlists/wordlist-owla.js.map index 96723d5c5..da5e1832e 100644 --- a/lib.commonjs/wordlists/wordlist-owla.js.map +++ b/lib.commonjs/wordlists/wordlist-owla.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":";;;AAAA,uDAAgD;AAChD,qDAA8C;AAE9C;;;;;;;;;;;GAWG;AACH,MAAa,YAAa,SAAQ,6BAAW;IAC3C,OAAO,CAAS;IAEhB,YAAY,MAAc,EAAE,IAAY,EAAE,MAAc,EAAE,QAAgB;QACxE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,YAAY;QACV,OAAO,IAAA,2BAAU,EAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;CACF;AAfD,oCAeC"} \ No newline at end of file +{"version":3,"file":"wordlist-owla.js","sources":["../../lib.esm/wordlists/wordlist-owla.js"],"sourcesContent":["import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map"],"names":["WordlistOwl","decodeOwlA"],"mappings":";;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,SAASA,uBAAW,CAAC;AAC9C,IAAI,OAAO;AACX,IAAI,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;AAChD,QAAQ,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC;AACrC,QAAQ,IAAI,CAAC,OAAO,GAAG,MAAM;AAC7B,IAAI;AACJ,IAAI,IAAI,OAAO,GAAG;AAClB,QAAQ,OAAO,IAAI,CAAC,OAAO;AAC3B,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAOC,qBAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;AACnD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist.d.ts.map b/lib.commonjs/wordlists/wordlist.d.ts.map index ef52e4565..c298de76e 100644 --- a/lib.commonjs/wordlists/wordlist.d.ts.map +++ b/lib.commonjs/wordlists/wordlist.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC5B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAIpC;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAEvC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAC3C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM;CAYzC"} \ No newline at end of file +{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC7B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAM,EAAE,MAAM,EAEzB;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAEnC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAWvC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist.js b/lib.commonjs/wordlists/wordlist.js index cef696213..b9a2a8e5b 100644 --- a/lib.commonjs/wordlists/wordlist.js +++ b/lib.commonjs/wordlists/wordlist.js @@ -1,8 +1,16 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Wordlist = void 0; -const id_js_1 = require("../hash/id.js"); -const index_js_1 = require("../utils/index.js"); +'use strict'; + +var id = require('../hash/id.js'); +require('../utils/base58.js'); +require('../logger/logger.js'); +require('../utils/errors.js'); +var properties = require('../utils/properties.js'); +require('http'); +require('https'); +require('zlib'); +require('../utils/fixednumber.js'); +require('../utils/maths.js'); + /** * A Wordlist represents a collection of language-specific * words used to encode and devoce [[link-bip-39]] encoded data @@ -21,7 +29,7 @@ class Wordlist { * there is no state kept internally, so they are safe to share. */ constructor(locale) { - (0, index_js_1.defineProperties)(this, { locale }); + properties.defineProperties(this, { locale }); } /** * Sub-classes may override this to provide a language-specific @@ -52,8 +60,9 @@ class Wordlist { } words.push(word); } - return (0, id_js_1.id)(words.join("\n") + "\n"); + return id.id(words.join("\n") + "\n"); } } + exports.Wordlist = Wordlist; -//# sourceMappingURL=wordlist.js.map \ No newline at end of file +//# sourceMappingURL=wordlist.js.map diff --git a/lib.commonjs/wordlists/wordlist.js.map b/lib.commonjs/wordlists/wordlist.js.map index ea4b48364..c79f848e6 100644 --- a/lib.commonjs/wordlists/wordlist.js.map +++ b/lib.commonjs/wordlists/wordlist.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlist.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":";;;AAAA,yCAAmC;AACnC,gDAAqD;AAErD;;;;GAIG;AACH,MAAsB,QAAQ;IAC5B,MAAM,CAAU;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAc;QACxB,IAAA,2BAAgB,EAAW,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAc;QAClB,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAoB;QACvB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAeD,MAAM,CAAC,KAAK,CAAC,QAAkB;QAC7B,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;YAC7B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,wBAAwB;YACxB,IAAI,CAAC,KAAK,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;gBACrC,OAAO,IAAI,CAAC;aACb;YACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClB;QACD,OAAO,IAAA,UAAE,EAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACrC,CAAC;CACF;AA/DD,4BA+DC"} \ No newline at end of file +{"version":3,"file":"wordlist.js","sources":["../../lib.esm/wordlists/wordlist.js"],"sourcesContent":["import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map"],"names":["defineProperties","id"],"mappings":";;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,QAAQ,CAAC;AACtB,IAAI,MAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQA,2BAAgB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC;AAC1C,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,QAAQ,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;AACjD,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,QAAQ,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AAC9B,IAAI;AACJ,IAAI,OAAO,KAAK,CAAC,QAAQ,EAAE;AAC3B,QAAQ,MAAM,KAAK,GAAG,EAAE;AACxB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;AACvC,YAAY,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5C;AACA,YAAY,IAAI,CAAC,KAAK,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;AACnD,gBAAgB,OAAO,IAAI;AAC3B,YAAY;AACZ,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5B,QAAQ;AACR,QAAQ,OAAOC,KAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAC1C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists-browser.js b/lib.commonjs/wordlists/wordlists-browser.js index 569f5ca12..68c2b6386 100644 --- a/lib.commonjs/wordlists/wordlists-browser.js +++ b/lib.commonjs/wordlists/wordlists-browser.js @@ -1,8 +1,10 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlists = void 0; -const lang_en_js_1 = require("./lang-en.js"); -exports.wordlists = { - en: lang_en_js_1.LangEn.wordlist(), +'use strict'; + +var langEn = require('./lang-en.js'); + +const wordlists = { + en: langEn.LangEn.wordlist(), }; -//# sourceMappingURL=wordlists-browser.js.map \ No newline at end of file + +exports.wordlists = wordlists; +//# sourceMappingURL=wordlists-browser.js.map diff --git a/lib.commonjs/wordlists/wordlists-browser.js.map b/lib.commonjs/wordlists/wordlists-browser.js.map index 382337bb9..a3401ebd3 100644 --- a/lib.commonjs/wordlists/wordlists-browser.js.map +++ b/lib.commonjs/wordlists/wordlists-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlists-browser.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":";;;AAAA,6CAAsC;AAIzB,QAAA,SAAS,GAA6B;IACjD,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;CACtB,CAAC"} \ No newline at end of file +{"version":3,"file":"wordlists-browser.js","sources":["../../lib.esm/wordlists/wordlists-browser.js"],"sourcesContent":["import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map"],"names":["LangEn"],"mappings":";;;;AACY,MAAC,SAAS,GAAG;AACzB,IAAI,EAAE,EAAEA,aAAM,CAAC,QAAQ,EAAE;AACzB;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists-extra.js b/lib.commonjs/wordlists/wordlists-extra.js index 38dbc9266..3c1197fb1 100644 --- a/lib.commonjs/wordlists/wordlists-extra.js +++ b/lib.commonjs/wordlists/wordlists-extra.js @@ -1,20 +1,22 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.LangZh = exports.LangPt = exports.LangIt = exports.LangKo = exports.LangJa = exports.LangFr = exports.LangEs = exports.LangCz = void 0; -var lang_cz_js_1 = require("./lang-cz.js"); -Object.defineProperty(exports, "LangCz", { enumerable: true, get: function () { return lang_cz_js_1.LangCz; } }); -var lang_es_js_1 = require("./lang-es.js"); -Object.defineProperty(exports, "LangEs", { enumerable: true, get: function () { return lang_es_js_1.LangEs; } }); -var lang_fr_js_1 = require("./lang-fr.js"); -Object.defineProperty(exports, "LangFr", { enumerable: true, get: function () { return lang_fr_js_1.LangFr; } }); -var lang_ja_js_1 = require("./lang-ja.js"); -Object.defineProperty(exports, "LangJa", { enumerable: true, get: function () { return lang_ja_js_1.LangJa; } }); -var lang_ko_js_1 = require("./lang-ko.js"); -Object.defineProperty(exports, "LangKo", { enumerable: true, get: function () { return lang_ko_js_1.LangKo; } }); -var lang_it_js_1 = require("./lang-it.js"); -Object.defineProperty(exports, "LangIt", { enumerable: true, get: function () { return lang_it_js_1.LangIt; } }); -var lang_pt_js_1 = require("./lang-pt.js"); -Object.defineProperty(exports, "LangPt", { enumerable: true, get: function () { return lang_pt_js_1.LangPt; } }); -var lang_zh_js_1 = require("./lang-zh.js"); -Object.defineProperty(exports, "LangZh", { enumerable: true, get: function () { return lang_zh_js_1.LangZh; } }); -//# sourceMappingURL=wordlists-extra.js.map \ No newline at end of file +'use strict'; + +var langCz = require('./lang-cz.js'); +var langEs = require('./lang-es.js'); +var langFr = require('./lang-fr.js'); +var langJa = require('./lang-ja.js'); +var langKo = require('./lang-ko.js'); +var langIt = require('./lang-it.js'); +var langPt = require('./lang-pt.js'); +var langZh = require('./lang-zh.js'); + + + +exports.LangCz = langCz.LangCz; +exports.LangEs = langEs.LangEs; +exports.LangFr = langFr.LangFr; +exports.LangJa = langJa.LangJa; +exports.LangKo = langKo.LangKo; +exports.LangIt = langIt.LangIt; +exports.LangPt = langPt.LangPt; +exports.LangZh = langZh.LangZh; +//# sourceMappingURL=wordlists-extra.js.map diff --git a/lib.commonjs/wordlists/wordlists-extra.js.map b/lib.commonjs/wordlists/wordlists-extra.js.map index 45ad32830..cb9d641e5 100644 --- a/lib.commonjs/wordlists/wordlists-extra.js.map +++ b/lib.commonjs/wordlists/wordlists-extra.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlists-extra.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-extra.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA;AACf,2CAAsC;AAA7B,oGAAA,MAAM,OAAA"} \ No newline at end of file +{"version":3,"file":"wordlists-extra.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists.js b/lib.commonjs/wordlists/wordlists.js index 97235d88e..0d37a30f7 100644 --- a/lib.commonjs/wordlists/wordlists.js +++ b/lib.commonjs/wordlists/wordlists.js @@ -1,15 +1,15 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.wordlists = void 0; -const lang_cz_js_1 = require("./lang-cz.js"); -const lang_en_js_1 = require("./lang-en.js"); -const lang_es_js_1 = require("./lang-es.js"); -const lang_fr_js_1 = require("./lang-fr.js"); -const lang_ja_js_1 = require("./lang-ja.js"); -const lang_ko_js_1 = require("./lang-ko.js"); -const lang_it_js_1 = require("./lang-it.js"); -const lang_pt_js_1 = require("./lang-pt.js"); -const lang_zh_js_1 = require("./lang-zh.js"); +'use strict'; + +var langCz = require('./lang-cz.js'); +var langEn = require('./lang-en.js'); +var langEs = require('./lang-es.js'); +var langFr = require('./lang-fr.js'); +var langJa = require('./lang-ja.js'); +var langKo = require('./lang-ko.js'); +var langIt = require('./lang-it.js'); +var langPt = require('./lang-pt.js'); +var langZh = require('./lang-zh.js'); + /** * The available Wordlists by their * [ISO 639-1 Language Code](link-wiki-iso639). @@ -23,16 +23,18 @@ const lang_zh_js_1 = require("./lang-zh.js"); * about 80kb. If required, they are available by importing the * included ``wordlists-extra.min.js`` file. */ -exports.wordlists = { - cz: lang_cz_js_1.LangCz.wordlist(), - en: lang_en_js_1.LangEn.wordlist(), - es: lang_es_js_1.LangEs.wordlist(), - fr: lang_fr_js_1.LangFr.wordlist(), - it: lang_it_js_1.LangIt.wordlist(), - pt: lang_pt_js_1.LangPt.wordlist(), - ja: lang_ja_js_1.LangJa.wordlist(), - ko: lang_ko_js_1.LangKo.wordlist(), - zh_cn: lang_zh_js_1.LangZh.wordlist("cn"), - zh_tw: lang_zh_js_1.LangZh.wordlist("tw"), +const wordlists = { + cz: langCz.LangCz.wordlist(), + en: langEn.LangEn.wordlist(), + es: langEs.LangEs.wordlist(), + fr: langFr.LangFr.wordlist(), + it: langIt.LangIt.wordlist(), + pt: langPt.LangPt.wordlist(), + ja: langJa.LangJa.wordlist(), + ko: langKo.LangKo.wordlist(), + zh_cn: langZh.LangZh.wordlist("cn"), + zh_tw: langZh.LangZh.wordlist("tw"), }; -//# sourceMappingURL=wordlists.js.map \ No newline at end of file + +exports.wordlists = wordlists; +//# sourceMappingURL=wordlists.js.map diff --git a/lib.commonjs/wordlists/wordlists.js.map b/lib.commonjs/wordlists/wordlists.js.map index 6c6c3cf4c..e4c1b3d7d 100644 --- a/lib.commonjs/wordlists/wordlists.js.map +++ b/lib.commonjs/wordlists/wordlists.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlists.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":";;;AAAA,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AACtC,6CAAsC;AAItC;;;;;;;;;;;;GAYG;AACU,QAAA,SAAS,GAA6B;IACjD,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,mBAAM,CAAC,QAAQ,EAAE;IACrB,KAAK,EAAE,mBAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,KAAK,EAAE,mBAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;CAC7B,CAAC"} \ No newline at end of file +{"version":3,"file":"wordlists.js","sources":["../../lib.esm/wordlists/wordlists.js"],"sourcesContent":["import { LangCz } from \"./lang-cz.js\";\nimport { LangEn } from \"./lang-en.js\";\nimport { LangEs } from \"./lang-es.js\";\nimport { LangFr } from \"./lang-fr.js\";\nimport { LangJa } from \"./lang-ja.js\";\nimport { LangKo } from \"./lang-ko.js\";\nimport { LangIt } from \"./lang-it.js\";\nimport { LangPt } from \"./lang-pt.js\";\nimport { LangZh } from \"./lang-zh.js\";\n/**\n * The available Wordlists by their\n * [ISO 639-1 Language Code](link-wiki-iso639).\n *\n * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr),\n * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt),\n * [zh_cn](LangZh), [zh_tw](LangZh))\n *\n * The dist files (in the ``/dist`` folder) have had all languages\n * except English stripped out, which reduces the library size by\n * about 80kb. If required, they are available by importing the\n * included ``wordlists-extra.min.js`` file.\n */\nexport const wordlists = {\n cz: LangCz.wordlist(),\n en: LangEn.wordlist(),\n es: LangEs.wordlist(),\n fr: LangFr.wordlist(),\n it: LangIt.wordlist(),\n pt: LangPt.wordlist(),\n ja: LangJa.wordlist(),\n ko: LangKo.wordlist(),\n zh_cn: LangZh.wordlist(\"cn\"),\n zh_tw: LangZh.wordlist(\"tw\"),\n};\n//# sourceMappingURL=wordlists.js.map"],"names":["LangCz","LangEn","LangEs","LangFr","LangIt","LangPt","LangJa","LangKo","LangZh"],"mappings":";;;;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG;AACzB,IAAI,EAAE,EAAEA,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,KAAK,EAAEC,aAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AAChC,IAAI,KAAK,EAAEA,aAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AAChC;;"} \ No newline at end of file diff --git a/lib.esm/_tests/blockchain-data.d.ts.map b/lib.esm/_tests/blockchain-data.d.ts.map index 768360b32..640ed0edf 100644 --- a/lib.esm/_tests/blockchain-data.d.ts.map +++ b/lib.esm/_tests/blockchain-data.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"blockchain-data.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3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AE,MAAM,CAAC;QACd,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC,CAAC;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAC9B,qBAAqB,EACrB,KAAK,CAAC,qBAAqB,CAAC,CAyB7B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAC5B,qBAAqB,EACrB,KAAK,CAAC,mBAAmB,CAAC,CAiE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,qBAAqB,EACrB,KAAK,CAAC,yBAAyB,CAAC,CAwDjC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAC9B,qBAAqB,EACrB,KAAK,CAAC,qBAAqB,CAAC,CAiG7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,qBAAqB,CAAyB,CAAC;AAChF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQ7E"} \ No newline at end of file +{"version":3,"file":"blockchain-data.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,M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,MAAM,CAC/B,qBAAqB,EACrB,KAAK,CAAC,qBAAqB,CAAC,CAiG5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,qBAAqB,CAAyB,CAAC;AAChF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQ7E"} \ No newline at end of file diff --git a/lib.esm/_tests/blockchain-data.js.map b/lib.esm/_tests/blockchain-data.js.map index 5c6db8940..bb232395e 100644 --- a/lib.esm/_tests/blockchain-data.js.map +++ b/lib.esm/_tests/blockchain-data.js.map @@ -1 +1 @@ -{"version":3,"file":"blockchain-data.js","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAqFA,MAAM,CAAC,MAAM,WAAW,GAGpB;IACF,OAAO,EAAE;QACP;YACE,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,4CAA4C;YACrD,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC;YACnC,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,IAAI;SACX;QACD;YACE,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,kdAAkd;YACxd,OAAO,EAAE;gBACP,GAAG,EAAE,oEAAoE;aAC1E;SACF;QACD;YACE,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,oBAAoB;SAC3B;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAGlB;IACF,OAAO,EAAE;QACP;YACE,IAAI,EAAE,qBAAqB;YAC3B,IAAI,EAAE,oEAAoE;YAC1E,UAAU,EACR,oEAAoE;YACtE,MAAM,EAAE,CAAC;YACT,SAAS,EAAE,UAAU;YACrB,KAAK,EAAE,oBAAoB;YAC3B,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC;YAC/B,WAAW,EAAE,MAAM,CAAC,Q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,EAAE,MAAM,CAAC,UAAU,CAAC;YAC/B,IAAI,EAAE;gBACJ;oBACE,OAAO,EAAE,4CAA4C;oBACrD,SAAS,EACP,oEAAoE;oBACtE,WAAW,EAAE,QAAQ;oBACrB,IAAI,EAAE,IAAI;oBACV,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE;wBACN,oEAAoE;wBACpE,oEAAoE;qBACrE;oBACD,eAAe,EACb,oEAAoE;oBACtE,gBAAgB,EAAE,IAAI;iBACvB;aACF;YACD,SAAS,EACP,ogBAAogB;YACtgB,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,CAAC;YACT,EAAE,EAAE,4CAA4C;YAChD,IAAI,EAAE,oEAAoE;YAC1E,KAAK,EAAE,IAAI;SACZ;KACF;IACD,MAAM,EAAE,EAAE;CACX,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAiC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAChF,MAAM,UAAU,qBAAqB,CAAC,OAAe,EAAE,KAAa;IAClE,QAAQ,OAAO,EAAE;QACf,KAAK,WAAW;YACd,OAAO,KAAK,IAAI,OAAO,CAAC;QAC1B;YACE,MAAM;KACT;IACD,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC"} \ No newline at end of file +{"version":3,"file":"blockchain-data.js","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAqFA,MAAM,CAAC,MAAM,WAAW,GAGpB;IACH,OAAO,EAAE;QACR;YACC,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,4CAA4C;YACrD,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC;YACnC,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,IAAI;SACV;QACD;YACC,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,kdAAkd;YACxd,OAAO,EAAE;gBACR,GAAG,EAAE,oEAAoE;aACzE;S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newline at end of file diff --git a/lib.esm/_tests/create-provider.d.ts.map b/lib.esm/_tests/create-provider.d.ts.map index 901738c3a..6a71ec23d 100644 --- a/lib.esm/_tests/create-provider.d.ts.map +++ b/lib.esm/_tests/create-provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA2EpD,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAED,eAAO,MAAM,aAAa,mBAAqD,CAAC;AAUhF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAMnE;AAED,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACd,IAAI,GAAG,gBAAgB,CAsBzB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAMzD"} \ No newline at end of file +{"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA2EpD,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAED,eAAO,MAAM,aAAa,mBAAqD,CAAC;AAUhF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAMnE;AAED,wBAAgB,WAAW,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACb,IAAI,GAAG,gBAAgB,CAsBzB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAMzD"} \ No newline at end of file diff --git a/lib.esm/_tests/create-provider.js.map b/lib.esm/_tests/create-provider.js.map index e0cfff3d4..ffc8a0297 100644 --- a/lib.esm/_tests/create-provider.js.map +++ b/lib.esm/_tests/create-provider.js.map @@ -1 +1 @@ -{"version":3,"file":"create-provider.js","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,GACR,MAAM,aAAa,CAAC;AAUrB,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACrD,gDAAgD;AAEhD,MAAM,gBAAgB,GAA2B;IAC/C;QACE,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAC/B,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QAC1E,CAAC;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAC/B,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QACzE,CAAC;KACF;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAC/B,OAAO,cAAc,CAAC,oBAAoB,CACxC,OAAO,EACP,kCAAkC,CACnC,CAAC;QACJ,CAAC;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAC/B,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;KACF;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,WAAW;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AM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;KACpD;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"} \ No newline at end of file +{"version":3,"file":"create-provider.js","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,GACP,MAAM,aAAa,CAAC;AAUrB,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACrD,gDAAgD;AAEhD,MAAM,gBAAgB,GAA2B;IAChD;QACC,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAChC,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QACzE,CAAC;KACD;IACD;QACC,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAChC,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QACxE,CAAC;KACD;IACD;QACC,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAChC,OAAO,cAAc,CAAC,oBAAoB,CACzC,OAAO,EACP,kCAAkC,CAClC,CAAC;QACH,CAAC;KACD;IACD;QACC,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAChC,OAAO,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC;KACD;IACD;QACC,IAAI,EAAE,mBAAmB;QACzB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAChC,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;KACD;IACD;QACC,IAAI,EA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,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/test-cip.d.ts b/lib.esm/_tests/test-cip.d.ts new file mode 100644 index 000000000..cc969463b --- /dev/null +++ b/lib.esm/_tests/test-cip.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test-cip.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/test-cip.d.ts.map b/lib.esm/_tests/test-cip.d.ts.map new file mode 100644 index 000000000..cd282b01e --- /dev/null +++ b/lib.esm/_tests/test-cip.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test-cip.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-cip.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/_tests/test-cip.js b/lib.esm/_tests/test-cip.js new file mode 100644 index 000000000..3936d3067 --- /dev/null +++ b/lib.esm/_tests/test-cip.js @@ -0,0 +1,150 @@ +import assert from "node:assert/strict"; +import { Interface, Cip150MetadataContract, Cip151Lifecycle, Cip152LabCertificate, CustomUnitToken, cip150Abi, customUnitAbi, IpfsGateway, } from "../index.js"; +const address = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; +describe("CIP metadata and custom units", () => { + it("uses Unix seconds and exact inclusive lifecycle boundaries", () => { + const lifecycle = new Cip151Lifecycle({ + tokenExpiration: "9007199254740993", + tradingStop: "0", + }); + assert.equal(lifecycle.isExpiredAt(9007199254740992n), false); + assert.equal(lifecycle.isExpiredAt(9007199254740993n), true); + assert.equal(lifecycle.isTradingStoppedAt(0n), true); + assert.equal(new Cip151Lifecycle().isExpiredAt(1n), false); + for (const value of ["-1", "1.5", "1e3", " 1", "NaN"]) + assert.throws(() => new Cip151Lifecycle({ tokenExpiration: value })); + }); + it("validates and copies lab measurements", () => { + const input = { moisture: { value: 12, unit: "%" } }; + const lab = new Cip152LabCertificate(input); + input.moisture.value = 99; + assert.equal(lab.measurements.moisture.value, 12); + for (const json of [ + null, + [], + { x: {} }, + { x: { value: true } }, + { x: { value: Infinity } }, + { x: { value: 1, unit: 3 } }, + ]) + assert.throws(() => new Cip152LabCertificate(json)); + }); + it("encodes CIP-150 calls and preserves block references", async () => { + const abi = new Interface(cip150Abi); + const values = { + tokenExpiration: "100", + lab: "ipfs://QmExample/lab.json", + }; + const calls = []; + const metadata = new Cip150MetadataContract(address, { + provider: null, + call: async (tx) => { + assert.equal(tx.blockTag, 42); + const parsed = abi.parseTransaction({ data: tx.data }); + calls.push(parsed.name); + const key = parsed.args.length ? parsed.args[0] : ""; + const result = { + listMetadataKeys: [Object.keys(values)], + metadataCount: [2n], + getMetadataByIndex: ["tokenExpiration", "100"], + hasMetadataKey: [Object.hasOwn(values, key)], + getMetadataValue: [values[key]], + isMetadataSealed: [true], + }; + return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); + }, + }); + assert.equal(await metadata.count(42), 2n); + assert.deepEqual(await metadata.getByIndex(0n, 42), { + key: "tokenExpiration", + value: "100", + }); + assert.equal((await metadata.readAll(42))[0].sealed, true); + assert.equal((await metadata.readAll(42, false))[0].sealed, undefined); + assert.equal((await metadata.readLifecycle(42)).tokenExpiration, 100n); + const gateway = new IpfsGateway({ + fetch: async () => new Response('{"pH":{"value":7}}'), + }); + assert.equal((await metadata.readLabCertificate(gateway, 42)).measurements.pH.value, 7); + values.lab = "ipfs://QmExample/wrong.json"; + await assert.rejects(metadata.readLabCertificate(gateway, 42), /lab.json/); + delete values.lab; + assert.equal(await metadata.readLabCertificate(gateway, 42), null); + await assert.rejects(metadata.setValue("x", "y"), /sendTransaction/); + assert.ok(calls.includes("isMetadataSealed")); + }); + it("discovers custom units and retains balances beyond Number precision", async () => { + const abi = new Interface(customUnitAbi); + const canonical = 9007199254740993n; + const token = new CustomUnitToken(address, { + provider: null, + call: async (tx) => { + assert.equal(tx.blockTag, 10); + const parsed = abi.parseTransaction({ data: tx.data }); + const result = { + supportsUnit: [parsed.args.length > 0 && parsed.args[0] === "units"], + supportedUnits: [["units", "kg"]], + preferredUnit: ["kg"], + balanceOf: [canonical], + balanceOfUnit: [canonical * 3n], + }; + if (parsed.name === "balanceOfUnit") + assert.equal(parsed.args[1], "kg"); + return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); + }, + }); + assert.equal((await token.discover(10)).supports("kg"), true); + const balance = await token.balance(address, undefined, 10); + assert.equal(balance.multiplierNumerator, canonical * 3n); + assert.equal(balance.multiplierDenominator, canonical); + assert.equal(await token.supportsUnit(" ", 10), false); + assert.throws(() => token.balanceOfUnit(address, " ")); + }); +}); +describe("IPFS gateway", () => { + it("resolves references and rejects unsupported schemes and traversal", () => { + const gateway = new IpfsGateway(); + for (const ref of [ + "ipfs://QmExample/lab.json", + "/ipfs/QmExample/lab.json", + "QmExample/lab.json", + "ipfs://ipfs/QmExample/lab.json", + ]) + assert.equal(gateway.resolve(ref).href, "https://ipf.sk/QmExample/lab.json"); + assert.equal(gateway.resolve("https://example.com/lab.json").href, "https://example.com/lab.json"); + for (const ref of ["", "file:///tmp/lab.json", "QmExample/../lab.json"]) + assert.throws(() => gateway.resolve(ref)); + assert.throws(() => new IpfsGateway({ maxResponseBytes: 0 })); + assert.throws(() => new IpfsGateway({ template: "ftp://example.com/{cid}" })); + }); + it("bounds streamed bodies and cancels oversized responses", async () => { + let cancelled = false; + const gateway = new IpfsGateway({ + maxResponseBytes: 4, + fetch: async () => new Response(new ReadableStream({ + start(c) { + c.enqueue(new Uint8Array(5)); + }, + cancel() { + cancelled = true; + }, + })), + }); + await assert.rejects(gateway.readJson("QmExample"), /exceeds/); + assert.equal(cancelled, true); + }); + it("rejects HTTP errors and invalid JSON", async () => { + await assert.rejects(new IpfsGateway({ + fetch: async () => new Response("no", { status: 404 }), + }).readJson("QmExample"), /404/); + await assert.rejects(new IpfsGateway({ fetch: async () => new Response("not json") }).readJson("QmExample"), SyntaxError); + }); + it("aborts stalled requests", async () => { + const gateway = new IpfsGateway({ + timeoutMs: 5, + fetch: async (_url, init) => new Promise((_resolve, reject) => init.signal.addEventListener("abort", () => reject(new Error("aborted")))), + }); + await assert.rejects(gateway.readJson("QmExample"), /aborted/); + }); +}); +//# sourceMappingURL=test-cip.js.map \ No newline at end of file diff --git a/lib.esm/_tests/test-cip.js.map b/lib.esm/_tests/test-cip.js.map new file mode 100644 index 000000000..b9103561c --- /dev/null +++ b/lib.esm/_tests/test-cip.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test-cip.js","sourceRoot":"","sources":["../../src.ts/_tests/test-cip.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACN,SAAS,EACT,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,aAAa,EACb,WAAW,GACX,MAAM,aAAa,CAAC;AAErB,MAAM,OAAO,GAAG,gDAAgD,CAAC;AAEjE,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACrE,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC;YACrC,eAAe,EAAE,kBAAkB;YACnC,WAAW,EAAE,GAAG;SAChB,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QACrD,MAAM,CAAC,KAAK,CAAC,IAAI,eAAe,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QAC3D,KAAK,MAAM,KAAK,I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UAAU,CAAC,EAAE,CAAC,CAAC,QAAQ,CACxE,WAAW,CACX,EACD,WAAW,CACX,CAAC;IACH,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC;YAC/B,SAAS,EAAE,CAAC;YACZ,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAC3B,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAChC,IAAK,CAAC,MAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAC5C,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAC5B,CACD;SACF,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/test-contract.js b/lib.esm/_tests/test-contract.js index b5fa6fff5..3ab6af6e3 100644 --- a/lib.esm/_tests/test-contract.js +++ b/lib.esm/_tests/test-contract.js @@ -8,7 +8,7 @@ const testSeed = "ec372b08ffc451a5dd991c68006aa01a033a6a391e0e72d5690c13cff719fd const tesPrivateKey = "69bb68c3a00a0cd9cbf2cab316476228c758329bbfe0b1759e8634694a9497afea05bcbf24e2aa0627eac4240484bb71de646a9296872a3c0e"; const testAddress = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; const testPublicKey = "0x484ed765af56534f1c98c0f3ac9fb460fbf5c3cf582e54a6cdfc319986ce1bb875d3afcc9c336764348c96264dfeef9565364d7e8e14e9aa80"; -const provider = getDefaultProvider("https://xcbapi.corecoin.cc/"); +const provider = getDefaultProvider(process.env.COREBC_RPC_URL || "https://xcbapi.corecoin.cc/"); const mnemonicWallet = Wallet.fromPhrase({ phrase: testWalletPhrase, password: "111111", @@ -18,7 +18,6 @@ const mnemonicWalletWithoutPassKey = Wallet.fromPhrase({ phrase: testWalletPhrase, prefix: networkIdToPrefix(3), }); -console.log(mnemonicWalletWithoutPassKey.publicKey); const wallet = Wallet.fromSeed({ prefix: networkIdToPrefix(3), seed: testSeed, @@ -45,28 +44,30 @@ const transaction = Transaction.from({ networkId: 4, }); describe("Test wallet creation", function () { + after(() => provider.destroy()); it("can generate a random wallet", function () { + assert.equal(mnemonicWalletWithoutPassKey.publicKey.length, 116); assert.equal(randomWallet.mnemonic?.phrase.split(" ").length, 24, "mismatch in phrase length"); assert.equal(isAddressable(randomWallet), true, "random wallet is not addressable"); }); }); describe("Test getting data from blockchain and calling smart contract", function () { - it("can currectly sign a transaction", async function () { + it("can correctly sign a transaction", async function () { this.timeout(TIMEOUT_PERIOD); const tx = await baseWallet.signTransaction(transaction); assert.equal(tx, tesSignedTransaction, "sign transaction failed"); }); - it("can currectly get signer from signed transaction", async function () { + it("can correctly get signer from signed transaction", async function () { this.timeout(TIMEOUT_PERIOD); const message = "my message"; const signedMessage = await baseWallet.signMessage(message); const address = verifyMessage(message, signedMessage, networkIdToPrefix(3)); assert.equal(address, baseWalletAddress, "get address from signed message failed"); }); - it("can get feeData ", async function () { + (process.env.COREBC_RPC_URL ? it : it.skip)("can get fee data", async function () { this.timeout(TIMEOUT_PERIOD); const feeData = await provider.getFeeData(); - assert.equal(feeData.energyPrice, 1000000000n, "mismatch in expected energy price"); + assert.ok(feeData.energyPrice !== null && feeData.energyPrice >= 0n); }); it("can generate wallet", function () { assert.equal(mnemonicWallet.address.length, 46, "mismatch in address length"); diff --git a/lib.esm/_tests/test-contract.js.map b/lib.esm/_tests/test-contract.js.map index 83fc2155f..23d4e0571 100644 --- a/lib.esm/_tests/test-contract.js.map +++ b/lib.esm/_tests/test-contract.js.map @@ -1 +1 @@ -{"version":3,"file":"test-contract.js","sourceRoot":"","sources":["../../src.ts/_tests/test-contract.ts"],"names":[],"mappings":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AAM,CAAC,KAAK,CACV,MAAM,CAAC,SAAS,EAChB,aAAa,EACb,mCAAmC,CACpC,CAAC;QACF,MAAM,CAAC,KAAK,CACV,MAAM,CAAC,OAAO,EACd,WAAW,EACX,oCAAoC,CACrC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"test-contract.js","sourceRoot":"","sources":["../../src.ts/_tests/test-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,MAAM,EACN,WAAW,EACX,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,oBAAoB,GACzB,oaAAoa,CAAC;AACta,MAAM,gBAAgB,GACrB,oJAAoJ,CAAC;AACtJ,MAAM,QAAQ,GACb,kIAAkI,CAAC;AACpI,MAAM,aAAa,GAClB,oHAAoH,CAAC;AACtH,MAAM,WAAW,GAAG,gDAAgD,CAAC;AACrE,MAAM,aAAa,GAClB,sHAAsH,CAAC;AACxH,MAAM,QAAQ,GAAG,kBAAkB,CAClC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,6BAA6B,CAC3D,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC;IACxC,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,QAAQ;IAClB,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;CAC5B,CAAC,CAAC;AACH,MAAM,4BAA4B,GAAG,MAAM,CAAC,UAAU,CAAC;IACtD,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC9B,M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AC5B,CAAC;QACF,MAAM,CAAC,KAAK,CACX,cAAc,CAAC,SAAS,EACxB,aAAa,EACb,wBAAwB,CACxB,CAAC;QACF,MAAM,CAAC,KAAK,CACX,cAAc,CAAC,OAAO,EACtB,WAAW,EACX,+BAA+B,CAC/B,CAAC;QACF,MAAM,CAAC,KAAK,CACX,UAAU,CAAC,OAAO,CAAC,MAAM,EACzB,EAAE,EACF,4CAA4C,CAC5C,CAAC;QACF,MAAM,CAAC,KAAK,CACX,UAAU,CAAC,SAAS,EACpB,aAAa,EACb,wCAAwC,CACxC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,UAAU,CAAC,OAAO,EAClB,WAAW,EACX,yCAAyC,CACzC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,MAAM,CAAC,OAAO,CAAC,MAAM,EACrB,EAAE,EACF,uCAAuC,CACvC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,MAAM,CAAC,SAAS,EAChB,aAAa,EACb,mCAAmC,CACnC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,MAAM,CAAC,OAAO,EACd,WAAW,EACX,oCAAoC,CACpC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/test-crypto.d.ts b/lib.esm/_tests/test-crypto.d.ts new file mode 100644 index 000000000..5e2048d9c --- /dev/null +++ b/lib.esm/_tests/test-crypto.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test-crypto.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/test-crypto.d.ts.map b/lib.esm/_tests/test-crypto.d.ts.map new file mode 100644 index 000000000..bac9d8b06 --- /dev/null +++ b/lib.esm/_tests/test-crypto.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test-crypto.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-crypto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/_tests/test-crypto.js b/lib.esm/_tests/test-crypto.js new file mode 100644 index 000000000..f1e298a02 --- /dev/null +++ b/lib.esm/_tests/test-crypto.js @@ -0,0 +1,37 @@ +import assert from "node:assert/strict"; +import { SigningKey, getBytes, sha256, ripemd160, scryptSync, scrypt, keccak256, } from "../index.js"; +import { createHash } from "../crypto/crypto-browser.js"; +describe("updated crypto dependencies", () => { + it("matches standard hash and scrypt vectors", async () => { + assert.equal(sha256("0x"), "0xa7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"); + assert.equal(ripemd160("0x"), "0x9c1185a5c5e9fc54612808977ee8f548b2258d31"); + assert.equal(keccak256("0x"), "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"); + const expected = "0x77d6576238657b203b19ca42c18a0497"; + assert.equal(scryptSync("0x", "0x", 16, 1, 1, 16), expected); + assert.equal(await scrypt("0x", "0x", 16, 1, 1, 16), expected); + assert.deepEqual(createHash("sha256").update(new Uint8Array()).digest(), getBytes("0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")); + }); + it("copies byte private keys and validates lengths", () => { + const bytes = new Uint8Array(57).fill(1); + const key = new SigningKey(bytes); + bytes.fill(2); + assert.equal(key.privateKey, "0x" + "01".repeat(57)); + for (const length of [0, 32, 56, 58]) + assert.throws(() => new SigningKey(new Uint8Array(length))); + assert.throws(() => key.sign("0x00")); + }); + it("signs, rejects tampering and derives symmetric Ed448 secrets in both key modes", () => { + const a = new SigningKey("01".repeat(57)); + const b = new SigningKey("02".repeat(56) + "80"); + const digest = sha256("0x1234"); + for (const key of [a, b]) { + const sig = key.sign(digest); + assert.equal(SigningKey.recoverPublicKey(digest, sig), key.publicKey); + assert.throws(() => SigningKey.recoverPublicKey(sha256("0x1235"), sig)); + } + assert.equal(a.computeSharedSecret(b.publicKey), b.computeSharedSecret(a.publicKey)); + assert.equal(SigningKey.addPoints(a.publicKey, b.publicKey), SigningKey.addPoints(b.publicKey, a.publicKey)); + assert.throws(() => a.computeSharedSecret("0x00")); + }); +}); +//# sourceMappingURL=test-crypto.js.map \ No newline at end of file diff --git a/lib.esm/_tests/test-crypto.js.map b/lib.esm/_tests/test-crypto.js.map new file mode 100644 index 000000000..642d885a2 --- /dev/null +++ b/lib.esm/_tests/test-crypto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test-crypto.js","sourceRoot":"","sources":["../../src.ts/_tests/test-crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACN,UAAU,EACV,QAAQ,EACR,MAAM,EACN,SAAS,EACT,UAAU,EACV,MAAM,EACN,SAAS,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,CAAC,KAAK,CACX,MAAM,CAAC,IAAI,CAAC,EACZ,oEAAoE,CACpE,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,4CAA4C,CAAC,CAAC;QAC5E,MAAM,CAAC,KAAK,CACX,SAAS,CAAC,IAAI,CAAC,EACf,oEAAoE,CACpE,CAAC;QACF,MAAM,QAAQ,GAAG,oCAAoC,CAAC;QACtD,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,MAAM,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC/D,MAAM,CAAC,SAAS,CACf,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC,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C,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;YACtE,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACzE,CAAC;QACD,MAAM,CAAC,KAAK,CACX,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,EAClC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,CAClC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EAC9C,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,CAC9C,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/test-keystore.d.ts b/lib.esm/_tests/test-keystore.d.ts new file mode 100644 index 000000000..c74023fe2 --- /dev/null +++ b/lib.esm/_tests/test-keystore.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test-keystore.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/test-keystore.d.ts.map b/lib.esm/_tests/test-keystore.d.ts.map new file mode 100644 index 000000000..f298fe780 --- /dev/null +++ b/lib.esm/_tests/test-keystore.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-keystore.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/_tests/test-keystore.js b/lib.esm/_tests/test-keystore.js new file mode 100644 index 000000000..577f45c7a --- /dev/null +++ b/lib.esm/_tests/test-keystore.js @@ -0,0 +1,41 @@ +import assert from "node:assert/strict"; +import { Wallet, networkIdToPrefix, encryptKeystoreJsonSync, encryptKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, } from "../index.js"; +describe("AES keystores", () => { + const wallet = Wallet.fromSeed({ + seed: "01".repeat(64), + prefix: networkIdToPrefix(3), + }); + const account = { address: wallet.address, privateKey: wallet.privateKey }; + const options = { scrypt: { N: 16, r: 1, p: 1 } }; + it("round-trips Ed448 keys with sync and async encryption", async () => { + for (const json of [ + encryptKeystoreJsonSync(account, "test", options), + await encryptKeystoreJson(account, "test", options), + ]) { + assert.deepEqual(decryptKeystoreJsonSync(json, "test"), account); + assert.deepEqual(await decryptKeystoreJson(json, "test"), account); + assert.throws(() => decryptKeystoreJsonSync(json, "wrong"), /incorrect password/); + const changed = JSON.parse(json); + changed.Crypto.mac = "00".repeat(32); + await assert.rejects(decryptKeystoreJson(JSON.stringify(changed), "test"), /incorrect password/); + } + }); + it("rejects unsafe KDF parameters before allocating work", () => { + for (const scrypt of [ + { N: 0 }, + { N: 1 }, + { N: 2 ** 32 }, + { r: 0 }, + { p: 2 ** 30 }, + { N: 1048576, r: 8 }, + ]) + assert.throws(() => encryptKeystoreJsonSync(account, "test", { scrypt }), /unsafe/); + const data = JSON.parse(encryptKeystoreJsonSync(account, "test", options)); + data.Crypto.kdfparams.n = 2 ** 32; + assert.throws(() => decryptKeystoreJsonSync(JSON.stringify(data), "test"), /unsafe/); + data.Crypto.kdf = "pbkdf2"; + Object.assign(data.Crypto.kdfparams, { c: 10000001, prf: "hmac-sha256" }); + assert.throws(() => decryptKeystoreJsonSync(JSON.stringify(data), "test"), /unsafe/); + }); +}); +//# sourceMappingURL=test-keystore.js.map \ No newline at end of file diff --git a/lib.esm/_tests/test-keystore.js.map b/lib.esm/_tests/test-keystore.js.map new file mode 100644 index 000000000..c3cd64192 --- /dev/null +++ b/lib.esm/_tests/test-keystore.js.map @@ -0,0 +1 @@ +{"version":3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Q,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC,CAAC;QAC1E,MAAM,CAAC,MAAM,CACZ,GAAG,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAC3D,QAAQ,CACR,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/types.d.ts.map b/lib.esm/_tests/types.d.ts.map index 6619a1cf6..db09709f7 100644 --- a/lib.esm/_tests/types.d.ts.map +++ b/lib.esm/_tests/types.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B;IACE,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpD,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;CAClC,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;CAClC,CAAC;AAEN,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM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AAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB"} \ No newline at end of file +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC3B;IACA,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpD,KAAK,EAAE,MAAM,CAAC;CACb,GACD;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CACd,GACD;IACA,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,kBAAkB,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AgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB"} \ No newline at end of file diff --git a/lib.esm/_version.d.ts b/lib.esm/_version.d.ts index ab655b4ad..515a07b59 100644 --- a/lib.esm/_version.d.ts +++ b/lib.esm/_version.d.ts @@ -1,5 +1,3 @@ -/** - * The current version of corebc. - */ +/** The current version of corebc; keep in sync with package.json. */ export declare const version: string; //# sourceMappingURL=_version.d.ts.map \ No newline at end of file diff --git a/lib.esm/_version.d.ts.map b/lib.esm/_version.d.ts.map index 502b731b4..99992181e 100644 --- a/lib.esm/_version.d.ts.map +++ b/lib.esm/_version.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"} \ No newline at end of file diff --git a/lib.esm/_version.js b/lib.esm/_version.js index aefc1f0bb..5ba73f265 100644 --- a/lib.esm/_version.js +++ b/lib.esm/_version.js @@ -1,6 +1,3 @@ -/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ -/** - * The current version of corebc. - */ -export const version = "6.4.0"; +/** The current version of corebc; keep in sync with package.json. */ +export const version = "0.4.1"; //# sourceMappingURL=_version.js.map \ No newline at end of file diff --git a/lib.esm/_version.js.map b/lib.esm/_version.js.map index 360ba34f9..08e177b22 100644 --- a/lib.esm/_version.js.map +++ b/lib.esm/_version.js.map @@ -1 +1 @@ -{"version":3,"file":"_version.js","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAEnE;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAW,OAAO,CAAC"} \ No newline at end of file +{"version":3,"file":"_version.js","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,CAAC,MAAM,OAAO,GAAW,OAAO,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi-types/Tes.d.ts.map b/lib.esm/abi-types/Tes.d.ts.map index 04a5ce028..0c7f7bc42 100644 --- a/lib.esm/abi-types/Tes.d.ts.map +++ b/lib.esm/abi-types/Tes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACT,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C,WAAW,CACT,eAAe,EACX,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,2CAA2C,GAC3C,iDAAiD,GACjD,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,cAAc,GACjB,gBAAgB,CAAC;IAEpB,QAAQ,CACN,sBAAsB,EAAE,UAAU,GAAG,gBAAgB,GAAG,UAAU,GACjE,aAAa,CAAC;IAEjB,kBAAkB,CAChB,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,GAClC,MAAM,CAAC;IACV,kBAAkB,CAChB,gBAAgB,EAAE,WAAW,EAC7B,MAAM,EAAE,CAAC,WAAW,C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kBAAkB,CAC1B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;KACH,CAAC;CACH"} \ No newline at end of file +{"version":3,"file":"Tes.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC9C,WAAW,CACV,eAAe,EACZ,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,2CAA2C,GAC3C,iDAAiD,GACjD,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,cAAc,GACf,gBAAgB,CAAC;IAEpB,QAAQ,CACP,sBAAsB,EAAE,UAAU,GAAG,gBAAgB,GAAG,UAAU,GAChE,aAAa,CAAC;IAEjB,kBAAkB,CACjB,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,GACjC,MAAM,CAAC;IACV,kBAAkB,CACjB,gBAAgB,EAAE,WAAW,EAC7B,MAAM,EAAE,CAAC,WAAW,CAAC,GACnB,MAAM,CAAC;IACV,kBAAkB,CACjB,gBAAgB,EAAE,cAAc,EAChC,MAAM,EAAE,CAAC,YAAY,EAAE,CAAC,GACtB,MAAM,CAAC;IACV,kBAAkB,CACjB,gBAAgB,EAAE,aAAa,EAC/B,MAAM,EAAE,CAAC,YAAY,CAAC,GACpB,MAAM,CAAC;IACV,kBA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/lib.esm/abi-types/Tes_abi.d.ts.map +++ b/lib.esm/abi-types/Tes_abi.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes_abi.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACT,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,WAAW,CACT,eAAe,EACX,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,2CAA2C,GAC3C,iDAAiD,GACjD,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,cAAc,GACjB,gBAAgB,CAAC;IAEpB,QAAQ,CACN,sBAAsB,EAAE,UAAU,GAAG,gBAAgB,GAAG,UAAU,GACjE,aAAa,CAAC;IAEjB,kBAAkB,CAChB,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,GAClC,MAAM,CAAC;IACV,kBAAkB,CAChB,gBAAgB,EAAE,WAAW,EAC7B,MAAM,EAAE,CAAC,WAAW,CAAC,GACpB,MAAM,CAAC;IACV,kBAAkB,CAChB,gBAAgB,EAAE,cAAc,EAChC,MAAM,EAAE,CAAC,YAAY,EAAE,CAAC,GACvB,MAAM,CAAC;IACV,kBAAkB,CAChB,gBAAgB,EAAE,aAAa,EAC/B,MAAM,EAAE,CAAC,YAAY,CAAC,GACrB,MAAM,CAAC;IACV,kBAAkB,CAChB,gBAAgB,EAAE,kBAAkB,E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aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;IACF,QAAQ,CACN,GAAG,EAAE,gBAAgB,GACpB,kBAAkB,CACnB,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CACjC,CAAC;IACF,QAAQ,CACN,GAAG,EAAE,UAAU,GACd,kBAAkB,CACnB,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;IAEF,OAAO,EAAE;QACP,mCAAmC,EAAE,kBAAkB,CACrD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC1B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACxD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CACjC,CAAC;QACF,cAAc,EAAE,kBAAkB,CAChC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CACjC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACrD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC1B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;KACH,CAAC;CACH"} \ No newline at end of file +{"version":3,"file":"Tes_abi.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,S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AC,YAAY,CAChC,CAAC;IACF,QAAQ,CACP,GAAG,EAAE,UAAU,GACb,kBAAkB,CACpB,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;IAEF,OAAO,EAAE;QACR,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACzD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QACF,cAAc,EAAE,kBAAkB,CACjC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/lib.esm/abi-types/common.d.ts.map b/lib.esm/abi-types/common.d.ts.map index 1d45da294..b7d6fe89d 100644 --- a/lib.esm/abi-types/common.d.ts.map +++ b/lib.esm/abi-types/common.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/common.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,QAAQ,EAC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,CACC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/B,CAAC,SAAS,MAAM,GAChB,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAExC,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,gBAAgB,CAAC;IAE3B,WAAW,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,gBAAgB,CAAC;IAEjE,mBAAmB,CAClB,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,UAAU,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,IAAI,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC9E,WAAW,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,gBAAgB,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChE"} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes__factory.d.ts.map b/lib.esm/abi-types/factories/Tes__factory.d.ts.map index 9c0f56a13..262b59a93 100644 --- a/lib.esm/abi-types/factories/Tes__factory.d.ts.map +++ b/lib.esm/abi-types/factories/Tes__factory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuWnD,qBAAa,YAAY;IACvB,MAAM,CAAC,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAQ;IAC3B,MAAM,CAAC,eAAe,IAAI,YAAY;IAGtC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,GAAG;CAGrE"} \ No newline at end of file +{"version":3,"file":"Tes__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuWnD,qBAAa,YAAY;IACxB,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;;qBAMX,OAA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CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,GAAG,CAEnE;CACD"} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes__factory.js.map b/lib.esm/abi-types/factories/Tes__factory.js.map index f47fa5aff..d54554413 100644 --- a/lib.esm/abi-types/factories/Tes__factory.js.map +++ b/lib.esm/abi-types/factories/Tes__factory.js.map @@ -1 +1 @@ -{"version":3,"file":"Tes__factory.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AAEpB,OAAO,EAAE,QAAQ,EAAkB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGtE,MAAM,IAAI,GAAG;IACX;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACd;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,KAAK;gBACd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aAChB;SACF;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;CACO,CAAC;AAEX,MAAM,OAAO,YAAY;IACvB,MAAM,CAAU,GAAG,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,eAAe;QACpB,OAAO,IAAI,SAAS,CAAC,IAAI,CAAiB,CAAC;IAC7C,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,MAA8B;QAC5D,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAmB,CAAC;IAC/D,CAAC"} \ No newline at end of file +{"version":3,"file":"Tes__factory.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AAEpB,OAAO,EAAE,QAAQ,EAAkB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGtE,MAAM,IAAI,GAAG;IACZ;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aACf;SACD;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACb;IACD;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aACf;YACD;g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ACV,IAAI,EAAE,SAAS;aACf;YACD;gBACC,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aACf;SACD;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KAChB;CACQ,CAAC;AAEX,MAAM,OAAO,YAAY;IACxB,MAAM,CAAU,GAAG,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,eAAe;QACrB,OAAO,IAAI,SAAS,CAAC,IAAI,CAAiB,CAAC;IAC5C,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,MAA8B;QAC7D,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAmB,CAAC;IAC9D,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes_abi__factory.d.ts.map b/lib.esm/abi-types/factories/Tes_abi__factory.d.ts.map index 5abc35679..530a4f795 100644 --- a/lib.esm/abi-types/factories/Tes_abi__factory.d.ts.map +++ b/lib.esm/abi-types/factories/Tes_abi__factory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes_abi__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuW/D,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAQ;IAC3B,MAAM,CAAC,eAAe,IAAI,gBAAgB;IAG1C,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO;CAGzE"} \ No newline at end of file +{"version":3,"file":"Tes_abi__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuW/D,qBAAa,gBAAgB;IAC5B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,MAAM;qBACpB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,MAAM;;uBAGR,gBAAgB;uBAChB,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE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IAAI,EAAE,SAAS;;uBAGX,cAAc;;qBAGlB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;uBAGX,qBAAqB;;qBAGzB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;uBAIV,aAAa;;qBAGjB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,cAAc;;kCAEH,YAAY;uBACvB,UAAU;OAKU;IAC3B,MAAM,CAAC,eAAe,IAAI,gBAAgB,CAEzC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAEvE;CACD"} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes_abi__factory.js.map b/lib.esm/abi-types/factories/Tes_abi__factory.js.map index e85ea92b7..e978722e4 100644 --- a/lib.esm/abi-types/factories/Tes_abi__factory.js.map +++ b/lib.esm/abi-types/factories/Tes_abi__factory.js.map @@ -1 +1 @@ -{"version":3,"file":"Tes_abi__factory.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/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AAI,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAuB,CAAC;IACnE,CAAC"} \ No newline at end of file +{"version":3,"file":"Tes_abi__factory.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AAEpB,OAAO,EAAE,QAAQ,EAAkB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGtE,MAAM,IAAI,GAAG;IACZ;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aACf;SACD;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACb;IACD;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,KAAK;gBACd,YAAY,EAAE,MAAM;gBACpB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,MAAM;aACZ;SACD;QACD,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,OAAO;KACb;IACD;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,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,IAAI,SAAS,CAAC,IAAI,CAAqB,CAAC;IAChD,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,MAA8B;QAC7D,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAuB,CAAC;IAClE,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/abi-coder.d.ts.map b/lib.esm/abi/abi-coder.d.ts.map index a86e1aca8..ad04d5ac9 100644 --- a/lib.esm/abi/abi-coder.d.ts.map +++ b/lib.esm/abi/abi-coder.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AA8F3B;;GAEG;AACH,qBAAa,QAAQ;;IA2DnB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM;IAQjE;;;;OAIG;IACH,MAAM,CACJ,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACzB,MAAM;IAeT;;;;;;OAMG;IACH,MAAM,CACJ,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,OAAO,GACd,MAAM;IAQT;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ;IAOlC;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC5B,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE;QAAE,EAAE,CAAC,E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pB,kBAAkB,CAOpB;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/abi-coder.js.map b/lib.esm/abi/abi-coder.js.map index d79f4b139..2fb988ea7 100644 --- a/lib.esm/abi/abi-coder.js.map +++ b/lib.esm/abi/abi-coder.js.map @@ -1 +1 @@ -{"version":3,"file":"abi-coder.js","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAS,MAAM,EAAU,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AASjE,mEAAmE;AACnE,MAAM,YAAY,GAAwB,IAAI,GAAG,EAAE,CAAC;AACpD,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AACxC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;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,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC1C,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe;QACrB,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;YAC1B,YAAY,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC/B,CAAC;QACD,OAAO,YAAY,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC7B,MAA2B,EAC3B,EAA+D,EAC/D,IAAsB;QAEtB,OAAO,uBAAuB,CAC7B,MAAM,EACN,EAAE,EACF,IAAI,EACJ,QAAQ,CAAC,eAAe,EAAE,CAC1B,CAAC;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/bytes32.js.map b/lib.esm/abi/bytes32.js.map index e7c66bfee..2cfdd0378 100644 --- a/lib.esm/abi/bytes32.js.map +++ b/lib.esm/abi/bytes32.js.map @@ -1 +1 @@ -{"version":3,"file":"bytes32.js","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,YAAY,GACb,MAAM,mBAAmB,CAAC;AAI3B;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,gBAAgB;IAChB,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAEhC,0CAA0C;IAC1C,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAC9D;IAED,wCAAwC;IACxC,OAAO,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CA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AI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAChE,CAAC;IAED,4BAA4B;IAC5B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,EAAE,CAAC;IACV,CAAC;IAED,6BAA6B;IAC7B,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi/coders/abstract-coder.d.ts.map b/lib.esm/abi/coders/abstract-coder.d.ts.map index 3141c016e..df211a063 100644 --- a/lib.esm/abi/coders/abstract-coder.d.ts.map +++ b/lib.esm/abi/coders/abstract-coder.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AAiBnC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAGpC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE1B;;OAEG;gBACS,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAkG/B;;;;;OAKG;IACH,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC;IAWrB;;;;;OAKG;IACH,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAuB/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a 100644 --- a/lib.esm/abi/coders/abstract-coder.js.map +++ b/lib.esm/abi/coders/abstract-coder.js.map @@ -1 +1 @@ -{"version":3,"file":"abstract-coder.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,cAAc,GACf,MAAM,sBAAsB,CAAC;AAI9B;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAW,EAAE,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;AAEzC,qEAAqE;AACrE,iEAAiE;AACjE,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;AAEhC,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,UAAU,CAAC,IAAY,EAAE,KAAY;IAC5C,MAAM,OAAO,GAAG,IAAI,KAAK,CACvB,0DAA0D,IAAI,EAAE,CACjE,CAAC;IACI,OAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,MAAM,OAAO,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,OAAO,MAAO,SAAQ,KAAU;IAC3B,MAAM,CAA+B;IAI9C;;OAEG;IACH,YAAY,GAAG,IAAgB;QAC7B,oDAAoD;QACpD,uDAAuD;QACvD,wDAAwD;QACxD,uDAAuD;QACvD,kDAAkD;QAElD,2EAA2E;QAC3E,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,KAAK,GAAe,IAAI,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,KAAK,GAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QAE1D,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,IAAI,KAAK,KAAK,MAAM,E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SAAS;QACP,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5C,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"abstract-coder.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,cAAc,GACd,MAAM,sBAAsB,CAAC;AAI9B;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAW,EAAE,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;AAEzC,qEAAqE;AACrE,iEAAiE;AACjE,MAAM,cAAc,GAAG,CAAC,MAAM,CAAC,CAAC;AAEhC,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,UAAU,CAAC,IAAY,EAAE,KAAY;IAC7C,MAAM,OAAO,GAAG,IAAI,KAAK,CACxB,0DAA0D,IAAI,EAAE,CAChE,CAAC;IACI,OAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,MAAM,OAAO,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,OAAO,MAAO,SAAQ,KAAU;IAC5B,MAAM,CAA+B;IAI9C;;OAEG;IACH,YAAY,GAAG,IAAgB;QAC9B,oDAAoD;QACpD,uDAAuD;QACvD,wDAAwD;QACxD,uDAAuD;QACvD,kDAAkD;QAElD,2EAA2E;QAC3E,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,KAAK,GAAe,IAAI,CAAC,CAAC,CAAC,CAAC;QAChC,IAAI,KAAK,GAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QAE1D,IAAI,IAAI,GAAG,IAAI,CAAC;QAChB,I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C,UAAU,CAAC,CAAC;IAC7E,CAAC;IAED,aAAa;IACb,SAAS,CAAC,MAAc,EAAE,KAAe;QACxC,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;QAC7B,oDAAoD;QACpD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,wBAAwB;IACxB,SAAS;QACR,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,CAAC;IAED,SAAS;QACR,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/address.d.ts.map b/lib.esm/abi/coders/address.d.ts.map index 89cabff49..030f77d6d 100644 --- a/lib.esm/abi/coders/address.d.ts.map +++ b/lib.esm/abi/coders/address.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAUtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAQrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/address.js.map b/lib.esm/abi/coders/address.js.map index 5fe22a1b1..7ce15954a 100644 --- a/lib.esm/abi/coders/address.js.map +++ b/lib.esm/abi/coders/address.js.map @@ -1 +1 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,SAAiB;QAC3B,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,YAAY;QACV,OAAO,4CAA4C,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QAC3C,IAAI,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI;YACF,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;SAC3B;QAAC,OAAO,KAAU,EAAE;YACnB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAChD;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACrD,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAiB;QAC5B,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,YAAY;QACX,OAAO,4CAA4C,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QAC5C,IAAI,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI,CAAC;YACJ,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACpD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/anonymous.d.ts.map b/lib.esm/abi/coders/anonymous.d.ts.map index 75c762afb..d0f9d87cb 100644 --- a/lib.esm/abi/coders/anonymous.d.ts.map +++ b/lib.esm/abi/coders/anonymous.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,OAAO,CAAC,KAAK,CAAQ;gBAET,KAAK,EAAE,KAAK;IAKxB,YAAY,IAAI,GAAG;IAInB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAI1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACxC,OAAO,CAAC,KAAK,CAAQ;IAErB,YAAY,KAAK,EAAE,KAAK,EAGvB;IAED,YAAY,IAAI,GAAG,CAElB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAEzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/anonymous.js.map b/lib.esm/abi/coders/anonymous.js.map index a1c36e195..d4b1c86e4 100644 --- a/lib.esm/abi/coders/anonymous.js.map +++ b/lib.esm/abi/coders/anonymous.js.map @@ -1 +1 @@ -{"version":3,"file":"anonymous.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAC/B,KAAK,CAAQ;IAErB,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC/B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"anonymous.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAChC,KAAK,CAAQ;IAErB,YAAY,KAAY;QACvB,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED,YAAY;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/array.d.ts.map b/lib.esm/abi/coders/array.d.ts.map index 9875b8e9e..8cdb33a3b 100644 --- a/lib.esm/abi/coders/array.d.ts.map +++ b/lib.esm/abi/coders/array.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAC5B,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC3C,MAAM,CAuER;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAmD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,MAA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C,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM,CA0BzD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CA2B1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/array.js.map b/lib.esm/abi/coders/array.js.map index 9879b08ce..ed25ac117 100644 --- a/lib.esm/abi/coders/array.js.map +++ b/lib.esm/abi/coders/array.js.map @@ -1 +1 @@ -{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIhD;;GAEG;AACH,MAAM,UAAU,IAAI,CAClB,MAAc,EACd,MAA4B,EAC5B,MAA4C;IAE5C,IAAI,WAAW,GAAe,EAAE,CAAC;IAEjC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,WAAW,GAAG,MAAM,CAAC;KACtB;SAAM,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QAC/C,IAAI,MAAM,GAAgC,EAAE,CAAC;QAE7C,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACjC,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC;YAC7B,MAAM,CACJ,IAAI,EACJ,uDAAuD,EACvD,kBAAkB,EAClB,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CACvD,CAAC;YAEF,MAAM,CACJ,CAAC,MAAM,CAAC,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AM,CAAC;QACxB,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;YAChB,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;YAE3B,sDAAsD;YACtD,wDAAwD;YACxD,yDAAyD;YACzD,sDAAsD;YACtD,4DAA4D;YAC5D,MAAM,CACJ,KAAK,GAAG,QAAQ,IAAI,MAAM,CAAC,UAAU,EACrC,0BAA0B,EAC1B,gBAAgB,EAChB;gBACE,MAAM,EAAE,MAAM,CAAC,KAAK;gBACpB,MAAM,EAAE,KAAK,GAAG,QAAQ;gBACxB,MAAM,EAAE,MAAM,CAAC,UAAU;aAC1B,CACF,CAAC;SACH;QACD,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;YAC9B,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAC7C;QAED,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIhD;;GAEG;AACH,MAAM,UAAU,IAAI,CACnB,MAAc,EACd,MAA4B,EAC5B,MAA4C;IAE5C,IAAI,WAAW,GAAe,EAAE,CAAC;IAEjC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC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,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/boolean.d.ts.map b/lib.esm/abi/coders/boolean.d.ts.map index 8f22ce499..f0c2679a1 100644 --- a/lib.esm/abi/coders/boolean.d.ts.map +++ b/lib.esm/abi/coders/boolean.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,OAAO;IAIvB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM;IAKvD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,OAAO,CAEtB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAGtD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/boolean.js.map b/lib.esm/abi/coders/boolean.js.map index b3b412254..3ad4fa201 100644 --- a/lib.esm/abi/coders/boolean.js.map +++ b/lib.esm/abi/coders/boolean.js.map @@ -1 +1 @@ -{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACrC,YAAY,SAAiB;QAC3B,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,YAAY;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAuB;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAC9B,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAiB;QAC5B,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,YAAY;QACX,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAuB;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAC7B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/bytes.d.ts.map b/lib.esm/abi/coders/bytes.d.ts.map index d765084b7..956098f28 100644 --- a/lib.esm/abi/coders/bytes.d.ts.map +++ b/lib.esm/abi/coders/bytes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAI3C,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;gBACnC,SAAS,EAAE,MAAM;IAI7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAE1C;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;IAChD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/bytes.js.map b/lib.esm/abi/coders/bytes.js.map index ba865bb25..9c2be3ef4 100644 --- a/lib.esm/abi/coders/bytes.js.map +++ b/lib.esm/abi/coders/bytes.js.map @@ -1 +1 @@ -{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,IAAY,EAAE,SAAiB;QACzC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC/B,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAC5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C,MAAc;QACpB,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAChD,YAAY,SAAiB;QAC5B,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACtC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/fixed-bytes.d.ts.map b/lib.esm/abi/coders/fixed-bytes.d.ts.map index cca02a1ac..9d870c078 100644 --- a/lib.esm/abi/coders/fixed-bytes.d.ts.map +++ b/lib.esm/abi/coders/fixed-bytes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAM3C,YAAY,IAAI,MAAM;IAOtB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM;IAQzD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAI1C;IAED,YAAY,IAAI,MAAM,CAKrB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/fixed-bytes.js.map b/lib.esm/abi/coders/fixed-bytes.js.map index b0b8e537d..a3f40c20c 100644 --- a/lib.esm/abi/coders/fixed-bytes.js.map +++ b/lib.esm/abi/coders/fixed-bytes.js.map @@ -1 +1 @@ -{"version":3,"file":"fixed-bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAM5C;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,IAAI,CAAU;IAEvB,YAAY,IAAY,EAAE,SAAiB;QACzC,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,KAAK,CAAC,IAA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AI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACpC,gBAAgB,CAAkB,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,YAAY;QACX,OAAO,oEAAoE,CAAC,SAAS,CACpF,CAAC,EACD,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CACjB,CAAC;IACH,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAyB;QAC/C,IAAI,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/null.d.ts.map b/lib.esm/abi/coders/null.d.ts.map index 5b43f1d78..e2ef8ebc5 100644 --- a/lib.esm/abi/coders/null.d.ts.map +++ b/lib.esm/abi/coders/null.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,IAAI;IAIpB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAI5B"} \ No newline at end of file +{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACnC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,IAAI,CAEnB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAG1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/null.js.map b/lib.esm/abi/coders/null.js.map index cb4ab0c33..b35177549 100644 --- a/lib.esm/abi/coders/null.js.map +++ b/lib.esm/abi/coders/null.js.map @@ -1 +1 @@ -{"version":3,"file":"null.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,YAAY,SAAiB;QAC3B,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAC/B,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;SACrC;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"null.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IACnC,YAAY,SAAiB;QAC5B,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,YAAY;QACX,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAChC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/number.d.ts.map b/lib.esm/abi/coders/number.d.ts.map index b9ef16d8a..5af9a7edb 100644 --- a/lib.esm/abi/coders/number.d.ts.map +++ b/lib.esm/abi/coders/number.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAY,MAA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} \ No newline at end of file diff --git a/lib.esm/abi/coders/number.js.map b/lib.esm/abi/coders/number.js.map index 99df3d6e2..7a1d8539f 100644 --- a/lib.esm/abi/coders/number.js.map +++ b/lib.esm/abi/coders/number.js.map @@ -1 +1 @@ -{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,MAAM,GACP,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAMtD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,cAAc,GAAG,MAAM,CAC3B,oEAAoE,CACrE,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,IAAI,CAAU;IACd,MAAM,CAAW;IAE1B,YAAY,IAAY,EAAE,MAAe,EAAE,SAAiB;QAC1D,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QAClD,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAEpC,gBAAgB,CACd,IAAI,EACJ,EAAE,IAAI,EAAE,MAAM,EAAE,EAChB,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CACtC,CAAC;IACJ,CAAC;IAED,YAAY;QACV,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAA4B;QACjD,IAAI,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAE5D,qCAAqC;QACrC,IAAI,YAAY,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC;QACtD,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YACnD,IAAI,KAAK,GAAG,MAAM,IAAI,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE;gBAC9C,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;aACjD;YACD,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC;SACrC;aAAM,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE;YACpE,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;SACjD;QAED,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAEpD,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;SACxC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,MAAM,GACN,MAAM,sBAAsB,CAAC;AAE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AC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;gBAChD,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;YACjD,CAAC;YACD,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC;QACrC,CAAC;aAAM,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC;YACtE,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;QACjD,CAAC;QAED,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAEpD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,KAAK,CAAC;IACd,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/string.d.ts.map b/lib.esm/abi/coders/string.d.ts.map index 38618a702..d0158dd8b 100644 --- a/lib.esm/abi/coders/string.d.ts.map +++ b/lib.esm/abi/coders/string.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;gBACpC,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAOtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IACjD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAKrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/string.js.map b/lib.esm/abi/coders/string.js.map index 2ffbcff34..6552cd138 100644 --- a/lib.esm/abi/coders/string.js.map +++ b/lib.esm/abi/coders/string.js.map @@ -1 +1 @@ -{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAChD,YAAY,SAAiB;QAC3B,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC7B,CAAC;IAED,YAAY;QACV,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QAC3C,OAAO,KAAK,CAAC,MAAM,CACjB,MAAM,EACN,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CACjD,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,OAAO,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IACjD,YAAY,SAAiB;QAC5B,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,YAAY;QACX,OAAO,EAAE,CAAC;IACX,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QAC5C,OAAO,KAAK,CAAC,MAAM,CAClB,MAAM,EACN,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAChD,CAAC;IACH,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/tuple.d.ts.map b/lib.esm/abi/coders/tuple.d.ts.map index de1068222..bc66dc09e 100644 --- a/lib.esm/abi/coders/tuple.d.ts.map +++ b/lib.esm/abi/coders/tuple.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;gBAE3B,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM;IAiBnD,YAAY,IAAI,GAAG;IA0CnB,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,KAAK,GACnD,MAAM;IAKT,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAEvC,YAAY,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,EAelD;IAED,YAAY,IAAI,GAAG,CAwClB;IAED,MAAM,CACL,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,KAAK,GAClD,MAAM,CAGR;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/tuple.js.map b/lib.esm/abi/coders/tuple.js.map index f5cc76c99..7a99b4816 100644 --- a/lib.esm/abi/coders/tuple.js.map +++ b/lib.esm/abi/coders/tuple.js.map @@ -1 +1 @@ -{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAI1C;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC1B,MAAM,CAAwB;IAEvC,YAAY,MAAoB,EAAE,SAAiB;QACjD,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,KAAK,GAAkB,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,IAAI,KAAK,CAAC,OAAO,EAAE;gBACjB,OAAO,GAAG,IAAI,CAAC;aAChB;YACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QAE9C,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACzC,gBAAgB,CAAa,IAAI,EAAE;YACjC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;SACtC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AAoD;QAEpD,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/fragments.d.ts.map b/lib.esm/abi/fragments.d.ts.map index c3f678ffe..b1a1124b4 100644 --- a/lib.esm/abi/fragments.d.ts.map +++ b/lib.esm/abi/fragments.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QA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,MAAM,EAC3D,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAChC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,EACjC,MAAM,EAAE,IAAI,GAAG,MAAM,EAcrB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CA2ClC;IAED,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAW5D;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB,CA6DtC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAChD;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAGrE;IAED,MAAM,IAAI,MAAM,CAEf;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,CAepC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/fragments.js.map b/lib.esm/abi/fragments.js.map index c2305b912..3a3e5a43c 100644 --- a/lib.esm/abi/fragments.js.map +++ b/lib.esm/abi/fragments.js.map @@ -1 +1 @@ -{"version":3,"file":"fragments.js","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,MAAM,EACN,aAAa,EACb,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,EAAE,EAAE,MAAM,k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m/abi/index.d.ts.map index 4eb1a4ab8..a3a6ec0b1 100644 --- a/lib.esm/abi/index.d.ts.map +++ b/lib.esm/abi/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACP,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi/index.js.map b/lib.esm/abi/index.js.map index 906989cb2..959af7db5 100644 --- a/lib.esm/abi/index.js.map +++ b/lib.esm/abi/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM;AACN,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACP,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM;AACN,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi/interface.d.ts.map b/lib.esm/abi/interface.d.ts.map index 763cd7ac3..d7d096cce 100644 --- a/lib.esm/abi/interface.d.ts.map +++ b/lib.esm/abi/interface.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;AAErC,qBAAa,cAAc;IACzB,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;g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E,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,CA8CzC;IAGD,cAAc,CACb,QAAQ,EAAE,aAAa,GAAG,MAAM,EAChC,IAAI,EAAE,SAAS,EACf,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAC5B,MAAM,CA8ER;IAED;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,YAAY,CAAC;KACrB,GAAG,IAAI,GAAG,sBAAsB,CAYhC;IAED,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEvC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;KACb,GAAG,IAAI,GAAG,cAAc,CAgBxB;IAED;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,gBAAgB,CAWnD;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAkBtD;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/interface.js b/lib.esm/abi/interface.js index 7334605ad..68c1d2999 100644 --- a/lib.esm/abi/interface.js +++ b/lib.esm/abi/interface.js @@ -565,32 +565,32 @@ export class Interface { } // Get the 4-byte selector used by Solidity to identify a function /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ + getSelector(fragment: ErrorFragment | FunctionFragment): string { + if (typeof(fragment) === "string") { + const matches: Array = [ ]; + + try { matches.push(this.getFunction(fragment)); } catch (error) { } + try { matches.push(this.getError(fragment)); } catch (_) { } + + if (matches.length === 0) { + logger.throwArgumentError("unknown fragment", "key", fragment); + } else if (matches.length > 1) { + logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); + } + + fragment = matches[0]; + } + + return dataSlice(id(fragment.format()), 0, 4); + } + */ // Get the 32-byte topic hash used by Solidity to identify an event /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ + getEventTopic(fragment: EventFragment): string { + //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } + return id(fragment.format()); + } + */ _decodeParams(params, data) { return this.#abiCoder.decode(params, data); } @@ -757,34 +757,34 @@ export class Interface { return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); } /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ + spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { + const promises: Array> = [ ]; + const process = function(type: ParamType, value: any): any { + if (type.baseType === "array") { + return descend(type.child + } + if (type. === "address") { + } + }; + + const descend = function (inputs: Array, values: ReadonlyArray) { + if (inputs.length !== values.length) { throw new Error("length mismatch"); } + }; + + const result: Array = [ ]; + values.forEach((value, index) => { + if (value == null) { + topics.push(null); + } else if (param.baseType === "array" || param.baseType === "tuple") { + logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); + } else if (Array.isArray(value)) { + topics.push(value.map((value) => encodeTopic(param, value))); + } else { + topics.push(encodeTopic(param, value)); + } + }); + } +*/ // Create the filter for the event with search criteria (e.g. for xcb_filterLog) encodeFilterTopics(fragment, values) { if (typeof fragment === "string") { diff --git a/lib.esm/abi/interface.js.map b/lib.esm/abi/interface.js.map index 44978446b..9b7c7cecb 100644 --- a/lib.esm/abi/interface.js.map +++ b/lib.esm/abi/interface.js.map @@ -1 +1 @@ -{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EACL,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,MAAM,GACP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EAEb,QAAQ,EACR,gBAAgB,EAChB,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAUnC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;AAErC,MAAM,OAAO,cAAc;IAChB,QAAQ,CAAiB;IACzB,IAAI,CAAU;IACd,SAAS,CAAU;IACnB,KAAK,CAAU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,CAAC;IAC9B,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EACN,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,MAAM,GACN,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EAEb,QAAQ,EACR,gBAAgB,EAChB,SAAS,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAUnC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;AAErC,MAAM,OAAO,cAAc;IACjB,QAAQ,CAAiB;IACzB,IAAI,CAAU;IACd,SAAS,CAAU;IACnB,KAAK,CAAU;IACf,IAAI,CAAU;IAEvB,YAAY,QAAuB,EAAE,KAAa,EAAE,IAAY;QAC/D,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EACzB,SAAS,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC/B,gBAAgB,CAAiB,IAAI,EAAE;YACtC,QAAQ;YACR,IAAI;YACJ,SAAS;YACT,KAAK;YACL,IAAI;SACJ,CAAC,CAAC;IACJ,CAAC;CACD;AAED,MAAM,OAAO,sBAAsB;IACzB,QAAQ,CAAoB;IAC5B,IAAI,CAAU;IACd,IAAI,CAAU;IACd,SAAS,CAAU;IACnB,QAAQ,CAAU;IAClB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E,GAAG,GAAG,KAAK,IAAI,KAAK,CAEzC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAQvD;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/typed.js.map b/lib.esm/abi/typed.js.map index d12f2b336..0c2c61aa4 100644 --- a/lib.esm/abi/typed.js.map +++ b/lib.esm/abi/typed.js.map @@ -1 +1 @@ -{"version":3,"file":"typed.js","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOpE,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,CAAC,CAAC,KAAmB,EAAE,KAAa;IAC3C,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,CAAC,EAAE;QACb,MAAM,GAAG,IAAI,CAAC;QACd,KAAK,IAAI,CAAC,CAAC,CAAC;KACb;IAED,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,EAAE,EAAE,KAAK,EAAE;QACjE,MAAM;QACN,KAAK;KACN,CAAC,CAAC;AACL,CAAC;AAED,SAAS,CAAC,CAAC,KAAgB,EAAE,IAAa;IACxC,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACxE,CAAC;AA0BD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAEjD,MAAM,OAAO,KAAK;IACP,IAAI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S,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACtE,CAAC;YACD,OAAO,KAAK,CAAC,KAAK,CAAC;QACpB,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/address/checks.js.map b/lib.esm/address/checks.js.map index 4a4a16b57..68fb59ffa 100644 --- a/lib.esm/address/checks.js.map +++ b/lib.esm/address/checks.js.map @@ -1 +1 @@ -{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAA4B,UAAU,EAAE,MAAM,YAAY,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,KAAU;IACtC,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,CAAC;AACzD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAU;IAClC,IAAI;QACF,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,KAAK,EAAE,GAAE;IAClB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,KAAK,UAAU,YAAY,CACzB,MAAW,EACX,OAA+B;IAE/B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;IAC7B,IACE,MAAM,IAAI,IAAI;QACd,MAAM,KAAK,4CAA4C,EACvD;QACA,MAAM,CACJ,OAAO,MAAM,KAAK,QAAQ,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;QACF,cAAc,CACZ,KAAK,EACL,+DAA+D,EAC/D,QAAQ,EACR,MAAM,CACP,CAAC;KACH;IACD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;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AAI;QACd,MAAM,KAAK,4CAA4C,EACtD,CAAC;QACF,MAAM,CACL,OAAO,MAAM,KAAK,QAAQ,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,EAAE,KAAK,EAAE,MAAM,EAAE,CACjB,CAAC;QACF,cAAc,CACb,KAAK,EACL,+DAA+D,EAC/D,QAAQ,EACR,MAAM,CACN,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,cAAc,CAAC,MAAmB;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;QAE1B,iEAAiE;QACjE,8DAA8D;QAE9D,6DAA6D;IAC9D,CAAC;SAAM,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAClD,CAAC;SAAM,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACxD,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAED,cAAc,CAAC,KAAK,EAAE,+BAA+B,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/lib.esm/address/contract-address.d.ts.map b/lib.esm/address/contract-address.d.ts.map index 8511ac269..c9b527dd2 100644 --- a/lib.esm/address/contract-address.d.ts.map +++ b/lib.esm/address/contract-address.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACrB,GAAG,MAAM,CAcT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,SAAS,GACtB,MAAM,CAoBR"} \ No newline at end of file +{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,GAAG,MAAM,CAcT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,SAAS,GACrB,MAAM,CAoBR"} \ No newline at end of file diff --git a/lib.esm/address/contract-address.js.map b/lib.esm/address/contract-address.js.map index ff61592a9..80e46e0ba 100644 --- a/lib.esm/address/contract-address.js.map +++ b/lib.esm/address/contract-address.js.map @@ -1 +1 @@ -{"version":3,"file":"contract-address.js","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM;AACN,cAAc;AACd,SAAS;AACT,eAAe;EAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;A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,CAAC,CAAC,EAC9D,EAAE,CACH,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,uCAAuC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;AACzD,CAAC"} \ No newline at end of file +{"version":3,"file":"contract-address.js","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM;AACN,cAAc;AACd,SAAS;AACT,eAAe;EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGxC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAEpD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAGhC;IACA,MAAM,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,KAAK,GAAG,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAE9C,IAAI,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,QAAQ,KAAK,GAAG,EAAE,CAAC;QACt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ib.esm/address/index.d.ts.map +++ b/lib.esm/address/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;CAQ5B;AAED,OAAO,EAAa,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA8BpE,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBpE;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoB3C;AACD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACrB,UAmBA;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;CAQ5B;AAED,OAAO,EAAa,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA8BpE,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBpE;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoB3C;AACD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,UAmBA;AAED,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GAClB,CAAC"} \ No newline at end of file diff --git a/lib.esm/address/index.js.map b/lib.esm/address/index.js.map index efd08d3dc..39ad12a5c 100644 --- a/lib.esm/address/index.js.map +++ b/lib.esm/address/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,IAAI,CAAC;AAmCL,OAAO,EAAE,SAAS,EAAgB,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,QAAQ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E;QAC3C,OAAO,IAAI,CAAC;KACb;SAAM;QACL,MAAM,CAAC,kBAAkB,CAAC,eAAe,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QACnE,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,WAG3B;IACC,IAAI,IAAI,GAAQ,IAAI,CAAC;IACrB,IAAI;QACF,IAAI,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;KACrC;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,CAAC,kBAAkB,CACvB,sBAAsB,EACtB,aAAa,EACb,WAAW,CACZ,CAAC;KACH;IAED,MAAM,KAAK,GAAG,UAAU,CACtB,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAC1D,CAAC;IACF,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;AACzD,CAAC;AAED,OAAO,EACL,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GACnB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,IAAI,CAAC;AAmCL,OAAO,EAAE,SAAS,EAAgB,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,M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EACjB,iBAAiB,EACjB,kBAAkB,GAClB,CAAC"} \ No newline at end of file diff --git a/lib.esm/bigNumber/bigNumber.d.ts.map b/lib.esm/bigNumber/bigNumber.d.ts.map index d71c9db78..5dcf4c8f7 100644 --- a/lib.esm/bigNumber/bigNumber.d.ts.map +++ b/lib.esm/bigNumber/bigNumber.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"bigNumber.d.ts","sourceRoot":"","sources":["../../src.ts/bigNumber/bigNumber.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,EACL,OAAO,EAIR,MAAM,kBAAkB,CAAC;AAS1B,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAExE,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,YAAY,CAUhE;AAKD,qBAAa,SAAU,YAAW,OAAO;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;gBAEnB,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM;IAmB9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIlC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIhC,GAAG,IAAI,SAAS;IAOhB,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAInC,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAInC,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAQnC,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAInC,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAQnC,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAQnC,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAQnC,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAQl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AAG,OAAO,CAEhC;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,MAAM,IAAI,OAAO,CAEhB;IAED,QAAQ,IAAI,MAAM,CAQjB;IAED,QAAQ,IAAI,MAAM,CAYjB;IAED,QAAQ,IAAI,MAAM,CAyBjB;IAED,WAAW,IAAI,MAAM,CAEpB;IAED,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAExB;IAED,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAuEjC;IAED,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAEjD;CACD;AA6ED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"} \ No newline at end of file diff --git a/lib.esm/bigNumber/bigNumber.js.map b/lib.esm/bigNumber/bigNumber.js.map index d8e318d8c..5ceba96a6 100644 --- a/lib.esm/bigNumber/bigNumber.js.map +++ b/lib.esm/bigNumber/bigNumber.js.map @@ -1 +1 @@ -{"version":3,"file":"bigNumber.js","sourceRoot":"","sources":["../../src.ts/bigNumber/bigNumber.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;GAMG;AAEH,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAGL,OAAO,EACP,OAAO,EACP,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAC1B,IAAO,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;AAEnB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAE7C,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AAIlC,MAAM,UAAU,cAAc,CAAC,KAAU;IACvC,OAAO,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,CAAC,CAAC;AACrC,CAAC;AACD,aAAa;AACb,SAAS,IAAI,CAAC,KAAmB;IAChC,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IAChD,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACpB,OAAO,IAAI,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,IAAI,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,UAAU,CAAC,KAAa,EAAE,SAAiB,EAAE,KAAW;IAChE,MAAM,MAAM,GAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IAC3D,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACtE,CAAC;AAED,8BAA8B;AAC9B,MAAM,UAAU,WAAW,CAAC,KAAa;IACxC,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC;AAED,8BAA8B;AAC9B,MAAM,UAAU,WAAW,CAAC,KAAa;IACxC,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/lib.esm/cip/custom-units.d.ts b/lib.esm/cip/custom-units.d.ts new file mode 100644 index 000000000..58031982f --- /dev/null +++ b/lib.esm/cip/custom-units.d.ts @@ -0,0 +1,33 @@ +import type { AddressLike } from "../address/index.js"; +import { Contract } from "../contract/index.js"; +import type { BlockTag, ContractRunner } from "../providers/index.js"; +export declare const customUnitAbi: readonly string[]; +export declare class CustomUnitDiscovery { + readonly preferredUnit: string; + readonly supportedUnits: readonly string[]; + constructor(units: readonly string[], preferredUnit: string); + get isValid(): boolean; + supports(unit: string): boolean; +} +/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ +export declare class CustomUnitBalance { + readonly canonicalAmount: bigint; + readonly unitAmount: bigint; + readonly unit: string; + constructor(canonicalAmount: bigint, unitAmount: bigint, unit: string); + get multiplierNumerator(): bigint; + get multiplierDenominator(): bigint; +} +/** Core custom-unit contract convention used by Tone and Core API. */ +export declare class CustomUnitToken { + readonly contract: Contract; + constructor(address: string, runner: ContractRunner); + supportsUnit(unit: string, blockTag?: BlockTag): Promise; + supportedUnits(blockTag?: BlockTag): Promise; + preferredUnit(blockTag?: BlockTag): Promise; + discover(blockTag?: BlockTag): Promise; + canonicalBalance(account: AddressLike, blockTag?: BlockTag): Promise; + balanceOfUnit(account: AddressLike, unit: string, blockTag?: BlockTag): Promise; + balance(account: AddressLike, unit?: string, blockTag?: BlockTag): Promise; +} +//# sourceMappingURL=custom-units.d.ts.map \ No newline at end of file diff --git a/lib.esm/cip/custom-units.d.ts.map b/lib.esm/cip/custom-units.d.ts.map new file mode 100644 index 000000000..69faaea75 --- /dev/null +++ b/lib.esm/cip/custom-units.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"custom-units.d.ts","sourceRoot":"","sources":["../../src.ts/cip/custom-units.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,eAAO,MAAM,aAAa,mBAMxB,CAAC;AACH,qBAAa,mBAAmB;IAI9B,QAAQ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,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,CAAC,CAGjB;IACK,OAAO,CACZ,OAAO,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAO5B;CACD"} \ No newline at end of file diff --git a/lib.esm/cip/custom-units.js b/lib.esm/cip/custom-units.js new file mode 100644 index 000000000..e163cfff3 --- /dev/null +++ b/lib.esm/cip/custom-units.js @@ -0,0 +1,81 @@ +import { Contract } from "../contract/index.js"; +export const customUnitAbi = Object.freeze([ + "function supportsUnit(string unit) view returns (bool)", + "function supportedUnits() view returns (string[])", + "function preferredUnit() view returns (string)", + "function balanceOf(address account) view returns (uint256)", + "function balanceOfUnit(address account, string unit) view returns (uint256)", +]); +export class CustomUnitDiscovery { + preferredUnit; + supportedUnits; + constructor(units, preferredUnit) { + this.preferredUnit = preferredUnit; + this.supportedUnits = Object.freeze([...units]); + } + get isValid() { + return (this.supports("units") && + this.preferredUnit !== "" && + this.supports(this.preferredUnit)); + } + supports(unit) { + return this.supportedUnits.includes(unit); + } +} +/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ +export class CustomUnitBalance { + canonicalAmount; + unitAmount; + unit; + constructor(canonicalAmount, unitAmount, unit) { + this.canonicalAmount = canonicalAmount; + this.unitAmount = unitAmount; + this.unit = unit; + } + get multiplierNumerator() { + return this.unitAmount; + } + get multiplierDenominator() { + return this.canonicalAmount; + } +} +/** Core custom-unit contract convention used by Tone and Core API. */ +export class CustomUnitToken { + contract; + constructor(address, runner) { + this.contract = new Contract(address, customUnitAbi, runner); + } + async supportsUnit(unit, blockTag) { + return (unit.trim() !== "" && + (await this.contract.supportsUnit(unit.trim(), { blockTag }))); + } + async supportedUnits(blockTag) { + return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag }))); + } + async preferredUnit(blockTag) { + return (await this.contract.preferredUnit({ blockTag })).trim(); + } + async discover(blockTag) { + if (!(await this.supportsUnit("units", blockTag))) + return null; + const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag)); + return discovery.isValid ? discovery : null; + } + canonicalBalance(account, blockTag) { + return this.contract.balanceOf(account, { blockTag }); + } + balanceOfUnit(account, unit, blockTag) { + if (!unit.trim()) + throw new TypeError("unit must not be empty"); + return this.contract.balanceOfUnit(account, unit.trim(), { blockTag }); + } + async balance(account, unit, blockTag) { + const resolved = unit?.trim() || (await this.preferredUnit(blockTag)); + const [canonical, calculated] = await Promise.all([ + this.canonicalBalance(account, blockTag), + this.balanceOfUnit(account, resolved, blockTag), + ]); + return new CustomUnitBalance(canonical, calculated, resolved); + } +} +//# sourceMappingURL=custom-units.js.map \ No newline at end of file diff --git a/lib.esm/cip/custom-units.js.map b/lib.esm/cip/custom-units.js.map new file mode 100644 index 000000000..3f4c37e22 --- /dev/null +++ b/lib.esm/cip/custom-units.js.map @@ -0,0 +1 @@ +{"version":3,"file":"custom-units.js","sourceRoot":"","sources":["../../src.ts/cip/custom-units.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,wDAAwD;IACxD,mDAAmD;IACnD,gDAAgD;IAChD,4DAA4D;IAC5D,6EAA6E;CAC7E,CAAC,CAAC;AACH,MAAM,OAAO,mBAAmB;IAIrB,aAAa;IAHd,cAAc,CAAoB;IAC3C,YACC,KAAwB,EACf,aAAqB;6BAArB,aAAa;QAEtB,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,OAAO;QACV,OAAO,CACN,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;YACtB,IAAI,CAAC,aAAa,KAAK,EAAE;YACzB,IAAI,CAAC,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,CAAC;SAC/C,CAAC,CAAC;QACH,OAAO,IAAI,iBAAiB,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/D,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/cip/index.d.ts b/lib.esm/cip/index.d.ts new file mode 100644 index 000000000..cdd86e31b --- /dev/null +++ b/lib.esm/cip/index.d.ts @@ -0,0 +1,49 @@ +import { Contract } from "../contract/index.js"; +import type { Overrides, ContractTransactionResponse } from "../contract/index.js"; +import type { BlockTag, ContractRunner } from "../providers/index.js"; +import { IpfsGateway } from "../ipfs/index.js"; +/** On-chain interface defined by CIP-150. */ +export declare const cip150Abi: readonly string[]; +export interface Cip150MetadataEntry { + readonly key: string; + readonly value: string; + readonly sealed?: boolean; +} +export declare const cip151TokenExpirationKey = "tokenExpiration"; +export declare const cip151TradingStopKey = "tradingStop"; +export declare const cip152LabKey = "lab"; +/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ +export declare class Cip151Lifecycle { + readonly tokenExpiration: bigint | null; + readonly tradingStop: bigint | null; + constructor(metadata?: Readonly>); + isExpiredAt(seconds: bigint): boolean; + isTradingStoppedAt(seconds: bigint): boolean; +} +export interface Cip152LabMeasurement { + readonly value: string | number; + readonly unit?: string; +} +/** Validates certificate structure, not the authenticity of its issuer. */ +export declare class Cip152LabCertificate { + readonly measurements: Readonly>; + constructor(json: unknown); +} +/** Typed metadata reader and writer. Writes require a signer as runner. */ +export declare class Cip150MetadataContract { + readonly contract: Contract; + constructor(address: string, runner: ContractRunner); + getValue(key: string, blockTag?: BlockTag): Promise; + hasKey(key: string, blockTag?: BlockTag): Promise; + isSealed(key: string, blockTag?: BlockTag): Promise; + listKeys(blockTag?: BlockTag): Promise; + getByIndex(index: bigint, blockTag?: BlockTag): Promise; + count(blockTag?: BlockTag): Promise; + readAll(blockTag?: BlockTag, includeSealedState?: boolean): Promise; + setValue(key: string, value: string, overrides?: Overrides): Promise; + sealKey(key: string, overrides?: Overrides): Promise; + readLifecycle(blockTag?: BlockTag): Promise; + readLabCertificate(gateway: IpfsGateway, blockTag?: BlockTag): Promise; +} +export { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from "./custom-units.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/cip/index.d.ts.map b/lib.esm/cip/index.d.ts.map new file mode 100644 index 000000000..d0120ee3c --- /dev/null +++ b/lib.esm/cip/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/cip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EACX,SAAS,EACT,2BAA2B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,6CAA6C;AAC7C,eAAO,MAAM,SAAS,mBASpB,CAAC;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC1B;AACD,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAC1D,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,iFAAiF;AACjF,qBAAa,eAAe;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,YAAY,QAAQ,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,EAU1D;IACD,WAAW,CAAC,OAAO,EAAE,MAAM,G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AAC,CAazC;IACD,QAAQ,CACP,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,SAAc,GACvB,OAAO,CAAC,2BAA2B,CAAC,CAEtC;IACD,OAAO,CACN,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,SAAc,GACvB,OAAO,CAAC,2BAA2B,CAAC,CAEtC;IACK,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAOjE;IACK,kBAAkB,CACvB,OAAO,EAAE,WAAW,EACpB,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAMtC;CACD;AACD,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACb,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/lib.esm/cip/index.js b/lib.esm/cip/index.js new file mode 100644 index 000000000..d597ed10a --- /dev/null +++ b/lib.esm/cip/index.js @@ -0,0 +1,124 @@ +import { Contract } from "../contract/index.js"; +/** On-chain interface defined by CIP-150. */ +export const cip150Abi = Object.freeze([ + "function getMetadataValue(string key) view returns (string value)", + "function hasMetadataKey(string key) view returns (bool exists)", + "function isMetadataSealed(string key) view returns (bool sealed)", + "function listMetadataKeys() view returns (string[] keys)", + "function getMetadataByIndex(uint256 index) view returns (string key, string value)", + "function metadataCount() view returns (uint256 total)", + "function setMetadataValue(string key, string value)", + "function sealMetadataKey(string key)", +]); +export const cip151TokenExpirationKey = "tokenExpiration"; +export const cip151TradingStopKey = "tradingStop"; +export const cip152LabKey = "lab"; +/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ +export class Cip151Lifecycle { + tokenExpiration; + tradingStop; + constructor(metadata = {}) { + const parse = (key) => { + const value = metadata[key]; + if (value == null || value === "") + return null; + if (!/^\d+$/.test(value)) + throw new TypeError(`${key} must be a non-negative Unix timestamp`); + return BigInt(value); + }; + this.tokenExpiration = parse(cip151TokenExpirationKey); + this.tradingStop = parse(cip151TradingStopKey); + } + isExpiredAt(seconds) { + return this.tokenExpiration !== null && seconds >= this.tokenExpiration; + } + isTradingStoppedAt(seconds) { + return this.tradingStop !== null && seconds >= this.tradingStop; + } +} +/** Validates certificate structure, not the authenticity of its issuer. */ +export class Cip152LabCertificate { + measurements; + constructor(json) { + if (json === null || typeof json !== "object" || Array.isArray(json)) + throw new TypeError("CIP-152 lab.json must be an object"); + const measurements = Object.create(null); + for (const [key, property] of Object.entries(json)) { + if (!property || + typeof property !== "object" || + Array.isArray(property) || + !Object.hasOwn(property, "value")) + throw new TypeError(`CIP-152 property ${key} must contain a value`); + const { value, unit } = property; + if (!(typeof value === "string" || + (typeof value === "number" && Number.isFinite(value)))) + throw new TypeError(`CIP-152 property ${key} has an invalid value`); + if (unit != null && typeof unit !== "string") + throw new TypeError(`CIP-152 property ${key} has an invalid unit`); + measurements[key] = Object.freeze(unit == null ? { value } : { value, unit }); + } + this.measurements = Object.freeze(measurements); + } +} +/** Typed metadata reader and writer. Writes require a signer as runner. */ +export class Cip150MetadataContract { + contract; + constructor(address, runner) { + this.contract = new Contract(address, cip150Abi, runner); + } + getValue(key, blockTag) { + return this.contract.getMetadataValue(key, { blockTag }); + } + hasKey(key, blockTag) { + return this.contract.hasMetadataKey(key, { blockTag }); + } + isSealed(key, blockTag) { + return this.contract.isMetadataSealed(key, { blockTag }); + } + async listKeys(blockTag) { + return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag }))); + } + async getByIndex(index, blockTag) { + const [key, value] = await this.contract.getMetadataByIndex(index, { + blockTag, + }); + return Object.freeze({ key, value }); + } + count(blockTag) { + return this.contract.metadataCount({ blockTag }); + } + async readAll(blockTag, includeSealedState = true) { + const entries = []; + for (const key of await this.listKeys(blockTag)) { + const value = await this.getValue(key, blockTag); + entries.push(Object.freeze(includeSealedState + ? { key, value, sealed: await this.isSealed(key, blockTag) } + : { key, value })); + } + return Object.freeze(entries); + } + setValue(key, value, overrides = {}) { + return this.contract.setMetadataValue(key, value, overrides); + } + sealKey(key, overrides = {}) { + return this.contract.sealMetadataKey(key, overrides); + } + async readLifecycle(blockTag) { + const metadata = {}; + for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) { + if (await this.hasKey(key, blockTag)) + metadata[key] = await this.getValue(key, blockTag); + } + return new Cip151Lifecycle(metadata); + } + async readLabCertificate(gateway, blockTag) { + if (!(await this.hasKey(cip152LabKey, blockTag))) + return null; + const reference = await this.getValue(cip152LabKey, blockTag); + if (!gateway.resolve(reference).pathname.endsWith("/lab.json")) + throw new TypeError("CIP-152 reference must point to lab.json"); + return new Cip152LabCertificate(await gateway.readJson(reference)); + } +} +export { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from "./custom-units.js"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/cip/index.js.map b/lib.esm/cip/index.js.map new file mode 100644 index 000000000..524f8bba1 --- /dev/null +++ b/lib.esm/cip/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/cip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAQhD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,mEAAmE;IACnE,gEAAgE;IAChE,kEAAkE;IAClE,0DAA0D;IAC1D,oFAAoF;IACpF,uDAAuD;IACvD,qDAAqD;IACrD,sCAAsC;CACtC,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAElC,iFAAiF;AACjF,MAAM,OAAO,eAAe;IAClB,eAAe,CAAgB;IAC/B,WAAW,CAAgB;IACpC,YAAY,QAAQ,GAAqC,EA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AC7D,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;QACjE,OAAO,IAAI,oBAAoB,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;CACD;AACD,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACb,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/hashes.d.ts.map b/lib.esm/constants/hashes.d.ts.map index ef1df7d58..225420a8c 100644 --- a/lib.esm/constants/hashes.d.ts.map +++ b/lib.esm/constants/hashes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAC+C,CAAC"} \ No newline at end of file +{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAC8C,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/hashes.js.map b/lib.esm/constants/hashes.js.map index bfb490d60..97cb925f5 100644 --- a/lib.esm/constants/hashes.js.map +++ b/lib.esm/constants/hashes.js.map @@ -1 +1 @@ -{"version":3,"file":"hashes.js","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GACnB,oEAAoE,CAAC"} \ No newline at end of file +{"version":3,"file":"hashes.js","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GACpB,oEAAoE,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/index.d.ts.map b/lib.esm/constants/index.d.ts.map index 0c26e029d..d703c7245 100644 --- a/lib.esm/constants/index.d.ts.map +++ b/lib.esm/constants/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/index.js.map b/lib.esm/constants/index.js.map index 054324d76..c114a0d0a 100644 --- a/lib.esm/constants/index.js.map +++ b/lib.esm/constants/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/numbers.d.ts.map b/lib.esm/constants/numbers.d.ts.map index 7e7f487f7..927678af4 100644 --- a/lib.esm/constants/numbers.d.ts.map +++ b/lib.esm/constants/numbers.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAEf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEZ,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAiC,CAAC;AAC5D,eAAO,MAAM,IAAI,EAAE,MAAgC,CAAC;AACpD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC;AACnD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC"} \ No newline at end of file +{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAEf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEb,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAiC,CAAC;AAC5D,eAAO,MAAM,IAAI,EAAE,MAAgC,CAAC;AACpD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC;AACnD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/numbers.js.map b/lib.esm/constants/numbers.js.map index 3f13321b5..993fb0f41 100644 --- a/lib.esm/constants/numbers.js.map +++ b/lib.esm/constants/numbers.js.map @@ -1 +1 @@ -{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,CAAC,GAAW,MAAM,CAC7B,oEAAoE,CACrE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAW,MAAM,CACtC,oEAAoE,CACrE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GACpB,MAAM,CAAC,oEAAoE,CAAC;IAC5E,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEb;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,MAAM,CACrC,oEAAoE,CACrE,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,IAAI,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACpD,MAAM,CAAC,MAAM,GAAG,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,GAAG,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,CAAC,GAAW,MAAM,CAC9B,oEAAoE,CACpE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAW,MAAM,CACvC,oEAAoE,CACpE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GACrB,MAAM,CAAC,oEAAoE,CAAC;IAC5E,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEZ;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,MAAM,CACtC,oEAAoE,CACpE,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,IAAI,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACpD,MAAM,CAAC,MAAM,GAAG,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,GAAG,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/contract/contract.d.ts b/lib.esm/contract/contract.d.ts index b7a2cd009..637e513de 100644 --- a/lib.esm/contract/contract.d.ts +++ b/lib.esm/contract/contract.d.ts @@ -45,7 +45,7 @@ export declare class BaseContract implements Addressable, EventEmitterable(target: string, abi: InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit; static isIndexed(value: any): value is Indexed; } -declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: ContractRunner | null | undefined) => BaseContract & Omit; +declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: null | ContractRunner) => BaseContract & Omit; export declare class Contract extends Contract_base { } export {}; diff --git a/lib.esm/contract/contract.d.ts.map b/lib.esm/contract/contract.d.ts.map index d2114f9d0..93e959992 100644 --- a/lib.esm/contract/contract.d.ts.map +++ b/lib.esm/contract/contract.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAEL,GAAG,EACH,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAGL,2BAA2B,EAC3B,QAAQ,EACT,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,SAAS,EAEV,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EAIf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAEV,iBAAiB,EACjB,iBAAiB,EAEjB,cAAc,EAEd,aAAa,EACb,mBAAmB,EAEnB,eAAe,EAChB,MAAM,YAAY,CAAC;AA2GpB;;GAEG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EAClE,GAAG,EAAE,GAAG,EACR,OAAO,CAAC,EAAE,KAAK,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AAC,CAAC,GAAG,iBAAiB,EACrC,GAAG,EAAE,YAAY,GAChB,KACD,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,KAC3B,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;IAS/C,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,EAC/B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,GAC7B,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC;IAO7C,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO;CAG/C;;AAUD,qBAAa,QAAS,SAAQ,aAAe;CAAG"} \ No newline at end of file +{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAEN,GAAG,EACH,mBAAmB,EACnB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAGN,2BAA2B,EAC3B,QAAQ,EACR,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACX,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,SAAS,EAET,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACX,QAAQ,EACR,cAAc,EAId,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAEX,iBAAiB,EACjB,iBAAiB,EAEjB,cAAc,EAEd,aAAa,EACb,mBAAmB,EAEnB,eAAe,EACf,MAAM,YAAY,CAAC;AA2GpB;;GAEG;AACH,wBAAsB,aAAa,CAAC,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,EAAE,iBAAiB,EACxB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;IAGK,cAAc,CACnB,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;IAED,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,iBAAiB,EACtC,GAAG,EAAE,YAAY,GACf,KACF,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,KAC1B,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAO9C;IAED,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,EAChC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,GAC5B,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAM5C;IACD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAE7C;CACD;0CAGQ,MAAM,OACT,YAAY,WACR,IAAI,GAAG,cAAc,KAC1B,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/D,qBAAa,QAAS,SAAQ,aAAe;CAAG"} \ No newline at end of file diff --git a/lib.esm/contract/contract.js.map b/lib.esm/contract/contract.js.map index 2e68642f6..444601d70 100644 --- a/lib.esm/contract/contract.js.map +++ b/lib.esm/contract/contract.js.map @@ -1 +1 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,WAAW,EACX,GAAG,GAEJ,MAAM,0BAA0B,CAAC;AAClC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,EAAE;gBACzC,IAAI,EAAE,CAAC;gBACP,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;aAClB;SACF;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iBAAiB;IACjB,KAAK,CAAC,WAAW,CACf,KAAwB,EACxB,QAAkB;QAElB,OAAO,MAAM,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,cAAc,CAClB,KAAwB,EACxB,QAAkB;QAElB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,UAAU,CACf,GAAiB;QAKjB,MAAM,cAAe,SAAQ,YAAY;YACvC,YAAY,OAAe,EAAE,SAAgC,IAAI;gBAC/D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;YAC9B,CAAC;SACF;QACD,OAAO,cAAqB,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,IAAI,CACT,MAAc,EACd,GAAiB,EACjB,MAA8B;QAE9B,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,GAAG,IAAI,CAAC;SACf;QACD,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,QAAe,CAAC;IACzB,CAAC;IACD,MAAM,CAAC,SAAS,CAAC,KAAU;QACzB,OAAO,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACF;AAED,SAAS,aAAa;IAKpB,OAAO,YAAmB,CAAC;AAC7B,CAAC;AAED,MAAM,OAAO,QAAS,SAAQ,aAAa,EAAE;CAAG"} \ No newline at end of file +{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,K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 600026a1b..e49bf553e 100644 --- a/lib.esm/contract/factory.d.ts.map +++ b/lib.esm/contract/factory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,OAAO,EAAE,YAAY,EAA8B,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAKjE,qBAAa,eAAe,CAC1B,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EACjC,CAAC,GAAG,YAAY;IAEhB,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAG,IAAI,GAAG,cAAc,CAAC;gBAGtC,GAAG,EAAE,SAAS,GAAG,YAAY,EAC7B,QAAQ,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EACxC,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc;IA2B1B,oBAAoB,CACxB,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,yBAAyB,CAAC;IAsB/B,MAAM,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CACnD,YAAY,GAAG;QACb,qBAAqB,IAAI,2BAA2B,CAAC;KACtD,GAAG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AAA;KAAE,EACxC,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,EAyB9B;IAEK,oBAAoB,CACzB,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC,yBAAyB,CAAC,CAoBpC;IAEK,MAAM,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CACpD,YAAY,GAAG;QACd,qBAAqB,IAAI,2BAA2B,CAAC;KACrD,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAC/B,CAoBA;IAED,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAE5D;IAED,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAC3E,MAAM,EAAE,GAAG,EACX,MAAM,CAAC,EAAE,cAAc,GACrB,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAiBvB;CACD"} \ No newline at end of file diff --git a/lib.esm/contract/factory.js.map b/lib.esm/contract/factory.js.map index a8cba5661..6479a66f5 100644 --- a/lib.esm/contract/factory.js.map +++ b/lib.esm/contract/factory.js.map @@ -1 +1 @@ -{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,MAAM,EACN,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAYzE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,C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,QAAQ,GAAG,EAAE,CAAC;QAClB,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC5B,CAAC;aAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAC9C,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAChC,CAAC;QAED,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/contract/index.d.ts.map b/lib.esm/contract/index.d.ts.map index ce8d05bb5..a5098a449 100644 --- a/lib.esm/contract/index.d.ts.map +++ b/lib.esm/contract/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,GAChB,MAAM,YAAY,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/lib.esm/contract/index.js.map b/lib.esm/contract/index.js.map index d8d2fec14..bbfe70a1e 100644 --- a/lib.esm/contract/index.js.map +++ b/lib.esm/contract/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACT,MAAM,eAAe,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,eAAe,CAAC"} \ No newline at end of file diff --git a/lib.esm/contract/types.d.ts.map b/lib.esm/contract/types.d.ts.map index d0dd8e022..d356fb5ec 100644 --- a/lib.esm/contract/types.d.ts.map +++ b/lib.esm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/wrappers.d.ts.map b/lib.esm/contract/wrappers.d.ts.map index aa2542479..4538896c6 100644 --- a/lib.esm/contract/wrappers.d.ts.map +++ b/lib.esm/contract/wrappers.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,qBAAa,QAAS,SAAQ,GAAG;IAC/B,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa;IAM/D,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,cAAc,IAAI,MAAM,CAE3B;CACF;AAED,qBAAa,0BAA2B,SAAQ,kBAAkB;;gBAGpD,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,kBAAkB;IAKxE,IAAI,IAAI,IAAI,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,CAWhC;CACF;AAED,qBAAa,2BAA4B,SAAQ,mBAAmB;;gBAGtD,KAAK,EAAE,SA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K,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAEnD;IAEK,qBAAqB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAEzD;CACD;AAED,qBAAa,oBAAqB,SAAQ,2BAA2B;IACpE,SAAiB,QAAQ,EAAE,aAAa,CAAC;IACzC,SAAiB,GAAG,EAAE,QAAQ,CAAC;IAC/B,SAAiB,IAAI,EAAE,MAAM,CAAC;IAE9B,YACC,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,GAAG,EAcT;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;CACD"} \ No newline at end of file diff --git a/lib.esm/contract/wrappers.js.map b/lib.esm/contract/wrappers.js.map index e79ad385a..df90db46c 100644 --- a/lib.esm/contract/wrappers.js.map +++ b/lib.esm/contract/wrappers.js.map @@ -1 +1 @@ -{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,GAAG,EACH,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AASnE,MAAM,OAAO,QAAS,SAAQ,GAAG;IACtB,SAAS,CAAa;IACtB,QAAQ,CAAiB;IACzB,IAAI,CAAU;IAEvB,YAAY,GAAQ,EAAE,KAAgB,EAAE,QAAuB;QAC7D,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAClE,gBAAgB,CAAW,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EA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AAG,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,cAAc;QACnB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,qBAAqB;QAC1B,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAC/C,CAAC;CACD;AAED,MAAM,OAAO,oBAAqB,SAAQ,2BAA2B;IAKpE,YACC,QAAsB,EACtB,QAAyB,EACzB,MAAyB,EACzB,QAAuB,EACvB,IAAS;QAET,KAAK,CACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,IAAI,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAChD,CAAC;QACF,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,cAAc,CAC7C,QAAQ,EACR,IAAI,CAAC,GAAG,CAAC,IAAI,EACb,IAAI,CAAC,GAAG,CAAC,MAAM,CACf,CAAC;QACF,gBAAgB,CAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,SAAS;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,cAAc;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/corebc.d.ts b/lib.esm/corebc.d.ts index 04ae175d8..1dede3269 100644 --- a/lib.esm/corebc.d.ts +++ b/lib.esm/corebc.d.ts @@ -23,4 +23,6 @@ export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, C export type { AccessList, AccessListish, AccessListEntry, TransactionLike, } from "./transaction/index.js"; export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, CoreBCError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedCoreBCError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener, } from "./utils/index.js"; export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions, } from "./wallet/index.js"; +export * from "./cip/index.js"; +export * from "./ipfs/index.js"; //# sourceMappingURL=corebc.d.ts.map \ No newline at end of file diff --git a/lib.esm/corebc.d.ts.map b/lib.esm/corebc.d.ts.map index d023fbd11..c9c604763 100644 --- a/lib.esm/corebc.d.ts.map +++ b/lib.esm/corebc.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"corebc.d.ts","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,KAAK,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,aAAa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B,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,GACf,MAAM,mBAAmB,CAAC"} \ No newline at end of file +{"version":3,"file":"corebc.d.ts","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,KAAK,GACL,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACN,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EACN,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,CAAC,EACD,QAAQ,EACR,UAAU,EACV,aAAa,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,E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eAAe,EACf,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.esm/corebc.js b/lib.esm/corebc.js index d8cb46b04..e44acdfe8 100644 --- a/lib.esm/corebc.js +++ b/lib.esm/corebc.js @@ -14,4 +14,6 @@ export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLen export { Mnemonic, BaseWallet, HDNodeWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js"; export { BigNumber } from "./bigNumber/bigNumber.js"; export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists, } from "./wordlists/index.js"; +export * from "./cip/index.js"; +export * from "./ipfs/index.js"; //# sourceMappingURL=corebc.js.map \ No newline at end of file diff --git a/lib.esm/corebc.js.map b/lib.esm/corebc.js.map index c8fa02a9b..27e3e783d 100644 --- a/lib.esm/corebc.js.map +++ b/lib.esm/corebc.js.map @@ -1 +1 @@ -{"version":3,"file":"corebc.js","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,KAAK,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM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BAAsB,CAAC;AAE9B,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,UAAU,EACV,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,WAAW,EACX,WAAW,EACX,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,SAAS,EACT,eAAe,EACf,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,MAAM,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,YAAY,EACZ,SAAS,GACV,MAAM,sBAAsB,CAAC"} \ No newline at end of file +{"version":3,"file":"corebc.js","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,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c,EACd,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EACN,QAAQ,EACR,MAAM,EACN,WAAW,EACX,YAAY,EACZ,SAAS,GACT,MAAM,sBAAsB,CAAC;AA0I9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/browser-ed448.d.ts b/lib.esm/crypto/browser-ed448.d.ts index 7aee3772e..7b2b7d29a 100644 --- a/lib.esm/crypto/browser-ed448.d.ts +++ b/lib.esm/crypto/browser-ed448.d.ts @@ -1,3 +1,4 @@ -import ed448 from "bcrypto/lib/ed448-browser.js"; +import type { Ed448Backend } from "./ed448-types.js"; +declare const ed448: Ed448Backend; export default ed448; //# sourceMappingURL=browser-ed448.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/browser-ed448.d.ts.map b/lib.esm/crypto/browser-ed448.d.ts.map index ac87af8f7..33a4fd898 100644 --- a/lib.esm/crypto/browser-ed448.d.ts.map +++ b/lib.esm/crypto/browser-ed448.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"browser-ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,8BAA8B,CAAC;AACjD,eAAe,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"browser-ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/lib.esm/crypto/browser-ed448.js b/lib.esm/crypto/browser-ed448.js index 3f7f3f0cb..f8b6b6f72 100644 --- a/lib.esm/crypto/browser-ed448.js +++ b/lib.esm/crypto/browser-ed448.js @@ -1,5 +1,6 @@ -"use strict"; +// bcrypto does not ship TypeScript declarations. // @ts-ignore -import ed448 from "bcrypto/lib/ed448-browser.js"; +import backend from "bcrypto/lib/ed448-browser.js"; +const ed448 = backend; export default ed448; //# sourceMappingURL=browser-ed448.js.map \ No newline at end of file diff --git a/lib.esm/crypto/browser-ed448.js.map b/lib.esm/crypto/browser-ed448.js.map index 3adaf1126..a9fee80b4 100644 --- a/lib.esm/crypto/browser-ed448.js.map +++ b/lib.esm/crypto/browser-ed448.js.map @@ -1 +1 @@ -{"version":3,"file":"browser-ed448.js","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,aAAa;AACb,OAAO,KAAK,MAAM,8BAA8B,CAAC;AACjD,eAAe,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"browser-ed448.js","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,aAAa;AACb,OAAO,OAAO,MAAM,8BAA8B,CAAC;AAEnD,MAAM,KAAK,GAAiB,OAAO,CAAC;AACpC,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/browser-sha3.d.ts.map b/lib.esm/crypto/browser-sha3.d.ts.map index e40fa9ffd..61f4a3fba 100644 --- a/lib.esm/crypto/browser-sha3.d.ts.map +++ b/lib.esm/crypto/browser-sha3.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"browser-sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AAQA,OAAO,EAAY,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACd,MAAM,CAkBR"} \ No newline at end of file +{"version":3,"file":"browser-sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AASA,OAAO,EAAY,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR"} \ No newline at end of file diff --git a/lib.esm/crypto/browser-sha3.js b/lib.esm/crypto/browser-sha3.js index 03a54384e..7bac13cff 100644 --- a/lib.esm/crypto/browser-sha3.js +++ b/lib.esm/crypto/browser-sha3.js @@ -1,4 +1,5 @@ -"use strict"; +import { Buffer } from "buffer"; +("use strict"); // @ts-ignore import _ripemd160 from "bcrypto/lib/ripemd160-browser"; // @ts-ignore diff --git a/lib.esm/crypto/browser-sha3.js.map b/lib.esm/crypto/browser-sha3.js.map index 27c4fbaa2..0966a462a 100644 --- a/lib.esm/crypto/browser-sha3.js.map +++ b/lib.esm/crypto/browser-sha3.js.map @@ -1 +1 @@ -{"version":3,"file":"browser-sha3.js","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AAAA,YAA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CAAC,MAAM,CAAC,qBAAqB,EACnC;QACC,SAAS,EAAE,aAAa;QACxB,SAAS,EAAE,SAAS;KACpB,CACD,CAAC;IACF,OAAO,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/crypto-browser.d.ts.map b/lib.esm/crypto/crypto-browser.d.ts.map index 74fb87c78..96b1570a8 100644 --- a/lib.esm/crypto/crypto-browser.d.ts.map +++ b/lib.esm/crypto/crypto-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;KAAG;IAEnB,MAAM,MAAM,EAAE,MAAM,CAAC;IAErB,MAAM,IAAI,EAAE,MAAM,CAAC;CACpB;AAkBD,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAYrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAIvE;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,GAAG,QAAQ,GACzB,UAAU,CAIZ;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAoBtD"} \ No newline at end of file +{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;KAAG;IAEnB,MAAM,MAAM,EAAE,MAAM,CAAC;IAErB,MAAM,IAAI,EAAE,MAAM,CAAC;CACnB;AAmBD,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAcrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAMvE;AAED,wBAAgB,UAAU,CACzB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,GAAG,QAAQ,GACxB,UAAU,CAIZ;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAoBtD"} \ No newline at end of file diff --git a/lib.esm/crypto/crypto-browser.js b/lib.esm/crypto/crypto-browser.js index 1697aceef..af974960d 100644 --- a/lib.esm/crypto/crypto-browser.js +++ b/lib.esm/crypto/crypto-browser.js @@ -1,14 +1,17 @@ /* Browser Crypto Shims */ -import { hmac } from "@noble/hashes/hmac"; -import { pbkdf2 } from "@noble/hashes/pbkdf2"; -import { sha256 } from "@noble/hashes/sha256"; -import { sha512 } from "@noble/hashes/sha512"; -import { sha3_256, sha3_512 } from "@noble/hashes/sha3"; +import { ripemd160 } from "@noble/hashes/legacy.js"; +import { hmac } from "@noble/hashes/hmac.js"; +import { pbkdf2 } from "@noble/hashes/pbkdf2.js"; +import { sha256 } from "@noble/hashes/sha2.js"; +import { sha512 } from "@noble/hashes/sha2.js"; +import { sha3_256, sha3_512 } from "@noble/hashes/sha3.js"; import ed448 from "./browser-ed448.js"; import { assert, assertArgument } from "../utils/index.js"; export { ed448 }; export { Ed448Goldilock } from "./ed448goldilock-browser.js"; function getGlobal() { + if (typeof globalThis !== "undefined") + return globalThis; if (typeof self !== "undefined") { return self; } @@ -24,6 +27,8 @@ const anyGlobal = getGlobal(); const crypto = anyGlobal.crypto || anyGlobal.msCrypto; export function createHash(algo) { switch (algo) { + case "ripemd160": + return ripemd160.create(); case "sha256": return sha256.create(); case "sha512": @@ -36,7 +41,7 @@ export function createHash(algo) { assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); } export function createHmac(_algo, key) { - const algo = { sha256, sha512 }[_algo]; + const algo = { sha256, sha512, "sha3-256": sha3_256, "sha3-512": sha3_512 }[_algo]; assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); return hmac.create(algo, key); } diff --git a/lib.esm/crypto/crypto-browser.js.map b/lib.esm/crypto/crypto-browser.js.map index 2b85d47e0..3e244fd0f 100644 --- a/lib.esm/crypto/crypto-browser.js.map +++ b/lib.esm/crypto/crypto-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"crypto-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,E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EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,CAC1E,KAAiB,CACjB,CAAC;IACF,cAAc,CAAC,IAAI,IAAI,IAAI,EAAE,wBAAwB,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC3E,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,UAAU,CACzB,QAAoB,EACpB,IAAgB,EAChB,UAAkB,EAClB,MAAc,EACd,KAA0B;IAE1B,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;IACvC,cAAc,CAAC,IAAI,IAAI,IAAI,EAAE,0BAA0B,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;IAC7E,OAAO,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc;IACzC,MAAM,CACL,MAAM,IAAI,IAAI,EACd,iDAAiD,EACjD,uBAAuB,EACvB;QACC,SAAS,EAAE,aAAa;KACxB,CACD,CAAC;IAEF,cAAc,CACb,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,EACxD,gBAAgB,EAChB,QAAQ,EACR,MAAM,CACN,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/crypto.d.ts b/lib.esm/crypto/crypto.d.ts index 56e369d6c..67011fd36 100644 --- a/lib.esm/crypto/crypto.d.ts +++ b/lib.esm/crypto/crypto.d.ts @@ -1,3 +1,4 @@ +/// import ed448 from "./ed448.js"; export { ed448 }; export { Ed448Goldilock } from "./ed448goldilock.js"; diff --git a/lib.esm/crypto/crypto.d.ts.map b/lib.esm/crypto/crypto.d.ts.map index a472d84a5..551ce5172 100644 --- a/lib.esm/crypto/crypto.d.ts.map +++ b/lib.esm/crypto/crypto.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file +{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/crypto.js b/lib.esm/crypto/crypto.js index 76c6f3a16..2ec24f8f7 100644 --- a/lib.esm/crypto/crypto.js +++ b/lib.esm/crypto/crypto.js @@ -1,3 +1,4 @@ +/// import ed448 from "./ed448.js"; export { ed448 }; export { Ed448Goldilock } from "./ed448goldilock.js"; diff --git a/lib.esm/crypto/crypto.js.map b/lib.esm/crypto/crypto.js.map index 5b22aa525..50456e3cc 100644 --- a/lib.esm/crypto/crypto.js.map +++ b/lib.esm/crypto/crypto.js.map @@ -1 +1 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file +{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448-types.d.ts b/lib.esm/crypto/ed448-types.d.ts new file mode 100644 index 000000000..705f54df5 --- /dev/null +++ b/lib.esm/crypto/ed448-types.d.ts @@ -0,0 +1,15 @@ +import type { Buffer } from "buffer"; +/** Buffer-based bcrypto Ed448 operations used by Core signing. */ +export interface Ed448Backend { + privateKeyGenerate(): Buffer; + publicKeyCreate(key: Buffer): Buffer; + publicKeyFromScalar(scalar: Buffer): Buffer; + publicKeyVerify(key: Buffer): boolean; + publicKeyCombine(keys: Buffer[]): Buffer; + sign(message: Buffer, key: Buffer): Buffer; + signWithScalar(message: Buffer, scalar: Buffer, prefix: Buffer): Buffer; + verify(message: Buffer, signature: Buffer, publicKey: Buffer): boolean; + derive(publicKey: Buffer, key: Buffer): Buffer; + deriveWithScalar(publicKey: Buffer, scalar: Buffer): Buffer; +} +//# sourceMappingURL=ed448-types.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448-types.d.ts.map b/lib.esm/crypto/ed448-types.d.ts.map new file mode 100644 index 000000000..209f88584 --- /dev/null +++ b/lib.esm/crypto/ed448-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ed448-types.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC5B,kBAAkB,IAAI,MAAM,CAAC;IAC7B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5D"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448-types.js b/lib.esm/crypto/ed448-types.js new file mode 100644 index 000000000..11baabae1 --- /dev/null +++ b/lib.esm/crypto/ed448-types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=ed448-types.js.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448-types.js.map b/lib.esm/crypto/ed448-types.js.map new file mode 100644 index 000000000..0564f5549 --- /dev/null +++ b/lib.esm/crypto/ed448-types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ed448-types.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448-types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/crypto/ed448.d.ts b/lib.esm/crypto/ed448.d.ts index 5dfe597f9..fd3e5a866 100644 --- a/lib.esm/crypto/ed448.d.ts +++ b/lib.esm/crypto/ed448.d.ts @@ -1,3 +1,4 @@ -import ed448 from "bcrypto/lib/ed448.js"; +import type { Ed448Backend } from "./ed448-types.js"; +declare const ed448: Ed448Backend; export default ed448; //# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448.d.ts.map b/lib.esm/crypto/ed448.d.ts.map index 19085a96e..7ea835437 100644 --- a/lib.esm/crypto/ed448.d.ts.map +++ b/lib.esm/crypto/ed448.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,sBAAsB,CAAC;AAEzC,eAAe,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448.js b/lib.esm/crypto/ed448.js index 48ace1601..a72f52656 100644 --- a/lib.esm/crypto/ed448.js +++ b/lib.esm/crypto/ed448.js @@ -1,5 +1,6 @@ -"use strict"; +// bcrypto does not ship TypeScript declarations. // @ts-ignore -import ed448 from "bcrypto/lib/ed448.js"; +import backend from "bcrypto/lib/ed448.js"; +const ed448 = backend; export default ed448; //# sourceMappingURL=ed448.js.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448.js.map b/lib.esm/crypto/ed448.js.map index 2b5a73716..210b134ce 100644 --- a/lib.esm/crypto/ed448.js.map +++ b/lib.esm/crypto/ed448.js.map @@ -1 +1 @@ -{"version":3,"file":"ed448.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,aAAa;AACb,OAAO,KAAK,MAAM,sBAAsB,CAAC;AAEzC,eAAe,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"ed448.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,aAAa;AACb,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAE3C,MAAM,KAAK,GAAiB,OAAO,CAAC;AACpC,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock-browser.d.ts b/lib.esm/crypto/ed448goldilock-browser.d.ts index 675f772fa..58df73a6f 100644 --- a/lib.esm/crypto/ed448goldilock-browser.d.ts +++ b/lib.esm/crypto/ed448goldilock-browser.d.ts @@ -1,6 +1,7 @@ +import { Buffer } from "buffer"; export declare class Ed448Goldilock { - static _channel: any; - static generatePrivateKey(): any; + static _channel: import("./ed448-types.js").Ed448Backend; + static generatePrivateKey(): Buffer; static getPublicKeyFromPrivateKey(privateKey: string): string; static signWithPrivateKey(privateKey: string, msg: string): string; static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; diff --git a/lib.esm/crypto/ed448goldilock-browser.d.ts.map b/lib.esm/crypto/ed448goldilock-browser.d.ts.map index 754f2764a..976a9855d 100644 --- a/lib.esm/crypto/ed448goldilock-browser.d.ts.map +++ b/lib.esm/crypto/ed448goldilock-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAOA,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,MAAS;IAExB,MAAM,CAAC,kBAAkB;IAMzB,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAc7D,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAqBlE,MAAM,CAAC,+BAA+B,CACpC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,MAAM;IAMT,MAAM,CAAC,eAAe,CACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO;IAIV,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAQzD,MAAM,CAAC,iBAAiB,CACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,MAAM;IAaT,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAc9C,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAiBlD,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAgBrD,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CASxE"} \ No newline at end of file +{"version":3,"file":"ed448goldilock-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock-browser.js b/lib.esm/crypto/ed448goldilock-browser.js index 5449803c2..c8af42378 100644 --- a/lib.esm/crypto/ed448goldilock-browser.js +++ b/lib.esm/crypto/ed448goldilock-browser.js @@ -1,3 +1,4 @@ +import { Buffer } from "buffer"; // @ts-ignore import ed448 from "./browser-ed448.js"; // @ts-ignore @@ -48,7 +49,7 @@ export class Ed448Goldilock { return signedMessage + publicKey; } static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(msgHash, signedMsg, pubKey); + return this._channel.verify(Buffer.from(msgHash, "hex"), Buffer.from(signedMsg, "hex"), Buffer.from(pubKey, "hex")); } static SHA512Hash(password, salt) { var p1 = Buffer.from(password, "hex"); diff --git a/lib.esm/crypto/ed448goldilock-browser.js.map b/lib.esm/crypto/ed448goldilock-browser.js.map index 0c86f3ffe..80c838e49 100644 --- a/lib.esm/crypto/ed448goldilock-browser.js.map +++ b/lib.esm/crypto/ed448goldilock-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,aAAa;AACb,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,aAAa;AACb,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAE/C,MAAM,OAAO,cAAc;IACzB,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;IAExB,MAAM,CAAC,kBAAkB;QACvB,IAAI,UAAU,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAC5C,UAAU,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QACvB,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAkB;QAClD,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE;YACpB,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;YAClB,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;YACnB,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAC1D,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC/C;aAAM;YACL,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAA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C,IAAI,CAAC,CAAC;QACnD,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,EAAE,UAAU,GAAG,EAAE,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,CAAC;QACpE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7B,CAAC"} \ No newline at end of file +{"version":3,"file":"ed448goldilock-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,aAAa;AACb,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,aAAa;AACb,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,aAAa;AACb,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAE/C,MAAM,OAAO,cAAc;IAC1B,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;IAExB,MAAM,CAAC,kBAAkB;QACxB,IAAI,UAAU,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAC5C,UAAU,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QACvB,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAkB;QACnD,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,E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No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock.d.ts b/lib.esm/crypto/ed448goldilock.d.ts index 737cae0a1..3dff60994 100644 --- a/lib.esm/crypto/ed448goldilock.d.ts +++ b/lib.esm/crypto/ed448goldilock.d.ts @@ -1,6 +1,7 @@ +import { Buffer } from "buffer"; export declare class Ed448Goldilock { - static _channel: any; - static generatePrivateKey(): any; + static _channel: import("./ed448-types.js").Ed448Backend; + static generatePrivateKey(): Buffer; static getPublicKeyFromPrivateKey(privateKey: string): string; static signWithPrivateKey(privateKey: string, msg: string): string; static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; diff --git a/lib.esm/crypto/ed448goldilock.d.ts.map b/lib.esm/crypto/ed448goldilock.d.ts.map index 34092c2fe..7cd4dfaca 100644 --- a/lib.esm/crypto/ed448goldilock.d.ts.map +++ b/lib.esm/crypto/ed448goldilock.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":"AAOA,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,MAAS;IAExB,MAAM,CAAC,kBAAkB;IAMzB,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAc7D,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAqBlE,MAAM,CAAC,+BAA+B,CACpC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,MAAM;IAMT,MAAM,CAAC,eAAe,CACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO;IAIV,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAQzD,MAAM,CAAC,iBAAiB,CACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,MAAM;IAaT,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAc9C,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAiBlD,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAgBrD,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CASxE"} \ No newline at end of file +{"version":3,"file":"ed448goldilock.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock.js b/lib.esm/crypto/ed448goldilock.js index 33142b5e7..9eaf5adff 100644 --- a/lib.esm/crypto/ed448goldilock.js +++ b/lib.esm/crypto/ed448goldilock.js @@ -1,5 +1,6 @@ +import { Buffer } from "buffer"; // @ts-ignore -import ed448 from "bcrypto/lib/ed448.js"; +import ed448 from "./ed448.js"; // @ts-ignore import pbkdf2 from "bcrypto/lib/pbkdf2.js"; // @ts-ignore @@ -48,7 +49,7 @@ export class Ed448Goldilock { return signedMessage + publicKey; } static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(msgHash, signedMsg, pubKey); + return this._channel.verify(Buffer.from(msgHash, "hex"), Buffer.from(signedMsg, "hex"), Buffer.from(pubKey, "hex")); } static SHA512Hash(password, salt) { var p1 = Buffer.from(password, "hex"); diff --git a/lib.esm/crypto/ed448goldilock.js.map b/lib.esm/crypto/ed448goldilock.js.map index 778ebc095..097bc0178 100644 --- a/lib.esm/crypto/ed448goldilock.js.map +++ b/lib.esm/crypto/ed448goldilock.js.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,KAAK,MAAM,sBAAsB,CAAC;AACzC,aAAa;AACb,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,aAAa;AACb,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAE/C,MAAM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,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YACzD,OAAO,EAAE,GAAG,cAAc,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAY,EAAE,KAAa;QAC7D,IAAI,CAAC,GAAG,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,EAAE,UAAU,GAAG,EAAE,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,CAAC;QACpE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/crypto/hmac.d.ts b/lib.esm/crypto/hmac.d.ts index 4c5e3227d..902055c49 100644 --- a/lib.esm/crypto/hmac.d.ts +++ b/lib.esm/crypto/hmac.d.ts @@ -1,4 +1,5 @@ import type { BytesLike } from "../utils/index.js"; +declare const _computeHmac: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; /** * Return the HMAC for %%data%% using the %%key%% key with the underlying * %%algo%% used for compression. @@ -18,8 +19,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string; export declare namespace computeHmac { - var _: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; - var lock: () => void; - var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; + export { _computeHmac as _ }; + export var lock: () => void; + export var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/hmac.d.ts.map b/lib.esm/crypto/hmac.d.ts.map index 49d9b637c..b5c8a51d9 100644 --- a/lib.esm/crypto/hmac.d.ts.map +++ b/lib.esm/crypto/hmac.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,GACf,MAAM,CAIR;yBARe,WAAW"} \ No newline at end of file +{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,YAAY,cACN,QAAQ,GAAG,QAAQ,OACzB,UAAU,QACT,UAAU,KACd,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAC1B,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,GACd,MAAM,CAIR;yBARe,WAAW;aASX,YAAY;;gCAKrB,CACL,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,UAAU,KACZ,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/hmac.js.map b/lib.esm/crypto/hmac.js.map index e854d8821..704b0a0e5 100644 --- a/lib.esm/crypto/hmac.js.map +++ b/lib.esm/crypto/hmac.js.map @@ -1 +1 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UACnB,SAA8B,EAC9B,GAAe,EACf,IAAgB;IAEhB,OAAO,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC1D,CAAC,CAAC;AAEF,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CACzB,SAA8B,EAC9B,IAAe,EACf,KAAgB;IAEhB,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD,CAAC;AACD,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAG;IACjB,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC,CAAC;AACF,WAAW,CAAC,QAAQ,GAAG,UACrB,IAIc;IAEd,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;KAC1C;IACD,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UACpB,SAA8B,EAC9B,GAAe,EACf,IAAgB;IAEhB,OAAO,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACzD,CAAC,CAAC;AAEF,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAC1B,SAA8B,EAC9B,IAAe,EACf,KAAgB;IAEhB,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC;AACD,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAG;IAClB,MAAM,GAAG,IAAI,CAAC;AACf,CAAC,CAAC;AACF,WAAW,CAAC,QAAQ,GAAG,UACtB,IAIc;IAEd,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC1C,CAAC;IACD,aAAa,GAAG,IAAI,CAAC;AACtB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/index.d.ts.map b/lib.esm/crypto/index.d.ts.map index 153bb6fd7..76d2d37f8 100644 --- a/lib.esm/crypto/index.d.ts.map +++ b/lib.esm/crypto/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,iBAAS,IAAI,IAAI,IAAI,CAUpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,iBAAS,IAAI,IAAI,IAAI,CAUpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/index.js.map b/lib.esm/crypto/index.js.map index 747390a20..8bfc5e2d7 100644 --- a/lib.esm/crypto/index.js.map +++ b/lib.esm/crypto/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,IAAI,CAAC;AAEL,8CAA8C;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,SAAS,IAAI;IACX,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,SAAS,CAAC,IAAI,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,IAAI,EAAE,CAAC;IAClB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,IAAI,EAAE,CAAC;AACrB,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,IAAI,CAAC;AAEL,8CAA8C;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,SAAS,IAAI;IACZ,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,SAAS,CAAC,IAAI,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,IAAI,EAAE,CAAC;IAClB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/keccak.d.ts b/lib.esm/crypto/keccak.d.ts index 533f46dc6..a2b3dd879 100644 --- a/lib.esm/crypto/keccak.d.ts +++ b/lib.esm/crypto/keccak.d.ts @@ -4,6 +4,7 @@ * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] */ import type { BytesLike } from "../utils/index.js"; +declare const _keccak256: (data: Uint8Array) => Uint8Array; /** * Compute the cryptographic KECCAK256 hash of %%data%%. * @@ -28,8 +29,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function keccak256(_data: BytesLike): string; export declare namespace keccak256 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _keccak256 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=keccak.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/keccak.d.ts.map b/lib.esm/crypto/keccak.d.ts.map index 2f0a88fb1..dfe4be3ef 100644 --- a/lib.esm/crypto/keccak.d.ts.map +++ b/lib.esm/crypto/keccak.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAUnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file +{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/keccak.js b/lib.esm/crypto/keccak.js index b22f2aafc..65c5e43da 100644 --- a/lib.esm/crypto/keccak.js +++ b/lib.esm/crypto/keccak.js @@ -3,7 +3,7 @@ * * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] */ -import { keccak_256 } from "@noble/hashes/sha3"; +import { keccak_256 } from "@noble/hashes/sha3.js"; import { getBytes, hexlify } from "../utils/index.js"; let locked = false; const _keccak256 = function (data) { diff --git a/lib.esm/crypto/keccak.js.map b/lib.esm/crypto/keccak.js.map index de46c417c..05e88834a 100644 --- a/lib.esm/crypto/keccak.js.map +++ b/lib.esm/crypto/keccak.js.map @@ -1 +1 @@ -{"version":3,"file":"keccak.js","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAU,IAAgB;IAC3C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACxC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG;IACf,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC,CAAC;AACF,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAqC;IAClE,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAC5C;IACD,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"keccak.js","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAU,IAAgB;IAC5C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC;AAEF,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG;IAChB,MAAM,GAAG,IAAI,CAAC;AACf,CAAC,CAAC;AACF,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAqC;IACnE,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAC5C,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;AACpB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2-browser.d.ts.map b/lib.esm/crypto/pbkdf2-browser.d.ts.map index a7519b4b4..97bf68048 100644 --- a/lib.esm/crypto/pbkdf2-browser.d.ts.map +++ b/lib.esm/crypto/pbkdf2-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pbkdf2-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,+BAA+B,CAAC;AACnD,eAAe,MAAM,CAAC"} \ No newline at end of file +{"version":3,"file":"pbkdf2-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,+BAA+B,CAAC;eACpC,MAAM"} \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2.d.ts b/lib.esm/crypto/pbkdf2.d.ts index 400e9744f..c2da81c40 100644 --- a/lib.esm/crypto/pbkdf2.d.ts +++ b/lib.esm/crypto/pbkdf2.d.ts @@ -6,6 +6,7 @@ * @_subsection: api/crypto:Passwords [about-pbkdf] */ import type { BytesLike } from "../utils/index.js"; +declare const _pbkdf2: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; /** * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using * the %%salt%% and using %%iterations%% of %%algo%%. @@ -28,8 +29,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string; export declare namespace pbkdf2 { - var _: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; - var lock: () => void; - var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; + export { _pbkdf2 as _ }; + export var lock: () => void; + export var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; } +export {}; //# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2.d.ts.map b/lib.esm/crypto/pbkdf2.d.ts.map index 99323c18c..fc5ad966d 100644 --- a/lib.esm/crypto/pbkdf2.d.ts.map +++ b/lib.esm/crypto/pbkdf2.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAgBnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACpB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GACxB,MAAM,CAIR;yBAVe,MAAM"} \ No newline at end of file +{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,OAAO,aACF,UAAU,QACd,UAAU,cACJ,MAAM,UACV,MAAM,QACR,QAAQ,GAAG,QAAQ,KACvB,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACrB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GACvB,MAAM,CAIR;yBAVe,MAAM;aAWX,OAAO;2BACS,IAAI;gCAIxB,CACL,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,KACrB,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2.js.map b/lib.esm/crypto/pbkdf2.js.map index bf6be91b3..77a63b7a5 100644 --- a/lib.esm/crypto/pbkdf2.js.map +++ b/lib.esm/crypto/pbkdf2.js.map @@ -1 +1 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,OAAO,GA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pB,IAAgB,EAChB,UAAkB,EAClB,MAAc,EACd,IAAyB;IAEzB,OAAO,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,IAAI,QAAQ,GAAG,OAAO,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,MAAM,CACrB,SAAoB,EACpB,KAAgB,EAChB,UAAkB,EAClB,MAAc,EACd,IAAyB;IAEzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG;IACb,MAAM,GAAG,IAAI,CAAC;AACf,CAAC,CAAC;AACF,MAAM,CAAC,QAAQ,GAAG,UACjB,IAMc;IAEd,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;IACD,QAAQ,GAAG,IAAI,CAAC;AACjB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/random.d.ts b/lib.esm/crypto/random.d.ts index fd9378000..609ec0ec0 100644 --- a/lib.esm/crypto/random.d.ts +++ b/lib.esm/crypto/random.d.ts @@ -1,3 +1,4 @@ +declare const _randomBytes: (length: number) => Uint8Array; /** * Return %%length%% bytes of cryptographically secure random data. * @@ -7,8 +8,9 @@ */ export declare function randomBytes(length: number): Uint8Array; export declare namespace randomBytes { - var _: (length: number) => Uint8Array; - var lock: () => void; - var register: (func: (length: number) => Uint8Array) => void; + export { _randomBytes as _ }; + export var lock: () => void; + export var register: (func: (length: number) => Uint8Array) => void; } +export {}; //# sourceMappingURL=random.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/random.d.ts.map b/lib.esm/crypto/random.d.ts.map index a907fd7ef..0e9d29e7b 100644 --- a/lib.esm/crypto/random.d.ts.map +++ b/lib.esm/crypto/random.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW"} \ No newline at end of file +{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY,WAAqB,MAAM,KAAG,UAE/C,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW;aAIX,YAAY;2BACI,IAAI;gCAGG,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU"} \ No newline at end of file diff --git a/lib.esm/crypto/random.js.map b/lib.esm/crypto/random.js.map index aa9ee631c..69fc6e771 100644 --- a/lib.esm/crypto/random.js.map +++ b/lib.esm/crypto/random.js.map @@ -1 +1 @@ -{"version":3,"file":"random.js","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3D,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UAAU,MAAc;IAC3C,OAAO,IAAI,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;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,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/ripemd160.d.ts b/lib.esm/crypto/ripemd160.d.ts index 27b7b4a1c..a38b5f516 100644 --- a/lib.esm/crypto/ripemd160.d.ts +++ b/lib.esm/crypto/ripemd160.d.ts @@ -1,4 +1,5 @@ import type { BytesLike } from "../utils/index.js"; +declare const _ripemd160: (data: Uint8Array) => Uint8Array; /** * Compute the cryptographic RIPEMD-160 hash of %%data%%. * @@ -18,8 +19,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function ripemd160(_data: BytesLike): string; export declare namespace ripemd160 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _ripemd160 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/ripemd160.d.ts.map b/lib.esm/crypto/ripemd160.d.ts.map index 2eb29db41..68683ca8b 100644 --- a/lib.esm/crypto/ripemd160.d.ts.map +++ b/lib.esm/crypto/ripemd160.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAUnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file +{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/ripemd160.js b/lib.esm/crypto/ripemd160.js index e099b22d9..726abe900 100644 --- a/lib.esm/crypto/ripemd160.js +++ b/lib.esm/crypto/ripemd160.js @@ -1,4 +1,4 @@ -import { ripemd160 as noble_ripemd160 } from "@noble/hashes/ripemd160"; +import { ripemd160 as noble_ripemd160 } from "@noble/hashes/legacy.js"; import { getBytes, hexlify } from "../utils/index.js"; let locked = false; const _ripemd160 = function (data) { diff --git a/lib.esm/crypto/ripemd160.js.map b/lib.esm/crypto/ripemd160.js.map index c28940fc9..7bf82e0ce 100644 --- a/lib.esm/crypto/ripemd160.js.map +++ b/lib.esm/crypto/ripemd160.js.map @@ -1 +1 @@ -{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAU,IAAgB;IAC3C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC,CAAC;AAEF,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACxC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG;IACf,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC,CAAC;AACF,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAqC;IAClE,IAAI,MAAM,EAAE;QACV,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;KAC5C;IACD,WAAW,GAAG,IAAI,CAAC;AACrB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAU,IAAgB;IAC5C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG;IAChB,MAAM,GAAG,IAAI,CAAC;AACf,CAAC,CAAC;AACF,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAqC;IACnE,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAC5C,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;AACpB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/rlp.js.map b/lib.esm/crypto/rlp.js.map index 3b158f9a4..f42debc58 100644 --- a/lib.esm/crypto/rlp.js.map +++ b/lib.esm/crypto/rlp.js.map @@ -1 +1 @@ -{"version":3,"file":"rlp.js","sourceRoot":"","sources":["../../src.ts/crypto/rlp.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAa,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE7E,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;AAEvC,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,OAAO,KAAK,EAAE;QACZ,aAAa;QACb,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;QAC7B,KAAK,KAAK,CAAC,CAAC;KACb;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,iBAAiB,CACxB,IAAgB,EAChB,MAAc,EACd,MAAc;IAEd,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAC1C;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,OAAO,CAAC,MAA2B;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,IAAI,OAAO,GAAkB,EAAE,CAAC;QAChC,MAAM,CAAC,OAAO,CAAC,UAAU,KAAK;YAC5B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,MAAM,IAA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C;IACD,OAAO,OAAO,CAAC,MAAM,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/scrypt.d.ts b/lib.esm/crypto/scrypt.d.ts index b0e678f52..a00b5a43b 100644 --- a/lib.esm/crypto/scrypt.d.ts +++ b/lib.esm/crypto/scrypt.d.ts @@ -8,6 +8,8 @@ import type { BytesLike } from "../utils/index.js"; * @_docloc: api/crypto:Passwords */ export type ProgressCallback = (percent: number) => void; +declare const _scryptAsync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback) => Promise & Uint8Array>; +declare const _scryptSync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array & Uint8Array; /** * The [[link-wiki-scrypt]] uses a memory and cpu hard method of * derivation to increase the resource cost to brute-force a password @@ -47,9 +49,9 @@ export type ProgressCallback = (percent: number) => void; */ export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise; export declare namespace scrypt { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback | undefined) => Promise; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback | undefined) => Promise) => void; + export { _scryptAsync as _ }; + export var lock: () => void; + export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback) => Promise) => void; } /** * Provides a synchronous variant of [[scrypt]]. @@ -75,8 +77,9 @@ export declare namespace scrypt { */ export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string; export declare namespace scryptSync { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; + export { _scryptSync as _ }; + export var lock: () => void; + export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; } +export {}; //# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/scrypt.d.ts.map b/lib.esm/crypto/scrypt.d.ts.map index b8a706e0e..23c428160 100644 --- a/lib.esm/crypto/scrypt.d.ts.map +++ b/lib.esm/crypto/scrypt.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AA6CzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,MAAM,CAC1B,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAIjB;yBAZqB,MAAM;;;;;AAmC5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,GACZ,MAAM,CAIR;yBAXe,UAAU"} \ No newline at end of file +{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;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E,MAAM,KACT,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/scrypt.js b/lib.esm/crypto/scrypt.js index 1ee42ee88..a31ad5a93 100644 --- a/lib.esm/crypto/scrypt.js +++ b/lib.esm/crypto/scrypt.js @@ -1,4 +1,4 @@ -import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from "@noble/hashes/scrypt"; +import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from "@noble/hashes/scrypt.js"; import { getBytes, hexlify as H } from "../utils/index.js"; let lockedSync = false, lockedAsync = false; const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { diff --git a/lib.esm/crypto/scrypt.js.map b/lib.esm/crypto/scrypt.js.map index a652d1f16..417845075 100644 --- a/lib.esm/crypto/scrypt.js.map +++ b/lib.esm/crypto/scrypt.js.map @@ -1 +1 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,UAAU,EACpB,WAAW,IAAI,WAAW,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAc3D,IAAI,UAAU,GAAG,KAAK,EACpB,WAAW,GAAG,KAAK,CAAC;AAEtB,MAAM,YAAY,GAAG,KAAK,WACxB,MAAkB,EAClB,IAAgB,EAChB,CAAS,EACT,CAAS,EACT,CAAS,EACT,KAAa,EACb,UAA6B;IAE7B,OAAO,MAAM,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;AACzE,CAAC,CAAC;AACF,MAAM,WAAW,GAAG,UAClB,MAAkB,EAClB,IAAgB,EAChB,CAAS,EACT,CAAS,EACT,CAAS,EACT,KAAa;IAEb,OAAO,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,E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EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACtD,CAAC;AACD,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC;AAC3B,UAAU,CAAC,IAAI,GAAG;IACjB,UAAU,GAAG,IAAI,CAAC;AACnB,CAAC,CAAC;AACF,UAAU,CAAC,QAAQ,GAAG,UACrB,IAOc;IAEd,IAAI,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IACD,YAAY,GAAG,IAAI,CAAC;AACrB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/sha3.d.ts b/lib.esm/crypto/sha3.d.ts index e9130d128..34e1d42f6 100644 --- a/lib.esm/crypto/sha3.d.ts +++ b/lib.esm/crypto/sha3.d.ts @@ -1,6 +1,8 @@ import { BytesLike } from "../utils/data.js"; +declare const _sha256: (data: Uint8Array) => string; +declare const _sha512: (data: Uint8Array) => string; /** - * Compute the cryptographic SHA2-256 hash of %%data%%. + * Compute the cryptographic SHA3-256 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -23,14 +25,14 @@ export declare enum SupportedAlgorithm { export declare function ripemd160(data: BytesLike): string; export declare function sha256(data: BytesLike): string; export declare namespace sha256 { - var _: (data: Uint8Array) => string; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _sha256 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } export declare function legacySha256(data: BytesLike): string; export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string; /** - * Compute the cryptographic SHA2-512 hash of %%data%%. + * Compute the cryptographic SHA3-512 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -47,8 +49,9 @@ export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLik */ export declare function sha512(data: BytesLike): string; export declare namespace sha512 { - var _: (data: Uint8Array) => string; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _sha512 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/sha3.d.ts.map b/lib.esm/crypto/sha3.d.ts.map index 62d2f90aa..d71f0360e 100644 --- a/lib.esm/crypto/sha3.d.ts.map +++ b/lib.esm/crypto/sha3.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAqB,MAAM,kBAAkB,CAAC;AAgC1E;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAYjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAU9C;yBAVe,MAAM;;;;;AAYtB,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIpD;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACd,MAAM,CAkBR;AAcD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAU9C;yBAVe,MAAM"} \ No newline at end of file +{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAqB,MAAM,kBAAkB,CAAC;AAM1E,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AACvD,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AAOvD;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,kBAAkB;IAC7B,MAAM,WAAW;IACjB,MAAM,WAAW;CACjB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAkCX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI;;AAlCxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIpD;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR;AAcD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAGX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI"} \ No newline at end of file diff --git a/lib.esm/crypto/sha3.js b/lib.esm/crypto/sha3.js index e8b7c001b..951d632ff 100644 --- a/lib.esm/crypto/sha3.js +++ b/lib.esm/crypto/sha3.js @@ -3,27 +3,13 @@ import { arrayify, getBytes, hexlify } from "../utils/data.js"; import { createHash, createHmac } from "./crypto.js"; import { Buffer } from "buffer"; const logger = new Logger("sha3/0.0.1"); -const _sha256 = function (data) { - let v = "0x" + - createHash("sha3-256") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - return v; -}; -const _sha512 = function (data) { - let v = "0x" + - createHash("sha3-512") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - return v; -}; -// @ts-ignore +const _sha256 = (data) => hexlify(createHash("sha3-256").update(data).digest()); +const _sha512 = (data) => hexlify(createHash("sha3-512").update(data).digest()); let __sha256 = _sha256; -// @ts-ignore let __sha512 = _sha512; let locked256 = false, locked512 = false; /** - * Compute the cryptographic SHA2-256 hash of %%data%%. + * Compute the cryptographic SHA3-256 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -45,27 +31,10 @@ export var SupportedAlgorithm; SupportedAlgorithm["sha512"] = "sha512"; })(SupportedAlgorithm || (SupportedAlgorithm = {})); export function ripemd160(data) { - let createdHash = "0x" + - createHash("ripemd160") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; + return hexlify(createHash("ripemd160").update(getBytes(data)).digest()); } export function sha256(data) { - let createdHash = createHash("sha3-256") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; + return hexlify(__sha256(getBytes(data))); } export function legacySha256(data) { const _data = getBytes(data, "data"); @@ -76,10 +45,10 @@ export function computeHmac(algorithm, key, data) { const d = Buffer.from(arrayify(data)); const k = Buffer.from(arrayify(key)); if (algorithm === SupportedAlgorithm.sha256) { - return "0x" + createHmac("sha3-256", k).update(d).digest("hex"); + return hexlify(createHmac("sha3-256", k).update(d).digest()); } else if (algorithm === SupportedAlgorithm.sha512) { - return "0x" + createHmac("sha3-512", k).update(d).digest("hex"); + return hexlify(createHmac("sha3-512", k).update(d).digest()); } logger.throwError("unsupported algorithm - " + algorithm, Logger.errors.UNSUPPORTED_OPERATION, { operation: "computeHmac", @@ -99,7 +68,7 @@ sha256.register = function (func) { }; Object.freeze(sha256); /** - * Compute the cryptographic SHA2-512 hash of %%data%%. + * Compute the cryptographic SHA3-512 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -115,15 +84,7 @@ Object.freeze(sha256); * //_result: */ export function sha512(data) { - let createdHash = createHash("sha3-512") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; + return hexlify(__sha512(getBytes(data))); } sha512._ = _sha512; sha512.lock = function () { @@ -135,5 +96,5 @@ sha512.register = function (func) { } __sha512 = func; }; -Object.freeze(sha256); +Object.freeze(sha512); //# sourceMappingURL=sha3.js.map \ No newline at end of file diff --git a/lib.esm/crypto/sha3.js.map b/lib.esm/crypto/sha3.js.map index f88ea2a25..f79f699fe 100644 --- a/lib.esm/crypto/sha3.js.map +++ b/lib.esm/crypto/sha3.js.map @@ -1 +1 @@ -{"version":3,"file":"sha3.js","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAa,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC;AAExC,MAAM,OAAO,GAAG,UAAU,IAAgB;IACxC,IAAI,CAAC,GACH,IAAI;QACJ,UAAU,CAAC,UAAU,CAAC;aACnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;aACnC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,UAAU,IAAgB;IACxC,IAAI,CAAC,GACH,IAAI;QACJ,UAAU,CAAC,UAAU,CAAC;aACnB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;aACnC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,CAAC,CAAC;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AC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG;IACb,SAAS,GAAG,IAAI,CAAC;AAClB,CAAC,CAAC;AACF,MAAM,CAAC,QAAQ,GAAG,UAAU,IAAqC;IAChE,IAAI,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;IACD,QAAQ,GAAG,IAAI,CAAC;AACjB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/signature.d.ts.map b/lib.esm/crypto/signature.d.ts.map index 83d7e9f37..cf72d7bd1 100644 --- a/lib.esm/crypto/signature.d.ts.map +++ b/lib.esm/crypto/signature.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcjE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,SAAS;;IAMpB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAGrB;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAUtB;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAEf;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,YAAY,EAIxB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,IAAI,GAAG,MAAM,CAE5B;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,IAAI,GAAG,MAAM,CAMnC;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAOxB;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;gBACS,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE;IAYxD;;OAEG;IACH,KAAK,IAAI,SAAS;IAQlB;;OAEG;IACH,MAAM,IAAI,GAAG;IAWb;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM;IAc5C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM;IAIjE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE;CAwBhD"} \ No newline at end of file +{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcjE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,SAAS;;IAMrB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAGrB;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAUtB;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAEf;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,YAAY,EAIxB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,IAAI,GAAG,MAAM,CAE5B;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,IAAI,GAAG,MAAM,CAMnC;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAOxB;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAMvD;IAMD;;OAEG;IACH,KAAK,IAAI,SAAS,CAMjB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CASZ;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAY3C;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM,CAEhE;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE,CAc9C;CAUD"} \ No newline at end of file diff --git a/lib.esm/crypto/signature.js.map b/lib.esm/crypto/signature.js.map index 6e14c4119..934189994 100644 --- a/lib.esm/crypto/signature.js.map +++ b/lib.esm/crypto/signature.js.map @@ -1 +1 @@ -{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,cA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CAAC;QAEjD,sDAAsD;QACtD,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,CAAC;CAUD"} \ No newline at end of file diff --git a/lib.esm/crypto/signing-key.d.ts b/lib.esm/crypto/signing-key.d.ts index a030dac26..3ce0c2ea0 100644 --- a/lib.esm/crypto/signing-key.d.ts +++ b/lib.esm/crypto/signing-key.d.ts @@ -19,73 +19,17 @@ export declare class SigningKey { * The private key. */ get privateKey(): string; - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ + /** The 57-byte Ed448 public key encoded as hex. */ get publicKey(): string; - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ + /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ get compressedPublicKey(): string; /** * Return the signature of the signed %%digest%%. */ sign(digest: BytesLike): string; - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ + /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ computeSharedSecret(other: BytesLike): string; - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ + /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ static computePublicKey(key: BytesLike, compressed?: boolean): string; /** * Returns the public key for the private key which produced the @@ -106,16 +50,7 @@ export declare class SigningKey { * */ static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string; - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ + /** Adds two encoded Ed448 public points. The compression flag is ignored. */ static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string; } //# sourceMappingURL=signing-key.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/signing-key.d.ts.map b/lib.esm/crypto/signing-key.d.ts.map index b5aea9127..1185a52a8 100644 --- a/lib.esm/crypto/signing-key.d.ts.map +++ b/lib.esm/crypto/signing-key.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAYhD;;;GAGG;AACH,qBAAa,UAAU;;IAGrB;;OAEG;gBACS,UAAU,EAAE,SAAS;IAcjC;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;;;;OAKG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;;;;OAMG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM;IAmC/B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAU7C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;IAkBrE;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM;IAqB5E;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;CAS7E"} \ No newline at end of file +{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD;;;GAGG;AACH,qBAAa,UAAU;;IAGtB;;OAEG;IACH,YAAY,UAAU,EAAE,SAAS,EAYhC;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,mDAAmD;IACnD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,sEAAsE;IACtE,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAiC9B;IAED,uGAAuG;IACvG,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAgB5C;IAED,gGAAgG;IAChG,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAgBpE;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAmB3E;IAED,6EAA6E;IAC7E,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAY3E;CACD"} \ No newline at end of file diff --git a/lib.esm/crypto/signing-key.js b/lib.esm/crypto/signing-key.js index 2c80bace6..7b3a9cd7c 100644 --- a/lib.esm/crypto/signing-key.js +++ b/lib.esm/crypto/signing-key.js @@ -3,15 +3,12 @@ * * @_subsection: api/crypto:Signing [about-signing] */ -import * as secp256k1 from "@noble/secp256k1"; -import { dataLength, getBytes, getBytesCopy, hexlify, assertArgument, } from "../utils/index.js"; +import { dataLength, getBytesCopy, hexlify, assertArgument, } from "../utils/index.js"; import { arrayify, hexConcat } from "../utils/data.js"; import { Logger } from "../logger/logger.js"; import { ed448 } from "./crypto.js"; import { Buffer } from "buffer"; const logger = new Logger("signing-key/0.0.1"); -//const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -// Make noble-secp256k1 sync /** * A **SigningKey** provides high-level access to the elliptic curve * cryptography (ECC) operations and key management. @@ -22,12 +19,11 @@ export class SigningKey { * Creates a new **SigningKey** for %%privateKey%%. */ constructor(privateKey) { - let tmp = privateKey; - if (typeof tmp === "string" && tmp.startsWith("0x")) { - tmp = tmp.replace("0x", ""); - } - assertArgument(dataLength("0x" + tmp) === 57, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify("0x" + tmp); + const normalized = typeof privateKey === "string" && !privateKey.startsWith("0x") + ? "0x" + privateKey + : privateKey; + assertArgument(dataLength(normalized) === 57, "invalid private key", "privateKey", "[REDACTED]"); + this.#privateKey = hexlify(normalized); } /** * The private key. @@ -35,22 +31,11 @@ export class SigningKey { get privateKey() { return this.#privateKey; } - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ + /** The 57-byte Ed448 public key encoded as hex. */ get publicKey() { return SigningKey.computePublicKey(this.#privateKey); } - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ + /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ get compressedPublicKey() { return SigningKey.computePublicKey(this.#privateKey, true); } @@ -85,57 +70,20 @@ export class SigningKey { const hexlified = hexlify(sig); return hexConcat([hexlified, this.publicKey]); } - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ + /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ computeSharedSecret(other) { - const pubKey = SigningKey.computePublicKey(other); - return hexlify(secp256k1.getSharedSecret(getBytesCopy(this.#privateKey), getBytes(pubKey))); + const pub = Buffer.from(getBytesCopy(other)); + assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), "invalid public key", "other", other); + const key = Buffer.from(getBytesCopy(this.#privateKey)); + if (key[56] > 127) { + const scalar = key.subarray(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + return hexlify(ed448.deriveWithScalar(pub, scalar)); + } + return hexlify(ed448.derive(pub, key)); } - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ + /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ static computePublicKey(key, compressed) { const bytes = Buffer.from(arrayify(key)); if (bytes.length !== 57) { @@ -184,20 +132,14 @@ export class SigningKey { logger.throwArgumentError("invalid signature", "signature", signature); return ""; } - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ + /** Adds two encoded Ed448 public points. The compression flag is ignored. */ static addPoints(p0, p1, compressed) { - const pub0 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p0).substring(2)); - const pub1 = secp256k1.ProjectivePoint.fromHex(SigningKey.computePublicKey(p1).substring(2)); - return "0x" + pub0.add(pub1).toHex(!!compressed); + const points = [p0, p1].map((point) => { + const bytes = Buffer.from(getBytesCopy(point)); + assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), "invalid public key", "point", point); + return bytes; + }); + return hexlify(ed448.publicKeyCombine(points)); } } //# sourceMappingURL=signing-key.js.map \ No newline at end of file diff --git a/lib.esm/crypto/signing-key.js.map b/lib.esm/crypto/signing-key.js.map index 833310939..bc7673ee6 100644 --- a/lib.esm/crypto/signing-key.js.map +++ b/lib.esm/crypto/signing-key.js.map @@ -1 +1 @@ -{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;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AAC,KAAK,CAAC,EACnD,oBAAoB,EACpB,OAAO,EACP,KAAK,CACL,CAAC;YACF,OAAO,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAChD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/hash/id.js.map b/lib.esm/hash/id.js.map index a49ed54d7..1ed001302 100644 --- a/lib.esm/hash/id.js.map +++ b/lib.esm/hash/id.js.map @@ -1 +1 @@ -{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,EAAE,CAAC,KAAa,EAAE,SAAmB;IACnD,IAAI,SAAS,EAAE;QACb,OAAO,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;KACtC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;AACpC,CAAC"} \ No newline at end of file +{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,EAAE,CAAC,KAAa,EAAE,SAAmB;IACpD,IAAI,SAAS,EAAE,CAAC;QACf,OAAO,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/lib.esm/hash/message.d.ts.map b/lib.esm/hash/message.d.ts.map index 76c7dfa70..8c0421a97 100644 --- a/lib.esm/hash/message.d.ts.map +++ b/lib.esm/hash/message.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAWhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAGR"} \ No newline at end of file +{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAWhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,GACZ,MAAM,CAGR"} \ No newline at end of file diff --git a/lib.esm/hash/message.js.map b/lib.esm/hash/message.js.map index e1e6e7853..8a4f8edf6 100644 --- a/lib.esm/hash/message.js.map +++ b/lib.esm/hash/message.js.map @@ -1 +1 @@ -{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAiB,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;IACtD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;KAChC;IACD,OAAO,MAAM,CACX,MAAM,CAAC;QACL,WAAW,CAAC,aAAa,CAAC;QAC1B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO;KACR,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,OAA4B,EAC5B,GAAkB,EAClB,MAAc;IAEd,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC7C,CAAC"} \ No newline at end of file +{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAiB,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;IACvD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,MAAM,CACZ,MAAM,CAAC;QACN,WAAW,CAAC,aAAa,CAAC;QAC1B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO;KACP,CAAC,CACF,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC5B,OAA4B,EAC5B,GAAkB,EAClB,MAAc;IAEd,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/lib.esm/hash/solidity.d.ts.map b/lib.esm/hash/solidity.d.ts.map index 251b44140..8a06af8f2 100644 --- a/lib.esm/hash/solidity.d.ts.map +++ b/lib.esm/hash/solidity.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACzB,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACzB,MAAM,CAER"} \ No newline at end of file +{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAER"} \ No newline at end of file diff --git a/lib.esm/hash/solidity.js.map b/lib.esm/hash/solidity.js.map index 717efa4cf..c91bdab97 100644 --- a/lib.esm/hash/solidity.js.map +++ b/lib.esm/hash/solidity.js.map @@ -1 +1 @@ -{"version":3,"file":"solidity.js","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACT,MAAM,EACN,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACpD,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAEtD,SAAS,KAAK,CAAC,IAAY,EAAE,KAAU,EAAE,OAAiB;IACxD,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,IAAI,OAAO,EAAE;gBACX,OAAO,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;aAC1C;YACD,OAAO,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;QACrC,KAAK,QAAQ;YACX,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,KAAK,OAAO;YACV,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;QACzB,KAAK,MAAM;YACT,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;YAClC,IAAI,OAAO,EAAE;gBACX,OAAO,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC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B;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC7B,KAA4B,EAC5B,MAA0B;IAE1B,cAAc,CACb,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAC9B,oDAAoD,EACpD,QAAQ,EACR,MAAM,CACN,CAAC;IAEF,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,KAAK,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,KAAK;QAClC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CACnC,KAA4B,EAC5B,MAA0B;IAE1B,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/lib.esm/hash/typed-data.d.ts.map b/lib.esm/hash/typed-data.d.ts.map index fc4135d06..27a189723 100644 --- a/lib.esm/hash/typed-data.d.ts.map +++ b/lib.esm/hash/typed-data.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"typed-data.d.ts","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAYjE,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAChC,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IA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,GACxB,MAAM,CAMR;IAED,MAAM,CAAC,IAAI,CACV,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,MAAM,CAER;IAGD,OAAa,YAAY,CACxB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAC5C,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC,CAoDlD;IAED,MAAM,CAAC,UAAU,CAChB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,GAAG,CAiEL;CACD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,MAAM,CAMR"} \ No newline at end of file diff --git a/lib.esm/hash/typed-data.js.map b/lib.esm/hash/typed-data.js.map index c7200f018..6c922f01b 100644 --- a/lib.esm/hash/typed-data.js.map +++ b/lib.esm/hash/typed-data.js.map @@ -1 +1 @@ -{"version":3,"file":"typed-data.js","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAAA,O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C,EAC3C,SAAS,EACT,MAAM,CACP,CAAC;AACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"typed-data.js","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACN,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,WAAW,EACX,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,EACN,YAAY,EACZ,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAEhB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,cAAc,GAAG,MAAM,CAC5B,oEAAoE,CACpE,CAAC;AAeF,SAAS,WAAW,CAAC,KAAgB;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC;IACpC,IAAI,SAAS,EAAE,CAAC;QACf,OAAO,MAAM,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAW,CAAC;IAC5D,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAA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,IAAI,EAAE,CAAC;oBACd,KAAK,SAAS;wBACb,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;oBAC5B,KAAK,MAAM;wBACV,OAAO,CAAC,CAAC,KAAK,CAAC;oBAChB,KAAK,QAAQ;wBACZ,cAAc,CACb,OAAO,KAAK,KAAK,QAAQ,EACzB,gBAAgB,EAChB,OAAO,EACP,KAAK,CACL,CAAC;wBACF,OAAO,KAAK,CAAC;gBACf,CAAC;gBAED,cAAc,CAAC,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;YACzD,CAAC,CAAC;SACF,CAAC;IACH,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC9B,MAAuB,EACvB,KAA4C,EAC5C,KAA0B,EAC1B,SAAiB,EACjB,MAAc;IAEd,OAAO,cAAc,CACpB,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,EAC3C,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/lib.esm/ipfs/index.d.ts b/lib.esm/ipfs/index.d.ts new file mode 100644 index 000000000..e1bf33eb0 --- /dev/null +++ b/lib.esm/ipfs/index.d.ts @@ -0,0 +1,18 @@ +export declare const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; +export interface IpfsGatewayOptions { + template?: string; + maxResponseBytes?: number; + timeoutMs?: number; + fetch?: typeof globalThis.fetch; +} +/** Configurable IPFS resolution and bounded JSON loading. */ +export declare class IpfsGateway { + #private; + readonly template: string; + readonly maxResponseBytes: number; + readonly timeoutMs: number; + constructor(options?: IpfsGatewayOptions); + resolve(reference: string): URL; + readJson(reference: string): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/ipfs/index.d.ts.map b/lib.esm/ipfs/index.d.ts.map new file mode 100644 index 000000000..baabf24dc --- /dev/null +++ b/lib.esm/ipfs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/ipfs/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CAChC;AACD,6DAA6D;AAC7D,qBAAa,WAAW;;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,YAAY,OAAO,GAAE,kBAAuB,EAgB3C;IACD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAe9B;IACK,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0ClD;CACD"} \ No newline at end of file diff --git a/lib.esm/ipfs/index.js b/lib.esm/ipfs/index.js new file mode 100644 index 000000000..52692a400 --- /dev/null +++ b/lib.esm/ipfs/index.js @@ -0,0 +1,73 @@ +export const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; +/** Configurable IPFS resolution and bounded JSON loading. */ +export class IpfsGateway { + template; + maxResponseBytes; + timeoutMs; + #fetch; + constructor(options = {}) { + this.template = options.template ?? defaultIpfsGatewayTemplate; + this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024; + this.timeoutMs = options.timeoutMs ?? 30_000; + this.#fetch = options.fetch ?? globalThis.fetch; + const templateUrl = new URL(this.template.replace("{cid}", "cid")); + if (!/^https?:$/.test(templateUrl.protocol) || + this.template.split("{cid}").length !== 2) + throw new TypeError("gateway template must be HTTP(S) and contain one {cid}"); + for (const value of [this.maxResponseBytes, this.timeoutMs]) + if (!Number.isSafeInteger(value) || value <= 0) + throw new TypeError("gateway limits must be positive safe integers"); + } + resolve(reference) { + const value = reference.trim(); + if (/^https?:\/\//i.test(value)) + return new URL(value); + const path = value.replace(/^ipfs:\/\//, "").replace(/^\/?ipfs\//, ""); + if (!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path) || + path.split("/").some((part) => part === "." || part === "..")) + throw new TypeError("invalid IPFS reference"); + return new URL(this.template.replace("{cid}", path.split("/").map(encodeURIComponent).join("/"))); + } + async readJson(reference) { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), this.timeoutMs); + let reader; + try { + const response = await this.#fetch(this.resolve(reference), { + headers: { accept: "application/json" }, + signal: controller.signal, + }); + if (!response.ok) { + await response.body?.cancel(); + throw new Error(`IPFS gateway returned HTTP ${response.status}`); + } + if (!response.body) + throw new Error("IPFS gateway returned an empty body"); + reader = response.body.getReader(); + const chunks = []; + let length = 0; + while (true) { + const { done, value } = await reader.read(); + if (done) + break; + length += value.length; + if (length > this.maxResponseBytes) + throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`); + chunks.push(value); + } + const bytes = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + bytes.set(chunk, offset); + offset += chunk.length; + } + return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)); + } + finally { + clearTimeout(timer); + await reader?.cancel().catch(() => { }); + reader?.releaseLock(); + } + } +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/ipfs/index.js.map b/lib.esm/ipfs/index.js.map new file mode 100644 index 000000000..c4d8fd221 --- /dev/null +++ b/lib.esm/ipfs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/ipfs/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAOjE,6DAA6D;AAC7D,MAAM,OAAO,WAAW;IACd,QAAQ,CAAS;IACjB,gBAAgB,CAAS;IACzB,SAAS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iB,EAAE,CAAC;YAChC,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,OAAO,IAAI,EAAE,CAAC;gBACb,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;gBAC5C,IAAI,IAAI;oBAAE,MAAM;gBAChB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;gBACvB,IAAI,MAAM,GAAG,IAAI,CAAC,gBAAgB;oBACjC,MAAM,IAAI,KAAK,CACd,yBAAyB,IAAI,CAAC,gBAAgB,QAAQ,CACtD,CAAC;gBACH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;YACD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;YACrC,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC5B,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;YACxB,CAAC;YACD,OAAO,IAAI,CAAC,KAAK,CAChB,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;QACH,CAAC;gBAAS,CAAC;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YACvC,MAAM,EAAE,WAAW,EAAE,CAAC;QACvB,CAAC;IACF,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/logger/logger.d.ts.map b/lib.esm/logger/logger.d.ts.map index f1ca4504f..1880f0d16 100644 --- a/lib.esm/logger/logger.d.ts.map +++ b/lib.esm/logger/logger.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","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,EAAE,GAAG,GAAG,KAAK,CAKnE;IAED,MAAM,CACL,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,SAAS,EAChB,MAAM,CAAC,EAAE,GAAG,GACV,IAAI,CAKN;IAED,cAAc,CACb,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,GACR,IAAI,CAKN;IAED,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAcrC;IAED,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAwBrD;IAED,kBAAkB,CACjB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CA4BN;IAED,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAMrC;IAED,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAc1C;IAED,MAAM,CAAC,YAAY,IAAI,MAAM,CAK5B;IAED,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CA0BnE;IAED,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAO3C;IAED,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnC;CACD"} \ No newline at end of file diff --git a/lib.esm/logger/logger.js.map b/lib.esm/logger/logger.js.map index 179f9e643..d92d0abf6 100644 --- a/lib.esm/logger/logger.js.map +++ b/lib.esm/logger/logger.js.map @@ -1 +1 @@ -{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src.ts/logger/logger.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,sBAAsB,GAAG,K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AAC;QACH,CAAC;QAED,aAAa,GAAG,CAAC,CAAC,UAAU,CAAC;QAC7B,sBAAsB,GAAG,CAAC,CAAC,SAAS,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,QAAkB;QACpC,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAChD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,sBAAsB,GAAG,QAAQ,CAAC,CAAC;YAC9D,OAAO;QACR,CAAC;QACD,SAAS,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,OAAe;QAC1B,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/package.json b/lib.esm/package.json index 04a5cfd61..e10f33ed2 100644 --- a/lib.esm/package.json +++ b/lib.esm/package.json @@ -1,12 +1,13 @@ { - "browser": { - "./crypto/crypto.js": "./crypto/crypto-browser.js", - "./providers/provider-ipcsocket.js": "./providers/provider-ipcsocket-browser.js", - "./providers/ws.js": "./providers/ws-browser.js", - "./utils/base64.js": "./utils/base64-browser.js", - "./utils/geturl.js": "./utils/geturl-browser.js", - "./wordlists/wordlists.js": "./wordlists/wordlists-browser.js" - }, - "sideEffects": false, - "type": "module" + "type": "module", + "sideEffects": false, + "browser": { + "./crypto/crypto.js": "./crypto/crypto-browser.js", + "./providers/provider-ipcsocket.js": "./providers/provider-ipcsocket-browser.js", + "./providers/ws.js": "./providers/ws-browser.js", + "./utils/base64.js": "./utils/base64-browser.js", + "./utils/geturl.js": "./utils/geturl-browser.js", + "./crypto/ed448goldilock.js": "./crypto/ed448goldilock-browser.js", + "./wordlists/wordlists.js": "./wordlists/wordlists-browser.js" + } } diff --git a/lib.esm/providers/abstract-provider.d.ts.map b/lib.esm/providers/abstract-provider.d.ts.map index ca3a7ea53..b293b4e8f 100644 --- a/lib.esm/providers/abstract-provider.d.ts.map +++ b/lib.esm/providers/abstract-provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAaL,YAAY,EAOb,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAEL,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,QAAQ,EACR,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,kBAAkB,EACnB,MAAM,eAAe,CAAC;AA2CvB,MAAM,MAAM,0BAA0B,GAClC;IACE,MAAM,EAAE,0BAA0B,CAAC;IACnC,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,GACD;IACE,MAAM,EAAE,4BAA4B,CAAC;IACrC,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,GAAG,CAAC;CACb,GACD;IACE,MAAM,EAAE,2BAA2B,CAAC;IACpC,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,GAA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AE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBxD,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpE,cAAc,CAClB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,IAAI,CAAC;IAMhB,OAAO,IAAI,IAAI;IAUf,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAUxB;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IA+BtC,MAAM,IAAI,IAAI;CAqBf"} \ No newline at end of file +{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAaN,YAAY,EAOZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAEN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACX,QAAQ,EACR,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,MAAM,eAAe,CAAC;AA2CvB,MAAM,MAAM,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KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWhE;IAEK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWlE;IAEK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBtE;IAEK,aAAa,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAc1D;IAEK,SAAS,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAa/D;IAEK,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBlE;IAEK,kBAAkB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB7D;IAGK,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;IAGK,cAAc,CACnB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;IAID,OAAO,IAAI,IAAI,CAQd;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAUxB;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CA6BrC;IAED,MAAM,IAAI,IAAI,CAoBb;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/abstract-provider.js b/lib.esm/providers/abstract-provider.js index 52658839f..a1ba76591 100644 --- a/lib.esm/providers/abstract-provider.js +++ b/lib.esm/providers/abstract-provider.js @@ -485,7 +485,7 @@ export class AbstractProvider { } const networkPromise = this.#networkPromise; const [expected, actual] = await Promise.all([ - networkPromise, + networkPromise, // Possibly an explicit Network this._detectNetwork(), // The actual connected network ]); if (expected.networkId !== actual.networkId) { @@ -582,7 +582,7 @@ export class AbstractProvider { action: "call", data, reason: "OffchainLookup", - transaction: transaction, + transaction: transaction, // @TODO: populate data? invocation: null, revert: { signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", diff --git a/lib.esm/providers/abstract-provider.js.map b/lib.esm/providers/abstract-provider.js.map index bedba9197..b5f87199f 100644 --- a/lib.esm/providers/abstract-provider.js.map +++ b/lib.esm/providers/abstract-provider.js.map @@ -1 +1 @@ -{"version":3,"file":"abstract-provider.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,oBAAoB;AACpB,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,SAAS,EACT,MAAM,EACN,cAAc,EACd,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,WAAW,EACX,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,sBA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,KAAK,EAAE;QACd,MAAM,CAAC,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE;YAClE,MAAM,EAAE,kCAAkC;SAC3C,CAAC,CAAC;KACJ;IAED,MAAM,CAAC,SAAS,GAAG,yCAAyC;SACzD,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAO,MAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhC,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"abstract-provider.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,oBAAoB;AACpB,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,SAAS,EACT,MAAM,EACN,cAAc,EACd,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACN,WAAW,EACX,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AA4BjC,MAAM,kB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C1B,CAAC;QACD,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,CAAC,KAAK,EAAE,iCAAiC,EAAE,gBAAgB,EAAE;YAClE,MAAM,EAAE,iCAAiC;SACzC,CAAC,CAAC;IACJ,CAAC;IAED,oCAAoC;IACpC,MAAM,CACL,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EACrD,0CAA0C,EAC1C,gBAAgB,EAChB;QACC,MAAM,EAAE,0CAA0C;KAClD,CACD,CAAC;IACF,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;IAE3C,6DAA6D;IAC7D,IAAI,CAAC;QACJ,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzC,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QACD,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,CAAC,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE;YACnE,MAAM,EAAE,kCAAkC;SAC1C,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,SAAS,GAAG,yCAAyC;SAC1D,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAO,MAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/B,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/abstract-signer.d.ts.map b/lib.esm/providers/abstract-signer.d.ts.map index 41b30b933..35aaa1ca6 100644 --- a/lib.esm/providers/abstract-signer.d.ts.map +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AAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpE,QAAQ,CAAC,aAAa,CACrB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;CACnB;AAED,qBAAa,UAAW,SAAQ,cAAc;;IAC7C,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAE1B,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,EAGtD;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAE7C;IAQK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/abstract-signer.js.map b/lib.esm/providers/abstract-signer.js.map index bbc9565e9..6f0de6379 100644 --- a/lib.esm/providers/abstract-signer.js.map +++ b/lib.esm/providers/abstract-signer.js.map @@ -1 +1 @@ -{"version":3,"file":"abstract-signer.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,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,CAAC,EAAE,CAAC,CAAC;QAC/C,OAAO,GAAG,CAAC,IAAI,CAAC;QAChB,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,MAAM,QAAQ,CAAC,oBAAoB,CACxC,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAClC,CAAC;IACJ,CAAC;CASF;AAED,MAAM,OAAO,UAAW,SAAQ,cAAc;IACnC,OAAO,CAAU;IAE1B,YAAY,OAAe,EAAE,QAA0B;QACrD,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,gBAAgB,CAAa,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,OAAO,CAAC,QAAyB;QAC/B,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChD,CAAC;IAED,iBAAiB,CAAC,MAAc,EAAE,SAAiB;QACjD,MAAM,CAAC,KAAK,EAAE,0BAA0B,MAAM,EAAE,EAAE,uBAAuB,EAAE;YACzE,SAAS;SACV,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAsB;QAC1C,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAA4B;QAC5C,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;QAE1B,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACxD,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"abstract-signer.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mapp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AK,CAAC,aAAa,CAClB,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;QAE1B,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACvD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/community.d.ts.map b/lib.esm/providers/community.d.ts.map index f8a2a68bc..e36ebbacf 100644 --- a/lib.esm/providers/community.d.ts.map +++ b/lib.esm/providers/community.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAChC;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA4BzD"} \ No newline at end of file +{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAC/B;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA4BzD"} \ No newline at end of file diff --git a/lib.esm/providers/community.js.map b/lib.esm/providers/community.js.map index 8dbe2326d..10fc9a9d6 100644 --- a/lib.esm/providers/community.js.map +++ b/lib.esm/providers/community.js.map @@ -1 +1 @@ -{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;QACtB,OAAO;KACR;IACD,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CACT,6BAA6B,OAAO,sCAAsC,CAC3E,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACT,2EAA2E,CAC5E,CAAC;IACF,OAAO,CAAC,GAAG,CACT,oEAAoE,CACrE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACT,yEAAyE,CAC1E,CAAC;IACF,OAAO,CAAC,GAAG,CACT,wEAAwE,CACzE,CAAC;IACF,OAAO,CAAC,GAAG,CACT,+EAA+E,CAChF,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"} \ No newline at end of file +{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IAClD,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,OAAO;IACR,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CACV,6BAA6B,OAAO,sCAAsC,CAC1E,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACV,2EAA2E,CAC3E,CAAC;IACF,OAAO,CAAC,GAAG,CACV,oEAAoE,CACpE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACV,yEAAyE,CACzE,CAAC;IACF,OAAO,CAAC,GAAG,CACV,wEAAwE,CACxE,CAAC;IACF,OAAO,CAAC,GAAG,CACV,+EAA+E,CAC/E,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/contracts.d.ts.map b/lib.esm/providers/contracts.d.ts.map index 085cff0c7..29a278289 100644 --- a/lib.esm/providers/contracts.d.ts.map +++ b/lib.esm/providers/contracts.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAG1B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7D,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAGvD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC5E"} \ No newline at end of file +{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAG1B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7D,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAGvD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC3E"} \ No newline at end of file diff --git a/lib.esm/providers/default-provider.d.ts.map b/lib.esm/providers/default-provider.d.ts.map index a7b02c6c0..6e1d55294 100644 --- a/lib.esm/providers/default-provider.d.ts.map +++ b/lib.esm/providers/default-provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAC5C,OAAO,CAAC,EAAE,GAAG,GACZ,gBAAgB,CA6FlB"} \ No newline at end of file +{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxD,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAC5C,OAAO,CAAC,EAAE,GAAG,GACX,gBAAgB,CA6FlB"} \ No newline at end of file diff --git a/lib.esm/providers/default-provider.js b/lib.esm/providers/default-provider.js index 11ac97df6..d915d748c 100644 --- a/lib.esm/providers/default-provider.js +++ b/lib.esm/providers/default-provider.js @@ -64,20 +64,20 @@ export function getDefaultProvider(network, options) { } } /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } - */ + if (options.pocket !== "-") { + try { + let appId = options.pocket; + let secretKey: undefined | string = undefined; + let loadBalancer: undefined | boolean = undefined; + if (typeof(appId) === "object") { + loadBalancer = !!appId.loadBalancer; + secretKey = appId.secretKey; + appId = appId.appId; + } + providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); + } catch (error) { console.log(error); } + } +*/ if (options.quicknode !== "-") { try { let token = options.quicknode; diff --git a/lib.esm/providers/default-provider.js.map b/lib.esm/providers/default-provider.js.map index f38d5acf6..bd6f81316 100644 --- a/lib.esm/providers/default-provider.js.map +++ b/lib.esm/providers/default-provider.js.map @@ -1 +1 @@ -{"version":3,"file":"default-provider.js","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,wDAAwD;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,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O,SAAS,CAAC,CAAC,CAAC,CAAC;KACrB;IAED,OAAO,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC"} \ No newline at end of file +{"version":3,"file":"default-provider.js","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,wDAAwD;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAM5D,SAAS,eAAe,CAAC,KAAU;IAClC,OAAO,CACN,KAAK;QACL,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;QAChC,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU,CACjC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CACjC,OAA4C,EAC5C,OAAa;IAEb,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,GAAG,EAAE,CAAC;IACd,CAAC;IAED,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9D,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,IACC,CAAC,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxD,eAAe,CAAC,OAAO,CA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SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;YACjC,CAAC;YACD,SAAS,CAAC,IAAI,CAAC,IAAI,cAAc,CAAC,OAAO,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC;QACvE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;IACD;;;;;;;;;;;;;;EAcC;IACD,IAAI,OAAO,CAAC,SAAS,KAAK,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC;YACJ,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC;YAC9B,SAAS,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;QACvD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;IAED,MAAM,CACL,SAAS,CAAC,MAAM,EAChB,6BAA6B,EAC7B,uBAAuB,EACvB;QACC,SAAS,EAAE,oBAAoB;KAC/B,CACD,CAAC;IAEF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/format.d.ts.map b/lib.esm/providers/format.d.ts.map index da5b2ee35..1c35b4b35 100644 --- a/lib.esm/providers/format.d.ts.map +++ b/lib.esm/providers/format.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAIzB,MAAM,MAAM,UAAU,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AS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAOzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAOtD;AAKD,wBAAgB,MAAM,CACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GACtC,UAAU,CA+BZ;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAejD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAG7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAmBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAE/C;AAoBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,CAWnD;AAkBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAEtD;AA6BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,wBAAwB,CAE7E;AAED,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,GAAG,GACR,yBAAyB,CA0G3B"} \ No newline at end of file diff --git a/lib.esm/providers/format.js b/lib.esm/providers/format.js index 5e3f5cd93..7c55b0fc2 100644 --- a/lib.esm/providers/format.js +++ b/lib.esm/providers/format.js @@ -209,38 +209,38 @@ export function formatTransactionResponse(value) { } // @TODO: check networkId /* - if (value.networkId != null) { - let networkId = value.networkId; - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - result.networkId = networkId; - - } else { - let networkId = value.networkId; - - // geth-etc returns networkId - if (networkId == null && result.v == null) { - networkId = value.networkId; - } - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - if (typeof(networkId) !== "number" && result.v != null) { - networkId = (result.v - 35) / 2; - if (networkId < 0) { networkId = 0; } - networkId = parseInt(networkId); - } - - if (typeof(networkId) !== "number") { networkId = 0; } - - result.networkId = networkId; - } - */ + if (value.networkId != null) { + let networkId = value.networkId; + + if (isHexString(networkId)) { + networkId = BigNumber.from(networkId).toNumber(); + } + + result.networkId = networkId; + + } else { + let networkId = value.networkId; + + // geth-etc returns networkId + if (networkId == null && result.v == null) { + networkId = value.networkId; + } + + if (isHexString(networkId)) { + networkId = BigNumber.from(networkId).toNumber(); + } + + if (typeof(networkId) !== "number" && result.v != null) { + networkId = (result.v - 35) / 2; + if (networkId < 0) { networkId = 0; } + networkId = parseInt(networkId); + } + + if (typeof(networkId) !== "number") { networkId = 0; } + + result.networkId = networkId; + } + */ // 0x0000... should actually be null if (result.blockHash && getBigInt(result.blockHash) === BN_0) { result.blockHash = null; diff --git a/lib.esm/providers/format.js.map b/lib.esm/providers/format.js.map index a2c3b85a5..d729ddee2 100644 --- a/lib.esm/providers/format.js.map +++ b/lib.esm/providers/format.js.map @@ -1 +1 @@ -{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACL,SAAS,EACT,SAAS,EACT,OAAO,EACP,WAAW,EACX,YAAY,EACZ,MAAM,EACN,cAAc,GACf,MAAM,mBAAmB,CAAC;AAS3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAIvB,MAAM,UAAU,SAAS,CAAC,MAAkB,EAAE,SAAe;IAC3D,OAAO,UAAU,KAAU;QACzB,IAAI,KAAK,IAA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CAAC;KAC3C;IAED,wBAAwB;IACxB,IAAI,KAAK,CAAC,SAAS,EAAE;QACnB,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;KACpC;SAAM;QACL,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC;KAC1B;IAED,6EAA6E;IAC7E,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE;QAC5B,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;QACnD,IAAI,SAAS,IAAI,IAAI,EAAE;YACrB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;SAC9B;KACF;IAED,yBAAyB;IACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAgCI;IAEJ,oCAAoC;IACpC,IAAI,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QAC5D,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;KACzB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACN,SAAS,EACT,SAAS,EACT,OAAO,EACP,WAAW,EACX,YAAY,EACZ,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAS3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAIvB,MAAM,UAAU,SAAS,CAAC,MAAkB,EAAE,SAAe;IAC5D,OAAO,UAAU,KAAU;QAC1B,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,OAAO,SAAS,CAAC;QAClB,CAAC;QACD,OAAO,MAAM,C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CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;QACjD,MAAM,CAAC,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,wBAAwB;IACxB,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACrB,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IACpC,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,6EAA6E;IAC7E,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;QACnD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QAC9B,CAAC;IACF,CAAC;IAED,yBAAyB;IACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCK;IAEL,oCAAoC;IACpC,IAAI,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9D,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/formatting.d.ts.map b/lib.esm/providers/formatting.d.ts.map index 65b377ed3..5d7ddfb6b 100644 --- a/lib.esm/providers/formatting.d.ts.map +++ b/lib.esm/providers/formatting.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwDH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK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;AAmBD,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CACnB"} \ No newline at end of file +{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwDH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;IAEhC,YAAY,EAAE,aAAa,CAAC,MAAM,GAAG,yBAAyB,CAAC,CAAC;CAChE;AAKD,MAAM,WAAW,SAAS;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,EAAE,MAAM,CAAC;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,SAAS,EAAE,MAAM,CAAC;CAClB"} \ No newline at end of file diff --git a/lib.esm/providers/index.d.ts.map b/lib.esm/providers/index.d.ts.map index 206142646..25fe43a45 100644 --- a/lib.esm/providers/index.d.ts.map +++ b/lib.esm/providers/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,GAEZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBA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ACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EACN,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACX,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,YAAY,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GACzB,MAAM,iBAAiB,CAAC;AAWzB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,YAAY,EACX,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,wBAAwB,GACxB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,yBAAyB,EACzB,eAAe,GACf,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE/E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/index.js.map b/lib.esm/providers/index.js.map index ffbe9183d..a3f1db64e 100644 --- a/lib.esm/providers/index.js.map +++ b/lib.esm/providers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBA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ACL,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,WAAW;AACX,4BAA4B;EAC5B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,aAAa,GACb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC,CAAC,YAAY;AACzE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EACN,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/network.d.ts.map b/lib.esm/providers/network.d.ts.map index a62904576..639456c16 100644 --- a/lib.esm/providers/network.d.ts.map +++ b/lib.esm/providers/network.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAiBN,qBAAa,OAAO;;gBAMN,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY;IAMjD,MAAM,IAAI,GAAG;IAIb;;;;;OAKG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,EAEhC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IAmCnC;;OAEG;IACH,IAAI,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,CAElC;IAED;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAQzC;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC;IAI1E;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAChD,QAAQ,EAAE,MAAM,GACf,KAAK,CAAC,CAAC,CAAC;IAMX;;OAEG;IACH,KAAK,IAAI,OAAO;IAQhB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM;IAuBnD;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO;IAyD1C;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACb,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,WAAW,EAAE,MAAM,OAAO,GACzB,IAAI;CAeR"} \ No newline at end of file +{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GACnB,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN;IACA,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBL,qBAAa,OAAO;;IAMnB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAIhD;IAED,MAAM,IAAI,GAAG,CAEZ;IAED;;;;;OAKG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,EAEhC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAiClC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,CAElC;IAED;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAMxC;IAED;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,CAEzE;IAED;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EACjD,QAAQ,EAAE,MAAM,GACd,KAAK,CAAC,CAAC,CAAC,CAIV;IAED;;OAEG;IACH,KAAK,IAAI,OAAO,CAMf;IAED;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,CAqBlD;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAuDzC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,WAAW,EAAE,MAAM,OAAO,GACxB,IAAI,CAcN;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/network.js.map b/lib.esm/providers/network.js.map index c22eeb2e6..5f4096dc5 100644 --- a/lib.esm/providers/network.js.map +++ b/lib.esm/providers/network.js.map @@ -1 +1 @@ -{"version":3,"file":"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\ No newline at end of file diff --git a/lib.esm/providers/pagination.d.ts.map b/lib.esm/providers/pagination.d.ts.map index 5479c9c0a..8ff265391 100644 --- a/lib.esm/providers/pagination.d.ts.map +++ b/lib.esm/providers/pagination.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACnD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACf"} \ No newline at end of file +{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACpD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACd"} \ No newline at end of file diff --git a/lib.esm/providers/plugin-fallback.d.ts.map b/lib.esm/providers/plugin-fallback.d.ts.map index 6d2023762..d639bafb3 100644 --- a/lib.esm/providers/plugin-fallback.d.ts.map +++ b/lib.esm/providers/plugin-fallback.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,wBAAwB,gDACU,CAAC;AAEhD,qBAAa,oBAAqB,YAAW,sBAAsB;IACzD,IAAI,EAAE,MAAM,CAAC;;IAQrB,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB;IAMzD,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAGhE;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACvE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAWhE"} \ No newline at end of file +{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,wBAAwB,gDACS,CAAC;AAE/C,qBAAa,oBAAqB,YAAW,sBAAsB;IAC1D,IAAI,EAAE,MAAM,CAAC;IAErB,cAIC;IAED,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB,CAExD;IAID,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAE9D;CACD;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACxE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAU9D;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/plugin-fallback.js.map b/lib.esm/providers/plugin-fallback.js.map index 14309ecb9..14ef61e5a 100644 --- a/lib.esm/providers/plugin-fallback.js.map +++ b/lib.esm/providers/plugin-fallback.js.map @@ -1 +1 @@ -{"version":3,"file":"plugin-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOrD,MAAM,CAAC,MAAM,wBAAwB,GACnC,6CAA6C,CAAC;AAEhD,MAAM,OAAO,oBAAoB;IAG/B;QACE,gBAAgB,CAAuB,IAAI,EAAE;YAC3C,IAAI,EAAE,wBAAwB;SAC/B,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,QAA0B;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,gEAAgE;IAChE,2BAA2B;IAC3B,WAAW,CAAC,MAA4B,EAAE,MAAW;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,MAAM,OAAO,+BAAgC,SAAQ,oBAAoB;IACvE,WAAW,CAAC,MAA4B,EAAE,MAAW;QACnD,IACE,MAAM,CAAC,MAAM,KAAK,gBAAgB;YAClC,MAAM,CAAC,MAAM,KAAK,uBAAuB,EACzC;YACA,IAAI,MAAM,IAAI,IAAI,EAAE;gBAClB,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"plugin-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOrD,MAAM,CAAC,MAAM,wBAAwB,GACpC,6CAA6C,CAAC;AAE/C,MAAM,OAAO,oBAAoB;IAGhC;QACC,gBAAgB,CAAuB,IAAI,EAAE;YAC5C,IAAI,EAAE,wBAAwB;SAC9B,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,QAA0B;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,gEAAgE;IAChE,2BAA2B;IAC3B,WAAW,CAAC,MAA4B,EAAE,MAAW;QACpD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAED,MAAM,OAAO,+BAAgC,SAAQ,oBAAoB;IACxE,WAAW,CAAC,MAA4B,EAAE,MAAW;QACpD,IACC,MAAM,CAAC,MAAM,KAAK,gBAAgB;YAClC,MAAM,CAAC,MAAM,KAAK,uBAAuB,EACxC,CAAC;YACF,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACpB,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;QACD,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/plugins-network.d.ts.map b/lib.esm/providers/plugins-network.d.ts.map index 7c9b9b3c7..bcea34835 100644 --- a/lib.esm/providers/plugins-network.d.ts.map +++ b/lib.esm/providers/plugins-network.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"plugins-network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvD,qBAAa,aAAa;IACxB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM;IAIxB,KAAK,IAAI,aAAa;CAOvB;AAKD,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,qBAAa,gBACX,SAAQ,aACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,cAAc,EAAG,MAAM,CAAC;IAEjC,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,sBA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AAC,UAAU,EAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,sBAAsB,EAAG,MAAM,CAAC;IACzC,QAAQ,CAAC,mBAAmB,EAAG,MAAM,CAAC;IAEtC,YAAY,cAAc,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,oBAAoB,EA6BhE;IAED,KAAK,IAAI,gBAAgB,CAExB;CACD;AAED,qBAAa,oBAAqB,SAAQ,aAAa;;IAGtD,IAAI,WAAW,IAAI,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,CAE1D;IAED,YAAY,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,EAGhE;IAEK,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAErD;IAED,KAAK,IAAI,oBAAoB,CAE5B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/plugins-network.js.map b/lib.esm/providers/plugins-network.js.map index 4f149be02..e9043abcf 100644 --- a/lib.esm/providers/plugins-network.js.map +++ b/lib.esm/providers/plugins-network.js.map @@ -1 +1 @@ -{"version":3,"file":"plugins-network.js","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,MAAM,OAAO,aAAa;IACf,IAAI,CAAU;IAEvB,YAAY,IAAY;QACtB,gBAAgB,CAAgB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,KAAK;QACH,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CAKF;AAcD,MAAM,OAAO,gBACX,SAAQ,aAAa;IAGZ,cAAc,CAAU;IAExB,MAAM,C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I,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,YAAY,WAAqD;QAC/D,KAAK,CAAC,oCAAoC,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAAkB;QACjC,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK;QACH,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACrD,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;EAiBE"} \ No newline at end of file +{"version":3,"file":"plugins-network.js","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,MAAM,OAAO,aAAa;IAChB,IAAI,CAAU;IAEvB,YAAY,IAAY;QACvB,gBAAgB,CAAgB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CAKD;AAcD,MAAM,OAAO,gBACZ,SAAQ,aAAa;IAGZ,cAAc,CAAU;IAExB,MAAM,CAAU;IAChB,QAAQ,CAAU;IAClB,UAAU,CAAU;IACpB,aAAa,CAAU;IACvB,sBAAsB,CAAU;IAChC,mBAAmB,CAAU;IAEtC,YAAY,cAAuB,EAAE,KAA4B;QAChE,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;YAC5B,cAAc,GAAG,CAAC,CAAC;QACpB,CAAC;QACD,KAAK,CAAC,yCAAyC,cAAc,IAAI,CAAC,EAAE,CAAC,CAAC;QAEtE,MAAM,KAAK,GAA2B,EAAE,cAAc,EAAE,CAAC;QACzD,SAAS,GAAG,CAAC,IAAgC,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;CACD;AAED;;;;;;;;;;;;;;;;;EAiBE"} \ No newline at end of file diff --git a/lib.esm/providers/provider-alchemy.d.ts.map b/lib.esm/providers/provider-alchemy.d.ts.map index f2eec176b..4e4c121cd 100644 --- a/lib.esm/providers/provider-alchemy.d.ts.map +++ b/lib.esm/providers/provider-alchemy.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKL,YAAY,EACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;;;GAUG;AACH,qBAAa,eACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAezD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAO3C,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IA2CvD,mBAAmB,IAAI,OAAO;IAI9B,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY;CAmBnE"} \ No newline at end of file +{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKN,YAAY,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;;;GAUG;AACH,qBAAa,eACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAaxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAEK,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,CAyCtD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAkBjE;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-alchemy.js.map b/lib.esm/providers/provider-alchemy.js.map index 4b801874e..d556e0836 100644 --- a/lib.esm/providers/provider-alchemy.js.map +++ b/lib.esm/providers/provider-alchemy.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,cAAc,EACd,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,C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,KAAK,EAAE,KAAK;aACb,CAAC,CAAC;SACJ;QAED,OAAO,MAAM,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,MAAe;QACjD,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,GAAG,aAAa,CAAC;SACxB;QAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC9B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,MAAM,EAAE,CACjD,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE;YAC5B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACvD,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,cAAc,EACd,YAAY,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AASxD,MAAM,aAAa,GAAG,kCAAkC,CAAC;AAEzD,SAAS,OAAO,CAAC,IAAY;IAC5B,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,SAAS;YACb,OAAO,2BAA2B,CAAC;QACpC,KAAK,Q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,CAAC,CAAC;IAClC,CAAC;IAED,mBAAmB;QAClB,OAAO,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,MAAe;QAClD,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACpB,MAAM,GAAG,aAAa,CAAC;QACxB,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC/B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,MAAM,EAAE,CAChD,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE,CAAC;YAC9B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACxD,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAC/B,OAAO,IAAI,CAAC;YACb,CAAC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-ankr.d.ts.map b/lib.esm/providers/provider-ankr.d.ts.map index 45cfc5423..d0704e281 100644 --- a/lib.esm/providers/provider-ankr.d.ts.map +++ b/lib.esm/providers/provider-ankr.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,M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,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAgBxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAkBxE;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAY/D;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-ankr.js.map b/lib.esm/providers/provider-ankr.js.map index 57ac6a154..86a5019e3 100644 --- a/lib.esm/providers/provider-ankr.js.map +++ b/lib.esm/providers/provider-ankr.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-ankr.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxD,MAAM,aAAa,GACjB,kEAAkE,CAAC;AAErE,SAAS,OAAO,CAAC,IAAY;IAC3B,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,kBAAkB,CAAC;QAC5B,KAAK,QAAQ;YACX,OAAO,yBAAyB,CAAC;QACnC,KAAK,OAAO;YACV,OAAO,sBAAsB,CAAC;QAChC,KAAK,UAAU;YACb,OAAO,uBAAuB,CAAC;KAClC;IAED,cAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC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KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACvD,mBAAmB,CAAC,cAAc,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,WAAW,CAAC,OAAuB,EAAE,KAAmB;QACtD,IAAI,OAAO,CAAC,MAAM,KAAK,wBAAwB,EAAE;YAC/C,IACE,KAAK;gBACL,KAAK,CAAC,KAAK;gBACX,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,+CAA+C,EACvE;gBACA,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,qCAAqC,CAAC;aAC7D;SACF;QAED,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC;IACvC,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-ankr.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxD,MAAM,aAAa,GAClB,kEAAkE,CAAC;AAEpE,SAAS,OAAO,CAAC,IAAY;IAC5B,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,SAAS;YACb,OAAO,kBAAkB,CAAC;QAC3B,KAAK,QAAQ;YACZ,OAAO,yBAAyB,CAAC;QAClC,KAAK,OAAO;YACX,OAAO,sBAAsB,CAAC;QAC/B,KAAK,UAAU;YACd,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,cAAc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AI,MAAM,EAAE,CAC7C,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,MAAM,KAAK,aAAa,EAAE,CAAC;YAC9B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACxD,mBAAmB,CAAC,cAAc,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YACb,CAAC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,OAAuB,EAAE,KAAmB;QACvD,IAAI,OAAO,CAAC,MAAM,KAAK,wBAAwB,EAAE,CAAC;YACjD,IACC,KAAK;gBACL,KAAK,CAAC,KAAK;gBACX,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,+CAA+C,EACtE,CAAC;gBACF,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,qCAAqC,CAAC;YAC7D,CAAC;QACF,CAAC;QAED,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,mBAAmB;QAClB,OAAO,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC;IACtC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-browser.d.ts.map b/lib.esm/providers/provider-browser.d.ts.map index cf224c60e..890c4678c 100644 --- a/lib.esm/providers/provider-browser.d.ts.map +++ b/lib.esm/providers/provider-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,eAAe;I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AK,CAe/D;IAEK,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAc1D;IAEK,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiBjE;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-browser.js.map b/lib.esm/providers/provider-browser.js.map index fd4f140d8..531343e04 100644 --- a/lib.esm/providers/provider-browser.js.map +++ b/lib.esm/providers/provider-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AA+BlE,MAAM,OAAO,eAAgB,SAAQ,yBAAyB;IAC5D,QAAQ,CAGU;IAElB,YAAY,IAAqB,EAAE,OAAoB;QACrD,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,KAAK,EACnB,MAAc,EACd,MAAwC,EACxC,EAAE;YACF,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC3C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC/D,OAAO,MAAM,CAAC;aACf;YAAC,OAAO,CAAM,EAAE;gBACf,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CA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7B;YAAC,OAAO,KAAU,EAAE;gBACnB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;gBAC9B,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;aAC5D;SACF;QAED,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AA+BlE,MAAM,OAAO,eAAgB,SAAQ,yBAAyB;IAC7D,QAAQ,CAGU;IAElB,YAAY,IAAqB,EAAE,OAAoB;QACtD,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,KAAK,EACpB,MAAc,EACd,MAAwC,EACvC,EAAE;YACH,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,IAAI,CAAC;gBACJ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC3C,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC/D,OAAO,MAAM,CAAC;YACf,CAAC;YAAC,OAAO,CAAM,EAAE,CAAC;gBACjB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAC7B,KAAM,CAAC,IAA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BAAqB,EAAE,EAAE,CAAC,CAAC;gBAC/C,4BAA4B;YAC7B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACrB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;gBAC9B,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5D,CAAC;QACF,CAAC;QAED,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-cloudflare.d.ts.map b/lib.esm/providers/provider-cloudflare.d.ts.map index e70790a60..8dbb47f78 100644 --- a/lib.esm/providers/provider-cloudflare.d.ts.map +++ b/lib.esm/providers/provider-cloudflare.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;gBACzC,QAAQ,CAAC,EAAE,UAAU;CAalC"} \ No newline at end of file +{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACtD,YAAY,QAAQ,CAAC,EAAE,UAAU,EAYhC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-cloudflare.js.map b/lib.esm/providers/provider-cloudflare.js.map index faa23f6e1..182374d83 100644 --- a/lib.esm/providers/provider-cloudflare.js.map +++ b/lib.esm/providers/provider-cloudflare.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACrD,YAAY,QAAqB;QAC/B,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,SAAS,CAAC;SACtB;QACD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,cAAc,CACZ,OAAO,CAAC,IAAI,KAAK,SAAS,EAC1B,qBAAqB,EACrB,SAAS,EACT,QAAQ,CACT,CAAC;QACF,KAAK,CAAC,6BAA6B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACtD,YAAY,QAAqB;QAChC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,SAAS,CAAC;QACtB,CAAC;QACD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,cAAc,CACb,OAAO,CAAC,IAAI,KAAK,SAAS,EAC1B,qBAAqB,EACrB,SAAS,EACT,QAAQ,CACR,CAAC;QACF,KAAK,CAAC,6BAA6B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-fallback.d.ts.map b/lib.esm/providers/provider-fallback.d.ts.map index 16b3b607f..95bda52bd 100644 --- a/lib.esm/providers/provider-fallback.d.ts.map +++ b/lib.esm/providers/provider-fallback.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiC/C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAErC,QAAQ,EAAE,gBAAgB,CAAC;IAI3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD;;GAEG;AACH,MAAM,WAAW,qBACf,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IAExC,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,cAAc,EAAE,MAAM,CAAC;IAGvB,aAAa,EAAE,MAAM,CAAC;IAGtB,SAAS,EAAE,MAAM,CAAC;IAGlB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,eAAe,EAAE,MAAM,CAAC;IAGxB,KAAK,EAAE,MAAM,CAAC;CACf;AAsCD;;GAEG;AACH,MAAM,MA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map index cd73d69c1..ac840f3d2 100644 --- a/lib.esm/providers/provider-fallback.js.map +++ b/lib.esm/providers/provider-fallback.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,SAAS,EACT,SAAS,EACT,MAAM,EACN,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKvC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAEzB,SAAS,OAAO,CAAU,KAAe;IACvC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;KAChB;AACH,CAAC;AAED,SAAS,KAAK,CAAC,QAAgB;IAC7B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,OAAO;IACd,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,SAAS,CAAC,KAAU;IAC3B,OAAO,IAAI,C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,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;aACxD,CACF,CAAC;YACF,IAAI,MAAM,YAAY,KAAK,EAAE;gBAC3B,MAAM,MAAM,CAAC;aACd;YACD,OAAO,MAAM,CAAC;SACf;QAED,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAE1B,0CAA0C;QAC1C,MAAM,OAAO,GAAqB,IAAI,GAAG,EAAE,CAAC;QAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;SAC/B;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAEvD,mDAAmD;QACnD,oDAAoD;QACpD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;gBAC3C,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;aAC/B;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,OAAO;QACX,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE;YACxC,QAAQ,CAAC,OAAO,EAAE,CAAC;SACpB;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,SAAS,EACT,SAAS,EACT,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKvC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IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC;QACpB,CAAC;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-infura.d.ts.map b/lib.esm/providers/provider-infura.d.ts.map index cc3baf59e..2d942d185 100644 --- a/lib.esm/providers/provider-infura.d.ts.map +++ b/lib.esm/providers/provider-infura.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAEL,YAAY,EAGb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;GAQG;AACH,qBAAa,uBACX,SAAQ,iBACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBACS,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM;IAoBpD,mBAAmB,IAAI,OAAO;CAG/B;AAED;;;;;;;;GAQG;AACH,qBAAa,cACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBAED,QAAQ,CAAC,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM;IAuB/B,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAOjD,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,MAAM,CAAC,oBAAoB,CACzB,OAAO,CAAC,EAAE,UAAU,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,uBAAuB;IAI1B;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC5B,YAAY;CAyBhB"} \ No newline at end of file +{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAEN,YAAY,EAGZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;GAQG;AACH,qBAAa,uBACZ,SAAQ,iBACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,YAAY,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,EAkBnD;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD;AAED;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAqB7B;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAC1B,OAAO,CAAC,EAAE,UAAU,EACpB,SAAS,CAAC,EAAE,MAAM,GAChB,uBAAuB,CAEzB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC3B,YAAY,CAwBd;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-infura.js.map b/lib.esm/providers/provider-infura.js.map index 7e20ecc38..f81e5ad3a 100644 --- a/lib.esm/providers/provider-infura.js.map +++ b/lib.esm/providers/provider-infura.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,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AC,CAAC;SAC1E;QAAC,OAAO,KAAK,EAAE,GAAE;QAClB,OAAO,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,SAAS,KAAK,gBAAgB,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB,CACzB,OAAoB,EACpB,SAAkB;QAElB,OAAO,IAAI,uBAAuB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACzD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAgB,EAChB,SAAyB,EACzB,aAA6B;QAE7B,IAAI,SAAS,IAAI,IAAI,EAAE;YACrB,SAAS,GAAG,gBAAgB,CAAC;SAC9B;QACD,IAAI,aAAa,IAAI,IAAI,EAAE;YACzB,aAAa,GAAG,IAAI,CAAC;SACtB;QAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC9B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,SAAS,EAAE,CACpD,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,IAAI,aAAa,EAAE;YACjB,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;SAC3C;QAED,IAAI,SAAS,KAAK,gBAAgB,EAAE;YAClC,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACvD,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,cAAc,GACd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ib.esm/providers/provider-ipcsocket.d.ts b/lib.esm/providers/provider-ipcsocket.d.ts index a9ee3bfc9..9f92c9d4f 100644 --- a/lib.esm/providers/provider-ipcsocket.d.ts +++ b/lib.esm/providers/provider-ipcsocket.d.ts @@ -1,4 +1,4 @@ -/// +/// import { SocketProvider } from "./provider-socket.js"; import type { Socket } from "net"; import type { Networkish } from "./network.js"; diff --git a/lib.esm/providers/provider-ipcsocket.d.ts.map b/lib.esm/providers/provider-ipcsocket.d.ts.map index 91d6287d7..93bec7dd7 100644 --- a/lib.esm/providers/provider-ipcsocket.d.ts.map +++ b/lib.esm/providers/provider-ipcsocket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB/C,qBAAa,iBAAkB,SAAQ,cAAc;;IAEnD,IAAI,MAAM,IAAI,MAAM,CAEnB;gBAEW,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU;IA8B9C,OAAO,IAAI,IAAI;IAOT,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C"} \ No newline at end of file +{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB/C,qBAAa,iBAAkB,SAAQ,cAAc;;IAEpD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EA+B7C;IAED,OAAO,IAAI,IAAI,CAKd;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-ipcsocket.js b/lib.esm/providers/provider-ipcsocket.js index fc2401006..cb9f9035b 100644 --- a/lib.esm/providers/provider-ipcsocket.js +++ b/lib.esm/providers/provider-ipcsocket.js @@ -1,3 +1,4 @@ +/// import { connect } from "net"; import { SocketProvider } from "./provider-socket.js"; // @TODO: Is this sufficient? Is this robust? Will newlines occur between @@ -34,7 +35,10 @@ export class IpcSocketProvider extends SocketProvider { }); let response = Buffer.alloc(0); this.socket.on("data", (data) => { - response = Buffer.concat([response, data]); + response = Buffer.concat([ + response, + typeof data === "string" ? Buffer.from(data) : data, + ]); const { messages, remaining } = splitBuffer(response); messages.forEach((message) => { this._processMessage(message); diff --git a/lib.esm/providers/provider-ipcsocket.js.map b/lib.esm/providers/provider-ipcsocket.js.map index 8095f3bf5..da850b822 100644 --- a/lib.esm/providers/provider-ipcsocket.js.map +++ b/lib.esm/providers/provider-ipcsocket.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-ipcsocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,yEAAyE;AACzE,0CAA0C;AAC1C,SAAS,WAAW,CAAC,IAAY;IAI/B,MAAM,QAAQ,GAAkB,EAAE,CAAC;IAEnC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,OAAO,IAAI,EAAE;QACX,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC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AO,CAAC,CAAC;YAChC,CAAC,CAAC,CAAC;YACH,QAAQ,GAAG,SAAS,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACzB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAElB,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-ipcsocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,yEAAyE;AACzE,0CAA0C;AAC1C,SAAS,WAAW,CAAC,IAAY;IAIhC,MAAM,QAAQ,GAAkB,EAAE,CAAC;IAEnC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,OAAO,IAAI,EAAE,CAAC;QACb,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;YACf,MAAM;QACP,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,EAA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OAAO,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;YACH,QAAQ,GAAG,SAAS,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAElB,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-jsonrpc.d.ts.map b/lib.esm/providers/provider-jsonrpc.d.ts.map index 5e8ed8fa0..0635f491a 100644 --- a/lib.esm/providers/provider-jsonrpc.d.ts.map +++ b/lib.esm/providers/provider-jsonrpc.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAUL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOvC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAA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AC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACvC,OAAO,CAAC,GAAG,CAAC;IAST,KAAK,CACT,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC9C,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;CAgBjC"} \ No newline at end of file +{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAUN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOvC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACX,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuD1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,OAAO,EAAE,KAAK,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,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MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAgB3E;IAED;;;;;;;;;;;OAWG;IACG,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA8BjE;IAEK,YAAY,IAAI,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAGlD;CACD;AAED,8BAAsB,yBAA0B,SAAQ,kBAAkB;;IAEzE,YAAY,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB,EAIpE;IAED,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAM5C;IAED;;OAEG;IACH,IAAI,eAAe,IAAI,MAAM,CAE5B;IACD,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAUhC;CACD;AAED;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,yBAAyB;;IAG7D,YACC,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,EAC3B,OAAO,CAAC,EAAE,UAAU,EACpB,OAAO,CAAC,EAAE,yBAAyB,EAYnC;IAED,cAAc,IAAI,YAAY,CAE7B;IAEK,IAAI,CACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACtC,OAAO,CAAC,GAAG,CAAC,CAOd;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAe/B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-jsonrpc.js b/lib.esm/providers/provider-jsonrpc.js index e29e1c653..bb8dcca74 100644 --- a/lib.esm/providers/provider-jsonrpc.js +++ b/lib.esm/providers/provider-jsonrpc.js @@ -53,8 +53,8 @@ function isPollable(value) { const defaultOptions = { polling: false, staticNetwork: null, - batchStallTime: 10, - batchMaxSize: 1 << 20, + batchStallTime: 10, // 10ms + batchMaxSize: 1 << 20, // 1Mb batchMaxCount: 100, // 100 requests }; // @TODO: Unchecked Signers @@ -315,12 +315,12 @@ export class JsonRpcApiProvider extends AbstractProvider { return this.#network; } /* - { - assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { - operation: "jsonRpcApiProvider._send" - }); - } - */ + { + assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { + operation: "jsonRpcApiProvider._send" + }); + } + */ /** * Resolves to the non-normalized value by performing %%req%%. * diff --git a/lib.esm/providers/provider-jsonrpc.js.map b/lib.esm/providers/provider-jsonrpc.js.map index 41365ec80..e00e6340e 100644 --- a/lib.esm/providers/provider-jsonrpc.js.map +++ b/lib.esm/providers/provider-jsonrpc.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-jsonrpc.js","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS;AACT,yBAAyB;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,MAAM,EACN,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE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C,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;SACnD;QAAC,OAAO,KAAK,EAAE,GAAE;KACnB;AACH,CAAC;AAED,SAAS,cAAc,CAAC,KAAU;IAChC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"provider-jsonrpc.js","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS;AACT,yBAAyB;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACN,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,MAAM,EACN,cAAc,EACd,YAAY,EACZ,iBAAiB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACN,uBAAuB,EACvB,yBAAyB,GACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAiBjE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,SAAS,GAAG,8CAA8C,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7E,gDAAgD;AAChD,SAAS,QAAQ,CAAU,KAAQ;IAClC,IAAI,KAAK,IAAI,IAAI,IAAI,SAAS,CAAC,OAAO,CAA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ED,mDAAmD;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC;YACJ,OAAO,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;IACnB,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAED,SAAS,eAAe,CAAC,KAAU,EAAE,MAAqB;IACzD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO;IACR,CAAC;IAED,4CAA4C;IAC5C,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED,qBAAqB;IACrB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;YACzB,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;IAED,mDAAmD;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC;YACJ,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;QACnD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;IACnB,CAAC;AACF,CAAC;AAED,SAAS,cAAc,CAAC,KAAU;IACjC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/provider-pocket.d.ts.map b/lib.esm/providers/provider-pocket.d.ts.map index fc500ed76..aaf617488 100644 --- a/lib.esm/providers/provider-pocket.d.ts.map +++ b/lib.esm/providers/provider-pocket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB/C;;;;;;;;GAQG;AACH,qBAAa,cACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;gBAED,QAAQ,CAAC,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM;IA4BnC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAWjD;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAChC,YAAY;IAwBf,mBAAmB,IAAI,OAAO;CAG/B"} \ No newline at end of file +{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB/C;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,EA0BjC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAShD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAC/B,YAAY,CAsBd;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-pocket.js.map b/lib.esm/providers/provider-pocket.js.map index 2212d4b8b..7b691e676 100644 --- a/lib.esm/providers/provider-pocket.js.map +++ b/lib.esm/providers/provider-pocket.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-pocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE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iBAAiB;SAClB,CAAC,CAAC;IACL,CAAC;IAED,YAAY,CAAC,SAAiB;QAC5B,IAAI;YACF,OAAO,IAAI,cAAc,CACvB,SAAS,EACT,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,iBAAiB,CACvB,CAAC;SACH;QAAC,OAAO,KAAK,EAAE,GAAE;QAClB,OAAO,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAgB,EAChB,aAA6B,EAC7B,iBAAiC;QAEjC,IAAI,aAAa,IAAI,IAAI,EAAE;YACzB,aAAa,GAAG,oBAAoB,CAAC;SACtC;QAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC9B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,aAAa,EAAE,CAC3D,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,iBAAiB,EAAE;YACrB,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;SAC/C;QAED,IAAI,aAAa,KAAK,oBAAoB,EAAE;YAC1C,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACvD,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,aAAa,KAAK,oBAAoB,CAAC;IACrD,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-pocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MA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C,gBAAgB,CAAiB,IAAI,EAAE;YACtC,aAAa;YACb,iBAAiB;SACjB,CAAC,CAAC;IACJ,CAAC;IAED,YAAY,CAAC,SAAiB;QAC7B,IAAI,CAAC;YACJ,OAAO,IAAI,cAAc,CACxB,SAAS,EACT,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,iBAAiB,CACtB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;QAClB,OAAO,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAgB,EAChB,aAA6B,EAC7B,iBAAiC;QAEjC,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC3B,aAAa,GAAG,oBAAoB,CAAC;QACtC,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC/B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,aAAa,EAAE,CAC1D,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,iBAAiB,EAAE,CAAC;YACvB,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;QAC/C,CAAC;QAED,IAAI,aAAa,KAAK,oBAAoB,EAAE,CAAC;YAC5C,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACxD,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YACb,CAAC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,mBAAmB;QAClB,OAAO,IAAI,CAAC,aAAa,KAAK,oBAAoB,CAAC;IACpD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-quicknode.d.ts.map b/lib.esm/providers/provider-quicknode.d.ts.map index 8b27f9f9d..f3be4df32 100644 --- a/lib.esm/providers/provider-quicknode.d.ts.map +++ b/lib.esm/providers/provider-quicknode.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B/C;;;;;;;;GAQG;AACH,qBAAa,iBACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM;IAexD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAOjD,mBAAmB,IAAI,OAAO;IAI9B;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAoBzE"} \ No newline at end of file +{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B/C;;;;;;;;GAQG;AACH,qBAAa,iBACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,EAavD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAmBvE;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-quicknode.js.map b/lib.esm/providers/provider-quicknode.js.map index 67dd7e1a5..2bead724e 100644 --- a/lib.esm/providers/provider-quicknode.js.map +++ b/lib.esm/providers/provider-quicknode.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxD,MAAM,YAAY,GAAG,0CAA0C,CAAC;AAEhE,SAAS,OAAO,CAAC,IAAY;IAC3B,QAAQ,IAAI,EAAE;QACZ,KAAK,SAAS;YACZ,OAAO,qBAAqB,CAAC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AAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,KAAqB;QACvD,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,KAAK,GAAG,YAAY,CAAC;SACtB;QAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC9B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAC7C,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,mEAAmE;QAEnE,IAAI,KAAK,KAAK,YAAY,EAAE;YAC1B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACvD,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;gBACzC,OAAO,IAAI,CAAC;YACd,CAAC,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxD,MAAM,YAAY,GAAG,0CAA0C,CAAC;AAEhE,SAAS,OAAO,CAAC,IAAY;IAC5B,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,SAAS;YACb,OAAO,qBAAqB,CAAC;QAE9B,KAAK,UAAU;YACd,OAAO,sCAAsC,CAAC;QAC/C,KAAK,iBAAiB;YACrB,OAAO,qCAAqC,CAAC;QAC9C,KAAK,OAAO;YACX,OAAO,2BAA2B,CAAC;QACpC,KAAK,cAAc;YAClB,OAAO,mCAA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B,KAAK,GAAG,YAAY,CAAC;QACtB,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC/B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAC5C,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,mEAAmE;QAEnE,IAAI,KAAK,KAAK,YAAY,EAAE,CAAC;YAC5B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACxD,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;gBACzC,OAAO,IAAI,CAAC;YACb,CAAC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-socket.d.ts.map b/lib.esm/providers/provider-socket.d.ts.map index bdbc5029a..e919560e4 100644 --- a/lib.esm/providers/provider-socket.d.ts.map +++ b/lib.esm/providers/provider-socket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-socket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU/C,qBAAa,gBAAiB,YAAW,UAAU;;IAIjD,IAAI,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAEvB;gBAOW,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC;IAQxD,KAAK,IAAI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EK,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACD;AAED,qBAAa,qBAAsB,SAAQ,gBAAgB;;IAE1D,IAAI,SAAS,IAAI,WAAW,CAE3B;IAED,YAAY,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAGxD;IAEK,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjE;CACD;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;;IAiBrD,YAAY,OAAO,CAAC,EAAE,UAAU,EAK/B;IAYD,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAkB5C;IAED,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI,CASvE;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAuB9C;IAkBK,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCpD;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-socket.js b/lib.esm/providers/provider-socket.js index 5c002948b..260c94e65 100644 --- a/lib.esm/providers/provider-socket.js +++ b/lib.esm/providers/provider-socket.js @@ -123,13 +123,13 @@ export class SocketProvider extends JsonRpcApiProvider { } // This value is only valid after _start has been called /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ + get _network(): Network { + if (this.#network == null) { + throw new Error("this shouldn't happen"); + } + return this.#network.clone(); + } + */ _getSubscriber(sub) { switch (sub.type) { case "close": @@ -175,18 +175,18 @@ export class SocketProvider extends JsonRpcApiProvider { } // Sub-classes must call this once they are connected /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ + async _start(): Promise { + if (this.#ready) { return; } + + for (const { payload } of this.#callbacks.values()) { + await this._write(JSON.stringify(payload)); + } + + this.#ready = (async function() { + await super._start(); + })(); + } + */ // Sub-classes must call this for each message async _processMessage(message) { const result = (JSON.parse(message)); diff --git a/lib.esm/providers/provider-socket.js.map b/lib.esm/providers/provider-socket.js.map index 05cc4e35a..53b04b7bc 100644 --- a/lib.esm/providers/provider-socket.js.map +++ b/lib.esm/providers/provider-socket.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-socket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAmB3D,MAAM,OAAO,gBAAgB;IAC3B,SAAS,CAAiB;IAE1B,OAAO,CAAS;IAChB,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAClC,CAAC;IAED,SAAS,CAAkC;IAC3C,OAAO,CAAiB;IAExB,YAAY,CAAuB;IAEnC,YAAY,QAAwB,EAAE,MAAkB;QACtD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CA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AM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-socket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAmB3D,MAAM,OAAO,gBAAgB;IAC5B,SAAS,CAAiB;IAE1B,OAAO,CAAS;IAChB,IAAI,MAAM;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,SAAS,CAAkC;IAC3C,OAAO,CAAiB;IAExB,YAAY,CAAuB;IAEnC,YAAY,QAAwB,EAAE,MAAkB;QACvD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS;aAC7B,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC;aAClC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YAClB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACzC,OAAO,QAAQ,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI;QACe,IAAI,CAAC,SAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YACn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I,CACR,OAAO,EACP,SAAS,CAAC,gCAAgC,EAAE,eAAe,EAAE;oBAC5D,UAAU,EAAE,YAAY;oBACxB,MAAM;iBACN,CAAC,CACF,CAAC;gBACF,OAAO;YACR,CAAC;YACD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAElC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;aAAM,IAAI,MAAM,CAAC,MAAM,KAAK,kBAAkB,EAAE,CAAC;YACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;YAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC5C,IAAI,UAAU,EAAE,CAAC;gBAChB,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACjD,CAAC;iBAAM,CAAC;gBACP,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;gBAC1C,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;oBACrB,OAAO,GAAG,EAAE,CAAC;oBACb,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;gBACtC,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACpC,CAAC;QACF,CAAC;IACF,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QAC3B,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACnD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-websocket.d.ts.map b/lib.esm/providers/provider-websocket.d.ts.map index a60b262ca..57f785f9c 100644 --- a/lib.esm/providers/provider-websocket.d.ts.map +++ b/lib.esm/providers/provider-websocket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-websocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9C,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IACjD,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD,qBAAa,iBAAkB,SAAQ,cAAc;;IAInD,IAAI,SAAS,IAAI,aAAa,CAK7B;gBAGC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,gBAAgB,EAC9C,OAAO,CAAC,EAAE,UAAU;IA8ChB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAO/B"} \ No newline at end of file +{"version":3,"file":"provider-websocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9C,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IACjD,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD,qBAAa,iBAAkB,SAAQ,cAAc;;IAIpD,IAAI,SAAS,IAAI,aAAa,CAK7B;IAED,YACC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,gBAAgB,EAC9C,OAAO,CAAC,EAAE,UAAU,EA4CpB;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAM7B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-websocket.js b/lib.esm/providers/provider-websocket.js index b984a7416..b0905e998 100644 --- a/lib.esm/providers/provider-websocket.js +++ b/lib.esm/providers/provider-websocket.js @@ -39,20 +39,20 @@ export class WebSocketProvider extends SocketProvider { this._processMessage(message.data); }; /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); + this.websocket.onclose = (event) => { + // @TODO: What event.code should we reconnect on? + const reconnect = false; + if (reconnect) { + this.pause(true); + if (this.#connect) { + this.#websocket = this.#connect(); + this.#websocket.onopen = ... + // @TODO: this requires the super class to rebroadcast; move it there } - }; - */ + this._reconnect(); + } + }; +*/ } async _write(message) { this.websocket.send(message); diff --git a/lib.esm/providers/provider-websocket.js.map b/lib.esm/providers/provider-websocket.js.map index 59ba33c17..4aca54fc4 100644 --- a/lib.esm/providers/provider-websocket.js.map +++ b/lib.esm/providers/provider-websocket.js.map @@ -1 +1 @@ -{"version":3,"file":"provider-websocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC,CAAC,YAAY;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAiBtD,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IACnD,QAAQ,CAA0B;IAElC,UAAU,CAAuB;IACjC,IAAI,SAAS;QACX,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;SACrC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,YACE,GAA8C,EAC9C,OAAoB;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;YAC3B,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE;gBACnB,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;YAC7B,CAAC,CAAC;YACF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;SACnC;aAAM,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;YACpC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;YACpB,IAAI,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC;SACzB;aAAM;YACL,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;SACvB;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE;YACjC,IAAI;gBACF,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;gBACpB,IAAI,CAAC,MAAM,EAAE,CAAC;aACf;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;gBACxD,sCAAsC;aACvC;QACH,CAAC,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,OAAyB,EAAE,EAAE;YACvD,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC,CAAC;QACF;;;;;;;;;;;;;;MAcF;IACA,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QAC1B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YAC3B,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;SACxB;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"provider-websocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC,CAAC,YAAY;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAiBtD,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IACpD,QAAQ,CAA0B;IAElC,UAAU,CAAuB;IACjC,IAAI,SAAS;QACZ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AM,CAAC,OAAe;QAC3B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;YAC7B,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACxB,CAAC;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider.d.ts.map b/lib.esm/providers/provider.d.ts.map index fdfa52655..5f7427dc0 100644 --- a/lib.esm/providers/provider.d.ts.map +++ b/lib.esm/providers/provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAE7C,OAAO,EACL,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAoBzB;;;GAGG;AACH,qBAAa,OAAO;IAClB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAG,IAAI,GAAG,MAAM,CAAC;gBAEzB,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM;IAMvC;;OAEG;IACH,MAAM,IAAI,GAAG;CAOd;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI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C,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD;;;OAGG;IACH,IAAI,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9C;;;;OAIG;IACH,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAKrE;;;;;;;OAOG;IACH,QAAQ,CACP,mBAAmB,EAAE,QAAQ,GAAG,MAAM,EACtC,WAAW,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;IAEzB;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,mBAAmB,CAAC,CAAC;IAElE;;;;;;OAMG;IACH,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAExE;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAK3D;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAKjE;;;OAGG;IAEH;;;OAGG;IACH,kBAAkB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAClD"} \ No newline at end of file diff --git a/lib.esm/providers/provider.js.map b/lib.esm/providers/provider.js.map index 495ffeeb3..c4b141597 100644 --- a/lib.esm/providers/provider.js.map +++ b/lib.esm/providers/provider.js.map @@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AAC;AACtD,CAAC;AAED,SAAS,8BAA8B,CAAC,EAIvC;IACC,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC;AAC5C,CAAC;AAED,SAAS,sBAAsB,CAAC,GAQ/B;IACC,OAAO;QACL,MAAM,EAAE,UAAU;QAClB,GAAG,EAAE;YACH,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACzC,KAAK,EAAE,GAAG,CAAC,KAAK;SACjB;KACF,CAAC;AACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,cAAc,EACd,OAAO,EACP,SAAS,GACT,MAAM,mBAAmB,CAAC;AAS3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAWvB,0BAA0B;AAE1B,SAAS,QAAQ,CAAI,KAA2B;IAC/C,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,SAAS,MAAM,CAAC,KAAoB;IACnC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC;AAED,0DAA0D;AAE1D;;;GAGG;AACH,MAAM,OAAO,OAAO;IACnB;;OAEG;IACM,WAAW,CAAiB;IAErC,YAAY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D,EAC5D,KAAgE;IAEhE,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;AACrD,CAAC;AAED,SAAS,8BAA8B,CAAC,EAIvC;IACA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,sBAAsB,CAAC,GAQ/B;IACA,OAAO;QACN,MAAM,EAAE,UAAU;QAClB,GAAG,EAAE;YACJ,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACzC,KAAK,EAAE,GAAG,CAAC,KAAK;SAChB;KACD,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/signer-noncemanager.d.ts.map b/lib.esm/providers/signer-noncemanager.d.ts.map index 9f69385c3..ccd407c82 100644 --- a/lib.esm/providers/signer-noncemanager.d.ts.map +++ b/lib.esm/providers/signer-noncemanager.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signer-noncemanager.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,YAAa,SAAQ,cAAc;;IAC9C,MAAM,EAAG,MAAM,CAAC;g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,GAAG,QAAQ,GAAG,YAAY,CAE/C;IAEK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAWnD;IAED,SAAS,IAAI,IAAI,CAEhB;IAED,KAAK,IAAI,IAAI,CAGZ;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAU1E;IAED,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvD;IAED,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzD;IAED,aAAa,CACZ,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/signer-noncemanager.js.map b/lib.esm/providers/signer-noncemanager.js.map index 03a4f51cb..a88f21093 100644 --- a/lib.esm/providers/signer-noncemanager.js.map +++ b/lib.esm/providers/signer-noncemanager.js.map @@ -1 +1 @@ -{"version":3,"file":"signer-noncemanager.js","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAYtD,MAAM,OAAO,YAAa,SAAQ,cAAc;IAC9C,MAAM,CAAU;IAEhB,aAAa,CAAyB;IACtC,MAAM,CAAS;IAEf,YAAY,MAAc;QACxB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,gBAAgB,CAAe,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC,aAAa,GAAG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;IAED,eAAe,CAAC,EAAsB;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,WAAW,CAAC,OAA4B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED,aAAa,CACX,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;QAE1B,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"signer-noncemanager.js","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAYtD,MAAM,OAAO,YAAa,SAAQ,cAAc;IAC/C,MAAM,CAAU;IAEhB,aAAa,CAAyB;IACtC,MAAM,CAAS;IAEf,YAAY,MAAc;QACzB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,gBAAgB,CAAe,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,UAAU;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IACjC,CAAC;IAED,OAAO,CAAC,QAAyB;QAChC,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAmB;QACjC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC5B,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,EAA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m/providers/signer.d.ts.map b/lib.esm/providers/signer.d.ts.map index 4dff87bbe..d5935e8bb 100644 --- a/lib.esm/providers/signer.d.ts.map +++ b/lib.esm/providers/signer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,WAAW,EAAE,cAAc,EAAE,YAAY;IACvE;;OAEG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IAK3C;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAK/C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvE;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAK9E;;;;;;;;;;;;;;OAcG;IACH,cAAc,CAAC,EAAE,EAAE,kBAA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,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-connection.d.ts.map b/lib.esm/providers/subscriber-connection.d.ts.map index 2f88c6893..baef99405 100644 --- a/lib.esm/providers/subscriber-connection.d.ts.map +++ b/lib.esm/providers/subscriber-connection.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAErD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;gBAQ9C,QAAQ,EAAE,qBAAqB;IAO3C,KAAK,IAAI,IAAI;IAiBb,IAAI,IAAI,IAAI;IAYZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAOtC,MAAM,IAAI,IAAI;CAGf"} \ No newline at end of file +{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAEtD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;IAQ3D,YAAY,QAAQ,EAAE,qBAAqB,EAK1C;IAED,KAAK,IAAI,IAAI,CAeZ;IAED,IAAI,IAAI,IAAI,CAUX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-connection.js.map b/lib.esm/providers/subscriber-connection.js.map index eb4860edb..111ace64a 100644 --- a/lib.esm/providers/subscriber-connection.js.map +++ b/lib.esm/providers/subscriber-connection.js.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkB9C;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IACpC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,QAAQ,CAAU;IAElB,SAAS,CAAgB;IAEzB,YAAY,QAA+B;QACzC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,KAAK;QACH,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,OAAO;SACR;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,MAAW,EAAE,EAAE;YACvE,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,OAAO,GACX,IAAI,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;YACjE,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE;gBAC3C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;aACjC;YACD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,OAAO;SACR;QACD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAC1B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;SACvB;IACH,CAAC;IAED,KAAK,CAAC,eAAyB;QAC7B,IAAI,eAAe,EAAE;YACnB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SACxB;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkB9C;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IACrC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,QAAQ,CAAU;IA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F,CAAC;IAED,KAAK,CAAC,eAAyB;QAC9B,IAAI,eAAe,EAAE,CAAC;YACrB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED,MAAM;QACL,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-filterid.d.ts.map b/lib.esm/providers/subscriber-filterid.d.ts.map index b2d81a26c..957e1320c 100644 --- a/lib.esm/providers/subscriber-filterid.d.ts.map +++ b/lib.esm/providers/subscriber-filterid.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,YAAW,UAAU;;gBAYvC,QAAQ,EAAE,kBAAkB;IAaxC,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU;IAkEhD,KAAK,IAAI,IAAI;IASb,IAAI,IAAI,IAAI;IAWZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAOtC,MAAM,IAAI,IAAI;CAGf;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;;gBAGjD,QAAQ,EAAE,kBAAkB,EAA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AE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;;IAG9D,YAAY,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAG5D;IAED,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAE/C;IAEK,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAG9D;IAEK,YAAY,CACjB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;CACD;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,kBAAkB;IAC1D,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D;IAEK,YAAY,CACjB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-filterid.js.map b/lib.esm/providers/subscriber-filterid.js.map index 066dc3391..e1ccb0808 100644 --- a/lib.esm/providers/subscriber-filterid.js.map +++ b/lib.esm/providers/subscriber-filterid.js.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAOjE,SAAS,IAAI,CAAC,GAAQ;IACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,kBAAkB;IAC7B,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ACrE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,QAA4B,EAC5B,OAAmB;QAEnB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;SAC1E;IACH,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,kBAAkB;IAC/D,KAAK,CAAC,UAAU,CAAC,QAA4B;QAC3C,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,QAA4B,EAC5B,OAAmB;QAEnB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;SAClC;IACH,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAOjE,SAAS,IAAI,CAAC,GAAQ;IACrB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,kBAAkB;IAC9B,SAAS,CAAqB;IAE9B,gBAAgB,CAAyB;IACzC,OAAO,CAA+B;IAEtC,QAAQ,CAAU;IAElB,QAAQ,CAAiB;IAEzB,MAAM,CAAU;IAEhB,YAAY,QAA4B;QACvC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,gBAAg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AAC;IAED,KAAK,CAAC,YAAY,CACjB,QAA4B,EAC5B,OAAmB;QAEnB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC1E,CAAC;IACF,CAAC;CACD;AAED;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,kBAAkB;IAChE,KAAK,CAAC,UAAU,CAAC,QAA4B;QAC5C,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,YAAY,CACjB,QAA4B,EAC5B,OAAmB;QAEnB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-polling.d.ts.map b/lib.esm/providers/subscriber-polling.d.ts.map index 9082a53d0..9fd6aa7aa 100644 --- a/lib.esm/providers/subscriber-polling.d.ts.map +++ b/lib.esm/providers/subscriber-polling.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-polling.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9E;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,aAAa,GACnB,UAAU,CAYZ;AAID;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;gBAU3C,QAAQ,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G;AACH,qBAAa,4BAA6B,SAAQ,iBAAiB;;IAGlE,YAAY,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAGnD;IAEK,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1E;CACD;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAWxD,YAAY,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAM1D;IA6BD,KAAK,IAAI,IAAI,CAYZ;IAED,IAAI,IAAI,IAAI,CAOX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-polling.js.map b/lib.esm/providers/subscriber-polling.js.map index 858d03c8c..8ac8f299a 100644 --- a/lib.esm/providers/subscriber-polling.js.map +++ b/lib.esm/providers/subscriber-polling.js.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-polling.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKxD,SAAS,IAAI,CAAC,GAAQ;IACpB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAA0B,EAC1B,KAAoB;IAEpB,IAAI,KAAK,KAAK,OAAO,EAAE;QACrB,OAAO,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC;KAC7C;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE;QAC1B,OAAO,IAAI,4BAA4B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;KAC1D;IAED,MAAM,CAAC,KAAK,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eAAe,EAAE;YACnB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;SACxB;IACH,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"subscriber-polling.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKxD,SAAS,IAAI,CAAC,GAAQ;IACrB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CACnC,QAA0B,EAC1B,KAAoB;IAEpB,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;QACvB,OAAO,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,4BAA4B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,CAAC,KAAK,EAAE,2BAA2B,EAAE,uBAAuB,EAAE;QACnE,SAAS,EAAE,sBAAsB;QACjC,IAAI,EAAE,EAAE,KAAK,EAAE;KACf,CAAC,CAAC;AACJ,CAAC;AAED,uBAAuB;AAEvB;;;;GAIG;AACH,MAAM,OAAO,sBAAsB;IAClC,SAAS,CAAmB;IAC5B,OAAO,CAAgB;IAEvB,SAAS,CAAS;IAElB,iEAAiE;IACjE,2DAA2D;IAC3D,YAAY,CAAS;IAErB,YAAY,QAA0B;QACrC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAEtB,IAAI,CAAC,YAAY,GAAG,CAAC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ffc7..335e644e4 100644 --- a/lib.esm/providers/ws-browser.js.map +++ b/lib.esm/providers/ws-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"ws-browser.js","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":"AAAA,SAAS,SAAS;IAChB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;QAC/B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,OAAO,MAAM,CAAC;KACf;IACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,GAAG,SAAS,EAAE,CAAC,SAAS,CAAC;AAEzC,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"ws-browser.js","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":"AAAA,SAAS,SAAS;IACjB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,GAAG,SAAS,EAAE,CAAC,SAAS,CAAC;AAEzC,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/lib.esm/transaction/accesslist.js.map b/lib.esm/transaction/accesslist.js.map index 2dd1473cd..5317671a9 100644 --- a/lib.esm/transaction/accesslist.js.map +++ b/lib.esm/transaction/accesslist.js.map @@ -1 +1 @@ -{"version":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AK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAC1C,qBAAqB,EACrB,OAAO,EACP,KAAK,CACN,CAAC;IAEF,MAAM,MAAM,GACV,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9B,MAAM,WAAW,GAAyB,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAC1D,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;YACpB,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;YACzB,OAAO,KAAK,CAAC;QACf,CAAC,EACqB,EAAE,CACzB,CAAC;QACF,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IACL,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"accesslist.js","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhE,SAAS,YAAY,CACpB,IAAY,EACZ,WAA0B;IAE1B,OAAO;QACN,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;QACzB,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;YAClD,cAAc,CACb,WAAW,CAAC,UAAU,EAAE,EAAE,CAAC,EAC3B,cAAc,EACd,eAAe,KAAK,GAAG,EACvB,UAAU,CACV,CAAC;YACF,OAAO,UAAU,CAAC,WAA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AC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACJ,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/transaction/address.d.ts.map b/lib.esm/transaction/address.d.ts.map index 620aa31e9..48e65cc8e 100644 --- a/lib.esm/transaction/address.d.ts.map +++ b/lib.esm/transaction/address.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EAAE,MAAM,GACb,MAAM,CAIR;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,MAAM,EAAE,MAAM,GACb,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACb,MAAM,CAIR;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"} \ No newline at end of file +{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAC9B,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AAED,wBAAgB,cAAc,CAC7B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"} \ No newline at end of file diff --git a/lib.esm/transaction/address.js.map b/lib.esm/transaction/address.js.map index 0705f5862..6f4c15e0c 100644 --- a/lib.esm/transaction/address.js.map +++ b/lib.esm/transaction/address.js.map @@ -1 +1 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIxD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;GAIG;AAEH,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC/D,CAAC;A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AM,CAAC,CAAC;AAC3C,CAAC;AACD,MAAM,UAAU,aAAa,CAAC,OAAe;IAC5C,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAChC,CAAC"} \ No newline at end of file diff --git a/lib.esm/transaction/index.d.ts.map b/lib.esm/transaction/index.d.ts.map index 304612964..4c5a4305f 100644 --- a/lib.esm/transaction/index.d.ts.map +++ b/lib.esm/transaction/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAC9B,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GACxB,UAAU,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/lib.esm/transaction/index.js.map b/lib.esm/transaction/index.js.map index f1f5d64df..99d060ed7 100644 --- a/lib.esm/transaction/index.js.map +++ b/lib.esm/transaction/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,IAAI,CAAC;AAoBL,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,IAAI,CAAC;AAkBL,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/lib.esm/transaction/transaction.d.ts.map b/lib.esm/transaction/transaction.d.ts.map index f298b00da..e3c637686 100644 --- a/lib.esm/transaction/transaction.d.ts.map +++ b/lib.esm/transaction/transaction.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM;IACzC;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAEhC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,aAAa,CAAC;CAClC;AA2HD;;;;;;;;;;;;GAYG;AACH,qBAAa,WAAY,YAAW,eAAe,CAAC,MAAM,CAAC;;IAUzD;;;OAGG;IACH,IAAI,EAAE,IAAI,IAAI,GAAG,MAAM,CAEtB;IACD,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,MA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,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,KAAK,IAAI,WAAW;IAIpB;;OAEG;IACH,MAAM,IAAI,GAAG;IAoBb;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW;CA6DhE"} \ No newline at end of file +{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM;IAC1C;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAEhC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,aAAa,CAAC;CACjC;AA2HD;;;;;;;;;;;;GAYG;AACH,qBAAa,WAAY,YAAW,eAAe,CAAC,MAAM,CAAC;;IAU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AM,CAAC;QACb,SAAS,EAAE,SAAS,CAAC;KACrB,CAGA;IAED;;;;;OAKG;IACH,IAAI,UAAU,IAAI,MAAM,CAQvB;IAED;;;;;OAKG;IACH,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,KAAK,IAAI,WAAW,CAEnB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CAkBZ;IAED;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW,CA4D9D;CACD"} \ No newline at end of file diff --git a/lib.esm/transaction/transaction.js.map b/lib.esm/transaction/transaction.js.map index 1bb4188ba..ab1d2e741 100644 --- a/lib.esm/transaction/transaction.js.map +++ b/lib.esm/transaction/transaction.js.map @@ -1 +1 @@ -{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACL,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,EACP,MAAM,EACN,cAAc,GACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAe,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC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AI,IAAI,IAAI,EAAE;YACnB,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC;SACvB;QACD,IAAI,EAAE,CAAC,KAAK,IAAI,IAAI,EAAE;YACpB,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;SACzB;QACD,IAAI,EAAE,CAAC,SAAS,IAAI,IAAI,EAAE;YACxB,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;SACjC;QACD,IAAI,EAAE,CAAC,SAAS,IAAI,IAAI,EAAE;YACxB,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;SACjC;QAED,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,EAAE;YACnB,cAAc,CACZ,MAAM,CAAC,QAAQ,EAAE,EACjB,yCAAyC,EACzC,IAAI,EACJ,EAAE,CACH,CAAC;YACF,cAAc,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;SACpE;QAED,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,EAAE;YACnB,cAAc,CACZ,MAAM,CAAC,QAAQ,EAAE,EACjB,yCAAyC,EACzC,IAAI,EACJ,EAAE,CACH,CAAC;YACF,cAAc,CACZ,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAC3D,eAAe,EACf,IAAI,EACJ,EAAE,CACH,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACN,QAAQ,EACR,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AAI,EAAE,CAAC;YACrB,cAAc,CACb,MAAM,CAAC,QAAQ,EAAE,EACjB,yCAAyC,EACzC,IAAI,EACJ,EAAE,CACF,CAAC;YACF,cAAc,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YACrB,cAAc,CACb,MAAM,CAAC,QAAQ,EAAE,EACjB,yCAAyC,EACzC,IAAI,EACJ,EAAE,CACF,CAAC;YACF,cAAc,CACb,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAC3D,eAAe,EACf,IAAI,EACJ,EAAE,CACF,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/base58.js.map b/lib.esm/utils/base58.js.map index 902b9c1a1..b32b1f4d5 100644 --- a/lib.esm/utils/base58.js.map +++ b/lib.esm/utils/base58.js.map @@ -1 +1 @@ -{"version":3,"file":"base58.js","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,QAAQ,GAAG,4DAA4D,CAAC;AAC9E,IAAI,MAAM,GAAkC,IAAI,CAAC;AAEjD,SAAS,QAAQ,CAAC,MAAc;IAC9B,IAAI,MAAM,IAAI,IAAI,EAAE;QAClB,MAAM,GAAG,EAAE,CAAC;QACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,C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C,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC;QAChB,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/base64-browser.js.map b/lib.esm/utils/base64-browser.js.map index 97d3b6382..7fad8e1a5 100644 --- a/lib.esm/utils/base64-browser.js.map +++ b/lib.esm/utils/base64-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"base64-browser.js","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":"AAAA,uBAAuB;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxC,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KAClC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAgB;IAC3C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,QAAQ,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1C;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC"} \ No newline at end of file +{"version":3,"file":"base64-browser.js","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":"AAAA,uBAAuB;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC5C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAgB;IAC5C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,QAAQ,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/base64.js.map b/lib.esm/utils/base64.js.map index ef3938faf..23aecbc86 100644 --- a/lib.esm/utils/base64.js.map +++ b/lib.esm/utils/base64.js.map @@ -1 +1 @@ -{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAInD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe;IAC1C,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACxD,CAAC"} \ No newline at end of file +{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAInD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACzC,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe;IAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvD,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/data.d.ts.map b/lib.esm/utils/data.d.ts.map index b82bf731e..3b65817ca 100644 --- a/lib.esm/utils/data.d.ts.map +++ b/lib.esm/utils/data.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,M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AE,MAAM,GACV,MAAM,CAYR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAMtD;AA0BD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAmBvD;AAED,wBAAgB,QAAQ,CACvB,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,EACnC,OAAO,CAAC,EAAE,WAAW,GACnB,UAAU,CAuDZ;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAMjE"} \ No newline at end of file diff --git a/lib.esm/utils/data.js b/lib.esm/utils/data.js index f53e97149..5372a06f2 100644 --- a/lib.esm/utils/data.js +++ b/lib.esm/utils/data.js @@ -310,7 +310,7 @@ export function arrayify(value, options) { if (result.length === 0) { result.push(0); } - return addSlice(new Uint8Array(result)); + return new Uint8Array(result); } if (options.allowMissingPrefix && typeof value === "string" && @@ -338,24 +338,13 @@ export function arrayify(value, options) { // @ts-ignore result.push(parseInt(hex.substring(i, i + 2), 16)); } - return addSlice(new Uint8Array(result)); + return new Uint8Array(result); } if (isBytes(value)) { - return addSlice(new Uint8Array(value)); + return new Uint8Array(value); } return logger.throwArgumentError("invalid arrayify value", "value", value); } -function addSlice(array) { - // @ts-ignore - if (array.slice) { - return array; - } - array.slice = function () { - const args = Array.prototype.slice.call(arguments); - return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args))); - }; - return array; -} export function hexConcat(items) { let result = "0x"; items.forEach((item) => { diff --git a/lib.esm/utils/data.js.map b/lib.esm/utils/data.js.map index 10c3eb703..fb56167fe 100644 --- a/lib.esm/utils/data.js.map +++ b/lib.esm/utils/data.js.map @@ -1 +1 @@ -{"version":3,"file":"data.js","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,kBAAkB,CAAC,CAAC;AA8B9C,SAAS,SAAS,CAAC,KAAU;IAC3B,OAAO,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;AAC7B,CAAC;AACD,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,KAAU;IAChC,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IAED,IAAI,KAAK,CAAC,WAAW,KAAK,UAAU,EAAE;QACpC,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,OAAO,KAAK,CAAC;KACd;IACD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QAChD,OAAO,KAAK,CAAC;KACd;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE;YACtC,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;A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AAC;QACpB,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAA+B;IACxD,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/errors.d.ts.map b/lib.esm/utils/errors.d.ts.map index de9bc0ec5..b9eff4781 100644 --- a/lib.esm/utils/errors.d.ts.map +++ b/lib.esm/utils/errors.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAiDhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,SAAS,GAEjB,eAAe,GACf,iBAAiB,GACjB,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,SAAS,GACT,UAAU,GACV,WAAW,GAGX,gBAAgB,GAChB,eAAe,GAGf,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,GACrB,gBAAgB,GAGhB,gB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;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,KAAK,CAEf;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CA2BN;AA8BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,GAAG,EACf,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAoBN"} \ No newline at end of file +{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACX,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAiDhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,SAAS,GAElB,eAAe,GACf,iBAAiB,GACjB,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,SAAS,GACT,UAAU,GACV,WAAW,GAGX,gBAAgB,GAChB,eAAe,GAGf,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,GACrB,gBAAgB,GAGhB,gBAAgB,GAChB,oBAAoB,GACpB,eAAe,GACf,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,gBAAgB,GAG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AAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACZ,OAAO,CAAC,KAAK,CAEf;AAED,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CA2BN;AA8BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,UAAU,EAAE,GAAG,EACf,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,MAAM,GAChB,IAAI,CAoBN"} \ No newline at end of file diff --git a/lib.esm/utils/errors.js.map b/lib.esm/utils/errors.js.map index 6e25e80da..914595a30 100644 --- a/lib.esm/utils/errors.js.map +++ b/lib.esm/utils/errors.js.map @@ -1 +1 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAYnD,SAAS,SAAS,CAAC,KAAU;IAC3B,IAAI,KAAK,IAAI,IAAI,EAAE;QACjB,OAAO,MAAM,CAAC;KACf;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACxB,OAAO,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;KACtD;IAED,IAAI,KAAK,YAAY,UAAU,EAAE;QAC/B,MAAM,GAAG,GAAG,kBAAkB,CAAC;QAC/B,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,IAAI,GAAG,CAAC,KAAK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A4B,MAAM,eAAe,EACjD,uBAAuB,EACvB;YACC,SAAS;SACT,CACD,CAAC;IACH,CAAC;AACF,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/events.d.ts.map b/lib.esm/utils/events.d.ts.map index 13c18f4ef..140670f11 100644 --- a/lib.esm/utils/events.d.ts.map +++ b/lib.esm/utils/events.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC;;;OAGG;IACH,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtD;;OAEG;IACH,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAA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AAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,qBAAa,YAAY,CAAC,CAAC;;IAC1B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,CAAC,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAIvC;;;OAGG;IACH,YACC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC5B,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,CAAC,EAIT;IAED;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpC;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/events.js.map b/lib.esm/utils/events.js.map index 77522ecb1..d6fb75a60 100644 --- a/lib.esm/utils/events.js.map +++ b/lib.esm/utils/events.js.map @@ -1 +1 @@ -{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA+DnD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACvB;;OAEG;IACM,MAAM,CAAK;IAEpB;;OAEG;IACM,OAAO,CAAuB;IAE9B,SAAS,CAAkB;IAEpC;;;OAGG;IACH,YACE,OAA4B,EAC5B,QAAyB,EACzB,MAAS;QAET,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,gBAAgB,CAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QAClB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;YAC1B,OAAO;SACR;QACD,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA+DnD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACxB;;OAEG;IACM,MAAM,CAAK;IAEpB;;OAEG;IACM,OAAO,CAAuB;IAE9B,SAAS,CAAkB;IAEpC;;;OAGG;IACH,YACC,OAA4B,EAC5B,QAAyB,EACzB,MAAS;QAET,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,gBAAgB,CAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QACnB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YAC5B,OAAO;QACR,CAAC;QACD,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/fetch.d.ts.map b/lib.esm/utils/fetch.d.ts.map index 1319c39a1..59bbdc142 100644 --- a/lib.esm/utils/fetch.d.ts.map +++ b/lib.esm/utils/fetch.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,IAAI,GAAG,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,KAChB,OAAO,CAAC,aAAa,CAAC,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAC3B,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,iBAAiB,KACvB,OAAO,CAAC,YAAY,GAAG,aAAa,CAAC,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,KACv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,CAAC,UAAU,CAAC,CAEtC;IAED;;;;;OAKG;IACH,IAAI,QAAQ,IAAI,MAAM,CAcrB;IAED;;;;;OAKG;IACH,IAAI,QAAQ,IAAI,GAAG,CAclB;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAgB1D;IAED,YACC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,CAAC,EAAE,YAAY,EAetB;IAED;;;;OAIG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,aAAa,CAiB9D;IAED;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAiB1D;IAED;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7B;IAED;;OAEG;IACH,OAAO,IAAI,IAAI,IAAI,aAAa,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAEtD;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,IAAI,GAAG,YAAY,CAEjC;IAED;;OAEG;IACH,EAAE,IAAI,OAAO,CAMZ;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAaf;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/fetch.js.map b/lib.esm/utils/fetch.js.map index 6676d58de..b889879bf 100644 --- a/lib.esm/utils/fetch.js.map +++ b/lib.esm/utils/fetch.js.map @@ -1 +1 @@ -{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY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I,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QACrC,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;YACpB,OAAO,GAAG,mBAAmB,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;QACtE,CAAC;QACD,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE;YACtC,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,iBAAiB;YAC1C,QAAQ,EAAE,IAAI;YACd,KAAK;SACL,CAAC,CAAC;IACJ,CAAC;CACD;AAED,SAAS,OAAO;IACf,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AAC7B,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC/B,OAAO,WAAW,CACjB,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACpD,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC,CAAC,CACF,CAAC;AACH,CAAC;AAED,SAAS,IAAI,CAAC,KAAa;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAC7D,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/fixednumber.d.ts.map b/lib.esm/utils/fixednumber.d.ts.map index 2f8afd8ab..0acb110cb 100644 --- a/lib.esm/utils/fixednumber.d.ts.map +++ b/lib.esm/utils/fixednumber.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4C1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM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OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAuCpE;IAED;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAWtE;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/fixednumber.js b/lib.esm/utils/fixednumber.js index 8bbe59fbb..41c98b512 100644 --- a/lib.esm/utils/fixednumber.js +++ b/lib.esm/utils/fixednumber.js @@ -49,7 +49,7 @@ function checkValue(val, format, safeOp) { fault: "overflow", value: val, }); - val = ((val % limit) + limit) % limit & (limit - BN_1); + val = (((val % limit) + limit) % limit) & (limit - BN_1); } return val; } @@ -219,27 +219,27 @@ export class FixedNumber { } #checkValue(val, safeOp) { /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - + const width = BigInt(this.width); + if (this.signed) { + const limit = (BN_1 << (width - BN_1)); + assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { + operation: safeOp, fault: "overflow", value: val + }); + + if (val > BN_0) { + val = fromTwos(mask(val, width), width); } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; + val = -fromTwos(mask(-val, width), width); } - */ + + } else { + const masked = mask(val, width); + assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { + operation: safeOp, fault: "overflow", value: val + }); + val = masked; + } +*/ val = checkValue(val, this.#format, safeOp); return new _a(_guard, val, this.#format); } diff --git a/lib.esm/utils/fixednumber.js.map b/lib.esm/utils/fixednumber.js.map index e3d37998c..0fe155e05 100644 --- a/lib.esm/utils/fixednumber.js.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G,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;QAED,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QAEvC,OAAO,IAAI,EAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;CACD;;AAED,0DAA0D;AAC1D,wDAAwD;AACxD,gCAAgC;AAChC,uCAAuC"} \ No newline at end of file diff --git a/lib.esm/utils/geturl-browser.d.ts b/lib.esm/utils/geturl-browser.d.ts index 133a13813..29cebe088 100644 --- a/lib.esm/utils/geturl-browser.d.ts +++ b/lib.esm/utils/geturl-browser.d.ts @@ -1,21 +1,3 @@ import type { FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -declare global { - class Headers { - constructor(values: Array<[string, string]>); - forEach(func: (v: string, k: string) => void): void; - } - class Response { - status: number; - statusText: string; - headers: Headers; - arrayBuffer(): Promise; - } - type FetchInit = { - method?: string; - headers?: Headers; - body?: Uint8Array; - }; - function fetch(url: string, init: FetchInit): Promise; -} export declare function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise; //# sourceMappingURL=geturl-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/geturl-browser.d.ts.map b/lib.esm/utils/geturl-browser.d.ts.map index 852575bca..3190d62cc 100644 --- a/lib.esm/utils/geturl-browser.d.ts.map +++ b/lib.esm/utils/geturl-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IAEb,MAAM,OAAO;oBACC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;KACpD;IAGD,MAAM,QAAQ;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;KACpC;IAED,KAAK,SAAS,GAAG;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,UAAU,CAAC;KACnB,CAAC;IAEF,SAAS,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACjE;AAID,wBAAsB,MAAM,CAC1B,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA0DrC"} \ No newline at end of file +{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAIpB,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA0DrC"} \ No newline at end of file diff --git a/lib.esm/utils/geturl-browser.js.map b/lib.esm/utils/geturl-browser.js.map index ba0c9a601..8973d741b 100644 --- a/lib.esm/utils/geturl-browser.js.map +++ b/lib.esm/utils/geturl-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"geturl-browser.js","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAgCrC,2EAA2E;AAC3E,aAAa;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at end of file diff --git a/lib.esm/utils/geturl.d.ts.map b/lib.esm/utils/geturl.d.ts.map index 8cde884db..7728357a3 100644 --- a/lib.esm/utils/geturl.d.ts.map +++ b/lib.esm/utils/geturl.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,MAAM,CAC1B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,cAAc,CAAC,CAqGzB"} \ No newline at end of file +{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,cAAc,CAAC,CAqGzB"} \ No newline at end of file diff --git a/lib.esm/utils/geturl.js.map b/lib.esm/utils/geturl.js.map index e88ed76b4..e5932b8b0 100644 --- a/lib.esm/utils/geturl.js.map +++ b/lib.esm/utils/geturl.js.map @@ -1 +1 @@ -{"version":3,"file":"geturl.js","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAQrC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,GAAiB,E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YACF,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACnB,IAAI,OAAO,CAAC,kBAAkB,CAAC,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC;oBACpD,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;gBACnC,CAAC;gBAED,OAAO,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC1B,qEAAqE;gBAC/D,KAAM,CAAC,QAAQ,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gBACrE,MAAM,CAAC,KAAK,CAAC,CAAC;YACf,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC7B,MAAM,CAAC,KAAK,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/index.d.ts.map b/lib.esm/utils/index.d.ts.map index 2efd33012..2be8f026a 100644 --- a/lib.esm/utils/index.d.ts.map +++ b/lib.esm/utils/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT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jB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9D,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EACV,aAAa,EACb,wBAAwB,EACxB,eAAe,GAChB,MAAM,WAAW,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,GACT,MAAM,WAAW,CAAC;AAEnB,OAAO,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,SAAS,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,WAAW,E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AAkB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EACX,aAAa,EACb,wBAAwB,EACxB,eAAe,GACf,MAAM,WAAW,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/index.js.map b/lib.esm/utils/index.js.map index ba6e458d0..548d8698a 100644 --- a/lib.esm/utils/index.js.map +++ b/lib.esm/utils/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,eAAe,EACf,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1E,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,GACT,MAAM,WAAW,CAAC;AAEnB,OAAO,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,SAAS,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,GACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1E,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/maths.js.map b/lib.esm/utils/maths.js.map index 16ed7f6e1..c635e9327 100644 --- a/lib.esm/utils/maths.js.map +++ b/lib.esm/utils/maths.js.map @@ -1 +1 @@ -{"version":3,"file":"maths.js","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAcrD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,iDAAiD;AAEjD,uCAAuC;AACvC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAoB,EAAE,MAAe;IAC5D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjD,MAAM,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE;QAC3D,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,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GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QACnB,MAAM,GAAG,GAAG,CAAC;IACd,CAAC;IACD,OAAO,IAAI,GAAG,MAAM,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/properties.d.ts.map b/lib.esm/utils/properties.d.ts.map index 2520af8fb..b675427ea 100644 --- a/lib.esm/utils/properties.d.ts.map +++ b/lib.esm/utils/properties.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAC/C,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACrC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACjC,KAAK,CAAC,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAAE,GAClC,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,EACX,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACtC,IAAI,CAcN"} \ No newline at end of file +{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAChD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACjC,KAAK,CAAC,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAAE,GACjC,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC9B,MAAM,EAAE,GAAG,EACX,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACrC,IAAI,CAcN"} \ No newline at end of file diff --git a/lib.esm/utils/properties.js.map b/lib.esm/utils/properties.js.map index b5e7f94a0..652c693ab 100644 --- a/lib.esm/utils/properties.js.map +++ b/lib.esm/utils/properties.js.map @@ -1 +1 @@ -{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAEpD,SAAS,SAAS,CAAC,KAAU,EAAE,IAAY,EAAE,IAAY;IACvD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,QAAQ,IAAI,EAAE;YACZ,KAAK,KAAK;gBAC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;QACvC,IAAI,IAAI,EAAE;YACR,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;SAC7B;QAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;YACjC,UAAU,EAAE,IAAI;YAChB,KAAK;YACL,QAAQ,EAAE,KAAK;SAChB,CAAC,CAAC;KACJ;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,MAAW,EACX,UAAuC;IAEvC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QACzC,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC/D;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAClC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACpB,MAAM,CAAC,kBAAkB,CACvB,uBAAuB,GAAG,GAAG,EAC7B,cAAc,GAAG,GAAG,EACpB,MAAM,CACP,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file +{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAEpD,SAAS,SAAS,CAAC,KAAU,EAAE,IAAY,EAAE,IAAY;IACxD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,QAAQ,I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,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACvC,IAAI,IAAI,EAAE,CAAC;YACV,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE;YAClC,UAAU,EAAE,IAAI;YAChB,KAAK;YACL,QAAQ,EAAE,KAAK;SACf,CAAC,CAAC;IACJ,CAAC;AACF,CAAC;AAED,MAAM,UAAU,eAAe,CAC9B,MAAW,EACX,UAAuC;IAEvC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC3C,MAAM,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,kBAAkB,CACxB,uBAAuB,GAAG,GAAG,EAC7B,cAAc,GAAG,GAAG,EACpB,MAAM,CACN,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/rlp-decode.js.map b/lib.esm/utils/rlp-decode.js.map index 18b3f3d8a..330a628c4 100644 --- a/lib.esm/utils/rlp-decode.js.map +++ b/lib.esm/utils/rlp-decode.js.map @@ -1 +1 @@ -{"version":3,"file":"rlp-decode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,SAAS,WAAW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G,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QACpE,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjD,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjC,cAAc,CACb,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,MAAM,EAChC,mCAAmC,EACnC,MAAM,EACN,KAAK,CACL,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/rlp-encode.js.map b/lib.esm/utils/rlp-encode.js.map index f586be932..5fb0749f0 100644 --- a/lib.esm/utils/rlp-encode.js.map +++ b/lib.esm/utils/rlp-encode.js.map @@ -1 +1 @@ -{"version":3,"file":"rlp-encode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,OAAO,KAAK,EAAE;QACZ,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;QAC7B,KAAK,KAAK,CAAC,CAAC;KACb;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,OAAO,CAAC,MAA2B;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,IAAI,OAAO,GAAkB,EAAE,CAAC;QAChC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MAAM,IAAI,GAAkB,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CACrD,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,CAC1B,CAAC;IAEF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAC;IACb,CAAC;SAAM,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QAC9B,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,MAAyB;IAClD,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1B,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/units.d.ts.map b/lib.esm/utils/units.d.ts.map index 3db242e6c..fef9d60bc 100644 --- a/lib.esm/utils/units.d.ts.map +++ b/lib.esm/utils/units.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB/D;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,YAAY,EACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GACtB,MAAM,CAWR;AAED;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,QAAS,MAAM,GAAG,MAAM,oBA6CvD,CAAC;AACF,eAAO,MAAM,YAAY,MAAO,MAAM,8BAQrC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAsBzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"} \ No newline at end of file +{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,YAAY,EACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GACrB,MAAM,CAWR;AAED;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,QAAS,MAAM,GAAG,MAAM,oBA6CvD,CAAC;AACF,eAAO,MAAM,YAAY,MAAO,MAAM,8BAQrC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAsBzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"} \ No newline at end of file diff --git a/lib.esm/utils/units.js.map b/lib.esm/utils/units.js.map index 163c94963..4884e25f6 100644 --- a/lib.esm/utils/units.js.map +++ b/lib.esm/utils/units.js.map @@ -1 +1 @@ -{"version":3,"file":"units.js","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,MAAM,KAAK,GAAG;IACZ,8CAA8C;IAC9C,KAAK;IAEL,mBAAmB;IACnB,QAAQ;IAER,0BAA0B;IAC1B,QAAQ;IAER,iFAAiF;IACjF,QAAQ;IAER,8BAA8B;IAC9B,OAAO;IAEP,+BAA+B;IAC/B,QAAQ;IAER,MAAM;CACP,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CACzB,KAAmB,EACnB,IAAuB;IAEvB,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClC,cAAc,CAAC,KAAK,IAAI,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACzD,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC;KACtB;SAAM,IAAI,IAAI,IAAI,IAAI,EAAE;QACvB,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KACpC;IAED,OAAO,WAAW,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AACzE,CAAC;AAED;;;;GAIG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAoB,EAAE,EAAE;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AAC,QAAQ,EAAE,CAAC;IAC/C,CAAC;IACD,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClC,cAAc,CAAC,KAAK,IAAI,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACzD,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;SAAM,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACzB,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,WAAW,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,GAAiB;IAC1C,OAAO,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW;IACnC,OAAO,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/utf8.d.ts.map b/lib.esm/utils/utf8.d.ts.map index f79c87b2e..febc8e114 100644 --- a/lib.esm/utils/utf8.d.ts.map +++ b/lib.esm/utils/utf8.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"utf8.d.ts","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,wBAAwB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BG;AACH,MAAM,MAAM,eAAe,GACxB,qBAAqB,GACrB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,UAAU,CAAC;AAEd;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,CAC3B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EACrB,YAAY,CAAC,EAAE,MAAM,KACjB,MAAM,CAAC;AAwEZ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACpC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,aAAa,CAAC,CAKpD,CAAC;AA2GH;;;;GAIG;AACH,wBAAgB,WAAW,CAC1B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,UAAU,CAwCZ;AAkBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,aAAa,GACrB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,KAAK,CAAC,MAAM,CAAC,CAEf"} \ No newline at end of file diff --git a/lib.esm/utils/utf8.js.map b/lib.esm/utils/utf8.js.map index 1d7607145..f46745b4e 100644 --- a/lib.esm/utils/utf8.js.map +++ b/lib.esm/utils/utf8.js.map @@ -1 +1 @@ -{"version":3,"file":"utf8.js","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAgF9D,SAAS,SAAS,CAChB,MAAuB,EACvB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GAAG,IAAI,CAAC,CAAC;SAChC;KACF;IAED,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED,QAAQ;AACR,SAAS,aAAa,CAAC,UAAyB;IAC9C,OAAO,UAAU;SACd,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QACjB,IAAI,SAAS,IAAI,MAAM,EAAE;YACvB,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;SACvC;QACD,SAAS,IAAI,OAAO,CAAC;QACrB,OAAO,MAAM,CAAC,YAAY,CACxB,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,EACpC,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,MAAM,CAC7B,CAAC;IACJ,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAgB,EAChB,OAAuB;IAEvB,OAAO,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC9B,GAAW,EACX,IAA+B;IAE/B,OAAO,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACnD,CAAC"} \ No newline at end of file +{"version":3,"file":"utf8.js","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAgF9D,SAAS,SAAS,CACjB,MAAuB,EACvB,MAAc,EACd,KAAiB,EACjB,MAAqB,EACrB,YAAqB;IAErB,cAAc,CACb,KAAK,EACL,+BAA+B,MAAM,KAAK,MAAM,EAAE,EAClD,OAAO,EACP,KA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AC,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED,QAAQ;AACR,SAAS,aAAa,CAAC,UAAyB;IAC/C,OAAO,UAAU;SACf,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAClB,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;YACzB,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACvC,CAAC;QACD,SAAS,IAAI,OAAO,CAAC;QACrB,OAAO,MAAM,CAAC,YAAY,CACzB,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,EACpC,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,MAAM,CAC5B,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC3B,KAAgB,EAChB,OAAuB;IAEvB,OAAO,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC/B,GAAW,EACX,IAA+B;IAE/B,OAAO,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/uuid.js.map b/lib.esm/utils/uuid.js.map index 62520202c..5b9c8f9b4 100644 --- a/lib.esm/utils/uuid.js.map +++ b/lib.esm/utils/uuid.js.map @@ -1 +1 @@ -{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAI9C;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,WAAsB;IAC3C,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEnD,kBAAkB;IAClB,wCAAwC;IACxC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,cAAc;IACd,uCAAuC;IACvC,uCAAuC;IACvC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE7B,OAAO;QACL,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;QACtB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;KACxB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"} \ No newline at end of file +{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAI9C;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,WAAsB;IAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEnD,kBAAkB;IAClB,wCAAwC;IACxC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,cAAc;IACd,uCAAuC;IACvC,uCAAuC;IACvC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE7B,OAAO;QACN,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;QACtB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;KACvB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/base-wallet.d.ts.map b/lib.esm/wallet/base-wallet.d.ts.map index dc25c591a..9b7a9bb96 100644 --- a/lib.esm/wallet/base-wallet.d.ts.map +++ b/lib.esm/wallet/base-wallet.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"base-wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AASvD,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG1E;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,cAAc;;IAC5C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM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BAAa,UAAW,SAAQ,cAAc;;IAC7C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAIxB;;;;;;OAMG;IACH,YAAY,EACX,UAAU,EACV,MAAM,EACN,QAAQ,GACR,EAAE;QACF,UAAU,EAAE,UAAU,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,EAcA;IAKD;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAM7C;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAID;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAEpD;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAgCjB;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/base-wallet.js.map b/lib.esm/wallet/base-wallet.js.map index 78e0a5d58..ee6120855 100644 --- a/lib.esm/wallet/base-wallet.js.map +++ b/lib.esm/wallet/base-wallet.js.map @@ -1 +1 @@ -{"version":3,"file":"base-wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAAA,OA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AAkE;IAClE,4BAA4B;IAC5B;;OAEG;IACH,eAAe,CAAC,OAA4B;QAC1C,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;QAE1B,yBAAyB;QACzB,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,YAAY,CACnD,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EAAE,IAAY,EAAE,EAAE;YACrB,sDAAsD;YACtD,yBAAyB;YAEzB,MAAM,CACJ,IAAI,CAAC,QAAQ,IAAI,IAAI,EACrB,6CAA6C,EAC7C,uBAAuB,EACvB;gBACE,SAAS,EAAE,aAAa;gBACxB,IAAI,EAAE,EAAE,IAAI,EAAE;aACf,CACF,CAAC;YAEF,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;YACjC,MAAM,CAAC,OAAO,IAAI,IAAI,EAAE,uBAAuB,EAAE,mBAAmB,EAAE;gBACpE,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC;QACjB,CAAC,CACF,CAAC;QAEF,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CACzB,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAChE,CAAC;IACJ,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"base-wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yB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a,CAClB,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;QAE1B,yBAAyB;QACzB,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,YAAY,CACpD,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EAAE,IAAY,EAAE,EAAE;YACtB,sDAAsD;YACtD,yBAAyB;YAEzB,MAAM,CACL,IAAI,CAAC,QAAQ,IAAI,IAAI,EACrB,6CAA6C,EAC7C,uBAAuB,EACvB;gBACC,SAAS,EAAE,aAAa;gBACxB,IAAI,EAAE,EAAE,IAAI,EAAE;aACd,CACD,CAAC;YAEF,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;YACjC,MAAM,CAAC,OAAO,IAAI,IAAI,EAAE,uBAAuB,EAAE,mBAAmB,EAAE;gBACrE,KAAK,EAAE,IAAI;aACX,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC;QAChB,CAAC,CACD,CAAC;QAEF,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAC1B,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAC/D,CAAC;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/english_words.d.ts.map b/lib.esm/wallet/english_words.d.ts.map index 15a3e8323..b0bd73fa9 100644 --- a/lib.esm/wallet/english_words.d.ts.map +++ b/lib.esm/wallet/english_words.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"english_words.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,i0VACuyV,CAAC"} \ No newline at end of file +{"version":3,"file":"english_words.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,i0VACsyV,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/english_words.js.map b/lib.esm/wallet/english_words.js.map index 5fcb938ce..ab2578a02 100644 --- a/lib.esm/wallet/english_words.js.map +++ b/lib.esm/wallet/english_words.js.map @@ -1 +1 @@ -{"version":3,"file":"english_words.js","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GACvB,8zVAA8zV,CAAC"} \ No newline at end of file +{"version":3,"file":"english_words.js","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GACxB,8zVAA8zV,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/hdwallet.d.ts.map b/lib.esm/wallet/hdwallet.d.ts.map index cc249d4de..6ff875955 100644 --- a/lib.esm/wallet/hdwallet.d.ts.map +++ b/lib.esm/wallet/hdwallet.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hdwallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAA0B,UAAU,EAAU,MAAM,oBAAoB,CAAC;AAUhF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAetD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAY,CAAC;AAiFvC;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,UAAU;;IAC1C;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,QAAQ,CAAC,WA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M,EACN,QAAQ,EACR,IAAI,EACJ,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAiBf;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,YAAY,CAOf;CACD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAStD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAS7D"} \ No newline at end of file diff --git a/lib.esm/wallet/hdwallet.js.map b/lib.esm/wallet/hdwallet.js.map index 340f202a2..088c0736b 100644 --- a/lib.esm/wallet/hdwallet.js.map +++ b/lib.esm/wallet/hdwallet.js.map @@ -1 +1 @@ -{"version":3,"file":"hdwallet.js","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,mBAAmB,EACnB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AI,CAAC,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EACd,IAAI,EACJ,MAAM,EACN,IAAI,GAKL;QACC,OAAO,YAAY,CAAC,SAAS,CAAC;YAC5B,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,IAAI,IAAI,WAAW;YACzB,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF;AAED;;;;;;;;;;;;;;;EAeE;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,MAAe;IAC5C,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,cAAc,CACZ,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EACjC,uBAAuB,EACvB,OAAO,EACP,KAAK,CACN,CAAC;IACF,OAAO,aAAa,KAAK,OAAO,CAAC;AACnC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAe;IACnD,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,cAAc,CACZ,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EACjC,uBAAuB,EACvB,OAAO,EACP,KAAK,CACN,CAAC;IACF,OAAO,kBAAkB,KAAK,EAAE,CAAC;AACnC,CAAC"} \ No newline at end of file +{"version":3,"file":"hdwallet.js","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EACN,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,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esm/wallet/index.d.ts.map +++ b/lib.esm/wallet/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/index.js.map b/lib.esm/wallet/index.js.map index 8828a0625..d3dbff105 100644 --- a/lib.esm/wallet/index.js.map +++ b/lib.esm/wallet/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/json-crowdsale.d.ts.map b/lib.esm/wallet/json-crowdsale.d.ts.map index 4514aef1b..db8057554 100644 --- a/lib.esm/wallet/json-crowdsale.d.ts.map +++ b/lib.esm/wallet/json-crowdsale.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC7B,gBAAgB,CAmClB"} \ No newline at end of file +{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,gBAAgB,CAmClB"} \ No newline at end of file diff --git a/lib.esm/wallet/json-crowdsale.js b/lib.esm/wallet/json-crowdsale.js index fddef7c1f..c3c9d148f 100644 --- a/lib.esm/wallet/json-crowdsale.js +++ b/lib.esm/wallet/json-crowdsale.js @@ -3,7 +3,7 @@ */ // @ts-ignore import pkg from "aes-js"; -const { CBC, pkcs7Strip } = pkg; +const { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg; import { getAddress } from "../address/index.js"; import { pbkdf2 } from "../crypto/index.js"; import { id } from "../hash/index.js"; diff --git a/lib.esm/wallet/json-crowdsale.js.map b/lib.esm/wallet/json-crowdsale.js.map index 8ea45fac9..76fc523ea 100644 --- a/lib.esm/wallet/json-crowdsale.js.map +++ b/lib.esm/wallet/json-crowdsale.js.map @@ -1 +1 @@ -{"version":3,"file":"json-crowdsale.js","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,aAAa;AACb,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAWjE;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,IAAI;QACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,OAAO,IAAI,CAAC;SACb;KACF;IAAC,OAAO,KAAK,EAAE,GAAE;IAClB,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAY,EACZ,SAA8B;IAE9B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,W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IAChE,cAAc,CACb,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,EAAE,KAAK,CAAC,EACpC,iBAAiB,EACjB,MAAM,EACN,IAAI,CACJ,CAAC;IAEF,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CACzE,CAAC,EACD,EAAE,CACF,CAAC;IAEF,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAExC,mBAAmB;IACnB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAEjE,6EAA6E;IAC7E,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;AAC7C,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/json-keystore.d.ts.map b/lib.esm/wallet/json-keystore.d.ts.map index a56cc644a..742508cc1 100644 --- a/lib.esm/wallet/json-keystore.d.ts.map +++ b/lib.esm/wallet/json-keystore.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAA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AM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,MAAM,CASR;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,MAAM,CAAC,CAiBjB"} \ No newline at end of file +{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACR,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASpD;AAkLD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,eAAe,CAmBjB;AAUD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,EAC9B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,eAAe,CAAC,CA2B1B;AA8ID;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,MAAM,CASR;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,MAAM,CAAC,CAiBjB"} \ No newline at end of file diff --git a/lib.esm/wallet/json-keystore.js b/lib.esm/wallet/json-keystore.js index 0866d3b6a..314dec535 100644 --- a/lib.esm/wallet/json-keystore.js +++ b/lib.esm/wallet/json-keystore.js @@ -10,7 +10,7 @@ */ // @ts-ignore import pkg from "aes-js"; -const { CTR } = pkg; +const { Counter, ModeOfOperation: { ctr: CTR }, } = pkg; import { getAddress } from "../address/index.js"; import { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from "../crypto/index.js"; import { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from "../utils/index.js"; @@ -36,7 +36,7 @@ function decrypt(data, key, ciphertext) { const cipher = spelunk(data, "crypto.cipher:string"); if (cipher === "aes-128-ctr") { const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, iv); + const aesCtr = new CTR(key, new Counter(iv)); return hexlify(aesCtr.decrypt(ciphertext)); } assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { @@ -47,7 +47,16 @@ function getAccount(data, _key) { const key = getBytes(_key); const ciphertext = spelunk(data, "crypto.ciphertext:data!"); const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2); - assertArgument(computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), "incorrect password", "password", "[ REDACTED ]"); + const expectedMAC = spelunk(data, "crypto.mac:string!"); + let difference = 0; + const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC); + if (validMAC) { + const actual = getBytes("0x" + computedMAC); + const expected = getBytes("0x" + expectedMAC); + for (let i = 0; i < actual.length; i++) + difference |= actual[i] ^ expected[i]; + } + assertArgument(validMAC && difference === 0, "incorrect password", "password", "[REDACTED]"); const privateKey = decrypt(data, key.slice(0, 16), ciphertext); const address = getAddress(data.address); const prefix = extractPrefix(address); @@ -68,7 +77,7 @@ function getAccount(data, _key) { const mnemonicKey = key.slice(32, 64); const mnemonicCiphertext = spelunk(data, "x-corebc.mnemonicCiphertext:data!"); const mnemonicIv = spelunk(data, "x-corebc.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); account.mnemonic = { path: spelunk(data, "x-corebc.path:string") || defaultPath, locale: spelunk(data, "x-corebc.locale:string") || "en", @@ -77,6 +86,16 @@ function getAccount(data, _key) { } return account; } +// Match Core Web3Dart's wallet KDF resource limits. +function validateScrypt(N, r, p) { + assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, "unsafe scrypt N", "kdf.N", N); + assertArgument(Number.isSafeInteger(r) && + Number.isSafeInteger(p) && + r > 0 && + p > 0 && + r * p <= 1048576 && + 128 * N * r <= 256 * 1024 * 1024, "unsafe scrypt work or memory requirement", "kdf", { N, r, p }); +} function getDecryptKdfParams(data) { const kdf = spelunk(data, "crypto.kdf:string"); if (kdf && typeof kdf === "string") { @@ -85,9 +104,7 @@ function getDecryptKdfParams(data) { const N = spelunk(data, "crypto.kdfparams.n:int!"); const r = spelunk(data, "crypto.kdfparams.r:int!"); const p = spelunk(data, "crypto.kdfparams.p:int!"); - // Make sure N is a power of 2 - assertArgument(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - assertArgument(r > 0 && p > 0, "invalid kdf", "kdf", kdf); + validateScrypt(N, r, p); const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); return { name: "scrypt", salt, N, r, p, dkLen: 64 }; @@ -96,11 +113,18 @@ function getDecryptKdfParams(data) { const salt = spelunk(data, "crypto.kdfparams.salt:data!"); const prf = spelunk(data, "crypto.kdfparams.prf:string!"); const algorithm = prf.split("-").pop(); - assertArgument(algorithm === "sha256" || algorithm === "sha512", "invalid kdf.pdf", "kdf.pdf", prf); + assertArgument(prf === "hmac-sha256" || prf === "hmac-sha512", "invalid kdf.pdf", "kdf.pdf", prf); const count = spelunk(data, "crypto.kdfparams.c:int!"); + assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, "unsafe PBKDF2 iteration count", "kdf.c", count); const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { name: "pbkdf2", salt, count, dkLen, algorithm }; + return { + name: "pbkdf2", + salt, + count, + dkLen, + algorithm: algorithm, + }; } } assertArgument(false, "unsupported key-derivation function", "kdf", kdf); @@ -183,22 +207,17 @@ function getEncryptKdfParams(options) { // Override the scrypt password-based key derivation function parameters let N = 1 << 17, r = 8, p = 1; if (options.scrypt) { - if (options.scrypt.N) { + if (options.scrypt.N != null) { N = options.scrypt.N; } - if (options.scrypt.r) { + if (options.scrypt.r != null) { r = options.scrypt.r; } - if (options.scrypt.p) { + if (options.scrypt.p != null) { p = options.scrypt.p; } } - assertArgument(typeof N === "number" && - N > 0 && - Number.isSafeInteger(N) && - (BigInt(N) & BigInt(N - 1)) === BigInt(0), "invalid scrypt N parameter", "options.N", N); - assertArgument(typeof r === "number" && r > 0 && Number.isSafeInteger(r), "invalid scrypt r parameter", "options.r", r); - assertArgument(typeof p === "number" && p > 0 && Number.isSafeInteger(p), "invalid scrypt p parameter", "options.p", p); + validateScrypt(N, r, p); return { name: "scrypt", dkLen: 32, salt, N, r, p }; } function _encryptKeystore(key, kdf, account, options) { @@ -217,7 +236,7 @@ function _encryptKeystore(key, kdf, account, options) { const derivedKey = key.slice(0, 16); const macPrefix = key.slice(16, 32); // Encrypt the private key - const aesCtr = new CTR(derivedKey, iv); + const aesCtr = new CTR(derivedKey, new Counter(iv)); const ciphertext = getBytes(aesCtr.encrypt(privateKey)); // Compute the message authentication code, used to check the password const mac = sha256(concat([macPrefix, ciphertext])); @@ -250,7 +269,7 @@ function _encryptKeystore(key, kdf, account, options) { const mnemonicKey = key.slice(32, 64); const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); const now = new Date(); const timestamp = now.getUTCFullYear() + diff --git a/lib.esm/wallet/json-keystore.js.map b/lib.esm/wallet/json-keystore.js.map index 3cb75b2b5..546c4bb3c 100644 --- a/lib.esm/wallet/json-keystore.js.map +++ b/lib.esm/wallet/json-keystore.js.map @@ -1 +1 @@ -{"version":3,"file":"json-keystore.js","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,aAAa;AACb,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACL,MAAM,EACN,WAAW,EACX,MAAM,EACN,UAAU,EACV,MAAM,GACP,MAAM,oBAAoB,CAAC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E,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/mnemonic.d.ts.map b/lib.esm/wallet/mnemonic.d.ts.map index 82d411a3d..1f5e4541d 100644 --- a/lib.esm/wallet/mnemonic.d.ts.map +++ b/lib.esm/wallet/mnemonic.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA6HtD;;;GAGG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAE1B;;OAEG;gBAED,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ;IAY5B;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,EAChB,MAAM,EACN,QAAQ,EACR,QAAQ,GACT,EAAE;QACD,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC5B,GAAG,QAAQ;IAOZ;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CAChB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC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AAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,GAAG,QAAQ,CAKX;IAED;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CACjB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,QAAQ,CAIV;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CACrB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,MAAM,CAGR;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAEzE;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,OAAO,CAM1E;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/mnemonic.js.map b/lib.esm/wallet/mnemonic.js.map index 65921f68f..e252eaa4d 100644 --- a/lib.esm/wallet/mnemonic.js.map +++ b/lib.esm/wallet/mnemonic.js.map @@ -1 +1 @@ -{"version":3,"file":"mnemonic.js","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAIjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,uCAAuC;AACvC,SAAS,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;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/mnemonicToSeed.d.ts.map b/lib.esm/wallet/mnemonicToSeed.d.ts.map index fa7e673dc..87afb28cf 100644 --- a/lib.esm/wallet/mnemonicToSeed.d.ts.map +++ b/lib.esm/wallet/mnemonicToSeed.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"mnemonicToSeed.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E"} \ No newline at end of file +{"version":3,"file":"mnemonicToSeed.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E"} \ No newline at end of file diff --git a/lib.esm/wallet/mnemonicToSeed.js b/lib.esm/wallet/mnemonicToSeed.js index 6e88e1f96..578640058 100644 --- a/lib.esm/wallet/mnemonicToSeed.js +++ b/lib.esm/wallet/mnemonicToSeed.js @@ -1,3 +1,4 @@ +import { Buffer } from "buffer"; import { pbkdf2Sync } from "../crypto/crypto.js"; import utf8 from "utf8"; export function mnemonicToSeed(mnemonic, password) { @@ -12,11 +13,11 @@ const generateSeed = (mnemonic, password) => { const aesSaltPrefix = "mnemonicfortheAESkey"; const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); const aesSalt = utf8.encode(aesSaltPrefix + password); - const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), goldilockSalt, 2048, 64, "sha512"); - const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), aesSalt, 2048, 64, "sha512"); + const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(goldilockSalt), 2048, 64, "sha512"); + const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(aesSalt), 2048, 64, "sha512"); return { - aes: aesKeySeed.toString("hex"), - goldilock: goldilockKey.toString("hex"), + aes: Buffer.from(aesKeySeed).toString("hex"), + goldilock: Buffer.from(goldilockKey).toString("hex"), }; }; //# sourceMappingURL=mnemonicToSeed.js.map \ No newline at end of file diff --git a/lib.esm/wallet/mnemonicToSeed.js.map b/lib.esm/wallet/mnemonicToSeed.js.map index 262290427..23438518b 100644 --- a/lib.esm/wallet/mnemonicToSeed.js.map +++ b/lib.esm/wallet/mnemonicToSeed.js.map @@ -1 +1 @@ -{"version":3,"file":"mnemonicToSeed.js","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,QAAiB;IAChE,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,EAAE,CAAC;KACf;IACD,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,CAAC,CAAC,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,QAAiB,EAAE,EAAE;IAC3D,MAAM,mBAAmB,GAAG,UAAU,CAAC;IACvC,MAAM,aAAa,GAAG,sBAAsB,CAAC;IAE7C,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,mBAAmB,GAAG,QAAQ,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,GAAG,QAAQ,CAAC,CAAC;IAEtD,MAAM,YAAY,GAAG,UAAU,CAC7B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EACrB,aAAa,EACb,IAAI,EACJ,EAAE,EACF,QAAQ,CACT,CAAC;IAEF,MAAM,UAAU,GAAG,UAAU,CAC3B,MAAM,C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CAAC,IAAI,CAAC,QAAQ,CAAC,EACrB,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EACpB,IAAI,EACJ,EAAE,EACF,QAAQ,CACR,CAAC;IAEF,OAAO;QACN,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC5C,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;KACpD,CAAC;AACH,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/utils.js.map b/lib.esm/wallet/utils.js.map index 6bf9e19de..7ffbbe739 100644 --- a/lib.esm/wallet/utils.js.map +++ b/lib.esm/wallet/utils.js.map @@ -1 +1 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src.ts/wallet/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAChE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;KAC9B;IACD,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,KAAsB,EAAE,MAAc;IACzD,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE;QAC5B,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;KACrB;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAA6B;IACvD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,OAAO,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,CA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AAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzD,OAAoB,UAAU,CAAC,GAAG,CAAE,CAAC;YACtC,CAAC;QACF,CAAC;QAED,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;YACrB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;gBAC7B,OAAoB,aAAa,CAAC,GAAG,CAAE,CAAC;YACzC,CAAC;QACF,CAAC;QAED,IAAI,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5C,OAAoB,GAAI,CAAC;QAC1B,CAAC;QACD,IAAI,IAAI,KAAK,OAAO,GAAG,EAAE,CAAC;YACzB,OAAO,GAAG,CAAC;QACZ,CAAC;QAED,cAAc,CAAC,KAAK,EAAE,wBAAwB,IAAI,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BE;AACF,0DAA0D;AAC1D;;;;;;;;;;;;;;;;;;;;;;;EAuBE"} \ No newline at end of file diff --git a/lib.esm/wallet/wallet.d.ts.map b/lib.esm/wallet/wallet.d.ts.map index edbeaa1bd..b640b9ef5 100644 --- a/lib.esm/wallet/wallet.d.ts.map +++ b/lib.esm/wallet/wallet.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAe,YAAY,EAAE,MAAM,eAAe,CAAC;AAW1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AActD;;;;;;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AAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,CAiBhC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,GAC3B,YAAY,GAAG,MAAM,CAWvB;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAClB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,YAAY,CAWd;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,YAAY,CAUf;IACD,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAUf;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/wallet.js.map b/lib.esm/wallet/wallet.js.map index ba08710a9..90a9801c4 100644 --- a/lib.esm/wallet/wallet.js.map +++ b/lib.esm/wallet/wallet.js.map @@ -1 +1 @@ -{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE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AC,CAAC;SACtE;QAED,OAAO,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,MAAc,EACd,QAA0B;QAE1B,MAAM,MAAM,GAAG,YAAY,CAAC,YAAY,CACtC,MAAM,EACN,SAAS,EACT,SAAS,EACT,SAAS,CACV,CAAC;QACF,IAAI,QAAQ,EAAE;YACZ,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACjC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EAChB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,GAMT;QACC,MAAM,MAAM,GAAG,YAAY,CAAC,UAAU,CAAC;YACrC,MAAM;YACN,MAAM;YACN,QAAQ;SACT,CAAC,CAAC;QACH,IAAI,QAAQ,EAAE;YACZ,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACjC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,EACd,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,IAAI,GAML;QACC,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC;YACnC,IAAI;YACJ,MAAM;YACN,IAAI,EAAE,IAAI,IAAI,WAAW;SAC1B,CAAC,CAAC;QACH,IAAI,QAAQ,EAAE;YACZ,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SACjC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kB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bit-reader.js.map b/lib.esm/wordlists/bit-reader.js.map index f7ee6ddba..f7282c1a6 100644 --- a/lib.esm/wordlists/bit-reader.js.map +++ b/lib.esm/wordlists/bit-reader.js.map @@ -1 +1 @@ -{"version":3,"file":"bit-reader.js","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GACV,kEAAkE,CAAC;AAErE;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,IAAY;IACpD,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,IAAI,KAAK,GAAG,CAAC,EACX,IAAI,GAAG,CAAC,EACR,KAAK,GAAG,CAAC,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,4BAA4B;QAC5B,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,CAAC;QAEV,qCAAqC;QACrC,OAAO,IAAI,IAAI,KAAK,EAAE;YACpB,mBAAmB;YACnB,MAAM,KAAK,GAAG,KAAK,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;YACtC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,IAAI,KAAK,CAAC;YAEd,kDAAkD;YAClD,kCAAkC;YAClC,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,KAAK,IAAI,QAAQ,CAAC;aACnB;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;gBAC3B,KAAK,GAAG,CAAC,CAAC;aACX;SACF;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"} \ No newline at end of file +{"version":3,"file":"bit-reader.js","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GACX,kEAAkE,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,IAAY;IACrD,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,IAAI,KAAK,GAAG,CAAC,EACZ,IAAI,GAAG,CAAC,EACR,KAAK,GAAG,CAAC,CAAC;IACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,4BAA4B;QAC5B,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,CAAC;QAEV,qCAAqC;QACrC,OAAO,IAAI,IAAI,KAAK,EAAE,CAAC;YACtB,mBAAmB;YACnB,MAAM,KAAK,GAAG,KAAK,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;YACtC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,IAAI,KAAK,CAAC;YAEd,kDAAkD;YAClD,kCAAkC;YAClC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACjB,KAAK,IAAI,QAAQ,CAAC;YACnB,CAAC;iBAAM,CAAC;gBACP,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;gBAC3B,KAAK,GAAG,CAAC,CAAC;YACX,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owl.js.map b/lib.esm/wordlists/decode-owl.js.map index 35bb4d0d1..05bb54eb9 100644 --- a/lib.esm/wordlists/decode-owl.js.map +++ b/lib.esm/wordlists/decode-owl.js.map @@ -1 +1 @@ -{"version":3,"file":"decode-owl.js","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,QAAQ,GAAG,+BAA+B,CAAC;AACjD,MAAM,IAAI,GAAG,WAAW,CAAC;AAEzB,SAAS,MAAM,CAAC,KAAoB,EAAE,GAAW;IAC/C,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,OAAO,KAAK,CAAC,MAAM,CACjB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACd,IAAI,IAAI,KAAK,GAAG,EAAE;YAChB,OAAO,EAAE,CAAC;SACX;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YAC3B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;SACjD;aAAM;YACL,OAAO,GAAG,EAAE,CAAC;YACb,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClB;QACD,OAAO,KAAK,CAAC;IACf,CAAC,EACc,EAAE,CAClB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE,IAAY;IAC/C,yDAAyD;IACzD,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;QAC7C,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,CAA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,IAAI,EAAE,IAAI,EAAE,EAAE;QACzB,IAAI,IAAI,EAAE,CAAC;YACV,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC1C,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAClB,CAAC;QACF,CAAC;aAAM,CAAC;YACP,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC,CACD,CAAC;IACF,qBAAqB;IACrB,IAAI,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC;IACD,oBAAoB;IAEpB,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,uBAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAEvE,OAAO,MAAM,CACZ,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,EACvC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAC1C,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owla.js.map b/lib.esm/wordlists/decode-owla.js.map index 044e6bd43..fb53252a4 100644 --- a/lib.esm/wordlists/decode-owla.js.map +++ b/lib.esm/wordlists/decode-owla.js.map @@ -1 +1 @@ -{"version":3,"file":"decode-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],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,CAAC,SAAS,CAAC,CAAC;YACnC,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;gBACf,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;gBAC7D,SAAS,EAAE,CAAC;YACb,CAAC;YACD,OAAO,MAAM,CAAC;QACf,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/enwords.d.ts.map b/lib.esm/wordlists/enwords.d.ts.map index 95d94c6d6..ff2c89431 100644 --- a/lib.esm/wordlists/enwords.d.ts.map +++ b/lib.esm/wordlists/enwords.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"enwords.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,i0VAC4yV,CAAC"} \ No newline at end of file +{"version":3,"file":"enwords.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,i0VAC2yV,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/enwords.js.map b/lib.esm/wordlists/enwords.js.map index 9210b1461..073cd4118 100644 --- a/lib.esm/wordlists/enwords.js.map +++ b/lib.esm/wordlists/enwords.js.map @@ -1 +1 @@ -{"version":3,"file":"enwords.js","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAClB,8zVAA8zV,CAAC"} \ No newline at end of file +{"version":3,"file":"enwords.js","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GACnB,8zVAA8zV,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/generation/encode-latin.d.ts.map b/lib.esm/wordlists/generation/encode-latin.d.ts.map index 87eca3714..0a1f29f5d 100644 --- a/lib.esm/wordlists/generation/encode-latin.d.ts.map +++ b/lib.esm/wordlists/generation/encode-latin.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAyIA,qBAAa,SAAS;;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAKX,KAAK,EAAE,MAAM;IAMzB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAW1B,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA8BjB;CACF;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IACpD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB,CA+FA;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAmDA"} \ No newline at end of file +{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAyIA,qBAAa,SAAS;;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAKvB,YAAY,KAAK,EAAE,MAAM,EAIxB;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CASzB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA8BjB;CACD;AAED,MAAM,WAAW,SAAS;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IACrD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,CA+FA;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb,CAmDA"} \ No newline at end of file diff --git a/lib.esm/wordlists/generation/encode-latin.js.map b/lib.esm/wordlists/generation/encode-latin.js.map index 5c0d5733a..7ac8b12a0 100644 --- a/lib.esm/wordlists/generation/encode-latin.js.map +++ b/lib.esm/wordlists/generation/encode-latin.js.map @@ -1 +1 @@ -{"version":3,"file":"encode-latin.js","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,EAAE;AACF,6DAA6D;AAC7D,2DAA2D;AAC3D,wDAAwD;AACxD,WAAW;AACX,EAAE;AACF,0BAA0B;AAC1B,uCAAuC;AACvC,6DAA6D;AAC7D,mBAAmB;AACnB,uCAAuC;AACvC,4DAA4D;AAC5D,6DAA6D;AAC7D,kBAAkB;AAClB,EAAE;AACF,mEAAmE;AACnE,mEAAmE;AACnE,qCAAqC;AACrC,qDAAqD;AACrD,kEAAkE;AAClE,qBAAqB;A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AAO,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CACT,YAAY,EACZ,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CACvD,CAAC;IACF,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;KAC9B;CACF"} \ No newline at end of file +{"version":3,"file":"encode-latin.js","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,EAAE;AACF,6DAA6D;AAC7D,2DAA2D;AAC3D,wDAAwD;AACxD,WAAW;AACX,EAAE;AACF,0BAA0B;AAC1B,uCAAuC;AACvC,6DAA6D;AAC7D,mBAAmB;AACnB,uCAAuC;AACvC,4DAA4D;AAC5D,6DAA6D;AAC7D,kBAAkB;AAClB,EAAE;AACF,mEAAmE;AACnE,mEAAmE;AACnE,qCAAqC;AACrC,qDAAqD;AACrD,kEAAkE;AAClE,qBAAqB;AACrB,6CAA6C;AAC7C,+DAA+D;AAC/D,qEAAqE;AACrE,UAAU;AACV,iDAAiD;AACjD,wEAAwE;AACxE,6BAA6B;AAC7B,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,yEAAyE;AACzE,iBAAiB;AACjB,EAAE;AACF,qBAAqB;AACrB,EAAE;AACF,sEAAsE;AACtE,mEAAmE;AACnE,wEAAwE;AACxE,QAAQ;AACR,EAAE;AACF,sEAAsE;AACtE,0EAA0E;AAC1E,wDAAwD;AACxD,qCAAqC;AACrC,6EAA6E;AAC7E,6BAA6B;AAC7B,sBAAsB;AACtB,qCAAqC;AACrC,sBAAsB;AACtB,sEAAsE;AACtE,0BAA0B;AAC1B,qCAAqC;AACrC,EAAE;AACF,0DAA0D;AAC1D,uEA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,CACV,YAAY,EACZ,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CACtD,CAAC;IACF,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;AACF,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-cz.d.ts.map b/lib.esm/wordlists/lang-cz.d.ts.map index 0db7b336b..344196e7e 100644 --- a/lib.esm/wordlists/lang-cz.d.ts.map +++ b/lib.esm/wordlists/lang-cz.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-cz.js.map b/lib.esm/wordlists/lang-cz.js.map index 0b5b98019..abb100879 100644 --- a/lib.esm/wordlists/lang-cz.js.map +++ b/lib.esm/wordlists/lang-cz.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-cz.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACT,q9NAAq9N,CAAC;AACx9N,MAAM,QAAQ,GACZ,oEAAoE,CAAC;AAEvE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;IACH;QACE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"lang-cz.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACV,q9NAAq9N,CAAC;AACv9N,MAAM,QAAQ,GACb,oEAAoE,CAAC;AAEtE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-en.d.ts.map b/lib.esm/wordlists/lang-en.d.ts.map index c43c99b64..bcff43d4d 100644 --- a/lib.esm/wordlists/lang-en.d.ts.map +++ b/lib.esm/wordlists/lang-en.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-en.js.map b/lib.esm/wordlists/lang-en.js.map index 196a6442d..ad1b69854 100644 --- a/lib.esm/wordlists/lang-en.js.map +++ b/lib.esm/wordlists/lang-en.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-en.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACT,u3LAAu3L,CAAC;AAC13L,MAAM,QAAQ,GACZ,oEAAoE,CAAC;AAEvE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;IACH;QACE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"lang-en.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACV,u3LAAu3L,CAAC;AACz3L,MAAM,QAAQ,GACb,oEAAoE,CAAC;AAEtE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-es.d.ts.map b/lib.esm/wordlists/lang-es.d.ts.map index 1f4b7bb34..e52928599 100644 --- a/lib.esm/wordlists/lang-es.d.ts.map +++ b/lib.esm/wordlists/lang-es.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACtC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-es.js.map b/lib.esm/wordlists/lang-es.js.map index e5ac2e783..9aa9c4d52 100644 --- a/lib.esm/wordlists/lang-es.js.map +++ b/lib.esm/wordlists/lang-es.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-es.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,KAAK,GACT,iwLAAiwL,CAAC;AACpwL,MAAM,OAAO,GACX,gWAAgW,CAAC;AACnW,MAAM,QAAQ,GACZ,oEAAoE,CAAC;AAEvE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,YAAY;IACtC;;;;;;;OAOG;IACH;QACE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"lang-es.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,KAAK,GACV,iwLAAiwL,CAAC;AACnwL,MAAM,OAAO,GACZ,gWAAgW,CAAC;AAClW,MAAM,QAAQ,GACb,oEAAoE,CAAC;AAEtE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-fr.d.ts.map b/lib.esm/wordlists/lang-fr.d.ts.map index 3f40d40a0..c10fb3e78 100644 --- a/lib.esm/wordlists/lang-fr.d.ts.map +++ b/lib.esm/wordlists/lang-fr.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-fr.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-fr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACtC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-fr.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-fr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-fr.js.map b/lib.esm/wordlists/lang-fr.js.map index d3fdc2e96..241c18c77 100644 --- a/lib.esm/wordlists/lang-fr.js.map +++ b/lib.esm/wordlists/lang-fr.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-fr.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-fr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,KAAK,GACT,u9OAAu9O,CAAC;AAC19O,MAAM,OAAO,GACX,kWAAkW,CAAC;AACrW,MAAM,QAAQ,GACZ,oEAAoE,CAAC;AAEvE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,YAAY;IACtC;;;;;;;OAOG;IACH;QACE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"lang-fr.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-fr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,KAAK,GACV,u9OAAu9O,CAAC;AACz9O,MAAM,OAAO,GACZ,kWAAkW,CAAC;AACpW,MAAM,QAAQ,GACb,oEAAoE,CAAC;AAEtE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-it.d.ts.map b/lib.esm/wordlists/lang-it.d.ts.map index 52039429e..fbb232db7 100644 --- a/lib.esm/wordlists/lang-it.d.ts.map +++ b/lib.esm/wordlists/lang-it.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-it.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-it.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-it.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-it.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-it.js.map b/lib.esm/wordlists/lang-it.js.map index f0f022c29..2c46a7e63 100644 --- a/lib.esm/wordlists/lang-it.js.map +++ b/lib.esm/wordlists/lang-it.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-it.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-it.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACT,0+OAA0+O,CAAC;AAC7+O,MAAM,QAAQ,GACZ,oEAAoE,CAAC;AAEvE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;IACH;QACE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"lang-it.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-it.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACV,0+OAA0+O,CAAC;AAC5+O,MAAM,QAAQ,GACb,oEAAoE,CAAC;AAEtE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ja.d.ts.map b/lib.esm/wordlists/lang-ja.d.ts.map index f4acbfdf3..82a3ec1e4 100644 --- a/lib.esm/wordlists/lang-ja.d.ts.map +++ b/lib.esm/wordlists/lang-ja.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6IzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC;;;;;;;OAOG;;IAKH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6IzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ja.js.map b/lib.esm/wordlists/lang-ja.js.map index 5e722af6f..c14d46263 100644 --- a/lib.esm/wordlists/lang-ja.js.map +++ b/lib.esm/wordlists/lang-ja.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-ja.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EACL,OAAO,EACP,cAAc,EACd,WAAW,EACX,YAAY,GACb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,IAAI,GAAG;IACX,eAAe;IACf,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c;QACnB,2BAA2B;QAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,KAAoB;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ko.d.ts.map b/lib.esm/wordlists/lang-ko.d.ts.map index 8b8d34088..4e6fdeecb 100644 --- a/lib.esm/wordlists/lang-ko.d.ts.map +++ b/lib.esm/wordlists/lang-ko.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC;;;;;;;OAOG;;IAKH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ko.js.map b/lib.esm/wordlists/lang-ko.js.map index a756d46ea..9a24b792d 100644 --- a/lib.esm/wordlists/lang-ko.js.map +++ b/lib.esm/wordlists/lang-ko.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-ko.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,IAAI,GAAG;IACX,MAAM;IACN,y5JAAy5J;IACz5J,8lIAA8lI;IAC9lI,i8BAAi8B;IACj8B,koCAAkoC;IACloC,yaAAya;IACza,gHAAgH;IAChH,+EAA+E;CAChF,CAAC;AAEF,MAAM,KAAK,GACT,wEAAwE,CAAC;AAE3E,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,IAAI,IAAI,EAAE,EAAE;QACd,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;KACxB;SAAM,IAAI,IAAI,IAAI,EAAE,EAAE;QACrB,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;KACvB;IAED,OAAO,YAAY,CACjB,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAC9D,CAAC;AACJ,CAAC;AAED,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,SAAS,SAAS;IAChB,IAAI,SAAS,IAAI,IAAI,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,QAAQ,GAAkB,EAAE,CAAC;IA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QACF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,YAAY,CAAC,IAAY;QACvB,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"lang-ko.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,IAAI,GAAG;IACZ,MAAM;IACN,y5JAAy5J;IACz5J,8lIAA8lI;IAC9lI,i8BAAi8B;IACj8B,koCAAkoC;IACloC,yaAAya;IACza,gHAAgH;IAChH,+EAA+E;CAC/E,CAAC;AAEF,MAAM,KAAK,GACV,wEAAwE,CAAC;AAE1E,SAAS,SAAS,CAAC,IAAY;IAC9B,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;QAChB,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;IACxB,CAAC;SAAM,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,YAAY,CAClB,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAC7D,CAAC;AACH,CAAC;AAED,IAAI,SAAS,GAAyB,IAAI,CAA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pB,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;QAC1B,cAAc,CACb,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAClC,uBAAuB,KAAK,EAAE,EAC9B,OAAO,EACP,KAAK,CACL,CAAC;QACF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,IAAY;QACxB,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-pt.d.ts.map b/lib.esm/wordlists/lang-pt.d.ts.map index c979f9c09..024c97c03 100644 --- a/lib.esm/wordlists/lang-pt.d.ts.map +++ b/lib.esm/wordlists/lang-pt.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-pt.js.map b/lib.esm/wordlists/lang-pt.js.map index 3c5b6e42b..88dbc04f3 100644 --- a/lib.esm/wordlists/lang-pt.js.map +++ b/lib.esm/wordlists/lang-pt.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-pt.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACT,s0OAAs0O,CAAC;AACz0O,MAAM,QAAQ,GACZ,oEAAoE,CAAC;AAEvE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;IACH;QACE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACb,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;SACzB;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"lang-pt.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACV,s0OAAs0O,CAAC;AACx0O,MAAM,QAAQ,GACb,oEAAoE,CAAC;AAEtE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-zh.d.ts.map b/lib.esm/wordlists/lang-zh.d.ts.map index 8dd1943aa..06d1b5870 100644 --- a/lib.esm/wordlists/lang-zh.d.ts.map +++ b/lib.esm/wordlists/lang-zh.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC;;;;;;;;;OASG;gBACS,OAAO,EAAE,MAAM;IAI3B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAMzC"} \ No newline at end of file +{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;;;OASG;IACH,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKvC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-zh.js.map b/lib.esm/wordlists/lang-zh.js.map index 4d8be371e..dccaac86c 100644 --- a/lib.esm/wordlists/lang-zh.js.map +++ b/lib.esm/wordlists/lang-zh.js.map @@ -1 +1 @@ -{"version":3,"file":"lang-zh.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,IAAI,GACR,kgMAAkgM,CAAC;AACrgM,MAAM,SAAS,GACb,6lDAA6lD,CAAC;AAEhmD,MAAM,SAAS,GAAyC;IACtD,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,MAAM,GAA2B;IACrC,KAAK,EAAE,oEAAoE;IAC3E,KAAK,EAAE,oEAAoE;CAC5E,CAAC;AAEF,MAAM,KAAK,GACT,kEAAkE,CAAC;AACrE,MAAM,KAAK,GAAG,4BAA4B,CAAC;AAE3C,SAAS,SAAS,CAAC,MAAc;IAC/B,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;QAC7B,OAAO,SAAS,CAAC,MAAM,CAAkB,CAAC;KAC3C;IAED,MAAM,QAAQ,GAAG,EAAE,CAAC;IAEpB,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;QAC7B,MAAM,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACrC,MAAM,KAAK,GAAG;YACZ,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC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,MAAM,CAAC,QAAQ,CAAC,OAAe;QAC9B,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;YAChC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owl.d.ts.map b/lib.esm/wordlists/wordlist-owl.d.ts.map index c0dcec9e9..cb5198fb8 100644 --- a/lib.esm/wordlists/wordlist-owl.d.ts.map +++ b/lib.esm/wordlists/wordlist-owl.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIvC;;;OAGG;gBACS,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAO1D,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;IAsB7B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGnC"} \ No newline at end of file +{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIxC;;;OAGG;IACH,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAKzD;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;IAoBD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owl.js.map b/lib.esm/wordlists/wordlist-owl.js.map index 34f540c0f..9856e4343 100644 --- a/lib.esm/wordlists/wordlist-owl.js.map +++ b/lib.esm/wordlists/wordlist-owl.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owl.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,0CAA0C;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,WAAY,SAAQ,QAAQ;IACvC,KAAK,CAAS;IACd,SAAS,CAAS;IAElB;;;OAGG;IACH,YAAY,MAAc,EAAE,IAAY,EAAE,QAAgB;QACxD,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,YAAY;QACV,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,CAAuB;IAC7B,UAAU;QACR,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YACvB,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YAElC,qDAAqD;YACrD,MAAM,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC;YACnD,qBAAqB;YACrB,IAAI,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;gBAC/B,MAAM,IAAI,KAAK,CAAC,sBAAsB,IAAI,CAAC,MAAM,aAAa,CAAC,CAAC;aACjE;YACD,oBAAoB;YAEpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;SACrB;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAChC,cAAc,CACZ,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAClC,uBAAuB,KAAK,EAAE,EAC9B,OAAO,EACP,KAAK,CACN,CAAC;QACF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,YAAY,CAAC,IAAY;QACvB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"wordlist-owl.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,0CAA0C;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,WAAY,SAAQ,QAAQ;IACxC,KAAK,CAAS;IACd,SAAS,CAAS;IAElB;;;OAGG;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,IAAI,CAAC,CAAC;IACxC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owla.d.ts.map b/lib.esm/wordlists/wordlist-owla.d.ts.map index a02c1dff5..ed20b28e0 100644 --- a/lib.esm/wordlists/wordlist-owla.d.ts.map +++ b/lib.esm/wordlists/wordlist-owla.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;gBAG/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAK1E,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;CAG9B"} \ No newline at end of file +{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;IAG5C,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAGzE;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owla.js.map b/lib.esm/wordlists/wordlist-owla.js.map index fc0603c94..290c81ea3 100644 --- a/lib.esm/wordlists/wordlist-owla.js.map +++ b/lib.esm/wordlists/wordlist-owla.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,OAAO,CAAS;IAEhB,YAAY,MAAc,EAAE,IAAY,EAAE,MAAc,EAAE,QAAgB;QACxE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,YAAY;QACV,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"wordlist-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC5C,OAAO,CAAS;IAEhB,YAAY,MAAc,EAAE,IAAY,EAAE,MAAc,EAAE,QAAgB;QACzE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,YAAY;QACX,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist.d.ts.map b/lib.esm/wordlists/wordlist.d.ts.map index ef52e4565..c298de76e 100644 --- a/lib.esm/wordlists/wordlist.d.ts.map +++ b/lib.esm/wordlists/wordlist.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC5B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAIpC;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAEvC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAC3C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM;CAYzC"} \ No newline at end of file +{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC7B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAM,EAAE,MAAM,EAEzB;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAEnC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAWvC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist.js.map b/lib.esm/wordlists/wordlist.js.map index 9c0fcaec2..d0daa2a1e 100644 --- a/lib.esm/wordlists/wordlist.js.map +++ b/lib.esm/wordlists/wordlist.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlist.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,MAAM,OAAgB,QAAQ;IAC5B,MAAM,CAAU;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAc;QACxB,gBAAgB,CAAW,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAc;QAClB,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAoB;QACvB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAeD,MAAM,CAAC,KAAK,CAAC,QAAkB;QAC7B,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;YAC7B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,wBAAwB;YACxB,IAAI,CAAC,KAAK,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;gBACrC,OAAO,IAAI,CAAC;aACb;YACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClB;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACrC,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"wordlist.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,MAAM,OAAgB,QAAQ;IAC7B,MAAM,CAAU;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAc;QACzB,gBAAgB,CAAW,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAc;QACnB,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAoB;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAeD,MAAM,CAAC,KAAK,CAAC,QAAkB;QAC9B,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,wBAAwB;YACxB,IAAI,CAAC,KAAK,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvC,OAAO,IAAI,CAAC;YACb,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACpC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists-browser.js.map b/lib.esm/wordlists/wordlists-browser.js.map index 997302999..f4a98b126 100644 --- a/lib.esm/wordlists/wordlists-browser.js.map +++ b/lib.esm/wordlists/wordlists-browser.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlists-browser.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,MAAM,CAAC,MAAM,SAAS,GAA6B;IACjD,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;CACtB,CAAC"} \ No newline at end of file +{"version":3,"file":"wordlists-browser.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,MAAM,CAAC,MAAM,SAAS,GAA6B;IAClD,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;CACrB,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists.js.map b/lib.esm/wordlists/wordlists.js.map index c3fa83e3f..15c990e52 100644 --- a/lib.esm/wordlists/wordlists.js.map +++ b/lib.esm/wordlists/wordlists.js.map @@ -1 +1 @@ -{"version":3,"file":"wordlists.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,E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rB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;CAC5B,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..36177b746 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1576 @@ +{ + "name": "corebc", + "version": "0.4.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "corebc", + "version": "0.4.1", + "license": "CORE", + "dependencies": { + "@noble/hashes": "2.4.0", + "@types/node": "26.4.1", + "aes-js": "3.1.2", + "bcrypto": "^5.5.2", + "bn.js": "^5.2.5", + "buffer": "^6.0.3", + "tslib": "2.8.1", + "utf8": "^3.0.0", + "ws": "8.21.3" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^29.0.0", + "@rollup/plugin-inject": "^5.0.5", + "@rollup/plugin-node-resolve": "16.0.3", + "@types/bn.js": "^5.2.0", + "@types/mocha": "10.0.10", + "@types/semver": "7.8.0", + "@types/utf8": "^3.0.3", + "c8": "12.0.0", + "mocha": "12.0.0", + "prettier": "^3.9.6", + "rollup": "4.63.1", + "semver": "7.8.5", + "typescript": "7.0.2", + "uglify-js": "3.19.3" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz", + "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@noble/hashes": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.4.0.tgz", + "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@rollup/plugin-commonjs": { + "version": "29.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-29.0.3.tgz", + "integrity": "sha512-ZaOxZceP7SOUW7Lqw5IRVweSQYWaeIPnXIGLiB690EBA3FGJTO40EEr2L5yZplJWsgTCogILRSpcAe7+U0Otdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-inject": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz", + "integrity": "sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.3" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-node-resolve": { + "version": "16.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", + "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/resolve": "1.20.2", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.78.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.4.0.tgz", + "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.1.tgz", + "integrity": "sha512-FQNqd1lRy/0QhDk3xeRIkSBiCpXCiDnZO3YLVdcDKN1UBiKToNftCzcXYNLshmPDUMlu2TdeS8tGcsU6f3YF1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@types/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-DLbJ1BPqxvQhIGbeu8VbUC1DiAiahHtAYvA0ZEAa4P31F7IaArc8z3C3BRQdWX4mtLQuABG4yzp76ZrS02Ui1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mocha": { + "version": "10.0.10", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", + "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "26.4.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.4.1.tgz", + "integrity": "sha512-k97ENvZWtvA6yqz5/FS6a7duDgOPEeOQOc2iKS/nY6mX6qJUKtLnWzQS+Xj6tXweyj6ZcTAK2Qecetnvi9nCLA==", + "license": "MIT", + "dependencies": { + "undici-types": "~8.3.0" + } + }, + "node_modules/@types/resolve": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", + "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/semver": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.8.0.tgz", + "integrity": "sha512-1mAINjtQCXXeLkJ9ehXkwOcBpqtLxiVtKhpUf83DdRNdQKV0iXZpaHYqRr7nj+wvxuJzoAmAwXI+sCNMv1CzLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/utf8": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/utf8/-/utf8-3.0.3.tgz", + "integrity": "sha512-+lqLGxWZsEe4Z6OrzBI7Ym4SMUTaMS5yOrHZ0/IL0bpIye1Qbs4PpobJL2mLDbftUXlPFZR7fu6d1yM+bHLX1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript/typescript-darwin-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/aes-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", + "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==", + "license": "MIT" + }, + "node_modules/ansi-regex": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.3.0.tgz", + "integrity": "sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bcrypto": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/bcrypto/-/bcrypto-5.5.2.tgz", + "integrity": "sha512-k3PF755oJM0+25iOVuraNedF5XneykxRwl+oBoMeQPfYee4qX8hHQhKCsNZWLthNYgi41GH2ysopd/8sDQDhEw==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "bufio": "~1.0.7", + "loady": "~0.0.5" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/bn.js": { + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.5.tgz", + "integrity": "sha512-Vq886eXykuP5E6HcKSSStP3bJgrE6In5WKxVUvJ8XGpWWYs2xZHWqUwzCtGgEtBcxyd57KBFDPFoUfNzdaHCNg==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", + "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "license": "ISC" + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/bufio": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/bufio/-/bufio-1.0.7.tgz", + "integrity": "sha512-bd1dDQhiC+bEbEfg56IdBv7faWa6OipMs/AFFFvtFnB3wAYjlwQpQRZ0pm6ZkgtfL0pILRXhKxOiQj6UzoMR7A==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/c8": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/c8/-/c8-12.0.0.tgz", + "integrity": "sha512-4zpJvrd1nKWutnnKC2pXkFmb6iM1l+ffN//o1CzlTNwW7GSOs9a1xrLqkC48nU8oEkjmPZLPiwMsIaOvoF4Pqg==", + "dev": true, + "license": "ISC", + "dependencies": { + "@bcoe/v8-coverage": "^1.0.1", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^8.0.0", + "v8-to-istanbul": "^9.0.0", + "yargs": "^18.0.0", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2" + }, + "peerDependenciesMeta": { + "monocart-coverage-reports": { + "optional": true + } + } + }, + "node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/cliui": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/diff": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz", + "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/foreground-child/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has/node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true, + "license": "MIT" + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", + "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/js-yaml": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.4.1.tgz", + "integrity": "sha512-28R/k+NAjeuf7+CKlTxWZVExJGwVVLwY06DgEnOMz2gEpfNkDcD7QvyiVPT0xy0XXhU8vHsd4Ot42OOPdJG7dQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.mjs" + } + }, + "node_modules/loady": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/loady/-/loady-0.0.5.tgz", + "integrity": "sha512-uxKD2HIj042/HBx77NBcmEPsD+hxCgAtjEWlYNScuUjIsh/62Uyu39GOR68TBR68v+jqDL9zfftCWoUo4y03sQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lru-cache": { + "version": "11.5.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mocha": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-12.0.0.tgz", + "integrity": "sha512-NYNh5IFt6WYqm9bi4601m7vix8MZdXC0DwS4gY6WhXO2RgJWhivhISVmq1oklCif18OSI9l+vx5Mdm5oh1XGiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "browser-stdout": "^1.3.1", + "chokidar": "^5.0.0", + "debug": "^4.3.5", + "diff": "^9.0.0", + "find-up": "^5.0.0", + "glob": "^13.0.0", + "is-path-inside": "^3.0.3", + "is-unicode-supported": "^0.1.0", + "js-yaml": "^5.0.0", + "minimatch": "^10.2.2", + "ms": "^2.1.3", + "picocolors": "^1.1.1", + "serialize-javascript": "^7.0.2", + "strip-json-comments": "^5.0.3", + "supports-color": "^8.1.1", + "workerpool": "^10.0.0" + }, + "bin": { + "mocha": "bin/mocha.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prettier": { + "version": "3.9.6", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz", + "integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/readdirp": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz", + "integrity": "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/resolve": { + "version": "1.22.6", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", + "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rollup": { + "version": "4.63.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.1.tgz", + "integrity": "sha512-3Df9jsstwhccuEfmAMi9l8XUh/GOkVObmFTU7CCVBysEbcOZLl84jCtaAZMcPiMz2EGKsATzQcU+Xr3n/wU6cg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.63.1", + "@rollup/rollup-android-arm64": "4.63.1", + "@rollup/rollup-darwin-arm64": "4.63.1", + "@rollup/rollup-darwin-x64": "4.63.1", + "@rollup/rollup-freebsd-arm64": "4.63.1", + "@rollup/rollup-freebsd-x64": "4.63.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.63.1", + "@rollup/rollup-linux-arm-musleabihf": "4.63.1", + "@rollup/rollup-linux-arm64-gnu": "4.63.1", + "@rollup/rollup-linux-arm64-musl": "4.63.1", + "@rollup/rollup-linux-loong64-gnu": "4.63.1", + "@rollup/rollup-linux-loong64-musl": "4.63.1", + "@rollup/rollup-linux-ppc64-gnu": "4.63.1", + "@rollup/rollup-linux-ppc64-musl": "4.63.1", + "@rollup/rollup-linux-riscv64-gnu": "4.63.1", + "@rollup/rollup-linux-riscv64-musl": "4.63.1", + "@rollup/rollup-linux-s390x-gnu": "4.63.1", + "@rollup/rollup-linux-x64-gnu": "4.63.1", + "@rollup/rollup-linux-x64-musl": "4.63.1", + "@rollup/rollup-openbsd-x64": "4.63.1", + "@rollup/rollup-openharmony-arm64": "4.63.1", + "@rollup/rollup-win32-arm64-msvc": "4.63.1", + "@rollup/rollup-win32-ia32-msvc": "4.63.1", + "@rollup/rollup-win32-x64-gnu": "4.63.1", + "@rollup/rollup-win32-x64-msvc": "4.63.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.1.tgz", + "integrity": "sha512-k3CMsaIvvdSwm8oLB4MXSl0wH2/cwlH7xGcnRd2DaeRmBkbzYmyT8j0tsX60DwD1eRwHTpNpH8ljKu9oUT1MeQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-json-comments": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz", + "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-8.0.0.tgz", + "integrity": "sha512-ZOffsNrXYggvU1mDGHk54I96r26P8SyMjO5slMKSc7+IWmtB/MQKnEC2fP51imB3/pT6YK5cT5E8f+Dd9KdyOQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^13.0.6", + "minimatch": "^10.2.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc" + }, + "engines": { + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" + } + }, + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/undici-types": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", + "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", + "license": "MIT" + }, + "node_modules/utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "license": "MIT" + }, + "node_modules/v8-to-istanbul": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/workerpool": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-10.0.3.tgz", + "integrity": "sha512-6z2Iis68Wqth93/G/wJP9u+R3O+d2XTlgWChGCwuT1qLbBsOYueGRZuJ++v3mtDP5KjYdy+WzvWC+VWETSVXJA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ws": { + "version": "8.21.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz", + "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.1.0.tgz", + "integrity": "sha512-2rAgRKu54VsHkqI0/tYkmluGXHD4KW7yZoycuqDQ15QOTnc2VVfy0nN/1eMhnQLO00A+dwtK20xuCnc1YGeUyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^9.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "string-width": "^8.2.1", + "y18n": "^5.0.5", + "yargs-parser": "^22.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/string-width": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", + "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-east-asian-width": "^1.5.0", + "strip-ansi": "^7.1.2" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/package.json b/package.json index 10b3ca86d..7ab65501f 100644 --- a/package.json +++ b/package.json @@ -1,128 +1,153 @@ { - "name": "corebc", - "version": "0.4.1", - "author": "CorePass", - "description": "A complete and compact CoreBC library, for Dapps, wallets and any other tools.", - "browser": { - "./lib.esm/crypto/crypto.js": "./lib.esm/crypto/crypto-browser.js", - "./lib.esm/providers/provider-ipcsocket.js": "./lib.esm/providers/provider-ipcsocket-browser.js", - "./lib.esm/providers/ws.js": "./lib.esm/providers/ws-browser.js", - "./lib.esm/utils/base64.js": "./lib.esm/utils/base64-browser.js", - "./lib.esm/utils/geturl.js": "./lib.esm/utils/geturl-browser.js", - "./lib.esm/crypto/ed448goldilock.js": "./lib.esm/crypto/ed448goldilock-browser.js", - "./src.ts/crypto/ed448goldilock.ts": "./src.ts/crypto/ed448goldilock-browser.ts", - "./lib.esm/wordlists/wordlists.js": "./lib.esm/wordlists/wordlists-browser.js" - }, - "dependencies": { - "@noble/hashes": "1.3.2", - "@noble/secp256k1": "2.0.0", - "@types/node": "20.6.4", - "aes-js": "3.1.2", - "bcrypto": "^5.4.0", - "bn.js": "^5.2.1", - "buffer": "^6.0.3", - "tslib": "2.6.2", - "utf8": "^3.0.0", - "ws": "8.14.2" - }, - "devDependencies": { - "@rollup/plugin-node-resolve": "15.2.3", - "@types/bn.js": "^5.1.2", - "@types/mocha": "10.0.2", - "@types/semver": "7.5.3", - "@types/utf8": "^3.0.1", - "c8": "8.0.1", - "mocha": "10.2.0", - "npm-run-all": "^4.1.5", - "prettier": "^3.0.3", - "rollup": "4.0.2", - "semver": "7.5.4", - "typescript": "5.2.2", - "uglify-js": "3.17.4" - }, - "engines": { - "node": ">=14.0.0" - }, - "exports": { - ".": { - "import": "./lib.esm/index.js", - "default": "./lib.commonjs/index.js" - }, - "./abi": { - "import": "./lib.esm/abi/index.js", - "default": "./lib.commonjs/abi/index.js" - }, - "./address": { - "import": "./lib.esm/address/index.js", - "default": "./lib.commonjs/address/index.js" - }, - "./constants": { - "import": "./lib.esm/constants/index.js", - "default": "./lib.commonjs/constants/index.js" - }, - "./contract": { - "import": "./lib.esm/contract/index.js", - "default": "./lib.commonjs/contract/index.js" - }, - "./crypto": { - "import": "./lib.esm/crypto/index.js", - "default": "./lib.commonjs/crypto/index.js" - }, - "./hash": { - "import": "./lib.esm/hash/index.js", - "default": "./lib.commonjs/hash/index.js" - }, - "./providers": { - "import": "./lib.esm/providers/index.js", - "default": "./lib.commonjs/providers/index.js" - }, - "./transaction": { - "import": "./lib.esm/transaction/index.js", - "default": "./lib.commonjs/transaction/index.js" - }, - "./utils": { - "import": "./lib.esm/utils/index.js", - "default": "./lib.commonjs/utils/index.js" - }, - "./wallet": { - "import": "./lib.esm/wallet/index.js", - "default": "./lib.commonjs/wallet/index.js" - }, - "./wordlists": { - "import": "./lib.esm/wordlists/index.js", - "default": "./lib.commonjs/wordlists/index.js" - } - }, - "license": "CORE", - "main": "./lib.commonjs/index.js", - "module": "./lib.esm/index.js", - "publishConfig": { - "access": "public", - "tag": "latest" - }, - "scripts": { - "_build-dist": "rollup -c && uglifyjs ./dist/corebc.js -o ./dist/corebc.min.js && uglifyjs ./dist/corebc.umd.js -o ./dist/corebc.umd.min.js && uglifyjs ./dist/wordlists-extra.js -o ./dist/wordlists-extra.min.js", - "_dist-stats": "gzip -k9f -S '.gz' ./dist/corebc.min.js && gzip -k9f -S '.gz' ./dist/corebc.umd.min.js && gzip -k9f -S '.gz' ./dist/wordlists-extra.min.js && du -hs ./dist/*.gz && echo '' && du -hs ./dist/*.js", - "auto-build": "npm run build -- -w", - "build": "tsc --project tsconfig.esm.json", - "build-all": "npm run build && npm run build-commonjs && npm run build-dist && npm run build-types", - "build-clean": "npm run clean && npm run build && node lib.esm/_admin/update-version.js && node lib.esm/_admin/update-changelog.js && npm run build-all && npm run _build-dist && npm run _dist-stats", - "build-commonjs": "tsc --project tsconfig.commonjs.json", - "build-dist": "npm run build && npm run _build-dist && npm run _dist-stats", - "build-types": "tsc --project tsconfig.types.json", - "clean": "rm -rf dist lib.esm lib.commonjs types && cp -r misc/basedirs/* .", - "clean-test": "npm run clean && npm run build && npm run test", - "format": "run-p format:*", - "format:prettier": "run-s \" lint:prettier --write \"", - "lint": "run-p lint:*", - "lint:prettier": "prettier \"src.ts/**/*.(md|json|yml|ts|tsx|html|css|js)\" --ignore-path .gitignore --check", - "stats": "echo 'Dependencies' && npm ls --all --omit=dev", - "test": "npm run test-esm", - "test-commonjs": "mocha ./lib.commonjs/_tests/test-*.js", - "test-coverage": "c8 -o output -r lcov -r text mocha --no-colo ./lib.esm/_tests/test-*.js | tee output/summary.txt", - "test-esm": "mocha ./lib.esm/_tests/test-*.js" - }, - "sideEffects": false, - "type": "module", - "types": "./types/index.d.ts" + "name": "corebc", + "version": "0.4.1", + "author": "CorePass", + "description": "A complete and compact CoreBC library, for Dapps, wallets and any other tools.", + "browser": { + "./lib.esm/crypto/crypto.js": "./lib.esm/crypto/crypto-browser.js", + "./lib.esm/providers/provider-ipcsocket.js": "./lib.esm/providers/provider-ipcsocket-browser.js", + "./lib.esm/providers/ws.js": "./lib.esm/providers/ws-browser.js", + "./lib.esm/utils/base64.js": "./lib.esm/utils/base64-browser.js", + "./lib.esm/utils/geturl.js": "./lib.esm/utils/geturl-browser.js", + "./lib.esm/crypto/ed448goldilock.js": "./lib.esm/crypto/ed448goldilock-browser.js", + "./src.ts/crypto/ed448goldilock.ts": "./src.ts/crypto/ed448goldilock-browser.ts", + "./lib.esm/wordlists/wordlists.js": "./lib.esm/wordlists/wordlists-browser.js" + }, + "dependencies": { + "@noble/hashes": "2.4.0", + "@types/node": "26.4.1", + "aes-js": "3.1.2", + "bcrypto": "^5.5.2", + "bn.js": "^5.2.5", + "buffer": "^6.0.3", + "tslib": "2.8.1", + "utf8": "^3.0.0", + "ws": "8.21.3" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^29.0.0", + "@rollup/plugin-inject": "^5.0.5", + "@rollup/plugin-node-resolve": "16.0.3", + "@types/bn.js": "^5.2.0", + "@types/mocha": "10.0.10", + "@types/semver": "7.8.0", + "@types/utf8": "^3.0.3", + "c8": "12.0.0", + "mocha": "12.0.0", + "prettier": "^3.9.6", + "rollup": "4.63.1", + "semver": "7.8.5", + "typescript": "7.0.2", + "uglify-js": "3.19.3" + }, + "engines": { + "node": ">=22.12.0" + }, + "exports": { + ".": { + "import": "./lib.esm/index.js", + "default": "./lib.commonjs/index.js" + }, + "./abi": { + "import": "./lib.esm/abi/index.js", + "default": "./lib.commonjs/abi/index.js" + }, + "./address": { + "import": "./lib.esm/address/index.js", + "default": "./lib.commonjs/address/index.js" + }, + "./constants": { + "import": "./lib.esm/constants/index.js", + "default": "./lib.commonjs/constants/index.js" + }, + "./contract": { + "import": "./lib.esm/contract/index.js", + "default": "./lib.commonjs/contract/index.js" + }, + "./crypto": { + "import": "./lib.esm/crypto/index.js", + "default": "./lib.commonjs/crypto/index.js" + }, + "./hash": { + "import": "./lib.esm/hash/index.js", + "default": "./lib.commonjs/hash/index.js" + }, + "./providers": { + "import": "./lib.esm/providers/index.js", + "default": "./lib.commonjs/providers/index.js" + }, + "./transaction": { + "import": "./lib.esm/transaction/index.js", + "default": "./lib.commonjs/transaction/index.js" + }, + "./utils": { + "import": "./lib.esm/utils/index.js", + "default": "./lib.commonjs/utils/index.js" + }, + "./wallet": { + "import": "./lib.esm/wallet/index.js", + "default": "./lib.commonjs/wallet/index.js" + }, + "./wordlists": { + "import": "./lib.esm/wordlists/index.js", + "default": "./lib.commonjs/wordlists/index.js" + }, + "./cip": { + "import": "./lib.esm/cip/index.js", + "default": "./lib.commonjs/cip/index.js" + }, + "./ipfs": { + "import": "./lib.esm/ipfs/index.js", + "default": "./lib.commonjs/ipfs/index.js" + } + }, + "license": "CORE", + "main": "./lib.commonjs/index.js", + "module": "./lib.esm/index.js", + "publishConfig": { + "access": "public", + "tag": "latest" + }, + "scripts": { + "_build-dist": "rollup -c && uglifyjs ./dist/corebc.js -o ./dist/corebc.min.js && uglifyjs ./dist/corebc.umd.js -o ./dist/corebc.umd.min.js && uglifyjs ./dist/wordlists-extra.js -o ./dist/wordlists-extra.min.js", + "_dist-stats": "gzip -k9f -S '.gz' ./dist/corebc.min.js && gzip -k9f -S '.gz' ./dist/corebc.umd.min.js && gzip -k9f -S '.gz' ./dist/wordlists-extra.min.js && du -hs ./dist/*.gz && echo '' && du -hs ./dist/*.js", + "auto-build": "npm run build -- -w", + "build": "node scripts/prepare-build.mjs && tsc --project tsconfig.esm.json", + "build-all": "npm run build && npm run build-commonjs && npm run _build-dist && npm run build-types", + "build-clean": "npm run clean && npm run build-all", + "build-commonjs": "node scripts/build-commonjs.mjs", + "build-dist": "npm run build && npm run _build-dist && npm run _dist-stats", + "build-types": "tsc --project tsconfig.types.json", + "clean": "node scripts/clean.mjs", + "clean-test": "npm run clean && npm run build-all && npm test", + "format": "prettier --write src.ts scripts package.json tsconfig*.json rollup.config.mjs .github README.md CONTRIBUTING.md CHANGELOG.md HEALTH.md .prettierrc.json", + "lint": "prettier --check src.ts scripts package.json tsconfig*.json rollup.config.mjs .github README.md CONTRIBUTING.md CHANGELOG.md HEALTH.md .prettierrc.json", + "stats": "echo 'Dependencies' && npm ls --all --omit=dev", + "test": "npm run test-esm && npm run test-commonjs", + "test-commonjs": "mocha ./lib.commonjs/_tests/test-*.js", + "test-coverage": "c8 -o output -r lcov -r text npm run test-esm", + "test-esm": "mocha ./lib.esm/_tests/test-*.js", + "check": "npm run build-all && npm run lint && npm test && npm run test-package", + "test-package": "node scripts/test-package.mjs", + "prepack": "npm run build-all" + }, + "sideEffects": false, + "type": "module", + "types": "./types/index.d.ts", + "files": [ + "lib.esm", + "lib.commonjs", + "types", + "dist", + "src.ts", + "!**/_admin/**", + "!**/_tests/**" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/CorePass/corebc.js.git" + }, + "bugs": { + "url": "https://github.com/CorePass/corebc.js/issues" + } } diff --git a/rollup.config.mjs b/rollup.config.mjs index c151833e1..e266ba067 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -1,50 +1,64 @@ - -import { nodeResolve } from '@rollup/plugin-node-resolve'; +import inject from "@rollup/plugin-inject"; +import commonjs from "@rollup/plugin-commonjs"; +import { nodeResolve } from "@rollup/plugin-node-resolve"; function getConfig(opts) { - if (opts == null) { opts = { }; } + if (opts == null) { + opts = {}; + } - const file = `./dist/corebc${ (opts.suffix || "") }.js`; - const exportConditions = [ "default", "module", "import" ]; - const mainFields = [ "module", "main" ]; - if (opts.browser) { mainFields.unshift("browser"); } + const file = `./dist/corebc${opts.suffix || ""}.js`; + const exportConditions = ["default", "module", "import"]; + const mainFields = ["module", "main"]; + if (opts.browser) { + mainFields.unshift("browser"); + } - return { - input: "./lib.esm/index.js", - output: { - file, - banner: "const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {});", - name: (opts.name || undefined), - format: (opts.format || "esm"), - sourcemap: true - }, - context: "__$G", - treeshake: true, - plugins: [ nodeResolve({ - exportConditions, - mainFields, - modulesOnly: true, - preferBuiltins: false - }) ], - }; + return { + input: "./lib.esm/index.js", + output: { + file, + banner: + "const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {});", + name: opts.name || undefined, + format: opts.format || "esm", + sourcemap: true, + }, + context: "__$G", + treeshake: true, + plugins: [ + nodeResolve({ + exportConditions, + mainFields, + browser: true, + preferBuiltins: false, + }), + commonjs(), + inject({ Buffer: ["buffer", "Buffer"] }), + ], + }; } export default [ - getConfig({ browser: true }), - getConfig({ browser: true, suffix: ".umd", format: "umd", name: "corebc" }), - { - input: "./lib.esm/wordlists/wordlists-extra.js", - output: { - file: "./dist/wordlists-extra.js", - format: "esm", - sourcemap: true - }, - treeshake: true, - plugins: [ nodeResolve({ - exportConditions: [ "default", "module", "import" ], - mainFields: [ "browser", "module", "main" ], - modulesOnly: true, - preferBuiltins: false - }) ], - } + getConfig({ browser: true }), + getConfig({ browser: true, suffix: ".umd", format: "umd", name: "corebc" }), + { + input: "./lib.esm/wordlists/wordlists-extra.js", + output: { + file: "./dist/wordlists-extra.js", + format: "esm", + sourcemap: true, + }, + treeshake: true, + plugins: [ + nodeResolve({ + exportConditions: ["default", "module", "import"], + mainFields: ["browser", "module", "main"], + browser: true, + preferBuiltins: false, + }), + commonjs(), + inject({ Buffer: ["buffer", "Buffer"] }), + ], + }, ]; diff --git a/scripts/build-commonjs.mjs b/scripts/build-commonjs.mjs new file mode 100644 index 000000000..633a50adf --- /dev/null +++ b/scripts/build-commonjs.mjs @@ -0,0 +1,28 @@ +import { readdir, mkdir, writeFile, copyFile } from "node:fs/promises"; +import { rollup } from "rollup"; +const input = (await readdir("lib.esm", { recursive: true })) + .filter((name) => name.endsWith(".js") && !name.startsWith("_admin/")) + .map((name) => `lib.esm/${name}`); +const bundle = await rollup({ + input, + external: (id) => !id.startsWith(".") && !id.startsWith("/"), +}); +await bundle.write({ + dir: "lib.commonjs", + format: "cjs", + exports: "named", + preserveModules: true, + preserveModulesRoot: "lib.esm", + sourcemap: true, +}); +await bundle.close(); +await writeFile( + "lib.commonjs/package.json", + JSON.stringify({ type: "commonjs" }), +); +for (const name of await readdir("lib.esm", { recursive: true })) { + if (!/\.d\.ts(?:\.map)?$/.test(name) || name.startsWith("_admin/")) continue; + const dest = `lib.commonjs/${name}`; + await mkdir(dest.slice(0, dest.lastIndexOf("/")), { recursive: true }); + await copyFile(`lib.esm/${name}`, dest); +} diff --git a/scripts/clean.mjs b/scripts/clean.mjs new file mode 100644 index 000000000..1de44ef07 --- /dev/null +++ b/scripts/clean.mjs @@ -0,0 +1,7 @@ +import { readdir, rm } from "node:fs/promises"; +for (const dir of ["dist", "lib.esm", "lib.commonjs", "types"]) { + for (const entry of await readdir(dir).catch(() => [])) { + if (entry === "README.md") continue; + await rm(`${dir}/${entry}`, { recursive: true, force: true }); + } +} diff --git a/scripts/prepare-build.mjs b/scripts/prepare-build.mjs new file mode 100644 index 000000000..1da0d75d6 --- /dev/null +++ b/scripts/prepare-build.mjs @@ -0,0 +1,17 @@ +import { mkdir, readFile, writeFile } from "node:fs/promises"; +const pkg = JSON.parse(await readFile("package.json", "utf8")); +const browser = Object.fromEntries( + Object.entries(pkg.browser) + .filter(([key]) => key.startsWith("./lib.esm/")) + .map(([key, value]) => [ + key.replace("./lib.esm/", "./"), + value.replace("./lib.esm/", "./"), + ]), +); +for (const dir of ["lib.esm", "lib.commonjs", "dist", "types"]) + await mkdir(dir, { recursive: true }); +await writeFile( + "lib.esm/package.json", + JSON.stringify({ type: "module", sideEffects: false, browser }, null, "\t") + + "\n", +); diff --git a/scripts/test-browser.mjs b/scripts/test-browser.mjs new file mode 100644 index 000000000..7ffe28d2b --- /dev/null +++ b/scripts/test-browser.mjs @@ -0,0 +1,37 @@ +import { readFile } from "node:fs/promises"; +import vm from "node:vm"; +import { webcrypto } from "node:crypto"; +for (const file of ["dist/corebc.umd.js", "dist/corebc.umd.min.js"]) { + const context = vm.createContext({ + crypto: webcrypto, + console, + TextEncoder, + TextDecoder, + setTimeout, + clearTimeout, + AbortController, + fetch, + URL, + }); + vm.runInContext( + "globalThis.self = globalThis; globalThis.window = globalThis;", + context, + ); + vm.runInContext(await readFile(file, "utf8"), context, { filename: file }); + vm.runInContext( + ` + const key = new corebc.SigningKey("01".repeat(57)); + const digest = corebc.sha256("0x1234"); + if (corebc.SigningKey.recoverPublicKey(digest, key.sign(digest)) !== key.publicKey) throw new Error("browser signature mismatch"); + const wallet = corebc.Wallet.createRandom(corebc.networkIdToPrefix(3)); + if (wallet.address.length !== 46) throw new Error("invalid browser wallet"); + const account = { address: wallet.address, privateKey: wallet.privateKey }; + const json = corebc.encryptKeystoreJsonSync(account, "test", { scrypt: { N: 16, r: 1, p: 1 } }); + if (corebc.decryptKeystoreJsonSync(json, "test").privateKey !== wallet.privateKey) throw new Error("browser keystore mismatch"); + const known = corebc.Wallet.fromPhrase({ phrase: "better artwork flavor fish solve deer orient spread adapt doll attack hour sort copper super income bacon engine skate ill similar wink crack club", password: "111111", prefix: corebc.networkIdToPrefix(3) }); + if (known.address !== "0xab38254e30777140469a3aa168df81182d3d61f9843f") throw new Error("browser mnemonic mismatch"); + `, + context, + ); +} +console.log("Browser bundle checks passed"); diff --git a/scripts/test-package.mjs b/scripts/test-package.mjs new file mode 100644 index 000000000..a5bd4e8ca --- /dev/null +++ b/scripts/test-package.mjs @@ -0,0 +1,74 @@ +import assert from "node:assert/strict"; +import { execFileSync } from "node:child_process"; +import { mkdtemp, readFile, writeFile, rm } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join, resolve } from "node:path"; + +const pkg = JSON.parse(await readFile("package.json", "utf8")); +const temp = await mkdtemp(join(tmpdir(), "corebc-package-")); +try { + const [packed] = JSON.parse( + execFileSync( + "npm", + ["pack", "--ignore-scripts", "--json", "--pack-destination", temp], + { encoding: "utf8" }, + ), + ); + assert.ok( + !packed.files.some(({ path }) => /(?:^|\/)_(tests|admin)\//.test(path)), + ); + await writeFile( + join(temp, "package.json"), + '{"private":true,"type":"module"}', + ); + execFileSync( + "npm", + ["install", "--no-audit", "--no-fund", join(temp, packed.filename)], + { cwd: temp, stdio: "pipe" }, + ); + for (const mode of ["module", "commonjs"]) { + const code = + (mode === "module" + ? `import { version } from "corebc"; if (version !== ${JSON.stringify(pkg.version)}) throw new Error("version mismatch");\n` + : `if (require("corebc").version !== ${JSON.stringify(pkg.version)}) throw new Error("version mismatch");\n`) + + Object.keys(pkg.exports) + .map((key) => { + const name = "corebc" + (key === "." ? "" : key.slice(1)); + return mode === "module" + ? `await import(${JSON.stringify(name)});` + : `require(${JSON.stringify(name)});`; + }) + .join("\n"); + execFileSync(process.execPath, ["--input-type=" + mode, "-e", code], { + cwd: temp, + stdio: "pipe", + }); + } + // Compile consumer imports against both package export conditions. + const consumer = + 'import { Wallet, Cip150MetadataContract, IpfsGateway } from "corebc";\nimport { Cip151Lifecycle } from "corebc/cip";\nvoid [Wallet, Cip150MetadataContract, IpfsGateway, new Cip151Lifecycle()];\n'; + for (const ext of ["mts", "cts"]) { + const filename = join(temp, `consumer.${ext}`); + await writeFile(filename, consumer); + execFileSync( + resolve("node_modules/.bin/tsc"), + [ + "--ignoreConfig", + "--noEmit", + "--strict", + "--module", + "nodenext", + "--target", + "es2022", + filename, + ], + { cwd: temp, stdio: "inherit" }, + ); + } + await import("./test-browser.mjs"); + console.log( + `Package smoke checks passed: ${packed.files.length} files, ${packed.size} bytes; ESM, CommonJS, declarations and browser bundles.`, + ); +} finally { + await rm(temp, { recursive: true, force: true }); +} diff --git a/src.ts/_tests/blockchain-data.ts b/src.ts/_tests/blockchain-data.ts index 2a96b4b50..92e13dad1 100644 --- a/src.ts/_tests/blockchain-data.ts +++ b/src.ts/_tests/blockchain-data.ts @@ -1,354 +1,354 @@ export type TestBlockchainNetwork = "mainnet" | "goerli"; export interface TestBlockchainAddress { - test: string; - address: string; - code?: string; - nonce?: number; - name?: string; - balance?: bigint; - storage?: Record; + test: string; + address: string; + code?: string; + nonce?: number; + name?: string; + balance?: bigint; + storage?: Record; } export interface TestBlockchainBlock { - test: string; - hash: string; - parentHash: string; - number: number; - timestamp: number; - nonce: string; - difficulty: bigint; - energyLimit: bigint; - energyUsed: bigint; - miner: string; - extraData: string; - transactions: Array; + test: string; + hash: string; + parentHash: string; + number: number; + timestamp: number; + nonce: string; + difficulty: bigint; + energyLimit: bigint; + energyUsed: bigint; + miner: string; + extraData: string; + transactions: Array; - baseFeePerEnergy?: bigint; + baseFeePerEnergy?: bigint; } export interface TestBlockchainTransaction { - test: string; - hash: string; - blockHash: string; - blockNumber: number; - // index: number, - type: number; - from: string; - energyPrice: bigint; - energyLimit: bigint; - to: string; - value: bigint; - nonce: number; - data: string; - signature: { - r: string; - s: string; - yParity: 0 | 1; - v: number; - networkV: null | bigint; - }; - creates: null | string; - networkId: bigint; + test: string; + hash: string; + blockHash: string; + blockNumber: number; + // index: number, + type: number; + from: string; + energyPrice: bigint; + energyLimit: bigint; + to: string; + value: bigint; + nonce: number; + data: string; + signature: { + r: string; + s: string; + yParity: 0 | 1; + v: number; + networkV: null | bigint; + }; + creates: null | string; + networkId: bigint; - accessList?: Array>>; + accessList?: Array>>; } export interface TestBlockchainReceipt { - test: string; - //byzantium: true, - blockHash: string; - blockNumber: number; - type: number; - contractAddress: null | string; - cumulativeEnergyUsed: bigint; - from: string; - energyUsed: bigint; - energyPrice: bigint; - logs: Array<{ - address: string; - blockHash: string; - blockNumber: number; - data: string; - index: number; - topics: Array; - transactionHash: string; - transactionIndex: number; - }>; - logsBloom: string; - root: null | string; - status: null | number; - to: string; - hash: string; - index: number; + test: string; + //byzantium: true, + blockHash: string; + blockNumber: number; + type: number; + contractAddress: null | string; + cumulativeEnergyUsed: bigint; + from: string; + energyUsed: bigint; + energyPrice: bigint; + logs: Array<{ + address: string; + blockHash: string; + blockNumber: number; + data: string; + index: number; + topics: Array; + transactionHash: string; + transactionIndex: number; + }>; + logsBloom: string; + root: null | string; + status: null | number; + to: string; + hash: string; + index: number; } export const testAddress: Record< - TestBlockchainNetwork, - Array + TestBlockchainNetwork, + Array > = { - mainnet: [ - { - test: "old-account", - address: "0xAC1639CF97a3A46D431e6d1216f576622894cBB5", - balance: BigInt("4813414100000000"), - nonce: 3, - code: "0x", - }, - { - test: "TheDAO-splitter-contract", - address: "0x3474627D4F63A678266BC17171D87f8570936622", - code: "0x606060405260e060020a60003504630b3ed5368114602e57806337b0574a14605257806356fa47f0146062575b005b602c6004356000546101009004600160a060020a03908116339091161460bb575b50565b60005460ff166060908152602090f35b602c60043560005460ff1615609657600160a060020a038116600034606082818181858883f193505050501515604f576002565b33600160a060020a0316600034606082818181858883f193505050501515604f576002565b600080546101009004600160a060020a03169082606082818181858883f193505050501515604f57600256", - storage: { - "0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300", - }, - }, - { - test: "ricmoo.firefly.eth", - address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72", - name: "ricmoo.firefly.eth", - }, - ], - goerli: [], + mainnet: [ + { + test: "old-account", + address: "0xAC1639CF97a3A46D431e6d1216f576622894cBB5", + balance: BigInt("4813414100000000"), + nonce: 3, + code: "0x", + }, + { + test: "TheDAO-splitter-contract", + address: "0x3474627D4F63A678266BC17171D87f8570936622", + code: "0x606060405260e060020a60003504630b3ed5368114602e57806337b0574a14605257806356fa47f0146062575b005b602c6004356000546101009004600160a060020a03908116339091161460bb575b50565b60005460ff166060908152602090f35b602c60043560005460ff1615609657600160a060020a038116600034606082818181858883f193505050501515604f576002565b33600160a060020a0316600034606082818181858883f193505050501515604f576002565b600080546101009004600160a060020a03169082606082818181858883f193505050501515604f57600256", + storage: { + "0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300", + }, + }, + { + test: "ricmoo.firefly.eth", + address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72", + name: "ricmoo.firefly.eth", + }, + ], + goerli: [], }; export const testBlock: Record< - TestBlockchainNetwork, - Array + TestBlockchainNetwork, + Array > = { - mainnet: [ - { - test: "old-homestead-block", - hash: "0x3d6122660cc824376f11ee842f83addc3525e2dd6756b9bcf0affa6aa88cf741", - parentHash: - "0xb495a1d7e6663152ae92708da4843337b958146015a2802f4193a410044698c9", - number: 3, - timestamp: 1438270048, - nonce: "0x2e9344e0cbde83ce", - difficulty: BigInt(17154715646), - energyLimit: BigInt("0x1388"), - energyUsed: BigInt("0"), - miner: "0x5088D623ba0fcf0131E0897a91734A4D83596AA0", - extraData: - "0x476574682f76312e302e302d66633739643332642f6c696e75782f676f312e34", - transactions: [], - }, - { - test: "london-block", - number: 14413999, - hash: "0x6c79356d40ebb6ed63dc19f5d407f8f1c876047b59dc1a4598cce0e64dcabec5", - parentHash: - "0xbf09b0e215f247a5066d19ece5b4c66960771d45fae62985e8d751fb1adcfe2f", - timestamp: 1647654576, - nonce: "0xb4bc9979af5369fe", - difficulty: BigInt("12841513359509721"), - energyLimit: BigInt("30087914"), - energyUsed: BigInt("2008910"), - miner: "0x2A20380DcA5bC24D052acfbf79ba23e988ad0050", - extraData: "0x706f6f6c696e2e636f6d21f7092f019bb92a76", - baseFeePerEnergy: BigInt("40911884304"), - transactions: [ - "0x1c3a398933db10634631f54b435c40c8805c13f12bbac7c3dab858ca44213fa2", - "0xd98947cbdd892cc7f679c903903e6d18a5c5afb19e94437beba79372ad71c347", - "0x4d66190deb55b5820cb0ce9adb972f646fa0f3e64eaeee674bbf3d054bf3d883", - "0x9db7bd5f4c91d6103c714bcbc35df3dc708daa668aaef7449b589dbd3be24dac", - "0x126a43ae4ade4b7fc5c8ac9ebd3dbcf7314f63c60f2804fb49aa25b5c7d80bb1", - "0x82a90aa4b3b1b7873b117c3ff1ca7165ae34b2fc0788cc0cbfd41805d588590d", - "0x7f694a6a9972457753ed3dec164f17272b1c8b1da4eab149df95e31a3e72f606", - "0xdce1cba1ff33f0c23881087d49de3b34fe84c8a6883f3edd75b04fc23e458aac", - "0xbe1c69f825279cebef42d1f0e07397dcddef7fb278b0195e295ede3e156836c4", - "0x1d2f007b3c0f894403973a30e5ffaa78589f873d963e9554c6bb1bd7a3127245", - "0x9c8c78191cf4ae9ae8eee1165153eabe24dbd8b9509b83d5f0caeea85251bb2f", - "0x42e956f4b3dd6535359b272a0d2dab995c364cb48baaf8d0a1981995f3f8c808", - "0xdc2c2e99393e24d5dc66e38665fa1d1ff007d92088ef3fd2549545fdbe862ef6", - "0xaad7be28fffd2e77e8e40bf57f2ac140aa8283ec93c7f3f61a82c79405602f53", - "0x4735f1421b7b30283e87e0799e82e54307d3e5ba14cd54ad8420b57577489a71", - "0x0b9d6aa23aa439b41e86595f2ad91f498adffa3e6e7cb26ac7d73252e59fd3de", - "0xcd93e19bd5d5c5a834fec613116fa01f46eddfd2faa20ef302271b874b9d812a", - "0x5bf1976574a637f5ac0b8bda1a792fa16cc7ce9624d32e9bd6bd9aa6a8f19d2f", - "0x2e778da4f66f10f7b681b605635c6599cdbeea167fc1c4396a097aef5d06de61", - "0xd5fd68eebc4c870ccda081786a74c75c250e9e2d8269b8935edb3adb11b80bb2", - "0x2aec42a11c1d8c1e5198d54aacbc6bebb09bcd5e78f6af81ea09d65c9064734a", - "0xbea2e364ea4959ec438d9ccc2d2f7120c7eaba3b177cc0d7df8ff65d866ef89f", - "0xf48bbb0f838353060da4126a555ce532abf497a9d1108001afffaac513a59ddf", - "0xf5664e4372cce62733a6610efb7701a4a0e552d81f8caa764d8474b3070c6617", - "0x9d3732ddbd20610008ff737da2f61120734a1cbfa864374bcbcf10051e6048cb", - "0xc4d0df5bc6fa51b34ac3c898866d779d4e51a6be4d13be1ec3084b7229b03b47", - "0x90c86ec98b8ad98049b4ee54cb3aa72c5ae743077b830e8a294aa5dc47a1fb18", - ], - }, - ], - goerli: [], + mainnet: [ + { + test: "old-homestead-block", + hash: "0x3d6122660cc824376f11ee842f83addc3525e2dd6756b9bcf0affa6aa88cf741", + parentHash: + "0xb495a1d7e6663152ae92708da4843337b958146015a2802f4193a410044698c9", + number: 3, + timestamp: 1438270048, + nonce: "0x2e9344e0cbde83ce", + difficulty: BigInt(17154715646), + energyLimit: BigInt("0x1388"), + energyUsed: BigInt("0"), + miner: "0x5088D623ba0fcf0131E0897a91734A4D83596AA0", + extraData: + "0x476574682f76312e302e302d66633739643332642f6c696e75782f676f312e34", + transactions: [], + }, + { + test: "london-block", + number: 14413999, + hash: "0x6c79356d40ebb6ed63dc19f5d407f8f1c876047b59dc1a4598cce0e64dcabec5", + parentHash: + "0xbf09b0e215f247a5066d19ece5b4c66960771d45fae62985e8d751fb1adcfe2f", + timestamp: 1647654576, + nonce: "0xb4bc9979af5369fe", + difficulty: BigInt("12841513359509721"), + energyLimit: BigInt("30087914"), + energyUsed: BigInt("2008910"), + miner: "0x2A20380DcA5bC24D052acfbf79ba23e988ad0050", + extraData: "0x706f6f6c696e2e636f6d21f7092f019bb92a76", + baseFeePerEnergy: BigInt("40911884304"), + transactions: [ + "0x1c3a398933db10634631f54b435c40c8805c13f12bbac7c3dab858ca44213fa2", + "0xd98947cbdd892cc7f679c903903e6d18a5c5afb19e94437beba79372ad71c347", + "0x4d66190deb55b5820cb0ce9adb972f646fa0f3e64eaeee674bbf3d054bf3d883", + "0x9db7bd5f4c91d6103c714bcbc35df3dc708daa668aaef7449b589dbd3be24dac", + "0x126a43ae4ade4b7fc5c8ac9ebd3dbcf7314f63c60f2804fb49aa25b5c7d80bb1", + "0x82a90aa4b3b1b7873b117c3ff1ca7165ae34b2fc0788cc0cbfd41805d588590d", + "0x7f694a6a9972457753ed3dec164f17272b1c8b1da4eab149df95e31a3e72f606", + "0xdce1cba1ff33f0c23881087d49de3b34fe84c8a6883f3edd75b04fc23e458aac", + "0xbe1c69f825279cebef42d1f0e07397dcddef7fb278b0195e295ede3e156836c4", + "0x1d2f007b3c0f894403973a30e5ffaa78589f873d963e9554c6bb1bd7a3127245", + "0x9c8c78191cf4ae9ae8eee1165153eabe24dbd8b9509b83d5f0caeea85251bb2f", + "0x42e956f4b3dd6535359b272a0d2dab995c364cb48baaf8d0a1981995f3f8c808", + "0xdc2c2e99393e24d5dc66e38665fa1d1ff007d92088ef3fd2549545fdbe862ef6", + "0xaad7be28fffd2e77e8e40bf57f2ac140aa8283ec93c7f3f61a82c79405602f53", + "0x4735f1421b7b30283e87e0799e82e54307d3e5ba14cd54ad8420b57577489a71", + "0x0b9d6aa23aa439b41e86595f2ad91f498adffa3e6e7cb26ac7d73252e59fd3de", + "0xcd93e19bd5d5c5a834fec613116fa01f46eddfd2faa20ef302271b874b9d812a", + "0x5bf1976574a637f5ac0b8bda1a792fa16cc7ce9624d32e9bd6bd9aa6a8f19d2f", + "0x2e778da4f66f10f7b681b605635c6599cdbeea167fc1c4396a097aef5d06de61", + "0xd5fd68eebc4c870ccda081786a74c75c250e9e2d8269b8935edb3adb11b80bb2", + "0x2aec42a11c1d8c1e5198d54aacbc6bebb09bcd5e78f6af81ea09d65c9064734a", + "0xbea2e364ea4959ec438d9ccc2d2f7120c7eaba3b177cc0d7df8ff65d866ef89f", + "0xf48bbb0f838353060da4126a555ce532abf497a9d1108001afffaac513a59ddf", + "0xf5664e4372cce62733a6610efb7701a4a0e552d81f8caa764d8474b3070c6617", + "0x9d3732ddbd20610008ff737da2f61120734a1cbfa864374bcbcf10051e6048cb", + "0xc4d0df5bc6fa51b34ac3c898866d779d4e51a6be4d13be1ec3084b7229b03b47", + "0x90c86ec98b8ad98049b4ee54cb3aa72c5ae743077b830e8a294aa5dc47a1fb18", + ], + }, + ], + goerli: [], }; export const testTransaction: Record< - TestBlockchainNetwork, - Array + TestBlockchainNetwork, + Array > = { - mainnet: [ - { - test: "legacy", - hash: "0xccc90ab97a74c952fb3376c4a3efb566a58a10df62eb4d44a61e106fcf10ec61", - blockHash: - "0x9653f180a5720f3634816eb945a6d722adee52cc47526f6357ac10adaf368135", - blockNumber: 4097745, - // index: 18, - type: 0, - from: "0x32DEF047DeFd076DB21A2D759aff2A591c972248", - energyPrice: BigInt("0x4a817c800"), - energyLimit: BigInt("0x3d090"), - to: "0x6fC21092DA55B392b045eD78F4732bff3C580e2c", - value: BigInt("0x186cc6acd4b0000"), - nonce: 0, - data: "0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067269636d6f6f0000000000000000000000000000000000000000000000000000", - signature: { - r: "0x1e5605197a03e3f0a168f14749168dfeefc44c9228312dacbffdcbbb13263265", - s: "0x269c3e5b3558267ad91b0a887d51f9f10098771c67b82ea6cb74f29638754f54", - yParity: 1, - v: 28, - networkV: BigInt(38), - }, - creates: null, - networkId: BigInt(1), - }, - { - test: "EIP-1559", - hash: "0x8ff41d0ba5d239acc8c123ff12451a2c15721c838f657e583d355999af4a4349", - blockHash: - "0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0", - blockNumber: 12966000, - // index: 185, - type: 2, - from: "0x5afFBa12E9332bbc0E221c8E7BEf7CB7cfB3F281", - to: "0x2258CcD34ae29E6B199b6CD64eb2aEF157df7CdE", - energyLimit: BigInt("21000"), - nonce: 2, - data: "0x", - value: BigInt("1100000000000000"), - energyPrice: BigInt("70578812137"), - networkId: BigInt(1), - signature: { - r: "0xdd26e5478d0aa84e334a0393d335ab24b83de8ecae9290305f15ab884ded246c", - s: "0x6494b4f61b0d9a5a82ecb86d72b301f859f404f0bec9682bbfff619903ecfbe2", - yParity: 1, - v: 28, - networkV: null, - }, - creates: null, - accessList: [], - }, - ], - goerli: [], + mainnet: [ + { + test: "legacy", + hash: "0xccc90ab97a74c952fb3376c4a3efb566a58a10df62eb4d44a61e106fcf10ec61", + blockHash: + "0x9653f180a5720f3634816eb945a6d722adee52cc47526f6357ac10adaf368135", + blockNumber: 4097745, + // index: 18, + type: 0, + from: "0x32DEF047DeFd076DB21A2D759aff2A591c972248", + energyPrice: BigInt("0x4a817c800"), + energyLimit: BigInt("0x3d090"), + to: "0x6fC21092DA55B392b045eD78F4732bff3C580e2c", + value: BigInt("0x186cc6acd4b0000"), + nonce: 0, + data: "0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067269636d6f6f0000000000000000000000000000000000000000000000000000", + signature: { + r: "0x1e5605197a03e3f0a168f14749168dfeefc44c9228312dacbffdcbbb13263265", + s: "0x269c3e5b3558267ad91b0a887d51f9f10098771c67b82ea6cb74f29638754f54", + yParity: 1, + v: 28, + networkV: BigInt(38), + }, + creates: null, + networkId: BigInt(1), + }, + { + test: "EIP-1559", + hash: "0x8ff41d0ba5d239acc8c123ff12451a2c15721c838f657e583d355999af4a4349", + blockHash: + "0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0", + blockNumber: 12966000, + // index: 185, + type: 2, + from: "0x5afFBa12E9332bbc0E221c8E7BEf7CB7cfB3F281", + to: "0x2258CcD34ae29E6B199b6CD64eb2aEF157df7CdE", + energyLimit: BigInt("21000"), + nonce: 2, + data: "0x", + value: BigInt("1100000000000000"), + energyPrice: BigInt("70578812137"), + networkId: BigInt(1), + signature: { + r: "0xdd26e5478d0aa84e334a0393d335ab24b83de8ecae9290305f15ab884ded246c", + s: "0x6494b4f61b0d9a5a82ecb86d72b301f859f404f0bec9682bbfff619903ecfbe2", + yParity: 1, + v: 28, + networkV: null, + }, + creates: null, + accessList: [], + }, + ], + goerli: [], }; export const testReceipt: Record< - TestBlockchainNetwork, - Array + TestBlockchainNetwork, + Array > = { - mainnet: [ - { - test: "legacy", - //byzantium: false, - blockHash: - "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", - blockNumber: 0x3c92b5, - type: 0, - contractAddress: null, - cumulativeEnergyUsed: BigInt(0x1cca2e), - from: "0x18C6045651826824FEBBD39d8560584078d1b247", - energyUsed: BigInt(0x14bb7), - energyPrice: BigInt(4100000000), - logs: [ - { - address: "0x314159265dD8dbb310642f98f50C066173C1259b", - blockHash: - "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", - blockNumber: 0x3c92b5, - data: "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247", - index: 0x1a, - topics: [ - "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", - "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", - "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1", - ], - transactionHash: - "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", - transactionIndex: 0x39, - }, - { - address: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef", - blockHash: - "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", - blockNumber: 0x3c92b5, - data: "0x000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000595a32ce", - index: 0x1b, - topics: [ - "0x0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e670", - "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1", - "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247", - ], - transactionHash: - "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", - transactionIndex: 0x39, - }, - ], - logsBloom: - "0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000", - root: "0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590", - // Should be null for pre-byzantium, but some nodes have backfilled it - status: 1, - to: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef", - hash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", - index: 0x39, - }, - { - test: "byzantium", - //byzantium: true, - blockHash: - "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9", - blockNumber: 0x444f76, - type: 0, - contractAddress: null, - cumulativeEnergyUsed: BigInt(0x15bfe7), - from: "0x18C6045651826824FEBBD39d8560584078d1b247", - energyUsed: BigInt(0x1b968), - energyPrice: BigInt(1000000000), - logs: [ - { - address: "0xb90E64082D00437e65A76d4c8187596BC213480a", - blockHash: - "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9", - blockNumber: 0x444f76, - data: "0x", - index: 0x10, - topics: [ - "0x748d071d1992ee1bfe7a39058114d0a50d5798fe8eb3a9bfb4687f024629a2ce", - "0x5574aa58f7191ccab6de6cf75fe2ea0484f010b852fdd8c6b7ae151d6c2f4b83", - ], - transactionHash: - "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac", - transactionIndex: 0x1e, - }, - ], - logsBloom: - "0x00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000800000000000000000000000000000000000000", - root: null, - status: 1, - to: "0xb90E64082D00437e65A76d4c8187596BC213480a", - hash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac", - index: 0x1e, - }, - ], - goerli: [], + mainnet: [ + { + test: "legacy", + //byzantium: false, + blockHash: + "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", + blockNumber: 0x3c92b5, + type: 0, + contractAddress: null, + cumulativeEnergyUsed: BigInt(0x1cca2e), + from: "0x18C6045651826824FEBBD39d8560584078d1b247", + energyUsed: BigInt(0x14bb7), + energyPrice: BigInt(4100000000), + logs: [ + { + address: "0x314159265dD8dbb310642f98f50C066173C1259b", + blockHash: + "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", + blockNumber: 0x3c92b5, + data: "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247", + index: 0x1a, + topics: [ + "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", + "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", + "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1", + ], + transactionHash: + "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", + transactionIndex: 0x39, + }, + { + address: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef", + blockHash: + "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", + blockNumber: 0x3c92b5, + data: "0x000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000595a32ce", + index: 0x1b, + topics: [ + "0x0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e670", + "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1", + "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247", + ], + transactionHash: + "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", + transactionIndex: 0x39, + }, + ], + logsBloom: + "0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000", + root: "0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590", + // Should be null for pre-byzantium, but some nodes have backfilled it + status: 1, + to: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef", + hash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", + index: 0x39, + }, + { + test: "byzantium", + //byzantium: true, + blockHash: + "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9", + blockNumber: 0x444f76, + type: 0, + contractAddress: null, + cumulativeEnergyUsed: BigInt(0x15bfe7), + from: "0x18C6045651826824FEBBD39d8560584078d1b247", + energyUsed: BigInt(0x1b968), + energyPrice: BigInt(1000000000), + logs: [ + { + address: "0xb90E64082D00437e65A76d4c8187596BC213480a", + blockHash: + "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9", + blockNumber: 0x444f76, + data: "0x", + index: 0x10, + topics: [ + "0x748d071d1992ee1bfe7a39058114d0a50d5798fe8eb3a9bfb4687f024629a2ce", + "0x5574aa58f7191ccab6de6cf75fe2ea0484f010b852fdd8c6b7ae151d6c2f4b83", + ], + transactionHash: + "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac", + transactionIndex: 0x1e, + }, + ], + logsBloom: + "0x00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000800000000000000000000000000000000000000", + root: null, + status: 1, + to: "0xb90E64082D00437e65A76d4c8187596BC213480a", + hash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac", + index: 0x1e, + }, + ], + goerli: [], }; export const networkNames: Array = ["mainnet", "goerli"]; export function networkFeatureAtBlock(feature: string, block: number): boolean { - switch (feature) { - case "byzantium": - return block >= 4370000; - default: - break; - } - throw new Error(`unknown feature: ${feature}`); + switch (feature) { + case "byzantium": + return block >= 4370000; + default: + break; + } + throw new Error(`unknown feature: ${feature}`); } diff --git a/src.ts/_tests/create-provider.ts b/src.ts/_tests/create-provider.ts index f104fbb02..66ee75665 100644 --- a/src.ts/_tests/create-provider.ts +++ b/src.ts/_tests/create-provider.ts @@ -1,150 +1,150 @@ import { - AlchemyProvider, - InfuraProvider, - PocketProvider, - QuickNodeProvider, - FallbackProvider, - isError, + AlchemyProvider, + InfuraProvider, + PocketProvider, + QuickNodeProvider, + FallbackProvider, + isError, } from "../index.js"; import type { AbstractProvider } from "../index.js"; interface ProviderCreator { - name: string; - networks: Array; - create: (network: string) => null | AbstractProvider; + name: string; + networks: Array; + create: (network: string) => null | AbstractProvider; } const ethNetworks = ["default", "mainnet", "goerli"]; //const maticNetworks = [ "matic", "maticmum" ]; const ProviderCreators: Array = [ - { - name: "AlchemyProvider", - networks: ethNetworks, - create: function (network: string) { - return new AlchemyProvider(network, "YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM"); - }, - }, - { - name: "InfuraProvider", - networks: ethNetworks, - create: function (network: string) { - return new InfuraProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); - }, - }, - { - name: "InfuraWebsocketProvider", - networks: ethNetworks, - create: function (network: string) { - return InfuraProvider.getWebSocketProvider( - network, - "49a0efa3aaee4fd99797bfa94d8ce2f1", - ); - }, - }, - { - name: "PocketProvider", - networks: ethNetworks, - create: function (network: string) { - return new PocketProvider(network); - }, - }, - { - name: "QuickNodeProvider", - networks: ethNetworks, - create: function (network: string) { - return new QuickNodeProvider(network); - }, - }, - { - name: "FallbackProvider", - networks: ethNetworks, - create: function (network: string) { - const providers: Array = []; - for (const providerName of [ - "AlchemyProvider", - "AnkrProvider", - "InfuraProvider", - ]) { - const provider = getProvider(providerName, network); - if (provider) { - providers.push(provider); - } - } - if (providers.length === 0) { - throw new Error("UNSUPPORTED NETWORK"); - } - return new FallbackProvider(providers); - }, - }, + { + name: "AlchemyProvider", + networks: ethNetworks, + create: function (network: string) { + return new AlchemyProvider(network, "YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM"); + }, + }, + { + name: "InfuraProvider", + networks: ethNetworks, + create: function (network: string) { + return new InfuraProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); + }, + }, + { + name: "InfuraWebsocketProvider", + networks: ethNetworks, + create: function (network: string) { + return InfuraProvider.getWebSocketProvider( + network, + "49a0efa3aaee4fd99797bfa94d8ce2f1", + ); + }, + }, + { + name: "PocketProvider", + networks: ethNetworks, + create: function (network: string) { + return new PocketProvider(network); + }, + }, + { + name: "QuickNodeProvider", + networks: ethNetworks, + create: function (network: string) { + return new QuickNodeProvider(network); + }, + }, + { + name: "FallbackProvider", + networks: ethNetworks, + create: function (network: string) { + const providers: Array = []; + for (const providerName of [ + "AlchemyProvider", + "AnkrProvider", + "InfuraProvider", + ]) { + const provider = getProvider(providerName, network); + if (provider) { + providers.push(provider); + } + } + if (providers.length === 0) { + throw new Error("UNSUPPORTED NETWORK"); + } + return new FallbackProvider(providers); + }, + }, ]; let setup = false; const cleanup: Array<() => void> = []; export function setupProviders(): void { - after(function () { - for (const func of cleanup) { - func(); - } - }); - setup = true; + after(function () { + for (const func of cleanup) { + func(); + } + }); + setup = true; } export const providerNames = Object.freeze(ProviderCreators.map((c) => c.name)); function getCreator(provider: string): null | ProviderCreator { - const creators = ProviderCreators.filter((c) => c.name === provider); - if (creators.length === 1) { - return creators[0]; - } - return null; + const creators = ProviderCreators.filter((c) => c.name === provider); + if (creators.length === 1) { + return creators[0]; + } + return null; } export function getProviderNetworks(provider: string): Array { - const creator = getCreator(provider); - if (creator) { - return creator.networks; - } - return []; + const creator = getCreator(provider); + if (creator) { + return creator.networks; + } + return []; } export function getProvider( - provider: string, - network: string, + provider: string, + network: string, ): null | AbstractProvider { - if (setup == false) { - throw new Error("MUST CALL setupProviders in root context"); - } + if (setup == false) { + throw new Error("MUST CALL setupProviders in root context"); + } - const creator = getCreator(provider); - try { - if (creator) { - const provider = creator.create(network); - if (provider) { - cleanup.push(() => { - provider.destroy(); - }); - } - return provider; - } - } catch (error) { - if (!isError(error, "INVALID_ARGUMENT")) { - throw error; - } - } - return null; + const creator = getCreator(provider); + try { + if (creator) { + const provider = creator.create(network); + if (provider) { + cleanup.push(() => { + provider.destroy(); + }); + } + return provider; + } + } catch (error) { + if (!isError(error, "INVALID_ARGUMENT")) { + throw error; + } + } + return null; } export function checkProvider(provider: string, network: string): boolean { - const creator = getCreator(provider); - return creator != null; + const creator = getCreator(provider); + return creator != null; } export function connect(network: string): AbstractProvider { - const provider = getProvider("InfuraProvider", network); - if (provider == null) { - throw new Error(`could not connect to ${network}`); - } - return provider; + const provider = getProvider("InfuraProvider", network); + if (provider == null) { + throw new Error(`could not connect to ${network}`); + } + return provider; } diff --git a/src.ts/_tests/test-cip.ts b/src.ts/_tests/test-cip.ts new file mode 100644 index 000000000..b6109ce71 --- /dev/null +++ b/src.ts/_tests/test-cip.ts @@ -0,0 +1,187 @@ +import assert from "node:assert/strict"; +import { + Interface, + Cip150MetadataContract, + Cip151Lifecycle, + Cip152LabCertificate, + CustomUnitToken, + cip150Abi, + customUnitAbi, + IpfsGateway, +} from "../index.js"; +import type { TransactionRequest } from "../providers/index.js"; +const address = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; + +describe("CIP metadata and custom units", () => { + it("uses Unix seconds and exact inclusive lifecycle boundaries", () => { + const lifecycle = new Cip151Lifecycle({ + tokenExpiration: "9007199254740993", + tradingStop: "0", + }); + assert.equal(lifecycle.isExpiredAt(9007199254740992n), false); + assert.equal(lifecycle.isExpiredAt(9007199254740993n), true); + assert.equal(lifecycle.isTradingStoppedAt(0n), true); + assert.equal(new Cip151Lifecycle().isExpiredAt(1n), false); + for (const value of ["-1", "1.5", "1e3", " 1", "NaN"]) + assert.throws(() => new Cip151Lifecycle({ tokenExpiration: value })); + }); + it("validates and copies lab measurements", () => { + const input = { moisture: { value: 12, unit: "%" } }; + const lab = new Cip152LabCertificate(input); + input.moisture.value = 99; + assert.equal(lab.measurements.moisture.value, 12); + for (const json of [ + null, + [], + { x: {} }, + { x: { value: true } }, + { x: { value: Infinity } }, + { x: { value: 1, unit: 3 } }, + ]) + assert.throws(() => new Cip152LabCertificate(json)); + }); + it("encodes CIP-150 calls and preserves block references", async () => { + const abi = new Interface(cip150Abi); + const values: Record = { + tokenExpiration: "100", + lab: "ipfs://QmExample/lab.json", + }; + const calls: string[] = []; + const metadata = new Cip150MetadataContract(address, { + provider: null, + call: async (tx: TransactionRequest) => { + assert.equal(tx.blockTag, 42); + const parsed = abi.parseTransaction({ data: tx.data! })!; + calls.push(parsed.name); + const key = parsed.args.length ? parsed.args[0] : ""; + const result: Record = { + listMetadataKeys: [Object.keys(values)], + metadataCount: [2n], + getMetadataByIndex: ["tokenExpiration", "100"], + hasMetadataKey: [Object.hasOwn(values, key)], + getMetadataValue: [values[key]], + isMetadataSealed: [true], + }; + return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); + }, + }); + assert.equal(await metadata.count(42), 2n); + assert.deepEqual(await metadata.getByIndex(0n, 42), { + key: "tokenExpiration", + value: "100", + }); + assert.equal((await metadata.readAll(42))[0].sealed, true); + assert.equal((await metadata.readAll(42, false))[0].sealed, undefined); + assert.equal((await metadata.readLifecycle(42)).tokenExpiration, 100n); + const gateway = new IpfsGateway({ + fetch: async () => new Response('{"pH":{"value":7}}'), + }); + assert.equal( + (await metadata.readLabCertificate(gateway, 42))!.measurements.pH.value, + 7, + ); + values.lab = "ipfs://QmExample/wrong.json"; + await assert.rejects(metadata.readLabCertificate(gateway, 42), /lab.json/); + delete values.lab; + assert.equal(await metadata.readLabCertificate(gateway, 42), null); + await assert.rejects(metadata.setValue("x", "y"), /sendTransaction/); + assert.ok(calls.includes("isMetadataSealed")); + }); + it("discovers custom units and retains balances beyond Number precision", async () => { + const abi = new Interface(customUnitAbi); + const canonical = 9007199254740993n; + const token = new CustomUnitToken(address, { + provider: null, + call: async (tx) => { + assert.equal(tx.blockTag, 10); + const parsed = abi.parseTransaction({ data: tx.data! })!; + const result: Record = { + supportsUnit: [parsed.args.length > 0 && parsed.args[0] === "units"], + supportedUnits: [["units", "kg"]], + preferredUnit: ["kg"], + balanceOf: [canonical], + balanceOfUnit: [canonical * 3n], + }; + if (parsed.name === "balanceOfUnit") assert.equal(parsed.args[1], "kg"); + return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); + }, + }); + assert.equal((await token.discover(10))!.supports("kg"), true); + const balance = await token.balance(address, undefined, 10); + assert.equal(balance.multiplierNumerator, canonical * 3n); + assert.equal(balance.multiplierDenominator, canonical); + assert.equal(await token.supportsUnit(" ", 10), false); + assert.throws(() => token.balanceOfUnit(address, " ")); + }); +}); + +describe("IPFS gateway", () => { + it("resolves references and rejects unsupported schemes and traversal", () => { + const gateway = new IpfsGateway(); + for (const ref of [ + "ipfs://QmExample/lab.json", + "/ipfs/QmExample/lab.json", + "QmExample/lab.json", + "ipfs://ipfs/QmExample/lab.json", + ]) + assert.equal( + gateway.resolve(ref).href, + "https://ipf.sk/QmExample/lab.json", + ); + assert.equal( + gateway.resolve("https://example.com/lab.json").href, + "https://example.com/lab.json", + ); + for (const ref of ["", "file:///tmp/lab.json", "QmExample/../lab.json"]) + assert.throws(() => gateway.resolve(ref)); + assert.throws(() => new IpfsGateway({ maxResponseBytes: 0 })); + assert.throws( + () => new IpfsGateway({ template: "ftp://example.com/{cid}" }), + ); + }); + it("bounds streamed bodies and cancels oversized responses", async () => { + let cancelled = false; + const gateway = new IpfsGateway({ + maxResponseBytes: 4, + fetch: async () => + new Response( + new ReadableStream({ + start(c) { + c.enqueue(new Uint8Array(5)); + }, + cancel() { + cancelled = true; + }, + }), + ), + }); + await assert.rejects(gateway.readJson("QmExample"), /exceeds/); + assert.equal(cancelled, true); + }); + it("rejects HTTP errors and invalid JSON", async () => { + await assert.rejects( + new IpfsGateway({ + fetch: async () => new Response("no", { status: 404 }), + }).readJson("QmExample"), + /404/, + ); + await assert.rejects( + new IpfsGateway({ fetch: async () => new Response("not json") }).readJson( + "QmExample", + ), + SyntaxError, + ); + }); + it("aborts stalled requests", async () => { + const gateway = new IpfsGateway({ + timeoutMs: 5, + fetch: async (_url, init) => + new Promise((_resolve, reject) => + init!.signal!.addEventListener("abort", () => + reject(new Error("aborted")), + ), + ), + }); + await assert.rejects(gateway.readJson("QmExample"), /aborted/); + }); +}); diff --git a/src.ts/_tests/test-contract.ts b/src.ts/_tests/test-contract.ts index c92c7f2f2..2dcbec7c8 100644 --- a/src.ts/_tests/test-contract.ts +++ b/src.ts/_tests/test-contract.ts @@ -1,153 +1,156 @@ import { - getDefaultProvider, - Wallet, - Transaction, - SigningKey, - BaseWallet, - verifyMessage, - isAddressable, + getDefaultProvider, + Wallet, + Transaction, + SigningKey, + BaseWallet, + verifyMessage, + isAddressable, } from "../corebc.js"; import assert from "assert"; import { networkIdToPrefix } from "../address/index.js"; const TIMEOUT_PERIOD = 120000; const tesSignedTransaction = - "0xf8ce800a830f423f0496ce276773ac97d16855a3c8faa45399136b56d419486081c880b8ab54bc60412c90c104a89865a43c33f335836bcb473f0cd477ecb2c82e6310676c87b708e3971d009b4a04e518f12454c3ee1aebc19a6b7df00076b834b692b7432611f3dafff0f422dfbae722ba4b989cfc82fee2e539fbbf21d652ea587df59e8421a3a8bc8ca2ba35033598954c54e10c00315484db568379ce94f9c894e3e6e4c7ee216676b713ca892d9b26746ae902a772e217a6a8bb493ce2bb313cf0cb66e76765d4c45ec6b68600"; + "0xf8ce800a830f423f0496ce276773ac97d16855a3c8faa45399136b56d419486081c880b8ab54bc60412c90c104a89865a43c33f335836bcb473f0cd477ecb2c82e6310676c87b708e3971d009b4a04e518f12454c3ee1aebc19a6b7df00076b834b692b7432611f3dafff0f422dfbae722ba4b989cfc82fee2e539fbbf21d652ea587df59e8421a3a8bc8ca2ba35033598954c54e10c00315484db568379ce94f9c894e3e6e4c7ee216676b713ca892d9b26746ae902a772e217a6a8bb493ce2bb313cf0cb66e76765d4c45ec6b68600"; const testWalletPhrase = - "better artwork flavor fish solve deer orient spread adapt doll attack hour sort copper super income bacon engine skate ill similar wink crack club"; + "better artwork flavor fish solve deer orient spread adapt doll attack hour sort copper super income bacon engine skate ill similar wink crack club"; const testSeed = - "ec372b08ffc451a5dd991c68006aa01a033a6a391e0e72d5690c13cff719fdcb2502812dbf5f32a6df828cd22d77a36405bb15bb2637b7e77f99fa60f00d3560"; + "ec372b08ffc451a5dd991c68006aa01a033a6a391e0e72d5690c13cff719fdcb2502812dbf5f32a6df828cd22d77a36405bb15bb2637b7e77f99fa60f00d3560"; const tesPrivateKey = - "69bb68c3a00a0cd9cbf2cab316476228c758329bbfe0b1759e8634694a9497afea05bcbf24e2aa0627eac4240484bb71de646a9296872a3c0e"; + "69bb68c3a00a0cd9cbf2cab316476228c758329bbfe0b1759e8634694a9497afea05bcbf24e2aa0627eac4240484bb71de646a9296872a3c0e"; const testAddress = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; const testPublicKey = - "0x484ed765af56534f1c98c0f3ac9fb460fbf5c3cf582e54a6cdfc319986ce1bb875d3afcc9c336764348c96264dfeef9565364d7e8e14e9aa80"; -const provider = getDefaultProvider("https://xcbapi.corecoin.cc/"); + "0x484ed765af56534f1c98c0f3ac9fb460fbf5c3cf582e54a6cdfc319986ce1bb875d3afcc9c336764348c96264dfeef9565364d7e8e14e9aa80"; +const provider = getDefaultProvider( + process.env.COREBC_RPC_URL || "https://xcbapi.corecoin.cc/", +); const mnemonicWallet = Wallet.fromPhrase({ - phrase: testWalletPhrase, - password: "111111", - prefix: networkIdToPrefix(3), + phrase: testWalletPhrase, + password: "111111", + prefix: networkIdToPrefix(3), }); const mnemonicWalletWithoutPassKey = Wallet.fromPhrase({ - phrase: testWalletPhrase, - prefix: networkIdToPrefix(3), + phrase: testWalletPhrase, + prefix: networkIdToPrefix(3), }); -console.log(mnemonicWalletWithoutPassKey.publicKey); + const wallet = Wallet.fromSeed({ - prefix: networkIdToPrefix(3), - seed: testSeed, - provider, + prefix: networkIdToPrefix(3), + seed: testSeed, + provider, }); const seedWallet = Wallet.fromSeed({ - prefix: networkIdToPrefix(3), - seed: testSeed, + prefix: networkIdToPrefix(3), + seed: testSeed, }); const signingKey = new SigningKey(tesPrivateKey); const baseWalletAddress = "0xab03a5fd22b9bee8b8ab877c86e0a2c21765e1d5bfc5"; const baseWallet = new BaseWallet({ - signingKey, - prefix: networkIdToPrefix(3), - provider, + signingKey, + prefix: networkIdToPrefix(3), + provider, }); const randomWallet = Wallet.createRandom(networkIdToPrefix(3), provider); const transaction = Transaction.from({ - to: "0xce276773ac97d16855a3c8faa45399136b56d4194860", - value: 200n, - nonce: 0, - energyLimit: 999999n, - energyPrice: 10n, - networkId: 4, + to: "0xce276773ac97d16855a3c8faa45399136b56d4194860", + value: 200n, + nonce: 0, + energyLimit: 999999n, + energyPrice: 10n, + networkId: 4, }); describe("Test wallet creation", function () { - it("can generate a random wallet", function () { - assert.equal( - randomWallet.mnemonic?.phrase.split(" ").length, - 24, - "mismatch in phrase length", - ); + after(() => provider.destroy()); + it("can generate a random wallet", function () { + assert.equal(mnemonicWalletWithoutPassKey.publicKey.length, 116); + assert.equal( + randomWallet.mnemonic?.phrase.split(" ").length, + 24, + "mismatch in phrase length", + ); - assert.equal( - isAddressable(randomWallet), - true, - "random wallet is not addressable", - ); - }); + assert.equal( + isAddressable(randomWallet), + true, + "random wallet is not addressable", + ); + }); }); describe("Test getting data from blockchain and calling smart contract", function () { - it("can currectly sign a transaction", async function () { - this.timeout(TIMEOUT_PERIOD); - const tx = await baseWallet.signTransaction(transaction); - assert.equal(tx, tesSignedTransaction, "sign transaction failed"); - }); - it("can currectly get signer from signed transaction", async function () { - this.timeout(TIMEOUT_PERIOD); - const message = "my message"; - const signedMessage = await baseWallet.signMessage(message); - const address = verifyMessage(message, signedMessage, networkIdToPrefix(3)); - assert.equal( - address, - baseWalletAddress, - "get address from signed message failed", - ); - }); - it("can get feeData ", async function () { - this.timeout(TIMEOUT_PERIOD); - const feeData = await provider.getFeeData(); - assert.equal( - feeData.energyPrice, - 1000000000n, - "mismatch in expected energy price", - ); - }); - it("can generate wallet", function () { - assert.equal( - mnemonicWallet.address.length, - 46, - "mismatch in address length", - ); - assert.equal( - mnemonicWallet.publicKey, - testPublicKey, - "mismatch in public key", - ); - assert.equal( - mnemonicWallet.address, - testAddress, - "mismatch in generated address", - ); - assert.equal( - seedWallet.address.length, - 46, - "mismatch in address length for seed wallet", - ); - assert.equal( - seedWallet.publicKey, - testPublicKey, - "mismatch in public key for seed wallet", - ); - assert.equal( - seedWallet.address, - testAddress, - "mismatch in seed length for seed wallet", - ); - assert.equal( - wallet.address.length, - 46, - "mismatch in address length for wallet", - ); - assert.equal( - wallet.publicKey, - testPublicKey, - "mismatch in public key for wallet", - ); - assert.equal( - wallet.address, - testAddress, - "mismatch in seed length for wallet", - ); - }); + it("can correctly sign a transaction", async function () { + this.timeout(TIMEOUT_PERIOD); + const tx = await baseWallet.signTransaction(transaction); + assert.equal(tx, tesSignedTransaction, "sign transaction failed"); + }); + it("can correctly get signer from signed transaction", async function () { + this.timeout(TIMEOUT_PERIOD); + const message = "my message"; + const signedMessage = await baseWallet.signMessage(message); + const address = verifyMessage(message, signedMessage, networkIdToPrefix(3)); + assert.equal( + address, + baseWalletAddress, + "get address from signed message failed", + ); + }); + (process.env.COREBC_RPC_URL ? it : it.skip)( + "can get fee data", + async function () { + this.timeout(TIMEOUT_PERIOD); + const feeData = await provider.getFeeData(); + assert.ok(feeData.energyPrice !== null && feeData.energyPrice >= 0n); + }, + ); + it("can generate wallet", function () { + assert.equal( + mnemonicWallet.address.length, + 46, + "mismatch in address length", + ); + assert.equal( + mnemonicWallet.publicKey, + testPublicKey, + "mismatch in public key", + ); + assert.equal( + mnemonicWallet.address, + testAddress, + "mismatch in generated address", + ); + assert.equal( + seedWallet.address.length, + 46, + "mismatch in address length for seed wallet", + ); + assert.equal( + seedWallet.publicKey, + testPublicKey, + "mismatch in public key for seed wallet", + ); + assert.equal( + seedWallet.address, + testAddress, + "mismatch in seed length for seed wallet", + ); + assert.equal( + wallet.address.length, + 46, + "mismatch in address length for wallet", + ); + assert.equal( + wallet.publicKey, + testPublicKey, + "mismatch in public key for wallet", + ); + assert.equal( + wallet.address, + testAddress, + "mismatch in seed length for wallet", + ); + }); }); diff --git a/src.ts/_tests/test-crypto.ts b/src.ts/_tests/test-crypto.ts new file mode 100644 index 000000000..b66ebf3bc --- /dev/null +++ b/src.ts/_tests/test-crypto.ts @@ -0,0 +1,62 @@ +import assert from "node:assert/strict"; +import { + SigningKey, + getBytes, + sha256, + ripemd160, + scryptSync, + scrypt, + keccak256, +} from "../index.js"; +import { createHash } from "../crypto/crypto-browser.js"; + +describe("updated crypto dependencies", () => { + it("matches standard hash and scrypt vectors", async () => { + assert.equal( + sha256("0x"), + "0xa7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a", + ); + assert.equal(ripemd160("0x"), "0x9c1185a5c5e9fc54612808977ee8f548b2258d31"); + assert.equal( + keccak256("0x"), + "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + ); + const expected = "0x77d6576238657b203b19ca42c18a0497"; + assert.equal(scryptSync("0x", "0x", 16, 1, 1, 16), expected); + assert.equal(await scrypt("0x", "0x", 16, 1, 1, 16), expected); + assert.deepEqual( + createHash("sha256").update(new Uint8Array()).digest(), + getBytes( + "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + ), + ); + }); + it("copies byte private keys and validates lengths", () => { + const bytes = new Uint8Array(57).fill(1); + const key = new SigningKey(bytes); + bytes.fill(2); + assert.equal(key.privateKey, "0x" + "01".repeat(57)); + for (const length of [0, 32, 56, 58]) + assert.throws(() => new SigningKey(new Uint8Array(length))); + assert.throws(() => key.sign("0x00")); + }); + it("signs, rejects tampering and derives symmetric Ed448 secrets in both key modes", () => { + const a = new SigningKey("01".repeat(57)); + const b = new SigningKey("02".repeat(56) + "80"); + const digest = sha256("0x1234"); + for (const key of [a, b]) { + const sig = key.sign(digest); + assert.equal(SigningKey.recoverPublicKey(digest, sig), key.publicKey); + assert.throws(() => SigningKey.recoverPublicKey(sha256("0x1235"), sig)); + } + assert.equal( + a.computeSharedSecret(b.publicKey), + b.computeSharedSecret(a.publicKey), + ); + assert.equal( + SigningKey.addPoints(a.publicKey, b.publicKey), + SigningKey.addPoints(b.publicKey, a.publicKey), + ); + assert.throws(() => a.computeSharedSecret("0x00")); + }); +}); diff --git a/src.ts/_tests/test-keystore.ts b/src.ts/_tests/test-keystore.ts new file mode 100644 index 000000000..dccfe38f4 --- /dev/null +++ b/src.ts/_tests/test-keystore.ts @@ -0,0 +1,63 @@ +import assert from "node:assert/strict"; +import { + Wallet, + networkIdToPrefix, + encryptKeystoreJsonSync, + encryptKeystoreJson, + decryptKeystoreJsonSync, + decryptKeystoreJson, +} from "../index.js"; + +describe("AES keystores", () => { + const wallet = Wallet.fromSeed({ + seed: "01".repeat(64), + prefix: networkIdToPrefix(3), + }); + const account = { address: wallet.address, privateKey: wallet.privateKey }; + const options = { scrypt: { N: 16, r: 1, p: 1 } }; + it("round-trips Ed448 keys with sync and async encryption", async () => { + for (const json of [ + encryptKeystoreJsonSync(account, "test", options), + await encryptKeystoreJson(account, "test", options), + ]) { + assert.deepEqual(decryptKeystoreJsonSync(json, "test"), account); + assert.deepEqual(await decryptKeystoreJson(json, "test"), account); + assert.throws( + () => decryptKeystoreJsonSync(json, "wrong"), + /incorrect password/, + ); + const changed = JSON.parse(json); + changed.Crypto.mac = "00".repeat(32); + await assert.rejects( + decryptKeystoreJson(JSON.stringify(changed), "test"), + /incorrect password/, + ); + } + }); + it("rejects unsafe KDF parameters before allocating work", () => { + for (const scrypt of [ + { N: 0 }, + { N: 1 }, + { N: 2 ** 32 }, + { r: 0 }, + { p: 2 ** 30 }, + { N: 1048576, r: 8 }, + ]) + assert.throws( + () => encryptKeystoreJsonSync(account, "test", { scrypt }), + /unsafe/, + ); + const data = JSON.parse(encryptKeystoreJsonSync(account, "test", options)); + data.Crypto.kdfparams.n = 2 ** 32; + assert.throws( + () => decryptKeystoreJsonSync(JSON.stringify(data), "test"), + /unsafe/, + ); + data.Crypto.kdf = "pbkdf2"; + Object.assign(data.Crypto.kdfparams, { c: 10000001, prf: "hmac-sha256" }); + assert.throws( + () => decryptKeystoreJsonSync(JSON.stringify(data), "test"), + /unsafe/, + ); + }); +}); diff --git a/src.ts/_tests/types.ts b/src.ts/_tests/types.ts index 50a53748f..9fdaaa951 100644 --- a/src.ts/_tests/types.ts +++ b/src.ts/_tests/types.ts @@ -1,142 +1,142 @@ export type TestCaseAbiVerbose = - | { - type: "address" | "hexstring" | "number" | "string"; - value: string; - } - | { - type: "boolean"; - value: boolean; - } - | { - type: "array"; - value: Array; - } - | { - type: "object"; - value: Array; - }; + | { + type: "address" | "hexstring" | "number" | "string"; + value: string; + } + | { + type: "boolean"; + value: boolean; + } + | { + type: "array"; + value: Array; + } + | { + type: "object"; + value: Array; + }; export interface TestCaseAbi { - name: string; - type: string; - value: any; - verbose: TestCaseAbiVerbose; - bytecode: string; - encoded: string; + name: string; + type: string; + value: any; + verbose: TestCaseAbiVerbose; + bytecode: string; + encoded: string; } ///////////////////////////// // address export interface TestCaseAccount { - name: string; - privateKey: string; - address: string; - icap: string; + name: string; + privateKey: string; + address: string; + icap: string; } export type TestCaseCreate = { - sender: string; - creates: Array<{ - name: string; - nonce: number; - address: string; - }>; + sender: string; + creates: Array<{ + name: string; + nonce: number; + address: string; + }>; }; export type TestCaseCreate2 = { - sender: string; - creates: Array<{ - name: string; - salt: string; - initCode: string; - initCodeHash: string; - address: string; - }>; + sender: string; + creates: Array<{ + name: string; + salt: string; + initCode: string; + initCodeHash: string; + address: string; + }>; }; ///////////////////////////// // crypto export interface TestCaseHash { - name: string; - data: string; - sha256: string; - sha512: string; - ripemd160: string; + name: string; + data: string; + sha256: string; + sha512: string; + ripemd160: string; } export interface TestCasePbkdf { - name: string; - password: string; - salt: string; - dkLen: number; - pbkdf2: { - iterations: number; - algorithm: "sha256" | "sha512"; - key: string; - }; - scrypt: { - N: number; - r: number; - p: number; - key: string; - }; + name: string; + password: string; + salt: string; + dkLen: number; + pbkdf2: { + iterations: number; + algorithm: "sha256" | "sha512"; + key: string; + }; + scrypt: { + N: number; + r: number; + p: number; + key: string; + }; } export interface TestCaseHmac { - name: string; - data: string; - key: string; - algorithm: "sha256" | "sha512"; - hmac: string; + name: string; + data: string; + key: string; + algorithm: "sha256" | "sha512"; + hmac: string; } ///////////////////////////// // hash export interface TestCaseHash { - name: string; - data: string; - sha256: string; - sha512: string; - ripemd160: string; + name: string; + data: string; + sha256: string; + sha512: string; + ripemd160: string; } export interface TestCaseTypedDataDomain { - name?: string; - version?: string; - networkId?: number; - verifyingContract?: string; - salt?: string; + name?: string; + version?: string; + networkId?: number; + verifyingContract?: string; + salt?: string; } export interface TestCaseTypedDataType { - name: string; - type: string; + name: string; + type: string; } export interface TestCaseTypedData { - name: string; + name: string; - domain: TestCaseTypedDataDomain; - primaryType: string; - types: Record>; - data: any; + domain: TestCaseTypedDataDomain; + primaryType: string; + types: Record>; + data: any; - encoded: string; - digest: string; + encoded: string; + digest: string; - privateKey?: string; - signature?: string; + privateKey?: string; + signature?: string; } export interface TestCaseSolidityHash { - name: string; - types: Array; - ripemd160: string; - sha256: string; - values: Array; + name: string; + types: Array; + ripemd160: string; + sha256: string; + values: Array; } ///////////////////////////// @@ -145,98 +145,98 @@ export interface TestCaseSolidityHash { export type NestedHexString = string | Array; export interface TestCaseRlp { - name: string; - encoded: string; - decoded: NestedHexString; + name: string; + encoded: string; + decoded: NestedHexString; } ///////////////////////////// // transaction export interface TestCaseTransactionTx { - to?: string; - nonce?: number; - energyLimit?: string; + to?: string; + nonce?: number; + energyLimit?: string; - energyPrice?: string; - maxFeePerEnergy?: string; + energyPrice?: string; + maxFeePerEnergy?: string; - data?: string; - value?: string; + data?: string; + value?: string; - accessList?: Array<{ address: string; storageKeys: Array }>; + accessList?: Array<{ address: string; storageKeys: Array }>; - networkId?: string; + networkId?: string; } export interface TestCaseTransactionSig { - r: string; - s: string; - v: string; + r: string; + s: string; + v: string; } export interface TestCaseTransaction { - name: string; - transaction: TestCaseTransactionTx; - privateKey: string; + name: string; + transaction: TestCaseTransactionTx; + privateKey: string; - unsignedLegacy: string; - signedLegacy: string; - unsignedEip155: string; - signedEip155: string; - unsignedBerlin: string; - signedBerlin: string; - unsignedLondon: string; - signedLondon: string; + unsignedLegacy: string; + signedLegacy: string; + unsignedEip155: string; + signedEip155: string; + unsignedBerlin: string; + signedBerlin: string; + unsignedLondon: string; + signedLondon: string; - signatureLegacy: TestCaseTransactionSig; - signatureEip155: TestCaseTransactionSig; - signatureBerlin: TestCaseTransactionSig; - signatureLondon: TestCaseTransactionSig; + signatureLegacy: TestCaseTransactionSig; + signatureEip155: TestCaseTransactionSig; + signatureBerlin: TestCaseTransactionSig; + signatureLondon: TestCaseTransactionSig; } ///////////////////////////// // wallet export interface TestCaseMnemonicNode { - path: string; - chainCode: string; - depth: number; - index: number; - parentFingerprint: string; - fingerprint: string; - publicKey: string; - privateKey: string; - xpriv: string; - xpub: string; + path: string; + chainCode: string; + depth: number; + index: number; + parentFingerprint: string; + fingerprint: string; + publicKey: string; + privateKey: string; + xpriv: string; + xpub: string; } export interface TestCaseMnemonic { - name: string; - phrase: string; - phraseHash: string; - password: string; - locale: string; - entropy: string; - seed: string; - nodes: Array; + name: string; + phrase: string; + phraseHash: string; + password: string; + locale: string; + entropy: string; + seed: string; + nodes: Array; } export interface TestCaseWallet { - name: string; - filename: string; - type: string; - address: string; - password: string; - content: string; + name: string; + filename: string; + type: string; + address: string; + password: string; + content: string; } ///////////////////////////// // wordlists export interface TestCaseWordlist { - name: string; - filename: string; - locale: string; - content: string; + name: string; + filename: string; + locale: string; + content: string; } diff --git a/src.ts/_version.ts b/src.ts/_version.ts index a49459bed..7e7b72401 100644 --- a/src.ts/_version.ts +++ b/src.ts/_version.ts @@ -1,6 +1,2 @@ -/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */ - -/** - * The current version of corebc. - */ -export const version: string = "6.4.0"; +/** The current version of corebc; keep in sync with package.json. */ +export const version: string = "0.4.1"; diff --git a/src.ts/abi-types/Tes.ts b/src.ts/abi-types/Tes.ts index 031514d63..f5162db0a 100644 --- a/src.ts/abi-types/Tes.ts +++ b/src.ts/abi-types/Tes.ts @@ -2,447 +2,447 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumberish, - BytesLike, - FunctionFragment, - Result, - Interface, - EventFragment, - AddressLike, - ContractRunner, - ContractMethod, - Listener, + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, } from "../corebc.js"; import type { - TypedContractEvent, - TypedDeferredTopicFilter, - TypedEventLog, - TypedLogDescription, - TypedListener, - TypedContractMethod, + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, } from "./common.js"; export interface TesInterface extends Interface { - getFunction( - nameOrSignature: - | "approve" - | "balanceOf" - | "batchOwnerOf" - | "getApproved" - | "isApprovedForAll" - | "mint" - | "ownerOf" - | "safeTransferFrom(address,address,uint256)" - | "safeTransferFrom(address,address,uint256,bytes)" - | "setApprovalForAll" - | "tokenByIndex" - | "tokenOfOwnerByIndex" - | "totalSupply" - | "transferFrom", - ): FunctionFragment; - - getEvent( - nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer", - ): EventFragment; - - encodeFunctionData( - functionFragment: "approve", - values: [AddressLike, BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "balanceOf", - values: [AddressLike], - ): string; - encodeFunctionData( - functionFragment: "batchOwnerOf", - values: [BigNumberish[]], - ): string; - encodeFunctionData( - functionFragment: "getApproved", - values: [BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "isApprovedForAll", - values: [AddressLike, AddressLike], - ): string; - encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; - encodeFunctionData( - functionFragment: "ownerOf", - values: [BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "safeTransferFrom(address,address,uint256)", - values: [AddressLike, AddressLike, BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "safeTransferFrom(address,address,uint256,bytes)", - values: [AddressLike, AddressLike, BigNumberish, BytesLike], - ): string; - encodeFunctionData( - functionFragment: "setApprovalForAll", - values: [AddressLike, boolean], - ): string; - encodeFunctionData( - functionFragment: "tokenByIndex", - values: [BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "tokenOfOwnerByIndex", - values: [AddressLike, BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "totalSupply", - values?: undefined, - ): string; - encodeFunctionData( - functionFragment: "transferFrom", - values: [AddressLike, AddressLike, BigNumberish], - ): string; - - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "batchOwnerOf", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "getApproved", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "isApprovedForAll", - data: BytesLike, - ): Result; - decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "safeTransferFrom(address,address,uint256)", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "safeTransferFrom(address,address,uint256,bytes)", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "setApprovalForAll", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "tokenByIndex", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "tokenOfOwnerByIndex", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "totalSupply", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "transferFrom", - data: BytesLike, - ): Result; + getFunction( + nameOrSignature: + | "approve" + | "balanceOf" + | "batchOwnerOf" + | "getApproved" + | "isApprovedForAll" + | "mint" + | "ownerOf" + | "safeTransferFrom(address,address,uint256)" + | "safeTransferFrom(address,address,uint256,bytes)" + | "setApprovalForAll" + | "tokenByIndex" + | "tokenOfOwnerByIndex" + | "totalSupply" + | "transferFrom", + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer", + ): EventFragment; + + encodeFunctionData( + functionFragment: "approve", + values: [AddressLike, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [AddressLike], + ): string; + encodeFunctionData( + functionFragment: "batchOwnerOf", + values: [BigNumberish[]], + ): string; + encodeFunctionData( + functionFragment: "getApproved", + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "isApprovedForAll", + values: [AddressLike, AddressLike], + ): string; + encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "ownerOf", + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom(address,address,uint256)", + values: [AddressLike, AddressLike, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom(address,address,uint256,bytes)", + values: [AddressLike, AddressLike, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: "setApprovalForAll", + values: [AddressLike, boolean], + ): string; + encodeFunctionData( + functionFragment: "tokenByIndex", + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "tokenOfOwnerByIndex", + values: [AddressLike, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [AddressLike, AddressLike, BigNumberish], + ): string; + + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "batchOwnerOf", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "getApproved", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "isApprovedForAll", + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom(address,address,uint256)", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom(address,address,uint256,bytes)", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "setApprovalForAll", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "tokenByIndex", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "tokenOfOwnerByIndex", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike, + ): Result; } export namespace ApprovalEvent { - export type InputTuple = [ - owner: AddressLike, - approved: AddressLike, - tokenId: BigNumberish, - ]; - export type OutputTuple = [owner: string, approved: string, tokenId: bigint]; - export interface OutputObject { - owner: string; - approved: string; - tokenId: bigint; - } - export type Event = TypedContractEvent; - export type Filter = TypedDeferredTopicFilter; - export type Log = TypedEventLog; - export type LogDescription = TypedLogDescription; + export type InputTuple = [ + owner: AddressLike, + approved: AddressLike, + tokenId: BigNumberish, + ]; + export type OutputTuple = [owner: string, approved: string, tokenId: bigint]; + export interface OutputObject { + owner: string; + approved: string; + tokenId: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; } export namespace ApprovalForAllEvent { - export type InputTuple = [ - owner: AddressLike, - operator: AddressLike, - approved: boolean, - ]; - export type OutputTuple = [ - owner: string, - operator: string, - approved: boolean, - ]; - export interface OutputObject { - owner: string; - operator: string; - approved: boolean; - } - export type Event = TypedContractEvent; - export type Filter = TypedDeferredTopicFilter; - export type Log = TypedEventLog; - export type LogDescription = TypedLogDescription; + export type InputTuple = [ + owner: AddressLike, + operator: AddressLike, + approved: boolean, + ]; + export type OutputTuple = [ + owner: string, + operator: string, + approved: boolean, + ]; + export interface OutputObject { + owner: string; + operator: string; + approved: boolean; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; } export namespace TransferEvent { - export type InputTuple = [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - ]; - export type OutputTuple = [from: string, to: string, tokenId: bigint]; - export interface OutputObject { - from: string; - to: string; - tokenId: bigint; - } - export type Event = TypedContractEvent; - export type Filter = TypedDeferredTopicFilter; - export type Log = TypedEventLog; - export type LogDescription = TypedLogDescription; + export type InputTuple = [ + from: AddressLike, + to: AddressLike, + tokenId: BigNumberish, + ]; + export type OutputTuple = [from: string, to: string, tokenId: bigint]; + export interface OutputObject { + from: string; + to: string; + tokenId: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; } export interface Tes extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; - attach(addressOrName: AddressLike): this; - deployed(): Promise; - - interface: TesInterface; - - queryFilter( - event: TCEvent, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined, - ): Promise>>; - queryFilter( - filter: TypedDeferredTopicFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined, - ): Promise>>; - - on( - event: TCEvent, - listener: TypedListener, - ): Promise; - on( - filter: TypedDeferredTopicFilter, - listener: TypedListener, - ): Promise; - - once( - event: TCEvent, - listener: TypedListener, - ): Promise; - once( - filter: TypedDeferredTopicFilter, - listener: TypedListener, - ): Promise; - - listeners( - event: TCEvent, - ): Promise>>; - listeners(eventName?: string): Promise>; - removeAllListeners( - event?: TCEvent, - ): Promise; - - approve: TypedContractMethod< - [to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - - balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - - batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - - getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - - isApprovedForAll: TypedContractMethod< - [owner: AddressLike, operator: AddressLike], - [boolean], - "view" - >; - - mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - - ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - - "safeTransferFrom(address,address,uint256)": TypedContractMethod< - [from: AddressLike, to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - - "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod< - [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike, - ], - [void], - "nonpayable" - >; - - setApprovalForAll: TypedContractMethod< - [operator: AddressLike, approved: boolean], - [void], - "nonpayable" - >; - - tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; - - tokenOfOwnerByIndex: TypedContractMethod< - [owner: AddressLike, index: BigNumberish], - [bigint], - "view" - >; - - totalSupply: TypedContractMethod<[], [bigint], "view">; - - transferFrom: TypedContractMethod< - [from: AddressLike, to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - - getFunction( - key: string | FunctionFragment, - ): T; - - getFunction( - nameOrSignature: "approve", - ): TypedContractMethod< - [to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - getFunction( - nameOrSignature: "balanceOf", - ): TypedContractMethod<[owner: AddressLike], [bigint], "view">; - getFunction( - nameOrSignature: "batchOwnerOf", - ): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getFunction( - nameOrSignature: "getApproved", - ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction( - nameOrSignature: "isApprovedForAll", - ): TypedContractMethod< - [owner: AddressLike, operator: AddressLike], - [boolean], - "view" - >; - getFunction( - nameOrSignature: "mint", - ): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - getFunction( - nameOrSignature: "ownerOf", - ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction( - nameOrSignature: "safeTransferFrom(address,address,uint256)", - ): TypedContractMethod< - [from: AddressLike, to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - getFunction( - nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)", - ): TypedContractMethod< - [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike, - ], - [void], - "nonpayable" - >; - getFunction( - nameOrSignature: "setApprovalForAll", - ): TypedContractMethod< - [operator: AddressLike, approved: boolean], - [void], - "nonpayable" - >; - getFunction( - nameOrSignature: "tokenByIndex", - ): TypedContractMethod<[index: BigNumberish], [bigint], "view">; - getFunction( - nameOrSignature: "tokenOfOwnerByIndex", - ): TypedContractMethod< - [owner: AddressLike, index: BigNumberish], - [bigint], - "view" - >; - getFunction( - nameOrSignature: "totalSupply", - ): TypedContractMethod<[], [bigint], "view">; - getFunction( - nameOrSignature: "transferFrom", - ): TypedContractMethod< - [from: AddressLike, to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - - getEvent( - key: "Approval", - ): TypedContractEvent< - ApprovalEvent.InputTuple, - ApprovalEvent.OutputTuple, - ApprovalEvent.OutputObject - >; - getEvent( - key: "ApprovalForAll", - ): TypedContractEvent< - ApprovalForAllEvent.InputTuple, - ApprovalForAllEvent.OutputTuple, - ApprovalForAllEvent.OutputObject - >; - getEvent( - key: "Transfer", - ): TypedContractEvent< - TransferEvent.InputTuple, - TransferEvent.OutputTuple, - TransferEvent.OutputObject - >; - - filters: { - "Approval(address,address,uint256)": TypedContractEvent< - ApprovalEvent.InputTuple, - ApprovalEvent.OutputTuple, - ApprovalEvent.OutputObject - >; - Approval: TypedContractEvent< - ApprovalEvent.InputTuple, - ApprovalEvent.OutputTuple, - ApprovalEvent.OutputObject - >; - - "ApprovalForAll(address,address,bool)": TypedContractEvent< - ApprovalForAllEvent.InputTuple, - ApprovalForAllEvent.OutputTuple, - ApprovalForAllEvent.OutputObject - >; - ApprovalForAll: TypedContractEvent< - ApprovalForAllEvent.InputTuple, - ApprovalForAllEvent.OutputTuple, - ApprovalForAllEvent.OutputObject - >; - - "Transfer(address,address,uint256)": TypedContractEvent< - TransferEvent.InputTuple, - TransferEvent.OutputTuple, - TransferEvent.OutputObject - >; - Transfer: TypedContractEvent< - TransferEvent.InputTuple, - TransferEvent.OutputTuple, - TransferEvent.OutputObject - >; - }; + connect(runner?: ContractRunner | null): BaseContract; + attach(addressOrName: AddressLike): this; + deployed(): Promise; + + interface: TesInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener, + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener, + ): Promise; + + once( + event: TCEvent, + listener: TypedListener, + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener, + ): Promise; + + listeners( + event: TCEvent, + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent, + ): Promise; + + approve: TypedContractMethod< + [to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + + balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; + + batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; + + getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; + + isApprovedForAll: TypedContractMethod< + [owner: AddressLike, operator: AddressLike], + [boolean], + "view" + >; + + mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; + + ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; + + "safeTransferFrom(address,address,uint256)": TypedContractMethod< + [from: AddressLike, to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + + "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod< + [ + from: AddressLike, + to: AddressLike, + tokenId: BigNumberish, + data: BytesLike, + ], + [void], + "nonpayable" + >; + + setApprovalForAll: TypedContractMethod< + [operator: AddressLike, approved: boolean], + [void], + "nonpayable" + >; + + tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; + + tokenOfOwnerByIndex: TypedContractMethod< + [owner: AddressLike, index: BigNumberish], + [bigint], + "view" + >; + + totalSupply: TypedContractMethod<[], [bigint], "view">; + + transferFrom: TypedContractMethod< + [from: AddressLike, to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment, + ): T; + + getFunction( + nameOrSignature: "approve", + ): TypedContractMethod< + [to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "balanceOf", + ): TypedContractMethod<[owner: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "batchOwnerOf", + ): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; + getFunction( + nameOrSignature: "getApproved", + ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "isApprovedForAll", + ): TypedContractMethod< + [owner: AddressLike, operator: AddressLike], + [boolean], + "view" + >; + getFunction( + nameOrSignature: "mint", + ): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "ownerOf", + ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "safeTransferFrom(address,address,uint256)", + ): TypedContractMethod< + [from: AddressLike, to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)", + ): TypedContractMethod< + [ + from: AddressLike, + to: AddressLike, + tokenId: BigNumberish, + data: BytesLike, + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "setApprovalForAll", + ): TypedContractMethod< + [operator: AddressLike, approved: boolean], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "tokenByIndex", + ): TypedContractMethod<[index: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "tokenOfOwnerByIndex", + ): TypedContractMethod< + [owner: AddressLike, index: BigNumberish], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "totalSupply", + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "transferFrom", + ): TypedContractMethod< + [from: AddressLike, to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + + getEvent( + key: "Approval", + ): TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + getEvent( + key: "ApprovalForAll", + ): TypedContractEvent< + ApprovalForAllEvent.InputTuple, + ApprovalForAllEvent.OutputTuple, + ApprovalForAllEvent.OutputObject + >; + getEvent( + key: "Transfer", + ): TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + + filters: { + "Approval(address,address,uint256)": TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + Approval: TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + + "ApprovalForAll(address,address,bool)": TypedContractEvent< + ApprovalForAllEvent.InputTuple, + ApprovalForAllEvent.OutputTuple, + ApprovalForAllEvent.OutputObject + >; + ApprovalForAll: TypedContractEvent< + ApprovalForAllEvent.InputTuple, + ApprovalForAllEvent.OutputTuple, + ApprovalForAllEvent.OutputObject + >; + + "Transfer(address,address,uint256)": TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + Transfer: TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + }; } diff --git a/src.ts/abi-types/Tes_abi.ts b/src.ts/abi-types/Tes_abi.ts index 5639c55e8..38c007b26 100644 --- a/src.ts/abi-types/Tes_abi.ts +++ b/src.ts/abi-types/Tes_abi.ts @@ -2,447 +2,447 @@ /* tslint:disable */ /* eslint-disable */ import type { - BaseContract, - BigNumberish, - BytesLike, - FunctionFragment, - Result, - Interface, - EventFragment, - AddressLike, - ContractRunner, - ContractMethod, - Listener, + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, } from "../corebc.js"; import type { - TypedContractEvent, - TypedDeferredTopicFilter, - TypedEventLog, - TypedLogDescription, - TypedListener, - TypedContractMethod, + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, } from "./common.js"; export interface Tes_abiInterface extends Interface { - getFunction( - nameOrSignature: - | "approve" - | "balanceOf" - | "batchOwnerOf" - | "getApproved" - | "isApprovedForAll" - | "mint" - | "ownerOf" - | "safeTransferFrom(address,address,uint256)" - | "safeTransferFrom(address,address,uint256,bytes)" - | "setApprovalForAll" - | "tokenByIndex" - | "tokenOfOwnerByIndex" - | "totalSupply" - | "transferFrom", - ): FunctionFragment; - - getEvent( - nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer", - ): EventFragment; - - encodeFunctionData( - functionFragment: "approve", - values: [AddressLike, BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "balanceOf", - values: [AddressLike], - ): string; - encodeFunctionData( - functionFragment: "batchOwnerOf", - values: [BigNumberish[]], - ): string; - encodeFunctionData( - functionFragment: "getApproved", - values: [BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "isApprovedForAll", - values: [AddressLike, AddressLike], - ): string; - encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; - encodeFunctionData( - functionFragment: "ownerOf", - values: [BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "safeTransferFrom(address,address,uint256)", - values: [AddressLike, AddressLike, BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "safeTransferFrom(address,address,uint256,bytes)", - values: [AddressLike, AddressLike, BigNumberish, BytesLike], - ): string; - encodeFunctionData( - functionFragment: "setApprovalForAll", - values: [AddressLike, boolean], - ): string; - encodeFunctionData( - functionFragment: "tokenByIndex", - values: [BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "tokenOfOwnerByIndex", - values: [AddressLike, BigNumberish], - ): string; - encodeFunctionData( - functionFragment: "totalSupply", - values?: undefined, - ): string; - encodeFunctionData( - functionFragment: "transferFrom", - values: [AddressLike, AddressLike, BigNumberish], - ): string; - - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "batchOwnerOf", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "getApproved", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "isApprovedForAll", - data: BytesLike, - ): Result; - decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; - decodeFunctionResult( - functionFragment: "safeTransferFrom(address,address,uint256)", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "safeTransferFrom(address,address,uint256,bytes)", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "setApprovalForAll", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "tokenByIndex", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "tokenOfOwnerByIndex", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "totalSupply", - data: BytesLike, - ): Result; - decodeFunctionResult( - functionFragment: "transferFrom", - data: BytesLike, - ): Result; + getFunction( + nameOrSignature: + | "approve" + | "balanceOf" + | "batchOwnerOf" + | "getApproved" + | "isApprovedForAll" + | "mint" + | "ownerOf" + | "safeTransferFrom(address,address,uint256)" + | "safeTransferFrom(address,address,uint256,bytes)" + | "setApprovalForAll" + | "tokenByIndex" + | "tokenOfOwnerByIndex" + | "totalSupply" + | "transferFrom", + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer", + ): EventFragment; + + encodeFunctionData( + functionFragment: "approve", + values: [AddressLike, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [AddressLike], + ): string; + encodeFunctionData( + functionFragment: "batchOwnerOf", + values: [BigNumberish[]], + ): string; + encodeFunctionData( + functionFragment: "getApproved", + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "isApprovedForAll", + values: [AddressLike, AddressLike], + ): string; + encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "ownerOf", + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom(address,address,uint256)", + values: [AddressLike, AddressLike, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "safeTransferFrom(address,address,uint256,bytes)", + values: [AddressLike, AddressLike, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: "setApprovalForAll", + values: [AddressLike, boolean], + ): string; + encodeFunctionData( + functionFragment: "tokenByIndex", + values: [BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "tokenOfOwnerByIndex", + values: [AddressLike, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined, + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [AddressLike, AddressLike, BigNumberish], + ): string; + + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "batchOwnerOf", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "getApproved", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "isApprovedForAll", + data: BytesLike, + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom(address,address,uint256)", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "safeTransferFrom(address,address,uint256,bytes)", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "setApprovalForAll", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "tokenByIndex", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "tokenOfOwnerByIndex", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike, + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike, + ): Result; } export namespace ApprovalEvent { - export type InputTuple = [ - owner: AddressLike, - approved: AddressLike, - tokenId: BigNumberish, - ]; - export type OutputTuple = [owner: string, approved: string, tokenId: bigint]; - export interface OutputObject { - owner: string; - approved: string; - tokenId: bigint; - } - export type Event = TypedContractEvent; - export type Filter = TypedDeferredTopicFilter; - export type Log = TypedEventLog; - export type LogDescription = TypedLogDescription; + export type InputTuple = [ + owner: AddressLike, + approved: AddressLike, + tokenId: BigNumberish, + ]; + export type OutputTuple = [owner: string, approved: string, tokenId: bigint]; + export interface OutputObject { + owner: string; + approved: string; + tokenId: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; } export namespace ApprovalForAllEvent { - export type InputTuple = [ - owner: AddressLike, - operator: AddressLike, - approved: boolean, - ]; - export type OutputTuple = [ - owner: string, - operator: string, - approved: boolean, - ]; - export interface OutputObject { - owner: string; - operator: string; - approved: boolean; - } - export type Event = TypedContractEvent; - export type Filter = TypedDeferredTopicFilter; - export type Log = TypedEventLog; - export type LogDescription = TypedLogDescription; + export type InputTuple = [ + owner: AddressLike, + operator: AddressLike, + approved: boolean, + ]; + export type OutputTuple = [ + owner: string, + operator: string, + approved: boolean, + ]; + export interface OutputObject { + owner: string; + operator: string; + approved: boolean; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; } export namespace TransferEvent { - export type InputTuple = [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - ]; - export type OutputTuple = [from: string, to: string, tokenId: bigint]; - export interface OutputObject { - from: string; - to: string; - tokenId: bigint; - } - export type Event = TypedContractEvent; - export type Filter = TypedDeferredTopicFilter; - export type Log = TypedEventLog; - export type LogDescription = TypedLogDescription; + export type InputTuple = [ + from: AddressLike, + to: AddressLike, + tokenId: BigNumberish, + ]; + export type OutputTuple = [from: string, to: string, tokenId: bigint]; + export interface OutputObject { + from: string; + to: string; + tokenId: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; } export interface Tes_abi extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; - attach(addressOrName: AddressLike): this; - deployed(): Promise; - - interface: Tes_abiInterface; - - queryFilter( - event: TCEvent, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined, - ): Promise>>; - queryFilter( - filter: TypedDeferredTopicFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined, - ): Promise>>; - - on( - event: TCEvent, - listener: TypedListener, - ): Promise; - on( - filter: TypedDeferredTopicFilter, - listener: TypedListener, - ): Promise; - - once( - event: TCEvent, - listener: TypedListener, - ): Promise; - once( - filter: TypedDeferredTopicFilter, - listener: TypedListener, - ): Promise; - - listeners( - event: TCEvent, - ): Promise>>; - listeners(eventName?: string): Promise>; - removeAllListeners( - event?: TCEvent, - ): Promise; - - approve: TypedContractMethod< - [to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - - balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - - batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - - getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - - isApprovedForAll: TypedContractMethod< - [owner: AddressLike, operator: AddressLike], - [boolean], - "view" - >; - - mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - - ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - - "safeTransferFrom(address,address,uint256)": TypedContractMethod< - [from: AddressLike, to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - - "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod< - [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike, - ], - [void], - "nonpayable" - >; - - setApprovalForAll: TypedContractMethod< - [operator: AddressLike, approved: boolean], - [void], - "nonpayable" - >; - - tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; - - tokenOfOwnerByIndex: TypedContractMethod< - [owner: AddressLike, index: BigNumberish], - [bigint], - "view" - >; - - totalSupply: TypedContractMethod<[], [bigint], "view">; - - transferFrom: TypedContractMethod< - [from: AddressLike, to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - - getFunction( - key: string | FunctionFragment, - ): T; - - getFunction( - nameOrSignature: "approve", - ): TypedContractMethod< - [to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - getFunction( - nameOrSignature: "balanceOf", - ): TypedContractMethod<[owner: AddressLike], [bigint], "view">; - getFunction( - nameOrSignature: "batchOwnerOf", - ): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getFunction( - nameOrSignature: "getApproved", - ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction( - nameOrSignature: "isApprovedForAll", - ): TypedContractMethod< - [owner: AddressLike, operator: AddressLike], - [boolean], - "view" - >; - getFunction( - nameOrSignature: "mint", - ): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - getFunction( - nameOrSignature: "ownerOf", - ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction( - nameOrSignature: "safeTransferFrom(address,address,uint256)", - ): TypedContractMethod< - [from: AddressLike, to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - getFunction( - nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)", - ): TypedContractMethod< - [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike, - ], - [void], - "nonpayable" - >; - getFunction( - nameOrSignature: "setApprovalForAll", - ): TypedContractMethod< - [operator: AddressLike, approved: boolean], - [void], - "nonpayable" - >; - getFunction( - nameOrSignature: "tokenByIndex", - ): TypedContractMethod<[index: BigNumberish], [bigint], "view">; - getFunction( - nameOrSignature: "tokenOfOwnerByIndex", - ): TypedContractMethod< - [owner: AddressLike, index: BigNumberish], - [bigint], - "view" - >; - getFunction( - nameOrSignature: "totalSupply", - ): TypedContractMethod<[], [bigint], "view">; - getFunction( - nameOrSignature: "transferFrom", - ): TypedContractMethod< - [from: AddressLike, to: AddressLike, tokenId: BigNumberish], - [void], - "nonpayable" - >; - - getEvent( - key: "Approval", - ): TypedContractEvent< - ApprovalEvent.InputTuple, - ApprovalEvent.OutputTuple, - ApprovalEvent.OutputObject - >; - getEvent( - key: "ApprovalForAll", - ): TypedContractEvent< - ApprovalForAllEvent.InputTuple, - ApprovalForAllEvent.OutputTuple, - ApprovalForAllEvent.OutputObject - >; - getEvent( - key: "Transfer", - ): TypedContractEvent< - TransferEvent.InputTuple, - TransferEvent.OutputTuple, - TransferEvent.OutputObject - >; - - filters: { - "Approval(address,address,uint256)": TypedContractEvent< - ApprovalEvent.InputTuple, - ApprovalEvent.OutputTuple, - ApprovalEvent.OutputObject - >; - Approval: TypedContractEvent< - ApprovalEvent.InputTuple, - ApprovalEvent.OutputTuple, - ApprovalEvent.OutputObject - >; - - "ApprovalForAll(address,address,bool)": TypedContractEvent< - ApprovalForAllEvent.InputTuple, - ApprovalForAllEvent.OutputTuple, - ApprovalForAllEvent.OutputObject - >; - ApprovalForAll: TypedContractEvent< - ApprovalForAllEvent.InputTuple, - ApprovalForAllEvent.OutputTuple, - ApprovalForAllEvent.OutputObject - >; - - "Transfer(address,address,uint256)": TypedContractEvent< - TransferEvent.InputTuple, - TransferEvent.OutputTuple, - TransferEvent.OutputObject - >; - Transfer: TypedContractEvent< - TransferEvent.InputTuple, - TransferEvent.OutputTuple, - TransferEvent.OutputObject - >; - }; + connect(runner?: ContractRunner | null): BaseContract; + attach(addressOrName: AddressLike): this; + deployed(): Promise; + + interface: Tes_abiInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener, + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener, + ): Promise; + + once( + event: TCEvent, + listener: TypedListener, + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener, + ): Promise; + + listeners( + event: TCEvent, + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent, + ): Promise; + + approve: TypedContractMethod< + [to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + + balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; + + batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; + + getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; + + isApprovedForAll: TypedContractMethod< + [owner: AddressLike, operator: AddressLike], + [boolean], + "view" + >; + + mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; + + ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; + + "safeTransferFrom(address,address,uint256)": TypedContractMethod< + [from: AddressLike, to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + + "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod< + [ + from: AddressLike, + to: AddressLike, + tokenId: BigNumberish, + data: BytesLike, + ], + [void], + "nonpayable" + >; + + setApprovalForAll: TypedContractMethod< + [operator: AddressLike, approved: boolean], + [void], + "nonpayable" + >; + + tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; + + tokenOfOwnerByIndex: TypedContractMethod< + [owner: AddressLike, index: BigNumberish], + [bigint], + "view" + >; + + totalSupply: TypedContractMethod<[], [bigint], "view">; + + transferFrom: TypedContractMethod< + [from: AddressLike, to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment, + ): T; + + getFunction( + nameOrSignature: "approve", + ): TypedContractMethod< + [to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "balanceOf", + ): TypedContractMethod<[owner: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "batchOwnerOf", + ): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; + getFunction( + nameOrSignature: "getApproved", + ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "isApprovedForAll", + ): TypedContractMethod< + [owner: AddressLike, operator: AddressLike], + [boolean], + "view" + >; + getFunction( + nameOrSignature: "mint", + ): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "ownerOf", + ): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "safeTransferFrom(address,address,uint256)", + ): TypedContractMethod< + [from: AddressLike, to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)", + ): TypedContractMethod< + [ + from: AddressLike, + to: AddressLike, + tokenId: BigNumberish, + data: BytesLike, + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "setApprovalForAll", + ): TypedContractMethod< + [operator: AddressLike, approved: boolean], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "tokenByIndex", + ): TypedContractMethod<[index: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "tokenOfOwnerByIndex", + ): TypedContractMethod< + [owner: AddressLike, index: BigNumberish], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "totalSupply", + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "transferFrom", + ): TypedContractMethod< + [from: AddressLike, to: AddressLike, tokenId: BigNumberish], + [void], + "nonpayable" + >; + + getEvent( + key: "Approval", + ): TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + getEvent( + key: "ApprovalForAll", + ): TypedContractEvent< + ApprovalForAllEvent.InputTuple, + ApprovalForAllEvent.OutputTuple, + ApprovalForAllEvent.OutputObject + >; + getEvent( + key: "Transfer", + ): TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + + filters: { + "Approval(address,address,uint256)": TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + Approval: TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + + "ApprovalForAll(address,address,bool)": TypedContractEvent< + ApprovalForAllEvent.InputTuple, + ApprovalForAllEvent.OutputTuple, + ApprovalForAllEvent.OutputObject + >; + ApprovalForAll: TypedContractEvent< + ApprovalForAllEvent.InputTuple, + ApprovalForAllEvent.OutputTuple, + ApprovalForAllEvent.OutputObject + >; + + "Transfer(address,address,uint256)": TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + Transfer: TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + }; } diff --git a/src.ts/abi-types/common.ts b/src.ts/abi-types/common.ts index 2aee3c6dc..f7556774a 100644 --- a/src.ts/abi-types/common.ts +++ b/src.ts/abi-types/common.ts @@ -5,132 +5,121 @@ /* tslint:disable */ /* eslint-disable */ import type { - FunctionFragment, - Typed, - EventFragment, - ContractTransaction, - ContractTransactionResponse, - DeferredTopicFilter, - EventLog, - TransactionRequest, - LogDescription, + FunctionFragment, + Typed, + EventFragment, + ContractTransaction, + ContractTransactionResponse, + DeferredTopicFilter, + EventLog, + TransactionRequest, + LogDescription, } from "../corebc.js"; -export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent> - extends DeferredTopicFilter {} +export interface TypedDeferredTopicFilter< + _TCEvent extends TypedContractEvent, +> extends DeferredTopicFilter {} export interface TypedContractEvent< - InputTuple extends Array = any, - OutputTuple extends Array = any, - OutputObject = any, + InputTuple extends Array = any, + OutputTuple extends Array = any, + OutputObject = any, > { - ( - ...args: Partial - ): TypedDeferredTopicFilter< - TypedContractEvent - >; - name: string; - fragment: EventFragment; - getFragment(...args: Partial): EventFragment; + ( + ...args: Partial + ): TypedDeferredTopicFilter< + TypedContractEvent + >; + name: string; + fragment: EventFragment; + getFragment(...args: Partial): EventFragment; } -type __TypechainAOutputTuple = T extends TypedContractEvent< - infer _U, - infer W -> - ? W - : never; -type __TypechainOutputObject = T extends TypedContractEvent< - infer _U, - infer _W, - infer V -> - ? V - : never; - -export interface TypedEventLog - extends Omit { - args: __TypechainAOutputTuple & __TypechainOutputObject; +type __TypechainAOutputTuple = + T extends TypedContractEvent ? W : never; +type __TypechainOutputObject = + T extends TypedContractEvent ? V : never; + +export interface TypedEventLog extends Omit< + EventLog, + "args" +> { + args: __TypechainAOutputTuple & __TypechainOutputObject; } -export interface TypedLogDescription - extends Omit { - args: __TypechainAOutputTuple & __TypechainOutputObject; +export interface TypedLogDescription< + TCEvent extends TypedContractEvent, +> extends Omit { + args: __TypechainAOutputTuple & __TypechainOutputObject; } export type TypedListener = ( - ...listenerArg: [ - ...__TypechainAOutputTuple, - TypedEventLog, - ...undefined[], - ] + ...listenerArg: [ + ...__TypechainAOutputTuple, + TypedEventLog, + ...undefined[], + ] ) => void; export type MinCoreBCFactory = { - deploy(...a: ARGS[]): Promise; + deploy(...a: ARGS[]): Promise; }; -export type GetContractTypeFromFactory = F extends MinCoreBCFactory< - infer C, - any -> - ? C - : never; -export type GetARGsTypeFromFactory = F extends MinCoreBCFactory - ? Parameters - : never; +export type GetContractTypeFromFactory = + F extends MinCoreBCFactory ? C : never; +export type GetARGsTypeFromFactory = + F extends MinCoreBCFactory ? Parameters : never; export type StateMutability = "nonpayable" | "payable" | "view"; export type BaseOverrides = Omit; export type NonPayableOverrides = Omit< - BaseOverrides, - "value" | "blockTag" | "enableCcipRead" + BaseOverrides, + "value" | "blockTag" | "enableCcipRead" >; export type PayableOverrides = Omit< - BaseOverrides, - "blockTag" | "enableCcipRead" + BaseOverrides, + "blockTag" | "enableCcipRead" >; export type ViewOverrides = Omit; export type Overrides = S extends "nonpayable" - ? NonPayableOverrides - : S extends "payable" - ? PayableOverrides - : ViewOverrides; + ? NonPayableOverrides + : S extends "payable" + ? PayableOverrides + : ViewOverrides; export type PostfixOverrides, S extends StateMutability> = - | A - | [...A, Overrides]; + A | [...A, Overrides]; export type ContractMethodArgs< - A extends Array, - S extends StateMutability, + A extends Array, + S extends StateMutability, > = PostfixOverrides<{ [I in keyof A]-?: A[I] | Typed }, S>; export type DefaultReturnType = R extends Array ? R[0] : R; // export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { export interface TypedContractMethod< - A extends Array = Array, - R = any, - S extends StateMutability = "payable", + A extends Array = Array, + R = any, + S extends StateMutability = "payable", > { - ( - ...args: ContractMethodArgs - ): S extends "view" - ? Promise> - : Promise; + ( + ...args: ContractMethodArgs + ): S extends "view" + ? Promise> + : Promise; - name: string; + name: string; - fragment: FunctionFragment; + fragment: FunctionFragment; - getFragment(...args: ContractMethodArgs): FunctionFragment; + getFragment(...args: ContractMethodArgs): FunctionFragment; - populateTransaction( - ...args: ContractMethodArgs - ): Promise; - staticCall(...args: ContractMethodArgs): Promise>; - send(...args: ContractMethodArgs): Promise; - estimateGas(...args: ContractMethodArgs): Promise; - staticCallResult(...args: ContractMethodArgs): Promise; + populateTransaction( + ...args: ContractMethodArgs + ): Promise; + staticCall(...args: ContractMethodArgs): Promise>; + send(...args: ContractMethodArgs): Promise; + estimateGas(...args: ContractMethodArgs): Promise; + staticCallResult(...args: ContractMethodArgs): Promise; } diff --git a/src.ts/abi-types/factories/Tes__factory.ts b/src.ts/abi-types/factories/Tes__factory.ts index 8eca4cb60..bd57a1633 100644 --- a/src.ts/abi-types/factories/Tes__factory.ts +++ b/src.ts/abi-types/factories/Tes__factory.ts @@ -6,368 +6,368 @@ import { Contract, ContractRunner, Interface } from "../../corebc.js"; import type { Tes, TesInterface } from "../Tes.js"; const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "approved", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Transfer", - type: "event", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "approve", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - ], - name: "batchOwnerOf", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "getApproved", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "isApprovedForAll", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "mint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ownerOf", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenOfOwnerByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "transferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + ], + name: "batchOwnerOf", + outputs: [ + { + internalType: "address[]", + name: "", + type: "address[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenOfOwnerByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, ] as const; export class Tes__factory { - static readonly abi = _abi; - static createInterface(): TesInterface { - return new Interface(_abi) as TesInterface; - } - static connect(address: string, runner?: ContractRunner | null): Tes { - return new Contract(address, _abi, runner) as unknown as Tes; - } + static readonly abi = _abi; + static createInterface(): TesInterface { + return new Interface(_abi) as TesInterface; + } + static connect(address: string, runner?: ContractRunner | null): Tes { + return new Contract(address, _abi, runner) as unknown as Tes; + } } diff --git a/src.ts/abi-types/factories/Tes_abi__factory.ts b/src.ts/abi-types/factories/Tes_abi__factory.ts index 5d7ed54c0..d6ee0b6db 100644 --- a/src.ts/abi-types/factories/Tes_abi__factory.ts +++ b/src.ts/abi-types/factories/Tes_abi__factory.ts @@ -6,368 +6,368 @@ import { Contract, ContractRunner, Interface } from "../../corebc.js"; import type { Tes_abi, Tes_abiInterface } from "../Tes_abi.js"; const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "approved", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Transfer", - type: "event", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "approve", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - ], - name: "batchOwnerOf", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "getApproved", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "isApprovedForAll", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "mint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ownerOf", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenOfOwnerByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "transferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]", + }, + ], + name: "batchOwnerOf", + outputs: [ + { + internalType: "address[]", + name: "", + type: "address[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "operator", + type: "address", + }, + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenOfOwnerByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, ] as const; export class Tes_abi__factory { - static readonly abi = _abi; - static createInterface(): Tes_abiInterface { - return new Interface(_abi) as Tes_abiInterface; - } - static connect(address: string, runner?: ContractRunner | null): Tes_abi { - return new Contract(address, _abi, runner) as unknown as Tes_abi; - } + static readonly abi = _abi; + static createInterface(): Tes_abiInterface { + return new Interface(_abi) as Tes_abiInterface; + } + static connect(address: string, runner?: ContractRunner | null): Tes_abi { + return new Contract(address, _abi, runner) as unknown as Tes_abi; + } } diff --git a/src.ts/abi/abi-coder.ts b/src.ts/abi/abi-coder.ts index d84ad2182..e45eecb22 100644 --- a/src.ts/abi/abi-coder.ts +++ b/src.ts/abi/abi-coder.ts @@ -29,10 +29,10 @@ import { getAddress } from "../address/index.js"; import { getBytes, hexlify, makeError } from "../utils/index.js"; import type { - BytesLike, - CallExceptionAction, - CallExceptionError, - CallExceptionTransaction, + BytesLike, + CallExceptionAction, + CallExceptionError, + CallExceptionTransaction, } from "../utils/index.js"; // https://docs.soliditylang.org/en/v0.8.17/control-structures.html @@ -54,224 +54,224 @@ const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); let defaultCoder: null | AbiCoder = null; function getBuiltinCallException( - action: CallExceptionAction, - tx: { to?: null | string; from?: null | string; data?: string }, - data: null | BytesLike, - abiCoder: AbiCoder, + action: CallExceptionAction, + tx: { to?: null | string; from?: null | string; data?: string }, + data: null | BytesLike, + abiCoder: AbiCoder, ): CallExceptionError { - let message = "missing revert data"; + let message = "missing revert data"; - let reason: null | string = null; - const invocation = null; - let revert: null | { signature: string; name: string; args: Array } = - null; + let reason: null | string = null; + const invocation = null; + let revert: null | { signature: string; name: string; args: Array } = + null; - if (data) { - message = "execution reverted"; + if (data) { + message = "execution reverted"; - const bytes = getBytes(data); - data = hexlify(data); + const bytes = getBytes(data); + data = hexlify(data); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason], - }; - message += `: ${JSON.stringify(reason)}`; - } catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code], - }; - reason = `Panic due to ${PanicReasons.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } catch (error) { - message += " (could not decode panic code)"; - } - } else { - message += " (unknown custom error)"; - } - } + if (bytes.length === 0) { + message += " (no data present; likely require(false) occurred"; + reason = "require(false)"; + } else if (bytes.length % 32 !== 4) { + message += " (could not decode reason; invalid data length)"; + } else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { + // Error(string) + try { + reason = abiCoder.decode(["string"], bytes.slice(4))[0]; + revert = { + signature: "Error(string)", + name: "Error", + args: [reason], + }; + message += `: ${JSON.stringify(reason)}`; + } catch (error) { + message += " (could not decode reason; invalid string data)"; + } + } else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { + // Panic(uint256) + try { + const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); + revert = { + signature: "Panic(uint256)", + name: "Panic", + args: [code], + }; + reason = `Panic due to ${PanicReasons.get(code) || "UNKNOWN"}(${code})`; + message += `: ${reason}`; + } catch (error) { + message += " (could not decode panic code)"; + } + } else { + message += " (unknown custom error)"; + } + } - const transaction: CallExceptionTransaction = { - to: tx.to ? getAddress(tx.to) : null, - data: tx.data || "0x", - }; - if (tx.from) { - transaction.from = getAddress(tx.from); - } + const transaction: CallExceptionTransaction = { + to: tx.to ? getAddress(tx.to) : null, + data: tx.data || "0x", + }; + if (tx.from) { + transaction.from = getAddress(tx.from); + } - return makeError(message, "CALL_EXCEPTION", { - action, - data, - reason, - transaction, - invocation, - revert, - }); + return makeError(message, "CALL_EXCEPTION", { + action, + data, + reason, + transaction, + invocation, + revert, + }); } /** * About AbiCoder */ export class AbiCoder { - #getCoder(param: ParamType): Coder { - if (param.isArray()) { - return new ArrayCoder( - this.#getCoder(param.arrayChildren), - param.arrayLength, - param.name, - ); - } + #getCoder(param: ParamType): Coder { + if (param.isArray()) { + return new ArrayCoder( + this.#getCoder(param.arrayChildren), + param.arrayLength, + param.name, + ); + } - if (param.isTuple()) { - return new TupleCoder( - param.components.map((c) => this.#getCoder(c)), - param.name, - ); - } + if (param.isTuple()) { + return new TupleCoder( + param.components.map((c) => this.#getCoder(c)), + param.name, + ); + } - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } + switch (param.baseType) { + case "address": + return new AddressCoder(param.name); + case "bool": + return new BooleanCoder(param.name); + case "string": + return new StringCoder(param.name); + case "bytes": + return new BytesCoder(param.name); + case "": + return new NullCoder(param.name); + } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - assertArgument( - size !== 0 && size <= 256 && size % 8 === 0, - "invalid " + match[1] + " bit length", - "param", - param, - ); - return new NumberCoder(size / 8, match[1] === "int", param.name); - } + // u?int[0-9]* + let match = param.type.match(paramTypeNumber); + if (match) { + let size = parseInt(match[2] || "256"); + assertArgument( + size !== 0 && size <= 256 && size % 8 === 0, + "invalid " + match[1] + " bit length", + "param", + param, + ); + return new NumberCoder(size / 8, match[1] === "int", param.name); + } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - assertArgument( - size !== 0 && size <= 32, - "invalid bytes length", - "param", - param, - ); - return new FixedBytesCoder(size, param.name); - } + // bytes[0-9]+ + match = param.type.match(paramTypeBytes); + if (match) { + let size = parseInt(match[1]); + assertArgument( + size !== 0 && size <= 32, + "invalid bytes length", + "param", + param, + ); + return new FixedBytesCoder(size, param.name); + } - assertArgument(false, "invalid type", "type", param.type); - } + assertArgument(false, "invalid type", "type", param.type); + } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types: ReadonlyArray): Result { - const coders: Array = types.map((type) => - this.#getCoder(ParamType.from(type)), - ); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } + /** + * Get the default values for the given %%types%%. + * + * For example, a ``uint`` is by default ``0`` and ``bool`` + * is by default ``false``. + */ + getDefaultValue(types: ReadonlyArray): Result { + const coders: Array = types.map((type) => + this.#getCoder(ParamType.from(type)), + ); + const coder = new TupleCoder(coders, "_"); + return coder.defaultValue(); + } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode( - types: ReadonlyArray, - values: ReadonlyArray, - ): string { - assertArgumentCount( - values.length, - types.length, - "types/values length mismatch", - ); + /** + * Encode the %%values%% as the %%types%% into ABI data. + * + * @returns DataHexstring + */ + encode( + types: ReadonlyArray, + values: ReadonlyArray, + ): string { + assertArgumentCount( + values.length, + types.length, + "types/values length mismatch", + ); - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); + const coders = types.map((type) => this.#getCoder(ParamType.from(type))); + const coder = new TupleCoder(coders, "_"); - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } + const writer = new Writer(); + coder.encode(writer, values); + return writer.data; + } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode( - types: ReadonlyArray, - data: BytesLike, - loose?: boolean, - ): Result { - const coders: Array = types.map((type) => - this.#getCoder(ParamType.from(type)), - ); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose)); - } + /** + * Decode the ABI %%data%% as the %%types%% into values. + * + * If %%loose%% decoding is enabled, then strict padding is + * not enforced. Some older versions of Solidity incorrectly + * padded event data emitted from ``external`` functions. + */ + decode( + types: ReadonlyArray, + data: BytesLike, + loose?: boolean, + ): Result { + const coders: Array = types.map((type) => + this.#getCoder(ParamType.from(type)), + ); + const coder = new TupleCoder(coders, "_"); + return coder.decode(new Reader(data, loose)); + } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder(): AbiCoder { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } + /** + * Returns the shared singleton instance of a default [[AbiCoder]]. + * + * On the first call, the instance is created internally. + */ + static defaultAbiCoder(): AbiCoder { + if (defaultCoder == null) { + defaultCoder = new AbiCoder(); + } + return defaultCoder; + } - /** - * Returns an corebc-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException( - action: CallExceptionAction, - tx: { to?: null | string; from?: null | string; data?: string }, - data: null | BytesLike, - ): CallExceptionError { - return getBuiltinCallException( - action, - tx, - data, - AbiCoder.defaultAbiCoder(), - ); - } + /** + * Returns an corebc-compatible [[CallExceptionError]] Error for the given + * result %%data%% for the [[CallExceptionAction]] %%action%% against + * the Transaction %%tx%%. + */ + static getBuiltinCallException( + action: CallExceptionAction, + tx: { to?: null | string; from?: null | string; data?: string }, + data: null | BytesLike, + ): CallExceptionError { + return getBuiltinCallException( + action, + tx, + data, + AbiCoder.defaultAbiCoder(), + ); + } } diff --git a/src.ts/abi/bytes32.ts b/src.ts/abi/bytes32.ts index e694cb6e5..09f2d5af0 100644 --- a/src.ts/abi/bytes32.ts +++ b/src.ts/abi/bytes32.ts @@ -5,10 +5,10 @@ */ import { - getBytes, - toUtf8Bytes, - toUtf8String, - zeroPadBytes, + getBytes, + toUtf8Bytes, + toUtf8String, + zeroPadBytes, } from "../utils/index.js"; import type { BytesLike } from "../utils/index.js"; @@ -17,38 +17,38 @@ import type { BytesLike } from "../utils/index.js"; * Encodes %%text%% as a Bytes32 string. */ export function encodeBytes32String(text: string): string { - // Get the bytes - const bytes = toUtf8Bytes(text); + // Get the bytes + const bytes = toUtf8Bytes(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } + // Check we have room for null-termination + if (bytes.length > 31) { + throw new Error("bytes32 string must be less than 32 bytes"); + } - // Zero-pad (implicitly null-terminates) - return zeroPadBytes(bytes, 32); + // Zero-pad (implicitly null-terminates) + return zeroPadBytes(bytes, 32); } /** * Encodes the Bytes32-encoded %%bytes%% into a string. */ export function decodeBytes32String(_bytes: BytesLike): string { - const data = getBytes(_bytes, "bytes"); - - // Must be 32 bytes with a null-termination - if (data.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { - length--; - } - - // Determine the string value - return toUtf8String(data.slice(0, length)); + const data = getBytes(_bytes, "bytes"); + + // Must be 32 bytes with a null-termination + if (data.length !== 32) { + throw new Error("invalid bytes32 - not 32 bytes long"); + } + if (data[31] !== 0) { + throw new Error("invalid bytes32 string - no null terminator"); + } + + // Find the null termination + let length = 31; + while (data[length - 1] === 0) { + length--; + } + + // Determine the string value + return toUtf8String(data.slice(0, length)); } diff --git a/src.ts/abi/coders/abstract-coder.ts b/src.ts/abi/coders/abstract-coder.ts index 8cced79cd..06cc97777 100644 --- a/src.ts/abi/coders/abstract-coder.ts +++ b/src.ts/abi/coders/abstract-coder.ts @@ -1,14 +1,14 @@ import { - defineProperties, - concat, - getBytesCopy, - getNumber, - hexlify, - toBeArray, - toBigInt, - toNumber, - assert, - assertArgument, + defineProperties, + concat, + getBytesCopy, + getNumber, + hexlify, + toBeArray, + toBigInt, + toNumber, + assert, + assertArgument, } from "../../utils/index.js"; import type { BigNumberish, BytesLike } from "../../utils/index.js"; @@ -26,11 +26,11 @@ const passProperties = ["then"]; const _guard = {}; function throwError(name: string, error: Error): never { - const wrapped = new Error( - `deferred error during ABI decoding triggered accessing ${name}`, - ); - (wrapped).error = error; - throw wrapped; + const wrapped = new Error( + `deferred error during ABI decoding triggered accessing ${name}`, + ); + (wrapped).error = error; + throw wrapped; } /** @@ -41,248 +41,248 @@ function throwError(name: string, error: Error): never { * @_docloc: api/abi */ export class Result extends Array { - readonly #names: ReadonlyArray; - - [K: string | number]: any; - - /** - * @private - */ - constructor(...args: Array) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items: Array = args[1]; - let names: Array = (args[2] || []).slice(); - - let wrap = true; - if (guard !== _guard) { - items = args; - names = []; - wrap = false; - } - - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { - this[index] = item; - }); - - // Find all unique keys - const nameCounts = names.reduce( - (accum, name) => { - if (typeof name === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, - >new Map(), - ); - - // Remove any key thats not unique - this.#names = Object.freeze( - items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - }), - ); - - if (!wrap) { - return; - } - - // A wrapped Result is immutable - Object.freeze(this); - - // Proxy indices and names so we can trap deferred errors - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof prop === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (this: any, ...args: Array) { - return value.apply(this === receiver ? target : this, args); - }; - } else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply(this === receiver ? target : this, [ - prop, - ]); - } - } - - return Reflect.get(target, prop, receiver); - }, - }); - } - - /** - * Returns the Result as a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(): Array { - const result: Array = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - result.push(item); - }); - return result; - } - - /** - * Returns the Result as an Object with each name-value pair. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(): Record { - return this.#names.reduce( - (accum, name, index) => { - assert( - name != null, - "value at index ${ index } unnamed", - "UNSUPPORTED_OPERATION", - { - operation: "toObject()", - }, - ); - - // Add values for names that don't conflict - if (!(name in accum)) { - accum[name] = this.getValue(name); - } - - return accum; - }, - >{}, - ); - } - - /** - * @_ignore - */ - slice(start?: number | undefined, end?: number | undefined): Result { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - - const result: any = [], - names: any = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(this.#names[i]); - } - - return new Result(_guard, result, names); - } - - /** - * @_ignore - */ - filter( - callback: (el: any, index: number, array: Result) => boolean, - thisArg?: any, - ): Result { - const result: any = [], - names: any = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(this.#names[i]); - } - } - - return new Result(_guard, result, names); - } - - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name: string): any { - const index = this.#names.indexOf(name); - if (index === -1) { - return undefined; - } - - const value = this[index]; - - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, (value).error); - } - - return value; - } - - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items: Array, keys?: Array): Result { - return new Result(_guard, items, keys); - } + readonly #names: ReadonlyArray; + + [K: string | number]: any; + + /** + * @private + */ + constructor(...args: Array) { + // To properly sub-class Array so the other built-in + // functions work, the constructor has to behave fairly + // well. So, in the event we are created via fromItems() + // we build the read-only Result object we want, but on + // any other input, we use the default constructor + + // constructor(guard: any, items: Array, keys?: Array); + const guard = args[0]; + let items: Array = args[1]; + let names: Array = (args[2] || []).slice(); + + let wrap = true; + if (guard !== _guard) { + items = args; + names = []; + wrap = false; + } + + // Can't just pass in ...items since an array of length 1 + // is a special case in the super. + super(items.length); + items.forEach((item, index) => { + this[index] = item; + }); + + // Find all unique keys + const nameCounts = names.reduce( + (accum, name) => { + if (typeof name === "string") { + accum.set(name, (accum.get(name) || 0) + 1); + } + return accum; + }, + >new Map(), + ); + + // Remove any key thats not unique + this.#names = Object.freeze( + items.map((item, index) => { + const name = names[index]; + if (name != null && nameCounts.get(name) === 1) { + return name; + } + return null; + }), + ); + + if (!wrap) { + return; + } + + // A wrapped Result is immutable + Object.freeze(this); + + // Proxy indices and names so we can trap deferred errors + return new Proxy(this, { + get: (target, prop, receiver) => { + if (typeof prop === "string") { + // Index accessor + if (prop.match(/^[0-9]+$/)) { + const index = getNumber(prop, "%index"); + if (index < 0 || index >= this.length) { + throw new RangeError("out of result range"); + } + + const item = target[index]; + if (item instanceof Error) { + throwError(`index ${index}`, item); + } + return item; + } + + // Pass important checks (like `then` for Promise) through + if (passProperties.indexOf(prop) >= 0) { + return Reflect.get(target, prop, receiver); + } + + const value = target[prop]; + if (value instanceof Function) { + // Make sure functions work with private variables + // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding + return function (this: any, ...args: Array) { + return value.apply(this === receiver ? target : this, args); + }; + } else if (!(prop in target)) { + // Possible name accessor + return target.getValue.apply(this === receiver ? target : this, [ + prop, + ]); + } + } + + return Reflect.get(target, prop, receiver); + }, + }); + } + + /** + * Returns the Result as a normal Array. + * + * This will throw if there are any outstanding deferred + * errors. + */ + toArray(): Array { + const result: Array = []; + this.forEach((item, index) => { + if (item instanceof Error) { + throwError(`index ${index}`, item); + } + result.push(item); + }); + return result; + } + + /** + * Returns the Result as an Object with each name-value pair. + * + * This will throw if any value is unnamed, or if there are + * any outstanding deferred errors. + */ + toObject(): Record { + return this.#names.reduce( + (accum, name, index) => { + assert( + name != null, + "value at index ${ index } unnamed", + "UNSUPPORTED_OPERATION", + { + operation: "toObject()", + }, + ); + + // Add values for names that don't conflict + if (!(name in accum)) { + accum[name] = this.getValue(name); + } + + return accum; + }, + >{}, + ); + } + + /** + * @_ignore + */ + slice(start?: number | undefined, end?: number | undefined): Result { + if (start == null) { + start = 0; + } + if (start < 0) { + start += this.length; + if (start < 0) { + start = 0; + } + } + + if (end == null) { + end = this.length; + } + if (end < 0) { + end += this.length; + if (end < 0) { + end = 0; + } + } + if (end > this.length) { + end = this.length; + } + + const result: any = [], + names: any = []; + for (let i = start; i < end; i++) { + result.push(this[i]); + names.push(this.#names[i]); + } + + return new Result(_guard, result, names); + } + + /** + * @_ignore + */ + filter( + callback: (el: any, index: number, array: Result) => boolean, + thisArg?: any, + ): Result { + const result: any = [], + names: any = []; + for (let i = 0; i < this.length; i++) { + const item = this[i]; + if (item instanceof Error) { + throwError(`index ${i}`, item); + } + + if (callback.call(thisArg, item, i, this)) { + result.push(item); + names.push(this.#names[i]); + } + } + + return new Result(_guard, result, names); + } + + /** + * Returns the value for %%name%%. + * + * Since it is possible to have a key whose name conflicts with + * a method on a [[Result]] or its superclass Array, or any + * JavaScript keyword, this ensures all named values are still + * accessible by name. + */ + getValue(name: string): any { + const index = this.#names.indexOf(name); + if (index === -1) { + return undefined; + } + + const value = this[index]; + + if (value instanceof Error) { + throwError(`property ${JSON.stringify(name)}`, (value).error); + } + + return value; + } + + /** + * Creates a new [[Result]] for %%items%% with each entry + * also accessible by its corresponding name in %%keys%%. + */ + static fromItems(items: Array, keys?: Array): Result { + return new Result(_guard, items, keys); + } } /** @@ -299,226 +299,226 @@ export class Result extends Array { * @_docloc api/abi */ export function checkResultErrors( - result: Result, + result: Result, ): Array<{ path: Array; error: Error }> { - // Find the first error (if any) - const errors: Array<{ path: Array; error: Error }> = []; - - const checkErrors = function ( - path: Array, - object: any, - ): void { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - - try { - checkErrors(childPath, object[key]); - } catch (error: any) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - - return errors; + // Find the first error (if any) + const errors: Array<{ path: Array; error: Error }> = []; + + const checkErrors = function ( + path: Array, + object: any, + ): void { + if (!Array.isArray(object)) { + return; + } + for (let key in object) { + const childPath = path.slice(); + childPath.push(key); + + try { + checkErrors(childPath, object[key]); + } catch (error: any) { + errors.push({ path: childPath, error: error }); + } + } + }; + checkErrors([], result); + + return errors; } function getValue(value: BigNumberish): Uint8Array { - let bytes = toBeArray(value); + let bytes = toBeArray(value); - assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: WordSize, - offset: bytes.length, - }); + assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { + buffer: bytes, + length: WordSize, + offset: bytes.length, + }); - if (bytes.length !== WordSize) { - bytes = getBytesCopy( - concat([Padding.slice(bytes.length % WordSize), bytes]), - ); - } + if (bytes.length !== WordSize) { + bytes = getBytesCopy( + concat([Padding.slice(bytes.length % WordSize), bytes]), + ); + } - return bytes; + return bytes; } /** * @_ignore */ export abstract class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - readonly name!: string; - - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - readonly type!: string; - - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - readonly localName!: string; - - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - readonly dynamic!: boolean; - - constructor(name: string, type: string, localName: string, dynamic: boolean) { - defineProperties( - this, - { name, type, localName, dynamic }, - { - name: "string", - type: "string", - localName: "string", - dynamic: "boolean", - }, - ); - } - - _throwError(message: string, value: any): never { - assertArgument(false, message, this.localName, value); - } - - abstract encode(writer: Writer, value: any): number; - abstract decode(reader: Reader): any; - - abstract defaultValue(): any; + // The coder name: + // - address, uint256, tuple, array, etc. + readonly name!: string; + + // The fully expanded type, including composite types: + // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. + readonly type!: string; + + // The localName bound in the signature, in this example it is "baz": + // - tuple(address foo, uint bar) baz + readonly localName!: string; + + // Whether this type is dynamic: + // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. + // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) + readonly dynamic!: boolean; + + constructor(name: string, type: string, localName: string, dynamic: boolean) { + defineProperties( + this, + { name, type, localName, dynamic }, + { + name: "string", + type: "string", + localName: "string", + dynamic: "boolean", + }, + ); + } + + _throwError(message: string, value: any): never { + assertArgument(false, message, this.localName, value); + } + + abstract encode(writer: Writer, value: any): number; + abstract decode(reader: Reader): any; + + abstract defaultValue(): any; } /** * @_ignore */ export class Writer { - // An array of WordSize lengthed objects to concatenation - #data: Array; - #dataLength: number; - - constructor() { - this.#data = []; - this.#dataLength = 0; - } - - get data(): string { - return concat(this.#data) as string; - } - get length(): number { - return this.#dataLength; - } - - #writeData(data: Uint8Array): number { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - - appendWriter(writer: Writer): number { - return this.#writeData(getBytesCopy(writer.data)); - } - - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value: BytesLike): number { - let bytes = getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - - // Numeric item; pad on the left *to* WordSize - writeValue(value: BigNumberish): number { - return this.#writeData(getValue(value)); - } - - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue(): (value: BigNumberish) => void { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value: BigNumberish) => { - this.#data[offset] = getValue(value); - }; - } + // An array of WordSize lengthed objects to concatenation + #data: Array; + #dataLength: number; + + constructor() { + this.#data = []; + this.#dataLength = 0; + } + + get data(): string { + return concat(this.#data) as string; + } + get length(): number { + return this.#dataLength; + } + + #writeData(data: Uint8Array): number { + this.#data.push(data); + this.#dataLength += data.length; + return data.length; + } + + appendWriter(writer: Writer): number { + return this.#writeData(getBytesCopy(writer.data)); + } + + // Arrayish item; pad on the right to *nearest* WordSize + writeBytes(value: BytesLike): number { + let bytes = getBytesCopy(value); + const paddingOffset = bytes.length % WordSize; + if (paddingOffset) { + bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); + } + return this.#writeData(bytes); + } + + // Numeric item; pad on the left *to* WordSize + writeValue(value: BigNumberish): number { + return this.#writeData(getValue(value)); + } + + // Inserts a numeric place-holder, returning a callback that can + // be used to asjust the value later + writeUpdatableValue(): (value: BigNumberish) => void { + const offset = this.#data.length; + this.#data.push(Padding); + this.#dataLength += WordSize; + return (value: BigNumberish) => { + this.#data[offset] = getValue(value); + }; + } } /** * @_ignore */ export class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - readonly allowLoose!: boolean; - - readonly #data: Uint8Array; - #offset: number; - - constructor(data: BytesLike, allowLoose?: boolean) { - defineProperties(this, { allowLoose: !!allowLoose }); - - this.#data = getBytesCopy(data); - - this.#offset = 0; - } - - get data(): string { - return hexlify(this.#data); - } - get dataLength(): number { - return this.#data.length; - } - get consumed(): number { - return this.#offset; - } - get bytes(): Uint8Array { - return new Uint8Array(this.#data); - } - - #peekBytes(offset: number, length: number, loose?: boolean): Uint8Array { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if ( - this.allowLoose && - loose && - this.#offset + length <= this.#data.length - ) { - alignedLength = length; - } else { - assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength, - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - - // Create a sub-reader with the same underlying data, but offset - subReader(offset: number): Reader { - return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose); - } - - // Read bytes - readBytes(length: number, loose?: boolean): Uint8Array { - let bytes = this.#peekBytes(0, length, !!loose); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - - // Read a numeric values - readValue(): bigint { - return toBigInt(this.readBytes(WordSize)); - } - - readIndex(): number { - return toNumber(this.readBytes(WordSize)); - } + // Allows incomplete unpadded data to be read; otherwise an error + // is raised if attempting to overrun the buffer. This is required + // to deal with an old Solidity bug, in which event data for + // external (not public thoguh) was tightly packed. + readonly allowLoose!: boolean; + + readonly #data: Uint8Array; + #offset: number; + + constructor(data: BytesLike, allowLoose?: boolean) { + defineProperties(this, { allowLoose: !!allowLoose }); + + this.#data = getBytesCopy(data); + + this.#offset = 0; + } + + get data(): string { + return hexlify(this.#data); + } + get dataLength(): number { + return this.#data.length; + } + get consumed(): number { + return this.#offset; + } + get bytes(): Uint8Array { + return new Uint8Array(this.#data); + } + + #peekBytes(offset: number, length: number, loose?: boolean): Uint8Array { + let alignedLength = Math.ceil(length / WordSize) * WordSize; + if (this.#offset + alignedLength > this.#data.length) { + if ( + this.allowLoose && + loose && + this.#offset + length <= this.#data.length + ) { + alignedLength = length; + } else { + assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { + buffer: getBytesCopy(this.#data), + length: this.#data.length, + offset: this.#offset + alignedLength, + }); + } + } + return this.#data.slice(this.#offset, this.#offset + alignedLength); + } + + // Create a sub-reader with the same underlying data, but offset + subReader(offset: number): Reader { + return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose); + } + + // Read bytes + readBytes(length: number, loose?: boolean): Uint8Array { + let bytes = this.#peekBytes(0, length, !!loose); + this.#offset += bytes.length; + // @TODO: Make sure the length..end bytes are all 0? + return bytes.slice(0, length); + } + + // Read a numeric values + readValue(): bigint { + return toBigInt(this.readBytes(WordSize)); + } + + readIndex(): number { + return toNumber(this.readBytes(WordSize)); + } } diff --git a/src.ts/abi/coders/address.ts b/src.ts/abi/coders/address.ts index da51d008c..b105d1192 100644 --- a/src.ts/abi/coders/address.ts +++ b/src.ts/abi/coders/address.ts @@ -10,25 +10,25 @@ import type { Reader, Writer } from "./abstract-coder.js"; * @_ignore */ export class AddressCoder extends Coder { - constructor(localName: string) { - super("address", "address", localName, false); - } + constructor(localName: string) { + super("address", "address", localName, false); + } - defaultValue(): string { - return "0x0000000000000000000000000000000000000000"; - } + defaultValue(): string { + return "0x0000000000000000000000000000000000000000"; + } - encode(writer: Writer, _value: string | Typed): number { - let value = Typed.dereference(_value, "string"); - try { - value = getAddress(value); - } catch (error: any) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } + encode(writer: Writer, _value: string | Typed): number { + let value = Typed.dereference(_value, "string"); + try { + value = getAddress(value); + } catch (error: any) { + return this._throwError(error.message, _value); + } + return writer.writeValue(value); + } - decode(reader: Reader): any { - return getAddress(toBeHex(reader.readValue(), 22)); - } + decode(reader: Reader): any { + return getAddress(toBeHex(reader.readValue(), 22)); + } } diff --git a/src.ts/abi/coders/anonymous.ts b/src.ts/abi/coders/anonymous.ts index 98847440f..83872b55a 100644 --- a/src.ts/abi/coders/anonymous.ts +++ b/src.ts/abi/coders/anonymous.ts @@ -8,22 +8,22 @@ import type { Reader, Writer } from "./abstract-coder.js"; * @_ignore */ export class AnonymousCoder extends Coder { - private coder: Coder; + private coder: Coder; - constructor(coder: Coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } + constructor(coder: Coder) { + super(coder.name, coder.type, "_", coder.dynamic); + this.coder = coder; + } - defaultValue(): any { - return this.coder.defaultValue(); - } + defaultValue(): any { + return this.coder.defaultValue(); + } - encode(writer: Writer, value: any): number { - return this.coder.encode(writer, value); - } + encode(writer: Writer, value: any): number { + return this.coder.encode(writer, value); + } - decode(reader: Reader): any { - return this.coder.decode(reader); - } + decode(reader: Reader): any { + return this.coder.decode(reader); + } } diff --git a/src.ts/abi/coders/array.ts b/src.ts/abi/coders/array.ts index 11de7d864..fc2e52851 100644 --- a/src.ts/abi/coders/array.ts +++ b/src.ts/abi/coders/array.ts @@ -1,9 +1,9 @@ import { - defineProperties, - isError, - assert, - assertArgument, - assertArgumentCount, + defineProperties, + isError, + assert, + assertArgument, + assertArgumentCount, } from "../../utils/index.js"; import { Typed } from "../typed.js"; @@ -17,217 +17,217 @@ import type { Reader } from "./abstract-coder.js"; * @_ignore */ export function pack( - writer: Writer, - coders: ReadonlyArray, - values: Array | { [name: string]: any }, + writer: Writer, + coders: ReadonlyArray, + values: Array | { [name: string]: any }, ): number { - let arrayValues: Array = []; - - if (Array.isArray(values)) { - arrayValues = values; - } else if (values && typeof values === "object") { - let unique: { [name: string]: boolean } = {}; - - arrayValues = coders.map((coder) => { - const name = coder.localName; - assert( - name, - "cannot encode object for signature with missing names", - "INVALID_ARGUMENT", - { argument: "values", info: { coder }, value: values }, - ); - - assert( - !unique[name], - "cannot encode object for signature with duplicate names", - "INVALID_ARGUMENT", - { argument: "values", info: { coder }, value: values }, - ); - - unique[name] = true; - - return values[name]; - }); - } else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - - assertArgument( - coders.length === arrayValues.length, - "types/value length mismatch", - "tuple", - values, - ); - - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - - let updateFuncs: Array<(baseOffset: number) => void> = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset: number) => { - updateFunc(baseOffset + dynamicOffset); - }); - } else { - coder.encode(staticWriter, value); - } - }); - - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { - func(staticWriter.length); - }); - - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; + let arrayValues: Array = []; + + if (Array.isArray(values)) { + arrayValues = values; + } else if (values && typeof values === "object") { + let unique: { [name: string]: boolean } = {}; + + arrayValues = coders.map((coder) => { + const name = coder.localName; + assert( + name, + "cannot encode object for signature with missing names", + "INVALID_ARGUMENT", + { argument: "values", info: { coder }, value: values }, + ); + + assert( + !unique[name], + "cannot encode object for signature with duplicate names", + "INVALID_ARGUMENT", + { argument: "values", info: { coder }, value: values }, + ); + + unique[name] = true; + + return values[name]; + }); + } else { + assertArgument(false, "invalid tuple value", "tuple", values); + } + + assertArgument( + coders.length === arrayValues.length, + "types/value length mismatch", + "tuple", + values, + ); + + let staticWriter = new Writer(); + let dynamicWriter = new Writer(); + + let updateFuncs: Array<(baseOffset: number) => void> = []; + coders.forEach((coder, index) => { + let value = arrayValues[index]; + + if (coder.dynamic) { + // Get current dynamic offset (for the future pointer) + let dynamicOffset = dynamicWriter.length; + + // Encode the dynamic value into the dynamicWriter + coder.encode(dynamicWriter, value); + + // Prepare to populate the correct offset once we are done + let updateFunc = staticWriter.writeUpdatableValue(); + updateFuncs.push((baseOffset: number) => { + updateFunc(baseOffset + dynamicOffset); + }); + } else { + coder.encode(staticWriter, value); + } + }); + + // Backfill all the dynamic offsets, now that we know the static length + updateFuncs.forEach((func) => { + func(staticWriter.length); + }); + + let length = writer.appendWriter(staticWriter); + length += writer.appendWriter(dynamicWriter); + return length; } /** * @_ignore */ export function unpack(reader: Reader, coders: ReadonlyArray): Result { - let values: Array = []; - let keys: Array = []; - - // A reader anchored to this base - let baseReader = reader.subReader(0); - - coders.forEach((coder) => { - let value: any = null; - - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } catch (error: any) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } else { - try { - value = coder.decode(reader); - } catch (error: any) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - - if (value == undefined) { - throw new Error("investigate"); - } - - values.push(value); - keys.push(coder.localName || null); - }); - - return Result.fromItems(values, keys); + let values: Array = []; + let keys: Array = []; + + // A reader anchored to this base + let baseReader = reader.subReader(0); + + coders.forEach((coder) => { + let value: any = null; + + if (coder.dynamic) { + let offset = reader.readIndex(); + let offsetReader = baseReader.subReader(offset); + try { + value = coder.decode(offsetReader); + } catch (error: any) { + // Cannot recover from this + if (isError(error, "BUFFER_OVERRUN")) { + throw error; + } + + value = error; + value.baseType = coder.name; + value.name = coder.localName; + value.type = coder.type; + } + } else { + try { + value = coder.decode(reader); + } catch (error: any) { + // Cannot recover from this + if (isError(error, "BUFFER_OVERRUN")) { + throw error; + } + + value = error; + value.baseType = coder.name; + value.name = coder.localName; + value.type = coder.type; + } + } + + if (value == undefined) { + throw new Error("investigate"); + } + + values.push(value); + keys.push(coder.localName || null); + }); + + return Result.fromItems(values, keys); } /** * @_ignore */ export class ArrayCoder extends Coder { - readonly coder!: Coder; - readonly length!: number; - - constructor(coder: Coder, length: number, localName: string) { - const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; - const dynamic = length === -1 || coder.dynamic; - super("array", type, localName, dynamic); - defineProperties(this, { coder, length }); - } - - defaultValue(): Array { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - - const result: Array = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - - encode(writer: Writer, _value: Array | Typed): number { - const value = Typed.dereference(_value, "array"); - - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - - let count = this.length; - - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - - assertArgumentCount( - value.length, - count, - "coder array" + (this.localName ? " " + this.localName : ""), - ); - - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - - return pack(writer, coders, value); - } - - decode(reader: Reader): any { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - assert( - count * WordSize <= reader.dataLength, - "insufficient data length", - "BUFFER_OVERRUN", - { - buffer: reader.bytes, - offset: count * WordSize, - length: reader.dataLength, - }, - ); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new AnonymousCoder(this.coder)); - } - - return unpack(reader, coders); - } + readonly coder!: Coder; + readonly length!: number; + + constructor(coder: Coder, length: number, localName: string) { + const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; + const dynamic = length === -1 || coder.dynamic; + super("array", type, localName, dynamic); + defineProperties(this, { coder, length }); + } + + defaultValue(): Array { + // Verifies the child coder is valid (even if the array is dynamic or 0-length) + const defaultChild = this.coder.defaultValue(); + + const result: Array = []; + for (let i = 0; i < this.length; i++) { + result.push(defaultChild); + } + return result; + } + + encode(writer: Writer, _value: Array | Typed): number { + const value = Typed.dereference(_value, "array"); + + if (!Array.isArray(value)) { + this._throwError("expected array value", value); + } + + let count = this.length; + + if (count === -1) { + count = value.length; + writer.writeValue(value.length); + } + + assertArgumentCount( + value.length, + count, + "coder array" + (this.localName ? " " + this.localName : ""), + ); + + let coders = []; + for (let i = 0; i < value.length; i++) { + coders.push(this.coder); + } + + return pack(writer, coders, value); + } + + decode(reader: Reader): any { + let count = this.length; + if (count === -1) { + count = reader.readIndex(); + + // Check that there is *roughly* enough data to ensure + // stray random data is not being read as a length. Each + // slot requires at least 32 bytes for their value (or 32 + // bytes as a link to the data). This could use a much + // tighter bound, but we are erroring on the side of safety. + assert( + count * WordSize <= reader.dataLength, + "insufficient data length", + "BUFFER_OVERRUN", + { + buffer: reader.bytes, + offset: count * WordSize, + length: reader.dataLength, + }, + ); + } + let coders = []; + for (let i = 0; i < count; i++) { + coders.push(new AnonymousCoder(this.coder)); + } + + return unpack(reader, coders); + } } diff --git a/src.ts/abi/coders/boolean.ts b/src.ts/abi/coders/boolean.ts index 92a4d6dc2..e5fbb9812 100644 --- a/src.ts/abi/coders/boolean.ts +++ b/src.ts/abi/coders/boolean.ts @@ -7,20 +7,20 @@ import type { Reader, Writer } from "./abstract-coder.js"; * @_ignore */ export class BooleanCoder extends Coder { - constructor(localName: string) { - super("bool", "bool", localName, false); - } + constructor(localName: string) { + super("bool", "bool", localName, false); + } - defaultValue(): boolean { - return false; - } + defaultValue(): boolean { + return false; + } - encode(writer: Writer, _value: boolean | Typed): number { - const value = Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } + encode(writer: Writer, _value: boolean | Typed): number { + const value = Typed.dereference(_value, "bool"); + return writer.writeValue(value ? 1 : 0); + } - decode(reader: Reader): any { - return !!reader.readValue(); - } + decode(reader: Reader): any { + return !!reader.readValue(); + } } diff --git a/src.ts/abi/coders/bytes.ts b/src.ts/abi/coders/bytes.ts index cd604edad..5b8541194 100644 --- a/src.ts/abi/coders/bytes.ts +++ b/src.ts/abi/coders/bytes.ts @@ -8,35 +8,35 @@ import type { Reader, Writer } from "./abstract-coder.js"; * @_ignore */ export class DynamicBytesCoder extends Coder { - constructor(type: string, localName: string) { - super(type, type, localName, true); - } - - defaultValue(): string { - return "0x"; - } - - encode(writer: Writer, value: any): number { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - - decode(reader: Reader): any { - return reader.readBytes(reader.readIndex(), true); - } + constructor(type: string, localName: string) { + super(type, type, localName, true); + } + + defaultValue(): string { + return "0x"; + } + + encode(writer: Writer, value: any): number { + value = getBytesCopy(value); + let length = writer.writeValue(value.length); + length += writer.writeBytes(value); + return length; + } + + decode(reader: Reader): any { + return reader.readBytes(reader.readIndex(), true); + } } /** * @_ignore */ export class BytesCoder extends DynamicBytesCoder { - constructor(localName: string) { - super("bytes", localName); - } + constructor(localName: string) { + super("bytes", localName); + } - decode(reader: Reader): any { - return hexlify(super.decode(reader)); - } + decode(reader: Reader): any { + return hexlify(super.decode(reader)); + } } diff --git a/src.ts/abi/coders/fixed-bytes.ts b/src.ts/abi/coders/fixed-bytes.ts index ef9142d11..203310027 100644 --- a/src.ts/abi/coders/fixed-bytes.ts +++ b/src.ts/abi/coders/fixed-bytes.ts @@ -11,30 +11,30 @@ import type { Reader, Writer } from "./abstract-coder.js"; * @_ignore */ export class FixedBytesCoder extends Coder { - readonly size!: number; - - constructor(size: number, localName: string) { - let name = "bytes" + String(size); - super(name, name, localName, false); - defineProperties(this, { size }, { size: "number" }); - } - - defaultValue(): string { - return "0x0000000000000000000000000000000000000000000000000000000000000000".substring( - 0, - 2 + this.size * 2, - ); - } - - encode(writer: Writer, _value: BytesLike | Typed): number { - let data = getBytesCopy(Typed.dereference(_value, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data); - } - - decode(reader: Reader): any { - return hexlify(reader.readBytes(this.size)); - } + readonly size!: number; + + constructor(size: number, localName: string) { + let name = "bytes" + String(size); + super(name, name, localName, false); + defineProperties(this, { size }, { size: "number" }); + } + + defaultValue(): string { + return "0x0000000000000000000000000000000000000000000000000000000000000000".substring( + 0, + 2 + this.size * 2, + ); + } + + encode(writer: Writer, _value: BytesLike | Typed): number { + let data = getBytesCopy(Typed.dereference(_value, this.type)); + if (data.length !== this.size) { + this._throwError("incorrect data length", _value); + } + return writer.writeBytes(data); + } + + decode(reader: Reader): any { + return hexlify(reader.readBytes(this.size)); + } } diff --git a/src.ts/abi/coders/null.ts b/src.ts/abi/coders/null.ts index f70dd0bcc..eabae5e85 100644 --- a/src.ts/abi/coders/null.ts +++ b/src.ts/abi/coders/null.ts @@ -7,23 +7,23 @@ const Empty = new Uint8Array([]); * @_ignore */ export class NullCoder extends Coder { - constructor(localName: string) { - super("null", "", localName, false); - } + constructor(localName: string) { + super("null", "", localName, false); + } - defaultValue(): null { - return null; - } + defaultValue(): null { + return null; + } - encode(writer: Writer, value: any): number { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } + encode(writer: Writer, value: any): number { + if (value != null) { + this._throwError("not null", value); + } + return writer.writeBytes(Empty); + } - decode(reader: Reader): any { - reader.readBytes(0); - return null; - } + decode(reader: Reader): any { + reader.readBytes(0); + return null; + } } diff --git a/src.ts/abi/coders/number.ts b/src.ts/abi/coders/number.ts index 5688faea6..8f0641e30 100644 --- a/src.ts/abi/coders/number.ts +++ b/src.ts/abi/coders/number.ts @@ -1,9 +1,9 @@ import { - defineProperties, - fromTwos, - getBigInt, - mask, - toTwos, + defineProperties, + fromTwos, + getBigInt, + mask, + toTwos, } from "../../utils/index.js"; import { Typed } from "../typed.js"; @@ -16,56 +16,56 @@ import type { Reader, Writer } from "./abstract-coder.js"; const BN_0 = BigInt(0); const BN_1 = BigInt(1); const BN_MAX_UINT256 = BigInt( - "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", ); /** * @_ignore */ export class NumberCoder extends Coder { - readonly size!: number; - readonly signed!: boolean; + readonly size!: number; + readonly signed!: boolean; - constructor(size: number, signed: boolean, localName: string) { - const name = (signed ? "int" : "uint") + size * 8; - super(name, name, localName, false); + constructor(size: number, signed: boolean, localName: string) { + const name = (signed ? "int" : "uint") + size * 8; + super(name, name, localName, false); - defineProperties( - this, - { size, signed }, - { size: "number", signed: "boolean" }, - ); - } + defineProperties( + this, + { size, signed }, + { size: "number", signed: "boolean" }, + ); + } - defaultValue(): number { - return 0; - } + defaultValue(): number { + return 0; + } - encode(writer: Writer, _value: BigNumberish | Typed): number { - let value = getBigInt(Typed.dereference(_value, this.type)); + encode(writer: Writer, _value: BigNumberish | Typed): number { + let value = getBigInt(Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, this.size * 8 - 1); - if (value > bounds || value < -(bounds + BN_1)) { - this._throwError("value out-of-bounds", _value); - } - value = toTwos(value, 8 * WordSize); - } else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } + // Check bounds are safe for encoding + let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8); + if (this.signed) { + let bounds = mask(maxUintValue, this.size * 8 - 1); + if (value > bounds || value < -(bounds + BN_1)) { + this._throwError("value out-of-bounds", _value); + } + value = toTwos(value, 8 * WordSize); + } else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) { + this._throwError("value out-of-bounds", _value); + } - return writer.writeValue(value); - } + return writer.writeValue(value); + } - decode(reader: Reader): any { - let value = mask(reader.readValue(), this.size * 8); + decode(reader: Reader): any { + let value = mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = fromTwos(value, this.size * 8); - } + if (this.signed) { + value = fromTwos(value, this.size * 8); + } - return value; - } + return value; + } } diff --git a/src.ts/abi/coders/string.ts b/src.ts/abi/coders/string.ts index a728187f2..56918c0bf 100644 --- a/src.ts/abi/coders/string.ts +++ b/src.ts/abi/coders/string.ts @@ -9,22 +9,22 @@ import type { Reader, Writer } from "./abstract-coder.js"; * @_ignore */ export class StringCoder extends DynamicBytesCoder { - constructor(localName: string) { - super("string", localName); - } + constructor(localName: string) { + super("string", localName); + } - defaultValue(): string { - return ""; - } + defaultValue(): string { + return ""; + } - encode(writer: Writer, _value: string | Typed): number { - return super.encode( - writer, - toUtf8Bytes(Typed.dereference(_value, "string")), - ); - } + encode(writer: Writer, _value: string | Typed): number { + return super.encode( + writer, + toUtf8Bytes(Typed.dereference(_value, "string")), + ); + } - decode(reader: Reader): any { - return toUtf8String(super.decode(reader)); - } + decode(reader: Reader): any { + return toUtf8String(super.decode(reader)); + } } diff --git a/src.ts/abi/coders/tuple.ts b/src.ts/abi/coders/tuple.ts index eadf393d5..688f1cdca 100644 --- a/src.ts/abi/coders/tuple.ts +++ b/src.ts/abi/coders/tuple.ts @@ -11,76 +11,76 @@ import type { Reader, Writer } from "./abstract-coder.js"; * @_ignore */ export class TupleCoder extends Coder { - readonly coders!: ReadonlyArray; + readonly coders!: ReadonlyArray; - constructor(coders: Array, localName: string) { - let dynamic = false; - const types: Array = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = "tuple(" + types.join(",") + ")"; + constructor(coders: Array, localName: string) { + let dynamic = false; + const types: Array = []; + coders.forEach((coder) => { + if (coder.dynamic) { + dynamic = true; + } + types.push(coder.type); + }); + const type = "tuple(" + types.join(",") + ")"; - super("tuple", type, localName, dynamic); - defineProperties(this, { - coders: Object.freeze(coders.slice()), - }); - } + super("tuple", type, localName, dynamic); + defineProperties(this, { + coders: Object.freeze(coders.slice()), + }); + } - defaultValue(): any { - const values: any = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); + defaultValue(): any { + const values: any = []; + this.coders.forEach((coder) => { + values.push(coder.defaultValue()); + }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce( - (accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, - <{ [name: string]: number }>{}, - ); + // We only output named properties for uniquely named coders + const uniqueNames = this.coders.reduce( + (accum, coder) => { + const name = coder.localName; + if (name) { + if (!accum[name]) { + accum[name] = 0; + } + accum[name]++; + } + return accum; + }, + <{ [name: string]: number }>{}, + ); - // Add named values - this.coders.forEach((coder: Coder, index: number) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } + // Add named values + this.coders.forEach((coder: Coder, index: number) => { + let name = coder.localName; + if (!name || uniqueNames[name] !== 1) { + return; + } - if (name === "length") { - name = "_length"; - } + if (name === "length") { + name = "_length"; + } - if (values[name] != null) { - return; - } + if (values[name] != null) { + return; + } - values[name] = values[index]; - }); + values[name] = values[index]; + }); - return Object.freeze(values); - } + return Object.freeze(values); + } - encode( - writer: Writer, - _value: Array | { [name: string]: any } | Typed, - ): number { - const value = Typed.dereference(_value, "tuple"); - return pack(writer, this.coders, value); - } + encode( + writer: Writer, + _value: Array | { [name: string]: any } | Typed, + ): number { + const value = Typed.dereference(_value, "tuple"); + return pack(writer, this.coders, value); + } - decode(reader: Reader): any { - return unpack(reader, this.coders); - } + decode(reader: Reader): any { + return unpack(reader, this.coders); + } } diff --git a/src.ts/abi/fragments.ts b/src.ts/abi/fragments.ts index f1100120b..db3bba47f 100644 --- a/src.ts/abi/fragments.ts +++ b/src.ts/abi/fragments.ts @@ -5,12 +5,12 @@ */ import { - defineProperties, - getBigInt, - getNumber, - assert, - assertPrivate, - assertArgument, + defineProperties, + getBigInt, + getNumber, + assert, + assertPrivate, + assertArgument, } from "../utils/index.js"; import { id } from "../hash/index.js"; @@ -18,103 +18,103 @@ import { id } from "../hash/index.js"; * A type description in a JSON API. */ export interface JsonFragmentType { - /** - * The parameter name. - */ - readonly name?: string; - - /** - * If the parameter is indexed. - */ - readonly indexed?: boolean; - - /** - * The type of the parameter. - */ - readonly type?: string; - - /** - * The internal Solidity type. - */ - readonly internalType?: string; - - /** - * The components for a tuple. - */ - readonly components?: ReadonlyArray; + /** + * The parameter name. + */ + readonly name?: string; + + /** + * If the parameter is indexed. + */ + readonly indexed?: boolean; + + /** + * The type of the parameter. + */ + readonly type?: string; + + /** + * The internal Solidity type. + */ + readonly internalType?: string; + + /** + * The components for a tuple. + */ + readonly components?: ReadonlyArray; } /** * A fragment for a method, event or error in a JSON API. */ export interface JsonFragment { - /** - * The name of the error, event, function, etc. - */ - readonly name?: string; - - /** - * The type of the fragment (e.g. ``event``, ``"function"``, etc.) - */ - readonly type?: string; - - /** - * If the event is anonymous. - */ - readonly anonymous?: boolean; - - /** - * If the function is payable. - */ - readonly payable?: boolean; - - /** - * If the function is constant. - */ - readonly constant?: boolean; - - /** - * The mutability state of the function. - */ - readonly stateMutability?: string; - - /** - * The input parameters. - */ - readonly inputs?: ReadonlyArray; - - /** - * The output parameters. - */ - readonly outputs?: ReadonlyArray; - - /** - * The energy limit to use when sending a transaction for this function. - */ - readonly energy?: string; + /** + * The name of the error, event, function, etc. + */ + readonly name?: string; + + /** + * The type of the fragment (e.g. ``event``, ``"function"``, etc.) + */ + readonly type?: string; + + /** + * If the event is anonymous. + */ + readonly anonymous?: boolean; + + /** + * If the function is payable. + */ + readonly payable?: boolean; + + /** + * If the function is constant. + */ + readonly constant?: boolean; + + /** + * The mutability state of the function. + */ + readonly stateMutability?: string; + + /** + * The input parameters. + */ + readonly inputs?: ReadonlyArray; + + /** + * The output parameters. + */ + readonly outputs?: ReadonlyArray; + + /** + * The energy limit to use when sending a transaction for this function. + */ + readonly energy?: string; } /** * The format to serialize the output as. */ export type FormatType = - // Bare formatting, as is needed for computing a sighash of an event or function - | "sighash" + // Bare formatting, as is needed for computing a sighash of an event or function + | "sighash" - // Human-Readable with Minimal spacing and without names (compact human-readable) - | "minimal" + // Human-Readable with Minimal spacing and without names (compact human-readable) + | "minimal" - // Human-Readable with nice spacing, including all names - | "full" + // Human-Readable with nice spacing, including all names + | "full" - // JSON-format a la Solidity - | "json"; + // JSON-format a la Solidity + | "json"; // [ "a", "b" ] => { "a": 1, "b": 1 } function setify(items: Array): ReadonlySet { - const result: Set = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); + const result: Set = new Set(); + items.forEach((k) => result.add(k)); + return Object.freeze(result); } // Visibility Keywords @@ -135,12 +135,12 @@ const Keywords = setify(_keywords.split(" ")); // Single character tokens const SimpleTokens: Record = { - "(": "OPEN_PAREN", - ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", - "]": "CLOSE_BRACKET", - ",": "COMMA", - "@": "AT", + "(": "OPEN_PAREN", + ")": "CLOSE_PAREN", + "[": "OPEN_BRACKET", + "]": "CLOSE_BRACKET", + ",": "COMMA", + "@": "AT", }; // Parser regexes to consume the next token @@ -151,424 +151,424 @@ const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); // Parser regexs to check validity const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); const regexType = new RegExp( - "^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$", + "^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$", ); /** * @ignore: */ type Token = Readonly<{ - // Type of token (e.g. TYPE, KEYWORD, NUMBER, etc) - type: string; + // Type of token (e.g. TYPE, KEYWORD, NUMBER, etc) + type: string; - // Offset into the original source code - offset: number; + // Offset into the original source code + offset: number; - // Actual text content of the token - text: string; + // Actual text content of the token + text: string; - // The parenthesis depth - depth: number; + // The parenthesis depth + depth: number; - // If a parenthesis, the offset (in tokens) that balances it - match: number; + // If a parenthesis, the offset (in tokens) that balances it + match: number; - // For parenthesis and commas, the offset (in tokens) to the - // previous/next parenthesis or comma in the list - linkBack: number; - linkNext: number; + // For parenthesis and commas, the offset (in tokens) to the + // previous/next parenthesis or comma in the list + linkBack: number; + linkNext: number; - // If a BRACKET, the value inside - value: number; + // If a BRACKET, the value inside + value: number; }>; class TokenString { - #offset: number; - #tokens: ReadonlyArray; - - get offset(): number { - return this.#offset; - } - get length(): number { - return this.#tokens.length - this.#offset; - } - - constructor(tokens: ReadonlyArray) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - - clone(): TokenString { - return new TokenString(this.#tokens); - } - reset(): void { - this.#offset = 0; - } - - #subTokenString(from: number = 0, to: number = 0): TokenString { - return new TokenString( - this.#tokens.slice(from, to).map((t) => { - return Object.freeze( - Object.assign({}, t, { - match: t.match - from, - linkBack: t.linkBack - from, - linkNext: t.linkNext - from, - }), - ); - }), - ); - } - - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed: ReadonlySet): string { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type: string): string { - if (this.peek().type !== type) { - throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`); - } - return this.pop().text; - } - - // Pops and returns a "(" TOKENS ")" - popParen(): TokenString { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams(): Array { - const top = this.peek(); - - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - - const result: Array = []; - - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - - this.#offset = top.match + 1; - - return result; - } - - // Returns the top Token, throwing if out of tokens - peek(): Token { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed: ReadonlySet): null | string { - const top = this.peekType("KEYWORD"); - return top != null && allowed.has(top) ? top : null; - } - - // Returns the value of the next token if it is `type` - peekType(type: string): null | string { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return top.type === type ? top.text : null; - } - - // Returns the next token; throws if out of tokens - pop(): Token { - const result = this.peek(); - this.#offset++; - return result; - } - - toString(): string { - const tokens: Array = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } + #offset: number; + #tokens: ReadonlyArray; + + get offset(): number { + return this.#offset; + } + get length(): number { + return this.#tokens.length - this.#offset; + } + + constructor(tokens: ReadonlyArray) { + this.#offset = 0; + this.#tokens = tokens.slice(); + } + + clone(): TokenString { + return new TokenString(this.#tokens); + } + reset(): void { + this.#offset = 0; + } + + #subTokenString(from: number = 0, to: number = 0): TokenString { + return new TokenString( + this.#tokens.slice(from, to).map((t) => { + return Object.freeze( + Object.assign({}, t, { + match: t.match - from, + linkBack: t.linkBack - from, + linkNext: t.linkNext - from, + }), + ); + }), + ); + } + + // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens + popKeyword(allowed: ReadonlySet): string { + const top = this.peek(); + if (top.type !== "KEYWORD" || !allowed.has(top.text)) { + throw new Error(`expected keyword ${top.text}`); + } + return this.pop().text; + } + + // Pops and returns the value of the next token if it is `type`; throws if out of tokens + popType(type: string): string { + if (this.peek().type !== type) { + throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`); + } + return this.pop().text; + } + + // Pops and returns a "(" TOKENS ")" + popParen(): TokenString { + const top = this.peek(); + if (top.type !== "OPEN_PAREN") { + throw new Error("bad start"); + } + const result = this.#subTokenString(this.#offset + 1, top.match + 1); + this.#offset = top.match + 1; + return result; + } + + // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" + popParams(): Array { + const top = this.peek(); + + if (top.type !== "OPEN_PAREN") { + throw new Error("bad start"); + } + + const result: Array = []; + + while (this.#offset < top.match - 1) { + const link = this.peek().linkNext; + result.push(this.#subTokenString(this.#offset + 1, link)); + this.#offset = link; + } + + this.#offset = top.match + 1; + + return result; + } + + // Returns the top Token, throwing if out of tokens + peek(): Token { + if (this.#offset >= this.#tokens.length) { + throw new Error("out-of-bounds"); + } + return this.#tokens[this.#offset]; + } + + // Returns the next value, if it is a keyword in `allowed` + peekKeyword(allowed: ReadonlySet): null | string { + const top = this.peekType("KEYWORD"); + return top != null && allowed.has(top) ? top : null; + } + + // Returns the value of the next token if it is `type` + peekType(type: string): null | string { + if (this.length === 0) { + return null; + } + const top = this.peek(); + return top.type === type ? top.text : null; + } + + // Returns the next token; throws if out of tokens + pop(): Token { + const result = this.peek(); + this.#offset++; + return result; + } + + toString(): string { + const tokens: Array = []; + for (let i = this.#offset; i < this.#tokens.length; i++) { + const token = this.#tokens[i]; + tokens.push(`${token.type}:${token.text}`); + } + return ``; + } } type Writeable = { -readonly [P in keyof T]: T[P] }; function lex(text: string): TokenString { - const tokens: Array = []; - - const throwError = (message: string) => { - const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - - let brackets: Array = []; - let commas: Array = []; - - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - - const token = { - depth: brackets.length, - linkBack: -1, - linkNext: -1, - match: -1, - type: "", - text: "", - offset, - value: -1, - }; - tokens.push(token); - - let type = SimpleTokens[cur[0]] || ""; - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - - token.match = brackets.pop() as number; - (>tokens[token.match]).match = tokens.length - 1; - token.depth--; - - token.linkBack = commas.pop() as number; - (>tokens[token.linkBack]).linkNext = tokens.length - 1; - } else if (type === "COMMA") { - token.linkBack = commas.pop() as number; - (>tokens[token.linkBack]).linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = (tokens.pop() as Token).text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = (tokens.pop() as Token).text; - suffix = value + suffix; - (>tokens[tokens.length - 1]).value = - getNumber(value); - } - if ( - tokens.length === 0 || - tokens[tokens.length - 1].type !== "BRACKET" - ) { - throw new Error("missing opening bracket"); - } - (>tokens[tokens.length - 1]).text += suffix; - } - - continue; - } - - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - - token.type = "ID"; - continue; - } - - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - - throw new Error( - `unexpected token ${JSON.stringify(cur[0])} at position ${offset}`, - ); - } - - return new TokenString(tokens.map((t) => Object.freeze(t))); + const tokens: Array = []; + + const throwError = (message: string) => { + const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI"; + throw new Error(`invalid token ${token} at ${offset}: ${message}`); + }; + + let brackets: Array = []; + let commas: Array = []; + + let offset = 0; + while (offset < text.length) { + // Strip off any leading whitespace + let cur = text.substring(offset); + let match = cur.match(regexWhitespacePrefix); + if (match) { + offset += match[1].length; + cur = text.substring(offset); + } + + const token = { + depth: brackets.length, + linkBack: -1, + linkNext: -1, + match: -1, + type: "", + text: "", + offset, + value: -1, + }; + tokens.push(token); + + let type = SimpleTokens[cur[0]] || ""; + if (type) { + token.type = type; + token.text = cur[0]; + offset++; + + if (type === "OPEN_PAREN") { + brackets.push(tokens.length - 1); + commas.push(tokens.length - 1); + } else if (type == "CLOSE_PAREN") { + if (brackets.length === 0) { + throwError("no matching open bracket"); + } + + token.match = brackets.pop() as number; + (>tokens[token.match]).match = tokens.length - 1; + token.depth--; + + token.linkBack = commas.pop() as number; + (>tokens[token.linkBack]).linkNext = tokens.length - 1; + } else if (type === "COMMA") { + token.linkBack = commas.pop() as number; + (>tokens[token.linkBack]).linkNext = tokens.length - 1; + commas.push(tokens.length - 1); + } else if (type === "OPEN_BRACKET") { + token.type = "BRACKET"; + } else if (type === "CLOSE_BRACKET") { + // Remove the CLOSE_BRACKET + let suffix = (tokens.pop() as Token).text; + if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { + const value = (tokens.pop() as Token).text; + suffix = value + suffix; + (>tokens[tokens.length - 1]).value = + getNumber(value); + } + if ( + tokens.length === 0 || + tokens[tokens.length - 1].type !== "BRACKET" + ) { + throw new Error("missing opening bracket"); + } + (>tokens[tokens.length - 1]).text += suffix; + } + + continue; + } + + match = cur.match(regexIdPrefix); + if (match) { + token.text = match[1]; + offset += token.text.length; + + if (Keywords.has(token.text)) { + token.type = "KEYWORD"; + continue; + } + + if (token.text.match(regexType)) { + token.type = "TYPE"; + continue; + } + + token.type = "ID"; + continue; + } + + match = cur.match(regexNumberPrefix); + if (match) { + token.text = match[1]; + token.type = "NUMBER"; + offset += token.text.length; + continue; + } + + throw new Error( + `unexpected token ${JSON.stringify(cur[0])} at position ${offset}`, + ); + } + + return new TokenString(tokens.map((t) => Object.freeze(t))); } // Check only one of `allowed` is in `set` function allowSingle( - set: ReadonlySet, - allowed: ReadonlySet, + set: ReadonlySet, + allowed: ReadonlySet, ): void { - let included: Array = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } + let included: Array = []; + for (const key in allowed.keys()) { + if (set.has(key)) { + included.push(key); + } + } + if (included.length > 1) { + throw new Error(`conflicting types: ${included.join(", ")}`); + } } // Functions to process a Solidity Signature TokenString from left-to-right for... // ...the name with an optional type, returning the name function consumeName(type: string, tokens: TokenString): string { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - - return tokens.popType("ID"); + if (tokens.peekKeyword(KwTypes)) { + const keyword = tokens.pop().text; + if (keyword !== type) { + throw new Error(`expected ${type}, got ${keyword}`); + } + } + + return tokens.popType("ID"); } // ...all keywords matching allowed, returning the keywords function consumeKeywords( - tokens: TokenString, - allowed?: ReadonlySet, + tokens: TokenString, + allowed?: ReadonlySet, ): ReadonlySet { - const keywords: Set = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - - return Object.freeze(keywords); + const keywords: Set = new Set(); + while (true) { + const keyword = tokens.peekType("KEYWORD"); + + if (keyword == null || (allowed && !allowed.has(keyword))) { + break; + } + tokens.pop(); + + if (keywords.has(keyword)) { + throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); + } + keywords.add(keyword); + } + + return Object.freeze(keywords); } // ...all visibility keywords, returning the coalesced mutability function consumeMutability( - tokens: TokenString, + tokens: TokenString, ): "payable" | "nonpayable" | "view" | "pure" { - let modifiers = consumeKeywords(tokens, KwVisib); - - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - - return "nonpayable"; + let modifiers = consumeKeywords(tokens, KwVisib); + + // Detect conflicting modifiers + allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); + allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); + + // Process mutability states + if (modifiers.has("view")) { + return "view"; + } + if (modifiers.has("pure")) { + return "pure"; + } + if (modifiers.has("payable")) { + return "payable"; + } + if (modifiers.has("nonpayable")) { + return "nonpayable"; + } + + // Process legacy `constant` last + if (modifiers.has("constant")) { + return "view"; + } + + return "nonpayable"; } // ...a parameter list, returning the ParamType list function consumeParams( - tokens: TokenString, - allowIndexed?: boolean, + tokens: TokenString, + allowIndexed?: boolean, ): Array { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); + return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); } // ...a energy limit, returning a BigNumber or null if none function consumeEnergy(tokens: TokenString): null | bigint { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid energy"); - } - return null; + if (tokens.peekType("AT")) { + tokens.pop(); + if (tokens.peekType("NUMBER")) { + return getBigInt(tokens.pop().text); + } + throw new Error("invalid energy"); + } + return null; } function consumeEoi(tokens: TokenString): void { - if (tokens.length) { - throw new Error(`unexpected tokens: ${tokens.toString()}`); - } + if (tokens.length) { + throw new Error(`unexpected tokens: ${tokens.toString()}`); + } } const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); function verifyBasicType(type: string): string { - const match = type.match(regexType); - assertArgument(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - assertArgument( - length !== 0 && length <= 32, - "invalid bytes length", - "type", - type, - ); - } else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3] as string); - assertArgument( - size !== 0 && size <= 256 && size % 8 === 0, - "invalid numeric width", - "type", - type, - ); - } - - return type; + const match = type.match(regexType); + assertArgument(match, "invalid type", "type", type); + if (type === "uint") { + return "uint256"; + } + if (type === "int") { + return "int256"; + } + + if (match[2]) { + // bytesXX + const length = parseInt(match[2]); + assertArgument( + length !== 0 && length <= 32, + "invalid bytes length", + "type", + type, + ); + } else if (match[3]) { + // intXX or uintXX + const size = parseInt(match[3] as string); + assertArgument( + size !== 0 && size <= 256 && size % 8 === 0, + "invalid numeric width", + "type", + type, + ); + } + + return type; } // Make the Fragment constructors effectively private @@ -585,8 +585,8 @@ export type ParamTypeWalkFunc = (type: string, value: any) => any; * this is called on each component. */ export type ParamTypeWalkAsyncFunc = ( - type: string, - value: any, + type: string, + value: any, ) => any | Promise; const internal = Symbol.for("_corebc_internal"); @@ -603,633 +603,628 @@ const StructFragmentInternal = "_StructInternal"; * Each input and output of a [[Fragment]] is an Array of **PAramType**. */ export class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - readonly name!: string; - - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - readonly type!: string; - - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - readonly baseType!: string; - - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - readonly indexed!: null | boolean; - - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - readonly components!: null | ReadonlyArray; - - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - readonly arrayLength!: null | number; - - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - readonly arrayChildren!: null | ParamType; - - /** - * @private - */ - constructor( - guard: any, - name: string, - type: string, - baseType: string, - indexed: null | boolean, - components: null | ReadonlyArray, - arrayLength: null | number, - arrayChildren: null | ParamType, - ) { - assertPrivate(guard, _guard, "ParamType"); - Object.defineProperty(this, internal, { value: ParamTypeInternal }); - - if (components) { - components = Object.freeze(components.slice()); - } - - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } else if (components != null) { - throw new Error(""); - } - - defineProperties(this, { - name, - type, - baseType, - indexed, - components, - arrayLength, - arrayChildren, - }); - } - - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format?: FormatType): string { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - let result: any = { - type: this.baseType === "tuple" ? "tuple" : this.type, - name: this.name || undefined, - }; - if (typeof this.indexed === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => - JSON.parse(c.format(format)), - ); - } - return JSON.stringify(result); - } - - let result = ""; - - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; - } else { - if (this.isTuple()) { - if (format !== "sighash") { - result += this.type; - } - result += - "(" + - this.components - .map((comp) => comp.format(format)) - .join(format === "full" ? ", " : ",") + - ")"; - } else { - result += this.type; - } - } - - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - - return result; - } - - /* - * Returns true if %%value%% is an Array type. - * - * This provides a type gaurd ensuring that the - * [[arrayChildren]] and [[arrayLength]] are non-null. - */ - //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } { - // return value && (value.baseType === "array") - //} - - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray(): this is ParamType & { - arrayChildren: ParamType; - arrayLength: number; - } { - return this.baseType === "array"; - } - - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple(): this is ParamType & { components: ReadonlyArray } { - return this.baseType === "tuple"; - } - - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable(): this is ParamType & { indexed: boolean } { - return this.indexed != null; - } - - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value: any, process: ParamTypeWalkFunc): any { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => _this.arrayChildren.walk(v, process)); - } - - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => _this.components[i].walk(v, process)); - } - - return process(this.type, value); - } - - #walkAsync( - promises: Array>, - value: any, - process: ParamTypeWalkAsyncFunc, - setValue: (value: any) => void, - ): void { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value: any) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - - if (this.isTuple()) { - const components = this.components; - - // Convert the object into an array - let result: Array; - if (Array.isArray(value)) { - result = value.slice(); - } else { - if (value == null || typeof value !== "object") { - throw new Error("invalid tuple value"); - } - - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value: any) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - - const result = process(this.type, value); - if (result.then) { - promises.push( - (async function () { - setValue(await result); - })(), - ); - } else { - setValue(result); - } - } - - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise { - const promises: Array> = []; - const result: [any] = [value]; - this.#walkAsync(promises, value, process, (value: any) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj: any, allowIndexed?: boolean): ParamType { - if (ParamType.isParamType(obj)) { - return obj; - } - - if (typeof obj === "string") { - return ParamType.from(lex(obj), allowIndexed); - } else if (obj instanceof TokenString) { - let type = "", - baseType = ""; - let comps: null | Array = null; - - if ( - consumeKeywords(obj, setify(["tuple"])).has("tuple") || - obj.peekType("OPEN_PAREN") - ) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - - // Check for Array - let arrayChildren: null | ParamType = null; - let arrayLength: null | number = null; - - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType( - _guard, - "", - type, - baseType, - null, - comps, - arrayLength, - arrayChildren, - ); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - - let indexed: boolean | null = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - - const name = obj.peekType("ID") ? obj.pop().text : ""; - - if (obj.length) { - throw new Error("leftover tokens"); - } - - return new ParamType( - _guard, - name, - type, - baseType, - indexed, - comps, - arrayLength, - arrayChildren, - ); - } - - const name = obj.name; - assertArgument( - !name || (typeof name === "string" && name.match(regexId)), - "invalid name", - "obj.name", - name, - ); - - let indexed = obj.indexed; - if (indexed != null) { - assertArgument( - allowIndexed, - "parameter cannot be indexed", - "obj.indexed", - obj.indexed, - ); - indexed = !!indexed; - } - - let type = obj.type; - - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components, - }); - - return new ParamType( - _guard, - name || "", - type, - "array", - indexed, - null, - arrayLength, - arrayChildren, - ); - } - - if ( - type === "tuple" || - type.startsWith("tuple(" /* fix: ) */) || - type.startsWith("(" /* fix: ) */) - ) { - const comps = - obj.components != null - ? obj.components.map((c: any) => ParamType.from(c)) - : null; - const tuple = new ParamType( - _guard, - name || "", - type, - "tuple", - indexed, - comps, - null, - null, - ); - // @TODO: use lexer to validate and normalize type - return tuple; - } - - type = verifyBasicType(obj.type); - - return new ParamType( - _guard, - name || "", - type, - type, - indexed, - null, - null, - null, - ); - } - - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value: any): value is ParamType { - return value && value[internal] === ParamTypeInternal; - } + /** + * The local name of the parameter (or ``""`` if unbound) + */ + readonly name!: string; + + /** + * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, + * ``"uint256[3][]"``) + */ + readonly type!: string; + + /** + * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) + */ + readonly baseType!: string; + + /** + * True if the parameters is indexed. + * + * For non-indexable types this is ``null``. + */ + readonly indexed!: null | boolean; + + /** + * The components for the tuple. + * + * For non-tuple types this is ``null``. + */ + readonly components!: null | ReadonlyArray; + + /** + * The array length, or ``-1`` for dynamic-lengthed arrays. + * + * For non-array types this is ``null``. + */ + readonly arrayLength!: null | number; + + /** + * The type of each child in the array. + * + * For non-array types this is ``null``. + */ + readonly arrayChildren!: null | ParamType; + + /** + * @private + */ + constructor( + guard: any, + name: string, + type: string, + baseType: string, + indexed: null | boolean, + components: null | ReadonlyArray, + arrayLength: null | number, + arrayChildren: null | ParamType, + ) { + assertPrivate(guard, _guard, "ParamType"); + Object.defineProperty(this, internal, { value: ParamTypeInternal }); + + if (components) { + components = Object.freeze(components.slice()); + } + + if (baseType === "array") { + if (arrayLength == null || arrayChildren == null) { + throw new Error(""); + } + } else if (arrayLength != null || arrayChildren != null) { + throw new Error(""); + } + + if (baseType === "tuple") { + if (components == null) { + throw new Error(""); + } + } else if (components != null) { + throw new Error(""); + } + + defineProperties(this, { + name, + type, + baseType, + indexed, + components, + arrayLength, + arrayChildren, + }); + } + + /** + * Return a string representation of this type. + * + * For example, + * + * ``sighash" => "(uint256,address)"`` + * + * ``"minimal" => "tuple(uint256,address) indexed"`` + * + * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` + */ + format(format?: FormatType): string { + if (format == null) { + format = "sighash"; + } + if (format === "json") { + let result: any = { + type: this.baseType === "tuple" ? "tuple" : this.type, + name: this.name || undefined, + }; + if (typeof this.indexed === "boolean") { + result.indexed = this.indexed; + } + if (this.isTuple()) { + result.components = this.components.map((c) => + JSON.parse(c.format(format)), + ); + } + return JSON.stringify(result); + } + + let result = ""; + + // Array + if (this.isArray()) { + result += this.arrayChildren.format(format); + result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; + } else { + if (this.isTuple()) { + if (format !== "sighash") { + result += this.type; + } + result += + "(" + + this.components + .map((comp) => comp.format(format)) + .join(format === "full" ? ", " : ",") + + ")"; + } else { + result += this.type; + } + } + + if (format !== "sighash") { + if (this.indexed === true) { + result += " indexed"; + } + if (format === "full" && this.name) { + result += " " + this.name; + } + } + + return result; + } + + /* + * Returns true if %%value%% is an Array type. + * + * This provides a type gaurd ensuring that the + * [[arrayChildren]] and [[arrayLength]] are non-null. + */ + //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } { + // return value && (value.baseType === "array") + //} + + /** + * Returns true if %%this%% is an Array type. + * + * This provides a type gaurd ensuring that [[arrayChildren]] + * and [[arrayLength]] are non-null. + */ + isArray(): this is ParamType & { + arrayChildren: ParamType; + arrayLength: number; + } { + return this.baseType === "array"; + } + + /** + * Returns true if %%this%% is a Tuple type. + * + * This provides a type gaurd ensuring that [[components]] + * is non-null. + */ + isTuple(): this is ParamType & { components: ReadonlyArray } { + return this.baseType === "tuple"; + } + + /** + * Returns true if %%this%% is an Indexable type. + * + * This provides a type gaurd ensuring that [[indexed]] + * is non-null. + */ + isIndexable(): this is ParamType & { indexed: boolean } { + return this.indexed != null; + } + + /** + * Walks the **ParamType** with %%value%%, calling %%process%% + * on each type, destructing the %%value%% recursively. + */ + walk(value: any, process: ParamTypeWalkFunc): any { + if (this.isArray()) { + if (!Array.isArray(value)) { + throw new Error("invalid array value"); + } + if (this.arrayLength !== -1 && value.length !== this.arrayLength) { + throw new Error("array is wrong length"); + } + const _this = this; + return value.map((v) => _this.arrayChildren.walk(v, process)); + } + + if (this.isTuple()) { + if (!Array.isArray(value)) { + throw new Error("invalid tuple value"); + } + if (value.length !== this.components.length) { + throw new Error("array is wrong length"); + } + const _this = this; + return value.map((v, i) => _this.components[i].walk(v, process)); + } + + return process(this.type, value); + } + + #walkAsync( + promises: Array>, + value: any, + process: ParamTypeWalkAsyncFunc, + setValue: (value: any) => void, + ): void { + if (this.isArray()) { + if (!Array.isArray(value)) { + throw new Error("invalid array value"); + } + if (this.arrayLength !== -1 && value.length !== this.arrayLength) { + throw new Error("array is wrong length"); + } + const childType = this.arrayChildren; + + const result = value.slice(); + result.forEach((value, index) => { + childType.#walkAsync(promises, value, process, (value: any) => { + result[index] = value; + }); + }); + setValue(result); + return; + } + + if (this.isTuple()) { + const components = this.components; + + // Convert the object into an array + let result: Array; + if (Array.isArray(value)) { + result = value.slice(); + } else { + if (value == null || typeof value !== "object") { + throw new Error("invalid tuple value"); + } + + result = components.map((param) => { + if (!param.name) { + throw new Error("cannot use object value with unnamed components"); + } + if (!(param.name in value)) { + throw new Error(`missing value for component ${param.name}`); + } + return value[param.name]; + }); + } + + if (result.length !== this.components.length) { + throw new Error("array is wrong length"); + } + + result.forEach((value, index) => { + components[index].#walkAsync(promises, value, process, (value: any) => { + result[index] = value; + }); + }); + setValue(result); + return; + } + + const result = process(this.type, value); + if (result.then) { + promises.push( + (async function () { + setValue(await result); + })(), + ); + } else { + setValue(result); + } + } + + /** + * Walks the **ParamType** with %%value%%, asynchronously calling + * %%process%% on each type, destructing the %%value%% recursively. + * + * This can be used to resolve ENS naes by walking and resolving each + * ``"address"`` type. + */ + async walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise { + const promises: Array> = []; + const result: [any] = [value]; + this.#walkAsync(promises, value, process, (value: any) => { + result[0] = value; + }); + if (promises.length) { + await Promise.all(promises); + } + return result[0]; + } + + /** + * Creates a new **ParamType** for %%obj%%. + * + * If %%allowIndexed%% then the ``indexed`` keyword is permitted, + * otherwise the ``indexed`` keyword will throw an error. + */ + static from(obj: any, allowIndexed?: boolean): ParamType { + if (ParamType.isParamType(obj)) { + return obj; + } + + if (typeof obj === "string") { + return ParamType.from(lex(obj), allowIndexed); + } else if (obj instanceof TokenString) { + let type = "", + baseType = ""; + let comps: null | Array = null; + + if ( + consumeKeywords(obj, setify(["tuple"])).has("tuple") || + obj.peekType("OPEN_PAREN") + ) { + // Tuple + baseType = "tuple"; + comps = obj.popParams().map((t) => ParamType.from(t)); + type = `tuple(${comps.map((c) => c.format()).join(",")})`; + } else { + // Normal + type = verifyBasicType(obj.popType("TYPE")); + baseType = type; + } + + // Check for Array + let arrayChildren: null | ParamType = null; + let arrayLength: null | number = null; + + while (obj.length && obj.peekType("BRACKET")) { + const bracket = obj.pop(); //arrays[i]; + arrayChildren = new ParamType( + _guard, + "", + type, + baseType, + null, + comps, + arrayLength, + arrayChildren, + ); + arrayLength = bracket.value; + type += bracket.text; + baseType = "array"; + comps = null; + } + + let indexed: boolean | null = null; + const keywords = consumeKeywords(obj, KwModifiers); + if (keywords.has("indexed")) { + if (!allowIndexed) { + throw new Error(""); + } + indexed = true; + } + + const name = obj.peekType("ID") ? obj.pop().text : ""; + + if (obj.length) { + throw new Error("leftover tokens"); + } + + return new ParamType( + _guard, + name, + type, + baseType, + indexed, + comps, + arrayLength, + arrayChildren, + ); + } + + const name = obj.name; + assertArgument( + !name || (typeof name === "string" && name.match(regexId)), + "invalid name", + "obj.name", + name, + ); + + let indexed = obj.indexed; + if (indexed != null) { + assertArgument( + allowIndexed, + "parameter cannot be indexed", + "obj.indexed", + obj.indexed, + ); + indexed = !!indexed; + } + + let type = obj.type; + + let arrayMatch = type.match(regexArrayType); + if (arrayMatch) { + const arrayLength = parseInt(arrayMatch[2] || "-1"); + const arrayChildren = ParamType.from({ + type: arrayMatch[1], + components: obj.components, + }); + + return new ParamType( + _guard, + name || "", + type, + "array", + indexed, + null, + arrayLength, + arrayChildren, + ); + } + + if ( + type === "tuple" || + type.startsWith("tuple(" /* fix: ) */) || + type.startsWith("(" /* fix: ) */) + ) { + const comps = + obj.components != null + ? obj.components.map((c: any) => ParamType.from(c)) + : null; + const tuple = new ParamType( + _guard, + name || "", + type, + "tuple", + indexed, + comps, + null, + null, + ); + // @TODO: use lexer to validate and normalize type + return tuple; + } + + type = verifyBasicType(obj.type); + + return new ParamType( + _guard, + name || "", + type, + type, + indexed, + null, + null, + null, + ); + } + + /** + * Returns true if %%value%% is a **ParamType**. + */ + static isParamType(value: any): value is ParamType { + return value && value[internal] === ParamTypeInternal; + } } /** * The type of a [[Fragment]]. */ export type FragmentType = - | "constructor" - | "error" - | "event" - | "fallback" - | "function" - | "struct"; + "constructor" | "error" | "event" | "fallback" | "function" | "struct"; /** * An abstract class to represent An individual fragment from a parse ABI. */ export abstract class Fragment { - /** - * The type of the fragment. - */ - readonly type!: FragmentType; - - /** - * The inputs for the fragment. - */ - readonly inputs!: ReadonlyArray; - - /** - * @private - */ - constructor( - guard: any, - type: FragmentType, - inputs: ReadonlyArray, - ) { - assertPrivate(guard, _guard, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type, inputs }); - } - - /** - * Returns a string representation of this fragment. - */ - abstract format(format?: FormatType): string; - - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj: any): Fragment { - if (typeof obj === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } catch (e) {} - - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - - const type = obj.peekKeyword(KwTypes); - - switch (type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - } else if (typeof obj === "object") { - // JSON ABI - - switch (obj.type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - - assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from", - }); - } - - assertArgument(false, "unsupported frgament object", "obj", obj); - } - - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value: any): value is ConstructorFragment { - return ConstructorFragment.isFragment(value); - } - - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value: any): value is ErrorFragment { - return ErrorFragment.isFragment(value); - } - - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value: any): value is EventFragment { - return EventFragment.isFragment(value); - } - - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value: any): value is FunctionFragment { - return FunctionFragment.isFragment(value); - } - - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value: any): value is StructFragment { - return StructFragment.isFragment(value); - } + /** + * The type of the fragment. + */ + readonly type!: FragmentType; + + /** + * The inputs for the fragment. + */ + readonly inputs!: ReadonlyArray; + + /** + * @private + */ + constructor( + guard: any, + type: FragmentType, + inputs: ReadonlyArray, + ) { + assertPrivate(guard, _guard, "Fragment"); + inputs = Object.freeze(inputs.slice()); + defineProperties(this, { type, inputs }); + } + + /** + * Returns a string representation of this fragment. + */ + abstract format(format?: FormatType): string; + + /** + * Creates a new **Fragment** for %%obj%%, wich can be any supported + * ABI frgament type. + */ + static from(obj: any): Fragment { + if (typeof obj === "string") { + // Try parsing JSON... + try { + Fragment.from(JSON.parse(obj)); + } catch (e) {} + + // ...otherwise, use the human-readable lexer + return Fragment.from(lex(obj)); + } + + if (obj instanceof TokenString) { + // Human-readable ABI (already lexed) + + const type = obj.peekKeyword(KwTypes); + + switch (type) { + case "constructor": + return ConstructorFragment.from(obj); + case "error": + return ErrorFragment.from(obj); + case "event": + return EventFragment.from(obj); + case "fallback": + case "receive": + return FallbackFragment.from(obj); + case "function": + return FunctionFragment.from(obj); + case "struct": + return StructFragment.from(obj); + } + } else if (typeof obj === "object") { + // JSON ABI + + switch (obj.type) { + case "constructor": + return ConstructorFragment.from(obj); + case "error": + return ErrorFragment.from(obj); + case "event": + return EventFragment.from(obj); + case "fallback": + case "receive": + return FallbackFragment.from(obj); + case "function": + return FunctionFragment.from(obj); + case "struct": + return StructFragment.from(obj); + } + + assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { + operation: "Fragment.from", + }); + } + + assertArgument(false, "unsupported frgament object", "obj", obj); + } + + /** + * Returns true if %%value%% is a [[ConstructorFragment]]. + */ + static isConstructor(value: any): value is ConstructorFragment { + return ConstructorFragment.isFragment(value); + } + + /** + * Returns true if %%value%% is an [[ErrorFragment]]. + */ + static isError(value: any): value is ErrorFragment { + return ErrorFragment.isFragment(value); + } + + /** + * Returns true if %%value%% is an [[EventFragment]]. + */ + static isEvent(value: any): value is EventFragment { + return EventFragment.isFragment(value); + } + + /** + * Returns true if %%value%% is a [[FunctionFragment]]. + */ + static isFunction(value: any): value is FunctionFragment { + return FunctionFragment.isFragment(value); + } + + /** + * Returns true if %%value%% is a [[StructFragment]]. + */ + static isStruct(value: any): value is StructFragment { + return StructFragment.isFragment(value); + } } /** @@ -1237,623 +1232,623 @@ export abstract class Fragment { * which has a name from a parse ABI. */ export abstract class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - readonly name!: string; - - /** - * @private - */ - constructor( - guard: any, - type: FragmentType, - name: string, - inputs: ReadonlyArray, - ) { - super(guard, type, inputs); - assertArgument( - typeof name === "string" && name.match(regexId), - "invalid identifier", - "name", - name, - ); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name }); - } + /** + * The name of the fragment. + */ + readonly name!: string; + + /** + * @private + */ + constructor( + guard: any, + type: FragmentType, + name: string, + inputs: ReadonlyArray, + ) { + super(guard, type, inputs); + assertArgument( + typeof name === "string" && name.match(regexId), + "invalid identifier", + "name", + name, + ); + inputs = Object.freeze(inputs.slice()); + defineProperties(this, { name }); + } } function joinParams( - format: FormatType, - params: ReadonlyArray, + format: FormatType, + params: ReadonlyArray, ): string { - return ( - "(" + - params.map((p) => p.format(format)).join(format === "full" ? ", " : ",") + - ")" - ); + return ( + "(" + + params.map((p) => p.format(format)).join(format === "full" ? ", " : ",") + + ")" + ); } /** * A Fragment which represents a //Custom Error//. */ export class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal, { value: ErrorFragmentInternal }); - } - - /** - * The Custom Error selector. - */ - get selector(): string { - return id(this.format("sighash")).substring(0, 10); - } - - format(format?: FormatType): string { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - - const result: string[] = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - - static from(obj: any): ErrorFragment { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - - if (typeof obj === "string") { - return ErrorFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - - return new ErrorFragment(_guard, name, inputs); - } - - return new ErrorFragment( - _guard, - obj.name, - obj.inputs ? obj.inputs.map(ParamType.from) : [], - ); - } - - static isFragment(value: any): value is ErrorFragment { - return value && value[internal] === ErrorFragmentInternal; - } + /** + * @private + */ + constructor(guard: any, name: string, inputs: ReadonlyArray) { + super(guard, "error", name, inputs); + Object.defineProperty(this, internal, { value: ErrorFragmentInternal }); + } + + /** + * The Custom Error selector. + */ + get selector(): string { + return id(this.format("sighash")).substring(0, 10); + } + + format(format?: FormatType): string { + if (format == null) { + format = "sighash"; + } + if (format === "json") { + return JSON.stringify({ + type: "error", + name: this.name, + inputs: this.inputs.map((input) => JSON.parse(input.format(format))), + }); + } + + const result: string[] = []; + if (format !== "sighash") { + result.push("error"); + } + result.push(this.name + joinParams(format, this.inputs)); + return result.join(" "); + } + + static from(obj: any): ErrorFragment { + if (ErrorFragment.isFragment(obj)) { + return obj; + } + + if (typeof obj === "string") { + return ErrorFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const name = consumeName("error", obj); + const inputs = consumeParams(obj); + consumeEoi(obj); + + return new ErrorFragment(_guard, name, inputs); + } + + return new ErrorFragment( + _guard, + obj.name, + obj.inputs ? obj.inputs.map(ParamType.from) : [], + ); + } + + static isFragment(value: any): value is ErrorFragment { + return value && value[internal] === ErrorFragmentInternal; + } } /** * A Fragment which represents an Event. */ export class EventFragment extends NamedFragment { - readonly anonymous!: boolean; - - /** - * @private - */ - constructor( - guard: any, - name: string, - inputs: ReadonlyArray, - anonymous: boolean, - ) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - - /** - * The Event topic hash. - */ - get topicHash(): string { - return id(this.format("sighash")); - } - - format(format?: FormatType): string { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - - const result: string[] = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - - static getTopicHash(name: string, params?: Array): string { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard, name, params, false); - return fragment.topicHash; - } - - static from(obj: any): EventFragment { - if (EventFragment.isFragment(obj)) { - return obj; - } - - if (typeof obj === "string") { - return EventFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has( - "anonymous", - ); - consumeEoi(obj); - - return new EventFragment(_guard, name, inputs, anonymous); - } - - return new EventFragment( - _guard, - obj.name, - obj.inputs ? obj.inputs.map((p: any) => ParamType.from(p, true)) : [], - !!obj.anonymous, - ); - } - - static isFragment(value: any): value is EventFragment { - return value && value[internal] === EventFragmentInternal; - } + readonly anonymous!: boolean; + + /** + * @private + */ + constructor( + guard: any, + name: string, + inputs: ReadonlyArray, + anonymous: boolean, + ) { + super(guard, "event", name, inputs); + Object.defineProperty(this, internal, { value: EventFragmentInternal }); + defineProperties(this, { anonymous }); + } + + /** + * The Event topic hash. + */ + get topicHash(): string { + return id(this.format("sighash")); + } + + format(format?: FormatType): string { + if (format == null) { + format = "sighash"; + } + if (format === "json") { + return JSON.stringify({ + type: "event", + anonymous: this.anonymous, + name: this.name, + inputs: this.inputs.map((i) => JSON.parse(i.format(format))), + }); + } + + const result: string[] = []; + if (format !== "sighash") { + result.push("event"); + } + result.push(this.name + joinParams(format, this.inputs)); + if (format !== "sighash" && this.anonymous) { + result.push("anonymous"); + } + return result.join(" "); + } + + static getTopicHash(name: string, params?: Array): string { + params = (params || []).map((p) => ParamType.from(p)); + const fragment = new EventFragment(_guard, name, params, false); + return fragment.topicHash; + } + + static from(obj: any): EventFragment { + if (EventFragment.isFragment(obj)) { + return obj; + } + + if (typeof obj === "string") { + return EventFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const name = consumeName("event", obj); + const inputs = consumeParams(obj, true); + const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has( + "anonymous", + ); + consumeEoi(obj); + + return new EventFragment(_guard, name, inputs, anonymous); + } + + return new EventFragment( + _guard, + obj.name, + obj.inputs ? obj.inputs.map((p: any) => ParamType.from(p, true)) : [], + !!obj.anonymous, + ); + } + + static isFragment(value: any): value is EventFragment { + return value && value[internal] === EventFragmentInternal; + } } /** * A Fragment which represents a constructor. */ export class ConstructorFragment extends Fragment { - readonly payable!: boolean; - readonly energy!: null | bigint; - - /** - * @private - */ - constructor( - guard: any, - type: FragmentType, - inputs: ReadonlyArray, - payable: boolean, - energy: null | bigint, - ) { - super(guard, type, inputs); - Object.defineProperty(this, internal, { - value: ConstructorFragmentInternal, - }); - defineProperties(this, { payable, energy }); - } - - format(format?: FormatType): string { - assert( - format != null && format !== "sighash", - "cannot format a constructor for sighash", - "UNSUPPORTED_OPERATION", - { operation: "format(sighash)" }, - ); - - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: this.payable ? "payable" : "undefined", - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - - const result = [`constructor${joinParams(format, this.inputs)}`]; - result.push(this.payable ? "payable" : "nonpayable"); - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - return result.join(" "); - } - - static from(obj: any): ConstructorFragment { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - - if (typeof obj === "string") { - return ConstructorFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, setify(["payable"])).has( - "payable", - ); - const energy = consumeEnergy(obj); - consumeEoi(obj); - - return new ConstructorFragment( - _guard, - "constructor", - inputs, - payable, - energy, - ); - } - - return new ConstructorFragment( - _guard, - "constructor", - obj.inputs ? obj.inputs.map(ParamType.from) : [], - !!obj.payable, - obj.energy != null ? obj.energy : null, - ); - } - - static isFragment(value: any): value is ConstructorFragment { - return value && value[internal] === ConstructorFragmentInternal; - } + readonly payable!: boolean; + readonly energy!: null | bigint; + + /** + * @private + */ + constructor( + guard: any, + type: FragmentType, + inputs: ReadonlyArray, + payable: boolean, + energy: null | bigint, + ) { + super(guard, type, inputs); + Object.defineProperty(this, internal, { + value: ConstructorFragmentInternal, + }); + defineProperties(this, { payable, energy }); + } + + format(format?: FormatType): string { + assert( + format != null && format !== "sighash", + "cannot format a constructor for sighash", + "UNSUPPORTED_OPERATION", + { operation: "format(sighash)" }, + ); + + if (format === "json") { + return JSON.stringify({ + type: "constructor", + stateMutability: this.payable ? "payable" : "undefined", + payable: this.payable, + energy: this.energy != null ? this.energy : undefined, + inputs: this.inputs.map((i) => JSON.parse(i.format(format))), + }); + } + + const result = [`constructor${joinParams(format, this.inputs)}`]; + result.push(this.payable ? "payable" : "nonpayable"); + if (this.energy != null) { + result.push(`@${this.energy.toString()}`); + } + return result.join(" "); + } + + static from(obj: any): ConstructorFragment { + if (ConstructorFragment.isFragment(obj)) { + return obj; + } + + if (typeof obj === "string") { + return ConstructorFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + consumeKeywords(obj, setify(["constructor"])); + const inputs = consumeParams(obj); + const payable = !!consumeKeywords(obj, setify(["payable"])).has( + "payable", + ); + const energy = consumeEnergy(obj); + consumeEoi(obj); + + return new ConstructorFragment( + _guard, + "constructor", + inputs, + payable, + energy, + ); + } + + return new ConstructorFragment( + _guard, + "constructor", + obj.inputs ? obj.inputs.map(ParamType.from) : [], + !!obj.payable, + obj.energy != null ? obj.energy : null, + ); + } + + static isFragment(value: any): value is ConstructorFragment { + return value && value[internal] === ConstructorFragmentInternal; + } } /** * A Fragment which represents a method. */ export class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - readonly payable!: boolean; - - constructor(guard: any, inputs: ReadonlyArray, payable: boolean) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - - format(format?: FormatType): string { - const type = this.inputs.length === 0 ? "receive" : "fallback"; - - if (format === "json") { - const stateMutability = this.payable ? "payable" : "nonpayable"; - return JSON.stringify({ type, stateMutability }); - } - - return `${type}()${this.payable ? " payable" : ""}`; - } - - static from(obj: any): FallbackFragment { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - - if (typeof obj === "string") { - return FallbackFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - assertArgument( - topIsValid, - "type must be fallback or receive", - "obj", - errorObj, - ); - - const type = obj.popKeyword(setify(["fallback", "receive"])); - - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - assertArgument( - inputs.length === 0, - `receive cannot have arguments`, - "obj.inputs", - inputs, - ); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard, [], true); - } - - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument( - inputs.length === 1 && inputs[0].type === "bytes", - "invalid fallback inputs", - "obj.inputs", - inputs.map((i) => i.format("minimal")).join(", "), - ); - } else { - inputs = [ParamType.from("bytes")]; - } - - const mutability = consumeMutability(obj); - assertArgument( - mutability === "nonpayable" || mutability === "payable", - "fallback cannot be constants", - "obj.stateMutability", - mutability, - ); - - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument( - outputs.length === 1 && outputs[0].type === "bytes", - "invalid fallback outputs", - "obj.outputs", - outputs.map((i) => i.format("minimal")).join(", "), - ); - } - - consumeEoi(obj); - - return new FallbackFragment(_guard, inputs, mutability === "payable"); - } - - if (obj.type === "receive") { - return new FallbackFragment(_guard, [], true); - } - - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = obj.stateMutability === "payable"; - return new FallbackFragment(_guard, inputs, payable); - } - - assertArgument(false, "invalid fallback description", "obj", obj); - } - - static isFragment(value: any): value is FallbackFragment { - return value && value[internal] === FallbackFragmentInternal; - } + /** + * If the function can be sent value during invocation. + */ + readonly payable!: boolean; + + constructor(guard: any, inputs: ReadonlyArray, payable: boolean) { + super(guard, "fallback", inputs); + Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); + defineProperties(this, { payable }); + } + + format(format?: FormatType): string { + const type = this.inputs.length === 0 ? "receive" : "fallback"; + + if (format === "json") { + const stateMutability = this.payable ? "payable" : "nonpayable"; + return JSON.stringify({ type, stateMutability }); + } + + return `${type}()${this.payable ? " payable" : ""}`; + } + + static from(obj: any): FallbackFragment { + if (FallbackFragment.isFragment(obj)) { + return obj; + } + + if (typeof obj === "string") { + return FallbackFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const errorObj = obj.toString(); + + const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); + assertArgument( + topIsValid, + "type must be fallback or receive", + "obj", + errorObj, + ); + + const type = obj.popKeyword(setify(["fallback", "receive"])); + + // receive() + if (type === "receive") { + const inputs = consumeParams(obj); + assertArgument( + inputs.length === 0, + `receive cannot have arguments`, + "obj.inputs", + inputs, + ); + consumeKeywords(obj, setify(["payable"])); + consumeEoi(obj); + return new FallbackFragment(_guard, [], true); + } + + // fallback() [payable] + // fallback(bytes) [payable] returns (bytes) + let inputs = consumeParams(obj); + if (inputs.length) { + assertArgument( + inputs.length === 1 && inputs[0].type === "bytes", + "invalid fallback inputs", + "obj.inputs", + inputs.map((i) => i.format("minimal")).join(", "), + ); + } else { + inputs = [ParamType.from("bytes")]; + } + + const mutability = consumeMutability(obj); + assertArgument( + mutability === "nonpayable" || mutability === "payable", + "fallback cannot be constants", + "obj.stateMutability", + mutability, + ); + + if (consumeKeywords(obj, setify(["returns"])).has("returns")) { + const outputs = consumeParams(obj); + assertArgument( + outputs.length === 1 && outputs[0].type === "bytes", + "invalid fallback outputs", + "obj.outputs", + outputs.map((i) => i.format("minimal")).join(", "), + ); + } + + consumeEoi(obj); + + return new FallbackFragment(_guard, inputs, mutability === "payable"); + } + + if (obj.type === "receive") { + return new FallbackFragment(_guard, [], true); + } + + if (obj.type === "fallback") { + const inputs = [ParamType.from("bytes")]; + const payable = obj.stateMutability === "payable"; + return new FallbackFragment(_guard, inputs, payable); + } + + assertArgument(false, "invalid fallback description", "obj", obj); + } + + static isFragment(value: any): value is FallbackFragment { + return value && value[internal] === FallbackFragmentInternal; + } } /** * A Fragment which represents a method. */ export class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - readonly constant!: boolean; - - /** - * The returned types for the result of calling this function. - */ - readonly outputs!: ReadonlyArray; - - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - readonly stateMutability!: "payable" | "nonpayable" | "view" | "pure"; - - /** - * If the function can be sent value during invocation. - */ - readonly payable!: boolean; - - /** - * The amount of energy to send when calling this function - */ - readonly energy!: null | bigint; - - /** - * @private - */ - constructor( - guard: any, - name: string, - stateMutability: "payable" | "nonpayable" | "view" | "pure", - inputs: ReadonlyArray, - outputs: ReadonlyArray, - energy: null | bigint, - ) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = stateMutability === "view" || stateMutability === "pure"; - const payable = stateMutability === "payable"; - defineProperties(this, { - constant, - energy, - outputs, - payable, - stateMutability, - }); - } - - /** - * The Function selector. - */ - get selector(): string { - return id(this.format("sighash")).substring(0, 10); - } - - format(format?: FormatType): string { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: - this.stateMutability !== "nonpayable" - ? this.stateMutability - : undefined, - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - - const result: string[] = []; - - if (format !== "sighash") { - result.push("function"); - } - - result.push(this.name + joinParams(format, this.inputs)); - - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - } - return result.join(" "); - } - - static getSelector(name: string, params?: Array): string { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment( - _guard, - name, - "view", - params, - [], - null, - ); - return fragment.selector; - } - - static from(obj: any): FunctionFragment { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - - if (typeof obj === "string") { - return FunctionFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - - let outputs: Array = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - - const energy = consumeEnergy(obj); - - consumeEoi(obj); - - return new FunctionFragment( - _guard, - name, - mutability, - inputs, - outputs, - energy, - ); - } - - let stateMutability = obj.stateMutability; - - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - - if (typeof obj.constant === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } else if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - - return new FunctionFragment( - _guard, - obj.name, - stateMutability, - obj.inputs ? obj.inputs.map(ParamType.from) : [], - obj.outputs ? obj.outputs.map(ParamType.from) : [], - obj.energy != null ? obj.energy : null, - ); - } - - static isFragment(value: any): value is FunctionFragment { - return value && value[internal] === FunctionFragmentInternal; - } + /** + * If the function is constant (e.g. ``pure`` or ``view`` functions). + */ + readonly constant!: boolean; + + /** + * The returned types for the result of calling this function. + */ + readonly outputs!: ReadonlyArray; + + /** + * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` + * or ``pure``) + */ + readonly stateMutability!: "payable" | "nonpayable" | "view" | "pure"; + + /** + * If the function can be sent value during invocation. + */ + readonly payable!: boolean; + + /** + * The amount of energy to send when calling this function + */ + readonly energy!: null | bigint; + + /** + * @private + */ + constructor( + guard: any, + name: string, + stateMutability: "payable" | "nonpayable" | "view" | "pure", + inputs: ReadonlyArray, + outputs: ReadonlyArray, + energy: null | bigint, + ) { + super(guard, "function", name, inputs); + Object.defineProperty(this, internal, { value: FunctionFragmentInternal }); + outputs = Object.freeze(outputs.slice()); + const constant = stateMutability === "view" || stateMutability === "pure"; + const payable = stateMutability === "payable"; + defineProperties(this, { + constant, + energy, + outputs, + payable, + stateMutability, + }); + } + + /** + * The Function selector. + */ + get selector(): string { + return id(this.format("sighash")).substring(0, 10); + } + + format(format?: FormatType): string { + if (format == null) { + format = "sighash"; + } + if (format === "json") { + return JSON.stringify({ + type: "function", + name: this.name, + constant: this.constant, + stateMutability: + this.stateMutability !== "nonpayable" + ? this.stateMutability + : undefined, + payable: this.payable, + energy: this.energy != null ? this.energy : undefined, + inputs: this.inputs.map((i) => JSON.parse(i.format(format))), + outputs: this.outputs.map((o) => JSON.parse(o.format(format))), + }); + } + + const result: string[] = []; + + if (format !== "sighash") { + result.push("function"); + } + + result.push(this.name + joinParams(format, this.inputs)); + + if (format !== "sighash") { + if (this.stateMutability !== "nonpayable") { + result.push(this.stateMutability); + } + + if (this.outputs && this.outputs.length) { + result.push("returns"); + result.push(joinParams(format, this.outputs)); + } + + if (this.energy != null) { + result.push(`@${this.energy.toString()}`); + } + } + return result.join(" "); + } + + static getSelector(name: string, params?: Array): string { + params = (params || []).map((p) => ParamType.from(p)); + const fragment = new FunctionFragment( + _guard, + name, + "view", + params, + [], + null, + ); + return fragment.selector; + } + + static from(obj: any): FunctionFragment { + if (FunctionFragment.isFragment(obj)) { + return obj; + } + + if (typeof obj === "string") { + return FunctionFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const name = consumeName("function", obj); + const inputs = consumeParams(obj); + const mutability = consumeMutability(obj); + + let outputs: Array = []; + if (consumeKeywords(obj, setify(["returns"])).has("returns")) { + outputs = consumeParams(obj); + } + + const energy = consumeEnergy(obj); + + consumeEoi(obj); + + return new FunctionFragment( + _guard, + name, + mutability, + inputs, + outputs, + energy, + ); + } + + let stateMutability = obj.stateMutability; + + // Use legacy Solidity ABI logic if stateMutability is missing + if (stateMutability == null) { + stateMutability = "payable"; + + if (typeof obj.constant === "boolean") { + stateMutability = "view"; + if (!obj.constant) { + stateMutability = "payable"; + if (typeof obj.payable === "boolean" && !obj.payable) { + stateMutability = "nonpayable"; + } + } + } else if (typeof obj.payable === "boolean" && !obj.payable) { + stateMutability = "nonpayable"; + } + } + + // @TODO: verifyState for stateMutability (e.g. throw if + // payable: false but stateMutability is "nonpayable") + + return new FunctionFragment( + _guard, + obj.name, + stateMutability, + obj.inputs ? obj.inputs.map(ParamType.from) : [], + obj.outputs ? obj.outputs.map(ParamType.from) : [], + obj.energy != null ? obj.energy : null, + ); + } + + static isFragment(value: any): value is FunctionFragment { + return value && value[internal] === FunctionFragmentInternal; + } } /** * A Fragment which represents a structure. */ export class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal, { value: StructFragmentInternal }); - } - - format(): string { - throw new Error("@TODO"); - } - - static from(obj: any): StructFragment { - if (typeof obj === "string") { - return StructFragment.from(lex(obj)); - } else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard, name, inputs); - } - - return new StructFragment( - _guard, - obj.name, - obj.inputs ? obj.inputs.map(ParamType.from) : [], - ); - } - - static isFragment(value: any): value is FunctionFragment { - return value && value[internal] === StructFragmentInternal; - } + /** + * @private + */ + constructor(guard: any, name: string, inputs: ReadonlyArray) { + super(guard, "struct", name, inputs); + Object.defineProperty(this, internal, { value: StructFragmentInternal }); + } + + format(): string { + throw new Error("@TODO"); + } + + static from(obj: any): StructFragment { + if (typeof obj === "string") { + return StructFragment.from(lex(obj)); + } else if (obj instanceof TokenString) { + const name = consumeName("struct", obj); + const inputs = consumeParams(obj); + consumeEoi(obj); + return new StructFragment(_guard, name, inputs); + } + + return new StructFragment( + _guard, + obj.name, + obj.inputs ? obj.inputs.map(ParamType.from) : [], + ); + } + + static isFragment(value: any): value is FunctionFragment { + return value && value[internal] === StructFragmentInternal; + } } diff --git a/src.ts/abi/index.ts b/src.ts/abi/index.ts index 255046357..639f1b745 100644 --- a/src.ts/abi/index.ts +++ b/src.ts/abi/index.ts @@ -11,36 +11,36 @@ export { AbiCoder } from "./abi-coder.js"; export { decodeBytes32String, encodeBytes32String } from "./bytes32.js"; export { - ConstructorFragment, - ErrorFragment, - EventFragment, - FallbackFragment, - Fragment, - FunctionFragment, - NamedFragment, - ParamType, - StructFragment, + ConstructorFragment, + ErrorFragment, + EventFragment, + FallbackFragment, + Fragment, + FunctionFragment, + NamedFragment, + ParamType, + StructFragment, } from "./fragments.js"; export { - checkResultErrors, - Indexed, - Interface, - ErrorDescription, - LogDescription, - TransactionDescription, - Result, + checkResultErrors, + Indexed, + Interface, + ErrorDescription, + LogDescription, + TransactionDescription, + Result, } from "./interface.js"; export { Typed } from "./typed.js"; export type { - JsonFragment, - JsonFragmentType, - FormatType, - FragmentType, - ParamTypeWalkAsyncFunc, - ParamTypeWalkFunc, + JsonFragment, + JsonFragmentType, + FormatType, + FragmentType, + ParamTypeWalkAsyncFunc, + ParamTypeWalkFunc, } from "./fragments.js"; export type { InterfaceAbi } from "./interface.js"; diff --git a/src.ts/abi/interface.ts b/src.ts/abi/interface.ts index b1943c203..4de2cf61e 100644 --- a/src.ts/abi/interface.ts +++ b/src.ts/abi/interface.ts @@ -6,38 +6,38 @@ import { id } from "../hash/index.js"; import { - concat, - dataSlice, - getBigInt, - getBytes, - getBytesCopy, - hexlify, - zeroPadValue, - isHexString, - defineProperties, - assertArgument, - toBeHex, - assert, + concat, + dataSlice, + getBigInt, + getBytes, + getBytesCopy, + hexlify, + zeroPadValue, + isHexString, + defineProperties, + assertArgument, + toBeHex, + assert, } from "../utils/index.js"; import { AbiCoder } from "./abi-coder.js"; import { checkResultErrors, Result } from "./coders/abstract-coder.js"; import { - ConstructorFragment, - ErrorFragment, - EventFragment, - FallbackFragment, - Fragment, - FunctionFragment, - ParamType, + ConstructorFragment, + ErrorFragment, + EventFragment, + FallbackFragment, + Fragment, + FunctionFragment, + ParamType, } from "./fragments.js"; import { Typed } from "./typed.js"; import type { - BigNumberish, - BytesLike, - CallExceptionError, - CallExceptionTransaction, + BigNumberish, + BytesLike, + CallExceptionError, + CallExceptionTransaction, } from "../utils/index.js"; import type { JsonFragment } from "./fragments.js"; @@ -46,127 +46,127 @@ import { sha256 } from "../crypto/sha3.js"; export { checkResultErrors, Result }; export class LogDescription { - readonly fragment!: EventFragment; - readonly name!: string; - readonly signature!: string; - readonly topic!: string; - readonly args!: Result; - - constructor(fragment: EventFragment, topic: string, args: Result) { - const name = fragment.name, - signature = fragment.format(); - defineProperties(this, { - fragment, - name, - signature, - topic, - args, - }); - } + readonly fragment!: EventFragment; + readonly name!: string; + readonly signature!: string; + readonly topic!: string; + readonly args!: Result; + + constructor(fragment: EventFragment, topic: string, args: Result) { + const name = fragment.name, + signature = fragment.format(); + defineProperties(this, { + fragment, + name, + signature, + topic, + args, + }); + } } export class TransactionDescription { - readonly fragment!: FunctionFragment; - readonly name!: string; - readonly args!: Result; - readonly signature!: string; - readonly selector!: string; - readonly value!: bigint; - - constructor( - fragment: FunctionFragment, - selector: string, - args: Result, - value: bigint, - ) { - const name = fragment.name, - signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - value, - }); - } + readonly fragment!: FunctionFragment; + readonly name!: string; + readonly args!: Result; + readonly signature!: string; + readonly selector!: string; + readonly value!: bigint; + + constructor( + fragment: FunctionFragment, + selector: string, + args: Result, + value: bigint, + ) { + const name = fragment.name, + signature = fragment.format(); + defineProperties(this, { + fragment, + name, + args, + signature, + selector, + value, + }); + } } export class ErrorDescription { - readonly fragment!: ErrorFragment; - readonly name!: string; - readonly args!: Result; - readonly signature!: string; - readonly selector!: string; - - constructor(fragment: ErrorFragment, selector: string, args: Result) { - const name = fragment.name, - signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - }); - } + readonly fragment!: ErrorFragment; + readonly name!: string; + readonly args!: Result; + readonly signature!: string; + readonly selector!: string; + + constructor(fragment: ErrorFragment, selector: string, args: Result) { + const name = fragment.name, + signature = fragment.format(); + defineProperties(this, { + fragment, + name, + args, + signature, + selector, + }); + } } export class Indexed { - readonly hash!: null | string; - readonly _isIndexed!: boolean; + readonly hash!: null | string; + readonly _isIndexed!: boolean; - static isIndexed(value: any): value is Indexed { - return !!(value && value._isIndexed); - } + static isIndexed(value: any): value is Indexed { + return !!(value && value._isIndexed); + } - constructor(hash: null | string) { - defineProperties(this, { hash, _isIndexed: true }); - } + constructor(hash: null | string) { + defineProperties(this, { hash, _isIndexed: true }); + } } type ErrorInfo = { - signature: string; - inputs: Array; - name: string; - reason: (...args: Array) => string; + signature: string; + inputs: Array; + name: string; + reason: (...args: Array) => string; }; // https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require const PanicReasons: Record = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", + "0": "generic panic", + "1": "assert(false)", + "17": "arithmetic overflow", + "18": "division or modulo by zero", + "33": "enum overflow", + "34": "invalid encoded storage byte array accessed", + "49": "out-of-bounds array access; popping on an empty array", + "50": "out-of-bounds access of an array or bytesN", + "65": "out of memory", + "81": "uninitialized function", }; const BuiltinErrors: Record = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message: string) => { - return `reverted with reason string ${JSON.stringify(message)}`; - }, - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code: bigint) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - }, - }, + "0x08c379a0": { + signature: "Error(string)", + name: "Error", + inputs: ["string"], + reason: (message: string) => { + return `reverted with reason string ${JSON.stringify(message)}`; + }, + }, + "0x4e487b71": { + signature: "Panic(uint256)", + name: "Panic", + inputs: ["uint256"], + reason: (code: bigint) => { + let reason = "unknown panic code"; + if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { + reason = PanicReasons[code.toString()]; + } + return `reverted with panic code 0x${code.toString(16)} (${reason})`; + }, + }, }; /* @@ -194,8 +194,7 @@ function checkNames(fragment: Fragment, type: "input" | "output", params: Array< * @TODO */ export type InterfaceAbi = - | string - | ReadonlyArray; + string | ReadonlyArray; /** * An Interface abstracts many of the low-level details for @@ -208,555 +207,555 @@ export type InterfaceAbi = * The ABI can be specified by [any supported format](InterfaceAbi). */ export class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - readonly fragments!: ReadonlyArray; - - /** - * The Contract constructor. - */ - readonly deploy!: ConstructorFragment; - - /** - * The Fallback method, if any. - */ - readonly fallback!: null | FallbackFragment; - - /** - * If receiving xcb is supported. - */ - readonly receive!: boolean; - - #errors: Map; - #events: Map; - #functions: Map; - // #structs: Map; - - #abiCoder: AbiCoder; - - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments: InterfaceAbi) { - let abi: ReadonlyArray = []; - if (typeof fragments === "string") { - abi = JSON.parse(fragments); - } else { - abi = fragments; - } - - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - - const frags: Array = []; - for (const a of abi) { - try { - frags.push(Fragment.from(a)); - } catch (error) { - console.log("EE", error); - } - } - - defineProperties(this, { - fragments: Object.freeze(frags), - }); - - let fallback: null | FallbackFragment = null; - let receive = false; - - this.#abiCoder = this.getAbiCoder(); - - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket: Map; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - defineProperties(this, { - deploy: fragment, - }); - return; - - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } else { - assertArgument( - !fallback || - (fragment).payable !== fallback.payable, - "conflicting fallback fragments", - `fragments[${index}]`, - fragment, - ); - fallback = fragment; - receive = fallback.payable; - } - return; - - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - - case "error": - bucket = this.#errors; - break; - - default: - return; - } - - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - - bucket.set(signature, fragment); - }); - - // If we do not have a constructor add a default - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()"), - }); - } - - defineProperties(this, { fallback, receive }); - } - - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal?: boolean): Array { - const format = minimal ? "minimal" : "full"; - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson(): string { - const abi = this.fragments.map((f) => f.format("json")); - - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder(): AbiCoder { - return AbiCoder.defaultAbiCoder(); - } - - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction( - key: string, - values: null | Array, - forceUnique: boolean, - ): null | FunctionFragment { - // Selector - if (isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching: Array = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - - if (values) { - const lastValue = values.length > 0 ? values[values.length - 1] : null; - - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if ( - inputs !== valueLength && - (!allowOptions || inputs !== valueLength - 1) - ) { - matching.splice(i, 1); - } - } - - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if ( - matching.length === 1 && - values && - values.length !== matching[0].inputs.length - ) { - const lastArg = values[values.length - 1]; - if ( - lastArg == null || - Array.isArray(lastArg) || - typeof lastArg !== "object" - ) { - matching.splice(0, 1); - } - } - - if (matching.length === 0) { - return null; - } - - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument( - false, - `ambiguous function description (i.e. matches ${matchStr})`, - "key", - key, - ); - } - - return matching[0]; - } - - // Normalize the signature and lookup the function - const result = this.#functions.get(FunctionFragment.from(key).format()); - if (result) { - return result; - } - - return null; - } - - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key: string): string { - const fragment = this.#getFunction(key, null, false); - assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key: string): boolean { - return !!this.#getFunction(key, null, false); - } - - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction( - key: string, - values?: Array, - ): null | FunctionFragment { - return this.#getFunction(key, values || null, true); - } - - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction( - callback: (func: FunctionFragment, index: number) => void, - ): void { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#functions.get(name), i); - } - } - - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent( - key: string, - values: null | Array, - forceUnique: boolean, - ): null | EventFragment { - // EventTopic - if (isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching: any = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - - if (matching.length === 0) { - return null; - } - - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m: any) => JSON.stringify(m.format())) - .join(", "); - assertArgument( - false, - `ambiguous event description (i.e. matches ${matchStr})`, - "key", - key, - ); - } - - return matching[0]; - } - - // Normalize the signature and lookup the function - const result = this.#events.get(EventFragment.from(key).format()); - if (result) { - return result; - } - - return null; - } - - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key: string): string { - const fragment = this.#getEvent(key, null, false); - assertArgument(fragment, "no matching event", "key", key); - - return fragment.name; - } - - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key: string): boolean { - return !!this.#getEvent(key, null, false); - } - - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key: string, values?: Array): null | EventFragment { - return this.#getEvent(key, values || null, true); - } - - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback: (func: EventFragment, index: number) => void): void { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#events.get(name), i); - } - } - - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key: string, values?: Array): null | ErrorFragment { - if (isHexString(key)) { - const selector = key.toLowerCase(); - - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - - return null; - } - - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching: any = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - - if (matching.length === 0) { - if (key === "Error") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return ErrorFragment.from("error Panic(uint256)"); - } - return null; - } else if (matching.length > 1) { - const matchStr = matching - .map((m: any) => JSON.stringify(m.format())) - .join(", "); - assertArgument( - false, - `ambiguous error description (i.e. ${matchStr})`, - "name", - key, - ); - } - - return matching[0]; - } - - // Normalize the signature and lookup the function - key = ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return ErrorFragment.from("error Panic(uint256)"); - } - - const result = this.#errors.get(key); - if (result) { - return result; - } - - return null; - } - - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback: (func: ErrorFragment, index: number) => void): void { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#errors.get(name), i); - } - } - - // Get the 4-byte selector used by Solidity to identify a function - /* + /** + * All the Contract ABI members (i.e. methods, events, errors, etc). + */ + readonly fragments!: ReadonlyArray; + + /** + * The Contract constructor. + */ + readonly deploy!: ConstructorFragment; + + /** + * The Fallback method, if any. + */ + readonly fallback!: null | FallbackFragment; + + /** + * If receiving xcb is supported. + */ + readonly receive!: boolean; + + #errors: Map; + #events: Map; + #functions: Map; + // #structs: Map; + + #abiCoder: AbiCoder; + + /** + * Create a new Interface for the %%fragments%%. + */ + constructor(fragments: InterfaceAbi) { + let abi: ReadonlyArray = []; + if (typeof fragments === "string") { + abi = JSON.parse(fragments); + } else { + abi = fragments; + } + + this.#functions = new Map(); + this.#errors = new Map(); + this.#events = new Map(); + // this.#structs = new Map(); + + const frags: Array = []; + for (const a of abi) { + try { + frags.push(Fragment.from(a)); + } catch (error) { + console.log("EE", error); + } + } + + defineProperties(this, { + fragments: Object.freeze(frags), + }); + + let fallback: null | FallbackFragment = null; + let receive = false; + + this.#abiCoder = this.getAbiCoder(); + + // Add all fragments by their signature + this.fragments.forEach((fragment, index) => { + let bucket: Map; + switch (fragment.type) { + case "constructor": + if (this.deploy) { + console.log("duplicate definition - constructor"); + return; + } + //checkNames(fragment, "input", fragment.inputs); + defineProperties(this, { + deploy: fragment, + }); + return; + + case "fallback": + if (fragment.inputs.length === 0) { + receive = true; + } else { + assertArgument( + !fallback || + (fragment).payable !== fallback.payable, + "conflicting fallback fragments", + `fragments[${index}]`, + fragment, + ); + fallback = fragment; + receive = fallback.payable; + } + return; + + case "function": + //checkNames(fragment, "input", fragment.inputs); + //checkNames(fragment, "output", (fragment).outputs); + bucket = this.#functions; + break; + + case "event": + //checkNames(fragment, "input", fragment.inputs); + bucket = this.#events; + break; + + case "error": + bucket = this.#errors; + break; + + default: + return; + } + + // Two identical entries; ignore it + const signature = fragment.format(); + if (bucket.has(signature)) { + return; + } + + bucket.set(signature, fragment); + }); + + // If we do not have a constructor add a default + if (!this.deploy) { + defineProperties(this, { + deploy: ConstructorFragment.from("constructor()"), + }); + } + + defineProperties(this, { fallback, receive }); + } + + /** + * Returns the entire Human-Readable ABI, as an array of + * signatures, optionally as %%minimal%% strings, which + * removes parameter names and unneceesary spaces. + */ + format(minimal?: boolean): Array { + const format = minimal ? "minimal" : "full"; + const abi = this.fragments.map((f) => f.format(format)); + return abi; + } + + /** + * Return the JSON-encoded ABI. This is the format Solidiy + * returns. + */ + formatJson(): string { + const abi = this.fragments.map((f) => f.format("json")); + + // We need to re-bundle the JSON fragments a bit + return JSON.stringify(abi.map((j) => JSON.parse(j))); + } + + /** + * The ABI coder that will be used to encode and decode binary + * data. + */ + getAbiCoder(): AbiCoder { + return AbiCoder.defaultAbiCoder(); + } + + // Find a function definition by any means necessary (unless it is ambiguous) + #getFunction( + key: string, + values: null | Array, + forceUnique: boolean, + ): null | FunctionFragment { + // Selector + if (isHexString(key)) { + const selector = key.toLowerCase(); + for (const fragment of this.#functions.values()) { + if (selector === fragment.selector) { + return fragment; + } + } + return null; + } + + // It is a bare name, look up the function (will return null if ambiguous) + if (key.indexOf("(") === -1) { + const matching: Array = []; + for (const [name, fragment] of this.#functions) { + if (name.split("(" /* fix:) */)[0] === key) { + matching.push(fragment); + } + } + + if (values) { + const lastValue = values.length > 0 ? values[values.length - 1] : null; + + let valueLength = values.length; + let allowOptions = true; + if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { + allowOptions = false; + valueLength--; + } + + // Remove all matches that don't have a compatible length. The args + // may contain an overrides, so the match may have n or n - 1 parameters + for (let i = matching.length - 1; i >= 0; i--) { + const inputs = matching[i].inputs.length; + if ( + inputs !== valueLength && + (!allowOptions || inputs !== valueLength - 1) + ) { + matching.splice(i, 1); + } + } + + // Remove all matches that don't match the Typed signature + for (let i = matching.length - 1; i >= 0; i--) { + const inputs = matching[i].inputs; + for (let j = 0; j < values.length; j++) { + // Not a typed value + if (!Typed.isTyped(values[j])) { + continue; + } + + // We are past the inputs + if (j >= inputs.length) { + if (values[j].type === "overrides") { + continue; + } + matching.splice(i, 1); + break; + } + + // Make sure the value type matches the input type + if (values[j].type !== inputs[j].baseType) { + matching.splice(i, 1); + break; + } + } + } + } + // We found a single matching signature with an overrides, but the + // last value is something that cannot possibly be an options + if ( + matching.length === 1 && + values && + values.length !== matching[0].inputs.length + ) { + const lastArg = values[values.length - 1]; + if ( + lastArg == null || + Array.isArray(lastArg) || + typeof lastArg !== "object" + ) { + matching.splice(0, 1); + } + } + + if (matching.length === 0) { + return null; + } + + if (matching.length > 1 && forceUnique) { + const matchStr = matching + .map((m) => JSON.stringify(m.format())) + .join(", "); + assertArgument( + false, + `ambiguous function description (i.e. matches ${matchStr})`, + "key", + key, + ); + } + + return matching[0]; + } + + // Normalize the signature and lookup the function + const result = this.#functions.get(FunctionFragment.from(key).format()); + if (result) { + return result; + } + + return null; + } + + /** + * Get the function name for %%key%%, which may be a function selector, + * function name or function signature that belongs to the ABI. + */ + getFunctionName(key: string): string { + const fragment = this.#getFunction(key, null, false); + assertArgument(fragment, "no matching function", "key", key); + return fragment.name; + } + + /** + * Returns true if %%key%% (a function selector, function name or + * function signature) is present in the ABI. + * + * In the case of a function name, the name may be ambiguous, so + * accessing the [[FunctionFragment]] may require refinement. + */ + hasFunction(key: string): boolean { + return !!this.#getFunction(key, null, false); + } + + /** + * Get the [[FunctionFragment]] for %%key%%, which may be a function + * selector, function name or function signature that belongs to the ABI. + * + * If %%values%% is provided, it will use the Typed API to handle + * ambiguous cases where multiple functions match by name. + * + * If the %%key%% and %%values%% do not refine to a single function in + * the ABI, this will throw. + */ + getFunction( + key: string, + values?: Array, + ): null | FunctionFragment { + return this.#getFunction(key, values || null, true); + } + + /** + * Iterate over all functions, calling %%callback%%, sorted by their name. + */ + forEachFunction( + callback: (func: FunctionFragment, index: number) => void, + ): void { + const names = Array.from(this.#functions.keys()); + names.sort((a, b) => a.localeCompare(b)); + for (let i = 0; i < names.length; i++) { + const name = names[i]; + callback(this.#functions.get(name), i); + } + } + + // Find an event definition by any means necessary (unless it is ambiguous) + #getEvent( + key: string, + values: null | Array, + forceUnique: boolean, + ): null | EventFragment { + // EventTopic + if (isHexString(key)) { + const eventTopic = key.toLowerCase(); + for (const fragment of this.#events.values()) { + if (eventTopic === fragment.topicHash) { + return fragment; + } + } + return null; + } + + // It is a bare name, look up the function (will return null if ambiguous) + if (key.indexOf("(") === -1) { + const matching: any = []; + for (const [name, fragment] of this.#events) { + if (name.split("(" /* fix:) */)[0] === key) { + matching.push(fragment); + } + } + + if (values) { + // Remove all matches that don't have a compatible length. + for (let i = matching.length - 1; i >= 0; i--) { + if (matching[i].inputs.length < values.length) { + matching.splice(i, 1); + } + } + + // Remove all matches that don't match the Typed signature + for (let i = matching.length - 1; i >= 0; i--) { + const inputs = matching[i].inputs; + for (let j = 0; j < values.length; j++) { + // Not a typed value + if (!Typed.isTyped(values[j])) { + continue; + } + + // Make sure the value type matches the input type + if (values[j].type !== inputs[j].baseType) { + matching.splice(i, 1); + break; + } + } + } + } + + if (matching.length === 0) { + return null; + } + + if (matching.length > 1 && forceUnique) { + const matchStr = matching + .map((m: any) => JSON.stringify(m.format())) + .join(", "); + assertArgument( + false, + `ambiguous event description (i.e. matches ${matchStr})`, + "key", + key, + ); + } + + return matching[0]; + } + + // Normalize the signature and lookup the function + const result = this.#events.get(EventFragment.from(key).format()); + if (result) { + return result; + } + + return null; + } + + /** + * Get the event name for %%key%%, which may be a topic hash, + * event name or event signature that belongs to the ABI. + */ + getEventName(key: string): string { + const fragment = this.#getEvent(key, null, false); + assertArgument(fragment, "no matching event", "key", key); + + return fragment.name; + } + + /** + * Returns true if %%key%% (an event topic hash, event name or + * event signature) is present in the ABI. + * + * In the case of an event name, the name may be ambiguous, so + * accessing the [[EventFragment]] may require refinement. + */ + hasEvent(key: string): boolean { + return !!this.#getEvent(key, null, false); + } + + /** + * Get the [[EventFragment]] for %%key%%, which may be a topic hash, + * event name or event signature that belongs to the ABI. + * + * If %%values%% is provided, it will use the Typed API to handle + * ambiguous cases where multiple events match by name. + * + * If the %%key%% and %%values%% do not refine to a single event in + * the ABI, this will throw. + */ + getEvent(key: string, values?: Array): null | EventFragment { + return this.#getEvent(key, values || null, true); + } + + /** + * Iterate over all events, calling %%callback%%, sorted by their name. + */ + forEachEvent(callback: (func: EventFragment, index: number) => void): void { + const names = Array.from(this.#events.keys()); + names.sort((a, b) => a.localeCompare(b)); + for (let i = 0; i < names.length; i++) { + const name = names[i]; + callback(this.#events.get(name), i); + } + } + + /** + * Get the [[ErrorFragment]] for %%key%%, which may be an error + * selector, error name or error signature that belongs to the ABI. + * + * If %%values%% is provided, it will use the Typed API to handle + * ambiguous cases where multiple errors match by name. + * + * If the %%key%% and %%values%% do not refine to a single error in + * the ABI, this will throw. + */ + getError(key: string, values?: Array): null | ErrorFragment { + if (isHexString(key)) { + const selector = key.toLowerCase(); + + if (BuiltinErrors[selector]) { + return ErrorFragment.from(BuiltinErrors[selector].signature); + } + + for (const fragment of this.#errors.values()) { + if (selector === fragment.selector) { + return fragment; + } + } + + return null; + } + + // It is a bare name, look up the function (will return null if ambiguous) + if (key.indexOf("(") === -1) { + const matching: any = []; + for (const [name, fragment] of this.#errors) { + if (name.split("(" /* fix:) */)[0] === key) { + matching.push(fragment); + } + } + + if (matching.length === 0) { + if (key === "Error") { + return ErrorFragment.from("error Error(string)"); + } + if (key === "Panic") { + return ErrorFragment.from("error Panic(uint256)"); + } + return null; + } else if (matching.length > 1) { + const matchStr = matching + .map((m: any) => JSON.stringify(m.format())) + .join(", "); + assertArgument( + false, + `ambiguous error description (i.e. ${matchStr})`, + "name", + key, + ); + } + + return matching[0]; + } + + // Normalize the signature and lookup the function + key = ErrorFragment.from(key).format(); + if (key === "Error(string)") { + return ErrorFragment.from("error Error(string)"); + } + if (key === "Panic(uint256)") { + return ErrorFragment.from("error Panic(uint256)"); + } + + const result = this.#errors.get(key); + if (result) { + return result; + } + + return null; + } + + /** + * Iterate over all errors, calling %%callback%%, sorted by their name. + */ + forEachError(callback: (func: ErrorFragment, index: number) => void): void { + const names = Array.from(this.#errors.keys()); + names.sort((a, b) => a.localeCompare(b)); + for (let i = 0; i < names.length; i++) { + const name = names[i]; + callback(this.#errors.get(name), i); + } + } + + // Get the 4-byte selector used by Solidity to identify a function + /* getSelector(fragment: ErrorFragment | FunctionFragment): string { if (typeof(fragment) === "string") { const matches: Array = [ ]; @@ -777,232 +776,232 @@ export class Interface { } */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* + // Get the 32-byte topic hash used by Solidity to identify an event + /* getEventTopic(fragment: EventFragment): string { //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } return id(fragment.format()); } */ - _decodeParams(params: ReadonlyArray, data: BytesLike): Result { - return this.#abiCoder.decode(params, data); - } - - _encodeParams( - params: ReadonlyArray, - values: ReadonlyArray, - ): string { - return this.#abiCoder.encode(params, values); - } - - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values?: ReadonlyArray): string { - return this._encodeParams(this.deploy.inputs, values || []); - } - - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - - assertArgument( - dataSlice(data, 0, 4) === fragment.selector, - `data signature does not match error ${fragment.name}.`, - "data", - data, - ); - - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult( - fragment: ErrorFragment | string, - values?: ReadonlyArray, - ): string { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]) as string; - } - - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData( - fragment: FunctionFragment | string, - data: BytesLike, - ): Result { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - - assertArgument( - dataSlice(data, 0, 4) === fragment.selector, - `data signature does not match function ${fragment.name}.`, - "data", - data, - ); - - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData( - fragment: FunctionFragment | string, - values?: ReadonlyArray, - ): string { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]) as string; - } - - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult( - fragment: FunctionFragment | string, - data: BytesLike, - ): Result { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - - let message = "invalid length for result data"; - - const bytes = getBytesCopy(data); - if (bytes.length % 32 === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } catch (error) { - message = "could not decode result data"; - } - } - - // Call returned data with no error, but the data is junk - assert(false, message, "BAD_DATA", { - value: hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() }, - }); - } - - makeError( - _data: BytesLike, - tx: CallExceptionTransaction, - ): CallExceptionError { - const data = getBytes(_data, "data"); - - const error = AbiCoder.getBuiltinCallException("call", tx, data); - - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, - signature: ef.format(), - args, - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args, - }; - } - - return error; - } - - /** - * Encodes the result data (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult( - fragment: FunctionFragment | string, - values?: ReadonlyArray, - ): string { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* + _decodeParams(params: ReadonlyArray, data: BytesLike): Result { + return this.#abiCoder.decode(params, data); + } + + _encodeParams( + params: ReadonlyArray, + values: ReadonlyArray, + ): string { + return this.#abiCoder.encode(params, values); + } + + /** + * Encodes a ``tx.data`` object for deploying the Contract with + * the %%values%% as the constructor arguments. + */ + encodeDeploy(values?: ReadonlyArray): string { + return this._encodeParams(this.deploy.inputs, values || []); + } + + /** + * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the + * specified error (see [[getError]] for valid values for + * %%key%%). + * + * Most developers should prefer the [[parseCallResult]] method instead, + * which will automatically detect a ``CALL_EXCEPTION`` and throw the + * corresponding error. + */ + decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result { + if (typeof fragment === "string") { + const f = this.getError(fragment); + assertArgument(f, "unknown error", "fragment", fragment); + fragment = f; + } + + assertArgument( + dataSlice(data, 0, 4) === fragment.selector, + `data signature does not match error ${fragment.name}.`, + "data", + data, + ); + + return this._decodeParams(fragment.inputs, dataSlice(data, 4)); + } + + /** + * Encodes the transaction revert data for a call result that + * reverted from the the Contract with the sepcified %%error%% + * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. + * + * This is generally not used by most developers, unless trying to mock + * a result from a Contract. + */ + encodeErrorResult( + fragment: ErrorFragment | string, + values?: ReadonlyArray, + ): string { + if (typeof fragment === "string") { + const f = this.getError(fragment); + assertArgument(f, "unknown error", "fragment", fragment); + fragment = f; + } + + return concat([ + fragment.selector, + this._encodeParams(fragment.inputs, values || []), + ]) as string; + } + + /** + * Decodes the %%data%% from a transaction ``tx.data`` for + * the function specified (see [[getFunction]] for valid values + * for %%fragment%%). + * + * Most developers should prefer the [[parseTransaction]] method + * instead, which will automatically detect the fragment. + */ + decodeFunctionData( + fragment: FunctionFragment | string, + data: BytesLike, + ): Result { + if (typeof fragment === "string") { + const f = this.getFunction(fragment); + assertArgument(f, "unknown function", "fragment", fragment); + fragment = f; + } + + assertArgument( + dataSlice(data, 0, 4) === fragment.selector, + `data signature does not match function ${fragment.name}.`, + "data", + data, + ); + + return this._decodeParams(fragment.inputs, dataSlice(data, 4)); + } + + /** + * Encodes the ``tx.data`` for a transaction that calls the function + * specified (see [[getFunction]] for valid values for %%fragment%%) with + * the %%values%%. + */ + encodeFunctionData( + fragment: FunctionFragment | string, + values?: ReadonlyArray, + ): string { + if (typeof fragment === "string") { + const f = this.getFunction(fragment); + assertArgument(f, "unknown function", "fragment", fragment); + fragment = f; + } + + return concat([ + fragment.selector, + this._encodeParams(fragment.inputs, values || []), + ]) as string; + } + + /** + * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the + * specified function (see [[getFunction]] for valid values for + * %%key%%). + * + * Most developers should prefer the [[parseCallResult]] method instead, + * which will automatically detect a ``CALL_EXCEPTION`` and throw the + * corresponding error. + */ + decodeFunctionResult( + fragment: FunctionFragment | string, + data: BytesLike, + ): Result { + if (typeof fragment === "string") { + const f = this.getFunction(fragment); + assertArgument(f, "unknown function", "fragment", fragment); + fragment = f; + } + + let message = "invalid length for result data"; + + const bytes = getBytesCopy(data); + if (bytes.length % 32 === 0) { + try { + return this.#abiCoder.decode(fragment.outputs, bytes); + } catch (error) { + message = "could not decode result data"; + } + } + + // Call returned data with no error, but the data is junk + assert(false, message, "BAD_DATA", { + value: hexlify(bytes), + info: { method: fragment.name, signature: fragment.format() }, + }); + } + + makeError( + _data: BytesLike, + tx: CallExceptionTransaction, + ): CallExceptionError { + const data = getBytes(_data, "data"); + + const error = AbiCoder.getBuiltinCallException("call", tx, data); + + // Not a built-in error; try finding a custom error + const customPrefix = "execution reverted (unknown custom error)"; + if (error.message.startsWith(customPrefix)) { + const selector = hexlify(data.slice(0, 4)); + + const ef = this.getError(selector); + if (ef) { + try { + const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); + error.revert = { + name: ef.name, + signature: ef.format(), + args, + }; + error.reason = error.revert.signature; + error.message = `execution reverted: ${error.reason}`; + } catch (e) { + error.message = `execution reverted (coult not decode custom error)`; + } + } + } + + // Add the invocation, if available + const parsed = this.parseTransaction(tx); + if (parsed) { + error.invocation = { + method: parsed.name, + signature: parsed.signature, + args: parsed.args, + }; + } + + return error; + } + + /** + * Encodes the result data (e.g. from an ``xcb_call``) for the + * specified function (see [[getFunction]] for valid values + * for %%fragment%%) with %%values%%. + * + * This is generally not used by most developers, unless trying to mock + * a result from a Contract. + */ + encodeFunctionResult( + fragment: FunctionFragment | string, + values?: ReadonlyArray, + ): string { + if (typeof fragment === "string") { + const f = this.getFunction(fragment); + assertArgument(f, "unknown function", "fragment", fragment); + fragment = f; + } + return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); + } + /* spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { const promises: Array> = [ ]; const process = function(type: ParamType, value: any): any { @@ -1031,322 +1030,322 @@ export class Interface { }); } */ - // Create the filter for the event with search criteria (e.g. for xcb_filterLog) - encodeFilterTopics( - fragment: EventFragment | string, - values: ReadonlyArray, - ): Array> { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - - assert( - values.length <= fragment.inputs.length, - `too many arguments for ${fragment.format()}`, - "UNEXPECTED_ARGUMENT", - { count: values.length, expectedCount: fragment.inputs.length }, - ); - - const topics: Array> = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param: ParamType, value: any): string => { - if (param.type === "string") { - return id(value); - } else if (param.type === "bytes") { - return sha256(hexlify(value)); - } - - if (param.type === "bool" && typeof value === "boolean") { - value = value ? "0x01" : "0x00"; - } - - if (param.type.match(/^u?int/)) { - value = toBeHex(value); - } - - // Check addresses are valid - if (param.type === "address") { - this.#abiCoder.encode(["address"], [value]); - } - return zeroPadValue(hexlify(value), 32); - //@TOOD should probably be return toHex(value, 32) - }; - - values.forEach((value, index) => { - const param = (fragment).inputs[index]; - - if (!param.indexed) { - assertArgument( - value == null, - "cannot filter non-indexed parameters; must be null", - "contract." + param.name, - value, - ); - return; - } - - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument( - false, - "filtering with tuples or arrays not supported", - "contract." + param.name, - value, - ); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - - return topics; - } - - encodeEventLog( - fragment: EventFragment | string, - values: ReadonlyArray, - ): { data: string; topics: Array } { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - - const topics: Array = []; - - const dataTypes: Array = []; - const dataValues: Array = []; - - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - - assertArgument( - values.length === fragment.inputs.length, - "event arguments/values mismatch", - "values", - values, - ); - - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)); - } else if (param.type === "bytes") { - topics.push(sha256(value)); - } else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } else { - dataTypes.push(param); - dataValues.push(value); - } - }); - - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics, - }; - } - - // Decode a filter for the event and the search criteria - decodeEventLog( - fragment: EventFragment | string, - data: BytesLike, - topics?: ReadonlyArray, - ): Result { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument( - isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, - "fragment/topic mismatch", - "topics[0]", - topics[0], - ); - topics = topics.slice(1); - } - - const indexed: Array = []; - const nonIndexed: Array = []; - const dynamic: Array = []; - - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if ( - param.type === "string" || - param.type === "bytes" || - param.baseType === "tuple" || - param.baseType === "array" - ) { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } else { - indexed.push(param); - dynamic.push(false); - } - } else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - - const resultIndexed = - topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values: Array = []; - const keys: Array = []; - let nonIndexedIndex = 0, - indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value: any = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } else { - try { - value = resultIndexed[indexedIndex++]; - } catch (error) { - value = error; - } - } - } else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } catch (error) { - value = error; - } - } - - values.push(value); - keys.push(param.name || null); - }); - - return Result.fromItems(values, keys); - } - - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx: { - data: string; - value?: BigNumberish; - }): null | TransactionDescription { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); - - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - - if (!fragment) { - return null; - } - - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - - parseCallResult(data: BytesLike): Result { - throw new Error("@TODO"); - } - - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log: { - topics: Array; - data: string; - }): null | LogDescription { - const fragment = this.getEvent(log.topics[0]); - - if (!fragment || fragment.anonymous) { - return null; - } - - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - - return new LogDescription( - fragment, - fragment.topicHash, - this.decodeEventLog(fragment, log.data, log.topics), - ); - } - - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data: BytesLike): null | ErrorDescription { - const hexData = hexlify(data); - - const fragment = this.getError(dataSlice(hexData, 0, 4)); - - if (!fragment) { - return null; - } - - const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value: InterfaceAbi | Interface): Interface { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - - // JSON - if (typeof value === "string") { - return new Interface(JSON.parse(value)); - } - - // Maybe an interface from an older version, or from a symlinked copy - if (typeof (value).format === "function") { - return new Interface((value).format("json")); - } - - // Array of fragments - return new Interface(value); - } + // Create the filter for the event with search criteria (e.g. for xcb_filterLog) + encodeFilterTopics( + fragment: EventFragment | string, + values: ReadonlyArray, + ): Array> { + if (typeof fragment === "string") { + const f = this.getEvent(fragment); + assertArgument(f, "unknown event", "eventFragment", fragment); + fragment = f; + } + + assert( + values.length <= fragment.inputs.length, + `too many arguments for ${fragment.format()}`, + "UNEXPECTED_ARGUMENT", + { count: values.length, expectedCount: fragment.inputs.length }, + ); + + const topics: Array> = []; + if (!fragment.anonymous) { + topics.push(fragment.topicHash); + } + + // @TODO: Use the coders for this; to properly support tuples, etc. + const encodeTopic = (param: ParamType, value: any): string => { + if (param.type === "string") { + return id(value); + } else if (param.type === "bytes") { + return sha256(hexlify(value)); + } + + if (param.type === "bool" && typeof value === "boolean") { + value = value ? "0x01" : "0x00"; + } + + if (param.type.match(/^u?int/)) { + value = toBeHex(value); + } + + // Check addresses are valid + if (param.type === "address") { + this.#abiCoder.encode(["address"], [value]); + } + return zeroPadValue(hexlify(value), 32); + //@TOOD should probably be return toHex(value, 32) + }; + + values.forEach((value, index) => { + const param = (fragment).inputs[index]; + + if (!param.indexed) { + assertArgument( + value == null, + "cannot filter non-indexed parameters; must be null", + "contract." + param.name, + value, + ); + return; + } + + if (value == null) { + topics.push(null); + } else if (param.baseType === "array" || param.baseType === "tuple") { + assertArgument( + false, + "filtering with tuples or arrays not supported", + "contract." + param.name, + value, + ); + } else if (Array.isArray(value)) { + topics.push(value.map((value) => encodeTopic(param, value))); + } else { + topics.push(encodeTopic(param, value)); + } + }); + + // Trim off trailing nulls + while (topics.length && topics[topics.length - 1] === null) { + topics.pop(); + } + + return topics; + } + + encodeEventLog( + fragment: EventFragment | string, + values: ReadonlyArray, + ): { data: string; topics: Array } { + if (typeof fragment === "string") { + const f = this.getEvent(fragment); + assertArgument(f, "unknown event", "eventFragment", fragment); + fragment = f; + } + + const topics: Array = []; + + const dataTypes: Array = []; + const dataValues: Array = []; + + if (!fragment.anonymous) { + topics.push(fragment.topicHash); + } + + assertArgument( + values.length === fragment.inputs.length, + "event arguments/values mismatch", + "values", + values, + ); + + fragment.inputs.forEach((param, index) => { + const value = values[index]; + if (param.indexed) { + if (param.type === "string") { + topics.push(id(value)); + } else if (param.type === "bytes") { + topics.push(sha256(value)); + } else if (param.baseType === "tuple" || param.baseType === "array") { + // @TODO + throw new Error("not implemented"); + } else { + topics.push(this.#abiCoder.encode([param.type], [value])); + } + } else { + dataTypes.push(param); + dataValues.push(value); + } + }); + + return { + data: this.#abiCoder.encode(dataTypes, dataValues), + topics: topics, + }; + } + + // Decode a filter for the event and the search criteria + decodeEventLog( + fragment: EventFragment | string, + data: BytesLike, + topics?: ReadonlyArray, + ): Result { + if (typeof fragment === "string") { + const f = this.getEvent(fragment); + assertArgument(f, "unknown event", "eventFragment", fragment); + fragment = f; + } + + if (topics != null && !fragment.anonymous) { + const eventTopic = fragment.topicHash; + assertArgument( + isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, + "fragment/topic mismatch", + "topics[0]", + topics[0], + ); + topics = topics.slice(1); + } + + const indexed: Array = []; + const nonIndexed: Array = []; + const dynamic: Array = []; + + fragment.inputs.forEach((param, index) => { + if (param.indexed) { + if ( + param.type === "string" || + param.type === "bytes" || + param.baseType === "tuple" || + param.baseType === "array" + ) { + indexed.push(ParamType.from({ type: "bytes32", name: param.name })); + dynamic.push(true); + } else { + indexed.push(param); + dynamic.push(false); + } + } else { + nonIndexed.push(param); + dynamic.push(false); + } + }); + + const resultIndexed = + topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null; + const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); + + //const result: (Array & { [ key: string ]: any }) = [ ]; + const values: Array = []; + const keys: Array = []; + let nonIndexedIndex = 0, + indexedIndex = 0; + fragment.inputs.forEach((param, index) => { + let value: any = null; + if (param.indexed) { + if (resultIndexed == null) { + value = new Indexed(null); + } else if (dynamic[index]) { + value = new Indexed(resultIndexed[indexedIndex++]); + } else { + try { + value = resultIndexed[indexedIndex++]; + } catch (error) { + value = error; + } + } + } else { + try { + value = resultNonIndexed[nonIndexedIndex++]; + } catch (error) { + value = error; + } + } + + values.push(value); + keys.push(param.name || null); + }); + + return Result.fromItems(values, keys); + } + + /** + * Parses a transaction, finding the matching function and extracts + * the parameter values along with other useful function details. + * + * If the matching function cannot be found, return null. + */ + parseTransaction(tx: { + data: string; + value?: BigNumberish; + }): null | TransactionDescription { + const data = getBytes(tx.data, "tx.data"); + const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); + + const fragment = this.getFunction(hexlify(data.slice(0, 4))); + + if (!fragment) { + return null; + } + + const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); + return new TransactionDescription(fragment, fragment.selector, args, value); + } + + parseCallResult(data: BytesLike): Result { + throw new Error("@TODO"); + } + + /** + * Parses a receipt log, finding the matching event and extracts + * the parameter values along with other useful event details. + * + * If the matching event cannot be found, returns null. + */ + parseLog(log: { + topics: Array; + data: string; + }): null | LogDescription { + const fragment = this.getEvent(log.topics[0]); + + if (!fragment || fragment.anonymous) { + return null; + } + + // @TODO: If anonymous, and the only method, and the input count matches, should we parse? + // Probably not, because just because it is the only event in the ABI does + // not mean we have the full ABI; maybe just a fragment? + + return new LogDescription( + fragment, + fragment.topicHash, + this.decodeEventLog(fragment, log.data, log.topics), + ); + } + + /** + * Parses a revert data, finding the matching error and extracts + * the parameter values along with other useful error details. + * + * If the matching event cannot be found, returns null. + */ + parseError(data: BytesLike): null | ErrorDescription { + const hexData = hexlify(data); + + const fragment = this.getError(dataSlice(hexData, 0, 4)); + + if (!fragment) { + return null; + } + + const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); + return new ErrorDescription(fragment, fragment.selector, args); + } + + /** + * Creates a new [[Interface]] from the ABI %%value%%. + * + * The %%value%% may be provided as an existing [[Interface]] object, + * a JSON-encoded ABI or any Human-Readable ABI format. + */ + static from(value: InterfaceAbi | Interface): Interface { + // Already an Interface, which is immutable + if (value instanceof Interface) { + return value; + } + + // JSON + if (typeof value === "string") { + return new Interface(JSON.parse(value)); + } + + // Maybe an interface from an older version, or from a symlinked copy + if (typeof (value).format === "function") { + return new Interface((value).format("json")); + } + + // Array of fragments + return new Interface(value); + } } diff --git a/src.ts/abi/typed.ts b/src.ts/abi/typed.ts index a4cfc97fb..a21eac76c 100644 --- a/src.ts/abi/typed.ts +++ b/src.ts/abi/typed.ts @@ -23,482 +23,482 @@ import type { Result } from "./coders/abstract-coder.js"; const _gaurd = {}; function n(value: BigNumberish, width: number): Typed { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { - signed, - width, - }); + let signed = false; + if (width < 0) { + signed = true; + width *= -1; + } + + // @TODO: Check range is valid for value + return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { + signed, + width, + }); } function b(value: BytesLike, size?: number): Typed { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size }); + // @TODO: Check range is valid for value + return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size }); } export interface TypedNumber extends Typed { - value: number; - defaultValue(): number; - minValue(): number; - maxValue(): number; + value: number; + defaultValue(): number; + minValue(): number; + maxValue(): number; } export interface TypedBigInt extends Typed { - value: bigint; - defaultValue(): bigint; - minValue(): bigint; - maxValue(): bigint; + value: bigint; + defaultValue(): bigint; + minValue(): bigint; + maxValue(): bigint; } export interface TypedData extends Typed { - value: string; - defaultValue(): string; + value: string; + defaultValue(): string; } export interface TypedString extends Typed { - value: string; - defaultValue(): string; + value: string; + defaultValue(): string; } const _typedSymbol = Symbol.for("_corebc_typed"); export class Typed { - readonly type!: string; - readonly value!: any; - - readonly #options: any; - - readonly _typedSymbol!: Symbol; - - constructor(gaurd: any, type: string, value: any, options?: any) { - if (options == null) { - options = null; - } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - - // Check the value is valid - this.format(); - } - - format(): string { - if (this.type === "array") { - throw new Error(""); - } else if (this.type === "dynamicArray") { - throw new Error(""); - } else if (this.type === "tuple") { - return `tuple(${this.value.map((v: Typed) => v.format()).join(",")})`; - } - - return this.type; - } - - defaultValue(): string | number | bigint | Result { - return 0; - } - - minValue(): string | number | bigint { - return 0; - } - - maxValue(): string | number | bigint { - return 0; - } - - isBigInt(): this is TypedBigInt { - return !!this.type.match(/^u?int[0-9]+$/); - } - - isData(): this is TypedData { - return this.type.startsWith("bytes"); - } - - isString(): this is TypedString { - return this.type === "string"; - } - - get tupleName(): null | string { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - get arrayLength(): null | number { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return (>this.value).length; - } - return null; - } - - static from(type: string, value: any): Typed { - return new Typed(_gaurd, type, value); - } - - static uint8(v: BigNumberish): Typed { - return n(v, 8); - } - static uint16(v: BigNumberish): Typed { - return n(v, 16); - } - static uint24(v: BigNumberish): Typed { - return n(v, 24); - } - static uint32(v: BigNumberish): Typed { - return n(v, 32); - } - static uint40(v: BigNumberish): Typed { - return n(v, 40); - } - static uint48(v: BigNumberish): Typed { - return n(v, 48); - } - static uint56(v: BigNumberish): Typed { - return n(v, 56); - } - static uint64(v: BigNumberish): Typed { - return n(v, 64); - } - static uint72(v: BigNumberish): Typed { - return n(v, 72); - } - static uint80(v: BigNumberish): Typed { - return n(v, 80); - } - static uint88(v: BigNumberish): Typed { - return n(v, 88); - } - static uint96(v: BigNumberish): Typed { - return n(v, 96); - } - static uint104(v: BigNumberish): Typed { - return n(v, 104); - } - static uint112(v: BigNumberish): Typed { - return n(v, 112); - } - static uint120(v: BigNumberish): Typed { - return n(v, 120); - } - static uint128(v: BigNumberish): Typed { - return n(v, 128); - } - static uint136(v: BigNumberish): Typed { - return n(v, 136); - } - static uint144(v: BigNumberish): Typed { - return n(v, 144); - } - static uint152(v: BigNumberish): Typed { - return n(v, 152); - } - static uint160(v: BigNumberish): Typed { - return n(v, 160); - } - static uint168(v: BigNumberish): Typed { - return n(v, 168); - } - static uint176(v: BigNumberish): Typed { - return n(v, 176); - } - static uint184(v: BigNumberish): Typed { - return n(v, 184); - } - static uint192(v: BigNumberish): Typed { - return n(v, 192); - } - static uint200(v: BigNumberish): Typed { - return n(v, 200); - } - static uint208(v: BigNumberish): Typed { - return n(v, 208); - } - static uint216(v: BigNumberish): Typed { - return n(v, 216); - } - static uint224(v: BigNumberish): Typed { - return n(v, 224); - } - static uint232(v: BigNumberish): Typed { - return n(v, 232); - } - static uint240(v: BigNumberish): Typed { - return n(v, 240); - } - static uint248(v: BigNumberish): Typed { - return n(v, 248); - } - static uint256(v: BigNumberish): Typed { - return n(v, 256); - } - static uint(v: BigNumberish): Typed { - return n(v, 256); - } - - static int8(v: BigNumberish): Typed { - return n(v, -8); - } - static int16(v: BigNumberish): Typed { - return n(v, -16); - } - static int24(v: BigNumberish): Typed { - return n(v, -24); - } - static int32(v: BigNumberish): Typed { - return n(v, -32); - } - static int40(v: BigNumberish): Typed { - return n(v, -40); - } - static int48(v: BigNumberish): Typed { - return n(v, -48); - } - static int56(v: BigNumberish): Typed { - return n(v, -56); - } - static int64(v: BigNumberish): Typed { - return n(v, -64); - } - static int72(v: BigNumberish): Typed { - return n(v, -72); - } - static int80(v: BigNumberish): Typed { - return n(v, -80); - } - static int88(v: BigNumberish): Typed { - return n(v, -88); - } - static int96(v: BigNumberish): Typed { - return n(v, -96); - } - static int104(v: BigNumberish): Typed { - return n(v, -104); - } - static int112(v: BigNumberish): Typed { - return n(v, -112); - } - static int120(v: BigNumberish): Typed { - return n(v, -120); - } - static int128(v: BigNumberish): Typed { - return n(v, -128); - } - static int136(v: BigNumberish): Typed { - return n(v, -136); - } - static int144(v: BigNumberish): Typed { - return n(v, -144); - } - static int152(v: BigNumberish): Typed { - return n(v, -152); - } - static int160(v: BigNumberish): Typed { - return n(v, -160); - } - static int168(v: BigNumberish): Typed { - return n(v, -168); - } - static int176(v: BigNumberish): Typed { - return n(v, -176); - } - static int184(v: BigNumberish): Typed { - return n(v, -184); - } - static int192(v: BigNumberish): Typed { - return n(v, -192); - } - static int200(v: BigNumberish): Typed { - return n(v, -200); - } - static int208(v: BigNumberish): Typed { - return n(v, -208); - } - static int216(v: BigNumberish): Typed { - return n(v, -216); - } - static int224(v: BigNumberish): Typed { - return n(v, -224); - } - static int232(v: BigNumberish): Typed { - return n(v, -232); - } - static int240(v: BigNumberish): Typed { - return n(v, -240); - } - static int248(v: BigNumberish): Typed { - return n(v, -248); - } - static int256(v: BigNumberish): Typed { - return n(v, -256); - } - static int(v: BigNumberish): Typed { - return n(v, -256); - } - - static bytes1(v: BytesLike): Typed { - return b(v, 1); - } - static bytes2(v: BytesLike): Typed { - return b(v, 2); - } - static bytes3(v: BytesLike): Typed { - return b(v, 3); - } - static bytes4(v: BytesLike): Typed { - return b(v, 4); - } - static bytes5(v: BytesLike): Typed { - return b(v, 5); - } - static bytes6(v: BytesLike): Typed { - return b(v, 6); - } - static bytes7(v: BytesLike): Typed { - return b(v, 7); - } - static bytes8(v: BytesLike): Typed { - return b(v, 8); - } - static bytes9(v: BytesLike): Typed { - return b(v, 9); - } - static bytes10(v: BytesLike): Typed { - return b(v, 10); - } - static bytes11(v: BytesLike): Typed { - return b(v, 11); - } - static bytes12(v: BytesLike): Typed { - return b(v, 12); - } - static bytes13(v: BytesLike): Typed { - return b(v, 13); - } - static bytes14(v: BytesLike): Typed { - return b(v, 14); - } - static bytes15(v: BytesLike): Typed { - return b(v, 15); - } - static bytes16(v: BytesLike): Typed { - return b(v, 16); - } - static bytes17(v: BytesLike): Typed { - return b(v, 17); - } - static bytes18(v: BytesLike): Typed { - return b(v, 18); - } - static bytes19(v: BytesLike): Typed { - return b(v, 19); - } - static bytes20(v: BytesLike): Typed { - return b(v, 20); - } - static bytes21(v: BytesLike): Typed { - return b(v, 21); - } - static bytes22(v: BytesLike): Typed { - return b(v, 22); - } - static bytes23(v: BytesLike): Typed { - return b(v, 23); - } - static bytes24(v: BytesLike): Typed { - return b(v, 24); - } - static bytes25(v: BytesLike): Typed { - return b(v, 25); - } - static bytes26(v: BytesLike): Typed { - return b(v, 26); - } - static bytes27(v: BytesLike): Typed { - return b(v, 27); - } - static bytes28(v: BytesLike): Typed { - return b(v, 28); - } - static bytes29(v: BytesLike): Typed { - return b(v, 29); - } - static bytes30(v: BytesLike): Typed { - return b(v, 30); - } - static bytes31(v: BytesLike): Typed { - return b(v, 31); - } - static bytes32(v: BytesLike): Typed { - return b(v, 32); - } - - static address(v: string | Addressable): Typed { - return new Typed(_gaurd, "address", v); - } - static bool(v: any): Typed { - return new Typed(_gaurd, "bool", !!v); - } - static bytes(v: BytesLike): Typed { - return new Typed(_gaurd, "bytes", v); - } - static string(v: string): Typed { - return new Typed(_gaurd, "string", v); - } - - static array(v: Array, dynamic?: null | boolean): Typed { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "array", v, dynamic); - } - - static tuple( - v: Array | Record, - name?: string, - ): Typed { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "tuple", v, name); - } - - static overrides(v: Record): Typed { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value: any): value is Typed { - return value && value._typedSymbol === _typedSymbol; - } - - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value: Typed | T, type: string): T { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } + readonly type!: string; + readonly value!: any; + + readonly #options: any; + + readonly _typedSymbol!: Symbol; + + constructor(gaurd: any, type: string, value: any, options?: any) { + if (options == null) { + options = null; + } + assertPrivate(_gaurd, gaurd, "Typed"); + defineProperties(this, { _typedSymbol, type, value }); + this.#options = options; + + // Check the value is valid + this.format(); + } + + format(): string { + if (this.type === "array") { + throw new Error(""); + } else if (this.type === "dynamicArray") { + throw new Error(""); + } else if (this.type === "tuple") { + return `tuple(${this.value.map((v: Typed) => v.format()).join(",")})`; + } + + return this.type; + } + + defaultValue(): string | number | bigint | Result { + return 0; + } + + minValue(): string | number | bigint { + return 0; + } + + maxValue(): string | number | bigint { + return 0; + } + + isBigInt(): this is TypedBigInt { + return !!this.type.match(/^u?int[0-9]+$/); + } + + isData(): this is TypedData { + return this.type.startsWith("bytes"); + } + + isString(): this is TypedString { + return this.type === "string"; + } + + get tupleName(): null | string { + if (this.type !== "tuple") { + throw TypeError("not a tuple"); + } + return this.#options; + } + + // Returns the length of this type as an array + // - `null` indicates the length is unforced, it could be dynamic + // - `-1` indicates the length is dynamic + // - any other value indicates it is a static array and is its length + get arrayLength(): null | number { + if (this.type !== "array") { + throw TypeError("not an array"); + } + if (this.#options === true) { + return -1; + } + if (this.#options === false) { + return (>this.value).length; + } + return null; + } + + static from(type: string, value: any): Typed { + return new Typed(_gaurd, type, value); + } + + static uint8(v: BigNumberish): Typed { + return n(v, 8); + } + static uint16(v: BigNumberish): Typed { + return n(v, 16); + } + static uint24(v: BigNumberish): Typed { + return n(v, 24); + } + static uint32(v: BigNumberish): Typed { + return n(v, 32); + } + static uint40(v: BigNumberish): Typed { + return n(v, 40); + } + static uint48(v: BigNumberish): Typed { + return n(v, 48); + } + static uint56(v: BigNumberish): Typed { + return n(v, 56); + } + static uint64(v: BigNumberish): Typed { + return n(v, 64); + } + static uint72(v: BigNumberish): Typed { + return n(v, 72); + } + static uint80(v: BigNumberish): Typed { + return n(v, 80); + } + static uint88(v: BigNumberish): Typed { + return n(v, 88); + } + static uint96(v: BigNumberish): Typed { + return n(v, 96); + } + static uint104(v: BigNumberish): Typed { + return n(v, 104); + } + static uint112(v: BigNumberish): Typed { + return n(v, 112); + } + static uint120(v: BigNumberish): Typed { + return n(v, 120); + } + static uint128(v: BigNumberish): Typed { + return n(v, 128); + } + static uint136(v: BigNumberish): Typed { + return n(v, 136); + } + static uint144(v: BigNumberish): Typed { + return n(v, 144); + } + static uint152(v: BigNumberish): Typed { + return n(v, 152); + } + static uint160(v: BigNumberish): Typed { + return n(v, 160); + } + static uint168(v: BigNumberish): Typed { + return n(v, 168); + } + static uint176(v: BigNumberish): Typed { + return n(v, 176); + } + static uint184(v: BigNumberish): Typed { + return n(v, 184); + } + static uint192(v: BigNumberish): Typed { + return n(v, 192); + } + static uint200(v: BigNumberish): Typed { + return n(v, 200); + } + static uint208(v: BigNumberish): Typed { + return n(v, 208); + } + static uint216(v: BigNumberish): Typed { + return n(v, 216); + } + static uint224(v: BigNumberish): Typed { + return n(v, 224); + } + static uint232(v: BigNumberish): Typed { + return n(v, 232); + } + static uint240(v: BigNumberish): Typed { + return n(v, 240); + } + static uint248(v: BigNumberish): Typed { + return n(v, 248); + } + static uint256(v: BigNumberish): Typed { + return n(v, 256); + } + static uint(v: BigNumberish): Typed { + return n(v, 256); + } + + static int8(v: BigNumberish): Typed { + return n(v, -8); + } + static int16(v: BigNumberish): Typed { + return n(v, -16); + } + static int24(v: BigNumberish): Typed { + return n(v, -24); + } + static int32(v: BigNumberish): Typed { + return n(v, -32); + } + static int40(v: BigNumberish): Typed { + return n(v, -40); + } + static int48(v: BigNumberish): Typed { + return n(v, -48); + } + static int56(v: BigNumberish): Typed { + return n(v, -56); + } + static int64(v: BigNumberish): Typed { + return n(v, -64); + } + static int72(v: BigNumberish): Typed { + return n(v, -72); + } + static int80(v: BigNumberish): Typed { + return n(v, -80); + } + static int88(v: BigNumberish): Typed { + return n(v, -88); + } + static int96(v: BigNumberish): Typed { + return n(v, -96); + } + static int104(v: BigNumberish): Typed { + return n(v, -104); + } + static int112(v: BigNumberish): Typed { + return n(v, -112); + } + static int120(v: BigNumberish): Typed { + return n(v, -120); + } + static int128(v: BigNumberish): Typed { + return n(v, -128); + } + static int136(v: BigNumberish): Typed { + return n(v, -136); + } + static int144(v: BigNumberish): Typed { + return n(v, -144); + } + static int152(v: BigNumberish): Typed { + return n(v, -152); + } + static int160(v: BigNumberish): Typed { + return n(v, -160); + } + static int168(v: BigNumberish): Typed { + return n(v, -168); + } + static int176(v: BigNumberish): Typed { + return n(v, -176); + } + static int184(v: BigNumberish): Typed { + return n(v, -184); + } + static int192(v: BigNumberish): Typed { + return n(v, -192); + } + static int200(v: BigNumberish): Typed { + return n(v, -200); + } + static int208(v: BigNumberish): Typed { + return n(v, -208); + } + static int216(v: BigNumberish): Typed { + return n(v, -216); + } + static int224(v: BigNumberish): Typed { + return n(v, -224); + } + static int232(v: BigNumberish): Typed { + return n(v, -232); + } + static int240(v: BigNumberish): Typed { + return n(v, -240); + } + static int248(v: BigNumberish): Typed { + return n(v, -248); + } + static int256(v: BigNumberish): Typed { + return n(v, -256); + } + static int(v: BigNumberish): Typed { + return n(v, -256); + } + + static bytes1(v: BytesLike): Typed { + return b(v, 1); + } + static bytes2(v: BytesLike): Typed { + return b(v, 2); + } + static bytes3(v: BytesLike): Typed { + return b(v, 3); + } + static bytes4(v: BytesLike): Typed { + return b(v, 4); + } + static bytes5(v: BytesLike): Typed { + return b(v, 5); + } + static bytes6(v: BytesLike): Typed { + return b(v, 6); + } + static bytes7(v: BytesLike): Typed { + return b(v, 7); + } + static bytes8(v: BytesLike): Typed { + return b(v, 8); + } + static bytes9(v: BytesLike): Typed { + return b(v, 9); + } + static bytes10(v: BytesLike): Typed { + return b(v, 10); + } + static bytes11(v: BytesLike): Typed { + return b(v, 11); + } + static bytes12(v: BytesLike): Typed { + return b(v, 12); + } + static bytes13(v: BytesLike): Typed { + return b(v, 13); + } + static bytes14(v: BytesLike): Typed { + return b(v, 14); + } + static bytes15(v: BytesLike): Typed { + return b(v, 15); + } + static bytes16(v: BytesLike): Typed { + return b(v, 16); + } + static bytes17(v: BytesLike): Typed { + return b(v, 17); + } + static bytes18(v: BytesLike): Typed { + return b(v, 18); + } + static bytes19(v: BytesLike): Typed { + return b(v, 19); + } + static bytes20(v: BytesLike): Typed { + return b(v, 20); + } + static bytes21(v: BytesLike): Typed { + return b(v, 21); + } + static bytes22(v: BytesLike): Typed { + return b(v, 22); + } + static bytes23(v: BytesLike): Typed { + return b(v, 23); + } + static bytes24(v: BytesLike): Typed { + return b(v, 24); + } + static bytes25(v: BytesLike): Typed { + return b(v, 25); + } + static bytes26(v: BytesLike): Typed { + return b(v, 26); + } + static bytes27(v: BytesLike): Typed { + return b(v, 27); + } + static bytes28(v: BytesLike): Typed { + return b(v, 28); + } + static bytes29(v: BytesLike): Typed { + return b(v, 29); + } + static bytes30(v: BytesLike): Typed { + return b(v, 30); + } + static bytes31(v: BytesLike): Typed { + return b(v, 31); + } + static bytes32(v: BytesLike): Typed { + return b(v, 32); + } + + static address(v: string | Addressable): Typed { + return new Typed(_gaurd, "address", v); + } + static bool(v: any): Typed { + return new Typed(_gaurd, "bool", !!v); + } + static bytes(v: BytesLike): Typed { + return new Typed(_gaurd, "bytes", v); + } + static string(v: string): Typed { + return new Typed(_gaurd, "string", v); + } + + static array(v: Array, dynamic?: null | boolean): Typed { + throw new Error("not implemented yet"); + return new Typed(_gaurd, "array", v, dynamic); + } + + static tuple( + v: Array | Record, + name?: string, + ): Typed { + throw new Error("not implemented yet"); + return new Typed(_gaurd, "tuple", v, name); + } + + static overrides(v: Record): Typed { + return new Typed(_gaurd, "overrides", Object.assign({}, v)); + } + + /** + * Returns true only if %%value%% is a [[Typed]] instance. + */ + static isTyped(value: any): value is Typed { + return value && value._typedSymbol === _typedSymbol; + } + + /** + * If the value is a [[Typed]] instance, validates the underlying value + * and returns it, otherwise returns value directly. + * + * This is useful for functions that with to accept either a [[Typed]] + * object or values. + */ + static dereference(value: Typed | T, type: string): T { + if (Typed.isTyped(value)) { + if (value.type !== type) { + throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); + } + return value.value; + } + return value; + } } diff --git a/src.ts/address/checks.ts b/src.ts/address/checks.ts index 165b7bf56..18ff581a2 100644 --- a/src.ts/address/checks.ts +++ b/src.ts/address/checks.ts @@ -17,7 +17,7 @@ import { Addressable, AddressLike, getAddress } from "./index.js"; * //_result: */ export function isAddressable(value: any): value is Addressable { - return value && typeof value.getAddress === "function"; + return value && typeof value.getAddress === "function"; } /** @@ -46,36 +46,36 @@ export function isAddressable(value: any): value is Addressable { * //_result: */ export function isAddress(value: any): value is string { - try { - getAddress(value); - return true; - } catch (error) {} - return false; + try { + getAddress(value); + return true; + } catch (error) {} + return false; } async function checkAddress( - target: any, - promise: Promise, + target: any, + promise: Promise, ): Promise { - const result = await promise; - if ( - result == null || - result === "0x0000000000000000000000000000000000000000" - ) { - assert( - typeof target !== "string", - "unconfigured name", - "UNCONFIGURED_NAME", - { value: target }, - ); - assertArgument( - false, - "invalid AddressLike value; did not resolve to a value address", - "target", - target, - ); - } - return getAddress(result); + const result = await promise; + if ( + result == null || + result === "0x0000000000000000000000000000000000000000" + ) { + assert( + typeof target !== "string", + "unconfigured name", + "UNCONFIGURED_NAME", + { value: target }, + ); + assertArgument( + false, + "invalid AddressLike value; did not resolve to a value address", + "target", + target, + ); + } + return getAddress(result); } /** @@ -113,18 +113,18 @@ async function checkAddress( * //_error: */ export function resolveAddress(target: AddressLike): string | Promise { - if (typeof target === "string") { - return getAddress(target); + if (typeof target === "string") { + return getAddress(target); - // assert(resolver != null, "ENS resolution requires a provider", - // "UNSUPPORTED_OPERATION", { operation: "resolveName" }); + // assert(resolver != null, "ENS resolution requires a provider", + // "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - // return checkAddress(target, resolver.resolveName(target)); - } else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } else if (target && typeof target.then === "function") { - return checkAddress(target, target); - } + // return checkAddress(target, resolver.resolveName(target)); + } else if (isAddressable(target)) { + return checkAddress(target, target.getAddress()); + } else if (target && typeof target.then === "function") { + return checkAddress(target, target); + } - assertArgument(false, "unsupported addressable value", "target", target); + assertArgument(false, "unsupported addressable value", "target", target); } diff --git a/src.ts/address/contract-address.ts b/src.ts/address/contract-address.ts index ed49fd968..80ea2e1a9 100644 --- a/src.ts/address/contract-address.ts +++ b/src.ts/address/contract-address.ts @@ -1,8 +1,8 @@ import { - concat, - // dataSlice, - getBigInt, - // encodeRlp + concat, + // dataSlice, + getBigInt, + // encodeRlp } from "../utils/index.js"; import { getAddress } from "./index.js"; @@ -34,22 +34,22 @@ const logger = new Logger("contract-address/0.0.1"); * //_result: */ export function getCreateAddress(tx: { - from: string; - nonce: BigNumberish; + from: string; + nonce: BigNumberish; }): string { - const from = getAddress(tx.from); - const nonce = getBigInt(tx.nonce, "tx.nonce"); + const from = getAddress(tx.from); + const nonce = getBigInt(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } else { - nonceHex = "0x" + nonceHex; - } + let nonceHex = nonce.toString(16); + if (nonceHex === "0") { + nonceHex = "0x"; + } else if (nonceHex.length % 2) { + nonceHex = "0x0" + nonceHex; + } else { + nonceHex = "0x" + nonceHex; + } - return getAddress(from); + return getAddress(from); } /** @@ -69,27 +69,27 @@ export function getCreateAddress(tx: { * //_result: */ export function getCreate2Address( - from: string, - salt: BytesLike, - initCodeHash: BytesLike, + from: string, + salt: BytesLike, + initCodeHash: BytesLike, ): string { - if (hexDataLength(salt) !== 32) { - logger.throwArgumentError("salt must be 32 bytes", "salt", salt); - } - if (hexDataLength(initCodeHash) !== 32) { - logger.throwArgumentError( - "initCodeHash must be 32 bytes", - "initCodeHash", - initCodeHash, - ); - } + if (hexDataLength(salt) !== 32) { + logger.throwArgumentError("salt must be 32 bytes", "salt", salt); + } + if (hexDataLength(initCodeHash) !== 32) { + logger.throwArgumentError( + "initCodeHash must be 32 bytes", + "initCodeHash", + initCodeHash, + ); + } - const val = hexDataSlice( - sha256(concat(["0xff", getAddress(from), salt, initCodeHash])), - 12, - ); - console.log({ "contract-address/74=>should be string": val }); - const prefix = from.substring(2, 4); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); + const val = hexDataSlice( + sha256(concat(["0xff", getAddress(from), salt, initCodeHash])), + 12, + ); + console.log({ "contract-address/74=>should be string": val }); + const prefix = from.substring(2, 4); + const checksum = calculateCheckSum(val, prefix); + return "0x" + prefix + checksum + removeHexPrefix(val); } diff --git a/src.ts/address/index.ts b/src.ts/address/index.ts index 3e85c302e..0a27580bb 100644 --- a/src.ts/address/index.ts +++ b/src.ts/address/index.ts @@ -24,10 +24,10 @@ null; * the [balance](Provider-getBalance). */ export interface Addressable { - /** - * Get the object address. - */ - getAddress(): Promise; + /** + * Get the object address. + */ + getAddress(): Promise; } /** @@ -39,13 +39,13 @@ export type AddressLike = string | Promise | Addressable; * An interface for any object which can resolve an ENS name. */ export interface NameResolver { - /** - * Resolve to the address for the ENS %%name%%. - * - * Resolves to ``null`` if the name is unconfigued. Use - * [[resolveAddress]] (passing this object as %%resolver%%) to - * throw for names that are unconfigured. - */ + /** + * Resolve to the address for the ENS %%name%%. + * + * Resolves to ``null`` if the name is unconfigued. Use + * [[resolveAddress]] (passing this object as %%resolver%%) to + * throw for names that are unconfigured. + */ } import { BigNumber, BigNumberish } from "../bigNumber/bigNumber.js"; @@ -53,49 +53,49 @@ import { encode } from "../crypto/rlp.js"; import { sha256 } from "../crypto/sha3.js"; import { Logger } from "../logger/logger.js"; import { - arrayify, - getBytes, - hexDataSlice, - hexlify, - stripZeros, + arrayify, + getBytes, + hexDataSlice, + hexlify, + stripZeros, } from "../utils/data.js"; const logger = new Logger("address/0.0.1"); const precompiledAddresses = [ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000002", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000005", - "0000000000000000000000000000000000000000000000000000000000000006", - "0000000000000000000000000000000000000000000000000000000000000007", - "0000000000000000000000000000000000000000000000000000000000000008", - "0000000000000000000000000000000000000000000000000000000000000009", + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000001", + "0000000000000000000000000000000000000000000000000000000000000002", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000005", + "0000000000000000000000000000000000000000000000000000000000000006", + "0000000000000000000000000000000000000000000000000000000000000007", + "0000000000000000000000000000000000000000000000000000000000000008", + "0000000000000000000000000000000000000000000000000000000000000009", ]; function removeHexPrefix(val: string): string { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; + return val.substring(0, 2) === "0x" ? val.substring(2) : val; } function calculateCheckSum(_address: string, _prefix: string): string { - const address = getBytes("0x" + _address.replace("0x", "")); - const prefix = getBytes("0x" + _prefix.replace("0x", "")); - const tmpConcated = new Uint8Array([...address, ...prefix]); - const hexedConcat = hexlify(tmpConcated).replace("0x", "") + "00"; - const mods = Array.from(hexedConcat.toUpperCase(), (c) => { - const charCode = c.charCodeAt(0); - return charCode > 64 && charCode < 91 - ? (charCode - 55).toString() - : (charCode - 48).toString(); - }).join(""); - const bigVal = BigInt(mods); - const val97 = BigInt(97); - const val98 = BigInt(98); - const remainder = bigVal % val97; - const checkSum = val98 - remainder; - const result = checkSum > 9 ? checkSum.toString() : "0" + checkSum.toString(); - return result; + const address = getBytes("0x" + _address.replace("0x", "")); + const prefix = getBytes("0x" + _prefix.replace("0x", "")); + const tmpConcated = new Uint8Array([...address, ...prefix]); + const hexedConcat = hexlify(tmpConcated).replace("0x", "") + "00"; + const mods = Array.from(hexedConcat.toUpperCase(), (c) => { + const charCode = c.charCodeAt(0); + return charCode > 64 && charCode < 91 + ? (charCode - 55).toString() + : (charCode - 48).toString(); + }).join(""); + const bigVal = BigInt(mods); + const val97 = BigInt(97); + const val98 = BigInt(98); + const remainder = bigVal % val97; + const checkSum = val98 - remainder; + const result = checkSum > 9 ? checkSum.toString() : "0" + checkSum.toString(); + return result; } // See: https://en.wikipedia.org/wiki/International_Bank_Account_Number @@ -103,10 +103,10 @@ function calculateCheckSum(_address: string, _prefix: string): string { // Create lookup table const ibanLookup: { [character: string]: string } = {}; for (let i = 0; i < 10; i++) { - ibanLookup[String(i)] = String(i); + ibanLookup[String(i)] = String(i); } for (let i = 0; i < 26; i++) { - ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); + ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); } // How many decimal digits can we process? (for 64-bit float, this is 15) @@ -114,28 +114,28 @@ for (let i = 0; i < 26; i++) { const safeDigits = 15; function ibanChecksum(address: string): string { - address = address.toUpperCase(); - address = address.substring(4) + address.substring(0, 2) + "00"; + address = address.toUpperCase(); + address = address.substring(4) + address.substring(0, 2) + "00"; - let expanded = address - .split("") - .map((c) => { - return ibanLookup[c]; - }) - .join(""); + let expanded = address + .split("") + .map((c) => { + return ibanLookup[c]; + }) + .join(""); - // Javascript can handle integers safely up to 15 (decimal) digits - while (expanded.length >= safeDigits) { - let block = expanded.substring(0, safeDigits); - expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length); - } + // Javascript can handle integers safely up to 15 (decimal) digits + while (expanded.length >= safeDigits) { + let block = expanded.substring(0, safeDigits); + expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length); + } - let checksum = String(98 - (parseInt(expanded, 10) % 97)); - while (checksum.length < 2) { - checksum = "0" + checksum; - } + let checksum = String(98 - (parseInt(expanded, 10) % 97)); + while (checksum.length < 2) { + checksum = "0" + checksum; + } - return checksum; + return checksum; } /** @@ -174,25 +174,25 @@ function ibanChecksum(address: string): string { * //_error: */ function getAddress(address: string): string { - if (typeof address !== "string") { - logger.throwArgumentError("invalid address", "address", address); - } + if (typeof address !== "string") { + logger.throwArgumentError("invalid address", "address", address); + } - if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) { - logger.throwArgumentError("invalid address", "address", address); - } - const raw = removeHexPrefix(address); - if (precompiledAddresses.includes(raw)) { - return "0x" + raw; - } + if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) { + logger.throwArgumentError("invalid address", "address", address); + } + const raw = removeHexPrefix(address); + if (precompiledAddresses.includes(raw)) { + return "0x" + raw; + } - const prefix = raw.substring(0, 2); - const val = raw.substring(4); - const checksum = calculateCheckSum(val, prefix); - if (checksum !== raw.substring(2, 4)) { - logger.throwArgumentError("bad address checksum", "address", address); - } - return "0x" + prefix + checksum + val; + const prefix = raw.substring(0, 2); + const val = raw.substring(4); + const checksum = calculateCheckSum(val, prefix); + if (checksum !== raw.substring(2, 4)) { + logger.throwArgumentError("bad address checksum", "address", address); + } + return "0x" + prefix + checksum + val; } /** * The [ICAP Address format](link-icap) format is an early checksum @@ -213,55 +213,55 @@ function getAddress(address: string): string { * //_error: */ function getIcapAddress(address: string): string { - //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); - let base36 = BigInt(getAddress(address)).toString(36).toUpperCase(); - while (base36.length < 30) { - base36 = "0" + base36; - } - return "XE" + ibanChecksum("XE00" + base36) + base36; + //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); + let base36 = BigInt(getAddress(address)).toString(36).toUpperCase(); + while (base36.length < 30) { + base36 = "0" + base36; + } + return "XE" + ibanChecksum("XE00" + base36) + base36; } function networkIdToPrefix(networkId: number): string { - if (networkId == 1) { - return "cb"; - } else if (networkId == 3 || networkId == 4) { - return "ab"; - } else if (networkId > 10 || networkId == 0) { - return "ce"; - } else { - logger.throwArgumentError("bad networkId", "networkId", networkId); - return ""; - } + if (networkId == 1) { + return "cb"; + } else if (networkId == 3 || networkId == 4) { + return "ab"; + } else if (networkId > 10 || networkId == 0) { + return "ce"; + } else { + logger.throwArgumentError("bad networkId", "networkId", networkId); + return ""; + } } function getContractAddress(transaction: { - from: string; - nonce: BigNumberish; + from: string; + nonce: BigNumberish; }) { - let from: any = null; - try { - from = getAddress(transaction.from); - } catch (error) { - logger.throwArgumentError( - "missing from address", - "transaction", - transaction, - ); - } + let from: any = null; + try { + from = getAddress(transaction.from); + } catch (error) { + logger.throwArgumentError( + "missing from address", + "transaction", + transaction, + ); + } - const nonce = stripZeros( - arrayify(BigNumber.from(transaction.nonce).toHexString()), - ); - const val = hexDataSlice(sha256(encode([from, nonce])), 12); - const prefix = from.substring(2, 4); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); + const nonce = stripZeros( + arrayify(BigNumber.from(transaction.nonce).toHexString()), + ); + const val = hexDataSlice(sha256(encode([from, nonce])), 12); + const prefix = from.substring(2, 4); + const checksum = calculateCheckSum(val, prefix); + return "0x" + prefix + checksum + removeHexPrefix(val); } export { - getAddress, - getIcapAddress, - calculateCheckSum, - networkIdToPrefix, - getContractAddress, + getAddress, + getIcapAddress, + calculateCheckSum, + networkIdToPrefix, + getContractAddress, }; diff --git a/src.ts/bigNumber/bigNumber.ts b/src.ts/bigNumber/bigNumber.ts index 92dbb6922..e0d4a888c 100644 --- a/src.ts/bigNumber/bigNumber.ts +++ b/src.ts/bigNumber/bigNumber.ts @@ -11,11 +11,11 @@ import _BN from "bn.js"; import { Logger } from "../logger/logger.js"; import { - Bytes, - Hexable, - isBytes, - hexlify, - isHexString, + Bytes, + Hexable, + isBytes, + hexlify, + isHexString, } from "../utils/data.js"; import BN = _BN.BN; @@ -28,384 +28,384 @@ const MAX_SAFE = 0x1fffffffffffff; export type BigNumberish = BigNumber | Bytes | bigint | string | number; export function isBigNumberish(value: any): value is BigNumberish { - return ( - value != null && - (BigNumber.isBigNumber(value) || - (typeof value === "number" && value % 1 === 0) || - (typeof value === "string" && !!value.match(/^-?[0-9]+$/)) || - isHexString(value) || - typeof value === "bigint" || - isBytes(value)) - ); + return ( + value != null && + (BigNumber.isBigNumber(value) || + (typeof value === "number" && value % 1 === 0) || + (typeof value === "string" && !!value.match(/^-?[0-9]+$/)) || + isHexString(value) || + typeof value === "bigint" || + isBytes(value)) + ); } // Only warn about passing 10 into radix once let _warnedToStringRadix = false; export class BigNumber implements Hexable { - readonly _hex: string; - readonly _isBigNumber: boolean; - - constructor(constructorGuard: any, hex: string) { - logger.checkNew(new.target, BigNumber); - - if (constructorGuard !== _constructorGuard) { - logger.throwError( - "cannot call constructor directly; use BigNumber.from", - Logger.errors.UNSUPPORTED_OPERATION, - { - operation: "new (BigNumber)", - }, - ); - } - - this._hex = hex; - this._isBigNumber = true; - - Object.freeze(this); - } - - fromTwos(value: number): BigNumber { - return toBigNumber(toBN(this).fromTwos(value)); - } - - toTwos(value: number): BigNumber { - return toBigNumber(toBN(this).toTwos(value)); - } - - abs(): BigNumber { - if (this._hex[0] === "-") { - return BigNumber.from(this._hex.substring(1)); - } - return this; - } - - add(other: BigNumberish): BigNumber { - return toBigNumber(toBN(this).add(toBN(other))); - } - - sub(other: BigNumberish): BigNumber { - return toBigNumber(toBN(this).sub(toBN(other))); - } - - div(other: BigNumberish): BigNumber { - const o = BigNumber.from(other); - if (o.isZero()) { - throwFault("division by zero", "div"); - } - return toBigNumber(toBN(this).div(toBN(other))); - } - - mul(other: BigNumberish): BigNumber { - return toBigNumber(toBN(this).mul(toBN(other))); - } - - mod(other: BigNumberish): BigNumber { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot modulo negative values", "mod"); - } - return toBigNumber(toBN(this).umod(value)); - } - - pow(other: BigNumberish): BigNumber { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot raise to negative values", "pow"); - } - return toBigNumber(toBN(this).pow(value)); - } - - and(other: BigNumberish): BigNumber { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'and' negative values", "and"); - } - return toBigNumber(toBN(this).and(value)); - } - - or(other: BigNumberish): BigNumber { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'or' negative values", "or"); - } - return toBigNumber(toBN(this).or(value)); - } - - xor(other: BigNumberish): BigNumber { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'xor' negative values", "xor"); - } - return toBigNumber(toBN(this).xor(value)); - } - - mask(value: number): BigNumber { - if (this.isNegative() || value < 0) { - throwFault("cannot mask negative values", "mask"); - } - return toBigNumber(toBN(this).maskn(value)); - } - - shl(value: number): BigNumber { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shl"); - } - return toBigNumber(toBN(this).shln(value)); - } - - shr(value: number): BigNumber { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shr"); - } - return toBigNumber(toBN(this).shrn(value)); - } - - eq(other: BigNumberish): boolean { - return toBN(this).eq(toBN(other)); - } - - lt(other: BigNumberish): boolean { - return toBN(this).lt(toBN(other)); - } - - lte(other: BigNumberish): boolean { - return toBN(this).lte(toBN(other)); - } - - gt(other: BigNumberish): boolean { - return toBN(this).gt(toBN(other)); - } - - gte(other: BigNumberish): boolean { - return toBN(this).gte(toBN(other)); - } - - isNegative(): boolean { - return this._hex[0] === "-"; - } - - isZero(): boolean { - return toBN(this).isZero(); - } - - toNumber(): number { - try { - return toBN(this).toNumber(); - } catch (error) { - throwFault("overflow", "toNumber", this.toString()); - } - // @ts-ignore - return null; - } - - toBigInt(): bigint { - try { - return BigInt(this.toString()); - } catch (e) {} - - return logger.throwError( - "this platform does not support BigInt", - Logger.errors.UNSUPPORTED_OPERATION, - { - value: this.toString(), - }, - ); - } - - toString(): string { - // Lots of people expect this, which we do not support, so check (See: #889) - if (arguments.length > 0) { - if (arguments[0] === 10) { - if (!_warnedToStringRadix) { - _warnedToStringRadix = true; - logger.warn( - "BigNumber.toString does not accept any parameters; base-10 is assumed", - ); - } - } else if (arguments[0] === 16) { - logger.throwError( - "BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", - Logger.errors.UNEXPECTED_ARGUMENT, - {}, - ); - } else { - logger.throwError( - "BigNumber.toString does not accept parameters", - Logger.errors.UNEXPECTED_ARGUMENT, - {}, - ); - } - } - return toBN(this).toString(10); - } - - toHexString(): string { - return this._hex; - } - - toJSON(key?: string): any { - return { type: "BigNumber", hex: this.toHexString() }; - } - - static from(value: any): BigNumber { - if (value instanceof BigNumber) { - return value; - } - - if (typeof value === "string") { - if (value.match(/^-?0x[0-9a-f]+$/i)) { - return new BigNumber(_constructorGuard, toHex(value)); - } - - if (value.match(/^-?[0-9]+$/)) { - return new BigNumber(_constructorGuard, toHex(new BN(value))); - } - - return logger.throwArgumentError( - "invalid BigNumber string", - "value", - value, - ); - } - - if (typeof value === "number") { - if (value % 1) { - throwFault("underflow", "BigNumber.from", value); - } - - if (value >= MAX_SAFE || value <= -MAX_SAFE) { - throwFault("overflow", "BigNumber.from", value); - } - - return BigNumber.from(String(value)); - } - - const anyValue = value; - - if (typeof anyValue === "bigint") { - return BigNumber.from(anyValue.toString()); - } - - if (isBytes(anyValue)) { - return BigNumber.from(hexlify(anyValue)); - } - - if (anyValue) { - // Hexable interface (takes priority) - if (anyValue.toHexString) { - const hex = anyValue.toHexString(); - if (typeof hex === "string") { - return BigNumber.from(hex); - } - } else { - // For now, handle legacy JSON-ified values (goes away in v6) - let hex = anyValue._hex; - - // New-form JSON - if (hex == null && anyValue.type === "BigNumber") { - hex = anyValue.hex; - } - - if (typeof hex === "string") { - if ( - isHexString(hex) || - (hex[0] === "-" && isHexString(hex.substring(1))) - ) { - return BigNumber.from(hex); - } - } - } - } - - return logger.throwArgumentError("invalid BigNumber value", "value", value); - } - - static isBigNumber(value: any): value is BigNumber { - return !!(value && value._isBigNumber); - } + readonly _hex: string; + readonly _isBigNumber: boolean; + + constructor(constructorGuard: any, hex: string) { + logger.checkNew(new.target, BigNumber); + + if (constructorGuard !== _constructorGuard) { + logger.throwError( + "cannot call constructor directly; use BigNumber.from", + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: "new (BigNumber)", + }, + ); + } + + this._hex = hex; + this._isBigNumber = true; + + Object.freeze(this); + } + + fromTwos(value: number): BigNumber { + return toBigNumber(toBN(this).fromTwos(value)); + } + + toTwos(value: number): BigNumber { + return toBigNumber(toBN(this).toTwos(value)); + } + + abs(): BigNumber { + if (this._hex[0] === "-") { + return BigNumber.from(this._hex.substring(1)); + } + return this; + } + + add(other: BigNumberish): BigNumber { + return toBigNumber(toBN(this).add(toBN(other))); + } + + sub(other: BigNumberish): BigNumber { + return toBigNumber(toBN(this).sub(toBN(other))); + } + + div(other: BigNumberish): BigNumber { + const o = BigNumber.from(other); + if (o.isZero()) { + throwFault("division by zero", "div"); + } + return toBigNumber(toBN(this).div(toBN(other))); + } + + mul(other: BigNumberish): BigNumber { + return toBigNumber(toBN(this).mul(toBN(other))); + } + + mod(other: BigNumberish): BigNumber { + const value = toBN(other); + if (value.isNeg()) { + throwFault("cannot modulo negative values", "mod"); + } + return toBigNumber(toBN(this).umod(value)); + } + + pow(other: BigNumberish): BigNumber { + const value = toBN(other); + if (value.isNeg()) { + throwFault("cannot raise to negative values", "pow"); + } + return toBigNumber(toBN(this).pow(value)); + } + + and(other: BigNumberish): BigNumber { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault("cannot 'and' negative values", "and"); + } + return toBigNumber(toBN(this).and(value)); + } + + or(other: BigNumberish): BigNumber { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault("cannot 'or' negative values", "or"); + } + return toBigNumber(toBN(this).or(value)); + } + + xor(other: BigNumberish): BigNumber { + const value = toBN(other); + if (this.isNegative() || value.isNeg()) { + throwFault("cannot 'xor' negative values", "xor"); + } + return toBigNumber(toBN(this).xor(value)); + } + + mask(value: number): BigNumber { + if (this.isNegative() || value < 0) { + throwFault("cannot mask negative values", "mask"); + } + return toBigNumber(toBN(this).maskn(value)); + } + + shl(value: number): BigNumber { + if (this.isNegative() || value < 0) { + throwFault("cannot shift negative values", "shl"); + } + return toBigNumber(toBN(this).shln(value)); + } + + shr(value: number): BigNumber { + if (this.isNegative() || value < 0) { + throwFault("cannot shift negative values", "shr"); + } + return toBigNumber(toBN(this).shrn(value)); + } + + eq(other: BigNumberish): boolean { + return toBN(this).eq(toBN(other)); + } + + lt(other: BigNumberish): boolean { + return toBN(this).lt(toBN(other)); + } + + lte(other: BigNumberish): boolean { + return toBN(this).lte(toBN(other)); + } + + gt(other: BigNumberish): boolean { + return toBN(this).gt(toBN(other)); + } + + gte(other: BigNumberish): boolean { + return toBN(this).gte(toBN(other)); + } + + isNegative(): boolean { + return this._hex[0] === "-"; + } + + isZero(): boolean { + return toBN(this).isZero(); + } + + toNumber(): number { + try { + return toBN(this).toNumber(); + } catch (error) { + throwFault("overflow", "toNumber", this.toString()); + } + // @ts-ignore + return null; + } + + toBigInt(): bigint { + try { + return BigInt(this.toString()); + } catch (e) {} + + return logger.throwError( + "this platform does not support BigInt", + Logger.errors.UNSUPPORTED_OPERATION, + { + value: this.toString(), + }, + ); + } + + toString(): string { + // Lots of people expect this, which we do not support, so check (See: #889) + if (arguments.length > 0) { + if (arguments[0] === 10) { + if (!_warnedToStringRadix) { + _warnedToStringRadix = true; + logger.warn( + "BigNumber.toString does not accept any parameters; base-10 is assumed", + ); + } + } else if (arguments[0] === 16) { + logger.throwError( + "BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", + Logger.errors.UNEXPECTED_ARGUMENT, + {}, + ); + } else { + logger.throwError( + "BigNumber.toString does not accept parameters", + Logger.errors.UNEXPECTED_ARGUMENT, + {}, + ); + } + } + return toBN(this).toString(10); + } + + toHexString(): string { + return this._hex; + } + + toJSON(key?: string): any { + return { type: "BigNumber", hex: this.toHexString() }; + } + + static from(value: any): BigNumber { + if (value instanceof BigNumber) { + return value; + } + + if (typeof value === "string") { + if (value.match(/^-?0x[0-9a-f]+$/i)) { + return new BigNumber(_constructorGuard, toHex(value)); + } + + if (value.match(/^-?[0-9]+$/)) { + return new BigNumber(_constructorGuard, toHex(new BN(value))); + } + + return logger.throwArgumentError( + "invalid BigNumber string", + "value", + value, + ); + } + + if (typeof value === "number") { + if (value % 1) { + throwFault("underflow", "BigNumber.from", value); + } + + if (value >= MAX_SAFE || value <= -MAX_SAFE) { + throwFault("overflow", "BigNumber.from", value); + } + + return BigNumber.from(String(value)); + } + + const anyValue = value; + + if (typeof anyValue === "bigint") { + return BigNumber.from(anyValue.toString()); + } + + if (isBytes(anyValue)) { + return BigNumber.from(hexlify(anyValue)); + } + + if (anyValue) { + // Hexable interface (takes priority) + if (anyValue.toHexString) { + const hex = anyValue.toHexString(); + if (typeof hex === "string") { + return BigNumber.from(hex); + } + } else { + // For now, handle legacy JSON-ified values (goes away in v6) + let hex = anyValue._hex; + + // New-form JSON + if (hex == null && anyValue.type === "BigNumber") { + hex = anyValue.hex; + } + + if (typeof hex === "string") { + if ( + isHexString(hex) || + (hex[0] === "-" && isHexString(hex.substring(1))) + ) { + return BigNumber.from(hex); + } + } + } + } + + return logger.throwArgumentError("invalid BigNumber value", "value", value); + } + + static isBigNumber(value: any): value is BigNumber { + return !!(value && value._isBigNumber); + } } // Normalize the hex string // @ts-ignore function toHex(value: string | BN): string { - // For BN, call on the hex string - if (typeof value !== "string") { - return toHex(value.toString(16)); - } - - // If negative, prepend the negative sign to the normalized positive value - if (value[0] === "-") { - // Strip off the negative sign - value = value.substring(1); - - // Cannot have multiple negative signs (e.g. "--0x04") - if (value[0] === "-") { - logger.throwArgumentError("invalid hex", "value", value); - } - - // Call toHex on the positive component - value = toHex(value); - - // Do not allow "-0x00" - if (value === "0x00") { - return value; - } - - // Negate the value - return "-" + value; - } - - // Add a "0x" prefix if missing - if (value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - - // Normalize zero - if (value === "0x") { - return "0x00"; - } - - // Make the string even length - if (value.length % 2) { - value = "0x0" + value.substring(2); - } - - // Trim to smallest even-length string - while (value.length > 4 && value.substring(0, 4) === "0x00") { - value = "0x" + value.substring(4); - } - - return value; + // For BN, call on the hex string + if (typeof value !== "string") { + return toHex(value.toString(16)); + } + + // If negative, prepend the negative sign to the normalized positive value + if (value[0] === "-") { + // Strip off the negative sign + value = value.substring(1); + + // Cannot have multiple negative signs (e.g. "--0x04") + if (value[0] === "-") { + logger.throwArgumentError("invalid hex", "value", value); + } + + // Call toHex on the positive component + value = toHex(value); + + // Do not allow "-0x00" + if (value === "0x00") { + return value; + } + + // Negate the value + return "-" + value; + } + + // Add a "0x" prefix if missing + if (value.substring(0, 2) !== "0x") { + value = "0x" + value; + } + + // Normalize zero + if (value === "0x") { + return "0x00"; + } + + // Make the string even length + if (value.length % 2) { + value = "0x0" + value.substring(2); + } + + // Trim to smallest even-length string + while (value.length > 4 && value.substring(0, 4) === "0x00") { + value = "0x" + value.substring(4); + } + + return value; } // @ts-ignore function toBigNumber(value: BN): BigNumber { - return BigNumber.from(toHex(value)); + return BigNumber.from(toHex(value)); } // @ts-ignore function toBN(value: BigNumberish): BN { - const hex = BigNumber.from(value).toHexString(); - if (hex[0] === "-") { - return new BN("-" + hex.substring(3), 16); - } - return new BN(hex.substring(2), 16); + const hex = BigNumber.from(value).toHexString(); + if (hex[0] === "-") { + return new BN("-" + hex.substring(3), 16); + } + return new BN(hex.substring(2), 16); } function throwFault(fault: string, operation: string, value?: any): never { - const params: any = { fault: fault, operation: operation }; - if (value != null) { - params.value = value; - } + const params: any = { fault: fault, operation: operation }; + if (value != null) { + params.value = value; + } - return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params); + return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params); } // value should have no prefix export function _base36To16(value: string): string { - return new BN(value, 36).toString(16); + return new BN(value, 36).toString(16); } // value should have no prefix export function _base16To36(value: string): string { - return new BN(value, 16).toString(36); + return new BN(value, 16).toString(36); } diff --git a/src.ts/cip/custom-units.ts b/src.ts/cip/custom-units.ts new file mode 100644 index 000000000..22593ef63 --- /dev/null +++ b/src.ts/cip/custom-units.ts @@ -0,0 +1,96 @@ +import type { AddressLike } from "../address/index.js"; +import { Contract } from "../contract/index.js"; +import type { BlockTag, ContractRunner } from "../providers/index.js"; + +export const customUnitAbi = Object.freeze([ + "function supportsUnit(string unit) view returns (bool)", + "function supportedUnits() view returns (string[])", + "function preferredUnit() view returns (string)", + "function balanceOf(address account) view returns (uint256)", + "function balanceOfUnit(address account, string unit) view returns (uint256)", +]); +export class CustomUnitDiscovery { + readonly supportedUnits: readonly string[]; + constructor( + units: readonly string[], + readonly preferredUnit: string, + ) { + this.supportedUnits = Object.freeze([...units]); + } + get isValid(): boolean { + return ( + this.supports("units") && + this.preferredUnit !== "" && + this.supports(this.preferredUnit) + ); + } + supports(unit: string): boolean { + return this.supportedUnits.includes(unit); + } +} +/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ +export class CustomUnitBalance { + constructor( + readonly canonicalAmount: bigint, + readonly unitAmount: bigint, + readonly unit: string, + ) {} + get multiplierNumerator(): bigint { + return this.unitAmount; + } + get multiplierDenominator(): bigint { + return this.canonicalAmount; + } +} +/** Core custom-unit contract convention used by Tone and Core API. */ +export class CustomUnitToken { + readonly contract: Contract; + constructor(address: string, runner: ContractRunner) { + this.contract = new Contract(address, customUnitAbi, runner); + } + async supportsUnit(unit: string, blockTag?: BlockTag): Promise { + return ( + unit.trim() !== "" && + (await this.contract.supportsUnit(unit.trim(), { blockTag })) + ); + } + async supportedUnits(blockTag?: BlockTag): Promise { + return Object.freeze( + Array.from(await this.contract.supportedUnits({ blockTag })), + ); + } + async preferredUnit(blockTag?: BlockTag): Promise { + return (await this.contract.preferredUnit({ blockTag })).trim(); + } + async discover(blockTag?: BlockTag): Promise { + if (!(await this.supportsUnit("units", blockTag))) return null; + const discovery = new CustomUnitDiscovery( + await this.supportedUnits(blockTag), + await this.preferredUnit(blockTag), + ); + return discovery.isValid ? discovery : null; + } + canonicalBalance(account: AddressLike, blockTag?: BlockTag): Promise { + return this.contract.balanceOf(account, { blockTag }); + } + balanceOfUnit( + account: AddressLike, + unit: string, + blockTag?: BlockTag, + ): Promise { + if (!unit.trim()) throw new TypeError("unit must not be empty"); + return this.contract.balanceOfUnit(account, unit.trim(), { blockTag }); + } + async balance( + account: AddressLike, + unit?: string, + blockTag?: BlockTag, + ): Promise { + const resolved = unit?.trim() || (await this.preferredUnit(blockTag)); + const [canonical, calculated] = await Promise.all([ + this.canonicalBalance(account, blockTag), + this.balanceOfUnit(account, resolved, blockTag), + ]); + return new CustomUnitBalance(canonical, calculated, resolved); + } +} diff --git a/src.ts/cip/index.ts b/src.ts/cip/index.ts new file mode 100644 index 000000000..3346c0bf9 --- /dev/null +++ b/src.ts/cip/index.ts @@ -0,0 +1,172 @@ +import { Contract } from "../contract/index.js"; +import type { + Overrides, + ContractTransactionResponse, +} from "../contract/index.js"; +import type { BlockTag, ContractRunner } from "../providers/index.js"; +import { IpfsGateway } from "../ipfs/index.js"; + +/** On-chain interface defined by CIP-150. */ +export const cip150Abi = Object.freeze([ + "function getMetadataValue(string key) view returns (string value)", + "function hasMetadataKey(string key) view returns (bool exists)", + "function isMetadataSealed(string key) view returns (bool sealed)", + "function listMetadataKeys() view returns (string[] keys)", + "function getMetadataByIndex(uint256 index) view returns (string key, string value)", + "function metadataCount() view returns (uint256 total)", + "function setMetadataValue(string key, string value)", + "function sealMetadataKey(string key)", +]); +export interface Cip150MetadataEntry { + readonly key: string; + readonly value: string; + readonly sealed?: boolean; +} +export const cip151TokenExpirationKey = "tokenExpiration"; +export const cip151TradingStopKey = "tradingStop"; +export const cip152LabKey = "lab"; + +/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ +export class Cip151Lifecycle { + readonly tokenExpiration: bigint | null; + readonly tradingStop: bigint | null; + constructor(metadata: Readonly> = {}) { + const parse = (key: string): bigint | null => { + const value = metadata[key]; + if (value == null || value === "") return null; + if (!/^\d+$/.test(value)) + throw new TypeError(`${key} must be a non-negative Unix timestamp`); + return BigInt(value); + }; + this.tokenExpiration = parse(cip151TokenExpirationKey); + this.tradingStop = parse(cip151TradingStopKey); + } + isExpiredAt(seconds: bigint): boolean { + return this.tokenExpiration !== null && seconds >= this.tokenExpiration; + } + isTradingStoppedAt(seconds: bigint): boolean { + return this.tradingStop !== null && seconds >= this.tradingStop; + } +} +export interface Cip152LabMeasurement { + readonly value: string | number; + readonly unit?: string; +} +/** Validates certificate structure, not the authenticity of its issuer. */ +export class Cip152LabCertificate { + readonly measurements: Readonly>; + constructor(json: unknown) { + if (json === null || typeof json !== "object" || Array.isArray(json)) + throw new TypeError("CIP-152 lab.json must be an object"); + const measurements: Record = + Object.create(null); + for (const [key, property] of Object.entries(json)) { + if ( + !property || + typeof property !== "object" || + Array.isArray(property) || + !Object.hasOwn(property, "value") + ) + throw new TypeError(`CIP-152 property ${key} must contain a value`); + const { value, unit } = property; + if (!( + typeof value === "string" || + (typeof value === "number" && Number.isFinite(value)) + )) + throw new TypeError(`CIP-152 property ${key} has an invalid value`); + if (unit != null && typeof unit !== "string") + throw new TypeError(`CIP-152 property ${key} has an invalid unit`); + measurements[key] = Object.freeze( + unit == null ? { value } : { value, unit }, + ); + } + this.measurements = Object.freeze(measurements); + } +} +/** Typed metadata reader and writer. Writes require a signer as runner. */ +export class Cip150MetadataContract { + readonly contract: Contract; + constructor(address: string, runner: ContractRunner) { + this.contract = new Contract(address, cip150Abi, runner); + } + getValue(key: string, blockTag?: BlockTag): Promise { + return this.contract.getMetadataValue(key, { blockTag }); + } + hasKey(key: string, blockTag?: BlockTag): Promise { + return this.contract.hasMetadataKey(key, { blockTag }); + } + isSealed(key: string, blockTag?: BlockTag): Promise { + return this.contract.isMetadataSealed(key, { blockTag }); + } + async listKeys(blockTag?: BlockTag): Promise { + return Object.freeze( + Array.from(await this.contract.listMetadataKeys({ blockTag })), + ); + } + async getByIndex( + index: bigint, + blockTag?: BlockTag, + ): Promise { + const [key, value] = await this.contract.getMetadataByIndex(index, { + blockTag, + }); + return Object.freeze({ key, value }); + } + count(blockTag?: BlockTag): Promise { + return this.contract.metadataCount({ blockTag }); + } + async readAll( + blockTag?: BlockTag, + includeSealedState = true, + ): Promise { + const entries = []; + for (const key of await this.listKeys(blockTag)) { + const value = await this.getValue(key, blockTag); + entries.push( + Object.freeze( + includeSealedState + ? { key, value, sealed: await this.isSealed(key, blockTag) } + : { key, value }, + ), + ); + } + return Object.freeze(entries); + } + setValue( + key: string, + value: string, + overrides: Overrides = {}, + ): Promise { + return this.contract.setMetadataValue(key, value, overrides); + } + sealKey( + key: string, + overrides: Overrides = {}, + ): Promise { + return this.contract.sealMetadataKey(key, overrides); + } + async readLifecycle(blockTag?: BlockTag): Promise { + const metadata: Record = {}; + for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) { + if (await this.hasKey(key, blockTag)) + metadata[key] = await this.getValue(key, blockTag); + } + return new Cip151Lifecycle(metadata); + } + async readLabCertificate( + gateway: IpfsGateway, + blockTag?: BlockTag, + ): Promise { + if (!(await this.hasKey(cip152LabKey, blockTag))) return null; + const reference = await this.getValue(cip152LabKey, blockTag); + if (!gateway.resolve(reference).pathname.endsWith("/lab.json")) + throw new TypeError("CIP-152 reference must point to lab.json"); + return new Cip152LabCertificate(await gateway.readJson(reference)); + } +} +export { + CustomUnitToken, + CustomUnitBalance, + CustomUnitDiscovery, + customUnitAbi, +} from "./custom-units.js"; diff --git a/src.ts/constants/hashes.ts b/src.ts/constants/hashes.ts index bd777a13b..e61fd9062 100644 --- a/src.ts/constants/hashes.ts +++ b/src.ts/constants/hashes.ts @@ -4,4 +4,4 @@ * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) */ export const ZeroHash: string = - "0x0000000000000000000000000000000000000000000000000000000000000000"; + "0x0000000000000000000000000000000000000000000000000000000000000000"; diff --git a/src.ts/constants/index.ts b/src.ts/constants/index.ts index 658cd66b6..1c28cc972 100644 --- a/src.ts/constants/index.ts +++ b/src.ts/constants/index.ts @@ -7,14 +7,14 @@ export { ZeroAddress } from "./addresses.js"; export { ZeroHash } from "./hashes.js"; export { - N, - NegativeOne, - Zero, - One, - Two, - OrePerXCB, - MaxUint256, - MinInt256, - MaxInt256, + N, + NegativeOne, + Zero, + One, + Two, + OrePerXCB, + MaxUint256, + MinInt256, + MaxInt256, } from "./numbers.js"; export { CoreSymbol, MessagePrefix } from "./strings.js"; diff --git a/src.ts/constants/numbers.ts b/src.ts/constants/numbers.ts index a7855d6f6..2f34b2a97 100644 --- a/src.ts/constants/numbers.ts +++ b/src.ts/constants/numbers.ts @@ -4,7 +4,7 @@ * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) */ export const N: bigint = BigInt( - "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", + "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", ); /** @@ -20,7 +20,7 @@ export const OrePerXCB: bigint = BigInt("1000000000000000000"); * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) */ export const MaxUint256: bigint = BigInt( - "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", ); /** @@ -29,8 +29,8 @@ export const MaxUint256: bigint = BigInt( * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) */ export const MinInt256: bigint = - BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * - BigInt(-1); + BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * + BigInt(-1); /** * A constant for the maximum value for an ``int256``. @@ -38,7 +38,7 @@ export const MinInt256: bigint = * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) */ export const MaxInt256: bigint = BigInt( - "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", ); export const NegativeOne: bigint = /*#__PURE__*/ BigInt(-1); diff --git a/src.ts/contract/contract.ts b/src.ts/contract/contract.ts index 36ed8bc9c..59b8b3d6b 100644 --- a/src.ts/contract/contract.ts +++ b/src.ts/contract/contract.ts @@ -1,130 +1,130 @@ import { Indexed, Interface, Typed } from "../abi/index.js"; import { resolveAddress } from "../address/checks.js"; import { - copyRequest, - Log, - TransactionResponse, + copyRequest, + Log, + TransactionResponse, } from "../providers/provider.js"; import { - defineProperties, - isCallException, - isHexString, - resolveProperties, - makeError, - assert, - assertArgument, + defineProperties, + isCallException, + isHexString, + resolveProperties, + makeError, + assert, + assertArgument, } from "../utils/index.js"; import { - ContractEventPayload, - ContractUnknownEventPayload, - ContractTransactionResponse, - EventLog, + ContractEventPayload, + ContractUnknownEventPayload, + ContractTransactionResponse, + EventLog, } from "./wrappers.js"; import type { - EventFragment, - FunctionFragment, - InterfaceAbi, - ParamType, - Result, + EventFragment, + FunctionFragment, + InterfaceAbi, + ParamType, + Result, } from "../abi/index.js"; import type { Addressable } from "../address/index.js"; import type { EventEmitterable, Listener } from "../utils/index.js"; import type { - BlockTag, - ContractRunner, - Provider, - TransactionRequest, - TopicFilter, + BlockTag, + ContractRunner, + Provider, + TransactionRequest, + TopicFilter, } from "../providers/index.js"; import type { - BaseContractMethod, - ContractEventName, - ContractInterface, - ContractMethodArgs, - ContractMethod, - ContractEventArgs, - ContractEvent, - ContractTransaction, - DeferredTopicFilter, - WrappedFallback, + BaseContractMethod, + ContractEventName, + ContractInterface, + ContractMethodArgs, + ContractMethod, + ContractEventArgs, + ContractEvent, + ContractTransaction, + DeferredTopicFilter, + WrappedFallback, } from "./types.js"; const BN_0 = BigInt(0); interface ContractRunnerCaller extends ContractRunner { - call: (tx: TransactionRequest) => Promise; + call: (tx: TransactionRequest) => Promise; } interface ContractRunnerEstimater extends ContractRunner { - estimateEnergy: (tx: TransactionRequest) => Promise; + estimateEnergy: (tx: TransactionRequest) => Promise; } interface ContractRunnerSender extends ContractRunner { - sendTransaction: (tx: TransactionRequest) => Promise; + sendTransaction: (tx: TransactionRequest) => Promise; } interface ContractRunnerResolver extends ContractRunner { - resolveName: (name: string | Addressable) => Promise; + resolveName: (name: string | Addressable) => Promise; } function canCall(value: any): value is ContractRunnerCaller { - return value && typeof value.call === "function"; + return value && typeof value.call === "function"; } function canEstimate(value: any): value is ContractRunnerEstimater { - return value && typeof value.estimateEnergy === "function"; + return value && typeof value.estimateEnergy === "function"; } function canResolve(value: any): value is ContractRunnerResolver { - return value && typeof value.resolveName === "function"; + return value && typeof value.resolveName === "function"; } function canSend(value: any): value is ContractRunnerSender { - return value && typeof value.sendTransaction === "function"; + return value && typeof value.sendTransaction === "function"; } class PreparedTopicFilter implements DeferredTopicFilter { - #filter: Promise; - readonly fragment!: EventFragment; - - constructor( - contract: BaseContract, - fragment: EventFragment, - args: Array, - ) { - defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - - // Recursively descend into args and resolve any addresses - this.#filter = (async function () { - const resolvedArgs = await Promise.all( - fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - }), - ); - - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - - getTopicFilter(): Promise { - return this.#filter; - } + #filter: Promise; + readonly fragment!: EventFragment; + + constructor( + contract: BaseContract, + fragment: EventFragment, + args: Array, + ) { + defineProperties(this, { fragment }); + if (fragment.inputs.length < args.length) { + throw new Error("too many arguments"); + } + + // Recursively descend into args and resolve any addresses + this.#filter = (async function () { + const resolvedArgs = await Promise.all( + fragment.inputs.map((param, index) => { + const arg = args[index]; + if (arg == null) { + return null; + } + + return param.walkAsync(args[index], (type, value) => { + if (type === "address") { + return resolveAddress(value); + } + return value; + }); + }), + ); + + return contract.interface.encodeFilterTopics(fragment, resolvedArgs); + })(); + } + + getTopicFilter(): Promise { + return this.#filter; + } } // A = Arguments passed in as a tuple @@ -135,411 +135,411 @@ class PreparedTopicFilter implements DeferredTopicFilter { //export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { function getRunner( - value: any, - feature: keyof ContractRunner, + value: any, + feature: keyof ContractRunner, ): null | T { - if (value == null) { - return null; - } - if (typeof value[feature] === "function") { - return value; - } - if (value.provider && typeof value.provider[feature] === "function") { - return value.provider; - } - return null; + if (value == null) { + return null; + } + if (typeof value[feature] === "function") { + return value; + } + if (value.provider && typeof value.provider[feature] === "function") { + return value.provider; + } + return null; } function getProvider(value: null | ContractRunner): null | Provider { - if (value == null) { - return null; - } - return value.provider || null; + if (value == null) { + return null; + } + return value.provider || null; } /** * @_ignore: */ export async function copyOverrides( - arg: any, - allowed?: Array, + arg: any, + allowed?: Array, ): Promise> { - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = copyRequest(Typed.dereference(arg, "overrides")); - - assertArgument( - overrides.to == null || (allowed || []).indexOf("to") >= 0, - "cannot override to", - "overrides.to", - overrides.to, - ); - assertArgument( - overrides.data == null || (allowed || []).indexOf("data") >= 0, - "cannot override data", - "overrides.data", - overrides.data, - ); - - // Resolve any from - if (overrides.from) { - overrides.from = await resolveAddress(overrides.from); - } - - return >overrides; + // Create a shallow copy (we'll deep-ify anything needed during normalizing) + const overrides = copyRequest(Typed.dereference(arg, "overrides")); + + assertArgument( + overrides.to == null || (allowed || []).indexOf("to") >= 0, + "cannot override to", + "overrides.to", + overrides.to, + ); + assertArgument( + overrides.data == null || (allowed || []).indexOf("data") >= 0, + "cannot override data", + "overrides.data", + overrides.data, + ); + + // Resolve any from + if (overrides.from) { + overrides.from = await resolveAddress(overrides.from); + } + + return >overrides; } /** * @_ignore: */ export async function resolveArgs( - _runner: null | ContractRunner, - inputs: ReadonlyArray, - args: Array, + _runner: null | ContractRunner, + inputs: ReadonlyArray, + args: Array, ): Promise> { - // Recursively descend into args and resolve any addresses - return await Promise.all( - inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = Typed.dereference(value, type); - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - }), - ); + // Recursively descend into args and resolve any addresses + return await Promise.all( + inputs.map((param, index) => { + return param.walkAsync(args[index], (type, value) => { + value = Typed.dereference(value, type); + if (type === "address") { + return resolveAddress(value); + } + return value; + }); + }), + ); } function buildWrappedFallback(contract: BaseContract): WrappedFallback { - const populateTransaction = async function ( - overrides?: Omit, - ): Promise { - // If an overrides was passed in, copy it and normalize the values - - const tx: ContractTransaction = ( - await copyOverrides<"data">(overrides, ["data"]) - ); - tx.to = await contract.getAddress(); - - const iface = contract.interface; - - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - assertArgument( - payable || (tx.value || BN_0) === BN_0, - "cannot send value to non-payable contract", - "overrides.value", - tx.value, - ); - - // Only allow fallback contracts to set non-empty data - assertArgument( - iface.fallback || (tx.data || "0x") === "0x", - "cannot send data to receive-only contract", - "overrides.data", - tx.data, - ); - - return tx; - }; - - const staticCall = async function ( - overrides?: Omit, - ): Promise { - const runner = getRunner(contract.runner, "call"); - assert( - canCall(runner), - "contract runner does not support calling", - "UNSUPPORTED_OPERATION", - { operation: "call" }, - ); - - const tx = await populateTransaction(overrides); - - try { - return await runner.call(tx); - } catch (error: any) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - - const send = async function ( - overrides?: Omit, - ): Promise { - const runner = contract.runner; - assert( - canSend(runner), - "contract runner does not support sending transactions", - "UNSUPPORTED_OPERATION", - { operation: "sendTransaction" }, - ); - - const tx = await runner.sendTransaction( - await populateTransaction(overrides), - ); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse( - contract.interface, - provider, - tx, - ); - }; - - const estimateEnergy = async function ( - overrides?: Omit, - ): Promise { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert( - canEstimate(runner), - "contract runner does not support energy estimation", - "UNSUPPORTED_OPERATION", - { operation: "estimateEnergy" }, - ); - - return await runner.estimateEnergy(await populateTransaction(overrides)); - }; - - const method = async (overrides?: Omit) => { - return await send(overrides); - }; - - defineProperties(method, { - _contract: contract, - - estimateEnergy, - populateTransaction, - send, - staticCall, - }); - - return method; + const populateTransaction = async function ( + overrides?: Omit, + ): Promise { + // If an overrides was passed in, copy it and normalize the values + + const tx: ContractTransaction = ( + await copyOverrides<"data">(overrides, ["data"]) + ); + tx.to = await contract.getAddress(); + + const iface = contract.interface; + + // Only allow payable contracts to set non-zero value + const payable = iface.receive || (iface.fallback && iface.fallback.payable); + assertArgument( + payable || (tx.value || BN_0) === BN_0, + "cannot send value to non-payable contract", + "overrides.value", + tx.value, + ); + + // Only allow fallback contracts to set non-empty data + assertArgument( + iface.fallback || (tx.data || "0x") === "0x", + "cannot send data to receive-only contract", + "overrides.data", + tx.data, + ); + + return tx; + }; + + const staticCall = async function ( + overrides?: Omit, + ): Promise { + const runner = getRunner(contract.runner, "call"); + assert( + canCall(runner), + "contract runner does not support calling", + "UNSUPPORTED_OPERATION", + { operation: "call" }, + ); + + const tx = await populateTransaction(overrides); + + try { + return await runner.call(tx); + } catch (error: any) { + if (isCallException(error) && error.data) { + throw contract.interface.makeError(error.data, tx); + } + throw error; + } + }; + + const send = async function ( + overrides?: Omit, + ): Promise { + const runner = contract.runner; + assert( + canSend(runner), + "contract runner does not support sending transactions", + "UNSUPPORTED_OPERATION", + { operation: "sendTransaction" }, + ); + + const tx = await runner.sendTransaction( + await populateTransaction(overrides), + ); + const provider = getProvider(contract.runner); + // @TODO: the provider can be null; make a custom dummy provider that will throw a + // meaningful error + return new ContractTransactionResponse( + contract.interface, + provider, + tx, + ); + }; + + const estimateEnergy = async function ( + overrides?: Omit, + ): Promise { + const runner = getRunner(contract.runner, "estimateEnergy"); + assert( + canEstimate(runner), + "contract runner does not support energy estimation", + "UNSUPPORTED_OPERATION", + { operation: "estimateEnergy" }, + ); + + return await runner.estimateEnergy(await populateTransaction(overrides)); + }; + + const method = async (overrides?: Omit) => { + return await send(overrides); + }; + + defineProperties(method, { + _contract: contract, + + estimateEnergy, + populateTransaction, + send, + staticCall, + }); + + return method; } function buildWrappedMethod< - A extends Array = Array, - R = any, - D extends R | ContractTransactionResponse = ContractTransactionResponse, + A extends Array = Array, + R = any, + D extends R | ContractTransactionResponse = ContractTransactionResponse, >(contract: BaseContract, key: string): BaseContractMethod { - const getFragment = function ( - ...args: ContractMethodArgs - ): FunctionFragment { - const fragment = contract.interface.getFunction(key, args); - assert( - fragment, - "no matching fragment in getFragment", - "UNSUPPORTED_OPERATION", - { - operation: "fragment", - }, - ); - return fragment; - }; - - const populateTransaction = async function ( - ...args: ContractMethodArgs - ): Promise { - const fragment = getFragment(...args); - - // If an overrides was passed in, copy it and normalize the values - let overrides: Omit = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - - if (fragment.inputs.length !== args.length) { - throw new Error( - "internal error: fragment inputs doesn't match arguments; should not happen", - ); - } - - const resolvedArgs = await resolveArgs( - contract.runner, - fragment.inputs, - args, - ); - - return Object.assign( - {}, - overrides, - await resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs), - }), - ); - }; - - const staticCall = async function ( - ...args: ContractMethodArgs - ): Promise { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return (result); - }; - - const send = async function ( - ...args: ContractMethodArgs - ): Promise { - const runner = contract.runner; - assert( - canSend(runner), - "contract runner does not support sending transactions", - "UNSUPPORTED_OPERATION", - { operation: "sendTransaction" }, - ); - - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse( - contract.interface, - provider, - tx, - ); - }; - - const estimateEnergy = async function ( - ...args: ContractMethodArgs - ): Promise { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert( - canEstimate(runner), - "contract runner does not support energy estimation", - "UNSUPPORTED_OPERATION", - { operation: "estimateEnergy" }, - ); - - return await runner.estimateEnergy(await populateTransaction(...args)); - }; - - const staticCallResult = async function ( - ...args: ContractMethodArgs - ): Promise { - const runner = getRunner(contract.runner, "call"); - assert( - canCall(runner), - "contract runner does not support calling", - "UNSUPPORTED_OPERATION", - { operation: "call" }, - ); - - const tx = await populateTransaction(...args); - - let result = "0x"; - try { - result = await runner.call(tx); - } catch (error: any) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - - const method = async (...args: ContractMethodArgs) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - - defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, - _key: key, - - getFragment, - - estimateEnergy, - populateTransaction, - send, - staticCall, - staticCallResult, - }); - - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - assert( - fragment, - "no matching fragment in defineProperty", - "UNSUPPORTED_OPERATION", - { - operation: "fragment", - }, - ); - return fragment; - }, - }); - - return >method; + const getFragment = function ( + ...args: ContractMethodArgs + ): FunctionFragment { + const fragment = contract.interface.getFunction(key, args); + assert( + fragment, + "no matching fragment in getFragment", + "UNSUPPORTED_OPERATION", + { + operation: "fragment", + }, + ); + return fragment; + }; + + const populateTransaction = async function ( + ...args: ContractMethodArgs + ): Promise { + const fragment = getFragment(...args); + + // If an overrides was passed in, copy it and normalize the values + let overrides: Omit = {}; + if (fragment.inputs.length + 1 === args.length) { + overrides = await copyOverrides(args.pop()); + } + + if (fragment.inputs.length !== args.length) { + throw new Error( + "internal error: fragment inputs doesn't match arguments; should not happen", + ); + } + + const resolvedArgs = await resolveArgs( + contract.runner, + fragment.inputs, + args, + ); + + return Object.assign( + {}, + overrides, + await resolveProperties({ + to: contract.getAddress(), + data: contract.interface.encodeFunctionData(fragment, resolvedArgs), + }), + ); + }; + + const staticCall = async function ( + ...args: ContractMethodArgs + ): Promise { + const result = await staticCallResult(...args); + if (result.length === 1) { + return result[0]; + } + return (result); + }; + + const send = async function ( + ...args: ContractMethodArgs + ): Promise { + const runner = contract.runner; + assert( + canSend(runner), + "contract runner does not support sending transactions", + "UNSUPPORTED_OPERATION", + { operation: "sendTransaction" }, + ); + + const tx = await runner.sendTransaction(await populateTransaction(...args)); + const provider = getProvider(contract.runner); + // @TODO: the provider can be null; make a custom dummy provider that will throw a + // meaningful error + return new ContractTransactionResponse( + contract.interface, + provider, + tx, + ); + }; + + const estimateEnergy = async function ( + ...args: ContractMethodArgs + ): Promise { + const runner = getRunner(contract.runner, "estimateEnergy"); + assert( + canEstimate(runner), + "contract runner does not support energy estimation", + "UNSUPPORTED_OPERATION", + { operation: "estimateEnergy" }, + ); + + return await runner.estimateEnergy(await populateTransaction(...args)); + }; + + const staticCallResult = async function ( + ...args: ContractMethodArgs + ): Promise { + const runner = getRunner(contract.runner, "call"); + assert( + canCall(runner), + "contract runner does not support calling", + "UNSUPPORTED_OPERATION", + { operation: "call" }, + ); + + const tx = await populateTransaction(...args); + + let result = "0x"; + try { + result = await runner.call(tx); + } catch (error: any) { + if (isCallException(error) && error.data) { + throw contract.interface.makeError(error.data, tx); + } + throw error; + } + + const fragment = getFragment(...args); + return contract.interface.decodeFunctionResult(fragment, result); + }; + + const method = async (...args: ContractMethodArgs) => { + const fragment = getFragment(...args); + if (fragment.constant) { + return await staticCall(...args); + } + return await send(...args); + }; + + defineProperties(method, { + name: contract.interface.getFunctionName(key), + _contract: contract, + _key: key, + + getFragment, + + estimateEnergy, + populateTransaction, + send, + staticCall, + staticCallResult, + }); + + // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) + Object.defineProperty(method, "fragment", { + configurable: false, + enumerable: true, + get: () => { + const fragment = contract.interface.getFunction(key); + assert( + fragment, + "no matching fragment in defineProperty", + "UNSUPPORTED_OPERATION", + { + operation: "fragment", + }, + ); + return fragment; + }, + }); + + return >method; } function buildWrappedEvent = Array>( - contract: BaseContract, - key: string, + contract: BaseContract, + key: string, ): ContractEvent { - const getFragment = function (...args: ContractEventArgs): EventFragment { - const fragment = contract.interface.getEvent(key, args); - - assert(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - - return fragment; - }; - - const method = function ( - ...args: ContractMethodArgs - ): PreparedTopicFilter { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - - defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, - _key: key, - - getFragment, - }); - - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - - return fragment; - }, - }); - - return >(method); + const getFragment = function (...args: ContractEventArgs): EventFragment { + const fragment = contract.interface.getEvent(key, args); + + assert(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { + operation: "fragment", + }); + + return fragment; + }; + + const method = function ( + ...args: ContractMethodArgs + ): PreparedTopicFilter { + return new PreparedTopicFilter(contract, getFragment(...args), args); + }; + + defineProperties(method, { + name: contract.interface.getEventName(key), + _contract: contract, + _key: key, + + getFragment, + }); + + // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) + Object.defineProperty(method, "fragment", { + configurable: false, + enumerable: true, + get: () => { + const fragment = contract.interface.getEvent(key); + + assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { + operation: "fragment", + }); + + return fragment; + }, + }); + + return >(method); } type Sub = { - tag: string; - listeners: Array<{ listener: Listener; once: boolean }>; - start: () => void; - stop: () => void; + tag: string; + listeners: Array<{ listener: Listener; once: boolean }>; + start: () => void; + stop: () => void; }; // The combination of TypeScrype, Private Fields and Proxies makes @@ -549,211 +549,211 @@ type Sub = { const internal = Symbol.for("_corebcInternal_contract"); type Internal = { - addrPromise: Promise; - addr: null | string; + addrPromise: Promise; + addr: null | string; - deployTx: null | ContractTransactionResponse; + deployTx: null | ContractTransactionResponse; - subs: Map; + subs: Map; }; const internalValues: WeakMap = new WeakMap(); function setInternal(contract: BaseContract, values: Internal): void { - internalValues.set(contract[internal], values); + internalValues.set(contract[internal], values); } function getInternal(contract: BaseContract): Internal { - return internalValues.get(contract[internal]) as Internal; + return internalValues.get(contract[internal]) as Internal; } function isDeferred(value: any): value is DeferredTopicFilter { - return ( - value && - typeof value === "object" && - "getTopicFilter" in value && - typeof value.getTopicFilter === "function" && - value.fragment - ); + return ( + value && + typeof value === "object" && + "getTopicFilter" in value && + typeof value.getTopicFilter === "function" && + value.fragment + ); } async function getSubInfo( - contract: BaseContract, - event: ContractEventName, + contract: BaseContract, + event: ContractEventName, ): Promise<{ - fragment: null | EventFragment; - tag: string; - topics: TopicFilter; + fragment: null | EventFragment; + tag: string; + topics: TopicFilter; }> { - let topics: Array>; - let fragment: null | EventFragment = null; - - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - - if (Array.isArray(event)) { - const topicHashify = function (name: string): string { - if (isHexString(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } else if (event === "*") { - topics = [null]; - } else if (typeof event === "string") { - if (isHexString(event, 32)) { - // Topic Hash - topics = [event]; - } else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - assertArgument(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } else { - assertArgument(false, "unknown event name", "event", event); - } - - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - - const tag = topics - .map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }) - .join("&"); - - return { fragment, tag, topics }; + let topics: Array>; + let fragment: null | EventFragment = null; + + // Convert named events to topicHash and get the fragment for + // events which need deconstructing. + + if (Array.isArray(event)) { + const topicHashify = function (name: string): string { + if (isHexString(name, 32)) { + return name; + } + const fragment = contract.interface.getEvent(name); + assertArgument(fragment, "unknown fragment", "name", name); + return fragment.topicHash; + }; + + // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` + topics = event.map((e) => { + if (e == null) { + return null; + } + if (Array.isArray(e)) { + return e.map(topicHashify); + } + return topicHashify(e); + }); + } else if (event === "*") { + topics = [null]; + } else if (typeof event === "string") { + if (isHexString(event, 32)) { + // Topic Hash + topics = [event]; + } else { + // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` + fragment = contract.interface.getEvent(event); + assertArgument(fragment, "unknown fragment", "event", event); + topics = [fragment.topicHash]; + } + } else if (isDeferred(event)) { + // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` + topics = await event.getTopicFilter(); + } else if ("fragment" in event) { + // ContractEvent; e.g. `contract.filter.Transfer` + fragment = event.fragment; + topics = [fragment.topicHash]; + } else { + assertArgument(false, "unknown event name", "event", event); + } + + // Normalize topics and sort TopicSets + topics = topics.map((t) => { + if (t == null) { + return null; + } + if (Array.isArray(t)) { + const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); + if (items.length === 1) { + return items[0]; + } + items.sort(); + return items; + } + return t.toLowerCase(); + }); + + const tag = topics + .map((t) => { + if (t == null) { + return "null"; + } + if (Array.isArray(t)) { + return t.join("|"); + } + return t; + }) + .join("&"); + + return { fragment, tag, topics }; } async function hasSub( - contract: BaseContract, - event: ContractEventName, + contract: BaseContract, + event: ContractEventName, ): Promise { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; + const { subs } = getInternal(contract); + return subs.get((await getSubInfo(contract, event)).tag) || null; } async function getSub( - contract: BaseContract, - operation: string, - event: ContractEventName, + contract: BaseContract, + operation: string, + event: ContractEventName, ): Promise { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - assert( - provider, - "contract runner does not support subscribing", - "UNSUPPORTED_OPERATION", - { operation }, - ); - - const { fragment, tag, topics } = await getSubInfo(contract, event); - - const { addr, subs } = getInternal(contract); - - let sub = subs.get(tag); - if (!sub) { - const address: string | Addressable = addr ? addr : contract; - const filter = { address, topics }; - const listener = (log: Log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } catch (error) {} - } - - // If fragment is null, we do not deconstruct the args to emit - - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment - ? contract.interface.decodeEventLog(fragment, log.data, log.topics) - : []; - emit(contract, event, args, (listener: null | Listener) => { - return new ContractEventPayload( - contract, - listener, - event, - _foundFragment, - log, - ); - }); - } else { - emit(contract, event, [], (listener: null | Listener) => { - return new ContractUnknownEventPayload( - contract, - listener, - event, - log, - ); - }); - } - }; - - let starting: Array> = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - - const stop = async () => { - if (starting.length == 0) { - return; - } - - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; + // Make sure our runner can actually subscribe to events + const provider = getProvider(contract.runner); + assert( + provider, + "contract runner does not support subscribing", + "UNSUPPORTED_OPERATION", + { operation }, + ); + + const { fragment, tag, topics } = await getSubInfo(contract, event); + + const { addr, subs } = getInternal(contract); + + let sub = subs.get(tag); + if (!sub) { + const address: string | Addressable = addr ? addr : contract; + const filter = { address, topics }; + const listener = (log: Log) => { + let foundFragment = fragment; + if (foundFragment == null) { + try { + foundFragment = contract.interface.getEvent(log.topics[0]); + } catch (error) {} + } + + // If fragment is null, we do not deconstruct the args to emit + + if (foundFragment) { + const _foundFragment = foundFragment; + const args = fragment + ? contract.interface.decodeEventLog(fragment, log.data, log.topics) + : []; + emit(contract, event, args, (listener: null | Listener) => { + return new ContractEventPayload( + contract, + listener, + event, + _foundFragment, + log, + ); + }); + } else { + emit(contract, event, [], (listener: null | Listener) => { + return new ContractUnknownEventPayload( + contract, + listener, + event, + log, + ); + }); + } + }; + + let starting: Array> = []; + const start = () => { + if (starting.length) { + return; + } + starting.push(provider.on(filter, listener)); + }; + + const stop = async () => { + if (starting.length == 0) { + return; + } + + let started = starting; + starting = []; + await Promise.all(started); + provider.off(filter, listener); + }; + + sub = { tag, listeners: [], start, stop }; + subs.set(tag, sub); + } + return sub; } // We use this to ensure one emit resolves before firing the next to @@ -764,470 +764,470 @@ let lastEmit: Promise = Promise.resolve(); type PayloadFunc = (listener: null | Listener) => ContractUnknownEventPayload; async function _emit( - contract: BaseContract, - event: ContractEventName, - args: Array, - payloadFunc: null | PayloadFunc, + contract: BaseContract, + event: ContractEventName, + args: Array, + payloadFunc: null | PayloadFunc, ): Promise { - await lastEmit; - - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } catch (error) {} - return !once; - }); - return count > 0; + await lastEmit; + + const sub = await hasSub(contract, event); + if (!sub) { + return false; + } + + const count = sub.listeners.length; + sub.listeners = sub.listeners.filter(({ listener, once }) => { + const passArgs = Array.from(args); + if (payloadFunc) { + passArgs.push(payloadFunc(once ? null : listener)); + } + try { + listener.call(contract, ...passArgs); + } catch (error) {} + return !once; + }); + return count > 0; } async function emit( - contract: BaseContract, - event: ContractEventName, - args: Array, - payloadFunc: null | PayloadFunc, + contract: BaseContract, + event: ContractEventName, + args: Array, + payloadFunc: null | PayloadFunc, ): Promise { - try { - await lastEmit; - } catch (error) {} + try { + await lastEmit; + } catch (error) {} - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; + const resultPromise = _emit(contract, event, args, payloadFunc); + lastEmit = resultPromise; + return await resultPromise; } const passProperties = ["then"]; export class BaseContract - implements Addressable, EventEmitterable + implements Addressable, EventEmitterable { - readonly target!: string | Addressable; - readonly interface!: Interface; - readonly runner!: null | ContractRunner; - - readonly filters!: Record; - - readonly [internal]: any; - - readonly fallback!: null | WrappedFallback; - - constructor( - target: string | Addressable, - abi: Interface | InterfaceAbi, - runner?: null | ContractRunner, - _deployTx?: null | TransactionResponse, - ) { - if (runner == null) { - runner = null; - } - const iface = Interface.from(abi); - defineProperties(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - - let addrPromise; - let addr: any = null; - - let deployTx: null | ContractTransactionResponse = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new ContractTransactionResponse( - this.interface, - provider, - _deployTx, - ); - } - - let subs = new Map(); - - // Resolve the target as the address - if (typeof target === "string") { - if (isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw makeError( - "contract runner does not support name resolution", - "UNSUPPORTED_OPERATION", - { - operation: "resolveName", - }, - ); - } - - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - } else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - - // Add the event filters - const filters = new Proxy( - {}, - { - get: (target, _prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - - const prop = String(_prop); - - const result = this.getEvent(prop); - if (result) { - return result; - } - - throw new Error(`unknown contract event: ${prop}`); - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - - return ( - Reflect.has(target, prop) || this.interface.hasEvent(String(prop)) - ); - }, - }, - ); - defineProperties(this, { filters }); - - defineProperties(this, { - fallback: - iface.receive || iface.fallback ? buildWrappedFallback(this) : null, - }); - - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, _prop, receiver) => { - if (_prop in target || passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - - const prop = String(_prop); - - const result = target.getFunction(prop); - if (result) { - return result; - } - - throw new Error(`unknown contract method: ${prop}`); - }, - has: (target, prop) => { - if (prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - - return target.interface.hasFunction(String(prop)); - }, - }); - } - - connect(runner: null | ContractRunner): BaseContract { - return new BaseContract(this.target, this.interface, runner); - } - - async getAddress(): Promise { - return await getInternal(this).addrPromise; - } - - async getDeployedCode(): Promise { - const provider = getProvider(this.runner); - assert( - provider, - "runner does not support .provider", - "UNSUPPORTED_OPERATION", - { operation: "getDeployedCode" }, - ); - - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - - async waitForDeployment(): Promise { - // We have the deployement transaction; just use that (throws if deployement fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - assert( - provider != null, - "contract runner does not support .provider", - "UNSUPPORTED_OPERATION", - { operation: "waitForDeployment" }, - ); - - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - - deploymentTransaction(): null | ContractTransactionResponse { - return getInternal(this).deployTx; - } - - getFunction( - key: string | FunctionFragment, - ): T { - if (typeof key !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - - getEvent(key: string | EventFragment): ContractEvent { - if (typeof key !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - - async queryTransaction(hash: string): Promise> { - // Is this useful? - throw new Error("@TODO"); - } - - async queryFilter( - event: ContractEventName, - fromBlock?: BlockTag, - toBlock?: BlockTag, - ): Promise> { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = addr ? addr : await addrPromise; - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - - const provider = getProvider(this.runner); - assert( - provider, - "contract runner does not have a provider", - "UNSUPPORTED_OPERATION", - { operation: "queryFilter" }, - ); - - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } catch (error) {} - } - - if (foundFragment) { - return new EventLog(log, this.interface, foundFragment); - } else { - return new Log(log, provider); - } - }); - } - - async on(event: ContractEventName, listener: Listener): Promise { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - - async once(event: ContractEventName, listener: Listener): Promise { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - - async emit(event: ContractEventName, ...args: Array): Promise { - return await emit(this, event, args, null); - } - - async listenerCount(event?: ContractEventName): Promise { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - - const { subs } = getInternal(this); - - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - - async listeners(event?: ContractEventName): Promise> { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - - const { subs } = getInternal(this); - - let result: Array = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - - async off(event: ContractEventName, listener?: Listener): Promise { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - - return this; - } - - async removeAllListeners(event?: ContractEventName): Promise { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - - return this; - } - - // Alias for "on" - async addListener( - event: ContractEventName, - listener: Listener, - ): Promise { - return await this.on(event, listener); - } - - // Alias for "off" - async removeListener( - event: ContractEventName, - listener: Listener, - ): Promise { - return await this.off(event, listener); - } - - static buildClass( - abi: InterfaceAbi, - ): new ( - target: string, - runner?: null | ContractRunner, - ) => BaseContract & Omit { - class CustomContract extends BaseContract { - constructor(address: string, runner: null | ContractRunner = null) { - super(address, abi, runner); - } - } - return CustomContract as any; - } - - static from( - target: string, - abi: InterfaceAbi, - runner?: null | ContractRunner, - ): BaseContract & Omit { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract as any; - } - static isIndexed(value: any): value is Indexed { - return Indexed.isIndexed(value); - } + readonly target!: string | Addressable; + readonly interface!: Interface; + readonly runner!: null | ContractRunner; + + readonly filters!: Record; + + readonly [internal]: any; + + readonly fallback!: null | WrappedFallback; + + constructor( + target: string | Addressable, + abi: Interface | InterfaceAbi, + runner?: null | ContractRunner, + _deployTx?: null | TransactionResponse, + ) { + if (runner == null) { + runner = null; + } + const iface = Interface.from(abi); + defineProperties(this, { target, runner, interface: iface }); + Object.defineProperty(this, internal, { value: {} }); + + let addrPromise; + let addr: any = null; + + let deployTx: null | ContractTransactionResponse = null; + if (_deployTx) { + const provider = getProvider(runner); + // @TODO: the provider can be null; make a custom dummy provider that will throw a + // meaningful error + deployTx = new ContractTransactionResponse( + this.interface, + provider, + _deployTx, + ); + } + + let subs = new Map(); + + // Resolve the target as the address + if (typeof target === "string") { + if (isHexString(target)) { + addr = target; + addrPromise = Promise.resolve(target); + } else { + const resolver = getRunner(runner, "resolveName"); + if (!canResolve(resolver)) { + throw makeError( + "contract runner does not support name resolution", + "UNSUPPORTED_OPERATION", + { + operation: "resolveName", + }, + ); + } + + addrPromise = resolver.resolveName(target).then((addr) => { + if (addr == null) { + throw new Error("TODO"); + } + getInternal(this).addr = addr; + return addr; + }); + } + } else { + addrPromise = target.getAddress().then((addr) => { + if (addr == null) { + throw new Error("TODO"); + } + getInternal(this).addr = addr; + return addr; + }); + } + + // Set our private values + setInternal(this, { addrPromise, addr, deployTx, subs }); + + // Add the event filters + const filters = new Proxy( + {}, + { + get: (target, _prop, receiver) => { + // Pass important checks (like `then` for Promise) through + if (passProperties.indexOf(_prop) >= 0) { + return Reflect.get(target, _prop, receiver); + } + + const prop = String(_prop); + + const result = this.getEvent(prop); + if (result) { + return result; + } + + throw new Error(`unknown contract event: ${prop}`); + }, + has: (target, prop) => { + // Pass important checks (like `then` for Promise) through + if (passProperties.indexOf(prop) >= 0) { + return Reflect.has(target, prop); + } + + return ( + Reflect.has(target, prop) || this.interface.hasEvent(String(prop)) + ); + }, + }, + ); + defineProperties(this, { filters }); + + defineProperties(this, { + fallback: + iface.receive || iface.fallback ? buildWrappedFallback(this) : null, + }); + + // Return a Proxy that will respond to functions + return new Proxy(this, { + get: (target, _prop, receiver) => { + if (_prop in target || passProperties.indexOf(_prop) >= 0) { + return Reflect.get(target, _prop, receiver); + } + + const prop = String(_prop); + + const result = target.getFunction(prop); + if (result) { + return result; + } + + throw new Error(`unknown contract method: ${prop}`); + }, + has: (target, prop) => { + if (prop in target || passProperties.indexOf(prop) >= 0) { + return Reflect.has(target, prop); + } + + return target.interface.hasFunction(String(prop)); + }, + }); + } + + connect(runner: null | ContractRunner): BaseContract { + return new BaseContract(this.target, this.interface, runner); + } + + async getAddress(): Promise { + return await getInternal(this).addrPromise; + } + + async getDeployedCode(): Promise { + const provider = getProvider(this.runner); + assert( + provider, + "runner does not support .provider", + "UNSUPPORTED_OPERATION", + { operation: "getDeployedCode" }, + ); + + const code = await provider.getCode(await this.getAddress()); + if (code === "0x") { + return null; + } + return code; + } + + async waitForDeployment(): Promise { + // We have the deployement transaction; just use that (throws if deployement fails) + const deployTx = this.deploymentTransaction(); + if (deployTx) { + await deployTx.wait(); + return this; + } + + // Check for code + const code = await this.getDeployedCode(); + if (code != null) { + return this; + } + + // Make sure we can subscribe to a provider event + const provider = getProvider(this.runner); + assert( + provider != null, + "contract runner does not support .provider", + "UNSUPPORTED_OPERATION", + { operation: "waitForDeployment" }, + ); + + return new Promise((resolve, reject) => { + const checkCode = async () => { + try { + const code = await this.getDeployedCode(); + if (code != null) { + return resolve(this); + } + provider.once("block", checkCode); + } catch (error) { + reject(error); + } + }; + checkCode(); + }); + } + + deploymentTransaction(): null | ContractTransactionResponse { + return getInternal(this).deployTx; + } + + getFunction( + key: string | FunctionFragment, + ): T { + if (typeof key !== "string") { + key = key.format(); + } + const func = buildWrappedMethod(this, key); + return func; + } + + getEvent(key: string | EventFragment): ContractEvent { + if (typeof key !== "string") { + key = key.format(); + } + return buildWrappedEvent(this, key); + } + + async queryTransaction(hash: string): Promise> { + // Is this useful? + throw new Error("@TODO"); + } + + async queryFilter( + event: ContractEventName, + fromBlock?: BlockTag, + toBlock?: BlockTag, + ): Promise> { + if (fromBlock == null) { + fromBlock = 0; + } + if (toBlock == null) { + toBlock = "latest"; + } + const { addr, addrPromise } = getInternal(this); + const address = addr ? addr : await addrPromise; + const { fragment, topics } = await getSubInfo(this, event); + const filter = { address, topics, fromBlock, toBlock }; + + const provider = getProvider(this.runner); + assert( + provider, + "contract runner does not have a provider", + "UNSUPPORTED_OPERATION", + { operation: "queryFilter" }, + ); + + return (await provider.getLogs(filter)).map((log) => { + let foundFragment = fragment; + if (foundFragment == null) { + try { + foundFragment = this.interface.getEvent(log.topics[0]); + } catch (error) {} + } + + if (foundFragment) { + return new EventLog(log, this.interface, foundFragment); + } else { + return new Log(log, provider); + } + }); + } + + async on(event: ContractEventName, listener: Listener): Promise { + const sub = await getSub(this, "on", event); + sub.listeners.push({ listener, once: false }); + sub.start(); + return this; + } + + async once(event: ContractEventName, listener: Listener): Promise { + const sub = await getSub(this, "once", event); + sub.listeners.push({ listener, once: true }); + sub.start(); + return this; + } + + async emit(event: ContractEventName, ...args: Array): Promise { + return await emit(this, event, args, null); + } + + async listenerCount(event?: ContractEventName): Promise { + if (event) { + const sub = await hasSub(this, event); + if (!sub) { + return 0; + } + return sub.listeners.length; + } + + const { subs } = getInternal(this); + + let total = 0; + for (const { listeners } of subs.values()) { + total += listeners.length; + } + return total; + } + + async listeners(event?: ContractEventName): Promise> { + if (event) { + const sub = await hasSub(this, event); + if (!sub) { + return []; + } + return sub.listeners.map(({ listener }) => listener); + } + + const { subs } = getInternal(this); + + let result: Array = []; + for (const { listeners } of subs.values()) { + result = result.concat(listeners.map(({ listener }) => listener)); + } + return result; + } + + async off(event: ContractEventName, listener?: Listener): Promise { + const sub = await hasSub(this, event); + if (!sub) { + return this; + } + + if (listener) { + const index = sub.listeners + .map(({ listener }) => listener) + .indexOf(listener); + if (index >= 0) { + sub.listeners.splice(index, 1); + } + } + + if (listener == null || sub.listeners.length === 0) { + sub.stop(); + getInternal(this).subs.delete(sub.tag); + } + + return this; + } + + async removeAllListeners(event?: ContractEventName): Promise { + if (event) { + const sub = await hasSub(this, event); + if (!sub) { + return this; + } + sub.stop(); + getInternal(this).subs.delete(sub.tag); + } else { + const { subs } = getInternal(this); + for (const { tag, stop } of subs.values()) { + stop(); + subs.delete(tag); + } + } + + return this; + } + + // Alias for "on" + async addListener( + event: ContractEventName, + listener: Listener, + ): Promise { + return await this.on(event, listener); + } + + // Alias for "off" + async removeListener( + event: ContractEventName, + listener: Listener, + ): Promise { + return await this.off(event, listener); + } + + static buildClass( + abi: InterfaceAbi, + ): new ( + target: string, + runner?: null | ContractRunner, + ) => BaseContract & Omit { + class CustomContract extends BaseContract { + constructor(address: string, runner: null | ContractRunner = null) { + super(address, abi, runner); + } + } + return CustomContract as any; + } + + static from( + target: string, + abi: InterfaceAbi, + runner?: null | ContractRunner, + ): BaseContract & Omit { + if (runner == null) { + runner = null; + } + const contract = new this(target, abi, runner); + return contract as any; + } + static isIndexed(value: any): value is Indexed { + return Indexed.isIndexed(value); + } } function _ContractBase(): new ( - target: string, - abi: InterfaceAbi, - runner?: null | ContractRunner, + target: string, + abi: InterfaceAbi, + runner?: null | ContractRunner, ) => BaseContract & Omit { - return BaseContract as any; + return BaseContract as any; } export class Contract extends _ContractBase() {} diff --git a/src.ts/contract/factory.ts b/src.ts/contract/factory.ts index be7ff8a43..107e95459 100644 --- a/src.ts/contract/factory.ts +++ b/src.ts/contract/factory.ts @@ -1,12 +1,12 @@ import { Interface } from "../abi/index.js"; import { getCreateAddress } from "../address/contract-address.js"; import { - concat, - defineProperties, - getBytes, - hexlify, - assert, - assertArgument, + concat, + defineProperties, + getBytes, + hexlify, + assert, + assertArgument, } from "../utils/index.js"; import { BaseContract, copyOverrides, resolveArgs } from "./contract.js"; @@ -16,9 +16,9 @@ import type { ContractRunner } from "../providers/index.js"; import type { BytesLike } from "../utils/index.js"; import type { - ContractInterface, - ContractMethodArgs, - ContractDeployTransaction, + ContractInterface, + ContractMethodArgs, + ContractDeployTransaction, } from "./types.js"; import type { ContractTransactionResponse } from "./wrappers.js"; import { isBytes } from "../utils/data.js"; @@ -26,116 +26,116 @@ import { isBytes } from "../utils/data.js"; // A = Arguments to the constructor // I = Interface of deployed contracts export class ContractFactory< - A extends Array = Array, - I = BaseContract, + A extends Array = Array, + I = BaseContract, > { - readonly interface!: Interface; - readonly bytecode!: string; - readonly runner!: null | ContractRunner; - - constructor( - abi: Interface | InterfaceAbi, - bytecode: BytesLike | { object: string }, - runner?: null | ContractRunner, - ) { - const iface = Interface.from(abi); - - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = hexlify(getBytes(bytecode)); - } else if (typeof bytecode === "string") { - bytecode = bytecode; - } else if (isBytes(bytecode)) { - bytecode = hexlify(bytecode); - } else if (bytecode && typeof bytecode.object === "string") { - // Allow the bytecode object from the Solidity compiler - bytecode = (bytecode).object; - } else { - // Crash in the next verification step - bytecode = "!"; - } - - defineProperties(this, { - // @ts-ignore - bytecode, - interface: iface, - runner: runner || null, - }); - } - - async getDeployTransaction( - ...args: ContractMethodArgs - ): Promise { - let overrides: Omit = {}; - - const fragment = this.interface.deploy; - - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - - const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); - - const data = concat([ - this.bytecode, - this.interface.encodeDeploy(resolvedArgs), - ]) as string; - return Object.assign({}, overrides, { data }); - } - - async deploy(...args: ContractMethodArgs): Promise< - BaseContract & { - deploymentTransaction(): ContractTransactionResponse; - } & Omit - > { - const tx = await this.getDeployTransaction(...args); - - assert( - this.runner && typeof this.runner.sendTransaction === "function", - "factory runner does not support sending transactions", - "UNSUPPORTED_OPERATION", - { - operation: "sendTransaction", - }, - ); - - const sentTx = await this.runner.sendTransaction(tx); - const address = getCreateAddress(sentTx); - return new (BaseContract)( - address, - this.interface, - this.runner, - sentTx, - ); - } - - connect(runner: null | ContractRunner): ContractFactory { - return new ContractFactory(this.interface, this.bytecode, runner); - } - - static fromSolidity = Array, I = ContractInterface>( - output: any, - runner?: ContractRunner, - ): ContractFactory { - assertArgument(output != null, "bad compiler output", "output", output); - - if (typeof output === "string") { - output = JSON.parse(output); - } - - const abi = output.abi; - - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - - return new this(abi, bytecode, runner); - } + readonly interface!: Interface; + readonly bytecode!: string; + readonly runner!: null | ContractRunner; + + constructor( + abi: Interface | InterfaceAbi, + bytecode: BytesLike | { object: string }, + runner?: null | ContractRunner, + ) { + const iface = Interface.from(abi); + + // Dereference Solidity bytecode objects and allow a missing `0x`-prefix + if (bytecode instanceof Uint8Array) { + bytecode = hexlify(getBytes(bytecode)); + } else if (typeof bytecode === "string") { + bytecode = bytecode; + } else if (isBytes(bytecode)) { + bytecode = hexlify(bytecode); + } else if (bytecode && typeof bytecode.object === "string") { + // Allow the bytecode object from the Solidity compiler + bytecode = (bytecode).object; + } else { + // Crash in the next verification step + bytecode = "!"; + } + + defineProperties(this, { + // @ts-ignore + bytecode, + interface: iface, + runner: runner || null, + }); + } + + async getDeployTransaction( + ...args: ContractMethodArgs + ): Promise { + let overrides: Omit = {}; + + const fragment = this.interface.deploy; + + if (fragment.inputs.length + 1 === args.length) { + overrides = await copyOverrides(args.pop()); + } + + if (fragment.inputs.length !== args.length) { + throw new Error("incorrect number of arguments to constructor"); + } + + const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); + + const data = concat([ + this.bytecode, + this.interface.encodeDeploy(resolvedArgs), + ]) as string; + return Object.assign({}, overrides, { data }); + } + + async deploy(...args: ContractMethodArgs): Promise< + BaseContract & { + deploymentTransaction(): ContractTransactionResponse; + } & Omit + > { + const tx = await this.getDeployTransaction(...args); + + assert( + this.runner && typeof this.runner.sendTransaction === "function", + "factory runner does not support sending transactions", + "UNSUPPORTED_OPERATION", + { + operation: "sendTransaction", + }, + ); + + const sentTx = await this.runner.sendTransaction(tx); + const address = getCreateAddress(sentTx); + return new (BaseContract)( + address, + this.interface, + this.runner, + sentTx, + ); + } + + connect(runner: null | ContractRunner): ContractFactory { + return new ContractFactory(this.interface, this.bytecode, runner); + } + + static fromSolidity = Array, I = ContractInterface>( + output: any, + runner?: ContractRunner, + ): ContractFactory { + assertArgument(output != null, "bad compiler output", "output", output); + + if (typeof output === "string") { + output = JSON.parse(output); + } + + const abi = output.abi; + + let bytecode = ""; + if (output.bytecode) { + bytecode = output.bytecode; + } else if (output.evm && output.evm.bytecode) { + bytecode = output.evm.bytecode; + } + + return new this(abi, bytecode, runner); + } } diff --git a/src.ts/contract/index.ts b/src.ts/contract/index.ts index 9b2c2f849..7767f5618 100644 --- a/src.ts/contract/index.ts +++ b/src.ts/contract/index.ts @@ -8,26 +8,26 @@ export { BaseContract, Contract } from "./contract.js"; export { ContractFactory } from "./factory.js"; export { - ContractEventPayload, - ContractUnknownEventPayload, - ContractTransactionReceipt, - ContractTransactionResponse, - EventLog, + ContractEventPayload, + ContractUnknownEventPayload, + ContractTransactionReceipt, + ContractTransactionResponse, + EventLog, } from "./wrappers.js"; export type { - BaseContractMethod, - ConstantContractMethod, - PostfixOverrides, - ContractEvent, - ContractEventArgs, - ContractEventName, - ContractDeployTransaction, - ContractInterface, - ContractMethod, - ContractMethodArgs, - ContractTransaction, - DeferredTopicFilter, - Overrides, - WrappedFallback, + BaseContractMethod, + ConstantContractMethod, + PostfixOverrides, + ContractEvent, + ContractEventArgs, + ContractEventName, + ContractDeployTransaction, + ContractInterface, + ContractMethod, + ContractMethodArgs, + ContractTransaction, + DeferredTopicFilter, + Overrides, + WrappedFallback, } from "./types.js"; diff --git a/src.ts/contract/types.ts b/src.ts/contract/types.ts index 70b96b09c..48df2fd70 100644 --- a/src.ts/contract/types.ts +++ b/src.ts/contract/types.ts @@ -1,45 +1,44 @@ import type { - EventFragment, - FunctionFragment, - Result, - Typed, + EventFragment, + FunctionFragment, + Result, + Typed, } from "../abi/index.js"; import type { - TransactionRequest, - PreparedTransactionRequest, - TopicFilter, + TransactionRequest, + PreparedTransactionRequest, + TopicFilter, } from "../providers/index.js"; import type { ContractTransactionResponse } from "./wrappers.js"; // The types of events a Contract can listen for export type ContractEventName = - | string - | ContractEvent - | TopicFilter - | DeferredTopicFilter; + string | ContractEvent | TopicFilter | DeferredTopicFilter; export interface ContractInterface { - [name: string]: BaseContractMethod; + [name: string]: BaseContractMethod; } export interface DeferredTopicFilter { - getTopicFilter(): Promise; - fragment: EventFragment; + getTopicFilter(): Promise; + fragment: EventFragment; } export interface ContractTransaction extends PreparedTransactionRequest { - // These are populated by contract methods and cannot bu null - to: string; - data: string; + // These are populated by contract methods and cannot bu null + to: string; + data: string; - // These are resolved - from?: string; + // These are resolved + from?: string; } // Deployment Transactions have no `to` -export interface ContractDeployTransaction - extends Omit {} +export interface ContractDeployTransaction extends Omit< + ContractTransaction, + "to" +> {} // Overrides; cannot override `to` or `data` as Contract populates these export interface Overrides extends Omit {} @@ -47,7 +46,7 @@ export interface Overrides extends Omit {} // Arguments for methods; with an optional (n+1)th Override export type PostfixOverrides> = A | [...A, Overrides]; export type ContractMethodArgs> = PostfixOverrides<{ - [I in keyof A]-?: A[I] | Typed; + [I in keyof A]-?: A[I] | Typed; }>; // A = Arguments passed in as a tuple @@ -56,61 +55,63 @@ export type ContractMethodArgs> = PostfixOverrides<{ // D = The type the default call will return (i.e. R for view/pure, // TransactionResponse otherwise) export interface BaseContractMethod< - A extends Array = Array, - R = any, - D extends R | ContractTransactionResponse = R | ContractTransactionResponse, + A extends Array = Array, + R = any, + D extends R | ContractTransactionResponse = R | ContractTransactionResponse, > { - (...args: ContractMethodArgs): Promise; + (...args: ContractMethodArgs): Promise; - name: string; + name: string; - fragment: FunctionFragment; + fragment: FunctionFragment; - getFragment(...args: ContractMethodArgs): FunctionFragment; + getFragment(...args: ContractMethodArgs): FunctionFragment; - populateTransaction( - ...args: ContractMethodArgs - ): Promise; - staticCall(...args: ContractMethodArgs): Promise; - send(...args: ContractMethodArgs): Promise; - estimateEnergy(...args: ContractMethodArgs): Promise; - staticCallResult(...args: ContractMethodArgs): Promise; + populateTransaction( + ...args: ContractMethodArgs + ): Promise; + staticCall(...args: ContractMethodArgs): Promise; + send(...args: ContractMethodArgs): Promise; + estimateEnergy(...args: ContractMethodArgs): Promise; + staticCallResult(...args: ContractMethodArgs): Promise; } export interface ContractMethod< - A extends Array = Array, - R = any, - D extends R | ContractTransactionResponse = R | ContractTransactionResponse, + A extends Array = Array, + R = any, + D extends R | ContractTransactionResponse = R | ContractTransactionResponse, > extends BaseContractMethod {} -export interface ConstantContractMethod, R = any> - extends ContractMethod {} +export interface ConstantContractMethod< + A extends Array, + R = any, +> extends ContractMethod {} // Arguments for events; with each element optional and/or nullable export type ContractEventArgs> = { - [I in keyof A]?: A[I] | Typed | null; + [I in keyof A]?: A[I] | Typed | null; }; export interface ContractEvent = Array> { - (...args: ContractEventArgs): DeferredTopicFilter; + (...args: ContractEventArgs): DeferredTopicFilter; - name: string; + name: string; - fragment: EventFragment; - getFragment(...args: ContractEventArgs): EventFragment; + fragment: EventFragment; + getFragment(...args: ContractEventArgs): EventFragment; } export interface WrappedFallback { - ( - overrides?: Omit, - ): Promise; - - populateTransaction( - overrides?: Omit, - ): Promise; - staticCall(overrides?: Omit): Promise; - send( - overrides?: Omit, - ): Promise; - estimateEnergy(overrides?: Omit): Promise; + ( + overrides?: Omit, + ): Promise; + + populateTransaction( + overrides?: Omit, + ): Promise; + staticCall(overrides?: Omit): Promise; + send( + overrides?: Omit, + ): Promise; + estimateEnergy(overrides?: Omit): Promise; } diff --git a/src.ts/contract/wrappers.ts b/src.ts/contract/wrappers.ts index 7053d5184..ea4f7469e 100644 --- a/src.ts/contract/wrappers.ts +++ b/src.ts/contract/wrappers.ts @@ -1,8 +1,8 @@ import { - Block, - Log, - TransactionReceipt, - TransactionResponse, + Block, + Log, + TransactionReceipt, + TransactionResponse, } from "../providers/provider.js"; import { defineProperties, EventPayload } from "../utils/index.js"; @@ -14,120 +14,120 @@ import type { BaseContract } from "./contract.js"; import type { ContractEventName } from "./types.js"; export class EventLog extends Log { - readonly interface!: Interface; - readonly fragment!: EventFragment; - readonly args!: Result; - - constructor(log: Log, iface: Interface, fragment: EventFragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - defineProperties(this, { args, fragment, interface: iface }); - } - - get eventName(): string { - return this.fragment.name; - } - get eventSignature(): string { - return this.fragment.format(); - } + readonly interface!: Interface; + readonly fragment!: EventFragment; + readonly args!: Result; + + constructor(log: Log, iface: Interface, fragment: EventFragment) { + super(log, log.provider); + const args = iface.decodeEventLog(fragment, log.data, log.topics); + defineProperties(this, { args, fragment, interface: iface }); + } + + get eventName(): string { + return this.fragment.name; + } + get eventSignature(): string { + return this.fragment.format(); + } } export class ContractTransactionReceipt extends TransactionReceipt { - readonly #iface: Interface; - - constructor(iface: Interface, provider: Provider, tx: TransactionReceipt) { - super(tx, provider); - this.#iface = iface; - } - - get logs(): Array { - return super.logs.map((log) => { - const fragment = log.topics.length - ? this.#iface.getEvent(log.topics[0]) - : null; - if (fragment) { - return new EventLog(log, this.#iface, fragment); - } else { - return log; - } - }); - } + readonly #iface: Interface; + + constructor(iface: Interface, provider: Provider, tx: TransactionReceipt) { + super(tx, provider); + this.#iface = iface; + } + + get logs(): Array { + return super.logs.map((log) => { + const fragment = log.topics.length + ? this.#iface.getEvent(log.topics[0]) + : null; + if (fragment) { + return new EventLog(log, this.#iface, fragment); + } else { + return log; + } + }); + } } export class ContractTransactionResponse extends TransactionResponse { - readonly #iface: Interface; - - constructor(iface: Interface, provider: Provider, tx: TransactionResponse) { - super(tx, provider); - this.#iface = iface; - } - - async wait(confirms?: number): Promise { - const receipt = await super.wait(); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } + readonly #iface: Interface; + + constructor(iface: Interface, provider: Provider, tx: TransactionResponse) { + super(tx, provider); + this.#iface = iface; + } + + async wait(confirms?: number): Promise { + const receipt = await super.wait(); + if (receipt == null) { + return null; + } + return new ContractTransactionReceipt(this.#iface, this.provider, receipt); + } } export class ContractUnknownEventPayload extends EventPayload { - readonly log!: Log; - - constructor( - contract: BaseContract, - listener: null | Listener, - filter: ContractEventName, - log: Log, - ) { - super(contract, listener, filter); - defineProperties(this, { log }); - } - - async getBlock(): Promise { - return await this.log.getBlock(); - } - - async getTransaction(): Promise { - return await this.log.getTransaction(); - } - - async getTransactionReceipt(): Promise { - return await this.log.getTransactionReceipt(); - } + readonly log!: Log; + + constructor( + contract: BaseContract, + listener: null | Listener, + filter: ContractEventName, + log: Log, + ) { + super(contract, listener, filter); + defineProperties(this, { log }); + } + + async getBlock(): Promise { + return await this.log.getBlock(); + } + + async getTransaction(): Promise { + return await this.log.getTransaction(); + } + + async getTransactionReceipt(): Promise { + return await this.log.getTransactionReceipt(); + } } export class ContractEventPayload extends ContractUnknownEventPayload { - declare readonly fragment: EventFragment; - declare readonly log: EventLog; - declare readonly args: Result; - - constructor( - contract: BaseContract, - listener: null | Listener, - filter: ContractEventName, - fragment: EventFragment, - _log: Log, - ) { - super( - contract, - listener, - filter, - new EventLog(_log, contract.interface, fragment), - ); - const args = contract.interface.decodeEventLog( - fragment, - this.log.data, - this.log.topics, - ); - defineProperties(this, { args, fragment }); - } - - get eventName(): string { - return this.fragment.name; - } - - get eventSignature(): string { - return this.fragment.format(); - } + declare readonly fragment: EventFragment; + declare readonly log: EventLog; + declare readonly args: Result; + + constructor( + contract: BaseContract, + listener: null | Listener, + filter: ContractEventName, + fragment: EventFragment, + _log: Log, + ) { + super( + contract, + listener, + filter, + new EventLog(_log, contract.interface, fragment), + ); + const args = contract.interface.decodeEventLog( + fragment, + this.log.data, + this.log.topics, + ); + defineProperties(this, { args, fragment }); + } + + get eventName(): string { + return this.fragment.name; + } + + get eventSignature(): string { + return this.fragment.format(); + } } diff --git a/src.ts/corebc.ts b/src.ts/corebc.ts index 06dc13039..17036ae9a 100644 --- a/src.ts/corebc.ts +++ b/src.ts/corebc.ts @@ -2,250 +2,250 @@ export { version } from "./_version.js"; export { publicToAddress } from "./transaction/address.js"; export { - decodeBytes32String, - encodeBytes32String, - AbiCoder, - ConstructorFragment, - ErrorFragment, - EventFragment, - Fragment, - FallbackFragment, - FunctionFragment, - NamedFragment, - ParamType, - StructFragment, - checkResultErrors, - ErrorDescription, - Indexed, - Interface, - LogDescription, - Result, - TransactionDescription, - Typed, + decodeBytes32String, + encodeBytes32String, + AbiCoder, + ConstructorFragment, + ErrorFragment, + EventFragment, + Fragment, + FallbackFragment, + FunctionFragment, + NamedFragment, + ParamType, + StructFragment, + checkResultErrors, + ErrorDescription, + Indexed, + Interface, + LogDescription, + Result, + TransactionDescription, + Typed, } from "./abi/index.js"; export { getAddress, networkIdToPrefix } from "./address/index.js"; export { - getCreate2Address, - getCreateAddress, + getCreate2Address, + getCreateAddress, } from "./address/contract-address.js"; export { isAddressable, isAddress, resolveAddress } from "./address/checks.js"; export { - ZeroAddress, - OrePerXCB, - MaxUint256, - MinInt256, - MaxInt256, - N, - ZeroHash, - CoreSymbol, - MessagePrefix, + ZeroAddress, + OrePerXCB, + MaxUint256, + MinInt256, + MaxInt256, + N, + ZeroHash, + CoreSymbol, + MessagePrefix, } from "./constants/index.js"; export { - BaseContract, - Contract, - ContractFactory, - ContractEventPayload, - ContractTransactionReceipt, - ContractTransactionResponse, - ContractUnknownEventPayload, - EventLog, + BaseContract, + Contract, + ContractFactory, + ContractEventPayload, + ContractTransactionReceipt, + ContractTransactionResponse, + ContractUnknownEventPayload, + EventLog, } from "./contract/index.js"; export { - computeHmac, - randomBytes, - ripemd160, - sha256, - sha512, - pbkdf2, - scrypt, - scryptSync, - lock, - Ed448Goldilock, - Signature, - SigningKey, - keccak256, + computeHmac, + randomBytes, + ripemd160, + sha256, + sha512, + pbkdf2, + scrypt, + scryptSync, + lock, + Ed448Goldilock, + Signature, + SigningKey, + keccak256, } from "./crypto/index.js"; export { - id, - hashMessage, - verifyMessage, - solidityPacked, - solidityPackedSha256, - TypedDataEncoder, - verifyTypedData, + id, + hashMessage, + verifyMessage, + solidityPacked, + solidityPackedSha256, + TypedDataEncoder, + verifyTypedData, } from "./hash/index.js"; export { - getDefaultProvider, - Block, - FeeData, - Log, - TransactionReceipt, - TransactionResponse, - AbstractSigner, - NonceManager, - VoidSigner, - AbstractProvider, - FallbackProvider, - JsonRpcApiProvider, - JsonRpcProvider, - JsonRpcSigner, - BrowserProvider, - AlchemyProvider, - AnkrProvider, - CloudflareProvider, - InfuraProvider, - InfuraWebSocketProvider, - PocketProvider, - QuickNodeProvider, - IpcSocketProvider, - SocketProvider, - WebSocketProvider, - Network, - FeeDataNetworkPlugin, - EnergyCostPlugin, - NetworkPlugin, - SocketBlockSubscriber, - SocketEventSubscriber, - SocketPendingSubscriber, - SocketSubscriber, - UnmanagedSubscriber, - copyRequest, - showThrottleMessage, + getDefaultProvider, + Block, + FeeData, + Log, + TransactionReceipt, + TransactionResponse, + AbstractSigner, + NonceManager, + VoidSigner, + AbstractProvider, + FallbackProvider, + JsonRpcApiProvider, + JsonRpcProvider, + JsonRpcSigner, + BrowserProvider, + AlchemyProvider, + AnkrProvider, + CloudflareProvider, + InfuraProvider, + InfuraWebSocketProvider, + PocketProvider, + QuickNodeProvider, + IpcSocketProvider, + SocketProvider, + WebSocketProvider, + Network, + FeeDataNetworkPlugin, + EnergyCostPlugin, + NetworkPlugin, + SocketBlockSubscriber, + SocketEventSubscriber, + SocketPendingSubscriber, + SocketSubscriber, + UnmanagedSubscriber, + copyRequest, + showThrottleMessage, } from "./providers/index.js"; export { - accessListify, - computeAddress, - recoverAddress, - Transaction, + accessListify, + computeAddress, + recoverAddress, + Transaction, } from "./transaction/index.js"; export { - decodeBase58, - encodeBase58, - decodeBase64, - encodeBase64, - concat, - dataLength, - dataSlice, - getBytes, - getBytesCopy, - hexlify, - isHexString, - isBytesLike, - stripZerosLeft, - zeroPadBytes, - zeroPadValue, - defineProperties, - resolveProperties, - assert, - assertArgument, - assertArgumentCount, - assertNormalize, - assertPrivate, - makeError, - isCallException, - isError, - EventPayload, - FetchRequest, - FetchResponse, - FetchCancelSignal, - FixedNumber, - getBigInt, - getNumber, - getUint, - toBeArray, - toBigInt, - toBeHex, - toNumber, - toQuantity, - fromTwos, - toTwos, - mask, - formatXCB, - parseXCB, - formatUnits, - parseUnits, - toUtf8Bytes, - toUtf8CodePoints, - toUtf8String, - Utf8ErrorFuncs, - decodeRlp, - encodeRlp, - uuidV4, - arrayify, - hexConcat, + decodeBase58, + encodeBase58, + decodeBase64, + encodeBase64, + concat, + dataLength, + dataSlice, + getBytes, + getBytesCopy, + hexlify, + isHexString, + isBytesLike, + stripZerosLeft, + zeroPadBytes, + zeroPadValue, + defineProperties, + resolveProperties, + assert, + assertArgument, + assertArgumentCount, + assertNormalize, + assertPrivate, + makeError, + isCallException, + isError, + EventPayload, + FetchRequest, + FetchResponse, + FetchCancelSignal, + FixedNumber, + getBigInt, + getNumber, + getUint, + toBeArray, + toBigInt, + toBeHex, + toNumber, + toQuantity, + fromTwos, + toTwos, + mask, + formatXCB, + parseXCB, + formatUnits, + parseUnits, + toUtf8Bytes, + toUtf8CodePoints, + toUtf8String, + Utf8ErrorFuncs, + decodeRlp, + encodeRlp, + uuidV4, + arrayify, + hexConcat, } from "./utils/index.js"; export { - Mnemonic, - BaseWallet, - HDNodeWallet, - Wallet, - defaultPath, - getAccountPath, - getIndexedAccountPath, - isCrowdsaleJson, - isKeystoreJson, - decryptCrowdsaleJson, - decryptKeystoreJsonSync, - decryptKeystoreJson, - encryptKeystoreJson, - encryptKeystoreJsonSync, + Mnemonic, + BaseWallet, + HDNodeWallet, + Wallet, + defaultPath, + getAccountPath, + getIndexedAccountPath, + isCrowdsaleJson, + isKeystoreJson, + decryptCrowdsaleJson, + decryptKeystoreJsonSync, + decryptKeystoreJson, + encryptKeystoreJson, + encryptKeystoreJsonSync, } from "./wallet/index.js"; export { BigNumber } from "./bigNumber/bigNumber.js"; export { - Wordlist, - LangEn, - WordlistOwl, - WordlistOwlA, - wordlists, + Wordlist, + LangEn, + WordlistOwl, + WordlistOwlA, + wordlists, } from "./wordlists/index.js"; ///////////////////////////// // Types export type { - JsonFragment, - JsonFragmentType, - FormatType, - FragmentType, - InterfaceAbi, - ParamTypeWalkFunc, - ParamTypeWalkAsyncFunc, + JsonFragment, + JsonFragmentType, + FormatType, + FragmentType, + InterfaceAbi, + ParamTypeWalkFunc, + ParamTypeWalkAsyncFunc, } from "./abi/index.js"; export type { - Addressable, - AddressLike, - NameResolver, + Addressable, + AddressLike, + NameResolver, } from "./address/index.js"; export type { - ConstantContractMethod, - ContractEvent, - ContractEventArgs, - ContractEventName, - ContractInterface, - ContractMethod, - ContractMethodArgs, - ContractTransaction, - DeferredTopicFilter, - Overrides, - BaseContractMethod, - ContractDeployTransaction, - PostfixOverrides, - WrappedFallback, + ConstantContractMethod, + ContractEvent, + ContractEventArgs, + ContractEventName, + ContractInterface, + ContractMethod, + ContractMethodArgs, + ContractTransaction, + DeferredTopicFilter, + Overrides, + BaseContractMethod, + ContractDeployTransaction, + PostfixOverrides, + WrappedFallback, } from "./contract/index.js"; export type { ProgressCallback, SignatureLike } from "./crypto/index.js"; @@ -253,97 +253,100 @@ export type { ProgressCallback, SignatureLike } from "./crypto/index.js"; export type { TypedDataDomain, TypedDataField } from "./hash/index.js"; export type { - Provider, - Signer, - AbstractProviderPlugin, - BlockParams, - BlockTag, - ContractRunner, - DebugEventBrowserProvider, - Eip1193Provider, - EventFilter, - Filter, - FilterByBlockHash, - EnergyCostParameters, - JsonRpcApiProviderOptions, - JsonRpcError, - JsonRpcPayload, - JsonRpcResult, - JsonRpcTransactionRequest, - LogParams, - MinedBlock, - MinedTransactionResponse, - Networkish, - OrphanFilter, - PerformActionFilter, - PerformActionRequest, - PerformActionTransaction, - PreparedTransactionRequest, - ProviderEvent, - Subscriber, - Subscription, - TopicFilter, - TransactionReceiptParams, - TransactionRequest, - TransactionResponseParams, - WebSocketCreator, - WebSocketLike, + Provider, + Signer, + AbstractProviderPlugin, + BlockParams, + BlockTag, + ContractRunner, + DebugEventBrowserProvider, + Eip1193Provider, + EventFilter, + Filter, + FilterByBlockHash, + EnergyCostParameters, + JsonRpcApiProviderOptions, + JsonRpcError, + JsonRpcPayload, + JsonRpcResult, + JsonRpcTransactionRequest, + LogParams, + MinedBlock, + MinedTransactionResponse, + Networkish, + OrphanFilter, + PerformActionFilter, + PerformActionRequest, + PerformActionTransaction, + PreparedTransactionRequest, + ProviderEvent, + Subscriber, + Subscription, + TopicFilter, + TransactionReceiptParams, + TransactionRequest, + TransactionResponseParams, + WebSocketCreator, + WebSocketLike, } from "./providers/index.js"; export type { - AccessList, - AccessListish, - AccessListEntry, - TransactionLike, + AccessList, + AccessListish, + AccessListEntry, + TransactionLike, } from "./transaction/index.js"; export type { - BytesLike, - BigNumberish, - Numeric, - ErrorCode, - FixedFormat, - Utf8ErrorFunc, - UnicodeNormalizationForm, - Utf8ErrorReason, - RlpStructuredData, - GetUrlResponse, - FetchPreflightFunc, - FetchProcessFunc, - FetchRetryFunc, - FetchGatewayFunc, - FetchGetUrlFunc, - CoreBCError, - UnknownError, - NotImplementedError, - UnsupportedOperationError, - NetworkError, - ServerError, - TimeoutError, - BadDataError, - CancelledError, - BufferOverrunError, - NumericFaultError, - InvalidArgumentError, - MissingArgumentError, - UnexpectedArgumentError, - CallExceptionError, - InsufficientFundsError, - NonceExpiredError, - OffchainFaultError, - ReplacementUnderpricedError, - TransactionReplacedError, - UnconfiguredNameError, - ActionRejectedError, - CodedCoreBCError, - CallExceptionAction, - CallExceptionTransaction, - EventEmitterable, - Listener, + BytesLike, + BigNumberish, + Numeric, + ErrorCode, + FixedFormat, + Utf8ErrorFunc, + UnicodeNormalizationForm, + Utf8ErrorReason, + RlpStructuredData, + GetUrlResponse, + FetchPreflightFunc, + FetchProcessFunc, + FetchRetryFunc, + FetchGatewayFunc, + FetchGetUrlFunc, + CoreBCError, + UnknownError, + NotImplementedError, + UnsupportedOperationError, + NetworkError, + ServerError, + TimeoutError, + BadDataError, + CancelledError, + BufferOverrunError, + NumericFaultError, + InvalidArgumentError, + MissingArgumentError, + UnexpectedArgumentError, + CallExceptionError, + InsufficientFundsError, + NonceExpiredError, + OffchainFaultError, + ReplacementUnderpricedError, + TransactionReplacedError, + UnconfiguredNameError, + ActionRejectedError, + CodedCoreBCError, + CallExceptionAction, + CallExceptionTransaction, + EventEmitterable, + Listener, } from "./utils/index.js"; export type { - CrowdsaleAccount, - KeystoreAccount, - EncryptOptions, + CrowdsaleAccount, + KeystoreAccount, + EncryptOptions, } from "./wallet/index.js"; + +export * from "./cip/index.js"; +export * from "./ipfs/index.js"; diff --git a/src.ts/crypto/browser-ed448.ts b/src.ts/crypto/browser-ed448.ts index cb8965cb7..e61328ef0 100644 --- a/src.ts/crypto/browser-ed448.ts +++ b/src.ts/crypto/browser-ed448.ts @@ -1,5 +1,6 @@ -"use strict"; - +// bcrypto does not ship TypeScript declarations. // @ts-ignore -import ed448 from "bcrypto/lib/ed448-browser.js"; +import backend from "bcrypto/lib/ed448-browser.js"; +import type { Ed448Backend } from "./ed448-types.js"; +const ed448: Ed448Backend = backend; export default ed448; diff --git a/src.ts/crypto/browser-sha3.ts b/src.ts/crypto/browser-sha3.ts index f07274f2f..4e1d18b5c 100644 --- a/src.ts/crypto/browser-sha3.ts +++ b/src.ts/crypto/browser-sha3.ts @@ -1,4 +1,5 @@ -"use strict"; +import { Buffer } from "buffer"; +("use strict"); // @ts-ignore import _ripemd160 from "bcrypto/lib/ripemd160-browser"; @@ -12,43 +13,43 @@ import { SupportedAlgorithm } from "./sha3.js"; const logger = new Logger("corebc-crypto/browser-sha3/0.0.1"); export function ripemd160(data: BytesLike): string { - const d = Buffer.from(arrayify(data)); - const h = _ripemd160.digest(d); - return hexlify(h); + const d = Buffer.from(arrayify(data)); + const h = _ripemd160.digest(d); + return hexlify(h); } export function sha256(data: BytesLike): string { - const d = Buffer.from(arrayify(data)); - const h = sha3.digest(d, 256); - return hexlify(h); + const d = Buffer.from(arrayify(data)); + const h = sha3.digest(d, 256); + return hexlify(h); } export function sha512(data: BytesLike): string { - const d = Buffer.from(arrayify(data)); - const h = sha3.digest(d, 512); - return hexlify(h); + const d = Buffer.from(arrayify(data)); + const h = sha3.digest(d, 512); + return hexlify(h); } export function computeHmac( - algorithm: SupportedAlgorithm, - key: BytesLike, - data: BytesLike, + algorithm: SupportedAlgorithm, + key: BytesLike, + data: BytesLike, ): string { - const d = Buffer.from(arrayify(data)); - const k = Buffer.from(arrayify(key)); - if (algorithm === SupportedAlgorithm.sha256) { - return hexlify(sha3.mac(d, k, 256)); - } else if (algorithm === SupportedAlgorithm.sha512) { - return hexlify(sha3.mac(d, k, 512)); - } - - logger.throwError( - "unsupported algorithm - " + algorithm, - Logger.errors.UNSUPPORTED_OPERATION, - { - operation: "computeHmac", - algorithm: algorithm, - }, - ); - return ""; + const d = Buffer.from(arrayify(data)); + const k = Buffer.from(arrayify(key)); + if (algorithm === SupportedAlgorithm.sha256) { + return hexlify(sha3.mac(d, k, 256)); + } else if (algorithm === SupportedAlgorithm.sha512) { + return hexlify(sha3.mac(d, k, 512)); + } + + logger.throwError( + "unsupported algorithm - " + algorithm, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: "computeHmac", + algorithm: algorithm, + }, + ); + return ""; } diff --git a/src.ts/crypto/crypto-browser.ts b/src.ts/crypto/crypto-browser.ts index 7fc53da79..06c90c20a 100644 --- a/src.ts/crypto/crypto-browser.ts +++ b/src.ts/crypto/crypto-browser.ts @@ -1,10 +1,11 @@ /* Browser Crypto Shims */ -import { hmac } from "@noble/hashes/hmac"; -import { pbkdf2 } from "@noble/hashes/pbkdf2"; -import { sha256 } from "@noble/hashes/sha256"; -import { sha512 } from "@noble/hashes/sha512"; -import { sha3_256, sha3_512 } from "@noble/hashes/sha3"; +import { ripemd160 } from "@noble/hashes/legacy.js"; +import { hmac } from "@noble/hashes/hmac.js"; +import { pbkdf2 } from "@noble/hashes/pbkdf2.js"; +import { sha256 } from "@noble/hashes/sha2.js"; +import { sha512 } from "@noble/hashes/sha2.js"; +import { sha3_256, sha3_512 } from "@noble/hashes/sha3.js"; import ed448 from "./browser-ed448.js"; import { assert, assertArgument } from "../utils/index.js"; @@ -12,84 +13,89 @@ export { ed448 }; export { Ed448Goldilock } from "./ed448goldilock-browser.js"; declare global { - interface Window {} - // @ts-ignore - const window: Window; - // @ts-ignore - const self: Window; + interface Window {} + // @ts-ignore + const window: Window; + // @ts-ignore + const self: Window; } function getGlobal(): any { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw new Error("unable to locate global object"); } const anyGlobal = getGlobal(); const crypto: any = anyGlobal.crypto || anyGlobal.msCrypto; export interface CryptoHasher { - update(data: Uint8Array): CryptoHasher; - digest(): Uint8Array; + update(data: Uint8Array): CryptoHasher; + digest(): Uint8Array; } export function createHash(algo: string): CryptoHasher { - switch (algo) { - case "sha256": - return sha256.create(); - case "sha512": - return sha512.create(); - case "sha3-256": - return sha3_256.create(); - case "sha3-512": - return sha3_512.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); + switch (algo) { + case "ripemd160": + return ripemd160.create(); + case "sha256": + return sha256.create(); + case "sha512": + return sha512.create(); + case "sha3-256": + return sha3_256.create(); + case "sha3-512": + return sha3_512.create(); + } + assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); } export function createHmac(_algo: string, key: Uint8Array): CryptoHasher { - const algo = { sha256, sha512 }[_algo]; - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac.create(algo, key); + const algo = { sha256, sha512, "sha3-256": sha3_256, "sha3-512": sha3_512 }[ + _algo as "sha256" + ]; + assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); + return hmac.create(algo, key); } export function pbkdf2Sync( - password: Uint8Array, - salt: Uint8Array, - iterations: number, - keylen: number, - _algo: "sha256" | "sha512", + password: Uint8Array, + salt: Uint8Array, + iterations: number, + keylen: number, + _algo: "sha256" | "sha512", ): Uint8Array { - const algo = { sha256, sha512 }[_algo]; - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen }); + const algo = { sha256, sha512 }[_algo]; + assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); + return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen }); } export function randomBytes(length: number): Uint8Array { - assert( - crypto != null, - "platform does not support secure random numbers", - "UNSUPPORTED_OPERATION", - { - operation: "randomBytes", - }, - ); + assert( + crypto != null, + "platform does not support secure random numbers", + "UNSUPPORTED_OPERATION", + { + operation: "randomBytes", + }, + ); - assertArgument( - Number.isInteger(length) && length > 0 && length <= 1024, - "invalid length", - "length", - length, - ); + assertArgument( + Number.isInteger(length) && length > 0 && length <= 1024, + "invalid length", + "length", + length, + ); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; + const result = new Uint8Array(length); + crypto.getRandomValues(result); + return result; } diff --git a/src.ts/crypto/crypto.ts b/src.ts/crypto/crypto.ts index e095a7ab7..dedc6a05d 100644 --- a/src.ts/crypto/crypto.ts +++ b/src.ts/crypto/crypto.ts @@ -1,3 +1,4 @@ +/// import ed448 from "./ed448.js"; export { ed448 }; export { Ed448Goldilock } from "./ed448goldilock.js"; diff --git a/src.ts/crypto/ed448-types.ts b/src.ts/crypto/ed448-types.ts new file mode 100644 index 000000000..a73d95102 --- /dev/null +++ b/src.ts/crypto/ed448-types.ts @@ -0,0 +1,14 @@ +import type { Buffer } from "buffer"; +/** Buffer-based bcrypto Ed448 operations used by Core signing. */ +export interface Ed448Backend { + privateKeyGenerate(): Buffer; + publicKeyCreate(key: Buffer): Buffer; + publicKeyFromScalar(scalar: Buffer): Buffer; + publicKeyVerify(key: Buffer): boolean; + publicKeyCombine(keys: Buffer[]): Buffer; + sign(message: Buffer, key: Buffer): Buffer; + signWithScalar(message: Buffer, scalar: Buffer, prefix: Buffer): Buffer; + verify(message: Buffer, signature: Buffer, publicKey: Buffer): boolean; + derive(publicKey: Buffer, key: Buffer): Buffer; + deriveWithScalar(publicKey: Buffer, scalar: Buffer): Buffer; +} diff --git a/src.ts/crypto/ed448.ts b/src.ts/crypto/ed448.ts index 6b0b62164..225fc9a8b 100644 --- a/src.ts/crypto/ed448.ts +++ b/src.ts/crypto/ed448.ts @@ -1,6 +1,6 @@ -"use strict"; - +// bcrypto does not ship TypeScript declarations. // @ts-ignore -import ed448 from "bcrypto/lib/ed448.js"; - +import backend from "bcrypto/lib/ed448.js"; +import type { Ed448Backend } from "./ed448-types.js"; +const ed448: Ed448Backend = backend; export default ed448; diff --git a/src.ts/crypto/ed448goldilock-browser.ts b/src.ts/crypto/ed448goldilock-browser.ts index a71f8898f..944683d03 100644 --- a/src.ts/crypto/ed448goldilock-browser.ts +++ b/src.ts/crypto/ed448goldilock-browser.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer"; // @ts-ignore import ed448 from "./browser-ed448.js"; // @ts-ignore @@ -6,146 +7,150 @@ import pbkdf2 from "./pbkdf2-browser.js"; import SHA3_512 from "bcrypto/lib/sha3-512.js"; export class Ed448Goldilock { - static _channel = ed448; + static _channel = ed448; - static generatePrivateKey() { - var privateKey = ed448.privateKeyGenerate(); - privateKey[56] &= 0x7f; - return privateKey; - } + static generatePrivateKey() { + var privateKey = ed448.privateKeyGenerate(); + privateKey[56] &= 0x7f; + return privateKey; + } - static getPublicKeyFromPrivateKey(privateKey: string): string { - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var scalar = secret.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - var publicKey = this._channel.publicKeyFromScalar(scalar); - return Buffer.from(publicKey).toString("hex"); - } else { - var publicKey = this._channel.publicKeyCreate(secret); - return Buffer.from(publicKey).toString("hex"); - } - } + static getPublicKeyFromPrivateKey(privateKey: string): string { + var secret = Buffer.from(privateKey, "hex"); + if (secret[56] > 127) { + var scalar = secret.slice(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + var publicKey = this._channel.publicKeyFromScalar(scalar); + return Buffer.from(publicKey).toString("hex"); + } else { + var publicKey = this._channel.publicKeyCreate(secret); + return Buffer.from(publicKey).toString("hex"); + } + } - static signWithPrivateKey(privateKey: string, msg: string): string { - var msgToSign = Buffer.from(msg, "hex"); - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var prefix = secret.slice(0, 57); - prefix[0] &= 0xfc; - prefix[56] = 0; - prefix[55] |= 0x80; - var scalar = prefix.slice(0, 56); - var signedMessage = this._channel.signWithScalar( - msgToSign, - scalar, - prefix, - ); - return Buffer.from(signedMessage).toString("hex"); - } else { - var signedMessage = this._channel.sign(msgToSign, secret); - return Buffer.from(signedMessage).toString("hex"); - } - } + static signWithPrivateKey(privateKey: string, msg: string): string { + var msgToSign = Buffer.from(msg, "hex"); + var secret = Buffer.from(privateKey, "hex"); + if (secret[56] > 127) { + var prefix = secret.slice(0, 57); + prefix[0] &= 0xfc; + prefix[56] = 0; + prefix[55] |= 0x80; + var scalar = prefix.slice(0, 56); + var signedMessage = this._channel.signWithScalar( + msgToSign, + scalar, + prefix, + ); + return Buffer.from(signedMessage).toString("hex"); + } else { + var signedMessage = this._channel.sign(msgToSign, secret); + return Buffer.from(signedMessage).toString("hex"); + } + } - static signWithPrivateKeyNConcatPubkey( - privateKey: string, - msg: string, - ): string { - var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); - var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); - return signedMessage + publicKey; - } + static signWithPrivateKeyNConcatPubkey( + privateKey: string, + msg: string, + ): string { + var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); + var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); + return signedMessage + publicKey; + } - static verifySignature( - msgHash: string, - signedMsg: string, - pubKey: string, - ): boolean { - return this._channel.verify(msgHash, signedMsg, pubKey); - } + static verifySignature( + msgHash: string, + signedMsg: string, + pubKey: string, + ): boolean { + return this._channel.verify( + Buffer.from(msgHash, "hex"), + Buffer.from(signedMsg, "hex"), + Buffer.from(pubKey, "hex"), + ); + } - static SHA512Hash(password: string, salt: string): string { - var p1 = Buffer.from(password, "hex"); - var s1 = Buffer.from(salt, "hex"); - return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString( - "hex", - ); - } + static SHA512Hash(password: string, salt: string): string { + var p1 = Buffer.from(password, "hex"); + var s1 = Buffer.from(salt, "hex"); + return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString( + "hex", + ); + } - static concatenateAndHex( - prefix: number, - key: string, - index: number, - salt: string, - ): string { - var ind = Buffer.alloc(4); - var p = Buffer.alloc(1); - p[0] = prefix % 256; - var j = index; - for (let i = 0; i < 4; i++) { - ind[i] = j % 256; - j = Math.floor(j / 256); - } - var t = p.toString("hex") + key + ind.toString("hex"); - return Ed448Goldilock.SHA512Hash(t, salt); - } + static concatenateAndHex( + prefix: number, + key: string, + index: number, + salt: string, + ): string { + var ind = Buffer.alloc(4); + var p = Buffer.alloc(1); + p[0] = prefix % 256; + var j = index; + for (let i = 0; i < 4; i++) { + ind[i] = j % 256; + j = Math.floor(j / 256); + } + var t = p.toString("hex") + key + ind.toString("hex"); + return Ed448Goldilock.SHA512Hash(t, salt); + } - static addScalar(a: string, b: string): string { - var a1 = Buffer.from(a, "hex"); - var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); - b1[0] &= 0xfc; - var c = Buffer.alloc(57); - var hold = 0; - for (let i = 0; i < 57; i++) { - hold += a1[i] + b1[i]; - c[i] = hold % 256; - hold = Math.floor(hold / 256); - } - return c.toString("hex"); - } + static addScalar(a: string, b: string): string { + var a1 = Buffer.from(a, "hex"); + var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); + b1[0] &= 0xfc; + var c = Buffer.alloc(57); + var hold = 0; + for (let i = 0; i < 57; i++) { + hold += a1[i] + b1[i]; + c[i] = hold % 256; + hold = Math.floor(hold / 256); + } + return c.toString("hex"); + } - static seedToExtendedPrivate(seed: string): string { - var s1 = Ed448Goldilock.SHA512Hash( - seed, - "6d6e656d6f6e6963666f72746865636861696e", - ); - var s2 = Ed448Goldilock.SHA512Hash( - seed, - "6d6e656d6f6e6963666f727468656b6579", - ); - var b = Buffer.from(s2, "hex"); - b[56] |= 0x80; - b[55] |= 0x80; - b[55] &= 0xbf; - var s3 = b.toString("hex"); - return s1 + s3; - } + static seedToExtendedPrivate(seed: string): string { + var s1 = Ed448Goldilock.SHA512Hash( + seed, + "6d6e656d6f6e6963666f72746865636861696e", + ); + var s2 = Ed448Goldilock.SHA512Hash( + seed, + "6d6e656d6f6e6963666f727468656b6579", + ); + var b = Buffer.from(s2, "hex"); + b[56] |= 0x80; + b[55] |= 0x80; + b[55] &= 0xbf; + var s3 = b.toString("hex"); + return s1 + s3; + } - static childPrivateToPrivate(s: string, index: number) { - var s0 = s.substr(0, 114); - var s1 = s.substr(114, 228); - var r0, r1; - if (index >= 0x80000000) { - r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } else { - var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); - r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - } + static childPrivateToPrivate(s: string, index: number) { + var s0 = s.substr(0, 114); + var s1 = s.substr(114, 228); + var r0, r1; + if (index >= 0x80000000) { + r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); + r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); + return r0 + Ed448Goldilock.addScalar(s1, r1); + } else { + var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); + r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); + r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); + return r0 + Ed448Goldilock.addScalar(s1, r1); + } + } - static HDWalletGenerateKeyFromSeed(seed: string, index: number): string { - var m = Ed448Goldilock.seedToExtendedPrivate(seed); - var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); - var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); - var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); - var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); - var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); - return k5.substr(114, 228); - } + static HDWalletGenerateKeyFromSeed(seed: string, index: number): string { + var m = Ed448Goldilock.seedToExtendedPrivate(seed); + var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); + var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); + var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); + var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); + var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); + return k5.substr(114, 228); + } } diff --git a/src.ts/crypto/ed448goldilock.ts b/src.ts/crypto/ed448goldilock.ts index 1a000c3de..230e5666e 100644 --- a/src.ts/crypto/ed448goldilock.ts +++ b/src.ts/crypto/ed448goldilock.ts @@ -1,151 +1,156 @@ +import { Buffer } from "buffer"; // @ts-ignore -import ed448 from "bcrypto/lib/ed448.js"; +import ed448 from "./ed448.js"; // @ts-ignore import pbkdf2 from "bcrypto/lib/pbkdf2.js"; // @ts-ignore import SHA3_512 from "bcrypto/lib/sha3-512.js"; export class Ed448Goldilock { - static _channel = ed448; + static _channel = ed448; - static generatePrivateKey() { - var privateKey = ed448.privateKeyGenerate(); - privateKey[56] &= 0x7f; - return privateKey; - } + static generatePrivateKey() { + var privateKey = ed448.privateKeyGenerate(); + privateKey[56] &= 0x7f; + return privateKey; + } - static getPublicKeyFromPrivateKey(privateKey: string): string { - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var scalar = secret.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - var publicKey = this._channel.publicKeyFromScalar(scalar); - return Buffer.from(publicKey).toString("hex"); - } else { - var publicKey = this._channel.publicKeyCreate(secret); - return Buffer.from(publicKey).toString("hex"); - } - } + static getPublicKeyFromPrivateKey(privateKey: string): string { + var secret = Buffer.from(privateKey, "hex"); + if (secret[56] > 127) { + var scalar = secret.slice(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + var publicKey = this._channel.publicKeyFromScalar(scalar); + return Buffer.from(publicKey).toString("hex"); + } else { + var publicKey = this._channel.publicKeyCreate(secret); + return Buffer.from(publicKey).toString("hex"); + } + } - static signWithPrivateKey(privateKey: string, msg: string): string { - var msgToSign = Buffer.from(msg, "hex"); - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var prefix = secret.slice(0, 57); - prefix[0] &= 0xfc; - prefix[56] = 0; - prefix[55] |= 0x80; - var scalar = prefix.slice(0, 56); - var signedMessage = this._channel.signWithScalar( - msgToSign, - scalar, - prefix, - ); - return Buffer.from(signedMessage).toString("hex"); - } else { - var signedMessage = this._channel.sign(msgToSign, secret); - return Buffer.from(signedMessage).toString("hex"); - } - } + static signWithPrivateKey(privateKey: string, msg: string): string { + var msgToSign = Buffer.from(msg, "hex"); + var secret = Buffer.from(privateKey, "hex"); + if (secret[56] > 127) { + var prefix = secret.slice(0, 57); + prefix[0] &= 0xfc; + prefix[56] = 0; + prefix[55] |= 0x80; + var scalar = prefix.slice(0, 56); + var signedMessage = this._channel.signWithScalar( + msgToSign, + scalar, + prefix, + ); + return Buffer.from(signedMessage).toString("hex"); + } else { + var signedMessage = this._channel.sign(msgToSign, secret); + return Buffer.from(signedMessage).toString("hex"); + } + } - static signWithPrivateKeyNConcatPubkey( - privateKey: string, - msg: string, - ): string { - var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); - var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); - return signedMessage + publicKey; - } + static signWithPrivateKeyNConcatPubkey( + privateKey: string, + msg: string, + ): string { + var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); + var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); + return signedMessage + publicKey; + } - static verifySignature( - msgHash: string, - signedMsg: string, - pubKey: string, - ): boolean { - return this._channel.verify(msgHash, signedMsg, pubKey); - } + static verifySignature( + msgHash: string, + signedMsg: string, + pubKey: string, + ): boolean { + return this._channel.verify( + Buffer.from(msgHash, "hex"), + Buffer.from(signedMsg, "hex"), + Buffer.from(pubKey, "hex"), + ); + } - static SHA512Hash(password: string, salt: string): string { - var p1 = Buffer.from(password, "hex"); - var s1 = Buffer.from(salt, "hex"); - return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString( - "hex", - ); - } + static SHA512Hash(password: string, salt: string): string { + var p1 = Buffer.from(password, "hex"); + var s1 = Buffer.from(salt, "hex"); + return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString( + "hex", + ); + } - static concatenateAndHex( - prefix: number, - key: string, - index: number, - salt: string, - ): string { - var ind = Buffer.alloc(4); - var p = Buffer.alloc(1); - p[0] = prefix % 256; - var j = index; - for (let i = 0; i < 4; i++) { - ind[i] = j % 256; - j = Math.floor(j / 256); - } - var t = p.toString("hex") + key + ind.toString("hex"); - return Ed448Goldilock.SHA512Hash(t, salt); - } + static concatenateAndHex( + prefix: number, + key: string, + index: number, + salt: string, + ): string { + var ind = Buffer.alloc(4); + var p = Buffer.alloc(1); + p[0] = prefix % 256; + var j = index; + for (let i = 0; i < 4; i++) { + ind[i] = j % 256; + j = Math.floor(j / 256); + } + var t = p.toString("hex") + key + ind.toString("hex"); + return Ed448Goldilock.SHA512Hash(t, salt); + } - static addScalar(a: string, b: string): string { - var a1 = Buffer.from(a, "hex"); - var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); - b1[0] &= 0xfc; - var c = Buffer.alloc(57); - var hold = 0; - for (let i = 0; i < 57; i++) { - hold += a1[i] + b1[i]; - c[i] = hold % 256; - hold = Math.floor(hold / 256); - } - return c.toString("hex"); - } + static addScalar(a: string, b: string): string { + var a1 = Buffer.from(a, "hex"); + var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); + b1[0] &= 0xfc; + var c = Buffer.alloc(57); + var hold = 0; + for (let i = 0; i < 57; i++) { + hold += a1[i] + b1[i]; + c[i] = hold % 256; + hold = Math.floor(hold / 256); + } + return c.toString("hex"); + } - static seedToExtendedPrivate(seed: string): string { - var s1 = Ed448Goldilock.SHA512Hash( - seed, - "6d6e656d6f6e6963666f72746865636861696e", - ); - var s2 = Ed448Goldilock.SHA512Hash( - seed, - "6d6e656d6f6e6963666f727468656b6579", - ); - var b = Buffer.from(s2, "hex"); - b[56] |= 0x80; - b[55] |= 0x80; - b[55] &= 0xbf; - var s3 = b.toString("hex"); - return s1 + s3; - } + static seedToExtendedPrivate(seed: string): string { + var s1 = Ed448Goldilock.SHA512Hash( + seed, + "6d6e656d6f6e6963666f72746865636861696e", + ); + var s2 = Ed448Goldilock.SHA512Hash( + seed, + "6d6e656d6f6e6963666f727468656b6579", + ); + var b = Buffer.from(s2, "hex"); + b[56] |= 0x80; + b[55] |= 0x80; + b[55] &= 0xbf; + var s3 = b.toString("hex"); + return s1 + s3; + } - static childPrivateToPrivate(s: string, index: number) { - var s0 = s.substr(0, 114); - var s1 = s.substr(114, 228); - var r0, r1; - if (index >= 0x80000000) { - r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } else { - var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); - r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - } + static childPrivateToPrivate(s: string, index: number) { + var s0 = s.substr(0, 114); + var s1 = s.substr(114, 228); + var r0, r1; + if (index >= 0x80000000) { + r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); + r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); + return r0 + Ed448Goldilock.addScalar(s1, r1); + } else { + var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); + r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); + r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); + return r0 + Ed448Goldilock.addScalar(s1, r1); + } + } - static HDWalletGenerateKeyFromSeed(seed: string, index: number): string { - var m = Ed448Goldilock.seedToExtendedPrivate(seed); - var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); - var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); - var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); - var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); - var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); - return k5.substr(114, 228); - } + static HDWalletGenerateKeyFromSeed(seed: string, index: number): string { + var m = Ed448Goldilock.seedToExtendedPrivate(seed); + var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); + var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); + var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); + var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); + var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); + return k5.substr(114, 228); + } } diff --git a/src.ts/crypto/hmac.ts b/src.ts/crypto/hmac.ts index 0ed639c93..bcb59b05b 100644 --- a/src.ts/crypto/hmac.ts +++ b/src.ts/crypto/hmac.ts @@ -14,11 +14,11 @@ import type { BytesLike } from "../utils/index.js"; let locked = false; const _computeHmac = function ( - algorithm: "sha256" | "sha512", - key: Uint8Array, - data: Uint8Array, + algorithm: "sha256" | "sha512", + key: Uint8Array, + data: Uint8Array, ): BytesLike { - return createHmac(algorithm, key).update(data).digest(); + return createHmac(algorithm, key).update(data).digest(); }; let __computeHmac = _computeHmac; @@ -41,28 +41,28 @@ let __computeHmac = _computeHmac; * */ export function computeHmac( - algorithm: "sha256" | "sha512", - _key: BytesLike, - _data: BytesLike, + algorithm: "sha256" | "sha512", + _key: BytesLike, + _data: BytesLike, ): string { - const key = getBytes(_key, "key"); - const data = getBytes(_data, "data"); - return hexlify(__computeHmac(algorithm, key, data)); + const key = getBytes(_key, "key"); + const data = getBytes(_data, "data"); + return hexlify(__computeHmac(algorithm, key, data)); } computeHmac._ = _computeHmac; computeHmac.lock = function () { - locked = true; + locked = true; }; computeHmac.register = function ( - func: ( - algorithm: "sha256" | "sha512", - key: Uint8Array, - data: Uint8Array, - ) => BytesLike, + func: ( + algorithm: "sha256" | "sha512", + key: Uint8Array, + data: Uint8Array, + ) => BytesLike, ) { - if (locked) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; + if (locked) { + throw new Error("computeHmac is locked"); + } + __computeHmac = func; }; Object.freeze(computeHmac); diff --git a/src.ts/crypto/index.ts b/src.ts/crypto/index.ts index 33bb23c04..b4d9840ce 100644 --- a/src.ts/crypto/index.ts +++ b/src.ts/crypto/index.ts @@ -18,31 +18,31 @@ import { Ed448Goldilock } from "./crypto.js"; import { keccak256 } from "./keccak.js"; export { - computeHmac, - randomBytes, - ripemd160, - sha256, - sha512, - pbkdf2, - scrypt, - scryptSync, - keccak256, - Ed448Goldilock, + computeHmac, + randomBytes, + ripemd160, + sha256, + sha512, + pbkdf2, + scrypt, + scryptSync, + keccak256, + Ed448Goldilock, }; export { SigningKey } from "./signing-key.js"; export { Signature } from "./signature.js"; function lock(): void { - computeHmac.lock(); - pbkdf2.lock(); - randomBytes.lock(); - ripemd160.lock(); - scrypt.lock(); - scryptSync.lock(); - sha256.lock(); - sha512.lock(); - randomBytes.lock(); + computeHmac.lock(); + pbkdf2.lock(); + randomBytes.lock(); + ripemd160.lock(); + scrypt.lock(); + scryptSync.lock(); + sha256.lock(); + sha512.lock(); + randomBytes.lock(); } export { lock }; diff --git a/src.ts/crypto/keccak.ts b/src.ts/crypto/keccak.ts index 4564cddb9..bf6430e3d 100644 --- a/src.ts/crypto/keccak.ts +++ b/src.ts/crypto/keccak.ts @@ -4,7 +4,7 @@ * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] */ -import { keccak_256 } from "@noble/hashes/sha3"; +import { keccak_256 } from "@noble/hashes/sha3.js"; import { getBytes, hexlify } from "../utils/index.js"; @@ -13,7 +13,7 @@ import type { BytesLike } from "../utils/index.js"; let locked = false; const _keccak256 = function (data: Uint8Array): Uint8Array { - return keccak_256(data); + return keccak_256(data); }; let __keccak256: (data: Uint8Array) => BytesLike = _keccak256; @@ -41,17 +41,17 @@ let __keccak256: (data: Uint8Array) => BytesLike = _keccak256; * //_error: */ export function keccak256(_data: BytesLike): string { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); + const data = getBytes(_data, "data"); + return hexlify(__keccak256(data)); } keccak256._ = _keccak256; keccak256.lock = function (): void { - locked = true; + locked = true; }; keccak256.register = function (func: (data: Uint8Array) => BytesLike) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; + if (locked) { + throw new TypeError("keccak256 is locked"); + } + __keccak256 = func; }; Object.freeze(keccak256); diff --git a/src.ts/crypto/pbkdf2.ts b/src.ts/crypto/pbkdf2.ts index f967ee9a5..48ebbb7df 100644 --- a/src.ts/crypto/pbkdf2.ts +++ b/src.ts/crypto/pbkdf2.ts @@ -15,13 +15,13 @@ import type { BytesLike } from "../utils/index.js"; let locked = false; const _pbkdf2 = function ( - password: Uint8Array, - salt: Uint8Array, - iterations: number, - keylen: number, - algo: "sha256" | "sha512", + password: Uint8Array, + salt: Uint8Array, + iterations: number, + keylen: number, + algo: "sha256" | "sha512", ): BytesLike { - return pbkdf2Sync(password, salt, iterations, keylen, algo); + return pbkdf2Sync(password, salt, iterations, keylen, algo); }; let __pbkdf2 = _pbkdf2; @@ -47,32 +47,32 @@ let __pbkdf2 = _pbkdf2; * //_result: */ export function pbkdf2( - _password: BytesLike, - _salt: BytesLike, - iterations: number, - keylen: number, - algo: "sha256" | "sha512", + _password: BytesLike, + _salt: BytesLike, + iterations: number, + keylen: number, + algo: "sha256" | "sha512", ): string { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); + const password = getBytes(_password, "password"); + const salt = getBytes(_salt, "salt"); + return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); } pbkdf2._ = _pbkdf2; pbkdf2.lock = function (): void { - locked = true; + locked = true; }; pbkdf2.register = function ( - func: ( - password: Uint8Array, - salt: Uint8Array, - iterations: number, - keylen: number, - algo: "sha256" | "sha512", - ) => BytesLike, + func: ( + password: Uint8Array, + salt: Uint8Array, + iterations: number, + keylen: number, + algo: "sha256" | "sha512", + ) => BytesLike, ) { - if (locked) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; + if (locked) { + throw new Error("pbkdf2 is locked"); + } + __pbkdf2 = func; }; Object.freeze(pbkdf2); diff --git a/src.ts/crypto/random.ts b/src.ts/crypto/random.ts index 5eeae96bf..dcb4e3003 100644 --- a/src.ts/crypto/random.ts +++ b/src.ts/crypto/random.ts @@ -11,7 +11,7 @@ import { randomBytes as crypto_random } from "./crypto.js"; let locked = false; const _randomBytes = function (length: number): Uint8Array { - return new Uint8Array(crypto_random(length)); + return new Uint8Array(crypto_random(length)); }; let __randomBytes = _randomBytes; @@ -24,17 +24,17 @@ let __randomBytes = _randomBytes; * //_result: */ export function randomBytes(length: number): Uint8Array { - return __randomBytes(length); + return __randomBytes(length); } randomBytes._ = _randomBytes; randomBytes.lock = function (): void { - locked = true; + locked = true; }; randomBytes.register = function (func: (length: number) => Uint8Array) { - if (locked) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; + if (locked) { + throw new Error("randomBytes is locked"); + } + __randomBytes = func; }; Object.freeze(randomBytes); diff --git a/src.ts/crypto/ripemd160.ts b/src.ts/crypto/ripemd160.ts index 00481c215..510717a5b 100644 --- a/src.ts/crypto/ripemd160.ts +++ b/src.ts/crypto/ripemd160.ts @@ -1,4 +1,4 @@ -import { ripemd160 as noble_ripemd160 } from "@noble/hashes/ripemd160"; +import { ripemd160 as noble_ripemd160 } from "@noble/hashes/legacy.js"; import { getBytes, hexlify } from "../utils/index.js"; @@ -7,7 +7,7 @@ import type { BytesLike } from "../utils/index.js"; let locked = false; const _ripemd160 = function (data: Uint8Array): Uint8Array { - return noble_ripemd160(data); + return noble_ripemd160(data); }; let __ripemd160: (data: Uint8Array) => BytesLike = _ripemd160; @@ -30,17 +30,17 @@ let __ripemd160: (data: Uint8Array) => BytesLike = _ripemd160; * */ export function ripemd160(_data: BytesLike): string { - const data = getBytes(_data, "data"); - return hexlify(__ripemd160(data)); + const data = getBytes(_data, "data"); + return hexlify(__ripemd160(data)); } ripemd160._ = _ripemd160; ripemd160.lock = function (): void { - locked = true; + locked = true; }; ripemd160.register = function (func: (data: Uint8Array) => BytesLike) { - if (locked) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; + if (locked) { + throw new TypeError("ripemd160 is locked"); + } + __ripemd160 = func; }; Object.freeze(ripemd160); diff --git a/src.ts/crypto/rlp.ts b/src.ts/crypto/rlp.ts index e1db2e03f..69b56d8bb 100644 --- a/src.ts/crypto/rlp.ts +++ b/src.ts/crypto/rlp.ts @@ -6,185 +6,185 @@ import { arrayify, BytesLike, hexlify, isBytesLike } from "../utils/data.js"; const logger = new Logger("rlp/0.0.1"); function arrayifyInteger(value: number): Array { - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value >>= 8; - } - return result; + const result = []; + while (value) { + // @ts-ignore + result.unshift(value & 0xff); + value >>= 8; + } + return result; } function unarrayifyInteger( - data: Uint8Array, - offset: number, - length: number, + data: Uint8Array, + offset: number, + length: number, ): number { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; + let result = 0; + for (let i = 0; i < length; i++) { + result = result * 256 + data[offset + i]; + } + return result; } function _encode(object: Array | string): Array { - if (Array.isArray(object)) { - let payload: Array = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); + if (Array.isArray(object)) { + let payload: Array = []; + object.forEach(function (child) { + payload = payload.concat(_encode(child)); + }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } + if (payload.length <= 55) { + payload.unshift(0xc0 + payload.length); + return payload; + } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); + const length = arrayifyInteger(payload.length); + length.unshift(0xf7 + length.length); - return length.concat(payload); - } + return length.concat(payload); + } - if (!isBytesLike(object)) { - logger.throwArgumentError("RLP object must be BytesLike", "object", object); - } + if (!isBytesLike(object)) { + logger.throwArgumentError("RLP object must be BytesLike", "object", object); + } - const data: Array = Array.prototype.slice.call(arrayify(object)); + const data: Array = Array.prototype.slice.call(arrayify(object)); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } + if (data.length === 1 && data[0] <= 0x7f) { + return data; + } else if (data.length <= 55) { + data.unshift(0x80 + data.length); + return data; + } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); + const length = arrayifyInteger(data.length); + length.unshift(0xb7 + length.length); - return length.concat(data); + return length.concat(data); } export function encode(object: any): string { - return hexlify(_encode(object)); + return hexlify(_encode(object)); } type Decoded = { - result: any; - consumed: number; + result: any; + consumed: number; }; function _decodeChildren( - data: Uint8Array, - offset: number, - childOffset: number, - length: number, + data: Uint8Array, + offset: number, + childOffset: number, + length: number, ): Decoded { - const result: any[] = []; + const result: any[] = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); + while (childOffset < offset + 1 + length) { + const decoded = _decode(data, childOffset); - result.push(decoded.result); + result.push(decoded.result); - childOffset += decoded.consumed; - if (childOffset > offset + 1 + length) { - logger.throwError( - "child data too short", - Logger.errors.BUFFER_OVERRUN, - {}, - ); - } - } + childOffset += decoded.consumed; + if (childOffset > offset + 1 + length) { + logger.throwError( + "child data too short", + Logger.errors.BUFFER_OVERRUN, + {}, + ); + } + } - return { consumed: 1 + length, result: result }; + return { consumed: 1 + length, result: result }; } // returns { consumed: number, result: Object } function _decode( - data: Uint8Array, - offset: number, + data: Uint8Array, + offset: number, ): { consumed: number; result: any } { - if (data.length === 0) { - logger.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - if (offset + 1 + lengthLength > data.length) { - logger.throwError( - "data short segment too short", - Logger.errors.BUFFER_OVERRUN, - {}, - ); - } - - const length = unarrayifyInteger(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger.throwError( - "data long segment too short", - Logger.errors.BUFFER_OVERRUN, - {}, - ); - } - - return _decodeChildren( - data, - offset, - offset + 1 + lengthLength, - lengthLength + length, - ); - } else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - if (offset + 1 + length > data.length) { - logger.throwError( - "data array too short", - Logger.errors.BUFFER_OVERRUN, - {}, - ); - } - - return _decodeChildren(data, offset, offset + 1, length); - } else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - if (offset + 1 + lengthLength > data.length) { - logger.throwError( - "data array too short", - Logger.errors.BUFFER_OVERRUN, - {}, - ); - } - - const length = unarrayifyInteger(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger.throwError( - "data array too short", - Logger.errors.BUFFER_OVERRUN, - {}, - ); - } - - const result = hexlify( - data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length), - ); - return { consumed: 1 + lengthLength + length, result: result }; - } else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - if (offset + 1 + length > data.length) { - logger.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlify(data[offset]) }; + if (data.length === 0) { + logger.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); + } + + // Array with extra length prefix + if (data[offset] >= 0xf8) { + const lengthLength = data[offset] - 0xf7; + if (offset + 1 + lengthLength > data.length) { + logger.throwError( + "data short segment too short", + Logger.errors.BUFFER_OVERRUN, + {}, + ); + } + + const length = unarrayifyInteger(data, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data.length) { + logger.throwError( + "data long segment too short", + Logger.errors.BUFFER_OVERRUN, + {}, + ); + } + + return _decodeChildren( + data, + offset, + offset + 1 + lengthLength, + lengthLength + length, + ); + } else if (data[offset] >= 0xc0) { + const length = data[offset] - 0xc0; + if (offset + 1 + length > data.length) { + logger.throwError( + "data array too short", + Logger.errors.BUFFER_OVERRUN, + {}, + ); + } + + return _decodeChildren(data, offset, offset + 1, length); + } else if (data[offset] >= 0xb8) { + const lengthLength = data[offset] - 0xb7; + if (offset + 1 + lengthLength > data.length) { + logger.throwError( + "data array too short", + Logger.errors.BUFFER_OVERRUN, + {}, + ); + } + + const length = unarrayifyInteger(data, offset + 1, lengthLength); + if (offset + 1 + lengthLength + length > data.length) { + logger.throwError( + "data array too short", + Logger.errors.BUFFER_OVERRUN, + {}, + ); + } + + const result = hexlify( + data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length), + ); + return { consumed: 1 + lengthLength + length, result: result }; + } else if (data[offset] >= 0x80) { + const length = data[offset] - 0x80; + if (offset + 1 + length > data.length) { + logger.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); + } + + const result = hexlify(data.slice(offset + 1, offset + 1 + length)); + return { consumed: 1 + length, result: result }; + } + return { consumed: 1, result: hexlify(data[offset]) }; } export function decode(data: BytesLike): any { - const bytes = arrayify(data); - const decoded = _decode(bytes, 0); - if (decoded.consumed !== bytes.length) { - logger.throwArgumentError("invalid rlp data", "data", data); - } - return decoded.result; + const bytes = arrayify(data); + const decoded = _decode(bytes, 0); + if (decoded.consumed !== bytes.length) { + logger.throwArgumentError("invalid rlp data", "data", data); + } + return decoded.result; } diff --git a/src.ts/crypto/scrypt.ts b/src.ts/crypto/scrypt.ts index 5b37fddeb..e6c85dd88 100644 --- a/src.ts/crypto/scrypt.ts +++ b/src.ts/crypto/scrypt.ts @@ -1,7 +1,7 @@ import { - scrypt as _nobleSync, - scryptAsync as _nobleAsync, -} from "@noble/hashes/scrypt"; + scrypt as _nobleSync, + scryptAsync as _nobleAsync, +} from "@noble/hashes/scrypt.js"; import { getBytes, hexlify as H } from "../utils/index.js"; @@ -18,46 +18,46 @@ import type { BytesLike } from "../utils/index.js"; export type ProgressCallback = (percent: number) => void; let lockedSync = false, - lockedAsync = false; + lockedAsync = false; const _scryptAsync = async function ( - passwd: Uint8Array, - salt: Uint8Array, - N: number, - r: number, - p: number, - dkLen: number, - onProgress?: ProgressCallback, + passwd: Uint8Array, + salt: Uint8Array, + N: number, + r: number, + p: number, + dkLen: number, + onProgress?: ProgressCallback, ) { - return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress }); + return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress }); }; const _scryptSync = function ( - passwd: Uint8Array, - salt: Uint8Array, - N: number, - r: number, - p: number, - dkLen: number, + passwd: Uint8Array, + salt: Uint8Array, + N: number, + r: number, + p: number, + dkLen: number, ) { - return _nobleSync(passwd, salt, { N, r, p, dkLen }); + return _nobleSync(passwd, salt, { N, r, p, dkLen }); }; let __scryptAsync: ( - passwd: Uint8Array, - salt: Uint8Array, - N: number, - r: number, - p: number, - dkLen: number, - onProgress?: ProgressCallback, + passwd: Uint8Array, + salt: Uint8Array, + N: number, + r: number, + p: number, + dkLen: number, + onProgress?: ProgressCallback, ) => Promise = _scryptAsync; let __scryptSync: ( - passwd: Uint8Array, - salt: Uint8Array, - N: number, - r: number, - p: number, - dkLen: number, + passwd: Uint8Array, + salt: Uint8Array, + N: number, + r: number, + p: number, + dkLen: number, ) => BytesLike = _scryptSync; /** @@ -98,37 +98,37 @@ let __scryptSync: ( * //_result: */ export async function scrypt( - _passwd: BytesLike, - _salt: BytesLike, - N: number, - r: number, - p: number, - dkLen: number, - progress?: ProgressCallback, + _passwd: BytesLike, + _salt: BytesLike, + N: number, + r: number, + p: number, + dkLen: number, + progress?: ProgressCallback, ): Promise { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); + const passwd = getBytes(_passwd, "passwd"); + const salt = getBytes(_salt, "salt"); + return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); } scrypt._ = _scryptAsync; scrypt.lock = function (): void { - lockedAsync = true; + lockedAsync = true; }; scrypt.register = function ( - func: ( - passwd: Uint8Array, - salt: Uint8Array, - N: number, - r: number, - p: number, - dkLen: number, - progress?: ProgressCallback, - ) => Promise, + func: ( + passwd: Uint8Array, + salt: Uint8Array, + N: number, + r: number, + p: number, + dkLen: number, + progress?: ProgressCallback, + ) => Promise, ) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; + if (lockedAsync) { + throw new Error("scrypt is locked"); + } + __scryptAsync = func; }; Object.freeze(scrypt); @@ -155,34 +155,34 @@ Object.freeze(scrypt); * //_result: */ export function scryptSync( - _passwd: BytesLike, - _salt: BytesLike, - N: number, - r: number, - p: number, - dkLen: number, + _passwd: BytesLike, + _salt: BytesLike, + N: number, + r: number, + p: number, + dkLen: number, ): string { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return H(__scryptSync(passwd, salt, N, r, p, dkLen)); + const passwd = getBytes(_passwd, "passwd"); + const salt = getBytes(_salt, "salt"); + return H(__scryptSync(passwd, salt, N, r, p, dkLen)); } scryptSync._ = _scryptSync; scryptSync.lock = function (): void { - lockedSync = true; + lockedSync = true; }; scryptSync.register = function ( - func: ( - passwd: Uint8Array, - salt: Uint8Array, - N: number, - r: number, - p: number, - dkLen: number, - ) => BytesLike, + func: ( + passwd: Uint8Array, + salt: Uint8Array, + N: number, + r: number, + p: number, + dkLen: number, + ) => BytesLike, ) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; + if (lockedSync) { + throw new Error("scryptSync is locked"); + } + __scryptSync = func; }; Object.freeze(scryptSync); diff --git a/src.ts/crypto/sha3.ts b/src.ts/crypto/sha3.ts index 3b812cb62..369dcdf3c 100644 --- a/src.ts/crypto/sha3.ts +++ b/src.ts/crypto/sha3.ts @@ -5,34 +5,18 @@ import { Buffer } from "buffer"; const logger = new Logger("sha3/0.0.1"); -const _sha256 = function (data: Uint8Array): string { - let v = - "0x" + - createHash("sha3-256") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - return v; -}; - -const _sha512 = function (data: Uint8Array): string { - let v = - "0x" + - createHash("sha3-512") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - return v; -}; - -// @ts-ignore +const _sha256 = (data: Uint8Array): string => + hexlify(createHash("sha3-256").update(data).digest()); +const _sha512 = (data: Uint8Array): string => + hexlify(createHash("sha3-512").update(data).digest()); let __sha256: (data: Uint8Array) => BytesLike = _sha256; -// @ts-ignore let __sha512: (data: Uint8Array) => BytesLike = _sha512; let locked256 = false, - locked512 = false; + locked512 = false; /** - * Compute the cryptographic SHA2-256 hash of %%data%%. + * Compute the cryptographic SHA3-256 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -49,80 +33,62 @@ let locked256 = false, * */ export enum SupportedAlgorithm { - sha256 = "sha256", - sha512 = "sha512", + sha256 = "sha256", + sha512 = "sha512", } export function ripemd160(data: BytesLike): string { - let createdHash = - "0x" + - createHash("ripemd160") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; + return hexlify(createHash("ripemd160").update(getBytes(data)).digest()); } export function sha256(data: BytesLike): string { - let createdHash = createHash("sha3-256") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; + return hexlify(__sha256(getBytes(data))); } export function legacySha256(data: BytesLike): string { - const _data = getBytes(data, "data"); - const hexlified = hexlify(createHash("sha256").update(_data).digest()); - return hexlified; + const _data = getBytes(data, "data"); + const hexlified = hexlify(createHash("sha256").update(_data).digest()); + return hexlified; } export function computeHmac( - algorithm: SupportedAlgorithm, - key: BytesLike, - data: BytesLike, + algorithm: SupportedAlgorithm, + key: BytesLike, + data: BytesLike, ): string { - const d = Buffer.from(arrayify(data)); - const k = Buffer.from(arrayify(key)); - if (algorithm === SupportedAlgorithm.sha256) { - return "0x" + createHmac("sha3-256", k).update(d).digest("hex"); - } else if (algorithm === SupportedAlgorithm.sha512) { - return "0x" + createHmac("sha3-512", k).update(d).digest("hex"); - } + const d = Buffer.from(arrayify(data)); + const k = Buffer.from(arrayify(key)); + if (algorithm === SupportedAlgorithm.sha256) { + return hexlify(createHmac("sha3-256", k).update(d).digest()); + } else if (algorithm === SupportedAlgorithm.sha512) { + return hexlify(createHmac("sha3-512", k).update(d).digest()); + } - logger.throwError( - "unsupported algorithm - " + algorithm, - Logger.errors.UNSUPPORTED_OPERATION, - { - operation: "computeHmac", - algorithm: algorithm, - }, - ); - return ""; + logger.throwError( + "unsupported algorithm - " + algorithm, + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: "computeHmac", + algorithm: algorithm, + }, + ); + return ""; } sha256._ = _sha256; sha256.lock = function (): void { - locked256 = true; + locked256 = true; }; sha256.register = function (func: (data: Uint8Array) => BytesLike): void { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; + if (locked256) { + throw new Error("sha256 is locked"); + } + __sha256 = func; }; Object.freeze(sha256); /** - * Compute the cryptographic SHA2-512 hash of %%data%%. + * Compute the cryptographic SHA3-512 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -139,24 +105,16 @@ Object.freeze(sha256); */ export function sha512(data: BytesLike): string { - let createdHash = createHash("sha3-512") - .update(Buffer.from(arrayify(data))) - .digest("hex"); - const v = "0x" + createdHash; - if (typeof createdHash !== "string") { - createdHash = hexlify(createdHash); - return createdHash; - } - return v; + return hexlify(__sha512(getBytes(data))); } sha512._ = _sha512; sha512.lock = function (): void { - locked512 = true; + locked512 = true; }; sha512.register = function (func: (data: Uint8Array) => BytesLike): void { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; + if (locked512) { + throw new Error("sha512 is locked"); + } + __sha512 = func; }; -Object.freeze(sha256); +Object.freeze(sha512); diff --git a/src.ts/crypto/signature.ts b/src.ts/crypto/signature.ts index ce52dea42..dc178d68f 100644 --- a/src.ts/crypto/signature.ts +++ b/src.ts/crypto/signature.ts @@ -1,12 +1,12 @@ import { - concat, - dataLength, - getBigInt, - getBytes, - getNumber, - hexlify, - assertArgument, - assertPrivate, + concat, + dataLength, + getBigInt, + getBytes, + getNumber, + hexlify, + assertArgument, + assertPrivate, } from "../utils/index.js"; import type { BigNumberish, BytesLike } from "../utils/index.js"; @@ -37,243 +37,243 @@ export type SignatureLike = string; * @_docloc: api/crypto:Signing */ export class Signature { - #r: string; - #s: string; - #v: 27 | 28; - #networkV: null | bigint; + #r: string; + #s: string; + #v: 27 | 28; + #networkV: null | bigint; - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r(): string { - return this.#r; - } - set r(value: BytesLike) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - this.#r = hexlify(value); - } + /** + * The ``r`` value for a signautre. + * + * This represents the ``x`` coordinate of a "reference" or + * challenge point, from which the ``y`` can be computed. + */ + get r(): string { + return this.#r; + } + set r(value: BytesLike) { + assertArgument(dataLength(value) === 32, "invalid r", "value", value); + this.#r = hexlify(value); + } - /** - * The ``s`` value for a signature. - */ - get s(): string { - return this.#s; - } - set s(_value: BytesLike) { - assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); - const value = hexlify(_value); - assertArgument( - parseInt(value.substring(0, 3)) < 8, - "non-canonical s", - "value", - value, - ); - this.#s = value; - } + /** + * The ``s`` value for a signature. + */ + get s(): string { + return this.#s; + } + set s(_value: BytesLike) { + assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); + const value = hexlify(_value); + assertArgument( + parseInt(value.substring(0, 3)) < 8, + "non-canonical s", + "value", + value, + ); + this.#s = value; + } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v(): 27 | 28 { - return this.#v; - } - set v(value: BigNumberish) { - const v = getNumber(value, "value"); - assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } + /** + * The ``v`` value for a signature. + * + * Since a given ``x`` value for ``r`` has two possible values for + * its correspondin ``y``, the ``v`` indicates which of the two ``y`` + * values to use. + * + * It is normalized to the values ``27`` or ``28`` for legacy + * purposes. + */ + get v(): 27 | 28 { + return this.#v; + } + set v(value: BigNumberish) { + const v = getNumber(value, "value"); + assertArgument(v === 27 || v === 28, "invalid v", "v", value); + this.#v = v; + } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV(): null | bigint { - return this.#networkV; - } + /** + * The EIP-155 ``v`` for legacy transactions. For non-legacy + * transactions, this value is ``null``. + */ + get networkV(): null | bigint { + return this.#networkV; + } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacynetworkId(): null | bigint { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getnetworkId(v); - } + /** + * The chain ID for EIP-155 legacy transactions. For non-legacy + * transactions, this value is ``null``. + */ + get legacynetworkId(): null | bigint { + const v = this.networkV; + if (v == null) { + return null; + } + return Signature.getnetworkId(v); + } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity(): 0 | 1 { - return this.v === 27 ? 0 : 1; - } + /** + * The ``yParity`` for the signature. + * + * See ``v`` for more details on how this value is used. + */ + get yParity(): 0 | 1 { + return this.v === 27 ? 0 : 1; + } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS(): string { - // The EIP-2098 compact representation - const yParityAndS = getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return hexlify(yParityAndS); - } + /** + * The [[link-eip-2098]] compact representation of the ``yParity`` + * and ``s`` compacted into a single ``bytes32``. + */ + get yParityAndS(): string { + // The EIP-2098 compact representation + const yParityAndS = getBytes(this.s); + if (this.yParity) { + yParityAndS[0] |= 0x80; + } + return hexlify(yParityAndS); + } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized(): string { - return concat([this.r, this.yParityAndS]) as string; - } + /** + * The [[link-eip-2098]] compact representation. + */ + get compactSerialized(): string { + return concat([this.r, this.yParityAndS]) as string; + } - /** - * The serialized representation. - */ - get serialized(): string { - return concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]) as string; - } + /** + * The serialized representation. + */ + get serialized(): string { + return concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]) as string; + } - /** - * @private - */ - constructor(guard: any, r: string, s: string, v: 27 | 28) { - assertPrivate(guard, _guard, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } + /** + * @private + */ + constructor(guard: any, r: string, s: string, v: 27 | 28) { + assertPrivate(guard, _guard, "Signature"); + this.#r = r; + this.#s = s; + this.#v = v; + this.#networkV = null; + } - [Symbol.for("nodejs.util.inspect.custom")](): string { - return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; - } + [Symbol.for("nodejs.util.inspect.custom")](): string { + return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; + } - /** - * Returns a new identical [[Signature]]. - */ - clone(): Signature { - const clone = new Signature(_guard, this.r, this.s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } + /** + * Returns a new identical [[Signature]]. + */ + clone(): Signature { + const clone = new Signature(_guard, this.r, this.s, this.v); + if (this.networkV) { + clone.#networkV = this.networkV; + } + return clone; + } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON(): any { - const networkV = this.networkV; - return { - _type: "signature", - networkV: networkV != null ? networkV.toString() : null, - r: this.r, - s: this.s, - v: this.v, - }; - } + /** + * Returns a representation that is compatible with ``JSON.stringify``. + */ + toJSON(): any { + const networkV = this.networkV; + return { + _type: "signature", + networkV: networkV != null ? networkV.toString() : null, + r: this.r, + s: this.s, + v: this.v, + }; + } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getnetworkId(45) - * //_result: - * - * Signature.getnetworkId(46) - * //_result: - */ - static getnetworkId(v: BigNumberish): bigint { - const bv = getBigInt(v, "v"); + /** + * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. + * + * @example: + * Signature.getnetworkId(45) + * //_result: + * + * Signature.getnetworkId(46) + * //_result: + */ + static getnetworkId(v: BigNumberish): bigint { + const bv = getBigInt(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if (bv == BN_27 || bv == BN_28) { - return BN_0; - } + // The v is not an EIP-155 v, so it is the unspecified chain ID + if (bv == BN_27 || bv == BN_28) { + return BN_0; + } - // Bad value for an EIP-155 v - assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); + // Bad value for an EIP-155 v + assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); - return (bv - BN_35) / BN_2; - } + return (bv - BN_35) / BN_2; + } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getnetworkIdV(5, 27) - * //_result: - * - * Signature.getnetworkIdV(5, 28) - * //_result: - * - */ - static getnetworkIdV(networkId: BigNumberish, v: 27 | 28): bigint { - return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27); - } + /** + * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. + * + * Legacy transactions which use [[link-eip-155]] hijack the ``v`` + * property to include the chain ID. + * + * @example: + * Signature.getnetworkIdV(5, 27) + * //_result: + * + * Signature.getnetworkIdV(5, 28) + * //_result: + * + */ + static getnetworkIdV(networkId: BigNumberish, v: 27 | 28): bigint { + return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27); + } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v: BigNumberish): 27 | 28 { - const bv = getBigInt(v); + /** + * Compute the normalized legacy transaction ``v`` from a ``yParirty``, + * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. + * + * @example: + * // The values 0 and 1 imply v is actually yParity + * Signature.getNormalizedV(0) + * //_result: + * + * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) + * Signature.getNormalizedV(27) + * //_result: + * + * // Legacy EIP-155 transaction (i.e. >= 35) + * Signature.getNormalizedV(46) + * //_result: + * + * // Invalid values throw + * Signature.getNormalizedV(5) + * //_error: + */ + static getNormalizedV(v: BigNumberish): 27 | 28 { + const bv = getBigInt(v); - if (bv === BN_0 || bv === BN_27) { - return 27; - } - if (bv === BN_1 || bv === BN_28) { - return 28; - } + if (bv === BN_0 || bv === BN_27) { + return 27; + } + if (bv === BN_1 || bv === BN_28) { + return 28; + } - assertArgument(bv >= BN_35, "invalid v", "v", v); + assertArgument(bv >= BN_35, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return bv & BN_1 ? 27 : 28; - } + // Otherwise, EIP-155 v means odd is 27 and even is 28 + return bv & BN_1 ? 27 : 28; + } - /** - * Creates a new [[Signature]]. - * - * If no %%sig%% is provided, a new [[Signature]] is created - * with default values. - * - * If %%sig%% is a string, it is parsed. - */ + /** + * Creates a new [[Signature]]. + * + * If no %%sig%% is provided, a new [[Signature]] is created + * with default values. + * + * If %%sig%% is a string, it is parsed. + */ } diff --git a/src.ts/crypto/signing-key.ts b/src.ts/crypto/signing-key.ts index e86aa0d33..8e3bbf355 100644 --- a/src.ts/crypto/signing-key.ts +++ b/src.ts/crypto/signing-key.ts @@ -4,14 +4,11 @@ * @_subsection: api/crypto:Signing [about-signing] */ -import * as secp256k1 from "@noble/secp256k1"; - import { - dataLength, - getBytes, - getBytesCopy, - hexlify, - assertArgument, + dataLength, + getBytesCopy, + hexlify, + assertArgument, } from "../utils/index.js"; import type { BytesLike } from "../utils/index.js"; @@ -24,231 +21,174 @@ import { Buffer } from "buffer"; const logger = new Logger("signing-key/0.0.1"); -//const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); - -// Make noble-secp256k1 sync - /** * A **SigningKey** provides high-level access to the elliptic curve * cryptography (ECC) operations and key management. */ export class SigningKey { - #privateKey: string; - - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey: BytesLike) { - let tmp = privateKey; - if (typeof tmp === "string" && tmp.startsWith("0x")) { - tmp = tmp.replace("0x", ""); - } - assertArgument( - dataLength("0x" + tmp) === 57, - "invalid private key", - "privateKey", - "[REDACTED]", - ); - this.#privateKey = hexlify("0x" + tmp); - } - - /** - * The private key. - */ - get privateKey(): string { - return this.#privateKey; - } - - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ - get publicKey(): string { - return SigningKey.computePublicKey(this.#privateKey); - } - - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ - get compressedPublicKey(): string { - return SigningKey.computePublicKey(this.#privateKey, true); - } - - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest: BytesLike): string { - const key = getBytesCopy(this.#privateKey); - assertArgument( - dataLength(digest) === 32, - "invalid digest length", - "digest", - digest, - ); - const keyBuffer = new Uint8Array(arrayify(key)); - if (keyBuffer.length !== 57) { - logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - const digestBuffer = new Uint8Array(arrayify(digest)); - if (digestBuffer.length !== 32) { - logger.throwArgumentError("bad digest length", "digest", digest); - } - - if (keyBuffer[56] > 127) { - const prefix = keyBuffer.slice(0, 57); - prefix[0] &= 0xfc; - prefix[55] |= 0x80; - prefix[56] = 0; - const scalar = prefix.slice(0, 56); - const bufferDigest = Buffer.from(digestBuffer); - const bufferPrfx = Buffer.from(prefix); - const bufferScalar = Buffer.from(scalar); - const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer)); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ - computeSharedSecret(other: BytesLike): string { - const pubKey = SigningKey.computePublicKey(other); - return hexlify( - secp256k1.getSharedSecret( - getBytesCopy(this.#privateKey), - getBytes(pubKey), - ), - ); - } - - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ - static computePublicKey(key: BytesLike, compressed?: boolean): string { - const bytes = Buffer.from(arrayify(key)); - if (bytes.length !== 57) { - logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - - if (bytes[56] > 127) { - const scalar = bytes.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - const pub = ed448.publicKeyFromScalar(scalar); - return hexlify(pub); - } - - const pub = ed448.publicKeyCreate(bytes); - return hexlify(pub); - } - - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string { - assertArgument( - dataLength(digest) === 32, - "invalid digest length", - "digest", - digest, - ); - const digestBuffer = Buffer.from(arrayify(digest)); - const sigBuffer = Buffer.from(arrayify(signature)); - if (sigBuffer.length !== 171) { - logger.throwArgumentError("invalid signature", "signature", signature); - } - const sig = sigBuffer.slice(0, 114); - const pub = sigBuffer.slice(114); - if (ed448.verify(digestBuffer, sig, pub)) { - return hexlify(pub); - } - logger.throwArgumentError("invalid signature", "signature", signature); - return ""; - } - - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ - static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string { - const pub0 = secp256k1.ProjectivePoint.fromHex( - SigningKey.computePublicKey(p0).substring(2), - ); - const pub1 = secp256k1.ProjectivePoint.fromHex( - SigningKey.computePublicKey(p1).substring(2), - ); - return "0x" + pub0.add(pub1).toHex(!!compressed); - } + #privateKey: string; + + /** + * Creates a new **SigningKey** for %%privateKey%%. + */ + constructor(privateKey: BytesLike) { + const normalized = + typeof privateKey === "string" && !privateKey.startsWith("0x") + ? "0x" + privateKey + : privateKey; + assertArgument( + dataLength(normalized) === 57, + "invalid private key", + "privateKey", + "[REDACTED]", + ); + this.#privateKey = hexlify(normalized); + } + + /** + * The private key. + */ + get privateKey(): string { + return this.#privateKey; + } + + /** The 57-byte Ed448 public key encoded as hex. */ + get publicKey(): string { + return SigningKey.computePublicKey(this.#privateKey); + } + + /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ + get compressedPublicKey(): string { + return SigningKey.computePublicKey(this.#privateKey, true); + } + + /** + * Return the signature of the signed %%digest%%. + */ + sign(digest: BytesLike): string { + const key = getBytesCopy(this.#privateKey); + assertArgument( + dataLength(digest) === 32, + "invalid digest length", + "digest", + digest, + ); + const keyBuffer = new Uint8Array(arrayify(key)); + if (keyBuffer.length !== 57) { + logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); + } + const digestBuffer = new Uint8Array(arrayify(digest)); + if (digestBuffer.length !== 32) { + logger.throwArgumentError("bad digest length", "digest", digest); + } + + if (keyBuffer[56] > 127) { + const prefix = keyBuffer.slice(0, 57); + prefix[0] &= 0xfc; + prefix[55] |= 0x80; + prefix[56] = 0; + const scalar = prefix.slice(0, 56); + const bufferDigest = Buffer.from(digestBuffer); + const bufferPrfx = Buffer.from(prefix); + const bufferScalar = Buffer.from(scalar); + const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); + const hexlified = hexlify(sig); + return hexConcat([hexlified, this.publicKey]); + } + const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer)); + const hexlified = hexlify(sig); + return hexConcat([hexlified, this.publicKey]); + } + + /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ + computeSharedSecret(other: BytesLike): string { + const pub = Buffer.from(getBytesCopy(other)); + assertArgument( + pub.length === 57 && ed448.publicKeyVerify(pub), + "invalid public key", + "other", + other, + ); + const key = Buffer.from(getBytesCopy(this.#privateKey)); + if (key[56] > 127) { + const scalar = key.subarray(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + return hexlify(ed448.deriveWithScalar(pub, scalar)); + } + return hexlify(ed448.derive(pub, key)); + } + + /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ + static computePublicKey(key: BytesLike, compressed?: boolean): string { + const bytes = Buffer.from(arrayify(key)); + if (bytes.length !== 57) { + logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); + } + + if (bytes[56] > 127) { + const scalar = bytes.slice(0, 56); + scalar[0] &= 0xfc; + scalar[55] |= 0x80; + const pub = ed448.publicKeyFromScalar(scalar); + return hexlify(pub); + } + + const pub = ed448.publicKeyCreate(bytes); + return hexlify(pub); + } + + /** + * Returns the public key for the private key which produced the + * %%signature%% for the given %%digest%%. + * + * @example: + * key = new SigningKey(id("some-secret")) + * digest = id("hello world") + * sig = key.sign(digest) + * + * // Notice the signer public key... + * key.publicKey + * //_result: + * + * // ...is equal to the recovered public key + * SigningKey.recoverPublicKey(digest, sig) + * //_result: + * + */ + static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string { + assertArgument( + dataLength(digest) === 32, + "invalid digest length", + "digest", + digest, + ); + const digestBuffer = Buffer.from(arrayify(digest)); + const sigBuffer = Buffer.from(arrayify(signature)); + if (sigBuffer.length !== 171) { + logger.throwArgumentError("invalid signature", "signature", signature); + } + const sig = sigBuffer.slice(0, 114); + const pub = sigBuffer.slice(114); + if (ed448.verify(digestBuffer, sig, pub)) { + return hexlify(pub); + } + logger.throwArgumentError("invalid signature", "signature", signature); + return ""; + } + + /** Adds two encoded Ed448 public points. The compression flag is ignored. */ + static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string { + const points = [p0, p1].map((point) => { + const bytes = Buffer.from(getBytesCopy(point)); + assertArgument( + bytes.length === 57 && ed448.publicKeyVerify(bytes), + "invalid public key", + "point", + point, + ); + return bytes; + }); + return hexlify(ed448.publicKeyCombine(points)); + } } diff --git a/src.ts/hash/id.ts b/src.ts/hash/id.ts index c8552b93f..5398c18fa 100644 --- a/src.ts/hash/id.ts +++ b/src.ts/hash/id.ts @@ -12,8 +12,8 @@ import { toUtf8Bytes } from "../utils/index.js"; * //_result: */ export function id(value: string, useKeccak?: boolean): string { - if (useKeccak) { - return keccak256(toUtf8Bytes(value)); - } - return sha256(toUtf8Bytes(value)); + if (useKeccak) { + return keccak256(toUtf8Bytes(value)); + } + return sha256(toUtf8Bytes(value)); } diff --git a/src.ts/hash/message.ts b/src.ts/hash/message.ts index abd6830fb..b13d22eb1 100644 --- a/src.ts/hash/message.ts +++ b/src.ts/hash/message.ts @@ -30,16 +30,16 @@ import { sha256, SignatureLike } from "../crypto/index.js"; * */ export function hashMessage(message: Uint8Array | string): string { - if (typeof message === "string") { - message = toUtf8Bytes(message); - } - return sha256( - concat([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message.length)), - message, - ]), - ); + if (typeof message === "string") { + message = toUtf8Bytes(message); + } + return sha256( + concat([ + toUtf8Bytes(MessagePrefix), + toUtf8Bytes(String(message.length)), + message, + ]), + ); } /** @@ -47,10 +47,10 @@ export function hashMessage(message: Uint8Array | string): string { * the signature %%sig%% during signing for %%message%%. */ export function verifyMessage( - message: Uint8Array | string, - sig: SignatureLike, - prefix: string, + message: Uint8Array | string, + sig: SignatureLike, + prefix: string, ): string { - const digest = hashMessage(message); - return recoverAddress(digest, sig, prefix); + const digest = hashMessage(message); + return recoverAddress(digest, sig, prefix); } diff --git a/src.ts/hash/solidity.ts b/src.ts/hash/solidity.ts index d897b8fbe..63c954298 100644 --- a/src.ts/hash/solidity.ts +++ b/src.ts/hash/solidity.ts @@ -1,16 +1,16 @@ import { getAddress } from "../address/index.js"; import { sha256 as _sha256 } from "../crypto/index.js"; import { - concat, - dataLength, - getBytes, - hexlify, - toBeArray, - toTwos, - toUtf8Bytes, - zeroPadBytes, - zeroPadValue, - assertArgument, + concat, + dataLength, + getBytes, + hexlify, + toBeArray, + toTwos, + toUtf8Bytes, + zeroPadBytes, + zeroPadValue, + assertArgument, } from "../utils/index.js"; const regexBytes = new RegExp("^bytes([0-9]+)$"); @@ -18,92 +18,92 @@ const regexNumber = new RegExp("^(u?int)([0-9]*)$"); const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); function _pack(type: string, value: any, isArray?: boolean): Uint8Array { - switch (type) { - case "address": - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(getAddress(value)); - case "string": - return toUtf8Bytes(value); - case "bytes": - return getBytes(value); - case "bool": - value = !!value ? "0x01" : "0x00"; - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(value); - } - - let match = type.match(regexNumber); - if (match) { - let signed = match[1] === "int"; - let size = parseInt(match[2] || "256"); - - assertArgument( - (!match[2] || match[2] === String(size)) && - size % 8 === 0 && - size !== 0 && - size <= 256, - "invalid number type", - "type", - type, - ); - - if (isArray) { - size = 256; - } - - if (signed) { - value = toTwos(value, size); - } - - return getBytes(zeroPadValue(toBeArray(value), size / 8)); - } - - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - - assertArgument( - String(size) === match[1] && size !== 0 && size <= 32, - "invalid bytes type", - "type", - type, - ); - assertArgument( - dataLength(value) === size, - `invalid value for ${type}`, - "value", - value, - ); - - if (isArray) { - return getBytes(zeroPadBytes(value, 32)); - } - return value; - } - - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - assertArgument( - count === value.length, - `invalid array length for ${type}`, - "value", - value, - ); - - const result: Array = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return getBytes(concat(result)); - } - - assertArgument(false, "invalid type", "type", type); + switch (type) { + case "address": + if (isArray) { + return getBytes(zeroPadValue(value, 32)); + } + return getBytes(getAddress(value)); + case "string": + return toUtf8Bytes(value); + case "bytes": + return getBytes(value); + case "bool": + value = !!value ? "0x01" : "0x00"; + if (isArray) { + return getBytes(zeroPadValue(value, 32)); + } + return getBytes(value); + } + + let match = type.match(regexNumber); + if (match) { + let signed = match[1] === "int"; + let size = parseInt(match[2] || "256"); + + assertArgument( + (!match[2] || match[2] === String(size)) && + size % 8 === 0 && + size !== 0 && + size <= 256, + "invalid number type", + "type", + type, + ); + + if (isArray) { + size = 256; + } + + if (signed) { + value = toTwos(value, size); + } + + return getBytes(zeroPadValue(toBeArray(value), size / 8)); + } + + match = type.match(regexBytes); + if (match) { + const size = parseInt(match[1]); + + assertArgument( + String(size) === match[1] && size !== 0 && size <= 32, + "invalid bytes type", + "type", + type, + ); + assertArgument( + dataLength(value) === size, + `invalid value for ${type}`, + "value", + value, + ); + + if (isArray) { + return getBytes(zeroPadBytes(value, 32)); + } + return value; + } + + match = type.match(regexArray); + if (match && Array.isArray(value)) { + const baseType = match[1]; + const count = parseInt(match[2] || String(value.length)); + assertArgument( + count === value.length, + `invalid array length for ${type}`, + "value", + value, + ); + + const result: Array = []; + value.forEach(function (value) { + result.push(_pack(baseType, value, true)); + }); + return getBytes(concat(result)); + } + + assertArgument(false, "invalid type", "type", type); } // @TODO: Array Enum @@ -118,21 +118,21 @@ function _pack(type: string, value: any, isArray?: boolean): Uint8Array { * //_result: */ export function solidityPacked( - types: ReadonlyArray, - values: ReadonlyArray, + types: ReadonlyArray, + values: ReadonlyArray, ): string { - assertArgument( - types.length === values.length, - "wrong number of values; expected ${ types.length }", - "values", - values, - ); - - const tight: Array = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return hexlify(concat(tight)); + assertArgument( + types.length === values.length, + "wrong number of values; expected ${ types.length }", + "values", + values, + ); + + const tight: Array = []; + types.forEach(function (type, index) { + tight.push(_pack(type, values[index])); + }); + return hexlify(concat(tight)); } /** @@ -145,8 +145,8 @@ export function solidityPacked( * //_result: */ export function solidityPackedSha256( - types: ReadonlyArray, - values: ReadonlyArray, + types: ReadonlyArray, + values: ReadonlyArray, ): string { - return _sha256(solidityPacked(types, values)); + return _sha256(solidityPacked(types, values)); } diff --git a/src.ts/hash/typed-data.ts b/src.ts/hash/typed-data.ts index 5a82b7083..967b98713 100644 --- a/src.ts/hash/typed-data.ts +++ b/src.ts/hash/typed-data.ts @@ -1,18 +1,18 @@ import { getAddress } from "../address/index.js"; import { recoverAddress } from "../transaction/index.js"; import { - concat, - defineProperties, - getBigInt, - getBytes, - hexlify, - isHexString, - mask, - toBeHex, - toQuantity, - toTwos, - zeroPadValue, - assertArgument, + concat, + defineProperties, + getBigInt, + getBytes, + hexlify, + isHexString, + mask, + toBeHex, + toQuantity, + toTwos, + zeroPadValue, + assertArgument, } from "../utils/index.js"; import { id } from "./id.js"; @@ -27,667 +27,667 @@ const BN__1 = BigInt(-1); const BN_0 = BigInt(0); const BN_1 = BigInt(1); const BN_MAX_UINT256 = BigInt( - "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", ); export interface TypedDataDomain { - name?: null | string; - version?: null | string; - networkId?: null | BigNumberish; - verifyingContract?: null | string; - salt?: null | BytesLike; + name?: null | string; + version?: null | string; + networkId?: null | BigNumberish; + verifyingContract?: null | string; + salt?: null | BytesLike; } export interface TypedDataField { - name: string; - type: string; + name: string; + type: string; } function hexPadRight(value: BytesLike): string { - const bytes = getBytes(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return concat([bytes, padding.slice(padOffset)]) as string; - } - return hexlify(bytes); + const bytes = getBytes(value); + const padOffset = bytes.length % 32; + if (padOffset) { + return concat([bytes, padding.slice(padOffset)]) as string; + } + return hexlify(bytes); } const hexTrue = toBeHex(BN_1, 32); const hexFalse = toBeHex(BN_0, 32); const domainFieldTypes: Record = { - name: "string", - version: "string", - networkId: "uint256", - verifyingContract: "address", - salt: "bytes32", + name: "string", + version: "string", + networkId: "uint256", + verifyingContract: "address", + salt: "bytes32", }; const domainFieldNames: Array = [ - "name", - "version", - "networkId", - "verifyingContract", - "salt", + "name", + "version", + "networkId", + "verifyingContract", + "salt", ]; function checkString(key: string): (value: any) => string { - return function (value: any) { - assertArgument( - typeof value === "string", - `invalid domain value for ${JSON.stringify(key)}`, - `domain.${key}`, - value, - ); - return value; - }; + return function (value: any) { + assertArgument( + typeof value === "string", + `invalid domain value for ${JSON.stringify(key)}`, + `domain.${key}`, + value, + ); + return value; + }; } const domainChecks: Record any> = { - name: checkString("name"), - version: checkString("version"), - networkId: function (_value: any) { - const value = getBigInt(_value, "domain.networkId"); - assertArgument(value >= 0, "invalid chain ID", "domain.networkId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function (value: any) { - try { - return getAddress(value).toLowerCase(); - } catch (error) {} - assertArgument( - false, - `invalid domain value "verifyingContract"`, - "domain.verifyingContract", - value, - ); - }, - salt: function (value: any) { - const bytes = getBytes(value, "domain.salt"); - assertArgument( - bytes.length === 32, - `invalid domain value "salt"`, - "domain.salt", - value, - ); - return hexlify(bytes); - }, + name: checkString("name"), + version: checkString("version"), + networkId: function (_value: any) { + const value = getBigInt(_value, "domain.networkId"); + assertArgument(value >= 0, "invalid chain ID", "domain.networkId", _value); + if (Number.isSafeInteger(value)) { + return Number(value); + } + return toQuantity(value); + }, + verifyingContract: function (value: any) { + try { + return getAddress(value).toLowerCase(); + } catch (error) {} + assertArgument( + false, + `invalid domain value "verifyingContract"`, + "domain.verifyingContract", + value, + ); + }, + salt: function (value: any) { + const bytes = getBytes(value, "domain.salt"); + assertArgument( + bytes.length === 32, + `invalid domain value "salt"`, + "domain.salt", + value, + ); + return hexlify(bytes); + }, }; function getBaseEncoder(type: string): null | ((value: any) => string) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d*)$/); - if (match) { - const signed = match[1] === ""; - - const width = parseInt(match[2] || "256"); - assertArgument( - width % 8 === 0 && - width !== 0 && - width <= 256 && - (match[2] == null || match[2] === String(width)), - "invalid numeric width", - "type", - type, - ); - - const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); - const boundsLower = signed ? (boundsUpper + BN_1) * BN__1 : BN_0; - - return function (_value: BigNumberish) { - const value = getBigInt(_value, "value"); - - assertArgument( - value >= boundsLower && value <= boundsUpper, - `value out-of-bounds for ${type}`, - "value", - value, - ); - - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument( - width !== 0 && width <= 32 && match[1] === String(width), - "invalid bytes width", - "type", - type, - ); - - return function (value: BytesLike) { - const bytes = getBytes(value); - assertArgument( - bytes.length === width, - `invalid length for ${type}`, - "value", - value, - ); - return hexPadRight(value); - }; - } - } - - switch (type) { - case "address": - return function (value: string) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": - return function (value: boolean) { - return !value ? hexFalse : hexTrue; - }; - case "bytes": - return function (value: BytesLike) { - return sha256(value); - }; - case "string": - return function (value: string) { - return id(value); - }; - } - - return null; + // intXX and uintXX + { + const match = type.match(/^(u?)int(\d*)$/); + if (match) { + const signed = match[1] === ""; + + const width = parseInt(match[2] || "256"); + assertArgument( + width % 8 === 0 && + width !== 0 && + width <= 256 && + (match[2] == null || match[2] === String(width)), + "invalid numeric width", + "type", + type, + ); + + const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); + const boundsLower = signed ? (boundsUpper + BN_1) * BN__1 : BN_0; + + return function (_value: BigNumberish) { + const value = getBigInt(_value, "value"); + + assertArgument( + value >= boundsLower && value <= boundsUpper, + `value out-of-bounds for ${type}`, + "value", + value, + ); + + return toBeHex(signed ? toTwos(value, 256) : value, 32); + }; + } + } + + // bytesXX + { + const match = type.match(/^bytes(\d+)$/); + if (match) { + const width = parseInt(match[1]); + assertArgument( + width !== 0 && width <= 32 && match[1] === String(width), + "invalid bytes width", + "type", + type, + ); + + return function (value: BytesLike) { + const bytes = getBytes(value); + assertArgument( + bytes.length === width, + `invalid length for ${type}`, + "value", + value, + ); + return hexPadRight(value); + }; + } + } + + switch (type) { + case "address": + return function (value: string) { + return zeroPadValue(getAddress(value), 32); + }; + case "bool": + return function (value: boolean) { + return !value ? hexFalse : hexTrue; + }; + case "bytes": + return function (value: BytesLike) { + return sha256(value); + }; + case "string": + return function (value: string) { + return id(value); + }; + } + + return null; } function encodeType(name: string, fields: Array): string { - return `${name}(${fields - .map(({ name, type }) => type + " " + name) - .join(",")})`; + return `${name}(${fields + .map(({ name, type }) => type + " " + name) + .join(",")})`; } export class TypedDataEncoder { - readonly primaryType!: string; - - readonly #types: string; - get types(): Record> { - return JSON.parse(this.#types); - } - - readonly #fullTypes: Map; - - readonly #encoderCache: Map string>; - - constructor(types: Record>) { - this.#types = JSON.stringify(types); - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - - // Link struct types to their direct child structs - const links: Map> = new Map(); - - // Link structs to structs which contain them as a child - const parents: Map> = new Map(); - - // Link all subtypes within a given struct - const subtypes: Map> = new Map(); - - Object.keys(types).forEach((type) => { - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - - for (const name in types) { - const uniqueNames: Set = new Set(); - - for (const field of types[name]) { - // Check each field has a unique name - assertArgument( - !uniqueNames.has(field.name), - `duplicate variable name ${JSON.stringify( - field.name, - )} in ${JSON.stringify(name)}`, - "types", - types, - ); - uniqueNames.add(field.name); - - // Get the base type (drop any array specifiers) - const baseType = - (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null; - assertArgument( - baseType !== name, - `circular type reference to ${JSON.stringify(baseType)}`, - "types", - types, - ); - - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - - assertArgument( - parents.has(baseType), - `unknown type ${JSON.stringify(baseType)}`, - "types", - types, - ); - - // Add linkage - (parents.get(baseType) as Array).push(name); - (links.get(name) as Set).add(baseType); - } - } - - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter( - (n) => (parents.get(n) as Array).length === 0, - ); - assertArgument( - primaryTypes.length !== 0, - "missing primary type", - "types", - types, - ); - assertArgument( - primaryTypes.length === 1, - `ambiguous primary types or unused types: ${primaryTypes - .map((t) => JSON.stringify(t)) - .join(", ")}`, - "types", - types, - ); - - defineProperties(this, { primaryType: primaryTypes[0] }); - - // Check for circular type references - function checkCircular(type: string, found: Set) { - assertArgument( - !found.has(type), - `circular type reference to ${JSON.stringify(type)}`, - "types", - types, - ); - - found.add(type); - - for (const child of links.get(type) as Set) { - if (!parents.has(child)) { - continue; - } - - // Recursively check children - checkCircular(child, found); - - // Mark all ancestors as having this decendant - for (const subtype of found) { - (subtypes.get(subtype) as Set).add(child); - } - } - - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set( - name, - encodeType(name, types[name]) + - st.map((t) => encodeType(t, types[t])).join(""), - ); - } - } - - getEncoder(type: string): (value: any) => string { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - - #getEncoder(type: string): (value: any) => string { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - const subtype = match[1]; - const subEncoder = this.getEncoder(subtype); - return (value: Array) => { - assertArgument( - !match[3] || parseInt(match[3]) === value.length, - `array length mismatch; expected length ${parseInt(match[3])}`, - "value", - value, - ); - - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(sha256); - } - - return sha256(concat(result)); - }; - } - - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id(this.#fullTypes.get(type) as string); - return (value: Record) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return sha256(result); - } - return result; - }); - values.unshift(encodedType); - return concat(values) as string; - }; - } - - assertArgument(false, `unknown type: ${type}`, "type", type); - } - - encodeType(name: string): string { - const result = this.#fullTypes.get(name); - assertArgument( - result, - `unknown type: ${JSON.stringify(name)}`, - "name", - name, - ); - return result; - } - - encodeData(type: string, value: any): string { - return this.getEncoder(type)(value); - } - - hashStruct(name: string, value: Record): string { - return sha256(this.encodeData(name, value)); - } - - encode(value: Record): string { - return this.encodeData(this.primaryType, value); - } - - hash(value: Record): string { - return this.hashStruct(this.primaryType, value); - } - - _visit( - type: string, - value: any, - callback: (type: string, data: any) => any, - ): any { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - assertArgument( - !match[3] || parseInt(match[3]) === value.length, - `array length mismatch; expected length ${parseInt(match[3])}`, - "value", - value, - ); - return value.map((v: any) => this._visit(match[1], v, callback)); - } - - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce( - (accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, - >{}, - ); - } - - assertArgument(false, `unknown type: ${type}`, "type", type); - } - - visit( - value: Record, - callback: (type: string, data: any) => any, - ): any { - return this._visit(this.primaryType, value, callback); - } - - static from(types: Record>): TypedDataEncoder { - return new TypedDataEncoder(types); - } - - static getPrimaryType(types: Record>): string { - return TypedDataEncoder.from(types).primaryType; - } - - static hashStruct( - name: string, - types: Record>, - value: Record, - ): string { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - - static hashDomain(domain: TypedDataDomain): string { - const domainFields: Array = []; - for (const name in domain) { - if ((>domain)[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - assertArgument( - type, - `invalid typed-data domain key: ${JSON.stringify(name)}`, - "domain", - domain, - ); - domainFields.push({ name, type }); - } - - domainFields.sort((a, b) => { - return ( - domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name) - ); - }); - - return TypedDataEncoder.hashStruct( - "EIP712Domain", - { EIP712Domain: domainFields }, - domain, - ); - } - - static encode( - domain: TypedDataDomain, - types: Record>, - value: Record, - ): string { - return concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value), - ]) as string; - } - - static hash( - domain: TypedDataDomain, - types: Record>, - value: Record, - ): string { - return sha256(TypedDataEncoder.encode(domain, types, value)); - } - - // Replaces all address types with ENS names with their looked up address - static async resolveNames( - domain: TypedDataDomain, - types: Record>, - value: Record, - resolveName: (name: string) => Promise, - ): Promise<{ domain: TypedDataDomain; value: any }> { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - - // Allow passing null to ignore value - for (const key in domain) { - if ((>domain)[key] == null) { - delete (>domain)[key]; - } - } - - // Look up all ENS names - const ensCache: Record = {}; - - // Do we need to look up the domain's verifyingContract? - if ( - domain.verifyingContract && - !isHexString(domain.verifyingContract, 20) - ) { - ensCache[domain.verifyingContract] = "0x"; - } - - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - - // Get a list of all the addresses - encoder.visit(value, (type: string, value: any) => { - if (type === "address" && !isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - - // Replace all ENS names with their address - value = encoder.visit(value, (type: string, value: any) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - - return { domain, value }; - } - - static getPayload( - domain: TypedDataDomain, - types: Record>, - value: Record, - ): any { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - - // Derive the EIP712Domain Struct reference type - const domainValues: Record = {}; - const domainTypes: Array<{ name: string; type: string }> = []; - - domainFieldNames.forEach((name) => { - const value = (domain)[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - - const encoder = TypedDataEncoder.from(types); - - const typesWithDomain = Object.assign({}, types); - assertArgument( - typesWithDomain.EIP712Domain == null, - "types must not contain EIP712Domain type", - "types.EIP712Domain", - types, - ); - - typesWithDomain.EIP712Domain = domainTypes; - - // Validate the data structures and types - encoder.encode(value); - - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type: string, value: any) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value)); - } - - // uint or int - if (type.match(/^u?int/)) { - return getBigInt(value).toString(); - } - - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - assertArgument( - typeof value === "string", - "invalid string", - "value", - value, - ); - return value; - } - - assertArgument(false, "unsupported type", "type", type); - }), - }; - } + readonly primaryType!: string; + + readonly #types: string; + get types(): Record> { + return JSON.parse(this.#types); + } + + readonly #fullTypes: Map; + + readonly #encoderCache: Map string>; + + constructor(types: Record>) { + this.#types = JSON.stringify(types); + this.#fullTypes = new Map(); + this.#encoderCache = new Map(); + + // Link struct types to their direct child structs + const links: Map> = new Map(); + + // Link structs to structs which contain them as a child + const parents: Map> = new Map(); + + // Link all subtypes within a given struct + const subtypes: Map> = new Map(); + + Object.keys(types).forEach((type) => { + links.set(type, new Set()); + parents.set(type, []); + subtypes.set(type, new Set()); + }); + + for (const name in types) { + const uniqueNames: Set = new Set(); + + for (const field of types[name]) { + // Check each field has a unique name + assertArgument( + !uniqueNames.has(field.name), + `duplicate variable name ${JSON.stringify( + field.name, + )} in ${JSON.stringify(name)}`, + "types", + types, + ); + uniqueNames.add(field.name); + + // Get the base type (drop any array specifiers) + const baseType = + (field.type.match(/^([^\x5b]*)(\x5b|$)/))[1] || null; + assertArgument( + baseType !== name, + `circular type reference to ${JSON.stringify(baseType)}`, + "types", + types, + ); + + // Is this a base encoding type? + const encoder = getBaseEncoder(baseType); + if (encoder) { + continue; + } + + assertArgument( + parents.has(baseType), + `unknown type ${JSON.stringify(baseType)}`, + "types", + types, + ); + + // Add linkage + (parents.get(baseType) as Array).push(name); + (links.get(name) as Set).add(baseType); + } + } + + // Deduce the primary type + const primaryTypes = Array.from(parents.keys()).filter( + (n) => (parents.get(n) as Array).length === 0, + ); + assertArgument( + primaryTypes.length !== 0, + "missing primary type", + "types", + types, + ); + assertArgument( + primaryTypes.length === 1, + `ambiguous primary types or unused types: ${primaryTypes + .map((t) => JSON.stringify(t)) + .join(", ")}`, + "types", + types, + ); + + defineProperties(this, { primaryType: primaryTypes[0] }); + + // Check for circular type references + function checkCircular(type: string, found: Set) { + assertArgument( + !found.has(type), + `circular type reference to ${JSON.stringify(type)}`, + "types", + types, + ); + + found.add(type); + + for (const child of links.get(type) as Set) { + if (!parents.has(child)) { + continue; + } + + // Recursively check children + checkCircular(child, found); + + // Mark all ancestors as having this decendant + for (const subtype of found) { + (subtypes.get(subtype) as Set).add(child); + } + } + + found.delete(type); + } + checkCircular(this.primaryType, new Set()); + + // Compute each fully describe type + for (const [name, set] of subtypes) { + const st = Array.from(set); + st.sort(); + this.#fullTypes.set( + name, + encodeType(name, types[name]) + + st.map((t) => encodeType(t, types[t])).join(""), + ); + } + } + + getEncoder(type: string): (value: any) => string { + let encoder = this.#encoderCache.get(type); + if (!encoder) { + encoder = this.#getEncoder(type); + this.#encoderCache.set(type, encoder); + } + return encoder; + } + + #getEncoder(type: string): (value: any) => string { + // Basic encoder type (address, bool, uint256, etc) + { + const encoder = getBaseEncoder(type); + if (encoder) { + return encoder; + } + } + + // Array + const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); + if (match) { + const subtype = match[1]; + const subEncoder = this.getEncoder(subtype); + return (value: Array) => { + assertArgument( + !match[3] || parseInt(match[3]) === value.length, + `array length mismatch; expected length ${parseInt(match[3])}`, + "value", + value, + ); + + let result = value.map(subEncoder); + if (this.#fullTypes.has(subtype)) { + result = result.map(sha256); + } + + return sha256(concat(result)); + }; + } + + // Struct + const fields = this.types[type]; + if (fields) { + const encodedType = id(this.#fullTypes.get(type) as string); + return (value: Record) => { + const values = fields.map(({ name, type }) => { + const result = this.getEncoder(type)(value[name]); + if (this.#fullTypes.has(type)) { + return sha256(result); + } + return result; + }); + values.unshift(encodedType); + return concat(values) as string; + }; + } + + assertArgument(false, `unknown type: ${type}`, "type", type); + } + + encodeType(name: string): string { + const result = this.#fullTypes.get(name); + assertArgument( + result, + `unknown type: ${JSON.stringify(name)}`, + "name", + name, + ); + return result; + } + + encodeData(type: string, value: any): string { + return this.getEncoder(type)(value); + } + + hashStruct(name: string, value: Record): string { + return sha256(this.encodeData(name, value)); + } + + encode(value: Record): string { + return this.encodeData(this.primaryType, value); + } + + hash(value: Record): string { + return this.hashStruct(this.primaryType, value); + } + + _visit( + type: string, + value: any, + callback: (type: string, data: any) => any, + ): any { + // Basic encoder type (address, bool, uint256, etc) + { + const encoder = getBaseEncoder(type); + if (encoder) { + return callback(type, value); + } + } + + // Array + const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); + if (match) { + assertArgument( + !match[3] || parseInt(match[3]) === value.length, + `array length mismatch; expected length ${parseInt(match[3])}`, + "value", + value, + ); + return value.map((v: any) => this._visit(match[1], v, callback)); + } + + // Struct + const fields = this.types[type]; + if (fields) { + return fields.reduce( + (accum, { name, type }) => { + accum[name] = this._visit(type, value[name], callback); + return accum; + }, + >{}, + ); + } + + assertArgument(false, `unknown type: ${type}`, "type", type); + } + + visit( + value: Record, + callback: (type: string, data: any) => any, + ): any { + return this._visit(this.primaryType, value, callback); + } + + static from(types: Record>): TypedDataEncoder { + return new TypedDataEncoder(types); + } + + static getPrimaryType(types: Record>): string { + return TypedDataEncoder.from(types).primaryType; + } + + static hashStruct( + name: string, + types: Record>, + value: Record, + ): string { + return TypedDataEncoder.from(types).hashStruct(name, value); + } + + static hashDomain(domain: TypedDataDomain): string { + const domainFields: Array = []; + for (const name in domain) { + if ((>domain)[name] == null) { + continue; + } + const type = domainFieldTypes[name]; + assertArgument( + type, + `invalid typed-data domain key: ${JSON.stringify(name)}`, + "domain", + domain, + ); + domainFields.push({ name, type }); + } + + domainFields.sort((a, b) => { + return ( + domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name) + ); + }); + + return TypedDataEncoder.hashStruct( + "EIP712Domain", + { EIP712Domain: domainFields }, + domain, + ); + } + + static encode( + domain: TypedDataDomain, + types: Record>, + value: Record, + ): string { + return concat([ + "0x1901", + TypedDataEncoder.hashDomain(domain), + TypedDataEncoder.from(types).hash(value), + ]) as string; + } + + static hash( + domain: TypedDataDomain, + types: Record>, + value: Record, + ): string { + return sha256(TypedDataEncoder.encode(domain, types, value)); + } + + // Replaces all address types with ENS names with their looked up address + static async resolveNames( + domain: TypedDataDomain, + types: Record>, + value: Record, + resolveName: (name: string) => Promise, + ): Promise<{ domain: TypedDataDomain; value: any }> { + // Make a copy to isolate it from the object passed in + domain = Object.assign({}, domain); + + // Allow passing null to ignore value + for (const key in domain) { + if ((>domain)[key] == null) { + delete (>domain)[key]; + } + } + + // Look up all ENS names + const ensCache: Record = {}; + + // Do we need to look up the domain's verifyingContract? + if ( + domain.verifyingContract && + !isHexString(domain.verifyingContract, 20) + ) { + ensCache[domain.verifyingContract] = "0x"; + } + + // We are going to use the encoder to visit all the base values + const encoder = TypedDataEncoder.from(types); + + // Get a list of all the addresses + encoder.visit(value, (type: string, value: any) => { + if (type === "address" && !isHexString(value, 20)) { + ensCache[value] = "0x"; + } + return value; + }); + + // Lookup each name + for (const name in ensCache) { + ensCache[name] = await resolveName(name); + } + + // Replace the domain verifyingContract if needed + if (domain.verifyingContract && ensCache[domain.verifyingContract]) { + domain.verifyingContract = ensCache[domain.verifyingContract]; + } + + // Replace all ENS names with their address + value = encoder.visit(value, (type: string, value: any) => { + if (type === "address" && ensCache[value]) { + return ensCache[value]; + } + return value; + }); + + return { domain, value }; + } + + static getPayload( + domain: TypedDataDomain, + types: Record>, + value: Record, + ): any { + // Validate the domain fields + TypedDataEncoder.hashDomain(domain); + + // Derive the EIP712Domain Struct reference type + const domainValues: Record = {}; + const domainTypes: Array<{ name: string; type: string }> = []; + + domainFieldNames.forEach((name) => { + const value = (domain)[name]; + if (value == null) { + return; + } + domainValues[name] = domainChecks[name](value); + domainTypes.push({ name, type: domainFieldTypes[name] }); + }); + + const encoder = TypedDataEncoder.from(types); + + const typesWithDomain = Object.assign({}, types); + assertArgument( + typesWithDomain.EIP712Domain == null, + "types must not contain EIP712Domain type", + "types.EIP712Domain", + types, + ); + + typesWithDomain.EIP712Domain = domainTypes; + + // Validate the data structures and types + encoder.encode(value); + + return { + types: typesWithDomain, + domain: domainValues, + primaryType: encoder.primaryType, + message: encoder.visit(value, (type: string, value: any) => { + // bytes + if (type.match(/^bytes(\d*)/)) { + return hexlify(getBytes(value)); + } + + // uint or int + if (type.match(/^u?int/)) { + return getBigInt(value).toString(); + } + + switch (type) { + case "address": + return value.toLowerCase(); + case "bool": + return !!value; + case "string": + assertArgument( + typeof value === "string", + "invalid string", + "value", + value, + ); + return value; + } + + assertArgument(false, "unsupported type", "type", type); + }), + }; + } } /** * Compute the address used to sign the typed data for the %%signature%%. */ export function verifyTypedData( - domain: TypedDataDomain, - types: Record>, - value: Record, - signature: string, - prefix: string, + domain: TypedDataDomain, + types: Record>, + value: Record, + signature: string, + prefix: string, ): string { - return recoverAddress( - TypedDataEncoder.hash(domain, types, value), - signature, - prefix, - ); + return recoverAddress( + TypedDataEncoder.hash(domain, types, value), + signature, + prefix, + ); } diff --git a/src.ts/ipfs/index.ts b/src.ts/ipfs/index.ts new file mode 100644 index 000000000..9cab0b7f4 --- /dev/null +++ b/src.ts/ipfs/index.ts @@ -0,0 +1,90 @@ +export const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; +export interface IpfsGatewayOptions { + template?: string; + maxResponseBytes?: number; + timeoutMs?: number; + fetch?: typeof globalThis.fetch; +} +/** Configurable IPFS resolution and bounded JSON loading. */ +export class IpfsGateway { + readonly template: string; + readonly maxResponseBytes: number; + readonly timeoutMs: number; + readonly #fetch: typeof globalThis.fetch; + constructor(options: IpfsGatewayOptions = {}) { + this.template = options.template ?? defaultIpfsGatewayTemplate; + this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024; + this.timeoutMs = options.timeoutMs ?? 30_000; + this.#fetch = options.fetch ?? globalThis.fetch; + const templateUrl = new URL(this.template.replace("{cid}", "cid")); + if ( + !/^https?:$/.test(templateUrl.protocol) || + this.template.split("{cid}").length !== 2 + ) + throw new TypeError( + "gateway template must be HTTP(S) and contain one {cid}", + ); + for (const value of [this.maxResponseBytes, this.timeoutMs]) + if (!Number.isSafeInteger(value) || value <= 0) + throw new TypeError("gateway limits must be positive safe integers"); + } + resolve(reference: string): URL { + const value = reference.trim(); + if (/^https?:\/\//i.test(value)) return new URL(value); + const path = value.replace(/^ipfs:\/\//, "").replace(/^\/?ipfs\//, ""); + if ( + !/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path) || + path.split("/").some((part) => part === "." || part === "..") + ) + throw new TypeError("invalid IPFS reference"); + return new URL( + this.template.replace( + "{cid}", + path.split("/").map(encodeURIComponent).join("/"), + ), + ); + } + async readJson(reference: string): Promise { + const controller = new AbortController(); + const timer = setTimeout(() => controller.abort(), this.timeoutMs); + let reader: ReadableStreamDefaultReader | undefined; + try { + const response = await this.#fetch(this.resolve(reference), { + headers: { accept: "application/json" }, + signal: controller.signal, + }); + if (!response.ok) { + await response.body?.cancel(); + throw new Error(`IPFS gateway returned HTTP ${response.status}`); + } + if (!response.body) + throw new Error("IPFS gateway returned an empty body"); + reader = response.body.getReader(); + const chunks: Uint8Array[] = []; + let length = 0; + while (true) { + const { done, value } = await reader.read(); + if (done) break; + length += value.length; + if (length > this.maxResponseBytes) + throw new Error( + `IPFS response exceeds ${this.maxResponseBytes} bytes`, + ); + chunks.push(value); + } + const bytes = new Uint8Array(length); + let offset = 0; + for (const chunk of chunks) { + bytes.set(chunk, offset); + offset += chunk.length; + } + return JSON.parse( + new TextDecoder("utf-8", { fatal: true }).decode(bytes), + ); + } finally { + clearTimeout(timer); + await reader?.cancel().catch(() => {}); + reader?.releaseLock(); + } + } +} diff --git a/src.ts/logger/logger.ts b/src.ts/logger/logger.ts index 630fac2b1..aac8621c4 100644 --- a/src.ts/logger/logger.ts +++ b/src.ts/logger/logger.ts @@ -4,425 +4,425 @@ let _permanentCensorErrors = false; let _censorErrors = false; const LogLevels: { [name: string]: number } = { - debug: 1, - default: 2, - info: 2, - warning: 3, - error: 4, - off: 5, + debug: 1, + default: 2, + info: 2, + warning: 3, + error: 4, + off: 5, }; let _logLevel = LogLevels["default"]; let _globalLogger: any = null; function _checkNormalize(): any { - try { - const missing: Array = []; - - // Make sure all forms of normalization are supported - ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { - try { - if ("test".normalize(form) !== "test") { - throw new Error("bad normalize"); - } - } catch (error) { - missing.push(form); - } - }); - - if (missing.length) { - throw new Error("missing " + missing.join(", ")); - } - - if ( - String.fromCharCode(0xe9).normalize("NFD") !== - String.fromCharCode(0x65, 0x0301) - ) { - throw new Error("broken implementation"); - } - } catch (error: any) { - return error.message; - } - - return null; + try { + const missing: Array = []; + + // Make sure all forms of normalization are supported + ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { + try { + if ("test".normalize(form) !== "test") { + throw new Error("bad normalize"); + } + } catch (error) { + missing.push(form); + } + }); + + if (missing.length) { + throw new Error("missing " + missing.join(", ")); + } + + if ( + String.fromCharCode(0xe9).normalize("NFD") !== + String.fromCharCode(0x65, 0x0301) + ) { + throw new Error("broken implementation"); + } + } catch (error: any) { + return error.message; + } + + return null; } const _normalizeError = _checkNormalize(); export enum LogLevel { - DEBUG = "DEBUG", - INFO = "INFO", - WARNING = "WARNING", - ERROR = "ERROR", - OFF = "OFF", + DEBUG = "DEBUG", + INFO = "INFO", + WARNING = "WARNING", + ERROR = "ERROR", + OFF = "OFF", } export enum ErrorCode { - /////////////////// - // Generic Errors - - // Unknown Error - UNKNOWN_ERROR = "UNKNOWN_ERROR", - - // Not Implemented - NOT_IMPLEMENTED = "NOT_IMPLEMENTED", - - // Unsupported Operation - // - operation - UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION", - - // Network Error (i.e. Core Network, such as an invalid network ID) - // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) - NETWORK_ERROR = "NETWORK_ERROR", - - // Some sort of bad response from the server - SERVER_ERROR = "SERVER_ERROR", - - // Timeout - TIMEOUT = "TIMEOUT", - - /////////////////// - // Operational Errors - - // Buffer Overrun - BUFFER_OVERRUN = "BUFFER_OVERRUN", - - // Numeric Fault - // - operation: the operation being executed - // - fault: the reason this faulted - NUMERIC_FAULT = "NUMERIC_FAULT", - - /////////////////// - // Argument Errors - - // Missing new operator to an object - // - name: The name of the class - MISSING_NEW = "MISSING_NEW", - - // Invalid argument (e.g. value is incompatible with type) to a function: - // - argument: The argument name that was invalid - // - value: The value of the argument - INVALID_ARGUMENT = "INVALID_ARGUMENT", - - // Missing argument to a function: - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - MISSING_ARGUMENT = "MISSING_ARGUMENT", - - // Too many arguments - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT", - - /////////////////// - // Blockchain Errors - - // Call exception - // - transaction: the transaction - // - address?: the contract address - // - args?: The arguments passed into the function - // - method?: The Solidity method signature - // - errorSignature?: The EIP848 error signature - // - errorArgs?: The EIP848 error parameters - // - reason: The reason (only for EIP848 "Error(string)") - CALL_EXCEPTION = "CALL_EXCEPTION", - - // Insufficient funds (< value + energyLimit * energyPrice) - // - transaction: the transaction attempted - INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS", - - // Nonce has already been used - // - transaction: the transaction attempted - NONCE_EXPIRED = "NONCE_EXPIRED", - - // The replacement fee for the transaction is too low - // - transaction: the transaction attempted - REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED", - - // The energy limit could not be estimated - // - transaction: the transaction passed to estimateEnergy - UNPREDICTABLE_ENERGY_LIMIT = "UNPREDICTABLE_ENERGY_LIMIT", - - // The transaction was replaced by one with a higher energy price - // - reason: "cancelled", "replaced" or "repriced" - // - cancelled: true if reason == "cancelled" or reason == "replaced") - // - hash: original transaction hash - // - replacement: the full TransactionsResponse for the replacement - // - receipt: the receipt of the replacement - TRANSACTION_REPLACED = "TRANSACTION_REPLACED", + /////////////////// + // Generic Errors + + // Unknown Error + UNKNOWN_ERROR = "UNKNOWN_ERROR", + + // Not Implemented + NOT_IMPLEMENTED = "NOT_IMPLEMENTED", + + // Unsupported Operation + // - operation + UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION", + + // Network Error (i.e. Core Network, such as an invalid network ID) + // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) + NETWORK_ERROR = "NETWORK_ERROR", + + // Some sort of bad response from the server + SERVER_ERROR = "SERVER_ERROR", + + // Timeout + TIMEOUT = "TIMEOUT", + + /////////////////// + // Operational Errors + + // Buffer Overrun + BUFFER_OVERRUN = "BUFFER_OVERRUN", + + // Numeric Fault + // - operation: the operation being executed + // - fault: the reason this faulted + NUMERIC_FAULT = "NUMERIC_FAULT", + + /////////////////// + // Argument Errors + + // Missing new operator to an object + // - name: The name of the class + MISSING_NEW = "MISSING_NEW", + + // Invalid argument (e.g. value is incompatible with type) to a function: + // - argument: The argument name that was invalid + // - value: The value of the argument + INVALID_ARGUMENT = "INVALID_ARGUMENT", + + // Missing argument to a function: + // - count: The number of arguments received + // - expectedCount: The number of arguments expected + MISSING_ARGUMENT = "MISSING_ARGUMENT", + + // Too many arguments + // - count: The number of arguments received + // - expectedCount: The number of arguments expected + UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT", + + /////////////////// + // Blockchain Errors + + // Call exception + // - transaction: the transaction + // - address?: the contract address + // - args?: The arguments passed into the function + // - method?: The Solidity method signature + // - errorSignature?: The EIP848 error signature + // - errorArgs?: The EIP848 error parameters + // - reason: The reason (only for EIP848 "Error(string)") + CALL_EXCEPTION = "CALL_EXCEPTION", + + // Insufficient funds (< value + energyLimit * energyPrice) + // - transaction: the transaction attempted + INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS", + + // Nonce has already been used + // - transaction: the transaction attempted + NONCE_EXPIRED = "NONCE_EXPIRED", + + // The replacement fee for the transaction is too low + // - transaction: the transaction attempted + REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED", + + // The energy limit could not be estimated + // - transaction: the transaction passed to estimateEnergy + UNPREDICTABLE_ENERGY_LIMIT = "UNPREDICTABLE_ENERGY_LIMIT", + + // The transaction was replaced by one with a higher energy price + // - reason: "cancelled", "replaced" or "repriced" + // - cancelled: true if reason == "cancelled" or reason == "replaced") + // - hash: original transaction hash + // - replacement: the full TransactionsResponse for the replacement + // - receipt: the receipt of the replacement + TRANSACTION_REPLACED = "TRANSACTION_REPLACED", } const HEX = "0123456789abcdef"; export class Logger { - readonly version: string = "0.0.1"; - - static errors = ErrorCode; - - static levels = LogLevel; - - constructor(version: string) { - Object.defineProperty(this, "version", { - enumerable: true, - value: version, - writable: false, - }); - } - - _log(logLevel: LogLevel, args: Array): void { - const level = logLevel.toLowerCase(); - if (LogLevels[level] == null) { - this.throwArgumentError("invalid log level name", "logLevel", logLevel); - } - if (_logLevel > LogLevels[level]) { - return; - } - console.log.apply(console, args); - } - - debug(...args: Array): void { - this._log(Logger.levels.DEBUG, args); - } - - info(...args: Array): void { - this._log(Logger.levels.INFO, args); - } - - warn(...args: Array): void { - this._log(Logger.levels.WARNING, args); - } - - makeError(message: string, code?: ErrorCode, params?: any): Error { - // Errors are being censored - if (_censorErrors) { - return this.makeError("censored error", code, {}); - } - - if (!code) { - code = Logger.errors.UNKNOWN_ERROR; - } - if (!params) { - params = {}; - } - - const messageDetails: Array = []; - Object.keys(params).forEach((key) => { - const value = params[key]; - try { - if (value instanceof Uint8Array) { - let hex = ""; - for (let i = 0; i < value.length; i++) { - hex += HEX[value[i] >> 4]; - hex += HEX[value[i] & 0x0f]; - } - messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); - } else { - messageDetails.push(key + "=" + JSON.stringify(value)); - } - } catch (error) { - messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); - } - }); - messageDetails.push(`code=${code}`); - messageDetails.push(`version=${this.version}`); - - const reason = message; - if (messageDetails.length) { - message += " (" + messageDetails.join(", ") + ")"; - } - - // @TODO: Any?? - const error: any = new Error(message); - error.reason = reason; - error.code = code; - - Object.keys(params).forEach(function (key) { - error[key] = params[key]; - }); - - return error; - } - - throwError(message: string, code?: ErrorCode, params?: any): never { - throw this.makeError(message, code, params); - } - - throwArgumentError(message: string, name: string, value: any): never { - return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { - argument: name, - value: value, - }); - } - - assert( - condition: any, - message: string, - code?: ErrorCode, - params?: any, - ): void { - if (!!condition) { - return; - } - this.throwError(message, code, params); - } - - assertArgument( - condition: any, - message: string, - name: string, - value: any, - ): void { - if (!!condition) { - return; - } - this.throwArgumentError(message, name, value); - } - - checkNormalize(message?: string): void { - if (message == null) { - message = "platform missing String.prototype.normalize"; - } - if (_normalizeError) { - this.throwError( - "platform missing String.prototype.normalize", - Logger.errors.UNSUPPORTED_OPERATION, - { - operation: "String.prototype.normalize", - form: _normalizeError, - }, - ); - } - } - - checkSafeUint53(value: number, message?: string): void { - if (typeof value !== "number") { - return; - } - - if (message == null) { - message = "value not safe"; - } - - if (value < 0 || value >= 0x1fffffffffffff) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "out-of-safe-range", - value: value, - }); - } - - if (value % 1) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "non-integer", - value: value, - }); - } - } - - checkArgumentCount( - count: number, - expectedCount: number, - message?: string, - ): void { - if (message) { - message = ": " + message; - } else { - message = ""; - } - - if (count < expectedCount) { - this.throwError( - "missing argument" + message, - Logger.errors.MISSING_ARGUMENT, - { - count: count, - expectedCount: expectedCount, - }, - ); - } - - if (count > expectedCount) { - this.throwError( - "too many arguments" + message, - Logger.errors.UNEXPECTED_ARGUMENT, - { - count: count, - expectedCount: expectedCount, - }, - ); - } - } - - checkNew(target: any, kind: any): void { - if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - - checkAbstract(target: any, kind: any): void { - if (target === kind) { - this.throwError( - "cannot instantiate abstract class " + - JSON.stringify(kind.name) + - " directly; use a sub-class", - Logger.errors.UNSUPPORTED_OPERATION, - { name: target.name, operation: "new" }, - ); - } else if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - - static globalLogger(): Logger { - if (!_globalLogger) { - _globalLogger = new Logger("logger/0.0.1"); - } - return _globalLogger; - } - - static setCensorship(censorship: boolean, permanent?: boolean): void { - if (!censorship && permanent) { - this.globalLogger().throwError( - "cannot permanently disable censorship", - Logger.errors.UNSUPPORTED_OPERATION, - { - operation: "setCensorship", - }, - ); - } - - if (_permanentCensorErrors) { - if (!censorship) { - return; - } - this.globalLogger().throwError( - "error censorship permanent", - Logger.errors.UNSUPPORTED_OPERATION, - { - operation: "setCensorship", - }, - ); - } - - _censorErrors = !!censorship; - _permanentCensorErrors = !!permanent; - } - - static setLogLevel(logLevel: LogLevel): void { - const level = LogLevels[logLevel.toLowerCase()]; - if (level == null) { - Logger.globalLogger().warn("invalid log level - " + logLevel); - return; - } - _logLevel = level; - } - - static from(version: string): Logger { - return new Logger(version); - } + readonly version: string = "0.0.1"; + + static errors = ErrorCode; + + static levels = LogLevel; + + constructor(version: string) { + Object.defineProperty(this, "version", { + enumerable: true, + value: version, + writable: false, + }); + } + + _log(logLevel: LogLevel, args: Array): void { + const level = logLevel.toLowerCase(); + if (LogLevels[level] == null) { + this.throwArgumentError("invalid log level name", "logLevel", logLevel); + } + if (_logLevel > LogLevels[level]) { + return; + } + console.log.apply(console, args); + } + + debug(...args: Array): void { + this._log(Logger.levels.DEBUG, args); + } + + info(...args: Array): void { + this._log(Logger.levels.INFO, args); + } + + warn(...args: Array): void { + this._log(Logger.levels.WARNING, args); + } + + makeError(message: string, code?: ErrorCode, params?: any): Error { + // Errors are being censored + if (_censorErrors) { + return this.makeError("censored error", code, {}); + } + + if (!code) { + code = Logger.errors.UNKNOWN_ERROR; + } + if (!params) { + params = {}; + } + + const messageDetails: Array = []; + Object.keys(params).forEach((key) => { + const value = params[key]; + try { + if (value instanceof Uint8Array) { + let hex = ""; + for (let i = 0; i < value.length; i++) { + hex += HEX[value[i] >> 4]; + hex += HEX[value[i] & 0x0f]; + } + messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); + } else { + messageDetails.push(key + "=" + JSON.stringify(value)); + } + } catch (error) { + messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); + } + }); + messageDetails.push(`code=${code}`); + messageDetails.push(`version=${this.version}`); + + const reason = message; + if (messageDetails.length) { + message += " (" + messageDetails.join(", ") + ")"; + } + + // @TODO: Any?? + const error: any = new Error(message); + error.reason = reason; + error.code = code; + + Object.keys(params).forEach(function (key) { + error[key] = params[key]; + }); + + return error; + } + + throwError(message: string, code?: ErrorCode, params?: any): never { + throw this.makeError(message, code, params); + } + + throwArgumentError(message: string, name: string, value: any): never { + return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { + argument: name, + value: value, + }); + } + + assert( + condition: any, + message: string, + code?: ErrorCode, + params?: any, + ): void { + if (!!condition) { + return; + } + this.throwError(message, code, params); + } + + assertArgument( + condition: any, + message: string, + name: string, + value: any, + ): void { + if (!!condition) { + return; + } + this.throwArgumentError(message, name, value); + } + + checkNormalize(message?: string): void { + if (message == null) { + message = "platform missing String.prototype.normalize"; + } + if (_normalizeError) { + this.throwError( + "platform missing String.prototype.normalize", + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: "String.prototype.normalize", + form: _normalizeError, + }, + ); + } + } + + checkSafeUint53(value: number, message?: string): void { + if (typeof value !== "number") { + return; + } + + if (message == null) { + message = "value not safe"; + } + + if (value < 0 || value >= 0x1fffffffffffff) { + this.throwError(message, Logger.errors.NUMERIC_FAULT, { + operation: "checkSafeInteger", + fault: "out-of-safe-range", + value: value, + }); + } + + if (value % 1) { + this.throwError(message, Logger.errors.NUMERIC_FAULT, { + operation: "checkSafeInteger", + fault: "non-integer", + value: value, + }); + } + } + + checkArgumentCount( + count: number, + expectedCount: number, + message?: string, + ): void { + if (message) { + message = ": " + message; + } else { + message = ""; + } + + if (count < expectedCount) { + this.throwError( + "missing argument" + message, + Logger.errors.MISSING_ARGUMENT, + { + count: count, + expectedCount: expectedCount, + }, + ); + } + + if (count > expectedCount) { + this.throwError( + "too many arguments" + message, + Logger.errors.UNEXPECTED_ARGUMENT, + { + count: count, + expectedCount: expectedCount, + }, + ); + } + } + + checkNew(target: any, kind: any): void { + if (target === Object || target == null) { + this.throwError("missing new", Logger.errors.MISSING_NEW, { + name: kind.name, + }); + } + } + + checkAbstract(target: any, kind: any): void { + if (target === kind) { + this.throwError( + "cannot instantiate abstract class " + + JSON.stringify(kind.name) + + " directly; use a sub-class", + Logger.errors.UNSUPPORTED_OPERATION, + { name: target.name, operation: "new" }, + ); + } else if (target === Object || target == null) { + this.throwError("missing new", Logger.errors.MISSING_NEW, { + name: kind.name, + }); + } + } + + static globalLogger(): Logger { + if (!_globalLogger) { + _globalLogger = new Logger("logger/0.0.1"); + } + return _globalLogger; + } + + static setCensorship(censorship: boolean, permanent?: boolean): void { + if (!censorship && permanent) { + this.globalLogger().throwError( + "cannot permanently disable censorship", + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: "setCensorship", + }, + ); + } + + if (_permanentCensorErrors) { + if (!censorship) { + return; + } + this.globalLogger().throwError( + "error censorship permanent", + Logger.errors.UNSUPPORTED_OPERATION, + { + operation: "setCensorship", + }, + ); + } + + _censorErrors = !!censorship; + _permanentCensorErrors = !!permanent; + } + + static setLogLevel(logLevel: LogLevel): void { + const level = LogLevels[logLevel.toLowerCase()]; + if (level == null) { + Logger.globalLogger().warn("invalid log level - " + logLevel); + return; + } + _logLevel = level; + } + + static from(version: string): Logger { + return new Logger(version); + } } diff --git a/src.ts/providers/abstract-provider.ts b/src.ts/providers/abstract-provider.ts index bb67a48ad..6d3854238 100644 --- a/src.ts/providers/abstract-provider.ts +++ b/src.ts/providers/abstract-provider.ts @@ -15,47 +15,47 @@ import { resolveAddress } from "../address/checks.js"; import { Transaction } from "../transaction/index.js"; import { - concat, - dataLength, - dataSlice, - hexlify, - isHexString, - getBigInt, - getBytes, - getNumber, - isCallException, - makeError, - assert, - assertArgument, - FetchRequest, - toBeArray, - toQuantity, - defineProperties, - EventPayload, - resolveProperties, - toUtf8String, + concat, + dataLength, + dataSlice, + hexlify, + isHexString, + getBigInt, + getBytes, + getNumber, + isCallException, + makeError, + assert, + assertArgument, + FetchRequest, + toBeArray, + toQuantity, + defineProperties, + EventPayload, + resolveProperties, + toUtf8String, } from "../utils/index.js"; import { - formatBlock, - formatLog, - formatTransactionReceipt, - formatTransactionResponse, + formatBlock, + formatLog, + formatTransactionReceipt, + formatTransactionResponse, } from "./format.js"; import { Network } from "./network.js"; import { - copyRequest, - Block, - FeeData, - Log, - TransactionReceipt, - TransactionResponse, + copyRequest, + Block, + FeeData, + Log, + TransactionReceipt, + TransactionResponse, } from "./provider.js"; import { - PollingBlockSubscriber, - PollingEventSubscriber, - PollingOrphanSubscriber, - PollingTransactionSubscriber, + PollingBlockSubscriber, + PollingEventSubscriber, + PollingOrphanSubscriber, + PollingTransactionSubscriber, } from "./subscriber-polling.js"; import type { Addressable, AddressLike } from "../address/index.js"; @@ -64,22 +64,22 @@ import type { Listener } from "../utils/index.js"; import type { Networkish } from "./network.js"; import type { - BlockParams, - LogParams, - TransactionReceiptParams, - TransactionResponseParams, + BlockParams, + LogParams, + TransactionReceiptParams, + TransactionResponseParams, } from "./formatting.js"; import type { - BlockTag, - EventFilter, - Filter, - FilterByBlockHash, - OrphanFilter, - PreparedTransactionRequest, - Provider, - ProviderEvent, - TransactionRequest, + BlockTag, + EventFilter, + Filter, + FilterByBlockHash, + OrphanFilter, + PreparedTransactionRequest, + Provider, + ProviderEvent, + TransactionRequest, } from "./provider.js"; type Timer = ReturnType; @@ -87,1772 +87,1772 @@ type Timer = ReturnType; const MAX_CCIP_REDIRECTS = 10; function isPromise(value: any): value is Promise { - return value && typeof value.then === "function"; + return value && typeof value.then === "function"; } function getTag(prefix: string, value: any): string { - return ( - prefix + - ":" + - JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof v === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof v === "string") { - return v.toLowerCase(); - } - - // Sort object keys - if (typeof v === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce( - (accum, key) => { - accum[key] = v[key]; - return accum; - }, - {}, - ); - } - - return v; - }) - ); + return ( + prefix + + ":" + + JSON.stringify(value, (k, v) => { + if (v == null) { + return "null"; + } + if (typeof v === "bigint") { + return `bigint:${v.toString()}`; + } + if (typeof v === "string") { + return v.toLowerCase(); + } + + // Sort object keys + if (typeof v === "object" && !Array.isArray(v)) { + const keys = Object.keys(v); + keys.sort(); + return keys.reduce( + (accum, key) => { + accum[key] = v[key]; + return accum; + }, + {}, + ); + } + + return v; + }) + ); } export type DebugEventAbstractProvider = - | { - action: "sendCcipReadFetchRequest"; - request: FetchRequest; - index: number; - urls: Array; - } - | { - action: "receiveCcipReadFetchResult"; - request: FetchRequest; - result: any; - } - | { - action: "receiveCcipReadFetchError"; - request: FetchRequest; - result: any; - } - | { - action: "sendCcipReadCall"; - transaction: { to: string; data: string }; - } - | { - action: "receiveCcipReadCallResult"; - transaction: { to: string; data: string }; - result: string; - } - | { - action: "receiveCcipReadCallError"; - transaction: { to: string; data: string }; - error: Error; - }; + | { + action: "sendCcipReadFetchRequest"; + request: FetchRequest; + index: number; + urls: Array; + } + | { + action: "receiveCcipReadFetchResult"; + request: FetchRequest; + result: any; + } + | { + action: "receiveCcipReadFetchError"; + request: FetchRequest; + result: any; + } + | { + action: "sendCcipReadCall"; + transaction: { to: string; data: string }; + } + | { + action: "receiveCcipReadCallResult"; + transaction: { to: string; data: string }; + result: string; + } + | { + action: "receiveCcipReadCallError"; + transaction: { to: string; data: string }; + error: Error; + }; // Only sub-classes overriding the _getSubscription method will care about this export type Subscription = - | { - type: "block" | "close" | "debug" | "error" | "network" | "pending"; - tag: string; - } - | { - type: "transaction"; - tag: string; - hash: string; - } - | { - type: "event"; - tag: string; - filter: EventFilter; - } - | { - type: "orphan"; - tag: string; - filter: OrphanFilter; - }; + | { + type: "block" | "close" | "debug" | "error" | "network" | "pending"; + tag: string; + } + | { + type: "transaction"; + tag: string; + hash: string; + } + | { + type: "event"; + tag: string; + filter: EventFilter; + } + | { + type: "orphan"; + tag: string; + filter: OrphanFilter; + }; export interface Subscriber { - start(): void; - stop(): void; + start(): void; + stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; + pause(dropWhilePaused?: boolean): void; + resume(): void; - // Subscribers which use polling should implement this to allow - // Providers the ability to update underlying polling intervals - // If not supported, accessing this property should return undefined - pollingInterval?: number; + // Subscribers which use polling should implement this to allow + // Providers the ability to update underlying polling intervals + // If not supported, accessing this property should return undefined + pollingInterval?: number; } export class UnmanagedSubscriber implements Subscriber { - name!: string; + name!: string; - constructor(name: string) { - defineProperties(this, { name }); - } + constructor(name: string) { + defineProperties(this, { name }); + } - start(): void {} - stop(): void {} + start(): void {} + stop(): void {} - pause(dropWhilePaused?: boolean): void {} - resume(): void {} + pause(dropWhilePaused?: boolean): void {} + resume(): void {} } type Sub = { - tag: string; - nameMap: Map; - addressableMap: WeakMap; - listeners: Array<{ listener: Listener; once: boolean }>; - // @TODO: get rid of this, as it is (and has to be) - // tracked in subscriber - started: boolean; - subscriber: Subscriber; + tag: string; + nameMap: Map; + addressableMap: WeakMap; + listeners: Array<{ listener: Listener; once: boolean }>; + // @TODO: get rid of this, as it is (and has to be) + // tracked in subscriber + started: boolean; + subscriber: Subscriber; }; function copy(value: T): T { - return JSON.parse(JSON.stringify(value)); + return JSON.parse(JSON.stringify(value)); } function concisify(items: Array): Array { - items = Array.from(new Set(items).values()); - items.sort(); - return items; + items = Array.from(new Set(items).values()); + items.sort(); + return items; } async function getSubscription( - _event: ProviderEvent, - provider: AbstractProvider, + _event: ProviderEvent, + provider: AbstractProvider, ): Promise { - if (_event == null) { - throw new Error("invalid event"); - } - - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - - if (typeof _event === "string") { - switch (_event) { - case "block": - case "pending": - case "debug": - case "error": - case "network": { - return { type: _event, tag: _event }; - } - } - } - - if (isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - - if ((_event).orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { - type: "orphan", - tag: getTag("orphan", event), - filter: copy(event), - }; - } - - if ((_event).address || (_event).topics) { - const event = _event; - - const filter: any = { - topics: (event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }), - }; - - if (event.address) { - const addresses: Array = []; - const promises: Array> = []; - - const addAddress = (addr: AddressLike) => { - if (isHexString(addr)) { - addresses.push(addr); - } else { - promises.push( - (async () => { - addresses.push(await resolveAddress(addr)); - })(), - ); - } - }; - - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - - return { filter, tag: getTag("event", filter), type: "event" }; - } - - assertArgument(false, "unknown ProviderEvent", "event", _event); + if (_event == null) { + throw new Error("invalid event"); + } + + // Normalize topic array info an EventFilter + if (Array.isArray(_event)) { + _event = { topics: _event }; + } + + if (typeof _event === "string") { + switch (_event) { + case "block": + case "pending": + case "debug": + case "error": + case "network": { + return { type: _event, tag: _event }; + } + } + } + + if (isHexString(_event, 32)) { + const hash = _event.toLowerCase(); + return { type: "transaction", tag: getTag("tx", { hash }), hash }; + } + + if ((_event).orphan) { + const event = _event; + // @TODO: Should lowercase and whatnot things here instead of copy... + return { + type: "orphan", + tag: getTag("orphan", event), + filter: copy(event), + }; + } + + if ((_event).address || (_event).topics) { + const event = _event; + + const filter: any = { + topics: (event.topics || []).map((t) => { + if (t == null) { + return null; + } + if (Array.isArray(t)) { + return concisify(t.map((t) => t.toLowerCase())); + } + return t.toLowerCase(); + }), + }; + + if (event.address) { + const addresses: Array = []; + const promises: Array> = []; + + const addAddress = (addr: AddressLike) => { + if (isHexString(addr)) { + addresses.push(addr); + } else { + promises.push( + (async () => { + addresses.push(await resolveAddress(addr)); + })(), + ); + } + }; + + if (Array.isArray(event.address)) { + event.address.forEach(addAddress); + } else { + addAddress(event.address); + } + if (promises.length) { + await Promise.all(promises); + } + filter.address = concisify(addresses.map((a) => a.toLowerCase())); + } + + return { filter, tag: getTag("event", filter), type: "event" }; + } + + assertArgument(false, "unknown ProviderEvent", "event", _event); } function getTime(): number { - return new Date().getTime(); + return new Date().getTime(); } export interface AbstractProviderPlugin { - readonly name: string; - connect(provider: AbstractProvider): AbstractProviderPlugin; + readonly name: string; + connect(provider: AbstractProvider): AbstractProviderPlugin; } export type PerformActionFilter = - | { - address?: string | Array; - topics?: Array>; - fromBlock?: BlockTag; - toBlock?: BlockTag; - } - | { - address?: string | Array; - topics?: Array>; - blockHash?: string; - }; + | { + address?: string | Array; + topics?: Array>; + fromBlock?: BlockTag; + toBlock?: BlockTag; + } + | { + address?: string | Array; + topics?: Array>; + blockHash?: string; + }; export interface PerformActionTransaction extends PreparedTransactionRequest { - to?: string; - from?: string; + to?: string; + from?: string; } export type PerformActionRequest = - | { - method: "broadcastTransaction"; - signedTransaction: string; - } - | { - method: "call"; - transaction: PerformActionTransaction; - blockTag: BlockTag; - } - | { - method: "networkId"; - } - | { - method: "estimateEnergy"; - transaction: PerformActionTransaction; - } - | { - method: "getBalance"; - address: string; - blockTag: BlockTag; - } - | { - method: "getBlock"; - blockTag: BlockTag; - includeTransactions: boolean; - } - | { - method: "getBlock"; - blockHash: string; - includeTransactions: boolean; - } - | { - method: "getBlockNumber"; - } - | { - method: "getCode"; - address: string; - blockTag: BlockTag; - } - | { - method: "getEnergyPrice"; - } - | { - method: "getLogs"; - filter: PerformActionFilter; - } - | { - method: "getStorage"; - address: string; - position: bigint; - blockTag: BlockTag; - } - | { - method: "getTransaction"; - hash: string; - } - | { - method: "getTransactionCount"; - address: string; - blockTag: BlockTag; - } - | { - method: "getTransactionReceipt"; - hash: string; - } - | { - method: "getTransactionResult"; - hash: string; - }; + | { + method: "broadcastTransaction"; + signedTransaction: string; + } + | { + method: "call"; + transaction: PerformActionTransaction; + blockTag: BlockTag; + } + | { + method: "networkId"; + } + | { + method: "estimateEnergy"; + transaction: PerformActionTransaction; + } + | { + method: "getBalance"; + address: string; + blockTag: BlockTag; + } + | { + method: "getBlock"; + blockTag: BlockTag; + includeTransactions: boolean; + } + | { + method: "getBlock"; + blockHash: string; + includeTransactions: boolean; + } + | { + method: "getBlockNumber"; + } + | { + method: "getCode"; + address: string; + blockTag: BlockTag; + } + | { + method: "getEnergyPrice"; + } + | { + method: "getLogs"; + filter: PerformActionFilter; + } + | { + method: "getStorage"; + address: string; + position: bigint; + blockTag: BlockTag; + } + | { + method: "getTransaction"; + hash: string; + } + | { + method: "getTransactionCount"; + address: string; + blockTag: BlockTag; + } + | { + method: "getTransactionReceipt"; + hash: string; + } + | { + method: "getTransactionResult"; + hash: string; + }; type _PerformAccountRequest = - | { - method: "getBalance" | "getTransactionCount" | "getCode"; - } - | { - method: "getStorage"; - position: bigint; - }; + | { + method: "getBalance" | "getTransactionCount" | "getCode"; + } + | { + method: "getStorage"; + position: bigint; + }; type CcipArgs = { - sender: string; - urls: Array; - calldata: string; - selector: string; - extraData: string; - errorArgs: Array; + sender: string; + urls: Array; + calldata: string; + selector: string; + extraData: string; + errorArgs: Array; }; export class AbstractProvider implements Provider { - #subs: Map; - #plugins: Map; - - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState: null | boolean; - - #networkPromise: null | Promise; - readonly #anyNetwork: boolean; - - #performCache: Map>; - - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber: number; - - #nextTimer: number; - #timers: Map void; time: number }>; - - #disableCcipRead: boolean; - - // @TODO: This should be a () => Promise so network can be - // done when needed; or rely entirely on _detectNetwork? - constructor(_network?: "any" | Networkish) { - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } else if (_network) { - const network = Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { - this.emit("network", network, null); - }, 0); - } else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - - this.#lastBlockNumber = -1; - - this.#performCache = new Map(); - - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - - this.#nextTimer = 1; - this.#timers = new Map(); - - this.#disableCcipRead = false; - } - - get provider(): this { - return this; - } - - get plugins(): Array { - return Array.from(this.#plugins.values()); - } - - attachPlugin(plugin: AbstractProviderPlugin): this { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - - getPlugin( - name: string, - ): null | T { - return this.#plugins.get(name) || null; - } - - get disableCcipRead(): boolean { - return this.#disableCcipRead; - } - set disableCcipRead(value: boolean) { - this.#disableCcipRead = !!value; - } - - // Shares multiple identical requests made during the same 250ms - async #perform(req: PerformActionRequest): Promise { - // Create a tag - const tag = getTag(req.method, req); - - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, 250); - } - - return await perform; - } - - async ccipReadFetch( - tx: PerformActionTransaction, - calldata: string, - urls: Array, - ): Promise { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - - const errorMessages: Array = []; - - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - - this.emit("debug", { - action: "sendCcipReadFetchRequest", - request, - index: i, - urls, - }); - - let errorMessage = "unknown error"; - - const resp = await request.send(); - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { - action: "receiveCcipReadFetchResult", - request, - result, - }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { - action: "receiveCcipReadFetchError", - request, - result, - }); - } catch (error) {} - - // 4xx indicates the result is not present; stop - 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 }, - }, - ); - - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - - assert( - false, - `error encountered during CCIP fetch: ${errorMessages - .map((m) => JSON.stringify(m)) - .join(", ")}`, - "OFFCHAIN_FAULT", - { - reason: "500_SERVER_ERROR", - transaction: tx, - info: { urls, errorMessages }, - }, - ); - } - - _wrapBlock(value: BlockParams, network: Network): Block { - return new Block(formatBlock(value), this); - } - - _wrapLog(value: LogParams, network: Network): Log { - return new Log(formatLog(value), this); - } - - _wrapTransactionReceipt( - value: TransactionReceiptParams, - network: Network, - ): TransactionReceipt { - return new TransactionReceipt(formatTransactionReceipt(value), this); - } - - _wrapTransactionResponse( - tx: TransactionResponseParams, - network: Network, - ): TransactionResponse { - return new TransactionResponse(formatTransactionResponse(tx), this); - } - - _detectNetwork(): Promise { - assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork", - }); - } - - // Sub-classes should override this and handle PerformActionRequest requests, calling - // the super for any unhandled actions. - async _perform(req: PerformActionRequest): Promise { - assert( - false, - `unsupported method: ${req.method}`, - "UNSUPPORTED_OPERATION", - { - operation: req.method, - info: req, - }, - ); - } - - // State - async getBlockNumber(): Promise { - const blockNumber = getNumber( - await this.#perform({ method: "getBlockNumber" }), - "%response", - ); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - - _getAddress(address: AddressLike): string | Promise { - return resolveAddress(address); - } - - _getBlockTag(blockTag?: BlockTag): string | Promise { - if (blockTag == null) { - return "latest"; - } - - switch (blockTag) { - case "earliest": - return "0x0"; - case "latest": - case "pending": - case "safe": - case "finalized": - return blockTag; - } - - if (isHexString(blockTag)) { - if (isHexString(blockTag, 32)) { - return blockTag; - } - return toQuantity(blockTag); - } - - if (typeof blockTag === "bigint") { - blockTag = getNumber(blockTag, "blockTag"); - } - - if (typeof blockTag === "number") { - if (blockTag >= 0) { - return toQuantity(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return toQuantity(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => - toQuantity(b + blockTag), - ); - } - - assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - - _getFilter( - filter: Filter | FilterByBlockHash, - ): PerformActionFilter | Promise { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - - const blockHash = "blockHash" in filter ? filter.blockHash : undefined; - - const resolve = ( - _address: Array, - fromBlock?: string, - toBlock?: string, - ) => { - let address: undefined | string | Array = undefined; - switch (_address.length) { - case 0: - break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - - return filter; - }; - - // Addresses could be async (ENS names or Addressables) - let address: Array> = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } else { - address.push(this._getAddress(filter.address)); - } - } - - let fromBlock: undefined | string | Promise = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - - let toBlock: undefined | string | Promise = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - - if ( - address.filter((a) => typeof a !== "string").length || - (fromBlock != null && typeof fromBlock !== "string") || - (toBlock != null && typeof toBlock !== "string") - ) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then( - (result) => { - return resolve(result[0], result[1], result[2]); - }, - ); - } - - return resolve(>address, fromBlock, toBlock); - } - - _getTransactionRequest( - _request: TransactionRequest, - ): PerformActionTransaction | Promise { - const request = copyRequest(_request); - - const promises: Array> = []; - ["to", "from"].forEach((key) => { - if ((request)[key] == null) { - return; - } - - const addr = resolveAddress((request)[key]); - if (isPromise(addr)) { - promises.push( - (async function () { - (request)[key] = await addr; - })(), - ); - } else { - (request)[key] = addr; - } - }); - - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise(blockTag)) { - promises.push( - (async function () { - request.blockTag = await blockTag; - })(), - ); - } else { - request.blockTag = blockTag; - } - } - - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - - return request; - } - - async getNetwork(): Promise { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = this._detectNetwork().then( - (network) => { - this.emit("network", network, null); - return network; - }, - (error) => { - // Reset the networkPromise on failure, so we will try again - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - }, - ); - - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - - const networkPromise = this.#networkPromise; - - const [expected, actual] = await Promise.all([ - networkPromise, // Possibly an explicit Network - this._detectNetwork(), // The actual connected network - ]); - - if (expected.networkId !== actual.networkId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } else { - // Otherwise, we do not allow changes to the underlying network - assert( - false, - `network changed: ${expected.networkId} => ${actual.networkId} `, - "NETWORK_ERROR", - { - event: "changed", - }, - ); - } - } - - return expected.clone(); - } - async getEnergyPrice(): Promise { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } catch (error) {} - return null; - })(), - }); - return new FeeData(energyPrice); - } - - async getFeeData(): Promise { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } catch (error) {} - return null; - })(), - }); - return new FeeData(energyPrice); - } - - async estimateEnergy(_tx: TransactionRequest): Promise { - let tx = this._getTransactionRequest(_tx); - if (isPromise(tx)) { - tx = await tx; - } - return getBigInt( - await this.#perform({ - method: "estimateEnergy", - transaction: tx, - }), - "%response", - ); - } - - async #call( - tx: PerformActionTransaction, - blockTag: string, - attempt: number, - ): Promise { - assert( - attempt < MAX_CCIP_REDIRECTS, - "CCIP read exceeded maximum redirections", - "OFFCHAIN_FAULT", - { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }), - }, - ); - - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = copyRequest(tx); - - try { - return hexlify( - await this._perform({ method: "call", transaction, blockTag }), - ); - } catch (error) { - // CCIP Read OffchainLookup - if ( - !this.disableCcipRead && - isCallException(error) && - error.data && - attempt >= 0 && - blockTag === "latest" && - transaction.to != null && - dataSlice(error.data, 0, 4) === "0x556f1830" - ) { - const data = error.data; - - const txSender = await resolveAddress(transaction.to); - - // Parse the CCIP Read Arguments - let ccipArgs: CcipArgs; - try { - ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); - } catch (error: any) { - assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", - transaction, - info: { data }, - }); - } - - // Check the sender of the OffchainLookup matches the transaction - assert( - ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), - "CCIP Read sender mismatch", - "CALL_EXCEPTION", - { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, // @TODO: populate data? - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs, - }, - }, - ); - - const ccipResult = await this.ccipReadFetch( - transaction, - ccipArgs.calldata, - ccipArgs.urls, - ); - assert( - ccipResult != null, - "CCIP Read failed to fetch data", - "OFFCHAIN_FAULT", - { - reason: "FETCH_FAILED", - transaction, - info: { data: error.data, errorArgs: ccipArgs.errorArgs }, - }, - ); - - const tx = { - to: txSender, - data: concat([ - ccipArgs.selector, - encodeBytes([ccipResult, ccipArgs.extraData]), - ]) as string, - }; - - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { - action: "receiveCcipReadCallResult", - transaction: Object.assign({}, tx), - result, - }); - return result; - } catch (error) { - this.emit("debug", { - action: "receiveCcipReadCallError", - transaction: Object.assign({}, tx), - error, - }); - throw error; - } - } - - throw error; - } - } - - async #checkNetwork(promise: Promise): Promise { - const { value } = await resolveProperties({ - network: this.getNetwork(), - value: promise, - }); - return value; - } - - async call(_tx: TransactionRequest): Promise { - const { tx, blockTag } = await resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag), - }); - return await this.#checkNetwork( - this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1), - ); - } - - // Account - async #getAccountValue( - request: _PerformAccountRequest, - _address: AddressLike, - _blockTag?: BlockTag, - ): Promise { - let address: string | Promise = this._getAddress(_address); - let blockTag: string | Promise = this._getBlockTag(_blockTag); - if (typeof address !== "string" || typeof blockTag !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - - return await this.#checkNetwork( - this.#perform(Object.assign(request, { address, blockTag })), - ); - } - - async getBalance(address: AddressLike, blockTag?: BlockTag): Promise { - return getBigInt( - await this.#getAccountValue({ method: "getBalance" }, address, blockTag), - "%response", - ); - } - - async getTransactionCount( - address: AddressLike, - blockTag?: BlockTag, - ): Promise { - return getNumber( - await this.#getAccountValue( - { method: "getTransactionCount" }, - address, - blockTag, - ), - "%response", - ); - } - - async getCode(address: AddressLike, blockTag?: BlockTag): Promise { - return hexlify( - await this.#getAccountValue({ method: "getCode" }, address, blockTag), - ); - } - - async getStorage( - address: AddressLike, - _position: BigNumberish, - blockTag?: BlockTag, - ): Promise { - const position = getBigInt(_position, "position"); - return hexlify( - await this.#getAccountValue( - { method: "getStorage", position }, - address, - blockTag, - ), - ); - } - - // Write - async broadcastTransaction(signedTx: string): Promise { - const { blockNumber, hash, network } = await resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx, - }), - network: this.getNetwork(), - }); - - const tx = Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - - return this._wrapTransactionResponse( - tx, - network, - ).replaceableTransaction(blockNumber); - } - - async #getBlock( - block: BlockTag | string, - includeTransactions: boolean, - ): Promise { - // @TODO: Add CustomBlockPlugin check - - if (isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", - blockHash: block, - includeTransactions, - }); - } - - let blockTag = this._getBlockTag(block); - if (typeof blockTag !== "string") { - blockTag = await blockTag; - } - - return await this.#perform({ - method: "getBlock", - blockTag, - includeTransactions, - }); - } - - // Queries - async getBlock( - block: BlockTag | string, - prefetchTxs?: boolean, - ): Promise { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs), - }); - if (params == null) { - return null; - } - - return this._wrapBlock(params, network); - } - - async getTransaction(hash: string): Promise { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }), - }); - if (params == null) { - return null; - } - - return this._wrapTransactionResponse(params, network); - } - - async getTransactionReceipt( - hash: string, - ): Promise { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }), - }); - if (params == null) { - return null; - } - - // Some backends did not backfill the effectiveEnergyPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.energyPrice == null && params.effectiveEnergyPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error( - "report this; could not find tx or effectiveEnergyPrice", - ); - } - params.effectiveEnergyPrice = tx.energyPrice; - } - - return this._wrapTransactionReceipt(params, network); - } - - async getTransactionResult(hash: string): Promise { - const { result } = await resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }), - }); - if (result == null) { - return null; - } - return hexlify(result); - } - - // Bloom-filter Queries - async getLogs(_filter: Filter | FilterByBlockHash): Promise> { - let filter = this._getFilter(_filter); - if (isPromise(filter)) { - filter = await filter; - } - - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform>({ method: "getLogs", filter }), - }); - - return params.map((p) => this._wrapLog(p, network)); - } - - // ENS - _getProvider(networkId: number): AbstractProvider { - assert( - false, - "provider cannot connect to target network", - "UNSUPPORTED_OPERATION", - { - operation: "_getProvider()", - }, - ); - } - - async waitForTransaction( - hash: string, - _confirms?: null | number, - timeout?: null | number, - ): Promise { - const confirms = _confirms != null ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - - return new Promise(async (resolve, reject) => { - let timer: null | Timer = null; - - const listener = async (blockNumber: number) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }; - - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - - listener(await this.getBlockNumber()); - }); - } - - async waitForBlock(blockTag?: BlockTag): Promise { - assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock", - }); - } - - _clearTimeout(timerId: number): void { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - - _setTimeout(_func: () => void, timeout?: number): number { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime() }); - } - - return timerId; - } - - _forEachSubscriber(func: (s: Subscriber) => void): void { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - - // Event API; sub-classes should override this; any supported - // event filter will have been munged into an EventFilter - _getSubscriber(sub: Subscription): Subscriber { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": - return new PollingBlockSubscriber(this); - case "event": - return new PollingEventSubscriber(this, sub.filter); - case "transaction": - return new PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new PollingOrphanSubscriber(this, sub.filter); - } - - throw new Error(`unsupported event: ${sub.type}`); - } - - _recoverSubscriber(oldSub: Subscriber, newSub: Subscriber): void { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - - async #hasSub( - event: ProviderEvent, - emitArgs?: Array, - ): Promise { - let sub = await getSubscription(event, this); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if ( - sub.type === "event" && - emitArgs && - emitArgs.length > 0 && - emitArgs[0].removed === true - ) { - sub = await getSubscription( - { orphan: "drop-log", log: emitArgs[0] }, - this, - ); - } - return this.#subs.get(sub.tag) || null; - } - - async #getSub(event: ProviderEvent): Promise { - const subscription = await getSubscription(event, this); - - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { - subscriber, - tag, - addressableMap, - nameMap, - started: false, - listeners: [], - }; - this.#subs.set(tag, sub); - } - - return sub; - } - - async on(event: ProviderEvent, listener: Listener): Promise { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - - async once(event: ProviderEvent, listener: Listener): Promise { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - - async emit(event: ProviderEvent, ...args: Array): Promise { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new EventPayload(this, once ? null : listener, event); - try { - listener.call(this, ...args, payload); - } catch (error) {} - return !once; - }); - - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - - return count > 0; - } - - async listenerCount(event?: ProviderEvent): Promise { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - - async listeners(event?: ProviderEvent): Promise> { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result: Array = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - - async off(event: ProviderEvent, listener?: Listener): Promise { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - - return this; - } - - async removeAllListeners(event?: ProviderEvent): Promise { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - - // Alias for "on" - async addListener(event: ProviderEvent, listener: Listener): Promise { - return await this.on(event, listener); - } - - // Alias for "off" - async removeListener( - event: ProviderEvent, - listener: Listener, - ): Promise { - return this.off(event, listener); - } - - // Sub-classes should override this to shutdown any sockets, etc. - // but MUST call this super.shutdown. - destroy(): void { - // Stop all listeners - this.removeAllListeners(); - - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - } - - get paused(): boolean { - return this.#pausedState != null; - } - set paused(pause: boolean) { - if (!!pause === this.paused) { - return; - } - - if (this.paused) { - this.resume(); - } else { - this.pause(false); - } - } - - pause(dropWhilePaused?: boolean): void { - this.#lastBlockNumber = -1; - - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - assert( - false, - "cannot change pause type; resume first", - "UNSUPPORTED_OPERATION", - { - operation: "pause", - }, - ); - } - - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - - // Remaining time needed for when we become unpaused - timer.time = getTime() - timer.time; - } - } - - resume(): void { - if (this.#pausedState == null) { - return; - } - - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime(); - - // Start the timer - setTimeout(timer.func, timeout); - } - } + #subs: Map; + #plugins: Map; + + // null=unpaused, true=paused+dropWhilePaused, false=paused + #pausedState: null | boolean; + + #networkPromise: null | Promise; + readonly #anyNetwork: boolean; + + #performCache: Map>; + + // The most recent block number if running an event or -1 if no "block" event + #lastBlockNumber: number; + + #nextTimer: number; + #timers: Map void; time: number }>; + + #disableCcipRead: boolean; + + // @TODO: This should be a () => Promise so network can be + // done when needed; or rely entirely on _detectNetwork? + constructor(_network?: "any" | Networkish) { + if (_network === "any") { + this.#anyNetwork = true; + this.#networkPromise = null; + } else if (_network) { + const network = Network.from(_network); + this.#anyNetwork = false; + this.#networkPromise = Promise.resolve(network); + setTimeout(() => { + this.emit("network", network, null); + }, 0); + } else { + this.#anyNetwork = false; + this.#networkPromise = null; + } + + this.#lastBlockNumber = -1; + + this.#performCache = new Map(); + + this.#subs = new Map(); + this.#plugins = new Map(); + this.#pausedState = null; + + this.#nextTimer = 1; + this.#timers = new Map(); + + this.#disableCcipRead = false; + } + + get provider(): this { + return this; + } + + get plugins(): Array { + return Array.from(this.#plugins.values()); + } + + attachPlugin(plugin: AbstractProviderPlugin): this { + if (this.#plugins.get(plugin.name)) { + throw new Error(`cannot replace existing plugin: ${plugin.name} `); + } + this.#plugins.set(plugin.name, plugin.connect(this)); + return this; + } + + getPlugin( + name: string, + ): null | T { + return this.#plugins.get(name) || null; + } + + get disableCcipRead(): boolean { + return this.#disableCcipRead; + } + set disableCcipRead(value: boolean) { + this.#disableCcipRead = !!value; + } + + // Shares multiple identical requests made during the same 250ms + async #perform(req: PerformActionRequest): Promise { + // Create a tag + const tag = getTag(req.method, req); + + let perform = this.#performCache.get(tag); + if (!perform) { + perform = this._perform(req); + this.#performCache.set(tag, perform); + + setTimeout(() => { + if (this.#performCache.get(tag) === perform) { + this.#performCache.delete(tag); + } + }, 250); + } + + return await perform; + } + + async ccipReadFetch( + tx: PerformActionTransaction, + calldata: string, + urls: Array, + ): Promise { + if (this.disableCcipRead || urls.length === 0 || tx.to == null) { + return null; + } + + const sender = tx.to.toLowerCase(); + const data = calldata.toLowerCase(); + + const errorMessages: Array = []; + + for (let i = 0; i < urls.length; i++) { + const url = urls[i]; + + // URL expansion + const href = url.replace("{sender}", sender).replace("{data}", data); + + // If no {data} is present, use POST; otherwise GET + //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); + + //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { + // value.status = response.statusCode; + // return value; + //}); + const request = new FetchRequest(href); + if (url.indexOf("{data}") === -1) { + request.body = { data, sender }; + } + + this.emit("debug", { + action: "sendCcipReadFetchRequest", + request, + index: i, + urls, + }); + + let errorMessage = "unknown error"; + + const resp = await request.send(); + try { + const result = resp.bodyJson; + if (result.data) { + this.emit("debug", { + action: "receiveCcipReadFetchResult", + request, + result, + }); + return result.data; + } + if (result.message) { + errorMessage = result.message; + } + this.emit("debug", { + action: "receiveCcipReadFetchError", + request, + result, + }); + } catch (error) {} + + // 4xx indicates the result is not present; stop + 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 }, + }, + ); + + // 5xx indicates server issue; try the next url + errorMessages.push(errorMessage); + } + + assert( + false, + `error encountered during CCIP fetch: ${errorMessages + .map((m) => JSON.stringify(m)) + .join(", ")}`, + "OFFCHAIN_FAULT", + { + reason: "500_SERVER_ERROR", + transaction: tx, + info: { urls, errorMessages }, + }, + ); + } + + _wrapBlock(value: BlockParams, network: Network): Block { + return new Block(formatBlock(value), this); + } + + _wrapLog(value: LogParams, network: Network): Log { + return new Log(formatLog(value), this); + } + + _wrapTransactionReceipt( + value: TransactionReceiptParams, + network: Network, + ): TransactionReceipt { + return new TransactionReceipt(formatTransactionReceipt(value), this); + } + + _wrapTransactionResponse( + tx: TransactionResponseParams, + network: Network, + ): TransactionResponse { + return new TransactionResponse(formatTransactionResponse(tx), this); + } + + _detectNetwork(): Promise { + assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { + operation: "_detectNetwork", + }); + } + + // Sub-classes should override this and handle PerformActionRequest requests, calling + // the super for any unhandled actions. + async _perform(req: PerformActionRequest): Promise { + assert( + false, + `unsupported method: ${req.method}`, + "UNSUPPORTED_OPERATION", + { + operation: req.method, + info: req, + }, + ); + } + + // State + async getBlockNumber(): Promise { + const blockNumber = getNumber( + await this.#perform({ method: "getBlockNumber" }), + "%response", + ); + if (this.#lastBlockNumber >= 0) { + this.#lastBlockNumber = blockNumber; + } + return blockNumber; + } + + _getAddress(address: AddressLike): string | Promise { + return resolveAddress(address); + } + + _getBlockTag(blockTag?: BlockTag): string | Promise { + if (blockTag == null) { + return "latest"; + } + + switch (blockTag) { + case "earliest": + return "0x0"; + case "latest": + case "pending": + case "safe": + case "finalized": + return blockTag; + } + + if (isHexString(blockTag)) { + if (isHexString(blockTag, 32)) { + return blockTag; + } + return toQuantity(blockTag); + } + + if (typeof blockTag === "bigint") { + blockTag = getNumber(blockTag, "blockTag"); + } + + if (typeof blockTag === "number") { + if (blockTag >= 0) { + return toQuantity(blockTag); + } + if (this.#lastBlockNumber >= 0) { + return toQuantity(this.#lastBlockNumber + blockTag); + } + return this.getBlockNumber().then((b) => + toQuantity(b + blockTag), + ); + } + + assertArgument(false, "invalid blockTag", "blockTag", blockTag); + } + + _getFilter( + filter: Filter | FilterByBlockHash, + ): PerformActionFilter | Promise { + // Create a canonical representation of the topics + const topics = (filter.topics || []).map((t) => { + if (t == null) { + return null; + } + if (Array.isArray(t)) { + return concisify(t.map((t) => t.toLowerCase())); + } + return t.toLowerCase(); + }); + + const blockHash = "blockHash" in filter ? filter.blockHash : undefined; + + const resolve = ( + _address: Array, + fromBlock?: string, + toBlock?: string, + ) => { + let address: undefined | string | Array = undefined; + switch (_address.length) { + case 0: + break; + case 1: + address = _address[0]; + break; + default: + _address.sort(); + address = _address; + } + + if (blockHash) { + if (fromBlock != null || toBlock != null) { + throw new Error("invalid filter"); + } + } + + const filter = {}; + if (address) { + filter.address = address; + } + if (topics.length) { + filter.topics = topics; + } + if (fromBlock) { + filter.fromBlock = fromBlock; + } + if (toBlock) { + filter.toBlock = toBlock; + } + if (blockHash) { + filter.blockHash = blockHash; + } + + return filter; + }; + + // Addresses could be async (ENS names or Addressables) + let address: Array> = []; + if (filter.address) { + if (Array.isArray(filter.address)) { + for (const addr of filter.address) { + address.push(this._getAddress(addr)); + } + } else { + address.push(this._getAddress(filter.address)); + } + } + + let fromBlock: undefined | string | Promise = undefined; + if ("fromBlock" in filter) { + fromBlock = this._getBlockTag(filter.fromBlock); + } + + let toBlock: undefined | string | Promise = undefined; + if ("toBlock" in filter) { + toBlock = this._getBlockTag(filter.toBlock); + } + + if ( + address.filter((a) => typeof a !== "string").length || + (fromBlock != null && typeof fromBlock !== "string") || + (toBlock != null && typeof toBlock !== "string") + ) { + return Promise.all([Promise.all(address), fromBlock, toBlock]).then( + (result) => { + return resolve(result[0], result[1], result[2]); + }, + ); + } + + return resolve(>address, fromBlock, toBlock); + } + + _getTransactionRequest( + _request: TransactionRequest, + ): PerformActionTransaction | Promise { + const request = copyRequest(_request); + + const promises: Array> = []; + ["to", "from"].forEach((key) => { + if ((request)[key] == null) { + return; + } + + const addr = resolveAddress((request)[key]); + if (isPromise(addr)) { + promises.push( + (async function () { + (request)[key] = await addr; + })(), + ); + } else { + (request)[key] = addr; + } + }); + + if (request.blockTag != null) { + const blockTag = this._getBlockTag(request.blockTag); + if (isPromise(blockTag)) { + promises.push( + (async function () { + request.blockTag = await blockTag; + })(), + ); + } else { + request.blockTag = blockTag; + } + } + + if (promises.length) { + return (async function () { + await Promise.all(promises); + return request; + })(); + } + + return request; + } + + async getNetwork(): Promise { + // No explicit network was set and this is our first time + if (this.#networkPromise == null) { + // Detect the current network (shared with all calls) + const detectNetwork = this._detectNetwork().then( + (network) => { + this.emit("network", network, null); + return network; + }, + (error) => { + // Reset the networkPromise on failure, so we will try again + if (this.#networkPromise === detectNetwork) { + this.#networkPromise = null; + } + throw error; + }, + ); + + this.#networkPromise = detectNetwork; + return (await detectNetwork).clone(); + } + + const networkPromise = this.#networkPromise; + + const [expected, actual] = await Promise.all([ + networkPromise, // Possibly an explicit Network + this._detectNetwork(), // The actual connected network + ]); + + if (expected.networkId !== actual.networkId) { + if (this.#anyNetwork) { + // The "any" network can change, so notify listeners + this.emit("network", actual, expected); + + // Update the network if something else hasn't already changed it + if (this.#networkPromise === networkPromise) { + this.#networkPromise = Promise.resolve(actual); + } + } else { + // Otherwise, we do not allow changes to the underlying network + assert( + false, + `network changed: ${expected.networkId} => ${actual.networkId} `, + "NETWORK_ERROR", + { + event: "changed", + }, + ); + } + } + + return expected.clone(); + } + async getEnergyPrice(): Promise { + const { energyPrice } = await resolveProperties({ + block: this.getBlock("latest"), + energyPrice: (async () => { + try { + const energyPrice = await this.#perform({ method: "getEnergyPrice" }); + return getBigInt(energyPrice, "%response"); + } catch (error) {} + return null; + })(), + }); + return new FeeData(energyPrice); + } + + async getFeeData(): Promise { + const { energyPrice } = await resolveProperties({ + block: this.getBlock("latest"), + energyPrice: (async () => { + try { + const energyPrice = await this.#perform({ method: "getEnergyPrice" }); + return getBigInt(energyPrice, "%response"); + } catch (error) {} + return null; + })(), + }); + return new FeeData(energyPrice); + } + + async estimateEnergy(_tx: TransactionRequest): Promise { + let tx = this._getTransactionRequest(_tx); + if (isPromise(tx)) { + tx = await tx; + } + return getBigInt( + await this.#perform({ + method: "estimateEnergy", + transaction: tx, + }), + "%response", + ); + } + + async #call( + tx: PerformActionTransaction, + blockTag: string, + attempt: number, + ): Promise { + assert( + attempt < MAX_CCIP_REDIRECTS, + "CCIP read exceeded maximum redirections", + "OFFCHAIN_FAULT", + { + reason: "TOO_MANY_REDIRECTS", + transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }), + }, + ); + + // This came in as a PerformActionTransaction, so to/from are safe; we can cast + const transaction = copyRequest(tx); + + try { + return hexlify( + await this._perform({ method: "call", transaction, blockTag }), + ); + } catch (error) { + // CCIP Read OffchainLookup + if ( + !this.disableCcipRead && + isCallException(error) && + error.data && + attempt >= 0 && + blockTag === "latest" && + transaction.to != null && + dataSlice(error.data, 0, 4) === "0x556f1830" + ) { + const data = error.data; + + const txSender = await resolveAddress(transaction.to); + + // Parse the CCIP Read Arguments + let ccipArgs: CcipArgs; + try { + ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); + } catch (error: any) { + assert(false, error.message, "OFFCHAIN_FAULT", { + reason: "BAD_DATA", + transaction, + info: { data }, + }); + } + + // Check the sender of the OffchainLookup matches the transaction + assert( + ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), + "CCIP Read sender mismatch", + "CALL_EXCEPTION", + { + action: "call", + data, + reason: "OffchainLookup", + transaction: transaction, // @TODO: populate data? + invocation: null, + revert: { + signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", + name: "OffchainLookup", + args: ccipArgs.errorArgs, + }, + }, + ); + + const ccipResult = await this.ccipReadFetch( + transaction, + ccipArgs.calldata, + ccipArgs.urls, + ); + assert( + ccipResult != null, + "CCIP Read failed to fetch data", + "OFFCHAIN_FAULT", + { + reason: "FETCH_FAILED", + transaction, + info: { data: error.data, errorArgs: ccipArgs.errorArgs }, + }, + ); + + const tx = { + to: txSender, + data: concat([ + ccipArgs.selector, + encodeBytes([ccipResult, ccipArgs.extraData]), + ]) as string, + }; + + this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); + try { + const result = await this.#call(tx, blockTag, attempt + 1); + this.emit("debug", { + action: "receiveCcipReadCallResult", + transaction: Object.assign({}, tx), + result, + }); + return result; + } catch (error) { + this.emit("debug", { + action: "receiveCcipReadCallError", + transaction: Object.assign({}, tx), + error, + }); + throw error; + } + } + + throw error; + } + } + + async #checkNetwork(promise: Promise): Promise { + const { value } = await resolveProperties({ + network: this.getNetwork(), + value: promise, + }); + return value; + } + + async call(_tx: TransactionRequest): Promise { + const { tx, blockTag } = await resolveProperties({ + tx: this._getTransactionRequest(_tx), + blockTag: this._getBlockTag(_tx.blockTag), + }); + return await this.#checkNetwork( + this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1), + ); + } + + // Account + async #getAccountValue( + request: _PerformAccountRequest, + _address: AddressLike, + _blockTag?: BlockTag, + ): Promise { + let address: string | Promise = this._getAddress(_address); + let blockTag: string | Promise = this._getBlockTag(_blockTag); + if (typeof address !== "string" || typeof blockTag !== "string") { + [address, blockTag] = await Promise.all([address, blockTag]); + } + + return await this.#checkNetwork( + this.#perform(Object.assign(request, { address, blockTag })), + ); + } + + async getBalance(address: AddressLike, blockTag?: BlockTag): Promise { + return getBigInt( + await this.#getAccountValue({ method: "getBalance" }, address, blockTag), + "%response", + ); + } + + async getTransactionCount( + address: AddressLike, + blockTag?: BlockTag, + ): Promise { + return getNumber( + await this.#getAccountValue( + { method: "getTransactionCount" }, + address, + blockTag, + ), + "%response", + ); + } + + async getCode(address: AddressLike, blockTag?: BlockTag): Promise { + return hexlify( + await this.#getAccountValue({ method: "getCode" }, address, blockTag), + ); + } + + async getStorage( + address: AddressLike, + _position: BigNumberish, + blockTag?: BlockTag, + ): Promise { + const position = getBigInt(_position, "position"); + return hexlify( + await this.#getAccountValue( + { method: "getStorage", position }, + address, + blockTag, + ), + ); + } + + // Write + async broadcastTransaction(signedTx: string): Promise { + const { blockNumber, hash, network } = await resolveProperties({ + blockNumber: this.getBlockNumber(), + hash: this._perform({ + method: "broadcastTransaction", + signedTransaction: signedTx, + }), + network: this.getNetwork(), + }); + + const tx = Transaction.from(signedTx); + if (tx.hash !== hash) { + throw new Error("@TODO: the returned hash did not match"); + } + + return this._wrapTransactionResponse( + tx, + network, + ).replaceableTransaction(blockNumber); + } + + async #getBlock( + block: BlockTag | string, + includeTransactions: boolean, + ): Promise { + // @TODO: Add CustomBlockPlugin check + + if (isHexString(block, 32)) { + return await this.#perform({ + method: "getBlock", + blockHash: block, + includeTransactions, + }); + } + + let blockTag = this._getBlockTag(block); + if (typeof blockTag !== "string") { + blockTag = await blockTag; + } + + return await this.#perform({ + method: "getBlock", + blockTag, + includeTransactions, + }); + } + + // Queries + async getBlock( + block: BlockTag | string, + prefetchTxs?: boolean, + ): Promise { + const { network, params } = await resolveProperties({ + network: this.getNetwork(), + params: this.#getBlock(block, !!prefetchTxs), + }); + if (params == null) { + return null; + } + + return this._wrapBlock(params, network); + } + + async getTransaction(hash: string): Promise { + const { network, params } = await resolveProperties({ + network: this.getNetwork(), + params: this.#perform({ method: "getTransaction", hash }), + }); + if (params == null) { + return null; + } + + return this._wrapTransactionResponse(params, network); + } + + async getTransactionReceipt( + hash: string, + ): Promise { + const { network, params } = await resolveProperties({ + network: this.getNetwork(), + params: this.#perform({ method: "getTransactionReceipt", hash }), + }); + if (params == null) { + return null; + } + + // Some backends did not backfill the effectiveEnergyPrice into old transactions + // in the receipt, so we look it up manually and inject it. + if (params.energyPrice == null && params.effectiveEnergyPrice == null) { + const tx = await this.#perform({ method: "getTransaction", hash }); + if (tx == null) { + throw new Error( + "report this; could not find tx or effectiveEnergyPrice", + ); + } + params.effectiveEnergyPrice = tx.energyPrice; + } + + return this._wrapTransactionReceipt(params, network); + } + + async getTransactionResult(hash: string): Promise { + const { result } = await resolveProperties({ + network: this.getNetwork(), + result: this.#perform({ method: "getTransactionResult", hash }), + }); + if (result == null) { + return null; + } + return hexlify(result); + } + + // Bloom-filter Queries + async getLogs(_filter: Filter | FilterByBlockHash): Promise> { + let filter = this._getFilter(_filter); + if (isPromise(filter)) { + filter = await filter; + } + + const { network, params } = await resolveProperties({ + network: this.getNetwork(), + params: this.#perform>({ method: "getLogs", filter }), + }); + + return params.map((p) => this._wrapLog(p, network)); + } + + // ENS + _getProvider(networkId: number): AbstractProvider { + assert( + false, + "provider cannot connect to target network", + "UNSUPPORTED_OPERATION", + { + operation: "_getProvider()", + }, + ); + } + + async waitForTransaction( + hash: string, + _confirms?: null | number, + timeout?: null | number, + ): Promise { + const confirms = _confirms != null ? _confirms : 1; + if (confirms === 0) { + return this.getTransactionReceipt(hash); + } + + return new Promise(async (resolve, reject) => { + let timer: null | Timer = null; + + const listener = async (blockNumber: number) => { + try { + const receipt = await this.getTransactionReceipt(hash); + if (receipt != null) { + if (blockNumber - receipt.blockNumber + 1 >= confirms) { + resolve(receipt); + //this.off("block", listener); + if (timer) { + clearTimeout(timer); + timer = null; + } + return; + } + } + } catch (error) { + console.log("EEE", error); + } + this.once("block", listener); + }; + + if (timeout != null) { + timer = setTimeout(() => { + if (timer == null) { + return; + } + timer = null; + this.off("block", listener); + reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); + }, timeout); + } + + listener(await this.getBlockNumber()); + }); + } + + async waitForBlock(blockTag?: BlockTag): Promise { + assert(false, "not implemented yet", "NOT_IMPLEMENTED", { + operation: "waitForBlock", + }); + } + + _clearTimeout(timerId: number): void { + const timer = this.#timers.get(timerId); + if (!timer) { + return; + } + if (timer.timer) { + clearTimeout(timer.timer); + } + this.#timers.delete(timerId); + } + + _setTimeout(_func: () => void, timeout?: number): number { + if (timeout == null) { + timeout = 0; + } + const timerId = this.#nextTimer++; + const func = () => { + this.#timers.delete(timerId); + _func(); + }; + + if (this.paused) { + this.#timers.set(timerId, { timer: null, func, time: timeout }); + } else { + const timer = setTimeout(func, timeout); + this.#timers.set(timerId, { timer, func, time: getTime() }); + } + + return timerId; + } + + _forEachSubscriber(func: (s: Subscriber) => void): void { + for (const sub of this.#subs.values()) { + func(sub.subscriber); + } + } + + // Event API; sub-classes should override this; any supported + // event filter will have been munged into an EventFilter + _getSubscriber(sub: Subscription): Subscriber { + switch (sub.type) { + case "debug": + case "error": + case "network": + return new UnmanagedSubscriber(sub.type); + case "block": + return new PollingBlockSubscriber(this); + case "event": + return new PollingEventSubscriber(this, sub.filter); + case "transaction": + return new PollingTransactionSubscriber(this, sub.hash); + case "orphan": + return new PollingOrphanSubscriber(this, sub.filter); + } + + throw new Error(`unsupported event: ${sub.type}`); + } + + _recoverSubscriber(oldSub: Subscriber, newSub: Subscriber): void { + for (const sub of this.#subs.values()) { + if (sub.subscriber === oldSub) { + if (sub.started) { + sub.subscriber.stop(); + } + sub.subscriber = newSub; + if (sub.started) { + newSub.start(); + } + if (this.#pausedState != null) { + newSub.pause(this.#pausedState); + } + break; + } + } + } + + async #hasSub( + event: ProviderEvent, + emitArgs?: Array, + ): Promise { + let sub = await getSubscription(event, this); + // This is a log that is removing an existing log; we actually want + // to emit an orphan event for the removed log + if ( + sub.type === "event" && + emitArgs && + emitArgs.length > 0 && + emitArgs[0].removed === true + ) { + sub = await getSubscription( + { orphan: "drop-log", log: emitArgs[0] }, + this, + ); + } + return this.#subs.get(sub.tag) || null; + } + + async #getSub(event: ProviderEvent): Promise { + const subscription = await getSubscription(event, this); + + // Prevent tampering with our tag in any subclass' _getSubscriber + const tag = subscription.tag; + + let sub = this.#subs.get(tag); + if (!sub) { + const subscriber = this._getSubscriber(subscription); + + const addressableMap = new WeakMap(); + const nameMap = new Map(); + sub = { + subscriber, + tag, + addressableMap, + nameMap, + started: false, + listeners: [], + }; + this.#subs.set(tag, sub); + } + + return sub; + } + + async on(event: ProviderEvent, listener: Listener): Promise { + const sub = await this.#getSub(event); + sub.listeners.push({ listener, once: false }); + if (!sub.started) { + sub.subscriber.start(); + sub.started = true; + if (this.#pausedState != null) { + sub.subscriber.pause(this.#pausedState); + } + } + return this; + } + + async once(event: ProviderEvent, listener: Listener): Promise { + const sub = await this.#getSub(event); + sub.listeners.push({ listener, once: true }); + if (!sub.started) { + sub.subscriber.start(); + sub.started = true; + if (this.#pausedState != null) { + sub.subscriber.pause(this.#pausedState); + } + } + return this; + } + + async emit(event: ProviderEvent, ...args: Array): Promise { + const sub = await this.#hasSub(event, args); + // If there is not subscription or if a recent emit removed + // the last of them (which also deleted the sub) do nothing + if (!sub || sub.listeners.length === 0) { + return false; + } + + const count = sub.listeners.length; + sub.listeners = sub.listeners.filter(({ listener, once }) => { + const payload = new EventPayload(this, once ? null : listener, event); + try { + listener.call(this, ...args, payload); + } catch (error) {} + return !once; + }); + + if (sub.listeners.length === 0) { + if (sub.started) { + sub.subscriber.stop(); + } + this.#subs.delete(sub.tag); + } + + return count > 0; + } + + async listenerCount(event?: ProviderEvent): Promise { + if (event) { + const sub = await this.#hasSub(event); + if (!sub) { + return 0; + } + return sub.listeners.length; + } + + let total = 0; + for (const { listeners } of this.#subs.values()) { + total += listeners.length; + } + return total; + } + + async listeners(event?: ProviderEvent): Promise> { + if (event) { + const sub = await this.#hasSub(event); + if (!sub) { + return []; + } + return sub.listeners.map(({ listener }) => listener); + } + let result: Array = []; + for (const { listeners } of this.#subs.values()) { + result = result.concat(listeners.map(({ listener }) => listener)); + } + return result; + } + + async off(event: ProviderEvent, listener?: Listener): Promise { + const sub = await this.#hasSub(event); + if (!sub) { + return this; + } + + if (listener) { + const index = sub.listeners + .map(({ listener }) => listener) + .indexOf(listener); + if (index >= 0) { + sub.listeners.splice(index, 1); + } + } + + if (!listener || sub.listeners.length === 0) { + if (sub.started) { + sub.subscriber.stop(); + } + this.#subs.delete(sub.tag); + } + + return this; + } + + async removeAllListeners(event?: ProviderEvent): Promise { + if (event) { + const { tag, started, subscriber } = await this.#getSub(event); + if (started) { + subscriber.stop(); + } + this.#subs.delete(tag); + } else { + for (const [tag, { started, subscriber }] of this.#subs) { + if (started) { + subscriber.stop(); + } + this.#subs.delete(tag); + } + } + return this; + } + + // Alias for "on" + async addListener(event: ProviderEvent, listener: Listener): Promise { + return await this.on(event, listener); + } + + // Alias for "off" + async removeListener( + event: ProviderEvent, + listener: Listener, + ): Promise { + return this.off(event, listener); + } + + // Sub-classes should override this to shutdown any sockets, etc. + // but MUST call this super.shutdown. + destroy(): void { + // Stop all listeners + this.removeAllListeners(); + + // Shut down all tiemrs + for (const timerId of this.#timers.keys()) { + this._clearTimeout(timerId); + } + } + + get paused(): boolean { + return this.#pausedState != null; + } + set paused(pause: boolean) { + if (!!pause === this.paused) { + return; + } + + if (this.paused) { + this.resume(); + } else { + this.pause(false); + } + } + + pause(dropWhilePaused?: boolean): void { + this.#lastBlockNumber = -1; + + if (this.#pausedState != null) { + if (this.#pausedState == !!dropWhilePaused) { + return; + } + assert( + false, + "cannot change pause type; resume first", + "UNSUPPORTED_OPERATION", + { + operation: "pause", + }, + ); + } + + this._forEachSubscriber((s) => s.pause(dropWhilePaused)); + this.#pausedState = !!dropWhilePaused; + + for (const timer of this.#timers.values()) { + // Clear the timer + if (timer.timer) { + clearTimeout(timer.timer); + } + + // Remaining time needed for when we become unpaused + timer.time = getTime() - timer.time; + } + } + + resume(): void { + if (this.#pausedState == null) { + return; + } + + this._forEachSubscriber((s) => s.resume()); + this.#pausedState = null; + for (const timer of this.#timers.values()) { + // Remaining time when we were paused + let timeout = timer.time; + if (timeout < 0) { + timeout = 0; + } + + // Start time (in cause paused, so we con compute remaininf time) + timer.time = getTime(); + + // Start the timer + setTimeout(timer.func, timeout); + } + } } function _parseString(result: string, start: number): null | string { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return toUtf8String(bytes); - } - } catch (error) {} - return null; + try { + const bytes = _parseBytes(result, start); + if (bytes) { + return toUtf8String(bytes); + } + } catch (error) {} + return null; } function _parseBytes(result: string, start: number): null | string { - if (result === "0x") { - return null; - } - try { - const offset = getNumber(dataSlice(result, start, start + 32)); - const length = getNumber(dataSlice(result, offset, offset + 32)); - - return dataSlice(result, offset + 32, offset + 32 + length); - } catch (error) {} - return null; + if (result === "0x") { + return null; + } + try { + const offset = getNumber(dataSlice(result, start, start + 32)); + const length = getNumber(dataSlice(result, offset, offset + 32)); + + return dataSlice(result, offset + 32, offset + 32 + length); + } catch (error) {} + return null; } function numPad(value: number): Uint8Array { - const result = toBeArray(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; + const result = toBeArray(value); + if (result.length > 32) { + throw new Error("internal; should not happen"); + } + + const padded = new Uint8Array(32); + padded.set(result, 32 - result.length); + return padded; } function bytesPad(value: Uint8Array): Uint8Array { - if (value.length % 32 === 0) { - return value; - } + if (value.length % 32 === 0) { + return value; + } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; + const result = new Uint8Array(Math.ceil(value.length / 32) * 32); + result.set(value); + return result; } const empty: Uint8Array = new Uint8Array([]); // ABI Encodes a series of (bytes, bytes, ...) function encodeBytes(datas: Array): string { - const result: Array = []; + const result: Array = []; - let byteCount = 0; + let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } + // Add place-holders for pointers as we add items + for (let i = 0; i < datas.length; i++) { + result.push(empty); + byteCount += 32; + } - for (let i = 0; i < datas.length; i++) { - const data = getBytes(datas[i]); + for (let i = 0; i < datas.length; i++) { + const data = getBytes(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); + // Update the bytes offset + result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } + // The length and padded value of data + result.push(numPad(data.length)); + result.push(bytesPad(data)); + byteCount += 32 + Math.ceil(data.length / 32) * 32; + } - return concat(result) as string; + return concat(result) as string; } const zeros = - "0x0000000000000000000000000000000000000000000000000000000000000000"; + "0x0000000000000000000000000000000000000000000000000000000000000000"; function parseOffchainLookup(data: string): CcipArgs { - const result: CcipArgs = { - sender: "", - urls: [], - calldata: "", - selector: "", - extraData: "", - errorArgs: [], - }; - - assert( - dataLength(data) >= 5 * 32, - "insufficient OffchainLookup data", - "OFFCHAIN_FAULT", - { - reason: "insufficient OffchainLookup data", - }, - ); - - const sender = dataSlice(data, 0, 32); - assert( - dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), - "corrupt OffchainLookup sender", - "OFFCHAIN_FAULT", - { - reason: "corrupt OffchainLookup sender", - }, - ); - result.sender = dataSlice(sender, 12); - - // Read the URLs from the response - try { - const urls: Array = []; - const urlsOffset = getNumber(dataSlice(data, 32, 64)); - const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); - const urlsData = dataSlice(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } catch (error) { - assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls", - }); - } - - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } catch (error) { - assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata", - }); - } - - // Get the callbackSelector (bytes4) - assert( - dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), - "corrupt OffchainLookup callbaackSelector", - "OFFCHAIN_FAULT", - { - reason: "corrupt OffchainLookup callbaackSelector", - }, - ); - result.selector = dataSlice(data, 96, 100); - - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } catch (error) { - assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData", - }); - } - - result.errorArgs = "sender,urls,calldata,selector,extraData" - .split(/,/) - .map((k) => (result)[k]); - - return result; + const result: CcipArgs = { + sender: "", + urls: [], + calldata: "", + selector: "", + extraData: "", + errorArgs: [], + }; + + assert( + dataLength(data) >= 5 * 32, + "insufficient OffchainLookup data", + "OFFCHAIN_FAULT", + { + reason: "insufficient OffchainLookup data", + }, + ); + + const sender = dataSlice(data, 0, 32); + assert( + dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), + "corrupt OffchainLookup sender", + "OFFCHAIN_FAULT", + { + reason: "corrupt OffchainLookup sender", + }, + ); + result.sender = dataSlice(sender, 12); + + // Read the URLs from the response + try { + const urls: Array = []; + const urlsOffset = getNumber(dataSlice(data, 32, 64)); + const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); + const urlsData = dataSlice(data, urlsOffset + 32); + for (let u = 0; u < urlsLength; u++) { + const url = _parseString(urlsData, u * 32); + if (url == null) { + throw new Error("abort"); + } + urls.push(url); + } + result.urls = urls; + } catch (error) { + assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { + reason: "corrupt OffchainLookup urls", + }); + } + + // Get the CCIP calldata to forward + try { + const calldata = _parseBytes(data, 64); + if (calldata == null) { + throw new Error("abort"); + } + result.calldata = calldata; + } catch (error) { + assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { + reason: "corrupt OffchainLookup calldata", + }); + } + + // Get the callbackSelector (bytes4) + assert( + dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), + "corrupt OffchainLookup callbaackSelector", + "OFFCHAIN_FAULT", + { + reason: "corrupt OffchainLookup callbaackSelector", + }, + ); + result.selector = dataSlice(data, 96, 100); + + // Get the extra data to send back to the contract as context + try { + const extraData = _parseBytes(data, 128); + if (extraData == null) { + throw new Error("abort"); + } + result.extraData = extraData; + } catch (error) { + assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { + reason: "corrupt OffchainLookup extraData", + }); + } + + result.errorArgs = "sender,urls,calldata,selector,extraData" + .split(/,/) + .map((k) => (result)[k]); + + return result; } diff --git a/src.ts/providers/abstract-signer.ts b/src.ts/providers/abstract-signer.ts index a00d3edc8..e901b59b0 100644 --- a/src.ts/providers/abstract-signer.ts +++ b/src.ts/providers/abstract-signer.ts @@ -7,11 +7,11 @@ import { resolveAddress } from "../address/checks.js"; import { getAddress } from "../address/index.js"; import { Transaction } from "../transaction/index.js"; import { - defineProperties, - getBigInt, - resolveProperties, - assert, - assertArgument, + defineProperties, + getBigInt, + resolveProperties, + assert, + assertArgument, } from "../utils/index.js"; import { copyRequest } from "./provider.js"; @@ -20,200 +20,199 @@ import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; import type { TransactionLike } from "../transaction/index.js"; import type { - BlockTag, - Provider, - TransactionRequest, - TransactionResponse, + BlockTag, + Provider, + TransactionRequest, + TransactionResponse, } from "./provider.js"; import type { Signer } from "./signer.js"; function checkProvider(signer: AbstractSigner, operation: string): Provider { - if (signer.provider) { - return signer.provider; - } - assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); + if (signer.provider) { + return signer.provider; + } + assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); } async function populate( - signer: AbstractSigner, - tx: TransactionRequest, + signer: AbstractSigner, + tx: TransactionRequest, ): Promise> { - let pop: any = copyRequest(tx); - - if (pop.to != null) { - pop.to = resolveAddress(pop.to); - } - - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).then( - ([address, from]) => { - assertArgument( - address.toLowerCase() === from.toLowerCase(), - "transaction from mismatch", - "tx.from", - from, - ); - return address; - }, - ); - } else { - pop.from = signer.getAddress(); - } - - return await resolveProperties(pop); + let pop: any = copyRequest(tx); + + if (pop.to != null) { + pop.to = resolveAddress(pop.to); + } + + if (pop.from != null) { + const from = pop.from; + pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).then( + ([address, from]) => { + assertArgument( + address.toLowerCase() === from.toLowerCase(), + "transaction from mismatch", + "tx.from", + from, + ); + return address; + }, + ); + } else { + pop.from = signer.getAddress(); + } + + return await resolveProperties(pop); } export abstract class AbstractSigner< - P extends null | Provider = null | Provider, -> implements Signer -{ - readonly provider!: P; - - constructor(provider?: P) { - defineProperties(this, { provider: provider || null }); - } - - abstract getAddress(): Promise; - abstract connect(provider: null | Provider): Signer; - - async getNonce(blockTag?: BlockTag): Promise { - return checkProvider(this, "getTransactionCount").getTransactionCount( - await this.getAddress(), - blockTag, - ); - } - - async populateCall(tx: TransactionRequest): Promise> { - const pop = await populate(this, tx); - return pop; - } - - async populateTransaction( - tx: TransactionRequest, - ): Promise> { - const provider = checkProvider(this, "populateTransaction"); - - const pop = await populate(this, tx); - - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - - if (pop.energyLimit == null) { - pop.energyLimit = await this.estimateEnergy(pop); - } - - // Populate the chain ID - const network = await (this.provider).getNetwork(); - if (pop.networkId != null) { - const networkId = getBigInt(pop.networkId); - assertArgument( - networkId === network.networkId, - "transaction networkId mismatch", - "tx.networkId", - tx.networkId, - ); - } else { - pop.networkId = network.networkId; - } - - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - // We need to auto-detect the intended type of this transaction... - - if (feeData.energyPrice != null) { - // Network doesn't support EIP-1559... - // Populate missing fee data - if (pop.energyPrice == null) { - pop.energyPrice = feeData.energyPrice; - } - } else { - // getFeeData has failed us. - assert( - false, - "failed to get consistent fee data", - "UNSUPPORTED_OPERATION", - { - operation: "signer.getFeeData", - }, - ); - } - - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await resolveProperties(pop); - } - - async estimateEnergy(tx: TransactionRequest): Promise { - return checkProvider(this, "estimateEnergy").estimateEnergy( - await this.populateCall(tx), - ); - } - - async call(tx: TransactionRequest): Promise { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - - async resolveName(name: string): Promise { - return getAddress(name); - } - - async sendTransaction(tx: TransactionRequest): Promise { - const provider = checkProvider(this, "sendTransaction"); - - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction.from(pop); - return await provider.broadcastTransaction( - await this.signTransaction(txObj), - ); - } - - abstract signTransaction(tx: TransactionRequest): Promise; - abstract signMessage(message: string | Uint8Array): Promise; - abstract signTypedData( - domain: TypedDataDomain, - types: Record>, - value: Record, - ): Promise; + P extends null | Provider = null | Provider, +> implements Signer { + readonly provider!: P; + + constructor(provider?: P) { + defineProperties(this, { provider: provider || null }); + } + + abstract getAddress(): Promise; + abstract connect(provider: null | Provider): Signer; + + async getNonce(blockTag?: BlockTag): Promise { + return checkProvider(this, "getTransactionCount").getTransactionCount( + await this.getAddress(), + blockTag, + ); + } + + async populateCall(tx: TransactionRequest): Promise> { + const pop = await populate(this, tx); + return pop; + } + + async populateTransaction( + tx: TransactionRequest, + ): Promise> { + const provider = checkProvider(this, "populateTransaction"); + + const pop = await populate(this, tx); + + if (pop.nonce == null) { + pop.nonce = await this.getNonce("pending"); + } + + if (pop.energyLimit == null) { + pop.energyLimit = await this.estimateEnergy(pop); + } + + // Populate the chain ID + const network = await (this.provider).getNetwork(); + if (pop.networkId != null) { + const networkId = getBigInt(pop.networkId); + assertArgument( + networkId === network.networkId, + "transaction networkId mismatch", + "tx.networkId", + tx.networkId, + ); + } else { + pop.networkId = network.networkId; + } + + // We need to get fee data to determine things + const feeData = await provider.getFeeData(); + // We need to auto-detect the intended type of this transaction... + + if (feeData.energyPrice != null) { + // Network doesn't support EIP-1559... + // Populate missing fee data + if (pop.energyPrice == null) { + pop.energyPrice = feeData.energyPrice; + } + } else { + // getFeeData has failed us. + assert( + false, + "failed to get consistent fee data", + "UNSUPPORTED_OPERATION", + { + operation: "signer.getFeeData", + }, + ); + } + + //@TOOD: Don't await all over the place; save them up for + // the end for better batching + return await resolveProperties(pop); + } + + async estimateEnergy(tx: TransactionRequest): Promise { + return checkProvider(this, "estimateEnergy").estimateEnergy( + await this.populateCall(tx), + ); + } + + async call(tx: TransactionRequest): Promise { + return checkProvider(this, "call").call(await this.populateCall(tx)); + } + + async resolveName(name: string): Promise { + return getAddress(name); + } + + async sendTransaction(tx: TransactionRequest): Promise { + const provider = checkProvider(this, "sendTransaction"); + + const pop = await this.populateTransaction(tx); + delete pop.from; + const txObj = Transaction.from(pop); + return await provider.broadcastTransaction( + await this.signTransaction(txObj), + ); + } + + abstract signTransaction(tx: TransactionRequest): Promise; + abstract signMessage(message: string | Uint8Array): Promise; + abstract signTypedData( + domain: TypedDataDomain, + types: Record>, + value: Record, + ): Promise; } export class VoidSigner extends AbstractSigner { - readonly address!: string; - - constructor(address: string, provider?: null | Provider) { - super(provider); - defineProperties(this, { address }); - } - - async getAddress(): Promise { - return this.address; - } - - connect(provider: null | Provider): VoidSigner { - return new VoidSigner(this.address, provider); - } - - #throwUnsupported(suffix: string, operation: string): never { - assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { - operation, - }); - } - - async signTransaction(tx: TransactionRequest): Promise { - this.#throwUnsupported("transactions", "signTransaction"); - } - - async signMessage(message: string | Uint8Array): Promise { - this.#throwUnsupported("messages", "signMessage"); - } - - async signTypedData( - domain: TypedDataDomain, - types: Record>, - value: Record, - ): Promise { - this.#throwUnsupported("typed-data", "signTypedData"); - } + readonly address!: string; + + constructor(address: string, provider?: null | Provider) { + super(provider); + defineProperties(this, { address }); + } + + async getAddress(): Promise { + return this.address; + } + + connect(provider: null | Provider): VoidSigner { + return new VoidSigner(this.address, provider); + } + + #throwUnsupported(suffix: string, operation: string): never { + assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { + operation, + }); + } + + async signTransaction(tx: TransactionRequest): Promise { + this.#throwUnsupported("transactions", "signTransaction"); + } + + async signMessage(message: string | Uint8Array): Promise { + this.#throwUnsupported("messages", "signMessage"); + } + + async signTypedData( + domain: TypedDataDomain, + types: Record>, + value: Record, + ): Promise { + this.#throwUnsupported("typed-data", "signTypedData"); + } } diff --git a/src.ts/providers/community.ts b/src.ts/providers/community.ts index 6e08cf22c..729399bca 100644 --- a/src.ts/providers/community.ts +++ b/src.ts/providers/community.ts @@ -12,11 +12,11 @@ * are in-use. */ export interface CommunityResourcable { - /** - * Returns true of the instance is connected using the community - * credentials. - */ - isCommunityResource(): boolean; + /** + * Returns true of the instance is connected using the community + * credentials. + */ + isCommunityResource(): boolean; } // Show the throttle message only once per service @@ -31,31 +31,31 @@ const shown: Set = new Set(); * The notification will only occur once per service. */ export function showThrottleMessage(service: string): void { - if (shown.has(service)) { - return; - } - shown.add(service); + if (shown.has(service)) { + return; + } + shown.add(service); - console.log("========= NOTICE ========="); - console.log( - `Request-Rate Exceeded for ${service} (this message will not be repeated)`, - ); - console.log(""); - console.log( - "The default API keys for each service are provided as a highly-throttled,", - ); - console.log( - "community resource for low-traffic projects and early prototyping.", - ); - console.log(""); - console.log( - "While your application will continue to function, we highly recommended", - ); - console.log( - "signing up for your own API keys to improve performance, increase your", - ); - console.log( - "request rate/limit and enable other perks, such as metrics and advanced APIs.", - ); - console.log(""); + console.log("========= NOTICE ========="); + console.log( + `Request-Rate Exceeded for ${service} (this message will not be repeated)`, + ); + console.log(""); + console.log( + "The default API keys for each service are provided as a highly-throttled,", + ); + console.log( + "community resource for low-traffic projects and early prototyping.", + ); + console.log(""); + console.log( + "While your application will continue to function, we highly recommended", + ); + console.log( + "signing up for your own API keys to improve performance, increase your", + ); + console.log( + "request rate/limit and enable other perks, such as metrics and advanced APIs.", + ); + console.log(""); } diff --git a/src.ts/providers/contracts.ts b/src.ts/providers/contracts.ts index e40f4d925..f61995cf3 100644 --- a/src.ts/providers/contracts.ts +++ b/src.ts/providers/contracts.ts @@ -1,23 +1,23 @@ import type { - Provider, - TransactionRequest, - TransactionResponse, + Provider, + TransactionRequest, + TransactionResponse, } from "./provider.js"; // The object that will be used to run Contracts. The Signer and Provider // both adhere to this, but other types of objects may wish to as well. export interface ContractRunner { - provider: null | Provider; + provider: null | Provider; - // Required to estimate energy; usually a Signer or Provider - estimateEnergy?: (tx: TransactionRequest) => Promise; + // Required to estimate energy; usually a Signer or Provider + estimateEnergy?: (tx: TransactionRequest) => Promise; - // Required for pure, view or static calls to contracts; usually a Signer or Provider - call?: (tx: TransactionRequest) => Promise; + // Required for pure, view or static calls to contracts; usually a Signer or Provider + call?: (tx: TransactionRequest) => Promise; - // Required to support ENS names; usually a Signer or Provider - resolveName?: (name: string) => Promise; + // Required to support ENS names; usually a Signer or Provider + resolveName?: (name: string) => Promise; - // Required for mutating calls; usually a Signer - sendTransaction?: (tx: TransactionRequest) => Promise; + // Required for mutating calls; usually a Signer + sendTransaction?: (tx: TransactionRequest) => Promise; } diff --git a/src.ts/providers/default-provider.ts b/src.ts/providers/default-provider.ts index 943a7619f..636ab7c0d 100644 --- a/src.ts/providers/default-provider.ts +++ b/src.ts/providers/default-provider.ts @@ -16,72 +16,72 @@ import type { Networkish } from "./network.js"; import { WebSocketLike } from "./provider-websocket.js"; function isWebSocketLike(value: any): value is WebSocketLike { - return ( - value && - typeof value.send === "function" && - typeof value.close === "function" - ); + return ( + value && + typeof value.send === "function" && + typeof value.close === "function" + ); } export function getDefaultProvider( - network: string | Networkish | WebSocketLike, - options?: any, + network: string | Networkish | WebSocketLike, + options?: any, ): AbstractProvider { - if (options == null) { - options = {}; - } + if (options == null) { + options = {}; + } - if (typeof network === "string" && network.match(/^https?:/)) { - return new JsonRpcProvider(network); - } + if (typeof network === "string" && network.match(/^https?:/)) { + return new JsonRpcProvider(network); + } - if ( - (typeof network === "string" && network.match(/^wss?:/)) || - isWebSocketLike(network) - ) { - return new WebSocketProvider(network); - } + if ( + (typeof network === "string" && network.match(/^wss?:/)) || + isWebSocketLike(network) + ) { + return new WebSocketProvider(network); + } - const providers: Array = []; + const providers: Array = []; - if (options.alchemy !== "-") { - try { - providers.push(new AlchemyProvider(network, options.alchemy)); - } catch (error) { - console.log(error); - } - } + if (options.alchemy !== "-") { + try { + providers.push(new AlchemyProvider(network, options.alchemy)); + } catch (error) { + console.log(error); + } + } - if (options.ankr !== "-" && options.ankr != null) { - try { - providers.push(new AnkrProvider(network, options.ankr)); - } catch (error) { - console.log(error); - } - } + if (options.ankr !== "-" && options.ankr != null) { + try { + providers.push(new AnkrProvider(network, options.ankr)); + } catch (error) { + console.log(error); + } + } - if (options.cloudflare !== "-") { - try { - providers.push(new CloudflareProvider(network)); - } catch (error) { - console.log(error); - } - } + if (options.cloudflare !== "-") { + try { + providers.push(new CloudflareProvider(network)); + } catch (error) { + console.log(error); + } + } - if (options.infura !== "-") { - try { - let projectId = options.infura; - let projectSecret: undefined | string = undefined; - if (typeof projectId === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new InfuraProvider(network, projectId, projectSecret)); - } catch (error) { - console.log(error); - } - } - /* + if (options.infura !== "-") { + try { + let projectId = options.infura; + let projectSecret: undefined | string = undefined; + if (typeof projectId === "object") { + projectSecret = projectId.projectSecret; + projectId = projectId.projectId; + } + providers.push(new InfuraProvider(network, projectId, projectSecret)); + } catch (error) { + console.log(error); + } + } + /* if (options.pocket !== "-") { try { let appId = options.pocket; @@ -96,27 +96,27 @@ export function getDefaultProvider( } catch (error) { console.log(error); } } */ - if (options.quicknode !== "-") { - try { - let token = options.quicknode; - providers.push(new QuickNodeProvider(network, token)); - } catch (error) { - console.log(error); - } - } + if (options.quicknode !== "-") { + try { + let token = options.quicknode; + providers.push(new QuickNodeProvider(network, token)); + } catch (error) { + console.log(error); + } + } - assert( - providers.length, - "unsupported default network", - "UNSUPPORTED_OPERATION", - { - operation: "getDefaultProvider", - }, - ); + assert( + providers.length, + "unsupported default network", + "UNSUPPORTED_OPERATION", + { + operation: "getDefaultProvider", + }, + ); - if (providers.length === 1) { - return providers[0]; - } + if (providers.length === 1) { + return providers[0]; + } - return new FallbackProvider(providers); + return new FallbackProvider(providers); } diff --git a/src.ts/providers/format.ts b/src.ts/providers/format.ts index 030cf2fef..024141004 100644 --- a/src.ts/providers/format.ts +++ b/src.ts/providers/format.ts @@ -5,20 +5,20 @@ import { getAddress } from "../address/index.js"; import { getCreateAddress } from "../address/contract-address.js"; import { accessListify } from "../transaction/index.js"; import { - getBigInt, - getNumber, - hexlify, - isHexString, - zeroPadValue, - assert, - assertArgument, + getBigInt, + getNumber, + hexlify, + isHexString, + zeroPadValue, + assert, + assertArgument, } from "../utils/index.js"; import type { - BlockParams, - LogParams, - TransactionReceiptParams, - TransactionResponseParams, + BlockParams, + LogParams, + TransactionReceiptParams, + TransactionResponseParams, } from "./formatting.js"; const BN_0 = BigInt(0); @@ -26,268 +26,268 @@ const BN_0 = BigInt(0); export type FormatFunc = (value: any) => any; export function allowNull(format: FormatFunc, nullValue?: any): FormatFunc { - return function (value: any) { - if (value == null) { - return nullValue; - } - return format(value); - }; + return function (value: any) { + if (value == null) { + return nullValue; + } + return format(value); + }; } export function arrayOf(format: FormatFunc): FormatFunc { - return (array: any) => { - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }; + return (array: any) => { + if (!Array.isArray(array)) { + throw new Error("not an array"); + } + return array.map((i) => format(i)); + }; } // Requires an object which matches a fleet of other formatters // Any FormatFunc may return `undefined` to have the value omitted // from the result object. Calls preserve `this`. export function object( - format: Record, - altNames?: Record>, + format: Record, + altNames?: Record>, ): FormatFunc { - return (value: any) => { - const result: any = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } catch (error) { - const message = error instanceof Error ? error.message : "not-an-error"; - assert( - false, - `invalid value for value.${key} (${message})`, - "BAD_DATA", - { value }, - ); - } - } - return result; - }; + return (value: any) => { + const result: any = {}; + for (const key in format) { + let srcKey = key; + if (altNames && key in altNames && !(srcKey in value)) { + for (const altKey of altNames[key]) { + if (altKey in value) { + srcKey = altKey; + break; + } + } + } + + try { + const nv = format[key](value[srcKey]); + if (nv !== undefined) { + result[key] = nv; + } + } catch (error) { + const message = error instanceof Error ? error.message : "not-an-error"; + assert( + false, + `invalid value for value.${key} (${message})`, + "BAD_DATA", + { value }, + ); + } + } + return result; + }; } export function formatBoolean(value: any): boolean { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - assertArgument( - false, - `invalid boolean; ${JSON.stringify(value)}`, - "value", - value, - ); + switch (value) { + case true: + case "true": + return true; + case false: + case "false": + return false; + } + assertArgument( + false, + `invalid boolean; ${JSON.stringify(value)}`, + "value", + value, + ); } export function formatData(value: string): string { - assertArgument(isHexString(value, true), "invalid data", "value", value); - return value; + assertArgument(isHexString(value, true), "invalid data", "value", value); + return value; } export function formatHash(value: any): string { - assertArgument(isHexString(value, 32), "invalid hash", "value", value); - return value; + assertArgument(isHexString(value, 32), "invalid hash", "value", value); + return value; } export function formatUint256(value: any): string { - if (!isHexString(value)) { - throw new Error("invalid uint256"); - } - return zeroPadValue(value, 32); + if (!isHexString(value)) { + throw new Error("invalid uint256"); + } + return zeroPadValue(value, 32); } const _formatLog = object( - { - address: getAddress, - blockHash: formatHash, - blockNumber: getNumber, - data: formatData, - index: getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: getNumber, - }, - { - index: ["logIndex"], - }, + { + address: getAddress, + blockHash: formatHash, + blockNumber: getNumber, + data: formatData, + index: getNumber, + removed: allowNull(formatBoolean, false), + topics: arrayOf(formatHash), + transactionHash: formatHash, + transactionIndex: getNumber, + }, + { + index: ["logIndex"], + }, ); export function formatLog(value: any): LogParams { - return _formatLog(value); + return _formatLog(value); } const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - number: getNumber, + hash: allowNull(formatHash), + parentHash: formatHash, + number: getNumber, - timestamp: getNumber, - nonce: allowNull(formatData), - difficulty: getBigInt, + timestamp: getNumber, + nonce: allowNull(formatData), + difficulty: getBigInt, - energyLimit: getBigInt, - energyUsed: getBigInt, + energyLimit: getBigInt, + energyUsed: getBigInt, - miner: allowNull(getAddress), - extraData: formatData, + miner: allowNull(getAddress), + extraData: formatData, - baseFeePerEnergy: allowNull(getBigInt), + baseFeePerEnergy: allowNull(getBigInt), }); export function formatBlock(value: any): BlockParams { - const result = _formatBlock(value); - result.transactions = value.transactions.map( - (tx: string | TransactionResponseParams) => { - if (typeof tx === "string") { - return tx; - } - return formatTransactionResponse(tx); - }, - ); - return result; + const result = _formatBlock(value); + result.transactions = value.transactions.map( + (tx: string | TransactionResponseParams) => { + if (typeof tx === "string") { + return tx; + } + return formatTransactionResponse(tx); + }, + ); + return result; } const _formatReceiptLog = object( - { - transactionIndex: getNumber, - blockNumber: getNumber, - transactionHash: formatHash, - address: getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: getNumber, - blockHash: formatHash, - }, - { - index: ["logIndex"], - }, + { + transactionIndex: getNumber, + blockNumber: getNumber, + transactionHash: formatHash, + address: getAddress, + topics: arrayOf(formatHash), + data: formatData, + index: getNumber, + blockHash: formatHash, + }, + { + index: ["logIndex"], + }, ); export function formatReceiptLog(value: any): LogParams { - return _formatReceiptLog(value); + return _formatReceiptLog(value); } const _formatTransactionReceipt = object( - { - to: allowNull(getAddress, null), - from: allowNull(getAddress, null), - contractAddress: allowNull(getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: getNumber, - root: allowNull(hexlify), - energyUsed: getBigInt, - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeEnergyUsed: getBigInt, - effectiveEnergyPrice: allowNull(getBigInt), - status: allowNull(getNumber), - type: allowNull(getNumber, 0), - }, - { - effectiveEnergyPrice: ["energyPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], - }, + { + to: allowNull(getAddress, null), + from: allowNull(getAddress, null), + contractAddress: allowNull(getAddress, null), + // should be allowNull(hash), but broken-EIP-658 support is handled in receipt + index: getNumber, + root: allowNull(hexlify), + energyUsed: getBigInt, + logsBloom: allowNull(formatData), + blockHash: formatHash, + hash: formatHash, + logs: arrayOf(formatReceiptLog), + blockNumber: getNumber, + //confirmations: allowNull(getNumber, null), + cumulativeEnergyUsed: getBigInt, + effectiveEnergyPrice: allowNull(getBigInt), + status: allowNull(getNumber), + type: allowNull(getNumber, 0), + }, + { + effectiveEnergyPrice: ["energyPrice"], + hash: ["transactionHash"], + index: ["transactionIndex"], + }, ); export function formatTransactionReceipt(value: any): TransactionReceiptParams { - return _formatTransactionReceipt(value); + return _formatTransactionReceipt(value); } export function formatTransactionResponse( - value: any, + value: any, ): TransactionResponseParams { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && !getAddress(value.to) && getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - - const result = object( - { - hash: formatHash, - - type: (value: any) => { - if (value === "0x" || value == null) { - return 0; - } - return getNumber(value); - }, - accessList: allowNull(accessListify, null), - - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(getNumber, null), - transactionIndex: allowNull(getNumber, null), - - //confirmations: allowNull(getNumber, null), - - from: getAddress, - - maxFeePerEnergy: allowNull(getBigInt), - - energyLimit: getBigInt, - to: allowNull(getAddress, null), - value: getBigInt, - nonce: getNumber, - data: formatData, - - creates: allowNull(getAddress, null), - - networkId: allowNull(getBigInt, null), - }, - { - data: ["input"], - energyLimit: ["energy"], - }, - )(value); - - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = getCreateAddress(result); - } - - // Compute the signature - if (value.signature) { - result.signature = value.signature; - } else { - result.signature = value; - } - - // Some backends omit networkId on legacy transactions, but we can compute it - if (result.networkId == null) { - const networkId = result.signature.legacynetworkId; - if (networkId != null) { - result.networkId = networkId; - } - } - - // @TODO: check networkId - /* + // Some clients (TestRPC) do strange things like return 0x0 for the + // 0 address; correct this to be a real address + if (value.to && !getAddress(value.to) && getBigInt(value.to) === BN_0) { + value.to = "0x0000000000000000000000000000000000000000"; + } + + const result = object( + { + hash: formatHash, + + type: (value: any) => { + if (value === "0x" || value == null) { + return 0; + } + return getNumber(value); + }, + accessList: allowNull(accessListify, null), + + blockHash: allowNull(formatHash, null), + blockNumber: allowNull(getNumber, null), + transactionIndex: allowNull(getNumber, null), + + //confirmations: allowNull(getNumber, null), + + from: getAddress, + + maxFeePerEnergy: allowNull(getBigInt), + + energyLimit: getBigInt, + to: allowNull(getAddress, null), + value: getBigInt, + nonce: getNumber, + data: formatData, + + creates: allowNull(getAddress, null), + + networkId: allowNull(getBigInt, null), + }, + { + data: ["input"], + energyLimit: ["energy"], + }, + )(value); + + // If to and creates are empty, populate the creates from the value + if (result.to == null && result.creates == null) { + result.creates = getCreateAddress(result); + } + + // Compute the signature + if (value.signature) { + result.signature = value.signature; + } else { + result.signature = value; + } + + // Some backends omit networkId on legacy transactions, but we can compute it + if (result.networkId == null) { + const networkId = result.signature.legacynetworkId; + if (networkId != null) { + result.networkId = networkId; + } + } + + // @TODO: check networkId + /* if (value.networkId != null) { let networkId = value.networkId; @@ -321,10 +321,10 @@ export function formatTransactionResponse( } */ - // 0x0000... should actually be null - if (result.blockHash && getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } + // 0x0000... should actually be null + if (result.blockHash && getBigInt(result.blockHash) === BN_0) { + result.blockHash = null; + } - return result; + return result; } diff --git a/src.ts/providers/formatting.ts b/src.ts/providers/formatting.ts index d97f1ed98..558c7a8b7 100644 --- a/src.ts/providers/formatting.ts +++ b/src.ts/providers/formatting.ts @@ -59,72 +59,72 @@ export interface PreparedTransactionRequest { // Block export interface BlockParams { - hash?: null | string; + hash?: null | string; - number: number; - timestamp: number; + number: number; + timestamp: number; - parentHash: string; + parentHash: string; - nonce: string; - difficulty: bigint; + nonce: string; + difficulty: bigint; - energyLimit: bigint; - energyUsed: bigint; + energyLimit: bigint; + energyUsed: bigint; - miner: string; - extraData: string; + miner: string; + extraData: string; - baseFeePerEnergy: null | bigint; + baseFeePerEnergy: null | bigint; - transactions: ReadonlyArray; + transactions: ReadonlyArray; } ////////////////////// // Log export interface LogParams { - transactionHash: string; - blockHash: string; - blockNumber: number; + transactionHash: string; + blockHash: string; + blockNumber: number; - removed: boolean; + removed: boolean; - address: string; - data: string; + address: string; + data: string; - topics: ReadonlyArray; + topics: ReadonlyArray; - index: number; - transactionIndex: number; + index: number; + transactionIndex: number; } ////////////////////// // Transaction Receipt export interface TransactionReceiptParams { - to: null | string; - from: string; - contractAddress: null | string; + to: null | string; + from: string; + contractAddress: null | string; - hash: string; - index: number; + hash: string; + index: number; - blockHash: string; - blockNumber: number; + blockHash: string; + blockNumber: number; - logsBloom: string; - logs: ReadonlyArray; + logsBloom: string; + logs: ReadonlyArray; - energyUsed: bigint; - cumulativeEnergyUsed: bigint; - energyPrice?: null | bigint; - effectiveEnergyPrice?: null | bigint; + energyUsed: bigint; + cumulativeEnergyUsed: bigint; + energyPrice?: null | bigint; + effectiveEnergyPrice?: null | bigint; - type: number; - //byzantium: boolean; - status: null | number; - root: null | string; + type: number; + //byzantium: boolean; + status: null | number; + root: null | string; } /* @@ -145,26 +145,26 @@ export interface ByzantiumTransactionReceipt { // Transaction Response export interface TransactionResponseParams { - blockNumber: null | number; - blockHash: null | string; + blockNumber: null | number; + blockHash: null | string; - hash: string; - index: number; + hash: string; + index: number; - type: number; + type: number; - to: null | string; - from: string; + to: null | string; + from: string; - nonce: number; + nonce: number; - energyLimit: bigint; + energyLimit: bigint; - energyPrice: bigint; + energyPrice: bigint; - data: string; - value: bigint; - networkId: bigint; + data: string; + value: bigint; + networkId: bigint; - signature: string; + signature: string; } diff --git a/src.ts/providers/index.ts b/src.ts/providers/index.ts index 5f22768ce..c410008ee 100644 --- a/src.ts/providers/index.ts +++ b/src.ts/providers/index.ts @@ -17,26 +17,26 @@ export { Network } from "./network.js"; export { NonceManager } from "./signer-noncemanager.js"; export { - NetworkPlugin, - EnergyCostPlugin, - FeeDataNetworkPlugin, + NetworkPlugin, + EnergyCostPlugin, + FeeDataNetworkPlugin, } from "./plugins-network.js"; export { - Block, - FeeData, - Log, - TransactionReceipt, - TransactionResponse, - copyRequest, - //resolveTransactionRequest, + Block, + FeeData, + Log, + TransactionReceipt, + TransactionResponse, + copyRequest, + //resolveTransactionRequest, } from "./provider.js"; export { FallbackProvider } from "./provider-fallback.js"; export { - JsonRpcApiProvider, - JsonRpcProvider, - JsonRpcSigner, + JsonRpcApiProvider, + JsonRpcProvider, + JsonRpcSigner, } from "./provider-jsonrpc.js"; export { BrowserProvider } from "./provider-browser.js"; @@ -54,28 +54,28 @@ export { SocketProvider } from "./provider-socket.js"; export { WebSocketProvider } from "./provider-websocket.js"; export { - SocketSubscriber, - SocketBlockSubscriber, - SocketPendingSubscriber, - SocketEventSubscriber, + SocketSubscriber, + SocketBlockSubscriber, + SocketPendingSubscriber, + SocketEventSubscriber, } from "./provider-socket.js"; export type { - Subscription, - Subscriber, - AbstractProviderPlugin, - PerformActionFilter, - PerformActionTransaction, - PerformActionRequest, + Subscription, + Subscriber, + AbstractProviderPlugin, + PerformActionFilter, + PerformActionTransaction, + PerformActionRequest, } from "./abstract-provider.js"; export type { ContractRunner } from "./contracts.js"; export type { - BlockParams, - LogParams, - TransactionReceiptParams, - TransactionResponseParams, + BlockParams, + LogParams, + TransactionReceiptParams, + TransactionResponseParams, } from "./formatting.js"; /* @@ -92,31 +92,31 @@ export type { Networkish } from "./network.js"; export type { EnergyCostParameters } from "./plugins-network.js"; export type { - BlockTag, - TransactionRequest, - PreparedTransactionRequest, - EventFilter, - Filter, - FilterByBlockHash, - OrphanFilter, - ProviderEvent, - TopicFilter, - Provider, - MinedBlock, - MinedTransactionResponse, + BlockTag, + TransactionRequest, + PreparedTransactionRequest, + EventFilter, + Filter, + FilterByBlockHash, + OrphanFilter, + ProviderEvent, + TopicFilter, + Provider, + MinedBlock, + MinedTransactionResponse, } from "./provider.js"; export type { - DebugEventBrowserProvider, - Eip1193Provider, + DebugEventBrowserProvider, + Eip1193Provider, } from "./provider-browser.js"; export type { - JsonRpcPayload, - JsonRpcResult, - JsonRpcError, - JsonRpcApiProviderOptions, - JsonRpcTransactionRequest, + JsonRpcPayload, + JsonRpcResult, + JsonRpcError, + JsonRpcApiProviderOptions, + JsonRpcTransactionRequest, } from "./provider-jsonrpc.js"; export type { WebSocketCreator, WebSocketLike } from "./provider-websocket.js"; diff --git a/src.ts/providers/network.ts b/src.ts/providers/network.ts index 4eadf0deb..97b2d9144 100644 --- a/src.ts/providers/network.ts +++ b/src.ts/providers/network.ts @@ -20,17 +20,17 @@ import type { NetworkPlugin } from "./plugins-network.js"; * - an object with sufficient details to describe a network */ export type Networkish = - | Network - | number - | bigint - | string - | { - name?: string; - networkId?: number; - //layerOneConnection?: Provider, - ensAddress?: string; - ensNetwork?: number; - }; + | Network + | number + | bigint + | string + | { + name?: string; + networkId?: number; + //layerOneConnection?: Provider, + ensAddress?: string; + ensNetwork?: number; + }; /* * * * // Networks which operation against an L2 can use this plugin to @@ -48,296 +48,296 @@ export class LayerOneConnectionPlugin extends NetworkPlugin { const Networks: Map Network> = new Map(); export class Network { - #name: string; - #networkId: bigint; - - #plugins: Map; - - constructor(name: string, networkId: BigNumberish) { - this.#name = name; - this.#networkId = getBigInt(networkId); - this.#plugins = new Map(); - } - - toJSON(): any { - return { name: this.name, networkId: String(this.networkId) }; - } - - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name(): string { - return this.#name; - } - set name(value: string) { - this.#name = value; - } - - /** - * The network chain ID. - */ - get networkId(): bigint { - return this.#networkId; - } - set networkId(value: BigNumberish) { - this.#networkId = getBigInt(value, "networkId"); - } - - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other: Networkish): boolean { - if (other == null) { - return false; - } - - if (typeof other === "string") { - try { - return this.networkId === getBigInt(other); - } catch (error) {} - return this.name === other; - } - - if (typeof other === "number" || typeof other === "bigint") { - try { - return this.networkId === getBigInt(other); - } catch (error) {} - return false; - } - - if (typeof other === "object") { - if (other.networkId != null) { - try { - return this.networkId === getBigInt(other.networkId); - } catch (error) {} - return false; - } - if (other.name != null) { - return this.name === other.name; - } - return false; - } - - return false; - } - - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins(): Array { - return Array.from(this.#plugins.values()); - } - - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin: NetworkPlugin): this { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name: string): null | T { - return this.#plugins.get(name) || null; - } - - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins( - basename: string, - ): Array { - return >( - this.plugins.filter((p) => p.name.split("#")[0] === basename) - ); - } - - /** - * Create a copy of this Network. - */ - clone(): Network { - const clone = new Network(this.name, this.networkId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - - /** - * Compute the intrinsic energy required for a transaction. - * - * A EnergyCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicEnergy(tx: TransactionLike): number { - const costs = - this.getPlugin( - "org.corebc.plugins.network.EnergyCost", - ) || new EnergyCostPlugin(); - - let energy = costs.txBase; - if (tx.to == null) { - energy += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - energy += costs.txDataZero; - } else { - energy += costs.txDataNonzero; - } - } - } - - return energy; - } - - /** - * Returns a new Network for the %%network%% name or networkId. - */ - static from(network?: Networkish): Network { - injectCommonNetworks(); - - // Default network - if (network == null) { - return Network.from("mainnet"); - } - - // Canonical name or chain ID - if (typeof network === "number") { - network = BigInt(network); - } - if (typeof network === "string" || typeof network === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof network === "bigint") { - return new Network("unknown", network); - } - - assertArgument(false, "unknown network", "network", network); - } - - // Clonable with network-like abilities - if (typeof (network).clone === "function") { - const clone = (network).clone(); - //if (typeof(network.name) !== "string" || typeof(network.networkId) !== "number") { - //} - return clone; - } - - // Networkish - if (typeof network === "object") { - assertArgument( - typeof network.name === "string" && - typeof network.networkId === "number", - "invalid network object name or networkId", - "network", - network, - ); - - const custom = new Network( - network.name, - network.networkId, - ); - - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - - return custom; - } - - assertArgument(false, "invalid network", "network", network); - } - - /** - * Register %%nameOrnetworkId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register( - nameOrnetworkId: string | number | bigint, - networkFunc: () => Network, - ): void { - if (typeof nameOrnetworkId === "number") { - nameOrnetworkId = BigInt(nameOrnetworkId); - } - const existing = Networks.get(nameOrnetworkId); - if (existing) { - assertArgument( - false, - `conflicting network for ${JSON.stringify(existing.name)}`, - "nameOrnetworkId", - nameOrnetworkId, - ); - } - Networks.set(nameOrnetworkId, networkFunc); - } + #name: string; + #networkId: bigint; + + #plugins: Map; + + constructor(name: string, networkId: BigNumberish) { + this.#name = name; + this.#networkId = getBigInt(networkId); + this.#plugins = new Map(); + } + + toJSON(): any { + return { name: this.name, networkId: String(this.networkId) }; + } + + /** + * The network common name. + * + * This is the canonical name, as networks migh have multiple + * names. + */ + get name(): string { + return this.#name; + } + set name(value: string) { + this.#name = value; + } + + /** + * The network chain ID. + */ + get networkId(): bigint { + return this.#networkId; + } + set networkId(value: BigNumberish) { + this.#networkId = getBigInt(value, "networkId"); + } + + /** + * Returns true if %%other%% matches this network. Any chain ID + * must match, and if no chain ID is present, the name must match. + * + * This method does not currently check for additional properties, + * such as ENS address or plug-in compatibility. + */ + matches(other: Networkish): boolean { + if (other == null) { + return false; + } + + if (typeof other === "string") { + try { + return this.networkId === getBigInt(other); + } catch (error) {} + return this.name === other; + } + + if (typeof other === "number" || typeof other === "bigint") { + try { + return this.networkId === getBigInt(other); + } catch (error) {} + return false; + } + + if (typeof other === "object") { + if (other.networkId != null) { + try { + return this.networkId === getBigInt(other.networkId); + } catch (error) {} + return false; + } + if (other.name != null) { + return this.name === other.name; + } + return false; + } + + return false; + } + + /** + * Returns the list of plugins currently attached to this Network. + */ + get plugins(): Array { + return Array.from(this.#plugins.values()); + } + + /** + * Attach a new %%plugin%% to this Network. The network name + * must be unique, excluding any fragment. + */ + attachPlugin(plugin: NetworkPlugin): this { + if (this.#plugins.get(plugin.name)) { + throw new Error(`cannot replace existing plugin: ${plugin.name} `); + } + this.#plugins.set(plugin.name, plugin.clone()); + return this; + } + + /** + * Return the plugin, if any, matching %%name%% exactly. Plugins + * with fragments will not be returned unless %%name%% includes + * a fragment. + */ + getPlugin(name: string): null | T { + return this.#plugins.get(name) || null; + } + + /** + * Gets a list of all plugins that match %%name%%, with otr without + * a fragment. + */ + getPlugins( + basename: string, + ): Array { + return >( + this.plugins.filter((p) => p.name.split("#")[0] === basename) + ); + } + + /** + * Create a copy of this Network. + */ + clone(): Network { + const clone = new Network(this.name, this.networkId); + this.plugins.forEach((plugin) => { + clone.attachPlugin(plugin.clone()); + }); + return clone; + } + + /** + * Compute the intrinsic energy required for a transaction. + * + * A EnergyCostPlugin can be attached to override the default + * values. + */ + computeIntrinsicEnergy(tx: TransactionLike): number { + const costs = + this.getPlugin( + "org.corebc.plugins.network.EnergyCost", + ) || new EnergyCostPlugin(); + + let energy = costs.txBase; + if (tx.to == null) { + energy += costs.txCreate; + } + if (tx.data) { + for (let i = 2; i < tx.data.length; i += 2) { + if (tx.data.substring(i, i + 2) === "00") { + energy += costs.txDataZero; + } else { + energy += costs.txDataNonzero; + } + } + } + + return energy; + } + + /** + * Returns a new Network for the %%network%% name or networkId. + */ + static from(network?: Networkish): Network { + injectCommonNetworks(); + + // Default network + if (network == null) { + return Network.from("mainnet"); + } + + // Canonical name or chain ID + if (typeof network === "number") { + network = BigInt(network); + } + if (typeof network === "string" || typeof network === "bigint") { + const networkFunc = Networks.get(network); + if (networkFunc) { + return networkFunc(); + } + if (typeof network === "bigint") { + return new Network("unknown", network); + } + + assertArgument(false, "unknown network", "network", network); + } + + // Clonable with network-like abilities + if (typeof (network).clone === "function") { + const clone = (network).clone(); + //if (typeof(network.name) !== "string" || typeof(network.networkId) !== "number") { + //} + return clone; + } + + // Networkish + if (typeof network === "object") { + assertArgument( + typeof network.name === "string" && + typeof network.networkId === "number", + "invalid network object name or networkId", + "network", + network, + ); + + const custom = new Network( + network.name, + network.networkId, + ); + + //if ((network).layerOneConnection) { + // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); + //} + + return custom; + } + + assertArgument(false, "invalid network", "network", network); + } + + /** + * Register %%nameOrnetworkId%% with a function which returns + * an instance of a Network representing that chain. + */ + static register( + nameOrnetworkId: string | number | bigint, + networkFunc: () => Network, + ): void { + if (typeof nameOrnetworkId === "number") { + nameOrnetworkId = BigInt(nameOrnetworkId); + } + const existing = Networks.get(nameOrnetworkId); + if (existing) { + assertArgument( + false, + `conflicting network for ${JSON.stringify(existing.name)}`, + "nameOrnetworkId", + nameOrnetworkId, + ); + } + Networks.set(nameOrnetworkId, networkFunc); + } } type Options = { - ensNetwork?: number; - priorityFee?: number; - altNames?: Array; + ensNetwork?: number; + priorityFee?: number; + altNames?: Array; }; // See: https://chainlist.org let injected = false; function injectCommonNetworks(): void { - if (injected) { - return; - } - injected = true; - - /// Register popular Core networks - function registerEth( - name: string, - networkId: number, - options: Options, - ): void { - const func = function () { - const network = new Network(name, networkId); - network.attachPlugin(new EnergyCostPlugin()); - return network; - }; - - // Register the network by name and chain ID - Network.register(name, func); - Network.register(networkId, func); - - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - - registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); - registerEth("sepolia", 11155111, {}); - - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - - registerEth("xdai", 100, { ensNetwork: 1 }); + if (injected) { + return; + } + injected = true; + + /// Register popular Core networks + function registerEth( + name: string, + networkId: number, + options: Options, + ): void { + const func = function () { + const network = new Network(name, networkId); + network.attachPlugin(new EnergyCostPlugin()); + return network; + }; + + // Register the network by name and chain ID + Network.register(name, func); + Network.register(networkId, func); + + if (options.altNames) { + options.altNames.forEach((name) => { + Network.register(name, func); + }); + } + } + + registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); + registerEth("ropsten", 3, { ensNetwork: 3 }); + registerEth("rinkeby", 4, { ensNetwork: 4 }); + registerEth("goerli", 5, { ensNetwork: 5 }); + registerEth("kovan", 42, { ensNetwork: 42 }); + registerEth("sepolia", 11155111, {}); + + registerEth("classic", 61, {}); + registerEth("classicKotti", 6, {}); + + registerEth("xdai", 100, { ensNetwork: 1 }); } diff --git a/src.ts/providers/pagination.ts b/src.ts/providers/pagination.ts index 360e5760f..a34899f11 100644 --- a/src.ts/providers/pagination.ts +++ b/src.ts/providers/pagination.ts @@ -1,8 +1,8 @@ export interface PaginationResult extends Array { - next(): Promise>; + next(): Promise>; - // The total number of results available or null if unknown - totalResults: null | number; + // The total number of results available or null if unknown + totalResults: null | number; - done: boolean; + done: boolean; } diff --git a/src.ts/providers/plugin-fallback.ts b/src.ts/providers/plugin-fallback.ts index b7b83a6fd..f0c52e337 100644 --- a/src.ts/providers/plugin-fallback.ts +++ b/src.ts/providers/plugin-fallback.ts @@ -2,43 +2,43 @@ import { AbstractProviderPlugin } from "./abstract-provider.js"; import { defineProperties } from "../utils/index.js"; import type { - AbstractProvider, - PerformActionRequest, + AbstractProvider, + PerformActionRequest, } from "./abstract-provider.js"; export const PluginIdFallbackProvider = - "org.corebc.plugins.provider.QualifiedPlugin"; + "org.corebc.plugins.provider.QualifiedPlugin"; export class CheckQualifiedPlugin implements AbstractProviderPlugin { - declare name: string; + declare name: string; - constructor() { - defineProperties(this, { - name: PluginIdFallbackProvider, - }); - } + constructor() { + defineProperties(this, { + name: PluginIdFallbackProvider, + }); + } - connect(provider: AbstractProvider): CheckQualifiedPlugin { - return this; - } + connect(provider: AbstractProvider): CheckQualifiedPlugin { + return this; + } - // Retruns true if this value should be considered qualified for - // inclusion in the quorum. - isQualified(action: PerformActionRequest, result: any): boolean { - return true; - } + // Retruns true if this value should be considered qualified for + // inclusion in the quorum. + isQualified(action: PerformActionRequest, result: any): boolean { + return true; + } } export class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action: PerformActionRequest, result: any): boolean { - if ( - action.method === "getTransaction" || - action.method === "getTransactionReceipt" - ) { - if (result == null) { - return false; - } - } - return super.isQualified(action, result); - } + isQualified(action: PerformActionRequest, result: any): boolean { + if ( + action.method === "getTransaction" || + action.method === "getTransactionReceipt" + ) { + if (result == null) { + return false; + } + } + return super.isQualified(action, result); + } } diff --git a/src.ts/providers/plugins-network.ts b/src.ts/providers/plugins-network.ts index 251ff742c..c64a3e628 100644 --- a/src.ts/providers/plugins-network.ts +++ b/src.ts/providers/plugins-network.ts @@ -4,101 +4,101 @@ import { assertArgument } from "../utils/index.js"; import type { FeeData, Provider } from "./provider.js"; export class NetworkPlugin { - readonly name!: string; + readonly name!: string; - constructor(name: string) { - defineProperties(this, { name }); - } + constructor(name: string) { + defineProperties(this, { name }); + } - clone(): NetworkPlugin { - return new NetworkPlugin(this.name); - } + clone(): NetworkPlugin { + return new NetworkPlugin(this.name); + } - // validate(network: Network): NetworkPlugin { - // return this; - // } + // validate(network: Network): NetworkPlugin { + // return this; + // } } // Networks can use this plugin to override calculations for the // intrinsic energy cost of a transaction for networks that differ // from the latest hardfork on Core mainnet. export type EnergyCostParameters = { - txBase?: number; - txCreate?: number; - txDataZero?: number; - txDataNonzero?: number; - txAccessListStorageKey?: number; - txAccessListAddress?: number; + txBase?: number; + txCreate?: number; + txDataZero?: number; + txDataNonzero?: number; + txAccessListStorageKey?: number; + txAccessListAddress?: number; }; export class EnergyCostPlugin - extends NetworkPlugin - implements EnergyCostParameters + extends NetworkPlugin + implements EnergyCostParameters { - readonly effectiveBlock!: number; - - readonly txBase!: number; - readonly txCreate!: number; - readonly txDataZero!: number; - readonly txDataNonzero!: number; - readonly txAccessListStorageKey!: number; - readonly txAccessListAddress!: number; - - constructor(effectiveBlock?: number, costs?: EnergyCostParameters) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock || 0}`); - - const props: Record = { effectiveBlock }; - function set(name: keyof EnergyCostParameters, nullish: number): void { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - assertArgument( - typeof value === "number", - `invalud value for ${name}`, - "costs", - costs, - ); - props[name] = value; - } - - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - - defineProperties(this, props); - } - - clone(): EnergyCostPlugin { - return new EnergyCostPlugin(this.effectiveBlock, this); - } + readonly effectiveBlock!: number; + + readonly txBase!: number; + readonly txCreate!: number; + readonly txDataZero!: number; + readonly txDataNonzero!: number; + readonly txAccessListStorageKey!: number; + readonly txAccessListAddress!: number; + + constructor(effectiveBlock?: number, costs?: EnergyCostParameters) { + if (effectiveBlock == null) { + effectiveBlock = 0; + } + super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock || 0}`); + + const props: Record = { effectiveBlock }; + function set(name: keyof EnergyCostParameters, nullish: number): void { + let value = (costs || {})[name]; + if (value == null) { + value = nullish; + } + assertArgument( + typeof value === "number", + `invalud value for ${name}`, + "costs", + costs, + ); + props[name] = value; + } + + set("txBase", 21000); + set("txCreate", 32000); + set("txDataZero", 4); + set("txDataNonzero", 16); + set("txAccessListStorageKey", 1900); + set("txAccessListAddress", 2400); + + defineProperties(this, props); + } + + clone(): EnergyCostPlugin { + return new EnergyCostPlugin(this.effectiveBlock, this); + } } export class FeeDataNetworkPlugin extends NetworkPlugin { - readonly #feeDataFunc: (provider: Provider) => Promise; + readonly #feeDataFunc: (provider: Provider) => Promise; - get feeDataFunc(): (provider: Provider) => Promise { - return this.#feeDataFunc; - } + get feeDataFunc(): (provider: Provider) => Promise { + return this.#feeDataFunc; + } - constructor(feeDataFunc: (provider: Provider) => Promise) { - super("org.corebc.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } + constructor(feeDataFunc: (provider: Provider) => Promise) { + super("org.corebc.plugins.network.FeeData"); + this.#feeDataFunc = feeDataFunc; + } - async getFeeData(provider: Provider): Promise { - return await this.#feeDataFunc(provider); - } + async getFeeData(provider: Provider): Promise { + return await this.#feeDataFunc(provider); + } - clone(): FeeDataNetworkPlugin { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } + clone(): FeeDataNetworkPlugin { + return new FeeDataNetworkPlugin(this.#feeDataFunc); + } } /* diff --git a/src.ts/providers/provider-alchemy.ts b/src.ts/providers/provider-alchemy.ts index 6fb324f76..056e2bb0a 100644 --- a/src.ts/providers/provider-alchemy.ts +++ b/src.ts/providers/provider-alchemy.ts @@ -4,11 +4,11 @@ * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] */ import { - defineProperties, - resolveProperties, - assert, - assertArgument, - FetchRequest, + defineProperties, + resolveProperties, + assert, + assertArgument, + FetchRequest, } from "../utils/index.js"; import { showThrottleMessage } from "./community.js"; @@ -16,8 +16,8 @@ import { Network } from "./network.js"; import { JsonRpcProvider } from "./provider-jsonrpc.js"; import type { - AbstractProvider, - PerformActionRequest, + AbstractProvider, + PerformActionRequest, } from "./abstract-provider.js"; import type { CommunityResourcable } from "./community.js"; import type { Networkish } from "./network.js"; @@ -25,29 +25,29 @@ import type { Networkish } from "./network.js"; const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; function getHost(name: string): string { - switch (name) { - case "mainnet": - return "eth-mainnet.alchemyapi.io"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - } - - assertArgument(false, "unsupported network", "network", name); + switch (name) { + case "mainnet": + return "eth-mainnet.alchemyapi.io"; + case "goerli": + return "eth-goerli.g.alchemy.com"; + case "sepolia": + return "eth-sepolia.g.alchemy.com"; + + case "arbitrum": + return "arb-mainnet.g.alchemy.com"; + case "arbitrum-goerli": + return "arb-goerli.g.alchemy.com"; + case "matic": + return "polygon-mainnet.g.alchemy.com"; + case "matic-mumbai": + return "polygon-mumbai.g.alchemy.com"; + case "optimism": + return "opt-mainnet.g.alchemy.com"; + case "optimism-goerli": + return "opt-goerli.g.alchemy.com"; + } + + assertArgument(false, "unsupported network", "network", name); } /** @@ -62,97 +62,97 @@ function getHost(name: string): string { * @_docloc: api/providers/thirdparty */ export class AlchemyProvider - extends JsonRpcProvider - implements CommunityResourcable + extends JsonRpcProvider + implements CommunityResourcable { - readonly apiKey!: string; - - constructor(_network?: Networkish, apiKey?: null | string) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - - defineProperties(this, { apiKey }); - } - - _getProvider(networkId: number): AbstractProvider { - try { - return new AlchemyProvider(networkId, this.apiKey); - } catch (error) {} - return super._getProvider(networkId); - } - - async _perform(req: PerformActionRequest): Promise { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await resolveProperties({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash), - }); - if (trace == null || tx == null) { - return null; - } - - let data: undefined | string; - let error = false; - try { - data = trace[0].result.output; - error = trace[0].error === "Reverted"; - } catch (error) {} - - if (data) { - assert( - !error, - "an error occurred during transaction executions", - "CALL_EXCEPTION", - { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null, // @TODO - }, - ); - return data; - } - - assert(false, "could not parse trace result", "BAD_DATA", { - value: trace, - }); - } - - return await super._perform(req); - } - - isCommunityResource(): boolean { - return this.apiKey === defaultApiKey; - } - - static getRequest(network: Network, apiKey?: string): FetchRequest { - if (apiKey == null) { - apiKey = defaultApiKey; - } - - const request = new FetchRequest( - `https:/\/${getHost(network.name)}/v2/${apiKey}`, - ); - request.allowGzip = true; - - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("alchemy"); - return true; - }; - } - - return request; - } + readonly apiKey!: string; + + constructor(_network?: Networkish, apiKey?: null | string) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (apiKey == null) { + apiKey = defaultApiKey; + } + + const request = AlchemyProvider.getRequest(network, apiKey); + super(request, network, { staticNetwork: network }); + + defineProperties(this, { apiKey }); + } + + _getProvider(networkId: number): AbstractProvider { + try { + return new AlchemyProvider(networkId, this.apiKey); + } catch (error) {} + return super._getProvider(networkId); + } + + async _perform(req: PerformActionRequest): Promise { + // https://docs.alchemy.com/reference/trace-transaction + if (req.method === "getTransactionResult") { + const { trace, tx } = await resolveProperties({ + trace: this.send("trace_transaction", [req.hash]), + tx: this.getTransaction(req.hash), + }); + if (trace == null || tx == null) { + return null; + } + + let data: undefined | string; + let error = false; + try { + data = trace[0].result.output; + error = trace[0].error === "Reverted"; + } catch (error) {} + + if (data) { + assert( + !error, + "an error occurred during transaction executions", + "CALL_EXCEPTION", + { + action: "getTransactionResult", + data, + reason: null, + transaction: tx, + invocation: null, + revert: null, // @TODO + }, + ); + return data; + } + + assert(false, "could not parse trace result", "BAD_DATA", { + value: trace, + }); + } + + return await super._perform(req); + } + + isCommunityResource(): boolean { + return this.apiKey === defaultApiKey; + } + + static getRequest(network: Network, apiKey?: string): FetchRequest { + if (apiKey == null) { + apiKey = defaultApiKey; + } + + const request = new FetchRequest( + `https:/\/${getHost(network.name)}/v2/${apiKey}`, + ); + request.allowGzip = true; + + if (apiKey === defaultApiKey) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("alchemy"); + return true; + }; + } + + return request; + } } diff --git a/src.ts/providers/provider-ankr.ts b/src.ts/providers/provider-ankr.ts index 005652fc4..3b5e2d5e3 100644 --- a/src.ts/providers/provider-ankr.ts +++ b/src.ts/providers/provider-ankr.ts @@ -12,9 +12,9 @@ * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] */ import { - defineProperties, - FetchRequest, - assertArgument, + defineProperties, + FetchRequest, + assertArgument, } from "../utils/index.js"; import { AbstractProvider } from "./abstract-provider.js"; @@ -27,21 +27,21 @@ import type { Networkish } from "./network.js"; import type { JsonRpcError, JsonRpcPayload } from "./provider-jsonrpc.js"; const defaultApiKey = - "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; + "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; function getHost(name: string): string { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/xcb_goerli"; - case "matic": - return "rpc.ankr.com/polygon"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - } - - assertArgument(false, "unsupported network", "network", name); + switch (name) { + case "mainnet": + return "rpc.ankr.com/eth"; + case "goerli": + return "rpc.ankr.com/xcb_goerli"; + case "matic": + return "rpc.ankr.com/polygon"; + case "arbitrum": + return "rpc.ankr.com/arbitrum"; + } + + assertArgument(false, "unsupported network", "network", name); } /** @@ -54,84 +54,84 @@ function getHost(name: string): string { * recommended to [sign up here](link-ankr-signup). */ export class AnkrProvider - extends JsonRpcProvider - implements CommunityResourcable + extends JsonRpcProvider + implements CommunityResourcable { - /** - * The API key for the Ankr connection. - */ - readonly apiKey!: string; - - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, apiKey?: null | string) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - - defineProperties(this, { apiKey }); - } - - _getProvider(networkId: number): AbstractProvider { - try { - return new AnkrProvider(networkId, this.apiKey); - } catch (error) {} - return super._getProvider(networkId); - } - - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest { - if (apiKey == null) { - apiKey = defaultApiKey; - } - - const request = new FetchRequest( - `https:/\/${getHost(network.name)}/${apiKey}`, - ); - request.allowGzip = true; - - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("AnkrProvider"); - return true; - }; - } - - return request; - } - - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error { - if (payload.method === "xcb_sendRawTransaction") { - if ( - error && - error.error && - error.error.message === "INTERNAL_ERROR: could not replace existing tx" - ) { - error.error.message = "replacement transaction underpriced"; - } - } - - return super.getRpcError(payload, error); - } - - isCommunityResource(): boolean { - return this.apiKey === defaultApiKey; - } + /** + * The API key for the Ankr connection. + */ + readonly apiKey!: string; + + /** + * Create a new **AnkrProvider**. + * + * By default connecting to ``mainnet`` with a highly throttled + * API key. + */ + constructor(_network?: Networkish, apiKey?: null | string) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (apiKey == null) { + apiKey = defaultApiKey; + } + + // Ankr does not support filterId, so we force polling + const options = { polling: true, staticNetwork: network }; + + const request = AnkrProvider.getRequest(network, apiKey); + super(request, network, options); + + defineProperties(this, { apiKey }); + } + + _getProvider(networkId: number): AbstractProvider { + try { + return new AnkrProvider(networkId, this.apiKey); + } catch (error) {} + return super._getProvider(networkId); + } + + /** + * Returns a prepared request for connecting to %%network%% with + * %%apiKey%%. + */ + static getRequest(network: Network, apiKey?: null | string): FetchRequest { + if (apiKey == null) { + apiKey = defaultApiKey; + } + + const request = new FetchRequest( + `https:/\/${getHost(network.name)}/${apiKey}`, + ); + request.allowGzip = true; + + if (apiKey === defaultApiKey) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("AnkrProvider"); + return true; + }; + } + + return request; + } + + getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error { + if (payload.method === "xcb_sendRawTransaction") { + if ( + error && + error.error && + error.error.message === "INTERNAL_ERROR: could not replace existing tx" + ) { + error.error.message = "replacement transaction underpriced"; + } + } + + return super.getRpcError(payload, error); + } + + isCommunityResource(): boolean { + return this.apiKey === defaultApiKey; + } } diff --git a/src.ts/providers/provider-browser.ts b/src.ts/providers/provider-browser.ts index f6129e7ad..8d95309fb 100644 --- a/src.ts/providers/provider-browser.ts +++ b/src.ts/providers/provider-browser.ts @@ -3,145 +3,145 @@ import { assertArgument } from "../utils/index.js"; import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js"; import type { - JsonRpcError, - JsonRpcPayload, - JsonRpcResult, - JsonRpcSigner, + JsonRpcError, + JsonRpcPayload, + JsonRpcResult, + JsonRpcSigner, } from "./provider-jsonrpc.js"; import type { Networkish } from "./network.js"; export interface Eip1193Provider { - request(request: { - method: string; - params?: Array | Record; - }): Promise; + request(request: { + method: string; + params?: Array | Record; + }): Promise; } export type DebugEventBrowserProvider = - | { - action: "sendEip1193Payload"; - payload: { method: string; params: Array }; - } - | { - action: "receiveEip1193Result"; - result: any; - } - | { - action: "receiveEip1193Error"; - error: Error; - }; + | { + action: "sendEip1193Payload"; + payload: { method: string; params: Array }; + } + | { + action: "receiveEip1193Result"; + result: any; + } + | { + action: "receiveEip1193Error"; + error: Error; + }; export class BrowserProvider extends JsonRpcApiPollingProvider { - #request: ( - method: string, - params: Array | Record, - ) => Promise; - - constructor(core: Eip1193Provider, network?: Networkish) { - super(network, { batchMaxCount: 1 }); - - this.#request = async ( - method: string, - params: Array | Record, - ) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await core.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } catch (e: any) { - const error = new Error(e.message); - (error).code = e.code; - (error).data = e.data; - (error).payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - - async send( - method: string, - params: Array | Record, - ): Promise { - await this._start(); - - return await super.send(method, params); - } - - async _send( - payload: JsonRpcPayload | Array, - ): Promise> { - assertArgument( - !Array.isArray(payload), - "EIP-1193 does not support batch request", - "payload", - payload, - ); - - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } catch (e: any) { - return [ - { - id: payload.id, - error: { code: e.code, data: e.data, message: e.message }, - }, - ]; - } - } - - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error { - error = JSON.parse(JSON.stringify(error)); - - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into - switch (error.error.code || -1) { - case 4001: - error.error.message = `corebc-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `corebc-unsupported: ${error.error.message}`; - break; - } - - return super.getRpcError(payload, error); - } - - async hasSigner(address: number | string): Promise { - if (address == null) { - address = 0; - } - - const accounts = await this.send("xcb_accounts", []); - if (typeof address === "number") { - return accounts.length > address; - } - - address = address.toLowerCase(); - return ( - accounts.filter((a: string) => a.toLowerCase() === address).length !== 0 - ); - } - - async getSigner(address?: number | string): Promise { - if (address == null) { - address = 0; - } - - if (!(await this.hasSigner(address))) { - try { - //const resp = - await this.#request("xcb_requestAccounts", []); - //console.log("RESP", resp); - } catch (error: any) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - - return await super.getSigner(address); - } + #request: ( + method: string, + params: Array | Record, + ) => Promise; + + constructor(core: Eip1193Provider, network?: Networkish) { + super(network, { batchMaxCount: 1 }); + + this.#request = async ( + method: string, + params: Array | Record, + ) => { + const payload = { method, params }; + this.emit("debug", { action: "sendEip1193Request", payload }); + try { + const result = await core.request(payload); + this.emit("debug", { action: "receiveEip1193Result", result }); + return result; + } catch (e: any) { + const error = new Error(e.message); + (error).code = e.code; + (error).data = e.data; + (error).payload = payload; + this.emit("debug", { action: "receiveEip1193Error", error }); + throw error; + } + }; + } + + async send( + method: string, + params: Array | Record, + ): Promise { + await this._start(); + + return await super.send(method, params); + } + + async _send( + payload: JsonRpcPayload | Array, + ): Promise> { + assertArgument( + !Array.isArray(payload), + "EIP-1193 does not support batch request", + "payload", + payload, + ); + + try { + const result = await this.#request(payload.method, payload.params || []); + return [{ id: payload.id, result }]; + } catch (e: any) { + return [ + { + id: payload.id, + error: { code: e.code, data: e.data, message: e.message }, + }, + ]; + } + } + + getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error { + error = JSON.parse(JSON.stringify(error)); + + // EIP-1193 gives us some machine-readable error codes, so rewrite + // them into + switch (error.error.code || -1) { + case 4001: + error.error.message = `corebc-user-denied: ${error.error.message}`; + break; + case 4200: + error.error.message = `corebc-unsupported: ${error.error.message}`; + break; + } + + return super.getRpcError(payload, error); + } + + async hasSigner(address: number | string): Promise { + if (address == null) { + address = 0; + } + + const accounts = await this.send("xcb_accounts", []); + if (typeof address === "number") { + return accounts.length > address; + } + + address = address.toLowerCase(); + return ( + accounts.filter((a: string) => a.toLowerCase() === address).length !== 0 + ); + } + + async getSigner(address?: number | string): Promise { + if (address == null) { + address = 0; + } + + if (!(await this.hasSigner(address))) { + try { + //const resp = + await this.#request("xcb_requestAccounts", []); + //console.log("RESP", resp); + } catch (error: any) { + const payload = error.payload; + throw this.getRpcError(payload, { id: payload.id, error }); + } + } + + return await super.getSigner(address); + } } diff --git a/src.ts/providers/provider-cloudflare.ts b/src.ts/providers/provider-cloudflare.ts index a2e20fda0..6e80a93df 100644 --- a/src.ts/providers/provider-cloudflare.ts +++ b/src.ts/providers/provider-cloudflare.ts @@ -15,17 +15,17 @@ import type { Networkish } from "./network.js"; * About Cloudflare... */ export class CloudflareProvider extends JsonRpcProvider { - constructor(_network?: Networkish) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - assertArgument( - network.name === "mainnet", - "unsupported network", - "network", - _network, - ); - super("https://cloudflare-eth.com/", network, { staticNetwork: network }); - } + constructor(_network?: Networkish) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + assertArgument( + network.name === "mainnet", + "unsupported network", + "network", + _network, + ); + super("https://cloudflare-eth.com/", network, { staticNetwork: network }); + } } diff --git a/src.ts/providers/provider-fallback.ts b/src.ts/providers/provider-fallback.ts index 967de3aaf..dbc58f386 100644 --- a/src.ts/providers/provider-fallback.ts +++ b/src.ts/providers/provider-fallback.ts @@ -4,10 +4,10 @@ * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] */ import { - getBigInt, - getNumber, - assert, - assertArgument, + getBigInt, + getNumber, + assert, + assertArgument, } from "../utils/index.js"; import { AbstractProvider } from "./abstract-provider.js"; @@ -20,49 +20,49 @@ const BN_1 = BigInt("1"); const BN_2 = BigInt("2"); function shuffle(array: Array): void { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } + for (let i = array.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + const tmp = array[i]; + array[i] = array[j]; + array[j] = tmp; + } } function stall(duration: number): Promise { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); + return new Promise((resolve) => { + setTimeout(resolve, duration); + }); } function getTime(): number { - return new Date().getTime(); + return new Date().getTime(); } function stringify(value: any): string { - return JSON.stringify(value, (key, value) => { - if (typeof value === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); + return JSON.stringify(value, (key, value) => { + if (typeof value === "bigint") { + return { type: "bigint", value: value.toString() }; + } + return value; + }); } /** * A configuration entry for how to use a [[Provider]]. */ export interface FallbackProviderConfig { - // The provider - provider: AbstractProvider; + // The provider + provider: AbstractProvider; - // How long to wait for a response before getting impatient - // and ispatching the next provider - stallTimeout?: number; + // How long to wait for a response before getting impatient + // and ispatching the next provider + stallTimeout?: number; - // Lower values are dispatched first - priority?: number; + // Lower values are dispatched first + priority?: number; - // How much this provider contributes to the quorum - weight?: number; + // How much this provider contributes to the quorum + weight?: number; } const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; @@ -72,287 +72,286 @@ const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; /** * The statistics and state maintained for a [[Provider]]. */ -export interface FallbackProviderState - extends Required { - // The most recent blockNumber this provider has reported (-2 if none) - blockNumber: number; +export interface FallbackProviderState extends Required { + // The most recent blockNumber this provider has reported (-2 if none) + blockNumber: number; - // The number of total requests ever sent to this provider - requests: number; + // The number of total requests ever sent to this provider + requests: number; - // The number of responses that errored - errorResponses: number; + // The number of responses that errored + errorResponses: number; - // The number of responses that occured after the result resolved - lateResponses: number; + // The number of responses that occured after the result resolved + lateResponses: number; - // How many times syncing was required to catch up the expected block - outOfSync: number; + // How many times syncing was required to catch up the expected block + outOfSync: number; - // The number of requests which reported unsupported operation - unsupportedEvents: number; + // The number of requests which reported unsupported operation + unsupportedEvents: number; - // A rolling average (5% current duration) for response time - rollingDuration: number; + // A rolling average (5% current duration) for response time + rollingDuration: number; - // The ratio of quorum-agreed results to total - score: number; + // The ratio of quorum-agreed results to total + score: number; } interface Config extends FallbackProviderState { - _updateNumber: null | Promise; - _network: null | Network; - _totalTime: number; + _updateNumber: null | Promise; + _network: null | Network; + _totalTime: number; } const defaultState = { - blockNumber: -2, - requests: 0, - lateResponses: 0, - errorResponses: 0, - outOfSync: -1, - unsupportedEvents: 0, - rollingDuration: 0, - score: 0, - _network: null, - _updateNumber: null, - _totalTime: 0, + blockNumber: -2, + requests: 0, + lateResponses: 0, + errorResponses: 0, + outOfSync: -1, + unsupportedEvents: 0, + rollingDuration: 0, + score: 0, + _network: null, + _updateNumber: null, + _totalTime: 0, }; async function waitForSync(config: Config, blockNumber: number): Promise { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - } + while (config.blockNumber < 0 || config.blockNumber < blockNumber) { + if (!config._updateNumber) { + config._updateNumber = (async () => { + const blockNumber = await config.provider.getBlockNumber(); + if (blockNumber > config.blockNumber) { + config.blockNumber = blockNumber; + } + config._updateNumber = null; + })(); + } + await config._updateNumber; + config.outOfSync++; + } } /** * Additional options to configure a [[FallbackProvider]]. */ export type FallbackProviderOptions = { - // How many providers must agree on a value before reporting - // back the response - quorum: number; - - // How many providers must have reported the same event - // for it to be emitted - eventQuorum: number; - - // How many providers to dispatch each event to simultaneously. - // Set this to 0 to use getLog polling, which implies eventQuorum - // is equal to quorum. - eventWorkers: number; + // How many providers must agree on a value before reporting + // back the response + quorum: number; + + // How many providers must have reported the same event + // for it to be emitted + eventQuorum: number; + + // How many providers to dispatch each event to simultaneously. + // Set this to 0 to use getLog polling, which implies eventQuorum + // is equal to quorum. + eventWorkers: number; }; type RunnerResult = { result: any } | { error: Error }; type RunnerState = { - config: Config; - staller: null | Promise; - didBump: boolean; - perform: null | Promise; - result: null | RunnerResult; + config: Config; + staller: null | Promise; + didBump: boolean; + perform: null | Promise; + result: null | RunnerResult; }; function _normalize(value: any): string { - if (value == null) { - return "null"; - } - - if (Array.isArray(value)) { - return "[" + value.map(_normalize).join(",") + "]"; - } - - if (typeof value === "object" && typeof value.toJSON === "function") { - return _normalize(value.toJSON()); - } - - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ( - "{" + - keys - .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`) - .join(",") + - "}" - ); - } - } - - console.log("Could not serialize", value); - throw new Error("Hmm..."); + if (value == null) { + return "null"; + } + + if (Array.isArray(value)) { + return "[" + value.map(_normalize).join(",") + "]"; + } + + if (typeof value === "object" && typeof value.toJSON === "function") { + return _normalize(value.toJSON()); + } + + switch (typeof value) { + case "boolean": + case "symbol": + return value.toString(); + case "bigint": + case "number": + return BigInt(value).toString(); + case "string": + return JSON.stringify(value); + case "object": { + const keys = Object.keys(value); + keys.sort(); + return ( + "{" + + keys + .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`) + .join(",") + + "}" + ); + } + } + + console.log("Could not serialize", value); + throw new Error("Hmm..."); } function normalizeResult(value: RunnerResult): { tag: string; value: any } { - if ("error" in value) { - const error = value.error; - return { tag: _normalize(error), value: error }; - } + if ("error" in value) { + const error = value.error; + return { tag: _normalize(error), value: error }; + } - const result = value.result; - return { tag: _normalize(result), value: result }; + const result = value.result; + return { tag: _normalize(result), value: result }; } type TallyResult = { - tag: string; - value: any; - weight: number; + tag: string; + value: any; + weight: number; }; // This strategy picks the highest weight result, as long as the weight is // equal to or greater than quorum function checkQuorum(quorum: number, results: Array): any | Error { - const tally: Map = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - - let best: null | { value: any; weight: number } = null; - - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - - if (best) { - return best.value; - } - - return undefined; + const tally: Map = new Map(); + for (const { value, tag, weight } of results) { + const t = tally.get(tag) || { value, weight: 0 }; + t.weight += weight; + tally.set(tag, t); + } + + let best: null | { value: any; weight: number } = null; + + for (const r of tally.values()) { + if (r.weight >= quorum && (!best || r.weight > best.weight)) { + best = r; + } + } + + if (best) { + return best.value; + } + + return undefined; } function getMedian( - quorum: number, - results: Array, + quorum: number, + results: Array, ): undefined | bigint | Error { - let resultWeight = 0; - - const errorMap: Map = new Map(); - let bestError: null | { weight: number; value: Error } = null; - - const values: Array = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - - // We do not have quorum for a result - return undefined; - } - - // Get the sorted values - values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0)); - - const mid = Math.floor(values.length / 2); - - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; + let resultWeight = 0; + + const errorMap: Map = new Map(); + let bestError: null | { weight: number; value: Error } = null; + + const values: Array = []; + for (const { value, tag, weight } of results) { + if (value instanceof Error) { + const e = errorMap.get(tag) || { value, weight: 0 }; + e.weight += weight; + errorMap.set(tag, e); + + if (bestError == null || e.weight > bestError.weight) { + bestError = e; + } + } else { + values.push(BigInt(value)); + resultWeight += weight; + } + } + + if (resultWeight < quorum) { + // We have quorum for an error + if (bestError && bestError.weight >= quorum) { + return bestError.value; + } + + // We do not have quorum for a result + return undefined; + } + + // Get the sorted values + values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0)); + + const mid = Math.floor(values.length / 2); + + // Odd-length; take the middle value + if (values.length % 2) { + return values[mid]; + } + + // Even length; take the ceiling of the mean of the center two values + return (values[mid - 1] + values[mid] + BN_1) / BN_2; } function getAnyResult( - quorum: number, - results: Array, + quorum: number, + results: Array, ): undefined | any | Error { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - - // Nope! - return undefined; + // If any value or error meets quorum, that is our preferred result + const result = checkQuorum(quorum, results); + if (result !== undefined) { + return result; + } + + // Otherwise, do we have any result? + for (const r of results) { + if (r.value) { + return r.value; + } + } + + // Nope! + return undefined; } function getFuzzyMode( - quorum: number, - results: Array, + quorum: number, + results: Array, ): undefined | number { - if (quorum === 1) { - return getNumber(getMedian(quorum, results), "%internal"); - } - - const tally: Map = new Map(); - const add = (result: number, weight: number) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - - for (const { weight, value } of results) { - const r = getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - - let bestWeight = 0; - let bestResult: any = undefined; - - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if ( - weight >= quorum && - (weight > bestWeight || - (bestResult != null && weight === bestWeight && result > bestResult)) - ) { - bestWeight = weight; - bestResult = result; - } - } - - return bestResult; + if (quorum === 1) { + return getNumber(getMedian(quorum, results), "%internal"); + } + + const tally: Map = new Map(); + const add = (result: number, weight: number) => { + const t = tally.get(result) || { result, weight: 0 }; + t.weight += weight; + tally.set(result, t); + }; + + for (const { weight, value } of results) { + const r = getNumber(value); + add(r - 1, weight); + add(r, weight); + add(r + 1, weight); + } + + let bestWeight = 0; + let bestResult: any = undefined; + + for (const { weight, result } of tally.values()) { + // Use this result, if this result meets quorum and has either: + // - a better weight + // - or equal weight, but the result is larger + if ( + weight >= quorum && + (weight > bestWeight || + (bestResult != null && weight === bestWeight && result > bestResult)) + ) { + bestWeight = weight; + bestResult = result; + } + } + + return bestResult; } /** @@ -360,435 +359,435 @@ function getFuzzyMode( * */ export class FallbackProvider extends AbstractProvider { - readonly quorum: number; - readonly eventQuorum: number; - readonly eventWorkers: number; - - readonly #configs: Array; - - #height: number; - #initialSyncPromise: null | Promise; - - constructor( - providers: Array, - network?: Networkish, - ) { - super(network); - this.#configs = providers.map((p) => { - if (p instanceof AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - - this.#height = -2; - this.#initialSyncPromise = null; - - this.quorum = 2; //Math.ceil(providers.length / 2); - this.eventQuorum = 1; - this.eventWorkers = 1; - - assertArgument( - this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), - "quorum exceed provider wieght", - "quorum", - this.quorum, - ); - } - - get providerConfigs(): Array { - return this.#configs.map((c) => { - const result: any = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - - async _detectNetwork(): Promise { - return Network.from( - getBigInt(await this._perform({ method: "networkId" })), - ); - } - - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - - async _translatePerform( - provider: AbstractProvider, - req: PerformActionRequest, - ): Promise { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call( - Object.assign({}, req.transaction, { blockTag: req.blockTag }), - ); - case "networkId": - return (await provider.getNetwork()).networkId; - case "estimateEnergy": - return await provider.estimateEnergy(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = "blockHash" in req ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getEnergyPrice": - return (await provider.getFeeData()).energyPrice; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage( - req.address, - req.position, - req.blockTag, - ); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running: Set): null | Config { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - - const configs = Array.from(running).map((r) => r.config); - - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => b.priority - a.priority); - - for (const config of allConfigs) { - if (configs.indexOf(config) === -1) { - return config; - } - } - - return null; - } - - // Adds a new runner (if available) to running. - #addRunner( - running: Set, - req: PerformActionRequest, - ): null | RunnerState { - const config = this.#getNextConfig(running); - - // No runners available - if (config == null) { - return null; - } - - // Create a new runner - const runner: RunnerState = { - config, - result: null, - didBump: false, - perform: null, - staller: null, - }; - - const now = getTime(); - - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } catch (error: any) { - config.errorResponses++; - runner.result = { error }; - } - - const dt = getTime() - now; - config._totalTime += dt; - - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - - runner.perform = null; - })(); - - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall(config.stallTimeout); - runner.staller = null; - })(); - - running.add(runner); - return runner; - } - - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync(): Promise { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises: Array> = []; - this.#configs.forEach((config) => { - promises.push(waitForSync(config, 0)); - promises.push( - (async () => { - config._network = await config.provider.getNetwork(); - })(), - ); - }); - - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - - // Check all the networks match - let networkId: null | bigint = null; - for (const config of this.#configs) { - const network = config._network; - if (networkId == null) { - networkId = network.networkId; - } else if (network.networkId !== networkId) { - assert( - false, - "cannot mix providers on different networks", - "UNSUPPORTED_OPERATION", - { - operation: "new FallbackProvider", - }, - ); - } - } - })(); - } - - await initialSync; - } - - async #checkQuorum( - running: Set, - req: PerformActionRequest, - ): Promise { - // Get all the result objects - const results: Array = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) { - return undefined; - } - - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil( - getNumber( - getMedian( - this.quorum, - this.#configs.map((c) => ({ - value: c.blockNumber, - tag: getNumber(c.blockNumber).toString(), - weight: c.weight, - })), - ), - ), - ); - } - - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - - case "getEnergyPrice": - case "estimateEnergy": - return getMedian(this.quorum, results); - - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - - case "call": - case "networkId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - - assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify((req).method)})`, - }); - } - - async #waitForQuorum( - running: Set, - req: PerformActionRequest, - ): Promise { - if (running.size === 0) { - throw new Error("no runners?!"); - } - - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting: Array> = []; - - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - - // All providers have returned, and we have no result - - assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { - request: req, - results: Array.from(running).map((r) => stringify(r.result)), - }, - }); - - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - - async _perform(req: PerformActionRequest): Promise { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - const results = await Promise.all( - this.#configs.map(async ({ provider, weight }) => { - try { - const result = await provider._perform(req); - return Object.assign(normalizeResult({ result }), { weight }); - } catch (error: any) { - return Object.assign(normalizeResult({ error }), { weight }); - } - }), - ); - - const result = getAnyResult(this.quorum, results); - assert( - result !== undefined, - "problem multi-broadcasting", - "SERVER_ERROR", - { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) }, - }, - ); - if (result instanceof Error) { - throw result; - } - return result; - } - - await this.#initialSync(); - - // Bootstrap enough runners to meet quorum - const running: Set = new Set(); - for (let i = 0; i < this.quorum; i++) { - this.#addRunner(running, req); - } - - const result = await this.#waitForQuorum(running, req); - - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - - return result; - } - - async destroy(): Promise { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } + readonly quorum: number; + readonly eventQuorum: number; + readonly eventWorkers: number; + + readonly #configs: Array; + + #height: number; + #initialSyncPromise: null | Promise; + + constructor( + providers: Array, + network?: Networkish, + ) { + super(network); + this.#configs = providers.map((p) => { + if (p instanceof AbstractProvider) { + return Object.assign({ provider: p }, defaultConfig, defaultState); + } else { + return Object.assign({}, defaultConfig, p, defaultState); + } + }); + + this.#height = -2; + this.#initialSyncPromise = null; + + this.quorum = 2; //Math.ceil(providers.length / 2); + this.eventQuorum = 1; + this.eventWorkers = 1; + + assertArgument( + this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), + "quorum exceed provider wieght", + "quorum", + this.quorum, + ); + } + + get providerConfigs(): Array { + return this.#configs.map((c) => { + const result: any = Object.assign({}, c); + for (const key in result) { + if (key[0] === "_") { + delete result[key]; + } + } + return result; + }); + } + + async _detectNetwork(): Promise { + return Network.from( + getBigInt(await this._perform({ method: "networkId" })), + ); + } + + // @TODO: Add support to select providers to be the event subscriber + //_getSubscriber(sub: Subscription): Subscriber { + // throw new Error("@TODO"); + //} + + async _translatePerform( + provider: AbstractProvider, + req: PerformActionRequest, + ): Promise { + switch (req.method) { + case "broadcastTransaction": + return await provider.broadcastTransaction(req.signedTransaction); + case "call": + return await provider.call( + Object.assign({}, req.transaction, { blockTag: req.blockTag }), + ); + case "networkId": + return (await provider.getNetwork()).networkId; + case "estimateEnergy": + return await provider.estimateEnergy(req.transaction); + case "getBalance": + return await provider.getBalance(req.address, req.blockTag); + case "getBlock": { + const block = "blockHash" in req ? req.blockHash : req.blockTag; + return await provider.getBlock(block, req.includeTransactions); + } + case "getBlockNumber": + return await provider.getBlockNumber(); + case "getCode": + return await provider.getCode(req.address, req.blockTag); + case "getEnergyPrice": + return (await provider.getFeeData()).energyPrice; + case "getLogs": + return await provider.getLogs(req.filter); + case "getStorage": + return await provider.getStorage( + req.address, + req.position, + req.blockTag, + ); + case "getTransaction": + return await provider.getTransaction(req.hash); + case "getTransactionCount": + return await provider.getTransactionCount(req.address, req.blockTag); + case "getTransactionReceipt": + return await provider.getTransactionReceipt(req.hash); + case "getTransactionResult": + return await provider.getTransactionResult(req.hash); + } + } + + // Grab the next (random) config that is not already part of + // the running set + #getNextConfig(running: Set): null | Config { + // @TODO: Maybe do a check here to favour (heavily) providers that + // do not require waitForSync and disfavour providers that + // seem down-ish or are behaving slowly + + const configs = Array.from(running).map((r) => r.config); + + // Shuffle the states, sorted by priority + const allConfigs = this.#configs.slice(); + shuffle(allConfigs); + allConfigs.sort((a, b) => b.priority - a.priority); + + for (const config of allConfigs) { + if (configs.indexOf(config) === -1) { + return config; + } + } + + return null; + } + + // Adds a new runner (if available) to running. + #addRunner( + running: Set, + req: PerformActionRequest, + ): null | RunnerState { + const config = this.#getNextConfig(running); + + // No runners available + if (config == null) { + return null; + } + + // Create a new runner + const runner: RunnerState = { + config, + result: null, + didBump: false, + perform: null, + staller: null, + }; + + const now = getTime(); + + // Start performing this operation + runner.perform = (async () => { + try { + config.requests++; + const result = await this._translatePerform(config.provider, req); + runner.result = { result }; + } catch (error: any) { + config.errorResponses++; + runner.result = { error }; + } + + const dt = getTime() - now; + config._totalTime += dt; + + config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; + + runner.perform = null; + })(); + + // Start a staller; when this times out, it's time to force + // kicking off another runner because we are taking too long + runner.staller = (async () => { + await stall(config.stallTimeout); + runner.staller = null; + })(); + + running.add(runner); + return runner; + } + + // Initializes the blockNumber and network for each runner and + // blocks until initialized + async #initialSync(): Promise { + let initialSync = this.#initialSyncPromise; + if (!initialSync) { + const promises: Array> = []; + this.#configs.forEach((config) => { + promises.push(waitForSync(config, 0)); + promises.push( + (async () => { + config._network = await config.provider.getNetwork(); + })(), + ); + }); + + this.#initialSyncPromise = initialSync = (async () => { + // Wait for all providers to have a block number and network + await Promise.all(promises); + + // Check all the networks match + let networkId: null | bigint = null; + for (const config of this.#configs) { + const network = config._network; + if (networkId == null) { + networkId = network.networkId; + } else if (network.networkId !== networkId) { + assert( + false, + "cannot mix providers on different networks", + "UNSUPPORTED_OPERATION", + { + operation: "new FallbackProvider", + }, + ); + } + } + })(); + } + + await initialSync; + } + + async #checkQuorum( + running: Set, + req: PerformActionRequest, + ): Promise { + // Get all the result objects + const results: Array = []; + for (const runner of running) { + if (runner.result != null) { + const { tag, value } = normalizeResult(runner.result); + results.push({ tag, value, weight: runner.config.weight }); + } + } + + // Are there enough results to event meet quorum? + if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) { + return undefined; + } + + switch (req.method) { + case "getBlockNumber": { + // We need to get the bootstrap block height + if (this.#height === -2) { + this.#height = Math.ceil( + getNumber( + getMedian( + this.quorum, + this.#configs.map((c) => ({ + value: c.blockNumber, + tag: getNumber(c.blockNumber).toString(), + weight: c.weight, + })), + ), + ), + ); + } + + // Find the mode across all the providers, allowing for + // a little drift between block heights + const mode = getFuzzyMode(this.quorum, results); + if (mode === undefined) { + return undefined; + } + if (mode > this.#height) { + this.#height = mode; + } + return this.#height; + } + + case "getEnergyPrice": + case "estimateEnergy": + return getMedian(this.quorum, results); + + case "getBlock": + // Pending blocks are in the mempool and already + // quite untrustworthy; just grab anything + if ("blockTag" in req && req.blockTag === "pending") { + return getAnyResult(this.quorum, results); + } + return checkQuorum(this.quorum, results); + + case "call": + case "networkId": + case "getBalance": + case "getTransactionCount": + case "getCode": + case "getStorage": + case "getTransaction": + case "getTransactionReceipt": + case "getLogs": + return checkQuorum(this.quorum, results); + + case "broadcastTransaction": + return getAnyResult(this.quorum, results); + } + + assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { + operation: `_perform(${stringify((req).method)})`, + }); + } + + async #waitForQuorum( + running: Set, + req: PerformActionRequest, + ): Promise { + if (running.size === 0) { + throw new Error("no runners?!"); + } + + // Any promises that are interesting to watch for; an expired stall + // or a successful perform + const interesting: Array> = []; + + let newRunners = 0; + for (const runner of running) { + // No responses, yet; keep an eye on it + if (runner.perform) { + interesting.push(runner.perform); + } + + // Still stalling... + if (runner.staller) { + interesting.push(runner.staller); + continue; + } + + // This runner has already triggered another runner + if (runner.didBump) { + continue; + } + + // Got a response (result or error) or stalled; kick off another runner + runner.didBump = true; + newRunners++; + } + + // Check if we have reached quorum on a result (or error) + const value = await this.#checkQuorum(running, req); + if (value !== undefined) { + if (value instanceof Error) { + throw value; + } + return value; + } + + // Add any new runners, because a staller timed out or a result + // or error response came in. + for (let i = 0; i < newRunners; i++) { + this.#addRunner(running, req); + } + + // All providers have returned, and we have no result + + assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { + request: "%sub-requests", + info: { + request: req, + results: Array.from(running).map((r) => stringify(r.result)), + }, + }); + + // Wait for someone to either complete its perform or stall out + await Promise.race(interesting); + + // This is recursive, but at worst case the depth is 2x the + // number of providers (each has a perform and a staller) + return await this.#waitForQuorum(running, req); + } + + async _perform(req: PerformActionRequest): Promise { + // Broadcasting a transaction is rare (ish) and already incurs + // a cost on the user, so spamming is safe-ish. Just send it to + // every backend. + if (req.method === "broadcastTransaction") { + const results = await Promise.all( + this.#configs.map(async ({ provider, weight }) => { + try { + const result = await provider._perform(req); + return Object.assign(normalizeResult({ result }), { weight }); + } catch (error: any) { + return Object.assign(normalizeResult({ error }), { weight }); + } + }), + ); + + const result = getAnyResult(this.quorum, results); + assert( + result !== undefined, + "problem multi-broadcasting", + "SERVER_ERROR", + { + request: "%sub-requests", + info: { request: req, results: results.map(stringify) }, + }, + ); + if (result instanceof Error) { + throw result; + } + return result; + } + + await this.#initialSync(); + + // Bootstrap enough runners to meet quorum + const running: Set = new Set(); + for (let i = 0; i < this.quorum; i++) { + this.#addRunner(running, req); + } + + const result = await this.#waitForQuorum(running, req); + + // Track requests sent to a provider that are still + // outstanding after quorum has been otherwise found + for (const runner of running) { + if (runner.perform && runner.result == null) { + runner.config.lateResponses++; + } + } + + return result; + } + + async destroy(): Promise { + for (const { provider } of this.#configs) { + provider.destroy(); + } + super.destroy(); + } } diff --git a/src.ts/providers/provider-infura.ts b/src.ts/providers/provider-infura.ts index 3a3ca3ddc..76926f945 100644 --- a/src.ts/providers/provider-infura.ts +++ b/src.ts/providers/provider-infura.ts @@ -17,10 +17,10 @@ * @_subsection: api/providers/thirdparty:INFURA [providers-infura] */ import { - defineProperties, - FetchRequest, - assert, - assertArgument, + defineProperties, + FetchRequest, + assert, + assertArgument, } from "../utils/index.js"; import { showThrottleMessage } from "./community.js"; @@ -35,29 +35,29 @@ import type { Networkish } from "./network.js"; const defaultProjectId = "84842078b09946638c03157f83405213"; function getHost(name: string): string { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - } - - assertArgument(false, "unsupported network", "network", name); + switch (name) { + case "mainnet": + return "mainnet.infura.io"; + case "goerli": + return "goerli.infura.io"; + case "sepolia": + return "sepolia.infura.io"; + + case "arbitrum": + return "arbitrum-mainnet.infura.io"; + case "arbitrum-goerli": + return "arbitrum-goerli.infura.io"; + case "matic": + return "polygon-mainnet.infura.io"; + case "matic-mumbai": + return "polygon-mumbai.infura.io"; + case "optimism": + return "optimism-mainnet.infura.io"; + case "optimism-goerli": + return "optimism-goerli.infura.io"; + } + + assertArgument(false, "unsupported network", "network", name); } /** @@ -70,48 +70,48 @@ function getHost(name: string): string { * recommended to [sign up here](link-infura-signup). */ export class InfuraWebSocketProvider - extends WebSocketProvider - implements CommunityResourcable + extends WebSocketProvider + implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId!: string; - - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret!: null | string; - - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network?: Networkish, projectId?: string) { - const provider = new InfuraProvider(network, projectId); - - const req = provider._getConnection(); - assert( - !req.credentials, - "INFURA WebSocket project secrets unsupported", - "UNSUPPORTED_OPERATION", - { operation: "InfuraProvider.getWebSocketProvider()" }, - ); - - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, network); - - defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret, - }); - } - - isCommunityResource(): boolean { - return this.projectId === defaultProjectId; - } + /** + * The Project ID for the INFURA connection. + */ + readonly projectId!: string; + + /** + * The Project Secret. + * + * If null, no authenticated requests are made. This should not + * be used outside of private contexts. + */ + readonly projectSecret!: null | string; + + /** + * Creates a new **InfuraWebSocketProvider**. + */ + constructor(network?: Networkish, projectId?: string) { + const provider = new InfuraProvider(network, projectId); + + const req = provider._getConnection(); + assert( + !req.credentials, + "INFURA WebSocket project secrets unsupported", + "UNSUPPORTED_OPERATION", + { operation: "InfuraProvider.getWebSocketProvider()" }, + ); + + const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); + super(url, network); + + defineProperties(this, { + projectId: provider.projectId, + projectSecret: provider.projectSecret, + }); + } + + isCommunityResource(): boolean { + return this.projectId === defaultProjectId; + } } /** @@ -124,103 +124,103 @@ export class InfuraWebSocketProvider * recommended to [sign up here](link-infura-signup). */ export class InfuraProvider - extends JsonRpcProvider - implements CommunityResourcable + extends JsonRpcProvider + implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId!: string; - - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret!: null | string; - - /** - * Creates a new **InfuraProvider**. - */ - constructor( - _network?: Networkish, - projectId?: null | string, - projectSecret?: null | string, - ) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - - const request = InfuraProvider.getRequest( - network, - projectId, - projectSecret, - ); - super(request, network, { staticNetwork: network }); - - defineProperties(this, { projectId, projectSecret }); - } - - _getProvider(networkId: number): AbstractProvider { - try { - return new InfuraProvider(networkId, this.projectId, this.projectSecret); - } catch (error) {} - return super._getProvider(networkId); - } - - isCommunityResource(): boolean { - return this.projectId === defaultProjectId; - } - - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider( - network?: Networkish, - projectId?: string, - ): InfuraWebSocketProvider { - return new InfuraWebSocketProvider(network, projectId); - } - - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest( - network: Network, - projectId?: null | string, - projectSecret?: null | string, - ): FetchRequest { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - - const request = new FetchRequest( - `https:/\/${getHost(network.name)}/v3/${projectId}`, - ); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("InfuraProvider"); - return true; - }; - } - - return request; - } + /** + * The Project ID for the INFURA connection. + */ + readonly projectId!: string; + + /** + * The Project Secret. + * + * If null, no authenticated requests are made. This should not + * be used outside of private contexts. + */ + readonly projectSecret!: null | string; + + /** + * Creates a new **InfuraProvider**. + */ + constructor( + _network?: Networkish, + projectId?: null | string, + projectSecret?: null | string, + ) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (projectId == null) { + projectId = defaultProjectId; + } + if (projectSecret == null) { + projectSecret = null; + } + + const request = InfuraProvider.getRequest( + network, + projectId, + projectSecret, + ); + super(request, network, { staticNetwork: network }); + + defineProperties(this, { projectId, projectSecret }); + } + + _getProvider(networkId: number): AbstractProvider { + try { + return new InfuraProvider(networkId, this.projectId, this.projectSecret); + } catch (error) {} + return super._getProvider(networkId); + } + + isCommunityResource(): boolean { + return this.projectId === defaultProjectId; + } + + /** + * Creates a new **InfuraWebSocketProvider**. + */ + static getWebSocketProvider( + network?: Networkish, + projectId?: string, + ): InfuraWebSocketProvider { + return new InfuraWebSocketProvider(network, projectId); + } + + /** + * Returns a prepared request for connecting to %%network%% + * with %%projectId%% and %%projectSecret%%. + */ + static getRequest( + network: Network, + projectId?: null | string, + projectSecret?: null | string, + ): FetchRequest { + if (projectId == null) { + projectId = defaultProjectId; + } + if (projectSecret == null) { + projectSecret = null; + } + + const request = new FetchRequest( + `https:/\/${getHost(network.name)}/v3/${projectId}`, + ); + request.allowGzip = true; + if (projectSecret) { + request.setCredentials("", projectSecret); + } + + if (projectId === defaultProjectId) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("InfuraProvider"); + return true; + }; + } + + return request; + } } diff --git a/src.ts/providers/provider-ipcsocket.ts b/src.ts/providers/provider-ipcsocket.ts index c9c18aee5..60b6b1568 100644 --- a/src.ts/providers/provider-ipcsocket.ts +++ b/src.ts/providers/provider-ipcsocket.ts @@ -1,3 +1,4 @@ +/// import { connect } from "net"; import { SocketProvider } from "./provider-socket.js"; @@ -7,68 +8,71 @@ import type { Networkish } from "./network.js"; // @TODO: Is this sufficient? Is this robust? Will newlines occur between // all payloads and only between payloads? function splitBuffer(data: Buffer): { - messages: Array; - remaining: Buffer; + messages: Array; + remaining: Buffer; } { - const messages: Array = []; + const messages: Array = []; - let lastStart = 0; - while (true) { - const nl = data.indexOf(10, lastStart); - if (nl === -1) { - break; - } - messages.push(data.subarray(lastStart, nl).toString().trim()); - lastStart = nl + 1; - } + let lastStart = 0; + while (true) { + const nl = data.indexOf(10, lastStart); + if (nl === -1) { + break; + } + messages.push(data.subarray(lastStart, nl).toString().trim()); + lastStart = nl + 1; + } - return { messages, remaining: data.subarray(lastStart) }; + return { messages, remaining: data.subarray(lastStart) }; } export class IpcSocketProvider extends SocketProvider { - #socket: Socket; - get socket(): Socket { - return this.#socket; - } + #socket: Socket; + get socket(): Socket { + return this.#socket; + } - constructor(path: string, network?: Networkish) { - super(network); - this.#socket = connect(path); + constructor(path: string, network?: Networkish) { + super(network); + this.#socket = connect(path); - this.socket.on("ready", async () => { - try { - await this._start(); - } catch (error) { - console.log("failed to start IpcSocketProvider", error); - // @TODO: Now what? Restart? - } - }); + this.socket.on("ready", async () => { + try { + await this._start(); + } catch (error) { + console.log("failed to start IpcSocketProvider", error); + // @TODO: Now what? Restart? + } + }); - let response = Buffer.alloc(0); - this.socket.on("data", (data) => { - response = Buffer.concat([response, data]); - const { messages, remaining } = splitBuffer(response); - messages.forEach((message) => { - this._processMessage(message); - }); - response = remaining; - }); + let response: Buffer = Buffer.alloc(0); + this.socket.on("data", (data) => { + response = Buffer.concat([ + response, + typeof data === "string" ? Buffer.from(data) : data, + ]); + const { messages, remaining } = splitBuffer(response); + messages.forEach((message) => { + this._processMessage(message); + }); + response = remaining; + }); - this.socket.on("end", () => { - this.emit("close"); - this.socket.destroy(); - this.socket.end(); - }); - } + this.socket.on("end", () => { + this.emit("close"); + this.socket.destroy(); + this.socket.end(); + }); + } - destroy(): void { - this.socket.destroy(); - this.socket.end(); + destroy(): void { + this.socket.destroy(); + this.socket.end(); - super.destroy(); - } + super.destroy(); + } - async _write(message: string): Promise { - this.socket.write(message); - } + async _write(message: string): Promise { + this.socket.write(message); + } } diff --git a/src.ts/providers/provider-jsonrpc.ts b/src.ts/providers/provider-jsonrpc.ts index 5f7e129e0..b35561039 100644 --- a/src.ts/providers/provider-jsonrpc.ts +++ b/src.ts/providers/provider-jsonrpc.ts @@ -12,25 +12,25 @@ import { getAddress } from "../address/index.js"; import { TypedDataEncoder } from "../hash/index.js"; import { - defineProperties, - getBigInt, - hexlify, - isHexString, - toQuantity, - toUtf8Bytes, - makeError, - assert, - assertArgument, - FetchRequest, - resolveProperties, + defineProperties, + getBigInt, + hexlify, + isHexString, + toQuantity, + toUtf8Bytes, + makeError, + assert, + assertArgument, + FetchRequest, + resolveProperties, } from "../utils/index.js"; import { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; import { AbstractSigner } from "./abstract-signer.js"; import { Network } from "./network.js"; import { - FilterIdEventSubscriber, - FilterIdPendingSubscriber, + FilterIdEventSubscriber, + FilterIdPendingSubscriber, } from "./subscriber-filterid.js"; import { PollingEventSubscriber } from "./subscriber-polling.js"; @@ -38,15 +38,15 @@ import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; import type { TransactionLike } from "../transaction/index.js"; import type { - PerformActionRequest, - Subscriber, - Subscription, + PerformActionRequest, + Subscriber, + Subscription, } from "./abstract-provider.js"; import type { Networkish } from "./network.js"; import type { - Provider, - TransactionRequest, - TransactionResponse, + Provider, + TransactionRequest, + TransactionResponse, } from "./provider.js"; import type { Signer } from "./signer.js"; import { resolveAddress } from "../address/checks.js"; @@ -56,81 +56,81 @@ type Timer = ReturnType; const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); //const Methods = "getAddress,then".split(/,/g); function deepCopy(value: T): T { - if (value == null || Primitive.indexOf(typeof value) >= 0) { - return value; - } - - // Keep any Addressable - if (typeof (value).getAddress === "function") { - return value; - } - - if (Array.isArray(value)) { - return value.map(deepCopy); - } - - if (typeof value === "object") { - return Object.keys(value).reduce( - (accum, key) => { - accum[key] = (value)[key]; - return accum; - }, - {}, - ); - } - - throw new Error(`should not happen: ${value} (${typeof value})`); + if (value == null || Primitive.indexOf(typeof value) >= 0) { + return value; + } + + // Keep any Addressable + if (typeof (value).getAddress === "function") { + return value; + } + + if (Array.isArray(value)) { + return value.map(deepCopy); + } + + if (typeof value === "object") { + return Object.keys(value).reduce( + (accum, key) => { + accum[key] = (value)[key]; + return accum; + }, + {}, + ); + } + + throw new Error(`should not happen: ${value} (${typeof value})`); } function stall(duration: number): Promise { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); + return new Promise((resolve) => { + setTimeout(resolve, duration); + }); } function getLowerCase(value: string): string { - if (value) { - return value.toLowerCase(); - } - return value; + if (value) { + return value.toLowerCase(); + } + return value; } interface Pollable { - pollingInterval: number; + pollingInterval: number; } function isPollable(value: any): value is Pollable { - return value && typeof value.pollingInterval === "number"; + return value && typeof value.pollingInterval === "number"; } /** * A JSON-RPC payload, which are sent to a JSON-RPC server. */ export type JsonRpcPayload = { - id: number; - method: string; - params: Array | Record; - jsonrpc: "2.0"; + id: number; + method: string; + params: Array | Record; + jsonrpc: "2.0"; }; /** * A JSON-RPC result, which are returned on success from a JSON-RPC server. */ export type JsonRpcResult = { - id: number; - result: any; + id: number; + result: any; }; /** * A JSON-RPC error, which are returned on failure from a JSON-RPC server. */ export type JsonRpcError = { - id: number; - error: { - code: number; - message?: string; - data?: any; - }; + id: number; + error: { + code: number; + message?: string; + data?: any; + }; }; /** @@ -138,18 +138,18 @@ export type JsonRpcError = { * receive this object as the first parameter. */ export type DebugEventJsonRpcApiProvider = - | { - action: "sendRpcPayload"; - payload: JsonRpcPayload | Array; - } - | { - action: "receiveRpcResult"; - result: Array; - } - | { - action: "receiveRpcError"; - error: Error; - }; + | { + action: "sendRpcPayload"; + payload: JsonRpcPayload | Array; + } + | { + action: "receiveRpcResult"; + result: Array; + } + | { + action: "receiveRpcError"; + error: Error; + }; /** * Options for configuring a [[JsonRpcApiProvider]]. Much of this @@ -181,243 +181,243 @@ export type DebugEventJsonRpcApiProvider = * If ``batchMaxCount = 1``, then batching is disabled. (default: ``100``) */ export type JsonRpcApiProviderOptions = { - polling?: boolean; - staticNetwork?: null | Network; - batchStallTime?: number; - batchMaxSize?: number; - batchMaxCount?: number; + polling?: boolean; + staticNetwork?: null | Network; + batchStallTime?: number; + batchMaxSize?: number; + batchMaxCount?: number; }; const defaultOptions = { - polling: false, - staticNetwork: null, + polling: false, + staticNetwork: null, - batchStallTime: 10, // 10ms - batchMaxSize: 1 << 20, // 1Mb - batchMaxCount: 100, // 100 requests + batchStallTime: 10, // 10ms + batchMaxSize: 1 << 20, // 1Mb + batchMaxCount: 100, // 100 requests }; export interface JsonRpcTransactionRequest { - from?: string; - to?: string; - data?: string; + from?: string; + to?: string; + data?: string; - networkId?: string; - type?: string; - energy?: string; + networkId?: string; + type?: string; + energy?: string; - energyPrice?: string; + energyPrice?: string; - nonce?: string; - value?: string; + nonce?: string; + value?: string; - accessList?: Array<{ address: string; storageKeys: Array }>; + accessList?: Array<{ address: string; storageKeys: Array }>; } // @TODO: Unchecked Signers export class JsonRpcSigner extends AbstractSigner { - address!: string; - - constructor(provider: JsonRpcApiProvider, address: string) { - super(provider); - address = getAddress(address); - defineProperties(this, { address }); - } - - connect(provider: null | Provider): Signer { - assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect", - }); - } - - async getAddress(): Promise { - return this.address; - } - - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction( - tx: TransactionRequest, - ): Promise> { - return await this.populateCall(tx); - } - - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx: TransactionRequest): Promise { - const tx = deepCopy(_tx); - - const promises: Array> = []; - - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push( - (async () => { - const from = await resolveAddress(_from); - assertArgument( - from != null && from.toLowerCase() === this.address.toLowerCase(), - "from address mismatch", - "transaction", - _tx, - ); - tx.from = from; - })(), - ); - } else { - tx.from = this.address; - } - - // The JSON-RPC for xcb_sendTransaction uses 90000 energy; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.energyLimit == null) { - promises.push( - (async () => { - tx.energyLimit = await this.provider.estimateEnergy({ - ...tx, - from: this.address, - }); - })(), - ); - } - - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push( - (async () => { - tx.to = await resolveAddress(_to); - })(), - ); - } - - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - - const hexTx = this.provider.getRpcTransaction(tx); - - return this.provider.send("xcb_sendTransaction", [hexTx]); - } - - async sendTransaction(tx: TransactionRequest): Promise { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - const checkTx = async () => { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - - // Wait another 4 seconds - this.provider._setTimeout(() => { - checkTx(); - }, timeouts.pop() || 4000); - }; - checkTx(); - }); - } - - async signTransaction(_tx: TransactionRequest): Promise { - const tx = deepCopy(_tx); - - // Make sure the from matches the sender - if (tx.from) { - const from = await resolveAddress(tx.from); - assertArgument( - from != null && from.toLowerCase() === this.address.toLowerCase(), - "from address mismatch", - "transaction", - _tx, - ); - tx.from = from; - } else { - tx.from = this.address; - } - - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("xcb_signTransaction", [hexTx]); - } - - async signMessage(_message: string | Uint8Array): Promise { - const message = - typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("personal_sign", [ - hexlify(message), - this.address.toLowerCase(), - ]); - } - - async signTypedData( - domain: TypedDataDomain, - types: Record>, - _value: Record, - ): Promise { - const value = deepCopy(_value); - - // Populate any ENS names (in-place) - const populated = await TypedDataEncoder.resolveNames( - domain, - types, - value, - async (value: string) => { - const address = await resolveAddress(value); - assertArgument( - address != null, - "TypedData does not support null address", - "value", - value, - ); - return address; - }, - ); - - return await this.provider.send("xcb_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify( - TypedDataEncoder.getPayload(populated.domain, types, populated.value), - ), - ]); - } - - async unlock(password: string): Promise { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), - password, - null, - ]); - } - - async _legacySignMessage(_message: string | Uint8Array): Promise { - const message = - typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("xcb_sign", [ - this.address.toLowerCase(), - hexlify(message), - ]); - } + address!: string; + + constructor(provider: JsonRpcApiProvider, address: string) { + super(provider); + address = getAddress(address); + defineProperties(this, { address }); + } + + connect(provider: null | Provider): Signer { + assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { + operation: "signer.connect", + }); + } + + async getAddress(): Promise { + return this.address; + } + + // JSON-RPC will automatially fill in nonce, etc. so we just check from + async populateTransaction( + tx: TransactionRequest, + ): Promise> { + return await this.populateCall(tx); + } + + // Returns just the hash of the transaction after sent, which is what + // the bare JSON-RPC API does; + async sendUncheckedTransaction(_tx: TransactionRequest): Promise { + const tx = deepCopy(_tx); + + const promises: Array> = []; + + // Make sure the from matches the sender + if (tx.from) { + const _from = tx.from; + promises.push( + (async () => { + const from = await resolveAddress(_from); + assertArgument( + from != null && from.toLowerCase() === this.address.toLowerCase(), + "from address mismatch", + "transaction", + _tx, + ); + tx.from = from; + })(), + ); + } else { + tx.from = this.address; + } + + // The JSON-RPC for xcb_sendTransaction uses 90000 energy; if the user + // wishes to use this, it is easy to specify explicitly, otherwise + // we look it up for them. + if (tx.energyLimit == null) { + promises.push( + (async () => { + tx.energyLimit = await this.provider.estimateEnergy({ + ...tx, + from: this.address, + }); + })(), + ); + } + + // The address may be an ENS name or Addressable + if (tx.to != null) { + const _to = tx.to; + promises.push( + (async () => { + tx.to = await resolveAddress(_to); + })(), + ); + } + + // Wait until all of our properties are filled in + if (promises.length) { + await Promise.all(promises); + } + + const hexTx = this.provider.getRpcTransaction(tx); + + return this.provider.send("xcb_sendTransaction", [hexTx]); + } + + async sendTransaction(tx: TransactionRequest): Promise { + // This cannot be mined any earlier than any recent block + const blockNumber = await this.provider.getBlockNumber(); + + // Send the transaction + const hash = await this.sendUncheckedTransaction(tx); + + // Unfortunately, JSON-RPC only provides and opaque transaction hash + // for a response, and we need the actual transaction, so we poll + // for it; it should show up very quickly + return await new Promise((resolve, reject) => { + const timeouts = [1000, 100]; + const checkTx = async () => { + // Try getting the transaction + const tx = await this.provider.getTransaction(hash); + if (tx != null) { + resolve(tx.replaceableTransaction(blockNumber)); + return; + } + + // Wait another 4 seconds + this.provider._setTimeout(() => { + checkTx(); + }, timeouts.pop() || 4000); + }; + checkTx(); + }); + } + + async signTransaction(_tx: TransactionRequest): Promise { + const tx = deepCopy(_tx); + + // Make sure the from matches the sender + if (tx.from) { + const from = await resolveAddress(tx.from); + assertArgument( + from != null && from.toLowerCase() === this.address.toLowerCase(), + "from address mismatch", + "transaction", + _tx, + ); + tx.from = from; + } else { + tx.from = this.address; + } + + const hexTx = this.provider.getRpcTransaction(tx); + return await this.provider.send("xcb_signTransaction", [hexTx]); + } + + async signMessage(_message: string | Uint8Array): Promise { + const message = + typeof _message === "string" ? toUtf8Bytes(_message) : _message; + return await this.provider.send("personal_sign", [ + hexlify(message), + this.address.toLowerCase(), + ]); + } + + async signTypedData( + domain: TypedDataDomain, + types: Record>, + _value: Record, + ): Promise { + const value = deepCopy(_value); + + // Populate any ENS names (in-place) + const populated = await TypedDataEncoder.resolveNames( + domain, + types, + value, + async (value: string) => { + const address = await resolveAddress(value); + assertArgument( + address != null, + "TypedData does not support null address", + "value", + value, + ); + return address; + }, + ); + + return await this.provider.send("xcb_signTypedData_v4", [ + this.address.toLowerCase(), + JSON.stringify( + TypedDataEncoder.getPayload(populated.domain, types, populated.value), + ), + ]); + } + + async unlock(password: string): Promise { + return this.provider.send("personal_unlockAccount", [ + this.address.toLowerCase(), + password, + null, + ]); + } + + async _legacySignMessage(_message: string | Uint8Array): Promise { + const message = + typeof _message === "string" ? toUtf8Bytes(_message) : _message; + return await this.provider.send("xcb_sign", [ + this.address.toLowerCase(), + hexlify(message), + ]); + } } type ResolveFunc = (result: JsonRpcResult) => void; type RejectFunc = (error: Error) => void; type Payload = { - payload: JsonRpcPayload; - resolve: ResolveFunc; - reject: RejectFunc; + payload: JsonRpcPayload; + resolve: ResolveFunc; + reject: RejectFunc; }; /** @@ -431,164 +431,164 @@ type Payload = { * - a sub-class MUST call the `_start()` method once connected */ export abstract class JsonRpcApiProvider extends AbstractProvider { - #options: Required; - - // The next ID to use for the JSON-RPC ID field - #nextId: number; - - // Payloads are queued and triggered in batches using the drainTimer - #payloads: Array; - #drainTimer: null | Timer; - - #notReady: null | { - promise: Promise; - resolve: null | ((v: void) => void); - }; - - #network: null | Network; - - #scheduleDrain(): void { - if (this.#drainTimer) { - return; - } - - // If we aren't using batching, no hard in sending it immeidately - const stallTime = - this._getOption("batchMaxCount") === 1 - ? 0 - : this._getOption("batchStallTime"); - - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - - const payloads = this.#payloads; - this.#payloads = []; - - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [payloads.shift()]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push(payloads.shift()); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift(batch.pop()); - break; - } - } - - // Process the result to each payload - (async () => { - const payload = - batch.length === 1 ? batch[0].payload : batch.map((p) => p.payload); - - this.emit("debug", { action: "sendRpcPayload", payload }); - - try { - // console.log({payload}) - const result = await this._send(payload); - // console.log({result}) - this.emit("debug", { action: "receiveRpcResult", result }); - - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - // Find the matching result - const resp = result.filter((r) => r.id === payload.id)[0]; - - // No result; the node failed us in unexpected ways - if (resp == null) { - return reject( - makeError("no response from server", "BAD_DATA", { - value: result, - info: { payload }, - }), - ); - } - - // The response is an error - if ("error" in resp) { - return reject(this.getRpcError(payload, resp)); - } - - // All good; send the result - resolve(resp.result); - } - } catch (error: any) { - this.emit("debug", { action: "receiveRpcError", error }); - - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) { - super(network); - - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - - this.#payloads = []; - this.#drainTimer = null; - - this.#network = null; - - { - let resolve: null | ((value: void) => void) = null; - const promise = new Promise((_resolve: (value: void) => void) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - - // Make sure any static network is compatbile with the provided netwrok - const staticNetwork = this._getOption("staticNetwork"); - if (staticNetwork) { - assertArgument( - network == null || staticNetwork.matches(network), - "staticNetwork MUST match network object", - "options", - options, - ); - this.#network = staticNetwork; - } - } - - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption( - key: K, - ): JsonRpcApiProviderOptions[K] { - return this.#options[key]; - } - - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network(): Network { - assert(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - - /** - * Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel. - * - * Sub-classes **MUST** override this. - */ - abstract _send( - payload: JsonRpcPayload | Array, - ): Promise>; - /* + #options: Required; + + // The next ID to use for the JSON-RPC ID field + #nextId: number; + + // Payloads are queued and triggered in batches using the drainTimer + #payloads: Array; + #drainTimer: null | Timer; + + #notReady: null | { + promise: Promise; + resolve: null | ((v: void) => void); + }; + + #network: null | Network; + + #scheduleDrain(): void { + if (this.#drainTimer) { + return; + } + + // If we aren't using batching, no hard in sending it immeidately + const stallTime = + this._getOption("batchMaxCount") === 1 + ? 0 + : this._getOption("batchStallTime"); + + this.#drainTimer = setTimeout(() => { + this.#drainTimer = null; + + const payloads = this.#payloads; + this.#payloads = []; + + while (payloads.length) { + // Create payload batches that satisfy our batch constraints + const batch = [payloads.shift()]; + while (payloads.length) { + if (batch.length === this.#options.batchMaxCount) { + break; + } + batch.push(payloads.shift()); + const bytes = JSON.stringify(batch.map((p) => p.payload)); + if (bytes.length > this.#options.batchMaxSize) { + payloads.unshift(batch.pop()); + break; + } + } + + // Process the result to each payload + (async () => { + const payload = + batch.length === 1 ? batch[0].payload : batch.map((p) => p.payload); + + this.emit("debug", { action: "sendRpcPayload", payload }); + + try { + // console.log({payload}) + const result = await this._send(payload); + // console.log({result}) + this.emit("debug", { action: "receiveRpcResult", result }); + + // Process results in batch order + for (const { resolve, reject, payload } of batch) { + // Find the matching result + const resp = result.filter((r) => r.id === payload.id)[0]; + + // No result; the node failed us in unexpected ways + if (resp == null) { + return reject( + makeError("no response from server", "BAD_DATA", { + value: result, + info: { payload }, + }), + ); + } + + // The response is an error + if ("error" in resp) { + return reject(this.getRpcError(payload, resp)); + } + + // All good; send the result + resolve(resp.result); + } + } catch (error: any) { + this.emit("debug", { action: "receiveRpcError", error }); + + for (const { reject } of batch) { + // @TODO: augment the error with the payload + reject(error); + } + } + })(); + } + }, stallTime); + } + + constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) { + super(network); + + this.#nextId = 1; + this.#options = Object.assign({}, defaultOptions, options || {}); + + this.#payloads = []; + this.#drainTimer = null; + + this.#network = null; + + { + let resolve: null | ((value: void) => void) = null; + const promise = new Promise((_resolve: (value: void) => void) => { + resolve = _resolve; + }); + this.#notReady = { promise, resolve }; + } + + // Make sure any static network is compatbile with the provided netwrok + const staticNetwork = this._getOption("staticNetwork"); + if (staticNetwork) { + assertArgument( + network == null || staticNetwork.matches(network), + "staticNetwork MUST match network object", + "options", + options, + ); + this.#network = staticNetwork; + } + } + + /** + * Returns the value associated with the option %%key%%. + * + * Sub-classes can use this to inquire about configuration options. + */ + _getOption( + key: K, + ): JsonRpcApiProviderOptions[K] { + return this.#options[key]; + } + + /** + * Gets the [[Network]] this provider has committed to. On each call, the network + * is detected, and if it has changed, the call will reject. + */ + get _network(): Network { + assert(this.#network, "network is not available yet", "NETWORK_ERROR"); + return this.#network; + } + + /** + * Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel. + * + * Sub-classes **MUST** override this. + */ + abstract _send( + payload: JsonRpcPayload | Array, + ): Promise>; + /* { assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { operation: "jsonRpcApiProvider._send" @@ -596,524 +596,524 @@ export abstract class JsonRpcApiProvider extends AbstractProvider { } */ - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req: PerformActionRequest): Promise { - const request = this.getRpcRequest(req); - - if (request != null) { - return await this.send(request.method, request.args); - } - - return super._perform(req); - } - - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork(): Promise { - const network = this._getOption("staticNetwork"); - if (network) { - return network; - } - - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - return Network.from(getBigInt(await this.send("xcb_networkId", []))); - } - - // We are not ready yet; use the primitive _send - - const payload: JsonRpcPayload = { - id: this.#nextId++, - method: "xcb_networkId", - params: [], - jsonrpc: "2.0", - }; - - this.emit("debug", { action: "sendRpcPayload", payload }); - - let result: JsonRpcResult | JsonRpcError; - try { - result = (await this._send(payload))[0]; - } catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - - this.emit("debug", { action: "receiveRpcResult", result }); - - if ("result" in result) { - return Network.from(getBigInt(result.result)); - } - - throw this.getRpcError(payload, result); - } - - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start(): void { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - - this.#notReady.resolve(); - this.#notReady = null; - - (async () => { - // Bootstrap the network - while (this.#network == null) { - try { - this.#network = await this._detectNetwork(); - } catch (error) { - console.log("JsonRpcProvider failed to startup; retry in 1s"); - await stall(1000); - } - } - - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady(): Promise { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub: Subscription): Subscriber { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new FilterIdPendingSubscriber(this); - } - - if (sub.type === "event") { - if (this._getOption("polling")) { - return new PollingEventSubscriber(this, sub.filter); - } - return new FilterIdEventSubscriber(this, sub.filter); - } - - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("orphan"); - } - - return super._getSubscriber(sub); - } - - /** - * Returns true only if the [[_start]] has been called. - */ - get ready(): boolean { - return this.#notReady == null; - } - - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest { - const result: JsonRpcTransactionRequest = {}; - - // JSON-RPC now requires numeric values to be "quantity" values - [ - "networkId", - "energyLimit", - "energyPrice", - "type", - "nonce", - "value", - ].forEach((key) => { - if ((tx)[key] == null) { - return; - } - let dstKey = key; - if (key === "energyLimit") { - dstKey = "energy"; - } - (result)[dstKey] = toQuantity( - getBigInt((tx)[key], `tx.${key}`), - ); - }); - - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if ((tx)[key] == null) { - return; - } - (result)[key] = hexlify((tx)[key]); - }); - - return result; - } - - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest( - req: PerformActionRequest, - ): null | { method: string; args: Array } { - switch (req.method) { - case "networkId": - return { method: "xcb_networkId", args: [] }; - - case "getBlockNumber": - return { method: "xcb_blockNumber", args: [] }; - - case "getEnergyPrice": - return { method: "xcb_energyPrice", args: [] }; - - case "getBalance": { - return { - method: "xcb_getBalance", - args: [getLowerCase(req.address), req.blockTag], - }; - } - case "getTransactionCount": - return { - method: "xcb_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag], - }; - - case "getCode": - return { - method: "xcb_getCode", - args: [getLowerCase(req.address), req.blockTag], - }; - - case "getStorage": - return { - method: "xcb_getStorageAt", - args: [ - getLowerCase(req.address), - "0x" + req.position.toString(16), - req.blockTag, - ], - }; - - case "broadcastTransaction": - return { - method: "xcb_sendRawTransaction", - args: [req.signedTransaction], - }; - - case "getBlock": - if ("blockTag" in req) { - return { - method: "xcb_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions], - }; - } else if ("blockHash" in req) { - return { - method: "xcb_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions], - }; - } - break; - - case "getTransaction": - return { - method: "xcb_getTransactionByHash", - args: [req.hash], - }; - - case "getTransactionReceipt": - return { - method: "xcb_getTransactionReceipt", - args: [req.hash], - }; - - case "call": - return { - method: "xcb_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag], - }; - - case "estimateEnergy": { - return { - method: "xcb_estimateEnergy", - args: [this.getRpcTransaction(req.transaction)], - }; - } - - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "xcb_getLogs", args: [req.filter] }; - } - - return null; - } - - /** - * Returns an CoreBC-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error { - const { method } = payload; - const { error } = _error; - if (method === "xcb_estimateEnergy" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: (payload).params[0], - info: { payload, error }, - }); - } - } - - if (method === "xcb_call" || method === "xcb_estimateEnergy") { - const result = spelunkData(error); - const e = AbiCoder.getBuiltinCallException( - method === "xcb_call" ? "call" : "estimateEnergy", - (payload).params[0], - result ? result.data : null, - ); - e.info = { error, payload }; - return e; - } - - // Only estimateEnergy and call can return arbitrary contract-defined text, so now we - // we can process text safely. - - const message = JSON.stringify(spelunkMessage(error)); - - if ( - typeof error.message === "string" && - error.message.match(/user denied|corebc-user-denied/i) - ) { - const actionMap: Record< - string, - | "requestAccess" - | "sendTransaction" - | "signMessage" - | "signTransaction" - | "signTypedData" - > = { - xcb_sign: "signMessage", - personal_sign: "signMessage", - xcb_signTypedData_v4: "signTypedData", - xcb_signTransaction: "signTransaction", - xcb_sendTransaction: "sendTransaction", - xcb_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - - return makeError(`user rejected action`, "ACTION_REJECTED", { - action: actionMap[method] || "unknown", - reason: "rejected", - info: { payload, error }, - }); - } - - if ( - method === "xcb_sendRawTransaction" || - method === "xcb_sendTransaction" - ) { - const transaction = >(payload).params[0]; - - if (message.match(/insufficient funds|base fee exceeds energy limit/i)) { - return makeError( - "insufficient funds for intrinsic transaction cost", - "INSUFFICIENT_FUNDS", - { - transaction, - info: { error }, - }, - ); - } - - if (message.match(/nonce/i) && message.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction, - info: { error }, - }); - } - - // "replacement transaction underpriced" - if ( - message.match(/replacement transaction/i) && - message.match(/underpriced/i) - ) { - return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction, - info: { error }, - }); - } - - if (message.match(/only replay-protected/i)) { - return makeError( - "legacy pre-eip-155 transactions not supported", - "UNSUPPORTED_OPERATION", - { - operation: method, - info: { transaction, info: { error } }, - }, - ); - } - } - - if (message.match(/the method .* does not exist/i)) { - return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, - info: { error }, - }); - } - - return makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); - } - - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method: string, params: Array | Record): Promise { - // @TODO: cache networkId?? purge on switch_networks - - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, - reject, - payload: { method, params, id, jsonrpc: "2.0" }, - }); - }); - - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - - return >promise; - } - - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address?: number | string): Promise { - if (address == null) { - address = 0; - } - - const accountsPromise = this.send("xcb_accounts", []); - - // Account index - if (typeof address === "number") { - const accounts = >await accountsPromise; - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - - const { accounts } = await resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise, - }); - - // Account address - address = getAddress(address); - for (const account of accounts) { - if (getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - - throw new Error("invalid account"); - } - - async listAccounts(): Promise> { - const accounts: Array = await this.send("xcb_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } + /** + * Resolves to the non-normalized value by performing %%req%%. + * + * Sub-classes may override this to modify behavior of actions, + * and should generally call ``super._perform`` as a fallback. + */ + async _perform(req: PerformActionRequest): Promise { + const request = this.getRpcRequest(req); + + if (request != null) { + return await this.send(request.method, request.args); + } + + return super._perform(req); + } + + /** + * Sub-classes may override this; it detects the *actual* network that + * we are **currently** connected to. + * + * Keep in mind that [[send]] may only be used once [[ready]], otherwise the + * _send primitive must be used instead. + */ + async _detectNetwork(): Promise { + const network = this._getOption("staticNetwork"); + if (network) { + return network; + } + + // If we are ready, use ``send``, which enabled requests to be batched + if (this.ready) { + return Network.from(getBigInt(await this.send("xcb_networkId", []))); + } + + // We are not ready yet; use the primitive _send + + const payload: JsonRpcPayload = { + id: this.#nextId++, + method: "xcb_networkId", + params: [], + jsonrpc: "2.0", + }; + + this.emit("debug", { action: "sendRpcPayload", payload }); + + let result: JsonRpcResult | JsonRpcError; + try { + result = (await this._send(payload))[0]; + } catch (error) { + this.emit("debug", { action: "receiveRpcError", error }); + throw error; + } + + this.emit("debug", { action: "receiveRpcResult", result }); + + if ("result" in result) { + return Network.from(getBigInt(result.result)); + } + + throw this.getRpcError(payload, result); + } + + /** + * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls + * will be passed to [[_send]] from [[send]]. If it is overridden, then + * ``super._start()`` **MUST** be called. + * + * Calling it multiple times is safe and has no effect. + */ + _start(): void { + if (this.#notReady == null || this.#notReady.resolve == null) { + return; + } + + this.#notReady.resolve(); + this.#notReady = null; + + (async () => { + // Bootstrap the network + while (this.#network == null) { + try { + this.#network = await this._detectNetwork(); + } catch (error) { + console.log("JsonRpcProvider failed to startup; retry in 1s"); + await stall(1000); + } + } + + // Start dispatching requests + this.#scheduleDrain(); + })(); + } + + /** + * Resolves once the [[_start]] has been called. This can be used in + * sub-classes to defer sending data until the connection has been + * established. + */ + async _waitUntilReady(): Promise { + if (this.#notReady == null) { + return; + } + return await this.#notReady.promise; + } + + /** + * Return a Subscriber that will manage the %%sub%%. + * + * Sub-classes may override this to modify the behavior of + * subscription management. + */ + _getSubscriber(sub: Subscription): Subscriber { + // Pending Filters aren't availble via polling + if (sub.type === "pending") { + return new FilterIdPendingSubscriber(this); + } + + if (sub.type === "event") { + if (this._getOption("polling")) { + return new PollingEventSubscriber(this, sub.filter); + } + return new FilterIdEventSubscriber(this, sub.filter); + } + + // Orphaned Logs are handled automatically, by the filter, since + // logs with removed are emitted by it + if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { + return new UnmanagedSubscriber("orphan"); + } + + return super._getSubscriber(sub); + } + + /** + * Returns true only if the [[_start]] has been called. + */ + get ready(): boolean { + return this.#notReady == null; + } + + /** + * Returns %%tx%% as a normalized JSON-RPC transaction request, + * which has all values hexlified and any numeric values converted + * to Quantity values. + */ + getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest { + const result: JsonRpcTransactionRequest = {}; + + // JSON-RPC now requires numeric values to be "quantity" values + [ + "networkId", + "energyLimit", + "energyPrice", + "type", + "nonce", + "value", + ].forEach((key) => { + if ((tx)[key] == null) { + return; + } + let dstKey = key; + if (key === "energyLimit") { + dstKey = "energy"; + } + (result)[dstKey] = toQuantity( + getBigInt((tx)[key], `tx.${key}`), + ); + }); + + // Make sure addresses and data are lowercase + ["from", "to", "data"].forEach((key) => { + if ((tx)[key] == null) { + return; + } + (result)[key] = hexlify((tx)[key]); + }); + + return result; + } + + /** + * Returns the request method and arguments required to perform + * %%req%%. + */ + getRpcRequest( + req: PerformActionRequest, + ): null | { method: string; args: Array } { + switch (req.method) { + case "networkId": + return { method: "xcb_networkId", args: [] }; + + case "getBlockNumber": + return { method: "xcb_blockNumber", args: [] }; + + case "getEnergyPrice": + return { method: "xcb_energyPrice", args: [] }; + + case "getBalance": { + return { + method: "xcb_getBalance", + args: [getLowerCase(req.address), req.blockTag], + }; + } + case "getTransactionCount": + return { + method: "xcb_getTransactionCount", + args: [getLowerCase(req.address), req.blockTag], + }; + + case "getCode": + return { + method: "xcb_getCode", + args: [getLowerCase(req.address), req.blockTag], + }; + + case "getStorage": + return { + method: "xcb_getStorageAt", + args: [ + getLowerCase(req.address), + "0x" + req.position.toString(16), + req.blockTag, + ], + }; + + case "broadcastTransaction": + return { + method: "xcb_sendRawTransaction", + args: [req.signedTransaction], + }; + + case "getBlock": + if ("blockTag" in req) { + return { + method: "xcb_getBlockByNumber", + args: [req.blockTag, !!req.includeTransactions], + }; + } else if ("blockHash" in req) { + return { + method: "xcb_getBlockByHash", + args: [req.blockHash, !!req.includeTransactions], + }; + } + break; + + case "getTransaction": + return { + method: "xcb_getTransactionByHash", + args: [req.hash], + }; + + case "getTransactionReceipt": + return { + method: "xcb_getTransactionReceipt", + args: [req.hash], + }; + + case "call": + return { + method: "xcb_call", + args: [this.getRpcTransaction(req.transaction), req.blockTag], + }; + + case "estimateEnergy": { + return { + method: "xcb_estimateEnergy", + args: [this.getRpcTransaction(req.transaction)], + }; + } + + case "getLogs": + if (req.filter && req.filter.address != null) { + if (Array.isArray(req.filter.address)) { + req.filter.address = req.filter.address.map(getLowerCase); + } else { + req.filter.address = getLowerCase(req.filter.address); + } + } + return { method: "xcb_getLogs", args: [req.filter] }; + } + + return null; + } + + /** + * Returns an CoreBC-style Error for the given JSON-RPC error + * %%payload%%, coalescing the various strings and error shapes + * that different nodes return, coercing them into a machine-readable + * standardized error. + */ + getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error { + const { method } = payload; + const { error } = _error; + if (method === "xcb_estimateEnergy" && error.message) { + const msg = error.message; + if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { + return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { + transaction: (payload).params[0], + info: { payload, error }, + }); + } + } + + if (method === "xcb_call" || method === "xcb_estimateEnergy") { + const result = spelunkData(error); + const e = AbiCoder.getBuiltinCallException( + method === "xcb_call" ? "call" : "estimateEnergy", + (payload).params[0], + result ? result.data : null, + ); + e.info = { error, payload }; + return e; + } + + // Only estimateEnergy and call can return arbitrary contract-defined text, so now we + // we can process text safely. + + const message = JSON.stringify(spelunkMessage(error)); + + if ( + typeof error.message === "string" && + error.message.match(/user denied|corebc-user-denied/i) + ) { + const actionMap: Record< + string, + | "requestAccess" + | "sendTransaction" + | "signMessage" + | "signTransaction" + | "signTypedData" + > = { + xcb_sign: "signMessage", + personal_sign: "signMessage", + xcb_signTypedData_v4: "signTypedData", + xcb_signTransaction: "signTransaction", + xcb_sendTransaction: "sendTransaction", + xcb_requestAccounts: "requestAccess", + wallet_requestAccounts: "requestAccess", + }; + + return makeError(`user rejected action`, "ACTION_REJECTED", { + action: actionMap[method] || "unknown", + reason: "rejected", + info: { payload, error }, + }); + } + + if ( + method === "xcb_sendRawTransaction" || + method === "xcb_sendTransaction" + ) { + const transaction = >(payload).params[0]; + + if (message.match(/insufficient funds|base fee exceeds energy limit/i)) { + return makeError( + "insufficient funds for intrinsic transaction cost", + "INSUFFICIENT_FUNDS", + { + transaction, + info: { error }, + }, + ); + } + + if (message.match(/nonce/i) && message.match(/too low/i)) { + return makeError("nonce has already been used", "NONCE_EXPIRED", { + transaction, + info: { error }, + }); + } + + // "replacement transaction underpriced" + if ( + message.match(/replacement transaction/i) && + message.match(/underpriced/i) + ) { + return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { + transaction, + info: { error }, + }); + } + + if (message.match(/only replay-protected/i)) { + return makeError( + "legacy pre-eip-155 transactions not supported", + "UNSUPPORTED_OPERATION", + { + operation: method, + info: { transaction, info: { error } }, + }, + ); + } + } + + if (message.match(/the method .* does not exist/i)) { + return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { + operation: payload.method, + info: { error }, + }); + } + + return makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); + } + + /** + * Requests the %%method%% with %%params%% via the JSON-RPC protocol + * over the underlying channel. This can be used to call methods + * on the backend that do not have a high-level API within the Provider + * API. + * + * This method queues requests according to the batch constraints + * in the options, assigns the request a unique ID. + * + * **Do NOT override** this method in sub-classes; instead + * override [[_send]] or force the options values in the + * call to the constructor to modify this method's behavior. + */ + send(method: string, params: Array | Record): Promise { + // @TODO: cache networkId?? purge on switch_networks + + const id = this.#nextId++; + const promise = new Promise((resolve, reject) => { + this.#payloads.push({ + resolve, + reject, + payload: { method, params, id, jsonrpc: "2.0" }, + }); + }); + + // If there is not a pending drainTimer, set one + this.#scheduleDrain(); + + return >promise; + } + + /** + * Resolves to the [[Signer]] account for %%address%% managed by + * the client. + * + * If the %%address%% is a number, it is used as an index in the + * the accounts from [[listAccounts]]. + * + * This can only be used on clients which manage accounts (such as + * Geth with imported account or MetaMask). + * + * Throws if the account doesn't exist. + */ + async getSigner(address?: number | string): Promise { + if (address == null) { + address = 0; + } + + const accountsPromise = this.send("xcb_accounts", []); + + // Account index + if (typeof address === "number") { + const accounts = >await accountsPromise; + if (address >= accounts.length) { + throw new Error("no such account"); + } + return new JsonRpcSigner(this, accounts[address]); + } + + const { accounts } = await resolveProperties({ + network: this.getNetwork(), + accounts: accountsPromise, + }); + + // Account address + address = getAddress(address); + for (const account of accounts) { + if (getAddress(account) === address) { + return new JsonRpcSigner(this, address); + } + } + + throw new Error("invalid account"); + } + + async listAccounts(): Promise> { + const accounts: Array = await this.send("xcb_accounts", []); + return accounts.map((a) => new JsonRpcSigner(this, a)); + } } export abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval: number; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) { - super(network, options); - - this.#pollingInterval = 4000; - } - - _getSubscriber(sub: Subscription): Subscriber { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval(): number { - return this.#pollingInterval; - } - set pollingInterval(value: number) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } + #pollingInterval: number; + constructor(network?: Networkish, options?: JsonRpcApiProviderOptions) { + super(network, options); + + this.#pollingInterval = 4000; + } + + _getSubscriber(sub: Subscription): Subscriber { + const subscriber = super._getSubscriber(sub); + if (isPollable(subscriber)) { + subscriber.pollingInterval = this.#pollingInterval; + } + return subscriber; + } + + /** + * The polling interval (default: 4000 ms) + */ + get pollingInterval(): number { + return this.#pollingInterval; + } + set pollingInterval(value: number) { + if (!Number.isInteger(value) || value < 0) { + throw new Error("invalid interval"); + } + this.#pollingInterval = value; + this._forEachSubscriber((sub) => { + if (isPollable(sub)) { + sub.pollingInterval = this.#pollingInterval; + } + }); + } } /** @@ -1125,123 +1125,123 @@ export abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider { * for updates. */ export class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect: FetchRequest; - - constructor( - url?: string | FetchRequest, - network?: Networkish, - options?: JsonRpcApiProviderOptions, - ) { - if (url == null) { - url = "http://localhost:8545"; - } - super(network, options); - - if (typeof url === "string") { - this.#connect = new FetchRequest(url); - } else { - this.#connect = url.clone(); - } - } - - _getConnection(): FetchRequest { - return this.#connect.clone(); - } - - async send( - method: string, - params: Array | Record, - ): Promise { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. xcb_networkId) until we absolutely have to. - await this._start(); - - return await super.send(method, params); - } - - async _send( - payload: JsonRpcPayload | Array, - ): Promise> { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - - const response = await request.send(); - response.assertOk(); - - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - - return resp; - } + #connect: FetchRequest; + + constructor( + url?: string | FetchRequest, + network?: Networkish, + options?: JsonRpcApiProviderOptions, + ) { + if (url == null) { + url = "http://localhost:8545"; + } + super(network, options); + + if (typeof url === "string") { + this.#connect = new FetchRequest(url); + } else { + this.#connect = url.clone(); + } + } + + _getConnection(): FetchRequest { + return this.#connect.clone(); + } + + async send( + method: string, + params: Array | Record, + ): Promise { + // All requests are over HTTP, so we can just start handling requests + // We do this here rather than the constructor so that we don't send any + // requests to the network (i.e. xcb_networkId) until we absolutely have to. + await this._start(); + + return await super.send(method, params); + } + + async _send( + payload: JsonRpcPayload | Array, + ): Promise> { + // Configure a POST connection for the requested method + const request = this._getConnection(); + request.body = JSON.stringify(payload); + request.setHeader("content-type", "application/json"); + + const response = await request.send(); + response.assertOk(); + + let resp = response.bodyJson; + if (!Array.isArray(resp)) { + resp = [resp]; + } + + return resp; + } } function spelunkData(value: any): null | { message: string; data: string } { - if (value == null) { - return null; - } - - // These *are* the droids we're looking for. - if ( - typeof value.message === "string" && - value.message.match("reverted") && - isHexString(value.data) - ) { - return { message: value.message, data: value.data }; - } - - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return spelunkData(JSON.parse(value)); - } catch (error) {} - } - - return null; + if (value == null) { + return null; + } + + // These *are* the droids we're looking for. + if ( + typeof value.message === "string" && + value.message.match("reverted") && + isHexString(value.data) + ) { + return { message: value.message, data: value.data }; + } + + // Spelunk further... + if (typeof value === "object") { + for (const key in value) { + const result = spelunkData(value[key]); + if (result) { + return result; + } + } + return null; + } + + // Might be a JSON string we can further descend... + if (typeof value === "string") { + try { + return spelunkData(JSON.parse(value)); + } catch (error) {} + } + + return null; } function _spelunkMessage(value: any, result: Array): void { - if (value == null) { - return; - } - - // These *are* the droids we're looking for. - if (typeof value.message === "string") { - result.push(value.message); - } - - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } catch (error) {} - } + if (value == null) { + return; + } + + // These *are* the droids we're looking for. + if (typeof value.message === "string") { + result.push(value.message); + } + + // Spelunk further... + if (typeof value === "object") { + for (const key in value) { + _spelunkMessage(value[key], result); + } + } + + // Might be a JSON string we can further descend... + if (typeof value === "string") { + try { + return _spelunkMessage(JSON.parse(value), result); + } catch (error) {} + } } function spelunkMessage(value: any): Array { - const result: Array = []; - _spelunkMessage(value, result); - return result; + const result: Array = []; + _spelunkMessage(value, result); + return result; } diff --git a/src.ts/providers/provider-pocket.ts b/src.ts/providers/provider-pocket.ts index 94479c8c1..8561a73cc 100644 --- a/src.ts/providers/provider-pocket.ts +++ b/src.ts/providers/provider-pocket.ts @@ -12,9 +12,9 @@ * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] */ import { - defineProperties, - FetchRequest, - assertArgument, + defineProperties, + FetchRequest, + assertArgument, } from "../utils/index.js"; import { AbstractProvider } from "./abstract-provider.js"; @@ -28,19 +28,19 @@ import type { Networkish } from "./network.js"; const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; function getHost(name: string): string { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - - assertArgument(false, "unsupported network", "network", name); + switch (name) { + case "mainnet": + return "eth-mainnet.gateway.pokt.network"; + case "goerli": + return "eth-goerli.gateway.pokt.network"; + + case "matic": + return "poly-mainnet.gateway.pokt.network"; + case "matic-mumbai": + return "polygon-mumbai-rpc.gateway.pokt.network"; + } + + assertArgument(false, "unsupported network", "network", name); } /** @@ -53,101 +53,101 @@ function getHost(name: string): string { * recommended to [sign up here](link-pocket-signup). */ export class PocketProvider - extends JsonRpcProvider - implements CommunityResourcable + extends JsonRpcProvider + implements CommunityResourcable { - /** - * The Application ID for the Pocket connection. - */ - readonly applicationId!: string; - - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - readonly applicationSecret!: null | string; - - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor( - _network?: Networkish, - applicationId?: null | string, - applicationSecret?: null | string, - ) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - - const options = { staticNetwork: network }; - - const request = PocketProvider.getRequest( - network, - applicationId, - applicationSecret, - ); - super(request, network, options); - - defineProperties(this, { - applicationId, - applicationSecret, - }); - } - - _getProvider(networkId: number): AbstractProvider { - try { - return new PocketProvider( - networkId, - this.applicationId, - this.applicationSecret, - ); - } catch (error) {} - return super._getProvider(networkId); - } - - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest( - network: Network, - applicationId?: null | string, - applicationSecret?: null | string, - ): FetchRequest { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - - const request = new FetchRequest( - `https:/\/${getHost(network.name)}/v1/lb/${applicationId}`, - ); - request.allowGzip = true; - - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("PocketProvider"); - return true; - }; - } - - return request; - } - - isCommunityResource(): boolean { - return this.applicationId === defaultApplicationId; - } + /** + * The Application ID for the Pocket connection. + */ + readonly applicationId!: string; + + /** + * The Application Secret for making authenticated requests + * to the Pocket connection. + */ + readonly applicationSecret!: null | string; + + /** + * Create a new **PocketProvider**. + * + * By default connecting to ``mainnet`` with a highly throttled + * API key. + */ + constructor( + _network?: Networkish, + applicationId?: null | string, + applicationSecret?: null | string, + ) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (applicationId == null) { + applicationId = defaultApplicationId; + } + if (applicationSecret == null) { + applicationSecret = null; + } + + const options = { staticNetwork: network }; + + const request = PocketProvider.getRequest( + network, + applicationId, + applicationSecret, + ); + super(request, network, options); + + defineProperties(this, { + applicationId, + applicationSecret, + }); + } + + _getProvider(networkId: number): AbstractProvider { + try { + return new PocketProvider( + networkId, + this.applicationId, + this.applicationSecret, + ); + } catch (error) {} + return super._getProvider(networkId); + } + + /** + * Returns a prepared request for connecting to %%network%% with + * %%applicationId%%. + */ + static getRequest( + network: Network, + applicationId?: null | string, + applicationSecret?: null | string, + ): FetchRequest { + if (applicationId == null) { + applicationId = defaultApplicationId; + } + + const request = new FetchRequest( + `https:/\/${getHost(network.name)}/v1/lb/${applicationId}`, + ); + request.allowGzip = true; + + if (applicationSecret) { + request.setCredentials("", applicationSecret); + } + + if (applicationId === defaultApplicationId) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("PocketProvider"); + return true; + }; + } + + return request; + } + + isCommunityResource(): boolean { + return this.applicationId === defaultApplicationId; + } } diff --git a/src.ts/providers/provider-quicknode.ts b/src.ts/providers/provider-quicknode.ts index 37a6a52af..ba2685d0a 100644 --- a/src.ts/providers/provider-quicknode.ts +++ b/src.ts/providers/provider-quicknode.ts @@ -17,9 +17,9 @@ */ import { - defineProperties, - FetchRequest, - assertArgument, + defineProperties, + FetchRequest, + assertArgument, } from "../utils/index.js"; import { showThrottleMessage } from "./community.js"; @@ -33,25 +33,25 @@ import type { Networkish } from "./network.js"; const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; function getHost(name: string): string { - switch (name) { - case "mainnet": - return "corebc.quiknode.pro"; - - case "arbitrum": - return "corebc.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "corebc.arbitrum-goerli.quiknode.pro"; - case "matic": - return "corebc.matic.quiknode.pro"; - case "matic-mumbai": - return "corebc.matic-testnet.quiknode.pro"; - case "optimism": - return "corebc.optimism.quiknode.pro"; - case "optimism-goerli": - return "corebc.optimism-goerli.quiknode.pro"; - } - - assertArgument(false, "unsupported network", "network", name); + switch (name) { + case "mainnet": + return "corebc.quiknode.pro"; + + case "arbitrum": + return "corebc.arbitrum-mainnet.quiknode.pro"; + case "arbitrum-goerli": + return "corebc.arbitrum-goerli.quiknode.pro"; + case "matic": + return "corebc.matic.quiknode.pro"; + case "matic-mumbai": + return "corebc.matic-testnet.quiknode.pro"; + case "optimism": + return "corebc.optimism.quiknode.pro"; + case "optimism-goerli": + return "corebc.optimism-goerli.quiknode.pro"; + } + + assertArgument(false, "unsupported network", "network", name); } /** @@ -64,65 +64,65 @@ function getHost(name: string): string { * recommended to [sign up here](link-quicknode). */ export class QuickNodeProvider - extends JsonRpcProvider - implements CommunityResourcable + extends JsonRpcProvider + implements CommunityResourcable { - /** - * The API token. - */ - readonly token!: string; - - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network?: Networkish, token?: null | string) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (token == null) { - token = defaultToken; - } - - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - - defineProperties(this, { token }); - } - - _getProvider(networkId: number): AbstractProvider { - try { - return new QuickNodeProvider(networkId, this.token); - } catch (error) {} - return super._getProvider(networkId); - } - - isCommunityResource(): boolean { - return this.token === defaultToken; - } - - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network: Network, token?: null | string): FetchRequest { - if (token == null) { - token = defaultToken; - } - - const request = new FetchRequest( - `https:/\/${getHost(network.name)}/${token}`, - ); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - - return request; - } + /** + * The API token. + */ + readonly token!: string; + + /** + * Creates a new **QuickNodeProvider**. + */ + constructor(_network?: Networkish, token?: null | string) { + if (_network == null) { + _network = "mainnet"; + } + const network = Network.from(_network); + if (token == null) { + token = defaultToken; + } + + const request = QuickNodeProvider.getRequest(network, token); + super(request, network, { staticNetwork: network }); + + defineProperties(this, { token }); + } + + _getProvider(networkId: number): AbstractProvider { + try { + return new QuickNodeProvider(networkId, this.token); + } catch (error) {} + return super._getProvider(networkId); + } + + isCommunityResource(): boolean { + return this.token === defaultToken; + } + + /** + * Returns a new request prepared for %%network%% and the + * %%token%%. + */ + static getRequest(network: Network, token?: null | string): FetchRequest { + if (token == null) { + token = defaultToken; + } + + const request = new FetchRequest( + `https:/\/${getHost(network.name)}/${token}`, + ); + request.allowGzip = true; + //if (projectSecret) { request.setCredentials("", projectSecret); } + + if (token === defaultToken) { + request.retryFunc = async (request, response, attempt) => { + showThrottleMessage("QuickNodeProvider"); + return true; + }; + } + + return request; + } } diff --git a/src.ts/providers/provider-socket.ts b/src.ts/providers/provider-socket.ts index f502d80ac..27b1a50df 100644 --- a/src.ts/providers/provider-socket.ts +++ b/src.ts/providers/provider-socket.ts @@ -16,136 +16,136 @@ import { JsonRpcApiProvider } from "./provider-jsonrpc.js"; import type { Subscriber, Subscription } from "./abstract-provider.js"; import type { EventFilter } from "./provider.js"; import type { - JsonRpcError, - JsonRpcPayload, - JsonRpcResult, + JsonRpcError, + JsonRpcPayload, + JsonRpcResult, } from "./provider-jsonrpc.js"; import type { Networkish } from "./network.js"; type JsonRpcSubscription = { - method: string; - params: { - result: any; - subscription: string; - }; + method: string; + params: { + result: any; + subscription: string; + }; }; export class SocketSubscriber implements Subscriber { - #provider: SocketProvider; - - #filter: string; - get filter(): Array { - return JSON.parse(this.#filter); - } - - #filterId: null | Promise; - #paused: null | boolean; - - #emitPromise: null | Promise; - - constructor(provider: SocketProvider, filter: Array) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - - start(): void { - this.#filterId = this.#provider - .send("xcb_subscribe", this.filter) - .then((filterId) => { - this.#provider._register(filterId, this); - return filterId; - }); - } - - stop(): void { - (>this.#filterId).then((filterId) => { - this.#provider.send("xcb_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused?: boolean): void { - assert( - dropWhilePaused, - "preserve logs while paused not supported by SocketSubscriber yet", - "UNSUPPORTED_OPERATION", - { operation: "pause(false)" }, - ); - this.#paused = !!dropWhilePaused; - } - - resume(): void { - this.#paused = null; - } - - _handleMessage(message: any): void { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise: null | Promise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - - async _emit(provider: SocketProvider, message: any): Promise { - throw new Error("sub-classes must implemente this; _emit"); - } + #provider: SocketProvider; + + #filter: string; + get filter(): Array { + return JSON.parse(this.#filter); + } + + #filterId: null | Promise; + #paused: null | boolean; + + #emitPromise: null | Promise; + + constructor(provider: SocketProvider, filter: Array) { + this.#provider = provider; + this.#filter = JSON.stringify(filter); + this.#filterId = null; + this.#paused = null; + this.#emitPromise = null; + } + + start(): void { + this.#filterId = this.#provider + .send("xcb_subscribe", this.filter) + .then((filterId) => { + this.#provider._register(filterId, this); + return filterId; + }); + } + + stop(): void { + (>this.#filterId).then((filterId) => { + this.#provider.send("xcb_unsubscribe", [filterId]); + }); + this.#filterId = null; + } + + // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs + // and resume + pause(dropWhilePaused?: boolean): void { + assert( + dropWhilePaused, + "preserve logs while paused not supported by SocketSubscriber yet", + "UNSUPPORTED_OPERATION", + { operation: "pause(false)" }, + ); + this.#paused = !!dropWhilePaused; + } + + resume(): void { + this.#paused = null; + } + + _handleMessage(message: any): void { + if (this.#filterId == null) { + return; + } + if (this.#paused === null) { + let emitPromise: null | Promise = this.#emitPromise; + if (emitPromise == null) { + emitPromise = this._emit(this.#provider, message); + } else { + emitPromise = emitPromise.then(async () => { + await this._emit(this.#provider, message); + }); + } + this.#emitPromise = emitPromise.then(() => { + if (this.#emitPromise === emitPromise) { + this.#emitPromise = null; + } + }); + } + } + + async _emit(provider: SocketProvider, message: any): Promise { + throw new Error("sub-classes must implemente this; _emit"); + } } export class SocketBlockSubscriber extends SocketSubscriber { - constructor(provider: SocketProvider) { - super(provider, ["newHeads"]); - } + constructor(provider: SocketProvider) { + super(provider, ["newHeads"]); + } - async _emit(provider: SocketProvider, message: any): Promise { - provider.emit("block", parseInt(message.number)); - } + async _emit(provider: SocketProvider, message: any): Promise { + provider.emit("block", parseInt(message.number)); + } } export class SocketPendingSubscriber extends SocketSubscriber { - constructor(provider: SocketProvider) { - super(provider, ["newPendingTransactions"]); - } + constructor(provider: SocketProvider) { + super(provider, ["newPendingTransactions"]); + } - async _emit(provider: SocketProvider, message: any): Promise { - provider.emit("pending", message); - } + async _emit(provider: SocketProvider, message: any): Promise { + provider.emit("pending", message); + } } export class SocketEventSubscriber extends SocketSubscriber { - #logFilter: string; - get logFilter(): EventFilter { - return JSON.parse(this.#logFilter); - } - - constructor(provider: SocketProvider, filter: EventFilter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - - async _emit(provider: SocketProvider, message: any): Promise { - provider.emit( - this.logFilter, - provider._wrapLog(message, provider._network), - ); - } + #logFilter: string; + get logFilter(): EventFilter { + return JSON.parse(this.#logFilter); + } + + constructor(provider: SocketProvider, filter: EventFilter) { + super(provider, ["logs", filter]); + this.#logFilter = JSON.stringify(filter); + } + + async _emit(provider: SocketProvider, message: any): Promise { + provider.emit( + this.logFilter, + provider._wrapLog(message, provider._network), + ); + } } /** @@ -153,31 +153,31 @@ export class SocketEventSubscriber extends SocketSubscriber { * */ export class SocketProvider extends JsonRpcApiProvider { - #callbacks: Map< - number, - { - payload: JsonRpcPayload; - resolve: (r: any) => void; - reject: (e: Error) => void; - } - >; - - // Maps each filterId to its subscriber - #subs: Map; - - // If any events come in before a subscriber has finished - // registering, queue them - #pending: Map>; - - constructor(network?: Networkish) { - super(network, { batchMaxCount: 1 }); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - - // This value is only valid after _start has been called - /* + #callbacks: Map< + number, + { + payload: JsonRpcPayload; + resolve: (r: any) => void; + reject: (e: Error) => void; + } + >; + + // Maps each filterId to its subscriber + #subs: Map; + + // If any events come in before a subscriber has finished + // registering, queue them + #pending: Map>; + + constructor(network?: Networkish) { + super(network, { batchMaxCount: 1 }); + this.#callbacks = new Map(); + this.#subs = new Map(); + this.#pending = new Map(); + } + + // This value is only valid after _start has been called + /* get _network(): Network { if (this.#network == null) { throw new Error("this shouldn't happen"); @@ -186,66 +186,66 @@ export class SocketProvider extends JsonRpcApiProvider { } */ - _getSubscriber(sub: Subscription): Subscriber { - switch (sub.type) { - case "close": - return new UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - - _register(filterId: number | string, subscriber: SocketSubscriber): void { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - - async _send( - payload: JsonRpcPayload | Array, - ): Promise> { - // WebSocket provider doesn't accept batches - assertArgument( - !Array.isArray(payload), - "WebSocket does not support batch send", - "payload", - payload, - ); - - // @TODO: stringify payloads here and store to prevent mutations - - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - - // Write the request to the socket - await this._write(JSON.stringify(payload)); - - return >[await promise]; - } - - // Sub-classes must call this once they are connected - /* + _getSubscriber(sub: Subscription): Subscriber { + switch (sub.type) { + case "close": + return new UnmanagedSubscriber("close"); + case "block": + return new SocketBlockSubscriber(this); + case "pending": + return new SocketPendingSubscriber(this); + case "event": + return new SocketEventSubscriber(this, sub.filter); + case "orphan": + // Handled auto-matically within AbstractProvider + // when the log.removed = true + if (sub.filter.orphan === "drop-log") { + return new UnmanagedSubscriber("drop-log"); + } + } + return super._getSubscriber(sub); + } + + _register(filterId: number | string, subscriber: SocketSubscriber): void { + this.#subs.set(filterId, subscriber); + const pending = this.#pending.get(filterId); + if (pending) { + for (const message of pending) { + subscriber._handleMessage(message); + } + this.#pending.delete(filterId); + } + } + + async _send( + payload: JsonRpcPayload | Array, + ): Promise> { + // WebSocket provider doesn't accept batches + assertArgument( + !Array.isArray(payload), + "WebSocket does not support batch send", + "payload", + payload, + ); + + // @TODO: stringify payloads here and store to prevent mutations + + // Prepare a promise to respond to + const promise = new Promise((resolve, reject) => { + this.#callbacks.set(payload.id, { payload, resolve, reject }); + }); + + // Wait until the socket is connected before writing to it + await this._waitUntilReady(); + + // Write the request to the socket + await this._write(JSON.stringify(payload)); + + return >[await promise]; + } + + // Sub-classes must call this once they are connected + /* async _start(): Promise { if (this.#ready) { return; } @@ -259,44 +259,44 @@ export class SocketProvider extends JsonRpcApiProvider { } */ - // Sub-classes must call this for each message - async _processMessage(message: string): Promise { - const result = ( - JSON.parse(message) - ); - - if ("id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit( - "error", - makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result, - }), - ); - return; - } - this.#callbacks.delete(result.id); - - callback.resolve(result); - } else if (result.method === "xcb_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - } - - async _write(message: string): Promise { - throw new Error("sub-classes must override this"); - } + // Sub-classes must call this for each message + async _processMessage(message: string): Promise { + const result = ( + JSON.parse(message) + ); + + if ("id" in result) { + const callback = this.#callbacks.get(result.id); + if (callback == null) { + this.emit( + "error", + makeError("received result for unknown id", "UNKNOWN_ERROR", { + reasonCode: "UNKNOWN_ID", + result, + }), + ); + return; + } + this.#callbacks.delete(result.id); + + callback.resolve(result); + } else if (result.method === "xcb_subscription") { + const filterId = result.params.subscription; + const subscriber = this.#subs.get(filterId); + if (subscriber) { + subscriber._handleMessage(result.params.result); + } else { + let pending = this.#pending.get(filterId); + if (pending == null) { + pending = []; + this.#pending.set(filterId, pending); + } + pending.push(result.params.result); + } + } + } + + async _write(message: string): Promise { + throw new Error("sub-classes must override this"); + } } diff --git a/src.ts/providers/provider-websocket.ts b/src.ts/providers/provider-websocket.ts index 89e00a9b2..8b032c7f0 100644 --- a/src.ts/providers/provider-websocket.ts +++ b/src.ts/providers/provider-websocket.ts @@ -5,61 +5,61 @@ import { SocketProvider } from "./provider-socket.js"; import type { Networkish } from "./network.js"; export interface WebSocketLike { - onopen: null | ((...args: Array) => any); - onmessage: null | ((...args: Array) => any); - onerror: null | ((...args: Array) => any); + onopen: null | ((...args: Array) => any); + onmessage: null | ((...args: Array) => any); + onerror: null | ((...args: Array) => any); - readyState: number; + readyState: number; - send(payload: any): void; - close(code?: number, reason?: string): void; + send(payload: any): void; + close(code?: number, reason?: string): void; } export type WebSocketCreator = () => WebSocketLike; export class WebSocketProvider extends SocketProvider { - #connect: null | WebSocketCreator; + #connect: null | WebSocketCreator; - #websocket: null | WebSocketLike; - get websocket(): WebSocketLike { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } + #websocket: null | WebSocketLike; + get websocket(): WebSocketLike { + if (this.#websocket == null) { + throw new Error("websocket closed"); + } + return this.#websocket; + } - constructor( - url: string | WebSocketLike | WebSocketCreator, - network?: Networkish, - ) { - super(network); - if (typeof url === "string") { - this.#connect = () => { - return new _WebSocket(url); - }; - this.#websocket = this.#connect(); - } else if (typeof url === "function") { - this.#connect = url; - this.#websocket = url(); - } else { - this.#connect = null; - this.#websocket = url; - } + constructor( + url: string | WebSocketLike | WebSocketCreator, + network?: Networkish, + ) { + super(network); + if (typeof url === "string") { + this.#connect = () => { + return new _WebSocket(url); + }; + this.#websocket = this.#connect(); + } else if (typeof url === "function") { + this.#connect = url; + this.#websocket = url(); + } else { + this.#connect = null; + this.#websocket = url; + } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; + this.websocket.onopen = async () => { + try { + await this._start(); + this.resume(); + } catch (error) { + console.log("failed to start WebsocketProvider", error); + // @TODO: now what? Attempt reconnect? + } + }; - this.websocket.onmessage = (message: { data: string }) => { - this._processMessage(message.data); - }; - /* + this.websocket.onmessage = (message: { data: string }) => { + this._processMessage(message.data); + }; + /* this.websocket.onclose = (event) => { // @TODO: What event.code should we reconnect on? const reconnect = false; @@ -74,17 +74,17 @@ export class WebSocketProvider extends SocketProvider { } }; */ - } + } - async _write(message: string): Promise { - this.websocket.send(message); - } + async _write(message: string): Promise { + this.websocket.send(message); + } - async destroy(): Promise { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } + async destroy(): Promise { + if (this.#websocket != null) { + this.#websocket.close(); + this.#websocket = null; + } + super.destroy(); + } } diff --git a/src.ts/providers/provider.ts b/src.ts/providers/provider.ts index 22bbf1b70..79373abb6 100644 --- a/src.ts/providers/provider.ts +++ b/src.ts/providers/provider.ts @@ -1,13 +1,13 @@ import { - defineProperties, - getBigInt, - getNumber, - hexlify, - resolveProperties, - assert, - assertArgument, - isError, - makeError, + defineProperties, + getBigInt, + getNumber, + hexlify, + resolveProperties, + assert, + assertArgument, + isError, + makeError, } from "../utils/index.js"; import type { AddressLike, NameResolver } from "../address/index.js"; @@ -22,26 +22,26 @@ const BN_0 = BigInt(0); export type BlockTag = BigNumberish | string; import { - BlockParams, - LogParams, - TransactionReceiptParams, - TransactionResponseParams, + BlockParams, + LogParams, + TransactionReceiptParams, + TransactionResponseParams, } from "./formatting.js"; // ----------------------- function getValue(value: undefined | null | T): null | T { - if (value == null) { - return null; - } - return value; + if (value == null) { + return null; + } + return value; } function toJson(value: null | bigint): null | string { - if (value == null) { - return null; - } - return value.toString(); + if (value == null) { + return null; + } + return value.toString(); } // @TODO? implements Required @@ -51,117 +51,117 @@ function toJson(value: null | bigint): null | string { * the network. */ export class FeeData { - /** - * The energy price for legacy networks. - */ - readonly energyPrice!: null | bigint; - - constructor(energyPrice?: null | bigint) { - defineProperties(this, { - energyPrice: getValue(energyPrice), - }); - } - - /** - * Returns a JSON-friendly value. - */ - toJSON(): any { - const { energyPrice } = this; - return { - _type: "FeeData", - energyPrice: toJson(energyPrice), - }; - } + /** + * The energy price for legacy networks. + */ + readonly energyPrice!: null | bigint; + + constructor(energyPrice?: null | bigint) { + defineProperties(this, { + energyPrice: getValue(energyPrice), + }); + } + + /** + * Returns a JSON-friendly value. + */ + toJSON(): any { + const { energyPrice } = this; + return { + _type: "FeeData", + energyPrice: toJson(energyPrice), + }; + } } export interface TransactionRequest { - type?: null | number; + type?: null | number; - to?: null | AddressLike; - from?: null | AddressLike; + to?: null | AddressLike; + from?: null | AddressLike; - nonce?: null | number; + nonce?: null | number; - energyLimit?: null | BigNumberish; - energyPrice?: null | BigNumberish; + energyLimit?: null | BigNumberish; + energyPrice?: null | BigNumberish; - data?: null | string; - value?: null | BigNumberish; - networkId?: null | BigNumberish; - customData?: any; - // Only meaningful when used for call - blockTag?: BlockTag; - enableCcipRead?: boolean; + data?: null | string; + value?: null | BigNumberish; + networkId?: null | BigNumberish; + customData?: any; + // Only meaningful when used for call + blockTag?: BlockTag; + enableCcipRead?: boolean; - // Todo? - //energyMultiplier?: number; + // Todo? + //energyMultiplier?: number; } export interface PreparedTransactionRequest { - to?: AddressLike; - from?: AddressLike; + to?: AddressLike; + from?: AddressLike; - nonce?: number; + nonce?: number; - energyLimit?: bigint; - energyPrice?: bigint; + energyLimit?: bigint; + energyPrice?: bigint; - data?: string; - value?: bigint; - networkId?: bigint; + data?: string; + value?: bigint; + networkId?: bigint; - customData?: any; + customData?: any; - blockTag?: BlockTag; - enableCcipRead?: boolean; + blockTag?: BlockTag; + enableCcipRead?: boolean; } export function copyRequest( - req: TransactionRequest, + req: TransactionRequest, ): PreparedTransactionRequest { - const result: any = {}; - - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - - if (req.data) { - result.data = hexlify(req.data); - } - - const bigIntKeys = "networkId,energyLimit,energyPrice,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || (req)[key] == null) { - continue; - } - result[key] = getBigInt((req)[key], `request.${key}`); - } - - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || (req)[key] == null) { - continue; - } - result[key] = getNumber((req)[key], `request.${key}`); - } - - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - - if ("enableCcipRead" in req) { - result.enableCcipReadEnabled = !!req.enableCcipRead; - } - - if ("customData" in req) { - result.customData = req.customData; - } - - return result; + const result: any = {}; + + // These could be addresses, ENS names or Addressables + if (req.to) { + result.to = req.to; + } + if (req.from) { + result.from = req.from; + } + + if (req.data) { + result.data = hexlify(req.data); + } + + const bigIntKeys = "networkId,energyLimit,energyPrice,value".split(/,/); + for (const key of bigIntKeys) { + if (!(key in req) || (req)[key] == null) { + continue; + } + result[key] = getBigInt((req)[key], `request.${key}`); + } + + const numberKeys = "type,nonce".split(/,/); + for (const key of numberKeys) { + if (!(key in req) || (req)[key] == null) { + continue; + } + result[key] = getNumber((req)[key], `request.${key}`); + } + + if ("blockTag" in req) { + result.blockTag = req.blockTag; + } + + if ("enableCcipRead" in req) { + result.enableCcipReadEnabled = !!req.enableCcipRead; + } + + if ("customData" in req) { + result.customData = req.customData; + } + + return result; } ////////////////////// @@ -175,11 +175,11 @@ export function copyRequest( * Before a block is included, it is a //pending// block. */ export interface MinedBlock extends Block { - readonly number: number; - readonly hash: string; - readonly timestamp: number; - readonly date: Date; - readonly miner: string; + readonly number: number; + readonly hash: string; + readonly timestamp: number; + readonly date: Date; + readonly miner: string; } /** @@ -187,409 +187,409 @@ export interface MinedBlock extends Block { * Core. */ export class Block implements BlockParams, Iterable { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - readonly provider!: Provider; - - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - readonly number!: number; - - /** - * The block hash. - */ - readonly hash!: null | string; - - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - readonly timestamp!: number; - - /** - * The block hash of the parent block. - */ - readonly parentHash!: string; - - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - readonly nonce!: string; - - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - readonly difficulty!: bigint; - - /** - * The total energy limit for this block. - */ - readonly energyLimit!: bigint; - - /** - * The total energy used in this block. - */ - readonly energyUsed!: bigint; - - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - readonly miner!: string; - - /** - * Any extra data the validator wished to include. - */ - readonly extraData!: string; - - /** - * The base fee per energy that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - readonly baseFeePerEnergy!: null | bigint; - - readonly #transactions: Array; - - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block: BlockParams, provider: Provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof tx !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - - defineProperties(this, { - provider, - - hash: getValue(block.hash), - - number: block.number, - timestamp: block.timestamp, - - parentHash: block.parentHash, - - nonce: block.nonce, - difficulty: block.difficulty, - - energyLimit: block.energyLimit, - energyUsed: block.energyUsed, - miner: block.miner, - extraData: block.extraData, - - baseFeePerEnergy: getValue(block.baseFeePerEnergy), - }); - } - - /** - * Returns the list of transaction hashes. - */ - get transactions(): ReadonlyArray { - return this.#transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return tx.hash; - }); - } - - /** - * Returns the complete transactions for blocks which - * prefetched them, by passing ``true`` to %%prefetchTxs%% - * into [[provider_getBlock]]. - */ - get prefetchedTransactions(): Array { - const txs = this.#transactions.slice(); - - // Doesn't matter... - if (txs.length === 0) { - return []; - } - - // Make sure we prefetched the transactions - assert( - typeof txs[0] === "object", - "transactions were not prefetched with block request", - "UNSUPPORTED_OPERATION", - { - operation: "transactionResponses()", - }, - ); - - return >txs; - } - - /** - * Returns a JSON-friendly value. - */ - toJSON(): any { - const { - baseFeePerEnergy, - difficulty, - extraData, - energyLimit, - energyUsed, - hash, - miner, - nonce, - number, - parentHash, - timestamp, - transactions, - } = this; - - return { - _type: "Block", - baseFeePerEnergy: toJson(baseFeePerEnergy), - difficulty: toJson(difficulty), - extraData, - energyLimit: toJson(energyLimit), - energyUsed: toJson(energyUsed), - hash, - miner, - nonce, - number, - parentHash, - timestamp, - transactions, - }; - } - - [Symbol.iterator](): Iterator { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - - /** - * The number of transactions in this block. - */ - get length(): number { - return this.#transactions.length; - } - - /** - * The [[link-js-date]] this block was included at. - */ - get date(): null | Date { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction( - indexOrHash: number | string, - ): Promise { - // Find the internal value by its index or hash - let tx: string | TransactionResponse | undefined = undefined; - if (typeof indexOrHash === "number") { - tx = this.#transactions[indexOrHash]; - } else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof v === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } else { - if (v.hash === hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - - if (typeof tx === "string") { - return await this.provider.getTransaction(tx); - } else { - return tx; - } - } - - getPrefetchedTransaction(indexOrHash: number | string): TransactionResponse { - const txs = this.prefetchedTransactions; - if (typeof indexOrHash === "number") { - return txs[indexOrHash]; - } - - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - - assertArgument( - false, - "no matching transaction", - "indexOrHash", - indexOrHash, - ); - } - - /** - * Has this block been mined. - * - * If true, the block has been typed-gaurded that all mined - * properties are non-null. - */ - isMined(): this is MinedBlock { - return !!this.hash; - } - - /** - * - */ - isLondon(): this is Block & { baseFeePerEnergy: bigint } { - return !!this.baseFeePerEnergy; - } - - orphanedEvent(): OrphanFilter { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } + /** + * The provider connected to the block used to fetch additional details + * if necessary. + */ + readonly provider!: Provider; + + /** + * The block number, sometimes called the block height. This is a + * sequential number that is one higher than the parent block. + */ + readonly number!: number; + + /** + * The block hash. + */ + readonly hash!: null | string; + + /** + * The timestamp for this block, which is the number of seconds since + * epoch that this block was included. + */ + readonly timestamp!: number; + + /** + * The block hash of the parent block. + */ + readonly parentHash!: string; + + /** + * The nonce. + * + * On legacy networks, this is the random number inserted which + * permitted the difficulty target to be reached. + */ + readonly nonce!: string; + + /** + * The difficulty target. + * + * On legacy networks, this is the proof-of-work target required + * for a block to meet the protocol rules to be included. + * + * On modern networks, this is a random number arrived at using + * randao. @TODO: Find links? + */ + readonly difficulty!: bigint; + + /** + * The total energy limit for this block. + */ + readonly energyLimit!: bigint; + + /** + * The total energy used in this block. + */ + readonly energyUsed!: bigint; + + /** + * The miner coinbase address, wihch receives any subsidies for + * including this block. + */ + readonly miner!: string; + + /** + * Any extra data the validator wished to include. + */ + readonly extraData!: string; + + /** + * The base fee per energy that all transactions in this block were + * charged. + * + * This adjusts after each block, depending on how congested the network + * is. + */ + readonly baseFeePerEnergy!: null | bigint; + + readonly #transactions: Array; + + /** + * Create a new **Block** object. + * + * This should generally not be necessary as the unless implementing a + * low-level library. + */ + constructor(block: BlockParams, provider: Provider) { + this.#transactions = block.transactions.map((tx) => { + if (typeof tx !== "string") { + return new TransactionResponse(tx, provider); + } + return tx; + }); + + defineProperties(this, { + provider, + + hash: getValue(block.hash), + + number: block.number, + timestamp: block.timestamp, + + parentHash: block.parentHash, + + nonce: block.nonce, + difficulty: block.difficulty, + + energyLimit: block.energyLimit, + energyUsed: block.energyUsed, + miner: block.miner, + extraData: block.extraData, + + baseFeePerEnergy: getValue(block.baseFeePerEnergy), + }); + } + + /** + * Returns the list of transaction hashes. + */ + get transactions(): ReadonlyArray { + return this.#transactions.map((tx) => { + if (typeof tx === "string") { + return tx; + } + return tx.hash; + }); + } + + /** + * Returns the complete transactions for blocks which + * prefetched them, by passing ``true`` to %%prefetchTxs%% + * into [[provider_getBlock]]. + */ + get prefetchedTransactions(): Array { + const txs = this.#transactions.slice(); + + // Doesn't matter... + if (txs.length === 0) { + return []; + } + + // Make sure we prefetched the transactions + assert( + typeof txs[0] === "object", + "transactions were not prefetched with block request", + "UNSUPPORTED_OPERATION", + { + operation: "transactionResponses()", + }, + ); + + return >txs; + } + + /** + * Returns a JSON-friendly value. + */ + toJSON(): any { + const { + baseFeePerEnergy, + difficulty, + extraData, + energyLimit, + energyUsed, + hash, + miner, + nonce, + number, + parentHash, + timestamp, + transactions, + } = this; + + return { + _type: "Block", + baseFeePerEnergy: toJson(baseFeePerEnergy), + difficulty: toJson(difficulty), + extraData, + energyLimit: toJson(energyLimit), + energyUsed: toJson(energyUsed), + hash, + miner, + nonce, + number, + parentHash, + timestamp, + transactions, + }; + } + + [Symbol.iterator](): Iterator { + let index = 0; + const txs = this.transactions; + return { + next: () => { + if (index < this.length) { + return { + value: txs[index++], + done: false, + }; + } + return { value: undefined, done: true }; + }, + }; + } + + /** + * The number of transactions in this block. + */ + get length(): number { + return this.#transactions.length; + } + + /** + * The [[link-js-date]] this block was included at. + */ + get date(): null | Date { + if (this.timestamp == null) { + return null; + } + return new Date(this.timestamp * 1000); + } + + /** + * Get the transaction at %%indexe%% within this block. + */ + async getTransaction( + indexOrHash: number | string, + ): Promise { + // Find the internal value by its index or hash + let tx: string | TransactionResponse | undefined = undefined; + if (typeof indexOrHash === "number") { + tx = this.#transactions[indexOrHash]; + } else { + const hash = indexOrHash.toLowerCase(); + for (const v of this.#transactions) { + if (typeof v === "string") { + if (v !== hash) { + continue; + } + tx = v; + break; + } else { + if (v.hash === hash) { + continue; + } + tx = v; + break; + } + } + } + if (tx == null) { + throw new Error("no such tx"); + } + + if (typeof tx === "string") { + return await this.provider.getTransaction(tx); + } else { + return tx; + } + } + + getPrefetchedTransaction(indexOrHash: number | string): TransactionResponse { + const txs = this.prefetchedTransactions; + if (typeof indexOrHash === "number") { + return txs[indexOrHash]; + } + + indexOrHash = indexOrHash.toLowerCase(); + for (const tx of txs) { + if (tx.hash === indexOrHash) { + return tx; + } + } + + assertArgument( + false, + "no matching transaction", + "indexOrHash", + indexOrHash, + ); + } + + /** + * Has this block been mined. + * + * If true, the block has been typed-gaurded that all mined + * properties are non-null. + */ + isMined(): this is MinedBlock { + return !!this.hash; + } + + /** + * + */ + isLondon(): this is Block & { baseFeePerEnergy: bigint } { + return !!this.baseFeePerEnergy; + } + + orphanedEvent(): OrphanFilter { + if (!this.isMined()) { + throw new Error(""); + } + return createOrphanedBlockFilter(this); + } } ////////////////////// // Log export class Log implements LogParams { - readonly provider: Provider; - - readonly transactionHash!: string; - readonly blockHash!: string; - readonly blockNumber!: number; - - readonly removed!: boolean; - - readonly address!: string; - readonly data!: string; - - readonly topics!: ReadonlyArray; - - readonly index!: number; - readonly transactionIndex!: number; - - constructor(log: LogParams, provider: Provider) { - this.provider = provider; - - const topics = Object.freeze(log.topics.slice()); - defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - - removed: log.removed, - - address: log.address, - data: log.data, - - topics, - - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - - toJSON(): any { - const { - address, - blockHash, - blockNumber, - data, - index, - removed, - topics, - transactionHash, - transactionIndex, - } = this; - - return { - _type: "log", - address, - blockHash, - blockNumber, - data, - index, - removed, - topics, - transactionHash, - transactionIndex, - }; - } - - async getBlock(): Promise { - const block = await this.provider.getBlock(this.blockHash); - assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - - async getTransaction(): Promise { - const tx = await this.provider.getTransaction(this.transactionHash); - assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - - async getTransactionReceipt(): Promise { - const receipt = await this.provider.getTransactionReceipt( - this.transactionHash, - ); - assert( - !!receipt, - "failed to find transaction receipt", - "UNKNOWN_ERROR", - {}, - ); - return receipt; - } - - removedEvent(): OrphanFilter { - return createRemovedLogFilter(this); - } + readonly provider: Provider; + + readonly transactionHash!: string; + readonly blockHash!: string; + readonly blockNumber!: number; + + readonly removed!: boolean; + + readonly address!: string; + readonly data!: string; + + readonly topics!: ReadonlyArray; + + readonly index!: number; + readonly transactionIndex!: number; + + constructor(log: LogParams, provider: Provider) { + this.provider = provider; + + const topics = Object.freeze(log.topics.slice()); + defineProperties(this, { + transactionHash: log.transactionHash, + blockHash: log.blockHash, + blockNumber: log.blockNumber, + + removed: log.removed, + + address: log.address, + data: log.data, + + topics, + + index: log.index, + transactionIndex: log.transactionIndex, + }); + } + + toJSON(): any { + const { + address, + blockHash, + blockNumber, + data, + index, + removed, + topics, + transactionHash, + transactionIndex, + } = this; + + return { + _type: "log", + address, + blockHash, + blockNumber, + data, + index, + removed, + topics, + transactionHash, + transactionIndex, + }; + } + + async getBlock(): Promise { + const block = await this.provider.getBlock(this.blockHash); + assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); + return block; + } + + async getTransaction(): Promise { + const tx = await this.provider.getTransaction(this.transactionHash); + assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); + return tx; + } + + async getTransactionReceipt(): Promise { + const receipt = await this.provider.getTransactionReceipt( + this.transactionHash, + ); + assert( + !!receipt, + "failed to find transaction receipt", + "UNKNOWN_ERROR", + {}, + ); + return receipt; + } + + removedEvent(): OrphanFilter { + return createRemovedLogFilter(this); + } } ////////////////////// @@ -610,169 +610,169 @@ export interface ByzantiumTransactionReceipt { */ export class TransactionReceipt - implements TransactionReceiptParams, Iterable + implements TransactionReceiptParams, Iterable { - readonly provider!: Provider; - - readonly to!: null | string; - readonly from!: string; - readonly contractAddress!: null | string; - - readonly hash!: string; - readonly index!: number; - - readonly blockHash!: string; - readonly blockNumber!: number; - - readonly logsBloom!: string; - - readonly energyUsed!: bigint; - readonly cumulativeEnergyUsed!: bigint; - readonly energyPrice!: bigint; - - readonly type!: number; - //readonly byzantium!: boolean; - readonly status!: null | number; - readonly root!: null | string; - - readonly #logs: ReadonlyArray; - - constructor(tx: TransactionReceiptParams, provider: Provider) { - this.#logs = Object.freeze( - tx.logs.map((log) => { - return new Log(log, provider); - }), - ); - - defineProperties(this, { - provider, - - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - - hash: tx.hash, - index: tx.index, - - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - - logsBloom: tx.logsBloom, - - energyUsed: tx.energyUsed, - cumulativeEnergyUsed: tx.cumulativeEnergyUsed, - energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice) as bigint, - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root, - }); - } - - get logs(): ReadonlyArray { - return this.#logs; - } - - toJSON(): any { - const { - to, - from, - contractAddress, - hash, - index, - blockHash, - blockNumber, - logsBloom, - logs, //byzantium, - status, - root, - } = this; - - return { - _type: "TransactionReceipt", - blockHash, - blockNumber, - //byzantium, - contractAddress, - cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed), - from, - energyPrice: toJson(this.energyPrice), - energyUsed: toJson(this.energyUsed), - hash, - index, - logs, - logsBloom, - root, - status, - to, - }; - } - - get length(): number { - return this.logs.length; - } - - [Symbol.iterator](): Iterator { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - }, - }; - } - - get fee(): bigint { - return this.energyUsed * this.energyPrice; - } - - async getBlock(): Promise { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - - async getTransaction(): Promise { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - - async getResult(): Promise { - return await this.provider.getTransactionResult(this.hash); - } - - async confirmations(): Promise { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - - removedEvent(): OrphanFilter { - return createRemovedTransactionFilter(this); - } - - reorderedEvent(other?: TransactionResponse): OrphanFilter { - assert( - !other || other.isMined(), - "unmined 'other' transction cannot be orphaned", - "UNSUPPORTED_OPERATION", - { operation: "reorderedEvent(other)" }, - ); - return createReorderedTransactionFilter(this, other); - } + readonly provider!: Provider; + + readonly to!: null | string; + readonly from!: string; + readonly contractAddress!: null | string; + + readonly hash!: string; + readonly index!: number; + + readonly blockHash!: string; + readonly blockNumber!: number; + + readonly logsBloom!: string; + + readonly energyUsed!: bigint; + readonly cumulativeEnergyUsed!: bigint; + readonly energyPrice!: bigint; + + readonly type!: number; + //readonly byzantium!: boolean; + readonly status!: null | number; + readonly root!: null | string; + + readonly #logs: ReadonlyArray; + + constructor(tx: TransactionReceiptParams, provider: Provider) { + this.#logs = Object.freeze( + tx.logs.map((log) => { + return new Log(log, provider); + }), + ); + + defineProperties(this, { + provider, + + to: tx.to, + from: tx.from, + contractAddress: tx.contractAddress, + + hash: tx.hash, + index: tx.index, + + blockHash: tx.blockHash, + blockNumber: tx.blockNumber, + + logsBloom: tx.logsBloom, + + energyUsed: tx.energyUsed, + cumulativeEnergyUsed: tx.cumulativeEnergyUsed, + energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice) as bigint, + //byzantium: tx.byzantium, + status: tx.status, + root: tx.root, + }); + } + + get logs(): ReadonlyArray { + return this.#logs; + } + + toJSON(): any { + const { + to, + from, + contractAddress, + hash, + index, + blockHash, + blockNumber, + logsBloom, + logs, //byzantium, + status, + root, + } = this; + + return { + _type: "TransactionReceipt", + blockHash, + blockNumber, + //byzantium, + contractAddress, + cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed), + from, + energyPrice: toJson(this.energyPrice), + energyUsed: toJson(this.energyUsed), + hash, + index, + logs, + logsBloom, + root, + status, + to, + }; + } + + get length(): number { + return this.logs.length; + } + + [Symbol.iterator](): Iterator { + let index = 0; + return { + next: () => { + if (index < this.length) { + return { value: this.logs[index++], done: false }; + } + return { value: undefined, done: true }; + }, + }; + } + + get fee(): bigint { + return this.energyUsed * this.energyPrice; + } + + async getBlock(): Promise { + const block = await this.provider.getBlock(this.blockHash); + if (block == null) { + throw new Error("TODO"); + } + return block; + } + + async getTransaction(): Promise { + const tx = await this.provider.getTransaction(this.hash); + if (tx == null) { + throw new Error("TODO"); + } + return tx; + } + + async getResult(): Promise { + return await this.provider.getTransactionResult(this.hash); + } + + async confirmations(): Promise { + return (await this.provider.getBlockNumber()) - this.blockNumber + 1; + } + + removedEvent(): OrphanFilter { + return createRemovedTransactionFilter(this); + } + + reorderedEvent(other?: TransactionResponse): OrphanFilter { + assert( + !other || other.isMined(), + "unmined 'other' transction cannot be orphaned", + "UNSUPPORTED_OPERATION", + { operation: "reorderedEvent(other)" }, + ); + return createReorderedTransactionFilter(this, other); + } } ////////////////////// // Transaction Response export interface MinedTransactionResponse extends TransactionResponse { - blockNumber: number; - blockHash: string; - date: Date; + blockNumber: number; + blockHash: string; + date: Date; } /* @@ -786,491 +786,491 @@ export type ReplacementDetectionSetup = { }; */ export class TransactionResponse - implements TransactionLike, TransactionResponseParams + implements TransactionLike, TransactionResponseParams { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - readonly provider: Provider; - - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockNumber: null | number; - - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockHash: null | string; - - /** - * The index within the block that this transaction resides at. - */ - readonly index!: number; - - /** - * The transaction hash. - */ - readonly hash!: string; - - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - readonly type!: number; - - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - readonly to!: null | string; - - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - readonly from!: string; - - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - readonly nonce!: number; - - /** - * The maximum units of energy this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - readonly energyLimit!: bigint; - - /** - * The energy price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective energy price// (the fee per energy that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerEnergy]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of energy the transaction - * consumes. - */ - readonly energyPrice!: bigint; - - /** - * The data. - */ - readonly data!: string; - - /** - * The value, in ore. Use [[formatXCB]] to format this value - * as xcb. - */ - readonly value!: bigint; - - /** - * The chain ID. - */ - readonly networkId!: bigint; - - /** - * The signature. - */ - readonly signature!: string; - - #startBlock: number; - - /** - * Create a new TransactionResponse with %%tx%% parameters - * connected to %%provider%%. - */ - constructor(tx: TransactionResponseParams, provider: Provider) { - this.provider = provider; - - this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null; - this.blockHash = tx.blockHash != null ? tx.blockHash : null; - - this.hash = tx.hash; - this.index = tx.index; - - this.from = tx.from; - this.to = tx.to || null; - - this.energyLimit = tx.energyLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - - this.energyPrice = tx.energyPrice; - - this.networkId = tx.networkId; - this.signature = tx.signature; - - this.#startBlock = -1; - } - - /** - * Returns a JSON representation of this transaction. - */ - toJSON(): any { - const { index, hash, type, to, from, nonce, data, signature } = this; - - return { - _type: "TransactionReceipt", - networkId: toJson(this.networkId), - data, - from, - energyLimit: toJson(this.energyLimit), - energyPrice: toJson(this.energyPrice), - hash, - nonce, - signature, - to, - index, - type, - value: toJson(this.value), - }; - } - - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock(): Promise { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction(): Promise { - return this.provider.getTransaction(this.hash); - } - - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait( - _confirms?: number, - _timeout?: number, - ): Promise { - const confirms = _confirms == null ? 1 : _confirms; - const timeout = _timeout == null ? 0 : _timeout; - - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = startBlock === -1 ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from), - }); - - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - - // We were replaced; start scanning for that transaction - - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx: TransactionResponse = await block.getTransaction(i); - - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - - // We will retry this on the next block (this case could be optimized) - if (blockNumber - receipt.blockNumber + 1 < confirms) { - return; - } - - // The reason we were replaced - let reason: "replaced" | "repriced" | "cancelled" = "replaced"; - if ( - tx.data === this.data && - tx.to === this.to && - tx.value === this.value - ) { - reason = "repriced"; - } else if ( - tx.data === "0x" && - tx.from === tx.to && - tx.value === BN_0 - ) { - reason = "cancelled"; - } - - assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: reason === "replaced" || reason === "cancelled", - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt, - }); - } - } - - nextScan++; - } - return; - }; - - const receipt = await this.provider.getTransactionReceipt(this.hash); - - if (receipt) { - if ((await receipt.confirmations()) >= confirms) { - return receipt; - } - } else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers: Array<() => void> = []; - const cancel = () => { - cancellers.forEach((c) => c()); - }; - - // On cancel, stop scanning for replacements - cancellers.push(() => { - stopScanning = true; - }); - - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { - clearTimeout(timer); - }); - } - - const txListener = async (receipt: TransactionReceipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - resolve(receipt); - } - }; - cancellers.push(() => { - this.provider.off(this.hash, txListener); - }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { - this.provider.off("block", replaceListener); - }); - this.provider.once("block", replaceListener); - } - }); - - return await (>waiter); - } - - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined(): this is MinedTransactionResponse { - return this.blockHash != null; - } - - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy(): this is TransactionResponse & { - accessList: null; - maxFeePerEnergy: null; - maxPriorityFeePerEnergy: null; - } { - return this.type === 0; - } - - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent(): OrphanFilter { - assert( - this.isMined(), - "unmined transaction canot be orphaned", - "UNSUPPORTED_OPERATION", - { operation: "removeEvent()" }, - ); - return createRemovedTransactionFilter(this); - } - - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter { - assert( - this.isMined(), - "unmined transaction canot be orphaned", - "UNSUPPORTED_OPERATION", - { operation: "removeEvent()" }, - ); - - assert( - !other || other.isMined(), - "unmined 'other' transaction canot be orphaned", - "UNSUPPORTED_OPERATION", - { operation: "removeEvent()" }, - ); - - return createReorderedTransactionFilter(this, other); - } - - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock: number): TransactionResponse { - assertArgument( - Number.isInteger(startBlock) && startBlock >= 0, - "invalid startBlock", - "startBlock", - startBlock, - ); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } + /** + * The provider this is connected to, which will influence how its + * methods will resolve its async inspection methods. + */ + readonly provider: Provider; + + /** + * The block number of the block that this transaction was included in. + * + * This is ``null`` for pending transactions. + */ + readonly blockNumber: null | number; + + /** + * The blockHash of the block that this transaction was included in. + * + * This is ``null`` for pending transactions. + */ + readonly blockHash: null | string; + + /** + * The index within the block that this transaction resides at. + */ + readonly index!: number; + + /** + * The transaction hash. + */ + readonly hash!: string; + + /** + * The [[link-eip-2718]] transaction envelope type. This is + * ``0`` for legacy transactions types. + */ + readonly type!: number; + + /** + * The receiver of this transaction. + * + * If ``null``, then the transaction is an initcode transaction. + * This means the result of executing the [[data]] will be deployed + * as a new contract on chain (assuming it does not revert) and the + * address may be computed using [[getCreateAddress]]. + */ + readonly to!: null | string; + + /** + * The sender of this transaction. It is implicitly computed + * from the transaction pre-image hash (as the digest) and the + * [[signature]] using ecrecover. + */ + readonly from!: string; + + /** + * The nonce, which is used to prevent replay attacks and offer + * a method to ensure transactions from a given sender are explicitly + * ordered. + * + * When sending a transaction, this must be equal to the number of + * transactions ever sent by [[from]]. + */ + readonly nonce!: number; + + /** + * The maximum units of energy this transaction can consume. If execution + * exceeds this, the entries transaction is reverted and the sender + * is charged for the full amount, despite not state changes being made. + */ + readonly energyLimit!: bigint; + + /** + * The energy price can have various values, depending on the network. + * + * In modern networks, for transactions that are included this is + * the //effective energy price// (the fee per energy that was actually + * charged), while for transactions that have not been included yet + * is the [[maxFeePerEnergy]]. + * + * For legacy transactions, or transactions on legacy networks, this + * is the fee that will be charged per unit of energy the transaction + * consumes. + */ + readonly energyPrice!: bigint; + + /** + * The data. + */ + readonly data!: string; + + /** + * The value, in ore. Use [[formatXCB]] to format this value + * as xcb. + */ + readonly value!: bigint; + + /** + * The chain ID. + */ + readonly networkId!: bigint; + + /** + * The signature. + */ + readonly signature!: string; + + #startBlock: number; + + /** + * Create a new TransactionResponse with %%tx%% parameters + * connected to %%provider%%. + */ + constructor(tx: TransactionResponseParams, provider: Provider) { + this.provider = provider; + + this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null; + this.blockHash = tx.blockHash != null ? tx.blockHash : null; + + this.hash = tx.hash; + this.index = tx.index; + + this.from = tx.from; + this.to = tx.to || null; + + this.energyLimit = tx.energyLimit; + this.nonce = tx.nonce; + this.data = tx.data; + this.value = tx.value; + + this.energyPrice = tx.energyPrice; + + this.networkId = tx.networkId; + this.signature = tx.signature; + + this.#startBlock = -1; + } + + /** + * Returns a JSON representation of this transaction. + */ + toJSON(): any { + const { index, hash, type, to, from, nonce, data, signature } = this; + + return { + _type: "TransactionReceipt", + networkId: toJson(this.networkId), + data, + from, + energyLimit: toJson(this.energyLimit), + energyPrice: toJson(this.energyPrice), + hash, + nonce, + signature, + to, + index, + type, + value: toJson(this.value), + }; + } + + /** + * Resolves to the Block that this transaction was included in. + * + * This will return null if the transaction has not been included yet. + */ + async getBlock(): Promise { + let blockNumber = this.blockNumber; + if (blockNumber == null) { + const tx = await this.getTransaction(); + if (tx) { + blockNumber = tx.blockNumber; + } + } + if (blockNumber == null) { + return null; + } + const block = this.provider.getBlock(blockNumber); + if (block == null) { + throw new Error("TODO"); + } + return block; + } + + /** + * Resolves to this transaction being re-requested from the + * provider. This can be used if you have an unmined transaction + * and wish to get an up-to-date populated instance. + */ + async getTransaction(): Promise { + return this.provider.getTransaction(this.hash); + } + + /** + * Resolves once this transaction has been mined and has + * %%confirms%% blocks including it (default: ``1``) with an + * optional %%timeout%%. + * + * This can resolve to ``null`` only if %%confirms%% is ``0`` + * and the transaction has not been mined, otherwise this will + * wait until enough confirmations have completed. + */ + async wait( + _confirms?: number, + _timeout?: number, + ): Promise { + const confirms = _confirms == null ? 1 : _confirms; + const timeout = _timeout == null ? 0 : _timeout; + + let startBlock = this.#startBlock; + let nextScan = -1; + let stopScanning = startBlock === -1 ? true : false; + const checkReplacement = async () => { + // Get the current transaction count for this sender + if (stopScanning) { + return null; + } + const { blockNumber, nonce } = await resolveProperties({ + blockNumber: this.provider.getBlockNumber(), + nonce: this.provider.getTransactionCount(this.from), + }); + + // No transaction or our nonce has not been mined yet; but we + // can start scanning later when we do start + if (nonce < this.nonce) { + startBlock = blockNumber; + return; + } + + // We were mined; no replacement + if (stopScanning) { + return null; + } + const mined = await this.getTransaction(); + if (mined && mined.blockNumber != null) { + return; + } + + // We were replaced; start scanning for that transaction + + // Starting to scan; look back a few extra blocks for safety + if (nextScan === -1) { + nextScan = startBlock - 3; + if (nextScan < this.#startBlock) { + nextScan = this.#startBlock; + } + } + + while (nextScan <= blockNumber) { + // Get the next block to scan + if (stopScanning) { + return null; + } + const block = await this.provider.getBlock(nextScan, true); + + // This should not happen; but we'll try again shortly + if (block == null) { + return; + } + + // We were mined; no replacement + for (const hash of block) { + if (hash === this.hash) { + return; + } + } + + // Search for the transaction that replaced us + for (let i = 0; i < block.length; i++) { + const tx: TransactionResponse = await block.getTransaction(i); + + if (tx.from === this.from && tx.nonce === this.nonce) { + // Get the receipt + if (stopScanning) { + return null; + } + const receipt = await this.provider.getTransactionReceipt(tx.hash); + + // This should not happen; but we'll try again shortly + if (receipt == null) { + return; + } + + // We will retry this on the next block (this case could be optimized) + if (blockNumber - receipt.blockNumber + 1 < confirms) { + return; + } + + // The reason we were replaced + let reason: "replaced" | "repriced" | "cancelled" = "replaced"; + if ( + tx.data === this.data && + tx.to === this.to && + tx.value === this.value + ) { + reason = "repriced"; + } else if ( + tx.data === "0x" && + tx.from === tx.to && + tx.value === BN_0 + ) { + reason = "cancelled"; + } + + assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { + cancelled: reason === "replaced" || reason === "cancelled", + reason, + replacement: tx.replaceableTransaction(startBlock), + hash: tx.hash, + receipt, + }); + } + } + + nextScan++; + } + return; + }; + + const receipt = await this.provider.getTransactionReceipt(this.hash); + + if (receipt) { + if ((await receipt.confirmations()) >= confirms) { + return receipt; + } + } else { + // Check for a replacement; throws if a replacement was found + await checkReplacement(); + + // Allow null only when the confirms is 0 + if (confirms === 0) { + return null; + } + } + + const waiter = new Promise((resolve, reject) => { + // List of things to cancel when we have a result (one way or the other) + const cancellers: Array<() => void> = []; + const cancel = () => { + cancellers.forEach((c) => c()); + }; + + // On cancel, stop scanning for replacements + cancellers.push(() => { + stopScanning = true; + }); + + // Set up any timeout requested + if (timeout > 0) { + const timer = setTimeout(() => { + cancel(); + reject(makeError("wait for transaction timeout", "TIMEOUT")); + }, timeout); + cancellers.push(() => { + clearTimeout(timer); + }); + } + + const txListener = async (receipt: TransactionReceipt) => { + // Done; return it! + if ((await receipt.confirmations()) >= confirms) { + cancel(); + resolve(receipt); + } + }; + cancellers.push(() => { + this.provider.off(this.hash, txListener); + }); + this.provider.on(this.hash, txListener); + // We support replacement detection; start checking + if (startBlock >= 0) { + const replaceListener = async () => { + try { + // Check for a replacement; this throws only if one is found + await checkReplacement(); + } catch (error) { + // We were replaced (with enough confirms); re-throw the error + if (isError(error, "TRANSACTION_REPLACED")) { + cancel(); + reject(error); + return; + } + } + + // Rescheudle a check on the next block + if (!stopScanning) { + this.provider.once("block", replaceListener); + } + }; + cancellers.push(() => { + this.provider.off("block", replaceListener); + }); + this.provider.once("block", replaceListener); + } + }); + + return await (>waiter); + } + + /** + * Returns ``true`` if this transaction has been included. + * + * This is effective only as of the time the TransactionResponse + * was instantiated. To get up-to-date information, use + * [[getTransaction]]. + * + * This provides a Type Guard that this transaction will have + * non-null property values for properties that are null for + * unmined transactions. + */ + isMined(): this is MinedTransactionResponse { + return this.blockHash != null; + } + + /** + * Returns true if the transaction is a legacy (i.e. ``type == 0``) + * transaction. + * + * This provides a Type Guard that this transaction will have + * the ``null``-ness for hardfork-specific properties set correctly. + */ + isLegacy(): this is TransactionResponse & { + accessList: null; + maxFeePerEnergy: null; + maxPriorityFeePerEnergy: null; + } { + return this.type === 0; + } + + /** + * Returns a filter which can be used to listen for orphan events + * that evict this transaction. + */ + removedEvent(): OrphanFilter { + assert( + this.isMined(), + "unmined transaction canot be orphaned", + "UNSUPPORTED_OPERATION", + { operation: "removeEvent()" }, + ); + return createRemovedTransactionFilter(this); + } + + /** + * Returns a filter which can be used to listen for orphan events + * that re-order this event against %%other%%. + */ + reorderedEvent(other?: TransactionResponse): OrphanFilter { + assert( + this.isMined(), + "unmined transaction canot be orphaned", + "UNSUPPORTED_OPERATION", + { operation: "removeEvent()" }, + ); + + assert( + !other || other.isMined(), + "unmined 'other' transaction canot be orphaned", + "UNSUPPORTED_OPERATION", + { operation: "removeEvent()" }, + ); + + return createReorderedTransactionFilter(this, other); + } + + /** + * Returns a new TransactionResponse instance which has the ability to + * detect (and throw an error) if the transaction is replaced, which + * will begin scanning at %%startBlock%%. + * + * This should generally not be used by developers and is intended + * primarily for internal use. Setting an incorrect %%startBlock%% can + * have devastating performance consequences if used incorrectly. + */ + replaceableTransaction(startBlock: number): TransactionResponse { + assertArgument( + Number.isInteger(startBlock) && startBlock >= 0, + "invalid startBlock", + "startBlock", + startBlock, + ); + const tx = new TransactionResponse(this, this.provider); + tx.#startBlock = startBlock; + return tx; + } } ////////////////////// @@ -1284,77 +1284,77 @@ export class TransactionResponse * Not currently fully supported. */ export type OrphanFilter = - | { - orphan: "drop-block"; - hash: string; - number: number; - } - | { - orphan: "drop-transaction"; - tx: { hash: string; blockHash: string; blockNumber: number }; - other?: { hash: string; blockHash: string; blockNumber: number }; - } - | { - orphan: "reorder-transaction"; - tx: { hash: string; blockHash: string; blockNumber: number }; - other?: { hash: string; blockHash: string; blockNumber: number }; - } - | { - orphan: "drop-log"; - log: { - transactionHash: string; - blockHash: string; - blockNumber: number; - address: string; - data: string; - topics: ReadonlyArray; - index: number; - }; - }; + | { + orphan: "drop-block"; + hash: string; + number: number; + } + | { + orphan: "drop-transaction"; + tx: { hash: string; blockHash: string; blockNumber: number }; + other?: { hash: string; blockHash: string; blockNumber: number }; + } + | { + orphan: "reorder-transaction"; + tx: { hash: string; blockHash: string; blockNumber: number }; + other?: { hash: string; blockHash: string; blockNumber: number }; + } + | { + orphan: "drop-log"; + log: { + transactionHash: string; + blockHash: string; + blockNumber: number; + address: string; + data: string; + topics: ReadonlyArray; + index: number; + }; + }; function createOrphanedBlockFilter(block: { - hash: string; - number: number; + hash: string; + number: number; }): OrphanFilter { - return { orphan: "drop-block", hash: block.hash, number: block.number }; + return { orphan: "drop-block", hash: block.hash, number: block.number }; } function createReorderedTransactionFilter( - tx: { hash: string; blockHash: string; blockNumber: number }, - other?: { hash: string; blockHash: string; blockNumber: number }, + tx: { hash: string; blockHash: string; blockNumber: number }, + other?: { hash: string; blockHash: string; blockNumber: number }, ): OrphanFilter { - return { orphan: "reorder-transaction", tx, other }; + return { orphan: "reorder-transaction", tx, other }; } function createRemovedTransactionFilter(tx: { - hash: string; - blockHash: string; - blockNumber: number; + hash: string; + blockHash: string; + blockNumber: number; }): OrphanFilter { - return { orphan: "drop-transaction", tx }; + return { orphan: "drop-transaction", tx }; } function createRemovedLogFilter(log: { - blockHash: string; - transactionHash: string; - blockNumber: number; - address: string; - data: string; - topics: ReadonlyArray; - index: number; + blockHash: string; + transactionHash: string; + blockNumber: number; + address: string; + data: string; + topics: ReadonlyArray; + index: number; }): OrphanFilter { - return { - orphan: "drop-log", - log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index, - }, - }; + return { + orphan: "drop-log", + log: { + transactionHash: log.transactionHash, + blockHash: log.blockHash, + blockNumber: log.blockNumber, + address: log.address, + data: log.data, + topics: Object.freeze(log.topics.slice()), + index: log.index, + }, + }; } ////////////////////// @@ -1375,27 +1375,24 @@ export type TopicFilter = Array>; //export type DeferableTopicFilter = Array | Array>>; export interface EventFilter { - address?: AddressLike | Array; - topics?: TopicFilter; + address?: AddressLike | Array; + topics?: TopicFilter; } export interface Filter extends EventFilter { - fromBlock?: BlockTag; - toBlock?: BlockTag; + fromBlock?: BlockTag; + toBlock?: BlockTag; } export interface FilterByBlockHash extends EventFilter { - blockHash?: string; + blockHash?: string; } ////////////////////// // ProviderEvent export type ProviderEvent = - | string - | Array> - | EventFilter - | OrphanFilter; + string | Array> | EventFilter | OrphanFilter; ////////////////////// // Provider @@ -1421,183 +1418,181 @@ export type ProviderEvent = * broadcast. */ export interface Provider - extends ContractRunner, - EventEmitterable, - NameResolver { - /** - * The provider iteself. - * - * This is part of the necessary API for executing a contract, as - * it provides a common property on any [[ContractRunner]] that - * can be used to access the read-only portion of the runner. - */ - provider: this; - - /** - * Shutdown any resources this provider is using. No additional - * calls should be made to this provider after calling this. - */ - destroy(): void; - - //////////////////// - // State - - /** - * Get the current block number. - */ - getBlockNumber(): Promise; - - /** - * Get the connected [[Network]]. - */ - getNetwork(): Promise; - - /** - * Get the best guess at the recommended [[FeeData]]. - */ - getFeeData(): Promise; - - //////////////////// - // Account - - /** - * Get the account balance (in ore) of %%address%%. If %%blockTag%% - * is specified and the node supports archive access for that - * %%blockTag%%, the balance is as of that [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - - /** - * Get the number of transactions ever sent for %%address%%, which - * is used as the ``nonce`` when sending a transaction. If - * %%blockTag%% is specified and the node supports archive access - * for that %%blockTag%%, the transaction count is as of that - * [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getTransactionCount( - address: AddressLike, - blockTag?: BlockTag, - ): Promise; - - /** - * Get the bytecode for %%address%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - - /** - * Get the storage slot value for %%address%% at slot %%position%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getStorage( - address: AddressLike, - position: BigNumberish, - blockTag?: BlockTag, - ): Promise; - - //////////////////// - // Execution - - /** - * Estimates the amount of energy required to executre %%tx%%. - */ - estimateEnergy(tx: TransactionRequest): Promise; - - /** - * Simulate the execution of %%tx%%. If the call reverts, it will - * throw a [[CallExceptionError]] which includes the revert data. - */ - call(tx: TransactionRequest): Promise; - - /** - * Broadcasts the %%signedTx%% to the network, adding it to the - * memory pool of any node for which the transaction meets the - * rebroadcast requirements. - */ - broadcastTransaction(signedTx: string): Promise; - - //////////////////// - // Queries - - /** - * Resolves to the block for %%blockHashOrBlockTag%%. - * - * If %%prefetchTxs%%, and the backend supports including transactions - * with block requests, all transactions will be included and the - * [[Block]] object will not need to make remote calls for getting - * transactions. - */ - getBlock( - blockHashOrBlockTag: BlockTag | string, - prefetchTxs?: boolean, - ): Promise; - - /** - * Resolves to the transaction for %%hash%%. - * - * If the transaction is unknown or on pruning nodes which - * discard old transactions this resolves to ``null``. - */ - getTransaction(hash: string): Promise; - - /** - * Resolves to the transaction receipt for %%hash%%, if mined. - * - * If the transaction has not been mined, is unknown or on - * pruning nodes which discard old transactions this resolves to - * ``null``. - */ - getTransactionReceipt(hash: string): Promise; - - /** - * Resolves to the result returned by the executions of %%hash%%. - * - * This is only supported on nodes with archive access and with - * the necessary debug APIs enabled. - */ - getTransactionResult(hash: string): Promise; - - //////////////////// - // Bloom-filter Queries - - /** - * Resolves to the list of Logs that match %%filter%% - */ - getLogs(filter: Filter | FilterByBlockHash): Promise>; - - //////////////////// - // ENS - - /** - * Resolves to the address configured for the %%ensName%% or - * ``null`` if unconfigured. - */ - - /** - * Waits until the transaction %%hash%% is mined and has %%confirms%% - * confirmations. - */ - waitForTransaction( - hash: string, - confirms?: number, - timeout?: number, - ): Promise; - - /** - * Resolves to the block at %%blockTag%% once it has been mined. - * - * This can be useful for waiting some number of blocks by using - * the ``currentBlockNumber + N``. - */ - waitForBlock(blockTag?: BlockTag): Promise; + extends ContractRunner, EventEmitterable, NameResolver { + /** + * The provider iteself. + * + * This is part of the necessary API for executing a contract, as + * it provides a common property on any [[ContractRunner]] that + * can be used to access the read-only portion of the runner. + */ + provider: this; + + /** + * Shutdown any resources this provider is using. No additional + * calls should be made to this provider after calling this. + */ + destroy(): void; + + //////////////////// + // State + + /** + * Get the current block number. + */ + getBlockNumber(): Promise; + + /** + * Get the connected [[Network]]. + */ + getNetwork(): Promise; + + /** + * Get the best guess at the recommended [[FeeData]]. + */ + getFeeData(): Promise; + + //////////////////// + // Account + + /** + * Get the account balance (in ore) of %%address%%. If %%blockTag%% + * is specified and the node supports archive access for that + * %%blockTag%%, the balance is as of that [[BlockTag]]. + * + * @note On nodes without archive access enabled, the %%blockTag%% may be + * **silently ignored** by the node, which may cause issues if relied on. + */ + getBalance(address: AddressLike, blockTag?: BlockTag): Promise; + + /** + * Get the number of transactions ever sent for %%address%%, which + * is used as the ``nonce`` when sending a transaction. If + * %%blockTag%% is specified and the node supports archive access + * for that %%blockTag%%, the transaction count is as of that + * [[BlockTag]]. + * + * @note On nodes without archive access enabled, the %%blockTag%% may be + * **silently ignored** by the node, which may cause issues if relied on. + */ + getTransactionCount( + address: AddressLike, + blockTag?: BlockTag, + ): Promise; + + /** + * Get the bytecode for %%address%%. + * + * @note On nodes without archive access enabled, the %%blockTag%% may be + * **silently ignored** by the node, which may cause issues if relied on. + */ + getCode(address: AddressLike, blockTag?: BlockTag): Promise; + + /** + * Get the storage slot value for %%address%% at slot %%position%%. + * + * @note On nodes without archive access enabled, the %%blockTag%% may be + * **silently ignored** by the node, which may cause issues if relied on. + */ + getStorage( + address: AddressLike, + position: BigNumberish, + blockTag?: BlockTag, + ): Promise; + + //////////////////// + // Execution + + /** + * Estimates the amount of energy required to executre %%tx%%. + */ + estimateEnergy(tx: TransactionRequest): Promise; + + /** + * Simulate the execution of %%tx%%. If the call reverts, it will + * throw a [[CallExceptionError]] which includes the revert data. + */ + call(tx: TransactionRequest): Promise; + + /** + * Broadcasts the %%signedTx%% to the network, adding it to the + * memory pool of any node for which the transaction meets the + * rebroadcast requirements. + */ + broadcastTransaction(signedTx: string): Promise; + + //////////////////// + // Queries + + /** + * Resolves to the block for %%blockHashOrBlockTag%%. + * + * If %%prefetchTxs%%, and the backend supports including transactions + * with block requests, all transactions will be included and the + * [[Block]] object will not need to make remote calls for getting + * transactions. + */ + getBlock( + blockHashOrBlockTag: BlockTag | string, + prefetchTxs?: boolean, + ): Promise; + + /** + * Resolves to the transaction for %%hash%%. + * + * If the transaction is unknown or on pruning nodes which + * discard old transactions this resolves to ``null``. + */ + getTransaction(hash: string): Promise; + + /** + * Resolves to the transaction receipt for %%hash%%, if mined. + * + * If the transaction has not been mined, is unknown or on + * pruning nodes which discard old transactions this resolves to + * ``null``. + */ + getTransactionReceipt(hash: string): Promise; + + /** + * Resolves to the result returned by the executions of %%hash%%. + * + * This is only supported on nodes with archive access and with + * the necessary debug APIs enabled. + */ + getTransactionResult(hash: string): Promise; + + //////////////////// + // Bloom-filter Queries + + /** + * Resolves to the list of Logs that match %%filter%% + */ + getLogs(filter: Filter | FilterByBlockHash): Promise>; + + //////////////////// + // ENS + + /** + * Resolves to the address configured for the %%ensName%% or + * ``null`` if unconfigured. + */ + + /** + * Waits until the transaction %%hash%% is mined and has %%confirms%% + * confirmations. + */ + waitForTransaction( + hash: string, + confirms?: number, + timeout?: number, + ): Promise; + + /** + * Resolves to the block at %%blockTag%% once it has been mined. + * + * This can be useful for waiting some number of blocks by using + * the ``currentBlockNumber + N``. + */ + waitForBlock(blockTag?: BlockTag): Promise; } diff --git a/src.ts/providers/signer-noncemanager.ts b/src.ts/providers/signer-noncemanager.ts index cb5b3e170..4911dd778 100644 --- a/src.ts/providers/signer-noncemanager.ts +++ b/src.ts/providers/signer-noncemanager.ts @@ -4,82 +4,82 @@ import { AbstractSigner } from "./abstract-signer.js"; import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; import type { - BlockTag, - Provider, - TransactionRequest, - TransactionResponse, + BlockTag, + Provider, + TransactionRequest, + TransactionResponse, } from "./provider.js"; import type { Signer } from "./signer.js"; export class NonceManager extends AbstractSigner { - signer!: Signer; - - #noncePromise: null | Promise; - #delta: number; - - constructor(signer: Signer) { - super(signer.provider); - defineProperties(this, { signer }); - - this.#noncePromise = null; - this.#delta = 0; - } - - async getAddress(): Promise { - return this.signer.getAddress(); - } - - connect(provider: null | Provider): NonceManager { - return new NonceManager(this.signer.connect(provider)); - } - - async getNonce(blockTag?: BlockTag): Promise { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - - return super.getNonce(blockTag); - } - - increment(): void { - this.#delta++; - } - - reset(): void { - this.#delta = 0; - this.#noncePromise = null; - } - - async sendTransaction(tx: TransactionRequest): Promise { - const noncePromise = this.getNonce("pending"); - this.increment(); - - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - - signTransaction(tx: TransactionRequest): Promise { - return this.signer.signTransaction(tx); - } - - signMessage(message: string | Uint8Array): Promise { - return this.signer.signMessage(message); - } - - signTypedData( - domain: TypedDataDomain, - types: Record>, - value: Record, - ): Promise { - return this.signer.signTypedData(domain, types, value); - } + signer!: Signer; + + #noncePromise: null | Promise; + #delta: number; + + constructor(signer: Signer) { + super(signer.provider); + defineProperties(this, { signer }); + + this.#noncePromise = null; + this.#delta = 0; + } + + async getAddress(): Promise { + return this.signer.getAddress(); + } + + connect(provider: null | Provider): NonceManager { + return new NonceManager(this.signer.connect(provider)); + } + + async getNonce(blockTag?: BlockTag): Promise { + if (blockTag === "pending") { + if (this.#noncePromise == null) { + this.#noncePromise = super.getNonce("pending"); + } + + const delta = this.#delta; + return (await this.#noncePromise) + delta; + } + + return super.getNonce(blockTag); + } + + increment(): void { + this.#delta++; + } + + reset(): void { + this.#delta = 0; + this.#noncePromise = null; + } + + async sendTransaction(tx: TransactionRequest): Promise { + const noncePromise = this.getNonce("pending"); + this.increment(); + + tx = await this.signer.populateTransaction(tx); + tx.nonce = await noncePromise; + + // @TODO: Maybe handle interesting/recoverable errors? + // Like don't increment if the tx was certainly not sent + return await this.signer.sendTransaction(tx); + } + + signTransaction(tx: TransactionRequest): Promise { + return this.signer.signTransaction(tx); + } + + signMessage(message: string | Uint8Array): Promise { + return this.signer.signMessage(message); + } + + signTypedData( + domain: TypedDataDomain, + types: Record>, + value: Record, + ): Promise { + return this.signer.signTypedData(domain, types, value); + } } diff --git a/src.ts/providers/signer.ts b/src.ts/providers/signer.ts index 6acd195c6..362090047 100644 --- a/src.ts/providers/signer.ts +++ b/src.ts/providers/signer.ts @@ -4,10 +4,10 @@ import type { TransactionLike } from "../transaction/index.js"; import type { ContractRunner } from "./contracts.js"; import type { - BlockTag, - Provider, - TransactionRequest, - TransactionResponse, + BlockTag, + Provider, + TransactionRequest, + TransactionResponse, } from "./provider.js"; /** @@ -19,134 +19,134 @@ import type { * private key may not be known). */ export interface Signer extends Addressable, ContractRunner, NameResolver { - /** - * The [[Provider]] attached to this Signer (if any). - */ - provider: null | Provider; - - /** - * Returns a new instance of this Signer connected to //provider// or detached - * from any Provider if null. - */ - connect(provider: null | Provider): Signer; - - //////////////////// - // State - - /** - * Get the address of the Signer. - */ - getAddress(): Promise; - - /** - * Gets the next nonce required for this Signer to send a transaction. - * - * @param blockTag - The blocktag to base the transaction count on, keep in mind - * many nodes do not honour this value and silently ignore it [default: ``"latest"``] - */ - getNonce(blockTag?: BlockTag): Promise; - - //////////////////// - // Preparation - - /** - * Prepares a {@link TransactionRequest} for calling: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - * @param tx - The call to prepare - */ - populateCall(tx: TransactionRequest): Promise>; - - /** - * Prepares a {@link TransactionRequest} for sending to the network by - * populating any missing properties: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``energyLimit`` via ``signer.estimateEnergy(tx)`` - * - populates ``networkId`` via ``signer.provider.getNetwork()`` - * - populates ``type`` and relevant fee data for that type (``energyPrice`` - * for legacy transactions, ``maxFeePerEnergy`` for EIP-1559, etc) - * - * @note Some Signer implementations may skip populating properties that - * are populated downstream; for example JsonRpcSigner defers to the - * node to populate the nonce and fee data. - * - * @param tx - The call to prepare - */ - populateTransaction(tx: TransactionRequest): Promise>; - - //////////////////// - // Execution - - /** - * Estimates the required energy required to execute //tx// on the Blockchain. This - * will be the expected amount a transaction will require as its ``energyLimit`` - * to successfully run all the necessary computations and store the needed state - * that the transaction intends. - * - * Keep in mind that this is **best efforts**, since the state of the Blockchain - * is in flux, which could affect transaction energy requirements. - * - * @throws UNPREDICTABLE_ENERGY_LIMIT A transaction that is believed by the node to likely - * fail will throw an error during energy estimation. This could indicate that it - * will actually fail or that the circumstances are simply too complex for the - * node to take into account. In these cases, a manually determined ``energyLimit`` - * will need to be made. - */ - estimateEnergy(tx: TransactionRequest): Promise; - - /** - * Evaluates the //tx// by running it against the current Blockchain state. This - * cannot change state and has no cost in xcb, as it is effectively simulating - * execution. - * - * This can be used to have the Blockchain perform computations based on its state - * (e.g. running a Contract's getters) or to simulate the effect of a transaction - * before actually performing an operation. - */ - call(tx: TransactionRequest): Promise; - - /** - * Resolves an ENS Name to an address. - */ - resolveName(name: string): Promise; - - //////////////////// - // Signing - - /** - * Signs %%tx%%, returning the fully signed transaction. This does not - * populate any additional properties within the transaction. - */ - signTransaction(tx: TransactionRequest): Promise; - - /** - * Sends %%tx%% to the Network. The ``signer.populateTransaction(tx)`` - * is called first to ensure all necessary properties for the - * transaction to be valid have been popualted first. - */ - sendTransaction(tx: TransactionRequest): Promise; - - /** - * Signers an [[link-eip-191]] prefixed personal message. - * - * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is **not** - * interpretted as a [[BytesLike]]; so the string ``"0x1234"`` is signed as six - * characters, **not** two bytes. - * - * To sign that example as two bytes, the Uint8Array should be used - * (i.e. ``new Uint8Array([ 0x12, 0x34 ])``). - */ - signMessage(message: string | Uint8Array): Promise; - - /** - * Signs the [[link-eip-712]] typed data. - */ - signTypedData( - domain: TypedDataDomain, - types: Record>, - value: Record, - ): Promise; + /** + * The [[Provider]] attached to this Signer (if any). + */ + provider: null | Provider; + + /** + * Returns a new instance of this Signer connected to //provider// or detached + * from any Provider if null. + */ + connect(provider: null | Provider): Signer; + + //////////////////// + // State + + /** + * Get the address of the Signer. + */ + getAddress(): Promise; + + /** + * Gets the next nonce required for this Signer to send a transaction. + * + * @param blockTag - The blocktag to base the transaction count on, keep in mind + * many nodes do not honour this value and silently ignore it [default: ``"latest"``] + */ + getNonce(blockTag?: BlockTag): Promise; + + //////////////////// + // Preparation + + /** + * Prepares a {@link TransactionRequest} for calling: + * - resolves ``to`` and ``from`` addresses + * - if ``from`` is specified , check that it matches this Signer + * + * @param tx - The call to prepare + */ + populateCall(tx: TransactionRequest): Promise>; + + /** + * Prepares a {@link TransactionRequest} for sending to the network by + * populating any missing properties: + * - resolves ``to`` and ``from`` addresses + * - if ``from`` is specified , check that it matches this Signer + * - populates ``nonce`` via ``signer.getNonce("pending")`` + * - populates ``energyLimit`` via ``signer.estimateEnergy(tx)`` + * - populates ``networkId`` via ``signer.provider.getNetwork()`` + * - populates ``type`` and relevant fee data for that type (``energyPrice`` + * for legacy transactions, ``maxFeePerEnergy`` for EIP-1559, etc) + * + * @note Some Signer implementations may skip populating properties that + * are populated downstream; for example JsonRpcSigner defers to the + * node to populate the nonce and fee data. + * + * @param tx - The call to prepare + */ + populateTransaction(tx: TransactionRequest): Promise>; + + //////////////////// + // Execution + + /** + * Estimates the required energy required to execute //tx// on the Blockchain. This + * will be the expected amount a transaction will require as its ``energyLimit`` + * to successfully run all the necessary computations and store the needed state + * that the transaction intends. + * + * Keep in mind that this is **best efforts**, since the state of the Blockchain + * is in flux, which could affect transaction energy requirements. + * + * @throws UNPREDICTABLE_ENERGY_LIMIT A transaction that is believed by the node to likely + * fail will throw an error during energy estimation. This could indicate that it + * will actually fail or that the circumstances are simply too complex for the + * node to take into account. In these cases, a manually determined ``energyLimit`` + * will need to be made. + */ + estimateEnergy(tx: TransactionRequest): Promise; + + /** + * Evaluates the //tx// by running it against the current Blockchain state. This + * cannot change state and has no cost in xcb, as it is effectively simulating + * execution. + * + * This can be used to have the Blockchain perform computations based on its state + * (e.g. running a Contract's getters) or to simulate the effect of a transaction + * before actually performing an operation. + */ + call(tx: TransactionRequest): Promise; + + /** + * Resolves an ENS Name to an address. + */ + resolveName(name: string): Promise; + + //////////////////// + // Signing + + /** + * Signs %%tx%%, returning the fully signed transaction. This does not + * populate any additional properties within the transaction. + */ + signTransaction(tx: TransactionRequest): Promise; + + /** + * Sends %%tx%% to the Network. The ``signer.populateTransaction(tx)`` + * is called first to ensure all necessary properties for the + * transaction to be valid have been popualted first. + */ + sendTransaction(tx: TransactionRequest): Promise; + + /** + * Signers an [[link-eip-191]] prefixed personal message. + * + * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is **not** + * interpretted as a [[BytesLike]]; so the string ``"0x1234"`` is signed as six + * characters, **not** two bytes. + * + * To sign that example as two bytes, the Uint8Array should be used + * (i.e. ``new Uint8Array([ 0x12, 0x34 ])``). + */ + signMessage(message: string | Uint8Array): Promise; + + /** + * Signs the [[link-eip-712]] typed data. + */ + signTypedData( + domain: TypedDataDomain, + types: Record>, + value: Record, + ): Promise; } diff --git a/src.ts/providers/subscriber-connection.ts b/src.ts/providers/subscriber-connection.ts index 4dd9992be..16a113667 100644 --- a/src.ts/providers/subscriber-connection.ts +++ b/src.ts/providers/subscriber-connection.ts @@ -11,9 +11,9 @@ import type { Provider } from "./provider.js"; * @_docloc: api/providers/abstract-provider */ export interface ConnectionRpcProvider extends Provider { - //send(method: string, params: Array): Promise; - _subscribe(param: Array, processFunc: (result: any) => void): number; - _unsubscribe(filterId: number): void; + //send(method: string, params: Array): Promise; + _subscribe(param: Array, processFunc: (result: any) => void): number; + _unsubscribe(filterId: number): void; } /** @@ -22,57 +22,57 @@ export interface ConnectionRpcProvider extends Provider { * @_docloc: api/providers/abstract-provider */ export class BlockConnectionSubscriber implements Subscriber { - #provider: ConnectionRpcProvider; - #blockNumber: number; + #provider: ConnectionRpcProvider; + #blockNumber: number; - #running: boolean; + #running: boolean; - #filterId: null | number; + #filterId: null | number; - constructor(provider: ConnectionRpcProvider) { - this.#provider = provider; - this.#blockNumber = -2; - this.#running = false; - this.#filterId = null; - } + constructor(provider: ConnectionRpcProvider) { + this.#provider = provider; + this.#blockNumber = -2; + this.#running = false; + this.#filterId = null; + } - start(): void { - if (this.#running) { - return; - } - this.#running = true; + start(): void { + if (this.#running) { + return; + } + this.#running = true; - this.#filterId = this.#provider._subscribe(["newHeads"], (result: any) => { - const blockNumber = getNumber(result.number); - const initial = - this.#blockNumber === -2 ? blockNumber : this.#blockNumber + 1; - for (let b = initial; b <= blockNumber; b++) { - this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - }); - } + this.#filterId = this.#provider._subscribe(["newHeads"], (result: any) => { + const blockNumber = getNumber(result.number); + const initial = + this.#blockNumber === -2 ? blockNumber : this.#blockNumber + 1; + for (let b = initial; b <= blockNumber; b++) { + this.#provider.emit("block", b); + } + this.#blockNumber = blockNumber; + }); + } - stop(): void { - if (!this.#running) { - return; - } - this.#running = false; + stop(): void { + if (!this.#running) { + return; + } + this.#running = false; - if (this.#filterId != null) { - this.#provider._unsubscribe(this.#filterId); - this.#filterId = null; - } - } + if (this.#filterId != null) { + this.#provider._unsubscribe(this.#filterId); + this.#filterId = null; + } + } - pause(dropWhilePaused?: boolean): void { - if (dropWhilePaused) { - this.#blockNumber = -2; - } - this.stop(); - } + pause(dropWhilePaused?: boolean): void { + if (dropWhilePaused) { + this.#blockNumber = -2; + } + this.stop(); + } - resume(): void { - this.start(); - } + resume(): void { + this.start(); + } } diff --git a/src.ts/providers/subscriber-filterid.ts b/src.ts/providers/subscriber-filterid.ts index 937a93728..7d24d811d 100644 --- a/src.ts/providers/subscriber-filterid.ts +++ b/src.ts/providers/subscriber-filterid.ts @@ -8,7 +8,7 @@ import type { EventFilter } from "./provider.js"; import type { JsonRpcApiProvider } from "./provider-jsonrpc.js"; function copy(obj: any): any { - return JSON.parse(JSON.stringify(obj)); + return JSON.parse(JSON.stringify(obj)); } /** @@ -22,134 +22,134 @@ function copy(obj: any): any { * @_docloc: api/providers/abstract-provider */ export class FilterIdSubscriber implements Subscriber { - #provider: JsonRpcApiProvider; - - #filterIdPromise: null | Promise; - #poller: (b: number) => Promise; - - #running: boolean; - - #network: null | Network; - - #hault: boolean; - - constructor(provider: JsonRpcApiProvider) { - this.#provider = provider; - - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - - this.#running = false; - - this.#network = null; - - this.#hault = false; - } - - _subscribe(provider: JsonRpcApiProvider): Promise { - throw new Error("subclasses must override this"); - } - - _emitResults(provider: AbstractProvider, result: Array): Promise { - throw new Error("subclasses must override this"); - } - - _recover(provider: AbstractProvider): Subscriber { - throw new Error("subclasses must override this"); - } - - async #poll(blockNumber: number): Promise { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - - // Get the Filter ID - let filterId: null | string = null; - try { - filterId = await this.#filterIdPromise; - } catch (error) { - if ( - !isError(error, "UNSUPPORTED_OPERATION") || - error.operation !== "xcb_newFilter" - ) { - throw error; - } - } - - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - - if ((this.#network as Network).networkId !== network.networkId) { - throw new Error("chaid changed"); - } - - if (this.#hault) { - return; - } - - const result = await this.#provider.send("xcb_getFilterChanges", [ - filterId, - ]); - await this._emitResults(this.#provider, result); - } catch (error) { - console.log("@TODO", error); - } - - this.#provider.once("block", this.#poller); - } - - #teardown(): void { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - this.#provider.send("xcb_uninstallFilter", [filterId]); - }); - } - } - - start(): void { - if (this.#running) { - return; - } - this.#running = true; - - this.#poll(-2); - } - - stop(): void { - if (!this.#running) { - return; - } - this.#running = false; - - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - - pause(dropWhilePaused?: boolean): void { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - - resume(): void { - this.start(); - } + #provider: JsonRpcApiProvider; + + #filterIdPromise: null | Promise; + #poller: (b: number) => Promise; + + #running: boolean; + + #network: null | Network; + + #hault: boolean; + + constructor(provider: JsonRpcApiProvider) { + this.#provider = provider; + + this.#filterIdPromise = null; + this.#poller = this.#poll.bind(this); + + this.#running = false; + + this.#network = null; + + this.#hault = false; + } + + _subscribe(provider: JsonRpcApiProvider): Promise { + throw new Error("subclasses must override this"); + } + + _emitResults(provider: AbstractProvider, result: Array): Promise { + throw new Error("subclasses must override this"); + } + + _recover(provider: AbstractProvider): Subscriber { + throw new Error("subclasses must override this"); + } + + async #poll(blockNumber: number): Promise { + try { + // Subscribe if necessary + if (this.#filterIdPromise == null) { + this.#filterIdPromise = this._subscribe(this.#provider); + } + + // Get the Filter ID + let filterId: null | string = null; + try { + filterId = await this.#filterIdPromise; + } catch (error) { + if ( + !isError(error, "UNSUPPORTED_OPERATION") || + error.operation !== "xcb_newFilter" + ) { + throw error; + } + } + + // The backend does not support Filter ID; downgrade to + // polling + if (filterId == null) { + this.#filterIdPromise = null; + this.#provider._recoverSubscriber(this, this._recover(this.#provider)); + return; + } + + const network = await this.#provider.getNetwork(); + if (!this.#network) { + this.#network = network; + } + + if ((this.#network as Network).networkId !== network.networkId) { + throw new Error("chaid changed"); + } + + if (this.#hault) { + return; + } + + const result = await this.#provider.send("xcb_getFilterChanges", [ + filterId, + ]); + await this._emitResults(this.#provider, result); + } catch (error) { + console.log("@TODO", error); + } + + this.#provider.once("block", this.#poller); + } + + #teardown(): void { + const filterIdPromise = this.#filterIdPromise; + if (filterIdPromise) { + this.#filterIdPromise = null; + filterIdPromise.then((filterId) => { + this.#provider.send("xcb_uninstallFilter", [filterId]); + }); + } + } + + start(): void { + if (this.#running) { + return; + } + this.#running = true; + + this.#poll(-2); + } + + stop(): void { + if (!this.#running) { + return; + } + this.#running = false; + + this.#hault = true; + this.#teardown(); + this.#provider.off("block", this.#poller); + } + + pause(dropWhilePaused?: boolean): void { + if (dropWhilePaused) { + this.#teardown(); + } + this.#provider.off("block", this.#poller); + } + + resume(): void { + this.start(); + } } /** @@ -158,30 +158,30 @@ export class FilterIdSubscriber implements Subscriber { * @_docloc: api/providers/abstract-provider */ export class FilterIdEventSubscriber extends FilterIdSubscriber { - #event: EventFilter; - - constructor(provider: JsonRpcApiProvider, filter: EventFilter) { - super(provider); - this.#event = copy(filter); - } - - _recover(provider: AbstractProvider): Subscriber { - return new PollingEventSubscriber(provider, this.#event); - } - - async _subscribe(provider: JsonRpcApiProvider): Promise { - const filterId = await provider.send("xcb_newFilter", [this.#event]); - return filterId; - } - - async _emitResults( - provider: JsonRpcApiProvider, - results: Array, - ): Promise { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } + #event: EventFilter; + + constructor(provider: JsonRpcApiProvider, filter: EventFilter) { + super(provider); + this.#event = copy(filter); + } + + _recover(provider: AbstractProvider): Subscriber { + return new PollingEventSubscriber(provider, this.#event); + } + + async _subscribe(provider: JsonRpcApiProvider): Promise { + const filterId = await provider.send("xcb_newFilter", [this.#event]); + return filterId; + } + + async _emitResults( + provider: JsonRpcApiProvider, + results: Array, + ): Promise { + for (const result of results) { + provider.emit(this.#event, provider._wrapLog(result, provider._network)); + } + } } /** @@ -190,16 +190,16 @@ export class FilterIdEventSubscriber extends FilterIdSubscriber { * @_docloc: api/providers/abstract-provider */ export class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider: JsonRpcApiProvider): Promise { - return await provider.send("xcb_newPendingTransactionFilter", []); - } - - async _emitResults( - provider: JsonRpcApiProvider, - results: Array, - ): Promise { - for (const result of results) { - provider.emit("pending", result); - } - } + async _subscribe(provider: JsonRpcApiProvider): Promise { + return await provider.send("xcb_newPendingTransactionFilter", []); + } + + async _emitResults( + provider: JsonRpcApiProvider, + results: Array, + ): Promise { + for (const result of results) { + provider.emit("pending", result); + } + } } diff --git a/src.ts/providers/subscriber-polling.ts b/src.ts/providers/subscriber-polling.ts index b0ed29783..80ad1b1bf 100644 --- a/src.ts/providers/subscriber-polling.ts +++ b/src.ts/providers/subscriber-polling.ts @@ -4,7 +4,7 @@ import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; import type { EventFilter, OrphanFilter, ProviderEvent } from "./provider.js"; function copy(obj: any): any { - return JSON.parse(JSON.stringify(obj)); + return JSON.parse(JSON.stringify(obj)); } /** @@ -13,20 +13,20 @@ function copy(obj: any): any { * @_docloc: api/providers/abstract-provider */ export function getPollingSubscriber( - provider: AbstractProvider, - event: ProviderEvent, + provider: AbstractProvider, + event: ProviderEvent, ): Subscriber { - if (event === "block") { - return new PollingBlockSubscriber(provider); - } - if (isHexString(event, 32)) { - return new PollingTransactionSubscriber(provider, event); - } - - assert(false, "unsupported polling event", "UNSUPPORTED_OPERATION", { - operation: "getPollingSubscriber", - info: { event }, - }); + if (event === "block") { + return new PollingBlockSubscriber(provider); + } + if (isHexString(event, 32)) { + return new PollingTransactionSubscriber(provider, event); + } + + assert(false, "unsupported polling event", "UNSUPPORTED_OPERATION", { + operation: "getPollingSubscriber", + info: { event }, + }); } // @TODO: refactor this @@ -37,100 +37,100 @@ export function getPollingSubscriber( * @_docloc: api/providers/abstract-provider */ export class PollingBlockSubscriber implements Subscriber { - #provider: AbstractProvider; - #poller: null | number; - - #interval: number; - - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber: number; - - constructor(provider: AbstractProvider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - - this.#blockNumber = -2; - } - - get pollingInterval(): number { - return this.#interval; - } - set pollingInterval(value: number) { - this.#interval = value; - } - - async #poll(): Promise { - try { - const blockNumber = await this.#provider.getBlockNumber(); - - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - - // @TODO: Put a cap on the maximum number of events per loop? - - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - - await this.#provider.emit("block", b); - } - - this.#blockNumber = blockNumber; - } - } catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - - // We have been stopped - if (this.#poller == null) { - return; - } - - this.#poller = this.#provider._setTimeout( - this.#poll.bind(this), - this.#interval, - ); - } - - start(): void { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout( - this.#poll.bind(this), - this.#interval, - ); - this.#poll(); - } - - stop(): void { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - - pause(dropWhilePaused?: boolean): void { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - - resume(): void { - this.start(); - } + #provider: AbstractProvider; + #poller: null | number; + + #interval: number; + + // The most recent block we have scanned for events. The value -2 + // indicates we still need to fetch an initial block number + #blockNumber: number; + + constructor(provider: AbstractProvider) { + this.#provider = provider; + this.#poller = null; + this.#interval = 4000; + + this.#blockNumber = -2; + } + + get pollingInterval(): number { + return this.#interval; + } + set pollingInterval(value: number) { + this.#interval = value; + } + + async #poll(): Promise { + try { + const blockNumber = await this.#provider.getBlockNumber(); + + // Bootstrap poll to setup our initial block number + if (this.#blockNumber === -2) { + this.#blockNumber = blockNumber; + return; + } + + // @TODO: Put a cap on the maximum number of events per loop? + + if (blockNumber !== this.#blockNumber) { + for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { + // We have been stopped + if (this.#poller == null) { + return; + } + + await this.#provider.emit("block", b); + } + + this.#blockNumber = blockNumber; + } + } catch (error) { + // @TODO: Minor bump, add an "error" event to let subscribers + // know things went awry. + //console.log(error); + } + + // We have been stopped + if (this.#poller == null) { + return; + } + + this.#poller = this.#provider._setTimeout( + this.#poll.bind(this), + this.#interval, + ); + } + + start(): void { + if (this.#poller) { + return; + } + this.#poller = this.#provider._setTimeout( + this.#poll.bind(this), + this.#interval, + ); + this.#poll(); + } + + stop(): void { + if (!this.#poller) { + return; + } + this.#provider._clearTimeout(this.#poller); + this.#poller = null; + } + + pause(dropWhilePaused?: boolean): void { + this.stop(); + if (dropWhilePaused) { + this.#blockNumber = -2; + } + } + + resume(): void { + this.start(); + } } /** @@ -139,47 +139,47 @@ export class PollingBlockSubscriber implements Subscriber { * @_docloc: api/providers/abstract-provider */ export class OnBlockSubscriber implements Subscriber { - #provider: AbstractProvider; - #poll: (b: number) => void; - #running: boolean; - - constructor(provider: AbstractProvider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber: number) => { - this._poll(blockNumber, this.#provider); - }; - } - - async _poll(blockNumber: number, provider: AbstractProvider): Promise { - throw new Error("sub-classes must override this"); - } - - start(): void { - if (this.#running) { - return; - } - this.#running = true; - - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - - stop(): void { - if (!this.#running) { - return; - } - this.#running = false; - - this.#provider.off("block", this.#poll); - } - - pause(dropWhilePaused?: boolean): void { - this.stop(); - } - resume(): void { - this.start(); - } + #provider: AbstractProvider; + #poll: (b: number) => void; + #running: boolean; + + constructor(provider: AbstractProvider) { + this.#provider = provider; + this.#running = false; + this.#poll = (blockNumber: number) => { + this._poll(blockNumber, this.#provider); + }; + } + + async _poll(blockNumber: number, provider: AbstractProvider): Promise { + throw new Error("sub-classes must override this"); + } + + start(): void { + if (this.#running) { + return; + } + this.#running = true; + + this.#poll(-2); + this.#provider.on("block", this.#poll); + } + + stop(): void { + if (!this.#running) { + return; + } + this.#running = false; + + this.#provider.off("block", this.#poll); + } + + pause(dropWhilePaused?: boolean): void { + this.stop(); + } + resume(): void { + this.start(); + } } /** @@ -188,17 +188,17 @@ export class OnBlockSubscriber implements Subscriber { * @_docloc: api/providers/abstract-provider */ export class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter: OrphanFilter; + #filter: OrphanFilter; - constructor(provider: AbstractProvider, filter: OrphanFilter) { - super(provider); - this.#filter = copy(filter); - } + constructor(provider: AbstractProvider, filter: OrphanFilter) { + super(provider); + this.#filter = copy(filter); + } - async _poll(blockNumber: number, provider: AbstractProvider): Promise { - throw new Error("@TODO"); - console.log(this.#filter); - } + async _poll(blockNumber: number, provider: AbstractProvider): Promise { + throw new Error("@TODO"); + console.log(this.#filter); + } } /** @@ -207,19 +207,19 @@ export class PollingOrphanSubscriber extends OnBlockSubscriber { * @_docloc: api/providers/abstract-provider */ export class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash: string; - - constructor(provider: AbstractProvider, hash: string) { - super(provider); - this.#hash = hash; - } - - async _poll(blockNumber: number, provider: AbstractProvider): Promise { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } + #hash: string; + + constructor(provider: AbstractProvider, hash: string) { + super(provider); + this.#hash = hash; + } + + async _poll(blockNumber: number, provider: AbstractProvider): Promise { + const tx = await provider.getTransactionReceipt(this.#hash); + if (tx) { + provider.emit(this.#hash, tx); + } + } } /** @@ -228,82 +228,82 @@ export class PollingTransactionSubscriber extends OnBlockSubscriber { * @_docloc: api/providers/abstract-provider */ export class PollingEventSubscriber implements Subscriber { - #provider: AbstractProvider; - #filter: EventFilter; - #poller: (b: number) => void; - - #running: boolean; - - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber: number; - - constructor(provider: AbstractProvider, filter: EventFilter) { - this.#provider = provider; - this.#filter = copy(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - - async #poll(blockNumber: number): Promise { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - - const filter = copy(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - - this.#blockNumber = blockNumber; - - for (const log of logs) { - this.#provider.emit(this.#filter, log); - } - } - - start(): void { - if (this.#running) { - return; - } - this.#running = true; - - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - - stop(): void { - if (!this.#running) { - return; - } - this.#running = false; - - this.#provider.off("block", this.#poller); - } - - pause(dropWhilePaused?: boolean): void { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - - resume(): void { - this.start(); - } + #provider: AbstractProvider; + #filter: EventFilter; + #poller: (b: number) => void; + + #running: boolean; + + // The most recent block we have scanned for events. The value -2 + // indicates we still need to fetch an initial block number + #blockNumber: number; + + constructor(provider: AbstractProvider, filter: EventFilter) { + this.#provider = provider; + this.#filter = copy(filter); + this.#poller = this.#poll.bind(this); + this.#running = false; + this.#blockNumber = -2; + } + + async #poll(blockNumber: number): Promise { + // The initial block hasn't been determined yet + if (this.#blockNumber === -2) { + return; + } + + const filter = copy(this.#filter); + filter.fromBlock = this.#blockNumber + 1; + filter.toBlock = blockNumber; + const logs = await this.#provider.getLogs(filter); + + // No logs could just mean the node has not indexed them yet, + // so we keep a sliding window of 60 blocks to keep scanning + if (logs.length === 0) { + if (this.#blockNumber < blockNumber - 60) { + this.#blockNumber = blockNumber - 60; + } + return; + } + + this.#blockNumber = blockNumber; + + for (const log of logs) { + this.#provider.emit(this.#filter, log); + } + } + + start(): void { + if (this.#running) { + return; + } + this.#running = true; + + if (this.#blockNumber === -2) { + this.#provider.getBlockNumber().then((blockNumber) => { + this.#blockNumber = blockNumber; + }); + } + this.#provider.on("block", this.#poller); + } + + stop(): void { + if (!this.#running) { + return; + } + this.#running = false; + + this.#provider.off("block", this.#poller); + } + + pause(dropWhilePaused?: boolean): void { + this.stop(); + if (dropWhilePaused) { + this.#blockNumber = -2; + } + } + + resume(): void { + this.start(); + } } diff --git a/src.ts/providers/ws-browser.ts b/src.ts/providers/ws-browser.ts index d3b8ce8f4..b6b377cef 100644 --- a/src.ts/providers/ws-browser.ts +++ b/src.ts/providers/ws-browser.ts @@ -1,14 +1,14 @@ function getGlobal(): any { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw new Error("unable to locate global object"); } const _WebSocket = getGlobal().WebSocket; diff --git a/src.ts/thirdparty.d.ts b/src.ts/thirdparty.d.ts index 17041a859..af8012a7d 100644 --- a/src.ts/thirdparty.d.ts +++ b/src.ts/thirdparty.d.ts @@ -1,14 +1,14 @@ declare module "ws" { - export class WebSocket { - constructor(...args: Array); + export class WebSocket { + constructor(...args: Array); - onopen: null | ((...args: Array) => any); - onmessage: null | ((...args: Array) => any); - onerror: null | ((...args: Array) => any); + onopen: null | ((...args: Array) => any); + onmessage: null | ((...args: Array) => any); + onerror: null | ((...args: Array) => any); - readyState: number; + readyState: number; - send(payload: any): void; - close(code?: number, reason?: string): void; - } + send(payload: any): void; + close(code?: number, reason?: string): void; + } } diff --git a/src.ts/transaction/accesslist.ts b/src.ts/transaction/accesslist.ts index 8d7393f46..e6328a93d 100644 --- a/src.ts/transaction/accesslist.ts +++ b/src.ts/transaction/accesslist.ts @@ -4,71 +4,71 @@ import { assertArgument, isHexString } from "../utils/index.js"; import type { AccessList, AccessListish } from "./index.js"; function accessSetify( - addr: string, - storageKeys: Array, + addr: string, + storageKeys: Array, ): { address: string; storageKeys: Array } { - return { - address: getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - assertArgument( - isHexString(storageKey, 32), - "invalid slot", - `storageKeys[${index}]`, - storageKey, - ); - return storageKey.toLowerCase(); - }), - }; + return { + address: getAddress(addr), + storageKeys: storageKeys.map((storageKey, index) => { + assertArgument( + isHexString(storageKey, 32), + "invalid slot", + `storageKeys[${index}]`, + storageKey, + ); + return storageKey.toLowerCase(); + }), + }; } /** * Returns a [[AccessList]] from any corebcsupported access-list structure. */ export function accessListify(value: AccessListish): AccessList { - if (Array.isArray(value)) { - return (< - Array< - | [string, Array] - | { address: string; storageKeys: Array } - > - >value).map((set, index) => { - if (Array.isArray(set)) { - assertArgument( - set.length === 2, - "invalid slot set", - `value[${index}]`, - set, - ); - return accessSetify(set[0], set[1]); - } - assertArgument( - set != null && typeof set === "object", - "invalid address-slot set", - "value", - value, - ); - return accessSetify(set.address, set.storageKeys); - }); - } + if (Array.isArray(value)) { + return (< + Array< + | [string, Array] + | { address: string; storageKeys: Array } + > + >value).map((set, index) => { + if (Array.isArray(set)) { + assertArgument( + set.length === 2, + "invalid slot set", + `value[${index}]`, + set, + ); + return accessSetify(set[0], set[1]); + } + assertArgument( + set != null && typeof set === "object", + "invalid address-slot set", + "value", + value, + ); + return accessSetify(set.address, set.storageKeys); + }); + } - assertArgument( - value != null && typeof value === "object", - "invalid access list", - "value", - value, - ); + assertArgument( + value != null && typeof value === "object", + "invalid access list", + "value", + value, + ); - const result: Array<{ address: string; storageKeys: Array }> = - Object.keys(value).map((addr) => { - const storageKeys: Record = value[addr].reduce( - (accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, - >{}, - ); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => a.address.localeCompare(b.address)); - return result; + const result: Array<{ address: string; storageKeys: Array }> = + Object.keys(value).map((addr) => { + const storageKeys: Record = value[addr].reduce( + (accum, storageKey) => { + accum[storageKey] = true; + return accum; + }, + >{}, + ); + return accessSetify(addr, Object.keys(storageKeys).sort()); + }); + result.sort((a, b) => a.address.localeCompare(b.address)); + return result; } diff --git a/src.ts/transaction/address.ts b/src.ts/transaction/address.ts index c7bb8e62c..5613eb176 100644 --- a/src.ts/transaction/address.ts +++ b/src.ts/transaction/address.ts @@ -13,29 +13,29 @@ import { calculateCheckSum } from "../address/index.js"; */ export function removeHexPrefix(val: string): string { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; + return val.substring(0, 2) === "0x" ? val.substring(2) : val; } export function publicToAddress( - key: BytesLike | string, - prefix: string, + key: BytesLike | string, + prefix: string, ): string { - const val = hexDataSlice(sha256(key), 12); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); + const val = hexDataSlice(sha256(key), 12); + const checksum = calculateCheckSum(val, prefix); + return "0x" + prefix + checksum + removeHexPrefix(val); } export function computeAddress( - key: string | SigningKey, - prefix: string, + key: string | SigningKey, + prefix: string, ): string { - let pubkey: string; - if (typeof key === "string") { - pubkey = SigningKey.computePublicKey(key, false); - } else { - pubkey = key.publicKey; - } - return publicToAddress(pubkey, prefix); // getAddress(sha256("0x" + pubkey.substring(4)).substring(26)); + let pubkey: string; + if (typeof key === "string") { + pubkey = SigningKey.computePublicKey(key, false); + } else { + pubkey = key.publicKey; + } + return publicToAddress(pubkey, prefix); // getAddress(sha256("0x" + pubkey.substring(4)).substring(26)); } /** @@ -43,15 +43,15 @@ export function computeAddress( * used to sign %%digest%% that resulted in %%signature%%. */ export function recoverAddress( - digest: BytesLike, - signature: SignatureLike, - prefix: string, + digest: BytesLike, + signature: SignatureLike, + prefix: string, ): string { - // return computeAddress(SigningKey.recoverPublicKey(digest, signature)); - const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature); - return publicToAddress(publicKey, prefix); + // return computeAddress(SigningKey.recoverPublicKey(digest, signature)); + const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature); + return publicToAddress(publicKey, prefix); } export function extractPrefix(address: string): string { - address = getAddress(address); - return address.substring(2, 4); + address = getAddress(address); + return address.substring(2, 4); } diff --git a/src.ts/transaction/index.ts b/src.ts/transaction/index.ts index 154f83f62..cac6cde4e 100644 --- a/src.ts/transaction/index.ts +++ b/src.ts/transaction/index.ts @@ -20,9 +20,7 @@ export type AccessList = Array; * Any corebc-supported access list structure. */ export type AccessListish = - | AccessList - | Array<[string, Array]> - | Record>; + AccessList | Array<[string, Array]> | Record>; export { accessListify } from "./accesslist.js"; export { computeAddress, recoverAddress } from "./address.js"; diff --git a/src.ts/transaction/transaction.ts b/src.ts/transaction/transaction.ts index ccc62dc46..e609261e8 100644 --- a/src.ts/transaction/transaction.ts +++ b/src.ts/transaction/transaction.ts @@ -1,12 +1,12 @@ import { getAddress } from "../address/index.js"; import { sha256, Signature, SigningKey } from "../crypto/index.js"; import { - getBytes, - getBigInt, - getNumber, - hexlify, - assert, - assertArgument, + getBytes, + getBigInt, + getNumber, + hexlify, + assert, + assertArgument, } from "../utils/index.js"; import { recoverAddress } from "./address.js"; @@ -24,176 +24,176 @@ const logger = new Logger("transaction/0.0.1"); const BN_0 = BigInt(0); export interface TransactionLike { - /** - * The recipient address or ``null`` for an ``init`` transaction. - */ - to?: null | A; - - /** - * The sender. - */ - from?: null | A; - - /** - * The nonce. - */ - nonce?: null | number; - - /** - * The maximum amount of energy that can be used. - */ - energyLimit?: null | BigNumberish; - - /** - * The energy price for legacy and berlin transactions. - */ - energyPrice?: null | BigNumberish; - - /** - * The data. - */ - data?: null | string; - - /** - * The value (in ore) to send. - */ - value?: null | BigNumberish; - - /** - * The chain ID the transaction is valid on. - */ - networkId?: null | BigNumberish; - - /** - * The transaction hash. - */ - hash?: null | string; - - /** - * The signature provided by the sender. - */ - signature?: null | SignatureLike; + /** + * The recipient address or ``null`` for an ``init`` transaction. + */ + to?: null | A; + + /** + * The sender. + */ + from?: null | A; + + /** + * The nonce. + */ + nonce?: null | number; + + /** + * The maximum amount of energy that can be used. + */ + energyLimit?: null | BigNumberish; + + /** + * The energy price for legacy and berlin transactions. + */ + energyPrice?: null | BigNumberish; + + /** + * The data. + */ + data?: null | string; + + /** + * The value (in ore) to send. + */ + value?: null | BigNumberish; + + /** + * The chain ID the transaction is valid on. + */ + networkId?: null | BigNumberish; + + /** + * The transaction hash. + */ + hash?: null | string; + + /** + * The signature provided by the sender. + */ + signature?: null | SignatureLike; } function handleAddress(value: string): null | string { - if (value === "0x") { - return null; - } - return getAddress(value); + if (value === "0x") { + return null; + } + return getAddress(value); } function parse(data: BytesLike): TransactionLike { - const handleNumber = (value: string): BigNumber => { - // @ts-ignore - if (value === "0x") { - return BigNumber.from(0); - } - return BigNumber.from(value); - }; - - const transaction = RLP.decode(data); - - if (transaction.length !== 7 && transaction.length !== 8) { - logger.throwArgumentError("invalid raw transaction", "data", data); - } - - const isSigned = transaction.length === 8; - const tx: TransactionLike = { - nonce: Number(handleNumber(transaction[0])), - energyPrice: handleNumber(transaction[1]).toBigInt(), - energyLimit: handleNumber(transaction[2]).toBigInt(), - networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(), - to: handleAddress(transaction[isSigned ? 4 : 3]), - value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(), - data: transaction[isSigned ? 6 : 5], - }; - - if (transaction.length === 8) { - const prefix = networkIdToPrefix(Number(tx.networkId)); - const digest = sha256(serialize(tx)); - tx.hash = sha256(serialize(tx, transaction[7])); - tx.from = recoverAddress(digest, transaction[7], prefix); - tx.signature = transaction[7]; - } - - return tx; + const handleNumber = (value: string): BigNumber => { + // @ts-ignore + if (value === "0x") { + return BigNumber.from(0); + } + return BigNumber.from(value); + }; + + const transaction = RLP.decode(data); + + if (transaction.length !== 7 && transaction.length !== 8) { + logger.throwArgumentError("invalid raw transaction", "data", data); + } + + const isSigned = transaction.length === 8; + const tx: TransactionLike = { + nonce: Number(handleNumber(transaction[0])), + energyPrice: handleNumber(transaction[1]).toBigInt(), + energyLimit: handleNumber(transaction[2]).toBigInt(), + networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(), + to: handleAddress(transaction[isSigned ? 4 : 3]), + value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(), + data: transaction[isSigned ? 6 : 5], + }; + + if (transaction.length === 8) { + const prefix = networkIdToPrefix(Number(tx.networkId)); + const digest = sha256(serialize(tx)); + tx.hash = sha256(serialize(tx, transaction[7])); + tx.from = recoverAddress(digest, transaction[7], prefix); + tx.signature = transaction[7]; + } + + return tx; } const unsignedTransactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, - { name: "networkId", maxLength: 32, numeric: true }, + { name: "nonce", maxLength: 32, numeric: true }, + { name: "energyPrice", maxLength: 32, numeric: true }, + { name: "energyLimit", maxLength: 32, numeric: true }, + { name: "to", length: 22 }, + { name: "value", maxLength: 32, numeric: true }, + { name: "data" }, + { name: "networkId", maxLength: 32, numeric: true }, ]; const transactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "networkId", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, + { name: "nonce", maxLength: 32, numeric: true }, + { name: "energyPrice", maxLength: 32, numeric: true }, + { name: "energyLimit", maxLength: 32, numeric: true }, + { name: "networkId", maxLength: 32, numeric: true }, + { name: "to", length: 22 }, + { name: "value", maxLength: 32, numeric: true }, + { name: "data" }, ]; const allowedTransactionKeys: { [key: string]: boolean } = { - networkId: true, - data: true, - energyLimit: true, - energyPrice: true, - nonce: true, - to: true, - value: true, + networkId: true, + data: true, + energyLimit: true, + energyPrice: true, + nonce: true, + to: true, + value: true, }; function serialize(transaction: TransactionLike, signature?: string): string { - checkProperties(transaction, allowedTransactionKeys); - - const raw: Array = []; - - (!!signature ? transactionFields : unsignedTransactionFields).forEach( - function ({ numeric, maxLength, name, length }) { - let value = (transaction)[name] || []; - const options: DataOptions = {}; - if (numeric) { - options.hexPad = "left"; - } - const tmpHexlified = hexlify(value, options); - value = arrayify(tmpHexlified); - // Fixed-width field - if (length && value.length !== length && value.length > 0) { - logger.throwArgumentError( - "invalid length for " + name, - "transaction:" + name, - value, - ); - } - - // Variable-width (with a maximum) - if (maxLength) { - value = stripZeros(value); - if (value.length > maxLength) { - logger.throwArgumentError( - "invalid length for " + name, - "transaction:" + name, - value, - ); - } - } - - const hexlified = hexlify(value); - raw.push(hexlified); - }, - ); - - if (!!signature) { - raw.push(hexlify(signature)); - } - const finalValue = RLP.encode(raw); - return finalValue; + checkProperties(transaction, allowedTransactionKeys); + + const raw: Array = []; + + (!!signature ? transactionFields : unsignedTransactionFields).forEach( + function ({ numeric, maxLength, name, length }) { + let value = (transaction)[name] || []; + const options: DataOptions = {}; + if (numeric) { + options.hexPad = "left"; + } + const tmpHexlified = hexlify(value, options); + value = arrayify(tmpHexlified); + // Fixed-width field + if (length && value.length !== length && value.length > 0) { + logger.throwArgumentError( + "invalid length for " + name, + "transaction:" + name, + value, + ); + } + + // Variable-width (with a maximum) + if (maxLength) { + value = stripZeros(value); + if (value.length > maxLength) { + logger.throwArgumentError( + "invalid length for " + name, + "transaction:" + name, + value, + ); + } + } + + const hexlified = hexlify(value); + raw.push(hexlified); + }, + ); + + if (!!signature) { + raw.push(hexlify(signature)); + } + const finalValue = RLP.encode(raw); + return finalValue; } /** @@ -210,294 +210,294 @@ function serialize(transaction: TransactionLike, signature?: string): string { * //_result: */ export class Transaction implements TransactionLike { - #to: null | string; - #data: string; - #nonce: number; - #energyLimit: bigint; - #energyPrice: null | bigint; - #value: bigint; - #networkId: bigint; - #sig: null | string; - - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to(): null | string { - return this.#to; - } - set to(value: null | string) { - this.#to = value == null ? null : getAddress(value); - } - - /** - * The transaction nonce. - */ - get nonce(): number { - return this.#nonce; - } - set nonce(value: BigNumberish) { - this.#nonce = getNumber(value, "value"); - } - - /** - * The energy limit. - */ - get energyLimit(): bigint { - return this.#energyLimit; - } - set energyLimit(value: BigNumberish) { - this.#energyLimit = getBigInt(value); - } - - /** - * The energy price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get energyPrice(): null | bigint { - const value = this.#energyPrice; - if (value == null) { - return BN_0; - } - return value; - } - set energyPrice(value: null | BigNumberish) { - this.#energyPrice = value == null ? null : getBigInt(value, "energyPrice"); - } - - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data(): string { - return this.#data; - } - set data(value: BytesLike) { - this.#data = hexlify(value); - } - - /** - * The amount of xcb (in ore) to send in this transactions. - */ - get value(): bigint { - return this.#value; - } - set value(value: BigNumberish) { - this.#value = getBigInt(value, "value"); - } - - /** - * The chain ID this transaction is valid on. - */ - get networkId(): bigint { - return this.#networkId; - } - set networkId(value: BigNumberish) { - this.#networkId = getBigInt(value); - } - - /** - * If signed, the signature for this transaction. - */ - get signature(): null | string { - return this.#sig || null; - } - set signature(value: null | SignatureLike) { - this.#sig = value == null ? null : value; - } - - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#to = null; - this.#nonce = 0; - this.#energyLimit = BigInt(0); - this.#energyPrice = null; - this.#data = "0x"; - this.#value = BigInt(0); - this.#networkId = BigInt(0); - this.#sig = null; - } - - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash(): null | string { - if (this.signature == null) { - return null; - } - return sha256(this.serialized); - } - - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash(): string { - return sha256(this.unsignedSerialized); - } - - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from(): null | string { - if (this.signature == null) { - return null; - } - const prefix = networkIdToPrefix(Number(this.#networkId)); - return recoverAddress(this.unsignedHash, this.signature, prefix); - } - - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey(): null | string { - if (this.signature == null) { - return null; - } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); - } - - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned(): this is Transaction & { - type: number; - typeName: string; - from: string; - signature: Signature; - } { - //isSigned(): this is SignedTransaction { - return this.signature != null; - } - - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized(): string { - assert( - this.signature != null, - "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", - "UNSUPPORTED_OPERATION", - { operation: ".serialized" }, - ); - return serialize(this, this.signature); - } - - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized(): string { - return serialize(this); - } - - /** - * Create a copy of this transaciton. - */ - clone(): Transaction { - return Transaction.from(this); - } - - /** - * Return a JSON-friendly object. - */ - toJSON(): any { - const s = (v: null | bigint) => { - if (v == null) { - return null; - } - return v.toString(); - }; - - return { - to: this.to, - data: this.data, - nonce: this.nonce, - energyLimit: s(this.energyLimit), - energyPrice: s(this.energyPrice), - value: s(this.value), - networkId: s(this.networkId), - sig: this.signature ? this.signature : null, - }; - } - - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx?: string | TransactionLike): Transaction { - if (tx == null) { - return new Transaction(); - } - - if (typeof tx === "string") { - const payload = getBytes(tx); - return Transaction.from(parse(payload)); - } - const result = new Transaction(); - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.energyLimit != null) { - result.energyLimit = tx.energyLimit; - } - if (tx.energyPrice != null) { - result.energyPrice = tx.energyPrice; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.networkId != null) { - result.networkId = tx.networkId; - } - if (tx.signature != null) { - result.signature = tx.signature; - } - - if (tx.hash != null) { - assertArgument( - result.isSigned(), - "unsigned transaction cannot define hash", - "tx", - tx, - ); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - - if (tx.from != null) { - assertArgument( - result.isSigned(), - "unsigned transaction cannot define from", - "tx", - tx, - ); - assertArgument( - result.from.toLowerCase() === (tx.from || "").toLowerCase(), - "from mismatch", - "tx", - tx, - ); - } - return result; - } + #to: null | string; + #data: string; + #nonce: number; + #energyLimit: bigint; + #energyPrice: null | bigint; + #value: bigint; + #networkId: bigint; + #sig: null | string; + + /** + * The ``to`` address for the transaction or ``null`` if the + * transaction is an ``init`` transaction. + */ + get to(): null | string { + return this.#to; + } + set to(value: null | string) { + this.#to = value == null ? null : getAddress(value); + } + + /** + * The transaction nonce. + */ + get nonce(): number { + return this.#nonce; + } + set nonce(value: BigNumberish) { + this.#nonce = getNumber(value, "value"); + } + + /** + * The energy limit. + */ + get energyLimit(): bigint { + return this.#energyLimit; + } + set energyLimit(value: BigNumberish) { + this.#energyLimit = getBigInt(value); + } + + /** + * The energy price. + * + * On legacy networks this defines the fee that will be paid. On + * EIP-1559 networks, this should be ``null``. + */ + get energyPrice(): null | bigint { + const value = this.#energyPrice; + if (value == null) { + return BN_0; + } + return value; + } + set energyPrice(value: null | BigNumberish) { + this.#energyPrice = value == null ? null : getBigInt(value, "energyPrice"); + } + + /** + * The transaction data. For ``init`` transactions this is the + * deployment code. + */ + get data(): string { + return this.#data; + } + set data(value: BytesLike) { + this.#data = hexlify(value); + } + + /** + * The amount of xcb (in ore) to send in this transactions. + */ + get value(): bigint { + return this.#value; + } + set value(value: BigNumberish) { + this.#value = getBigInt(value, "value"); + } + + /** + * The chain ID this transaction is valid on. + */ + get networkId(): bigint { + return this.#networkId; + } + set networkId(value: BigNumberish) { + this.#networkId = getBigInt(value); + } + + /** + * If signed, the signature for this transaction. + */ + get signature(): null | string { + return this.#sig || null; + } + set signature(value: null | SignatureLike) { + this.#sig = value == null ? null : value; + } + + /** + * Creates a new Transaction with default values. + */ + constructor() { + this.#to = null; + this.#nonce = 0; + this.#energyLimit = BigInt(0); + this.#energyPrice = null; + this.#data = "0x"; + this.#value = BigInt(0); + this.#networkId = BigInt(0); + this.#sig = null; + } + + /** + * The transaction hash, if signed. Otherwise, ``null``. + */ + get hash(): null | string { + if (this.signature == null) { + return null; + } + return sha256(this.serialized); + } + + /** + * The pre-image hash of this transaction. + * + * This is the digest that a [[Signer]] must sign to authorize + * this transaction. + */ + get unsignedHash(): string { + return sha256(this.unsignedSerialized); + } + + /** + * The sending address, if signed. Otherwise, ``null``. + */ + get from(): null | string { + if (this.signature == null) { + return null; + } + const prefix = networkIdToPrefix(Number(this.#networkId)); + return recoverAddress(this.unsignedHash, this.signature, prefix); + } + + /** + * The public key of the sender, if signed. Otherwise, ``null``. + */ + get fromPublicKey(): null | string { + if (this.signature == null) { + return null; + } + return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); + } + + /** + * Returns true if signed. + * + * This provides a Type Guard that properties requiring a signed + * transaction are non-null. + */ + isSigned(): this is Transaction & { + type: number; + typeName: string; + from: string; + signature: Signature; + } { + //isSigned(): this is SignedTransaction { + return this.signature != null; + } + + /** + * The serialized transaction. + * + * This throws if the transaction is unsigned. For the pre-image, + * use [[unsignedSerialized]]. + */ + get serialized(): string { + assert( + this.signature != null, + "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", + "UNSUPPORTED_OPERATION", + { operation: ".serialized" }, + ); + return serialize(this, this.signature); + } + + /** + * The transaction pre-image. + * + * The hash of this is the digest which needs to be signed to + * authorize this transaction. + */ + get unsignedSerialized(): string { + return serialize(this); + } + + /** + * Create a copy of this transaciton. + */ + clone(): Transaction { + return Transaction.from(this); + } + + /** + * Return a JSON-friendly object. + */ + toJSON(): any { + const s = (v: null | bigint) => { + if (v == null) { + return null; + } + return v.toString(); + }; + + return { + to: this.to, + data: this.data, + nonce: this.nonce, + energyLimit: s(this.energyLimit), + energyPrice: s(this.energyPrice), + value: s(this.value), + networkId: s(this.networkId), + sig: this.signature ? this.signature : null, + }; + } + + /** + * Create a **Transaction** from a serialized transaction or a + * Transaction-like object. + */ + static from(tx?: string | TransactionLike): Transaction { + if (tx == null) { + return new Transaction(); + } + + if (typeof tx === "string") { + const payload = getBytes(tx); + return Transaction.from(parse(payload)); + } + const result = new Transaction(); + if (tx.to != null) { + result.to = tx.to; + } + if (tx.nonce != null) { + result.nonce = tx.nonce; + } + if (tx.energyLimit != null) { + result.energyLimit = tx.energyLimit; + } + if (tx.energyPrice != null) { + result.energyPrice = tx.energyPrice; + } + if (tx.data != null) { + result.data = tx.data; + } + if (tx.value != null) { + result.value = tx.value; + } + if (tx.networkId != null) { + result.networkId = tx.networkId; + } + if (tx.signature != null) { + result.signature = tx.signature; + } + + if (tx.hash != null) { + assertArgument( + result.isSigned(), + "unsigned transaction cannot define hash", + "tx", + tx, + ); + assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); + } + + if (tx.from != null) { + assertArgument( + result.isSigned(), + "unsigned transaction cannot define from", + "tx", + tx, + ); + assertArgument( + result.from.toLowerCase() === (tx.from || "").toLowerCase(), + "from mismatch", + "tx", + tx, + ); + } + return result; + } } diff --git a/src.ts/utils/base58.ts b/src.ts/utils/base58.ts index c9e8f364d..9c4442ad9 100644 --- a/src.ts/utils/base58.ts +++ b/src.ts/utils/base58.ts @@ -22,15 +22,15 @@ const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; let Lookup: null | Record = null; function getAlpha(letter: string): bigint { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; + if (Lookup == null) { + Lookup = {}; + for (let i = 0; i < Alphabet.length; i++) { + Lookup[Alphabet[i]] = BigInt(i); + } + } + const result = Lookup[letter]; + assertArgument(result != null, `invalid base58 value`, "letter", letter); + return result; } const BN_0 = BigInt(0); @@ -40,23 +40,23 @@ const BN_58 = BigInt(58); * Encode %%value%% as a Base58-encoded string. */ export function encodeBase58(_value: BytesLike): string { - let value = toBigInt(getBytes(_value)); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - return result; + let value = toBigInt(getBytes(_value)); + let result = ""; + while (value) { + result = Alphabet[Number(value % BN_58)] + result; + value /= BN_58; + } + return result; } /** * Decode the Base58-encoded %%value%%. */ export function decodeBase58(value: string): bigint { - let result = BN_0; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; + let result = BN_0; + for (let i = 0; i < value.length; i++) { + result *= BN_58; + result += getAlpha(value[i]); + } + return result; } diff --git a/src.ts/utils/base64-browser.ts b/src.ts/utils/base64-browser.ts index b788723c7..42e7056fe 100644 --- a/src.ts/utils/base64-browser.ts +++ b/src.ts/utils/base64-browser.ts @@ -5,19 +5,19 @@ import { getBytes } from "./data.js"; import type { BytesLike } from "./data.js"; export function decodeBase64(textData: string): Uint8Array { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return getBytes(data); + textData = atob(textData); + const data = new Uint8Array(textData.length); + for (let i = 0; i < textData.length; i++) { + data[i] = textData.charCodeAt(i); + } + return getBytes(data); } export function encodeBase64(_data: BytesLike): string { - const data = getBytes(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); + const data = getBytes(_data); + let textData = ""; + for (let i = 0; i < data.length; i++) { + textData += String.fromCharCode(data[i]); + } + return btoa(textData); } diff --git a/src.ts/utils/base64.ts b/src.ts/utils/base64.ts index 81d963dbf..cfc806625 100644 --- a/src.ts/utils/base64.ts +++ b/src.ts/utils/base64.ts @@ -27,7 +27,7 @@ import type { BytesLike } from "./data.js"; * //_result: */ export function decodeBase64(value: string): Uint8Array { - return getBytesCopy(Buffer.from(value, "base64")); + return getBytesCopy(Buffer.from(value, "base64")); } /** @@ -51,5 +51,5 @@ export function decodeBase64(value: string): Uint8Array { * //_result: */ export function encodeBase64(data: BytesLike): string { - return Buffer.from(getBytes(data)).toString("base64"); + return Buffer.from(getBytes(data)).toString("base64"); } diff --git a/src.ts/utils/data.ts b/src.ts/utils/data.ts index c11027e91..e2d78d7f4 100644 --- a/src.ts/utils/data.ts +++ b/src.ts/utils/data.ts @@ -29,67 +29,67 @@ export type Bytes = ArrayLike; export type BytesLike = Bytes | string; export type DataOptions = { - allowMissingPrefix?: boolean; - hexPad?: "left" | "right" | null; + allowMissingPrefix?: boolean; + hexPad?: "left" | "right" | null; }; export interface Hexable { - toHexString(): string; + toHexString(): string; } function isHexable(value: any): value is Hexable { - return !!value.toHexString; + return !!value.toHexString; } function isInteger(value: number) { - return typeof value === "number" && value == value && value % 1 === 0; + return typeof value === "number" && value == value && value % 1 === 0; } export function isBytes(value: any): value is Bytes { - if (value == null) { - return false; - } - - if (value.constructor === Uint8Array) { - return true; - } - if (typeof value === "string") { - return false; - } - if (!isInteger(value.length) || value.length < 0) { - return false; - } - - for (let i = 0; i < value.length; i++) { - const v = value[i]; - if (!isInteger(v) || v < 0 || v >= 256) { - return false; - } - } - return true; + if (value == null) { + return false; + } + + if (value.constructor === Uint8Array) { + return true; + } + if (typeof value === "string") { + return false; + } + if (!isInteger(value.length) || value.length < 0) { + return false; + } + + for (let i = 0; i < value.length; i++) { + const v = value[i]; + if (!isInteger(v) || v < 0 || v >= 256) { + return false; + } + } + return true; } function _getBytes( - value: BytesLike, - name?: string, - copy?: boolean, + value: BytesLike, + name?: string, + copy?: boolean, ): Uint8Array { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - - if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - - assertArgument(false, "invalid BytesLike value", name || "value", value); + if (value instanceof Uint8Array) { + if (copy) { + return new Uint8Array(value); + } + return value; + } + + if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { + const result = new Uint8Array((value.length - 2) / 2); + let offset = 2; + for (let i = 0; i < result.length; i++) { + result[i] = parseInt(value.substring(offset, offset + 2), 16); + offset += 2; + } + return result; + } + + assertArgument(false, "invalid BytesLike value", name || "value", value); } /** @@ -100,7 +100,7 @@ function _getBytes( * @see: getBytesCopy */ export function getBytes(value: BytesLike, name?: string): Uint8Array { - return _getBytes(value, name, false); + return _getBytes(value, name, false); } /** @@ -111,7 +111,7 @@ export function getBytes(value: BytesLike, name?: string): Uint8Array { * @see: getBytes */ export function getBytesCopy(value: BytesLike, name?: string): Uint8Array { - return _getBytes(value, name, true); + return _getBytes(value, name, true); } /** @@ -122,21 +122,21 @@ export function getBytesCopy(value: BytesLike, name?: string): Uint8Array { * bytes of data (e.g. ``0x1234`` is 2 bytes). */ export function isHexString( - value: any, - length?: number | boolean, + value: any, + length?: number | boolean, ): value is `0x${string}` { - if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - - if (typeof length === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && value.length % 2 !== 0) { - return false; - } - - return true; + if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { + return false; + } + + if (typeof length === "number" && value.length !== 2 + 2 * length) { + return false; + } + if (length === true && value.length % 2 !== 0) { + return false; + } + + return true; } /** @@ -144,7 +144,7 @@ export function isHexString( * data (i.e. a valid [[DataHexString]] or a Uint8Array). */ export function isBytesLike(value: any): value is BytesLike { - return isHexString(value, true) || value instanceof Uint8Array; + return isHexString(value, true) || value instanceof Uint8Array; } const HexCharacters: string = "0123456789abcdef"; @@ -153,84 +153,84 @@ const HexCharacters: string = "0123456789abcdef"; * Returns a [[DataHexString]] representation of %%data%%. */ export function hexlify( - value: BytesLike | Hexable | number | bigint, - options?: DataOptions, + value: BytesLike | Hexable | number | bigint, + options?: DataOptions, ): string { - if (!options) { - options = {}; - } - if (typeof value === "string") { - if (value.includes(",") && value.startsWith("0x")) { - const v = value - .replace("0x", "") - .split(",") - .map((item) => Number(item)); - // @ts-ignore - value = new Uint8Array(v); - } - } - if (typeof value === "number") { - logger.checkSafeUint53(value, "invalid hexlify value"); - - let hex = ""; - while (value) { - hex = HexCharacters[value & 0xf] + hex; - value = Math.floor(value / 16); - } - - if (hex.length) { - if (hex.length % 2) { - hex = "0" + hex; - } - return "0x" + hex; - } - - return "0x00"; - } - - if (typeof value === "bigint") { - value = value.toString(16); - if (value.length % 2) { - return "0x0" + value; - } - return "0x" + value; - } - - if ( - options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x" - ) { - value = "0x" + value; - } - - if (isHexable(value)) { - return value.toHexString(); - } - - if (isHexString(value)) { - if ((value).length % 2) { - if (options.hexPad === "left") { - value = "0x0" + (value).substring(2); - } else if (options.hexPad === "right") { - value += "0"; - } else { - logger.throwArgumentError("hex data is odd-length", "value", value); - } - } - return (value).toLowerCase(); - } - - if (isBytes(value)) { - let result = "0x"; - for (let i = 0; i < value.length; i++) { - let v = value[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; - } - - return logger.throwArgumentError("invalid hexlify value", "value", value); + if (!options) { + options = {}; + } + if (typeof value === "string") { + if (value.includes(",") && value.startsWith("0x")) { + const v = value + .replace("0x", "") + .split(",") + .map((item) => Number(item)); + // @ts-ignore + value = new Uint8Array(v); + } + } + if (typeof value === "number") { + logger.checkSafeUint53(value, "invalid hexlify value"); + + let hex = ""; + while (value) { + hex = HexCharacters[value & 0xf] + hex; + value = Math.floor(value / 16); + } + + if (hex.length) { + if (hex.length % 2) { + hex = "0" + hex; + } + return "0x" + hex; + } + + return "0x00"; + } + + if (typeof value === "bigint") { + value = value.toString(16); + if (value.length % 2) { + return "0x0" + value; + } + return "0x" + value; + } + + if ( + options.allowMissingPrefix && + typeof value === "string" && + value.substring(0, 2) !== "0x" + ) { + value = "0x" + value; + } + + if (isHexable(value)) { + return value.toHexString(); + } + + if (isHexString(value)) { + if ((value).length % 2) { + if (options.hexPad === "left") { + value = "0x0" + (value).substring(2); + } else if (options.hexPad === "right") { + value += "0"; + } else { + logger.throwArgumentError("hex data is odd-length", "value", value); + } + } + return (value).toLowerCase(); + } + + if (isBytes(value)) { + let result = "0x"; + for (let i = 0; i < value.length; i++) { + let v = value[i]; + result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; + } + return result; + } + + return logger.throwArgumentError("invalid hexlify value", "value", value); } /** @@ -238,47 +238,47 @@ export function hexlify( * within %%data%%. */ export function concat(items: ReadonlyArray): string { - return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); + return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); } export function hexDataSlice( - data: BytesLike, - offset: number, - endOffset?: number, + data: BytesLike, + offset: number, + endOffset?: number, ): string { - if (typeof data !== "string") { - data = hexlify(data); - } else if (!isHexString(data) || data.length % 2) { - logger.throwArgumentError("invalid hexData", "value", data); - } + if (typeof data !== "string") { + data = hexlify(data); + } else if (!isHexString(data) || data.length % 2) { + logger.throwArgumentError("invalid hexData", "value", data); + } - offset = 2 + 2 * offset; + offset = 2 + 2 * offset; - if (endOffset != null) { - return "0x" + data.substring(offset, 2 + 2 * endOffset); - } + if (endOffset != null) { + return "0x" + data.substring(offset, 2 + 2 * endOffset); + } - return "0x" + data.substring(offset); + return "0x" + data.substring(offset); } export function hexDataLength(data: BytesLike) { - if (typeof data !== "string") { - data = hexlify(data); - } else if (!isHexString(data) || data.length % 2) { - return null; - } + if (typeof data !== "string") { + data = hexlify(data); + } else if (!isHexString(data) || data.length % 2) { + return null; + } - return (data.length - 2) / 2; + return (data.length - 2) / 2; } /** * Returns the length of %%data%%, in bytes. */ export function dataLength(data: BytesLike): number { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; + if (isHexString(data, true)) { + return (data.length - 2) / 2; + } + return getBytes(data).length; } /** @@ -288,21 +288,21 @@ export function dataLength(data: BytesLike): number { * By default %%start%% is 0 and %%end%% is the length of %%data%%. */ export function dataSlice( - data: BytesLike, - start?: number, - end?: number, + data: BytesLike, + start?: number, + end?: number, ): string { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: bytes.length, - offset: end, - }); - } - return hexlify( - bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end), - ); + const bytes = getBytes(data); + if (end != null && end > bytes.length) { + assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { + buffer: bytes, + length: bytes.length, + offset: end, + }); + } + return hexlify( + bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end), + ); } /** @@ -310,35 +310,35 @@ export function dataSlice( ** zero bytes from %%data%%. */ export function stripZerosLeft(data: BytesLike): string { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; + let bytes = hexlify(data).substring(2); + while (bytes.startsWith("00")) { + bytes = bytes.substring(2); + } + return "0x" + bytes; } function zeroPad(data: BytesLike, length: number, left: boolean): string { - const bytes = getBytes(data); - assert( - length >= bytes.length, - "padding exceeds data length", - "BUFFER_OVERRUN", - { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1, - }, - ); - - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } else { - result.set(bytes, 0); - } - - return hexlify(result); + const bytes = getBytes(data); + assert( + length >= bytes.length, + "padding exceeds data length", + "BUFFER_OVERRUN", + { + buffer: new Uint8Array(bytes), + length: length, + offset: length + 1, + }, + ); + + const result = new Uint8Array(length); + result.fill(0); + if (left) { + result.set(bytes, length - bytes.length); + } else { + result.set(bytes, 0); + } + + return hexlify(result); } /** @@ -352,7 +352,7 @@ function zeroPad(data: BytesLike, length: number, left: boolean): string { * (e.g. ``uint128``). */ export function zeroPadValue(data: BytesLike, length: number): string { - return zeroPad(data, length, true); + return zeroPad(data, length, true); } /** @@ -366,107 +366,94 @@ export function zeroPadValue(data: BytesLike, length: number): string { * (e.g. ``bytes16``). */ export function zeroPadBytes(data: BytesLike, length: number): string { - return zeroPad(data, length, false); + return zeroPad(data, length, false); } export function stripZeros(value: BytesLike): Uint8Array { - let result: Uint8Array = arrayify(value); + let result: Uint8Array = arrayify(value); - if (result.length === 0) { - return result; - } + if (result.length === 0) { + return result; + } - // Find the first non-zero entry - let start = 0; - while (start < result.length && result[start] === 0) { - start++; - } + // Find the first non-zero entry + let start = 0; + while (start < result.length && result[start] === 0) { + start++; + } - // If we started with zeros, strip them - if (start) { - result = result.slice(start); - } + // If we started with zeros, strip them + if (start) { + result = result.slice(start); + } - return result; + return result; } export function arrayify( - value: BytesLike | Hexable | number, - options?: DataOptions, + value: BytesLike | Hexable | number, + options?: DataOptions, ): Uint8Array { - if (!options) { - options = {}; - } - - if (typeof value === "number") { - logger.checkSafeUint53(value, "invalid arrayify value"); - const result: any = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value = parseInt(String(value / 256)); - } - if (result.length === 0) { - result.push(0); - } - - return addSlice(new Uint8Array(result)); - } - if ( - options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x" - ) { - value = "0x" + value; - } - if (isHexable(value)) { - value = value.toHexString(); - } - if (isHexString(value)) { - let hex = (value).substring(2); - if (hex.length % 2) { - if (options.hexPad === "left") { - hex = "0x0" + hex.substring(2); - } else if (options.hexPad === "right") { - hex += "0"; - } else { - logger.throwArgumentError("hex data is odd-length", "value", value); - } - } - - const result = []; - for (let i = 0; i < hex.length; i += 2) { - // @ts-ignore - result.push(parseInt(hex.substring(i, i + 2), 16)); - } - - return addSlice(new Uint8Array(result)); - } - - if (isBytes(value)) { - return addSlice(new Uint8Array(value)); - } - - return logger.throwArgumentError("invalid arrayify value", "value", value); -} -function addSlice(array: Uint8Array): Uint8Array { - // @ts-ignore - if (array.slice) { - return array; - } - - array.slice = function () { - const args: any = Array.prototype.slice.call(arguments); - return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args))); - }; - - return array; + if (!options) { + options = {}; + } + + if (typeof value === "number") { + logger.checkSafeUint53(value, "invalid arrayify value"); + const result: any = []; + while (value) { + // @ts-ignore + result.unshift(value & 0xff); + value = parseInt(String(value / 256)); + } + if (result.length === 0) { + result.push(0); + } + + return new Uint8Array(result); + } + if ( + options.allowMissingPrefix && + typeof value === "string" && + value.substring(0, 2) !== "0x" + ) { + value = "0x" + value; + } + if (isHexable(value)) { + value = value.toHexString(); + } + if (isHexString(value)) { + let hex = (value).substring(2); + if (hex.length % 2) { + if (options.hexPad === "left") { + hex = "0x0" + hex.substring(2); + } else if (options.hexPad === "right") { + hex += "0"; + } else { + logger.throwArgumentError("hex data is odd-length", "value", value); + } + } + + const result = []; + for (let i = 0; i < hex.length; i += 2) { + // @ts-ignore + result.push(parseInt(hex.substring(i, i + 2), 16)); + } + + return new Uint8Array(result); + } + + if (isBytes(value)) { + return new Uint8Array(value); + } + + return logger.throwArgumentError("invalid arrayify value", "value", value); } export function hexConcat(items: ReadonlyArray): string { - let result = "0x"; - items.forEach((item) => { - result += hexlify(item).substring(2); - }); - return result; + let result = "0x"; + items.forEach((item) => { + result += hexlify(item).substring(2); + }); + return result; } diff --git a/src.ts/utils/errors.ts b/src.ts/utils/errors.ts index a7a0f8db6..a7e8fc0d2 100644 --- a/src.ts/utils/errors.ts +++ b/src.ts/utils/errors.ts @@ -9,9 +9,9 @@ import { version } from "../_version.js"; import { defineProperties } from "./properties.js"; import type { - TransactionRequest, - TransactionReceipt, - TransactionResponse, + TransactionRequest, + TransactionReceipt, + TransactionResponse, } from "../providers/index.js"; import type { FetchRequest, FetchResponse } from "./fetch.js"; @@ -19,50 +19,50 @@ import type { FetchRequest, FetchResponse } from "./fetch.js"; export type ErrorInfo = Omit; function stringify(value: any): any { - if (value == null) { - return "null"; - } - - if (Array.isArray(value)) { - return "[ " + value.map(stringify).join(", ") + " ]"; - } - - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - - if (typeof value === "object" && typeof value.toJSON === "function") { - return stringify(value.toJSON()); - } - - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "number": - return value.toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ( - "{ " + - keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(", ") + - " }" - ); - } - } - - return `[ COULD NOT SERIALIZE ]`; + if (value == null) { + return "null"; + } + + if (Array.isArray(value)) { + return "[ " + value.map(stringify).join(", ") + " ]"; + } + + if (value instanceof Uint8Array) { + const HEX = "0123456789abcdef"; + let result = "0x"; + for (let i = 0; i < value.length; i++) { + result += HEX[value[i] >> 4]; + result += HEX[value[i] & 0xf]; + } + return result; + } + + if (typeof value === "object" && typeof value.toJSON === "function") { + return stringify(value.toJSON()); + } + + switch (typeof value) { + case "boolean": + case "symbol": + return value.toString(); + case "bigint": + return BigInt(value).toString(); + case "number": + return value.toString(); + case "string": + return JSON.stringify(value); + case "object": { + const keys = Object.keys(value); + keys.sort(); + return ( + "{ " + + keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(", ") + + " }" + ); + } + } + + return `[ COULD NOT SERIALIZE ]`; } /** @@ -127,59 +127,59 @@ function stringify(value: any): any { * **``"ACTION_REJECTED"``** - see [[ActionRejectedError]] */ export type ErrorCode = - // Generic Errors - | "UNKNOWN_ERROR" - | "NOT_IMPLEMENTED" - | "UNSUPPORTED_OPERATION" - | "NETWORK_ERROR" - | "SERVER_ERROR" - | "TIMEOUT" - | "BAD_DATA" - | "CANCELLED" - - // Operational Errors - | "BUFFER_OVERRUN" - | "NUMERIC_FAULT" - - // Argument Errors - | "INVALID_ARGUMENT" - | "MISSING_ARGUMENT" - | "UNEXPECTED_ARGUMENT" - | "VALUE_MISMATCH" - - // Blockchain Errors - | "CALL_EXCEPTION" - | "INSUFFICIENT_FUNDS" - | "NONCE_EXPIRED" - | "REPLACEMENT_UNDERPRICED" - | "TRANSACTION_REPLACED" - | "UNCONFIGURED_NAME" - | "OFFCHAIN_FAULT" - - // User Interaction - | "ACTION_REJECTED"; + // Generic Errors + | "UNKNOWN_ERROR" + | "NOT_IMPLEMENTED" + | "UNSUPPORTED_OPERATION" + | "NETWORK_ERROR" + | "SERVER_ERROR" + | "TIMEOUT" + | "BAD_DATA" + | "CANCELLED" + + // Operational Errors + | "BUFFER_OVERRUN" + | "NUMERIC_FAULT" + + // Argument Errors + | "INVALID_ARGUMENT" + | "MISSING_ARGUMENT" + | "UNEXPECTED_ARGUMENT" + | "VALUE_MISMATCH" + + // Blockchain Errors + | "CALL_EXCEPTION" + | "INSUFFICIENT_FUNDS" + | "NONCE_EXPIRED" + | "REPLACEMENT_UNDERPRICED" + | "TRANSACTION_REPLACED" + | "UNCONFIGURED_NAME" + | "OFFCHAIN_FAULT" + + // User Interaction + | "ACTION_REJECTED"; /** * All errors in corebc include properties to assist in * machine-readable errors. */ export interface CoreBCError extends Error { - /** - * The string error code. - */ - code: ErrorCode; - - /** - * Additional info regarding the error that may be useful. - * - * This is generally helpful mostly for human-based debugging. - */ - info?: Record; - - /** - * Any related error. - */ - error?: Error; + /** + * The string error code. + */ + code: ErrorCode; + + /** + * Additional info regarding the error that may be useful. + * + * This is generally helpful mostly for human-based debugging. + */ + info?: Record; + + /** + * Any related error. + */ + error?: Error; } // Generic Errors @@ -189,7 +189,7 @@ export interface CoreBCError extends Error { * know what the underlying problem is. */ export interface UnknownError extends CoreBCError<"UNKNOWN_ERROR"> { - [key: string]: any; + [key: string]: any; } /** @@ -197,10 +197,10 @@ export interface UnknownError extends CoreBCError<"UNKNOWN_ERROR"> { * intended for the future, but is currently not implemented. */ export interface NotImplementedError extends CoreBCError<"NOT_IMPLEMENTED"> { - /** - * The attempted operation. - */ - operation: string; + /** + * The attempted operation. + */ + operation: string; } /** @@ -213,16 +213,15 @@ export interface NotImplementedError extends CoreBCError<"NOT_IMPLEMENTED"> { * For example, a [[Wallet]] with no connected [[Provider]] is unable * to send a transaction. */ -export interface UnsupportedOperationError - extends CoreBCError<"UNSUPPORTED_OPERATION"> { - /** - * The attempted operation. - */ - operation: string; +export interface UnsupportedOperationError extends CoreBCError<"UNSUPPORTED_OPERATION"> { + /** + * The attempted operation. + */ + operation: string; } export interface NetworkError extends CoreBCError<"NETWORK_ERROR"> { - event: string; + event: string; } /** @@ -230,15 +229,15 @@ export interface NetworkError extends CoreBCError<"NETWORK_ERROR"> { * a server. */ export interface ServerError extends CoreBCError<"SERVER_ERROR"> { - /** - * The requested resource. - */ - request: FetchRequest | string; - - /** - * The response received from the server, if available. - */ - response?: FetchResponse; + /** + * The requested resource. + */ + request: FetchRequest | string; + + /** + * The response received from the server, if available. + */ + response?: FetchResponse; } /** @@ -250,20 +249,20 @@ export interface ServerError extends CoreBCError<"SERVER_ERROR"> { * been no response to indicate whether it was processed or not. */ export interface TimeoutError extends CoreBCError<"TIMEOUT"> { - /** - * The attempted operation. - */ - operation: string; - - /** - * The reason. - */ - reason: string; - - /** - * The resource request, if available. - */ - request?: FetchRequest; + /** + * The attempted operation. + */ + operation: string; + + /** + * The reason. + */ + reason: string; + + /** + * The resource request, if available. + */ + request?: FetchRequest; } /** @@ -271,10 +270,10 @@ export interface TimeoutError extends CoreBCError<"TIMEOUT"> { * be correctly interpretted. */ export interface BadDataError extends CoreBCError<"BAD_DATA"> { - /** - * The data. - */ - value: any; + /** + * The data. + */ + value: any; } /** @@ -293,20 +292,20 @@ export interface CancelledError extends CoreBCError<"CANCELLED"> {} * exploits when parsing data. */ export interface BufferOverrunError extends CoreBCError<"BUFFER_OVERRUN"> { - /** - * The buffer that was overrun. - */ - buffer: Uint8Array; - - /** - * The length of the buffer. - */ - length: number; - - /** - * The offset that was requested. - */ - offset: number; + /** + * The buffer that was overrun. + */ + buffer: Uint8Array; + + /** + * The length of the buffer. + */ + length: number; + + /** + * The offset that was requested. + */ + offset: number; } /** @@ -317,20 +316,20 @@ export interface BufferOverrunError extends CoreBCError<"BUFFER_OVERRUN"> { * a negative value. */ export interface NumericFaultError extends CoreBCError<"NUMERIC_FAULT"> { - /** - * The attempted operation. - */ - operation: string; - - /** - * The fault reported. - */ - fault: string; - - /** - * The value the operation was attempted against. - */ - value: any; + /** + * The attempted operation. + */ + operation: string; + + /** + * The fault reported. + */ + fault: string; + + /** + * The value the operation was attempted against. + */ + value: any; } // Argument Errors @@ -340,48 +339,47 @@ export interface NumericFaultError extends CoreBCError<"NUMERIC_FAULT"> { * a function or method. */ export interface InvalidArgumentError extends CoreBCError<"INVALID_ARGUMENT"> { - /** - * The name of the argument. - */ - argument: string; + /** + * The name of the argument. + */ + argument: string; - /** - * The value that was provided. - */ - value: any; + /** + * The value that was provided. + */ + value: any; - info?: Record; + info?: Record; } /** * This Error indicates there were too few arguments were provided. */ export interface MissingArgumentError extends CoreBCError<"MISSING_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - - /** - * The number of arguments expected. - */ - expectedCount: number; + /** + * The number of arguments received. + */ + count: number; + + /** + * The number of arguments expected. + */ + expectedCount: number; } /** * This Error indicates too many arguments were provided. */ -export interface UnexpectedArgumentError - extends CoreBCError<"UNEXPECTED_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - - /** - * The number of arguments expected. - */ - expectedCount: number; +export interface UnexpectedArgumentError extends CoreBCError<"UNEXPECTED_ARGUMENT"> { + /** + * The number of arguments received. + */ + count: number; + + /** + * The number of arguments expected. + */ + expectedCount: number; } // Blockchain Errors @@ -390,73 +388,69 @@ export interface UnexpectedArgumentError * The action that resulted in the error. */ export type CallExceptionAction = - | "call" - | "estimateEnergy" - | "getTransactionResult" - | "unknown"; + "call" | "estimateEnergy" | "getTransactionResult" | "unknown"; /** * The related transaction that caused the error. */ export type CallExceptionTransaction = { - to: null | string; - from?: string; - data: string; + to: null | string; + from?: string; + data: string; }; /** * This **Error** indicates a transaction reverted. */ export interface CallExceptionError extends CoreBCError<"CALL_EXCEPTION"> { - /** - * The action being performed when the revert was encountered. - */ - action: CallExceptionAction; - - /** - * The revert data returned. - */ - data: null | string; - - /** - * A human-readable representation of data, if possible. - */ - reason: null | string; - - /** - * The transaction that triggered the exception. - */ - transaction: CallExceptionTransaction; - - /** - * The contract invocation details, if available. - */ - invocation: null | { - method: string; - signature: string; - args: Array; - }; - - /** - * The built-in or custom revert error, if available - */ - revert: null | { - signature: string; - name: string; - args: Array; - }; + /** + * The action being performed when the revert was encountered. + */ + action: CallExceptionAction; + + /** + * The revert data returned. + */ + data: null | string; + + /** + * A human-readable representation of data, if possible. + */ + reason: null | string; + + /** + * The transaction that triggered the exception. + */ + transaction: CallExceptionTransaction; + + /** + * The contract invocation details, if available. + */ + invocation: null | { + method: string; + signature: string; + args: Array; + }; + + /** + * The built-in or custom revert error, if available + */ + revert: null | { + signature: string; + name: string; + args: Array; + }; } /** * The sending account has insufficient funds to cover the * entire transaction cost. */ -export interface InsufficientFundsError - extends CoreBCError<"INSUFFICIENT_FUNDS"> { - /** - * The transaction. - */ - transaction: TransactionRequest; +export interface InsufficientFundsError extends CoreBCError<"INSUFFICIENT_FUNDS"> { + /** + * The transaction. + */ + transaction: TransactionRequest; } /** @@ -464,10 +458,10 @@ export interface InsufficientFundsError * transaction that has been included. */ export interface NonceExpiredError extends CoreBCError<"NONCE_EXPIRED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; + /** + * The transaction. + */ + transaction: TransactionRequest; } /** @@ -475,15 +469,15 @@ export interface NonceExpiredError extends CoreBCError<"NONCE_EXPIRED"> { * be further processed. */ export interface OffchainFaultError extends CoreBCError<"OFFCHAIN_FAULT"> { - /** - * The transaction. - */ - transaction?: TransactionRequest; - - /** - * The reason the CCIP-read failed. - */ - reason: string; + /** + * The transaction. + */ + transaction?: TransactionRequest; + + /** + * The reason the CCIP-read failed. + */ + reason: string; } /** @@ -491,44 +485,42 @@ export interface OffchainFaultError extends CoreBCError<"OFFCHAIN_FAULT"> { * insufficient additional fee to afford evicting the old * transaction from the memory pool. */ -export interface ReplacementUnderpricedError - extends CoreBCError<"REPLACEMENT_UNDERPRICED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; +export interface ReplacementUnderpricedError extends CoreBCError<"REPLACEMENT_UNDERPRICED"> { + /** + * The transaction. + */ + transaction: TransactionRequest; } /** * A pending transaction was replaced by another. */ -export interface TransactionReplacedError - extends CoreBCError<"TRANSACTION_REPLACED"> { - /** - * If the transaction was cancelled, such that the original - * effects of the transaction cannot be assured. - */ - cancelled: boolean; - - /** - * The reason the transaction was replaced. - */ - reason: "repriced" | "cancelled" | "replaced"; - - /** - * The hash of the replaced transaction. - */ - hash: string; - - /** - * The transaction that replaced the transaction. - */ - replacement: TransactionResponse; - - /** - * The receipt of the transaction that replace the transaction. - */ - receipt: TransactionReceipt; +export interface TransactionReplacedError extends CoreBCError<"TRANSACTION_REPLACED"> { + /** + * If the transaction was cancelled, such that the original + * effects of the transaction cannot be assured. + */ + cancelled: boolean; + + /** + * The reason the transaction was replaced. + */ + reason: "repriced" | "cancelled" | "replaced"; + + /** + * The hash of the replaced transaction. + */ + hash: string; + + /** + * The transaction that replaced the transaction. + */ + replacement: TransactionResponse; + + /** + * The receipt of the transaction that replace the transaction. + */ + receipt: TransactionReceipt; } /** @@ -538,12 +530,11 @@ export interface TransactionReplacedError * This could indicate an ENS name is unowned or that the current * address being pointed to is the [[ZeroAddress]]. */ -export interface UnconfiguredNameError - extends CoreBCError<"UNCONFIGURED_NAME"> { - /** - * The ENS name that was requested - */ - value: string; +export interface UnconfiguredNameError extends CoreBCError<"UNCONFIGURED_NAME"> { + /** + * The ENS name that was requested + */ + value: string; } /** @@ -555,25 +546,25 @@ export interface UnconfiguredNameError * this error is thrown. */ export interface ActionRejectedError extends CoreBCError<"ACTION_REJECTED"> { - /** - * The requested action. - */ - action: - | "requestAccess" - | "sendTransaction" - | "signMessage" - | "signTransaction" - | "signTypedData" - | "unknown"; - - /** - * The reason the action was rejected. - * - * If there is already a pending request, some clients may indicate - * there is already a ``"pending"`` action. This prevents an app - * from spamming the user. - */ - reason: "expired" | "rejected" | "pending"; + /** + * The requested action. + */ + action: + | "requestAccess" + | "sendTransaction" + | "signMessage" + | "signTransaction" + | "signTypedData" + | "unknown"; + + /** + * The reason the action was rejected. + * + * If there is already a pending request, some clients may indicate + * there is already a ``"pending"`` action. This prevents an app + * from spamming the user. + */ + reason: "expired" | "rejected" | "pending"; } // Coding; converts an ErrorCode its Typed Error @@ -585,48 +576,48 @@ export interface ActionRejectedError extends CoreBCError<"ACTION_REJECTED"> { * @flatworm-skip-docs */ export type CodedCoreBCError = T extends "UNKNOWN_ERROR" - ? UnknownError - : T extends "NOT_IMPLEMENTED" - ? NotImplementedError - : T extends "UNSUPPORTED_OPERATION" - ? UnsupportedOperationError - : T extends "NETWORK_ERROR" - ? NetworkError - : T extends "SERVER_ERROR" - ? ServerError - : T extends "TIMEOUT" - ? TimeoutError - : T extends "BAD_DATA" - ? BadDataError - : T extends "CANCELLED" - ? CancelledError - : T extends "BUFFER_OVERRUN" - ? BufferOverrunError - : T extends "NUMERIC_FAULT" - ? NumericFaultError - : T extends "INVALID_ARGUMENT" - ? InvalidArgumentError - : T extends "MISSING_ARGUMENT" - ? MissingArgumentError - : T extends "UNEXPECTED_ARGUMENT" - ? UnexpectedArgumentError - : T extends "CALL_EXCEPTION" - ? CallExceptionError - : T extends "INSUFFICIENT_FUNDS" - ? InsufficientFundsError - : T extends "NONCE_EXPIRED" - ? NonceExpiredError - : T extends "OFFCHAIN_FAULT" - ? OffchainFaultError - : T extends "REPLACEMENT_UNDERPRICED" - ? ReplacementUnderpricedError - : T extends "TRANSACTION_REPLACED" - ? TransactionReplacedError - : T extends "UNCONFIGURED_NAME" - ? UnconfiguredNameError - : T extends "ACTION_REJECTED" - ? ActionRejectedError - : never; + ? UnknownError + : T extends "NOT_IMPLEMENTED" + ? NotImplementedError + : T extends "UNSUPPORTED_OPERATION" + ? UnsupportedOperationError + : T extends "NETWORK_ERROR" + ? NetworkError + : T extends "SERVER_ERROR" + ? ServerError + : T extends "TIMEOUT" + ? TimeoutError + : T extends "BAD_DATA" + ? BadDataError + : T extends "CANCELLED" + ? CancelledError + : T extends "BUFFER_OVERRUN" + ? BufferOverrunError + : T extends "NUMERIC_FAULT" + ? NumericFaultError + : T extends "INVALID_ARGUMENT" + ? InvalidArgumentError + : T extends "MISSING_ARGUMENT" + ? MissingArgumentError + : T extends "UNEXPECTED_ARGUMENT" + ? UnexpectedArgumentError + : T extends "CALL_EXCEPTION" + ? CallExceptionError + : T extends "INSUFFICIENT_FUNDS" + ? InsufficientFundsError + : T extends "NONCE_EXPIRED" + ? NonceExpiredError + : T extends "OFFCHAIN_FAULT" + ? OffchainFaultError + : T extends "REPLACEMENT_UNDERPRICED" + ? ReplacementUnderpricedError + : T extends "TRANSACTION_REPLACED" + ? TransactionReplacedError + : T extends "UNCONFIGURED_NAME" + ? UnconfiguredNameError + : T extends "ACTION_REJECTED" + ? ActionRejectedError + : never; /** * Returns true if the %%error%% matches an error thrown by corebc @@ -648,17 +639,17 @@ export type CodedCoreBCError = T extends "UNKNOWN_ERROR" * } */ export function isError>( - error: any, - code: K, + error: any, + code: K, ): error is T { - return error && (error).code === code; + return error && (error).code === code; } /** * Returns true if %%error%% is a [[CallExceptionError]. */ export function isCallException(error: any): error is CallExceptionError { - return isError(error, "CALL_EXCEPTION"); + return isError(error, "CALL_EXCEPTION"); } /** @@ -672,56 +663,56 @@ export function isCallException(error: any): error is CallExceptionError { * corebc version, %%code%% and all aditional properties, serialized. */ export function makeError>( - message: string, - code: K, - info?: ErrorInfo, + message: string, + code: K, + info?: ErrorInfo, ): T { - { - const details: Array = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error( - `value will overwrite populated values: ${stringify(info)}`, - ); - } - for (const key in info) { - const value = info[>key]; - // try { - details.push(key + "=" + stringify(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - - defineProperties(error, { code }); - - if (info) { - Object.assign(error, info); - } - - return error; + { + const details: Array = []; + if (info) { + if ("message" in info || "code" in info || "name" in info) { + throw new Error( + `value will overwrite populated values: ${stringify(info)}`, + ); + } + for (const key in info) { + const value = info[>key]; + // try { + details.push(key + "=" + stringify(value)); + // } catch (error: any) { + // console.log("MMM", error.message); + // details.push(key + "=[could not serialize object]"); + // } + } + } + details.push(`code=${code}`); + details.push(`version=${version}`); + + if (details.length) { + message += " (" + details.join(", ") + ")"; + } + } + + let error; + switch (code) { + case "INVALID_ARGUMENT": + error = new TypeError(message); + break; + case "NUMERIC_FAULT": + case "BUFFER_OVERRUN": + error = new RangeError(message); + break; + default: + error = new Error(message); + } + + defineProperties(error, { code }); + + if (info) { + Object.assign(error, info); + } + + return error; } /** @@ -731,14 +722,14 @@ export function makeError>( * @see [[api:makeError]] */ export function assert>( - check: unknown, - message: string, - code: K, - info?: ErrorInfo, + check: unknown, + message: string, + code: K, + info?: ErrorInfo, ): asserts check { - if (!check) { - throw makeError(message, code, info); - } + if (!check) { + throw makeError(message, code, info); + } } /** @@ -749,88 +740,88 @@ export function assert>( * any further code does not need additional compile-time checks. */ export function assertArgument( - check: unknown, - message: string, - name: string, - value: unknown, + check: unknown, + message: string, + name: string, + value: unknown, ): asserts check { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); + assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); } export function assertArgumentCount( - count: number, - expectedCount: number, - message?: string, + count: number, + expectedCount: number, + message?: string, ): void { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - - assert( - count >= expectedCount, - "missing arguemnt" + message, - "MISSING_ARGUMENT", - { - count: count, - expectedCount: expectedCount, - }, - ); - - assert( - count <= expectedCount, - "too many arguemnts" + message, - "UNEXPECTED_ARGUMENT", - { - count: count, - expectedCount: expectedCount, - }, - ); + if (message == null) { + message = ""; + } + if (message) { + message = ": " + message; + } + + assert( + count >= expectedCount, + "missing arguemnt" + message, + "MISSING_ARGUMENT", + { + count: count, + expectedCount: expectedCount, + }, + ); + + assert( + count <= expectedCount, + "too many arguemnts" + message, + "UNEXPECTED_ARGUMENT", + { + count: count, + expectedCount: expectedCount, + }, + ); } const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce( - (accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - /* c8 ignore stop */ - - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - - accum.push(form); - } catch (error) {} - - return accum; - }, - >[], + (accum, form) => { + try { + // General test for normalize + /* c8 ignore start */ + if ("test".normalize(form) !== "test") { + throw new Error("bad"); + } + /* c8 ignore stop */ + + if (form === "NFD") { + const check = String.fromCharCode(0xe9).normalize("NFD"); + const expected = String.fromCharCode(0x65, 0x0301); + /* c8 ignore start */ + if (check !== expected) { + throw new Error("broken"); + } + /* c8 ignore stop */ + } + + accum.push(form); + } catch (error) {} + + return accum; + }, + >[], ); /** * Throws if the normalization %%form%% is not supported. */ export function assertNormalize(form: string): void { - assert( - _normalizeForms.indexOf(form) >= 0, - "platform missing String.prototype.normalize", - "UNSUPPORTED_OPERATION", - { - operation: "String.prototype.normalize", - info: { form }, - }, - ); + assert( + _normalizeForms.indexOf(form) >= 0, + "platform missing String.prototype.normalize", + "UNSUPPORTED_OPERATION", + { + operation: "String.prototype.normalize", + info: { form }, + }, + ); } /** @@ -840,27 +831,27 @@ export function assertNormalize(form: string): void { * throwing if not, indicating the %%className%% if provided. */ export function assertPrivate( - givenGuard: any, - guard: any, - className?: string, + givenGuard: any, + guard: any, + className?: string, ): void { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, - operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert( - false, - `private constructor; use ${method}from* methods`, - "UNSUPPORTED_OPERATION", - { - operation, - }, - ); - } + if (className == null) { + className = ""; + } + if (givenGuard !== guard) { + let method = className, + operation = "new"; + if (className) { + method += "."; + operation += " " + className; + } + assert( + false, + `private constructor; use ${method}from* methods`, + "UNSUPPORTED_OPERATION", + { + operation, + }, + ); + } } diff --git a/src.ts/utils/events.ts b/src.ts/utils/events.ts index 5b453e332..f58fb676f 100644 --- a/src.ts/utils/events.ts +++ b/src.ts/utils/events.ts @@ -17,53 +17,53 @@ export type Listener = (...args: Array) => void; * An EventEmitter implements the observer pattern. */ export interface EventEmitterable { - /** - * Registers a %%listener%% that is called whenever the - * %%event%% occurs until unregistered. - */ - on(event: T, listener: Listener): Promise; + /** + * Registers a %%listener%% that is called whenever the + * %%event%% occurs until unregistered. + */ + on(event: T, listener: Listener): Promise; - /** - * Registers a %%listener%% that is called the next time - * %%event%% occurs. - */ - once(event: T, listener: Listener): Promise; + /** + * Registers a %%listener%% that is called the next time + * %%event%% occurs. + */ + once(event: T, listener: Listener): Promise; - /** - * Triggers each listener for %%event%% with the %%args%%. - */ - emit(event: T, ...args: Array): Promise; + /** + * Triggers each listener for %%event%% with the %%args%%. + */ + emit(event: T, ...args: Array): Promise; - /** - * Resolves to the number of listeners for %%event%%. - */ - listenerCount(event?: T): Promise; + /** + * Resolves to the number of listeners for %%event%%. + */ + listenerCount(event?: T): Promise; - /** - * Resolves to the listeners for %%event%%. - */ - listeners(event?: T): Promise>; + /** + * Resolves to the listeners for %%event%%. + */ + listeners(event?: T): Promise>; - /** - * Unregister the %%listener%% for %%event%%. If %%listener%% - * is unspecified, all listeners are unregistered. - */ - off(event: T, listener?: Listener): Promise; + /** + * Unregister the %%listener%% for %%event%%. If %%listener%% + * is unspecified, all listeners are unregistered. + */ + off(event: T, listener?: Listener): Promise; - /** - * Unregister all listeners for %%event%%. - */ - removeAllListeners(event?: T): Promise; + /** + * Unregister all listeners for %%event%%. + */ + removeAllListeners(event?: T): Promise; - /** - * Alias for [[on]]. - */ - addListener(event: T, listener: Listener): Promise; + /** + * Alias for [[on]]. + */ + addListener(event: T, listener: Listener): Promise; - /** - * Alias for [[off]]. - */ - removeListener(event: T, listener: Listener): Promise; + /** + * Alias for [[off]]. + */ + removeListener(event: T, listener: Listener): Promise; } /** @@ -72,38 +72,38 @@ export interface EventEmitterable { * an **EventPayload**. */ export class EventPayload { - /** - * The event filter. - */ - readonly filter!: T; + /** + * The event filter. + */ + readonly filter!: T; - /** - * The **EventEmitterable**. - */ - readonly emitter!: EventEmitterable; + /** + * The **EventEmitterable**. + */ + readonly emitter!: EventEmitterable; - readonly #listener: null | Listener; + readonly #listener: null | Listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor( - emitter: EventEmitterable, - listener: null | Listener, - filter: T, - ) { - this.#listener = listener; - defineProperties>(this, { emitter, filter }); - } + /** + * Create a new **EventPayload** for %%emitter%% with + * the %%listener%% and for %%filter%%. + */ + constructor( + emitter: EventEmitterable, + listener: null | Listener, + filter: T, + ) { + this.#listener = listener; + defineProperties>(this, { emitter, filter }); + } - /** - * Unregister the triggered listener for future events. - */ - async removeListener(): Promise { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } + /** + * Unregister the triggered listener for future events. + */ + async removeListener(): Promise { + if (this.#listener == null) { + return; + } + await this.emitter.off(this.filter, this.#listener); + } } diff --git a/src.ts/utils/fetch.ts b/src.ts/utils/fetch.ts index 9fb1a9413..30dbca120 100644 --- a/src.ts/utils/fetch.ts +++ b/src.ts/utils/fetch.ts @@ -12,15 +12,15 @@ import { toUtf8Bytes, toUtf8String } from "./utf8.js"; import { getUrl } from "./geturl.js"; export type GetUrlResponse = { - statusCode: number; - statusMessage: string; - headers: Record; - body: null | Uint8Array; + statusCode: number; + statusMessage: string; + headers: Record; + body: null | Uint8Array; }; export type FetchThrottleParams = { - maxAttempts?: number; - slotInterval?: number; + maxAttempts?: number; + slotInterval?: number; }; /** * Called before any network request, allowing updated headers (e.g. Bearer tokens), etc. @@ -31,25 +31,25 @@ export type FetchPreflightFunc = (req: FetchRequest) => Promise; * Called on the response, allowing client-based throttling logic or post-processing. */ export type FetchProcessFunc = ( - req: FetchRequest, - resp: FetchResponse, + req: FetchRequest, + resp: FetchResponse, ) => Promise; /** * Called prior to each retry; return true to retry, false to abort. */ export type FetchRetryFunc = ( - req: FetchRequest, - resp: FetchResponse, - attempt: number, + req: FetchRequest, + resp: FetchResponse, + attempt: number, ) => Promise; /** * Called on Gateway URLs. */ export type FetchGatewayFunc = ( - url: string, - signal?: FetchCancelSignal, + url: string, + signal?: FetchCancelSignal, ) => Promise; /** @@ -59,8 +59,8 @@ export type FetchGatewayFunc = ( * how you would register it. */ export type FetchGetUrlFunc = ( - req: FetchRequest, - signal?: FetchCancelSignal, + req: FetchRequest, + signal?: FetchCancelSignal, ) => Promise; const MAX_ATTEMPTS = 12; @@ -77,31 +77,31 @@ let locked = false; // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs async function dataGatewayFunc( - url: string, - signal?: FetchCancelSignal, + url: string, + signal?: FetchCancelSignal, ): Promise { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse( - 200, - "OK", - { - "content-type": match[1] || "text/plain", - }, - match[2] ? decodeBase64(match[3]) : unpercent(match[3]), - ); - } catch (error) { - return new FetchResponse( - 599, - "BAD REQUEST (invalid data: URI)", - {}, - null, - new FetchRequest(url), - ); - } + try { + const match = url.match(reData); + if (!match) { + throw new Error("invalid data"); + } + return new FetchResponse( + 200, + "OK", + { + "content-type": match[1] || "text/plain", + }, + match[2] ? decodeBase64(match[3]) : unpercent(match[3]), + ); + } catch (error) { + return new FetchResponse( + 599, + "BAD REQUEST (invalid data: URI)", + {}, + null, + new FetchRequest(url), + ); + } } /** @@ -109,33 +109,33 @@ async function dataGatewayFunc( * IPFS gateway hosted at %%baseUrl%%. */ function getIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc { - async function gatewayIpfs( - url: string, - signal?: FetchCancelSignal, - ): Promise { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } catch (error) { - return new FetchResponse( - 599, - "BAD REQUEST (invalid IPFS URI)", - {}, - null, - new FetchRequest(url), - ); - } - } - - return gatewayIpfs; + async function gatewayIpfs( + url: string, + signal?: FetchCancelSignal, + ): Promise { + try { + const match = url.match(reIpfs); + if (!match) { + throw new Error("invalid link"); + } + return new FetchRequest(`${baseUrl}${match[2]}`); + } catch (error) { + return new FetchResponse( + 599, + "BAD REQUEST (invalid IPFS URI)", + {}, + null, + new FetchRequest(url), + ); + } + } + + return gatewayIpfs; } const Gateways: Record = { - data: dataGatewayFunc, - ipfs: getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/"), + data: dataGatewayFunc, + ipfs: getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/"), }; const fetchSignals: WeakMap void> = new WeakMap(); @@ -144,56 +144,56 @@ const fetchSignals: WeakMap void> = new WeakMap(); * @_ignore */ export class FetchCancelSignal { - #listeners: Array<() => void>; - #cancelled: boolean; - - constructor(request: FetchRequest) { - this.#listeners = []; - this.#cancelled = false; - - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - - for (const listener of this.#listeners) { - setTimeout(() => { - listener(); - }, 0); - } - this.#listeners = []; - }); - } - - addListener(listener: () => void): void { - assert( - !this.#cancelled, - "singal already cancelled", - "UNSUPPORTED_OPERATION", - { - operation: "fetchCancelSignal.addCancelListener", - }, - ); - this.#listeners.push(listener); - } - - get cancelled(): boolean { - return this.#cancelled; - } - - checkSignal(): void { - assert(!this.cancelled, "cancelled", "CANCELLED", {}); - } + #listeners: Array<() => void>; + #cancelled: boolean; + + constructor(request: FetchRequest) { + this.#listeners = []; + this.#cancelled = false; + + fetchSignals.set(request, () => { + if (this.#cancelled) { + return; + } + this.#cancelled = true; + + for (const listener of this.#listeners) { + setTimeout(() => { + listener(); + }, 0); + } + this.#listeners = []; + }); + } + + addListener(listener: () => void): void { + assert( + !this.#cancelled, + "singal already cancelled", + "UNSUPPORTED_OPERATION", + { + operation: "fetchCancelSignal.addCancelListener", + }, + ); + this.#listeners.push(listener); + } + + get cancelled(): boolean { + return this.#cancelled; + } + + checkSignal(): void { + assert(!this.cancelled, "cancelled", "CANCELLED", {}); + } } // Check the signal, throwing if it is cancelled function checkSignal(signal?: FetchCancelSignal): FetchCancelSignal { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; + if (signal == null) { + throw new Error("missing signal; should not happen"); + } + signal.checkSignal(); + return signal; } /** @@ -211,893 +211,893 @@ function checkSignal(signal?: FetchCancelSignal): FetchCancelSignal { * //_result: */ export class FetchRequest implements Iterable<[key: string, value: string]> { - #allowInsecure: boolean; - #gzip: boolean; - #headers: Record; - #method: string; - #timeout: number; - #url: string; - - #body?: Uint8Array; - #bodyType?: string; - #creds?: string; - - // Hooks - #preflight?: null | FetchPreflightFunc; - #process?: null | FetchProcessFunc; - #retry?: null | FetchRetryFunc; - - #signal?: FetchCancelSignal; - - #throttle: Required; - - /** - * The fetch URI to requrest. - */ - get url(): string { - return this.#url; - } - set url(url: string) { - this.#url = String(url); - } - - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . - * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrincis ``Content-Type`` is - * set to ``application/json``. - */ - get body(): null | Uint8Array { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body: null | string | Readonly | Readonly) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } else if (typeof body === "string") { - this.#body = toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } else if (typeof body === "object") { - this.#body = toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } else { - throw new Error("invalid body"); - } - } - - /** - * Returns true if the request has a body. - */ - hasBody(): this is FetchRequest & { body: Uint8Array } { - return this.#body != null; - } - - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method(): string { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method: null | string) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any chnages will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers(): Record { - const headers = Object.assign({}, this.#headers); - - if (this.#creds) { - headers["authorization"] = `Basic ${encodeBase64( - toUtf8Bytes(this.#creds), - )}`; - } - - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - - return headers; - } - - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key: string): string { - return this.headers[key.toLowerCase()]; - } - - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key: string, value: string | number): void { - this.#headers[String(key).toLowerCase()] = String(value); - } - - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders(): void { - this.#headers = {}; - } - - [Symbol.iterator](): Iterator<[key: string, value: string]> { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials(): null | string { - return this.#creds || null; - } - - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username: string, password: string): void { - assertArgument( - !username.match(/:/), - "invalid basic authentication username", - "username", - "[REDACTED]", - ); - this.#creds = `${username}:${password}`; - } - - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip(): boolean { - return this.#gzip; - } - set allowGzip(value: boolean) { - this.#gzip = !!value; - } - - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication(): boolean { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value: boolean) { - this.#allowInsecure = !!value; - } - - /** - * The timeout (in milliseconds) to wait for a complere response. - * //(default: 5 minutes)// - */ - get timeout(): number { - return this.#timeout; - } - set timeout(timeout: number) { - assertArgument( - timeout >= 0, - "timeout must be non-zero", - "timeout", - timeout, - ); - this.#timeout = timeout; - } - - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc(): null | FetchPreflightFunc { - return this.#preflight || null; - } - set preflightFunc(preflight: null | FetchPreflightFunc) { - this.#preflight = preflight; - } - - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc(): null | FetchProcessFunc { - return this.#process || null; - } - set processFunc(process: null | FetchProcessFunc) { - this.#process = process; - } - - /** - * This function is called on each retry attempt. - */ - get retryFunc(): null | FetchRetryFunc { - return this.#retry || null; - } - set retryFunc(retry: null | FetchRetryFunc) { - this.#retry = retry; - } - - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url: string) { - this.#url = String(url); - - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS, - }; - } - - toString(): string { - return ``; - } - - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params: FetchThrottleParams): void { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - - async #send( - attempt: number, - expires: number, - delay: number, - _request: FetchRequest, - _response: FetchResponse, - ): Promise { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - - assert(getTime() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", - reason: "timeout", - request: _request, - }); - - if (delay > 0) { - await wait(delay); - } - - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme]( - req.url, - checkSignal(_request.#signal), - ); - if (result instanceof FetchResponse) { - let response = result; - - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } catch (error: any) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - - // Ignore throttling - } - } - - return response; - } - req = result; - } - - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - - const resp = await getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse( - resp.statusCode, - resp.statusMessage, - resp.headers, - resp.body, - _request, - ); - - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req - .redirect(location) - .#send(attempt + 1, expires, 0, _request, response); - } catch (error) {} - - // Things won't get any better on another attempt; abort - return response; - } else if (response.statusCode === 429) { - // Throttle - if ( - this.retryFunc == null || - (await this.retryFunc(req, response, attempt)) - ) { - const retryAfter = response.headers["retry-after"]; - let delay = - this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if ( - typeof retryAfter === "string" && - retryAfter.match(/^[1-9][0-9]*$/) - ) { - delay = parseInt(retryAfter); - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } catch (error: any) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - - // Throttle - let delay = - this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (error.stall >= 0) { - delay = error.stall; - } - - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - - return response; - } - - /** - * Resolves to the response by sending the request. - */ - send(): Promise { - assert( - this.#signal == null, - "request already sent", - "UNSUPPORTED_OPERATION", - { operation: "fetchRequest.send" }, - ); - this.#signal = new FetchCancelSignal(this); - return this.#send( - 0, - getTime() + this.timeout, - 0, - this, - new FetchResponse(0, "", {}, null, this), - ); - } - - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel(): void { - assert( - this.#signal != null, - "request has not been sent", - "UNSUPPORTED_OPERATION", - { operation: "fetchRequest.cancel" }, - ); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location: string): FetchRequest { - // Redirection; for now we only support absolute locataions - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - assert( - this.method === "GET" && - (current !== "https" || target !== "http") && - location.match(/^https?:/), - `unsupported redirect`, - "UNSUPPORTED_OPERATION", - { - operation: `redirect(${this.method} ${JSON.stringify( - this.url, - )} => ${JSON.stringify(location)})`, - }, - ); - - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - - return req; - } - - /** - * Create a new copy of this request. - */ - clone(): FetchRequest { - const clone = new FetchRequest(this.url); - - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - - if (this.allowGzip) { - clone.allowGzip = true; - } - - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - - return clone; - } - - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig(): void { - locked = true; - } - - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme: string): null | FetchGatewayFunc { - return Gateways[scheme.toLowerCase()] || null; - } - - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme: string, func: FetchGatewayFunc): void { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl: FetchGetUrlFunc): void { - if (locked) { - throw new Error("gateways locked"); - } - getUrlFunc = getUrl; - } - - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway(): FetchGatewayFunc { - return dataGatewayFunc; - } - - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc { - return getIpfsGatewayFunc(baseUrl); - } + #allowInsecure: boolean; + #gzip: boolean; + #headers: Record; + #method: string; + #timeout: number; + #url: string; + + #body?: Uint8Array; + #bodyType?: string; + #creds?: string; + + // Hooks + #preflight?: null | FetchPreflightFunc; + #process?: null | FetchProcessFunc; + #retry?: null | FetchRetryFunc; + + #signal?: FetchCancelSignal; + + #throttle: Required; + + /** + * The fetch URI to requrest. + */ + get url(): string { + return this.#url; + } + set url(url: string) { + this.#url = String(url); + } + + /** + * The fetch body, if any, to send as the request body. //(default: null)// + * + * When setting a body, the intrinsic ``Content-Type`` is automatically + * set and will be used if **not overridden** by setting a custom + * header. + * + * If %%body%% is null, the body is cleared (along with the + * intrinsic ``Content-Type``) and the . + * + * If %%body%% is a string, the intrincis ``Content-Type`` is set to + * ``text/plain``. + * + * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to + * ``application/octet-stream``. + * + * If %%body%% is any other object, the intrincis ``Content-Type`` is + * set to ``application/json``. + */ + get body(): null | Uint8Array { + if (this.#body == null) { + return null; + } + return new Uint8Array(this.#body); + } + set body(body: null | string | Readonly | Readonly) { + if (body == null) { + this.#body = undefined; + this.#bodyType = undefined; + } else if (typeof body === "string") { + this.#body = toUtf8Bytes(body); + this.#bodyType = "text/plain"; + } else if (body instanceof Uint8Array) { + this.#body = body; + this.#bodyType = "application/octet-stream"; + } else if (typeof body === "object") { + this.#body = toUtf8Bytes(JSON.stringify(body)); + this.#bodyType = "application/json"; + } else { + throw new Error("invalid body"); + } + } + + /** + * Returns true if the request has a body. + */ + hasBody(): this is FetchRequest & { body: Uint8Array } { + return this.#body != null; + } + + /** + * The HTTP method to use when requesting the URI. If no method + * has been explicitly set, then ``GET`` is used if the body is + * null and ``POST`` otherwise. + */ + get method(): string { + if (this.#method) { + return this.#method; + } + if (this.hasBody()) { + return "POST"; + } + return "GET"; + } + set method(method: null | string) { + if (method == null) { + method = ""; + } + this.#method = String(method).toUpperCase(); + } + + /** + * The headers that will be used when requesting the URI. All + * keys are lower-case. + * + * This object is a copy, so any chnages will **NOT** be reflected + * in the ``FetchRequest``. + * + * To set a header entry, use the ``setHeader`` method. + */ + get headers(): Record { + const headers = Object.assign({}, this.#headers); + + if (this.#creds) { + headers["authorization"] = `Basic ${encodeBase64( + toUtf8Bytes(this.#creds), + )}`; + } + + if (this.allowGzip) { + headers["accept-encoding"] = "gzip"; + } + + if (headers["content-type"] == null && this.#bodyType) { + headers["content-type"] = this.#bodyType; + } + if (this.body) { + headers["content-length"] = String(this.body.length); + } + + return headers; + } + + /** + * Get the header for %%key%%, ignoring case. + */ + getHeader(key: string): string { + return this.headers[key.toLowerCase()]; + } + + /** + * Set the header for %%key%% to %%value%%. All values are coerced + * to a string. + */ + setHeader(key: string, value: string | number): void { + this.#headers[String(key).toLowerCase()] = String(value); + } + + /** + * Clear all headers, resetting all intrinsic headers. + */ + clearHeaders(): void { + this.#headers = {}; + } + + [Symbol.iterator](): Iterator<[key: string, value: string]> { + const headers = this.headers; + const keys = Object.keys(headers); + let index = 0; + return { + next: () => { + if (index < keys.length) { + const key = keys[index++]; + return { + value: [key, headers[key]], + done: false, + }; + } + return { value: undefined, done: true }; + }, + }; + } + + /** + * The value that will be sent for the ``Authorization`` header. + * + * To set the credentials, use the ``setCredentials`` method. + */ + get credentials(): null | string { + return this.#creds || null; + } + + /** + * Sets an ``Authorization`` for %%username%% with %%password%%. + */ + setCredentials(username: string, password: string): void { + assertArgument( + !username.match(/:/), + "invalid basic authentication username", + "username", + "[REDACTED]", + ); + this.#creds = `${username}:${password}`; + } + + /** + * Enable and request gzip-encoded responses. The response will + * automatically be decompressed. //(default: true)// + */ + get allowGzip(): boolean { + return this.#gzip; + } + set allowGzip(value: boolean) { + this.#gzip = !!value; + } + + /** + * Allow ``Authentication`` credentials to be sent over insecure + * channels. //(default: false)// + */ + get allowInsecureAuthentication(): boolean { + return !!this.#allowInsecure; + } + set allowInsecureAuthentication(value: boolean) { + this.#allowInsecure = !!value; + } + + /** + * The timeout (in milliseconds) to wait for a complere response. + * //(default: 5 minutes)// + */ + get timeout(): number { + return this.#timeout; + } + set timeout(timeout: number) { + assertArgument( + timeout >= 0, + "timeout must be non-zero", + "timeout", + timeout, + ); + this.#timeout = timeout; + } + + /** + * This function is called prior to each request, for example + * during a redirection or retry in case of server throttling. + * + * This offers an opportunity to populate headers or update + * content before sending a request. + */ + get preflightFunc(): null | FetchPreflightFunc { + return this.#preflight || null; + } + set preflightFunc(preflight: null | FetchPreflightFunc) { + this.#preflight = preflight; + } + + /** + * This function is called after each response, offering an + * opportunity to provide client-level throttling or updating + * response data. + * + * Any error thrown in this causes the ``send()`` to throw. + * + * To schedule a retry attempt (assuming the maximum retry limit + * has not been reached), use [[response.throwThrottleError]]. + */ + get processFunc(): null | FetchProcessFunc { + return this.#process || null; + } + set processFunc(process: null | FetchProcessFunc) { + this.#process = process; + } + + /** + * This function is called on each retry attempt. + */ + get retryFunc(): null | FetchRetryFunc { + return this.#retry || null; + } + set retryFunc(retry: null | FetchRetryFunc) { + this.#retry = retry; + } + + /** + * Create a new FetchRequest instance with default values. + * + * Once created, each property may be set before issuing a + * ``.send()`` to make the request. + */ + constructor(url: string) { + this.#url = String(url); + + this.#allowInsecure = false; + this.#gzip = true; + this.#headers = {}; + this.#method = ""; + this.#timeout = 300000; + + this.#throttle = { + slotInterval: SLOT_INTERVAL, + maxAttempts: MAX_ATTEMPTS, + }; + } + + toString(): string { + return ``; + } + + /** + * Update the throttle parameters used to determine maximum + * attempts and exponential-backoff properties. + */ + setThrottleParams(params: FetchThrottleParams): void { + if (params.slotInterval != null) { + this.#throttle.slotInterval = params.slotInterval; + } + if (params.maxAttempts != null) { + this.#throttle.maxAttempts = params.maxAttempts; + } + } + + async #send( + attempt: number, + expires: number, + delay: number, + _request: FetchRequest, + _response: FetchResponse, + ): Promise { + if (attempt >= this.#throttle.maxAttempts) { + return _response.makeServerError("exceeded maximum retry limit"); + } + + assert(getTime() <= expires, "timeout", "TIMEOUT", { + operation: "request.send", + reason: "timeout", + request: _request, + }); + + if (delay > 0) { + await wait(delay); + } + + let req = this.clone(); + const scheme = (req.url.split(":")[0] || "").toLowerCase(); + + // Process any Gateways + if (scheme in Gateways) { + const result = await Gateways[scheme]( + req.url, + checkSignal(_request.#signal), + ); + if (result instanceof FetchResponse) { + let response = result; + + if (this.processFunc) { + checkSignal(_request.#signal); + try { + response = await this.processFunc(req, response); + } catch (error: any) { + // Something went wrong during processing; throw a 5xx server error + if (error.throttle == null || typeof error.stall !== "number") { + response + .makeServerError("error in post-processing function", error) + .assertOk(); + } + + // Ignore throttling + } + } + + return response; + } + req = result; + } + + // We have a preflight function; update the request + if (this.preflightFunc) { + req = await this.preflightFunc(req); + } + + const resp = await getUrlFunc(req, checkSignal(_request.#signal)); + let response = new FetchResponse( + resp.statusCode, + resp.statusMessage, + resp.headers, + resp.body, + _request, + ); + + if (response.statusCode === 301 || response.statusCode === 302) { + // Redirect + try { + const location = response.headers.location || ""; + return req + .redirect(location) + .#send(attempt + 1, expires, 0, _request, response); + } catch (error) {} + + // Things won't get any better on another attempt; abort + return response; + } else if (response.statusCode === 429) { + // Throttle + if ( + this.retryFunc == null || + (await this.retryFunc(req, response, attempt)) + ) { + const retryAfter = response.headers["retry-after"]; + let delay = + this.#throttle.slotInterval * + Math.trunc(Math.random() * Math.pow(2, attempt)); + if ( + typeof retryAfter === "string" && + retryAfter.match(/^[1-9][0-9]*$/) + ) { + delay = parseInt(retryAfter); + } + return req + .clone() + .#send(attempt + 1, expires, delay, _request, response); + } + } + + if (this.processFunc) { + checkSignal(_request.#signal); + try { + response = await this.processFunc(req, response); + } catch (error: any) { + // Something went wrong during processing; throw a 5xx server error + if (error.throttle == null || typeof error.stall !== "number") { + response + .makeServerError("error in post-processing function", error) + .assertOk(); + } + + // Throttle + let delay = + this.#throttle.slotInterval * + Math.trunc(Math.random() * Math.pow(2, attempt)); + if (error.stall >= 0) { + delay = error.stall; + } + + return req + .clone() + .#send(attempt + 1, expires, delay, _request, response); + } + } + + return response; + } + + /** + * Resolves to the response by sending the request. + */ + send(): Promise { + assert( + this.#signal == null, + "request already sent", + "UNSUPPORTED_OPERATION", + { operation: "fetchRequest.send" }, + ); + this.#signal = new FetchCancelSignal(this); + return this.#send( + 0, + getTime() + this.timeout, + 0, + this, + new FetchResponse(0, "", {}, null, this), + ); + } + + /** + * Cancels the inflight response, causing a ``CANCELLED`` + * error to be rejected from the [[send]]. + */ + cancel(): void { + assert( + this.#signal != null, + "request has not been sent", + "UNSUPPORTED_OPERATION", + { operation: "fetchRequest.cancel" }, + ); + const signal = fetchSignals.get(this); + if (!signal) { + throw new Error("missing signal; should not happen"); + } + signal(); + } + + /** + * Returns a new [[FetchRequest]] that represents the redirection + * to %%location%%. + */ + redirect(location: string): FetchRequest { + // Redirection; for now we only support absolute locataions + const current = this.url.split(":")[0].toLowerCase(); + const target = location.split(":")[0].toLowerCase(); + + // Don't allow redirecting: + // - non-GET requests + // - downgrading the security (e.g. https => http) + // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] + assert( + this.method === "GET" && + (current !== "https" || target !== "http") && + location.match(/^https?:/), + `unsupported redirect`, + "UNSUPPORTED_OPERATION", + { + operation: `redirect(${this.method} ${JSON.stringify( + this.url, + )} => ${JSON.stringify(location)})`, + }, + ); + + // Create a copy of this request, with a new URL + const req = new FetchRequest(location); + req.method = "GET"; + req.allowGzip = this.allowGzip; + req.timeout = this.timeout; + req.#headers = Object.assign({}, this.#headers); + if (this.#body) { + req.#body = new Uint8Array(this.#body); + } + req.#bodyType = this.#bodyType; + + // Do not forward credentials unless on the same domain; only absolute + //req.allowInsecure = false; + // paths are currently supported; may want a way to specify to forward? + //setStore(req.#props, "creds", getStore(this.#pros, "creds")); + + return req; + } + + /** + * Create a new copy of this request. + */ + clone(): FetchRequest { + const clone = new FetchRequest(this.url); + + // Preserve "default method" (i.e. null) + clone.#method = this.#method; + + // Preserve "default body" with type, copying the Uint8Array is present + if (this.#body) { + clone.#body = this.#body; + } + clone.#bodyType = this.#bodyType; + + // Preserve "default headers" + clone.#headers = Object.assign({}, this.#headers); + + // Credentials is readonly, so we copy internally + clone.#creds = this.#creds; + + if (this.allowGzip) { + clone.allowGzip = true; + } + + clone.timeout = this.timeout; + if (this.allowInsecureAuthentication) { + clone.allowInsecureAuthentication = true; + } + + clone.#preflight = this.#preflight; + clone.#process = this.#process; + clone.#retry = this.#retry; + + return clone; + } + + /** + * Locks all static configuration for gateways and FetchGetUrlFunc + * registration. + */ + static lockConfig(): void { + locked = true; + } + + /** + * Get the current Gateway function for %%scheme%%. + */ + static getGateway(scheme: string): null | FetchGatewayFunc { + return Gateways[scheme.toLowerCase()] || null; + } + + /** + * Use the %%func%% when fetching URIs using %%scheme%%. + * + * This method affects all requests globally. + * + * If [[lockConfig]] has been called, no change is made and this + * throws. + */ + static registerGateway(scheme: string, func: FetchGatewayFunc): void { + scheme = scheme.toLowerCase(); + if (scheme === "http" || scheme === "https") { + throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); + } + if (locked) { + throw new Error("gateways locked"); + } + Gateways[scheme] = func; + } + + /** + * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. + * + * This method affects all requests globally. + * + * If [[lockConfig]] has been called, no change is made and this + * throws. + */ + static registerGetUrl(getUrl: FetchGetUrlFunc): void { + if (locked) { + throw new Error("gateways locked"); + } + getUrlFunc = getUrl; + } + + /** + * Creates a function that can "fetch" data URIs. + * + * Note that this is automatically done internally to support + * data URIs, so it is not necessary to register it. + * + * This is not generally something that is needed, but may + * be useful in a wrapper to perfom custom data URI functionality. + */ + static createDataGateway(): FetchGatewayFunc { + return dataGatewayFunc; + } + + /** + * Creates a function that will fetch IPFS (unvalidated) from + * a custom gateway baseUrl. + * + * The default IPFS gateway used internally is + * ``"https:/\/gateway.ipfs.io/ipfs/"``. + */ + static createIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc { + return getIpfsGatewayFunc(baseUrl); + } } interface ThrottleError extends Error { - stall: number; - throttle: true; + stall: number; + throttle: true; } /** * The response for a FetchREquest. */ export class FetchResponse implements Iterable<[key: string, value: string]> { - #statusCode: number; - #statusMessage: string; - #headers: Record; - #body: null | Readonly; - #request: null | FetchRequest; - - #error: { error?: Error; message: string }; - - toString(): string { - return ``; - } - - /** - * The response status code. - */ - get statusCode(): number { - return this.#statusCode; - } - - /** - * The response status message. - */ - get statusMessage(): string { - return this.#statusMessage; - } - - /** - * The response headers. All keys are lower-case. - */ - get headers(): Record { - return Object.assign({}, this.#headers); - } - - /** - * The response body, or ``null`` if there was no body. - */ - get body(): null | Readonly { - return this.#body == null ? null : new Uint8Array(this.#body); - } - - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText(): string { - try { - return this.#body == null ? "" : toUtf8String(this.#body); - } catch (error) { - assert( - false, - "response body is not valid UTF-8 data", - "UNSUPPORTED_OPERATION", - { - operation: "bodyText", - info: { response: this }, - }, - ); - } - } - - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson(): any { - try { - return JSON.parse(this.bodyText); - } catch (error) { - assert( - false, - "response body is not valid JSON", - "UNSUPPORTED_OPERATION", - { - operation: "bodyJson", - info: { response: this }, - }, - ); - } - } - - [Symbol.iterator](): Iterator<[key: string, value: string]> { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - - constructor( - statusCode: number, - statusMessage: string, - headers: Readonly>, - body: null | Uint8Array, - request?: FetchRequest, - ) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce( - (accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, - >{}, - ); - this.#body = body == null ? null : new Uint8Array(body); - this.#request = request || null; - - this.#error = { message: "" }; - } - - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message?: string, error?: Error): FetchResponse { - let statusMessage: string; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse( - 599, - statusMessage, - this.headers, - this.body, - this.#request || undefined, - ); - response.#error = { message, error }; - return response; - } - - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message?: string, stall?: number): never { - if (stall == null) { - stall = -1; - } else { - assertArgument( - Number.isInteger(stall) && stall >= 0, - "invalid stall timeout", - "stall", - stall, - ); - } - - const error = new Error(message || "throttling requests"); - - defineProperties(error, { stall, throttle: true }); - - throw error; - } - - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key: string): string { - return this.headers[key.toLowerCase()]; - } - - /** - * Returns true of the response has a body. - */ - hasBody(): this is FetchResponse & { body: Uint8Array } { - return this.#body != null; - } - - /** - * The request made for this response. - */ - get request(): null | FetchRequest { - return this.#request; - } - - /** - * Returns true if this response was a success statusCode. - */ - ok(): boolean { - return ( - this.#error.message === "" && - this.statusCode >= 200 && - this.statusCode < 300 - ); - } - - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk(): void { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - assert(false, message, "SERVER_ERROR", { - request: this.request || "unknown request", - response: this, - error, - }); - } + #statusCode: number; + #statusMessage: string; + #headers: Record; + #body: null | Readonly; + #request: null | FetchRequest; + + #error: { error?: Error; message: string }; + + toString(): string { + return ``; + } + + /** + * The response status code. + */ + get statusCode(): number { + return this.#statusCode; + } + + /** + * The response status message. + */ + get statusMessage(): string { + return this.#statusMessage; + } + + /** + * The response headers. All keys are lower-case. + */ + get headers(): Record { + return Object.assign({}, this.#headers); + } + + /** + * The response body, or ``null`` if there was no body. + */ + get body(): null | Readonly { + return this.#body == null ? null : new Uint8Array(this.#body); + } + + /** + * The response body as a UTF-8 encoded string, or the empty + * string (i.e. ``""``) if there was no body. + * + * An error is thrown if the body is invalid UTF-8 data. + */ + get bodyText(): string { + try { + return this.#body == null ? "" : toUtf8String(this.#body); + } catch (error) { + assert( + false, + "response body is not valid UTF-8 data", + "UNSUPPORTED_OPERATION", + { + operation: "bodyText", + info: { response: this }, + }, + ); + } + } + + /** + * The response body, decoded as JSON. + * + * An error is thrown if the body is invalid JSON-encoded data + * or if there was no body. + */ + get bodyJson(): any { + try { + return JSON.parse(this.bodyText); + } catch (error) { + assert( + false, + "response body is not valid JSON", + "UNSUPPORTED_OPERATION", + { + operation: "bodyJson", + info: { response: this }, + }, + ); + } + } + + [Symbol.iterator](): Iterator<[key: string, value: string]> { + const headers = this.headers; + const keys = Object.keys(headers); + let index = 0; + return { + next: () => { + if (index < keys.length) { + const key = keys[index++]; + return { + value: [key, headers[key]], + done: false, + }; + } + return { value: undefined, done: true }; + }, + }; + } + + constructor( + statusCode: number, + statusMessage: string, + headers: Readonly>, + body: null | Uint8Array, + request?: FetchRequest, + ) { + this.#statusCode = statusCode; + this.#statusMessage = statusMessage; + this.#headers = Object.keys(headers).reduce( + (accum, k) => { + accum[k.toLowerCase()] = String(headers[k]); + return accum; + }, + >{}, + ); + this.#body = body == null ? null : new Uint8Array(body); + this.#request = request || null; + + this.#error = { message: "" }; + } + + /** + * Return a Response with matching headers and body, but with + * an error status code (i.e. 599) and %%message%% with an + * optional %%error%%. + */ + makeServerError(message?: string, error?: Error): FetchResponse { + let statusMessage: string; + if (!message) { + message = `${this.statusCode} ${this.statusMessage}`; + statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; + } else { + statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; + } + const response = new FetchResponse( + 599, + statusMessage, + this.headers, + this.body, + this.#request || undefined, + ); + response.#error = { message, error }; + return response; + } + + /** + * If called within a [request.processFunc](FetchRequest-processFunc) + * call, causes the request to retry as if throttled for %%stall%% + * milliseconds. + */ + throwThrottleError(message?: string, stall?: number): never { + if (stall == null) { + stall = -1; + } else { + assertArgument( + Number.isInteger(stall) && stall >= 0, + "invalid stall timeout", + "stall", + stall, + ); + } + + const error = new Error(message || "throttling requests"); + + defineProperties(error, { stall, throttle: true }); + + throw error; + } + + /** + * Get the header value for %%key%%, ignoring case. + */ + getHeader(key: string): string { + return this.headers[key.toLowerCase()]; + } + + /** + * Returns true of the response has a body. + */ + hasBody(): this is FetchResponse & { body: Uint8Array } { + return this.#body != null; + } + + /** + * The request made for this response. + */ + get request(): null | FetchRequest { + return this.#request; + } + + /** + * Returns true if this response was a success statusCode. + */ + ok(): boolean { + return ( + this.#error.message === "" && + this.statusCode >= 200 && + this.statusCode < 300 + ); + } + + /** + * Throws a ``SERVER_ERROR`` if this response is not ok. + */ + assertOk(): void { + if (this.ok()) { + return; + } + let { message, error } = this.#error; + if (message === "") { + message = `server response ${this.statusCode} ${this.statusMessage}`; + } + assert(false, message, "SERVER_ERROR", { + request: this.request || "unknown request", + response: this, + error, + }); + } } function getTime(): number { - return new Date().getTime(); + return new Date().getTime(); } function unpercent(value: string): Uint8Array { - return toUtf8Bytes( - value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - }), - ); + return toUtf8Bytes( + value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { + return String.fromCharCode(parseInt(code, 16)); + }), + ); } function wait(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); + return new Promise((resolve) => setTimeout(resolve, delay)); } diff --git a/src.ts/utils/fixednumber.ts b/src.ts/utils/fixednumber.ts index dc9ad98b9..9260077a2 100644 --- a/src.ts/utils/fixednumber.ts +++ b/src.ts/utils/fixednumber.ts @@ -20,16 +20,16 @@ const _guard = {}; // Constant to pull zeros from for multipliers let Zeros = "0000"; while (Zeros.length < 80) { - Zeros += Zeros; + Zeros += Zeros; } // Returns a string "1" followed by decimal "0"s function getTens(decimals: number): bigint { - let result = Zeros; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); + let result = Zeros; + while (result.length < decimals) { + result += result; + } + return BigInt("1" + result.substring(0, decimals)); } /* @@ -73,158 +73,158 @@ function getTens(decimals: number): bigint { * The bit-width must be byte aligned and the decimals can be at most 80. */ export type FixedFormat = - | number - | string - | { - signed?: boolean; - width?: number; - decimals?: number; - }; + | number + | string + | { + signed?: boolean; + width?: number; + decimals?: number; + }; function checkValue( - val: bigint, - format: _FixedFormat, - safeOp?: string, + val: bigint, + format: _FixedFormat, + safeOp?: string, ): bigint { - const width = BigInt(format.width); - if (format.signed) { - const limit = BN_1 << (width - BN_1); - assert( - safeOp == null || (val >= -limit && val < limit), - "overflow", - "NUMERIC_FAULT", - { - operation: safeOp, - fault: "overflow", - value: val, - }, - ); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - } else { - const limit = BN_1 << width; - assert( - safeOp == null || (val >= 0 && val < limit), - "overflow", - "NUMERIC_FAULT", - { - operation: safeOp, - fault: "overflow", - value: val, - }, - ); - val = ((val % limit) + limit) % limit & (limit - BN_1); - } - - return val; + const width = BigInt(format.width); + if (format.signed) { + const limit = BN_1 << (width - BN_1); + assert( + safeOp == null || (val >= -limit && val < limit), + "overflow", + "NUMERIC_FAULT", + { + operation: safeOp, + fault: "overflow", + value: val, + }, + ); + + if (val > BN_0) { + val = fromTwos(mask(val, width), width); + } else { + val = -fromTwos(mask(-val, width), width); + } + } else { + const limit = BN_1 << width; + assert( + safeOp == null || (val >= 0 && val < limit), + "overflow", + "NUMERIC_FAULT", + { + operation: safeOp, + fault: "overflow", + value: val, + }, + ); + val = (((val % limit) + limit) % limit) & (limit - BN_1); + } + + return val; } type _FixedFormat = { - signed: boolean; - width: number; - decimals: number; - name: string; + signed: boolean; + width: number; + decimals: number; + name: string; }; function getFormat(value?: FixedFormat): _FixedFormat { - if (typeof value === "number") { - value = `fixed128x${value}`; - } - - let signed = true; - let width = 128; - let decimals = 18; - - if (typeof value === "string") { - // Parse the format string - if (value === "fixed") { - // defaults... - } else if (value === "ufixed") { - signed = false; - } else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - assertArgument(match, "invalid fixed format", "format", value); - signed = match[1] !== "u"; - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } else if (value) { - // Extract the values from the object - const v: any = value; - const check = (key: string, type: string, defaultValue: any): any => { - if (v[key] == null) { - return defaultValue; - } - assertArgument( - typeof v[key] === type, - "invalid fixed format (" + key + " not " + type + ")", - "format." + key, - v[key], - ); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - - assertArgument( - width % 8 === 0, - "invalid FixedNumber width (not byte aligned)", - "format.width", - width, - ); - assertArgument( - decimals <= 80, - "invalid FixedNumber decimals (too large)", - "format.decimals", - decimals, - ); - - const name = - (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - - return { signed, width, decimals, name }; + if (typeof value === "number") { + value = `fixed128x${value}`; + } + + let signed = true; + let width = 128; + let decimals = 18; + + if (typeof value === "string") { + // Parse the format string + if (value === "fixed") { + // defaults... + } else if (value === "ufixed") { + signed = false; + } else { + const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); + assertArgument(match, "invalid fixed format", "format", value); + signed = match[1] !== "u"; + width = parseInt(match[2]); + decimals = parseInt(match[3]); + } + } else if (value) { + // Extract the values from the object + const v: any = value; + const check = (key: string, type: string, defaultValue: any): any => { + if (v[key] == null) { + return defaultValue; + } + assertArgument( + typeof v[key] === type, + "invalid fixed format (" + key + " not " + type + ")", + "format." + key, + v[key], + ); + return v[key]; + }; + signed = check("signed", "boolean", signed); + width = check("width", "number", width); + decimals = check("decimals", "number", decimals); + } + + assertArgument( + width % 8 === 0, + "invalid FixedNumber width (not byte aligned)", + "format.width", + width, + ); + assertArgument( + decimals <= 80, + "invalid FixedNumber decimals (too large)", + "format.decimals", + decimals, + ); + + const name = + (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); + + return { signed, width, decimals, name }; } function toString(val: bigint, decimals: number) { - let negative = ""; - if (val < BN_0) { - negative = "-"; - val *= BN_N1; - } - - let str = val.toString(); - - // No decimal point for whole values - if (decimals === 0) { - return negative + str; - } - - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros + str; - } - - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - - return negative + str; + let negative = ""; + if (val < BN_0) { + negative = "-"; + val *= BN_N1; + } + + let str = val.toString(); + + // No decimal point for whole values + if (decimals === 0) { + return negative + str; + } + + // Pad out to the whole component (including a whole digit) + while (str.length <= decimals) { + str = Zeros + str; + } + + // Insert the decimal point + const index = str.length - decimals; + str = str.substring(0, index) + "." + str.substring(index); + + // Trim the whole component (leaving at least one 0) + while (str[0] === "0" && str[1] !== ".") { + str = str.substring(1); + } + + // Trim the decimal component (leaving at least one 0) + while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { + str = str.substring(0, str.length - 1); + } + + return negative + str; } /** @@ -263,88 +263,88 @@ function toString(val: bigint, decimals: number) { * will thow a [[NumericFaultError]] on underflow. */ export class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - readonly format!: string; - - readonly #format: _FixedFormat; - - // The actual value (accounting for decimals) - #val: bigint; - - // A base-10 value to multiple values by to maintain the magnitude - readonly #tens: bigint; - - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - readonly _value!: string; - - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - - /** - * @private - */ - constructor(guard: any, value: bigint, format: any) { - assertPrivate(guard, _guard, "FixedNumber"); - - this.#val = value; - - this.#format = format; - - const _value = toString(value, format.decimals); - - defineProperties(this, { format: format.name, _value }); - - this.#tens = getTens(format.decimals); - } - - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed(): boolean { - return this.#format.signed; - } - - /** - * The number of bits available to store the value. - */ - get width(): number { - return this.#format.width; - } - - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals(): number { - return this.#format.decimals; - } - - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value(): bigint { - return this.#val; - } - - #checkFormat(other: FixedNumber): void { - assertArgument( - this.format === other.format, - "incompatible format; use fixedNumber.toFormat", - "other", - other, - ); - } - - #checkValue(val: bigint, safeOp?: string): FixedNumber { - /* + /** + * The specific fixed-point arithmetic field for this value. + */ + readonly format!: string; + + readonly #format: _FixedFormat; + + // The actual value (accounting for decimals) + #val: bigint; + + // A base-10 value to multiple values by to maintain the magnitude + readonly #tens: bigint; + + /** + * This is a property so console.log shows a human-meaningful value. + * + * @private + */ + readonly _value!: string; + + // Use this when changing this file to get some typing info, + // but then switch to any to mask the internal type + //constructor(guard: any, value: bigint, format: _FixedFormat) { + + /** + * @private + */ + constructor(guard: any, value: bigint, format: any) { + assertPrivate(guard, _guard, "FixedNumber"); + + this.#val = value; + + this.#format = format; + + const _value = toString(value, format.decimals); + + defineProperties(this, { format: format.name, _value }); + + this.#tens = getTens(format.decimals); + } + + /** + * If true, negative values are permitted, otherwise only + * positive values and zero are allowed. + */ + get signed(): boolean { + return this.#format.signed; + } + + /** + * The number of bits available to store the value. + */ + get width(): number { + return this.#format.width; + } + + /** + * The number of decimal places in the fixed-point arithment field. + */ + get decimals(): number { + return this.#format.decimals; + } + + /** + * The value as an integer, based on the smallest unit the + * [[decimals]] allow. + */ + get value(): bigint { + return this.#val; + } + + #checkFormat(other: FixedNumber): void { + assertArgument( + this.format === other.format, + "incompatible format; use fixedNumber.toFormat", + "other", + other, + ); + } + + #checkValue(val: bigint, safeOp?: string): FixedNumber { + /* const width = BigInt(this.width); if (this.signed) { const limit = (BN_1 << (width - BN_1)); @@ -366,421 +366,421 @@ export class FixedNumber { val = masked; } */ - val = checkValue(val, this.#format, safeOp); - return new FixedNumber(_guard, val, this.#format); - } - - #add(o: FixedNumber, safeOp?: string): FixedNumber { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other: FixedNumber): FixedNumber { - return this.#add(other); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other: FixedNumber): FixedNumber { - return this.#add(other, "add"); - } - - #sub(o: FixedNumber, safeOp?: string): FixedNumber { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other: FixedNumber): FixedNumber { - return this.#sub(other); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other: FixedNumber): FixedNumber { - return this.#sub(other, "sub"); - } - - #mul(o: FixedNumber, safeOp?: string): FixedNumber { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other: FixedNumber): FixedNumber { - return this.#mul(other); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other: FixedNumber): FixedNumber { - return this.#mul(other, "mul"); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other: FixedNumber): FixedNumber { - this.#checkFormat(other); - const value = this.#val * other.#val; - assert( - value % this.#tens === BN_0, - "precision lost during signalling mul", - "NUMERIC_FAULT", - { - operation: "mulSignal", - fault: "underflow", - value: this, - }, - ); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - - #div(o: FixedNumber, safeOp?: string): FixedNumber { - assert(o.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other: FixedNumber): FixedNumber { - return this.#div(other); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other: FixedNumber): FixedNumber { - return this.#div(other, "div"); - } - - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other: FixedNumber): FixedNumber { - assert(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(other); - const value = this.#val * this.#tens; - assert( - value % other.#val === BN_0, - "precision lost during signalling div", - "NUMERIC_FAULT", - { - operation: "divSignal", - fault: "underflow", - value: this, - }, - ); - return this.#checkValue(value / other.#val, "divSignal"); - } - - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%other%% is larger and ``0`` implies - * both are equal. - */ - cmp(other: FixedNumber): number { - let a = this.value, - b = other.value; - - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } else if (delta < 0) { - a *= getTens(-delta); - } - - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return -1; - } - return 0; - } - - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other: FixedNumber): boolean { - return this.cmp(other) === 0; - } - - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other: FixedNumber): boolean { - return this.cmp(other) < 0; - } - - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other: FixedNumber): boolean { - return this.cmp(other) <= 0; - } - - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other: FixedNumber): boolean { - return this.cmp(other) > 0; - } - - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other: FixedNumber): boolean { - return this.cmp(other) >= 0; - } - - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor(): FixedNumber { - let val = this.#val; - if (this.#val < BN_0) { - val -= this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling(): FixedNumber { - let val = this.#val; - if (this.#val > BN_0) { - val += this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals?: number): FixedNumber { - if (decimals == null) { - decimals = 0; - } - - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - - checkValue(value, this.#format, "round"); - - return new FixedNumber(_guard, value, this.#format); - } - - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero(): boolean { - return this.#val === BN_0; - } - - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative(): boolean { - return this.#val < BN_0; - } - - /** - * Returns the string representation of %%this%%. - */ - toString(): string { - return this._value; - } - - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat(): number { - return parseFloat(this.toString()); - } - - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format: FixedFormat): FixedNumber { - return FixedNumber.fromString(this.toString(), format); - } - - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue( - _value: BigNumberish, - decimals?: number, - _format?: FixedFormat, - ): FixedNumber { - if (decimals == null) { - decimals = 0; - } - const format = getFormat(_format); - - let value = getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - assert( - value % tens === BN_0, - "value loses precision for format", - "NUMERIC_FAULT", - { - operation: "fromValue", - fault: "underflow", - value: _value, - }, - ); - value /= tens; - } else if (delta < 0) { - value *= getTens(-delta); - } - - checkValue(value, format, "fromValue"); - - return new FixedNumber(_guard, value, format); - } - - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value: string, _format?: FixedFormat): FixedNumber { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - assertArgument( - match && match[2].length + match[3].length > 0, - "invalid FixedNumber string value", - "value", - _value, - ); - - const format = getFormat(_format); - - let whole = match[2] || "0", - decimal = match[3] || ""; - - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros; - } - - // Check precision is safe - assert( - decimal.substring(format.decimals).match(/^0*$/), - "too many decimals for format", - "NUMERIC_FAULT", - { - operation: "fromString", - fault: "underflow", - value: _value, - }, - ); - - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - - const value = BigInt(match[1] + whole + decimal); - - checkValue(value, format, "fromString"); - - return new FixedNumber(_guard, value, format); - } - - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value: BytesLike, _format?: FixedFormat): FixedNumber { - let value = toBigInt(getBytes(_value, "value")); - const format = getFormat(_format); - - if (format.signed) { - value = fromTwos(value, format.width); - } - - checkValue(value, format, "fromBytes"); - - return new FixedNumber(_guard, value, format); - } + val = checkValue(val, this.#format, safeOp); + return new FixedNumber(_guard, val, this.#format); + } + + #add(o: FixedNumber, safeOp?: string): FixedNumber { + this.#checkFormat(o); + return this.#checkValue(this.#val + o.#val, safeOp); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%this%% added + * to %%other%%, ignoring overflow. + */ + addUnsafe(other: FixedNumber): FixedNumber { + return this.#add(other); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%this%% added + * to %%other%%. A [[NumericFaultError]] is thrown if overflow + * occurs. + */ + add(other: FixedNumber): FixedNumber { + return this.#add(other, "add"); + } + + #sub(o: FixedNumber, safeOp?: string): FixedNumber { + this.#checkFormat(o); + return this.#checkValue(this.#val - o.#val, safeOp); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%other%% subtracted + * from %%this%%, ignoring overflow. + */ + subUnsafe(other: FixedNumber): FixedNumber { + return this.#sub(other); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%other%% subtracted + * from %%this%%. A [[NumericFaultError]] is thrown if overflow + * occurs. + */ + sub(other: FixedNumber): FixedNumber { + return this.#sub(other, "sub"); + } + + #mul(o: FixedNumber, safeOp?: string): FixedNumber { + this.#checkFormat(o); + return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%this%% multiplied + * by %%other%%, ignoring overflow and underflow (precision loss). + */ + mulUnsafe(other: FixedNumber): FixedNumber { + return this.#mul(other); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%this%% multiplied + * by %%other%%. A [[NumericFaultError]] is thrown if overflow + * occurs. + */ + mul(other: FixedNumber): FixedNumber { + return this.#mul(other, "mul"); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%this%% multiplied + * by %%other%%. A [[NumericFaultError]] is thrown if overflow + * occurs or if underflow (precision loss) occurs. + */ + mulSignal(other: FixedNumber): FixedNumber { + this.#checkFormat(other); + const value = this.#val * other.#val; + assert( + value % this.#tens === BN_0, + "precision lost during signalling mul", + "NUMERIC_FAULT", + { + operation: "mulSignal", + fault: "underflow", + value: this, + }, + ); + return this.#checkValue(value / this.#tens, "mulSignal"); + } + + #div(o: FixedNumber, safeOp?: string): FixedNumber { + assert(o.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { + operation: "div", + fault: "divide-by-zero", + value: this, + }); + this.#checkFormat(o); + return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%this%% divided + * by %%other%%, ignoring underflow (precision loss). A + * [[NumericFaultError]] is thrown if overflow occurs. + */ + divUnsafe(other: FixedNumber): FixedNumber { + return this.#div(other); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%this%% divided + * by %%other%%, ignoring underflow (precision loss). A + * [[NumericFaultError]] is thrown if overflow occurs. + */ + div(other: FixedNumber): FixedNumber { + return this.#div(other, "div"); + } + + /** + * Returns a new [[FixedNumber]] with the result of %%this%% divided + * by %%other%%. A [[NumericFaultError]] is thrown if underflow + * (precision loss) occurs. + */ + divSignal(other: FixedNumber): FixedNumber { + assert(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { + operation: "div", + fault: "divide-by-zero", + value: this, + }); + this.#checkFormat(other); + const value = this.#val * this.#tens; + assert( + value % other.#val === BN_0, + "precision lost during signalling div", + "NUMERIC_FAULT", + { + operation: "divSignal", + fault: "underflow", + value: this, + }, + ); + return this.#checkValue(value / other.#val, "divSignal"); + } + + /** + * Returns a comparison result between %%this%% and %%other%%. + * + * This is suitable for use in sorting, where ``-1`` implies %%this%% + * is smaller, ``1`` implies %%other%% is larger and ``0`` implies + * both are equal. + */ + cmp(other: FixedNumber): number { + let a = this.value, + b = other.value; + + // Coerce a and b to the same magnitude + const delta = this.decimals - other.decimals; + if (delta > 0) { + b *= getTens(delta); + } else if (delta < 0) { + a *= getTens(-delta); + } + + // Comnpare + if (a < b) { + return -1; + } + if (a > b) { + return -1; + } + return 0; + } + + /** + * Returns true if %%other%% is equal to %%this%%. + */ + eq(other: FixedNumber): boolean { + return this.cmp(other) === 0; + } + + /** + * Returns true if %%other%% is less than to %%this%%. + */ + lt(other: FixedNumber): boolean { + return this.cmp(other) < 0; + } + + /** + * Returns true if %%other%% is less than or equal to %%this%%. + */ + lte(other: FixedNumber): boolean { + return this.cmp(other) <= 0; + } + + /** + * Returns true if %%other%% is greater than to %%this%%. + */ + gt(other: FixedNumber): boolean { + return this.cmp(other) > 0; + } + + /** + * Returns true if %%other%% is greater than or equal to %%this%%. + */ + gte(other: FixedNumber): boolean { + return this.cmp(other) >= 0; + } + + /** + * Returns a new [[FixedNumber]] which is the largest **integer** + * that is less than or equal to %%this%%. + * + * The decimal component of the result will always be ``0``. + */ + floor(): FixedNumber { + let val = this.#val; + if (this.#val < BN_0) { + val -= this.#tens - BN_1; + } + val = (this.#val / this.#tens) * this.#tens; + return this.#checkValue(val, "floor"); + } + + /** + * Returns a new [[FixedNumber]] which is the smallest **integer** + * that is greater than or equal to %%this%%. + * + * The decimal component of the result will always be ``0``. + */ + ceiling(): FixedNumber { + let val = this.#val; + if (this.#val > BN_0) { + val += this.#tens - BN_1; + } + val = (this.#val / this.#tens) * this.#tens; + return this.#checkValue(val, "ceiling"); + } + + /** + * Returns a new [[FixedNumber]] with the decimal component + * rounded up on ties at %%decimals%% places. + */ + round(decimals?: number): FixedNumber { + if (decimals == null) { + decimals = 0; + } + + // Not enough precision to not already be rounded + if (decimals >= this.decimals) { + return this; + } + + const delta = this.decimals - decimals; + const bump = BN_5 * getTens(delta - 1); + + let value = this.value + bump; + const tens = getTens(delta); + value = (value / tens) * tens; + + checkValue(value, this.#format, "round"); + + return new FixedNumber(_guard, value, this.#format); + } + + /** + * Returns true if %%this%% is equal to ``0``. + */ + isZero(): boolean { + return this.#val === BN_0; + } + + /** + * Returns true if %%this%% is less than ``0``. + */ + isNegative(): boolean { + return this.#val < BN_0; + } + + /** + * Returns the string representation of %%this%%. + */ + toString(): string { + return this._value; + } + + /** + * Returns a float approximation. + * + * Due to IEEE 754 precission (or lack thereof), this function + * can only return an approximation and most values will contain + * rounding errors. + */ + toUnsafeFloat(): number { + return parseFloat(this.toString()); + } + + /** + * Return a new [[FixedNumber]] with the same value but has had + * its field set to %%format%%. + * + * This will throw if the value cannot fit into %%format%%. + */ + toFormat(format: FixedFormat): FixedNumber { + return FixedNumber.fromString(this.toString(), format); + } + + /** + * Creates a new [[FixedNumber]] for %%value%% divided by + * %%decimal%% places with %%format%%. + * + * This will throw a [[NumericFaultError]] if %%value%% (once adjusted + * for %%decimals%%) cannot fit in %%format%%, either due to overflow + * or underflow (precision loss). + */ + static fromValue( + _value: BigNumberish, + decimals?: number, + _format?: FixedFormat, + ): FixedNumber { + if (decimals == null) { + decimals = 0; + } + const format = getFormat(_format); + + let value = getBigInt(_value, "value"); + const delta = decimals - format.decimals; + if (delta > 0) { + const tens = getTens(delta); + assert( + value % tens === BN_0, + "value loses precision for format", + "NUMERIC_FAULT", + { + operation: "fromValue", + fault: "underflow", + value: _value, + }, + ); + value /= tens; + } else if (delta < 0) { + value *= getTens(-delta); + } + + checkValue(value, format, "fromValue"); + + return new FixedNumber(_guard, value, format); + } + + /** + * Creates a new [[FixedNumber]] for %%value%% with %%format%%. + * + * This will throw a [[NumericFaultError]] if %%value%% cannot fit + * in %%format%%, either due to overflow or underflow (precision loss). + */ + static fromString(_value: string, _format?: FixedFormat): FixedNumber { + const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); + assertArgument( + match && match[2].length + match[3].length > 0, + "invalid FixedNumber string value", + "value", + _value, + ); + + const format = getFormat(_format); + + let whole = match[2] || "0", + decimal = match[3] || ""; + + // Pad out the decimals + while (decimal.length < format.decimals) { + decimal += Zeros; + } + + // Check precision is safe + assert( + decimal.substring(format.decimals).match(/^0*$/), + "too many decimals for format", + "NUMERIC_FAULT", + { + operation: "fromString", + fault: "underflow", + value: _value, + }, + ); + + // Remove extra padding + decimal = decimal.substring(0, format.decimals); + + const value = BigInt(match[1] + whole + decimal); + + checkValue(value, format, "fromString"); + + return new FixedNumber(_guard, value, format); + } + + /** + * Creates a new [[FixedNumber]] with the big-endian representation + * %%value%% with %%format%%. + * + * This will throw a [[NumericFaultError]] if %%value%% cannot fit + * in %%format%% due to overflow. + */ + static fromBytes(_value: BytesLike, _format?: FixedFormat): FixedNumber { + let value = toBigInt(getBytes(_value, "value")); + const format = getFormat(_format); + + if (format.signed) { + value = fromTwos(value, format.width); + } + + checkValue(value, format, "fromBytes"); + + return new FixedNumber(_guard, value, format); + } } //const f1 = FixedNumber.fromString("12.56", "fixed16x2"); diff --git a/src.ts/utils/geturl-browser.ts b/src.ts/utils/geturl-browser.ts index 417d19885..3bd926c53 100644 --- a/src.ts/utils/geturl-browser.ts +++ b/src.ts/utils/geturl-browser.ts @@ -1,96 +1,72 @@ import { assert } from "./errors.js"; import type { - FetchRequest, - FetchCancelSignal, - GetUrlResponse, + FetchRequest, + FetchCancelSignal, + GetUrlResponse, } from "./fetch.js"; -declare global { - // @ts-ignore - class Headers { - constructor(values: Array<[string, string]>); - forEach(func: (v: string, k: string) => void): void; - } - - // @ts-ignore - class Response { - status: number; - statusText: string; - headers: Headers; - arrayBuffer(): Promise; - } - - type FetchInit = { - method?: string; - headers?: Headers; - body?: Uint8Array; - }; - - function fetch(url: string, init: FetchInit): Promise; -} - // @TODO: timeout is completely ignored; start a Promise.any with a reject? // @ts-ignore export async function getUrl( - req: FetchRequest, - _signal?: FetchCancelSignal, + req: FetchRequest, + _signal?: FetchCancelSignal, ): Promise { - const protocol = req.url.split(":")[0].toLowerCase(); + const protocol = req.url.split(":")[0].toLowerCase(); - assert( - protocol === "http" || protocol === "https", - `unsupported protocol ${protocol}`, - "UNSUPPORTED_OPERATION", - { - info: { protocol }, - operation: "request", - }, - ); + assert( + protocol === "http" || protocol === "https", + `unsupported protocol ${protocol}`, + "UNSUPPORTED_OPERATION", + { + info: { protocol }, + operation: "request", + }, + ); - assert( - protocol === "https" || !req.credentials || req.allowInsecureAuthentication, - "insecure authorized connections unsupported", - "UNSUPPORTED_OPERATION", - { - operation: "request", - }, - ); + assert( + protocol === "https" || !req.credentials || req.allowInsecureAuthentication, + "insecure authorized connections unsupported", + "UNSUPPORTED_OPERATION", + { + operation: "request", + }, + ); - let signal: undefined | AbortSignal = undefined; - if (_signal) { - const controller = new AbortController(); - signal = controller.signal; - _signal.addListener(() => { - controller.abort(); - }); - } + let signal: undefined | AbortSignal = undefined; + if (_signal) { + const controller = new AbortController(); + signal = controller.signal; + _signal.addListener(() => { + controller.abort(); + }); + } - const init = { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal, - }; - try { - const resp = await fetch(req.url, init); + const init = { + method: req.method, + headers: new Headers(Array.from(req)), + body: req.body || undefined, + signal, + }; + try { + const resp = await fetch(req.url, init); - const headers: Record = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); + const headers: Record = {}; + resp.headers.forEach((value, key) => { + headers[key.toLowerCase()] = value; + }); - const respBody = await resp.arrayBuffer(); - const body = respBody == null ? null : new Uint8Array(respBody); + const respBody = await resp.arrayBuffer(); + const body = respBody == null ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, - body, - }; - } catch (error: any) { - console.log({ error }); - return undefined; - } + return { + statusCode: resp.status, + statusMessage: resp.statusText, + headers, + body, + }; + } catch (error: any) { + console.log({ error }); + return undefined; + } } diff --git a/src.ts/utils/geturl.ts b/src.ts/utils/geturl.ts index 68f597f83..147bc825c 100644 --- a/src.ts/utils/geturl.ts +++ b/src.ts/utils/geturl.ts @@ -6,116 +6,116 @@ import { assert } from "./errors.js"; import { getBytes } from "./data.js"; import type { - FetchRequest, - FetchCancelSignal, - GetUrlResponse, + FetchRequest, + FetchCancelSignal, + GetUrlResponse, } from "./fetch.js"; /** * @_ignore: */ export async function getUrl( - req: FetchRequest, - signal?: FetchCancelSignal, + req: FetchRequest, + signal?: FetchCancelSignal, ): Promise { - const protocol = req.url.split(":")[0].toLowerCase(); - - assert( - protocol === "http" || protocol === "https", - `unsupported protocol ${protocol}`, - "UNSUPPORTED_OPERATION", - { - info: { protocol }, - operation: "request", - }, - ); - - assert( - protocol === "https" || !req.credentials || req.allowInsecureAuthentication, - "insecure authorized connections unsupported", - "UNSUPPORTED_OPERATION", - { - operation: "request", - }, - ); - - const method = req.method; - const headers = Object.assign({}, req.headers); - - const options: any = { method, headers }; - - const request = (protocol === "http" ? http : https).request( - req.url, - options, - ); - - request.setTimeout(req.timeout); - - const body = req.body; - if (body) { - request.write(Buffer.from(body)); - } - - request.end(); - - return new Promise((resolve, reject) => { - // @TODO: Node 15 added AbortSignal; once we drop support for - // Node14, we can add that in here too - - request.once("response", (resp: http.IncomingMessage) => { - const statusCode = resp.statusCode || 0; - const statusMessage = resp.statusMessage || ""; - const headers = Object.keys(resp.headers || {}).reduce( - (accum, name) => { - let value = resp.headers[name] || ""; - if (Array.isArray(value)) { - value = value.join(", "); - } - accum[name] = value; - return accum; - }, - <{ [name: string]: string }>{}, - ); - - let body: null | Uint8Array = null; - //resp.setEncoding("utf8"); - - resp.on("data", (chunk: Uint8Array) => { - if (signal) { - try { - signal.checkSignal(); - } catch (error) { - return reject(error); - } - } - - if (body == null) { - body = chunk; - } else { - const newBody = new Uint8Array(body.length + chunk.length); - newBody.set(body, 0); - newBody.set(chunk, body.length); - body = newBody; - } - }); - - resp.on("end", () => { - if (headers["content-encoding"] === "gzip" && body) { - body = getBytes(gunzipSync(body)); - } - - resolve({ statusCode, statusMessage, headers, body }); - }); - - resp.on("error", (error) => { - //@TODO: Should this just return nornal response with a server error? - (error).response = { statusCode, statusMessage, headers, body }; - reject(error); - }); - }); - - request.on("error", (error) => { - reject(error); - }); - }); + const protocol = req.url.split(":")[0].toLowerCase(); + + assert( + protocol === "http" || protocol === "https", + `unsupported protocol ${protocol}`, + "UNSUPPORTED_OPERATION", + { + info: { protocol }, + operation: "request", + }, + ); + + assert( + protocol === "https" || !req.credentials || req.allowInsecureAuthentication, + "insecure authorized connections unsupported", + "UNSUPPORTED_OPERATION", + { + operation: "request", + }, + ); + + const method = req.method; + const headers = Object.assign({}, req.headers); + + const options: any = { method, headers }; + + const request = (protocol === "http" ? http : https).request( + req.url, + options, + ); + + request.setTimeout(req.timeout); + + const body = req.body; + if (body) { + request.write(Buffer.from(body)); + } + + request.end(); + + return new Promise((resolve, reject) => { + // @TODO: Node 15 added AbortSignal; once we drop support for + // Node14, we can add that in here too + + request.once("response", (resp: http.IncomingMessage) => { + const statusCode = resp.statusCode || 0; + const statusMessage = resp.statusMessage || ""; + const headers = Object.keys(resp.headers || {}).reduce( + (accum, name) => { + let value = resp.headers[name] || ""; + if (Array.isArray(value)) { + value = value.join(", "); + } + accum[name] = value; + return accum; + }, + <{ [name: string]: string }>{}, + ); + + let body: null | Uint8Array = null; + //resp.setEncoding("utf8"); + + resp.on("data", (chunk: Uint8Array) => { + if (signal) { + try { + signal.checkSignal(); + } catch (error) { + return reject(error); + } + } + + if (body == null) { + body = chunk; + } else { + const newBody = new Uint8Array(body.length + chunk.length); + newBody.set(body, 0); + newBody.set(chunk, body.length); + body = newBody; + } + }); + + resp.on("end", () => { + if (headers["content-encoding"] === "gzip" && body) { + body = getBytes(gunzipSync(body)); + } + + resolve({ statusCode, statusMessage, headers, body }); + }); + + resp.on("error", (error) => { + //@TODO: Should this just return nornal response with a server error? + (error).response = { statusCode, statusMessage, headers, body }; + reject(error); + }); + }); + + request.on("error", (error) => { + reject(error); + }); + }); } diff --git a/src.ts/utils/index.ts b/src.ts/utils/index.ts index 0abdb0671..6b264844a 100644 --- a/src.ts/utils/index.ts +++ b/src.ts/utils/index.ts @@ -11,30 +11,30 @@ export { decodeBase58, encodeBase58 } from "./base58.js"; export { decodeBase64, encodeBase64 } from "./base64.js"; export { - getBytes, - getBytesCopy, - isHexString, - isBytesLike, - hexlify, - concat, - dataLength, - dataSlice, - stripZerosLeft, - zeroPadValue, - zeroPadBytes, - arrayify, - hexConcat, + getBytes, + getBytesCopy, + isHexString, + isBytesLike, + hexlify, + concat, + dataLength, + dataSlice, + stripZerosLeft, + zeroPadValue, + zeroPadBytes, + arrayify, + hexConcat, } from "./data.js"; export { - isCallException, - isError, - assert, - assertArgument, - assertArgumentCount, - assertPrivate, - assertNormalize, - makeError, + isCallException, + isError, + assert, + assertArgument, + assertArgumentCount, + assertPrivate, + assertNormalize, + makeError, } from "./errors.js"; export { EventPayload } from "./events.js"; @@ -44,17 +44,17 @@ export { FetchRequest, FetchResponse, FetchCancelSignal } from "./fetch.js"; export { FixedNumber } from "./fixednumber.js"; export { - fromTwos, - toTwos, - mask, - getBigInt, - getNumber, - getUint, - toBigInt, - toNumber, - toBeHex, - toBeArray, - toQuantity, + fromTwos, + toTwos, + mask, + getBigInt, + getNumber, + getUint, + toBigInt, + toNumber, + toBeHex, + toBeArray, + toQuantity, } from "./maths.js"; export { resolveProperties, defineProperties } from "./properties.js"; @@ -65,10 +65,10 @@ export { encodeRlp } from "./rlp-encode.js"; export { formatXCB, parseXCB, formatUnits, parseUnits } from "./units.js"; export { - toUtf8Bytes, - toUtf8CodePoints, - toUtf8String, - Utf8ErrorFuncs, + toUtf8Bytes, + toUtf8CodePoints, + toUtf8String, + Utf8ErrorFuncs, } from "./utf8.js"; export { uuidV4 } from "./uuid.js"; @@ -79,46 +79,46 @@ export { uuidV4 } from "./uuid.js"; export type { BytesLike } from "./data.js"; export type { - //ErrorFetchRequestWithBody, ErrorFetchRequest, - //ErrorFetchResponseWithBody, ErrorFetchResponse, - - ErrorCode, - CoreBCError, - UnknownError, - NotImplementedError, - UnsupportedOperationError, - NetworkError, - ServerError, - TimeoutError, - BadDataError, - CancelledError, - BufferOverrunError, - NumericFaultError, - InvalidArgumentError, - MissingArgumentError, - UnexpectedArgumentError, - CallExceptionError, - InsufficientFundsError, - NonceExpiredError, - OffchainFaultError, - ReplacementUnderpricedError, - TransactionReplacedError, - UnconfiguredNameError, - ActionRejectedError, - CallExceptionAction, - CallExceptionTransaction, - CodedCoreBCError, + //ErrorFetchRequestWithBody, ErrorFetchRequest, + //ErrorFetchResponseWithBody, ErrorFetchResponse, + + ErrorCode, + CoreBCError, + UnknownError, + NotImplementedError, + UnsupportedOperationError, + NetworkError, + ServerError, + TimeoutError, + BadDataError, + CancelledError, + BufferOverrunError, + NumericFaultError, + InvalidArgumentError, + MissingArgumentError, + UnexpectedArgumentError, + CallExceptionError, + InsufficientFundsError, + NonceExpiredError, + OffchainFaultError, + ReplacementUnderpricedError, + TransactionReplacedError, + UnconfiguredNameError, + ActionRejectedError, + CallExceptionAction, + CallExceptionTransaction, + CodedCoreBCError, } from "./errors.js"; export type { EventEmitterable, Listener } from "./events.js"; export type { - GetUrlResponse, - FetchPreflightFunc, - FetchProcessFunc, - FetchRetryFunc, - FetchGatewayFunc, - FetchGetUrlFunc, + GetUrlResponse, + FetchPreflightFunc, + FetchProcessFunc, + FetchRetryFunc, + FetchGatewayFunc, + FetchGetUrlFunc, } from "./fetch.js"; export type { FixedFormat } from "./fixednumber.js"; @@ -128,7 +128,7 @@ export type { BigNumberish, Numeric } from "./maths.js"; export type { RlpStructuredData } from "./rlp.js"; export type { - Utf8ErrorFunc, - UnicodeNormalizationForm, - Utf8ErrorReason, + Utf8ErrorFunc, + UnicodeNormalizationForm, + Utf8ErrorReason, } from "./utf8.js"; diff --git a/src.ts/utils/maths.ts b/src.ts/utils/maths.ts index 4e9f8420a..12fa94e02 100644 --- a/src.ts/utils/maths.ts +++ b/src.ts/utils/maths.ts @@ -33,22 +33,22 @@ const maxValue = 0x1fffffffffffff; * If the highest bit is ``1``, the result will be negative. */ export function fromTwos(_value: BigNumberish, _width: Numeric): bigint { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - - assert(value >> width === BN_0, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", - fault: "overflow", - value: _value, - }); - - // Top bit set; treat as a negative value - if (value >> (width - BN_1)) { - const mask = (BN_1 << width) - BN_1; - return -((~value & mask) + BN_1); - } - - return value; + const value = getUint(_value, "value"); + const width = BigInt(getNumber(_width, "width")); + + assert(value >> width === BN_0, "overflow", "NUMERIC_FAULT", { + operation: "fromTwos", + fault: "overflow", + value: _value, + }); + + // Top bit set; treat as a negative value + if (value >> (width - BN_1)) { + const mask = (BN_1 << width) - BN_1; + return -((~value & mask) + BN_1); + } + + return value; } /** @@ -58,38 +58,38 @@ export function fromTwos(_value: BigNumberish, _width: Numeric): bigint { * The result will always be positive. */ export function toTwos(_value: BigNumberish, _width: Numeric): bigint { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - - const limit = BN_1 << (width - BN_1); - - if (value < BN_0) { - value = -value; - assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - const mask = (BN_1 << width) - BN_1; - return (~value & mask) + BN_1; - } else { - assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - } - - return value; + let value = getBigInt(_value, "value"); + const width = BigInt(getNumber(_width, "width")); + + const limit = BN_1 << (width - BN_1); + + if (value < BN_0) { + value = -value; + assert(value <= limit, "too low", "NUMERIC_FAULT", { + operation: "toTwos", + fault: "overflow", + value: _value, + }); + const mask = (BN_1 << width) - BN_1; + return (~value & mask) + BN_1; + } else { + assert(value < limit, "too high", "NUMERIC_FAULT", { + operation: "toTwos", + fault: "overflow", + value: _value, + }); + } + + return value; } /** * Mask %%value%% with a bitmask of %%bits%% ones. */ export function mask(_value: BigNumberish, _bits: Numeric): bigint { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1 << bits) - BN_1); + const value = getUint(_value, "value"); + const bits = BigInt(getNumber(_bits, "bits")); + return value & ((BN_1 << bits) - BN_1); } /** @@ -97,52 +97,52 @@ export function mask(_value: BigNumberish, _bits: Numeric): bigint { * a BigInt, then an ArgumentError will be thrown for %%name%%. */ export function getBigInt(value: BigNumberish, name?: string): bigint { - switch (typeof value) { - case "bigint": - return value; - case "number": - assertArgument( - Number.isInteger(value), - "underflow", - name || "value", - value, - ); - assertArgument( - value >= -maxValue && value <= maxValue, - "overflow", - name || "value", - value, - ); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } catch (e: any) { - assertArgument( - false, - `invalid BigNumberish string: ${e.message}`, - name || "value", - value, - ); - } - } - assertArgument(false, "invalid BigNumberish value", name || "value", value); + switch (typeof value) { + case "bigint": + return value; + case "number": + assertArgument( + Number.isInteger(value), + "underflow", + name || "value", + value, + ); + assertArgument( + value >= -maxValue && value <= maxValue, + "overflow", + name || "value", + value, + ); + return BigInt(value); + case "string": + try { + if (value === "") { + throw new Error("empty string"); + } + if (value[0] === "-" && value[1] !== "-") { + return -BigInt(value.substring(1)); + } + return BigInt(value); + } catch (e: any) { + assertArgument( + false, + `invalid BigNumberish string: ${e.message}`, + name || "value", + value, + ); + } + } + assertArgument(false, "invalid BigNumberish value", name || "value", value); } export function getUint(value: BigNumberish, name?: string): bigint { - const result = getBigInt(value, name); - assert(result >= BN_0, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", - operation: "getUint", - value, - }); - return result; + const result = getBigInt(value, name); + assert(result >= BN_0, "unsigned value cannot be negative", "NUMERIC_FAULT", { + fault: "overflow", + operation: "getUint", + value, + }); + return result; } const Nibbles = "0123456789abcdef"; @@ -152,16 +152,16 @@ const Nibbles = "0123456789abcdef"; * is treated as Big Endian data. */ export function toBigInt(value: BigNumberish | Uint8Array): bigint { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles[v >> 4]; - result += Nibbles[v & 0x0f]; - } - return BigInt(result); - } - - return getBigInt(value); + if (value instanceof Uint8Array) { + let result = "0x0"; + for (const v of value) { + result += Nibbles[v >> 4]; + result += Nibbles[v & 0x0f]; + } + return BigInt(result); + } + + return getBigInt(value); } /** @@ -169,45 +169,45 @@ export function toBigInt(value: BigNumberish | Uint8Array): bigint { * a //number//, then an ArgumentError will be thrown for %%name%%. */ export function getNumber(value: BigNumberish, name?: string): number { - switch (typeof value) { - case "bigint": - assertArgument( - value >= -maxValue && value <= maxValue, - "overflow", - name || "value", - value, - ); - return Number(value); - case "number": - assertArgument( - Number.isInteger(value), - "underflow", - name || "value", - value, - ); - assertArgument( - value >= -maxValue && value <= maxValue, - "overflow", - name || "value", - value, - ); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } catch (e: any) { - assertArgument( - false, - `invalid numeric string: ${e.message}`, - name || "value", - value, - ); - } - } - assertArgument(false, "invalid numeric value", name || "value", value); + switch (typeof value) { + case "bigint": + assertArgument( + value >= -maxValue && value <= maxValue, + "overflow", + name || "value", + value, + ); + return Number(value); + case "number": + assertArgument( + Number.isInteger(value), + "underflow", + name || "value", + value, + ); + assertArgument( + value >= -maxValue && value <= maxValue, + "overflow", + name || "value", + value, + ); + return value; + case "string": + try { + if (value === "") { + throw new Error("empty string"); + } + return getNumber(BigInt(value), name); + } catch (e: any) { + assertArgument( + false, + `invalid numeric string: ${e.message}`, + name || "value", + value, + ); + } + } + assertArgument(false, "invalid numeric value", name || "value", value); } /** @@ -215,7 +215,7 @@ export function getNumber(value: BigNumberish, name?: string): number { * is treated as Big Endian data. Throws if the value is not safe. */ export function toNumber(value: BigNumberish | Uint8Array): number { - return getNumber(toBigInt(value)); + return getNumber(toBigInt(value)); } /** @@ -223,59 +223,59 @@ export function toNumber(value: BigNumberish | Uint8Array): number { * %%width%% bytes. */ export function toBeHex(_value: BigNumberish, _width?: Numeric): string { - const value = getUint(_value, "value"); - - let result = value.toString(16); - - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } else { - const width = getNumber(_width, "width"); - assert( - width * 2 >= result.length, - `value exceeds width (${width} bits)`, - "NUMERIC_FAULT", - { - operation: "toBeHex", - fault: "overflow", - value: _value, - }, - ); - - // Pad the value to the required width - while (result.length < width * 2) { - result = "0" + result; - } - } - - return "0x" + result; + const value = getUint(_value, "value"); + + let result = value.toString(16); + + if (_width == null) { + // Ensure the value is of even length + if (result.length % 2) { + result = "0" + result; + } + } else { + const width = getNumber(_width, "width"); + assert( + width * 2 >= result.length, + `value exceeds width (${width} bits)`, + "NUMERIC_FAULT", + { + operation: "toBeHex", + fault: "overflow", + value: _value, + }, + ); + + // Pad the value to the required width + while (result.length < width * 2) { + result = "0" + result; + } + } + + return "0x" + result; } /** * Converts %%value%% to a Big Endian Uint8Array. */ export function toBeArray(_value: BigNumberish): Uint8Array { - const value = getUint(_value, "value"); + const value = getUint(_value, "value"); - if (value === BN_0) { - return new Uint8Array([]); - } + if (value === BN_0) { + return new Uint8Array([]); + } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } + let hex = value.toString(16); + if (hex.length % 2) { + hex = "0" + hex; + } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } + const result = new Uint8Array(hex.length / 2); + for (let i = 0; i < result.length; i++) { + const offset = i * 2; + result[i] = parseInt(hex.substring(offset, offset + 2), 16); + } - return result; + return result; } /** @@ -286,14 +286,14 @@ export function toBeArray(_value: BigNumberish): Uint8Array { * numeric values. */ export function toQuantity(value: BytesLike | BigNumberish): string { - let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring( - 2, - ); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; + let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring( + 2, + ); + while (result.startsWith("0")) { + result = result.substring(1); + } + if (result === "") { + result = "0"; + } + return "0x" + result; } diff --git a/src.ts/utils/properties.ts b/src.ts/utils/properties.ts index bc3698949..625a5e901 100644 --- a/src.ts/utils/properties.ts +++ b/src.ts/utils/properties.ts @@ -8,27 +8,27 @@ import { Logger } from "../logger/logger.js"; const logger = new Logger("utils/properties/0.0.1"); function checkType(value: any, type: string, name: string): void { - const types = type.split("|").map((t) => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof value === type) { - return; - } - } - } + const types = type.split("|").map((t) => t.trim()); + for (let i = 0; i < types.length; i++) { + switch (type) { + case "any": + return; + case "bigint": + case "boolean": + case "number": + case "string": + if (typeof value === type) { + return; + } + } + } - const error: any = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; + const error: any = new Error(`invalid value for type ${type}`); + error.code = "INVALID_ARGUMENT"; + error.argument = `value.${name}`; + error.value = value; - throw error; + throw error; } /** @@ -36,19 +36,19 @@ function checkType(value: any, type: string, name: string): void { * values resolved. */ export async function resolveProperties(value: { - [P in keyof T]: T[P] | Promise; + [P in keyof T]: T[P] | Promise; }): Promise { - const keys = Object.keys(value); - const results = await Promise.all( - keys.map((k) => Promise.resolve(value[k])), - ); - return results.reduce( - (accum: any, v, index) => { - accum[keys[index]] = v; - return accum; - }, - <{ [P in keyof T]: T[P] }>{}, - ); + const keys = Object.keys(value); + const results = await Promise.all( + keys.map((k) => Promise.resolve(value[k])), + ); + return results.reduce( + (accum: any, v, index) => { + accum[keys[index]] = v; + return accum; + }, + <{ [P in keyof T]: T[P] }>{}, + ); } /** @@ -57,41 +57,41 @@ export async function resolveProperties(value: { * It %%types%% is specified, the values are checked. */ export function defineProperties( - target: T, - values: { [K in keyof T]?: T[K] }, - types?: { [K in keyof T]?: string }, + target: T, + values: { [K in keyof T]?: T[K] }, + types?: { [K in keyof T]?: string }, ): void { - for (let key in values) { - let value = values[key]; + for (let key in values) { + let value = values[key]; - const type = types ? types[key] : null; - if (type) { - checkType(value, type, key); - } + const type = types ? types[key] : null; + if (type) { + checkType(value, type, key); + } - Object.defineProperty(target, key, { - enumerable: true, - value, - writable: false, - }); - } + Object.defineProperty(target, key, { + enumerable: true, + value, + writable: false, + }); + } } export function checkProperties( - object: any, - properties: { [name: string]: boolean }, + object: any, + properties: { [name: string]: boolean }, ): void { - if (!object || typeof object !== "object") { - logger.throwArgumentError("invalid object", "object", object); - } + if (!object || typeof object !== "object") { + logger.throwArgumentError("invalid object", "object", object); + } - Object.keys(object).forEach((key) => { - if (!properties[key]) { - logger.throwArgumentError( - "invalid object key - " + key, - "transaction:" + key, - object, - ); - } - }); + Object.keys(object).forEach((key) => { + if (!properties[key]) { + logger.throwArgumentError( + "invalid object key - " + key, + "transaction:" + key, + object, + ); + } + }); } diff --git a/src.ts/utils/rlp-decode.ts b/src.ts/utils/rlp-decode.ts index a8cc1fe98..6350b9032 100644 --- a/src.ts/utils/rlp-decode.ts +++ b/src.ts/utils/rlp-decode.ts @@ -5,135 +5,135 @@ import { getBytes } from "./data.js"; import type { BytesLike, RlpStructuredData } from "./index.js"; function hexlifyByte(value: number): string { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; + let result = value.toString(16); + while (result.length < 2) { + result = "0" + result; + } + return "0x" + result; } function unarrayifyInteger( - data: Uint8Array, - offset: number, - length: number, + data: Uint8Array, + offset: number, + length: number, ): number { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; + let result = 0; + for (let i = 0; i < length; i++) { + result = result * 256 + data[offset + i]; + } + return result; } type Decoded = { - result: any; - consumed: number; + result: any; + consumed: number; }; function _decodeChildren( - data: Uint8Array, - offset: number, - childOffset: number, - length: number, + data: Uint8Array, + offset: number, + childOffset: number, + length: number, ): Decoded { - const result: any = []; - - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - - result.push(decoded.result); - - childOffset += decoded.consumed; - assert( - childOffset <= offset + 1 + length, - "child data too short", - "BUFFER_OVERRUN", - { - buffer: data, - length, - offset, - }, - ); - } - - return { consumed: 1 + length, result: result }; + const result: any = []; + + while (childOffset < offset + 1 + length) { + const decoded = _decode(data, childOffset); + + result.push(decoded.result); + + childOffset += decoded.consumed; + assert( + childOffset <= offset + 1 + length, + "child data too short", + "BUFFER_OVERRUN", + { + buffer: data, + length, + offset, + }, + ); + } + + return { consumed: 1 + length, result: result }; } // returns { consumed: number, result: Object } function _decode( - data: Uint8Array, - offset: number, + data: Uint8Array, + offset: number, ): { consumed: number; result: any } { - assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, - length: 0, - offset: 1, - }); - - const checkOffset = (offset: number) => { - assert( - offset <= data.length, - "data short segment too short", - "BUFFER_OVERRUN", - { - buffer: data, - length: data.length, - offset, - }, - ); - }; - - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - - return _decodeChildren( - data, - offset, - offset + 1 + lengthLength, - lengthLength + length, - ); - } else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - - return _decodeChildren(data, offset, offset + 1, length); - } else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - - const result = hexlify( - data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length), - ); - return { consumed: 1 + lengthLength + length, result: result }; - } else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - - return { consumed: 1, result: hexlifyByte(data[offset]) }; + assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { + buffer: data, + length: 0, + offset: 1, + }); + + const checkOffset = (offset: number) => { + assert( + offset <= data.length, + "data short segment too short", + "BUFFER_OVERRUN", + { + buffer: data, + length: data.length, + offset, + }, + ); + }; + + // Array with extra length prefix + if (data[offset] >= 0xf8) { + const lengthLength = data[offset] - 0xf7; + checkOffset(offset + 1 + lengthLength); + + const length = unarrayifyInteger(data, offset + 1, lengthLength); + checkOffset(offset + 1 + lengthLength + length); + + return _decodeChildren( + data, + offset, + offset + 1 + lengthLength, + lengthLength + length, + ); + } else if (data[offset] >= 0xc0) { + const length = data[offset] - 0xc0; + checkOffset(offset + 1 + length); + + return _decodeChildren(data, offset, offset + 1, length); + } else if (data[offset] >= 0xb8) { + const lengthLength = data[offset] - 0xb7; + checkOffset(offset + 1 + lengthLength); + + const length = unarrayifyInteger(data, offset + 1, lengthLength); + checkOffset(offset + 1 + lengthLength + length); + + const result = hexlify( + data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length), + ); + return { consumed: 1 + lengthLength + length, result: result }; + } else if (data[offset] >= 0x80) { + const length = data[offset] - 0x80; + checkOffset(offset + 1 + length); + + const result = hexlify(data.slice(offset + 1, offset + 1 + length)); + return { consumed: 1 + length, result: result }; + } + + return { consumed: 1, result: hexlifyByte(data[offset]) }; } /** * Decodes %%data%% into the structured data it represents. */ export function decodeRlp(_data: BytesLike): RlpStructuredData { - const data = getBytes(_data, "data"); - const decoded = _decode(data, 0); - assertArgument( - decoded.consumed === data.length, - "unexpected junk after rlp payload", - "data", - _data, - ); - return decoded.result; + const data = getBytes(_data, "data"); + const decoded = _decode(data, 0); + assertArgument( + decoded.consumed === data.length, + "unexpected junk after rlp payload", + "data", + _data, + ); + return decoded.result; } diff --git a/src.ts/utils/rlp-encode.ts b/src.ts/utils/rlp-encode.ts index 24eb7b7a3..c4a3779de 100644 --- a/src.ts/utils/rlp-encode.ts +++ b/src.ts/utils/rlp-encode.ts @@ -3,47 +3,47 @@ import { getBytes } from "./data.js"; import type { RlpStructuredData } from "./rlp.js"; function arrayifyInteger(value: number): Array { - const result: any = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; + const result: any = []; + while (value) { + result.unshift(value & 0xff); + value >>= 8; + } + return result; } function _encode(object: Array | string): Array { - if (Array.isArray(object)) { - let payload: Array = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - - return length.concat(payload); - } - - const data: Array = Array.prototype.slice.call( - getBytes(object, "object"), - ); - - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - - return length.concat(data); + if (Array.isArray(object)) { + let payload: Array = []; + object.forEach(function (child) { + payload = payload.concat(_encode(child)); + }); + + if (payload.length <= 55) { + payload.unshift(0xc0 + payload.length); + return payload; + } + + const length = arrayifyInteger(payload.length); + length.unshift(0xf7 + length.length); + + return length.concat(payload); + } + + const data: Array = Array.prototype.slice.call( + getBytes(object, "object"), + ); + + if (data.length === 1 && data[0] <= 0x7f) { + return data; + } else if (data.length <= 55) { + data.unshift(0x80 + data.length); + return data; + } + + const length = arrayifyInteger(data.length); + length.unshift(0xb7 + length.length); + + return length.concat(data); } const nibbles = "0123456789abcdef"; @@ -52,10 +52,10 @@ const nibbles = "0123456789abcdef"; * Encodes %%object%% as an RLP-encoded [[DataHexString]]. */ export function encodeRlp(object: RlpStructuredData): string { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; + let result = "0x"; + for (const v of _encode(object)) { + result += nibbles[v >> 4]; + result += nibbles[v & 0xf]; + } + return result; } diff --git a/src.ts/utils/units.ts b/src.ts/utils/units.ts index bc47be316..2a2cac337 100644 --- a/src.ts/utils/units.ts +++ b/src.ts/utils/units.ts @@ -26,25 +26,25 @@ import { getNumber } from "./maths.js"; import type { BigNumberish, Numeric } from "../utils/index.js"; const names = [ - ///Ore, the smallest and atomic amount of Core - "ore", + ///Ore, the smallest and atomic amount of Core + "ore", - ///fecore, 1000 ore - "fecore", + ///fecore, 1000 ore + "fecore", - ///Picore, one million ore - "picore", + ///Picore, one million ore + "picore", - ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices. - "nacore", + ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices. + "nacore", - ///Μcore, 10^12 ore or 1 μCore - "mcore", + ///Μcore, 10^12 ore or 1 μCore + "mcore", - ///micore, 10^15 ore or 1 mcore - "micore", + ///micore, 10^15 ore or 1 mcore + "micore", - "core", + "core", ]; /** @@ -54,19 +54,19 @@ const names = [ * */ export function formatUnits( - value: BigNumberish, - unit?: string | Numeric, + value: BigNumberish, + unit?: string | Numeric, ): string { - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - - return FixedNumber.fromValue(value, decimals, { decimals }).toString(); + let decimals = 18; + if (typeof unit === "string") { + const index = names.indexOf(unit); + assertArgument(index >= 0, "invalid unit", "unit", unit); + decimals = 3 * index; + } else if (unit != null) { + decimals = getNumber(unit, "unit"); + } + + return FixedNumber.fromValue(value, decimals, { decimals }).toString(); } /** @@ -76,90 +76,90 @@ export function formatUnits( */ export const scientificToDecimal = (num: string | number) => { - // @ts-ignore - var nsign = Math.sign(num); - //remove the sign - // @ts-ignore - num = Math.abs(num); - //if the number is in scientific notation remove it - // @ts-ignore - if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) { - var zero = "0", - // @ts-ignore - parts = String(num).toLowerCase().split("e"), //split into coeff and exponent - e = parts.pop(), //store the exponential part - // @ts-ignore - l = Math.abs(e), //get the number of zeros - // @ts-ignore - sign = e / l, - coeff_array = parts[0].split("."); - if (sign === -1) { - l = l - coeff_array[0].length; - if (l < 0) { - // @ts-ignore - num = - coeff_array[0].slice(0, l) + - "." + - coeff_array[0].slice(l) + - (coeff_array.length === 2 ? coeff_array[1] : ""); - } else { - // @ts-ignore - num = zero + "." + new Array(l + 1).join(zero) + coeff_array.join(""); - } - } else { - var dec = coeff_array[1]; - if (dec) l = l - dec.length; - if (l < 0) { - // @ts-ignore - num = coeff_array[0] + dec.slice(0, l) + "." + dec.slice(l); - } else { - // @ts-ignore - num = coeff_array.join("") + new Array(l + 1).join(zero); - } - } - } - // @ts-ignore - return nsign < 0 ? "-" + num : num; + // @ts-ignore + var nsign = Math.sign(num); + //remove the sign + // @ts-ignore + num = Math.abs(num); + //if the number is in scientific notation remove it + // @ts-ignore + if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) { + var zero = "0", + // @ts-ignore + parts = String(num).toLowerCase().split("e"), //split into coeff and exponent + e = parts.pop(), //store the exponential part + // @ts-ignore + l = Math.abs(e), //get the number of zeros + // @ts-ignore + sign = e / l, + coeff_array = parts[0].split("."); + if (sign === -1) { + l = l - coeff_array[0].length; + if (l < 0) { + // @ts-ignore + num = + coeff_array[0].slice(0, l) + + "." + + coeff_array[0].slice(l) + + (coeff_array.length === 2 ? coeff_array[1] : ""); + } else { + // @ts-ignore + num = zero + "." + new Array(l + 1).join(zero) + coeff_array.join(""); + } + } else { + var dec = coeff_array[1]; + if (dec) l = l - dec.length; + if (l < 0) { + // @ts-ignore + num = coeff_array[0] + dec.slice(0, l) + "." + dec.slice(l); + } else { + // @ts-ignore + num = coeff_array.join("") + new Array(l + 1).join(zero); + } + } + } + // @ts-ignore + return nsign < 0 ? "-" + num : num; }; export const trimDecimals = (n: string, decimals = 18) => { - n += ""; + n += ""; - if (n.indexOf(".") === -1) return n; + if (n.indexOf(".") === -1) return n; - const arr = n.split("."); - const fraction = arr[1].substr(0, decimals); - return arr[0] + "." + fraction; + const arr = n.split("."); + const fraction = arr[1].substr(0, decimals); + return arr[0] + "." + fraction; }; export function parseUnits(value: string, unit?: string | Numeric): bigint { - assertArgument( - typeof value === "string", - "value must be a string", - "value", - value, - ); - if (value.includes("e")) { - value = scientificToDecimal(value).toString(); - } - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - value = trimDecimals(value, decimals); - } else if (unit != null) { - decimals = getNumber(unit, "unit"); - value = trimDecimals(value, decimals); - } - - return FixedNumber.fromString(value, { decimals }).value; + assertArgument( + typeof value === "string", + "value must be a string", + "value", + value, + ); + if (value.includes("e")) { + value = scientificToDecimal(value).toString(); + } + let decimals = 18; + if (typeof unit === "string") { + const index = names.indexOf(unit); + assertArgument(index >= 0, "invalid unit", "unit", unit); + decimals = 3 * index; + value = trimDecimals(value, decimals); + } else if (unit != null) { + decimals = getNumber(unit, "unit"); + value = trimDecimals(value, decimals); + } + + return FixedNumber.fromString(value, { decimals }).value; } /** * Converts %%value%% into a //decimal string// using 18 decimal places. */ export function formatXCB(ore: BigNumberish): string { - return formatUnits(ore, 18); + return formatUnits(ore, 18); } /** @@ -167,5 +167,5 @@ export function formatXCB(ore: BigNumberish): string { * decimal places. */ export function parseXCB(xcb: string): bigint { - return parseUnits(xcb, 18); + return parseUnits(xcb, 18); } diff --git a/src.ts/utils/utf8.ts b/src.ts/utils/utf8.ts index c8220fecd..34c58509e 100644 --- a/src.ts/utils/utf8.ts +++ b/src.ts/utils/utf8.ts @@ -51,13 +51,13 @@ export type UnicodeNormalizationForm = "NFC" | "NFD" | "NFKC" | "NFKD"; * @returns string */ export type Utf8ErrorReason = - | "UNEXPECTED_CONTINUE" - | "BAD_PREFIX" - | "OVERRUN" - | "MISSING_CONTINUE" - | "OUT_OF_RANGE" - | "UTF16_SURROGATE" - | "OVERLONG"; + | "UNEXPECTED_CONTINUE" + | "BAD_PREFIX" + | "OVERRUN" + | "MISSING_CONTINUE" + | "OUT_OF_RANGE" + | "UTF16_SURROGATE" + | "OVERLONG"; /** * A callback that can be used with [[toUtf8String]] to analysis or @@ -80,81 +80,81 @@ export type Utf8ErrorReason = * when control resumes to the FSM. */ export type Utf8ErrorFunc = ( - reason: Utf8ErrorReason, - offset: number, - bytes: Uint8Array, - output: Array, - badCodepoint?: number, + reason: Utf8ErrorReason, + offset: number, + bytes: Uint8Array, + output: Array, + badCodepoint?: number, ) => number; function errorFunc( - reason: Utf8ErrorReason, - offset: number, - bytes: Uint8Array, - output: Array, - badCodepoint?: number, + reason: Utf8ErrorReason, + offset: number, + bytes: Uint8Array, + output: Array, + badCodepoint?: number, ): number { - assertArgument( - false, - `invalid codepoint at offset ${offset}; ${reason}`, - "bytes", - bytes, - ); + assertArgument( + false, + `invalid codepoint at offset ${offset}; ${reason}`, + "bytes", + bytes, + ); } function ignoreFunc( - reason: Utf8ErrorReason, - offset: number, - bytes: Uint8Array, - output: Array, - badCodepoint?: number, + reason: Utf8ErrorReason, + offset: number, + bytes: Uint8Array, + output: Array, + badCodepoint?: number, ): number { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - - // Nothing to skip - return 0; + // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes + if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { + let i = 0; + for (let o = offset + 1; o < bytes.length; o++) { + if (bytes[o] >> 6 !== 0x02) { + break; + } + i++; + } + return i; + } + + // This byte runs us past the end of the string, so just jump to the end + // (but the first byte was read already read and therefore skipped) + if (reason === "OVERRUN") { + return bytes.length - offset - 1; + } + + // Nothing to skip + return 0; } function replaceFunc( - reason: Utf8ErrorReason, - offset: number, - bytes: Uint8Array, - output: Array, - badCodepoint?: number, + reason: Utf8ErrorReason, + offset: number, + bytes: Uint8Array, + output: Array, + badCodepoint?: number, ): number { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument( - typeof badCodepoint === "number", - "invalid bad code point for replacement", - "badCodepoint", - badCodepoint, - ); - output.push(badCodepoint); - return 0; - } - - // Put the replacement character into the output - output.push(0xfffd); - - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes, output, badCodepoint); + // Overlong representations are otherwise "valid" code points; just non-deistingtished + if (reason === "OVERLONG") { + assertArgument( + typeof badCodepoint === "number", + "invalid bad code point for replacement", + "badCodepoint", + badCodepoint, + ); + output.push(badCodepoint); + return 0; + } + + // Put the replacement character into the output + output.push(0xfffd); + + // Otherwise, process as if ignoring errors + return ignoreFunc(reason, offset, bytes, output, badCodepoint); } /** @@ -173,114 +173,114 @@ function replaceFunc( * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> */ export const Utf8ErrorFuncs: Readonly< - Record<"error" | "ignore" | "replace", Utf8ErrorFunc> + Record<"error" | "ignore" | "replace", Utf8ErrorFunc> > = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc, + error: errorFunc, + ignore: ignoreFunc, + replace: replaceFunc, }); // http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 function getUtf8CodePoints( - _bytes: BytesLike, - onError?: Utf8ErrorFunc, + _bytes: BytesLike, + onError?: Utf8ErrorFunc, ): Array { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - - const bytes = getBytes(_bytes, "bytes"); - - const result: Array = []; - let i = 0; - - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - - // Multibyte; how many bytes left for this character? - let extraLength: any = null; - let overlongMask: any = null; - - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - - // 1110 xxxx 10xx xxxx 10xx xxxx - } else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - - // Remove the length prefix from the char - let res: null | number = c & ((1 << (8 - extraLength - 1)) - 1); - - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - - res = (res << 6) | (nextChar & 0x3f); - i++; - } - - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - - result.push(res); - } - - return result; + if (onError == null) { + onError = Utf8ErrorFuncs.error; + } + + const bytes = getBytes(_bytes, "bytes"); + + const result: Array = []; + let i = 0; + + // Invalid bytes are ignored + while (i < bytes.length) { + const c = bytes[i++]; + + // 0xxx xxxx + if (c >> 7 === 0) { + result.push(c); + continue; + } + + // Multibyte; how many bytes left for this character? + let extraLength: any = null; + let overlongMask: any = null; + + // 110x xxxx 10xx xxxx + if ((c & 0xe0) === 0xc0) { + extraLength = 1; + overlongMask = 0x7f; + + // 1110 xxxx 10xx xxxx 10xx xxxx + } else if ((c & 0xf0) === 0xe0) { + extraLength = 2; + overlongMask = 0x7ff; + + // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx + } else if ((c & 0xf8) === 0xf0) { + extraLength = 3; + overlongMask = 0xffff; + } else { + if ((c & 0xc0) === 0x80) { + i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); + } else { + i += onError("BAD_PREFIX", i - 1, bytes, result); + } + continue; + } + + // Do we have enough bytes in our data? + if (i - 1 + extraLength >= bytes.length) { + i += onError("OVERRUN", i - 1, bytes, result); + continue; + } + + // Remove the length prefix from the char + let res: null | number = c & ((1 << (8 - extraLength - 1)) - 1); + + for (let j = 0; j < extraLength; j++) { + let nextChar = bytes[i]; + + // Invalid continuation byte + if ((nextChar & 0xc0) != 0x80) { + i += onError("MISSING_CONTINUE", i, bytes, result); + res = null; + break; + } + + res = (res << 6) | (nextChar & 0x3f); + i++; + } + + // See above loop for invalid continuation byte + if (res === null) { + continue; + } + + // Maximum code point + if (res > 0x10ffff) { + i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); + continue; + } + + // Reserved for UTF-16 surrogate halves + if (res >= 0xd800 && res <= 0xdfff) { + i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); + continue; + } + + // Check for overlong sequences (more bytes than needed) + if (res <= overlongMask) { + i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); + continue; + } + + result.push(res); + } + + return result; } // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array @@ -291,64 +291,64 @@ function getUtf8CodePoints( * If %%form%% is specified, the string is normalized. */ export function toUtf8Bytes( - str: string, - form?: UnicodeNormalizationForm, + str: string, + form?: UnicodeNormalizationForm, ): Uint8Array { - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - - let result: any = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - - if (c < 0x80) { - result.push(c); - } else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - - assertArgument( - i < str.length && (c2 & 0xfc00) === 0xdc00, - "invalid surrogate pair", - "str", - str, - ); - - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - - return new Uint8Array(result); + if (form != null) { + assertNormalize(form); + str = str.normalize(form); + } + + let result: any = []; + for (let i = 0; i < str.length; i++) { + const c = str.charCodeAt(i); + + if (c < 0x80) { + result.push(c); + } else if (c < 0x800) { + result.push((c >> 6) | 0xc0); + result.push((c & 0x3f) | 0x80); + } else if ((c & 0xfc00) == 0xd800) { + i++; + const c2 = str.charCodeAt(i); + + assertArgument( + i < str.length && (c2 & 0xfc00) === 0xdc00, + "invalid surrogate pair", + "str", + str, + ); + + // Surrogate Pair + const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); + result.push((pair >> 18) | 0xf0); + result.push(((pair >> 12) & 0x3f) | 0x80); + result.push(((pair >> 6) & 0x3f) | 0x80); + result.push((pair & 0x3f) | 0x80); + } else { + result.push((c >> 12) | 0xe0); + result.push(((c >> 6) & 0x3f) | 0x80); + result.push((c & 0x3f) | 0x80); + } + } + + return new Uint8Array(result); } //export function _toUtf8String(codePoints: Array): string { - return codePoints - .map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode( - ((codePoint >> 10) & 0x3ff) + 0xd800, - (codePoint & 0x3ff) + 0xdc00, - ); - }) - .join(""); + return codePoints + .map((codePoint) => { + if (codePoint <= 0xffff) { + return String.fromCharCode(codePoint); + } + codePoint -= 0x10000; + return String.fromCharCode( + ((codePoint >> 10) & 0x3ff) + 0xd800, + (codePoint & 0x3ff) + 0xdc00, + ); + }) + .join(""); } /** @@ -359,10 +359,10 @@ function _toUtf8String(codePoints: Array): string { * (default: [error](Utf8ErrorFuncs)) */ export function toUtf8String( - bytes: BytesLike, - onError?: Utf8ErrorFunc, + bytes: BytesLike, + onError?: Utf8ErrorFunc, ): string { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); + return _toUtf8String(getUtf8CodePoints(bytes, onError)); } /** @@ -371,8 +371,8 @@ export function toUtf8String( * If %%form%% is specified, the string is normalized. */ export function toUtf8CodePoints( - str: string, - form?: UnicodeNormalizationForm, + str: string, + form?: UnicodeNormalizationForm, ): Array { - return getUtf8CodePoints(toUtf8Bytes(str, form)); + return getUtf8CodePoints(toUtf8Bytes(str, form)); } diff --git a/src.ts/utils/uuid.ts b/src.ts/utils/uuid.ts index 268d46e9e..0103dfa08 100644 --- a/src.ts/utils/uuid.ts +++ b/src.ts/utils/uuid.ts @@ -13,24 +13,24 @@ import type { BytesLike } from "./index.js"; * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) */ export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); + const bytes = getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; + // Section: 4.1.3: + // - time_hi_and_version[12:16] = 0b0100 + bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; + // Section 4.4 + // - clock_seq_hi_and_reserved[6] = 0b0 + // - clock_seq_hi_and_reserved[7] = 0b1 + bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = hexlify(bytes); + const value = hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); + return [ + value.substring(2, 10), + value.substring(10, 14), + value.substring(14, 18), + value.substring(18, 22), + value.substring(22, 34), + ].join("-"); } diff --git a/src.ts/wallet/base-wallet.ts b/src.ts/wallet/base-wallet.ts index 1c94a758e..ed450362c 100644 --- a/src.ts/wallet/base-wallet.ts +++ b/src.ts/wallet/base-wallet.ts @@ -3,10 +3,10 @@ import { hashMessage, TypedDataEncoder } from "../hash/index.js"; import { AbstractSigner } from "../providers/index.js"; import { computeAddress, Transaction } from "../transaction/index.js"; import { - defineProperties, - resolveProperties, - assert, - assertArgument, + defineProperties, + resolveProperties, + assert, + assertArgument, } from "../utils/index.js"; import { sha256, SigningKey } from "../crypto/index.js"; @@ -26,154 +26,154 @@ import type { TransactionLike } from "../transaction/index.js"; * a minimal Signer. */ export class BaseWallet extends AbstractSigner { - /** - * The wallet address. - */ - readonly address!: string; - readonly prefix: string; - - readonly #signingKey: SigningKey; - - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor({ - signingKey, - prefix, - provider, - }: { - signingKey: SigningKey; - prefix: string; - provider?: null | Provider; - }) { - super(provider); - this.prefix = prefix; - - assertArgument( - signingKey && typeof signingKey.sign === "function", - "invalid signingKey key", - "signingKey", - "[ REDACTED ]", - ); - - this.#signingKey = signingKey; - const address = computeAddress(this.#signingKey, prefix); - defineProperties(this, { address }); - } - - // Store private values behind getters to reduce visibility - // in console.log - - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey(): SigningKey { - return this.#signingKey; - } - - /** - * The private key for this wallet. - */ - get privateKey(): string { - return this.signingKey.privateKey; - } - - async getAddress(): Promise { - return this.address; - } - - connect(provider: null | Provider): BaseWallet { - return new BaseWallet({ - signingKey: this.#signingKey, - prefix: this.prefix, - provider, - }); - } - - async signTransaction(tx: TransactionRequest): Promise { - // Replace any Addressable or ENS name with an address - const { to, from } = await resolveProperties({ - to: tx.to || undefined, - from: tx.from || undefined, - }); - - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - assertArgument( - getAddress(tx.from) === this.address, - "transaction from address mismatch", - "tx.from", - tx.from, - ); - delete tx.from; - } - - // Build the transaction - const btx = Transaction.from(>tx); - const unSignedSerialized = btx.unsignedSerialized; - const unsignedHash = sha256(unSignedSerialized); - // sha256(btx.unsignedSerialized) - btx.signature = this.signingKey.sign(unsignedHash); - return btx.serialized; - } - - async signMessage(message: string | Uint8Array): Promise { - return this.signMessageSync(message); - } - - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message: string | Uint8Array): string { - return this.signingKey.sign(hashMessage(message)); - } - - async signTypedData( - domain: TypedDataDomain, - types: Record>, - value: Record, - ): Promise { - // Populate any ENS names - const populated = await TypedDataEncoder.resolveNames( - domain, - types, - value, - async (name: string) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - - assert( - this.provider != null, - "cannot resolve ENS names without a provider", - "UNSUPPORTED_OPERATION", - { - operation: "resolveName", - info: { name }, - }, - ); - - const address = getAddress(name); - assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name, - }); - - return address; - }, - ); - - return this.signingKey.sign( - TypedDataEncoder.hash(populated.domain, types, populated.value), - ); - } + /** + * The wallet address. + */ + readonly address!: string; + readonly prefix: string; + + readonly #signingKey: SigningKey; + + /** + * Creates a new BaseWallet for %%privateKey%%, optionally + * connected to %%provider%%. + * + * If %%provider%% is not specified, only offline methods can + * be used. + */ + constructor({ + signingKey, + prefix, + provider, + }: { + signingKey: SigningKey; + prefix: string; + provider?: null | Provider; + }) { + super(provider); + this.prefix = prefix; + + assertArgument( + signingKey && typeof signingKey.sign === "function", + "invalid signingKey key", + "signingKey", + "[ REDACTED ]", + ); + + this.#signingKey = signingKey; + const address = computeAddress(this.#signingKey, prefix); + defineProperties(this, { address }); + } + + // Store private values behind getters to reduce visibility + // in console.log + + /** + * The [[SigningKey]] used for signing payloads. + */ + get signingKey(): SigningKey { + return this.#signingKey; + } + + /** + * The private key for this wallet. + */ + get privateKey(): string { + return this.signingKey.privateKey; + } + + async getAddress(): Promise { + return this.address; + } + + connect(provider: null | Provider): BaseWallet { + return new BaseWallet({ + signingKey: this.#signingKey, + prefix: this.prefix, + provider, + }); + } + + async signTransaction(tx: TransactionRequest): Promise { + // Replace any Addressable or ENS name with an address + const { to, from } = await resolveProperties({ + to: tx.to || undefined, + from: tx.from || undefined, + }); + + if (to != null) { + tx.to = to; + } + if (from != null) { + tx.from = from; + } + if (tx.from != null) { + assertArgument( + getAddress(tx.from) === this.address, + "transaction from address mismatch", + "tx.from", + tx.from, + ); + delete tx.from; + } + + // Build the transaction + const btx = Transaction.from(>tx); + const unSignedSerialized = btx.unsignedSerialized; + const unsignedHash = sha256(unSignedSerialized); + // sha256(btx.unsignedSerialized) + btx.signature = this.signingKey.sign(unsignedHash); + return btx.serialized; + } + + async signMessage(message: string | Uint8Array): Promise { + return this.signMessageSync(message); + } + + // @TODO: Add a secialized signTx and signTyped sync that enforces + // all parameters are known? + /** + * Returns the signature for %%message%% signed with this wallet. + */ + signMessageSync(message: string | Uint8Array): string { + return this.signingKey.sign(hashMessage(message)); + } + + async signTypedData( + domain: TypedDataDomain, + types: Record>, + value: Record, + ): Promise { + // Populate any ENS names + const populated = await TypedDataEncoder.resolveNames( + domain, + types, + value, + async (name: string) => { + // @TODO: this should use resolveName; addresses don't + // need a provider + + assert( + this.provider != null, + "cannot resolve ENS names without a provider", + "UNSUPPORTED_OPERATION", + { + operation: "resolveName", + info: { name }, + }, + ); + + const address = getAddress(name); + assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { + value: name, + }); + + return address; + }, + ); + + return this.signingKey.sign( + TypedDataEncoder.hash(populated.domain, types, populated.value), + ); + } } diff --git a/src.ts/wallet/english_words.ts b/src.ts/wallet/english_words.ts index 0921f6edd..fc22392bf 100644 --- a/src.ts/wallet/english_words.ts +++ b/src.ts/wallet/english_words.ts @@ -1,2 +1,2 @@ export const englishWords = - "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; + "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; diff --git a/src.ts/wallet/hdwallet.ts b/src.ts/wallet/hdwallet.ts index b16079d29..969a545dc 100644 --- a/src.ts/wallet/hdwallet.ts +++ b/src.ts/wallet/hdwallet.ts @@ -5,19 +5,19 @@ */ import { randomBytes, ripemd160, SigningKey, sha256 } from "../crypto/index.js"; import { - dataSlice, - defineProperties, - getNumber, - assertPrivate, - assertArgument, + dataSlice, + defineProperties, + getNumber, + assertPrivate, + assertArgument, } from "../utils/index.js"; import { LangEn } from "../wordlists/lang-en.js"; import { BaseWallet } from "./base-wallet.js"; import { Mnemonic } from "./mnemonic.js"; import { - encryptKeystoreJson, - encryptKeystoreJsonSync, + encryptKeystoreJson, + encryptKeystoreJsonSync, } from "./json-keystore.js"; import type { ProgressCallback } from "../crypto/index.js"; @@ -79,47 +79,47 @@ const _guard = {}; type HDNodeLike = { depth: number; deriveChild: (i: number) => T }; function derivePath>(node: T, path: string): T { - const components = path.split("/"); - - assertArgument( - components.length > 0 && (components[0] === "m" || node.depth > 0), - "invalid path", - "path", - path, - ); - - if (components[0] === "m") { - components.shift(); - } - - let result: T = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - assertArgument( - index < HardenedBit, - "invalid path index", - `path[${i}]`, - component, - ); - result = result.deriveChild(HardenedBit + index); - } else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - assertArgument( - index < HardenedBit, - "invalid path index", - `path[${i}]`, - component, - ); - result = result.deriveChild(index); - } else { - assertArgument(false, "invalid path component", `path[${i}]`, component); - } - } - - return result; + const components = path.split("/"); + + assertArgument( + components.length > 0 && (components[0] === "m" || node.depth > 0), + "invalid path", + "path", + path, + ); + + if (components[0] === "m") { + components.shift(); + } + + let result: T = node; + for (let i = 0; i < components.length; i++) { + const component = components[i]; + + if (component.match(/^[0-9]+'$/)) { + const index = parseInt(component.substring(0, component.length - 1)); + assertArgument( + index < HardenedBit, + "invalid path index", + `path[${i}]`, + component, + ); + result = result.deriveChild(HardenedBit + index); + } else if (component.match(/^[0-9]+$/)) { + const index = parseInt(component); + assertArgument( + index < HardenedBit, + "invalid path index", + `path[${i}]`, + component, + ); + result = result.deriveChild(index); + } else { + assertArgument(false, "invalid path component", `path[${i}]`, component); + } + } + + return result; } /** @@ -131,346 +131,346 @@ function derivePath>(node: T, path: string): T { * a path indicating the index of each child. */ export class HDNodeWallet extends BaseWallet { - /** - * The compressed public key. - */ - readonly publicKey!: string; - prefix: string; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint!: string; - - /** - * The parent fingerprint. - */ - readonly parentFingerprint!: string; - - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - readonly mnemonic!: null | Mnemonic; - - readonly #seed!: string; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - readonly path!: null | string; - - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index!: number; - - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth!: number; - - /** - * @private - */ - constructor({ - guard, - seed, - signingKey, - parentFingerprint, - path, - index, - depth, - mnemonic, - provider, - prefix, - }: { - guard: any; - seed: string; - signingKey: SigningKey; - parentFingerprint: string; - path: null | string; - index: number; - depth: number; - mnemonic: null | Mnemonic; - provider: null | Provider; - prefix: string; - }) { - super({ - signingKey, - prefix, - provider, - }); - assertPrivate(guard, _guard, "HDNodeWallet"); - - defineProperties(this, { publicKey: signingKey.publicKey }); - - this.prefix = prefix; - this.#seed = seed; - const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, - fingerprint, - path, - index, - depth, - }); - - defineProperties(this, { mnemonic }); - } - - connect(provider: null | Provider): HDNodeWallet { - return new HDNodeWallet({ - guard: _guard, - signingKey: this.signingKey, - parentFingerprint: this.parentFingerprint, - path: this.path, - index: this.index, - depth: this.depth, - seed: this.#seed, - mnemonic: this.mnemonic, - provider, - prefix: this.prefix, - }); - } - - #account(): KeystoreAccount { - const account: KeystoreAccount = { - address: this.address, - privateKey: this.privateKey, - }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy, - }; - } - - return account; - } - - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt( - password: Uint8Array | string, - progressCallback?: ProgressCallback, - ): Promise { - return await encryptKeystoreJson(this.#account(), password, { - progressCallback, - }); - } - - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string { - return encryptKeystoreJsonSync(this.#account(), password); - } - - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { path: string } { - return this.path != null; - } - - /** - * Return the child for %%index%%. - */ - deriveChild(_index: number): HDNodeWallet { - const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed( - this.#seed, - Number(_index), - ); - const newSigningKey = new SigningKey(newPrivateKey); - - // Base path - let path = this.path; - if (path) { - path += "/" + (_index & ~HardenedBit); - if (_index & HardenedBit) { - path += "'"; - } - } - - return new HDNodeWallet({ - guard: _guard, - signingKey: newSigningKey, - parentFingerprint: this.fingerprint, - path, - index: _index, - seed: this.#seed, - depth: this.depth + 1, - mnemonic: this.mnemonic, - provider: this.provider, - prefix: this.prefix, - }); - } - - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path: string): HDNodeWallet { - return derivePath(this, path); - } - - static #fromSeed({ - _seed, - mnemonic, - prefix, - path, - }: { - _seed: string; - mnemonic: null | Mnemonic; - prefix: string; - path?: string; - }): HDNodeWallet { - const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed( - _seed, - 0, - ); - const signingKey = new SigningKey(extendetPrivateKey); - // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length }) - return new HDNodeWallet({ - seed: _seed, - guard: _guard, - signingKey, - parentFingerprint: "0x00000000", - path: path || defaultPath, - index: 0, - depth: 0, - mnemonic, - provider: null, - prefix, - }); - } - - /** - * Creates a new random HDNode. - */ - static createRandom( - prefix: string, - password?: string, - path?: string, - wordlist?: Wordlist, - ): HDNodeWallet { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist); - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - - /** - * Create am HD Node from %%mnemonic%%. - */ - static fromMnemonic( - mnemonic: Mnemonic, - prefix: string, - path?: string, - ): HDNodeWallet { - if (!path) { - path = defaultPath; - } - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - static mnemonicToSeed(mnemonic: string, password?: string): string { - const seed = mnemonicToSeed(mnemonic, password); - return seed; - } - - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase({ - phrase, - prefix, - password, - path, - wordlist, - }: { - phrase: string; - prefix: string; - password?: string; - path?: string; - wordlist?: Wordlist; - }): HDNodeWallet { - if (!password) { - password = ""; - } - if (!path) { - path = defaultPath; - } - if (!wordlist) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist }); - const _seed = mnemonic.computeSeed(); - return HDNodeWallet.#fromSeed({ - _seed, - mnemonic, - prefix, - }).derivePath(path); - } - - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed({ - seed, - prefix, - path, - }: { - seed: string; - prefix: string; - path?: string; - }): HDNodeWallet { - return HDNodeWallet.#fromSeed({ - _seed: seed, - mnemonic: null, - path: path || defaultPath, - prefix, - }); - } + /** + * The compressed public key. + */ + readonly publicKey!: string; + prefix: string; + /** + * The fingerprint. + * + * A fingerprint allows quick qay to detect parent and child nodes, + * but developers should be prepared to deal with collisions as it + * is only 4 bytes. + */ + readonly fingerprint!: string; + + /** + * The parent fingerprint. + */ + readonly parentFingerprint!: string; + + /** + * The mnemonic used to create this HD Node, if available. + * + * Sources such as extended keys do not encode the mnemonic, in + * which case this will be ``null``. + */ + readonly mnemonic!: null | Mnemonic; + + readonly #seed!: string; + /** + * The derivation path of this wallet. + * + * Since extended keys do not provider full path details, this + * may be ``null``, if instantiated from a source that does not + * enocde it. + */ + readonly path!: null | string; + + /** + * The child index of this wallet. Values over ``2 *\* 31`` indicate + * the node is hardened. + */ + readonly index!: number; + + /** + * The depth of this wallet, which is the number of components + * in its path. + */ + readonly depth!: number; + + /** + * @private + */ + constructor({ + guard, + seed, + signingKey, + parentFingerprint, + path, + index, + depth, + mnemonic, + provider, + prefix, + }: { + guard: any; + seed: string; + signingKey: SigningKey; + parentFingerprint: string; + path: null | string; + index: number; + depth: number; + mnemonic: null | Mnemonic; + provider: null | Provider; + prefix: string; + }) { + super({ + signingKey, + prefix, + provider, + }); + assertPrivate(guard, _guard, "HDNodeWallet"); + + defineProperties(this, { publicKey: signingKey.publicKey }); + + this.prefix = prefix; + this.#seed = seed; + const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); + defineProperties(this, { + parentFingerprint, + fingerprint, + path, + index, + depth, + }); + + defineProperties(this, { mnemonic }); + } + + connect(provider: null | Provider): HDNodeWallet { + return new HDNodeWallet({ + guard: _guard, + signingKey: this.signingKey, + parentFingerprint: this.parentFingerprint, + path: this.path, + index: this.index, + depth: this.depth, + seed: this.#seed, + mnemonic: this.mnemonic, + provider, + prefix: this.prefix, + }); + } + + #account(): KeystoreAccount { + const account: KeystoreAccount = { + address: this.address, + privateKey: this.privateKey, + }; + const m = this.mnemonic; + if (this.path && m && m.wordlist.locale === "en" && m.password === "") { + account.mnemonic = { + path: this.path, + locale: "en", + entropy: m.entropy, + }; + } + + return account; + } + + /** + * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with + * %%password%%. + * + * If %%progressCallback%% is specified, it will receive periodic + * updates as the encryption process progreses. + */ + async encrypt( + password: Uint8Array | string, + progressCallback?: ProgressCallback, + ): Promise { + return await encryptKeystoreJson(this.#account(), password, { + progressCallback, + }); + } + + /** + * Returns a [JSON Keystore Wallet](json-wallets) encryped with + * %%password%%. + * + * It is preferred to use the [async version](encrypt) instead, + * which allows a [[ProgressCallback]] to keep the user informed. + * + * This method will block the event loop (freezing all UI) until + * it is complete, which may be a non-trivial duration. + */ + encryptSync(password: Uint8Array | string): string { + return encryptKeystoreJsonSync(this.#account(), password); + } + + /** + * Returns true if this wallet has a path, providing a Type Guard + * that the path is non-null. + */ + hasPath(): this is { path: string } { + return this.path != null; + } + + /** + * Return the child for %%index%%. + */ + deriveChild(_index: number): HDNodeWallet { + const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed( + this.#seed, + Number(_index), + ); + const newSigningKey = new SigningKey(newPrivateKey); + + // Base path + let path = this.path; + if (path) { + path += "/" + (_index & ~HardenedBit); + if (_index & HardenedBit) { + path += "'"; + } + } + + return new HDNodeWallet({ + guard: _guard, + signingKey: newSigningKey, + parentFingerprint: this.fingerprint, + path, + index: _index, + seed: this.#seed, + depth: this.depth + 1, + mnemonic: this.mnemonic, + provider: this.provider, + prefix: this.prefix, + }); + } + + /** + * Return the HDNode for %%path%% from this node. + */ + derivePath(path: string): HDNodeWallet { + return derivePath(this, path); + } + + static #fromSeed({ + _seed, + mnemonic, + prefix, + path, + }: { + _seed: string; + mnemonic: null | Mnemonic; + prefix: string; + path?: string; + }): HDNodeWallet { + const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed( + _seed, + 0, + ); + const signingKey = new SigningKey(extendetPrivateKey); + // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length }) + return new HDNodeWallet({ + seed: _seed, + guard: _guard, + signingKey, + parentFingerprint: "0x00000000", + path: path || defaultPath, + index: 0, + depth: 0, + mnemonic, + provider: null, + prefix, + }); + } + + /** + * Creates a new random HDNode. + */ + static createRandom( + prefix: string, + password?: string, + path?: string, + wordlist?: Wordlist, + ): HDNodeWallet { + if (password == null) { + password = ""; + } + if (path == null) { + path = defaultPath; + } + if (wordlist == null) { + wordlist = LangEn.wordlist(); + } + const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist); + return HDNodeWallet.#fromSeed({ + _seed: mnemonic.computeSeed(), + mnemonic, + prefix, + }).derivePath(path); + } + + /** + * Create am HD Node from %%mnemonic%%. + */ + static fromMnemonic( + mnemonic: Mnemonic, + prefix: string, + path?: string, + ): HDNodeWallet { + if (!path) { + path = defaultPath; + } + return HDNodeWallet.#fromSeed({ + _seed: mnemonic.computeSeed(), + mnemonic, + prefix, + }).derivePath(path); + } + static mnemonicToSeed(mnemonic: string, password?: string): string { + const seed = mnemonicToSeed(mnemonic, password); + return seed; + } + + /** + * Creates an HD Node from a mnemonic %%phrase%%. + */ + static fromPhrase({ + phrase, + prefix, + password, + path, + wordlist, + }: { + phrase: string; + prefix: string; + password?: string; + path?: string; + wordlist?: Wordlist; + }): HDNodeWallet { + if (!password) { + password = ""; + } + if (!path) { + path = defaultPath; + } + if (!wordlist) { + wordlist = LangEn.wordlist(); + } + const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist }); + const _seed = mnemonic.computeSeed(); + return HDNodeWallet.#fromSeed({ + _seed, + mnemonic, + prefix, + }).derivePath(path); + } + + /** + * Creates an HD Node from a %%seed%%. + */ + static fromSeed({ + seed, + prefix, + path, + }: { + seed: string; + prefix: string; + path?: string; + }): HDNodeWallet { + return HDNodeWallet.#fromSeed({ + _seed: seed, + mnemonic: null, + path: path || defaultPath, + prefix, + }); + } } /* @@ -499,14 +499,14 @@ export class HDNodeWalletManager { * some software. */ export function getAccountPath(_index: Numeric): string { - const index = getNumber(_index, "index"); - assertArgument( - index >= 0 && index < HardenedBit, - "invalid account index", - "index", - index, - ); - return `m/44'/60'/${index}'/0/0`; + const index = getNumber(_index, "index"); + assertArgument( + index >= 0 && index < HardenedBit, + "invalid account index", + "index", + index, + ); + return `m/44'/60'/${index}'/0/0`; } /** @@ -519,12 +519,12 @@ export function getAccountPath(_index: Numeric): string { * This is the pattern used by wallets like MetaMask. */ export function getIndexedAccountPath(_index: Numeric): string { - const index = getNumber(_index, "index"); - assertArgument( - index >= 0 && index < HardenedBit, - "invalid account index", - "index", - index, - ); - return `m/44'/60'/0'/0/${index}`; + const index = getNumber(_index, "index"); + assertArgument( + index >= 0 && index < HardenedBit, + "invalid account index", + "index", + index, + ); + return `m/44'/60'/0'/0/${index}`; } diff --git a/src.ts/wallet/index.ts b/src.ts/wallet/index.ts index 284eb5985..dbd3977f2 100644 --- a/src.ts/wallet/index.ts +++ b/src.ts/wallet/index.ts @@ -20,20 +20,20 @@ export { BaseWallet } from "./base-wallet.js"; export { - defaultPath, - getAccountPath, - getIndexedAccountPath, - HDNodeWallet, + defaultPath, + getAccountPath, + getIndexedAccountPath, + HDNodeWallet, } from "./hdwallet.js"; export { isCrowdsaleJson, decryptCrowdsaleJson } from "./json-crowdsale.js"; export { - isKeystoreJson, - decryptKeystoreJsonSync, - decryptKeystoreJson, - encryptKeystoreJson, - encryptKeystoreJsonSync, + isKeystoreJson, + decryptKeystoreJsonSync, + decryptKeystoreJson, + encryptKeystoreJson, + encryptKeystoreJsonSync, } from "./json-keystore.js"; export { Mnemonic } from "./mnemonic.js"; diff --git a/src.ts/wallet/json-crowdsale.ts b/src.ts/wallet/json-crowdsale.ts index e043219f2..90c71cf75 100644 --- a/src.ts/wallet/json-crowdsale.ts +++ b/src.ts/wallet/json-crowdsale.ts @@ -3,7 +3,12 @@ */ // @ts-ignore import pkg from "aes-js"; -const { CBC, pkcs7Strip } = pkg; +const { + ModeOfOperation: { cbc: CBC }, + padding: { + pkcs7: { strip: pkcs7Strip }, + }, +} = pkg; import { getAddress } from "../address/index.js"; import { pbkdf2 } from "../crypto/index.js"; import { id } from "../hash/index.js"; @@ -16,21 +21,21 @@ import { getPassword, looseArrayify, spelunk } from "./utils.js"; * minimal. */ export type CrowdsaleAccount = { - privateKey: string; - address: string; + privateKey: string; + address: string; }; /** * Returns true if %%json%% is a valid JSON Crowdsale wallet. */ export function isCrowdsaleJson(json: string): boolean { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } catch (error) {} - return false; + try { + const data = JSON.parse(json); + if (data.encseed) { + return true; + } + } catch (error) {} + return false; } /** @@ -44,41 +49,41 @@ export function isCrowdsaleJson(json: string): boolean { * the library. */ export function decryptCrowdsaleJson( - json: string, - _password: string | Uint8Array, + json: string, + _password: string | Uint8Array, ): CrowdsaleAccount { - const data = JSON.parse(json); - const password = getPassword(_password); + const data = JSON.parse(json); + const password = getPassword(_password); - // Core Address - const address = getAddress(spelunk(data, "ethaddr:string!")); + // Core Address + const address = getAddress(spelunk(data, "ethaddr:string!")); - // Encrypted Seed - const encseed = looseArrayify(spelunk(data, "encseed:string!")); - assertArgument( - encseed && encseed.length % 16 === 0, - "invalid encseed", - "json", - json, - ); + // Encrypted Seed + const encseed = looseArrayify(spelunk(data, "encseed:string!")); + assertArgument( + encseed && encseed.length % 16 === 0, + "invalid encseed", + "json", + json, + ); - const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice( - 0, - 16, - ); + const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice( + 0, + 16, + ); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); + const iv = encseed.slice(0, 16); + const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); + // Decrypt the seed + const aesCbc = new CBC(key, iv); + const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } + // This wallet format is weird... Convert the binary encoded hex to a string. + let seedHex = ""; + for (let i = 0; i < seed.length; i++) { + seedHex += String.fromCharCode(seed[i]); + } - return { address, privateKey: id(seedHex) }; + return { address, privateKey: id(seedHex) }; } diff --git a/src.ts/wallet/json-keystore.ts b/src.ts/wallet/json-keystore.ts index bbfb46b4b..26e3b3001 100644 --- a/src.ts/wallet/json-keystore.ts +++ b/src.ts/wallet/json-keystore.ts @@ -10,23 +10,26 @@ */ // @ts-ignore import pkg from "aes-js"; -const { CTR } = pkg; +const { + Counter, + ModeOfOperation: { ctr: CTR }, +} = pkg; import { getAddress } from "../address/index.js"; import { - pbkdf2, - randomBytes, - scrypt, - scryptSync, - sha256, + pbkdf2, + randomBytes, + scrypt, + scryptSync, + sha256, } from "../crypto/index.js"; import { - concat, - getBytes, - hexlify, - uuidV4, - assert, - assertArgument, + concat, + getBytes, + hexlify, + uuidV4, + assert, + assertArgument, } from "../utils/index.js"; import { getPassword, spelunk, zpad } from "./utils.js"; @@ -43,180 +46,220 @@ const defaultPath = "m/44'/60'/0'/0/0"; * The contents of a JSON Keystore Wallet. */ export type KeystoreAccount = { - address: string; - privateKey: string; - mnemonic?: { - path?: string; - locale?: string; - entropy: string; - }; + address: string; + privateKey: string; + mnemonic?: { + path?: string; + locale?: string; + entropy: string; + }; }; /** * The parameters to use when encrypting a JSON Keystore Wallet. */ export type EncryptOptions = { - progressCallback?: ProgressCallback; - iv?: BytesLike; - entropy?: BytesLike; - client?: string; - salt?: BytesLike; - uuid?: string; - scrypt?: { - N?: number; - r?: number; - p?: number; - }; + progressCallback?: ProgressCallback; + iv?: BytesLike; + entropy?: BytesLike; + client?: string; + salt?: BytesLike; + uuid?: string; + scrypt?: { + N?: number; + r?: number; + p?: number; + }; }; /** * Returns true if %%json%% is a valid JSON Keystore Wallet. */ export function isKeystoreJson(json: string): boolean { - try { - const data = JSON.parse(json); - const version = data.version != null ? parseInt(data.version) : 0; - if (version === 3) { - return true; - } - } catch (error) {} - return false; + try { + const data = JSON.parse(json); + const version = data.version != null ? parseInt(data.version) : 0; + if (version === 3) { + return true; + } + } catch (error) {} + return false; } function decrypt(data: any, key: Uint8Array, ciphertext: Uint8Array): string { - const cipher = spelunk(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, iv); - return hexlify(aesCtr.decrypt(ciphertext)); - } - - assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt", - }); + const cipher = spelunk(data, "crypto.cipher:string"); + if (cipher === "aes-128-ctr") { + const iv = spelunk(data, "crypto.cipherparams.iv:data!"); + const aesCtr = new CTR(key, new Counter(iv)); + return hexlify(aesCtr.decrypt(ciphertext)); + } + + assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { + operation: "decrypt", + }); } function getAccount(data: any, _key: string): KeystoreAccount { - const key = getBytes(_key); - const ciphertext = spelunk(data, "crypto.ciphertext:data!"); - - const computedMAC = hexlify( - sha256(concat([key.slice(16, 32), ciphertext])), - ).substring(2); - assertArgument( - computedMAC === spelunk(data, "crypto.mac:string!").toLowerCase(), - "incorrect password", - "password", - "[ REDACTED ]", - ); - - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - - const address = getAddress(data.address); - const prefix = extractPrefix(address); - if (computeAddress(privateKey, prefix) !== address) { - throw new Error("address mismatch"); - } - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - - assertArgument( - getAddress(check) === address, - "keystore address/privateKey mismatch", - "address", - data.address, - ); - } - - const account: KeystoreAccount = { address, privateKey }; - - // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase - const version = spelunk(data, "x-corebc.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - - const mnemonicCiphertext = spelunk( - data, - "x-corebc.mnemonicCiphertext:data!", - ); - const mnemonicIv = spelunk( - data, - "x-corebc.mnemonicCounter:data!", - ); - - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - - account.mnemonic = { - path: spelunk(data, "x-corebc.path:string") || defaultPath, - locale: spelunk(data, "x-corebc.locale:string") || "en", - entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))), - }; - } - - return account; + const key = getBytes(_key); + const ciphertext = spelunk(data, "crypto.ciphertext:data!"); + + const computedMAC = hexlify( + sha256(concat([key.slice(16, 32), ciphertext])), + ).substring(2); + const expectedMAC = spelunk(data, "crypto.mac:string!"); + let difference = 0; + const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC); + if (validMAC) { + const actual = getBytes("0x" + computedMAC); + const expected = getBytes("0x" + expectedMAC); + for (let i = 0; i < actual.length; i++) + difference |= actual[i] ^ expected[i]; + } + assertArgument( + validMAC && difference === 0, + "incorrect password", + "password", + "[REDACTED]", + ); + + const privateKey = decrypt(data, key.slice(0, 16), ciphertext); + + const address = getAddress(data.address); + const prefix = extractPrefix(address); + if (computeAddress(privateKey, prefix) !== address) { + throw new Error("address mismatch"); + } + if (data.address) { + let check = data.address.toLowerCase(); + if (!check.startsWith("0x")) { + check = "0x" + check; + } + + assertArgument( + getAddress(check) === address, + "keystore address/privateKey mismatch", + "address", + data.address, + ); + } + + const account: KeystoreAccount = { address, privateKey }; + + // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase + const version = spelunk(data, "x-corebc.version:string"); + if (version === "0.1") { + const mnemonicKey = key.slice(32, 64); + + const mnemonicCiphertext = spelunk( + data, + "x-corebc.mnemonicCiphertext:data!", + ); + const mnemonicIv = spelunk( + data, + "x-corebc.mnemonicCounter:data!", + ); + + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); + + account.mnemonic = { + path: spelunk(data, "x-corebc.path:string") || defaultPath, + locale: spelunk(data, "x-corebc.locale:string") || "en", + entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))), + }; + } + + return account; } type ScryptParams = { - name: "scrypt"; - salt: Uint8Array; - N: number; - r: number; - p: number; - dkLen: number; + name: "scrypt"; + salt: Uint8Array; + N: number; + r: number; + p: number; + dkLen: number; }; type KdfParams = - | ScryptParams - | { - name: "pbkdf2"; - salt: Uint8Array; - count: number; - dkLen: number; - algorithm: "sha256" | "sha512"; - }; + | ScryptParams + | { + name: "pbkdf2"; + salt: Uint8Array; + count: number; + dkLen: number; + algorithm: "sha256" | "sha512"; + }; + +// Match Core Web3Dart's wallet KDF resource limits. +function validateScrypt(N: number, r: number, p: number): void { + assertArgument( + Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, + "unsafe scrypt N", + "kdf.N", + N, + ); + assertArgument( + Number.isSafeInteger(r) && + Number.isSafeInteger(p) && + r > 0 && + p > 0 && + r * p <= 1048576 && + 128 * N * r <= 256 * 1024 * 1024, + "unsafe scrypt work or memory requirement", + "kdf", + { N, r, p }, + ); +} function getDecryptKdfParams(data: any): KdfParams { - const kdf = spelunk(data, "crypto.kdf:string"); - if (kdf && typeof kdf === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const N = spelunk(data, "crypto.kdfparams.n:int!"); - const r = spelunk(data, "crypto.kdfparams.r:int!"); - const p = spelunk(data, "crypto.kdfparams.p:int!"); - - // Make sure N is a power of 2 - assertArgument(N > 0 && (N & (N - 1)) === 0, "invalid kdf.N", "kdf.N", N); - assertArgument(r > 0 && p > 0, "invalid kdf", "kdf", kdf); - - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } else if (kdf.toLowerCase() === "pbkdf2") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - - const prf = spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - assertArgument( - algorithm === "sha256" || algorithm === "sha512", - "invalid kdf.pdf", - "kdf.pdf", - prf, - ); - - const count = spelunk(data, "crypto.kdfparams.c:int!"); - - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - - return { name: "pbkdf2", salt, count, dkLen, algorithm }; - } - } - - assertArgument(false, "unsupported key-derivation function", "kdf", kdf); + const kdf = spelunk(data, "crypto.kdf:string"); + if (kdf && typeof kdf === "string") { + if (kdf.toLowerCase() === "scrypt") { + const salt = spelunk(data, "crypto.kdfparams.salt:data!"); + const N = spelunk(data, "crypto.kdfparams.n:int!"); + const r = spelunk(data, "crypto.kdfparams.r:int!"); + const p = spelunk(data, "crypto.kdfparams.p:int!"); + + validateScrypt(N, r, p); + + const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); + assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); + + return { name: "scrypt", salt, N, r, p, dkLen: 64 }; + } else if (kdf.toLowerCase() === "pbkdf2") { + const salt = spelunk(data, "crypto.kdfparams.salt:data!"); + + const prf = spelunk(data, "crypto.kdfparams.prf:string!"); + const algorithm = prf.split("-").pop(); + assertArgument( + prf === "hmac-sha256" || prf === "hmac-sha512", + "invalid kdf.pdf", + "kdf.pdf", + prf, + ); + + const count = spelunk(data, "crypto.kdfparams.c:int!"); + assertArgument( + Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, + "unsafe PBKDF2 iteration count", + "kdf.c", + count, + ); + + const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); + assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); + + return { + name: "pbkdf2", + salt, + count, + dkLen, + algorithm: algorithm as "sha256" | "sha512", + }; + } + } + + assertArgument(false, "unsupported key-derivation function", "kdf", kdf); } /** @@ -232,35 +275,35 @@ function getDecryptKdfParams(data: any): KdfParams { * paramters and platform. */ export function decryptKeystoreJsonSync( - json: string, - _password: string | Uint8Array, + json: string, + _password: string | Uint8Array, ): KeystoreAccount { - const data = JSON.parse(json); + const data = JSON.parse(json); - const password = getPassword(_password); + const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } + const params = getDecryptKdfParams(data); + if (params.name === "pbkdf2") { + const { salt, count, dkLen, algorithm } = params; + const key = pbkdf2(password, salt, count, dkLen, algorithm); + return getAccount(data, key); + } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); + assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { + params, + }); - const { salt, N, r, p, dkLen } = params; - const key = scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); + const { salt, N, r, p, dkLen } = params; + const key = scryptSync(password, salt, N, r, p, dkLen); + return getAccount(data, key); } function stall(duration: number): Promise { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); + return new Promise((resolve) => { + setTimeout(() => { + resolve(); + }, duration); + }); } /** @@ -275,196 +318,176 @@ function stall(duration: number): Promise { * decryption begins and ``1`` when complete. */ export async function decryptKeystoreJson( - json: string, - _password: string | Uint8Array, - progress?: ProgressCallback, + json: string, + _password: string | Uint8Array, + progress?: ProgressCallback, ): Promise { - const data = JSON.parse(json); - - const password = getPassword(_password); - - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall(0); - } - return getAccount(data, key); - } - - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - - const { salt, N, r, p, dkLen } = params; - const key = await scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); + const data = JSON.parse(json); + + const password = getPassword(_password); + + const params = getDecryptKdfParams(data); + if (params.name === "pbkdf2") { + if (progress) { + progress(0); + await stall(0); + } + const { salt, count, dkLen, algorithm } = params; + const key = pbkdf2(password, salt, count, dkLen, algorithm); + if (progress) { + progress(1); + await stall(0); + } + return getAccount(data, key); + } + + assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { + params, + }); + + const { salt, N, r, p, dkLen } = params; + const key = await scrypt(password, salt, N, r, p, dkLen, progress); + return getAccount(data, key); } function getEncryptKdfParams(options: EncryptOptions): ScryptParams { - // Check/generate the salt - const salt = - options.salt != null - ? getBytes(options.salt, "options.salt") - : randomBytes(32); - - // Override the scrypt password-based key derivation function parameters - let N = 1 << 17, - r = 8, - p = 1; - if (options.scrypt) { - if (options.scrypt.N) { - N = options.scrypt.N; - } - if (options.scrypt.r) { - r = options.scrypt.r; - } - if (options.scrypt.p) { - p = options.scrypt.p; - } - } - assertArgument( - typeof N === "number" && - N > 0 && - Number.isSafeInteger(N) && - (BigInt(N) & BigInt(N - 1)) === BigInt(0), - "invalid scrypt N parameter", - "options.N", - N, - ); - assertArgument( - typeof r === "number" && r > 0 && Number.isSafeInteger(r), - "invalid scrypt r parameter", - "options.r", - r, - ); - assertArgument( - typeof p === "number" && p > 0 && Number.isSafeInteger(p), - "invalid scrypt p parameter", - "options.p", - p, - ); - - return { name: "scrypt", dkLen: 32, salt, N, r, p }; + // Check/generate the salt + const salt = + options.salt != null + ? getBytes(options.salt, "options.salt") + : randomBytes(32); + + // Override the scrypt password-based key derivation function parameters + let N = 1 << 17, + r = 8, + p = 1; + if (options.scrypt) { + if (options.scrypt.N != null) { + N = options.scrypt.N; + } + if (options.scrypt.r != null) { + r = options.scrypt.r; + } + if (options.scrypt.p != null) { + p = options.scrypt.p; + } + } + validateScrypt(N, r, p); + + return { name: "scrypt", dkLen: 32, salt, N, r, p }; } function _encryptKeystore( - key: Uint8Array, - kdf: ScryptParams, - account: KeystoreAccount, - options: EncryptOptions, + key: Uint8Array, + kdf: ScryptParams, + account: KeystoreAccount, + options: EncryptOptions, ): any { - const privateKey = getBytes(account.privateKey, "privateKey"); - - // Override initialization vector - const iv = - options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); - assertArgument( - iv.length === 16, - "invalid options.iv length", - "options.iv", - options.iv, - ); - - // Override the uuid - const uuidRandom = - options.uuid != null - ? getBytes(options.uuid, "options.uuid") - : randomBytes(16); - assertArgument( - uuidRandom.length === 16, - "invalid options.uuid length", - "options.uuid", - options.iv, - ); - - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - - // Encrypt the private key - const aesCtr = new CTR(derivedKey, iv); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - - // Compute the message authentication code, used to check the password - const mac = sha256(concat([macPrefix, ciphertext])); - - const data: { [key: string]: any } = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv).substring(2), - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r, - }, - mac: mac.substring(2), - }, - }; - - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = - options.client != null ? options.client : `corebc/${version}`; - - const path = account.mnemonic.path || defaultPath; - const locale = account.mnemonic.locale || "en"; - - const mnemonicKey = key.slice(32, 64); - - const entropy = getBytes( - account.mnemonic.entropy, - "account.mnemonic.entropy", - ); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, mnemonicIv); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - - const now = new Date(); - const timestamp = - now.getUTCFullYear() + - "-" + - zpad(now.getUTCMonth() + 1, 2) + - "-" + - zpad(now.getUTCDate(), 2) + - "T" + - zpad(now.getUTCHours(), 2) + - "-" + - zpad(now.getUTCMinutes(), 2) + - "-" + - zpad(now.getUTCSeconds(), 2) + - ".0Z"; - const gethFilename = "UTC--" + timestamp + "--" + data.address; - - data["x-corebc"] = { - client, - gethFilename, - path, - locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1", - }; - } - - return JSON.stringify(data); + const privateKey = getBytes(account.privateKey, "privateKey"); + + // Override initialization vector + const iv = + options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); + assertArgument( + iv.length === 16, + "invalid options.iv length", + "options.iv", + options.iv, + ); + + // Override the uuid + const uuidRandom = + options.uuid != null + ? getBytes(options.uuid, "options.uuid") + : randomBytes(16); + assertArgument( + uuidRandom.length === 16, + "invalid options.uuid length", + "options.uuid", + options.iv, + ); + + // This will be used to encrypt the wallet (as per Web3 secret storage) + // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) + // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet) + const derivedKey = key.slice(0, 16); + const macPrefix = key.slice(16, 32); + + // Encrypt the private key + const aesCtr = new CTR(derivedKey, new Counter(iv)); + const ciphertext = getBytes(aesCtr.encrypt(privateKey)); + + // Compute the message authentication code, used to check the password + const mac = sha256(concat([macPrefix, ciphertext])); + + const data: { [key: string]: any } = { + address: account.address.substring(2).toLowerCase(), + id: uuidV4(uuidRandom), + version: 3, + Crypto: { + cipher: "aes-128-ctr", + cipherparams: { + iv: hexlify(iv).substring(2), + }, + ciphertext: hexlify(ciphertext).substring(2), + kdf: "scrypt", + kdfparams: { + salt: hexlify(kdf.salt).substring(2), + n: kdf.N, + dklen: 32, + p: kdf.p, + r: kdf.r, + }, + mac: mac.substring(2), + }, + }; + + // If we have a mnemonic, encrypt it into the JSON wallet + if (account.mnemonic) { + const client = + options.client != null ? options.client : `corebc/${version}`; + + const path = account.mnemonic.path || defaultPath; + const locale = account.mnemonic.locale || "en"; + + const mnemonicKey = key.slice(32, 64); + + const entropy = getBytes( + account.mnemonic.entropy, + "account.mnemonic.entropy", + ); + const mnemonicIv = randomBytes(16); + const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); + const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); + + const now = new Date(); + const timestamp = + now.getUTCFullYear() + + "-" + + zpad(now.getUTCMonth() + 1, 2) + + "-" + + zpad(now.getUTCDate(), 2) + + "T" + + zpad(now.getUTCHours(), 2) + + "-" + + zpad(now.getUTCMinutes(), 2) + + "-" + + zpad(now.getUTCSeconds(), 2) + + ".0Z"; + const gethFilename = "UTC--" + timestamp + "--" + data.address; + + data["x-corebc"] = { + client, + gethFilename, + path, + locale, + mnemonicCounter: hexlify(mnemonicIv).substring(2), + mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), + version: "0.1", + }; + } + + return JSON.stringify(data); } /** @@ -476,18 +499,18 @@ function _encryptKeystore( * used. Any provided [[ProgressCallback]] is ignord. */ export function encryptKeystoreJsonSync( - account: KeystoreAccount, - password: string | Uint8Array, - options?: EncryptOptions, + account: KeystoreAccount, + password: string | Uint8Array, + options?: EncryptOptions, ): string { - if (options == null) { - options = {}; - } - - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key), kdf, account, options); + if (options == null) { + options = {}; + } + + const passwordBytes = getPassword(password); + const kdf = getEncryptKdfParams(options); + const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); + return _encryptKeystore(getBytes(key), kdf, account, options); } /** @@ -500,24 +523,24 @@ export function encryptKeystoreJsonSync( * on the completion status.. */ export async function encryptKeystoreJson( - account: KeystoreAccount, - password: string | Uint8Array, - options?: EncryptOptions, + account: KeystoreAccount, + password: string | Uint8Array, + options?: EncryptOptions, ): Promise { - if (options == null) { - options = {}; - } - - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt( - passwordBytes, - kdf.salt, - kdf.N, - kdf.r, - kdf.p, - 64, - options.progressCallback, - ); - return _encryptKeystore(getBytes(key), kdf, account, options); + if (options == null) { + options = {}; + } + + const passwordBytes = getPassword(password); + const kdf = getEncryptKdfParams(options); + const key = await scrypt( + passwordBytes, + kdf.salt, + kdf.N, + kdf.r, + kdf.p, + 64, + options.progressCallback, + ); + return _encryptKeystore(getBytes(key), kdf, account, options); } diff --git a/src.ts/wallet/mnemonic.ts b/src.ts/wallet/mnemonic.ts index 7077d4d4f..062591793 100644 --- a/src.ts/wallet/mnemonic.ts +++ b/src.ts/wallet/mnemonic.ts @@ -1,10 +1,10 @@ import { - defineProperties, - getBytes, - hexlify, - assertNormalize, - assertPrivate, - assertArgument, + defineProperties, + getBytes, + hexlify, + assertNormalize, + assertPrivate, + assertArgument, } from "../utils/index.js"; import { LangEn } from "../wordlists/lang-en.js"; @@ -15,121 +15,121 @@ import { mnemonicToSeed } from "./mnemonicToSeed.js"; // Returns a byte with the MSB bits set function getUpperMask(bits: number): number { - return (((1 << bits) - 1) << (8 - bits)) & 0xff; + return (((1 << bits) - 1) << (8 - bits)) & 0xff; } // Returns a byte with the LSB bits set function getLowerMask(bits: number): number { - return ((1 << bits) - 1) & 0xff; + return ((1 << bits) - 1) & 0xff; } function mnemonicToEntropy( - mnemonic: string, - wordlist?: null | Wordlist, + mnemonic: string, + wordlist?: null | Wordlist, ): string { - assertNormalize("NFKD"); - - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - - const words = wordlist.split(mnemonic); - assertArgument( - words.length % 3 === 0 && words.length >= 12 && words.length <= 24, - "invalid mnemonic length", - "mnemonic", - "[ REDACTED ]", - ); - - const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8)); - - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - assertArgument( - index >= 0, - `invalid mnemonic word at index ${i}`, - "mnemonic", - "[ REDACTED ]", - ); - - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= 1 << (7 - (offset % 8)); - } - offset++; - } - } - - const entropyBits = (32 * words.length) / 3; - - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - - const checksum = - getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - - assertArgument( - checksum === (entropy[entropy.length - 1] & checksumMask), - "invalid mnemonic checksum", - "mnemonic", - "[ REDACTED ]", - ); - - return hexlify(entropy.slice(0, entropyBits / 8)); + assertNormalize("NFKD"); + + if (wordlist == null) { + wordlist = LangEn.wordlist(); + } + + const words = wordlist.split(mnemonic); + assertArgument( + words.length % 3 === 0 && words.length >= 12 && words.length <= 24, + "invalid mnemonic length", + "mnemonic", + "[ REDACTED ]", + ); + + const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8)); + + let offset = 0; + for (let i = 0; i < words.length; i++) { + let index = wordlist.getWordIndex(words[i].normalize("NFKD")); + assertArgument( + index >= 0, + `invalid mnemonic word at index ${i}`, + "mnemonic", + "[ REDACTED ]", + ); + + for (let bit = 0; bit < 11; bit++) { + if (index & (1 << (10 - bit))) { + entropy[offset >> 3] |= 1 << (7 - (offset % 8)); + } + offset++; + } + } + + const entropyBits = (32 * words.length) / 3; + + const checksumBits = words.length / 3; + const checksumMask = getUpperMask(checksumBits); + + const checksum = + getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; + + assertArgument( + checksum === (entropy[entropy.length - 1] & checksumMask), + "invalid mnemonic checksum", + "mnemonic", + "[ REDACTED ]", + ); + + return hexlify(entropy.slice(0, entropyBits / 8)); } function entropyToMnemonic( - entropy: Uint8Array, - wordlist?: null | Wordlist, + entropy: Uint8Array, + wordlist?: null | Wordlist, ): string { - assertArgument( - entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, - "invalid entropy size", - "entropy", - "[ REDACTED ]", - ); - - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - - const indices: Array = [0]; - - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - - remainingBits -= 8; - - // This byte will complete an 11-bit index - } else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - - remainingBits += 3; - } - } - - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = - parseInt(legacySha256(entropy).substring(2, 4), 16) & - getUpperMask(checksumBits); - - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= checksum >> (8 - checksumBits); - - return wordlist.join( - indices.map((index) => (wordlist).getWord(index)), - ); + assertArgument( + entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, + "invalid entropy size", + "entropy", + "[ REDACTED ]", + ); + + if (wordlist == null) { + wordlist = LangEn.wordlist(); + } + + const indices: Array = [0]; + + let remainingBits = 11; + for (let i = 0; i < entropy.length; i++) { + // Consume the whole byte (with still more to go) + if (remainingBits > 8) { + indices[indices.length - 1] <<= 8; + indices[indices.length - 1] |= entropy[i]; + + remainingBits -= 8; + + // This byte will complete an 11-bit index + } else { + indices[indices.length - 1] <<= remainingBits; + indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); + + // Start the next word + indices.push(entropy[i] & getLowerMask(8 - remainingBits)); + + remainingBits += 3; + } + } + + // Compute the checksum bits + const checksumBits = entropy.length / 4; + const checksum = + parseInt(legacySha256(entropy).substring(2, 4), 16) & + getUpperMask(checksumBits); + + // Shift the checksum into the word indices + indices[indices.length - 1] <<= checksumBits; + indices[indices.length - 1] |= checksum >> (8 - checksumBits); + + return wordlist.join( + indices.map((index) => (wordlist).getWord(index)), + ); } const _guard = {}; @@ -139,122 +139,122 @@ const _guard = {}; * seeds and convert between phrases and entropy. */ export class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - readonly phrase!: string; - - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - readonly password!: string; - - /** - * The wordlist for this mnemonic. - */ - readonly wordlist!: Wordlist; - - /** - * The underlying entropy which the mnemonic encodes. - */ - readonly entropy!: string; - - /** - * @private - */ - constructor( - guard: any, - entropy: string, - phrase: string, - password?: null | string, - wordlist?: null | Wordlist, - ) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - assertPrivate(guard, _guard, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist, entropy }); - } - - /** - * Returns the seed for the mnemonic. - */ - computeSeed(): string { - return mnemonicToSeed(this.phrase, this.password); - } - - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase({ - phrase, - password, - wordlist, - }: { - phrase: string; - password?: null | string; - wordlist?: null | Wordlist; - }): Mnemonic { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(getBytes(entropy), wordlist); - return new Mnemonic(_guard, entropy, phrase, password, wordlist); - } - - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy( - _entropy: BytesLike, - password?: null | string, - wordlist?: null | Wordlist, - ): Mnemonic { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist); - } - - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase( - _entropy: BytesLike, - wordlist?: null | Wordlist, - ): string { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string { - return mnemonicToEntropy(phrase, wordlist); - } - - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } catch (error) {} - return false; - } + /** + * The mnemonic phrase of 12, 15, 18, 21 or 24 words. + * + * Use the [[wordlist]] ``split`` method to get the individual words. + */ + readonly phrase!: string; + + /** + * The password used for this mnemonic. If no password is used this + * is the empty string (i.e. ``""``) as per the specification. + */ + readonly password!: string; + + /** + * The wordlist for this mnemonic. + */ + readonly wordlist!: Wordlist; + + /** + * The underlying entropy which the mnemonic encodes. + */ + readonly entropy!: string; + + /** + * @private + */ + constructor( + guard: any, + entropy: string, + phrase: string, + password?: null | string, + wordlist?: null | Wordlist, + ) { + if (password == null) { + password = ""; + } + if (wordlist == null) { + wordlist = LangEn.wordlist(); + } + assertPrivate(guard, _guard, "Mnemonic"); + defineProperties(this, { phrase, password, wordlist, entropy }); + } + + /** + * Returns the seed for the mnemonic. + */ + computeSeed(): string { + return mnemonicToSeed(this.phrase, this.password); + } + + /** + * Creates a new Mnemonic for the %%phrase%%. + * + * The default %%password%% is the empty string and the default + * wordlist is the [English wordlists](LangEn). + */ + static fromPhrase({ + phrase, + password, + wordlist, + }: { + phrase: string; + password?: null | string; + wordlist?: null | Wordlist; + }): Mnemonic { + // Normalize the case and space; throws if invalid + const entropy = mnemonicToEntropy(phrase, wordlist); + phrase = entropyToMnemonic(getBytes(entropy), wordlist); + return new Mnemonic(_guard, entropy, phrase, password, wordlist); + } + + /** + * Create a new **Mnemonic** from the %%entropy%%. + * + * The default %%password%% is the empty string and the default + * wordlist is the [English wordlists](LangEn). + */ + static fromEntropy( + _entropy: BytesLike, + password?: null | string, + wordlist?: null | Wordlist, + ): Mnemonic { + const entropy = getBytes(_entropy, "entropy"); + const phrase = entropyToMnemonic(entropy, wordlist); + return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist); + } + + /** + * Returns the phrase for %%mnemonic%%. + */ + static entropyToPhrase( + _entropy: BytesLike, + wordlist?: null | Wordlist, + ): string { + const entropy = getBytes(_entropy, "entropy"); + return entropyToMnemonic(entropy, wordlist); + } + + /** + * Returns the entropy for %%phrase%%. + */ + static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string { + return mnemonicToEntropy(phrase, wordlist); + } + + /** + * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. + * + * This checks all the provided words belong to the %%wordlist%%, + * that the length is valid and the checksum is correct. + */ + static isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean { + try { + mnemonicToEntropy(phrase, wordlist); + return true; + } catch (error) {} + return false; + } } diff --git a/src.ts/wallet/mnemonicToSeed.ts b/src.ts/wallet/mnemonicToSeed.ts index a3eb7b42b..1d91027d8 100644 --- a/src.ts/wallet/mnemonicToSeed.ts +++ b/src.ts/wallet/mnemonicToSeed.ts @@ -1,38 +1,39 @@ +import { Buffer } from "buffer"; import { pbkdf2Sync } from "../crypto/crypto.js"; import utf8 from "utf8"; export function mnemonicToSeed(mnemonic: string, password?: string): string { - if (!password) { - password = ""; - } - const t = generateSeed(mnemonic, password); - return t.goldilock; + if (!password) { + password = ""; + } + const t = generateSeed(mnemonic, password); + return t.goldilock; } const generateSeed = (mnemonic: string, password?: string) => { - const goldilockSaltPrefix = "mnemonic"; - const aesSaltPrefix = "mnemonicfortheAESkey"; + const goldilockSaltPrefix = "mnemonic"; + const aesSaltPrefix = "mnemonicfortheAESkey"; - const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); - const aesSalt = utf8.encode(aesSaltPrefix + password); + const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); + const aesSalt = utf8.encode(aesSaltPrefix + password); - const goldilockKey = pbkdf2Sync( - Buffer.from(mnemonic), - goldilockSalt, - 2048, - 64, - "sha512", - ); + const goldilockKey = pbkdf2Sync( + Buffer.from(mnemonic), + Buffer.from(goldilockSalt), + 2048, + 64, + "sha512", + ); - const aesKeySeed = pbkdf2Sync( - Buffer.from(mnemonic), - aesSalt, - 2048, - 64, - "sha512", - ); + const aesKeySeed = pbkdf2Sync( + Buffer.from(mnemonic), + Buffer.from(aesSalt), + 2048, + 64, + "sha512", + ); - return { - aes: aesKeySeed.toString("hex"), - goldilock: goldilockKey.toString("hex"), - }; + return { + aes: Buffer.from(aesKeySeed).toString("hex"), + goldilock: Buffer.from(goldilockKey).toString("hex"), + }; }; diff --git a/src.ts/wallet/utils.ts b/src.ts/wallet/utils.ts index 4d36615e0..03d127d05 100644 --- a/src.ts/wallet/utils.ts +++ b/src.ts/wallet/utils.ts @@ -5,95 +5,95 @@ import { getBytesCopy, assertArgument, toUtf8Bytes } from "../utils/index.js"; export function looseArrayify(hexString: string): Uint8Array { - if (typeof hexString === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return getBytesCopy(hexString); + if (typeof hexString === "string" && !hexString.startsWith("0x")) { + hexString = "0x" + hexString; + } + return getBytesCopy(hexString); } export function zpad(value: String | number, length: number): String { - value = String(value); - while (value.length < length) { - value = "0" + value; - } - return value; + value = String(value); + while (value.length < length) { + value = "0" + value; + } + return value; } export function getPassword(password: string | Uint8Array): Uint8Array { - if (typeof password === "string") { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); + if (typeof password === "string") { + return toUtf8Bytes(password, "NFKC"); + } + return getBytesCopy(password); } export function spelunk(object: any, _path: string): T { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - assertArgument(match != null, "invalid path", "path", _path); - - const path = match[1]; - const type = match[3]; - const reqd = match[4] === "!"; - - let cur = object; - for (const comp of path.toLowerCase().split(".")) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } else if (typeof cur === "object") { - let found: any = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } else { - cur = null; - } - - if (cur == null) { - break; - } - } - - assertArgument(!reqd || cur != null, "missing required value", "path", path); - - if (type && cur != null) { - if (type === "int") { - if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { - return (parseInt(cur)); - } else if (Number.isSafeInteger(cur)) { - return cur; - } - } - - if (type === "number") { - if (typeof cur === "string" && cur.match(/^-?[0-9.]*$/)) { - return (parseFloat(cur)); - } - } - - if (type === "data") { - if (typeof cur === "string") { - return (looseArrayify(cur)); - } - } - - if (type === "array" && Array.isArray(cur)) { - return (cur); - } - if (type === typeof cur) { - return cur; - } - - assertArgument(false, `wrong type found for ${type} `, "path", path); - } - - return cur; + const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); + assertArgument(match != null, "invalid path", "path", _path); + + const path = match[1]; + const type = match[3]; + const reqd = match[4] === "!"; + + let cur = object; + for (const comp of path.toLowerCase().split(".")) { + // Search for a child object with a case-insensitive matching key + if (Array.isArray(cur)) { + if (!comp.match(/^[0-9]+$/)) { + break; + } + cur = cur[parseInt(comp)]; + } else if (typeof cur === "object") { + let found: any = null; + for (const key in cur) { + if (key.toLowerCase() === comp) { + found = cur[key]; + break; + } + } + cur = found; + } else { + cur = null; + } + + if (cur == null) { + break; + } + } + + assertArgument(!reqd || cur != null, "missing required value", "path", path); + + if (type && cur != null) { + if (type === "int") { + if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { + return (parseInt(cur)); + } else if (Number.isSafeInteger(cur)) { + return cur; + } + } + + if (type === "number") { + if (typeof cur === "string" && cur.match(/^-?[0-9.]*$/)) { + return (parseFloat(cur)); + } + } + + if (type === "data") { + if (typeof cur === "string") { + return (looseArrayify(cur)); + } + } + + if (type === "array" && Array.isArray(cur)) { + return (cur); + } + if (type === typeof cur) { + return cur; + } + + assertArgument(false, `wrong type found for ${type} `, "path", path); + } + + return cur; } /* export function follow(object: any, path: string): null | string { diff --git a/src.ts/wallet/wallet.ts b/src.ts/wallet/wallet.ts index c441b4b30..1bade62d7 100644 --- a/src.ts/wallet/wallet.ts +++ b/src.ts/wallet/wallet.ts @@ -5,11 +5,11 @@ import { BaseWallet } from "./base-wallet.js"; import { defaultPath, HDNodeWallet } from "./hdwallet.js"; import { decryptCrowdsaleJson, isCrowdsaleJson } from "./json-crowdsale.js"; import { - decryptKeystoreJson, - decryptKeystoreJsonSync, - encryptKeystoreJson, - encryptKeystoreJsonSync, - isKeystoreJson, + decryptKeystoreJson, + decryptKeystoreJsonSync, + encryptKeystoreJson, + encryptKeystoreJsonSync, + isKeystoreJson, } from "./json-keystore.js"; import { Mnemonic } from "./mnemonic.js"; @@ -21,11 +21,11 @@ import type { KeystoreAccount } from "./json-keystore.js"; import { extractPrefix } from "../transaction/address.js"; function stall(duration: number): Promise { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); + return new Promise((resolve) => { + setTimeout(() => { + resolve(); + }, duration); + }); } /** @@ -39,230 +39,230 @@ function stall(duration: number): Promise { * wallets. */ export class Wallet extends BaseWallet { - /** - * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected - * to %%provider%%. - */ - constructor({ - key, - prefix, - provider, - }: { - key: string | SigningKey; - prefix: string; - provider?: null | Provider; - }) { - if (typeof key === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } + /** + * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected + * to %%provider%%. + */ + constructor({ + key, + prefix, + provider, + }: { + key: string | SigningKey; + prefix: string; + provider?: null | Provider; + }) { + if (typeof key === "string" && !key.startsWith("0x")) { + key = "0x" + key; + } - let signingKey = typeof key === "string" ? new SigningKey(key) : key; - super({ - signingKey, - prefix, - provider, - }); - } + let signingKey = typeof key === "string" ? new SigningKey(key) : key; + super({ + signingKey, + prefix, + provider, + }); + } - connect(provider: null | Provider): Wallet { - return new Wallet({ - key: this.signingKey, - prefix: this.prefix, - provider, - }); - } + connect(provider: null | Provider): Wallet { + return new Wallet({ + key: this.signingKey, + prefix: this.prefix, + provider, + }); + } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt( - password: Uint8Array | string, - progressCallback?: ProgressCallback, - ): Promise { - const account = { address: this.address, privateKey: this.privateKey }; - return await encryptKeystoreJson(account, password, { progressCallback }); - } + /** + * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with + * %%password%%. + * + * If %%progressCallback%% is specified, it will receive periodic + * updates as the encryption process progreses. + */ + async encrypt( + password: Uint8Array | string, + progressCallback?: ProgressCallback, + ): Promise { + const account = { address: this.address, privateKey: this.privateKey }; + return await encryptKeystoreJson(account, password, { progressCallback }); + } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string { - const account = { address: this.address, privateKey: this.privateKey }; - return encryptKeystoreJsonSync(account, password); - } + /** + * Returns a [JSON Keystore Wallet](json-wallets) encryped with + * %%password%%. + * + * It is preferred to use the [async version](encrypt) instead, + * which allows a [[ProgressCallback]] to keep the user informed. + * + * This method will block the event loop (freezing all UI) until + * it is complete, which may be a non-trivial duration. + */ + encryptSync(password: Uint8Array | string): string { + const account = { address: this.address, privateKey: this.privateKey }; + return encryptKeystoreJsonSync(account, password); + } - static #fromAccount( - account: null | CrowdsaleAccount | KeystoreAccount, - ): HDNodeWallet | Wallet { - assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - const address = account.address; - const prefix = extractPrefix(address); - if ( - "mnemonic" in account && - account.mnemonic && - account.mnemonic.locale === "en" - ) { - const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = HDNodeWallet.fromMnemonic( - mnemonic, - prefix, - account.mnemonic.path, - ); - if ( - wallet.address === account.address && - wallet.privateKey === account.privateKey - ) { - return wallet; - } - console.log( - "WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key", - ); - } + static #fromAccount( + account: null | CrowdsaleAccount | KeystoreAccount, + ): HDNodeWallet | Wallet { + assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); + const address = account.address; + const prefix = extractPrefix(address); + if ( + "mnemonic" in account && + account.mnemonic && + account.mnemonic.locale === "en" + ) { + const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); + const wallet = HDNodeWallet.fromMnemonic( + mnemonic, + prefix, + account.mnemonic.path, + ); + if ( + wallet.address === account.address && + wallet.privateKey === account.privateKey + ) { + return wallet; + } + console.log( + "WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key", + ); + } - const wallet = new Wallet({ - key: account.privateKey, - prefix, - }); + const wallet = new Wallet({ + key: account.privateKey, + prefix, + }); - assertArgument( - wallet.address === account.address, - "address/privateKey mismatch", - "json", - "[ REDACTED ]", - ); + assertArgument( + wallet.address === account.address, + "address/privateKey mismatch", + "json", + "[ REDACTED ]", + ); - return wallet; - } + return wallet; + } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson( - json: string, - password: Uint8Array | string, - progress?: ProgressCallback, - ): Promise { - let account: null | CrowdsaleAccount | KeystoreAccount = null; - if (isKeystoreJson(json)) { - account = await decryptKeystoreJson(json, password, progress); - } else if (isCrowdsaleJson(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = decryptCrowdsaleJson(json, password); - if (progress) { - progress(1); - await stall(0); - } - } + /** + * Creates (asynchronously) a **Wallet** by decrypting the %%json%% + * with %%password%%. + * + * If %%progress%% is provided, it is called periodically during + * decryption so that any UI can be updated. + */ + static async fromEncryptedJson( + json: string, + password: Uint8Array | string, + progress?: ProgressCallback, + ): Promise { + let account: null | CrowdsaleAccount | KeystoreAccount = null; + if (isKeystoreJson(json)) { + account = await decryptKeystoreJson(json, password, progress); + } else if (isCrowdsaleJson(json)) { + if (progress) { + progress(0); + await stall(0); + } + account = decryptCrowdsaleJson(json, password); + if (progress) { + progress(1); + await stall(0); + } + } - return Wallet.#fromAccount(account); - } + return Wallet.#fromAccount(account); + } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync( - json: string, - password: Uint8Array | string, - ): HDNodeWallet | Wallet { - let account: null | CrowdsaleAccount | KeystoreAccount = null; - if (isKeystoreJson(json)) { - account = decryptKeystoreJsonSync(json, password); - } else if (isCrowdsaleJson(json)) { - account = decryptCrowdsaleJson(json, password); - } else { - assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } + /** + * Creates a **Wallet** by decrypting the %%json%% with %%password%%. + * + * The [[fromEncryptedJson]] method is preferred, as this method + * will lock up and freeze the UI during decryption, which may take + * some time. + */ + static fromEncryptedJsonSync( + json: string, + password: Uint8Array | string, + ): HDNodeWallet | Wallet { + let account: null | CrowdsaleAccount | KeystoreAccount = null; + if (isKeystoreJson(json)) { + account = decryptKeystoreJsonSync(json, password); + } else if (isCrowdsaleJson(json)) { + account = decryptCrowdsaleJson(json, password); + } else { + assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); + } - return Wallet.#fromAccount(account); - } + return Wallet.#fromAccount(account); + } - /** - * Creates a new random [[HDNodeWallet]] using the avavilable - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom( - prefix: string, - provider?: null | Provider, - ): HDNodeWallet { - const wallet = HDNodeWallet.createRandom( - prefix, - undefined, - undefined, - undefined, - ); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } + /** + * Creates a new random [[HDNodeWallet]] using the avavilable + * [cryptographic random source](randomBytes). + * + * If there is no crytographic random source, this will throw. + */ + static createRandom( + prefix: string, + provider?: null | Provider, + ): HDNodeWallet { + const wallet = HDNodeWallet.createRandom( + prefix, + undefined, + undefined, + undefined, + ); + if (provider) { + return wallet.connect(provider); + } + return wallet; + } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase({ - phrase, - prefix, - provider, - password, - }: { - phrase: string; - prefix: string; - provider?: Provider; - password?: string; - }): HDNodeWallet { - const wallet = HDNodeWallet.fromPhrase({ - phrase, - prefix, - password, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - static fromSeed({ - seed, - prefix, - provider, - path, - }: { - seed: string; - prefix: string; - path?: string; - provider?: Provider; - }): HDNodeWallet { - const wallet = HDNodeWallet.fromSeed({ - seed, - prefix, - path: path || defaultPath, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } + /** + * Creates a [[HDNodeWallet]] for %%phrase%%. + */ + static fromPhrase({ + phrase, + prefix, + provider, + password, + }: { + phrase: string; + prefix: string; + provider?: Provider; + password?: string; + }): HDNodeWallet { + const wallet = HDNodeWallet.fromPhrase({ + phrase, + prefix, + password, + }); + if (provider) { + return wallet.connect(provider); + } + return wallet; + } + static fromSeed({ + seed, + prefix, + provider, + path, + }: { + seed: string; + prefix: string; + path?: string; + provider?: Provider; + }): HDNodeWallet { + const wallet = HDNodeWallet.fromSeed({ + seed, + prefix, + path: path || defaultPath, + }); + if (provider) { + return wallet.connect(provider); + } + return wallet; + } } diff --git a/src.ts/wordlists/bit-reader.ts b/src.ts/wordlists/bit-reader.ts index 3c1f2c878..12b140956 100644 --- a/src.ts/wordlists/bit-reader.ts +++ b/src.ts/wordlists/bit-reader.ts @@ -1,37 +1,37 @@ const Base64 = - ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; + ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; /** * @_ignore */ export function decodeBits(width: number, data: string): Array { - const maxValue = (1 << width) - 1; - const result: Array = []; - let accum = 0, - bits = 0, - flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = (accum << 6) | Base64.indexOf(data[i]); - bits += 6; + const maxValue = (1 << width) - 1; + const result: Array = []; + let accum = 0, + bits = 0, + flood = 0; + for (let i = 0; i < data.length; i++) { + // Accumulate 6 bits of data + accum = (accum << 6) | Base64.indexOf(data[i]); + bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = accum >> (bits - width); - accum &= (1 << (bits - width)) - 1; - bits -= width; + // While we have enough for a word... + while (bits >= width) { + // ...read the word + const value = accum >> (bits - width); + accum &= (1 << (bits - width)) - 1; + bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } else { - result.push(value + flood); - flood = 0; - } - } - } + // A value of 0 indicates we exceeded maxValue, it + // floods over into the next value + if (value === 0) { + flood += maxValue; + } else { + result.push(value + flood); + flood = 0; + } + } + } - return result; + return result; } diff --git a/src.ts/wordlists/decode-owl.ts b/src.ts/wordlists/decode-owl.ts index cbe7e778f..7aa8076ed 100644 --- a/src.ts/wordlists/decode-owl.ts +++ b/src.ts/wordlists/decode-owl.ts @@ -4,64 +4,64 @@ const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; const Word = /^[a-z]*$/i; function unfold(words: Array, sep: string): Array { - let initial = 97; - return words.reduce( - (accum, word) => { - if (word === sep) { - initial++; - } else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } else { - initial = 97; - accum.push(word); - } - return accum; - }, - >[], - ); + let initial = 97; + return words.reduce( + (accum, word) => { + if (word === sep) { + initial++; + } else if (word.match(Word)) { + accum.push(String.fromCharCode(initial) + word); + } else { + initial = 97; + accum.push(word); + } + return accum; + }, + >[], + ); } /** * @_ignore */ export function decode(data: string, subs: string): Array { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } + // Replace all the substitutions with their expanded form + for (let i = subsChrs.length - 1; i >= 0; i--) { + data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); + } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps: Array = []; - const leftover = data.replace( - /(:|([0-9])|([A-Z][a-z]*))/g, - (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } else { - clumps.push(item.toLowerCase()); - } - return ""; - }, - ); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ + // Get all tle clumps; each suffix, first-increment and second-increment + const clumps: Array = []; + const leftover = data.replace( + /(:|([0-9])|([A-Z][a-z]*))/g, + (all, item, semi, word) => { + if (semi) { + for (let i = parseInt(semi); i >= 0; i--) { + clumps.push(";"); + } + } else { + clumps.push(item.toLowerCase()); + } + return ""; + }, + ); + /* c8 ignore start */ + if (leftover) { + throw new Error(`leftovers: ${JSON.stringify(leftover)}`); + } + /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); + return unfold(unfold(clumps, ";"), ":"); } /** * @_ignore */ export function decodeOwl(data: string): Array { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); + assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode( - data.substring(1 + 2 * subsChrs.length), - data.substring(1, 1 + 2 * subsChrs.length), - ); + return decode( + data.substring(1 + 2 * subsChrs.length), + data.substring(1, 1 + 2 * subsChrs.length), + ); } diff --git a/src.ts/wordlists/decode-owla.ts b/src.ts/wordlists/decode-owla.ts index d25432a09..898d51815 100644 --- a/src.ts/wordlists/decode-owla.ts +++ b/src.ts/wordlists/decode-owla.ts @@ -7,31 +7,31 @@ import { decodeOwl } from "./decode-owl.js"; * @_ignore */ export function decodeOwlA(data: string, accents: string): Array { - let words = decodeOwl(data).join(","); + let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument( - match !== null, - "internal error parsing accents", - "accents", - accents, - ); + // Inject the accents + accents.split(/,/g).forEach((accent) => { + const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); + assertArgument( + match !== null, + "internal error parsing accents", + "accents", + accents, + ); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); + let posOffset = 0; + const positions = decodeBits(parseInt(match[3]), match[4]); + const charCode = parseInt(match[2]); + const regex = new RegExp(`([${match[1]}])`, "g"); + words = words.replace(regex, (all, letter) => { + const rem = --positions[posOffset]; + if (rem === 0) { + letter = String.fromCharCode(letter.charCodeAt(0), charCode); + posOffset++; + } + return letter; + }); + }); - return words.split(","); + return words.split(","); } diff --git a/src.ts/wordlists/enwords.ts b/src.ts/wordlists/enwords.ts index 625e42e11..56d99ca5c 100644 --- a/src.ts/wordlists/enwords.ts +++ b/src.ts/wordlists/enwords.ts @@ -1,2 +1,2 @@ export const enWords = - "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; + "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; diff --git a/src.ts/wordlists/generation/encode-latin.ts b/src.ts/wordlists/generation/encode-latin.ts index 399f56b43..24a67af3c 100644 --- a/src.ts/wordlists/generation/encode-latin.ts +++ b/src.ts/wordlists/generation/encode-latin.ts @@ -69,35 +69,35 @@ const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; const Word = /^[a-z'`]*$/i; function fold(words: Array, sep: string): Array { - const output: Array = []; - - let initial = 97; - for (const word of words) { - if (word.match(Word)) { - while (initial < word.charCodeAt(0)) { - initial++; - output.push(sep); - } - output.push(word.substring(1)); - } else { - initial = 97; - output.push(word); - } - } - - return output; + const output: Array = []; + + let initial = 97; + for (const word of words) { + if (word.match(Word)) { + while (initial < word.charCodeAt(0)) { + initial++; + output.push(sep); + } + output.push(word.substring(1)); + } else { + initial = 97; + output.push(word); + } + } + + return output; } function camelcase(words: Array): string { - return words - .map((word) => { - if (word.match(Word)) { - return word[0].toUpperCase() + word.substring(1); - } else { - return word; - } - }) - .join(""); + return words + .map((word) => { + if (word.match(Word)) { + return word[0].toUpperCase() + word.substring(1); + } else { + return word; + } + }) + .join(""); } //let cc = 0, ce = 0; @@ -134,258 +134,258 @@ function mangle(text: string): { word: string, special: string } { */ const Base64 = - ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; + ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; export class BitWriter { - readonly width: number; - readonly #data: Array; - - #bitLength: number; - - constructor(width: number) { - this.width = width; - this.#data = []; - this.#bitLength = 0; - } - - write(value: number): void { - const maxValue = (1 << this.width) - 1; - while (value > maxValue) { - this.#data.push(0); - this.#bitLength += this.width; - value -= maxValue; - } - this.#data.push(value); - this.#bitLength += this.width; - } - - get length(): number { - return 1 + Math.trunc((this.#bitLength + 5) / 6); - } - - get data(): string { - let result = String(this.width); - let bits = 0; - let accum = 0; - - const data = this.#data.slice(); - let bitMod = this.#bitLength % 6; - while (bitMod !== 0 && bitMod < 6) { - data.push(0); - bitMod += this.width; - } - - for (const value of data) { - accum <<= this.width; - accum |= value; - bits += this.width; - - if (bits < 6) { - continue; - } - - result += Base64[accum >> (bits - 6)]; - bits -= 6; - accum &= (1 << bits) - 1; - } - - if (result.length !== this.length) { - throw new Error(`Hmm: ${this.length} ${result.length} ${result}`); - } - return result; - } + readonly width: number; + readonly #data: Array; + + #bitLength: number; + + constructor(width: number) { + this.width = width; + this.#data = []; + this.#bitLength = 0; + } + + write(value: number): void { + const maxValue = (1 << this.width) - 1; + while (value > maxValue) { + this.#data.push(0); + this.#bitLength += this.width; + value -= maxValue; + } + this.#data.push(value); + this.#bitLength += this.width; + } + + get length(): number { + return 1 + Math.trunc((this.#bitLength + 5) / 6); + } + + get data(): string { + let result = String(this.width); + let bits = 0; + let accum = 0; + + const data = this.#data.slice(); + let bitMod = this.#bitLength % 6; + while (bitMod !== 0 && bitMod < 6) { + data.push(0); + bitMod += this.width; + } + + for (const value of data) { + accum <<= this.width; + accum |= value; + bits += this.width; + + if (bits < 6) { + continue; + } + + result += Base64[accum >> (bits - 6)]; + bits -= 6; + accum &= (1 << bits) - 1; + } + + if (result.length !== this.length) { + throw new Error(`Hmm: ${this.length} ${result.length} ${result}`); + } + return result; + } } export interface AccentSet { - accent: number; - follows: string; - positions: Array; - positionsLength: number; - positionData: string; - positionDataLength: number; + accent: number; + follows: string; + positions: Array; + positionsLength: number; + positionData: string; + positionDataLength: number; } function sorted(text: string): string { - const letters = text.split(""); - letters.sort(); - return letters.join(""); + const letters = text.split(""); + letters.sort(); + return letters.join(""); } // if (c.charCodeAt(0) === 768) { return "`"; } // if (c.charCodeAt(0) === 769) { return "'"; } // if (c.charCodeAt(0) === 771) { return "~"; } export function extractAccents(words: Array): { - accents: Array; - words: Array; + accents: Array; + words: Array; } { - // Build a list that maps accents to the letters it can follow - const followsMap: Map = new Map(); - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= "a" && c <= "z") { - continue; - } - - // Make sure this positions and codepoint make sense - if (c.charCodeAt(1)) { - throw new Error(`unsupported codepoint: "${c}"`); - } - if (i === 0) { - throw new Error(`unmatched accent: ${c}`); - } - - const ac = c.charCodeAt(0), - lastLetter = word[i - 1]; - const follows = followsMap.get(ac) || ""; - if (follows.indexOf(lastLetter) === -1) { - followsMap.set(ac, sorted(follows + lastLetter)); - } - } - } - - // Build the positions of each follow-set for those accents - const positionsMap: Map> = new Map(); - for (const [accent, follows] of followsMap) { - let count = 0; - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i], - ac = c.charCodeAt(0); - if (follows.indexOf(c) >= 0) { - count++; - } - if (ac === accent) { - const pos = positionsMap.get(ac) || []; - pos.push(count); - positionsMap.set(ac, pos); - } - } - } - } - - const accents: Array = []; - for (const [accent, follows] of followsMap) { - let last = -1; - const positions = (positionsMap.get(accent) || []).map((value, index) => { - const delta = value - last; - last = value; - if (index === 0) { - return value; - } - return delta; - }); - - // Find the best encoding of the position data - let positionData = ""; - for (let i = 2; i < 7; i++) { - const bitWriter = new BitWriter(i); - for (const p of positions) { - bitWriter.write(p); - } - if (positionData === "" || bitWriter.length < positionData.length) { - positionData = bitWriter.data; - } - } - const positionsLength = positions.length; - const positionDataLength = positionData.length; - - accents.push({ - accent, - follows, - positions, - positionsLength, - positionData, - positionDataLength, - }); - } - - words = words.map((word) => { - let result = ""; - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= "a" && c <= "z") { - result += c; - } - } - return result; - }); - - return { accents, words }; + // Build a list that maps accents to the letters it can follow + const followsMap: Map = new Map(); + for (const word of words) { + for (let i = 0; i < word.length; i++) { + const c = word[i]; + if (c >= "a" && c <= "z") { + continue; + } + + // Make sure this positions and codepoint make sense + if (c.charCodeAt(1)) { + throw new Error(`unsupported codepoint: "${c}"`); + } + if (i === 0) { + throw new Error(`unmatched accent: ${c}`); + } + + const ac = c.charCodeAt(0), + lastLetter = word[i - 1]; + const follows = followsMap.get(ac) || ""; + if (follows.indexOf(lastLetter) === -1) { + followsMap.set(ac, sorted(follows + lastLetter)); + } + } + } + + // Build the positions of each follow-set for those accents + const positionsMap: Map> = new Map(); + for (const [accent, follows] of followsMap) { + let count = 0; + for (const word of words) { + for (let i = 0; i < word.length; i++) { + const c = word[i], + ac = c.charCodeAt(0); + if (follows.indexOf(c) >= 0) { + count++; + } + if (ac === accent) { + const pos = positionsMap.get(ac) || []; + pos.push(count); + positionsMap.set(ac, pos); + } + } + } + } + + const accents: Array = []; + for (const [accent, follows] of followsMap) { + let last = -1; + const positions = (positionsMap.get(accent) || []).map((value, index) => { + const delta = value - last; + last = value; + if (index === 0) { + return value; + } + return delta; + }); + + // Find the best encoding of the position data + let positionData = ""; + for (let i = 2; i < 7; i++) { + const bitWriter = new BitWriter(i); + for (const p of positions) { + bitWriter.write(p); + } + if (positionData === "" || bitWriter.length < positionData.length) { + positionData = bitWriter.data; + } + } + const positionsLength = positions.length; + const positionDataLength = positionData.length; + + accents.push({ + accent, + follows, + positions, + positionsLength, + positionData, + positionDataLength, + }); + } + + words = words.map((word) => { + let result = ""; + for (let i = 0; i < word.length; i++) { + const c = word[i]; + if (c >= "a" && c <= "z") { + result += c; + } + } + return result; + }); + + return { accents, words }; } // Encode Official WordList export function encodeOwl(words: Array): { - subs: string; - data: string; + subs: string; + data: string; } { - // Fold the sorted words by indicating delta for the first 2 letters - let data = camelcase(fold(fold(words, ":"), ";")); - - // Replace semicolons with counts (e.g. ";;;" with "3") - data = data.replace(/(;+)/g, (all, semis) => { - let result = ""; - while (semis.length) { - let count = semis.length; - if (count > 10) { - count = 10; - } - result += String(count - 1); - semis = semis.substring(count); - } - return result; - }); - - // Finds the best option for a shortcut replacement using the - // unused ascii7 characters - function findBest(): string { - const tally: Record = {}; - const l = 2; - for (let i = l; i < data.length; i++) { - const key = data.substring(i - l, i); - tally[key] = (tally[key] || 0) + 1; - } - - const sorted: Array<{ text: string; count: number; save: number }> = - Object.keys(tally).map((text) => { - return { - text, - count: tally[text], - save: tally[text] * (text.length - 1), - }; - }); - sorted.sort((a, b) => b.save - a.save); - - return sorted[0].text; - } - - // Make substitutions - let subs = ""; - for (let i = 0; i < subsChrs.length; i++) { - const n = subsChrs[i], - o = findBest(); - subs += o; - data = data.split(o).join(n); - } - - return { data, subs }; + // Fold the sorted words by indicating delta for the first 2 letters + let data = camelcase(fold(fold(words, ":"), ";")); + + // Replace semicolons with counts (e.g. ";;;" with "3") + data = data.replace(/(;+)/g, (all, semis) => { + let result = ""; + while (semis.length) { + let count = semis.length; + if (count > 10) { + count = 10; + } + result += String(count - 1); + semis = semis.substring(count); + } + return result; + }); + + // Finds the best option for a shortcut replacement using the + // unused ascii7 characters + function findBest(): string { + const tally: Record = {}; + const l = 2; + for (let i = l; i < data.length; i++) { + const key = data.substring(i - l, i); + tally[key] = (tally[key] || 0) + 1; + } + + const sorted: Array<{ text: string; count: number; save: number }> = + Object.keys(tally).map((text) => { + return { + text, + count: tally[text], + save: tally[text] * (text.length - 1), + }; + }); + sorted.sort((a, b) => b.save - a.save); + + return sorted[0].text; + } + + // Make substitutions + let subs = ""; + for (let i = 0; i < subsChrs.length; i++) { + const n = subsChrs[i], + o = findBest(); + subs += o; + data = data.split(o).join(n); + } + + return { data, subs }; } // Returns either: // - OWL data for accent-free latin-1: { data, accentds: "" } // - OWLA data for accented latin-1: { data, accents } function encodeWords(_words: Array): { data: string; accents: string } { - const { accents, words } = extractAccents(_words); - const { data, subs } = encodeOwl(words); - const accentData = accents - .map(({ accent, follows, positionData }) => { - return `${follows}${accent}${positionData}`; - }) - .join(","); - - return { - data: `0${subs}${data}`, - accents: accentData, - }; + const { accents, words } = extractAccents(_words); + const { data, subs } = encodeOwl(words); + const accentData = accents + .map(({ accent, follows, positionData }) => { + return `${follows}${accent}${positionData}`; + }) + .join(","); + + return { + data: `0${subs}${data}`, + accents: accentData, + }; } // CLI @@ -394,28 +394,28 @@ const words = content.split("\n").filter(Boolean); const { data, accents } = encodeWords(words); if (accents) { - const rec = decodeOwlA(data, accents); - console.log("DATA: ", JSON.stringify(data)); - console.log("ACCENTS: ", JSON.stringify(accents)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id(content)); - console.log( - "RATIO: ", - Math.trunc((100 * data.length) / content.length) + "%", - ); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } + const rec = decodeOwlA(data, accents); + console.log("DATA: ", JSON.stringify(data)); + console.log("ACCENTS: ", JSON.stringify(accents)); + console.log("LENGTH: ", data.length); + console.log("CHECKSUM: ", id(content)); + console.log( + "RATIO: ", + Math.trunc((100 * data.length) / content.length) + "%", + ); + if (rec.join("\n") !== words.join("\n")) { + throw new Error("no match!"); + } } else { - const rec = decodeOwl(data); - console.log("DATA: ", JSON.stringify(data)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id(content)); - console.log( - "RATIO: ", - Math.trunc((100 * data.length) / content.length) + "%", - ); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } + const rec = decodeOwl(data); + console.log("DATA: ", JSON.stringify(data)); + console.log("LENGTH: ", data.length); + console.log("CHECKSUM: ", id(content)); + console.log( + "RATIO: ", + Math.trunc((100 * data.length) / content.length) + "%", + ); + if (rec.join("\n") !== words.join("\n")) { + throw new Error("no match!"); + } } diff --git a/src.ts/wordlists/lang-cz.ts b/src.ts/wordlists/lang-cz.ts index 9bc2a267f..d21e1d9f4 100644 --- a/src.ts/wordlists/lang-cz.ts +++ b/src.ts/wordlists/lang-cz.ts @@ -1,9 +1,9 @@ import { WordlistOwl } from "./wordlist-owl.js"; const words = - "0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Y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ps!Raz S)v Su~Taj Temn Tk~Ujm=Val Ve+tVin Vol!Vrt!Zvon 0Av RusuUd|Yt-1A+#ArmaAtn(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk"; const checksum = - "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; + "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; let wordlist: null | LangCz = null; @@ -13,26 +13,26 @@ let wordlist: null | LangCz = null; * @_docloc: api/wordlists */ export class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor() { - super("cz", words, checksum); - } + /** + * Creates a new instance of the Czech language Wordlist. + * + * Using the constructor should be unnecessary, instead use the + * [[wordlist]] singleton method. + * + * @_ignore: + */ + constructor() { + super("cz", words, checksum); + } - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist(): LangCz { - if (wordlist == null) { - wordlist = new LangCz(); - } - return wordlist; - } + /** + * Returns a singleton instance of a ``LangCz``, creating it + * if this is the first time being called. + */ + static wordlist(): LangCz { + if (wordlist == null) { + wordlist = new LangCz(); + } + return wordlist; + } } diff --git a/src.ts/wordlists/lang-en.ts b/src.ts/wordlists/lang-en.ts index d92f35c56..d2d81de09 100644 --- a/src.ts/wordlists/lang-en.ts +++ b/src.ts/wordlists/lang-en.ts @@ -1,9 +1,9 @@ import { WordlistOwl } from "./wordlist-owl.js"; const words = - "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>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>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; + "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySo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?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; const checksum = - "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; + "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; let wordlist: null | LangEn = null; @@ -13,26 +13,26 @@ let wordlist: null | LangEn = null; * @_docloc: api/wordlists */ export class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { - super("en", words, checksum); - } + /** + * Creates a new instance of the English language Wordlist. + * + * This should be unnecessary most of the time as the exported + * [[langEn]] should suffice. + * + * @_ignore: + */ + constructor() { + super("en", words, checksum); + } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEn { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } + /** + * Returns a singleton instance of a ``LangEn``, creating it + * if this is the first time being called. + */ + static wordlist(): LangEn { + if (wordlist == null) { + wordlist = new LangEn(); + } + return wordlist; + } } diff --git a/src.ts/wordlists/lang-es.ts b/src.ts/wordlists/lang-es.ts index 31eba917a..d40c98ab7 100644 --- a/src.ts/wordlists/lang-es.ts +++ b/src.ts/wordlists/lang-es.ts @@ -1,11 +1,11 @@ import { WordlistOwlA } from "./wordlist-owla.js"; const words = - "0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZo3Bol]D!D+Ld/eb_LoAmpuAnc]ApaAr]I>Is)IvoOqueOzaUle%Up 0Cl.EgoE=EnEr#F[G +M->NeN%P_sR>Rue]SneTaU{d2Am^AnA+AseAveI,)ImaInica2B_Cc~|i'Ci`CoDigoDoF_G!He)JinJoL/ch/eg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'C]r(C?,Da,Ffi|G$Ld#L[M`NdaNe|Nnife)Pi!Ppe(P-Rge!Rpas(Rri(R(R.gg'R_l#Spi)S+T^,0AdaAl/Arge!A /Av[ Azzo/EcieEdi!EgRappoReg#Ridu*Rozz&Ru|Ucc&UfoUp[@0B[t)C](Do!Gger{GoL+$On&PerboPpor Rgel#R)g#Ssur)Tu-0Ag&EdeseEgl'El&Enu Ez?IluppoIs+Izze-Ol+Uot&:Bac]Bul#Cci&Citur$LeLis`$MpoVer=Vo/+Zza3CaCn>Lefo$Me-r'MpoMu N@Pog-foRagg'RoTan'To*Tuban.Z'Zzo<5Cc&L,r&L Mbo/MoNfoNsil/Paz'Po*g?PpaRbaRn&R)L,t+Lo)(Lut&L_/Mpa+Ng&N{(NoN+gg'Nve-Po!Ra$Rc#R?n.S}3Det+DovaDu Ge+,I]*Lc)Li=Llu LoceN#Ndemm?N RaceRba,Rgog=Rif~RoRru}Rt~,Sc~Ssil*S+,Te-$Tri=Tus 3Andan.B-n.C[daChingoCi=nzaDim&Gil?G< Go!LeL/$MiniNc{!O/Pe-Rgo/Ro*goRu,n S](S'5Cche)Fo*LuPpa"; const checksum = - "0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620"; + "0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620"; let wordlist: null | LangIt = null; @@ -13,26 +13,26 @@ let wordlist: null | LangIt = null; * @_docloc: api/wordlists */ export class LangIt extends WordlistOwl { - /** - * Creates a new instance of the Italian language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langIt]] should suffice. - * - * @_ignore: - */ - constructor() { - super("it", words, checksum); - } + /** + * Creates a new instance of the Italian language Wordlist. + * + * This should be unnecessary most of the time as the exported + * [[langIt]] should suffice. + * + * @_ignore: + */ + constructor() { + super("it", words, checksum); + } - /** - * Returns a singleton instance of a ``LangIt``, creating it - * if this is the first time being called. - */ - static wordlist(): LangIt { - if (wordlist == null) { - wordlist = new LangIt(); - } - return wordlist; - } + /** + * Returns a singleton instance of a ``LangIt``, creating it + * if this is the first time being called. + */ + static wordlist(): LangIt { + if (wordlist == null) { + wordlist = new LangIt(); + } + return wordlist; + } } diff --git a/src.ts/wordlists/lang-ja.ts b/src.ts/wordlists/lang-ja.ts index 097bd91d2..50823e73e 100644 --- a/src.ts/wordlists/lang-ja.ts +++ b/src.ts/wordlists/lang-ja.ts @@ -1,148 +1,148 @@ import { id } from "../hash/index.js"; import { - hexlify, - assertArgument, - toUtf8Bytes, - toUtf8String, + hexlify, + assertArgument, + toUtf8Bytes, + toUtf8String, } from "../utils/index.js"; import { Wordlist } from "./wordlist.js"; const data = [ - // 4-kana words - "AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQCXQCDQGBQGDQGdQYXQpBQpQQpHQLXQHuQgBQhBQhCQuFQmXQiDQUFQZDQsFQdRQkHQbRQlOQlmQPDQjDQwXQMBQMDQcFQTBQTHQrDDXQDNFDGBDGQDGRDpFDhFDmXDZXDbRDMYDRdDTRDrXSAhSBCSBrSGQSEQSHBSVRShYShkSyQSuFSiBSdcSoESocSlmSMBSFBSFKSFNSFdSFcCByCaRCKcCSBCSRCCrCGbCEHCYXCpBCpQCIBCIHCeNCgBCgFCVECVcCmkCmwCZXCZFCdRClOClmClFCjDCjdCnXCwBCwXCcRCFQCFjGXhGNhGDEGDMGCDGCHG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GJBSJFGJBOfXGJBcqXGJHNJDGJRLiJEJfXEqEJFEJPEFpBEJYJBZJFYBwXUJYiJMEBYJZJyTYTONJXpQMFXFpeGIDdpJFstXpJFcPDLBVSJRLHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC", - // 8-kana words - "BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD", + // 8-kana words + "BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD", - // 9-kana words - "QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD", + // 9-kana words + "QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD", - // 10-kana words - "IJBEJqXZJ", + // 10-kana words + "IJBEJqXZJ", ]; // Maps each character into its kana value (the index) const mapping = - "~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt"; + "~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt"; let _wordlist: null | Array = null; function hex(word: string): string { - return hexlify(toUtf8Bytes(word)); + return hexlify(toUtf8Bytes(word)); } const KiYoKu = "0xe3818de38284e3818f"; const KyoKu = "0xe3818de38283e3818f"; function toString(data: Array): string { - return toUtf8String(new Uint8Array(data)); + return toUtf8String(new Uint8Array(data)); } function loadWords(): Array { - if (_wordlist !== null) { - return _wordlist; - } - - const wordlist = []; - - // Transforms for normalizing (sort is a not quite UTF-8) - const transform: { [key: string]: string | boolean } = {}; - - // Delete the diacritic marks - transform[toString([227, 130, 154])] = false; - transform[toString([227, 130, 153])] = false; - - // Some simple transforms that sort out most of the order - transform[toString([227, 130, 133])] = toString([227, 130, 134]); - transform[toString([227, 129, 163])] = toString([227, 129, 164]); - transform[toString([227, 130, 131])] = toString([227, 130, 132]); - transform[toString([227, 130, 135])] = toString([227, 130, 136]); - - // Normalize words using the transform - function normalize(word: string) { - let result = ""; - for (let i = 0; i < word.length; i++) { - let kana = word[i]; - const target = transform[kana]; - if (target === false) { - continue; - } - if (target) { - kana = target; - } - result += kana; - } - return result; - } - - // Sort how the Japanese list is sorted - function sortJapanese(a: string, b: string) { - a = normalize(a); - b = normalize(b); - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; - } - - // Load all the words - for (let length = 3; length <= 9; length++) { - const d = data[length - 3]; - for (let offset = 0; offset < d.length; offset += length) { - const word = []; - for (let i = 0; i < length; i++) { - const k = mapping.indexOf(d[offset + i]); - word.push(227); - word.push(k & 0x40 ? 130 : 129); - word.push((k & 0x3f) + 128); - } - wordlist.push(toString(word)); - } - } - wordlist.sort(sortJapanese); - - // For some reason kyoku and kiyoku are flipped in node (!!). - // The order SHOULD be: - // - kyoku - // - kiyoku - - // This should ignore "if", but that doesn't work here?? - /* c8 ignore start */ - if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) { - const tmp = wordlist[442]; - wordlist[442] = wordlist[443]; - wordlist[443] = tmp; - } - /* c8 ignore stop */ - - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if ( - checksum !== - "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600" - ) { - throw new Error("BIP39 Wordlist for ja (Japanese) FAILED"); - } - /* c8 ignore stop */ - - _wordlist = wordlist; - - return wordlist; + if (_wordlist !== null) { + return _wordlist; + } + + const wordlist = []; + + // Transforms for normalizing (sort is a not quite UTF-8) + const transform: { [key: string]: string | boolean } = {}; + + // Delete the diacritic marks + transform[toString([227, 130, 154])] = false; + transform[toString([227, 130, 153])] = false; + + // Some simple transforms that sort out most of the order + transform[toString([227, 130, 133])] = toString([227, 130, 134]); + transform[toString([227, 129, 163])] = toString([227, 129, 164]); + transform[toString([227, 130, 131])] = toString([227, 130, 132]); + transform[toString([227, 130, 135])] = toString([227, 130, 136]); + + // Normalize words using the transform + function normalize(word: string) { + let result = ""; + for (let i = 0; i < word.length; i++) { + let kana = word[i]; + const target = transform[kana]; + if (target === false) { + continue; + } + if (target) { + kana = target; + } + result += kana; + } + return result; + } + + // Sort how the Japanese list is sorted + function sortJapanese(a: string, b: string) { + a = normalize(a); + b = normalize(b); + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + return 0; + } + + // Load all the words + for (let length = 3; length <= 9; length++) { + const d = data[length - 3]; + for (let offset = 0; offset < d.length; offset += length) { + const word = []; + for (let i = 0; i < length; i++) { + const k = mapping.indexOf(d[offset + i]); + word.push(227); + word.push(k & 0x40 ? 130 : 129); + word.push((k & 0x3f) + 128); + } + wordlist.push(toString(word)); + } + } + wordlist.sort(sortJapanese); + + // For some reason kyoku and kiyoku are flipped in node (!!). + // The order SHOULD be: + // - kyoku + // - kiyoku + + // This should ignore "if", but that doesn't work here?? + /* c8 ignore start */ + if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) { + const tmp = wordlist[442]; + wordlist[442] = wordlist[443]; + wordlist[443] = tmp; + } + /* c8 ignore stop */ + + // Verify the computed list matches the official list + /* istanbul ignore if */ + const checksum = id(wordlist.join("\n") + "\n"); + /* c8 ignore start */ + if ( + checksum !== + "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600" + ) { + throw new Error("BIP39 Wordlist for ja (Japanese) FAILED"); + } + /* c8 ignore stop */ + + _wordlist = wordlist; + + return wordlist; } let wordlist: null | LangJa = null; @@ -153,50 +153,50 @@ let wordlist: null | LangJa = null; * @_docloc: api/wordlists */ export class LangJa extends Wordlist { - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ja"); - } - - getWord(index: number): string { - const words = loadWords(); - assertArgument( - index >= 0 && index < words.length, - `invalid word index: ${index}`, - "index", - index, - ); - return words[index]; - } - - getWordIndex(word: string): number { - return loadWords().indexOf(word); - } - - split(phrase: string): Array { - //logger.assertNormalize(); - return phrase.split(/(?:\u3000| )+/g); - } - - join(words: Array): string { - return words.join("\u3000"); - } - - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist(): LangJa { - if (wordlist == null) { - wordlist = new LangJa(); - } - return wordlist; - } + /** + * Creates a new instance of the Japanese language Wordlist. + * + * This should be unnecessary most of the time as the exported + * [[langJa]] should suffice. + * + * @_ignore: + */ + constructor() { + super("ja"); + } + + getWord(index: number): string { + const words = loadWords(); + assertArgument( + index >= 0 && index < words.length, + `invalid word index: ${index}`, + "index", + index, + ); + return words[index]; + } + + getWordIndex(word: string): number { + return loadWords().indexOf(word); + } + + split(phrase: string): Array { + //logger.assertNormalize(); + return phrase.split(/(?:\u3000| )+/g); + } + + join(words: Array): string { + return words.join("\u3000"); + } + + /** + * Returns a singleton instance of a ``LangJa``, creating it + * if this is the first time being called. + */ + static wordlist(): LangJa { + if (wordlist == null) { + wordlist = new LangJa(); + } + return wordlist; + } } diff --git a/src.ts/wordlists/lang-ko.ts b/src.ts/wordlists/lang-ko.ts index 476c8bdcc..6b8faf611 100644 --- a/src.ts/wordlists/lang-ko.ts +++ b/src.ts/wordlists/lang-ko.ts @@ -4,68 +4,68 @@ import { assertArgument, toUtf8String } from "../utils/index.js"; import { Wordlist } from "./wordlist.js"; const data = [ - "OYAa", - "ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrGgAlrOXAlvKnAlvMTAl3AbAl3MnAnATrAnAcrAnCZ3AnCl8A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MXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg", + "HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb", + "AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl", ]; const codes = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"; + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"; function getHangul(code: number): string { - if (code >= 40) { - code = code + 168 - 40; - } else if (code >= 19) { - code = code + 97 - 19; - } - - return toUtf8String( - new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128]), - ); + if (code >= 40) { + code = code + 168 - 40; + } else if (code >= 19) { + code = code + 97 - 19; + } + + return toUtf8String( + new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128]), + ); } let _wordlist: null | Array = null; function loadWords(): Array { - if (_wordlist != null) { - return _wordlist; - } - - const wordlist: Array = []; - - data.forEach((data, length) => { - length += 4; - for (let i = 0; i < data.length; i += length) { - let word = ""; - for (let j = 0; j < length; j++) { - word += getHangul(codes.indexOf(data[i + j])); - } - wordlist.push(word); - } - }); - - wordlist.sort(); - - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if ( - checksum !== - "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a" - ) { - throw new Error("BIP39 Wordlist for ko (Korean) FAILED"); - } - /* c8 ignore stop */ - - _wordlist = wordlist; - - return wordlist; + if (_wordlist != null) { + return _wordlist; + } + + const wordlist: Array = []; + + data.forEach((data, length) => { + length += 4; + for (let i = 0; i < data.length; i += length) { + let word = ""; + for (let j = 0; j < length; j++) { + word += getHangul(codes.indexOf(data[i + j])); + } + wordlist.push(word); + } + }); + + wordlist.sort(); + + // Verify the computed list matches the official list + /* istanbul ignore if */ + const checksum = id(wordlist.join("\n") + "\n"); + /* c8 ignore start */ + if ( + checksum !== + "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a" + ) { + throw new Error("BIP39 Wordlist for ko (Korean) FAILED"); + } + /* c8 ignore stop */ + + _wordlist = wordlist; + + return wordlist; } let wordlist: null | LangKo = null; @@ -76,41 +76,41 @@ let wordlist: null | LangKo = null; * @_docloc: api/wordlists */ export class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ko"); - } - - getWord(index: number): string { - const words = loadWords(); - assertArgument( - index >= 0 && index < words.length, - `invalid word index: ${index}`, - "index", - index, - ); - return words[index]; - } - - getWordIndex(word: string): number { - return loadWords().indexOf(word); - } - - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist(): LangKo { - if (wordlist == null) { - wordlist = new LangKo(); - } - return wordlist; - } + /** + * Creates a new instance of the Korean language Wordlist. + * + * This should be unnecessary most of the time as the exported + * [[langKo]] should suffice. + * + * @_ignore: + */ + constructor() { + super("ko"); + } + + getWord(index: number): string { + const words = loadWords(); + assertArgument( + index >= 0 && index < words.length, + `invalid word index: ${index}`, + "index", + index, + ); + return words[index]; + } + + getWordIndex(word: string): number { + return loadWords().indexOf(word); + } + + /** + * Returns a singleton instance of a ``LangKo``, creating it + * if this is the first time being called. + */ + static wordlist(): LangKo { + if (wordlist == null) { + wordlist = new LangKo(); + } + return wordlist; + } } diff --git a/src.ts/wordlists/lang-pt.ts b/src.ts/wordlists/lang-pt.ts index 386789a3b..c58ee8e05 100644 --- a/src.ts/wordlists/lang-pt.ts +++ b/src.ts/wordlists/lang-pt.ts @@ -1,9 +1,9 @@ import { WordlistOwl } from "./wordlist-owl.js"; const words = - "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi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seN$ni>-eRiTu#5B(fis)Rp[s>[&Rt'Sp'oS%n$:B`aBle%Bu^C/G `aLh(LoLvezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi="; + "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi?PoQue%lRagemRdi&Rne)R}h>p|&R[ioR%joRuj>voSs-oS%laT}e%U_UveVilZ*]2A%+AvoEcheE=rEmeErEspoI^Im*&Io~oIseItic Os)UaUz{o2B+m SafioSbo.Sc<,S-/Sfi#Sgas%Sigu&SlizeSmam SovaSpesaS)queSvi T&h T-$rT} Tri$UsaV(Vi=Vot#Z-a3Ag+maAle$Da)Fu,Gi.Lat#Lu-%M*u'Nast@Nh{oOceseRe$Sc[)Sf ceSp oSque%Ssip S)n%T?UrnoV(,Vi,rV~g Z(5Br?L|i=M?M*#NativoNz`>m-%Rs&SagemUr#U$r2EnagemIbleOg @2El EndeE$PloQues><%Vi=,:1Lod'O Olog@0Ific It&Uc#1Ei$Etiv 3E.1Ab| Eg(Ei$rEncoEv?Im* Ogi 0B goBol#Br~/Buti=EndaErg'Is,rPat@P-/P*#Polg P[goPurr Ul?0CaixeC-#Ch-%C}t_Deus Doss Faix Fei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ceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi="; const checksum = - "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; + "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; let wordlist: null | LangPt = null; @@ -13,26 +13,26 @@ let wordlist: null | LangPt = null; * @_docloc: api/wordlists */ export class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor() { - super("pt", words, checksum); - } + /** + * Creates a new instance of the Portuguese language Wordlist. + * + * This should be unnecessary most of the time as the exported + * [[langPt]] should suffice. + * + * @_ignore: + */ + constructor() { + super("pt", words, checksum); + } - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist(): LangPt { - if (wordlist == null) { - wordlist = new LangPt(); - } - return wordlist; - } + /** + * Returns a singleton instance of a ``LangPt``, creating it + * if this is the first time being called. + */ + static wordlist(): LangPt { + if (wordlist == null) { + wordlist = new LangPt(); + } + return wordlist; + } } diff --git a/src.ts/wordlists/lang-zh.ts b/src.ts/wordlists/lang-zh.ts index bb2c32343..70802317f 100644 --- a/src.ts/wordlists/lang-zh.ts +++ b/src.ts/wordlists/lang-zh.ts @@ -4,62 +4,62 @@ import { assertArgument, toUtf8String } from "../utils/index.js"; import { Wordlist } from "./wordlist.js"; const data = - "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN> = { - zh_cn: null, - zh_tw: null, + zh_cn: null, + zh_tw: null, }; const Checks: Record = { - zh_cn: "0x17bcc4d8547e5a7135e365d1ab443aaae95e76d8230c2782c67305d4f21497a1", - zh_tw: "0x51e720e90c7b87bec1d70eb6e74a21a449bd3ec9c020b01d3a40ed991b60ce5d", + zh_cn: "0x17bcc4d8547e5a7135e365d1ab443aaae95e76d8230c2782c67305d4f21497a1", + zh_tw: "0x51e720e90c7b87bec1d70eb6e74a21a449bd3ec9c020b01d3a40ed991b60ce5d", }; const codes = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; const style = "~!@#$%^&*_-=[]{}|;:,.()<>?"; function loadWords(locale: string): Array { - if (_wordlist[locale] != null) { - return _wordlist[locale] as Array; - } - - const wordlist = []; - - let deltaOffset = 0; - for (let i = 0; i < 2048; i++) { - const s = style.indexOf(data[i * 3]); - const bytes = [ - 228 + (s >> 2), - 128 + codes.indexOf(data[i * 3 + 1]), - 128 + codes.indexOf(data[i * 3 + 2]), - ]; - - if (locale === "zh_tw") { - const common = s % 4; - for (let i = common; i < 3; i++) { - bytes[i] = - codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128); - } - } - - wordlist.push(toUtf8String(new Uint8Array(bytes))); - } - - // Verify the computed list matches the official list - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== Checks[locale]) { - throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`); - } - /* c8 ignore stop */ - - _wordlist[locale] = wordlist; - - return wordlist; + if (_wordlist[locale] != null) { + return _wordlist[locale] as Array; + } + + const wordlist = []; + + let deltaOffset = 0; + for (let i = 0; i < 2048; i++) { + const s = style.indexOf(data[i * 3]); + const bytes = [ + 228 + (s >> 2), + 128 + codes.indexOf(data[i * 3 + 1]), + 128 + codes.indexOf(data[i * 3 + 2]), + ]; + + if (locale === "zh_tw") { + const common = s % 4; + for (let i = common; i < 3; i++) { + bytes[i] = + codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128); + } + } + + wordlist.push(toUtf8String(new Uint8Array(bytes))); + } + + // Verify the computed list matches the official list + const checksum = id(wordlist.join("\n") + "\n"); + /* c8 ignore start */ + if (checksum !== Checks[locale]) { + throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`); + } + /* c8 ignore stop */ + + _wordlist[locale] = wordlist; + + return wordlist; } const wordlists: Record = {}; @@ -71,51 +71,51 @@ const wordlists: Record = {}; * @_docloc: api/wordlists */ export class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect: string) { - super("zh_" + dialect); - } - - getWord(index: number): string { - const words = loadWords(this.locale); - assertArgument( - index >= 0 && index < words.length, - `invalid word index: ${index}`, - "index", - index, - ); - return words[index]; - } - - getWordIndex(word: string): number { - return loadWords(this.locale).indexOf(word); - } - - split(phrase: string): Array { - phrase = phrase.replace(/(?:\u3000| )+/g, ""); - return phrase.split(""); - } - - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect: string): LangZh { - if (wordlists[dialect] == null) { - wordlists[dialect] = new LangZh(dialect); - } - return wordlists[dialect]; - } + /** + * Creates a new instance of the Chinese language Wordlist for + * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified + * or traditional, respectively. + * + * This should be unnecessary most of the time as the exported + * [[langZhCn]] and [[langZhTw]] should suffice. + * + * @_ignore: + */ + constructor(dialect: string) { + super("zh_" + dialect); + } + + getWord(index: number): string { + const words = loadWords(this.locale); + assertArgument( + index >= 0 && index < words.length, + `invalid word index: ${index}`, + "index", + index, + ); + return words[index]; + } + + getWordIndex(word: string): number { + return loadWords(this.locale).indexOf(word); + } + + split(phrase: string): Array { + phrase = phrase.replace(/(?:\u3000| )+/g, ""); + return phrase.split(""); + } + + /** + * Returns a singleton instance of a ``LangZh`` for %%dialect%%, + * creating it if this is the first time being called. + * + * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or + * traditional, respectively. + */ + static wordlist(dialect: string): LangZh { + if (wordlists[dialect] == null) { + wordlists[dialect] = new LangZh(dialect); + } + return wordlists[dialect]; + } } diff --git a/src.ts/wordlists/wordlist-owl.ts b/src.ts/wordlists/wordlist-owl.ts index 3336472a9..72de7103d 100644 --- a/src.ts/wordlists/wordlist-owl.ts +++ b/src.ts/wordlists/wordlist-owl.ts @@ -20,58 +20,58 @@ import { Wordlist } from "./wordlist.js"; * to create these necessary data. */ export class WordlistOwl extends Wordlist { - #data: string; - #checksum: string; + #data: string; + #checksum: string; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, checksum: string) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } + /** + * Creates a new Wordlist for %%locale%% using the OWL %%data%% + * and validated against the %%checksum%%. + */ + constructor(locale: string, data: string, checksum: string) { + super(locale); + this.#data = data; + this.#checksum = checksum; + this.#words = null; + } - get _data(): string { - return this.#data; - } + get _data(): string { + return this.#data; + } - _decodeWords(): Array { - return decodeOwl(this.#data); - } + _decodeWords(): Array { + return decodeOwl(this.#data); + } - #words: null | Array; - #loadWords(): Array { - if (this.#words == null) { - const words = this._decodeWords(); + #words: null | Array; + #loadWords(): Array { + if (this.#words == null) { + const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n", true); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); - } - /* c8 ignore stop */ + // Verify the computed list matches the official list + const checksum = id(words.join("\n") + "\n", true); + /* c8 ignore start */ + if (checksum !== this.#checksum) { + throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); + } + /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } + this.#words = words; + } + return this.#words; + } - getWord(index: number): string { - const words = this.#loadWords(); - assertArgument( - index >= 0 && index < words.length, - `invalid word index: ${index}`, - "index", - index, - ); - return words[index]; - } + getWord(index: number): string { + const words = this.#loadWords(); + assertArgument( + index >= 0 && index < words.length, + `invalid word index: ${index}`, + "index", + index, + ); + return words[index]; + } - getWordIndex(word: string): number { - return this.#loadWords().indexOf(word); - } + getWordIndex(word: string): number { + return this.#loadWords().indexOf(word); + } } diff --git a/src.ts/wordlists/wordlist-owla.ts b/src.ts/wordlists/wordlist-owla.ts index b1ff8ee67..44b939a93 100644 --- a/src.ts/wordlists/wordlist-owla.ts +++ b/src.ts/wordlists/wordlist-owla.ts @@ -14,18 +14,18 @@ import { decodeOwlA } from "./decode-owla.js"; * to create these necessary data. */ export class WordlistOwlA extends WordlistOwl { - #accent: string; + #accent: string; - constructor(locale: string, data: string, accent: string, checksum: string) { - super(locale, data, checksum); - this.#accent = accent; - } + constructor(locale: string, data: string, accent: string, checksum: string) { + super(locale, data, checksum); + this.#accent = accent; + } - get _accent(): string { - return this.#accent; - } + get _accent(): string { + return this.#accent; + } - _decodeWords(): Array { - return decodeOwlA(this._data, this._accent); - } + _decodeWords(): Array { + return decodeOwlA(this._data, this._accent); + } } diff --git a/src.ts/wordlists/wordlist.ts b/src.ts/wordlists/wordlist.ts index f1e8276db..c5da15702 100644 --- a/src.ts/wordlists/wordlist.ts +++ b/src.ts/wordlists/wordlist.ts @@ -7,66 +7,66 @@ import { defineProperties } from "../utils/index.js"; * by mapping words to 11-bit values and vice versa. */ export abstract class Wordlist { - locale!: string; + locale!: string; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale: string) { - defineProperties(this, { locale }); - } + /** + * Creates a new Wordlist instance. + * + * Sub-classes MUST call this if they provide their own constructor, + * passing in the locale string of the language. + * + * Generally there is no need to create instances of a Wordlist, + * since each language-specific Wordlist creates an instance and + * there is no state kept internally, so they are safe to share. + */ + constructor(locale: string) { + defineProperties(this, { locale }); + } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase: string): Array { - return phrase.toLowerCase().split(/\s+/g); - } + /** + * Sub-classes may override this to provide a language-specific + * method for spliting %%phrase%% into individual words. + * + * By default, %%phrase%% is split using any sequences of + * white-space as defined by regular expressions (i.e. ``/\s+/``). + */ + split(phrase: string): Array { + return phrase.toLowerCase().split(/\s+/g); + } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words: Array): string { - return words.join(" "); - } + /** + * Sub-classes may override this to provider a language-specific + * method for joining %%words%% into a phrase. + * + * By default, %%words%% are joined by a single space. + */ + join(words: Array): string { + return words.join(" "); + } - /** - * Maps an 11-bit value into its coresponding word in the list. - * - * Sub-classes MUST override this. - */ - abstract getWord(index: number): string; + /** + * Maps an 11-bit value into its coresponding word in the list. + * + * Sub-classes MUST override this. + */ + abstract getWord(index: number): string; - /** - * Maps a word to its corresponding 11-bit value. - * - * Sub-classes MUST override this. - */ - abstract getWordIndex(word: string): number; - static check(wordlist: Wordlist): string { - const words: string[] = []; - for (let i = 0; i < 2048; i++) { - const word = wordlist.getWord(i); - /* istanbul ignore if */ - if (i !== wordlist.getWordIndex(word)) { - return "0x"; - } - words.push(word); - } - return id(words.join("\n") + "\n"); - } + /** + * Maps a word to its corresponding 11-bit value. + * + * Sub-classes MUST override this. + */ + abstract getWordIndex(word: string): number; + static check(wordlist: Wordlist): string { + const words: string[] = []; + for (let i = 0; i < 2048; i++) { + const word = wordlist.getWord(i); + /* istanbul ignore if */ + if (i !== wordlist.getWordIndex(word)) { + return "0x"; + } + words.push(word); + } + return id(words.join("\n") + "\n"); + } } diff --git a/src.ts/wordlists/wordlists-browser.ts b/src.ts/wordlists/wordlists-browser.ts index 3b01ba2fa..f5b3d357f 100644 --- a/src.ts/wordlists/wordlists-browser.ts +++ b/src.ts/wordlists/wordlists-browser.ts @@ -3,5 +3,5 @@ import { LangEn } from "./lang-en.js"; import type { Wordlist } from "./wordlist.js"; export const wordlists: Record = { - en: LangEn.wordlist(), + en: LangEn.wordlist(), }; diff --git a/src.ts/wordlists/wordlists.ts b/src.ts/wordlists/wordlists.ts index 1f275b99d..e8ff3e95d 100644 --- a/src.ts/wordlists/wordlists.ts +++ b/src.ts/wordlists/wordlists.ts @@ -24,14 +24,14 @@ import type { Wordlist } from "./wordlist.js"; * included ``wordlists-extra.min.js`` file. */ export const wordlists: Record = { - cz: LangCz.wordlist(), - en: LangEn.wordlist(), - es: LangEs.wordlist(), - fr: LangFr.wordlist(), - it: LangIt.wordlist(), - pt: LangPt.wordlist(), - ja: LangJa.wordlist(), - ko: LangKo.wordlist(), - zh_cn: LangZh.wordlist("cn"), - zh_tw: LangZh.wordlist("tw"), + cz: LangCz.wordlist(), + en: LangEn.wordlist(), + es: LangEs.wordlist(), + fr: LangFr.wordlist(), + it: LangIt.wordlist(), + pt: LangPt.wordlist(), + ja: LangJa.wordlist(), + ko: LangKo.wordlist(), + zh_cn: LangZh.wordlist("cn"), + zh_tw: LangZh.wordlist("tw"), }; diff --git a/tsconfig.base.json b/tsconfig.base.json index 72f5bb0dd..b9badd1af 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1,31 +1,27 @@ { - "compilerOptions": { - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "importHelpers": true, - "lib": [ - "es2020", - "es5" - ], - "moduleResolution": "node", - "noEmitOnError": true, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "preserveSymlinks": true, - "preserveWatchOutput": true, - "pretty": false, - "rootDir": "./src.ts", - "strict": true, - "sourceMap": true, - "target": "es2022" - }, - "exclude": [ ], - "include": [ - "./src.ts/**/*.ts" - ], + "compilerOptions": { + "declaration": true, + "types": ["node", "mocha"], + "declarationMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "importHelpers": true, + "lib": ["es2022", "es5"], + "moduleResolution": "bundler", + "noEmitOnError": true, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "preserveSymlinks": true, + "preserveWatchOutput": true, + "pretty": false, + "rootDir": "./src.ts", + "strict": true, + "sourceMap": true, + "target": "es2022" + }, + "exclude": [], + "include": ["./src.ts/**/*.ts"] } diff --git a/tsconfig.commonjs.json b/tsconfig.commonjs.json index b73f1dd6a..dbf4e6cd7 100644 --- a/tsconfig.commonjs.json +++ b/tsconfig.commonjs.json @@ -1,10 +1,5 @@ { - "exclude": [ - "src.ts/_admin/**" - ], - "extends": "./tsconfig.base.json", - "compilerOptions": { - "module": "commonjs", - "outDir": "./lib.commonjs" - } + "extends": "./tsconfig.esm.json", + "exclude": ["src.ts/_admin/**"], + "compilerOptions": { "noEmit": true } } diff --git a/tsconfig.esm.json b/tsconfig.esm.json index aa45c3b52..93846693a 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -1,7 +1,7 @@ { - "extends": "./tsconfig.base.json", - "compilerOptions": { - "module": "es2020", - "outDir": "./lib.esm" - } + "extends": "./tsconfig.base.json", + "compilerOptions": { + "module": "es2020", + "outDir": "./lib.esm" + } } diff --git a/tsconfig.types.json b/tsconfig.types.json index 018c522c0..e91298ecf 100644 --- a/tsconfig.types.json +++ b/tsconfig.types.json @@ -1,14 +1,11 @@ { - "exclude": [ - "src.ts/_admin/**", - "src.ts/_tests/**" - ], - "extends": "./tsconfig.base.json", - "compilerOptions": { - "declaration": true, - "declarationMap": true, - "declarationDir": "./types", - "emitDeclarationOnly": true, - "moduleResolution": "node" - } + "exclude": ["src.ts/_admin/**", "src.ts/_tests/**"], + "extends": "./tsconfig.base.json", + "compilerOptions": { + "declaration": true, + "declarationMap": true, + "declarationDir": "./types", + "emitDeclarationOnly": true, + "module": "es2022" + } } diff --git a/types/_version.d.ts b/types/_version.d.ts index ab655b4ad..515a07b59 100644 --- a/types/_version.d.ts +++ b/types/_version.d.ts @@ -1,5 +1,3 @@ -/** - * The current version of corebc. - */ +/** The current version of corebc; keep in sync with package.json. */ export declare const version: string; //# sourceMappingURL=_version.d.ts.map \ No newline at end of file diff --git a/types/_version.d.ts.map b/types/_version.d.ts.map index 502b731b4..99992181e 100644 --- a/types/_version.d.ts.map +++ b/types/_version.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"} \ No newline at end of file diff --git a/types/abi-types/Tes.d.ts.map b/types/abi-types/Tes.d.ts.map index 04a5ce028..0c7f7bc42 100644 --- a/types/abi-types/Tes.d.ts.map +++ b/types/abi-types/Tes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,E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AE,UAAU,GACd,kBAAkB,CACnB,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;IAEF,OAAO,EAAE;QACP,mCAAmC,EAAE,kBAAkB,CACrD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC1B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACxD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CACjC,CAAC;QACF,cAAc,EAAE,kBAAkB,CAChC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CACjC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACrD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC1B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;KACH,CAAC;CACH"} \ No newline at end of file +{"version":3,"file":"Tes.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,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C,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACzD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QACF,cAAc,EAAE,kBAAkB,CACjC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/types/abi-types/Tes_abi.d.ts.map b/types/abi-types/Tes_abi.d.ts.map index 4d5fd9d95..152cbb189 100644 --- a/types/abi-types/Tes_abi.d.ts.map +++ b/types/abi-types/Tes_abi.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes_abi.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACT,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IACjD,WAAW,CACT,eAAe,EACX,SAAS,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AAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACxD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CACjC,CAAC;QACF,cAAc,EAAE,kBAAkB,CAChC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CACjC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACrD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC1B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC3B,CAAC;KACH,CAAC;CACH"} \ No newline at end of file +{"version":3,"file":"Tes_abi.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IAClD,WAAW,CACV,eAAe,EACZ,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,2CAA2C,GAC3C,iDAAiD,GACjD,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,cAAc,GACf,gBAAgB,CAAC;IAEpB,QAAQ,CACP,sBAAsB,EAA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F,cAAc,EAAE,kBAAkB,CACjC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/types/abi-types/common.d.ts.map b/types/abi-types/common.d.ts.map index 1d45da294..b7d6fe89d 100644 --- a/types/abi-types/common.d.ts.map +++ b/types/abi-types/common.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/common.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,cAAc,EACf,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,wBAAwB,CAAC,QAAQ,SAAS,kBAAkB,CAC3E,SAAQ,mBAAmB;CAAG;AAEhC,MAAM,WAAW,kBAAkB,CACjC,UAAU,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,EACnC,WAAW,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,EACpC,YAAY,GAAG,GAAG;IAElB,CACE,GAAG,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,GAC3B,wBAAwB,CACzB,kBAAkB,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,CAAC,CAC1D,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,UAAU,CA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AAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,IAAI,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC9E,WAAW,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,gBAAgB,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChE"} \ No newline at end of file diff --git a/types/abi-types/factories/Tes__factory.d.ts.map b/types/abi-types/factories/Tes__factory.d.ts.map index 9c0f56a13..262b59a93 100644 --- a/types/abi-types/factories/Tes__factory.d.ts.map +++ b/types/abi-types/factories/Tes__factory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuWnD,qBAAa,YAAY;IACvB,MAAM,CAAC,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAQ;IAC3B,MAAM,CAAC,eAAe,IAAI,YAAY;IAGtC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,GAAG;CAGrE"} \ No newline at end of file +{"version":3,"file":"Tes__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuWnD,qBAAa,YAAY;IACxB,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,MAAM;qBACpB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,MAAM;;uBAGR,gBAAgB;uBAChB,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAA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,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;uBAGX,qBAAqB;;qBAGzB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;uBAIV,aAAa;;qBAGjB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,cAAc;;kCAEH,YAAY;uBACvB,UAAU;OAKU;IAC3B,MAAM,CAAC,eAAe,IAAI,YAAY,CAErC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,GAAG,CAEnE;CACD"} \ No newline at end of file diff --git a/types/abi-types/factories/Tes_abi__factory.d.ts.map b/types/abi-types/factories/Tes_abi__factory.d.ts.map index 5abc35679..530a4f795 100644 --- a/types/abi-types/factories/Tes_abi__factory.d.ts.map +++ b/types/abi-types/factories/Tes_abi__factory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Tes_abi__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuW/D,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAQ;IAC3B,MAAM,CAAC,eAAe,IAAI,gBAAgB;IAG1C,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO;CAGzE"} \ No newline at end of file +{"version":3,"file":"Tes_abi__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuW/D,qBAAa,gBAAgB;IAC5B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;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.ts.map b/types/abi/abi-coder.d.ts.map index a86e1aca8..ad04d5ac9 100644 --- a/types/abi/abi-coder.d.ts.map +++ b/types/abi/abi-coder.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACV,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AA8F3B;;GAEG;AACH,qBAAa,QAAQ;;IA2DnB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM;IAQjE;;;;OAIG;IACH,MAAM,CACJ,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACzB,MAAM;IAeT;;;;;;OAMG;IACH,MAAM,CACJ,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,OAAO,GACd,MAAM;IAQT;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ;IAOlC;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC5B,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/D,IAAI,EAAE,IAAI,GAAG,SAAS,GACrB,kBAAkB;CAQtB"} \ No newline at end of file +{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACX,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAElB,MAAM,mBAAmB,CAAC;AA8F3B;;GAEG;AACH,qBAAa,QAAQ;;IA2DpB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAMhE;IAED;;;;OAIG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;IAED;;;;;;OAMG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,OAAO,GACb,MAAM,CAMR;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ,CAKjC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/D,IAAI,EAAE,IAAI,GAAG,SAAS,GACpB,kBAAkB,CAOpB;CACD"} \ No newline at end of file diff --git a/types/abi/coders/abstract-coder.d.ts.map b/types/abi/coders/abstract-coder.d.ts.map index 3141c016e..df211a063 100644 --- a/types/abi/coders/abstract-coder.d.ts.map +++ b/types/abi/coders/abstract-coder.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/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MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU;IAQtD,SAAS,IAAI,MAAM;IAInB,SAAS,IAAI,MAAM;CAGpB"} \ No newline at end of file +{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AAiBnC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAGrC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE1B;;OAEG;IACH,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAgG9B;IAED;;;;;OAKG;IACH,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CASpB;IAED;;;;;OAKG;IACH,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAqB9B;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAgClE;IAED;;OAEG;IACH,MAAM,CACL,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EAC5D,OAAO,CAAC,EAAE,GAAG,GACX,MAAM,CAgBR;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAa1B;IAED;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM,CAEvE;CACD;AAED;;;;;;;;;;;;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I,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAMhD;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,UAAU,IAAI,MAAM,CAEvB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,KAAK,IAAI,UAAU,CAEtB;IAuBD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhC;IAGD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,CAKrD;IAGD,SAAS,IAAI,MAAM,CAElB;IAED,SAAS,IAAI,MAAM,CAElB;CACD"} \ No newline at end of file diff --git a/types/abi/coders/address.d.ts.map b/types/abi/coders/address.d.ts.map index 89cabff49..030f77d6d 100644 --- a/types/abi/coders/address.d.ts.map +++ b/types/abi/coders/address.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAUtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAQrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/anonymous.d.ts.map b/types/abi/coders/anonymous.d.ts.map index 75c762afb..d0f9d87cb 100644 --- a/types/abi/coders/anonymous.d.ts.map +++ b/types/abi/coders/anonymous.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,OAAO,CAAC,KAAK,CAAQ;gBAET,KAAK,EAAE,KAAK;IAKxB,YAAY,IAAI,GAAG;IAInB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAI1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACxC,OAAO,CAAC,KAAK,CAAQ;IAErB,YAAY,KAAK,EAAE,KAAK,EAGvB;IAED,YAAY,IAAI,GAAG,CAElB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAEzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/array.d.ts.map b/types/abi/coders/array.d.ts.map index 9875b8e9e..8cdb33a3b 100644 --- a/types/abi/coders/array.d.ts.map +++ b/types/abi/coders/array.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAC5B,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC3C,MAAM,CAuER;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAmD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;gBAEb,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAO3D,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC;IAW1B,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM;IA4B1D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CA4B5B"} \ No newline at end of file +{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAC5B,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC1C,MAAM,CAuER;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAmD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB,YAAY,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAK1D;IAED,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC,CASzB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM,CA0BzD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CA2B1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/boolean.d.ts.map b/types/abi/coders/boolean.d.ts.map index 8f22ce499..f0c2679a1 100644 --- a/types/abi/coders/boolean.d.ts.map +++ b/types/abi/coders/boolean.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,OAAO;IAIvB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM;IAKvD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,OAAO,CAEtB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAGtD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/bytes.d.ts.map b/types/abi/coders/bytes.d.ts.map index d765084b7..956098f28 100644 --- a/types/abi/coders/bytes.d.ts.map +++ b/types/abi/coders/bytes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAI3C,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;gBACnC,SAAS,EAAE,MAAM;IAI7B,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAE1C;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;IAChD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/fixed-bytes.d.ts.map b/types/abi/coders/fixed-bytes.d.ts.map index cca02a1ac..9d870c078 100644 --- a/types/abi/coders/fixed-bytes.d.ts.map +++ b/types/abi/coders/fixed-bytes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAM3C,YAAY,IAAI,MAAM;IAOtB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM;IAQzD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAI1C;IAED,YAAY,IAAI,MAAM,CAKrB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/null.d.ts.map b/types/abi/coders/null.d.ts.map index 5b43f1d78..e2ef8ebc5 100644 --- a/types/abi/coders/null.d.ts.map +++ b/types/abi/coders/null.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,IAAI;IAIpB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM;IAO1C,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAI5B"} \ No newline at end of file +{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACnC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,IAAI,CAEnB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAG1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/number.d.ts.map b/types/abi/coders/number.d.ts.map index b9ef16d8a..5af9a7edb 100644 --- a/types/abi/coders/number.d.ts.map +++ b/types/abi/coders/number.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAC;gBAEd,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM;IAW5D,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM;IAkB5D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAS5B"} \ No newline at end of file +{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAC;IAE1B,YAAY,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAS3D;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM,CAgB3D;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAQ1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/string.d.ts.map b/types/abi/coders/string.d.ts.map index 38618a702..d0158dd8b 100644 --- a/types/abi/coders/string.d.ts.map +++ b/types/abi/coders/string.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;gBACpC,SAAS,EAAE,MAAM;IAI7B,YAAY,IAAI,MAAM;IAItB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM;IAOtD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IACjD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAKrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/tuple.d.ts.map b/types/abi/coders/tuple.d.ts.map index de1068222..bc66dc09e 100644 --- a/types/abi/coders/tuple.d.ts.map +++ b/types/abi/coders/tuple.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;gBAE3B,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM;IAiBnD,YAAY,IAAI,GAAG;IA0CnB,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,KAAK,GACnD,MAAM;IAKT,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG;CAG5B"} \ No newline at end of file +{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAEvC,YAAY,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,EAelD;IAED,YAAY,IAAI,GAAG,CAwClB;IAED,MAAM,CACL,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,KAAK,GAClD,MAAM,CAGR;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/fragments.d.ts.map b/types/abi/fragments.d.ts.map index c3f678ffe..b1a1124b4 100644 --- a/types/abi/fragments.d.ts.map +++ b/types/abi/fragments.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACvD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC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QAAQ,CAAC,OAAO,EAAG,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,IAAI,GAAG,MAAM,CAAC;IAEhC;;OAEG;IACH,YACC,KAAK,EAAE,GAAG,EACV,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,EAC3D,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAChC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,EACjC,MAAM,EAAE,IAAI,GAAG,MAAM,EAcrB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CA2ClC;IAED,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAW5D;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB,CA6DtC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAChD;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAGrE;IAED,MAAM,IAAI,MAAM,CAEf;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,CAepC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD"} \ No newline at end of file diff --git a/types/abi/index.d.ts.map b/types/abi/index.d.ts.map index 4eb1a4ab8..a3a6ec0b1 100644 --- a/types/abi/index.d.ts.map +++ b/types/abi/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACP,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/types/abi/interface.d.ts.map b/types/abi/interface.d.ts.map index 763cd7ac3..d7d096cce 100644 --- a/types/abi/interface.d.ts.map +++ b/types/abi/interface.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;AAErC,qBAAa,cAAc;IACzB,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAWjE;AAED,qBAAa,sBAAsB;IACjC,QAAQ,CAAC,QA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a,GAAG,MAAM,EAChC,IAAI,EAAE,SAAS,EACf,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAC5B,MAAM,CA8ER;IAED;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,YAAY,CAAC;KACrB,GAAG,IAAI,GAAG,sBAAsB,CAYhC;IAED,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEvC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;KACb,GAAG,IAAI,GAAG,cAAc,CAgBxB;IAED;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,gBAAgB,CAWnD;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAkBtD;CACD"} \ No newline at end of file diff --git a/types/abi/typed.d.ts.map b/types/abi/typed.d.ts.map index 552156f75..80e5667ff 100644 --- a/types/abi/typed.d.ts.map +++ b/types/abi/typed.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAuBzD,MAAM,WAAW,WAAY,SAAQ,KAAK;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;IACvB,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC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AE,SAAS,GAAG,KAAK,CAElC;IAED,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,KAAK,CAE7C;IACD,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,KAAK,CAEzB;IACD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,KAAK,CAEhC;IACD,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,CAE9B;IAED,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,KAAK,CAGnE;IAED,MAAM,CAAC,KAAK,CACX,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,EACnD,IAAI,CAAC,EAAE,MAAM,GACX,KAAK,CAGP;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAE9C;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEzC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAQvD;CACD"} \ No newline at end of file diff --git a/types/address/contract-address.d.ts.map b/types/address/contract-address.d.ts.map index 8511ac269..c9b527dd2 100644 --- a/types/address/contract-address.d.ts.map +++ b/types/address/contract-address.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACrB,GAAG,MAAM,CAcT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,SAAS,GACtB,MAAM,CAoBR"} \ No newline at end of file +{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,GAAG,MAAM,CAcT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,SAAS,GACrB,MAAM,CAoBR"} \ No newline at end of file diff --git a/types/address/index.d.ts.map b/types/address/index.d.ts.map index 3dc38445f..86a6e44f8 100644 --- a/types/address/index.d.ts.map +++ b/types/address/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;CAQ5B;AAED,OAAO,EA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;;;;;;;;;GAiBG;AACH,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,UAmBA;AAED,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GAClB,CAAC"} \ No newline at end of file diff --git a/types/bigNumber/bigNumber.d.ts.map b/types/bigNumber/bigNumber.d.ts.map index d71c9db78..5dcf4c8f7 100644 --- a/types/bigNumber/bigNumber.d.ts.map +++ b/types/bigNumber/bigNumber.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"bigNumber.d.ts","sourceRoot":"","sources":["../../src.ts/bigNumber/bigNumber.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,KAAK,EACL,OAAO,EAIR,MAAM,kBAAkB,CAAC;AAS1B,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAExE,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,YAAY,CAUhE;AAKD,qBAAa,SAAU,YAAW,OAAO;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;gBAEnB,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM;IAmB9C,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIlC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS;IAIhC,GAAG,IAAI,SAAS;IAOhB,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAInC,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS;IAInC,GAAG,CAAC,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E,MAAM,GAAG,SAAS,CAK5B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,MAAM,IAAI,OAAO,CAEhB;IAED,QAAQ,IAAI,MAAM,CAQjB;IAED,QAAQ,IAAI,MAAM,CAYjB;IAED,QAAQ,IAAI,MAAM,CAyBjB;IAED,WAAW,IAAI,MAAM,CAEpB;IAED,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAExB;IAED,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAuEjC;IAED,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAEjD;CACD;AA6ED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"} \ No newline at end of file diff --git a/types/cip/custom-units.d.ts b/types/cip/custom-units.d.ts new file mode 100644 index 000000000..58031982f --- /dev/null +++ b/types/cip/custom-units.d.ts @@ -0,0 +1,33 @@ +import type { AddressLike } from "../address/index.js"; +import { Contract } from "../contract/index.js"; +import type { BlockTag, ContractRunner } from "../providers/index.js"; +export declare const customUnitAbi: readonly string[]; +export declare class CustomUnitDiscovery { + readonly preferredUnit: string; + readonly supportedUnits: readonly string[]; + constructor(units: readonly string[], preferredUnit: string); + get isValid(): boolean; + supports(unit: string): boolean; +} +/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ +export declare class CustomUnitBalance { + readonly canonicalAmount: bigint; + readonly unitAmount: bigint; + readonly unit: string; + constructor(canonicalAmount: bigint, unitAmount: bigint, unit: string); + get multiplierNumerator(): bigint; + get multiplierDenominator(): bigint; +} +/** Core custom-unit contract convention used by Tone and Core API. */ +export declare class CustomUnitToken { + readonly contract: Contract; + constructor(address: string, runner: ContractRunner); + supportsUnit(unit: string, blockTag?: BlockTag): Promise; + supportedUnits(blockTag?: BlockTag): Promise; + preferredUnit(blockTag?: BlockTag): Promise; + discover(blockTag?: BlockTag): Promise; + canonicalBalance(account: AddressLike, blockTag?: BlockTag): Promise; + balanceOfUnit(account: AddressLike, unit: string, blockTag?: BlockTag): Promise; + balance(account: AddressLike, unit?: string, blockTag?: BlockTag): Promise; +} +//# sourceMappingURL=custom-units.d.ts.map \ No newline at end of file diff --git a/types/cip/custom-units.d.ts.map b/types/cip/custom-units.d.ts.map new file mode 100644 index 000000000..69faaea75 --- /dev/null +++ b/types/cip/custom-units.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"custom-units.d.ts","sourceRoot":"","sources":["../../src.ts/cip/custom-units.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,eAAO,MAAM,aAAa,mBAMxB,CAAC;AACH,qBAAa,mBAAmB;IAI9B,QAAQ,CAAC,aAAa,EAAE,MAAM;IAH/B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,YACC,KAAK,EAAE,SAAS,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,EAG9B;IACD,IAAI,OAAO,IAAI,OAAO,CAMrB;IACD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9B;CACD;AACD,iFAAiF;AACjF,qBAAa,iBAAiB;IAE5B,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86e31b --- /dev/null +++ b/types/cip/index.d.ts @@ -0,0 +1,49 @@ +import { Contract } from "../contract/index.js"; +import type { Overrides, ContractTransactionResponse } from "../contract/index.js"; +import type { BlockTag, ContractRunner } from "../providers/index.js"; +import { IpfsGateway } from "../ipfs/index.js"; +/** On-chain interface defined by CIP-150. */ +export declare const cip150Abi: readonly string[]; +export interface Cip150MetadataEntry { + readonly key: string; + readonly value: string; + readonly sealed?: boolean; +} +export declare const cip151TokenExpirationKey = "tokenExpiration"; +export declare const cip151TradingStopKey = "tradingStop"; +export declare const cip152LabKey = "lab"; +/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ +export declare class Cip151Lifecycle { + readonly tokenExpiration: bigint | null; + readonly tradingStop: bigint | null; + constructor(metadata?: Readonly>); + isExpiredAt(seconds: bigint): boolean; + isTradingStoppedAt(seconds: bigint): boolean; +} +export interface Cip152LabMeasurement { + readonly value: string | number; + readonly unit?: string; +} +/** Validates certificate structure, not the authenticity of its issuer. */ +export declare class Cip152LabCertificate { + readonly measurements: Readonly>; + constructor(json: unknown); +} +/** Typed metadata reader and writer. Writes require a signer as runner. */ +export declare class Cip150MetadataContract { + readonly contract: Contract; + constructor(address: string, runner: ContractRunner); + getValue(key: string, blockTag?: BlockTag): Promise; + hasKey(key: string, blockTag?: BlockTag): Promise; + isSealed(key: string, blockTag?: BlockTag): Promise; + listKeys(blockTag?: BlockTag): Promise; + getByIndex(index: bigint, blockTag?: BlockTag): Promise; + count(blockTag?: BlockTag): Promise; + readAll(blockTag?: BlockTag, includeSealedState?: boolean): Promise; + setValue(key: string, value: string, overrides?: Overrides): Promise; + sealKey(key: string, overrides?: Overrides): Promise; + readLifecycle(blockTag?: BlockTag): Promise; + readLabCertificate(gateway: IpfsGateway, blockTag?: BlockTag): Promise; +} +export { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from "./custom-units.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/cip/index.d.ts.map b/types/cip/index.d.ts.map new file mode 100644 index 000000000..d0120ee3c --- /dev/null +++ b/types/cip/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/cip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EACX,SAAS,EACT,2BAA2B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,6CAA6C;AAC7C,eAAO,MAAM,SAAS,mBASpB,CAAC;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC1B;AACD,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAC1D,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,iFAAiF;AACjF,qBAAa,eAAe;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,YAAY,QAAQ,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,EAU1D;IACD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpC;IACD,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE3C;CACD;AACD,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB;AAC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C,CAEtC;IACK,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAOjE;IACK,kBAAkB,CACvB,OAAO,EAAE,WAAW,EACpB,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAMtC;CACD;AACD,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACb,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/types/constants/hashes.d.ts.map b/types/constants/hashes.d.ts.map index ef1df7d58..225420a8c 100644 --- a/types/constants/hashes.d.ts.map +++ b/types/constants/hashes.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAC+C,CAAC"} \ No newline at end of file +{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAC8C,CAAC"} \ No newline at end of file diff --git a/types/constants/index.d.ts.map b/types/constants/index.d.ts.map index 0c26e029d..d703c7245 100644 --- a/types/constants/index.d.ts.map +++ b/types/constants/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/types/constants/numbers.d.ts.map b/types/constants/numbers.d.ts.map index 7e7f487f7..927678af4 100644 --- a/types/constants/numbers.d.ts.map +++ b/types/constants/numbers.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAEf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEZ,CAAC;AAEb;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAiC,CAAC;AAC5D,eAAO,MAAM,IAAI,EAAE,MAAgC,CAAC;AACpD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC;AACnD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC"} \ No newline at end of file +{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAEf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEb,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAiC,CAAC;AAC5D,eAAO,MAAM,IAAI,EAAE,MAAgC,CAAC;AACpD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC;AACnD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC"} \ No newline at end of file diff --git a/types/contract/contract.d.ts b/types/contract/contract.d.ts index b7a2cd009..637e513de 100644 --- a/types/contract/contract.d.ts +++ b/types/contract/contract.d.ts @@ -45,7 +45,7 @@ export declare class BaseContract implements Addressable, EventEmitterable(target: string, abi: InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit; static isIndexed(value: any): value is Indexed; } -declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: ContractRunner | null | undefined) => BaseContract & Omit; +declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: null | ContractRunner) => BaseContract & Omit; export declare class Contract extends Contract_base { } export {}; diff --git a/types/contract/contract.d.ts.map b/types/contract/contract.d.ts.map index d2114f9d0..93e959992 100644 --- a/types/contract/contract.d.ts.map +++ b/types/contract/contract.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAEL,GAAG,EACH,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAGL,2BAA2B,EAC3B,QAAQ,EACT,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,SAAS,EAEV,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AC,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/D,qBAAa,QAAS,SAAQ,aAAe;CAAG"} \ No newline at end of file diff --git a/types/contract/factory.d.ts.map b/types/contract/factory.d.ts.map index 600026a1b..e49bf553e 100644 --- a/types/contract/factory.d.ts.map +++ b/types/contract/factory.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,OAAO,EAAE,YAAY,EAA8B,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAKjE,qBAAa,eAAe,CAC1B,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EACjC,CAAC,GAAG,YAAY;IAEhB,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAG,IAAI,GAAG,cAAc,CAAC;gBAGtC,GAAG,EAAE,SAAS,GAAG,YAAY,EAC7B,QAAQ,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EACxC,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc;IA2B1B,oBAAoB,CACxB,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,yBAAyB,CAAC;IAsB/B,MAAM,CA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IAAI,GAAG,cAAc,CAAC;IAExC,YACC,GAAG,EAAE,SAAS,GAAG,YAAY,EAC7B,QAAQ,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EACxC,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,EAyB9B;IAEK,oBAAoB,CACzB,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC,yBAAyB,CAAC,CAoBpC;IAEK,MAAM,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CACpD,YAAY,GAAG;QACd,qBAAqB,IAAI,2BAA2B,CAAC;KACrD,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAC/B,CAoBA;IAED,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAE5D;IAED,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAC3E,MAAM,EAAE,GAAG,EACX,MAAM,CAAC,EAAE,cAAc,GACrB,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAiBvB;CACD"} \ No newline at end of file diff --git a/types/contract/index.d.ts.map b/types/contract/index.d.ts.map index ce8d05bb5..a5098a449 100644 --- a/types/contract/index.d.ts.map +++ b/types/contract/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACL,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,GAChB,MAAM,YAAY,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/types/contract/types.d.ts.map b/types/contract/types.d.ts.map index d0dd8e022..d356fb5ec 100644 --- a/types/contract/types.d.ts.map +++ b/types/contract/types.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,KAAK,EACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAGjE,MAAM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AC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;IAC/D,CAAC,GAAG,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC;IAErD,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,GAAG,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC;CAC1D;AAED,MAAM,WAAW,eAAe;IAC/B,CACC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACxC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAExC,mBAAmB,CAClB,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACxC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxE,IAAI,CACH,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACxC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5E"} \ No newline at end of file diff --git a/types/contract/wrappers.d.ts.map b/types/contract/wrappers.d.ts.map index aa2542479..4538896c6 100644 --- a/types/contract/wrappers.d.ts.map +++ b/types/contract/wrappers.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,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AQ,EAAE,aAAa,EACvB,IAAI,EAAE,GAAG,EAcT;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;CACD"} \ No newline at end of file diff --git a/types/corebc.d.ts b/types/corebc.d.ts index 04ae175d8..1dede3269 100644 --- a/types/corebc.d.ts +++ b/types/corebc.d.ts @@ -23,4 +23,6 @@ export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, C export type { AccessList, AccessListish, AccessListEntry, TransactionLike, } from "./transaction/index.js"; export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, CoreBCError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedCoreBCError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener, } from "./utils/index.js"; export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions, } from "./wallet/index.js"; +export * from "./cip/index.js"; +export * from "./ipfs/index.js"; //# sourceMappingURL=corebc.d.ts.map \ No newline at end of file diff --git a/types/corebc.d.ts.map b/types/corebc.d.ts.map index d023fbd11..c9c604763 100644 --- a/types/corebc.d.ts.map +++ b/types/corebc.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"corebc.d.ts","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACL,mBA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C;AAE9B,YAAY,EACV,UAAU,EACV,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,SAAS,EACT,YAAY,EACZ,OAAO,EACP,SAAS,EACT,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,GACf,MAAM,mBAAmB,CAAC"} \ No newline at end of file +{"version":3,"file":"corebc.d.ts","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,KAAK,GACL,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE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WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,GACR,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACX,gBAAgB,EAChB,eAAe,EACf,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/types/crypto/browser-ed448.d.ts b/types/crypto/browser-ed448.d.ts index 7aee3772e..7b2b7d29a 100644 --- a/types/crypto/browser-ed448.d.ts +++ b/types/crypto/browser-ed448.d.ts @@ -1,3 +1,4 @@ -import ed448 from "bcrypto/lib/ed448-browser.js"; +import type { Ed448Backend } from "./ed448-types.js"; +declare const ed448: Ed448Backend; export default ed448; //# sourceMappingURL=browser-ed448.d.ts.map \ No newline at end of file diff --git a/types/crypto/browser-ed448.d.ts.map b/types/crypto/browser-ed448.d.ts.map index ac87af8f7..33a4fd898 100644 --- a/types/crypto/browser-ed448.d.ts.map +++ b/types/crypto/browser-ed448.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"browser-ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,8BAA8B,CAAC;AACjD,eAAe,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"browser-ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/types/crypto/browser-sha3.d.ts.map b/types/crypto/browser-sha3.d.ts.map index e40fa9ffd..61f4a3fba 100644 --- a/types/crypto/browser-sha3.d.ts.map +++ b/types/crypto/browser-sha3.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"browser-sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AAQA,OAAO,EAAY,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACd,MAAM,CAkBR"} \ No newline at end of file +{"version":3,"file":"browser-sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AASA,OAAO,EAAY,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR"} \ No newline at end of file diff --git a/types/crypto/crypto-browser.d.ts.map b/types/crypto/crypto-browser.d.ts.map index 74fb87c78..96b1570a8 100644 --- a/types/crypto/crypto-browser.d.ts.map +++ b/types/crypto/crypto-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;KAAG;IAEnB,MAAM,MAAM,EAAE,MAAM,CAAC;IAErB,MAAM,IAAI,EAAE,MAAM,CAAC;CACpB;AAkBD,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAYrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAIvE;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,GAAG,QAAQ,GACzB,UAAU,CAIZ;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAoBtD"} \ No newline at end of file +{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;KAAG;IAEnB,MAAM,MAAM,EAAE,MAAM,CAAC;IAErB,MAAM,IAAI,EAAE,MAAM,CAAC;CACnB;AAmBD,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAcrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAMvE;AAED,wBAAgB,UAAU,CACzB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,GAAG,QAAQ,GACxB,UAAU,CAIZ;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAoBtD"} \ No newline at end of file diff --git a/types/crypto/crypto.d.ts b/types/crypto/crypto.d.ts index 56e369d6c..67011fd36 100644 --- a/types/crypto/crypto.d.ts +++ b/types/crypto/crypto.d.ts @@ -1,3 +1,4 @@ +/// import ed448 from "./ed448.js"; export { ed448 }; export { Ed448Goldilock } from "./ed448goldilock.js"; diff --git a/types/crypto/crypto.d.ts.map b/types/crypto/crypto.d.ts.map index a472d84a5..551ce5172 100644 --- a/types/crypto/crypto.d.ts.map +++ b/types/crypto/crypto.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file +{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/types/crypto/ed448-types.d.ts b/types/crypto/ed448-types.d.ts new file mode 100644 index 000000000..705f54df5 --- /dev/null +++ b/types/crypto/ed448-types.d.ts @@ -0,0 +1,15 @@ +import type { Buffer } from "buffer"; +/** Buffer-based bcrypto Ed448 operations used by Core signing. */ +export interface Ed448Backend { + privateKeyGenerate(): Buffer; + publicKeyCreate(key: Buffer): Buffer; + publicKeyFromScalar(scalar: Buffer): Buffer; + publicKeyVerify(key: Buffer): boolean; + publicKeyCombine(keys: Buffer[]): Buffer; + sign(message: Buffer, key: Buffer): Buffer; + signWithScalar(message: Buffer, scalar: Buffer, prefix: Buffer): Buffer; + verify(message: Buffer, signature: Buffer, publicKey: Buffer): boolean; + derive(publicKey: Buffer, key: Buffer): Buffer; + deriveWithScalar(publicKey: Buffer, scalar: Buffer): Buffer; +} +//# sourceMappingURL=ed448-types.d.ts.map \ No newline at end of file diff --git a/types/crypto/ed448-types.d.ts.map b/types/crypto/ed448-types.d.ts.map new file mode 100644 index 000000000..209f88584 --- /dev/null +++ b/types/crypto/ed448-types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ed448-types.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC5B,kBAAkB,IAAI,MAAM,CAAC;IAC7B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5D"} \ No newline at end of file diff --git a/types/crypto/ed448.d.ts b/types/crypto/ed448.d.ts index 5dfe597f9..fd3e5a866 100644 --- a/types/crypto/ed448.d.ts +++ b/types/crypto/ed448.d.ts @@ -1,3 +1,4 @@ -import ed448 from "bcrypto/lib/ed448.js"; +import type { Ed448Backend } from "./ed448-types.js"; +declare const ed448: Ed448Backend; export default ed448; //# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/types/crypto/ed448.d.ts.map b/types/crypto/ed448.d.ts.map index 19085a96e..7ea835437 100644 --- a/types/crypto/ed448.d.ts.map +++ b/types/crypto/ed448.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,sBAAsB,CAAC;AAEzC,eAAe,KAAK,CAAC"} \ No newline at end of file +{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/types/crypto/ed448goldilock-browser.d.ts b/types/crypto/ed448goldilock-browser.d.ts index 675f772fa..58df73a6f 100644 --- a/types/crypto/ed448goldilock-browser.d.ts +++ b/types/crypto/ed448goldilock-browser.d.ts @@ -1,6 +1,7 @@ +import { Buffer } from "buffer"; export declare class Ed448Goldilock { - static _channel: any; - static generatePrivateKey(): any; + static _channel: import("./ed448-types.js").Ed448Backend; + static generatePrivateKey(): Buffer; static getPublicKeyFromPrivateKey(privateKey: string): string; static signWithPrivateKey(privateKey: string, msg: string): string; static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; diff --git a/types/crypto/ed448goldilock-browser.d.ts.map b/types/crypto/ed448goldilock-browser.d.ts.map index 754f2764a..976a9855d 100644 --- a/types/crypto/ed448goldilock-browser.d.ts.map +++ b/types/crypto/ed448goldilock-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAOA,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,MAAS;IAExB,MAAM,CAAC,kBAAkB;IAMzB,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAc7D,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAqBlE,MAAM,CAAC,+BAA+B,CACpC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACV,MAAM;IAMT,MAAM,CAAC,eAAe,CACpB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO;IAIV,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAQzD,MAAM,CAAC,iBAAiB,CACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACX,MAAM;IAaT,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAc9C,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAiBlD,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAgBrD,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;CASxE"} \ No newline at end of file +{"version":3,"file":"ed448goldilock-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/types/crypto/ed448goldilock.d.ts b/types/crypto/ed448goldilock.d.ts index 737cae0a1..3dff60994 100644 --- a/types/crypto/ed448goldilock.d.ts +++ b/types/crypto/ed448goldilock.d.ts @@ -1,6 +1,7 @@ +import { Buffer } from "buffer"; export declare class Ed448Goldilock { - static _channel: any; - static generatePrivateKey(): any; + static _channel: import("./ed448-types.js").Ed448Backend; + static generatePrivateKey(): Buffer; static getPublicKeyFromPrivateKey(privateKey: string): string; static signWithPrivateKey(privateKey: string, msg: string): string; static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; diff --git a/types/crypto/ed448goldilock.d.ts.map b/types/crypto/ed448goldilock.d.ts.map index 34092c2fe..7cd4dfaca 100644 --- a/types/crypto/ed448goldilock.d.ts.map +++ b/types/crypto/ed448goldilock.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ed448goldilock.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":"AAOA,qBAAa,cAAc;IACzB,MAAM,CAAC,QAAQ,MAAS;IAExB,MAAM,CAAC,kBAAkB;IAMzB,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAA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AC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/types/crypto/hmac.d.ts b/types/crypto/hmac.d.ts index 4c5e3227d..902055c49 100644 --- a/types/crypto/hmac.d.ts +++ b/types/crypto/hmac.d.ts @@ -1,4 +1,5 @@ import type { BytesLike } from "../utils/index.js"; +declare const _computeHmac: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; /** * Return the HMAC for %%data%% using the %%key%% key with the underlying * %%algo%% used for compression. @@ -18,8 +19,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string; export declare namespace computeHmac { - var _: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; - var lock: () => void; - var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; + export { _computeHmac as _ }; + export var lock: () => void; + export var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/types/crypto/hmac.d.ts.map b/types/crypto/hmac.d.ts.map index 49d9b637c..b5c8a51d9 100644 --- a/types/crypto/hmac.d.ts.map +++ b/types/crypto/hmac.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,GACf,MAAM,CAIR;yBARe,WAAW"} \ No newline at end of file +{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,YAAY,cACN,QAAQ,GAAG,QAAQ,OACzB,UAAU,QACT,UAAU,KACd,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAC1B,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,GACd,MAAM,CAIR;yBARe,WAAW;aASX,YAAY;;gCAKrB,CACL,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,UAAU,KACZ,SAAS"} \ No newline at end of file diff --git a/types/crypto/index.d.ts.map b/types/crypto/index.d.ts.map index 153bb6fd7..76d2d37f8 100644 --- a/types/crypto/index.d.ts.map +++ b/types/crypto/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,iBAAS,IAAI,IAAI,IAAI,CAUpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,iBAAS,IAAI,IAAI,IAAI,CAUpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/types/crypto/keccak.d.ts b/types/crypto/keccak.d.ts index 533f46dc6..a2b3dd879 100644 --- a/types/crypto/keccak.d.ts +++ b/types/crypto/keccak.d.ts @@ -4,6 +4,7 @@ * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] */ import type { BytesLike } from "../utils/index.js"; +declare const _keccak256: (data: Uint8Array) => Uint8Array; /** * Compute the cryptographic KECCAK256 hash of %%data%%. * @@ -28,8 +29,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function keccak256(_data: BytesLike): string; export declare namespace keccak256 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _keccak256 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=keccak.d.ts.map \ No newline at end of file diff --git a/types/crypto/keccak.d.ts.map b/types/crypto/keccak.d.ts.map index 2f0a88fb1..dfe4be3ef 100644 --- a/types/crypto/keccak.d.ts.map +++ b/types/crypto/keccak.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAUnD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file +{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/types/crypto/pbkdf2-browser.d.ts.map b/types/crypto/pbkdf2-browser.d.ts.map index a7519b4b4..97bf68048 100644 --- a/types/crypto/pbkdf2-browser.d.ts.map +++ b/types/crypto/pbkdf2-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pbkdf2-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,+BAA+B,CAAC;AACnD,eAAe,MAAM,CAAC"} \ No newline at end of file +{"version":3,"file":"pbkdf2-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,+BAA+B,CAAC;eACpC,MAAM"} \ No newline at end of file diff --git a/types/crypto/pbkdf2.d.ts b/types/crypto/pbkdf2.d.ts index 400e9744f..c2da81c40 100644 --- a/types/crypto/pbkdf2.d.ts +++ b/types/crypto/pbkdf2.d.ts @@ -6,6 +6,7 @@ * @_subsection: api/crypto:Passwords [about-pbkdf] */ import type { BytesLike } from "../utils/index.js"; +declare const _pbkdf2: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; /** * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using * the %%salt%% and using %%iterations%% of %%algo%%. @@ -28,8 +29,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string; export declare namespace pbkdf2 { - var _: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; - var lock: () => void; - var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; + export { _pbkdf2 as _ }; + export var lock: () => void; + export var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; } +export {}; //# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/types/crypto/pbkdf2.d.ts.map b/types/crypto/pbkdf2.d.ts.map index 99323c18c..fc5ad966d 100644 --- a/types/crypto/pbkdf2.d.ts.map +++ b/types/crypto/pbkdf2.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAgBnD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACpB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GACxB,MAAM,CAIR;yBAVe,MAAM"} \ No newline at end of file +{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,OAAO,aACF,UAAU,QACd,UAAU,cACJ,MAAM,UACV,MAAM,QACR,QAAQ,GAAG,QAAQ,KACvB,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACrB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GACvB,MAAM,CAIR;yBAVe,MAAM;aAWX,OAAO;2BACS,IAAI;gCAIxB,CACL,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,KACrB,SAAS"} \ No newline at end of file diff --git a/types/crypto/random.d.ts b/types/crypto/random.d.ts index fd9378000..609ec0ec0 100644 --- a/types/crypto/random.d.ts +++ b/types/crypto/random.d.ts @@ -1,3 +1,4 @@ +declare const _randomBytes: (length: number) => Uint8Array; /** * Return %%length%% bytes of cryptographically secure random data. * @@ -7,8 +8,9 @@ */ export declare function randomBytes(length: number): Uint8Array; export declare namespace randomBytes { - var _: (length: number) => Uint8Array; - var lock: () => void; - var register: (func: (length: number) => Uint8Array) => void; + export { _randomBytes as _ }; + export var lock: () => void; + export var register: (func: (length: number) => Uint8Array) => void; } +export {}; //# sourceMappingURL=random.d.ts.map \ No newline at end of file diff --git a/types/crypto/random.d.ts.map b/types/crypto/random.d.ts.map index a907fd7ef..0e9d29e7b 100644 --- a/types/crypto/random.d.ts.map +++ b/types/crypto/random.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW"} \ No newline at end of file +{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY,WAAqB,MAAM,KAAG,UAE/C,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW;aAIX,YAAY;2BACI,IAAI;gCAGG,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU"} \ No newline at end of file diff --git a/types/crypto/ripemd160.d.ts b/types/crypto/ripemd160.d.ts index 27b7b4a1c..a38b5f516 100644 --- a/types/crypto/ripemd160.d.ts +++ b/types/crypto/ripemd160.d.ts @@ -1,4 +1,5 @@ import type { BytesLike } from "../utils/index.js"; +declare const _ripemd160: (data: Uint8Array) => Uint8Array; /** * Compute the cryptographic RIPEMD-160 hash of %%data%%. * @@ -18,8 +19,9 @@ import type { BytesLike } from "../utils/index.js"; */ export declare function ripemd160(_data: BytesLike): string; export declare namespace ripemd160 { - var _: (data: Uint8Array) => Uint8Array; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _ripemd160 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/types/crypto/ripemd160.d.ts.map b/types/crypto/ripemd160.d.ts.map index 2eb29db41..68683ca8b 100644 --- a/types/crypto/ripemd160.d.ts.map +++ b/types/crypto/ripemd160.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAUnD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS"} \ No newline at end of file +{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/types/crypto/scrypt.d.ts b/types/crypto/scrypt.d.ts index b0e678f52..a00b5a43b 100644 --- a/types/crypto/scrypt.d.ts +++ b/types/crypto/scrypt.d.ts @@ -8,6 +8,8 @@ import type { BytesLike } from "../utils/index.js"; * @_docloc: api/crypto:Passwords */ export type ProgressCallback = (percent: number) => void; +declare const _scryptAsync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback) => Promise & Uint8Array>; +declare const _scryptSync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array & Uint8Array; /** * The [[link-wiki-scrypt]] uses a memory and cpu hard method of * derivation to increase the resource cost to brute-force a password @@ -47,9 +49,9 @@ export type ProgressCallback = (percent: number) => void; */ export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise; export declare namespace scrypt { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback | undefined) => Promise; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback | undefined) => Promise) => void; + export { _scryptAsync as _ }; + export var lock: () => void; + export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback) => Promise) => void; } /** * Provides a synchronous variant of [[scrypt]]. @@ -75,8 +77,9 @@ export declare namespace scrypt { */ export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string; export declare namespace scryptSync { - var _: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array; - var lock: () => void; - var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; + export { _scryptSync as _ }; + export var lock: () => void; + export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; } +export {}; //# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/types/crypto/scrypt.d.ts.map b/types/crypto/scrypt.d.ts.map index b8a706e0e..23c428160 100644 --- a/types/crypto/scrypt.d.ts.map +++ b/types/crypto/scrypt.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AA6CzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,MAAM,CAC1B,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,gBAAgB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAIjB;yBAZqB,MAAM;;;;;AAmC5B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,GACZ,MAAM,CAIR;yBAXe,UAAU"} \ No newline at end of file +{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAKzD,QAAA,MAAM,YAAY,WACT,UAAU,QACZ,UAAU,KACb,MAAM,KACN,MAAM,KACN,MAAM,SACF,MAAM,eACA,gBAAgB,mEAG7B,CAAC;AACF,QAAA,MAAM,WAAW,WACR,UAAU,QACZ,UAAU,KACb,MAAM,KACN,MAAM,KACN,MAAM,SACF,MAAM,0DAGb,CAAC;AAoBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,MAAM,CAC3B,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,MAAM,CAAC,CAIjB;yBAZqB,MAAM;aAajB,YAAY;2BACI,IAAI;gCAIxB,CACL,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,gBAAgB,KACvB,OAAO,CAAC,SAAS,CAAC;;AASxB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CACzB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,GACX,MAAM,CAIR;yBAXe,UAAU;aAYX,WAAW;2BACK,IAAI;gCAI5B,CACL,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,KACT,SAAS"} \ No newline at end of file diff --git a/types/crypto/sha3.d.ts b/types/crypto/sha3.d.ts index e9130d128..34e1d42f6 100644 --- a/types/crypto/sha3.d.ts +++ b/types/crypto/sha3.d.ts @@ -1,6 +1,8 @@ import { BytesLike } from "../utils/data.js"; +declare const _sha256: (data: Uint8Array) => string; +declare const _sha512: (data: Uint8Array) => string; /** - * Compute the cryptographic SHA2-256 hash of %%data%%. + * Compute the cryptographic SHA3-256 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -23,14 +25,14 @@ export declare enum SupportedAlgorithm { export declare function ripemd160(data: BytesLike): string; export declare function sha256(data: BytesLike): string; export declare namespace sha256 { - var _: (data: Uint8Array) => string; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _sha256 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } export declare function legacySha256(data: BytesLike): string; export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string; /** - * Compute the cryptographic SHA2-512 hash of %%data%%. + * Compute the cryptographic SHA3-512 hash of %%data%%. * * @_docloc: api/crypto:Hash Functions * @returns DataHexstring @@ -47,8 +49,9 @@ export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLik */ export declare function sha512(data: BytesLike): string; export declare namespace sha512 { - var _: (data: Uint8Array) => string; - var lock: () => void; - var register: (func: (data: Uint8Array) => BytesLike) => void; + export { _sha512 as _ }; + export var lock: () => void; + export var register: (func: (data: Uint8Array) => BytesLike) => void; } +export {}; //# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/types/crypto/sha3.d.ts.map b/types/crypto/sha3.d.ts.map index 62d2f90aa..d71f0360e 100644 --- a/types/crypto/sha3.d.ts.map +++ b/types/crypto/sha3.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAqB,MAAM,kBAAkB,CAAC;AAgC1E;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAYjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAU9C;yBAVe,MAAM;;;;;AAYtB,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIpD;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACd,MAAM,CAkBR;AAcD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAU9C;yBAVe,MAAM"} \ No newline at end of file +{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAqB,MAAM,kBAAkB,CAAC;AAM1E,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AACvD,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AAOvD;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,kBAAkB;IAC7B,MAAM,WAAW;IACjB,MAAM,WAAW;CACjB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAkCX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI;;AAlCxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIpD;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR;AAcD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAGX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI"} \ No newline at end of file diff --git a/types/crypto/signature.d.ts.map b/types/crypto/signature.d.ts.map index 83d7e9f37..cf72d7bd1 100644 --- a/types/crypto/signature.d.ts.map +++ b/types/crypto/signature.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcjE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,SAAS;;IAMpB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAGrB;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAUtB;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAEf;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,YAAY,EAIxB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,IAAI,GAAG,MAAM,CAE5B;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,IAAI,GAAG,MAAM,CAMnC;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAOxB;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;gBACS,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE;IAYxD;;OAEG;IACH,KAAK,IAAI,SAAS;IAQlB;;OAEG;IACH,MAAM,IAAI,GAAG;IAWb;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM;IAc5C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM;IAIjE;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE;CAwBhD"} \ No newline at end of file +{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAm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Ac,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE,CAc9C;CAUD"} \ No newline at end of file diff --git a/types/crypto/signing-key.d.ts b/types/crypto/signing-key.d.ts index a030dac26..3ce0c2ea0 100644 --- a/types/crypto/signing-key.d.ts +++ b/types/crypto/signing-key.d.ts @@ -19,73 +19,17 @@ export declare class SigningKey { * The private key. */ get privateKey(): string; - /** - * The uncompressed public key. - * - * This will always begin with the prefix ``0x04`` and be 132 - * characters long (the ``0x`` prefix and 130 hexadecimal nibbles). - */ + /** The 57-byte Ed448 public key encoded as hex. */ get publicKey(): string; - /** - * The compressed public key. - * - * This will always begin with either the prefix ``0x02`` or ``0x03`` - * and be 68 characters long (the ``0x`` prefix and 33 hexadecimal - * nibbles) - */ + /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ get compressedPublicKey(): string; /** * Return the signature of the signed %%digest%%. */ sign(digest: BytesLike): string; - /** - * Returns the [[link-wiki-ecdh]] shared secret between this - * private key and the %%other%% key. - * - * The %%other%% key may be any type of key, a raw public key, - * a compressed/uncompressed pubic key or aprivate key. - * - * Best practice is usually to use a cryptographic hash on the - * returned value before using it as a symetric secret. - * - * @example: - * sign1 = new SigningKey(id("some-secret-1")) - * sign2 = new SigningKey(id("some-secret-2")) - * - * // Notice that privA.computeSharedSecret(pubB)... - * sign1.computeSharedSecret(sign2.publicKey) - * //_result: - * - * // ...is equal to privB.computeSharedSecret(pubA). - * sign2.computeSharedSecret(sign1.publicKey) - * //_result: - */ + /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ computeSharedSecret(other: BytesLike): string; - /** - * Compute the public key for %%key%%, optionally %%compressed%%. - * - * The %%key%% may be any type of key, a raw public key, a - * compressed/uncompressed public key or private key. - * - * @example: - * sign = new SigningKey(id("some-secret")); - * - * // Compute the uncompressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey) - * //_result: - * - * // Compute the compressed public key for a private key - * SigningKey.computePublicKey(sign.privateKey, true) - * //_result: - * - * // Compute the uncompressed public key - * SigningKey.computePublicKey(sign.publicKey, false); - * //_result: - * - * // Compute the Compressed a public key - * SigningKey.computePublicKey(sign.publicKey, true); - * //_result: - */ + /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ static computePublicKey(key: BytesLike, compressed?: boolean): string; /** * Returns the public key for the private key which produced the @@ -106,16 +50,7 @@ export declare class SigningKey { * */ static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string; - /** - * Returns the point resulting from adding the ellipic curve points - * %%p0%% and %%p1%%. - * - * This is not a common function most developers should require, but - * can be useful for certain privacy-specific techniques. - * - * For example, it is used by [[HDNodeWallet]] to compute child - * addresses from parent public keys and chain codes. - */ + /** Adds two encoded Ed448 public points. The compression flag is ignored. */ static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string; } //# sourceMappingURL=signing-key.d.ts.map \ No newline at end of file diff --git a/types/crypto/signing-key.d.ts.map b/types/crypto/signing-key.d.ts.map index b5aea9127..1185a52a8 100644 --- a/types/crypto/signing-key.d.ts.map +++ b/types/crypto/signing-key.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAYhD;;;GAGG;AACH,qBAAa,UAAU;;IAGrB;;OAEG;gBACS,UAAU,EAAE,SAAS;IAcjC;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;;;;OAKG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;;;;OAMG;IACH,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM;IAmC/B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM;IAU7C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;IAkBrE;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM;IAqB5E;;;;;;;;;OASG;IACH,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM;CAS7E"} \ No newline at end of file +{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD;;;GAGG;AACH,qBAAa,UAAU;;IAGtB;;OAEG;IACH,YAAY,UAAU,EAAE,SAAS,EAYhC;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,mDAAmD;IACnD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,sEAAsE;IACtE,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAiC9B;IAED,uGAAuG;IACvG,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAgB5C;IAED,gGAAgG;IAChG,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAgBpE;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAmB3E;IAED,6EAA6E;IAC7E,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAY3E;CACD"} \ No newline at end of file diff --git a/types/hash/message.d.ts.map b/types/hash/message.d.ts.map index 76c7dfa70..8c0421a97 100644 --- a/types/hash/message.d.ts.map +++ b/types/hash/message.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAWhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAGR"} \ No newline at end of file +{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAWhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,GACZ,MAAM,CAGR"} \ No newline at end of file diff --git a/types/hash/solidity.d.ts.map b/types/hash/solidity.d.ts.map index 251b44140..8a06af8f2 100644 --- a/types/hash/solidity.d.ts.map +++ b/types/hash/solidity.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACzB,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACzB,MAAM,CAER"} \ No newline at end of file +{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAER"} \ No newline at end of file diff --git a/types/hash/typed-data.d.ts.map b/types/hash/typed-data.d.ts.map index fc4135d06..27a189723 100644 --- a/types/hash/typed-data.d.ts.map +++ b/types/hash/typed-data.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"typed-data.d.ts","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAYjE,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAChC,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM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E,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,MAAM,CAMR;IAED,MAAM,CAAC,IAAI,CACV,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,MAAM,CAER;IAGD,OAAa,YAAY,CACxB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAC5C,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC,CAoDlD;IAED,MAAM,CAAC,UAAU,CAChB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,GAAG,CAiEL;CACD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,MAAM,CAMR"} \ No newline at end of file diff --git a/types/ipfs/index.d.ts b/types/ipfs/index.d.ts new file mode 100644 index 000000000..e1bf33eb0 --- /dev/null +++ b/types/ipfs/index.d.ts @@ -0,0 +1,18 @@ +export declare const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; +export interface IpfsGatewayOptions { + template?: string; + maxResponseBytes?: number; + timeoutMs?: number; + fetch?: typeof globalThis.fetch; +} +/** Configurable IPFS resolution and bounded JSON loading. */ +export declare class IpfsGateway { + #private; + readonly template: string; + readonly maxResponseBytes: number; + readonly timeoutMs: number; + constructor(options?: IpfsGatewayOptions); + resolve(reference: string): URL; + readJson(reference: string): Promise; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/ipfs/index.d.ts.map b/types/ipfs/index.d.ts.map new file mode 100644 index 000000000..baabf24dc --- /dev/null +++ b/types/ipfs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/ipfs/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CAChC;AACD,6DAA6D;AAC7D,qBAAa,WAAW;;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,YAAY,OAAO,GAAE,kBAAuB,EAgB3C;IACD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAe9B;IACK,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0ClD;CACD"} \ No newline at end of file diff --git a/types/logger/logger.d.ts.map b/types/logger/logger.d.ts.map index f1ca4504f..1880f0d16 100644 --- a/types/logger/logger.d.ts.map +++ b/types/logger/logger.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"logger.d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AAM,EAAE,KAAK,EAAE,GAAG,GAAG,KAAK,CAKnE;IAED,MAAM,CACL,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,SAAS,EAChB,MAAM,CAAC,EAAE,GAAG,GACV,IAAI,CAKN;IAED,cAAc,CACb,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,GACR,IAAI,CAKN;IAED,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAcrC;IAED,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAwBrD;IAED,kBAAkB,CACjB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CA4BN;IAED,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAMrC;IAED,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAc1C;IAED,MAAM,CAAC,YAAY,IAAI,MAAM,CAK5B;IAED,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CA0BnE;IAED,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAO3C;IAED,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnC;CACD"} \ No newline at end of file diff --git a/types/providers/abstract-provider.d.ts.map b/types/providers/abstract-provider.d.ts.map index ca3a7ea53..b293b4e8f 100644 --- a/types/providers/abstract-provider.d.ts.map +++ b/types/providers/abstract-provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"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EACpB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,IAAI,CAAC;IAMhB,OAAO,IAAI,IAAI;IAUf,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAUxB;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IA+BtC,MAAM,IAAI,IAAI;CAqBf"} \ No newline at end of file +{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAaN,YAAY,EAOZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAEN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACX,QAAQ,EACR,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,MAAM,eAAe,CAAC;AA2CvB,MAAM,MAAM,0BAA0B,GACnC;IACA,MAAM,EAAE,0BAA0B,CAAC;IACnC,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACnB,GACD;IACA,MAA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C,CAWlE;IAEK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBtE;IAEK,aAAa,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAc1D;IAEK,SAAS,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAa/D;IAEK,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBlE;IAEK,kBAAkB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB7D;IAGK,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;IAGK,cAAc,CACnB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;IAID,OAAO,IAAI,IAAI,CAQd;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAUxB;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CA6BrC;IAED,MAAM,IAAI,IAAI,CAoBb;CACD"} \ No newline at end of file diff --git a/types/providers/abstract-signer.d.ts.map b/types/providers/abstract-signer.d.ts.map index 41b30b933..35aaa1ca6 100644 --- a/types/providers/abstract-signer.d.ts.map +++ b/types/providers/abstract-signer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"abstract-signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KA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CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;CACnB;AAED,qBAAa,UAAW,SAAQ,cAAc;;IAC7C,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAE1B,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,EAGtD;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAE7C;IAQK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/types/providers/community.d.ts.map b/types/providers/community.d.ts.map index f8a2a68bc..e36ebbacf 100644 --- a/types/providers/community.d.ts.map +++ b/types/providers/community.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAChC;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA4BzD"} \ No newline at end of file +{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAC/B;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA4BzD"} \ No newline at end of file diff --git a/types/providers/contracts.d.ts.map b/types/providers/contracts.d.ts.map index 085cff0c7..29a278289 100644 --- a/types/providers/contracts.d.ts.map +++ b/types/providers/contracts.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAG1B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7D,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAGvD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC5E"} \ No newline at end of file +{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAG1B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7D,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAGvD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC3E"} \ No newline at end of file diff --git a/types/providers/default-provider.d.ts.map b/types/providers/default-provider.d.ts.map index a7b02c6c0..6e1d55294 100644 --- a/types/providers/default-provider.d.ts.map +++ b/types/providers/default-provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAC5C,OAAO,CAAC,EAAE,GAAG,GACZ,gBAAgB,CA6FlB"} \ No newline at end of file +{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxD,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAC5C,OAAO,CAAC,EAAE,GAAG,GACX,gBAAgB,CA6FlB"} \ No newline at end of file diff --git a/types/providers/format.d.ts.map b/types/providers/format.d.ts.map index da5b2ee35..1c35b4b35 100644 --- a/types/providers/format.d.ts.map +++ b/types/providers/format.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAIzB,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAOzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAOtD;AAKD,wBAAgB,MAAM,CACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GACvC,UAAU,CA+BZ;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAejD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAG7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAmBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAE/C;AAoBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,CAWnD;AAkBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAEtD;AA6BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,wBAAwB,CAE7E;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,GAAG,GACT,yBAAyB,CA0G3B"} \ No newline at end of file +{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAIzB,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAOzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAOtD;AAKD,wBAAgB,MAAM,CACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GACtC,UAAU,CA+BZ;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAejD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAG7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAmBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAE/C;AAoBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,CAWnD;AAkBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAEtD;AA6BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,wBAAwB,CAE7E;AAED,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,GAAG,GACR,yBAAyB,CA0G3B"} \ No newline at end of file diff --git a/types/providers/formatting.d.ts.map b/types/providers/formatting.d.ts.map index 65b377ed3..5d7ddfb6b 100644 --- a/types/providers/formatting.d.ts.map +++ b/types/providers/formatting.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwDH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;IAEhC,YAAY,EAAE,aAAa,CAAC,MAAM,GAAG,yBAAyB,CAAC,CAAC;CACjE;AAKD,MAAM,WAAW,SAAS;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE9B,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAKD,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,IAAI,GAAG,MAAM,CAAC;IAE/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAE/B,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErC,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;CACrB;AAmBD,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CACnB"} \ No newline at end of file +{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwDH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAA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CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CAClB"} \ No newline at end of file diff --git a/types/providers/index.d.ts.map b/types/providers/index.d.ts.map index 206142646..25fe43a45 100644 --- a/types/providers/index.d.ts.map +++ b/types/providers/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,GAEZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,OA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AyB,EACzB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACV,cAAc,EACd,aAAa,EACb,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE/E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,GAEX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,aAAa,GACb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,E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E/E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/types/providers/network.d.ts.map b/types/providers/network.d.ts.map index a62904576..639456c16 100644 --- a/types/providers/network.d.ts.map +++ b/types/providers/network.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN;IACE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAiBN,qBAAa,OAAO;;gBAMN,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY;IAMjD,MAAM,IAAI,GAAG;IAIb;;;;;OAKG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,EAEhC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IAmCnC;;OAEG;IACH,IAAI,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,CAElC;IAED;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAQzC;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC;IAI1E;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAChD,QAAQ,EAAE,MAAM,GACf,KAAK,CAAC,CAAC,CAAC;IAMX;;OAEG;IACH,KAAK,IAAI,OAAO;IAQhB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM;IAuBnD;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO;IAyD1C;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACb,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,WAAW,EAAE,MAAM,OAAO,GACzB,IAAI;CAeR"} \ No newline at end of file +{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GACnB,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN;IACA,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBL,qBAAa,OAAO;;IAMnB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAIhD;IAED,MAAM,IAAI,GAAG,CAEZ;IAED;;;;;OAKG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,EAEhC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAiClC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,CAElC;IAED;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAMxC;IAED;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,CAEzE;IAED;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EACjD,QAAQ,EAAE,MAAM,GACd,KAAK,CAAC,CAAC,CAAC,CAIV;IAED;;OAEG;IACH,KAAK,IAAI,OAAO,CAMf;IAED;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,CAqBlD;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAuDzC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,WAAW,EAAE,MAAM,OAAO,GACxB,IAAI,CAcN;CACD"} \ No newline at end of file diff --git a/types/providers/pagination.d.ts.map b/types/providers/pagination.d.ts.map index 5479c9c0a..8ff265391 100644 --- a/types/providers/pagination.d.ts.map +++ b/types/providers/pagination.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACnD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACf"} \ No newline at end of file +{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACpD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACd"} \ No newline at end of file diff --git a/types/providers/plugin-fallback.d.ts.map b/types/providers/plugin-fallback.d.ts.map index 6d2023762..d639bafb3 100644 --- a/types/providers/plugin-fallback.d.ts.map +++ b/types/providers/plugin-fallback.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,wBAAwB,gDACU,CAAC;AAEhD,qBAAa,oBAAqB,YAAW,sBAAsB;IACzD,IAAI,EAAE,MAAM,CAAC;;IAQrB,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB;IAMzD,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAGhE;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACvE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO;CAWhE"} \ No newline at end of file +{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,wBAAwB,gDACS,CAAC;AAE/C,qBAAa,oBAAqB,YAAW,sBAAsB;IAC1D,IAAI,EAAE,MAAM,CAAC;IAErB,cAIC;IAED,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB,CAExD;IAID,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAE9D;CACD;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACxE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAU9D;CACD"} \ No newline at end of file diff --git a/types/providers/plugins-network.d.ts.map b/types/providers/plugins-network.d.ts.map index 7c9b9b3c7..bcea34835 100644 --- a/types/providers/plugins-network.d.ts.map +++ b/types/providers/plugins-network.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"plugins-network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvD,qBAAa,aAAa;IACxB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;gBAEX,IAAI,EAAE,MAAM;IAIxB,KAAK,IAAI,aAAa;CAOvB;AAKD,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,qBAAa,gBACX,SAAQ,aACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,cAAc,EAAG,MAAM,CAAC;IAEjC,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EF,qBAAa,gBACZ,SAAQ,aACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,cAAc,EAAG,MAAM,CAAC;IAEjC,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,sBAAsB,EAAG,MAAM,CAAC;IACzC,QAAQ,CAAC,mBAAmB,EAAG,MAAM,CAAC;IAEtC,YAAY,cAAc,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,oBAAoB,EA6BhE;IAED,KAAK,IAAI,gBAAgB,CAExB;CACD;AAED,qBAAa,oBAAqB,SAAQ,aAAa;;IAGtD,IAAI,WAAW,IAAI,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,CAE1D;IAED,YAAY,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,EAGhE;IAEK,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAErD;IAED,KAAK,IAAI,oBAAoB,CAE5B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-alchemy.d.ts.map b/types/providers/provider-alchemy.d.ts.map index f2eec176b..4e4c121cd 100644 --- a/types/providers/provider-alchemy.d.ts.map +++ b/types/providers/provider-alchemy.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKL,YAAY,EACb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACV,gBAA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,MAAM,EAaxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAEK,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,CAyCtD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAkBjE;CACD"} \ No newline at end of file diff --git a/types/providers/provider-ankr.d.ts.map b/types/providers/provider-ankr.d.ts.map index 45cfc5423..d0704e281 100644 --- a/types/providers/provider-ankr.d.ts.map +++ b/types/providers/provider-ankr.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoB1E;;;;;;;;GAQG;AACH,qBAAa,YACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM;IAkBzD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAOjD;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;IAoBzE,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAchE,mBAAmB,IAAI,OAAO;CAG/B"} \ No newline at end of file +{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoB1E;;;;;;;;GAQG;AACH,qBAAa,YACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAgBxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAkBxE;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAY/D;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-browser.d.ts.map b/types/providers/provider-browser.d.ts.map index cf224c60e..890c4678c 100644 --- a/types/providers/provider-browser.d.ts.map +++ b/types/providers/provider-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,OAAO,EAAE;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC3C,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAClB;AAED,MAAM,MAAM,yBAAyB,GACjC;IACE,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;CACjD,GACD;IACE,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAC;CACb,GACD;IACE,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEN,qBAAa,eAAgB,SAAQ,yBAAyB;;gBAMhD,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,UAAU;IAwBjD,IAAI,CACR,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACvC,OAAO,CAAC,GAAG,CAAC;IAMT,KAAK,CACT,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC9C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC;IAqB/C,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK;IAiB1D,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgBrD,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAkBnE"} \ No newline at end of file +{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC/B,OAAO,CAAC,OAAO,EAAE;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC1C,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,MAAM,MAAM,yBAAyB,GAClC;IACA,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;CAC/C,GACD;IACA,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAC;CACX,GACD;IACA,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;CACZ,CAAC;AAEL,qBAAa,eAAgB,SAAQ,yBAAyB;;IAM7D,YAAY,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,UAAU,EAsBtD;IAEK,IAAI,CACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACtC,OAAO,CAAC,GAAG,CAAC,CAId;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAmB9C;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAe/D;IAEK,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAc1D;IAEK,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiBjE;CACD"} \ No newline at end of file diff --git a/types/providers/provider-cloudflare.d.ts.map b/types/providers/provider-cloudflare.d.ts.map index e70790a60..8dbb47f78 100644 --- a/types/providers/provider-cloudflare.d.ts.map +++ b/types/providers/provider-cloudflare.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;gBACzC,QAAQ,CAAC,EAAE,UAAU;CAalC"} \ No newline at end of file +{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACtD,YAAY,QAAQ,CAAC,EAAE,UAAU,EAYhC;CACD"} \ No newline at end of file diff --git a/types/providers/provider-fallback.d.ts.map b/types/providers/provider-fallback.d.ts.map index 16b3b607f..95bda52bd 100644 --- a/types/providers/provider-fallback.d.ts.map +++ b/types/providers/provider-fallback.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiC/C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAErC,QAAQ,EAAE,gBAAgB,CAAC;IAI3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD;;GAEG;AACH,MAAM,WAAW,qBACf,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IAExC,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,cAAc,EAAE,MAAM,CAAC;IAGvB,aAAa,EAAE,MAAM,CAAC;IAGtB,SAAS,EAAE,MAAM,CAAC;IAGlB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,eAAe,EAAE,MAAM,CAAC;IAGxB,KAAK,EAAE,MAAM,CAAC;CACf;AAsCD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAGpC,MAAM,EAAE,MAAM,CAA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,WAAW,qBAAsB,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IAE9E,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,cAAc,EAAE,MAAM,CAAC;IAGvB,aAAa,EAAE,MAAM,CAAC;IAGtB,SAAS,EAAE,MAAM,CAAC;IAGlB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,eAAe,EAAE,MAAM,CAAC;IAGxB,KAAK,EAAE,MAAM,CAAC;CACd;AAsCD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAGrC,MAAM,EAAE,MAAM,CAAC;IAIf,WAAW,EAAE,MAAM,CAAC;IAKpB,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AA4MF;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAO9B,YACC,SAAS,EAAE,KAAK,CAAC,gBAAgB,GAAG,sBAAsB,CAAC,EAC3D,OAAO,CAAC,EAAE,UAAU,EAwBpB;IAED,IAAI,eAAe,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAUlD;IAEK,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAIvC;IAOK,iBAAiB,CACtB,QAAQ,EAAE,gBAAgB,EAC1B,GAAG,EAAE,oBAAoB,GACvB,OAAO,CAAC,GAAG,CAAC,CAyCd;IA4QK,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,CAAC,CAmD7D;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAK7B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-infura.d.ts.map b/types/providers/provider-infura.d.ts.map index cc3baf59e..2d942d185 100644 --- a/types/providers/provider-infura.d.ts.map +++ b/types/providers/provider-infura.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAEL,YAAY,EAGb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;GAQG;AACH,qBAAa,uBACX,SAAQ,iBACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBACS,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM;IAoBpD,mBAAmB,IAAI,OAAO;CAG/B;AAED;;;;;;;;GAQG;AACH,qBAAa,cACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;gBAED,QAAQ,CAAC,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM;IAuB/B,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAOjD,mBAAmB,IAAI,OAAO;IAI9B;;OAEG;IACH,MAAM,CAAC,oBAAoB,CACzB,OAAO,CAAC,EAAE,UAAU,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,uBAAuB;IAI1B;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC5B,YAAY;CAyBhB"} \ No newline at end of file +{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAEN,YAAY,EAGZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;GAQG;AACH,qBAAa,uBACZ,SAAQ,iBACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,YAAY,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,EAkBnD;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD;AAED;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAqB7B;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAC1B,OAAO,CAAC,EAAE,UAAU,EACpB,SAAS,CAAC,EAAE,MAAM,GAChB,uBAAuB,CAEzB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC3B,YAAY,CAwBd;CACD"} \ No newline at end of file diff --git a/types/providers/provider-ipcsocket.d.ts b/types/providers/provider-ipcsocket.d.ts index a9ee3bfc9..9f92c9d4f 100644 --- a/types/providers/provider-ipcsocket.d.ts +++ b/types/providers/provider-ipcsocket.d.ts @@ -1,4 +1,4 @@ -/// +/// import { SocketProvider } from "./provider-socket.js"; import type { Socket } from "net"; import type { Networkish } from "./network.js"; diff --git a/types/providers/provider-ipcsocket.d.ts.map b/types/providers/provider-ipcsocket.d.ts.map index 91d6287d7..93bec7dd7 100644 --- a/types/providers/provider-ipcsocket.d.ts.map +++ b/types/providers/provider-ipcsocket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB/C,qBAAa,iBAAkB,SAAQ,cAAc;;IAEnD,IAAI,MAAM,IAAI,MAAM,CAEnB;gBAEW,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU;IA8B9C,OAAO,IAAI,IAAI;IAOT,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C"} \ No newline at end of file +{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB/C,qBAAa,iBAAkB,SAAQ,cAAc;;IAEpD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EA+B7C;IAED,OAAO,IAAI,IAAI,CAKd;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/types/providers/provider-jsonrpc.d.ts.map b/types/providers/provider-jsonrpc.d.ts.map index 5e8ed8fa0..0635f491a 100644 --- a/types/providers/provider-jsonrpc.d.ts.map +++ b/types/providers/provider-jsonrpc.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAUL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAA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CAAC,EAAE,yBAAyB;IAcrC,cAAc,IAAI,YAAY;IAIxB,IAAI,CACR,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACvC,OAAO,CAAC,GAAG,CAAC;IAST,KAAK,CACT,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC9C,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;CAgBjC"} \ No newline at end of file +{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAUN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOvC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACX,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuD1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;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AK,CAgHhE;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAgB3E;IAED;;;;;;;;;;;OAWG;IACG,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA8BjE;IAEK,YAAY,IAAI,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAGlD;CACD;AAED,8BAAsB,yBAA0B,SAAQ,kBAAkB;;IAEzE,YAAY,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB,EAIpE;IAED,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAM5C;IAED;;OAEG;IACH,IAAI,eAAe,IAAI,MAAM,CAE5B;IACD,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAUhC;CACD;AAED;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,yBAAyB;;IAG7D,YACC,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,EAC3B,OAAO,CAAC,EAAE,UAAU,EACpB,OAAO,CAAC,EAAE,yBAAyB,EAYnC;IAED,cAAc,IAAI,YAAY,CAE7B;IAEK,IAAI,CACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACtC,OAAO,CAAC,GAAG,CAAC,CAOd;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAe/B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-pocket.d.ts.map b/types/providers/provider-pocket.d.ts.map index fc500ed76..aaf617488 100644 --- a/types/providers/provider-pocket.d.ts.map +++ b/types/providers/provider-pocket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB/C;;;;;;;;GAQG;AACH,qBAAa,cACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;gBAED,QAAQ,CAAC,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM;IA4BnC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAWjD;;;OAGG;IACH,MAAM,CAAC,UAAU,CACf,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAChC,YAAY;IAwBf,mBAAmB,IAAI,OAAO;CAG/B"} \ No newline at end of file +{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB/C;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,EA0BjC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAShD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAC/B,YAAY,CAsBd;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-quicknode.d.ts.map b/types/providers/provider-quicknode.d.ts.map index 8b27f9f9d..f3be4df32 100644 --- a/types/providers/provider-quicknode.d.ts.map +++ b/types/providers/provider-quicknode.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEL,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B/C;;;;;;;;GAQG;AACH,qBAAa,iBACX,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;gBACS,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM;IAexD,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAOjD,mBAAmB,IAAI,OAAO;IAI9B;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY;CAoBzE"} \ No newline at end of file +{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B/C;;;;;;;;GAQG;AACH,qBAAa,iBACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,EAavD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAmBvE;CACD"} \ No newline at end of file diff --git a/types/providers/provider-socket.d.ts.map b/types/providers/provider-socket.d.ts.map index bdbc5029a..e919560e4 100644 --- a/types/providers/provider-socket.d.ts.map +++ b/types/providers/provider-socket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-socket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU/C,qBAAa,gBAAiB,YAAW,UAAU;;IAIjD,IAAI,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAEvB;gBAOW,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC;IAQxD,KAAK,IAAI,IAAI;IASb,IAAI,IAAI,IAAI;IASZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAUtC,MAAM,IAAI,IAAI;IAId,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IAqB5B,KAAK,C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E3B;IAED,YAAY,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAGxD;IAEK,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjE;CACD;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;;IAiBrD,YAAY,OAAO,CAAC,EAAE,UAAU,EAK/B;IAYD,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAkB5C;IAED,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI,CASvE;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAuB9C;IAkBK,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCpD;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/types/providers/provider-websocket.d.ts.map b/types/providers/provider-websocket.d.ts.map index a60b262ca..57f785f9c 100644 --- a/types/providers/provider-websocket.d.ts.map +++ b/types/providers/provider-websocket.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider-websocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9C,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAA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,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD,qBAAa,iBAAkB,SAAQ,cAAc;;IAIpD,IAAI,SAAS,IAAI,aAAa,CAK7B;IAED,YACC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,gBAAgB,EAC9C,OAAO,CAAC,EAAE,UAAU,EA4CpB;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAM7B;CACD"} \ No newline at end of file diff --git a/types/providers/provider.d.ts.map b/types/providers/provider.d.ts.map index fdfa52655..5f7427dc0 100644 --- a/types/providers/provider.d.ts.map +++ b/types/providers/provider.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAE7C,OAAO,EACL,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,iBAAiB,CAAC;AAoBzB;;;GAGG;AACH,qBAAa,OAAO;IAClB;;O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E,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAClD"} \ No newline at end of file diff --git a/types/providers/signer-noncemanager.d.ts.map b/types/providers/signer-noncemanager.d.ts.map index 9f69385c3..ccd407c82 100644 --- a/types/providers/signer-noncemanager.d.ts.map +++ b/types/providers/signer-noncemanager.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signer-noncemanager.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,YAAa,SAAQ,cAAc;;IAC9C,MAAM,EAAG,MAAM,CAAC;gBAKJ,MAAM,EAAE,MAAM;IAQpB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,YAAY;IAI1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAapD,SAAS,IAAI,IAAI;IAIjB,KAAK,IAAI,IAAI;IAKP,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAY3E,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIxD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAI1D,aAAa,CACX,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACzB,OAAO,CAAC,MAAM,CAAC;CAGnB"} \ No newline at end of file +{"version":3,"file":"signer-noncemanager.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,YAAa,SAAQ,cAAc;;IAC/C,MAAM,EAAG,MAAM,CAAC;IAKhB,YAAY,MAAM,EAAE,MAAM,EAMzB;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,YAAY,CAE/C;IAEK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAWnD;IAED,SAAS,IAAI,IAAI,CAEhB;IAED,KAAK,IAAI,IAAI,CAGZ;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAU1E;IAED,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvD;IAED,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzD;IAED,aAAa,CACZ,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/types/providers/signer.d.ts.map b/types/providers/signer.d.ts.map index 4dff87bbe..d5935e8bb 100644 --- a/types/providers/signer.d.ts.map +++ b/types/providers/signer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,WAAW,EAAE,cAAc,EAAE,YAAY;IACvE;;OAEG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IAK3C;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAK/C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvE;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAK9E;;;;;;;;;;;;;;OAcG;IACH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,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/types/providers/subscriber-connection.d.ts.map b/types/providers/subscriber-connection.d.ts.map index 2f88c6893..baef99405 100644 --- a/types/providers/subscriber-connection.d.ts.map +++ b/types/providers/subscriber-connection.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAErD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;gBAQ9C,QAAQ,EAAE,qBAAqB;IAO3C,KAAK,IAAI,IAAI;IAiBb,IAAI,IAAI,IAAI;IAYZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAOtC,MAAM,IAAI,IAAI;CAGf"} \ No newline at end of file +{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAEtD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;IAQ3D,YAAY,QAAQ,EAAE,qBAAqB,EAK1C;IAED,KAAK,IAAI,IAAI,CAeZ;IAED,IAAI,IAAI,IAAI,CAUX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/types/providers/subscriber-filterid.d.ts.map b/types/providers/subscriber-filterid.d.ts.map index b2d81a26c..957e1320c 100644 --- a/types/providers/subscriber-filterid.d.ts.map +++ b/types/providers/subscriber-filterid.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,YAAW,UAAU;;gBAYvC,QAAQ,EAAE,kBAAkB;IAaxC,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzD,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3E,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU;IAkEhD,KAAK,IAAI,IAAI;IASb,IAAI,I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G,OAAO,CAAC,IAAI,CAAC,CAE1E;IAED,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAE/C;IAgED,KAAK,IAAI,IAAI,CAOZ;IAED,IAAI,IAAI,IAAI,CASX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;;IAG9D,YAAY,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAG5D;IAED,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAE/C;IAEK,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAG9D;IAEK,YAAY,CACjB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;CACD;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,kBAAkB;IAC1D,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D;IAEK,YAAY,CACjB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;CACD"} \ No newline at end of file diff --git a/types/providers/subscriber-polling.d.ts.map b/types/providers/subscriber-polling.d.ts.map index 9082a53d0..9fd6aa7aa 100644 --- a/types/providers/subscriber-polling.d.ts.map +++ b/types/providers/subscriber-polling.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"subscriber-polling.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE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3C,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW;IAmC3D,KAAK,IAAI,IAAI;IAcb,IAAI,IAAI,IAAI;IASZ,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI;IAOtC,MAAM,IAAI,IAAI;CAGf"} \ No newline at end of file +{"version":3,"file":"subscriber-polling.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9E;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,aAAa,GAClB,UAAU,CAYZ;AAID;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAUxD,YAAY,QAAQ,EAAE,gBAAgB,EAMrC;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IACD,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAEhC;IA2CD,KAAK,IAAI,IAAI,CASZ;IAED,IAAI,IAAI,IAAI,CAMX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,UAAU;;IAKnD,YAAY,QAAQ,EAAE,gBAAgB,EAMrC;IAEK,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E;IAED,KAAK,IAAI,IAAI,CAQZ;IAED,IAAI,IAAI,IAAI,CAOX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAErC;IACD,MAAM,IAAI,IAAI,CAEb;CACD;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,iBAAiB;;IAG7D,YAAY,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAG3D;IAEK,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1E;CACD;AAED;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,iBAAiB;;IAGlE,YAAY,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAGnD;IAEK,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1E;CACD;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAWxD,YAAY,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAM1D;IA6BD,KAAK,IAAI,IAAI,CAYZ;IAED,IAAI,IAAI,IAAI,CAOX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/types/transaction/address.d.ts.map b/types/transaction/address.d.ts.map index 620aa31e9..48e65cc8e 100644 --- a/types/transaction/address.d.ts.map +++ b/types/transaction/address.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EAAE,MAAM,GACb,MAAM,CAIR;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,MAAM,EAAE,MAAM,GACb,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACb,MAAM,CAIR;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"} \ No newline at end of file +{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAC9B,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AAED,wBAAgB,cAAc,CAC7B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"} \ No newline at end of file diff --git a/types/transaction/index.d.ts.map b/types/transaction/index.d.ts.map index 304612964..4c5a4305f 100644 --- a/types/transaction/index.d.ts.map +++ b/types/transaction/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAI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,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/types/transaction/transaction.d.ts.map b/types/transaction/transaction.d.ts.map index f298b00da..e3c637686 100644 --- a/types/transaction/transaction.d.ts.map +++ b/types/transaction/transaction.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM;IACzC;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAEhC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,aAAa,CAAC;CAClC;AA2HD;;;;;;;;;;;;GAYG;AACH,qBAAa,WAAY,YAAW,eAAe,CAAC,MAAM,CAAC;;IAUzD;;;OAGG;IACH,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E,SAAS,CAAC;KACtB;IAKD;;;;;OAKG;IACH,IAAI,UAAU,IAAI,MAAM,CAQvB;IAED;;;;;OAKG;IACH,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,KAAK,IAAI,WAAW;IAIpB;;OAEG;IACH,MAAM,IAAI,GAAG;IAoBb;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW;CA6DhE"} \ No newline at end of file +{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM;IAC1C;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAEhC;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,aAAa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WAAW,GAAG;QACjC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,SAAS,CAAC;KACrB,CAGA;IAED;;;;;OAKG;IACH,IAAI,UAAU,IAAI,MAAM,CAQvB;IAED;;;;;OAKG;IACH,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,KAAK,IAAI,WAAW,CAEnB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CAkBZ;IAED;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW,CA4D9D;CACD"} \ No newline at end of file diff --git a/types/utils/data.d.ts.map b/types/utils/data.d.ts.map index b82bf731e..3b65817ca 100644 --- a/types/utils/data.d.ts.map +++ b/types/utils/data.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAClC,CAAC;AACF,MAAM,WAAW,OAAO;IACtB,WAAW,IAAI,MAAM,CAAC;CACvB;AASD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAsBlD;AA2BD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAA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CAuDZ;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAMjE"} \ No newline at end of file diff --git a/types/utils/errors.d.ts.map b/types/utils/errors.d.ts.map index de9bc0ec5..b9eff4781 100644 --- a/types/utils/errors.d.ts.map +++ b/types/utils/errors.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAiDhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,SAAS,GAEjB,eAAe,GACf,iBAAiB,GACjB,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,SAAS,GACT,UAAU,GACV,WAAW,GAGX,gBAAgB,GAChB,eAAe,GAGf,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,GACrB,gBAAgB,GAGhB,gBAAgB,GAChB,oBAAoB,GACpB,eAAe,GACf,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,gBAAgB,GAGhB,iBAAiB,CAAC;AAEtB;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,KAAK;IACzE;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;IAEhB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE3B;;OAEG;IACH,KAAK,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;;GAKG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,GAAG,EACf,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAoBN"} \ No newline at end of file +{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACX,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAiDhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,MAAM,SAAS,GAElB,eAAe,GACf,iBAAiB,GACjB,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,SAAS,GACT,UAAU,GACV,WAAW,GAGX,gBAAgB,GAChB,eAAe,GAGf,kBAAkB,GAClB,kBAAkB,GAClB,qBAAqB,GACrB,gBAAgB,GAGhB,gBAAgB,GAChB,oBAAoB,GACpB,eAAe,GACf,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,gBAAgB,GAGhB,iBAAiB,CAAC;AAErB;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,CAAE,SAAQ,KAAK;IAC1E;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;IAEhB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACd;AAID;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,WAAW,CAAC,eAAe,CA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AAS,CAAC,EAAE,MAAM,GAChB,IAAI,CAoBN"} \ No newline at end of file diff --git a/types/utils/events.d.ts.map b/types/utils/events.d.ts.map index 13c18f4ef..140670f11 100644 --- a/types/utils/events.d.ts.map +++ b/types/utils/events.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC;;;OAGG;IACH,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtD;;OAEG;IACH,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE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C;IAE1C;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,qBAAa,YAAY,CAAC,CAAC;;IAC1B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,CAAC,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAIvC;;;OAGG;IACH,YACC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC5B,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,CAAC,EAIT;IAED;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpC;CACD"} \ No newline at end of file diff --git a/types/utils/fetch.d.ts.map b/types/utils/fetch.d.ts.map index 1319c39a1..59bbdc142 100644 --- a/types/utils/fetch.d.ts.map +++ b/types/utils/fetch.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MA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CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,CAAC,EAAE,YAAY,EAetB;IAED;;;;OAIG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,aAAa,CAiB9D;IAED;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAiB1D;IAED;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7B;IAED;;OAEG;IACH,OAAO,IAAI,IAAI,IAAI,aAAa,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAEtD;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,IAAI,GAAG,YAAY,CAEjC;IAED;;OAEG;IACH,EAAE,IAAI,OAAO,CAMZ;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAaf;CACD"} \ No newline at end of file diff --git a/types/utils/fixednumber.d.ts.map b/types/utils/fixednumber.d.ts.map index 2f8afd8ab..0acb110cb 100644 --- a/types/utils/fixednumber.d.ts.map +++ b/types/utils/fixednumber.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4C1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,MAAM,GACN;IACE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAoJN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,WAAW;;IACtB;;OAEG;IACH,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E,WAAW,GAAG,MAAM,CAoB9B;IAED;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE9B;IAED;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE9B;IAED;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE/B;IAED;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE9B;IAED;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE/B;IAED;;;;;OAKG;IACH,KAAK,IAAI,WAAW,CAOnB;IAED;;;;;OAKG;IACH,OAAO,IAAI,WAAW,CAOrB;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAoBpC;IAED;;OAEG;IACH,MAAM,IAAI,OAAO,CAEhB;IAED;;OAEG;IACH,UAAU,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,QAAQ,IAAI,MAAM,CAEjB;IAED;;;;;;OAMG;IACH,aAAa,IAAI,MAAM,CAEtB;IAED;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAEzC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,CACf,MAAM,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,WAAW,GACnB,WAAW,CA4Bb;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAuCpE;IAED;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAWtE;CACD"} \ No newline at end of file diff --git a/types/utils/geturl-browser.d.ts b/types/utils/geturl-browser.d.ts index 133a13813..29cebe088 100644 --- a/types/utils/geturl-browser.d.ts +++ b/types/utils/geturl-browser.d.ts @@ -1,21 +1,3 @@ import type { FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -declare global { - class Headers { - constructor(values: Array<[string, string]>); - forEach(func: (v: string, k: string) => void): void; - } - class Response { - status: number; - statusText: string; - headers: Headers; - arrayBuffer(): Promise; - } - type FetchInit = { - method?: string; - headers?: Headers; - body?: Uint8Array; - }; - function fetch(url: string, init: FetchInit): Promise; -} export declare function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise; //# sourceMappingURL=geturl-browser.d.ts.map \ No newline at end of file diff --git a/types/utils/geturl-browser.d.ts.map b/types/utils/geturl-browser.d.ts.map index 852575bca..3190d62cc 100644 --- a/types/utils/geturl-browser.d.ts.map +++ b/types/utils/geturl-browser.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,OAAO,CAAC,MAAM,CAAC;IAEb,MAAM,OAAO;oBACC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3C,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;KACpD;IAGD,MAAM,QAAQ;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;KACpC;IAED,KAAK,SAAS,GAAG;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,IAAI,CAAC,EAAE,UAAU,CAAC;KACnB,CAAC;IAEF,SAAS,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACjE;AAID,wBAAsB,MAAM,CAC1B,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA0DrC"} \ No newline at end of file +{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAIpB,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA0DrC"} \ No newline at end of file diff --git a/types/utils/geturl.d.ts.map b/types/utils/geturl.d.ts.map index 8cde884db..7728357a3 100644 --- a/types/utils/geturl.d.ts.map +++ b/types/utils/geturl.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,MAAM,CAC1B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,cAAc,CAAC,CAqGzB"} \ No newline at end of file +{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,cAAc,CAAC,CAqGzB"} \ No newline at end of file diff --git a/types/utils/index.d.ts.map b/types/utils/index.d.ts.map index 2efd33012..2be8f026a 100644 --- a/types/utils/index.d.ts.map +++ b/types/utils/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,GACV,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,eAAe,EACf,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACL,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1E,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACf,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAKnC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,YAAY,EAIV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9D,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EACV,aAAa,EACb,wBAAwB,EACxB,eAAe,GAChB,MAAM,WAAW,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,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iB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9D,YAAY,EACX,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,GACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EACX,aAAa,EACb,wBAAwB,EACxB,eAAe,GACf,MAAM,WAAW,CAAC"} \ No newline at end of file diff --git a/types/utils/properties.d.ts.map b/types/utils/properties.d.ts.map index 2520af8fb..b675427ea 100644 --- a/types/utils/properties.d.ts.map +++ b/types/utils/properties.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAC/C,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACrC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACjC,KAAK,CAAC,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAAE,GAClC,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,EACX,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACtC,IAAI,CAcN"} \ No newline at end of file +{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAChD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACjC,KAAK,CAAC,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAAE,GACjC,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC9B,MAAM,EAAE,GAAG,EACX,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACrC,IAAI,CAcN"} \ No newline at end of file diff --git a/types/utils/units.d.ts.map b/types/utils/units.d.ts.map index 3db242e6c..fef9d60bc 100644 --- a/types/utils/units.d.ts.map +++ b/types/utils/units.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB/D;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,YAAY,EACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GACtB,MAAM,CAWR;AAED;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,QAAS,MAAM,GAAG,MAAM,oBA6CvD,CAAC;AACF,eAAO,MAAM,YAAY,MAAO,MAAM,8BAQrC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAsBzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"} \ No newline at end of file +{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,YAAY,EACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GACrB,MAAM,CAWR;AAED;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,QAAS,MAAM,GAAG,MAAM,oBA6CvD,CAAC;AACF,eAAO,MAAM,YAAY,MAAO,MAAM,8BAQrC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAsBzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"} \ No newline at end of file diff --git a/types/utils/utf8.d.ts.map b/types/utils/utf8.d.ts.map index f79c87b2e..febc8e114 100644 --- a/types/utils/utf8.d.ts.map +++ b/types/utils/utf8.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"utf8.d.ts","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,eAAe,GACvB,qBAAqB,GACrB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,UAAU,CAAC;AAEf;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EACrB,YAAY,CAAC,EAAE,MAAM,KAClB,MAAM,CAAC;AAwEZ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACnC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,aAAa,CAAC,CAKrD,CAAC;AA2GH;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC9B,UAAU,CAwCZ;AAkBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,aAAa,GACtB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC9B,KAAK,CAAC,MAAM,CAAC,CAEf"} \ No newline at end of file +{"version":3,"file":"utf8.d.ts","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,eAAe,GACxB,qBAAqB,GACrB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,UAAU,CAAC;AAEd;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,CAC3B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EACrB,YAAY,CAAC,EAAE,MAAM,KACjB,MAAM,CAAC;AAwEZ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACpC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,aAAa,CAAC,CAKpD,CAAC;AA2GH;;;;GAIG;AACH,wBAAgB,WAAW,CAC1B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,UAAU,CAwCZ;AAkBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,aAAa,GACrB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,KAAK,CAAC,MAAM,CAAC,CAEf"} \ No newline at end of file diff --git a/types/wallet/base-wallet.d.ts.map b/types/wallet/base-wallet.d.ts.map index dc25c591a..9b7a9bb96 100644 --- a/types/wallet/base-wallet.d.ts.map +++ b/types/wallet/base-wallet.d.ts.map @@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AClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAgCjB;CACD"} \ No newline at end of file diff --git a/types/wallet/english_words.d.ts.map b/types/wallet/english_words.d.ts.map index 15a3e8323..b0bd73fa9 100644 --- a/types/wallet/english_words.d.ts.map +++ b/types/wallet/english_words.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"english_words.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,i0VACuyV,CAAC"} \ No newline at end of file +{"version":3,"file":"english_words.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,i0VACsyV,CAAC"} \ No newline at end of file diff --git a/types/wallet/hdwallet.d.ts.map b/types/wallet/hdwallet.d.ts.map index cc249d4de..6ff875955 100644 --- a/types/wallet/hdwallet.d.ts.map +++ b/types/wallet/hdwallet.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"hdwallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAA0B,UAAU,EAAU,MAAM,oBAAoB,CAAC;AAUhF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAetD;;GA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,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACX,YAAY,CASd;IACD,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAGjE;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAiBf;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,YAAY,CAOf;CACD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAStD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAS7D"} \ No newline at end of file diff --git a/types/wallet/index.d.ts.map b/types/wallet/index.d.ts.map index fc93212da..f380a0adc 100644 --- a/types/wallet/index.d.ts.map +++ b/types/wallet/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACb,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file diff --git a/types/wallet/json-crowdsale.d.ts.map b/types/wallet/json-crowdsale.d.ts.map index 4514aef1b..db8057554 100644 --- a/types/wallet/json-crowdsale.d.ts.map +++ b/types/wallet/json-crowdsale.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAaA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC7B,gBAAgB,CAmClB"} \ No newline at end of file +{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,gBAAgB,CAmClB"} \ No newline at end of file diff --git a/types/wallet/json-keystore.d.ts.map b/types/wallet/json-keystore.d.ts.map index a56cc644a..742508cc1 100644 --- a/types/wallet/json-keystore.d.ts.map +++ b/types/wallet/json-keystore.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ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AC,MAAM,CAAC,CAiBjB"} \ No newline at end of file +{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACR,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASpD;AAkLD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,eAAe,CAmBjB;AAUD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,EAC9B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,eAAe,CAAC,CA2B1B;AA8ID;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,MAAM,CASR;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,MAAM,CAAC,CAiBjB"} \ No newline at end of file diff --git a/types/wallet/mnemonic.d.ts.map b/types/wallet/mnemonic.d.ts.map index 82d411a3d..1f5e4541d 100644 --- a/types/wallet/mnemonic.d.ts.map +++ b/types/wallet/mnemonic.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA6HtD;;;GAGG;AACH,qBAAa,QAAQ;IACnB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAE1B;;OAEG;gBAED,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ;IAY5B;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;;;;OAKG;IACH,MAAM,C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IACH,YACC,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,EAU1B;IAED;;OAEG;IACH,WAAW,IAAI,MAAM,CAEpB;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,QAAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,GAAG,QAAQ,CAKX;IAED;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CACjB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,QAAQ,CAIV;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CACrB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,MAAM,CAGR;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAEzE;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,OAAO,CAM1E;CACD"} \ No newline at end of file diff --git a/types/wallet/mnemonicToSeed.d.ts.map b/types/wallet/mnemonicToSeed.d.ts.map index fa7e673dc..87afb28cf 100644 --- a/types/wallet/mnemonicToSeed.d.ts.map +++ b/types/wallet/mnemonicToSeed.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"mnemonicToSeed.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E"} \ No newline at end of file +{"version":3,"file":"mnemonicToSeed.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E"} \ No newline at end of file diff --git a/types/wallet/wallet.d.ts.map b/types/wallet/wallet.d.ts.map index edbeaa1bd..b640b9ef5 100644 --- a/types/wallet/wallet.d.ts.map +++ b/types/wallet/wallet.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAe,YAAY,EAAE,MAAM,eAAe,CAAC;AAW1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AActD;;;;;;;;;GASG;AACH,qBAAa,MAAO,SAAQ,UAAU;;IACpC;;;OAGG;gBACS,EACV,GAAG,EACH,MAAM,EACN,QAAQ,GACT,EAAE;QACD,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC5B;IAaD,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM;IAQ1C;;;;;;OAMG;IACG,OAAO,CACX,QAAQ,EAAE,UAAU,GAAG,MAAM,EAC7B,gBAAgB,CAAC,EAAE,gBA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AAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,YAAY,CAUf;IACD,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAUf;CACD"} \ No newline at end of file diff --git a/types/wordlists/enwords.d.ts.map b/types/wordlists/enwords.d.ts.map index 95d94c6d6..ff2c89431 100644 --- a/types/wordlists/enwords.d.ts.map +++ b/types/wordlists/enwords.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"enwords.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,i0VAC4yV,CAAC"} \ No newline at end of file +{"version":3,"file":"enwords.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,i0VAC2yV,CAAC"} \ No newline at end of file diff --git a/types/wordlists/generation/encode-latin.d.ts.map b/types/wordlists/generation/encode-latin.d.ts.map index 87eca3714..0a1f29f5d 100644 --- a/types/wordlists/generation/encode-latin.d.ts.map +++ b/types/wordlists/generation/encode-latin.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAyIA,qBAAa,SAAS;;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBAKX,KAAK,EAAE,MAAM;IAMzB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAW1B,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA8BjB;CACF;AAED,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IACpD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB,CA+FA;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAmDA"} \ No newline at end of file +{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAyIA,qBAAa,SAAS;;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAKvB,YAAY,KAAK,EAAE,MAAM,EAIxB;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CASzB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA8BjB;CACD;AAED,MAAM,WAAW,SAAS;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IACrD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,CA+FA;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb,CAmDA"} \ No newline at end of file diff --git a/types/wordlists/lang-cz.d.ts.map b/types/wordlists/lang-cz.d.ts.map index 0db7b336b..344196e7e 100644 --- a/types/wordlists/lang-cz.d.ts.map +++ b/types/wordlists/lang-cz.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-en.d.ts.map b/types/wordlists/lang-en.d.ts.map index c43c99b64..bcff43d4d 100644 --- a/types/wordlists/lang-en.d.ts.map +++ b/types/wordlists/lang-en.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-es.d.ts.map b/types/wordlists/lang-es.d.ts.map index 1f4b7bb34..e52928599 100644 --- a/types/wordlists/lang-es.d.ts.map +++ b/types/wordlists/lang-es.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACtC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-fr.d.ts.map b/types/wordlists/lang-fr.d.ts.map index 3f40d40a0..c10fb3e78 100644 --- a/types/wordlists/lang-fr.d.ts.map +++ b/types/wordlists/lang-fr.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-fr.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-fr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACtC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-fr.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-fr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-it.d.ts.map b/types/wordlists/lang-it.d.ts.map index 52039429e..fbb232db7 100644 --- a/types/wordlists/lang-it.d.ts.map +++ b/types/wordlists/lang-it.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-it.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-it.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-it.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-it.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-ja.d.ts.map b/types/wordlists/lang-ja.d.ts.map index f4acbfdf3..82a3ec1e4 100644 --- a/types/wordlists/lang-ja.d.ts.map +++ b/types/wordlists/lang-ja.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6IzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC;;;;;;;OAOG;;IAKH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6IzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-ko.d.ts.map b/types/wordlists/lang-ko.d.ts.map index 8b8d34088..4e6fdeecb 100644 --- a/types/wordlists/lang-ko.d.ts.map +++ b/types/wordlists/lang-ko.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC;;;;;;;OAOG;;IAKH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-pt.d.ts.map b/types/wordlists/lang-pt.d.ts.map index c979f9c09..024c97c03 100644 --- a/types/wordlists/lang-pt.d.ts.map +++ b/types/wordlists/lang-pt.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACrC;;;;;;;OAOG;;IAKH;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM;CAM1B"} \ No newline at end of file +{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-zh.d.ts.map b/types/wordlists/lang-zh.d.ts.map index 8dd1943aa..06d1b5870 100644 --- a/types/wordlists/lang-zh.d.ts.map +++ b/types/wordlists/lang-zh.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IAClC;;;;;;;;;OASG;gBACS,OAAO,EAAE,MAAM;IAI3B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIlC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAKpC;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAMzC"} \ No newline at end of file +{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;;;OASG;IACH,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKvC;CACD"} \ No newline at end of file diff --git a/types/wordlists/wordlist-owl.d.ts.map b/types/wordlists/wordlist-owl.d.ts.map index c0dcec9e9..cb5198fb8 100644 --- a/types/wordlists/wordlist-owl.d.ts.map +++ b/types/wordlists/wordlist-owl.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIvC;;;OAGG;gBACS,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAO1D,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;IAsB7B,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAW9B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAGnC"} \ No newline at end of file +{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIxC;;;OAGG;IACH,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAKzD;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;IAoBD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;CACD"} \ No newline at end of file diff --git a/types/wordlists/wordlist-owla.d.ts.map b/types/wordlists/wordlist-owla.d.ts.map index a02c1dff5..ed20b28e0 100644 --- a/types/wordlists/wordlist-owla.d.ts.map +++ b/types/wordlists/wordlist-owla.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;gBAG/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAK1E,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;CAG9B"} \ No newline at end of file +{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;IAG5C,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAGzE;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;CACD"} \ No newline at end of file diff --git a/types/wordlists/wordlist.d.ts.map b/types/wordlists/wordlist.d.ts.map index ef52e4565..c298de76e 100644 --- a/types/wordlists/wordlist.d.ts.map +++ b/types/wordlists/wordlist.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC5B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAIpC;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM;IAIlC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAEvC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAC3C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM;CAYzC"} \ No newline at end of file +{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC7B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAM,EAAE,MAAM,EAEzB;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAEnC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAWvC;CACD"} \ No newline at end of file From 387dd6858103e61599769990c98e40b082ebc22b Mon Sep 17 00:00:00 2001 From: Rastislav Date: Mon, 7 Sep 2026 09:19:04 +0200 Subject: [PATCH 2/4] Remove generated build artifacts and dependency lockfile --- .gitattributes | 7 - dist/README.md | 22 - dist/corebc.js | 46160 --------------- dist/corebc.js.map | 1 - dist/corebc.min.js | 1 - dist/corebc.umd.js | 46361 ---------------- dist/corebc.umd.js.map | 1 - dist/corebc.umd.min.js | 1 - dist/wordlists-extra.js | 5563 -- dist/wordlists-extra.js.map | 1 - dist/wordlists-extra.min.js | 1 - lib.commonjs/README.md | 16 - lib.commonjs/_tests/blockchain-data.d.ts | 83 - lib.commonjs/_tests/blockchain-data.d.ts.map | 1 - lib.commonjs/_tests/blockchain-data.js | 246 - lib.commonjs/_tests/blockchain-data.js.map | 1 - lib.commonjs/_tests/create-provider.d.ts | 8 - lib.commonjs/_tests/create-provider.d.ts.map | 1 - lib.commonjs/_tests/create-provider.js | 172 - lib.commonjs/_tests/create-provider.js.map | 1 - lib.commonjs/_tests/test-cip.d.ts | 2 - lib.commonjs/_tests/test-cip.d.ts.map | 1 - lib.commonjs/_tests/test-cip.js | 194 - lib.commonjs/_tests/test-cip.js.map | 1 - lib.commonjs/_tests/test-contract.d.ts | 2 - lib.commonjs/_tests/test-contract.d.ts.map | 1 - lib.commonjs/_tests/test-contract.js | 129 - lib.commonjs/_tests/test-contract.js.map | 1 - lib.commonjs/_tests/test-crypto.d.ts | 2 - lib.commonjs/_tests/test-crypto.d.ts.map | 1 - lib.commonjs/_tests/test-crypto.js | 79 - lib.commonjs/_tests/test-crypto.js.map | 1 - lib.commonjs/_tests/test-keystore.d.ts | 2 - lib.commonjs/_tests/test-keystore.d.ts.map | 1 - lib.commonjs/_tests/test-keystore.js | 82 - lib.commonjs/_tests/test-keystore.js.map | 1 - lib.commonjs/_tests/types.d.ts | 191 - lib.commonjs/_tests/types.d.ts.map | 1 - lib.commonjs/_tests/types.js | 3 - lib.commonjs/_tests/types.js.map | 1 - lib.commonjs/_version.d.ts | 3 - lib.commonjs/_version.d.ts.map | 1 - lib.commonjs/_version.js | 7 - lib.commonjs/_version.js.map | 1 - lib.commonjs/abi-types/Tes.d.ts | 223 - lib.commonjs/abi-types/Tes.d.ts.map | 1 - lib.commonjs/abi-types/Tes.js | 3 - lib.commonjs/abi-types/Tes.js.map | 1 - lib.commonjs/abi-types/Tes_abi.d.ts | 223 - lib.commonjs/abi-types/Tes_abi.d.ts.map | 1 - lib.commonjs/abi-types/Tes_abi.js | 3 - lib.commonjs/abi-types/Tes_abi.js.map | 1 - lib.commonjs/abi-types/common.d.ts | 51 - lib.commonjs/abi-types/common.d.ts.map | 1 - lib.commonjs/abi-types/common.js | 3 - lib.commonjs/abi-types/common.js.map | 1 - .../abi-types/factories/Tes__factory.d.ts | 280 - .../abi-types/factories/Tes__factory.d.ts.map | 1 - .../abi-types/factories/Tes__factory.js | 413 - .../abi-types/factories/Tes__factory.js.map | 1 - .../abi-types/factories/Tes_abi__factory.d.ts | 280 - .../factories/Tes_abi__factory.d.ts.map | 1 - .../abi-types/factories/Tes_abi__factory.js | 413 - .../factories/Tes_abi__factory.js.map | 1 - lib.commonjs/abi-types/factories/index.d.ts | 2 - .../abi-types/factories/index.d.ts.map | 1 - lib.commonjs/abi-types/factories/index.js | 10 - lib.commonjs/abi-types/factories/index.js.map | 1 - lib.commonjs/abi-types/index.d.ts | 4 - lib.commonjs/abi-types/index.d.ts.map | 1 - lib.commonjs/abi-types/index.js | 10 - lib.commonjs/abi-types/index.js.map | 1 - lib.commonjs/abi/abi-coder.d.ts | 59 - lib.commonjs/abi/abi-coder.d.ts.map | 1 - lib.commonjs/abi/abi-coder.js | 216 - lib.commonjs/abi/abi-coder.js.map | 1 - lib.commonjs/abi/bytes32.d.ts | 15 - lib.commonjs/abi/bytes32.d.ts.map | 1 - lib.commonjs/abi/bytes32.js | 55 - lib.commonjs/abi/bytes32.js.map | 1 - lib.commonjs/abi/coders/abstract-coder.d.ts | 117 - .../abi/coders/abstract-coder.d.ts.map | 1 - lib.commonjs/abi/coders/abstract-coder.js | 426 - lib.commonjs/abi/coders/abstract-coder.js.map | 1 - lib.commonjs/abi/coders/address.d.ts | 13 - lib.commonjs/abi/coders/address.d.ts.map | 1 - lib.commonjs/abi/coders/address.js | 34 - lib.commonjs/abi/coders/address.js.map | 1 - lib.commonjs/abi/coders/anonymous.d.ts | 15 - lib.commonjs/abi/coders/anonymous.d.ts.map | 1 - lib.commonjs/abi/coders/anonymous.js | 28 - lib.commonjs/abi/coders/anonymous.js.map | 1 - lib.commonjs/abi/coders/array.d.ts | 25 - lib.commonjs/abi/coders/array.d.ts.map | 1 - lib.commonjs/abi/coders/array.js | 180 - lib.commonjs/abi/coders/array.js.map | 1 - lib.commonjs/abi/coders/boolean.d.ts | 13 - lib.commonjs/abi/coders/boolean.d.ts.map | 1 - lib.commonjs/abi/coders/boolean.js | 26 - lib.commonjs/abi/coders/boolean.js.map | 1 - lib.commonjs/abi/coders/bytes.d.ts | 19 - lib.commonjs/abi/coders/bytes.d.ts.map | 1 - lib.commonjs/abi/coders/bytes.js | 48 - lib.commonjs/abi/coders/bytes.js.map | 1 - lib.commonjs/abi/coders/fixed-bytes.d.ts | 15 - lib.commonjs/abi/coders/fixed-bytes.d.ts.map | 1 - lib.commonjs/abi/coders/fixed-bytes.js | 41 - lib.commonjs/abi/coders/fixed-bytes.js.map | 1 - lib.commonjs/abi/coders/null.d.ts | 12 - lib.commonjs/abi/coders/null.d.ts.map | 1 - lib.commonjs/abi/coders/null.js | 29 - lib.commonjs/abi/coders/null.js.map | 1 - lib.commonjs/abi/coders/number.d.ts | 16 - lib.commonjs/abi/coders/number.d.ts.map | 1 - lib.commonjs/abi/coders/number.js | 58 - lib.commonjs/abi/coders/number.js.map | 1 - lib.commonjs/abi/coders/string.d.ts | 13 - lib.commonjs/abi/coders/string.d.ts.map | 1 - lib.commonjs/abi/coders/string.js | 26 - lib.commonjs/abi/coders/string.js.map | 1 - lib.commonjs/abi/coders/tuple.d.ts | 16 - lib.commonjs/abi/coders/tuple.d.ts.map | 1 - lib.commonjs/abi/coders/tuple.js | 70 - lib.commonjs/abi/coders/tuple.js.map | 1 - lib.commonjs/abi/fragments.d.ts | 372 - lib.commonjs/abi/fragments.d.ts.map | 1 - lib.commonjs/abi/fragments.js | 1308 - lib.commonjs/abi/fragments.js.map | 1 - lib.commonjs/abi/index.d.ts | 14 - lib.commonjs/abi/index.d.ts.map | 1 - lib.commonjs/abi/index.js | 32 - lib.commonjs/abi/index.js.map | 1 - lib.commonjs/abi/interface.d.ts | 270 - lib.commonjs/abi/interface.d.ts.map | 1 - lib.commonjs/abi/interface.js | 1065 - lib.commonjs/abi/interface.js.map | 1 - lib.commonjs/abi/typed.d.ts | 172 - lib.commonjs/abi/typed.d.ts.map | 1 - lib.commonjs/abi/typed.js | 455 - lib.commonjs/abi/typed.js.map | 1 - lib.commonjs/address/checks.d.ts | 78 - lib.commonjs/address/checks.d.ts.map | 1 - lib.commonjs/address/checks.js | 125 - lib.commonjs/address/checks.js.map | 1 - lib.commonjs/address/contract-address.d.ts | 41 - .../address/contract-address.d.ts.map | 1 - lib.commonjs/address/contract-address.js | 82 - lib.commonjs/address/contract-address.js.map | 1 - lib.commonjs/address/index.d.ts | 101 - lib.commonjs/address/index.d.ts.map | 1 - lib.commonjs/address/index.js | 205 - lib.commonjs/address/index.js.map | 1 - lib.commonjs/bigNumber/bigNumber.d.ts | 40 - lib.commonjs/bigNumber/bigNumber.d.ts.map | 1 - lib.commonjs/bigNumber/bigNumber.js | 313 - lib.commonjs/bigNumber/bigNumber.js.map | 1 - lib.commonjs/cip/custom-units.d.ts | 33 - lib.commonjs/cip/custom-units.d.ts.map | 1 - lib.commonjs/cip/custom-units.js | 117 - lib.commonjs/cip/custom-units.js.map | 1 - lib.commonjs/cip/index.d.ts | 49 - lib.commonjs/cip/index.d.ts.map | 1 - lib.commonjs/cip/index.js | 167 - lib.commonjs/cip/index.js.map | 1 - lib.commonjs/constants/addresses.d.ts | 7 - lib.commonjs/constants/addresses.d.ts.map | 1 - lib.commonjs/constants/addresses.js | 11 - lib.commonjs/constants/addresses.js.map | 1 - lib.commonjs/constants/hashes.d.ts | 7 - lib.commonjs/constants/hashes.d.ts.map | 1 - lib.commonjs/constants/hashes.js | 11 - lib.commonjs/constants/hashes.js.map | 1 - lib.commonjs/constants/index.d.ts | 10 - lib.commonjs/constants/index.d.ts.map | 1 - lib.commonjs/constants/index.js | 23 - lib.commonjs/constants/index.js.map | 1 - lib.commonjs/constants/numbers.d.ts | 35 - lib.commonjs/constants/numbers.d.ts.map | 1 - lib.commonjs/constants/numbers.js | 48 - lib.commonjs/constants/numbers.js.map | 1 - lib.commonjs/constants/strings.d.ts | 13 - lib.commonjs/constants/strings.d.ts.map | 1 - lib.commonjs/constants/strings.js | 19 - lib.commonjs/constants/strings.js.map | 1 - lib.commonjs/contract/contract.d.ts | 52 - lib.commonjs/contract/contract.d.ts.map | 1 - lib.commonjs/contract/contract.js | 803 - lib.commonjs/contract/contract.js.map | 1 - lib.commonjs/contract/factory.d.ts | 22 - lib.commonjs/contract/factory.d.ts.map | 1 - lib.commonjs/contract/factory.js | 97 - lib.commonjs/contract/factory.js.map | 1 - lib.commonjs/contract/index.d.ts | 10 - lib.commonjs/contract/index.d.ts.map | 1 - lib.commonjs/contract/index.js | 17 - lib.commonjs/contract/index.js.map | 1 - lib.commonjs/contract/types.d.ts | 56 - lib.commonjs/contract/types.d.ts.map | 1 - lib.commonjs/contract/types.js | 3 - lib.commonjs/contract/types.js.map | 1 - lib.commonjs/contract/wrappers.d.ts | 41 - lib.commonjs/contract/wrappers.d.ts.map | 1 - lib.commonjs/contract/wrappers.js | 100 - lib.commonjs/contract/wrappers.js.map | 1 - lib.commonjs/corebc.d.ts | 28 - lib.commonjs/corebc.d.ts.map | 1 - lib.commonjs/corebc.js | 283 - lib.commonjs/corebc.js.map | 1 - lib.commonjs/crypto/browser-ed448.d.ts | 4 - lib.commonjs/crypto/browser-ed448.d.ts.map | 1 - lib.commonjs/crypto/browser-ed448.js | 12 - lib.commonjs/crypto/browser-ed448.js.map | 1 - lib.commonjs/crypto/browser-sha3.d.ts | 7 - lib.commonjs/crypto/browser-sha3.d.ts.map | 1 - lib.commonjs/crypto/browser-sha3.js | 46 - lib.commonjs/crypto/browser-sha3.js.map | 1 - lib.commonjs/crypto/crypto-browser.d.ts | 18 - lib.commonjs/crypto/crypto-browser.d.ts.map | 1 - lib.commonjs/crypto/crypto-browser.js | 77 - lib.commonjs/crypto/crypto-browser.js.map | 1 - lib.commonjs/crypto/crypto.d.ts | 6 - lib.commonjs/crypto/crypto.d.ts.map | 1 - lib.commonjs/crypto/crypto.js | 27 - lib.commonjs/crypto/crypto.js.map | 1 - lib.commonjs/crypto/ed448-types.d.ts | 15 - lib.commonjs/crypto/ed448-types.d.ts.map | 1 - lib.commonjs/crypto/ed448-types.js | 3 - lib.commonjs/crypto/ed448-types.js.map | 1 - lib.commonjs/crypto/ed448.d.ts | 4 - lib.commonjs/crypto/ed448.d.ts.map | 1 - lib.commonjs/crypto/ed448.js | 12 - lib.commonjs/crypto/ed448.js.map | 1 - .../crypto/ed448goldilock-browser.d.ts | 16 - .../crypto/ed448goldilock-browser.d.ts.map | 1 - lib.commonjs/crypto/ed448goldilock-browser.js | 122 - .../crypto/ed448goldilock-browser.js.map | 1 - lib.commonjs/crypto/ed448goldilock.d.ts | 16 - lib.commonjs/crypto/ed448goldilock.d.ts.map | 1 - lib.commonjs/crypto/ed448goldilock.js | 122 - lib.commonjs/crypto/ed448goldilock.js.map | 1 - lib.commonjs/crypto/hmac.d.ts | 27 - lib.commonjs/crypto/hmac.d.ts.map | 1 - lib.commonjs/crypto/hmac.js | 66 - lib.commonjs/crypto/hmac.js.map | 1 - lib.commonjs/crypto/index.d.ts | 22 - lib.commonjs/crypto/index.d.ts.map | 1 - lib.commonjs/crypto/index.js | 47 - lib.commonjs/crypto/index.js.map | 1 - lib.commonjs/crypto/keccak.d.ts | 37 - lib.commonjs/crypto/keccak.d.ts.map | 1 - lib.commonjs/crypto/keccak.js | 63 - lib.commonjs/crypto/keccak.js.map | 1 - lib.commonjs/crypto/pbkdf2-browser.d.ts | 3 - lib.commonjs/crypto/pbkdf2-browser.d.ts.map | 1 - lib.commonjs/crypto/pbkdf2-browser.js | 10 - lib.commonjs/crypto/pbkdf2-browser.js.map | 1 - lib.commonjs/crypto/pbkdf2.d.ts | 37 - lib.commonjs/crypto/pbkdf2.d.ts.map | 1 - lib.commonjs/crypto/pbkdf2.js | 68 - lib.commonjs/crypto/pbkdf2.js.map | 1 - lib.commonjs/crypto/random.d.ts | 16 - lib.commonjs/crypto/random.d.ts.map | 1 - lib.commonjs/crypto/random.js | 45 - lib.commonjs/crypto/random.js.map | 1 - lib.commonjs/crypto/ripemd160.d.ts | 27 - lib.commonjs/crypto/ripemd160.d.ts.map | 1 - lib.commonjs/crypto/ripemd160.js | 53 - lib.commonjs/crypto/ripemd160.js.map | 1 - lib.commonjs/crypto/rlp.d.ts | 4 - lib.commonjs/crypto/rlp.d.ts.map | 1 - lib.commonjs/crypto/rlp.js | 124 - lib.commonjs/crypto/rlp.js.map | 1 - lib.commonjs/crypto/scrypt.d.ts | 85 - lib.commonjs/crypto/scrypt.d.ts.map | 1 - lib.commonjs/crypto/scrypt.js | 117 - lib.commonjs/crypto/scrypt.js.map | 1 - lib.commonjs/crypto/sha3.d.ts | 57 - lib.commonjs/crypto/sha3.d.ts.map | 1 - lib.commonjs/crypto/sha3.js | 112 - lib.commonjs/crypto/sha3.js.map | 1 - lib.commonjs/crypto/signature.d.ts | 131 - lib.commonjs/crypto/signature.d.ts.map | 1 - lib.commonjs/crypto/signature.js | 234 - lib.commonjs/crypto/signature.js.map | 1 - lib.commonjs/crypto/signing-key.d.ts | 56 - lib.commonjs/crypto/signing-key.d.ts.map | 1 - lib.commonjs/crypto/signing-key.js | 159 - lib.commonjs/crypto/signing-key.js.map | 1 - lib.commonjs/hash/id.d.ts | 11 - lib.commonjs/hash/id.d.ts.map | 1 - lib.commonjs/hash/id.js | 32 - lib.commonjs/hash/id.js.map | 1 - lib.commonjs/hash/index.d.ts | 11 - lib.commonjs/hash/index.d.ts.map | 1 - lib.commonjs/hash/index.js | 17 - lib.commonjs/hash/index.js.map | 1 - lib.commonjs/hash/message.d.ts | 34 - lib.commonjs/hash/message.d.ts.map | 1 - lib.commonjs/hash/message.js | 79 - lib.commonjs/hash/message.js.map | 1 - lib.commonjs/hash/solidity.d.ts | 21 - lib.commonjs/hash/solidity.d.ts.map | 1 - lib.commonjs/hash/solidity.js | 121 - lib.commonjs/hash/solidity.js.map | 1 - lib.commonjs/hash/typed-data.d.ts | 42 - lib.commonjs/hash/typed-data.d.ts.map | 1 - lib.commonjs/hash/typed-data.js | 450 - lib.commonjs/hash/typed-data.js.map | 1 - lib.commonjs/index.d.ts | 13 - lib.commonjs/index.d.ts.map | 1 - lib.commonjs/index.js | 290 - lib.commonjs/index.js.map | 1 - lib.commonjs/ipfs/index.d.ts | 18 - lib.commonjs/ipfs/index.d.ts.map | 1 - lib.commonjs/ipfs/index.js | 78 - lib.commonjs/ipfs/index.js.map | 1 - lib.commonjs/logger/logger.d.ts | 52 - lib.commonjs/logger/logger.d.ts.map | 1 - lib.commonjs/logger/logger.js | 329 - lib.commonjs/logger/logger.js.map | 1 - lib.commonjs/package.json | 1 - lib.commonjs/providers/abstract-provider.d.ts | 211 - .../providers/abstract-provider.d.ts.map | 1 - lib.commonjs/providers/abstract-provider.js | 1264 - .../providers/abstract-provider.js.map | 1 - lib.commonjs/providers/abstract-signer.d.ts | 31 - .../providers/abstract-signer.d.ts.map | 1 - lib.commonjs/providers/abstract-signer.js | 155 - lib.commonjs/providers/abstract-signer.js.map | 1 - lib.commonjs/providers/community.d.ts | 29 - lib.commonjs/providers/community.d.ts.map | 1 - lib.commonjs/providers/community.js | 38 - lib.commonjs/providers/community.js.map | 1 - lib.commonjs/providers/contracts.d.ts | 9 - lib.commonjs/providers/contracts.d.ts.map | 1 - lib.commonjs/providers/contracts.js | 3 - lib.commonjs/providers/contracts.js.map | 1 - lib.commonjs/providers/default-provider.d.ts | 5 - .../providers/default-provider.d.ts.map | 1 - lib.commonjs/providers/default-provider.js | 109 - .../providers/default-provider.js.map | 1 - lib.commonjs/providers/format.d.ts | 15 - lib.commonjs/providers/format.d.ts.map | 1 - lib.commonjs/providers/format.js | 288 - lib.commonjs/providers/format.js.map | 1 - lib.commonjs/providers/formatting.d.ts | 65 - lib.commonjs/providers/formatting.d.ts.map | 1 - lib.commonjs/providers/formatting.js | 3 - lib.commonjs/providers/formatting.js.map | 1 - lib.commonjs/providers/index.d.ts | 38 - lib.commonjs/providers/index.d.ts.map | 1 - lib.commonjs/providers/index.js | 62 - lib.commonjs/providers/index.js.map | 1 - lib.commonjs/providers/network.d.ts | 83 - lib.commonjs/providers/network.d.ts.map | 1 - lib.commonjs/providers/network.js | 261 - lib.commonjs/providers/network.js.map | 1 - lib.commonjs/providers/pagination.d.ts | 6 - lib.commonjs/providers/pagination.d.ts.map | 1 - lib.commonjs/providers/pagination.js | 3 - lib.commonjs/providers/pagination.js.map | 1 - lib.commonjs/providers/plugin-fallback.d.ts | 13 - .../providers/plugin-fallback.d.ts.map | 1 - lib.commonjs/providers/plugin-fallback.js | 44 - lib.commonjs/providers/plugin-fallback.js.map | 1 - lib.commonjs/providers/plugins-network.d.ts | 33 - .../providers/plugins-network.d.ts.map | 1 - lib.commonjs/providers/plugins-network.js | 94 - lib.commonjs/providers/plugins-network.js.map | 1 - lib.commonjs/providers/provider-alchemy.d.ts | 31 - .../providers/provider-alchemy.d.ts.map | 1 - lib.commonjs/providers/provider-alchemy.js | 129 - .../providers/provider-alchemy.js.map | 1 - lib.commonjs/providers/provider-ankr.d.ts | 51 - lib.commonjs/providers/provider-ankr.d.ts.map | 1 - lib.commonjs/providers/provider-ankr.js | 116 - lib.commonjs/providers/provider-ankr.js.map | 1 - lib.commonjs/providers/provider-browser.d.ts | 32 - .../providers/provider-browser.d.ts.map | 1 - lib.commonjs/providers/provider-browser.js | 99 - .../providers/provider-browser.js.map | 1 - .../providers/provider-cloudflare.d.ts | 14 - .../providers/provider-cloudflare.d.ts.map | 1 - lib.commonjs/providers/provider-cloudflare.js | 34 - .../providers/provider-cloudflare.js.map | 1 - lib.commonjs/providers/provider-fallback.d.ts | 51 - .../providers/provider-fallback.d.ts.map | 1 - lib.commonjs/providers/provider-fallback.js | 553 - .../providers/provider-fallback.js.map | 1 - lib.commonjs/providers/provider-infura.d.ts | 90 - .../providers/provider-infura.d.ts.map | 1 - lib.commonjs/providers/provider-infura.js | 179 - lib.commonjs/providers/provider-infura.js.map | 1 - .../providers/provider-ipcsocket-browser.d.ts | 3 - .../provider-ipcsocket-browser.d.ts.map | 1 - .../providers/provider-ipcsocket-browser.js | 6 - .../provider-ipcsocket-browser.js.map | 1 - .../providers/provider-ipcsocket.d.ts | 12 - .../providers/provider-ipcsocket.d.ts.map | 1 - lib.commonjs/providers/provider-ipcsocket.js | 68 - .../providers/provider-ipcsocket.js.map | 1 - lib.commonjs/providers/provider-jsonrpc.d.ts | 267 - .../providers/provider-jsonrpc.d.ts.map | 1 - lib.commonjs/providers/provider-jsonrpc.js | 885 - .../providers/provider-jsonrpc.js.map | 1 - lib.commonjs/providers/provider-pocket.d.ts | 54 - .../providers/provider-pocket.d.ts.map | 1 - lib.commonjs/providers/provider-pocket.js | 119 - lib.commonjs/providers/provider-pocket.js.map | 1 - .../providers/provider-quicknode.d.ts | 50 - .../providers/provider-quicknode.d.ts.map | 1 - lib.commonjs/providers/provider-quicknode.js | 112 - .../providers/provider-quicknode.js.map | 1 - lib.commonjs/providers/provider-socket.d.ts | 54 - .../providers/provider-socket.d.ts.map | 1 - lib.commonjs/providers/provider-socket.js | 241 - lib.commonjs/providers/provider-socket.js.map | 1 - .../providers/provider-websocket.d.ts | 19 - .../providers/provider-websocket.d.ts.map | 1 - lib.commonjs/providers/provider-websocket.js | 73 - .../providers/provider-websocket.js.map | 1 - lib.commonjs/providers/provider.d.ts | 623 - lib.commonjs/providers/provider.d.ts.map | 1 - lib.commonjs/providers/provider.js | 966 - lib.commonjs/providers/provider.js.map | 1 - .../providers/signer-noncemanager.d.ts | 19 - .../providers/signer-noncemanager.d.ts.map | 1 - lib.commonjs/providers/signer-noncemanager.js | 68 - .../providers/signer-noncemanager.js.map | 1 - lib.commonjs/providers/signer.d.ts | 118 - lib.commonjs/providers/signer.d.ts.map | 1 - lib.commonjs/providers/signer.js | 3 - lib.commonjs/providers/signer.js.map | 1 - .../providers/subscriber-connection.d.ts | 25 - .../providers/subscriber-connection.d.ts.map | 1 - .../providers/subscriber-connection.js | 64 - .../providers/subscriber-connection.js.map | 1 - .../providers/subscriber-filterid.d.ts | 46 - .../providers/subscriber-filterid.d.ts.map | 1 - lib.commonjs/providers/subscriber-filterid.js | 172 - .../providers/subscriber-filterid.js.map | 1 - .../providers/subscriber-polling.d.ts | 71 - .../providers/subscriber-polling.d.ts.map | 1 - lib.commonjs/providers/subscriber-polling.js | 265 - .../providers/subscriber-polling.js.map | 1 - lib.commonjs/providers/ws-browser.d.ts | 3 - lib.commonjs/providers/ws-browser.d.ts.map | 1 - lib.commonjs/providers/ws-browser.js | 18 - lib.commonjs/providers/ws-browser.js.map | 1 - lib.commonjs/providers/ws.d.ts | 2 - lib.commonjs/providers/ws.d.ts.map | 1 - lib.commonjs/providers/ws.js | 11 - lib.commonjs/providers/ws.js.map | 1 - lib.commonjs/transaction/accesslist.d.ts | 6 - lib.commonjs/transaction/accesslist.d.ts.map | 1 - lib.commonjs/transaction/accesslist.js | 50 - lib.commonjs/transaction/accesslist.js.map | 1 - lib.commonjs/transaction/address.d.ts | 18 - lib.commonjs/transaction/address.d.ts.map | 1 - lib.commonjs/transaction/address.js | 62 - lib.commonjs/transaction/address.js.map | 1 - lib.commonjs/transaction/index.d.ts | 25 - lib.commonjs/transaction/index.d.ts.map | 1 - lib.commonjs/transaction/index.js | 13 - lib.commonjs/transaction/index.js.map | 1 - lib.commonjs/transaction/transaction.d.ts | 169 - lib.commonjs/transaction/transaction.d.ts.map | 1 - lib.commonjs/transaction/transaction.js | 388 - lib.commonjs/transaction/transaction.js.map | 1 - lib.commonjs/utils/base58.d.ts | 23 - lib.commonjs/utils/base58.d.ts.map | 1 - lib.commonjs/utils/base58.js | 61 - lib.commonjs/utils/base58.js.map | 1 - lib.commonjs/utils/base64-browser.d.ts | 4 - lib.commonjs/utils/base64-browser.d.ts.map | 1 - lib.commonjs/utils/base64-browser.js | 25 - lib.commonjs/utils/base64-browser.js.map | 1 - lib.commonjs/utils/base64.d.ts | 40 - lib.commonjs/utils/base64.d.ts.map | 1 - lib.commonjs/utils/base64.js | 58 - lib.commonjs/utils/base64.js.map | 1 - lib.commonjs/utils/data.d.ts | 107 - lib.commonjs/utils/data.d.ts.map | 1 - lib.commonjs/utils/data.js | 376 - lib.commonjs/utils/data.js.map | 1 - lib.commonjs/utils/errors.d.ts | 486 - lib.commonjs/utils/errors.d.ts.map | 1 - lib.commonjs/utils/errors.js | 227 - lib.commonjs/utils/errors.js.map | 1 - lib.commonjs/utils/events.d.ts | 77 - lib.commonjs/utils/events.d.ts.map | 1 - lib.commonjs/utils/events.js | 45 - lib.commonjs/utils/events.js.map | 1 - lib.commonjs/utils/fetch.d.ts | 327 - lib.commonjs/utils/fetch.d.ts.map | 1 - lib.commonjs/utils/fetch.js | 832 - lib.commonjs/utils/fetch.js.map | 1 - lib.commonjs/utils/fixednumber.d.ts | 252 - lib.commonjs/utils/fixednumber.d.ts.map | 1 - lib.commonjs/utils/fixednumber.js | 581 - lib.commonjs/utils/fixednumber.js.map | 1 - lib.commonjs/utils/geturl-browser.d.ts | 3 - lib.commonjs/utils/geturl-browser.d.ts.map | 1 - lib.commonjs/utils/geturl-browser.js | 52 - lib.commonjs/utils/geturl-browser.js.map | 1 - lib.commonjs/utils/geturl.d.ts | 6 - lib.commonjs/utils/geturl.d.ts.map | 1 - lib.commonjs/utils/geturl.js | 85 - lib.commonjs/utils/geturl.js.map | 1 - lib.commonjs/utils/index.d.ts | 30 - lib.commonjs/utils/index.d.ts.map | 1 - lib.commonjs/utils/index.js | 74 - lib.commonjs/utils/index.js.map | 1 - lib.commonjs/utils/maths.d.ts | 62 - lib.commonjs/utils/maths.d.ts.map | 1 - lib.commonjs/utils/maths.js | 235 - lib.commonjs/utils/maths.js.map | 1 - lib.commonjs/utils/properties.d.ts | 21 - lib.commonjs/utils/properties.d.ts.map | 1 - lib.commonjs/utils/properties.js | 77 - lib.commonjs/utils/properties.js.map | 1 - lib.commonjs/utils/rlp-decode.d.ts | 6 - lib.commonjs/utils/rlp-decode.d.ts.map | 1 - lib.commonjs/utils/rlp-decode.js | 88 - lib.commonjs/utils/rlp-decode.js.map | 1 - lib.commonjs/utils/rlp-encode.d.ts | 6 - lib.commonjs/utils/rlp-encode.d.ts.map | 1 - lib.commonjs/utils/rlp-encode.js | 53 - lib.commonjs/utils/rlp-encode.js.map | 1 - lib.commonjs/utils/rlp.d.ts | 13 - lib.commonjs/utils/rlp.d.ts.map | 1 - lib.commonjs/utils/rlp.js | 10 - lib.commonjs/utils/rlp.js.map | 1 - lib.commonjs/utils/units.d.ts | 26 - lib.commonjs/utils/units.d.ts.map | 1 - lib.commonjs/utils/units.js | 161 - lib.commonjs/utils/units.js.map | 1 - lib.commonjs/utils/utf8.d.ts | 96 - lib.commonjs/utils/utf8.d.ts.map | 1 - lib.commonjs/utils/utf8.js | 228 - lib.commonjs/utils/utf8.js.map | 1 - lib.commonjs/utils/uuid.d.ts | 8 - lib.commonjs/utils/uuid.d.ts.map | 1 - lib.commonjs/utils/uuid.js | 35 - lib.commonjs/utils/uuid.js.map | 1 - lib.commonjs/wallet/base-wallet.d.ts | 53 - lib.commonjs/wallet/base-wallet.d.ts.map | 1 - lib.commonjs/wallet/base-wallet.js | 151 - lib.commonjs/wallet/base-wallet.js.map | 1 - lib.commonjs/wallet/english_words.d.ts | 2 - lib.commonjs/wallet/english_words.d.ts.map | 1 - lib.commonjs/wallet/english_words.js | 6 - lib.commonjs/wallet/english_words.js.map | 1 - lib.commonjs/wallet/hdwallet.d.ts | 166 - lib.commonjs/wallet/hdwallet.d.ts.map | 1 - lib.commonjs/wallet/hdwallet.js | 392 - lib.commonjs/wallet/hdwallet.js.map | 1 - lib.commonjs/wallet/index.d.ts | 27 - lib.commonjs/wallet/index.d.ts.map | 1 - lib.commonjs/wallet/index.js | 26 - lib.commonjs/wallet/index.js.map | 1 - lib.commonjs/wallet/json-crowdsale.d.ts | 24 - lib.commonjs/wallet/json-crowdsale.d.ts.map | 1 - lib.commonjs/wallet/json-crowdsale.js | 85 - lib.commonjs/wallet/json-crowdsale.js.map | 1 - lib.commonjs/wallet/json-keystore.d.ts | 79 - lib.commonjs/wallet/json-keystore.d.ts.map | 1 - lib.commonjs/wallet/json-keystore.js | 365 - lib.commonjs/wallet/json-keystore.js.map | 1 - lib.commonjs/wallet/mnemonic.d.ts | 69 - lib.commonjs/wallet/mnemonic.d.ts.map | 1 - lib.commonjs/wallet/mnemonic.js | 179 - lib.commonjs/wallet/mnemonic.js.map | 1 - lib.commonjs/wallet/mnemonicToSeed.d.ts | 2 - lib.commonjs/wallet/mnemonicToSeed.d.ts.map | 1 - lib.commonjs/wallet/mnemonicToSeed.js | 31 - lib.commonjs/wallet/mnemonicToSeed.js.map | 1 - lib.commonjs/wallet/utils.d.ts | 8 - lib.commonjs/wallet/utils.d.ts.map | 1 - lib.commonjs/wallet/utils.js | 159 - lib.commonjs/wallet/utils.js.map | 1 - lib.commonjs/wallet/wallet.d.ts | 86 - lib.commonjs/wallet/wallet.d.ts.map | 1 - lib.commonjs/wallet/wallet.js | 205 - lib.commonjs/wallet/wallet.js.map | 1 - lib.commonjs/wordlists/bit-reader.d.ts | 5 - lib.commonjs/wordlists/bit-reader.d.ts.map | 1 - lib.commonjs/wordlists/bit-reader.js | 36 - lib.commonjs/wordlists/bit-reader.js.map | 1 - lib.commonjs/wordlists/decode-owl.d.ts | 9 - lib.commonjs/wordlists/decode-owl.d.ts.map | 1 - lib.commonjs/wordlists/decode-owl.js | 68 - lib.commonjs/wordlists/decode-owl.js.map | 1 - lib.commonjs/wordlists/decode-owla.d.ts | 5 - lib.commonjs/wordlists/decode-owla.d.ts.map | 1 - lib.commonjs/wordlists/decode-owla.js | 40 - lib.commonjs/wordlists/decode-owla.js.map | 1 - lib.commonjs/wordlists/enwords.d.ts | 2 - lib.commonjs/wordlists/enwords.d.ts.map | 1 - lib.commonjs/wordlists/enwords.js | 6 - lib.commonjs/wordlists/enwords.js.map | 1 - .../wordlists/generation/encode-latin.d.ts | 25 - .../generation/encode-latin.d.ts.map | 1 - .../wordlists/generation/encode-latin.js | 364 - .../wordlists/generation/encode-latin.js.map | 1 - lib.commonjs/wordlists/index.d.ts | 25 - lib.commonjs/wordlists/index.d.ts.map | 1 - lib.commonjs/wordlists/index.js | 16 - lib.commonjs/wordlists/index.js.map | 1 - lib.commonjs/wordlists/lang-cz.d.ts | 23 - lib.commonjs/wordlists/lang-cz.d.ts.map | 1 - lib.commonjs/wordlists/lang-cz.js | 38 - lib.commonjs/wordlists/lang-cz.js.map | 1 - lib.commonjs/wordlists/lang-en.d.ts | 23 - lib.commonjs/wordlists/lang-en.d.ts.map | 1 - lib.commonjs/wordlists/lang-en.js | 38 - lib.commonjs/wordlists/lang-en.js.map | 1 - lib.commonjs/wordlists/lang-es.d.ts | 23 - lib.commonjs/wordlists/lang-es.d.ts.map | 1 - lib.commonjs/wordlists/lang-es.js | 39 - lib.commonjs/wordlists/lang-es.js.map | 1 - lib.commonjs/wordlists/lang-fr.d.ts | 23 - lib.commonjs/wordlists/lang-fr.d.ts.map | 1 - lib.commonjs/wordlists/lang-fr.js | 39 - lib.commonjs/wordlists/lang-fr.js.map | 1 - lib.commonjs/wordlists/lang-it.d.ts | 23 - lib.commonjs/wordlists/lang-it.d.ts.map | 1 - lib.commonjs/wordlists/lang-it.js | 38 - lib.commonjs/wordlists/lang-it.js.map | 1 - lib.commonjs/wordlists/lang-ja.d.ts | 27 - lib.commonjs/wordlists/lang-ja.d.ts.map | 1 - lib.commonjs/wordlists/lang-ja.js | 188 - lib.commonjs/wordlists/lang-ja.js.map | 1 - lib.commonjs/wordlists/lang-ko.d.ts | 25 - lib.commonjs/wordlists/lang-ko.d.ts.map | 1 - lib.commonjs/wordlists/lang-ko.js | 120 - lib.commonjs/wordlists/lang-ko.js.map | 1 - lib.commonjs/wordlists/lang-pt.d.ts | 23 - lib.commonjs/wordlists/lang-pt.d.ts.map | 1 - lib.commonjs/wordlists/lang-pt.js | 38 - lib.commonjs/wordlists/lang-pt.js.map | 1 - lib.commonjs/wordlists/lang-zh.d.ts | 32 - lib.commonjs/wordlists/lang-zh.d.ts.map | 1 - lib.commonjs/wordlists/lang-zh.js | 125 - lib.commonjs/wordlists/lang-zh.js.map | 1 - lib.commonjs/wordlists/wordlist-owl.d.ts | 26 - lib.commonjs/wordlists/wordlist-owl.d.ts.map | 1 - lib.commonjs/wordlists/wordlist-owl.js | 91 - lib.commonjs/wordlists/wordlist-owl.js.map | 1 - lib.commonjs/wordlists/wordlist-owla.d.ts | 20 - lib.commonjs/wordlists/wordlist-owla.d.ts.map | 1 - lib.commonjs/wordlists/wordlist-owla.js | 33 - lib.commonjs/wordlists/wordlist-owla.js.map | 1 - lib.commonjs/wordlists/wordlist.d.ts | 48 - lib.commonjs/wordlists/wordlist.d.ts.map | 1 - lib.commonjs/wordlists/wordlist.js | 68 - lib.commonjs/wordlists/wordlist.js.map | 1 - lib.commonjs/wordlists/wordlists-browser.d.ts | 3 - .../wordlists/wordlists-browser.d.ts.map | 1 - lib.commonjs/wordlists/wordlists-browser.js | 10 - .../wordlists/wordlists-browser.js.map | 1 - lib.commonjs/wordlists/wordlists-extra.d.ts | 9 - .../wordlists/wordlists-extra.d.ts.map | 1 - lib.commonjs/wordlists/wordlists-extra.js | 22 - lib.commonjs/wordlists/wordlists-extra.js.map | 1 - lib.commonjs/wordlists/wordlists.d.ts | 16 - lib.commonjs/wordlists/wordlists.d.ts.map | 1 - lib.commonjs/wordlists/wordlists.js | 40 - lib.commonjs/wordlists/wordlists.js.map | 1 - lib.esm/README.md | 16 - lib.esm/_tests/blockchain-data.d.ts | 83 - lib.esm/_tests/blockchain-data.d.ts.map | 1 - lib.esm/_tests/blockchain-data.js | 239 - lib.esm/_tests/blockchain-data.js.map | 1 - lib.esm/_tests/create-provider.d.ts | 8 - lib.esm/_tests/create-provider.d.ts.map | 1 - lib.esm/_tests/create-provider.js | 121 - lib.esm/_tests/create-provider.js.map | 1 - lib.esm/_tests/test-cip.d.ts | 2 - lib.esm/_tests/test-cip.d.ts.map | 1 - lib.esm/_tests/test-cip.js | 150 - lib.esm/_tests/test-cip.js.map | 1 - lib.esm/_tests/test-contract.d.ts | 2 - lib.esm/_tests/test-contract.d.ts.map | 1 - lib.esm/_tests/test-contract.js | 84 - lib.esm/_tests/test-contract.js.map | 1 - lib.esm/_tests/test-crypto.d.ts | 2 - lib.esm/_tests/test-crypto.d.ts.map | 1 - lib.esm/_tests/test-crypto.js | 37 - lib.esm/_tests/test-crypto.js.map | 1 - lib.esm/_tests/test-keystore.d.ts | 2 - lib.esm/_tests/test-keystore.d.ts.map | 1 - lib.esm/_tests/test-keystore.js | 41 - lib.esm/_tests/test-keystore.js.map | 1 - lib.esm/_tests/types.d.ts | 191 - lib.esm/_tests/types.d.ts.map | 1 - lib.esm/_tests/types.js | 2 - lib.esm/_tests/types.js.map | 1 - lib.esm/_version.d.ts | 3 - lib.esm/_version.d.ts.map | 1 - lib.esm/_version.js | 3 - lib.esm/_version.js.map | 1 - lib.esm/abi-types/Tes.d.ts | 223 - lib.esm/abi-types/Tes.d.ts.map | 1 - lib.esm/abi-types/Tes.js | 2 - lib.esm/abi-types/Tes.js.map | 1 - lib.esm/abi-types/Tes_abi.d.ts | 223 - lib.esm/abi-types/Tes_abi.d.ts.map | 1 - lib.esm/abi-types/Tes_abi.js | 2 - lib.esm/abi-types/Tes_abi.js.map | 1 - lib.esm/abi-types/common.d.ts | 51 - lib.esm/abi-types/common.d.ts.map | 1 - lib.esm/abi-types/common.js | 2 - lib.esm/abi-types/common.js.map | 1 - lib.esm/abi-types/factories/Tes__factory.d.ts | 280 - .../abi-types/factories/Tes__factory.d.ts.map | 1 - lib.esm/abi-types/factories/Tes__factory.js | 370 - .../abi-types/factories/Tes__factory.js.map | 1 - .../abi-types/factories/Tes_abi__factory.d.ts | 280 - .../factories/Tes_abi__factory.d.ts.map | 1 - .../abi-types/factories/Tes_abi__factory.js | 370 - .../factories/Tes_abi__factory.js.map | 1 - lib.esm/abi-types/factories/index.d.ts | 2 - lib.esm/abi-types/factories/index.d.ts.map | 1 - lib.esm/abi-types/factories/index.js | 5 - lib.esm/abi-types/factories/index.js.map | 1 - lib.esm/abi-types/index.d.ts | 4 - lib.esm/abi-types/index.d.ts.map | 1 - lib.esm/abi-types/index.js | 3 - lib.esm/abi-types/index.js.map | 1 - lib.esm/abi/abi-coder.d.ts | 59 - lib.esm/abi/abi-coder.d.ts.map | 1 - lib.esm/abi/abi-coder.js | 204 - lib.esm/abi/abi-coder.js.map | 1 - lib.esm/abi/bytes32.d.ts | 15 - lib.esm/abi/bytes32.d.ts.map | 1 - lib.esm/abi/bytes32.js | 40 - lib.esm/abi/bytes32.js.map | 1 - lib.esm/abi/coders/abstract-coder.d.ts | 117 - lib.esm/abi/coders/abstract-coder.d.ts.map | 1 - lib.esm/abi/coders/abstract-coder.js | 408 - lib.esm/abi/coders/abstract-coder.js.map | 1 - lib.esm/abi/coders/address.d.ts | 13 - lib.esm/abi/coders/address.d.ts.map | 1 - lib.esm/abi/coders/address.js | 29 - lib.esm/abi/coders/address.js.map | 1 - lib.esm/abi/coders/anonymous.d.ts | 15 - lib.esm/abi/coders/anonymous.d.ts.map | 1 - lib.esm/abi/coders/anonymous.js | 23 - lib.esm/abi/coders/anonymous.js.map | 1 - lib.esm/abi/coders/array.d.ts | 25 - lib.esm/abi/coders/array.d.ts.map | 1 - lib.esm/abi/coders/array.js | 165 - lib.esm/abi/coders/array.js.map | 1 - lib.esm/abi/coders/boolean.d.ts | 13 - lib.esm/abi/coders/boolean.d.ts.map | 1 - lib.esm/abi/coders/boolean.js | 21 - lib.esm/abi/coders/boolean.js.map | 1 - lib.esm/abi/coders/bytes.d.ts | 19 - lib.esm/abi/coders/bytes.d.ts.map | 1 - lib.esm/abi/coders/bytes.js | 34 - lib.esm/abi/coders/bytes.js.map | 1 - lib.esm/abi/coders/fixed-bytes.d.ts | 15 - lib.esm/abi/coders/fixed-bytes.d.ts.map | 1 - lib.esm/abi/coders/fixed-bytes.js | 28 - lib.esm/abi/coders/fixed-bytes.js.map | 1 - lib.esm/abi/coders/null.d.ts | 12 - lib.esm/abi/coders/null.d.ts.map | 1 - lib.esm/abi/coders/null.js | 24 - lib.esm/abi/coders/null.js.map | 1 - lib.esm/abi/coders/number.d.ts | 16 - lib.esm/abi/coders/number.d.ts.map | 1 - lib.esm/abi/coders/number.js | 45 - lib.esm/abi/coders/number.js.map | 1 - lib.esm/abi/coders/string.d.ts | 13 - lib.esm/abi/coders/string.d.ts.map | 1 - lib.esm/abi/coders/string.js | 21 - lib.esm/abi/coders/string.js.map | 1 - lib.esm/abi/coders/tuple.d.ts | 16 - lib.esm/abi/coders/tuple.d.ts.map | 1 - lib.esm/abi/coders/tuple.js | 65 - lib.esm/abi/coders/tuple.js.map | 1 - lib.esm/abi/fragments.d.ts | 372 - lib.esm/abi/fragments.d.ts.map | 1 - lib.esm/abi/fragments.js | 1270 - lib.esm/abi/fragments.js.map | 1 - lib.esm/abi/index.d.ts | 14 - lib.esm/abi/index.d.ts.map | 1 - lib.esm/abi/index.js | 13 - lib.esm/abi/index.js.map | 1 - lib.esm/abi/interface.d.ts | 270 - lib.esm/abi/interface.d.ts.map | 1 - lib.esm/abi/interface.js | 1030 - lib.esm/abi/interface.js.map | 1 - lib.esm/abi/typed.d.ts | 172 - lib.esm/abi/typed.d.ts.map | 1 - lib.esm/abi/typed.js | 444 - lib.esm/abi/typed.js.map | 1 - lib.esm/address/checks.d.ts | 78 - lib.esm/address/checks.d.ts.map | 1 - lib.esm/address/checks.js | 111 - lib.esm/address/checks.js.map | 1 - lib.esm/address/contract-address.d.ts | 41 - lib.esm/address/contract-address.d.ts.map | 1 - lib.esm/address/contract-address.js | 75 - lib.esm/address/contract-address.js.map | 1 - lib.esm/address/index.d.ts | 101 - lib.esm/address/index.d.ts.map | 1 - lib.esm/address/index.js | 198 - lib.esm/address/index.js.map | 1 - lib.esm/bigNumber/bigNumber.d.ts | 40 - lib.esm/bigNumber/bigNumber.d.ts.map | 1 - lib.esm/bigNumber/bigNumber.js | 313 - lib.esm/bigNumber/bigNumber.js.map | 1 - lib.esm/cip/custom-units.d.ts | 33 - lib.esm/cip/custom-units.d.ts.map | 1 - lib.esm/cip/custom-units.js | 81 - lib.esm/cip/custom-units.js.map | 1 - lib.esm/cip/index.d.ts | 49 - lib.esm/cip/index.d.ts.map | 1 - lib.esm/cip/index.js | 124 - lib.esm/cip/index.js.map | 1 - lib.esm/constants/addresses.d.ts | 7 - lib.esm/constants/addresses.d.ts.map | 1 - lib.esm/constants/addresses.js | 7 - lib.esm/constants/addresses.js.map | 1 - lib.esm/constants/hashes.d.ts | 7 - lib.esm/constants/hashes.d.ts.map | 1 - lib.esm/constants/hashes.js | 7 - lib.esm/constants/hashes.js.map | 1 - lib.esm/constants/index.d.ts | 10 - lib.esm/constants/index.d.ts.map | 1 - lib.esm/constants/index.js | 10 - lib.esm/constants/index.js.map | 1 - lib.esm/constants/numbers.d.ts | 35 - lib.esm/constants/numbers.d.ts.map | 1 - lib.esm/constants/numbers.js | 36 - lib.esm/constants/numbers.js.map | 1 - lib.esm/constants/strings.d.ts | 13 - lib.esm/constants/strings.d.ts.map | 1 - lib.esm/constants/strings.js | 14 - lib.esm/constants/strings.js.map | 1 - lib.esm/contract/contract.d.ts | 52 - lib.esm/contract/contract.d.ts.map | 1 - lib.esm/contract/contract.js | 784 - lib.esm/contract/contract.js.map | 1 - lib.esm/contract/factory.d.ts | 22 - lib.esm/contract/factory.d.ts.map | 1 - lib.esm/contract/factory.js | 83 - lib.esm/contract/factory.js.map | 1 - lib.esm/contract/index.d.ts | 10 - lib.esm/contract/index.d.ts.map | 1 - lib.esm/contract/index.js | 9 - lib.esm/contract/index.js.map | 1 - lib.esm/contract/types.d.ts | 56 - lib.esm/contract/types.d.ts.map | 1 - lib.esm/contract/types.js | 2 - lib.esm/contract/types.js.map | 1 - lib.esm/contract/wrappers.d.ts | 41 - lib.esm/contract/wrappers.d.ts.map | 1 - lib.esm/contract/wrappers.js | 82 - lib.esm/contract/wrappers.js.map | 1 - lib.esm/corebc.d.ts | 28 - lib.esm/corebc.d.ts.map | 1 - lib.esm/corebc.js | 19 - lib.esm/corebc.js.map | 1 - lib.esm/crypto/browser-ed448.d.ts | 4 - lib.esm/crypto/browser-ed448.d.ts.map | 1 - lib.esm/crypto/browser-ed448.js | 6 - lib.esm/crypto/browser-ed448.js.map | 1 - lib.esm/crypto/browser-sha3.d.ts | 7 - lib.esm/crypto/browser-sha3.d.ts.map | 1 - lib.esm/crypto/browser-sha3.js | 41 - lib.esm/crypto/browser-sha3.js.map | 1 - lib.esm/crypto/crypto-browser.d.ts | 18 - lib.esm/crypto/crypto-browser.d.ts.map | 1 - lib.esm/crypto/crypto-browser.js | 62 - lib.esm/crypto/crypto-browser.js.map | 1 - lib.esm/crypto/crypto.d.ts | 6 - lib.esm/crypto/crypto.d.ts.map | 1 - lib.esm/crypto/crypto.js | 6 - lib.esm/crypto/crypto.js.map | 1 - lib.esm/crypto/ed448-types.d.ts | 15 - lib.esm/crypto/ed448-types.d.ts.map | 1 - lib.esm/crypto/ed448-types.js | 2 - lib.esm/crypto/ed448-types.js.map | 1 - lib.esm/crypto/ed448.d.ts | 4 - lib.esm/crypto/ed448.d.ts.map | 1 - lib.esm/crypto/ed448.js | 6 - lib.esm/crypto/ed448.js.map | 1 - lib.esm/crypto/ed448goldilock-browser.d.ts | 16 - .../crypto/ed448goldilock-browser.d.ts.map | 1 - lib.esm/crypto/ed448goldilock-browser.js | 120 - lib.esm/crypto/ed448goldilock-browser.js.map | 1 - lib.esm/crypto/ed448goldilock.d.ts | 16 - lib.esm/crypto/ed448goldilock.d.ts.map | 1 - lib.esm/crypto/ed448goldilock.js | 120 - lib.esm/crypto/ed448goldilock.js.map | 1 - lib.esm/crypto/hmac.d.ts | 27 - lib.esm/crypto/hmac.d.ts.map | 1 - lib.esm/crypto/hmac.js | 49 - lib.esm/crypto/hmac.js.map | 1 - lib.esm/crypto/index.d.ts | 22 - lib.esm/crypto/index.d.ts.map | 1 - lib.esm/crypto/index.js | 32 - lib.esm/crypto/index.js.map | 1 - lib.esm/crypto/keccak.d.ts | 37 - lib.esm/crypto/keccak.d.ts.map | 1 - lib.esm/crypto/keccak.js | 50 - lib.esm/crypto/keccak.js.map | 1 - lib.esm/crypto/pbkdf2-browser.d.ts | 3 - lib.esm/crypto/pbkdf2-browser.d.ts.map | 1 - lib.esm/crypto/pbkdf2-browser.js | 4 - lib.esm/crypto/pbkdf2-browser.js.map | 1 - lib.esm/crypto/pbkdf2.d.ts | 37 - lib.esm/crypto/pbkdf2.d.ts.map | 1 - lib.esm/crypto/pbkdf2.js | 51 - lib.esm/crypto/pbkdf2.js.map | 1 - lib.esm/crypto/random.d.ts | 16 - lib.esm/crypto/random.d.ts.map | 1 - lib.esm/crypto/random.js | 36 - lib.esm/crypto/random.js.map | 1 - lib.esm/crypto/ripemd160.d.ts | 27 - lib.esm/crypto/ripemd160.d.ts.map | 1 - lib.esm/crypto/ripemd160.js | 40 - lib.esm/crypto/ripemd160.js.map | 1 - lib.esm/crypto/rlp.d.ts | 4 - lib.esm/crypto/rlp.d.ts.map | 1 - lib.esm/crypto/rlp.js | 119 - lib.esm/crypto/rlp.js.map | 1 - lib.esm/crypto/scrypt.d.ts | 85 - lib.esm/crypto/scrypt.d.ts.map | 1 - lib.esm/crypto/scrypt.js | 103 - lib.esm/crypto/scrypt.js.map | 1 - lib.esm/crypto/sha3.d.ts | 57 - lib.esm/crypto/sha3.d.ts.map | 1 - lib.esm/crypto/sha3.js | 100 - lib.esm/crypto/sha3.js.map | 1 - lib.esm/crypto/signature.d.ts | 131 - lib.esm/crypto/signature.d.ts.map | 1 - lib.esm/crypto/signature.js | 221 - lib.esm/crypto/signature.js.map | 1 - lib.esm/crypto/signing-key.d.ts | 56 - lib.esm/crypto/signing-key.d.ts.map | 1 - lib.esm/crypto/signing-key.js | 145 - lib.esm/crypto/signing-key.js.map | 1 - lib.esm/hash/id.d.ts | 11 - lib.esm/hash/id.d.ts.map | 1 - lib.esm/hash/id.js | 19 - lib.esm/hash/id.js.map | 1 - lib.esm/hash/index.d.ts | 11 - lib.esm/hash/index.d.ts.map | 1 - lib.esm/hash/index.js | 10 - lib.esm/hash/index.js.map | 1 - lib.esm/hash/message.d.ts | 34 - lib.esm/hash/message.d.ts.map | 1 - lib.esm/hash/message.js | 49 - lib.esm/hash/message.js.map | 1 - lib.esm/hash/solidity.d.ts | 21 - lib.esm/hash/solidity.d.ts.map | 1 - lib.esm/hash/solidity.js | 94 - lib.esm/hash/solidity.js.map | 1 - lib.esm/hash/typed-data.d.ts | 42 - lib.esm/hash/typed-data.d.ts.map | 1 - lib.esm/hash/typed-data.js | 422 - lib.esm/hash/typed-data.js.map | 1 - lib.esm/index.d.ts | 13 - lib.esm/index.d.ts.map | 1 - lib.esm/index.js | 13 - lib.esm/index.js.map | 1 - lib.esm/ipfs/index.d.ts | 18 - lib.esm/ipfs/index.d.ts.map | 1 - lib.esm/ipfs/index.js | 73 - lib.esm/ipfs/index.js.map | 1 - lib.esm/logger/logger.d.ts | 52 - lib.esm/logger/logger.d.ts.map | 1 - lib.esm/logger/logger.js | 329 - lib.esm/logger/logger.js.map | 1 - lib.esm/package.json | 13 - lib.esm/providers/abstract-provider.d.ts | 211 - lib.esm/providers/abstract-provider.d.ts.map | 1 - lib.esm/providers/abstract-provider.js | 1235 - lib.esm/providers/abstract-provider.js.map | 1 - lib.esm/providers/abstract-signer.d.ts | 31 - lib.esm/providers/abstract-signer.d.ts.map | 1 - lib.esm/providers/abstract-signer.js | 128 - lib.esm/providers/abstract-signer.js.map | 1 - lib.esm/providers/community.d.ts | 29 - lib.esm/providers/community.d.ts.map | 1 - lib.esm/providers/community.js | 34 - lib.esm/providers/community.js.map | 1 - lib.esm/providers/contracts.d.ts | 9 - lib.esm/providers/contracts.d.ts.map | 1 - lib.esm/providers/contracts.js | 2 - lib.esm/providers/contracts.js.map | 1 - lib.esm/providers/default-provider.d.ts | 5 - lib.esm/providers/default-provider.d.ts.map | 1 - lib.esm/providers/default-provider.js | 98 - lib.esm/providers/default-provider.js.map | 1 - lib.esm/providers/format.d.ts | 15 - lib.esm/providers/format.d.ts.map | 1 - lib.esm/providers/format.js | 250 - lib.esm/providers/format.js.map | 1 - lib.esm/providers/formatting.d.ts | 65 - lib.esm/providers/formatting.d.ts.map | 1 - lib.esm/providers/formatting.js | 7 - lib.esm/providers/formatting.js.map | 1 - lib.esm/providers/index.d.ts | 38 - lib.esm/providers/index.d.ts.map | 1 - lib.esm/providers/index.js | 30 - lib.esm/providers/index.js.map | 1 - lib.esm/providers/network.d.ts | 83 - lib.esm/providers/network.d.ts.map | 1 - lib.esm/providers/network.js | 249 - lib.esm/providers/network.js.map | 1 - lib.esm/providers/pagination.d.ts | 6 - lib.esm/providers/pagination.d.ts.map | 1 - lib.esm/providers/pagination.js | 2 - lib.esm/providers/pagination.js.map | 1 - lib.esm/providers/plugin-fallback.d.ts | 13 - lib.esm/providers/plugin-fallback.d.ts.map | 1 - lib.esm/providers/plugin-fallback.js | 29 - lib.esm/providers/plugin-fallback.js.map | 1 - lib.esm/providers/plugins-network.d.ts | 33 - lib.esm/providers/plugins-network.d.ts.map | 1 - lib.esm/providers/plugins-network.js | 80 - lib.esm/providers/plugins-network.js.map | 1 - lib.esm/providers/provider-alchemy.d.ts | 31 - lib.esm/providers/provider-alchemy.d.ts.map | 1 - lib.esm/providers/provider-alchemy.js | 118 - lib.esm/providers/provider-alchemy.js.map | 1 - lib.esm/providers/provider-ankr.d.ts | 51 - lib.esm/providers/provider-ankr.d.ts.map | 1 - lib.esm/providers/provider-ankr.js | 105 - lib.esm/providers/provider-ankr.js.map | 1 - lib.esm/providers/provider-browser.d.ts | 32 - lib.esm/providers/provider-browser.d.ts.map | 1 - lib.esm/providers/provider-browser.js | 87 - lib.esm/providers/provider-browser.js.map | 1 - lib.esm/providers/provider-cloudflare.d.ts | 14 - .../providers/provider-cloudflare.d.ts.map | 1 - lib.esm/providers/provider-cloudflare.js | 22 - lib.esm/providers/provider-cloudflare.js.map | 1 - lib.esm/providers/provider-fallback.d.ts | 51 - lib.esm/providers/provider-fallback.d.ts.map | 1 - lib.esm/providers/provider-fallback.js | 541 - lib.esm/providers/provider-fallback.js.map | 1 - lib.esm/providers/provider-infura.d.ts | 90 - lib.esm/providers/provider-infura.d.ts.map | 1 - lib.esm/providers/provider-infura.js | 167 - lib.esm/providers/provider-infura.js.map | 1 - .../providers/provider-ipcsocket-browser.d.ts | 3 - .../provider-ipcsocket-browser.d.ts.map | 1 - .../providers/provider-ipcsocket-browser.js | 3 - .../provider-ipcsocket-browser.js.map | 1 - lib.esm/providers/provider-ipcsocket.d.ts | 12 - lib.esm/providers/provider-ipcsocket.d.ts.map | 1 - lib.esm/providers/provider-ipcsocket.js | 63 - lib.esm/providers/provider-ipcsocket.js.map | 1 - lib.esm/providers/provider-jsonrpc.d.ts | 267 - lib.esm/providers/provider-jsonrpc.d.ts.map | 1 - lib.esm/providers/provider-jsonrpc.js | 853 - lib.esm/providers/provider-jsonrpc.js.map | 1 - lib.esm/providers/provider-pocket.d.ts | 54 - lib.esm/providers/provider-pocket.d.ts.map | 1 - lib.esm/providers/provider-pocket.js | 108 - lib.esm/providers/provider-pocket.js.map | 1 - lib.esm/providers/provider-quicknode.d.ts | 50 - lib.esm/providers/provider-quicknode.d.ts.map | 1 - lib.esm/providers/provider-quicknode.js | 101 - lib.esm/providers/provider-quicknode.js.map | 1 - lib.esm/providers/provider-socket.d.ts | 54 - lib.esm/providers/provider-socket.d.ts.map | 1 - lib.esm/providers/provider-socket.js | 225 - lib.esm/providers/provider-socket.js.map | 1 - lib.esm/providers/provider-websocket.d.ts | 19 - lib.esm/providers/provider-websocket.d.ts.map | 1 - lib.esm/providers/provider-websocket.js | 68 - lib.esm/providers/provider-websocket.js.map | 1 - lib.esm/providers/provider.d.ts | 623 - lib.esm/providers/provider.d.ts.map | 1 - lib.esm/providers/provider.js | 948 - lib.esm/providers/provider.js.map | 1 - lib.esm/providers/signer-noncemanager.d.ts | 19 - .../providers/signer-noncemanager.d.ts.map | 1 - lib.esm/providers/signer-noncemanager.js | 55 - lib.esm/providers/signer-noncemanager.js.map | 1 - lib.esm/providers/signer.d.ts | 118 - lib.esm/providers/signer.d.ts.map | 1 - lib.esm/providers/signer.js | 2 - lib.esm/providers/signer.js.map | 1 - lib.esm/providers/subscriber-connection.d.ts | 25 - .../providers/subscriber-connection.d.ts.map | 1 - lib.esm/providers/subscriber-connection.js | 52 - .../providers/subscriber-connection.js.map | 1 - lib.esm/providers/subscriber-filterid.d.ts | 46 - .../providers/subscriber-filterid.d.ts.map | 1 - lib.esm/providers/subscriber-filterid.js | 158 - lib.esm/providers/subscriber-filterid.js.map | 1 - lib.esm/providers/subscriber-polling.d.ts | 71 - lib.esm/providers/subscriber-polling.d.ts.map | 1 - lib.esm/providers/subscriber-polling.js | 248 - lib.esm/providers/subscriber-polling.js.map | 1 - lib.esm/providers/ws-browser.d.ts | 3 - lib.esm/providers/ws-browser.d.ts.map | 1 - lib.esm/providers/ws-browser.js | 15 - lib.esm/providers/ws-browser.js.map | 1 - lib.esm/providers/ws.d.ts | 2 - lib.esm/providers/ws.d.ts.map | 1 - lib.esm/providers/ws.js | 2 - lib.esm/providers/ws.js.map | 1 - lib.esm/transaction/accesslist.d.ts | 6 - lib.esm/transaction/accesslist.d.ts.map | 1 - lib.esm/transaction/accesslist.js | 37 - lib.esm/transaction/accesslist.js.map | 1 - lib.esm/transaction/address.d.ts | 18 - lib.esm/transaction/address.d.ts.map | 1 - lib.esm/transaction/address.js | 41 - lib.esm/transaction/address.js.map | 1 - lib.esm/transaction/index.d.ts | 25 - lib.esm/transaction/index.d.ts.map | 1 - lib.esm/transaction/index.js | 10 - lib.esm/transaction/index.js.map | 1 - lib.esm/transaction/transaction.d.ts | 169 - lib.esm/transaction/transaction.d.ts.map | 1 - lib.esm/transaction/transaction.js | 365 - lib.esm/transaction/transaction.js.map | 1 - lib.esm/utils/base58.d.ts | 23 - lib.esm/utils/base58.d.ts.map | 1 - lib.esm/utils/base58.js | 55 - lib.esm/utils/base58.js.map | 1 - lib.esm/utils/base64-browser.d.ts | 4 - lib.esm/utils/base64-browser.d.ts.map | 1 - lib.esm/utils/base64-browser.js | 19 - lib.esm/utils/base64-browser.js.map | 1 - lib.esm/utils/base64.d.ts | 40 - lib.esm/utils/base64.d.ts.map | 1 - lib.esm/utils/base64.js | 52 - lib.esm/utils/base64.js.map | 1 - lib.esm/utils/data.d.ts | 107 - lib.esm/utils/data.d.ts.map | 1 - lib.esm/utils/data.js | 355 - lib.esm/utils/data.js.map | 1 - lib.esm/utils/errors.d.ts | 486 - lib.esm/utils/errors.d.ts.map | 1 - lib.esm/utils/errors.js | 215 - lib.esm/utils/errors.js.map | 1 - lib.esm/utils/events.d.ts | 77 - lib.esm/utils/events.d.ts.map | 1 - lib.esm/utils/events.js | 40 - lib.esm/utils/events.js.map | 1 - lib.esm/utils/fetch.d.ts | 327 - lib.esm/utils/fetch.d.ts.map | 1 - lib.esm/utils/fetch.js | 825 - lib.esm/utils/fetch.js.map | 1 - lib.esm/utils/fixednumber.d.ts | 252 - lib.esm/utils/fixednumber.d.ts.map | 1 - lib.esm/utils/fixednumber.js | 583 - lib.esm/utils/fixednumber.js.map | 1 - lib.esm/utils/geturl-browser.d.ts | 3 - lib.esm/utils/geturl-browser.d.ts.map | 1 - lib.esm/utils/geturl-browser.js | 47 - lib.esm/utils/geturl-browser.js.map | 1 - lib.esm/utils/geturl.d.ts | 6 - lib.esm/utils/geturl.d.ts.map | 1 - lib.esm/utils/geturl.js | 80 - lib.esm/utils/geturl.js.map | 1 - lib.esm/utils/index.d.ts | 30 - lib.esm/utils/index.d.ts.map | 1 - lib.esm/utils/index.js | 22 - lib.esm/utils/index.js.map | 1 - lib.esm/utils/maths.d.ts | 62 - lib.esm/utils/maths.d.ts.map | 1 - lib.esm/utils/maths.js | 220 - lib.esm/utils/maths.js.map | 1 - lib.esm/utils/properties.d.ts | 21 - lib.esm/utils/properties.d.ts.map | 1 - lib.esm/utils/properties.js | 70 - lib.esm/utils/properties.js.map | 1 - lib.esm/utils/rlp-decode.d.ts | 6 - lib.esm/utils/rlp-decode.d.ts.map | 1 - lib.esm/utils/rlp-decode.js | 84 - lib.esm/utils/rlp-decode.js.map | 1 - lib.esm/utils/rlp-encode.d.ts | 6 - lib.esm/utils/rlp-encode.d.ts.map | 1 - lib.esm/utils/rlp-encode.js | 48 - lib.esm/utils/rlp-encode.js.map | 1 - lib.esm/utils/rlp.d.ts | 13 - lib.esm/utils/rlp.d.ts.map | 1 - lib.esm/utils/rlp.js | 9 - lib.esm/utils/rlp.js.map | 1 - lib.esm/utils/units.d.ts | 26 - lib.esm/utils/units.d.ts.map | 1 - lib.esm/utils/units.js | 151 - lib.esm/utils/units.js.map | 1 - lib.esm/utils/utf8.d.ts | 96 - lib.esm/utils/utf8.d.ts.map | 1 - lib.esm/utils/utf8.js | 220 - lib.esm/utils/utf8.js.map | 1 - lib.esm/utils/uuid.d.ts | 8 - lib.esm/utils/uuid.d.ts.map | 1 - lib.esm/utils/uuid.js | 30 - lib.esm/utils/uuid.js.map | 1 - lib.esm/wallet/base-wallet.d.ts | 53 - lib.esm/wallet/base-wallet.d.ts.map | 1 - lib.esm/wallet/base-wallet.js | 117 - lib.esm/wallet/base-wallet.js.map | 1 - lib.esm/wallet/english_words.d.ts | 2 - lib.esm/wallet/english_words.d.ts.map | 1 - lib.esm/wallet/english_words.js | 2 - lib.esm/wallet/english_words.js.map | 1 - lib.esm/wallet/hdwallet.d.ts | 166 - lib.esm/wallet/hdwallet.d.ts.map | 1 - lib.esm/wallet/hdwallet.js | 366 - lib.esm/wallet/hdwallet.js.map | 1 - lib.esm/wallet/index.d.ts | 27 - lib.esm/wallet/index.d.ts.map | 1 - lib.esm/wallet/index.js | 25 - lib.esm/wallet/index.js.map | 1 - lib.esm/wallet/json-crowdsale.d.ts | 24 - lib.esm/wallet/json-crowdsale.d.ts.map | 1 - lib.esm/wallet/json-crowdsale.js | 56 - lib.esm/wallet/json-crowdsale.js.map | 1 - lib.esm/wallet/json-keystore.d.ts | 79 - lib.esm/wallet/json-keystore.d.ts.map | 1 - lib.esm/wallet/json-keystore.js | 335 - lib.esm/wallet/json-keystore.js.map | 1 - lib.esm/wallet/mnemonic.d.ts | 69 - lib.esm/wallet/mnemonic.d.ts.map | 1 - lib.esm/wallet/mnemonic.js | 166 - lib.esm/wallet/mnemonic.js.map | 1 - lib.esm/wallet/mnemonicToSeed.d.ts | 2 - lib.esm/wallet/mnemonicToSeed.d.ts.map | 1 - lib.esm/wallet/mnemonicToSeed.js | 23 - lib.esm/wallet/mnemonicToSeed.js.map | 1 - lib.esm/wallet/utils.d.ts | 8 - lib.esm/wallet/utils.d.ts.map | 1 - lib.esm/wallet/utils.js | 142 - lib.esm/wallet/utils.js.map | 1 - lib.esm/wallet/wallet.d.ts | 86 - lib.esm/wallet/wallet.d.ts.map | 1 - lib.esm/wallet/wallet.js | 180 - lib.esm/wallet/wallet.js.map | 1 - lib.esm/wordlists/bit-reader.d.ts | 5 - lib.esm/wordlists/bit-reader.d.ts.map | 1 - lib.esm/wordlists/bit-reader.js | 32 - lib.esm/wordlists/bit-reader.js.map | 1 - lib.esm/wordlists/decode-owl.d.ts | 9 - lib.esm/wordlists/decode-owl.d.ts.map | 1 - lib.esm/wordlists/decode-owl.js | 55 - lib.esm/wordlists/decode-owl.js.map | 1 - lib.esm/wordlists/decode-owla.d.ts | 5 - lib.esm/wordlists/decode-owla.d.ts.map | 1 - lib.esm/wordlists/decode-owla.js | 28 - lib.esm/wordlists/decode-owla.js.map | 1 - lib.esm/wordlists/enwords.d.ts | 2 - lib.esm/wordlists/enwords.d.ts.map | 1 - lib.esm/wordlists/enwords.js | 2 - lib.esm/wordlists/enwords.js.map | 1 - .../wordlists/generation/encode-latin.d.ts | 25 - .../generation/encode-latin.d.ts.map | 1 - lib.esm/wordlists/generation/encode-latin.js | 357 - .../wordlists/generation/encode-latin.js.map | 1 - lib.esm/wordlists/index.d.ts | 25 - lib.esm/wordlists/index.d.ts.map | 1 - lib.esm/wordlists/index.js | 25 - lib.esm/wordlists/index.js.map | 1 - lib.esm/wordlists/lang-cz.d.ts | 23 - lib.esm/wordlists/lang-cz.d.ts.map | 1 - lib.esm/wordlists/lang-cz.js | 33 - lib.esm/wordlists/lang-cz.js.map | 1 - lib.esm/wordlists/lang-en.d.ts | 23 - lib.esm/wordlists/lang-en.d.ts.map | 1 - lib.esm/wordlists/lang-en.js | 33 - lib.esm/wordlists/lang-en.js.map | 1 - lib.esm/wordlists/lang-es.d.ts | 23 - lib.esm/wordlists/lang-es.d.ts.map | 1 - lib.esm/wordlists/lang-es.js | 34 - lib.esm/wordlists/lang-es.js.map | 1 - lib.esm/wordlists/lang-fr.d.ts | 23 - lib.esm/wordlists/lang-fr.d.ts.map | 1 - lib.esm/wordlists/lang-fr.js | 34 - lib.esm/wordlists/lang-fr.js.map | 1 - lib.esm/wordlists/lang-it.d.ts | 23 - lib.esm/wordlists/lang-it.d.ts.map | 1 - lib.esm/wordlists/lang-it.js | 33 - lib.esm/wordlists/lang-it.js.map | 1 - lib.esm/wordlists/lang-ja.d.ts | 27 - lib.esm/wordlists/lang-ja.d.ts.map | 1 - lib.esm/wordlists/lang-ja.js | 157 - lib.esm/wordlists/lang-ja.js.map | 1 - lib.esm/wordlists/lang-ko.d.ts | 25 - lib.esm/wordlists/lang-ko.d.ts.map | 1 - lib.esm/wordlists/lang-ko.js | 90 - lib.esm/wordlists/lang-ko.js.map | 1 - lib.esm/wordlists/lang-pt.d.ts | 23 - lib.esm/wordlists/lang-pt.d.ts.map | 1 - lib.esm/wordlists/lang-pt.js | 33 - lib.esm/wordlists/lang-pt.js.map | 1 - lib.esm/wordlists/lang-zh.d.ts | 32 - lib.esm/wordlists/lang-zh.d.ts.map | 1 - lib.esm/wordlists/lang-zh.js | 95 - lib.esm/wordlists/lang-zh.js.map | 1 - lib.esm/wordlists/wordlist-owl.d.ts | 26 - lib.esm/wordlists/wordlist-owl.d.ts.map | 1 - lib.esm/wordlists/wordlist-owl.js | 62 - lib.esm/wordlists/wordlist-owl.js.map | 1 - lib.esm/wordlists/wordlist-owla.d.ts | 20 - lib.esm/wordlists/wordlist-owla.d.ts.map | 1 - lib.esm/wordlists/wordlist-owla.js | 28 - lib.esm/wordlists/wordlist-owla.js.map | 1 - lib.esm/wordlists/wordlist.d.ts | 48 - lib.esm/wordlists/wordlist.d.ts.map | 1 - lib.esm/wordlists/wordlist.js | 55 - lib.esm/wordlists/wordlist.js.map | 1 - lib.esm/wordlists/wordlists-browser.d.ts | 3 - lib.esm/wordlists/wordlists-browser.d.ts.map | 1 - lib.esm/wordlists/wordlists-browser.js | 5 - lib.esm/wordlists/wordlists-browser.js.map | 1 - lib.esm/wordlists/wordlists-extra.d.ts | 9 - lib.esm/wordlists/wordlists-extra.d.ts.map | 1 - lib.esm/wordlists/wordlists-extra.js | 9 - lib.esm/wordlists/wordlists-extra.js.map | 1 - lib.esm/wordlists/wordlists.d.ts | 16 - lib.esm/wordlists/wordlists.d.ts.map | 1 - lib.esm/wordlists/wordlists.js | 35 - lib.esm/wordlists/wordlists.js.map | 1 - package-lock.json | 1576 - types/_version.d.ts | 3 - types/_version.d.ts.map | 1 - types/abi-types/Tes.d.ts | 223 - types/abi-types/Tes.d.ts.map | 1 - types/abi-types/Tes_abi.d.ts | 223 - types/abi-types/Tes_abi.d.ts.map | 1 - types/abi-types/common.d.ts | 51 - types/abi-types/common.d.ts.map | 1 - types/abi-types/factories/Tes__factory.d.ts | 280 - .../abi-types/factories/Tes__factory.d.ts.map | 1 - .../abi-types/factories/Tes_abi__factory.d.ts | 280 - .../factories/Tes_abi__factory.d.ts.map | 1 - types/abi-types/factories/index.d.ts | 2 - types/abi-types/factories/index.d.ts.map | 1 - types/abi-types/index.d.ts | 4 - types/abi-types/index.d.ts.map | 1 - types/abi/abi-coder.d.ts | 59 - types/abi/abi-coder.d.ts.map | 1 - types/abi/bytes32.d.ts | 15 - types/abi/bytes32.d.ts.map | 1 - types/abi/coders/abstract-coder.d.ts | 117 - types/abi/coders/abstract-coder.d.ts.map | 1 - types/abi/coders/address.d.ts | 13 - types/abi/coders/address.d.ts.map | 1 - types/abi/coders/anonymous.d.ts | 15 - types/abi/coders/anonymous.d.ts.map | 1 - types/abi/coders/array.d.ts | 25 - types/abi/coders/array.d.ts.map | 1 - types/abi/coders/boolean.d.ts | 13 - types/abi/coders/boolean.d.ts.map | 1 - types/abi/coders/bytes.d.ts | 19 - types/abi/coders/bytes.d.ts.map | 1 - types/abi/coders/fixed-bytes.d.ts | 15 - types/abi/coders/fixed-bytes.d.ts.map | 1 - types/abi/coders/null.d.ts | 12 - types/abi/coders/null.d.ts.map | 1 - types/abi/coders/number.d.ts | 16 - types/abi/coders/number.d.ts.map | 1 - types/abi/coders/string.d.ts | 13 - types/abi/coders/string.d.ts.map | 1 - types/abi/coders/tuple.d.ts | 16 - types/abi/coders/tuple.d.ts.map | 1 - types/abi/fragments.d.ts | 372 - types/abi/fragments.d.ts.map | 1 - types/abi/index.d.ts | 14 - types/abi/index.d.ts.map | 1 - types/abi/interface.d.ts | 270 - types/abi/interface.d.ts.map | 1 - types/abi/typed.d.ts | 172 - types/abi/typed.d.ts.map | 1 - types/address/checks.d.ts | 78 - types/address/checks.d.ts.map | 1 - types/address/contract-address.d.ts | 41 - types/address/contract-address.d.ts.map | 1 - types/address/index.d.ts | 101 - types/address/index.d.ts.map | 1 - types/bigNumber/bigNumber.d.ts | 40 - types/bigNumber/bigNumber.d.ts.map | 1 - types/cip/custom-units.d.ts | 33 - types/cip/custom-units.d.ts.map | 1 - types/cip/index.d.ts | 49 - types/cip/index.d.ts.map | 1 - types/constants/addresses.d.ts | 7 - types/constants/addresses.d.ts.map | 1 - types/constants/hashes.d.ts | 7 - types/constants/hashes.d.ts.map | 1 - types/constants/index.d.ts | 10 - types/constants/index.d.ts.map | 1 - types/constants/numbers.d.ts | 35 - types/constants/numbers.d.ts.map | 1 - types/constants/strings.d.ts | 13 - types/constants/strings.d.ts.map | 1 - types/contract/contract.d.ts | 52 - types/contract/contract.d.ts.map | 1 - types/contract/factory.d.ts | 22 - types/contract/factory.d.ts.map | 1 - types/contract/index.d.ts | 10 - types/contract/index.d.ts.map | 1 - types/contract/types.d.ts | 56 - types/contract/types.d.ts.map | 1 - types/contract/wrappers.d.ts | 41 - types/contract/wrappers.d.ts.map | 1 - types/corebc.d.ts | 28 - types/corebc.d.ts.map | 1 - types/crypto/browser-ed448.d.ts | 4 - types/crypto/browser-ed448.d.ts.map | 1 - types/crypto/browser-sha3.d.ts | 7 - types/crypto/browser-sha3.d.ts.map | 1 - types/crypto/crypto-browser.d.ts | 18 - types/crypto/crypto-browser.d.ts.map | 1 - types/crypto/crypto.d.ts | 6 - types/crypto/crypto.d.ts.map | 1 - types/crypto/ed448-types.d.ts | 15 - types/crypto/ed448-types.d.ts.map | 1 - types/crypto/ed448.d.ts | 4 - types/crypto/ed448.d.ts.map | 1 - types/crypto/ed448goldilock-browser.d.ts | 16 - types/crypto/ed448goldilock-browser.d.ts.map | 1 - types/crypto/ed448goldilock.d.ts | 16 - types/crypto/ed448goldilock.d.ts.map | 1 - types/crypto/hmac.d.ts | 27 - types/crypto/hmac.d.ts.map | 1 - types/crypto/index.d.ts | 22 - types/crypto/index.d.ts.map | 1 - types/crypto/keccak.d.ts | 37 - types/crypto/keccak.d.ts.map | 1 - types/crypto/pbkdf2-browser.d.ts | 3 - types/crypto/pbkdf2-browser.d.ts.map | 1 - types/crypto/pbkdf2.d.ts | 37 - types/crypto/pbkdf2.d.ts.map | 1 - types/crypto/random.d.ts | 16 - types/crypto/random.d.ts.map | 1 - types/crypto/ripemd160.d.ts | 27 - types/crypto/ripemd160.d.ts.map | 1 - types/crypto/rlp.d.ts | 4 - types/crypto/rlp.d.ts.map | 1 - types/crypto/scrypt.d.ts | 85 - types/crypto/scrypt.d.ts.map | 1 - types/crypto/sha3.d.ts | 57 - types/crypto/sha3.d.ts.map | 1 - types/crypto/signature.d.ts | 131 - types/crypto/signature.d.ts.map | 1 - types/crypto/signing-key.d.ts | 56 - types/crypto/signing-key.d.ts.map | 1 - types/hash/id.d.ts | 11 - types/hash/id.d.ts.map | 1 - types/hash/index.d.ts | 11 - types/hash/index.d.ts.map | 1 - types/hash/message.d.ts | 34 - types/hash/message.d.ts.map | 1 - types/hash/solidity.d.ts | 21 - types/hash/solidity.d.ts.map | 1 - types/hash/typed-data.d.ts | 42 - types/hash/typed-data.d.ts.map | 1 - types/index.d.ts | 13 - types/index.d.ts.map | 1 - types/ipfs/index.d.ts | 18 - types/ipfs/index.d.ts.map | 1 - types/logger/logger.d.ts | 52 - types/logger/logger.d.ts.map | 1 - types/providers/abstract-provider.d.ts | 211 - types/providers/abstract-provider.d.ts.map | 1 - types/providers/abstract-signer.d.ts | 31 - types/providers/abstract-signer.d.ts.map | 1 - types/providers/community.d.ts | 29 - types/providers/community.d.ts.map | 1 - types/providers/contracts.d.ts | 9 - types/providers/contracts.d.ts.map | 1 - types/providers/default-provider.d.ts | 5 - types/providers/default-provider.d.ts.map | 1 - types/providers/format.d.ts | 15 - types/providers/format.d.ts.map | 1 - types/providers/formatting.d.ts | 65 - types/providers/formatting.d.ts.map | 1 - types/providers/index.d.ts | 38 - types/providers/index.d.ts.map | 1 - types/providers/network.d.ts | 83 - types/providers/network.d.ts.map | 1 - types/providers/pagination.d.ts | 6 - types/providers/pagination.d.ts.map | 1 - types/providers/plugin-fallback.d.ts | 13 - types/providers/plugin-fallback.d.ts.map | 1 - types/providers/plugins-network.d.ts | 33 - types/providers/plugins-network.d.ts.map | 1 - types/providers/provider-alchemy.d.ts | 31 - types/providers/provider-alchemy.d.ts.map | 1 - types/providers/provider-ankr.d.ts | 51 - types/providers/provider-ankr.d.ts.map | 1 - types/providers/provider-browser.d.ts | 32 - types/providers/provider-browser.d.ts.map | 1 - types/providers/provider-cloudflare.d.ts | 14 - types/providers/provider-cloudflare.d.ts.map | 1 - types/providers/provider-fallback.d.ts | 51 - types/providers/provider-fallback.d.ts.map | 1 - types/providers/provider-infura.d.ts | 90 - types/providers/provider-infura.d.ts.map | 1 - .../providers/provider-ipcsocket-browser.d.ts | 3 - .../provider-ipcsocket-browser.d.ts.map | 1 - types/providers/provider-ipcsocket.d.ts | 12 - types/providers/provider-ipcsocket.d.ts.map | 1 - types/providers/provider-jsonrpc.d.ts | 267 - types/providers/provider-jsonrpc.d.ts.map | 1 - types/providers/provider-pocket.d.ts | 54 - types/providers/provider-pocket.d.ts.map | 1 - types/providers/provider-quicknode.d.ts | 50 - types/providers/provider-quicknode.d.ts.map | 1 - types/providers/provider-socket.d.ts | 54 - types/providers/provider-socket.d.ts.map | 1 - types/providers/provider-websocket.d.ts | 19 - types/providers/provider-websocket.d.ts.map | 1 - types/providers/provider.d.ts | 623 - types/providers/provider.d.ts.map | 1 - types/providers/signer-noncemanager.d.ts | 19 - types/providers/signer-noncemanager.d.ts.map | 1 - types/providers/signer.d.ts | 118 - types/providers/signer.d.ts.map | 1 - types/providers/subscriber-connection.d.ts | 25 - .../providers/subscriber-connection.d.ts.map | 1 - types/providers/subscriber-filterid.d.ts | 46 - types/providers/subscriber-filterid.d.ts.map | 1 - types/providers/subscriber-polling.d.ts | 71 - types/providers/subscriber-polling.d.ts.map | 1 - types/providers/ws-browser.d.ts | 3 - types/providers/ws-browser.d.ts.map | 1 - types/providers/ws.d.ts | 2 - types/providers/ws.d.ts.map | 1 - types/transaction/accesslist.d.ts | 6 - types/transaction/accesslist.d.ts.map | 1 - types/transaction/address.d.ts | 18 - types/transaction/address.d.ts.map | 1 - types/transaction/index.d.ts | 25 - types/transaction/index.d.ts.map | 1 - types/transaction/transaction.d.ts | 169 - types/transaction/transaction.d.ts.map | 1 - types/utils/base58.d.ts | 23 - types/utils/base58.d.ts.map | 1 - types/utils/base64-browser.d.ts | 4 - types/utils/base64-browser.d.ts.map | 1 - types/utils/base64.d.ts | 40 - types/utils/base64.d.ts.map | 1 - types/utils/data.d.ts | 107 - types/utils/data.d.ts.map | 1 - types/utils/errors.d.ts | 486 - types/utils/errors.d.ts.map | 1 - types/utils/events.d.ts | 77 - types/utils/events.d.ts.map | 1 - types/utils/fetch.d.ts | 327 - types/utils/fetch.d.ts.map | 1 - types/utils/fixednumber.d.ts | 252 - types/utils/fixednumber.d.ts.map | 1 - types/utils/geturl-browser.d.ts | 3 - types/utils/geturl-browser.d.ts.map | 1 - types/utils/geturl.d.ts | 6 - types/utils/geturl.d.ts.map | 1 - types/utils/index.d.ts | 30 - types/utils/index.d.ts.map | 1 - types/utils/maths.d.ts | 62 - types/utils/maths.d.ts.map | 1 - types/utils/properties.d.ts | 21 - types/utils/properties.d.ts.map | 1 - types/utils/rlp-decode.d.ts | 6 - types/utils/rlp-decode.d.ts.map | 1 - types/utils/rlp-encode.d.ts | 6 - types/utils/rlp-encode.d.ts.map | 1 - types/utils/rlp.d.ts | 13 - types/utils/rlp.d.ts.map | 1 - types/utils/units.d.ts | 26 - types/utils/units.d.ts.map | 1 - types/utils/utf8.d.ts | 96 - types/utils/utf8.d.ts.map | 1 - types/utils/uuid.d.ts | 8 - types/utils/uuid.d.ts.map | 1 - types/wallet/base-wallet.d.ts | 53 - types/wallet/base-wallet.d.ts.map | 1 - types/wallet/english_words.d.ts | 2 - types/wallet/english_words.d.ts.map | 1 - types/wallet/hdwallet.d.ts | 166 - types/wallet/hdwallet.d.ts.map | 1 - types/wallet/index.d.ts | 27 - types/wallet/index.d.ts.map | 1 - types/wallet/json-crowdsale.d.ts | 24 - types/wallet/json-crowdsale.d.ts.map | 1 - types/wallet/json-keystore.d.ts | 79 - types/wallet/json-keystore.d.ts.map | 1 - types/wallet/mnemonic.d.ts | 69 - types/wallet/mnemonic.d.ts.map | 1 - types/wallet/mnemonicToSeed.d.ts | 2 - types/wallet/mnemonicToSeed.d.ts.map | 1 - types/wallet/utils.d.ts | 8 - types/wallet/utils.d.ts.map | 1 - types/wallet/wallet.d.ts | 86 - types/wallet/wallet.d.ts.map | 1 - types/wordlists/bit-reader.d.ts | 5 - types/wordlists/bit-reader.d.ts.map | 1 - types/wordlists/decode-owl.d.ts | 9 - types/wordlists/decode-owl.d.ts.map | 1 - types/wordlists/decode-owla.d.ts | 5 - types/wordlists/decode-owla.d.ts.map | 1 - types/wordlists/enwords.d.ts | 2 - types/wordlists/enwords.d.ts.map | 1 - types/wordlists/generation/encode-latin.d.ts | 25 - .../generation/encode-latin.d.ts.map | 1 - types/wordlists/index.d.ts | 25 - types/wordlists/index.d.ts.map | 1 - types/wordlists/lang-cz.d.ts | 23 - types/wordlists/lang-cz.d.ts.map | 1 - types/wordlists/lang-en.d.ts | 23 - types/wordlists/lang-en.d.ts.map | 1 - types/wordlists/lang-es.d.ts | 23 - types/wordlists/lang-es.d.ts.map | 1 - types/wordlists/lang-fr.d.ts | 23 - types/wordlists/lang-fr.d.ts.map | 1 - types/wordlists/lang-it.d.ts | 23 - types/wordlists/lang-it.d.ts.map | 1 - types/wordlists/lang-ja.d.ts | 27 - types/wordlists/lang-ja.d.ts.map | 1 - types/wordlists/lang-ko.d.ts | 25 - types/wordlists/lang-ko.d.ts.map | 1 - types/wordlists/lang-pt.d.ts | 23 - types/wordlists/lang-pt.d.ts.map | 1 - types/wordlists/lang-zh.d.ts | 32 - types/wordlists/lang-zh.d.ts.map | 1 - types/wordlists/wordlist-owl.d.ts | 26 - types/wordlists/wordlist-owl.d.ts.map | 1 - types/wordlists/wordlist-owla.d.ts | 20 - types/wordlists/wordlist-owla.d.ts.map | 1 - types/wordlists/wordlist.d.ts | 48 - types/wordlists/wordlist.d.ts.map | 1 - types/wordlists/wordlists-browser.d.ts | 3 - types/wordlists/wordlists-browser.d.ts.map | 1 - types/wordlists/wordlists-extra.d.ts | 9 - types/wordlists/wordlists-extra.d.ts.map | 1 - types/wordlists/wordlists.d.ts | 16 - types/wordlists/wordlists.d.ts.map | 1 - 1642 files changed, 173306 deletions(-) delete mode 100644 .gitattributes delete mode 100644 dist/README.md delete mode 100644 dist/corebc.js delete mode 100644 dist/corebc.js.map delete mode 100644 dist/corebc.min.js delete mode 100644 dist/corebc.umd.js delete mode 100644 dist/corebc.umd.js.map delete mode 100644 dist/corebc.umd.min.js delete mode 100644 dist/wordlists-extra.js delete mode 100644 dist/wordlists-extra.js.map delete mode 100644 dist/wordlists-extra.min.js delete mode 100644 lib.commonjs/README.md delete mode 100644 lib.commonjs/_tests/blockchain-data.d.ts delete mode 100644 lib.commonjs/_tests/blockchain-data.d.ts.map delete mode 100644 lib.commonjs/_tests/blockchain-data.js delete mode 100644 lib.commonjs/_tests/blockchain-data.js.map delete mode 100644 lib.commonjs/_tests/create-provider.d.ts delete mode 100644 lib.commonjs/_tests/create-provider.d.ts.map delete mode 100644 lib.commonjs/_tests/create-provider.js delete mode 100644 lib.commonjs/_tests/create-provider.js.map delete mode 100644 lib.commonjs/_tests/test-cip.d.ts delete mode 100644 lib.commonjs/_tests/test-cip.d.ts.map delete mode 100644 lib.commonjs/_tests/test-cip.js delete mode 100644 lib.commonjs/_tests/test-cip.js.map delete mode 100644 lib.commonjs/_tests/test-contract.d.ts delete mode 100644 lib.commonjs/_tests/test-contract.d.ts.map delete mode 100644 lib.commonjs/_tests/test-contract.js delete mode 100644 lib.commonjs/_tests/test-contract.js.map delete mode 100644 lib.commonjs/_tests/test-crypto.d.ts delete mode 100644 lib.commonjs/_tests/test-crypto.d.ts.map delete mode 100644 lib.commonjs/_tests/test-crypto.js delete mode 100644 lib.commonjs/_tests/test-crypto.js.map delete mode 100644 lib.commonjs/_tests/test-keystore.d.ts delete mode 100644 lib.commonjs/_tests/test-keystore.d.ts.map delete mode 100644 lib.commonjs/_tests/test-keystore.js delete mode 100644 lib.commonjs/_tests/test-keystore.js.map delete mode 100644 lib.commonjs/_tests/types.d.ts delete mode 100644 lib.commonjs/_tests/types.d.ts.map delete mode 100644 lib.commonjs/_tests/types.js delete mode 100644 lib.commonjs/_tests/types.js.map delete mode 100644 lib.commonjs/_version.d.ts delete mode 100644 lib.commonjs/_version.d.ts.map delete mode 100644 lib.commonjs/_version.js delete mode 100644 lib.commonjs/_version.js.map delete mode 100644 lib.commonjs/abi-types/Tes.d.ts delete mode 100644 lib.commonjs/abi-types/Tes.d.ts.map delete mode 100644 lib.commonjs/abi-types/Tes.js delete mode 100644 lib.commonjs/abi-types/Tes.js.map delete mode 100644 lib.commonjs/abi-types/Tes_abi.d.ts delete mode 100644 lib.commonjs/abi-types/Tes_abi.d.ts.map delete mode 100644 lib.commonjs/abi-types/Tes_abi.js delete mode 100644 lib.commonjs/abi-types/Tes_abi.js.map delete mode 100644 lib.commonjs/abi-types/common.d.ts delete mode 100644 lib.commonjs/abi-types/common.d.ts.map delete mode 100644 lib.commonjs/abi-types/common.js delete mode 100644 lib.commonjs/abi-types/common.js.map delete mode 100644 lib.commonjs/abi-types/factories/Tes__factory.d.ts delete mode 100644 lib.commonjs/abi-types/factories/Tes__factory.d.ts.map delete mode 100644 lib.commonjs/abi-types/factories/Tes__factory.js delete mode 100644 lib.commonjs/abi-types/factories/Tes__factory.js.map delete mode 100644 lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts delete mode 100644 lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts.map delete mode 100644 lib.commonjs/abi-types/factories/Tes_abi__factory.js delete mode 100644 lib.commonjs/abi-types/factories/Tes_abi__factory.js.map delete mode 100644 lib.commonjs/abi-types/factories/index.d.ts delete mode 100644 lib.commonjs/abi-types/factories/index.d.ts.map delete mode 100644 lib.commonjs/abi-types/factories/index.js delete mode 100644 lib.commonjs/abi-types/factories/index.js.map delete mode 100644 lib.commonjs/abi-types/index.d.ts delete mode 100644 lib.commonjs/abi-types/index.d.ts.map delete mode 100644 lib.commonjs/abi-types/index.js delete mode 100644 lib.commonjs/abi-types/index.js.map delete mode 100644 lib.commonjs/abi/abi-coder.d.ts delete mode 100644 lib.commonjs/abi/abi-coder.d.ts.map delete mode 100644 lib.commonjs/abi/abi-coder.js delete mode 100644 lib.commonjs/abi/abi-coder.js.map delete mode 100644 lib.commonjs/abi/bytes32.d.ts delete mode 100644 lib.commonjs/abi/bytes32.d.ts.map delete mode 100644 lib.commonjs/abi/bytes32.js delete mode 100644 lib.commonjs/abi/bytes32.js.map delete mode 100644 lib.commonjs/abi/coders/abstract-coder.d.ts delete mode 100644 lib.commonjs/abi/coders/abstract-coder.d.ts.map delete mode 100644 lib.commonjs/abi/coders/abstract-coder.js delete mode 100644 lib.commonjs/abi/coders/abstract-coder.js.map delete mode 100644 lib.commonjs/abi/coders/address.d.ts delete mode 100644 lib.commonjs/abi/coders/address.d.ts.map delete mode 100644 lib.commonjs/abi/coders/address.js delete mode 100644 lib.commonjs/abi/coders/address.js.map delete mode 100644 lib.commonjs/abi/coders/anonymous.d.ts delete mode 100644 lib.commonjs/abi/coders/anonymous.d.ts.map delete mode 100644 lib.commonjs/abi/coders/anonymous.js delete mode 100644 lib.commonjs/abi/coders/anonymous.js.map delete mode 100644 lib.commonjs/abi/coders/array.d.ts delete mode 100644 lib.commonjs/abi/coders/array.d.ts.map delete mode 100644 lib.commonjs/abi/coders/array.js delete mode 100644 lib.commonjs/abi/coders/array.js.map delete mode 100644 lib.commonjs/abi/coders/boolean.d.ts delete mode 100644 lib.commonjs/abi/coders/boolean.d.ts.map delete mode 100644 lib.commonjs/abi/coders/boolean.js delete mode 100644 lib.commonjs/abi/coders/boolean.js.map delete mode 100644 lib.commonjs/abi/coders/bytes.d.ts delete mode 100644 lib.commonjs/abi/coders/bytes.d.ts.map delete mode 100644 lib.commonjs/abi/coders/bytes.js delete mode 100644 lib.commonjs/abi/coders/bytes.js.map delete mode 100644 lib.commonjs/abi/coders/fixed-bytes.d.ts delete mode 100644 lib.commonjs/abi/coders/fixed-bytes.d.ts.map delete mode 100644 lib.commonjs/abi/coders/fixed-bytes.js delete mode 100644 lib.commonjs/abi/coders/fixed-bytes.js.map delete mode 100644 lib.commonjs/abi/coders/null.d.ts delete mode 100644 lib.commonjs/abi/coders/null.d.ts.map delete mode 100644 lib.commonjs/abi/coders/null.js delete mode 100644 lib.commonjs/abi/coders/null.js.map delete mode 100644 lib.commonjs/abi/coders/number.d.ts delete mode 100644 lib.commonjs/abi/coders/number.d.ts.map delete mode 100644 lib.commonjs/abi/coders/number.js delete mode 100644 lib.commonjs/abi/coders/number.js.map delete mode 100644 lib.commonjs/abi/coders/string.d.ts delete mode 100644 lib.commonjs/abi/coders/string.d.ts.map delete mode 100644 lib.commonjs/abi/coders/string.js delete mode 100644 lib.commonjs/abi/coders/string.js.map delete mode 100644 lib.commonjs/abi/coders/tuple.d.ts delete mode 100644 lib.commonjs/abi/coders/tuple.d.ts.map delete mode 100644 lib.commonjs/abi/coders/tuple.js delete mode 100644 lib.commonjs/abi/coders/tuple.js.map delete mode 100644 lib.commonjs/abi/fragments.d.ts delete mode 100644 lib.commonjs/abi/fragments.d.ts.map delete mode 100644 lib.commonjs/abi/fragments.js delete mode 100644 lib.commonjs/abi/fragments.js.map delete mode 100644 lib.commonjs/abi/index.d.ts delete mode 100644 lib.commonjs/abi/index.d.ts.map delete mode 100644 lib.commonjs/abi/index.js delete mode 100644 lib.commonjs/abi/index.js.map delete mode 100644 lib.commonjs/abi/interface.d.ts delete mode 100644 lib.commonjs/abi/interface.d.ts.map delete mode 100644 lib.commonjs/abi/interface.js delete mode 100644 lib.commonjs/abi/interface.js.map delete mode 100644 lib.commonjs/abi/typed.d.ts delete mode 100644 lib.commonjs/abi/typed.d.ts.map delete mode 100644 lib.commonjs/abi/typed.js delete mode 100644 lib.commonjs/abi/typed.js.map delete mode 100644 lib.commonjs/address/checks.d.ts delete mode 100644 lib.commonjs/address/checks.d.ts.map delete mode 100644 lib.commonjs/address/checks.js delete mode 100644 lib.commonjs/address/checks.js.map delete mode 100644 lib.commonjs/address/contract-address.d.ts delete mode 100644 lib.commonjs/address/contract-address.d.ts.map delete mode 100644 lib.commonjs/address/contract-address.js delete mode 100644 lib.commonjs/address/contract-address.js.map delete mode 100644 lib.commonjs/address/index.d.ts delete mode 100644 lib.commonjs/address/index.d.ts.map delete mode 100644 lib.commonjs/address/index.js delete mode 100644 lib.commonjs/address/index.js.map delete mode 100644 lib.commonjs/bigNumber/bigNumber.d.ts delete mode 100644 lib.commonjs/bigNumber/bigNumber.d.ts.map delete mode 100644 lib.commonjs/bigNumber/bigNumber.js delete mode 100644 lib.commonjs/bigNumber/bigNumber.js.map delete mode 100644 lib.commonjs/cip/custom-units.d.ts delete mode 100644 lib.commonjs/cip/custom-units.d.ts.map delete mode 100644 lib.commonjs/cip/custom-units.js delete mode 100644 lib.commonjs/cip/custom-units.js.map delete mode 100644 lib.commonjs/cip/index.d.ts delete mode 100644 lib.commonjs/cip/index.d.ts.map delete mode 100644 lib.commonjs/cip/index.js delete mode 100644 lib.commonjs/cip/index.js.map delete mode 100644 lib.commonjs/constants/addresses.d.ts delete mode 100644 lib.commonjs/constants/addresses.d.ts.map delete mode 100644 lib.commonjs/constants/addresses.js delete mode 100644 lib.commonjs/constants/addresses.js.map delete mode 100644 lib.commonjs/constants/hashes.d.ts delete mode 100644 lib.commonjs/constants/hashes.d.ts.map delete mode 100644 lib.commonjs/constants/hashes.js delete mode 100644 lib.commonjs/constants/hashes.js.map delete mode 100644 lib.commonjs/constants/index.d.ts delete mode 100644 lib.commonjs/constants/index.d.ts.map delete mode 100644 lib.commonjs/constants/index.js delete mode 100644 lib.commonjs/constants/index.js.map delete mode 100644 lib.commonjs/constants/numbers.d.ts delete mode 100644 lib.commonjs/constants/numbers.d.ts.map delete mode 100644 lib.commonjs/constants/numbers.js delete mode 100644 lib.commonjs/constants/numbers.js.map delete mode 100644 lib.commonjs/constants/strings.d.ts delete mode 100644 lib.commonjs/constants/strings.d.ts.map delete mode 100644 lib.commonjs/constants/strings.js delete mode 100644 lib.commonjs/constants/strings.js.map delete mode 100644 lib.commonjs/contract/contract.d.ts delete mode 100644 lib.commonjs/contract/contract.d.ts.map delete mode 100644 lib.commonjs/contract/contract.js delete mode 100644 lib.commonjs/contract/contract.js.map delete mode 100644 lib.commonjs/contract/factory.d.ts delete mode 100644 lib.commonjs/contract/factory.d.ts.map delete mode 100644 lib.commonjs/contract/factory.js delete mode 100644 lib.commonjs/contract/factory.js.map delete mode 100644 lib.commonjs/contract/index.d.ts delete mode 100644 lib.commonjs/contract/index.d.ts.map delete mode 100644 lib.commonjs/contract/index.js delete mode 100644 lib.commonjs/contract/index.js.map delete mode 100644 lib.commonjs/contract/types.d.ts delete mode 100644 lib.commonjs/contract/types.d.ts.map delete mode 100644 lib.commonjs/contract/types.js delete mode 100644 lib.commonjs/contract/types.js.map delete mode 100644 lib.commonjs/contract/wrappers.d.ts delete mode 100644 lib.commonjs/contract/wrappers.d.ts.map delete mode 100644 lib.commonjs/contract/wrappers.js delete mode 100644 lib.commonjs/contract/wrappers.js.map delete mode 100644 lib.commonjs/corebc.d.ts delete mode 100644 lib.commonjs/corebc.d.ts.map delete mode 100644 lib.commonjs/corebc.js delete mode 100644 lib.commonjs/corebc.js.map delete mode 100644 lib.commonjs/crypto/browser-ed448.d.ts delete mode 100644 lib.commonjs/crypto/browser-ed448.d.ts.map delete mode 100644 lib.commonjs/crypto/browser-ed448.js delete mode 100644 lib.commonjs/crypto/browser-ed448.js.map delete mode 100644 lib.commonjs/crypto/browser-sha3.d.ts delete mode 100644 lib.commonjs/crypto/browser-sha3.d.ts.map delete mode 100644 lib.commonjs/crypto/browser-sha3.js delete mode 100644 lib.commonjs/crypto/browser-sha3.js.map delete mode 100644 lib.commonjs/crypto/crypto-browser.d.ts delete mode 100644 lib.commonjs/crypto/crypto-browser.d.ts.map delete mode 100644 lib.commonjs/crypto/crypto-browser.js delete mode 100644 lib.commonjs/crypto/crypto-browser.js.map delete mode 100644 lib.commonjs/crypto/crypto.d.ts delete mode 100644 lib.commonjs/crypto/crypto.d.ts.map delete mode 100644 lib.commonjs/crypto/crypto.js delete mode 100644 lib.commonjs/crypto/crypto.js.map delete mode 100644 lib.commonjs/crypto/ed448-types.d.ts delete mode 100644 lib.commonjs/crypto/ed448-types.d.ts.map delete mode 100644 lib.commonjs/crypto/ed448-types.js delete mode 100644 lib.commonjs/crypto/ed448-types.js.map delete mode 100644 lib.commonjs/crypto/ed448.d.ts delete mode 100644 lib.commonjs/crypto/ed448.d.ts.map delete mode 100644 lib.commonjs/crypto/ed448.js delete mode 100644 lib.commonjs/crypto/ed448.js.map delete mode 100644 lib.commonjs/crypto/ed448goldilock-browser.d.ts delete mode 100644 lib.commonjs/crypto/ed448goldilock-browser.d.ts.map delete mode 100644 lib.commonjs/crypto/ed448goldilock-browser.js delete mode 100644 lib.commonjs/crypto/ed448goldilock-browser.js.map delete mode 100644 lib.commonjs/crypto/ed448goldilock.d.ts delete mode 100644 lib.commonjs/crypto/ed448goldilock.d.ts.map delete mode 100644 lib.commonjs/crypto/ed448goldilock.js delete mode 100644 lib.commonjs/crypto/ed448goldilock.js.map delete mode 100644 lib.commonjs/crypto/hmac.d.ts delete mode 100644 lib.commonjs/crypto/hmac.d.ts.map delete mode 100644 lib.commonjs/crypto/hmac.js delete mode 100644 lib.commonjs/crypto/hmac.js.map delete mode 100644 lib.commonjs/crypto/index.d.ts delete mode 100644 lib.commonjs/crypto/index.d.ts.map delete mode 100644 lib.commonjs/crypto/index.js delete mode 100644 lib.commonjs/crypto/index.js.map delete mode 100644 lib.commonjs/crypto/keccak.d.ts delete mode 100644 lib.commonjs/crypto/keccak.d.ts.map delete mode 100644 lib.commonjs/crypto/keccak.js delete mode 100644 lib.commonjs/crypto/keccak.js.map delete mode 100644 lib.commonjs/crypto/pbkdf2-browser.d.ts delete mode 100644 lib.commonjs/crypto/pbkdf2-browser.d.ts.map delete mode 100644 lib.commonjs/crypto/pbkdf2-browser.js delete mode 100644 lib.commonjs/crypto/pbkdf2-browser.js.map delete mode 100644 lib.commonjs/crypto/pbkdf2.d.ts delete mode 100644 lib.commonjs/crypto/pbkdf2.d.ts.map delete mode 100644 lib.commonjs/crypto/pbkdf2.js delete mode 100644 lib.commonjs/crypto/pbkdf2.js.map delete mode 100644 lib.commonjs/crypto/random.d.ts delete mode 100644 lib.commonjs/crypto/random.d.ts.map delete mode 100644 lib.commonjs/crypto/random.js delete mode 100644 lib.commonjs/crypto/random.js.map delete mode 100644 lib.commonjs/crypto/ripemd160.d.ts delete mode 100644 lib.commonjs/crypto/ripemd160.d.ts.map delete mode 100644 lib.commonjs/crypto/ripemd160.js delete mode 100644 lib.commonjs/crypto/ripemd160.js.map delete mode 100644 lib.commonjs/crypto/rlp.d.ts delete mode 100644 lib.commonjs/crypto/rlp.d.ts.map delete mode 100644 lib.commonjs/crypto/rlp.js delete mode 100644 lib.commonjs/crypto/rlp.js.map delete mode 100644 lib.commonjs/crypto/scrypt.d.ts delete mode 100644 lib.commonjs/crypto/scrypt.d.ts.map delete mode 100644 lib.commonjs/crypto/scrypt.js delete mode 100644 lib.commonjs/crypto/scrypt.js.map delete mode 100644 lib.commonjs/crypto/sha3.d.ts delete mode 100644 lib.commonjs/crypto/sha3.d.ts.map delete mode 100644 lib.commonjs/crypto/sha3.js delete mode 100644 lib.commonjs/crypto/sha3.js.map delete mode 100644 lib.commonjs/crypto/signature.d.ts delete mode 100644 lib.commonjs/crypto/signature.d.ts.map delete mode 100644 lib.commonjs/crypto/signature.js delete mode 100644 lib.commonjs/crypto/signature.js.map delete mode 100644 lib.commonjs/crypto/signing-key.d.ts delete mode 100644 lib.commonjs/crypto/signing-key.d.ts.map delete mode 100644 lib.commonjs/crypto/signing-key.js delete mode 100644 lib.commonjs/crypto/signing-key.js.map delete mode 100644 lib.commonjs/hash/id.d.ts delete mode 100644 lib.commonjs/hash/id.d.ts.map delete mode 100644 lib.commonjs/hash/id.js delete mode 100644 lib.commonjs/hash/id.js.map delete mode 100644 lib.commonjs/hash/index.d.ts delete mode 100644 lib.commonjs/hash/index.d.ts.map delete mode 100644 lib.commonjs/hash/index.js delete mode 100644 lib.commonjs/hash/index.js.map delete mode 100644 lib.commonjs/hash/message.d.ts delete mode 100644 lib.commonjs/hash/message.d.ts.map delete mode 100644 lib.commonjs/hash/message.js delete mode 100644 lib.commonjs/hash/message.js.map delete mode 100644 lib.commonjs/hash/solidity.d.ts delete mode 100644 lib.commonjs/hash/solidity.d.ts.map delete mode 100644 lib.commonjs/hash/solidity.js delete mode 100644 lib.commonjs/hash/solidity.js.map delete mode 100644 lib.commonjs/hash/typed-data.d.ts delete mode 100644 lib.commonjs/hash/typed-data.d.ts.map delete mode 100644 lib.commonjs/hash/typed-data.js delete mode 100644 lib.commonjs/hash/typed-data.js.map delete mode 100644 lib.commonjs/index.d.ts delete mode 100644 lib.commonjs/index.d.ts.map delete mode 100644 lib.commonjs/index.js delete mode 100644 lib.commonjs/index.js.map delete mode 100644 lib.commonjs/ipfs/index.d.ts delete mode 100644 lib.commonjs/ipfs/index.d.ts.map delete mode 100644 lib.commonjs/ipfs/index.js delete mode 100644 lib.commonjs/ipfs/index.js.map delete mode 100644 lib.commonjs/logger/logger.d.ts delete mode 100644 lib.commonjs/logger/logger.d.ts.map delete mode 100644 lib.commonjs/logger/logger.js delete mode 100644 lib.commonjs/logger/logger.js.map delete mode 100644 lib.commonjs/package.json delete mode 100644 lib.commonjs/providers/abstract-provider.d.ts delete mode 100644 lib.commonjs/providers/abstract-provider.d.ts.map delete mode 100644 lib.commonjs/providers/abstract-provider.js delete mode 100644 lib.commonjs/providers/abstract-provider.js.map delete mode 100644 lib.commonjs/providers/abstract-signer.d.ts delete mode 100644 lib.commonjs/providers/abstract-signer.d.ts.map delete mode 100644 lib.commonjs/providers/abstract-signer.js delete mode 100644 lib.commonjs/providers/abstract-signer.js.map delete mode 100644 lib.commonjs/providers/community.d.ts delete mode 100644 lib.commonjs/providers/community.d.ts.map delete mode 100644 lib.commonjs/providers/community.js delete mode 100644 lib.commonjs/providers/community.js.map delete mode 100644 lib.commonjs/providers/contracts.d.ts delete mode 100644 lib.commonjs/providers/contracts.d.ts.map delete mode 100644 lib.commonjs/providers/contracts.js delete mode 100644 lib.commonjs/providers/contracts.js.map delete mode 100644 lib.commonjs/providers/default-provider.d.ts delete mode 100644 lib.commonjs/providers/default-provider.d.ts.map delete mode 100644 lib.commonjs/providers/default-provider.js delete mode 100644 lib.commonjs/providers/default-provider.js.map delete mode 100644 lib.commonjs/providers/format.d.ts delete mode 100644 lib.commonjs/providers/format.d.ts.map delete mode 100644 lib.commonjs/providers/format.js delete mode 100644 lib.commonjs/providers/format.js.map delete mode 100644 lib.commonjs/providers/formatting.d.ts delete mode 100644 lib.commonjs/providers/formatting.d.ts.map delete mode 100644 lib.commonjs/providers/formatting.js delete mode 100644 lib.commonjs/providers/formatting.js.map delete mode 100644 lib.commonjs/providers/index.d.ts delete mode 100644 lib.commonjs/providers/index.d.ts.map delete mode 100644 lib.commonjs/providers/index.js delete mode 100644 lib.commonjs/providers/index.js.map delete mode 100644 lib.commonjs/providers/network.d.ts delete mode 100644 lib.commonjs/providers/network.d.ts.map delete mode 100644 lib.commonjs/providers/network.js delete mode 100644 lib.commonjs/providers/network.js.map delete mode 100644 lib.commonjs/providers/pagination.d.ts delete mode 100644 lib.commonjs/providers/pagination.d.ts.map delete mode 100644 lib.commonjs/providers/pagination.js delete mode 100644 lib.commonjs/providers/pagination.js.map delete mode 100644 lib.commonjs/providers/plugin-fallback.d.ts delete mode 100644 lib.commonjs/providers/plugin-fallback.d.ts.map delete mode 100644 lib.commonjs/providers/plugin-fallback.js delete mode 100644 lib.commonjs/providers/plugin-fallback.js.map delete mode 100644 lib.commonjs/providers/plugins-network.d.ts delete mode 100644 lib.commonjs/providers/plugins-network.d.ts.map delete mode 100644 lib.commonjs/providers/plugins-network.js delete mode 100644 lib.commonjs/providers/plugins-network.js.map delete mode 100644 lib.commonjs/providers/provider-alchemy.d.ts delete mode 100644 lib.commonjs/providers/provider-alchemy.d.ts.map delete mode 100644 lib.commonjs/providers/provider-alchemy.js delete mode 100644 lib.commonjs/providers/provider-alchemy.js.map delete mode 100644 lib.commonjs/providers/provider-ankr.d.ts delete mode 100644 lib.commonjs/providers/provider-ankr.d.ts.map delete mode 100644 lib.commonjs/providers/provider-ankr.js delete mode 100644 lib.commonjs/providers/provider-ankr.js.map delete mode 100644 lib.commonjs/providers/provider-browser.d.ts delete mode 100644 lib.commonjs/providers/provider-browser.d.ts.map delete mode 100644 lib.commonjs/providers/provider-browser.js delete mode 100644 lib.commonjs/providers/provider-browser.js.map delete mode 100644 lib.commonjs/providers/provider-cloudflare.d.ts delete mode 100644 lib.commonjs/providers/provider-cloudflare.d.ts.map delete mode 100644 lib.commonjs/providers/provider-cloudflare.js delete mode 100644 lib.commonjs/providers/provider-cloudflare.js.map delete mode 100644 lib.commonjs/providers/provider-fallback.d.ts delete mode 100644 lib.commonjs/providers/provider-fallback.d.ts.map delete mode 100644 lib.commonjs/providers/provider-fallback.js delete mode 100644 lib.commonjs/providers/provider-fallback.js.map delete mode 100644 lib.commonjs/providers/provider-infura.d.ts delete mode 100644 lib.commonjs/providers/provider-infura.d.ts.map delete mode 100644 lib.commonjs/providers/provider-infura.js delete mode 100644 lib.commonjs/providers/provider-infura.js.map delete mode 100644 lib.commonjs/providers/provider-ipcsocket-browser.d.ts delete mode 100644 lib.commonjs/providers/provider-ipcsocket-browser.d.ts.map delete mode 100644 lib.commonjs/providers/provider-ipcsocket-browser.js delete mode 100644 lib.commonjs/providers/provider-ipcsocket-browser.js.map delete mode 100644 lib.commonjs/providers/provider-ipcsocket.d.ts delete mode 100644 lib.commonjs/providers/provider-ipcsocket.d.ts.map delete mode 100644 lib.commonjs/providers/provider-ipcsocket.js delete mode 100644 lib.commonjs/providers/provider-ipcsocket.js.map delete mode 100644 lib.commonjs/providers/provider-jsonrpc.d.ts delete mode 100644 lib.commonjs/providers/provider-jsonrpc.d.ts.map delete mode 100644 lib.commonjs/providers/provider-jsonrpc.js delete mode 100644 lib.commonjs/providers/provider-jsonrpc.js.map delete mode 100644 lib.commonjs/providers/provider-pocket.d.ts delete mode 100644 lib.commonjs/providers/provider-pocket.d.ts.map delete mode 100644 lib.commonjs/providers/provider-pocket.js delete mode 100644 lib.commonjs/providers/provider-pocket.js.map delete mode 100644 lib.commonjs/providers/provider-quicknode.d.ts delete mode 100644 lib.commonjs/providers/provider-quicknode.d.ts.map delete mode 100644 lib.commonjs/providers/provider-quicknode.js delete mode 100644 lib.commonjs/providers/provider-quicknode.js.map delete mode 100644 lib.commonjs/providers/provider-socket.d.ts delete mode 100644 lib.commonjs/providers/provider-socket.d.ts.map delete mode 100644 lib.commonjs/providers/provider-socket.js delete mode 100644 lib.commonjs/providers/provider-socket.js.map delete mode 100644 lib.commonjs/providers/provider-websocket.d.ts delete mode 100644 lib.commonjs/providers/provider-websocket.d.ts.map delete mode 100644 lib.commonjs/providers/provider-websocket.js delete mode 100644 lib.commonjs/providers/provider-websocket.js.map delete mode 100644 lib.commonjs/providers/provider.d.ts delete mode 100644 lib.commonjs/providers/provider.d.ts.map delete mode 100644 lib.commonjs/providers/provider.js delete mode 100644 lib.commonjs/providers/provider.js.map delete mode 100644 lib.commonjs/providers/signer-noncemanager.d.ts delete mode 100644 lib.commonjs/providers/signer-noncemanager.d.ts.map delete mode 100644 lib.commonjs/providers/signer-noncemanager.js delete mode 100644 lib.commonjs/providers/signer-noncemanager.js.map delete mode 100644 lib.commonjs/providers/signer.d.ts delete mode 100644 lib.commonjs/providers/signer.d.ts.map delete mode 100644 lib.commonjs/providers/signer.js delete mode 100644 lib.commonjs/providers/signer.js.map delete mode 100644 lib.commonjs/providers/subscriber-connection.d.ts delete mode 100644 lib.commonjs/providers/subscriber-connection.d.ts.map delete mode 100644 lib.commonjs/providers/subscriber-connection.js delete mode 100644 lib.commonjs/providers/subscriber-connection.js.map delete mode 100644 lib.commonjs/providers/subscriber-filterid.d.ts delete mode 100644 lib.commonjs/providers/subscriber-filterid.d.ts.map delete mode 100644 lib.commonjs/providers/subscriber-filterid.js delete mode 100644 lib.commonjs/providers/subscriber-filterid.js.map delete mode 100644 lib.commonjs/providers/subscriber-polling.d.ts delete mode 100644 lib.commonjs/providers/subscriber-polling.d.ts.map delete mode 100644 lib.commonjs/providers/subscriber-polling.js delete mode 100644 lib.commonjs/providers/subscriber-polling.js.map delete mode 100644 lib.commonjs/providers/ws-browser.d.ts delete mode 100644 lib.commonjs/providers/ws-browser.d.ts.map delete mode 100644 lib.commonjs/providers/ws-browser.js delete mode 100644 lib.commonjs/providers/ws-browser.js.map delete mode 100644 lib.commonjs/providers/ws.d.ts delete mode 100644 lib.commonjs/providers/ws.d.ts.map delete mode 100644 lib.commonjs/providers/ws.js delete mode 100644 lib.commonjs/providers/ws.js.map delete mode 100644 lib.commonjs/transaction/accesslist.d.ts delete mode 100644 lib.commonjs/transaction/accesslist.d.ts.map delete mode 100644 lib.commonjs/transaction/accesslist.js delete mode 100644 lib.commonjs/transaction/accesslist.js.map delete mode 100644 lib.commonjs/transaction/address.d.ts delete mode 100644 lib.commonjs/transaction/address.d.ts.map delete mode 100644 lib.commonjs/transaction/address.js delete mode 100644 lib.commonjs/transaction/address.js.map delete mode 100644 lib.commonjs/transaction/index.d.ts delete mode 100644 lib.commonjs/transaction/index.d.ts.map delete mode 100644 lib.commonjs/transaction/index.js delete mode 100644 lib.commonjs/transaction/index.js.map delete mode 100644 lib.commonjs/transaction/transaction.d.ts delete mode 100644 lib.commonjs/transaction/transaction.d.ts.map delete mode 100644 lib.commonjs/transaction/transaction.js delete mode 100644 lib.commonjs/transaction/transaction.js.map delete mode 100644 lib.commonjs/utils/base58.d.ts delete mode 100644 lib.commonjs/utils/base58.d.ts.map delete mode 100644 lib.commonjs/utils/base58.js delete mode 100644 lib.commonjs/utils/base58.js.map delete mode 100644 lib.commonjs/utils/base64-browser.d.ts delete mode 100644 lib.commonjs/utils/base64-browser.d.ts.map delete mode 100644 lib.commonjs/utils/base64-browser.js delete mode 100644 lib.commonjs/utils/base64-browser.js.map delete mode 100644 lib.commonjs/utils/base64.d.ts delete mode 100644 lib.commonjs/utils/base64.d.ts.map delete mode 100644 lib.commonjs/utils/base64.js delete mode 100644 lib.commonjs/utils/base64.js.map delete mode 100644 lib.commonjs/utils/data.d.ts delete mode 100644 lib.commonjs/utils/data.d.ts.map delete mode 100644 lib.commonjs/utils/data.js delete mode 100644 lib.commonjs/utils/data.js.map delete mode 100644 lib.commonjs/utils/errors.d.ts delete mode 100644 lib.commonjs/utils/errors.d.ts.map delete mode 100644 lib.commonjs/utils/errors.js delete mode 100644 lib.commonjs/utils/errors.js.map delete mode 100644 lib.commonjs/utils/events.d.ts delete mode 100644 lib.commonjs/utils/events.d.ts.map delete mode 100644 lib.commonjs/utils/events.js delete mode 100644 lib.commonjs/utils/events.js.map delete mode 100644 lib.commonjs/utils/fetch.d.ts delete mode 100644 lib.commonjs/utils/fetch.d.ts.map delete mode 100644 lib.commonjs/utils/fetch.js delete mode 100644 lib.commonjs/utils/fetch.js.map delete mode 100644 lib.commonjs/utils/fixednumber.d.ts delete mode 100644 lib.commonjs/utils/fixednumber.d.ts.map delete mode 100644 lib.commonjs/utils/fixednumber.js delete mode 100644 lib.commonjs/utils/fixednumber.js.map delete mode 100644 lib.commonjs/utils/geturl-browser.d.ts delete mode 100644 lib.commonjs/utils/geturl-browser.d.ts.map delete mode 100644 lib.commonjs/utils/geturl-browser.js delete mode 100644 lib.commonjs/utils/geturl-browser.js.map delete mode 100644 lib.commonjs/utils/geturl.d.ts delete mode 100644 lib.commonjs/utils/geturl.d.ts.map delete mode 100644 lib.commonjs/utils/geturl.js delete mode 100644 lib.commonjs/utils/geturl.js.map delete mode 100644 lib.commonjs/utils/index.d.ts delete mode 100644 lib.commonjs/utils/index.d.ts.map delete mode 100644 lib.commonjs/utils/index.js delete mode 100644 lib.commonjs/utils/index.js.map delete mode 100644 lib.commonjs/utils/maths.d.ts delete mode 100644 lib.commonjs/utils/maths.d.ts.map delete mode 100644 lib.commonjs/utils/maths.js delete mode 100644 lib.commonjs/utils/maths.js.map delete mode 100644 lib.commonjs/utils/properties.d.ts delete mode 100644 lib.commonjs/utils/properties.d.ts.map delete mode 100644 lib.commonjs/utils/properties.js delete mode 100644 lib.commonjs/utils/properties.js.map delete mode 100644 lib.commonjs/utils/rlp-decode.d.ts delete mode 100644 lib.commonjs/utils/rlp-decode.d.ts.map delete mode 100644 lib.commonjs/utils/rlp-decode.js delete mode 100644 lib.commonjs/utils/rlp-decode.js.map delete mode 100644 lib.commonjs/utils/rlp-encode.d.ts delete mode 100644 lib.commonjs/utils/rlp-encode.d.ts.map delete mode 100644 lib.commonjs/utils/rlp-encode.js delete mode 100644 lib.commonjs/utils/rlp-encode.js.map delete mode 100644 lib.commonjs/utils/rlp.d.ts delete mode 100644 lib.commonjs/utils/rlp.d.ts.map delete mode 100644 lib.commonjs/utils/rlp.js delete mode 100644 lib.commonjs/utils/rlp.js.map delete mode 100644 lib.commonjs/utils/units.d.ts delete mode 100644 lib.commonjs/utils/units.d.ts.map delete mode 100644 lib.commonjs/utils/units.js delete mode 100644 lib.commonjs/utils/units.js.map delete mode 100644 lib.commonjs/utils/utf8.d.ts delete mode 100644 lib.commonjs/utils/utf8.d.ts.map delete mode 100644 lib.commonjs/utils/utf8.js delete mode 100644 lib.commonjs/utils/utf8.js.map delete mode 100644 lib.commonjs/utils/uuid.d.ts delete mode 100644 lib.commonjs/utils/uuid.d.ts.map delete mode 100644 lib.commonjs/utils/uuid.js delete mode 100644 lib.commonjs/utils/uuid.js.map delete mode 100644 lib.commonjs/wallet/base-wallet.d.ts delete mode 100644 lib.commonjs/wallet/base-wallet.d.ts.map delete mode 100644 lib.commonjs/wallet/base-wallet.js delete mode 100644 lib.commonjs/wallet/base-wallet.js.map delete mode 100644 lib.commonjs/wallet/english_words.d.ts delete mode 100644 lib.commonjs/wallet/english_words.d.ts.map delete mode 100644 lib.commonjs/wallet/english_words.js delete mode 100644 lib.commonjs/wallet/english_words.js.map delete mode 100644 lib.commonjs/wallet/hdwallet.d.ts delete mode 100644 lib.commonjs/wallet/hdwallet.d.ts.map delete mode 100644 lib.commonjs/wallet/hdwallet.js delete mode 100644 lib.commonjs/wallet/hdwallet.js.map delete mode 100644 lib.commonjs/wallet/index.d.ts delete mode 100644 lib.commonjs/wallet/index.d.ts.map delete mode 100644 lib.commonjs/wallet/index.js delete mode 100644 lib.commonjs/wallet/index.js.map delete mode 100644 lib.commonjs/wallet/json-crowdsale.d.ts delete mode 100644 lib.commonjs/wallet/json-crowdsale.d.ts.map delete mode 100644 lib.commonjs/wallet/json-crowdsale.js delete mode 100644 lib.commonjs/wallet/json-crowdsale.js.map delete mode 100644 lib.commonjs/wallet/json-keystore.d.ts delete mode 100644 lib.commonjs/wallet/json-keystore.d.ts.map delete mode 100644 lib.commonjs/wallet/json-keystore.js delete mode 100644 lib.commonjs/wallet/json-keystore.js.map delete mode 100644 lib.commonjs/wallet/mnemonic.d.ts delete mode 100644 lib.commonjs/wallet/mnemonic.d.ts.map delete mode 100644 lib.commonjs/wallet/mnemonic.js delete mode 100644 lib.commonjs/wallet/mnemonic.js.map delete mode 100644 lib.commonjs/wallet/mnemonicToSeed.d.ts delete mode 100644 lib.commonjs/wallet/mnemonicToSeed.d.ts.map delete mode 100644 lib.commonjs/wallet/mnemonicToSeed.js delete mode 100644 lib.commonjs/wallet/mnemonicToSeed.js.map delete mode 100644 lib.commonjs/wallet/utils.d.ts delete mode 100644 lib.commonjs/wallet/utils.d.ts.map delete mode 100644 lib.commonjs/wallet/utils.js delete mode 100644 lib.commonjs/wallet/utils.js.map delete mode 100644 lib.commonjs/wallet/wallet.d.ts delete mode 100644 lib.commonjs/wallet/wallet.d.ts.map delete mode 100644 lib.commonjs/wallet/wallet.js delete mode 100644 lib.commonjs/wallet/wallet.js.map delete mode 100644 lib.commonjs/wordlists/bit-reader.d.ts delete mode 100644 lib.commonjs/wordlists/bit-reader.d.ts.map delete mode 100644 lib.commonjs/wordlists/bit-reader.js delete mode 100644 lib.commonjs/wordlists/bit-reader.js.map delete mode 100644 lib.commonjs/wordlists/decode-owl.d.ts delete mode 100644 lib.commonjs/wordlists/decode-owl.d.ts.map delete mode 100644 lib.commonjs/wordlists/decode-owl.js delete mode 100644 lib.commonjs/wordlists/decode-owl.js.map delete mode 100644 lib.commonjs/wordlists/decode-owla.d.ts delete mode 100644 lib.commonjs/wordlists/decode-owla.d.ts.map delete mode 100644 lib.commonjs/wordlists/decode-owla.js delete mode 100644 lib.commonjs/wordlists/decode-owla.js.map delete mode 100644 lib.commonjs/wordlists/enwords.d.ts delete mode 100644 lib.commonjs/wordlists/enwords.d.ts.map delete mode 100644 lib.commonjs/wordlists/enwords.js delete mode 100644 lib.commonjs/wordlists/enwords.js.map delete mode 100644 lib.commonjs/wordlists/generation/encode-latin.d.ts delete mode 100644 lib.commonjs/wordlists/generation/encode-latin.d.ts.map delete mode 100644 lib.commonjs/wordlists/generation/encode-latin.js delete mode 100644 lib.commonjs/wordlists/generation/encode-latin.js.map delete mode 100644 lib.commonjs/wordlists/index.d.ts delete mode 100644 lib.commonjs/wordlists/index.d.ts.map delete mode 100644 lib.commonjs/wordlists/index.js delete mode 100644 lib.commonjs/wordlists/index.js.map delete mode 100644 lib.commonjs/wordlists/lang-cz.d.ts delete mode 100644 lib.commonjs/wordlists/lang-cz.d.ts.map delete mode 100644 lib.commonjs/wordlists/lang-cz.js delete mode 100644 lib.commonjs/wordlists/lang-cz.js.map delete mode 100644 lib.commonjs/wordlists/lang-en.d.ts delete mode 100644 lib.commonjs/wordlists/lang-en.d.ts.map delete mode 100644 lib.commonjs/wordlists/lang-en.js delete mode 100644 lib.commonjs/wordlists/lang-en.js.map delete mode 100644 lib.commonjs/wordlists/lang-es.d.ts delete mode 100644 lib.commonjs/wordlists/lang-es.d.ts.map delete mode 100644 lib.commonjs/wordlists/lang-es.js delete mode 100644 lib.commonjs/wordlists/lang-es.js.map delete mode 100644 lib.commonjs/wordlists/lang-fr.d.ts delete mode 100644 lib.commonjs/wordlists/lang-fr.d.ts.map delete mode 100644 lib.commonjs/wordlists/lang-fr.js delete mode 100644 lib.commonjs/wordlists/lang-fr.js.map delete mode 100644 lib.commonjs/wordlists/lang-it.d.ts delete mode 100644 lib.commonjs/wordlists/lang-it.d.ts.map delete mode 100644 lib.commonjs/wordlists/lang-it.js delete mode 100644 lib.commonjs/wordlists/lang-it.js.map delete mode 100644 lib.commonjs/wordlists/lang-ja.d.ts delete mode 100644 lib.commonjs/wordlists/lang-ja.d.ts.map delete mode 100644 lib.commonjs/wordlists/lang-ja.js delete mode 100644 lib.commonjs/wordlists/lang-ja.js.map delete mode 100644 lib.commonjs/wordlists/lang-ko.d.ts delete mode 100644 lib.commonjs/wordlists/lang-ko.d.ts.map delete mode 100644 lib.commonjs/wordlists/lang-ko.js delete mode 100644 lib.commonjs/wordlists/lang-ko.js.map delete mode 100644 lib.commonjs/wordlists/lang-pt.d.ts delete mode 100644 lib.commonjs/wordlists/lang-pt.d.ts.map delete mode 100644 lib.commonjs/wordlists/lang-pt.js delete mode 100644 lib.commonjs/wordlists/lang-pt.js.map delete mode 100644 lib.commonjs/wordlists/lang-zh.d.ts delete mode 100644 lib.commonjs/wordlists/lang-zh.d.ts.map delete mode 100644 lib.commonjs/wordlists/lang-zh.js delete mode 100644 lib.commonjs/wordlists/lang-zh.js.map delete mode 100644 lib.commonjs/wordlists/wordlist-owl.d.ts delete mode 100644 lib.commonjs/wordlists/wordlist-owl.d.ts.map delete mode 100644 lib.commonjs/wordlists/wordlist-owl.js delete mode 100644 lib.commonjs/wordlists/wordlist-owl.js.map delete mode 100644 lib.commonjs/wordlists/wordlist-owla.d.ts delete mode 100644 lib.commonjs/wordlists/wordlist-owla.d.ts.map delete mode 100644 lib.commonjs/wordlists/wordlist-owla.js delete mode 100644 lib.commonjs/wordlists/wordlist-owla.js.map delete mode 100644 lib.commonjs/wordlists/wordlist.d.ts delete mode 100644 lib.commonjs/wordlists/wordlist.d.ts.map delete mode 100644 lib.commonjs/wordlists/wordlist.js delete mode 100644 lib.commonjs/wordlists/wordlist.js.map delete mode 100644 lib.commonjs/wordlists/wordlists-browser.d.ts delete mode 100644 lib.commonjs/wordlists/wordlists-browser.d.ts.map delete mode 100644 lib.commonjs/wordlists/wordlists-browser.js delete mode 100644 lib.commonjs/wordlists/wordlists-browser.js.map delete mode 100644 lib.commonjs/wordlists/wordlists-extra.d.ts delete mode 100644 lib.commonjs/wordlists/wordlists-extra.d.ts.map delete mode 100644 lib.commonjs/wordlists/wordlists-extra.js delete mode 100644 lib.commonjs/wordlists/wordlists-extra.js.map delete mode 100644 lib.commonjs/wordlists/wordlists.d.ts delete mode 100644 lib.commonjs/wordlists/wordlists.d.ts.map delete mode 100644 lib.commonjs/wordlists/wordlists.js delete mode 100644 lib.commonjs/wordlists/wordlists.js.map delete mode 100644 lib.esm/README.md delete mode 100644 lib.esm/_tests/blockchain-data.d.ts delete mode 100644 lib.esm/_tests/blockchain-data.d.ts.map delete mode 100644 lib.esm/_tests/blockchain-data.js delete mode 100644 lib.esm/_tests/blockchain-data.js.map delete mode 100644 lib.esm/_tests/create-provider.d.ts delete mode 100644 lib.esm/_tests/create-provider.d.ts.map delete mode 100644 lib.esm/_tests/create-provider.js delete mode 100644 lib.esm/_tests/create-provider.js.map delete mode 100644 lib.esm/_tests/test-cip.d.ts delete mode 100644 lib.esm/_tests/test-cip.d.ts.map delete mode 100644 lib.esm/_tests/test-cip.js delete mode 100644 lib.esm/_tests/test-cip.js.map delete mode 100644 lib.esm/_tests/test-contract.d.ts delete mode 100644 lib.esm/_tests/test-contract.d.ts.map delete mode 100644 lib.esm/_tests/test-contract.js delete mode 100644 lib.esm/_tests/test-contract.js.map delete mode 100644 lib.esm/_tests/test-crypto.d.ts delete mode 100644 lib.esm/_tests/test-crypto.d.ts.map delete mode 100644 lib.esm/_tests/test-crypto.js delete mode 100644 lib.esm/_tests/test-crypto.js.map delete mode 100644 lib.esm/_tests/test-keystore.d.ts delete mode 100644 lib.esm/_tests/test-keystore.d.ts.map delete mode 100644 lib.esm/_tests/test-keystore.js delete mode 100644 lib.esm/_tests/test-keystore.js.map delete mode 100644 lib.esm/_tests/types.d.ts delete mode 100644 lib.esm/_tests/types.d.ts.map delete mode 100644 lib.esm/_tests/types.js delete mode 100644 lib.esm/_tests/types.js.map delete mode 100644 lib.esm/_version.d.ts delete mode 100644 lib.esm/_version.d.ts.map delete mode 100644 lib.esm/_version.js delete mode 100644 lib.esm/_version.js.map delete mode 100644 lib.esm/abi-types/Tes.d.ts delete mode 100644 lib.esm/abi-types/Tes.d.ts.map delete mode 100644 lib.esm/abi-types/Tes.js delete mode 100644 lib.esm/abi-types/Tes.js.map delete mode 100644 lib.esm/abi-types/Tes_abi.d.ts delete mode 100644 lib.esm/abi-types/Tes_abi.d.ts.map delete mode 100644 lib.esm/abi-types/Tes_abi.js delete mode 100644 lib.esm/abi-types/Tes_abi.js.map delete mode 100644 lib.esm/abi-types/common.d.ts delete mode 100644 lib.esm/abi-types/common.d.ts.map delete mode 100644 lib.esm/abi-types/common.js delete mode 100644 lib.esm/abi-types/common.js.map delete mode 100644 lib.esm/abi-types/factories/Tes__factory.d.ts delete mode 100644 lib.esm/abi-types/factories/Tes__factory.d.ts.map delete mode 100644 lib.esm/abi-types/factories/Tes__factory.js delete mode 100644 lib.esm/abi-types/factories/Tes__factory.js.map delete mode 100644 lib.esm/abi-types/factories/Tes_abi__factory.d.ts delete mode 100644 lib.esm/abi-types/factories/Tes_abi__factory.d.ts.map delete mode 100644 lib.esm/abi-types/factories/Tes_abi__factory.js delete mode 100644 lib.esm/abi-types/factories/Tes_abi__factory.js.map delete mode 100644 lib.esm/abi-types/factories/index.d.ts delete mode 100644 lib.esm/abi-types/factories/index.d.ts.map delete mode 100644 lib.esm/abi-types/factories/index.js delete mode 100644 lib.esm/abi-types/factories/index.js.map delete mode 100644 lib.esm/abi-types/index.d.ts delete mode 100644 lib.esm/abi-types/index.d.ts.map delete mode 100644 lib.esm/abi-types/index.js delete mode 100644 lib.esm/abi-types/index.js.map delete mode 100644 lib.esm/abi/abi-coder.d.ts delete mode 100644 lib.esm/abi/abi-coder.d.ts.map delete mode 100644 lib.esm/abi/abi-coder.js delete mode 100644 lib.esm/abi/abi-coder.js.map delete mode 100644 lib.esm/abi/bytes32.d.ts delete mode 100644 lib.esm/abi/bytes32.d.ts.map delete mode 100644 lib.esm/abi/bytes32.js delete mode 100644 lib.esm/abi/bytes32.js.map delete mode 100644 lib.esm/abi/coders/abstract-coder.d.ts delete mode 100644 lib.esm/abi/coders/abstract-coder.d.ts.map delete mode 100644 lib.esm/abi/coders/abstract-coder.js delete mode 100644 lib.esm/abi/coders/abstract-coder.js.map delete mode 100644 lib.esm/abi/coders/address.d.ts delete mode 100644 lib.esm/abi/coders/address.d.ts.map delete mode 100644 lib.esm/abi/coders/address.js delete mode 100644 lib.esm/abi/coders/address.js.map delete mode 100644 lib.esm/abi/coders/anonymous.d.ts delete mode 100644 lib.esm/abi/coders/anonymous.d.ts.map delete mode 100644 lib.esm/abi/coders/anonymous.js delete mode 100644 lib.esm/abi/coders/anonymous.js.map delete mode 100644 lib.esm/abi/coders/array.d.ts delete mode 100644 lib.esm/abi/coders/array.d.ts.map delete mode 100644 lib.esm/abi/coders/array.js delete mode 100644 lib.esm/abi/coders/array.js.map delete mode 100644 lib.esm/abi/coders/boolean.d.ts delete mode 100644 lib.esm/abi/coders/boolean.d.ts.map delete mode 100644 lib.esm/abi/coders/boolean.js delete mode 100644 lib.esm/abi/coders/boolean.js.map delete mode 100644 lib.esm/abi/coders/bytes.d.ts delete mode 100644 lib.esm/abi/coders/bytes.d.ts.map delete mode 100644 lib.esm/abi/coders/bytes.js delete mode 100644 lib.esm/abi/coders/bytes.js.map delete mode 100644 lib.esm/abi/coders/fixed-bytes.d.ts delete mode 100644 lib.esm/abi/coders/fixed-bytes.d.ts.map delete mode 100644 lib.esm/abi/coders/fixed-bytes.js delete mode 100644 lib.esm/abi/coders/fixed-bytes.js.map delete mode 100644 lib.esm/abi/coders/null.d.ts delete mode 100644 lib.esm/abi/coders/null.d.ts.map delete mode 100644 lib.esm/abi/coders/null.js delete mode 100644 lib.esm/abi/coders/null.js.map delete mode 100644 lib.esm/abi/coders/number.d.ts delete mode 100644 lib.esm/abi/coders/number.d.ts.map delete mode 100644 lib.esm/abi/coders/number.js delete mode 100644 lib.esm/abi/coders/number.js.map delete mode 100644 lib.esm/abi/coders/string.d.ts delete mode 100644 lib.esm/abi/coders/string.d.ts.map delete mode 100644 lib.esm/abi/coders/string.js delete mode 100644 lib.esm/abi/coders/string.js.map delete mode 100644 lib.esm/abi/coders/tuple.d.ts delete mode 100644 lib.esm/abi/coders/tuple.d.ts.map delete mode 100644 lib.esm/abi/coders/tuple.js delete mode 100644 lib.esm/abi/coders/tuple.js.map delete mode 100644 lib.esm/abi/fragments.d.ts delete mode 100644 lib.esm/abi/fragments.d.ts.map delete mode 100644 lib.esm/abi/fragments.js delete mode 100644 lib.esm/abi/fragments.js.map delete mode 100644 lib.esm/abi/index.d.ts delete mode 100644 lib.esm/abi/index.d.ts.map delete mode 100644 lib.esm/abi/index.js delete mode 100644 lib.esm/abi/index.js.map delete mode 100644 lib.esm/abi/interface.d.ts delete mode 100644 lib.esm/abi/interface.d.ts.map delete mode 100644 lib.esm/abi/interface.js delete mode 100644 lib.esm/abi/interface.js.map delete mode 100644 lib.esm/abi/typed.d.ts delete mode 100644 lib.esm/abi/typed.d.ts.map delete mode 100644 lib.esm/abi/typed.js delete mode 100644 lib.esm/abi/typed.js.map delete mode 100644 lib.esm/address/checks.d.ts delete mode 100644 lib.esm/address/checks.d.ts.map delete mode 100644 lib.esm/address/checks.js delete mode 100644 lib.esm/address/checks.js.map delete mode 100644 lib.esm/address/contract-address.d.ts delete mode 100644 lib.esm/address/contract-address.d.ts.map delete mode 100644 lib.esm/address/contract-address.js delete mode 100644 lib.esm/address/contract-address.js.map delete mode 100644 lib.esm/address/index.d.ts delete mode 100644 lib.esm/address/index.d.ts.map delete mode 100644 lib.esm/address/index.js delete mode 100644 lib.esm/address/index.js.map delete mode 100644 lib.esm/bigNumber/bigNumber.d.ts delete mode 100644 lib.esm/bigNumber/bigNumber.d.ts.map delete mode 100644 lib.esm/bigNumber/bigNumber.js delete mode 100644 lib.esm/bigNumber/bigNumber.js.map delete mode 100644 lib.esm/cip/custom-units.d.ts delete mode 100644 lib.esm/cip/custom-units.d.ts.map delete mode 100644 lib.esm/cip/custom-units.js delete mode 100644 lib.esm/cip/custom-units.js.map delete mode 100644 lib.esm/cip/index.d.ts delete mode 100644 lib.esm/cip/index.d.ts.map delete mode 100644 lib.esm/cip/index.js delete mode 100644 lib.esm/cip/index.js.map delete mode 100644 lib.esm/constants/addresses.d.ts delete mode 100644 lib.esm/constants/addresses.d.ts.map delete mode 100644 lib.esm/constants/addresses.js delete mode 100644 lib.esm/constants/addresses.js.map delete mode 100644 lib.esm/constants/hashes.d.ts delete mode 100644 lib.esm/constants/hashes.d.ts.map delete mode 100644 lib.esm/constants/hashes.js delete mode 100644 lib.esm/constants/hashes.js.map delete mode 100644 lib.esm/constants/index.d.ts delete mode 100644 lib.esm/constants/index.d.ts.map delete mode 100644 lib.esm/constants/index.js delete mode 100644 lib.esm/constants/index.js.map delete mode 100644 lib.esm/constants/numbers.d.ts delete mode 100644 lib.esm/constants/numbers.d.ts.map delete mode 100644 lib.esm/constants/numbers.js delete mode 100644 lib.esm/constants/numbers.js.map delete mode 100644 lib.esm/constants/strings.d.ts delete mode 100644 lib.esm/constants/strings.d.ts.map delete mode 100644 lib.esm/constants/strings.js delete mode 100644 lib.esm/constants/strings.js.map delete mode 100644 lib.esm/contract/contract.d.ts delete mode 100644 lib.esm/contract/contract.d.ts.map delete mode 100644 lib.esm/contract/contract.js delete mode 100644 lib.esm/contract/contract.js.map delete mode 100644 lib.esm/contract/factory.d.ts delete mode 100644 lib.esm/contract/factory.d.ts.map delete mode 100644 lib.esm/contract/factory.js delete mode 100644 lib.esm/contract/factory.js.map delete mode 100644 lib.esm/contract/index.d.ts delete mode 100644 lib.esm/contract/index.d.ts.map delete mode 100644 lib.esm/contract/index.js delete mode 100644 lib.esm/contract/index.js.map delete mode 100644 lib.esm/contract/types.d.ts delete mode 100644 lib.esm/contract/types.d.ts.map delete mode 100644 lib.esm/contract/types.js delete mode 100644 lib.esm/contract/types.js.map delete mode 100644 lib.esm/contract/wrappers.d.ts delete mode 100644 lib.esm/contract/wrappers.d.ts.map delete mode 100644 lib.esm/contract/wrappers.js delete mode 100644 lib.esm/contract/wrappers.js.map delete mode 100644 lib.esm/corebc.d.ts delete mode 100644 lib.esm/corebc.d.ts.map delete mode 100644 lib.esm/corebc.js delete mode 100644 lib.esm/corebc.js.map delete mode 100644 lib.esm/crypto/browser-ed448.d.ts delete mode 100644 lib.esm/crypto/browser-ed448.d.ts.map delete mode 100644 lib.esm/crypto/browser-ed448.js delete mode 100644 lib.esm/crypto/browser-ed448.js.map delete mode 100644 lib.esm/crypto/browser-sha3.d.ts delete mode 100644 lib.esm/crypto/browser-sha3.d.ts.map delete mode 100644 lib.esm/crypto/browser-sha3.js delete mode 100644 lib.esm/crypto/browser-sha3.js.map delete mode 100644 lib.esm/crypto/crypto-browser.d.ts delete mode 100644 lib.esm/crypto/crypto-browser.d.ts.map delete mode 100644 lib.esm/crypto/crypto-browser.js delete mode 100644 lib.esm/crypto/crypto-browser.js.map delete mode 100644 lib.esm/crypto/crypto.d.ts delete mode 100644 lib.esm/crypto/crypto.d.ts.map delete mode 100644 lib.esm/crypto/crypto.js delete mode 100644 lib.esm/crypto/crypto.js.map delete mode 100644 lib.esm/crypto/ed448-types.d.ts delete mode 100644 lib.esm/crypto/ed448-types.d.ts.map delete mode 100644 lib.esm/crypto/ed448-types.js delete mode 100644 lib.esm/crypto/ed448-types.js.map delete mode 100644 lib.esm/crypto/ed448.d.ts delete mode 100644 lib.esm/crypto/ed448.d.ts.map delete mode 100644 lib.esm/crypto/ed448.js delete mode 100644 lib.esm/crypto/ed448.js.map delete mode 100644 lib.esm/crypto/ed448goldilock-browser.d.ts delete mode 100644 lib.esm/crypto/ed448goldilock-browser.d.ts.map delete mode 100644 lib.esm/crypto/ed448goldilock-browser.js delete mode 100644 lib.esm/crypto/ed448goldilock-browser.js.map delete mode 100644 lib.esm/crypto/ed448goldilock.d.ts delete mode 100644 lib.esm/crypto/ed448goldilock.d.ts.map delete mode 100644 lib.esm/crypto/ed448goldilock.js delete mode 100644 lib.esm/crypto/ed448goldilock.js.map delete mode 100644 lib.esm/crypto/hmac.d.ts delete mode 100644 lib.esm/crypto/hmac.d.ts.map delete mode 100644 lib.esm/crypto/hmac.js delete mode 100644 lib.esm/crypto/hmac.js.map delete mode 100644 lib.esm/crypto/index.d.ts delete mode 100644 lib.esm/crypto/index.d.ts.map delete mode 100644 lib.esm/crypto/index.js delete mode 100644 lib.esm/crypto/index.js.map delete mode 100644 lib.esm/crypto/keccak.d.ts delete mode 100644 lib.esm/crypto/keccak.d.ts.map delete mode 100644 lib.esm/crypto/keccak.js delete mode 100644 lib.esm/crypto/keccak.js.map delete mode 100644 lib.esm/crypto/pbkdf2-browser.d.ts delete mode 100644 lib.esm/crypto/pbkdf2-browser.d.ts.map delete mode 100644 lib.esm/crypto/pbkdf2-browser.js delete mode 100644 lib.esm/crypto/pbkdf2-browser.js.map delete mode 100644 lib.esm/crypto/pbkdf2.d.ts delete mode 100644 lib.esm/crypto/pbkdf2.d.ts.map delete mode 100644 lib.esm/crypto/pbkdf2.js delete mode 100644 lib.esm/crypto/pbkdf2.js.map delete mode 100644 lib.esm/crypto/random.d.ts delete mode 100644 lib.esm/crypto/random.d.ts.map delete mode 100644 lib.esm/crypto/random.js delete mode 100644 lib.esm/crypto/random.js.map delete mode 100644 lib.esm/crypto/ripemd160.d.ts delete mode 100644 lib.esm/crypto/ripemd160.d.ts.map delete mode 100644 lib.esm/crypto/ripemd160.js delete mode 100644 lib.esm/crypto/ripemd160.js.map delete mode 100644 lib.esm/crypto/rlp.d.ts delete mode 100644 lib.esm/crypto/rlp.d.ts.map delete mode 100644 lib.esm/crypto/rlp.js delete mode 100644 lib.esm/crypto/rlp.js.map delete mode 100644 lib.esm/crypto/scrypt.d.ts delete mode 100644 lib.esm/crypto/scrypt.d.ts.map delete mode 100644 lib.esm/crypto/scrypt.js delete mode 100644 lib.esm/crypto/scrypt.js.map delete mode 100644 lib.esm/crypto/sha3.d.ts delete mode 100644 lib.esm/crypto/sha3.d.ts.map delete mode 100644 lib.esm/crypto/sha3.js delete mode 100644 lib.esm/crypto/sha3.js.map delete mode 100644 lib.esm/crypto/signature.d.ts delete mode 100644 lib.esm/crypto/signature.d.ts.map delete mode 100644 lib.esm/crypto/signature.js delete mode 100644 lib.esm/crypto/signature.js.map delete mode 100644 lib.esm/crypto/signing-key.d.ts delete mode 100644 lib.esm/crypto/signing-key.d.ts.map delete mode 100644 lib.esm/crypto/signing-key.js delete mode 100644 lib.esm/crypto/signing-key.js.map delete mode 100644 lib.esm/hash/id.d.ts delete mode 100644 lib.esm/hash/id.d.ts.map delete mode 100644 lib.esm/hash/id.js delete mode 100644 lib.esm/hash/id.js.map delete mode 100644 lib.esm/hash/index.d.ts delete mode 100644 lib.esm/hash/index.d.ts.map delete mode 100644 lib.esm/hash/index.js delete mode 100644 lib.esm/hash/index.js.map delete mode 100644 lib.esm/hash/message.d.ts delete mode 100644 lib.esm/hash/message.d.ts.map delete mode 100644 lib.esm/hash/message.js delete mode 100644 lib.esm/hash/message.js.map delete mode 100644 lib.esm/hash/solidity.d.ts delete mode 100644 lib.esm/hash/solidity.d.ts.map delete mode 100644 lib.esm/hash/solidity.js delete mode 100644 lib.esm/hash/solidity.js.map delete mode 100644 lib.esm/hash/typed-data.d.ts delete mode 100644 lib.esm/hash/typed-data.d.ts.map delete mode 100644 lib.esm/hash/typed-data.js delete mode 100644 lib.esm/hash/typed-data.js.map delete mode 100644 lib.esm/index.d.ts delete mode 100644 lib.esm/index.d.ts.map delete mode 100644 lib.esm/index.js delete mode 100644 lib.esm/index.js.map delete mode 100644 lib.esm/ipfs/index.d.ts delete mode 100644 lib.esm/ipfs/index.d.ts.map delete mode 100644 lib.esm/ipfs/index.js delete mode 100644 lib.esm/ipfs/index.js.map delete mode 100644 lib.esm/logger/logger.d.ts delete mode 100644 lib.esm/logger/logger.d.ts.map delete mode 100644 lib.esm/logger/logger.js delete mode 100644 lib.esm/logger/logger.js.map delete mode 100644 lib.esm/package.json delete mode 100644 lib.esm/providers/abstract-provider.d.ts delete mode 100644 lib.esm/providers/abstract-provider.d.ts.map delete mode 100644 lib.esm/providers/abstract-provider.js delete mode 100644 lib.esm/providers/abstract-provider.js.map delete mode 100644 lib.esm/providers/abstract-signer.d.ts delete mode 100644 lib.esm/providers/abstract-signer.d.ts.map delete mode 100644 lib.esm/providers/abstract-signer.js delete mode 100644 lib.esm/providers/abstract-signer.js.map delete mode 100644 lib.esm/providers/community.d.ts delete mode 100644 lib.esm/providers/community.d.ts.map delete mode 100644 lib.esm/providers/community.js delete mode 100644 lib.esm/providers/community.js.map delete mode 100644 lib.esm/providers/contracts.d.ts delete mode 100644 lib.esm/providers/contracts.d.ts.map delete mode 100644 lib.esm/providers/contracts.js delete mode 100644 lib.esm/providers/contracts.js.map delete mode 100644 lib.esm/providers/default-provider.d.ts delete mode 100644 lib.esm/providers/default-provider.d.ts.map delete mode 100644 lib.esm/providers/default-provider.js delete mode 100644 lib.esm/providers/default-provider.js.map delete mode 100644 lib.esm/providers/format.d.ts delete mode 100644 lib.esm/providers/format.d.ts.map delete mode 100644 lib.esm/providers/format.js delete mode 100644 lib.esm/providers/format.js.map delete mode 100644 lib.esm/providers/formatting.d.ts delete mode 100644 lib.esm/providers/formatting.d.ts.map delete mode 100644 lib.esm/providers/formatting.js delete mode 100644 lib.esm/providers/formatting.js.map delete mode 100644 lib.esm/providers/index.d.ts delete mode 100644 lib.esm/providers/index.d.ts.map delete mode 100644 lib.esm/providers/index.js delete mode 100644 lib.esm/providers/index.js.map delete mode 100644 lib.esm/providers/network.d.ts delete mode 100644 lib.esm/providers/network.d.ts.map delete mode 100644 lib.esm/providers/network.js delete mode 100644 lib.esm/providers/network.js.map delete mode 100644 lib.esm/providers/pagination.d.ts delete mode 100644 lib.esm/providers/pagination.d.ts.map delete mode 100644 lib.esm/providers/pagination.js delete mode 100644 lib.esm/providers/pagination.js.map delete mode 100644 lib.esm/providers/plugin-fallback.d.ts delete mode 100644 lib.esm/providers/plugin-fallback.d.ts.map delete mode 100644 lib.esm/providers/plugin-fallback.js delete mode 100644 lib.esm/providers/plugin-fallback.js.map delete mode 100644 lib.esm/providers/plugins-network.d.ts delete mode 100644 lib.esm/providers/plugins-network.d.ts.map delete mode 100644 lib.esm/providers/plugins-network.js delete mode 100644 lib.esm/providers/plugins-network.js.map delete mode 100644 lib.esm/providers/provider-alchemy.d.ts delete mode 100644 lib.esm/providers/provider-alchemy.d.ts.map delete mode 100644 lib.esm/providers/provider-alchemy.js delete mode 100644 lib.esm/providers/provider-alchemy.js.map delete mode 100644 lib.esm/providers/provider-ankr.d.ts delete mode 100644 lib.esm/providers/provider-ankr.d.ts.map delete mode 100644 lib.esm/providers/provider-ankr.js delete mode 100644 lib.esm/providers/provider-ankr.js.map delete mode 100644 lib.esm/providers/provider-browser.d.ts delete mode 100644 lib.esm/providers/provider-browser.d.ts.map delete mode 100644 lib.esm/providers/provider-browser.js delete mode 100644 lib.esm/providers/provider-browser.js.map delete mode 100644 lib.esm/providers/provider-cloudflare.d.ts delete mode 100644 lib.esm/providers/provider-cloudflare.d.ts.map delete mode 100644 lib.esm/providers/provider-cloudflare.js delete mode 100644 lib.esm/providers/provider-cloudflare.js.map delete mode 100644 lib.esm/providers/provider-fallback.d.ts delete mode 100644 lib.esm/providers/provider-fallback.d.ts.map delete mode 100644 lib.esm/providers/provider-fallback.js delete mode 100644 lib.esm/providers/provider-fallback.js.map delete mode 100644 lib.esm/providers/provider-infura.d.ts delete mode 100644 lib.esm/providers/provider-infura.d.ts.map delete mode 100644 lib.esm/providers/provider-infura.js delete mode 100644 lib.esm/providers/provider-infura.js.map delete mode 100644 lib.esm/providers/provider-ipcsocket-browser.d.ts delete mode 100644 lib.esm/providers/provider-ipcsocket-browser.d.ts.map delete mode 100644 lib.esm/providers/provider-ipcsocket-browser.js delete mode 100644 lib.esm/providers/provider-ipcsocket-browser.js.map delete mode 100644 lib.esm/providers/provider-ipcsocket.d.ts delete mode 100644 lib.esm/providers/provider-ipcsocket.d.ts.map delete mode 100644 lib.esm/providers/provider-ipcsocket.js delete mode 100644 lib.esm/providers/provider-ipcsocket.js.map delete mode 100644 lib.esm/providers/provider-jsonrpc.d.ts delete mode 100644 lib.esm/providers/provider-jsonrpc.d.ts.map delete mode 100644 lib.esm/providers/provider-jsonrpc.js delete mode 100644 lib.esm/providers/provider-jsonrpc.js.map delete mode 100644 lib.esm/providers/provider-pocket.d.ts delete mode 100644 lib.esm/providers/provider-pocket.d.ts.map delete mode 100644 lib.esm/providers/provider-pocket.js delete mode 100644 lib.esm/providers/provider-pocket.js.map delete mode 100644 lib.esm/providers/provider-quicknode.d.ts delete mode 100644 lib.esm/providers/provider-quicknode.d.ts.map delete mode 100644 lib.esm/providers/provider-quicknode.js delete mode 100644 lib.esm/providers/provider-quicknode.js.map delete mode 100644 lib.esm/providers/provider-socket.d.ts delete mode 100644 lib.esm/providers/provider-socket.d.ts.map delete mode 100644 lib.esm/providers/provider-socket.js delete mode 100644 lib.esm/providers/provider-socket.js.map delete mode 100644 lib.esm/providers/provider-websocket.d.ts delete mode 100644 lib.esm/providers/provider-websocket.d.ts.map delete mode 100644 lib.esm/providers/provider-websocket.js delete mode 100644 lib.esm/providers/provider-websocket.js.map delete mode 100644 lib.esm/providers/provider.d.ts delete mode 100644 lib.esm/providers/provider.d.ts.map delete mode 100644 lib.esm/providers/provider.js delete mode 100644 lib.esm/providers/provider.js.map delete mode 100644 lib.esm/providers/signer-noncemanager.d.ts delete mode 100644 lib.esm/providers/signer-noncemanager.d.ts.map delete mode 100644 lib.esm/providers/signer-noncemanager.js delete mode 100644 lib.esm/providers/signer-noncemanager.js.map delete mode 100644 lib.esm/providers/signer.d.ts delete mode 100644 lib.esm/providers/signer.d.ts.map delete mode 100644 lib.esm/providers/signer.js delete mode 100644 lib.esm/providers/signer.js.map delete mode 100644 lib.esm/providers/subscriber-connection.d.ts delete mode 100644 lib.esm/providers/subscriber-connection.d.ts.map delete mode 100644 lib.esm/providers/subscriber-connection.js delete mode 100644 lib.esm/providers/subscriber-connection.js.map delete mode 100644 lib.esm/providers/subscriber-filterid.d.ts delete mode 100644 lib.esm/providers/subscriber-filterid.d.ts.map delete mode 100644 lib.esm/providers/subscriber-filterid.js delete mode 100644 lib.esm/providers/subscriber-filterid.js.map delete mode 100644 lib.esm/providers/subscriber-polling.d.ts delete mode 100644 lib.esm/providers/subscriber-polling.d.ts.map delete mode 100644 lib.esm/providers/subscriber-polling.js delete mode 100644 lib.esm/providers/subscriber-polling.js.map delete mode 100644 lib.esm/providers/ws-browser.d.ts delete mode 100644 lib.esm/providers/ws-browser.d.ts.map delete mode 100644 lib.esm/providers/ws-browser.js delete mode 100644 lib.esm/providers/ws-browser.js.map delete mode 100644 lib.esm/providers/ws.d.ts delete mode 100644 lib.esm/providers/ws.d.ts.map delete mode 100644 lib.esm/providers/ws.js delete mode 100644 lib.esm/providers/ws.js.map delete mode 100644 lib.esm/transaction/accesslist.d.ts delete mode 100644 lib.esm/transaction/accesslist.d.ts.map delete mode 100644 lib.esm/transaction/accesslist.js delete mode 100644 lib.esm/transaction/accesslist.js.map delete mode 100644 lib.esm/transaction/address.d.ts delete mode 100644 lib.esm/transaction/address.d.ts.map delete mode 100644 lib.esm/transaction/address.js delete mode 100644 lib.esm/transaction/address.js.map delete mode 100644 lib.esm/transaction/index.d.ts delete mode 100644 lib.esm/transaction/index.d.ts.map delete mode 100644 lib.esm/transaction/index.js delete mode 100644 lib.esm/transaction/index.js.map delete mode 100644 lib.esm/transaction/transaction.d.ts delete mode 100644 lib.esm/transaction/transaction.d.ts.map delete mode 100644 lib.esm/transaction/transaction.js delete mode 100644 lib.esm/transaction/transaction.js.map delete mode 100644 lib.esm/utils/base58.d.ts delete mode 100644 lib.esm/utils/base58.d.ts.map delete mode 100644 lib.esm/utils/base58.js delete mode 100644 lib.esm/utils/base58.js.map delete mode 100644 lib.esm/utils/base64-browser.d.ts delete mode 100644 lib.esm/utils/base64-browser.d.ts.map delete mode 100644 lib.esm/utils/base64-browser.js delete mode 100644 lib.esm/utils/base64-browser.js.map delete mode 100644 lib.esm/utils/base64.d.ts delete mode 100644 lib.esm/utils/base64.d.ts.map delete mode 100644 lib.esm/utils/base64.js delete mode 100644 lib.esm/utils/base64.js.map delete mode 100644 lib.esm/utils/data.d.ts delete mode 100644 lib.esm/utils/data.d.ts.map delete mode 100644 lib.esm/utils/data.js delete mode 100644 lib.esm/utils/data.js.map delete mode 100644 lib.esm/utils/errors.d.ts delete mode 100644 lib.esm/utils/errors.d.ts.map delete mode 100644 lib.esm/utils/errors.js delete mode 100644 lib.esm/utils/errors.js.map delete mode 100644 lib.esm/utils/events.d.ts delete mode 100644 lib.esm/utils/events.d.ts.map delete mode 100644 lib.esm/utils/events.js delete mode 100644 lib.esm/utils/events.js.map delete mode 100644 lib.esm/utils/fetch.d.ts delete mode 100644 lib.esm/utils/fetch.d.ts.map delete mode 100644 lib.esm/utils/fetch.js delete mode 100644 lib.esm/utils/fetch.js.map delete mode 100644 lib.esm/utils/fixednumber.d.ts delete mode 100644 lib.esm/utils/fixednumber.d.ts.map delete mode 100644 lib.esm/utils/fixednumber.js delete mode 100644 lib.esm/utils/fixednumber.js.map delete mode 100644 lib.esm/utils/geturl-browser.d.ts delete mode 100644 lib.esm/utils/geturl-browser.d.ts.map delete mode 100644 lib.esm/utils/geturl-browser.js delete mode 100644 lib.esm/utils/geturl-browser.js.map delete mode 100644 lib.esm/utils/geturl.d.ts delete mode 100644 lib.esm/utils/geturl.d.ts.map delete mode 100644 lib.esm/utils/geturl.js delete mode 100644 lib.esm/utils/geturl.js.map delete mode 100644 lib.esm/utils/index.d.ts delete mode 100644 lib.esm/utils/index.d.ts.map delete mode 100644 lib.esm/utils/index.js delete mode 100644 lib.esm/utils/index.js.map delete mode 100644 lib.esm/utils/maths.d.ts delete mode 100644 lib.esm/utils/maths.d.ts.map delete mode 100644 lib.esm/utils/maths.js delete mode 100644 lib.esm/utils/maths.js.map delete mode 100644 lib.esm/utils/properties.d.ts delete mode 100644 lib.esm/utils/properties.d.ts.map delete mode 100644 lib.esm/utils/properties.js delete mode 100644 lib.esm/utils/properties.js.map delete mode 100644 lib.esm/utils/rlp-decode.d.ts delete mode 100644 lib.esm/utils/rlp-decode.d.ts.map delete mode 100644 lib.esm/utils/rlp-decode.js delete mode 100644 lib.esm/utils/rlp-decode.js.map delete mode 100644 lib.esm/utils/rlp-encode.d.ts delete mode 100644 lib.esm/utils/rlp-encode.d.ts.map delete mode 100644 lib.esm/utils/rlp-encode.js delete mode 100644 lib.esm/utils/rlp-encode.js.map delete mode 100644 lib.esm/utils/rlp.d.ts delete mode 100644 lib.esm/utils/rlp.d.ts.map delete mode 100644 lib.esm/utils/rlp.js delete mode 100644 lib.esm/utils/rlp.js.map delete mode 100644 lib.esm/utils/units.d.ts delete mode 100644 lib.esm/utils/units.d.ts.map delete mode 100644 lib.esm/utils/units.js delete mode 100644 lib.esm/utils/units.js.map delete mode 100644 lib.esm/utils/utf8.d.ts delete mode 100644 lib.esm/utils/utf8.d.ts.map delete mode 100644 lib.esm/utils/utf8.js delete mode 100644 lib.esm/utils/utf8.js.map delete mode 100644 lib.esm/utils/uuid.d.ts delete mode 100644 lib.esm/utils/uuid.d.ts.map delete mode 100644 lib.esm/utils/uuid.js delete mode 100644 lib.esm/utils/uuid.js.map delete mode 100644 lib.esm/wallet/base-wallet.d.ts delete mode 100644 lib.esm/wallet/base-wallet.d.ts.map delete mode 100644 lib.esm/wallet/base-wallet.js delete mode 100644 lib.esm/wallet/base-wallet.js.map delete mode 100644 lib.esm/wallet/english_words.d.ts delete mode 100644 lib.esm/wallet/english_words.d.ts.map delete mode 100644 lib.esm/wallet/english_words.js delete mode 100644 lib.esm/wallet/english_words.js.map delete mode 100644 lib.esm/wallet/hdwallet.d.ts delete mode 100644 lib.esm/wallet/hdwallet.d.ts.map delete mode 100644 lib.esm/wallet/hdwallet.js delete mode 100644 lib.esm/wallet/hdwallet.js.map delete mode 100644 lib.esm/wallet/index.d.ts delete mode 100644 lib.esm/wallet/index.d.ts.map delete mode 100644 lib.esm/wallet/index.js delete mode 100644 lib.esm/wallet/index.js.map delete mode 100644 lib.esm/wallet/json-crowdsale.d.ts delete mode 100644 lib.esm/wallet/json-crowdsale.d.ts.map delete mode 100644 lib.esm/wallet/json-crowdsale.js delete mode 100644 lib.esm/wallet/json-crowdsale.js.map delete mode 100644 lib.esm/wallet/json-keystore.d.ts delete mode 100644 lib.esm/wallet/json-keystore.d.ts.map delete mode 100644 lib.esm/wallet/json-keystore.js delete mode 100644 lib.esm/wallet/json-keystore.js.map delete mode 100644 lib.esm/wallet/mnemonic.d.ts delete mode 100644 lib.esm/wallet/mnemonic.d.ts.map delete mode 100644 lib.esm/wallet/mnemonic.js delete mode 100644 lib.esm/wallet/mnemonic.js.map delete mode 100644 lib.esm/wallet/mnemonicToSeed.d.ts delete mode 100644 lib.esm/wallet/mnemonicToSeed.d.ts.map delete mode 100644 lib.esm/wallet/mnemonicToSeed.js delete mode 100644 lib.esm/wallet/mnemonicToSeed.js.map delete mode 100644 lib.esm/wallet/utils.d.ts delete mode 100644 lib.esm/wallet/utils.d.ts.map delete mode 100644 lib.esm/wallet/utils.js delete mode 100644 lib.esm/wallet/utils.js.map delete mode 100644 lib.esm/wallet/wallet.d.ts delete mode 100644 lib.esm/wallet/wallet.d.ts.map delete mode 100644 lib.esm/wallet/wallet.js delete mode 100644 lib.esm/wallet/wallet.js.map delete mode 100644 lib.esm/wordlists/bit-reader.d.ts delete mode 100644 lib.esm/wordlists/bit-reader.d.ts.map delete mode 100644 lib.esm/wordlists/bit-reader.js delete mode 100644 lib.esm/wordlists/bit-reader.js.map delete mode 100644 lib.esm/wordlists/decode-owl.d.ts delete mode 100644 lib.esm/wordlists/decode-owl.d.ts.map delete mode 100644 lib.esm/wordlists/decode-owl.js delete mode 100644 lib.esm/wordlists/decode-owl.js.map delete mode 100644 lib.esm/wordlists/decode-owla.d.ts delete mode 100644 lib.esm/wordlists/decode-owla.d.ts.map delete mode 100644 lib.esm/wordlists/decode-owla.js delete mode 100644 lib.esm/wordlists/decode-owla.js.map delete mode 100644 lib.esm/wordlists/enwords.d.ts delete mode 100644 lib.esm/wordlists/enwords.d.ts.map delete mode 100644 lib.esm/wordlists/enwords.js delete mode 100644 lib.esm/wordlists/enwords.js.map delete mode 100644 lib.esm/wordlists/generation/encode-latin.d.ts delete mode 100644 lib.esm/wordlists/generation/encode-latin.d.ts.map delete mode 100644 lib.esm/wordlists/generation/encode-latin.js delete mode 100644 lib.esm/wordlists/generation/encode-latin.js.map delete mode 100644 lib.esm/wordlists/index.d.ts delete mode 100644 lib.esm/wordlists/index.d.ts.map delete mode 100644 lib.esm/wordlists/index.js delete mode 100644 lib.esm/wordlists/index.js.map delete mode 100644 lib.esm/wordlists/lang-cz.d.ts delete mode 100644 lib.esm/wordlists/lang-cz.d.ts.map delete mode 100644 lib.esm/wordlists/lang-cz.js delete mode 100644 lib.esm/wordlists/lang-cz.js.map delete mode 100644 lib.esm/wordlists/lang-en.d.ts delete mode 100644 lib.esm/wordlists/lang-en.d.ts.map delete mode 100644 lib.esm/wordlists/lang-en.js delete mode 100644 lib.esm/wordlists/lang-en.js.map delete mode 100644 lib.esm/wordlists/lang-es.d.ts delete mode 100644 lib.esm/wordlists/lang-es.d.ts.map delete mode 100644 lib.esm/wordlists/lang-es.js delete mode 100644 lib.esm/wordlists/lang-es.js.map delete mode 100644 lib.esm/wordlists/lang-fr.d.ts delete mode 100644 lib.esm/wordlists/lang-fr.d.ts.map delete mode 100644 lib.esm/wordlists/lang-fr.js delete mode 100644 lib.esm/wordlists/lang-fr.js.map delete mode 100644 lib.esm/wordlists/lang-it.d.ts delete mode 100644 lib.esm/wordlists/lang-it.d.ts.map delete mode 100644 lib.esm/wordlists/lang-it.js delete mode 100644 lib.esm/wordlists/lang-it.js.map delete mode 100644 lib.esm/wordlists/lang-ja.d.ts delete mode 100644 lib.esm/wordlists/lang-ja.d.ts.map delete mode 100644 lib.esm/wordlists/lang-ja.js delete mode 100644 lib.esm/wordlists/lang-ja.js.map delete mode 100644 lib.esm/wordlists/lang-ko.d.ts delete mode 100644 lib.esm/wordlists/lang-ko.d.ts.map delete mode 100644 lib.esm/wordlists/lang-ko.js delete mode 100644 lib.esm/wordlists/lang-ko.js.map delete mode 100644 lib.esm/wordlists/lang-pt.d.ts delete mode 100644 lib.esm/wordlists/lang-pt.d.ts.map delete mode 100644 lib.esm/wordlists/lang-pt.js delete mode 100644 lib.esm/wordlists/lang-pt.js.map delete mode 100644 lib.esm/wordlists/lang-zh.d.ts delete mode 100644 lib.esm/wordlists/lang-zh.d.ts.map delete mode 100644 lib.esm/wordlists/lang-zh.js delete mode 100644 lib.esm/wordlists/lang-zh.js.map delete mode 100644 lib.esm/wordlists/wordlist-owl.d.ts delete mode 100644 lib.esm/wordlists/wordlist-owl.d.ts.map delete mode 100644 lib.esm/wordlists/wordlist-owl.js delete mode 100644 lib.esm/wordlists/wordlist-owl.js.map delete mode 100644 lib.esm/wordlists/wordlist-owla.d.ts delete mode 100644 lib.esm/wordlists/wordlist-owla.d.ts.map delete mode 100644 lib.esm/wordlists/wordlist-owla.js delete mode 100644 lib.esm/wordlists/wordlist-owla.js.map delete mode 100644 lib.esm/wordlists/wordlist.d.ts delete mode 100644 lib.esm/wordlists/wordlist.d.ts.map delete mode 100644 lib.esm/wordlists/wordlist.js delete mode 100644 lib.esm/wordlists/wordlist.js.map delete mode 100644 lib.esm/wordlists/wordlists-browser.d.ts delete mode 100644 lib.esm/wordlists/wordlists-browser.d.ts.map delete mode 100644 lib.esm/wordlists/wordlists-browser.js delete mode 100644 lib.esm/wordlists/wordlists-browser.js.map delete mode 100644 lib.esm/wordlists/wordlists-extra.d.ts delete mode 100644 lib.esm/wordlists/wordlists-extra.d.ts.map delete mode 100644 lib.esm/wordlists/wordlists-extra.js delete mode 100644 lib.esm/wordlists/wordlists-extra.js.map delete mode 100644 lib.esm/wordlists/wordlists.d.ts delete mode 100644 lib.esm/wordlists/wordlists.d.ts.map delete mode 100644 lib.esm/wordlists/wordlists.js delete mode 100644 lib.esm/wordlists/wordlists.js.map delete mode 100644 package-lock.json delete mode 100644 types/_version.d.ts delete mode 100644 types/_version.d.ts.map delete mode 100644 types/abi-types/Tes.d.ts delete mode 100644 types/abi-types/Tes.d.ts.map delete mode 100644 types/abi-types/Tes_abi.d.ts delete mode 100644 types/abi-types/Tes_abi.d.ts.map delete mode 100644 types/abi-types/common.d.ts delete mode 100644 types/abi-types/common.d.ts.map delete mode 100644 types/abi-types/factories/Tes__factory.d.ts delete mode 100644 types/abi-types/factories/Tes__factory.d.ts.map delete mode 100644 types/abi-types/factories/Tes_abi__factory.d.ts delete mode 100644 types/abi-types/factories/Tes_abi__factory.d.ts.map delete mode 100644 types/abi-types/factories/index.d.ts delete mode 100644 types/abi-types/factories/index.d.ts.map delete mode 100644 types/abi-types/index.d.ts delete mode 100644 types/abi-types/index.d.ts.map delete mode 100644 types/abi/abi-coder.d.ts delete mode 100644 types/abi/abi-coder.d.ts.map delete mode 100644 types/abi/bytes32.d.ts delete mode 100644 types/abi/bytes32.d.ts.map delete mode 100644 types/abi/coders/abstract-coder.d.ts delete mode 100644 types/abi/coders/abstract-coder.d.ts.map delete mode 100644 types/abi/coders/address.d.ts delete mode 100644 types/abi/coders/address.d.ts.map delete mode 100644 types/abi/coders/anonymous.d.ts delete mode 100644 types/abi/coders/anonymous.d.ts.map delete mode 100644 types/abi/coders/array.d.ts delete mode 100644 types/abi/coders/array.d.ts.map delete mode 100644 types/abi/coders/boolean.d.ts delete mode 100644 types/abi/coders/boolean.d.ts.map delete mode 100644 types/abi/coders/bytes.d.ts delete mode 100644 types/abi/coders/bytes.d.ts.map delete mode 100644 types/abi/coders/fixed-bytes.d.ts delete mode 100644 types/abi/coders/fixed-bytes.d.ts.map delete mode 100644 types/abi/coders/null.d.ts delete mode 100644 types/abi/coders/null.d.ts.map delete mode 100644 types/abi/coders/number.d.ts delete mode 100644 types/abi/coders/number.d.ts.map delete mode 100644 types/abi/coders/string.d.ts delete mode 100644 types/abi/coders/string.d.ts.map delete mode 100644 types/abi/coders/tuple.d.ts delete mode 100644 types/abi/coders/tuple.d.ts.map delete mode 100644 types/abi/fragments.d.ts delete mode 100644 types/abi/fragments.d.ts.map delete mode 100644 types/abi/index.d.ts delete mode 100644 types/abi/index.d.ts.map delete mode 100644 types/abi/interface.d.ts delete mode 100644 types/abi/interface.d.ts.map delete mode 100644 types/abi/typed.d.ts delete mode 100644 types/abi/typed.d.ts.map delete mode 100644 types/address/checks.d.ts delete mode 100644 types/address/checks.d.ts.map delete mode 100644 types/address/contract-address.d.ts delete mode 100644 types/address/contract-address.d.ts.map delete mode 100644 types/address/index.d.ts delete mode 100644 types/address/index.d.ts.map delete mode 100644 types/bigNumber/bigNumber.d.ts delete mode 100644 types/bigNumber/bigNumber.d.ts.map delete mode 100644 types/cip/custom-units.d.ts delete mode 100644 types/cip/custom-units.d.ts.map delete mode 100644 types/cip/index.d.ts delete mode 100644 types/cip/index.d.ts.map delete mode 100644 types/constants/addresses.d.ts delete mode 100644 types/constants/addresses.d.ts.map delete mode 100644 types/constants/hashes.d.ts delete mode 100644 types/constants/hashes.d.ts.map delete mode 100644 types/constants/index.d.ts delete mode 100644 types/constants/index.d.ts.map delete mode 100644 types/constants/numbers.d.ts delete mode 100644 types/constants/numbers.d.ts.map delete mode 100644 types/constants/strings.d.ts delete mode 100644 types/constants/strings.d.ts.map delete mode 100644 types/contract/contract.d.ts delete mode 100644 types/contract/contract.d.ts.map delete mode 100644 types/contract/factory.d.ts delete mode 100644 types/contract/factory.d.ts.map delete mode 100644 types/contract/index.d.ts delete mode 100644 types/contract/index.d.ts.map delete mode 100644 types/contract/types.d.ts delete mode 100644 types/contract/types.d.ts.map delete mode 100644 types/contract/wrappers.d.ts delete mode 100644 types/contract/wrappers.d.ts.map delete mode 100644 types/corebc.d.ts delete mode 100644 types/corebc.d.ts.map delete mode 100644 types/crypto/browser-ed448.d.ts delete mode 100644 types/crypto/browser-ed448.d.ts.map delete mode 100644 types/crypto/browser-sha3.d.ts delete mode 100644 types/crypto/browser-sha3.d.ts.map delete mode 100644 types/crypto/crypto-browser.d.ts delete mode 100644 types/crypto/crypto-browser.d.ts.map delete mode 100644 types/crypto/crypto.d.ts delete mode 100644 types/crypto/crypto.d.ts.map delete mode 100644 types/crypto/ed448-types.d.ts delete mode 100644 types/crypto/ed448-types.d.ts.map delete mode 100644 types/crypto/ed448.d.ts delete mode 100644 types/crypto/ed448.d.ts.map delete mode 100644 types/crypto/ed448goldilock-browser.d.ts delete mode 100644 types/crypto/ed448goldilock-browser.d.ts.map delete mode 100644 types/crypto/ed448goldilock.d.ts delete mode 100644 types/crypto/ed448goldilock.d.ts.map delete mode 100644 types/crypto/hmac.d.ts delete mode 100644 types/crypto/hmac.d.ts.map delete mode 100644 types/crypto/index.d.ts delete mode 100644 types/crypto/index.d.ts.map delete mode 100644 types/crypto/keccak.d.ts delete mode 100644 types/crypto/keccak.d.ts.map delete mode 100644 types/crypto/pbkdf2-browser.d.ts delete mode 100644 types/crypto/pbkdf2-browser.d.ts.map delete mode 100644 types/crypto/pbkdf2.d.ts delete mode 100644 types/crypto/pbkdf2.d.ts.map delete mode 100644 types/crypto/random.d.ts delete mode 100644 types/crypto/random.d.ts.map delete mode 100644 types/crypto/ripemd160.d.ts delete mode 100644 types/crypto/ripemd160.d.ts.map delete mode 100644 types/crypto/rlp.d.ts delete mode 100644 types/crypto/rlp.d.ts.map delete mode 100644 types/crypto/scrypt.d.ts delete mode 100644 types/crypto/scrypt.d.ts.map delete mode 100644 types/crypto/sha3.d.ts delete mode 100644 types/crypto/sha3.d.ts.map delete mode 100644 types/crypto/signature.d.ts delete mode 100644 types/crypto/signature.d.ts.map delete mode 100644 types/crypto/signing-key.d.ts delete mode 100644 types/crypto/signing-key.d.ts.map delete mode 100644 types/hash/id.d.ts delete mode 100644 types/hash/id.d.ts.map delete mode 100644 types/hash/index.d.ts delete mode 100644 types/hash/index.d.ts.map delete mode 100644 types/hash/message.d.ts delete mode 100644 types/hash/message.d.ts.map delete mode 100644 types/hash/solidity.d.ts delete mode 100644 types/hash/solidity.d.ts.map delete mode 100644 types/hash/typed-data.d.ts delete mode 100644 types/hash/typed-data.d.ts.map delete mode 100644 types/index.d.ts delete mode 100644 types/index.d.ts.map delete mode 100644 types/ipfs/index.d.ts delete mode 100644 types/ipfs/index.d.ts.map delete mode 100644 types/logger/logger.d.ts delete mode 100644 types/logger/logger.d.ts.map delete mode 100644 types/providers/abstract-provider.d.ts delete mode 100644 types/providers/abstract-provider.d.ts.map delete mode 100644 types/providers/abstract-signer.d.ts delete mode 100644 types/providers/abstract-signer.d.ts.map delete mode 100644 types/providers/community.d.ts delete mode 100644 types/providers/community.d.ts.map delete mode 100644 types/providers/contracts.d.ts delete mode 100644 types/providers/contracts.d.ts.map delete mode 100644 types/providers/default-provider.d.ts delete mode 100644 types/providers/default-provider.d.ts.map delete mode 100644 types/providers/format.d.ts delete mode 100644 types/providers/format.d.ts.map delete mode 100644 types/providers/formatting.d.ts delete mode 100644 types/providers/formatting.d.ts.map delete mode 100644 types/providers/index.d.ts delete mode 100644 types/providers/index.d.ts.map delete mode 100644 types/providers/network.d.ts delete mode 100644 types/providers/network.d.ts.map delete mode 100644 types/providers/pagination.d.ts delete mode 100644 types/providers/pagination.d.ts.map delete mode 100644 types/providers/plugin-fallback.d.ts delete mode 100644 types/providers/plugin-fallback.d.ts.map delete mode 100644 types/providers/plugins-network.d.ts delete mode 100644 types/providers/plugins-network.d.ts.map delete mode 100644 types/providers/provider-alchemy.d.ts delete mode 100644 types/providers/provider-alchemy.d.ts.map delete mode 100644 types/providers/provider-ankr.d.ts delete mode 100644 types/providers/provider-ankr.d.ts.map delete mode 100644 types/providers/provider-browser.d.ts delete mode 100644 types/providers/provider-browser.d.ts.map delete mode 100644 types/providers/provider-cloudflare.d.ts delete mode 100644 types/providers/provider-cloudflare.d.ts.map delete mode 100644 types/providers/provider-fallback.d.ts delete mode 100644 types/providers/provider-fallback.d.ts.map delete mode 100644 types/providers/provider-infura.d.ts delete mode 100644 types/providers/provider-infura.d.ts.map delete mode 100644 types/providers/provider-ipcsocket-browser.d.ts delete mode 100644 types/providers/provider-ipcsocket-browser.d.ts.map delete mode 100644 types/providers/provider-ipcsocket.d.ts delete mode 100644 types/providers/provider-ipcsocket.d.ts.map delete mode 100644 types/providers/provider-jsonrpc.d.ts delete mode 100644 types/providers/provider-jsonrpc.d.ts.map delete mode 100644 types/providers/provider-pocket.d.ts delete mode 100644 types/providers/provider-pocket.d.ts.map delete mode 100644 types/providers/provider-quicknode.d.ts delete mode 100644 types/providers/provider-quicknode.d.ts.map delete mode 100644 types/providers/provider-socket.d.ts delete mode 100644 types/providers/provider-socket.d.ts.map delete mode 100644 types/providers/provider-websocket.d.ts delete mode 100644 types/providers/provider-websocket.d.ts.map delete mode 100644 types/providers/provider.d.ts delete mode 100644 types/providers/provider.d.ts.map delete mode 100644 types/providers/signer-noncemanager.d.ts delete mode 100644 types/providers/signer-noncemanager.d.ts.map delete mode 100644 types/providers/signer.d.ts delete mode 100644 types/providers/signer.d.ts.map delete mode 100644 types/providers/subscriber-connection.d.ts delete mode 100644 types/providers/subscriber-connection.d.ts.map delete mode 100644 types/providers/subscriber-filterid.d.ts delete mode 100644 types/providers/subscriber-filterid.d.ts.map delete mode 100644 types/providers/subscriber-polling.d.ts delete mode 100644 types/providers/subscriber-polling.d.ts.map delete mode 100644 types/providers/ws-browser.d.ts delete mode 100644 types/providers/ws-browser.d.ts.map delete mode 100644 types/providers/ws.d.ts delete mode 100644 types/providers/ws.d.ts.map delete mode 100644 types/transaction/accesslist.d.ts delete mode 100644 types/transaction/accesslist.d.ts.map delete mode 100644 types/transaction/address.d.ts delete mode 100644 types/transaction/address.d.ts.map delete mode 100644 types/transaction/index.d.ts delete mode 100644 types/transaction/index.d.ts.map delete mode 100644 types/transaction/transaction.d.ts delete mode 100644 types/transaction/transaction.d.ts.map delete mode 100644 types/utils/base58.d.ts delete mode 100644 types/utils/base58.d.ts.map delete mode 100644 types/utils/base64-browser.d.ts delete mode 100644 types/utils/base64-browser.d.ts.map delete mode 100644 types/utils/base64.d.ts delete mode 100644 types/utils/base64.d.ts.map delete mode 100644 types/utils/data.d.ts delete mode 100644 types/utils/data.d.ts.map delete mode 100644 types/utils/errors.d.ts delete mode 100644 types/utils/errors.d.ts.map delete mode 100644 types/utils/events.d.ts delete mode 100644 types/utils/events.d.ts.map delete mode 100644 types/utils/fetch.d.ts delete mode 100644 types/utils/fetch.d.ts.map delete mode 100644 types/utils/fixednumber.d.ts delete mode 100644 types/utils/fixednumber.d.ts.map delete mode 100644 types/utils/geturl-browser.d.ts delete mode 100644 types/utils/geturl-browser.d.ts.map delete mode 100644 types/utils/geturl.d.ts delete mode 100644 types/utils/geturl.d.ts.map delete mode 100644 types/utils/index.d.ts delete mode 100644 types/utils/index.d.ts.map delete mode 100644 types/utils/maths.d.ts delete mode 100644 types/utils/maths.d.ts.map delete mode 100644 types/utils/properties.d.ts delete mode 100644 types/utils/properties.d.ts.map delete mode 100644 types/utils/rlp-decode.d.ts delete mode 100644 types/utils/rlp-decode.d.ts.map delete mode 100644 types/utils/rlp-encode.d.ts delete mode 100644 types/utils/rlp-encode.d.ts.map delete mode 100644 types/utils/rlp.d.ts delete mode 100644 types/utils/rlp.d.ts.map delete mode 100644 types/utils/units.d.ts delete mode 100644 types/utils/units.d.ts.map delete mode 100644 types/utils/utf8.d.ts delete mode 100644 types/utils/utf8.d.ts.map delete mode 100644 types/utils/uuid.d.ts delete mode 100644 types/utils/uuid.d.ts.map delete mode 100644 types/wallet/base-wallet.d.ts delete mode 100644 types/wallet/base-wallet.d.ts.map delete mode 100644 types/wallet/english_words.d.ts delete mode 100644 types/wallet/english_words.d.ts.map delete mode 100644 types/wallet/hdwallet.d.ts delete mode 100644 types/wallet/hdwallet.d.ts.map delete mode 100644 types/wallet/index.d.ts delete mode 100644 types/wallet/index.d.ts.map delete mode 100644 types/wallet/json-crowdsale.d.ts delete mode 100644 types/wallet/json-crowdsale.d.ts.map delete mode 100644 types/wallet/json-keystore.d.ts delete mode 100644 types/wallet/json-keystore.d.ts.map delete mode 100644 types/wallet/mnemonic.d.ts delete mode 100644 types/wallet/mnemonic.d.ts.map delete mode 100644 types/wallet/mnemonicToSeed.d.ts delete mode 100644 types/wallet/mnemonicToSeed.d.ts.map delete mode 100644 types/wallet/utils.d.ts delete mode 100644 types/wallet/utils.d.ts.map delete mode 100644 types/wallet/wallet.d.ts delete mode 100644 types/wallet/wallet.d.ts.map delete mode 100644 types/wordlists/bit-reader.d.ts delete mode 100644 types/wordlists/bit-reader.d.ts.map delete mode 100644 types/wordlists/decode-owl.d.ts delete mode 100644 types/wordlists/decode-owl.d.ts.map delete mode 100644 types/wordlists/decode-owla.d.ts delete mode 100644 types/wordlists/decode-owla.d.ts.map delete mode 100644 types/wordlists/enwords.d.ts delete mode 100644 types/wordlists/enwords.d.ts.map delete mode 100644 types/wordlists/generation/encode-latin.d.ts delete mode 100644 types/wordlists/generation/encode-latin.d.ts.map delete mode 100644 types/wordlists/index.d.ts delete mode 100644 types/wordlists/index.d.ts.map delete mode 100644 types/wordlists/lang-cz.d.ts delete mode 100644 types/wordlists/lang-cz.d.ts.map delete mode 100644 types/wordlists/lang-en.d.ts delete mode 100644 types/wordlists/lang-en.d.ts.map delete mode 100644 types/wordlists/lang-es.d.ts delete mode 100644 types/wordlists/lang-es.d.ts.map delete mode 100644 types/wordlists/lang-fr.d.ts delete mode 100644 types/wordlists/lang-fr.d.ts.map delete mode 100644 types/wordlists/lang-it.d.ts delete mode 100644 types/wordlists/lang-it.d.ts.map delete mode 100644 types/wordlists/lang-ja.d.ts delete mode 100644 types/wordlists/lang-ja.d.ts.map delete mode 100644 types/wordlists/lang-ko.d.ts delete mode 100644 types/wordlists/lang-ko.d.ts.map delete mode 100644 types/wordlists/lang-pt.d.ts delete mode 100644 types/wordlists/lang-pt.d.ts.map delete mode 100644 types/wordlists/lang-zh.d.ts delete mode 100644 types/wordlists/lang-zh.d.ts.map delete mode 100644 types/wordlists/wordlist-owl.d.ts delete mode 100644 types/wordlists/wordlist-owl.d.ts.map delete mode 100644 types/wordlists/wordlist-owla.d.ts delete mode 100644 types/wordlists/wordlist-owla.d.ts.map delete mode 100644 types/wordlists/wordlist.d.ts delete mode 100644 types/wordlists/wordlist.d.ts.map delete mode 100644 types/wordlists/wordlists-browser.d.ts delete mode 100644 types/wordlists/wordlists-browser.d.ts.map delete mode 100644 types/wordlists/wordlists-extra.d.ts delete mode 100644 types/wordlists/wordlists-extra.d.ts.map delete mode 100644 types/wordlists/wordlists.d.ts delete mode 100644 types/wordlists/wordlists.d.ts.map diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 7d273e83b..000000000 --- a/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -# Generated artifacts are retained for this repository's distribution model. -lib.esm/** linguist-generated=true -lib.commonjs/** linguist-generated=true -types/** linguist-generated=true -dist/** linguist-generated=true -# Rollup preserves trailing spaces in bundled third-party dependency sources. -dist/*.js whitespace=-blank-at-eol diff --git a/dist/README.md b/dist/README.md deleted file mode 100644 index 78b13a88d..000000000 --- a/dist/README.md +++ /dev/null @@ -1,22 +0,0 @@ -Distribution Folder -=================== - -The contents of this folder are for using `import` in ESM -browser-base projects. - -The `ethers.js` (and `ethers.min.js`) files only include the -English wordlist to conserve space. - -For additional Wordlist support, the `wordlist-extra.js` (and -`wordlist-extra.min.js`) should be imported too. - - -Notes ------ - -The contents are generated via the `npm build dist` target using -`rollup` and the `/rollup.config.js` configuration. - -Do not modify the files in this folder. They are deleted on `build-clean`. - -To modify this `README.md`, see the `/output/post-build/dist`. diff --git a/dist/corebc.js b/dist/corebc.js deleted file mode 100644 index d16fe3964..000000000 --- a/dist/corebc.js +++ /dev/null @@ -1,46160 +0,0 @@ -const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {}); -var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - -function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; -} - -function getAugmentedNamespace(n) { - if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n; - var f = n.default; - if (typeof f == "function") { - var a = function a () { - var isInstance = false; - try { - isInstance = this instanceof a; - } catch (e) {} - if (isInstance) { - return Reflect.construct(f, arguments, this.constructor); - } - return f.apply(this, arguments); - }; - a.prototype = f.prototype; - } else a = {}; - Object.defineProperty(a, '__esModule', {value: true}); - Object.keys(n).forEach(function (k) { - var d = Object.getOwnPropertyDescriptor(n, k); - Object.defineProperty(a, k, d.get ? d : { - enumerable: true, - get: function () { - return n[k]; - } - }); - }); - return a; -} - -var buffer = {}; - -var base64Js = {}; - -var hasRequiredBase64Js; - -function requireBase64Js () { - if (hasRequiredBase64Js) return base64Js; - hasRequiredBase64Js = 1; - - base64Js.byteLength = byteLength; - base64Js.toByteArray = toByteArray; - base64Js.fromByteArray = fromByteArray; - - var lookup = []; - var revLookup = []; - var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; - - var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } - - // Support decoding URL-safe base64 strings, as Node.js does. - // See: https://en.wikipedia.org/wiki/Base64#URL_applications - revLookup['-'.charCodeAt(0)] = 62; - revLookup['_'.charCodeAt(0)] = 63; - - function getLens (b64) { - var len = b64.length; - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('='); - if (validLen === -1) validLen = len; - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4); - - return [validLen, placeHoldersLen] - } - - // base64 is 4/3 + up to two characters of the original data - function byteLength (b64) { - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen - } - - function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen - } - - function toByteArray (b64) { - var tmp; - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); - - var curByte = 0; - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen; - - var i; - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)]; - arr[curByte++] = (tmp >> 16) & 0xFF; - arr[curByte++] = (tmp >> 8) & 0xFF; - arr[curByte++] = tmp & 0xFF; - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4); - arr[curByte++] = tmp & 0xFF; - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2); - arr[curByte++] = (tmp >> 8) & 0xFF; - arr[curByte++] = tmp & 0xFF; - } - - return arr - } - - function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] - } - - function encodeChunk (uint8, start, end) { - var tmp; - var output = []; - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF); - output.push(tripletToBase64(tmp)); - } - return output.join('') - } - - function fromByteArray (uint8) { - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var parts = []; - var maxChunkLength = 16383; // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1]; - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ); - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1]; - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ); - } - - return parts.join('') - } - return base64Js; -} - -var ieee754 = {}; - -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ - -var hasRequiredIeee754; - -function requireIeee754 () { - if (hasRequiredIeee754) return ieee754; - hasRequiredIeee754 = 1; - ieee754.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = (nBytes * 8) - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? (nBytes - 1) : 0; - var d = isLE ? -1 : 1; - var s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) - }; - - ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = (nBytes * 8) - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); - var i = isLE ? 0 : (nBytes - 1); - var d = isLE ? 1 : -1; - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128; - }; - return ieee754; -} - -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ - -var hasRequiredBuffer; - -function requireBuffer () { - if (hasRequiredBuffer) return buffer; - hasRequiredBuffer = 1; - (function (exports) { - - const base64 = requireBase64Js(); - const ieee754 = requireIeee754(); - const customInspectSymbol = - (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation - ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation - : null; - - exports.Buffer = Buffer; - exports.SlowBuffer = SlowBuffer; - exports.INSPECT_MAX_BYTES = 50; - - const K_MAX_LENGTH = 0x7fffffff; - exports.kMaxLength = K_MAX_LENGTH; - - /** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an Object - * implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */ - Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); - - if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && - typeof console.error === 'function') { - console.error( - 'This browser lacks typed array (Uint8Array) support which is required by ' + - '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' - ); - } - - function typedArraySupport () { - // Can typed array instances can be augmented? - try { - const arr = new Uint8Array(1); - const proto = { foo: function () { return 42 } }; - Object.setPrototypeOf(proto, Uint8Array.prototype); - Object.setPrototypeOf(arr, proto); - return arr.foo() === 42 - } catch (e) { - return false - } - } - - Object.defineProperty(Buffer.prototype, 'parent', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.buffer - } - }); - - Object.defineProperty(Buffer.prototype, 'offset', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.byteOffset - } - }); - - function createBuffer (length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"') - } - // Return an augmented `Uint8Array` instance - const buf = new Uint8Array(length); - Object.setPrototypeOf(buf, Buffer.prototype); - return buf - } - - /** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - - function Buffer (arg, encodingOrOffset, length) { - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new TypeError( - 'The "string" argument must be of type string. Received type number' - ) - } - return allocUnsafe(arg) - } - return from(arg, encodingOrOffset, length) - } - - Buffer.poolSize = 8192; // not used by this implementation - - function from (value, encodingOrOffset, length) { - if (typeof value === 'string') { - return fromString(value, encodingOrOffset) - } - - if (ArrayBuffer.isView(value)) { - return fromArrayView(value) - } - - if (value == null) { - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) - } - - if (isInstance(value, ArrayBuffer) || - (value && isInstance(value.buffer, ArrayBuffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof SharedArrayBuffer !== 'undefined' && - (isInstance(value, SharedArrayBuffer) || - (value && isInstance(value.buffer, SharedArrayBuffer)))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof value === 'number') { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number' - ) - } - - const valueOf = value.valueOf && value.valueOf(); - if (valueOf != null && valueOf !== value) { - return Buffer.from(valueOf, encodingOrOffset, length) - } - - const b = fromObject(value); - if (b) return b - - if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && - typeof value[Symbol.toPrimitive] === 'function') { - return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length) - } - - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) - } - - /** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ - Buffer.from = function (value, encodingOrOffset, length) { - return from(value, encodingOrOffset, length) - }; - - // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: - // https://github.com/feross/buffer/pull/148 - Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); - Object.setPrototypeOf(Buffer, Uint8Array); - - function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be of type number') - } else if (size < 0) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } - } - - function alloc (size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpreted as a start offset. - return typeof encoding === 'string' - ? createBuffer(size).fill(fill, encoding) - : createBuffer(size).fill(fill) - } - return createBuffer(size) - } - - /** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ - Buffer.alloc = function (size, fill, encoding) { - return alloc(size, fill, encoding) - }; - - function allocUnsafe (size) { - assertSize(size); - return createBuffer(size < 0 ? 0 : checked(size) | 0) - } - - /** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ - Buffer.allocUnsafe = function (size) { - return allocUnsafe(size) - }; - /** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ - Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(size) - }; - - function fromString (string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8'; - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - - const length = byteLength(string, encoding) | 0; - let buf = createBuffer(length); - - const actual = buf.write(string, encoding); - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - buf = buf.slice(0, actual); - } - - return buf - } - - function fromArrayLike (array) { - const length = array.length < 0 ? 0 : checked(array.length) | 0; - const buf = createBuffer(length); - for (let i = 0; i < length; i += 1) { - buf[i] = array[i] & 255; - } - return buf - } - - function fromArrayView (arrayView) { - if (isInstance(arrayView, Uint8Array)) { - const copy = new Uint8Array(arrayView); - return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) - } - return fromArrayLike(arrayView) - } - - function fromArrayBuffer (array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds') - } - - let buf; - if (byteOffset === undefined && length === undefined) { - buf = new Uint8Array(array); - } else if (length === undefined) { - buf = new Uint8Array(array, byteOffset); - } else { - buf = new Uint8Array(array, byteOffset, length); - } - - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(buf, Buffer.prototype); - - return buf - } - - function fromObject (obj) { - if (Buffer.isBuffer(obj)) { - const len = checked(obj.length) | 0; - const buf = createBuffer(len); - - if (buf.length === 0) { - return buf - } - - obj.copy(buf, 0, 0, len); - return buf - } - - if (obj.length !== undefined) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) - } - return fromArrayLike(obj) - } - - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) - } - } - - function checked (length) { - // Note: cannot use `length < K_MAX_LENGTH` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= K_MAX_LENGTH) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') - } - return length | 0 - } - - function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0; - } - return Buffer.alloc(+length) - } - - Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true && - b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false - }; - - Buffer.compare = function compare (a, b) { - if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); - if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' - ) - } - - if (a === b) return 0 - - let x = a.length; - let y = b.length; - - for (let i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } - }; - - Buffer.concat = function concat (list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - let i; - if (length === undefined) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - - const buffer = Buffer.allocUnsafe(length); - let pos = 0; - for (i = 0; i < list.length; ++i) { - let buf = list[i]; - if (isInstance(buf, Uint8Array)) { - if (pos + buf.length > buffer.length) { - if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); - buf.copy(buffer, pos); - } else { - Uint8Array.prototype.set.call( - buffer, - buf, - pos - ); - } - } else if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } else { - buf.copy(buffer, pos); - } - pos += buf.length; - } - return buffer - }; - - function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + - 'Received type ' + typeof string - ) - } - - const len = string.length; - const mustMatch = (arguments.length > 2 && arguments[2] === true); - if (!mustMatch && len === 0) return 0 - - // Use a for loop to avoid recursion - let loweredCase = false; - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) { - return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 - } - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - } - Buffer.byteLength = byteLength; - - function slowToString (encoding, start, end) { - let loweredCase = false; - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0; - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length; - } - - if (end <= 0) { - return '' - } - - // Force coercion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0; - start >>>= 0; - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8'; - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase(); - loweredCase = true; - } - } - } - - // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) - // to detect a Buffer instance. It's not possible to use `instanceof Buffer` - // reliably in a browserify context because there could be multiple different - // copies of the 'buffer' package in use. This method works even for Buffer - // instances that were created from another copy of the `buffer` package. - // See: https://github.com/feross/buffer/issues/154 - Buffer.prototype._isBuffer = true; - - function swap (b, n, m) { - const i = b[n]; - b[n] = b[m]; - b[m] = i; - } - - Buffer.prototype.swap16 = function swap16 () { - const len = this.length; - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (let i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this - }; - - Buffer.prototype.swap32 = function swap32 () { - const len = this.length; - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (let i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this - }; - - Buffer.prototype.swap64 = function swap64 () { - const len = this.length; - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (let i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this - }; - - Buffer.prototype.toString = function toString () { - const length = this.length; - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) - }; - - Buffer.prototype.toLocaleString = Buffer.prototype.toString; - - Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 - }; - - Buffer.prototype.inspect = function inspect () { - let str = ''; - const max = exports.INSPECT_MAX_BYTES; - str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); - if (this.length > max) str += ' ... '; - return '' - }; - if (customInspectSymbol) { - Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; - } - - Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer.from(target, target.offset, target.byteLength); - } - if (!Buffer.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. ' + - 'Received type ' + (typeof target) - ) - } - - if (start === undefined) { - start = 0; - } - if (end === undefined) { - end = target ? target.length : 0; - } - if (thisStart === undefined) { - thisStart = 0; - } - if (thisEnd === undefined) { - thisEnd = this.length; - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - - if (this === target) return 0 - - let x = thisEnd - thisStart; - let y = end - start; - const len = Math.min(x, y); - - const thisCopy = this.slice(thisStart, thisEnd); - const targetCopy = target.slice(start, end); - - for (let i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, - // OR the last index of `val` in `buffer` at offset <= `byteOffset`. - // - // Arguments: - // - buffer - a Buffer to search - // - val - a string, Buffer, or number - // - byteOffset - an index into `buffer`; will be clamped to an int32 - // - encoding - an optional encoding, relevant is val is a string - // - dir - true for indexOf, false for lastIndexOf - function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff; - } else if (byteOffset < -2147483648) { - byteOffset = -2147483648; - } - byteOffset = +byteOffset; // Coerce to Number. - if (numberIsNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1); - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset; - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1; - } else if (byteOffset < 0) { - if (dir) byteOffset = 0; - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding); - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF; // Search for a byte value [0-255] - if (typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') - } - - function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - let indexSize = 1; - let arrLength = arr.length; - let valLength = val.length; - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase(); - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - let i; - if (dir) { - let foundIndex = -1; - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i; - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - let found = true; - for (let j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break - } - } - if (found) return i - } - } - - return -1 - } - - Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 - }; - - Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) - }; - - Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) - }; - - function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0; - const remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - - const strLen = string.length; - - if (length > strLen / 2) { - length = strLen / 2; - } - let i; - for (i = 0; i < length; ++i) { - const parsed = parseInt(string.substr(i * 2, 2), 16); - if (numberIsNaN(parsed)) return i - buf[offset + i] = parsed; - } - return i - } - - function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) - } - - function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) - } - - function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) - } - - function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) - } - - Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8'; - length = this.length; - offset = 0; - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset; - length = this.length; - offset = 0; - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset >>> 0; - if (isFinite(length)) { - length = length >>> 0; - if (encoding === undefined) encoding = 'utf8'; - } else { - encoding = length; - length = undefined; - } - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - const remaining = this.length - offset; - if (length === undefined || length > remaining) length = remaining; - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8'; - - let loweredCase = false; - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - case 'latin1': - case 'binary': - return asciiWrite(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - }; - - Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } - }; - - function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } - } - - function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end); - const res = []; - - let i = start; - while (i < end) { - const firstByte = buf[i]; - let codePoint = null; - let bytesPerSequence = (firstByte > 0xEF) - ? 4 - : (firstByte > 0xDF) - ? 3 - : (firstByte > 0xBF) - ? 2 - : 1; - - if (i + bytesPerSequence <= end) { - let secondByte, thirdByte, fourthByte, tempCodePoint; - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte; - } - break - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint; - } - } - break - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint; - } - } - break - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint; - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD; - bytesPerSequence = 1; - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000; - res.push(codePoint >>> 10 & 0x3FF | 0xD800); - codePoint = 0xDC00 | codePoint & 0x3FF; - } - - res.push(codePoint); - i += bytesPerSequence; - } - - return decodeCodePointsArray(res) - } - - // Based on http://stackoverflow.com/a/22747272/680742, the browser with - // the lowest limit is Chrome, with 0x10000 args. - // We go 1 magnitude less, for safety - const MAX_ARGUMENTS_LENGTH = 0x1000; - - function decodeCodePointsArray (codePoints) { - const len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - let res = ''; - let i = 0; - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ); - } - return res - } - - function asciiSlice (buf, start, end) { - let ret = ''; - end = Math.min(buf.length, end); - - for (let i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F); - } - return ret - } - - function latin1Slice (buf, start, end) { - let ret = ''; - end = Math.min(buf.length, end); - - for (let i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret - } - - function hexSlice (buf, start, end) { - const len = buf.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - let out = ''; - for (let i = start; i < end; ++i) { - out += hexSliceLookupTable[buf[i]]; - } - return out - } - - function utf16leSlice (buf, start, end) { - const bytes = buf.slice(start, end); - let res = ''; - // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) - for (let i = 0; i < bytes.length - 1; i += 2) { - res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)); - } - return res - } - - Buffer.prototype.slice = function slice (start, end) { - const len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - - if (start < 0) { - start += len; - if (start < 0) start = 0; - } else if (start > len) { - start = len; - } - - if (end < 0) { - end += len; - if (end < 0) end = 0; - } else if (end > len) { - end = len; - } - - if (end < start) end = start; - - const newBuf = this.subarray(start, end); - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(newBuf, Buffer.prototype); - - return newBuf - }; - - /* - * Need to make sure that buffer isn't trying to write out of bounds. - */ - function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') - } - - Buffer.prototype.readUintLE = - Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - let val = this[offset]; - let mul = 1; - let i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - - return val - }; - - Buffer.prototype.readUintBE = - Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - checkOffset(offset, byteLength, this.length); - } - - let val = this[offset + --byteLength]; - let mul = 1; - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul; - } - - return val - }; - - Buffer.prototype.readUint8 = - Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - return this[offset] - }; - - Buffer.prototype.readUint16LE = - Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] | (this[offset + 1] << 8) - }; - - Buffer.prototype.readUint16BE = - Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return (this[offset] << 8) | this[offset + 1] - }; - - Buffer.prototype.readUint32LE = - Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) - }; - - Buffer.prototype.readUint32BE = - Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) - }; - - Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const lo = first + - this[++offset] * 2 ** 8 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 24; - - const hi = this[++offset] + - this[++offset] * 2 ** 8 + - this[++offset] * 2 ** 16 + - last * 2 ** 24; - - return BigInt(lo) + (BigInt(hi) << BigInt(32)) - }); - - Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const hi = first * 2 ** 24 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - this[++offset]; - - const lo = this[++offset] * 2 ** 24 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - last; - - return (BigInt(hi) << BigInt(32)) + BigInt(lo) - }); - - Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - let val = this[offset]; - let mul = 1; - let i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - let i = byteLength; - let mul = 1; - let val = this[offset + --i]; - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) - }; - - Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - const val = this[offset] | (this[offset + 1] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - const val = this[offset + 1] | (this[offset] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) - }; - - Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) - }; - - Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const val = this[offset + 4] + - this[offset + 5] * 2 ** 8 + - this[offset + 6] * 2 ** 16 + - (last << 24); // Overflow - - return (BigInt(val) << BigInt(32)) + - BigInt(first + - this[++offset] * 2 ** 8 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 24) - }); - - Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const val = (first << 24) + // Overflow - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - this[++offset]; - - return (BigInt(val) << BigInt(32)) + - BigInt(this[++offset] * 2 ** 24 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - last) - }); - - Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, true, 23, 4) - }; - - Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, false, 23, 4) - }; - - Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, true, 52, 8) - }; - - Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, false, 52, 8) - }; - - function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') - } - - Buffer.prototype.writeUintLE = - Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - let mul = 1; - let i = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUintBE = - Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - let i = byteLength - 1; - let mul = 1; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUint8 = - Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); - this[offset] = (value & 0xff); - return offset + 1 - }; - - Buffer.prototype.writeUint16LE = - Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - return offset + 2 - }; - - Buffer.prototype.writeUint16BE = - Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - return offset + 2 - }; - - Buffer.prototype.writeUint32LE = - Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - this[offset + 3] = (value >>> 24); - this[offset + 2] = (value >>> 16); - this[offset + 1] = (value >>> 8); - this[offset] = (value & 0xff); - return offset + 4 - }; - - Buffer.prototype.writeUint32BE = - Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - return offset + 4 - }; - - function wrtBigUInt64LE (buf, value, offset, min, max) { - checkIntBI(value, min, max, buf, offset, 7); - - let lo = Number(value & BigInt(0xffffffff)); - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - return offset - } - - function wrtBigUInt64BE (buf, value, offset, min, max) { - checkIntBI(value, min, max, buf, offset, 7); - - let lo = Number(value & BigInt(0xffffffff)); - buf[offset + 7] = lo; - lo = lo >> 8; - buf[offset + 6] = lo; - lo = lo >> 8; - buf[offset + 5] = lo; - lo = lo >> 8; - buf[offset + 4] = lo; - let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); - buf[offset + 3] = hi; - hi = hi >> 8; - buf[offset + 2] = hi; - hi = hi >> 8; - buf[offset + 1] = hi; - hi = hi >> 8; - buf[offset] = hi; - return offset + 8 - } - - Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) { - return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) - }); - - Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) { - return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) - }); - - Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - const limit = Math.pow(2, (8 * byteLength) - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - let i = 0; - let mul = 1; - let sub = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - const limit = Math.pow(2, (8 * byteLength) - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - let i = byteLength - 1; - let mul = 1; - let sub = 0; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128); - if (value < 0) value = 0xff + value + 1; - this[offset] = (value & 0xff); - return offset + 1 - }; - - Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - return offset + 2 - }; - - Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - return offset + 2 - }; - - Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - this[offset + 2] = (value >>> 16); - this[offset + 3] = (value >>> 24); - return offset + 4 - }; - - Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); - if (value < 0) value = 0xffffffff + value + 1; - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - return offset + 4 - }; - - Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) { - return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) - }); - - Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) { - return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) - }); - - function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') - } - - function writeFloat (buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 4); - } - ieee754.write(buf, value, offset, littleEndian, 23, 4); - return offset + 4 - } - - Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) - }; - - function writeDouble (buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 8); - } - ieee754.write(buf, value, offset, littleEndian, 52, 8); - return offset + 8 - } - - Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) - }; - - // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) - Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') - if (!start) start = 0; - if (!end && end !== 0) end = this.length; - if (targetStart >= target.length) targetStart = target.length; - if (!targetStart) targetStart = 0; - if (end > 0 && end < start) end = start; - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('Index out of range') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - - const len = end - start; - - if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { - // Use built-in when available, missing from IE11 - this.copyWithin(targetStart, start, end); - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart - ); - } - - return len - }; - - // Usage: - // buffer.fill(number[, offset[, end]]) - // buffer.fill(buffer[, offset[, end]]) - // buffer.fill(string[, offset[, end]][, encoding]) - Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === 'string') { - encoding = end; - end = this.length; - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - if (val.length === 1) { - const code = val.charCodeAt(0); - if ((encoding === 'utf8' && code < 128) || - encoding === 'latin1') { - // Fast path: If `val` fits into a single byte, use that numeric value. - val = code; - } - } - } else if (typeof val === 'number') { - val = val & 255; - } else if (typeof val === 'boolean') { - val = Number(val); - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0; - end = end === undefined ? this.length : end >>> 0; - - if (!val) val = 0; - - let i; - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - const bytes = Buffer.isBuffer(val) - ? val - : Buffer.from(val, encoding); - const len = bytes.length; - if (len === 0) { - throw new TypeError('The value "' + val + - '" is invalid for argument "value"') - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - - return this - }; - - // CUSTOM ERRORS - // ============= - - // Simplified versions from Node, changed for Buffer-only usage - const errors = {}; - function E (sym, getMessage, Base) { - errors[sym] = class NodeError extends Base { - constructor () { - super(); - - Object.defineProperty(this, 'message', { - value: getMessage.apply(this, arguments), - writable: true, - configurable: true - }); - - // Add the error code to the name to include it in the stack trace. - this.name = `${this.name} [${sym}]`; - // Access the stack to generate the error message including the error code - // from the name. - this.stack; // eslint-disable-line no-unused-expressions - // Reset the name to the actual name. - delete this.name; - } - - get code () { - return sym - } - - set code (value) { - Object.defineProperty(this, 'code', { - configurable: true, - enumerable: true, - value, - writable: true - }); - } - - toString () { - return `${this.name} [${sym}]: ${this.message}` - } - }; - } - - E('ERR_BUFFER_OUT_OF_BOUNDS', - function (name) { - if (name) { - return `${name} is outside of buffer bounds` - } - - return 'Attempt to access memory outside buffer bounds' - }, RangeError); - E('ERR_INVALID_ARG_TYPE', - function (name, actual) { - return `The "${name}" argument must be of type number. Received type ${typeof actual}` - }, TypeError); - E('ERR_OUT_OF_RANGE', - function (str, range, input) { - let msg = `The value of "${str}" is out of range.`; - let received = input; - if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { - received = addNumericalSeparator(String(input)); - } else if (typeof input === 'bigint') { - received = String(input); - if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { - received = addNumericalSeparator(received); - } - received += 'n'; - } - msg += ` It must be ${range}. Received ${received}`; - return msg - }, RangeError); - - function addNumericalSeparator (val) { - let res = ''; - let i = val.length; - const start = val[0] === '-' ? 1 : 0; - for (; i >= start + 4; i -= 3) { - res = `_${val.slice(i - 3, i)}${res}`; - } - return `${val.slice(0, i)}${res}` - } - - // CHECK FUNCTIONS - // =============== - - function checkBounds (buf, offset, byteLength) { - validateNumber(offset, 'offset'); - if (buf[offset] === undefined || buf[offset + byteLength] === undefined) { - boundsError(offset, buf.length - (byteLength + 1)); - } - } - - function checkIntBI (value, min, max, buf, offset, byteLength) { - if (value > max || value < min) { - const n = typeof min === 'bigint' ? 'n' : ''; - let range; - { - if (min === 0 || min === BigInt(0)) { - range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`; - } else { - range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + - `${(byteLength + 1) * 8 - 1}${n}`; - } - } - throw new errors.ERR_OUT_OF_RANGE('value', range, value) - } - checkBounds(buf, offset, byteLength); - } - - function validateNumber (value, name) { - if (typeof value !== 'number') { - throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value) - } - } - - function boundsError (value, length, type) { - if (Math.floor(value) !== value) { - validateNumber(value, type); - throw new errors.ERR_OUT_OF_RANGE('offset', 'an integer', value) - } - - if (length < 0) { - throw new errors.ERR_BUFFER_OUT_OF_BOUNDS() - } - - throw new errors.ERR_OUT_OF_RANGE('offset', - `>= ${0} and <= ${length}`, - value) - } - - // HELPER FUNCTIONS - // ================ - - const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; - - function base64clean (str) { - // Node takes equal signs as end of the Base64 encoding - str = str.split('=')[0]; - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = str.trim().replace(INVALID_BASE64_RE, ''); - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '='; - } - return str - } - - function utf8ToBytes (string, units) { - units = units || Infinity; - let codePoint; - const length = string.length; - let leadSurrogate = null; - const bytes = []; - - for (let i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } - - // valid lead - leadSurrogate = codePoint; - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - leadSurrogate = codePoint; - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - } - - leadSurrogate = null; - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint); - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else { - throw new Error('Invalid code point') - } - } - - return bytes - } - - function asciiToBytes (str) { - const byteArray = []; - for (let i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF); - } - return byteArray - } - - function utf16leToBytes (str, units) { - let c, hi, lo; - const byteArray = []; - for (let i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - - return byteArray - } - - function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) - } - - function blitBuffer (src, dst, offset, length) { - let i; - for (i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i]; - } - return i - } - - // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass - // the `instanceof` check but they should be treated as of that type. - // See: https://github.com/feross/buffer/issues/166 - function isInstance (obj, type) { - return obj instanceof type || - (obj != null && obj.constructor != null && obj.constructor.name != null && - obj.constructor.name === type.name) - } - function numberIsNaN (obj) { - // For IE11 support - return obj !== obj // eslint-disable-line no-self-compare - } - - // Create lookup table for `toString('hex')` - // See: https://github.com/feross/buffer/issues/219 - const hexSliceLookupTable = (function () { - const alphabet = '0123456789abcdef'; - const table = new Array(256); - for (let i = 0; i < 16; ++i) { - const i16 = i * 16; - for (let j = 0; j < 16; ++j) { - table[i16 + j] = alphabet[i] + alphabet[j]; - } - } - return table - })(); - - // Return not function with Error if BigInt not supported - function defineBigIntMethod (fn) { - return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn - } - - function BufferBigIntNotDefined () { - throw new Error('BigInt not supported') - } - } (buffer)); - return buffer; -} - -var bufferExports = requireBuffer(); - -/** The current version of corebc; keep in sync with package.json. */ -const version = "0.4.1"; - -var bn$2 = {exports: {}}; - -var _nodeResolve_empty = {}; - -var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - default: _nodeResolve_empty -}); - -var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1); - -var bn$1 = bn$2.exports; - -var hasRequiredBn$1; - -function requireBn$1 () { - if (hasRequiredBn$1) return bn$2.exports; - hasRequiredBn$1 = 1; - (function (module) { - (function (module, exports) { - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - if (BN.isBN(number)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') { - Buffer = window.Buffer; - } else { - Buffer = require$$0.Buffer; - } - } catch (e) { - } - - BN.isBN = function isBN (num) { - if (num instanceof BN) { - return true; - } - - return num !== null && typeof num === 'object' && - num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); - }; - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - this.negative = 1; - } - - if (start < number.length) { - if (base === 16) { - this._parseHex(number, start, endian); - } else { - this._parseBase(number, base, start); - if (endian === 'le') { - this._initArray(this.toArray(), base, endian); - } - } - } - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [number & 0x3ffffff]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [0]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this._strip(); - }; - - function parseHex4Bits (string, index) { - var c = string.charCodeAt(index); - // '0' - '9' - if (c >= 48 && c <= 57) { - return c - 48; - // 'A' - 'F' - } else if (c >= 65 && c <= 70) { - return c - 55; - // 'a' - 'f' - } else if (c >= 97 && c <= 102) { - return c - 87; - } else { - assert(false, 'Invalid character in ' + string); - } - } - - function parseHexByte (string, lowerBound, index) { - var r = parseHex4Bits(string, index); - if (index - 1 >= lowerBound) { - r |= parseHex4Bits(string, index - 1) << 4; - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start, endian) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - // 24-bits chunks - var off = 0; - var j = 0; - - var w; - if (endian === 'be') { - for (i = number.length - 1; i >= start; i -= 2) { - w = parseHexByte(number, start, i) << off; - this.words[j] |= w & 0x3ffffff; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } else { - var parseLength = number.length - start; - for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) { - w = parseHexByte(number, start, i) << off; - this.words[j] |= w & 0x3ffffff; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } - - this._strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var b = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - b = c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - b = c - 17 + 0xa; - - // '0' - '9' - } else { - b = c; - } - assert(c >= 0 && b < mul, 'Invalid character'); - r += b; - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [0]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - this._strip(); - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - function move (dest, src) { - dest.words = src.words; - dest.length = src.length; - dest.negative = src.negative; - dest.red = src.red; - } - - BN.prototype._move = function _move (dest) { - move(dest, this); - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - BN.prototype._expand = function _expand (size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - - // Remove leading `0` from `this` - BN.prototype._strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - // Check Symbol.for because not everywhere where Symbol defined - // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility - if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') { - try { - BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect; - } catch (e) { - BN.prototype.inspect = inspect; - } - } else { - BN.prototype.inspect = inspect; - } - - function inspect () { - return (this.red ? ''; - } - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '0', - '00', - '000', - '0000', - '00000', - '000000', - '0000000', - '00000000', - '000000000', - '0000000000', - '00000000000', - '000000000000', - '0000000000000', - '00000000000000', - '000000000000000', - '0000000000000000', - '00000000000000000', - '000000000000000000', - '0000000000000000000', - '00000000000000000000', - '000000000000000000000', - '0000000000000000000000', - '00000000000000000000000', - '000000000000000000000000', - '0000000000000000000000000' - ]; - - var groupSizes = [ - 0, 0, - 25, 16, 12, 11, 10, 9, 8, - 8, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 5, 5, - 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modrn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // NOTE: at this stage it is known that the top bit is set - ret += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16, 2); - }; - - if (Buffer) { - BN.prototype.toBuffer = function toBuffer (endian, length) { - return this.toArrayLike(Buffer, endian, length); - }; - } - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - var allocate = function allocate (ArrayType, size) { - if (ArrayType.allocUnsafe) { - return ArrayType.allocUnsafe(size); - } - return new ArrayType(size); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - this._strip(); - - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - var res = allocate(ArrayType, reqLength); - var postfix = endian === 'le' ? 'LE' : 'BE'; - this['_toArrayLike' + postfix](res, byteLength); - return res; - }; - - BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) { - var position = 0; - var carry = 0; - - for (var i = 0, shift = 0; i < this.length; i++) { - var word = (this.words[i] << shift) | carry; - - res[position++] = word & 0xff; - if (position < res.length) { - res[position++] = (word >> 8) & 0xff; - } - if (position < res.length) { - res[position++] = (word >> 16) & 0xff; - } - - if (shift === 6) { - if (position < res.length) { - res[position++] = (word >> 24) & 0xff; - } - carry = 0; - shift = 0; - } else { - carry = word >>> 24; - shift += 2; - } - } - - if (position < res.length) { - res[position++] = carry; - - while (position < res.length) { - res[position++] = 0; - } - } - }; - - BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) { - var position = res.length - 1; - var carry = 0; - - for (var i = 0, shift = 0; i < this.length; i++) { - var word = (this.words[i] << shift) | carry; - - res[position--] = word & 0xff; - if (position >= 0) { - res[position--] = (word >> 8) & 0xff; - } - if (position >= 0) { - res[position--] = (word >> 16) & 0xff; - } - - if (shift === 6) { - if (position >= 0) { - res[position--] = (word >> 24) & 0xff; - } - carry = 0; - shift = 0; - } else { - carry = word >>> 24; - shift += 2; - } - } - - if (position >= 0) { - res[position--] = carry; - - while (position >= 0) { - res[position--] = 0; - } - } - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] >>> wbit) & 0x01; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this._strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this._strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this._strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - this._expand(bytesNeeded); - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - i++; - } - - // Clear words above the requested width so the result stays below 2 ** width - for (; i < this.length; i++) { - this.words[i] = 0; - } - - // And remove leading zeroes - return this._strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - this._expand(off + 1); - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this._strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } - - return this._strip(); - }; - - // Subtract `num` from `this` - BN.prototype.sub = function sub (num) { - return this.clone().isub(num); - }; - - function smallMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - var len = (self.length + num.length) | 0; - out.length = len; - len = (len - 1) | 0; - - // Peel one iteration (compiler can't do it, because of code complexity) - var a = self.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - var carry = (r / 0x4000000) | 0; - out.words[0] = lo; - - for (var k = 1; k < len; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = carry >>> 26; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = (k - j) | 0; - a = self.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - - return out._strip(); - } - - // TODO(indutny): it may be reasonable to omit it for users who don't need - // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit - // multiplication (like elliptic secp256k1). - var comb10MulTo = function comb10MulTo (self, num, out) { - var a = self.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 0x1fff; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 0x1fff; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 0x1fff; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 0x1fff; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 0x1fff; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 0x1fff; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 0x1fff; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 0x1fff; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 0x1fff; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 0x1fff; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 0x1fff; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 0x1fff; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 0x1fff; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 0x1fff; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 0x1fff; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 0x1fff; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 0x1fff; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 0x1fff; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 0x1fff; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 0x1fff; - var bh9 = b9 >>> 13; - - out.negative = self.negative ^ num.negative; - out.length = 19; - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - - // Polyfill comb - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - - function bigMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - out.length = self.length + num.length; - - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - - return out._strip(); - } - - function jumboMulTo (self, num, out) { - // Temporary disable, see https://github.com/indutny/bn.js/issues/211 - // var fftm = new FFTM(); - // return fftm.mulp(self, num, out); - return bigMulTo(self, num, out); - } - - BN.prototype.mulTo = function mulTo (num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - - return res; - }; - - // Multiply `this` by `num` - BN.prototype.mul = function mul (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - - // Multiply employing FFT - BN.prototype.mulf = function mulf (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - - // In-place Multiplication - BN.prototype.imul = function imul (num) { - return this.clone().mulTo(num, this); - }; - - BN.prototype.imuln = function imuln (num) { - var isNegNum = num < 0; - if (isNegNum) num = -num; - - assert(typeof num === 'number'); - assert(num < 0x4000000); - - // Carry - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - carry >>= 26; - carry += (w / 0x4000000) | 0; - // NOTE: lo is 27bit maximum - carry += lo >>> 26; - this.words[i] = lo & 0x3ffffff; - } - - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - if (num === 0) { - this.length = 1; - this._normSign(); - } - - return isNegNum ? this.ineg() : this; - }; - - BN.prototype.muln = function muln (num) { - return this.clone().imuln(num); - }; - - // `this` * `this` - BN.prototype.sqr = function sqr () { - return this.mul(this); - }; - - // `this` * `this` in-place - BN.prototype.isqr = function isqr () { - return this.imul(this.clone()); - }; - - // Math.pow(`this`, `num`) - BN.prototype.pow = function pow (num) { - var w = toBitArray(num); - if (w.length === 0) return new BN(1); - - // Skip leading zeroes - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) break; - } - - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) continue; - - res = res.mul(q); - } - } - - return res; - }; - - // Shift-left in-place - BN.prototype.iushln = function iushln (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); - var i; - - if (r !== 0) { - var carry = 0; - - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = ((this.words[i] | 0) - newCarry) << r; - this.words[i] = c | carry; - carry = newCarry >>> (26 - r); - } - - if (carry) { - this.words[i] = carry; - this.length++; - } - } - - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - - this.length += s; - } - - return this._strip(); - }; - - BN.prototype.ishln = function ishln (bits) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushln(bits); - }; - - // Shift-right in-place - // NOTE: `hint` is a lowest bit before trailing zeroes - // NOTE: if `extended` is present - it will be filled with destroyed bits - BN.prototype.iushrn = function iushrn (bits, hint, extended) { - assert(typeof bits === 'number' && bits >= 0); - var h; - if (hint) { - h = (hint - (hint % 26)) / 26; - } else { - h = 0; - } - - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - var maskedWords = extended; - - h -= s; - h = Math.max(0, h); - - // Extended mode, copy masked part - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - - if (s === 0) ; else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = (carry << (26 - r)) | (word >>> r); - carry = word & mask; - } - - // Push carried bits as a mask - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this._strip(); - }; - - BN.prototype.ishrn = function ishrn (bits, hint, extended) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - - // Shift-left - BN.prototype.shln = function shln (bits) { - return this.clone().ishln(bits); - }; - - BN.prototype.ushln = function ushln (bits) { - return this.clone().iushln(bits); - }; - - // Shift-right - BN.prototype.shrn = function shrn (bits) { - return this.clone().ishrn(bits); - }; - - BN.prototype.ushrn = function ushrn (bits) { - return this.clone().iushrn(bits); - }; - - // Test if n bit is set - BN.prototype.testn = function testn (bit) { - assert(typeof bit === 'number' && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) return false; - - // Check bit and return - var w = this.words[s]; - - return !!(w & q); - }; - - // Return only lowers bits of number (in-place) - BN.prototype.imaskn = function imaskn (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - - assert(this.negative === 0, 'imaskn works only with positive numbers'); - - if (this.length <= s) { - return this; - } - - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - - if (r !== 0) { - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - this.words[this.length - 1] &= mask; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this._strip(); - }; - - // Return only lowers bits of number - BN.prototype.maskn = function maskn (bits) { - return this.clone().imaskn(bits); - }; - - // Add plain number `num` to `this` - BN.prototype.iaddn = function iaddn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.isubn(-num); - - // Possible sign change - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) <= num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - - // Add without checks - return this._iaddn(num); - }; - - BN.prototype._iaddn = function _iaddn (num) { - this.words[0] += num; - - // Carry - for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - - return this; - }; - - // Subtract plain number `num` from `this` - BN.prototype.isubn = function isubn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.iaddn(-num); - - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - - this.words[0] -= num; - - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - // Carry - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - } - - return this._strip(); - }; - - BN.prototype.addn = function addn (num) { - return this.clone().iaddn(num); - }; - - BN.prototype.subn = function subn (num) { - return this.clone().isubn(num); - }; - - BN.prototype.iabs = function iabs () { - this.negative = 0; - - return this; - }; - - BN.prototype.abs = function abs () { - return this.clone().iabs(); - }; - - BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { - var len = num.length + shift; - var i; - - this._expand(len); - - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 0x3ffffff; - carry = (w >> 26) - ((right / 0x4000000) | 0); - this.words[i + shift] = w & 0x3ffffff; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) return this._strip(); - - // Subtraction overflow - assert(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 0x3ffffff; - } - this.negative = 1; - - return this._strip(); - }; - - BN.prototype._wordDiv = function _wordDiv (num, mode) { - var shift = this.length - num.length; - - var a = this.clone(); - var b = num; - - // Normalize - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - - // Initialize quotient - var m = a.length - b.length; - var q; - - if (mode !== 'mod') { - q = new BN(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 0x4000000 + - (a.words[b.length + j - 1] | 0); - - // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max - // (0x7ffffff) - qj = Math.min((qj / bhi) | 0, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q._strip(); - } - a._strip(); - - // Denormalize - if (mode !== 'div' && shift !== 0) { - a.iushrn(shift); - } - - return { - div: q || null, - mod: a - }; - }; - - // NOTE: 1) `mode` can be set to `mod` to request mod only, - // to `div` to request div only, or be absent to - // request both div & mod - // 2) `positive` is true if unsigned mod is requested - BN.prototype.divmod = function divmod (num, mode, positive) { - assert(!num.isZero()); - - if (this.isZero()) { - return { - div: new BN(0), - mod: new BN(0) - }; - } - - var div, mod, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.iadd(num); - } - } - - return { - div: div, - mod: mod - }; - } - - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - return { - div: div, - mod: res.mod - }; - } - - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.isub(num); - } - } - - return { - div: res.div, - mod: mod - }; - } - - // Both numbers are positive at this point - - // Strip both numbers to approximate shift value - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN(0), - mod: this - }; - } - - // Very short reduction - if (num.length === 1) { - if (mode === 'div') { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - - if (mode === 'mod') { - return { - div: null, - mod: new BN(this.modrn(num.words[0])) - }; - } - - return { - div: this.divn(num.words[0]), - mod: new BN(this.modrn(num.words[0])) - }; - } - - return this._wordDiv(num, mode); - }; - - // Find `this` / `num` - BN.prototype.div = function div (num) { - return this.divmod(num, 'div', false).div; - }; - - // Find `this` % `num` - BN.prototype.mod = function mod (num) { - return this.divmod(num, 'mod', false).mod; - }; - - BN.prototype.umod = function umod (num) { - return this.divmod(num, 'mod', true).mod; - }; - - // Find Round(`this` / `num`) - BN.prototype.divRound = function divRound (num) { - var dm = this.divmod(num); - - // Fast case - exact division - if (dm.mod.isZero()) return dm.div; - - var mod = dm.mod.abs(); - - var half = num.abs().iushrn(1); - var r2 = num.words[0] & 1; - var cmp = mod.cmp(half); - - // Round down - if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div; - - // Round up, away from zero - var up = new BN(1); - up.negative = this.negative ^ num.negative; - return dm.div.iadd(up); - }; - - BN.prototype.modrn = function modrn (num) { - var isNegNum = num < 0; - if (isNegNum) num = -num; - - assert(num <= 0x3ffffff); - var p = (1 << 26) % num; - - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - - return isNegNum ? -acc : acc; - }; - - // WARNING: DEPRECATED - BN.prototype.modn = function modn (num) { - return this.modrn(num); - }; - - // In-place division by number - BN.prototype.idivn = function idivn (num) { - var isNegNum = num < 0; - if (isNegNum) num = -num; - - assert(num <= 0x3ffffff); - - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 0x4000000; - this.words[i] = (w / num) | 0; - carry = w % num; - } - - this._strip(); - return isNegNum ? this.ineg() : this; - }; - - BN.prototype.divn = function divn (num) { - return this.clone().idivn(num); - }; - - BN.prototype.egcd = function egcd (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var x = this; - var y = p.clone(); - - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - - // A * x + B * y = x - var A = new BN(1); - var B = new BN(0); - - // C * x + D * y = y - var C = new BN(0); - var D = new BN(1); - - var g = 0; - - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - - var yp = y.clone(); - var xp = x.clone(); - - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - } - - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - - // This is reduced incarnation of the binary EEA - // above, designated to invert members of the - // _prime_ fields F(p) at a maximal speed - BN.prototype._invmp = function _invmp (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var a = this; - var b = p.clone(); - - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - - var x1 = new BN(1); - var x2 = new BN(0); - - var delta = b.clone(); - - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - - x1.iushrn(1); - } - } - - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - - x2.iushrn(1); - } - } - - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - - if (res.cmpn(0) < 0) { - res.iadd(p); - } - - return res; - }; - - BN.prototype.gcd = function gcd (num) { - if (this.isZero()) return num.abs(); - if (num.isZero()) return this.abs(); - - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - - // Remove common factor of two - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - - var r = a.cmp(b); - if (r < 0) { - // Swap `a` and `b` to make `a` always bigger than `b` - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - - a.isub(b); - } while (true); - - return b.iushln(shift); - }; - - // Invert number in the field F(num) - BN.prototype.invm = function invm (num) { - return this.egcd(num).a.umod(num); - }; - - BN.prototype.isEven = function isEven () { - return (this.words[0] & 1) === 0; - }; - - BN.prototype.isOdd = function isOdd () { - return (this.words[0] & 1) === 1; - }; - - // And first word and num - BN.prototype.andln = function andln (num) { - return this.words[0] & num; - }; - - // Increment at the bit position in-line - BN.prototype.bincn = function bincn (bit) { - assert(typeof bit === 'number'); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) { - this._expand(s + 1); - this.words[s] |= q; - return this; - } - - // Add bit and propagate, if needed - var carry = q; - for (var i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 0x3ffffff; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - - BN.prototype.isZero = function isZero () { - return this.length === 1 && this.words[0] === 0; - }; - - BN.prototype.cmpn = function cmpn (num) { - var negative = num < 0; - - if (this.negative !== 0 && !negative) return -1; - if (this.negative === 0 && negative) return 1; - - this._strip(); - - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - - assert(num <= 0x3ffffff, 'Number is too big'); - - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Compare two numbers and return: - // 1 - if `this` > `num` - // 0 - if `this` == `num` - // -1 - if `this` < `num` - BN.prototype.cmp = function cmp (num) { - if (this.negative !== 0 && num.negative === 0) return -1; - if (this.negative === 0 && num.negative !== 0) return 1; - - var res = this.ucmp(num); - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Unsigned comparison - BN.prototype.ucmp = function ucmp (num) { - // At this point both numbers have the same sign - if (this.length > num.length) return 1; - if (this.length < num.length) return -1; - - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - - if (a === b) continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - - BN.prototype.gtn = function gtn (num) { - return this.cmpn(num) === 1; - }; - - BN.prototype.gt = function gt (num) { - return this.cmp(num) === 1; - }; - - BN.prototype.gten = function gten (num) { - return this.cmpn(num) >= 0; - }; - - BN.prototype.gte = function gte (num) { - return this.cmp(num) >= 0; - }; - - BN.prototype.ltn = function ltn (num) { - return this.cmpn(num) === -1; - }; - - BN.prototype.lt = function lt (num) { - return this.cmp(num) === -1; - }; - - BN.prototype.lten = function lten (num) { - return this.cmpn(num) <= 0; - }; - - BN.prototype.lte = function lte (num) { - return this.cmp(num) <= 0; - }; - - BN.prototype.eqn = function eqn (num) { - return this.cmpn(num) === 0; - }; - - BN.prototype.eq = function eq (num) { - return this.cmp(num) === 0; - }; - - // - // A reduce context, could be using montgomery or something better, depending - // on the `m` itself. - // - BN.red = function red (num) { - return new Red(num); - }; - - BN.prototype.toRed = function toRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - assert(this.negative === 0, 'red works only with positives'); - return ctx.convertTo(this)._forceRed(ctx); - }; - - BN.prototype.fromRed = function fromRed () { - assert(this.red, 'fromRed works only with numbers in reduction context'); - return this.red.convertFrom(this); - }; - - BN.prototype._forceRed = function _forceRed (ctx) { - this.red = ctx; - return this; - }; - - BN.prototype.forceRed = function forceRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - return this._forceRed(ctx); - }; - - BN.prototype.redAdd = function redAdd (num) { - assert(this.red, 'redAdd works only with red numbers'); - return this.red.add(this, num); - }; - - BN.prototype.redIAdd = function redIAdd (num) { - assert(this.red, 'redIAdd works only with red numbers'); - return this.red.iadd(this, num); - }; - - BN.prototype.redSub = function redSub (num) { - assert(this.red, 'redSub works only with red numbers'); - return this.red.sub(this, num); - }; - - BN.prototype.redISub = function redISub (num) { - assert(this.red, 'redISub works only with red numbers'); - return this.red.isub(this, num); - }; - - BN.prototype.redShl = function redShl (num) { - assert(this.red, 'redShl works only with red numbers'); - return this.red.shl(this, num); - }; - - BN.prototype.redMul = function redMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - - BN.prototype.redIMul = function redIMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - - BN.prototype.redSqr = function redSqr () { - assert(this.red, 'redSqr works only with red numbers'); - this.red._verify1(this); - return this.red.sqr(this); - }; - - BN.prototype.redISqr = function redISqr () { - assert(this.red, 'redISqr works only with red numbers'); - this.red._verify1(this); - return this.red.isqr(this); - }; - - // Square root over p - BN.prototype.redSqrt = function redSqrt () { - assert(this.red, 'redSqrt works only with red numbers'); - this.red._verify1(this); - return this.red.sqrt(this); - }; - - BN.prototype.redInvm = function redInvm () { - assert(this.red, 'redInvm works only with red numbers'); - this.red._verify1(this); - return this.red.invm(this); - }; - - // Return negative clone of `this` % `red modulo` - BN.prototype.redNeg = function redNeg () { - assert(this.red, 'redNeg works only with red numbers'); - this.red._verify1(this); - return this.red.neg(this); - }; - - BN.prototype.redPow = function redPow (num) { - assert(this.red && !num.red, 'redPow(normalNum)'); - this.red._verify1(this); - return this.red.pow(this, num); - }; - - // Prime numbers with efficient reduction - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - - // Pseudo-Mersenne prime - function MPrime (name, p) { - // P = 2 ^ N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = new BN(1).iushln(this.n).isub(this.p); - - this.tmp = this._tmp(); - } - - MPrime.prototype._tmp = function _tmp () { - var tmp = new BN(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - - MPrime.prototype.ireduce = function ireduce (num) { - // Assumes that `num` is less than `P^2` - // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) - var r = num; - var rlen; - - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - if (r.strip !== undefined) { - // r is a BN v4 instance - r.strip(); - } else { - // r is a BN v5 instance - r._strip(); - } - } - - return r; - }; - - MPrime.prototype.split = function split (input, out) { - input.iushrn(this.n, 0, out); - }; - - MPrime.prototype.imulK = function imulK (num) { - return num.imul(this.k); - }; - - function K256 () { - MPrime.call( - this, - 'k256', - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); - } - inherits(K256, MPrime); - - K256.prototype.split = function split (input, output) { - // 256 = 9 * 26 + 22 - var mask = 0x3fffff; - - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs - var prev = input.words[9]; - output.words[output.length++] = prev & mask; - - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - - K256.prototype.imulK = function imulK (num) { - // K = 0x1000003d1 = [ 0x40, 0x3d1 ] - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - - // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 0x3d1; - num.words[i] = lo & 0x3ffffff; - lo = w * 0x40 + ((lo / 0x4000000) | 0); - } - - // Fast length reduction - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - - function P224 () { - MPrime.call( - this, - 'p224', - 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); - } - inherits(P224, MPrime); - - function P192 () { - MPrime.call( - this, - 'p192', - 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); - } - inherits(P192, MPrime); - - function P25519 () { - // 2 ^ 255 - 19 - MPrime.call( - this, - '25519', - '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); - } - inherits(P25519, MPrime); - - P25519.prototype.imulK = function imulK (num) { - // K = 0x13 - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 0x13 + carry; - var lo = hi & 0x3ffffff; - hi >>>= 26; - - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - - // Exported mostly for testing purposes, use plain name instead - BN._prime = function prime (name) { - // Cached version of prime - if (primes[name]) return primes[name]; - - var prime; - if (name === 'k256') { - prime = new K256(); - } else if (name === 'p224') { - prime = new P224(); - } else if (name === 'p192') { - prime = new P192(); - } else if (name === 'p25519') { - prime = new P25519(); - } else { - throw new Error('Unknown prime ' + name); - } - primes[name] = prime; - - return prime; - }; - - // - // Base reduction engine - // - function Red (m) { - if (typeof m === 'string') { - var prime = BN._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - assert(m.gtn(1), 'modulus must be greater than 1'); - this.m = m; - this.prime = null; - } - } - - Red.prototype._verify1 = function _verify1 (a) { - assert(a.negative === 0, 'red works only with positives'); - assert(a.red, 'red works only with red numbers'); - }; - - Red.prototype._verify2 = function _verify2 (a, b) { - assert((a.negative | b.negative) === 0, 'red works only with positives'); - assert(a.red && a.red === b.red, - 'red works only with red numbers'); - }; - - Red.prototype.imod = function imod (a) { - if (this.prime) return this.prime.ireduce(a)._forceRed(this); - - move(a, a.umod(this.m)._forceRed(this)); - return a; - }; - - Red.prototype.neg = function neg (a) { - if (a.isZero()) { - return a.clone(); - } - - return this.m.sub(a)._forceRed(this); - }; - - Red.prototype.add = function add (a, b) { - this._verify2(a, b); - - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.iadd = function iadd (a, b) { - this._verify2(a, b); - - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - - Red.prototype.sub = function sub (a, b) { - this._verify2(a, b); - - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.isub = function isub (a, b) { - this._verify2(a, b); - - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - - Red.prototype.shl = function shl (a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - - Red.prototype.imul = function imul (a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - - Red.prototype.mul = function mul (a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - - Red.prototype.isqr = function isqr (a) { - return this.imul(a, a.clone()); - }; - - Red.prototype.sqr = function sqr (a) { - return this.mul(a, a); - }; - - Red.prototype.sqrt = function sqrt (a) { - if (a.isZero()) return a.clone(); - - var mod3 = this.m.andln(3); - assert(mod3 % 2 === 1); - - // Fast case - if (mod3 === 3) { - var pow = this.m.add(new BN(1)).iushrn(2); - return this.pow(a, pow); - } - - // Tonelli-Shanks algorithm (Totally unoptimized and slow) - // - // Find Q and S, that Q * 2 ^ S = (P - 1) - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert(!q.isZero()); - - var one = new BN(1).toRed(this); - var nOne = one.redNeg(); - - // Find quadratic non-residue - // NOTE: Max is such because of generalized Riemann hypothesis. - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN(2 * z * z).toRed(this); - - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert(i < m); - var b = this.pow(c, new BN(1).iushln(m - i - 1)); - - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - - return r; - }; - - Red.prototype.invm = function invm (a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - - Red.prototype.pow = function pow (a, num) { - if (num.isZero()) return new BN(1).toRed(this); - if (num.cmpn(1) === 0) return a.clone(); - - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = (word >> j) & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; - - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - - return res; - }; - - Red.prototype.convertTo = function convertTo (num) { - var r = num.umod(this.m); - - return r === num ? r.clone() : r; - }; - - Red.prototype.convertFrom = function convertFrom (num) { - var res = num.clone(); - res.red = null; - return res; - }; - - // - // Montgomery method engine - // - - BN.mont = function mont (num) { - return new Mont(num); - }; - - function Mont (m) { - Red.call(this, m); - - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - (this.shift % 26); - } - - this.r = new BN(1).iushln(this.shift); - this.r2 = this.imod(this.r.sqr()); - this.rinv = this.r._invmp(this.m); - - this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); - this.minv = this.minv.umod(this.r); - this.minv = this.r.sub(this.minv); - } - inherits(Mont, Red); - - Mont.prototype.convertTo = function convertTo (num) { - return this.imod(num.ushln(this.shift)); - }; - - Mont.prototype.convertFrom = function convertFrom (num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - - Mont.prototype.imul = function imul (a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.mul = function mul (a, b) { - if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); - - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.invm = function invm (a) { - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; - })(module, bn$1); - } (bn$2)); - return bn$2.exports; -} - -var bnExports = requireBn$1(); -var _BN = /*@__PURE__*/getDefaultExportFromCjs(bnExports); - -let _permanentCensorErrors = false; -let _censorErrors = false; -const LogLevels = { - debug: 1, - default: 2, - info: 2, - warning: 3, - error: 4, - off: 5, -}; -let _logLevel = LogLevels["default"]; -let _globalLogger = null; -function _checkNormalize() { - try { - const missing = []; - // Make sure all forms of normalization are supported - ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { - try { - if ("test".normalize(form) !== "test") { - throw new Error("bad normalize"); - } - } - catch (error) { - missing.push(form); - } - }); - if (missing.length) { - throw new Error("missing " + missing.join(", ")); - } - if (String.fromCharCode(0xe9).normalize("NFD") !== - String.fromCharCode(0x65, 0x0301)) { - throw new Error("broken implementation"); - } - } - catch (error) { - return error.message; - } - return null; -} -const _normalizeError = _checkNormalize(); -var LogLevel; -(function (LogLevel) { - LogLevel["DEBUG"] = "DEBUG"; - LogLevel["INFO"] = "INFO"; - LogLevel["WARNING"] = "WARNING"; - LogLevel["ERROR"] = "ERROR"; - LogLevel["OFF"] = "OFF"; -})(LogLevel || (LogLevel = {})); -var ErrorCode; -(function (ErrorCode) { - /////////////////// - // Generic Errors - // Unknown Error - ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR"; - // Not Implemented - ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED"; - // Unsupported Operation - // - operation - ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION"; - // Network Error (i.e. Core Network, such as an invalid network ID) - // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) - ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR"; - // Some sort of bad response from the server - ErrorCode["SERVER_ERROR"] = "SERVER_ERROR"; - // Timeout - ErrorCode["TIMEOUT"] = "TIMEOUT"; - /////////////////// - // Operational Errors - // Buffer Overrun - ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN"; - // Numeric Fault - // - operation: the operation being executed - // - fault: the reason this faulted - ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT"; - /////////////////// - // Argument Errors - // Missing new operator to an object - // - name: The name of the class - ErrorCode["MISSING_NEW"] = "MISSING_NEW"; - // Invalid argument (e.g. value is incompatible with type) to a function: - // - argument: The argument name that was invalid - // - value: The value of the argument - ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT"; - // Missing argument to a function: - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT"; - // Too many arguments - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT"; - /////////////////// - // Blockchain Errors - // Call exception - // - transaction: the transaction - // - address?: the contract address - // - args?: The arguments passed into the function - // - method?: The Solidity method signature - // - errorSignature?: The EIP848 error signature - // - errorArgs?: The EIP848 error parameters - // - reason: The reason (only for EIP848 "Error(string)") - ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION"; - // Insufficient funds (< value + energyLimit * energyPrice) - // - transaction: the transaction attempted - ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS"; - // Nonce has already been used - // - transaction: the transaction attempted - ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED"; - // The replacement fee for the transaction is too low - // - transaction: the transaction attempted - ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED"; - // The energy limit could not be estimated - // - transaction: the transaction passed to estimateEnergy - ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"] = "UNPREDICTABLE_ENERGY_LIMIT"; - // The transaction was replaced by one with a higher energy price - // - reason: "cancelled", "replaced" or "repriced" - // - cancelled: true if reason == "cancelled" or reason == "replaced") - // - hash: original transaction hash - // - replacement: the full TransactionsResponse for the replacement - // - receipt: the receipt of the replacement - ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; -})(ErrorCode || (ErrorCode = {})); -const HEX = "0123456789abcdef"; -class Logger { - version = "0.0.1"; - static errors = ErrorCode; - static levels = LogLevel; - constructor(version) { - Object.defineProperty(this, "version", { - enumerable: true, - value: version, - writable: false, - }); - } - _log(logLevel, args) { - const level = logLevel.toLowerCase(); - if (LogLevels[level] == null) { - this.throwArgumentError("invalid log level name", "logLevel", logLevel); - } - if (_logLevel > LogLevels[level]) { - return; - } - console.log.apply(console, args); - } - debug(...args) { - this._log(Logger.levels.DEBUG, args); - } - info(...args) { - this._log(Logger.levels.INFO, args); - } - warn(...args) { - this._log(Logger.levels.WARNING, args); - } - makeError(message, code, params) { - // Errors are being censored - if (_censorErrors) { - return this.makeError("censored error", code, {}); - } - if (!code) { - code = Logger.errors.UNKNOWN_ERROR; - } - if (!params) { - params = {}; - } - const messageDetails = []; - Object.keys(params).forEach((key) => { - const value = params[key]; - try { - if (value instanceof Uint8Array) { - let hex = ""; - for (let i = 0; i < value.length; i++) { - hex += HEX[value[i] >> 4]; - hex += HEX[value[i] & 0x0f]; - } - messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); - } - else { - messageDetails.push(key + "=" + JSON.stringify(value)); - } - } - catch (error) { - messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); - } - }); - messageDetails.push(`code=${code}`); - messageDetails.push(`version=${this.version}`); - const reason = message; - if (messageDetails.length) { - message += " (" + messageDetails.join(", ") + ")"; - } - // @TODO: Any?? - const error = new Error(message); - error.reason = reason; - error.code = code; - Object.keys(params).forEach(function (key) { - error[key] = params[key]; - }); - return error; - } - throwError(message, code, params) { - throw this.makeError(message, code, params); - } - throwArgumentError(message, name, value) { - return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { - argument: name, - value: value, - }); - } - assert(condition, message, code, params) { - if (!!condition) { - return; - } - this.throwError(message, code, params); - } - assertArgument(condition, message, name, value) { - if (!!condition) { - return; - } - this.throwArgumentError(message, name, value); - } - checkNormalize(message) { - if (_normalizeError) { - this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "String.prototype.normalize", - form: _normalizeError, - }); - } - } - checkSafeUint53(value, message) { - if (typeof value !== "number") { - return; - } - if (message == null) { - message = "value not safe"; - } - if (value < 0 || value >= 0x1fffffffffffff) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "out-of-safe-range", - value: value, - }); - } - if (value % 1) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "non-integer", - value: value, - }); - } - } - checkArgumentCount(count, expectedCount, message) { - if (message) { - message = ": " + message; - } - else { - message = ""; - } - if (count < expectedCount) { - this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - if (count > expectedCount) { - this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - } - checkNew(target, kind) { - if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - checkAbstract(target, kind) { - if (target === kind) { - this.throwError("cannot instantiate abstract class " + - JSON.stringify(kind.name) + - " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }); - } - else if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - static globalLogger() { - if (!_globalLogger) { - _globalLogger = new Logger("logger/0.0.1"); - } - return _globalLogger; - } - static setCensorship(censorship, permanent) { - if (!censorship && permanent) { - this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - if (_permanentCensorErrors) { - if (!censorship) { - return; - } - this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - _censorErrors = !!censorship; - _permanentCensorErrors = !!permanent; - } - static setLogLevel(logLevel) { - const level = LogLevels[logLevel.toLowerCase()]; - if (level == null) { - Logger.globalLogger().warn("invalid log level - " + logLevel); - return; - } - _logLevel = level; - } - static from(version) { - return new Logger(version); - } -} - -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -const logger$7 = new Logger("utils/properties/0.0.1"); -function checkType(value, type, name) { - const types = type.split("|").map((t) => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof value === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; -} -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); -} -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = types ? types[key] : null; - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { - enumerable: true, - value, - writable: false, - }); - } -} -function checkProperties(object, properties) { - if (!object || typeof object !== "object") { - logger$7.throwArgumentError("invalid object", "object", object); - } - Object.keys(object).forEach((key) => { - if (!properties[key]) { - logger$7.throwArgumentError("invalid object key - " + key, "transaction:" + key, object); - } - }); -} - -/** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -function stringify$1(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[ " + value.map(stringify$1).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return stringify$1(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "number": - return value.toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{ " + - keys.map((k) => `${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ") + - " }"); - } - } - return `[ COULD NOT SERIALIZE ]`; -} -/** - * Returns true if the %%error%% matches an error thrown by corebc - * that matches the error %%code%%. - * - * In TypeScript envornoments, this can be used to check that %%error%% - * matches an corebcError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -function isError(error, code) { - return error && error.code === code; -} -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); -} -/** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ -function makeError(message, code, info) { - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify$1(info)}`); - } - for (const key in info) { - const value = info[key]; - // try { - details.push(key + "=" + stringify$1(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - return error; -} -/** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } -} -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} -function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing arguemnt" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); - assert(count <= expectedCount, "too many arguemnts" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); -} -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; -}, []); -/** - * Throws if the normalization %%form%% is not supported. - */ -function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", - info: { form }, - }); -} -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation, - }); - } -} - -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -const logger$6 = new Logger("utils/data/0.0.1"); -function isHexable(value) { - return !!value.toHexString; -} -function isInteger(value) { - return typeof value === "number" && value == value && value % 1 === 0; -} -function isBytes$1(value) { - if (value == null) { - return false; - } - if (value.constructor === Uint8Array) { - return true; - } - if (typeof value === "string") { - return false; - } - if (!isInteger(value.length) || value.length < 0) { - return false; - } - for (let i = 0; i < value.length; i++) { - const v = value[i]; - if (!isInteger(v) || v < 0 || v >= 256) { - return false; - } - } - return true; -} -function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); -} -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -function getBytes(value, name) { - return _getBytes(value, name, false); -} -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -function getBytesCopy(value, name) { - return _getBytes(value, name, true); -} -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -function isHexString(value, length) { - if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof length === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && value.length % 2 !== 0) { - return false; - } - return true; -} -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -function isBytesLike(value) { - return isHexString(value, true) || value instanceof Uint8Array; -} -const HexCharacters = "0123456789abcdef"; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -function hexlify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "string") { - if (value.includes(",") && value.startsWith("0x")) { - const v = value - .replace("0x", "") - .split(",") - .map((item) => Number(item)); - // @ts-ignore - value = new Uint8Array(v); - } - } - if (typeof value === "number") { - logger$6.checkSafeUint53(value, "invalid hexlify value"); - let hex = ""; - while (value) { - hex = HexCharacters[value & 0xf] + hex; - value = Math.floor(value / 16); - } - if (hex.length) { - if (hex.length % 2) { - hex = "0" + hex; - } - return "0x" + hex; - } - return "0x00"; - } - if (typeof value === "bigint") { - value = value.toString(16); - if (value.length % 2) { - return "0x0" + value; - } - return "0x" + value; - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - return value.toHexString(); - } - if (isHexString(value)) { - if (value.length % 2) { - if (options.hexPad === "left") { - value = "0x0" + value.substring(2); - } - else if (options.hexPad === "right") { - value += "0"; - } - else { - logger$6.throwArgumentError("hex data is odd-length", "value", value); - } - } - return value.toLowerCase(); - } - if (isBytes$1(value)) { - let result = "0x"; - for (let i = 0; i < value.length; i++) { - let v = value[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; - } - return logger$6.throwArgumentError("invalid hexlify value", "value", value); -} -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -function concat(items) { - return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); -} -function hexDataSlice(data, offset, endOffset) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - logger$6.throwArgumentError("invalid hexData", "value", data); - } - offset = 2 + 2 * offset; - return "0x" + data.substring(offset); -} -function hexDataLength(data) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - return null; - } - return (data.length - 2) / 2; -} -/** - * Returns the length of %%data%%, in bytes. - */ -function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; -} -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: bytes.length, - offset: end, - }); - } - return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); -} -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; -} -function zeroPad(data, length, left) { - const bytes = getBytes(data); - assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1, - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -function zeroPadValue(data, length) { - return zeroPad(data, length, true); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -function zeroPadBytes(data, length) { - return zeroPad(data, length, false); -} -function stripZeros(value) { - let result = arrayify(value); - if (result.length === 0) { - return result; - } - // Find the first non-zero entry - let start = 0; - while (start < result.length && result[start] === 0) { - start++; - } - // If we started with zeros, strip them - if (start) { - result = result.slice(start); - } - return result; -} -function arrayify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "number") { - logger$6.checkSafeUint53(value, "invalid arrayify value"); - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value = parseInt(String(value / 256)); - } - if (result.length === 0) { - result.push(0); - } - return new Uint8Array(result); - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - value = value.toHexString(); - } - if (isHexString(value)) { - let hex = value.substring(2); - if (hex.length % 2) { - if (options.hexPad === "left") { - hex = "0x0" + hex.substring(2); - } - else if (options.hexPad === "right") { - hex += "0"; - } - else { - logger$6.throwArgumentError("hex data is odd-length", "value", value); - } - } - const result = []; - for (let i = 0; i < hex.length; i += 2) { - // @ts-ignore - result.push(parseInt(hex.substring(i, i + 2), 16)); - } - return new Uint8Array(result); - } - if (isBytes$1(value)) { - return new Uint8Array(value); - } - return logger$6.throwArgumentError("invalid arrayify value", "value", value); -} -function hexConcat(items) { - let result = "0x"; - items.forEach((item) => { - result += hexlify(item).substring(2); - }); - return result; -} - -var BN = _BN.BN; -const logger$5 = new Logger("bigNumber/0.0.1"); -const _constructorGuard = {}; -const MAX_SAFE = 0x1fffffffffffff; -// Only warn about passing 10 into radix once -let _warnedToStringRadix = false; -class BigNumber { - _hex; - _isBigNumber; - constructor(constructorGuard, hex) { - logger$5.checkNew(new.target, BigNumber); - if (constructorGuard !== _constructorGuard) { - logger$5.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "new (BigNumber)", - }); - } - this._hex = hex; - this._isBigNumber = true; - Object.freeze(this); - } - fromTwos(value) { - return toBigNumber(toBN(this).fromTwos(value)); - } - toTwos(value) { - return toBigNumber(toBN(this).toTwos(value)); - } - abs() { - if (this._hex[0] === "-") { - return BigNumber.from(this._hex.substring(1)); - } - return this; - } - add(other) { - return toBigNumber(toBN(this).add(toBN(other))); - } - sub(other) { - return toBigNumber(toBN(this).sub(toBN(other))); - } - div(other) { - const o = BigNumber.from(other); - if (o.isZero()) { - throwFault("division by zero", "div"); - } - return toBigNumber(toBN(this).div(toBN(other))); - } - mul(other) { - return toBigNumber(toBN(this).mul(toBN(other))); - } - mod(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot modulo negative values", "mod"); - } - return toBigNumber(toBN(this).umod(value)); - } - pow(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot raise to negative values", "pow"); - } - return toBigNumber(toBN(this).pow(value)); - } - and(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'and' negative values", "and"); - } - return toBigNumber(toBN(this).and(value)); - } - or(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'or' negative values", "or"); - } - return toBigNumber(toBN(this).or(value)); - } - xor(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'xor' negative values", "xor"); - } - return toBigNumber(toBN(this).xor(value)); - } - mask(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot mask negative values", "mask"); - } - return toBigNumber(toBN(this).maskn(value)); - } - shl(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shl"); - } - return toBigNumber(toBN(this).shln(value)); - } - shr(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shr"); - } - return toBigNumber(toBN(this).shrn(value)); - } - eq(other) { - return toBN(this).eq(toBN(other)); - } - lt(other) { - return toBN(this).lt(toBN(other)); - } - lte(other) { - return toBN(this).lte(toBN(other)); - } - gt(other) { - return toBN(this).gt(toBN(other)); - } - gte(other) { - return toBN(this).gte(toBN(other)); - } - isNegative() { - return this._hex[0] === "-"; - } - isZero() { - return toBN(this).isZero(); - } - toNumber() { - try { - return toBN(this).toNumber(); - } - catch (error) { - throwFault("overflow", "toNumber", this.toString()); - } - // @ts-ignore - return null; - } - toBigInt() { - try { - return BigInt(this.toString()); - } - catch (e) { } - return logger$5.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, { - value: this.toString(), - }); - } - toString() { - // Lots of people expect this, which we do not support, so check (See: #889) - if (arguments.length > 0) { - if (arguments[0] === 10) { - if (!_warnedToStringRadix) { - _warnedToStringRadix = true; - logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed"); - } - } - else if (arguments[0] === 16) { - logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - else { - logger$5.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - } - return toBN(this).toString(10); - } - toHexString() { - return this._hex; - } - toJSON(key) { - return { type: "BigNumber", hex: this.toHexString() }; - } - static from(value) { - if (value instanceof BigNumber) { - return value; - } - if (typeof value === "string") { - if (value.match(/^-?0x[0-9a-f]+$/i)) { - return new BigNumber(_constructorGuard, toHex(value)); - } - if (value.match(/^-?[0-9]+$/)) { - return new BigNumber(_constructorGuard, toHex(new BN(value))); - } - return logger$5.throwArgumentError("invalid BigNumber string", "value", value); - } - if (typeof value === "number") { - if (value % 1) { - throwFault("underflow", "BigNumber.from", value); - } - if (value >= MAX_SAFE || value <= -MAX_SAFE) { - throwFault("overflow", "BigNumber.from", value); - } - return BigNumber.from(String(value)); - } - const anyValue = value; - if (typeof anyValue === "bigint") { - return BigNumber.from(anyValue.toString()); - } - if (isBytes$1(anyValue)) { - return BigNumber.from(hexlify(anyValue)); - } - if (anyValue) { - // Hexable interface (takes priority) - if (anyValue.toHexString) { - const hex = anyValue.toHexString(); - if (typeof hex === "string") { - return BigNumber.from(hex); - } - } - else { - // For now, handle legacy JSON-ified values (goes away in v6) - let hex = anyValue._hex; - // New-form JSON - if (hex == null && anyValue.type === "BigNumber") { - hex = anyValue.hex; - } - if (typeof hex === "string") { - if (isHexString(hex) || - (hex[0] === "-" && isHexString(hex.substring(1)))) { - return BigNumber.from(hex); - } - } - } - } - return logger$5.throwArgumentError("invalid BigNumber value", "value", value); - } - static isBigNumber(value) { - return !!(value && value._isBigNumber); - } -} -// Normalize the hex string -// @ts-ignore -function toHex(value) { - // For BN, call on the hex string - if (typeof value !== "string") { - return toHex(value.toString(16)); - } - // If negative, prepend the negative sign to the normalized positive value - if (value[0] === "-") { - // Strip off the negative sign - value = value.substring(1); - // Cannot have multiple negative signs (e.g. "--0x04") - if (value[0] === "-") { - logger$5.throwArgumentError("invalid hex", "value", value); - } - // Call toHex on the positive component - value = toHex(value); - // Do not allow "-0x00" - if (value === "0x00") { - return value; - } - // Negate the value - return "-" + value; - } - // Add a "0x" prefix if missing - if (value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - // Normalize zero - if (value === "0x") { - return "0x00"; - } - // Make the string even length - if (value.length % 2) { - value = "0x0" + value.substring(2); - } - // Trim to smallest even-length string - while (value.length > 4 && value.substring(0, 4) === "0x00") { - value = "0x" + value.substring(4); - } - return value; -} -// @ts-ignore -function toBigNumber(value) { - return BigNumber.from(toHex(value)); -} -// @ts-ignore -function toBN(value) { - const hex = BigNumber.from(value).toHexString(); - if (hex[0] === "-") { - return new BN("-" + hex.substring(3), 16); - } - return new BN(hex.substring(2), 16); -} -function throwFault(fault, operation, value) { - const params = { fault: fault, operation: operation }; - if (value != null) { - params.value = value; - } - return logger$5.throwError(fault, Logger.errors.NUMERIC_FAULT, params); -} - -const logger$4 = new Logger("rlp/0.0.1"); -function arrayifyInteger$1(value) { - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function unarrayifyInteger$1(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; -} -function _encode$1(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode$1(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger$1(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - if (!isBytesLike(object)) { - logger$4.throwArgumentError("RLP object must be BytesLike", "object", object); - } - const data = Array.prototype.slice.call(arrayify(object)); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger$1(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); -} -function encode(object) { - return hexlify(_encode$1(object)); -} -function _decodeChildren$1(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode$1(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - if (childOffset > offset + 1 + length) { - logger$4.throwError("child data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - } - return { consumed: 1 + length, result: result }; -} -// returns { consumed: number, result: Object } -function _decode$1(data, offset) { - if (data.length === 0) { - logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - if (offset + 1 + lengthLength > data.length) { - logger$4.throwError("data short segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger$1(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger$4.throwError("data long segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren$1(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - if (offset + 1 + length > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren$1(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - if (offset + 1 + lengthLength > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger$1(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - if (offset + 1 + length > data.length) { - logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlify(data[offset]) }; -} -function decode$1(data) { - const bytes = arrayify(data); - const decoded = _decode$1(bytes, 0); - if (decoded.consumed !== bytes.length) { - logger$4.throwArgumentError("invalid rlp data", "data", data); - } - return decoded.result; -} - -const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))(); -const _32n = /* @__PURE__ */ BigInt(32); -// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high -// }` to match little-endian word order rather than the property names. -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array -// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`. -function split(lst, le = false) { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers -// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below -// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes). -const fromNumH = (n) => (n / 2 ** 32) | 0; -const fromNumL = (n) => n >>> 0; -// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call -// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`. -function setU64FromNum(view, byteOffset, n, isLE) { - const h = fromNumH(n); - const l = fromNumL(n); - view.setUint32(byteOffset, isLE ? l : h, isLE); - view.setUint32(byteOffset + 4, isLE ? h : l, isLE); -} -// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`. -const shrSH = (h, _l, s) => h >>> s; -// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`. -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps -// local copies so V8 inlines them into keccakP. -// Add two split 64-bit words and return the split `{ h, l }` sum. -// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out -// of the low sum and instead use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`. -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`. -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`. -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`. -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`. -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`. -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; - -/** - * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. - * @param a - value to test - * @returns `true` when the value is a Uint8Array-compatible view. - * @example - * Check whether a value is a Uint8Array-compatible view. - * ```ts - * isBytes(new Uint8Array([1, 2, 3])); - * ``` - */ -function isBytes(a) { - // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases. - // The fallback still requires a real ArrayBuffer view, so plain - // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and - // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views. - return (a instanceof Uint8Array || - (ArrayBuffer.isView(a) && - a.constructor.name === 'Uint8Array' && - 'BYTES_PER_ELEMENT' in a && - a.BYTES_PER_ELEMENT === 1)); -} -// Shared error-message prefix builder. Only called on throw paths, so assert -// success paths never pay for the string concatenation. -const atitle = (title) => (title ? `"${title}" ` : ''); -/** - * Asserts something is a non-negative integer. - * @param n - number to validate - * @param title - label included in thrown errors - * @returns The validated number. - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Validate a non-negative integer option. - * ```ts - * anumber(32, 'length'); - * ``` - */ -function anumber(n, title = '') { - if (typeof n !== 'number') - throw new TypeError(atitle(title) + 'expected number, got ' + typeof n); - if (!Number.isSafeInteger(n) || n < 0) - throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n); - return n; -} -/** - * Asserts something is a boolean. - * @param value - value to validate - * @param title - label included in thrown errors - * @returns The validated boolean. - * @throws On wrong argument types. {@link TypeError} - * @example - * Validate a boolean option. - * ```ts - * abool(true, 'enableXOF'); - * ``` - */ -function abool(value, title = '') { - if (typeof value !== 'boolean') - throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value); - return value; -} -/** - * Asserts something is Uint8Array. - * @param value - value to validate - * @param length - optional exact length constraint - * @param title - label included in thrown errors - * @returns The validated byte array. - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Validate that a value is a byte array. - * ```ts - * abytes(new Uint8Array([1, 2, 3])); - * ``` - */ -function abytes(value, length, title = '') { - // Success path first: this runs at the start of every update() / digestInto(), and the - // common `abytes(data)` form must not pay for length handling it does not use. - if (isBytes(value) && (length === undefined)) - return value; - const bytes = isBytes(value); - const ofLen = ''; - const got = bytes ? `length=${value.length}` : `type=${typeof value}`; - const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got; - if (!bytes) - throw new TypeError(message); - throw new RangeError(message); -} -/** - * Asserts something is a wrapped hash constructor. - * @param h - hash constructor to validate - * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError} - * @throws On invalid hash metadata ranges or values. {@link RangeError} - * @throws If the hash metadata allows empty outputs or block sizes. {@link Error} - * @example - * Validate a callable hash wrapper. - * ```ts - * import { ahash } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * ahash(sha256); - * ``` - */ -function ahash(h) { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new TypeError('expected hash wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); - // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass - // validation and can produce empty outputs instead of failing fast. - if (h.outputLen < 1 || h.blockLen < 1) - throw new Error('hash blockLen / outputLen must be >= 1'); -} -const aobject = (value, label) => { - if (value === null || typeof value !== 'object' || Array.isArray(value)) - throw new TypeError((label === 'object' ? '' : `"${label}" `) + 'expected object, got type=' + typeof value); -}; -const aopts = (value, label) => { - aobject(value, label); - const proto = Object.getPrototypeOf(value); - if (proto !== Object.prototype && proto !== null) - throw new TypeError(`"${label}" expected plain object`); - // Object.assign() treats an own "__proto__" source key as a write to the target's legacy - // prototype setter. Reject it before merging so inherited option values cannot be injected. - if (Object.hasOwn(value, '__proto__')) - throw new TypeError(`"${label}.__proto__" is not allowed`); -}; -/** - * Asserts a hash instance has not been destroyed or finished. - * @param instance - hash instance to validate - * @param checkFinished - whether to reject finalized instances - * @throws If the hash instance has already been destroyed or finalized. {@link Error} - * @example - * Validate that a hash instance is still usable. - * ```ts - * import { aexists } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const hash = sha256.create(); - * aexists(hash); - * ``` - */ -function aexists(instance, checkFinished = true) { - // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their - // truthiness is checked - re-validating their type per call was pure hot-path overhead. - if (instance.destroyed) - throw new Error('hash was destroyed'); - if (checkFinished && instance.finished) - throw new Error('digest() was already called'); -} -/** - * Asserts output is a sufficiently-sized byte array. - * @param out - destination buffer - * @param instance - hash instance providing output length - * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes. - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Validate a caller-provided digest buffer. - * ```ts - * import { aoutput } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const hash = sha256.create(); - * aoutput(new Uint8Array(hash.outputLen), hash); - * ``` - */ -function aoutput(out, instance) { - abytes(out, undefined, 'output'); - // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast - // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call. - const min = instance.outputLen; - if (!(out.length >= min)) { - throw new RangeError('"output" expected length >= ' + min); - } -} -/** - * Casts a typed array view to Uint32Array. - * `arr.byteOffset` must already be 4-byte aligned or the platform - * Uint32Array constructor will throw. - * @param arr - source typed array - * @returns Uint32Array view over the same buffer. - * @example - * Reinterpret a byte array as 32-bit words. - * ```ts - * u32(new Uint8Array(8)); - * ``` - */ -function u32(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} -/** - * Zeroizes typed arrays in place. Warning: JS provides no guarantees. - * @param arrays - arrays to overwrite with zeros - * @example - * Zeroize sensitive buffers in place. - * ```ts - * clean(new Uint8Array([1, 2, 3])); - * ``` - */ -function clean(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} -/** - * Creates a DataView for byte-level manipulation. - * @param arr - source typed array - * @returns DataView over the same buffer region. - * @example - * Create a DataView over an existing buffer. - * ```ts - * createView(new Uint8Array(4)); - * ``` - */ -function createView(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** - * Rotate-right operation for uint32 values. - * @param word - source word - * @param shift - shift amount in bits - * @returns Rotated word. - * @example - * Rotate a 32-bit word to the right. - * ```ts - * rotr(0x12345678, 8); - * ``` - */ -function rotr(word, shift) { - return (word << (32 - shift)) | (word >>> shift); -} -/** - * Rotate-left operation for uint32 values. - * @param word - source word - * @param shift - shift amount in bits - * @returns Rotated word. - * @example - * Rotate a 32-bit word to the left. - * ```ts - * rotl(0x12345678, 8); - * ``` - */ -function rotl(word, shift) { - return (word << shift) | ((word >>> (32 - shift)) >>> 0); -} -/** Whether the current platform is little-endian. */ -const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); -/** - * Byte-swap operation for uint32 values. - * @param word - source word - * @returns Word with reversed byte order. - * @example - * Reverse the byte order of a 32-bit word. - * ```ts - * byteSwap(0x11223344); - * ``` - */ -function byteSwap(word) { - return (((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff)); -} -/** - * Byte-swaps every word of a Uint32Array in place. - * @param arr - array to mutate - * @returns The same array after mutation; callers pass live state arrays here. - * @example - * Reverse the byte order of every word in place. - * ```ts - * byteSwap32(new Uint32Array([0x11223344])); - * ``` - */ -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } - return arr; -} -/** - * Conditionally byte-swaps a Uint32Array on big-endian platforms. - * @param u - array to normalize for host endianness - * @returns Original or byte-swapped array depending on platform endianness. - * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`. - * @example - * Normalize a word array for host endianness. - * ```ts - * swap32IfBE(new Uint32Array([0x11223344])); - * ``` - */ -const swap32IfBE = isLE - ? (u) => u - : byteSwap32; -/** - * Yields to the host task scheduler so timers, I/O, and rendering can make progress. - * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback. - * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so - * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while - * still allowing other event-loop work to proceed. - * @param onReject - optional cleanup invoked only if the host yield fails - * @example - * Yield to the next scheduler tick. - * ```ts - * await nextTick(); - * ``` - */ -function nextTick(onReject) { - const host = globalThis; - if (typeof host.scheduler?.yield === 'function') { - const promise = host.scheduler.yield(); - // Keep the original scheduler rejection; this handler exists only for cleanup. - if (onReject) - promise.catch(onReject); - return promise; - } - return new Promise((resolve) => host.setTimeout(resolve, 0)); -} -/** - * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops. - * @param iters - number of loop iterations to run - * @param tick - maximum time slice in milliseconds - * @param cb - callback executed on each iteration - * @param onReject - optional cleanup invoked only if a host yield fails - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Run a loop that periodically yields back to the event loop. - * ```ts - * await asyncLoop(2, 0, () => {}); - * ``` - */ -async function asyncLoop(iters, tick, cb, onReject) { - anumber(iters, 'iters'); - anumber(tick, 'tick'); - if (typeof cb !== 'function') - throw new TypeError('callback must be a function'); - // Callback is synchronous by contract; asyncLoop only yields between sync work windows. - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(onReject); - // Track only synchronous work time; scheduler delay after yielding is outside our budget. - ts = Date.now(); - } -} -/** - * Converts string to bytes using UTF8 encoding. - * Built-in doesn't validate input to be string: we do the check. - * Non-ASCII details are delegated to the platform `TextEncoder`. - * @param str - string to encode - * @returns UTF-8 encoded bytes. - * @throws On wrong argument types. {@link TypeError} - * @example - * Encode a string as UTF-8 bytes. - * ```ts - * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99]) - * ``` - */ -function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new TypeError('string expected'); - const encoded = new TextEncoder().encode(str); - try { - // Copy into the current realm for Firefox extension contexts. Callers that own the returned - // buffer can then wipe it independently of TextEncoder's temporary result. - return new Uint8Array(encoded); // https://bugzil.la/1681809 - } - finally { - clean(encoded); - } -} -/** - * Helper for KDFs: consumes Uint8Array or string. - * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer. - * @param data - user-provided KDF input - * @param errorTitle - label included in thrown errors - * @returns Byte representation of the input. - * @throws On wrong argument types. {@link TypeError} - * @example - * Normalize KDF input to bytes. - * ```ts - * kdfInputToBytes('password'); - * ``` - */ -function kdfInputToBytes(data, errorTitle = '') { - if (typeof data === 'string') - return utf8ToBytes(data); - return abytes(data, undefined, errorTitle); -} -/** - * Merges default options and passed options. - * @param defaults - base option object - * @param opts - user overrides - * @param title - label included in thrown override errors - * @returns Fresh merged option object with a null prototype. - * @throws On wrong argument types. {@link TypeError} - * @example - * Merge user overrides onto default options. - * ```ts - * checkOpts({ dkLen: 32 }, { asyncTick: 10 }); - * ``` - */ -function checkOpts(defaults, opts, title = 'opts') { - aopts(defaults, 'defaults'); - if (opts !== undefined) - aopts(opts, title); - // Callers read optional fields directly, so omitted values must not fall through to ambient - // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output). - const merged = Object.assign(Object.create(null), defaults, opts); - return merged; -} -/** - * Creates a callable hash function from a stateful class constructor. - * @param hashCons - hash constructor or factory - * @param info - optional metadata such as DER OID - * @returns Frozen callable hash wrapper with `.create()`. - * Wrapper construction eagerly calls `hashCons(undefined)` once to read - * `outputLen` / `blockLen`, so constructor side effects happen at module - * init time. - * @throws On wrong argument types. {@link TypeError} - * @example - * Wrap a stateful hash constructor into a callable helper. - * ```ts - * import { createHasher } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const wrapped = createHasher(sha256.create, { oid: sha256.oid }); - * wrapped(new Uint8Array([1])); - * ``` - */ -function createHasher(hashCons, info = {}) { - if (typeof hashCons !== 'function') - throw new TypeError('"hashCons" expected function, got type=' + typeof hashCons); - info = checkOpts({}, info, 'info'); - const hashC = (msg, opts) => hashCons(opts) - .update(msg) - .digest(); - const tmp = hashCons(undefined); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.canXOF = tmp.canXOF; - hashC.create = (opts) => hashCons(opts); - Object.assign(hashC, info); - return Object.freeze(hashC); -} -/** - * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`. - * @param suffix - final OID byte for the selected hash. - * The helper accepts any byte even though only the documented NIST hash - * suffixes are meaningful downstream. - * @returns Object containing the DER-encoded OID. - * @example - * Build OID metadata for a NIST hash. - * ```ts - * oidNist(0x01); - * ``` - */ -const oidNist = (suffix) => ({ - // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet. - // Larger suffix values would need base-128 OID encoding and a different length byte. - oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]), -}); - -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -/** - * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`. - * Returns bits from `b` when `a` is set, otherwise from `c`. - * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never - * set the same bit. - * @param a - selector word - * @param b - word chosen when selector bit is set - * @param c - word chosen when selector bit is clear - * @returns Mixed 32-bit word. - * @example - * Combine three words with the shared 32-bit choice primitive. - * ```ts - * Chi(0xffffffff, 0x12345678, 0x87654321); - * ``` - */ -function Chi(a, b, c) { - return (a & b) ^ (~a & c); -} -/** - * Shared 32-bit majority primitive reused by SHA-256 and SHA-1. - * Returns bits shared by at least two inputs. - * @param a - first input word - * @param b - second input word - * @param c - third input word - * @returns Mixed 32-bit word. - * @example - * Combine three words with the shared 32-bit majority primitive. - * ```ts - * Maj(0xffffffff, 0x12345678, 0x87654321); - * ``` - */ -function Maj(a, b, c) { - return (a & b) ^ (a & c) ^ (b & c); -} -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit - * strings with partial-byte tails. - * @param blockLen - internal block size in bytes - * @param outputLen - digest size in bytes - * @param padOffset - trailing length field size in bytes - * @param isLE - whether length and state words are encoded in little-endian - * @example - * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow. - * ```ts - * import { _SHA1 } from '@noble/hashes/legacy.js'; - * const hash = new _SHA1(); - * hash.update(new Uint8Array([97, 98, 99])); - * hash.digest(); - * ``` - */ -class HashMD { - blockLen; - outputLen; - canXOF = false; - padOffset; - isLE; - // For partial updates less than block size - buffer; - view; - finished = false; - length = 0; - pos = 0; - destroyed = false; - constructor(blockLen, outputLen, padOffset, isLE) { - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - aexists(this); - abytes(data); - const { view, buffer, blockLen } = this; - const len = data.length; - let processed = false; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path only when there is no buffered partial block: `take === blockLen` implies - // `this.pos === 0`, so we can process full blocks directly from the input view. - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - processed = true; - continue; - } - // When the whole input is buffered in one go (common for short messages), passing `data` - // directly avoids allocating a subarray view. - buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - processed = true; - } - } - this.length += data.length; - // Shared schedule buffers only pick up input-derived words inside process(); if everything - // was buffered without processing, there is nothing to zero. - if (processed) - this.roundClean(); - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message, then zero-pad the rest of the block - buffer[pos++] = 0b10000000; - buffer.fill(0, pos); - // we have less than padOffset left in buffer, so we cannot put length in - // current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - buffer.fill(0); - } - // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from - // the padding fill above, and JS will overflow before user input can make that half non-zero. - // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an - // integer below 2**53, so the split inside the helper stays exact). - setU64FromNum(view, blockLen - 8, this.length * 8, isLE); - this.process(view, 0); - // The final block above is processed outside update(), so the shared message-schedule - // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest(). - this.roundClean(); - // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one. - const oview = out === buffer ? view : createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT - const outLen = len / 4; - const state = this.get(); - // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state. - if (len % 4 || outLen > state.length) - throw new Error('invalid outputLen'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return - // fresh bytes to the caller. - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneIntoMeta(to) { - const { buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and - // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it. - if (pos) - to.buffer.set(buffer); // Avoid a hot modulo guard. - return to; - } - clone() { - return this._cloneInto(); - } -} -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ -/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the - * square roots of the first eight prime numbers. Exported as a shared table; callers must treat - * it as read-only because constructors copy words from it by index. */ -const SHA256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, -]); -/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen - * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first - * eight prime numbers. Exported as a shared table; callers must treat it as read-only because - * constructors copy halves from it by index. */ -const SHA512_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, -]); - -/** - -SHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions. -RFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors, -not the base RIPEMD-160 compression spec. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151 - * @module - */ -// RIPEMD-160 -// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables. -const Rho160 = /* @__PURE__ */ Uint8Array.from([ - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, -]); -const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); -const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); -// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds. -const idxLR = /* @__PURE__ */ (() => { - const L = [Id160]; - const R = [Pi160]; - const res = [L, R]; - for (let i = 0; i < 4; i++) - for (let j of res) - j.push(j[i].map((k) => Rho160[k])); - return res; -})(); -const idxL = /* @__PURE__ */ (() => idxLR[0])(); -const idxR = /* @__PURE__ */ (() => idxLR[1])(); -// const [idxL, idxR] = idxLR; -// Base per-group shift table before the left/right message-order permutations are applied. -const shifts160 = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => Uint8Array.from(i)); -const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); -const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); -// Five left-lane additive constants for RIPEMD-160. -const Kl160 = /* @__PURE__ */ Uint32Array.from([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -// Five right-lane additive constants for RIPEMD-160. -const Kr160 = /* @__PURE__ */ Uint32Array.from([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range -// inputs currently fall through to the group-4 branch. -function ripemd_f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - if (group === 1) - return (x & y) | (~x & z); - if (group === 2) - return (x | ~y) ^ z; - if (group === 3) - return (x & z) | (y & ~z); - return x ^ (y | ~z); -} -// Reusable 16-word RIPEMD-160 message block buffer. -const BUF_160 = /* @__PURE__ */ new Uint32Array(16); -/** - * Internal RIPEMD-160 legacy hash class. - * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification. - */ -class _RIPEMD160 extends HashMD { - h0 = 0x67452301 | 0; - h1 = 0xefcdab89 | 0; - h2 = 0x98badcfe | 0; - h3 = 0x10325476 | 0; - h4 = 0xc3d2e1f0 | 0; - constructor() { - super(64, 20, 8, true); - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - _cloneInto(to) { - (to ||= new this.constructor()).set(...this.get()); - return this._cloneIntoMeta(to); - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF_160[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order. - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - clean(BUF_160); - } - destroy() { - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0); - } -} -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point - * at the base RIPEMD-160 references. - * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html} - * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf} - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with RIPEMD-160. - * ```ts - * ripemd160(new Uint8Array([97, 98, 99])); - * ``` - */ -const ripemd160$1 = /* @__PURE__ */ createHasher(() => new _RIPEMD160()); - -/** - * HMAC: RFC2104 message authentication code. - * @module - */ -/** - * Internal class for HMAC. - * Accepts any byte key, although RFC 2104 §3 recommends keys at least - * `HashLen` bytes long. - */ -class _HMAC { - oHash; - iHash; - blockLen; - outputLen; - canXOF = false; - finished = false; - destroyed = false; - constructor(hash, key) { - ahash(hash); - abytes(key, undefined, 'key'); - this.iHash = hash.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('expected Hash instance'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of the first block) of the outer hash here, - // we can re-use it between multiple calls via clone. - this.oHash = hash.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - clean(pad); - } - update(buf) { - aexists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - const buf = out.subarray(0, this.outputLen); - // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before - // overwriting that same prefix with the final tag, leaving any oversized tail untouched. - this.iHash.digestInto(buf); - this.oHash.update(buf); - this.oHash.digestInto(buf); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since the key - // is already in state and we don't know it. - to ||= Object.create(Object.getPrototypeOf(this), {}); - const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.canXOF = canXOF; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - clone() { - return this._cloneInto(); - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } -} -const hmac$1 = /* @__PURE__ */ (() => { - const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest()); - hmac_.create = (hash, key) => new _HMAC(hash, key); - return hmac_; -})(); - -/** - * PBKDF (RFC 2898). Can be used to create a key from password and salt. - * @module - */ -// Common validation and per-call state setup for sync/async functions. -function pbkdf2Init(hash, _password, _salt, _opts) { - ahash(hash); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - anumber(c, 'c'); - anumber(dkLen, 'dkLen'); - anumber(asyncTick, 'asyncTick'); - if (c < 1) - throw new Error('"c" (iterations) must be >= 1'); - // RFC 8018 §5.2 defines `dkLen` as "a positive integer". - if (dkLen < 1) - throw new Error('"dkLen" must be >= 1'); - // RFC 8018 §5.2 step 1 requires rejecting oversize `dkLen` - // before allocating the destination buffer. - if (dkLen > (2 ** 32 - 1) * hash.outputLen) - throw new Error('derived key too long'); - const p = kdfInputToBytes(_password, 'password'); - try { - const s = kdfInputToBytes(_salt, 'salt'); - try { - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - const { iHash, oHash, outputLen } = hmac$1.create(hash, p); - // Drive keyed hashes directly; the wrapper is only needed to initialize their HMAC midstates. - const u = new Uint8Array(outputLen); - const eng = pbkdf2Engine(iHash, oHash, s, u); - return { c, dkLen, asyncTick, DK, outputLen, eng }; - } - finally { - // Uint8Array inputs belong to the caller; only wipe our UTF-8 conversion. - if (typeof _salt === 'string') - clean(s); - } - } - finally { - if (typeof _password === 'string') - clean(p); - } -} -// Per-call PRF driver writes U1 into both `u` and `Ti`, then later digests into `u`; -// shared by the sync and async variants. -function pbkdf2Engine(iHash, oHash, salt, u) { - const counter = new Uint8Array(4); - const view = createView(counter); - // Full clones retain tree/config state; absorb salt before async yields without cloning input. - const salted = iHash._cloneInto().update(salt); - // u1() overwrites the worker before reading it. Seed from the outer midstate so a long salt - // cannot pre-populate a tree stack that the first reset would abandon without wiping. - const work = oHash._cloneInto(); - const iClone = iHash._cloneInto; // Capture before mixed feedback can materialize state tuples. - const oClone = oHash._cloneInto; - return { - u1: (ti, Ti) => { - view.setInt32(0, ti, false); - salted._cloneInto(work).update(counter).digestInto(u); - oHash._cloneInto(work).update(u).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - }, - // Whole `F` inner loop for the sync variant: one optimized function owns the hot loop. - rounds: (c, Ti) => { - for (let ui = 1; ui < c; ui++) { - iClone.call(iHash, work).update(u).digestInto(u); - oClone.call(oHash, work).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - }, - output: (DK) => { - // Keyed templates and derived worker states are secret material. - iHash.destroy(); - oHash.destroy(); - salted.destroy(); - work.destroy(); - // Shared sync/async cleanup point: wipe transient PRF state - // while preserving the derived key buffer. - clean(u); - return DK; - }, - }; -} -/** - * PBKDF2-HMAC: RFC 8018 key derivation function. - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated; - * JS string inputs are UTF-8 encoded first - * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first - * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided, - * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}. - * @returns Derived key bytes. - * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error} - * @example - * PBKDF2-HMAC: RFC 2898 key derivation function. - * ```ts - * import { pbkdf2 } from '@noble/hashes/pbkdf2.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - * ``` - */ -function pbkdf2$3(hash, password, salt, opts) { - const { c, dkLen, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) { - // Ti = F(Password, Salt, c, i) - // The last Ti view can be shorter than hLen, which applies - // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies. - const Ti = DK.subarray(pos, pos + outputLen); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - eng.u1(ti, Ti); - // Uc = PRF(Password, Uc−1); Ti ^= Uc - eng.rounds(c, Ti); - } - return eng.output(DK); -} - -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and - * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}. - * @module - */ -/** - * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits - * of the cube roots of the first 64 primes (2..311). - */ -// prettier-ignore -const SHA256_K = /* @__PURE__ */ Uint32Array.from([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */ -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */ -class SHA2_32B extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // Numeric initializers matter: starting the fields as `undefined` changes - // V8's field representation and makes sha256 3x slower (measured). - A = 0; - B = 0; - C = 0; - D = 0; - E = 0; - F = 0; - G = 0; - H = 0; - constructor(outputLen, IV) { - super(64, outputLen, 8, false); - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - _cloneInto(to) { - (to ||= new this.constructor()).set(...this.get()); - return this._cloneIntoMeta(to); - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - clean(SHA256_W); - } - destroy() { - // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves - // update()/digest() callable on reused instances. - this.destroyed = true; - this.set(0, 0, 0, 0, 0, 0, 0, 0); - clean(this.buffer); - } -} -/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */ -class _SHA256 extends SHA2_32B { - constructor() { - super(32, SHA256_IV); - } -} -// SHA2-512 is slower than sha256 in js because u64 operations are slow. -// SHA-384 / SHA-512 round constants from RFC 6234 §5.2: -// 80 full 64-bit words split into high/low halves. -// prettier-ignore -const K512 = /* @__PURE__ */ (() => split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); -const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); -// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */ -class SHA2_64B extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // h -- high 32 bits, l -- low 32 bits - // Numeric initializers matter: starting the fields as `undefined` changes - // V8's field representation and slows hashing down (measured on sha256). - Ah = 0; - Al = 0; - Bh = 0; - Bl = 0; - Ch = 0; - Cl = 0; - Dh = 0; - Dl = 0; - Eh = 0; - El = 0; - Fh = 0; - Fl = 0; - Gh = 0; - Gl = 0; - Hh = 0; - Hl = 0; - constructor(outputLen, IV) { - super(128, outputLen, 16, false); - this.Ah = IV[0] | 0; - this.Al = IV[1] | 0; - this.Bh = IV[2] | 0; - this.Bl = IV[3] | 0; - this.Ch = IV[4] | 0; - this.Cl = IV[5] | 0; - this.Dh = IV[6] | 0; - this.Dl = IV[7] | 0; - this.Eh = IV[8] | 0; - this.El = IV[9] | 0; - this.Fh = IV[10] | 0; - this.Fl = IV[11] | 0; - this.Gh = IV[12] | 0; - this.Gl = IV[13] | 0; - this.Hh = IV[14] | 0; - this.Hl = IV[15] | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - _cloneInto(to) { - (to ||= new this.constructor()).set(...this.get()); - return this._cloneIntoMeta(to); - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7); - const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6); - const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6); - // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16]; - const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41); - const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39); - const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = add3L(T1l, sigma0l, MAJl); - Ah = add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - clean(SHA512_W_H, SHA512_W_L); - } - destroy() { - // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves - // update()/digest() callable on reused instances. - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */ -class _SHA512 extends SHA2_64B { - constructor() { - super(64, SHA512_IV); - } -} -/** - * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info: - * - * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack. - * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - Each sha256 hash is executing 2^18 bit operations. - * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA2-256. - * ```ts - * sha256(new Uint8Array([97, 98, 99])); - * ``` - */ -const sha256$2 = /* @__PURE__ */ createHasher(() => new _SHA256(), -/* @__PURE__ */ oidNist(0x01)); -/** - * SHA2-512 hash function from RFC 4634. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA2-512. - * ```ts - * sha512(new Uint8Array([97, 98, 99])); - * ``` - */ -const sha512$1 = /* @__PURE__ */ createHasher(() => new _SHA512(), -/* @__PURE__ */ oidNist(0x03)); - -/** - * SHA3 (keccak) hash function, based on a new "Sponge function" design. - * Different from older hashes, the internal state is bigger than output size. - * - * Check out - * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202}, - * {@link https://keccak.team/keccak.html | Website}, and - * {@link https://crypto.stackexchange.com/q/15727 | the differences between - * SHA-3 and Keccak}. - * - * Check out `sha3-addons` module for cSHAKE, k12, and others. - * @module - */ -// No __PURE__ annotations in sha3 header: -// EVERYTHING is in fact used on every export. -// Various per round constants calculations -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const _7n = BigInt(7); -const _256n = BigInt(256); -// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors -// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`. -const _0x71n = BigInt(0x71); -const SHA3_PI = []; -const SHA3_ROTL = []; -const _SHA3_IOTA = []; // no pure annotation: var is always used -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const IOTAS = split(_SHA3_IOTA, true); -// `split(..., true)` keeps the local little-endian lane-word layout used by -// `state32`, so these `H` / `L` tables follow the file's first-word / -// second-word lane slots rather than `_u64.ts`'s usual high/low naming. -const SHA3_IOTA_H = IOTAS[0]; -const SHA3_IOTA_L = IOTAS[1]; -// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can -// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only -// consumer of left-rotates; other hashes use right-rotates from _u64. -// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64. -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); -// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2. -// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation. -const B = new Uint32Array(5 * 2); -/** - * `keccakf1600` internal permutation, additionally allows adjusting the round count. - * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words - * in this file's local little-endian lane-word order - * @param rounds - number of rounds to execute - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @throws If `rounds` is outside the supported `1..24` range. {@link Error} - * @example - * Permute a Keccak state with the default 24 rounds. - * ```ts - * keccakP(new Uint32Array(50)); - * ``` - */ -function keccakP(s, rounds = 24) { - if (!(s instanceof Uint32Array)) - throw new TypeError('"s" expected Uint32Array(50), got type=' + typeof s); - if (s.length !== 50) - throw new RangeError('"s" expected Uint32Array(50), got length=' + s.length); - anumber(rounds, 'rounds'); - // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table. - if (rounds < 1 || rounds > 24) - throw new Error('"rounds" expected integer 1..24'); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - // Same as: - // for (let x = 0; x < 10; x++) B[x] = s[y + x]; - // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - for (let y = 0; y < 50; y += 10) { - const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3]; - s[y] ^= ~s[y + 2] & s[y + 4]; - s[y + 1] ^= ~s[y + 3] & s[y + 5]; - s[y + 2] ^= ~s[y + 4] & s[y + 6]; - s[y + 3] ^= ~s[y + 5] & s[y + 7]; - s[y + 4] ^= ~s[y + 6] & s[y + 8]; - s[y + 5] ^= ~s[y + 7] & s[y + 9]; - s[y + 6] ^= ~s[y + 8] & b0; - s[y + 7] ^= ~s[y + 9] & b1; - s[y + 8] ^= ~b0 & b2; - s[y + 9] ^= ~b1 & b3; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - clean(B); -} -/** - * Keccak sponge function. - * @param blockLen - absorb/squeeze rate in bytes - * @param suffix - domain separation suffix byte - * @param outputLen - default digest length in bytes. This base sponge only - * requires a non-negative integer; wrappers that need positive output - * lengths must enforce that themselves. - * @param enableXOF - whether XOF output is allowed - * @param rounds - number of Keccak-f rounds - * @example - * Build a sponge state, absorb bytes, then finalize a digest. - * ```ts - * const hash = new Keccak(136, 0x06, 32); - * hash.update(new Uint8Array([1, 2, 3])); - * hash.digest(); - * ``` - */ -class Keccak { - state; - pos = 0; - posOut = 0; - finished = false; - state32; - destroyed = false; - blockLen; - suffix; - outputLen; - canXOF; - enableXOF = false; - rounds; - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - anumber(blockLen, 'blockLen'); - anumber(suffix, 'suffix'); - anumber(rounds, 'rounds'); - abool(enableXOF, 'enableXOF'); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.canXOF = enableXOF; - this.rounds = rounds; - // Can be passed from user as dkLen - anumber(outputLen, 'outputLen'); - // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state. - if (!(0 < blockLen && blockLen < 200)) - throw new Error('"blockLen" must be 1..199'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - clone() { - return this._cloneInto(); - } - keccak() { - swap32IfBE(this.state32); - keccakP(this.state32, this.rounds); - swap32IfBE(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data) { - aexists(this); - abytes(data); - const { blockLen, state, state32 } = this; - const len = data.length; - // Absorb full blocks with u32 XORs when both sides are 4-byte aligned. - // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe. - const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0; - const blockLen32 = blockLen / 4; - const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined; - for (let pos = 0; pos < len;) { - if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) { - for (let i = 0, o = pos / 4; i < blockLen32; i++) - state32[i] ^= data32[o + i]; - pos += blockLen; - // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override, - // so it must reflect the fully-absorbed block before the permutation fires. - this.pos = blockLen; - this.keccak(); - continue; - } - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1. - // These byte values already include the first padding bit, while the - // final `0x80` below supplies the closing `1` bit in the last rate byte. - state[pos] ^= suffix; - // If that combined suffix lands in the last rate byte and already sets - // bit 7, absorb it first so the final pad10*1 bit can be xored into a - // fresh block. - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - aexists(this, false); - abytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base - // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/ - // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF. - if (!this.enableXOF) - throw new Error('XOF is not enabled'); - return this.writeInto(out); - } - xof(bytes) { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - aoutput(out, this); - if (this.finished) - throw new Error('digest() was already called'); - // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest. - this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen)); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.outputLen); - this.digestInto(out); - return out; - } - destroy() { - this.destroyed = true; - clean(this.state); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); - // Reused destinations can come from a different rate/capacity variant, so clone must rewrite - // the sponge geometry as well as the state words. - to.blockLen = blockLen; - to.state32.set(this.state32); - // Sponge padding and XOF output are positional, so both offsets are part of the clone state. - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone - // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie. - to.canXOF = this.canXOF; - to.destroyed = this.destroyed; - return to; - } -} -const genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info); -/** - * SHA3-256 hash function. Different from keccak-256. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA3-256. - * ```ts - * sha3_256(new Uint8Array([97, 98, 99])); - * ``` - */ -const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, -/* @__PURE__ */ oidNist(0x08)); -/** - * SHA3-512 hash function. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA3-512. - * ```ts - * sha3_512(new Uint8Array([97, 98, 99])); - * ``` - */ -const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, -/* @__PURE__ */ oidNist(0x0a)); -/** - * Keccak-256 hash function. Different from SHA3-256. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with Keccak-256. - * ```ts - * keccak_256(new Uint8Array([97, 98, 99])); - * ``` - */ -const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32); - -/*! - * assert.js - assert for bcrypto - * Copyright (c) 2020, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var assert_1; -var hasRequiredAssert; - -function requireAssert () { - if (hasRequiredAssert) return assert_1; - hasRequiredAssert = 1; - - /* - * Assert - */ - - function assert(val, msg) { - if (!val) { - const err = new Error(msg || 'Assertion failed'); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, assert); - - throw err; - } - } - - /* - * Expose - */ - - assert_1 = assert; - return assert_1; -} - -var customBrowser = {}; - -/*! - * custom.js - custom inspect symbol for bcrypto - * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var hasRequiredCustomBrowser; - -function requireCustomBrowser () { - if (hasRequiredCustomBrowser) return customBrowser; - hasRequiredCustomBrowser = 1; - - customBrowser.custom = 'inspect'; - return customBrowser; -} - -var bn; -var hasRequiredBn; - -function requireBn () { - if (hasRequiredBn) return bn; - hasRequiredBn = 1; - - const {custom} = requireCustomBrowser(); - - /* - * Constants - */ - - const zeros = [ - '', - '0', - '00', - '000', - '0000', - '00000', - '000000', - '0000000', - '00000000', - '000000000', - '0000000000', - '00000000000', - '000000000000', - '0000000000000', - '00000000000000', - '000000000000000', - '0000000000000000', - '00000000000000000', - '000000000000000000', - '0000000000000000000', - '00000000000000000000', - '000000000000000000000', - '0000000000000000000000', - '00000000000000000000000', - '000000000000000000000000', - '0000000000000000000000000' - ]; - - const groupSizes = [ - 0x00, 0x19, 0x10, 0x0c, 0x0b, 0x0a, - 0x09, 0x08, 0x08, 0x07, 0x07, 0x07, - 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 - ]; - - const groupBases = [ - 0x00000000, 0x02000000, 0x0290d741, 0x01000000, - 0x02e90edd, 0x039aa400, 0x0267bf47, 0x01000000, - 0x0290d741, 0x00989680, 0x012959c3, 0x0222c000, - 0x03bd7765, 0x0072e440, 0x00adcea1, 0x01000000, - 0x01704f61, 0x0206fc40, 0x02cddcf9, 0x03d09000, - 0x003e5185, 0x004ea360, 0x006235f7, 0x00798000, - 0x009502f9, 0x00b54ba0, 0x00daf26b, 0x01069c00, - 0x0138f9ad, 0x0172c9e0, 0x01b4d89f, 0x02000000, - 0x025528a1, 0x02b54a20, 0x03216b93, 0x039aa400 - ]; - - const primes = { - p192: null, - p224: null, - p521: null, - k256: null, - p251: null, - p25519: null, - p448: null - }; - - const modes = { - NONE: 0, - QUO: 1, - REM: 2, - BOTH: 3, - EUCLID: 4, - ALL: 7 - }; - - const WND_WIDTH = 4; - const WND_SIZE = 1 << (WND_WIDTH - 1); - - const HAS_BIGINT = typeof BigInt === 'function'; - - /** - * BN - */ - - class BN { - constructor(num, base, endian) { - this.words = [0]; - this.length = 1; - this.negative = 0; - this.red = null; - this.from(num, base, endian); - } - - /* - * Addition Engine - */ - - _iadd(a, b) { - let carry = 0; - let i = 0; - - // a.length > b.length - if (a.length < b.length) - [a, b] = [b, a]; - - if (a !== this) - this._alloc(a.length); - - for (; i < b.length; i++) { - const r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - - this.words[i] = r & 0x3ffffff; - - carry = r >>> 26; - } - - for (; carry !== 0 && i < a.length; i++) { - const r = (a.words[i] | 0) + carry; - - this.words[i] = r & 0x3ffffff; - - carry = r >>> 26; - } - - this.length = a.length; - - if (carry !== 0) { - this._alloc(this.length + 1); - this.words[this.length++] = carry; - } else if (a !== this) { - // Copy the rest of the words. - for (; i < a.length; i++) - this.words[i] = a.words[i]; - } - - // Note: we shouldn't need to strip here. - return this; - } - - _iaddn(num) { - this.words[0] += num; - - if (this.words[0] < 0x4000000) - return this; - - // Carry. - let i = 0; - - this._alloc(this.length + 1); - - this.words[this.length] = 0; - - for (; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - this.words[i + 1] += 1; - } - - this.length = Math.max(this.length, i + 1); - - // Note: we shouldn't need to strip here. - return this; - } - - /* - * Addition - */ - - iadd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.negative === num.negative) { - // x + y == x + y - // (-x) + (-y) == -(x + y) - this._iadd(this, num); - } else { - // x + (-y) == x - y == -(y - x) - // (-x) + y == y - x == -(x - y) - const cmp = this.ucmp(num); - - // x + (-x) == (-x) + x == 0 - if (cmp === 0) { - this.words[0] = 0; - this.length = 1; - this.negative = 0; - return this; - } - - if (cmp < 0) { - this._isub(num, this); - this.negative ^= 1; - } else { - this._isub(this, num); - } - } - - return this; - } - - iaddn(num) { - enforce(isSMI(num), 'num', 'smi'); - - const negative = (num < 0) | 0; - - if (negative) - num = -num; - - if (this.negative === negative) { - // x + y == x + y - // (-x) + (-y) == -(x + y) - this._iaddn(num); - } else { - // x + (-y) == x - y == -(y - x) - // (-x) + y == y - x == -(x - y) - if (this.length === 1 && this.words[0] < num) { - this.words[0] = num - this.words[0]; - this.negative ^= 1; - } else { - this._isubn(num); - } - } - - return this; - } - - add(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (num.length > this.length) - return num.clone().iadd(this); - - return this.clone().iadd(num); - } - - addn(num) { - return this.clone().iaddn(num); - } - - /* - * Subtraction Engine - */ - - _isub(a, b) { - let carry = 0; - let i = 0; - - // a > b - assert(a.length >= b.length); - - if (a !== this) - this._alloc(a.length); - - for (; i < b.length; i++) { - const r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - - carry = r >> 26; - - this.words[i] = r & 0x3ffffff; - } - - for (; carry !== 0 && i < a.length; i++) { - const r = (a.words[i] | 0) + carry; - - carry = r >> 26; - - this.words[i] = r & 0x3ffffff; - } - - assert(carry === 0); - - // Copy rest of the words. - if (a !== this) { - for (; i < a.length; i++) - this.words[i] = a.words[i]; - } - - this.length = Math.max(this.length, i); - - return this._strip(); - } - - _isubn(num) { - this.words[0] -= num; - - if (this.words[0] >= 0) - return this._normalize(); - - assert(this.length !== 1); - - // Carry. - this._alloc(this.length + 1); - - for (let i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - - this.words[this.length] = 0; - - return this._strip(); - } - - /* - * Subtraction - */ - - isub(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.negative !== num.negative) { - // x - (-y) == x + y - // (-x) - y == -(x + y) - this._iadd(this, num); - } else { - // x - y == x - y == -(y - x) - // (-x) - (-y) == y - x == -(x - y) - const cmp = this.ucmp(num); - - // x - x == 0 - if (cmp === 0) { - this.words[0] = 0; - this.length = 1; - this.negative = 0; - return this; - } - - if (cmp < 0) { - this._isub(num, this); - this.negative ^= 1; - } else { - this._isub(this, num); - } - } - - return this; - } - - isubn(num) { - enforce(isSMI(num), 'num', 'smi'); - - const negative = (num < 0) | 0; - - if (negative) - num = -num; - - if (this.negative !== negative) { - // x - (-y) == x + y - // (-x) - y == -(x + y) - this._iaddn(num); - } else { - // x - y == x - y == -(y - x) - // (-x) - (-y) == y - x == -(x - y) - if (this.length === 1 && this.words[0] < num) { - this.words[0] = num - this.words[0]; - this.negative ^= 1; - } else { - this._isubn(num); - } - } - - return this; - } - - sub(num) { - return this.clone().isub(num); - } - - subn(num) { - return this.clone().isubn(num); - } - - /* - * Multiplication Engine - */ - - _mul(num, out) { - enforce(BN.isBN(num), 'num', 'bignum'); - enforce(BN.isBN(out), 'out', 'bignum'); - - if (this.length === 10 && num.length === 10) - return comb10MulTo(this, num, out); - - const len = this.length + num.length; - - if (len < 63) - return smallMulTo(this, num, out); - - if (len < 1024) - return bigMulTo(this, num, out); - - return jumboMulTo(this, num, out); - } - - /* - * Multiplication - */ - - imul(num) { - return this.mul(num)._move(this); - } - - imuln(num) { - enforce(isSMI(num), 'num', 'smi'); - - const neg = (num < 0) | 0; - - if (neg) - num = -num; - - // Carry. - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const w = this.words[i] * num; - const lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - - carry >>= 26; - carry += (w / 0x4000000) | 0; - carry += lo >>> 26; - - this.words[i] = lo & 0x3ffffff; - } - - this.negative ^= neg; - - if (carry !== 0) { - this._alloc(this.length + 1); - this.words[this.length++] = carry; - } else { - this._strip(); - } - - return this; - } - - mul(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - const len = this.length + num.length; - const out = new BN(); - - out.words = new Array(len); - - for (let i = 0; i < len; i ++) - out.words[i] = 0; - - return this._mul(num, out); - } - - muln(num) { - return this.clone().imuln(num); - } - - /* - * Multiplication + Shift - */ - - mulShift(num, bits) { - enforce(BN.isBN(num), 'num', 'bignum'); - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - const r = this.mul(num); - const b = r.utestn(bits - 1); - - r.iushrn(bits); - - if (this.negative ^ num.negative) - return r.isubn(b); - - return r.iaddn(b); - } - - /* - * Division Engine - */ - - _div(num, flags) { - enforce(BN.isBN(num), 'num', 'bignum'); - assert((flags & modes.ALL) === flags); - assert(flags !== modes.NONE); - - const a = this; - const b = num; - - nonzero(!b.isZero()); - - if (a.isZero()) - return [new BN(0), new BN(0)]; - - const as = a.negative; - const bs = b.negative; - - a.negative = 0; - b.negative = 0; - - let q = null; - let r = null; - - if (a.ucmp(b) < 0) { - if (flags & modes.QUO) - q = new BN(0); - - if (flags & modes.REM) - r = a.clone(); - } else if (b.length === 1) { - if (flags & modes.QUO) - q = a.quon(b.words[0]); - - if (flags & modes.REM) - r = a.remn(b.words[0]); - } else { - [q, r] = a._wordDiv(b, flags); - } - - a.negative = as; - b.negative = bs; - - if (flags & modes.QUO) { - q.negative = a.negative ^ b.negative; - q._normalize(); - } - - if (flags & modes.REM) { - r.negative = a.negative; - r._normalize(); - } - - if (flags & modes.EUCLID) { - if (flags & modes.QUO) { - assert((flags & modes.REM) !== 0); - - if (r.negative !== 0) { - if (b.negative !== 0) - q.iaddn(1); - else - q.isubn(1); - } - } - - if (flags & modes.REM) { - if (r.negative !== 0) { - if (b.negative !== 0) - r.isub(b); - else - r.iadd(b); - } - } - } - - return [q, r]; - } - - _wordDiv(num, flags) { - let a = this.clone(); - let b = num; - let q = null; - let hi; - - // Normalize. - const word = b.words[b.length - 1] | 0; - const shift = 26 - countBits(word); - - if (shift !== 0) { - b = b.clone(); - - a.iushln(shift); - b.iushln(shift); - - hi = b.words[b.length - 1] | 0; - } else { - hi = word; - } - - // Initialize quotient. - const m = a.length - b.length; - - assert(m >= 0); - - if (flags & modes.QUO) { - q = new BN(0); - q.length = m + 1; - q.words = new Array(q.length); - - for (let i = 0; i < q.length; i++) - q.words[i] = 0; - } - - // Diff. - const d = a.clone(); - - d._ishlnsubmul(b, 1, m); - - if (d.negative === 0) { - if (q) - q.words[m] = 1; - - a = d; - } - - // Divide. - for (let j = m - 1; j >= 0; j--) { - const ahi = a.words[b.length + j]; - const alo = a.words[b.length + j - 1]; - const quo = ((ahi * 0x4000000 + alo) / hi) | 0; - - let qj = Math.min(quo, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - - while (a.negative !== 0) { - qj -= 1; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - a.ineg(); - } - - if (q) - q.words[j] = qj; - } - - // Strip. - if (q) - q._strip(); - - // Denormalize. - // Note: we shouldn't need to strip `a` here. - if ((flags & modes.REM) && shift !== 0) - a.iushrn(shift); - - return [q, a]; - } - - _ishlnsubmul(num, mul, shift) { - let carry = 0; - let i = 0; - - this._expand(num.length + shift); - - for (; i < num.length; i++) { - const k = (this.words[i + shift] | 0) + carry; - const r = num.words[i] * mul; - const w = k - (r & 0x3ffffff); - - carry = (w >> 26) - ((r / 0x4000000) | 0); - - this.words[i + shift] = w & 0x3ffffff; - } - - for (; i < this.length - shift; i++) { - const w = (this.words[i + shift] | 0) + carry; - - carry = w >> 26; - - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) - return this._strip(); - - // Subtraction overflow. - assert(carry === -1); - - carry = 0; - - for (let i = 0; i < this.length; i++) { - const w = -(this.words[i] | 0) + carry; - - carry = w >> 26; - - this.words[i] = w & 0x3ffffff; - } - - this.negative = 1; - - return this._strip(); - } - - /* - * Truncation Division + Modulo - */ - - quorem(num) { - return this._div(num, modes.BOTH); - } - - /* - * Truncation Division - */ - - iquo(num) { - return this.quo(num)._move(this); - } - - iquon(num) { - enforce(isSMI(num), 'num', 'smi'); - nonzero(num !== 0); - - const neg = (num < 0) | 0; - - if (neg) - num = -num; - - let carry = 0; - - for (let i = this.length - 1; i >= 0; i--) { - const w = (this.words[i] | 0) + carry * 0x4000000; - - this.words[i] = (w / num) | 0; - - carry = w % num; - } - - this.negative ^= neg; - - return this._strip(); - } - - quo(num) { - return this._div(num, modes.QUO)[0]; - } - - quon(num) { - return this.clone().iquon(num); - } - - /* - * Truncation Modulo - */ - - irem(num) { - return this.rem(num)._move(this); - } - - iremn(num) { - let m = this.remrn(num); - - if (m < 0) - m = -m; - - this.words[0] = m; - this.length = 1; - - return this._normalize(); - } - - rem(num) { - return this._div(num, modes.REM)[1]; - } - - remn(num) { - return this.clone().iremn(num); - } - - remrn(num) { - enforce(isSMI(num), 'num', 'smi'); - nonzero(num !== 0); - - if (num < 0) - num = -num; - - const p = (1 << 26) % num; - - let acc = 0; - - for (let i = this.length - 1; i >= 0; i--) - acc = (p * acc + (this.words[i] | 0)) % num; - - return this.negative !== 0 ? (-acc | 0) : acc; - } - - /* - * Euclidean Division + Modulo - */ - - divmod(num) { - return this._div(num, modes.BOTH | modes.EUCLID); - } - - /* - * Euclidean Division - */ - - idiv(num) { - return this.div(num)._move(this); - } - - idivn(num) { - if (this.negative === 0) - return this.iquon(num); - - const r = this.remrn(num); - - this.iquon(num); - - if (r < 0) { - if (num < 0) - this.iaddn(1); - else - this.isubn(1); - } - - return this; - } - - div(num) { - return this._div(num, modes.BOTH | modes.EUCLID)[0]; - } - - divn(num) { - return this.clone().idivn(num); - } - - /* - * Euclidean Modulo - */ - - imod(num) { - if (this.ucmp(num) < 0) { - if (this.negative !== 0) { - this._isub(num, this); - this.negative = 0; - } - return this; - } - - return this.mod(num)._move(this); - } - - imodn(num) { - this.words[0] = this.modrn(num); - this.length = 1; - this.negative = 0; - return this; - } - - mod(num) { - return this._div(num, modes.REM | modes.EUCLID)[1]; - } - - modn(num) { - return this.clone().imodn(num); - } - - modrn(num) { - enforce(isSMI(num), 'num', 'smi'); - - let r = this.remrn(num); - - if (r < 0) { - if (num < 0) - r -= num; - else - r += num; - } - - return r; - } - - /* - * Round Division - */ - - divRound(num) { - const [q, r] = this.quorem(num); - - // Fast case - exact division. - if (r.isZero()) - return q; - - const bit = num.words[0] & 1; - - num.iushrn(1); - - const cmp = r.ucmp(num); - - num.iushln(1); - - num.words[0] |= bit; - - // Round down. - if (cmp < 0 || (num.isOdd() && cmp === 0)) - return q; - - // Round up. - if (this.negative ^ num.negative) - return q.isubn(1); - - return q.iaddn(1); - } - - /* - * Exponentiation - */ - - ipow(num) { - return this.pow(num)._move(this); - } - - ipown(num) { - return this.pown(num)._move(this); - } - - pow(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let b = countBits(num.words[num.length - 1]); - let r = new BN(1); - - for (let i = num.length - 1; i >= 0; i--) { - const word = num.words[i]; - - for (let j = b - 1; j >= 0; j--) { - r = r.sqr(); - - if ((word >> j) & 1) - r = r.mul(this); - } - - b = 26; - } - - return r; - } - - pown(num) { - enforce(isSMI(num), 'num', 'smi'); - - if (num < 0) - num = -num; - - if (num === 0) - return new BN(1); - - if (num === 1) - return this.clone(); - - const bits = countBits(num); - - let r = this; - - for (let i = bits - 2; i >= 0; i--) { - r = r.sqr(); - - if ((num >> i) & 1) - r = r.mul(this); - } - - return r; - } - - isqr() { - return this.imul(this); - } - - sqr() { - return this.mul(this); - } - - /* - * Roots Engine - */ - - _rootrem(pow, rem) { - enforce((pow >>> 0) === pow, 'num', 'uint32'); - - if (pow === 0) - throw new RangeError('Zeroth root.'); - - if (~pow & this.negative) - throw new RangeError('Negative with even root.'); - - if (this.ucmpn(1) <= 0) - return [this.clone(), new BN(0)]; - - let u = new BN(0); - let t = BN.shift(1, this.bitLength() / pow + 1 | 0); - let v, r; - - if (this.negative !== 0) - t.ineg(); - - if (pow === 2) { - do { - u = t; - t = this.quo(u); - t.iadd(u); - t.iushrn(1); - } while (t.ucmp(u) < 0); - } else { - do { - u = t; - t = u.pown(pow - 1); - t = this.quo(t); - v = u.muln(pow - 1); - t.iadd(v); - t = t.quon(pow); - } while (t.ucmp(u) < 0); - } - - if (rem) { - t = u.pown(pow); - r = this.sub(t); - } - - return [u, r]; - } - - /* - * Roots - */ - - rootrem(pow) { - return this._rootrem(pow, 1); - } - - iroot(pow) { - return this.root(pow)._move(this); - } - - root(pow) { - return this._rootrem(pow, 0)[0]; - } - - isPower(pow) { - enforce((pow >>> 0) === pow, 'num', 'uint32'); - - if (pow === 0 || (~pow & this.negative)) - return false; - - const [, r] = this.rootrem(pow); - - return r.sign() === 0; - } - - sqrtrem() { - return this.rootrem(2); - } - - isqrt() { - return this.sqrt()._move(this); - } - - sqrt() { - return this.root(2); - } - - isSquare() { - return this.isPower(2); - } - - /* - * AND - */ - - iand(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let x = this; - let y = num; - - if (x === y) - return x; - - if ((x.negative | y.negative) === 0) - return x.iuand(y); - - if ((x.negative & y.negative) === 1) { - // (-x) & (-y) == ~(x-1) & ~(y-1) - // == ~((x-1) | (y-1)) - // == -(((x-1) | (y-1)) + 1) - x.iaddn(1); - y.iaddn(1); - x.iuor(y); - x.isubn(1); - y.isubn(1); - return x; - } - - // Assume x is the positive number. - if (x.negative !== 0) - [x, y] = [y.clone(), x]; - - // x & (-y) == x & ~(y-1) - // == x & ~(y-1) - const width = x.bitLength(); - - y.iaddn(1); - y.inotn(width); - x.iuand(y); - y.inotn(width); - y.isubn(1); - - return x._move(this); - } - - iandn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if ((this.negative | (num < 0)) !== 0) - return this.iand(new BN(num)); - - this.words[0] &= num; - this.length = 1; - - return this; - } - - and(num) { - return this.clone().iand(num); - } - - andn(num) { - return this.clone().iandn(num); - } - - andrn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if ((this.negative | (num < 0)) !== 0) { - const n = this.iand(new BN(num)); - - if (n.length > 1) - throw new RangeError('Number exceeds 26 bits.'); - - return n.negative !== 0 ? -n.words[0] : n.words[0]; - } - - return this.words[0] & num; - } - - /* - * Unsigned AND - */ - - iuand(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - this.length = Math.min(this.length, num.length); - - for (let i = 0; i < this.length; i++) - this.words[i] &= num.words[i]; - - return this._strip(); - } - - iuandn(num) { - enforce(isSMI(num), 'num', 'smi'); - - this.words[0] &= Math.abs(num); - this.length = 1; - - return this._normalize(); - } - - uand(num) { - return this.clone().iuand(num); - } - - uandn(num) { - return this.clone().iuandn(num); - } - - uandrn(num) { - enforce(isSMI(num), 'num', 'smi'); - - const n = this.words[0] & Math.abs(num); - - return this.negative !== 0 ? (-n | 0) : n; - } - - /* - * OR - */ - - ior(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let x = this; - let y = num; - - if (x === y) - return x; - - if ((x.negative | y.negative) === 0) - return x.iuor(y); - - if ((x.negative & y.negative) === 1) { - // (-x) | (-y) == ~(x-1) | ~(y-1) - // == ~((x-1) & (y-1)) - // == -(((x-1) & (y-1)) + 1) - x.iaddn(1); - y.iaddn(1); - x.iuand(y); - x.isubn(1); - y.isubn(1); - return x; - } - - // Assume x is the positive number. - y = y.clone(); - - if (x.negative !== 0) - [x, y] = [y, x]; - - // x | (-y) == x | ~(y-1) - // == ~((y-1) & ~x) - // == -(((y-1) & ~x) + 1) - y.iaddn(1); - x.inotn(y.bitLength()); - y.iuand(x); - y.isubn(1); - - return y._move(this); - } - - iorn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if ((this.negative | (num < 0)) !== 0) - return this.ior(new BN(num)); - - this.words[0] |= num; - - return this; - } - - or(num) { - return this.clone().ior(num); - } - - orn(num) { - return this.clone().iorn(num); - } - - /* - * Unsigned OR - */ - - iuor(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - this._expand(num.length); - - for (let i = 0; i < num.length; i++) - this.words[i] |= num.words[i]; - - // Note: we shouldn't need to strip here. - return this; - } - - iuorn(num) { - enforce(isSMI(num), 'num', 'smi'); - - this.words[0] |= Math.abs(num); - - return this; - } - - uor(num) { - return this.clone().iuor(num); - } - - uorn(num) { - return this.clone().iuorn(num); - } - - /* - * XOR - */ - - ixor(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let x = this; - let y = num; - - if (x === y) { - x.words[0] = 0; - x.length = 1; - x.negative = 0; - return x; - } - - if ((x.negative | y.negative) === 0) - return x.iuxor(y); - - if ((x.negative & y.negative) === 1) { - // (-x) ^ (-y) == ~(x-1) ^ ~(y-1) - // == (x-1) ^ (y-1) - x.iaddn(1); - y.iaddn(1); - x.iuxor(y); - x.ineg(); - y.isubn(1); - return x; - } - - // Assume x is the positive number. - if (x.negative !== 0) - [x, y] = [y.clone(), x]; - - // x ^ (-y) == x ^ ~(y-1) - // == ~(x ^ (y-1)) - // == -((x ^ (y-1)) + 1) - y.iaddn(1); - x.iuxor(y); - x.iaddn(1); - x.ineg(); - y.isubn(1); - - return x._move(this); - } - - ixorn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if ((this.negative | (num < 0)) !== 0) - return this.ixor(new BN(num)); - - this.words[0] ^= num; - - return this; - } - - xor(num) { - return this.clone().ixor(num); - } - - xorn(num) { - return this.clone().ixorn(num); - } - - /* - * Unsigned XOR - */ - - iuxor(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let a = this; - let b = num; - - if (a.length < b.length) - [a, b] = [b, a]; - - let i = 0; - - for (; i < b.length; i++) - this.words[i] = a.words[i] ^ b.words[i]; - - if (a !== this) { - this._alloc(a.length); - - for (; i < a.length; i++) - this.words[i] = a.words[i]; - } - - this.length = a.length; - - return this._strip(); - } - - iuxorn(num) { - enforce(isSMI(num), 'num', 'smi'); - - this.words[0] ^= Math.abs(num); - - return this._normalize(); - } - - uxor(num) { - return this.clone().iuxor(num); - } - - uxorn(num) { - return this.clone().iuxorn(num); - } - - /* - * NOT - */ - - inot() { - if (this.negative !== 0) { - // ~(-x) == ~(~(x-1)) == x-1 - this.ineg().isubn(1); - } else { - // ~x == -x-1 == -(x+1) - this.iaddn(1).ineg(); - } - return this; - } - - not() { - return this.clone().inot(); - } - - inotn(width) { - enforce((width >>> 0) === width, 'width', 'uint32'); - - const r = width % 26; - - let s = Math.ceil(width / 26); - let i = 0; - - // Extend the buffer with leading zeroes. - this._expand(s); - - if (r > 0) - s -= 1; - - // Handle complete words. - for (; i < s; i++) - this.words[i] ^= 0x3ffffff; - - // Handle the residue. - if (r > 0) - this.words[i] ^= (1 << r) - 1; - - // And remove leading zeroes. - return this._strip(); - } - - notn(width) { - return this.clone().inotn(width); - } - - /* - * Left Shift - */ - - ishl(num) { - enforce(BN.isBN(num), 'bits', 'bignum'); - enforce(num.bitLength() <= 32, 'bits', 'uint32'); - return this.ishln(num.toNumber()); - } - - ishln(bits) { - return this.iushln(bits); - } - - shl(num) { - return this.clone().ishl(num); - } - - shln(bits) { - return this.clone().ishln(bits); - } - - /* - * Unsigned Left Shift - */ - - iushl(num) { - enforce(BN.isBN(num), 'bits', 'bignum'); - enforce(num.bitLength() <= 32, 'bits', 'uint32'); - return this.iushln(num.toNumber()); - } - - iushln(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - const r = bits % 26; - const s = (bits - r) / 26; - const mask = ((1 << r) - 1) << (26 - r); - - if (r !== 0) { - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const ncarry = this.words[i] & mask; - const c = ((this.words[i] | 0) - ncarry) << r; - - this.words[i] = c | carry; - - carry = ncarry >>> (26 - r); - } - - if (carry !== 0) { - this._alloc(this.length + 1); - this.words[this.length++] = carry; - } - } - - if (s !== 0) { - this._alloc(this.length + s); - - for (let i = this.length - 1; i >= 0; i--) - this.words[i + s] = this.words[i]; - - for (let i = 0; i < s; i++) - this.words[i] = 0; - - this.length += s; - } - - return this._strip(); - } - - ushl(num) { - return this.clone().iushl(num); - } - - ushln(bits) { - return this.clone().iushln(bits); - } - - /* - * Right Shift Engine - */ - - _split(bits, output) { - const r = bits % 26; - const s = Math.min((bits - r) / 26, this.length); - const mask = (1 << r) - 1; - - // Extended mode, copy masked part. - if (output) { - output._alloc(s); - - for (let i = 0; i < s; i++) - output.words[i] = this.words[i]; - - output.length = s; - } - - if (s === 0) ; else if (this.length > s) { - this.length -= s; - for (let i = 0; i < this.length; i++) - this.words[i] = this.words[i + s]; - } else { - this.words[0] = 0; - this.length = 1; - } - - let carry = 0; - - if (r !== 0) { - for (let i = this.length - 1; i >= 0; i--) { - const word = this.words[i] | 0; - - this.words[i] = (carry << (26 - r)) | (word >>> r); - - carry = word & mask; - } - } - - // Push carried bits as a mask. - if (output) { - if (carry !== 0) { - output._alloc(output.length + 1); - output.words[output.length++] = carry; - } else { - if (output.length === 0) - output.words[output.length++] = 0; - - output._strip(); - } - } - - return this._strip(); - } - - /* - * Right Shift - */ - - ishr(num) { - enforce(BN.isBN(num), 'bits', 'bignum'); - enforce(num.bitLength() <= 32, 'bits', 'uint32'); - return this.ishrn(num.toNumber()); - } - - ishrn(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - if (this.negative !== 0) { - // (-x) >> y == ~(x-1) >> y - // == ~((x-1) >> y) - // == -(((x-1) >> y) + 1) - this.iaddn(1); - this.iushrn(bits); - this.isubn(1); - return this; - } - - return this.iushrn(bits); - } - - shr(num) { - return this.clone().ishr(num); - } - - shrn(bits) { - return this.clone().ishrn(bits); - } - - /* - * Unsigned Right Shift - */ - - iushr(num) { - enforce(BN.isBN(num), 'bits', 'bignum'); - enforce(num.bitLength() <= 32, 'bits', 'uint32'); - return this.iushrn(num.toNumber()); - } - - iushrn(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - return this._split(bits, null); - } - - ushr(num) { - return this.clone().iushr(num); - } - - ushrn(bits) { - return this.clone().iushrn(bits); - } - - /* - * Bit Manipulation - */ - - setn(bit, val) { - enforce((bit >>> 0) === bit, 'bit', 'uint32'); - - if (this.negative !== 0) { - this.iaddn(1); - this.usetn(bit, !val); - this.isubn(1); - return this; - } - - return this.usetn(bit, val); - } - - usetn(bit, val) { - enforce((bit >>> 0) === bit, 'bit', 'uint32'); - - const r = bit % 26; - const s = (bit - r) / 26; - - this._expand(s + 1); - - if (val) - this.words[s] |= (1 << r); - else - this.words[s] &= ~(1 << r); - - return this._strip(); - } - - testn(bit) { - enforce((bit >>> 0) === bit, 'bit', 'uint32'); - - const r = bit % 26; - const s = (bit - r) / 26; - - // Fast case: bit is much higher than all existing words. - if (this.length <= s) - return this.negative; - - // Check bit and return. - const w = this.words[s]; - const val = (w >> r) & 1; - - if (this.negative !== 0) { - if (r > 0 && (w & ((1 << r) - 1))) - return val ^ 1; - - let j = s; - - while (j--) { - if (this.words[j] > 0) - return val ^ 1; - } - } - - return val; - } - - utestn(bit) { - enforce((bit >>> 0) === bit, 'bit', 'uint32'); - - const r = bit % 26; - const s = (bit - r) / 26; - - // Fast case: bit is much higher than all existing words. - if (this.length <= s) - return 0; - - // Check bit and return. - return (this.words[s] >> r) & 1; - } - - imaskn(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - if (this.negative !== 0) { - this.iaddn(1); - this.inotn(bits + 1); - this.ineg(); - } - - return this.iumaskn(bits); - } - - maskn(bits) { - return this.clone().imaskn(bits); - } - - iumaskn(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - const r = bits % 26; - - let s = (bits - r) / 26; - - if (this.length <= s) - return this; - - if (r !== 0) - s += 1; - - this.length = Math.min(s, this.length); - - if (r !== 0) - this.words[this.length - 1] &= (1 << r) - 1; - - if (this.length === 0) - this.words[this.length++] = 0; - - return this._strip(); - } - - umaskn(bits) { - return this.clone().iumaskn(bits); - } - - andln(num) { - return this.words[0] & num; - } - - bit(pos) { - return this.utestn(pos); - } - - bits(pos, width) { - enforce((pos >>> 0) === pos, 'pos', 'uint32'); - enforce((width >>> 0) === width, 'width', 'uint32'); - enforce(width <= 26, 'width', 'width'); - - const shift = pos % 26; - const index = (pos - shift) / 26; - - if (index >= this.length) - return 0; - - let bits = (this.words[index] >> shift) & ((1 << width) - 1); - - if (shift + width > 26 && index + 1 < this.length) { - const more = shift + width - 26; - const next = this.words[index + 1] & ((1 << more) - 1); - - bits |= next << (26 - shift); - } - - return bits; - } - - /* - * Negation - */ - - ineg() { - if (!this.isZero()) - this.negative ^= 1; - - return this; - } - - neg() { - return this.clone().ineg(); - } - - iabs() { - this.negative = 0; - return this; - } - - abs() { - return this.clone().iabs(); - } - - /* - * Comparison - */ - - cmp(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.negative !== num.negative) - return num.negative - this.negative; - - const res = this.ucmp(num); - - if (this.negative !== 0) - return -res | 0; - - return res; - } - - cmpn(num) { - enforce(isSMI(num), 'num', 'smi'); - - const negative = (num < 0) | 0; - - if (this.negative !== negative) - return negative - this.negative; - - const res = this.ucmpn(num); - - if (this.negative !== 0) - return -res | 0; - - return res; - } - - eq(num) { - return this.cmp(num) === 0; - } - - eqn(num) { - return this.cmpn(num) === 0; - } - - gt(num) { - return this.cmp(num) > 0; - } - - gtn(num) { - return this.cmpn(num) > 0; - } - - gte(num) { - return this.cmp(num) >= 0; - } - - gten(num) { - return this.cmpn(num) >= 0; - } - - lt(num) { - return this.cmp(num) < 0; - } - - ltn(num) { - return this.cmpn(num) < 0; - } - - lte(num) { - return this.cmp(num) <= 0; - } - - lten(num) { - return this.cmpn(num) <= 0; - } - - sign() { - if (this.negative !== 0) - return -1; - - if (this.length === 1 && this.words[0] === 0) - return 0; - - return 1; - } - - isZero() { - return this.length === 1 && this.words[0] === 0; - } - - isNeg() { - return this.negative !== 0; - } - - isPos() { - return this.negative === 0; - } - - isOdd() { - return (this.words[0] & 1) === 1; - } - - isEven() { - return (this.words[0] & 1) === 0; - } - - /* - * Unsigned Comparison - */ - - ucmp(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.length < num.length) - return -1; - - if (this.length > num.length) - return 1; - - for (let i = this.length - 1; i >= 0; i--) { - const a = this.words[i] | 0; - const b = num.words[i] | 0; - - if (a === b) - continue; - - return (a > b) - (a < b); - } - - return 0; - } - - ucmpn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if (this.length > 1) - return 1; - - const w = this.words[0] | 0; - - if (num < 0) - num = -num; - - return (w > num) - (w < num); - } - - /* - * Number Theoretic Functions - */ - - legendre(num) { - const red = HAS_BIGINT ? BN.red(num) : BN.mont(num); - return this.toRed(red).redLegendre(); - } - - jacobi(num) { - // See: A Binary Algorithm for the Jacobi Symbol - // J. Shallit, J. Sorenson - // Page 3, Section 3 - enforce(BN.isBN(num), 'num', 'bignum'); - - if (num.isZero() || num.isEven()) - throw new Error('jacobi: `num` must be odd.'); - - let a = this._cloneNormal(); - let b = num.clone(); - let j = 1; - - if (b.isNeg()) { - if (a.isNeg()) - j = -1; - b.ineg(); - } - - if (a.isNeg() || a.ucmp(b) >= 0) - a.imod(b); - - while (!a.isZero()) { - const bits = a._makeOdd(); - - if (bits & 1) { - const bmod8 = b.andln(7); - - if (bmod8 === 3 || bmod8 === 5) - j = -j; - } - - if (a.ucmp(b) < 0) { - [a, b] = [b, a]; - - if (a.andln(3) === 3 && b.andln(3) === 3) - j = -j; - } - - a._isub(a, b).iushrn(1); - - const bmod8 = b.andln(7); - - if (bmod8 === 3 || bmod8 === 5) - j = -j; - } - - if (b.cmpn(1) !== 0) - return 0; - - return j; - } - - kronecker(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.isZero()) - return num.ucmpn(1) === 0 ? 1 : 0; - - if (num.isZero()) - return this.ucmpn(1) === 0 ? 1 : 0; - - if (((this.words[0] | num.words[0]) & 1) === 0) - return 0; - - const x = this; - const y = num.clone(); - const bits = y._makeOdd(); - const table = [0, 1, 0, -1, 0, -1, 0, 1]; - - let k = x.jacobi(y); - - if (bits & 1) - k *= table[x.andln(7)]; - - return k | 0; - } - - igcd(num) { - return this.gcd(num)._move(this); - } - - gcd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.isZero()) - return num.abs(); - - if (num.isZero()) - return this.abs(); - - let a = this.clone(); - let b = num.clone(); - - a.negative = 0; - b.negative = 0; - - // Remove common factor of two. - const shift = a._factor2(b); - - if (shift !== 0) { - a.iushrn(shift); - b.iushrn(shift); - } - - for (;;) { - a._makeOdd(); - b._makeOdd(); - - const cmp = a.ucmp(b); - - if (cmp < 0) { - // a > b - [a, b] = [b, a]; - } else if (cmp === 0 || b.ucmpn(1) === 0) { - // Break if a == b. - // Break if b == 1 to avoid repeated subtraction. - break; - } - - a._isub(a, b); - } - - return b.iushln(shift); - } - - ilcm(num) { - return this.lcm(num)._move(this); - } - - lcm(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.isZero() || num.isZero()) - return new BN(0); - - return this.quo(this.gcd(num)).mul(num).iabs(); - } - - egcd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.isZero()) { - return [ - new BN(0), - new BN(num.sign()), - num.abs() - ]; - } - - if (num.isZero()) { - return [ - new BN(this.sign()), - new BN(0), - this.abs() - ]; - } - - const x = this.clone(); - const y = num.clone(); - - x.negative = 0; - y.negative = 0; - - // A * x + B * y = x - const A = new BN(1); - const B = new BN(0); - - // C * x + D * y = y - const C = new BN(0); - const D = new BN(1); - - // Remove common factor of two. - const g = x._factor2(y); - - if (g > 0) { - x.iushrn(g); - y.iushrn(g); - } - - const xp = x.clone(); - const yp = y.clone(); - - while (!x.isZero()) { - let i = x._makeOdd(); - let j = y._makeOdd(); - - while (i--) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - - while (j--) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - if (this.negative !== 0) - C.ineg(); - - if (num.negative !== 0) - D.ineg(); - - return [C, D, y.iushln(g)]; - } - - iinvert(num) { - return this.invert(num)._move(this); - } - - invert(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - range(num.sign() > 0, 'invert'); - - if (num.isOdd()) - return this._invertp(num); - - if (num.cmpn(1) === 0) - throw new RangeError('Not invertible.'); - - const [s,, g] = this.egcd(num); - - if (g.cmpn(1) !== 0) - throw new RangeError('Not invertible.'); - - return s.imod(num); - } - - ifermat(num) { - return this.fermat(num)._move(this); - } - - fermat(num) { - const red = HAS_BIGINT ? BN.red(num) : BN.mont(num); - return this.toRed(red).redFermat().fromRed(); - } - - ipowm(y, m, mont) { - return this.powm(y, m, mont)._move(this); - } - - powm(y, m, mont) { - const red = !HAS_BIGINT && mont ? BN.mont(m) : BN.red(m); - return this.toRed(red).redPow(y).fromRed(); - } - - ipowmn(y, m, mont) { - return this.powmn(y, m, mont)._move(this); - } - - powmn(y, m, mont) { - const red = mont ? BN.mont(m) : BN.red(m); - return this.toRed(red).redPown(y).fromRed(); - } - - isqrtm(p) { - return this.sqrtm(p)._move(this); - } - - sqrtm(p) { - enforce(BN.isBN(p), 'p', 'bignum'); - - let red; - - if (p.andln(3) === 3 || p.andln(7) === 5) { - // Probably not worth the setup. - red = BN.red(p); - } else { - red = BN.mont(p); - } - - return this.toRed(red).redSqrt().fromRed(); - } - - isqrtpq(p, q) { - return this.sqrtpq(p, q)._move(this); - } - - sqrtpq(p, q) { - const sp = this.sqrtm(p); - const sq = this.sqrtm(q); - const [mp, mq] = p.egcd(q); - const lhs = sq.mul(mp).mul(p); - const rhs = sp.mul(mq).mul(q); - const n = p.mul(q); - - return lhs.iadd(rhs).imod(n); - } - - /* - * Primality Testing - */ - - isPrime(rng, reps, limit) { - enforce((reps >>> 0) === reps, 'reps', 'uint32'); - - if (!this.isPrimeMR(rng, reps + 1, true)) - return false; - - if (!this.isPrimeLucas(limit)) - return false; - - return true; - } - - isPrimeMR(rng, reps, force2 = false) { - enforce((reps >>> 0) === reps, 'reps', 'uint32'); - enforce(reps > 0, 'reps', 'integer'); - enforce(typeof force2 === 'boolean', 'force2', 'boolean'); - - const n = this; - - if (n.cmpn(7) < 0) { - return n.cmpn(2) === 0 - || n.cmpn(3) === 0 - || n.cmpn(5) === 0; - } - - if (n.isEven()) - return false; - - const nm1 = n.subn(1); - const nm3 = nm1.subn(2); - const k = nm1.zeroBits(); - const q = nm1.ushrn(k); - - const red = BN.red(n); - const rnm1 = nm1.toRed(red); - const rone = new BN(1).toRed(red); - - next: - for (let i = 0; i < reps; i++) { - let x; - - if (i === reps - 1 && force2) { - x = new BN(2); - } else { - x = BN.random(rng, 0, nm3); - x.iaddn(2); - } - - let y = x.toRed(red).redPow(q); - - if (y.cmp(rone) === 0 || y.cmp(rnm1) === 0) - continue; - - for (let j = 1; j < k; j++) { - y = y.redSqr(); - - if (y.cmp(rnm1) === 0) - continue next; - - if (y.cmp(rone) === 0) - return false; - } - - return false; - } - - return true; - } - - isPrimeLucas(limit = 0) { - enforce((limit >>> 0) === limit, 'limit', 'uint32'); - - const n = this; - - // Ignore 0 and 1. - if (n.cmpn(1) <= 0) - return false; - - // Two is the only even prime. - if (n.isEven()) - return n.cmpn(2) === 0; - - let p = 3; - - for (;;) { - if (p > 10000) { - // Thought to be impossible. - throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`); - } - - if (limit !== 0 && p > limit) { - // Optional DoS limit. - return false; - } - - const d = new BN(p * p - 4); - const j = d.jacobi(n); - - if (j === -1) - break; - - if (j === 0) - return n.cmpn(p + 2) === 0; - - if (p === 40) { - if (n.isSquare()) - return false; - } - - p += 1; - } - - const s = n.addn(1); - const r = s._makeOdd(); - - let vk = new BN(2); - let vk1 = new BN(p); - - for (let i = s.bitLength(); i >= 0; i--) { - if (s.utestn(i)) { - vk = vk.mul(vk1).isubn(p).imod(n); - vk1 = vk1.sqr().isubn(2).imod(n); - } else { - vk1 = vk1.mul(vk).isubn(p).imod(n); - vk = vk.sqr().isubn(2).imod(n); - } - } - - if (vk.cmpn(2) === 0 || vk.cmp(n.subn(2)) === 0) { - const a = vk.muln(p).imod(n); - const b = vk1.ushln(1).imod(n); - - if (a.cmp(b) === 0) - return true; - } - - for (let t = 0; t < r - 1; t++) { - if (vk.isZero()) - return true; - - if (vk.cmpn(2) === 0) - return false; - - vk = vk.sqr().isubn(2).imod(n); - } - - return false; - } - - /* - * Twos Complement - */ - - toTwos(width) { - if (this.negative !== 0) - return this.abs().inotn(width).iaddn(1); - - return this.clone(); - } - - fromTwos(width) { - enforce((width >>> 0) === width, 'width', 'uint32'); - range(width > 0, 'width'); - - if (this.testn(width - 1)) - return this.notn(width).iaddn(1).ineg(); - - return this.clone(); - } - - /* - * Reduction Context - */ - - toRed(ctx) { - enforce(ctx instanceof Red, 'ctx', 'reduction context'); - - if (this.red) - throw new Error('Already in reduction context.'); - - return ctx.convertTo(this); - } - - fromRed() { - red(this.red, 'fromRed'); - return this.red.convertFrom(this); - } - - forceRed(ctx) { - enforce(ctx instanceof Red, 'ctx', 'reduction context'); - - if (this.red) { - if (!ctx.m.eq(this.red.m) || ctx.mont !== this.red.mont) - throw new Error('Already in reduction context.'); - } else { - range(this.negative === 0, 'red'); - range(this.ucmp(ctx.m) < 0, 'red'); - } - - return this.clone()._forceRed(ctx); - } - - redIAdd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIAdd'); - return this.red.iadd(this, num); - } - - redAdd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redAdd'); - return this.red.add(this, num); - } - - redIAddn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redIAddn'); - return this.red.iaddn(this, num); - } - - redAddn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redAddn'); - return this.red.addn(this, num); - } - - redISub(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redISub'); - return this.red.isub(this, num); - } - - redSub(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redSub'); - return this.red.sub(this, num); - } - - redISubn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redISubn'); - return this.red.isubn(this, num); - } - - redSubn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redSubn'); - return this.red.subn(this, num); - } - - redIMul(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIMul'); - return this.red.imul(this, num); - } - - redMul(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redMul'); - return this.red.mul(this, num); - } - - redIMuln(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redIMuln'); - return this.red.imuln(this, num); - } - - redMuln(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redMuln'); - return this.red.muln(this, num); - } - - redIDiv(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIDiv'); - return this.red.idiv(this, num); - } - - redDiv(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redDiv'); - return this.red.div(this, num); - } - - redIDivn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redIDivn'); - return this.red.idivn(this, num); - } - - redDivn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redDivn'); - return this.red.divn(this, num); - } - - redIPow(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIPow'); - nonred(!num.red, 'redIPow'); - return this.red.ipow(this, num); - } - - redPow(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redPow'); - nonred(!num.red, 'redPow'); - return this.red.pow(this, num); - } - - redIPown(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redIPown'); - return this.red.ipown(this, num); - } - - redPown(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redPown'); - return this.red.pown(this, num); - } - - redISqr() { - red(this.red, 'redISqr'); - return this.red.isqr(this); - } - - redSqr() { - red(this.red, 'redSqr'); - return this.red.sqr(this); - } - - redISqrt() { - red(this.red, 'redISqrt'); - return this.red.isqrt(this); - } - - redSqrt() { - red(this.red, 'redSqrt'); - return this.red.sqrt(this); - } - - redIDivSqrt(v) { - red(this.red, 'redIDivSqrt'); - return this.red.idivsqrt(this, v); - } - - redDivSqrt(v) { - red(this.red, 'redDivSqrt'); - return this.red.divsqrt(this, v); - } - - redIsSquare() { - red(this.red, 'redIsSquare'); - return this.red.isSquare(this); - } - - redIShl(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIShl'); - nonred(!num.red, 'redIShl'); - return this.red.ishl(this, num); - } - - redShl(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redShl'); - nonred(!num.red, 'redShl'); - return this.red.shl(this, num); - } - - redIShln(num) { - enforce((num >>> 0) === num, 'num', 'uint32'); - red(this.red, 'redIShln'); - return this.red.ishln(this, num); - } - - redShln(num) { - enforce((num >>> 0) === num, 'num', 'uint32'); - red(this.red, 'redShln'); - return this.red.shln(this, num); - } - - redINeg() { - red(this.red, 'redINeg'); - return this.red.ineg(this); - } - - redNeg() { - red(this.red, 'redNeg'); - return this.red.neg(this); - } - - redEq(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redEq'); - return this.red.eq(this, num); - } - - redEqn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redEqn'); - return this.red.eqn(this, num); - } - - redIsHigh() { - red(this.red, 'redIsHigh'); - return this.red.isHigh(this); - } - - redIsLow() { - red(this.red, 'redIsLow'); - return this.red.isLow(this); - } - - redIsOdd() { - red(this.red, 'redIsOdd'); - return this.red.isOdd(this); - } - - redIsEven() { - red(this.red, 'redIsEven'); - return this.red.isEven(this); - } - - redLegendre() { - red(this.red, 'redLegendre'); - return this.red.legendre(this); - } - - redJacobi() { - red(this.red, 'redJacobi'); - return this.red.jacobi(this); - } - - redKronecker() { - red(this.red, 'redKronecker'); - return this.red.kronecker(this); - } - - redIInvert() { - red(this.red, 'redIInvert'); - return this.red.iinvert(this); - } - - redInvert() { - red(this.red, 'redInvert'); - return this.red.invert(this); - } - - redIFermat() { - red(this.red, 'redIFermat'); - return this.red.ifermat(this); - } - - redFermat() { - red(this.red, 'redFermat'); - return this.red.fermat(this); - } - - /* - * Internal - */ - - _move(dest) { - dest.words = this.words; - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - return dest; - } - - _alloc(size) { - while (this.words.length < size) - this.words.push(0); - - return this; - } - - _expand(size) { - this._alloc(size); - - while (this.length < size) - this.words[this.length++] = 0; - - return this; - } - - _strip() { - while (this.length > 1 && this.words[this.length - 1] === 0) - this.length -= 1; - - return this._normalize(); - } - - _normalize() { - assert(this.length > 0); - - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) - this.negative = 0; - - return this; - } - - _check() { - // We never have a zero length number. - assert(this.length > 0); - - // Cannot exceed array bounds. - assert(this.length <= this.words.length); - - if (this.length === 1) { - // Must be normalized. - if (this.words[0] === 0) - assert(this.negative === 0); - return this; - } - - // Must be stripped. - assert(this.words[this.length - 1] !== 0); - - return this; - } - - _invertp(p) { - // Penk's right shift binary EGCD. - // - // See: The Art of Computer Programming, - // Volume 2, Seminumerical Algorithms - // Donald E. Knuth - // Exercise 4.5.2.39 - enforce(BN.isBN(p), 'p', 'bignum'); - range(p.sign() > 0, 'invert'); - assert(p.isOdd()); - - if (p.cmpn(1) === 0) - throw new RangeError('Not invertible.'); - - const a = this.clone(); - const b = p.clone(); - const u = new BN(1); - const v = new BN(0); - - if (a.isNeg() || a.ucmp(b) >= 0) - a.imod(b); - - while (!a.isZero()) { - let i = a._makeOdd(); - let j = b._makeOdd(); - - while (i--) { - if (u.isOdd()) - u._iadd(u, p); - - u.iushrn(1); - } - - while (j--) { - if (v.isOdd()) - v._iadd(v, p); - - v.iushrn(1); - } - - if (a.ucmp(b) >= 0) { - a._isub(a, b); - if (u.ucmp(v) < 0) { - u._isub(v, u); - u._isub(p, u); - } else { - u._isub(u, v); - } - } else { - b._isub(b, a); - if (v.ucmp(u) < 0) { - v._isub(u, v); - v._isub(p, v); - } else { - v._isub(v, u); - } - } - } - - if (b.cmpn(1) !== 0) - throw new RangeError('Not invertible.'); - - assert(v.negative === 0); - assert(v.ucmp(p) < 0); - - return v; - } - - _makeOdd() { - const shift = this.zeroBits(); - - if (shift > 0) - this.iushrn(shift); - - return shift; - } - - _factor2(num) { - // Find common factor of two. - // Expects inputs to be non-zero. - if ((this.words[0] | num.words[0]) & 1) - return 0; - - const len = Math.min(this.length, num.length); - - let r = 0; - - for (let i = 0; i < len; i++) { - const b = zeroBits(this.words[i] | num.words[i]); - - r += b; - - if (b !== 26) - break; - } - - return r; - } - - _cloneNormal() { - return this.red ? this.fromRed() : this.clone(); - } - - _forceRed(ctx) { - this.red = ctx; - return this; - } - - /* - * Helpers - */ - - clone() { - const copy = new BN(); - - copy.words = new Array(this.length); - - for (let i = 0; i < this.length; i++) - copy.words[i] = this.words[i]; - - copy.length = this.length; - copy.negative = this.negative; - copy.red = this.red; - - return copy; - } - - inject(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - this._alloc(num.length); - - for (let i = 0; i < num.length; i++) - this.words[i] = num.words[i]; - - this.length = num.length; - this.negative = num.negative; - this.red = num.red; - - return this; - } - - set(num, endian) { - return this.fromNumber(num, endian); - } - - swap(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - const x = this; - const y = num; - - [x.words, y.words] = [y.words, x.words]; - [x.length, y.length] = [y.length, x.length]; - [x.negative, y.negative] = [y.negative, x.negative]; - [x.red, y.red] = [y.red, x.red]; - - return x; - } - - reverse() { - const neg = this.negative; - - this.fromBuffer(this.toBuffer('be'), 'le'); - this.negative = neg; - - return this; - } - - byteLength() { - return Math.ceil(this.bitLength() / 8); - } - - bitLength() { - const w = this.words[this.length - 1]; - const hi = countBits(w); - return (this.length - 1) * 26 + hi; - } - - zeroBits() { - if (this.isZero()) - return 0; - - if (this.isOdd()) - return 0; - - let r = 0; - - for (let i = 0; i < this.length; i++) { - const b = zeroBits(this.words[i]); - - r += b; - - if (b !== 26) - break; - } - - return r; - } - - isSafe() { - if (this.length <= 2) - return true; - - if (this.length === 3 && this.words[2] === 0x01) - return true; - - return false; - } - - word(pos) { - enforce((pos >>> 0) === pos, 'pos', 'uint32'); - - if (pos >= this.length) - return 0; - - return this.words[pos]; - } - - [custom]() { - let prefix = 'BN'; - - if (this.red) - prefix = 'BN-R'; - - return `<${prefix}: ${this.toString(10)}>`; - } - - /* - * Conversion - */ - - toNumber() { - let num = this.words[0]; - - if (this.length === 2) { - num += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // Note: at this stage it is known that the top bit is set. - num += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - throw new RangeError('Number can only safely store up to 53 bits.'); - } - - return this.negative !== 0 ? -num : num; - } - - toDouble() { - let num = 0; - - for (let i = this.length - 1; i >= 0; i--) - num = (num * 0x4000000) + this.words[i]; - - return this.negative !== 0 ? -num : num; - } - - valueOf() { - return this.toDouble(); - } - - toBigInt() { - if (!HAS_BIGINT) - throw new Error('BigInt is not supported!'); - - const s52 = BigInt(52); - const s26 = BigInt(26); - - let i = this.length - 1; - let num = BigInt(0); - - for (; i >= 1; i -= 2) { - const hi = this.words[i] * 0x4000000; - const lo = this.words[i - 1]; - - num = (num << s52) | BigInt(hi + lo); - } - - if (i >= 0) - num = (num << s26) | BigInt(this.words[0]); - - return this.negative !== 0 ? -num : num; - } - - toBool() { - return !this.isZero(); - } - - toString(base, padding) { - base = getBase(base); - - if (padding == null) - padding = 0; - - if (padding === 0) - padding = 1; - - enforce((base >>> 0) === base, 'base', 'uint32'); - enforce((padding >>> 0) === padding, 'padding', 'uint32'); - - if (base < 2 || base > 36) - throw new RangeError('Base ranges between 2 and 36.'); - - this._check(); - - if (base === 16) { - let out = ''; - let off = 0; - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const w = this.words[i]; - const word = (((w << off) | carry) & 0xffffff).toString(16); - - carry = (w >>> (24 - off)) & 0xffffff; - - if (carry !== 0 || i !== this.length - 1) - out = zeros[6 - word.length] + word + out; - else - out = word + out; - - off += 2; - - if (off >= 26) { - off -= 26; - i -= 1; - } - } - - if (carry !== 0) - out = carry.toString(16) + out; - - while (out.length % padding !== 0) - out = '0' + out; - - if (this.negative !== 0) - out = '-' + out; - - return out; - } - - const groupSize = groupSizes[base - 1]; - const groupBase = groupBases[base - 1]; - const c = this.clone(); - - let out = ''; - - c.negative = 0; - - while (!c.isZero()) { - const r = c.remrn(groupBase).toString(base); - - c.iquon(groupBase); - - if (!c.isZero()) - out = zeros[groupSize - r.length] + r + out; - else - out = r + out; - } - - if (this.isZero()) - out = '0'; - - while (out.length % padding !== 0) - out = '0' + out; - - if (this.negative !== 0) - out = '-' + out; - - return out; - } - - toJSON() { - return this.toString(16, 2); - } - - toArray(endian, length) { - return this.toArrayLike(Array, endian, length); - } - - toBuffer(endian, length) { - return this.toArrayLike(bufferExports.Buffer, endian, length); - } - - toArrayLike(ArrayType, endian, length) { - if (endian == null) - endian = 'be'; - - if (length == null) - length = 0; - - enforce(typeof ArrayType === 'function', 'ArrayType', 'function'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - enforce((length >>> 0) === length, 'length', 'uint32'); - - this._check(); - - const bytes = this.byteLength(); - const size = length || Math.max(1, bytes); - - if (bytes > size) - throw new RangeError('Byte array longer than desired length.'); - - const res = allocate(ArrayType, size); - - // See: https://github.com/indutny/bn.js/pull/222 - if (endian === 'be') { - let pos = res.length - 1; - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const shift = (i & 3) << 1; - const word = (this.words[i] << shift) | carry; - - res[pos--] = word & 0xff; - - if (pos >= 0) - res[pos--] = (word >>> 8) & 0xff; - - if (pos >= 0) - res[pos--] = (word >>> 16) & 0xff; - - if (shift === 6) { - if (pos >= 0) - res[pos--] = (word >>> 24) & 0xff; - - carry = 0; - } else { - carry = word >>> 24; - } - } - - if (pos >= 0) { - res[pos--] = carry; - - while (pos >= 0) - res[pos--] = 0; - - carry = 0; - } - - assert(carry === 0); - } else { - let pos = 0; - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const shift = (i & 3) << 1; - const word = (this.words[i] << shift) | carry; - - res[pos++] = word & 0xff; - - if (pos < res.length) - res[pos++] = (word >>> 8) & 0xff; - - if (pos < res.length) - res[pos++] = (word >>> 16) & 0xff; - - if (shift === 6) { - if (pos < res.length) - res[pos++] = (word >>> 24) & 0xff; - - carry = 0; - } else { - carry = word >>> 24; - } - } - - if (pos < res.length) { - res[pos++] = carry; - - while (pos < res.length) - res[pos++] = 0; - - carry = 0; - } - - assert(carry === 0); - } - - return res; - } - - encode(endian, length) { - return this.toBuffer(endian, length); - } - - /* - * Instantiation - */ - - of(num, endian) { - return this.fromNumber(num, endian); - } - - fromNumber(num, endian) { - if (endian == null) - endian = 'be'; - - enforce(isInteger(num), 'num', 'integer'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - const neg = (num < 0) | 0; - - if (neg) - num = -num; - - if (num < 0x4000000) { - this.words[0] = num & 0x3ffffff; - this.length = 1; - } else if (num < 0x10000000000000) { - this.words = [ - num & 0x3ffffff, - (num / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - this.words = [ - num & 0x3ffffff, - (num / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - this.negative = neg; - - if (endian === 'le') - this.reverse(); - - return this; - } - - fromDouble(num, endian) { - if (endian == null) - endian = 'be'; - - enforce(typeof num === 'number', 'num', 'double'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - if (!isFinite(num)) - num = 0; - - const neg = (num <= -1) | 0; - - if (num < 0) - num = -num; - - num = Math.floor(num); - - this.words = []; - - while (num > 0) { - const lo = num % 0x4000000; - const hi = (num - lo) / 0x4000000; - - this.words.push(lo); - - num = hi; - } - - if (this.words.length === 0) - this.words.push(0); - - this.length = this.words.length; - this.negative = neg; - - if (endian === 'le') - this.reverse(); - - return this; - } - - fromBigInt(num, endian) { - if (endian == null) - endian = 'be'; - - enforce(typeof num === 'bigint', 'num', 'bigint'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - if (!HAS_BIGINT) - throw new Error('BigInt is not supported!'); - - // You know the implementation has a - // problem when strings are twice - // as fast as bigints. - const start = (num < BigInt(0)) | 0; - - this._fromHex(num.toString(16), start); - this.negative = start; - - if (endian === 'le') - this.reverse(); - - return this; - } - - fromBool(value) { - enforce(typeof value === 'boolean', 'value', 'boolean'); - - this.words[0] = value | 0; - this.length = 1; - this.negative = 0; - - return this; - } - - fromString(str, base, endian) { - if (base === 'le' || base === 'be') - [base, endian] = [endian, base]; - - base = getBase(base); - - if (endian == null) - endian = 'be'; - - enforce(typeof str === 'string', 'string', 'string'); - enforce((base >>> 0) === base, 'base', 'uint32'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - if (base < 2 || base > 36) - throw new Error('Base ranges between 2 and 36.'); - - str = str.replace(/\s+/g, ''); - - let start = 0; - - if (str.length > 0 && str.charCodeAt(0) === 0x2d) - start = 1; - - if (base === 16) - this._fromHex(str, start); - else - this._fromBase(str, base, start); - - this.negative = start; - - this._normalize(); - - if (endian === 'le') - this.reverse(); - - return this; - } - - _fromHex(str, start) { - this.length = Math.max(2, Math.ceil((str.length - start) / 6)); - this.words = new Array(this.length); - - for (let i = 0; i < this.length; i++) - this.words[i] = 0; - - // Scan 24-bit chunks and add them to the number. - let off = 0; - let i = str.length - 6; - let j = 0; - - for (; i >= start; i -= 6) { - const w = parseHex(str, i, i + 6); - - this.words[j] |= (w << off) & 0x3ffffff; - - // `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb. - this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff; - - off += 24; - - if (off >= 26) { - off -= 26; - j += 1; - } - } - - if (i + 6 !== start) { - const w = parseHex(str, start, i + 6); - - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff; - } - - return this._strip(); - } - - _fromBase(str, base, start) { - // Initialize as zero. - this.words[0] = 0; - this.length = 1; - this.negative = 0; - - // Find length of limb in base. - let limbLen = 0; - let limbPow = 1; - - for (; limbPow <= 0x3ffffff; limbPow *= base) - limbLen += 1; - - limbLen -= 1; - limbPow = (limbPow / base) | 0; - - const total = str.length - start; - const mod = total % limbLen; - const end = Math.min(total, total - mod) + start; - - let i = start; - - for (; i < end; i += limbLen) { - const word = parseBase(str, i, i + limbLen, base); - - this.imuln(limbPow); - this._iaddn(word); - } - - if (mod !== 0) { - const pow = Math.pow(base, mod); - const word = parseBase(str, i, str.length, base); - - this.imuln(pow); - this._iaddn(word); - } - - return this; - } - - fromJSON(json) { - if (BN.isBN(json)) { - if (json.red) - return json.fromRed(); - - return json.clone(); - } - - if (Array.isArray(json)) { - for (const chunk of json) - enforce(typeof chunk === 'string', 'chunk', 'string'); - - json = json.join(''); - } - - return this.fromString(json, 16); - } - - fromBN(num) { - return this.inject(num); - } - - fromArray(data, endian) { - enforce(Array.isArray(data), 'data', 'array'); - return this.fromArrayLike(data, endian); - } - - fromBuffer(data, endian) { - enforce(bufferExports.Buffer.isBuffer(data), 'data', 'buffer'); - return this.fromArrayLike(data, endian); - } - - fromArrayLike(data, endian) { - if (endian == null) - endian = 'be'; - - enforce(data && (data.length >>> 0) === data.length, 'data', 'array-like'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - if (data.length === 0) { - this.words[0] = 0; - this.length = 1; - this.negative = 0; - return this; - } - - this.length = Math.max(2, Math.ceil(data.length / 3)); - this.words = new Array(this.length); - this.negative = 0; - - for (let i = 0; i < this.length; i++) - this.words[i] = 0; - - const left = data.length % 3; - - let off = 0; - let j = 0; - let w = 0; - - if (endian === 'be') { - for (let i = data.length - 1; i >= 2; i -= 3) { - const w = data[i] | (data[i - 1] << 8) | (data[i - 2] << 16); - - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - - off += 24; - - if (off >= 26) { - off -= 26; - j += 1; - } - } - - switch (left) { - case 2: - w = data[1] | (data[0] << 8); - break; - case 1: - w = data[0]; - break; - } - } else { - const len = data.length - left; - - for (let i = 0; i < len; i += 3) { - const w = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16); - - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - - off += 24; - - if (off >= 26) { - off -= 26; - j += 1; - } - } - - switch (left) { - case 2: - w = data[len] | (data[len + 1] << 8); - break; - case 1: - w = data[len]; - break; - } - } - - if (left > 0) { - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - } - - return this._strip(); - } - - decode(data, endian) { - return this.fromBuffer(data, endian); - } - - from(num, base, endian) { - if (num == null) - return this; - - if (base === 'le' || base === 'be') - [base, endian] = [endian, base]; - - if (typeof num === 'number') - return this.fromNumber(num, endian); - - if (typeof num === 'bigint') - return this.fromBigInt(num, endian); - - if (typeof num === 'string') - return this.fromString(num, base, endian); - - if (typeof num === 'object') { - if (BN.isBN(num)) - return this.fromBN(num, endian); - - if ((num.length >>> 0) === num.length) - return this.fromArrayLike(num, endian); - } - - if (typeof num === 'boolean') - return this.fromBool(num); - - throw new TypeError('Non-numeric object passed to BN.'); - } - - /* - * Static Methods - */ - - static min(...args) { - let min = null; - - for (const num of args) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (!min || num.cmp(min) < 0) - min = num; - } - - return min || new BN(0); - } - - static max(...args) { - let max = null; - - for (const num of args) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (!max || num.cmp(max) > 0) - max = num; - } - - return max || new BN(0); - } - - static cmp(a, b) { - enforce(BN.isBN(a), 'a', 'bignum'); - return a.cmp(b); - } - - static ucmp(a, b) { - enforce(BN.isBN(a), 'a', 'bignum'); - return a.ucmp(b); - } - - static red(num) { - return new Red(num); - } - - static barrett(num) { - return new Barrett(num); - } - - static mont(num) { - return new Mont(num); - } - - static _prime(name) { - if (primes[name]) - return primes[name]; - - let prime; - - if (name === 'p192') - prime = new P192(); - else if (name === 'p224') - prime = new P224(); - else if (name === 'p521') - prime = new P521(); - else if (name === 'k256') - prime = new K256(); - else if (name === 'p251') - prime = new P251(); - else if (name === 'p25519') - prime = new P25519(); - else if (name === 'p448') - prime = new P448(); - else - throw new Error(`Unknown prime: "${name}".`); - - primes[name] = prime; - - return prime; - } - - static prime(name) { - return BN._prime(name).p.clone(); - } - - static pow(num, exp) { - if (num === 2) - return BN.shift(1, exp); - - return new BN().fromNumber(num).pown(exp); - } - - static shift(num, bits) { - if (num === 1) - return new BN(0).usetn(bits, 1); - - return new BN().fromNumber(num).ishln(bits); - } - - static mask(bits) { - return BN.shift(1, bits).isubn(1); - } - - static randomBits(rng, bits) { - enforce(rng != null, 'rng', 'rng'); - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - if (typeof rng === 'object') { - enforce(typeof rng.randomBytes === 'function', 'rng', 'rng'); - - const size = (bits + 7) >>> 3; - const total = size * 8; - const bytes = rng.randomBytes(size); - - enforce(bufferExports.Buffer.isBuffer(bytes), 'bytes', 'buffer'); - - if (bytes.length !== size) - throw new RangeError('Invalid number of bytes returned from RNG.'); - - const num = BN.fromBuffer(bytes); - - if (total > bits) - num.iushrn(total - bits); - - return num; - } - - enforce(typeof rng === 'function', 'rng', 'rng'); - - const num = rng(bits); - - enforce(BN.isBN(num), 'num', 'bignum'); - range(num.negative === 0, 'RNG'); - nonred(!num.red, 'RNG'); - - if (num.bitLength() > bits) - throw new RangeError('Invalid number of bits returned from RNG.'); - - return num; - } - - static random(rng, min, max) { - min = BN.cast(min, 16); - max = BN.cast(max, 16); - - if (min.cmp(max) > 0) - throw new RangeError('Minimum cannot be greater than maximum.'); - - const space = max.sub(min).iabs(); - const bits = space.bitLength(); - - if (bits === 0) - return min.clone(); - - for (;;) { - const num = BN.randomBits(rng, bits); - - // Maximum is _exclusive_! - if (num.cmp(space) >= 0) - continue; - - // Minimum is _inclusive_! - num.iadd(min); - - return num; - } - } - - static of(num, endian) { - return new BN().of(num, endian); - } - - static fromNumber(num, endian) { - return new BN().fromNumber(num, endian); - } - - static fromDouble(num, endian) { - return new BN().fromDouble(num, endian); - } - - static fromBigInt(num, endian) { - return new BN().fromBigInt(num, endian); - } - - static fromBool(value) { - return new BN().fromBool(value); - } - - static fromString(str, base, endian) { - return new BN().fromString(str, base, endian); - } - - static fromJSON(json) { - return new BN().fromJSON(json); - } - - static fromBN(num) { - return new BN().fromBN(num); - } - - static fromArray(data, endian) { - return new BN().fromArray(data, endian); - } - - static fromBuffer(data, endian) { - return new BN().fromBuffer(data, endian); - } - - static fromArrayLike(data, endian) { - return new BN().fromArrayLike(data, endian); - } - - static decode(data, endian) { - return new BN().decode(data, endian); - } - - static from(num, base, endian) { - return new BN().from(num, base, endian); - } - - static cast(num, base, endian) { - if (BN.isBN(num)) - return num; - - return new BN(num, base, endian); - } - - static isBN(obj) { - return obj instanceof BN; - } - } - - /* - * Static - */ - - BN.BN = BN; - BN.wordSize = 26; - BN.native = 0; - - /** - * Prime - */ - - class Prime { - constructor(name, p) { - // P = 2^N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = BN.shift(1, this.n).isub(this.p); - this.lo = this.p.clone(); - this.one = this.p.clone(); - } - - ireduce(num) { - // Assumes that `num` is less than `P^2`: - // num = HI * (2^N - K) + HI * K + LO = HI * K + LO (mod P) - const neg = num.negative !== 0; - - // Track bits. - let bits = num.bitLength(); - - // Must be less than P^2. - assert(bits <= this.n * 2); - - // Ensure positive. - num.negative = 0; - - // Reduce. - while (bits > this.n) { - // lo = num & ((1 << n) - 1) - // num = num >> n - this.split(num, this.lo); - - // num = num * K - this.imulK(num); - - // num = num + lo - num._iadd(num, this.lo); - - // bits = bitlen(num) - bits = num.bitLength(); - } - - // Final reduction. - const cmp = bits < this.n ? -1 : num.ucmp(this.p); - - if (cmp === 0) { - num.words[0] = 0; - num.length = 1; - } else if (cmp > 0) { - num._isub(num, this.p); - } else ; - - // Adjust sign. - if (neg && !num.isZero()) - num._isub(this.p, num); - - return num; - } - - split(input, out) { - input._split(this.n, out); - } - - imulK(num) { - return num.imul(this.k); - } - - pm2(x1) { - // Exponent: p - 2 - throw new Error('Not implemented.'); - } - - fermat(x) { - return this.pm2(x); - } - } - - /** - * Prime (3 mod 4) - */ - - class Prime34 extends Prime { - constructor(name, p) { - super(name, p); - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - throw new Error('Not implemented.'); - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - throw new Error('Not implemented.'); - } - - sqrt(x) { - // r = x^((p + 1) / 4) mod p - const {red} = x; - const r = this.pp1d4(x); - - if (!red.sqr(r).eq(x)) - throw new SquareRootError(r); - - return r; - } - - divsqrt(u, v) { - // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p - const {red} = u; - const u2 = red.sqr(u); - const u3 = red.mul(u2, u); - const u5 = red.mul(u3, u2); - const v3 = red.mul(red.sqr(v), v); - const p = this.pm3d4(red.mul(u5, v3)); - const x = red.mul(red.mul(u3, v), p); - const c = red.mul(v, red.sqr(x)); - - if (c.eq(u)) - return x; - - throw new SquareRootError(x); - } - } - - /** - * Prime (5 mod 8) - */ - - class Prime58 extends Prime { - constructor(name, p, sm1) { - super(name, p); - - this.sm1 = new BN(sm1, 16); - } - - pm5d8(x1) { - // Exponent: (p - 5) / 8 - throw new Error('Not implemented.'); - } - - pp3d8(x1) { - // Exponent: (p + 3) / 8 - throw new Error('Not implemented.'); - } - - sqrt(x) { - // r = x^((p + 3) / 8) mod p - const {red} = x; - const sm1 = this.sm1._forceRed(red); - const r = this.pp3d8(x); - - if (red.sqr(r).eq(x)) - return r; - - const c = red.mul(r, sm1); - - if (red.sqr(c).eq(x)) - return c; - - throw new SquareRootError(r); - } - - divsqrt(u, v) { - // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p - const {red} = u; - const sm1 = this.sm1._forceRed(red); - const v3 = red.mul(red.sqr(v), v); - const v7 = red.mul(red.sqr(v3), v); - const p = this.pm5d8(red.mul(u, v7)); - const x = red.mul(red.mul(u, v3), p); - const c = red.mul(v, red.sqr(x)); - - if (c.eq(u)) - return x; - - const mc = red.ineg(c); - - if (mc.eq(u)) - return red.mul(x, sm1); - - if (mc.eq(red.mul(u, sm1))) - throw new SquareRootError(red.mul(x, sm1)); - - throw new SquareRootError(x); - } - } - - /** - * Prime (1 mod 16) - */ - - class Prime116 extends Prime { - constructor(name, p, g) { - super(name, p); - - this.g = new BN(g, 16); - this.z = this.p.subn(1).zeroBits(); - } - - powS(x1) { - // Exponent: (p - 1) / 2^k - throw new Error('Not implemented.'); - } - - powE(x1) { - // Exponent: (s + 1) / 2 - throw new Error('Not implemented.'); - } - - sqrt(x) { - // Tonelli-Shanks (variable time). - // - // Constants: - // - // k = factors of 2 for (p - 1) - // s = (p - 1) / 2^k - // e = (s + 1) / 2 - // n = first non-square in F(p) - // - // Algorithm: - // - // g = n^s mod p - // y = x^e mod p - // b = x^s mod p - // - // loop: - // t = b - // m = 0 - // - // while t != 1: - // t = t^2 mod p - // m += 1 - // - // if m == 0: - // break - // - // if m >= k: - // fail - // - // t = g^(2^(k - m - 1)) mod p - // g = t^2 mod p - // y = y * t mod p - // b = b * g mod p - // k = m - // - // return y - // - const {red} = x; - - switch (red.jacobi(x)) { - case -1: - throw new SquareRootError(x); - case 0: - return x.clone(); - } - - let g = this.g._forceRed(red); - let y = this.powE(x); - let b = this.powS(x); - let k = this.z; - - for (;;) { - let t = b; - let m = 0; - - while (t.cmpn(1) !== 0 && m < k) { - t = red.sqr(t); - m += 1; - } - - if (m === 0) - break; - - assert(m < k); - - t = red.sqrn(g, k - m - 1); - g = red.sqr(t); - y = red.mul(y, t); - b = red.mul(b, g); - k = m; - } - - return y; - } - - divsqrt(u, v) { - const {red} = u; - - if (v.isZero()) - throw new SquareRootError(v); - - return this.sqrt(red.div(u, v)); - } - } - - /** - * P192 - */ - - class P192 extends Prime34 { - constructor() { - // 2^192 - 2^64 - 1 (= 3 mod 4) - super('p192', 'ffffffff ffffffff ffffffff fffffffe' - + 'ffffffff ffffffff'); - } - - imulK(num) { - // K = 0x10000000000000001 - // K = 2^64 + 1 - const one = this.one.inject(num); - return num.iushln(64)._iadd(num, one); - } - - core(x1) { - // Exponent: (p - 3) / 4 - // Bits: 127x1 1x0 62x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x12 = red.sqrnmul(x6, 6, x6); - const x24 = red.sqrnmul(x12, 12, x12); - const x30 = red.sqrnmul(x24, 6, x6); - const x31 = red.sqrnmul(x30, 1, x1); - const x62 = red.sqrnmul(x31, 31, x31); - const x124 = red.sqrnmul(x62, 62, x62); - const x127 = red.sqrnmul(x124, 3, x3); - const r0 = red.sqrn(x127, 1); - const r1 = red.sqrnmul(r0, 62, x62); - - return r1; - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - // Bits: 127x1 1x0 62x1 - return this.core(x1); - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 127x1 1x0 62x1 1x0 1x1 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 128x1 62x0 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x4 = red.sqrnmul(x2, 2, x2); - const x8 = red.sqrnmul(x4, 4, x4); - const x16 = red.sqrnmul(x8, 8, x8); - const x32 = red.sqrnmul(x16, 16, x16); - const x64 = red.sqrnmul(x32, 32, x32); - const x128 = red.sqrnmul(x64, 64, x64); - const r0 = red.sqrn(x128, 62); - - return r0; - } - } - - /** - * P224 - */ - - class P224 extends Prime116 { - constructor() { - // 2^224 - 2^96 + 1 (1 mod 16) - super('p224', 'ffffffff ffffffff ffffffff ffffffff' - + '00000000 00000000 00000001', - '6a0fec67 8598a792 0c55b2d4 0b2d6ffb' - + 'bea3d8ce f3fb3632 dc691b74'); - } - - imulK(num) { - // K = 0xffffffffffffffffffffffff - // K = 2^96 - 1 - const one = this.one.inject(num); - return num.iushln(96)._isub(num, one); - } - - powS(x1) { - // Exponent: 2^128 - 1 - // Bits: 128x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x4 = red.sqrnmul(x2, 2, x2); - const x8 = red.sqrnmul(x4, 4, x4); - const x16 = red.sqrnmul(x8, 8, x8); - const x32 = red.sqrnmul(x16, 16, x16); - const x64 = red.sqrnmul(x32, 32, x32); - const x128 = red.sqrnmul(x64, 64, x64); - - return x128; - } - - powE(x1) { - // Exponent: 2^127 - // Bits: 1x1 127x0 - const {red} = x1; - const r0 = red.sqrn(x1, 127); - - return r0; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 127x1 1x0 96x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x12 = red.sqrnmul(x6, 6, x6); - const x24 = red.sqrnmul(x12, 12, x12); - const x48 = red.sqrnmul(x24, 24, x24); - const x96 = red.sqrnmul(x48, 48, x48); - const x120 = red.sqrnmul(x96, 24, x24); - const x126 = red.sqrnmul(x120, 6, x6); - const x127 = red.sqrnmul(x126, 1, x1); - const r0 = red.sqrn(x127, 1); - const r1 = red.sqrnmul(r0, 96, x96); - - return r1; - } - } - - /** - * P521 - */ - - class P521 extends Prime34 { - constructor() { - // 2^521 - 1 (= 3 mod 4) - super('p521', '000001ff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff'); - } - - imulK(num) { - // K = 0x01 - return num; - } - - core(x1) { - // Exponent: 2^519 - 1 - // Bits: 519x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x7 = red.sqrnmul(x6, 1, x1); - const x8 = red.sqrnmul(x7, 1, x1); - const x16 = red.sqrnmul(x8, 8, x8); - const x32 = red.sqrnmul(x16, 16, x16); - const x64 = red.sqrnmul(x32, 32, x32); - const x128 = red.sqrnmul(x64, 64, x64); - const x256 = red.sqrnmul(x128, 128, x128); - const x512 = red.sqrnmul(x256, 256, x256); - const x519 = red.sqrnmul(x512, 7, x7); - - return x519; - } - - pm3d4(x1) { - // Exponent: 2^519 - 1 - // Bits: 519x1 - return this.core(x1); - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 519x1 1x0 1x1 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 1x1 519x0 - const {red} = x1; - const r0 = red.sqrn(x1, 519); - - return r0; - } - } - - /** - * K256 - */ - - class K256 extends Prime34 { - constructor() { - // 2^256 - 2^32 - 977 (= 3 mod 4) - super('k256', 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff fffffffe fffffc2f'); - } - - split(input, output) { - // 256 = 9 * 26 + 22 - const mask = 0x3fffff; - const len = Math.min(input.length, 9); - - output._alloc(len + 1); - - for (let i = 0; i < len; i++) - output.words[i] = input.words[i]; - - output.length = len; - - if (input.length <= 9) { - output._strip(); - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs. - let prev = input.words[9]; - let i = 10; - - output.words[output.length++] = prev & mask; - output._strip(); - - for (; i < input.length; i++) { - const next = input.words[i] | 0; - - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - - prev = next; - } - - prev >>>= 22; - - input.words[i - 10] = prev; - - if (prev === 0 && input.length > 10) - input.length -= 10; - else - input.length -= 9; - - input._strip(); // Unsure if we need this. - } - - imulK(num) { - // K = 0x1000003d1 = [0x40, 0x3d1] - // K = 2^32 + 977 - num._expand(num.length + 2); - - // Bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - let lo = 0; - - for (let i = 0; i < num.length; i++) { - const w = num.words[i]; - - lo += w * 0x3d1; - - num.words[i] = lo & 0x3ffffff; - - lo = w * 0x40 + Math.floor(lo / 0x4000000); - } - - // Fast length reduction. - if (num.words[num.length - 1] === 0) { - num.length -= 1; - if (num.words[num.length - 1] === 0) - num.length -= 1; - } - - // Note: we shouldn't need to strip here. - return num; - } - - core(x1, x2) { - // Exponent: (p - 47) / 64 - // Bits: 223x1 1x0 22x1 4x0 - const {red} = x1; - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x9 = red.sqrnmul(x6, 3, x3); - const x11 = red.sqrnmul(x9, 2, x2); - const x22 = red.sqrnmul(x11, 11, x11); - const x44 = red.sqrnmul(x22, 22, x22); - const x88 = red.sqrnmul(x44, 44, x44); - const x176 = red.sqrnmul(x88, 88, x88); - const x220 = red.sqrnmul(x176, 44, x44); - const x223 = red.sqrnmul(x220, 3, x3); - const r0 = red.sqrn(x223, 1); - const r1 = red.sqrnmul(r0, 22, x22); - const r2 = red.sqrn(r1, 4); - - return r2; - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r2 = this.core(x1, x2); - const r3 = red.sqrnmul(r2, 1, x1); - const r4 = red.sqrn(r3, 1); - const r5 = red.sqrnmul(r4, 2, x2); - - return r5; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 1x0 1x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r2 = this.core(x1, x2); - const r3 = red.sqrnmul(r2, 1, x1); - const r4 = red.sqrn(r3, 1); - const r5 = red.sqrnmul(r4, 2, x2); - const r6 = red.sqrn(r5, 1); - const r7 = red.sqrnmul(r6, 1, x1); - - return r7; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 223x1 1x0 22x1 4x0 2x1 2x0 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r2 = this.core(x1, x2); - const r3 = red.sqrnmul(r2, 2, x2); - const r4 = red.sqrn(r3, 2); - - return r4; - } - } - - /** - * P251 - */ - - class P251 extends Prime34 { - constructor() { - // 2^251 - 9 - super('p251', '07ffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff fffffff7'); - } - - imulK(num) { - // K = 0x09 - if (num.isZero()) - return num; - - let carry = 0; - - for (let i = 0; i < num.length; i++) { - const w = num.words[i] * 0x09 + carry; - - carry = w >>> 26; - - num.words[i] = w & 0x3ffffff; - } - - if (carry !== 0) { - num._alloc(num.length + 1); - num.words[num.length++] = carry; - } - - // Note: we shouldn't need to strip here. - return num; - } - - core(x1) { - // Exponent: 2^247 - 1 - // Bits: 247x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x12 = red.sqrnmul(x6, 6, x6); - const x24 = red.sqrnmul(x12, 12, x12); - const x48 = red.sqrnmul(x24, 24, x24); - const x96 = red.sqrnmul(x48, 48, x48); - const x192 = red.sqrnmul(x96, 96, x96); - const x240 = red.sqrnmul(x192, 48, x48); - const x246 = red.sqrnmul(x240, 6, x6); - const x247 = red.sqrnmul(x246, 1, x1); - - return x247; - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - // Bits: 247x1 1x0 1x1 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 247x1 1x0 1x1 1x0 1x1 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - const r3 = red.sqrn(r2, 1); - const r4 = red.sqrnmul(r3, 1, x1); - - return r4; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 248x1 1x0 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrnmul(r0, 1, x1); - const r2 = red.sqrn(r1, 1); - - return r2; - } - } - - /** - * P25519 - */ - - class P25519 extends Prime58 { - constructor() { - // 2^255 - 19 (= 5 mod 8) - super('p25519', '7fffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff ffffffed', - '2b832480 4fc1df0b 2b4d0099 3dfbd7a7' - + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'); - } - - imulK(num) { - // K = 0x13 - let carry = 0; - - for (let i = 0; i < num.length; i++) { - const w = num.words[i] * 0x13 + carry; - - carry = w >>> 26; - - num.words[i] = w & 0x3ffffff; - } - - if (carry !== 0) { - num._alloc(num.length + 1); - num.words[num.length++] = carry; - } - - // Note: we shouldn't need to strip here. - return num; - } - - core(x1, x2) { - // Exponent: 2^250 - 1 - // Bits: 250x1 - const {red} = x1; - const x4 = red.sqrnmul(x2, 2, x2); - const x5 = red.sqrnmul(x4, 1, x1); - const x10 = red.sqrnmul(x5, 5, x5); - const x20 = red.sqrnmul(x10, 10, x10); - const x40 = red.sqrnmul(x20, 20, x20); - const x50 = red.sqrnmul(x40, 10, x10); - const x100 = red.sqrnmul(x50, 50, x50); - const x200 = red.sqrnmul(x100, 100, x100); - const x250 = red.sqrnmul(x200, 50, x50); - - return x250; - } - - pm5d8(x1) { - // Exponent: (p - 5) / 8 - // Bits: 250x1 1x0 1x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r0 = this.core(x1, x2); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 250x1 1x0 1x1 1x0 2x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r0 = this.core(x1, x2); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - const r3 = red.sqrn(r2, 1); - const r4 = red.sqrnmul(r3, 2, x2); - - return r4; - } - - pp3d8(x1) { - // Exponent: (p + 3) / 8 - // Bits: 251x1 1x0 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r0 = this.core(x1, x2); - const r1 = red.sqrnmul(r0, 1, x1); - const r2 = red.sqrn(r1, 1); - - return r2; - } - } - - /** - * P448 - */ - - class P448 extends Prime34 { - constructor() { - // 2^448 - 2^224 - 1 (= 3 mod 4) - super('p448', 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff fffffffe ffffffff' - + 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff'); - } - - imulK(num) { - // K = 0x100000000000000000000000000000000000000000000000000000001 - // K = 2^224 + 1 - const one = this.one.inject(num); - return num.iushln(224)._iadd(num, one); - } - - core(x1, x2) { - // Exponent: 2^222 - 1 - // Bits: 222x1 - const {red} = x1; - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x9 = red.sqrnmul(x6, 3, x3); - const x11 = red.sqrnmul(x9, 2, x2); - const x22 = red.sqrnmul(x11, 11, x11); - const x44 = red.sqrnmul(x22, 22, x22); - const x88 = red.sqrnmul(x44, 44, x44); - const x176 = red.sqrnmul(x88, 88, x88); - const x220 = red.sqrnmul(x176, 44, x44); - const x222 = red.sqrnmul(x220, 2, x2); - - return x222; - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - // Bits: 223x1 1x0 222x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x222 = this.core(x1, x2); - const r0 = red.sqrnmul(x222, 1, x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 222, x222); - - return r2; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 223x1 1x0 222x1 1x0 1x1 - const {red} = x1; - const r0 = this.pm3d4(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 224x1 222x0 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r0 = this.core(x1, x2); - const r1 = red.sqrnmul(r0, 2, x2); - const r2 = red.sqrn(r1, 222); - - return r2; - } - } - - /** - * Reduction Engine - */ - - class Red { - constructor(m) { - let prime = null; - - if (typeof m === 'string') { - prime = BN._prime(m); - m = prime.p; - } - - enforce(BN.isBN(m), 'm', 'bignum'); - nonred(!m.red, 'reduction'); - range(m.sign() > 0, 'reduction'); - - this.m = m; - this.prime = prime; - this.mb = null; - this.sm1 = null; - } - - _verify1(a) { - range(a.negative === 0, 'red'); - red(a.red != null, 'red'); - } - - _verify2(a, b) { - range((a.negative | b.negative) === 0, 'red'); - red(a.red != null && a.red === b.red, 'red'); - } - - get mont() { - return false; - } - - precompute() { - // Precompute `sqrt(-1)` for primes congruent to 5 mod 8. - if (this.sm1 === null && this.m.andln(7) === 5) { - if (this.prime) { - this.sm1 = this.prime.sm1.clone()._forceRed(this); - } else { - const x = new BN(2).toRed(this); - const e = this.m.subn(1).iushrn(2); - - // sqrt(-1) = 2^((p - 1) / 4) mod p - this.sm1 = this.pow(x, e); - } - } - - return this; - } - - convertTo(num) { - const res = num.mod(this.m); - res.red = this; - return res; - } - - convertFrom(num) { - const res = num.clone(); - res.red = null; - return res; - } - - intTo(a) { - return a; - } - - intFrom(a) { - return a; - } - - imod(a) { - if (this.prime) - return this.prime.ireduce(a)._forceRed(this); - - return a.imod(this.m)._forceRed(this); - } - - iadd(a, b) { - this._verify2(a, b); - - a._iadd(a, b); - - if (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - - return a; - } - - add(a, b) { - if (a.length < b.length) - return this.iadd(b.clone(), a); - - return this.iadd(a.clone(), b); - } - - iaddn(a, num) { - this._verify1(a); - - if (num < 0) - return this.isubn(a, -num); - - if (this.m.length === 1) - num %= this.m.words[0]; - - a._iaddn(num); - - if (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - - return a; - } - - addn(a, num) { - return this.iaddn(a.clone(), num); - } - - isub(a, b) { - this._verify2(a, b); - - // 0: a - a mod m == 0 - // -1: a - b mod m == m - (b - a) - // +1: a - b mod m == a - b - const cmp = a.ucmp(b); - - if (cmp === 0) { - a.words[0] = 0; - a.length = 1; - return a; - } - - if (cmp < 0) { - a._isub(b, a); - a._isub(this.m, a); - } else { - a._isub(a, b); - } - - return a; - } - - sub(a, b) { - return this.isub(a.clone(), b); - } - - isubn(a, num) { - this._verify1(a); - - if (num < 0) - return this.iaddn(a, -num); - - if (this.m.length === 1) - num %= this.m.words[0]; - - // <: a - b mod m == m - (b - a) - // >=: a - b mod m == a - b - if (a.length === 1 && a.words[0] < num) { - a.words[0] = num - a.words[0]; - a._isub(this.m, a); - } else { - a._isubn(num); - } - - return a; - } - - subn(a, num) { - return this.isubn(a.clone(), num); - } - - imul(a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - } - - mul(a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - } - - imuln(a, num) { - this._verify1(a); - - if (a.isZero()) - return a; - - if (num === 0) { - a.words[0] = 0; - a.length = 1; - return a; - } - - const neg = num < 0; - - if (neg) - num = -num; - - if (this.m.length === 1) - num %= this.m.words[0]; - - a.imuln(num); - - if (num <= 16) { - // Quick reduction. - while (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - } else { - this.imod(a); - } - - if (neg) - this.ineg(a); - - return a; - } - - muln(a, num) { - return this.imuln(a.clone(), num); - } - - idiv(a, b) { - return this.div(a, b)._move(a); - } - - div(a, b) { - return this.mul(a, this.invert(b)); - } - - idivn(a, num) { - return this.divn(a, num)._move(a); - } - - divn(a, num) { - return this.div(a, this.convertTo(new BN(num))); - } - - ipow(a, num) { - return this.pow(a, num)._move(a); - } - - pow(a, num) { - this._verify1(a); - - if (num.isNeg()) - a = this.invert(a); - - // Small exponent. - if (num.length === 1) - return this.pown(a, num.words[0]); - - // Call out to BigInt. - if (HAS_BIGINT && !this.prime) - return this.powInt(a, num); - - // Otherwise, a BN implementation. - return this.powNum(a, num); - } - - powNum(a, num) { - // Sliding window (odd multiples only). - const one = new BN(1).toRed(this); - const wnd = new Array(WND_SIZE); - const a2 = this.sqr(a); - - wnd[0] = a; - - for (let i = 1; i < WND_SIZE; i++) - wnd[i] = this.mul(wnd[i - 1], a2); - - let i = num.bitLength(); - let r = one; - - while (i >= WND_WIDTH) { - let width = WND_WIDTH; - let bits = num.bits(i - width, width); - - if (bits < WND_SIZE) { - r = this.sqr(r); - i -= 1; - continue; - } - - while ((bits & 1) === 0) { - width -= 1; - bits >>= 1; - } - - if (r === one) { - r = wnd[bits >> 1].clone(); - } else { - r = this.sqrn(r, width); - r = this.mul(r, wnd[bits >> 1]); - } - - i -= width; - } - - if (i > 0) { - const bits = num.bits(0, i); - - while (i--) { - r = this.sqr(r); - - if ((bits >> i) & 1) - r = this.mul(r, a); - } - } - - return r; - } - - powInt(a, num) { - if (this.mb === null) - this.mb = this.m.toBigInt(); - - const x = this.intFrom(a.toBigInt()); - const y = powInt(x, num, this.mb); - const z = this.intTo(y); - - return BN.fromBigInt(z)._forceRed(this); - } - - sqrn(a, n) { - while (n--) - a = this.sqr(a); - - return a; - } - - sqrnmul(a, n, b) { - return this.mul(this.sqrn(a, n), b); - } - - ipown(a, num) { - return this.pown(a, num)._move(a); - } - - pown(a, num) { - this._verify1(a); - - if (num < 0) { - a = this.invert(a); - num = -num; - } - - if (num === 0) - return new BN(1).toRed(this); - - if (num === 1) - return a.clone(); - - const bits = countBits(num); - - let r = a; - - for (let i = bits - 2; i >= 0; i--) { - r = this.sqr(r); - - if ((num >> i) & 1) - r = this.mul(r, a); - } - - return r; - } - - isqr(a) { - return this.imul(a, a); - } - - sqr(a) { - return this.mul(a, a); - } - - isqrt(x) { - return this.sqrt(x)._move(x); - } - - sqrt(x) { - this._verify1(x); - - // Optimized square root chain. - if (this.prime) - return this.prime.sqrt(x); - - // Fast case (p = 3 mod 4). - if (this.m.andln(3) === 3) - return this.sqrt3mod4(x); - - // Fast case (p = 5 mod 8). - if (this.m.andln(7) === 5) { - if (this.sm1 != null) - return this.sqrt5mod8sm1(x); - return this.sqrt5mod8(x); - } - - // Slow case (Tonelli-Shanks). - return this.sqrt0(x); - } - - sqrt3mod4(x) { - const e = this.m.addn(1).iushrn(2); // (p + 1) / 4 - const b = this.pow(x, e); - - if (!this.sqr(b).eq(x)) - throw new SquareRootError(b); - - return b; - } - - sqrt5mod8(x) { - // Atkin's Algorithm. - const one = new BN(1).toRed(this); - const e = this.m.ushrn(3); // (p - 5) / 8 - const x2 = this.add(x, x); - const alpha = this.pow(x2, e); - const beta = this.mul(x2, this.sqr(alpha)); - const b = this.mul(this.mul(alpha, x), this.isub(beta, one)); - - if (!this.sqr(b).eq(x)) - throw new SquareRootError(b); - - return b; - } - - sqrt5mod8sm1(x) { - const e = this.m.addn(3).iushrn(3); // (p + 3) / 8 - const b = this.pow(x, e); - - if (this.sqr(b).eq(x)) - return b; - - const c = this.mul(b, this.sm1); - - if (this.sqr(c).eq(x)) - return c; - - throw new SquareRootError(b); - } - - sqrt0(x) { - if (this.m.cmpn(1) === 0 || !this.m.isOdd()) - throw new Error('Invalid prime.'); - - switch (this.jacobi(x)) { - case -1: - throw new SquareRootError(x); - case 0: - return x.clone(); - } - - const one = new BN(1).toRed(this); - const s = this.m.subn(1); - const e = s._makeOdd(); - const n = new BN(2).toRed(this); - - while (this.jacobi(n) !== -1) - this.iadd(n, one); - - let g = this.pow(n, s); - let b = this.pow(x, s); - let y = this.pow(x, s.iaddn(1).iushrn(1)); - let k = e; - - for (;;) { - let t = b; - let m = 0; - - while (!t.eq(one) && m < k) { - t = this.sqr(t); - m += 1; - } - - if (m === 0) - break; - - assert(m < k); - - t = this.sqrn(g, k - m - 1); - g = this.sqr(t); - y = this.mul(y, t); - b = this.mul(b, g); - k = m; - } - - return y; - } - - idivsqrt(u, v) { - return this.divsqrt(u, v)._move(u); - } - - divsqrt(u, v) { - this._verify2(u, v); - - // u = 0, v = 0 - if (u.isZero() && v.isZero()) - throw new SquareRootError(v); - - // Optimized inverse square root chain. - if (this.prime) - return this.prime.divsqrt(u, v); - - // p = 3 mod 4 - if (this.m.andln(3) === 3) - return this.divsqrt3mod4(u, v); - - // p = 5 mod 8 - if (this.sm1 != null && this.m.andln(7) === 5) - return this.divsqrt5mod8(u, v); - - // v = 0 - if (v.isZero()) - throw new SquareRootError(v); - - return this.sqrt(this.div(u, v)); - } - - divsqrt3mod4(u, v) { - // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p - const e = this.m.subn(3).iushrn(2); - const u2 = this.sqr(u); - const u3 = this.mul(u2, u); - const u5 = this.mul(u3, u2); - const v3 = this.mul(this.sqr(v), v); - const p = this.pow(this.mul(u5, v3), e); - const x = this.mul(this.mul(u3, v), p); - const c = this.mul(v, this.sqr(x)); - - if (c.eq(u)) - return x; - - throw new SquareRootError(x); - } - - divsqrt5mod8(u, v) { - // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p - const e = this.m.subn(5).iushrn(3); - const v3 = this.mul(this.sqr(v), v); - const v7 = this.mul(this.sqr(v3), v); - const p = this.pow(this.mul(u, v7), e); - const x = this.mul(this.mul(u, v3), p); - const c = this.mul(v, this.sqr(x)); - - if (c.eq(u)) - return x; - - const mc = this.ineg(c); - - if (mc.eq(u)) - return this.mul(x, this.sm1); - - if (mc.eq(this.mul(u, this.sm1))) - throw new SquareRootError(this.mul(x, this.sm1)); - - throw new SquareRootError(x); - } - - isSquare(a) { - if (this.m.isOdd()) - return this.jacobi(a) >= 0; - - return this.kronecker(a) >= 0; - } - - ishl(a, num) { - this._verify1(a); - return this.imod(a.iushl(num)); - } - - shl(a, num) { - return this.ishl(a.clone(), num); - } - - ishln(a, num) { - this._verify1(a); - - a.iushln(num); - - if (num <= 4) { - // Quick reduction. - while (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - } else { - this.imod(a); - } - - return a; - } - - shln(a, num) { - return this.ishln(a.clone(), num); - } - - ineg(a) { - this._verify1(a); - - if (!a.isZero()) - a._isub(this.m, a); - - return a; - } - - neg(a) { - return this.ineg(a.clone()); - } - - eq(a, b) { - this._verify2(a, b); - return a.ucmp(b) === 0; - } - - eqn(a, num) { - this._verify1(a); - - if (this.m.length === 1) { - num %= this.m.words[0]; - - if (num < 0) - num += this.m.words[0]; - - return a.ucmpn(num) === 0; - } - - if (num < 0) { - this.m._isubn(-num); - - const cmp = a.ucmp(this.m); - - this.m._iaddn(-num); - - return cmp === 0; - } - - return a.ucmpn(num) === 0; - } - - isHigh(a) { - return !this.isLow(a); - } - - isLow(a) { - this._verify1(a); - return a.ucmp(this.m.ushrn(1)) <= 0; - } - - isOdd(a) { - this._verify1(a); - return a.isOdd(); - } - - isEven(a) { - this._verify1(a); - return a.isEven(); - } - - legendre(num) { - this._verify1(num); - - if (this.m.isEven()) - throw new Error('legendre: `num` must be odd.'); - - // Euler's criterion. - const e = this.m.subn(1).iushrn(1); // (p - 1) / 2 - const symbol = this.pow(num, e); - - if (symbol.isZero()) - return 0; - - const one = new BN(1).toRed(this); - - if (symbol.eq(one)) - return 1; - - if (symbol.eq(this.ineg(one))) - return -1; - - throw new Error('Invalid prime.'); - } - - jacobi(a) { - this._verify1(a); - return a.jacobi(this.m); - } - - kronecker(a) { - this._verify1(a); - return a.kronecker(this.m); - } - - iinvert(a) { - return this.invert(a)._move(a); - } - - invert(a) { - this._verify1(a); - return a.invert(this.m)._forceRed(this); - } - - ifermat(a) { - return this.fermat(a)._move(a); - } - - fermat(a) { - this._verify1(a); - - if (a.isZero() || this.m.cmpn(1) === 0) - throw new RangeError('Not invertible.'); - - // Optimized inversion chain. - if (this.prime) - return this.prime.fermat(a); - - // Invert using fermat's little theorem. - return this.pow(a, this.m.subn(2)); - } - - invertAll(elems) { - // Montgomery's trick. - enforce(Array.isArray(elems), 'elems', 'array'); - - for (const elem of elems) { - enforce(BN.isBN(elem), 'elem', 'bignum'); - - this._verify1(elem); - } - - if (this.m.cmpn(1) === 0 || this.m.isEven()) - throw new RangeError('Not invertible.'); - - const len = elems.length; - const invs = new Array(len); - - if (len === 0) - return invs; - - let acc = new BN(1).toRed(this); - - for (let i = 0; i < len; i++) { - if (elems[i].isZero()) { - invs[i] = elems[i].clone(); - continue; - } - - invs[i] = acc; - acc = this.mul(acc, elems[i]); - } - - acc = this.invert(acc); - - for (let i = len - 1; i >= 0; i--) { - if (elems[i].isZero()) - continue; - - invs[i] = this.mul(acc, invs[i]); - acc = this.mul(acc, elems[i]); - } - - return invs; - } - - [custom]() { - if (this.prime) - return ``; - - return ``; - } - } - - /** - * Barrett Engine - */ - - class Barrett extends Red { - constructor(m) { - super(m); - - this.prime = null; - this.n = this.m.bitLength(); - - if ((this.n % 26) !== 0) - this.n += 26 - (this.n % 26); - - this.k = this.n * 2; - this.w = this.k / 26; - this.b = BN.shift(1, this.k).div(this.m); - } - - convertTo(num) { - if (num.length > this.w) - return super.convertTo(num); - - return this.imod(num.clone()); - } - - _shift(q) { - let i = 0; - let j = this.w; - - while (j < q.length) - q.words[i++] = q.words[j++]; - - if (i === 0) - q.words[i++] = 0; - - q.length = i; - } - - imod(a) { - const neg = a.negative; - - assert(a.length <= this.w); - - a.negative = 0; - - const q = a.mul(this.b); - - // Shift right by `k` bits. - this._shift(q); - - a._isub(a, q.mul(this.m)); - - if (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - - if (neg && !a.isZero()) - a._isub(this.m, a); - - a.red = this; - - return a; - } - } - - /** - * Montgomery Engine - */ - - class Mont extends Red { - constructor(m) { - super(m); - - // Note that: - // - // mi = (-m^-1 mod (2^(n * 2))) mod r - // - // and: - // - // mi = (((2^n)^-1 mod m) * r^-1 - 1) / m - // - // are equivalent. - this.prime = null; - this.n = this.m.length * 26; - this.r = BN.shift(1, this.n); - this.r2 = BN.shift(1, this.n * 2).imod(this.m); - this.ri = this.r.invert(this.m); - this.mi = this.r.mul(this.ri).isubn(1).div(this.m); - this.rib = null; - } - - get mont() { - return true; - } - - convertTo(num) { - if (num.isNeg() || num.ucmp(this.m) >= 0) - return this.imod(num.ushln(this.n)); - - // Equivalent to: (num * 2^n) mod m - return this.mul(num, this.r2); - } - - convertFrom(num) { - // Equivalent to: num * r^-1 mod m - const r = this.mul(num, new BN(1)); - r.red = null; - return r; - } - - intTo(a) { - return (a << BigInt(this.n)) % this.mb; - } - - intFrom(a) { - if (this.rib === null) - this.rib = this.ri.toBigInt(); - - return (a * this.rib) % this.mb; - } - - iaddn(a, num) { - return this.iadd(a, this.convertTo(new BN(num))); - } - - isubn(a, num) { - return this.isub(a, this.convertTo(new BN(num))); - } - - imul(a, b) { - return this.mul(a, b)._move(a); - } - - mul(a, b) { - if (a.isZero() || b.isZero()) - return new BN(0)._forceRed(this); - - const t = a.mul(b); - const c = t.umaskn(this.n).mul(this.mi).iumaskn(this.n); - const u = t.iadd(c.mul(this.m)).iushrn(this.n); - - if (u.ucmp(this.m) >= 0) - u._isub(u, this.m); - - return u._forceRed(this); - } - - imuln(a, num) { - this._verify1(a); - - if (a.isZero()) - return a; - - if (num === 0) { - a.words[0] = 0; - a.length = 1; - return a; - } - - const neg = num < 0; - - if (neg) - num = -num; - - if (this.m.length === 1) - num %= this.m.words[0]; - - const bits = countBits(num); - - // Potentially compute with additions. - // This avoids an expensive division. - if (bits > 5) { - // Slow case (num > 31). - this.imul(a, this.convertTo(new BN(num))); - } else if ((num & (num - 1)) === 0) { - // Optimize for powers of two. - for (let i = 0; i < bits - 1; i++) - this.iadd(a, a); - } else { - // Multiply left to right. - const c = a.clone(); - - for (let i = bits - 2; i >= 0; i--) { - this.iadd(a, a); - - if ((num >> i) & 1) - this.iadd(a, c); - } - } - - if (neg) - this.ineg(a); - - return a; - } - - eqn(a, num) { - this._verify1(a); - - if (num === 0) - return a.isZero(); - - return a.ucmp(this.convertTo(new BN(num))) === 0; - } - - isLow(a) { - this._verify1(a); - return this.convertFrom(a).ucmp(this.m.ushrn(1)) <= 0; - } - - isOdd(a) { - this._verify1(a); - return this.convertFrom(a).isOdd(); - } - - isEven(a) { - this._verify1(a); - return this.convertFrom(a).isEven(); - } - - invert(a) { - this._verify1(a); - - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - return this.imod(a.invert(this.m).mul(this.r2)); - } - } - - /* - * Helpers - */ - - function makeError(Error, msg, start) { - const err = new Error(msg); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, start); - - return err; - } - - function assert(value, message) { - if (!value) { - const msg = message || 'Assertion failed.'; - throw makeError(Error, msg, assert); - } - } - - function enforce(value, name, type) { - if (!value) { - const msg = `"${name}" must be a(n) ${type}.`; - throw makeError(TypeError, msg, enforce); - } - } - - function range(value, name) { - if (!value) { - const msg = `"${name}" only works with positive numbers.`; - throw makeError(RangeError, msg, range); - } - } - - function red(value, name) { - if (!value) { - const msg = `"${name}" only works with red numbers.`; - throw makeError(TypeError, msg, red); - } - } - - function nonred(value, name) { - if (!value) { - const msg = `"${name}" only works with normal numbers.`; - throw makeError(TypeError, msg, nonred); - } - } - - function nonzero(value) { - if (!value) { - const msg = 'Cannot divide by zero.'; - throw makeError(RangeError, msg, nonzero); - } - } - - class SquareRootError extends Error { - constructor(result) { - super(); - - this.name = 'SquareRootError'; - this.message = 'X is not a square mod P.'; - this.result = result.fromRed(); - - if (Error.captureStackTrace) - Error.captureStackTrace(this, SquareRootError); - } - } - - function isInteger(num) { - return Number.isSafeInteger(num); - } - - function isSMI(num) { - return isInteger(num) - && num >= -67108863 - && num <= 0x3ffffff; - } - - function allocate(ArrayType, size) { - if (ArrayType.allocUnsafeSlow) - return ArrayType.allocUnsafeSlow(size); - - return new ArrayType(size); - } - - function getBase(base) { - if (base == null) - return 10; - - if (typeof base === 'number') - return base; - - switch (base) { - case 'bin': - return 2; - case 'oct': - return 8; - case 'dec': - return 10; - case 'hex': - return 16; - } - - return 0; - } - - /* - * Internal - */ - - function countBits(w) { - if (Math.clz32) - return 32 - Math.clz32(w); - - let t = w; - let r = 0; - - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - - return r + t; - } - - function zeroBits(w) { - // Shortcut. - if (w === 0) - return 26; - - let t = w; - let r = 0; - - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - - if ((t & 0x1) === 0) - r += 1; - - return r; - } - - function parseHex(str, start, end) { - const len = Math.min(str.length, end); - - let r = 0; - let z = 0; - - for (let i = start; i < len; i++) { - const c = str.charCodeAt(i) - 48; - - r <<= 4; - - let b; - - if (c >= 49 && c <= 54) { - // 'a' - 'f' - b = c - 49 + 0xa; - } else if (c >= 17 && c <= 22) { - // 'A' - 'F' - b = c - 17 + 0xa; - } else { - // '0' - '9' - b = c; - } - - r |= b; - z |= b; - } - - if (z & -16) - throw new Error('Invalid string.'); - - return r; - } - - function parseBase(str, start, end, mul) { - const len = Math.min(str.length, end); - - let r = 0; - - for (let i = start; i < len; i++) { - const c = str.charCodeAt(i) - 48; - - r *= mul; - - let b; - - if (c >= 49) { - // 'a' - b = c - 49 + 0xa; - } else if (c >= 17) { - // 'A' - b = c - 17 + 0xa; - } else { - // '0' - '9' - b = c; - } - - if (c < 0 || c > 207 || b >= mul) - throw new Error('Invalid string.'); - - r += b; - } - - return r; - } - - /* - * Exponentiation (bigint) - */ - - function powInt(x, e, m) { - // Sliding window (odd multiples only). - const one = BigInt(1); - const wnd = new Array(WND_SIZE); - const x2 = (x * x) % m; - - wnd[0] = x; - - for (let i = 1; i < WND_SIZE; i++) - wnd[i] = (wnd[i - 1] * x2) % m; - - let i = e.bitLength(); - let r = one; - - while (i >= WND_WIDTH) { - let width = WND_WIDTH; - let bits = e.bits(i - width, width); - - if (bits < WND_SIZE) { - r = (r * r) % m; - i -= 1; - continue; - } - - while ((bits & 1) === 0) { - width -= 1; - bits >>= 1; - } - - if (r === one) { - r = wnd[bits >> 1]; - } else { - r = sqrn(r, width, m); - r = (r * wnd[bits >> 1]) % m; - } - - i -= width; - } - - if (i > 0) { - const bits = e.bits(0, i); - - while (i--) { - r = (r * r) % m; - - if ((bits >> i) & 1) - r = (r * x) % m; - } - } - - return r; - } - - function sqrn(x, n, m) { - for (let i = 0; i < n; i++) - x = (x * x) % m; - return x; - } - - /* - * Multiplication - */ - - function smallMulTo(self, num, out) { - const len = self.length + num.length; - - out.negative = self.negative ^ num.negative; - out._alloc(len); - out.length = len; - - // Peel one iteration (compiler can't - // do it, because of code complexity). - const a = self.words[0]; - const b = num.words[0]; - const r = a * b; - const lo = r & 0x3ffffff; - - let carry = (r / 0x4000000) | 0; - let k = 1; - - out.words[0] = lo; - - for (; k < out.length - 1; k++) { - // Sum all words with the same - // `i + j = k` and accumulate - // `ncarry`, note that ncarry - // could be >= 0x3ffffff. - let ncarry = carry >>> 26; - let rword = carry & 0x3ffffff; - - const min = Math.max(0, k - self.length + 1); - const max = Math.min(k, num.length - 1); - - for (let j = min; j <= max; j++) { - const i = k - j; - const a = self.words[i]; - const b = num.words[j]; - const r = a * b + rword; - - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - - out.words[k] = rword | 0; - carry = ncarry | 0; - } - - if (carry !== 0) - out.words[k] = carry | 0; - else - out.length -= 1; - - return out._strip(); - } - - function bigMulTo(self, num, out) { - const len = self.length + num.length; - - out.negative = self.negative ^ num.negative; - out._alloc(len); - out.length = len; - - let carry = 0; - let hncarry = 0; - let k = 0; - - for (; k < out.length - 1; k++) { - // Sum all words with the same - // `i + j = k` and accumulate - // `ncarry`, note that ncarry - // could be >= 0x3ffffff. - let ncarry = hncarry; - - hncarry = 0; - - let rword = carry & 0x3ffffff; - - const min = Math.max(0, k - self.length + 1); - const max = Math.min(k, num.length - 1); - - for (let j = min; j <= max; j++) { - const i = k - j; - const a = self.words[i]; - const b = num.words[j]; - const r = a * b; - - let lo = r & 0x3ffffff; - - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - - if (carry !== 0) - out.words[k] = carry; - else - out.length -= 1; - - return out._strip(); - } - - function jumboMulTo(x, y, out) { - // v8 has a 2147483519 bit max (~256mb). - if (!HAS_BIGINT || x.length + y.length > 82595519) - return bigMulTo(x, y, out); - - const zero = BigInt(0); - const mask = BigInt(0x3ffffff); - const shift = BigInt(26); - - let z = x.toBigInt() * y.toBigInt(); - - const neg = (z < zero) | 0; - - if (neg) - z = -z; - - let i = 0; - - while (z > zero) { - out.words[i++] = Number(z & mask); - z >>= shift; - } - - if (i === 0) - out.words[i++] = 0; - - out.length = i; - out.negative = neg; - - return out; - } - - function comb10MulTo(self, num, out) { - const a = self.words; - const b = num.words; - const o = out.words; - const a0 = a[0] | 0; - const al0 = a0 & 0x1fff; - const ah0 = a0 >>> 13; - const a1 = a[1] | 0; - const al1 = a1 & 0x1fff; - const ah1 = a1 >>> 13; - const a2 = a[2] | 0; - const al2 = a2 & 0x1fff; - const ah2 = a2 >>> 13; - const a3 = a[3] | 0; - const al3 = a3 & 0x1fff; - const ah3 = a3 >>> 13; - const a4 = a[4] | 0; - const al4 = a4 & 0x1fff; - const ah4 = a4 >>> 13; - const a5 = a[5] | 0; - const al5 = a5 & 0x1fff; - const ah5 = a5 >>> 13; - const a6 = a[6] | 0; - const al6 = a6 & 0x1fff; - const ah6 = a6 >>> 13; - const a7 = a[7] | 0; - const al7 = a7 & 0x1fff; - const ah7 = a7 >>> 13; - const a8 = a[8] | 0; - const al8 = a8 & 0x1fff; - const ah8 = a8 >>> 13; - const a9 = a[9] | 0; - const al9 = a9 & 0x1fff; - const ah9 = a9 >>> 13; - const b0 = b[0] | 0; - const bl0 = b0 & 0x1fff; - const bh0 = b0 >>> 13; - const b1 = b[1] | 0; - const bl1 = b1 & 0x1fff; - const bh1 = b1 >>> 13; - const b2 = b[2] | 0; - const bl2 = b2 & 0x1fff; - const bh2 = b2 >>> 13; - const b3 = b[3] | 0; - const bl3 = b3 & 0x1fff; - const bh3 = b3 >>> 13; - const b4 = b[4] | 0; - const bl4 = b4 & 0x1fff; - const bh4 = b4 >>> 13; - const b5 = b[5] | 0; - const bl5 = b5 & 0x1fff; - const bh5 = b5 >>> 13; - const b6 = b[6] | 0; - const bl6 = b6 & 0x1fff; - const bh6 = b6 >>> 13; - const b7 = b[7] | 0; - const bl7 = b7 & 0x1fff; - const bh7 = b7 >>> 13; - const b8 = b[8] | 0; - const bl8 = b8 & 0x1fff; - const bh8 = b8 >>> 13; - const b9 = b[9] | 0; - const bl9 = b9 & 0x1fff; - const bh9 = b9 >>> 13; - - let c = 0; - let lo, mid, hi; - - out.negative = self.negative ^ num.negative; - out._alloc(20); - out.length = 19; - - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - - let w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - - let w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - - let w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - - let w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - - let w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - - let w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - - let w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - - let w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - - let w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - - let w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - - let w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - - let w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - - let w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - - let w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - - let w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - - let w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - - let w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - - let w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - - let w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - - if (c !== 0) { - o[19] = c; - out.length += 1; - } - - // Note: we shouldn't need to strip here. - return out; - } - - // Polyfill comb. - if (!Math.imul) - comb10MulTo = smallMulTo; - - /* - * Expose - */ - - BN.Red = Red; - - bn = BN; - return bn; -} - -/*! - * bn.js - big numbers for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var bnBrowser; -var hasRequiredBnBrowser; - -function requireBnBrowser () { - if (hasRequiredBnBrowser) return bnBrowser; - hasRequiredBnBrowser = 1; - - bnBrowser = requireBn(); - return bnBrowser; -} - -var chacha20; -var hasRequiredChacha20; - -function requireChacha20 () { - if (hasRequiredChacha20) return chacha20; - hasRequiredChacha20 = 1; - - const assert = requireAssert(); - - /* - * Constants - */ - - const BIG_ENDIAN = new Int8Array(new Int16Array([1]).buffer)[0] === 0; - - /** - * ChaCha20 - */ - - class ChaCha20 { - /** - * Create a ChaCha20 context. - * @constructor - */ - - constructor() { - this.state = new Uint32Array(16); - this.stream = new Uint32Array(16); - this.bytes = new Uint8Array(this.stream.buffer); - this.pos = -1; - - if (BIG_ENDIAN) - this.bytes = bufferExports.Buffer.alloc(64); - } - - /** - * Initialize chacha20 with a key, nonce, and counter. - * @param {Buffer} key - * @param {Buffer} nonce - * @param {Number} counter - */ - - init(key, nonce, counter) { - if (counter == null) - counter = 0; - - assert(bufferExports.Buffer.isBuffer(key)); - assert(bufferExports.Buffer.isBuffer(nonce)); - assert(Number.isSafeInteger(counter)); - - if (key.length !== 16 && key.length !== 32) - throw new RangeError('Invalid key size.'); - - if (nonce.length >= 24) { - key = ChaCha20.derive(key, nonce.slice(0, 16)); - nonce = nonce.slice(16); - } - - this.state[0] = 0x61707865; - this.state[1] = key.length < 32 ? 0x3120646e : 0x3320646e; - this.state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32; - this.state[3] = 0x6b206574; - this.state[4] = readU32(key, 0); - this.state[5] = readU32(key, 4); - this.state[6] = readU32(key, 8); - this.state[7] = readU32(key, 12); - this.state[8] = readU32(key, 16 % key.length); - this.state[9] = readU32(key, 20 % key.length); - this.state[10] = readU32(key, 24 % key.length); - this.state[11] = readU32(key, 28 % key.length); - this.state[12] = counter >>> 0; - - if (nonce.length === 8) { - this.state[13] = (counter / 0x100000000) >>> 0; - this.state[14] = readU32(nonce, 0); - this.state[15] = readU32(nonce, 4); - } else if (nonce.length === 12) { - this.state[13] = readU32(nonce, 0); - this.state[14] = readU32(nonce, 4); - this.state[15] = readU32(nonce, 8); - } else if (nonce.length === 16) { - this.state[12] = readU32(nonce, 0); - this.state[13] = readU32(nonce, 4); - this.state[14] = readU32(nonce, 8); - this.state[15] = readU32(nonce, 12); - } else { - throw new RangeError('Invalid nonce size.'); - } - - this.pos = 0; - - return this; - } - - /** - * Encrypt/decrypt data. - * @param {Buffer} data - Will be mutated. - * @returns {Buffer} - */ - - encrypt(data) { - assert(bufferExports.Buffer.isBuffer(data)); - - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - for (let i = 0; i < data.length; i++) { - if ((this.pos & 63) === 0) { - this._block(); - this.pos = 0; - } - - data[i] ^= this.bytes[this.pos++]; - } - - return data; - } - - /** - * Stir the stream. - */ - - _block() { - for (let i = 0; i < 16; i++) - this.stream[i] = this.state[i]; - - for (let i = 0; i < 10; i++) { - qround(this.stream, 0, 4, 8, 12); - qround(this.stream, 1, 5, 9, 13); - qround(this.stream, 2, 6, 10, 14); - qround(this.stream, 3, 7, 11, 15); - qround(this.stream, 0, 5, 10, 15); - qround(this.stream, 1, 6, 11, 12); - qround(this.stream, 2, 7, 8, 13); - qround(this.stream, 3, 4, 9, 14); - } - - for (let i = 0; i < 16; i++) - this.stream[i] += this.state[i]; - - if (BIG_ENDIAN) { - for (let i = 0; i < 16; i++) - writeU32(this.bytes, this.stream[i], i * 4); - } - - this.state[12] += 1; - - if (this.state[12] === 0) - this.state[13] += 1; - } - - /** - * Destroy context. - */ - - destroy() { - for (let i = 0; i < 16; i++) { - this.state[i] = 0; - this.stream[i] = 0; - } - - if (BIG_ENDIAN) { - for (let i = 0; i < 64; i++) - this.bytes[i] = 0; - } - - this.pos = -1; - - return this; - } - - /** - * Derive key with XChaCha20. - * @param {Buffer} key - * @param {Buffer} nonce - * @returns {Buffer} - */ - - static derive(key, nonce) { - assert(bufferExports.Buffer.isBuffer(key)); - assert(bufferExports.Buffer.isBuffer(nonce)); - - if (key.length !== 16 && key.length !== 32) - throw new RangeError('Invalid key size.'); - - if (nonce.length !== 16) - throw new RangeError('Invalid nonce size.'); - - const state = new Uint32Array(16); - - state[0] = 0x61707865; - state[1] = key.length < 32 ? 0x3120646e : 0x3320646e; - state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32; - state[3] = 0x6b206574; - state[4] = readU32(key, 0); - state[5] = readU32(key, 4); - state[6] = readU32(key, 8); - state[7] = readU32(key, 12); - state[8] = readU32(key, 16 % key.length); - state[9] = readU32(key, 20 % key.length); - state[10] = readU32(key, 24 % key.length); - state[11] = readU32(key, 28 % key.length); - state[12] = readU32(nonce, 0); - state[13] = readU32(nonce, 4); - state[14] = readU32(nonce, 8); - state[15] = readU32(nonce, 12); - - for (let i = 0; i < 10; i++) { - qround(state, 0, 4, 8, 12); - qround(state, 1, 5, 9, 13); - qround(state, 2, 6, 10, 14); - qround(state, 3, 7, 11, 15); - qround(state, 0, 5, 10, 15); - qround(state, 1, 6, 11, 12); - qround(state, 2, 7, 8, 13); - qround(state, 3, 4, 9, 14); - } - - const out = bufferExports.Buffer.alloc(32); - - writeU32(out, state[0], 0); - writeU32(out, state[1], 4); - writeU32(out, state[2], 8); - writeU32(out, state[3], 12); - writeU32(out, state[12], 16); - writeU32(out, state[13], 20); - writeU32(out, state[14], 24); - writeU32(out, state[15], 28); - - return out; - } - } - - /* - * Static - */ - - ChaCha20.native = 0; - - /* - * Helpers - */ - - function qround(x, a, b, c, d) { - x[a] += x[b]; - x[d] = rotl32(x[d] ^ x[a], 16); - - x[c] += x[d]; - x[b] = rotl32(x[b] ^ x[c], 12); - - x[a] += x[b]; - x[d] = rotl32(x[d] ^ x[a], 8); - - x[c] += x[d]; - x[b] = rotl32(x[b] ^ x[c], 7); - } - - function rotl32(w, b) { - return (w << b) | (w >>> (32 - b)); - } - - function readU32(data, off) { - return (data[off++] - + data[off++] * 0x100 - + data[off++] * 0x10000 - + data[off] * 0x1000000); - } - - function writeU32(dst, num, off) { - dst[off++] = num; - num >>>= 8; - dst[off++] = num; - num >>>= 8; - dst[off++] = num; - num >>>= 8; - dst[off++] = num; - return off; - } - - /* - * Expose - */ - - chacha20 = ChaCha20; - return chacha20; -} - -/*! - * chacha20.js - chacha20 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var chacha20Browser; -var hasRequiredChacha20Browser; - -function requireChacha20Browser () { - if (hasRequiredChacha20Browser) return chacha20Browser; - hasRequiredChacha20Browser = 1; - - chacha20Browser = requireChacha20(); - return chacha20Browser; -} - -var hmac; -var hasRequiredHmac; - -function requireHmac () { - if (hasRequiredHmac) return hmac; - hasRequiredHmac = 1; - - const assert = requireAssert(); - - /** - * HMAC - */ - - class HMAC { - /** - * Create an HMAC. - * @param {Function} Hash - * @param {Number} size - * @param {Array} [x=[]] - * @param {Array} [y=[]] - */ - - constructor(Hash, size, x = [], y = []) { - assert(typeof Hash === 'function'); - assert((size >>> 0) === size); - assert(Array.isArray(x)); - assert(Array.isArray(y)); - - this.hash = Hash; - this.size = size; - this.x = x; - this.y = y; - - this.inner = new Hash(); - this.outer = new Hash(); - } - - /** - * Initialize HMAC context. - * @param {Buffer} data - */ - - init(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - // Shorten key - if (key.length > this.size) { - const Hash = this.hash; - const h = new Hash(); - - h.init(...this.x); - h.update(key); - - key = h.final(...this.y); - - assert(key.length <= this.size); - } - - // Pad key - const pad = bufferExports.Buffer.alloc(this.size); - - for (let i = 0; i < key.length; i++) - pad[i] = key[i] ^ 0x36; - - for (let i = key.length; i < pad.length; i++) - pad[i] = 0x36; - - this.inner.init(...this.x); - this.inner.update(pad); - - for (let i = 0; i < key.length; i++) - pad[i] = key[i] ^ 0x5c; - - for (let i = key.length; i < pad.length; i++) - pad[i] = 0x5c; - - this.outer.init(...this.x); - this.outer.update(pad); - - return this; - } - - /** - * Update HMAC context. - * @param {Buffer} data - */ - - update(data) { - this.inner.update(data); - return this; - } - - /** - * Finalize HMAC context. - * @returns {Buffer} - */ - - final() { - this.outer.update(this.inner.final(...this.y)); - return this.outer.final(...this.y); - } - } - - /* - * Expose - */ - - hmac = HMAC; - return hmac; -} - -var sha256$1; -var hasRequiredSha256; - -function requireSha256 () { - if (hasRequiredSha256) return sha256$1; - hasRequiredSha256 = 1; - - const assert = requireAssert(); - const HMAC = requireHmac(); - - /* - * Constants - */ - - const FINALIZED = -1; - const DESC = bufferExports.Buffer.alloc(8, 0x00); - const PADDING = bufferExports.Buffer.alloc(64, 0x00); - - PADDING[0] = 0x80; - - const K = new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 - ]); - - /** - * SHA256 - */ - - class SHA256 { - constructor() { - this.state = new Uint32Array(8); - this.msg = new Uint32Array(64); - this.block = bufferExports.Buffer.alloc(64); - this.size = FINALIZED; - } - - init() { - this.state[0] = 0x6a09e667; - this.state[1] = 0xbb67ae85; - this.state[2] = 0x3c6ef372; - this.state[3] = 0xa54ff53a; - this.state[4] = 0x510e527f; - this.state[5] = 0x9b05688c; - this.state[6] = 0x1f83d9ab; - this.state[7] = 0x5be0cd19; - this.size = 0; - return this; - } - - update(data) { - assert(bufferExports.Buffer.isBuffer(data)); - this._update(data, data.length); - return this; - } - - final() { - return this._final(bufferExports.Buffer.alloc(32)); - } - - _update(data, len) { - assert(this.size !== FINALIZED, 'Context is not initialized.'); - - let pos = this.size & 63; - let off = 0; - - this.size += len; - - if (pos > 0) { - let want = 64 - pos; - - if (want > len) - want = len; - - data.copy(this.block, pos, off, off + want); - - pos += want; - len -= want; - off += want; - - if (pos < 64) - return; - - this._transform(this.block, 0); - } - - while (len >= 64) { - this._transform(data, off); - off += 64; - len -= 64; - } - - if (len > 0) - data.copy(this.block, 0, off, off + len); - } - - _final(out) { - assert(this.size !== FINALIZED, 'Context is not initialized.'); - - const pos = this.size & 63; - const len = this.size * 8; - - writeU32(DESC, (len * (1 / 0x100000000)) >>> 0, 0); - writeU32(DESC, len >>> 0, 4); - - this._update(PADDING, 1 + ((119 - pos) & 63)); - this._update(DESC, 8); - - for (let i = 0; i < 8; i++) { - writeU32(out, this.state[i], i * 4); - this.state[i] = 0; - } - - for (let i = 0; i < 64; i++) - this.msg[i] = 0; - - for (let i = 0; i < 64; i++) - this.block[i] = 0; - - this.size = FINALIZED; - - return out; - } - - _transform(chunk, pos) { - const W = this.msg; - - let a = this.state[0]; - let b = this.state[1]; - let c = this.state[2]; - let d = this.state[3]; - let e = this.state[4]; - let f = this.state[5]; - let g = this.state[6]; - let h = this.state[7]; - let i = 0; - - for (; i < 16; i++) - W[i] = readU32(chunk, pos + i * 4); - - for (; i < 64; i++) - W[i] = sigma1(W[i - 2]) + W[i - 7] + sigma0(W[i - 15]) + W[i - 16]; - - for (i = 0; i < 64; i++) { - const t1 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; - const t2 = Sigma0(a) + Maj(a, b, c); - - h = g; - g = f; - f = e; - - e = (d + t1) >>> 0; - - d = c; - c = b; - b = a; - - a = (t1 + t2) >>> 0; - } - - this.state[0] += a; - this.state[1] += b; - this.state[2] += c; - this.state[3] += d; - this.state[4] += e; - this.state[5] += f; - this.state[6] += g; - this.state[7] += h; - } - - static hash() { - return new SHA256(); - } - - static hmac() { - return new HMAC(SHA256, 64); - } - - static digest(data) { - return SHA256.ctx.init().update(data).final(); - } - - static root(left, right) { - assert(bufferExports.Buffer.isBuffer(left) && left.length === 32); - assert(bufferExports.Buffer.isBuffer(right) && right.length === 32); - return SHA256.ctx.init().update(left).update(right).final(); - } - - static multi(x, y, z) { - const {ctx} = SHA256; - - ctx.init(); - ctx.update(x); - ctx.update(y); - - if (z) - ctx.update(z); - - return ctx.final(); - } - - static mac(data, key) { - return SHA256.hmac().init(key).update(data).final(); - } - } - - /* - * Static - */ - - SHA256.native = 0; - SHA256.id = 'SHA256'; - SHA256.size = 32; - SHA256.bits = 256; - SHA256.blockSize = 64; - SHA256.zero = bufferExports.Buffer.alloc(32, 0x00); - SHA256.ctx = new SHA256(); - - /* - * Helpers - */ - - function Sigma0(x) { - return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10); - } - - function Sigma1(x) { - return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7); - } - - function sigma0(x) { - return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3); - } - - function sigma1(x) { - return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10); - } - - function Ch(x, y, z) { - return z ^ (x & (y ^ z)); - } - - function Maj(x, y, z) { - return (x & y) | (z & (x | y)); - } - - function readU32(data, off) { - return (data[off++] * 0x1000000 - + data[off++] * 0x10000 - + data[off++] * 0x100 - + data[off]); - } - - function writeU32(data, num, off) { - data[off++] = num >>> 24; - data[off++] = num >>> 16; - data[off++] = num >>> 8; - data[off++] = num; - return off; - } - - /* - * Expose - */ - - sha256$1 = SHA256; - return sha256$1; -} - -/*! - * sha256.js - sha256 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var sha256Browser; -var hasRequiredSha256Browser; - -function requireSha256Browser () { - if (hasRequiredSha256Browser) return sha256Browser; - hasRequiredSha256Browser = 1; - - sha256Browser = requireSha256(); - return sha256Browser; -} - -var batchRng; -var hasRequiredBatchRng; - -function requireBatchRng () { - if (hasRequiredBatchRng) return batchRng; - hasRequiredBatchRng = 1; - - const assert = requireAssert(); - const BN = requireBnBrowser(); - const ChaCha20 = requireChacha20Browser(); - const SHA256 = requireSha256Browser(); - - /** - * BatchRNG - */ - - class BatchRNG { - constructor(curve, encode = key => key) { - this.curve = curve; - this.encode = encode; - this.hash = new SHA256(); - this.chacha = new ChaCha20(); - this.key = bufferExports.Buffer.alloc(32, 0x00); - this.iv = bufferExports.Buffer.alloc(8, 0x00); - this.cache = [new BN(1), new BN(1)]; - } - - init(batch) { - assert(Array.isArray(batch)); - - this.hash.init(); - - for (const [msg, sig, key] of batch) { - this.hash.update(SHA256.digest(msg)); - this.hash.update(sig); - this.hash.update(this.encode(key)); - } - - this.key = this.hash.final(); - this.cache[0] = new BN(1); - this.cache[1] = new BN(1); - - return this; - } - - encrypt(counter) { - const size = this.curve.scalarSize * 2; - const data = bufferExports.Buffer.alloc(size, 0x00); - const left = data.slice(0, this.curve.scalarSize); - const right = data.slice(this.curve.scalarSize); - - this.chacha.init(this.key, this.iv, counter); - this.chacha.encrypt(data); - - return [ - this.curve.decodeScalar(left), - this.curve.decodeScalar(right) - ]; - } - - refresh(counter) { - let overflow = 0; - - for (;;) { - // First word is always zero. - this.iv[4] = overflow; - this.iv[5] = overflow >>> 8; - this.iv[6] = overflow >>> 16; - this.iv[7] = overflow >>> 24; - - overflow += 1; - - const [s1, s2] = this.encrypt(counter); - - if (s1.isZero() || s1.cmp(this.curve.n) >= 0) - continue; - - if (s2.isZero() || s2.cmp(this.curve.n) >= 0) - continue; - - this.cache[0] = s1; - this.cache[1] = s2; - - break; - } - } - - generate(index) { - assert((index >>> 0) === index); - - if (index & 1) - this.refresh(index >>> 1); - - return this.cache[index & 1]; - } - } - - /* - * Expose - */ - - batchRng = BatchRNG; - return batchRng; -} - -var elliptic = {}; - -var hasRequiredElliptic; - -function requireElliptic () { - if (hasRequiredElliptic) return elliptic; - hasRequiredElliptic = 1; - - const {custom} = requireCustomBrowser(); - const BN = requireBnBrowser(); - - /* - * Constants - */ - - const types = { - AFFINE: 0, - JACOBIAN: 1, - PROJECTIVE: 2, - EXTENDED: 3 - }; - - const jsfIndex = [ - -3, // -1 -1 - -1, // -1 0 - -5, // -1 1 - -7, // 0 -1 - 0, // 0 0 - 7, // 0 1 - 5, // 1 -1 - 1, // 1 0 - 3 // 1 1 - ]; - - let uid = 0; - - /** - * Curve - */ - - class Curve { - constructor(Point, type, conf) { - this.Point = null; - this.id = null; - this.uid = uid++; - this.ossl = null; - this.type = 'base'; - this.endian = 'be'; - this.hash = null; - this.prefix = null; - this.context = false; - this.prime = null; - this.p = null; - this.red = null; - this.fieldSize = 0; - this.fieldBits = 0; - this.adjustedSize = 0; - this.signBit = 0; - this.mask = 0; - this.n = null; - this.h = null; - this.q = null; - this.z = null; - this.g = null; - this.nh = null; - this.scalarSize = 0; - this.scalarBits = 0; - this.zero = null; - this.one = null; - this.two = null; - this.three = null; - this.four = null; - this.i2 = null; - this.i3 = null; - this.i4 = null; - this.i6 = null; - this.torsion = null; - this.endo = null; - this.hi = null; - this._init(Point, type, conf); - } - - _init(Point, type, conf) { - assert(typeof Point === 'function'); - assert(typeof type === 'string'); - assert(conf && typeof conf === 'object'); - assert(conf.red == null || (conf.red instanceof BN.Red)); - assert(conf.p != null, 'Must pass a prime.'); - assert(conf.id == null || typeof conf.id === 'string'); - assert(conf.ossl == null || typeof conf.ossl === 'string'); - assert(conf.endian == null || typeof conf.endian === 'string'); - assert(conf.hash == null || typeof conf.hash === 'string'); - assert(conf.prefix == null || typeof conf.prefix === 'string'); - assert(conf.context == null || typeof conf.context === 'boolean'); - assert(conf.prime == null || typeof conf.prime === 'string'); - assert(conf.torsion == null || Array.isArray(conf.torsion)); - - // Point class. - this.Point = Point; - - // Meta. - this.id = conf.id || null; - this.ossl = conf.ossl || null; - this.type = type; - this.endian = conf.endian || (type === 'short' ? 'be' : 'le'); - this.hash = conf.hash || null; - this.prefix = conf.prefix ? bufferExports.Buffer.from(conf.prefix, 'binary') : null; - this.context = conf.context || false; - this.prime = conf.prime || null; - - // Prime. - this.p = BN.fromJSON(conf.p); - - // Reduction. - if (conf.red) { - this.red = conf.red; - } else { - // Use Montgomery when there is no fast reduction for the prime. - this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); - this.red.precompute(); - } - - // Precalculate encoding length. - this.fieldSize = this.p.byteLength(); - this.fieldBits = this.p.bitLength(); - this.adjustedSize = this.fieldSize + ((this.fieldBits & 7) === 0); - this.signBit = this.adjustedSize * 8 - 1; - this.mask = 0xff; - - if ((this.fieldBits & 7) !== 0) - this.mask = (1 << (this.fieldBits & 7)) - 1; - - // Curve configuration, optional. - this.n = BN.fromJSON(conf.n || '0'); - this.h = BN.fromJSON(conf.h || '1'); - this.q = this.n.mul(this.h); - this.z = BN.fromJSON(conf.z || '0').toRed(this.red); - this.g = null; - this.nh = this.n.ushrn(1); - this.scalarSize = this.n.byteLength(); - this.scalarBits = this.n.bitLength(); - - // Useful for many curves. - this.zero = new BN(0).toRed(this.red); - this.one = new BN(1).toRed(this.red); - this.two = new BN(2).toRed(this.red); - this.three = new BN(3).toRed(this.red); - this.four = new BN(4).toRed(this.red); - - // Inverses. - this.i2 = this.two.redInvert(); - this.i3 = this.three.redInvert(); - this.i4 = this.i2.redSqr(); - this.i6 = this.i2.redMul(this.i3); - - // Torsion. - this.torsion = new Array(this.h.word(0)); - - for (let i = 0; i < this.torsion.length; i++) - this.torsion[i] = this.point(); - - // Endomorphism. - this.endo = null; - - // Cache. - this.hi = null; - - // Memoize. - this._scale = memoize(this._scale, this); - this.isIsomorphic = memoize(this.isIsomorphic, this); - this.isIsogenous = memoize(this.isIsogenous, this); - - // Sanity checks. - assert(this.p.sign() > 0 && this.p.isOdd()); - assert(this.n.sign() >= 0); - assert(this.h.sign() > 0 && this.h.cmpn(255) <= 0); - assert(this.endian === 'be' || this.endian === 'le'); - - return this; - } - - _finalize(conf) { - assert(conf && typeof conf === 'object'); - - // Create base point. - this.g = conf.g ? this.pointFromJSON(conf.g) : this.point(); - - // Parse small order points. - if (conf.torsion) { - assert(conf.torsion.length === this.torsion.length); - - for (let i = 0; i < this.torsion.length; i++) - this.torsion[i] = this.pointFromJSON(conf.torsion[i]); - } - - return this; - } - - _findTorsion() { - // Find all torsion points by grinding. - assert(!this.n.isZero()); - - const h = this.h.word(0); - const x = this.one.redNeg(); - const out = [this.point()]; - const set = new Set(); - - let len = h; - - while (out.length < len) { - let p; - - x.redIAdd(this.one); - - try { - p = this.pointFromX(x.clone()); - } catch (e) { - continue; - } - - try { - p = p.mul(this.n); - } catch (e) { - len = 2; - continue; - } - - if (p.isInfinity()) - continue; - - p.normalize(); - - for (const point of [p, p.neg()]) { - const key = point.key(); - - if (!set.has(key)) { - out.push(point); - set.add(key); - } - } - } - - out.sort((a, b) => a.cmp(b)); - - while (out.length < h) - out.push(this.point()); - - return out; - } - - _fixedMul(p, k) { - // Fixed-base method for point multiplication. - // - // [ECPM] "Windowed method". - // [GECC] Page 95, Section 3.3. - // - // Windows are appropriately shifted to avoid any - // doublings. This reduces a 256 bit multiplication - // down to 64 additions with a window size of 4. - assert(p instanceof Point); - assert(k instanceof BN); - assert(p.pre && p.pre.windows); - - // Get precomputed windows. - const {width, points} = p._getWindows(0, 0); - - // Recompute window size. - const size = 1 << width; - - // Recompute steps. - const bits = k.bitLength(); - const steps = ((bits + width - 1) / width) >>> 0; - - // Multiply. - let acc = this.jpoint(); - - for (let i = 0; i < steps; i++) { - const bits = k.bits(i * width, width); - - acc = acc.add(points[i * size + bits]); - } - - // Adjust sign. - if (k.isNeg()) - acc = acc.neg(); - - return acc; - } - - _fixedNafMul(p, k) { - // Fixed-base NAF windowing method for point multiplication. - // - // [GECC] Algorithm 3.42, Page 105, Section 3.3. - assert(p instanceof Point); - assert(k instanceof BN); - assert(p.pre && p.pre.doubles); - - // Get precomputed doubles. - const {step, points} = p._getDoubles(0, 0); - - // Get fixed NAF (in a more windowed form). - const naf = getFixedNAF(k, 2, k.bitLength() + 1, step); - - // Compute steps. - const I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3; - - // Multiply. - let a = this.jpoint(); - let b = this.jpoint(); - - for (let i = I; i > 0; i--) { - for (let j = 0; j < naf.length; j++) { - const nafW = naf[j]; - - if (nafW === i) - b = b.add(points[j]); - else if (nafW === -i) - b = b.sub(points[j]); - } - - a = a.add(b); - } - - return a; - } - - _wnafMul(w, p, k) { - // Window NAF method for point multiplication. - // - // [GECC] Algorithm 3.36, Page 100, Section 3.3. - assert(p instanceof Point); - assert(k instanceof BN); - - // Precompute window. - const {width, points} = p._safeNAF(w); - - // Get NAF form. - const naf = getNAF(k, width, k.bitLength() + 1); - - // Add `this`*(N+1) for every w-NAF index. - let acc = this.jpoint(); - - for (let i = naf.length - 1; i >= 0; i--) { - const z = naf[i]; - - if (i !== naf.length - 1) - acc = acc.dbl(); - - if (z > 0) - acc = acc.add(points[(z - 1) >> 1]); - else if (z < 0) - acc = acc.sub(points[(-z - 1) >> 1]); - } - - return acc; - } - - _wnafMulAdd(w, points, coeffs) { - // Multiple point multiplication, also known - // as "Shamir's trick" (with interleaved NAFs). - // - // [GECC] Algorithm 3.48, Page 109, Section 3.3.3. - // Algorithm 3.51, Page 112, Section 3.3. - // - // This is particularly useful for signature - // verifications and mutiplications after an - // endomorphism split. - assert((w >>> 0) === w); - assert(Array.isArray(points)); - assert(Array.isArray(coeffs)); - assert(points.length === coeffs.length); - - const length = points.length; - const wnd = new Array(length); - const naf = new Array(length); - - // Check arrays and calculate size. - let max = 0; - - for (let i = 0; i < length; i++) { - const point = points[i]; - const coeff = coeffs[i]; - - assert(point instanceof Point); - assert(coeff instanceof BN); - - if (i > 0 && point.type !== points[i - 1].type) - throw new Error('Cannot mix points.'); - - // Avoid sparse arrays. - wnd[i] = null; - naf[i] = null; - - // Compute max scalar size. - max = Math.max(max, coeff.bitLength() + 1); - } - - // Compute NAFs. - let ppoint = null; - let pcoeff = null; - let len = 0; - - for (let i = 0; i < length; i++) { - const point = points[i]; - const coeff = coeffs[i]; - const pre = point._getNAF(0); - - // Use precomputation if available. - if (pre) { - wnd[len] = pre.points; - naf[len] = getNAF(coeff, pre.width, max); - len += 1; - continue; - } - - // Save last non-precomputed point. - if (!ppoint) { - ppoint = point; - pcoeff = coeff; - continue; - } - - // Compute JSF in NAF form. - wnd[len] = ppoint._getJNAF(point); - naf[len] = getJNAF(pcoeff, coeff, max); - - ppoint = null; - pcoeff = null; - - len += 1; - } - - // Regular NAF for odd points. - if (ppoint) { - const nafw = ppoint._safeNAF(w); - - wnd[len] = nafw.points; - naf[len] = getNAF(pcoeff, nafw.width, max); - - len += 1; - } - - // Multiply and add. - let acc = this.jpoint(); - - for (let i = max - 1; i >= 0; i--) { - if (i !== max - 1) - acc = acc.dbl(); - - for (let j = 0; j < len; j++) { - const z = naf[j][i]; - - if (z > 0) - acc = acc.add(wnd[j][(z - 1) >> 1]); - else if (z < 0) - acc = acc.sub(wnd[j][(-z - 1) >> 1]); - } - } - - return acc; - } - - _endoWnafMulAdd(points, coeffs) { - throw new Error('Not implemented.'); - } - - _scale(curve, invert) { - assert(curve instanceof Curve); - assert(curve.p.eq(this.p)); - - switch (curve.type) { - case 'short': - return this._scaleShort(curve, invert); - case 'mont': - return this._scaleMont(curve, invert); - case 'edwards': - return this._scaleEdwards(curve, invert); - default: - throw new Error('Not implemented.'); - } - } - - _scaleShort(curve, invert) { - throw new Error('Not implemented.'); - } - - _scaleMont(curve, invert) { - throw new Error('Not implemented.'); - } - - _scaleEdwards(curve, invert) { - throw new Error('Not implemented.'); - } - - isElliptic() { - throw new Error('Not implemented.'); - } - - jinv() { - throw new Error('Not implemented.'); - } - - isComplete() { - return false; - } - - precompute(rng) { - assert(!this.g.isInfinity(), 'Must have base point.'); - assert(!this.n.isZero(), 'Must have order.'); - - this.g.precompute(this.n.bitLength(), rng); - - return this; - } - - scalar(num, base, endian) { - const k = new BN(num, base, endian); - - assert(!k.red); - - if (this.n.isZero()) - return k; - - return k.imod(this.n); - } - - field(num, base, endian) { - const x = BN.cast(num, base, endian); - - if (x.red) - return x.forceRed(this.red); - - return x.toRed(this.red); - } - - point(x, y) { - throw new Error('Not implemented.'); - } - - jpoint(x, y, z) { - throw new Error('Not implemented.'); - } - - xpoint(x, z) { - throw new Error('Not implemented.'); - } - - cpoint(xx, xz, yy, yz) { - assert(xx instanceof BN); - assert(xz instanceof BN); - assert(yy instanceof BN); - assert(yz instanceof BN); - - if (xz.isZero() || yz.isZero()) - return this.point(); - - const z = xz.redMul(yz).redInvert(); - const x = xx.redMul(yz).redMul(z); - const y = yy.redMul(xz).redMul(z); - - return this.point(x, y); - } - - solveX2(y) { - throw new Error('Not implemented.'); - } - - solveX(y) { - return this.solveX2(y).redSqrt(); - } - - solveY2(x) { - throw new Error('Not implemented.'); - } - - solveY(x) { - return this.solveY2(x).redSqrt(); - } - - validate(point) { - throw new Error('Not implemented.'); - } - - pointFromX(x, sign) { - throw new Error('Not implemented.'); - } - - pointFromY(y, sign) { - throw new Error('Not implemented.'); - } - - isIsomorphic(curve) { - throw new Error('Not implemented.'); - } - - isIsogenous(curve) { - throw new Error('Not implemented.'); - } - - pointFromShort(point) { - throw new Error('Not implemented.'); - } - - pointFromMont(point, sign) { - throw new Error('Not implemented.'); - } - - pointFromEdwards(point) { - throw new Error('Not implemented.'); - } - - pointFromUniform(u) { - throw new Error('Not implemented.'); - } - - pointToUniform(p) { - throw new Error('Not implemented.'); - } - - pointFromHash(bytes, pake = false) { - // [H2EC] "Roadmap". - assert(bufferExports.Buffer.isBuffer(bytes)); - assert(typeof pake === 'boolean'); - - if (bytes.length !== this.fieldSize * 2) - throw new Error('Invalid hash size.'); - - // Random oracle encoding. - // Ensure a proper distribution. - const s1 = bytes.slice(0, this.fieldSize); - const s2 = bytes.slice(this.fieldSize); - const u1 = this.decodeUniform(s1); - const u2 = this.decodeUniform(s2); - const p1 = this.pointFromUniform(u1); - const p2 = this.pointFromUniform(u2); - const p3 = p1.add(p2); - - return pake ? p3.mulH() : p3; - } - - pointToHash(p, subgroup, rng) { - // [SQUARED] Algorithm 1, Page 8, Section 3.3. - assert(p instanceof this.Point); - assert((subgroup >>> 0) === subgroup); - - // Add a random torsion component. - const i = subgroup % this.torsion.length; - const p0 = p.add(this.torsion[i]); - - // Average Cost (R = sqrt): - // - // SSWU (~4 iterations) => 8I + 16R - // SVDW (~4 iterations) => 12I + 28R - // Elligator 1 (~2 iterations) => 6I + 10R - // Elligator 2 (~2 iterations) => 4I + 6R - // Ristretto (~1 iteration) => 1I + 2R + h*1R - for (;;) { - const u1 = this.randomField(rng); - const p1 = this.pointFromUniform(u1); - - // Avoid 2-torsion points: - // Short Weierstrass: ((A / 3) / B, 0) - // Montgomery: (0, 0) - // Twisted Edwards: (0, -1) - if (p1.neg().eq(p1)) - continue; - - const p2 = p0.sub(p1); - const hint = randomInt(rng); - - let u2; - try { - u2 = this.pointToUniform(p2, hint & 15); - } catch (e) { - if (e.message === 'Invalid point.') - continue; - throw e; - } - - const s1 = this.encodeUniform(u1, hint >>> 8); - const s2 = this.encodeUniform(u2, hint >>> 16); - - return bufferExports.Buffer.concat([s1, s2]); - } - } - - randomScalar(rng) { - const max = this.n.isZero() ? this.p : this.n; - return BN.random(rng, 1, max); - } - - randomField(rng) { - return BN.random(rng, 1, this.p).toRed(this.red); - } - - randomPoint(rng) { - let p; - - for (;;) { - const x = this.randomField(rng); - const sign = (randomInt(rng) & 1) !== 0; - - try { - p = this.pointFromX(x, sign); - } catch (e) { - continue; - } - - assert(p.validate()); - - return p.mulH(); - } - } - - mulAll(points, coeffs) { - return this.jmulAll(points, coeffs); - } - - jmulAll(points, coeffs) { - assert(Array.isArray(points)); - assert(points.length === 0 || (points[0] instanceof Point)); - - // Multiply with endomorphism if we're using affine points. - if (this.endo && points.length > 0 && points[0].type === types.AFFINE) - return this._endoWnafMulAdd(points, coeffs); - - // Otherwise, a regular Shamir's trick. - return this._wnafMulAdd(5, points, coeffs); - } - - mulH(k) { - assert(k instanceof BN); - return this.imulH(k.clone()); - } - - imulH(k) { - assert(k instanceof BN); - assert(!k.red); - - const word = this.h.word(0); - - // Optimize for powers of two. - if ((word & (word - 1)) === 0) { - const bits = this.h.bitLength(); - return k.iushln(bits - 1).imod(this.n); - } - - return k.imuln(word).imod(this.n); - } - - normalizeAll(points) { - assert(Array.isArray(points)); - - const len = points.length; - const z = new Array(len); - - for (let i = 0; i < len; i++) { - const p = points[i]; - - assert(p instanceof Point); - assert(p.curve === this); - - if (p.type === types.AFFINE) { - z[i] = this.one; - continue; - } - - z[i] = p.z; - } - - const zi = this.red.invertAll(z); - const out = new Array(len); - - for (let i = 0; i < len; i++) - out[i] = points[i].scale(zi[i]); - - return out; - } - - affinizeAll(points) { - return this.normalizeAll(points); - } - - clamp(scalar) { - // [RFC7748] Page 8, Section 5. - // [RFC8032] Section 5.1.5 & 5.2.5. - assert(bufferExports.Buffer.isBuffer(scalar)); - assert(scalar.length === this.scalarSize); - assert(this.scalarSize <= this.fieldSize); - - let top = (this.fieldBits & 7) || 8; - let lsb = 0; - let msb = this.scalarSize - 1; - - // Swap endianness. - if (this.endian === 'be') - [lsb, msb] = [msb, lsb]; - - // Adjust for low order. - if (this.scalarSize < this.fieldSize) - top = 8; - - // Ensure a multiple of the cofactor. - scalar[lsb] &= -this.h.word(0) & 0xff; - - // Clamp to the prime. - scalar[msb] &= (1 << top) - 1; - - // Set the high bit. - scalar[msb] |= 1 << (top - 1); - - return scalar; - } - - splitHash(bytes) { - // [RFC8032] Section 5.1.6 & 5.2.6. - assert(bufferExports.Buffer.isBuffer(bytes)); - assert(bytes.length === this.adjustedSize * 2); - assert(this.scalarSize <= this.adjustedSize); - - let off = 0; - - if (this.endian === 'be') - off = this.adjustedSize - this.scalarSize; - - const scalar = bytes.slice(off, off + this.scalarSize); - const prefix = bytes.slice(this.adjustedSize); - - this.clamp(scalar); - - return [scalar, prefix]; - } - - encodeField(x) { - // [SEC1] Page 12, Section 2.3.5. - assert(x instanceof BN); - assert(!x.red); - - return x.encode(this.endian, this.fieldSize); - } - - decodeField(bytes) { - // [SEC1] Page 13, Section 2.3.6. - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.fieldSize) - throw new Error('Invalid field element size.'); - - return BN.decode(bytes, this.endian); - } - - encodeAdjusted(x) { - assert(x instanceof BN); - assert(!x.red); - - return x.encode(this.endian, this.adjustedSize); - } - - decodeAdjusted(bytes) { - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.adjustedSize) - throw new Error('Invalid field element size.'); - - return BN.decode(bytes, this.endian); - } - - encodeScalar(k) { - // [SEC1] Page 13, Section 2.3.7. - assert(k instanceof BN); - assert(!k.red); - - return k.encode(this.endian, this.scalarSize); - } - - decodeScalar(bytes) { - // [SEC1] Page 14, Section 2.3.8. - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.scalarSize) - throw new Error('Invalid scalar size.'); - - return BN.decode(bytes, this.endian); - } - - encodeClamped(k) { - // [RFC7748] Page 8, Section 5. - // [RFC8032] Section 5.1.5 & 5.2.5. - return this.clamp(this.encodeScalar(k)); - } - - decodeClamped(bytes) { - // [RFC7748] Page 8, Section 5. - // [RFC8032] Section 5.1.5 & 5.2.5. - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.scalarSize) - throw new Error('Invalid scalar size.'); - - const clamped = this.clamp(bufferExports.Buffer.from(bytes)); - - return BN.decode(clamped, this.endian); - } - - encodeUniform(x, bits) { - assert(x instanceof BN); - assert((bits >>> 0) === bits); - - const msb = this.endian === 'le' ? this.fieldSize - 1 : 0; - const bytes = x.fromRed().encode(this.endian, this.fieldSize); - - bytes[msb] |= (bits & ~this.mask) & 0xff; - - return bytes; - } - - decodeUniform(bytes) { - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.fieldSize) - throw new Error('Invalid field size.'); - - const x = BN.decode(bytes, this.endian); - - x.iumaskn(this.fieldBits); - - return x.toRed(this.red); - } - - encodePoint(point, compact) { - assert(point instanceof Point); - return point.encode(compact); - } - - decodePoint(bytes) { - throw new Error('Not implemented.'); - } - - encodeX(point) { - throw new Error('Not implemented.'); - } - - decodeX(bytes) { - throw new Error('Not implemented.'); - } - - decodeEven(bytes) { - throw new Error('Not implemented.'); - } - - decodeSquare(bytes) { - throw new Error('Not implemented.'); - } - - toShort() { - throw new Error('Not implemented.'); - } - - toMont(b0) { - throw new Error('Not implemented.'); - } - - toEdwards(a0) { - throw new Error('Not implemented.'); - } - - pointToJSON(point, pre) { - assert(point instanceof Point); - return point.toJSON(pre); - } - - pointFromJSON(json) { - throw new Error('Not implemented.'); - } - - toJSON(pre) { - let prefix, context; - let n, z, endo; - - if (this.type === 'edwards') { - prefix = this.prefix ? this.prefix.toString() : null; - context = this.context; - } - - if (!this.n.isZero()) - n = this.n.toJSON(); - - if (!this.z.isZero()) { - z = this.z.fromRed(); - - if (this.z.redIsHigh()) - z.isub(this.p); - - z = z.toString(16); - } - - if (this.endo) - endo = this.endo.toJSON(); - - return { - id: this.id, - ossl: this.ossl, - type: this.type, - endian: this.endian, - hash: this.hash, - prefix, - context, - prime: this.prime, - p: this.p.toJSON(), - a: undefined, - b: undefined, - d: undefined, - n, - h: this.h.toString(16), - s: undefined, - z, - c: undefined, - g: this.g.toJSON(pre), - endo - }; - } - - static fromJSON(json) { - return new this(json); - } - } - - /** - * Point - */ - - class Point { - constructor(curve, type) { - assert(curve instanceof Curve); - assert((type >>> 0) === type); - - this.curve = curve; - this.type = type; - this.pre = null; - } - - _init() { - throw new Error('Not implemented.'); - } - - _safeNAF(width) { - assert((width >>> 0) === width); - - if (this.pre && this.pre.naf) - return this.pre.naf; - - if (width === 0) - return null; - - const size = 1 << (width - 2); - const points = new Array(size); - const p = this.toJ(); - const dbl = size === 1 ? null : p.dbl(); - - points[0] = p; - - for (let i = 1; i < size; i++) - points[i] = points[i - 1].add(dbl); - - return new NAF(width, points); - } - - _getNAF(width) { - assert((width >>> 0) === width); - - if (this.pre && this.pre.naf) - return this.pre.naf; - - if (width === 0) - return null; - - const odds = this._safeNAF(width).points; - const points = this.curve.affinizeAll(odds); - - return new NAF(width, points); - } - - _getWindows(width, bits) { - assert((width >>> 0) === width); - assert((bits >>> 0) === bits); - - if (this.pre && this.pre.windows) - return this.pre.windows; - - if (width === 0) - return null; - - const size = 1 << width; - const steps = ((bits + width - 1) / width) >>> 0; - const wnds = new Array(steps * size); - - let g = this.toJ(); - - for (let i = 0; i < steps; i++) { - wnds[i * size] = this.curve.jpoint(); - - for (let j = 1; j < size; j++) - wnds[i * size + j] = wnds[i * size + j - 1].add(g); - - g = g.dblp(width); - } - - const points = this.curve.affinizeAll(wnds); - - return new Windows(width, bits, points); - } - - _getDoubles(step, power) { - assert((step >>> 0) === step); - assert((power >>> 0) === power); - - if (this.pre && this.pre.doubles) - return this.pre.doubles; - - if (step === 0) - return null; - - const len = Math.ceil(power / step) + 1; - const dbls = new Array(len); - - let acc = this.toJ(); - let k = 0; - - dbls[k++] = acc; - - for (let i = 0; i < power; i += step) { - for (let j = 0; j < step; j++) - acc = acc.dbl(); - - dbls[k++] = acc; - } - - assert(k === len); - - const points = this.curve.affinizeAll(dbls); - - return new Doubles(step, points); - } - - _getBeta() { - return null; - } - - _getBlinding(rng) { - if (this.pre && this.pre.blinding) - return this.pre.blinding; - - if (!rng) - return null; - - if (this.curve.n.isZero()) - return null; - - // Pregenerate a random blinding value: - // - // blind = random integer in [1,n-1] - // unblind = G * blind - // - // We intend to subtract the blinding value - // from scalars before multiplication. We - // can add the unblinding point once the - // multiplication is complete. - const blind = this.curve.randomScalar(rng); - const unblind = this.mul(blind); - - return new Blinding(blind, unblind); - } - - _hasWindows(k) { - assert(k instanceof BN); - - if (!this.pre || !this.pre.windows) - return false; - - const {width, bits} = this.pre.windows; - const steps = ((bits + width - 1) / width) >>> 0; - - return k.bitLength() <= steps * width; - } - - _hasDoubles(k) { - assert(k instanceof BN); - - if (!this.pre || !this.pre.doubles) - return false; - - const {step, points} = this.pre.doubles; - const power = k.bitLength() + 1; - - return points.length >= Math.ceil(power / step) + 1; - } - - _getJNAF(point) { - assert(point instanceof Point); - assert(point.type === this.type); - - // Create comb for JSF. - return [ - this, // 1 - this.add(point), // 3 - this.sub(point), // 5 - point // 7 - ]; - } - - _blind(k, rng) { - // [SIDE1] Page 5, Section 4. - // [BLIND] Page 20, Section 7. - assert(k instanceof BN); - assert(!k.red); - - // Scalar splitting (requires precomputation). - // - // Blind a multiplication by first subtracting - // a blinding value from the scalar. Example: - // - // b = random integer in [1,n-1] - // B = P * b (precomputed) - // Q = P * (k - b) + B - // - // Note that Joye describes a different method - // (multiplier randomization) which computes: - // - // B = random point in E - // Q = (P + B) * k - B * k - // - // Our method is more similar to the "scalar - // splitting" technique described in the - // second source above. - // - // The blinding value and its corresponding - // point are randomly generated and computed - // on boot. As long as an attacker is not - // able to observe the boot, this should give - // a decent bit of protection against various - // channel attacks. - if (this.pre && this.pre.blinding) { - const {blind, unblind} = this.pre.blinding; - const t = k.sub(blind); - - return [this, t, unblind]; - } - - // Randomization is not possible without - // an RNG. Do a normal multiplication. - if (!rng) - return [this, k, null]; - - // If we have no precomputed blinding - // factor, there are two possibilities - // for randomization: - // - // 1. Randomize the multiplier by adding - // a random multiple of `n`. - // - // 2. Re-scale the point itself by a - // random factor. - // - // The first option can be accomplished - // with some like: - // - // a = random integer in [1,n-1] - // r = a * n - // Q = P * (k + r) - // - // The second is accomplished with: - // - // a = random element in F(p) - // R = (x * a^2, y * a^3, z * a) - // Q = R * k - // - // If we have precomputed doubles / naf - // points, we opt for the first method - // to avoid randomizing everything. - if (this.pre) { - if (this.curve.n.isZero()) - return [this, k, null]; - - const a = this.curve.randomScalar(rng); - const r = a.mul(this.curve.n); - const t = r.iadd(k); - - return [this, t, null]; - } - - // If there is no precomputation _at all_, - // we opt for the second method. - const p = this.randomize(rng); - - return [p, k, null]; - } - - clone() { - throw new Error('Not implemented.'); - } - - precompute(bits, rng) { - assert((bits >>> 0) === bits); - - if (!this.pre) - this.pre = new Precomp(); - - if (!this.pre.naf) - this.pre.naf = this._getNAF(9); - - if (!this.pre.doubles) - this.pre.doubles = this._getDoubles(4, bits + 1); - - if (!this.pre.beta) - this.pre.beta = this._getBeta(); - - if (!this.pre.blinding) - this.pre.blinding = this._getBlinding(rng); - - return this; - } - - validate() { - return this.curve.validate(this); - } - - normalize() { - return this; - } - - scale(a) { - throw new Error('Not implemented.'); - } - - randomize(rng) { - const z = this.curve.randomField(rng); - return this.scale(z); - } - - neg() { - throw new Error('Not implemented.'); - } - - add(point) { - throw new Error('Not implemented.'); - } - - sub(point) { - assert(point instanceof Point); - return this.add(point.neg()); - } - - dbl() { - throw new Error('Not implemented.'); - } - - dblp(pow) { - // Repeated doubling. This can - // be optimized by child classes. - assert((pow >>> 0) === pow); - - let r = this; - - for (let i = 0; i < pow; i++) - r = r.dbl(); - - return r; - } - - diffAddDbl(p, q) { - throw new Error('Not implemented.'); - } - - getX() { - throw new Error('Not implemented.'); - } - - getY() { - throw new Error('Not implemented.'); - } - - eq(point) { - throw new Error('Not implemented.'); - } - - cmp(point) { - throw new Error('Not implemented.'); - } - - isInfinity() { - throw new Error('Not implemented.'); - } - - isOrder2() { - throw new Error('Not implemented.'); - } - - isOdd() { - throw new Error('Not implemented.'); - } - - isEven() { - throw new Error('Not implemented.'); - } - - isSquare() { - throw new Error('Not implemented.'); - } - - eqX(x) { - throw new Error('Not implemented.'); - } - - eqR(x) { - throw new Error('Not implemented.'); - } - - isSmall() { - // Test whether the point is of small order. - if (this.isInfinity()) - return false; - - // P * h = O - return this.jmulH().isInfinity(); - } - - hasTorsion() { - // Test whether the point is in another subgroup. - if (this.isInfinity()) - return false; - - // P * n != O - return !this.jmul(this.curve.n).isInfinity(); - } - - order() { - // Calculate point order. - const {h, n} = this.curve; - - let p = this.toJ(); - let q = new BN(1); - - while (!p.isInfinity()) { - q.iaddn(1); - - if (q.cmp(h) > 0) { - q = n.clone(); - break; - } - - p = p.add(this); - } - - return q; - } - - mul(k) { - return this.jmul(k); - } - - muln(k) { - return this.jmuln(k); - } - - mulBlind(k, rng) { - return this.jmulBlind(k, rng); - } - - mulAdd(k1, p2, k2) { - return this.jmulAdd(k1, p2, k2); - } - - mulH() { - return this.jmulH(); - } - - div(k) { - return this.jdiv(k); - } - - divn(k) { - return this.jdivn(k); - } - - divH() { - return this.jdivH(); - } - - jmul(k) { - - if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - - if (this.curve.endo && this.type === types.AFFINE) - return this.curve._endoWnafMulAdd([this], [k]); - - return this.curve._wnafMul(5, this, k); - } - - jmuln(k) { - assert((k | 0) === k); - return this.jmul(new BN(k)); - } - - jmulBlind(k, rng = null) { - const [p, t, unblind] = this._blind(k, rng); - const q = p.jmul(t); - - if (unblind) - return q.add(unblind); - - return q; - } - - jmulAdd(k1, p2, k2) { - if (this.curve.endo && this.type === types.AFFINE) - return this.curve._endoWnafMulAdd([this, p2], [k1, k2]); - - return this.curve._wnafMulAdd(5, [this, p2], [k1, k2]); - } - - jmulH() { - const word = this.curve.h.word(0); - - // Optimize for powers of two. - if ((word & (word - 1)) === 0) { - const bits = this.curve.h.bitLength(); - return this.toJ().dblp(bits - 1); - } - - return this.jmul(this.curve.h); - } - - jdiv(k) { - assert(k instanceof BN); - assert(!k.red); - - return this.jmul(k.invert(this.curve.n)); - } - - jdivn(k) { - assert(!this.curve.n.isZero()); - - if (this.curve.h.cmpn(k) === 0) - return this.jdivH(); - - return this.jdiv(new BN(k)); - } - - jdivH() { - if (this.curve.n.isZero()) - return this.toJ(); - - if (this.curve.h.cmpn(1) === 0) - return this.toJ(); - - if (this.curve.hi === null) - this.curve.hi = this.curve.h.invert(this.curve.n); - - return this.jmul(this.curve.hi); - } - - toP() { - return this.normalize(); - } - - toJ() { - return this; - } - - toX() { - return this; - } - - key() { - if (this.isInfinity()) - return `${this.curve.uid}:oo`; - - this.normalize(); - - const x = this.getX().toString(16); - const y = this.getY().toString(16); - - return `${this.curve.uid}:${x},${y}`; - } - - encode(compact) { - throw new Error('Not implemented.'); - } - - static decode(curve, bytes) { - throw new Error('Not implemented.'); - } - - encodeX() { - throw new Error('Not implemented.'); - } - - static decodeX(curve, bytes) { - throw new Error('Not implemented.'); - } - - static decodeEven(curve, bytes) { - throw new Error('Not implemented.'); - } - - static decodeSquare(curve, bytes) { - throw new Error('Not implemented.'); - } - - toJSON(pre) { - throw new Error('Not implemented.'); - } - - static fromJSON(curve, json) { - throw new Error('Not implemented.'); - } - - [custom]() { - return ''; - } - } - - /** - * ShortCurve - */ - - class ShortCurve extends Curve { - constructor(conf) { - super(ShortPoint, 'short', conf); - - this.a = BN.fromJSON(conf.a).toRed(this.red); - this.b = BN.fromJSON(conf.b).toRed(this.red); - this.c = BN.fromJSON(conf.c || '0').toRed(this.red); - this.ai = this.a.isZero() ? this.zero : this.a.redInvert(); - this.zi = this.z.isZero() ? this.zero : this.z.redInvert(); - - this.zeroA = this.a.isZero(); - this.threeA = this.a.eq(this.three.redNeg()); - this.redN = this.n.toRed(this.red); - this.pmodn = this.p.clone(); - this.highOrder = this.n.cmp(this.p) >= 0; - this.smallGap = false; - - this._finalize(conf); - } - - _finalize(conf) { - super._finalize(conf); - - // Precalculate endomorphism. - if (conf.endo != null) - this.endo = Endo.fromJSON(this, conf.endo); - else - this.endo = this._getEndomorphism(); - - if (!this.n.isZero()) { - this.pmodn = this.p.mod(this.n); - - // Check for Maxwell's trick (see eqR). - this.smallGap = this.p.div(this.n).cmpn(1) <= 0; - } - - return this; - } - - static _isomorphism(curveA, curveB, custom, odd) { - // Short Weierstrass Isomorphism. - // - // [GECC] Page 84, Section 3.1.5. - // [ARITH1] Page 274, Section 13.1.5. - // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves). - // - // Find `u` such that `a * u^4 = a'` and `b * u^6 = b'`. - // - // Transformation: - // - // u4 = a' / a - // u2 = +-sqrt(u4) - // u6 = u4 * u2 - // a' = a * u4 - // b' = b * u6 - // - // Where `u2` is any root that is square. - // - // If a = 0, we can do: - // - // a' = 0 - // b' = b' - // - // Where (b' / b)^(1 / 3) is square. - // - // If b = 0, we can do: - // - // a' = a' - // b' = 0 - // - // Where sqrt(a' / a) is square. - assert(curveA instanceof BN); - assert(curveB instanceof BN); - assert(custom instanceof BN); - assert(odd == null || typeof odd === 'boolean'); - assert(!curveA.isZero() || !curveB.isZero()); - - if (custom.isZero()) - throw new Error('Invalid coefficient.'); - - if (curveA.isZero()) { - const customB = custom; - const u6 = customB.redDiv(curveB); - // Todo: allow index flag. - const u2 = uncube(u6); - - // Already checked in uncube(). - assert(u2.redJacobi() === 1); - - return [curveA.clone(), customB.clone()]; - } - - if (curveB.isZero()) { - const customA = custom; - const u4 = customA.redDiv(curveA); - const u2 = u4.redSqrt(); - - // Todo: allow odd flag. - if (u2.redJacobi() !== 1) - u2.redINeg(); - - if (u2.redJacobi() !== 1) - throw new Error('Invalid `a` coefficient.'); - - return [customA.clone(), curveB.clone()]; - } - - const customA = custom; - const u4 = customA.redDiv(curveA); - const u2 = u4.redSqrt(); - - if (odd != null) { - if (u2.redIsOdd() !== odd) - u2.redINeg(); - } else { - if (u2.redJacobi() !== 1) - u2.redINeg(); - } - - if (u2.redJacobi() !== 1) - throw new Error('Invalid `a` coefficient.'); - - const u6 = u4.redMul(u2); - const a = curveA.redMul(u4); - const b = curveB.redMul(u6); - - assert(a.eq(customA)); - - return [a, b]; - } - - _short(a0, odd) { - return ShortCurve._isomorphism(this.a, this.b, a0, odd); - } - - _mont(b0, odd) { - // Short Weierstrass->Montgomery Equivalence. - // - // [ARITH1] Page 286, Section 13.2.3.c. - // [SAFE] "Ladders". - // - // Transformation: - // - // r = A / (3 * B) - // s = +-sqrt(3 * r^2 + a) - // A = 3 * r / s - // B = 1 / s - const [r, s] = this._findRS(odd); - const b = s.redInvert(); - const a = r.redMuln(3).redMul(b); - - if (b0 != null) - return MontCurve._isomorphism(a, b, b0); - - return [a, b]; - } - - _edwards(a0, odd) { - // Short Weierstrass->Twisted Edwards Equivalence. - // - // [TWISTEQ] Section 1. - // - // Transformation: - // - // r = (a' + d') / 6 - // s = +-sqrt(3 * r^2 + a) - // a' = 3 * r + 2 * s - // d' = 3 * r - 2 * s - const [r, s] = this._findRS(odd); - const r3 = r.redMuln(3); - const s2 = s.redMuln(2); - const a = r3.redAdd(s2); - const d = r3.redSub(s2); - - if (a0 != null) - return EdwardsCurve._isomorphism(a, d, a0); - - return [a, d]; - } - - _findRS(sign) { - // Find `r` and `s` for equivalence. - // - // [ARITH1] Page 286, Section 13.2.3.c. - // [SAFE] "Ladders". - // - // Computation: - // - // r = solve(r^3 + a * r + b == 0, r) - // s = +-sqrt(3 * r^2 + a) - // - // Computing `r` is non-trivial. We need - // to solve `r^3 + a * r + b = 0`, but we - // don't have a polynomial solver, so we - // loop over random points until we find - // one with 2-torsion. Multiplying by the - // subgroup order should yield a point of - // ((A / 3) / B, 0) which is a solution. - assert(sign == null || typeof sign === 'boolean'); - assert(this.h.word(0) >= 4); - assert(!this.n.isZero()); - - const x = this.one.redNeg(); - - let p; - - for (;;) { - x.redIAdd(this.one); - - try { - p = this.pointFromX(x.clone()); - } catch (e) { - continue; - } - - p = p.mul(this.n); - - if (p.isInfinity()) - continue; - - if (!p.y.isZero()) - continue; - - break; - } - - const r = p.x; - const r2 = r.redSqr(); - const s = r2.redMuln(3).redIAdd(this.a).redSqrt(); - - if (sign != null) { - if (s.redIsOdd() !== sign) - s.redINeg(); - } - - return [r, s]; - } - - _scale0(a, b) { - // We can extract the isomorphism factors with: - // - // u4 = a' / a - // u6 = b' / b - // u2 = +-sqrt(u4) - // u = +-sqrt(u2) - // u3 = u2 * u - // - // `u2` should be picked such that `u4 * u2 = u6`. - // - // If a = 0, we can do: - // - // u6 = b' / b - // u2 = u6^(1 / 3) - // u = +-sqrt(u2) - // u3 = u2 * u - // - // Where `u2` is any root that is square. - // - // If b = 0, we can do: - // - // u4 = a' / a - // u2 = +-sqrt(u4) - // u = +-sqrt(u2) - // u3 = u2 * u - // - // Where `u2` is any root that is square. - assert(this.a.isZero() === a.isZero()); - assert(this.b.isZero() === b.isZero()); - - if (this.a.isZero()) { - const u6 = this.b.redDiv(this.field(b)); - // Todo: figure out how to check index. - const u2 = uncube(u6); - const u = u2.redSqrt(); - const u3 = u2.redMul(u); - - assert(u3.redSqr().eq(u6)); - assert(!u.isZero()); - - return [u2, u3]; - } - - if (this.b.isZero()) { - const u4 = this.a.redDiv(this.field(a)); - const u2 = u4.redSqrt(); - - // Todo: figure out how to check oddness. - if (u2.redJacobi() !== 1) - u2.redINeg(); - - const u = u2.redSqrt(); - const u3 = u2.redMul(u); - - assert(u3.redMul(u).eq(u4)); - assert(!u.isZero()); - - return [u2, u3]; - } - - const u4 = this.a.redDiv(this.field(a)); - const u6 = this.b.redDiv(this.field(b)); - const u2 = u4.redSqrt(); - - if (!u4.redMul(u2).eq(u6)) - u2.redINeg(); - - assert(u4.redMul(u2).eq(u6)); - - const u = u2.redSqrt(); - const u3 = u2.redMul(u); - - assert(!u.isZero()); - - return [u2, u3]; - } - - _scale1(x, y) { - // If base points are available, it is much - // easier, with: - // - // u2 = x' / x - // u3 = y' / y - // u = +-sqrt(u2) - // - // `u` should be picked such that `u2 * u = u3`. - const u2 = this.g.x.redDiv(this.field(x)); - const u3 = this.g.y.redDiv(this.field(y)); - const u = u2.redSqrt(); - - if (!u2.redMul(u).eq(u3)) - u.redINeg(); - - assert(u2.redMul(u).eq(u3)); - assert(!u.isZero()); - - return [u2, u3]; - } - - _scaleShort(curve) { - assert(curve instanceof ShortCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) - return this._scale0(curve.a, curve.b); - - return this._scale1(curve.g.x, curve.g.y); - } - - _scaleMont(curve) { - assert(curve instanceof MontCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) { - const [a, b] = curve._short(); - return this._scale0(a, b); - } - - const {x, y} = curve.g; - const nx = x.redAdd(curve.a3).redMul(curve.bi); - const ny = y.redMul(curve.bi); - - return this._scale1(nx, ny); - } - - _scaleEdwards(curve) { - assert(curve instanceof EdwardsCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) { - const [a, b] = curve._short(); - return this._scale0(a, b); - } - - const {x, y, z} = curve.g; - const a5 = curve.a.redMuln(5); - const d5 = curve.d.redMuln(5); - const dma = curve.d.redSub(curve.a); - const d5a = d5.redSub(curve.a); - const da5 = curve.d.redSub(a5); - const ypz = y.redAdd(z); - const ymz = y.redSub(z); - const xx = d5a.redMul(y).redIAdd(da5.redMul(z)); - const xz = ymz.redMuln(12); - const yy = dma.redMul(ypz).redMul(z); - const yz = ymz.redMul(x).redIMuln(4); - const zi = xz.redMul(yz).redInvert(); - const nx = xx.redMul(yz).redMul(zi); - const ny = yy.redMul(xz).redMul(zi); - - return this._scale1(nx, ny); - } - - _getEndomorphism(index = 0) { - // Compute endomorphism. - // - // [GECC] Example 3.76, Page 128, Section 3.5. - - // No curve params. - if (this.n.isZero() || this.g.isInfinity()) - return null; - - // No efficient endomorphism. - if (!this.zeroA || this.p.modrn(3) !== 1 || this.n.modrn(3) !== 1) - return null; - - // Solve beta^3 mod p = 1. - const [b1, b2] = this._getEndoRoots(this.p); - - // Choose the smallest beta by default. - const beta = [b1, b2][index & 1].toRed(this.red); - - // Solve lambda^3 mod n = 1. - const [l1, l2] = this._getEndoRoots(this.n); - - // Choose the lambda matching selected beta. - // Note that P * lambda = (x * beta, y). - const p = this.point(this.g.x.redMul(beta), this.g.y); - - let lambda; - - if (this.g.mul(l1).eq(p)) { - lambda = l1; - } else { - assert(this.g.mul(l2).eq(p)); - lambda = l2; - } - - // Get basis vectors. - const basis = this._getEndoBasis(lambda); - - // Precompute `g1` and `g2`. - const pre = this._getEndoPrecomp(basis); - - return new Endo(beta, lambda, basis, pre); - } - - _getEndoRoots(num) { - // Find roots for x^2 + x + 1 in F. - // - // [GECC] Example 3.76, Page 128, Section 3.5. - // [GLV] Page 192, Section 2 (Endomorphisms). - // - // The above document doesn't fully explain how - // to derive these and only "hints" at it, as - // mentioned by Hal Finney[1], but we're basically - // computing two possible cube roots of 1 here. - // - // Note that we could also compute[2]: - // - // beta = 2^((p - 1) / 3) mod p - // lambda = 3^((n - 1) / 3) mod n - // - // As an extension of Fermat's little theorem: - // - // g^(p - 1) mod p == 1 - // - // It is suspected[3] this is how Hal Finney[4] - // computed his original endomorphism roots. - // - // @indutny's method for computing cube roots - // of unity[5] appears to be the method described - // on wikipedia[6][7]. - // - // Sage produces the same solution: - // - // sage: solve(x^2 + x + 1 == 0, x) - // [x == -1/2*I*sqrt(3) - 1/2, x == 1/2*I*sqrt(3) - 1/2] - // - // This can be reduced to: - // - // x = (+-sqrt(-3) - 1) / 2 - // - // [1] https://bitcointalk.org/index.php?topic=3238.msg45565#msg45565 - // [2] https://crypto.stackexchange.com/a/22739 - // [3] https://bitcoin.stackexchange.com/a/35872 - // [4] https://github.com/halfinney/bitcoin/commit/dc411b5 - // [5] https://en.wikipedia.org/wiki/Cube_root_of_unity - // [6] https://en.wikipedia.org/wiki/Splitting_field#Cubic_example - // [7] http://mathworld.wolfram.com/SplittingField.html - const red = num === this.p ? this.red : BN.mont(num); - const two = new BN(2).toRed(red); - const three = new BN(3).toRed(red); - const i2 = two.redInvert(); - - // S1 = sqrt(-3) / 2 - const s1 = three.redNeg().redSqrt().redMul(i2); - - // S2 = -S1 - const s2 = s1.redNeg(); - - // R1 = S1 - 1 / 2 - const r1 = s1.redSub(i2).fromRed(); - - // R2 = S2 - 1 / 2 - const r2 = s2.redSub(i2).fromRed(); - - return [r1, r2].sort(BN.cmp); - } - - _getEndoBasis(lambda) { - // Compute endomorphic basis. - // - // This essentially computes Cornacchia's algorithm - // for solving x^2 + d * y^2 = m (d = lambda, m = order). - // - // https://en.wikipedia.org/wiki/Cornacchia%27s_algorithm - // - // [GECC] Algorithm 3.74, Page 127, Section 3.5. - // [GLV] Page 196, Section 4 (Decomposing K). - // - // Balanced length-two representation of a multiplier. - // - // 1. Run the extended euclidean algorithm with inputs n - // and lambda. The algorithm produces a sequence of - // equations si*n + ti*lam = ri where s0=1, t0=0, - // r0=n, s1=0, t1=1, r1=lam, and the remainders ri - // and are non-negative and strictly decreasing. Let - // l be the greatest index for which rl >= sqrt(n). - const [rl, tl, rl1, tl1, rl2, tl2] = this._egcdSqrt(lambda); - - // 2. Set (a1, b1) <- (rl+1, -tl+1). - const a1 = rl1; - const b1 = tl1.neg(); - - // 3. If (rl^2 + tl^2) <= (rl+2^2 + tl+2^2) - // then set (a2, b2) <- (rl, -tl). - // else set (a2, b2) <- (rl+2, -tl+2). - const lhs = rl.sqr().iadd(tl.sqr()); - const rhs = rl2.sqr().iadd(tl2.sqr()); - - let a2, b2; - - if (lhs.cmp(rhs) <= 0) { - a2 = rl; - b2 = tl.neg(); - } else { - a2 = rl2; - b2 = tl2.neg(); - } - - return [ - new Vector(a1, b1), - new Vector(a2, b2) - ]; - } - - _egcdSqrt(lambda) { - // Extended Euclidean algorithm for integers. - // - // [GECC] Algorithm 2.19, Page 40, Section 2.2. - // [GLV] Page 196, Section 4 (Decomposing K). - assert(lambda instanceof BN); - assert(!lambda.red); - assert(lambda.sign() > 0); - assert(this.n.sign() > 0); - - // Note that we insert the approximate square - // root checks as described in algorithm 3.74. - // - // Algorithm 2.19 is defined as: - // - // 1. u <- a - // v <- b - // - // 2. x1 <- 1 - // y1 <- 0 - // x2 <- 0 - // y2 <- 1 - // - // 3. while u != 0 do - // - // 3.1. q <- floor(v / u) - // r <- v - q * u - // x <- x2 - q * x1 - // y <- y2 - q * y1 - // - // 3.2. v <- u - // u <- r - // x2 <- x1 - // x1 <- x - // y2 <- y1 - // y1 <- y - // - // 4. d <- v - // x <- x2 - // y <- y2 - // - // 5. Return (d, x, y). - - // Start with an approximate square root of n. - const sqrtn = this.n.ushrn(this.n.bitLength() >>> 1); - - let u = lambda; // r1 - let v = this.n.clone(); // r0 - let x1 = new BN(1); // t1 - let y1 = new BN(0); // t0 - let x2 = new BN(0); // s1 - let y2 = new BN(1); // s0 - - // All vectors are roots of: a + b * lambda = 0 (mod n). - let rl, tl; - - // First vector. - let rl1, tl1; - - // Inner. - let i = 0; - let j = 0; - let p; - - // Compute EGCD. - while (!u.isZero() && i < 2) { - const q = v.quo(u); - const r = v.sub(q.mul(u)); - const x = x2.sub(q.mul(x1)); - const y = y2.sub(q.mul(y1)); - - // Check for r < sqrt(n). - if (j === 0 && r.cmp(sqrtn) < 0) { - rl = p; - tl = x1; - rl1 = r; - tl1 = x; - j = 1; // 1 more round. - } - - p = r; - v = u; - u = r; - x2 = x1; - x1 = x; - y2 = y1; - y1 = y; - - i += j; - } - - // Should never happen. - assert(j !== 0, 'Could not find r < sqrt(n).'); - - // Second vector. - const rl2 = x2; - const tl2 = x1; - - return [ - rl, - tl, - rl1, - tl1, - rl2, - tl2 - ]; - } - - _getEndoPrecomp(basis) { - // Precompute `g1` and `g2` to avoid round division. - // - // [JCEN12] Page 5, Section 4.3. - // - // Computation: - // - // d = a1 * b2 - b1 * a2 - // t = ceil(log2(d+1)) + p - // g1 = round((2^t * b2) / d) - // g2 = round((2^t * b1) / d) - // - // Where: - // - // `p` is the number of precision bits. - // `d` is equal to `n` (the curve order). - // - // The paper above uses 2 as the value of `p`, - // whereas libsecp256k1 uses 128 (total=384). - // - // We pick precision for `g1` and `g2` such that: - // - // abs(g1) < n - // abs(g2) < n - // - // This ensures maximum precision for the constants - // while also ensuring they fit into a fixed number - // of scalar limbs in more optimized implementations. - // - // Furthermore, we attempt to align to a limb width - // of 64 bits. This allows us to optimize the shift, - // a la libsecp256k1[1]. - // - // [1] https://github.com/bitcoin-core/secp256k1/pull/822 - assert(Array.isArray(basis)); - assert(basis.length === 2); - assert(basis[0] instanceof Vector); - assert(basis[1] instanceof Vector); - - const [v1, v2] = basis; - const d = v1.a.mul(v2.b).isub(v1.b.mul(v2.a)); - const bits = d.bitLength(); - const align = bits >= 160; - - assert(d.eq(this.n)); - - // Start with a rough estimate. - let shift = bits + Math.ceil(bits / 2) + 1; - let g1, g2; - - if (align) - shift -= shift & 63; - - while (shift > bits) { - g1 = v2.b.ushln(shift).divRound(d); - g2 = v1.b.ushln(shift).divRound(d); - - if (g1.ucmp(d) < 0 && g2.ucmp(d) < 0) - break; - - if (align) - shift -= 64; - else - shift -= 1; - } - - if (shift <= bits) - throw new Error('Could not calculate g1 and g2.'); - - return [shift, g1, g2]; - } - - _endoSplit(k) { - // Balanced length-two representation of a multiplier. - // - // [GECC] Algorithm 3.74, Page 127, Section 3.5. - // - // Also note that it is possible to precompute[1] - // values in order to avoid the division[2][3][4]. - // - // This involves precomputing `g1` and `g2 (see - // above). `c1` and `c2` can then be computed as - // follows: - // - // t = ceil(log2(n+1)) + p - // c1 = (k * g1) >> t - // c2 = -((k * g2) >> t) - // - // Where `>>` is an _unsigned_ right shift. Also - // note that the last bit discarded in the shift - // must be stored. If it is 1, then add 1 to the - // scalar (absolute addition). - // - // It's worth noting that libsecp256k1 uses a - // different calculation along the lines of: - // - // t = ceil(log2(n+1)) + p - // c1 = ((k * g1) >> t) * -b1 - // c2 = ((k * -g2) >> t) * -b2 - // k2 = c1 + c2 - // k1 = k2 * -lambda + k - // - // So, in the future, we can consider changing - // step 4 to: - // - // 4. Compute c1 = (k * g1) >> t - // and c2 = -((k * g2) >> t). - // - // const [shift, g1, g2] = this.endo.pre; - // const c1 = k.mulShift(g1, shift); - // const c2 = k.mulShift(g2, shift).ineg(); - // - // Once we're brave enough, that is. - // - // [1] [JCEN12] Page 5, Section 4.3. - // [2] https://github.com/bitcoin-core/secp256k1/blob/0b70241/src/scalar_impl.h#L259 - // [3] https://github.com/bitcoin-core/secp256k1/pull/21 - // [4] https://github.com/bitcoin-core/secp256k1/pull/127 - assert(k instanceof BN); - assert(!k.red); - assert(!this.n.isZero()); - - const [v1, v2] = this.endo.basis; - - // 4. Compute c1 = round(b2 * k / n) - // and c2 = round(-b1 * k / n). - const c1 = v2.b.mul(k).divRound(this.n); - const c2 = v1.b.neg().mul(k).divRound(this.n); - - // 5. Compute k1 = k - c1 * a1 - c2 * a2 - // and k2 = -c1 * b1 - c2 * b2. - const p1 = c1.mul(v1.a); - const p2 = c2.mul(v2.a); - const q1 = c1.ineg().mul(v1.b); - const q2 = c2.mul(v2.b); - - // Calculate answer. - const k1 = k.sub(p1).isub(p2); - const k2 = q1.isub(q2); - - // 6. Return (k1, k2). - return [k1, k2]; - } - - _endoBeta(point) { - assert(point instanceof ShortPoint); - return [point, point._getBeta()]; - } - - _endoWnafMulAdd(points, coeffs) { - // Point multiplication with efficiently computable endomorphisms. - // - // [GECC] Algorithm 3.77, Page 129, Section 3.5. - // [GLV] Page 193, Section 3 (Using Efficient Endomorphisms). - // - // Note it may be possible to do this 4-dimensionally [4GLV]. - assert(Array.isArray(points)); - assert(Array.isArray(coeffs)); - assert(points.length === coeffs.length); - assert(this.endo != null); - - const len = points.length; - const npoints = new Array(len * 2); - const ncoeffs = new Array(len * 2); - - for (let i = 0; i < len; i++) { - const [p1, p2] = this._endoBeta(points[i]); - const [k1, k2] = this._endoSplit(coeffs[i]); - - npoints[i * 2 + 0] = p1; - ncoeffs[i * 2 + 0] = k1; - npoints[i * 2 + 1] = p2; - ncoeffs[i * 2 + 1] = k2; - } - - return this._wnafMulAdd(5, npoints, ncoeffs); - } - - _sswu(u) { - // Simplified Shallue-Woestijne-Ulas Method. - // - // Distribution: 3/8. - // - // [SSWU1] Page 15-16, Section 7. Appendix G. - // [SSWU2] Page 5, Theorem 2.3. - // [H2EC] "Simplified Shallue-van de Woestijne-Ulas Method". - // - // Assumptions: - // - // - a != 0, b != 0. - // - Let z be a non-square in F(p). - // - z != -1. - // - The polynomial g(x) - z is irreducible over F(p). - // - g(b / (z * a)) is square in F(p). - // - u != 0, u != +-sqrt(-1 / z). - // - // Map: - // - // g(x) = x^3 + a * x + b - // t1 = 1 / (z^2 * u^4 + z * u^2) - // x1 = (-b / a) * (1 + t1) - // x1 = b / (z * a), if t1 = 0 - // x2 = z * u^2 * x1 - // x = x1, if g(x1) is square - // = x2, otherwise - // y = sign(u) * abs(sqrt(g(x))) - const {b, z, ai, zi, one} = this; - const z2 = z.redSqr(); - const ba = b.redNeg().redMul(ai); - const bza = b.redMul(zi).redMul(ai); - const u2 = u.redSqr(); - const u4 = u2.redSqr(); - const t0 = z2.redMul(u4).redIAdd(z.redMul(u2)); - const t1 = t0.isZero() ? t0 : t0.redInvert(); - const x1 = t1.isZero() ? bza : ba.redMul(one.redAdd(t1)); - const x2 = z.redMul(u2).redMul(x1); - const y1 = this.solveY2(x1); - const y2 = this.solveY2(x2); - const alpha = y1.redIsSquare() | 0; - const x = [x1, x2][alpha ^ 1]; - const y = [y1, y2][alpha ^ 1].redSqrt(); - - if (y.redIsOdd() !== u.redIsOdd()) - y.redINeg(); - - return this.point(x, y); - } - - _sswui(p, hint) { - // Inverting the Map (Simplified Shallue-Woestijne-Ulas). - // - // Assumptions: - // - // - a^2 * x^2 - 2 * a * b * x - 3 * b^2 is square in F(p). - // - If r < 3 then x != -b / a. - // - // Unlike SVDW, the preimages here are evenly - // distributed (more or less). SSWU covers ~3/8 - // of the curve points. Each preimage has a 1/2 - // chance of mapping to either x1 or x2. - // - // Assuming the point is within that set, each - // point has a 1/4 chance of inverting to any - // of the preimages. This means we can simply - // randomly select a preimage if one exists. - // - // However, the [SVDW2] sampling method seems - // slighly faster in practice for [SQUARED]. - // - // Map: - // - // c = sqrt(a^2 * x^2 - 2 * a * b * x - 3 * b^2) - // u1 = -(a * x + b - c) / (2 * (a * x + b) * z) - // u2 = -(a * x + b + c) / (2 * (a * x + b) * z) - // u3 = -(a * x + b - c) / (2 * b * z) - // u4 = -(a * x + b + c) / (2 * b * z) - // r = random integer in [1,4] - // u = sign(y) * abs(sqrt(ur)) - const {a, b, z} = this; - const {x, y} = p; - const r = hint & 3; - const a2x2 = a.redSqr().redMul(x.redSqr()); - const abx2 = a.redMul(b).redMul(x).redIMuln(2); - const b23 = b.redSqr().redMuln(3); - const axb = a.redMul(x).redIAdd(b); - const c = a2x2.redISub(abx2).redISub(b23).redSqrt(); - const n0 = axb.redSub(c).redINeg(); - const n1 = axb.redAdd(c).redINeg(); - const d0 = axb.redMul(z).redIMuln(2); - const d1 = b.redMul(z).redIMuln(2); - const n = [n0, n1][r & 1]; // r = 1 or 3 - const d = [d0, d1][r >>> 1]; // r = 2 or 3 - const u = n.redDivSqrt(d); - - if (u.redIsOdd() !== y.redIsOdd()) - u.redINeg(); - - return u; - } - - _svdwf(u) { - // Shallue-van de Woestijne Method. - // - // Distribution: 9/16. - // - // [SVDW1] Section 5. - // [SVDW2] Page 8, Section 3. - // Page 15, Section 6, Algorithm 1. - // [H2EC] "Shallue-van de Woestijne Method". - // - // Assumptions: - // - // - p = 1 (mod 3). - // - a = 0, b != 0. - // - Let z be a unique element in F(p). - // - g((sqrt(-3 * z^2) - z) / 2) is square in F(p). - // - u != 0, u != +-sqrt(-g(z)). - // - // Map: - // - // g(x) = x^3 + b - // c = sqrt(-3 * z^2) - // t1 = u^2 + g(z) - // t2 = 1 / (u^2 * t1) - // t3 = u^4 * t2 * c - // x1 = (c - z) / 2 - t3 - // x2 = t3 - (c + z) / 2 - // x3 = z - t1^3 * t2 / (3 * z^2) - // x = x1, if g(x1) is square - // = x2, if g(x2) is square - // = x3, otherwise - // y = sign(u) * abs(sqrt(g(x))) - const {c, z, zi, i2, i3} = this; - const gz = this.solveY2(z); - const z3 = i3.redMul(zi.redSqr()); - const u2 = u.redSqr(); - const u4 = u2.redSqr(); - const t1 = u2.redAdd(gz); - const u2t1 = u2.redMul(t1); - const t2 = u2t1.isZero() ? u2t1 : u2t1.redInvert(); - const t3 = u4.redMul(t2).redMul(c); - const t4 = t1.redSqr().redMul(t1); - const x1 = c.redSub(z).redMul(i2).redISub(t3); - const x2 = t3.redSub(c.redAdd(z).redMul(i2)); - const x3 = z.redSub(t4.redMul(t2).redMul(z3)); - const y1 = this.solveY2(x1); - const y2 = this.solveY2(x2); - const y3 = this.solveY2(x3); - const alpha = y1.redJacobi() | 1; - const beta = y2.redJacobi() | 1; - const i = mod((alpha - 1) * beta, 3); - const x = [x1, x2, x3][i]; - const y = [y1, y2, y3][i]; - - return [x, y]; - } - - _svdw(u) { - const [x, yy] = this._svdwf(u); - const y = yy.redSqrt(); - - if (y.redIsOdd() !== u.redIsOdd()) - y.redINeg(); - - return this.point(x, y); - } - - _svdwi(p, hint) { - // Inverting the Map (Shallue-van de Woestijne). - // - // [SQUARED] Algorithm 1, Page 8, Section 3.3. - // [SVDW2] Page 12, Section 5. - // [SVDW3] "Inverting the map". - // - // Assumptions: - // - // - If r = 1 then x != -(c + z) / 2. - // - If r = 2 then x != (c - z) / 2. - // - If r > 2 then (t0 - t1 + t2) is square in F(p). - // - f(f^-1(x)) = x where f is the map function. - // - // We use the sampling method from [SVDW2], - // _not_ [SQUARED]. This seems to have a - // better distribution in practice. - // - // Note that [SVDW3] also appears to be - // incorrect in terms of distribution. - // - // The distribution of f(u), assuming u is - // random, is (1/2, 1/4, 1/4). - // - // To mirror this, f^-1(x) should simply - // pick (1/2, 1/4, 1/8, 1/8). - // - // To anyone running the forward map, our - // strings will appear to be random. - // - // Map: - // - // g(x) = x^3 + b - // c = sqrt(-3 * z^2) - // t0 = 9 * (x^2 * z^2 + z^4) - // t1 = 18 * x * z^3 - // t2 = 12 * g(z) * (x - z) - // t3 = sqrt(t0 - t1 + t2) - // t4 = t3 * z - // u1 = g(z) * (c - 2 * x - z) / (c + 2 * x + z) - // u2 = g(z) * (c + 2 * x + z) / (c - 2 * x - z) - // u3 = (3 * (z^3 - x * z^2) - 2 * g(z) + t4) / 2 - // u4 = (3 * (z^3 - x * z^2) - 2 * g(z) - t4) / 2 - // r = random integer in [1,4] - // u = sign(y) * abs(sqrt(ur)) - const {b, c, z, zero, two} = this; - const {x, y} = p; - const r = hint & 3; - const z2 = z.redSqr(); - const z3 = z2.redMul(z); - const z4 = z2.redSqr(); - const gz = z3.redAdd(b); - const gz2 = gz.redMuln(2); - const xx = x.redSqr(); - const x2z = x.redMuln(2).redIAdd(z); - const xz2 = x.redMul(z2); - const c0 = c.redSub(x2z); - const c1 = c.redAdd(x2z); - const t0 = xx.redMul(z2).redIAdd(z4).redIMuln(9); - const t1 = x.redMul(z3).redIMuln(18); - const t2 = gz.redMul(x.redSub(z)).redIMuln(12); - const t3 = r >= 2 ? t0.redISub(t1).redIAdd(t2).redSqrt() : zero; - const t4 = t3.redMul(z); - const t5 = z3.redISub(xz2).redIMuln(3).redISub(gz2); - const n0 = gz.redMul(c0); - const n1 = gz.redMul(c1); - const n2 = t5.redAdd(t4); - const n3 = t5.redSub(t4); - const d2 = two; - const n = [n0, n1, n2, n3][r]; - const d = [c1, c0, d2, d2][r]; - const u = n.redDivSqrt(d); - const [x0] = this._svdwf(u); - - if (!x0.eq(x)) - throw new Error('Invalid point.'); - - if (u.redIsOdd() !== y.redIsOdd()) - u.redINeg(); - - return u; - } - - isElliptic() { - const {a, b} = this; - const a2 = a.redSqr(); - const a3 = a2.redMul(a); - const b2 = b.redSqr(); - const d = b2.redMuln(27).redIAdd(a3.redMuln(4)); - - // 4 * a^3 + 27 * b^2 != 0 - return !d.isZero(); - } - - jinv() { - // [ARITH1] Page 71, Section 4.4. - // http://mathworld.wolfram.com/j-Invariant.html - const {a, b} = this; - const a2 = a.redSqr(); - const a3 = a2.redMul(a); - const b2 = b.redSqr(); - const t0 = a3.redMuln(4); - const lhs = t0.redMuln(1728); - const rhs = b2.redMuln(27).redIAdd(t0); - - if (rhs.isZero()) - throw new Error('Curve is not elliptic.'); - - // (1728 * 4 * a^3) / (4 * a^3 + 27 * b^2) - return lhs.redDiv(rhs).fromRed(); - } - - point(x, y) { - return new ShortPoint(this, x, y); - } - - jpoint(x, y, z) { - return new JPoint(this, x, y, z); - } - - solveX(y) { - assert(y instanceof BN); - - if (!this.a.isZero()) - throw new Error('Not implemented.'); - - // x^3 = y^2 - b - const y2 = y.redSqr(); - const x3 = y2.redSub(this.b); - - return cubeRoots(x3); - } - - solveY2(x) { - // [GECC] Page 89, Section 3.2.2. - // https://hyperelliptic.org/EFD/g1p/auto-shortw.html - assert(x instanceof BN); - - // y^2 = x^3 + a * x + b - const x3 = x.redSqr().redMul(x); - const y2 = x3.redIAdd(this.b); - - if (!this.zeroA) { - // Save some cycles for a = -3. - if (this.threeA) - y2.redIAdd(x.redMuln(-3)); - else - y2.redIAdd(this.a.redMul(x)); - } - - return y2; - } - - validate(point) { - assert(point instanceof ShortPoint); - - if (point.inf) - return true; - - const {x, y} = point; - const y2 = this.solveY2(x); - - return y.redSqr().eq(y2); - } - - pointFromX(x, sign = null) { - assert(x instanceof BN); - assert(sign == null || typeof sign === 'boolean'); - - if (!x.red) - x = x.toRed(this.red); - - const y = this.solveY(x); - - if (sign != null) { - if (this.h.cmpn(1) > 0) { - if (y.isZero() && sign) - throw new Error('Invalid point.'); - } - - if (y.redIsOdd() !== sign) - y.redINeg(); - } - - return this.point(x, y); - } - - pointFromY(y, index = 0) { - assert(y instanceof BN); - assert((index >>> 0) === index); - - if (!y.red) - y = y.toRed(this.red); - - const coords = this.solveX(y); - - if (index >= coords.length) - throw new Error('Invalid X coordinate index.'); - - const x = coords[index]; - - return this.point(x, y); - } - - isIsomorphic(curve) { - // [GECC] Page 84, Section 3.1.5. - // [ARITH1] Page 286, Section 13.2.3.c. - assert(curve instanceof Curve); - - if (!curve.p.eq(this.p)) - return false; - - let u2, u3; - try { - [u2, u3] = this._scale(curve); - } catch (e) { - return false; - } - - // E(a,b) <-> E(au^4,bu^6) - if (curve.type === 'short') { - // a' = a * u^4, b' = b * u^6 - const a = this.field(curve.a).redMul(u2.redSqr()); - const b = this.field(curve.b).redMul(u3.redSqr()); - - return this.a.eq(a) && this.b.eq(b); - } - - // E(a,b) <-> M(A,B) - if (curve.type === 'mont') { - // (A / (3 * B))^3 + a * (A / (3 * B)) + b = 0 - const {a3, bi} = curve; - const x = this.field(a3.redMul(bi)).redMul(u2); - const y2 = this.solveY2(x); - - return y2.isZero(); - } - - // E(a,b) <-> E(a,d) - if (curve.type === 'edwards') { - // ((a' + d') / 6)^3 + a * ((a' + d') / 6) + b = 0 - const x = this.field(curve.ad6).redMul(u2); - const y2 = this.solveY2(x); - - return y2.isZero(); - } - - return false; - } - - isIsogenous(curve) { - assert(curve instanceof Curve); - return false; - } - - pointFromShort(point) { - // [GECC] Page 84, Section 3.1.5. - // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves). - assert(point instanceof ShortPoint); - - if (this.isIsomorphic(point.curve)) { - // Isomorphic maps for E(a,b)<->E(au^4,bu^6): - // - // x' = x * u^2 - // y' = y * u^3 - // - // Where a * u^4 = a' and b * u^6 = b'. - if (point.isInfinity()) - return this.point(); - - const [u2, u3] = this._scale(point.curve); - const x = this.field(point.x); - const y = this.field(point.y); - const nx = x.redMul(u2); - const ny = y.redMul(u3); - - return this.point(nx, ny); - } - - throw new Error('Not implemented.'); - } - - pointFromMont(point) { - // [ALT] Appendix E.2 (Switching between Alternative Representations). - // [MONT2] "Equivalence with Weierstrass curves" - assert(point instanceof MontPoint); - - if (this.isIsomorphic(point.curve)) { - // Equivalence for M(A,B)->E(a,b): - // - // x = (u + A / 3) / B - // y = v / B - // - // Undefined if ((u^3 + A * u^2 + u) / B) is not square. - if (point.isInfinity()) - return this.point(); - - const {a3, bi} = point.curve; - const [u2, u3] = this._scale(point.curve); - const nx = point.x.redAdd(a3).redMul(bi); - const ny = point.y.redMul(bi); - - return this.point(this.field(nx).redMul(u2), - this.field(ny).redMul(u3)); - } - - throw new Error('Not implemented.'); - } - - pointFromEdwards(point) { - // [TWISTEQ] Section 2. - assert(point instanceof EdwardsPoint); - - if (this.isIsomorphic(point.curve)) { - // Equivalence for E(a,d)->E(a',b'): - // - // x' = ((5 * d - a) * y + d - 5 * a) / (12 * (y - 1)) - // y' = (d - a) * (y + 1) / (4 * x * (y - 1)) - // - // Undefined for x = 0 or y = 1. - // - // Exceptional Cases: - // - (0, 1) -> O - // - (0, -1) -> ((a + d) / 6, 0) - // - // Unexceptional Cases: - // - (sqrt(1 / a), 0) -> ((5 * a - d) / 12, (a - d) / 4 * sqrt(a)) - const {a, d, ad6} = point.curve; - const [u2, u3] = this._scale(point.curve); - - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) { - const x = this.field(ad6).redMul(u2); - return this.point(x, this.zero); - } - - const {x, y, z} = point; - const a5 = a.redMuln(5); - const d5 = d.redMuln(5); - const dma = d.redSub(a); - const d5a = d5.redSub(a); - const da5 = d.redSub(a5); - const ypz = y.redAdd(z); - const ymz = y.redSub(z); - const xx = d5a.redMul(y).redIAdd(da5.redMul(z)); - const xz = ymz.redMuln(12); - const yy = dma.redMul(ypz).redMul(z); - const yz = ymz.redMul(x).redIMuln(4); - - return this.cpoint(this.field(xx).redMul(u2), - this.field(xz), - this.field(yy).redMul(u3), - this.field(yz)); - } - - throw new Error('Not implemented.'); - } - - pointFromUniform(u) { - assert(u instanceof BN); - - // z = 0 or b = 0 - if (this.z.isZero() || this.b.isZero()) - throw new Error('Not implemented.'); - - // a != 0, b != 0 - if (!this.a.isZero()) - return this._sswu(u); - - // p = 1 mod 3, a = 0, b != 0 - if (!this.c.isZero()) - return this._svdw(u); - - throw new Error('Not implemented.'); - } - - pointToUniform(p, hint) { - // Convert a short weierstrass point to a field - // element by inverting either the SSWU or SVDW - // map. - // - // Hint Layout: - // - // [00000000] [0000] [0000] - // | | | - // | | +-- preimage index - // | +--- subgroup - // +-- bits to OR with uniform bytes - assert(p instanceof ShortPoint); - assert((hint >>> 0) === hint); - - // z = 0 or b = 0 - if (this.z.isZero() || this.b.isZero()) - throw new Error('Not implemented.'); - - // P = O - if (p.isInfinity()) - throw new Error('Invalid point.'); - - // Add a random torsion component. - const i = ((hint >>> 4) & 15) % this.torsion.length; - const q = p.add(this.torsion[i]); - - return wrapErrors(() => { - // a != 0, b != 0 - if (!this.a.isZero()) - return this._sswui(q, hint); - - // p = 1 mod 3, a = 0, b != 0 - if (!this.c.isZero()) - return this._svdwi(q, hint); - - throw new Error('Not implemented.'); - }); - } - - mulAll(points, coeffs) { - return super.mulAll(points, coeffs).toP(); - } - - affinizeAll(points) { - const out = this.normalizeAll(points); - - for (let i = 0; i < out.length; i++) - out[i] = out[i].toP(); - - return out; - } - - decodePoint(bytes) { - return ShortPoint.decode(this, bytes); - } - - encodeX(point) { - assert(point instanceof Point); - return point.encodeX(); - } - - decodeEven(bytes) { - return ShortPoint.decodeEven(this, bytes); - } - - decodeSquare(bytes) { - return ShortPoint.decodeSquare(this, bytes); - } - - toShort(a0, odd, sign = null) { - const [a, b] = this._short(a0, odd); - - const curve = new ShortCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = curve._scale(this); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromShort(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromShort(this.torsion[i]); - - return curve; - } - - toMont(b0, odd, sign = null) { - const [a, b] = this._mont(b0, odd); - - const curve = new MontCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = this._scale(curve); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromShort(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromShort(this.torsion[i]); - - return curve; - } - - toEdwards(a0, odd, sign = null) { - const [a, d] = this._edwards(a0, odd); - - const curve = new EdwardsCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - d: d, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = this._scale(curve); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) { - curve.g = curve.pointFromShort(this.g); - curve.g.normalize(); - } - - if (curve.isComplete()) { - for (let i = 0; i < this.h.word(0); i++) { - curve.torsion[i] = curve.pointFromShort(this.torsion[i]); - curve.torsion[i].normalize(); - } - } - - return curve; - } - - pointFromJSON(json) { - return ShortPoint.fromJSON(this, json); - } - - toJSON(pre) { - const json = super.toJSON(pre); - - json.a = this.a.fromRed().toJSON(); - json.b = this.b.fromRed().toJSON(); - - if (!this.c.isZero()) - json.c = this.c.fromRed().toJSON(); - - return json; - } - } - - /** - * ShortPoint - */ - - class ShortPoint extends Point { - constructor(curve, x, y) { - assert(curve instanceof ShortCurve); - - super(curve, types.AFFINE); - - this.x = this.curve.zero; - this.y = this.curve.zero; - this.inf = true; - - if (x != null) - this._init(x, y); - } - - _init(x, y) { - assert(x instanceof BN); - assert(y instanceof BN); - - this.x = x; - this.y = y; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - - this.inf = false; - } - - _getBeta() { - if (!this.curve.endo) - return null; - - if (this.pre && this.pre.beta) - return this.pre.beta; - - // Augment the point with our beta value. - // This is the counterpart to `k2` after - // the endomorphism split of `k`. - // - // Note that if we have precomputation, - // we have to clone and update all of the - // precomputed points below. - const xb = this.x.redMul(this.curve.endo.beta); - const beta = this.curve.point(xb, this.y); - - if (this.pre) { - beta.pre = this.pre.map((point) => { - const xb = point.x.redMul(this.curve.endo.beta); - return this.curve.point(xb, point.y); - }); - - this.pre.beta = beta; - } - - return beta; - } - - _getJNAF(point) { - assert(point instanceof ShortPoint); - - if (this.inf || point.inf) - return super._getJNAF(point); - - // Create comb for JSF. - const comb = [ - this, // 1 - null, // 3 - null, // 5 - point // 7 - ]; - - // Try to avoid Jacobian points, if possible. - if (this.y.eq(point.y)) { - comb[1] = this.add(point); - comb[2] = this.toJ().sub(point); - } else if (this.y.eq(point.y.redNeg())) { - comb[1] = this.toJ().add(point); - comb[2] = this.sub(point); - } else { - comb[1] = this.toJ().add(point); - comb[2] = this.toJ().sub(point); - } - - return comb; - } - - clone() { - if (this.inf) - return this.curve.point(); - - return this.curve.point(this.x, this.y); - } - - scale(a) { - return this.toJ().scale(a); - } - - neg() { - // P = O - if (this.inf) - return this; - - // -(X1, Y1) = (X1, -Y1) - return this.curve.point(this.x, this.y.redNeg()); - } - - add(p) { - // [GECC] Page 80, Section 3.1.2. - // - // Addition Law: - // - // l = (y1 - y2) / (x1 - x2) - // x3 = l^2 - x1 - x2 - // y3 = l * (x1 - x3) - y1 - // - // 1I + 2M + 1S + 6A - assert(p instanceof ShortPoint); - - // O + P = P - if (this.inf) - return p; - - // P + O = P - if (p.inf) - return this; - - // P + P, P + -P - if (this.x.eq(p.x)) { - // P + -P = O - if (!this.y.eq(p.y)) - return this.curve.point(); - - // P + P = 2P - return this.dbl(); - } - - // X1 != X2, Y1 = Y2 - if (this.y.eq(p.y)) { - // X3 = -X1 - X2 - const nx = this.x.redNeg().redISub(p.x); - - // Y3 = -Y1 - const ny = this.y.redNeg(); - - // Skip the inverse. - return this.curve.point(nx, ny); - } - - // H = X1 - X2 - const h = this.x.redSub(p.x); - - // R = Y1 - Y2 - const r = this.y.redSub(p.y); - - // L = R / H - const l = r.redDiv(h); - - // X3 = L^2 - X1 - X2 - const nx = l.redSqr().redISub(this.x).redISub(p.x); - - // Y3 = L * (X1 - X3) - Y1 - const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); - - return this.curve.point(nx, ny); - } - - dbl() { - // [GECC] Page 80, Section 3.1.2. - // - // Addition Law (doubling): - // - // l = (3 * x1^2 + a) / (2 * y1) - // x3 = l^2 - 2 * x1 - // y3 = l * (x1 - x3) - y1 - // - // 1I + 2M + 2S + 3A + 2*2 + 1*3 - - // P = O - if (this.inf) - return this; - - // Y1 = 0 - if (this.y.isZero()) - return this.curve.point(); - - // XX = X1^2 - const xx = this.x.redSqr(); - - // M = 3 * XX + a - const m = xx.redIMuln(3).redIAdd(this.curve.a); - - // Z = 2 * Y1 - const z = this.y.redMuln(2); - - // L = M / Z - const l = m.redDiv(z); - - // X3 = L^2 - 2 * X1 - const nx = l.redSqr().redISub(this.x).redISub(this.x); - - // Y3 = L * (X1 - X3) - Y1 - const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); - - return this.curve.point(nx, ny); - } - - dblp(pow) { - return this.toJ().dblp(pow).toP(); - } - - getX() { - if (this.inf) - throw new Error('Invalid point.'); - - return this.x.fromRed(); - } - - getY() { - if (this.inf) - throw new Error('Invalid point.'); - - return this.y.fromRed(); - } - - eq(p) { - assert(p instanceof ShortPoint); - - // P = Q - if (this === p) - return true; - - // P = O - if (this.inf) - return p.inf; - - // Q = O - if (p.inf) - return false; - - // X1 = X2, Y1 = Y2 - return this.x.eq(p.x) - && this.y.eq(p.y); - } - - cmp(point) { - assert(point instanceof ShortPoint); - - if (this.inf && !point.inf) - return -1; - - if (!this.inf && point.inf) - return 1; - - if (this.inf && point.inf) - return 0; - - return this.order().cmp(point.order()) - || this.getX().cmp(point.getX()) - || this.getY().cmp(point.getY()); - } - - isInfinity() { - // Infinity cannot be represented in - // the affine space, except by a flag. - return this.inf; - } - - isOrder2() { - if (this.inf) - return false; - - return this.y.isZero(); - } - - isOdd() { - if (this.inf) - return false; - - return this.y.redIsOdd(); - } - - isEven() { - if (this.inf) - return false; - - return this.y.redIsEven(); - } - - isSquare() { - if (this.inf) - return false; - - return this.y.redJacobi() !== -1; - } - - eqX(x) { - assert(x instanceof BN); - assert(!x.red); - - if (this.inf) - return false; - - return this.getX().eq(x); - } - - eqR(x) { - assert(x instanceof BN); - assert(!x.red); - assert(!this.curve.n.isZero()); - - if (this.inf) - return false; - - return this.getX().imod(this.curve.n).eq(x); - } - - mul(k) { - return super.mul(k).toP(); - } - - muln(k) { - return super.muln(k).toP(); - } - - mulBlind(k, rng) { - return super.mulBlind(k, rng).toP(); - } - - mulAdd(k1, p2, k2) { - return super.mulAdd(k1, p2, k2).toP(); - } - - mulH() { - return super.mulH().toP(); - } - - div(k) { - return super.div(k).toP(); - } - - divn(k) { - return super.divn(k).toP(); - } - - divH() { - return super.divH().toP(); - } - - toP() { - return this; - } - - toJ() { - // (X3, Y3, Z3) = (1, 1, 0) - if (this.inf) - return this.curve.jpoint(); - - // (X3, Y3, Z3) = (X1, Y1, 1) - return this.curve.jpoint(this.x, this.y, this.curve.one); - } - - encode(compact) { - // [SEC1] Page 10, Section 2.3.3. - if (compact == null) - compact = true; - - assert(typeof compact === 'boolean'); - - const {fieldSize} = this.curve; - - // We do not serialize points at infinity. - if (this.inf) - throw new Error('Invalid point.'); - - // Compressed form (0x02 = even, 0x03 = odd). - if (compact) { - const p = bufferExports.Buffer.alloc(1 + fieldSize); - const x = this.curve.encodeField(this.getX()); - - p[0] = 0x02 | this.y.redIsOdd(); - x.copy(p, 1); - - return p; - } - - // Uncompressed form (0x04). - const p = bufferExports.Buffer.alloc(1 + fieldSize * 2); - const x = this.curve.encodeField(this.getX()); - const y = this.curve.encodeField(this.getY()); - - p[0] = 0x04; - x.copy(p, 1); - y.copy(p, 1 + fieldSize); - - return p; - } - - static decode(curve, bytes) { - // [SEC1] Page 11, Section 2.3.4. - assert(curve instanceof ShortCurve); - assert(bufferExports.Buffer.isBuffer(bytes)); - - const len = curve.fieldSize; - - if (bytes.length < 1 + len) - throw new Error('Not a point.'); - - // Point forms: - // - // 0x00 -> Infinity (openssl, unsupported) - // 0x02 -> Compressed Even - // 0x03 -> Compressed Odd - // 0x04 -> Uncompressed - // 0x06 -> Hybrid Even (openssl) - // 0x07 -> Hybrid Odd (openssl) - // - // Note that openssl supports serializing points - // at infinity as {0}. We choose not to support it - // because it's strange and not terribly useful. - const form = bytes[0]; - - switch (form) { - case 0x02: - case 0x03: { - if (bytes.length !== 1 + len) - throw new Error('Invalid point size for compressed.'); - - const x = curve.decodeField(bytes.slice(1, 1 + len)); - - if (x.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - const p = curve.pointFromX(x, form === 0x03); - - assert(!p.isInfinity()); - - return p; - } - - case 0x04: - case 0x06: - case 0x07: { - if (bytes.length !== 1 + len * 2) - throw new Error('Invalid point size for uncompressed.'); - - const x = curve.decodeField(bytes.slice(1, 1 + len)); - const y = curve.decodeField(bytes.slice(1 + len, 1 + 2 * len)); - - // [GECC] Algorithm 4.3, Page 180, Section 4. - if (x.cmp(curve.p) >= 0 || y.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - // OpenSSL hybrid encoding. - if (form !== 0x04 && form !== (0x06 | y.isOdd())) - throw new Error('Invalid hybrid encoding.'); - - const p = curve.point(x, y); - - if (!p.validate()) - throw new Error('Invalid point.'); - - assert(!p.isInfinity()); - - return p; - } - - default: { - throw new Error('Unknown point format.'); - } - } - } - - encodeX() { - // [SCHNORR] "Specification". - // [BIP340] "Specification". - return this.curve.encodeField(this.getX()); - } - - static decodeEven(curve, bytes) { - // [BIP340] "Specification". - assert(curve instanceof ShortCurve); - - const x = curve.decodeField(bytes); - - if (x.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - return curve.pointFromX(x, false); - } - - static decodeSquare(curve, bytes) { - // [SCHNORR] "Specification". - assert(curve instanceof ShortCurve); - - const x = curve.decodeField(bytes); - - if (x.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - return curve.pointFromX(x); - } - - toJSON(pre) { - if (this.inf) - return []; - - const x = this.getX().toJSON(); - const y = this.getY().toJSON(); - - if (pre === true && this.pre) - return [x, y, this.pre.toJSON()]; - - return [x, y]; - } - - toPretty() { - if (this.inf) - return []; - - const size = this.curve.fieldSize * 2; - const x = toPretty(this.getX(), size); - const y = toPretty(this.getY(), size); - - return [x, y]; - } - - static fromJSON(curve, json) { - assert(curve instanceof ShortCurve); - assert(Array.isArray(json)); - assert(json.length === 0 - || json.length === 2 - || json.length === 3); - - if (json.length === 0) - return curve.point(); - - const x = BN.fromJSON(json[0]); - const y = BN.fromJSON(json[1]); - const point = curve.point(x, y); - - if (json.length > 2 && json[2] != null) - point.pre = Precomp.fromJSON(point, json[2]); - - return point; - } - - [custom]() { - if (this.inf) - return ''; - - return ''; - } - } - - /** - * JPoint - */ - - class JPoint extends Point { - constructor(curve, x, y, z) { - assert(curve instanceof ShortCurve); - - super(curve, types.JACOBIAN); - - this.x = this.curve.one; - this.y = this.curve.one; - this.z = this.curve.zero; - this.zOne = false; - - if (x != null) - this._init(x, y, z); - } - - _init(x, y, z) { - assert(x instanceof BN); - assert(y instanceof BN); - assert(z == null || (z instanceof BN)); - - this.x = x; - this.y = y; - this.z = z || this.curve.one; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - - this.zOne = this.z.eq(this.curve.one); - } - - clone() { - return this.curve.jpoint(this.x, this.y, this.z); - } - - validate() { - // [GECC] Example 3.20, Page 88, Section 3. - const {a, b} = this.curve; - - // P = O - if (this.isInfinity()) - return true; - - // Z1 = 1 - if (this.zOne) - return this.curve.validate(this.toP()); - - // y^2 = x^3 + a * x * z^4 + b * z^6 - const lhs = this.y.redSqr(); - const x3 = this.x.redSqr().redMul(this.x); - const z2 = this.z.redSqr(); - const z4 = z2.redSqr(); - const z6 = z4.redMul(z2); - const rhs = x3.redIAdd(b.redMul(z6)); - - if (!this.curve.zeroA) { - // Save some cycles for a = -3. - if (this.curve.threeA) - rhs.redIAdd(z4.redIMuln(-3).redMul(this.x)); - else - rhs.redIAdd(a.redMul(z4).redMul(this.x)); - } - - return lhs.eq(rhs); - } - - normalize() { - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#scaling-z - // 1I + 3M + 1S - - // Z = 1 - if (this.zOne) - return this; - - // P = O - if (this.isInfinity()) - return this; - - // A = 1 / Z1 - const a = this.z.redInvert(); - - // AA = A^2 - const aa = a.redSqr(); - - // X3 = X1 * AA - this.x = this.x.redMul(aa); - - // Y3 = Y1 * AA * A - this.y = this.y.redMul(aa).redMul(a); - - // Z3 = 1 - this.z = this.curve.one; - this.zOne = true; - - return this; - } - - scale(a) { - assert(a instanceof BN); - - // P = O - if (this.isInfinity()) - return this.curve.jpoint(); - - // AA = A^2 - const aa = a.redSqr(); - - // X3 = X1 * AA - const nx = this.x.redMul(aa); - - // Y3 = Y1 * AA * A - const ny = this.y.redMul(aa).redMul(a); - - // Z3 = Z1 * A - const nz = this.z.redMul(a); - - return this.curve.jpoint(nx, ny, nz); - } - - neg() { - // -(X1, Y1, Z1) = (X1, -Y1, Z1) - return this.curve.jpoint(this.x, this.y.redNeg(), this.z); - } - - add(p) { - assert(p instanceof Point); - - if (p.type === types.AFFINE) - return this._mixedAdd(p); - - return this._add(p); - } - - _add(p) { - assert(p instanceof JPoint); - - // O + P = P - if (this.isInfinity()) - return p; - - // P + O = P - if (p.isInfinity()) - return this; - - // Z1 = 1 - if (this.zOne) - return p._addJA(this); - - // Z2 = 1 - if (p.zOne) - return this._addJA(p); - - return this._addJJ(p); - } - - _mixedAdd(p) { - assert(p instanceof ShortPoint); - - // O + P = P - if (this.isInfinity()) - return p.toJ(); - - // P + O = P - if (p.isInfinity()) - return this; - - return this._addJA(p); - } - - _addJJ(p) { - // No assumptions. - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-1998-cmo-2 - // 12M + 4S + 6A + 1*2 (implemented as: 12M + 4S + 7A) - - // Z1Z1 = Z1^2 - const z1z1 = this.z.redSqr(); - - // Z2Z2 = Z2^2 - const z2z2 = p.z.redSqr(); - - // U1 = X1 * Z2Z2 - const u1 = this.x.redMul(z2z2); - - // U2 = X2 * Z1Z1 - const u2 = p.x.redMul(z1z1); - - // S1 = Y1 * Z2 * Z2Z2 - const s1 = this.y.redMul(p.z).redMul(z2z2); - - // S2 = Y2 * Z1 * Z1Z1 - const s2 = p.y.redMul(this.z).redMul(z1z1); - - // H = U2 - U1 - const h = u2.redISub(u1); - - // r = S2 - S1 - const r = s2.redISub(s1); - - // H = 0 - if (h.isZero()) { - if (!r.isZero()) - return this.curve.jpoint(); - - return this.dbl(); - } - - // HH = H^2 - const hh = h.redSqr(); - - // HHH = H * HH - const hhh = h.redMul(hh); - - // V = U1 * HH - const v = u1.redMul(hh); - - // X3 = r^2 - HHH - 2 * V - const nx = r.redSqr().redISub(hhh).redISub(v).redISub(v); - - // Y3 = r * (V - X3) - S1 * HHH - const ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh)); - - // Z3 = Z1 * Z2 * H - const nz = this.z.redMul(p.z).redMul(h); - - return this.curve.jpoint(nx, ny, nz); - } - - _addJA(p) { - // Assumes Z2 = 1. - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-madd - // 8M + 3S + 6A + 5*2 (implemented as: 8M + 3S + 7A + 4*2) - - // Z1Z1 = Z1^2 - const z1z1 = this.z.redSqr(); - - // U2 = X2 * Z1Z1 - const u2 = p.x.redMul(z1z1); - - // S2 = Y2 * Z1 * Z1Z1 - const s2 = p.y.redMul(this.z).redMul(z1z1); - - // H = U2 - X1 - const h = u2.redISub(this.x); - - // r = 2 * (S2 - Y1) - const r = s2.redISub(this.y).redIMuln(2); - - // H = 0 - if (h.isZero()) { - if (!r.isZero()) - return this.curve.jpoint(); - - return this.dbl(); - } - - // I = (2 * H)^2 - const i = h.redMuln(2).redSqr(); - - // J = H * I - const j = h.redMul(i); - - // V = X1 * I - const v = this.x.redMul(i); - - // X3 = r^2 - J - 2 * V - const nx = r.redSqr().redISub(j).redISub(v).redISub(v); - - // Y3 = r * (V - X3) - 2 * Y1 * J - const ny = r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2)); - - // Z3 = 2 * Z1 * H - const nz = this.z.redMul(h).redIMuln(2); - - return this.curve.jpoint(nx, ny, nz); - } - - dbl() { - // P = O - if (this.isInfinity()) - return this; - - // Y1 = 0 - if (this.y.isZero()) - return this.curve.jpoint(); - - // a = 0 - if (this.curve.zeroA) - return this._dbl0(); - - // a = -3 - if (this.curve.threeA) - return this._dbl3(); - - return this._dblJ(); - } - - _dblJ() { - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-1998-cmo-2 - // 3M + 6S + 4A + 1*a + 2*2 + 1*3 + 1*4 + 1*8 - // (implemented as: 3M + 6S + 5A + 1*a + 1*2 + 1*3 + 1*4 + 1*8) - - // XX = X1^2 - const xx = this.x.redSqr(); - - // YY = Y1^2 - const yy = this.y.redSqr(); - - // ZZ = Z1^2 - const zz = this.z.redSqr(); - - // S = 4 * X1 * YY - const s = this.x.redMul(yy).redIMuln(4); - - // M = 3 * XX + a * ZZ^2 - const m = xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr())); - - // T = M^2 - 2 * S - const t = m.redSqr().redISub(s).redISub(s); - - // X3 = T - const nx = t; - - // Y3 = M * (S - T) - 8 * YY^2 - const ny = m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8)); - - // Z3 = 2 * Y1 * Z1 - const nz = this.y.redMul(this.z).redIMuln(2); - - return this.curve.jpoint(nx, ny, nz); - } - - _dbl0() { - // Assumes a = 0. - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l - // 2M + 5S + 6A + 3*2 + 1*3 + 1*8 - // (implemented as: 2M + 5S + 7A + 2*2 + 1*3 + 1*8) - - // A = X1^2 - const a = this.x.redSqr(); - - // B = Y1^2 - const b = this.y.redSqr(); - - // C = B^2 - const c = b.redSqr(); - - // + XB2 = (X1 + B)^2 - const xb2 = b.redIAdd(this.x).redSqr(); - - // D = 2 * ((X1 + B)^2 - A - C) - const d = xb2.redISub(a).redISub(c).redIMuln(2); - - // E = 3 * A - const e = a.redIMuln(3); - - // F = E^2 - const f = e.redSqr(); - - // X3 = F - 2 * D - const nx = f.redISub(d).redISub(d); - - // Y3 = E * (D - X3) - 8 * C - const ny = e.redMul(d.redISub(nx)).redISub(c.redIMuln(8)); - - // Z3 = 2 * Y1 * Z1 - const nz = this.y.redMul(this.z).redIMuln(2); - - return this.curve.jpoint(nx, ny, nz); - } - - _dbl3() { - // Assumes a = -3. - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b - // 3M + 5S + 8A + 1*3 + 1*4 + 2*8 - // (implemented as: 3M + 5S + 8A + 1*2 + 1*3 + 1*4 + 1*8) - - // delta = Z1^2 - const delta = this.z.redSqr(); - - // gamma = Y1^2 - const gamma = this.y.redSqr(); - - // beta = X1 * gamma - const beta = this.x.redMul(gamma); - - // + xmdelta = X1 - delta - const xmdelta = this.x.redSub(delta); - - // + xpdelta = X1 + delta - const xpdelta = this.x.redAdd(delta); - - // alpha = 3 * (X1 - delta) * (X1 + delta) - const alpha = xmdelta.redMul(xpdelta).redIMuln(3); - - // + beta4 = 4 * beta - const beta4 = beta.redIMuln(4); - - // + beta8 = 2 * beta4 - const beta8 = beta4.redMuln(2); - - // + gamma28 = 8 * gamma^2 - const gamma28 = gamma.redSqr().redIMuln(8); - - // X3 = alpha^2 - 8 * beta - const nx = alpha.redSqr().redISub(beta8); - - // Z3 = (Y1 + Z1)^2 - gamma - delta - const nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); - - // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 - const ny = alpha.redMul(beta4.redISub(nx)).redISub(gamma28); - - return this.curve.jpoint(nx, ny, nz); - } - - getX() { - if (this.isInfinity()) - throw new Error('Invalid point.'); - - this.normalize(); - - return this.x.fromRed(); - } - - getY() { - if (this.isInfinity()) - throw new Error('Invalid point.'); - - this.normalize(); - - return this.y.fromRed(); - } - - eq(p) { - assert(p instanceof JPoint); - - // P = Q - if (this === p) - return true; - - // P = O - if (this.isInfinity()) - return p.isInfinity(); - - // Q = O - if (p.isInfinity()) - return false; - - // Z1 = Z2 - if (this.z.eq(p.z)) { - return this.x.eq(p.x) - && this.y.eq(p.y); - } - - // X1 * Z2^2 = X2 * Z1^2 - const zz1 = this.z.redSqr(); - const zz2 = p.z.redSqr(); - const x1 = this.x.redMul(zz2); - const x2 = p.x.redMul(zz1); - - if (!x1.eq(x2)) - return false; - - // Y1 * Z2^3 = Y2 * Z1^3 - const zzz1 = zz1.redMul(this.z); - const zzz2 = zz2.redMul(p.z); - const y1 = this.y.redMul(zzz2); - const y2 = p.y.redMul(zzz1); - - return y1.eq(y2); - } - - cmp(point) { - assert(point instanceof JPoint); - - const inf1 = this.isInfinity(); - const inf2 = point.isInfinity(); - - if (inf1 && !inf2) - return -1; - - if (!inf1 && inf2) - return 1; - - if (inf1 && inf2) - return 0; - - return this.order().cmp(point.order()) - || this.getX().cmp(point.getX()) - || this.getY().cmp(point.getY()); - } - - isInfinity() { - // Z1 = 0 - return this.z.isZero(); - } - - isOrder2() { - if (this.isInfinity()) - return false; - - return this.y.isZero(); - } - - isOdd() { - if (this.isInfinity()) - return false; - - this.normalize(); - - return this.y.redIsOdd(); - } - - isEven() { - if (this.isInfinity()) - return false; - - this.normalize(); - - return this.y.redIsEven(); - } - - isSquare() { - if (this.isInfinity()) - return false; - - return this.y.redMul(this.z).redJacobi() !== -1; - } - - eqX(x) { - // Verify that integer `x` is equal to field - // element `x` by scaling it by our z coordinate. - // This optimization is mentioned in and used for - // bip-schnorr[1]. This avoids having to affinize - // the resulting point during verification. - // - // [1] [SCHNORR] "Optimizations". - assert(x instanceof BN); - assert(!x.red); - - if (this.isInfinity()) - return false; - - const zz = this.z.redSqr(); - const rx = x.toRed(this.curve.red).redMul(zz); - - return this.x.eq(rx); - } - - eqR(x) { - // Similar to the optimization above, this - // optimization, suggested by Maxwell[1], - // compares an integer to an X coordinate - // by scaling it. - // - // Since a signature's R value is modulo N - // in ECDSA, we may be dealing with an R - // value greater than N in actuality. - // - // If the equality check fails, we can - // scale N itself by Z and add it to the - // X field element. - // - // [1] https://github.com/bitcoin-core/secp256k1/commit/ce7eb6f - assert(x instanceof BN); - assert(!x.red); - - if (!this.curve.smallGap) - return this.toP().eqR(x); - - if (this.isInfinity()) - return false; - - if (x.cmp(this.curve.p) >= 0) - return false; - - const zz = this.z.redSqr(); - const rx = x.toRed(this.curve.red).redMul(zz); - - if (this.x.eq(rx)) - return true; - - if (this.curve.highOrder) - return false; - - if (x.cmp(this.curve.pmodn) >= 0) - return false; - - const rn = this.curve.redN.redMul(zz); - - rx.redIAdd(rn); - - return this.x.eq(rx); - } - - toP() { - // P = O - if (this.isInfinity()) - return this.curve.point(); - - this.normalize(); - - // (X3, Y3) = (X1 / Z1^2, Y1 / Z1^3) - return this.curve.point(this.x, this.y); - } - - toJ() { - return this; - } - - encode(compact) { - return this.toP().encode(compact); - } - - static decode(curve, bytes) { - return ShortPoint.decode(curve, bytes).toJ(); - } - - encodeX() { - return this.toP().encodeX(); - } - - static decodeEven(curve, bytes) { - return ShortPoint.decodeEven(curve, bytes).toJ(); - } - - static decodeSquare(curve, bytes) { - return ShortPoint.decodeSquare(curve, bytes).toJ(); - } - - toJSON(pre) { - return this.toP().toJSON(pre); - } - - toPretty() { - return this.toP().toPretty(); - } - - static fromJSON(curve, json) { - return ShortPoint.fromJSON(curve, json).toJ(); - } - - [custom]() { - if (this.isInfinity()) - return ''; - - return ''; - } - } - - /** - * MontCurve - */ - - class MontCurve extends Curve { - constructor(conf) { - super(MontPoint, 'mont', conf); - - this.a = BN.fromJSON(conf.a).toRed(this.red); - this.b = BN.fromJSON(conf.b).toRed(this.red); - - this.bi = this.b.redInvert(); - this.a2 = this.a.redAdd(this.two); - this.a24 = this.a2.redMul(this.i4); - this.a3 = this.a.redMul(this.i3); - this.a0 = this.a.redMul(this.bi); - this.b0 = this.bi.redSqr(); - - this._finalize(conf); - } - - static _isomorphism(curveA, curveB, customB) { - // Montgomery Isomorphism. - // - // [MONT3] Page 3, Section 2.1. - // - // Transformation: - // - // A' = A - // B' = B' - // - // Where (B / B') is square. - assert(curveA instanceof BN); - assert(curveB instanceof BN); - assert(customB instanceof BN); - - const a = curveA.clone(); - const b = customB.clone(); - const c = curveB.redDiv(customB); - - if (c.redJacobi() !== 1) - throw new Error('Invalid `b` coefficient.'); - - return [a, b]; - } - - _short(a0, odd) { - // Montgomery->Short Weierstrass Equivalence. - // - // [MONT2] "Equivalence with Weierstrass curves". - // - // Transformation: - // - // a = (3 - A^2) / (3 * B^2) - // b = (2 * A^3 - 9 * A) / (27 * B^3) - const {a, b, three} = this; - const a2 = a.redSqr(); - const a3 = a2.redMul(a); - const b2 = b.redSqr(); - const b3 = b2.redMul(b); - const n0 = three.redSub(a2); - const d0 = b2.redMuln(3); - const n1 = a3.redMuln(2).redISub(a.redMuln(9)); - const d1 = b3.redMuln(27); - const wa = n0.redDiv(d0); - const wb = n1.redDiv(d1); - - if (a0 != null) - return ShortCurve._isomorphism(wa, wb, a0, odd); - - return [wa, wb]; - } - - _mont(b0) { - return MontCurve._isomorphism(this.a, this.b, b0); - } - - _edwards(a0, invert = false) { - // Montgomery->Twisted Edwards Transformation. - // - // [MONT1] Page 11, Section 4.3.5. - // [TWISTED] Theorem 3.2, Page 4, Section 3. - // - // Equivalence: - // - // a = (A + 2) / B - // d = (A - 2) / B - // - // Isomorphism: - // - // a = a' - // d = a' * (A - 2) / (A + 2) - // - // Where ((A + 2) / (B * a')) is square. - // - // If `d` is square, we can usually find - // a complete curve by using the `invert` - // option. This will create an isomorphism - // chain of: M(A,B)->E(a,d)->E(d,a). - // - // The equivalence between E(a,d) and - // E(d,a) is: - // - // (x, y) = (x, 1 / y) - // - // Meaning our map to E(d,a) is: - // - // x = u / v - // y = 1 / ((u - 1) / (u + 1)) - // = (u + 1) / (u - 1) - assert(typeof invert === 'boolean'); - - const {two, bi} = this; - const a = this.a.redAdd(two).redMul(bi); - const d = this.a.redSub(two).redMul(bi); - - if (invert) - a.swap(d); - - if (a0 != null) - return EdwardsCurve._isomorphism(a, d, a0); - - return [a, d]; - } - - _scaleShort(curve) { - assert(curve instanceof ShortCurve); - - const [u2, u3] = curve._scale(this); - - return [this.field(u2.redInvert()), - this.field(u3.redInvert())]; - } - - _scaleMont(curve) { - // We can extract the isomorphism factor with: - // - // c = +-sqrt(B / B') - // - // If base points are available, we can do: - // - // c = v' / v - assert(curve instanceof MontCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) - return this.field(curve.b).redDivSqrt(this.b); - - return this.g.y.redDiv(this.field(curve.g.y)); - } - - _scaleEdwards(curve, invert) { - // We _could_ do something like: - // - // B = 4 / (a - d) - // c = +-sqrt(B / B') - // - // Which can be reduced to: - // - // c = +-sqrt(4 / ((a - d) * B')) - // - // If base points are available: - // - // v = u' / x - // c = v' / v - // - // Which can be reduced to: - // - // c = v' * x / u' - // - // However, the way our maps are - // written, we can re-use the Edwards - // isomorphism factor when going the - // other direction. - assert(curve instanceof EdwardsCurve); - - const c = curve._scale(this, invert); - - return this.field(c); - } - - _solveY0(x) { - assert(x instanceof BN); - - // y^2 = x^3 + A * x^2 + B * x - const a = this.a0; - const b = this.b0; - const x2 = x.redSqr(); - const x3 = x2.redMul(x); - const y2 = x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x)); - - return y2; - } - - _elligator2(u) { - // Elligator 2. - // - // Distribution: 1/2. - // - // [ELL2] Page 11, Section 5.2. - // [H2EC] "Elligator 2 Method". - // "Mappings for Montgomery curves". - // [SAFE] "Indistinguishability from uniform random strings". - // - // Assumptions: - // - // - y^2 = x^3 + A * x^2 + B * x. - // - A != 0, B != 0. - // - A^2 - 4 * B is non-zero and non-square in F(p). - // - Let z be a non-square in F(p). - // - u != +-sqrt(-1 / z). - // - // Note that Elligator 2 is defined over the form: - // - // y'^2 = x'^3 + A' * x'^2 + B' * x' - // - // Instead of: - // - // B * y^2 = x^3 + A * x^2 + x - // - // Where: - // - // A' = A / B - // B' = 1 / B^2 - // x' = x / B - // y' = y / B - // - // And: - // - // x = B * x' - // y = B * y' - // - // This is presumably the result of Elligator 2 - // being designed in long Weierstrass form. If - // we want to support B != 1, we need to do the - // conversion. - // - // Map: - // - // g(x) = x^3 + A * x^2 + B * x - // x1 = -A / (1 + z * u^2) - // x1 = -A, if x1 = 0 - // x2 = -x1 - A - // x = x1, if g(x1) is square - // = x2, otherwise - // y = sign(u) * abs(sqrt(g(x))) - const lhs = this.a0.redNeg(); - const rhs = this.one.redAdd(this.z.redMul(u.redSqr())); - - if (rhs.isZero()) - rhs.inject(this.one); - - const x1 = lhs.redMul(rhs.redInvert()); - const x2 = x1.redNeg().redISub(this.a0); - const y1 = this._solveY0(x1); - const y2 = this._solveY0(x2); - const alpha = y1.redIsSquare() | 0; - const x0 = [x1, x2][alpha ^ 1]; - const y0 = [y1, y2][alpha ^ 1].redSqrt(); - - if (y0.redIsOdd() !== u.redIsOdd()) - y0.redINeg(); - - const x = this.b.redMul(x0); - const y = this.b.redMul(y0); - - return this.point(x, y); - } - - _invert2(p, hint) { - // Inverting the Map (Elligator 2). - // - // [ELL2] Page 12, Section 5.3. - // - // Assumptions: - // - // - -z * x * (x + A) is square in F(p). - // - If r = 1 then x != 0. - // - If r = 2 then x != -A. - // - // Map: - // - // u1 = -(x + A) / (x * z) - // u2 = -x / ((x + A) * z) - // r = random integer in [1,2] - // u = sign(y) * abs(sqrt(ur)) - // - // Note that `0 / 0` can only occur if A = 0 - // (this violates the assumptions of Elligator 2). - const {x, y} = p; - const r = hint & 1; - const x0 = x.redMul(this.bi); - const y0 = y.redMul(this.bi); - const n = x0.redAdd(this.a0); - const d = x0; - const lhs = [n, d][r].redINeg(); - const rhs = [d, n][r].redMul(this.z); - const u = lhs.redDivSqrt(rhs); - - if (u.redIsOdd() !== y0.redIsOdd()) - u.redINeg(); - - return u; - } - - isElliptic() { - const a2 = this.a.redSqr(); - const d = this.b.redMul(a2.redSub(this.four)); - - // B * (A^2 - 4) != 0 - return !d.isZero(); - } - - jinv() { - // [MONT3] Page 3, Section 2. - const {a, three, four} = this; - const a2 = a.redSqr(); - const t0 = a2.redSub(three); - const lhs = t0.redPown(3).redIMuln(256); - const rhs = a2.redSub(four); - - if (rhs.isZero()) - throw new Error('Curve is not elliptic.'); - - // (256 * (A^2 - 3)^3) / (A^2 - 4) - return lhs.redDiv(rhs).fromRed(); - } - - point(x, y) { - return new MontPoint(this, x, y); - } - - jpoint(x, y, z) { - assert(x == null && y == null && z == null); - return this.point(); - } - - xpoint(x, z) { - return new XPoint(this, x, z); - } - - solveY2(x) { - // [MONT3] Page 3, Section 2. - // https://hyperelliptic.org/EFD/g1p/auto-montgom.html - assert(x instanceof BN); - - // B * y^2 = x^3 + A * x^2 + x - const x2 = x.redSqr(); - const x3 = x2.redMul(x); - const by2 = x3.redIAdd(this.a.redMul(x2)).redIAdd(x); - const y2 = by2.redMul(this.bi); - - return y2; - } - - validate(point) { - assert(point instanceof MontPoint); - - if (point.isInfinity()) - return true; - - const {x, y} = point; - const y2 = this.solveY2(x); - - return y.redSqr().eq(y2); - } - - pointFromX(x, sign = null) { - assert(x instanceof BN); - assert(sign == null || typeof sign === 'boolean'); - - if (!x.red) - x = x.toRed(this.red); - - const y = this.solveY(x); - - if (sign != null) { - if (y.isZero() && sign) - throw new Error('Invalid point.'); - - if (y.redIsOdd() !== sign) - y.redINeg(); - } - - return this.point(x, y); - } - - isIsomorphic(curve, invert) { - // [MONT3] Page 3, Section 2.1. - assert(curve instanceof Curve); - - if (!curve.p.eq(this.p)) - return false; - - // M(A,B) <-> M(A,B') - if (curve.type === 'mont') { - const a = this.field(curve.a); - const b = this.field(curve.b); - - // A' = A - if (!this.a.eq(a)) - return false; - - // B' != 0 - if (this.b.isZero()) - return false; - - // jacobi(B / B') = 1 - const c = b.redDiv(this.b); - - return c.redJacobi() === 1; - } - - return curve.isIsomorphic(this, invert); - } - - isIsogenous(curve) { - assert(curve instanceof Curve); - - if (curve.type === 'mont') - return false; - - return curve.isIsogenous(this); - } - - pointFromShort(point) { - // [ALT] Appendix E.2 (Switching between Alternative Representations). - // [MONT2] "Equivalence with Weierstrass curves" - assert(point instanceof ShortPoint); - - if (this.isIsomorphic(point.curve)) { - // Equivalence for E(a,b)->M(A,B): - // - // u = B * x - A / 3 - // v = B * y - // - // Undefined if ((u^3 + A * u^2 + u) / B) is not square. - if (point.isInfinity()) - return this.point(); - - const {a3, b} = this; - const [u2, u3] = this._scale(point.curve); - const x = this.field(point.x).redMul(u2); - const y = this.field(point.y).redMul(u3); - const u = b.redMul(x).redISub(a3); - const v = b.redMul(y); - - return this.point(u, v); - } - - throw new Error('Not implemented.'); - } - - pointFromMont(point) { - // [MONT3] Page 3, Section 2.1. - assert(point instanceof MontPoint); - - if (this.isIsomorphic(point.curve)) { - // Isomorphic maps for M(A,B)<->M(A,B'): - // - // u' = u - // v' = +-sqrt(B / B') * v - // - // Undefined if (B / B') is not square. - if (point.isInfinity()) - return this.point(); - - const c = this._scale(point.curve); - const u = this.field(point.x); - const v = this.field(point.y); - const nu = u; - const nv = c.redMul(v); - - return this.point(nu, nv); - } - - throw new Error('Not implemented.'); - } - - pointFromEdwards(point) { - // [RFC7748] Section 4.1 & 4.2. - // [MONT3] Page 6, Section 2.5. - // [TWISTED] Theorem 3.2, Page 4, Section 3. - assert(point instanceof EdwardsPoint); - assert(point.curve.p.eq(this.p)); - - // Edwards `x`, `y`, `z`. - const x = this.field(point.x); - const y = this.field(point.y); - const z = this.field(point.z); - - if (this.isIsogenous(point.curve)) { - // 4-isogeny maps for E(1,d)->M(2-4d,1): - // - // u = y^2 / x^2 - // v = (2 - x^2 - y^2) * y / x^3 - // - // Undefined for x = 0. - // - // Exceptional Cases: - // - (0, 1) -> O - // - (0, -1) -> (0, 0) - // - // Unexceptional Cases: - // - (+-1, 0) -> (0, 0) - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.zero); - - const c = z.redSqr().redIMuln(2); - const uu = y.redSqr(); - const uz = x.redSqr(); - const vv = c.redISub(uz).redISub(uu).redMul(y); - const vz = uz.redMul(x); - - return this.cpoint(uu, uz, vv, vz); - } - - if (this.isIsomorphic(point.curve, true)) { - // Isomorphic maps for E(d,a)->M(A,B): - // - // u = (y + 1) / (y - 1) - // v = +-sqrt((A - 2) / (B * a)) * u / x - // - // Undefined for x = 0 or y = 1. - // - // Exceptional Cases: - // - (0, 1) -> O - // - (0, -1) -> (0, 0) - // - // Unexceptional Cases: - // - (+-sqrt(1 / a), 0) -> (-1, +-sqrt((A - 2) / B)) - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.zero); - - const c = this._scale(point.curve, true); - const uu = y.redAdd(z); - const uz = y.redSub(z); - const vv = c.redMul(z).redMul(uu); - const vz = x.redMul(uz); - - return this.cpoint(uu, uz, vv, vz); - } - - if (this.isIsomorphic(point.curve, false)) { - // Isomorphic maps for E(a,d)->M(A,B): - // - // u = (1 + y) / (1 - y) - // v = +-sqrt((A + 2) / (B * a)) * u / x - // - // Undefined for x = 0 or y = 1. - // - // Exceptional Cases: - // - (0, 1) -> O - // - (0, -1) -> (0, 0) - // - // Unexceptional Cases: - // - (+-sqrt(1 / a), 0) -> (1, +-sqrt((A + 2) / B)) - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.zero); - - const c = this._scale(point.curve, false); - const uu = z.redAdd(y); - const uz = z.redSub(y); - const vv = c.redMul(z).redMul(uu); - const vz = x.redMul(uz); - - return this.cpoint(uu, uz, vv, vz); - } - - throw new Error('Not implemented.'); - } - - pointFromUniform(u) { - assert(u instanceof BN); - - // z = 0 or A = 0 - if (this.z.isZero() || this.a.isZero()) - throw new Error('Not implemented.'); - - return this._elligator2(u); - } - - pointToUniform(p, hint) { - // Convert a montgomery point to a field - // element by inverting the elligator2 map. - // - // Hint Layout: - // - // [00000000] [0000] [0000] - // | | | - // | | +-- preimage index - // | +--- subgroup - // +-- bits to OR with uniform bytes - assert(p instanceof MontPoint); - assert((hint >>> 0) === hint); - - // z = 0 or A = 0 - if (this.z.isZero() || this.a.isZero()) - throw new Error('Not implemented.'); - - // P = O - if (p.isInfinity()) - throw new Error('Invalid point.'); - - // Add a random torsion component. - const i = ((hint >>> 4) & 15) % this.torsion.length; - const q = p.add(this.torsion[i]); - - return wrapErrors(() => { - return this._invert2(q, hint); - }); - } - - decodePoint(bytes, sign) { - return MontPoint.decode(this, bytes, sign); - } - - encodeX(point) { - assert(point instanceof XPoint); - return point.encode(); - } - - decodeX(bytes) { - return XPoint.decode(this, bytes); - } - - toShort(a0, odd, sign = null) { - const [a, b] = this._short(a0, odd); - - const curve = new ShortCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = curve._scale(this); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromMont(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromMont(this.torsion[i]); - - return curve; - } - - toMont(b0, sign = null) { - const [a, b] = this._mont(b0); - - const curve = new MontCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h, - z: this.z - }); - - if (sign != null) { - const c = curve._scale(this); - - if (c.redIsOdd() !== sign) - c.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromMont(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromMont(this.torsion[i]); - - return curve; - } - - toEdwards(a0, invert, sign = null) { - const [a, d] = this._edwards(a0, invert); - - const curve = new EdwardsCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - d: d, - n: this.n, - h: this.h, - z: this.z - }); - - if (sign != null) { - const c = curve._scale(this, invert); - - if (c.redIsOdd() !== sign) - c.redINeg(); - } - - if (!this.g.isInfinity()) { - curve.g = curve.pointFromMont(this.g); - curve.g.normalize(); - } - - if (curve.isComplete()) { - for (let i = 0; i < this.h.word(0); i++) { - curve.torsion[i] = curve.pointFromMont(this.torsion[i]); - curve.torsion[i].normalize(); - } - } - - return curve; - } - - pointFromJSON(json) { - return MontPoint.fromJSON(this, json); - } - - toJSON(pre) { - const json = super.toJSON(pre); - json.a = this.a.fromRed().toJSON(); - json.b = this.b.fromRed().toJSON(); - return json; - } - } - - /** - * MontPoint - */ - - class MontPoint extends Point { - constructor(curve, x, y) { - assert(curve instanceof MontCurve); - - super(curve, types.AFFINE); - - this.x = this.curve.zero; - this.y = this.curve.zero; - this.inf = true; - - if (x != null) - this._init(x, y); - } - - _init(x, y) { - assert(x instanceof BN); - assert(y instanceof BN); - - this.x = x; - this.y = y; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - - this.inf = false; - } - - clone() { - if (this.inf) - return this.curve.point(); - - return this.curve.point(this.x, this.y); - } - - scale(a) { - return this.clone(); - } - - randomize(rng) { - return this.clone(); - } - - neg() { - // P = O - if (this.inf) - return this; - - // -(X1, Y1) = (X1, -Y1) - return this.curve.point(this.x, this.y.redNeg()); - } - - add(p) { - // [MONT1] Page 8, Section 4.3.2. - // - // Addition Law: - // - // l = (y2 - y1) / (x2 - x1) - // x3 = b * l^2 - a - x1 - x2 - // y3 = l * (x1 - x3) - y1 - // - // 1I + 2M + 1S + 7A + 1*b - assert(p instanceof MontPoint); - - // O + P = P - if (this.inf) - return p; - - // P + O = P - if (p.inf) - return this; - - // P + P, P + -P - if (this.x.eq(p.x)) { - // P + -P = O - if (!this.y.eq(p.y)) - return this.curve.point(); - - // P + P = 2P - return this.dbl(); - } - - // H = X2 - X1 - const h = p.x.redSub(this.x); - - // R = Y2 - Y1 - const r = p.y.redSub(this.y); - - // L = R / H - const l = r.redDiv(h); - - // K = b * L^2 - const k = this.curve.b.redMul(l.redSqr()); - - // X3 = K - a - X1 - X2 - const nx = k.redISub(this.curve.a).redISub(this.x).redISub(p.x); - - // Y3 = L * (X1 - X3) - Y1 - const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); - - return this.curve.point(nx, ny); - } - - dbl() { - // [MONT1] Page 8, Section 4.3.2. - // - // Addition Law (doubling): - // - // l = (3 * x1^2 + 2 * a * x1 + 1) / (2 * b * y1) - // x3 = b * l^2 - a - 2 * x1 - // y3 = l * (x1 - x3) - y1 - // - // 1I + 3M + 2S + 7A + 1*a + 1*b + 1*b + 2*2 + 1*3 - - // P = O - if (this.inf) - return this; - - // Y1 = 0 - if (this.y.isZero()) - return this.curve.point(); - - // M1 = 3 * X1^2 - const m1 = this.x.redSqr().redIMuln(3); - - // M2 = 2 * a * X1 - const m2 = this.curve.a.redMul(this.x).redIMuln(2); - - // M = M1 + M2 + 1 - const m = m1.redIAdd(m2).redIAdd(this.curve.one); - - // Z = 2 * b * Y1 - const z = this.curve.b.redMul(this.y).redIMuln(2); - - // L = M / Z - const l = m.redDiv(z); - - // K = b * L^2 - const k = this.curve.b.redMul(l.redSqr()); - - // X3 = K - a - 2 * X1 - const nx = k.redISub(this.curve.a).redISub(this.x).redISub(this.x); - - // Y3 = L * (X1 - X3) - Y1 - const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); - - return this.curve.point(nx, ny); - } - - getX() { - if (this.inf) - throw new Error('Invalid point.'); - - return this.x.fromRed(); - } - - getY() { - if (this.inf) - throw new Error('Invalid point.'); - - return this.y.fromRed(); - } - - eq(p) { - assert(p instanceof MontPoint); - - // P = Q - if (this === p) - return true; - - // P = O - if (this.inf) - return p.inf; - - // Q = O - if (p.inf) - return false; - - // X1 = X2, Y1 = Y2 - return this.x.eq(p.x) - && this.y.eq(p.y); - } - - cmp(point) { - assert(point instanceof MontPoint); - - if (this.inf && !point.inf) - return -1; - - if (!this.inf && point.inf) - return 1; - - if (this.inf && point.inf) - return 0; - - return this.order().cmp(point.order()) - || this.getX().cmp(point.getX()) - || this.getY().cmp(point.getY()); - } - - isInfinity() { - // Infinity cannot be represented in - // the affine space, except by a flag. - return this.inf; - } - - isOrder2() { - if (this.inf) - return false; - - return this.y.isZero(); - } - - isOdd() { - if (this.inf) - return false; - - return this.y.redIsOdd(); - } - - isEven() { - if (this.inf) - return false; - - return this.y.redIsEven(); - } - - toP() { - return this; - } - - toJ() { - return this; - } - - toX() { - // (X3, Z3) = (1, 0) - if (this.inf) - return this.curve.xpoint(); - - // (X3, Z3) = (X1, 1) - return this.curve.xpoint(this.x, this.curve.one); - } - - encode() { - return this.toX().encode(); - } - - static decode(curve, bytes, sign) { - assert(curve instanceof MontCurve); - return curve.decodeX(bytes).toP(sign); - } - - toJSON(pre) { - if (this.inf) - return []; - - const x = this.getX().toJSON(); - const y = this.getY().toJSON(); - - return [x, y]; - } - - toPretty() { - if (this.inf) - return []; - - const size = this.curve.fieldSize * 2; - const x = toPretty(this.getX(), size); - const y = toPretty(this.getY(), size); - - return [x, y]; - } - - static fromJSON(curve, json) { - assert(curve instanceof MontCurve); - assert(Array.isArray(json)); - assert(json.length === 0 - || json.length === 2 - || json.length === 3); - - if (json.length === 0) - return curve.point(); - - const x = BN.fromJSON(json[0]); - const y = BN.fromJSON(json[1]); - - return curve.point(x, y); - } - - [custom]() { - if (this.inf) - return ''; - - return ''; - } - } - - /** - * XPoint - */ - - class XPoint extends Point { - constructor(curve, x, z) { - assert(curve instanceof MontCurve); - - super(curve, types.PROJECTIVE); - - this.x = this.curve.one; - this.z = this.curve.zero; - - if (x != null) - this._init(x, z); - } - - _init(x, z) { - assert(x instanceof BN); - assert(z == null || (z instanceof BN)); - - this.x = x; - this.z = z || this.curve.one; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - } - - clone() { - return this.curve.xpoint(this.x, this.z); - } - - precompute(power, rng) { - // No-op. - return this; - } - - validate() { - if (this.isInfinity()) - return true; - - // B * y^2 * z = x^3 + A * x^2 * z + x * z^2 - const {x, z} = this; - const x2 = x.redSqr(); - const x3 = x2.redMul(x); - const z2 = z.redSqr(); - const ax2 = this.curve.a.redMul(x2).redMul(z); - const by2 = x3.redIAdd(ax2).redIAdd(x.redMul(z2)); - const y2 = by2.redMul(this.curve.bi); - - // sqrt(y^2 * z^4) = y * z^2 - return y2.redMul(z).redJacobi() !== -1; - } - - normalize() { - // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#scaling-scale - // 1I + 1M - - // P = O - if (this.isInfinity()) - return this; - - // Z1 = 1 - if (this.z.eq(this.curve.one)) - return this; - - // X3 = X1 / Z1 - this.x = this.x.redDiv(this.z); - - // Z3 = 1 - this.z = this.curve.one; - - return this; - } - - scale(a) { - assert(a instanceof BN); - - // P = O - if (this.isInfinity()) - return this.curve.xpoint(); - - // X3 = X1 * A - const nx = this.x.redMul(a); - - // Y3 = Y1 * A - const nz = this.z.redMul(a); - - return this.curve.xpoint(nx, nz); - } - - neg() { - // -(X1, Z1) = (X1, Z1) - return this; - } - - dbl() { - // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 - // 2M + 2S + 4A + 1*a24 - - // A = X1 + Z1 - const a = this.x.redAdd(this.z); - - // AA = A^2 - const aa = a.redSqr(); - - // B = X1 - Z1 - const b = this.x.redSub(this.z); - - // BB = B^2 - const bb = b.redSqr(); - - // C = AA - BB - const c = aa.redSub(bb); - - // X3 = AA * BB - const nx = aa.redMul(bb); - - // Z3 = C * (BB + a24 * C) - const nz = c.redMul(bb.redIAdd(this.curve.a24.redMul(c))); - - return this.curve.xpoint(nx, nz); - } - - diffAddDbl(p2, p3) { - // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#ladder-ladd-1987-m-3 - // 6M + 4S + 8A + 1*a24 - assert(p2 instanceof XPoint); - assert(p3 instanceof XPoint); - - // A = X2 + Z2 - const a = p2.x.redAdd(p2.z); - - // AA = A^2 - const aa = a.redSqr(); - - // B = X2 - Z2 - const b = p2.x.redSub(p2.z); - - // BB = B^2 - const bb = b.redSqr(); - - // E = AA - BB - const e = aa.redSub(bb); - - // C = X3 + Z3 - const c = p3.x.redAdd(p3.z); - - // D = X3 - Z3 - const d = p3.x.redSub(p3.z); - - // DA = D * A - const da = d.redMul(a); - - // CB = C * B - const cb = c.redMul(b); - - // X5 = Z1 * (DA + CB)^2 - const x5 = this.z.redMul(da.redAdd(cb).redSqr()); - - // Z5 = X1 * (DA - CB)^2 - const z5 = this.x.redMul(da.redISub(cb).redSqr()); - - // X4 = AA * BB - const x4 = aa.redMul(bb); - - // Z4 = E * (BB + a24 * E) - const z4 = e.redMul(bb.redIAdd(this.curve.a24.redMul(e))); - - return [ - this.curve.xpoint(x4, z4), - this.curve.xpoint(x5, z5) - ]; - } - - getX() { - if (this.isInfinity()) - throw new Error('Invalid point.'); - - this.normalize(); - - return this.x.fromRed(); - } - - getY(sign) { - return this.toP(sign).getY(); - } - - eq(p) { - assert(p instanceof XPoint); - - // P = Q - if (this === p) - return true; - - // P = O - if (this.isInfinity()) - return p.isInfinity(); - - // Q = O - if (p.isInfinity()) - return false; - - // Z1 = Z2 - if (this.z.eq(p.z)) - return this.x.eq(p.x); - - // X1 * Z2 = X2 * Z1 - const x1 = this.x.redMul(p.z); - const x2 = p.x.redMul(this.z); - - return x1.eq(x2); - } - - cmp(point) { - assert(point instanceof XPoint); - - const inf1 = this.isInfinity(); - const inf2 = point.isInfinity(); - - if (inf1 && !inf2) - return -1; - - if (!inf1 && inf2) - return 1; - - if (inf1 && inf2) - return 0; - - return this.order().cmp(point.order()) - || this.getX().cmp(point.getX()); - } - - isInfinity() { - // Z1 = 0 - return this.z.isZero(); - } - - isOrder2() { - if (this.isInfinity()) - return false; - - return this.x.isZero(); - } - - isOdd() { - return false; - } - - isEven() { - return false; - } - - hasTorsion() { - if (this.isInfinity()) - return false; - - // X1 = 0, Z1 != 0 (edge case) - if (this.x.isZero()) - return true; - - return super.hasTorsion(); - } - - order() { - try { - return this.toP().order(); - } catch (e) { - return new BN(1); - } - } - - jmul(k) { - // Multiply with the Montgomery Ladder. - // - // [MONT3] Algorithm 4, Page 12, Section 4.2. - // - // Note that any clamping is meant to - // be done _outside_ of this function. - assert(k instanceof BN); - assert(!k.red); - - const bits = k.bitLength(); - - let a = this.curve.xpoint(); - let b = this; - - for (let i = bits - 1; i >= 0; i--) { - const bit = k.bit(i); - - if (bit === 0) - [a, b] = this.diffAddDbl(a, b); - else - [b, a] = this.diffAddDbl(b, a); - } - - return a; - } - - jmulBlind(k, rng) { - if (!rng) - return this.jmul(k); - - // Randomize if available. - return this.randomize(rng).jmul(k); - } - - jmulAdd(k1, p2, k2) { - throw new Error('Not implemented.'); - } - - toP(sign = null) { - assert(sign == null || typeof sign === 'boolean'); - - if (this.isInfinity()) - return this.curve.point(); - - this.normalize(); - - return this.curve.pointFromX(this.x, sign); - } - - toJ() { - return this; - } - - toX() { - return this; - } - - key() { - if (this.isInfinity()) - return `${this.curve.uid}:oo`; - - this.normalize(); - - const x = this.getX().toString(16); - - return `${this.curve.uid}:${x}`; - } - - encode() { - // [RFC7748] Section 5. - return this.curve.encodeField(this.getX()); - } - - static decode(curve, bytes) { - assert(curve instanceof MontCurve); - - // [RFC7748] Section 5. - const x = curve.decodeField(bytes); - - // We're supposed to ignore the hi bit - // on montgomery points... I think. If - // we don't, the X25519 test vectors - // break, which is pretty convincing - // evidence. This is a no-op for X448. - x.iumaskn(curve.fieldBits); - - // Note: montgomery points are meant to be - // reduced by the prime and do not have to - // be explicitly validated in order to do - // the montgomery ladder. - const p = curve.xpoint(x, curve.one); - - assert(!p.isInfinity()); - - return p; - } - - toJSON(pre) { - return this.toP().toJSON(pre); - } - - toPretty() { - return this.toP().toPretty(); - } - - static fromJSON(curve, json) { - return MontPoint.fromJSON(curve, json).toX(); - } - - [custom]() { - if (this.isInfinity()) - return ''; - - return ''; - } - } - - /** - * EdwardsCurve - */ - - class EdwardsCurve extends Curve { - constructor(conf) { - super(EdwardsPoint, 'edwards', conf); - - this.a = BN.fromJSON(conf.a).toRed(this.red); - this.d = BN.fromJSON(conf.d).toRed(this.red); - this.s = BN.fromJSON(conf.s || '0').toRed(this.red); - this.si = this.s.isZero() ? this.zero : this.s.redInvert(); - - this.k = this.d.redMuln(2); - this.smi = -this.d.redNeg().word(0); - this.ad6 = this.a.redAdd(this.d).redMul(this.i6); - - this.twisted = !this.a.eq(this.one); - this.oneA = this.a.eq(this.one); - this.mOneA = this.a.eq(this.one.redNeg()); - this.smallD = this.prime != null && this.d.redNeg().length === 1; - this.alt = null; - - this._finalize(conf); - } - - static _isomorphism(curveA, curveD, customA) { - // Twisted Edwards Isomorphism. - // - // [TWISTED] Definition 2.1, Page 3, Section 2. - // - // Transformation: - // - // a' = a' - // d' = a' * d / a - // - // Where (a / a') is square. - assert(curveA instanceof BN); - assert(curveD instanceof BN); - assert(customA instanceof BN); - - const a = customA.clone(); - const d = customA.redMul(curveD).redDiv(curveA); - const c = curveA.redDiv(customA); - - if (c.redJacobi() !== 1) - throw new Error('Invalid `a` coefficient.'); - - return [a, d]; - } - - _short(a0, odd) { - // Twisted Edwards->Short Weierstrass Equivalence. - // - // [TWISTEQ] Section 2. - // - // Transformation: - // - // a' = -(a^2 + 14 * a * d + d^2) / 48 - // b' = (33 * (a^2 * d + a * d^2) - a^3 - d^3) / 864 - const {a, d} = this; - const a2 = a.redSqr(); - const a3 = a2.redMul(a); - const d2 = d.redSqr(); - const d3 = d2.redMul(d); - const ad14 = a.redMul(d).redIMuln(14); - const a2d = a2.redMul(d); - const ad2 = a.redMul(d2); - const t0 = a2d.redIAdd(ad2).redIMuln(33); - const wa = a2.redAdd(ad14).redIAdd(d2).redDivn(-48); - const wb = t0.redISub(a3).redISub(d3).redDivn(864); - - if (a0 != null) - return ShortCurve._isomorphism(wa, wb, a0, odd); - - return [wa, wb]; - } - - _mont(b0, invert = false) { - // Twisted Edwards->Montgomery Transformation. - // - // [TWISTED] Theorem 3.2, Page 4, Section 3. - // - // Equivalence: - // - // A = 2 * (a + d) / (a - d) - // B = 4 / (a - d) - // - // Isomorphism: - // - // A = 2 * (a + d) / (a - d) - // B = B' - // - // Where ((4 / (a - d)) / B') is square. - // - // If `4 / (a - d)` is non-square, we can - // usually force B=1 by using the `invert` - // option. This will create an isomorphism - // chain of: E(a,d)->E(d,a)->M(-A,-B). - // - // The equivalence between E(a,d) and E(d,a) - // is: - // - // (x, y) = (x, 1 / y) - // - // Meaning our map to M(-A,-B) is: - // - // u = (1 + 1 / y) / (1 - 1 / y) - // = (y + 1) / (y - 1) - // v = u / x - assert(typeof invert === 'boolean'); - - let apd, amd; - - if (invert) { - apd = this.d.redAdd(this.a); - amd = this.d.redSub(this.a); - } else { - apd = this.a.redAdd(this.d); - amd = this.a.redSub(this.d); - } - - const z = amd.redInvert(); - const a = apd.redMuln(2).redMul(z); - const b = z.redMuln(4); - - if (b0 != null) - return MontCurve._isomorphism(a, b, b0); - - return [a, b]; - } - - _edwards(a0) { - return EdwardsCurve._isomorphism(this.a, this.d, a0); - } - - _scaleShort(curve) { - assert(curve instanceof ShortCurve); - - const [u2, u3] = curve._scale(this); - - return [this.field(u2.redInvert()), - this.field(u3.redInvert())]; - } - - _scaleMont(curve, invert = false) { - // Calculate isomorphism factor between - // Twisted Edwards and Montgomery with: - // - // a = (A + 2) / B - // c = +-sqrt(a / a') - // - // Which can be reduced to: - // - // c = +-sqrt((A + 2) / (B * a')) - // - // If base points are available, we can do: - // - // x = u / v - // c = x' / x - // - // Which can be reduced to: - // - // c = v * x' / u - // - // We can now calculate the Edwards `x` with: - // - // x' = c * u / v - // - // And likewise, the Montgomery `v`: - // - // v = c * u / x' - assert(curve instanceof MontCurve); - assert(typeof invert === 'boolean'); - - if (this.g.isInfinity() || curve.g.isInfinity()) { - const [a] = curve._edwards(null, invert); - - return this.field(a).redDivSqrt(this.a); - } - - const x = curve.g.x.redDiv(curve.g.y); - - return this.g.x.redDiv(this.field(x)); - } - - _scaleEdwards(curve) { - // We can extract the isomorphism factor with: - // - // c = +-sqrt(a / a') - // - // If base points are available, we can do: - // - // c = x' / x - assert(curve instanceof EdwardsCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) - return this.field(curve.a).redDivSqrt(this.a); - - return this.g.x.redDiv(this.field(curve.g.x)); - } - - _mulA(num) { - assert(num instanceof BN); - - // n * a = n - if (this.oneA) - return num.clone(); - - // n * a = -n - if (this.mOneA) - return num.redNeg(); - - return this.a.redMul(num); - } - - _mulD(num) { - assert(num instanceof BN); - - // -d < 0x4000000 - if (this.smallD) - return num.redMuln(this.smi); - - return this.d.redMul(num); - } - - _elligator1(t) { - // Elligator 1. - // - // Distribution: 1/2. - // - // [ELL1] Page 6, Section 3. - // Page 15, Appendix A. - // [ELL2] Page 7, Section 3.2. - // - // Assumptions: - // - // - Let p be a prime power congruent to 3 mod 4. - // - Let s be a nonzero element of F(p). - // - Let c = 2 / s^2. - // - Let r = c + 1 / c. - // - Let d = -(c + 1)^2 / (c - 1)^2. - // - (s^2 - 2) * (s^2 + 2) != 0. - // - c * (c - 1) * (c + 1) != 0. - // - r != 0. - // - d is not square. - // - x^2 + y^2 = 1 + d * x^2 * y^2. - // - u * v * X * Y * x * (Y + 1) != 0. - // - Y^2 = X^5 + (r^2 - 2) * X^3 + X. - // - // Elligator 1, as devised by Fouque et al, - // takes place on the hyperelliptic curve of: - // - // y^2 = x^5 + (r^2 - 2) * x^3 + x - // - // Not only must our Edwards curve be complete, - // with a prime congruent to 3 mod 4, and a = 1, - // our curve must be isomorphic to a hyperelliptic - // curve of the above form. Roughly one half of - // all Edwards curves are isomorphic to a curve - // of said form. - // - // We can derive the isomorphism with: - // - // c = (d +- 2 * sqrt(-d) - 1) / (d + 1) - // s = +-sqrt(2 / c) - // r = c + 1 / c - // - // Note that even if your curve is an Elligator 1 - // curve, Elligator 2 is probably still preferable, - // as it has nearly the same properties (i.e. the - // same distribution), and is much less complex. - // - // Map: - // - // f(a) = a^((p - 1) / 2) - // u = (1 - t) / (1 + t) - // v = u^5 + (r^2 - 2) * u^3 + u - // X = f(v) * u - // Y = (f(v) * v)^((p + 1) / 4) * f(v) * f(u^2 + 1 / c^2) - // Y = 1, if u = 0 - // x = (c - 1) * s * X * (1 + X) / Y - // y = (r * X - (1 + X)^2) / (r * X + (1 + X)^2) - // - // When t = +-1, we create the hyperelliptic - // 2-torsion point of (0, 0). This needs to be - // mapped to (0, -1) in Edwards form, but the x - // denominator becomes zero. As far as I can - // tell, this is the only exceptional case. - // - // The only other exceptional case initially - // appears to be when the y denominator sums to - // zero (when t = sqrt(4 / r + 1)), however, the - // hyperelliptic `X` is negated by the sign of - // `v`, making this impossible. - const {s, si, i2, one, two} = this; - const c = si.redSqr().redIMuln(2); - const ci = s.redSqr().redMul(i2); - const ci2 = ci.redSqr(); - const r = c.redAdd(ci); - const r2 = r.redSqr().redISub(two); - const cm1 = c.redSub(one); - const uu = one.redSub(t); - const uz = one.redAdd(t); - const u = uz.isZero() ? uz : uu.redDiv(uz); - const u2 = u.redSqr(); - const u3 = u2.redMul(u); - const u5 = u3.redMul(u2); - const v = u5.redAdd(r2.redMul(u3)).redIAdd(u); - const f0 = this.field(v.redJacobi()); - const f1 = this.field(u2.redAdd(ci2).redJacobi()); - const f2 = f0.redMul(f1); - const X = f0.redMul(u); - const Y = f0.redMul(v).redSqrt().redMul(f2); - const X1 = one.redAdd(X); - const rX = r.redMul(X); - const X12 = X1.redSqr(); - const xx = cm1.redMul(s).redMul(X).redMul(X1); - const xz = u.isZero() ? this.one : Y; - const yy = rX.redSub(X12); - const yz = rX.redAdd(X12); - - return this.cpoint(xx, xz, yy, yz); - } - - _invert1(p, hint) { - // Inverting the Map (Elligator 1). - // - // [ELL1] Page 6, Section 3. - // Page 15, Appendix A. - // [ELL2] Page 7, Section 3.3. - // - // Assumptions: - // - // - y + 1 != 0. - // - (1 + n * r)^2 - 1 is square in F(p). - // - If n * r = -2 then x = 2 * s * (c - 1) * f(c) / r. - // - Y = (c - 1) * s * X * (1 + X) / x. - // - // Map: - // - // f(a) = a^((p - 1) / 2) - // n = (y - 1) / (2 * (y + 1)) - // X = -(1 + n * r) + ((1 + n * r)^2 - 1)^((p + 1) / 4) - // z = f((c - 1) * s * X * (1 + X) * x * (X^2 + 1 / c^2)) - // u = z * X - // t = (1 - u) / (1 + u) - const {s, si, i2, one} = this; - const {x, y, z} = p; - const sign = hint & 1; - const c = si.redSqr().redIMuln(2); - const ci = s.redSqr().redMul(i2); - const ci2 = ci.redSqr(); - const r = c.redAdd(ci); - const cm1 = c.redSub(one); - const nn = y.redSub(z); - const nz = y.redAdd(z).redIMuln(2); - const n = nz.isZero() ? nz : nn.redDiv(nz); - const nr1 = one.redAdd(n.redMul(r)); - const w2 = nr1.redSqr().redISub(one); - const w = w2.redSqrt(); - const X = w.redSub(nr1); - const X1 = one.redAdd(X); - const YY = cm1.redMul(s).redMul(X).redMul(X1); - const Y = YY.redMul(x.redMul(z)); - const X2 = X.redSqr().redIAdd(ci2); - const Z = this.field(Y.redMul(X2).redJacobi()); - const u = Z.redMul(X); - const tt = one.redSub(u); - const tz = one.redAdd(u); - const t = tz.isZero() ? tz : tt.redDiv(tz); - - if (t.redIsOdd() !== Boolean(sign)) - t.redINeg(); - - return t; - } - - _alt() { - if (!this.alt) - this.alt = this.toMont(); - - return this.alt; - } - - isElliptic() { - const ad = this.a.redMul(this.d); - const amd = this.a.redSub(this.d); - - // a * d * (a - d) != 0 - return !ad.redMul(amd).isZero(); - } - - jinv() { - // [TWISTED] Definition 2.1, Page 3, Section 2. - const {a, d} = this; - const ad = a.redMul(d); - const amd4 = a.redSub(d).redPown(4); - const a2 = a.redSqr(); - const d2 = d.redSqr(); - const t0 = a2.redAdd(ad.redMuln(14)).redIAdd(d2); - const lhs = t0.redPown(3).redIMuln(16); - const rhs = ad.redMul(amd4); - - if (rhs.isZero()) - throw new Error('Curve is not elliptic.'); - - // 16 * (a^2 + 14 * a * d + d^2)^3 / (a * d * (a - d)^4) - return lhs.redDiv(rhs).fromRed(); - } - - isComplete() { - return this.a.redJacobi() === 1 - && this.d.redJacobi() === -1; - } - - point(x, y, z, t) { - return new EdwardsPoint(this, x, y, z, t); - } - - jpoint(x, y, z) { - assert(x == null && y == null && z == null); - return this.point(); - } - - cpoint(xx, xz, yy, yz) { - assert(xx instanceof BN); - assert(xz instanceof BN); - assert(yy instanceof BN); - assert(yz instanceof BN); - - const x = xx.redMul(yz); - const y = yy.redMul(xz); - const z = xz.redMul(yz); - const t = xx.redMul(yy); - - return this.point(x, y, z, t); - } - - solveX2(y) { - // [RFC8032] Section 5.1.3 & 5.2.3. - assert(y instanceof BN); - - // x^2 = (y^2 - 1) / (d * y^2 - a) - const y2 = y.redSqr(); - const rhs = this._mulD(y2).redISub(this.a); - const lhs = y2.redISub(this.one); - const x2 = lhs.redDiv(rhs); - - return x2; - } - - solveX(y) { - // Optimize with inverse square root trick. - // - // Note that `0 / 0` can only occur if - // `a == d` (i.e. the curve is singular). - const y2 = y.redSqr(); - const rhs = this._mulD(y2).redISub(this.a); - const lhs = y2.redISub(this.one); - - return lhs.redDivSqrt(rhs); - } - - solveY2(x) { - assert(x instanceof BN); - - // y^2 = (a * x^2 - 1) / (d * x^2 - 1) - const x2 = x.redSqr(); - const lhs = this._mulA(x2).redISub(this.one); - const rhs = this._mulD(x2).redISub(this.one); - const y2 = lhs.redDiv(rhs); - - return y2; - } - - solveY(x) { - // Optimize with inverse square root trick. - // - // Note that `0 / 0` can only occur if - // `a == d` (i.e. the curve is singular). - const x2 = x.redSqr(); - const lhs = this._mulA(x2).redISub(this.one); - const rhs = this._mulD(x2).redISub(this.one); - - return lhs.redDivSqrt(rhs); - } - - validate(point) { - // [TWISTED] Definition 2.1, Page 3, Section 2. - // Page 11, Section 6. - assert(point instanceof EdwardsPoint); - - // Z1 = 1 - if (point.zOne) { - // a * x^2 + y^2 = 1 + d * x^2 * y^2 - const x2 = point.x.redSqr(); - const y2 = point.y.redSqr(); - const dxy = this._mulD(x2).redMul(y2); - const lhs = this._mulA(x2).redIAdd(y2); - const rhs = this.one.redAdd(dxy); - const tz = point.t; - const xy = point.x.redMul(point.y); - - return lhs.eq(rhs) && tz.eq(xy); - } - - // (a * x^2 + y^2) * z^2 = z^4 + d * x^2 * y^2 - const x2 = point.x.redSqr(); - const y2 = point.y.redSqr(); - const z2 = point.z.redSqr(); - const z4 = z2.redSqr(); - const dxy = this._mulD(x2).redMul(y2); - const lhs = this._mulA(x2).redIAdd(y2).redMul(z2); - const rhs = z4.redIAdd(dxy); - const tz = point.t.redMul(point.z); - const xy = point.x.redMul(point.y); - - return lhs.eq(rhs) && tz.eq(xy); - } - - pointFromX(x, sign = null) { - assert(x instanceof BN); - assert(sign == null || typeof sign === 'boolean'); - - if (!x.red) - x = x.toRed(this.red); - - const y = this.solveY(x); - - if (sign != null) { - if (y.isZero() && sign) - throw new Error('Invalid point.'); - - if (y.redIsOdd() !== sign) - y.redINeg(); - } - - return this.point(x, y); - } - - pointFromY(y, sign = null) { - assert(y instanceof BN); - assert(sign == null || typeof sign === 'boolean'); - - if (!y.red) - y = y.toRed(this.red); - - const x = this.solveX(y); - - if (sign != null) { - if (x.isZero() && sign) - throw new Error('Invalid point.'); - - if (x.redIsOdd() !== sign) - x.redINeg(); - } - - return this.point(x, y); - } - - isIsomorphic(curve, invert = false) { - // [TWISTED] Theorem 3.2, Page 4, Section 3. - // Definition 2.1, Page 3, Section 2. - assert(curve instanceof Curve); - assert(typeof invert === 'boolean'); - - if (!curve.p.eq(this.p)) - return false; - - // E(a,d) <-> E(a,b) - if (curve.type === 'short') - return curve.isIsomorphic(this); - - // E(a,d) <-> M(A,B) - // E(a,d) <-> M(-A,-B) - if (curve.type === 'mont') { - // A * (a - d) = 2 * (a + d) - const a = this.field(curve.a); - - let apd, amd; - - if (invert) { - apd = this.d.redAdd(this.a); - amd = this.d.redSub(this.a); - } else { - apd = this.a.redAdd(this.d); - amd = this.a.redSub(this.d); - } - - return a.redMul(amd).eq(apd.redIMuln(2)); - } - - // E(a,d) <-> E(a',a'd/a) - if (curve.type === 'edwards') { - // a' * d = a * d' - const a = this.field(curve.a); - const d = this.field(curve.d); - - return this.a.redMul(d).eq(a.redMul(this.d)); - } - - return false; - } - - isIsogenous(curve) { - // Check for the 4-isogenies described by Hamburg: - // https://moderncrypto.org/mail-archive/curves/2016/000806.html - assert(curve instanceof Curve); - - if (!curve.p.eq(this.p)) - return false; - - // E(1,d) <-> M(2-4d,1) - if (curve.type === 'mont') { - if (!this.a.eq(this.one)) - return false; - - const a = this.field(curve.a); - const b = this.field(curve.b); - const d24 = this.two.redSub(this.d.redMuln(4)); - - return a.eq(d24) && b.eq(this.one); - } - - // E(a,d) <-> E(-a,d-a) - if (curve.type === 'edwards') { - const a = this.field(curve.a); - const d = this.field(curve.d); - - return a.eq(this.a.redNeg()) - && d.eq(this.d.redSub(this.a)); - } - - return false; - } - - pointFromShort(point) { - // [TWISTEQ] Section 1. - assert(point instanceof ShortPoint); - - if (this.isIsomorphic(point.curve)) { - // Equivalence for E(a,b)->E(a',d'): - // - // x' = (6 * x - a' - d') / (6 * y) - // y' = (12 * x - 5 * a' + d') / (12 * x + a' - 5 * d') - // - // Undefined for x = (5 * d' - a') / 12 or y = 0. - // - // Exceptional Cases: - // - O -> (0, 1) - // - ((a' + d') / 6, 0) -> (0, -1) - // - ((5 * d' - a') / 12, (d' - a') / 4 * sqrt(d')) -> (sqrt(1/d'), oo) - // - // Unexceptional Cases: - // - ((5 * a' - d') / 12, (a' - d') / 4 * sqrt(a')) -> (sqrt(1/a'), 0) - if (point.isInfinity()) - return this.point(); - - if (point.y.isZero()) - return this.point(this.zero, this.one.redNeg()); - - const {a, d} = this; - const [u2, u3] = this._scale(point.curve); - const a5 = a.redMuln(5); - const d5 = d.redMuln(5); - const x = this.field(point.x).redMul(u2); - const y = this.field(point.y).redMul(u3); - const x6 = x.redMuln(6); - const x12 = x.redMuln(12); - const xx = x6.redSub(a).redISub(d); - const xz = y.redMuln(6); - const yy = x12.redSub(a5).redIAdd(d); - const yz = x12.redAdd(a).redISub(d5); - - return this.cpoint(xx, xz, yy, yz); - } - - throw new Error('Not implemented.'); - } - - pointFromMont(point) { - // [RFC7748] Section 4.1 & 4.2. - // [MONT3] Page 6, Section 2.5. - // [TWISTED] Theorem 3.2, Page 4, Section 3. - assert(point instanceof MontPoint); - assert(point.curve.p.eq(this.p)); - - // Montgomery `u`, `v`. - const u = this.field(point.x); - const v = this.field(point.y); - - if (this.isIsogenous(point.curve)) { - // 4-isogeny maps for M(2-4d,1)->E(1,d): - // - // x = 4 * v * (u^2 - 1) / (u^4 - 2 * u^2 + 4 * v^2 + 1) - // y = -(u^5 - 2 * u^3 - 4 * u * v^2 + u) / - // (u^5 - 2 * u^2 * v^2 - 2 * u^3 - 2 * v^2 + u) - // - // Undefined for u = 0 and v = 0. - // - // Exceptional Cases: - // - O -> (0, 1) - // - (0, 0) -> (0, 1) - // - // Unexceptional Cases: - // - (-1, +-sqrt(A - 2)) -> (0, 1) - // - (1, +-sqrt(A + 2)) -> (0, -1) - // - // The point (1, v) is invalid on Curve448. - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(); - - const u2 = u.redSqr(); - const u3 = u2.redMul(u); - const u4 = u3.redMul(u); - const u5 = u4.redMul(u); - const v2 = v.redSqr(); - const a = v.redMuln(4); - const b = u2.redSub(this.one); - const c = u2.redMuln(2); - const d = v2.redMuln(4); - const e = u3.redIMuln(2); - const f = u.redMul(v2).redIMuln(4); - const g = u2.redMul(v2).redIMuln(2); - const h = v2.redIMuln(2); - const xx = a.redMul(b); - const xz = u4.redISub(c).redIAdd(d).redIAdd(this.one); - const yy = u5.redSub(e).redISub(f).redIAdd(u).redINeg(); - const yz = u5.redISub(g).redISub(e).redISub(h).redIAdd(u); - - return this.cpoint(xx, xz, yy, yz).divn(4); - } - - if (this.isIsomorphic(point.curve, true)) { - // Isomorphic maps for M(-A,-B)->E(a,d): - // - // x = +-sqrt((A - 2) / (B * a)) * u / v - // y = (u + 1) / (u - 1) - // - // Undefined for u = 1 or v = 0. - // - // Exceptional Cases: - // - O -> (0, 1) - // - (0, 0) -> (0, -1) - // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / d), oo) - // - // Unexceptional Cases: - // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / a), 0) - // - // The point (1, v) is invalid on Curve448. - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.one.redNeg()); - - const c = this._scale(point.curve, true); - const xx = c.redMul(u); - const xz = v; - const yy = u.redAdd(this.one); - const yz = u.redSub(this.one); - - return this.cpoint(xx, xz, yy, yz); - } - - if (this.isIsomorphic(point.curve, false)) { - // Isomorphic maps for M(A,B)->E(a,d): - // - // x = +-sqrt((A + 2) / (B * a)) * u / v - // y = (u - 1) / (u + 1) - // - // Undefined for u = -1 or v = 0. - // - // Exceptional Cases: - // - O -> (0, 1) - // - (0, 0) -> (0, -1) - // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / d), oo) - // - // Unexceptional Cases: - // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / a), 0) - // - // The point (-1, v) is invalid on Curve25519. - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.one.redNeg()); - - const c = this._scale(point.curve, false); - const xx = c.redMul(u); - const xz = v; - const yy = u.redSub(this.one); - const yz = u.redAdd(this.one); - - return this.cpoint(xx, xz, yy, yz); - } - - throw new Error('Not implemented.'); - } - - pointFromEdwards(point) { - // [TWISTED] Definition 2.1, Page 3, Section 2. - // [ISOGENY] Page 2, Section 2. - assert(point instanceof EdwardsPoint); - assert(point.curve.p.eq(this.p)); - - // Edwards `x`, `y`, `z`, `t`. - const a = this.field(point.curve.a); - const x = this.field(point.x); - const y = this.field(point.y); - const z = this.field(point.z); - const t = this.field(point.t); - - if (this.isIsogenous(point.curve)) { - // 4-isogeny maps for E(a,d)<->E(-a,d-a): - // - // x' = (2 * x * y) / (y^2 - a * x^2) - // y' = (y^2 + a * x^2) / (2 - y^2 - a * x^2) - // - // Undefined for y^2 - a * x^2 = 0 - // or y^2 + a * x^2 = 2. - const xy = x.redMul(y); - const x2 = x.redSqr(); - const y2 = y.redSqr(); - const z2 = z.redSqr(); - const ax2 = a.redMul(x2); - const xx = xy.redIMuln(2); - const xz = y2.redSub(ax2); - const yy = y2.redAdd(ax2); - const yz = z2.redIMuln(2).redISub(yy); - const p = this.cpoint(xx, xz, yy, yz); - - return !this.twisted ? p.divn(4) : p; - } - - if (this.isIsomorphic(point.curve)) { - // Isomorphic maps for E(a,d)<->E(a',a'd/a): - // - // x' = +-sqrt(a / a') * x - // y' = y - // - // Undefined when (a / a') is not square. - const c = this._scale(point.curve); - const nx = c.redMul(x); - const ny = y; - const nz = z; - const nt = c.redMul(t); - - return this.point(nx, ny, nz, nt); - } - - throw new Error('Not implemented.'); - } - - pointFromUniform(u, curve = null) { - assert(u instanceof BN); - assert(u.red === this.red); - assert(curve == null || (curve instanceof MontCurve)); - - if (!curve) - curve = this._alt(); - - const u0 = curve.field(u); - const p0 = curve.pointFromUniform(u0); - - return this.pointFromMont(p0); - } - - pointToUniform(p, hint, curve = null) { - // Convert an edwards point to a field - // element by inverting the elligator2 map. - // - // Hint Layout: - // - // [00000000] [0000] [0000] - // | | | - // | | +-- preimage index - // | +--- subgroup - // +-- bits to OR with uniform bytes - assert(p instanceof EdwardsPoint); - assert((hint >>> 0) === hint); - assert(curve == null || (curve instanceof MontCurve)); - - if (!curve) - curve = this._alt(); - - // Add a random torsion component. - const i = ((hint >> 4) & 15) % this.torsion.length; - const q = p.add(this.torsion[i]); - - // Convert and invert. - const p0 = curve.pointFromEdwards(q); - const u0 = curve.pointToUniform(p0, hint & 15); - - return this.field(u0); - } - - pointFromHash(bytes, pake, curve = null) { - assert(curve == null || (curve instanceof MontCurve)); - - if (!curve) - curve = this._alt(); - - const p0 = curve.pointFromHash(bytes, pake); - - return this.pointFromMont(p0); - } - - pointToHash(p, subgroup, rng, curve = null) { - assert(p instanceof EdwardsPoint); - assert((subgroup >>> 0) === subgroup); - assert(curve == null || (curve instanceof MontCurve)); - - if (!curve) - curve = this._alt(); - - // Add a random torsion component. - const i = subgroup % this.torsion.length; - const q = p.add(this.torsion[i]); - - // Convert and invert. - const p0 = curve.pointFromEdwards(q); - - return curve.pointToHash(p0, 0, rng); - } - - decodePoint(bytes) { - return EdwardsPoint.decode(this, bytes); - } - - toShort(a0, odd, sign = null) { - const [a, b] = this._short(a0, odd); - - const curve = new ShortCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = curve._scale(this); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromEdwards(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); - - return curve; - } - - toMont(b0, invert, sign = null) { - const [a, b] = this._mont(b0, invert); - - const curve = new MontCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h, - z: this.z - }); - - if (sign != null) { - const c = this._scale(curve, invert); - - if (c.redIsOdd() !== sign) - c.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromEdwards(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); - - return curve; - } - - toEdwards(a0, sign = null) { - const [a, d] = this._edwards(a0); - - const curve = new EdwardsCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - d: d, - n: this.n, - h: this.h, - z: this.z - }); - - if (sign != null) { - const c = curve._scale(this); - - if (c.redIsOdd() !== sign) - c.redINeg(); - } - - if (!this.g.isInfinity()) { - curve.g = curve.pointFromEdwards(this.g); - curve.g.normalize(); - } - - if (curve.isComplete()) { - for (let i = 0; i < this.h.word(0); i++) { - curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); - curve.torsion[i].normalize(); - } - } - - return curve; - } - - pointFromJSON(json) { - return EdwardsPoint.fromJSON(this, json); - } - - toJSON(pre) { - const json = super.toJSON(pre); - - json.a = this.a.fromRed().toJSON(); - json.d = this.d.fromRed().toJSON(); - - if (!this.s.isZero()) - json.s = this.s.fromRed().toJSON(); - - return json; - } - } - - /** - * EdwardsPoint - */ - - class EdwardsPoint extends Point { - constructor(curve, x, y, z, t) { - assert(curve instanceof EdwardsCurve); - - super(curve, types.EXTENDED); - - this.x = this.curve.zero; - this.y = this.curve.one; - this.z = this.curve.one; - this.t = this.curve.zero; - this.zOne = true; - - if (x != null) - this._init(x, y, z, t); - } - - _init(x, y, z, t) { - assert(x instanceof BN); - assert(y instanceof BN); - assert(z == null || (z instanceof BN)); - assert(t == null || (t instanceof BN)); - - this.x = x; - this.y = y; - this.z = z || this.curve.one; - this.t = t || null; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - - if (this.t && !this.t.red) - this.t = this.t.toRed(this.curve.red); - - this.zOne = this.z.eq(this.curve.one); - - this._check(); - - if (!this.t) { - this.t = this.x.redMul(this.y); - if (!this.zOne) - this.t = this.t.redDiv(this.z); - } - } - - _check() { - // In order to achieve complete - // addition formulas, `a` must - // be a square (always the case - // for a=1), and `d` must be a - // non-square. - // - // If this is not the case, the - // addition formulas may have - // exceptional cases where Z3=0. - // - // In particular, this can occur - // when: Q*h = -P*h and Q != -P. - // - // This is assuming 4-torsion is - // involved (the 4-torsion point - // is _not_ representable when - // `d` is square). - if (this.z.isZero()) - throw new Error('Invalid point.'); - } - - clone() { - return this.curve.point(this.x, this.y, this.z, this.t); - } - - normalize() { - // https://hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#scaling-z - // 1I + 2M (+ 1M if extended) - - // Z1 = 1 - if (this.zOne) - return this; - - // A = 1 / Z1 - const a = this.z.redInvert(); - - // X3 = X1 * A - this.x = this.x.redMul(a); - - // Y3 = Y1 * A - this.y = this.y.redMul(a); - - // T3 = T1 * A - this.t = this.t.redMul(a); - - // Z3 = 1 - this.z = this.curve.one; - this.zOne = true; - - return this; - } - - scale(a) { - assert(a instanceof BN); - - // X3 = X1 * A - const nx = this.x.redMul(a); - - // Y3 = Y1 * A - const ny = this.y.redMul(a); - - // Z3 = Z1 * A - const nz = this.z.redMul(a); - - // T3 = T1 * A - const nt = this.t.redMul(a); - - return this.curve.point(nx, ny, nz, nt); - } - - neg() { - // -(X1, Y1, Z1, T1) = (-X1, Y1, Z1, -T1) - const nx = this.x.redNeg(); - const ny = this.y; - const nz = this.z; - const nt = this.t.redNeg(); - - return this.curve.point(nx, ny, nz, nt); - } - - add(p) { - assert(p instanceof EdwardsPoint); - - // P = O - if (this.isInfinity()) - return p; - - // Q = O - if (p.isInfinity()) - return this; - - // Z1 = 1 - if (this.zOne) - return p._add(this); - - return this._add(p); - } - - _add(p) { - // a = -1 - if (this.curve.mOneA) - return this._addM1(p); - - return this._addA(p); - } - - _addM1(p) { - // Assumes a = -1. - // - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-3 - // 8M + 8A + 1*k + 1*2 - // - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-madd-2008-hwcd-3 - // 7M + 8A + 1*k + 1*2 - - // A = (Y1 - X1) * (Y2 - X2) - const a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); - - // B = (Y1 + X1) * (Y2 + X2) - const b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); - - // C = T1 * k * T2 - const c = this.t.redMul(this.curve.k).redMul(p.t); - - // D = Z1 * 2 * Z2 - const d = p.zOne ? this.z.redAdd(this.z) : this.z.redMul(p.z).redIMuln(2); - - // E = B - A - const e = b.redSub(a); - - // F = D - C - const f = d.redSub(c); - - // G = D + C - const g = d.redIAdd(c); - - // H = B + A - const h = b.redIAdd(a); - - // X3 = E * F - const nx = e.redMul(f); - - // Y3 = G * H - const ny = g.redMul(h); - - // T3 = E * H - const nt = e.redMul(h); - - // Z3 = F * G - const nz = f.redMul(g); - - return this.curve.point(nx, ny, nz, nt); - } - - _addA(p) { - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // 9M + 7A + 1*a + 1*d - // - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-madd-2008-hwcd - // 8M + 7A + 1*a + 1*d - - // A = X1 * X2 - const a = this.x.redMul(p.x); - - // B = Y1 * Y2 - const b = this.y.redMul(p.y); - - // C = T1 * d * T2 - const c = this.curve._mulD(this.t).redMul(p.t); - - // D = Z1 * Z2 - const d = p.zOne ? this.z.clone() : this.z.redMul(p.z); - - // + XYXY = (X1 + Y1) * (X2 + Y2) - const xyxy = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)); - - // E = (X1 + Y1) * (X2 + Y2) - A - B - const e = xyxy.redISub(a).redISub(b); - - // F = D - C - const f = d.redSub(c); - - // G = D + C - const g = d.redIAdd(c); - - // H = B - a * A - const h = b.redISub(this.curve._mulA(a)); - - // X3 = E * F - const nx = e.redMul(f); - - // Y3 = G * H - const ny = g.redMul(h); - - // T3 = E * H - const nt = e.redMul(h); - - // Z3 = F * G - const nz = f.redMul(g); - - return this.curve.point(nx, ny, nz, nt); - } - - dbl() { - // P = O - if (this.isInfinity()) - return this; - - return this._dbl(); - } - - _dbl() { - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // 4M + 4S + 6A + 1*a + 1*2 - // - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-mdbl-2008-hwcd - // 3M + 4S + 7A + 1*a + 1*2 - - // A = X1^2 - const a = this.x.redSqr(); - - // B = Y1^2 - const b = this.y.redSqr(); - - // C = 2 * Z1^2 - const c = this.zOne ? this.curve.two : this.z.redSqr().redIMuln(2); - - // D = a * A - const d = this.curve._mulA(a); - - // E = (X1 + Y1)^2 - A - B - const e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); - - // G = D + B - const g = d.redAdd(b); - - // F = G - C - const f = g.redSub(c); - - // H = D - B - const h = d.redISub(b); - - // X3 = E * F - const nx = e.redMul(f); - - // Y3 = G * H - const ny = g.redMul(h); - - // T3 = E * H - const nt = e.redMul(h); - - // Z3 = F * G - const nz = f.redMul(g); - - return this.curve.point(nx, ny, nz, nt); - } - - getX() { - this.normalize(); - return this.x.fromRed(); - } - - getY() { - this.normalize(); - return this.y.fromRed(); - } - - eq(p) { - assert(p instanceof EdwardsPoint); - assert(!this.z.isZero()); - assert(!p.z.isZero()); - - // P = Q - if (this === p) - return true; - - // Z1 = Z2 - if (this.z.eq(p.z)) { - return this.x.eq(p.x) - && this.y.eq(p.y); - } - - // X1 * Z2 = X2 * Z1 - const x1 = this.x.redMul(p.z); - const x2 = p.x.redMul(this.z); - - if (!x1.eq(x2)) - return false; - - const y1 = this.y.redMul(p.z); - const y2 = p.y.redMul(this.z); - - return y1.eq(y2); - } - - cmp(point) { - assert(point instanceof EdwardsPoint); - - return this.order().cmp(point.order()) - || this.getY().cmp(point.getY()) - || this.getX().cmp(point.getX()); - } - - isInfinity() { - assert(!this.z.isZero()); - - // X1 = 0 - if (!this.x.isZero()) - return false; - - // Y1 = Z1 - return this.y.eq(this.z); - } - - isOrder2() { - if (this.isInfinity()) - return false; - - return this.x.isZero(); - } - - isOdd() { - this.normalize(); - return this.x.redIsOdd(); - } - - isEven() { - this.normalize(); - return this.x.redIsEven(); - } - - toP() { - return this.normalize(); - } - - toJ() { - return this; - } - - encode() { - // [RFC8032] Section 5.1.2. - const y = this.getY(); - - // Note: `x` normalized from `getY()` call. - y.setn(this.curve.signBit, this.x.redIsOdd()); - - return this.curve.encodeAdjusted(y); - } - - static decode(curve, bytes) { - // [RFC8032] Section 5.1.3. - assert(curve instanceof EdwardsCurve); - - const y = curve.decodeAdjusted(bytes); - const sign = y.testn(curve.signBit) !== 0; - - y.setn(curve.signBit, 0); - - if (y.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - return curve.pointFromY(y, sign); - } - - toJSON(pre) { - if (this.isInfinity()) - return []; - - const x = this.getX().toJSON(); - const y = this.getY().toJSON(); - - if (pre === true && this.pre) - return [x, y, this.pre.toJSON()]; - - return [x, y]; - } - - toPretty() { - const size = this.curve.fieldSize * 2; - const x = toPretty(this.getX(), size); - const y = toPretty(this.getY(), size); - - return [x, y]; - } - - static fromJSON(curve, json) { - assert(curve instanceof EdwardsCurve); - assert(Array.isArray(json)); - assert(json.length === 0 - || json.length === 2 - || json.length === 3); - - if (json.length === 0) - return curve.point(); - - const x = BN.fromJSON(json[0]); - const y = BN.fromJSON(json[1]); - const point = curve.point(x, y); - - if (json.length > 2 && json[2] != null) - point.pre = Precomp.fromJSON(point, json[2]); - - return point; - } - - [custom]() { - if (this.isInfinity()) - return ''; - - return ''; - } - } - - /** - * Precomp - */ - - class Precomp { - constructor() { - this.naf = null; - this.windows = null; - this.doubles = null; - this.blinding = null; - this.beta = null; - } - - map(func) { - assert(typeof func === 'function'); - - const out = new this.constructor(); - - if (this.naf) - out.naf = this.naf.map(func); - - if (this.doubles) - out.doubles = this.doubles.map(func); - - return out; - } - - toJSON() { - return { - naf: this.naf ? this.naf.toJSON() : null, - windows: this.windows ? this.windows.toJSON() : null, - doubles: this.doubles ? this.doubles.toJSON() : null, - blinding: this.blinding ? this.blinding.toJSON() : undefined - }; - } - - fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - - if (json.naf != null) - this.naf = NAF.fromJSON(point, json.naf); - - if (json.windows != null) - this.windows = Windows.fromJSON(point, json.windows); - - if (json.doubles != null) - this.doubles = Doubles.fromJSON(point, json.doubles); - - if (json.blinding != null) - this.blinding = Blinding.fromJSON(point, json.blinding); - - return this; - } - - static fromJSON(point, json) { - return new this().fromJSON(point, json); - } - } - - /** - * NAF - */ - - class NAF { - constructor(width, points) { - this.width = width; - this.points = points; - } - - map(func) { - assert(typeof func === 'function'); - - const {width} = this; - const points = []; - - for (const point of this.points) - points.push(func(point)); - - return new this.constructor(width, points); - } - - toJSON() { - return { - width: this.width, - points: this.points.slice(1).map((point) => { - return point.toJSON(); - }) - }; - } - - static fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - assert((json.width >>> 0) === json.width); - assert(Array.isArray(json.points)); - - const {curve} = point; - const {width} = json; - const points = [point]; - - for (const item of json.points) - points.push(curve.pointFromJSON(item)); - - return new this(width, points); - } - } - - /** - * Windows - */ - - class Windows { - constructor(width, bits, points) { - this.width = width; - this.bits = bits; - this.points = points; - } - - toJSON() { - return { - width: this.width, - bits: this.bits, - points: this.points.slice(1).map((point) => { - return point.toJSON(); - }) - }; - } - - static fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - assert((json.width >>> 0) === json.width); - assert((json.bits >>> 0) === json.bits); - assert(Array.isArray(json.points)); - - const {curve} = point; - const {width, bits} = json; - const points = [point]; - - for (const item of json.points) - points.push(curve.pointFromJSON(item)); - - return new this(width, bits, points); - } - } - - /** - * Doubles - */ - - class Doubles { - constructor(step, points) { - this.step = step; - this.points = points; - } - - map(func) { - assert(typeof func === 'function'); - - const {step} = this; - const points = []; - - for (const point of this.points) - points.push(func(point)); - - return new this.constructor(step, points); - } - - toJSON() { - return { - step: this.step, - points: this.points.slice(1).map((point) => { - return point.toJSON(); - }) - }; - } - - static fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - assert((json.step >>> 0) === json.step); - assert(Array.isArray(json.points)); - - const {curve} = point; - const {step} = json; - const points = [point]; - - for (const item of json.points) - points.push(curve.pointFromJSON(item)); - - return new this(step, points); - } - } - - /** - * Blinding - */ - - class Blinding { - constructor(blind, unblind) { - this.blind = blind; - this.unblind = unblind; - } - - toJSON() { - return { - blind: this.blind.toJSON(), - unblind: this.unblind.toJSON() - }; - } - - static fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - - const {curve} = point; - const blind = BN.fromJSON(json.blind); - const unblind = curve.pointFromJSON(json.unblind); - - return new this(blind, unblind); - } - } - - /** - * Endo - */ - - class Endo { - constructor(beta, lambda, basis, pre) { - this.beta = beta; - this.lambda = lambda; - this.basis = basis; - this.pre = pre; - } - - toJSON() { - return { - beta: this.beta.fromRed().toJSON(), - lambda: this.lambda.toJSON(), - basis: [ - this.basis[0].toJSON(), - this.basis[1].toJSON() - ], - pre: [ - this.pre[0], - this.pre[1].toJSON(), - this.pre[2].toJSON() - ] - }; - } - - static fromJSON(curve, json) { - assert(curve instanceof Curve); - assert(json && typeof json === 'object'); - assert(Array.isArray(json.basis)); - assert(Array.isArray(json.pre)); - assert(json.basis.length === 2); - assert(json.pre.length === 3); - assert((json.pre[0] >>> 0) === json.pre[0]); - - const beta = BN.fromJSON(json.beta).toRed(curve.red); - const lambda = BN.fromJSON(json.lambda); - - const basis = [ - Vector.fromJSON(json.basis[0]), - Vector.fromJSON(json.basis[1]) - ]; - - const pre = [ - json.pre[0], - BN.fromJSON(json.pre[1]), - BN.fromJSON(json.pre[2]) - ]; - - return new this(beta, lambda, basis, pre); - } - } - - /** - * Vector - */ - - class Vector { - constructor(a, b) { - this.a = a; - this.b = b; - } - - toJSON() { - return { - a: this.a.toJSON(), - b: this.b.toJSON() - }; - } - - static fromJSON(json) { - assert(json && typeof json === 'object'); - - const a = BN.fromJSON(json.a); - const b = BN.fromJSON(json.b); - - return new this(a, b); - } - } - - /** - * P192 - * https://tinyurl.com/fips-186-2 (page 29) - * https://tinyurl.com/fips-186-3 (page 88) - */ - - class P192 extends ShortCurve { - constructor(pre) { - super({ - id: 'P192', - ossl: 'prime192v1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: 'p192', - // 2^192 - 2^64 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff fffffffe', - 'ffffffff ffffffff'], - // -3 mod p - a: ['ffffffff ffffffff ffffffff fffffffe', - 'ffffffff fffffffc'], - b: ['64210519 e59c80e7 0fa7e9ab 72243049', - 'feb8deec c146b9b1'], - n: ['ffffffff ffffffff ffffffff 99def836', - '146bc9b1 b4d22831'], - h: '1', - // Icart - z: '-5', - g: [ - ['188da80e b03090f6 7cbf20eb 43a18800', - 'f4ff0afd 82ff1012'], - ['07192b95 ffc8da78 631011ed 6b24cdd5', - '73f977a1 1e794811'], - pre - ] - }); - } - } - - /** - * P224 - * https://tinyurl.com/fips-186-2 (page 30) - * https://tinyurl.com/fips-186-3 (page 88) - */ - - class P224 extends ShortCurve { - constructor(pre) { - super({ - id: 'P224', - ossl: 'secp224r1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: 'p224', - // 2^224 - 2^96 + 1 (1 mod 16) - p: ['ffffffff ffffffff ffffffff ffffffff', - '00000000 00000000 00000001'], - // -3 mod p - a: ['ffffffff ffffffff ffffffff fffffffe', - 'ffffffff ffffffff fffffffe'], - b: ['b4050a85 0c04b3ab f5413256 5044b0b7', - 'd7bfd8ba 270b3943 2355ffb4'], - n: ['ffffffff ffffffff ffffffff ffff16a2', - 'e0b8f03e 13dd2945 5c5c2a3d'], - h: '1', - // SSWU - z: '1f', - g: [ - ['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3', - '56c21122 343280d6 115c1d21'], - ['bd376388 b5f723fb 4c22dfe6 cd4375a0', - '5a074764 44d58199 85007e34'], - pre - ] - }); - } - } - - /** - * P256 - * https://tinyurl.com/fips-186-2 (page 31) - * https://tinyurl.com/fips-186-3 (page 89) - */ - - class P256 extends ShortCurve { - constructor(pre) { - super({ - id: 'P256', - ossl: 'prime256v1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: null, - // 2^256 - 2^224 + 2^192 + 2^96 - 1 (= 3 mod 4) - p: ['ffffffff 00000001 00000000 00000000', - '00000000 ffffffff ffffffff ffffffff'], - // -3 mod p - a: ['ffffffff 00000001 00000000 00000000', - '00000000 ffffffff ffffffff fffffffc'], - b: ['5ac635d8 aa3a93e7 b3ebbd55 769886bc', - '651d06b0 cc53b0f6 3bce3c3e 27d2604b'], - n: ['ffffffff 00000000 ffffffff ffffffff', - 'bce6faad a7179e84 f3b9cac2 fc632551'], - h: '1', - // SSWU - z: '-a', - g: [ - ['6b17d1f2 e12c4247 f8bce6e5 63a440f2', - '77037d81 2deb33a0 f4a13945 d898c296'], - ['4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16', - '2bce3357 6b315ece cbb64068 37bf51f5'], - pre - ] - }); - } - } - - /** - * P384 - * https://tinyurl.com/fips-186-2 (page 32) - * https://tinyurl.com/fips-186-3 (page 89) - */ - - class P384 extends ShortCurve { - constructor(pre) { - super({ - id: 'P384', - ossl: 'secp384r1', - type: 'short', - endian: 'be', - hash: 'SHA384', - prime: null, - // 2^384 - 2^128 - 2^96 + 2^32 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff fffffffe', - 'ffffffff 00000000 00000000 ffffffff'], - // -3 mod p - a: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff fffffffe', - 'ffffffff 00000000 00000000 fffffffc'], - b: ['b3312fa7 e23ee7e4 988e056b e3f82d19', - '181d9c6e fe814112 0314088f 5013875a', - 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'], - n: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff c7634d81 f4372ddf', - '581a0db2 48b0a77a ecec196a ccc52973'], - h: '1', - // Icart - z: '-c', - g: [ - ['aa87ca22 be8b0537 8eb1c71e f320ad74', - '6e1d3b62 8ba79b98 59f741e0 82542a38', - '5502f25d bf55296c 3a545e38 72760ab7'], - ['3617de4a 96262c6f 5d9e98bf 9292dc29', - 'f8f41dbd 289a147c e9da3113 b5f0b8c0', - '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'], - pre - ] - }); - } - } - - /** - * P521 - * https://tinyurl.com/fips-186-2 (page 33) - * https://tinyurl.com/fips-186-3 (page 90) - */ - - class P521 extends ShortCurve { - constructor(pre) { - super({ - id: 'P521', - ossl: 'secp521r1', - type: 'short', - endian: 'be', - hash: 'SHA512', - prime: 'p521', - // 2^521 - 1 (= 3 mod 4) - p: ['000001ff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff'], - // -3 mod p - a: ['000001ff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'fffffffc'], - b: ['00000051 953eb961 8e1c9a1f 929a21a0', - 'b68540ee a2da725b 99b315f3 b8b48991', - '8ef109e1 56193951 ec7e937b 1652c0bd', - '3bb1bf07 3573df88 3d2c34f1 ef451fd4', - '6b503f00'], - n: ['000001ff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'fffffffa 51868783 bf2f966b 7fcc0148', - 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e', - '91386409'], - h: '1', - // SSWU - z: '-4', - g: [ - ['000000c6 858e06b7 0404e9cd 9e3ecb66', - '2395b442 9c648139 053fb521 f828af60', - '6b4d3dba a14b5e77 efe75928 fe1dc127', - 'a2ffa8de 3348b3c1 856a429b f97e7e31', - 'c2e5bd66'], - ['00000118 39296a78 9a3bc004 5c8a5fb4', - '2c7d1bd9 98f54449 579b4468 17afbd17', - '273e662c 97ee7299 5ef42640 c550b901', - '3fad0761 353c7086 a272c240 88be9476', - '9fd16650'], - pre - ] - }); - } - } - - /** - * SECP256K1 - * https://www.secg.org/SEC2-Ver-1.0.pdf (page 15, section 2.7.1) - * https://www.secg.org/sec2-v2.pdf (page 9, section 2.4.1) - */ - - class SECP256K1 extends ShortCurve { - constructor(pre) { - super({ - id: 'SECP256K1', - ossl: 'secp256k1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: 'k256', - // 2^256 - 2^32 - 977 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe fffffc2f'], - a: '0', - b: '7', - n: ['ffffffff ffffffff ffffffff fffffffe', - 'baaedce6 af48a03b bfd25e8c d0364141'], - h: '1', - // SVDW - z: '1', - // sqrt(-3) - c: ['0a2d2ba9 3507f1df 233770c2 a797962c', - 'c61f6d15 da14ecd4 7d8d27ae 1cd5f852'], - g: [ - ['79be667e f9dcbbac 55a06295 ce870b07', - '029bfcdb 2dce28d9 59f2815b 16f81798'], - ['483ada77 26a3c465 5da4fbfc 0e1108a8', - 'fd17b448 a6855419 9c47d08f fb10d4b8'], - pre - ], - // Precomputed endomorphism. - endo: { - beta: ['7ae96a2b 657c0710 6e64479e ac3434e9', - '9cf04975 12f58995 c1396c28 719501ee'], - lambda: ['5363ad4c c05c30e0 a5261c02 8812645a', - '122e22ea 20816678 df02967c 1b23bd72'], - basis: [ - { - a: '3086d221a7d46bcde86c90e49284eb15', - b: '-e4437ed6010e88286f547fa90abfe4c3' - }, - { - a: '114ca50f7a8e2f3f657c1108d9d44cfd8', - b: '3086d221a7d46bcde86c90e49284eb15' - } - ], - pre: [ - 384, - ['3086d221 a7d46bcd e86c90e4 9284eb15', - '3daa8a14 71e8ca7f e893209a 45dbb031'], - ['-', - 'e4437ed6 010e8828 6f547fa9 0abfe4c4', - '221208ac 9df506c6 1571b4ae 8ac47f71'] - ] - } - }); - } - } - - /** - * BRAINPOOLP256 - * https://tools.ietf.org/html/rfc5639#section-3.4 - */ - - class BRAINPOOLP256 extends ShortCurve { - constructor(pre) { - super({ - id: 'BRAINPOOLP256', - ossl: 'brainpoolP256r1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: null, - // (= 3 mod 4) - p: ['a9fb57db a1eea9bc 3e660a90 9d838d72', - '6e3bf623 d5262028 2013481d 1f6e5377'], - a: ['7d5a0975 fc2c3057 eef67530 417affe7', - 'fb8055c1 26dc5c6c e94a4b44 f330b5d9'], - b: ['26dc5c6c e94a4b44 f330b5d9 bbd77cbf', - '95841629 5cf7e1ce 6bccdc18 ff8c07b6'], - n: ['a9fb57db a1eea9bc 3e660a90 9d838d71', - '8c397aa3 b561a6f7 901e0e82 974856a7'], - h: '1', - // Icart - z: '-2', - g: [ - ['8bd2aeb9 cb7e57cb 2c4b482f fc81b7af', - 'b9de27e1 e3bd23c2 3a4453bd 9ace3262'], - ['547ef835 c3dac4fd 97f8461a 14611dc9', - 'c2774513 2ded8e54 5c1d54c7 2f046997'], - pre - ] - }); - } - } - - /** - * BRAINPOOLP384 - * https://tools.ietf.org/html/rfc5639#section-3.6 - */ - - class BRAINPOOLP384 extends ShortCurve { - constructor(pre) { - super({ - id: 'BRAINPOOLP384', - ossl: 'brainpoolP384r1', - type: 'short', - endian: 'be', - hash: 'SHA384', - prime: null, - // (= 3 mod 4) - p: ['8cb91e82 a3386d28 0f5d6f7e 50e641df', - '152f7109 ed5456b4 12b1da19 7fb71123', - 'acd3a729 901d1a71 87470013 3107ec53'], - a: ['7bc382c6 3d8c150c 3c72080a ce05afa0', - 'c2bea28e 4fb22787 139165ef ba91f90f', - '8aa5814a 503ad4eb 04a8c7dd 22ce2826'], - b: ['04a8c7dd 22ce2826 8b39b554 16f0447c', - '2fb77de1 07dcd2a6 2e880ea5 3eeb62d5', - '7cb43902 95dbc994 3ab78696 fa504c11'], - n: ['8cb91e82 a3386d28 0f5d6f7e 50e641df', - '152f7109 ed5456b3 1f166e6c ac0425a7', - 'cf3ab6af 6b7fc310 3b883202 e9046565'], - h: '1', - // SSWU - z: '-5', - g: [ - ['1d1c64f0 68cf45ff a2a63a81 b7c13f6b', - '8847a3e7 7ef14fe3 db7fcafe 0cbd10e8', - 'e826e034 36d646aa ef87b2e2 47d4af1e'], - ['8abe1d75 20f9c2a4 5cb1eb8e 95cfd552', - '62b70b29 feec5864 e19c054f f9912928', - '0e464621 77918111 42820341 263c5315'], - pre - ] - }); - } - } - - /** - * BRAINPOOLP512 - * https://tools.ietf.org/html/rfc5639#section-3.7 - */ - - class BRAINPOOLP512 extends ShortCurve { - constructor(pre) { - super({ - id: 'BRAINPOOLP512', - ossl: 'brainpoolP512r1', - type: 'short', - endian: 'be', - hash: 'SHA512', - prime: null, - // (= 3 mod 4) - p: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07', - 'cb308db3 b3c9d20e d6639cca 70330871', - '7d4d9b00 9bc66842 aecda12a e6a380e6', - '2881ff2f 2d82c685 28aa6056 583a48f3'], - a: ['7830a331 8b603b89 e2327145 ac234cc5', - '94cbdd8d 3df91610 a83441ca ea9863bc', - '2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5', - '7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca'], - b: ['3df91610 a83441ca ea9863bc 2ded5d5a', - 'a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7', - '2bf2c7b9 e7c1ac4d 77fc94ca dc083e67', - '984050b7 5ebae5dd 2809bd63 8016f723'], - n: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07', - 'cb308db3 b3c9d20e d6639cca 70330870', - '553e5c41 4ca92619 41866119 7fac1047', - '1db1d381 085ddadd b5879682 9ca90069'], - h: '1', - // Icart - z: '7', - g: [ - ['81aee4bd d82ed964 5a21322e 9c4c6a93', - '85ed9f70 b5d916c1 b43b62ee f4d0098e', - 'ff3b1f78 e2d0d48d 50d1687b 93b97d5f', - '7c6d5047 406a5e68 8b352209 bcb9f822'], - ['7dde385d 566332ec c0eabfa9 cf7822fd', - 'f209f700 24a57b1a a000c55b 881f8111', - 'b2dcde49 4a5f485e 5bca4bd8 8a2763ae', - 'd1ca2b2f a8f05406 78cd1e0f 3ad80892'], - pre - ] - }); - } - } - - /** - * X25519 - * https://tools.ietf.org/html/rfc7748#section-4.1 - */ - - class X25519 extends MontCurve { - constructor() { - super({ - id: 'X25519', - ossl: 'X25519', - type: 'mont', - endian: 'le', - hash: 'SHA512', - prime: 'p25519', - // 2^255 - 19 (= 5 mod 8) - p: ['7fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffed'], - // 486662 - a: '76d06', - b: '1', - n: ['10000000 00000000 00000000 00000000', - '14def9de a2f79cd6 5812631a 5cf5d3ed'], - h: '8', - // Elligator 2 - z: '2', - g: [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000009'], - // See: https://www.rfc-editor.org/errata/eid4730 - ['5f51e65e 475f794b 1fe122d3 88b72eb3', - '6dc2b281 92839e4d d6163a5d 81312c14'] - ], - torsion: [ - [], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000001'], - ['6be4f497 f9a9c2af c21fa77a d7f4a6ef', - '635a11c7 284a9363 e9a248ef 9c884415'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000001'], - ['141b0b68 06563d50 3de05885 280b5910', - '9ca5ee38 d7b56c9c 165db710 6377bbd8'] - ], - [ - ['57119fd0 dd4e22d8 868e1c58 c45c4404', - '5bef839c 55b1d0b1 248c50a3 bc959c5f'], - ['68c59389 3d458e64 31c6ca00 45fb5015', - '20a44346 8eaa68dd 0f103842 048065b7'] - ], - [ - ['57119fd0 dd4e22d8 868e1c58 c45c4404', - '5bef839c 55b1d0b1 248c50a3 bc959c5f'], - ['173a6c76 c2ba719b ce3935ff ba04afea', - 'df5bbcb9 71559722 f0efc7bd fb7f9a36'] - ], - [ - ['00b8495f 16056286 fdb1329c eb8d09da', - '6ac49ff1 fae35616 aeb8413b 7c7aebe0'], - ['3931c129 569e83a5 29482c14 e628b457', - '933bfc29 ed801b4d 68871483 92507b1a'] - ], - [ - ['00b8495f 16056286 fdb1329c eb8d09da', - '6ac49ff1 fae35616 aeb8413b 7c7aebe0'], - ['46ce3ed6 a9617c5a d6b7d3eb 19d74ba8', - '6cc403d6 127fe4b2 9778eb7c 6daf84d3'] - ] - ] - }); - } - } - - /** - * X448 - * https://tools.ietf.org/html/rfc7748#section-4.2 - */ - - class X448 extends MontCurve { - constructor() { - super({ - id: 'X448', - ossl: 'X448', - type: 'mont', - endian: 'le', - hash: 'SHAKE256', - prime: 'p448', - // 2^448 - 2^224 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff'], - // 156326 - a: '262a6', - b: '1', - n: ['3fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 7cca23e9', - 'c44edb49 aed63690 216cc272 8dc58f55', - '2378c292 ab5844f3'], - h: '4', - // Elligator 2 - z: '-1', - g: [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000005'], - ['7d235d12 95f5b1f6 6c98ab6e 58326fce', - 'cbae5d34 f55545d0 60f75dc2 8df3f6ed', - 'b8027e23 46430d21 1312c4b1 50677af7', - '6fd7223d 457b5b1a'] - ], - torsion: [ - [], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['ba4d3a08 29b6112f 8812e51b a0bb2abe', - 'bc1cb08e b48e5569 36ba50fd d2e7d68a', - 'f8cb3216 0522425b 3f990812 abbe635a', - 'd37a21e1 7551b193'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['45b2c5f7 d649eed0 77ed1ae4 5f44d541', - '43e34f71 4b71aa96 c945af01 2d182975', - '0734cde9 faddbda4 c066f7ed 54419ca5', - '2c85de1e 8aae4e6c'] - ] - ] - }); - } - } - - /** - * MONT448 - * Isomorphic to Ed448-Goldilocks. - */ - - class MONT448 extends MontCurve { - constructor() { - super({ - id: 'MONT448', - ossl: null, - type: 'mont', - endian: 'le', - hash: 'SHAKE256', - prime: 'p448', - // 2^448 - 2^224 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff'], - // -78160 / -39082 mod p - a: ['b2cf97d2 d43459a9 31ed36b1 fc4e3cb5', - '5d93f8d2 22746997 60ccffc6 49961ed6', - 'c5b05fca c24864ed 6fb59697 931b78da', - '84ddecd8 ca2b5cfb'], - b: '1', - n: ['3fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 7cca23e9', - 'c44edb49 aed63690 216cc272 8dc58f55', - '2378c292 ab5844f3'], - h: '4', - // Elligator 2 - z: '-1', - g: [ - ['ac0d24cc c6c75cb0 eb71f81e 7a6edf51', - '48e88aee 009a2a24 e795687e c28e125a', - '3e6730a6 0d46367b aa7fe99d 152128dc', - '41321bc7 7817f059'], - ['5a4437f6 80c0d0db 9b061276 d5d0ffcc', - 'e786ff33 b6a53d30 98746425 82e66f09', - '4433dae7 7244a6e2 6b11e905 7228f483', - '556c41a5 913f55fe'] - ], - torsion: [ - [], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['bec92fd0 6da2acf2 b4e261e8 7cef0d34', - '22e75c18 3c589857 b71924e5 73c2f9ce', - 'e18da5f2 466e2f39 3c2eedf0 f105a60a', - 'b40c717d 4f1e1fd7'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['4136d02f 925d530d 4b1d9e17 8310f2cb', - 'dd18a3e7 c3a767a8 48e6db19 8c3d0631', - '1e725a0d b991d0c6 c3d1120f 0efa59f5', - '4bf38e82 b0e1e028'] - ] - ] - }); - } - } - - /** - * ED25519 - * https://tools.ietf.org/html/rfc8032#section-5.1 - */ - - class ED25519 extends EdwardsCurve { - constructor(pre) { - super({ - id: 'ED25519', - ossl: 'ED25519', - type: 'edwards', - endian: 'le', - hash: 'SHA512', - prefix: 'SigEd25519 no Ed25519 collisions', - context: false, - prime: 'p25519', - // 2^255 - 19 (= 5 mod 8) - p: ['7fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffed'], - a: '-1', - // -121665 / 121666 mod p - d: ['52036cee 2b6ffe73 8cc74079 7779e898', - '00700a4d 4141d8ab 75eb4dca 135978a3'], - n: ['10000000 00000000 00000000 00000000', - '14def9de a2f79cd6 5812631a 5cf5d3ed'], - h: '8', - // Elligator 2 - z: '2', - g: [ - ['216936d3 cd6e53fe c0a4e231 fdd6dc5c', - '692cc760 9525a7b2 c9562d60 8f25d51a'], - // 4/5 - ['66666666 66666666 66666666 66666666', - '66666666 66666666 66666666 66666658'], - pre - ], - torsion: [ - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000001'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'], - ['7fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffec'] - ], - [ - ['2b832480 4fc1df0b 2b4d0099 3dfbd7a7', - '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'] - ], - [ - ['547cdb7f b03e20f4 d4b2ff66 c2042858', - 'd0bce7f9 52d01b87 3b11e4d8 b5f15f3d'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'] - ], - [ - ['1fd5b9a0 06394a28 e9339932 38de4abb', - '5c193c70 13e5e238 dea14646 c545d14a'], - ['05fc536d 880238b1 3933c6d3 05acdfd5', - 'f098eff2 89f4c345 b027b2c2 8f95e826'] - ], - [ - ['602a465f f9c6b5d7 16cc66cd c721b544', - 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'], - ['05fc536d 880238b1 3933c6d3 05acdfd5', - 'f098eff2 89f4c345 b027b2c2 8f95e826'] - ], - [ - ['1fd5b9a0 06394a28 e9339932 38de4abb', - '5c193c70 13e5e238 dea14646 c545d14a'], - ['7a03ac92 77fdc74e c6cc392c fa53202a', - '0f67100d 760b3cba 4fd84d3d 706a17c7'] - ], - [ - ['602a465f f9c6b5d7 16cc66cd c721b544', - 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'], - ['7a03ac92 77fdc74e c6cc392c fa53202a', - '0f67100d 760b3cba 4fd84d3d 706a17c7'] - ] - ] - }); - } - } - - /** - * ISO448 - * https://tools.ietf.org/html/rfc7748#section-4.2 - * https://git.zx2c4.com/goldilocks/tree/_aux/ristretto/ristretto.sage#n658 - */ - - class ISO448 extends EdwardsCurve { - constructor(pre) { - super({ - id: 'ISO448', - ossl: null, - type: 'edwards', - endian: 'le', - hash: 'SHAKE256', - prefix: 'SigEd448', - context: true, - prime: 'p448', - // 2^448 - 2^224 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff'], - a: '1', - // 39082 / 39081 mod p - d: ['d78b4bdc 7f0daf19 f24f38c2 9373a2cc', - 'ad461572 42a50f37 809b1da3 412a12e7', - '9ccc9c81 264cfe9a d0809970 58fb61c4', - '243cc32d baa156b9'], - n: ['3fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 7cca23e9', - 'c44edb49 aed63690 216cc272 8dc58f55', - '2378c292 ab5844f3'], - h: '4', - // Elligator 2 - z: '-1', - g: [ - ['79a70b2b 70400553 ae7c9df4 16c792c6', - '1128751a c9296924 0c25a07d 728bdc93', - 'e21f7787 ed697224 9de732f3 8496cd11', - '69871309 3e9c04fc'], - // Note: the RFC has this wrong. - ['7fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 80000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'], - pre - ], - torsion: [ - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ] - ] - }); - } - } - - /** - * ED448 - * https://tools.ietf.org/html/rfc8032#section-5.2 - */ - - class ED448 extends EdwardsCurve { - constructor(pre) { - super({ - id: 'ED448', - ossl: 'ED448', - type: 'edwards', - endian: 'le', - hash: 'SHAKE256', - prefix: 'SigEd448', - context: true, - prime: 'p448', - // 2^448 - 2^224 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff'], - a: '1', - // -39081 mod p - d: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffff6756'], - n: ['3fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 7cca23e9', - 'c44edb49 aed63690 216cc272 8dc58f55', - '2378c292 ab5844f3'], - h: '4', - // Elligator 2 - z: '-1', - g: [ - ['4f1970c6 6bed0ded 221d15a6 22bf36da', - '9e146570 470f1767 ea6de324 a3d3a464', - '12ae1af7 2ab66511 433b80e1 8b00938e', - '2626a82b c70cc05e'], - ['693f4671 6eb6bc24 88762037 56c9c762', - '4bea7373 6ca39840 87789c1e 05a0c2d7', - '3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad', - '9808795b f230fa14'], - pre - ], - torsion: [ - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ] - ] - }); - } - } - - /* - * Curve Registry - */ - - const curves = { - __proto__: null, - P192, - P224, - P256, - P384, - P521, - SECP256K1, - BRAINPOOLP256, - BRAINPOOLP384, - BRAINPOOLP512, - X25519, - X448, - MONT448, - ED25519, - ISO448, - ED448 - }; - - const cache = { - __proto__: null, - P192: null, - P224: null, - P256: null, - P384: null, - P521: null, - SECP256K1: null, - BRAINPOOLP256: null, - BRAINPOOLP384: null, - BRAINPOOLP512: null, - X25519: null, - X448: null, - MONT448: null, - ED25519: null, - ISO448: null, - ED448: null - }; - - function curve(name, ...args) { - assert(typeof name === 'string'); - - const key = name.toUpperCase(); - - let curve = cache[key]; - - if (!curve) { - const Curve = curves[key]; - - if (!Curve) - throw new Error(`Curve not found: "${name}".`); - - curve = new Curve(...args); - cache[key] = curve; - } - - return curve; - } - - function register(name, Curve) { - assert(typeof name === 'string'); - assert(typeof Curve === 'function'); - - const key = name.toUpperCase(); - - if (curves[key]) - throw new Error(`Curve already registered: "${name}".`); - - curves[key] = Curve; - cache[key] = null; - } - - /* - * Scalar Recoding - */ - - function getNAF(k, width, max) { - // Computing the width-w NAF of a positive integer. - // - // [GECC] Algorithm 3.35, Page 100, Section 3.3. - // - // The above document describes a rather abstract - // method of recoding. The more optimal method - // below was ported from libsecp256k1. - assert(k instanceof BN); - assert(!k.red); - assert((width >>> 0) === width); - assert((max >>> 0) === max); - - const naf = new Array(max); - const bits = k.bitLength() + 1; - const sign = k.sign() | 1; - - assert(bits <= max); - - for (let i = 0; i < max; i++) - naf[i] = 0; - - let i = 0; - let carry = 0; - let word; - - while (i < bits) { - if (k.bit(i) === carry) { - i += 1; - continue; - } - - word = k.bits(i, width) + carry; - carry = (word >> (width - 1)) & 1; - word -= carry << width; - - naf[i] = sign * word; - - i += width; - } - - assert(carry === 0); - - return naf; - } - - function getFixedNAF(k, width, max, step) { - assert((step >>> 0) === step); - - // Recode to NAF. - const naf = getNAF(k, width, max); - - // Translate into more windowed form. - const len = Math.ceil(naf.length / step); - const repr = new Array(len); - - let i = 0; - - for (let j = 0; j < naf.length; j += step) { - let nafW = 0; - - for (let k = j + step - 1; k >= j; k--) - nafW = (nafW << 1) + naf[k]; - - repr[i++] = nafW; - } - - assert(i === len); - - return repr; - } - - function getJSF(k1, k2, max) { - // Joint sparse form. - // - // [GECC] Algorithm 3.50, Page 111, Section 3.3. - assert(k1 instanceof BN); - assert(k2 instanceof BN); - assert(!k1.red); - assert(!k2.red); - assert((max >>> 0) === max); - - const jsf = [new Array(max), new Array(max)]; - const bits = Math.max(k1.bitLength(), k2.bitLength()) + 1; - const s1 = k1.sign() | 1; - const s2 = k2.sign() | 1; - - assert(bits <= max); - - let d1 = 0; - let d2 = 0; - - for (let i = 0; i < bits; i++) { - const b1 = k1.bits(i, 3); - const b2 = k2.bits(i, 3); - - // First phase. - let m14 = ((b1 & 3) + d1) & 3; - let m24 = ((b2 & 3) + d2) & 3; - let u1 = 0; - let u2 = 0; - - if (m14 === 3) - m14 = -1; - - if (m24 === 3) - m24 = -1; - - if (m14 & 1) { - const m8 = ((b1 & 7) + d1) & 7; - - if ((m8 === 3 || m8 === 5) && m24 === 2) - u1 = -m14; - else - u1 = m14; - } - - if (m24 & 1) { - const m8 = ((b2 & 7) + d2) & 7; - - if ((m8 === 3 || m8 === 5) && m14 === 2) - u2 = -m24; - else - u2 = m24; - } - - jsf[0][i] = u1 * s1; - jsf[1][i] = u2 * s2; - - // Second phase. - if (2 * d1 === 1 + u1) - d1 = 1 - d1; - - if (2 * d2 === 1 + u2) - d2 = 1 - d2; - } - - for (let i = bits; i < max; i++) { - jsf[0][i] = 0; - jsf[1][i] = 0; - } - - return jsf; - } - - function getJNAF(c1, c2, max) { - const jsf = getJSF(c1, c2, max); - const naf = new Array(max); - - // JSF -> NAF conversion. - for (let i = 0; i < max; i++) { - const ja = jsf[0][i]; - const jb = jsf[1][i]; - - naf[i] = jsfIndex[(ja + 1) * 3 + (jb + 1)]; - } - - return naf; - } - - /* - * Helpers - */ - - function assert(val, msg) { - if (!val) { - const err = new Error(msg || 'Assertion failed'); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, assert); - - throw err; - } - } - - function wrapErrors(fn) { - assert(typeof fn === 'function'); - - try { - return fn(); - } catch (e) { - if (e.message === 'X is not a square mod P.' - || e.message === 'Not invertible.') { - throw new Error('Invalid point.'); - } - throw e; - } - } - - function mod(x, y) { - // Euclidean modulo. - let r = x % y; - - if (r < 0) { - r += y; - } - - return r; - } - - function cubeRoot(x) { - assert(x instanceof BN); - assert(x.red); - - const p = x.red.m; - - if (p.cmpn(3) <= 0) - return x.clone(); - - // p = 2 mod 3 - if (p.modrn(3) === 2) { - // e = (2 * p - 1) / 3 - const e = p.ushln(1).isubn(1).idivn(3); - return x.redPow(e); - } - - const mod9 = p.modrn(9); - - // p = 4 mod 9 - if (mod9 === 4) { - // e = (2 * p + 1) / 9 - const e = p.ushln(1).iaddn(1).idivn(9); - const r = x.redPow(e); - const c = r.redSqr().redMul(r); - - if (!c.eq(x)) - throw new Error('X is not a cube mod P.'); - - return r; - } - - // p = 7 mod 9 - if (mod9 === 7) { - // e = (p + 2) / 9 - const e = p.addn(2).idivn(9); - const r = x.redPow(e); - const c = r.redSqr().redMul(r); - - if (!c.eq(x)) - throw new Error('X is not a cube mod P.'); - - return r; - } - - throw new Error('Not implemented.'); - } - - function cubeRoots(x) { - const r0 = cubeRoot(x); - - // p = 1 mod 3 - if (x.red.m.modrn(3) === 1) { - // Multiply by roots of unity to find other roots. - const two = new BN(2).toRed(x.red); - const three = new BN(3).toRed(x.red); - const i2 = two.redInvert(); - const s1 = three.redNeg().redSqrt().redMul(i2); - const s2 = s1.redNeg(); - const u1 = s1.redSub(i2); - const u2 = s2.redSub(i2); - const r1 = r0.redMul(u1); - const r2 = r0.redMul(u2); - - return [r0, r1, r2]; - } - - // p = 2 mod 3 guarantees 1 cube root per element. - return [r0]; - } - - function uncube(x) { - // Find a cube root which is also a quadratic residue. - for (const root of cubeRoots(x)) { - if (root.redJacobi() >= 0) - return root; - } - - throw new Error('X^(1/3) is not a square mod P.'); - } - - function randomInt(rng) { - return BN.randomBits(rng, 32).toNumber(); - } - - function memoize(method, self) { - const cache = new WeakMap(); - - return function memoized(curve, invert) { - const i = invert & 1; - const item = cache.get(curve); - - if (item && item[i] !== null) - return item[i]; - - const result = method.call(self, curve, invert); - - if (!cache.has(curve)) - cache.set(curve, [null, null]); - - cache.get(curve)[i] = result; - - return result; - }; - } - - function toPretty(x, size) { - assert(x instanceof BN); - assert((size >>> 0) === size); - - if (size & 7) - size += 8 - (size & 7); - - const str = x.toString(16, size); - const chunks = []; - const out = []; - - assert((str.length & 7) === 0); - - for (let i = 0; i < str.length; i += 8) - chunks.push(str.slice(i, i + 8)); - - for (let i = 0; i < chunks.length; i += 4) - out.push(chunks.slice(i, i + 4).join(' ')); - - return out; - } - - /* - * Expose - */ - - elliptic.Curve = Curve; - elliptic.Point = Point; - elliptic.ShortCurve = ShortCurve; - elliptic.ShortPoint = ShortPoint; - elliptic.JPoint = JPoint; - elliptic.MontCurve = MontCurve; - elliptic.MontPoint = MontPoint; - elliptic.XPoint = XPoint; - elliptic.EdwardsCurve = EdwardsCurve; - elliptic.EdwardsPoint = EdwardsPoint; - elliptic.curves = curves; - elliptic.curve = curve; - elliptic.register = register; - return elliptic; -} - -var random = {}; - -var hasRequiredRandom; - -function requireRandom () { - if (hasRequiredRandom) return random; - hasRequiredRandom = 1; - - const assert = requireAssert(); - - /* - * Constants - */ - - const crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto; - const HAS_CRYPTO = crypto && typeof crypto.getRandomValues === 'function'; - const randomValues = HAS_CRYPTO ? crypto.getRandomValues.bind(crypto) : null; - const pool = new Uint32Array(16); - const MAX_BYTES = 65536; - - let poolPos = 0; - - /** - * Generate pseudo-random bytes. - * @param {Number} size - * @returns {Buffer} - */ - - function randomBytes(size) { - assert((size >>> 0) === size); - - const data = bufferExports.Buffer.alloc(size); - - randomFillSync(data, 0, size); - - return data; - } - - /** - * Generate pseudo-random bytes. - * @param {Buffer} data - * @param {Number} [off=0] - * @param {Number} [size=data.length-off] - * @returns {Buffer} - */ - - function randomFill(data, off, size) { - assert(bufferExports.Buffer.isBuffer(data)); - - if (off == null) - off = 0; - - assert((off >>> 0) === off); - - if (size == null) - size = data.length - off; - - assert((size >>> 0) === size); - assert(off + size <= data.length); - - randomFillSync(data, off, size); - - return data; - } - - /** - * Generate a random uint32. - * @returns {Number} - */ - - function randomInt() { - if ((poolPos & 15) === 0) { - getRandomValues(pool); - poolPos = 0; - } - - return pool[poolPos++]; - } - - /** - * Generate a random uint32 within a range. - * @param {Number} min - Inclusive. - * @param {Number} max - Exclusive. - * @returns {Number} - */ - - function randomRange(min, max) { - assert((min >>> 0) === min); - assert((max >>> 0) === max); - assert(max >= min); - - const space = max - min; - - if (space === 0) - return min; - - const top = -space >>> 0; - - let x, r; - - do { - x = randomInt(); - r = x % space; - } while (x - r > top); - - return r + min; - } - - /* - * Helpers - */ - - function getRandomValues(array) { - if (!HAS_CRYPTO) - throw new Error('Entropy source not available.'); - - return randomValues(array); - } - - function randomFillSync(data, off, size) { - assert(bufferExports.Buffer.isBuffer(data)); - assert(data.buffer instanceof ArrayBuffer); - assert((data.byteOffset >>> 0) === data.byteOffset); - assert((data.byteLength >>> 0) === data.byteLength); - assert((off >>> 0) === off); - assert((size >>> 0) === size); - assert(off + size <= data.byteLength); - - if (size > 2 ** 31 - 1) - throw new RangeError('The value "size" is out of range.'); - - const offset = data.byteOffset + off; - const array = new Uint8Array(data.buffer, offset, size); - - if (array.length > MAX_BYTES) { - for (let i = 0; i < array.length; i += MAX_BYTES) { - let j = i + MAX_BYTES; - - if (j > array.length) - j = array.length; - - getRandomValues(array.subarray(i, j)); - } - } else { - if (array.length > 0) - getRandomValues(array); - } - } - - /* - * Expose - */ - - random.native = 0; - random.randomBytes = randomBytes; - random.randomFill = randomFill; - random.randomInt = randomInt; - random.randomRange = randomRange; - return random; -} - -/*! - * random.js - random for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var randomBrowser; -var hasRequiredRandomBrowser; - -function requireRandomBrowser () { - if (hasRequiredRandomBrowser) return randomBrowser; - hasRequiredRandomBrowser = 1; - - randomBrowser = requireRandom(); - return randomBrowser; -} - -var eddsa; -var hasRequiredEddsa; - -function requireEddsa () { - if (hasRequiredEddsa) return eddsa; - hasRequiredEddsa = 1; - - const assert = requireAssert(); - const BatchRNG = requireBatchRng(); - const BN = requireBnBrowser(); - const elliptic = requireElliptic(); - const rng = requireRandomBrowser(); - - /* - * EDDSA - */ - - class EDDSA { - constructor(id, mid, eid, hash, pre) { - assert(typeof id === 'string'); - assert(!mid || typeof mid === 'string'); - assert(!eid || typeof eid === 'string'); - assert(hash); - - this.id = id; - this.type = 'eddsa'; - this.mid = mid || null; - this.eid = eid || null; - this.hash = hash; - this.native = 0; - - this._pre = pre || null; - this._curve = null; - this._mont = null; - this._iso = null; - this._rng = null; - } - - get curve() { - if (!this._curve) { - this._curve = elliptic.curve(this.id, this._pre); - this._curve.precompute(rng); - this._pre = null; - } - return this._curve; - } - - get mont() { - if (this.mid && !this._mont) - this._mont = elliptic.curve(this.mid); - return this._mont; - } - - get iso() { - if (!this.eid) - return this.mont; - - if (!this._iso) - this._iso = elliptic.curve(this.eid); - - return this._iso; - } - - get rng() { - if (!this._rng) - this._rng = new BatchRNG(this.curve); - - return this._rng; - } - - get size() { - return this.curve.adjustedSize; - } - - get bits() { - return this.curve.fieldBits; - } - - hashNonce(prefix, msg, ph, ctx) { - const hash = new Hash(this); - - hash.init(ph, ctx); - hash.update(prefix); - hash.update(msg); - - return hash.final(); - } - - hashChallenge(R, A, m, ph, ctx) { - const hash = new Hash(this); - - hash.init(ph, ctx); - hash.update(R); - hash.update(A); - hash.update(m); - - return hash.final(); - } - - privateKeyGenerate() { - return rng.randomBytes(this.curve.adjustedSize); - } - - scalarGenerate() { - const scalar = rng.randomBytes(this.curve.scalarSize); - return this.curve.clamp(scalar); - } - - privateKeyExpand(secret) { - assert(bufferExports.Buffer.isBuffer(secret)); - assert(secret.length === this.curve.adjustedSize); - - const hash = this.hash.digest(secret, this.curve.adjustedSize * 2); - - return this.curve.splitHash(hash); - } - - privateKeyConvert(secret) { - const [key] = this.privateKeyExpand(secret); - return key; - } - - privateKeyVerify(secret) { - assert(bufferExports.Buffer.isBuffer(secret)); - return secret.length === this.curve.adjustedSize; - } - - scalarVerify(scalar) { - assert(bufferExports.Buffer.isBuffer(scalar)); - return scalar.length === this.curve.scalarSize; - } - - scalarIsZero(scalar) { - assert(bufferExports.Buffer.isBuffer(scalar)); - - let k; - try { - k = this.curve.decodeScalar(scalar).imod(this.curve.n); - } catch (e) { - return false; - } - - return k.isZero(); - } - - scalarClamp(scalar) { - assert(bufferExports.Buffer.isBuffer(scalar)); - assert(scalar.length === this.curve.scalarSize); - - return this.curve.clamp(bufferExports.Buffer.from(scalar)); - } - - privateKeyExport(secret) { - const pub = this.publicKeyCreate(secret); - const {x, y} = this.publicKeyExport(pub); - - return { - d: bufferExports.Buffer.from(secret), - x, - y - }; - } - - privateKeyImport(json) { - assert(json && typeof json === 'object'); - assert(bufferExports.Buffer.isBuffer(json.d)); - - if (json.d.length !== this.curve.adjustedSize) - throw new Error('Invalid private key.'); - - return bufferExports.Buffer.from(json.d); - } - - scalarTweakAdd(scalar, tweak) { - const a = this.curve.decodeScalar(scalar); - const t = this.curve.decodeScalar(tweak); - const k = a.add(t).imod(this.curve.n); - - return this.curve.encodeScalar(k); - } - - scalarTweakMul(scalar, tweak) { - const a = this.curve.decodeScalar(scalar); - const t = this.curve.decodeScalar(tweak); - const k = a.mul(t).imod(this.curve.n); - - return this.curve.encodeScalar(k); - } - - scalarReduce(scalar) { - const a = this.curve.decodeScalar(scalar); - const k = a.imod(this.curve.n); - - return this.curve.encodeScalar(k); - } - - scalarNegate(scalar) { - const a = this.curve.decodeScalar(scalar).imod(this.curve.n); - const k = a.neg().imod(this.curve.n); - - return this.curve.encodeScalar(k); - } - - scalarInvert(scalar) { - const a = this.curve.decodeScalar(scalar).imod(this.curve.n); - - if (a.isZero()) - return this.curve.encodeScalar(a); - - const k = a.invert(this.curve.n); - - return this.curve.encodeScalar(k); - } - - publicKeyCreate(secret) { - const key = this.privateKeyConvert(secret); - return this.publicKeyFromScalar(key); - } - - publicKeyFromScalar(scalar) { - const a = this.curve.decodeScalar(scalar).imod(this.curve.n); - const A = this.curve.g.mulBlind(a); - - return A.encode(); - } - - publicKeyConvert(key) { - if (!this.mont) - throw new Error('No equivalent montgomery curve.'); - - const A = this.curve.decodePoint(key); - const P = this.mont.pointFromEdwards(A); - - return P.encode(); - } - - publicKeyFromUniform(bytes) { - const u = this.curve.decodeUniform(bytes); - const A = this.curve.pointFromUniform(u, this.iso); - - return A.encode(); - } - - publicKeyToUniform(key, hint = rng.randomInt()) { - const A = this.curve.decodePoint(key); - const u = this.curve.pointToUniform(A, hint, this.iso); - - return this.curve.encodeUniform(u, hint >>> 8); - } - - publicKeyFromHash(bytes, pake = false) { - const A = this.curve.pointFromHash(bytes, pake, this.iso); - return A.encode(); - } - - publicKeyToHash(key, subgroup = rng.randomInt()) { - const A = this.curve.decodePoint(key); - return this.curve.pointToHash(A, subgroup, rng, this.iso); - } - - publicKeyVerify(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - try { - this.curve.decodePoint(key); - } catch (e) { - return false; - } - - return true; - } - - publicKeyIsInfinity(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - let A; - try { - A = this.curve.decodePoint(key); - } catch (e) { - return false; - } - - return A.isInfinity(); - } - - publicKeyIsSmall(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - let A; - try { - A = this.curve.decodePoint(key); - } catch (e) { - return false; - } - - return A.isSmall(); - } - - publicKeyHasTorsion(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - let A; - try { - A = this.curve.decodePoint(key); - } catch (e) { - return false; - } - - return A.hasTorsion(); - } - - publicKeyExport(key) { - const {x, y} = this.curve.decodePoint(key); - - return { - x: this.curve.encodeField(x.fromRed()), - y: this.curve.encodeField(y.fromRed()) - }; - } - - publicKeyImport(json) { - assert(json && typeof json === 'object'); - - let x = null; - let y = null; - let A; - - if (json.x != null) { - x = BN.decode(json.x, this.curve.endian); - - if (x.cmp(this.curve.p) >= 0) - throw new Error('Invalid point.'); - } - - if (json.y != null) { - y = BN.decode(json.y, this.curve.endian); - - if (y.cmp(this.curve.p) >= 0) - throw new Error('Invalid point.'); - } - - if (x && y) { - A = this.curve.point(x, y); - - if (!A.validate()) - throw new Error('Invalid point.'); - } else if (x) { - A = this.curve.pointFromX(x, json.sign); - } else if (y) { - A = this.curve.pointFromY(y, json.sign); - } else { - throw new Error('Invalid point.'); - } - - return A.encode(); - } - - publicKeyTweakAdd(key, tweak) { - const t = this.curve.decodeScalar(tweak).imod(this.curve.n); - const A = this.curve.decodePoint(key); - const T = this.curve.g.mul(t); - const P = T.add(A); - - return P.encode(); - } - - publicKeyTweakMul(key, tweak) { - const t = this.curve.decodeScalar(tweak); - const A = this.curve.decodePoint(key); - const P = A.mul(t); - - return P.encode(); - } - - publicKeyCombine(keys) { - assert(Array.isArray(keys)); - - let P = this.curve.point(); - - for (const key of keys) { - const A = this.curve.decodePoint(key); - - P = P.add(A); - } - - return P.encode(); - } - - publicKeyNegate(key) { - const A = this.curve.decodePoint(key); - const P = A.neg(); - - return P.encode(); - } - - sign(msg, secret, ph, ctx) { - const [key, prefix] = this.privateKeyExpand(secret); - return this.signWithScalar(msg, key, prefix, ph, ctx); - } - - signWithScalar(msg, scalar, prefix, ph, ctx) { - // EdDSA Signing. - // - // [EDDSA] Page 12, Section 4. - // [RFC8032] Page 8, Section 3.3. - // - // Assumptions: - // - // - Let `H` be a cryptographic hash function. - // - Let `m` be a byte array of arbitrary size. - // - Let `a` be a secret scalar. - // - Let `w` be a secret byte array. - // - // Computation: - // - // k = H(w, m) mod n - // R = G * k - // A = G * a - // e = H(R, A, m) mod n - // s = (k + e * a) mod n - // S = (R, s) - // - // Note that `k` must remain secret, - // otherwise an attacker can compute: - // - // a = (s - k) / e mod n - // - // The same is true of `w` as `k` - // can be re-derived as `H(w, m)`. - if (ctx == null) - ctx = bufferExports.Buffer.alloc(0); - - assert(bufferExports.Buffer.isBuffer(msg)); - assert(bufferExports.Buffer.isBuffer(prefix)); - assert(prefix.length === this.curve.adjustedSize); - - const {n} = this.curve; - const G = this.curve.g; - const k = this.hashNonce(prefix, msg, ph, ctx); - const Rraw = G.mulBlind(k).encode(); - const a = this.curve.decodeScalar(scalar); - const Araw = G.mulBlind(a).encode(); - const e = this.hashChallenge(Rraw, Araw, msg, ph, ctx); - const s = k.add(e.mul(a)).imod(n); - - return bufferExports.Buffer.concat([Rraw, this.curve.encodeAdjusted(s)]); - } - - signTweakAdd(msg, secret, tweak, ph, ctx) { - const [key_, prefix_] = this.privateKeyExpand(secret); - const key = this.scalarTweakAdd(key_, tweak); - const expanded = this.hash.multi(prefix_, tweak, null, - this.curve.adjustedSize * 2); - const prefix = expanded.slice(0, this.curve.adjustedSize); - - return this.signWithScalar(msg, key, prefix, ph, ctx); - } - - signTweakMul(msg, secret, tweak, ph, ctx) { - const [key_, prefix_] = this.privateKeyExpand(secret); - const key = this.scalarTweakMul(key_, tweak); - const expanded = this.hash.multi(prefix_, tweak, null, - this.curve.adjustedSize * 2); - const prefix = expanded.slice(0, this.curve.adjustedSize); - - return this.signWithScalar(msg, key, prefix, ph, ctx); - } - - verify(msg, sig, key, ph, ctx) { - if (ctx == null) - ctx = bufferExports.Buffer.alloc(0); - - assert(bufferExports.Buffer.isBuffer(msg)); - assert(bufferExports.Buffer.isBuffer(sig)); - assert(bufferExports.Buffer.isBuffer(key)); - assert(ph == null || typeof ph === 'boolean'); - assert(bufferExports.Buffer.isBuffer(ctx)); - - if (sig.length !== this.curve.adjustedSize * 2) - return false; - - if (key.length !== this.curve.adjustedSize) - return false; - - try { - return this._verify(msg, sig, key, ph, ctx); - } catch (e) { - return false; - } - } - - _verify(msg, sig, key, ph, ctx) { - // EdDSA Verification. - // - // [EDDSA] Page 15, Section 5. - // [RFC8032] Page 8, Section 3.4. - // - // Assumptions: - // - // - Let `H` be a cryptographic hash function. - // - Let `m` be a byte array of arbitrary size. - // - Let `R` and `s` be signature elements. - // - Let `A` be a valid group element. - // - s < n. - // - // Computation: - // - // e = H(R, A, m) mod n - // G * s == R + A * e - // - // Alternatively, we can compute: - // - // R == G * s - A * e - // - // This allows us to make use of a - // multi-exponentiation algorithm. - const {n} = this.curve; - const G = this.curve.g; - const Rraw = sig.slice(0, this.curve.adjustedSize); - const sraw = sig.slice(this.curve.adjustedSize); - const R = this.curve.decodePoint(Rraw); - const s = this.curve.decodeAdjusted(sraw); - const A = this.curve.decodePoint(key); - - if (s.cmp(n) >= 0) - return false; - - const e = this.hashChallenge(Rraw, key, msg, ph, ctx); - - return G.mulAdd(s, A.neg(), e).eq(R); - } - - verifySingle(msg, sig, key, ph, ctx) { - if (ctx == null) - ctx = bufferExports.Buffer.alloc(0); - - assert(bufferExports.Buffer.isBuffer(msg)); - assert(bufferExports.Buffer.isBuffer(sig)); - assert(bufferExports.Buffer.isBuffer(key)); - assert(ph == null || typeof ph === 'boolean'); - assert(bufferExports.Buffer.isBuffer(ctx)); - - if (sig.length !== this.curve.adjustedSize * 2) - return false; - - if (key.length !== this.curve.adjustedSize) - return false; - - try { - return this._verifySingle(msg, sig, key, ph, ctx); - } catch (e) { - return false; - } - } - - _verifySingle(msg, sig, key, ph, ctx) { - // EdDSA Verification (with cofactor multiplication). - // - // [EDDSA] Page 15, Section 5. - // [RFC8032] Page 8, Section 3.4. - // - // Assumptions: - // - // - Let `H` be a cryptographic hash function. - // - Let `m` be a byte array of arbitrary size. - // - Let `R` and `s` be signature elements. - // - Let `A` be a valid group element. - // - s < n. - // - // Computation: - // - // e = H(R, A, m) mod n - // (G * s) * h == (R + A * e) * h - // - // Alternatively, we can compute: - // - // R * h == G * (s * h) - (A * h) * e - // - // This allows us to make use of a - // multi-exponentiation algorithm. - const {n} = this.curve; - const G = this.curve.g; - const Rraw = sig.slice(0, this.curve.adjustedSize); - const sraw = sig.slice(this.curve.adjustedSize); - const R = this.curve.decodePoint(Rraw); - const s = this.curve.decodeAdjusted(sraw); - const A = this.curve.decodePoint(key); - - if (s.cmp(n) >= 0) - return false; - - const e = this.hashChallenge(Rraw, key, msg, ph, ctx); - const sh = this.curve.imulH(s); - const Ah = A.mulH(); - const Rh = R.mulH(); - - return G.mulAdd(sh, Ah.neg(), e).eq(Rh); - } - - verifyBatch(batch, ph, ctx) { - if (ctx == null) - ctx = bufferExports.Buffer.alloc(0); - - assert(Array.isArray(batch)); - assert(ph == null || typeof ph === 'boolean'); - assert(bufferExports.Buffer.isBuffer(ctx)); - - for (const item of batch) { - assert(Array.isArray(item) && item.length === 3); - - const [msg, sig, key] = item; - - assert(bufferExports.Buffer.isBuffer(msg)); - assert(bufferExports.Buffer.isBuffer(sig)); - assert(bufferExports.Buffer.isBuffer(key)); - - if (sig.length !== this.curve.adjustedSize * 2) - return false; - - if (key.length !== this.curve.adjustedSize) - return false; - } - - try { - return this._verifyBatch(batch, ph, ctx); - } catch (e) { - return false; - } - } - - _verifyBatch(batch, ph, ctx) { - // EdDSA Batch Verification. - // - // [EDDSA] Page 16, Section 5. - // - // Assumptions: - // - // - Let `H` be a cryptographic hash function. - // - Let `R` and `s` be signature elements. - // - Let `A` be a valid group element. - // - Let `i` be the batch item index. - // - s < n. - // - a1 = 1 mod n. - // - // Computation: - // - // ei = H(Ri, Ai, mi) mod n - // ai = random integer in [1,n-1] - // lhs = (si * ai + ...) * h mod n - // rhs = (Ri * h) * ai + (Ai * h) * (ei * ai mod n) + ... - // G * -lhs + rhs == O - const {n} = this.curve; - const G = this.curve.g; - const points = new Array(1 + batch.length * 2); - const coeffs = new Array(1 + batch.length * 2); - const sum = new BN(0); - - this.rng.init(batch); - - points[0] = G; - coeffs[0] = sum; - - for (let i = 0; i < batch.length; i++) { - const [msg, sig, key] = batch[i]; - const Rraw = sig.slice(0, this.curve.adjustedSize); - const sraw = sig.slice(this.curve.adjustedSize); - const R = this.curve.decodePoint(Rraw); - const s = this.curve.decodeAdjusted(sraw); - const A = this.curve.decodePoint(key); - - if (s.cmp(n) >= 0) - return false; - - const e = this.hashChallenge(Rraw, key, msg, ph, ctx); - const a = this.rng.generate(i); - const ea = e.mul(a).imod(n); - - sum.iadd(s.mul(a)).imod(n); - - points[1 + i * 2 + 0] = R.mulH(); - coeffs[1 + i * 2 + 0] = a; - points[1 + i * 2 + 1] = A.mulH(); - coeffs[1 + i * 2 + 1] = ea; - } - - this.curve.imulH(sum.ineg()); - - return this.curve.mulAll(points, coeffs).isInfinity(); - } - - derive(pub, secret) { - const scalar = this.privateKeyConvert(secret); - return this.deriveWithScalar(pub, scalar); - } - - deriveWithScalar(pub, scalar) { - const A = this.curve.decodePoint(pub); - const a = this.curve.decodeClamped(scalar); - const P = A.mulBlind(a, rng); - - if (P.isInfinity()) - throw new Error('Invalid point.'); - - return P.encode(); - } - } - - /* - * Hash - */ - - class Hash { - constructor(eddsa) { - this.curve = eddsa.curve; - // eslint-disable-next-line - this.hash = new eddsa.hash(); - } - - init(ph, ctx) { - assert(ph == null || typeof ph === 'boolean'); - assert(bufferExports.Buffer.isBuffer(ctx)); - - if (ctx.length > 255) - ctx = ctx.slice(0, 255); - - this.hash.init(); - - if (this.curve.context || ph != null || ctx.length > 0) { - if (this.curve.prefix) - this.hash.update(this.curve.prefix); - - this.hash.update(byte(ph)); - this.hash.update(byte(ctx.length)); - this.hash.update(ctx); - } - - return this; - } - - update(data) { - this.hash.update(data); - return this; - } - - final() { - const hash = this.hash.final(this.curve.adjustedSize * 2); - const num = BN.decode(hash, this.curve.endian); - - return num.imod(this.curve.n); - } - } - - /* - * Helpers - */ - - function byte(ch) { - const buf = bufferExports.Buffer.alloc(1); - buf[0] = ch & 0xff; - return buf; - } - - /* - * Expose - */ - - eddsa = EDDSA; - return eddsa; -} - -var keccak; -var hasRequiredKeccak; - -function requireKeccak () { - if (hasRequiredKeccak) return keccak; - hasRequiredKeccak = 1; - - const assert = requireAssert(); - const HMAC = requireHmac(); - - /* - * Constants - */ - - const FINALIZED = 0x80000000; - - const ROUND_CONST = new Uint32Array([ - 0x00000001, 0x00000000, 0x00008082, 0x00000000, - 0x0000808a, 0x80000000, 0x80008000, 0x80000000, - 0x0000808b, 0x00000000, 0x80000001, 0x00000000, - 0x80008081, 0x80000000, 0x00008009, 0x80000000, - 0x0000008a, 0x00000000, 0x00000088, 0x00000000, - 0x80008009, 0x00000000, 0x8000000a, 0x00000000, - 0x8000808b, 0x00000000, 0x0000008b, 0x80000000, - 0x00008089, 0x80000000, 0x00008003, 0x80000000, - 0x00008002, 0x80000000, 0x00000080, 0x80000000, - 0x0000800a, 0x00000000, 0x8000000a, 0x80000000, - 0x80008081, 0x80000000, 0x00008080, 0x80000000, - 0x80000001, 0x00000000, 0x80008008, 0x80000000 - ]); - - /** - * Keccak - */ - - class Keccak { - constructor() { - this.state = new Uint32Array(50); - this.block = bufferExports.Buffer.alloc(200); - this.bs = 136; - this.pos = FINALIZED; - } - - init(bits) { - if (bits == null) - bits = 256; - - assert((bits >>> 0) === bits); - assert(bits >= 128); - assert(bits <= 512); - - const rate = 1600 - bits * 2; - - assert(rate >= 0 && (rate & 63) === 0); - - this.bs = rate >>> 3; - this.pos = 0; - - return this; - } - - update(data) { - assert(bufferExports.Buffer.isBuffer(data)); - assert(!(this.pos & FINALIZED), 'Context is not initialized.'); - - let len = data.length; - let pos = this.pos; - let off = 0; - - this.pos = (this.pos + len) % this.bs; - - if (pos > 0) { - let want = this.bs - pos; - - if (want > len) - want = len; - - data.copy(this.block, pos, off, off + want); - - pos += want; - len -= want; - off += want; - - if (pos < this.bs) - return this; - - this._transform(this.block, 0); - } - - while (len >= this.bs) { - this._transform(data, off); - off += this.bs; - len -= this.bs; - } - - if (len > 0) - data.copy(this.block, 0, off, off + len); - - return this; - } - - final(pad, len) { - if (pad == null) - pad = 0x01; - - if (len == null || len === 0) - len = 100 - (this.bs >>> 1); - - assert((pad & 0xff) === pad); - assert((len >>> 0) === len); - assert(!(this.pos & FINALIZED), 'Context is not initialized.'); - - this.block.fill(0, this.pos, this.bs); - this.block[this.pos] |= pad; - this.block[this.bs - 1] |= 0x80; - this._transform(this.block, 0); - this.pos = FINALIZED; - - assert(len <= this.bs); - - const out = bufferExports.Buffer.alloc(len); - - for (let i = 0; i < len; i++) - out[i] = this.state[i >>> 2] >>> (8 * (i & 3)); - - for (let i = 0; i < 50; i++) - this.state[i] = 0; - - for (let i = 0; i < this.bs; i++) - this.block[i] = 0; - - return out; - } - - _transform(block, off) { - const count = this.bs >>> 2; - const s = this.state; - - for (let i = 0; i < count; i++) - s[i] ^= readU32(block, off + i * 4); - - for (let n = 0; n < 48; n += 2) { - const c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]; - const c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]; - const c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]; - const c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43]; - const c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44]; - const c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45]; - const c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46]; - const c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47]; - const c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48]; - const c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49]; - - const h0 = c8 ^ ((c2 << 1) | (c3 >>> 31)); - const l0 = c9 ^ ((c3 << 1) | (c2 >>> 31)); - const h1 = c0 ^ ((c4 << 1) | (c5 >>> 31)); - const l1 = c1 ^ ((c5 << 1) | (c4 >>> 31)); - const h2 = c2 ^ ((c6 << 1) | (c7 >>> 31)); - const l2 = c3 ^ ((c7 << 1) | (c6 >>> 31)); - const h3 = c4 ^ ((c8 << 1) | (c9 >>> 31)); - const l3 = c5 ^ ((c9 << 1) | (c8 >>> 31)); - const h4 = c6 ^ ((c0 << 1) | (c1 >>> 31)); - const l4 = c7 ^ ((c1 << 1) | (c0 >>> 31)); - - s[0] ^= h0; - s[1] ^= l0; - s[10] ^= h0; - s[11] ^= l0; - s[20] ^= h0; - s[21] ^= l0; - s[30] ^= h0; - s[31] ^= l0; - s[40] ^= h0; - s[41] ^= l0; - - s[2] ^= h1; - s[3] ^= l1; - s[12] ^= h1; - s[13] ^= l1; - s[22] ^= h1; - s[23] ^= l1; - s[32] ^= h1; - s[33] ^= l1; - s[42] ^= h1; - s[43] ^= l1; - - s[4] ^= h2; - s[5] ^= l2; - s[14] ^= h2; - s[15] ^= l2; - s[24] ^= h2; - s[25] ^= l2; - s[34] ^= h2; - s[35] ^= l2; - s[44] ^= h2; - s[45] ^= l2; - - s[6] ^= h3; - s[7] ^= l3; - s[16] ^= h3; - s[17] ^= l3; - s[26] ^= h3; - s[27] ^= l3; - s[36] ^= h3; - s[37] ^= l3; - s[46] ^= h3; - s[47] ^= l3; - - s[8] ^= h4; - s[9] ^= l4; - s[18] ^= h4; - s[19] ^= l4; - s[28] ^= h4; - s[29] ^= l4; - s[38] ^= h4; - s[39] ^= l4; - s[48] ^= h4; - s[49] ^= l4; - - const b0 = s[0]; - const b1 = s[1]; - const b32 = (s[11] << 4) | (s[10] >>> 28); - const b33 = (s[10] << 4) | (s[11] >>> 28); - const b14 = (s[20] << 3) | (s[21] >>> 29); - const b15 = (s[21] << 3) | (s[20] >>> 29); - const b46 = (s[31] << 9) | (s[30] >>> 23); - const b47 = (s[30] << 9) | (s[31] >>> 23); - const b28 = (s[40] << 18) | (s[41] >>> 14); - const b29 = (s[41] << 18) | (s[40] >>> 14); - const b20 = (s[2] << 1) | (s[3] >>> 31); - const b21 = (s[3] << 1) | (s[2] >>> 31); - const b2 = (s[13] << 12) | (s[12] >>> 20); - const b3 = (s[12] << 12) | (s[13] >>> 20); - const b34 = (s[22] << 10) | (s[23] >>> 22); - const b35 = (s[23] << 10) | (s[22] >>> 22); - const b16 = (s[33] << 13) | (s[32] >>> 19); - const b17 = (s[32] << 13) | (s[33] >>> 19); - const b48 = (s[42] << 2) | (s[43] >>> 30); - const b49 = (s[43] << 2) | (s[42] >>> 30); - const b40 = (s[5] << 30) | (s[4] >>> 2); - const b41 = (s[4] << 30) | (s[5] >>> 2); - const b22 = (s[14] << 6) | (s[15] >>> 26); - const b23 = (s[15] << 6) | (s[14] >>> 26); - const b4 = (s[25] << 11) | (s[24] >>> 21); - const b5 = (s[24] << 11) | (s[25] >>> 21); - const b36 = (s[34] << 15) | (s[35] >>> 17); - const b37 = (s[35] << 15) | (s[34] >>> 17); - const b18 = (s[45] << 29) | (s[44] >>> 3); - const b19 = (s[44] << 29) | (s[45] >>> 3); - const b10 = (s[6] << 28) | (s[7] >>> 4); - const b11 = (s[7] << 28) | (s[6] >>> 4); - const b42 = (s[17] << 23) | (s[16] >>> 9); - const b43 = (s[16] << 23) | (s[17] >>> 9); - const b24 = (s[26] << 25) | (s[27] >>> 7); - const b25 = (s[27] << 25) | (s[26] >>> 7); - const b6 = (s[36] << 21) | (s[37] >>> 11); - const b7 = (s[37] << 21) | (s[36] >>> 11); - const b38 = (s[47] << 24) | (s[46] >>> 8); - const b39 = (s[46] << 24) | (s[47] >>> 8); - const b30 = (s[8] << 27) | (s[9] >>> 5); - const b31 = (s[9] << 27) | (s[8] >>> 5); - const b12 = (s[18] << 20) | (s[19] >>> 12); - const b13 = (s[19] << 20) | (s[18] >>> 12); - const b44 = (s[29] << 7) | (s[28] >>> 25); - const b45 = (s[28] << 7) | (s[29] >>> 25); - const b26 = (s[38] << 8) | (s[39] >>> 24); - const b27 = (s[39] << 8) | (s[38] >>> 24); - const b8 = (s[48] << 14) | (s[49] >>> 18); - const b9 = (s[49] << 14) | (s[48] >>> 18); - - s[0] = b0 ^ (~b2 & b4); - s[1] = b1 ^ (~b3 & b5); - s[10] = b10 ^ (~b12 & b14); - s[11] = b11 ^ (~b13 & b15); - s[20] = b20 ^ (~b22 & b24); - s[21] = b21 ^ (~b23 & b25); - s[30] = b30 ^ (~b32 & b34); - s[31] = b31 ^ (~b33 & b35); - s[40] = b40 ^ (~b42 & b44); - s[41] = b41 ^ (~b43 & b45); - s[2] = b2 ^ (~b4 & b6); - s[3] = b3 ^ (~b5 & b7); - s[12] = b12 ^ (~b14 & b16); - s[13] = b13 ^ (~b15 & b17); - s[22] = b22 ^ (~b24 & b26); - s[23] = b23 ^ (~b25 & b27); - s[32] = b32 ^ (~b34 & b36); - s[33] = b33 ^ (~b35 & b37); - s[42] = b42 ^ (~b44 & b46); - s[43] = b43 ^ (~b45 & b47); - s[4] = b4 ^ (~b6 & b8); - s[5] = b5 ^ (~b7 & b9); - s[14] = b14 ^ (~b16 & b18); - s[15] = b15 ^ (~b17 & b19); - s[24] = b24 ^ (~b26 & b28); - s[25] = b25 ^ (~b27 & b29); - s[34] = b34 ^ (~b36 & b38); - s[35] = b35 ^ (~b37 & b39); - s[44] = b44 ^ (~b46 & b48); - s[45] = b45 ^ (~b47 & b49); - s[6] = b6 ^ (~b8 & b0); - s[7] = b7 ^ (~b9 & b1); - s[16] = b16 ^ (~b18 & b10); - s[17] = b17 ^ (~b19 & b11); - s[26] = b26 ^ (~b28 & b20); - s[27] = b27 ^ (~b29 & b21); - s[36] = b36 ^ (~b38 & b30); - s[37] = b37 ^ (~b39 & b31); - s[46] = b46 ^ (~b48 & b40); - s[47] = b47 ^ (~b49 & b41); - s[8] = b8 ^ (~b0 & b2); - s[9] = b9 ^ (~b1 & b3); - s[18] = b18 ^ (~b10 & b12); - s[19] = b19 ^ (~b11 & b13); - s[28] = b28 ^ (~b20 & b22); - s[29] = b29 ^ (~b21 & b23); - s[38] = b38 ^ (~b30 & b32); - s[39] = b39 ^ (~b31 & b33); - s[48] = b48 ^ (~b40 & b42); - s[49] = b49 ^ (~b41 & b43); - - s[0] ^= ROUND_CONST[n + 0]; - s[1] ^= ROUND_CONST[n + 1]; - } - } - - static hash() { - return new Keccak(); - } - - static hmac(bits, pad, len) { - if (bits == null) - bits = 256; - - assert((bits >>> 0) === bits); - - const rate = 1600 - bits * 2; - - assert(rate >= 0 && (rate & 63) === 0); - - return new HMAC(Keccak, rate >>> 3, [bits], [pad, len]); - } - - static digest(data, bits, pad, len) { - return Keccak.ctx.init(bits).update(data).final(pad, len); - } - - static root(left, right, bits, pad, len) { - if (bits == null) - bits = 256; - - if (len == null) - len = 0; - - if (len === 0) - len = bits >>> 3; - - assert((bits >>> 0) === bits); - assert((bits & 7) === 0); - assert((len >>> 0) === len); - assert(bufferExports.Buffer.isBuffer(left) && left.length === len); - assert(bufferExports.Buffer.isBuffer(right) && right.length === len); - - return Keccak.ctx.init(bits).update(left).update(right).final(pad, len); - } - - static multi(x, y, z, bits, pad, len) { - const {ctx} = Keccak; - - ctx.init(bits); - ctx.update(x); - ctx.update(y); - - if (z) - ctx.update(z); - - return ctx.final(pad, len); - } - - static mac(data, key, bits, pad, len) { - return Keccak.hmac(bits, pad, len).init(key).update(data).final(); - } - } - - /* - * Static - */ - - Keccak.native = 0; - Keccak.id = 'KECCAK256'; - Keccak.size = 32; - Keccak.bits = 256; - Keccak.blockSize = 136; - Keccak.zero = bufferExports.Buffer.alloc(32, 0x00); - Keccak.ctx = new Keccak(); - - /* - * Helpers - */ - - function readU32(data, off) { - return (data[off++] - + data[off++] * 0x100 - + data[off++] * 0x10000 - + data[off] * 0x1000000); - } - - /* - * Expose - */ - - keccak = Keccak; - return keccak; -} - -/*! - * keccak.js - keccak for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var keccakBrowser; -var hasRequiredKeccakBrowser; - -function requireKeccakBrowser () { - if (hasRequiredKeccakBrowser) return keccakBrowser; - hasRequiredKeccakBrowser = 1; - - keccakBrowser = requireKeccak(); - return keccakBrowser; -} - -var shake; -var hasRequiredShake; - -function requireShake () { - if (hasRequiredShake) return shake; - hasRequiredShake = 1; - - const Keccak = requireKeccakBrowser(); - - /** - * SHAKE - */ - - class SHAKE extends Keccak { - /** - * Create a SHAKE Context. - * @constructor - */ - - constructor() { - super(); - } - - final(len) { - return super.final(0x1f, len); - } - - static hash() { - return new SHAKE(); - } - - static hmac(bits, len) { - return super.hmac(bits, 0x1f, len); - } - - static digest(data, bits, len) { - return super.digest(data, bits, 0x1f, len); - } - - static root(left, right, bits, len) { - return super.root(left, right, bits, 0x1f, len); - } - - static multi(x, y, z, bits, len) { - return super.multi(x, y, z, bits, 0x1f, len); - } - - static mac(data, key, bits, len) { - return super.mac(data, key, bits, 0x1f, len); - } - } - - /* - * Static - */ - - SHAKE.native = Keccak.native; - SHAKE.id = 'SHAKE256'; - SHAKE.size = 32; - SHAKE.bits = 256; - SHAKE.blockSize = 136; - SHAKE.zero = bufferExports.Buffer.alloc(32, 0x00); - SHAKE.ctx = new SHAKE(); - - /* - * Expose - */ - - shake = SHAKE; - return shake; -} - -var shake256; -var hasRequiredShake256; - -function requireShake256 () { - if (hasRequiredShake256) return shake256; - hasRequiredShake256 = 1; - - const SHAKE = requireShake(); - - /** - * SHAKE256 - */ - - class SHAKE256 extends SHAKE { - constructor() { - super(); - } - - init() { - return super.init(256); - } - - static hash() { - return new SHAKE256(); - } - - static hmac(len) { - return super.hmac(256, len); - } - - static digest(data, len) { - return super.digest(data, 256, len); - } - - static root(left, right, len) { - return super.root(left, right, 256, len); - } - - static multi(x, y, z, len) { - return super.multi(x, y, z, 256, len); - } - - static mac(data, key, len) { - return super.mac(data, key, 256, len); - } - } - - /* - * Static - */ - - SHAKE256.native = SHAKE.native; - SHAKE256.id = 'SHAKE256'; - SHAKE256.size = 32; - SHAKE256.bits = 256; - SHAKE256.blockSize = 136; - SHAKE256.zero = bufferExports.Buffer.alloc(32, 0x00); - SHAKE256.ctx = new SHAKE256(); - - /* - * Expose - */ - - shake256 = SHAKE256; - return shake256; -} - -/*! - * ed448.js - ed448 for bcrypto - * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Resources: - * https://eprint.iacr.org/2015/625.pdf - * https://tools.ietf.org/html/rfc8032#section-5.2 - */ - -var ed448$1; -var hasRequiredEd448; - -function requireEd448 () { - if (hasRequiredEd448) return ed448$1; - hasRequiredEd448 = 1; - - const EDDSA = requireEddsa(); - const SHAKE256 = requireShake256(); - - /* - * Expose - */ - - ed448$1 = new EDDSA('ED448', 'X448', 'MONT448', SHAKE256); - return ed448$1; -} - -/*! - * ed448.js - ed448 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var ed448Browser; -var hasRequiredEd448Browser; - -function requireEd448Browser () { - if (hasRequiredEd448Browser) return ed448Browser; - hasRequiredEd448Browser = 1; - - ed448Browser = requireEd448(); - return ed448Browser; -} - -var ed448BrowserExports = requireEd448Browser(); -var backend = /*@__PURE__*/getDefaultExportFromCjs(ed448BrowserExports); - -// bcrypto does not ship TypeScript declarations. -// @ts-ignore -const ed448 = backend; - -/** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ -const BN_0$9 = BigInt(0); -const BN_1$5 = BigInt(1); -//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; -// IEEE 754 support 53-bits of mantissa -const maxValue = 0x1fffffffffffff; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -function fromTwos(_value, _width) { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - assert(value >> width === BN_0$9, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", - fault: "overflow", - value: _value, - }); - // Top bit set; treat as a negative value - if (value >> (width - BN_1$5)) { - const mask = (BN_1$5 << width) - BN_1$5; - return -((~value & mask) + BN_1$5); - } - return value; -} -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -function toTwos(_value, _width) { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = BN_1$5 << (width - BN_1$5); - if (value < BN_0$9) { - value = -value; - assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - const mask = (BN_1$5 << width) - BN_1$5; - return (~value & mask) + BN_1$5; - } - else { - assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - } - return value; -} -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -function mask(_value, _bits) { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1$5 << bits) - BN_1$5); -} -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -function getBigInt(value, name) { - switch (typeof value) { - case "bigint": - return value; - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } - catch (e) { - assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid BigNumberish value", name || "value", value); -} -function getUint(value, name) { - const result = getBigInt(value, name); - assert(result >= BN_0$9, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", - operation: "getUint", - value, - }); - return result; -} -const Nibbles = "0123456789abcdef"; -/* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ -function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles[v >> 4]; - result += Nibbles[v & 0x0f]; - } - return BigInt(result); - } - return getBigInt(value); -} -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -function getNumber(value, name) { - switch (typeof value) { - case "bigint": - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } - catch (e) { - assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid numeric value", name || "value", value); -} -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -function toNumber(value) { - return getNumber(toBigInt(value)); -} -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -function toBeHex(_value, _width) { - const value = getUint(_value, "value"); - let result = value.toString(16); - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } - else { - const width = getNumber(_width, "width"); - assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value, - }); - // Pad the value to the required width - while (result.length < width * 2) { - result = "0" + result; - } - } - return "0x" + result; -} -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -function toBeArray(_value) { - const value = getUint(_value, "value"); - if (value === BN_0$9) { - return new Uint8Array([]); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - return result; -} -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -function toQuantity(value) { - let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; -} - -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -let Lookup = null; -function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; -} -const BN_0$8 = BigInt(0); -const BN_58 = BigInt(58); -/** - * Encode %%value%% as a Base58-encoded string. - */ -function encodeBase58(_value) { - let value = toBigInt(getBytes(_value)); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - return result; -} -/** - * Decode the Base58-encoded %%value%%. - */ -function decodeBase58(value) { - let result = BN_0$8; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; -} - -// utils/base64-browser -function decodeBase64(textData) { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return getBytes(data); -} -function encodeBase64(_data) { - const data = getBytes(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); -} - -/** - * Explain events... - * - * @_section api/utils/events:Events [about-events] - */ -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -class EventPayload { - /** - * The event filter. - */ - filter; - /** - * The **EventEmitterable**. - */ - emitter; - #listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter, listener, filter) { - this.#listener = listener; - defineProperties(this, { emitter, filter }); - } - /** - * Unregister the triggered listener for future events. - */ - async removeListener() { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } -} - -/** - * Using strings in Core (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ -function errorFunc(reason, offset, bytes, output, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); -} -function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; -} -function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes); -} -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc, -}); -// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 -function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; -} -// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8Bytes(str, form) { - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); -} -//export -function _toUtf8String(codePoints) { - return codePoints - .map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00); - }) - .join(""); -} -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); -} -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8CodePoints(str, form) { - return getUtf8CodePoints(toUtf8Bytes(str, form)); -} - -// @TODO: timeout is completely ignored; start a Promise.any with a reject? -// @ts-ignore -async function getUrl(req, _signal) { - const protocol = req.url.split(":")[0].toLowerCase(); - assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request", - }); - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request", - }); - let signal = undefined; - if (_signal) { - const controller = new AbortController(); - signal = controller.signal; - _signal.addListener(() => { - controller.abort(); - }); - } - const init = { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal, - }; - try { - const resp = await fetch(req.url, init); - const headers = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - const respBody = await resp.arrayBuffer(); - const body = respBody == null ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, - body, - }; - } - catch (error) { - console.log({ error }); - return undefined; - } -} - -/** - * Explain fetching here... - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ -const MAX_ATTEMPTS = 12; -const SLOT_INTERVAL = 250; -// The global FetchGetUrlFunc implementation. -let getUrlFunc = getUrl; -const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); -const reIpfs = new RegExp("^ipfs://(ipfs/)?(.*)$", "i"); -// If locked, new Gateways cannot be added -let locked$5 = false; -// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs -async function dataGatewayFunc(url, signal) { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse(200, "OK", { - "content-type": match[1] || "text/plain", - }, match[2] ? decodeBase64(match[3]) : unpercent(match[3])); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); - } -} -/** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ -function getIpfsGatewayFunc(baseUrl) { - async function gatewayIpfs(url, signal) { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); - } - } - return gatewayIpfs; -} -const Gateways = { - data: dataGatewayFunc, - ipfs: getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/"), -}; -const fetchSignals = new WeakMap(); -/** - * @_ignore - */ -class FetchCancelSignal { - #listeners; - #cancelled; - constructor(request) { - this.#listeners = []; - this.#cancelled = false; - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - for (const listener of this.#listeners) { - setTimeout(() => { - listener(); - }, 0); - } - this.#listeners = []; - }); - } - addListener(listener) { - assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener", - }); - this.#listeners.push(listener); - } - get cancelled() { - return this.#cancelled; - } - checkSignal() { - assert(!this.cancelled, "cancelled", "CANCELLED", {}); - } -} -// Check the signal, throwing if it is cancelled -function checkSignal(signal) { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -class FetchRequest { - #allowInsecure; - #gzip; - #headers; - #method; - #timeout; - #url; - #body; - #bodyType; - #creds; - // Hooks - #preflight; - #process; - #retry; - #signal; - #throttle; - /** - * The fetch URI to requrest. - */ - get url() { - return this.#url; - } - set url(url) { - this.#url = String(url); - } - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . - * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrincis ``Content-Type`` is - * set to ``application/json``. - */ - get body() { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } - else if (typeof body === "string") { - this.#body = toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } - else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } - else if (typeof body === "object") { - this.#body = toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } - else { - throw new Error("invalid body"); - } - } - /** - * Returns true if the request has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method() { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any chnages will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers() { - const headers = Object.assign({}, this.#headers); - if (this.#creds) { - headers["authorization"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`; - } - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - return headers; - } - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key, value) { - this.#headers[String(key).toLowerCase()] = String(value); - } - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders() { - this.#headers = {}; - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials() { - return this.#creds || null; - } - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username, password) { - assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${username}:${password}`; - } - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip() { - return this.#gzip; - } - set allowGzip(value) { - this.#gzip = !!value; - } - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication() { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value) { - this.#allowInsecure = !!value; - } - /** - * The timeout (in milliseconds) to wait for a complere response. - * //(default: 5 minutes)// - */ - get timeout() { - return this.#timeout; - } - set timeout(timeout) { - assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc() { - return this.#preflight || null; - } - set preflightFunc(preflight) { - this.#preflight = preflight; - } - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc() { - return this.#process || null; - } - set processFunc(process) { - this.#process = process; - } - /** - * This function is called on each retry attempt. - */ - get retryFunc() { - return this.#retry || null; - } - set retryFunc(retry) { - this.#retry = retry; - } - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url) { - this.#url = String(url); - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS, - }; - } - toString() { - return ``; - } - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params) { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - async #send(attempt, expires, delay, _request, _response) { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - assert(getTime$2() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", - reason: "timeout", - request: _request, - }); - if (delay > 0) { - await wait(delay); - } - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Ignore throttling - } - } - return response; - } - req = result; - } - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - const resp = await getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req - .redirect(location) - .#send(attempt + 1, expires, 0, _request, response); - } - catch (error) { } - // Things won't get any better on another attempt; abort - return response; - } - else if (response.statusCode === 429) { - // Throttle - if (this.retryFunc == null || - (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof retryAfter === "string" && - retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Throttle - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (error.stall >= 0) { - delay = error.stall; - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - return response; - } - /** - * Resolves to the response by sending the request. - */ - send() { - assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime$2() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); - } - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel() { - assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location) { - // Redirection; for now we only support absolute locataions - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - assert(this.method === "GET" && - (current !== "https" || target !== "http") && - location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`, - }); - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - return req; - } - /** - * Create a new copy of this request. - */ - clone() { - const clone = new FetchRequest(this.url); - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - if (this.allowGzip) { - clone.allowGzip = true; - } - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - return clone; - } - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig() { - locked$5 = true; - } - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme) { - return Gateways[scheme.toLowerCase()] || null; - } - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme, func) { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked$5) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl) { - if (locked$5) { - throw new Error("gateways locked"); - } - getUrlFunc = getUrl; - } - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway() { - return dataGatewayFunc; - } - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl) { - return getIpfsGatewayFunc(baseUrl); - } -} -/** - * The response for a FetchREquest. - */ -class FetchResponse { - #statusCode; - #statusMessage; - #headers; - #body; - #request; - #error; - toString() { - return ``; - } - /** - * The response status code. - */ - get statusCode() { - return this.#statusCode; - } - /** - * The response status message. - */ - get statusMessage() { - return this.#statusMessage; - } - /** - * The response headers. All keys are lower-case. - */ - get headers() { - return Object.assign({}, this.#headers); - } - /** - * The response body, or ``null`` if there was no body. - */ - get body() { - return this.#body == null ? null : new Uint8Array(this.#body); - } - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText() { - try { - return this.#body == null ? "" : toUtf8String(this.#body); - } - catch (error) { - assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", - info: { response: this }, - }); - } - } - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson() { - try { - return JSON.parse(this.bodyText); - } - catch (error) { - assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", - info: { response: this }, - }); - } - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - constructor(statusCode, statusMessage, headers, body, request) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, {}); - this.#body = body == null ? null : new Uint8Array(body); - this.#request = request || null; - this.#error = { message: "" }; - } - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message, error) { - let statusMessage; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } - else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message, stall) { - if (stall == null) { - stall = -1; - } - else { - assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - const error = new Error(message || "throttling requests"); - defineProperties(error, { stall, throttle: true }); - throw error; - } - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Returns true of the response has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The request made for this response. - */ - get request() { - return this.#request; - } - /** - * Returns true if this response was a success statusCode. - */ - ok() { - return (this.#error.message === "" && - this.statusCode >= 200 && - this.statusCode < 300); - } - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk() { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - assert(false, message, "SERVER_ERROR", { - request: this.request || "unknown request", - response: this, - error, - }); - } -} -function getTime$2() { - return new Date().getTime(); -} -function unpercent(value) { - return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); -} -function wait(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); -} - -var _a$1; -const BN_N1 = BigInt(-1); -const BN_0$7 = BigInt(0); -const BN_1$4 = BigInt(1); -const BN_5 = BigInt(5); -const _guard$5 = {}; -// Constant to pull zeros from for multipliers -let Zeros = "0000"; -while (Zeros.length < 80) { - Zeros += Zeros; -} -// Returns a string "1" followed by decimal "0"s -function getTens(decimals) { - let result = Zeros; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); -} -function checkValue(val, format, safeOp) { - const width = BigInt(format.width); - if (format.signed) { - const limit = BN_1$4 << (width - BN_1$4); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - if (val > BN_0$7) { - val = fromTwos(mask(val, width), width); - } - else { - val = -fromTwos(mask(-val, width), width); - } - } - else { - const limit = BN_1$4 << width; - assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - val = (((val % limit) + limit) % limit) & (limit - BN_1$4); - } - return val; -} -function getFormat(value) { - if (typeof value === "number") { - value = `fixed128x${value}`; - } - let signed = true; - let width = 128; - let decimals = 18; - if (typeof value === "string") { - // Parse the format string - if (value === "fixed") ; - else if (value === "ufixed") { - signed = false; - } - else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - assertArgument(match, "invalid fixed format", "format", value); - signed = match[1] !== "u"; - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } - else if (value) { - // Extract the values from the object - const v = value; - const check = (key, type, defaultValue) => { - if (v[key] == null) { - return defaultValue; - } - assertArgument(typeof v[key] === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - assertArgument(width % 8 === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - return { signed, width, decimals, name }; -} -function toString(val, decimals) { - let negative = ""; - if (val < BN_0$7) { - negative = "-"; - val *= BN_N1; - } - let str = val.toString(); - // No decimal point for whole values - if (decimals === 0) { - return negative + str; - } - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros + str; - } - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - return negative + str; -} -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, an value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - format; - #format; - // The actual value (accounting for decimals) - #val; - // A base-10 value to multiple values by to maintain the magnitude - #tens; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - _value; - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - /** - * @private - */ - constructor(guard, value, format) { - assertPrivate(guard, _guard$5, "FixedNumber"); - this.#val = value; - this.#format = format; - const _value = toString(value, format.decimals); - defineProperties(this, { format: format.name, _value }); - this.#tens = getTens(format.decimals); - } - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed() { - return this.#format.signed; - } - /** - * The number of bits available to store the value. - */ - get width() { - return this.#format.width; - } - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals() { - return this.#format.decimals; - } - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value() { - return this.#val; - } - #checkFormat(other) { - assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); - } - #checkValue(val, safeOp) { - /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } -*/ - val = checkValue(val, this.#format, safeOp); - return new _a$1(_guard$5, val, this.#format); - } - #add(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other) { - return this.#add(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other) { - return this.#add(other, "add"); - } - #sub(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other) { - return this.#sub(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other) { - return this.#sub(other, "sub"); - } - #mul(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other) { - return this.#mul(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other) { - return this.#mul(other, "mul"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other) { - this.#checkFormat(other); - const value = this.#val * other.#val; - assert(value % this.#tens === BN_0$7, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - #div(o, safeOp) { - assert(o.#val !== BN_0$7, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other) { - return this.#div(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other) { - return this.#div(other, "div"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other) { - assert(other.#val !== BN_0$7, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(other); - const value = this.#val * this.#tens; - assert(value % other.#val === BN_0$7, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%other%% is larger and ``0`` implies - * both are equal. - */ - cmp(other) { - let a = this.value, b = other.value; - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } - else if (delta < 0) { - a *= getTens(-delta); - } - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return -1; - } - return 0; - } - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other) { - return this.cmp(other) === 0; - } - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other) { - return this.cmp(other) < 0; - } - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other) { - return this.cmp(other) <= 0; - } - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other) { - return this.cmp(other) > 0; - } - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other) { - return this.cmp(other) >= 0; - } - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor() { - let val = this.#val; - if (this.#val < BN_0$7) { - val -= this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling() { - let val = this.#val; - if (this.#val > BN_0$7) { - val += this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals) { - if (decimals == null) { - decimals = 0; - } - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - checkValue(value, this.#format, "round"); - return new _a$1(_guard$5, value, this.#format); - } - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero() { - return this.#val === BN_0$7; - } - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative() { - return this.#val < BN_0$7; - } - /** - * Returns the string representation of %%this%%. - */ - toString() { - return this._value; - } - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat() { - return parseFloat(this.toString()); - } - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format) { - return _a$1.fromString(this.toString(), format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value, decimals, _format) { - if (decimals == null) { - decimals = 0; - } - const format = getFormat(_format); - let value = getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - assert(value % tens === BN_0$7, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", - fault: "underflow", - value: _value, - }); - value /= tens; - } - else if (delta < 0) { - value *= getTens(-delta); - } - checkValue(value, format, "fromValue"); - return new _a$1(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value, _format) { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - assertArgument(match && match[2].length + match[3].length > 0, "invalid FixedNumber string value", "value", _value); - const format = getFormat(_format); - let whole = match[2] || "0", decimal = match[3] || ""; - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros; - } - // Check precision is safe - assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", - fault: "underflow", - value: _value, - }); - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - const value = BigInt(match[1] + whole + decimal); - checkValue(value, format, "fromString"); - return new _a$1(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value, _format) { - let value = toBigInt(getBytes(_value, "value")); - const format = getFormat(_format); - if (format.signed) { - value = fromTwos(value, format.width); - } - checkValue(value, format, "fromBytes"); - return new _a$1(_guard$5, value, format); - } -} -_a$1 = FixedNumber; -//const f1 = FixedNumber.fromString("12.56", "fixed16x2"); -//const f2 = FixedNumber.fromString("0.3", "fixed16x2"); -//console.log(f1.divSignal(f2)); -//const BUMP = FixedNumber.from("0.5"); - -function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; -} -function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; -} -function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, - length, - offset, - }); - } - return { consumed: 1 + length, result: result }; -} -// returns { consumed: number, result: Object } -function _decode(data, offset) { - assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, - length: 0, - offset: 1, - }); - const checkOffset = (offset) => { - assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, - length: data.length, - offset, - }); - }; - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - return _decodeChildren(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlifyByte(data[offset]) }; -} -/** - * Decodes %%data%% into the structured data it represents. - */ -function decodeRlp(_data) { - const data = getBytes(_data, "data"); - const decoded = _decode(data, 0); - assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; -} - -function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - const data = Array.prototype.slice.call(getBytes(object, "object")); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); -} -const nibbles = "0123456789abcdef"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -function encodeRlp(object) { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; -} - -/** - * Most interactions with Core requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Core, //Core// is divisible to 18 decimal places, - * where each individual unit is called a //ore//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ -const names = [ - ///Ore, the smallest and atomic amount of Core - "ore", - ///fecore, 1000 ore - "fecore", - ///Picore, one million ore - "picore", - ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices. - "nacore", - ///Μcore, 10^12 ore or 1 μCore - "mcore", - ///micore, 10^15 ore or 1 mcore - "micore", - "core", -]; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit - * - */ -function formatUnits(value, unit) { - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromValue(value, decimals, { decimals }).toString(); -} -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit. - */ -const scientificToDecimal = (num) => { - // @ts-ignore - var nsign = Math.sign(num); - //remove the sign - // @ts-ignore - num = Math.abs(num); - //if the number is in scientific notation remove it - // @ts-ignore - if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) { - var zero = "0", - // @ts-ignore - parts = String(num).toLowerCase().split("e"), //split into coeff and exponent - e = parts.pop(), //store the exponential part - // @ts-ignore - l = Math.abs(e), //get the number of zeros - // @ts-ignore - sign = e / l, coeff_array = parts[0].split("."); - if (sign === -1) { - l = l - coeff_array[0].length; - if (l < 0) { - // @ts-ignore - num = - coeff_array[0].slice(0, l) + - "." + - coeff_array[0].slice(l) + - (coeff_array.length === 2 ? coeff_array[1] : ""); - } - else { - // @ts-ignore - num = zero + "." + new Array(l + 1).join(zero) + coeff_array.join(""); - } - } - else { - var dec = coeff_array[1]; - if (dec) - l = l - dec.length; - if (l < 0) { - // @ts-ignore - num = coeff_array[0] + dec.slice(0, l) + "." + dec.slice(l); - } - else { - // @ts-ignore - num = coeff_array.join("") + new Array(l + 1).join(zero); - } - } - } - // @ts-ignore - return nsign < 0 ? "-" + num : num; -}; -const trimDecimals = (n, decimals = 18) => { - n += ""; - if (n.indexOf(".") === -1) - return n; - const arr = n.split("."); - const fraction = arr[1].substr(0, decimals); - return arr[0] + "." + fraction; -}; -function parseUnits(value, unit) { - assertArgument(typeof value === "string", "value must be a string", "value", value); - if (value.includes("e")) { - value = scientificToDecimal(value).toString(); - } - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - value = trimDecimals(value, decimals); - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - value = trimDecimals(value, decimals); - } - return FixedNumber.fromString(value, { decimals }).value; -} -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -function formatXCB(ore) { - return formatUnits(ore, 18); -} -/** - * Converts the //decimal string// %%xcb%% to a BigInt, using 18 - * decimal places. - */ -function parseXCB(xcb) { - return parseUnits(xcb, 18); -} - -/** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -function uuidV4(randomBytes) { - const bytes = getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} - -var pbkdf2$2 = {}; - -var hasRequiredPbkdf2; - -function requirePbkdf2 () { - if (hasRequiredPbkdf2) return pbkdf2$2; - hasRequiredPbkdf2 = 1; - - const assert = requireAssert(); - const crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto || {}; - const subtle = crypto.subtle || {}; - - /** - * Perform key derivation using PBKDF2. - * @param {Function} hash - * @param {Buffer} pass - * @param {Buffer} salt - * @param {Number} iter - * @param {Number} len - * @returns {Buffer} - */ - - function derive(hash, pass, salt, iter, len) { - if (typeof pass === 'string') - pass = bufferExports.Buffer.from(pass, 'utf8'); - - if (typeof salt === 'string') - salt = bufferExports.Buffer.from(salt, 'utf8'); - - if (salt == null) - salt = bufferExports.Buffer.alloc(0); - - assert(hash && typeof hash.id === 'string'); - assert(bufferExports.Buffer.isBuffer(pass)); - assert(bufferExports.Buffer.isBuffer(salt)); - assert((iter >>> 0) === iter); - assert((len >>> 0) === len); - - const size = hash.size; - const blocks = Math.ceil(len / size); - const out = bufferExports.Buffer.alloc(blocks * size); - const state = bufferExports.Buffer.alloc(salt.length + 4); - - salt.copy(state, 0); - - // Preemptively shorten key. - if (pass.length > hash.blockSize) { - pass = hash.digest(pass); - assert(pass.length <= hash.blockSize); - } - - for (let i = 0; i < blocks; i++) { - const round = i + 1; - - state[salt.length + 0] = round >>> 24; - state[salt.length + 1] = round >>> 16; - state[salt.length + 2] = round >>> 8; - state[salt.length + 3] = round; - - const block = hash.mac(state, pass); - - let mac = block; - - for (let j = 1; j < iter; j++) { - mac = hash.mac(mac, pass); - - for (let k = 0; k < size; k++) - block[k] ^= mac[k]; - } - - block.copy(out, i * size); - } - - return out.slice(0, len); - } - - /** - * Execute pbkdf2 asynchronously. - * @param {Function} hash - * @param {Buffer} pass - * @param {Buffer} salt - * @param {Number} iter - * @param {Number} len - * @returns {Promise} - */ - - async function deriveAsync(hash, pass, salt, iter, len) { - if (typeof pass === 'string') - pass = bufferExports.Buffer.from(pass, 'utf8'); - - if (typeof salt === 'string') - salt = bufferExports.Buffer.from(salt, 'utf8'); - - if (salt == null) - salt = bufferExports.Buffer.alloc(0); - - assert(hash && typeof hash.id === 'string'); - assert(bufferExports.Buffer.isBuffer(pass)); - assert(bufferExports.Buffer.isBuffer(salt)); - assert((iter >>> 0) === iter); - assert((len >>> 0) === len); - - const name = getHash(hash); - - if (!subtle.importKey || !subtle.deriveBits || !name) - return derive(hash, pass, salt, iter, len); - - const algo = { name: 'PBKDF2' }; - const use = ['deriveBits']; - - const options = { - name: 'PBKDF2', - salt: salt, - iterations: iter, - hash: name - }; - - const key = await subtle.importKey('raw', pass, algo, false, use); - const out = await subtle.deriveBits(options, key, len * 8); - - return bufferExports.Buffer.from(out); - } - - /* - * Helpers - */ - - function getHash(hash) { - switch (hash.id) { - case 'SHA1': - return 'SHA-1'; - case 'SHA256': - return 'SHA-256'; - case 'SHA384': - return 'SHA-384'; - case 'SHA512': - return 'SHA-512'; - default: - return null; - } - } - - /* - * Expose - */ - - pbkdf2$2.native = 0; - pbkdf2$2.derive = derive; - pbkdf2$2.deriveAsync = deriveAsync; - return pbkdf2$2; -} - -/*! - * pbkdf2.js - pbkdf2 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var pbkdf2Browser; -var hasRequiredPbkdf2Browser; - -function requirePbkdf2Browser () { - if (hasRequiredPbkdf2Browser) return pbkdf2Browser; - hasRequiredPbkdf2Browser = 1; - - pbkdf2Browser = requirePbkdf2(); - return pbkdf2Browser; -} - -var pbkdf2BrowserExports = requirePbkdf2Browser(); -var pbkdf2$1 = /*@__PURE__*/getDefaultExportFromCjs(pbkdf2BrowserExports); - -var sha3; -var hasRequiredSha3; - -function requireSha3 () { - if (hasRequiredSha3) return sha3; - hasRequiredSha3 = 1; - - const Keccak = requireKeccak(); - - /** - * SHA3 - */ - - class SHA3 extends Keccak { - constructor() { - super(); - } - - final() { - return super.final(0x06, null); - } - - static hash() { - return new SHA3(); - } - - static hmac(bits) { - return super.hmac(bits, 0x06, null); - } - - static digest(data, bits) { - return super.digest(data, bits, 0x06, null); - } - - static root(left, right, bits) { - return super.root(left, right, bits, 0x06, null); - } - - static multi(x, y, z, bits) { - return super.multi(x, y, z, bits, 0x06, null); - } - - static mac(data, key, bits) { - return super.mac(data, key, bits, 0x06, null); - } - } - - /* - * Static - */ - - SHA3.native = 0; - SHA3.id = 'SHA3_256'; - SHA3.size = 32; - SHA3.bits = 256; - SHA3.blockSize = 136; - SHA3.zero = bufferExports.Buffer.alloc(32, 0x00); - SHA3.ctx = new SHA3(); - - /* - * Expose - */ - - sha3 = SHA3; - return sha3; -} - -/*! - * sha3.js - sha3 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - -var sha3Browser; -var hasRequiredSha3Browser; - -function requireSha3Browser () { - if (hasRequiredSha3Browser) return sha3Browser; - hasRequiredSha3Browser = 1; - - sha3Browser = requireSha3(); - return sha3Browser; -} - -var sha3512; -var hasRequiredSha3512; - -function requireSha3512 () { - if (hasRequiredSha3512) return sha3512; - hasRequiredSha3512 = 1; - - const SHA3 = requireSha3Browser(); - - /** - * SHA3-512 - */ - - class SHA3_512 extends SHA3 { - constructor() { - super(); - } - - init() { - return super.init(512); - } - - static hash() { - return new SHA3_512(); - } - - static hmac() { - return super.hmac(512); - } - - static digest(data) { - return super.digest(data, 512); - } - - static root(left, right) { - return super.root(left, right, 512); - } - - static multi(x, y, z) { - return super.multi(x, y, z, 512); - } - - static mac(data, key) { - return super.mac(data, key, 512); - } - } - - /* - * Static - */ - - SHA3_512.native = SHA3.native; - SHA3_512.id = 'SHA3_512'; - SHA3_512.size = 64; - SHA3_512.bits = 512; - SHA3_512.blockSize = 72; - SHA3_512.zero = bufferExports.Buffer.alloc(64, 0x00); - SHA3_512.ctx = new SHA3_512(); - - /* - * Expose - */ - - sha3512 = SHA3_512; - return sha3512; -} - -var sha3512Exports = requireSha3512(); -var SHA3_512 = /*@__PURE__*/getDefaultExportFromCjs(sha3512Exports); - -class Ed448Goldilock { - static _channel = ed448; - static generatePrivateKey() { - var privateKey = ed448.privateKeyGenerate(); - privateKey[56] &= 0x7f; - return privateKey; - } - static getPublicKeyFromPrivateKey(privateKey) { - var secret = bufferExports.Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var scalar = secret.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - var publicKey = this._channel.publicKeyFromScalar(scalar); - return bufferExports.Buffer.from(publicKey).toString("hex"); - } - else { - var publicKey = this._channel.publicKeyCreate(secret); - return bufferExports.Buffer.from(publicKey).toString("hex"); - } - } - static signWithPrivateKey(privateKey, msg) { - var msgToSign = bufferExports.Buffer.from(msg, "hex"); - var secret = bufferExports.Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var prefix = secret.slice(0, 57); - prefix[0] &= 0xfc; - prefix[56] = 0; - prefix[55] |= 0x80; - var scalar = prefix.slice(0, 56); - var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return bufferExports.Buffer.from(signedMessage).toString("hex"); - } - else { - var signedMessage = this._channel.sign(msgToSign, secret); - return bufferExports.Buffer.from(signedMessage).toString("hex"); - } - } - static signWithPrivateKeyNConcatPubkey(privateKey, msg) { - var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); - var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); - return signedMessage + publicKey; - } - static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(bufferExports.Buffer.from(msgHash, "hex"), bufferExports.Buffer.from(signedMsg, "hex"), bufferExports.Buffer.from(pubKey, "hex")); - } - static SHA512Hash(password, salt) { - var p1 = bufferExports.Buffer.from(password, "hex"); - var s1 = bufferExports.Buffer.from(salt, "hex"); - return bufferExports.Buffer.from(pbkdf2$1.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); - } - static concatenateAndHex(prefix, key, index, salt) { - var ind = bufferExports.Buffer.alloc(4); - var p = bufferExports.Buffer.alloc(1); - p[0] = prefix % 256; - var j = index; - for (let i = 0; i < 4; i++) { - ind[i] = j % 256; - j = Math.floor(j / 256); - } - var t = p.toString("hex") + key + ind.toString("hex"); - return Ed448Goldilock.SHA512Hash(t, salt); - } - static addScalar(a, b) { - var a1 = bufferExports.Buffer.from(a, "hex"); - var b1 = bufferExports.Buffer.from(b.substr(0, 106) + "00000000", "hex"); - b1[0] &= 0xfc; - var c = bufferExports.Buffer.alloc(57); - var hold = 0; - for (let i = 0; i < 57; i++) { - hold += a1[i] + b1[i]; - c[i] = hold % 256; - hold = Math.floor(hold / 256); - } - return c.toString("hex"); - } - static seedToExtendedPrivate(seed) { - var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); - var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = bufferExports.Buffer.from(s2, "hex"); - b[56] |= 0x80; - b[55] |= 0x80; - b[55] &= 0xbf; - var s3 = b.toString("hex"); - return s1 + s3; - } - static childPrivateToPrivate(s, index) { - var s0 = s.substr(0, 114); - var s1 = s.substr(114, 228); - var r0, r1; - if (index >= 0x80000000) { - r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - else { - var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); - r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - } - static HDWalletGenerateKeyFromSeed(seed, index) { - var m = Ed448Goldilock.seedToExtendedPrivate(seed); - var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); - var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); - var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); - var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); - var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); - return k5.substr(114, 228); - } -} - -/* Browser Crypto Shims */ -function getGlobal$1() { - if (typeof globalThis !== "undefined") - return globalThis; - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); -} -const anyGlobal = getGlobal$1(); -const crypto = anyGlobal.crypto || anyGlobal.msCrypto; -function createHash(algo) { - switch (algo) { - case "ripemd160": - return ripemd160$1.create(); - case "sha256": - return sha256$2.create(); - case "sha512": - return sha512$1.create(); - case "sha3-256": - return sha3_256.create(); - case "sha3-512": - return sha3_512.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); -} -function createHmac(_algo, key) { - const algo = { sha256: sha256$2, sha512: sha512$1, "sha3-256": sha3_256, "sha3-512": sha3_512 }[_algo]; - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac$1.create(algo, key); -} -function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = { sha256: sha256$2, sha512: sha512$1 }[_algo]; - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2$3(algo, password, salt, { c: iterations, dkLen: keylen }); -} -function randomBytes$1(length) { - assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes", - }); - assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; -} - -const _sha256 = (data) => hexlify(createHash("sha3-256").update(data).digest()); -const _sha512 = (data) => hexlify(createHash("sha3-512").update(data).digest()); -let __sha256 = _sha256; -let __sha512 = _sha512; -let locked256 = false, locked512 = false; -/** - * Compute the cryptographic SHA3-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -var SupportedAlgorithm; -(function (SupportedAlgorithm) { - SupportedAlgorithm["sha256"] = "sha256"; - SupportedAlgorithm["sha512"] = "sha512"; -})(SupportedAlgorithm || (SupportedAlgorithm = {})); -function sha256(data) { - return hexlify(__sha256(getBytes(data))); -} -function legacySha256(data) { - const _data = getBytes(data, "data"); - const hexlified = hexlify(createHash("sha256").update(_data).digest()); - return hexlified; -} -sha256._ = _sha256; -sha256.lock = function () { - locked256 = true; -}; -sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; -}; -Object.freeze(sha256); -/** - * Compute the cryptographic SHA3-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -function sha512(data) { - return hexlify(__sha512(getBytes(data))); -} -sha512._ = _sha512; -sha512.lock = function () { - locked512 = true; -}; -sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; -}; -Object.freeze(sha512); - -/** - * Addresses are a fundamental part of interacting with Core. They - * represent the gloabal identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Core Naming Service (CNS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -const logger$3 = new Logger("address/0.0.1"); -const precompiledAddresses = [ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000002", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000005", - "0000000000000000000000000000000000000000000000000000000000000006", - "0000000000000000000000000000000000000000000000000000000000000007", - "0000000000000000000000000000000000000000000000000000000000000008", - "0000000000000000000000000000000000000000000000000000000000000009", -]; -function removeHexPrefix$1(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; -} -function calculateCheckSum(_address, _prefix) { - const address = getBytes("0x" + _address.replace("0x", "")); - const prefix = getBytes("0x" + _prefix.replace("0x", "")); - const tmpConcated = new Uint8Array([...address, ...prefix]); - const hexedConcat = hexlify(tmpConcated).replace("0x", "") + "00"; - const mods = Array.from(hexedConcat.toUpperCase(), (c) => { - const charCode = c.charCodeAt(0); - return charCode > 64 && charCode < 91 - ? (charCode - 55).toString() - : (charCode - 48).toString(); - }).join(""); - const bigVal = BigInt(mods); - const val97 = BigInt(97); - const val98 = BigInt(98); - const remainder = bigVal % val97; - const checkSum = val98 - remainder; - const result = checkSum > 9 ? checkSum.toString() : "0" + checkSum.toString(); - return result; -} -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Core uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -function getAddress(address) { - if (typeof address !== "string") { - logger$3.throwArgumentError("invalid address", "address", address); - } - if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) { - logger$3.throwArgumentError("invalid address", "address", address); - } - const raw = removeHexPrefix$1(address); - if (precompiledAddresses.includes(raw)) { - return "0x" + raw; - } - const prefix = raw.substring(0, 2); - const val = raw.substring(4); - const checksum = calculateCheckSum(val, prefix); - if (checksum !== raw.substring(2, 4)) { - logger$3.throwArgumentError("bad address checksum", "address", address); - } - return "0x" + prefix + checksum + val; -} -function networkIdToPrefix(networkId) { - if (networkId == 1) { - return "cb"; - } - else if (networkId == 3 || networkId == 4) { - return "ab"; - } - else if (networkId > 10 || networkId == 0) { - return "ce"; - } - else { - logger$3.throwArgumentError("bad networkId", "networkId", networkId); - return ""; - } -} - -/** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ -let locked$4 = false; -const _computeHmac = function (algorithm, key, data) { - return createHmac(algorithm, key).update(data).digest(); -}; -let __computeHmac = _computeHmac; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -function computeHmac(algorithm, _key, _data) { - const key = getBytes(_key, "key"); - const data = getBytes(_data, "data"); - return hexlify(__computeHmac(algorithm, key, data)); -} -computeHmac._ = _computeHmac; -computeHmac.lock = function () { - locked$4 = true; -}; -computeHmac.register = function (func) { - if (locked$4) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; -}; -Object.freeze(computeHmac); - -let locked$3 = false; -const _ripemd160 = function (data) { - return ripemd160$1(data); -}; -let __ripemd160 = _ripemd160; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -function ripemd160(_data) { - const data = getBytes(_data, "data"); - return hexlify(__ripemd160(data)); -} -ripemd160._ = _ripemd160; -ripemd160.lock = function () { - locked$3 = true; -}; -ripemd160.register = function (func) { - if (locked$3) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; -}; -Object.freeze(ripemd160); - -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -let locked$2 = false; -const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return pbkdf2Sync(password, salt, iterations, keylen, algo); -}; -let __pbkdf2 = _pbkdf2; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); -} -pbkdf2._ = _pbkdf2; -pbkdf2.lock = function () { - locked$2 = true; -}; -pbkdf2.register = function (func) { - if (locked$2) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; -}; -Object.freeze(pbkdf2); - -/** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ -let locked$1 = false; -const _randomBytes = function (length) { - return new Uint8Array(randomBytes$1(length)); -}; -let __randomBytes = _randomBytes; -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -function randomBytes(length) { - return __randomBytes(length); -} -randomBytes._ = _randomBytes; -randomBytes.lock = function () { - locked$1 = true; -}; -randomBytes.register = function (func) { - if (locked$1) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; -}; -Object.freeze(randomBytes); - -/** - * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. - * @module - */ -// The main Scrypt loop: uses Salsa extensively. -// Six versions of the function were tried, this is the fastest one. -// RFC 7914 §3 / §4 step 2 applies Salsa20/8 to one 16-word (64-byte) block -// after xor'ing two such blocks. -// The local `y*` snapshot keeps the xor input stable even when `out` aliases `prev` or `input`. -// prettier-ignore -function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html and RFC 7914's Salsa20/8 core. - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; -} -function BlockMix(input, ii, out, oi, r) { - // The block B is `r` 128-byte chunks, i.e. `2r` 16-word (64-byte) Salsa blocks. - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // RFC 7914 §4 step 3 outputs `Y[0], Y[2], ...` first, then `Y[1], Y[3], ...`; - // `head` and `tail` lay out those even/odd halves in place. - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - XorAndSalsa(out, head, input, (ii += 16), out, tail); - } -} -// 128*r*(N+p+1) for N=2**20, r=8, p=1: 1 GiB main table plus 2 KiB workspace. -const SCRYPT_DEFAULT_MAXMEM = 128 * 8 * (2 ** 20 + 1 + 1); -// Common prologue and epilogue for sync/async functions -function scryptInit(password, salt, _opts) { - const opts = checkOpts({ - dkLen: 32, - asyncTick: 10, - maxmem: SCRYPT_DEFAULT_MAXMEM, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - anumber(N, 'N'); - anumber(r, 'r'); - anumber(p, 'p'); - anumber(dkLen, 'dkLen'); - anumber(asyncTick, 'asyncTick'); - anumber(maxmem, 'maxmem'); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('"onProgress" must be a function'); - // Without this, r=0 slips through: blockSize=0 turns the `p` upper bound into - // Infinity and the failure surfaces later as a confusing pbkdf2 dkLen error. - if (r < 1) - throw new Error('"r" expected integer >= 1'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - // Max N is 2^32 (Integrify is 32-bit). - // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB. - // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, - // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: - // https://www.rfc-editor.org/errata_search.php?rfc=7914 - const pow32 = Math.pow(2, 32); - if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) - throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32'); - if (p < 1 || p > ((pow32 - 1) * 32) / blockSize) - throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)'); - // RFC 7914 §2 defines `dkLen` as a positive integer. - if (dkLen < 1 || dkLen > (pow32 - 1) * 32) - throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32'); - // Include the shared `tmp` scratch block so `maxmem` matches noble's actual temporary allocation. - // Node requires more headroom here, so this accounting is intentionally noble-specific. - const memUsed = blockSize * (N + p + 1); - if (memUsed > maxmem) - throw new Error('"maxmem" limit was hit: memUsed(128*r*(N+p+1))=' + memUsed + ', maxmem=' + maxmem); - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2$3(sha256$2, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) { - // Wiping here instead of a try/catch around the main loops keeps them - // try-free: measured ~1% slower at N=2^21 with the loops inside a try. - // onProgress is the only user code that can throw mid-derivation. - try { - onProgress(blockMixCnt / totalBlockMix); - } - catch (e) { - clean(B, V, tmp); - throw e; - } - } - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; -} -function scryptOutput(password, dkLen, B, V, tmp) { - // Shared final PBKDF2-and-cleanup step: keep the derived key, wipe the scrypt workspace. - const res = pbkdf2$3(sha256$2, password, B, { c: 1, dkLen }); - clean(B, V, tmp); - return res; -} -/** - * Scrypt KDF from RFC 7914. See {@link ScryptOpts}. - * @param password - password or key material to derive from; - * JS string inputs are UTF-8 encoded first - * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first - * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided, - * must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}. - * @returns Derived key bytes. - * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error} - * @example - * Derive a key with scrypt. - * ```ts - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - * ``` - * @example - * Derive a key with small demo costs and progress/memory controls. - * ```ts - * const progressLog: number[] = []; - * scrypt('password', 'salt', { - * N: 16, - * r: 8, - * p: 1, - * dkLen: 32, - * maxmem: 1024 * 1024, - * asyncTick: 10, - * onProgress(progress) { - * progressLog.push(progress); - * }, - * }); - * ``` - */ -function scrypt$1(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N - // only depends on the low word here because N is a power of two and - // this implementation caps N at 2^32. - // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked - // above; >>> 0 for unsigned, input fits in u32. - const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations - // tmp = B ^ V[j] - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} -/** - * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}. - * @param password - password or key material to derive from; - * JS string inputs are UTF-8 encoded first - * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first - * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided, - * must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local - * scheduler-yield control for this JS wrapper, not part of RFC 7914. - * See {@link ScryptOpts}. - * @returns Promise resolving to derived key bytes. - * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error} - * @example - * Derive a key with scrypt asynchronously. - * ```ts - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - * ``` - * @example - * Derive a key asynchronously with small demo costs and progress/memory controls. - * ```ts - * await scryptAsync('password', 'salt', { - * N: 16, - * r: 8, - * p: 1, - * dkLen: 32, - * maxmem: 1024 * 1024, - * asyncTick: 1, - * onProgress(progress) { - * if (progress > 1) throw new Error('invalid progress'); - * }, - * }); - * ``` - */ -async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - // One failure handler covers both yield boundaries without putting the hot loops in a try block. - const abort = () => clean(B, V, tmp); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }, abort); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N - // only depends on the low word here because N is a power of two and - // this implementation caps N at 2^32. - // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked - // above; >>> 0 for unsigned, input fits in u32. - const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations - // tmp = B ^ V[j] - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }, abort); - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); -} - -let lockedSync = false, lockedAsync = false; -const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await scryptAsync(passwd, salt, { N, r, p, dkLen, onProgress }); -}; -const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return scrypt$1(passwd, salt, { N, r, p, dkLen }); -}; -let __scryptAsync = _scryptAsync; -let __scryptSync = _scryptSync; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); -} -scrypt._ = _scryptAsync; -scrypt.lock = function () { - lockedAsync = true; -}; -scrypt.register = function (func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; -}; -Object.freeze(scrypt); -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(__scryptSync(passwd, salt, N, r, p, dkLen)); -} -scryptSync._ = _scryptSync; -scryptSync.lock = function () { - lockedSync = true; -}; -scryptSync.register = function (func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; -}; -Object.freeze(scryptSync); - -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -let locked = false; -const _keccak256 = function (data) { - return keccak_256(data); -}; -let __keccak256 = _keccak256; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -function keccak256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); -} -keccak256._ = _keccak256; -keccak256.lock = function () { - locked = true; -}; -keccak256.register = function (func) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; -}; -Object.freeze(keccak256); - -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -const logger$2 = new Logger("signing-key/0.0.1"); -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -class SigningKey { - #privateKey; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - const normalized = typeof privateKey === "string" && !privateKey.startsWith("0x") - ? "0x" + privateKey - : privateKey; - assertArgument(dataLength(normalized) === 57, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify(normalized); - } - /** - * The private key. - */ - get privateKey() { - return this.#privateKey; - } - /** The 57-byte Ed448 public key encoded as hex. */ - get publicKey() { - return SigningKey.computePublicKey(this.#privateKey); - } - /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ - get compressedPublicKey() { - return SigningKey.computePublicKey(this.#privateKey, true); - } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest) { - const key = getBytesCopy(this.#privateKey); - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const keyBuffer = new Uint8Array(arrayify(key)); - if (keyBuffer.length !== 57) { - logger$2.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - const digestBuffer = new Uint8Array(arrayify(digest)); - if (digestBuffer.length !== 32) { - logger$2.throwArgumentError("bad digest length", "digest", digest); - } - if (keyBuffer[56] > 127) { - const prefix = keyBuffer.slice(0, 57); - prefix[0] &= 0xfc; - prefix[55] |= 0x80; - prefix[56] = 0; - const scalar = prefix.slice(0, 56); - const bufferDigest = bufferExports.Buffer.from(digestBuffer); - const bufferPrfx = bufferExports.Buffer.from(prefix); - const bufferScalar = bufferExports.Buffer.from(scalar); - const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - const sig = ed448.sign(bufferExports.Buffer.from(digestBuffer), bufferExports.Buffer.from(keyBuffer)); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ - computeSharedSecret(other) { - const pub = bufferExports.Buffer.from(getBytesCopy(other)); - assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), "invalid public key", "other", other); - const key = bufferExports.Buffer.from(getBytesCopy(this.#privateKey)); - if (key[56] > 127) { - const scalar = key.subarray(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - return hexlify(ed448.deriveWithScalar(pub, scalar)); - } - return hexlify(ed448.derive(pub, key)); - } - /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ - static computePublicKey(key, compressed) { - const bytes = bufferExports.Buffer.from(arrayify(key)); - if (bytes.length !== 57) { - logger$2.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - if (bytes[56] > 127) { - const scalar = bytes.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - const pub = ed448.publicKeyFromScalar(scalar); - return hexlify(pub); - } - const pub = ed448.publicKeyCreate(bytes); - return hexlify(pub); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest, signature) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const digestBuffer = bufferExports.Buffer.from(arrayify(digest)); - const sigBuffer = bufferExports.Buffer.from(arrayify(signature)); - if (sigBuffer.length !== 171) { - logger$2.throwArgumentError("invalid signature", "signature", signature); - } - const sig = sigBuffer.slice(0, 114); - const pub = sigBuffer.slice(114); - if (ed448.verify(digestBuffer, sig, pub)) { - return hexlify(pub); - } - logger$2.throwArgumentError("invalid signature", "signature", signature); - return ""; - } - /** Adds two encoded Ed448 public points. The compression flag is ignored. */ - static addPoints(p0, p1, compressed) { - const points = [p0, p1].map((point) => { - const bytes = bufferExports.Buffer.from(getBytesCopy(point)); - assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), "invalid public key", "point", point); - return bytes; - }); - return hexlify(ed448.publicKeyCombine(points)); - } -} - -// Constants -const BN_0$6 = BigInt(0); -const BN_1$3 = BigInt(1); -const BN_2$1 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const _guard$4 = {}; -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -class Signature { - #r; - #s; - #v; - #networkV; - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { - return this.#r; - } - set r(value) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - this.#r = hexlify(value); - } - /** - * The ``s`` value for a signature. - */ - get s() { - return this.#s; - } - set s(_value) { - assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); - const value = hexlify(_value); - assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); - this.#s = value; - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { - return this.#v; - } - set v(value) { - const v = getNumber(value, "value"); - assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { - return this.#networkV; - } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacynetworkId() { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getnetworkId(v); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return this.v === 27 ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - // The EIP-2098 compact representation - const yParityAndS = getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return hexlify(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return concat([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); - } - /** - * @private - */ - constructor(guard, r, s, v) { - assertPrivate(guard, _guard$4, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - [Symbol.for("nodejs.util.inspect.custom")]() { - return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone = new Signature(_guard$4, this.r, this.s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: networkV != null ? networkV.toString() : null, - r: this.r, - s: this.s, - v: this.v, - }; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getnetworkId(45) - * //_result: - * - * Signature.getnetworkId(46) - * //_result: - */ - static getnetworkId(v) { - const bv = getBigInt(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if (bv == BN_27 || bv == BN_28) { - return BN_0$6; - } - // Bad value for an EIP-155 v - assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); - return (bv - BN_35) / BN_2$1; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getnetworkIdV(5, 27) - * //_result: - * - * Signature.getnetworkIdV(5, 28) - * //_result: - * - */ - static getnetworkIdV(networkId, v) { - return getBigInt(networkId) * BN_2$1 + BigInt(35 + v - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v) { - const bv = getBigInt(v); - if (bv === BN_0$6 || bv === BN_27) { - return 27; - } - if (bv === BN_1$3 || bv === BN_28) { - return 28; - } - assertArgument(bv >= BN_35, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return bv & BN_1$3 ? 27 : 28; - } -} - -/** - * A fundamental building block of Core is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -function lock() { - computeHmac.lock(); - pbkdf2.lock(); - randomBytes.lock(); - ripemd160.lock(); - scrypt.lock(); - scryptSync.lock(); - sha256.lock(); - sha512.lock(); - randomBytes.lock(); -} - -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -function removeHexPrefix(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; -} -function publicToAddress(key, prefix) { - const val = hexDataSlice(sha256(key), 12); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); -} -function computeAddress(key, prefix) { - let pubkey; - if (typeof key === "string") { - pubkey = SigningKey.computePublicKey(key, false); - } - else { - pubkey = key.publicKey; - } - return publicToAddress(pubkey, prefix); // getAddress(sha256("0x" + pubkey.substring(4)).substring(26)); -} -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -function recoverAddress(digest, signature, prefix) { - // return computeAddress(SigningKey.recoverPublicKey(digest, signature)); - const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature); - return publicToAddress(publicKey, prefix); -} -function extractPrefix(address) { - address = getAddress(address); - return address.substring(2, 4); -} - -/** - * @_ignore: - */ -const WordSize = 32; -const Padding = new Uint8Array(WordSize); -// Properties used to immediate pass through to the underlying object -// - `then` is used to detect if an object is a Promise for await -const passProperties$1 = ["then"]; -const _guard$3 = {}; -function throwError(name, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); - wrapped.error = error; - throw wrapped; -} -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -class Result extends Array { - #names; - /** - * @private - */ - constructor(...args) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap = true; - if (guard !== _guard$3) { - items = args; - names = []; - wrap = false; - } - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { - this[index] = item; - }); - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof name === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, new Map()); - // Remove any key thats not unique - this.#names = Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - })); - if (!wrap) { - return; - } - // A wrapped Result is immutable - Object.freeze(this); - // Proxy indices and names so we can trap deferred errors - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof prop === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - // Pass important checks (like `then` for Promise) through - if (passProperties$1.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (...args) { - return value.apply(this === receiver ? target : this, args); - }; - } - else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply(this === receiver ? target : this, [ - prop, - ]); - } - } - return Reflect.get(target, prop, receiver); - }, - }); - } - /** - * Returns the Result as a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray() { - const result = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject() { - return this.#names.reduce((accum, name, index) => { - assert(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", { - operation: "toObject()", - }); - // Add values for names that don't conflict - if (!(name in accum)) { - accum[name] = this.getValue(name); - } - return accum; - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const result = [], names = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(this.#names[i]); - } - return new Result(_guard$3, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const result = [], names = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(this.#names[i]); - } - } - return new Result(_guard$3, result, names); - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name) { - const index = this.#names.indexOf(name); - if (index === -1) { - return undefined; - } - const value = this[index]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys) { - return new Result(_guard$3, items, keys); - } -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -function checkResultErrors(result) { - // Find the first error (if any) - const errors = []; - const checkErrors = function (path, object) { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - try { - checkErrors(childPath, object[key]); - } - catch (error) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - return errors; -} -function getValue$1(value) { - let bytes = toBeArray(value); - assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: WordSize, - offset: bytes.length, - }); - if (bytes.length !== WordSize) { - bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes])); - } - return bytes; -} -/** - * @_ignore - */ -class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - name; - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - type; - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - localName; - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - dynamic; - constructor(name, type, localName, dynamic) { - defineProperties(this, { name, type, localName, dynamic }, { - name: "string", - type: "string", - localName: "string", - dynamic: "boolean", - }); - } - _throwError(message, value) { - assertArgument(false, message, this.localName, value); - } -} -/** - * @_ignore - */ -class Writer { - // An array of WordSize lengthed objects to concatenation - #data; - #dataLength; - constructor() { - this.#data = []; - this.#dataLength = 0; - } - get data() { - return concat(this.#data); - } - get length() { - return this.#dataLength; - } - #writeData(data) { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - appendWriter(writer) { - return this.#writeData(getBytesCopy(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes = getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return this.#writeData(getValue$1(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value) => { - this.#data[offset] = getValue$1(value); - }; - } -} -/** - * @_ignore - */ -class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - allowLoose; - #data; - #offset; - constructor(data, allowLoose) { - defineProperties(this, { allowLoose: !!allowLoose }); - this.#data = getBytesCopy(data); - this.#offset = 0; - } - get data() { - return hexlify(this.#data); - } - get dataLength() { - return this.#data.length; - } - get consumed() { - return this.#offset; - } - get bytes() { - return new Uint8Array(this.#data); - } - #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && - loose && - this.#offset + length <= this.#data.length) { - alignedLength = length; - } - else { - assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength, - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset) { - return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose); - } - // Read bytes - readBytes(length, loose) { - let bytes = this.#peekBytes(0, length, !!loose); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - // Read a numeric values - readValue() { - return toBigInt(this.readBytes(WordSize)); - } - readIndex() { - return toNumber(this.readBytes(WordSize)); - } -} - -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -const _gaurd = {}; -function n(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { - signed, - width, - }); -} -function b(value, size) { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size }); -} -const _typedSymbol = Symbol.for("_corebc_typed"); -class Typed { - type; - value; - #options; - _typedSymbol; - constructor(gaurd, type, value, options) { - if (options == null) { - options = null; - } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - // Check the value is valid - this.format(); - } - format() { - if (this.type === "array") { - throw new Error(""); - } - else if (this.type === "dynamicArray") { - throw new Error(""); - } - else if (this.type === "tuple") { - return `tuple(${this.value.map((v) => v.format()).join(",")})`; - } - return this.type; - } - defaultValue() { - return 0; - } - minValue() { - return 0; - } - maxValue() { - return 0; - } - isBigInt() { - return !!this.type.match(/^u?int[0-9]+$/); - } - isData() { - return this.type.startsWith("bytes"); - } - isString() { - return this.type === "string"; - } - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return this.value.length; - } - return null; - } - static from(type, value) { - return new Typed(_gaurd, type, value); - } - static uint8(v) { - return n(v, 8); - } - static uint16(v) { - return n(v, 16); - } - static uint24(v) { - return n(v, 24); - } - static uint32(v) { - return n(v, 32); - } - static uint40(v) { - return n(v, 40); - } - static uint48(v) { - return n(v, 48); - } - static uint56(v) { - return n(v, 56); - } - static uint64(v) { - return n(v, 64); - } - static uint72(v) { - return n(v, 72); - } - static uint80(v) { - return n(v, 80); - } - static uint88(v) { - return n(v, 88); - } - static uint96(v) { - return n(v, 96); - } - static uint104(v) { - return n(v, 104); - } - static uint112(v) { - return n(v, 112); - } - static uint120(v) { - return n(v, 120); - } - static uint128(v) { - return n(v, 128); - } - static uint136(v) { - return n(v, 136); - } - static uint144(v) { - return n(v, 144); - } - static uint152(v) { - return n(v, 152); - } - static uint160(v) { - return n(v, 160); - } - static uint168(v) { - return n(v, 168); - } - static uint176(v) { - return n(v, 176); - } - static uint184(v) { - return n(v, 184); - } - static uint192(v) { - return n(v, 192); - } - static uint200(v) { - return n(v, 200); - } - static uint208(v) { - return n(v, 208); - } - static uint216(v) { - return n(v, 216); - } - static uint224(v) { - return n(v, 224); - } - static uint232(v) { - return n(v, 232); - } - static uint240(v) { - return n(v, 240); - } - static uint248(v) { - return n(v, 248); - } - static uint256(v) { - return n(v, 256); - } - static uint(v) { - return n(v, 256); - } - static int8(v) { - return n(v, -8); - } - static int16(v) { - return n(v, -16); - } - static int24(v) { - return n(v, -24); - } - static int32(v) { - return n(v, -32); - } - static int40(v) { - return n(v, -40); - } - static int48(v) { - return n(v, -48); - } - static int56(v) { - return n(v, -56); - } - static int64(v) { - return n(v, -64); - } - static int72(v) { - return n(v, -72); - } - static int80(v) { - return n(v, -80); - } - static int88(v) { - return n(v, -88); - } - static int96(v) { - return n(v, -96); - } - static int104(v) { - return n(v, -104); - } - static int112(v) { - return n(v, -112); - } - static int120(v) { - return n(v, -120); - } - static int128(v) { - return n(v, -128); - } - static int136(v) { - return n(v, -136); - } - static int144(v) { - return n(v, -144); - } - static int152(v) { - return n(v, -152); - } - static int160(v) { - return n(v, -160); - } - static int168(v) { - return n(v, -168); - } - static int176(v) { - return n(v, -176); - } - static int184(v) { - return n(v, -184); - } - static int192(v) { - return n(v, -192); - } - static int200(v) { - return n(v, -200); - } - static int208(v) { - return n(v, -208); - } - static int216(v) { - return n(v, -216); - } - static int224(v) { - return n(v, -224); - } - static int232(v) { - return n(v, -232); - } - static int240(v) { - return n(v, -240); - } - static int248(v) { - return n(v, -248); - } - static int256(v) { - return n(v, -256); - } - static int(v) { - return n(v, -256); - } - static bytes1(v) { - return b(v, 1); - } - static bytes2(v) { - return b(v, 2); - } - static bytes3(v) { - return b(v, 3); - } - static bytes4(v) { - return b(v, 4); - } - static bytes5(v) { - return b(v, 5); - } - static bytes6(v) { - return b(v, 6); - } - static bytes7(v) { - return b(v, 7); - } - static bytes8(v) { - return b(v, 8); - } - static bytes9(v) { - return b(v, 9); - } - static bytes10(v) { - return b(v, 10); - } - static bytes11(v) { - return b(v, 11); - } - static bytes12(v) { - return b(v, 12); - } - static bytes13(v) { - return b(v, 13); - } - static bytes14(v) { - return b(v, 14); - } - static bytes15(v) { - return b(v, 15); - } - static bytes16(v) { - return b(v, 16); - } - static bytes17(v) { - return b(v, 17); - } - static bytes18(v) { - return b(v, 18); - } - static bytes19(v) { - return b(v, 19); - } - static bytes20(v) { - return b(v, 20); - } - static bytes21(v) { - return b(v, 21); - } - static bytes22(v) { - return b(v, 22); - } - static bytes23(v) { - return b(v, 23); - } - static bytes24(v) { - return b(v, 24); - } - static bytes25(v) { - return b(v, 25); - } - static bytes26(v) { - return b(v, 26); - } - static bytes27(v) { - return b(v, 27); - } - static bytes28(v) { - return b(v, 28); - } - static bytes29(v) { - return b(v, 29); - } - static bytes30(v) { - return b(v, 30); - } - static bytes31(v) { - return b(v, 31); - } - static bytes32(v) { - return b(v, 32); - } - static address(v) { - return new Typed(_gaurd, "address", v); - } - static bool(v) { - return new Typed(_gaurd, "bool", !!v); - } - static bytes(v) { - return new Typed(_gaurd, "bytes", v); - } - static string(v) { - return new Typed(_gaurd, "string", v); - } - static array(v, dynamic) { - throw new Error("not implemented yet"); - } - static tuple(v, name) { - throw new Error("not implemented yet"); - } - static overrides(v) { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return value && value._typedSymbol === _typedSymbol; - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type) { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } -} - -/** - * @_ignore - */ -class AddressCoder extends Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value) { - let value = Typed.dereference(_value, "string"); - try { - value = getAddress(value); - } - catch (error) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - decode(reader) { - return getAddress(toBeHex(reader.readValue(), 22)); - } -} - -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -class AnonymousCoder extends Coder { - coder; - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } -} - -/** - * @_ignore - */ -function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } - else if (values && typeof values === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name = coder.localName; - assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name] = true; - return values[name]; - }); - } - else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - let updateFuncs = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } - else { - coder.encode(staticWriter, value); - } - }); - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { - func(staticWriter.length); - }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; -} -/** - * @_ignore - */ -function unpack(reader, coders) { - let values = []; - let keys = []; - // A reader anchored to this base - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - else { - try { - value = coder.decode(reader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == undefined) { - throw new Error("investigate"); - } - values.push(value); - keys.push(coder.localName || null); - }); - return Result.fromItems(values, keys); -} -/** - * @_ignore - */ -class ArrayCoder extends Coder { - coder; - length; - constructor(coder, length, localName) { - const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; - const dynamic = length === -1 || coder.dynamic; - super("array", type, localName, dynamic); - defineProperties(this, { coder, length }); - } - defaultValue() { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { - buffer: reader.bytes, - offset: count * WordSize, - length: reader.dataLength, - }); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } -} - -/** - * @_ignore - */ -class BooleanCoder extends Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } -} - -/** - * @_ignore - */ -class DynamicBytesCoder extends Coder { - constructor(type, localName) { - super(type, type, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } -} -/** - * @_ignore - */ -class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return hexlify(super.decode(reader)); - } -} - -/** - * @_ignore - */ -class FixedBytesCoder extends Coder { - size; - constructor(size, localName) { - let name = "bytes" + String(size); - super(name, name, localName, false); - defineProperties(this, { size }, { size: "number" }); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); - } - encode(writer, _value) { - let data = getBytesCopy(Typed.dereference(_value, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data); - } - decode(reader) { - return hexlify(reader.readBytes(this.size)); - } -} - -const Empty = new Uint8Array([]); -/** - * @_ignore - */ -class NullCoder extends Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } -} - -const BN_0$5 = BigInt(0); -const BN_1$2 = BigInt(1); -const BN_MAX_UINT256$1 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * @_ignore - */ -class NumberCoder extends Coder { - size; - signed; - constructor(size, signed, localName) { - const name = (signed ? "int" : "uint") + size * 8; - super(name, name, localName, false); - defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value) { - let value = getBigInt(Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = mask(BN_MAX_UINT256$1, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, this.size * 8 - 1); - if (value > bounds || value < -(bounds + BN_1$2)) { - this._throwError("value out-of-bounds", _value); - } - value = toTwos(value, 8 * WordSize); - } - else if (value < BN_0$5 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - return writer.writeValue(value); - } - decode(reader) { - let value = mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = fromTwos(value, this.size * 8); - } - return value; - } -} - -/** - * @_ignore - */ -class StringCoder extends DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value) { - return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); - } - decode(reader) { - return toUtf8String(super.decode(reader)); - } -} - -/** - * @_ignore - */ -class TupleCoder extends Coder { - coders; - constructor(coders, localName) { - let dynamic = false; - const types = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = "tuple(" + types.join(",") + ")"; - super("tuple", type, localName, dynamic); - defineProperties(this, { - coders: Object.freeze(coders.slice()), - }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, {}); - // Add named values - this.coders.forEach((coder, index) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } - if (name === "length") { - name = "_length"; - } - if (values[name] != null) { - return; - } - values[name] = values[index]; - }); - return Object.freeze(values); - } - encode(writer, _value) { - const value = Typed.dereference(_value, "tuple"); - return pack(writer, this.coders, value); - } - decode(reader) { - return unpack(reader, this.coders); - } -} - -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * - * @example: - * id("hello world") - * //_result: - */ -function id(value, useKeccak) { - if (useKeccak) { - return keccak256(toUtf8Bytes(value)); - } - return sha256(toUtf8Bytes(value)); -} - -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -const ZeroAddress = "0x0000000000000000000000000000000000000000"; - -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; - -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -/** - * A constant for the number of ore in a single xcb. - * - * (**i.e.** ``1000000000000000000n``) - */ -const OrePerXCB = BigInt("1000000000000000000"); -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * - BigInt(-1); -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - -// NFKC (composed) // (decomposed) -/** - * A constant for the core symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -const CoreSymbol = "\u039e"; // "\uD835\uDF63"; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Core Signed Message:\\n"``) - */ -const MessagePrefix = "\x19Core Signed Message:\n"; - -function accessSetify(addr, storageKeys) { - return { - address: getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); - return storageKey.toLowerCase(); - }), - }; -} -/** - * Returns a [[AccessList]] from any corebcsupported access-list structure. - */ -function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set, index) => { - if (Array.isArray(set)) { - assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); - return accessSetify(set[0], set[1]); - } - assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => a.address.localeCompare(b.address)); - return result; -} - -const logger$1 = new Logger("transaction/0.0.1"); -const BN_0$4 = BigInt(0); -function handleAddress(value) { - if (value === "0x") { - return null; - } - return getAddress(value); -} -function parse(data) { - const handleNumber = (value) => { - // @ts-ignore - if (value === "0x") { - return BigNumber.from(0); - } - return BigNumber.from(value); - }; - const transaction = decode$1(data); - if (transaction.length !== 7 && transaction.length !== 8) { - logger$1.throwArgumentError("invalid raw transaction", "data", data); - } - const isSigned = transaction.length === 8; - const tx = { - nonce: Number(handleNumber(transaction[0])), - energyPrice: handleNumber(transaction[1]).toBigInt(), - energyLimit: handleNumber(transaction[2]).toBigInt(), - networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(), - to: handleAddress(transaction[isSigned ? 4 : 3]), - value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(), - data: transaction[isSigned ? 6 : 5], - }; - if (transaction.length === 8) { - const prefix = networkIdToPrefix(Number(tx.networkId)); - const digest = sha256(serialize(tx)); - tx.hash = sha256(serialize(tx, transaction[7])); - tx.from = recoverAddress(digest, transaction[7], prefix); - tx.signature = transaction[7]; - } - return tx; -} -const unsignedTransactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, - { name: "networkId", maxLength: 32, numeric: true }, -]; -const transactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "networkId", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, -]; -const allowedTransactionKeys = { - networkId: true, - data: true, - energyLimit: true, - energyPrice: true, - nonce: true, - to: true, - value: true, -}; -function serialize(transaction, signature) { - checkProperties(transaction, allowedTransactionKeys); - const raw = []; - (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) { - let value = transaction[name] || []; - const options = {}; - if (numeric) { - options.hexPad = "left"; - } - const tmpHexlified = hexlify(value, options); - value = arrayify(tmpHexlified); - // Fixed-width field - if (length && value.length !== length && value.length > 0) { - logger$1.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - // Variable-width (with a maximum) - if (maxLength) { - value = stripZeros(value); - if (value.length > maxLength) { - logger$1.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - } - const hexlified = hexlify(value); - raw.push(hexlified); - }); - if (!!signature) { - raw.push(hexlify(signature)); - } - const finalValue = encode(raw); - return finalValue; -} -/** - * A **Transaction** describes an operation to be executed on - * Core by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in corebc) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -class Transaction { - #to; - #data; - #nonce; - #energyLimit; - #energyPrice; - #value; - #networkId; - #sig; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - return this.#to; - } - set to(value) { - this.#to = value == null ? null : getAddress(value); - } - /** - * The transaction nonce. - */ - get nonce() { - return this.#nonce; - } - set nonce(value) { - this.#nonce = getNumber(value, "value"); - } - /** - * The energy limit. - */ - get energyLimit() { - return this.#energyLimit; - } - set energyLimit(value) { - this.#energyLimit = getBigInt(value); - } - /** - * The energy price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get energyPrice() { - const value = this.#energyPrice; - if (value == null) { - return BN_0$4; - } - return value; - } - set energyPrice(value) { - this.#energyPrice = value == null ? null : getBigInt(value, "energyPrice"); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { - return this.#data; - } - set data(value) { - this.#data = hexlify(value); - } - /** - * The amount of xcb (in ore) to send in this transactions. - */ - get value() { - return this.#value; - } - set value(value) { - this.#value = getBigInt(value, "value"); - } - /** - * The chain ID this transaction is valid on. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = getBigInt(value); - } - /** - * If signed, the signature for this transaction. - */ - get signature() { - return this.#sig || null; - } - set signature(value) { - this.#sig = value == null ? null : value; - } - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#to = null; - this.#nonce = 0; - this.#energyLimit = BigInt(0); - this.#energyPrice = null; - this.#data = "0x"; - this.#value = BigInt(0); - this.#networkId = BigInt(0); - this.#sig = null; - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return sha256(this.serialized); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return sha256(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - const prefix = networkIdToPrefix(Number(this.#networkId)); - return recoverAddress(this.unsignedHash, this.signature, prefix); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - //isSigned(): this is SignedTransaction { - return this.signature != null; - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - assert(this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - return serialize(this, this.signature); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return serialize(this); - } - /** - * Create a copy of this transaciton. - */ - clone() { - return Transaction.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s = (v) => { - if (v == null) { - return null; - } - return v.toString(); - }; - return { - to: this.to, - data: this.data, - nonce: this.nonce, - energyLimit: s(this.energyLimit), - energyPrice: s(this.energyPrice), - value: s(this.value), - networkId: s(this.networkId), - sig: this.signature ? this.signature : null, - }; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new Transaction(); - } - if (typeof tx === "string") { - const payload = getBytes(tx); - return Transaction.from(parse(payload)); - } - const result = new Transaction(); - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.energyLimit != null) { - result.energyLimit = tx.energyLimit; - } - if (tx.energyPrice != null) { - result.energyPrice = tx.energyPrice; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.networkId != null) { - result.networkId = tx.networkId; - } - if (tx.signature != null) { - result.signature = tx.signature; - } - if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); - assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } -} - -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -function hashMessage(message) { - if (typeof message === "string") { - message = toUtf8Bytes(message); - } - return sha256(concat([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message.length)), - message, - ])); -} -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -function verifyMessage(message, sig, prefix) { - const digest = hashMessage(message); - return recoverAddress(digest, sig, prefix); -} - -const regexBytes = new RegExp("^bytes([0-9]+)$"); -const regexNumber = new RegExp("^(u?int)([0-9]*)$"); -const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); -function _pack(type, value, isArray) { - switch (type) { - case "address": - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(getAddress(value)); - case "string": - return toUtf8Bytes(value); - case "bytes": - return getBytes(value); - case "bool": - value = !!value ? "0x01" : "0x00"; - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(value); - } - let match = type.match(regexNumber); - if (match) { - let signed = match[1] === "int"; - let size = parseInt(match[2] || "256"); - assertArgument((!match[2] || match[2] === String(size)) && - size % 8 === 0 && - size !== 0 && - size <= 256, "invalid number type", "type", type); - if (isArray) { - size = 256; - } - if (signed) { - value = toTwos(value, size); - } - return getBytes(zeroPadValue(toBeArray(value), size / 8)); - } - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - assertArgument(dataLength(value) === size, `invalid value for ${type}`, "value", value); - if (isArray) { - return getBytes(zeroPadBytes(value, 32)); - } - return value; - } - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); - const result = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return getBytes(concat(result)); - } - assertArgument(false, "invalid type", "type", type); -} -// @TODO: Array Enum -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPacked(types, values) { - assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - const tight = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return hexlify(concat(tight)); -} -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPackedSha256(types, values) { - return sha256(solidityPacked(types, values)); -} - -const padding = new Uint8Array(32); -padding.fill(0); -const BN__1 = BigInt(-1); -const BN_0$3 = BigInt(0); -const BN_1$1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -function hexPadRight(value) { - const bytes = getBytes(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return concat([bytes, padding.slice(padOffset)]); - } - return hexlify(bytes); -} -const hexTrue = toBeHex(BN_1$1, 32); -const hexFalse = toBeHex(BN_0$3, 32); -const domainFieldTypes = { - name: "string", - version: "string", - networkId: "uint256", - verifyingContract: "address", - salt: "bytes32", -}; -const domainFieldNames = [ - "name", - "version", - "networkId", - "verifyingContract", - "salt", -]; -function checkString(key) { - return function (value) { - assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); - return value; - }; -} -const domainChecks = { - name: checkString("name"), - version: checkString("version"), - networkId: function (_value) { - const value = getBigInt(_value, "domain.networkId"); - assertArgument(value >= 0, "invalid chain ID", "domain.networkId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function (value) { - try { - return getAddress(value).toLowerCase(); - } - catch (error) { } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function (value) { - const bytes = getBytes(value, "domain.salt"); - assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes); - }, -}; -function getBaseEncoder(type) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d*)$/); - if (match) { - const signed = match[1] === ""; - const width = parseInt(match[2] || "256"); - assertArgument(width % 8 === 0 && - width !== 0 && - width <= 256 && - (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type); - const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); - const boundsLower = signed ? (boundsUpper + BN_1$1) * BN__1 : BN_0$3; - return function (_value) { - const value = getBigInt(_value, "value"); - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - return function (value) { - const bytes = getBytes(value); - assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type) { - case "address": - return function (value) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": - return function (value) { - return !value ? hexFalse : hexTrue; - }; - case "bytes": - return function (value) { - return sha256(value); - }; - case "string": - return function (value) { - return id(value); - }; - } - return null; -} -function encodeType(name, fields) { - return `${name}(${fields - .map(({ name, type }) => type + " " + name) - .join(",")})`; -} -class TypedDataEncoder { - primaryType; - #types; - get types() { - return JSON.parse(this.#types); - } - #fullTypes; - #encoderCache; - constructor(types) { - this.#types = JSON.stringify(types); - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - // Link struct types to their direct child structs - const links = new Map(); - // Link structs to structs which contain them as a child - const parents = new Map(); - // Link all subtypes within a given struct - const subtypes = new Map(); - Object.keys(types).forEach((type) => { - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - for (const name in types) { - const uniqueNames = new Set(); - for (const field of types[name]) { - // Check each field has a unique name - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types); - uniqueNames.add(field.name); - // Get the base type (drop any array specifiers) - const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1] || null; - assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types); - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types); - // Add linkage - parents.get(baseType).push(name); - links.get(name).add(baseType); - } - } - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => parents.get(n).length === 0); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", types); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes - .map((t) => JSON.stringify(t)) - .join(", ")}`, "types", types); - defineProperties(this, { primaryType: primaryTypes[0] }); - // Check for circular type references - function checkCircular(type, found) { - assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types); - found.add(type); - for (const child of links.get(type)) { - if (!parents.has(child)) { - continue; - } - // Recursively check children - checkCircular(child, found); - // Mark all ancestors as having this decendant - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + - st.map((t) => encodeType(t, types[t])).join("")); - } - } - getEncoder(type) { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - #getEncoder(type) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - const subtype = match[1]; - const subEncoder = this.getEncoder(subtype); - return (value) => { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(sha256); - } - return sha256(concat(result)); - }; - } - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id(this.#fullTypes.get(type)); - return (value) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return sha256(result); - } - return result; - }); - values.unshift(encodedType); - return concat(values); - }; - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - encodeType(name) { - const result = this.#fullTypes.get(name); - assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); - return result; - } - encodeData(type, value) { - return this.getEncoder(type)(value); - } - hashStruct(name, value) { - return sha256(this.encodeData(name, value)); - } - encode(value) { - return this.encodeData(this.primaryType, value); - } - hash(value) { - return this.hashStruct(this.primaryType, value); - } - _visit(type, value, callback) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - return value.map((v) => this._visit(match[1], v, callback)); - } - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, {}); - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - static from(types) { - return new TypedDataEncoder(types); - } - static getPrimaryType(types) { - return TypedDataEncoder.from(types).primaryType; - } - static hashStruct(name, types, value) { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - static hashDomain(domain) { - const domainFields = []; - for (const name in domain) { - if (domain[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); - domainFields.push({ name, type }); - } - domainFields.sort((a, b) => { - return (domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name)); - }); - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - static encode(domain, types, value) { - return concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value), - ]); - } - static hash(domain, types, value) { - return sha256(TypedDataEncoder.encode(domain, types, value)); - } - // Replaces all address types with ENS names with their looked up address - static async resolveNames(domain, types, value, resolveName) { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - // Allow passing null to ignore value - for (const key in domain) { - if (domain[key] == null) { - delete domain[key]; - } - } - // Look up all ENS names - const ensCache = {}; - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && - !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - // Get a list of all the addresses - encoder.visit(value, (type, value) => { - if (type === "address" && !isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - // Replace all ENS names with their address - value = encoder.visit(value, (type, value) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - return { domain, value }; - } - static getPayload(domain, types, value) { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - // Derive the EIP712Domain Struct reference type - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name) => { - const value = domain[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - const encoder = TypedDataEncoder.from(types); - const typesWithDomain = Object.assign({}, types); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - typesWithDomain.EIP712Domain = domainTypes; - // Validate the data structures and types - encoder.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type, value) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value)); - } - // uint or int - if (type.match(/^u?int/)) { - return getBigInt(value).toString(); - } - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - assertArgument(typeof value === "string", "invalid string", "value", value); - return value; - } - assertArgument(false, "unsupported type", "type", type); - }), - }; - } -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -function verifyTypedData(domain, types, value, signature, prefix) { - return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix); -} - -/** - * About frgaments... - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -var _a; -// [ "a", "b" ] => { "a": 1, "b": 1 } -function setify(items) { - const result = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); -} -// Visibility Keywords -const _kwVisib = "constant external internal payable private public pure view"; -const KwVisib = setify(_kwVisib.split(" ")); -const _kwTypes = "constructor error event fallback function receive struct"; -const KwTypes = setify(_kwTypes.split(" ")); -const _kwModifiers = "calldata memory storage payable indexed"; -const KwModifiers = setify(_kwModifiers.split(" ")); -const _kwOther = "tuple returns"; -// All Keywords -const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); -const Keywords = setify(_keywords.split(" ")); -// Single character tokens -const SimpleTokens = { - "(": "OPEN_PAREN", - ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", - "]": "CLOSE_BRACKET", - ",": "COMMA", - "@": "AT", -}; -// Parser regexes to consume the next token -const regexWhitespacePrefix = new RegExp("^(\\s*)"); -const regexNumberPrefix = new RegExp("^([0-9]+)"); -const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); -// Parser regexs to check validity -const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); -const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); -class TokenString { - #offset; - #tokens; - get offset() { - return this.#offset; - } - get length() { - return this.#tokens.length - this.#offset; - } - constructor(tokens) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - clone() { - return new _a(this.#tokens); - } - reset() { - this.#offset = 0; - } - #subTokenString(from = 0, to = 0) { - return new _a(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({}, t, { - match: t.match - from, - linkBack: t.linkBack - from, - linkNext: t.linkNext - from, - })); - })); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type) { - if (this.peek().type !== type) { - throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - this.#offset = top.match + 1; - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return top != null && allowed.has(top) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return top.type === type ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - this.#offset++; - return result; - } - toString() { - const tokens = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } -} -_a = TokenString; -function lex(text) { - const tokens = []; - const throwError = (message) => { - const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - let brackets = []; - let commas = []; - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - const token = { - depth: brackets.length, - linkBack: -1, - linkNext: -1, - match: -1, - type: "", - text: "", - offset, - value: -1, - }; - tokens.push(token); - let type = SimpleTokens[cur[0]] || ""; - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } - else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - token.match = brackets.pop(); - tokens[token.match].match = tokens.length - 1; - token.depth--; - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - } - else if (type === "COMMA") { - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } - else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } - else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - tokens[tokens.length - 1].value = - getNumber(value); - } - if (tokens.length === 0 || - tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - tokens[tokens.length - 1].text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - token.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); - } - return new TokenString(tokens.map((t) => Object.freeze(t))); -} -// Check only one of `allowed` is in `set` -function allowSingle(set, allowed) { - let included = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } -} -// Functions to process a Solidity Signature TokenString from left-to-right for... -// ...the name with an optional type, returning the name -function consumeName(type, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - return tokens.popType("ID"); -} -// ...all keywords matching allowed, returning the keywords -function consumeKeywords(tokens, allowed) { - const keywords = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - return Object.freeze(keywords); -} -// ...all visibility keywords, returning the coalesced mutability -function consumeMutability(tokens) { - let modifiers = consumeKeywords(tokens, KwVisib); - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; -} -// ...a parameter list, returning the ParamType list -function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); -} -// ...a energy limit, returning a BigNumber or null if none -function consumeEnergy(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid energy"); - } - return null; -} -function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens: ${tokens.toString()}`); - } -} -const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); -function verifyBasicType(type) { - const match = type.match(regexType); - assertArgument(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); - } - else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3]); - assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid numeric width", "type", type); - } - return type; -} -// Make the Fragment constructors effectively private -const _guard$2 = {}; -const internal$1 = Symbol.for("_corebc_internal"); -const ParamTypeInternal = "_ParamTypeInternal"; -const ErrorFragmentInternal = "_ErrorInternal"; -const EventFragmentInternal = "_EventInternal"; -const ConstructorFragmentInternal = "_ConstructorInternal"; -const FallbackFragmentInternal = "_FallbackInternal"; -const FunctionFragmentInternal = "_FunctionInternal"; -const StructFragmentInternal = "_StructInternal"; -/** - * Each input and output of a [[Fragment]] is an Array of **PAramType**. - */ -class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - name; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - type; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - baseType; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - indexed; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - components; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - arrayLength; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - arrayChildren; - /** - * @private - */ - constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - assertPrivate(guard, _guard$2, "ParamType"); - Object.defineProperty(this, internal$1, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } - else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } - else if (components != null) { - throw new Error(""); - } - defineProperties(this, { - name, - type, - baseType, - indexed, - components, - arrayLength, - arrayChildren, - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - let result = { - type: this.baseType === "tuple" ? "tuple" : this.type, - name: this.name || undefined, - }; - if (typeof this.indexed === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - let result = ""; - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; - } - else { - if (this.isTuple()) { - if (format !== "sighash") { - result += this.type; - } - result += - "(" + - this.components - .map((comp) => comp.format(format)) - .join(format === "full" ? ", " : ",") + - ")"; - } - else { - result += this.type; - } - } - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /* - * Returns true if %%value%% is an Array type. - * - * This provides a type gaurd ensuring that the - * [[arrayChildren]] and [[arrayLength]] are non-null. - */ - //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } { - // return value && (value.baseType === "array") - //} - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return this.baseType === "array"; - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return this.baseType === "tuple"; - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return this.indexed != null; - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => _this.arrayChildren.walk(v, process)); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => _this.components[i].walk(v, process)); - } - return process(this.type, value); - } - #walkAsync(promises, value, process, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - if (this.isTuple()) { - const components = this.components; - // Convert the object into an array - let result; - if (Array.isArray(value)) { - result = value.slice(); - } - else { - if (value == null || typeof value !== "object") { - throw new Error("invalid tuple value"); - } - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - const result = process(this.type, value); - if (result.then) { - promises.push((async function () { - setValue(await result); - })()); - } - else { - setValue(result); - } - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process) { - const promises = []; - const result = [value]; - this.#walkAsync(promises, value, process, (value) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (ParamType.isParamType(obj)) { - return obj; - } - if (typeof obj === "string") { - return ParamType.from(lex(obj), allowIndexed); - } - else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || - obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } - else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - // Check for Array - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard$2, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - let indexed = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - const name = obj.peekType("ID") ? obj.pop().text : ""; - if (obj.length) { - throw new Error("leftover tokens"); - } - return new ParamType(_guard$2, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - const name = obj.name; - assertArgument(!name || (typeof name === "string" && name.match(regexId)), "invalid name", "obj.name", name); - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type = obj.type; - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components, - }); - return new ParamType(_guard$2, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - if (type === "tuple" || - type.startsWith("tuple(" /* fix: ) */) || - type.startsWith("(" /* fix: ) */)) { - const comps = obj.components != null - ? obj.components.map((c) => ParamType.from(c)) - : null; - const tuple = new ParamType(_guard$2, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - type = verifyBasicType(obj.type); - return new ParamType(_guard$2, name || "", type, type, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return value && value[internal$1] === ParamTypeInternal; - } -} -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -class Fragment { - /** - * The type of the fragment. - */ - type; - /** - * The inputs for the fragment. - */ - inputs; - /** - * @private - */ - constructor(guard, type, inputs) { - assertPrivate(guard, _guard$2, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof obj === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } - catch (e) { } - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - const type = obj.peekKeyword(KwTypes); - switch (type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - } - else if (typeof obj === "object") { - // JSON ABI - switch (obj.type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from", - }); - } - assertArgument(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - name; - /** - * @private - */ - constructor(guard, type, name, inputs) { - super(guard, type, inputs); - assertArgument(typeof name === "string" && name.match(regexId), "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name }); - } -} -function joinParams(format, params) { - return ("(" + - params.map((p) => p.format(format)).join(format === "full" ? ", " : ",") + - ")"); -} -/** - * A Fragment which represents a //Custom Error//. - */ -class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal$1, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ErrorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard$2, name, inputs); - } - return new ErrorFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal$1] === ErrorFragmentInternal; - } -} -/** - * A Fragment which represents an Event. - */ -class EventFragment extends NamedFragment { - anonymous; - /** - * @private - */ - constructor(guard, name, inputs, anonymous) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal$1, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return id(this.format("sighash")); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - static getTopicHash(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard$2, name, params, false); - return fragment.topicHash; - } - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return EventFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard$2, name, inputs, anonymous); - } - return new EventFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); - } - static isFragment(value) { - return value && value[internal$1] === EventFragmentInternal; - } -} -/** - * A Fragment which represents a constructor. - */ -class ConstructorFragment extends Fragment { - payable; - energy; - /** - * @private - */ - constructor(guard, type, inputs, payable, energy) { - super(guard, type, inputs); - Object.defineProperty(this, internal$1, { - value: ConstructorFragmentInternal, - }); - defineProperties(this, { payable, energy }); - } - format(format) { - assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: this.payable ? "payable" : "undefined", - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = [`constructor${joinParams(format, this.inputs)}`]; - result.push(this.payable ? "payable" : "nonpayable"); - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - return result.join(" "); - } - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ConstructorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable"); - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard$2, "constructor", inputs, payable, energy); - } - return new ConstructorFragment(_guard$2, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal$1] === ConstructorFragmentInternal; - } -} -/** - * A Fragment which represents a method. - */ -class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - payable; - constructor(guard, inputs, payable) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal$1, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - format(format) { - const type = this.inputs.length === 0 ? "receive" : "fallback"; - if (format === "json") { - const stateMutability = this.payable ? "payable" : "nonpayable"; - return JSON.stringify({ type, stateMutability }); - } - return `${type}()${this.payable ? " payable" : ""}`; - } - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FallbackFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type = obj.popKeyword(setify(["fallback", "receive"])); - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard$2, [], true); - } - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); - } - else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard$2, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard$2, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = obj.stateMutability === "payable"; - return new FallbackFragment(_guard$2, inputs, payable); - } - assertArgument(false, "invalid fallback description", "obj", obj); - } - static isFragment(value) { - return value && value[internal$1] === FallbackFragmentInternal; - } -} -/** - * A Fragment which represents a method. - */ -class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - constant; - /** - * The returned types for the result of calling this function. - */ - outputs; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - stateMutability; - /** - * If the function can be sent value during invocation. - */ - payable; - /** - * The amount of energy to send when calling this function - */ - energy; - /** - * @private - */ - constructor(guard, name, stateMutability, inputs, outputs, energy) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal$1, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = stateMutability === "view" || stateMutability === "pure"; - const payable = stateMutability === "payable"; - defineProperties(this, { - constant, - energy, - outputs, - payable, - stateMutability, - }); - } - /** - * The Function selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: this.stateMutability !== "nonpayable" - ? this.stateMutability - : undefined, - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - } - return result.join(" "); - } - static getSelector(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard$2, name, "view", params, [], null); - return fragment.selector; - } - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FunctionFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new FunctionFragment(_guard$2, name, mutability, inputs, outputs, energy); - } - let stateMutability = obj.stateMutability; - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof obj.constant === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } - else if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - return new FunctionFragment(_guard$2, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal$1] === FunctionFragmentInternal; - } -} -/** - * A Fragment which represents a structure. - */ -class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal$1, { value: StructFragmentInternal }); - } - format() { - throw new Error("@TODO"); - } - static from(obj) { - if (typeof obj === "string") { - return StructFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard$2, name, inputs); - } - return new StructFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal$1] === StructFragmentInternal; - } -} - -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -// https://docs.soliditylang.org/en/v0.8.17/control-structures.html -const PanicReasons$1 = new Map(); -PanicReasons$1.set(0x00, "GENERIC_PANIC"); -PanicReasons$1.set(0x01, "ASSERT_FALSE"); -PanicReasons$1.set(0x11, "OVERFLOW"); -PanicReasons$1.set(0x12, "DIVIDE_BY_ZERO"); -PanicReasons$1.set(0x21, "ENUM_RANGE_ERROR"); -PanicReasons$1.set(0x22, "BAD_STORAGE_DATA"); -PanicReasons$1.set(0x31, "STACK_UNDERFLOW"); -PanicReasons$1.set(0x32, "ARRAY_RANGE_ERROR"); -PanicReasons$1.set(0x41, "OUT_OF_MEMORY"); -PanicReasons$1.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); -const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); -const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); -let defaultCoder = null; -function getBuiltinCallException(action, tx, data, abiCoder) { - let message = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data) { - message = "execution reverted"; - const bytes = getBytes(data); - data = hexlify(data); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } - else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } - else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason], - }; - message += `: ${JSON.stringify(reason)}`; - } - catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } - else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code], - }; - reason = `Panic due to ${PanicReasons$1.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } - catch (error) { - message += " (could not decode panic code)"; - } - } - else { - message += " (unknown custom error)"; - } - } - const transaction = { - to: tx.to ? getAddress(tx.to) : null, - data: tx.data || "0x", - }; - if (tx.from) { - transaction.from = getAddress(tx.from); - } - return makeError(message, "CALL_EXCEPTION", { - action, - data, - reason, - transaction, - invocation, - revert, - }); -} -/** - * About AbiCoder - */ -class AbiCoder { - #getCoder(param) { - if (param.isArray()) { - return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param); - return new NumberCoder(size / 8, match[1] === "int", param.name); - } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new FixedBytesCoder(size, param.name); - } - assertArgument(false, "invalid type", "type", param.type); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types, values) { - assertArgumentCount(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose)); - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an corebc-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } -} - -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -/** - * Encodes %%text%% as a Bytes32 string. - */ -function encodeBytes32String(text) { - // Get the bytes - const bytes = toUtf8Bytes(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } - // Zero-pad (implicitly null-terminates) - return zeroPadBytes(bytes, 32); -} -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -function decodeBytes32String(_bytes) { - const data = getBytes(_bytes, "bytes"); - // Must be 32 bytes with a null-termination - if (data.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { - length--; - } - // Determine the string value - return toUtf8String(data.slice(0, length)); -} - -/** - * About Interface - * - * @_subsection api/abi:Interfaces [interfaces] - */ -class LogDescription { - fragment; - name; - signature; - topic; - args; - constructor(fragment, topic, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - signature, - topic, - args, - }); - } -} -class TransactionDescription { - fragment; - name; - args; - signature; - selector; - value; - constructor(fragment, selector, args, value) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - value, - }); - } -} -class ErrorDescription { - fragment; - name; - args; - signature; - selector; - constructor(fragment, selector, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - }); - } -} -class Indexed { - hash; - _isIndexed; - static isIndexed(value) { - return !!(value && value._isIndexed); - } - constructor(hash) { - defineProperties(this, { hash, _isIndexed: true }); - } -} -// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require -const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", -}; -const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message) => { - return `reverted with reason string ${JSON.stringify(message)}`; - }, - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - }, - }, -}; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - fragments; - /** - * The Contract constructor. - */ - deploy; - /** - * The Fallback method, if any. - */ - fallback; - /** - * If receiving xcb is supported. - */ - receive; - #errors; - #events; - #functions; - // #structs: Map; - #abiCoder; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments) { - let abi = []; - if (typeof fragments === "string") { - abi = JSON.parse(fragments); - } - else { - abi = fragments; - } - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - const frags = []; - for (const a of abi) { - try { - frags.push(Fragment.from(a)); - } - catch (error) { - console.log("EE", error); - } - } - defineProperties(this, { - fragments: Object.freeze(frags), - }); - let fallback = null; - let receive = false; - this.#abiCoder = this.getAbiCoder(); - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - defineProperties(this, { - deploy: fragment, - }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } - else { - assertArgument(!fallback || - fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - case "error": - bucket = this.#errors; - break; - default: - return; - } - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - bucket.set(signature, fragment); - }); - // If we do not have a constructor add a default - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()"), - }); - } - defineProperties(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format = minimal ? "minimal" : "full"; - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi = this.fragments.map((f) => f.format("json")); - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return AbiCoder.defaultAbiCoder(); - } - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key, values, forceUnique) { - // Selector - if (isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - const lastValue = values.length > 0 ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && - (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && - values && - values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || - Array.isArray(lastArg) || - typeof lastArg !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#functions.get(FunctionFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key) { - const fragment = this.#getFunction(key, null, false); - assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key) { - return !!this.#getFunction(key, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key, values) { - return this.#getFunction(key, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#functions.get(name), i); - } - } - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key, values, forceUnique) { - // EventTopic - if (isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#events.get(EventFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key) { - const fragment = this.#getEvent(key, null, false); - assertArgument(fragment, "no matching event", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key) { - return !!this.#getEvent(key, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key, values) { - return this.#getEvent(key, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#events.get(name), i); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key, values) { - if (isHexString(key)) { - const selector = key.toLowerCase(); - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key === "Error") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return ErrorFragment.from("error Panic(uint256)"); - } - return null; - } - else if (matching.length > 1) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - key = ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return ErrorFragment.from("error Panic(uint256)"); - } - const result = this.#errors.get(key); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#errors.get(name), i); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return this.#abiCoder.decode(params, data); - } - _encodeParams(params, values) { - return this.#abiCoder.encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - let message = "invalid length for result data"; - const bytes = getBytesCopy(data); - if (bytes.length % 32 === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } - catch (error) { - message = "could not decode result data"; - } - } - // Call returned data with no error, but the data is junk - assert(false, message, "BAD_DATA", { - value: hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() }, - }); - } - makeError(_data, tx) { - const data = getBytes(_data, "data"); - const error = AbiCoder.getBuiltinCallException("call", tx, data); - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, - signature: ef.format(), - args, - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } - catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args, - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } -*/ - // Create the filter for the event with search criteria (e.g. for xcb_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param, value) => { - if (param.type === "string") { - return id(value); - } - else if (param.type === "bytes") { - return sha256(hexlify(value)); - } - if (param.type === "bool" && typeof value === "boolean") { - value = value ? "0x01" : "0x00"; - } - if (param.type.match(/^u?int/)) { - value = toBeHex(value); - } - // Check addresses are valid - if (param.type === "address") { - this.#abiCoder.encode(["address"], [value]); - } - return zeroPadValue(hexlify(value), 32); - //@TOOD should probably be return toHex(value, 32) - }; - values.forEach((value, index) => { - const param = fragment.inputs[index]; - if (!param.indexed) { - assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); - return; - } - if (value == null) { - topics.push(null); - } - else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); - } - else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } - else { - topics.push(encodeTopic(param, value)); - } - }); - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)); - } - else if (param.type === "bytes") { - topics.push(sha256(value)); - } - else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } - else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } - else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics, - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || - param.type === "bytes" || - param.baseType === "tuple" || - param.baseType === "array") { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } - else { - indexed.push(param); - dynamic.push(false); - } - } - else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values = []; - const keys = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } - else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } - else { - try { - value = resultIndexed[indexedIndex++]; - } - catch (error) { - value = error; - } - } - } - else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } - catch (error) { - value = error; - } - } - values.push(value); - keys.push(param.name || null); - }); - return Result.fromItems(values, keys); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log) { - const fragment = this.getEvent(log.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data) { - const hexData = hexlify(data); - const fragment = this.getError(dataSlice(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - // JSON - if (typeof value === "string") { - return new Interface(JSON.parse(value)); - } - // Maybe an interface from an older version, or from a symlinked copy - if (typeof value.format === "function") { - return new Interface(value.format("json")); - } - // Array of fragments - return new Interface(value); - } -} - -const logger = new Logger("contract-address/0.0.1"); -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -function getCreateAddress(tx) { - const from = getAddress(tx.from); - const nonce = getBigInt(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } - else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } - else { - nonceHex = "0x" + nonceHex; - } - return getAddress(from); -} -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -function getCreate2Address(from, salt, initCodeHash) { - if (hexDataLength(salt) !== 32) { - logger.throwArgumentError("salt must be 32 bytes", "salt", salt); - } - if (hexDataLength(initCodeHash) !== 32) { - logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash); - } - const val = hexDataSlice(sha256(concat(["0xff", getAddress(from), salt, initCodeHash])), 12); - console.log({ "contract-address/74=>should be string": val }); - const prefix = from.substring(2, 4); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); -} - -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.corebc.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -function isAddressable(value) { - return value && typeof value.getAddress === "function"; -} -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -function isAddress(value) { - try { - getAddress(value); - return true; - } - catch (error) { } - return false; -} -async function checkAddress(target, promise) { - const result = await promise; - if (result == null || - result === "0x0000000000000000000000000000000000000000") { - assert(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return getAddress(result); -} -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -function resolveAddress(target) { - if (typeof target === "string") { - return getAddress(target); - // assert(resolver != null, "ENS resolution requires a provider", - // "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - // return checkAddress(target, resolver.resolveName(target)); - } - else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } - else if (target && typeof target.then === "function") { - return checkAddress(target, target); - } - assertArgument(false, "unsupported addressable value", "target", target); -} - -const BN_0$2 = BigInt(0); -// ----------------------- -function getValue(value) { - if (value == null) { - return null; - } - return value; -} -function toJson(value) { - if (value == null) { - return null; - } - return value.toString(); -} -// @TODO? implements Required -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -class FeeData { - /** - * The energy price for legacy networks. - */ - energyPrice; - constructor(energyPrice) { - defineProperties(this, { - energyPrice: getValue(energyPrice), - }); - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { energyPrice } = this; - return { - _type: "FeeData", - energyPrice: toJson(energyPrice), - }; - } -} -function copyRequest(req) { - const result = {}; - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = hexlify(req.data); - } - const bigIntKeys = "networkId,energyLimit,energyPrice,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getBigInt(req[key], `request.${key}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getNumber(req[key], `request.${key}`); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipReadEnabled = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - return result; -} -/** - * A **Block** represents the data associated with a full block on - * Core. - */ -class Block { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - number; - /** - * The block hash. - */ - hash; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - timestamp; - /** - * The block hash of the parent block. - */ - parentHash; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - nonce; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - difficulty; - /** - * The total energy limit for this block. - */ - energyLimit; - /** - * The total energy used in this block. - */ - energyUsed; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - miner; - /** - * Any extra data the validator wished to include. - */ - extraData; - /** - * The base fee per energy that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - baseFeePerEnergy; - #transactions; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block, provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof tx !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - defineProperties(this, { - provider, - hash: getValue(block.hash), - number: block.number, - timestamp: block.timestamp, - parentHash: block.parentHash, - nonce: block.nonce, - difficulty: block.difficulty, - energyLimit: block.energyLimit, - energyUsed: block.energyUsed, - miner: block.miner, - extraData: block.extraData, - baseFeePerEnergy: getValue(block.baseFeePerEnergy), - }); - } - /** - * Returns the list of transaction hashes. - */ - get transactions() { - return this.#transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return tx.hash; - }); - } - /** - * Returns the complete transactions for blocks which - * prefetched them, by passing ``true`` to %%prefetchTxs%% - * into [[provider_getBlock]]. - */ - get prefetchedTransactions() { - const txs = this.#transactions.slice(); - // Doesn't matter... - if (txs.length === 0) { - return []; - } - // Make sure we prefetched the transactions - assert(typeof txs[0] === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()", - }); - return txs; - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this; - return { - _type: "Block", - baseFeePerEnergy: toJson(baseFeePerEnergy), - difficulty: toJson(difficulty), - extraData, - energyLimit: toJson(energyLimit), - energyUsed: toJson(energyUsed), - hash, - miner, - nonce, - number, - parentHash, - timestamp, - transactions, - }; - } - [Symbol.iterator]() { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The number of transactions in this block. - */ - get length() { - return this.#transactions.length; - } - /** - * The [[link-js-date]] this block was included at. - */ - get date() { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash) { - // Find the internal value by its index or hash - let tx = undefined; - if (typeof indexOrHash === "number") { - tx = this.#transactions[indexOrHash]; - } - else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof v === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } - else { - if (v.hash === hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - if (typeof tx === "string") { - return await this.provider.getTransaction(tx); - } - else { - return tx; - } - } - getPrefetchedTransaction(indexOrHash) { - const txs = this.prefetchedTransactions; - if (typeof indexOrHash === "number") { - return txs[indexOrHash]; - } - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); - } - /** - * Has this block been mined. - * - * If true, the block has been typed-gaurded that all mined - * properties are non-null. - */ - isMined() { - return !!this.hash; - } - /** - * - */ - isLondon() { - return !!this.baseFeePerEnergy; - } - orphanedEvent() { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } -} -////////////////////// -// Log -class Log { - provider; - transactionHash; - blockHash; - blockNumber; - removed; - address; - data; - topics; - index; - transactionIndex; - constructor(log, provider) { - this.provider = provider; - const topics = Object.freeze(log.topics.slice()); - defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - removed: log.removed, - address: log.address, - data: log.data, - topics, - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - toJSON() { - const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this; - return { - _type: "log", - address, - blockHash, - blockNumber, - data, - index, - removed, - topics, - transactionHash, - transactionIndex, - }; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.transactionHash); - assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - async getTransactionReceipt() { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); - return receipt; - } - removedEvent() { - return createRemovedLogFilter(this); - } -} -////////////////////// -// Transaction Receipt -/* -export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; -} - -export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; -} -*/ -class TransactionReceipt { - provider; - to; - from; - contractAddress; - hash; - index; - blockHash; - blockNumber; - logsBloom; - energyUsed; - cumulativeEnergyUsed; - energyPrice; - type; - //readonly byzantium!: boolean; - status; - root; - #logs; - constructor(tx, provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - defineProperties(this, { - provider, - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - hash: tx.hash, - index: tx.index, - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - logsBloom: tx.logsBloom, - energyUsed: tx.energyUsed, - cumulativeEnergyUsed: tx.cumulativeEnergyUsed, - energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice), - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root, - }); - } - get logs() { - return this.#logs; - } - toJSON() { - const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, - status, root, } = this; - return { - _type: "TransactionReceipt", - blockHash, - blockNumber, - //byzantium, - contractAddress, - cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed), - from, - energyPrice: toJson(this.energyPrice), - energyUsed: toJson(this.energyUsed), - hash, - index, - logs, - logsBloom, - root, - status, - to, - }; - } - get length() { - return this.logs.length; - } - [Symbol.iterator]() { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - }, - }; - } - get fee() { - return this.energyUsed * this.energyPrice; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - async getResult() { - return await this.provider.getTransactionResult(this.hash); - } - async confirmations() { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - removedEvent() { - return createRemovedTransactionFilter(this); - } - reorderedEvent(other) { - assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } -} -/* -export type ReplacementDetectionSetup = { - to: string; - from: string; - value: bigint; - data: string; - nonce: number; - block: number; -}; -*/ -class TransactionResponse { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockNumber; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockHash; - /** - * The index within the block that this transaction resides at. - */ - index; - /** - * The transaction hash. - */ - hash; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - type; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - to; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - from; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - nonce; - /** - * The maximum units of energy this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - energyLimit; - /** - * The energy price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective energy price// (the fee per energy that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerEnergy]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of energy the transaction - * consumes. - */ - energyPrice; - /** - * The data. - */ - data; - /** - * The value, in ore. Use [[formatXCB]] to format this value - * as xcb. - */ - value; - /** - * The chain ID. - */ - networkId; - /** - * The signature. - */ - signature; - #startBlock; - /** - * Create a new TransactionResponse with %%tx%% parameters - * connected to %%provider%%. - */ - constructor(tx, provider) { - this.provider = provider; - this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null; - this.blockHash = tx.blockHash != null ? tx.blockHash : null; - this.hash = tx.hash; - this.index = tx.index; - this.from = tx.from; - this.to = tx.to || null; - this.energyLimit = tx.energyLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - this.energyPrice = tx.energyPrice; - this.networkId = tx.networkId; - this.signature = tx.signature; - this.#startBlock = -1; - } - /** - * Returns a JSON representation of this transaction. - */ - toJSON() { - const { index, hash, type, to, from, nonce, data, signature } = this; - return { - _type: "TransactionReceipt", - networkId: toJson(this.networkId), - data, - from, - energyLimit: toJson(this.energyLimit), - energyPrice: toJson(this.energyPrice), - hash, - nonce, - signature, - to, - index, - type, - value: toJson(this.value), - }; - } - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock() { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction() { - return this.provider.getTransaction(this.hash); - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms, _timeout) { - const confirms = _confirms == null ? 1 : _confirms; - const timeout = _timeout == null ? 0 : _timeout; - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = startBlock === -1 ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from), - }); - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - // We were replaced; start scanning for that transaction - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx = await block.getTransaction(i); - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - // We will retry this on the next block (this case could be optimized) - if (blockNumber - receipt.blockNumber + 1 < confirms) { - return; - } - // The reason we were replaced - let reason = "replaced"; - if (tx.data === this.data && - tx.to === this.to && - tx.value === this.value) { - reason = "repriced"; - } - else if (tx.data === "0x" && - tx.from === tx.to && - tx.value === BN_0$2) { - reason = "cancelled"; - } - assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: reason === "replaced" || reason === "cancelled", - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt, - }); - } - } - nextScan++; - } - return; - }; - const receipt = await this.provider.getTransactionReceipt(this.hash); - if (receipt) { - if ((await receipt.confirmations()) >= confirms) { - return receipt; - } - } - else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers = []; - const cancel = () => { - cancellers.forEach((c) => c()); - }; - // On cancel, stop scanning for replacements - cancellers.push(() => { - stopScanning = true; - }); - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { - clearTimeout(timer); - }); - } - const txListener = async (receipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - resolve(receipt); - } - }; - cancellers.push(() => { - this.provider.off(this.hash, txListener); - }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } - catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { - this.provider.off("block", replaceListener); - }); - this.provider.once("block", replaceListener); - } - }); - return await waiter; - } - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined() { - return this.blockHash != null; - } - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy() { - return this.type === 0; - } - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent() { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other) { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createReorderedTransactionFilter(this, other); - } - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock) { - assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } -} -function createOrphanedBlockFilter(block) { - return { orphan: "drop-block", hash: block.hash, number: block.number }; -} -function createReorderedTransactionFilter(tx, other) { - return { orphan: "reorder-transaction", tx, other }; -} -function createRemovedTransactionFilter(tx) { - return { orphan: "drop-transaction", tx }; -} -function createRemovedLogFilter(log) { - return { - orphan: "drop-log", - log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index, - }, - }; -} - -class EventLog extends Log { - interface; - fragment; - args; - constructor(log, iface, fragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - defineProperties(this, { args, fragment, interface: iface }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } -} -class ContractTransactionReceipt extends TransactionReceipt { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - get logs() { - return super.logs.map((log) => { - const fragment = log.topics.length - ? this.#iface.getEvent(log.topics[0]) - : null; - if (fragment) { - return new EventLog(log, this.#iface, fragment); - } - else { - return log; - } - }); - } -} -class ContractTransactionResponse extends TransactionResponse { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - async wait(confirms) { - const receipt = await super.wait(); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } -} -class ContractUnknownEventPayload extends EventPayload { - log; - constructor(contract, listener, filter, log) { - super(contract, listener, filter); - defineProperties(this, { log }); - } - async getBlock() { - return await this.log.getBlock(); - } - async getTransaction() { - return await this.log.getTransaction(); - } - async getTransactionReceipt() { - return await this.log.getTransactionReceipt(); - } -} -class ContractEventPayload extends ContractUnknownEventPayload { - constructor(contract, listener, filter, fragment, _log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - defineProperties(this, { args, fragment }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } -} - -const BN_0$1 = BigInt(0); -function canCall(value) { - return value && typeof value.call === "function"; -} -function canEstimate(value) { - return value && typeof value.estimateEnergy === "function"; -} -function canResolve(value) { - return value && typeof value.resolveName === "function"; -} -function canSend(value) { - return value && typeof value.sendTransaction === "function"; -} -class PreparedTopicFilter { - #filter; - fragment; - constructor(contract, fragment, args) { - defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - // Recursively descend into args and resolve any addresses - this.#filter = (async function () { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - })); - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - getTopicFilter() { - return this.#filter; - } -} -// A = Arguments passed in as a tuple -// R = The result type of the call (i.e. if only one return type, -// the qualified type, otherwise Result) -// D = The type the default call will return (i.e. R for view/pure, -// TransactionResponse otherwise) -//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { -function getRunner(value, feature) { - if (value == null) { - return null; - } - if (typeof value[feature] === "function") { - return value; - } - if (value.provider && typeof value.provider[feature] === "function") { - return value.provider; - } - return null; -} -function getProvider(value) { - if (value == null) { - return null; - } - return value.provider || null; -} -/** - * @_ignore: - */ -async function copyOverrides(arg, allowed) { - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = copyRequest(Typed.dereference(arg, "overrides")); - assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); - // Resolve any from - if (overrides.from) { - overrides.from = await resolveAddress(overrides.from); - } - return overrides; -} -/** - * @_ignore: - */ -async function resolveArgs(_runner, inputs, args) { - // Recursively descend into args and resolve any addresses - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = Typed.dereference(value, type); - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - })); -} -function buildWrappedFallback(contract) { - const populateTransaction = async function (overrides) { - // If an overrides was passed in, copy it and normalize the values - const tx = (await copyOverrides(overrides, ["data"])); - tx.to = await contract.getAddress(); - const iface = contract.interface; - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - assertArgument(payable || (tx.value || BN_0$1) === BN_0$1, "cannot send value to non-payable contract", "overrides.value", tx.value); - // Only allow fallback contracts to set non-empty data - assertArgument(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data); - return tx; - }; - const staticCall = async function (overrides) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(overrides); - try { - return await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - const send = async function (overrides) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (overrides) { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(overrides)); - }; - const method = async (overrides) => { - return await send(overrides); - }; - defineProperties(method, { - _contract: contract, - estimateEnergy, - populateTransaction, - send, - staticCall, - }); - return method; -} -function buildWrappedMethod(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getFunction(key, args); - assert(fragment, "no matching fragment in getFragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const populateTransaction = async function (...args) { - const fragment = getFragment(...args); - // If an overrides was passed in, copy it and normalize the values - let overrides = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs), - })); - }; - const staticCall = async function (...args) { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return result; - }; - const send = async function (...args) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (...args) { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(...args)); - }; - const staticCallResult = async function (...args) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(...args); - let result = "0x"; - try { - result = await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - const method = async (...args) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, - _key: key, - getFragment, - estimateEnergy, - populateTransaction, - send, - staticCall, - staticCallResult, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - assert(fragment, "no matching fragment in defineProperty", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; -} -function buildWrappedEvent(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getEvent(key, args); - assert(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const method = function (...args) { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, - _key: key, - getFragment, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; -} -// The combination of TypeScrype, Private Fields and Proxies makes -// the world go boom; so we hide variables with some trickery keeping -// a symbol attached to each BaseContract which its sub-class (even -// via a Proxy) can reach and use to look up its internal values. -const internal = Symbol.for("_corebcInternal_contract"); -const internalValues = new WeakMap(); -function setInternal(contract, values) { - internalValues.set(contract[internal], values); -} -function getInternal(contract) { - return internalValues.get(contract[internal]); -} -function isDeferred(value) { - return (value && - typeof value === "object" && - "getTopicFilter" in value && - typeof value.getTopicFilter === "function" && - value.fragment); -} -async function getSubInfo(contract, event) { - let topics; - let fragment = null; - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - if (Array.isArray(event)) { - const topicHashify = function (name) { - if (isHexString(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } - else if (event === "*") { - topics = [null]; - } - else if (typeof event === "string") { - if (isHexString(event, 32)) { - // Topic Hash - topics = [event]; - } - else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - assertArgument(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } - else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } - else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } - else { - assertArgument(false, "unknown event name", "event", event); - } - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - const tag = topics - .map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }) - .join("&"); - return { fragment, tag, topics }; -} -async function hasSub(contract, event) { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; -} -async function getSub(contract, operation, event) { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); - const { fragment, tag, topics } = await getSubInfo(contract, event); - const { addr, subs } = getInternal(contract); - let sub = subs.get(tag); - if (!sub) { - const address = addr ? addr : contract; - const filter = { address, topics }; - const listener = (log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - // If fragment is null, we do not deconstruct the args to emit - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment - ? contract.interface.decodeEventLog(fragment, log.data, log.topics) - : []; - emit(contract, event, args, (listener) => { - return new ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } - else { - emit(contract, event, [], (listener) => { - return new ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - let starting = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - const stop = async () => { - if (starting.length == 0) { - return; - } - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; -} -// We use this to ensure one emit resolves before firing the next to -// ensure correct ordering (note this cannot throw and just adds the -// notice to the event queu using setTimeout). -let lastEmit = Promise.resolve(); -async function _emit(contract, event, args, payloadFunc) { - await lastEmit; - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } - catch (error) { } - return !once; - }); - return count > 0; -} -async function emit(contract, event, args, payloadFunc) { - try { - await lastEmit; - } - catch (error) { } - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; -} -const passProperties = ["then"]; -class BaseContract { - target; - interface; - runner; - filters; - [internal]; - fallback; - constructor(target, abi, runner, _deployTx) { - if (runner == null) { - runner = null; - } - const iface = Interface.from(abi); - defineProperties(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - let addrPromise; - let addr = null; - let deployTx = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); - } - let subs = new Map(); - // Resolve the target as the address - if (typeof target === "string") { - if (isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } - else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - }); - } - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - } - else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - // Add the event filters - const filters = new Proxy({}, { - get: (target, _prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = this.getEvent(prop); - if (result) { - return result; - } - throw new Error(`unknown contract event: ${prop}`); - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop))); - }, - }); - defineProperties(this, { filters }); - defineProperties(this, { - fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null, - }); - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, _prop, receiver) => { - if (_prop in target || passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = target.getFunction(prop); - if (result) { - return result; - } - throw new Error(`unknown contract method: ${prop}`); - }, - has: (target, prop) => { - if (prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return target.interface.hasFunction(String(prop)); - }, - }); - } - connect(runner) { - return new BaseContract(this.target, this.interface, runner); - } - async getAddress() { - return await getInternal(this).addrPromise; - } - async getDeployedCode() { - const provider = getProvider(this.runner); - assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - async waitForDeployment() { - // We have the deployement transaction; just use that (throws if deployement fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } - catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - deploymentTransaction() { - return getInternal(this).deployTx; - } - getFunction(key) { - if (typeof key !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - getEvent(key) { - if (typeof key !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - async queryTransaction(hash) { - // Is this useful? - throw new Error("@TODO"); - } - async queryFilter(event, fromBlock, toBlock) { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = addr ? addr : await addrPromise; - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - if (foundFragment) { - return new EventLog(log, this.interface, foundFragment); - } - else { - return new Log(log, provider); - } - }); - } - async on(event, listener) { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - async once(event, listener) { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - async emit(event, ...args) { - return await emit(this, event, args, null); - } - async listenerCount(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - const { subs } = getInternal(this); - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - const { subs } = getInternal(this); - let result = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return await this.off(event, listener); - } - static buildClass(abi) { - class CustomContract extends BaseContract { - constructor(address, runner = null) { - super(address, abi, runner); - } - } - return CustomContract; - } - static from(target, abi, runner) { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract; - } - static isIndexed(value) { - return Indexed.isIndexed(value); - } -} -function _ContractBase() { - return BaseContract; -} -class Contract extends _ContractBase() { -} - -// A = Arguments to the constructor -// I = Interface of deployed contracts -class ContractFactory { - interface; - bytecode; - runner; - constructor(abi, bytecode, runner) { - const iface = Interface.from(abi); - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = hexlify(getBytes(bytecode)); - } - else if (typeof bytecode === "string") { - bytecode = bytecode; - } - else if (isBytes$1(bytecode)) { - bytecode = hexlify(bytecode); - } - else if (bytecode && typeof bytecode.object === "string") { - // Allow the bytecode object from the Solidity compiler - bytecode = bytecode.object; - } - else { - // Crash in the next verification step - bytecode = "!"; - } - defineProperties(this, { - // @ts-ignore - bytecode, - interface: iface, - runner: runner || null, - }); - } - async getDeployTransaction(...args) { - let overrides = {}; - const fragment = this.interface.deploy; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); - const data = concat([ - this.bytecode, - this.interface.encodeDeploy(resolvedArgs), - ]); - return Object.assign({}, overrides, { data }); - } - async deploy(...args) { - const tx = await this.getDeployTransaction(...args); - assert(this.runner && typeof this.runner.sendTransaction === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction", - }); - const sentTx = await this.runner.sendTransaction(tx); - const address = getCreateAddress(sentTx); - return new BaseContract(address, this.interface, this.runner, sentTx); - } - connect(runner) { - return new ContractFactory(this.interface, this.bytecode, runner); - } - static fromSolidity(output, runner) { - assertArgument(output != null, "bad compiler output", "output", output); - if (typeof output === "string") { - output = JSON.parse(output); - } - const abi = output.abi; - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } - else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - return new this(abi, bytecode, runner); - } -} - -/** - * @_ignore - */ -const BN_0 = BigInt(0); -function allowNull(format, nullValue) { - return function (value) { - if (value == null) { - return nullValue; - } - return format(value); - }; -} -function arrayOf(format) { - return (array) => { - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }; -} -// Requires an object which matches a fleet of other formatters -// Any FormatFunc may return `undefined` to have the value omitted -// from the result object. Calls preserve `this`. -function object(format, altNames) { - return (value) => { - const result = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } - catch (error) { - const message = error instanceof Error ? error.message : "not-an-error"; - assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); - } - } - return result; - }; -} -function formatBoolean(value) { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); -} -function formatData(value) { - assertArgument(isHexString(value, true), "invalid data", "value", value); - return value; -} -function formatHash(value) { - assertArgument(isHexString(value, 32), "invalid hash", "value", value); - return value; -} -const _formatLog = object({ - address: getAddress, - blockHash: formatHash, - blockNumber: getNumber, - data: formatData, - index: getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: getNumber, -}, { - index: ["logIndex"], -}); -function formatLog(value) { - return _formatLog(value); -} -const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - number: getNumber, - timestamp: getNumber, - nonce: allowNull(formatData), - difficulty: getBigInt, - energyLimit: getBigInt, - energyUsed: getBigInt, - miner: allowNull(getAddress), - extraData: formatData, - baseFeePerEnergy: allowNull(getBigInt), -}); -function formatBlock(value) { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return formatTransactionResponse(tx); - }); - return result; -} -const _formatReceiptLog = object({ - transactionIndex: getNumber, - blockNumber: getNumber, - transactionHash: formatHash, - address: getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: getNumber, - blockHash: formatHash, -}, { - index: ["logIndex"], -}); -function formatReceiptLog(value) { - return _formatReceiptLog(value); -} -const _formatTransactionReceipt = object({ - to: allowNull(getAddress, null), - from: allowNull(getAddress, null), - contractAddress: allowNull(getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: getNumber, - root: allowNull(hexlify), - energyUsed: getBigInt, - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeEnergyUsed: getBigInt, - effectiveEnergyPrice: allowNull(getBigInt), - status: allowNull(getNumber), - type: allowNull(getNumber, 0), -}, { - effectiveEnergyPrice: ["energyPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], -}); -function formatTransactionReceipt(value) { - return _formatTransactionReceipt(value); -} -function formatTransactionResponse(value) { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && !getAddress(value.to) && getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - const result = object({ - hash: formatHash, - type: (value) => { - if (value === "0x" || value == null) { - return 0; - } - return getNumber(value); - }, - accessList: allowNull(accessListify, null), - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(getNumber, null), - transactionIndex: allowNull(getNumber, null), - //confirmations: allowNull(getNumber, null), - from: getAddress, - maxFeePerEnergy: allowNull(getBigInt), - energyLimit: getBigInt, - to: allowNull(getAddress, null), - value: getBigInt, - nonce: getNumber, - data: formatData, - creates: allowNull(getAddress, null), - networkId: allowNull(getBigInt, null), - }, { - data: ["input"], - energyLimit: ["energy"], - })(value); - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = getCreateAddress(result); - } - // Compute the signature - if (value.signature) { - result.signature = value.signature; - } - else { - result.signature = value; - } - // Some backends omit networkId on legacy transactions, but we can compute it - if (result.networkId == null) { - const networkId = result.signature.legacynetworkId; - if (networkId != null) { - result.networkId = networkId; - } - } - // @TODO: check networkId - /* - if (value.networkId != null) { - let networkId = value.networkId; - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - result.networkId = networkId; - - } else { - let networkId = value.networkId; - - // geth-etc returns networkId - if (networkId == null && result.v == null) { - networkId = value.networkId; - } - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - if (typeof(networkId) !== "number" && result.v != null) { - networkId = (result.v - 35) / 2; - if (networkId < 0) { networkId = 0; } - networkId = parseInt(networkId); - } - - if (typeof(networkId) !== "number") { networkId = 0; } - - result.networkId = networkId; - } - */ - // 0x0000... should actually be null - if (result.blockHash && getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } - return result; -} - -class NetworkPlugin { - name; - constructor(name) { - defineProperties(this, { name }); - } - clone() { - return new NetworkPlugin(this.name); - } -} -class EnergyCostPlugin extends NetworkPlugin { - effectiveBlock; - txBase; - txCreate; - txDataZero; - txDataNonzero; - txAccessListStorageKey; - txAccessListAddress; - constructor(effectiveBlock, costs) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock || 0}`); - const props = { effectiveBlock }; - function set(name, nullish) { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs); - props[name] = value; - } - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - defineProperties(this, props); - } - clone() { - return new EnergyCostPlugin(this.effectiveBlock, this); - } -} -class FeeDataNetworkPlugin extends NetworkPlugin { - #feeDataFunc; - get feeDataFunc() { - return this.#feeDataFunc; - } - constructor(feeDataFunc) { - super("org.corebc.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - async getFeeData(provider) { - return await this.#feeDataFunc(provider); - } - clone() { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } -} -/* -export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } -} -*/ - -/** - * About networks - * - * @_subsection: api/providers:Networks [networks] - */ -/* * * * -// Networks which operation against an L2 can use this plugin to -// specify how to access L1, for the purpose of resolving ENS, -// for example. -export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; -*/ -// Networks or clients with a higher need for security (such as clients -// that may automatically make CCIP requests without user interaction) -// can use this plugin to anonymize requests or intercept CCIP requests -// to notify and/or receive authorization from the user -const Networks = new Map(); -class Network { - #name; - #networkId; - #plugins; - constructor(name, networkId) { - this.#name = name; - this.#networkId = getBigInt(networkId); - this.#plugins = new Map(); - } - toJSON() { - return { name: this.name, networkId: String(this.networkId) }; - } - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name() { - return this.#name; - } - set name(value) { - this.#name = value; - } - /** - * The network chain ID. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = getBigInt(value, "networkId"); - } - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other) { - if (other == null) { - return false; - } - if (typeof other === "string") { - try { - return this.networkId === getBigInt(other); - } - catch (error) { } - return this.name === other; - } - if (typeof other === "number" || typeof other === "bigint") { - try { - return this.networkId === getBigInt(other); - } - catch (error) { } - return false; - } - if (typeof other === "object") { - if (other.networkId != null) { - try { - return this.networkId === getBigInt(other.networkId); - } - catch (error) { } - return false; - } - if (other.name != null) { - return this.name === other.name; - } - return false; - } - return false; - } - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name) { - return this.#plugins.get(name) || null; - } - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename) { - return (this.plugins.filter((p) => p.name.split("#")[0] === basename)); - } - /** - * Create a copy of this Network. - */ - clone() { - const clone = new Network(this.name, this.networkId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - /** - * Compute the intrinsic energy required for a transaction. - * - * A EnergyCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicEnergy(tx) { - const costs = this.getPlugin("org.corebc.plugins.network.EnergyCost") || new EnergyCostPlugin(); - let energy = costs.txBase; - if (tx.to == null) { - energy += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - energy += costs.txDataZero; - } - else { - energy += costs.txDataNonzero; - } - } - } - return energy; - } - /** - * Returns a new Network for the %%network%% name or networkId. - */ - static from(network) { - injectCommonNetworks(); - // Default network - if (network == null) { - return Network.from("mainnet"); - } - // Canonical name or chain ID - if (typeof network === "number") { - network = BigInt(network); - } - if (typeof network === "string" || typeof network === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof network === "bigint") { - return new Network("unknown", network); - } - assertArgument(false, "unknown network", "network", network); - } - // Clonable with network-like abilities - if (typeof network.clone === "function") { - const clone = network.clone(); - //if (typeof(network.name) !== "string" || typeof(network.networkId) !== "number") { - //} - return clone; - } - // Networkish - if (typeof network === "object") { - assertArgument(typeof network.name === "string" && - typeof network.networkId === "number", "invalid network object name or networkId", "network", network); - const custom = new Network(network.name, network.networkId); - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - return custom; - } - assertArgument(false, "invalid network", "network", network); - } - /** - * Register %%nameOrnetworkId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrnetworkId, networkFunc) { - if (typeof nameOrnetworkId === "number") { - nameOrnetworkId = BigInt(nameOrnetworkId); - } - const existing = Networks.get(nameOrnetworkId); - if (existing) { - assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrnetworkId", nameOrnetworkId); - } - Networks.set(nameOrnetworkId, networkFunc); - } -} -// See: https://chainlist.org -let injected = false; -function injectCommonNetworks() { - if (injected) { - return; - } - injected = true; - /// Register popular Core networks - function registerEth(name, networkId, options) { - const func = function () { - const network = new Network(name, networkId); - network.attachPlugin(new EnergyCostPlugin()); - return network; - }; - // Register the network by name and chain ID - Network.register(name, func); - Network.register(networkId, func); - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - registerEth("mainnet", 1, { altNames: ["homestead"] }); - registerEth("ropsten", 3, { }); - registerEth("rinkeby", 4, { }); - registerEth("goerli", 5, { }); - registerEth("kovan", 42, { }); - registerEth("sepolia", 11155111, {}); - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - registerEth("xdai", 100, { }); -} - -function copy$2(obj) { - return JSON.parse(JSON.stringify(obj)); -} -// @TODO: refactor this -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class PollingBlockSubscriber { - #provider; - #poller; - #interval; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - this.#blockNumber = -2; - } - get pollingInterval() { - return this.#interval; - } - set pollingInterval(value) { - this.#interval = value; - } - async #poll() { - try { - const blockNumber = await this.#provider.getBlockNumber(); - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - // @TODO: Put a cap on the maximum number of events per loop? - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - await this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - } - } - catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - // We have been stopped - if (this.#poller == null) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - start() { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - stop() { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class OnBlockSubscriber { - #provider; - #poll; - #running; - constructor(provider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber) => { - this._poll(blockNumber, this.#provider); - }; - } - async _poll(blockNumber, provider) { - throw new Error("sub-classes must override this"); - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poll); - } - pause(dropWhilePaused) { - this.stop(); - } - resume() { - this.start(); - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter; - constructor(provider, filter) { - super(provider); - this.#filter = copy$2(filter); - } - async _poll(blockNumber, provider) { - throw new Error("@TODO"); - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash; - constructor(provider, hash) { - super(provider); - this.#hash = hash; - } - async _poll(blockNumber, provider) { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class PollingEventSubscriber { - #provider; - #filter; - #poller; - #running; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = copy$2(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - async #poll(blockNumber) { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - const filter = copy$2(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - this.#blockNumber = blockNumber; - for (const log of logs) { - this.#provider.emit(this.#filter, log); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} - -/** - * About Subclassing the Provider... - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -// @TODO -// Event coalescence -// When we register an event with an async value (e.g. address is a Signer -// or ENS name), we need to add it immeidately for the Event API, but also -// need time to resolve the address. Upon resolving the address, we need to -// migrate the listener to the static event. We also need to maintain a map -// of Signer/ENS name to address so we can sync respond to listenerCount. -const MAX_CCIP_REDIRECTS = 10; -function isPromise(value) { - return value && typeof value.then === "function"; -} -function getTag(prefix, value) { - return (prefix + - ":" + - JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof v === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof v === "string") { - return v.toLowerCase(); - } - // Sort object keys - if (typeof v === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, {}); - } - return v; - })); -} -class UnmanagedSubscriber { - name; - constructor(name) { - defineProperties(this, { name }); - } - start() { } - stop() { } - pause(dropWhilePaused) { } - resume() { } -} -function copy$1(value) { - return JSON.parse(JSON.stringify(value)); -} -function concisify(items) { - items = Array.from(new Set(items).values()); - items.sort(); - return items; -} -async function getSubscription(_event, provider) { - if (_event == null) { - throw new Error("invalid event"); - } - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - if (typeof _event === "string") { - switch (_event) { - case "block": - case "pending": - case "debug": - case "error": - case "network": { - return { type: _event, tag: _event }; - } - } - } - if (isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - if (_event.orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { - type: "orphan", - tag: getTag("orphan", event), - filter: copy$1(event), - }; - } - if (_event.address || _event.topics) { - const event = _event; - const filter = { - topics: (event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }), - }; - if (event.address) { - const addresses = []; - const promises = []; - const addAddress = (addr) => { - if (isHexString(addr)) { - addresses.push(addr); - } - else { - promises.push((async () => { - addresses.push(await resolveAddress(addr)); - })()); - } - }; - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } - else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - return { filter, tag: getTag("event", filter), type: "event" }; - } - assertArgument(false, "unknown ProviderEvent", "event", _event); -} -function getTime$1() { - return new Date().getTime(); -} -class AbstractProvider { - #subs; - #plugins; - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState; - #networkPromise; - #anyNetwork; - #performCache; - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber; - #nextTimer; - #timers; - #disableCcipRead; - // @TODO: This should be a () => Promise so network can be - // done when needed; or rely entirely on _detectNetwork? - constructor(_network) { - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } - else if (_network) { - const network = Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { - this.emit("network", network, null); - }, 0); - } - else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - this.#lastBlockNumber = -1; - this.#performCache = new Map(); - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - this.#nextTimer = 1; - this.#timers = new Map(); - this.#disableCcipRead = false; - } - get provider() { - return this; - } - get plugins() { - return Array.from(this.#plugins.values()); - } - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - getPlugin(name) { - return this.#plugins.get(name) || null; - } - get disableCcipRead() { - return this.#disableCcipRead; - } - set disableCcipRead(value) { - this.#disableCcipRead = !!value; - } - // Shares multiple identical requests made during the same 250ms - async #perform(req) { - // Create a tag - const tag = getTag(req.method, req); - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, 250); - } - return await perform; - } - async ccipReadFetch(tx, calldata, urls) { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - const errorMessages = []; - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - this.emit("debug", { - action: "sendCcipReadFetchRequest", - request, - index: i, - urls, - }); - let errorMessage = "unknown error"; - const resp = await request.send(); - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { - action: "receiveCcipReadFetchResult", - request, - result, - }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { - action: "receiveCcipReadFetchError", - request, - result, - }); - } - catch (error) { } - // 4xx indicates the result is not present; stop - 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 }, - }); - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - assert(false, `error encountered during CCIP fetch: ${errorMessages - .map((m) => JSON.stringify(m)) - .join(", ")}`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, - info: { urls, errorMessages }, - }); - } - _wrapBlock(value, network) { - return new Block(formatBlock(value), this); - } - _wrapLog(value, network) { - return new Log(formatLog(value), this); - } - _wrapTransactionReceipt(value, network) { - return new TransactionReceipt(formatTransactionReceipt(value), this); - } - _wrapTransactionResponse(tx, network) { - return new TransactionResponse(formatTransactionResponse(tx), this); - } - _detectNetwork() { - assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork", - }); - } - // Sub-classes should override this and handle PerformActionRequest requests, calling - // the super for any unhandled actions. - async _perform(req) { - assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req, - }); - } - // State - async getBlockNumber() { - const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - _getAddress(address) { - return resolveAddress(address); - } - _getBlockTag(blockTag) { - if (blockTag == null) { - return "latest"; - } - switch (blockTag) { - case "earliest": - return "0x0"; - case "latest": - case "pending": - case "safe": - case "finalized": - return blockTag; - } - if (isHexString(blockTag)) { - if (isHexString(blockTag, 32)) { - return blockTag; - } - return toQuantity(blockTag); - } - if (typeof blockTag === "bigint") { - blockTag = getNumber(blockTag, "blockTag"); - } - if (typeof blockTag === "number") { - if (blockTag >= 0) { - return toQuantity(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return toQuantity(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => toQuantity(b + blockTag)); - } - assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - _getFilter(filter) { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - const blockHash = "blockHash" in filter ? filter.blockHash : undefined; - const resolve = (_address, fromBlock, toBlock) => { - let address = undefined; - switch (_address.length) { - case 0: - break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - return filter; - }; - // Addresses could be async (ENS names or Addressables) - let address = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } - else { - address.push(this._getAddress(filter.address)); - } - } - let fromBlock = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - let toBlock = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - if (address.filter((a) => typeof a !== "string").length || - (fromBlock != null && typeof fromBlock !== "string") || - (toBlock != null && typeof toBlock !== "string")) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - return resolve(address, fromBlock, toBlock); - } - _getTransactionRequest(_request) { - const request = copyRequest(_request); - const promises = []; - ["to", "from"].forEach((key) => { - if (request[key] == null) { - return; - } - const addr = resolveAddress(request[key]); - if (isPromise(addr)) { - promises.push((async function () { - request[key] = await addr; - })()); - } - else { - request[key] = addr; - } - }); - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise(blockTag)) { - promises.push((async function () { - request.blockTag = await blockTag; - })()); - } - else { - request.blockTag = blockTag; - } - } - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - return request; - } - async getNetwork() { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = this._detectNetwork().then((network) => { - this.emit("network", network, null); - return network; - }, (error) => { - // Reset the networkPromise on failure, so we will try again - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - }); - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - const networkPromise = this.#networkPromise; - const [expected, actual] = await Promise.all([ - networkPromise, // Possibly an explicit Network - this._detectNetwork(), // The actual connected network - ]); - if (expected.networkId !== actual.networkId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } - else { - // Otherwise, we do not allow changes to the underlying network - assert(false, `network changed: ${expected.networkId} => ${actual.networkId} `, "NETWORK_ERROR", { - event: "changed", - }); - } - } - return expected.clone(); - } - async getEnergyPrice() { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new FeeData(energyPrice); - } - async getFeeData() { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new FeeData(energyPrice); - } - async estimateEnergy(_tx) { - let tx = this._getTransactionRequest(_tx); - if (isPromise(tx)) { - tx = await tx; - } - return getBigInt(await this.#perform({ - method: "estimateEnergy", - transaction: tx, - }), "%response"); - } - async #call(tx, blockTag, attempt) { - assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }), - }); - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = copyRequest(tx); - try { - return hexlify(await this._perform({ method: "call", transaction, blockTag })); - } - catch (error) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && - isCallException(error) && - error.data && - attempt >= 0 && - blockTag === "latest" && - transaction.to != null && - dataSlice(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - const txSender = await resolveAddress(transaction.to); - // Parse the CCIP Read Arguments - let ccipArgs; - try { - ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); - } - catch (error) { - assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", - transaction, - info: { data }, - }); - } - // Check the sender of the OffchainLookup matches the transaction - assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, // @TODO: populate data? - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs, - }, - }); - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", - transaction, - info: { data: error.data, errorArgs: ccipArgs.errorArgs }, - }); - const tx = { - to: txSender, - data: concat([ - ccipArgs.selector, - encodeBytes([ccipResult, ccipArgs.extraData]), - ]), - }; - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { - action: "receiveCcipReadCallResult", - transaction: Object.assign({}, tx), - result, - }); - return result; - } - catch (error) { - this.emit("debug", { - action: "receiveCcipReadCallError", - transaction: Object.assign({}, tx), - error, - }); - throw error; - } - } - throw error; - } - } - async #checkNetwork(promise) { - const { value } = await resolveProperties({ - network: this.getNetwork(), - value: promise, - }); - return value; - } - async call(_tx) { - const { tx, blockTag } = await resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag), - }); - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); - } - // Account - async #getAccountValue(request, _address, _blockTag) { - let address = this._getAddress(_address); - let blockTag = this._getBlockTag(_blockTag); - if (typeof address !== "string" || typeof blockTag !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - async getBalance(address, blockTag) { - return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - async getTransactionCount(address, blockTag) { - return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - async getCode(address, blockTag) { - return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - async getStorage(address, _position, blockTag) { - const position = getBigInt(_position, "position"); - return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - // Write - async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx, - }), - network: this.getNetwork(), - }); - const tx = Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - async #getBlock(block, includeTransactions) { - // @TODO: Add CustomBlockPlugin check - if (isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", - blockHash: block, - includeTransactions, - }); - } - let blockTag = this._getBlockTag(block); - if (typeof blockTag !== "string") { - blockTag = await blockTag; - } - return await this.#perform({ - method: "getBlock", - blockTag, - includeTransactions, - }); - } - // Queries - async getBlock(block, prefetchTxs) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs), - }); - if (params == null) { - return null; - } - return this._wrapBlock(params, network); - } - async getTransaction(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }), - }); - if (params == null) { - return null; - } - return this._wrapTransactionResponse(params, network); - } - async getTransactionReceipt(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }), - }); - if (params == null) { - return null; - } - // Some backends did not backfill the effectiveEnergyPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.energyPrice == null && params.effectiveEnergyPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error("report this; could not find tx or effectiveEnergyPrice"); - } - params.effectiveEnergyPrice = tx.energyPrice; - } - return this._wrapTransactionReceipt(params, network); - } - async getTransactionResult(hash) { - const { result } = await resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }), - }); - if (result == null) { - return null; - } - return hexlify(result); - } - // Bloom-filter Queries - async getLogs(_filter) { - let filter = this._getFilter(_filter); - if (isPromise(filter)) { - filter = await filter; - } - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getLogs", filter }), - }); - return params.map((p) => this._wrapLog(p, network)); - } - // ENS - _getProvider(networkId) { - assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()", - }); - } - async waitForTransaction(hash, _confirms, timeout) { - const confirms = _confirms != null ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - return new Promise(async (resolve, reject) => { - let timer = null; - const listener = async (blockNumber) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } - catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }; - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - listener(await this.getBlockNumber()); - }); - } - async waitForBlock(blockTag) { - assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock", - }); - } - _clearTimeout(timerId) { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - _setTimeout(_func, timeout) { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } - else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime$1() }); - } - return timerId; - } - _forEachSubscriber(func) { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - // Event API; sub-classes should override this; any supported - // event filter will have been munged into an EventFilter - _getSubscriber(sub) { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": - return new PollingBlockSubscriber(this); - case "event": - return new PollingEventSubscriber(this, sub.filter); - case "transaction": - return new PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new PollingOrphanSubscriber(this, sub.filter); - } - throw new Error(`unsupported event: ${sub.type}`); - } - _recoverSubscriber(oldSub, newSub) { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - async #hasSub(event, emitArgs) { - let sub = await getSubscription(event); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && - emitArgs && - emitArgs.length > 0 && - emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }); - } - return this.#subs.get(sub.tag) || null; - } - async #getSub(event) { - const subscription = await getSubscription(event); - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { - subscriber, - tag, - addressableMap, - nameMap, - started: false, - listeners: [], - }; - this.#subs.set(tag, sub); - } - return sub; - } - async on(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async once(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async emit(event, ...args) { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new EventPayload(this, once ? null : listener, event); - try { - listener.call(this, ...args, payload); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return count > 0; - } - async listenerCount(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return this.off(event, listener); - } - // Sub-classes should override this to shutdown any sockets, etc. - // but MUST call this super.shutdown. - destroy() { - // Stop all listeners - this.removeAllListeners(); - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - } - get paused() { - return this.#pausedState != null; - } - set paused(pause) { - if (!!pause === this.paused) { - return; - } - if (this.paused) { - this.resume(); - } - else { - this.pause(false); - } - } - pause(dropWhilePaused) { - this.#lastBlockNumber = -1; - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause", - }); - } - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - // Remaining time needed for when we become unpaused - timer.time = getTime$1() - timer.time; - } - } - resume() { - if (this.#pausedState == null) { - return; - } - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime$1(); - // Start the timer - setTimeout(timer.func, timeout); - } - } -} -function _parseString(result, start) { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return toUtf8String(bytes); - } - } - catch (error) { } - return null; -} -function _parseBytes(result, start) { - if (result === "0x") { - return null; - } - try { - const offset = getNumber(dataSlice(result, start, start + 32)); - const length = getNumber(dataSlice(result, offset, offset + 32)); - return dataSlice(result, offset + 32, offset + 32 + length); - } - catch (error) { } - return null; -} -function numPad(value) { - const result = toBeArray(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; -} -function bytesPad(value) { - if (value.length % 32 === 0) { - return value; - } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; -} -const empty = new Uint8Array([]); -// ABI Encodes a series of (bytes, bytes, ...) -function encodeBytes(datas) { - const result = []; - let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - for (let i = 0; i < datas.length; i++) { - const data = getBytes(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } - return concat(result); -} -const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; -function parseOffchainLookup(data) { - const result = { - sender: "", - urls: [], - calldata: "", - selector: "", - extraData: "", - errorArgs: [], - }; - assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data", - }); - const sender = dataSlice(data, 0, 32); - assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender", - }); - result.sender = dataSlice(sender, 12); - // Read the URLs from the response - try { - const urls = []; - const urlsOffset = getNumber(dataSlice(data, 32, 64)); - const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); - const urlsData = dataSlice(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } - catch (error) { - assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls", - }); - } - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } - catch (error) { - assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata", - }); - } - // Get the callbackSelector (bytes4) - assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector", - }); - result.selector = dataSlice(data, 96, 100); - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } - catch (error) { - assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData", - }); - } - result.errorArgs = "sender,urls,calldata,selector,extraData" - .split(/,/) - .map((k) => result[k]); - return result; -} - -/** - * About Abstract Signer and subclassing - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ -function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); -} -async function populate(signer, tx) { - let pop = copyRequest(tx); - if (pop.to != null) { - pop.to = resolveAddress(pop.to); - } - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).then(([address, from]) => { - assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); - return address; - }); - } - else { - pop.from = signer.getAddress(); - } - return await resolveProperties(pop); -} -class AbstractSigner { - provider; - constructor(provider) { - defineProperties(this, { provider: provider || null }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.energyLimit == null) { - pop.energyLimit = await this.estimateEnergy(pop); - } - // Populate the chain ID - const network = await this.provider.getNetwork(); - if (pop.networkId != null) { - const networkId = getBigInt(pop.networkId); - assertArgument(networkId === network.networkId, "transaction networkId mismatch", "tx.networkId", tx.networkId); - } - else { - pop.networkId = network.networkId; - } - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - // We need to auto-detect the intended type of this transaction... - if (feeData.energyPrice != null) { - // Network doesn't support EIP-1559... - // Populate missing fee data - if (pop.energyPrice == null) { - pop.energyPrice = feeData.energyPrice; - } - } - else { - // getFeeData has failed us. - assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData", - }); - } - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await resolveProperties(pop); - } - async estimateEnergy(tx) { - return checkProvider(this, "estimateEnergy").estimateEnergy(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name) { - return getAddress(name); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } -} -class VoidSigner extends AbstractSigner { - address; - constructor(address, provider) { - super(provider); - defineProperties(this, { address }); - } - async getAddress() { - return this.address; - } - connect(provider) { - return new VoidSigner(this.address, provider); - } - #throwUnsupported(suffix, operation) { - assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { - operation, - }); - } - async signTransaction(tx) { - this.#throwUnsupported("transactions", "signTransaction"); - } - async signMessage(message) { - this.#throwUnsupported("messages", "signMessage"); - } - async signTypedData(domain, types, value) { - this.#throwUnsupported("typed-data", "signTypedData"); - } -} - -/** - * There are many awesome community services that provide Core - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -// Show the throttle message only once per service -const shown = new Set(); -/** - * Displays a warning in tht console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -function showThrottleMessage(service) { - if (shown.has(service)) { - return; - } - shown.add(service); - console.log("========= NOTICE ========="); - console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); -} - -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdSubscriber { - #provider; - #filterIdPromise; - #poller; - #running; - #network; - #hault; - constructor(provider) { - this.#provider = provider; - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#network = null; - this.#hault = false; - } - _subscribe(provider) { - throw new Error("subclasses must override this"); - } - _emitResults(provider, result) { - throw new Error("subclasses must override this"); - } - _recover(provider) { - throw new Error("subclasses must override this"); - } - async #poll(blockNumber) { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - // Get the Filter ID - let filterId = null; - try { - filterId = await this.#filterIdPromise; - } - catch (error) { - if (!isError(error, "UNSUPPORTED_OPERATION") || - error.operation !== "xcb_newFilter") { - throw error; - } - } - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - if (this.#network.networkId !== network.networkId) { - throw new Error("chaid changed"); - } - if (this.#hault) { - return; - } - const result = await this.#provider.send("xcb_getFilterChanges", [ - filterId, - ]); - await this._emitResults(this.#provider, result); - } - catch (error) { - console.log("@TODO", error); - } - this.#provider.once("block", this.#poller); - } - #teardown() { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - this.#provider.send("xcb_uninstallFilter", [filterId]); - }); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - resume() { - this.start(); - } -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdEventSubscriber extends FilterIdSubscriber { - #event; - constructor(provider, filter) { - super(provider); - this.#event = copy(filter); - } - _recover(provider) { - return new PollingEventSubscriber(provider, this.#event); - } - async _subscribe(provider) { - const filterId = await provider.send("xcb_newFilter", [this.#event]); - return filterId; - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider) { - return await provider.send("xcb_newPendingTransactionFilter", []); - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit("pending", result); - } - } -} - -/** - * About JSON-RPC... - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -// @TODO: -// - Add the batching API -const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); -//const Methods = "getAddress,then".split(/,/g); -function deepCopy(value) { - if (value == null || Primitive.indexOf(typeof value) >= 0) { - return value; - } - // Keep any Addressable - if (typeof value.getAddress === "function") { - return value; - } - if (Array.isArray(value)) { - return value.map(deepCopy); - } - if (typeof value === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = value[key]; - return accum; - }, {}); - } - throw new Error(`should not happen: ${value} (${typeof value})`); -} -function stall$3(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); -} -function getLowerCase(value) { - if (value) { - return value.toLowerCase(); - } - return value; -} -function isPollable(value) { - return value && typeof value.pollingInterval === "number"; -} -const defaultOptions = { - polling: false, - staticNetwork: null, - batchStallTime: 10, // 10ms - batchMaxSize: 1 << 20, // 1Mb - batchMaxCount: 100, // 100 requests -}; -// @TODO: Unchecked Signers -class JsonRpcSigner extends AbstractSigner { - address; - constructor(provider, address) { - super(provider); - address = getAddress(address); - defineProperties(this, { address }); - } - connect(provider) { - assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect", - }); - } - async getAddress() { - return this.address; - } - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx) { - return await this.populateCall(tx); - } - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx) { - const tx = deepCopy(_tx); - const promises = []; - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await resolveAddress(_from); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } - else { - tx.from = this.address; - } - // The JSON-RPC for xcb_sendTransaction uses 90000 energy; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.energyLimit == null) { - promises.push((async () => { - tx.energyLimit = await this.provider.estimateEnergy({ - ...tx, - from: this.address, - }); - })()); - } - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await resolveAddress(_to); - })()); - } - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - const hexTx = this.provider.getRpcTransaction(tx); - return this.provider.send("xcb_sendTransaction", [hexTx]); - } - async sendTransaction(tx) { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - const checkTx = async () => { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - // Wait another 4 seconds - this.provider._setTimeout(() => { - checkTx(); - }, timeouts.pop() || 4000); - }; - checkTx(); - }); - } - async signTransaction(_tx) { - const tx = deepCopy(_tx); - // Make sure the from matches the sender - if (tx.from) { - const from = await resolveAddress(tx.from); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - } - else { - tx.from = this.address; - } - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("xcb_signTransaction", [hexTx]); - } - async signMessage(_message) { - const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("personal_sign", [ - hexlify(message), - this.address.toLowerCase(), - ]); - } - async signTypedData(domain, types, _value) { - const value = deepCopy(_value); - // Populate any ENS names (in-place) - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await resolveAddress(value); - assertArgument(address != null, "TypedData does not support null address", "value", value); - return address; - }); - return await this.provider.send("xcb_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value)), - ]); - } - async unlock(password) { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), - password, - null, - ]); - } - async _legacySignMessage(_message) { - const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("xcb_sign", [ - this.address.toLowerCase(), - hexlify(message), - ]); - } -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -class JsonRpcApiProvider extends AbstractProvider { - #options; - // The next ID to use for the JSON-RPC ID field - #nextId; - // Payloads are queued and triggered in batches using the drainTimer - #payloads; - #drainTimer; - #notReady; - #network; - #scheduleDrain() { - if (this.#drainTimer) { - return; - } - // If we aren't using batching, no hard in sending it immeidately - const stallTime = this._getOption("batchMaxCount") === 1 - ? 0 - : this._getOption("batchStallTime"); - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - const payloads = this.#payloads; - this.#payloads = []; - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [payloads.shift()]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push(payloads.shift()); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift(batch.pop()); - break; - } - } - // Process the result to each payload - (async () => { - const payload = batch.length === 1 ? batch[0].payload : batch.map((p) => p.payload); - this.emit("debug", { action: "sendRpcPayload", payload }); - try { - // console.log({payload}) - const result = await this._send(payload); - // console.log({result}) - this.emit("debug", { action: "receiveRpcResult", result }); - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - // Find the matching result - const resp = result.filter((r) => r.id === payload.id)[0]; - // No result; the node failed us in unexpected ways - if (resp == null) { - return reject(makeError("no response from server", "BAD_DATA", { - value: result, - info: { payload }, - })); - } - // The response is an error - if ("error" in resp) { - return reject(this.getRpcError(payload, resp)); - } - // All good; send the result - resolve(resp.result); - } - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - constructor(network, options) { - super(network); - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - this.#payloads = []; - this.#drainTimer = null; - this.#network = null; - { - let resolve = null; - const promise = new Promise((_resolve) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - // Make sure any static network is compatbile with the provided netwrok - const staticNetwork = this._getOption("staticNetwork"); - if (staticNetwork) { - assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key) { - return this.#options[key]; - } - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network() { - assert(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - /* - { - assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { - operation: "jsonRpcApiProvider._send" - }); - } - */ - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req) { - const request = this.getRpcRequest(req); - if (request != null) { - return await this.send(request.method, request.args); - } - return super._perform(req); - } - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork() { - const network = this._getOption("staticNetwork"); - if (network) { - return network; - } - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - return Network.from(getBigInt(await this.send("xcb_networkId", []))); - } - // We are not ready yet; use the primitive _send - const payload = { - id: this.#nextId++, - method: "xcb_networkId", - params: [], - jsonrpc: "2.0", - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return Network.from(getBigInt(result.result)); - } - throw this.getRpcError(payload, result); - } - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start() { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - this.#notReady.resolve(); - this.#notReady = null; - (async () => { - // Bootstrap the network - while (this.#network == null) { - try { - this.#network = await this._detectNetwork(); - } - catch (error) { - console.log("JsonRpcProvider failed to startup; retry in 1s"); - await stall$3(1000); - } - } - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady() { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub) { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new FilterIdPendingSubscriber(this); - } - if (sub.type === "event") { - if (this._getOption("polling")) { - return new PollingEventSubscriber(this, sub.filter); - } - return new FilterIdEventSubscriber(this, sub.filter); - } - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("orphan"); - } - return super._getSubscriber(sub); - } - /** - * Returns true only if the [[_start]] has been called. - */ - get ready() { - return this.#notReady == null; - } - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx) { - const result = {}; - // JSON-RPC now requires numeric values to be "quantity" values - [ - "networkId", - "energyLimit", - "energyPrice", - "type", - "nonce", - "value", - ].forEach((key) => { - if (tx[key] == null) { - return; - } - let dstKey = key; - if (key === "energyLimit") { - dstKey = "energy"; - } - result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`)); - }); - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if (tx[key] == null) { - return; - } - result[key] = hexlify(tx[key]); - }); - return result; - } - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req) { - switch (req.method) { - case "networkId": - return { method: "xcb_networkId", args: [] }; - case "getBlockNumber": - return { method: "xcb_blockNumber", args: [] }; - case "getEnergyPrice": - return { method: "xcb_energyPrice", args: [] }; - case "getBalance": { - return { - method: "xcb_getBalance", - args: [getLowerCase(req.address), req.blockTag], - }; - } - case "getTransactionCount": - return { - method: "xcb_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getCode": - return { - method: "xcb_getCode", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getStorage": - return { - method: "xcb_getStorageAt", - args: [ - getLowerCase(req.address), - "0x" + req.position.toString(16), - req.blockTag, - ], - }; - case "broadcastTransaction": - return { - method: "xcb_sendRawTransaction", - args: [req.signedTransaction], - }; - case "getBlock": - if ("blockTag" in req) { - return { - method: "xcb_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions], - }; - } - else if ("blockHash" in req) { - return { - method: "xcb_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions], - }; - } - break; - case "getTransaction": - return { - method: "xcb_getTransactionByHash", - args: [req.hash], - }; - case "getTransactionReceipt": - return { - method: "xcb_getTransactionReceipt", - args: [req.hash], - }; - case "call": - return { - method: "xcb_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag], - }; - case "estimateEnergy": { - return { - method: "xcb_estimateEnergy", - args: [this.getRpcTransaction(req.transaction)], - }; - } - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } - else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "xcb_getLogs", args: [req.filter] }; - } - return null; - } - /** - * Returns an CoreBC-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload, _error) { - const { method } = payload; - const { error } = _error; - if (method === "xcb_estimateEnergy" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: payload.params[0], - info: { payload, error }, - }); - } - } - if (method === "xcb_call" || method === "xcb_estimateEnergy") { - const result = spelunkData(error); - const e = AbiCoder.getBuiltinCallException(method === "xcb_call" ? "call" : "estimateEnergy", payload.params[0], result ? result.data : null); - e.info = { error, payload }; - return e; - } - // Only estimateEnergy and call can return arbitrary contract-defined text, so now we - // we can process text safely. - const message = JSON.stringify(spelunkMessage(error)); - if (typeof error.message === "string" && - error.message.match(/user denied|corebc-user-denied/i)) { - const actionMap = { - xcb_sign: "signMessage", - personal_sign: "signMessage", - xcb_signTypedData_v4: "signTypedData", - xcb_signTransaction: "signTransaction", - xcb_sendTransaction: "sendTransaction", - xcb_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - return makeError(`user rejected action`, "ACTION_REJECTED", { - action: actionMap[method] || "unknown", - reason: "rejected", - info: { payload, error }, - }); - } - if (method === "xcb_sendRawTransaction" || - method === "xcb_sendTransaction") { - const transaction = payload.params[0]; - if (message.match(/insufficient funds|base fee exceeds energy limit/i)) { - return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, - info: { error }, - }); - } - if (message.match(/nonce/i) && message.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction, - info: { error }, - }); - } - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && - message.match(/underpriced/i)) { - return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction, - info: { error }, - }); - } - if (message.match(/only replay-protected/i)) { - return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, - info: { transaction, info: { error } }, - }); - } - } - if (message.match(/the method .* does not exist/i)) { - return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, - info: { error }, - }); - } - return makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); - } - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method, params) { - // @TODO: cache networkId?? purge on switch_networks - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, - reject, - payload: { method, params, id, jsonrpc: "2.0" }, - }); - }); - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - return promise; - } - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address) { - if (address == null) { - address = 0; - } - const accountsPromise = this.send("xcb_accounts", []); - // Account index - if (typeof address === "number") { - const accounts = await accountsPromise; - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - const { accounts } = await resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise, - }); - // Account address - address = getAddress(address); - for (const account of accounts) { - if (getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - throw new Error("invalid account"); - } - async listAccounts() { - const accounts = await this.send("xcb_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } -} -class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval; - constructor(network, options) { - super(network, options); - this.#pollingInterval = 4000; - } - _getSubscriber(sub) { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval() { - return this.#pollingInterval; - } - set pollingInterval(value) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect; - constructor(url, network, options) { - if (url == null) { - url = "http://localhost:8545"; - } - super(network, options); - if (typeof url === "string") { - this.#connect = new FetchRequest(url); - } - else { - this.#connect = url.clone(); - } - } - _getConnection() { - return this.#connect.clone(); - } - async send(method, params) { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. xcb_networkId) until we absolutely have to. - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - return resp; - } -} -function spelunkData(value) { - if (value == null) { - return null; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string" && - value.message.match("reverted") && - isHexString(value.data)) { - return { message: value.message, data: value.data }; - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return spelunkData(JSON.parse(value)); - } - catch (error) { } - } - return null; -} -function _spelunkMessage(value, result) { - if (value == null) { - return; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string") { - result.push(value.message); - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } - catch (error) { } - } -} -function spelunkMessage(value) { - const result = []; - _spelunkMessage(value, result); - return result; -} - -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -const defaultApiKey$1 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; -function getHost$4(name) { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/xcb_goerli"; - case "matic": - return "rpc.ankr.com/polygon"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -class AnkrProvider extends JsonRpcProvider { - /** - * The API key for the Ankr connection. - */ - apiKey; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AnkrProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - const request = new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey$1) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("AnkrProvider"); - return true; - }; - } - return request; - } - getRpcError(payload, error) { - if (payload.method === "xcb_sendRawTransaction") { - if (error && - error.error && - error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - return super.getRpcError(payload, error); - } - isCommunityResource() { - return this.apiKey === defaultApiKey$1; - } -} - -/** - * About Alchemy - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; -function getHost$3(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.alchemyapi.io"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -class AlchemyProvider extends JsonRpcProvider { - apiKey; - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AlchemyProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - async _perform(req) { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await resolveProperties({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash), - }); - if (trace == null || tx == null) { - return null; - } - let data; - let error = false; - try { - data = trace[0].result.output; - error = trace[0].error === "Reverted"; - } - catch (error) { } - if (data) { - assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null, // @TODO - }); - return data; - } - assert(false, "could not parse trace result", "BAD_DATA", { - value: trace, - }); - } - return await super._perform(req); - } - isCommunityResource() { - return this.apiKey === defaultApiKey; - } - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("alchemy"); - return true; - }; - } - return request; - } -} - -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -/** - * About Cloudflare... - */ -class CloudflareProvider extends JsonRpcProvider { - constructor(_network) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - assertArgument(network.name === "mainnet", "unsupported network", "network", _network); - super("https://cloudflare-eth.com/", network, { staticNetwork: network }); - } -} - -function getGlobal() { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); -} -const _WebSocket = getGlobal().WebSocket; - -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider - */ -class SocketSubscriber { - #provider; - #filter; - get filter() { - return JSON.parse(this.#filter); - } - #filterId; - #paused; - #emitPromise; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - start() { - this.#filterId = this.#provider - .send("xcb_subscribe", this.filter) - .then((filterId) => { - this.#provider._register(filterId, this); - return filterId; - }); - } - stop() { - this.#filterId.then((filterId) => { - this.#provider.send("xcb_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused) { - assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - resume() { - this.#paused = null; - } - _handleMessage(message) { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } - else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - async _emit(provider, message) { - throw new Error("sub-classes must implemente this; _emit"); - } -} -class SocketBlockSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newHeads"]); - } - async _emit(provider, message) { - provider.emit("block", parseInt(message.number)); - } -} -class SocketPendingSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newPendingTransactions"]); - } - async _emit(provider, message) { - provider.emit("pending", message); - } -} -class SocketEventSubscriber extends SocketSubscriber { - #logFilter; - get logFilter() { - return JSON.parse(this.#logFilter); - } - constructor(provider, filter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - async _emit(provider, message) { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } -} -/** - * SocketProvider... - * - */ -class SocketProvider extends JsonRpcApiProvider { - #callbacks; - // Maps each filterId to its subscriber - #subs; - // If any events come in before a subscriber has finished - // registering, queue them - #pending; - constructor(network) { - super(network, { batchMaxCount: 1 }); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - _getSubscriber(sub) { - switch (sub.type) { - case "close": - return new UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - _register(filterId, subscriber) { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - async _send(payload) { - // WebSocket provider doesn't accept batches - assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - // @TODO: stringify payloads here and store to prevent mutations - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - // Write the request to the socket - await this._write(JSON.stringify(payload)); - return [await promise]; - } - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - // Sub-classes must call this for each message - async _processMessage(message) { - const result = (JSON.parse(message)); - if ("id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result, - })); - return; - } - this.#callbacks.delete(result.id); - callback.resolve(result); - } - else if (result.method === "xcb_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } - else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - } - async _write(message) { - throw new Error("sub-classes must override this"); - } -} - -class WebSocketProvider extends SocketProvider { - #connect; - #websocket; - get websocket() { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } - constructor(url, network) { - super(network); - if (typeof url === "string") { - this.#connect = () => { - return new _WebSocket(url); - }; - this.#websocket = this.#connect(); - } - else if (typeof url === "function") { - this.#connect = url; - this.#websocket = url(); - } - else { - this.#connect = null; - this.#websocket = url; - } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } - catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - this.websocket.onmessage = (message) => { - this._processMessage(message.data); - }; - /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; -*/ - } - async _write(message) { - this.websocket.send(message); - } - async destroy() { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } -} - -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -const defaultProjectId = "84842078b09946638c03157f83405213"; -function getHost$2(name) { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -class InfuraWebSocketProvider extends WebSocketProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network, projectId) { - const provider = new InfuraProvider(network, projectId); - const req = provider._getConnection(); - assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, network); - defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret, - }); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -class InfuraProvider extends JsonRpcProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network, projectId, projectSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - defineProperties(this, { projectId, projectSecret }); - } - _getProvider(networkId) { - try { - return new InfuraProvider(networkId, this.projectId, this.projectSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network, projectId) { - return new InfuraWebSocketProvider(network, projectId); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network, projectId, projectSecret) { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("InfuraProvider"); - return true; - }; - } - return request; - } -} - -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; -function getHost$1(name) { - switch (name) { - case "mainnet": - return "corebc.quiknode.pro"; - case "arbitrum": - return "corebc.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "corebc.arbitrum-goerli.quiknode.pro"; - case "matic": - return "corebc.matic.quiknode.pro"; - case "matic-mumbai": - return "corebc.matic-testnet.quiknode.pro"; - case "optimism": - return "corebc.optimism.quiknode.pro"; - case "optimism-goerli": - return "corebc.optimism-goerli.quiknode.pro"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -class QuickNodeProvider extends JsonRpcProvider { - /** - * The API token. - */ - token; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network, token) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (token == null) { - token = defaultToken; - } - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - defineProperties(this, { token }); - } - _getProvider(networkId) { - try { - return new QuickNodeProvider(networkId, this.token); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.token === defaultToken; - } - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network, token) { - if (token == null) { - token = defaultToken; - } - const request = new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - return request; - } -} - -/** - * Explain all the nitty-gritty about the **FallbackProvider**. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ -const BN_1 = BigInt("1"); -const BN_2 = BigInt("2"); -function shuffle(array) { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } -} -function stall$2(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); -} -function getTime() { - return new Date().getTime(); -} -function stringify(value) { - return JSON.stringify(value, (key, value) => { - if (typeof value === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); -} -const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; -const defaultState = { - blockNumber: -2, - requests: 0, - lateResponses: 0, - errorResponses: 0, - outOfSync: -1, - unsupportedEvents: 0, - rollingDuration: 0, - score: 0, - _network: null, - _updateNumber: null, - _totalTime: 0, -}; -async function waitForSync(config, blockNumber) { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - } -} -function _normalize(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[" + value.map(_normalize).join(",") + "]"; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return _normalize(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{" + - keys - .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`) - .join(",") + - "}"); - } - } - console.log("Could not serialize", value); - throw new Error("Hmm..."); -} -function normalizeResult(value) { - if ("error" in value) { - const error = value.error; - return { tag: _normalize(error), value: error }; - } - const result = value.result; - return { tag: _normalize(result), value: result }; -} -// This strategy picks the highest weight result, as long as the weight is -// equal to or greater than quorum -function checkQuorum(quorum, results) { - const tally = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - let best = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - if (best) { - return best.value; - } - return undefined; -} -function getMedian(quorum, results) { - let resultWeight = 0; - const errorMap = new Map(); - let bestError = null; - const values = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } - else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - // We do not have quorum for a result - return undefined; - } - // Get the sorted values - values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0)); - const mid = Math.floor(values.length / 2); - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; -} -function getAnyResult(quorum, results) { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - // Nope! - return undefined; -} -function getFuzzyMode(quorum, results) { - if (quorum === 1) { - return getNumber(getMedian(quorum, results), "%internal"); - } - const tally = new Map(); - const add = (result, weight) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - for (const { weight, value } of results) { - const r = getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - let bestWeight = 0; - let bestResult = undefined; - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && - (weight > bestWeight || - (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - return bestResult; -} -/** - * A Fallback Provider. - * - */ -class FallbackProvider extends AbstractProvider { - quorum; - eventQuorum; - eventWorkers; - #configs; - #height; - #initialSyncPromise; - constructor(providers, network) { - super(network); - this.#configs = providers.map((p) => { - if (p instanceof AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } - else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - this.#height = -2; - this.#initialSyncPromise = null; - this.quorum = 2; //Math.ceil(providers.length / 2); - this.eventQuorum = 1; - this.eventWorkers = 1; - assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), "quorum exceed provider wieght", "quorum", this.quorum); - } - get providerConfigs() { - return this.#configs.map((c) => { - const result = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - async _detectNetwork() { - return Network.from(getBigInt(await this._perform({ method: "networkId" }))); - } - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - async _translatePerform(provider, req) { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); - case "networkId": - return (await provider.getNetwork()).networkId; - case "estimateEnergy": - return await provider.estimateEnergy(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = "blockHash" in req ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getEnergyPrice": - return (await provider.getFeeData()).energyPrice; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running) { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - const configs = Array.from(running).map((r) => r.config); - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => b.priority - a.priority); - for (const config of allConfigs) { - if (configs.indexOf(config) === -1) { - return config; - } - } - return null; - } - // Adds a new runner (if available) to running. - #addRunner(running, req) { - const config = this.#getNextConfig(running); - // No runners available - if (config == null) { - return null; - } - // Create a new runner - const runner = { - config, - result: null, - didBump: false, - perform: null, - staller: null, - }; - const now = getTime(); - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } - catch (error) { - config.errorResponses++; - runner.result = { error }; - } - const dt = getTime() - now; - config._totalTime += dt; - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - runner.perform = null; - })(); - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall$2(config.stallTimeout); - runner.staller = null; - })(); - running.add(runner); - return runner; - } - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync() { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises = []; - this.#configs.forEach((config) => { - promises.push(waitForSync(config, 0)); - promises.push((async () => { - config._network = await config.provider.getNetwork(); - })()); - }); - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - // Check all the networks match - let networkId = null; - for (const config of this.#configs) { - const network = config._network; - if (networkId == null) { - networkId = network.networkId; - } - else if (network.networkId !== networkId) { - assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider", - }); - } - } - })(); - } - await initialSync; - } - async #checkQuorum(running, req) { - // Get all the result objects - const results = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) { - return undefined; - } - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({ - value: c.blockNumber, - tag: getNumber(c.blockNumber).toString(), - weight: c.weight, - }))))); - } - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - case "getEnergyPrice": - case "estimateEnergy": - return getMedian(this.quorum, results); - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - case "call": - case "networkId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify(req.method)})`, - }); - } - async #waitForQuorum(running, req) { - if (running.size === 0) { - throw new Error("no runners?!"); - } - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting = []; - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - // All providers have returned, and we have no result - assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { - request: req, - results: Array.from(running).map((r) => stringify(r.result)), - }, - }); - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - async _perform(req) { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => { - try { - const result = await provider._perform(req); - return Object.assign(normalizeResult({ result }), { weight }); - } - catch (error) { - return Object.assign(normalizeResult({ error }), { weight }); - } - })); - const result = getAnyResult(this.quorum, results); - assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) }, - }); - if (result instanceof Error) { - throw result; - } - return result; - } - await this.#initialSync(); - // Bootstrap enough runners to meet quorum - const running = new Set(); - for (let i = 0; i < this.quorum; i++) { - this.#addRunner(running, req); - } - const result = await this.#waitForQuorum(running, req); - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - return result; - } - async destroy() { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } -} - -function isWebSocketLike(value) { - return (value && - typeof value.send === "function" && - typeof value.close === "function"); -} -function getDefaultProvider(network, options) { - if (options == null) { - options = {}; - } - if (typeof network === "string" && network.match(/^https?:/)) { - return new JsonRpcProvider(network); - } - if ((typeof network === "string" && network.match(/^wss?:/)) || - isWebSocketLike(network)) { - return new WebSocketProvider(network); - } - const providers = []; - if (options.alchemy !== "-") { - try { - providers.push(new AlchemyProvider(network, options.alchemy)); - } - catch (error) { - console.log(error); - } - } - if (options.ankr !== "-" && options.ankr != null) { - try { - providers.push(new AnkrProvider(network, options.ankr)); - } - catch (error) { - console.log(error); - } - } - if (options.cloudflare !== "-") { - try { - providers.push(new CloudflareProvider(network)); - } - catch (error) { - console.log(error); - } - } - if (options.infura !== "-") { - try { - let projectId = options.infura; - let projectSecret = undefined; - if (typeof projectId === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new InfuraProvider(network, projectId, projectSecret)); - } - catch (error) { - console.log(error); - } - } - /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } -*/ - if (options.quicknode !== "-") { - try { - let token = options.quicknode; - providers.push(new QuickNodeProvider(network, token)); - } - catch (error) { - console.log(error); - } - } - assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider", - }); - if (providers.length === 1) { - return providers[0]; - } - return new FallbackProvider(providers); -} - -class NonceManager extends AbstractSigner { - signer; - #noncePromise; - #delta; - constructor(signer) { - super(signer.provider); - defineProperties(this, { signer }); - this.#noncePromise = null; - this.#delta = 0; - } - async getAddress() { - return this.signer.getAddress(); - } - connect(provider) { - return new NonceManager(this.signer.connect(provider)); - } - async getNonce(blockTag) { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - return super.getNonce(blockTag); - } - increment() { - this.#delta++; - } - reset() { - this.#delta = 0; - this.#noncePromise = null; - } - async sendTransaction(tx) { - const noncePromise = this.getNonce("pending"); - this.increment(); - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - signTransaction(tx) { - return this.signer.signTransaction(tx); - } - signMessage(message) { - return this.signer.signMessage(message); - } - signTypedData(domain, types, value) { - return this.signer.signTypedData(domain, types, value); - } -} - -class BrowserProvider extends JsonRpcApiPollingProvider { - #request; - constructor(core, network) { - super(network, { batchMaxCount: 1 }); - this.#request = async (method, params) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await core.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } - catch (e) { - const error = new Error(e.message); - error.code = e.code; - error.data = e.data; - error.payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - async send(method, params) { - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } - catch (e) { - return [ - { - id: payload.id, - error: { code: e.code, data: e.data, message: e.message }, - }, - ]; - } - } - getRpcError(payload, error) { - error = JSON.parse(JSON.stringify(error)); - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into - switch (error.error.code || -1) { - case 4001: - error.error.message = `corebc-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `corebc-unsupported: ${error.error.message}`; - break; - } - return super.getRpcError(payload, error); - } - async hasSigner(address) { - if (address == null) { - address = 0; - } - const accounts = await this.send("xcb_accounts", []); - if (typeof address === "number") { - return accounts.length > address; - } - address = address.toLowerCase(); - return (accounts.filter((a) => a.toLowerCase() === address).length !== 0); - } - async getSigner(address) { - if (address == null) { - address = 0; - } - if (!(await this.hasSigner(address))) { - try { - //const resp = - await this.#request("xcb_requestAccounts", []); - //console.log("RESP", resp); - } - catch (error) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - return await super.getSigner(address); - } -} - -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -class PocketProvider extends JsonRpcProvider { - /** - * The Application ID for the Pocket connection. - */ - applicationId; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - applicationSecret; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, applicationId, applicationSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - const options = { staticNetwork: network }; - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - defineProperties(this, { - applicationId, - applicationSecret, - }); - } - _getProvider(networkId) { - try { - return new PocketProvider(networkId, this.applicationId, this.applicationSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network, applicationId, applicationSecret) { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); - request.allowGzip = true; - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("PocketProvider"); - return true; - }; - } - return request; - } - isCommunityResource() { - return this.applicationId === defaultApplicationId; - } -} - -const IpcSocketProvider = undefined; - -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -class BaseWallet extends AbstractSigner { - /** - * The wallet address. - */ - address; - prefix; - #signingKey; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor({ signingKey, prefix, provider, }) { - super(provider); - this.prefix = prefix; - assertArgument(signingKey && typeof signingKey.sign === "function", "invalid signingKey key", "signingKey", "[ REDACTED ]"); - this.#signingKey = signingKey; - const address = computeAddress(this.#signingKey, prefix); - defineProperties(this, { address }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { - return this.#signingKey; - } - /** - * The private key for this wallet. - */ - get privateKey() { - return this.signingKey.privateKey; - } - async getAddress() { - return this.address; - } - connect(provider) { - return new BaseWallet({ - signingKey: this.#signingKey, - prefix: this.prefix, - provider, - }); - } - async signTransaction(tx) { - // Replace any Addressable or ENS name with an address - const { to, from } = await resolveProperties({ - to: tx.to || undefined, - from: tx.from || undefined, - }); - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - assertArgument(getAddress(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - // Build the transaction - const btx = Transaction.from(tx); - const unSignedSerialized = btx.unsignedSerialized; - const unsignedHash = sha256(unSignedSerialized); - // sha256(btx.unsignedSerialized) - btx.signature = this.signingKey.sign(unsignedHash); - return btx.serialized; - } - async signMessage(message) { - return this.signMessageSync(message); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message) { - return this.signingKey.sign(hashMessage(message)); - } - async signTypedData(domain, types, value) { - // Populate any ENS names - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name }, - }); - const address = getAddress(name); - assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name, - }); - return address; - }); - return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)); - } -} - -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; -function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); -} -/** - * @_ignore - */ -function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); -} -/** - * @_ignore - */ -function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); -} - -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } - static check(wordlist) { - const words = []; - for (let i = 0; i < 2048; i++) { - const word = wordlist.getWord(i); - /* istanbul ignore if */ - if (i !== wordlist.getWordIndex(word)) { - return "0x"; - } - words.push(word); - } - return id(words.join("\n") + "\n"); - } -} - -// Use the encode-latin.js script to create the necessary -// data files to be consumed by this class -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -class WordlistOwl extends Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - get _data() { - return this.#data; - } - _decodeWords() { - return decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n", true); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } -} - -const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'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ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; -const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; -let wordlist = null; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { - super("en", words, checksum); - } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } -} - -var utf8$1 = {}; - -/*! https://mths.be/utf8js v3.0.0 by @mathias */ - -var hasRequiredUtf8; - -function requireUtf8 () { - if (hasRequiredUtf8) return utf8$1; - hasRequiredUtf8 = 1; - (function (exports) { -(function(root) { - - var stringFromCharCode = String.fromCharCode; - - // Taken from https://mths.be/punycode - function ucs2decode(string) { - var output = []; - var counter = 0; - var length = string.length; - var value; - var extra; - while (counter < length) { - value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // low surrogate - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - } - - // Taken from https://mths.be/punycode - function ucs2encode(array) { - var length = array.length; - var index = -1; - var value; - var output = ''; - while (++index < length) { - value = array[index]; - if (value > 0xFFFF) { - value -= 0x10000; - output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); - value = 0xDC00 | value & 0x3FF; - } - output += stringFromCharCode(value); - } - return output; - } - - function checkScalarValue(codePoint) { - if (codePoint >= 0xD800 && codePoint <= 0xDFFF) { - throw Error( - 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() + - ' is not a scalar value' - ); - } - } - /*--------------------------------------------------------------------------*/ - - function createByte(codePoint, shift) { - return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80); - } - - function encodeCodePoint(codePoint) { - if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence - return stringFromCharCode(codePoint); - } - var symbol = ''; - if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence - symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0); - } - else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence - checkScalarValue(codePoint); - symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0); - symbol += createByte(codePoint, 6); - } - else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence - symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0); - symbol += createByte(codePoint, 12); - symbol += createByte(codePoint, 6); - } - symbol += stringFromCharCode((codePoint & 0x3F) | 0x80); - return symbol; - } - - function utf8encode(string) { - var codePoints = ucs2decode(string); - var length = codePoints.length; - var index = -1; - var codePoint; - var byteString = ''; - while (++index < length) { - codePoint = codePoints[index]; - byteString += encodeCodePoint(codePoint); - } - return byteString; - } - - /*--------------------------------------------------------------------------*/ - - function readContinuationByte() { - if (byteIndex >= byteCount) { - throw Error('Invalid byte index'); - } - - var continuationByte = byteArray[byteIndex] & 0xFF; - byteIndex++; - - if ((continuationByte & 0xC0) == 0x80) { - return continuationByte & 0x3F; - } - - // If we end up here, it’s not a continuation byte - throw Error('Invalid continuation byte'); - } - - function decodeSymbol() { - var byte1; - var byte2; - var byte3; - var byte4; - var codePoint; - - if (byteIndex > byteCount) { - throw Error('Invalid byte index'); - } - - if (byteIndex == byteCount) { - return false; - } - - // Read first byte - byte1 = byteArray[byteIndex] & 0xFF; - byteIndex++; - - // 1-byte sequence (no continuation bytes) - if ((byte1 & 0x80) == 0) { - return byte1; - } - - // 2-byte sequence - if ((byte1 & 0xE0) == 0xC0) { - byte2 = readContinuationByte(); - codePoint = ((byte1 & 0x1F) << 6) | byte2; - if (codePoint >= 0x80) { - return codePoint; - } else { - throw Error('Invalid continuation byte'); - } - } - - // 3-byte sequence (may include unpaired surrogates) - if ((byte1 & 0xF0) == 0xE0) { - byte2 = readContinuationByte(); - byte3 = readContinuationByte(); - codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3; - if (codePoint >= 0x0800) { - checkScalarValue(codePoint); - return codePoint; - } else { - throw Error('Invalid continuation byte'); - } - } - - // 4-byte sequence - if ((byte1 & 0xF8) == 0xF0) { - byte2 = readContinuationByte(); - byte3 = readContinuationByte(); - byte4 = readContinuationByte(); - codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) | - (byte3 << 0x06) | byte4; - if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { - return codePoint; - } - } - - throw Error('Invalid UTF-8 detected'); - } - - var byteArray; - var byteCount; - var byteIndex; - function utf8decode(byteString) { - byteArray = ucs2decode(byteString); - byteCount = byteArray.length; - byteIndex = 0; - var codePoints = []; - var tmp; - while ((tmp = decodeSymbol()) !== false) { - codePoints.push(tmp); - } - return ucs2encode(codePoints); - } - - /*--------------------------------------------------------------------------*/ - - root.version = '3.0.0'; - root.encode = utf8encode; - root.decode = utf8decode; - - }(exports)); - } (utf8$1)); - return utf8$1; -} - -var utf8Exports = requireUtf8(); -var utf8 = /*@__PURE__*/getDefaultExportFromCjs(utf8Exports); - -function mnemonicToSeed(mnemonic, password) { - if (!password) { - password = ""; - } - const t = generateSeed(mnemonic, password); - return t.goldilock; -} -const generateSeed = (mnemonic, password) => { - const goldilockSaltPrefix = "mnemonic"; - const aesSaltPrefix = "mnemonicfortheAESkey"; - const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); - const aesSalt = utf8.encode(aesSaltPrefix + password); - const goldilockKey = pbkdf2Sync(bufferExports.Buffer.from(mnemonic), bufferExports.Buffer.from(goldilockSalt), 2048, 64, "sha512"); - const aesKeySeed = pbkdf2Sync(bufferExports.Buffer.from(mnemonic), bufferExports.Buffer.from(aesSalt), 2048, 64, "sha512"); - return { - aes: bufferExports.Buffer.from(aesKeySeed).toString("hex"), - goldilock: bufferExports.Buffer.from(goldilockKey).toString("hex"), - }; -}; - -// Returns a byte with the MSB bits set -function getUpperMask(bits) { - return (((1 << bits) - 1) << (8 - bits)) & 0xff; -} -// Returns a byte with the LSB bits set -function getLowerMask(bits) { - return ((1 << bits) - 1) & 0xff; -} -function mnemonicToEntropy(mnemonic, wordlist) { - assertNormalize("NFKD"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const words = wordlist.split(mnemonic); - assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8)); - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= 1 << (7 - (offset % 8)); - } - offset++; - } - } - const entropyBits = (32 * words.length) / 3; - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return hexlify(entropy.slice(0, entropyBits / 8)); -} -function entropyToMnemonic(entropy, wordlist) { - assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - remainingBits -= 8; - // This byte will complete an 11-bit index - } - else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) & - getUpperMask(checksumBits); - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= checksum >> (8 - checksumBits); - return wordlist.join(indices.map((index) => wordlist.getWord(index))); -} -const _guard$1 = {}; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - phrase; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - password; - /** - * The wordlist for this mnemonic. - */ - wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - entropy; - /** - * @private - */ - constructor(guard, entropy, phrase, password, wordlist) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - assertPrivate(guard, _guard$1, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - return mnemonicToSeed(this.phrase, this.password); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase({ phrase, password, wordlist, }) { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(getBytes(entropy), wordlist); - return new Mnemonic(_guard$1, entropy, phrase, password, wordlist); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard$1, hexlify(entropy), phrase, password, wordlist); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist) { - return mnemonicToEntropy(phrase, wordlist); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist) { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } - catch (error) { } - return false; - } -} - -var aesJs = {exports: {}}; - -/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ - -var hasRequiredAesJs; - -function requireAesJs () { - if (hasRequiredAesJs) return aesJs.exports; - hasRequiredAesJs = 1; - (function (module, exports) { - (function(root) { - - function checkInt(value) { - return (parseInt(value) === value); - } - - function checkInts(arrayish) { - if (!checkInt(arrayish.length)) { return false; } - - for (var i = 0; i < arrayish.length; i++) { - if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) { - return false; - } - } - - return true; - } - - function coerceArray(arg, copy) { - - // ArrayBuffer view - if (arg.buffer && arg.name === 'Uint8Array') { - - if (copy) { - if (arg.slice) { - arg = arg.slice(); - } else { - arg = Array.prototype.slice.call(arg); - } - } - - return arg; - } - - // It's an array; check it is a valid representation of a byte - if (Array.isArray(arg)) { - if (!checkInts(arg)) { - throw new Error('Array contains invalid value: ' + arg); - } - - return new Uint8Array(arg); - } - - // Something else, but behaves like an array (maybe a Buffer? Arguments?) - if (checkInt(arg.length) && checkInts(arg)) { - return new Uint8Array(arg); - } - - throw new Error('unsupported array-like object'); - } - - function createArray(length) { - return new Uint8Array(length); - } - - function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) { - if (sourceStart != null || sourceEnd != null) { - if (sourceArray.slice) { - sourceArray = sourceArray.slice(sourceStart, sourceEnd); - } else { - sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd); - } - } - targetArray.set(sourceArray, targetStart); - } - - - - var convertUtf8 = (function() { - function toBytes(text) { - var result = [], i = 0; - text = encodeURI(text); - while (i < text.length) { - var c = text.charCodeAt(i++); - - // if it is a % sign, encode the following 2 bytes as a hex value - if (c === 37) { - result.push(parseInt(text.substr(i, 2), 16)); - i += 2; - - // otherwise, just the actual byte - } else { - result.push(c); - } - } - - return coerceArray(result); - } - - function fromBytes(bytes) { - var result = [], i = 0; - - while (i < bytes.length) { - var c = bytes[i]; - - if (c < 128) { - result.push(String.fromCharCode(c)); - i++; - } else if (c > 191 && c < 224) { - result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f))); - i += 2; - } else { - result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f))); - i += 3; - } - } - - return result.join(''); - } - - return { - toBytes: toBytes, - fromBytes: fromBytes, - } - })(); - - var convertHex = (function() { - function toBytes(text) { - var result = []; - for (var i = 0; i < text.length; i += 2) { - result.push(parseInt(text.substr(i, 2), 16)); - } - - return result; - } - - // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html - var Hex = '0123456789abcdef'; - - function fromBytes(bytes) { - var result = []; - for (var i = 0; i < bytes.length; i++) { - var v = bytes[i]; - result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]); - } - return result.join(''); - } - - return { - toBytes: toBytes, - fromBytes: fromBytes, - } - })(); - - - // Number of rounds by keysize - var numberOfRounds = {16: 10, 24: 12, 32: 14}; - - // Round constant words - var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; - - // S-box and Inverse S-box (S is for Substitution) - var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0x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, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; - - // Transformations for encryption - var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; - var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; - var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; - var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; - - // Transformations for decryption - var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; - var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; - var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; - var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; - - // Transformations for decryption key expansion - var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; - var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; - var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; - var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; - - function convertToInt32(bytes) { - var result = []; - for (var i = 0; i < bytes.length; i += 4) { - result.push( - (bytes[i ] << 24) | - (bytes[i + 1] << 16) | - (bytes[i + 2] << 8) | - bytes[i + 3] - ); - } - return result; - } - - var AES = function(key) { - if (!(this instanceof AES)) { - throw Error('AES must be instanitated with `new`'); - } - - Object.defineProperty(this, 'key', { - value: coerceArray(key, true) - }); - - this._prepare(); - }; - - - AES.prototype._prepare = function() { - - var rounds = numberOfRounds[this.key.length]; - if (rounds == null) { - throw new Error('invalid key size (must be 16, 24 or 32 bytes)'); - } - - // encryption round keys - this._Ke = []; - - // decryption round keys - this._Kd = []; - - for (var i = 0; i <= rounds; i++) { - this._Ke.push([0, 0, 0, 0]); - this._Kd.push([0, 0, 0, 0]); - } - - var roundKeyCount = (rounds + 1) * 4; - var KC = this.key.length / 4; - - // convert the key into ints - var tk = convertToInt32(this.key); - - // copy values into round key arrays - var index; - for (var i = 0; i < KC; i++) { - index = i >> 2; - this._Ke[index][i % 4] = tk[i]; - this._Kd[rounds - index][i % 4] = tk[i]; - } - - // key expansion (fips-197 section 5.2) - var rconpointer = 0; - var t = KC, tt; - while (t < roundKeyCount) { - tt = tk[KC - 1]; - tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ - (S[(tt >> 8) & 0xFF] << 16) ^ - (S[ tt & 0xFF] << 8) ^ - S[(tt >> 24) & 0xFF] ^ - (rcon[rconpointer] << 24)); - rconpointer += 1; - - // key expansion (for non-256 bit) - if (KC != 8) { - for (var i = 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - - // key expansion for 256-bit keys is "slightly different" (fips-197) - } else { - for (var i = 1; i < (KC / 2); i++) { - tk[i] ^= tk[i - 1]; - } - tt = tk[(KC / 2) - 1]; - - tk[KC / 2] ^= (S[ tt & 0xFF] ^ - (S[(tt >> 8) & 0xFF] << 8) ^ - (S[(tt >> 16) & 0xFF] << 16) ^ - (S[(tt >> 24) & 0xFF] << 24)); - - for (var i = (KC / 2) + 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - } - - // copy values into round key arrays - var i = 0, r, c; - while (i < KC && t < roundKeyCount) { - r = t >> 2; - c = t % 4; - this._Ke[r][c] = tk[i]; - this._Kd[rounds - r][c] = tk[i++]; - t++; - } - } - - // inverse-cipher-ify the decryption round key (fips-197 section 5.3) - for (var r = 1; r < rounds; r++) { - for (var c = 0; c < 4; c++) { - tt = this._Kd[r][c]; - this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^ - U2[(tt >> 16) & 0xFF] ^ - U3[(tt >> 8) & 0xFF] ^ - U4[ tt & 0xFF]); - } - } - }; - - AES.prototype.encrypt = function(plaintext) { - if (plaintext.length != 16) { - throw new Error('invalid plaintext size (must be 16 bytes)'); - } - - var rounds = this._Ke.length - 1; - var a = [0, 0, 0, 0]; - - // convert plaintext to (ints ^ key) - var t = convertToInt32(plaintext); - for (var i = 0; i < 4; i++) { - t[i] ^= this._Ke[0][i]; - } - - // apply round transforms - for (var r = 1; r < rounds; r++) { - for (var i = 0; i < 4; i++) { - a[i] = (T1[(t[ i ] >> 24) & 0xff] ^ - T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ - T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T4[ t[(i + 3) % 4] & 0xff] ^ - this._Ke[r][i]); - } - t = a.slice(); - } - - // the last round is special - var result = createArray(16), tt; - for (var i = 0; i < 4; i++) { - tt = this._Ke[rounds][i]; - result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff; - } - - return result; - }; - - AES.prototype.decrypt = function(ciphertext) { - if (ciphertext.length != 16) { - throw new Error('invalid ciphertext size (must be 16 bytes)'); - } - - var rounds = this._Kd.length - 1; - var a = [0, 0, 0, 0]; - - // convert plaintext to (ints ^ key) - var t = convertToInt32(ciphertext); - for (var i = 0; i < 4; i++) { - t[i] ^= this._Kd[0][i]; - } - - // apply round transforms - for (var r = 1; r < rounds; r++) { - for (var i = 0; i < 4; i++) { - a[i] = (T5[(t[ i ] >> 24) & 0xff] ^ - T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ - T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T8[ t[(i + 1) % 4] & 0xff] ^ - this._Kd[r][i]); - } - t = a.slice(); - } - - // the last round is special - var result = createArray(16), tt; - for (var i = 0; i < 4; i++) { - tt = this._Kd[rounds][i]; - result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff; - } - - return result; - }; - - - /** - * Mode Of Operation - Electonic Codebook (ECB) - */ - var ModeOfOperationECB = function(key) { - if (!(this instanceof ModeOfOperationECB)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Electronic Code Block"; - this.name = "ecb"; - - this._aes = new AES(key); - }; - - ModeOfOperationECB.prototype.encrypt = function(plaintext) { - plaintext = coerceArray(plaintext); - - if ((plaintext.length % 16) !== 0) { - throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); - } - - var ciphertext = createArray(plaintext.length); - var block = createArray(16); - - for (var i = 0; i < plaintext.length; i += 16) { - copyArray(plaintext, block, 0, i, i + 16); - block = this._aes.encrypt(block); - copyArray(block, ciphertext, i); - } - - return ciphertext; - }; - - ModeOfOperationECB.prototype.decrypt = function(ciphertext) { - ciphertext = coerceArray(ciphertext); - - if ((ciphertext.length % 16) !== 0) { - throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); - } - - var plaintext = createArray(ciphertext.length); - var block = createArray(16); - - for (var i = 0; i < ciphertext.length; i += 16) { - copyArray(ciphertext, block, 0, i, i + 16); - block = this._aes.decrypt(block); - copyArray(block, plaintext, i); - } - - return plaintext; - }; - - - /** - * Mode Of Operation - Cipher Block Chaining (CBC) - */ - var ModeOfOperationCBC = function(key, iv) { - if (!(this instanceof ModeOfOperationCBC)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Cipher Block Chaining"; - this.name = "cbc"; - - if (!iv) { - iv = createArray(16); - - } else if (iv.length != 16) { - throw new Error('invalid initialation vector size (must be 16 bytes)'); - } - - this._lastCipherblock = coerceArray(iv, true); - - this._aes = new AES(key); - }; - - ModeOfOperationCBC.prototype.encrypt = function(plaintext) { - plaintext = coerceArray(plaintext); - - if ((plaintext.length % 16) !== 0) { - throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); - } - - var ciphertext = createArray(plaintext.length); - var block = createArray(16); - - for (var i = 0; i < plaintext.length; i += 16) { - copyArray(plaintext, block, 0, i, i + 16); - - for (var j = 0; j < 16; j++) { - block[j] ^= this._lastCipherblock[j]; - } - - this._lastCipherblock = this._aes.encrypt(block); - copyArray(this._lastCipherblock, ciphertext, i); - } - - return ciphertext; - }; - - ModeOfOperationCBC.prototype.decrypt = function(ciphertext) { - ciphertext = coerceArray(ciphertext); - - if ((ciphertext.length % 16) !== 0) { - throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); - } - - var plaintext = createArray(ciphertext.length); - var block = createArray(16); - - for (var i = 0; i < ciphertext.length; i += 16) { - copyArray(ciphertext, block, 0, i, i + 16); - block = this._aes.decrypt(block); - - for (var j = 0; j < 16; j++) { - plaintext[i + j] = block[j] ^ this._lastCipherblock[j]; - } - - copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16); - } - - return plaintext; - }; - - - /** - * Mode Of Operation - Cipher Feedback (CFB) - */ - var ModeOfOperationCFB = function(key, iv, segmentSize) { - if (!(this instanceof ModeOfOperationCFB)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Cipher Feedback"; - this.name = "cfb"; - - if (!iv) { - iv = createArray(16); - - } else if (iv.length != 16) { - throw new Error('invalid initialation vector size (must be 16 size)'); - } - - if (!segmentSize) { segmentSize = 1; } - - this.segmentSize = segmentSize; - - this._shiftRegister = coerceArray(iv, true); - - this._aes = new AES(key); - }; - - ModeOfOperationCFB.prototype.encrypt = function(plaintext) { - if ((plaintext.length % this.segmentSize) != 0) { - throw new Error('invalid plaintext size (must be segmentSize bytes)'); - } - - var encrypted = coerceArray(plaintext, true); - - var xorSegment; - for (var i = 0; i < encrypted.length; i += this.segmentSize) { - xorSegment = this._aes.encrypt(this._shiftRegister); - for (var j = 0; j < this.segmentSize; j++) { - encrypted[i + j] ^= xorSegment[j]; - } - - // Shift the register - copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); - copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); - } - - return encrypted; - }; - - ModeOfOperationCFB.prototype.decrypt = function(ciphertext) { - if ((ciphertext.length % this.segmentSize) != 0) { - throw new Error('invalid ciphertext size (must be segmentSize bytes)'); - } - - var plaintext = coerceArray(ciphertext, true); - - var xorSegment; - for (var i = 0; i < plaintext.length; i += this.segmentSize) { - xorSegment = this._aes.encrypt(this._shiftRegister); - - for (var j = 0; j < this.segmentSize; j++) { - plaintext[i + j] ^= xorSegment[j]; - } - - // Shift the register - copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); - copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); - } - - return plaintext; - }; - - /** - * Mode Of Operation - Output Feedback (OFB) - */ - var ModeOfOperationOFB = function(key, iv) { - if (!(this instanceof ModeOfOperationOFB)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Output Feedback"; - this.name = "ofb"; - - if (!iv) { - iv = createArray(16); - - } else if (iv.length != 16) { - throw new Error('invalid initialation vector size (must be 16 bytes)'); - } - - this._lastPrecipher = coerceArray(iv, true); - this._lastPrecipherIndex = 16; - - this._aes = new AES(key); - }; - - ModeOfOperationOFB.prototype.encrypt = function(plaintext) { - var encrypted = coerceArray(plaintext, true); - - for (var i = 0; i < encrypted.length; i++) { - if (this._lastPrecipherIndex === 16) { - this._lastPrecipher = this._aes.encrypt(this._lastPrecipher); - this._lastPrecipherIndex = 0; - } - encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++]; - } - - return encrypted; - }; - - // Decryption is symetric - ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt; - - - /** - * Counter object for CTR common mode of operation - */ - var Counter = function(initialValue) { - if (!(this instanceof Counter)) { - throw Error('Counter must be instanitated with `new`'); - } - - // We allow 0, but anything false-ish uses the default 1 - if (initialValue !== 0 && !initialValue) { initialValue = 1; } - - if (typeof(initialValue) === 'number') { - this._counter = createArray(16); - this.setValue(initialValue); - - } else { - this.setBytes(initialValue); - } - }; - - Counter.prototype.setValue = function(value) { - if (typeof(value) !== 'number' || parseInt(value) != value) { - throw new Error('invalid counter value (must be an integer)'); - } - - // We cannot safely handle numbers beyond the safe range for integers - if (value > Number.MAX_SAFE_INTEGER) { - throw new Error('integer value out of safe range'); - } - - for (var index = 15; index >= 0; --index) { - this._counter[index] = value % 256; - value = parseInt(value / 256); - } - }; - - Counter.prototype.setBytes = function(bytes) { - bytes = coerceArray(bytes, true); - - if (bytes.length != 16) { - throw new Error('invalid counter bytes size (must be 16 bytes)'); - } - - this._counter = bytes; - }; - - Counter.prototype.increment = function() { - for (var i = 15; i >= 0; i--) { - if (this._counter[i] === 255) { - this._counter[i] = 0; - } else { - this._counter[i]++; - break; - } - } - }; - - - /** - * Mode Of Operation - Counter (CTR) - */ - var ModeOfOperationCTR = function(key, counter) { - if (!(this instanceof ModeOfOperationCTR)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Counter"; - this.name = "ctr"; - - if (!(counter instanceof Counter)) { - counter = new Counter(counter); - } - - this._counter = counter; - - this._remainingCounter = null; - this._remainingCounterIndex = 16; - - this._aes = new AES(key); - }; - - ModeOfOperationCTR.prototype.encrypt = function(plaintext) { - var encrypted = coerceArray(plaintext, true); - - for (var i = 0; i < encrypted.length; i++) { - if (this._remainingCounterIndex === 16) { - this._remainingCounter = this._aes.encrypt(this._counter._counter); - this._remainingCounterIndex = 0; - this._counter.increment(); - } - encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++]; - } - - return encrypted; - }; - - // Decryption is symetric - ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt; - - - /////////////////////// - // Padding - - // See:https://tools.ietf.org/html/rfc2315 - function pkcs7pad(data) { - data = coerceArray(data, true); - var padder = 16 - (data.length % 16); - var result = createArray(data.length + padder); - copyArray(data, result); - for (var i = data.length; i < result.length; i++) { - result[i] = padder; - } - return result; - } - - function pkcs7strip(data) { - data = coerceArray(data, true); - if (data.length < 16) { throw new Error('PKCS#7 invalid length'); } - - var padder = data[data.length - 1]; - if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); } - - var length = data.length - padder; - for (var i = 0; i < padder; i++) { - if (data[length + i] !== padder) { - throw new Error('PKCS#7 invalid padding byte'); - } - } - - var result = createArray(length); - copyArray(data, result, 0, 0, length); - return result; - } - - /////////////////////// - // Exporting - - - // The block cipher - var aesjs = { - AES: AES, - Counter: Counter, - - ModeOfOperation: { - ecb: ModeOfOperationECB, - cbc: ModeOfOperationCBC, - cfb: ModeOfOperationCFB, - ofb: ModeOfOperationOFB, - ctr: ModeOfOperationCTR - }, - - utils: { - hex: convertHex, - utf8: convertUtf8 - }, - - padding: { - pkcs7: { - pad: pkcs7pad, - strip: pkcs7strip - } - }, - - _arrayTest: { - coerceArray: coerceArray, - createArray: createArray, - copyArray: copyArray, - } - }; - - - // node.js - { - module.exports = aesjs; - - // RequireJS/AMD - // http://www.requirejs.org/docs/api.html - // https://github.com/amdjs/amdjs-api/wiki/AMD - } - - - })(); - } (aesJs)); - return aesJs.exports; -} - -var aesJsExports = requireAesJs(); -var pkg = /*@__PURE__*/getDefaultExportFromCjs(aesJsExports); - -/** - * @_ignore - */ -function looseArrayify(hexString) { - if (typeof hexString === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return getBytesCopy(hexString); -} -function zpad(value, length) { - value = String(value); - while (value.length < length) { - value = "0" + value; - } - return value; -} -function getPassword(password) { - if (typeof password === "string") { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); -} -function spelunk(object, _path) { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - assertArgument(match != null, "invalid path", "path", _path); - const path = match[1]; - const type = match[3]; - const reqd = match[4] === "!"; - let cur = object; - for (const comp of path.toLowerCase().split(".")) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } - else if (typeof cur === "object") { - let found = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } - else { - cur = null; - } - if (cur == null) { - break; - } - } - assertArgument(!reqd || cur != null, "missing required value", "path", path); - if (type && cur != null) { - if (type === "int") { - if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } - else if (Number.isSafeInteger(cur)) { - return cur; - } - } - if (type === "number") { - if (typeof cur === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - if (type === "data") { - if (typeof cur === "string") { - return looseArrayify(cur); - } - } - if (type === "array" && Array.isArray(cur)) { - return cur; - } - if (type === typeof cur) { - return cur; - } - assertArgument(false, `wrong type found for ${type} `, "path", path); - } - return cur; -} -/* -export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; -} - -// "path/to/something:type!" -export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); -} -*/ -// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) -/* -export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -*/ - -/** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Core along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -// @ts-ignore -const { Counter, ModeOfOperation: { ctr: CTR }, } = pkg; -const defaultPath$1 = "m/44'/60'/0'/0/0"; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -function isKeystoreJson(json) { - try { - const data = JSON.parse(json); - const version = data.version != null ? parseInt(data.version) : 0; - if (version === 3) { - return true; - } - } - catch (error) { } - return false; -} -function decrypt(data, key, ciphertext) { - const cipher = spelunk(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, new Counter(iv)); - return hexlify(aesCtr.decrypt(ciphertext)); - } - assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt", - }); -} -function getAccount(data, _key) { - const key = getBytes(_key); - const ciphertext = spelunk(data, "crypto.ciphertext:data!"); - const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2); - const expectedMAC = spelunk(data, "crypto.mac:string!"); - let difference = 0; - const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC); - if (validMAC) { - const actual = getBytes("0x" + computedMAC); - const expected = getBytes("0x" + expectedMAC); - for (let i = 0; i < actual.length; i++) - difference |= actual[i] ^ expected[i]; - } - assertArgument(validMAC && difference === 0, "incorrect password", "password", "[REDACTED]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - const address = getAddress(data.address); - const prefix = extractPrefix(address); - if (computeAddress(privateKey, prefix) !== address) { - throw new Error("address mismatch"); - } - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); - } - const account = { address, privateKey }; - // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase - const version = spelunk(data, "x-corebc.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = spelunk(data, "x-corebc.mnemonicCiphertext:data!"); - const mnemonicIv = spelunk(data, "x-corebc.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); - account.mnemonic = { - path: spelunk(data, "x-corebc.path:string") || defaultPath$1, - locale: spelunk(data, "x-corebc.locale:string") || "en", - entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))), - }; - } - return account; -} -// Match Core Web3Dart's wallet KDF resource limits. -function validateScrypt(N, r, p) { - assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, "unsafe scrypt N", "kdf.N", N); - assertArgument(Number.isSafeInteger(r) && - Number.isSafeInteger(p) && - r > 0 && - p > 0 && - r * p <= 1048576 && - 128 * N * r <= 256 * 1024 * 1024, "unsafe scrypt work or memory requirement", "kdf", { N, r, p }); -} -function getDecryptKdfParams(data) { - const kdf = spelunk(data, "crypto.kdf:string"); - if (kdf && typeof kdf === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const N = spelunk(data, "crypto.kdfparams.n:int!"); - const r = spelunk(data, "crypto.kdfparams.r:int!"); - const p = spelunk(data, "crypto.kdfparams.p:int!"); - validateScrypt(N, r, p); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } - else if (kdf.toLowerCase() === "pbkdf2") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const prf = spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - assertArgument(prf === "hmac-sha256" || prf === "hmac-sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = spelunk(data, "crypto.kdfparams.c:int!"); - assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, "unsafe PBKDF2 iteration count", "kdf.c", count); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { - name: "pbkdf2", - salt, - count, - dkLen, - algorithm: algorithm, - }; - } - } - assertArgument(false, "unsupported key-derivation function", "kdf", kdf); -} -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -function decryptKeystoreJsonSync(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); -} -function stall$1(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); -} -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -async function decryptKeystoreJson(json, _password, progress) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall$1(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall$1(0); - } - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = await scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); -} -function getEncryptKdfParams(options) { - // Check/generate the salt - const salt = options.salt != null - ? getBytes(options.salt, "options.salt") - : randomBytes(32); - // Override the scrypt password-based key derivation function parameters - let N = 1 << 17, r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N != null) { - N = options.scrypt.N; - } - if (options.scrypt.r != null) { - r = options.scrypt.r; - } - if (options.scrypt.p != null) { - p = options.scrypt.p; - } - } - validateScrypt(N, r, p); - return { name: "scrypt", dkLen: 32, salt, N, r, p }; -} -function _encryptKeystore(key, kdf, account, options) { - const privateKey = getBytes(account.privateKey, "privateKey"); - // Override initialization vector - const iv = options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); - assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - // Override the uuid - const uuidRandom = options.uuid != null - ? getBytes(options.uuid, "options.uuid") - : randomBytes(16); - assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - // Encrypt the private key - const aesCtr = new CTR(derivedKey, new Counter(iv)); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - // Compute the message authentication code, used to check the password - const mac = sha256(concat([macPrefix, ciphertext])); - const data = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv).substring(2), - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r, - }, - mac: mac.substring(2), - }, - }; - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = options.client != null ? options.client : `corebc/${version}`; - const path = account.mnemonic.path || defaultPath$1; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key.slice(32, 64); - const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - const now = new Date(); - const timestamp = now.getUTCFullYear() + - "-" + - zpad(now.getUTCMonth() + 1, 2) + - "-" + - zpad(now.getUTCDate(), 2) + - "T" + - zpad(now.getUTCHours(), 2) + - "-" + - zpad(now.getUTCMinutes(), 2) + - "-" + - zpad(now.getUTCSeconds(), 2) + - ".0Z"; - const gethFilename = "UTC--" + timestamp + "--" + data.address; - data["x-corebc"] = { - client, - gethFilename, - path, - locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1", - }; - } - return JSON.stringify(data); -} -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key), kdf, account, options); -} -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(getBytes(key), kdf, account, options); -} - -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -// import { arrayify, -// // hexDataSlice -// } from "../utils/data.js"; -// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array { -// const p = getBytes(password); -// const s = getBytes(salt); -// return getBytes(pbkdf2(p, s, 2048, 57, "sha512")); -// } -/** - * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -const defaultPath = "m"; -// "Bitcoin seed" -// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); -const HardenedBit = 0x80000000; -// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array { -// b = getBytes(concat([b.slice(0, 53), "0x00000000"])); -// b[0] &= 0xfc; -// const c = new Uint8Array(57); -// let hold = 0; -// for (let i = 0; i < 57; i++) { -// hold += a[i] + b[i]; -// c[i] = hold % 256; -// hold = Math.floor(hold / 256); -// } -// return c; -// }; -const _guard = {}; -function derivePath(node, path) { - const components = path.split("/"); - assertArgument(components.length > 0 && (components[0] === "m" || node.depth > 0), "invalid path", "path", path); - if (components[0] === "m") { - components.shift(); - } - let result = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(HardenedBit + index); - } - else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(index); - } - else { - assertArgument(false, "invalid path component", `path[${i}]`, component); - } - } - return result; -} -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -class HDNodeWallet extends BaseWallet { - /** - * The compressed public key. - */ - publicKey; - prefix; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent fingerprint. - */ - parentFingerprint; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - mnemonic; - #seed; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) { - super({ - signingKey, - prefix, - provider, - }); - assertPrivate(guard, _guard, "HDNodeWallet"); - defineProperties(this, { publicKey: signingKey.publicKey }); - this.prefix = prefix; - this.#seed = seed; - const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, - fingerprint, - path, - index, - depth, - }); - defineProperties(this, { mnemonic }); - } - connect(provider) { - return new HDNodeWallet({ - guard: _guard, - signingKey: this.signingKey, - parentFingerprint: this.parentFingerprint, - path: this.path, - index: this.index, - depth: this.depth, - seed: this.#seed, - mnemonic: this.mnemonic, - provider, - prefix: this.prefix, - }); - } - #account() { - const account = { - address: this.address, - privateKey: this.privateKey, - }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy, - }; - } - return account; - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await encryptKeystoreJson(this.#account(), password, { - progressCallback, - }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return encryptKeystoreJsonSync(this.#account(), password); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { - return this.path != null; - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index)); - const newSigningKey = new SigningKey(newPrivateKey); - // Base path - let path = this.path; - if (path) { - path += "/" + (_index & ~HardenedBit); - if (_index & HardenedBit) { - path += "'"; - } - } - return new HDNodeWallet({ - guard: _guard, - signingKey: newSigningKey, - parentFingerprint: this.fingerprint, - path, - index: _index, - seed: this.#seed, - depth: this.depth + 1, - mnemonic: this.mnemonic, - provider: this.provider, - prefix: this.prefix, - }); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - static #fromSeed({ _seed, mnemonic, prefix, path, }) { - const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0); - const signingKey = new SigningKey(extendetPrivateKey); - // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length }) - return new HDNodeWallet({ - seed: _seed, - guard: _guard, - signingKey, - parentFingerprint: "0x00000000", - path: path || defaultPath, - index: 0, - depth: 0, - mnemonic, - provider: null, - prefix, - }); - } - /** - * Creates a new random HDNode. - */ - static createRandom(prefix, password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist); - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - /** - * Create am HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, prefix, path) { - if (!path) { - path = defaultPath; - } - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - static mnemonicToSeed(mnemonic, password) { - const seed = mnemonicToSeed(mnemonic, password); - return seed; - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase({ phrase, prefix, password, path, wordlist, }) { - if (!password) { - password = ""; - } - if (!path) { - path = defaultPath; - } - if (!wordlist) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist }); - const _seed = mnemonic.computeSeed(); - return HDNodeWallet.#fromSeed({ - _seed, - mnemonic, - prefix, - }).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed({ seed, prefix, path, }) { - return HDNodeWallet.#fromSeed({ - _seed: seed, - mnemonic: null, - path: path || defaultPath, - prefix, - }); - } -} -/* -export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } -} -*/ -/** - * Returns the [[link-bip-32]] path for the acount at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -function getAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${index}'/0/0`; -} -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -function getIndexedAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${index}`; -} - -/** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -// @ts-ignore -const { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg; -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -function isCrowdsaleJson(json) { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } - catch (error) { } - return false; -} -/** - * Before Core launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive xcb - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -function decryptCrowdsaleJson(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - // Core Address - const address = getAddress(spelunk(data, "ethaddr:string!")); - // Encrypted Seed - const encseed = looseArrayify(spelunk(data, "encseed:string!")); - assertArgument(encseed && encseed.length % 16 === 0, "invalid encseed", "json", json); - const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - return { address, privateKey: id(seedHex) }; -} - -function stall(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); -} -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -class Wallet extends BaseWallet { - /** - * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected - * to %%provider%%. - */ - constructor({ key, prefix, provider, }) { - if (typeof key === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - let signingKey = typeof key === "string" ? new SigningKey(key) : key; - super({ - signingKey, - prefix, - provider, - }); - } - connect(provider) { - return new Wallet({ - key: this.signingKey, - prefix: this.prefix, - provider, - }); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - const account = { address: this.address, privateKey: this.privateKey }; - return await encryptKeystoreJson(account, password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - const account = { address: this.address, privateKey: this.privateKey }; - return encryptKeystoreJsonSync(account, password); - } - static #fromAccount(account) { - assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - const address = account.address; - const prefix = extractPrefix(address); - if ("mnemonic" in account && - account.mnemonic && - account.mnemonic.locale === "en") { - const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path); - if (wallet.address === account.address && - wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - const wallet = new Wallet({ - key: account.privateKey, - prefix, - }); - assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); - return wallet; - } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json, password, progress) { - let account = null; - if (isKeystoreJson(json)) { - account = await decryptKeystoreJson(json, password, progress); - } - else if (isCrowdsaleJson(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = decryptCrowdsaleJson(json, password); - if (progress) { - progress(1); - await stall(0); - } - } - return Wallet.#fromAccount(account); - } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json, password) { - let account = null; - if (isKeystoreJson(json)) { - account = decryptKeystoreJsonSync(json, password); - } - else if (isCrowdsaleJson(json)) { - account = decryptCrowdsaleJson(json, password); - } - else { - assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - return Wallet.#fromAccount(account); - } - /** - * Creates a new random [[HDNodeWallet]] using the avavilable - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(prefix, provider) { - const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase({ phrase, prefix, provider, password, }) { - const wallet = HDNodeWallet.fromPhrase({ - phrase, - prefix, - password, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - static fromSeed({ seed, prefix, provider, path, }) { - const wallet = HDNodeWallet.fromSeed({ - seed, - prefix, - path: path || defaultPath, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } -} - -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -/** - * @_ignore - */ -function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = (accum << 6) | Base64.indexOf(data[i]); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = accum >> (bits - width); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; -} - -/** - * @_ignore - */ -function decodeOwlA(data, accents) { - let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); -} - -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -class WordlistOwlA extends WordlistOwl { - #accent; - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - get _accent() { - return this.#accent; - } - _decodeWords() { - return decodeOwlA(this._data, this._accent); - } -} - -const wordlists = { - en: LangEn.wordlist(), -}; - -const customUnitAbi = Object.freeze([ - "function supportsUnit(string unit) view returns (bool)", - "function supportedUnits() view returns (string[])", - "function preferredUnit() view returns (string)", - "function balanceOf(address account) view returns (uint256)", - "function balanceOfUnit(address account, string unit) view returns (uint256)", -]); -class CustomUnitDiscovery { - preferredUnit; - supportedUnits; - constructor(units, preferredUnit) { - this.preferredUnit = preferredUnit; - this.supportedUnits = Object.freeze([...units]); - } - get isValid() { - return (this.supports("units") && - this.preferredUnit !== "" && - this.supports(this.preferredUnit)); - } - supports(unit) { - return this.supportedUnits.includes(unit); - } -} -/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ -class CustomUnitBalance { - canonicalAmount; - unitAmount; - unit; - constructor(canonicalAmount, unitAmount, unit) { - this.canonicalAmount = canonicalAmount; - this.unitAmount = unitAmount; - this.unit = unit; - } - get multiplierNumerator() { - return this.unitAmount; - } - get multiplierDenominator() { - return this.canonicalAmount; - } -} -/** Core custom-unit contract convention used by Tone and Core API. */ -class CustomUnitToken { - contract; - constructor(address, runner) { - this.contract = new Contract(address, customUnitAbi, runner); - } - async supportsUnit(unit, blockTag) { - return (unit.trim() !== "" && - (await this.contract.supportsUnit(unit.trim(), { blockTag }))); - } - async supportedUnits(blockTag) { - return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag }))); - } - async preferredUnit(blockTag) { - return (await this.contract.preferredUnit({ blockTag })).trim(); - } - async discover(blockTag) { - if (!(await this.supportsUnit("units", blockTag))) - return null; - const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag)); - return discovery.isValid ? discovery : null; - } - canonicalBalance(account, blockTag) { - return this.contract.balanceOf(account, { blockTag }); - } - balanceOfUnit(account, unit, blockTag) { - if (!unit.trim()) - throw new TypeError("unit must not be empty"); - return this.contract.balanceOfUnit(account, unit.trim(), { blockTag }); - } - async balance(account, unit, blockTag) { - const resolved = unit?.trim() || (await this.preferredUnit(blockTag)); - const [canonical, calculated] = await Promise.all([ - this.canonicalBalance(account, blockTag), - this.balanceOfUnit(account, resolved, blockTag), - ]); - return new CustomUnitBalance(canonical, calculated, resolved); - } -} - -/** On-chain interface defined by CIP-150. */ -const cip150Abi = Object.freeze([ - "function getMetadataValue(string key) view returns (string value)", - "function hasMetadataKey(string key) view returns (bool exists)", - "function isMetadataSealed(string key) view returns (bool sealed)", - "function listMetadataKeys() view returns (string[] keys)", - "function getMetadataByIndex(uint256 index) view returns (string key, string value)", - "function metadataCount() view returns (uint256 total)", - "function setMetadataValue(string key, string value)", - "function sealMetadataKey(string key)", -]); -const cip151TokenExpirationKey = "tokenExpiration"; -const cip151TradingStopKey = "tradingStop"; -const cip152LabKey = "lab"; -/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ -class Cip151Lifecycle { - tokenExpiration; - tradingStop; - constructor(metadata = {}) { - const parse = (key) => { - const value = metadata[key]; - if (value == null || value === "") - return null; - if (!/^\d+$/.test(value)) - throw new TypeError(`${key} must be a non-negative Unix timestamp`); - return BigInt(value); - }; - this.tokenExpiration = parse(cip151TokenExpirationKey); - this.tradingStop = parse(cip151TradingStopKey); - } - isExpiredAt(seconds) { - return this.tokenExpiration !== null && seconds >= this.tokenExpiration; - } - isTradingStoppedAt(seconds) { - return this.tradingStop !== null && seconds >= this.tradingStop; - } -} -/** Validates certificate structure, not the authenticity of its issuer. */ -class Cip152LabCertificate { - measurements; - constructor(json) { - if (json === null || typeof json !== "object" || Array.isArray(json)) - throw new TypeError("CIP-152 lab.json must be an object"); - const measurements = Object.create(null); - for (const [key, property] of Object.entries(json)) { - if (!property || - typeof property !== "object" || - Array.isArray(property) || - !Object.hasOwn(property, "value")) - throw new TypeError(`CIP-152 property ${key} must contain a value`); - const { value, unit } = property; - if (!(typeof value === "string" || - (typeof value === "number" && Number.isFinite(value)))) - throw new TypeError(`CIP-152 property ${key} has an invalid value`); - if (unit != null && typeof unit !== "string") - throw new TypeError(`CIP-152 property ${key} has an invalid unit`); - measurements[key] = Object.freeze(unit == null ? { value } : { value, unit }); - } - this.measurements = Object.freeze(measurements); - } -} -/** Typed metadata reader and writer. Writes require a signer as runner. */ -class Cip150MetadataContract { - contract; - constructor(address, runner) { - this.contract = new Contract(address, cip150Abi, runner); - } - getValue(key, blockTag) { - return this.contract.getMetadataValue(key, { blockTag }); - } - hasKey(key, blockTag) { - return this.contract.hasMetadataKey(key, { blockTag }); - } - isSealed(key, blockTag) { - return this.contract.isMetadataSealed(key, { blockTag }); - } - async listKeys(blockTag) { - return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag }))); - } - async getByIndex(index, blockTag) { - const [key, value] = await this.contract.getMetadataByIndex(index, { - blockTag, - }); - return Object.freeze({ key, value }); - } - count(blockTag) { - return this.contract.metadataCount({ blockTag }); - } - async readAll(blockTag, includeSealedState = true) { - const entries = []; - for (const key of await this.listKeys(blockTag)) { - const value = await this.getValue(key, blockTag); - entries.push(Object.freeze(includeSealedState - ? { key, value, sealed: await this.isSealed(key, blockTag) } - : { key, value })); - } - return Object.freeze(entries); - } - setValue(key, value, overrides = {}) { - return this.contract.setMetadataValue(key, value, overrides); - } - sealKey(key, overrides = {}) { - return this.contract.sealMetadataKey(key, overrides); - } - async readLifecycle(blockTag) { - const metadata = {}; - for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) { - if (await this.hasKey(key, blockTag)) - metadata[key] = await this.getValue(key, blockTag); - } - return new Cip151Lifecycle(metadata); - } - async readLabCertificate(gateway, blockTag) { - if (!(await this.hasKey(cip152LabKey, blockTag))) - return null; - const reference = await this.getValue(cip152LabKey, blockTag); - if (!gateway.resolve(reference).pathname.endsWith("/lab.json")) - throw new TypeError("CIP-152 reference must point to lab.json"); - return new Cip152LabCertificate(await gateway.readJson(reference)); - } -} - -const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; -/** Configurable IPFS resolution and bounded JSON loading. */ -class IpfsGateway { - template; - maxResponseBytes; - timeoutMs; - #fetch; - constructor(options = {}) { - this.template = options.template ?? defaultIpfsGatewayTemplate; - this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024; - this.timeoutMs = options.timeoutMs ?? 30_000; - this.#fetch = options.fetch ?? globalThis.fetch; - const templateUrl = new URL(this.template.replace("{cid}", "cid")); - if (!/^https?:$/.test(templateUrl.protocol) || - this.template.split("{cid}").length !== 2) - throw new TypeError("gateway template must be HTTP(S) and contain one {cid}"); - for (const value of [this.maxResponseBytes, this.timeoutMs]) - if (!Number.isSafeInteger(value) || value <= 0) - throw new TypeError("gateway limits must be positive safe integers"); - } - resolve(reference) { - const value = reference.trim(); - if (/^https?:\/\//i.test(value)) - return new URL(value); - const path = value.replace(/^ipfs:\/\//, "").replace(/^\/?ipfs\//, ""); - if (!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path) || - path.split("/").some((part) => part === "." || part === "..")) - throw new TypeError("invalid IPFS reference"); - return new URL(this.template.replace("{cid}", path.split("/").map(encodeURIComponent).join("/"))); - } - async readJson(reference) { - const controller = new AbortController(); - const timer = setTimeout(() => controller.abort(), this.timeoutMs); - let reader; - try { - const response = await this.#fetch(this.resolve(reference), { - headers: { accept: "application/json" }, - signal: controller.signal, - }); - if (!response.ok) { - await response.body?.cancel(); - throw new Error(`IPFS gateway returned HTTP ${response.status}`); - } - if (!response.body) - throw new Error("IPFS gateway returned an empty body"); - reader = response.body.getReader(); - const chunks = []; - let length = 0; - while (true) { - const { done, value } = await reader.read(); - if (done) - break; - length += value.length; - if (length > this.maxResponseBytes) - throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`); - chunks.push(value); - } - const bytes = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - bytes.set(chunk, offset); - offset += chunk.length; - } - return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)); - } - finally { - clearTimeout(timer); - await reader?.cancel().catch(() => { }); - reader?.releaseLock(); - } - } -} - -var corebc = /*#__PURE__*/Object.freeze({ - __proto__: null, - AbiCoder: AbiCoder, - AbstractProvider: AbstractProvider, - AbstractSigner: AbstractSigner, - AlchemyProvider: AlchemyProvider, - AnkrProvider: AnkrProvider, - BaseContract: BaseContract, - BaseWallet: BaseWallet, - BigNumber: BigNumber, - Block: Block, - BrowserProvider: BrowserProvider, - Cip150MetadataContract: Cip150MetadataContract, - Cip151Lifecycle: Cip151Lifecycle, - Cip152LabCertificate: Cip152LabCertificate, - CloudflareProvider: CloudflareProvider, - ConstructorFragment: ConstructorFragment, - Contract: Contract, - ContractEventPayload: ContractEventPayload, - ContractFactory: ContractFactory, - ContractTransactionReceipt: ContractTransactionReceipt, - ContractTransactionResponse: ContractTransactionResponse, - ContractUnknownEventPayload: ContractUnknownEventPayload, - CoreSymbol: CoreSymbol, - CustomUnitBalance: CustomUnitBalance, - CustomUnitDiscovery: CustomUnitDiscovery, - CustomUnitToken: CustomUnitToken, - Ed448Goldilock: Ed448Goldilock, - EnergyCostPlugin: EnergyCostPlugin, - ErrorDescription: ErrorDescription, - ErrorFragment: ErrorFragment, - EventFragment: EventFragment, - EventLog: EventLog, - EventPayload: EventPayload, - FallbackFragment: FallbackFragment, - FallbackProvider: FallbackProvider, - FeeData: FeeData, - FeeDataNetworkPlugin: FeeDataNetworkPlugin, - FetchCancelSignal: FetchCancelSignal, - FetchRequest: FetchRequest, - FetchResponse: FetchResponse, - FixedNumber: FixedNumber, - Fragment: Fragment, - FunctionFragment: FunctionFragment, - HDNodeWallet: HDNodeWallet, - Indexed: Indexed, - InfuraProvider: InfuraProvider, - InfuraWebSocketProvider: InfuraWebSocketProvider, - Interface: Interface, - IpcSocketProvider: IpcSocketProvider, - IpfsGateway: IpfsGateway, - JsonRpcApiProvider: JsonRpcApiProvider, - JsonRpcProvider: JsonRpcProvider, - JsonRpcSigner: JsonRpcSigner, - LangEn: LangEn, - Log: Log, - LogDescription: LogDescription, - MaxInt256: MaxInt256, - MaxUint256: MaxUint256, - MessagePrefix: MessagePrefix, - MinInt256: MinInt256, - Mnemonic: Mnemonic, - N: N, - NamedFragment: NamedFragment, - Network: Network, - NetworkPlugin: NetworkPlugin, - NonceManager: NonceManager, - OrePerXCB: OrePerXCB, - ParamType: ParamType, - PocketProvider: PocketProvider, - QuickNodeProvider: QuickNodeProvider, - Result: Result, - Signature: Signature, - SigningKey: SigningKey, - SocketBlockSubscriber: SocketBlockSubscriber, - SocketEventSubscriber: SocketEventSubscriber, - SocketPendingSubscriber: SocketPendingSubscriber, - SocketProvider: SocketProvider, - SocketSubscriber: SocketSubscriber, - StructFragment: StructFragment, - Transaction: Transaction, - TransactionDescription: TransactionDescription, - TransactionReceipt: TransactionReceipt, - TransactionResponse: TransactionResponse, - Typed: Typed, - TypedDataEncoder: TypedDataEncoder, - UnmanagedSubscriber: UnmanagedSubscriber, - Utf8ErrorFuncs: Utf8ErrorFuncs, - VoidSigner: VoidSigner, - Wallet: Wallet, - WebSocketProvider: WebSocketProvider, - Wordlist: Wordlist, - WordlistOwl: WordlistOwl, - WordlistOwlA: WordlistOwlA, - ZeroAddress: ZeroAddress, - ZeroHash: ZeroHash, - accessListify: accessListify, - arrayify: arrayify, - assert: assert, - assertArgument: assertArgument, - assertArgumentCount: assertArgumentCount, - assertNormalize: assertNormalize, - assertPrivate: assertPrivate, - checkResultErrors: checkResultErrors, - cip150Abi: cip150Abi, - cip151TokenExpirationKey: cip151TokenExpirationKey, - cip151TradingStopKey: cip151TradingStopKey, - cip152LabKey: cip152LabKey, - computeAddress: computeAddress, - computeHmac: computeHmac, - concat: concat, - copyRequest: copyRequest, - customUnitAbi: customUnitAbi, - dataLength: dataLength, - dataSlice: dataSlice, - decodeBase58: decodeBase58, - decodeBase64: decodeBase64, - decodeBytes32String: decodeBytes32String, - decodeRlp: decodeRlp, - decryptCrowdsaleJson: decryptCrowdsaleJson, - decryptKeystoreJson: decryptKeystoreJson, - decryptKeystoreJsonSync: decryptKeystoreJsonSync, - defaultIpfsGatewayTemplate: defaultIpfsGatewayTemplate, - defaultPath: defaultPath, - defineProperties: defineProperties, - encodeBase58: encodeBase58, - encodeBase64: encodeBase64, - encodeBytes32String: encodeBytes32String, - encodeRlp: encodeRlp, - encryptKeystoreJson: encryptKeystoreJson, - encryptKeystoreJsonSync: encryptKeystoreJsonSync, - formatUnits: formatUnits, - formatXCB: formatXCB, - fromTwos: fromTwos, - getAccountPath: getAccountPath, - getAddress: getAddress, - getBigInt: getBigInt, - getBytes: getBytes, - getBytesCopy: getBytesCopy, - getCreate2Address: getCreate2Address, - getCreateAddress: getCreateAddress, - getDefaultProvider: getDefaultProvider, - getIndexedAccountPath: getIndexedAccountPath, - getNumber: getNumber, - getUint: getUint, - hashMessage: hashMessage, - hexConcat: hexConcat, - hexlify: hexlify, - id: id, - isAddress: isAddress, - isAddressable: isAddressable, - isBytesLike: isBytesLike, - isCallException: isCallException, - isCrowdsaleJson: isCrowdsaleJson, - isError: isError, - isHexString: isHexString, - isKeystoreJson: isKeystoreJson, - keccak256: keccak256, - lock: lock, - makeError: makeError, - mask: mask, - networkIdToPrefix: networkIdToPrefix, - parseUnits: parseUnits, - parseXCB: parseXCB, - pbkdf2: pbkdf2, - publicToAddress: publicToAddress, - randomBytes: randomBytes, - recoverAddress: recoverAddress, - resolveAddress: resolveAddress, - resolveProperties: resolveProperties, - ripemd160: ripemd160, - scrypt: scrypt, - scryptSync: scryptSync, - sha256: sha256, - sha512: sha512, - showThrottleMessage: showThrottleMessage, - solidityPacked: solidityPacked, - solidityPackedSha256: solidityPackedSha256, - stripZerosLeft: stripZerosLeft, - toBeArray: toBeArray, - toBeHex: toBeHex, - toBigInt: toBigInt, - toNumber: toNumber, - toQuantity: toQuantity, - toTwos: toTwos, - toUtf8Bytes: toUtf8Bytes, - toUtf8CodePoints: toUtf8CodePoints, - toUtf8String: toUtf8String, - uuidV4: uuidV4, - verifyMessage: verifyMessage, - verifyTypedData: verifyTypedData, - version: version, - wordlists: wordlists, - zeroPadBytes: zeroPadBytes, - zeroPadValue: zeroPadValue -}); - -var Buffer = bufferExports.Buffer; -export { AbiCoder, AbstractProvider, AbstractSigner, AlchemyProvider, AnkrProvider, BaseContract, BaseWallet, BigNumber, Block, BrowserProvider, Buffer, Cip150MetadataContract, Cip151Lifecycle, Cip152LabCertificate, CloudflareProvider, ConstructorFragment, Contract, ContractEventPayload, ContractFactory, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, CoreSymbol, CustomUnitBalance, CustomUnitDiscovery, CustomUnitToken, Ed448Goldilock, EnergyCostPlugin, ErrorDescription, ErrorFragment, EventFragment, EventLog, EventPayload, FallbackFragment, FallbackProvider, FeeData, FeeDataNetworkPlugin, FetchCancelSignal, FetchRequest, FetchResponse, FixedNumber, Fragment, FunctionFragment, HDNodeWallet, Indexed, InfuraProvider, InfuraWebSocketProvider, Interface, IpcSocketProvider, IpfsGateway, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, LangEn, Log, LogDescription, MaxInt256, MaxUint256, MessagePrefix, MinInt256, Mnemonic, N, NamedFragment, Network, NetworkPlugin, NonceManager, OrePerXCB, ParamType, PocketProvider, QuickNodeProvider, Result, Signature, SigningKey, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketProvider, SocketSubscriber, StructFragment, Transaction, TransactionDescription, TransactionReceipt, TransactionResponse, Typed, TypedDataEncoder, UnmanagedSubscriber, Utf8ErrorFuncs, VoidSigner, Wallet, WebSocketProvider, Wordlist, WordlistOwl, WordlistOwlA, ZeroAddress, ZeroHash, accessListify, arrayify, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, checkResultErrors, cip150Abi, cip151TokenExpirationKey, cip151TradingStopKey, cip152LabKey, computeAddress, computeHmac, concat, copyRequest, corebc, customUnitAbi, dataLength, dataSlice, decodeBase58, decodeBase64, decodeBytes32String, decodeRlp, decryptCrowdsaleJson, decryptKeystoreJson, decryptKeystoreJsonSync, defaultIpfsGatewayTemplate, defaultPath, defineProperties, encodeBase58, encodeBase64, encodeBytes32String, encodeRlp, encryptKeystoreJson, encryptKeystoreJsonSync, formatUnits, formatXCB, fromTwos, getAccountPath, getAddress, getBigInt, getBytes, getBytesCopy, getCreate2Address, getCreateAddress, getDefaultProvider, getIndexedAccountPath, getNumber, getUint, hashMessage, hexConcat, hexlify, id, isAddress, isAddressable, isBytesLike, isCallException, isCrowdsaleJson, isError, isHexString, isKeystoreJson, keccak256, lock, makeError, mask, networkIdToPrefix, parseUnits, parseXCB, pbkdf2, publicToAddress, randomBytes, recoverAddress, resolveAddress, resolveProperties, ripemd160, scrypt, scryptSync, sha256, sha512, showThrottleMessage, solidityPacked, solidityPackedSha256, stripZerosLeft, toBeArray, toBeHex, toBigInt, toNumber, toQuantity, toTwos, toUtf8Bytes, toUtf8CodePoints, toUtf8String, uuidV4, verifyMessage, verifyTypedData, version, wordlists, zeroPadBytes, zeroPadValue }; -//# sourceMappingURL=corebc.js.map diff --git a/dist/corebc.js.map b/dist/corebc.js.map deleted file mode 100644 index a6de9e66c..000000000 --- a/dist/corebc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"corebc.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../lib.esm/_version.js","../node_modules/bn.js/lib/bn.js","../lib.esm/logger/logger.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/bigNumber/bigNumber.js","../lib.esm/crypto/rlp.js","../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/_md.js","../node_modules/@noble/hashes/legacy.js","../node_modules/@noble/hashes/hmac.js","../node_modules/@noble/hashes/pbkdf2.js","../node_modules/@noble/hashes/sha2.js","../node_modules/@noble/hashes/sha3.js","../node_modules/bcrypto/lib/internal/assert.js","../node_modules/bcrypto/lib/internal/custom-browser.js","../node_modules/bcrypto/lib/js/bn.js","../node_modules/bcrypto/lib/bn-browser.js","../node_modules/bcrypto/lib/js/chacha20.js","../node_modules/bcrypto/lib/chacha20-browser.js","../node_modules/bcrypto/lib/internal/hmac.js","../node_modules/bcrypto/lib/js/sha256.js","../node_modules/bcrypto/lib/sha256-browser.js","../node_modules/bcrypto/lib/js/batch-rng.js","../node_modules/bcrypto/lib/js/elliptic.js","../node_modules/bcrypto/lib/js/random.js","../node_modules/bcrypto/lib/random-browser.js","../node_modules/bcrypto/lib/js/eddsa.js","../node_modules/bcrypto/lib/js/keccak.js","../node_modules/bcrypto/lib/keccak-browser.js","../node_modules/bcrypto/lib/shake.js","../node_modules/bcrypto/lib/shake256.js","../node_modules/bcrypto/lib/js/ed448.js","../node_modules/bcrypto/lib/ed448-browser.js","../lib.esm/crypto/browser-ed448.js","../lib.esm/utils/maths.js","../lib.esm/utils/base58.js","../lib.esm/utils/base64-browser.js","../lib.esm/utils/events.js","../lib.esm/utils/utf8.js","../lib.esm/utils/geturl-browser.js","../lib.esm/utils/fetch.js","../lib.esm/utils/fixednumber.js","../lib.esm/utils/rlp-decode.js","../lib.esm/utils/rlp-encode.js","../lib.esm/utils/units.js","../lib.esm/utils/uuid.js","../node_modules/bcrypto/lib/js/pbkdf2.js","../node_modules/bcrypto/lib/pbkdf2-browser.js","../node_modules/bcrypto/lib/js/sha3.js","../node_modules/bcrypto/lib/sha3-browser.js","../node_modules/bcrypto/lib/sha3-512.js","../lib.esm/crypto/ed448goldilock-browser.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/sha3.js","../lib.esm/address/index.js","../lib.esm/crypto/hmac.js","../lib.esm/crypto/ripemd160.js","../lib.esm/crypto/pbkdf2.js","../lib.esm/crypto/random.js","../node_modules/@noble/hashes/scrypt.js","../lib.esm/crypto/scrypt.js","../lib.esm/crypto/keccak.js","../lib.esm/crypto/signing-key.js","../lib.esm/crypto/signature.js","../lib.esm/crypto/index.js","../lib.esm/transaction/address.js","../lib.esm/abi/coders/abstract-coder.js","../lib.esm/abi/typed.js","../lib.esm/abi/coders/address.js","../lib.esm/abi/coders/anonymous.js","../lib.esm/abi/coders/array.js","../lib.esm/abi/coders/boolean.js","../lib.esm/abi/coders/bytes.js","../lib.esm/abi/coders/fixed-bytes.js","../lib.esm/abi/coders/null.js","../lib.esm/abi/coders/number.js","../lib.esm/abi/coders/string.js","../lib.esm/abi/coders/tuple.js","../lib.esm/hash/id.js","../lib.esm/constants/addresses.js","../lib.esm/constants/hashes.js","../lib.esm/constants/numbers.js","../lib.esm/constants/strings.js","../lib.esm/transaction/accesslist.js","../lib.esm/transaction/transaction.js","../lib.esm/hash/message.js","../lib.esm/hash/solidity.js","../lib.esm/hash/typed-data.js","../lib.esm/abi/fragments.js","../lib.esm/abi/abi-coder.js","../lib.esm/abi/bytes32.js","../lib.esm/abi/interface.js","../lib.esm/address/contract-address.js","../lib.esm/address/checks.js","../lib.esm/providers/provider.js","../lib.esm/contract/wrappers.js","../lib.esm/contract/contract.js","../lib.esm/contract/factory.js","../lib.esm/providers/format.js","../lib.esm/providers/plugins-network.js","../lib.esm/providers/network.js","../lib.esm/providers/subscriber-polling.js","../lib.esm/providers/abstract-provider.js","../lib.esm/providers/abstract-signer.js","../lib.esm/providers/community.js","../lib.esm/providers/subscriber-filterid.js","../lib.esm/providers/provider-jsonrpc.js","../lib.esm/providers/provider-ankr.js","../lib.esm/providers/provider-alchemy.js","../lib.esm/providers/provider-cloudflare.js","../lib.esm/providers/ws-browser.js","../lib.esm/providers/provider-socket.js","../lib.esm/providers/provider-websocket.js","../lib.esm/providers/provider-infura.js","../lib.esm/providers/provider-quicknode.js","../lib.esm/providers/provider-fallback.js","../lib.esm/providers/default-provider.js","../lib.esm/providers/signer-noncemanager.js","../lib.esm/providers/provider-browser.js","../lib.esm/providers/provider-pocket.js","../lib.esm/providers/provider-ipcsocket-browser.js","../lib.esm/wallet/base-wallet.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-en.js","../node_modules/utf8/utf8.js","../lib.esm/wallet/mnemonicToSeed.js","../lib.esm/wallet/mnemonic.js","../node_modules/aes-js/index.js","../lib.esm/wallet/utils.js","../lib.esm/wallet/json-keystore.js","../lib.esm/wallet/hdwallet.js","../lib.esm/wallet/json-crowdsale.js","../lib.esm/wallet/wallet.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/wordlists-browser.js","../lib.esm/cip/custom-units.js","../lib.esm/cip/index.js","../lib.esm/ipfs/index.js"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","/** The current version of corebc; keep in sync with package.json. */\nexport const version = \"0.4.1\";\n//# sourceMappingURL=_version.js.map","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n i++;\n }\n\n // Clear words above the requested width so the result stays below 2 ** width\n for (; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n if (num === 0) {\n this.length = 1;\n this._normSign();\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.mod.abs();\n\n var half = num.abs().iushrn(1);\n var r2 = num.words[0] & 1;\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up, away from zero\n var up = new BN(1);\n up.negative = this.negative ^ num.negative;\n return dm.div.iadd(up);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map","import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map","/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return new Uint8Array(result);\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return new Uint8Array(result);\n }\n if (isBytes(value)) {\n return new Uint8Array(value);\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { isBytes, hexlify, isHexString, } from \"../utils/data.js\";\nvar BN = _BN.BN;\nconst logger = new Logger(\"bigNumber/0.0.1\");\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null &&\n (BigNumber.isBigNumber(value) ||\n (typeof value === \"number\" && value % 1 === 0) ||\n (typeof value === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n typeof value === \"bigint\" ||\n isBytes(value)));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n _hex;\n _isBigNumber;\n constructor(constructorGuard, hex) {\n logger.checkNew(new.target, BigNumber);\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\",\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division by zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return this._hex[0] === \"-\";\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n // @ts-ignore\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString(),\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof value === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof value === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof anyValue === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof hex === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof hex === \"string\") {\n if (isHexString(hex) ||\n (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\n// @ts-ignore\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof value !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\n// @ts-ignore\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\n// @ts-ignore\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return new BN(\"-\" + hex.substring(3), 16);\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return new BN(value, 36).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return new BN(value, 16).toString(36);\n}\n//# sourceMappingURL=bigNumber.js.map","\"use strict\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify, isBytesLike } from \"../utils/data.js\";\nconst logger = new Logger(\"rlp/0.0.1\");\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return 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 _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 if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(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}\nexport function encode(object) {\n return hexlify(_encode(object));\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 if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: 1 + length, result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\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 if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: 1 + length, result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=rlp.js.map","const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();\nconst _32n = /* @__PURE__ */ BigInt(32);\n// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high\n// }` to match little-endian word order rather than the property names.\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array\n// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS\n// bitwise results back to uint32 first, and little-endian callers must swap.\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers\n// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below\n// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes).\nconst fromNumH = (n) => (n / 2 ** 32) | 0;\nconst fromNumL = (n) => n >>> 0;\n// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call\n// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`.\nfunction setU64FromNum(view, byteOffset, n, isLE) {\n const h = fromNumH(n);\n const l = fromNumL(n);\n view.setUint32(byteOffset, isLE ? l : h, isLE);\n view.setUint32(byteOffset + 4, isLE ? h : l, isLE);\n}\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s) => h >>> s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.\nconst rotr32H = (_h, l) => l;\n// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.\nconst rotr32L = (h, _l) => h;\n// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps\n// local copies so V8 inlines them into keccakP.\n// Add two split 64-bit words and return the split `{ h, l }` sum.\n// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out\n// of the low sum and instead use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\n// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\n// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\n// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, fromNumH, fromNumL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, setU64FromNum, shrSH, shrSL, split, toBig };\n","/**\n * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.\n * @param a - value to test\n * @returns `true` when the value is a Uint8Array-compatible view.\n * @example\n * Check whether a value is a Uint8Array-compatible view.\n * ```ts\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n// Shared error-message prefix builder. Only called on throw paths, so assert\n// success paths never pay for the string concatenation.\nconst atitle = (title) => (title ? `\"${title}\" ` : '');\n/**\n * Asserts something is a non-negative integer.\n * @param n - number to validate\n * @param title - label included in thrown errors\n * @returns The validated number.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a non-negative integer option.\n * ```ts\n * anumber(32, 'length');\n * ```\n */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number')\n throw new TypeError(atitle(title) + 'expected number, got ' + typeof n);\n if (!Number.isSafeInteger(n) || n < 0)\n throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n);\n return n;\n}\n/**\n * Asserts something is a boolean.\n * @param value - value to validate\n * @param title - label included in thrown errors\n * @returns The validated boolean.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a boolean option.\n * ```ts\n * abool(true, 'enableXOF');\n * ```\n */\nexport function abool(value, title = '') {\n if (typeof value !== 'boolean')\n throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);\n return value;\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - value to validate\n * @param length - optional exact length constraint\n * @param title - label included in thrown errors\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate that a value is a byte array.\n * ```ts\n * abytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function abytes(value, length, title = '') {\n // Success path first: this runs at the start of every update() / digestInto(), and the\n // common `abytes(data)` form must not pay for length handling it does not use.\n if (isBytes(value) && (length === undefined || value.length === length))\n return value;\n // Error path: recompute freely to build the exact message.\n if (length !== undefined)\n anumber(length, 'length');\n const bytes = isBytes(value);\n const ofLen = length !== undefined ? ` of length ${length}` : '';\n const got = bytes ? `length=${value.length}` : `type=${typeof value}`;\n const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Asserts something is a wrapped hash constructor.\n * @param h - hash constructor to validate\n * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}\n * @throws On invalid hash metadata ranges or values. {@link RangeError}\n * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}\n * @example\n * Validate a callable hash wrapper.\n * ```ts\n * import { ahash } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('expected hash wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1 || h.blockLen < 1)\n throw new Error('hash blockLen / outputLen must be >= 1');\n}\nconst aobject = (value, label) => {\n if (value === null || typeof value !== 'object' || Array.isArray(value))\n throw new TypeError((label === 'object' ? '' : `\"${label}\" `) + 'expected object, got type=' + typeof value);\n};\nconst aopts = (value, label) => {\n aobject(value, label);\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null)\n throw new TypeError(`\"${label}\" expected plain object`);\n // Object.assign() treats an own \"__proto__\" source key as a write to the target's legacy\n // prototype setter. Reject it before merging so inherited option values cannot be injected.\n if (Object.hasOwn(value, '__proto__'))\n throw new TypeError(`\"${label}.__proto__\" is not allowed`);\n};\n/**\n * Asserts a hash instance has not been destroyed or finished.\n * @param instance - hash instance to validate\n * @param checkFinished - whether to reject finalized instances\n * @throws If the hash instance has already been destroyed or finalized. {@link Error}\n * @example\n * Validate that a hash instance is still usable.\n * ```ts\n * import { aexists } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aexists(hash);\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their\n // truthiness is checked - re-validating their type per call was pure hot-path overhead.\n if (instance.destroyed)\n throw new Error('hash was destroyed');\n if (checkFinished && instance.finished)\n throw new Error('digest() was already called');\n}\n/**\n * Asserts output is a sufficiently-sized byte array.\n * @param out - destination buffer\n * @param instance - hash instance providing output length\n * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a caller-provided digest buffer.\n * ```ts\n * import { aoutput } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aoutput(new Uint8Array(hash.outputLen), hash);\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast\n // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call.\n const min = instance.outputLen;\n if (!(out.length >= min)) {\n throw new RangeError('\"output\" expected length >= ' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed array view to Uint32Array.\n * `arr.byteOffset` must already be 4-byte aligned or the platform\n * Uint32Array constructor will throw.\n * @param arr - source typed array\n * @returns Uint32Array view over the same buffer.\n * @example\n * Reinterpret a byte array as 32-bit words.\n * ```ts\n * u32(new Uint8Array(8));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Zeroizes typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros\n * @example\n * Zeroize sensitive buffers in place.\n * ```ts\n * clean(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/**\n * Creates a DataView for byte-level manipulation.\n * @param arr - source typed array\n * @returns DataView over the same buffer region.\n * @example\n * Create a DataView over an existing buffer.\n * ```ts\n * createView(new Uint8Array(4));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Rotate-right operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the right.\n * ```ts\n * rotr(0x12345678, 8);\n * ```\n */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Rotate-left operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the left.\n * ```ts\n * rotl(0x12345678, 8);\n * ```\n */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/**\n * Byte-swap operation for uint32 values.\n * @param word - source word\n * @returns Word with reversed byte order.\n * @example\n * Reverse the byte order of a 32-bit word.\n * ```ts\n * byteSwap(0x11223344);\n * ```\n */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\n/**\n * Byte-swaps every word of a Uint32Array in place.\n * @param arr - array to mutate\n * @returns The same array after mutation; callers pass live state arrays here.\n * @example\n * Reverse the byte order of every word in place.\n * ```ts\n * byteSwap32(new Uint32Array([0x11223344]));\n * ```\n */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n/**\n * Conditionally byte-swaps a Uint32Array on big-endian platforms.\n * @param u - array to normalize for host endianness\n * @returns Original or byte-swapped array depending on platform endianness.\n * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.\n * @example\n * Normalize a word array for host endianness.\n * ```ts\n * swap32IfBE(new Uint32Array([0x11223344]));\n * ```\n */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\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}\n// Strict ASCII nibble parser: non-ASCII hex lookalikes are rejected as undefined.\n// ASCII codes: '0'..'9' = 48..57, 'A'..'F' = 65..70, 'a'..'f' = 97..102.\n// prettier-ignore\nfunction asciiToBase16(ch) {\n return ch >= 48 && ch <= 57 ? ch - 48 // '2' => 50-48\n : ch >= 65 && ch <= 70 ? ch - (65 - 10) // 'B' => 66-(65-10)\n : ch >= 97 && ch <= 102 ? ch - (97 - 10) // 'b' => 98-(97-10)\n : undefined;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi)); // parse first char, multiply it by 16\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); // parse second char\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // example: 'A9' => 10*16 + 9\n }\n return array;\n}\n/**\n * Yields to the host task scheduler so timers, I/O, and rendering can make progress.\n * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback.\n * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so\n * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while\n * still allowing other event-loop work to proceed.\n * @param onReject - optional cleanup invoked only if the host yield fails\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport function nextTick(onReject) {\n const host = globalThis;\n if (typeof host.scheduler?.yield === 'function') {\n const promise = host.scheduler.yield();\n // Keep the original scheduler rejection; this handler exists only for cleanup.\n if (onReject)\n promise.catch(onReject);\n return promise;\n }\n return new Promise((resolve) => host.setTimeout(resolve, 0));\n}\n/**\n * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @param onReject - optional cleanup invoked only if a host yield fails\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb, onReject) {\n anumber(iters, 'iters');\n anumber(tick, 'tick');\n if (typeof cb !== 'function')\n throw new TypeError('callback must be a function');\n // Callback is synchronous by contract; asyncLoop only yields between sync work windows.\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick(onReject);\n // Track only synchronous work time; scheduler delay after yielding is outside our budget.\n ts = Date.now();\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n const encoded = new TextEncoder().encode(str);\n try {\n // Copy into the current realm for Firefox extension contexts. Callers that own the returned\n // buffer can then wipe it independently of TextEncoder's temporary result.\n return new Uint8Array(encoded); // https://bugzil.la/1681809\n }\n finally {\n clean(encoded);\n }\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Validates declared required and optional field types on a plain object.\n * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct\n * one-line guards such as `abytes()`, `abool()`, or `anumber()` instead.\n * @param object - object to validate\n * @param fields - map of required field names to expected types\n * @param optFields - map of optional field names to expected types\n * @param title - label included in thrown errors\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate required and optional option fields.\n * ```ts\n * validateObject({ N: 1024, dkLen: 32 }, { N: 'number' }, { dkLen: 'number' });\n * ```\n */\nexport const validateObject = (object, fields = {}, optFields = {}, title = 'object') => {\n aobject(object, title);\n aobject(fields, 'fields');\n aobject(optFields, 'optFields');\n function checkField(fieldName, expectedType, isOpt) {\n const label = title === 'object' ? `param \"${String(fieldName)}\"` : `\"${title}.${String(fieldName)}\"`;\n // Config fields must be explicit own properties. Optional inherited values are rejected too\n // because callers keep reading the same options object after validation.\n const val = object[fieldName];\n // Runtime objects such as Field instances intentionally satisfy required method slots\n // via their shared prototype.\n if (!Object.hasOwn(object, fieldName) &&\n (isOpt ? val !== undefined : expectedType !== 'function')) {\n throw new TypeError(`${label} is invalid: expected own property`);\n }\n if (isOpt && val === undefined)\n return;\n const current = typeof val;\n if (current !== expectedType || val === null)\n throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);\n }\n const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));\n iter(fields, false);\n iter(optFields, true);\n};\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @param title - label included in thrown override errors\n * @returns Fresh merged option object with a null prototype.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts, title = 'opts') {\n aopts(defaults, 'defaults');\n if (opts !== undefined)\n aopts(opts, title);\n // Callers read optional fields directly, so omitted values must not fall through to ambient\n // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).\n const merged = Object.assign(Object.create(null), defaults, opts);\n return merged;\n}\n/**\n * Creates a callable hash function from a stateful class constructor.\n * @param hashCons - hash constructor or factory\n * @param info - optional metadata such as DER OID\n * @returns Frozen callable hash wrapper with `.create()`.\n * Wrapper construction eagerly calls `hashCons(undefined)` once to read\n * `outputLen` / `blockLen`, so constructor side effects happen at module\n * init time.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Wrap a stateful hash constructor into a callable helper.\n * ```ts\n * import { createHasher } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const wrapped = createHasher(sha256.create, { oid: sha256.oid });\n * wrapped(new Uint8Array([1]));\n * ```\n */\nexport function createHasher(hashCons, info = {}) {\n if (typeof hashCons !== 'function')\n throw new TypeError('\"hashCons\" expected function, got type=' + typeof hashCons);\n info = checkOpts({}, info, 'info');\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.canXOF = tmp.canXOF;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 §10.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.\n * @param suffix - final OID byte for the selected hash.\n * The helper accepts any byte even though only the documented NIST hash\n * suffixes are meaningful downstream.\n * @returns Object containing the DER-encoded OID.\n * @example\n * Build OID metadata for a NIST hash.\n * ```ts\n * oidNist(0x01);\n * ```\n */\nexport const oidNist = (suffix) => ({\n // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.\n // Larger suffix values would need base-128 OID encoding and a different length byte.\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { setU64FromNum } from \"./_u64.js\";\nimport { abytes, aexists, aoutput, createView } from \"./utils.js\";\n/**\n * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.\n * Returns bits from `b` when `a` is set, otherwise from `c`.\n * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never\n * set the same bit.\n * @param a - selector word\n * @param b - word chosen when selector bit is set\n * @param c - word chosen when selector bit is clear\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit choice primitive.\n * ```ts\n * Chi(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/**\n * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.\n * Returns bits shared by at least two inputs.\n * @param a - first input word\n * @param b - second input word\n * @param c - third input word\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit majority primitive.\n * ```ts\n * Maj(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit\n * strings with partial-byte tails.\n * @param blockLen - internal block size in bytes\n * @param outputLen - digest size in bytes\n * @param padOffset - trailing length field size in bytes\n * @param isLE - whether length and state words are encoded in little-endian\n * @example\n * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.\n * ```ts\n * import { _SHA1 } from '@noble/hashes/legacy.js';\n * const hash = new _SHA1();\n * hash.update(new Uint8Array([97, 98, 99]));\n * hash.digest();\n * ```\n */\nexport class HashMD {\n blockLen;\n outputLen;\n canXOF = false;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n let processed = false;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path only when there is no buffered partial block: `take === blockLen` implies\n // `this.pos === 0`, so we can process full blocks directly from the input view.\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n processed = true;\n continue;\n }\n // When the whole input is buffered in one go (common for short messages), passing `data`\n // directly avoids allocating a subarray view.\n buffer.set(pos === 0 && take === len ? data : 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 processed = true;\n }\n }\n this.length += data.length;\n // Shared schedule buffers only pick up input-derived words inside process(); if everything\n // was buffered without processing, there is nothing to zero.\n if (processed)\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(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, then zero-pad the rest of the block\n buffer[pos++] = 0b10000000;\n buffer.fill(0, pos);\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n buffer.fill(0);\n }\n // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from\n // the padding fill above, and JS will overflow before user input can make that half non-zero.\n // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an\n // integer below 2**53, so the split inside the helper stays exact).\n setU64FromNum(view, blockLen - 8, this.length * 8, isLE);\n this.process(view, 0);\n // The final block above is processed outside update(), so the shared message-schedule\n // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest().\n this.roundClean();\n // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.\n const oview = out === buffer ? view : createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n const outLen = len / 4;\n const state = this.get();\n // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state.\n if (len % 4 || outLen > state.length)\n throw new Error('invalid outputLen');\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 // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return\n // fresh bytes to the caller.\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneIntoMeta(to) {\n const { buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and\n // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it.\n if (pos)\n to.buffer.set(buffer); // Avoid a hot modulo guard.\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the\n * square roots of the first eight prime numbers. Exported as a shared table; callers must treat\n * it as read-only because constructors copy words from it by index. */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state `H(0)` from RFC 6234 §6.1. Exported as a shared table; callers must\n * treat it as read-only because constructors copy words from it by index. */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the ninth\n * through sixteenth prime numbers. Exported as a shared table; callers must treat it as read-only\n * because constructors copy halves from it by index. */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first\n * eight prime numbers. Exported as a shared table; callers must treat it as read-only because\n * constructors copy halves from it by index. */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n","/**\n\nSHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions.\nRFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors,\nnot the base RIPEMD-160 compression spec.\nDon't use them in a new protocol. What \"weak\" means:\n\n- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.\n- No practical pre-image attacks (only theoretical, 2^123.4)\n- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151\n * @module\n */\nimport { Chi, HashMD, Maj } from \"./_md.js\";\nimport { clean, createHasher, rotl } from \"./utils.js\";\n/** Initial SHA-1 state from RFC 3174 §6.1. */\nconst SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\n// Reusable 80-word SHA-1 message schedule buffer.\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA1 legacy hash class. */\nexport class _SHA1 extends HashMD {\n A = SHA1_IV[0] | 0;\n B = SHA1_IV[1] | 0;\n C = SHA1_IV[2] | 0;\n D = SHA1_IV[3] | 0;\n E = SHA1_IV[4] | 0;\n constructor() {\n super(64, 20, 8, false);\n }\n get() {\n const { A, B, C, D, E } = this;\n return [A, B, C, D, E];\n }\n set(A, B, C, D, E) {\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 }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n SHA1_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 80; i++)\n SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n // Compression function main loop, 80 rounds\n let { A, B, C, D, E } = this;\n for (let i = 0; i < 80; i++) {\n let F, K;\n if (i < 20) {\n F = Chi(B, C, D);\n K = 0x5a827999;\n }\n else if (i < 40) {\n F = B ^ C ^ D;\n K = 0x6ed9eba1;\n }\n else if (i < 60) {\n F = Maj(B, C, D);\n K = 0x8f1bbcdc;\n }\n else {\n F = B ^ C ^ D;\n K = 0xca62c1d6;\n }\n const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0;\n E = D;\n D = C;\n C = rotl(B, 30);\n B = A;\n A = T;\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 this.set(A, B, C, D, E);\n }\n roundClean() {\n clean(SHA1_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA1.\n * ```ts\n * sha1(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha1 = /* @__PURE__ */ createHasher(() => new _SHA1());\n/** RFC 1321 `T[i]` uses `floor(2^32 * abs(sin(i)))`; this is the shared `2^32` scale factor. */\nconst p32 = /* @__PURE__ */ Math.pow(2, 32);\n/** RFC 1321 `T[1..64]` table. */\nconst K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));\n/** MD5 initial state from RFC 1321, stored as 4 u32 words. */\nconst MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);\n// Reusable 16-word MD5 message block buffer.\nconst MD5_W = /* @__PURE__ */ new Uint32Array(16);\n// RFC 1321 §3.4 per-round rotate amounts, flattened to 64 entries so the round loop\n// avoids allocating a 4-element array literal every round (measured ~5% of md5).\nconst MD5_SHIFTS = /* @__PURE__ */ (() => {\n const S = [\n [7, 12, 17, 22],\n [5, 9, 14, 20],\n [4, 11, 16, 23],\n [6, 10, 15, 21],\n ];\n return Uint8Array.from({ length: 64 }, (_, i) => S[Math.floor(i / 16)][i % 4]);\n})();\n/** Internal MD5 legacy hash class. */\nexport class _MD5 extends HashMD {\n A = MD5_IV[0] | 0;\n B = MD5_IV[1] | 0;\n C = MD5_IV[2] | 0;\n D = MD5_IV[3] | 0;\n constructor() {\n super(64, 16, 8, true);\n }\n get() {\n const { A, B, C, D } = this;\n return [A, B, C, D];\n }\n set(A, B, C, D) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n MD5_W[i] = view.getUint32(offset, true);\n // Compression function main loop, 64 rounds\n let { A, B, C, D } = this;\n for (let i = 0; i < 64; i++) {\n let F, g;\n if (i < 16) {\n F = Chi(B, C, D);\n g = i;\n }\n else if (i < 32) {\n // RFC 1321 round 2 uses G(B,C,D) = (B & D) | (C & ~D), which is `Chi(D, B, C)`.\n F = Chi(D, B, C);\n g = (5 * i + 1) % 16;\n }\n else if (i < 48) {\n F = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n }\n else {\n F = C ^ (B | ~D);\n g = (7 * i) % 16;\n }\n F = F + A + K[i] + MD5_W[g];\n A = D;\n D = C;\n C = B;\n B = B + rotl(F, MD5_SHIFTS[i]);\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 this.set(A, B, C, D);\n }\n roundClean() {\n clean(MD5_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.\n * MD5 architecture is similar to SHA1, with some differences:\n * - Reduced output length: 16 bytes (128 bit) instead of 20\n * - 64 rounds, instead of 80\n * - Little-endian: could be faster, but will require more code\n * - Non-linear index selection: huge speed-up for unroll\n * - Per round constants: more memory accesses, additional speed-up for unroll\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with MD5.\n * ```ts\n * md5(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const md5 = /* @__PURE__ */ createHasher(() => new _MD5());\n// RIPEMD-160\n// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables.\nconst Rho160 = /* @__PURE__ */ Uint8Array.from([\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n]);\nconst Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();\nconst Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();\n// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds.\nconst idxLR = /* @__PURE__ */ (() => {\n const L = [Id160];\n const R = [Pi160];\n const res = [L, R];\n for (let i = 0; i < 4; i++)\n for (let j of res)\n j.push(j[i].map((k) => Rho160[k]));\n return res;\n})();\nconst idxL = /* @__PURE__ */ (() => idxLR[0])();\nconst idxR = /* @__PURE__ */ (() => idxLR[1])();\n// const [idxL, idxR] = idxLR;\n// Base per-group shift table before the left/right message-order permutations are applied.\nconst shifts160 = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => Uint8Array.from(i));\nconst shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));\nconst shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));\n// Five left-lane additive constants for RIPEMD-160.\nconst Kl160 = /* @__PURE__ */ Uint32Array.from([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\n// Five right-lane additive constants for RIPEMD-160.\nconst Kr160 = /* @__PURE__ */ Uint32Array.from([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range\n// inputs currently fall through to the group-4 branch.\nfunction ripemd_f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n if (group === 1)\n return (x & y) | (~x & z);\n if (group === 2)\n return (x | ~y) ^ z;\n if (group === 3)\n return (x & z) | (y & ~z);\n return x ^ (y | ~z);\n}\n// Reusable 16-word RIPEMD-160 message block buffer.\nconst BUF_160 = /* @__PURE__ */ new Uint32Array(16);\n/**\n * Internal RIPEMD-160 legacy hash class.\n * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification.\n */\nexport class _RIPEMD160 extends HashMD {\n h0 = 0x67452301 | 0;\n h1 = 0xefcdab89 | 0;\n h2 = 0x98badcfe | 0;\n h3 = 0x10325476 | 0;\n h4 = 0xc3d2e1f0 | 0;\n constructor() {\n super(64, 20, 8, true);\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF_160[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order.\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n clean(BUF_160);\n }\n destroy() {\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a legacy hash function from 1990s.\n * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point\n * at the base RIPEMD-160 references.\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html}\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf}\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with RIPEMD-160.\n * ```ts\n * ripemd160(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160());\n","/**\n * HMAC: RFC2104 message authentication code.\n * @module\n */\nimport { abytes, aexists, ahash, aoutput, clean, } from \"./utils.js\";\n/**\n * Internal class for HMAC.\n * Accepts any byte key, although RFC 2104 §3 recommends keys at least\n * `HashLen` bytes long.\n */\nexport class _HMAC {\n oHash;\n iHash;\n blockLen;\n outputLen;\n canXOF = false;\n finished = false;\n destroyed = false;\n constructor(hash, key) {\n ahash(hash);\n abytes(key, undefined, 'key');\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('expected Hash instance');\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 the first block) of the outer hash here,\n // 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 clean(pad);\n }\n update(buf) {\n aexists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n const buf = out.subarray(0, this.outputLen);\n // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before\n // overwriting that same prefix with the final tag, leaving any oversized tail untouched.\n this.iHash.digestInto(buf);\n this.oHash.update(buf);\n this.oHash.digestInto(buf);\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 the key\n // is already in state and we don't know it.\n to ||= Object.create(Object.getPrototypeOf(this), {});\n const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.canXOF = canXOF;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\nexport const hmac = /* @__PURE__ */ (() => {\n const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest());\n hmac_.create = (hash, key) => new _HMAC(hash, key);\n return hmac_;\n})();\n","/**\n * PBKDF (RFC 2898). Can be used to create a key from password and salt.\n * @module\n */\nimport { hmac } from \"./hmac.js\";\n// prettier-ignore\nimport { ahash, anumber, asyncLoop, checkOpts, clean, createView, kdfInputToBytes } from \"./utils.js\";\n// Common validation and per-call state setup for sync/async functions.\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n ahash(hash);\n const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);\n const { c, dkLen, asyncTick } = opts;\n anumber(c, 'c');\n anumber(dkLen, 'dkLen');\n anumber(asyncTick, 'asyncTick');\n if (c < 1)\n throw new Error('\"c\" (iterations) must be >= 1');\n // RFC 8018 §5.2 defines `dkLen` as \"a positive integer\".\n if (dkLen < 1)\n throw new Error('\"dkLen\" must be >= 1');\n // RFC 8018 §5.2 step 1 requires rejecting oversize `dkLen`\n // before allocating the destination buffer.\n if (dkLen > (2 ** 32 - 1) * hash.outputLen)\n throw new Error('derived key too long');\n const p = kdfInputToBytes(_password, 'password');\n try {\n const s = kdfInputToBytes(_salt, 'salt');\n try {\n // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n const DK = new Uint8Array(dkLen);\n const { iHash, oHash, outputLen } = hmac.create(hash, p);\n // Drive keyed hashes directly; the wrapper is only needed to initialize their HMAC midstates.\n const u = new Uint8Array(outputLen);\n const eng = pbkdf2Engine(iHash, oHash, s, u);\n return { c, dkLen, asyncTick, DK, outputLen, eng };\n }\n finally {\n // Uint8Array inputs belong to the caller; only wipe our UTF-8 conversion.\n if (typeof _salt === 'string')\n clean(s);\n }\n }\n finally {\n if (typeof _password === 'string')\n clean(p);\n }\n}\n// Per-call PRF driver writes U1 into both `u` and `Ti`, then later digests into `u`;\n// shared by the sync and async variants.\nfunction pbkdf2Engine(iHash, oHash, salt, u) {\n const counter = new Uint8Array(4);\n const view = createView(counter);\n // Full clones retain tree/config state; absorb salt before async yields without cloning input.\n const salted = iHash._cloneInto().update(salt);\n // u1() overwrites the worker before reading it. Seed from the outer midstate so a long salt\n // cannot pre-populate a tree stack that the first reset would abandon without wiping.\n const work = oHash._cloneInto();\n const iClone = iHash._cloneInto; // Capture before mixed feedback can materialize state tuples.\n const oClone = oHash._cloneInto;\n return {\n u1: (ti, Ti) => {\n view.setInt32(0, ti, false);\n salted._cloneInto(work).update(counter).digestInto(u);\n oHash._cloneInto(work).update(u).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n },\n // Whole `F` inner loop for the sync variant: one optimized function owns the hot loop.\n rounds: (c, Ti) => {\n for (let ui = 1; ui < c; ui++) {\n iClone.call(iHash, work).update(u).digestInto(u);\n oClone.call(oHash, work).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n }\n },\n output: (DK) => {\n // Keyed templates and derived worker states are secret material.\n iHash.destroy();\n oHash.destroy();\n salted.destroy();\n work.destroy();\n // Shared sync/async cleanup point: wipe transient PRF state\n // while preserving the derived key buffer.\n clean(u);\n return DK;\n },\n };\n}\n/**\n * PBKDF2-HMAC: RFC 8018 key derivation function.\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated;\n * JS string inputs are UTF-8 encoded first\n * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first\n * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,\n * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}.\n * @returns Derived key bytes.\n * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error}\n * @example\n * PBKDF2-HMAC: RFC 2898 key derivation function.\n * ```ts\n * import { pbkdf2 } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });\n * ```\n */\nexport function pbkdf2(hash, password, salt, opts) {\n const { c, dkLen, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) {\n // Ti = F(Password, Salt, c, i)\n // The last Ti view can be shorter than hLen, which applies\n // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies.\n const Ti = DK.subarray(pos, pos + outputLen);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n eng.u1(ti, Ti);\n // Uc = PRF(Password, Uc−1); Ti ^= Uc\n eng.rounds(c, Ti);\n }\n return eng.output(DK);\n}\n/**\n * PBKDF2-HMAC: RFC 8018 key derivation function. Async version.\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated;\n * JS string inputs are UTF-8 encoded first\n * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first\n * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,\n * must be `>= 1` per RFC 8018 §5.2. `asyncTick` is only a local\n * scheduler-yield knob for this JS wrapper, not part of RFC 8018.\n * See {@link Pbkdf2Opt}.\n * @returns Promise resolving to derived key bytes.\n * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error}\n * @example\n * PBKDF2-HMAC: RFC 2898 key derivation function.\n * ```ts\n * import { pbkdf2Async } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 });\n * ```\n * @example\n * Tune the async PBKDF2 scheduler for short UI tasks.\n * ```ts\n * import { pbkdf2Async } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = await pbkdf2Async(sha256, 'password', 'salt', {\n * dkLen: 32,\n * c: 32,\n * asyncTick: 1,\n * });\n * ```\n */\nexport async function pbkdf2Async(hash, password, salt, opts) {\n const { c, dkLen, asyncTick, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts);\n // Reuse normal state destruction, then wipe the incomplete output if a host yield aborts.\n const abort = () => {\n eng.output(DK);\n clean(DK);\n };\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) {\n // Ti = F(Password, Salt, c, i)\n // The last Ti view can be shorter than hLen, which applies\n // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies.\n const Ti = DK.subarray(pos, pos + outputLen);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n eng.u1(ti, Ti);\n await asyncLoop(c - 1, asyncTick, () => {\n // Uc = PRF(Password, Uc−1)\n eng.rounds(2, Ti); // c=2 runs exactly one PRF iteration per callback.\n }, abort);\n }\n return eng.output(DK);\n}\n","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\n/**\n * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits\n * of the cube roots of the first 64 primes (2..311).\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\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/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */\nclass SHA2_32B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and makes sha256 3x slower (measured).\n A = 0;\n B = 0;\n C = 0;\n D = 0;\n E = 0;\n F = 0;\n G = 0;\n H = 0;\n constructor(outputLen, IV) {\n super(64, outputLen, 8, false);\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 _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\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 clean(SHA256_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */\nexport class _SHA256 extends SHA2_32B {\n constructor() {\n super(32, SHA256_IV);\n }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */\nexport class _SHA224 extends SHA2_32B {\n constructor() {\n super(28, SHA224_IV);\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// SHA-384 / SHA-512 round constants from RFC 6234 §5.2:\n// 80 full 64-bit words split into high/low halves.\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\n// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */\nclass SHA2_64B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and slows hashing down (measured on sha256).\n Ah = 0;\n Al = 0;\n Bh = 0;\n Bl = 0;\n Ch = 0;\n Cl = 0;\n Dh = 0;\n Dl = 0;\n Eh = 0;\n El = 0;\n Fh = 0;\n Fl = 0;\n Gh = 0;\n Gl = 0;\n Hh = 0;\n Hl = 0;\n constructor(outputLen, IV) {\n super(128, outputLen, 16, false);\n this.Ah = IV[0] | 0;\n this.Al = IV[1] | 0;\n this.Bh = IV[2] | 0;\n this.Bl = IV[3] | 0;\n this.Ch = IV[4] | 0;\n this.Cl = IV[5] | 0;\n this.Dh = IV[6] | 0;\n this.Dl = IV[7] | 0;\n this.Eh = IV[8] | 0;\n this.El = IV[9] | 0;\n this.Fh = IV[10] | 0;\n this.Fl = IV[11] | 0;\n this.Gh = IV[12] | 0;\n this.Gl = IV[13] | 0;\n this.Hh = IV[14] | 0;\n this.Hl = IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA512 extends SHA2_64B {\n constructor() {\n super(64, SHA512_IV);\n }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA384 extends SHA2_64B {\n constructor() {\n super(48, SHA384_IV);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.\n * These IV literals are checked against that script rather than a dedicated\n * local RFC section.\n */\n/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_224 extends SHA2_64B {\n constructor() {\n super(28, T224_IV);\n }\n}\n/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_256 extends SHA2_64B {\n constructor() {\n super(32, T256_IV);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-256.\n * ```ts\n * sha256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__PURE__ */ oidNist(0x01));\n/**\n * SHA2-224 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-224.\n * ```ts\n * sha224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__PURE__ */ oidNist(0x04));\n/**\n * SHA2-512 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512.\n * ```ts\n * sha512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__PURE__ */ oidNist(0x03));\n/**\n * SHA2-384 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-384.\n * ```ts\n * sha384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/256.\n * ```ts\n * sha512_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/224.\n * ```ts\n * sha512_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202},\n * {@link https://keccak.team/keccak.html | Website}, and\n * {@link https://crypto.stackexchange.com/q/15727 | the differences between\n * SHA-3 and Keccak}.\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { split } from \"./_u64.js\";\n// prettier-ignore\nimport { abool, abytes, aexists, anumber, aoutput, checkOpts, clean, createHasher, oidNist, swap32IfBE, u32 } from \"./utils.js\";\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\n// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors\n// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`.\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = []; // no pure annotation: var is always used\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\n// `split(..., true)` keeps the local little-endian lane-word layout used by\n// `state32`, so these `H` / `L` tables follow the file's first-word /\n// second-word lane slots rather than `_u64.ts`'s usual high/low naming.\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can\n// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only\n// consumer of left-rotates; other hashes use right-rotates from _u64.\n// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64.\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2.\n// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation.\nconst B = new Uint32Array(5 * 2);\n/**\n * `keccakf1600` internal permutation, additionally allows adjusting the round count.\n * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words\n * in this file's local little-endian lane-word order\n * @param rounds - number of rounds to execute\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If `rounds` is outside the supported `1..24` range. {@link Error}\n * @example\n * Permute a Keccak state with the default 24 rounds.\n * ```ts\n * keccakP(new Uint32Array(50));\n * ```\n */\nexport function keccakP(s, rounds = 24) {\n if (!(s instanceof Uint32Array))\n throw new TypeError('\"s\" expected Uint32Array(50), got type=' + typeof s);\n if (s.length !== 50)\n throw new RangeError('\"s\" expected Uint32Array(50), got length=' + s.length);\n anumber(rounds, 'rounds');\n // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table.\n if (rounds < 1 || rounds > 24)\n throw new Error('\"rounds\" expected integer 1..24');\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n // Same as:\n // for (let x = 0; x < 10; x++) B[x] = s[y + x];\n // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n for (let y = 0; y < 50; y += 10) {\n const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3];\n s[y] ^= ~s[y + 2] & s[y + 4];\n s[y + 1] ^= ~s[y + 3] & s[y + 5];\n s[y + 2] ^= ~s[y + 4] & s[y + 6];\n s[y + 3] ^= ~s[y + 5] & s[y + 7];\n s[y + 4] ^= ~s[y + 6] & s[y + 8];\n s[y + 5] ^= ~s[y + 7] & s[y + 9];\n s[y + 6] ^= ~s[y + 8] & b0;\n s[y + 7] ^= ~s[y + 9] & b1;\n s[y + 8] ^= ~b0 & b2;\n s[y + 9] ^= ~b1 & b3;\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n/**\n * Keccak sponge function.\n * @param blockLen - absorb/squeeze rate in bytes\n * @param suffix - domain separation suffix byte\n * @param outputLen - default digest length in bytes. This base sponge only\n * requires a non-negative integer; wrappers that need positive output\n * lengths must enforce that themselves.\n * @param enableXOF - whether XOF output is allowed\n * @param rounds - number of Keccak-f rounds\n * @example\n * Build a sponge state, absorb bytes, then finalize a digest.\n * ```ts\n * const hash = new Keccak(136, 0x06, 32);\n * hash.update(new Uint8Array([1, 2, 3]));\n * hash.digest();\n * ```\n */\nexport class Keccak {\n state;\n pos = 0;\n posOut = 0;\n finished = false;\n state32;\n destroyed = false;\n blockLen;\n suffix;\n outputLen;\n canXOF;\n enableXOF = false;\n rounds;\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n anumber(blockLen, 'blockLen');\n anumber(suffix, 'suffix');\n anumber(rounds, 'rounds');\n abool(enableXOF, 'enableXOF');\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.canXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen, 'outputLen');\n // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state.\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('\"blockLen\" must be 1..199');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone() {\n return this._cloneInto();\n }\n keccak() {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { blockLen, state, state32 } = this;\n const len = data.length;\n // Absorb full blocks with u32 XORs when both sides are 4-byte aligned.\n // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe.\n const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0;\n const blockLen32 = blockLen / 4;\n const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined;\n for (let pos = 0; pos < len;) {\n if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) {\n for (let i = 0, o = pos / 4; i < blockLen32; i++)\n state32[i] ^= data32[o + i];\n pos += blockLen;\n // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override,\n // so it must reflect the fully-absorbed block before the permutation fires.\n this.pos = blockLen;\n this.keccak();\n continue;\n }\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1.\n // These byte values already include the first padding bit, while the\n // final `0x80` below supplies the closing `1` bit in the last rate byte.\n state[pos] ^= suffix;\n // If that combined suffix lands in the last rate byte and already sets\n // bit 7, absorb it first so the final pad10*1 bit can be xored into a\n // fresh block.\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base\n // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/\n // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF.\n if (!this.enableXOF)\n throw new Error('XOF is not enabled');\n return this.writeInto(out);\n }\n xof(bytes) {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n aoutput(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest.\n this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen));\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.outputLen);\n this.digestInto(out);\n return out;\n }\n destroy() {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);\n // Reused destinations can come from a different rate/capacity variant, so clone must rewrite\n // the sponge geometry as well as the state words.\n to.blockLen = blockLen;\n to.state32.set(this.state32);\n // Sponge padding and XOF output are positional, so both offsets are part of the clone state.\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone\n // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie.\n to.canXOF = this.canXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info);\n/**\n * SHA3-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-224.\n * ```ts\n * sha3_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_224 = /* @__PURE__ */ genKeccak(0x06, 144, 28, \n/* @__PURE__ */ oidNist(0x07));\n/**\n * SHA3-256 hash function. Different from keccak-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-256.\n * ```ts\n * sha3_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, \n/* @__PURE__ */ oidNist(0x08));\n/**\n * SHA3-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-384.\n * ```ts\n * sha3_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_384 = /* @__PURE__ */ genKeccak(0x06, 104, 48, \n/* @__PURE__ */ oidNist(0x09));\n/**\n * SHA3-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-512.\n * ```ts\n * sha3_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, \n/* @__PURE__ */ oidNist(0x0a));\n/**\n * Keccak-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-224.\n * ```ts\n * keccak_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_224 = /* @__PURE__ */ genKeccak(0x01, 144, 28);\n/**\n * Keccak-256 hash function. Different from SHA3-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-256.\n * ```ts\n * keccak_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32);\n/**\n * Keccak-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-384.\n * ```ts\n * keccak_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_384 = /* @__PURE__ */ genKeccak(0x01, 104, 48);\n/**\n * Keccak-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-512.\n * ```ts\n * keccak_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_512 = /* @__PURE__ */ genKeccak(0x01, 72, 64);\nconst genShake = (suffix, blockLen, outputLen, info = {}) => createHasher((opts = {}) => {\n opts = checkOpts({}, opts);\n return new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true);\n}, info);\n/**\n * SHAKE128 XOF with 128-bit security and a 16-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128.\n * ```ts\n * shake128(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 16, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 256-bit security and a 32-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256.\n * ```ts\n * shake256(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 32, /* @__PURE__ */ oidNist(0x0c));\n/**\n * SHAKE128 XOF with 256-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128 using a 32-byte default output.\n * ```ts\n * shake128_32(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128_32 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 32, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 512-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256 using a 64-byte default output.\n * ```ts\n * shake256_64(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256_64 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 64, /* @__PURE__ */ oidNist(0x0c));\n","/*!\n * assert.js - assert for bcrypto\n * Copyright (c) 2020, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\n/*\n * Assert\n */\n\nfunction assert(val, msg) {\n if (!val) {\n const err = new Error(msg || 'Assertion failed');\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, assert);\n\n throw err;\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = assert;\n","/*!\n * custom.js - custom inspect symbol for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nexports.custom = 'inspect';\n","/*!\n * bn.js - big numbers for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/bn.js:\n * Copyright (c) 2015, Fedor Indutny (MIT License).\n * https://github.com/indutny/bn.js\n *\n * Parts of this software are based on golang/go:\n * Copyright (c) 2009, The Go Authors. All rights reserved.\n * https://github.com/golang/go\n *\n * Parts of this software are based on openssl/openssl:\n * Copyright (c) 1998-2018, The OpenSSL Project (Apache License v2.0).\n * Copyright (c) 1995-1998, Eric A. Young, Tim J. Hudson. All rights reserved.\n * https://github.com/openssl/openssl\n *\n * Parts of this software are based on libgmp:\n * Copyright (c) 1991-1997, 1999-2014, Free Software Foundation, Inc.\n * https://gmplib.org/\n *\n * Parts of this software are based on v8/v8:\n * Copyright (c) 2017, The V8 Project Authors (BSD-Style License).\n * https://github.com/v8/v8\n *\n * Resources:\n * https://github.com/indutny/bn.js/blob/master/lib/bn.js\n * https://github.com/indutny/miller-rabin/blob/master/lib/mr.js\n * https://github.com/golang/go/blob/master/src/math/big/int.go\n * https://github.com/golang/go/blob/master/src/math/big/nat.go\n * https://github.com/golang/go/blob/master/src/math/big/prime.go\n * https://github.com/openssl/openssl/tree/master/crypto/bn\n * https://github.com/openssl/openssl/blob/master/crypto/bn/bn_kron.c\n * https://github.com/gnutls/nettle/blob/master/mini-gmp.c\n * https://github.com/v8/v8/blob/master/src/objects/bigint.cc\n */\n\n/* eslint valid-typeof: \"off\" */\n\n'use strict';\n\nconst {custom} = require('../internal/custom');\n\n/*\n * Constants\n */\n\nconst zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n];\n\nconst groupSizes = [\n 0x00, 0x19, 0x10, 0x0c, 0x0b, 0x0a,\n 0x09, 0x08, 0x08, 0x07, 0x07, 0x07,\n 0x07, 0x06, 0x06, 0x06, 0x06, 0x06,\n 0x06, 0x06, 0x05, 0x05, 0x05, 0x05,\n 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,\n 0x05, 0x05, 0x05, 0x05, 0x05, 0x05\n];\n\nconst groupBases = [\n 0x00000000, 0x02000000, 0x0290d741, 0x01000000,\n 0x02e90edd, 0x039aa400, 0x0267bf47, 0x01000000,\n 0x0290d741, 0x00989680, 0x012959c3, 0x0222c000,\n 0x03bd7765, 0x0072e440, 0x00adcea1, 0x01000000,\n 0x01704f61, 0x0206fc40, 0x02cddcf9, 0x03d09000,\n 0x003e5185, 0x004ea360, 0x006235f7, 0x00798000,\n 0x009502f9, 0x00b54ba0, 0x00daf26b, 0x01069c00,\n 0x0138f9ad, 0x0172c9e0, 0x01b4d89f, 0x02000000,\n 0x025528a1, 0x02b54a20, 0x03216b93, 0x039aa400\n];\n\nconst primes = {\n p192: null,\n p224: null,\n p521: null,\n k256: null,\n p251: null,\n p25519: null,\n p448: null\n};\n\nconst modes = {\n NONE: 0,\n QUO: 1,\n REM: 2,\n BOTH: 3,\n EUCLID: 4,\n ALL: 7\n};\n\nconst WND_WIDTH = 4;\nconst WND_SIZE = 1 << (WND_WIDTH - 1);\n\nconst HAS_BIGINT = typeof BigInt === 'function';\n\n/**\n * BN\n */\n\nclass BN {\n constructor(num, base, endian) {\n this.words = [0];\n this.length = 1;\n this.negative = 0;\n this.red = null;\n this.from(num, base, endian);\n }\n\n /*\n * Addition Engine\n */\n\n _iadd(a, b) {\n let carry = 0;\n let i = 0;\n\n // a.length > b.length\n if (a.length < b.length)\n [a, b] = [b, a];\n\n if (a !== this)\n this._alloc(a.length);\n\n for (; i < b.length; i++) {\n const r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n\n this.words[i] = r & 0x3ffffff;\n\n carry = r >>> 26;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n const r = (a.words[i] | 0) + carry;\n\n this.words[i] = r & 0x3ffffff;\n\n carry = r >>> 26;\n }\n\n this.length = a.length;\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n } else if (a !== this) {\n // Copy the rest of the words.\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n _iaddn(num) {\n this.words[0] += num;\n\n if (this.words[0] < 0x4000000)\n return this;\n\n // Carry.\n let i = 0;\n\n this._alloc(this.length + 1);\n\n this.words[this.length] = 0;\n\n for (; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n this.words[i + 1] += 1;\n }\n\n this.length = Math.max(this.length, i + 1);\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n /*\n * Addition\n */\n\n iadd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative === num.negative) {\n // x + y == x + y\n // (-x) + (-y) == -(x + y)\n this._iadd(this, num);\n } else {\n // x + (-y) == x - y == -(y - x)\n // (-x) + y == y - x == -(x - y)\n const cmp = this.ucmp(num);\n\n // x + (-x) == (-x) + x == 0\n if (cmp === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n if (cmp < 0) {\n this._isub(num, this);\n this.negative ^= 1;\n } else {\n this._isub(this, num);\n }\n }\n\n return this;\n }\n\n iaddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (negative)\n num = -num;\n\n if (this.negative === negative) {\n // x + y == x + y\n // (-x) + (-y) == -(x + y)\n this._iaddn(num);\n } else {\n // x + (-y) == x - y == -(y - x)\n // (-x) + y == y - x == -(x - y)\n if (this.length === 1 && this.words[0] < num) {\n this.words[0] = num - this.words[0];\n this.negative ^= 1;\n } else {\n this._isubn(num);\n }\n }\n\n return this;\n }\n\n add(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (num.length > this.length)\n return num.clone().iadd(this);\n\n return this.clone().iadd(num);\n }\n\n addn(num) {\n return this.clone().iaddn(num);\n }\n\n /*\n * Subtraction Engine\n */\n\n _isub(a, b) {\n let carry = 0;\n let i = 0;\n\n // a > b\n assert(a.length >= b.length);\n\n if (a !== this)\n this._alloc(a.length);\n\n for (; i < b.length; i++) {\n const r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n\n carry = r >> 26;\n\n this.words[i] = r & 0x3ffffff;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n const r = (a.words[i] | 0) + carry;\n\n carry = r >> 26;\n\n this.words[i] = r & 0x3ffffff;\n }\n\n assert(carry === 0);\n\n // Copy rest of the words.\n if (a !== this) {\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n this.length = Math.max(this.length, i);\n\n return this._strip();\n }\n\n _isubn(num) {\n this.words[0] -= num;\n\n if (this.words[0] >= 0)\n return this._normalize();\n\n assert(this.length !== 1);\n\n // Carry.\n this._alloc(this.length + 1);\n\n for (let i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n\n this.words[this.length] = 0;\n\n return this._strip();\n }\n\n /*\n * Subtraction\n */\n\n isub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative !== num.negative) {\n // x - (-y) == x + y\n // (-x) - y == -(x + y)\n this._iadd(this, num);\n } else {\n // x - y == x - y == -(y - x)\n // (-x) - (-y) == y - x == -(x - y)\n const cmp = this.ucmp(num);\n\n // x - x == 0\n if (cmp === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n if (cmp < 0) {\n this._isub(num, this);\n this.negative ^= 1;\n } else {\n this._isub(this, num);\n }\n }\n\n return this;\n }\n\n isubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (negative)\n num = -num;\n\n if (this.negative !== negative) {\n // x - (-y) == x + y\n // (-x) - y == -(x + y)\n this._iaddn(num);\n } else {\n // x - y == x - y == -(y - x)\n // (-x) - (-y) == y - x == -(x - y)\n if (this.length === 1 && this.words[0] < num) {\n this.words[0] = num - this.words[0];\n this.negative ^= 1;\n } else {\n this._isubn(num);\n }\n }\n\n return this;\n }\n\n sub(num) {\n return this.clone().isub(num);\n }\n\n subn(num) {\n return this.clone().isubn(num);\n }\n\n /*\n * Multiplication Engine\n */\n\n _mul(num, out) {\n enforce(BN.isBN(num), 'num', 'bignum');\n enforce(BN.isBN(out), 'out', 'bignum');\n\n if (this.length === 10 && num.length === 10)\n return comb10MulTo(this, num, out);\n\n const len = this.length + num.length;\n\n if (len < 63)\n return smallMulTo(this, num, out);\n\n if (len < 1024)\n return bigMulTo(this, num, out);\n\n return jumboMulTo(this, num, out);\n }\n\n /*\n * Multiplication\n */\n\n imul(num) {\n return this.mul(num)._move(this);\n }\n\n imuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n // Carry.\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = this.words[i] * num;\n const lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n carry += lo >>> 26;\n\n this.words[i] = lo & 0x3ffffff;\n }\n\n this.negative ^= neg;\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n } else {\n this._strip();\n }\n\n return this;\n }\n\n mul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n const len = this.length + num.length;\n const out = new BN();\n\n out.words = new Array(len);\n\n for (let i = 0; i < len; i ++)\n out.words[i] = 0;\n\n return this._mul(num, out);\n }\n\n muln(num) {\n return this.clone().imuln(num);\n }\n\n /*\n * Multiplication + Shift\n */\n\n mulShift(num, bits) {\n enforce(BN.isBN(num), 'num', 'bignum');\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = this.mul(num);\n const b = r.utestn(bits - 1);\n\n r.iushrn(bits);\n\n if (this.negative ^ num.negative)\n return r.isubn(b);\n\n return r.iaddn(b);\n }\n\n /*\n * Division Engine\n */\n\n _div(num, flags) {\n enforce(BN.isBN(num), 'num', 'bignum');\n assert((flags & modes.ALL) === flags);\n assert(flags !== modes.NONE);\n\n const a = this;\n const b = num;\n\n nonzero(!b.isZero());\n\n if (a.isZero())\n return [new BN(0), new BN(0)];\n\n const as = a.negative;\n const bs = b.negative;\n\n a.negative = 0;\n b.negative = 0;\n\n let q = null;\n let r = null;\n\n if (a.ucmp(b) < 0) {\n if (flags & modes.QUO)\n q = new BN(0);\n\n if (flags & modes.REM)\n r = a.clone();\n } else if (b.length === 1) {\n if (flags & modes.QUO)\n q = a.quon(b.words[0]);\n\n if (flags & modes.REM)\n r = a.remn(b.words[0]);\n } else {\n [q, r] = a._wordDiv(b, flags);\n }\n\n a.negative = as;\n b.negative = bs;\n\n if (flags & modes.QUO) {\n q.negative = a.negative ^ b.negative;\n q._normalize();\n }\n\n if (flags & modes.REM) {\n r.negative = a.negative;\n r._normalize();\n }\n\n if (flags & modes.EUCLID) {\n if (flags & modes.QUO) {\n assert((flags & modes.REM) !== 0);\n\n if (r.negative !== 0) {\n if (b.negative !== 0)\n q.iaddn(1);\n else\n q.isubn(1);\n }\n }\n\n if (flags & modes.REM) {\n if (r.negative !== 0) {\n if (b.negative !== 0)\n r.isub(b);\n else\n r.iadd(b);\n }\n }\n }\n\n return [q, r];\n }\n\n _wordDiv(num, flags) {\n let a = this.clone();\n let b = num;\n let q = null;\n let hi;\n\n // Normalize.\n const word = b.words[b.length - 1] | 0;\n const shift = 26 - countBits(word);\n\n if (shift !== 0) {\n b = b.clone();\n\n a.iushln(shift);\n b.iushln(shift);\n\n hi = b.words[b.length - 1] | 0;\n } else {\n hi = word;\n }\n\n // Initialize quotient.\n const m = a.length - b.length;\n\n assert(m >= 0);\n\n if (flags & modes.QUO) {\n q = new BN(0);\n q.length = m + 1;\n q.words = new Array(q.length);\n\n for (let i = 0; i < q.length; i++)\n q.words[i] = 0;\n }\n\n // Diff.\n const d = a.clone();\n\n d._ishlnsubmul(b, 1, m);\n\n if (d.negative === 0) {\n if (q)\n q.words[m] = 1;\n\n a = d;\n }\n\n // Divide.\n for (let j = m - 1; j >= 0; j--) {\n const ahi = a.words[b.length + j];\n const alo = a.words[b.length + j - 1];\n const quo = ((ahi * 0x4000000 + alo) / hi) | 0;\n\n let qj = Math.min(quo, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n\n while (a.negative !== 0) {\n qj -= 1;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n a.ineg();\n }\n\n if (q)\n q.words[j] = qj;\n }\n\n // Strip.\n if (q)\n q._strip();\n\n // Denormalize.\n // Note: we shouldn't need to strip `a` here.\n if ((flags & modes.REM) && shift !== 0)\n a.iushrn(shift);\n\n return [q, a];\n }\n\n _ishlnsubmul(num, mul, shift) {\n let carry = 0;\n let i = 0;\n\n this._expand(num.length + shift);\n\n for (; i < num.length; i++) {\n const k = (this.words[i + shift] | 0) + carry;\n const r = num.words[i] * mul;\n const w = k - (r & 0x3ffffff);\n\n carry = (w >> 26) - ((r / 0x4000000) | 0);\n\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n for (; i < this.length - shift; i++) {\n const w = (this.words[i + shift] | 0) + carry;\n\n carry = w >> 26;\n\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0)\n return this._strip();\n\n // Subtraction overflow.\n assert(carry === -1);\n\n carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = -(this.words[i] | 0) + carry;\n\n carry = w >> 26;\n\n this.words[i] = w & 0x3ffffff;\n }\n\n this.negative = 1;\n\n return this._strip();\n }\n\n /*\n * Truncation Division + Modulo\n */\n\n quorem(num) {\n return this._div(num, modes.BOTH);\n }\n\n /*\n * Truncation Division\n */\n\n iquo(num) {\n return this.quo(num)._move(this);\n }\n\n iquon(num) {\n enforce(isSMI(num), 'num', 'smi');\n nonzero(num !== 0);\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n let carry = 0;\n\n for (let i = this.length - 1; i >= 0; i--) {\n const w = (this.words[i] | 0) + carry * 0x4000000;\n\n this.words[i] = (w / num) | 0;\n\n carry = w % num;\n }\n\n this.negative ^= neg;\n\n return this._strip();\n }\n\n quo(num) {\n return this._div(num, modes.QUO)[0];\n }\n\n quon(num) {\n return this.clone().iquon(num);\n }\n\n /*\n * Truncation Modulo\n */\n\n irem(num) {\n return this.rem(num)._move(this);\n }\n\n iremn(num) {\n let m = this.remrn(num);\n\n if (m < 0)\n m = -m;\n\n this.words[0] = m;\n this.length = 1;\n\n return this._normalize();\n }\n\n rem(num) {\n return this._div(num, modes.REM)[1];\n }\n\n remn(num) {\n return this.clone().iremn(num);\n }\n\n remrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n nonzero(num !== 0);\n\n if (num < 0)\n num = -num;\n\n const p = (1 << 26) % num;\n\n let acc = 0;\n\n for (let i = this.length - 1; i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n\n return this.negative !== 0 ? (-acc | 0) : acc;\n }\n\n /*\n * Euclidean Division + Modulo\n */\n\n divmod(num) {\n return this._div(num, modes.BOTH | modes.EUCLID);\n }\n\n /*\n * Euclidean Division\n */\n\n idiv(num) {\n return this.div(num)._move(this);\n }\n\n idivn(num) {\n if (this.negative === 0)\n return this.iquon(num);\n\n const r = this.remrn(num);\n\n this.iquon(num);\n\n if (r < 0) {\n if (num < 0)\n this.iaddn(1);\n else\n this.isubn(1);\n }\n\n return this;\n }\n\n div(num) {\n return this._div(num, modes.BOTH | modes.EUCLID)[0];\n }\n\n divn(num) {\n return this.clone().idivn(num);\n }\n\n /*\n * Euclidean Modulo\n */\n\n imod(num) {\n if (this.ucmp(num) < 0) {\n if (this.negative !== 0) {\n this._isub(num, this);\n this.negative = 0;\n }\n return this;\n }\n\n return this.mod(num)._move(this);\n }\n\n imodn(num) {\n this.words[0] = this.modrn(num);\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n mod(num) {\n return this._div(num, modes.REM | modes.EUCLID)[1];\n }\n\n modn(num) {\n return this.clone().imodn(num);\n }\n\n modrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n let r = this.remrn(num);\n\n if (r < 0) {\n if (num < 0)\n r -= num;\n else\n r += num;\n }\n\n return r;\n }\n\n /*\n * Round Division\n */\n\n divRound(num) {\n const [q, r] = this.quorem(num);\n\n // Fast case - exact division.\n if (r.isZero())\n return q;\n\n const bit = num.words[0] & 1;\n\n num.iushrn(1);\n\n const cmp = r.ucmp(num);\n\n num.iushln(1);\n\n num.words[0] |= bit;\n\n // Round down.\n if (cmp < 0 || (num.isOdd() && cmp === 0))\n return q;\n\n // Round up.\n if (this.negative ^ num.negative)\n return q.isubn(1);\n\n return q.iaddn(1);\n }\n\n /*\n * Exponentiation\n */\n\n ipow(num) {\n return this.pow(num)._move(this);\n }\n\n ipown(num) {\n return this.pown(num)._move(this);\n }\n\n pow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let b = countBits(num.words[num.length - 1]);\n let r = new BN(1);\n\n for (let i = num.length - 1; i >= 0; i--) {\n const word = num.words[i];\n\n for (let j = b - 1; j >= 0; j--) {\n r = r.sqr();\n\n if ((word >> j) & 1)\n r = r.mul(this);\n }\n\n b = 26;\n }\n\n return r;\n }\n\n pown(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if (num < 0)\n num = -num;\n\n if (num === 0)\n return new BN(1);\n\n if (num === 1)\n return this.clone();\n\n const bits = countBits(num);\n\n let r = this;\n\n for (let i = bits - 2; i >= 0; i--) {\n r = r.sqr();\n\n if ((num >> i) & 1)\n r = r.mul(this);\n }\n\n return r;\n }\n\n isqr() {\n return this.imul(this);\n }\n\n sqr() {\n return this.mul(this);\n }\n\n /*\n * Roots Engine\n */\n\n _rootrem(pow, rem) {\n enforce((pow >>> 0) === pow, 'num', 'uint32');\n\n if (pow === 0)\n throw new RangeError('Zeroth root.');\n\n if (~pow & this.negative)\n throw new RangeError('Negative with even root.');\n\n if (this.ucmpn(1) <= 0)\n return [this.clone(), new BN(0)];\n\n let u = new BN(0);\n let t = BN.shift(1, this.bitLength() / pow + 1 | 0);\n let v, r;\n\n if (this.negative !== 0)\n t.ineg();\n\n if (pow === 2) {\n do {\n u = t;\n t = this.quo(u);\n t.iadd(u);\n t.iushrn(1);\n } while (t.ucmp(u) < 0);\n } else {\n do {\n u = t;\n t = u.pown(pow - 1);\n t = this.quo(t);\n v = u.muln(pow - 1);\n t.iadd(v);\n t = t.quon(pow);\n } while (t.ucmp(u) < 0);\n }\n\n if (rem) {\n t = u.pown(pow);\n r = this.sub(t);\n }\n\n return [u, r];\n }\n\n /*\n * Roots\n */\n\n rootrem(pow) {\n return this._rootrem(pow, 1);\n }\n\n iroot(pow) {\n return this.root(pow)._move(this);\n }\n\n root(pow) {\n return this._rootrem(pow, 0)[0];\n }\n\n isPower(pow) {\n enforce((pow >>> 0) === pow, 'num', 'uint32');\n\n if (pow === 0 || (~pow & this.negative))\n return false;\n\n const [, r] = this.rootrem(pow);\n\n return r.sign() === 0;\n }\n\n sqrtrem() {\n return this.rootrem(2);\n }\n\n isqrt() {\n return this.sqrt()._move(this);\n }\n\n sqrt() {\n return this.root(2);\n }\n\n isSquare() {\n return this.isPower(2);\n }\n\n /*\n * AND\n */\n\n iand(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y)\n return x;\n\n if ((x.negative | y.negative) === 0)\n return x.iuand(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) & (-y) == ~(x-1) & ~(y-1)\n // == ~((x-1) | (y-1))\n // == -(((x-1) | (y-1)) + 1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuor(y);\n x.isubn(1);\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n if (x.negative !== 0)\n [x, y] = [y.clone(), x];\n\n // x & (-y) == x & ~(y-1)\n // == x & ~(y-1)\n const width = x.bitLength();\n\n y.iaddn(1);\n y.inotn(width);\n x.iuand(y);\n y.inotn(width);\n y.isubn(1);\n\n return x._move(this);\n }\n\n iandn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.iand(new BN(num));\n\n this.words[0] &= num;\n this.length = 1;\n\n return this;\n }\n\n and(num) {\n return this.clone().iand(num);\n }\n\n andn(num) {\n return this.clone().iandn(num);\n }\n\n andrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0) {\n const n = this.iand(new BN(num));\n\n if (n.length > 1)\n throw new RangeError('Number exceeds 26 bits.');\n\n return n.negative !== 0 ? -n.words[0] : n.words[0];\n }\n\n return this.words[0] & num;\n }\n\n /*\n * Unsigned AND\n */\n\n iuand(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this.length = Math.min(this.length, num.length);\n\n for (let i = 0; i < this.length; i++)\n this.words[i] &= num.words[i];\n\n return this._strip();\n }\n\n iuandn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] &= Math.abs(num);\n this.length = 1;\n\n return this._normalize();\n }\n\n uand(num) {\n return this.clone().iuand(num);\n }\n\n uandn(num) {\n return this.clone().iuandn(num);\n }\n\n uandrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const n = this.words[0] & Math.abs(num);\n\n return this.negative !== 0 ? (-n | 0) : n;\n }\n\n /*\n * OR\n */\n\n ior(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y)\n return x;\n\n if ((x.negative | y.negative) === 0)\n return x.iuor(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) | (-y) == ~(x-1) | ~(y-1)\n // == ~((x-1) & (y-1))\n // == -(((x-1) & (y-1)) + 1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuand(y);\n x.isubn(1);\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n y = y.clone();\n\n if (x.negative !== 0)\n [x, y] = [y, x];\n\n // x | (-y) == x | ~(y-1)\n // == ~((y-1) & ~x)\n // == -(((y-1) & ~x) + 1)\n y.iaddn(1);\n x.inotn(y.bitLength());\n y.iuand(x);\n y.isubn(1);\n\n return y._move(this);\n }\n\n iorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.ior(new BN(num));\n\n this.words[0] |= num;\n\n return this;\n }\n\n or(num) {\n return this.clone().ior(num);\n }\n\n orn(num) {\n return this.clone().iorn(num);\n }\n\n /*\n * Unsigned OR\n */\n\n iuor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this._expand(num.length);\n\n for (let i = 0; i < num.length; i++)\n this.words[i] |= num.words[i];\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n iuorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] |= Math.abs(num);\n\n return this;\n }\n\n uor(num) {\n return this.clone().iuor(num);\n }\n\n uorn(num) {\n return this.clone().iuorn(num);\n }\n\n /*\n * XOR\n */\n\n ixor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y) {\n x.words[0] = 0;\n x.length = 1;\n x.negative = 0;\n return x;\n }\n\n if ((x.negative | y.negative) === 0)\n return x.iuxor(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) ^ (-y) == ~(x-1) ^ ~(y-1)\n // == (x-1) ^ (y-1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuxor(y);\n x.ineg();\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n if (x.negative !== 0)\n [x, y] = [y.clone(), x];\n\n // x ^ (-y) == x ^ ~(y-1)\n // == ~(x ^ (y-1))\n // == -((x ^ (y-1)) + 1)\n y.iaddn(1);\n x.iuxor(y);\n x.iaddn(1);\n x.ineg();\n y.isubn(1);\n\n return x._move(this);\n }\n\n ixorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.ixor(new BN(num));\n\n this.words[0] ^= num;\n\n return this;\n }\n\n xor(num) {\n return this.clone().ixor(num);\n }\n\n xorn(num) {\n return this.clone().ixorn(num);\n }\n\n /*\n * Unsigned XOR\n */\n\n iuxor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let a = this;\n let b = num;\n\n if (a.length < b.length)\n [a, b] = [b, a];\n\n let i = 0;\n\n for (; i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n\n if (a !== this) {\n this._alloc(a.length);\n\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n this.length = a.length;\n\n return this._strip();\n }\n\n iuxorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] ^= Math.abs(num);\n\n return this._normalize();\n }\n\n uxor(num) {\n return this.clone().iuxor(num);\n }\n\n uxorn(num) {\n return this.clone().iuxorn(num);\n }\n\n /*\n * NOT\n */\n\n inot() {\n if (this.negative !== 0) {\n // ~(-x) == ~(~(x-1)) == x-1\n this.ineg().isubn(1);\n } else {\n // ~x == -x-1 == -(x+1)\n this.iaddn(1).ineg();\n }\n return this;\n }\n\n not() {\n return this.clone().inot();\n }\n\n inotn(width) {\n enforce((width >>> 0) === width, 'width', 'uint32');\n\n const r = width % 26;\n\n let s = Math.ceil(width / 26);\n let i = 0;\n\n // Extend the buffer with leading zeroes.\n this._expand(s);\n\n if (r > 0)\n s -= 1;\n\n // Handle complete words.\n for (; i < s; i++)\n this.words[i] ^= 0x3ffffff;\n\n // Handle the residue.\n if (r > 0)\n this.words[i] ^= (1 << r) - 1;\n\n // And remove leading zeroes.\n return this._strip();\n }\n\n notn(width) {\n return this.clone().inotn(width);\n }\n\n /*\n * Left Shift\n */\n\n ishl(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.ishln(num.toNumber());\n }\n\n ishln(bits) {\n return this.iushln(bits);\n }\n\n shl(num) {\n return this.clone().ishl(num);\n }\n\n shln(bits) {\n return this.clone().ishln(bits);\n }\n\n /*\n * Unsigned Left Shift\n */\n\n iushl(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.iushln(num.toNumber());\n }\n\n iushln(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = bits % 26;\n const s = (bits - r) / 26;\n const mask = ((1 << r) - 1) << (26 - r);\n\n if (r !== 0) {\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const ncarry = this.words[i] & mask;\n const c = ((this.words[i] | 0) - ncarry) << r;\n\n this.words[i] = c | carry;\n\n carry = ncarry >>> (26 - r);\n }\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n }\n }\n\n if (s !== 0) {\n this._alloc(this.length + s);\n\n for (let i = this.length - 1; i >= 0; i--)\n this.words[i + s] = this.words[i];\n\n for (let i = 0; i < s; i++)\n this.words[i] = 0;\n\n this.length += s;\n }\n\n return this._strip();\n }\n\n ushl(num) {\n return this.clone().iushl(num);\n }\n\n ushln(bits) {\n return this.clone().iushln(bits);\n }\n\n /*\n * Right Shift Engine\n */\n\n _split(bits, output) {\n const r = bits % 26;\n const s = Math.min((bits - r) / 26, this.length);\n const mask = (1 << r) - 1;\n\n // Extended mode, copy masked part.\n if (output) {\n output._alloc(s);\n\n for (let i = 0; i < s; i++)\n output.words[i] = this.words[i];\n\n output.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all.\n } else if (this.length > s) {\n this.length -= s;\n for (let i = 0; i < this.length; i++)\n this.words[i] = this.words[i + s];\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n let carry = 0;\n\n if (r !== 0) {\n for (let i = this.length - 1; i >= 0; i--) {\n const word = this.words[i] | 0;\n\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n\n carry = word & mask;\n }\n }\n\n // Push carried bits as a mask.\n if (output) {\n if (carry !== 0) {\n output._alloc(output.length + 1);\n output.words[output.length++] = carry;\n } else {\n if (output.length === 0)\n output.words[output.length++] = 0;\n\n output._strip();\n }\n }\n\n return this._strip();\n }\n\n /*\n * Right Shift\n */\n\n ishr(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.ishrn(num.toNumber());\n }\n\n ishrn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (this.negative !== 0) {\n // (-x) >> y == ~(x-1) >> y\n // == ~((x-1) >> y)\n // == -(((x-1) >> y) + 1)\n this.iaddn(1);\n this.iushrn(bits);\n this.isubn(1);\n return this;\n }\n\n return this.iushrn(bits);\n }\n\n shr(num) {\n return this.clone().ishr(num);\n }\n\n shrn(bits) {\n return this.clone().ishrn(bits);\n }\n\n /*\n * Unsigned Right Shift\n */\n\n iushr(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.iushrn(num.toNumber());\n }\n\n iushrn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n return this._split(bits, null);\n }\n\n ushr(num) {\n return this.clone().iushr(num);\n }\n\n ushrn(bits) {\n return this.clone().iushrn(bits);\n }\n\n /*\n * Bit Manipulation\n */\n\n setn(bit, val) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n if (this.negative !== 0) {\n this.iaddn(1);\n this.usetn(bit, !val);\n this.isubn(1);\n return this;\n }\n\n return this.usetn(bit, val);\n }\n\n usetn(bit, val) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n this._expand(s + 1);\n\n if (val)\n this.words[s] |= (1 << r);\n else\n this.words[s] &= ~(1 << r);\n\n return this._strip();\n }\n\n testn(bit) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n // Fast case: bit is much higher than all existing words.\n if (this.length <= s)\n return this.negative;\n\n // Check bit and return.\n const w = this.words[s];\n const val = (w >> r) & 1;\n\n if (this.negative !== 0) {\n if (r > 0 && (w & ((1 << r) - 1)))\n return val ^ 1;\n\n let j = s;\n\n while (j--) {\n if (this.words[j] > 0)\n return val ^ 1;\n }\n }\n\n return val;\n }\n\n utestn(bit) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n // Fast case: bit is much higher than all existing words.\n if (this.length <= s)\n return 0;\n\n // Check bit and return.\n return (this.words[s] >> r) & 1;\n }\n\n imaskn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (this.negative !== 0) {\n this.iaddn(1);\n this.inotn(bits + 1);\n this.ineg();\n }\n\n return this.iumaskn(bits);\n }\n\n maskn(bits) {\n return this.clone().imaskn(bits);\n }\n\n iumaskn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = bits % 26;\n\n let s = (bits - r) / 26;\n\n if (this.length <= s)\n return this;\n\n if (r !== 0)\n s += 1;\n\n this.length = Math.min(s, this.length);\n\n if (r !== 0)\n this.words[this.length - 1] &= (1 << r) - 1;\n\n if (this.length === 0)\n this.words[this.length++] = 0;\n\n return this._strip();\n }\n\n umaskn(bits) {\n return this.clone().iumaskn(bits);\n }\n\n andln(num) {\n return this.words[0] & num;\n }\n\n bit(pos) {\n return this.utestn(pos);\n }\n\n bits(pos, width) {\n enforce((pos >>> 0) === pos, 'pos', 'uint32');\n enforce((width >>> 0) === width, 'width', 'uint32');\n enforce(width <= 26, 'width', 'width');\n\n const shift = pos % 26;\n const index = (pos - shift) / 26;\n\n if (index >= this.length)\n return 0;\n\n let bits = (this.words[index] >> shift) & ((1 << width) - 1);\n\n if (shift + width > 26 && index + 1 < this.length) {\n const more = shift + width - 26;\n const next = this.words[index + 1] & ((1 << more) - 1);\n\n bits |= next << (26 - shift);\n }\n\n return bits;\n }\n\n /*\n * Negation\n */\n\n ineg() {\n if (!this.isZero())\n this.negative ^= 1;\n\n return this;\n }\n\n neg() {\n return this.clone().ineg();\n }\n\n iabs() {\n this.negative = 0;\n return this;\n }\n\n abs() {\n return this.clone().iabs();\n }\n\n /*\n * Comparison\n */\n\n cmp(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative !== num.negative)\n return num.negative - this.negative;\n\n const res = this.ucmp(num);\n\n if (this.negative !== 0)\n return -res | 0;\n\n return res;\n }\n\n cmpn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (this.negative !== negative)\n return negative - this.negative;\n\n const res = this.ucmpn(num);\n\n if (this.negative !== 0)\n return -res | 0;\n\n return res;\n }\n\n eq(num) {\n return this.cmp(num) === 0;\n }\n\n eqn(num) {\n return this.cmpn(num) === 0;\n }\n\n gt(num) {\n return this.cmp(num) > 0;\n }\n\n gtn(num) {\n return this.cmpn(num) > 0;\n }\n\n gte(num) {\n return this.cmp(num) >= 0;\n }\n\n gten(num) {\n return this.cmpn(num) >= 0;\n }\n\n lt(num) {\n return this.cmp(num) < 0;\n }\n\n ltn(num) {\n return this.cmpn(num) < 0;\n }\n\n lte(num) {\n return this.cmp(num) <= 0;\n }\n\n lten(num) {\n return this.cmpn(num) <= 0;\n }\n\n sign() {\n if (this.negative !== 0)\n return -1;\n\n if (this.length === 1 && this.words[0] === 0)\n return 0;\n\n return 1;\n }\n\n isZero() {\n return this.length === 1 && this.words[0] === 0;\n }\n\n isNeg() {\n return this.negative !== 0;\n }\n\n isPos() {\n return this.negative === 0;\n }\n\n isOdd() {\n return (this.words[0] & 1) === 1;\n }\n\n isEven() {\n return (this.words[0] & 1) === 0;\n }\n\n /*\n * Unsigned Comparison\n */\n\n ucmp(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.length < num.length)\n return -1;\n\n if (this.length > num.length)\n return 1;\n\n for (let i = this.length - 1; i >= 0; i--) {\n const a = this.words[i] | 0;\n const b = num.words[i] | 0;\n\n if (a === b)\n continue;\n\n return (a > b) - (a < b);\n }\n\n return 0;\n }\n\n ucmpn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if (this.length > 1)\n return 1;\n\n const w = this.words[0] | 0;\n\n if (num < 0)\n num = -num;\n\n return (w > num) - (w < num);\n }\n\n /*\n * Number Theoretic Functions\n */\n\n legendre(num) {\n const red = HAS_BIGINT ? BN.red(num) : BN.mont(num);\n return this.toRed(red).redLegendre();\n }\n\n jacobi(num) {\n // See: A Binary Algorithm for the Jacobi Symbol\n // J. Shallit, J. Sorenson\n // Page 3, Section 3\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (num.isZero() || num.isEven())\n throw new Error('jacobi: `num` must be odd.');\n\n let a = this._cloneNormal();\n let b = num.clone();\n let j = 1;\n\n if (b.isNeg()) {\n if (a.isNeg())\n j = -1;\n b.ineg();\n }\n\n if (a.isNeg() || a.ucmp(b) >= 0)\n a.imod(b);\n\n while (!a.isZero()) {\n const bits = a._makeOdd();\n\n if (bits & 1) {\n const bmod8 = b.andln(7);\n\n if (bmod8 === 3 || bmod8 === 5)\n j = -j;\n }\n\n if (a.ucmp(b) < 0) {\n [a, b] = [b, a];\n\n if (a.andln(3) === 3 && b.andln(3) === 3)\n j = -j;\n }\n\n a._isub(a, b).iushrn(1);\n\n const bmod8 = b.andln(7);\n\n if (bmod8 === 3 || bmod8 === 5)\n j = -j;\n }\n\n if (b.cmpn(1) !== 0)\n return 0;\n\n return j;\n }\n\n kronecker(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero())\n return num.ucmpn(1) === 0 ? 1 : 0;\n\n if (num.isZero())\n return this.ucmpn(1) === 0 ? 1 : 0;\n\n if (((this.words[0] | num.words[0]) & 1) === 0)\n return 0;\n\n const x = this;\n const y = num.clone();\n const bits = y._makeOdd();\n const table = [0, 1, 0, -1, 0, -1, 0, 1];\n\n let k = x.jacobi(y);\n\n if (bits & 1)\n k *= table[x.andln(7)];\n\n return k | 0;\n }\n\n igcd(num) {\n return this.gcd(num)._move(this);\n }\n\n gcd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero())\n return num.abs();\n\n if (num.isZero())\n return this.abs();\n\n let a = this.clone();\n let b = num.clone();\n\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two.\n const shift = a._factor2(b);\n\n if (shift !== 0) {\n a.iushrn(shift);\n b.iushrn(shift);\n }\n\n for (;;) {\n a._makeOdd();\n b._makeOdd();\n\n const cmp = a.ucmp(b);\n\n if (cmp < 0) {\n // a > b\n [a, b] = [b, a];\n } else if (cmp === 0 || b.ucmpn(1) === 0) {\n // Break if a == b.\n // Break if b == 1 to avoid repeated subtraction.\n break;\n }\n\n a._isub(a, b);\n }\n\n return b.iushln(shift);\n }\n\n ilcm(num) {\n return this.lcm(num)._move(this);\n }\n\n lcm(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero() || num.isZero())\n return new BN(0);\n\n return this.quo(this.gcd(num)).mul(num).iabs();\n }\n\n egcd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero()) {\n return [\n new BN(0),\n new BN(num.sign()),\n num.abs()\n ];\n }\n\n if (num.isZero()) {\n return [\n new BN(this.sign()),\n new BN(0),\n this.abs()\n ];\n }\n\n const x = this.clone();\n const y = num.clone();\n\n x.negative = 0;\n y.negative = 0;\n\n // A * x + B * y = x\n const A = new BN(1);\n const B = new BN(0);\n\n // C * x + D * y = y\n const C = new BN(0);\n const D = new BN(1);\n\n // Remove common factor of two.\n const g = x._factor2(y);\n\n if (g > 0) {\n x.iushrn(g);\n y.iushrn(g);\n }\n\n const xp = x.clone();\n const yp = y.clone();\n\n while (!x.isZero()) {\n let i = x._makeOdd();\n let j = y._makeOdd();\n\n while (i--) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n\n while (j--) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n if (this.negative !== 0)\n C.ineg();\n\n if (num.negative !== 0)\n D.ineg();\n\n return [C, D, y.iushln(g)];\n }\n\n iinvert(num) {\n return this.invert(num)._move(this);\n }\n\n invert(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n range(num.sign() > 0, 'invert');\n\n if (num.isOdd())\n return this._invertp(num);\n\n if (num.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n const [s,, g] = this.egcd(num);\n\n if (g.cmpn(1) !== 0)\n throw new RangeError('Not invertible.');\n\n return s.imod(num);\n }\n\n ifermat(num) {\n return this.fermat(num)._move(this);\n }\n\n fermat(num) {\n const red = HAS_BIGINT ? BN.red(num) : BN.mont(num);\n return this.toRed(red).redFermat().fromRed();\n }\n\n ipowm(y, m, mont) {\n return this.powm(y, m, mont)._move(this);\n }\n\n powm(y, m, mont) {\n const red = !HAS_BIGINT && mont ? BN.mont(m) : BN.red(m);\n return this.toRed(red).redPow(y).fromRed();\n }\n\n ipowmn(y, m, mont) {\n return this.powmn(y, m, mont)._move(this);\n }\n\n powmn(y, m, mont) {\n const red = mont ? BN.mont(m) : BN.red(m);\n return this.toRed(red).redPown(y).fromRed();\n }\n\n isqrtm(p) {\n return this.sqrtm(p)._move(this);\n }\n\n sqrtm(p) {\n enforce(BN.isBN(p), 'p', 'bignum');\n\n let red;\n\n if (p.andln(3) === 3 || p.andln(7) === 5) {\n // Probably not worth the setup.\n red = BN.red(p);\n } else {\n red = BN.mont(p);\n }\n\n return this.toRed(red).redSqrt().fromRed();\n }\n\n isqrtpq(p, q) {\n return this.sqrtpq(p, q)._move(this);\n }\n\n sqrtpq(p, q) {\n const sp = this.sqrtm(p);\n const sq = this.sqrtm(q);\n const [mp, mq] = p.egcd(q);\n const lhs = sq.mul(mp).mul(p);\n const rhs = sp.mul(mq).mul(q);\n const n = p.mul(q);\n\n return lhs.iadd(rhs).imod(n);\n }\n\n /*\n * Primality Testing\n */\n\n isPrime(rng, reps, limit) {\n enforce((reps >>> 0) === reps, 'reps', 'uint32');\n\n if (!this.isPrimeMR(rng, reps + 1, true))\n return false;\n\n if (!this.isPrimeLucas(limit))\n return false;\n\n return true;\n }\n\n isPrimeMR(rng, reps, force2 = false) {\n enforce((reps >>> 0) === reps, 'reps', 'uint32');\n enforce(reps > 0, 'reps', 'integer');\n enforce(typeof force2 === 'boolean', 'force2', 'boolean');\n\n const n = this;\n\n if (n.cmpn(7) < 0) {\n return n.cmpn(2) === 0\n || n.cmpn(3) === 0\n || n.cmpn(5) === 0;\n }\n\n if (n.isEven())\n return false;\n\n const nm1 = n.subn(1);\n const nm3 = nm1.subn(2);\n const k = nm1.zeroBits();\n const q = nm1.ushrn(k);\n\n const red = BN.red(n);\n const rnm1 = nm1.toRed(red);\n const rone = new BN(1).toRed(red);\n\nnext:\n for (let i = 0; i < reps; i++) {\n let x;\n\n if (i === reps - 1 && force2) {\n x = new BN(2);\n } else {\n x = BN.random(rng, 0, nm3);\n x.iaddn(2);\n }\n\n let y = x.toRed(red).redPow(q);\n\n if (y.cmp(rone) === 0 || y.cmp(rnm1) === 0)\n continue;\n\n for (let j = 1; j < k; j++) {\n y = y.redSqr();\n\n if (y.cmp(rnm1) === 0)\n continue next;\n\n if (y.cmp(rone) === 0)\n return false;\n }\n\n return false;\n }\n\n return true;\n }\n\n isPrimeLucas(limit = 0) {\n enforce((limit >>> 0) === limit, 'limit', 'uint32');\n\n const n = this;\n\n // Ignore 0 and 1.\n if (n.cmpn(1) <= 0)\n return false;\n\n // Two is the only even prime.\n if (n.isEven())\n return n.cmpn(2) === 0;\n\n let p = 3;\n\n for (;;) {\n if (p > 10000) {\n // Thought to be impossible.\n throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`);\n }\n\n if (limit !== 0 && p > limit) {\n // Optional DoS limit.\n return false;\n }\n\n const d = new BN(p * p - 4);\n const j = d.jacobi(n);\n\n if (j === -1)\n break;\n\n if (j === 0)\n return n.cmpn(p + 2) === 0;\n\n if (p === 40) {\n if (n.isSquare())\n return false;\n }\n\n p += 1;\n }\n\n const s = n.addn(1);\n const r = s._makeOdd();\n\n let vk = new BN(2);\n let vk1 = new BN(p);\n\n for (let i = s.bitLength(); i >= 0; i--) {\n if (s.utestn(i)) {\n vk = vk.mul(vk1).isubn(p).imod(n);\n vk1 = vk1.sqr().isubn(2).imod(n);\n } else {\n vk1 = vk1.mul(vk).isubn(p).imod(n);\n vk = vk.sqr().isubn(2).imod(n);\n }\n }\n\n if (vk.cmpn(2) === 0 || vk.cmp(n.subn(2)) === 0) {\n const a = vk.muln(p).imod(n);\n const b = vk1.ushln(1).imod(n);\n\n if (a.cmp(b) === 0)\n return true;\n }\n\n for (let t = 0; t < r - 1; t++) {\n if (vk.isZero())\n return true;\n\n if (vk.cmpn(2) === 0)\n return false;\n\n vk = vk.sqr().isubn(2).imod(n);\n }\n\n return false;\n }\n\n /*\n * Twos Complement\n */\n\n toTwos(width) {\n if (this.negative !== 0)\n return this.abs().inotn(width).iaddn(1);\n\n return this.clone();\n }\n\n fromTwos(width) {\n enforce((width >>> 0) === width, 'width', 'uint32');\n range(width > 0, 'width');\n\n if (this.testn(width - 1))\n return this.notn(width).iaddn(1).ineg();\n\n return this.clone();\n }\n\n /*\n * Reduction Context\n */\n\n toRed(ctx) {\n enforce(ctx instanceof Red, 'ctx', 'reduction context');\n\n if (this.red)\n throw new Error('Already in reduction context.');\n\n return ctx.convertTo(this);\n }\n\n fromRed() {\n red(this.red, 'fromRed');\n return this.red.convertFrom(this);\n }\n\n forceRed(ctx) {\n enforce(ctx instanceof Red, 'ctx', 'reduction context');\n\n if (this.red) {\n if (!ctx.m.eq(this.red.m) || ctx.mont !== this.red.mont)\n throw new Error('Already in reduction context.');\n } else {\n range(this.negative === 0, 'red');\n range(this.ucmp(ctx.m) < 0, 'red');\n }\n\n return this.clone()._forceRed(ctx);\n }\n\n redIAdd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIAdd');\n return this.red.iadd(this, num);\n }\n\n redAdd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redAdd');\n return this.red.add(this, num);\n }\n\n redIAddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIAddn');\n return this.red.iaddn(this, num);\n }\n\n redAddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redAddn');\n return this.red.addn(this, num);\n }\n\n redISub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redISub');\n return this.red.isub(this, num);\n }\n\n redSub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redSub');\n return this.red.sub(this, num);\n }\n\n redISubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redISubn');\n return this.red.isubn(this, num);\n }\n\n redSubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redSubn');\n return this.red.subn(this, num);\n }\n\n redIMul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIMul');\n return this.red.imul(this, num);\n }\n\n redMul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redMul');\n return this.red.mul(this, num);\n }\n\n redIMuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIMuln');\n return this.red.imuln(this, num);\n }\n\n redMuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redMuln');\n return this.red.muln(this, num);\n }\n\n redIDiv(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIDiv');\n return this.red.idiv(this, num);\n }\n\n redDiv(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redDiv');\n return this.red.div(this, num);\n }\n\n redIDivn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIDivn');\n return this.red.idivn(this, num);\n }\n\n redDivn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redDivn');\n return this.red.divn(this, num);\n }\n\n redIPow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIPow');\n nonred(!num.red, 'redIPow');\n return this.red.ipow(this, num);\n }\n\n redPow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redPow');\n nonred(!num.red, 'redPow');\n return this.red.pow(this, num);\n }\n\n redIPown(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIPown');\n return this.red.ipown(this, num);\n }\n\n redPown(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redPown');\n return this.red.pown(this, num);\n }\n\n redISqr() {\n red(this.red, 'redISqr');\n return this.red.isqr(this);\n }\n\n redSqr() {\n red(this.red, 'redSqr');\n return this.red.sqr(this);\n }\n\n redISqrt() {\n red(this.red, 'redISqrt');\n return this.red.isqrt(this);\n }\n\n redSqrt() {\n red(this.red, 'redSqrt');\n return this.red.sqrt(this);\n }\n\n redIDivSqrt(v) {\n red(this.red, 'redIDivSqrt');\n return this.red.idivsqrt(this, v);\n }\n\n redDivSqrt(v) {\n red(this.red, 'redDivSqrt');\n return this.red.divsqrt(this, v);\n }\n\n redIsSquare() {\n red(this.red, 'redIsSquare');\n return this.red.isSquare(this);\n }\n\n redIShl(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIShl');\n nonred(!num.red, 'redIShl');\n return this.red.ishl(this, num);\n }\n\n redShl(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redShl');\n nonred(!num.red, 'redShl');\n return this.red.shl(this, num);\n }\n\n redIShln(num) {\n enforce((num >>> 0) === num, 'num', 'uint32');\n red(this.red, 'redIShln');\n return this.red.ishln(this, num);\n }\n\n redShln(num) {\n enforce((num >>> 0) === num, 'num', 'uint32');\n red(this.red, 'redShln');\n return this.red.shln(this, num);\n }\n\n redINeg() {\n red(this.red, 'redINeg');\n return this.red.ineg(this);\n }\n\n redNeg() {\n red(this.red, 'redNeg');\n return this.red.neg(this);\n }\n\n redEq(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redEq');\n return this.red.eq(this, num);\n }\n\n redEqn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redEqn');\n return this.red.eqn(this, num);\n }\n\n redIsHigh() {\n red(this.red, 'redIsHigh');\n return this.red.isHigh(this);\n }\n\n redIsLow() {\n red(this.red, 'redIsLow');\n return this.red.isLow(this);\n }\n\n redIsOdd() {\n red(this.red, 'redIsOdd');\n return this.red.isOdd(this);\n }\n\n redIsEven() {\n red(this.red, 'redIsEven');\n return this.red.isEven(this);\n }\n\n redLegendre() {\n red(this.red, 'redLegendre');\n return this.red.legendre(this);\n }\n\n redJacobi() {\n red(this.red, 'redJacobi');\n return this.red.jacobi(this);\n }\n\n redKronecker() {\n red(this.red, 'redKronecker');\n return this.red.kronecker(this);\n }\n\n redIInvert() {\n red(this.red, 'redIInvert');\n return this.red.iinvert(this);\n }\n\n redInvert() {\n red(this.red, 'redInvert');\n return this.red.invert(this);\n }\n\n redIFermat() {\n red(this.red, 'redIFermat');\n return this.red.ifermat(this);\n }\n\n redFermat() {\n red(this.red, 'redFermat');\n return this.red.fermat(this);\n }\n\n /*\n * Internal\n */\n\n _move(dest) {\n dest.words = this.words;\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n return dest;\n }\n\n _alloc(size) {\n while (this.words.length < size)\n this.words.push(0);\n\n return this;\n }\n\n _expand(size) {\n this._alloc(size);\n\n while (this.length < size)\n this.words[this.length++] = 0;\n\n return this;\n }\n\n _strip() {\n while (this.length > 1 && this.words[this.length - 1] === 0)\n this.length -= 1;\n\n return this._normalize();\n }\n\n _normalize() {\n assert(this.length > 0);\n\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0)\n this.negative = 0;\n\n return this;\n }\n\n _check() {\n // We never have a zero length number.\n assert(this.length > 0);\n\n // Cannot exceed array bounds.\n assert(this.length <= this.words.length);\n\n if (this.length === 1) {\n // Must be normalized.\n if (this.words[0] === 0)\n assert(this.negative === 0);\n return this;\n }\n\n // Must be stripped.\n assert(this.words[this.length - 1] !== 0);\n\n return this;\n }\n\n _invertp(p) {\n // Penk's right shift binary EGCD.\n //\n // See: The Art of Computer Programming,\n // Volume 2, Seminumerical Algorithms\n // Donald E. Knuth\n // Exercise 4.5.2.39\n enforce(BN.isBN(p), 'p', 'bignum');\n range(p.sign() > 0, 'invert');\n assert(p.isOdd());\n\n if (p.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n const a = this.clone();\n const b = p.clone();\n const u = new BN(1);\n const v = new BN(0);\n\n if (a.isNeg() || a.ucmp(b) >= 0)\n a.imod(b);\n\n while (!a.isZero()) {\n let i = a._makeOdd();\n let j = b._makeOdd();\n\n while (i--) {\n if (u.isOdd())\n u._iadd(u, p);\n\n u.iushrn(1);\n }\n\n while (j--) {\n if (v.isOdd())\n v._iadd(v, p);\n\n v.iushrn(1);\n }\n\n if (a.ucmp(b) >= 0) {\n a._isub(a, b);\n if (u.ucmp(v) < 0) {\n u._isub(v, u);\n u._isub(p, u);\n } else {\n u._isub(u, v);\n }\n } else {\n b._isub(b, a);\n if (v.ucmp(u) < 0) {\n v._isub(u, v);\n v._isub(p, v);\n } else {\n v._isub(v, u);\n }\n }\n }\n\n if (b.cmpn(1) !== 0)\n throw new RangeError('Not invertible.');\n\n assert(v.negative === 0);\n assert(v.ucmp(p) < 0);\n\n return v;\n }\n\n _makeOdd() {\n const shift = this.zeroBits();\n\n if (shift > 0)\n this.iushrn(shift);\n\n return shift;\n }\n\n _factor2(num) {\n // Find common factor of two.\n // Expects inputs to be non-zero.\n if ((this.words[0] | num.words[0]) & 1)\n return 0;\n\n const len = Math.min(this.length, num.length);\n\n let r = 0;\n\n for (let i = 0; i < len; i++) {\n const b = zeroBits(this.words[i] | num.words[i]);\n\n r += b;\n\n if (b !== 26)\n break;\n }\n\n return r;\n }\n\n _cloneNormal() {\n return this.red ? this.fromRed() : this.clone();\n }\n\n _forceRed(ctx) {\n this.red = ctx;\n return this;\n }\n\n /*\n * Helpers\n */\n\n clone() {\n const copy = new BN();\n\n copy.words = new Array(this.length);\n\n for (let i = 0; i < this.length; i++)\n copy.words[i] = this.words[i];\n\n copy.length = this.length;\n copy.negative = this.negative;\n copy.red = this.red;\n\n return copy;\n }\n\n inject(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this._alloc(num.length);\n\n for (let i = 0; i < num.length; i++)\n this.words[i] = num.words[i];\n\n this.length = num.length;\n this.negative = num.negative;\n this.red = num.red;\n\n return this;\n }\n\n set(num, endian) {\n return this.fromNumber(num, endian);\n }\n\n swap(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n const x = this;\n const y = num;\n\n [x.words, y.words] = [y.words, x.words];\n [x.length, y.length] = [y.length, x.length];\n [x.negative, y.negative] = [y.negative, x.negative];\n [x.red, y.red] = [y.red, x.red];\n\n return x;\n }\n\n reverse() {\n const neg = this.negative;\n\n this.fromBuffer(this.toBuffer('be'), 'le');\n this.negative = neg;\n\n return this;\n }\n\n byteLength() {\n return Math.ceil(this.bitLength() / 8);\n }\n\n bitLength() {\n const w = this.words[this.length - 1];\n const hi = countBits(w);\n return (this.length - 1) * 26 + hi;\n }\n\n zeroBits() {\n if (this.isZero())\n return 0;\n\n if (this.isOdd())\n return 0;\n\n let r = 0;\n\n for (let i = 0; i < this.length; i++) {\n const b = zeroBits(this.words[i]);\n\n r += b;\n\n if (b !== 26)\n break;\n }\n\n return r;\n }\n\n isSafe() {\n if (this.length <= 2)\n return true;\n\n if (this.length === 3 && this.words[2] === 0x01)\n return true;\n\n return false;\n }\n\n word(pos) {\n enforce((pos >>> 0) === pos, 'pos', 'uint32');\n\n if (pos >= this.length)\n return 0;\n\n return this.words[pos];\n }\n\n [custom]() {\n let prefix = 'BN';\n\n if (this.red)\n prefix = 'BN-R';\n\n return `<${prefix}: ${this.toString(10)}>`;\n }\n\n /*\n * Conversion\n */\n\n toNumber() {\n let num = this.words[0];\n\n if (this.length === 2) {\n num += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // Note: at this stage it is known that the top bit is set.\n num += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n throw new RangeError('Number can only safely store up to 53 bits.');\n }\n\n return this.negative !== 0 ? -num : num;\n }\n\n toDouble() {\n let num = 0;\n\n for (let i = this.length - 1; i >= 0; i--)\n num = (num * 0x4000000) + this.words[i];\n\n return this.negative !== 0 ? -num : num;\n }\n\n valueOf() {\n return this.toDouble();\n }\n\n toBigInt() {\n if (!HAS_BIGINT)\n throw new Error('BigInt is not supported!');\n\n const s52 = BigInt(52);\n const s26 = BigInt(26);\n\n let i = this.length - 1;\n let num = BigInt(0);\n\n for (; i >= 1; i -= 2) {\n const hi = this.words[i] * 0x4000000;\n const lo = this.words[i - 1];\n\n num = (num << s52) | BigInt(hi + lo);\n }\n\n if (i >= 0)\n num = (num << s26) | BigInt(this.words[0]);\n\n return this.negative !== 0 ? -num : num;\n }\n\n toBool() {\n return !this.isZero();\n }\n\n toString(base, padding) {\n base = getBase(base);\n\n if (padding == null)\n padding = 0;\n\n if (padding === 0)\n padding = 1;\n\n enforce((base >>> 0) === base, 'base', 'uint32');\n enforce((padding >>> 0) === padding, 'padding', 'uint32');\n\n if (base < 2 || base > 36)\n throw new RangeError('Base ranges between 2 and 36.');\n\n this._check();\n\n if (base === 16) {\n let out = '';\n let off = 0;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = this.words[i];\n const word = (((w << off) | carry) & 0xffffff).toString(16);\n\n carry = (w >>> (24 - off)) & 0xffffff;\n\n if (carry !== 0 || i !== this.length - 1)\n out = zeros[6 - word.length] + word + out;\n else\n out = word + out;\n\n off += 2;\n\n if (off >= 26) {\n off -= 26;\n i -= 1;\n }\n }\n\n if (carry !== 0)\n out = carry.toString(16) + out;\n\n while (out.length % padding !== 0)\n out = '0' + out;\n\n if (this.negative !== 0)\n out = '-' + out;\n\n return out;\n }\n\n const groupSize = groupSizes[base - 1];\n const groupBase = groupBases[base - 1];\n const c = this.clone();\n\n let out = '';\n\n c.negative = 0;\n\n while (!c.isZero()) {\n const r = c.remrn(groupBase).toString(base);\n\n c.iquon(groupBase);\n\n if (!c.isZero())\n out = zeros[groupSize - r.length] + r + out;\n else\n out = r + out;\n }\n\n if (this.isZero())\n out = '0';\n\n while (out.length % padding !== 0)\n out = '0' + out;\n\n if (this.negative !== 0)\n out = '-' + out;\n\n return out;\n }\n\n toJSON() {\n return this.toString(16, 2);\n }\n\n toArray(endian, length) {\n return this.toArrayLike(Array, endian, length);\n }\n\n toBuffer(endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n }\n\n toArrayLike(ArrayType, endian, length) {\n if (endian == null)\n endian = 'be';\n\n if (length == null)\n length = 0;\n\n enforce(typeof ArrayType === 'function', 'ArrayType', 'function');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n enforce((length >>> 0) === length, 'length', 'uint32');\n\n this._check();\n\n const bytes = this.byteLength();\n const size = length || Math.max(1, bytes);\n\n if (bytes > size)\n throw new RangeError('Byte array longer than desired length.');\n\n const res = allocate(ArrayType, size);\n\n // See: https://github.com/indutny/bn.js/pull/222\n if (endian === 'be') {\n let pos = res.length - 1;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const shift = (i & 3) << 1;\n const word = (this.words[i] << shift) | carry;\n\n res[pos--] = word & 0xff;\n\n if (pos >= 0)\n res[pos--] = (word >>> 8) & 0xff;\n\n if (pos >= 0)\n res[pos--] = (word >>> 16) & 0xff;\n\n if (shift === 6) {\n if (pos >= 0)\n res[pos--] = (word >>> 24) & 0xff;\n\n carry = 0;\n } else {\n carry = word >>> 24;\n }\n }\n\n if (pos >= 0) {\n res[pos--] = carry;\n\n while (pos >= 0)\n res[pos--] = 0;\n\n carry = 0;\n }\n\n assert(carry === 0);\n } else {\n let pos = 0;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const shift = (i & 3) << 1;\n const word = (this.words[i] << shift) | carry;\n\n res[pos++] = word & 0xff;\n\n if (pos < res.length)\n res[pos++] = (word >>> 8) & 0xff;\n\n if (pos < res.length)\n res[pos++] = (word >>> 16) & 0xff;\n\n if (shift === 6) {\n if (pos < res.length)\n res[pos++] = (word >>> 24) & 0xff;\n\n carry = 0;\n } else {\n carry = word >>> 24;\n }\n }\n\n if (pos < res.length) {\n res[pos++] = carry;\n\n while (pos < res.length)\n res[pos++] = 0;\n\n carry = 0;\n }\n\n assert(carry === 0);\n }\n\n return res;\n }\n\n encode(endian, length) {\n return this.toBuffer(endian, length);\n }\n\n /*\n * Instantiation\n */\n\n of(num, endian) {\n return this.fromNumber(num, endian);\n }\n\n fromNumber(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(isInteger(num), 'num', 'integer');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n if (num < 0x4000000) {\n this.words[0] = num & 0x3ffffff;\n this.length = 1;\n } else if (num < 0x10000000000000) {\n this.words = [\n num & 0x3ffffff,\n (num / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n this.words = [\n num & 0x3ffffff,\n (num / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n this.negative = neg;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromDouble(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(typeof num === 'number', 'num', 'double');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (!isFinite(num))\n num = 0;\n\n const neg = (num <= -1) | 0;\n\n if (num < 0)\n num = -num;\n\n num = Math.floor(num);\n\n this.words = [];\n\n while (num > 0) {\n const lo = num % 0x4000000;\n const hi = (num - lo) / 0x4000000;\n\n this.words.push(lo);\n\n num = hi;\n }\n\n if (this.words.length === 0)\n this.words.push(0);\n\n this.length = this.words.length;\n this.negative = neg;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromBigInt(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(typeof num === 'bigint', 'num', 'bigint');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (!HAS_BIGINT)\n throw new Error('BigInt is not supported!');\n\n // You know the implementation has a\n // problem when strings are twice\n // as fast as bigints.\n const start = (num < BigInt(0)) | 0;\n\n this._fromHex(num.toString(16), start);\n this.negative = start;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromBool(value) {\n enforce(typeof value === 'boolean', 'value', 'boolean');\n\n this.words[0] = value | 0;\n this.length = 1;\n this.negative = 0;\n\n return this;\n }\n\n fromString(str, base, endian) {\n if (base === 'le' || base === 'be')\n [base, endian] = [endian, base];\n\n base = getBase(base);\n\n if (endian == null)\n endian = 'be';\n\n enforce(typeof str === 'string', 'string', 'string');\n enforce((base >>> 0) === base, 'base', 'uint32');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (base < 2 || base > 36)\n throw new Error('Base ranges between 2 and 36.');\n\n str = str.replace(/\\s+/g, '');\n\n let start = 0;\n\n if (str.length > 0 && str.charCodeAt(0) === 0x2d)\n start = 1;\n\n if (base === 16)\n this._fromHex(str, start);\n else\n this._fromBase(str, base, start);\n\n this.negative = start;\n\n this._normalize();\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n _fromHex(str, start) {\n this.length = Math.max(2, Math.ceil((str.length - start) / 6));\n this.words = new Array(this.length);\n\n for (let i = 0; i < this.length; i++)\n this.words[i] = 0;\n\n // Scan 24-bit chunks and add them to the number.\n let off = 0;\n let i = str.length - 6;\n let j = 0;\n\n for (; i >= start; i -= 6) {\n const w = parseHex(str, i, i + 6);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n\n // `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb.\n this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n if (i + 6 !== start) {\n const w = parseHex(str, start, i + 6);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff;\n }\n\n return this._strip();\n }\n\n _fromBase(str, base, start) {\n // Initialize as zero.\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n\n // Find length of limb in base.\n let limbLen = 0;\n let limbPow = 1;\n\n for (; limbPow <= 0x3ffffff; limbPow *= base)\n limbLen += 1;\n\n limbLen -= 1;\n limbPow = (limbPow / base) | 0;\n\n const total = str.length - start;\n const mod = total % limbLen;\n const end = Math.min(total, total - mod) + start;\n\n let i = start;\n\n for (; i < end; i += limbLen) {\n const word = parseBase(str, i, i + limbLen, base);\n\n this.imuln(limbPow);\n this._iaddn(word);\n }\n\n if (mod !== 0) {\n const pow = Math.pow(base, mod);\n const word = parseBase(str, i, str.length, base);\n\n this.imuln(pow);\n this._iaddn(word);\n }\n\n return this;\n }\n\n fromJSON(json) {\n if (BN.isBN(json)) {\n if (json.red)\n return json.fromRed();\n\n return json.clone();\n }\n\n if (Array.isArray(json)) {\n for (const chunk of json)\n enforce(typeof chunk === 'string', 'chunk', 'string');\n\n json = json.join('');\n }\n\n return this.fromString(json, 16);\n }\n\n fromBN(num) {\n return this.inject(num);\n }\n\n fromArray(data, endian) {\n enforce(Array.isArray(data), 'data', 'array');\n return this.fromArrayLike(data, endian);\n }\n\n fromBuffer(data, endian) {\n enforce(Buffer.isBuffer(data), 'data', 'buffer');\n return this.fromArrayLike(data, endian);\n }\n\n fromArrayLike(data, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(data && (data.length >>> 0) === data.length, 'data', 'array-like');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (data.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n this.length = Math.max(2, Math.ceil(data.length / 3));\n this.words = new Array(this.length);\n this.negative = 0;\n\n for (let i = 0; i < this.length; i++)\n this.words[i] = 0;\n\n const left = data.length % 3;\n\n let off = 0;\n let j = 0;\n let w = 0;\n\n if (endian === 'be') {\n for (let i = data.length - 1; i >= 2; i -= 3) {\n const w = data[i] | (data[i - 1] << 8) | (data[i - 2] << 16);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n switch (left) {\n case 2:\n w = data[1] | (data[0] << 8);\n break;\n case 1:\n w = data[0];\n break;\n }\n } else {\n const len = data.length - left;\n\n for (let i = 0; i < len; i += 3) {\n const w = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n switch (left) {\n case 2:\n w = data[len] | (data[len + 1] << 8);\n break;\n case 1:\n w = data[len];\n break;\n }\n }\n\n if (left > 0) {\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n }\n\n return this._strip();\n }\n\n decode(data, endian) {\n return this.fromBuffer(data, endian);\n }\n\n from(num, base, endian) {\n if (num == null)\n return this;\n\n if (base === 'le' || base === 'be')\n [base, endian] = [endian, base];\n\n if (typeof num === 'number')\n return this.fromNumber(num, endian);\n\n if (typeof num === 'bigint')\n return this.fromBigInt(num, endian);\n\n if (typeof num === 'string')\n return this.fromString(num, base, endian);\n\n if (typeof num === 'object') {\n if (BN.isBN(num))\n return this.fromBN(num, endian);\n\n if ((num.length >>> 0) === num.length)\n return this.fromArrayLike(num, endian);\n }\n\n if (typeof num === 'boolean')\n return this.fromBool(num);\n\n throw new TypeError('Non-numeric object passed to BN.');\n }\n\n /*\n * Static Methods\n */\n\n static min(...args) {\n let min = null;\n\n for (const num of args) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (!min || num.cmp(min) < 0)\n min = num;\n }\n\n return min || new BN(0);\n }\n\n static max(...args) {\n let max = null;\n\n for (const num of args) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (!max || num.cmp(max) > 0)\n max = num;\n }\n\n return max || new BN(0);\n }\n\n static cmp(a, b) {\n enforce(BN.isBN(a), 'a', 'bignum');\n return a.cmp(b);\n }\n\n static ucmp(a, b) {\n enforce(BN.isBN(a), 'a', 'bignum');\n return a.ucmp(b);\n }\n\n static red(num) {\n return new Red(num);\n }\n\n static barrett(num) {\n return new Barrett(num);\n }\n\n static mont(num) {\n return new Mont(num);\n }\n\n static _prime(name) {\n if (primes[name])\n return primes[name];\n\n let prime;\n\n if (name === 'p192')\n prime = new P192();\n else if (name === 'p224')\n prime = new P224();\n else if (name === 'p521')\n prime = new P521();\n else if (name === 'k256')\n prime = new K256();\n else if (name === 'p251')\n prime = new P251();\n else if (name === 'p25519')\n prime = new P25519();\n else if (name === 'p448')\n prime = new P448();\n else\n throw new Error(`Unknown prime: \"${name}\".`);\n\n primes[name] = prime;\n\n return prime;\n }\n\n static prime(name) {\n return BN._prime(name).p.clone();\n }\n\n static pow(num, exp) {\n if (num === 2)\n return BN.shift(1, exp);\n\n return new BN().fromNumber(num).pown(exp);\n }\n\n static shift(num, bits) {\n if (num === 1)\n return new BN(0).usetn(bits, 1);\n\n return new BN().fromNumber(num).ishln(bits);\n }\n\n static mask(bits) {\n return BN.shift(1, bits).isubn(1);\n }\n\n static randomBits(rng, bits) {\n enforce(rng != null, 'rng', 'rng');\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (typeof rng === 'object') {\n enforce(typeof rng.randomBytes === 'function', 'rng', 'rng');\n\n const size = (bits + 7) >>> 3;\n const total = size * 8;\n const bytes = rng.randomBytes(size);\n\n enforce(Buffer.isBuffer(bytes), 'bytes', 'buffer');\n\n if (bytes.length !== size)\n throw new RangeError('Invalid number of bytes returned from RNG.');\n\n const num = BN.fromBuffer(bytes);\n\n if (total > bits)\n num.iushrn(total - bits);\n\n return num;\n }\n\n enforce(typeof rng === 'function', 'rng', 'rng');\n\n const num = rng(bits);\n\n enforce(BN.isBN(num), 'num', 'bignum');\n range(num.negative === 0, 'RNG');\n nonred(!num.red, 'RNG');\n\n if (num.bitLength() > bits)\n throw new RangeError('Invalid number of bits returned from RNG.');\n\n return num;\n }\n\n static random(rng, min, max) {\n min = BN.cast(min, 16);\n max = BN.cast(max, 16);\n\n if (min.cmp(max) > 0)\n throw new RangeError('Minimum cannot be greater than maximum.');\n\n const space = max.sub(min).iabs();\n const bits = space.bitLength();\n\n if (bits === 0)\n return min.clone();\n\n for (;;) {\n const num = BN.randomBits(rng, bits);\n\n // Maximum is _exclusive_!\n if (num.cmp(space) >= 0)\n continue;\n\n // Minimum is _inclusive_!\n num.iadd(min);\n\n return num;\n }\n }\n\n static of(num, endian) {\n return new BN().of(num, endian);\n }\n\n static fromNumber(num, endian) {\n return new BN().fromNumber(num, endian);\n }\n\n static fromDouble(num, endian) {\n return new BN().fromDouble(num, endian);\n }\n\n static fromBigInt(num, endian) {\n return new BN().fromBigInt(num, endian);\n }\n\n static fromBool(value) {\n return new BN().fromBool(value);\n }\n\n static fromString(str, base, endian) {\n return new BN().fromString(str, base, endian);\n }\n\n static fromJSON(json) {\n return new BN().fromJSON(json);\n }\n\n static fromBN(num) {\n return new BN().fromBN(num);\n }\n\n static fromArray(data, endian) {\n return new BN().fromArray(data, endian);\n }\n\n static fromBuffer(data, endian) {\n return new BN().fromBuffer(data, endian);\n }\n\n static fromArrayLike(data, endian) {\n return new BN().fromArrayLike(data, endian);\n }\n\n static decode(data, endian) {\n return new BN().decode(data, endian);\n }\n\n static from(num, base, endian) {\n return new BN().from(num, base, endian);\n }\n\n static cast(num, base, endian) {\n if (BN.isBN(num))\n return num;\n\n return new BN(num, base, endian);\n }\n\n static isBN(obj) {\n return obj instanceof BN;\n }\n}\n\n/*\n * Static\n */\n\nBN.BN = BN;\nBN.wordSize = 26;\nBN.native = 0;\n\n/**\n * Prime\n */\n\nclass Prime {\n constructor(name, p) {\n // P = 2^N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = BN.shift(1, this.n).isub(this.p);\n this.lo = this.p.clone();\n this.one = this.p.clone();\n }\n\n ireduce(num) {\n // Assumes that `num` is less than `P^2`:\n // num = HI * (2^N - K) + HI * K + LO = HI * K + LO (mod P)\n const neg = num.negative !== 0;\n\n // Track bits.\n let bits = num.bitLength();\n\n // Must be less than P^2.\n assert(bits <= this.n * 2);\n\n // Ensure positive.\n num.negative = 0;\n\n // Reduce.\n while (bits > this.n) {\n // lo = num & ((1 << n) - 1)\n // num = num >> n\n this.split(num, this.lo);\n\n // num = num * K\n this.imulK(num);\n\n // num = num + lo\n num._iadd(num, this.lo);\n\n // bits = bitlen(num)\n bits = num.bitLength();\n }\n\n // Final reduction.\n const cmp = bits < this.n ? -1 : num.ucmp(this.p);\n\n if (cmp === 0) {\n num.words[0] = 0;\n num.length = 1;\n } else if (cmp > 0) {\n num._isub(num, this.p);\n } else {\n // Note: we shouldn't need to strip here.\n }\n\n // Adjust sign.\n if (neg && !num.isZero())\n num._isub(this.p, num);\n\n return num;\n }\n\n split(input, out) {\n input._split(this.n, out);\n }\n\n imulK(num) {\n return num.imul(this.k);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n throw new Error('Not implemented.');\n }\n\n fermat(x) {\n return this.pm2(x);\n }\n}\n\n/**\n * Prime (3 mod 4)\n */\n\nclass Prime34 extends Prime {\n constructor(name, p) {\n super(name, p);\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n throw new Error('Not implemented.');\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // r = x^((p + 1) / 4) mod p\n const {red} = x;\n const r = this.pp1d4(x);\n\n if (!red.sqr(r).eq(x))\n throw new SquareRootError(r);\n\n return r;\n }\n\n divsqrt(u, v) {\n // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p\n const {red} = u;\n const u2 = red.sqr(u);\n const u3 = red.mul(u2, u);\n const u5 = red.mul(u3, u2);\n const v3 = red.mul(red.sqr(v), v);\n const p = this.pm3d4(red.mul(u5, v3));\n const x = red.mul(red.mul(u3, v), p);\n const c = red.mul(v, red.sqr(x));\n\n if (c.eq(u))\n return x;\n\n throw new SquareRootError(x);\n }\n}\n\n/**\n * Prime (5 mod 8)\n */\n\nclass Prime58 extends Prime {\n constructor(name, p, sm1) {\n super(name, p);\n\n this.sm1 = new BN(sm1, 16);\n }\n\n pm5d8(x1) {\n // Exponent: (p - 5) / 8\n throw new Error('Not implemented.');\n }\n\n pp3d8(x1) {\n // Exponent: (p + 3) / 8\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // r = x^((p + 3) / 8) mod p\n const {red} = x;\n const sm1 = this.sm1._forceRed(red);\n const r = this.pp3d8(x);\n\n if (red.sqr(r).eq(x))\n return r;\n\n const c = red.mul(r, sm1);\n\n if (red.sqr(c).eq(x))\n return c;\n\n throw new SquareRootError(r);\n }\n\n divsqrt(u, v) {\n // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p\n const {red} = u;\n const sm1 = this.sm1._forceRed(red);\n const v3 = red.mul(red.sqr(v), v);\n const v7 = red.mul(red.sqr(v3), v);\n const p = this.pm5d8(red.mul(u, v7));\n const x = red.mul(red.mul(u, v3), p);\n const c = red.mul(v, red.sqr(x));\n\n if (c.eq(u))\n return x;\n\n const mc = red.ineg(c);\n\n if (mc.eq(u))\n return red.mul(x, sm1);\n\n if (mc.eq(red.mul(u, sm1)))\n throw new SquareRootError(red.mul(x, sm1));\n\n throw new SquareRootError(x);\n }\n}\n\n/**\n * Prime (1 mod 16)\n */\n\nclass Prime116 extends Prime {\n constructor(name, p, g) {\n super(name, p);\n\n this.g = new BN(g, 16);\n this.z = this.p.subn(1).zeroBits();\n }\n\n powS(x1) {\n // Exponent: (p - 1) / 2^k\n throw new Error('Not implemented.');\n }\n\n powE(x1) {\n // Exponent: (s + 1) / 2\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // Tonelli-Shanks (variable time).\n //\n // Constants:\n //\n // k = factors of 2 for (p - 1)\n // s = (p - 1) / 2^k\n // e = (s + 1) / 2\n // n = first non-square in F(p)\n //\n // Algorithm:\n //\n // g = n^s mod p\n // y = x^e mod p\n // b = x^s mod p\n //\n // loop:\n // t = b\n // m = 0\n //\n // while t != 1:\n // t = t^2 mod p\n // m += 1\n //\n // if m == 0:\n // break\n //\n // if m >= k:\n // fail\n //\n // t = g^(2^(k - m - 1)) mod p\n // g = t^2 mod p\n // y = y * t mod p\n // b = b * g mod p\n // k = m\n //\n // return y\n //\n const {red} = x;\n\n switch (red.jacobi(x)) {\n case -1:\n throw new SquareRootError(x);\n case 0:\n return x.clone();\n case 1:\n break;\n }\n\n let g = this.g._forceRed(red);\n let y = this.powE(x);\n let b = this.powS(x);\n let k = this.z;\n\n for (;;) {\n let t = b;\n let m = 0;\n\n while (t.cmpn(1) !== 0 && m < k) {\n t = red.sqr(t);\n m += 1;\n }\n\n if (m === 0)\n break;\n\n assert(m < k);\n\n t = red.sqrn(g, k - m - 1);\n g = red.sqr(t);\n y = red.mul(y, t);\n b = red.mul(b, g);\n k = m;\n }\n\n return y;\n }\n\n divsqrt(u, v) {\n const {red} = u;\n\n if (v.isZero())\n throw new SquareRootError(v);\n\n return this.sqrt(red.div(u, v));\n }\n}\n\n/**\n * P192\n */\n\nclass P192 extends Prime34 {\n constructor() {\n // 2^192 - 2^64 - 1 (= 3 mod 4)\n super('p192', 'ffffffff ffffffff ffffffff fffffffe'\n + 'ffffffff ffffffff');\n }\n\n imulK(num) {\n // K = 0x10000000000000001\n // K = 2^64 + 1\n const one = this.one.inject(num);\n return num.iushln(64)._iadd(num, one);\n }\n\n core(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 127x1 1x0 62x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x30 = red.sqrnmul(x24, 6, x6);\n const x31 = red.sqrnmul(x30, 1, x1);\n const x62 = red.sqrnmul(x31, 31, x31);\n const x124 = red.sqrnmul(x62, 62, x62);\n const x127 = red.sqrnmul(x124, 3, x3);\n const r0 = red.sqrn(x127, 1);\n const r1 = red.sqrnmul(r0, 62, x62);\n\n return r1;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 127x1 1x0 62x1\n return this.core(x1);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 127x1 1x0 62x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 128x1 62x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x4 = red.sqrnmul(x2, 2, x2);\n const x8 = red.sqrnmul(x4, 4, x4);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n const r0 = red.sqrn(x128, 62);\n\n return r0;\n }\n}\n\n/**\n * P224\n */\n\nclass P224 extends Prime116 {\n constructor() {\n // 2^224 - 2^96 + 1 (1 mod 16)\n super('p224', 'ffffffff ffffffff ffffffff ffffffff'\n + '00000000 00000000 00000001',\n '6a0fec67 8598a792 0c55b2d4 0b2d6ffb'\n + 'bea3d8ce f3fb3632 dc691b74');\n }\n\n imulK(num) {\n // K = 0xffffffffffffffffffffffff\n // K = 2^96 - 1\n const one = this.one.inject(num);\n return num.iushln(96)._isub(num, one);\n }\n\n powS(x1) {\n // Exponent: 2^128 - 1\n // Bits: 128x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x4 = red.sqrnmul(x2, 2, x2);\n const x8 = red.sqrnmul(x4, 4, x4);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n\n return x128;\n }\n\n powE(x1) {\n // Exponent: 2^127\n // Bits: 1x1 127x0\n const {red} = x1;\n const r0 = red.sqrn(x1, 127);\n\n return r0;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 127x1 1x0 96x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x48 = red.sqrnmul(x24, 24, x24);\n const x96 = red.sqrnmul(x48, 48, x48);\n const x120 = red.sqrnmul(x96, 24, x24);\n const x126 = red.sqrnmul(x120, 6, x6);\n const x127 = red.sqrnmul(x126, 1, x1);\n const r0 = red.sqrn(x127, 1);\n const r1 = red.sqrnmul(r0, 96, x96);\n\n return r1;\n }\n}\n\n/**\n * P521\n */\n\nclass P521 extends Prime34 {\n constructor() {\n // 2^521 - 1 (= 3 mod 4)\n super('p521', '000001ff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff');\n }\n\n imulK(num) {\n // K = 0x01\n return num;\n }\n\n core(x1) {\n // Exponent: 2^519 - 1\n // Bits: 519x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x7 = red.sqrnmul(x6, 1, x1);\n const x8 = red.sqrnmul(x7, 1, x1);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n const x256 = red.sqrnmul(x128, 128, x128);\n const x512 = red.sqrnmul(x256, 256, x256);\n const x519 = red.sqrnmul(x512, 7, x7);\n\n return x519;\n }\n\n pm3d4(x1) {\n // Exponent: 2^519 - 1\n // Bits: 519x1\n return this.core(x1);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 519x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 1x1 519x0\n const {red} = x1;\n const r0 = red.sqrn(x1, 519);\n\n return r0;\n }\n}\n\n/**\n * K256\n */\n\nclass K256 extends Prime34 {\n constructor() {\n // 2^256 - 2^32 - 977 (= 3 mod 4)\n super('k256', 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff fffffffe fffffc2f');\n }\n\n split(input, output) {\n // 256 = 9 * 26 + 22\n const mask = 0x3fffff;\n const len = Math.min(input.length, 9);\n\n output._alloc(len + 1);\n\n for (let i = 0; i < len; i++)\n output.words[i] = input.words[i];\n\n output.length = len;\n\n if (input.length <= 9) {\n output._strip();\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs.\n let prev = input.words[9];\n let i = 10;\n\n output.words[output.length++] = prev & mask;\n output._strip();\n\n for (; i < input.length; i++) {\n const next = input.words[i] | 0;\n\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n\n prev = next;\n }\n\n prev >>>= 22;\n\n input.words[i - 10] = prev;\n\n if (prev === 0 && input.length > 10)\n input.length -= 10;\n else\n input.length -= 9;\n\n input._strip(); // Unsure if we need this.\n }\n\n imulK(num) {\n // K = 0x1000003d1 = [0x40, 0x3d1]\n // K = 2^32 + 977\n num._expand(num.length + 2);\n\n // Bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n let lo = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i];\n\n lo += w * 0x3d1;\n\n num.words[i] = lo & 0x3ffffff;\n\n lo = w * 0x40 + Math.floor(lo / 0x4000000);\n }\n\n // Fast length reduction.\n if (num.words[num.length - 1] === 0) {\n num.length -= 1;\n if (num.words[num.length - 1] === 0)\n num.length -= 1;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1, x2) {\n // Exponent: (p - 47) / 64\n // Bits: 223x1 1x0 22x1 4x0\n const {red} = x1;\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x9 = red.sqrnmul(x6, 3, x3);\n const x11 = red.sqrnmul(x9, 2, x2);\n const x22 = red.sqrnmul(x11, 11, x11);\n const x44 = red.sqrnmul(x22, 22, x22);\n const x88 = red.sqrnmul(x44, 44, x44);\n const x176 = red.sqrnmul(x88, 88, x88);\n const x220 = red.sqrnmul(x176, 44, x44);\n const x223 = red.sqrnmul(x220, 3, x3);\n const r0 = red.sqrn(x223, 1);\n const r1 = red.sqrnmul(r0, 22, x22);\n const r2 = red.sqrn(r1, 4);\n\n return r2;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 1, x1);\n const r4 = red.sqrn(r3, 1);\n const r5 = red.sqrnmul(r4, 2, x2);\n\n return r5;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 1x0 1x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 1, x1);\n const r4 = red.sqrn(r3, 1);\n const r5 = red.sqrnmul(r4, 2, x2);\n const r6 = red.sqrn(r5, 1);\n const r7 = red.sqrnmul(r6, 1, x1);\n\n return r7;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 223x1 1x0 22x1 4x0 2x1 2x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 2, x2);\n const r4 = red.sqrn(r3, 2);\n\n return r4;\n }\n}\n\n/**\n * P251\n */\n\nclass P251 extends Prime34 {\n constructor() {\n // 2^251 - 9\n super('p251', '07ffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff fffffff7');\n }\n\n imulK(num) {\n // K = 0x09\n if (num.isZero())\n return num;\n\n let carry = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i] * 0x09 + carry;\n\n carry = w >>> 26;\n\n num.words[i] = w & 0x3ffffff;\n }\n\n if (carry !== 0) {\n num._alloc(num.length + 1);\n num.words[num.length++] = carry;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1) {\n // Exponent: 2^247 - 1\n // Bits: 247x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x48 = red.sqrnmul(x24, 24, x24);\n const x96 = red.sqrnmul(x48, 48, x48);\n const x192 = red.sqrnmul(x96, 96, x96);\n const x240 = red.sqrnmul(x192, 48, x48);\n const x246 = red.sqrnmul(x240, 6, x6);\n const x247 = red.sqrnmul(x246, 1, x1);\n\n return x247;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 247x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 247x1 1x0 1x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n const r3 = red.sqrn(r2, 1);\n const r4 = red.sqrnmul(r3, 1, x1);\n\n return r4;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 248x1 1x0\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrnmul(r0, 1, x1);\n const r2 = red.sqrn(r1, 1);\n\n return r2;\n }\n}\n\n/**\n * P25519\n */\n\nclass P25519 extends Prime58 {\n constructor() {\n // 2^255 - 19 (= 5 mod 8)\n super('p25519', '7fffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffed',\n '2b832480 4fc1df0b 2b4d0099 3dfbd7a7'\n + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0');\n }\n\n imulK(num) {\n // K = 0x13\n let carry = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i] * 0x13 + carry;\n\n carry = w >>> 26;\n\n num.words[i] = w & 0x3ffffff;\n }\n\n if (carry !== 0) {\n num._alloc(num.length + 1);\n num.words[num.length++] = carry;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1, x2) {\n // Exponent: 2^250 - 1\n // Bits: 250x1\n const {red} = x1;\n const x4 = red.sqrnmul(x2, 2, x2);\n const x5 = red.sqrnmul(x4, 1, x1);\n const x10 = red.sqrnmul(x5, 5, x5);\n const x20 = red.sqrnmul(x10, 10, x10);\n const x40 = red.sqrnmul(x20, 20, x20);\n const x50 = red.sqrnmul(x40, 10, x10);\n const x100 = red.sqrnmul(x50, 50, x50);\n const x200 = red.sqrnmul(x100, 100, x100);\n const x250 = red.sqrnmul(x200, 50, x50);\n\n return x250;\n }\n\n pm5d8(x1) {\n // Exponent: (p - 5) / 8\n // Bits: 250x1 1x0 1x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 250x1 1x0 1x1 1x0 2x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n const r3 = red.sqrn(r2, 1);\n const r4 = red.sqrnmul(r3, 2, x2);\n\n return r4;\n }\n\n pp3d8(x1) {\n // Exponent: (p + 3) / 8\n // Bits: 251x1 1x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrnmul(r0, 1, x1);\n const r2 = red.sqrn(r1, 1);\n\n return r2;\n }\n}\n\n/**\n * P448\n */\n\nclass P448 extends Prime34 {\n constructor() {\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n super('p448', 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff fffffffe ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff');\n }\n\n imulK(num) {\n // K = 0x100000000000000000000000000000000000000000000000000000001\n // K = 2^224 + 1\n const one = this.one.inject(num);\n return num.iushln(224)._iadd(num, one);\n }\n\n core(x1, x2) {\n // Exponent: 2^222 - 1\n // Bits: 222x1\n const {red} = x1;\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x9 = red.sqrnmul(x6, 3, x3);\n const x11 = red.sqrnmul(x9, 2, x2);\n const x22 = red.sqrnmul(x11, 11, x11);\n const x44 = red.sqrnmul(x22, 22, x22);\n const x88 = red.sqrnmul(x44, 44, x44);\n const x176 = red.sqrnmul(x88, 88, x88);\n const x220 = red.sqrnmul(x176, 44, x44);\n const x222 = red.sqrnmul(x220, 2, x2);\n\n return x222;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 223x1 1x0 222x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x222 = this.core(x1, x2);\n const r0 = red.sqrnmul(x222, 1, x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 222, x222);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 223x1 1x0 222x1 1x0 1x1\n const {red} = x1;\n const r0 = this.pm3d4(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 224x1 222x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrnmul(r0, 2, x2);\n const r2 = red.sqrn(r1, 222);\n\n return r2;\n }\n}\n\n/**\n * Reduction Engine\n */\n\nclass Red {\n constructor(m) {\n let prime = null;\n\n if (typeof m === 'string') {\n prime = BN._prime(m);\n m = prime.p;\n }\n\n enforce(BN.isBN(m), 'm', 'bignum');\n nonred(!m.red, 'reduction');\n range(m.sign() > 0, 'reduction');\n\n this.m = m;\n this.prime = prime;\n this.mb = null;\n this.sm1 = null;\n }\n\n _verify1(a) {\n range(a.negative === 0, 'red');\n red(a.red != null, 'red');\n }\n\n _verify2(a, b) {\n range((a.negative | b.negative) === 0, 'red');\n red(a.red != null && a.red === b.red, 'red');\n }\n\n get mont() {\n return false;\n }\n\n precompute() {\n // Precompute `sqrt(-1)` for primes congruent to 5 mod 8.\n if (this.sm1 === null && this.m.andln(7) === 5) {\n if (this.prime) {\n this.sm1 = this.prime.sm1.clone()._forceRed(this);\n } else {\n const x = new BN(2).toRed(this);\n const e = this.m.subn(1).iushrn(2);\n\n // sqrt(-1) = 2^((p - 1) / 4) mod p\n this.sm1 = this.pow(x, e);\n }\n }\n\n return this;\n }\n\n convertTo(num) {\n const res = num.mod(this.m);\n res.red = this;\n return res;\n }\n\n convertFrom(num) {\n const res = num.clone();\n res.red = null;\n return res;\n }\n\n intTo(a) {\n return a;\n }\n\n intFrom(a) {\n return a;\n }\n\n imod(a) {\n if (this.prime)\n return this.prime.ireduce(a)._forceRed(this);\n\n return a.imod(this.m)._forceRed(this);\n }\n\n iadd(a, b) {\n this._verify2(a, b);\n\n a._iadd(a, b);\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n return a;\n }\n\n add(a, b) {\n if (a.length < b.length)\n return this.iadd(b.clone(), a);\n\n return this.iadd(a.clone(), b);\n }\n\n iaddn(a, num) {\n this._verify1(a);\n\n if (num < 0)\n return this.isubn(a, -num);\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n a._iaddn(num);\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n return a;\n }\n\n addn(a, num) {\n return this.iaddn(a.clone(), num);\n }\n\n isub(a, b) {\n this._verify2(a, b);\n\n // 0: a - a mod m == 0\n // -1: a - b mod m == m - (b - a)\n // +1: a - b mod m == a - b\n const cmp = a.ucmp(b);\n\n if (cmp === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n if (cmp < 0) {\n a._isub(b, a);\n a._isub(this.m, a);\n } else {\n a._isub(a, b);\n }\n\n return a;\n }\n\n sub(a, b) {\n return this.isub(a.clone(), b);\n }\n\n isubn(a, num) {\n this._verify1(a);\n\n if (num < 0)\n return this.iaddn(a, -num);\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n // <: a - b mod m == m - (b - a)\n // >=: a - b mod m == a - b\n if (a.length === 1 && a.words[0] < num) {\n a.words[0] = num - a.words[0];\n a._isub(this.m, a);\n } else {\n a._isubn(num);\n }\n\n return a;\n }\n\n subn(a, num) {\n return this.isubn(a.clone(), num);\n }\n\n imul(a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n }\n\n mul(a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n }\n\n imuln(a, num) {\n this._verify1(a);\n\n if (a.isZero())\n return a;\n\n if (num === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n const neg = num < 0;\n\n if (neg)\n num = -num;\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n a.imuln(num);\n\n if (num <= 16) {\n // Quick reduction.\n while (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n } else {\n this.imod(a);\n }\n\n if (neg)\n this.ineg(a);\n\n return a;\n }\n\n muln(a, num) {\n return this.imuln(a.clone(), num);\n }\n\n idiv(a, b) {\n return this.div(a, b)._move(a);\n }\n\n div(a, b) {\n return this.mul(a, this.invert(b));\n }\n\n idivn(a, num) {\n return this.divn(a, num)._move(a);\n }\n\n divn(a, num) {\n return this.div(a, this.convertTo(new BN(num)));\n }\n\n ipow(a, num) {\n return this.pow(a, num)._move(a);\n }\n\n pow(a, num) {\n this._verify1(a);\n\n if (num.isNeg())\n a = this.invert(a);\n\n // Small exponent.\n if (num.length === 1)\n return this.pown(a, num.words[0]);\n\n // Call out to BigInt.\n if (HAS_BIGINT && !this.prime)\n return this.powInt(a, num);\n\n // Otherwise, a BN implementation.\n return this.powNum(a, num);\n }\n\n powNum(a, num) {\n // Sliding window (odd multiples only).\n const one = new BN(1).toRed(this);\n const wnd = new Array(WND_SIZE);\n const a2 = this.sqr(a);\n\n wnd[0] = a;\n\n for (let i = 1; i < WND_SIZE; i++)\n wnd[i] = this.mul(wnd[i - 1], a2);\n\n let i = num.bitLength();\n let r = one;\n\n while (i >= WND_WIDTH) {\n let width = WND_WIDTH;\n let bits = num.bits(i - width, width);\n\n if (bits < WND_SIZE) {\n r = this.sqr(r);\n i -= 1;\n continue;\n }\n\n while ((bits & 1) === 0) {\n width -= 1;\n bits >>= 1;\n }\n\n if (r === one) {\n r = wnd[bits >> 1].clone();\n } else {\n r = this.sqrn(r, width);\n r = this.mul(r, wnd[bits >> 1]);\n }\n\n i -= width;\n }\n\n if (i > 0) {\n const bits = num.bits(0, i);\n\n while (i--) {\n r = this.sqr(r);\n\n if ((bits >> i) & 1)\n r = this.mul(r, a);\n }\n }\n\n return r;\n }\n\n powInt(a, num) {\n if (this.mb === null)\n this.mb = this.m.toBigInt();\n\n const x = this.intFrom(a.toBigInt());\n const y = powInt(x, num, this.mb);\n const z = this.intTo(y);\n\n return BN.fromBigInt(z)._forceRed(this);\n }\n\n sqrn(a, n) {\n while (n--)\n a = this.sqr(a);\n\n return a;\n }\n\n sqrnmul(a, n, b) {\n return this.mul(this.sqrn(a, n), b);\n }\n\n ipown(a, num) {\n return this.pown(a, num)._move(a);\n }\n\n pown(a, num) {\n this._verify1(a);\n\n if (num < 0) {\n a = this.invert(a);\n num = -num;\n }\n\n if (num === 0)\n return new BN(1).toRed(this);\n\n if (num === 1)\n return a.clone();\n\n const bits = countBits(num);\n\n let r = a;\n\n for (let i = bits - 2; i >= 0; i--) {\n r = this.sqr(r);\n\n if ((num >> i) & 1)\n r = this.mul(r, a);\n }\n\n return r;\n }\n\n isqr(a) {\n return this.imul(a, a);\n }\n\n sqr(a) {\n return this.mul(a, a);\n }\n\n isqrt(x) {\n return this.sqrt(x)._move(x);\n }\n\n sqrt(x) {\n this._verify1(x);\n\n // Optimized square root chain.\n if (this.prime)\n return this.prime.sqrt(x);\n\n // Fast case (p = 3 mod 4).\n if (this.m.andln(3) === 3)\n return this.sqrt3mod4(x);\n\n // Fast case (p = 5 mod 8).\n if (this.m.andln(7) === 5) {\n if (this.sm1 != null)\n return this.sqrt5mod8sm1(x);\n return this.sqrt5mod8(x);\n }\n\n // Slow case (Tonelli-Shanks).\n return this.sqrt0(x);\n }\n\n sqrt3mod4(x) {\n const e = this.m.addn(1).iushrn(2); // (p + 1) / 4\n const b = this.pow(x, e);\n\n if (!this.sqr(b).eq(x))\n throw new SquareRootError(b);\n\n return b;\n }\n\n sqrt5mod8(x) {\n // Atkin's Algorithm.\n const one = new BN(1).toRed(this);\n const e = this.m.ushrn(3); // (p - 5) / 8\n const x2 = this.add(x, x);\n const alpha = this.pow(x2, e);\n const beta = this.mul(x2, this.sqr(alpha));\n const b = this.mul(this.mul(alpha, x), this.isub(beta, one));\n\n if (!this.sqr(b).eq(x))\n throw new SquareRootError(b);\n\n return b;\n }\n\n sqrt5mod8sm1(x) {\n const e = this.m.addn(3).iushrn(3); // (p + 3) / 8\n const b = this.pow(x, e);\n\n if (this.sqr(b).eq(x))\n return b;\n\n const c = this.mul(b, this.sm1);\n\n if (this.sqr(c).eq(x))\n return c;\n\n throw new SquareRootError(b);\n }\n\n sqrt0(x) {\n if (this.m.cmpn(1) === 0 || !this.m.isOdd())\n throw new Error('Invalid prime.');\n\n switch (this.jacobi(x)) {\n case -1:\n throw new SquareRootError(x);\n case 0:\n return x.clone();\n case 1:\n break;\n }\n\n const one = new BN(1).toRed(this);\n const s = this.m.subn(1);\n const e = s._makeOdd();\n const n = new BN(2).toRed(this);\n\n while (this.jacobi(n) !== -1)\n this.iadd(n, one);\n\n let g = this.pow(n, s);\n let b = this.pow(x, s);\n let y = this.pow(x, s.iaddn(1).iushrn(1));\n let k = e;\n\n for (;;) {\n let t = b;\n let m = 0;\n\n while (!t.eq(one) && m < k) {\n t = this.sqr(t);\n m += 1;\n }\n\n if (m === 0)\n break;\n\n assert(m < k);\n\n t = this.sqrn(g, k - m - 1);\n g = this.sqr(t);\n y = this.mul(y, t);\n b = this.mul(b, g);\n k = m;\n }\n\n return y;\n }\n\n idivsqrt(u, v) {\n return this.divsqrt(u, v)._move(u);\n }\n\n divsqrt(u, v) {\n this._verify2(u, v);\n\n // u = 0, v = 0\n if (u.isZero() && v.isZero())\n throw new SquareRootError(v);\n\n // Optimized inverse square root chain.\n if (this.prime)\n return this.prime.divsqrt(u, v);\n\n // p = 3 mod 4\n if (this.m.andln(3) === 3)\n return this.divsqrt3mod4(u, v);\n\n // p = 5 mod 8\n if (this.sm1 != null && this.m.andln(7) === 5)\n return this.divsqrt5mod8(u, v);\n\n // v = 0\n if (v.isZero())\n throw new SquareRootError(v);\n\n return this.sqrt(this.div(u, v));\n }\n\n divsqrt3mod4(u, v) {\n // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p\n const e = this.m.subn(3).iushrn(2);\n const u2 = this.sqr(u);\n const u3 = this.mul(u2, u);\n const u5 = this.mul(u3, u2);\n const v3 = this.mul(this.sqr(v), v);\n const p = this.pow(this.mul(u5, v3), e);\n const x = this.mul(this.mul(u3, v), p);\n const c = this.mul(v, this.sqr(x));\n\n if (c.eq(u))\n return x;\n\n throw new SquareRootError(x);\n }\n\n divsqrt5mod8(u, v) {\n // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p\n const e = this.m.subn(5).iushrn(3);\n const v3 = this.mul(this.sqr(v), v);\n const v7 = this.mul(this.sqr(v3), v);\n const p = this.pow(this.mul(u, v7), e);\n const x = this.mul(this.mul(u, v3), p);\n const c = this.mul(v, this.sqr(x));\n\n if (c.eq(u))\n return x;\n\n const mc = this.ineg(c);\n\n if (mc.eq(u))\n return this.mul(x, this.sm1);\n\n if (mc.eq(this.mul(u, this.sm1)))\n throw new SquareRootError(this.mul(x, this.sm1));\n\n throw new SquareRootError(x);\n }\n\n isSquare(a) {\n if (this.m.isOdd())\n return this.jacobi(a) >= 0;\n\n return this.kronecker(a) >= 0;\n }\n\n ishl(a, num) {\n this._verify1(a);\n return this.imod(a.iushl(num));\n }\n\n shl(a, num) {\n return this.ishl(a.clone(), num);\n }\n\n ishln(a, num) {\n this._verify1(a);\n\n a.iushln(num);\n\n if (num <= 4) {\n // Quick reduction.\n while (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n } else {\n this.imod(a);\n }\n\n return a;\n }\n\n shln(a, num) {\n return this.ishln(a.clone(), num);\n }\n\n ineg(a) {\n this._verify1(a);\n\n if (!a.isZero())\n a._isub(this.m, a);\n\n return a;\n }\n\n neg(a) {\n return this.ineg(a.clone());\n }\n\n eq(a, b) {\n this._verify2(a, b);\n return a.ucmp(b) === 0;\n }\n\n eqn(a, num) {\n this._verify1(a);\n\n if (this.m.length === 1) {\n num %= this.m.words[0];\n\n if (num < 0)\n num += this.m.words[0];\n\n return a.ucmpn(num) === 0;\n }\n\n if (num < 0) {\n this.m._isubn(-num);\n\n const cmp = a.ucmp(this.m);\n\n this.m._iaddn(-num);\n\n return cmp === 0;\n }\n\n return a.ucmpn(num) === 0;\n }\n\n isHigh(a) {\n return !this.isLow(a);\n }\n\n isLow(a) {\n this._verify1(a);\n return a.ucmp(this.m.ushrn(1)) <= 0;\n }\n\n isOdd(a) {\n this._verify1(a);\n return a.isOdd();\n }\n\n isEven(a) {\n this._verify1(a);\n return a.isEven();\n }\n\n legendre(num) {\n this._verify1(num);\n\n if (this.m.isEven())\n throw new Error('legendre: `num` must be odd.');\n\n // Euler's criterion.\n const e = this.m.subn(1).iushrn(1); // (p - 1) / 2\n const symbol = this.pow(num, e);\n\n if (symbol.isZero())\n return 0;\n\n const one = new BN(1).toRed(this);\n\n if (symbol.eq(one))\n return 1;\n\n if (symbol.eq(this.ineg(one)))\n return -1;\n\n throw new Error('Invalid prime.');\n }\n\n jacobi(a) {\n this._verify1(a);\n return a.jacobi(this.m);\n }\n\n kronecker(a) {\n this._verify1(a);\n return a.kronecker(this.m);\n }\n\n iinvert(a) {\n return this.invert(a)._move(a);\n }\n\n invert(a) {\n this._verify1(a);\n return a.invert(this.m)._forceRed(this);\n }\n\n ifermat(a) {\n return this.fermat(a)._move(a);\n }\n\n fermat(a) {\n this._verify1(a);\n\n if (a.isZero() || this.m.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n // Optimized inversion chain.\n if (this.prime)\n return this.prime.fermat(a);\n\n // Invert using fermat's little theorem.\n return this.pow(a, this.m.subn(2));\n }\n\n invertAll(elems) {\n // Montgomery's trick.\n enforce(Array.isArray(elems), 'elems', 'array');\n\n for (const elem of elems) {\n enforce(BN.isBN(elem), 'elem', 'bignum');\n\n this._verify1(elem);\n }\n\n if (this.m.cmpn(1) === 0 || this.m.isEven())\n throw new RangeError('Not invertible.');\n\n const len = elems.length;\n const invs = new Array(len);\n\n if (len === 0)\n return invs;\n\n let acc = new BN(1).toRed(this);\n\n for (let i = 0; i < len; i++) {\n if (elems[i].isZero()) {\n invs[i] = elems[i].clone();\n continue;\n }\n\n invs[i] = acc;\n acc = this.mul(acc, elems[i]);\n }\n\n acc = this.invert(acc);\n\n for (let i = len - 1; i >= 0; i--) {\n if (elems[i].isZero())\n continue;\n\n invs[i] = this.mul(acc, invs[i]);\n acc = this.mul(acc, elems[i]);\n }\n\n return invs;\n }\n\n [custom]() {\n if (this.prime)\n return ``;\n\n return ``;\n }\n}\n\n/**\n * Barrett Engine\n */\n\nclass Barrett extends Red {\n constructor(m) {\n super(m);\n\n this.prime = null;\n this.n = this.m.bitLength();\n\n if ((this.n % 26) !== 0)\n this.n += 26 - (this.n % 26);\n\n this.k = this.n * 2;\n this.w = this.k / 26;\n this.b = BN.shift(1, this.k).div(this.m);\n }\n\n convertTo(num) {\n if (num.length > this.w)\n return super.convertTo(num);\n\n return this.imod(num.clone());\n }\n\n _shift(q) {\n let i = 0;\n let j = this.w;\n\n while (j < q.length)\n q.words[i++] = q.words[j++];\n\n if (i === 0)\n q.words[i++] = 0;\n\n q.length = i;\n }\n\n imod(a) {\n const neg = a.negative;\n\n assert(a.length <= this.w);\n\n a.negative = 0;\n\n const q = a.mul(this.b);\n\n // Shift right by `k` bits.\n this._shift(q);\n\n a._isub(a, q.mul(this.m));\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n if (neg && !a.isZero())\n a._isub(this.m, a);\n\n a.red = this;\n\n return a;\n }\n}\n\n/**\n * Montgomery Engine\n */\n\nclass Mont extends Red {\n constructor(m) {\n super(m);\n\n // Note that:\n //\n // mi = (-m^-1 mod (2^(n * 2))) mod r\n //\n // and:\n //\n // mi = (((2^n)^-1 mod m) * r^-1 - 1) / m\n //\n // are equivalent.\n this.prime = null;\n this.n = this.m.length * 26;\n this.r = BN.shift(1, this.n);\n this.r2 = BN.shift(1, this.n * 2).imod(this.m);\n this.ri = this.r.invert(this.m);\n this.mi = this.r.mul(this.ri).isubn(1).div(this.m);\n this.rib = null;\n }\n\n get mont() {\n return true;\n }\n\n convertTo(num) {\n if (num.isNeg() || num.ucmp(this.m) >= 0)\n return this.imod(num.ushln(this.n));\n\n // Equivalent to: (num * 2^n) mod m\n return this.mul(num, this.r2);\n }\n\n convertFrom(num) {\n // Equivalent to: num * r^-1 mod m\n const r = this.mul(num, new BN(1));\n r.red = null;\n return r;\n }\n\n intTo(a) {\n return (a << BigInt(this.n)) % this.mb;\n }\n\n intFrom(a) {\n if (this.rib === null)\n this.rib = this.ri.toBigInt();\n\n return (a * this.rib) % this.mb;\n }\n\n iaddn(a, num) {\n return this.iadd(a, this.convertTo(new BN(num)));\n }\n\n isubn(a, num) {\n return this.isub(a, this.convertTo(new BN(num)));\n }\n\n imul(a, b) {\n return this.mul(a, b)._move(a);\n }\n\n mul(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n\n const t = a.mul(b);\n const c = t.umaskn(this.n).mul(this.mi).iumaskn(this.n);\n const u = t.iadd(c.mul(this.m)).iushrn(this.n);\n\n if (u.ucmp(this.m) >= 0)\n u._isub(u, this.m);\n\n return u._forceRed(this);\n }\n\n imuln(a, num) {\n this._verify1(a);\n\n if (a.isZero())\n return a;\n\n if (num === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n const neg = num < 0;\n\n if (neg)\n num = -num;\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n const bits = countBits(num);\n\n // Potentially compute with additions.\n // This avoids an expensive division.\n if (bits > 5) {\n // Slow case (num > 31).\n this.imul(a, this.convertTo(new BN(num)));\n } else if ((num & (num - 1)) === 0) {\n // Optimize for powers of two.\n for (let i = 0; i < bits - 1; i++)\n this.iadd(a, a);\n } else {\n // Multiply left to right.\n const c = a.clone();\n\n for (let i = bits - 2; i >= 0; i--) {\n this.iadd(a, a);\n\n if ((num >> i) & 1)\n this.iadd(a, c);\n }\n }\n\n if (neg)\n this.ineg(a);\n\n return a;\n }\n\n eqn(a, num) {\n this._verify1(a);\n\n if (num === 0)\n return a.isZero();\n\n return a.ucmp(this.convertTo(new BN(num))) === 0;\n }\n\n isLow(a) {\n this._verify1(a);\n return this.convertFrom(a).ucmp(this.m.ushrn(1)) <= 0;\n }\n\n isOdd(a) {\n this._verify1(a);\n return this.convertFrom(a).isOdd();\n }\n\n isEven(a) {\n this._verify1(a);\n return this.convertFrom(a).isEven();\n }\n\n invert(a) {\n this._verify1(a);\n\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n return this.imod(a.invert(this.m).mul(this.r2));\n }\n}\n\n/*\n * Helpers\n */\n\nfunction makeError(Error, msg, start) {\n const err = new Error(msg);\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, start);\n\n return err;\n}\n\nfunction assert(value, message) {\n if (!value) {\n const msg = message || 'Assertion failed.';\n throw makeError(Error, msg, assert);\n }\n}\n\nfunction enforce(value, name, type) {\n if (!value) {\n const msg = `\"${name}\" must be a(n) ${type}.`;\n throw makeError(TypeError, msg, enforce);\n }\n}\n\nfunction range(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with positive numbers.`;\n throw makeError(RangeError, msg, range);\n }\n}\n\nfunction red(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with red numbers.`;\n throw makeError(TypeError, msg, red);\n }\n}\n\nfunction nonred(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with normal numbers.`;\n throw makeError(TypeError, msg, nonred);\n }\n}\n\nfunction nonzero(value) {\n if (!value) {\n const msg = 'Cannot divide by zero.';\n throw makeError(RangeError, msg, nonzero);\n }\n}\n\nclass SquareRootError extends Error {\n constructor(result) {\n super();\n\n this.name = 'SquareRootError';\n this.message = 'X is not a square mod P.';\n this.result = result.fromRed();\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, SquareRootError);\n }\n}\n\nfunction isInteger(num) {\n return Number.isSafeInteger(num);\n}\n\nfunction isSMI(num) {\n return isInteger(num)\n && num >= -0x3ffffff\n && num <= 0x3ffffff;\n}\n\nfunction allocate(ArrayType, size) {\n if (ArrayType.allocUnsafeSlow)\n return ArrayType.allocUnsafeSlow(size);\n\n return new ArrayType(size);\n}\n\nfunction getBase(base) {\n if (base == null)\n return 10;\n\n if (typeof base === 'number')\n return base;\n\n switch (base) {\n case 'bin':\n return 2;\n case 'oct':\n return 8;\n case 'dec':\n return 10;\n case 'hex':\n return 16;\n }\n\n return 0;\n}\n\n/*\n * Internal\n */\n\nfunction countBits(w) {\n if (Math.clz32)\n return 32 - Math.clz32(w);\n\n let t = w;\n let r = 0;\n\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n\n return r + t;\n}\n\nfunction zeroBits(w) {\n // Shortcut.\n if (w === 0)\n return 26;\n\n let t = w;\n let r = 0;\n\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n\n if ((t & 0x1) === 0)\n r += 1;\n\n return r;\n}\n\nfunction parseHex(str, start, end) {\n const len = Math.min(str.length, end);\n\n let r = 0;\n let z = 0;\n\n for (let i = start; i < len; i++) {\n const c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n let b;\n\n if (c >= 49 && c <= 54) {\n // 'a' - 'f'\n b = c - 49 + 0xa;\n } else if (c >= 17 && c <= 22) {\n // 'A' - 'F'\n b = c - 17 + 0xa;\n } else {\n // '0' - '9'\n b = c;\n }\n\n r |= b;\n z |= b;\n }\n\n if (z & ~15)\n throw new Error('Invalid string.');\n\n return r;\n}\n\nfunction parseBase(str, start, end, mul) {\n const len = Math.min(str.length, end);\n\n let r = 0;\n\n for (let i = start; i < len; i++) {\n const c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n let b;\n\n if (c >= 49) {\n // 'a'\n b = c - 49 + 0xa;\n } else if (c >= 17) {\n // 'A'\n b = c - 17 + 0xa;\n } else {\n // '0' - '9'\n b = c;\n }\n\n if (c < 0 || c > 207 || b >= mul)\n throw new Error('Invalid string.');\n\n r += b;\n }\n\n return r;\n}\n\n/*\n * Exponentiation (bigint)\n */\n\nfunction powInt(x, e, m) {\n // Sliding window (odd multiples only).\n const one = BigInt(1);\n const wnd = new Array(WND_SIZE);\n const x2 = (x * x) % m;\n\n wnd[0] = x;\n\n for (let i = 1; i < WND_SIZE; i++)\n wnd[i] = (wnd[i - 1] * x2) % m;\n\n let i = e.bitLength();\n let r = one;\n\n while (i >= WND_WIDTH) {\n let width = WND_WIDTH;\n let bits = e.bits(i - width, width);\n\n if (bits < WND_SIZE) {\n r = (r * r) % m;\n i -= 1;\n continue;\n }\n\n while ((bits & 1) === 0) {\n width -= 1;\n bits >>= 1;\n }\n\n if (r === one) {\n r = wnd[bits >> 1];\n } else {\n r = sqrn(r, width, m);\n r = (r * wnd[bits >> 1]) % m;\n }\n\n i -= width;\n }\n\n if (i > 0) {\n const bits = e.bits(0, i);\n\n while (i--) {\n r = (r * r) % m;\n\n if ((bits >> i) & 1)\n r = (r * x) % m;\n }\n }\n\n return r;\n}\n\nfunction sqrn(x, n, m) {\n for (let i = 0; i < n; i++)\n x = (x * x) % m;\n return x;\n}\n\n/*\n * Multiplication\n */\n\nfunction smallMulTo(self, num, out) {\n const len = self.length + num.length;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(len);\n out.length = len;\n\n // Peel one iteration (compiler can't\n // do it, because of code complexity).\n const a = self.words[0];\n const b = num.words[0];\n const r = a * b;\n const lo = r & 0x3ffffff;\n\n let carry = (r / 0x4000000) | 0;\n let k = 1;\n\n out.words[0] = lo;\n\n for (; k < out.length - 1; k++) {\n // Sum all words with the same\n // `i + j = k` and accumulate\n // `ncarry`, note that ncarry\n // could be >= 0x3ffffff.\n let ncarry = carry >>> 26;\n let rword = carry & 0x3ffffff;\n\n const min = Math.max(0, k - self.length + 1);\n const max = Math.min(k, num.length - 1);\n\n for (let j = min; j <= max; j++) {\n const i = k - j;\n const a = self.words[i];\n const b = num.words[j];\n const r = a * b + rword;\n\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n\n if (carry !== 0)\n out.words[k] = carry | 0;\n else\n out.length -= 1;\n\n return out._strip();\n}\n\nfunction bigMulTo(self, num, out) {\n const len = self.length + num.length;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(len);\n out.length = len;\n\n let carry = 0;\n let hncarry = 0;\n let k = 0;\n\n for (; k < out.length - 1; k++) {\n // Sum all words with the same\n // `i + j = k` and accumulate\n // `ncarry`, note that ncarry\n // could be >= 0x3ffffff.\n let ncarry = hncarry;\n\n hncarry = 0;\n\n let rword = carry & 0x3ffffff;\n\n const min = Math.max(0, k - self.length + 1);\n const max = Math.min(k, num.length - 1);\n\n for (let j = min; j <= max; j++) {\n const i = k - j;\n const a = self.words[i];\n const b = num.words[j];\n const r = a * b;\n\n let lo = r & 0x3ffffff;\n\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n\n if (carry !== 0)\n out.words[k] = carry;\n else\n out.length -= 1;\n\n return out._strip();\n}\n\nfunction jumboMulTo(x, y, out) {\n // v8 has a 2147483519 bit max (~256mb).\n if (!HAS_BIGINT || x.length + y.length > 82595519)\n return bigMulTo(x, y, out);\n\n const zero = BigInt(0);\n const mask = BigInt(0x3ffffff);\n const shift = BigInt(26);\n\n let z = x.toBigInt() * y.toBigInt();\n\n const neg = (z < zero) | 0;\n\n if (neg)\n z = -z;\n\n let i = 0;\n\n while (z > zero) {\n out.words[i++] = Number(z & mask);\n z >>= shift;\n }\n\n if (i === 0)\n out.words[i++] = 0;\n\n out.length = i;\n out.negative = neg;\n\n return out;\n}\n\nfunction comb10MulTo(self, num, out) {\n const a = self.words;\n const b = num.words;\n const o = out.words;\n const a0 = a[0] | 0;\n const al0 = a0 & 0x1fff;\n const ah0 = a0 >>> 13;\n const a1 = a[1] | 0;\n const al1 = a1 & 0x1fff;\n const ah1 = a1 >>> 13;\n const a2 = a[2] | 0;\n const al2 = a2 & 0x1fff;\n const ah2 = a2 >>> 13;\n const a3 = a[3] | 0;\n const al3 = a3 & 0x1fff;\n const ah3 = a3 >>> 13;\n const a4 = a[4] | 0;\n const al4 = a4 & 0x1fff;\n const ah4 = a4 >>> 13;\n const a5 = a[5] | 0;\n const al5 = a5 & 0x1fff;\n const ah5 = a5 >>> 13;\n const a6 = a[6] | 0;\n const al6 = a6 & 0x1fff;\n const ah6 = a6 >>> 13;\n const a7 = a[7] | 0;\n const al7 = a7 & 0x1fff;\n const ah7 = a7 >>> 13;\n const a8 = a[8] | 0;\n const al8 = a8 & 0x1fff;\n const ah8 = a8 >>> 13;\n const a9 = a[9] | 0;\n const al9 = a9 & 0x1fff;\n const ah9 = a9 >>> 13;\n const b0 = b[0] | 0;\n const bl0 = b0 & 0x1fff;\n const bh0 = b0 >>> 13;\n const b1 = b[1] | 0;\n const bl1 = b1 & 0x1fff;\n const bh1 = b1 >>> 13;\n const b2 = b[2] | 0;\n const bl2 = b2 & 0x1fff;\n const bh2 = b2 >>> 13;\n const b3 = b[3] | 0;\n const bl3 = b3 & 0x1fff;\n const bh3 = b3 >>> 13;\n const b4 = b[4] | 0;\n const bl4 = b4 & 0x1fff;\n const bh4 = b4 >>> 13;\n const b5 = b[5] | 0;\n const bl5 = b5 & 0x1fff;\n const bh5 = b5 >>> 13;\n const b6 = b[6] | 0;\n const bl6 = b6 & 0x1fff;\n const bh6 = b6 >>> 13;\n const b7 = b[7] | 0;\n const bl7 = b7 & 0x1fff;\n const bh7 = b7 >>> 13;\n const b8 = b[8] | 0;\n const bl8 = b8 & 0x1fff;\n const bh8 = b8 >>> 13;\n const b9 = b[9] | 0;\n const bl9 = b9 & 0x1fff;\n const bh9 = b9 >>> 13;\n\n let c = 0;\n let lo, mid, hi;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(20);\n out.length = 19;\n\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n\n let w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n\n let w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n\n let w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n\n let w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n\n let w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n\n let w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n\n let w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n\n let w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n\n let w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n\n let w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n\n let w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n\n let w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n\n let w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n\n let w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n\n let w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n\n let w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n\n let w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n\n let w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n\n let w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n\n if (c !== 0) {\n o[19] = c;\n out.length += 1;\n }\n\n // Note: we shouldn't need to strip here.\n return out;\n}\n\n// Polyfill comb.\nif (!Math.imul)\n comb10MulTo = smallMulTo;\n\n/*\n * Expose\n */\n\nBN.Red = Red;\n\nmodule.exports = BN;\n","/*!\n * bn.js - big numbers for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/bn');\n","/*!\n * chacha20.js - chacha20 for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources\n * https://en.wikipedia.org/wiki/Chacha20\n * https://tools.ietf.org/html/rfc7539#section-2\n * https://cr.yp.to/chacha.html\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/*\n * Constants\n */\n\nconst BIG_ENDIAN = new Int8Array(new Int16Array([1]).buffer)[0] === 0;\n\n/**\n * ChaCha20\n */\n\nclass ChaCha20 {\n /**\n * Create a ChaCha20 context.\n * @constructor\n */\n\n constructor() {\n this.state = new Uint32Array(16);\n this.stream = new Uint32Array(16);\n this.bytes = new Uint8Array(this.stream.buffer);\n this.pos = -1;\n\n if (BIG_ENDIAN)\n this.bytes = Buffer.alloc(64);\n }\n\n /**\n * Initialize chacha20 with a key, nonce, and counter.\n * @param {Buffer} key\n * @param {Buffer} nonce\n * @param {Number} counter\n */\n\n init(key, nonce, counter) {\n if (counter == null)\n counter = 0;\n\n assert(Buffer.isBuffer(key));\n assert(Buffer.isBuffer(nonce));\n assert(Number.isSafeInteger(counter));\n\n if (key.length !== 16 && key.length !== 32)\n throw new RangeError('Invalid key size.');\n\n if (nonce.length >= 24) {\n key = ChaCha20.derive(key, nonce.slice(0, 16));\n nonce = nonce.slice(16);\n }\n\n this.state[0] = 0x61707865;\n this.state[1] = key.length < 32 ? 0x3120646e : 0x3320646e;\n this.state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32;\n this.state[3] = 0x6b206574;\n this.state[4] = readU32(key, 0);\n this.state[5] = readU32(key, 4);\n this.state[6] = readU32(key, 8);\n this.state[7] = readU32(key, 12);\n this.state[8] = readU32(key, 16 % key.length);\n this.state[9] = readU32(key, 20 % key.length);\n this.state[10] = readU32(key, 24 % key.length);\n this.state[11] = readU32(key, 28 % key.length);\n this.state[12] = counter >>> 0;\n\n if (nonce.length === 8) {\n this.state[13] = (counter / 0x100000000) >>> 0;\n this.state[14] = readU32(nonce, 0);\n this.state[15] = readU32(nonce, 4);\n } else if (nonce.length === 12) {\n this.state[13] = readU32(nonce, 0);\n this.state[14] = readU32(nonce, 4);\n this.state[15] = readU32(nonce, 8);\n } else if (nonce.length === 16) {\n this.state[12] = readU32(nonce, 0);\n this.state[13] = readU32(nonce, 4);\n this.state[14] = readU32(nonce, 8);\n this.state[15] = readU32(nonce, 12);\n } else {\n throw new RangeError('Invalid nonce size.');\n }\n\n this.pos = 0;\n\n return this;\n }\n\n /**\n * Encrypt/decrypt data.\n * @param {Buffer} data - Will be mutated.\n * @returns {Buffer}\n */\n\n encrypt(data) {\n assert(Buffer.isBuffer(data));\n\n if (this.pos === -1)\n throw new Error('Context is not initialized.');\n\n for (let i = 0; i < data.length; i++) {\n if ((this.pos & 63) === 0) {\n this._block();\n this.pos = 0;\n }\n\n data[i] ^= this.bytes[this.pos++];\n }\n\n return data;\n }\n\n /**\n * Stir the stream.\n */\n\n _block() {\n for (let i = 0; i < 16; i++)\n this.stream[i] = this.state[i];\n\n for (let i = 0; i < 10; i++) {\n qround(this.stream, 0, 4, 8, 12);\n qround(this.stream, 1, 5, 9, 13);\n qround(this.stream, 2, 6, 10, 14);\n qround(this.stream, 3, 7, 11, 15);\n qround(this.stream, 0, 5, 10, 15);\n qround(this.stream, 1, 6, 11, 12);\n qround(this.stream, 2, 7, 8, 13);\n qround(this.stream, 3, 4, 9, 14);\n }\n\n for (let i = 0; i < 16; i++)\n this.stream[i] += this.state[i];\n\n if (BIG_ENDIAN) {\n for (let i = 0; i < 16; i++)\n writeU32(this.bytes, this.stream[i], i * 4);\n }\n\n this.state[12] += 1;\n\n if (this.state[12] === 0)\n this.state[13] += 1;\n }\n\n /**\n * Destroy context.\n */\n\n destroy() {\n for (let i = 0; i < 16; i++) {\n this.state[i] = 0;\n this.stream[i] = 0;\n }\n\n if (BIG_ENDIAN) {\n for (let i = 0; i < 64; i++)\n this.bytes[i] = 0;\n }\n\n this.pos = -1;\n\n return this;\n }\n\n /**\n * Derive key with XChaCha20.\n * @param {Buffer} key\n * @param {Buffer} nonce\n * @returns {Buffer}\n */\n\n static derive(key, nonce) {\n assert(Buffer.isBuffer(key));\n assert(Buffer.isBuffer(nonce));\n\n if (key.length !== 16 && key.length !== 32)\n throw new RangeError('Invalid key size.');\n\n if (nonce.length !== 16)\n throw new RangeError('Invalid nonce size.');\n\n const state = new Uint32Array(16);\n\n state[0] = 0x61707865;\n state[1] = key.length < 32 ? 0x3120646e : 0x3320646e;\n state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32;\n state[3] = 0x6b206574;\n state[4] = readU32(key, 0);\n state[5] = readU32(key, 4);\n state[6] = readU32(key, 8);\n state[7] = readU32(key, 12);\n state[8] = readU32(key, 16 % key.length);\n state[9] = readU32(key, 20 % key.length);\n state[10] = readU32(key, 24 % key.length);\n state[11] = readU32(key, 28 % key.length);\n state[12] = readU32(nonce, 0);\n state[13] = readU32(nonce, 4);\n state[14] = readU32(nonce, 8);\n state[15] = readU32(nonce, 12);\n\n for (let i = 0; i < 10; i++) {\n qround(state, 0, 4, 8, 12);\n qround(state, 1, 5, 9, 13);\n qround(state, 2, 6, 10, 14);\n qround(state, 3, 7, 11, 15);\n qround(state, 0, 5, 10, 15);\n qround(state, 1, 6, 11, 12);\n qround(state, 2, 7, 8, 13);\n qround(state, 3, 4, 9, 14);\n }\n\n const out = Buffer.alloc(32);\n\n writeU32(out, state[0], 0);\n writeU32(out, state[1], 4);\n writeU32(out, state[2], 8);\n writeU32(out, state[3], 12);\n writeU32(out, state[12], 16);\n writeU32(out, state[13], 20);\n writeU32(out, state[14], 24);\n writeU32(out, state[15], 28);\n\n return out;\n }\n}\n\n/*\n * Static\n */\n\nChaCha20.native = 0;\n\n/*\n * Helpers\n */\n\nfunction qround(x, a, b, c, d) {\n x[a] += x[b];\n x[d] = rotl32(x[d] ^ x[a], 16);\n\n x[c] += x[d];\n x[b] = rotl32(x[b] ^ x[c], 12);\n\n x[a] += x[b];\n x[d] = rotl32(x[d] ^ x[a], 8);\n\n x[c] += x[d];\n x[b] = rotl32(x[b] ^ x[c], 7);\n}\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\n\nfunction readU32(data, off) {\n return (data[off++]\n + data[off++] * 0x100\n + data[off++] * 0x10000\n + data[off] * 0x1000000);\n}\n\nfunction writeU32(dst, num, off) {\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n return off;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = ChaCha20;\n","/*!\n * chacha20.js - chacha20 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/chacha20');\n","/*!\n * hmac.js - hmac for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/hash.js:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/hash.js\n *\n * Resources:\n * https://en.wikipedia.org/wiki/HMAC\n * https://tools.ietf.org/html/rfc2104\n * https://github.com/indutny/hash.js/blob/master/lib/hash/hmac.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/**\n * HMAC\n */\n\nclass HMAC {\n /**\n * Create an HMAC.\n * @param {Function} Hash\n * @param {Number} size\n * @param {Array} [x=[]]\n * @param {Array} [y=[]]\n */\n\n constructor(Hash, size, x = [], y = []) {\n assert(typeof Hash === 'function');\n assert((size >>> 0) === size);\n assert(Array.isArray(x));\n assert(Array.isArray(y));\n\n this.hash = Hash;\n this.size = size;\n this.x = x;\n this.y = y;\n\n this.inner = new Hash();\n this.outer = new Hash();\n }\n\n /**\n * Initialize HMAC context.\n * @param {Buffer} data\n */\n\n init(key) {\n assert(Buffer.isBuffer(key));\n\n // Shorten key\n if (key.length > this.size) {\n const Hash = this.hash;\n const h = new Hash();\n\n h.init(...this.x);\n h.update(key);\n\n key = h.final(...this.y);\n\n assert(key.length <= this.size);\n }\n\n // Pad key\n const pad = Buffer.alloc(this.size);\n\n for (let i = 0; i < key.length; i++)\n pad[i] = key[i] ^ 0x36;\n\n for (let i = key.length; i < pad.length; i++)\n pad[i] = 0x36;\n\n this.inner.init(...this.x);\n this.inner.update(pad);\n\n for (let i = 0; i < key.length; i++)\n pad[i] = key[i] ^ 0x5c;\n\n for (let i = key.length; i < pad.length; i++)\n pad[i] = 0x5c;\n\n this.outer.init(...this.x);\n this.outer.update(pad);\n\n return this;\n }\n\n /**\n * Update HMAC context.\n * @param {Buffer} data\n */\n\n update(data) {\n this.inner.update(data);\n return this;\n }\n\n /**\n * Finalize HMAC context.\n * @returns {Buffer}\n */\n\n final() {\n this.outer.update(this.inner.final(...this.y));\n return this.outer.final(...this.y);\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = HMAC;\n","/*!\n * sha256.js - SHA256 implementation for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/hash.js:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/hash.js\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-2\n * https://tools.ietf.org/html/rfc4634\n * https://github.com/indutny/hash.js/blob/master/lib/hash/sha/256.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst HMAC = require('../internal/hmac');\n\n/*\n * Constants\n */\n\nconst FINALIZED = -1;\nconst DESC = Buffer.alloc(8, 0x00);\nconst PADDING = Buffer.alloc(64, 0x00);\n\nPADDING[0] = 0x80;\n\nconst K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n/**\n * SHA256\n */\n\nclass SHA256 {\n constructor() {\n this.state = new Uint32Array(8);\n this.msg = new Uint32Array(64);\n this.block = Buffer.alloc(64);\n this.size = FINALIZED;\n }\n\n init() {\n this.state[0] = 0x6a09e667;\n this.state[1] = 0xbb67ae85;\n this.state[2] = 0x3c6ef372;\n this.state[3] = 0xa54ff53a;\n this.state[4] = 0x510e527f;\n this.state[5] = 0x9b05688c;\n this.state[6] = 0x1f83d9ab;\n this.state[7] = 0x5be0cd19;\n this.size = 0;\n return this;\n }\n\n update(data) {\n assert(Buffer.isBuffer(data));\n this._update(data, data.length);\n return this;\n }\n\n final() {\n return this._final(Buffer.alloc(32));\n }\n\n _update(data, len) {\n assert(this.size !== FINALIZED, 'Context is not initialized.');\n\n let pos = this.size & 63;\n let off = 0;\n\n this.size += len;\n\n if (pos > 0) {\n let want = 64 - pos;\n\n if (want > len)\n want = len;\n\n data.copy(this.block, pos, off, off + want);\n\n pos += want;\n len -= want;\n off += want;\n\n if (pos < 64)\n return;\n\n this._transform(this.block, 0);\n }\n\n while (len >= 64) {\n this._transform(data, off);\n off += 64;\n len -= 64;\n }\n\n if (len > 0)\n data.copy(this.block, 0, off, off + len);\n }\n\n _final(out) {\n assert(this.size !== FINALIZED, 'Context is not initialized.');\n\n const pos = this.size & 63;\n const len = this.size * 8;\n\n writeU32(DESC, (len * (1 / 0x100000000)) >>> 0, 0);\n writeU32(DESC, len >>> 0, 4);\n\n this._update(PADDING, 1 + ((119 - pos) & 63));\n this._update(DESC, 8);\n\n for (let i = 0; i < 8; i++) {\n writeU32(out, this.state[i], i * 4);\n this.state[i] = 0;\n }\n\n for (let i = 0; i < 64; i++)\n this.msg[i] = 0;\n\n for (let i = 0; i < 64; i++)\n this.block[i] = 0;\n\n this.size = FINALIZED;\n\n return out;\n }\n\n _transform(chunk, pos) {\n const W = this.msg;\n\n let a = this.state[0];\n let b = this.state[1];\n let c = this.state[2];\n let d = this.state[3];\n let e = this.state[4];\n let f = this.state[5];\n let g = this.state[6];\n let h = this.state[7];\n let i = 0;\n\n for (; i < 16; i++)\n W[i] = readU32(chunk, pos + i * 4);\n\n for (; i < 64; i++)\n W[i] = sigma1(W[i - 2]) + W[i - 7] + sigma0(W[i - 15]) + W[i - 16];\n\n for (i = 0; i < 64; i++) {\n const t1 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i];\n const t2 = Sigma0(a) + Maj(a, b, c);\n\n h = g;\n g = f;\n f = e;\n\n e = (d + t1) >>> 0;\n\n d = c;\n c = b;\n b = a;\n\n a = (t1 + t2) >>> 0;\n }\n\n this.state[0] += a;\n this.state[1] += b;\n this.state[2] += c;\n this.state[3] += d;\n this.state[4] += e;\n this.state[5] += f;\n this.state[6] += g;\n this.state[7] += h;\n }\n\n static hash() {\n return new SHA256();\n }\n\n static hmac() {\n return new HMAC(SHA256, 64);\n }\n\n static digest(data) {\n return SHA256.ctx.init().update(data).final();\n }\n\n static root(left, right) {\n assert(Buffer.isBuffer(left) && left.length === 32);\n assert(Buffer.isBuffer(right) && right.length === 32);\n return SHA256.ctx.init().update(left).update(right).final();\n }\n\n static multi(x, y, z) {\n const {ctx} = SHA256;\n\n ctx.init();\n ctx.update(x);\n ctx.update(y);\n\n if (z)\n ctx.update(z);\n\n return ctx.final();\n }\n\n static mac(data, key) {\n return SHA256.hmac().init(key).update(data).final();\n }\n}\n\n/*\n * Static\n */\n\nSHA256.native = 0;\nSHA256.id = 'SHA256';\nSHA256.size = 32;\nSHA256.bits = 256;\nSHA256.blockSize = 64;\nSHA256.zero = Buffer.alloc(32, 0x00);\nSHA256.ctx = new SHA256();\n\n/*\n * Helpers\n */\n\nfunction Sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n}\n\nfunction Sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n}\n\nfunction sigma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3);\n}\n\nfunction sigma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10);\n}\n\nfunction Ch(x, y, z) {\n return z ^ (x & (y ^ z));\n}\n\nfunction Maj(x, y, z) {\n return (x & y) | (z & (x | y));\n}\n\nfunction readU32(data, off) {\n return (data[off++] * 0x1000000\n + data[off++] * 0x10000\n + data[off++] * 0x100\n + data[off]);\n}\n\nfunction writeU32(data, num, off) {\n data[off++] = num >>> 24;\n data[off++] = num >>> 16;\n data[off++] = num >>> 8;\n data[off++] = num;\n return off;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = SHA256;\n","/*!\n * sha256.js - sha256 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/sha256');\n","/*!\n * batch-rng.js - batch rng for bcrypto\n * Copyright (c) 2019-2020, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on ElementsProject/secp256k1-zkp:\n * Copyright (c) 2013, Pieter Wuille.\n * https://github.com/ElementsProject/secp256k1-zkp\n *\n * Resources:\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/modules/schnorrsig/main_impl.h#L166\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/scalar_4x64_impl.h#L972\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/scalar_8x32_impl.h#L747\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst BN = require('../bn');\nconst ChaCha20 = require('../chacha20');\nconst SHA256 = require('../sha256');\n\n/**\n * BatchRNG\n */\n\nclass BatchRNG {\n constructor(curve, encode = key => key) {\n this.curve = curve;\n this.encode = encode;\n this.hash = new SHA256();\n this.chacha = new ChaCha20();\n this.key = Buffer.alloc(32, 0x00);\n this.iv = Buffer.alloc(8, 0x00);\n this.cache = [new BN(1), new BN(1)];\n }\n\n init(batch) {\n assert(Array.isArray(batch));\n\n this.hash.init();\n\n for (const [msg, sig, key] of batch) {\n this.hash.update(SHA256.digest(msg));\n this.hash.update(sig);\n this.hash.update(this.encode(key));\n }\n\n this.key = this.hash.final();\n this.cache[0] = new BN(1);\n this.cache[1] = new BN(1);\n\n return this;\n }\n\n encrypt(counter) {\n const size = this.curve.scalarSize * 2;\n const data = Buffer.alloc(size, 0x00);\n const left = data.slice(0, this.curve.scalarSize);\n const right = data.slice(this.curve.scalarSize);\n\n this.chacha.init(this.key, this.iv, counter);\n this.chacha.encrypt(data);\n\n return [\n this.curve.decodeScalar(left),\n this.curve.decodeScalar(right)\n ];\n }\n\n refresh(counter) {\n let overflow = 0;\n\n for (;;) {\n // First word is always zero.\n this.iv[4] = overflow;\n this.iv[5] = overflow >>> 8;\n this.iv[6] = overflow >>> 16;\n this.iv[7] = overflow >>> 24;\n\n overflow += 1;\n\n const [s1, s2] = this.encrypt(counter);\n\n if (s1.isZero() || s1.cmp(this.curve.n) >= 0)\n continue;\n\n if (s2.isZero() || s2.cmp(this.curve.n) >= 0)\n continue;\n\n this.cache[0] = s1;\n this.cache[1] = s2;\n\n break;\n }\n }\n\n generate(index) {\n assert((index >>> 0) === index);\n\n if (index & 1)\n this.refresh(index >>> 1);\n\n return this.cache[index & 1];\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = BatchRNG;\n","/*!\n * elliptic.js - elliptic curves for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/elliptic:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/elliptic\n *\n * Formulas from DJB and Tanja Lange [EFD].\n *\n * References:\n *\n * [GECC] Guide to Elliptic Curve Cryptography\n * D. Hankerson, A. Menezes, and S. Vanstone\n * https://tinyurl.com/guide-to-ecc\n *\n * [GLV] Faster Point Multiplication on Elliptic Curves\n * R. Gallant, R. Lambert, and S. Vanstone\n * https://link.springer.com/content/pdf/10.1007/3-540-44647-8_11.pdf\n *\n * [MONT1] Montgomery curves and the Montgomery ladder\n * Daniel J. Bernstein, Tanja Lange\n * https://eprint.iacr.org/2017/293.pdf\n *\n * [SQUARED] Elligator Squared\n * Mehdi Tibouchi\n * https://eprint.iacr.org/2014/043.pdf\n *\n * [SEC1] SEC 1 - Standards for Efficient Cryptography Group\n * Certicom Research\n * https://www.secg.org/sec1-v2.pdf\n *\n * [SEC2] SEC 2: Recommended Elliptic Curve Domain Parameters\n * Certicom Research\n * https://www.secg.org/sec2-v2.pdf\n *\n * [SIDE1] Elliptic Curves and Side-Channel Attacks\n * Marc Joye\n * https://pdfs.semanticscholar.org/8d69/9645033e25d74fcfd4cbf07a770d2e943e14.pdf\n *\n * [BLIND] Side-Channel Analysis on Blinding Regular Scalar Multiplications\n * B. Feix, M. Roussellet, A. Venelli\n * https://eprint.iacr.org/2014/191.pdf\n *\n * [ALT] Alternative Elliptic Curve Representations\n * R. Struik\n * https://tools.ietf.org/id/draft-ietf-lwig-curve-representations-02.html\n *\n * [ARITH1] Arithmetic of Elliptic Curves\n * Christophe Doche, Tanja Lange\n * Handbook of Elliptic and Hyperelliptic Curve Cryptography\n * Page 267, Section 13 (978-1-58488-518-4)\n * https://hyperelliptic.org/HEHCC/index.html\n *\n * [ARITH2] The Arithmetic of Elliptic Curves, 2nd Edition\n * Joseph H. Silverman\n * http://www.pdmi.ras.ru/~lowdimma/BSD/Silverman-Arithmetic_of_EC.pdf\n *\n * [EFD] Explicit-Formulas Database\n * Daniel J. Bernstein, Tanja Lange\n * https://hyperelliptic.org/EFD/index.html\n *\n * [SAFE] SafeCurves: choosing safe curves for elliptic-curve cryptography\n * Daniel J. Bernstein\n * https://safecurves.cr.yp.to/\n *\n * [4GLV] Refinement of the Four-Dimensional GLV Method on Elliptic Curves\n * Hairong Yi, Yuqing Zhu, and Dongdai Lin\n * http://www.site.uottawa.ca/~cadams/papers/prepro/paper_19_slides.pdf\n *\n * [SSWU1] Efficient Indifferentiable Hashing into Ordinary Elliptic Curves\n * E. Brier, J. Coron, T. Icart, D. Madore, H. Randriam, M. Tibouchi\n * https://eprint.iacr.org/2009/340.pdf\n *\n * [SSWU2] Rational points on certain hyperelliptic curves over finite fields\n * Maciej Ulas\n * https://arxiv.org/abs/0706.1448\n *\n * [H2EC] Hashing to Elliptic Curves\n * A. Faz-Hernandez, S. Scott, N. Sullivan, R. S. Wahby, C. A. Wood\n * https://git.io/JeWz6\n * https://github.com/cfrg/draft-irtf-cfrg-hash-to-curve\n *\n * [SVDW1] Construction of Rational Points on Elliptic Curves\n * A. Shallue, C. E. van de Woestijne\n * https://works.bepress.com/andrew_shallue/1/download/\n *\n * [SVDW2] Indifferentiable Hashing to Barreto-Naehrig Curves\n * Pierre-Alain Fouque, Mehdi Tibouchi\n * https://www.di.ens.fr/~fouque/pub/latincrypt12.pdf\n *\n * [SVDW3] Covert ECDH over secp256k1\n * Pieter Wuille\n * https://gist.github.com/sipa/29118d3fcfac69f9930d57433316c039\n *\n * [MONT2] Montgomery Curve (wikipedia)\n * https://en.wikipedia.org/wiki/Montgomery_curve\n *\n * [MONT3] Montgomery Curves and their arithmetic\n * C. Costello, B. Smith\n * https://eprint.iacr.org/2017/212.pdf\n *\n * [ELL2] Elliptic-curve points indistinguishable from uniform random strings\n * D. Bernstein, M. Hamburg, A. Krasnova, T. Lange\n * https://elligator.cr.yp.to/elligator-20130828.pdf\n *\n * [RFC7748] Elliptic Curves for Security\n * A. Langley, M. Hamburg, S. Turner\n * https://tools.ietf.org/html/rfc7748\n *\n * [TWISTED] Twisted Edwards Curves\n * D. Bernstein, P. Birkner, M. Joye, T. Lange, C. Peters\n * https://eprint.iacr.org/2008/013.pdf\n *\n * [ELL1] Injective Encodings to Elliptic Curves\n * P. Fouque, A. Joux, M. Tibouchi\n * https://eprint.iacr.org/2013/373.pdf\n *\n * [ISOGENY] Twisting Edwards curves with isogenies\n * Mike Hamburg\n * https://www.shiftleft.org/papers/isogeny/isogeny.pdf\n *\n * [RFC8032] Edwards-Curve Digital Signature Algorithm (EdDSA)\n * S. Josefsson, SJD AB, I. Liusvaara\n * https://tools.ietf.org/html/rfc8032\n *\n * [SCHNORR] Schnorr Signatures for secp256k1\n * Pieter Wuille\n * https://github.com/sipa/bips/blob/d194620/bip-schnorr.mediawiki\n *\n * [BIP340] Schnorr Signatures for secp256k1\n * Pieter Wuille, Jonas Nick, Tim Ruffing\n * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\n *\n * [JCEN12] Efficient Software Implementation of Public-Key Cryptography\n * on Sensor Networks Using the MSP430X Microcontroller\n * C. P. L. Gouvea, L. B. Oliveira, J. Lopez\n * http://conradoplg.cryptoland.net/files/2010/12/jcen12.pdf\n *\n * [FIPS186] Federal Information Processing Standards Publication\n * National Institute of Standards and Technology\n * https://tinyurl.com/fips-186-3\n *\n * [RFC5639] Elliptic Curve Cryptography (ECC) Brainpool\n * Standard Curves and Curve Generation\n * M. Lochter, BSI, J. Merkle\n * https://tools.ietf.org/html/rfc5639\n *\n * [TWISTEQ] Twisted Edwards & Short Weierstrass Equivalence\n * Christopher Jeffrey\n * https://gist.github.com/chjj/16ba7fa08d64e8dda269a9fe5b2a8bbc\n *\n * [ECPM] Elliptic Curve Point Multiplication (wikipedia)\n * https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication\n */\n\n'use strict';\n\nconst {custom} = require('../internal/custom');\nconst BN = require('../bn');\n\n/*\n * Constants\n */\n\nconst types = {\n AFFINE: 0,\n JACOBIAN: 1,\n PROJECTIVE: 2,\n EXTENDED: 3\n};\n\nconst jsfIndex = [\n -3, // -1 -1\n -1, // -1 0\n -5, // -1 1\n -7, // 0 -1\n 0, // 0 0\n 7, // 0 1\n 5, // 1 -1\n 1, // 1 0\n 3 // 1 1\n];\n\nconst USE_FIXED = false;\n\nlet uid = 0;\n\n/**\n * Curve\n */\n\nclass Curve {\n constructor(Point, type, conf) {\n this.Point = null;\n this.id = null;\n this.uid = uid++;\n this.ossl = null;\n this.type = 'base';\n this.endian = 'be';\n this.hash = null;\n this.prefix = null;\n this.context = false;\n this.prime = null;\n this.p = null;\n this.red = null;\n this.fieldSize = 0;\n this.fieldBits = 0;\n this.adjustedSize = 0;\n this.signBit = 0;\n this.mask = 0;\n this.n = null;\n this.h = null;\n this.q = null;\n this.z = null;\n this.g = null;\n this.nh = null;\n this.scalarSize = 0;\n this.scalarBits = 0;\n this.zero = null;\n this.one = null;\n this.two = null;\n this.three = null;\n this.four = null;\n this.i2 = null;\n this.i3 = null;\n this.i4 = null;\n this.i6 = null;\n this.torsion = null;\n this.endo = null;\n this.hi = null;\n this._init(Point, type, conf);\n }\n\n _init(Point, type, conf) {\n assert(typeof Point === 'function');\n assert(typeof type === 'string');\n assert(conf && typeof conf === 'object');\n assert(conf.red == null || (conf.red instanceof BN.Red));\n assert(conf.p != null, 'Must pass a prime.');\n assert(conf.id == null || typeof conf.id === 'string');\n assert(conf.ossl == null || typeof conf.ossl === 'string');\n assert(conf.endian == null || typeof conf.endian === 'string');\n assert(conf.hash == null || typeof conf.hash === 'string');\n assert(conf.prefix == null || typeof conf.prefix === 'string');\n assert(conf.context == null || typeof conf.context === 'boolean');\n assert(conf.prime == null || typeof conf.prime === 'string');\n assert(conf.torsion == null || Array.isArray(conf.torsion));\n\n // Point class.\n this.Point = Point;\n\n // Meta.\n this.id = conf.id || null;\n this.ossl = conf.ossl || null;\n this.type = type;\n this.endian = conf.endian || (type === 'short' ? 'be' : 'le');\n this.hash = conf.hash || null;\n this.prefix = conf.prefix ? Buffer.from(conf.prefix, 'binary') : null;\n this.context = conf.context || false;\n this.prime = conf.prime || null;\n\n // Prime.\n this.p = BN.fromJSON(conf.p);\n\n // Reduction.\n if (conf.red) {\n this.red = conf.red;\n } else {\n // Use Montgomery when there is no fast reduction for the prime.\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n this.red.precompute();\n }\n\n // Precalculate encoding length.\n this.fieldSize = this.p.byteLength();\n this.fieldBits = this.p.bitLength();\n this.adjustedSize = this.fieldSize + ((this.fieldBits & 7) === 0);\n this.signBit = this.adjustedSize * 8 - 1;\n this.mask = 0xff;\n\n if ((this.fieldBits & 7) !== 0)\n this.mask = (1 << (this.fieldBits & 7)) - 1;\n\n // Curve configuration, optional.\n this.n = BN.fromJSON(conf.n || '0');\n this.h = BN.fromJSON(conf.h || '1');\n this.q = this.n.mul(this.h);\n this.z = BN.fromJSON(conf.z || '0').toRed(this.red);\n this.g = null;\n this.nh = this.n.ushrn(1);\n this.scalarSize = this.n.byteLength();\n this.scalarBits = this.n.bitLength();\n\n // Useful for many curves.\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n this.three = new BN(3).toRed(this.red);\n this.four = new BN(4).toRed(this.red);\n\n // Inverses.\n this.i2 = this.two.redInvert();\n this.i3 = this.three.redInvert();\n this.i4 = this.i2.redSqr();\n this.i6 = this.i2.redMul(this.i3);\n\n // Torsion.\n this.torsion = new Array(this.h.word(0));\n\n for (let i = 0; i < this.torsion.length; i++)\n this.torsion[i] = this.point();\n\n // Endomorphism.\n this.endo = null;\n\n // Cache.\n this.hi = null;\n\n // Memoize.\n this._scale = memoize(this._scale, this);\n this.isIsomorphic = memoize(this.isIsomorphic, this);\n this.isIsogenous = memoize(this.isIsogenous, this);\n\n // Sanity checks.\n assert(this.p.sign() > 0 && this.p.isOdd());\n assert(this.n.sign() >= 0);\n assert(this.h.sign() > 0 && this.h.cmpn(255) <= 0);\n assert(this.endian === 'be' || this.endian === 'le');\n\n return this;\n }\n\n _finalize(conf) {\n assert(conf && typeof conf === 'object');\n\n // Create base point.\n this.g = conf.g ? this.pointFromJSON(conf.g) : this.point();\n\n // Parse small order points.\n if (conf.torsion) {\n assert(conf.torsion.length === this.torsion.length);\n\n for (let i = 0; i < this.torsion.length; i++)\n this.torsion[i] = this.pointFromJSON(conf.torsion[i]);\n }\n\n return this;\n }\n\n _findTorsion() {\n // Find all torsion points by grinding.\n assert(!this.n.isZero());\n\n const h = this.h.word(0);\n const x = this.one.redNeg();\n const out = [this.point()];\n const set = new Set();\n\n let len = h;\n\n while (out.length < len) {\n let p;\n\n x.redIAdd(this.one);\n\n try {\n p = this.pointFromX(x.clone());\n } catch (e) {\n continue;\n }\n\n try {\n p = p.mul(this.n);\n } catch (e) {\n len = 2;\n continue;\n }\n\n if (p.isInfinity())\n continue;\n\n p.normalize();\n\n for (const point of [p, p.neg()]) {\n const key = point.key();\n\n if (!set.has(key)) {\n out.push(point);\n set.add(key);\n }\n }\n }\n\n out.sort((a, b) => a.cmp(b));\n\n while (out.length < h)\n out.push(this.point());\n\n return out;\n }\n\n _fixedMul(p, k) {\n // Fixed-base method for point multiplication.\n //\n // [ECPM] \"Windowed method\".\n // [GECC] Page 95, Section 3.3.\n //\n // Windows are appropriately shifted to avoid any\n // doublings. This reduces a 256 bit multiplication\n // down to 64 additions with a window size of 4.\n assert(p instanceof Point);\n assert(k instanceof BN);\n assert(p.pre && p.pre.windows);\n\n // Get precomputed windows.\n const {width, points} = p._getWindows(0, 0);\n\n // Recompute window size.\n const size = 1 << width;\n\n // Recompute steps.\n const bits = k.bitLength();\n const steps = ((bits + width - 1) / width) >>> 0;\n\n // Multiply.\n let acc = this.jpoint();\n\n for (let i = 0; i < steps; i++) {\n const bits = k.bits(i * width, width);\n\n acc = acc.add(points[i * size + bits]);\n }\n\n // Adjust sign.\n if (k.isNeg())\n acc = acc.neg();\n\n return acc;\n }\n\n _fixedNafMul(p, k) {\n // Fixed-base NAF windowing method for point multiplication.\n //\n // [GECC] Algorithm 3.42, Page 105, Section 3.3.\n assert(p instanceof Point);\n assert(k instanceof BN);\n assert(p.pre && p.pre.doubles);\n\n // Get precomputed doubles.\n const {step, points} = p._getDoubles(0, 0);\n\n // Get fixed NAF (in a more windowed form).\n const naf = getFixedNAF(k, 2, k.bitLength() + 1, step);\n\n // Compute steps.\n const I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3;\n\n // Multiply.\n let a = this.jpoint();\n let b = this.jpoint();\n\n for (let i = I; i > 0; i--) {\n for (let j = 0; j < naf.length; j++) {\n const nafW = naf[j];\n\n if (nafW === i)\n b = b.add(points[j]);\n else if (nafW === -i)\n b = b.sub(points[j]);\n }\n\n a = a.add(b);\n }\n\n return a;\n }\n\n _wnafMul(w, p, k) {\n // Window NAF method for point multiplication.\n //\n // [GECC] Algorithm 3.36, Page 100, Section 3.3.\n assert(p instanceof Point);\n assert(k instanceof BN);\n\n // Precompute window.\n const {width, points} = p._safeNAF(w);\n\n // Get NAF form.\n const naf = getNAF(k, width, k.bitLength() + 1);\n\n // Add `this`*(N+1) for every w-NAF index.\n let acc = this.jpoint();\n\n for (let i = naf.length - 1; i >= 0; i--) {\n const z = naf[i];\n\n if (i !== naf.length - 1)\n acc = acc.dbl();\n\n if (z > 0)\n acc = acc.add(points[(z - 1) >> 1]);\n else if (z < 0)\n acc = acc.sub(points[(-z - 1) >> 1]);\n }\n\n return acc;\n }\n\n _wnafMulAdd(w, points, coeffs) {\n // Multiple point multiplication, also known\n // as \"Shamir's trick\" (with interleaved NAFs).\n //\n // [GECC] Algorithm 3.48, Page 109, Section 3.3.3.\n // Algorithm 3.51, Page 112, Section 3.3.\n //\n // This is particularly useful for signature\n // verifications and mutiplications after an\n // endomorphism split.\n assert((w >>> 0) === w);\n assert(Array.isArray(points));\n assert(Array.isArray(coeffs));\n assert(points.length === coeffs.length);\n\n const length = points.length;\n const wnd = new Array(length);\n const naf = new Array(length);\n\n // Check arrays and calculate size.\n let max = 0;\n\n for (let i = 0; i < length; i++) {\n const point = points[i];\n const coeff = coeffs[i];\n\n assert(point instanceof Point);\n assert(coeff instanceof BN);\n\n if (i > 0 && point.type !== points[i - 1].type)\n throw new Error('Cannot mix points.');\n\n // Avoid sparse arrays.\n wnd[i] = null;\n naf[i] = null;\n\n // Compute max scalar size.\n max = Math.max(max, coeff.bitLength() + 1);\n }\n\n // Compute NAFs.\n let ppoint = null;\n let pcoeff = null;\n let len = 0;\n\n for (let i = 0; i < length; i++) {\n const point = points[i];\n const coeff = coeffs[i];\n const pre = point._getNAF(0);\n\n // Use precomputation if available.\n if (pre) {\n wnd[len] = pre.points;\n naf[len] = getNAF(coeff, pre.width, max);\n len += 1;\n continue;\n }\n\n // Save last non-precomputed point.\n if (!ppoint) {\n ppoint = point;\n pcoeff = coeff;\n continue;\n }\n\n // Compute JSF in NAF form.\n wnd[len] = ppoint._getJNAF(point);\n naf[len] = getJNAF(pcoeff, coeff, max);\n\n ppoint = null;\n pcoeff = null;\n\n len += 1;\n }\n\n // Regular NAF for odd points.\n if (ppoint) {\n const nafw = ppoint._safeNAF(w);\n\n wnd[len] = nafw.points;\n naf[len] = getNAF(pcoeff, nafw.width, max);\n\n len += 1;\n }\n\n // Multiply and add.\n let acc = this.jpoint();\n\n for (let i = max - 1; i >= 0; i--) {\n if (i !== max - 1)\n acc = acc.dbl();\n\n for (let j = 0; j < len; j++) {\n const z = naf[j][i];\n\n if (z > 0)\n acc = acc.add(wnd[j][(z - 1) >> 1]);\n else if (z < 0)\n acc = acc.sub(wnd[j][(-z - 1) >> 1]);\n }\n }\n\n return acc;\n }\n\n _endoWnafMulAdd(points, coeffs) {\n throw new Error('Not implemented.');\n }\n\n _scale(curve, invert) {\n assert(curve instanceof Curve);\n assert(curve.p.eq(this.p));\n\n switch (curve.type) {\n case 'short':\n return this._scaleShort(curve, invert);\n case 'mont':\n return this._scaleMont(curve, invert);\n case 'edwards':\n return this._scaleEdwards(curve, invert);\n default:\n throw new Error('Not implemented.');\n }\n }\n\n _scaleShort(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n _scaleMont(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n _scaleEdwards(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n isElliptic() {\n throw new Error('Not implemented.');\n }\n\n jinv() {\n throw new Error('Not implemented.');\n }\n\n isComplete() {\n return false;\n }\n\n precompute(rng) {\n assert(!this.g.isInfinity(), 'Must have base point.');\n assert(!this.n.isZero(), 'Must have order.');\n\n this.g.precompute(this.n.bitLength(), rng);\n\n return this;\n }\n\n scalar(num, base, endian) {\n const k = new BN(num, base, endian);\n\n assert(!k.red);\n\n if (this.n.isZero())\n return k;\n\n return k.imod(this.n);\n }\n\n field(num, base, endian) {\n const x = BN.cast(num, base, endian);\n\n if (x.red)\n return x.forceRed(this.red);\n\n return x.toRed(this.red);\n }\n\n point(x, y) {\n throw new Error('Not implemented.');\n }\n\n jpoint(x, y, z) {\n throw new Error('Not implemented.');\n }\n\n xpoint(x, z) {\n throw new Error('Not implemented.');\n }\n\n cpoint(xx, xz, yy, yz) {\n assert(xx instanceof BN);\n assert(xz instanceof BN);\n assert(yy instanceof BN);\n assert(yz instanceof BN);\n\n if (xz.isZero() || yz.isZero())\n return this.point();\n\n const z = xz.redMul(yz).redInvert();\n const x = xx.redMul(yz).redMul(z);\n const y = yy.redMul(xz).redMul(z);\n\n return this.point(x, y);\n }\n\n solveX2(y) {\n throw new Error('Not implemented.');\n }\n\n solveX(y) {\n return this.solveX2(y).redSqrt();\n }\n\n solveY2(x) {\n throw new Error('Not implemented.');\n }\n\n solveY(x) {\n return this.solveY2(x).redSqrt();\n }\n\n validate(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromX(x, sign) {\n throw new Error('Not implemented.');\n }\n\n pointFromY(y, sign) {\n throw new Error('Not implemented.');\n }\n\n isIsomorphic(curve) {\n throw new Error('Not implemented.');\n }\n\n isIsogenous(curve) {\n throw new Error('Not implemented.');\n }\n\n pointFromShort(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point, sign) {\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n throw new Error('Not implemented.');\n }\n\n pointToUniform(p) {\n throw new Error('Not implemented.');\n }\n\n pointFromHash(bytes, pake = false) {\n // [H2EC] \"Roadmap\".\n assert(Buffer.isBuffer(bytes));\n assert(typeof pake === 'boolean');\n\n if (bytes.length !== this.fieldSize * 2)\n throw new Error('Invalid hash size.');\n\n // Random oracle encoding.\n // Ensure a proper distribution.\n const s1 = bytes.slice(0, this.fieldSize);\n const s2 = bytes.slice(this.fieldSize);\n const u1 = this.decodeUniform(s1);\n const u2 = this.decodeUniform(s2);\n const p1 = this.pointFromUniform(u1);\n const p2 = this.pointFromUniform(u2);\n const p3 = p1.add(p2);\n\n return pake ? p3.mulH() : p3;\n }\n\n pointToHash(p, subgroup, rng) {\n // [SQUARED] Algorithm 1, Page 8, Section 3.3.\n assert(p instanceof this.Point);\n assert((subgroup >>> 0) === subgroup);\n\n // Add a random torsion component.\n const i = subgroup % this.torsion.length;\n const p0 = p.add(this.torsion[i]);\n\n // Average Cost (R = sqrt):\n //\n // SSWU (~4 iterations) => 8I + 16R\n // SVDW (~4 iterations) => 12I + 28R\n // Elligator 1 (~2 iterations) => 6I + 10R\n // Elligator 2 (~2 iterations) => 4I + 6R\n // Ristretto (~1 iteration) => 1I + 2R + h*1R\n for (;;) {\n const u1 = this.randomField(rng);\n const p1 = this.pointFromUniform(u1);\n\n // Avoid 2-torsion points:\n // Short Weierstrass: ((A / 3) / B, 0)\n // Montgomery: (0, 0)\n // Twisted Edwards: (0, -1)\n if (p1.neg().eq(p1))\n continue;\n\n const p2 = p0.sub(p1);\n const hint = randomInt(rng);\n\n let u2;\n try {\n u2 = this.pointToUniform(p2, hint & 15);\n } catch (e) {\n if (e.message === 'Invalid point.')\n continue;\n throw e;\n }\n\n const s1 = this.encodeUniform(u1, hint >>> 8);\n const s2 = this.encodeUniform(u2, hint >>> 16);\n\n return Buffer.concat([s1, s2]);\n }\n }\n\n randomScalar(rng) {\n const max = this.n.isZero() ? this.p : this.n;\n return BN.random(rng, 1, max);\n }\n\n randomField(rng) {\n return BN.random(rng, 1, this.p).toRed(this.red);\n }\n\n randomPoint(rng) {\n let p;\n\n for (;;) {\n const x = this.randomField(rng);\n const sign = (randomInt(rng) & 1) !== 0;\n\n try {\n p = this.pointFromX(x, sign);\n } catch (e) {\n continue;\n }\n\n assert(p.validate());\n\n return p.mulH();\n }\n }\n\n mulAll(points, coeffs) {\n return this.jmulAll(points, coeffs);\n }\n\n jmulAll(points, coeffs) {\n assert(Array.isArray(points));\n assert(points.length === 0 || (points[0] instanceof Point));\n\n // Multiply with endomorphism if we're using affine points.\n if (this.endo && points.length > 0 && points[0].type === types.AFFINE)\n return this._endoWnafMulAdd(points, coeffs);\n\n // Otherwise, a regular Shamir's trick.\n return this._wnafMulAdd(5, points, coeffs);\n }\n\n mulH(k) {\n assert(k instanceof BN);\n return this.imulH(k.clone());\n }\n\n imulH(k) {\n assert(k instanceof BN);\n assert(!k.red);\n\n const word = this.h.word(0);\n\n // Optimize for powers of two.\n if ((word & (word - 1)) === 0) {\n const bits = this.h.bitLength();\n return k.iushln(bits - 1).imod(this.n);\n }\n\n return k.imuln(word).imod(this.n);\n }\n\n normalizeAll(points) {\n assert(Array.isArray(points));\n\n const len = points.length;\n const z = new Array(len);\n\n for (let i = 0; i < len; i++) {\n const p = points[i];\n\n assert(p instanceof Point);\n assert(p.curve === this);\n\n if (p.type === types.AFFINE) {\n z[i] = this.one;\n continue;\n }\n\n z[i] = p.z;\n }\n\n const zi = this.red.invertAll(z);\n const out = new Array(len);\n\n for (let i = 0; i < len; i++)\n out[i] = points[i].scale(zi[i]);\n\n return out;\n }\n\n affinizeAll(points) {\n return this.normalizeAll(points);\n }\n\n clamp(scalar) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n assert(Buffer.isBuffer(scalar));\n assert(scalar.length === this.scalarSize);\n assert(this.scalarSize <= this.fieldSize);\n\n let top = (this.fieldBits & 7) || 8;\n let lsb = 0;\n let msb = this.scalarSize - 1;\n\n // Swap endianness.\n if (this.endian === 'be')\n [lsb, msb] = [msb, lsb];\n\n // Adjust for low order.\n if (this.scalarSize < this.fieldSize)\n top = 8;\n\n // Ensure a multiple of the cofactor.\n scalar[lsb] &= -this.h.word(0) & 0xff;\n\n // Clamp to the prime.\n scalar[msb] &= (1 << top) - 1;\n\n // Set the high bit.\n scalar[msb] |= 1 << (top - 1);\n\n return scalar;\n }\n\n splitHash(bytes) {\n // [RFC8032] Section 5.1.6 & 5.2.6.\n assert(Buffer.isBuffer(bytes));\n assert(bytes.length === this.adjustedSize * 2);\n assert(this.scalarSize <= this.adjustedSize);\n\n let off = 0;\n\n if (this.endian === 'be')\n off = this.adjustedSize - this.scalarSize;\n\n const scalar = bytes.slice(off, off + this.scalarSize);\n const prefix = bytes.slice(this.adjustedSize);\n\n this.clamp(scalar);\n\n return [scalar, prefix];\n }\n\n encodeField(x) {\n // [SEC1] Page 12, Section 2.3.5.\n assert(x instanceof BN);\n assert(!x.red);\n\n return x.encode(this.endian, this.fieldSize);\n }\n\n decodeField(bytes) {\n // [SEC1] Page 13, Section 2.3.6.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.fieldSize)\n throw new Error('Invalid field element size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeAdjusted(x) {\n assert(x instanceof BN);\n assert(!x.red);\n\n return x.encode(this.endian, this.adjustedSize);\n }\n\n decodeAdjusted(bytes) {\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.adjustedSize)\n throw new Error('Invalid field element size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeScalar(k) {\n // [SEC1] Page 13, Section 2.3.7.\n assert(k instanceof BN);\n assert(!k.red);\n\n return k.encode(this.endian, this.scalarSize);\n }\n\n decodeScalar(bytes) {\n // [SEC1] Page 14, Section 2.3.8.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.scalarSize)\n throw new Error('Invalid scalar size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeClamped(k) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n return this.clamp(this.encodeScalar(k));\n }\n\n decodeClamped(bytes) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.scalarSize)\n throw new Error('Invalid scalar size.');\n\n const clamped = this.clamp(Buffer.from(bytes));\n\n return BN.decode(clamped, this.endian);\n }\n\n encodeUniform(x, bits) {\n assert(x instanceof BN);\n assert((bits >>> 0) === bits);\n\n const msb = this.endian === 'le' ? this.fieldSize - 1 : 0;\n const bytes = x.fromRed().encode(this.endian, this.fieldSize);\n\n bytes[msb] |= (bits & ~this.mask) & 0xff;\n\n return bytes;\n }\n\n decodeUniform(bytes) {\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.fieldSize)\n throw new Error('Invalid field size.');\n\n const x = BN.decode(bytes, this.endian);\n\n x.iumaskn(this.fieldBits);\n\n return x.toRed(this.red);\n }\n\n encodePoint(point, compact) {\n assert(point instanceof Point);\n return point.encode(compact);\n }\n\n decodePoint(bytes) {\n throw new Error('Not implemented.');\n }\n\n encodeX(point) {\n throw new Error('Not implemented.');\n }\n\n decodeX(bytes) {\n throw new Error('Not implemented.');\n }\n\n decodeEven(bytes) {\n throw new Error('Not implemented.');\n }\n\n decodeSquare(bytes) {\n throw new Error('Not implemented.');\n }\n\n toShort() {\n throw new Error('Not implemented.');\n }\n\n toMont(b0) {\n throw new Error('Not implemented.');\n }\n\n toEdwards(a0) {\n throw new Error('Not implemented.');\n }\n\n pointToJSON(point, pre) {\n assert(point instanceof Point);\n return point.toJSON(pre);\n }\n\n pointFromJSON(json) {\n throw new Error('Not implemented.');\n }\n\n toJSON(pre) {\n let prefix, context;\n let n, z, endo;\n\n if (this.type === 'edwards') {\n prefix = this.prefix ? this.prefix.toString() : null;\n context = this.context;\n }\n\n if (!this.n.isZero())\n n = this.n.toJSON();\n\n if (!this.z.isZero()) {\n z = this.z.fromRed();\n\n if (this.z.redIsHigh())\n z.isub(this.p);\n\n z = z.toString(16);\n }\n\n if (this.endo)\n endo = this.endo.toJSON();\n\n return {\n id: this.id,\n ossl: this.ossl,\n type: this.type,\n endian: this.endian,\n hash: this.hash,\n prefix,\n context,\n prime: this.prime,\n p: this.p.toJSON(),\n a: undefined,\n b: undefined,\n d: undefined,\n n,\n h: this.h.toString(16),\n s: undefined,\n z,\n c: undefined,\n g: this.g.toJSON(pre),\n endo\n };\n }\n\n static fromJSON(json) {\n return new this(json);\n }\n}\n\n/**\n * Point\n */\n\nclass Point {\n constructor(curve, type) {\n assert(curve instanceof Curve);\n assert((type >>> 0) === type);\n\n this.curve = curve;\n this.type = type;\n this.pre = null;\n }\n\n _init() {\n throw new Error('Not implemented.');\n }\n\n _safeNAF(width) {\n assert((width >>> 0) === width);\n\n if (this.pre && this.pre.naf)\n return this.pre.naf;\n\n if (width === 0)\n return null;\n\n const size = 1 << (width - 2);\n const points = new Array(size);\n const p = this.toJ();\n const dbl = size === 1 ? null : p.dbl();\n\n points[0] = p;\n\n for (let i = 1; i < size; i++)\n points[i] = points[i - 1].add(dbl);\n\n return new NAF(width, points);\n }\n\n _getNAF(width) {\n assert((width >>> 0) === width);\n\n if (this.pre && this.pre.naf)\n return this.pre.naf;\n\n if (width === 0)\n return null;\n\n const odds = this._safeNAF(width).points;\n const points = this.curve.affinizeAll(odds);\n\n return new NAF(width, points);\n }\n\n _getWindows(width, bits) {\n assert((width >>> 0) === width);\n assert((bits >>> 0) === bits);\n\n if (this.pre && this.pre.windows)\n return this.pre.windows;\n\n if (width === 0)\n return null;\n\n const size = 1 << width;\n const steps = ((bits + width - 1) / width) >>> 0;\n const wnds = new Array(steps * size);\n\n let g = this.toJ();\n\n for (let i = 0; i < steps; i++) {\n wnds[i * size] = this.curve.jpoint();\n\n for (let j = 1; j < size; j++)\n wnds[i * size + j] = wnds[i * size + j - 1].add(g);\n\n g = g.dblp(width);\n }\n\n const points = this.curve.affinizeAll(wnds);\n\n return new Windows(width, bits, points);\n }\n\n _getDoubles(step, power) {\n assert((step >>> 0) === step);\n assert((power >>> 0) === power);\n\n if (this.pre && this.pre.doubles)\n return this.pre.doubles;\n\n if (step === 0)\n return null;\n\n const len = Math.ceil(power / step) + 1;\n const dbls = new Array(len);\n\n let acc = this.toJ();\n let k = 0;\n\n dbls[k++] = acc;\n\n for (let i = 0; i < power; i += step) {\n for (let j = 0; j < step; j++)\n acc = acc.dbl();\n\n dbls[k++] = acc;\n }\n\n assert(k === len);\n\n const points = this.curve.affinizeAll(dbls);\n\n return new Doubles(step, points);\n }\n\n _getBeta() {\n return null;\n }\n\n _getBlinding(rng) {\n if (this.pre && this.pre.blinding)\n return this.pre.blinding;\n\n if (!rng)\n return null;\n\n if (this.curve.n.isZero())\n return null;\n\n // Pregenerate a random blinding value:\n //\n // blind = random integer in [1,n-1]\n // unblind = G * blind\n //\n // We intend to subtract the blinding value\n // from scalars before multiplication. We\n // can add the unblinding point once the\n // multiplication is complete.\n const blind = this.curve.randomScalar(rng);\n const unblind = this.mul(blind);\n\n return new Blinding(blind, unblind);\n }\n\n _hasWindows(k) {\n assert(k instanceof BN);\n\n if (!this.pre || !this.pre.windows)\n return false;\n\n const {width, bits} = this.pre.windows;\n const steps = ((bits + width - 1) / width) >>> 0;\n\n return k.bitLength() <= steps * width;\n }\n\n _hasDoubles(k) {\n assert(k instanceof BN);\n\n if (!this.pre || !this.pre.doubles)\n return false;\n\n const {step, points} = this.pre.doubles;\n const power = k.bitLength() + 1;\n\n return points.length >= Math.ceil(power / step) + 1;\n }\n\n _getJNAF(point) {\n assert(point instanceof Point);\n assert(point.type === this.type);\n\n // Create comb for JSF.\n return [\n this, // 1\n this.add(point), // 3\n this.sub(point), // 5\n point // 7\n ];\n }\n\n _blind(k, rng) {\n // [SIDE1] Page 5, Section 4.\n // [BLIND] Page 20, Section 7.\n assert(k instanceof BN);\n assert(!k.red);\n\n // Scalar splitting (requires precomputation).\n //\n // Blind a multiplication by first subtracting\n // a blinding value from the scalar. Example:\n //\n // b = random integer in [1,n-1]\n // B = P * b (precomputed)\n // Q = P * (k - b) + B\n //\n // Note that Joye describes a different method\n // (multiplier randomization) which computes:\n //\n // B = random point in E\n // Q = (P + B) * k - B * k\n //\n // Our method is more similar to the \"scalar\n // splitting\" technique described in the\n // second source above.\n //\n // The blinding value and its corresponding\n // point are randomly generated and computed\n // on boot. As long as an attacker is not\n // able to observe the boot, this should give\n // a decent bit of protection against various\n // channel attacks.\n if (this.pre && this.pre.blinding) {\n const {blind, unblind} = this.pre.blinding;\n const t = k.sub(blind);\n\n return [this, t, unblind];\n }\n\n // Randomization is not possible without\n // an RNG. Do a normal multiplication.\n if (!rng)\n return [this, k, null];\n\n // If we have no precomputed blinding\n // factor, there are two possibilities\n // for randomization:\n //\n // 1. Randomize the multiplier by adding\n // a random multiple of `n`.\n //\n // 2. Re-scale the point itself by a\n // random factor.\n //\n // The first option can be accomplished\n // with some like:\n //\n // a = random integer in [1,n-1]\n // r = a * n\n // Q = P * (k + r)\n //\n // The second is accomplished with:\n //\n // a = random element in F(p)\n // R = (x * a^2, y * a^3, z * a)\n // Q = R * k\n //\n // If we have precomputed doubles / naf\n // points, we opt for the first method\n // to avoid randomizing everything.\n if (this.pre) {\n if (this.curve.n.isZero())\n return [this, k, null];\n\n const a = this.curve.randomScalar(rng);\n const r = a.mul(this.curve.n);\n const t = r.iadd(k);\n\n return [this, t, null];\n }\n\n // If there is no precomputation _at all_,\n // we opt for the second method.\n const p = this.randomize(rng);\n\n return [p, k, null];\n }\n\n clone() {\n throw new Error('Not implemented.');\n }\n\n precompute(bits, rng) {\n assert((bits >>> 0) === bits);\n\n if (!this.pre)\n this.pre = new Precomp();\n\n if (!this.pre.naf)\n this.pre.naf = this._getNAF(9);\n\n if (USE_FIXED && !this.pre.windows)\n this.pre.windows = this._getWindows(4, bits);\n\n if (!this.pre.doubles)\n this.pre.doubles = this._getDoubles(4, bits + 1);\n\n if (!this.pre.beta)\n this.pre.beta = this._getBeta();\n\n if (!this.pre.blinding)\n this.pre.blinding = this._getBlinding(rng);\n\n return this;\n }\n\n validate() {\n return this.curve.validate(this);\n }\n\n normalize() {\n return this;\n }\n\n scale(a) {\n throw new Error('Not implemented.');\n }\n\n randomize(rng) {\n const z = this.curve.randomField(rng);\n return this.scale(z);\n }\n\n neg() {\n throw new Error('Not implemented.');\n }\n\n add(point) {\n throw new Error('Not implemented.');\n }\n\n sub(point) {\n assert(point instanceof Point);\n return this.add(point.neg());\n }\n\n dbl() {\n throw new Error('Not implemented.');\n }\n\n dblp(pow) {\n // Repeated doubling. This can\n // be optimized by child classes.\n assert((pow >>> 0) === pow);\n\n let r = this;\n\n for (let i = 0; i < pow; i++)\n r = r.dbl();\n\n return r;\n }\n\n diffAddDbl(p, q) {\n throw new Error('Not implemented.');\n }\n\n getX() {\n throw new Error('Not implemented.');\n }\n\n getY() {\n throw new Error('Not implemented.');\n }\n\n eq(point) {\n throw new Error('Not implemented.');\n }\n\n cmp(point) {\n throw new Error('Not implemented.');\n }\n\n isInfinity() {\n throw new Error('Not implemented.');\n }\n\n isOrder2() {\n throw new Error('Not implemented.');\n }\n\n isOdd() {\n throw new Error('Not implemented.');\n }\n\n isEven() {\n throw new Error('Not implemented.');\n }\n\n isSquare() {\n throw new Error('Not implemented.');\n }\n\n eqX(x) {\n throw new Error('Not implemented.');\n }\n\n eqR(x) {\n throw new Error('Not implemented.');\n }\n\n isSmall() {\n // Test whether the point is of small order.\n if (this.isInfinity())\n return false;\n\n // P * h = O\n return this.jmulH().isInfinity();\n }\n\n hasTorsion() {\n // Test whether the point is in another subgroup.\n if (this.isInfinity())\n return false;\n\n // P * n != O\n return !this.jmul(this.curve.n).isInfinity();\n }\n\n order() {\n // Calculate point order.\n const {h, n} = this.curve;\n\n let p = this.toJ();\n let q = new BN(1);\n\n while (!p.isInfinity()) {\n q.iaddn(1);\n\n if (q.cmp(h) > 0) {\n q = n.clone();\n break;\n }\n\n p = p.add(this);\n }\n\n return q;\n }\n\n mul(k) {\n return this.jmul(k);\n }\n\n muln(k) {\n return this.jmuln(k);\n }\n\n mulBlind(k, rng) {\n return this.jmulBlind(k, rng);\n }\n\n mulAdd(k1, p2, k2) {\n return this.jmulAdd(k1, p2, k2);\n }\n\n mulH() {\n return this.jmulH();\n }\n\n div(k) {\n return this.jdiv(k);\n }\n\n divn(k) {\n return this.jdivn(k);\n }\n\n divH() {\n return this.jdivH();\n }\n\n jmul(k) {\n if (USE_FIXED && this._hasWindows(k))\n return this.curve._fixedMul(this, k);\n\n if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n\n if (this.curve.endo && this.type === types.AFFINE)\n return this.curve._endoWnafMulAdd([this], [k]);\n\n return this.curve._wnafMul(5, this, k);\n }\n\n jmuln(k) {\n assert((k | 0) === k);\n return this.jmul(new BN(k));\n }\n\n jmulBlind(k, rng = null) {\n const [p, t, unblind] = this._blind(k, rng);\n const q = p.jmul(t);\n\n if (unblind)\n return q.add(unblind);\n\n return q;\n }\n\n jmulAdd(k1, p2, k2) {\n if (this.curve.endo && this.type === types.AFFINE)\n return this.curve._endoWnafMulAdd([this, p2], [k1, k2]);\n\n return this.curve._wnafMulAdd(5, [this, p2], [k1, k2]);\n }\n\n jmulH() {\n const word = this.curve.h.word(0);\n\n // Optimize for powers of two.\n if ((word & (word - 1)) === 0) {\n const bits = this.curve.h.bitLength();\n return this.toJ().dblp(bits - 1);\n }\n\n return this.jmul(this.curve.h);\n }\n\n jdiv(k) {\n assert(k instanceof BN);\n assert(!k.red);\n\n return this.jmul(k.invert(this.curve.n));\n }\n\n jdivn(k) {\n assert(!this.curve.n.isZero());\n\n if (this.curve.h.cmpn(k) === 0)\n return this.jdivH();\n\n return this.jdiv(new BN(k));\n }\n\n jdivH() {\n if (this.curve.n.isZero())\n return this.toJ();\n\n if (this.curve.h.cmpn(1) === 0)\n return this.toJ();\n\n if (this.curve.hi === null)\n this.curve.hi = this.curve.h.invert(this.curve.n);\n\n return this.jmul(this.curve.hi);\n }\n\n toP() {\n return this.normalize();\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n return this;\n }\n\n key() {\n if (this.isInfinity())\n return `${this.curve.uid}:oo`;\n\n this.normalize();\n\n const x = this.getX().toString(16);\n const y = this.getY().toString(16);\n\n return `${this.curve.uid}:${x},${y}`;\n }\n\n encode(compact) {\n throw new Error('Not implemented.');\n }\n\n static decode(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n encodeX() {\n throw new Error('Not implemented.');\n }\n\n static decodeX(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n static decodeEven(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n static decodeSquare(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n toJSON(pre) {\n throw new Error('Not implemented.');\n }\n\n static fromJSON(curve, json) {\n throw new Error('Not implemented.');\n }\n\n [custom]() {\n return '';\n }\n}\n\n/**\n * ShortCurve\n */\n\nclass ShortCurve extends Curve {\n constructor(conf) {\n super(ShortPoint, 'short', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.b = BN.fromJSON(conf.b).toRed(this.red);\n this.c = BN.fromJSON(conf.c || '0').toRed(this.red);\n this.ai = this.a.isZero() ? this.zero : this.a.redInvert();\n this.zi = this.z.isZero() ? this.zero : this.z.redInvert();\n\n this.zeroA = this.a.isZero();\n this.threeA = this.a.eq(this.three.redNeg());\n this.redN = this.n.toRed(this.red);\n this.pmodn = this.p.clone();\n this.highOrder = this.n.cmp(this.p) >= 0;\n this.smallGap = false;\n\n this._finalize(conf);\n }\n\n _finalize(conf) {\n super._finalize(conf);\n\n // Precalculate endomorphism.\n if (conf.endo != null)\n this.endo = Endo.fromJSON(this, conf.endo);\n else\n this.endo = this._getEndomorphism();\n\n if (!this.n.isZero()) {\n this.pmodn = this.p.mod(this.n);\n\n // Check for Maxwell's trick (see eqR).\n this.smallGap = this.p.div(this.n).cmpn(1) <= 0;\n }\n\n return this;\n }\n\n static _isomorphism(curveA, curveB, custom, odd) {\n // Short Weierstrass Isomorphism.\n //\n // [GECC] Page 84, Section 3.1.5.\n // [ARITH1] Page 274, Section 13.1.5.\n // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves).\n //\n // Find `u` such that `a * u^4 = a'` and `b * u^6 = b'`.\n //\n // Transformation:\n //\n // u4 = a' / a\n // u2 = +-sqrt(u4)\n // u6 = u4 * u2\n // a' = a * u4\n // b' = b * u6\n //\n // Where `u2` is any root that is square.\n //\n // If a = 0, we can do:\n //\n // a' = 0\n // b' = b'\n //\n // Where (b' / b)^(1 / 3) is square.\n //\n // If b = 0, we can do:\n //\n // a' = a'\n // b' = 0\n //\n // Where sqrt(a' / a) is square.\n assert(curveA instanceof BN);\n assert(curveB instanceof BN);\n assert(custom instanceof BN);\n assert(odd == null || typeof odd === 'boolean');\n assert(!curveA.isZero() || !curveB.isZero());\n\n if (custom.isZero())\n throw new Error('Invalid coefficient.');\n\n if (curveA.isZero()) {\n const customB = custom;\n const u6 = customB.redDiv(curveB);\n // Todo: allow index flag.\n const u2 = uncube(u6);\n\n // Already checked in uncube().\n assert(u2.redJacobi() === 1);\n\n return [curveA.clone(), customB.clone()];\n }\n\n if (curveB.isZero()) {\n const customA = custom;\n const u4 = customA.redDiv(curveA);\n const u2 = u4.redSqrt();\n\n // Todo: allow odd flag.\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n\n if (u2.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n return [customA.clone(), curveB.clone()];\n }\n\n const customA = custom;\n const u4 = customA.redDiv(curveA);\n const u2 = u4.redSqrt();\n\n if (odd != null) {\n if (u2.redIsOdd() !== odd)\n u2.redINeg();\n } else {\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n }\n\n if (u2.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n const u6 = u4.redMul(u2);\n const a = curveA.redMul(u4);\n const b = curveB.redMul(u6);\n\n assert(a.eq(customA));\n\n return [a, b];\n }\n\n _short(a0, odd) {\n return ShortCurve._isomorphism(this.a, this.b, a0, odd);\n }\n\n _mont(b0, odd) {\n // Short Weierstrass->Montgomery Equivalence.\n //\n // [ARITH1] Page 286, Section 13.2.3.c.\n // [SAFE] \"Ladders\".\n //\n // Transformation:\n //\n // r = A / (3 * B)\n // s = +-sqrt(3 * r^2 + a)\n // A = 3 * r / s\n // B = 1 / s\n const [r, s] = this._findRS(odd);\n const b = s.redInvert();\n const a = r.redMuln(3).redMul(b);\n\n if (b0 != null)\n return MontCurve._isomorphism(a, b, b0);\n\n return [a, b];\n }\n\n _edwards(a0, odd) {\n // Short Weierstrass->Twisted Edwards Equivalence.\n //\n // [TWISTEQ] Section 1.\n //\n // Transformation:\n //\n // r = (a' + d') / 6\n // s = +-sqrt(3 * r^2 + a)\n // a' = 3 * r + 2 * s\n // d' = 3 * r - 2 * s\n const [r, s] = this._findRS(odd);\n const r3 = r.redMuln(3);\n const s2 = s.redMuln(2);\n const a = r3.redAdd(s2);\n const d = r3.redSub(s2);\n\n if (a0 != null)\n return EdwardsCurve._isomorphism(a, d, a0);\n\n return [a, d];\n }\n\n _findRS(sign) {\n // Find `r` and `s` for equivalence.\n //\n // [ARITH1] Page 286, Section 13.2.3.c.\n // [SAFE] \"Ladders\".\n //\n // Computation:\n //\n // r = solve(r^3 + a * r + b == 0, r)\n // s = +-sqrt(3 * r^2 + a)\n //\n // Computing `r` is non-trivial. We need\n // to solve `r^3 + a * r + b = 0`, but we\n // don't have a polynomial solver, so we\n // loop over random points until we find\n // one with 2-torsion. Multiplying by the\n // subgroup order should yield a point of\n // ((A / 3) / B, 0) which is a solution.\n assert(sign == null || typeof sign === 'boolean');\n assert(this.h.word(0) >= 4);\n assert(!this.n.isZero());\n\n const x = this.one.redNeg();\n\n let p;\n\n for (;;) {\n x.redIAdd(this.one);\n\n try {\n p = this.pointFromX(x.clone());\n } catch (e) {\n continue;\n }\n\n p = p.mul(this.n);\n\n if (p.isInfinity())\n continue;\n\n if (!p.y.isZero())\n continue;\n\n break;\n }\n\n const r = p.x;\n const r2 = r.redSqr();\n const s = r2.redMuln(3).redIAdd(this.a).redSqrt();\n\n if (sign != null) {\n if (s.redIsOdd() !== sign)\n s.redINeg();\n }\n\n return [r, s];\n }\n\n _scale0(a, b) {\n // We can extract the isomorphism factors with:\n //\n // u4 = a' / a\n // u6 = b' / b\n // u2 = +-sqrt(u4)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // `u2` should be picked such that `u4 * u2 = u6`.\n //\n // If a = 0, we can do:\n //\n // u6 = b' / b\n // u2 = u6^(1 / 3)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // Where `u2` is any root that is square.\n //\n // If b = 0, we can do:\n //\n // u4 = a' / a\n // u2 = +-sqrt(u4)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // Where `u2` is any root that is square.\n assert(this.a.isZero() === a.isZero());\n assert(this.b.isZero() === b.isZero());\n\n if (this.a.isZero()) {\n const u6 = this.b.redDiv(this.field(b));\n // Todo: figure out how to check index.\n const u2 = uncube(u6);\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(u3.redSqr().eq(u6));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n if (this.b.isZero()) {\n const u4 = this.a.redDiv(this.field(a));\n const u2 = u4.redSqrt();\n\n // Todo: figure out how to check oddness.\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(u3.redMul(u).eq(u4));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n const u4 = this.a.redDiv(this.field(a));\n const u6 = this.b.redDiv(this.field(b));\n const u2 = u4.redSqrt();\n\n if (!u4.redMul(u2).eq(u6))\n u2.redINeg();\n\n assert(u4.redMul(u2).eq(u6));\n\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n _scale1(x, y) {\n // If base points are available, it is much\n // easier, with:\n //\n // u2 = x' / x\n // u3 = y' / y\n // u = +-sqrt(u2)\n //\n // `u` should be picked such that `u2 * u = u3`.\n const u2 = this.g.x.redDiv(this.field(x));\n const u3 = this.g.y.redDiv(this.field(y));\n const u = u2.redSqrt();\n\n if (!u2.redMul(u).eq(u3))\n u.redINeg();\n\n assert(u2.redMul(u).eq(u3));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this._scale0(curve.a, curve.b);\n\n return this._scale1(curve.g.x, curve.g.y);\n }\n\n _scaleMont(curve) {\n assert(curve instanceof MontCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a, b] = curve._short();\n return this._scale0(a, b);\n }\n\n const {x, y} = curve.g;\n const nx = x.redAdd(curve.a3).redMul(curve.bi);\n const ny = y.redMul(curve.bi);\n\n return this._scale1(nx, ny);\n }\n\n _scaleEdwards(curve) {\n assert(curve instanceof EdwardsCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a, b] = curve._short();\n return this._scale0(a, b);\n }\n\n const {x, y, z} = curve.g;\n const a5 = curve.a.redMuln(5);\n const d5 = curve.d.redMuln(5);\n const dma = curve.d.redSub(curve.a);\n const d5a = d5.redSub(curve.a);\n const da5 = curve.d.redSub(a5);\n const ypz = y.redAdd(z);\n const ymz = y.redSub(z);\n const xx = d5a.redMul(y).redIAdd(da5.redMul(z));\n const xz = ymz.redMuln(12);\n const yy = dma.redMul(ypz).redMul(z);\n const yz = ymz.redMul(x).redIMuln(4);\n const zi = xz.redMul(yz).redInvert();\n const nx = xx.redMul(yz).redMul(zi);\n const ny = yy.redMul(xz).redMul(zi);\n\n return this._scale1(nx, ny);\n }\n\n _getEndomorphism(index = 0) {\n // Compute endomorphism.\n //\n // [GECC] Example 3.76, Page 128, Section 3.5.\n\n // No curve params.\n if (this.n.isZero() || this.g.isInfinity())\n return null;\n\n // No efficient endomorphism.\n if (!this.zeroA || this.p.modrn(3) !== 1 || this.n.modrn(3) !== 1)\n return null;\n\n // Solve beta^3 mod p = 1.\n const [b1, b2] = this._getEndoRoots(this.p);\n\n // Choose the smallest beta by default.\n const beta = [b1, b2][index & 1].toRed(this.red);\n\n // Solve lambda^3 mod n = 1.\n const [l1, l2] = this._getEndoRoots(this.n);\n\n // Choose the lambda matching selected beta.\n // Note that P * lambda = (x * beta, y).\n const p = this.point(this.g.x.redMul(beta), this.g.y);\n\n let lambda;\n\n if (this.g.mul(l1).eq(p)) {\n lambda = l1;\n } else {\n assert(this.g.mul(l2).eq(p));\n lambda = l2;\n }\n\n // Get basis vectors.\n const basis = this._getEndoBasis(lambda);\n\n // Precompute `g1` and `g2`.\n const pre = this._getEndoPrecomp(basis);\n\n return new Endo(beta, lambda, basis, pre);\n }\n\n _getEndoRoots(num) {\n // Find roots for x^2 + x + 1 in F.\n //\n // [GECC] Example 3.76, Page 128, Section 3.5.\n // [GLV] Page 192, Section 2 (Endomorphisms).\n //\n // The above document doesn't fully explain how\n // to derive these and only \"hints\" at it, as\n // mentioned by Hal Finney[1], but we're basically\n // computing two possible cube roots of 1 here.\n //\n // Note that we could also compute[2]:\n //\n // beta = 2^((p - 1) / 3) mod p\n // lambda = 3^((n - 1) / 3) mod n\n //\n // As an extension of Fermat's little theorem:\n //\n // g^(p - 1) mod p == 1\n //\n // It is suspected[3] this is how Hal Finney[4]\n // computed his original endomorphism roots.\n //\n // @indutny's method for computing cube roots\n // of unity[5] appears to be the method described\n // on wikipedia[6][7].\n //\n // Sage produces the same solution:\n //\n // sage: solve(x^2 + x + 1 == 0, x)\n // [x == -1/2*I*sqrt(3) - 1/2, x == 1/2*I*sqrt(3) - 1/2]\n //\n // This can be reduced to:\n //\n // x = (+-sqrt(-3) - 1) / 2\n //\n // [1] https://bitcointalk.org/index.php?topic=3238.msg45565#msg45565\n // [2] https://crypto.stackexchange.com/a/22739\n // [3] https://bitcoin.stackexchange.com/a/35872\n // [4] https://github.com/halfinney/bitcoin/commit/dc411b5\n // [5] https://en.wikipedia.org/wiki/Cube_root_of_unity\n // [6] https://en.wikipedia.org/wiki/Splitting_field#Cubic_example\n // [7] http://mathworld.wolfram.com/SplittingField.html\n const red = num === this.p ? this.red : BN.mont(num);\n const two = new BN(2).toRed(red);\n const three = new BN(3).toRed(red);\n const i2 = two.redInvert();\n\n // S1 = sqrt(-3) / 2\n const s1 = three.redNeg().redSqrt().redMul(i2);\n\n // S2 = -S1\n const s2 = s1.redNeg();\n\n // R1 = S1 - 1 / 2\n const r1 = s1.redSub(i2).fromRed();\n\n // R2 = S2 - 1 / 2\n const r2 = s2.redSub(i2).fromRed();\n\n return [r1, r2].sort(BN.cmp);\n }\n\n _getEndoBasis(lambda) {\n // Compute endomorphic basis.\n //\n // This essentially computes Cornacchia's algorithm\n // for solving x^2 + d * y^2 = m (d = lambda, m = order).\n //\n // https://en.wikipedia.org/wiki/Cornacchia%27s_algorithm\n //\n // [GECC] Algorithm 3.74, Page 127, Section 3.5.\n // [GLV] Page 196, Section 4 (Decomposing K).\n //\n // Balanced length-two representation of a multiplier.\n //\n // 1. Run the extended euclidean algorithm with inputs n\n // and lambda. The algorithm produces a sequence of\n // equations si*n + ti*lam = ri where s0=1, t0=0,\n // r0=n, s1=0, t1=1, r1=lam, and the remainders ri\n // and are non-negative and strictly decreasing. Let\n // l be the greatest index for which rl >= sqrt(n).\n const [rl, tl, rl1, tl1, rl2, tl2] = this._egcdSqrt(lambda);\n\n // 2. Set (a1, b1) <- (rl+1, -tl+1).\n const a1 = rl1;\n const b1 = tl1.neg();\n\n // 3. If (rl^2 + tl^2) <= (rl+2^2 + tl+2^2)\n // then set (a2, b2) <- (rl, -tl).\n // else set (a2, b2) <- (rl+2, -tl+2).\n const lhs = rl.sqr().iadd(tl.sqr());\n const rhs = rl2.sqr().iadd(tl2.sqr());\n\n let a2, b2;\n\n if (lhs.cmp(rhs) <= 0) {\n a2 = rl;\n b2 = tl.neg();\n } else {\n a2 = rl2;\n b2 = tl2.neg();\n }\n\n return [\n new Vector(a1, b1),\n new Vector(a2, b2)\n ];\n }\n\n _egcdSqrt(lambda) {\n // Extended Euclidean algorithm for integers.\n //\n // [GECC] Algorithm 2.19, Page 40, Section 2.2.\n // [GLV] Page 196, Section 4 (Decomposing K).\n assert(lambda instanceof BN);\n assert(!lambda.red);\n assert(lambda.sign() > 0);\n assert(this.n.sign() > 0);\n\n // Note that we insert the approximate square\n // root checks as described in algorithm 3.74.\n //\n // Algorithm 2.19 is defined as:\n //\n // 1. u <- a\n // v <- b\n //\n // 2. x1 <- 1\n // y1 <- 0\n // x2 <- 0\n // y2 <- 1\n //\n // 3. while u != 0 do\n //\n // 3.1. q <- floor(v / u)\n // r <- v - q * u\n // x <- x2 - q * x1\n // y <- y2 - q * y1\n //\n // 3.2. v <- u\n // u <- r\n // x2 <- x1\n // x1 <- x\n // y2 <- y1\n // y1 <- y\n //\n // 4. d <- v\n // x <- x2\n // y <- y2\n //\n // 5. Return (d, x, y).\n\n // Start with an approximate square root of n.\n const sqrtn = this.n.ushrn(this.n.bitLength() >>> 1);\n\n let u = lambda; // r1\n let v = this.n.clone(); // r0\n let x1 = new BN(1); // t1\n let y1 = new BN(0); // t0\n let x2 = new BN(0); // s1\n let y2 = new BN(1); // s0\n\n // All vectors are roots of: a + b * lambda = 0 (mod n).\n let rl, tl;\n\n // First vector.\n let rl1, tl1;\n\n // Inner.\n let i = 0;\n let j = 0;\n let p;\n\n // Compute EGCD.\n while (!u.isZero() && i < 2) {\n const q = v.quo(u);\n const r = v.sub(q.mul(u));\n const x = x2.sub(q.mul(x1));\n const y = y2.sub(q.mul(y1));\n\n // Check for r < sqrt(n).\n if (j === 0 && r.cmp(sqrtn) < 0) {\n rl = p;\n tl = x1;\n rl1 = r;\n tl1 = x;\n j = 1; // 1 more round.\n }\n\n p = r;\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n\n i += j;\n }\n\n // Should never happen.\n assert(j !== 0, 'Could not find r < sqrt(n).');\n\n // Second vector.\n const rl2 = x2;\n const tl2 = x1;\n\n return [\n rl,\n tl,\n rl1,\n tl1,\n rl2,\n tl2\n ];\n }\n\n _getEndoPrecomp(basis) {\n // Precompute `g1` and `g2` to avoid round division.\n //\n // [JCEN12] Page 5, Section 4.3.\n //\n // Computation:\n //\n // d = a1 * b2 - b1 * a2\n // t = ceil(log2(d+1)) + p\n // g1 = round((2^t * b2) / d)\n // g2 = round((2^t * b1) / d)\n //\n // Where:\n //\n // `p` is the number of precision bits.\n // `d` is equal to `n` (the curve order).\n //\n // The paper above uses 2 as the value of `p`,\n // whereas libsecp256k1 uses 128 (total=384).\n //\n // We pick precision for `g1` and `g2` such that:\n //\n // abs(g1) < n\n // abs(g2) < n\n //\n // This ensures maximum precision for the constants\n // while also ensuring they fit into a fixed number\n // of scalar limbs in more optimized implementations.\n //\n // Furthermore, we attempt to align to a limb width\n // of 64 bits. This allows us to optimize the shift,\n // a la libsecp256k1[1].\n //\n // [1] https://github.com/bitcoin-core/secp256k1/pull/822\n assert(Array.isArray(basis));\n assert(basis.length === 2);\n assert(basis[0] instanceof Vector);\n assert(basis[1] instanceof Vector);\n\n const [v1, v2] = basis;\n const d = v1.a.mul(v2.b).isub(v1.b.mul(v2.a));\n const bits = d.bitLength();\n const align = bits >= 160;\n\n assert(d.eq(this.n));\n\n // Start with a rough estimate.\n let shift = bits + Math.ceil(bits / 2) + 1;\n let g1, g2;\n\n if (align)\n shift -= shift & 63;\n\n while (shift > bits) {\n g1 = v2.b.ushln(shift).divRound(d);\n g2 = v1.b.ushln(shift).divRound(d);\n\n if (g1.ucmp(d) < 0 && g2.ucmp(d) < 0)\n break;\n\n if (align)\n shift -= 64;\n else\n shift -= 1;\n }\n\n if (shift <= bits)\n throw new Error('Could not calculate g1 and g2.');\n\n return [shift, g1, g2];\n }\n\n _endoSplit(k) {\n // Balanced length-two representation of a multiplier.\n //\n // [GECC] Algorithm 3.74, Page 127, Section 3.5.\n //\n // Also note that it is possible to precompute[1]\n // values in order to avoid the division[2][3][4].\n //\n // This involves precomputing `g1` and `g2 (see\n // above). `c1` and `c2` can then be computed as\n // follows:\n //\n // t = ceil(log2(n+1)) + p\n // c1 = (k * g1) >> t\n // c2 = -((k * g2) >> t)\n //\n // Where `>>` is an _unsigned_ right shift. Also\n // note that the last bit discarded in the shift\n // must be stored. If it is 1, then add 1 to the\n // scalar (absolute addition).\n //\n // It's worth noting that libsecp256k1 uses a\n // different calculation along the lines of:\n //\n // t = ceil(log2(n+1)) + p\n // c1 = ((k * g1) >> t) * -b1\n // c2 = ((k * -g2) >> t) * -b2\n // k2 = c1 + c2\n // k1 = k2 * -lambda + k\n //\n // So, in the future, we can consider changing\n // step 4 to:\n //\n // 4. Compute c1 = (k * g1) >> t\n // and c2 = -((k * g2) >> t).\n //\n // const [shift, g1, g2] = this.endo.pre;\n // const c1 = k.mulShift(g1, shift);\n // const c2 = k.mulShift(g2, shift).ineg();\n //\n // Once we're brave enough, that is.\n //\n // [1] [JCEN12] Page 5, Section 4.3.\n // [2] https://github.com/bitcoin-core/secp256k1/blob/0b70241/src/scalar_impl.h#L259\n // [3] https://github.com/bitcoin-core/secp256k1/pull/21\n // [4] https://github.com/bitcoin-core/secp256k1/pull/127\n assert(k instanceof BN);\n assert(!k.red);\n assert(!this.n.isZero());\n\n const [v1, v2] = this.endo.basis;\n\n // 4. Compute c1 = round(b2 * k / n)\n // and c2 = round(-b1 * k / n).\n const c1 = v2.b.mul(k).divRound(this.n);\n const c2 = v1.b.neg().mul(k).divRound(this.n);\n\n // 5. Compute k1 = k - c1 * a1 - c2 * a2\n // and k2 = -c1 * b1 - c2 * b2.\n const p1 = c1.mul(v1.a);\n const p2 = c2.mul(v2.a);\n const q1 = c1.ineg().mul(v1.b);\n const q2 = c2.mul(v2.b);\n\n // Calculate answer.\n const k1 = k.sub(p1).isub(p2);\n const k2 = q1.isub(q2);\n\n // 6. Return (k1, k2).\n return [k1, k2];\n }\n\n _endoBeta(point) {\n assert(point instanceof ShortPoint);\n return [point, point._getBeta()];\n }\n\n _endoWnafMulAdd(points, coeffs) {\n // Point multiplication with efficiently computable endomorphisms.\n //\n // [GECC] Algorithm 3.77, Page 129, Section 3.5.\n // [GLV] Page 193, Section 3 (Using Efficient Endomorphisms).\n //\n // Note it may be possible to do this 4-dimensionally [4GLV].\n assert(Array.isArray(points));\n assert(Array.isArray(coeffs));\n assert(points.length === coeffs.length);\n assert(this.endo != null);\n\n const len = points.length;\n const npoints = new Array(len * 2);\n const ncoeffs = new Array(len * 2);\n\n for (let i = 0; i < len; i++) {\n const [p1, p2] = this._endoBeta(points[i]);\n const [k1, k2] = this._endoSplit(coeffs[i]);\n\n npoints[i * 2 + 0] = p1;\n ncoeffs[i * 2 + 0] = k1;\n npoints[i * 2 + 1] = p2;\n ncoeffs[i * 2 + 1] = k2;\n }\n\n return this._wnafMulAdd(5, npoints, ncoeffs);\n }\n\n _sswu(u) {\n // Simplified Shallue-Woestijne-Ulas Method.\n //\n // Distribution: 3/8.\n //\n // [SSWU1] Page 15-16, Section 7. Appendix G.\n // [SSWU2] Page 5, Theorem 2.3.\n // [H2EC] \"Simplified Shallue-van de Woestijne-Ulas Method\".\n //\n // Assumptions:\n //\n // - a != 0, b != 0.\n // - Let z be a non-square in F(p).\n // - z != -1.\n // - The polynomial g(x) - z is irreducible over F(p).\n // - g(b / (z * a)) is square in F(p).\n // - u != 0, u != +-sqrt(-1 / z).\n //\n // Map:\n //\n // g(x) = x^3 + a * x + b\n // t1 = 1 / (z^2 * u^4 + z * u^2)\n // x1 = (-b / a) * (1 + t1)\n // x1 = b / (z * a), if t1 = 0\n // x2 = z * u^2 * x1\n // x = x1, if g(x1) is square\n // = x2, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const {b, z, ai, zi, one} = this;\n const z2 = z.redSqr();\n const ba = b.redNeg().redMul(ai);\n const bza = b.redMul(zi).redMul(ai);\n const u2 = u.redSqr();\n const u4 = u2.redSqr();\n const t0 = z2.redMul(u4).redIAdd(z.redMul(u2));\n const t1 = t0.isZero() ? t0 : t0.redInvert();\n const x1 = t1.isZero() ? bza : ba.redMul(one.redAdd(t1));\n const x2 = z.redMul(u2).redMul(x1);\n const y1 = this.solveY2(x1);\n const y2 = this.solveY2(x2);\n const alpha = y1.redIsSquare() | 0;\n const x = [x1, x2][alpha ^ 1];\n const y = [y1, y2][alpha ^ 1].redSqrt();\n\n if (y.redIsOdd() !== u.redIsOdd())\n y.redINeg();\n\n return this.point(x, y);\n }\n\n _sswui(p, hint) {\n // Inverting the Map (Simplified Shallue-Woestijne-Ulas).\n //\n // Assumptions:\n //\n // - a^2 * x^2 - 2 * a * b * x - 3 * b^2 is square in F(p).\n // - If r < 3 then x != -b / a.\n //\n // Unlike SVDW, the preimages here are evenly\n // distributed (more or less). SSWU covers ~3/8\n // of the curve points. Each preimage has a 1/2\n // chance of mapping to either x1 or x2.\n //\n // Assuming the point is within that set, each\n // point has a 1/4 chance of inverting to any\n // of the preimages. This means we can simply\n // randomly select a preimage if one exists.\n //\n // However, the [SVDW2] sampling method seems\n // slighly faster in practice for [SQUARED].\n //\n // Map:\n //\n // c = sqrt(a^2 * x^2 - 2 * a * b * x - 3 * b^2)\n // u1 = -(a * x + b - c) / (2 * (a * x + b) * z)\n // u2 = -(a * x + b + c) / (2 * (a * x + b) * z)\n // u3 = -(a * x + b - c) / (2 * b * z)\n // u4 = -(a * x + b + c) / (2 * b * z)\n // r = random integer in [1,4]\n // u = sign(y) * abs(sqrt(ur))\n const {a, b, z} = this;\n const {x, y} = p;\n const r = hint & 3;\n const a2x2 = a.redSqr().redMul(x.redSqr());\n const abx2 = a.redMul(b).redMul(x).redIMuln(2);\n const b23 = b.redSqr().redMuln(3);\n const axb = a.redMul(x).redIAdd(b);\n const c = a2x2.redISub(abx2).redISub(b23).redSqrt();\n const n0 = axb.redSub(c).redINeg();\n const n1 = axb.redAdd(c).redINeg();\n const d0 = axb.redMul(z).redIMuln(2);\n const d1 = b.redMul(z).redIMuln(2);\n const n = [n0, n1][r & 1]; // r = 1 or 3\n const d = [d0, d1][r >>> 1]; // r = 2 or 3\n const u = n.redDivSqrt(d);\n\n if (u.redIsOdd() !== y.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n _svdwf(u) {\n // Shallue-van de Woestijne Method.\n //\n // Distribution: 9/16.\n //\n // [SVDW1] Section 5.\n // [SVDW2] Page 8, Section 3.\n // Page 15, Section 6, Algorithm 1.\n // [H2EC] \"Shallue-van de Woestijne Method\".\n //\n // Assumptions:\n //\n // - p = 1 (mod 3).\n // - a = 0, b != 0.\n // - Let z be a unique element in F(p).\n // - g((sqrt(-3 * z^2) - z) / 2) is square in F(p).\n // - u != 0, u != +-sqrt(-g(z)).\n //\n // Map:\n //\n // g(x) = x^3 + b\n // c = sqrt(-3 * z^2)\n // t1 = u^2 + g(z)\n // t2 = 1 / (u^2 * t1)\n // t3 = u^4 * t2 * c\n // x1 = (c - z) / 2 - t3\n // x2 = t3 - (c + z) / 2\n // x3 = z - t1^3 * t2 / (3 * z^2)\n // x = x1, if g(x1) is square\n // = x2, if g(x2) is square\n // = x3, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const {c, z, zi, i2, i3} = this;\n const gz = this.solveY2(z);\n const z3 = i3.redMul(zi.redSqr());\n const u2 = u.redSqr();\n const u4 = u2.redSqr();\n const t1 = u2.redAdd(gz);\n const u2t1 = u2.redMul(t1);\n const t2 = u2t1.isZero() ? u2t1 : u2t1.redInvert();\n const t3 = u4.redMul(t2).redMul(c);\n const t4 = t1.redSqr().redMul(t1);\n const x1 = c.redSub(z).redMul(i2).redISub(t3);\n const x2 = t3.redSub(c.redAdd(z).redMul(i2));\n const x3 = z.redSub(t4.redMul(t2).redMul(z3));\n const y1 = this.solveY2(x1);\n const y2 = this.solveY2(x2);\n const y3 = this.solveY2(x3);\n const alpha = y1.redJacobi() | 1;\n const beta = y2.redJacobi() | 1;\n const i = mod((alpha - 1) * beta, 3);\n const x = [x1, x2, x3][i];\n const y = [y1, y2, y3][i];\n\n return [x, y];\n }\n\n _svdw(u) {\n const [x, yy] = this._svdwf(u);\n const y = yy.redSqrt();\n\n if (y.redIsOdd() !== u.redIsOdd())\n y.redINeg();\n\n return this.point(x, y);\n }\n\n _svdwi(p, hint) {\n // Inverting the Map (Shallue-van de Woestijne).\n //\n // [SQUARED] Algorithm 1, Page 8, Section 3.3.\n // [SVDW2] Page 12, Section 5.\n // [SVDW3] \"Inverting the map\".\n //\n // Assumptions:\n //\n // - If r = 1 then x != -(c + z) / 2.\n // - If r = 2 then x != (c - z) / 2.\n // - If r > 2 then (t0 - t1 + t2) is square in F(p).\n // - f(f^-1(x)) = x where f is the map function.\n //\n // We use the sampling method from [SVDW2],\n // _not_ [SQUARED]. This seems to have a\n // better distribution in practice.\n //\n // Note that [SVDW3] also appears to be\n // incorrect in terms of distribution.\n //\n // The distribution of f(u), assuming u is\n // random, is (1/2, 1/4, 1/4).\n //\n // To mirror this, f^-1(x) should simply\n // pick (1/2, 1/4, 1/8, 1/8).\n //\n // To anyone running the forward map, our\n // strings will appear to be random.\n //\n // Map:\n //\n // g(x) = x^3 + b\n // c = sqrt(-3 * z^2)\n // t0 = 9 * (x^2 * z^2 + z^4)\n // t1 = 18 * x * z^3\n // t2 = 12 * g(z) * (x - z)\n // t3 = sqrt(t0 - t1 + t2)\n // t4 = t3 * z\n // u1 = g(z) * (c - 2 * x - z) / (c + 2 * x + z)\n // u2 = g(z) * (c + 2 * x + z) / (c - 2 * x - z)\n // u3 = (3 * (z^3 - x * z^2) - 2 * g(z) + t4) / 2\n // u4 = (3 * (z^3 - x * z^2) - 2 * g(z) - t4) / 2\n // r = random integer in [1,4]\n // u = sign(y) * abs(sqrt(ur))\n const {b, c, z, zero, two} = this;\n const {x, y} = p;\n const r = hint & 3;\n const z2 = z.redSqr();\n const z3 = z2.redMul(z);\n const z4 = z2.redSqr();\n const gz = z3.redAdd(b);\n const gz2 = gz.redMuln(2);\n const xx = x.redSqr();\n const x2z = x.redMuln(2).redIAdd(z);\n const xz2 = x.redMul(z2);\n const c0 = c.redSub(x2z);\n const c1 = c.redAdd(x2z);\n const t0 = xx.redMul(z2).redIAdd(z4).redIMuln(9);\n const t1 = x.redMul(z3).redIMuln(18);\n const t2 = gz.redMul(x.redSub(z)).redIMuln(12);\n const t3 = r >= 2 ? t0.redISub(t1).redIAdd(t2).redSqrt() : zero;\n const t4 = t3.redMul(z);\n const t5 = z3.redISub(xz2).redIMuln(3).redISub(gz2);\n const n0 = gz.redMul(c0);\n const n1 = gz.redMul(c1);\n const n2 = t5.redAdd(t4);\n const n3 = t5.redSub(t4);\n const d2 = two;\n const n = [n0, n1, n2, n3][r];\n const d = [c1, c0, d2, d2][r];\n const u = n.redDivSqrt(d);\n const [x0] = this._svdwf(u);\n\n if (!x0.eq(x))\n throw new Error('Invalid point.');\n\n if (u.redIsOdd() !== y.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n isElliptic() {\n const {a, b} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const d = b2.redMuln(27).redIAdd(a3.redMuln(4));\n\n // 4 * a^3 + 27 * b^2 != 0\n return !d.isZero();\n }\n\n jinv() {\n // [ARITH1] Page 71, Section 4.4.\n // http://mathworld.wolfram.com/j-Invariant.html\n const {a, b} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const t0 = a3.redMuln(4);\n const lhs = t0.redMuln(1728);\n const rhs = b2.redMuln(27).redIAdd(t0);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // (1728 * 4 * a^3) / (4 * a^3 + 27 * b^2)\n return lhs.redDiv(rhs).fromRed();\n }\n\n point(x, y) {\n return new ShortPoint(this, x, y);\n }\n\n jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n }\n\n solveX(y) {\n assert(y instanceof BN);\n\n if (!this.a.isZero())\n throw new Error('Not implemented.');\n\n // x^3 = y^2 - b\n const y2 = y.redSqr();\n const x3 = y2.redSub(this.b);\n\n return cubeRoots(x3);\n }\n\n solveY2(x) {\n // [GECC] Page 89, Section 3.2.2.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw.html\n assert(x instanceof BN);\n\n // y^2 = x^3 + a * x + b\n const x3 = x.redSqr().redMul(x);\n const y2 = x3.redIAdd(this.b);\n\n if (!this.zeroA) {\n // Save some cycles for a = -3.\n if (this.threeA)\n y2.redIAdd(x.redMuln(-3));\n else\n y2.redIAdd(this.a.redMul(x));\n }\n\n return y2;\n }\n\n validate(point) {\n assert(point instanceof ShortPoint);\n\n if (point.inf)\n return true;\n\n const {x, y} = point;\n const y2 = this.solveY2(x);\n\n return y.redSqr().eq(y2);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (this.h.cmpn(1) > 0) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n }\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n pointFromY(y, index = 0) {\n assert(y instanceof BN);\n assert((index >>> 0) === index);\n\n if (!y.red)\n y = y.toRed(this.red);\n\n const coords = this.solveX(y);\n\n if (index >= coords.length)\n throw new Error('Invalid X coordinate index.');\n\n const x = coords[index];\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve) {\n // [GECC] Page 84, Section 3.1.5.\n // [ARITH1] Page 286, Section 13.2.3.c.\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n let u2, u3;\n try {\n [u2, u3] = this._scale(curve);\n } catch (e) {\n return false;\n }\n\n // E(a,b) <-> E(au^4,bu^6)\n if (curve.type === 'short') {\n // a' = a * u^4, b' = b * u^6\n const a = this.field(curve.a).redMul(u2.redSqr());\n const b = this.field(curve.b).redMul(u3.redSqr());\n\n return this.a.eq(a) && this.b.eq(b);\n }\n\n // E(a,b) <-> M(A,B)\n if (curve.type === 'mont') {\n // (A / (3 * B))^3 + a * (A / (3 * B)) + b = 0\n const {a3, bi} = curve;\n const x = this.field(a3.redMul(bi)).redMul(u2);\n const y2 = this.solveY2(x);\n\n return y2.isZero();\n }\n\n // E(a,b) <-> E(a,d)\n if (curve.type === 'edwards') {\n // ((a' + d') / 6)^3 + a * ((a' + d') / 6) + b = 0\n const x = this.field(curve.ad6).redMul(u2);\n const y2 = this.solveY2(x);\n\n return y2.isZero();\n }\n\n return false;\n }\n\n isIsogenous(curve) {\n assert(curve instanceof Curve);\n return false;\n }\n\n pointFromShort(point) {\n // [GECC] Page 84, Section 3.1.5.\n // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves).\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for E(a,b)<->E(au^4,bu^6):\n //\n // x' = x * u^2\n // y' = y * u^3\n //\n // Where a * u^4 = a' and b * u^6 = b'.\n if (point.isInfinity())\n return this.point();\n\n const [u2, u3] = this._scale(point.curve);\n const x = this.field(point.x);\n const y = this.field(point.y);\n const nx = x.redMul(u2);\n const ny = y.redMul(u3);\n\n return this.point(nx, ny);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [ALT] Appendix E.2 (Switching between Alternative Representations).\n // [MONT2] \"Equivalence with Weierstrass curves\"\n assert(point instanceof MontPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for M(A,B)->E(a,b):\n //\n // x = (u + A / 3) / B\n // y = v / B\n //\n // Undefined if ((u^3 + A * u^2 + u) / B) is not square.\n if (point.isInfinity())\n return this.point();\n\n const {a3, bi} = point.curve;\n const [u2, u3] = this._scale(point.curve);\n const nx = point.x.redAdd(a3).redMul(bi);\n const ny = point.y.redMul(bi);\n\n return this.point(this.field(nx).redMul(u2),\n this.field(ny).redMul(u3));\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [TWISTEQ] Section 2.\n assert(point instanceof EdwardsPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,d)->E(a',b'):\n //\n // x' = ((5 * d - a) * y + d - 5 * a) / (12 * (y - 1))\n // y' = (d - a) * (y + 1) / (4 * x * (y - 1))\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> ((a + d) / 6, 0)\n //\n // Unexceptional Cases:\n // - (sqrt(1 / a), 0) -> ((5 * a - d) / 12, (a - d) / 4 * sqrt(a))\n const {a, d, ad6} = point.curve;\n const [u2, u3] = this._scale(point.curve);\n\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero()) {\n const x = this.field(ad6).redMul(u2);\n return this.point(x, this.zero);\n }\n\n const {x, y, z} = point;\n const a5 = a.redMuln(5);\n const d5 = d.redMuln(5);\n const dma = d.redSub(a);\n const d5a = d5.redSub(a);\n const da5 = d.redSub(a5);\n const ypz = y.redAdd(z);\n const ymz = y.redSub(z);\n const xx = d5a.redMul(y).redIAdd(da5.redMul(z));\n const xz = ymz.redMuln(12);\n const yy = dma.redMul(ypz).redMul(z);\n const yz = ymz.redMul(x).redIMuln(4);\n\n return this.cpoint(this.field(xx).redMul(u2),\n this.field(xz),\n this.field(yy).redMul(u3),\n this.field(yz));\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n assert(u instanceof BN);\n\n // z = 0 or b = 0\n if (this.z.isZero() || this.b.isZero())\n throw new Error('Not implemented.');\n\n // a != 0, b != 0\n if (!this.a.isZero())\n return this._sswu(u);\n\n // p = 1 mod 3, a = 0, b != 0\n if (!this.c.isZero())\n return this._svdw(u);\n\n throw new Error('Not implemented.');\n }\n\n pointToUniform(p, hint) {\n // Convert a short weierstrass point to a field\n // element by inverting either the SSWU or SVDW\n // map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof ShortPoint);\n assert((hint >>> 0) === hint);\n\n // z = 0 or b = 0\n if (this.z.isZero() || this.b.isZero())\n throw new Error('Not implemented.');\n\n // P = O\n if (p.isInfinity())\n throw new Error('Invalid point.');\n\n // Add a random torsion component.\n const i = ((hint >>> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n return wrapErrors(() => {\n // a != 0, b != 0\n if (!this.a.isZero())\n return this._sswui(q, hint);\n\n // p = 1 mod 3, a = 0, b != 0\n if (!this.c.isZero())\n return this._svdwi(q, hint);\n\n throw new Error('Not implemented.');\n });\n }\n\n mulAll(points, coeffs) {\n return super.mulAll(points, coeffs).toP();\n }\n\n affinizeAll(points) {\n const out = this.normalizeAll(points);\n\n for (let i = 0; i < out.length; i++)\n out[i] = out[i].toP();\n\n return out;\n }\n\n decodePoint(bytes) {\n return ShortPoint.decode(this, bytes);\n }\n\n encodeX(point) {\n assert(point instanceof Point);\n return point.encodeX();\n }\n\n decodeEven(bytes) {\n return ShortPoint.decodeEven(this, bytes);\n }\n\n decodeSquare(bytes) {\n return ShortPoint.decodeSquare(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromShort(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, odd, sign = null) {\n const [a, b] = this._mont(b0, odd);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = this._scale(curve);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromShort(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, odd, sign = null) {\n const [a, d] = this._edwards(a0, odd);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = this._scale(curve);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromShort(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return ShortPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n\n json.a = this.a.fromRed().toJSON();\n json.b = this.b.fromRed().toJSON();\n\n if (!this.c.isZero())\n json.c = this.c.fromRed().toJSON();\n\n return json;\n }\n}\n\n/**\n * ShortPoint\n */\n\nclass ShortPoint extends Point {\n constructor(curve, x, y) {\n assert(curve instanceof ShortCurve);\n\n super(curve, types.AFFINE);\n\n this.x = this.curve.zero;\n this.y = this.curve.zero;\n this.inf = true;\n\n if (x != null)\n this._init(x, y);\n }\n\n _init(x, y) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n\n this.x = x;\n this.y = y;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n this.inf = false;\n }\n\n _getBeta() {\n if (!this.curve.endo)\n return null;\n\n if (this.pre && this.pre.beta)\n return this.pre.beta;\n\n // Augment the point with our beta value.\n // This is the counterpart to `k2` after\n // the endomorphism split of `k`.\n //\n // Note that if we have precomputation,\n // we have to clone and update all of the\n // precomputed points below.\n const xb = this.x.redMul(this.curve.endo.beta);\n const beta = this.curve.point(xb, this.y);\n\n if (this.pre) {\n beta.pre = this.pre.map((point) => {\n const xb = point.x.redMul(this.curve.endo.beta);\n return this.curve.point(xb, point.y);\n });\n\n this.pre.beta = beta;\n }\n\n return beta;\n }\n\n _getJNAF(point) {\n assert(point instanceof ShortPoint);\n\n if (this.inf || point.inf)\n return super._getJNAF(point);\n\n // Create comb for JSF.\n const comb = [\n this, // 1\n null, // 3\n null, // 5\n point // 7\n ];\n\n // Try to avoid Jacobian points, if possible.\n if (this.y.eq(point.y)) {\n comb[1] = this.add(point);\n comb[2] = this.toJ().sub(point);\n } else if (this.y.eq(point.y.redNeg())) {\n comb[1] = this.toJ().add(point);\n comb[2] = this.sub(point);\n } else {\n comb[1] = this.toJ().add(point);\n comb[2] = this.toJ().sub(point);\n }\n\n return comb;\n }\n\n clone() {\n if (this.inf)\n return this.curve.point();\n\n return this.curve.point(this.x, this.y);\n }\n\n scale(a) {\n return this.toJ().scale(a);\n }\n\n neg() {\n // P = O\n if (this.inf)\n return this;\n\n // -(X1, Y1) = (X1, -Y1)\n return this.curve.point(this.x, this.y.redNeg());\n }\n\n add(p) {\n // [GECC] Page 80, Section 3.1.2.\n //\n // Addition Law:\n //\n // l = (y1 - y2) / (x1 - x2)\n // x3 = l^2 - x1 - x2\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 1S + 6A\n assert(p instanceof ShortPoint);\n\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P, P + -P\n if (this.x.eq(p.x)) {\n // P + -P = O\n if (!this.y.eq(p.y))\n return this.curve.point();\n\n // P + P = 2P\n return this.dbl();\n }\n\n // X1 != X2, Y1 = Y2\n if (this.y.eq(p.y)) {\n // X3 = -X1 - X2\n const nx = this.x.redNeg().redISub(p.x);\n\n // Y3 = -Y1\n const ny = this.y.redNeg();\n\n // Skip the inverse.\n return this.curve.point(nx, ny);\n }\n\n // H = X1 - X2\n const h = this.x.redSub(p.x);\n\n // R = Y1 - Y2\n const r = this.y.redSub(p.y);\n\n // L = R / H\n const l = r.redDiv(h);\n\n // X3 = L^2 - X1 - X2\n const nx = l.redSqr().redISub(this.x).redISub(p.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dbl() {\n // [GECC] Page 80, Section 3.1.2.\n //\n // Addition Law (doubling):\n //\n // l = (3 * x1^2 + a) / (2 * y1)\n // x3 = l^2 - 2 * x1\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 2S + 3A + 2*2 + 1*3\n\n // P = O\n if (this.inf)\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.point();\n\n // XX = X1^2\n const xx = this.x.redSqr();\n\n // M = 3 * XX + a\n const m = xx.redIMuln(3).redIAdd(this.curve.a);\n\n // Z = 2 * Y1\n const z = this.y.redMuln(2);\n\n // L = M / Z\n const l = m.redDiv(z);\n\n // X3 = L^2 - 2 * X1\n const nx = l.redSqr().redISub(this.x).redISub(this.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dblp(pow) {\n return this.toJ().dblp(pow).toP();\n }\n\n getX() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof ShortPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.inf)\n return p.inf;\n\n // Q = O\n if (p.inf)\n return false;\n\n // X1 = X2, Y1 = Y2\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n cmp(point) {\n assert(point instanceof ShortPoint);\n\n if (this.inf && !point.inf)\n return -1;\n\n if (!this.inf && point.inf)\n return 1;\n\n if (this.inf && point.inf)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Infinity cannot be represented in\n // the affine space, except by a flag.\n return this.inf;\n }\n\n isOrder2() {\n if (this.inf)\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.inf)\n return false;\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.inf)\n return false;\n\n return this.y.redIsEven();\n }\n\n isSquare() {\n if (this.inf)\n return false;\n\n return this.y.redJacobi() !== -1;\n }\n\n eqX(x) {\n assert(x instanceof BN);\n assert(!x.red);\n\n if (this.inf)\n return false;\n\n return this.getX().eq(x);\n }\n\n eqR(x) {\n assert(x instanceof BN);\n assert(!x.red);\n assert(!this.curve.n.isZero());\n\n if (this.inf)\n return false;\n\n return this.getX().imod(this.curve.n).eq(x);\n }\n\n mul(k) {\n return super.mul(k).toP();\n }\n\n muln(k) {\n return super.muln(k).toP();\n }\n\n mulBlind(k, rng) {\n return super.mulBlind(k, rng).toP();\n }\n\n mulAdd(k1, p2, k2) {\n return super.mulAdd(k1, p2, k2).toP();\n }\n\n mulH() {\n return super.mulH().toP();\n }\n\n div(k) {\n return super.div(k).toP();\n }\n\n divn(k) {\n return super.divn(k).toP();\n }\n\n divH() {\n return super.divH().toP();\n }\n\n toP() {\n return this;\n }\n\n toJ() {\n // (X3, Y3, Z3) = (1, 1, 0)\n if (this.inf)\n return this.curve.jpoint();\n\n // (X3, Y3, Z3) = (X1, Y1, 1)\n return this.curve.jpoint(this.x, this.y, this.curve.one);\n }\n\n encode(compact) {\n // [SEC1] Page 10, Section 2.3.3.\n if (compact == null)\n compact = true;\n\n assert(typeof compact === 'boolean');\n\n const {fieldSize} = this.curve;\n\n // We do not serialize points at infinity.\n if (this.inf)\n throw new Error('Invalid point.');\n\n // Compressed form (0x02 = even, 0x03 = odd).\n if (compact) {\n const p = Buffer.alloc(1 + fieldSize);\n const x = this.curve.encodeField(this.getX());\n\n p[0] = 0x02 | this.y.redIsOdd();\n x.copy(p, 1);\n\n return p;\n }\n\n // Uncompressed form (0x04).\n const p = Buffer.alloc(1 + fieldSize * 2);\n const x = this.curve.encodeField(this.getX());\n const y = this.curve.encodeField(this.getY());\n\n p[0] = 0x04;\n x.copy(p, 1);\n y.copy(p, 1 + fieldSize);\n\n return p;\n }\n\n static decode(curve, bytes) {\n // [SEC1] Page 11, Section 2.3.4.\n assert(curve instanceof ShortCurve);\n assert(Buffer.isBuffer(bytes));\n\n const len = curve.fieldSize;\n\n if (bytes.length < 1 + len)\n throw new Error('Not a point.');\n\n // Point forms:\n //\n // 0x00 -> Infinity (openssl, unsupported)\n // 0x02 -> Compressed Even\n // 0x03 -> Compressed Odd\n // 0x04 -> Uncompressed\n // 0x06 -> Hybrid Even (openssl)\n // 0x07 -> Hybrid Odd (openssl)\n //\n // Note that openssl supports serializing points\n // at infinity as {0}. We choose not to support it\n // because it's strange and not terribly useful.\n const form = bytes[0];\n\n switch (form) {\n case 0x02:\n case 0x03: {\n if (bytes.length !== 1 + len)\n throw new Error('Invalid point size for compressed.');\n\n const x = curve.decodeField(bytes.slice(1, 1 + len));\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n const p = curve.pointFromX(x, form === 0x03);\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n case 0x04:\n case 0x06:\n case 0x07: {\n if (bytes.length !== 1 + len * 2)\n throw new Error('Invalid point size for uncompressed.');\n\n const x = curve.decodeField(bytes.slice(1, 1 + len));\n const y = curve.decodeField(bytes.slice(1 + len, 1 + 2 * len));\n\n // [GECC] Algorithm 4.3, Page 180, Section 4.\n if (x.cmp(curve.p) >= 0 || y.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n // OpenSSL hybrid encoding.\n if (form !== 0x04 && form !== (0x06 | y.isOdd()))\n throw new Error('Invalid hybrid encoding.');\n\n const p = curve.point(x, y);\n\n if (!p.validate())\n throw new Error('Invalid point.');\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n default: {\n throw new Error('Unknown point format.');\n }\n }\n }\n\n encodeX() {\n // [SCHNORR] \"Specification\".\n // [BIP340] \"Specification\".\n return this.curve.encodeField(this.getX());\n }\n\n static decodeEven(curve, bytes) {\n // [BIP340] \"Specification\".\n assert(curve instanceof ShortCurve);\n\n const x = curve.decodeField(bytes);\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromX(x, false);\n }\n\n static decodeSquare(curve, bytes) {\n // [SCHNORR] \"Specification\".\n assert(curve instanceof ShortCurve);\n\n const x = curve.decodeField(bytes);\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromX(x);\n }\n\n toJSON(pre) {\n if (this.inf)\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n if (pre === true && this.pre)\n return [x, y, this.pre.toJSON()];\n\n return [x, y];\n }\n\n toPretty() {\n if (this.inf)\n return [];\n\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof ShortCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n const point = curve.point(x, y);\n\n if (json.length > 2 && json[2] != null)\n point.pre = Precomp.fromJSON(point, json[2]);\n\n return point;\n }\n\n [custom]() {\n if (this.inf)\n return '';\n\n return '';\n }\n}\n\n/**\n * JPoint\n */\n\nclass JPoint extends Point {\n constructor(curve, x, y, z) {\n assert(curve instanceof ShortCurve);\n\n super(curve, types.JACOBIAN);\n\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = this.curve.zero;\n this.zOne = false;\n\n if (x != null)\n this._init(x, y, z);\n }\n\n _init(x, y, z) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n assert(z == null || (z instanceof BN));\n\n this.x = x;\n this.y = y;\n this.z = z || this.curve.one;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z.eq(this.curve.one);\n }\n\n clone() {\n return this.curve.jpoint(this.x, this.y, this.z);\n }\n\n validate() {\n // [GECC] Example 3.20, Page 88, Section 3.\n const {a, b} = this.curve;\n\n // P = O\n if (this.isInfinity())\n return true;\n\n // Z1 = 1\n if (this.zOne)\n return this.curve.validate(this.toP());\n\n // y^2 = x^3 + a * x * z^4 + b * z^6\n const lhs = this.y.redSqr();\n const x3 = this.x.redSqr().redMul(this.x);\n const z2 = this.z.redSqr();\n const z4 = z2.redSqr();\n const z6 = z4.redMul(z2);\n const rhs = x3.redIAdd(b.redMul(z6));\n\n if (!this.curve.zeroA) {\n // Save some cycles for a = -3.\n if (this.curve.threeA)\n rhs.redIAdd(z4.redIMuln(-3).redMul(this.x));\n else\n rhs.redIAdd(a.redMul(z4).redMul(this.x));\n }\n\n return lhs.eq(rhs);\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#scaling-z\n // 1I + 3M + 1S\n\n // Z = 1\n if (this.zOne)\n return this;\n\n // P = O\n if (this.isInfinity())\n return this;\n\n // A = 1 / Z1\n const a = this.z.redInvert();\n\n // AA = A^2\n const aa = a.redSqr();\n\n // X3 = X1 * AA\n this.x = this.x.redMul(aa);\n\n // Y3 = Y1 * AA * A\n this.y = this.y.redMul(aa).redMul(a);\n\n // Z3 = 1\n this.z = this.curve.one;\n this.zOne = true;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // P = O\n if (this.isInfinity())\n return this.curve.jpoint();\n\n // AA = A^2\n const aa = a.redSqr();\n\n // X3 = X1 * AA\n const nx = this.x.redMul(aa);\n\n // Y3 = Y1 * AA * A\n const ny = this.y.redMul(aa).redMul(a);\n\n // Z3 = Z1 * A\n const nz = this.z.redMul(a);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n neg() {\n // -(X1, Y1, Z1) = (X1, -Y1, Z1)\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }\n\n add(p) {\n assert(p instanceof Point);\n\n if (p.type === types.AFFINE)\n return this._mixedAdd(p);\n\n return this._add(p);\n }\n\n _add(p) {\n assert(p instanceof JPoint);\n\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.zOne)\n return p._addJA(this);\n\n // Z2 = 1\n if (p.zOne)\n return this._addJA(p);\n\n return this._addJJ(p);\n }\n\n _mixedAdd(p) {\n assert(p instanceof ShortPoint);\n\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n return this._addJA(p);\n }\n\n _addJJ(p) {\n // No assumptions.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-1998-cmo-2\n // 12M + 4S + 6A + 1*2 (implemented as: 12M + 4S + 7A)\n\n // Z1Z1 = Z1^2\n const z1z1 = this.z.redSqr();\n\n // Z2Z2 = Z2^2\n const z2z2 = p.z.redSqr();\n\n // U1 = X1 * Z2Z2\n const u1 = this.x.redMul(z2z2);\n\n // U2 = X2 * Z1Z1\n const u2 = p.x.redMul(z1z1);\n\n // S1 = Y1 * Z2 * Z2Z2\n const s1 = this.y.redMul(p.z).redMul(z2z2);\n\n // S2 = Y2 * Z1 * Z1Z1\n const s2 = p.y.redMul(this.z).redMul(z1z1);\n\n // H = U2 - U1\n const h = u2.redISub(u1);\n\n // r = S2 - S1\n const r = s2.redISub(s1);\n\n // H = 0\n if (h.isZero()) {\n if (!r.isZero())\n return this.curve.jpoint();\n\n return this.dbl();\n }\n\n // HH = H^2\n const hh = h.redSqr();\n\n // HHH = H * HH\n const hhh = h.redMul(hh);\n\n // V = U1 * HH\n const v = u1.redMul(hh);\n\n // X3 = r^2 - HHH - 2 * V\n const nx = r.redSqr().redISub(hhh).redISub(v).redISub(v);\n\n // Y3 = r * (V - X3) - S1 * HHH\n const ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh));\n\n // Z3 = Z1 * Z2 * H\n const nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _addJA(p) {\n // Assumes Z2 = 1.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-madd\n // 8M + 3S + 6A + 5*2 (implemented as: 8M + 3S + 7A + 4*2)\n\n // Z1Z1 = Z1^2\n const z1z1 = this.z.redSqr();\n\n // U2 = X2 * Z1Z1\n const u2 = p.x.redMul(z1z1);\n\n // S2 = Y2 * Z1 * Z1Z1\n const s2 = p.y.redMul(this.z).redMul(z1z1);\n\n // H = U2 - X1\n const h = u2.redISub(this.x);\n\n // r = 2 * (S2 - Y1)\n const r = s2.redISub(this.y).redIMuln(2);\n\n // H = 0\n if (h.isZero()) {\n if (!r.isZero())\n return this.curve.jpoint();\n\n return this.dbl();\n }\n\n // I = (2 * H)^2\n const i = h.redMuln(2).redSqr();\n\n // J = H * I\n const j = h.redMul(i);\n\n // V = X1 * I\n const v = this.x.redMul(i);\n\n // X3 = r^2 - J - 2 * V\n const nx = r.redSqr().redISub(j).redISub(v).redISub(v);\n\n // Y3 = r * (V - X3) - 2 * Y1 * J\n const ny = r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2));\n\n // Z3 = 2 * Z1 * H\n const nz = this.z.redMul(h).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n dbl() {\n // P = O\n if (this.isInfinity())\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.jpoint();\n\n // a = 0\n if (this.curve.zeroA)\n return this._dbl0();\n\n // a = -3\n if (this.curve.threeA)\n return this._dbl3();\n\n return this._dblJ();\n }\n\n _dblJ() {\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-1998-cmo-2\n // 3M + 6S + 4A + 1*a + 2*2 + 1*3 + 1*4 + 1*8\n // (implemented as: 3M + 6S + 5A + 1*a + 1*2 + 1*3 + 1*4 + 1*8)\n\n // XX = X1^2\n const xx = this.x.redSqr();\n\n // YY = Y1^2\n const yy = this.y.redSqr();\n\n // ZZ = Z1^2\n const zz = this.z.redSqr();\n\n // S = 4 * X1 * YY\n const s = this.x.redMul(yy).redIMuln(4);\n\n // M = 3 * XX + a * ZZ^2\n const m = xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr()));\n\n // T = M^2 - 2 * S\n const t = m.redSqr().redISub(s).redISub(s);\n\n // X3 = T\n const nx = t;\n\n // Y3 = M * (S - T) - 8 * YY^2\n const ny = m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8));\n\n // Z3 = 2 * Y1 * Z1\n const nz = this.y.redMul(this.z).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _dbl0() {\n // Assumes a = 0.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l\n // 2M + 5S + 6A + 3*2 + 1*3 + 1*8\n // (implemented as: 2M + 5S + 7A + 2*2 + 1*3 + 1*8)\n\n // A = X1^2\n const a = this.x.redSqr();\n\n // B = Y1^2\n const b = this.y.redSqr();\n\n // C = B^2\n const c = b.redSqr();\n\n // + XB2 = (X1 + B)^2\n const xb2 = b.redIAdd(this.x).redSqr();\n\n // D = 2 * ((X1 + B)^2 - A - C)\n const d = xb2.redISub(a).redISub(c).redIMuln(2);\n\n // E = 3 * A\n const e = a.redIMuln(3);\n\n // F = E^2\n const f = e.redSqr();\n\n // X3 = F - 2 * D\n const nx = f.redISub(d).redISub(d);\n\n // Y3 = E * (D - X3) - 8 * C\n const ny = e.redMul(d.redISub(nx)).redISub(c.redIMuln(8));\n\n // Z3 = 2 * Y1 * Z1\n const nz = this.y.redMul(this.z).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _dbl3() {\n // Assumes a = -3.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S + 8A + 1*3 + 1*4 + 2*8\n // (implemented as: 3M + 5S + 8A + 1*2 + 1*3 + 1*4 + 1*8)\n\n // delta = Z1^2\n const delta = this.z.redSqr();\n\n // gamma = Y1^2\n const gamma = this.y.redSqr();\n\n // beta = X1 * gamma\n const beta = this.x.redMul(gamma);\n\n // + xmdelta = X1 - delta\n const xmdelta = this.x.redSub(delta);\n\n // + xpdelta = X1 + delta\n const xpdelta = this.x.redAdd(delta);\n\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n const alpha = xmdelta.redMul(xpdelta).redIMuln(3);\n\n // + beta4 = 4 * beta\n const beta4 = beta.redIMuln(4);\n\n // + beta8 = 2 * beta4\n const beta8 = beta4.redMuln(2);\n\n // + gamma28 = 8 * gamma^2\n const gamma28 = gamma.redSqr().redIMuln(8);\n\n // X3 = alpha^2 - 8 * beta\n const nx = alpha.redSqr().redISub(beta8);\n\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n const nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n const ny = alpha.redMul(beta4.redISub(nx)).redISub(gamma28);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n getX() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof JPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.isInfinity())\n return p.isInfinity();\n\n // Q = O\n if (p.isInfinity())\n return false;\n\n // Z1 = Z2\n if (this.z.eq(p.z)) {\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n // X1 * Z2^2 = X2 * Z1^2\n const zz1 = this.z.redSqr();\n const zz2 = p.z.redSqr();\n const x1 = this.x.redMul(zz2);\n const x2 = p.x.redMul(zz1);\n\n if (!x1.eq(x2))\n return false;\n\n // Y1 * Z2^3 = Y2 * Z1^3\n const zzz1 = zz1.redMul(this.z);\n const zzz2 = zz2.redMul(p.z);\n const y1 = this.y.redMul(zzz2);\n const y2 = p.y.redMul(zzz1);\n\n return y1.eq(y2);\n }\n\n cmp(point) {\n assert(point instanceof JPoint);\n\n const inf1 = this.isInfinity();\n const inf2 = point.isInfinity();\n\n if (inf1 && !inf2)\n return -1;\n\n if (!inf1 && inf2)\n return 1;\n\n if (inf1 && inf2)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Z1 = 0\n return this.z.isZero();\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.isInfinity())\n return false;\n\n this.normalize();\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.isInfinity())\n return false;\n\n this.normalize();\n\n return this.y.redIsEven();\n }\n\n isSquare() {\n if (this.isInfinity())\n return false;\n\n return this.y.redMul(this.z).redJacobi() !== -1;\n }\n\n eqX(x) {\n // Verify that integer `x` is equal to field\n // element `x` by scaling it by our z coordinate.\n // This optimization is mentioned in and used for\n // bip-schnorr[1]. This avoids having to affinize\n // the resulting point during verification.\n //\n // [1] [SCHNORR] \"Optimizations\".\n assert(x instanceof BN);\n assert(!x.red);\n\n if (this.isInfinity())\n return false;\n\n const zz = this.z.redSqr();\n const rx = x.toRed(this.curve.red).redMul(zz);\n\n return this.x.eq(rx);\n }\n\n eqR(x) {\n // Similar to the optimization above, this\n // optimization, suggested by Maxwell[1],\n // compares an integer to an X coordinate\n // by scaling it.\n //\n // Since a signature's R value is modulo N\n // in ECDSA, we may be dealing with an R\n // value greater than N in actuality.\n //\n // If the equality check fails, we can\n // scale N itself by Z and add it to the\n // X field element.\n //\n // [1] https://github.com/bitcoin-core/secp256k1/commit/ce7eb6f\n assert(x instanceof BN);\n assert(!x.red);\n\n if (!this.curve.smallGap)\n return this.toP().eqR(x);\n\n if (this.isInfinity())\n return false;\n\n if (x.cmp(this.curve.p) >= 0)\n return false;\n\n const zz = this.z.redSqr();\n const rx = x.toRed(this.curve.red).redMul(zz);\n\n if (this.x.eq(rx))\n return true;\n\n if (this.curve.highOrder)\n return false;\n\n if (x.cmp(this.curve.pmodn) >= 0)\n return false;\n\n const rn = this.curve.redN.redMul(zz);\n\n rx.redIAdd(rn);\n\n return this.x.eq(rx);\n }\n\n toP() {\n // P = O\n if (this.isInfinity())\n return this.curve.point();\n\n this.normalize();\n\n // (X3, Y3) = (X1 / Z1^2, Y1 / Z1^3)\n return this.curve.point(this.x, this.y);\n }\n\n toJ() {\n return this;\n }\n\n encode(compact) {\n return this.toP().encode(compact);\n }\n\n static decode(curve, bytes) {\n return ShortPoint.decode(curve, bytes).toJ();\n }\n\n encodeX() {\n return this.toP().encodeX();\n }\n\n static decodeEven(curve, bytes) {\n return ShortPoint.decodeEven(curve, bytes).toJ();\n }\n\n static decodeSquare(curve, bytes) {\n return ShortPoint.decodeSquare(curve, bytes).toJ();\n }\n\n toJSON(pre) {\n return this.toP().toJSON(pre);\n }\n\n toPretty() {\n return this.toP().toPretty();\n }\n\n static fromJSON(curve, json) {\n return ShortPoint.fromJSON(curve, json).toJ();\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * MontCurve\n */\n\nclass MontCurve extends Curve {\n constructor(conf) {\n super(MontPoint, 'mont', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.b = BN.fromJSON(conf.b).toRed(this.red);\n\n this.bi = this.b.redInvert();\n this.a2 = this.a.redAdd(this.two);\n this.a24 = this.a2.redMul(this.i4);\n this.a3 = this.a.redMul(this.i3);\n this.a0 = this.a.redMul(this.bi);\n this.b0 = this.bi.redSqr();\n\n this._finalize(conf);\n }\n\n static _isomorphism(curveA, curveB, customB) {\n // Montgomery Isomorphism.\n //\n // [MONT3] Page 3, Section 2.1.\n //\n // Transformation:\n //\n // A' = A\n // B' = B'\n //\n // Where (B / B') is square.\n assert(curveA instanceof BN);\n assert(curveB instanceof BN);\n assert(customB instanceof BN);\n\n const a = curveA.clone();\n const b = customB.clone();\n const c = curveB.redDiv(customB);\n\n if (c.redJacobi() !== 1)\n throw new Error('Invalid `b` coefficient.');\n\n return [a, b];\n }\n\n _short(a0, odd) {\n // Montgomery->Short Weierstrass Equivalence.\n //\n // [MONT2] \"Equivalence with Weierstrass curves\".\n //\n // Transformation:\n //\n // a = (3 - A^2) / (3 * B^2)\n // b = (2 * A^3 - 9 * A) / (27 * B^3)\n const {a, b, three} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const b3 = b2.redMul(b);\n const n0 = three.redSub(a2);\n const d0 = b2.redMuln(3);\n const n1 = a3.redMuln(2).redISub(a.redMuln(9));\n const d1 = b3.redMuln(27);\n const wa = n0.redDiv(d0);\n const wb = n1.redDiv(d1);\n\n if (a0 != null)\n return ShortCurve._isomorphism(wa, wb, a0, odd);\n\n return [wa, wb];\n }\n\n _mont(b0) {\n return MontCurve._isomorphism(this.a, this.b, b0);\n }\n\n _edwards(a0, invert = false) {\n // Montgomery->Twisted Edwards Transformation.\n //\n // [MONT1] Page 11, Section 4.3.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n //\n // Equivalence:\n //\n // a = (A + 2) / B\n // d = (A - 2) / B\n //\n // Isomorphism:\n //\n // a = a'\n // d = a' * (A - 2) / (A + 2)\n //\n // Where ((A + 2) / (B * a')) is square.\n //\n // If `d` is square, we can usually find\n // a complete curve by using the `invert`\n // option. This will create an isomorphism\n // chain of: M(A,B)->E(a,d)->E(d,a).\n //\n // The equivalence between E(a,d) and\n // E(d,a) is:\n //\n // (x, y) = (x, 1 / y)\n //\n // Meaning our map to E(d,a) is:\n //\n // x = u / v\n // y = 1 / ((u - 1) / (u + 1))\n // = (u + 1) / (u - 1)\n assert(typeof invert === 'boolean');\n\n const {two, bi} = this;\n const a = this.a.redAdd(two).redMul(bi);\n const d = this.a.redSub(two).redMul(bi);\n\n if (invert)\n a.swap(d);\n\n if (a0 != null)\n return EdwardsCurve._isomorphism(a, d, a0);\n\n return [a, d];\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n const [u2, u3] = curve._scale(this);\n\n return [this.field(u2.redInvert()),\n this.field(u3.redInvert())];\n }\n\n _scaleMont(curve) {\n // We can extract the isomorphism factor with:\n //\n // c = +-sqrt(B / B')\n //\n // If base points are available, we can do:\n //\n // c = v' / v\n assert(curve instanceof MontCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this.field(curve.b).redDivSqrt(this.b);\n\n return this.g.y.redDiv(this.field(curve.g.y));\n }\n\n _scaleEdwards(curve, invert) {\n // We _could_ do something like:\n //\n // B = 4 / (a - d)\n // c = +-sqrt(B / B')\n //\n // Which can be reduced to:\n //\n // c = +-sqrt(4 / ((a - d) * B'))\n //\n // If base points are available:\n //\n // v = u' / x\n // c = v' / v\n //\n // Which can be reduced to:\n //\n // c = v' * x / u'\n //\n // However, the way our maps are\n // written, we can re-use the Edwards\n // isomorphism factor when going the\n // other direction.\n assert(curve instanceof EdwardsCurve);\n\n const c = curve._scale(this, invert);\n\n return this.field(c);\n }\n\n _solveY0(x) {\n assert(x instanceof BN);\n\n // y^2 = x^3 + A * x^2 + B * x\n const a = this.a0;\n const b = this.b0;\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const y2 = x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x));\n\n return y2;\n }\n\n _elligator2(u) {\n // Elligator 2.\n //\n // Distribution: 1/2.\n //\n // [ELL2] Page 11, Section 5.2.\n // [H2EC] \"Elligator 2 Method\".\n // \"Mappings for Montgomery curves\".\n // [SAFE] \"Indistinguishability from uniform random strings\".\n //\n // Assumptions:\n //\n // - y^2 = x^3 + A * x^2 + B * x.\n // - A != 0, B != 0.\n // - A^2 - 4 * B is non-zero and non-square in F(p).\n // - Let z be a non-square in F(p).\n // - u != +-sqrt(-1 / z).\n //\n // Note that Elligator 2 is defined over the form:\n //\n // y'^2 = x'^3 + A' * x'^2 + B' * x'\n //\n // Instead of:\n //\n // B * y^2 = x^3 + A * x^2 + x\n //\n // Where:\n //\n // A' = A / B\n // B' = 1 / B^2\n // x' = x / B\n // y' = y / B\n //\n // And:\n //\n // x = B * x'\n // y = B * y'\n //\n // This is presumably the result of Elligator 2\n // being designed in long Weierstrass form. If\n // we want to support B != 1, we need to do the\n // conversion.\n //\n // Map:\n //\n // g(x) = x^3 + A * x^2 + B * x\n // x1 = -A / (1 + z * u^2)\n // x1 = -A, if x1 = 0\n // x2 = -x1 - A\n // x = x1, if g(x1) is square\n // = x2, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const lhs = this.a0.redNeg();\n const rhs = this.one.redAdd(this.z.redMul(u.redSqr()));\n\n if (rhs.isZero())\n rhs.inject(this.one);\n\n const x1 = lhs.redMul(rhs.redInvert());\n const x2 = x1.redNeg().redISub(this.a0);\n const y1 = this._solveY0(x1);\n const y2 = this._solveY0(x2);\n const alpha = y1.redIsSquare() | 0;\n const x0 = [x1, x2][alpha ^ 1];\n const y0 = [y1, y2][alpha ^ 1].redSqrt();\n\n if (y0.redIsOdd() !== u.redIsOdd())\n y0.redINeg();\n\n const x = this.b.redMul(x0);\n const y = this.b.redMul(y0);\n\n return this.point(x, y);\n }\n\n _invert2(p, hint) {\n // Inverting the Map (Elligator 2).\n //\n // [ELL2] Page 12, Section 5.3.\n //\n // Assumptions:\n //\n // - -z * x * (x + A) is square in F(p).\n // - If r = 1 then x != 0.\n // - If r = 2 then x != -A.\n //\n // Map:\n //\n // u1 = -(x + A) / (x * z)\n // u2 = -x / ((x + A) * z)\n // r = random integer in [1,2]\n // u = sign(y) * abs(sqrt(ur))\n //\n // Note that `0 / 0` can only occur if A = 0\n // (this violates the assumptions of Elligator 2).\n const {x, y} = p;\n const r = hint & 1;\n const x0 = x.redMul(this.bi);\n const y0 = y.redMul(this.bi);\n const n = x0.redAdd(this.a0);\n const d = x0;\n const lhs = [n, d][r].redINeg();\n const rhs = [d, n][r].redMul(this.z);\n const u = lhs.redDivSqrt(rhs);\n\n if (u.redIsOdd() !== y0.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n isElliptic() {\n const a2 = this.a.redSqr();\n const d = this.b.redMul(a2.redSub(this.four));\n\n // B * (A^2 - 4) != 0\n return !d.isZero();\n }\n\n jinv() {\n // [MONT3] Page 3, Section 2.\n const {a, three, four} = this;\n const a2 = a.redSqr();\n const t0 = a2.redSub(three);\n const lhs = t0.redPown(3).redIMuln(256);\n const rhs = a2.redSub(four);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // (256 * (A^2 - 3)^3) / (A^2 - 4)\n return lhs.redDiv(rhs).fromRed();\n }\n\n point(x, y) {\n return new MontPoint(this, x, y);\n }\n\n jpoint(x, y, z) {\n assert(x == null && y == null && z == null);\n return this.point();\n }\n\n xpoint(x, z) {\n return new XPoint(this, x, z);\n }\n\n solveY2(x) {\n // [MONT3] Page 3, Section 2.\n // https://hyperelliptic.org/EFD/g1p/auto-montgom.html\n assert(x instanceof BN);\n\n // B * y^2 = x^3 + A * x^2 + x\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const by2 = x3.redIAdd(this.a.redMul(x2)).redIAdd(x);\n const y2 = by2.redMul(this.bi);\n\n return y2;\n }\n\n validate(point) {\n assert(point instanceof MontPoint);\n\n if (point.isInfinity())\n return true;\n\n const {x, y} = point;\n const y2 = this.solveY2(x);\n\n return y.redSqr().eq(y2);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve, invert) {\n // [MONT3] Page 3, Section 2.1.\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n // M(A,B) <-> M(A,B')\n if (curve.type === 'mont') {\n const a = this.field(curve.a);\n const b = this.field(curve.b);\n\n // A' = A\n if (!this.a.eq(a))\n return false;\n\n // B' != 0\n if (this.b.isZero())\n return false;\n\n // jacobi(B / B') = 1\n const c = b.redDiv(this.b);\n\n return c.redJacobi() === 1;\n }\n\n return curve.isIsomorphic(this, invert);\n }\n\n isIsogenous(curve) {\n assert(curve instanceof Curve);\n\n if (curve.type === 'mont')\n return false;\n\n return curve.isIsogenous(this);\n }\n\n pointFromShort(point) {\n // [ALT] Appendix E.2 (Switching between Alternative Representations).\n // [MONT2] \"Equivalence with Weierstrass curves\"\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,b)->M(A,B):\n //\n // u = B * x - A / 3\n // v = B * y\n //\n // Undefined if ((u^3 + A * u^2 + u) / B) is not square.\n if (point.isInfinity())\n return this.point();\n\n const {a3, b} = this;\n const [u2, u3] = this._scale(point.curve);\n const x = this.field(point.x).redMul(u2);\n const y = this.field(point.y).redMul(u3);\n const u = b.redMul(x).redISub(a3);\n const v = b.redMul(y);\n\n return this.point(u, v);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [MONT3] Page 3, Section 2.1.\n assert(point instanceof MontPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for M(A,B)<->M(A,B'):\n //\n // u' = u\n // v' = +-sqrt(B / B') * v\n //\n // Undefined if (B / B') is not square.\n if (point.isInfinity())\n return this.point();\n\n const c = this._scale(point.curve);\n const u = this.field(point.x);\n const v = this.field(point.y);\n const nu = u;\n const nv = c.redMul(v);\n\n return this.point(nu, nv);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [RFC7748] Section 4.1 & 4.2.\n // [MONT3] Page 6, Section 2.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n assert(point instanceof EdwardsPoint);\n assert(point.curve.p.eq(this.p));\n\n // Edwards `x`, `y`, `z`.\n const x = this.field(point.x);\n const y = this.field(point.y);\n const z = this.field(point.z);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for E(1,d)->M(2-4d,1):\n //\n // u = y^2 / x^2\n // v = (2 - x^2 - y^2) * y / x^3\n //\n // Undefined for x = 0.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-1, 0) -> (0, 0)\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = z.redSqr().redIMuln(2);\n const uu = y.redSqr();\n const uz = x.redSqr();\n const vv = c.redISub(uz).redISub(uu).redMul(y);\n const vz = uz.redMul(x);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n if (this.isIsomorphic(point.curve, true)) {\n // Isomorphic maps for E(d,a)->M(A,B):\n //\n // u = (y + 1) / (y - 1)\n // v = +-sqrt((A - 2) / (B * a)) * u / x\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-sqrt(1 / a), 0) -> (-1, +-sqrt((A - 2) / B))\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = this._scale(point.curve, true);\n const uu = y.redAdd(z);\n const uz = y.redSub(z);\n const vv = c.redMul(z).redMul(uu);\n const vz = x.redMul(uz);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n if (this.isIsomorphic(point.curve, false)) {\n // Isomorphic maps for E(a,d)->M(A,B):\n //\n // u = (1 + y) / (1 - y)\n // v = +-sqrt((A + 2) / (B * a)) * u / x\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-sqrt(1 / a), 0) -> (1, +-sqrt((A + 2) / B))\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = this._scale(point.curve, false);\n const uu = z.redAdd(y);\n const uz = z.redSub(y);\n const vv = c.redMul(z).redMul(uu);\n const vz = x.redMul(uz);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n assert(u instanceof BN);\n\n // z = 0 or A = 0\n if (this.z.isZero() || this.a.isZero())\n throw new Error('Not implemented.');\n\n return this._elligator2(u);\n }\n\n pointToUniform(p, hint) {\n // Convert a montgomery point to a field\n // element by inverting the elligator2 map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof MontPoint);\n assert((hint >>> 0) === hint);\n\n // z = 0 or A = 0\n if (this.z.isZero() || this.a.isZero())\n throw new Error('Not implemented.');\n\n // P = O\n if (p.isInfinity())\n throw new Error('Invalid point.');\n\n // Add a random torsion component.\n const i = ((hint >>> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n return wrapErrors(() => {\n return this._invert2(q, hint);\n });\n }\n\n decodePoint(bytes, sign) {\n return MontPoint.decode(this, bytes, sign);\n }\n\n encodeX(point) {\n assert(point instanceof XPoint);\n return point.encode();\n }\n\n decodeX(bytes) {\n return XPoint.decode(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromMont(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, sign = null) {\n const [a, b] = this._mont(b0);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromMont(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, invert, sign = null) {\n const [a, d] = this._edwards(a0, invert);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this, invert);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromMont(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return MontPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n json.a = this.a.fromRed().toJSON();\n json.b = this.b.fromRed().toJSON();\n return json;\n }\n}\n\n/**\n * MontPoint\n */\n\nclass MontPoint extends Point {\n constructor(curve, x, y) {\n assert(curve instanceof MontCurve);\n\n super(curve, types.AFFINE);\n\n this.x = this.curve.zero;\n this.y = this.curve.zero;\n this.inf = true;\n\n if (x != null)\n this._init(x, y);\n }\n\n _init(x, y) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n\n this.x = x;\n this.y = y;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n this.inf = false;\n }\n\n clone() {\n if (this.inf)\n return this.curve.point();\n\n return this.curve.point(this.x, this.y);\n }\n\n scale(a) {\n return this.clone();\n }\n\n randomize(rng) {\n return this.clone();\n }\n\n neg() {\n // P = O\n if (this.inf)\n return this;\n\n // -(X1, Y1) = (X1, -Y1)\n return this.curve.point(this.x, this.y.redNeg());\n }\n\n add(p) {\n // [MONT1] Page 8, Section 4.3.2.\n //\n // Addition Law:\n //\n // l = (y2 - y1) / (x2 - x1)\n // x3 = b * l^2 - a - x1 - x2\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 1S + 7A + 1*b\n assert(p instanceof MontPoint);\n\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P, P + -P\n if (this.x.eq(p.x)) {\n // P + -P = O\n if (!this.y.eq(p.y))\n return this.curve.point();\n\n // P + P = 2P\n return this.dbl();\n }\n\n // H = X2 - X1\n const h = p.x.redSub(this.x);\n\n // R = Y2 - Y1\n const r = p.y.redSub(this.y);\n\n // L = R / H\n const l = r.redDiv(h);\n\n // K = b * L^2\n const k = this.curve.b.redMul(l.redSqr());\n\n // X3 = K - a - X1 - X2\n const nx = k.redISub(this.curve.a).redISub(this.x).redISub(p.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dbl() {\n // [MONT1] Page 8, Section 4.3.2.\n //\n // Addition Law (doubling):\n //\n // l = (3 * x1^2 + 2 * a * x1 + 1) / (2 * b * y1)\n // x3 = b * l^2 - a - 2 * x1\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 3M + 2S + 7A + 1*a + 1*b + 1*b + 2*2 + 1*3\n\n // P = O\n if (this.inf)\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.point();\n\n // M1 = 3 * X1^2\n const m1 = this.x.redSqr().redIMuln(3);\n\n // M2 = 2 * a * X1\n const m2 = this.curve.a.redMul(this.x).redIMuln(2);\n\n // M = M1 + M2 + 1\n const m = m1.redIAdd(m2).redIAdd(this.curve.one);\n\n // Z = 2 * b * Y1\n const z = this.curve.b.redMul(this.y).redIMuln(2);\n\n // L = M / Z\n const l = m.redDiv(z);\n\n // K = b * L^2\n const k = this.curve.b.redMul(l.redSqr());\n\n // X3 = K - a - 2 * X1\n const nx = k.redISub(this.curve.a).redISub(this.x).redISub(this.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n getX() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof MontPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.inf)\n return p.inf;\n\n // Q = O\n if (p.inf)\n return false;\n\n // X1 = X2, Y1 = Y2\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n cmp(point) {\n assert(point instanceof MontPoint);\n\n if (this.inf && !point.inf)\n return -1;\n\n if (!this.inf && point.inf)\n return 1;\n\n if (this.inf && point.inf)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Infinity cannot be represented in\n // the affine space, except by a flag.\n return this.inf;\n }\n\n isOrder2() {\n if (this.inf)\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.inf)\n return false;\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.inf)\n return false;\n\n return this.y.redIsEven();\n }\n\n toP() {\n return this;\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n // (X3, Z3) = (1, 0)\n if (this.inf)\n return this.curve.xpoint();\n\n // (X3, Z3) = (X1, 1)\n return this.curve.xpoint(this.x, this.curve.one);\n }\n\n encode() {\n return this.toX().encode();\n }\n\n static decode(curve, bytes, sign) {\n assert(curve instanceof MontCurve);\n return curve.decodeX(bytes).toP(sign);\n }\n\n toJSON(pre) {\n if (this.inf)\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n return [x, y];\n }\n\n toPretty() {\n if (this.inf)\n return [];\n\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof MontCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n\n return curve.point(x, y);\n }\n\n [custom]() {\n if (this.inf)\n return '';\n\n return '';\n }\n}\n\n/**\n * XPoint\n */\n\nclass XPoint extends Point {\n constructor(curve, x, z) {\n assert(curve instanceof MontCurve);\n\n super(curve, types.PROJECTIVE);\n\n this.x = this.curve.one;\n this.z = this.curve.zero;\n\n if (x != null)\n this._init(x, z);\n }\n\n _init(x, z) {\n assert(x instanceof BN);\n assert(z == null || (z instanceof BN));\n\n this.x = x;\n this.z = z || this.curve.one;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n }\n\n clone() {\n return this.curve.xpoint(this.x, this.z);\n }\n\n precompute(power, rng) {\n // No-op.\n return this;\n }\n\n validate() {\n if (this.isInfinity())\n return true;\n\n // B * y^2 * z = x^3 + A * x^2 * z + x * z^2\n const {x, z} = this;\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const z2 = z.redSqr();\n const ax2 = this.curve.a.redMul(x2).redMul(z);\n const by2 = x3.redIAdd(ax2).redIAdd(x.redMul(z2));\n const y2 = by2.redMul(this.curve.bi);\n\n // sqrt(y^2 * z^4) = y * z^2\n return y2.redMul(z).redJacobi() !== -1;\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#scaling-scale\n // 1I + 1M\n\n // P = O\n if (this.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.z.eq(this.curve.one))\n return this;\n\n // X3 = X1 / Z1\n this.x = this.x.redDiv(this.z);\n\n // Z3 = 1\n this.z = this.curve.one;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // P = O\n if (this.isInfinity())\n return this.curve.xpoint();\n\n // X3 = X1 * A\n const nx = this.x.redMul(a);\n\n // Y3 = Y1 * A\n const nz = this.z.redMul(a);\n\n return this.curve.xpoint(nx, nz);\n }\n\n neg() {\n // -(X1, Z1) = (X1, Z1)\n return this;\n }\n\n dbl() {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n // 2M + 2S + 4A + 1*a24\n\n // A = X1 + Z1\n const a = this.x.redAdd(this.z);\n\n // AA = A^2\n const aa = a.redSqr();\n\n // B = X1 - Z1\n const b = this.x.redSub(this.z);\n\n // BB = B^2\n const bb = b.redSqr();\n\n // C = AA - BB\n const c = aa.redSub(bb);\n\n // X3 = AA * BB\n const nx = aa.redMul(bb);\n\n // Z3 = C * (BB + a24 * C)\n const nz = c.redMul(bb.redIAdd(this.curve.a24.redMul(c)));\n\n return this.curve.xpoint(nx, nz);\n }\n\n diffAddDbl(p2, p3) {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#ladder-ladd-1987-m-3\n // 6M + 4S + 8A + 1*a24\n assert(p2 instanceof XPoint);\n assert(p3 instanceof XPoint);\n\n // A = X2 + Z2\n const a = p2.x.redAdd(p2.z);\n\n // AA = A^2\n const aa = a.redSqr();\n\n // B = X2 - Z2\n const b = p2.x.redSub(p2.z);\n\n // BB = B^2\n const bb = b.redSqr();\n\n // E = AA - BB\n const e = aa.redSub(bb);\n\n // C = X3 + Z3\n const c = p3.x.redAdd(p3.z);\n\n // D = X3 - Z3\n const d = p3.x.redSub(p3.z);\n\n // DA = D * A\n const da = d.redMul(a);\n\n // CB = C * B\n const cb = c.redMul(b);\n\n // X5 = Z1 * (DA + CB)^2\n const x5 = this.z.redMul(da.redAdd(cb).redSqr());\n\n // Z5 = X1 * (DA - CB)^2\n const z5 = this.x.redMul(da.redISub(cb).redSqr());\n\n // X4 = AA * BB\n const x4 = aa.redMul(bb);\n\n // Z4 = E * (BB + a24 * E)\n const z4 = e.redMul(bb.redIAdd(this.curve.a24.redMul(e)));\n\n return [\n this.curve.xpoint(x4, z4),\n this.curve.xpoint(x5, z5)\n ];\n }\n\n getX() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.x.fromRed();\n }\n\n getY(sign) {\n return this.toP(sign).getY();\n }\n\n eq(p) {\n assert(p instanceof XPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.isInfinity())\n return p.isInfinity();\n\n // Q = O\n if (p.isInfinity())\n return false;\n\n // Z1 = Z2\n if (this.z.eq(p.z))\n return this.x.eq(p.x);\n\n // X1 * Z2 = X2 * Z1\n const x1 = this.x.redMul(p.z);\n const x2 = p.x.redMul(this.z);\n\n return x1.eq(x2);\n }\n\n cmp(point) {\n assert(point instanceof XPoint);\n\n const inf1 = this.isInfinity();\n const inf2 = point.isInfinity();\n\n if (inf1 && !inf2)\n return -1;\n\n if (!inf1 && inf2)\n return 1;\n\n if (inf1 && inf2)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX());\n }\n\n isInfinity() {\n // Z1 = 0\n return this.z.isZero();\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.x.isZero();\n }\n\n isOdd() {\n return false;\n }\n\n isEven() {\n return false;\n }\n\n hasTorsion() {\n if (this.isInfinity())\n return false;\n\n // X1 = 0, Z1 != 0 (edge case)\n if (this.x.isZero())\n return true;\n\n return super.hasTorsion();\n }\n\n order() {\n try {\n return this.toP().order();\n } catch (e) {\n return new BN(1);\n }\n }\n\n jmul(k) {\n // Multiply with the Montgomery Ladder.\n //\n // [MONT3] Algorithm 4, Page 12, Section 4.2.\n //\n // Note that any clamping is meant to\n // be done _outside_ of this function.\n assert(k instanceof BN);\n assert(!k.red);\n\n const bits = k.bitLength();\n\n let a = this.curve.xpoint();\n let b = this;\n\n for (let i = bits - 1; i >= 0; i--) {\n const bit = k.bit(i);\n\n if (bit === 0)\n [a, b] = this.diffAddDbl(a, b);\n else\n [b, a] = this.diffAddDbl(b, a);\n }\n\n return a;\n }\n\n jmulBlind(k, rng) {\n if (!rng)\n return this.jmul(k);\n\n // Randomize if available.\n return this.randomize(rng).jmul(k);\n }\n\n jmulAdd(k1, p2, k2) {\n throw new Error('Not implemented.');\n }\n\n toP(sign = null) {\n assert(sign == null || typeof sign === 'boolean');\n\n if (this.isInfinity())\n return this.curve.point();\n\n this.normalize();\n\n return this.curve.pointFromX(this.x, sign);\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n return this;\n }\n\n key() {\n if (this.isInfinity())\n return `${this.curve.uid}:oo`;\n\n this.normalize();\n\n const x = this.getX().toString(16);\n\n return `${this.curve.uid}:${x}`;\n }\n\n encode() {\n // [RFC7748] Section 5.\n return this.curve.encodeField(this.getX());\n }\n\n static decode(curve, bytes) {\n assert(curve instanceof MontCurve);\n\n // [RFC7748] Section 5.\n const x = curve.decodeField(bytes);\n\n // We're supposed to ignore the hi bit\n // on montgomery points... I think. If\n // we don't, the X25519 test vectors\n // break, which is pretty convincing\n // evidence. This is a no-op for X448.\n x.iumaskn(curve.fieldBits);\n\n // Note: montgomery points are meant to be\n // reduced by the prime and do not have to\n // be explicitly validated in order to do\n // the montgomery ladder.\n const p = curve.xpoint(x, curve.one);\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n toJSON(pre) {\n return this.toP().toJSON(pre);\n }\n\n toPretty() {\n return this.toP().toPretty();\n }\n\n static fromJSON(curve, json) {\n return MontPoint.fromJSON(curve, json).toX();\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * EdwardsCurve\n */\n\nclass EdwardsCurve extends Curve {\n constructor(conf) {\n super(EdwardsPoint, 'edwards', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.d = BN.fromJSON(conf.d).toRed(this.red);\n this.s = BN.fromJSON(conf.s || '0').toRed(this.red);\n this.si = this.s.isZero() ? this.zero : this.s.redInvert();\n\n this.k = this.d.redMuln(2);\n this.smi = -this.d.redNeg().word(0);\n this.ad6 = this.a.redAdd(this.d).redMul(this.i6);\n\n this.twisted = !this.a.eq(this.one);\n this.oneA = this.a.eq(this.one);\n this.mOneA = this.a.eq(this.one.redNeg());\n this.smallD = this.prime != null && this.d.redNeg().length === 1;\n this.alt = null;\n\n this._finalize(conf);\n }\n\n static _isomorphism(curveA, curveD, customA) {\n // Twisted Edwards Isomorphism.\n //\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n //\n // Transformation:\n //\n // a' = a'\n // d' = a' * d / a\n //\n // Where (a / a') is square.\n assert(curveA instanceof BN);\n assert(curveD instanceof BN);\n assert(customA instanceof BN);\n\n const a = customA.clone();\n const d = customA.redMul(curveD).redDiv(curveA);\n const c = curveA.redDiv(customA);\n\n if (c.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n return [a, d];\n }\n\n _short(a0, odd) {\n // Twisted Edwards->Short Weierstrass Equivalence.\n //\n // [TWISTEQ] Section 2.\n //\n // Transformation:\n //\n // a' = -(a^2 + 14 * a * d + d^2) / 48\n // b' = (33 * (a^2 * d + a * d^2) - a^3 - d^3) / 864\n const {a, d} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const d2 = d.redSqr();\n const d3 = d2.redMul(d);\n const ad14 = a.redMul(d).redIMuln(14);\n const a2d = a2.redMul(d);\n const ad2 = a.redMul(d2);\n const t0 = a2d.redIAdd(ad2).redIMuln(33);\n const wa = a2.redAdd(ad14).redIAdd(d2).redDivn(-48);\n const wb = t0.redISub(a3).redISub(d3).redDivn(864);\n\n if (a0 != null)\n return ShortCurve._isomorphism(wa, wb, a0, odd);\n\n return [wa, wb];\n }\n\n _mont(b0, invert = false) {\n // Twisted Edwards->Montgomery Transformation.\n //\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n //\n // Equivalence:\n //\n // A = 2 * (a + d) / (a - d)\n // B = 4 / (a - d)\n //\n // Isomorphism:\n //\n // A = 2 * (a + d) / (a - d)\n // B = B'\n //\n // Where ((4 / (a - d)) / B') is square.\n //\n // If `4 / (a - d)` is non-square, we can\n // usually force B=1 by using the `invert`\n // option. This will create an isomorphism\n // chain of: E(a,d)->E(d,a)->M(-A,-B).\n //\n // The equivalence between E(a,d) and E(d,a)\n // is:\n //\n // (x, y) = (x, 1 / y)\n //\n // Meaning our map to M(-A,-B) is:\n //\n // u = (1 + 1 / y) / (1 - 1 / y)\n // = (y + 1) / (y - 1)\n // v = u / x\n assert(typeof invert === 'boolean');\n\n let apd, amd;\n\n if (invert) {\n apd = this.d.redAdd(this.a);\n amd = this.d.redSub(this.a);\n } else {\n apd = this.a.redAdd(this.d);\n amd = this.a.redSub(this.d);\n }\n\n const z = amd.redInvert();\n const a = apd.redMuln(2).redMul(z);\n const b = z.redMuln(4);\n\n if (b0 != null)\n return MontCurve._isomorphism(a, b, b0);\n\n return [a, b];\n }\n\n _edwards(a0) {\n return EdwardsCurve._isomorphism(this.a, this.d, a0);\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n const [u2, u3] = curve._scale(this);\n\n return [this.field(u2.redInvert()),\n this.field(u3.redInvert())];\n }\n\n _scaleMont(curve, invert = false) {\n // Calculate isomorphism factor between\n // Twisted Edwards and Montgomery with:\n //\n // a = (A + 2) / B\n // c = +-sqrt(a / a')\n //\n // Which can be reduced to:\n //\n // c = +-sqrt((A + 2) / (B * a'))\n //\n // If base points are available, we can do:\n //\n // x = u / v\n // c = x' / x\n //\n // Which can be reduced to:\n //\n // c = v * x' / u\n //\n // We can now calculate the Edwards `x` with:\n //\n // x' = c * u / v\n //\n // And likewise, the Montgomery `v`:\n //\n // v = c * u / x'\n assert(curve instanceof MontCurve);\n assert(typeof invert === 'boolean');\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a] = curve._edwards(null, invert);\n\n return this.field(a).redDivSqrt(this.a);\n }\n\n const x = curve.g.x.redDiv(curve.g.y);\n\n return this.g.x.redDiv(this.field(x));\n }\n\n _scaleEdwards(curve) {\n // We can extract the isomorphism factor with:\n //\n // c = +-sqrt(a / a')\n //\n // If base points are available, we can do:\n //\n // c = x' / x\n assert(curve instanceof EdwardsCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this.field(curve.a).redDivSqrt(this.a);\n\n return this.g.x.redDiv(this.field(curve.g.x));\n }\n\n _mulA(num) {\n assert(num instanceof BN);\n\n // n * a = n\n if (this.oneA)\n return num.clone();\n\n // n * a = -n\n if (this.mOneA)\n return num.redNeg();\n\n return this.a.redMul(num);\n }\n\n _mulD(num) {\n assert(num instanceof BN);\n\n // -d < 0x4000000\n if (this.smallD)\n return num.redMuln(this.smi);\n\n return this.d.redMul(num);\n }\n\n _elligator1(t) {\n // Elligator 1.\n //\n // Distribution: 1/2.\n //\n // [ELL1] Page 6, Section 3.\n // Page 15, Appendix A.\n // [ELL2] Page 7, Section 3.2.\n //\n // Assumptions:\n //\n // - Let p be a prime power congruent to 3 mod 4.\n // - Let s be a nonzero element of F(p).\n // - Let c = 2 / s^2.\n // - Let r = c + 1 / c.\n // - Let d = -(c + 1)^2 / (c - 1)^2.\n // - (s^2 - 2) * (s^2 + 2) != 0.\n // - c * (c - 1) * (c + 1) != 0.\n // - r != 0.\n // - d is not square.\n // - x^2 + y^2 = 1 + d * x^2 * y^2.\n // - u * v * X * Y * x * (Y + 1) != 0.\n // - Y^2 = X^5 + (r^2 - 2) * X^3 + X.\n //\n // Elligator 1, as devised by Fouque et al,\n // takes place on the hyperelliptic curve of:\n //\n // y^2 = x^5 + (r^2 - 2) * x^3 + x\n //\n // Not only must our Edwards curve be complete,\n // with a prime congruent to 3 mod 4, and a = 1,\n // our curve must be isomorphic to a hyperelliptic\n // curve of the above form. Roughly one half of\n // all Edwards curves are isomorphic to a curve\n // of said form.\n //\n // We can derive the isomorphism with:\n //\n // c = (d +- 2 * sqrt(-d) - 1) / (d + 1)\n // s = +-sqrt(2 / c)\n // r = c + 1 / c\n //\n // Note that even if your curve is an Elligator 1\n // curve, Elligator 2 is probably still preferable,\n // as it has nearly the same properties (i.e. the\n // same distribution), and is much less complex.\n //\n // Map:\n //\n // f(a) = a^((p - 1) / 2)\n // u = (1 - t) / (1 + t)\n // v = u^5 + (r^2 - 2) * u^3 + u\n // X = f(v) * u\n // Y = (f(v) * v)^((p + 1) / 4) * f(v) * f(u^2 + 1 / c^2)\n // Y = 1, if u = 0\n // x = (c - 1) * s * X * (1 + X) / Y\n // y = (r * X - (1 + X)^2) / (r * X + (1 + X)^2)\n //\n // When t = +-1, we create the hyperelliptic\n // 2-torsion point of (0, 0). This needs to be\n // mapped to (0, -1) in Edwards form, but the x\n // denominator becomes zero. As far as I can\n // tell, this is the only exceptional case.\n //\n // The only other exceptional case initially\n // appears to be when the y denominator sums to\n // zero (when t = sqrt(4 / r + 1)), however, the\n // hyperelliptic `X` is negated by the sign of\n // `v`, making this impossible.\n const {s, si, i2, one, two} = this;\n const c = si.redSqr().redIMuln(2);\n const ci = s.redSqr().redMul(i2);\n const ci2 = ci.redSqr();\n const r = c.redAdd(ci);\n const r2 = r.redSqr().redISub(two);\n const cm1 = c.redSub(one);\n const uu = one.redSub(t);\n const uz = one.redAdd(t);\n const u = uz.isZero() ? uz : uu.redDiv(uz);\n const u2 = u.redSqr();\n const u3 = u2.redMul(u);\n const u5 = u3.redMul(u2);\n const v = u5.redAdd(r2.redMul(u3)).redIAdd(u);\n const f0 = this.field(v.redJacobi());\n const f1 = this.field(u2.redAdd(ci2).redJacobi());\n const f2 = f0.redMul(f1);\n const X = f0.redMul(u);\n const Y = f0.redMul(v).redSqrt().redMul(f2);\n const X1 = one.redAdd(X);\n const rX = r.redMul(X);\n const X12 = X1.redSqr();\n const xx = cm1.redMul(s).redMul(X).redMul(X1);\n const xz = u.isZero() ? this.one : Y;\n const yy = rX.redSub(X12);\n const yz = rX.redAdd(X12);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n _invert1(p, hint) {\n // Inverting the Map (Elligator 1).\n //\n // [ELL1] Page 6, Section 3.\n // Page 15, Appendix A.\n // [ELL2] Page 7, Section 3.3.\n //\n // Assumptions:\n //\n // - y + 1 != 0.\n // - (1 + n * r)^2 - 1 is square in F(p).\n // - If n * r = -2 then x = 2 * s * (c - 1) * f(c) / r.\n // - Y = (c - 1) * s * X * (1 + X) / x.\n //\n // Map:\n //\n // f(a) = a^((p - 1) / 2)\n // n = (y - 1) / (2 * (y + 1))\n // X = -(1 + n * r) + ((1 + n * r)^2 - 1)^((p + 1) / 4)\n // z = f((c - 1) * s * X * (1 + X) * x * (X^2 + 1 / c^2))\n // u = z * X\n // t = (1 - u) / (1 + u)\n const {s, si, i2, one} = this;\n const {x, y, z} = p;\n const sign = hint & 1;\n const c = si.redSqr().redIMuln(2);\n const ci = s.redSqr().redMul(i2);\n const ci2 = ci.redSqr();\n const r = c.redAdd(ci);\n const cm1 = c.redSub(one);\n const nn = y.redSub(z);\n const nz = y.redAdd(z).redIMuln(2);\n const n = nz.isZero() ? nz : nn.redDiv(nz);\n const nr1 = one.redAdd(n.redMul(r));\n const w2 = nr1.redSqr().redISub(one);\n const w = w2.redSqrt();\n const X = w.redSub(nr1);\n const X1 = one.redAdd(X);\n const YY = cm1.redMul(s).redMul(X).redMul(X1);\n const Y = YY.redMul(x.redMul(z));\n const X2 = X.redSqr().redIAdd(ci2);\n const Z = this.field(Y.redMul(X2).redJacobi());\n const u = Z.redMul(X);\n const tt = one.redSub(u);\n const tz = one.redAdd(u);\n const t = tz.isZero() ? tz : tt.redDiv(tz);\n\n if (t.redIsOdd() !== Boolean(sign))\n t.redINeg();\n\n return t;\n }\n\n _alt() {\n if (!this.alt)\n this.alt = this.toMont();\n\n return this.alt;\n }\n\n isElliptic() {\n const ad = this.a.redMul(this.d);\n const amd = this.a.redSub(this.d);\n\n // a * d * (a - d) != 0\n return !ad.redMul(amd).isZero();\n }\n\n jinv() {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n const {a, d} = this;\n const ad = a.redMul(d);\n const amd4 = a.redSub(d).redPown(4);\n const a2 = a.redSqr();\n const d2 = d.redSqr();\n const t0 = a2.redAdd(ad.redMuln(14)).redIAdd(d2);\n const lhs = t0.redPown(3).redIMuln(16);\n const rhs = ad.redMul(amd4);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // 16 * (a^2 + 14 * a * d + d^2)^3 / (a * d * (a - d)^4)\n return lhs.redDiv(rhs).fromRed();\n }\n\n isComplete() {\n return this.a.redJacobi() === 1\n && this.d.redJacobi() === -1;\n }\n\n point(x, y, z, t) {\n return new EdwardsPoint(this, x, y, z, t);\n }\n\n jpoint(x, y, z) {\n assert(x == null && y == null && z == null);\n return this.point();\n }\n\n cpoint(xx, xz, yy, yz) {\n assert(xx instanceof BN);\n assert(xz instanceof BN);\n assert(yy instanceof BN);\n assert(yz instanceof BN);\n\n const x = xx.redMul(yz);\n const y = yy.redMul(xz);\n const z = xz.redMul(yz);\n const t = xx.redMul(yy);\n\n return this.point(x, y, z, t);\n }\n\n solveX2(y) {\n // [RFC8032] Section 5.1.3 & 5.2.3.\n assert(y instanceof BN);\n\n // x^2 = (y^2 - 1) / (d * y^2 - a)\n const y2 = y.redSqr();\n const rhs = this._mulD(y2).redISub(this.a);\n const lhs = y2.redISub(this.one);\n const x2 = lhs.redDiv(rhs);\n\n return x2;\n }\n\n solveX(y) {\n // Optimize with inverse square root trick.\n //\n // Note that `0 / 0` can only occur if\n // `a == d` (i.e. the curve is singular).\n const y2 = y.redSqr();\n const rhs = this._mulD(y2).redISub(this.a);\n const lhs = y2.redISub(this.one);\n\n return lhs.redDivSqrt(rhs);\n }\n\n solveY2(x) {\n assert(x instanceof BN);\n\n // y^2 = (a * x^2 - 1) / (d * x^2 - 1)\n const x2 = x.redSqr();\n const lhs = this._mulA(x2).redISub(this.one);\n const rhs = this._mulD(x2).redISub(this.one);\n const y2 = lhs.redDiv(rhs);\n\n return y2;\n }\n\n solveY(x) {\n // Optimize with inverse square root trick.\n //\n // Note that `0 / 0` can only occur if\n // `a == d` (i.e. the curve is singular).\n const x2 = x.redSqr();\n const lhs = this._mulA(x2).redISub(this.one);\n const rhs = this._mulD(x2).redISub(this.one);\n\n return lhs.redDivSqrt(rhs);\n }\n\n validate(point) {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n // Page 11, Section 6.\n assert(point instanceof EdwardsPoint);\n\n // Z1 = 1\n if (point.zOne) {\n // a * x^2 + y^2 = 1 + d * x^2 * y^2\n const x2 = point.x.redSqr();\n const y2 = point.y.redSqr();\n const dxy = this._mulD(x2).redMul(y2);\n const lhs = this._mulA(x2).redIAdd(y2);\n const rhs = this.one.redAdd(dxy);\n const tz = point.t;\n const xy = point.x.redMul(point.y);\n\n return lhs.eq(rhs) && tz.eq(xy);\n }\n\n // (a * x^2 + y^2) * z^2 = z^4 + d * x^2 * y^2\n const x2 = point.x.redSqr();\n const y2 = point.y.redSqr();\n const z2 = point.z.redSqr();\n const z4 = z2.redSqr();\n const dxy = this._mulD(x2).redMul(y2);\n const lhs = this._mulA(x2).redIAdd(y2).redMul(z2);\n const rhs = z4.redIAdd(dxy);\n const tz = point.t.redMul(point.z);\n const xy = point.x.redMul(point.y);\n\n return lhs.eq(rhs) && tz.eq(xy);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n pointFromY(y, sign = null) {\n assert(y instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!y.red)\n y = y.toRed(this.red);\n\n const x = this.solveX(y);\n\n if (sign != null) {\n if (x.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (x.redIsOdd() !== sign)\n x.redINeg();\n }\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve, invert = false) {\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n // Definition 2.1, Page 3, Section 2.\n assert(curve instanceof Curve);\n assert(typeof invert === 'boolean');\n\n if (!curve.p.eq(this.p))\n return false;\n\n // E(a,d) <-> E(a,b)\n if (curve.type === 'short')\n return curve.isIsomorphic(this);\n\n // E(a,d) <-> M(A,B)\n // E(a,d) <-> M(-A,-B)\n if (curve.type === 'mont') {\n // A * (a - d) = 2 * (a + d)\n const a = this.field(curve.a);\n\n let apd, amd;\n\n if (invert) {\n apd = this.d.redAdd(this.a);\n amd = this.d.redSub(this.a);\n } else {\n apd = this.a.redAdd(this.d);\n amd = this.a.redSub(this.d);\n }\n\n return a.redMul(amd).eq(apd.redIMuln(2));\n }\n\n // E(a,d) <-> E(a',a'd/a)\n if (curve.type === 'edwards') {\n // a' * d = a * d'\n const a = this.field(curve.a);\n const d = this.field(curve.d);\n\n return this.a.redMul(d).eq(a.redMul(this.d));\n }\n\n return false;\n }\n\n isIsogenous(curve) {\n // Check for the 4-isogenies described by Hamburg:\n // https://moderncrypto.org/mail-archive/curves/2016/000806.html\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n // E(1,d) <-> M(2-4d,1)\n if (curve.type === 'mont') {\n if (!this.a.eq(this.one))\n return false;\n\n const a = this.field(curve.a);\n const b = this.field(curve.b);\n const d24 = this.two.redSub(this.d.redMuln(4));\n\n return a.eq(d24) && b.eq(this.one);\n }\n\n // E(a,d) <-> E(-a,d-a)\n if (curve.type === 'edwards') {\n const a = this.field(curve.a);\n const d = this.field(curve.d);\n\n return a.eq(this.a.redNeg())\n && d.eq(this.d.redSub(this.a));\n }\n\n return false;\n }\n\n pointFromShort(point) {\n // [TWISTEQ] Section 1.\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,b)->E(a',d'):\n //\n // x' = (6 * x - a' - d') / (6 * y)\n // y' = (12 * x - 5 * a' + d') / (12 * x + a' - 5 * d')\n //\n // Undefined for x = (5 * d' - a') / 12 or y = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - ((a' + d') / 6, 0) -> (0, -1)\n // - ((5 * d' - a') / 12, (d' - a') / 4 * sqrt(d')) -> (sqrt(1/d'), oo)\n //\n // Unexceptional Cases:\n // - ((5 * a' - d') / 12, (a' - d') / 4 * sqrt(a')) -> (sqrt(1/a'), 0)\n if (point.isInfinity())\n return this.point();\n\n if (point.y.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const {a, d} = this;\n const [u2, u3] = this._scale(point.curve);\n const a5 = a.redMuln(5);\n const d5 = d.redMuln(5);\n const x = this.field(point.x).redMul(u2);\n const y = this.field(point.y).redMul(u3);\n const x6 = x.redMuln(6);\n const x12 = x.redMuln(12);\n const xx = x6.redSub(a).redISub(d);\n const xz = y.redMuln(6);\n const yy = x12.redSub(a5).redIAdd(d);\n const yz = x12.redAdd(a).redISub(d5);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [RFC7748] Section 4.1 & 4.2.\n // [MONT3] Page 6, Section 2.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n assert(point instanceof MontPoint);\n assert(point.curve.p.eq(this.p));\n\n // Montgomery `u`, `v`.\n const u = this.field(point.x);\n const v = this.field(point.y);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for M(2-4d,1)->E(1,d):\n //\n // x = 4 * v * (u^2 - 1) / (u^4 - 2 * u^2 + 4 * v^2 + 1)\n // y = -(u^5 - 2 * u^3 - 4 * u * v^2 + u) /\n // (u^5 - 2 * u^2 * v^2 - 2 * u^3 - 2 * v^2 + u)\n //\n // Undefined for u = 0 and v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, 1)\n //\n // Unexceptional Cases:\n // - (-1, +-sqrt(A - 2)) -> (0, 1)\n // - (1, +-sqrt(A + 2)) -> (0, -1)\n //\n // The point (1, v) is invalid on Curve448.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point();\n\n const u2 = u.redSqr();\n const u3 = u2.redMul(u);\n const u4 = u3.redMul(u);\n const u5 = u4.redMul(u);\n const v2 = v.redSqr();\n const a = v.redMuln(4);\n const b = u2.redSub(this.one);\n const c = u2.redMuln(2);\n const d = v2.redMuln(4);\n const e = u3.redIMuln(2);\n const f = u.redMul(v2).redIMuln(4);\n const g = u2.redMul(v2).redIMuln(2);\n const h = v2.redIMuln(2);\n const xx = a.redMul(b);\n const xz = u4.redISub(c).redIAdd(d).redIAdd(this.one);\n const yy = u5.redSub(e).redISub(f).redIAdd(u).redINeg();\n const yz = u5.redISub(g).redISub(e).redISub(h).redIAdd(u);\n\n return this.cpoint(xx, xz, yy, yz).divn(4);\n }\n\n if (this.isIsomorphic(point.curve, true)) {\n // Isomorphic maps for M(-A,-B)->E(a,d):\n //\n // x = +-sqrt((A - 2) / (B * a)) * u / v\n // y = (u + 1) / (u - 1)\n //\n // Undefined for u = 1 or v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, -1)\n // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / d), oo)\n //\n // Unexceptional Cases:\n // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / a), 0)\n //\n // The point (1, v) is invalid on Curve448.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const c = this._scale(point.curve, true);\n const xx = c.redMul(u);\n const xz = v;\n const yy = u.redAdd(this.one);\n const yz = u.redSub(this.one);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n if (this.isIsomorphic(point.curve, false)) {\n // Isomorphic maps for M(A,B)->E(a,d):\n //\n // x = +-sqrt((A + 2) / (B * a)) * u / v\n // y = (u - 1) / (u + 1)\n //\n // Undefined for u = -1 or v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, -1)\n // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / d), oo)\n //\n // Unexceptional Cases:\n // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / a), 0)\n //\n // The point (-1, v) is invalid on Curve25519.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const c = this._scale(point.curve, false);\n const xx = c.redMul(u);\n const xz = v;\n const yy = u.redSub(this.one);\n const yz = u.redAdd(this.one);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n // [ISOGENY] Page 2, Section 2.\n assert(point instanceof EdwardsPoint);\n assert(point.curve.p.eq(this.p));\n\n // Edwards `x`, `y`, `z`, `t`.\n const a = this.field(point.curve.a);\n const x = this.field(point.x);\n const y = this.field(point.y);\n const z = this.field(point.z);\n const t = this.field(point.t);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for E(a,d)<->E(-a,d-a):\n //\n // x' = (2 * x * y) / (y^2 - a * x^2)\n // y' = (y^2 + a * x^2) / (2 - y^2 - a * x^2)\n //\n // Undefined for y^2 - a * x^2 = 0\n // or y^2 + a * x^2 = 2.\n const xy = x.redMul(y);\n const x2 = x.redSqr();\n const y2 = y.redSqr();\n const z2 = z.redSqr();\n const ax2 = a.redMul(x2);\n const xx = xy.redIMuln(2);\n const xz = y2.redSub(ax2);\n const yy = y2.redAdd(ax2);\n const yz = z2.redIMuln(2).redISub(yy);\n const p = this.cpoint(xx, xz, yy, yz);\n\n return !this.twisted ? p.divn(4) : p;\n }\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for E(a,d)<->E(a',a'd/a):\n //\n // x' = +-sqrt(a / a') * x\n // y' = y\n //\n // Undefined when (a / a') is not square.\n const c = this._scale(point.curve);\n const nx = c.redMul(x);\n const ny = y;\n const nz = z;\n const nt = c.redMul(t);\n\n return this.point(nx, ny, nz, nt);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u, curve = null) {\n assert(u instanceof BN);\n assert(u.red === this.red);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n const u0 = curve.field(u);\n const p0 = curve.pointFromUniform(u0);\n\n return this.pointFromMont(p0);\n }\n\n pointToUniform(p, hint, curve = null) {\n // Convert an edwards point to a field\n // element by inverting the elligator2 map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof EdwardsPoint);\n assert((hint >>> 0) === hint);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n // Add a random torsion component.\n const i = ((hint >> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n // Convert and invert.\n const p0 = curve.pointFromEdwards(q);\n const u0 = curve.pointToUniform(p0, hint & 15);\n\n return this.field(u0);\n }\n\n pointFromHash(bytes, pake, curve = null) {\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n const p0 = curve.pointFromHash(bytes, pake);\n\n return this.pointFromMont(p0);\n }\n\n pointToHash(p, subgroup, rng, curve = null) {\n assert(p instanceof EdwardsPoint);\n assert((subgroup >>> 0) === subgroup);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n // Add a random torsion component.\n const i = subgroup % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n // Convert and invert.\n const p0 = curve.pointFromEdwards(q);\n\n return curve.pointToHash(p0, 0, rng);\n }\n\n decodePoint(bytes) {\n return EdwardsPoint.decode(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromEdwards(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, invert, sign = null) {\n const [a, b] = this._mont(b0, invert);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = this._scale(curve, invert);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromEdwards(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, sign = null) {\n const [a, d] = this._edwards(a0);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromEdwards(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return EdwardsPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n\n json.a = this.a.fromRed().toJSON();\n json.d = this.d.fromRed().toJSON();\n\n if (!this.s.isZero())\n json.s = this.s.fromRed().toJSON();\n\n return json;\n }\n}\n\n/**\n * EdwardsPoint\n */\n\nclass EdwardsPoint extends Point {\n constructor(curve, x, y, z, t) {\n assert(curve instanceof EdwardsCurve);\n\n super(curve, types.EXTENDED);\n\n this.x = this.curve.zero;\n this.y = this.curve.one;\n this.z = this.curve.one;\n this.t = this.curve.zero;\n this.zOne = true;\n\n if (x != null)\n this._init(x, y, z, t);\n }\n\n _init(x, y, z, t) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n assert(z == null || (z instanceof BN));\n assert(t == null || (t instanceof BN));\n\n this.x = x;\n this.y = y;\n this.z = z || this.curve.one;\n this.t = t || null;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n if (this.t && !this.t.red)\n this.t = this.t.toRed(this.curve.red);\n\n this.zOne = this.z.eq(this.curve.one);\n\n this._check();\n\n if (!this.t) {\n this.t = this.x.redMul(this.y);\n if (!this.zOne)\n this.t = this.t.redDiv(this.z);\n }\n }\n\n _check() {\n // In order to achieve complete\n // addition formulas, `a` must\n // be a square (always the case\n // for a=1), and `d` must be a\n // non-square.\n //\n // If this is not the case, the\n // addition formulas may have\n // exceptional cases where Z3=0.\n //\n // In particular, this can occur\n // when: Q*h = -P*h and Q != -P.\n //\n // This is assuming 4-torsion is\n // involved (the 4-torsion point\n // is _not_ representable when\n // `d` is square).\n if (this.z.isZero())\n throw new Error('Invalid point.');\n }\n\n clone() {\n return this.curve.point(this.x, this.y, this.z, this.t);\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#scaling-z\n // 1I + 2M (+ 1M if extended)\n\n // Z1 = 1\n if (this.zOne)\n return this;\n\n // A = 1 / Z1\n const a = this.z.redInvert();\n\n // X3 = X1 * A\n this.x = this.x.redMul(a);\n\n // Y3 = Y1 * A\n this.y = this.y.redMul(a);\n\n // T3 = T1 * A\n this.t = this.t.redMul(a);\n\n // Z3 = 1\n this.z = this.curve.one;\n this.zOne = true;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // X3 = X1 * A\n const nx = this.x.redMul(a);\n\n // Y3 = Y1 * A\n const ny = this.y.redMul(a);\n\n // Z3 = Z1 * A\n const nz = this.z.redMul(a);\n\n // T3 = T1 * A\n const nt = this.t.redMul(a);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n neg() {\n // -(X1, Y1, Z1, T1) = (-X1, Y1, Z1, -T1)\n const nx = this.x.redNeg();\n const ny = this.y;\n const nz = this.z;\n const nt = this.t.redNeg();\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n add(p) {\n assert(p instanceof EdwardsPoint);\n\n // P = O\n if (this.isInfinity())\n return p;\n\n // Q = O\n if (p.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.zOne)\n return p._add(this);\n\n return this._add(p);\n }\n\n _add(p) {\n // a = -1\n if (this.curve.mOneA)\n return this._addM1(p);\n\n return this._addA(p);\n }\n\n _addM1(p) {\n // Assumes a = -1.\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-3\n // 8M + 8A + 1*k + 1*2\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-madd-2008-hwcd-3\n // 7M + 8A + 1*k + 1*2\n\n // A = (Y1 - X1) * (Y2 - X2)\n const a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n\n // B = (Y1 + X1) * (Y2 + X2)\n const b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n\n // C = T1 * k * T2\n const c = this.t.redMul(this.curve.k).redMul(p.t);\n\n // D = Z1 * 2 * Z2\n const d = p.zOne ? this.z.redAdd(this.z) : this.z.redMul(p.z).redIMuln(2);\n\n // E = B - A\n const e = b.redSub(a);\n\n // F = D - C\n const f = d.redSub(c);\n\n // G = D + C\n const g = d.redIAdd(c);\n\n // H = B + A\n const h = b.redIAdd(a);\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n _addA(p) {\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd\n // 9M + 7A + 1*a + 1*d\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-madd-2008-hwcd\n // 8M + 7A + 1*a + 1*d\n\n // A = X1 * X2\n const a = this.x.redMul(p.x);\n\n // B = Y1 * Y2\n const b = this.y.redMul(p.y);\n\n // C = T1 * d * T2\n const c = this.curve._mulD(this.t).redMul(p.t);\n\n // D = Z1 * Z2\n const d = p.zOne ? this.z.clone() : this.z.redMul(p.z);\n\n // + XYXY = (X1 + Y1) * (X2 + Y2)\n const xyxy = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y));\n\n // E = (X1 + Y1) * (X2 + Y2) - A - B\n const e = xyxy.redISub(a).redISub(b);\n\n // F = D - C\n const f = d.redSub(c);\n\n // G = D + C\n const g = d.redIAdd(c);\n\n // H = B - a * A\n const h = b.redISub(this.curve._mulA(a));\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n dbl() {\n // P = O\n if (this.isInfinity())\n return this;\n\n return this._dbl();\n }\n\n _dbl() {\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd\n // 4M + 4S + 6A + 1*a + 1*2\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-mdbl-2008-hwcd\n // 3M + 4S + 7A + 1*a + 1*2\n\n // A = X1^2\n const a = this.x.redSqr();\n\n // B = Y1^2\n const b = this.y.redSqr();\n\n // C = 2 * Z1^2\n const c = this.zOne ? this.curve.two : this.z.redSqr().redIMuln(2);\n\n // D = a * A\n const d = this.curve._mulA(a);\n\n // E = (X1 + Y1)^2 - A - B\n const e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n\n // G = D + B\n const g = d.redAdd(b);\n\n // F = G - C\n const f = g.redSub(c);\n\n // H = D - B\n const h = d.redISub(b);\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n getX() {\n this.normalize();\n return this.x.fromRed();\n }\n\n getY() {\n this.normalize();\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof EdwardsPoint);\n assert(!this.z.isZero());\n assert(!p.z.isZero());\n\n // P = Q\n if (this === p)\n return true;\n\n // Z1 = Z2\n if (this.z.eq(p.z)) {\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n // X1 * Z2 = X2 * Z1\n const x1 = this.x.redMul(p.z);\n const x2 = p.x.redMul(this.z);\n\n if (!x1.eq(x2))\n return false;\n\n const y1 = this.y.redMul(p.z);\n const y2 = p.y.redMul(this.z);\n\n return y1.eq(y2);\n }\n\n cmp(point) {\n assert(point instanceof EdwardsPoint);\n\n return this.order().cmp(point.order())\n || this.getY().cmp(point.getY())\n || this.getX().cmp(point.getX());\n }\n\n isInfinity() {\n assert(!this.z.isZero());\n\n // X1 = 0\n if (!this.x.isZero())\n return false;\n\n // Y1 = Z1\n return this.y.eq(this.z);\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.x.isZero();\n }\n\n isOdd() {\n this.normalize();\n return this.x.redIsOdd();\n }\n\n isEven() {\n this.normalize();\n return this.x.redIsEven();\n }\n\n toP() {\n return this.normalize();\n }\n\n toJ() {\n return this;\n }\n\n encode() {\n // [RFC8032] Section 5.1.2.\n const y = this.getY();\n\n // Note: `x` normalized from `getY()` call.\n y.setn(this.curve.signBit, this.x.redIsOdd());\n\n return this.curve.encodeAdjusted(y);\n }\n\n static decode(curve, bytes) {\n // [RFC8032] Section 5.1.3.\n assert(curve instanceof EdwardsCurve);\n\n const y = curve.decodeAdjusted(bytes);\n const sign = y.testn(curve.signBit) !== 0;\n\n y.setn(curve.signBit, 0);\n\n if (y.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromY(y, sign);\n }\n\n toJSON(pre) {\n if (this.isInfinity())\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n if (pre === true && this.pre)\n return [x, y, this.pre.toJSON()];\n\n return [x, y];\n }\n\n toPretty() {\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof EdwardsCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n const point = curve.point(x, y);\n\n if (json.length > 2 && json[2] != null)\n point.pre = Precomp.fromJSON(point, json[2]);\n\n return point;\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * Precomp\n */\n\nclass Precomp {\n constructor() {\n this.naf = null;\n this.windows = null;\n this.doubles = null;\n this.blinding = null;\n this.beta = null;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const out = new this.constructor();\n\n if (this.naf)\n out.naf = this.naf.map(func);\n\n if (this.doubles)\n out.doubles = this.doubles.map(func);\n\n return out;\n }\n\n toJSON() {\n return {\n naf: this.naf ? this.naf.toJSON() : null,\n windows: this.windows ? this.windows.toJSON() : null,\n doubles: this.doubles ? this.doubles.toJSON() : null,\n blinding: this.blinding ? this.blinding.toJSON() : undefined\n };\n }\n\n fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n\n if (json.naf != null)\n this.naf = NAF.fromJSON(point, json.naf);\n\n if (json.windows != null)\n this.windows = Windows.fromJSON(point, json.windows);\n\n if (json.doubles != null)\n this.doubles = Doubles.fromJSON(point, json.doubles);\n\n if (json.blinding != null)\n this.blinding = Blinding.fromJSON(point, json.blinding);\n\n return this;\n }\n\n static fromJSON(point, json) {\n return new this().fromJSON(point, json);\n }\n}\n\n/**\n * NAF\n */\n\nclass NAF {\n constructor(width, points) {\n this.width = width;\n this.points = points;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const {width} = this;\n const points = [];\n\n for (const point of this.points)\n points.push(func(point));\n\n return new this.constructor(width, points);\n }\n\n toJSON() {\n return {\n width: this.width,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.width >>> 0) === json.width);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {width} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(width, points);\n }\n}\n\n/**\n * Windows\n */\n\nclass Windows {\n constructor(width, bits, points) {\n this.width = width;\n this.bits = bits;\n this.points = points;\n }\n\n toJSON() {\n return {\n width: this.width,\n bits: this.bits,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.width >>> 0) === json.width);\n assert((json.bits >>> 0) === json.bits);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {width, bits} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(width, bits, points);\n }\n}\n\n/**\n * Doubles\n */\n\nclass Doubles {\n constructor(step, points) {\n this.step = step;\n this.points = points;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const {step} = this;\n const points = [];\n\n for (const point of this.points)\n points.push(func(point));\n\n return new this.constructor(step, points);\n }\n\n toJSON() {\n return {\n step: this.step,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.step >>> 0) === json.step);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {step} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(step, points);\n }\n}\n\n/**\n * Blinding\n */\n\nclass Blinding {\n constructor(blind, unblind) {\n this.blind = blind;\n this.unblind = unblind;\n }\n\n toJSON() {\n return {\n blind: this.blind.toJSON(),\n unblind: this.unblind.toJSON()\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n\n const {curve} = point;\n const blind = BN.fromJSON(json.blind);\n const unblind = curve.pointFromJSON(json.unblind);\n\n return new this(blind, unblind);\n }\n}\n\n/**\n * Endo\n */\n\nclass Endo {\n constructor(beta, lambda, basis, pre) {\n this.beta = beta;\n this.lambda = lambda;\n this.basis = basis;\n this.pre = pre;\n }\n\n toJSON() {\n return {\n beta: this.beta.fromRed().toJSON(),\n lambda: this.lambda.toJSON(),\n basis: [\n this.basis[0].toJSON(),\n this.basis[1].toJSON()\n ],\n pre: [\n this.pre[0],\n this.pre[1].toJSON(),\n this.pre[2].toJSON()\n ]\n };\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof Curve);\n assert(json && typeof json === 'object');\n assert(Array.isArray(json.basis));\n assert(Array.isArray(json.pre));\n assert(json.basis.length === 2);\n assert(json.pre.length === 3);\n assert((json.pre[0] >>> 0) === json.pre[0]);\n\n const beta = BN.fromJSON(json.beta).toRed(curve.red);\n const lambda = BN.fromJSON(json.lambda);\n\n const basis = [\n Vector.fromJSON(json.basis[0]),\n Vector.fromJSON(json.basis[1])\n ];\n\n const pre = [\n json.pre[0],\n BN.fromJSON(json.pre[1]),\n BN.fromJSON(json.pre[2])\n ];\n\n return new this(beta, lambda, basis, pre);\n }\n}\n\n/**\n * Vector\n */\n\nclass Vector {\n constructor(a, b) {\n this.a = a;\n this.b = b;\n }\n\n toJSON() {\n return {\n a: this.a.toJSON(),\n b: this.b.toJSON()\n };\n }\n\n static fromJSON(json) {\n assert(json && typeof json === 'object');\n\n const a = BN.fromJSON(json.a);\n const b = BN.fromJSON(json.b);\n\n return new this(a, b);\n }\n}\n\n/**\n * P192\n * https://tinyurl.com/fips-186-2 (page 29)\n * https://tinyurl.com/fips-186-3 (page 88)\n */\n\nclass P192 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P192',\n ossl: 'prime192v1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'p192',\n // 2^192 - 2^64 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff ffffffff'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff fffffffc'],\n b: ['64210519 e59c80e7 0fa7e9ab 72243049',\n 'feb8deec c146b9b1'],\n n: ['ffffffff ffffffff ffffffff 99def836',\n '146bc9b1 b4d22831'],\n h: '1',\n // Icart\n z: '-5',\n g: [\n ['188da80e b03090f6 7cbf20eb 43a18800',\n 'f4ff0afd 82ff1012'],\n ['07192b95 ffc8da78 631011ed 6b24cdd5',\n '73f977a1 1e794811'],\n pre\n ]\n });\n }\n}\n\n/**\n * P224\n * https://tinyurl.com/fips-186-2 (page 30)\n * https://tinyurl.com/fips-186-3 (page 88)\n */\n\nclass P224 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P224',\n ossl: 'secp224r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'p224',\n // 2^224 - 2^96 + 1 (1 mod 16)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n '00000000 00000000 00000001'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff ffffffff fffffffe'],\n b: ['b4050a85 0c04b3ab f5413256 5044b0b7',\n 'd7bfd8ba 270b3943 2355ffb4'],\n n: ['ffffffff ffffffff ffffffff ffff16a2',\n 'e0b8f03e 13dd2945 5c5c2a3d'],\n h: '1',\n // SSWU\n z: '1f',\n g: [\n ['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3',\n '56c21122 343280d6 115c1d21'],\n ['bd376388 b5f723fb 4c22dfe6 cd4375a0',\n '5a074764 44d58199 85007e34'],\n pre\n ]\n });\n }\n}\n\n/**\n * P256\n * https://tinyurl.com/fips-186-2 (page 31)\n * https://tinyurl.com/fips-186-3 (page 89)\n */\n\nclass P256 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P256',\n ossl: 'prime256v1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: null,\n // 2^256 - 2^224 + 2^192 + 2^96 - 1 (= 3 mod 4)\n p: ['ffffffff 00000001 00000000 00000000',\n '00000000 ffffffff ffffffff ffffffff'],\n // -3 mod p\n a: ['ffffffff 00000001 00000000 00000000',\n '00000000 ffffffff ffffffff fffffffc'],\n b: ['5ac635d8 aa3a93e7 b3ebbd55 769886bc',\n '651d06b0 cc53b0f6 3bce3c3e 27d2604b'],\n n: ['ffffffff 00000000 ffffffff ffffffff',\n 'bce6faad a7179e84 f3b9cac2 fc632551'],\n h: '1',\n // SSWU\n z: '-a',\n g: [\n ['6b17d1f2 e12c4247 f8bce6e5 63a440f2',\n '77037d81 2deb33a0 f4a13945 d898c296'],\n ['4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16',\n '2bce3357 6b315ece cbb64068 37bf51f5'],\n pre\n ]\n });\n }\n}\n\n/**\n * P384\n * https://tinyurl.com/fips-186-2 (page 32)\n * https://tinyurl.com/fips-186-3 (page 89)\n */\n\nclass P384 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P384',\n ossl: 'secp384r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA384',\n prime: null,\n // 2^384 - 2^128 - 2^96 + 2^32 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff 00000000 00000000 ffffffff'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff 00000000 00000000 fffffffc'],\n b: ['b3312fa7 e23ee7e4 988e056b e3f82d19',\n '181d9c6e fe814112 0314088f 5013875a',\n 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'],\n n: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff c7634d81 f4372ddf',\n '581a0db2 48b0a77a ecec196a ccc52973'],\n h: '1',\n // Icart\n z: '-c',\n g: [\n ['aa87ca22 be8b0537 8eb1c71e f320ad74',\n '6e1d3b62 8ba79b98 59f741e0 82542a38',\n '5502f25d bf55296c 3a545e38 72760ab7'],\n ['3617de4a 96262c6f 5d9e98bf 9292dc29',\n 'f8f41dbd 289a147c e9da3113 b5f0b8c0',\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'],\n pre\n ]\n });\n }\n}\n\n/**\n * P521\n * https://tinyurl.com/fips-186-2 (page 33)\n * https://tinyurl.com/fips-186-3 (page 90)\n */\n\nclass P521 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P521',\n ossl: 'secp521r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA512',\n prime: 'p521',\n // 2^521 - 1 (= 3 mod 4)\n p: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff'],\n // -3 mod p\n a: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'fffffffc'],\n b: ['00000051 953eb961 8e1c9a1f 929a21a0',\n 'b68540ee a2da725b 99b315f3 b8b48991',\n '8ef109e1 56193951 ec7e937b 1652c0bd',\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4',\n '6b503f00'],\n n: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'fffffffa 51868783 bf2f966b 7fcc0148',\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e',\n '91386409'],\n h: '1',\n // SSWU\n z: '-4',\n g: [\n ['000000c6 858e06b7 0404e9cd 9e3ecb66',\n '2395b442 9c648139 053fb521 f828af60',\n '6b4d3dba a14b5e77 efe75928 fe1dc127',\n 'a2ffa8de 3348b3c1 856a429b f97e7e31',\n 'c2e5bd66'],\n ['00000118 39296a78 9a3bc004 5c8a5fb4',\n '2c7d1bd9 98f54449 579b4468 17afbd17',\n '273e662c 97ee7299 5ef42640 c550b901',\n '3fad0761 353c7086 a272c240 88be9476',\n '9fd16650'],\n pre\n ]\n });\n }\n}\n\n/**\n * SECP256K1\n * https://www.secg.org/SEC2-Ver-1.0.pdf (page 15, section 2.7.1)\n * https://www.secg.org/sec2-v2.pdf (page 9, section 2.4.1)\n */\n\nclass SECP256K1 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'SECP256K1',\n ossl: 'secp256k1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'k256',\n // 2^256 - 2^32 - 977 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe fffffc2f'],\n a: '0',\n b: '7',\n n: ['ffffffff ffffffff ffffffff fffffffe',\n 'baaedce6 af48a03b bfd25e8c d0364141'],\n h: '1',\n // SVDW\n z: '1',\n // sqrt(-3)\n c: ['0a2d2ba9 3507f1df 233770c2 a797962c',\n 'c61f6d15 da14ecd4 7d8d27ae 1cd5f852'],\n g: [\n ['79be667e f9dcbbac 55a06295 ce870b07',\n '029bfcdb 2dce28d9 59f2815b 16f81798'],\n ['483ada77 26a3c465 5da4fbfc 0e1108a8',\n 'fd17b448 a6855419 9c47d08f fb10d4b8'],\n pre\n ],\n // Precomputed endomorphism.\n endo: {\n beta: ['7ae96a2b 657c0710 6e64479e ac3434e9',\n '9cf04975 12f58995 c1396c28 719501ee'],\n lambda: ['5363ad4c c05c30e0 a5261c02 8812645a',\n '122e22ea 20816678 df02967c 1b23bd72'],\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3'\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15'\n }\n ],\n pre: [\n 384,\n ['3086d221 a7d46bcd e86c90e4 9284eb15',\n '3daa8a14 71e8ca7f e893209a 45dbb031'],\n ['-',\n 'e4437ed6 010e8828 6f547fa9 0abfe4c4',\n '221208ac 9df506c6 1571b4ae 8ac47f71']\n ]\n }\n });\n }\n}\n\n/**\n * BRAINPOOLP256\n * https://tools.ietf.org/html/rfc5639#section-3.4\n */\n\nclass BRAINPOOLP256 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP256',\n ossl: 'brainpoolP256r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: null,\n // (= 3 mod 4)\n p: ['a9fb57db a1eea9bc 3e660a90 9d838d72',\n '6e3bf623 d5262028 2013481d 1f6e5377'],\n a: ['7d5a0975 fc2c3057 eef67530 417affe7',\n 'fb8055c1 26dc5c6c e94a4b44 f330b5d9'],\n b: ['26dc5c6c e94a4b44 f330b5d9 bbd77cbf',\n '95841629 5cf7e1ce 6bccdc18 ff8c07b6'],\n n: ['a9fb57db a1eea9bc 3e660a90 9d838d71',\n '8c397aa3 b561a6f7 901e0e82 974856a7'],\n h: '1',\n // Icart\n z: '-2',\n g: [\n ['8bd2aeb9 cb7e57cb 2c4b482f fc81b7af',\n 'b9de27e1 e3bd23c2 3a4453bd 9ace3262'],\n ['547ef835 c3dac4fd 97f8461a 14611dc9',\n 'c2774513 2ded8e54 5c1d54c7 2f046997'],\n pre\n ]\n });\n }\n}\n\n/**\n * BRAINPOOLP384\n * https://tools.ietf.org/html/rfc5639#section-3.6\n */\n\nclass BRAINPOOLP384 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP384',\n ossl: 'brainpoolP384r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA384',\n prime: null,\n // (= 3 mod 4)\n p: ['8cb91e82 a3386d28 0f5d6f7e 50e641df',\n '152f7109 ed5456b4 12b1da19 7fb71123',\n 'acd3a729 901d1a71 87470013 3107ec53'],\n a: ['7bc382c6 3d8c150c 3c72080a ce05afa0',\n 'c2bea28e 4fb22787 139165ef ba91f90f',\n '8aa5814a 503ad4eb 04a8c7dd 22ce2826'],\n b: ['04a8c7dd 22ce2826 8b39b554 16f0447c',\n '2fb77de1 07dcd2a6 2e880ea5 3eeb62d5',\n '7cb43902 95dbc994 3ab78696 fa504c11'],\n n: ['8cb91e82 a3386d28 0f5d6f7e 50e641df',\n '152f7109 ed5456b3 1f166e6c ac0425a7',\n 'cf3ab6af 6b7fc310 3b883202 e9046565'],\n h: '1',\n // SSWU\n z: '-5',\n g: [\n ['1d1c64f0 68cf45ff a2a63a81 b7c13f6b',\n '8847a3e7 7ef14fe3 db7fcafe 0cbd10e8',\n 'e826e034 36d646aa ef87b2e2 47d4af1e'],\n ['8abe1d75 20f9c2a4 5cb1eb8e 95cfd552',\n '62b70b29 feec5864 e19c054f f9912928',\n '0e464621 77918111 42820341 263c5315'],\n pre\n ]\n });\n }\n}\n\n/**\n * BRAINPOOLP512\n * https://tools.ietf.org/html/rfc5639#section-3.7\n */\n\nclass BRAINPOOLP512 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP512',\n ossl: 'brainpoolP512r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA512',\n prime: null,\n // (= 3 mod 4)\n p: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07',\n 'cb308db3 b3c9d20e d6639cca 70330871',\n '7d4d9b00 9bc66842 aecda12a e6a380e6',\n '2881ff2f 2d82c685 28aa6056 583a48f3'],\n a: ['7830a331 8b603b89 e2327145 ac234cc5',\n '94cbdd8d 3df91610 a83441ca ea9863bc',\n '2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5',\n '7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca'],\n b: ['3df91610 a83441ca ea9863bc 2ded5d5a',\n 'a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7',\n '2bf2c7b9 e7c1ac4d 77fc94ca dc083e67',\n '984050b7 5ebae5dd 2809bd63 8016f723'],\n n: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07',\n 'cb308db3 b3c9d20e d6639cca 70330870',\n '553e5c41 4ca92619 41866119 7fac1047',\n '1db1d381 085ddadd b5879682 9ca90069'],\n h: '1',\n // Icart\n z: '7',\n g: [\n ['81aee4bd d82ed964 5a21322e 9c4c6a93',\n '85ed9f70 b5d916c1 b43b62ee f4d0098e',\n 'ff3b1f78 e2d0d48d 50d1687b 93b97d5f',\n '7c6d5047 406a5e68 8b352209 bcb9f822'],\n ['7dde385d 566332ec c0eabfa9 cf7822fd',\n 'f209f700 24a57b1a a000c55b 881f8111',\n 'b2dcde49 4a5f485e 5bca4bd8 8a2763ae',\n 'd1ca2b2f a8f05406 78cd1e0f 3ad80892'],\n pre\n ]\n });\n }\n}\n\n/**\n * X25519\n * https://tools.ietf.org/html/rfc7748#section-4.1\n */\n\nclass X25519 extends MontCurve {\n constructor() {\n super({\n id: 'X25519',\n ossl: 'X25519',\n type: 'mont',\n endian: 'le',\n hash: 'SHA512',\n prime: 'p25519',\n // 2^255 - 19 (= 5 mod 8)\n p: ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffed'],\n // 486662\n a: '76d06',\n b: '1',\n n: ['10000000 00000000 00000000 00000000',\n '14def9de a2f79cd6 5812631a 5cf5d3ed'],\n h: '8',\n // Elligator 2\n z: '2',\n g: [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000009'],\n // See: https://www.rfc-editor.org/errata/eid4730\n ['5f51e65e 475f794b 1fe122d3 88b72eb3',\n '6dc2b281 92839e4d d6163a5d 81312c14']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001'],\n ['6be4f497 f9a9c2af c21fa77a d7f4a6ef',\n '635a11c7 284a9363 e9a248ef 9c884415']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001'],\n ['141b0b68 06563d50 3de05885 280b5910',\n '9ca5ee38 d7b56c9c 165db710 6377bbd8']\n ],\n [\n ['57119fd0 dd4e22d8 868e1c58 c45c4404',\n '5bef839c 55b1d0b1 248c50a3 bc959c5f'],\n ['68c59389 3d458e64 31c6ca00 45fb5015',\n '20a44346 8eaa68dd 0f103842 048065b7']\n ],\n [\n ['57119fd0 dd4e22d8 868e1c58 c45c4404',\n '5bef839c 55b1d0b1 248c50a3 bc959c5f'],\n ['173a6c76 c2ba719b ce3935ff ba04afea',\n 'df5bbcb9 71559722 f0efc7bd fb7f9a36']\n ],\n [\n ['00b8495f 16056286 fdb1329c eb8d09da',\n '6ac49ff1 fae35616 aeb8413b 7c7aebe0'],\n ['3931c129 569e83a5 29482c14 e628b457',\n '933bfc29 ed801b4d 68871483 92507b1a']\n ],\n [\n ['00b8495f 16056286 fdb1329c eb8d09da',\n '6ac49ff1 fae35616 aeb8413b 7c7aebe0'],\n ['46ce3ed6 a9617c5a d6b7d3eb 19d74ba8',\n '6cc403d6 127fe4b2 9778eb7c 6daf84d3']\n ]\n ]\n });\n }\n}\n\n/**\n * X448\n * https://tools.ietf.org/html/rfc7748#section-4.2\n */\n\nclass X448 extends MontCurve {\n constructor() {\n super({\n id: 'X448',\n ossl: 'X448',\n type: 'mont',\n endian: 'le',\n hash: 'SHAKE256',\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n // 156326\n a: '262a6',\n b: '1',\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000005'],\n ['7d235d12 95f5b1f6 6c98ab6e 58326fce',\n 'cbae5d34 f55545d0 60f75dc2 8df3f6ed',\n 'b8027e23 46430d21 1312c4b1 50677af7',\n '6fd7223d 457b5b1a']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['ba4d3a08 29b6112f 8812e51b a0bb2abe',\n 'bc1cb08e b48e5569 36ba50fd d2e7d68a',\n 'f8cb3216 0522425b 3f990812 abbe635a',\n 'd37a21e1 7551b193']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['45b2c5f7 d649eed0 77ed1ae4 5f44d541',\n '43e34f71 4b71aa96 c945af01 2d182975',\n '0734cde9 faddbda4 c066f7ed 54419ca5',\n '2c85de1e 8aae4e6c']\n ]\n ]\n });\n }\n}\n\n/**\n * MONT448\n * Isomorphic to Ed448-Goldilocks.\n */\n\nclass MONT448 extends MontCurve {\n constructor() {\n super({\n id: 'MONT448',\n ossl: null,\n type: 'mont',\n endian: 'le',\n hash: 'SHAKE256',\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n // -78160 / -39082 mod p\n a: ['b2cf97d2 d43459a9 31ed36b1 fc4e3cb5',\n '5d93f8d2 22746997 60ccffc6 49961ed6',\n 'c5b05fca c24864ed 6fb59697 931b78da',\n '84ddecd8 ca2b5cfb'],\n b: '1',\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['ac0d24cc c6c75cb0 eb71f81e 7a6edf51',\n '48e88aee 009a2a24 e795687e c28e125a',\n '3e6730a6 0d46367b aa7fe99d 152128dc',\n '41321bc7 7817f059'],\n ['5a4437f6 80c0d0db 9b061276 d5d0ffcc',\n 'e786ff33 b6a53d30 98746425 82e66f09',\n '4433dae7 7244a6e2 6b11e905 7228f483',\n '556c41a5 913f55fe']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['bec92fd0 6da2acf2 b4e261e8 7cef0d34',\n '22e75c18 3c589857 b71924e5 73c2f9ce',\n 'e18da5f2 466e2f39 3c2eedf0 f105a60a',\n 'b40c717d 4f1e1fd7']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['4136d02f 925d530d 4b1d9e17 8310f2cb',\n 'dd18a3e7 c3a767a8 48e6db19 8c3d0631',\n '1e725a0d b991d0c6 c3d1120f 0efa59f5',\n '4bf38e82 b0e1e028']\n ]\n ]\n });\n }\n}\n\n/**\n * ED25519\n * https://tools.ietf.org/html/rfc8032#section-5.1\n */\n\nclass ED25519 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ED25519',\n ossl: 'ED25519',\n type: 'edwards',\n endian: 'le',\n hash: 'SHA512',\n prefix: 'SigEd25519 no Ed25519 collisions',\n context: false,\n prime: 'p25519',\n // 2^255 - 19 (= 5 mod 8)\n p: ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffed'],\n a: '-1',\n // -121665 / 121666 mod p\n d: ['52036cee 2b6ffe73 8cc74079 7779e898',\n '00700a4d 4141d8ab 75eb4dca 135978a3'],\n n: ['10000000 00000000 00000000 00000000',\n '14def9de a2f79cd6 5812631a 5cf5d3ed'],\n h: '8',\n // Elligator 2\n z: '2',\n g: [\n ['216936d3 cd6e53fe c0a4e231 fdd6dc5c',\n '692cc760 9525a7b2 c9562d60 8f25d51a'],\n // 4/5\n ['66666666 66666666 66666666 66666666',\n '66666666 66666666 66666666 66666658'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffec']\n ],\n [\n ['2b832480 4fc1df0b 2b4d0099 3dfbd7a7',\n '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['547cdb7f b03e20f4 d4b2ff66 c2042858',\n 'd0bce7f9 52d01b87 3b11e4d8 b5f15f3d'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['1fd5b9a0 06394a28 e9339932 38de4abb',\n '5c193c70 13e5e238 dea14646 c545d14a'],\n ['05fc536d 880238b1 3933c6d3 05acdfd5',\n 'f098eff2 89f4c345 b027b2c2 8f95e826']\n ],\n [\n ['602a465f f9c6b5d7 16cc66cd c721b544',\n 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'],\n ['05fc536d 880238b1 3933c6d3 05acdfd5',\n 'f098eff2 89f4c345 b027b2c2 8f95e826']\n ],\n [\n ['1fd5b9a0 06394a28 e9339932 38de4abb',\n '5c193c70 13e5e238 dea14646 c545d14a'],\n ['7a03ac92 77fdc74e c6cc392c fa53202a',\n '0f67100d 760b3cba 4fd84d3d 706a17c7']\n ],\n [\n ['602a465f f9c6b5d7 16cc66cd c721b544',\n 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'],\n ['7a03ac92 77fdc74e c6cc392c fa53202a',\n '0f67100d 760b3cba 4fd84d3d 706a17c7']\n ]\n ]\n });\n }\n}\n\n/**\n * ISO448\n * https://tools.ietf.org/html/rfc7748#section-4.2\n * https://git.zx2c4.com/goldilocks/tree/_aux/ristretto/ristretto.sage#n658\n */\n\nclass ISO448 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ISO448',\n ossl: null,\n type: 'edwards',\n endian: 'le',\n hash: 'SHAKE256',\n prefix: 'SigEd448',\n context: true,\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n a: '1',\n // 39082 / 39081 mod p\n d: ['d78b4bdc 7f0daf19 f24f38c2 9373a2cc',\n 'ad461572 42a50f37 809b1da3 412a12e7',\n '9ccc9c81 264cfe9a d0809970 58fb61c4',\n '243cc32d baa156b9'],\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['79a70b2b 70400553 ae7c9df4 16c792c6',\n '1128751a c9296924 0c25a07d 728bdc93',\n 'e21f7787 ed697224 9de732f3 8496cd11',\n '69871309 3e9c04fc'],\n // Note: the RFC has this wrong.\n ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 80000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ]\n ]\n });\n }\n}\n\n/**\n * ED448\n * https://tools.ietf.org/html/rfc8032#section-5.2\n */\n\nclass ED448 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ED448',\n ossl: 'ED448',\n type: 'edwards',\n endian: 'le',\n hash: 'SHAKE256',\n prefix: 'SigEd448',\n context: true,\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n a: '1',\n // -39081 mod p\n d: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffff6756'],\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['4f1970c6 6bed0ded 221d15a6 22bf36da',\n '9e146570 470f1767 ea6de324 a3d3a464',\n '12ae1af7 2ab66511 433b80e1 8b00938e',\n '2626a82b c70cc05e'],\n ['693f4671 6eb6bc24 88762037 56c9c762',\n '4bea7373 6ca39840 87789c1e 05a0c2d7',\n '3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad',\n '9808795b f230fa14'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ]\n ]\n });\n }\n}\n\n/*\n * Curve Registry\n */\n\nconst curves = {\n __proto__: null,\n P192,\n P224,\n P256,\n P384,\n P521,\n SECP256K1,\n BRAINPOOLP256,\n BRAINPOOLP384,\n BRAINPOOLP512,\n X25519,\n X448,\n MONT448,\n ED25519,\n ISO448,\n ED448\n};\n\nconst cache = {\n __proto__: null,\n P192: null,\n P224: null,\n P256: null,\n P384: null,\n P521: null,\n SECP256K1: null,\n BRAINPOOLP256: null,\n BRAINPOOLP384: null,\n BRAINPOOLP512: null,\n X25519: null,\n X448: null,\n MONT448: null,\n ED25519: null,\n ISO448: null,\n ED448: null\n};\n\nfunction curve(name, ...args) {\n assert(typeof name === 'string');\n\n const key = name.toUpperCase();\n\n let curve = cache[key];\n\n if (!curve) {\n const Curve = curves[key];\n\n if (!Curve)\n throw new Error(`Curve not found: \"${name}\".`);\n\n curve = new Curve(...args);\n cache[key] = curve;\n }\n\n return curve;\n}\n\nfunction register(name, Curve) {\n assert(typeof name === 'string');\n assert(typeof Curve === 'function');\n\n const key = name.toUpperCase();\n\n if (curves[key])\n throw new Error(`Curve already registered: \"${name}\".`);\n\n curves[key] = Curve;\n cache[key] = null;\n}\n\n/*\n * Scalar Recoding\n */\n\nfunction getNAF(k, width, max) {\n // Computing the width-w NAF of a positive integer.\n //\n // [GECC] Algorithm 3.35, Page 100, Section 3.3.\n //\n // The above document describes a rather abstract\n // method of recoding. The more optimal method\n // below was ported from libsecp256k1.\n assert(k instanceof BN);\n assert(!k.red);\n assert((width >>> 0) === width);\n assert((max >>> 0) === max);\n\n const naf = new Array(max);\n const bits = k.bitLength() + 1;\n const sign = k.sign() | 1;\n\n assert(bits <= max);\n\n for (let i = 0; i < max; i++)\n naf[i] = 0;\n\n let i = 0;\n let carry = 0;\n let word;\n\n while (i < bits) {\n if (k.bit(i) === carry) {\n i += 1;\n continue;\n }\n\n word = k.bits(i, width) + carry;\n carry = (word >> (width - 1)) & 1;\n word -= carry << width;\n\n naf[i] = sign * word;\n\n i += width;\n }\n\n assert(carry === 0);\n\n return naf;\n}\n\nfunction getFixedNAF(k, width, max, step) {\n assert((step >>> 0) === step);\n\n // Recode to NAF.\n const naf = getNAF(k, width, max);\n\n // Translate into more windowed form.\n const len = Math.ceil(naf.length / step);\n const repr = new Array(len);\n\n let i = 0;\n\n for (let j = 0; j < naf.length; j += step) {\n let nafW = 0;\n\n for (let k = j + step - 1; k >= j; k--)\n nafW = (nafW << 1) + naf[k];\n\n repr[i++] = nafW;\n }\n\n assert(i === len);\n\n return repr;\n}\n\nfunction getJSF(k1, k2, max) {\n // Joint sparse form.\n //\n // [GECC] Algorithm 3.50, Page 111, Section 3.3.\n assert(k1 instanceof BN);\n assert(k2 instanceof BN);\n assert(!k1.red);\n assert(!k2.red);\n assert((max >>> 0) === max);\n\n const jsf = [new Array(max), new Array(max)];\n const bits = Math.max(k1.bitLength(), k2.bitLength()) + 1;\n const s1 = k1.sign() | 1;\n const s2 = k2.sign() | 1;\n\n assert(bits <= max);\n\n let d1 = 0;\n let d2 = 0;\n\n for (let i = 0; i < bits; i++) {\n const b1 = k1.bits(i, 3);\n const b2 = k2.bits(i, 3);\n\n // First phase.\n let m14 = ((b1 & 3) + d1) & 3;\n let m24 = ((b2 & 3) + d2) & 3;\n let u1 = 0;\n let u2 = 0;\n\n if (m14 === 3)\n m14 = -1;\n\n if (m24 === 3)\n m24 = -1;\n\n if (m14 & 1) {\n const m8 = ((b1 & 7) + d1) & 7;\n\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n\n if (m24 & 1) {\n const m8 = ((b2 & 7) + d2) & 7;\n\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n\n jsf[0][i] = u1 * s1;\n jsf[1][i] = u2 * s2;\n\n // Second phase.\n if (2 * d1 === 1 + u1)\n d1 = 1 - d1;\n\n if (2 * d2 === 1 + u2)\n d2 = 1 - d2;\n }\n\n for (let i = bits; i < max; i++) {\n jsf[0][i] = 0;\n jsf[1][i] = 0;\n }\n\n return jsf;\n}\n\nfunction getJNAF(c1, c2, max) {\n const jsf = getJSF(c1, c2, max);\n const naf = new Array(max);\n\n // JSF -> NAF conversion.\n for (let i = 0; i < max; i++) {\n const ja = jsf[0][i];\n const jb = jsf[1][i];\n\n naf[i] = jsfIndex[(ja + 1) * 3 + (jb + 1)];\n }\n\n return naf;\n}\n\n/*\n * Helpers\n */\n\nfunction assert(val, msg) {\n if (!val) {\n const err = new Error(msg || 'Assertion failed');\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, assert);\n\n throw err;\n }\n}\n\nfunction wrapErrors(fn) {\n assert(typeof fn === 'function');\n\n try {\n return fn();\n } catch (e) {\n if (e.message === 'X is not a square mod P.'\n || e.message === 'Not invertible.') {\n throw new Error('Invalid point.');\n }\n throw e;\n }\n}\n\nfunction mod(x, y) {\n // Euclidean modulo.\n let r = x % y;\n\n if (r < 0) {\n if (y < 0)\n r -= y;\n else\n r += y;\n }\n\n return r;\n}\n\nfunction cubeRoot(x) {\n assert(x instanceof BN);\n assert(x.red);\n\n const p = x.red.m;\n\n if (p.cmpn(3) <= 0)\n return x.clone();\n\n // p = 2 mod 3\n if (p.modrn(3) === 2) {\n // e = (2 * p - 1) / 3\n const e = p.ushln(1).isubn(1).idivn(3);\n return x.redPow(e);\n }\n\n const mod9 = p.modrn(9);\n\n // p = 4 mod 9\n if (mod9 === 4) {\n // e = (2 * p + 1) / 9\n const e = p.ushln(1).iaddn(1).idivn(9);\n const r = x.redPow(e);\n const c = r.redSqr().redMul(r);\n\n if (!c.eq(x))\n throw new Error('X is not a cube mod P.');\n\n return r;\n }\n\n // p = 7 mod 9\n if (mod9 === 7) {\n // e = (p + 2) / 9\n const e = p.addn(2).idivn(9);\n const r = x.redPow(e);\n const c = r.redSqr().redMul(r);\n\n if (!c.eq(x))\n throw new Error('X is not a cube mod P.');\n\n return r;\n }\n\n throw new Error('Not implemented.');\n}\n\nfunction cubeRoots(x) {\n const r0 = cubeRoot(x);\n\n // p = 1 mod 3\n if (x.red.m.modrn(3) === 1) {\n // Multiply by roots of unity to find other roots.\n const two = new BN(2).toRed(x.red);\n const three = new BN(3).toRed(x.red);\n const i2 = two.redInvert();\n const s1 = three.redNeg().redSqrt().redMul(i2);\n const s2 = s1.redNeg();\n const u1 = s1.redSub(i2);\n const u2 = s2.redSub(i2);\n const r1 = r0.redMul(u1);\n const r2 = r0.redMul(u2);\n\n return [r0, r1, r2];\n }\n\n // p = 2 mod 3 guarantees 1 cube root per element.\n return [r0];\n}\n\nfunction uncube(x) {\n // Find a cube root which is also a quadratic residue.\n for (const root of cubeRoots(x)) {\n if (root.redJacobi() >= 0)\n return root;\n }\n\n throw new Error('X^(1/3) is not a square mod P.');\n}\n\nfunction randomInt(rng) {\n return BN.randomBits(rng, 32).toNumber();\n}\n\nfunction memoize(method, self) {\n const cache = new WeakMap();\n\n return function memoized(curve, invert) {\n const i = invert & 1;\n const item = cache.get(curve);\n\n if (item && item[i] !== null)\n return item[i];\n\n const result = method.call(self, curve, invert);\n\n if (!cache.has(curve))\n cache.set(curve, [null, null]);\n\n cache.get(curve)[i] = result;\n\n return result;\n };\n}\n\nfunction toPretty(x, size) {\n assert(x instanceof BN);\n assert((size >>> 0) === size);\n\n if (size & 7)\n size += 8 - (size & 7);\n\n const str = x.toString(16, size);\n const chunks = [];\n const out = [];\n\n assert((str.length & 7) === 0);\n\n for (let i = 0; i < str.length; i += 8)\n chunks.push(str.slice(i, i + 8));\n\n for (let i = 0; i < chunks.length; i += 4)\n out.push(chunks.slice(i, i + 4).join(' '));\n\n return out;\n}\n\n/*\n * Expose\n */\n\nexports.Curve = Curve;\nexports.Point = Point;\nexports.ShortCurve = ShortCurve;\nexports.ShortPoint = ShortPoint;\nexports.JPoint = JPoint;\nexports.MontCurve = MontCurve;\nexports.MontPoint = MontPoint;\nexports.XPoint = XPoint;\nexports.EdwardsCurve = EdwardsCurve;\nexports.EdwardsPoint = EdwardsPoint;\nexports.curves = curves;\nexports.curve = curve;\nexports.register = register;\n","/*!\n * random.js - random number generator for bcrypto\n * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://wiki.openssl.org/index.php/Random_Numbers\n * https://csrc.nist.gov/projects/random-bit-generation/\n * http://www.pcg-random.org/posts/bounded-rands.html\n * https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/*\n * Constants\n */\n\nconst crypto = global.crypto || global.msCrypto;\nconst HAS_CRYPTO = crypto && typeof crypto.getRandomValues === 'function';\nconst randomValues = HAS_CRYPTO ? crypto.getRandomValues.bind(crypto) : null;\nconst pool = new Uint32Array(16);\nconst MAX_BYTES = 65536;\n\nlet poolPos = 0;\n\n/**\n * Generate pseudo-random bytes.\n * @param {Number} size\n * @returns {Buffer}\n */\n\nfunction randomBytes(size) {\n assert((size >>> 0) === size);\n\n const data = Buffer.alloc(size);\n\n randomFillSync(data, 0, size);\n\n return data;\n}\n\n/**\n * Generate pseudo-random bytes.\n * @param {Buffer} data\n * @param {Number} [off=0]\n * @param {Number} [size=data.length-off]\n * @returns {Buffer}\n */\n\nfunction randomFill(data, off, size) {\n assert(Buffer.isBuffer(data));\n\n if (off == null)\n off = 0;\n\n assert((off >>> 0) === off);\n\n if (size == null)\n size = data.length - off;\n\n assert((size >>> 0) === size);\n assert(off + size <= data.length);\n\n randomFillSync(data, off, size);\n\n return data;\n}\n\n/**\n * Generate a random uint32.\n * @returns {Number}\n */\n\nfunction randomInt() {\n if ((poolPos & 15) === 0) {\n getRandomValues(pool);\n poolPos = 0;\n }\n\n return pool[poolPos++];\n}\n\n/**\n * Generate a random uint32 within a range.\n * @param {Number} min - Inclusive.\n * @param {Number} max - Exclusive.\n * @returns {Number}\n */\n\nfunction randomRange(min, max) {\n assert((min >>> 0) === min);\n assert((max >>> 0) === max);\n assert(max >= min);\n\n const space = max - min;\n\n if (space === 0)\n return min;\n\n const top = -space >>> 0;\n\n let x, r;\n\n do {\n x = randomInt();\n r = x % space;\n } while (x - r > top);\n\n return r + min;\n}\n\n/*\n * Helpers\n */\n\nfunction getRandomValues(array) {\n if (!HAS_CRYPTO)\n throw new Error('Entropy source not available.');\n\n return randomValues(array);\n}\n\nfunction randomFillSync(data, off, size) {\n assert(Buffer.isBuffer(data));\n assert(data.buffer instanceof ArrayBuffer);\n assert((data.byteOffset >>> 0) === data.byteOffset);\n assert((data.byteLength >>> 0) === data.byteLength);\n assert((off >>> 0) === off);\n assert((size >>> 0) === size);\n assert(off + size <= data.byteLength);\n\n if (size > 2 ** 31 - 1)\n throw new RangeError('The value \"size\" is out of range.');\n\n const offset = data.byteOffset + off;\n const array = new Uint8Array(data.buffer, offset, size);\n\n if (array.length > MAX_BYTES) {\n for (let i = 0; i < array.length; i += MAX_BYTES) {\n let j = i + MAX_BYTES;\n\n if (j > array.length)\n j = array.length;\n\n getRandomValues(array.subarray(i, j));\n }\n } else {\n if (array.length > 0)\n getRandomValues(array);\n }\n}\n\n/*\n * Expose\n */\n\nexports.native = 0;\nexports.randomBytes = randomBytes;\nexports.randomFill = randomFill;\nexports.randomInt = randomInt;\nexports.randomRange = randomRange;\n","/*!\n * random.js - random for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/random');\n","/*!\n * eddsa.js - EdDSA for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/elliptic:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/elliptic\n *\n * References:\n *\n * [EDDSA] High-speed high-security signatures\n * D. J. Bernstein, N. Duif, T. Lange, P. Schwabe, B. Yang\n * https://ed25519.cr.yp.to/ed25519-20110926.pdf\n *\n * [RFC8032] Edwards-Curve Digital Signature Algorithm (EdDSA)\n * S. Josefsson, I. Liusvaara\n * https://tools.ietf.org/html/rfc8032\n *\n * Implementation Notes:\n *\n * - In contrast to the ECDSA backend, we allow points at\n * infinity (in all functions).\n *\n * - Mike Hamburg's Ed448-Goldilocks rejects both infinity as\n * well as the torsion point (0, -1). We do not replicate\n * this behavior.\n *\n * - For Ed25519, we do \"cofactor-less\" verification by default.\n * This means torsion components will affect the result of the\n * verification.\n *\n * - For Ed448, we do cofactor verification by default to mimic\n * OpenSSL and Mike Hamburg's Ed448-Goldilocks implementation.\n *\n * - `verifySingle`/`verifyBatch` do cofactor verification. Do\n * not use `verifyBatch` expecting the same results as the\n * regular `verify` call[1]. This will not be the case for\n * Ed25519.\n *\n * - All functions are completely unaware of points of small\n * order and torsion components (in other words, points will\n * not be explicitly checked for this, anywhere).\n *\n * - `deriveWithScalar` and `exchangeWithScalar` automatically\n * clamp scalars before multiplying (meaning torsion components\n * are removed from the result and points of small order will\n * be normalized to infinity).\n *\n * - The HD function, `publicKeyTweakMul`, _does not_ clamp\n * automatically. It is possible to end up with a torsion\n * component in the resulting point (assuming the input\n * point had one).\n *\n * - Ed448-Goldilocks is 4-isogenous to Curve448. This means\n * that when converting to Curve448, small order points will\n * be normalized to (0, 0). When converting back to Ed448,\n * any small order points will be normalized to infinity,\n * and any torsion components will be removed completely.\n * Also note that when converting back, the implementation\n * needs to divide the point by 4. This is a major perf hit,\n * so treat `x448.publicKeyConvert` as if it were a point\n * multiplication.\n *\n * - Elligators should not be used with Edwards curves. As\n * Tibouchi notes[2], regular public keys will map to\n * _distinguishable_ field elements as they are always in\n * the primary subgroup. Either the Ristretto Elligator[3],\n * or a prime order curve with an Elligator Squared[2]\n * construction are suitable alternatives here.\n *\n * - These notes also spell out why you should avoid using\n * Edwards curves on a blockchain[4].\n *\n * [1] https://moderncrypto.org/mail-archive/curves/2016/000836.html\n * [2] https://eprint.iacr.org/2014/043.pdf\n * [3] https://ristretto.group/formulas/elligator.html\n * [4] https://src.getmonero.org/2017/05/17/disclosure-of-a-major-bug-in-cryptonote-based-currencies.html\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst BatchRNG = require('./batch-rng');\nconst BN = require('../bn');\nconst elliptic = require('./elliptic');\nconst rng = require('../random');\n\n/*\n * EDDSA\n */\n\nclass EDDSA {\n constructor(id, mid, eid, hash, pre) {\n assert(typeof id === 'string');\n assert(!mid || typeof mid === 'string');\n assert(!eid || typeof eid === 'string');\n assert(hash);\n\n this.id = id;\n this.type = 'eddsa';\n this.mid = mid || null;\n this.eid = eid || null;\n this.hash = hash;\n this.native = 0;\n\n this._pre = pre || null;\n this._curve = null;\n this._mont = null;\n this._iso = null;\n this._rng = null;\n }\n\n get curve() {\n if (!this._curve) {\n this._curve = elliptic.curve(this.id, this._pre);\n this._curve.precompute(rng);\n this._pre = null;\n }\n return this._curve;\n }\n\n get mont() {\n if (this.mid && !this._mont)\n this._mont = elliptic.curve(this.mid);\n return this._mont;\n }\n\n get iso() {\n if (!this.eid)\n return this.mont;\n\n if (!this._iso)\n this._iso = elliptic.curve(this.eid);\n\n return this._iso;\n }\n\n get rng() {\n if (!this._rng)\n this._rng = new BatchRNG(this.curve);\n\n return this._rng;\n }\n\n get size() {\n return this.curve.adjustedSize;\n }\n\n get bits() {\n return this.curve.fieldBits;\n }\n\n hashNonce(prefix, msg, ph, ctx) {\n const hash = new Hash(this);\n\n hash.init(ph, ctx);\n hash.update(prefix);\n hash.update(msg);\n\n return hash.final();\n }\n\n hashChallenge(R, A, m, ph, ctx) {\n const hash = new Hash(this);\n\n hash.init(ph, ctx);\n hash.update(R);\n hash.update(A);\n hash.update(m);\n\n return hash.final();\n }\n\n privateKeyGenerate() {\n return rng.randomBytes(this.curve.adjustedSize);\n }\n\n scalarGenerate() {\n const scalar = rng.randomBytes(this.curve.scalarSize);\n return this.curve.clamp(scalar);\n }\n\n privateKeyExpand(secret) {\n assert(Buffer.isBuffer(secret));\n assert(secret.length === this.curve.adjustedSize);\n\n const hash = this.hash.digest(secret, this.curve.adjustedSize * 2);\n\n return this.curve.splitHash(hash);\n }\n\n privateKeyConvert(secret) {\n const [key] = this.privateKeyExpand(secret);\n return key;\n }\n\n privateKeyVerify(secret) {\n assert(Buffer.isBuffer(secret));\n return secret.length === this.curve.adjustedSize;\n }\n\n scalarVerify(scalar) {\n assert(Buffer.isBuffer(scalar));\n return scalar.length === this.curve.scalarSize;\n }\n\n scalarIsZero(scalar) {\n assert(Buffer.isBuffer(scalar));\n\n let k;\n try {\n k = this.curve.decodeScalar(scalar).imod(this.curve.n);\n } catch (e) {\n return false;\n }\n\n return k.isZero();\n }\n\n scalarClamp(scalar) {\n assert(Buffer.isBuffer(scalar));\n assert(scalar.length === this.curve.scalarSize);\n\n return this.curve.clamp(Buffer.from(scalar));\n }\n\n privateKeyExport(secret) {\n const pub = this.publicKeyCreate(secret);\n const {x, y} = this.publicKeyExport(pub);\n\n return {\n d: Buffer.from(secret),\n x,\n y\n };\n }\n\n privateKeyImport(json) {\n assert(json && typeof json === 'object');\n assert(Buffer.isBuffer(json.d));\n\n if (json.d.length !== this.curve.adjustedSize)\n throw new Error('Invalid private key.');\n\n return Buffer.from(json.d);\n }\n\n scalarTweakAdd(scalar, tweak) {\n const a = this.curve.decodeScalar(scalar);\n const t = this.curve.decodeScalar(tweak);\n const k = a.add(t).imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarTweakMul(scalar, tweak) {\n const a = this.curve.decodeScalar(scalar);\n const t = this.curve.decodeScalar(tweak);\n const k = a.mul(t).imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarReduce(scalar) {\n const a = this.curve.decodeScalar(scalar);\n const k = a.imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarNegate(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n const k = a.neg().imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarInvert(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n\n if (a.isZero())\n return this.curve.encodeScalar(a);\n\n const k = a.invert(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n publicKeyCreate(secret) {\n const key = this.privateKeyConvert(secret);\n return this.publicKeyFromScalar(key);\n }\n\n publicKeyFromScalar(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n const A = this.curve.g.mulBlind(a);\n\n return A.encode();\n }\n\n publicKeyConvert(key) {\n if (!this.mont)\n throw new Error('No equivalent montgomery curve.');\n\n const A = this.curve.decodePoint(key);\n const P = this.mont.pointFromEdwards(A);\n\n return P.encode();\n }\n\n publicKeyFromUniform(bytes) {\n const u = this.curve.decodeUniform(bytes);\n const A = this.curve.pointFromUniform(u, this.iso);\n\n return A.encode();\n }\n\n publicKeyToUniform(key, hint = rng.randomInt()) {\n const A = this.curve.decodePoint(key);\n const u = this.curve.pointToUniform(A, hint, this.iso);\n\n return this.curve.encodeUniform(u, hint >>> 8);\n }\n\n publicKeyFromHash(bytes, pake = false) {\n const A = this.curve.pointFromHash(bytes, pake, this.iso);\n return A.encode();\n }\n\n publicKeyToHash(key, subgroup = rng.randomInt()) {\n const A = this.curve.decodePoint(key);\n return this.curve.pointToHash(A, subgroup, rng, this.iso);\n }\n\n publicKeyVerify(key) {\n assert(Buffer.isBuffer(key));\n\n try {\n this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return true;\n }\n\n publicKeyIsInfinity(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.isInfinity();\n }\n\n publicKeyIsSmall(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.isSmall();\n }\n\n publicKeyHasTorsion(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.hasTorsion();\n }\n\n publicKeyExport(key) {\n const {x, y} = this.curve.decodePoint(key);\n\n return {\n x: this.curve.encodeField(x.fromRed()),\n y: this.curve.encodeField(y.fromRed())\n };\n }\n\n publicKeyImport(json) {\n assert(json && typeof json === 'object');\n\n let x = null;\n let y = null;\n let A;\n\n if (json.x != null) {\n x = BN.decode(json.x, this.curve.endian);\n\n if (x.cmp(this.curve.p) >= 0)\n throw new Error('Invalid point.');\n }\n\n if (json.y != null) {\n y = BN.decode(json.y, this.curve.endian);\n\n if (y.cmp(this.curve.p) >= 0)\n throw new Error('Invalid point.');\n }\n\n if (x && y) {\n A = this.curve.point(x, y);\n\n if (!A.validate())\n throw new Error('Invalid point.');\n } else if (x) {\n A = this.curve.pointFromX(x, json.sign);\n } else if (y) {\n A = this.curve.pointFromY(y, json.sign);\n } else {\n throw new Error('Invalid point.');\n }\n\n return A.encode();\n }\n\n publicKeyTweakAdd(key, tweak) {\n const t = this.curve.decodeScalar(tweak).imod(this.curve.n);\n const A = this.curve.decodePoint(key);\n const T = this.curve.g.mul(t);\n const P = T.add(A);\n\n return P.encode();\n }\n\n publicKeyTweakMul(key, tweak) {\n const t = this.curve.decodeScalar(tweak);\n const A = this.curve.decodePoint(key);\n const P = A.mul(t);\n\n return P.encode();\n }\n\n publicKeyCombine(keys) {\n assert(Array.isArray(keys));\n\n let P = this.curve.point();\n\n for (const key of keys) {\n const A = this.curve.decodePoint(key);\n\n P = P.add(A);\n }\n\n return P.encode();\n }\n\n publicKeyNegate(key) {\n const A = this.curve.decodePoint(key);\n const P = A.neg();\n\n return P.encode();\n }\n\n sign(msg, secret, ph, ctx) {\n const [key, prefix] = this.privateKeyExpand(secret);\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n signWithScalar(msg, scalar, prefix, ph, ctx) {\n // EdDSA Signing.\n //\n // [EDDSA] Page 12, Section 4.\n // [RFC8032] Page 8, Section 3.3.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `a` be a secret scalar.\n // - Let `w` be a secret byte array.\n //\n // Computation:\n //\n // k = H(w, m) mod n\n // R = G * k\n // A = G * a\n // e = H(R, A, m) mod n\n // s = (k + e * a) mod n\n // S = (R, s)\n //\n // Note that `k` must remain secret,\n // otherwise an attacker can compute:\n //\n // a = (s - k) / e mod n\n //\n // The same is true of `w` as `k`\n // can be re-derived as `H(w, m)`.\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(prefix));\n assert(prefix.length === this.curve.adjustedSize);\n\n const {n} = this.curve;\n const G = this.curve.g;\n const k = this.hashNonce(prefix, msg, ph, ctx);\n const Rraw = G.mulBlind(k).encode();\n const a = this.curve.decodeScalar(scalar);\n const Araw = G.mulBlind(a).encode();\n const e = this.hashChallenge(Rraw, Araw, msg, ph, ctx);\n const s = k.add(e.mul(a)).imod(n);\n\n return Buffer.concat([Rraw, this.curve.encodeAdjusted(s)]);\n }\n\n signTweakAdd(msg, secret, tweak, ph, ctx) {\n const [key_, prefix_] = this.privateKeyExpand(secret);\n const key = this.scalarTweakAdd(key_, tweak);\n const expanded = this.hash.multi(prefix_, tweak, null,\n this.curve.adjustedSize * 2);\n const prefix = expanded.slice(0, this.curve.adjustedSize);\n\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n signTweakMul(msg, secret, tweak, ph, ctx) {\n const [key_, prefix_] = this.privateKeyExpand(secret);\n const key = this.scalarTweakMul(key_, tweak);\n const expanded = this.hash.multi(prefix_, tweak, null,\n this.curve.adjustedSize * 2);\n const prefix = expanded.slice(0, this.curve.adjustedSize);\n\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n verify(msg, sig, key, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n\n try {\n return this._verify(msg, sig, key, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verify(msg, sig, key, ph, ctx) {\n // EdDSA Verification.\n //\n // [EDDSA] Page 15, Section 5.\n // [RFC8032] Page 8, Section 3.4.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - s < n.\n //\n // Computation:\n //\n // e = H(R, A, m) mod n\n // G * s == R + A * e\n //\n // Alternatively, we can compute:\n //\n // R == G * s - A * e\n //\n // This allows us to make use of a\n // multi-exponentiation algorithm.\n const {n} = this.curve;\n const G = this.curve.g;\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n\n return G.mulAdd(s, A.neg(), e).eq(R);\n }\n\n verifySingle(msg, sig, key, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n\n try {\n return this._verifySingle(msg, sig, key, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verifySingle(msg, sig, key, ph, ctx) {\n // EdDSA Verification (with cofactor multiplication).\n //\n // [EDDSA] Page 15, Section 5.\n // [RFC8032] Page 8, Section 3.4.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - s < n.\n //\n // Computation:\n //\n // e = H(R, A, m) mod n\n // (G * s) * h == (R + A * e) * h\n //\n // Alternatively, we can compute:\n //\n // R * h == G * (s * h) - (A * h) * e\n //\n // This allows us to make use of a\n // multi-exponentiation algorithm.\n const {n} = this.curve;\n const G = this.curve.g;\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n const sh = this.curve.imulH(s);\n const Ah = A.mulH();\n const Rh = R.mulH();\n\n return G.mulAdd(sh, Ah.neg(), e).eq(Rh);\n }\n\n verifyBatch(batch, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Array.isArray(batch));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n for (const item of batch) {\n assert(Array.isArray(item) && item.length === 3);\n\n const [msg, sig, key] = item;\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n }\n\n try {\n return this._verifyBatch(batch, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verifyBatch(batch, ph, ctx) {\n // EdDSA Batch Verification.\n //\n // [EDDSA] Page 16, Section 5.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - Let `i` be the batch item index.\n // - s < n.\n // - a1 = 1 mod n.\n //\n // Computation:\n //\n // ei = H(Ri, Ai, mi) mod n\n // ai = random integer in [1,n-1]\n // lhs = (si * ai + ...) * h mod n\n // rhs = (Ri * h) * ai + (Ai * h) * (ei * ai mod n) + ...\n // G * -lhs + rhs == O\n const {n} = this.curve;\n const G = this.curve.g;\n const points = new Array(1 + batch.length * 2);\n const coeffs = new Array(1 + batch.length * 2);\n const sum = new BN(0);\n\n this.rng.init(batch);\n\n points[0] = G;\n coeffs[0] = sum;\n\n for (let i = 0; i < batch.length; i++) {\n const [msg, sig, key] = batch[i];\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n const a = this.rng.generate(i);\n const ea = e.mul(a).imod(n);\n\n sum.iadd(s.mul(a)).imod(n);\n\n points[1 + i * 2 + 0] = R.mulH();\n coeffs[1 + i * 2 + 0] = a;\n points[1 + i * 2 + 1] = A.mulH();\n coeffs[1 + i * 2 + 1] = ea;\n }\n\n this.curve.imulH(sum.ineg());\n\n return this.curve.mulAll(points, coeffs).isInfinity();\n }\n\n derive(pub, secret) {\n const scalar = this.privateKeyConvert(secret);\n return this.deriveWithScalar(pub, scalar);\n }\n\n deriveWithScalar(pub, scalar) {\n const A = this.curve.decodePoint(pub);\n const a = this.curve.decodeClamped(scalar);\n const P = A.mulBlind(a, rng);\n\n if (P.isInfinity())\n throw new Error('Invalid point.');\n\n return P.encode();\n }\n}\n\n/*\n * Hash\n */\n\nclass Hash {\n constructor(eddsa) {\n this.curve = eddsa.curve;\n // eslint-disable-next-line\n this.hash = new eddsa.hash();\n }\n\n init(ph, ctx) {\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (ctx.length > 255)\n ctx = ctx.slice(0, 255);\n\n this.hash.init();\n\n if (this.curve.context || ph != null || ctx.length > 0) {\n if (this.curve.prefix)\n this.hash.update(this.curve.prefix);\n\n this.hash.update(byte(ph));\n this.hash.update(byte(ctx.length));\n this.hash.update(ctx);\n }\n\n return this;\n }\n\n update(data) {\n this.hash.update(data);\n return this;\n }\n\n final() {\n const hash = this.hash.final(this.curve.adjustedSize * 2);\n const num = BN.decode(hash, this.curve.endian);\n\n return num.imod(this.curve.n);\n }\n}\n\n/*\n * Helpers\n */\n\nfunction byte(ch) {\n const buf = Buffer.alloc(1);\n buf[0] = ch & 0xff;\n return buf;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = EDDSA;\n","/*!\n * keccak.js - Keccak/SHA3 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on emn178/js-sha3:\n * Copyright (c) 2015-2017, Chen, Yi-Cyuan (MIT License).\n * https://github.com/emn178/js-sha3\n *\n * Parts of this software are based on rhash/RHash:\n * Copyright (c) 2005-2014, Aleksey Kravchenko\n * https://github.com/rhash/RHash\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n * https://github.com/rhash/RHash/blob/master/librhash/sha3.c\n * https://github.com/emn178/js-sha3/blob/master/src/sha3.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst HMAC = require('../internal/hmac');\n\n/*\n * Constants\n */\n\nconst FINALIZED = 0x80000000;\n\nconst ROUND_CONST = new Uint32Array([\n 0x00000001, 0x00000000, 0x00008082, 0x00000000,\n 0x0000808a, 0x80000000, 0x80008000, 0x80000000,\n 0x0000808b, 0x00000000, 0x80000001, 0x00000000,\n 0x80008081, 0x80000000, 0x00008009, 0x80000000,\n 0x0000008a, 0x00000000, 0x00000088, 0x00000000,\n 0x80008009, 0x00000000, 0x8000000a, 0x00000000,\n 0x8000808b, 0x00000000, 0x0000008b, 0x80000000,\n 0x00008089, 0x80000000, 0x00008003, 0x80000000,\n 0x00008002, 0x80000000, 0x00000080, 0x80000000,\n 0x0000800a, 0x00000000, 0x8000000a, 0x80000000,\n 0x80008081, 0x80000000, 0x00008080, 0x80000000,\n 0x80000001, 0x00000000, 0x80008008, 0x80000000\n]);\n\n/**\n * Keccak\n */\n\nclass Keccak {\n constructor() {\n this.state = new Uint32Array(50);\n this.block = Buffer.alloc(200);\n this.bs = 136;\n this.pos = FINALIZED;\n }\n\n init(bits) {\n if (bits == null)\n bits = 256;\n\n assert((bits >>> 0) === bits);\n assert(bits >= 128);\n assert(bits <= 512);\n\n const rate = 1600 - bits * 2;\n\n assert(rate >= 0 && (rate & 63) === 0);\n\n this.bs = rate >>> 3;\n this.pos = 0;\n\n return this;\n }\n\n update(data) {\n assert(Buffer.isBuffer(data));\n assert(!(this.pos & FINALIZED), 'Context is not initialized.');\n\n let len = data.length;\n let pos = this.pos;\n let off = 0;\n\n this.pos = (this.pos + len) % this.bs;\n\n if (pos > 0) {\n let want = this.bs - pos;\n\n if (want > len)\n want = len;\n\n data.copy(this.block, pos, off, off + want);\n\n pos += want;\n len -= want;\n off += want;\n\n if (pos < this.bs)\n return this;\n\n this._transform(this.block, 0);\n }\n\n while (len >= this.bs) {\n this._transform(data, off);\n off += this.bs;\n len -= this.bs;\n }\n\n if (len > 0)\n data.copy(this.block, 0, off, off + len);\n\n return this;\n }\n\n final(pad, len) {\n if (pad == null)\n pad = 0x01;\n\n if (len == null || len === 0)\n len = 100 - (this.bs >>> 1);\n\n assert((pad & 0xff) === pad);\n assert((len >>> 0) === len);\n assert(!(this.pos & FINALIZED), 'Context is not initialized.');\n\n this.block.fill(0, this.pos, this.bs);\n this.block[this.pos] |= pad;\n this.block[this.bs - 1] |= 0x80;\n this._transform(this.block, 0);\n this.pos = FINALIZED;\n\n assert(len <= this.bs);\n\n const out = Buffer.alloc(len);\n\n for (let i = 0; i < len; i++)\n out[i] = this.state[i >>> 2] >>> (8 * (i & 3));\n\n for (let i = 0; i < 50; i++)\n this.state[i] = 0;\n\n for (let i = 0; i < this.bs; i++)\n this.block[i] = 0;\n\n return out;\n }\n\n _transform(block, off) {\n const count = this.bs >>> 2;\n const s = this.state;\n\n for (let i = 0; i < count; i++)\n s[i] ^= readU32(block, off + i * 4);\n\n for (let n = 0; n < 48; n += 2) {\n const c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n const c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n const c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n const c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n const c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n const c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n const c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n const c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n const c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n const c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n const h0 = c8 ^ ((c2 << 1) | (c3 >>> 31));\n const l0 = c9 ^ ((c3 << 1) | (c2 >>> 31));\n const h1 = c0 ^ ((c4 << 1) | (c5 >>> 31));\n const l1 = c1 ^ ((c5 << 1) | (c4 >>> 31));\n const h2 = c2 ^ ((c6 << 1) | (c7 >>> 31));\n const l2 = c3 ^ ((c7 << 1) | (c6 >>> 31));\n const h3 = c4 ^ ((c8 << 1) | (c9 >>> 31));\n const l3 = c5 ^ ((c9 << 1) | (c8 >>> 31));\n const h4 = c6 ^ ((c0 << 1) | (c1 >>> 31));\n const l4 = c7 ^ ((c1 << 1) | (c0 >>> 31));\n\n s[0] ^= h0;\n s[1] ^= l0;\n s[10] ^= h0;\n s[11] ^= l0;\n s[20] ^= h0;\n s[21] ^= l0;\n s[30] ^= h0;\n s[31] ^= l0;\n s[40] ^= h0;\n s[41] ^= l0;\n\n s[2] ^= h1;\n s[3] ^= l1;\n s[12] ^= h1;\n s[13] ^= l1;\n s[22] ^= h1;\n s[23] ^= l1;\n s[32] ^= h1;\n s[33] ^= l1;\n s[42] ^= h1;\n s[43] ^= l1;\n\n s[4] ^= h2;\n s[5] ^= l2;\n s[14] ^= h2;\n s[15] ^= l2;\n s[24] ^= h2;\n s[25] ^= l2;\n s[34] ^= h2;\n s[35] ^= l2;\n s[44] ^= h2;\n s[45] ^= l2;\n\n s[6] ^= h3;\n s[7] ^= l3;\n s[16] ^= h3;\n s[17] ^= l3;\n s[26] ^= h3;\n s[27] ^= l3;\n s[36] ^= h3;\n s[37] ^= l3;\n s[46] ^= h3;\n s[47] ^= l3;\n\n s[8] ^= h4;\n s[9] ^= l4;\n s[18] ^= h4;\n s[19] ^= l4;\n s[28] ^= h4;\n s[29] ^= l4;\n s[38] ^= h4;\n s[39] ^= l4;\n s[48] ^= h4;\n s[49] ^= l4;\n\n const b0 = s[0];\n const b1 = s[1];\n const b32 = (s[11] << 4) | (s[10] >>> 28);\n const b33 = (s[10] << 4) | (s[11] >>> 28);\n const b14 = (s[20] << 3) | (s[21] >>> 29);\n const b15 = (s[21] << 3) | (s[20] >>> 29);\n const b46 = (s[31] << 9) | (s[30] >>> 23);\n const b47 = (s[30] << 9) | (s[31] >>> 23);\n const b28 = (s[40] << 18) | (s[41] >>> 14);\n const b29 = (s[41] << 18) | (s[40] >>> 14);\n const b20 = (s[2] << 1) | (s[3] >>> 31);\n const b21 = (s[3] << 1) | (s[2] >>> 31);\n const b2 = (s[13] << 12) | (s[12] >>> 20);\n const b3 = (s[12] << 12) | (s[13] >>> 20);\n const b34 = (s[22] << 10) | (s[23] >>> 22);\n const b35 = (s[23] << 10) | (s[22] >>> 22);\n const b16 = (s[33] << 13) | (s[32] >>> 19);\n const b17 = (s[32] << 13) | (s[33] >>> 19);\n const b48 = (s[42] << 2) | (s[43] >>> 30);\n const b49 = (s[43] << 2) | (s[42] >>> 30);\n const b40 = (s[5] << 30) | (s[4] >>> 2);\n const b41 = (s[4] << 30) | (s[5] >>> 2);\n const b22 = (s[14] << 6) | (s[15] >>> 26);\n const b23 = (s[15] << 6) | (s[14] >>> 26);\n const b4 = (s[25] << 11) | (s[24] >>> 21);\n const b5 = (s[24] << 11) | (s[25] >>> 21);\n const b36 = (s[34] << 15) | (s[35] >>> 17);\n const b37 = (s[35] << 15) | (s[34] >>> 17);\n const b18 = (s[45] << 29) | (s[44] >>> 3);\n const b19 = (s[44] << 29) | (s[45] >>> 3);\n const b10 = (s[6] << 28) | (s[7] >>> 4);\n const b11 = (s[7] << 28) | (s[6] >>> 4);\n const b42 = (s[17] << 23) | (s[16] >>> 9);\n const b43 = (s[16] << 23) | (s[17] >>> 9);\n const b24 = (s[26] << 25) | (s[27] >>> 7);\n const b25 = (s[27] << 25) | (s[26] >>> 7);\n const b6 = (s[36] << 21) | (s[37] >>> 11);\n const b7 = (s[37] << 21) | (s[36] >>> 11);\n const b38 = (s[47] << 24) | (s[46] >>> 8);\n const b39 = (s[46] << 24) | (s[47] >>> 8);\n const b30 = (s[8] << 27) | (s[9] >>> 5);\n const b31 = (s[9] << 27) | (s[8] >>> 5);\n const b12 = (s[18] << 20) | (s[19] >>> 12);\n const b13 = (s[19] << 20) | (s[18] >>> 12);\n const b44 = (s[29] << 7) | (s[28] >>> 25);\n const b45 = (s[28] << 7) | (s[29] >>> 25);\n const b26 = (s[38] << 8) | (s[39] >>> 24);\n const b27 = (s[39] << 8) | (s[38] >>> 24);\n const b8 = (s[48] << 14) | (s[49] >>> 18);\n const 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] ^= ROUND_CONST[n + 0];\n s[1] ^= ROUND_CONST[n + 1];\n }\n }\n\n static hash() {\n return new Keccak();\n }\n\n static hmac(bits, pad, len) {\n if (bits == null)\n bits = 256;\n\n assert((bits >>> 0) === bits);\n\n const rate = 1600 - bits * 2;\n\n assert(rate >= 0 && (rate & 63) === 0);\n\n return new HMAC(Keccak, rate >>> 3, [bits], [pad, len]);\n }\n\n static digest(data, bits, pad, len) {\n return Keccak.ctx.init(bits).update(data).final(pad, len);\n }\n\n static root(left, right, bits, pad, len) {\n if (bits == null)\n bits = 256;\n\n if (len == null)\n len = 0;\n\n if (len === 0)\n len = bits >>> 3;\n\n assert((bits >>> 0) === bits);\n assert((bits & 7) === 0);\n assert((len >>> 0) === len);\n assert(Buffer.isBuffer(left) && left.length === len);\n assert(Buffer.isBuffer(right) && right.length === len);\n\n return Keccak.ctx.init(bits).update(left).update(right).final(pad, len);\n }\n\n static multi(x, y, z, bits, pad, len) {\n const {ctx} = Keccak;\n\n ctx.init(bits);\n ctx.update(x);\n ctx.update(y);\n\n if (z)\n ctx.update(z);\n\n return ctx.final(pad, len);\n }\n\n static mac(data, key, bits, pad, len) {\n return Keccak.hmac(bits, pad, len).init(key).update(data).final();\n }\n}\n\n/*\n * Static\n */\n\nKeccak.native = 0;\nKeccak.id = 'KECCAK256';\nKeccak.size = 32;\nKeccak.bits = 256;\nKeccak.blockSize = 136;\nKeccak.zero = Buffer.alloc(32, 0x00);\nKeccak.ctx = new Keccak();\n\n/*\n * Helpers\n */\n\nfunction readU32(data, off) {\n return (data[off++]\n + data[off++] * 0x100\n + data[off++] * 0x10000\n + data[off] * 0x1000000);\n}\n\n/*\n * Expose\n */\n\nmodule.exports = Keccak;\n","/*!\n * keccak.js - keccak for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/keccak');\n","/*!\n * shake.js - SHAKE implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n */\n\n'use strict';\n\nconst Keccak = require('./keccak');\n\n/**\n * SHAKE\n */\n\nclass SHAKE extends Keccak {\n /**\n * Create a SHAKE Context.\n * @constructor\n */\n\n constructor() {\n super();\n }\n\n final(len) {\n return super.final(0x1f, len);\n }\n\n static hash() {\n return new SHAKE();\n }\n\n static hmac(bits, len) {\n return super.hmac(bits, 0x1f, len);\n }\n\n static digest(data, bits, len) {\n return super.digest(data, bits, 0x1f, len);\n }\n\n static root(left, right, bits, len) {\n return super.root(left, right, bits, 0x1f, len);\n }\n\n static multi(x, y, z, bits, len) {\n return super.multi(x, y, z, bits, 0x1f, len);\n }\n\n static mac(data, key, bits, len) {\n return super.mac(data, key, bits, 0x1f, len);\n }\n}\n\n/*\n * Static\n */\n\nSHAKE.native = Keccak.native;\nSHAKE.id = 'SHAKE256';\nSHAKE.size = 32;\nSHAKE.bits = 256;\nSHAKE.blockSize = 136;\nSHAKE.zero = Buffer.alloc(32, 0x00);\nSHAKE.ctx = new SHAKE();\n\n/*\n * Expose\n */\n\nmodule.exports = SHAKE;\n","/*!\n * shake256.js - SHAKE256 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nconst SHAKE = require('./shake');\n\n/**\n * SHAKE256\n */\n\nclass SHAKE256 extends SHAKE {\n constructor() {\n super();\n }\n\n init() {\n return super.init(256);\n }\n\n static hash() {\n return new SHAKE256();\n }\n\n static hmac(len) {\n return super.hmac(256, len);\n }\n\n static digest(data, len) {\n return super.digest(data, 256, len);\n }\n\n static root(left, right, len) {\n return super.root(left, right, 256, len);\n }\n\n static multi(x, y, z, len) {\n return super.multi(x, y, z, 256, len);\n }\n\n static mac(data, key, len) {\n return super.mac(data, key, 256, len);\n }\n}\n\n/*\n * Static\n */\n\nSHAKE256.native = SHAKE.native;\nSHAKE256.id = 'SHAKE256';\nSHAKE256.size = 32;\nSHAKE256.bits = 256;\nSHAKE256.blockSize = 136;\nSHAKE256.zero = Buffer.alloc(32, 0x00);\nSHAKE256.ctx = new SHAKE256();\n\n/*\n * Expose\n */\n\nmodule.exports = SHAKE256;\n","/*!\n * ed448.js - ed448 for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://eprint.iacr.org/2015/625.pdf\n * https://tools.ietf.org/html/rfc8032#section-5.2\n */\n\n'use strict';\n\nconst EDDSA = require('./eddsa');\nconst SHAKE256 = require('../shake256');\n\n/*\n * Expose\n */\n\nmodule.exports = new EDDSA('ED448', 'X448', 'MONT448', SHAKE256);\n","/*!\n * ed448.js - ed448 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/ed448');\n","// bcrypto does not ship TypeScript declarations.\n// @ts-ignore\nimport backend from \"bcrypto/lib/ed448-browser.js\";\nconst ed448 = backend;\nexport default ed448;\n//# sourceMappingURL=browser-ed448.js.map","/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert(value >> width === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\",\n fault: \"overflow\",\n value: _value,\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -((~value & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = BN_1 << (width - BN_1);\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n const mask = (BN_1 << width) - BN_1;\n return (~value & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof value) {\n case \"bigint\":\n return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\",\n operation: \"getUint\",\n value,\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof value) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value,\n });\n // Pad the value to the required width\n while (result.length < width * 2) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n return new Uint8Array([]);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map","/**\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 let value = toBigInt(getBytes(_value));\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\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","// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map","/**\n * Explain events...\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map","/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import { assert } from \"./errors.js\";\n// @TODO: timeout is completely ignored; start a Promise.any with a reject?\n// @ts-ignore\nexport async function getUrl(req, _signal) {\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 let signal = undefined;\n if (_signal) {\n const controller = new AbortController();\n signal = controller.signal;\n _signal.addListener(() => {\n controller.abort();\n });\n }\n const init = {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal,\n };\n try {\n const resp = await fetch(req.url, init);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = respBody == null ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers,\n body,\n };\n }\n catch (error) {\n console.log({ error });\n return undefined;\n }\n}\n//# sourceMappingURL=geturl-browser.js.map","/**\n * Explain fetching here...\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 { getUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet getUrlFunc = getUrl;\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(() => {\n listener();\n }, 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() {\n return this.#cancelled;\n }\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 /**\n * The fetch URI to requrest.\n */\n get url() {\n return this.#url;\n }\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``) and the .\n *\n * If %%body%% is a string, the intrincis ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrincis ``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 chnages 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 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]],\n 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 complere response.\n * //(default: 5 minutes)//\n */\n get timeout() {\n return this.#timeout;\n }\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 * 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 }\n toString() {\n return ``;\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\",\n reason: \"timeout\",\n 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\n .makeServerError(\"error in post-processing function\", error)\n .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 getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req\n .redirect(location)\n .#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 ||\n (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof retryAfter === \"string\" &&\n retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req\n .clone()\n .#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\n .makeServerError(\"error in post-processing function\", error)\n .assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req\n .clone()\n .#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 locataions\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" &&\n (current !== \"https\" || target !== \"http\") &&\n 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 = \"GET\";\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 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 getUrlFunc = getUrl;\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 * 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 ``;\n }\n /**\n * The response status code.\n */\n get statusCode() {\n return this.#statusCode;\n }\n /**\n * The response status message.\n */\n get statusMessage() {\n return this.#statusMessage;\n }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() {\n return Object.assign({}, this.#headers);\n }\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\",\n 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\",\n 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]],\n 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 of 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() {\n return this.#request;\n }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" &&\n this.statusCode >= 200 &&\n 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 assert(false, message, \"SERVER_ERROR\", {\n request: this.request || \"unknown request\",\n response: this,\n error,\n });\n }\n}\nfunction getTime() {\n return new Date().getTime();\n}\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","var _a;\n/**\n * About fixed-point math...\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = BN_1 << (width - BN_1);\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = BN_1 << width;\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n val = (((val % limit) + limit) % limit) & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof value === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof value === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = match[1] !== \"u\";\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof v[key] === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument(width % 8 === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return negative + str;\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return negative + str;\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, an value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() {\n return this.#format.signed;\n }\n /**\n * The number of bits available to store the value.\n */\n get width() {\n return this.#format.width;\n }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() {\n return this.#format.decimals;\n }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() {\n return this.#val;\n }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n\n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n*/\n val = checkValue(val, this.#format, safeOp);\n return new _a(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) {\n return this.#add(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) {\n return this.#add(other, \"add\");\n }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) {\n return this.#sub(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) {\n return this.#sub(other, \"sub\");\n }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) {\n return this.#mul(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) {\n return this.#mul(other, \"mul\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert(value % this.#tens === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) {\n return this.#div(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) {\n return this.#div(other, \"div\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(other);\n const value = this.#val * this.#tens;\n assert(value % other.#val === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%other%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return -1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) {\n return this.cmp(other) === 0;\n }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) {\n return this.cmp(other) < 0;\n }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) {\n return this.cmp(other) <= 0;\n }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) {\n return this.cmp(other) > 0;\n }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) {\n return this.cmp(other) >= 0;\n }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new _a(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() {\n return this.#val === BN_0;\n }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() {\n return this.#val < BN_0;\n }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() {\n return this._value;\n }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() {\n return parseFloat(this.toString());\n }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return _a.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, decimals, _format) {\n if (decimals == null) {\n decimals = 0;\n }\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert(value % tens === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\",\n fault: \"underflow\",\n value: _value,\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && match[2].length + match[3].length > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = match[2] || \"0\", decimal = match[3] || \"\";\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\",\n fault: \"underflow\",\n value: _value,\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new _a(_guard, value, format);\n }\n}\n_a = FixedNumber;\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","import { 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,\n length,\n 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,\n length: 0,\n offset: 1,\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data,\n length: data.length,\n 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","import { 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","/**\n * Most interactions with Core requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Core, //Core// is divisible to 18 decimal places,\n * where each individual unit is called a //ore//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n ///Ore, the smallest and atomic amount of Core\n \"ore\",\n ///fecore, 1000 ore\n \"fecore\",\n ///Picore, one million ore\n \"picore\",\n ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices.\n \"nacore\",\n ///Μcore, 10^12 ore or 1 μCore\n \"mcore\",\n ///micore, 10^15 ore or 1 mcore\n \"micore\",\n \"core\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit.\n */\nexport const scientificToDecimal = (num) => {\n // @ts-ignore\n var nsign = Math.sign(num);\n //remove the sign\n // @ts-ignore\n num = Math.abs(num);\n //if the number is in scientific notation remove it\n // @ts-ignore\n if (/\\d+\\.?\\d*e[\\+\\-]*\\d+/i.test(num)) {\n var zero = \"0\", \n // @ts-ignore\n parts = String(num).toLowerCase().split(\"e\"), //split into coeff and exponent\n e = parts.pop(), //store the exponential part\n // @ts-ignore\n l = Math.abs(e), //get the number of zeros\n // @ts-ignore\n sign = e / l, coeff_array = parts[0].split(\".\");\n if (sign === -1) {\n l = l - coeff_array[0].length;\n if (l < 0) {\n // @ts-ignore\n num =\n coeff_array[0].slice(0, l) +\n \".\" +\n coeff_array[0].slice(l) +\n (coeff_array.length === 2 ? coeff_array[1] : \"\");\n }\n else {\n // @ts-ignore\n num = zero + \".\" + new Array(l + 1).join(zero) + coeff_array.join(\"\");\n }\n }\n else {\n var dec = coeff_array[1];\n if (dec)\n l = l - dec.length;\n if (l < 0) {\n // @ts-ignore\n num = coeff_array[0] + dec.slice(0, l) + \".\" + dec.slice(l);\n }\n else {\n // @ts-ignore\n num = coeff_array.join(\"\") + new Array(l + 1).join(zero);\n }\n }\n }\n // @ts-ignore\n return nsign < 0 ? \"-\" + num : num;\n};\nexport const trimDecimals = (n, decimals = 18) => {\n n += \"\";\n if (n.indexOf(\".\") === -1)\n return n;\n const arr = n.split(\".\");\n const fraction = arr[1].substr(0, decimals);\n return arr[0] + \".\" + fraction;\n};\nexport function parseUnits(value, unit) {\n assertArgument(typeof value === \"string\", \"value must be a string\", \"value\", value);\n if (value.includes(\"e\")) {\n value = scientificToDecimal(value).toString();\n }\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n value = trimDecimals(value, decimals);\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n value = trimDecimals(value, decimals);\n }\n return FixedNumber.fromString(value, { decimals }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatXCB(ore) {\n return formatUnits(ore, 18);\n}\n/**\n * Converts the //decimal string// %%xcb%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseXCB(xcb) {\n return parseUnits(xcb, 18);\n}\n//# sourceMappingURL=units.js.map","/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map","/*!\n * pbkdf2.js - pbkdf2 for bcrypto\n * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/PBKDF2\n * https://tools.ietf.org/html/rfc2898\n * https://tools.ietf.org/html/rfc2898#section-5.2\n * https://tools.ietf.org/html/rfc6070\n * https://www.emc.com/collateral/white-papers/h11302-pkcs5v2-1-password-based-cryptography-standard-wp.pdf\n * http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst crypto = global.crypto || global.msCrypto || {};\nconst subtle = crypto.subtle || {};\n\n/**\n * Perform key derivation using PBKDF2.\n * @param {Function} hash\n * @param {Buffer} pass\n * @param {Buffer} salt\n * @param {Number} iter\n * @param {Number} len\n * @returns {Buffer}\n */\n\nfunction derive(hash, pass, salt, iter, len) {\n if (typeof pass === 'string')\n pass = Buffer.from(pass, 'utf8');\n\n if (typeof salt === 'string')\n salt = Buffer.from(salt, 'utf8');\n\n if (salt == null)\n salt = Buffer.alloc(0);\n\n assert(hash && typeof hash.id === 'string');\n assert(Buffer.isBuffer(pass));\n assert(Buffer.isBuffer(salt));\n assert((iter >>> 0) === iter);\n assert((len >>> 0) === len);\n\n const size = hash.size;\n const blocks = Math.ceil(len / size);\n const out = Buffer.alloc(blocks * size);\n const state = Buffer.alloc(salt.length + 4);\n\n salt.copy(state, 0);\n\n // Preemptively shorten key.\n if (pass.length > hash.blockSize) {\n pass = hash.digest(pass);\n assert(pass.length <= hash.blockSize);\n }\n\n for (let i = 0; i < blocks; i++) {\n const round = i + 1;\n\n state[salt.length + 0] = round >>> 24;\n state[salt.length + 1] = round >>> 16;\n state[salt.length + 2] = round >>> 8;\n state[salt.length + 3] = round;\n\n const block = hash.mac(state, pass);\n\n let mac = block;\n\n for (let j = 1; j < iter; j++) {\n mac = hash.mac(mac, pass);\n\n for (let k = 0; k < size; k++)\n block[k] ^= mac[k];\n }\n\n block.copy(out, i * size);\n }\n\n return out.slice(0, len);\n}\n\n/**\n * Execute pbkdf2 asynchronously.\n * @param {Function} hash\n * @param {Buffer} pass\n * @param {Buffer} salt\n * @param {Number} iter\n * @param {Number} len\n * @returns {Promise}\n */\n\nasync function deriveAsync(hash, pass, salt, iter, len) {\n if (typeof pass === 'string')\n pass = Buffer.from(pass, 'utf8');\n\n if (typeof salt === 'string')\n salt = Buffer.from(salt, 'utf8');\n\n if (salt == null)\n salt = Buffer.alloc(0);\n\n assert(hash && typeof hash.id === 'string');\n assert(Buffer.isBuffer(pass));\n assert(Buffer.isBuffer(salt));\n assert((iter >>> 0) === iter);\n assert((len >>> 0) === len);\n\n const name = getHash(hash);\n\n if (!subtle.importKey || !subtle.deriveBits || !name)\n return derive(hash, pass, salt, iter, len);\n\n const algo = { name: 'PBKDF2' };\n const use = ['deriveBits'];\n\n const options = {\n name: 'PBKDF2',\n salt: salt,\n iterations: iter,\n hash: name\n };\n\n const key = await subtle.importKey('raw', pass, algo, false, use);\n const out = await subtle.deriveBits(options, key, len * 8);\n\n return Buffer.from(out);\n}\n\n/*\n * Helpers\n */\n\nfunction getHash(hash) {\n switch (hash.id) {\n case 'SHA1':\n return 'SHA-1';\n case 'SHA256':\n return 'SHA-256';\n case 'SHA384':\n return 'SHA-384';\n case 'SHA512':\n return 'SHA-512';\n default:\n return null;\n }\n}\n\n/*\n * Expose\n */\n\nexports.native = 0;\nexports.derive = derive;\nexports.deriveAsync = deriveAsync;\n","/*!\n * pbkdf2.js - pbkdf2 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/pbkdf2');\n","/*!\n * sha3.js - SHA3 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n */\n\n'use strict';\n\nconst Keccak = require('./keccak');\n\n/**\n * SHA3\n */\n\nclass SHA3 extends Keccak {\n constructor() {\n super();\n }\n\n final() {\n return super.final(0x06, null);\n }\n\n static hash() {\n return new SHA3();\n }\n\n static hmac(bits) {\n return super.hmac(bits, 0x06, null);\n }\n\n static digest(data, bits) {\n return super.digest(data, bits, 0x06, null);\n }\n\n static root(left, right, bits) {\n return super.root(left, right, bits, 0x06, null);\n }\n\n static multi(x, y, z, bits) {\n return super.multi(x, y, z, bits, 0x06, null);\n }\n\n static mac(data, key, bits) {\n return super.mac(data, key, bits, 0x06, null);\n }\n}\n\n/*\n * Static\n */\n\nSHA3.native = 0;\nSHA3.id = 'SHA3_256';\nSHA3.size = 32;\nSHA3.bits = 256;\nSHA3.blockSize = 136;\nSHA3.zero = Buffer.alloc(32, 0x00);\nSHA3.ctx = new SHA3();\n\n/*\n * Expose\n */\n\nmodule.exports = SHA3;\n","/*!\n * sha3.js - sha3 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/sha3');\n","/*!\n * sha3-512.js - sha3-512 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nconst SHA3 = require('./sha3');\n\n/**\n * SHA3-512\n */\n\nclass SHA3_512 extends SHA3 {\n constructor() {\n super();\n }\n\n init() {\n return super.init(512);\n }\n\n static hash() {\n return new SHA3_512();\n }\n\n static hmac() {\n return super.hmac(512);\n }\n\n static digest(data) {\n return super.digest(data, 512);\n }\n\n static root(left, right) {\n return super.root(left, right, 512);\n }\n\n static multi(x, y, z) {\n return super.multi(x, y, z, 512);\n }\n\n static mac(data, key) {\n return super.mac(data, key, 512);\n }\n}\n\n/*\n * Static\n */\n\nSHA3_512.native = SHA3.native;\nSHA3_512.id = 'SHA3_512';\nSHA3_512.size = 64;\nSHA3_512.bits = 512;\nSHA3_512.blockSize = 72;\nSHA3_512.zero = Buffer.alloc(64, 0x00);\nSHA3_512.ctx = new SHA3_512();\n\n/*\n * Expose\n */\n\nmodule.exports = SHA3_512;\n","import { Buffer } from \"buffer\";\n// @ts-ignore\nimport ed448 from \"./browser-ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"./pbkdf2-browser.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(Buffer.from(msgHash, \"hex\"), Buffer.from(signedMsg, \"hex\"), Buffer.from(pubKey, \"hex\"));\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock-browser.js.map","/* Browser Crypto Shims */\nimport { ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"ripemd160\":\n return ripemd160.create();\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512, \"sha3-256\": sha3_256, \"sha3-512\": sha3_512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = (data) => hexlify(createHash(\"sha3-256\").update(data).digest());\nconst _sha512 = (data) => hexlify(createHash(\"sha3-512\").update(data).digest());\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA3-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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n return hexlify(createHash(\"ripemd160\").update(getBytes(data)).digest());\n}\nexport function sha256(data) {\n return hexlify(__sha256(getBytes(data)));\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(createHmac(\"sha3-256\", k).update(d).digest());\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(createHmac(\"sha3-512\", k).update(d).digest());\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 SHA3-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 return hexlify(__sha512(getBytes(data)));\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha512);\n//# sourceMappingURL=sha3.js.map","/**\n * Addresses are a fundamental part of interacting with Core. They\n * represent the gloabal identity of Externally Owned Accounts (accounts\n * backed by a private key) and contracts.\n *\n * The Core Naming Service (CNS) provides an interconnected ecosystem\n * of contracts, standards and libraries which enable looking up an\n * address for an ENS name.\n *\n * These functions help convert between various formats, validate\n * addresses and safely resolve ENS names.\n *\n * @_section: api/address:Addresses [about-addresses]\n */\nnull;\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { encode } from \"../crypto/rlp.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexDataSlice, hexlify, stripZeros, } from \"../utils/data.js\";\nconst logger = new Logger(\"address/0.0.1\");\nconst precompiledAddresses = [\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n \"0000000000000000000000000000000000000000000000000000000000000001\",\n \"0000000000000000000000000000000000000000000000000000000000000002\",\n \"0000000000000000000000000000000000000000000000000000000000000003\",\n \"0000000000000000000000000000000000000000000000000000000000000004\",\n \"0000000000000000000000000000000000000000000000000000000000000005\",\n \"0000000000000000000000000000000000000000000000000000000000000006\",\n \"0000000000000000000000000000000000000000000000000000000000000007\",\n \"0000000000000000000000000000000000000000000000000000000000000008\",\n \"0000000000000000000000000000000000000000000000000000000000000009\",\n];\nfunction removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nfunction calculateCheckSum(_address, _prefix) {\n const address = getBytes(\"0x\" + _address.replace(\"0x\", \"\"));\n const prefix = getBytes(\"0x\" + _prefix.replace(\"0x\", \"\"));\n const tmpConcated = new Uint8Array([...address, ...prefix]);\n const hexedConcat = hexlify(tmpConcated).replace(\"0x\", \"\") + \"00\";\n const mods = Array.from(hexedConcat.toUpperCase(), (c) => {\n const charCode = c.charCodeAt(0);\n return charCode > 64 && charCode < 91\n ? (charCode - 55).toString()\n : (charCode - 48).toString();\n }).join(\"\");\n const bigVal = BigInt(mods);\n const val97 = BigInt(97);\n const val98 = BigInt(98);\n const remainder = bigVal % val97;\n const checkSum = val98 - remainder;\n const result = checkSum > 9 ? checkSum.toString() : \"0\" + checkSum.toString();\n return result;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address\n .split(\"\")\n .map((c) => {\n return ibanLookup[c];\n })\n .join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Core uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nfunction getAddress(address) {\n if (typeof address !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n const raw = removeHexPrefix(address);\n if (precompiledAddresses.includes(raw)) {\n return \"0x\" + raw;\n }\n const prefix = raw.substring(0, 2);\n const val = raw.substring(4);\n const checksum = calculateCheckSum(val, prefix);\n if (checksum !== raw.substring(2, 4)) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n return \"0x\" + prefix + checksum + val;\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nfunction getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\nfunction networkIdToPrefix(networkId) {\n if (networkId == 1) {\n return \"cb\";\n }\n else if (networkId == 3 || networkId == 4) {\n return \"ab\";\n }\n else if (networkId > 10 || networkId == 0) {\n return \"ce\";\n }\n else {\n logger.throwArgumentError(\"bad networkId\", \"networkId\", networkId);\n return \"\";\n }\n}\nfunction getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n const val = hexDataSlice(sha256(encode([from, nonce])), 12);\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, };\n//# sourceMappingURL=index.js.map","/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () {\n locked = true;\n};\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map","import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () {\n locked = true;\n};\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map","/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () {\n locked = true;\n};\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map","/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () {\n locked = true;\n};\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map","/**\n * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt.\n * @module\n */\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { sha256 } from \"./sha2.js\";\n// prettier-ignore\nimport { anumber, asyncLoop, checkOpts, clean, rotl, swap32IfBE, u32 } from \"./utils.js\";\n// The main Scrypt loop: uses Salsa extensively.\n// Six versions of the function were tried, this is the fastest one.\n// RFC 7914 §3 / §4 step 2 applies Salsa20/8 to one 16-word (64-byte) block\n// after xor'ing two such blocks.\n// The local `y*` snapshot keeps the xor input stable even when `out` aliases `prev` or `input`.\n// prettier-ignore\nfunction XorAndSalsa(prev, pi, input, ii, out, oi) {\n // Based on https://cr.yp.to/salsa20.html and RFC 7914's Salsa20/8 core.\n // Xor blocks\n let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];\n let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];\n let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];\n let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];\n let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];\n let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];\n let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];\n let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];\n // Save state to temporary variables (salsa)\n let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n // Main loop (salsa)\n for (let i = 0; i < 8; i += 2) {\n x04 ^= rotl(x00 + x12 | 0, 7);\n x08 ^= rotl(x04 + x00 | 0, 9);\n x12 ^= rotl(x08 + x04 | 0, 13);\n x00 ^= rotl(x12 + x08 | 0, 18);\n x09 ^= rotl(x05 + x01 | 0, 7);\n x13 ^= rotl(x09 + x05 | 0, 9);\n x01 ^= rotl(x13 + x09 | 0, 13);\n x05 ^= rotl(x01 + x13 | 0, 18);\n x14 ^= rotl(x10 + x06 | 0, 7);\n x02 ^= rotl(x14 + x10 | 0, 9);\n x06 ^= rotl(x02 + x14 | 0, 13);\n x10 ^= rotl(x06 + x02 | 0, 18);\n x03 ^= rotl(x15 + x11 | 0, 7);\n x07 ^= rotl(x03 + x15 | 0, 9);\n x11 ^= rotl(x07 + x03 | 0, 13);\n x15 ^= rotl(x11 + x07 | 0, 18);\n x01 ^= rotl(x00 + x03 | 0, 7);\n x02 ^= rotl(x01 + x00 | 0, 9);\n x03 ^= rotl(x02 + x01 | 0, 13);\n x00 ^= rotl(x03 + x02 | 0, 18);\n x06 ^= rotl(x05 + x04 | 0, 7);\n x07 ^= rotl(x06 + x05 | 0, 9);\n x04 ^= rotl(x07 + x06 | 0, 13);\n x05 ^= rotl(x04 + x07 | 0, 18);\n x11 ^= rotl(x10 + x09 | 0, 7);\n x08 ^= rotl(x11 + x10 | 0, 9);\n x09 ^= rotl(x08 + x11 | 0, 13);\n x10 ^= rotl(x09 + x08 | 0, 18);\n x12 ^= rotl(x15 + x14 | 0, 7);\n x13 ^= rotl(x12 + x15 | 0, 9);\n x14 ^= rotl(x13 + x12 | 0, 13);\n x15 ^= rotl(x14 + x13 | 0, 18);\n }\n // Write output (salsa)\n out[oi++] = (y00 + x00) | 0;\n out[oi++] = (y01 + x01) | 0;\n out[oi++] = (y02 + x02) | 0;\n out[oi++] = (y03 + x03) | 0;\n out[oi++] = (y04 + x04) | 0;\n out[oi++] = (y05 + x05) | 0;\n out[oi++] = (y06 + x06) | 0;\n out[oi++] = (y07 + x07) | 0;\n out[oi++] = (y08 + x08) | 0;\n out[oi++] = (y09 + x09) | 0;\n out[oi++] = (y10 + x10) | 0;\n out[oi++] = (y11 + x11) | 0;\n out[oi++] = (y12 + x12) | 0;\n out[oi++] = (y13 + x13) | 0;\n out[oi++] = (y14 + x14) | 0;\n out[oi++] = (y15 + x15) | 0;\n}\nfunction BlockMix(input, ii, out, oi, r) {\n // The block B is `r` 128-byte chunks, i.e. `2r` 16-word (64-byte) Salsa blocks.\n let head = oi + 0;\n let tail = oi + 16 * r;\n for (let i = 0; i < 16; i++)\n out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]\n for (let i = 0; i < r; i++, head += 16, ii += 16) {\n // RFC 7914 §4 step 3 outputs `Y[0], Y[2], ...` first, then `Y[1], Y[3], ...`;\n // `head` and `tail` lay out those even/odd halves in place.\n XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])\n if (i > 0)\n tail += 16; // First iteration overwrites tmp value in tail\n // tail[i] = Salsa(blockIn[2*i+1] ^ head[i])\n XorAndSalsa(out, head, input, (ii += 16), out, tail);\n }\n}\n// 128*r*(N+p+1) for N=2**20, r=8, p=1: 1 GiB main table plus 2 KiB workspace.\nconst SCRYPT_DEFAULT_MAXMEM = 128 * 8 * (2 ** 20 + 1 + 1);\n// Common prologue and epilogue for sync/async functions\nfunction scryptInit(password, salt, _opts) {\n const opts = checkOpts({\n dkLen: 32,\n asyncTick: 10,\n maxmem: SCRYPT_DEFAULT_MAXMEM,\n }, _opts);\n const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;\n anumber(N, 'N');\n anumber(r, 'r');\n anumber(p, 'p');\n anumber(dkLen, 'dkLen');\n anumber(asyncTick, 'asyncTick');\n anumber(maxmem, 'maxmem');\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('\"onProgress\" must be a function');\n // Without this, r=0 slips through: blockSize=0 turns the `p` upper bound into\n // Infinity and the failure surfaces later as a confusing pbkdf2 dkLen error.\n if (r < 1)\n throw new Error('\"r\" expected integer >= 1');\n const blockSize = 128 * r;\n const blockSize32 = blockSize / 4;\n // Max N is 2^32 (Integrify is 32-bit).\n // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB.\n // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs,\n // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error:\n // https://www.rfc-editor.org/errata_search.php?rfc=7914\n const pow32 = Math.pow(2, 32);\n if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32)\n throw new Error('\"N\" expected a power of 2, and 2^1 <= N <= 2^32');\n if (p < 1 || p > ((pow32 - 1) * 32) / blockSize)\n throw new Error('\"p\" expected integer 1..((2^32 - 1) * 32) / (128 * r)');\n // RFC 7914 §2 defines `dkLen` as a positive integer.\n if (dkLen < 1 || dkLen > (pow32 - 1) * 32)\n throw new Error('\"dkLen\" expected integer 1..(2^32 - 1) * 32');\n // Include the shared `tmp` scratch block so `maxmem` matches noble's actual temporary allocation.\n // Node requires more headroom here, so this accounting is intentionally noble-specific.\n const memUsed = blockSize * (N + p + 1);\n if (memUsed > maxmem)\n throw new Error('\"maxmem\" limit was hit: memUsed(128*r*(N+p+1))=' + memUsed + ', maxmem=' + maxmem);\n // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)\n // Since it has only one iteration there is no reason to use async variant\n const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });\n const B32 = u32(B);\n // Re-used between parallel iterations. Array(iterations) of B\n const V = u32(new Uint8Array(blockSize * N));\n const tmp = u32(new Uint8Array(blockSize));\n let blockMixCb = () => { };\n if (onProgress) {\n const totalBlockMix = 2 * N * p;\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);\n let blockMixCnt = 0;\n blockMixCb = () => {\n blockMixCnt++;\n if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) {\n // Wiping here instead of a try/catch around the main loops keeps them\n // try-free: measured ~1% slower at N=2^21 with the loops inside a try.\n // onProgress is the only user code that can throw mid-derivation.\n try {\n onProgress(blockMixCnt / totalBlockMix);\n }\n catch (e) {\n clean(B, V, tmp);\n throw e;\n }\n }\n };\n }\n return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };\n}\nfunction scryptOutput(password, dkLen, B, V, tmp) {\n // Shared final PBKDF2-and-cleanup step: keep the derived key, wipe the scrypt workspace.\n const res = pbkdf2(sha256, password, B, { c: 1, dkLen });\n clean(B, V, tmp);\n return res;\n}\n/**\n * Scrypt KDF from RFC 7914. See {@link ScryptOpts}.\n * @param password - password or key material to derive from;\n * JS string inputs are UTF-8 encoded first\n * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first\n * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,\n * must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}.\n * @returns Derived key bytes.\n * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}\n * @example\n * Derive a key with scrypt.\n * ```ts\n * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });\n * ```\n * @example\n * Derive a key with small demo costs and progress/memory controls.\n * ```ts\n * const progressLog: number[] = [];\n * scrypt('password', 'salt', {\n * N: 16,\n * r: 8,\n * p: 1,\n * dkLen: 32,\n * maxmem: 1024 * 1024,\n * asyncTick: 10,\n * onProgress(progress) {\n * progressLog.push(progress);\n * },\n * });\n * ```\n */\nexport function scrypt(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts);\n swap32IfBE(B32);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n for (let i = 0, pos = 0; i < N - 1; i++) {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n for (let i = 0; i < N; i++) {\n // First u32 of the last 64-byte block (u32 is LE)\n // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N\n // only depends on the low word here because N is a power of two and\n // this implementation caps N at 2^32.\n // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked\n // above; >>> 0 for unsigned, input fits in u32.\n const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations\n // tmp = B ^ V[j]\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }\n }\n swap32IfBE(B32);\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n/**\n * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}.\n * @param password - password or key material to derive from;\n * JS string inputs are UTF-8 encoded first\n * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first\n * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,\n * must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local\n * scheduler-yield control for this JS wrapper, not part of RFC 7914.\n * See {@link ScryptOpts}.\n * @returns Promise resolving to derived key bytes.\n * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}\n * @example\n * Derive a key with scrypt asynchronously.\n * ```ts\n * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });\n * ```\n * @example\n * Derive a key asynchronously with small demo costs and progress/memory controls.\n * ```ts\n * await scryptAsync('password', 'salt', {\n * N: 16,\n * r: 8,\n * p: 1,\n * dkLen: 32,\n * maxmem: 1024 * 1024,\n * asyncTick: 1,\n * onProgress(progress) {\n * if (progress > 1) throw new Error('invalid progress');\n * },\n * });\n * ```\n */\nexport async function scryptAsync(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts);\n // One failure handler covers both yield boundaries without putting the hot loops in a try block.\n const abort = () => clean(B, V, tmp);\n swap32IfBE(B32);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n let pos = 0;\n await asyncLoop(N - 1, asyncTick, () => {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }, abort);\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n await asyncLoop(N, asyncTick, () => {\n // First u32 of the last 64-byte block (u32 is LE)\n // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N\n // only depends on the low word here because N is a power of two and\n // this implementation caps N at 2^32.\n // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked\n // above; >>> 0 for unsigned, input fits in u32.\n const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations\n // tmp = B ^ V[j]\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }, abort);\n }\n swap32IfBE(B32);\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n","import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from \"@noble/hashes/scrypt.js\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () {\n lockedAsync = true;\n};\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () {\n lockedSync = true;\n};\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport { dataLength, getBytesCopy, hexlify, assertArgument, } from \"../utils/index.js\";\nimport { arrayify, hexConcat } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { ed448 } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"signing-key/0.0.1\");\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 const normalized = typeof privateKey === \"string\" && !privateKey.startsWith(\"0x\")\n ? \"0x\" + privateKey\n : privateKey;\n assertArgument(dataLength(normalized) === 57, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(normalized);\n }\n /**\n * The private key.\n */\n get privateKey() {\n return this.#privateKey;\n }\n /** The 57-byte Ed448 public key encoded as hex. */\n get publicKey() {\n return SigningKey.computePublicKey(this.#privateKey);\n }\n /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */\n get compressedPublicKey() {\n return SigningKey.computePublicKey(this.#privateKey, true);\n }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n const key = getBytesCopy(this.#privateKey);\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const keyBuffer = new Uint8Array(arrayify(key));\n if (keyBuffer.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n const digestBuffer = new Uint8Array(arrayify(digest));\n if (digestBuffer.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n if (keyBuffer[56] > 127) {\n const prefix = keyBuffer.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[55] |= 0x80;\n prefix[56] = 0;\n const scalar = prefix.slice(0, 56);\n const bufferDigest = Buffer.from(digestBuffer);\n const bufferPrfx = Buffer.from(prefix);\n const bufferScalar = Buffer.from(scalar);\n const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx);\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer));\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */\n computeSharedSecret(other) {\n const pub = Buffer.from(getBytesCopy(other));\n assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), \"invalid public key\", \"other\", other);\n const key = Buffer.from(getBytesCopy(this.#privateKey));\n if (key[56] > 127) {\n const scalar = key.subarray(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n return hexlify(ed448.deriveWithScalar(pub, scalar));\n }\n return hexlify(ed448.derive(pub, key));\n }\n /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */\n static computePublicKey(key, compressed) {\n const bytes = Buffer.from(arrayify(key));\n if (bytes.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n if (bytes[56] > 127) {\n const scalar = bytes.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n const pub = ed448.publicKeyFromScalar(scalar);\n return hexlify(pub);\n }\n const pub = ed448.publicKeyCreate(bytes);\n return hexlify(pub);\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 digestBuffer = Buffer.from(arrayify(digest));\n const sigBuffer = Buffer.from(arrayify(signature));\n if (sigBuffer.length !== 171) {\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n }\n const sig = sigBuffer.slice(0, 114);\n const pub = sigBuffer.slice(114);\n if (ed448.verify(digestBuffer, sig, pub)) {\n return hexlify(pub);\n }\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n return \"\";\n }\n /** Adds two encoded Ed448 public points. The compression flag is ignored. */\n static addPoints(p0, p1, compressed) {\n const points = [p0, p1].map((point) => {\n const bytes = Buffer.from(getBytesCopy(point));\n assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), \"invalid public key\", \"point\", point);\n return bytes;\n });\n return hexlify(ed448.publicKeyCombine(points));\n }\n}\n//# sourceMappingURL=signing-key.js.map","import { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate, } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst _guard = {};\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signautre.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() {\n return this.#r;\n }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n const value = hexlify(_value);\n assertArgument(parseInt(value.substring(0, 3)) < 8, \"non-canonical s\", \"value\", value);\n this.#s = value;\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() {\n return this.#v;\n }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() {\n return this.#networkV;\n }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacynetworkId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getnetworkId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return this.v === 27 ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, this.yParity ? \"0x1c\" : \"0x1b\"]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return `Signature { r: \"${this.r}\", s: \"${this.s}\", yParity: ${this.yParity}, networkV: ${this.networkV} }`;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this.s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: networkV != null ? networkV.toString() : null,\n r: this.r,\n s: this.s,\n v: this.v,\n };\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getnetworkId(45)\n * //_result:\n *\n * Signature.getnetworkId(46)\n * //_result:\n */\n static getnetworkId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if (bv == BN_27 || bv == BN_28) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getnetworkIdV(5, 27)\n * //_result:\n *\n * Signature.getnetworkIdV(5, 28)\n * //_result:\n *\n */\n static getnetworkIdV(networkId, v) {\n return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return bv & BN_1 ? 27 : 28;\n }\n}\n//# sourceMappingURL=signature.js.map","/**\n * A fundamental building block of Core is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha3.js\";\nimport { Ed448Goldilock } from \"./crypto.js\";\nimport { keccak256 } from \"./keccak.js\";\nexport { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\nfunction lock() {\n computeHmac.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { arrayify, hexDataSlice } from \"../utils/data.js\";\nimport { calculateCheckSum } from \"../address/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 removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nexport function publicToAddress(key, prefix) {\n const val = hexDataSlice(sha256(key), 12);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport function computeAddress(key, prefix) {\n let pubkey;\n if (typeof key === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return publicToAddress(pubkey, prefix); // getAddress(sha256(\"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, prefix) {\n // return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature);\n return publicToAddress(publicKey, prefix);\n}\nexport function extractPrefix(address) {\n address = getAddress(address);\n return address.substring(2, 4);\n}\n//# sourceMappingURL=address.js.map","import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument, } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => {\n this[index] = item;\n });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof name === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, new Map());\n // Remove any key thats not unique\n this.#names = Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n }));\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof prop === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply(this === receiver ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply(this === receiver ? target : this, [\n prop,\n ]);\n }\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n }\n /**\n * Returns the Result as a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray() {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject() {\n return this.#names.reduce((accum, name, index) => {\n assert(name != null, \"value at index ${ index } unnamed\", \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\",\n });\n // Add values for names that don't conflict\n if (!(name in accum)) {\n accum[name] = this.getValue(name);\n }\n return accum;\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(this.#names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(this.#names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = this.#names.indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: WordSize,\n offset: bytes.length,\n });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\",\n type: \"string\",\n localName: \"string\",\n dynamic: \"boolean\",\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() {\n return this.#dataLength;\n }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n constructor(data, allowLoose) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#offset = 0;\n }\n get data() {\n return hexlify(this.#data);\n }\n get dataLength() {\n return this.#data.length;\n }\n get consumed() {\n return this.#offset;\n }\n get bytes() {\n return new Uint8Array(this.#data);\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose &&\n loose &&\n this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength,\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose);\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, {\n signed,\n width,\n });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${size ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_corebc_typed\");\nexport class Typed {\n type;\n value;\n #options;\n _typedSymbol;\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n defaultValue() {\n return 0;\n }\n minValue() {\n return 0;\n }\n maxValue() {\n return 0;\n }\n isBigInt() {\n return !!this.type.match(/^u?int[0-9]+$/);\n }\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n isString() {\n return this.type === \"string\";\n }\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return this.value.length;\n }\n return null;\n }\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n static uint8(v) {\n return n(v, 8);\n }\n static uint16(v) {\n return n(v, 16);\n }\n static uint24(v) {\n return n(v, 24);\n }\n static uint32(v) {\n return n(v, 32);\n }\n static uint40(v) {\n return n(v, 40);\n }\n static uint48(v) {\n return n(v, 48);\n }\n static uint56(v) {\n return n(v, 56);\n }\n static uint64(v) {\n return n(v, 64);\n }\n static uint72(v) {\n return n(v, 72);\n }\n static uint80(v) {\n return n(v, 80);\n }\n static uint88(v) {\n return n(v, 88);\n }\n static uint96(v) {\n return n(v, 96);\n }\n static uint104(v) {\n return n(v, 104);\n }\n static uint112(v) {\n return n(v, 112);\n }\n static uint120(v) {\n return n(v, 120);\n }\n static uint128(v) {\n return n(v, 128);\n }\n static uint136(v) {\n return n(v, 136);\n }\n static uint144(v) {\n return n(v, 144);\n }\n static uint152(v) {\n return n(v, 152);\n }\n static uint160(v) {\n return n(v, 160);\n }\n static uint168(v) {\n return n(v, 168);\n }\n static uint176(v) {\n return n(v, 176);\n }\n static uint184(v) {\n return n(v, 184);\n }\n static uint192(v) {\n return n(v, 192);\n }\n static uint200(v) {\n return n(v, 200);\n }\n static uint208(v) {\n return n(v, 208);\n }\n static uint216(v) {\n return n(v, 216);\n }\n static uint224(v) {\n return n(v, 224);\n }\n static uint232(v) {\n return n(v, 232);\n }\n static uint240(v) {\n return n(v, 240);\n }\n static uint248(v) {\n return n(v, 248);\n }\n static uint256(v) {\n return n(v, 256);\n }\n static uint(v) {\n return n(v, 256);\n }\n static int8(v) {\n return n(v, -8);\n }\n static int16(v) {\n return n(v, -16);\n }\n static int24(v) {\n return n(v, -24);\n }\n static int32(v) {\n return n(v, -32);\n }\n static int40(v) {\n return n(v, -40);\n }\n static int48(v) {\n return n(v, -48);\n }\n static int56(v) {\n return n(v, -56);\n }\n static int64(v) {\n return n(v, -64);\n }\n static int72(v) {\n return n(v, -72);\n }\n static int80(v) {\n return n(v, -80);\n }\n static int88(v) {\n return n(v, -88);\n }\n static int96(v) {\n return n(v, -96);\n }\n static int104(v) {\n return n(v, -104);\n }\n static int112(v) {\n return n(v, -112);\n }\n static int120(v) {\n return n(v, -120);\n }\n static int128(v) {\n return n(v, -128);\n }\n static int136(v) {\n return n(v, -136);\n }\n static int144(v) {\n return n(v, -144);\n }\n static int152(v) {\n return n(v, -152);\n }\n static int160(v) {\n return n(v, -160);\n }\n static int168(v) {\n return n(v, -168);\n }\n static int176(v) {\n return n(v, -176);\n }\n static int184(v) {\n return n(v, -184);\n }\n static int192(v) {\n return n(v, -192);\n }\n static int200(v) {\n return n(v, -200);\n }\n static int208(v) {\n return n(v, -208);\n }\n static int216(v) {\n return n(v, -216);\n }\n static int224(v) {\n return n(v, -224);\n }\n static int232(v) {\n return n(v, -232);\n }\n static int240(v) {\n return n(v, -240);\n }\n static int248(v) {\n return n(v, -248);\n }\n static int256(v) {\n return n(v, -256);\n }\n static int(v) {\n return n(v, -256);\n }\n static bytes1(v) {\n return b(v, 1);\n }\n static bytes2(v) {\n return b(v, 2);\n }\n static bytes3(v) {\n return b(v, 3);\n }\n static bytes4(v) {\n return b(v, 4);\n }\n static bytes5(v) {\n return b(v, 5);\n }\n static bytes6(v) {\n return b(v, 6);\n }\n static bytes7(v) {\n return b(v, 7);\n }\n static bytes8(v) {\n return b(v, 8);\n }\n static bytes9(v) {\n return b(v, 9);\n }\n static bytes10(v) {\n return b(v, 10);\n }\n static bytes11(v) {\n return b(v, 11);\n }\n static bytes12(v) {\n return b(v, 12);\n }\n static bytes13(v) {\n return b(v, 13);\n }\n static bytes14(v) {\n return b(v, 14);\n }\n static bytes15(v) {\n return b(v, 15);\n }\n static bytes16(v) {\n return b(v, 16);\n }\n static bytes17(v) {\n return b(v, 17);\n }\n static bytes18(v) {\n return b(v, 18);\n }\n static bytes19(v) {\n return b(v, 19);\n }\n static bytes20(v) {\n return b(v, 20);\n }\n static bytes21(v) {\n return b(v, 21);\n }\n static bytes22(v) {\n return b(v, 22);\n }\n static bytes23(v) {\n return b(v, 23);\n }\n static bytes24(v) {\n return b(v, 24);\n }\n static bytes25(v) {\n return b(v, 25);\n }\n static bytes26(v) {\n return b(v, 26);\n }\n static bytes27(v) {\n return b(v, 27);\n }\n static bytes28(v) {\n return b(v, 28);\n }\n static bytes29(v) {\n return b(v, 29);\n }\n static bytes30(v) {\n return b(v, 30);\n }\n static bytes31(v) {\n return b(v, 31);\n }\n static bytes32(v) {\n return b(v, 32);\n }\n static address(v) {\n return new Typed(_gaurd, \"address\", v);\n }\n static bool(v) {\n return new Typed(_gaurd, \"bool\", !!v);\n }\n static bytes(v) {\n return new Typed(_gaurd, \"bytes\", v);\n }\n static string(v) {\n return new Typed(_gaurd, \"string\", v);\n }\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return value && value._typedSymbol === _typedSymbol;\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map","import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 22));\n }\n}\n//# sourceMappingURL=address.js.map","import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","import { defineProperties, isError, assert, assertArgument, assertArgumentCount, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof values === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => {\n func(staticWriter.length);\n });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\";\n const dynamic = length === -1 || coder.dynamic;\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? \" \" + this.localName : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", {\n buffer: reader.bytes,\n offset: count * WordSize,\n length: reader.dataLength,\n });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map","import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map","import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map","import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\".substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map","import { defineProperties, fromTwos, getBigInt, mask, toTwos, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = (signed ? \"int\" : \"uint\") + size * 8;\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, this.size * 8 - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map","import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = \"tuple(\" + types.join(\",\") + \")\";\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, {\n coders: Object.freeze(coders.slice()),\n });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map","import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.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 * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of ore in a single xcb.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const OrePerXCB = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") *\n BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nexport const NegativeOne = /*#__PURE__*/ BigInt(-1);\nexport const Zero = /*#__PURE__*/ BigInt(0);\nexport const One = /*#__PURE__*/ BigInt(1);\nexport const Two = /*#__PURE__*/ BigInt(2);\n//# sourceMappingURL=numbers.js.map","// NFKC (composed) // (decomposed)\n/**\n * A constant for the core symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const CoreSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Core Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Core Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map","import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n }),\n };\n}\n/**\n * Returns a [[AccessList]] from any corebcsupported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof set === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof value === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => a.address.localeCompare(b.address));\n return result;\n}\n//# sourceMappingURL=accesslist.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { recoverAddress } from \"./address.js\";\nimport { checkProperties } from \"../utils/properties.js\";\nimport { arrayify, stripZeros } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport * as RLP from \"../crypto/rlp.js\";\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst logger = new Logger(\"transaction/0.0.1\");\nconst BN_0 = BigInt(0);\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction parse(data) {\n const handleNumber = (value) => {\n // @ts-ignore\n if (value === \"0x\") {\n return BigNumber.from(0);\n }\n return BigNumber.from(value);\n };\n const transaction = RLP.decode(data);\n if (transaction.length !== 7 && transaction.length !== 8) {\n logger.throwArgumentError(\"invalid raw transaction\", \"data\", data);\n }\n const isSigned = transaction.length === 8;\n const tx = {\n nonce: Number(handleNumber(transaction[0])),\n energyPrice: handleNumber(transaction[1]).toBigInt(),\n energyLimit: handleNumber(transaction[2]).toBigInt(),\n networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(),\n to: handleAddress(transaction[isSigned ? 4 : 3]),\n value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(),\n data: transaction[isSigned ? 6 : 5],\n };\n if (transaction.length === 8) {\n const prefix = networkIdToPrefix(Number(tx.networkId));\n const digest = sha256(serialize(tx));\n tx.hash = sha256(serialize(tx, transaction[7]));\n tx.from = recoverAddress(digest, transaction[7], prefix);\n tx.signature = transaction[7];\n }\n return tx;\n}\nconst unsignedTransactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n { name: \"networkId\", maxLength: 32, numeric: true },\n];\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"networkId\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n networkId: true,\n data: true,\n energyLimit: true,\n energyPrice: true,\n nonce: true,\n to: true,\n value: true,\n};\nfunction serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) {\n let value = transaction[name] || [];\n const options = {};\n if (numeric) {\n options.hexPad = \"left\";\n }\n const tmpHexlified = hexlify(value, options);\n value = arrayify(tmpHexlified);\n // Fixed-width field\n if (length && value.length !== length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n // Variable-width (with a maximum)\n if (maxLength) {\n value = stripZeros(value);\n if (value.length > maxLength) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n }\n const hexlified = hexlify(value);\n raw.push(hexlified);\n });\n if (!!signature) {\n raw.push(hexlify(signature));\n }\n const finalValue = RLP.encode(raw);\n return finalValue;\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Core by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in corebc) 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 #to;\n #data;\n #nonce;\n #energyLimit;\n #energyPrice;\n #value;\n #networkId;\n #sig;\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n return this.#to;\n }\n set to(value) {\n this.#to = value == null ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() {\n return this.#nonce;\n }\n set nonce(value) {\n this.#nonce = getNumber(value, \"value\");\n }\n /**\n * The energy limit.\n */\n get energyLimit() {\n return this.#energyLimit;\n }\n set energyLimit(value) {\n this.#energyLimit = getBigInt(value);\n }\n /**\n * The energy 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 energyPrice() {\n const value = this.#energyPrice;\n if (value == null) {\n return BN_0;\n }\n return value;\n }\n set energyPrice(value) {\n this.#energyPrice = value == null ? null : getBigInt(value, \"energyPrice\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() {\n return this.#data;\n }\n set data(value) {\n this.#data = hexlify(value);\n }\n /**\n * The amount of xcb (in ore) to send in this transactions.\n */\n get value() {\n return this.#value;\n }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value);\n }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() {\n return this.#sig || null;\n }\n set signature(value) {\n this.#sig = value == null ? null : value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#to = null;\n this.#nonce = 0;\n this.#energyLimit = BigInt(0);\n this.#energyPrice = null;\n this.#data = \"0x\";\n this.#value = BigInt(0);\n this.#networkId = BigInt(0);\n this.#sig = 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 sha256(this.serialized);\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 sha256(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 const prefix = networkIdToPrefix(Number(this.#networkId));\n return recoverAddress(this.unsignedHash, this.signature, prefix);\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);\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 //isSigned(): this is SignedTransaction {\n return this.signature != null;\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 assert(this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n return serialize(this, this.signature);\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 serialize(this);\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 to: this.to,\n data: this.data,\n nonce: this.nonce,\n energyLimit: s(this.energyLimit),\n energyPrice: s(this.energyPrice),\n value: s(this.value),\n networkId: s(this.networkId),\n sig: this.signature ? this.signature : null,\n };\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 return Transaction.from(parse(payload));\n }\n const result = new Transaction();\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.energyLimit != null) {\n result.energyLimit = tx.energyLimit;\n }\n if (tx.energyPrice != null) {\n result.energyPrice = tx.energyPrice;\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.networkId != null) {\n result.networkId = tx.networkId;\n }\n if (tx.signature != null) {\n result.signature = tx.signature;\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 { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof message === \"string\") {\n message = toUtf8Bytes(message);\n }\n return sha256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message,\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig, prefix) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig, prefix);\n}\n//# sourceMappingURL=message.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument, } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = !!value ? \"0x01\" : \"0x00\";\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = match[1] === \"int\";\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) &&\n size % 8 === 0 &&\n size !== 0 &&\n size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map","import { getAddress } from \"../address/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\";\nimport { sha256 } from \"../crypto/index.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\");\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 networkId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\",\n};\nconst domainFieldNames = [\n \"name\",\n \"version\",\n \"networkId\",\n \"verifyingContract\",\n \"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 networkId: function (_value) {\n const value = getBigInt(_value, \"domain.networkId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.networkId\", _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] || \"256\");\n assertArgument(width % 8 === 0 &&\n width !== 0 &&\n width <= 256 &&\n (match[2] == null || 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\":\n return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\":\n return function (value) {\n return !value ? hexFalse : hexTrue;\n };\n case \"bytes\":\n return function (value) {\n return sha256(value);\n };\n case \"string\":\n return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields\n .map(({ name, type }) => type + \" \" + name)\n .join(\",\")})`;\n}\nexport class TypedDataEncoder {\n primaryType;\n #types;\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n constructor(types) {\n this.#types = JSON.stringify(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 Object.keys(types).forEach((type) => {\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\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 = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1] || null;\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\n .map((t) => JSON.stringify(t))\n .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]) +\n st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(sha256);\n }\n return sha256(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 sha256(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 encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return sha256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n return value.map((v) => this._visit(match[1], 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 visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\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 static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value),\n ]);\n }\n static hash(domain, types, value) {\n return sha256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\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 &&\n !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 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 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, prefix) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix);\n}\n//# sourceMappingURL=typed-data.js.map","/**\n * About frgaments...\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nvar _a;\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\",\n \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\",\n \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\",\n \"@\": \"AT\",\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() {\n return this.#offset;\n }\n get length() {\n return this.#tokens.length - this.#offset;\n }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() {\n return new _a(this.#tokens);\n }\n reset() {\n this.#offset = 0;\n }\n #subTokenString(from = 0, to = 0) {\n return new _a(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: t.match - from,\n linkBack: t.linkBack - from,\n linkNext: t.linkNext - from,\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return top != null && allowed.has(top) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return top.type === type ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\n_a = TokenString;\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = offset < text.length ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = {\n depth: brackets.length,\n linkBack: -1,\n linkNext: -1,\n match: -1,\n type: \"\",\n text: \"\",\n offset,\n value: -1,\n };\n tokens.push(token);\n let type = SimpleTokens[cur[0]] || \"\";\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n tokens[token.match].match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n tokens[tokens.length - 1].value =\n getNumber(value);\n }\n if (tokens.length === 0 ||\n tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n tokens[tokens.length - 1].text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a energy limit, returning a BigNumber or null if none\nfunction consumeEnergy(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid energy\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_corebc_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **PAramType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name,\n type,\n baseType,\n indexed,\n components,\n arrayLength,\n arrayChildren,\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n let result = {\n type: this.baseType === \"tuple\" ? \"tuple\" : this.type,\n name: this.name || undefined,\n };\n if (typeof this.indexed === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${this.arrayLength < 0 ? \"\" : String(this.arrayLength)}]`;\n }\n else {\n if (this.isTuple()) {\n if (format !== \"sighash\") {\n result += this.type;\n }\n result +=\n \"(\" +\n this.components\n .map((comp) => comp.format(format))\n .join(format === \"full\" ? \", \" : \",\") +\n \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /*\n * Returns true if %%value%% is an Array type.\n *\n * This provides a type gaurd ensuring that the\n * [[arrayChildren]] and [[arrayLength]] are non-null.\n */\n //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } {\n // return value && (value.baseType === \"array\")\n //}\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return this.baseType === \"array\";\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return this.baseType === \"tuple\";\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return this.indexed != null;\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => _this.arrayChildren.walk(v, process));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => _this.components[i].walk(v, process));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof value !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () {\n setValue(await result);\n })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS naes by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ParamType.from(lex(obj), allowIndexed);\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") ||\n obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = obj.peekType(\"ID\") ? obj.pop().text : \"\";\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof name === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components,\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" ||\n type.startsWith(\"tuple(\" /* fix: ) */) ||\n type.startsWith(\"(\" /* fix: ) */)) {\n const comps = obj.components != null\n ? obj.components.map((c) => ParamType.from(c))\n : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return value && value[internal] === ParamTypeInternal;\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof obj === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n }\n else if (typeof obj === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\",\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof name === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return (\"(\" +\n params.map((p) => p.format(format)).join(format === \"full\" ? \", \" : \",\") +\n \")\");\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === ErrorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return EventFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n static isFragment(value) {\n return value && value[internal] === EventFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n payable;\n energy;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, energy) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, {\n value: ConstructorFragmentInternal,\n });\n defineProperties(this, { payable, energy });\n }\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: this.payable ? \"payable\" : \"undefined\",\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n result.push(this.payable ? \"payable\" : \"nonpayable\");\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n return result.join(\" \");\n }\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ConstructorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, setify([\"payable\"])).has(\"payable\");\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, energy);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === ConstructorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n format(format) {\n const type = this.inputs.length === 0 ? \"receive\" : \"fallback\";\n if (format === \"json\") {\n const stateMutability = this.payable ? \"payable\" : \"nonpayable\";\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FallbackFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = obj.stateMutability === \"payable\";\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n static isFragment(value) {\n return value && value[internal] === FallbackFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The amount of energy to send when calling this function\n */\n energy;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, energy) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = stateMutability === \"view\" || stateMutability === \"pure\";\n const payable = stateMutability === \"payable\";\n defineProperties(this, {\n constant,\n energy,\n outputs,\n payable,\n stateMutability,\n });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: this.stateMutability !== \"nonpayable\"\n ? this.stateMutability\n : undefined,\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n }\n return result.join(\" \");\n }\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FunctionFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof obj.constant === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === FunctionFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n format() {\n throw new Error(\"@TODO\");\n }\n static from(obj) {\n if (typeof obj === \"string\") {\n return StructFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === StructFragmentInternal;\n }\n}\n//# sourceMappingURL=fragments.js.map","/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason],\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code],\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: tx.to ? getAddress(tx.to) : null,\n data: tx.data || \"0x\",\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action,\n data,\n reason,\n transaction,\n invocation,\n revert,\n });\n}\n/**\n * About AbiCoder\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, match[1] === \"int\", param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose));\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an corebc-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map","/**\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","/**\n * About Interface\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert, } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nexport { checkResultErrors, Result };\nexport class LogDescription {\n fragment;\n name;\n signature;\n topic;\n args;\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n signature,\n topic,\n args,\n });\n }\n}\nexport class TransactionDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n value;\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n value,\n });\n }\n}\nexport class ErrorDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n });\n }\n}\nexport class Indexed {\n hash;\n _isIndexed;\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n },\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n },\n },\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving xcb is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof fragments === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(\"EE\", error);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags),\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, {\n deploy: fragment,\n });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback ||\n fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\"),\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = minimal ? \"minimal\" : \"full\";\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = values.length > 0 ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength &&\n (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 &&\n values &&\n values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null ||\n Array.isArray(lastArg) ||\n typeof lastArg !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#functions.get(name), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#events.get(name), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#errors.get(name), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\n getSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n\n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n\n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n\n fragment = matches[0];\n }\n\n return dataSlice(id(fragment.format()), 0, 4);\n }\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if (bytes.length % 32 === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() },\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name,\n signature: ef.format(),\n args,\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args,\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n\n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n };\n\n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n*/\n // Create the filter for the event with search criteria (e.g. for xcb_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return sha256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof value === \"boolean\") {\n value = value ? \"0x01\" : \"0x00\";\n }\n if (param.type.match(/^u?int/)) {\n value = toBeHex(value);\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n //@TOOD should probably be return toHex(value, 32)\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", \"contract.\" + param.name, value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", \"contract.\" + param.name, value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(sha256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics,\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" ||\n param.type === \"bytes\" ||\n param.baseType === \"tuple\" ||\n param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt(tx.value != null ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof value === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // Maybe an interface from an older version, or from a symlinked copy\n if (typeof value.format === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map","import { concat, \n// dataSlice,\ngetBigInt,\n// encodeRlp\n } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { hexDataLength, hexDataSlice } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { removeHexPrefix } from \"../transaction/address.js\";\nimport { calculateCheckSum } from \"./index.js\";\nconst logger = new Logger(\"contract-address/0.0.1\");\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(from);\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\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 * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n const val = hexDataSlice(sha256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12);\n console.log({ \"contract-address/74=>should be string\": val });\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\n//# sourceMappingURL=contract-address.js.map","import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.corebc.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return value && typeof value.getAddress === \"function\";\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null ||\n result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof target !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target) {\n if (typeof target === \"string\") {\n return getAddress(target);\n // assert(resolver != null, \"ENS resolution requires a provider\",\n // \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n // return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof target.then === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map","import { defineProperties, getBigInt, getNumber, hexlify, resolveProperties, assert, assertArgument, isError, makeError, } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The energy price for legacy networks.\n */\n energyPrice;\n constructor(energyPrice) {\n defineProperties(this, {\n energyPrice: getValue(energyPrice),\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { energyPrice } = this;\n return {\n _type: \"FeeData\",\n energyPrice: toJson(energyPrice),\n };\n }\n}\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"networkId,energyLimit,energyPrice,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipReadEnabled = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Core.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total energy limit for this block.\n */\n energyLimit;\n /**\n * The total energy used in this block.\n */\n energyUsed;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per energy that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerEnergy;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof tx !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n nonce: block.nonce,\n difficulty: block.difficulty,\n energyLimit: block.energyLimit,\n energyUsed: block.energyUsed,\n miner: block.miner,\n extraData: block.extraData,\n baseFeePerEnergy: getValue(block.baseFeePerEnergy),\n });\n }\n /**\n * Returns the list of transaction hashes.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof tx === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions for blocks which\n * prefetched them, by passing ``true`` to %%prefetchTxs%%\n * into [[provider_getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof txs[0] === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\",\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this;\n return {\n _type: \"Block\",\n baseFeePerEnergy: toJson(baseFeePerEnergy),\n difficulty: toJson(difficulty),\n extraData,\n energyLimit: toJson(energyLimit),\n energyUsed: toJson(energyUsed),\n hash,\n miner,\n nonce,\n number,\n parentHash,\n timestamp,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++],\n done: false,\n };\n }\n return { value: undefined, done: true };\n },\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() {\n return this.#transactions.length;\n }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof indexOrHash === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof v === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash === hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof tx === \"string\") {\n return await this.provider.getTransaction(tx);\n }\n else {\n return tx;\n }\n }\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof indexOrHash === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Has this block been mined.\n *\n * If true, the block has been typed-gaurded that all mined\n * properties are non-null.\n */\n isMined() {\n return !!this.hash;\n }\n /**\n *\n */\n isLondon() {\n return !!this.baseFeePerEnergy;\n }\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\nexport class Log {\n provider;\n transactionHash;\n blockHash;\n blockNumber;\n removed;\n address;\n data;\n topics;\n index;\n transactionIndex;\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this;\n return {\n _type: \"log\",\n address,\n blockHash,\n blockNumber,\n data,\n index,\n removed,\n topics,\n transactionHash,\n transactionIndex,\n };\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\nexport class TransactionReceipt {\n provider;\n to;\n from;\n contractAddress;\n hash;\n index;\n blockHash;\n blockNumber;\n logsBloom;\n energyUsed;\n cumulativeEnergyUsed;\n energyPrice;\n type;\n //readonly byzantium!: boolean;\n status;\n root;\n #logs;\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n energyUsed: tx.energyUsed,\n cumulativeEnergyUsed: tx.cumulativeEnergyUsed,\n energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice),\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root,\n });\n }\n get logs() {\n return this.#logs;\n }\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,\n status, root, } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash,\n blockNumber,\n //byzantium,\n contractAddress,\n cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed),\n from,\n energyPrice: toJson(this.energyPrice),\n energyUsed: toJson(this.energyUsed),\n hash,\n index,\n logs,\n logsBloom,\n root,\n status,\n to,\n };\n }\n get length() {\n return this.logs.length;\n }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n },\n };\n }\n get fee() {\n return this.energyUsed * this.energyPrice;\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n async getResult() {\n return await this.provider.getTransactionResult(this.hash);\n }\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/*\nexport type ReplacementDetectionSetup = {\n to: string;\n from: string;\n value: bigint;\n data: string;\n nonce: number;\n block: number;\n};\n*/\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of energy this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n energyLimit;\n /**\n * The energy price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective energy price// (the fee per energy that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerEnergy]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of energy the transaction\n * consumes.\n */\n energyPrice;\n /**\n * The data.\n */\n data;\n /**\n * The value, in ore. Use [[formatXCB]] to format this value\n * as xcb.\n */\n value;\n /**\n * The chain ID.\n */\n networkId;\n /**\n * The signature.\n */\n signature;\n #startBlock;\n /**\n * Create a new TransactionResponse with %%tx%% parameters\n * connected to %%provider%%.\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null;\n this.blockHash = tx.blockHash != null ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.from = tx.from;\n this.to = tx.to || null;\n this.energyLimit = tx.energyLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.energyPrice = tx.energyPrice;\n this.networkId = tx.networkId;\n this.signature = tx.signature;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON representation of this transaction.\n */\n toJSON() {\n const { index, hash, type, to, from, nonce, data, signature } = this;\n return {\n _type: \"TransactionReceipt\",\n networkId: toJson(this.networkId),\n data,\n from,\n energyLimit: toJson(this.energyLimit),\n energyPrice: toJson(this.energyPrice),\n hash,\n nonce,\n signature,\n to,\n index,\n type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = _confirms == null ? 1 : _confirms;\n const timeout = _timeout == null ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = startBlock === -1 ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from),\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if (blockNumber - receipt.blockNumber + 1 < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data &&\n tx.to === this.to &&\n tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" &&\n tx.from === tx.to &&\n tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: reason === \"replaced\" || reason === \"cancelled\",\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt,\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (receipt) {\n if ((await receipt.confirmations()) >= confirms) {\n return receipt;\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => {\n cancellers.forEach((c) => c());\n };\n // On cancel, stop scanning for replacements\n cancellers.push(() => {\n stopScanning = true;\n });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => {\n clearTimeout(timer);\n });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n resolve(receipt);\n }\n };\n cancellers.push(() => {\n this.provider.off(this.hash, txListener);\n });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => {\n this.provider.off(\"block\", replaceListener);\n });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return this.blockHash != null;\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return this.type === 0;\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return {\n orphan: \"drop-log\",\n log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index,\n },\n };\n}\n//# sourceMappingURL=provider.js.map","import { Log, TransactionReceipt, TransactionResponse, } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\nexport class EventLog extends Log {\n interface;\n fragment;\n args;\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length\n ? this.#iface.getEvent(log.topics[0])\n : null;\n if (fragment) {\n return new EventLog(log, this.#iface, fragment);\n }\n else {\n return log;\n }\n });\n }\n}\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n async wait(confirms) {\n const receipt = await super.wait();\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\nexport class ContractUnknownEventPayload extends EventPayload {\n log;\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n async getBlock() {\n return await this.log.getBlock();\n }\n async getTransaction() {\n return await this.log.getTransaction();\n }\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map","import { Indexed, Interface, Typed } from \"../abi/index.js\";\nimport { resolveAddress } from \"../address/checks.js\";\nimport { copyRequest, Log, } from \"../providers/provider.js\";\nimport { defineProperties, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument, } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return value && typeof value.call === \"function\";\n}\nfunction canEstimate(value) {\n return value && typeof value.estimateEnergy === \"function\";\n}\nfunction canResolve(value) {\n return value && typeof value.resolveName === \"function\";\n}\nfunction canSend(value) {\n return value && typeof value.sendTransaction === \"function\";\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof value[feature] === \"function\") {\n return value;\n }\n if (value.provider && typeof value.provider[feature] === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(Typed.dereference(arg, \"overrides\"));\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from);\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n const iface = contract.interface;\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || (tx.value || BN_0) === BN_0, \"cannot send value to non-payable contract\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || (tx.data || \"0x\") === \"0x\", \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment in getFragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs),\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract,\n _key: key,\n getFragment,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment in defineProperty\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment in\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract,\n _key: key,\n getFragment,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_corebcInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value &&\n typeof value === \"object\" &&\n \"getTopicFilter\" in value &&\n typeof value.getTopicFilter === \"function\" &&\n value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof event === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics\n .map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n })\n .join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = addr ? addr : contract;\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment\n ? contract.interface.decodeEventLog(fragment, log.data, log.topics)\n : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n return count > 0;\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n target;\n interface;\n runner;\n filters;\n [internal];\n fallback;\n constructor(target, abi, runner, _deployTx) {\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof target === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, _prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = this.getEvent(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract event: ${prop}`);\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop)));\n },\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null,\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, _prop, receiver) => {\n if (_prop in target || passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = target.getFunction(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract method: ${prop}`);\n },\n has: (target, prop) => {\n if (prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(String(prop));\n },\n });\n }\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n async getAddress() {\n return await getInternal(this).addrPromise;\n }\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n async waitForDeployment() {\n // We have the deployement transaction; just use that (throws if deployement fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n getFunction(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n getEvent(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n async queryTransaction(hash) {\n // Is this useful?\n throw new Error(\"@TODO\");\n }\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = addr ? addr : await addrPromise;\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n return new EventLog(log, this.interface, foundFragment);\n }\n else {\n return new Log(log, provider);\n }\n });\n }\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners\n .map(({ listener }) => listener)\n .indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n 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 await this.off(event, listener);\n }\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map","import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\nimport { isBytes } from \"../utils/data.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\nexport class ContractFactory {\n interface;\n bytecode;\n runner;\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else if (typeof bytecode === \"string\") {\n bytecode = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecode = hexlify(bytecode);\n }\n else if (bytecode && typeof bytecode.object === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecode = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecode = \"!\";\n }\n defineProperties(this, {\n // @ts-ignore\n bytecode,\n interface: iface,\n runner: runner || null,\n });\n }\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([\n this.bytecode,\n this.interface.encodeDeploy(resolvedArgs),\n ]);\n return Object.assign({}, overrides, { data });\n }\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof this.runner.sendTransaction === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\",\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof output === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map","/**\n * @_ignore\n */\nimport { getAddress } from \"../address/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.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) {\n return (array) => {\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 number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n energyLimit: getBigInt,\n energyUsed: getBigInt,\n miner: allowNull(getAddress),\n extraData: formatData,\n baseFeePerEnergy: allowNull(getBigInt),\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 energyUsed: getBigInt,\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeEnergyUsed: getBigInt,\n effectiveEnergyPrice: allowNull(getBigInt),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0),\n}, {\n effectiveEnergyPrice: [\"energyPrice\"],\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 && !getAddress(value.to) && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n //confirmations: allowNull(getNumber, null),\n from: getAddress,\n maxFeePerEnergy: allowNull(getBigInt),\n energyLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n networkId: allowNull(getBigInt, null),\n }, {\n data: [\"input\"],\n energyLimit: [\"energy\"],\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 // Compute the signature\n if (value.signature) {\n result.signature = value.signature;\n }\n else {\n result.signature = value;\n }\n // Some backends omit networkId on legacy transactions, but we can compute it\n if (result.networkId == null) {\n const networkId = result.signature.legacynetworkId;\n if (networkId != null) {\n result.networkId = networkId;\n }\n }\n // @TODO: check networkId\n /*\n if (value.networkId != null) {\n let networkId = value.networkId;\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n result.networkId = networkId;\n\n } else {\n let networkId = value.networkId;\n\n // geth-etc returns networkId\n if (networkId == null && result.v == null) {\n networkId = value.networkId;\n }\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n if (typeof(networkId) !== \"number\" && result.v != null) {\n networkId = (result.v - 35) / 2;\n if (networkId < 0) { networkId = 0; }\n networkId = parseInt(networkId);\n }\n\n if (typeof(networkId) !== \"number\") { networkId = 0; }\n\n result.networkId = networkId;\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 { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nexport class NetworkPlugin {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\nexport class EnergyCostPlugin extends NetworkPlugin {\n effectiveBlock;\n txBase;\n txCreate;\n txDataZero;\n txDataNonzero;\n txAccessListStorageKey;\n txAccessListAddress;\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.corebc.network.plugins.EnergyCost#${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 clone() {\n return new EnergyCostPlugin(this.effectiveBlock, this);\n }\n}\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n constructor(feeDataFunc) {\n super(\"org.corebc.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\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 * About networks\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { getBigInt, assertArgument } from \"../utils/index.js\";\nimport { EnergyCostPlugin } from \"./plugins-network.js\";\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*/\n// Networks or clients with a higher need for security (such as clients\n// that may automatically make CCIP requests without user interaction)\n// can use this plugin to anonymize requests or intercept CCIP requests\n// to notify and/or receive authorization from the user\nconst Networks = new Map();\nexport class Network {\n #name;\n #networkId;\n #plugins;\n constructor(name, networkId) {\n this.#name = name;\n this.#networkId = getBigInt(networkId);\n this.#plugins = new Map();\n }\n toJSON() {\n return { name: this.name, networkId: String(this.networkId) };\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() {\n return this.#name;\n }\n set name(value) {\n this.#name = value;\n }\n /**\n * The network chain ID.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value, \"networkId\");\n }\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.networkId === 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.networkId === getBigInt(other);\n }\n catch (error) { }\n return false;\n }\n if (typeof other === \"object\") {\n if (other.networkId != null) {\n try {\n return this.networkId === getBigInt(other.networkId);\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.networkId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic energy required for a transaction.\n *\n * A EnergyCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicEnergy(tx) {\n const costs = this.getPlugin(\"org.corebc.plugins.network.EnergyCost\") || new EnergyCostPlugin();\n let energy = costs.txBase;\n if (tx.to == null) {\n energy += 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 energy += costs.txDataZero;\n }\n else {\n energy += costs.txDataNonzero;\n }\n }\n }\n return energy;\n }\n /**\n * Returns a new Network for the %%network%% name or networkId.\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.networkId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof network === \"object\") {\n assertArgument(typeof network.name === \"string\" &&\n typeof network.networkId === \"number\", \"invalid network object name or networkId\", \"network\", network);\n const custom = new Network(network.name, network.networkId);\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrnetworkId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrnetworkId, networkFunc) {\n if (typeof nameOrnetworkId === \"number\") {\n nameOrnetworkId = BigInt(nameOrnetworkId);\n }\n const existing = Networks.get(nameOrnetworkId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrnetworkId\", nameOrnetworkId);\n }\n Networks.set(nameOrnetworkId, networkFunc);\n }\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Core networks\n function registerEth(name, networkId, options) {\n const func = function () {\n const network = new Network(name, networkId);\n network.attachPlugin(new EnergyCostPlugin());\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(networkId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\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 registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map","import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * @TODO\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\",\n info: { event },\n });\n}\n// @TODO: refactor this\n/**\n * @TODO\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 constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n get pollingInterval() {\n return this.#interval;\n }\n set pollingInterval(value) {\n this.#interval = value;\n }\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\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) {\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n/**\n * @TODO\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\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 * @TODO\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 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 this.#blockNumber = blockNumber;\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\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 * About Subclassing the Provider...\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/checks.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 { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse, } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse, } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber, } from \"./subscriber-polling.js\";\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return value && typeof value.then === \"function\";\n}\nfunction getTag(prefix, value) {\n return (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 // 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}\nexport class UnmanagedSubscriber {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\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 \"pending\":\n case \"debug\":\n case \"error\":\n case \"network\": {\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 {\n type: \"orphan\",\n tag: getTag(\"orphan\", event),\n filter: copy(event),\n };\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));\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() {\n return new Date().getTime();\n}\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\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 // @TODO: This should be a () => Promise so network can be\n // done when needed; or rely entirely on _detectNetwork?\n constructor(_network) {\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(() => {\n this.emit(\"network\", network, null);\n }, 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.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get provider() {\n return this;\n }\n get plugins() {\n return Array.from(this.#plugins.values());\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 getPlugin(name) {\n return this.#plugins.get(name) || null;\n }\n get disableCcipRead() {\n return this.#disableCcipRead;\n }\n set disableCcipRead(value) {\n this.#disableCcipRead = !!value;\n }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\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 }, 250);\n }\n return await perform;\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\", {\n action: \"sendCcipReadFetchRequest\",\n request,\n index: i,\n urls,\n });\n let errorMessage = \"unknown error\";\n const resp = await request.send();\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchResult\",\n request,\n result,\n });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchError\",\n request,\n result,\n });\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\", {\n reason: \"404_MISSING_RESOURCE\",\n transaction: tx,\n info: { url, errorMessage },\n });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages\n .map((m) => JSON.stringify(m))\n .join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx,\n info: { urls, errorMessages },\n });\n }\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\",\n });\n }\n // Sub-classes should override this and handle PerformActionRequest requests, calling\n // the super for any unhandled actions.\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 _getAddress(address) {\n return resolveAddress(address);\n }\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"latest\":\n case \"pending\":\n case \"safe\":\n case \"finalized\":\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 _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:\n 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 _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]);\n if (isPromise(addr)) {\n promises.push((async function () {\n request[key] = await addr;\n })());\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 () {\n request.blockTag = await blockTag;\n })());\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 = this._detectNetwork().then((network) => {\n this.emit(\"network\", network, null);\n return network;\n }, (error) => {\n // Reset the networkPromise on failure, so we will try again\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\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, // Possibly an explicit Network\n this._detectNetwork(), // The actual connected network\n ]);\n if (expected.networkId !== actual.networkId) {\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.networkId} => ${actual.networkId} `, \"NETWORK_ERROR\", {\n event: \"changed\",\n });\n }\n }\n return expected.clone();\n }\n async getEnergyPrice() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async getFeeData() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async estimateEnergy(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateEnergy\",\n 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 return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead &&\n isCallException(error) &&\n error.data &&\n attempt >= 0 &&\n blockTag === \"latest\" &&\n transaction.to != null &&\n dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to);\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\",\n transaction,\n 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, // @TODO: populate data?\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\",\n transaction,\n info: { data: error.data, errorArgs: ccipArgs.errorArgs },\n });\n const tx = {\n to: txSender,\n data: concat([\n ccipArgs.selector,\n encodeBytes([ccipResult, ccipArgs.extraData]),\n ]),\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\", {\n action: \"receiveCcipReadCallResult\",\n transaction: Object.assign({}, tx),\n result,\n });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadCallError\",\n transaction: Object.assign({}, tx),\n error,\n });\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\",\n blockHash: block,\n 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\",\n blockTag,\n 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 effectiveEnergyPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.energyPrice == null && params.effectiveEnergyPrice == 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 effectiveEnergyPrice\");\n }\n params.effectiveEnergyPrice = tx.energyPrice;\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(networkId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\",\n });\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 _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 _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 _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n // Event API; sub-classes should override this; any supported\n // event filter will have been munged into an EventFilter\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 return new PollingBlockSubscriber(this);\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 _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\" &&\n emitArgs &&\n emitArgs.length > 0 &&\n 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 = {\n subscriber,\n tag,\n addressableMap,\n nameMap,\n started: false,\n listeners: [],\n };\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 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\n .map(({ listener }) => listener)\n .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 // Sub-classes should override this to shutdown any sockets, etc.\n // but MUST call this super.shutdown.\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 }\n get paused() {\n return this.#pausedState != null;\n }\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 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 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: \"\",\n urls: [],\n calldata: \"\",\n selector: \"\",\n extraData: \"\",\n 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\"\n .split(/,/)\n .map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map","/**\n * About Abstract Signer and subclassing\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/checks.js\";\nimport { getAddress } 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);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).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}\nexport class AbstractSigner {\n provider;\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.energyLimit == null) {\n pop.energyLimit = await this.estimateEnergy(pop);\n }\n // Populate the chain ID\n const network = await this.provider.getNetwork();\n if (pop.networkId != null) {\n const networkId = getBigInt(pop.networkId);\n assertArgument(networkId === network.networkId, \"transaction networkId mismatch\", \"tx.networkId\", tx.networkId);\n }\n else {\n pop.networkId = network.networkId;\n }\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n // We need to auto-detect the intended type of this transaction...\n if (feeData.energyPrice != null) {\n // Network doesn't support EIP-1559...\n // Populate missing fee data\n if (pop.energyPrice == null) {\n pop.energyPrice = feeData.energyPrice;\n }\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 //@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 estimateEnergy(tx) {\n return checkProvider(this, \"estimateEnergy\").estimateEnergy(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 return getAddress(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}\nexport class VoidSigner extends AbstractSigner {\n address;\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\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","/**\n * There are many awesome community services that provide Core\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in tht console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n}\n//# sourceMappingURL=community.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 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 _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\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\") ||\n error.operation !== \"xcb_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.networkId !== network.networkId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"xcb_getFilterChanges\", [\n filterId,\n ]);\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 this.#provider.send(\"xcb_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() {\n this.start();\n }\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 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(\"xcb_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(\"xcb_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 * About JSON-RPC...\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, 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\";\nimport { resolveAddress } from \"../address/checks.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) => {\n setTimeout(resolve, duration);\n });\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, // 10ms\n batchMaxSize: 1 << 20, // 1Mb\n batchMaxCount: 100, // 100 requests\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);\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 xcb_sendTransaction uses 90000 energy; 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.energyLimit == null) {\n promises.push((async () => {\n tx.energyLimit = await this.provider.estimateEnergy({\n ...tx,\n from: this.address,\n });\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);\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(\"xcb_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 const checkTx = async () => {\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 // Wait another 4 seconds\n this.provider._setTimeout(() => {\n checkTx();\n }, 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);\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(\"xcb_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),\n 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(\"xcb_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(),\n password,\n null,\n ]);\n }\n async _legacySignMessage(_message) {\n const message = typeof _message === \"string\" ? toUtf8Bytes(_message) : _message;\n return await this.provider.send(\"xcb_sign\", [\n this.address.toLowerCase(),\n 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 #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no hard in sending it immeidately\n const stallTime = this._getOption(\"batchMaxCount\") === 1\n ? 0\n : 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 // console.log({payload})\n const result = await this._send(payload);\n // console.log({result})\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\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 return reject(makeError(\"no response from server\", \"BAD_DATA\", {\n value: result,\n info: { payload },\n }));\n }\n // The response is an error\n if (\"error\" in resp) {\n return reject(this.getRpcError(payload, resp));\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);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n // Make sure any static network is compatbile with the provided netwrok\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (staticNetwork) {\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 {\n assert(false, \"sub-classes must override _send\", \"UNSUPPORTED_OPERATION\", {\n operation: \"jsonRpcApiProvider._send\"\n });\n }\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 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 return network;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n return Network.from(getBigInt(await this.send(\"xcb_networkId\", [])));\n }\n // We are not ready yet; use the primitive _send\n const payload = {\n id: this.#nextId++,\n method: \"xcb_networkId\",\n params: [],\n jsonrpc: \"2.0\",\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n }\n catch (error) {\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 /**\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) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n console.log(\"JsonRpcProvider failed to startup; retry in 1s\");\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() {\n return this.#notReady == null;\n }\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 [\n \"networkId\",\n \"energyLimit\",\n \"energyPrice\",\n \"type\",\n \"nonce\",\n \"value\",\n ].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"energyLimit\") {\n dstKey = \"energy\";\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 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 \"networkId\":\n return { method: \"xcb_networkId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"xcb_blockNumber\", args: [] };\n case \"getEnergyPrice\":\n return { method: \"xcb_energyPrice\", args: [] };\n case \"getBalance\": {\n return {\n method: \"xcb_getBalance\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n }\n case \"getTransactionCount\":\n return {\n method: \"xcb_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getCode\":\n return {\n method: \"xcb_getCode\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getStorage\":\n return {\n method: \"xcb_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: \"xcb_sendRawTransaction\",\n args: [req.signedTransaction],\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"xcb_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions],\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"xcb_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions],\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"xcb_getTransactionByHash\",\n args: [req.hash],\n };\n case \"getTransactionReceipt\":\n return {\n method: \"xcb_getTransactionReceipt\",\n args: [req.hash],\n };\n case \"call\":\n return {\n method: \"xcb_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag],\n };\n case \"estimateEnergy\": {\n return {\n method: \"xcb_estimateEnergy\",\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: \"xcb_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an CoreBC-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 === \"xcb_estimateEnergy\" && 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 }\n if (method === \"xcb_call\" || method === \"xcb_estimateEnergy\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException(method === \"xcb_call\" ? \"call\" : \"estimateEnergy\", payload.params[0], result ? result.data : null);\n e.info = { error, payload };\n return e;\n }\n // Only estimateEnergy 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\" &&\n error.message.match(/user denied|corebc-user-denied/i)) {\n const actionMap = {\n xcb_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n xcb_signTypedData_v4: \"signTypedData\",\n xcb_signTransaction: \"signTransaction\",\n xcb_sendTransaction: \"sendTransaction\",\n xcb_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 === \"xcb_sendRawTransaction\" ||\n method === \"xcb_sendTransaction\") {\n const transaction = payload.params[0];\n if (message.match(/insufficient funds|base fee exceeds energy limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction,\n 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\", {\n transaction,\n info: { error },\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) &&\n message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction,\n info: { error },\n });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method,\n info: { transaction, info: { error } },\n });\n }\n }\n if (message.match(/the method .* does not exist/i)) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method,\n info: { error },\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error });\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 networkId?? purge on switch_networks\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve,\n 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(\"xcb_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(\"xcb_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n}\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n this.#pollingInterval = 4000;\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() {\n return this.#pollingInterval;\n }\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. xcb_networkId) 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\" &&\n value.message.match(\"reverted\") &&\n 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 * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/xcb_goerli\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AnkrProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"xcb_sendRawTransaction\") {\n if (error &&\n error.error &&\n error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n}\n//# sourceMappingURL=provider-ankr.js.map","/**\n * About Alchemy\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.alchemyapi.io\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AlchemyProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash),\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = trace[0].error === \"Reverted\";\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null, // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", {\n value: trace,\n });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map","/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https://cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map","function getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map","/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\nexport class SocketSubscriber {\n #provider;\n #filter;\n get filter() {\n return JSON.parse(this.#filter);\n }\n #filterId;\n #paused;\n #emitPromise;\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider\n .send(\"xcb_subscribe\", this.filter)\n .then((filterId) => {\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n this.#filterId.then((filterId) => {\n this.#provider.send(\"xcb_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\nexport class SocketBlockSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\nexport class SocketPendingSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n get logFilter() {\n return JSON.parse(this.#logFilter);\n }\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * SocketProvider...\n *\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n constructor(network) {\n super(network, { batchMaxCount: 1 });\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n\n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n\n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n // Sub-classes must call this for each message\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (\"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result,\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result.method === \"xcb_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n }\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map","import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network) {\n super(network);\n if (typeof url === \"string\") {\n this.#connect = () => {\n return new _WebSocket(url);\n };\n this.#websocket = this.#connect();\n }\n else if (typeof url === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n*/\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map","/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret,\n });\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(networkId) {\n try {\n return new InfuraProvider(networkId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map","/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"corebc.quiknode.pro\";\n case \"arbitrum\":\n return \"corebc.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"corebc.arbitrum-goerli.quiknode.pro\";\n case \"matic\":\n return \"corebc.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"corebc.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"corebc.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"corebc.optimism-goerli.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(networkId) {\n try {\n return new QuickNodeProvider(networkId, this.token);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.token === defaultToken;\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map","/**\n * Explain all the nitty-gritty about the **FallbackProvider**.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { getBigInt, getNumber, assert, assertArgument, } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\nfunction getTime() {\n return new Date().getTime();\n}\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof value === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2,\n requests: 0,\n lateResponses: 0,\n errorResponses: 0,\n outOfSync: -1,\n unsupportedEvents: 0,\n rollingDuration: 0,\n score: 0,\n _network: null,\n _updateNumber: null,\n _totalTime: 0,\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + value.map(_normalize).join(\",\") + \"]\";\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{\" +\n keys\n .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`)\n .join(\",\") +\n \"}\");\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(value) {\n if (\"error\" in value) {\n const error = value.error;\n return { tag: _normalize(error), value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum &&\n (weight > bestWeight ||\n (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A Fallback Provider.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n quorum;\n eventQuorum;\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n constructor(providers, network) {\n super(network);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n this.quorum = 2; //Math.ceil(providers.length / 2);\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), \"quorum exceed provider wieght\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"networkId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"networkId\":\n return (await provider.getNetwork()).networkId;\n case \"estimateEnergy\":\n return await provider.estimateEnergy(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = \"blockHash\" in req ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getEnergyPrice\":\n return (await provider.getFeeData()).energyPrice;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => b.priority - a.priority);\n for (const config of allConfigs) {\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config,\n result: null,\n didBump: false,\n perform: null,\n staller: null,\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = getTime() - now;\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push(waitForSync(config, 0));\n promises.push((async () => {\n config._network = await config.provider.getNetwork();\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let networkId = null;\n for (const config of this.#configs) {\n const network = config._network;\n if (networkId == null) {\n networkId = network.networkId;\n }\n else if (network.networkId !== networkId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\",\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight,\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getEnergyPrice\":\n case \"estimateEnergy\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"networkId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`,\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: {\n request: req,\n results: Array.from(running).map((r) => stringify(r.result)),\n },\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => {\n try {\n const result = await provider._perform(req);\n return Object.assign(normalizeResult({ result }), { weight });\n }\n catch (error) {\n return Object.assign(normalizeResult({ error }), { weight });\n }\n }));\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) },\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n for (let i = 0; i < this.quorum; i++) {\n this.#addRunner(running, req);\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map","import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value &&\n typeof value.send === \"function\" &&\n typeof value.close === \"function\");\n}\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n if (typeof network === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if ((typeof network === \"string\" && network.match(/^wss?:/)) ||\n isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n const providers = [];\n if (options.alchemy !== \"-\") {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.ankr !== \"-\" && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.cloudflare !== \"-\") {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.infura !== \"-\") {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof projectId === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) {\n console.log(error);\n }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n*/\n if (options.quicknode !== \"-\") {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) {\n console.log(error);\n }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\",\n });\n if (providers.length === 1) {\n return providers[0];\n }\n return new FallbackProvider(providers);\n}\n//# sourceMappingURL=default-provider.js.map","import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nexport class NonceManager extends AbstractSigner {\n signer;\n #noncePromise;\n #delta;\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n increment() {\n this.#delta++;\n }\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n constructor(core, network) {\n super(network, { batchMaxCount: 1 });\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await core.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [\n {\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message },\n },\n ];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `corebc-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `corebc-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"xcb_accounts\", []);\n if (typeof address === \"number\") {\n return accounts.length > address;\n }\n address = address.toLowerCase();\n return (accounts.filter((a) => a.toLowerCase() === address).length !== 0);\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n //const resp =\n await this.#request(\"xcb_requestAccounts\", []);\n //console.log(\"RESP\", resp);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n}\n//# sourceMappingURL=provider-browser.js.map","/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, {\n applicationId,\n applicationSecret,\n });\n }\n _getProvider(networkId) {\n try {\n return new PocketProvider(networkId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return this.applicationId === defaultApplicationId;\n }\n}\n//# sourceMappingURL=provider-pocket.js.map","const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map","import { getAddress } from \"../address/index.js\";\nimport { hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, resolveProperties, assert, assertArgument, } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n prefix;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor({ signingKey, prefix, provider, }) {\n super(provider);\n this.prefix = prefix;\n assertArgument(signingKey && typeof signingKey.sign === \"function\", \"invalid signingKey key\", \"signingKey\", \"[ REDACTED ]\");\n this.#signingKey = signingKey;\n const address = computeAddress(this.#signingKey, prefix);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() {\n return this.#signingKey;\n }\n /**\n * The private key for this wallet.\n */\n get privateKey() {\n return this.signingKey.privateKey;\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new BaseWallet({\n signingKey: this.#signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n async signTransaction(tx) {\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: tx.to || undefined,\n from: tx.from || undefined,\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress(tx.from) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n const unSignedSerialized = btx.unsignedSerialized;\n const unsignedHash = sha256(unSignedSerialized);\n // sha256(btx.unsignedSerialized)\n btx.signature = this.signingKey.sign(unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name },\n });\n const address = getAddress(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name,\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value));\n }\n}\n//# sourceMappingURL=base-wallet.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT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2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"en\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map","/*! https://mths.be/utf8js v3.0.0 by @mathias */\n;(function(root) {\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tthrow Error(\n\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t' is not a scalar value'\n\t\t\t);\n\t\t}\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tcheckScalarValue(codePoint);\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string) {\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol() {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\tcheckScalarValue(codePoint);\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString) {\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol()) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\troot.version = '3.0.0';\n\troot.encode = utf8encode;\n\troot.decode = utf8decode;\n\n}(typeof exports === 'undefined' ? this.utf8 = {} : exports));\n","import { Buffer } from \"buffer\";\nimport { pbkdf2Sync } from \"../crypto/crypto.js\";\nimport utf8 from \"utf8\";\nexport function mnemonicToSeed(mnemonic, password) {\n if (!password) {\n password = \"\";\n }\n const t = generateSeed(mnemonic, password);\n return t.goldilock;\n}\nconst generateSeed = (mnemonic, password) => {\n const goldilockSaltPrefix = \"mnemonic\";\n const aesSaltPrefix = \"mnemonicfortheAESkey\";\n const goldilockSalt = utf8.encode(goldilockSaltPrefix + password);\n const aesSalt = utf8.encode(aesSaltPrefix + password);\n const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(goldilockSalt), 2048, 64, \"sha512\");\n const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(aesSalt), 2048, 64, \"sha512\");\n return {\n aes: Buffer.from(aesKeySeed).toString(\"hex\"),\n goldilock: Buffer.from(goldilockKey).toString(\"hex\"),\n };\n};\n//# sourceMappingURL=mnemonicToSeed.js.map","import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { legacySha256 } from \"../crypto/sha3.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return (((1 << bits) - 1) << (8 - bits)) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset++;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) &\n getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n return mnemonicToSeed(this.phrase, this.password);\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase({ phrase, password, wordlist, }) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingURL=mnemonic.js.map","/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */\n(function(root) {\n \"use strict\";\n\n function checkInt(value) {\n return (parseInt(value) === value);\n }\n\n function checkInts(arrayish) {\n if (!checkInt(arrayish.length)) { return false; }\n\n for (var i = 0; i < arrayish.length; i++) {\n if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {\n return false;\n }\n }\n\n return true;\n }\n\n function coerceArray(arg, copy) {\n\n // ArrayBuffer view\n if (arg.buffer && arg.name === 'Uint8Array') {\n\n if (copy) {\n if (arg.slice) {\n arg = arg.slice();\n } else {\n arg = Array.prototype.slice.call(arg);\n }\n }\n\n return arg;\n }\n\n // It's an array; check it is a valid representation of a byte\n if (Array.isArray(arg)) {\n if (!checkInts(arg)) {\n throw new Error('Array contains invalid value: ' + arg);\n }\n\n return new Uint8Array(arg);\n }\n\n // Something else, but behaves like an array (maybe a Buffer? Arguments?)\n if (checkInt(arg.length) && checkInts(arg)) {\n return new Uint8Array(arg);\n }\n\n throw new Error('unsupported array-like object');\n }\n\n function createArray(length) {\n return new Uint8Array(length);\n }\n\n function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {\n if (sourceStart != null || sourceEnd != null) {\n if (sourceArray.slice) {\n sourceArray = sourceArray.slice(sourceStart, sourceEnd);\n } else {\n sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);\n }\n }\n targetArray.set(sourceArray, targetStart);\n }\n\n\n\n var convertUtf8 = (function() {\n function toBytes(text) {\n var result = [], i = 0;\n text = encodeURI(text);\n while (i < text.length) {\n var c = text.charCodeAt(i++);\n\n // if it is a % sign, encode the following 2 bytes as a hex value\n if (c === 37) {\n result.push(parseInt(text.substr(i, 2), 16))\n i += 2;\n\n // otherwise, just the actual byte\n } else {\n result.push(c)\n }\n }\n\n return coerceArray(result);\n }\n\n function fromBytes(bytes) {\n var result = [], i = 0;\n\n while (i < bytes.length) {\n var c = bytes[i];\n\n if (c < 128) {\n result.push(String.fromCharCode(c));\n i++;\n } else if (c > 191 && c < 224) {\n result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f)));\n i += 2;\n } else {\n result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f)));\n i += 3;\n }\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n var convertHex = (function() {\n function toBytes(text) {\n var result = [];\n for (var i = 0; i < text.length; i += 2) {\n result.push(parseInt(text.substr(i, 2), 16));\n }\n\n return result;\n }\n\n // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html\n var Hex = '0123456789abcdef';\n\n function fromBytes(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i++) {\n var v = bytes[i];\n result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]);\n }\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n\n // Number of rounds by keysize\n var numberOfRounds = {16: 10, 24: 12, 32: 14}\n\n // Round constant words\n var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n\n // S-box and Inverse S-box (S is for Substitution)\n var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88,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x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n\n // Transformations for encryption\n var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\n var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\n var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\n var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n\n // Transformations for decryption\n var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\n var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\n var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\n var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n\n // Transformations for decryption key expansion\n var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\n var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\n var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\n var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\n\n function convertToInt32(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i += 4) {\n result.push(\n (bytes[i ] << 24) |\n (bytes[i + 1] << 16) |\n (bytes[i + 2] << 8) |\n bytes[i + 3]\n );\n }\n return result;\n }\n\n var AES = function(key) {\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n Object.defineProperty(this, 'key', {\n value: coerceArray(key, true)\n });\n\n this._prepare();\n }\n\n\n AES.prototype._prepare = function() {\n\n var rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new Error('invalid key size (must be 16, 24 or 32 bytes)');\n }\n\n // encryption round keys\n this._Ke = [];\n\n // decryption round keys\n this._Kd = [];\n\n for (var i = 0; i <= rounds; i++) {\n this._Ke.push([0, 0, 0, 0]);\n this._Kd.push([0, 0, 0, 0]);\n }\n\n var roundKeyCount = (rounds + 1) * 4;\n var KC = this.key.length / 4;\n\n // convert the key into ints\n var tk = convertToInt32(this.key);\n\n // copy values into round key arrays\n var index;\n for (var i = 0; i < KC; i++) {\n index = i >> 2;\n this._Ke[index][i % 4] = tk[i];\n this._Kd[rounds - index][i % 4] = tk[i];\n }\n\n // key expansion (fips-197 section 5.2)\n var rconpointer = 0;\n var t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[ tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (var i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n } else {\n for (var i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n\n tk[KC / 2] ^= (S[ tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n\n for (var i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n\n // copy values into round key arrays\n var i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n this._Ke[r][c] = tk[i];\n this._Kd[rounds - r][c] = tk[i++];\n t++;\n }\n }\n\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (var r = 1; r < rounds; r++) {\n for (var c = 0; c < 4; c++) {\n tt = this._Kd[r][c];\n this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[ tt & 0xFF]);\n }\n }\n }\n\n AES.prototype.encrypt = function(plaintext) {\n if (plaintext.length != 16) {\n throw new Error('invalid plaintext size (must be 16 bytes)');\n }\n\n var rounds = this._Ke.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(plaintext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Ke[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T1[(t[ i ] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[ t[(i + 3) % 4] & 0xff] ^\n this._Ke[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Ke[rounds][i];\n result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n AES.prototype.decrypt = function(ciphertext) {\n if (ciphertext.length != 16) {\n throw new Error('invalid ciphertext size (must be 16 bytes)');\n }\n\n var rounds = this._Kd.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(ciphertext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Kd[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T5[(t[ i ] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[ t[(i + 1) % 4] & 0xff] ^\n this._Kd[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Kd[rounds][i];\n result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n\n /**\n * Mode Of Operation - Electonic Codebook (ECB)\n */\n var ModeOfOperationECB = function(key) {\n if (!(this instanceof ModeOfOperationECB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Electronic Code Block\";\n this.name = \"ecb\";\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationECB.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n block = this._aes.encrypt(block);\n copyArray(block, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationECB.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n copyArray(block, plaintext, i);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Block Chaining (CBC)\n */\n var ModeOfOperationCBC = function(key, iv) {\n if (!(this instanceof ModeOfOperationCBC)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Block Chaining\";\n this.name = \"cbc\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastCipherblock = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCBC.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n\n for (var j = 0; j < 16; j++) {\n block[j] ^= this._lastCipherblock[j];\n }\n\n this._lastCipherblock = this._aes.encrypt(block);\n copyArray(this._lastCipherblock, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n\n for (var j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ this._lastCipherblock[j];\n }\n\n copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Feedback (CFB)\n */\n var ModeOfOperationCFB = function(key, iv, segmentSize) {\n if (!(this instanceof ModeOfOperationCFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Feedback\";\n this.name = \"cfb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 size)');\n }\n\n if (!segmentSize) { segmentSize = 1; }\n\n this.segmentSize = segmentSize;\n\n this._shiftRegister = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCFB.prototype.encrypt = function(plaintext) {\n if ((plaintext.length % this.segmentSize) != 0) {\n throw new Error('invalid plaintext size (must be segmentSize bytes)');\n }\n\n var encrypted = coerceArray(plaintext, true);\n\n var xorSegment;\n for (var i = 0; i < encrypted.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n for (var j = 0; j < this.segmentSize; j++) {\n encrypted[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return encrypted;\n }\n\n ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {\n if ((ciphertext.length % this.segmentSize) != 0) {\n throw new Error('invalid ciphertext size (must be segmentSize bytes)');\n }\n\n var plaintext = coerceArray(ciphertext, true);\n\n var xorSegment;\n for (var i = 0; i < plaintext.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n plaintext[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return plaintext;\n }\n\n /**\n * Mode Of Operation - Output Feedback (OFB)\n */\n var ModeOfOperationOFB = function(key, iv) {\n if (!(this instanceof ModeOfOperationOFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Output Feedback\";\n this.name = \"ofb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastPrecipher = coerceArray(iv, true);\n this._lastPrecipherIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationOFB.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._lastPrecipherIndex === 16) {\n this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);\n this._lastPrecipherIndex = 0;\n }\n encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;\n\n\n /**\n * Counter object for CTR common mode of operation\n */\n var Counter = function(initialValue) {\n if (!(this instanceof Counter)) {\n throw Error('Counter must be instanitated with `new`');\n }\n\n // We allow 0, but anything false-ish uses the default 1\n if (initialValue !== 0 && !initialValue) { initialValue = 1; }\n\n if (typeof(initialValue) === 'number') {\n this._counter = createArray(16);\n this.setValue(initialValue);\n\n } else {\n this.setBytes(initialValue);\n }\n }\n\n Counter.prototype.setValue = function(value) {\n if (typeof(value) !== 'number' || parseInt(value) != value) {\n throw new Error('invalid counter value (must be an integer)');\n }\n\n // We cannot safely handle numbers beyond the safe range for integers\n if (value > Number.MAX_SAFE_INTEGER) {\n throw new Error('integer value out of safe range');\n }\n\n for (var index = 15; index >= 0; --index) {\n this._counter[index] = value % 256;\n value = parseInt(value / 256);\n }\n }\n\n Counter.prototype.setBytes = function(bytes) {\n bytes = coerceArray(bytes, true);\n\n if (bytes.length != 16) {\n throw new Error('invalid counter bytes size (must be 16 bytes)');\n }\n\n this._counter = bytes;\n };\n\n Counter.prototype.increment = function() {\n for (var i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n\n\n /**\n * Mode Of Operation - Counter (CTR)\n */\n var ModeOfOperationCTR = function(key, counter) {\n if (!(this instanceof ModeOfOperationCTR)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Counter\";\n this.name = \"ctr\";\n\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter)\n }\n\n this._counter = counter;\n\n this._remainingCounter = null;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCTR.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = this._aes.encrypt(this._counter._counter);\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;\n\n\n ///////////////////////\n // Padding\n\n // See:https://tools.ietf.org/html/rfc2315\n function pkcs7pad(data) {\n data = coerceArray(data, true);\n var padder = 16 - (data.length % 16);\n var result = createArray(data.length + padder);\n copyArray(data, result);\n for (var i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n }\n\n function pkcs7strip(data) {\n data = coerceArray(data, true);\n if (data.length < 16) { throw new Error('PKCS#7 invalid length'); }\n\n var padder = data[data.length - 1];\n if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); }\n\n var length = data.length - padder;\n for (var i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new Error('PKCS#7 invalid padding byte');\n }\n }\n\n var result = createArray(length);\n copyArray(data, result, 0, 0, length);\n return result;\n }\n\n ///////////////////////\n // Exporting\n\n\n // The block cipher\n var aesjs = {\n AES: AES,\n Counter: Counter,\n\n ModeOfOperation: {\n ecb: ModeOfOperationECB,\n cbc: ModeOfOperationCBC,\n cfb: ModeOfOperationCFB,\n ofb: ModeOfOperationOFB,\n ctr: ModeOfOperationCTR\n },\n\n utils: {\n hex: convertHex,\n utf8: convertUtf8\n },\n\n padding: {\n pkcs7: {\n pad: pkcs7pad,\n strip: pkcs7strip\n }\n },\n\n _arrayTest: {\n coerceArray: coerceArray,\n createArray: createArray,\n copyArray: copyArray,\n }\n };\n\n\n // node.js\n if (typeof exports !== 'undefined') {\n module.exports = aesjs\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define([], function() { return aesjs; });\n\n // Web Browsers\n } else {\n\n // If there was an existing library at \"aesjs\" make sure it's still available\n if (root.aesjs) {\n aesjs._aesjs = root.aesjs;\n }\n\n root.aesjs = aesjs;\n }\n\n\n})(this);\n","/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof hexString === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = \"0\" + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof password === \"string\") {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = match[4] === \"!\";\n let cur = object;\n for (const comp of path.toLowerCase().split(\".\")) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof cur === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof cur === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof cur) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map","/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Core along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { Counter, ModeOfOperation: { ctr: CTR }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from \"../crypto/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nimport { computeAddress, extractPrefix } from \"../transaction/address.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = data.version != null ? parseInt(data.version) : 0;\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, new Counter(iv));\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\",\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n const expectedMAC = spelunk(data, \"crypto.mac:string!\");\n let difference = 0;\n const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC);\n if (validMAC) {\n const actual = getBytes(\"0x\" + computedMAC);\n const expected = getBytes(\"0x\" + expectedMAC);\n for (let i = 0; i < actual.length; i++)\n difference |= actual[i] ^ expected[i];\n }\n assertArgument(validMAC && difference === 0, \"incorrect password\", \"password\", \"[REDACTED]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = getAddress(data.address);\n const prefix = extractPrefix(address);\n if (computeAddress(privateKey, prefix) !== address) {\n throw new Error(\"address mismatch\");\n }\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-corebc.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-corebc.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-corebc.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n account.mnemonic = {\n path: spelunk(data, \"x-corebc.path:string\") || defaultPath,\n locale: spelunk(data, \"x-corebc.locale:string\") || \"en\",\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))),\n };\n }\n return account;\n}\n// Match Core Web3Dart's wallet KDF resource limits.\nfunction validateScrypt(N, r, p) {\n assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, \"unsafe scrypt N\", \"kdf.N\", N);\n assertArgument(Number.isSafeInteger(r) &&\n Number.isSafeInteger(p) &&\n r > 0 &&\n p > 0 &&\n r * p <= 1048576 &&\n 128 * N * r <= 256 * 1024 * 1024, \"unsafe scrypt work or memory requirement\", \"kdf\", { N, r, p });\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof kdf === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n validateScrypt(N, r, p);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(prf === \"hmac-sha256\" || prf === \"hmac-sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, \"unsafe PBKDF2 iteration count\", \"kdf.c\", count);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return {\n name: \"pbkdf2\",\n salt,\n count,\n dkLen,\n algorithm: algorithm,\n };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = options.salt != null\n ? getBytes(options.salt, \"options.salt\")\n : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = 1 << 17, r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N != null) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r != null) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p != null) {\n p = options.scrypt.p;\n }\n }\n validateScrypt(N, r, p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = options.iv != null ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = options.uuid != null\n ? getBytes(options.uuid, \"options.uuid\")\n : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, new Counter(iv));\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = sha256(concat([macPrefix, ciphertext]));\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r,\n },\n mac: mac.substring(2),\n },\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = options.client != null ? options.client : `corebc/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = now.getUTCFullYear() +\n \"-\" +\n zpad(now.getUTCMonth() + 1, 2) +\n \"-\" +\n zpad(now.getUTCDate(), 2) +\n \"T\" +\n zpad(now.getUTCHours(), 2) +\n \"-\" +\n zpad(now.getUTCMinutes(), 2) +\n \"-\" +\n zpad(now.getUTCSeconds(), 2) +\n \".0Z\";\n const gethFilename = \"UTC--\" + timestamp + \"--\" + data.address;\n data[\"x-corebc\"] = {\n client,\n gethFilename,\n path,\n locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\",\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map","/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { dataSlice, defineProperties, getNumber, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\nimport { Ed448Goldilock } from \"../crypto/crypto.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// import { arrayify,\n// // hexDataSlice\n// } from \"../utils/data.js\";\n// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array {\n// const p = getBytes(password);\n// const s = getBytes(salt);\n// return getBytes(pbkdf2(p, s, 2048, 57, \"sha512\"));\n// }\n/**\n * The default derivation path for Core HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m\";\n// \"Bitcoin seed\"\n// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\n// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array {\n// b = getBytes(concat([b.slice(0, 53), \"0x00000000\"]));\n// b[0] &= 0xfc;\n// const c = new Uint8Array(57);\n// let hold = 0;\n// for (let i = 0; i < 57; i++) {\n// hold += a[i] + b[i];\n// c[i] = hold % 256;\n// hold = Math.floor(hold / 256);\n// }\n// return c;\n// };\nconst _guard = {};\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0 && (components[0] === \"m\" || node.depth > 0), \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n prefix;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n #seed;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) {\n super({\n signingKey,\n prefix,\n provider,\n });\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.publicKey });\n this.prefix = prefix;\n this.#seed = seed;\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint,\n fingerprint,\n path,\n index,\n depth,\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet({\n guard: _guard,\n signingKey: this.signingKey,\n parentFingerprint: this.parentFingerprint,\n path: this.path,\n index: this.index,\n depth: this.depth,\n seed: this.#seed,\n mnemonic: this.mnemonic,\n provider,\n prefix: this.prefix,\n });\n }\n #account() {\n const account = {\n address: this.address,\n privateKey: this.privateKey,\n };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy,\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, {\n progressCallback,\n });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() {\n return this.path != null;\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index));\n const newSigningKey = new SigningKey(newPrivateKey);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (_index & ~HardenedBit);\n if (_index & HardenedBit) {\n path += \"'\";\n }\n }\n return new HDNodeWallet({\n guard: _guard,\n signingKey: newSigningKey,\n parentFingerprint: this.fingerprint,\n path,\n index: _index,\n seed: this.#seed,\n depth: this.depth + 1,\n mnemonic: this.mnemonic,\n provider: this.provider,\n prefix: this.prefix,\n });\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed({ _seed, mnemonic, prefix, path, }) {\n const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0);\n const signingKey = new SigningKey(extendetPrivateKey);\n // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length })\n return new HDNodeWallet({\n seed: _seed,\n guard: _guard,\n signingKey,\n parentFingerprint: \"0x00000000\",\n path: path || defaultPath,\n index: 0,\n depth: 0,\n mnemonic,\n provider: null,\n prefix,\n });\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(prefix, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist);\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Create am HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, prefix, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n static mnemonicToSeed(mnemonic, password) {\n const seed = mnemonicToSeed(mnemonic, password);\n return seed;\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, password, path, wordlist, }) {\n if (!password) {\n password = \"\";\n }\n if (!path) {\n path = defaultPath;\n }\n if (!wordlist) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist });\n const _seed = mnemonic.computeSeed();\n return HDNodeWallet.#fromSeed({\n _seed,\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed({ seed, prefix, path, }) {\n return HDNodeWallet.#fromSeed({\n _seed: seed,\n mnemonic: null,\n path: path || defaultPath,\n prefix,\n });\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the acount at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map","/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n/**\n * Before Core launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive xcb\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Core Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && encseed.length % 16 === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map","import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { defaultPath, HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson, } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { extractPrefix } from \"../transaction/address.js\";\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected\n * to %%provider%%.\n */\n constructor({ key, prefix, provider, }) {\n if (typeof key === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = typeof key === \"string\" ? new SigningKey(key) : key;\n super({\n signingKey,\n prefix,\n provider,\n });\n }\n connect(provider) {\n return new Wallet({\n key: this.signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n const address = account.address;\n const prefix = extractPrefix(address);\n if (\"mnemonic\" in account &&\n account.mnemonic &&\n account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path);\n if (wallet.address === account.address &&\n wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet({\n key: account.privateKey,\n prefix,\n });\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the avavilable\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(prefix, provider) {\n const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, provider, password, }) {\n const wallet = HDNodeWallet.fromPhrase({\n phrase,\n prefix,\n password,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n static fromSeed({ seed, prefix, provider, path, }) {\n const wallet = HDNodeWallet.fromSeed({\n seed,\n prefix,\n path: path || defaultPath,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map","import { Contract } from \"../contract/index.js\";\nexport const customUnitAbi = Object.freeze([\n \"function supportsUnit(string unit) view returns (bool)\",\n \"function supportedUnits() view returns (string[])\",\n \"function preferredUnit() view returns (string)\",\n \"function balanceOf(address account) view returns (uint256)\",\n \"function balanceOfUnit(address account, string unit) view returns (uint256)\",\n]);\nexport class CustomUnitDiscovery {\n preferredUnit;\n supportedUnits;\n constructor(units, preferredUnit) {\n this.preferredUnit = preferredUnit;\n this.supportedUnits = Object.freeze([...units]);\n }\n get isValid() {\n return (this.supports(\"units\") &&\n this.preferredUnit !== \"\" &&\n this.supports(this.preferredUnit));\n }\n supports(unit) {\n return this.supportedUnits.includes(unit);\n }\n}\n/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */\nexport class CustomUnitBalance {\n canonicalAmount;\n unitAmount;\n unit;\n constructor(canonicalAmount, unitAmount, unit) {\n this.canonicalAmount = canonicalAmount;\n this.unitAmount = unitAmount;\n this.unit = unit;\n }\n get multiplierNumerator() {\n return this.unitAmount;\n }\n get multiplierDenominator() {\n return this.canonicalAmount;\n }\n}\n/** Core custom-unit contract convention used by Tone and Core API. */\nexport class CustomUnitToken {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, customUnitAbi, runner);\n }\n async supportsUnit(unit, blockTag) {\n return (unit.trim() !== \"\" &&\n (await this.contract.supportsUnit(unit.trim(), { blockTag })));\n }\n async supportedUnits(blockTag) {\n return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag })));\n }\n async preferredUnit(blockTag) {\n return (await this.contract.preferredUnit({ blockTag })).trim();\n }\n async discover(blockTag) {\n if (!(await this.supportsUnit(\"units\", blockTag)))\n return null;\n const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag));\n return discovery.isValid ? discovery : null;\n }\n canonicalBalance(account, blockTag) {\n return this.contract.balanceOf(account, { blockTag });\n }\n balanceOfUnit(account, unit, blockTag) {\n if (!unit.trim())\n throw new TypeError(\"unit must not be empty\");\n return this.contract.balanceOfUnit(account, unit.trim(), { blockTag });\n }\n async balance(account, unit, blockTag) {\n const resolved = unit?.trim() || (await this.preferredUnit(blockTag));\n const [canonical, calculated] = await Promise.all([\n this.canonicalBalance(account, blockTag),\n this.balanceOfUnit(account, resolved, blockTag),\n ]);\n return new CustomUnitBalance(canonical, calculated, resolved);\n }\n}\n//# sourceMappingURL=custom-units.js.map","import { Contract } from \"../contract/index.js\";\n/** On-chain interface defined by CIP-150. */\nexport const cip150Abi = Object.freeze([\n \"function getMetadataValue(string key) view returns (string value)\",\n \"function hasMetadataKey(string key) view returns (bool exists)\",\n \"function isMetadataSealed(string key) view returns (bool sealed)\",\n \"function listMetadataKeys() view returns (string[] keys)\",\n \"function getMetadataByIndex(uint256 index) view returns (string key, string value)\",\n \"function metadataCount() view returns (uint256 total)\",\n \"function setMetadataValue(string key, string value)\",\n \"function sealMetadataKey(string key)\",\n]);\nexport const cip151TokenExpirationKey = \"tokenExpiration\";\nexport const cip151TradingStopKey = \"tradingStop\";\nexport const cip152LabKey = \"lab\";\n/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */\nexport class Cip151Lifecycle {\n tokenExpiration;\n tradingStop;\n constructor(metadata = {}) {\n const parse = (key) => {\n const value = metadata[key];\n if (value == null || value === \"\")\n return null;\n if (!/^\\d+$/.test(value))\n throw new TypeError(`${key} must be a non-negative Unix timestamp`);\n return BigInt(value);\n };\n this.tokenExpiration = parse(cip151TokenExpirationKey);\n this.tradingStop = parse(cip151TradingStopKey);\n }\n isExpiredAt(seconds) {\n return this.tokenExpiration !== null && seconds >= this.tokenExpiration;\n }\n isTradingStoppedAt(seconds) {\n return this.tradingStop !== null && seconds >= this.tradingStop;\n }\n}\n/** Validates certificate structure, not the authenticity of its issuer. */\nexport class Cip152LabCertificate {\n measurements;\n constructor(json) {\n if (json === null || typeof json !== \"object\" || Array.isArray(json))\n throw new TypeError(\"CIP-152 lab.json must be an object\");\n const measurements = Object.create(null);\n for (const [key, property] of Object.entries(json)) {\n if (!property ||\n typeof property !== \"object\" ||\n Array.isArray(property) ||\n !Object.hasOwn(property, \"value\"))\n throw new TypeError(`CIP-152 property ${key} must contain a value`);\n const { value, unit } = property;\n if (!(typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value))))\n throw new TypeError(`CIP-152 property ${key} has an invalid value`);\n if (unit != null && typeof unit !== \"string\")\n throw new TypeError(`CIP-152 property ${key} has an invalid unit`);\n measurements[key] = Object.freeze(unit == null ? { value } : { value, unit });\n }\n this.measurements = Object.freeze(measurements);\n }\n}\n/** Typed metadata reader and writer. Writes require a signer as runner. */\nexport class Cip150MetadataContract {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, cip150Abi, runner);\n }\n getValue(key, blockTag) {\n return this.contract.getMetadataValue(key, { blockTag });\n }\n hasKey(key, blockTag) {\n return this.contract.hasMetadataKey(key, { blockTag });\n }\n isSealed(key, blockTag) {\n return this.contract.isMetadataSealed(key, { blockTag });\n }\n async listKeys(blockTag) {\n return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag })));\n }\n async getByIndex(index, blockTag) {\n const [key, value] = await this.contract.getMetadataByIndex(index, {\n blockTag,\n });\n return Object.freeze({ key, value });\n }\n count(blockTag) {\n return this.contract.metadataCount({ blockTag });\n }\n async readAll(blockTag, includeSealedState = true) {\n const entries = [];\n for (const key of await this.listKeys(blockTag)) {\n const value = await this.getValue(key, blockTag);\n entries.push(Object.freeze(includeSealedState\n ? { key, value, sealed: await this.isSealed(key, blockTag) }\n : { key, value }));\n }\n return Object.freeze(entries);\n }\n setValue(key, value, overrides = {}) {\n return this.contract.setMetadataValue(key, value, overrides);\n }\n sealKey(key, overrides = {}) {\n return this.contract.sealMetadataKey(key, overrides);\n }\n async readLifecycle(blockTag) {\n const metadata = {};\n for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) {\n if (await this.hasKey(key, blockTag))\n metadata[key] = await this.getValue(key, blockTag);\n }\n return new Cip151Lifecycle(metadata);\n }\n async readLabCertificate(gateway, blockTag) {\n if (!(await this.hasKey(cip152LabKey, blockTag)))\n return null;\n const reference = await this.getValue(cip152LabKey, blockTag);\n if (!gateway.resolve(reference).pathname.endsWith(\"/lab.json\"))\n throw new TypeError(\"CIP-152 reference must point to lab.json\");\n return new Cip152LabCertificate(await gateway.readJson(reference));\n }\n}\nexport { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from \"./custom-units.js\";\n//# sourceMappingURL=index.js.map","export const defaultIpfsGatewayTemplate = \"https://ipf.sk/{cid}\";\n/** Configurable IPFS resolution and bounded JSON loading. */\nexport class IpfsGateway {\n template;\n maxResponseBytes;\n timeoutMs;\n #fetch;\n constructor(options = {}) {\n this.template = options.template ?? defaultIpfsGatewayTemplate;\n this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024;\n this.timeoutMs = options.timeoutMs ?? 30_000;\n this.#fetch = options.fetch ?? globalThis.fetch;\n const templateUrl = new URL(this.template.replace(\"{cid}\", \"cid\"));\n if (!/^https?:$/.test(templateUrl.protocol) ||\n this.template.split(\"{cid}\").length !== 2)\n throw new TypeError(\"gateway template must be HTTP(S) and contain one {cid}\");\n for (const value of [this.maxResponseBytes, this.timeoutMs])\n if (!Number.isSafeInteger(value) || value <= 0)\n throw new TypeError(\"gateway limits must be positive safe integers\");\n }\n resolve(reference) {\n const value = reference.trim();\n if (/^https?:\\/\\//i.test(value))\n return new URL(value);\n const path = value.replace(/^ipfs:\\/\\//, \"\").replace(/^\\/?ipfs\\//, \"\");\n if (!/^[A-Za-z0-9]+(?:\\/[^?#]*)?$/.test(path) ||\n path.split(\"/\").some((part) => part === \".\" || part === \"..\"))\n throw new TypeError(\"invalid IPFS reference\");\n return new URL(this.template.replace(\"{cid}\", path.split(\"/\").map(encodeURIComponent).join(\"/\")));\n }\n async readJson(reference) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n let reader;\n try {\n const response = await this.#fetch(this.resolve(reference), {\n headers: { accept: \"application/json\" },\n signal: controller.signal,\n });\n if (!response.ok) {\n await response.body?.cancel();\n throw new Error(`IPFS gateway returned HTTP ${response.status}`);\n }\n if (!response.body)\n throw new Error(\"IPFS gateway returned an empty body\");\n reader = response.body.getReader();\n const chunks = [];\n let length = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done)\n break;\n length += value.length;\n if (length > this.maxResponseBytes)\n throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);\n chunks.push(value);\n }\n const bytes = new Uint8Array(length);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.length;\n }\n return JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes));\n }\n finally {\n clearTimeout(timer);\n await reader?.cancel().catch(() => { });\n reader?.releaseLock();\n }\n }\n}\n//# sourceMappingURL=index.js.map"],"names":["require$$0","require$$1","this","logger","stringify","isBytes","arrayifyInteger","unarrayifyInteger","_encode","_decodeChildren","_decode","decode","ripemd160","hmac","pbkdf2","u64.split","u64.rotrSH","u64.shrSH","u64.rotrSL","u64.shrSL","u64.rotrBH","u64.rotrBL","u64.add4L","u64.add4H","u64.add5L","u64.add5H","u64.add","u64.add3L","u64.add3H","sha256","sha512","Buffer","require$$2","require$$3","global","require$$4","ed448","BN_0","BN_1","locked","getTime","_a","_guard","getGlobal","randomBytes","removeHexPrefix","noble_ripemd160","crypto_random","scrypt","_nobleAsync","_nobleSync","H","BN_2","passProperties","getValue","BN_MAX_UINT256","RLP.decode","RLP.encode","_sha256","internal","PanicReasons","copy","stall","defaultApiKey","getHost","defaultPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,CAAA,QAAA,CAAA,UAAkB,GAAG;AACrB,CAAA,QAAA,CAAA,WAAmB,GAAG;AACtB,CAAA,QAAA,CAAA,aAAqB,GAAG;;AAExB,CAAA,IAAI,MAAM,GAAG;AACb,CAAA,IAAI,SAAS,GAAG;CAChB,IAAI,GAAG,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,UAAU,GAAG;;AAE3D,CAAA,IAAI,IAAI,GAAG;AACX,CAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;AACjD,GAAE,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;GAClB,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG;AAClC,CAAA;;AAEA;AACA;CACA,SAAS,CAAC,GAAG,CAAC,UA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,4,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,52,53,54,55,56,65,132,135]} \ No newline at end of file diff --git a/dist/corebc.min.js b/dist/corebc.min.js deleted file mode 100644 index 986ddb5cd..000000000 --- a/dist/corebc.min.js +++ /dev/null @@ -1 +0,0 @@ -const __$G=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x}function getAugmentedNamespace(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var f=n.default;if(typeof f=="function"){var a=function a(){var isInstance=false;try{isInstance=this instanceof a}catch(e){}if(isInstance){return Reflect.construct(f,arguments,this.constructor)}return f.apply(this,arguments)};a.prototype=f.prototype}else a={};Object.defineProperty(a,"__esModule",{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k]}})});return a}var buffer={};var base64Js={};var hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1;base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){if(hasRequiredIeee754)return ieee754;hasRequiredIeee754=1;ieee754.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};ieee754.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128};return ieee754}var hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;(function(exports){const base64=requireBase64Js();const ieee754=requireIeee754();const customInspectSymbol=typeof Symbol==="function"&&typeof Symbol["for"]==="function"?Symbol["for"]("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;const K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{const arr=new Uint8Array(1);const proto={foo:function(){return 42}};Object.setPrototypeOf(proto,Uint8Array.prototype);Object.setPrototypeOf(arr,proto);return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}const buf=new Uint8Array(length);Object.setPrototypeOf(buf,Buffer.prototype);return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayView(value)}if(value==null){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof SharedArrayBuffer!=="undefined"&&(isInstance(value,SharedArrayBuffer)||value&&isInstance(value.buffer,SharedArrayBuffer))){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}const valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}const b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}const length=byteLength(string,encoding)|0;let buf=createBuffer(length);const actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){const length=array.length<0?0:checked(array.length)|0;const buf=createBuffer(length);for(let i=0;i=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;let x=a.length;let y=b.length;for(let i=0,len=Math.min(x,y);ibuffer.length){if(!Buffer.isBuffer(buf))buf=Buffer.from(buf);buf.copy(buffer,pos)}else{Uint8Array.prototype.set.call(buffer,buf,pos)}}else if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}else{buf.copy(buffer,pos)}pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(ArrayBuffer.isView(string)||isInstance(string,ArrayBuffer)){return string.byteLength}if(typeof string!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof string)}const len=string.length;const mustMatch=arguments.length>2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;let loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){let loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){const i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){const len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(let i=0;imax)str+=" ... ";return""};if(customInspectSymbol){Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect}Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;let x=thisEnd-thisStart;let y=end-start;const len=Math.min(x,y);const thisCopy=this.slice(thisStart,thisEnd);const targetCopy=target.slice(start,end);for(let i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){let indexSize=1;let arrLength=arr.length;let valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}let i;if(dir){let foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){let found=true;for(let j=0;jremaining){length=remaining}}const strLen=string.length;if(length>strLen/2){length=strLen/2}let i;for(i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}const remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";let loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":case"latin1":case"binary":return asciiWrite(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);const res=[];let i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){let secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}const MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){const len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}let res="";let i=0;while(ilen)end=len;let out="";for(let i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}let val=this[offset+--byteLength];let mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readBigUInt64LE=defineBigIntMethod(function readBigUInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const lo=first+this[++offset]*2**8+this[++offset]*2**16+this[++offset]*2**24;const hi=this[++offset]+this[++offset]*2**8+this[++offset]*2**16+last*2**24;return BigInt(lo)+(BigInt(hi)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const hi=first*2**24+this[++offset]*2**16+this[++offset]*2**8+this[++offset];const lo=this[++offset]*2**24+this[++offset]*2**16+this[++offset]*2**8+last;return(BigInt(hi)<>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let i=byteLength;let mul=1;let val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readBigInt64LE=defineBigIntMethod(function readBigInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=this[offset+4]+this[offset+5]*2**8+this[offset+6]*2**16+(last<<24);return(BigInt(val)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=(first<<24)+this[++offset]*2**16+this[++offset]*2**8+this[++offset];return(BigInt(val)<>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let mul=1;let i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let i=byteLength-1;let mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function wrtBigUInt64LE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;return offset}function wrtBigUInt64BE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset+7]=lo;lo=lo>>8;buf[offset+6]=lo;lo=lo>>8;buf[offset+5]=lo;lo=lo>>8;buf[offset+4]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset+3]=hi;hi=hi>>8;buf[offset+2]=hi;hi=hi>>8;buf[offset+1]=hi;hi=hi>>8;buf[offset]=hi;return offset+8}Buffer.prototype.writeBigUInt64LE=defineBigIntMethod(function writeBigUInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeBigUInt64BE=defineBigIntMethod(function writeBigUInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=0;let mul=1;let sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=byteLength-1;let mul=1;let sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeBigInt64LE=defineBigIntMethod(function writeBigInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Buffer.prototype.writeBigInt64BE=defineBigIntMethod(function writeBigInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;let i;if(typeof val==="number"){for(i=start;i2**32){received=addNumericalSeparator(String(input))}else if(typeof input==="bigint"){received=String(input);if(input>BigInt(2)**BigInt(32)||input<-(BigInt(2)**BigInt(32))){received=addNumericalSeparator(received)}received+="n"}msg+=` It must be ${range}. Received ${received}`;return msg},RangeError);function addNumericalSeparator(val){let res="";let i=val.length;const start=val[0]==="-"?1:0;for(;i>=start+4;i-=3){res=`_${val.slice(i-3,i)}${res}`}return`${val.slice(0,i)}${res}`}function checkBounds(buf,offset,byteLength){validateNumber(offset,"offset");if(buf[offset]===undefined||buf[offset+byteLength]===undefined){boundsError(offset,buf.length-(byteLength+1))}}function checkIntBI(value,min,max,buf,offset,byteLength){if(value>max||value= 0${n} and < 2${n} ** ${(byteLength+1)*8}${n}`}else{range=`>= -(2${n} ** ${(byteLength+1)*8-1}${n}) and < 2 ** `+`${(byteLength+1)*8-1}${n}`}}throw new errors.ERR_OUT_OF_RANGE("value",range,value)}checkBounds(buf,offset,byteLength)}function validateNumber(value,name){if(typeof value!=="number"){throw new errors.ERR_INVALID_ARG_TYPE(name,"number",value)}}function boundsError(value,length,type){if(Math.floor(value)!==value){validateNumber(value,type);throw new errors.ERR_OUT_OF_RANGE("offset","an integer",value)}if(length<0){throw new errors.ERR_BUFFER_OUT_OF_BOUNDS}throw new errors.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${length}`,value)}const INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(str){str=str.split("=")[0];str=str.trim().replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function utf8ToBytes(string,units){units=units||Infinity;let codePoint;const length=string.length;let leadSurrogate=null;const bytes=[];for(let i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){const byteArray=[];for(let i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){let i;for(i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}const hexSliceLookupTable=function(){const alphabet="0123456789abcdef";const table=new Array(256);for(let i=0;i<16;++i){const i16=i*16;for(let j=0;j<16;++j){table[i16+j]=alphabet[i]+alphabet[j]}}return table}();function defineBigIntMethod(fn){return typeof BigInt==="undefined"?BufferBigIntNotDefined:fn}function BufferBigIntNotDefined(){throw new Error("BigInt not supported")}})(buffer);return buffer}var bufferExports=requireBuffer();const version="0.4.1";var bn$2={exports:{}};var _nodeResolve_empty={};var _nodeResolve_empty$1=Object.freeze({__proto__:null,default:_nodeResolve_empty});var require$$0=getAugmentedNamespace(_nodeResolve_empty$1);var bn$1=bn$2.exports;var hasRequiredBn$1;function requireBn$1(){if(hasRequiredBn$1)return bn$2.exports;hasRequiredBn$1=1;(function(module){(function(module,exports){function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number)){return number}this.negative=0;this.words=null;this.length=0;this.red=null;if(number!==null){if(base==="le"||base==="be"){endian=base;base=10}this._init(number||0,base||10,endian||"be")}}if(typeof module==="object"){module.exports=BN}else{exports.BN=BN}BN.BN=BN;BN.wordSize=26;var Buffer;try{if(typeof window!=="undefined"&&typeof window.Buffer!=="undefined"){Buffer=window.Buffer}else{Buffer=require$$0.Buffer}}catch(e){}BN.isBN=function isBN(num){if(num instanceof BN){return true}return num!==null&&typeof num==="object"&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)};BN.max=function max(left,right){if(left.cmp(right)>0)return left;return right};BN.min=function min(left,right){if(left.cmp(right)<0)return left;return right};BN.prototype._init=function init(number,base,endian){if(typeof number==="number"){return this._initNumber(number,base,endian)}if(typeof number==="object"){return this._initArray(number,base,endian)}if(base==="hex"){base=16}assert(base===(base|0)&&base>=2&&base<=36);number=number.toString().replace(/\s+/g,"");var start=0;if(number[0]==="-"){start++;this.negative=1}if(start=0;i-=3){w=number[i]|number[i-1]<<8|number[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}else if(endian==="le"){for(i=0,j=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}return this._strip()};function parseHex4Bits(string,index){var c=string.charCodeAt(index);if(c>=48&&c<=57){return c-48}else if(c>=65&&c<=70){return c-55}else if(c>=97&&c<=102){return c-87}else{assert(false,"Invalid character in "+string)}}function parseHexByte(string,lowerBound,index){var r=parseHex4Bits(string,index);if(index-1>=lowerBound){r|=parseHex4Bits(string,index-1)<<4}return r}BN.prototype._parseHex=function _parseHex(number,start,endian){this.length=Math.ceil((number.length-start)/6);this.words=new Array(this.length);for(var i=0;i=start;i-=2){w=parseHexByte(number,start,i)<=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}else{var parseLength=number.length-start;for(i=parseLength%2===0?start+1:start;i=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}this._strip()};function parseBase(str,start,end,mul){var r=0;var b=0;var len=Math.min(str.length,end);for(var i=start;i=49){b=c-49+10}else if(c>=17){b=c-17+10}else{b=c}assert(c>=0&&b1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};if(typeof Symbol!=="undefined"&&typeof Symbol.for==="function"){try{BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}catch(e){BN.prototype.inspect=inspect}}else{BN.prototype.inspect=inspect}function inspect(){return(this.red?""}var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(base,padding){base=base||10;padding=padding|0||1;var out;if(base===16||base==="hex"){out="";var off=0;var carry=0;for(var i=0;i>>24-off&16777215;off+=2;if(off>=26){off-=26;i--}if(carry!==0||i!==this.length-1){out=zeros[6-word.length]+word+out}else{out=word+out}}if(carry!==0){out=carry.toString(16)+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}if(base===(base|0)&&base>=2&&base<=36){var groupSize=groupSizes[base];var groupBase=groupBases[base];out="";var c=this.clone();c.negative=0;while(!c.isZero()){var r=c.modrn(groupBase).toString(base);c=c.idivn(groupBase);if(!c.isZero()){out=zeros[groupSize-r.length]+r+out}else{out=r+out}}if(this.isZero()){out="0"+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var ret=this.words[0];if(this.length===2){ret+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){ret+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-ret:ret};BN.prototype.toJSON=function toJSON(){return this.toString(16,2)};if(Buffer){BN.prototype.toBuffer=function toBuffer(endian,length){return this.toArrayLike(Buffer,endian,length)}}BN.prototype.toArray=function toArray(endian,length){return this.toArrayLike(Array,endian,length)};var allocate=function allocate(ArrayType,size){if(ArrayType.allocUnsafe){return ArrayType.allocUnsafe(size)}return new ArrayType(size)};BN.prototype.toArrayLike=function toArrayLike(ArrayType,endian,length){this._strip();var byteLength=this.byteLength();var reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length");assert(reqLength>0,"Requested array length <= 0");var res=allocate(ArrayType,reqLength);var postfix=endian==="le"?"LE":"BE";this["_toArrayLike"+postfix](res,byteLength);return res};BN.prototype._toArrayLikeLE=function _toArrayLikeLE(res,byteLength){var position=0;var carry=0;for(var i=0,shift=0;i>8&255}if(position>16&255}if(shift===6){if(position>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position=0){res[position--]=word>>8&255}if(position>=0){res[position--]=word>>16&255}if(shift===6){if(position>=0){res[position--]=word>>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position>=0){res[position--]=carry;while(position>=0){res[position--]=0}}};if(Math.clz32){BN.prototype._countBits=function _countBits(w){return 32-Math.clz32(w)}}else{BN.prototype._countBits=function _countBits(w){var t=w;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(w){if(w===0)return 26;var t=w;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var w=this.words[this.length-1];var hi=this._countBits(w);return(this.length-1)*26+hi};function toBitArray(num){var w=new Array(num.bitLength());for(var bit=0;bit>>wbit&1}return w}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var r=0;for(var i=0;inum.length)return this.clone().ior(num);return num.clone().ior(this)};BN.prototype.uor=function uor(num){if(this.length>num.length)return this.clone().iuor(num);return num.clone().iuor(this)};BN.prototype.iuand=function iuand(num){var b;if(this.length>num.length){b=num}else{b=this}for(var i=0;inum.length)return this.clone().iand(num);return num.clone().iand(this)};BN.prototype.uand=function uand(num){if(this.length>num.length)return this.clone().iuand(num);return num.clone().iuand(this)};BN.prototype.iuxor=function iuxor(num){var a;var b;if(this.length>num.length){a=this;b=num}else{a=num;b=this}for(var i=0;inum.length)return this.clone().ixor(num);return num.clone().ixor(this)};BN.prototype.uxor=function uxor(num){if(this.length>num.length)return this.clone().iuxor(num);return num.clone().iuxor(this)};BN.prototype.inotn=function inotn(width){assert(typeof width==="number"&&width>=0);var bytesNeeded=Math.ceil(width/26)|0;var bitsLeft=width%26;this._expand(bytesNeeded);if(bitsLeft>0){bytesNeeded--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-bitsLeft;i++}for(;i=0);var off=bit/26|0;var wbit=bit%26;this._expand(off+1);if(val){this.words[off]=this.words[off]|1<num.length){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this.words[this.length]=carry;this.length++}else if(a!==this){for(;inum.length)return this.clone().iadd(num);return num.clone().iadd(this)};BN.prototype.isub=function isub(num){if(num.negative!==0){num.negative=0;var r=this.iadd(num);num.negative=1;return r._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(num);this.negative=1;return this._normSign()}var cmp=this.cmp(num);if(cmp===0){this.negative=0;this.length=1;this.words[0]=0;return this}var a,b;if(cmp>0){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}if(carry===0&&i>>26;var rword=carry&67108863;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=self.words[i]|0;b=num.words[j]|0;r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0){out.words[k]=carry|0}else{out.length--}return out._strip()}var comb10MulTo=function comb10MulTo(self,num,out){var a=self.words;var b=num.words;var o=out.words;var c=0;var lo;var mid;var hi;var a0=a[0]|0;var al0=a0&8191;var ah0=a0>>>13;var a1=a[1]|0;var al1=a1&8191;var ah1=a1>>>13;var a2=a[2]|0;var al2=a2&8191;var ah2=a2>>>13;var a3=a[3]|0;var al3=a3&8191;var ah3=a3>>>13;var a4=a[4]|0;var al4=a4&8191;var ah4=a4>>>13;var a5=a[5]|0;var al5=a5&8191;var ah5=a5>>>13;var a6=a[6]|0;var al6=a6&8191;var ah6=a6>>>13;var a7=a[7]|0;var al7=a7&8191;var ah7=a7>>>13;var a8=a[8]|0;var al8=a8&8191;var ah8=a8>>>13;var a9=a[9]|0;var al9=a9&8191;var ah9=a9>>>13;var b0=b[0]|0;var bl0=b0&8191;var bh0=b0>>>13;var b1=b[1]|0;var bl1=b1&8191;var bh1=b1>>>13;var b2=b[2]|0;var bl2=b2&8191;var bh2=b2>>>13;var b3=b[3]|0;var bl3=b3&8191;var bh3=b3>>>13;var b4=b[4]|0;var bl4=b4&8191;var bh4=b4>>>13;var b5=b[5]|0;var bl5=b5&8191;var bh5=b5>>>13;var b6=b[6]|0;var bl6=b6&8191;var bh6=b6>>>13;var b7=b[7]|0;var bl7=b7&8191;var bh7=b7>>>13;var b8=b[8]|0;var bl8=b8&8191;var bh8=b8>>>13;var b9=b[9]|0;var bl9=b9&8191;var bh9=b9>>>13;out.negative=self.negative^num.negative;out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length++}return out};if(!Math.imul){comb10MulTo=smallMulTo}function bigMulTo(self,num,out){out.negative=num.negative^self.negative;out.length=self.length+num.length;var carry=0;var hncarry=0;for(var k=0;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0){out.words[k]=carry}else{out.length--}return out._strip()}function jumboMulTo(self,num,out){return bigMulTo(self,num,out)}BN.prototype.mulTo=function mulTo(num,out){var res;var len=this.length+num.length;if(this.length===10&&num.length===10){res=comb10MulTo(this,num,out)}else if(len<63){res=smallMulTo(this,num,out)}else if(len<1024){res=bigMulTo(this,num,out)}else{res=jumboMulTo(this,num,out)}return res};BN.prototype.mul=function mul(num){var out=new BN(null);out.words=new Array(this.length+num.length);return this.mulTo(num,out)};BN.prototype.mulf=function mulf(num){var out=new BN(null);out.words=new Array(this.length+num.length);return jumboMulTo(this,num,out)};BN.prototype.imul=function imul(num){return this.clone().mulTo(num,this)};BN.prototype.imuln=function imuln(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(typeof num==="number");assert(num<67108864);var carry=0;for(var i=0;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}if(carry!==0){this.words[i]=carry;this.length++}if(num===0){this.length=1;this._normSign()}return isNegNum?this.ineg():this};BN.prototype.muln=function muln(num){return this.clone().imuln(num)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(num){var w=toBitArray(num);if(w.length===0)return new BN(1);var res=this;for(var i=0;i=0);var r=bits%26;var s=(bits-r)/26;var carryMask=67108863>>>26-r<<26-r;var i;if(r!==0){var carry=0;for(i=0;i>>26-r}if(carry){this.words[i]=carry;this.length++}}if(s!==0){for(i=this.length-1;i>=0;i--){this.words[i+s]=this.words[i]}for(i=0;i=0);var h;if(hint){h=(hint-hint%26)/26}else{h=0}var r=bits%26;var s=Math.min((bits-r)/26,this.length);var mask=67108863^67108863>>>r<s){this.length-=s;for(i=0;i=0&&(carry!==0||i>=h);i--){var word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}if(maskedWords&&carry!==0){maskedWords.words[maskedWords.length++]=carry}if(this.length===0){this.words[0]=0;this.length=1}return this._strip()};BN.prototype.ishrn=function ishrn(bits,hint,extended){assert(this.negative===0);return this.iushrn(bits,hint,extended)};BN.prototype.shln=function shln(bits){return this.clone().ishln(bits)};BN.prototype.ushln=function ushln(bits){return this.clone().iushln(bits)};BN.prototype.shrn=function shrn(bits){return this.clone().ishrn(bits)};BN.prototype.ushrn=function ushrn(bits){return this.clone().iushrn(bits)};BN.prototype.testn=function testn(bit){assert(typeof bit==="number"&&bit>=0);var r=bit%26;var s=(bit-r)/26;var q=1<=0);var r=bits%26;var s=(bits-r)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=s){return this}if(r!==0){s++}this.length=Math.min(s,this.length);if(r!==0){var mask=67108863^67108863>>>r<=67108864;i++){this.words[i]-=67108864;if(i===this.length-1){this.words[i+1]=1}else{this.words[i+1]++}}this.length=Math.max(this.length,i+1);return this};BN.prototype.isubn=function isubn(num){assert(typeof num==="number");assert(num<67108864);if(num<0)return this.iaddn(-num);if(this.negative!==0){this.negative=0;this.iaddn(num);this.negative=1;return this}this.words[0]-=num;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var i=0;i>26)-(right/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this._strip();assert(carry===-1);carry=0;for(i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this._strip()};BN.prototype._wordDiv=function _wordDiv(num,mode){var shift=this.length-num.length;var a=this.clone();var b=num;var bhi=b.words[b.length-1]|0;var bhiBits=this._countBits(bhi);shift=26-bhiBits;if(shift!==0){b=b.ushln(shift);a.iushln(shift);bhi=b.words[b.length-1]|0}var m=a.length-b.length;var q;if(mode!=="mod"){q=new BN(null);q.length=m+1;q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=(a.words[b.length+j]|0)*67108864+(a.words[b.length+j-1]|0);qj=Math.min(qj/bhi|0,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj--;a.negative=0;a._ishlnsubmul(b,1,j);if(!a.isZero()){a.negative^=1}}if(q){q.words[j]=qj}}if(q){q._strip()}a._strip();if(mode!=="div"&&shift!==0){a.iushrn(shift)}return{div:q||null,mod:a}};BN.prototype.divmod=function divmod(num,mode,positive){assert(!num.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var div,mod,res;if(this.negative!==0&&num.negative===0){res=this.neg().divmod(num,mode);if(mode!=="mod"){div=res.div.neg()}if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.iadd(num)}}return{div:div,mod:mod}}if(this.negative===0&&num.negative!==0){res=this.divmod(num.neg(),mode);if(mode!=="mod"){div=res.div.neg()}return{div:div,mod:res.mod}}if((this.negative&num.negative)!==0){res=this.neg().divmod(num.neg(),mode);if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.isub(num)}}return{div:res.div,mod:mod}}if(num.length>this.length||this.cmp(num)<0){return{div:new BN(0),mod:this}}if(num.length===1){if(mode==="div"){return{div:this.divn(num.words[0]),mod:null}}if(mode==="mod"){return{div:null,mod:new BN(this.modrn(num.words[0]))}}return{div:this.divn(num.words[0]),mod:new BN(this.modrn(num.words[0]))}}return this._wordDiv(num,mode)};BN.prototype.div=function div(num){return this.divmod(num,"div",false).div};BN.prototype.mod=function mod(num){return this.divmod(num,"mod",false).mod};BN.prototype.umod=function umod(num){return this.divmod(num,"mod",true).mod};BN.prototype.divRound=function divRound(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=dm.mod.abs();var half=num.abs().iushrn(1);var r2=num.words[0]&1;var cmp=mod.cmp(half);if(cmp<0||r2===1&&cmp===0)return dm.div;var up=new BN(1);up.negative=this.negative^num.negative;return dm.div.iadd(up)};BN.prototype.modrn=function modrn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var p=(1<<26)%num;var acc=0;for(var i=this.length-1;i>=0;i--){acc=(p*acc+(this.words[i]|0))%num}return isNegNum?-acc:acc};BN.prototype.modn=function modn(num){return this.modrn(num)};BN.prototype.idivn=function idivn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var carry=0;for(var i=this.length-1;i>=0;i--){var w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}this._strip();return isNegNum?this.ineg():this};BN.prototype.divn=function divn(num){return this.clone().idivn(num)};BN.prototype.egcd=function egcd(p){assert(p.negative===0);assert(!p.isZero());var x=this;var y=p.clone();if(x.negative!==0){x=x.umod(p)}else{x=x.clone()}var A=new BN(1);var B=new BN(0);var C=new BN(0);var D=new BN(1);var g=0;while(x.isEven()&&y.isEven()){x.iushrn(1);y.iushrn(1);++g}var yp=y.clone();var xp=x.clone();while(!x.isZero()){for(var i=0,im=1;(x.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){x.iushrn(i);while(i-- >0){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}}for(var j=0,jm=1;(y.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){y.iushrn(j);while(j-- >0){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}return{a:C,b:D,gcd:y.iushln(g)}};BN.prototype._invmp=function _invmp(p){assert(p.negative===0);assert(!p.isZero());var a=this;var b=p.clone();if(a.negative!==0){a=a.umod(p)}else{a=a.clone()}var x1=new BN(1);var x2=new BN(0);var delta=b.clone();while(a.cmpn(1)>0&&b.cmpn(1)>0){for(var i=0,im=1;(a.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){a.iushrn(i);while(i-- >0){if(x1.isOdd()){x1.iadd(delta)}x1.iushrn(1)}}for(var j=0,jm=1;(b.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){b.iushrn(j);while(j-- >0){if(x2.isOdd()){x2.iadd(delta)}x2.iushrn(1)}}if(a.cmp(b)>=0){a.isub(b);x1.isub(x2)}else{b.isub(a);x2.isub(x1)}}var res;if(a.cmpn(1)===0){res=x1}else{res=x2}if(res.cmpn(0)<0){res.iadd(p)}return res};BN.prototype.gcd=function gcd(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone();var b=num.clone();a.negative=0;b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++){a.iushrn(1);b.iushrn(1)}do{while(a.isEven()){a.iushrn(1)}while(b.isEven()){b.iushrn(1)}var r=a.cmp(b);if(r<0){var t=a;a=b;b=t}else if(r===0||b.cmpn(1)===0){break}a.isub(b)}while(true);return b.iushln(shift)};BN.prototype.invm=function invm(num){return this.egcd(num).a.umod(num)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(num){return this.words[0]&num};BN.prototype.bincn=function bincn(bit){assert(typeof bit==="number");var r=bit%26;var s=(bit-r)/26;var q=1<>>26;w&=67108863;this.words[i]=w}if(carry!==0){this.words[i]=carry;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(num){var negative=num<0;if(this.negative!==0&&!negative)return-1;if(this.negative===0&&negative)return 1;this._strip();var res;if(this.length>1){res=1}else{if(negative){num=-num}assert(num<=67108863,"Number is too big");var w=this.words[0]|0;res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=this.words[i]|0;var b=num.words[i]|0;if(a===b)continue;if(ab){res=1}break}return res};BN.prototype.gtn=function gtn(num){return this.cmpn(num)===1};BN.prototype.gt=function gt(num){return this.cmp(num)===1};BN.prototype.gten=function gten(num){return this.cmpn(num)>=0};BN.prototype.gte=function gte(num){return this.cmp(num)>=0};BN.prototype.ltn=function ltn(num){return this.cmpn(num)===-1};BN.prototype.lt=function lt(num){return this.cmp(num)===-1};BN.prototype.lten=function lten(num){return this.cmpn(num)<=0};BN.prototype.lte=function lte(num){return this.cmp(num)<=0};BN.prototype.eqn=function eqn(num){return this.cmpn(num)===0};BN.prototype.eq=function eq(num){return this.cmp(num)===0};BN.red=function red(num){return new Red(num)};BN.prototype.toRed=function toRed(ctx){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return ctx.convertTo(this)._forceRed(ctx)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(ctx){this.red=ctx;return this};BN.prototype.forceRed=function forceRed(ctx){assert(!this.red,"Already a number in reduction context");return this._forceRed(ctx)};BN.prototype.redAdd=function redAdd(num){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,num)};BN.prototype.redIAdd=function redIAdd(num){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,num)};BN.prototype.redSub=function redSub(num){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,num)};BN.prototype.redISub=function redISub(num){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,num)};BN.prototype.redShl=function redShl(num){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,num)};BN.prototype.redMul=function redMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.mul(this,num)};BN.prototype.redIMul=function redIMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.imul(this,num)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(num){assert(this.red&&!num.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};function MPrime(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var tmp=new BN(null);tmp.words=new Array(Math.ceil(this.n/13));return tmp};MPrime.prototype.ireduce=function ireduce(num){var r=num;var rlen;do{this.split(r,this.tmp);r=this.imulK(r);r=r.iadd(this.tmp);rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0){r.isub(this.p)}else{if(r.strip!==undefined){r.strip()}else{r._strip()}}return r};MPrime.prototype.split=function split(input,out){input.iushrn(this.n,0,out)};MPrime.prototype.imulK=function imulK(num){return num.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(input,output){var mask=4194303;var outLen=Math.min(input.length,9);for(var i=0;i>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10){input.length-=10}else{input.length-=9}};K256.prototype.imulK=function imulK(num){num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;var lo=0;for(var i=0;i>>=26;num.words[i]=lo;carry=hi}if(carry!==0){num.words[num.length++]=carry}return num};BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if(name==="k256"){prime=new K256}else if(name==="p224"){prime=new P224}else if(name==="p192"){prime=new P192}else if(name==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+name)}primes[name]=prime;return prime};function Red(m){if(typeof m==="string"){var prime=BN._prime(m);this.m=prime.p;this.prime=prime}else{assert(m.gtn(1),"modulus must be greater than 1");this.m=m;this.prime=null}}Red.prototype._verify1=function _verify1(a){assert(a.negative===0,"red works only with positives");assert(a.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(a,b){assert((a.negative|b.negative)===0,"red works only with positives");assert(a.red&&a.red===b.red,"red works only with red numbers")};Red.prototype.imod=function imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);move(a,a.umod(this.m)._forceRed(this));return a};Red.prototype.neg=function neg(a){if(a.isZero()){return a.clone()}return this.m.sub(a)._forceRed(this)};Red.prototype.add=function add(a,b){this._verify2(a,b);var res=a.add(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res._forceRed(this)};Red.prototype.iadd=function iadd(a,b){this._verify2(a,b);var res=a.iadd(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res};Red.prototype.sub=function sub(a,b){this._verify2(a,b);var res=a.sub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res._forceRed(this)};Red.prototype.isub=function isub(a,b){this._verify2(a,b);var res=a.isub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res};Red.prototype.shl=function shl(a,num){this._verify1(a);return this.imod(a.ushln(num))};Red.prototype.imul=function imul(a,b){this._verify2(a,b);return this.imod(a.imul(b))};Red.prototype.mul=function mul(a,b){this._verify2(a,b);return this.imod(a.mul(b))};Red.prototype.isqr=function isqr(a){return this.imul(a,a.clone())};Red.prototype.sqr=function sqr(a){return this.mul(a,a)};Red.prototype.sqrt=function sqrt(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);assert(mod3%2===1);if(mod3===3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}var q=this.m.subn(1);var s=0;while(!q.isZero()&&q.andln(1)===0){s++;q.iushrn(1)}assert(!q.isZero());var one=new BN(1).toRed(this);var nOne=one.redNeg();var lpow=this.m.subn(1).iushrn(1);var z=this.m.bitLength();z=new BN(2*z*z).toRed(this);while(this.pow(z,lpow).cmp(nOne)!==0){z.redIAdd(nOne)}var c=this.pow(z,q);var r=this.pow(a,q.addn(1).iushrn(1));var t=this.pow(a,q);var m=s;while(t.cmp(one)!==0){var tmp=t;for(var i=0;tmp.cmp(one)!==0;i++){tmp=tmp.redSqr()}assert(i=0;i--){var word=num.words[i];for(var j=start-1;j>=0;j--){var bit=word>>j&1;if(res!==wnd[0]){res=this.sqr(res)}if(bit===0&¤t===0){currentLen=0;continue}current<<=1;current|=bit;currentLen++;if(currentLen!==windowSize&&(i!==0||j!==0))continue;res=this.mul(res,wnd[current]);currentLen=0;current=0}start=26}return res};Red.prototype.convertTo=function convertTo(num){var r=num.umod(this.m);return r===num?r.clone():r};Red.prototype.convertFrom=function convertFrom(num){var res=num.clone();res.red=null;return res};BN.mont=function mont(num){return new Mont(num)};function Mont(m){Red.call(this,m);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(num){return this.imod(num.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(num){var r=this.imod(num.mul(this.rinv));r.red=null;return r};Mont.prototype.imul=function imul(a,b){if(a.isZero()||b.isZero()){a.words[0]=0;a.length=1;return a}var t=a.imul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.mul=function mul(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.invm=function invm(a){var res=this.imod(a._invmp(this.m).mul(this.r2));return res._forceRed(this)}})(module,bn$1)})(bn$2);return bn$2.exports}var bnExports=requireBn$1();var _BN=getDefaultExportFromCjs(bnExports);let _permanentCensorErrors=false;let _censorErrors=false;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels["default"];let _globalLogger=null;function _checkNormalize(){try{const missing=[];["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing.push(form)}});if(missing.length){throw new Error("missing "+missing.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"]="UNPREDICTABLE_ENERGY_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{version="0.0.1";static errors=ErrorCode;static levels=LogLevel;constructor(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}_log(logLevel,args){const level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)}debug(...args){this._log(Logger.levels.DEBUG,args)}info(...args){this._log(Logger.levels.INFO,args)}warn(...args){this._log(Logger.levels.WARNING,args)}makeError(message,code,params){if(_censorErrors){return this.makeError("censored error",code,{})}if(!code){code=Logger.errors.UNKNOWN_ERROR}if(!params){params={}}const messageDetails=[];Object.keys(params).forEach(key=>{const value=params[key];try{if(value instanceof Uint8Array){let hex="";for(let i=0;i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push(`code=${code}`);messageDetails.push(`version=${this.version}`);const reason=message;if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}const error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error}throwError(message,code,params){throw this.makeError(message,code,params)}throwArgumentError(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})}assert(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)}assertArgument(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)}checkNormalize(message){if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}}checkSafeUint53(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}}checkArgumentCount(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}}checkNew(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}checkAbstract(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}static globalLogger(){if(!_globalLogger){_globalLogger=new Logger("logger/0.0.1")}return _globalLogger}static setCensorship(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent}static setLogLevel(logLevel){const level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level}static from(version){return new Logger(version)}}const logger$7=new Logger("utils/properties/0.0.1");function checkType(value,type,name){const types=type.split("|").map(t=>t.trim());for(let i=0;iPromise.resolve(value[k])));return results.reduce((accum,v,index)=>{accum[keys[index]]=v;return accum},{})}function defineProperties(target,values,types){for(let key in values){let value=values[key];const type=types?types[key]:null;if(type){checkType(value,type,key)}Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function checkProperties(object,properties){if(!object||typeof object!=="object"){logger$7.throwArgumentError("invalid object","object",object)}Object.keys(object).forEach(key=>{if(!properties[key]){logger$7.throwArgumentError("invalid object key - "+key,"transaction:"+key,object)}})}function stringify$1(value){if(value==null){return"null"}if(Array.isArray(value)){return"[ "+value.map(stringify$1).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify$1(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"number":return value.toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function isError(error,code){return error&&error.code===code}function isCallException(error){return isError(error,"CALL_EXCEPTION")}function makeError(message,code,info){{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify$1(info)}`)}for(const key in info){const value=info[key];details.push(key+"="+stringify$1(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}function assertArgumentCount(count,expectedCount,message){if(message==null){message=""}if(message){message=": "+message}assert(count>=expectedCount,"missing arguemnt"+message,"MISSING_ARGUMENT",{count:count,expectedCount:expectedCount});assert(count<=expectedCount,"too many arguemnts"+message,"UNEXPECTED_ARGUMENT",{count:count,expectedCount:expectedCount})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function assertNormalize(form){assert(_normalizeForms.indexOf(form)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:form}})}function assertPrivate(givenGuard,guard,className){if(className==null){className=""}if(givenGuard!==guard){let method=className,operation="new";if(className){method+=".";operation+=" "+className}assert(false,`private constructor; use ${method}from* methods`,"UNSUPPORTED_OPERATION",{operation:operation})}}const logger$6=new Logger("utils/data/0.0.1");function isHexable(value){return!!value.toHexString}function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes$1(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(let i=0;i=256){return false}}return true}function _getBytes(value,name,copy){if(value instanceof Uint8Array){if(copy){return new Uint8Array(value)}return value}if(typeof value==="string"&&value.match(/^0x([0-9a-f][0-9a-f])*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;iNumber(item));value=new Uint8Array(v)}}if(typeof value==="number"){logger$6.checkSafeUint53(value,"invalid hexlify value");let hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger$6.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes$1(value)){let result="0x";for(let i=0;i>4]+HexCharacters[v&15]}return result}return logger$6.throwArgumentError("invalid hexlify value","value",value)}function concat(items){return"0x"+items.map(d=>hexlify(d).substring(2)).join("")}function hexDataSlice(data,offset,endOffset){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){logger$6.throwArgumentError("invalid hexData","value",data)}offset=2+2*offset;return"0x"+data.substring(offset)}function hexDataLength(data){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){return null}return(data.length-2)/2}function dataLength(data){if(isHexString(data,true)){return(data.length-2)/2}return getBytes(data).length}function dataSlice(data,start,end){const bytes=getBytes(data);if(end!=null&&end>bytes.length){assert(false,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:bytes,length:bytes.length,offset:end})}return hexlify(bytes.slice(start==null?0:start,end==null?bytes.length:end))}function stripZerosLeft(data){let bytes=hexlify(data).substring(2);while(bytes.startsWith("00")){bytes=bytes.substring(2)}return"0x"+bytes}function zeroPad(data,length,left){const bytes=getBytes(data);assert(length>=bytes.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(bytes),length:length,offset:length+1});const result=new Uint8Array(length);result.fill(0);if(left){result.set(bytes,length-bytes.length)}else{result.set(bytes,0)}return hexlify(result)}function zeroPadValue(data,length){return zeroPad(data,length,true)}function zeroPadBytes(data,length){return zeroPad(data,length,false)}function stripZeros(value){let result=arrayify(value);if(result.length===0){return result}let start=0;while(start{result+=hexlify(item).substring(2)});return result}var BN=_BN.BN;const logger$5=new Logger("bigNumber/0.0.1");const _constructorGuard={};const MAX_SAFE=9007199254740991;let _warnedToStringRadix=false;class BigNumber{_hex;_isBigNumber;constructor(constructorGuard,hex){logger$5.checkNew(new.target,BigNumber);if(constructorGuard!==_constructorGuard){logger$5.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"})}this._hex=hex;this._isBigNumber=true;Object.freeze(this)}fromTwos(value){return toBigNumber(toBN(this).fromTwos(value))}toTwos(value){return toBigNumber(toBN(this).toTwos(value))}abs(){if(this._hex[0]==="-"){return BigNumber.from(this._hex.substring(1))}return this}add(other){return toBigNumber(toBN(this).add(toBN(other)))}sub(other){return toBigNumber(toBN(this).sub(toBN(other)))}div(other){const o=BigNumber.from(other);if(o.isZero()){throwFault("division by zero","div")}return toBigNumber(toBN(this).div(toBN(other)))}mul(other){return toBigNumber(toBN(this).mul(toBN(other)))}mod(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot modulo negative values","mod")}return toBigNumber(toBN(this).umod(value))}pow(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot raise to negative values","pow")}return toBigNumber(toBN(this).pow(value))}and(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'and' negative values","and")}return toBigNumber(toBN(this).and(value))}or(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'or' negative values","or")}return toBigNumber(toBN(this).or(value))}xor(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'xor' negative values","xor")}return toBigNumber(toBN(this).xor(value))}mask(value){if(this.isNegative()||value<0){throwFault("cannot mask negative values","mask")}return toBigNumber(toBN(this).maskn(value))}shl(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shl")}return toBigNumber(toBN(this).shln(value))}shr(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shr")}return toBigNumber(toBN(this).shrn(value))}eq(other){return toBN(this).eq(toBN(other))}lt(other){return toBN(this).lt(toBN(other))}lte(other){return toBN(this).lte(toBN(other))}gt(other){return toBN(this).gt(toBN(other))}gte(other){return toBN(this).gte(toBN(other))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch(error){throwFault("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return logger$5.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){if(arguments.length>0){if(arguments[0]===10){if(!_warnedToStringRadix){_warnedToStringRadix=true;logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")}}else if(arguments[0]===16){logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{})}else{logger$5.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})}}return toBN(this).toString(10)}toHexString(){return this._hex}toJSON(key){return{type:"BigNumber",hex:this.toHexString()}}static from(value){if(value instanceof BigNumber){return value}if(typeof value==="string"){if(value.match(/^-?0x[0-9a-f]+$/i)){return new BigNumber(_constructorGuard,toHex(value))}if(value.match(/^-?[0-9]+$/)){return new BigNumber(_constructorGuard,toHex(new BN(value)))}return logger$5.throwArgumentError("invalid BigNumber string","value",value)}if(typeof value==="number"){if(value%1){throwFault("underflow","BigNumber.from",value)}if(value>=MAX_SAFE||value<=-MAX_SAFE){throwFault("overflow","BigNumber.from",value)}return BigNumber.from(String(value))}const anyValue=value;if(typeof anyValue==="bigint"){return BigNumber.from(anyValue.toString())}if(isBytes$1(anyValue)){return BigNumber.from(hexlify(anyValue))}if(anyValue){if(anyValue.toHexString){const hex=anyValue.toHexString();if(typeof hex==="string"){return BigNumber.from(hex)}}else{let hex=anyValue._hex;if(hex==null&&anyValue.type==="BigNumber"){hex=anyValue.hex}if(typeof hex==="string"){if(isHexString(hex)||hex[0]==="-"&&isHexString(hex.substring(1))){return BigNumber.from(hex)}}}}return logger$5.throwArgumentError("invalid BigNumber value","value",value)}static isBigNumber(value){return!!(value&&value._isBigNumber)}}function toHex(value){if(typeof value!=="string"){return toHex(value.toString(16))}if(value[0]==="-"){value=value.substring(1);if(value[0]==="-"){logger$5.throwArgumentError("invalid hex","value",value)}value=toHex(value);if(value==="0x00"){return value}return"-"+value}if(value.substring(0,2)!=="0x"){value="0x"+value}if(value==="0x"){return"0x00"}if(value.length%2){value="0x0"+value.substring(2)}while(value.length>4&&value.substring(0,4)==="0x00"){value="0x"+value.substring(4)}return value}function toBigNumber(value){return BigNumber.from(toHex(value))}function toBN(value){const hex=BigNumber.from(value).toHexString();if(hex[0]==="-"){return new BN("-"+hex.substring(3),16)}return new BN(hex.substring(2),16)}function throwFault(fault,operation,value){const params={fault:fault,operation:operation};if(value!=null){params.value=value}return logger$5.throwError(fault,Logger.errors.NUMERIC_FAULT,params)}const logger$4=new Logger("rlp/0.0.1");function arrayifyInteger$1(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function unarrayifyInteger$1(data,offset,length){let result=0;for(let i=0;ioffset+1+length){logger$4.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}}return{consumed:1+length,result:result}}function _decode$1(data,offset){if(data.length===0){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}if(data[offset]>=248){const lengthLength=data[offset]-247;if(offset+1+lengthLength>data.length){logger$4.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;if(offset+1+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;if(offset+1+lengthLength>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;if(offset+1+length>data.length){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlify(data[offset])}}function decode$1(data){const bytes=arrayify(data);const decoded=_decode$1(bytes,0);if(decoded.consumed!==bytes.length){logger$4.throwArgumentError("invalid rlp data","data",data)}return decoded.result}const U32_MASK64=(()=>BigInt(2**32-1))();const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){const len=lst.length;let Ah=new Uint32Array(len);let Al=new Uint32Array(len);for(let i=0;in/2**32|0;const fromNumL=n=>n>>>0;function setU64FromNum(view,byteOffset,n,isLE){const h=fromNumH(n);const l=fromNumL(n);view.setUint32(byteOffset,isLE?l:h,isLE);view.setUint32(byteOffset+4,isLE?h:l,isLE)}const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;function isBytes(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in a&&a.BYTES_PER_ELEMENT===1}const atitle=title=>title?`"${title}" `:"";function anumber(n,title=""){if(typeof n!=="number")throw new TypeError(atitle(title)+"expected number, got "+typeof n);if(!Number.isSafeInteger(n)||n<0)throw new RangeError(atitle(title)+"expected integer >= 0, got "+n);return n}function abool(value,title=""){if(typeof value!=="boolean")throw new TypeError(atitle(title)+"expected boolean, got type="+typeof value);return value}function abytes(value,length,title=""){if(isBytes(value)&&length===undefined)return value;const bytes=isBytes(value);const ofLen="";const got=bytes?`length=${value.length}`:`type=${typeof value}`;const message=atitle(title)+"expected Uint8Array"+ofLen+", got "+got;if(!bytes)throw new TypeError(message);throw new RangeError(message)}function ahash(h){if(typeof h!=="function"||typeof h.create!=="function")throw new TypeError("expected hash wrapped by utils.createHasher");anumber(h.outputLen);anumber(h.blockLen);if(h.outputLen<1||h.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const aobject=(value,label)=>{if(value===null||typeof value!=="object"||Array.isArray(value))throw new TypeError((label==="object"?"":`"${label}" `)+"expected object, got type="+typeof value)};const aopts=(value,label)=>{aobject(value,label);const proto=Object.getPrototypeOf(value);if(proto!==Object.prototype&&proto!==null)throw new TypeError(`"${label}" expected plain object`);if(Object.hasOwn(value,"__proto__"))throw new TypeError(`"${label}.__proto__" is not allowed`)};function aexists(instance,checkFinished=true){if(instance.destroyed)throw new Error("hash was destroyed");if(checkFinished&&instance.finished)throw new Error("digest() was already called")}function aoutput(out,instance){abytes(out,undefined,"output");const min=instance.outputLen;if(!(out.length>=min)){throw new RangeError('"output" expected length >= '+min)}}function u32(arr){return new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4))}function clean(...arrays){for(let i=0;i>>shift}function rotl(word,shift){return word<>>32-shift>>>0}const isLE=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function byteSwap(word){return word<<24&4278190080|word<<8&16711680|word>>>8&65280|word>>>24&255}function byteSwap32(arr){for(let i=0;iu:byteSwap32;function nextTick(onReject){const host=globalThis;if(typeof host.scheduler?.yield==="function"){const promise=host.scheduler.yield();if(onReject)promise.catch(onReject);return promise}return new Promise(resolve=>host.setTimeout(resolve,0))}async function asyncLoop(iters,tick,cb,onReject){anumber(iters,"iters");anumber(tick,"tick");if(typeof cb!=="function")throw new TypeError("callback must be a function");let ts=Date.now();for(let i=0;i=0&&diff= 1');if(dkLen<1)throw new Error('"dkLen" must be >= 1');if(dkLen>(2**32-1)*hash.outputLen)throw new Error("derived key too long");const p=kdfInputToBytes(_password,"password");try{const s=kdfInputToBytes(_salt,"salt");try{const DK=new Uint8Array(dkLen);const{iHash,oHash,outputLen}=hmac$1.create(hash,p);const u=new Uint8Array(outputLen);const eng=pbkdf2Engine(iHash,oHash,s,u);return{c:c,dkLen:dkLen,asyncTick:asyncTick,DK:DK,outputLen:outputLen,eng:eng}}finally{if(typeof _salt==="string")clean(s)}}finally{if(typeof _password==="string")clean(p)}}function pbkdf2Engine(iHash,oHash,salt,u){const counter=new Uint8Array(4);const view=createView(counter);const salted=iHash._cloneInto().update(salt);const work=oHash._cloneInto();const iClone=iHash._cloneInto;const oClone=oHash._cloneInto;return{u1:(ti,Ti)=>{view.setInt32(0,ti,false);salted._cloneInto(work).update(counter).digestInto(u);oHash._cloneInto(work).update(u).digestInto(u);Ti.set(u.subarray(0,Ti.length))},rounds:(c,Ti)=>{for(let ui=1;ui{iHash.destroy();oHash.destroy();salted.destroy();work.destroy();clean(u);return DK}}}function pbkdf2$3(hash,password,salt,opts){const{c,dkLen,DK,outputLen,eng}=pbkdf2Init(hash,password,salt,opts);for(let ti=1,pos=0;pos>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){clean(SHA256_W)}destroy(){this.destroyed=true;this.set(0,0,0,0,0,0,0,0);clean(this.buffer)}}class _SHA256 extends SHA2_32B{constructor(){super(32,SHA256_IV)}}const K512=(()=>split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_Kh=(()=>K512[0])();const SHA512_Kl=(()=>K512[1])();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA2_64B extends HashMD{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(outputLen,IV){super(128,outputLen,16,false);this.Ah=IV[0]|0;this.Al=IV[1]|0;this.Bh=IV[2]|0;this.Bl=IV[3]|0;this.Ch=IV[4]|0;this.Cl=IV[5]|0;this.Dh=IV[6]|0;this.Dl=IV[7]|0;this.Eh=IV[8]|0;this.El=IV[9]|0;this.Fh=IV[10]|0;this.Fl=IV[11]|0;this.Gh=IV[12]|0;this.Gl=IV[13]|0;this.Hh=IV[14]|0;this.Hl=IV[15]|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=rotrSH(W15h,W15l,1)^rotrSH(W15h,W15l,8)^shrSH(W15h,W15l,7);const s0l=rotrSL(W15h,W15l,1)^rotrSL(W15h,W15l,8)^shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=rotrSH(W2h,W2l,19)^rotrBH(W2h,W2l,61)^shrSH(W2h,W2l,6);const s1l=rotrSL(W2h,W2l,19)^rotrBL(W2h,W2l,61)^shrSL(W2h,W2l,6);const SUMl=add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=rotrSH(Eh,El,14)^rotrSH(Eh,El,18)^rotrBH(Eh,El,41);const sigma1l=rotrSL(Eh,El,14)^rotrSL(Eh,El,18)^rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=rotrSH(Ah,Al,28)^rotrBH(Ah,Al,34)^rotrBH(Ah,Al,39);const sigma0l=rotrSL(Ah,Al,28)^rotrBL(Ah,Al,34)^rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=add3L(T1l,sigma0l,MAJl);Ah=add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){clean(SHA512_W_H,SHA512_W_L)}destroy(){this.destroyed=true;clean(this.buffer);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class _SHA512 extends SHA2_64B{constructor(){super(64,SHA512_IV)}}const sha256$2=createHasher(()=>new _SHA256,oidNist(1));const sha512$1=createHasher(()=>new _SHA512,oidNist(3));const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);const SHA3_PI=[];const SHA3_ROTL=[];const _SHA3_IOTA=[];for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;const rotlH=(h,l,s)=>s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);const B=new Uint32Array(5*2);function keccakP(s,rounds=24){if(!(s instanceof Uint32Array))throw new TypeError('"s" expected Uint32Array(50), got type='+typeof s);if(s.length!==50)throw new RangeError('"s" expected Uint32Array(50), got length='+s.length);anumber(rounds,"rounds");if(rounds<1||rounds>24)throw new Error('"rounds" expected integer 1..24');for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){const b0=s[y],b1=s[y+1],b2=s[y+2],b3=s[y+3];s[y]^=~s[y+2]&s[y+4];s[y+1]^=~s[y+3]&s[y+5];s[y+2]^=~s[y+4]&s[y+6];s[y+3]^=~s[y+5]&s[y+7];s[y+4]^=~s[y+6]&s[y+8];s[y+5]^=~s[y+7]&s[y+9];s[y+6]^=~s[y+8]&b0;s[y+7]^=~s[y+9]&b1;s[y+8]^=~b0&b2;s[y+9]^=~b1&b3}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}clean(B)}class Keccak{state;pos=0;posOut=0;finished=false;state32;destroyed=false;blockLen;suffix;outputLen;canXOF;enableXOF=false;rounds;constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){anumber(blockLen,"blockLen");anumber(suffix,"suffix");anumber(rounds,"rounds");abool(enableXOF,"enableXOF");this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.canXOF=enableXOF;this.rounds=rounds;anumber(outputLen,"outputLen");if(!(0=blockLen?u32(data):undefined;for(let pos=0;pos=blockLen){for(let i=0,o=pos/4;i=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not enabled");return this.writeInto(out)}xof(bytes){anumber(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){aoutput(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out.length===this.outputLen?out:out.subarray(0,this.outputLen));this.destroy()}digest(){const out=new Uint8Array(this.outputLen);this.digestInto(out);return out}destroy(){this.destroyed=true;clean(this.state)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds);to.blockLen=blockLen;to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.canXOF=this.canXOF;to.destroyed=this.destroyed;return to}}const genKeccak=(suffix,blockLen,outputLen,info={})=>createHasher(()=>new Keccak(blockLen,suffix,outputLen),info);const sha3_256=genKeccak(6,136,32,oidNist(8));const sha3_512=genKeccak(6,72,64,oidNist(10));const keccak_256=genKeccak(1,136,32);var assert_1;var hasRequiredAssert;function requireAssert(){if(hasRequiredAssert)return assert_1;hasRequiredAssert=1;function assert(val,msg){if(!val){const err=new Error(msg||"Assertion failed");if(Error.captureStackTrace)Error.captureStackTrace(err,assert);throw err}}assert_1=assert;return assert_1}var customBrowser={};var hasRequiredCustomBrowser;function requireCustomBrowser(){if(hasRequiredCustomBrowser)return customBrowser;hasRequiredCustomBrowser=1;customBrowser.custom="inspect";return customBrowser}var bn;var hasRequiredBn;function requireBn(){if(hasRequiredBn)return bn;hasRequiredBn=1;const{custom}=requireCustomBrowser();const zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];const groupSizes=[0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];const groupBases=[0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];const primes={p192:null,p224:null,p521:null,k256:null,p251:null,p25519:null,p448:null};const modes={NONE:0,QUO:1,REM:2,BOTH:3,EUCLID:4,ALL:7};const WND_WIDTH=4;const WND_SIZE=1<>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}else if(a!==this){for(;i=67108864;i++){this.words[i]-=67108864;this.words[i+1]+=1}this.length=Math.max(this.length,i+1);return this}iadd(num){enforce(BN.isBN(num),"num","bignum");if(this.negative===num.negative){this._iadd(this,num)}else{const cmp=this.ucmp(num);if(cmp===0){this.words[0]=0;this.length=1;this.negative=0;return this}if(cmp<0){this._isub(num,this);this.negative^=1}else{this._isub(this,num)}}return this}iaddn(num){enforce(isSMI(num),"num","smi");const negative=num<0|0;if(negative)num=-num;if(this.negative===negative){this._iaddn(num)}else{if(this.length===1&&this.words[0]this.length)return num.clone().iadd(this);return this.clone().iadd(num)}addn(num){return this.clone().iaddn(num)}_isub(a,b){let carry=0;let i=0;assert(a.length>=b.length);if(a!==this)this._alloc(a.length);for(;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}assert(carry===0);if(a!==this){for(;i=0)return this._normalize();assert(this.length!==1);this._alloc(this.length+1);for(let i=0;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}this.negative^=neg;if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}else{this._strip()}return this}mul(num){enforce(BN.isBN(num),"num","bignum");const len=this.length+num.length;const out=new BN;out.words=new Array(len);for(let i=0;i>>0===bits,"bits","uint32");const r=this.mul(num);const b=r.utestn(bits-1);r.iushrn(bits);if(this.negative^num.negative)return r.isubn(b);return r.iaddn(b)}_div(num,flags){enforce(BN.isBN(num),"num","bignum");assert((flags&modes.ALL)===flags);assert(flags!==modes.NONE);const a=this;const b=num;nonzero(!b.isZero());if(a.isZero())return[new BN(0),new BN(0)];const as=a.negative;const bs=b.negative;a.negative=0;b.negative=0;let q=null;let r=null;if(a.ucmp(b)<0){if(flags&modes.QUO)q=new BN(0);if(flags&modes.REM)r=a.clone()}else if(b.length===1){if(flags&modes.QUO)q=a.quon(b.words[0]);if(flags&modes.REM)r=a.remn(b.words[0])}else{[q,r]=a._wordDiv(b,flags)}a.negative=as;b.negative=bs;if(flags&modes.QUO){q.negative=a.negative^b.negative;q._normalize()}if(flags&modes.REM){r.negative=a.negative;r._normalize()}if(flags&modes.EUCLID){if(flags&modes.QUO){assert((flags&modes.REM)!==0);if(r.negative!==0){if(b.negative!==0)q.iaddn(1);else q.isubn(1)}}if(flags&modes.REM){if(r.negative!==0){if(b.negative!==0)r.isub(b);else r.iadd(b)}}}return[q,r]}_wordDiv(num,flags){let a=this.clone();let b=num;let q=null;let hi;const word=b.words[b.length-1]|0;const shift=26-countBits(word);if(shift!==0){b=b.clone();a.iushln(shift);b.iushln(shift);hi=b.words[b.length-1]|0}else{hi=word}const m=a.length-b.length;assert(m>=0);if(flags&modes.QUO){q=new BN(0);q.length=m+1;q.words=new Array(q.length);for(let i=0;i=0;j--){const ahi=a.words[b.length+j];const alo=a.words[b.length+j-1];const quo=(ahi*67108864+alo)/hi|0;let qj=Math.min(quo,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj-=1;a.negative=0;a._ishlnsubmul(b,1,j);a.ineg()}if(q)q.words[j]=qj}if(q)q._strip();if(flags&modes.REM&&shift!==0)a.iushrn(shift);return[q,a]}_ishlnsubmul(num,mul,shift){let carry=0;let i=0;this._expand(num.length+shift);for(;i>26)-(r/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this._strip();assert(carry===-1);carry=0;for(let i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this._strip()}quorem(num){return this._div(num,modes.BOTH)}iquo(num){return this.quo(num)._move(this)}iquon(num){enforce(isSMI(num),"num","smi");nonzero(num!==0);const neg=num<0|0;if(neg)num=-num;let carry=0;for(let i=this.length-1;i>=0;i--){const w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}this.negative^=neg;return this._strip()}quo(num){return this._div(num,modes.QUO)[0]}quon(num){return this.clone().iquon(num)}irem(num){return this.rem(num)._move(this)}iremn(num){let m=this.remrn(num);if(m<0)m=-m;this.words[0]=m;this.length=1;return this._normalize()}rem(num){return this._div(num,modes.REM)[1]}remn(num){return this.clone().iremn(num)}remrn(num){enforce(isSMI(num),"num","smi");nonzero(num!==0);if(num<0)num=-num;const p=(1<<26)%num;let acc=0;for(let i=this.length-1;i>=0;i--)acc=(p*acc+(this.words[i]|0))%num;return this.negative!==0?-acc|0:acc}divmod(num){return this._div(num,modes.BOTH|modes.EUCLID)}idiv(num){return this.div(num)._move(this)}idivn(num){if(this.negative===0)return this.iquon(num);const r=this.remrn(num);this.iquon(num);if(r<0){if(num<0)this.iaddn(1);else this.isubn(1)}return this}div(num){return this._div(num,modes.BOTH|modes.EUCLID)[0]}divn(num){return this.clone().idivn(num)}imod(num){if(this.ucmp(num)<0){if(this.negative!==0){this._isub(num,this);this.negative=0}return this}return this.mod(num)._move(this)}imodn(num){this.words[0]=this.modrn(num);this.length=1;this.negative=0;return this}mod(num){return this._div(num,modes.REM|modes.EUCLID)[1]}modn(num){return this.clone().imodn(num)}modrn(num){enforce(isSMI(num),"num","smi");let r=this.remrn(num);if(r<0){if(num<0)r-=num;else r+=num}return r}divRound(num){const[q,r]=this.quorem(num);if(r.isZero())return q;const bit=num.words[0]&1;num.iushrn(1);const cmp=r.ucmp(num);num.iushln(1);num.words[0]|=bit;if(cmp<0||num.isOdd()&&cmp===0)return q;if(this.negative^num.negative)return q.isubn(1);return q.iaddn(1)}ipow(num){return this.pow(num)._move(this)}ipown(num){return this.pown(num)._move(this)}pow(num){enforce(BN.isBN(num),"num","bignum");let b=countBits(num.words[num.length-1]);let r=new BN(1);for(let i=num.length-1;i>=0;i--){const word=num.words[i];for(let j=b-1;j>=0;j--){r=r.sqr();if(word>>j&1)r=r.mul(this)}b=26}return r}pown(num){enforce(isSMI(num),"num","smi");if(num<0)num=-num;if(num===0)return new BN(1);if(num===1)return this.clone();const bits=countBits(num);let r=this;for(let i=bits-2;i>=0;i--){r=r.sqr();if(num>>i&1)r=r.mul(this)}return r}isqr(){return this.imul(this)}sqr(){return this.mul(this)}_rootrem(pow,rem){enforce(pow>>>0===pow,"num","uint32");if(pow===0)throw new RangeError("Zeroth root.");if(~pow&this.negative)throw new RangeError("Negative with even root.");if(this.ucmpn(1)<=0)return[this.clone(),new BN(0)];let u=new BN(0);let t=BN.shift(1,this.bitLength()/pow+1|0);let v,r;if(this.negative!==0)t.ineg();if(pow===2){do{u=t;t=this.quo(u);t.iadd(u);t.iushrn(1)}while(t.ucmp(u)<0)}else{do{u=t;t=u.pown(pow-1);t=this.quo(t);v=u.muln(pow-1);t.iadd(v);t=t.quon(pow)}while(t.ucmp(u)<0)}if(rem){t=u.pown(pow);r=this.sub(t)}return[u,r]}rootrem(pow){return this._rootrem(pow,1)}iroot(pow){return this.root(pow)._move(this)}root(pow){return this._rootrem(pow,0)[0]}isPower(pow){enforce(pow>>>0===pow,"num","uint32");if(pow===0||~pow&this.negative)return false;const[,r]=this.rootrem(pow);return r.sign()===0}sqrtrem(){return this.rootrem(2)}isqrt(){return this.sqrt()._move(this)}sqrt(){return this.root(2)}isSquare(){return this.isPower(2)}iand(num){enforce(BN.isBN(num),"num","bignum");let x=this;let y=num;if(x===y)return x;if((x.negative|y.negative)===0)return x.iuand(y);if((x.negative&y.negative)===1){x.iaddn(1);y.iaddn(1);x.iuor(y);x.isubn(1);y.isubn(1);return x}if(x.negative!==0)[x,y]=[y.clone(),x];const width=x.bitLength();y.iaddn(1);y.inotn(width);x.iuand(y);y.inotn(width);y.isubn(1);return x._move(this)}iandn(num){enforce(isSMI(num),"num","smi");if((this.negative|num<0)!==0)return this.iand(new BN(num));this.words[0]&=num;this.length=1;return this}and(num){return this.clone().iand(num)}andn(num){return this.clone().iandn(num)}andrn(num){enforce(isSMI(num),"num","smi");if((this.negative|num<0)!==0){const n=this.iand(new BN(num));if(n.length>1)throw new RangeError("Number exceeds 26 bits.");return n.negative!==0?-n.words[0]:n.words[0]}return this.words[0]&num}iuand(num){enforce(BN.isBN(num),"num","bignum");this.length=Math.min(this.length,num.length);for(let i=0;i>>0===width,"width","uint32");const r=width%26;let s=Math.ceil(width/26);let i=0;this._expand(s);if(r>0)s-=1;for(;i0)this.words[i]^=(1<>>0===bits,"bits","uint32");const r=bits%26;const s=(bits-r)/26;const mask=(1<>>26-r}if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}}if(s!==0){this._alloc(this.length+s);for(let i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(let i=0;is){this.length-=s;for(let i=0;i=0;i--){const word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}}if(output){if(carry!==0){output._alloc(output.length+1);output.words[output.length++]=carry}else{if(output.length===0)output.words[output.length++]=0;output._strip()}}return this._strip()}ishr(num){enforce(BN.isBN(num),"bits","bignum");enforce(num.bitLength()<=32,"bits","uint32");return this.ishrn(num.toNumber())}ishrn(bits){enforce(bits>>>0===bits,"bits","uint32");if(this.negative!==0){this.iaddn(1);this.iushrn(bits);this.isubn(1);return this}return this.iushrn(bits)}shr(num){return this.clone().ishr(num)}shrn(bits){return this.clone().ishrn(bits)}iushr(num){enforce(BN.isBN(num),"bits","bignum");enforce(num.bitLength()<=32,"bits","uint32");return this.iushrn(num.toNumber())}iushrn(bits){enforce(bits>>>0===bits,"bits","uint32");return this._split(bits,null)}ushr(num){return this.clone().iushr(num)}ushrn(bits){return this.clone().iushrn(bits)}setn(bit,val){enforce(bit>>>0===bit,"bit","uint32");if(this.negative!==0){this.iaddn(1);this.usetn(bit,!val);this.isubn(1);return this}return this.usetn(bit,val)}usetn(bit,val){enforce(bit>>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;this._expand(s+1);if(val)this.words[s]|=1<>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;if(this.length<=s)return this.negative;const w=this.words[s];const val=w>>r&1;if(this.negative!==0){if(r>0&&w&(1<0)return val^1}}return val}utestn(bit){enforce(bit>>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;if(this.length<=s)return 0;return this.words[s]>>r&1}imaskn(bits){enforce(bits>>>0===bits,"bits","uint32");if(this.negative!==0){this.iaddn(1);this.inotn(bits+1);this.ineg()}return this.iumaskn(bits)}maskn(bits){return this.clone().imaskn(bits)}iumaskn(bits){enforce(bits>>>0===bits,"bits","uint32");const r=bits%26;let s=(bits-r)/26;if(this.length<=s)return this;if(r!==0)s+=1;this.length=Math.min(s,this.length);if(r!==0)this.words[this.length-1]&=(1<>>0===pos,"pos","uint32");enforce(width>>>0===width,"width","uint32");enforce(width<=26,"width","width");const shift=pos%26;const index=(pos-shift)/26;if(index>=this.length)return 0;let bits=this.words[index]>>shift&(1<26&&index+10}gtn(num){return this.cmpn(num)>0}gte(num){return this.cmp(num)>=0}gten(num){return this.cmpn(num)>=0}lt(num){return this.cmp(num)<0}ltn(num){return this.cmpn(num)<0}lte(num){return this.cmp(num)<=0}lten(num){return this.cmpn(num)<=0}sign(){if(this.negative!==0)return-1;if(this.length===1&&this.words[0]===0)return 0;return 1}isZero(){return this.length===1&&this.words[0]===0}isNeg(){return this.negative!==0}isPos(){return this.negative===0}isOdd(){return(this.words[0]&1)===1}isEven(){return(this.words[0]&1)===0}ucmp(num){enforce(BN.isBN(num),"num","bignum");if(this.lengthnum.length)return 1;for(let i=this.length-1;i>=0;i--){const a=this.words[i]|0;const b=num.words[i]|0;if(a===b)continue;return(a>b)-(a1)return 1;const w=this.words[0]|0;if(num<0)num=-num;return(w>num)-(w=0)a.imod(b);while(!a.isZero()){const bits=a._makeOdd();if(bits&1){const bmod8=b.andln(7);if(bmod8===3||bmod8===5)j=-j}if(a.ucmp(b)<0){[a,b]=[b,a];if(a.andln(3)===3&&b.andln(3)===3)j=-j}a._isub(a,b).iushrn(1);const bmod8=b.andln(7);if(bmod8===3||bmod8===5)j=-j}if(b.cmpn(1)!==0)return 0;return j}kronecker(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero())return num.ucmpn(1)===0?1:0;if(num.isZero())return this.ucmpn(1)===0?1:0;if(((this.words[0]|num.words[0])&1)===0)return 0;const x=this;const y=num.clone();const bits=y._makeOdd();const table=[0,1,0,-1,0,-1,0,1];let k=x.jacobi(y);if(bits&1)k*=table[x.andln(7)];return k|0}igcd(num){return this.gcd(num)._move(this)}gcd(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero())return num.abs();if(num.isZero())return this.abs();let a=this.clone();let b=num.clone();a.negative=0;b.negative=0;const shift=a._factor2(b);if(shift!==0){a.iushrn(shift);b.iushrn(shift)}for(;;){a._makeOdd();b._makeOdd();const cmp=a.ucmp(b);if(cmp<0){[a,b]=[b,a]}else if(cmp===0||b.ucmpn(1)===0){break}a._isub(a,b)}return b.iushln(shift)}ilcm(num){return this.lcm(num)._move(this)}lcm(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero()||num.isZero())return new BN(0);return this.quo(this.gcd(num)).mul(num).iabs()}egcd(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero()){return[new BN(0),new BN(num.sign()),num.abs()]}if(num.isZero()){return[new BN(this.sign()),new BN(0),this.abs()]}const x=this.clone();const y=num.clone();x.negative=0;y.negative=0;const A=new BN(1);const B=new BN(0);const C=new BN(0);const D=new BN(1);const g=x._factor2(y);if(g>0){x.iushrn(g);y.iushrn(g)}const xp=x.clone();const yp=y.clone();while(!x.isZero()){let i=x._makeOdd();let j=y._makeOdd();while(i--){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}while(j--){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}if(this.negative!==0)C.ineg();if(num.negative!==0)D.ineg();return[C,D,y.iushln(g)]}iinvert(num){return this.invert(num)._move(this)}invert(num){enforce(BN.isBN(num),"num","bignum");range(num.sign()>0,"invert");if(num.isOdd())return this._invertp(num);if(num.cmpn(1)===0)throw new RangeError("Not invertible.");const[s,,g]=this.egcd(num);if(g.cmpn(1)!==0)throw new RangeError("Not invertible.");return s.imod(num)}ifermat(num){return this.fermat(num)._move(this)}fermat(num){const red=HAS_BIGINT?BN.red(num):BN.mont(num);return this.toRed(red).redFermat().fromRed()}ipowm(y,m,mont){return this.powm(y,m,mont)._move(this)}powm(y,m,mont){const red=!HAS_BIGINT&&mont?BN.mont(m):BN.red(m);return this.toRed(red).redPow(y).fromRed()}ipowmn(y,m,mont){return this.powmn(y,m,mont)._move(this)}powmn(y,m,mont){const red=mont?BN.mont(m):BN.red(m);return this.toRed(red).redPown(y).fromRed()}isqrtm(p){return this.sqrtm(p)._move(this)}sqrtm(p){enforce(BN.isBN(p),"p","bignum");let red;if(p.andln(3)===3||p.andln(7)===5){red=BN.red(p)}else{red=BN.mont(p)}return this.toRed(red).redSqrt().fromRed()}isqrtpq(p,q){return this.sqrtpq(p,q)._move(this)}sqrtpq(p,q){const sp=this.sqrtm(p);const sq=this.sqrtm(q);const[mp,mq]=p.egcd(q);const lhs=sq.mul(mp).mul(p);const rhs=sp.mul(mq).mul(q);const n=p.mul(q);return lhs.iadd(rhs).imod(n)}isPrime(rng,reps,limit){enforce(reps>>>0===reps,"reps","uint32");if(!this.isPrimeMR(rng,reps+1,true))return false;if(!this.isPrimeLucas(limit))return false;return true}isPrimeMR(rng,reps,force2=false){enforce(reps>>>0===reps,"reps","uint32");enforce(reps>0,"reps","integer");enforce(typeof force2==="boolean","force2","boolean");const n=this;if(n.cmpn(7)<0){return n.cmpn(2)===0||n.cmpn(3)===0||n.cmpn(5)===0}if(n.isEven())return false;const nm1=n.subn(1);const nm3=nm1.subn(2);const k=nm1.zeroBits();const q=nm1.ushrn(k);const red=BN.red(n);const rnm1=nm1.toRed(red);const rone=new BN(1).toRed(red);next:for(let i=0;i>>0===limit,"limit","uint32");const n=this;if(n.cmpn(1)<=0)return false;if(n.isEven())return n.cmpn(2)===0;let p=3;for(;;){if(p>1e4){throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`)}if(limit!==0&&p>limit){return false}const d=new BN(p*p-4);const j=d.jacobi(n);if(j===-1)break;if(j===0)return n.cmpn(p+2)===0;if(p===40){if(n.isSquare())return false}p+=1}const s=n.addn(1);const r=s._makeOdd();let vk=new BN(2);let vk1=new BN(p);for(let i=s.bitLength();i>=0;i--){if(s.utestn(i)){vk=vk.mul(vk1).isubn(p).imod(n);vk1=vk1.sqr().isubn(2).imod(n)}else{vk1=vk1.mul(vk).isubn(p).imod(n);vk=vk.sqr().isubn(2).imod(n)}}if(vk.cmpn(2)===0||vk.cmp(n.subn(2))===0){const a=vk.muln(p).imod(n);const b=vk1.ushln(1).imod(n);if(a.cmp(b)===0)return true}for(let t=0;t>>0===width,"width","uint32");range(width>0,"width");if(this.testn(width-1))return this.notn(width).iaddn(1).ineg();return this.clone()}toRed(ctx){enforce(ctx instanceof Red,"ctx","reduction context");if(this.red)throw new Error("Already in reduction context.");return ctx.convertTo(this)}fromRed(){red(this.red,"fromRed");return this.red.convertFrom(this)}forceRed(ctx){enforce(ctx instanceof Red,"ctx","reduction context");if(this.red){if(!ctx.m.eq(this.red.m)||ctx.mont!==this.red.mont)throw new Error("Already in reduction context.")}else{range(this.negative===0,"red");range(this.ucmp(ctx.m)<0,"red")}return this.clone()._forceRed(ctx)}redIAdd(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIAdd");return this.red.iadd(this,num)}redAdd(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redAdd");return this.red.add(this,num)}redIAddn(num){enforce(isSMI(num),"num","smi");red(this.red,"redIAddn");return this.red.iaddn(this,num)}redAddn(num){enforce(isSMI(num),"num","smi");red(this.red,"redAddn");return this.red.addn(this,num)}redISub(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redISub");return this.red.isub(this,num)}redSub(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redSub");return this.red.sub(this,num)}redISubn(num){enforce(isSMI(num),"num","smi");red(this.red,"redISubn");return this.red.isubn(this,num)}redSubn(num){enforce(isSMI(num),"num","smi");red(this.red,"redSubn");return this.red.subn(this,num)}redIMul(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIMul");return this.red.imul(this,num)}redMul(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redMul");return this.red.mul(this,num)}redIMuln(num){enforce(isSMI(num),"num","smi");red(this.red,"redIMuln");return this.red.imuln(this,num)}redMuln(num){enforce(isSMI(num),"num","smi");red(this.red,"redMuln");return this.red.muln(this,num)}redIDiv(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIDiv");return this.red.idiv(this,num)}redDiv(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redDiv");return this.red.div(this,num)}redIDivn(num){enforce(isSMI(num),"num","smi");red(this.red,"redIDivn");return this.red.idivn(this,num)}redDivn(num){enforce(isSMI(num),"num","smi");red(this.red,"redDivn");return this.red.divn(this,num)}redIPow(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIPow");nonred(!num.red,"redIPow");return this.red.ipow(this,num)}redPow(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redPow");nonred(!num.red,"redPow");return this.red.pow(this,num)}redIPown(num){enforce(isSMI(num),"num","smi");red(this.red,"redIPown");return this.red.ipown(this,num)}redPown(num){enforce(isSMI(num),"num","smi");red(this.red,"redPown");return this.red.pown(this,num)}redISqr(){red(this.red,"redISqr");return this.red.isqr(this)}redSqr(){red(this.red,"redSqr");return this.red.sqr(this)}redISqrt(){red(this.red,"redISqrt");return this.red.isqrt(this)}redSqrt(){red(this.red,"redSqrt");return this.red.sqrt(this)}redIDivSqrt(v){red(this.red,"redIDivSqrt");return this.red.idivsqrt(this,v)}redDivSqrt(v){red(this.red,"redDivSqrt");return this.red.divsqrt(this,v)}redIsSquare(){red(this.red,"redIsSquare");return this.red.isSquare(this)}redIShl(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIShl");nonred(!num.red,"redIShl");return this.red.ishl(this,num)}redShl(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redShl");nonred(!num.red,"redShl");return this.red.shl(this,num)}redIShln(num){enforce(num>>>0===num,"num","uint32");red(this.red,"redIShln");return this.red.ishln(this,num)}redShln(num){enforce(num>>>0===num,"num","uint32");red(this.red,"redShln");return this.red.shln(this,num)}redINeg(){red(this.red,"redINeg");return this.red.ineg(this)}redNeg(){red(this.red,"redNeg");return this.red.neg(this)}redEq(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redEq");return this.red.eq(this,num)}redEqn(num){enforce(isSMI(num),"num","smi");red(this.red,"redEqn");return this.red.eqn(this,num)}redIsHigh(){red(this.red,"redIsHigh");return this.red.isHigh(this)}redIsLow(){red(this.red,"redIsLow");return this.red.isLow(this)}redIsOdd(){red(this.red,"redIsOdd");return this.red.isOdd(this)}redIsEven(){red(this.red,"redIsEven");return this.red.isEven(this)}redLegendre(){red(this.red,"redLegendre");return this.red.legendre(this)}redJacobi(){red(this.red,"redJacobi");return this.red.jacobi(this)}redKronecker(){red(this.red,"redKronecker");return this.red.kronecker(this)}redIInvert(){red(this.red,"redIInvert");return this.red.iinvert(this)}redInvert(){red(this.red,"redInvert");return this.red.invert(this)}redIFermat(){red(this.red,"redIFermat");return this.red.ifermat(this)}redFermat(){red(this.red,"redFermat");return this.red.fermat(this)}_move(dest){dest.words=this.words;dest.length=this.length;dest.negative=this.negative;dest.red=this.red;return dest}_alloc(size){while(this.words.length1&&this.words[this.length-1]===0)this.length-=1;return this._normalize()}_normalize(){assert(this.length>0);if(this.length===1&&this.words[0]===0)this.negative=0;return this}_check(){assert(this.length>0);assert(this.length<=this.words.length);if(this.length===1){if(this.words[0]===0)assert(this.negative===0);return this}assert(this.words[this.length-1]!==0);return this}_invertp(p){enforce(BN.isBN(p),"p","bignum");range(p.sign()>0,"invert");assert(p.isOdd());if(p.cmpn(1)===0)throw new RangeError("Not invertible.");const a=this.clone();const b=p.clone();const u=new BN(1);const v=new BN(0);if(a.isNeg()||a.ucmp(b)>=0)a.imod(b);while(!a.isZero()){let i=a._makeOdd();let j=b._makeOdd();while(i--){if(u.isOdd())u._iadd(u,p);u.iushrn(1)}while(j--){if(v.isOdd())v._iadd(v,p);v.iushrn(1)}if(a.ucmp(b)>=0){a._isub(a,b);if(u.ucmp(v)<0){u._isub(v,u);u._isub(p,u)}else{u._isub(u,v)}}else{b._isub(b,a);if(v.ucmp(u)<0){v._isub(u,v);v._isub(p,v)}else{v._isub(v,u)}}}if(b.cmpn(1)!==0)throw new RangeError("Not invertible.");assert(v.negative===0);assert(v.ucmp(p)<0);return v}_makeOdd(){const shift=this.zeroBits();if(shift>0)this.iushrn(shift);return shift}_factor2(num){if((this.words[0]|num.words[0])&1)return 0;const len=Math.min(this.length,num.length);let r=0;for(let i=0;i>>0===pos,"pos","uint32");if(pos>=this.length)return 0;return this.words[pos]}[custom](){let prefix="BN";if(this.red)prefix="BN-R";return`<${prefix}: ${this.toString(10)}>`}toNumber(){let num=this.words[0];if(this.length===2){num+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){num+=4503599627370496+this.words[1]*67108864}else if(this.length>2){throw new RangeError("Number can only safely store up to 53 bits.")}return this.negative!==0?-num:num}toDouble(){let num=0;for(let i=this.length-1;i>=0;i--)num=num*67108864+this.words[i];return this.negative!==0?-num:num}valueOf(){return this.toDouble()}toBigInt(){if(!HAS_BIGINT)throw new Error("BigInt is not supported!");const s52=BigInt(52);const s26=BigInt(26);let i=this.length-1;let num=BigInt(0);for(;i>=1;i-=2){const hi=this.words[i]*67108864;const lo=this.words[i-1];num=num<=0)num=num<>>0===base,"base","uint32");enforce(padding>>>0===padding,"padding","uint32");if(base<2||base>36)throw new RangeError("Base ranges between 2 and 36.");this._check();if(base===16){let out="";let off=0;let carry=0;for(let i=0;i>>24-off&16777215;if(carry!==0||i!==this.length-1)out=zeros[6-word.length]+word+out;else out=word+out;off+=2;if(off>=26){off-=26;i-=1}}if(carry!==0)out=carry.toString(16)+out;while(out.length%padding!==0)out="0"+out;if(this.negative!==0)out="-"+out;return out}const groupSize=groupSizes[base-1];const groupBase=groupBases[base-1];const c=this.clone();let out="";c.negative=0;while(!c.isZero()){const r=c.remrn(groupBase).toString(base);c.iquon(groupBase);if(!c.isZero())out=zeros[groupSize-r.length]+r+out;else out=r+out}if(this.isZero())out="0";while(out.length%padding!==0)out="0"+out;if(this.negative!==0)out="-"+out;return out}toJSON(){return this.toString(16,2)}toArray(endian,length){return this.toArrayLike(Array,endian,length)}toBuffer(endian,length){return this.toArrayLike(bufferExports.Buffer,endian,length)}toArrayLike(ArrayType,endian,length){if(endian==null)endian="be";if(length==null)length=0;enforce(typeof ArrayType==="function","ArrayType","function");enforce(endian==="be"||endian==="le","endian","endianness");enforce(length>>>0===length,"length","uint32");this._check();const bytes=this.byteLength();const size=length||Math.max(1,bytes);if(bytes>size)throw new RangeError("Byte array longer than desired length.");const res=allocate(ArrayType,size);if(endian==="be"){let pos=res.length-1;let carry=0;for(let i=0;i=0)res[pos--]=word>>>8&255;if(pos>=0)res[pos--]=word>>>16&255;if(shift===6){if(pos>=0)res[pos--]=word>>>24&255;carry=0}else{carry=word>>>24}}if(pos>=0){res[pos--]=carry;while(pos>=0)res[pos--]=0;carry=0}assert(carry===0)}else{let pos=0;let carry=0;for(let i=0;i>>8&255;if(pos>>16&255;if(shift===6){if(pos>>24&255;carry=0}else{carry=word>>>24}}if(pos0){const lo=num%67108864;const hi=(num-lo)/67108864;this.words.push(lo);num=hi}if(this.words.length===0)this.words.push(0);this.length=this.words.length;this.negative=neg;if(endian==="le")this.reverse();return this}fromBigInt(num,endian){if(endian==null)endian="be";enforce(typeof num==="bigint","num","bigint");enforce(endian==="be"||endian==="le","endian","endianness");if(!HAS_BIGINT)throw new Error("BigInt is not supported!");const start=num>>0===base,"base","uint32");enforce(endian==="be"||endian==="le","endian","endianness");if(base<2||base>36)throw new Error("Base ranges between 2 and 36.");str=str.replace(/\s+/g,"");let start=0;if(str.length>0&&str.charCodeAt(0)===45)start=1;if(base===16)this._fromHex(str,start);else this._fromBase(str,base,start);this.negative=start;this._normalize();if(endian==="le")this.reverse();return this}_fromHex(str,start){this.length=Math.max(2,Math.ceil((str.length-start)/6));this.words=new Array(this.length);for(let i=0;i=start;i-=6){const w=parseHex(str,i,i+6);this.words[j]|=w<>>26-off&4194303;off+=24;if(off>=26){off-=26;j+=1}}if(i+6!==start){const w=parseHex(str,start,i+6);this.words[j]|=w<>>26-off&4194303}return this._strip()}_fromBase(str,base,start){this.words[0]=0;this.length=1;this.negative=0;let limbLen=0;let limbPow=1;for(;limbPow<=67108863;limbPow*=base)limbLen+=1;limbLen-=1;limbPow=limbPow/base|0;const total=str.length-start;const mod=total%limbLen;const end=Math.min(total,total-mod)+start;let i=start;for(;i>>0===data.length,"data","array-like");enforce(endian==="be"||endian==="le","endian","endianness");if(data.length===0){this.words[0]=0;this.length=1;this.negative=0;return this}this.length=Math.max(2,Math.ceil(data.length/3));this.words=new Array(this.length);this.negative=0;for(let i=0;i=2;i-=3){const w=data[i]|data[i-1]<<8|data[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j+=1}}switch(left){case 2:w=data[1]|data[0]<<8;break;case 1:w=data[0];break}}else{const len=data.length-left;for(let i=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j+=1}}switch(left){case 2:w=data[len]|data[len+1]<<8;break;case 1:w=data[len];break}}if(left>0){this.words[j]|=w<>>26-off&67108863}return this._strip()}decode(data,endian){return this.fromBuffer(data,endian)}from(num,base,endian){if(num==null)return this;if(base==="le"||base==="be")[base,endian]=[endian,base];if(typeof num==="number")return this.fromNumber(num,endian);if(typeof num==="bigint")return this.fromBigInt(num,endian);if(typeof num==="string")return this.fromString(num,base,endian);if(typeof num==="object"){if(BN.isBN(num))return this.fromBN(num,endian);if(num.length>>>0===num.length)return this.fromArrayLike(num,endian)}if(typeof num==="boolean")return this.fromBool(num);throw new TypeError("Non-numeric object passed to BN.")}static min(...args){let min=null;for(const num of args){enforce(BN.isBN(num),"num","bignum");if(!min||num.cmp(min)<0)min=num}return min||new BN(0)}static max(...args){let max=null;for(const num of args){enforce(BN.isBN(num),"num","bignum");if(!max||num.cmp(max)>0)max=num}return max||new BN(0)}static cmp(a,b){enforce(BN.isBN(a),"a","bignum");return a.cmp(b)}static ucmp(a,b){enforce(BN.isBN(a),"a","bignum");return a.ucmp(b)}static red(num){return new Red(num)}static barrett(num){return new Barrett(num)}static mont(num){return new Mont(num)}static _prime(name){if(primes[name])return primes[name];let prime;if(name==="p192")prime=new P192;else if(name==="p224")prime=new P224;else if(name==="p521")prime=new P521;else if(name==="k256")prime=new K256;else if(name==="p251")prime=new P251;else if(name==="p25519")prime=new P25519;else if(name==="p448")prime=new P448;else throw new Error(`Unknown prime: "${name}".`);primes[name]=prime;return prime}static prime(name){return BN._prime(name).p.clone()}static pow(num,exp){if(num===2)return BN.shift(1,exp);return(new BN).fromNumber(num).pown(exp)}static shift(num,bits){if(num===1)return new BN(0).usetn(bits,1);return(new BN).fromNumber(num).ishln(bits)}static mask(bits){return BN.shift(1,bits).isubn(1)}static randomBits(rng,bits){enforce(rng!=null,"rng","rng");enforce(bits>>>0===bits,"bits","uint32");if(typeof rng==="object"){enforce(typeof rng.randomBytes==="function","rng","rng");const size=bits+7>>>3;const total=size*8;const bytes=rng.randomBytes(size);enforce(bufferExports.Buffer.isBuffer(bytes),"bytes","buffer");if(bytes.length!==size)throw new RangeError("Invalid number of bytes returned from RNG.");const num=BN.fromBuffer(bytes);if(total>bits)num.iushrn(total-bits);return num}enforce(typeof rng==="function","rng","rng");const num=rng(bits);enforce(BN.isBN(num),"num","bignum");range(num.negative===0,"RNG");nonred(!num.red,"RNG");if(num.bitLength()>bits)throw new RangeError("Invalid number of bits returned from RNG.");return num}static random(rng,min,max){min=BN.cast(min,16);max=BN.cast(max,16);if(min.cmp(max)>0)throw new RangeError("Minimum cannot be greater than maximum.");const space=max.sub(min).iabs();const bits=space.bitLength();if(bits===0)return min.clone();for(;;){const num=BN.randomBits(rng,bits);if(num.cmp(space)>=0)continue;num.iadd(min);return num}}static of(num,endian){return(new BN).of(num,endian)}static fromNumber(num,endian){return(new BN).fromNumber(num,endian)}static fromDouble(num,endian){return(new BN).fromDouble(num,endian)}static fromBigInt(num,endian){return(new BN).fromBigInt(num,endian)}static fromBool(value){return(new BN).fromBool(value)}static fromString(str,base,endian){return(new BN).fromString(str,base,endian)}static fromJSON(json){return(new BN).fromJSON(json)}static fromBN(num){return(new BN).fromBN(num)}static fromArray(data,endian){return(new BN).fromArray(data,endian)}static fromBuffer(data,endian){return(new BN).fromBuffer(data,endian)}static fromArrayLike(data,endian){return(new BN).fromArrayLike(data,endian)}static decode(data,endian){return(new BN).decode(data,endian)}static from(num,base,endian){return(new BN).from(num,base,endian)}static cast(num,base,endian){if(BN.isBN(num))return num;return new BN(num,base,endian)}static isBN(obj){return obj instanceof BN}}BN.BN=BN;BN.wordSize=26;BN.native=0;class Prime{constructor(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=BN.shift(1,this.n).isub(this.p);this.lo=this.p.clone();this.one=this.p.clone()}ireduce(num){const neg=num.negative!==0;let bits=num.bitLength();assert(bits<=this.n*2);num.negative=0;while(bits>this.n){this.split(num,this.lo);this.imulK(num);num._iadd(num,this.lo);bits=num.bitLength()}const cmp=bits0){num._isub(num,this.p)}else;if(neg&&!num.isZero())num._isub(this.p,num);return num}split(input,out){input._split(this.n,out)}imulK(num){return num.imul(this.k)}pm2(x1){throw new Error("Not implemented.")}fermat(x){return this.pm2(x)}}class Prime34 extends Prime{constructor(name,p){super(name,p)}pm3d4(x1){throw new Error("Not implemented.")}pp1d4(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;const r=this.pp1d4(x);if(!red.sqr(r).eq(x))throw new SquareRootError(r);return r}divsqrt(u,v){const{red}=u;const u2=red.sqr(u);const u3=red.mul(u2,u);const u5=red.mul(u3,u2);const v3=red.mul(red.sqr(v),v);const p=this.pm3d4(red.mul(u5,v3));const x=red.mul(red.mul(u3,v),p);const c=red.mul(v,red.sqr(x));if(c.eq(u))return x;throw new SquareRootError(x)}}class Prime58 extends Prime{constructor(name,p,sm1){super(name,p);this.sm1=new BN(sm1,16)}pm5d8(x1){throw new Error("Not implemented.")}pp3d8(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;const sm1=this.sm1._forceRed(red);const r=this.pp3d8(x);if(red.sqr(r).eq(x))return r;const c=red.mul(r,sm1);if(red.sqr(c).eq(x))return c;throw new SquareRootError(r)}divsqrt(u,v){const{red}=u;const sm1=this.sm1._forceRed(red);const v3=red.mul(red.sqr(v),v);const v7=red.mul(red.sqr(v3),v);const p=this.pm5d8(red.mul(u,v7));const x=red.mul(red.mul(u,v3),p);const c=red.mul(v,red.sqr(x));if(c.eq(u))return x;const mc=red.ineg(c);if(mc.eq(u))return red.mul(x,sm1);if(mc.eq(red.mul(u,sm1)))throw new SquareRootError(red.mul(x,sm1));throw new SquareRootError(x)}}class Prime116 extends Prime{constructor(name,p,g){super(name,p);this.g=new BN(g,16);this.z=this.p.subn(1).zeroBits()}powS(x1){throw new Error("Not implemented.")}powE(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;switch(red.jacobi(x)){case-1:throw new SquareRootError(x);case 0:return x.clone()}let g=this.g._forceRed(red);let y=this.powE(x);let b=this.powS(x);let k=this.z;for(;;){let t=b;let m=0;while(t.cmpn(1)!==0&&m>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10)input.length-=10;else input.length-=9;input._strip()}imulK(num){num._expand(num.length+2);let lo=0;for(let i=0;i>>26;num.words[i]=w&67108863}if(carry!==0){num._alloc(num.length+1);num.words[num.length++]=carry}return num}core(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const x3=red.sqrnmul(x2,1,x1);const x6=red.sqrnmul(x3,3,x3);const x12=red.sqrnmul(x6,6,x6);const x24=red.sqrnmul(x12,12,x12);const x48=red.sqrnmul(x24,24,x24);const x96=red.sqrnmul(x48,48,x48);const x192=red.sqrnmul(x96,96,x96);const x240=red.sqrnmul(x192,48,x48);const x246=red.sqrnmul(x240,6,x6);const x247=red.sqrnmul(x246,1,x1);return x247}pm3d4(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pm2(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);const r3=red.sqrn(r2,1);const r4=red.sqrnmul(r3,1,x1);return r4}pp1d4(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrnmul(r0,1,x1);const r2=red.sqrn(r1,1);return r2}}class P25519 extends Prime58{constructor(){super("p25519","7fffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff ffffffff ffffffed","2b832480 4fc1df0b 2b4d0099 3dfbd7a7"+"2f431806 ad2fe478 c4ee1b27 4a0ea0b0")}imulK(num){let carry=0;for(let i=0;i>>26;num.words[i]=w&67108863}if(carry!==0){num._alloc(num.length+1);num.words[num.length++]=carry}return num}core(x1,x2){const{red}=x1;const x4=red.sqrnmul(x2,2,x2);const x5=red.sqrnmul(x4,1,x1);const x10=red.sqrnmul(x5,5,x5);const x20=red.sqrnmul(x10,10,x10);const x40=red.sqrnmul(x20,20,x20);const x50=red.sqrnmul(x40,10,x10);const x100=red.sqrnmul(x50,50,x50);const x200=red.sqrnmul(x100,100,x100);const x250=red.sqrnmul(x200,50,x50);return x250}pm5d8(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pm2(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);const r3=red.sqrn(r2,1);const r4=red.sqrnmul(r3,2,x2);return r4}pp3d8(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrnmul(r0,1,x1);const r2=red.sqrn(r1,1);return r2}}class P448 extends Prime34{constructor(){super("p448","ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff fffffffe ffffffff"+"ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff")}imulK(num){const one=this.one.inject(num);return num.iushln(224)._iadd(num,one)}core(x1,x2){const{red}=x1;const x3=red.sqrnmul(x2,1,x1);const x6=red.sqrnmul(x3,3,x3);const x9=red.sqrnmul(x6,3,x3);const x11=red.sqrnmul(x9,2,x2);const x22=red.sqrnmul(x11,11,x11);const x44=red.sqrnmul(x22,22,x22);const x88=red.sqrnmul(x44,44,x44);const x176=red.sqrnmul(x88,88,x88);const x220=red.sqrnmul(x176,44,x44);const x222=red.sqrnmul(x220,2,x2);return x222}pm3d4(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const x222=this.core(x1,x2);const r0=red.sqrnmul(x222,1,x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,222,x222);return r2}pm2(x1){const{red}=x1;const r0=this.pm3d4(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pp1d4(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrnmul(r0,2,x2);const r2=red.sqrn(r1,222);return r2}}class Red{constructor(m){let prime=null;if(typeof m==="string"){prime=BN._prime(m);m=prime.p}enforce(BN.isBN(m),"m","bignum");nonred(!m.red,"reduction");range(m.sign()>0,"reduction");this.m=m;this.prime=prime;this.mb=null;this.sm1=null}_verify1(a){range(a.negative===0,"red");red(a.red!=null,"red")}_verify2(a,b){range((a.negative|b.negative)===0,"red");red(a.red!=null&&a.red===b.red,"red")}get mont(){return false}precompute(){if(this.sm1===null&&this.m.andln(7)===5){if(this.prime){this.sm1=this.prime.sm1.clone()._forceRed(this)}else{const x=new BN(2).toRed(this);const e=this.m.subn(1).iushrn(2);this.sm1=this.pow(x,e)}}return this}convertTo(num){const res=num.mod(this.m);res.red=this;return res}convertFrom(num){const res=num.clone();res.red=null;return res}intTo(a){return a}intFrom(a){return a}imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.imod(this.m)._forceRed(this)}iadd(a,b){this._verify2(a,b);a._iadd(a,b);if(a.ucmp(this.m)>=0)a._isub(a,this.m);return a}add(a,b){if(a.length=0)a._isub(a,this.m);return a}addn(a,num){return this.iaddn(a.clone(),num)}isub(a,b){this._verify2(a,b);const cmp=a.ucmp(b);if(cmp===0){a.words[0]=0;a.length=1;return a}if(cmp<0){a._isub(b,a);a._isub(this.m,a)}else{a._isub(a,b)}return a}sub(a,b){return this.isub(a.clone(),b)}isubn(a,num){this._verify1(a);if(num<0)return this.iaddn(a,-num);if(this.m.length===1)num%=this.m.words[0];if(a.length===1&&a.words[0]=0)a._isub(a,this.m)}else{this.imod(a)}if(neg)this.ineg(a);return a}muln(a,num){return this.imuln(a.clone(),num)}idiv(a,b){return this.div(a,b)._move(a)}div(a,b){return this.mul(a,this.invert(b))}idivn(a,num){return this.divn(a,num)._move(a)}divn(a,num){return this.div(a,this.convertTo(new BN(num)))}ipow(a,num){return this.pow(a,num)._move(a)}pow(a,num){this._verify1(a);if(num.isNeg())a=this.invert(a);if(num.length===1)return this.pown(a,num.words[0]);if(HAS_BIGINT&&!this.prime)return this.powInt(a,num);return this.powNum(a,num)}powNum(a,num){const one=new BN(1).toRed(this);const wnd=new Array(WND_SIZE);const a2=this.sqr(a);wnd[0]=a;for(let i=1;i=WND_WIDTH){let width=WND_WIDTH;let bits=num.bits(i-width,width);if(bits>=1}if(r===one){r=wnd[bits>>1].clone()}else{r=this.sqrn(r,width);r=this.mul(r,wnd[bits>>1])}i-=width}if(i>0){const bits=num.bits(0,i);while(i--){r=this.sqr(r);if(bits>>i&1)r=this.mul(r,a)}}return r}powInt(a,num){if(this.mb===null)this.mb=this.m.toBigInt();const x=this.intFrom(a.toBigInt());const y=powInt(x,num,this.mb);const z=this.intTo(y);return BN.fromBigInt(z)._forceRed(this)}sqrn(a,n){while(n--)a=this.sqr(a);return a}sqrnmul(a,n,b){return this.mul(this.sqrn(a,n),b)}ipown(a,num){return this.pown(a,num)._move(a)}pown(a,num){this._verify1(a);if(num<0){a=this.invert(a);num=-num}if(num===0)return new BN(1).toRed(this);if(num===1)return a.clone();const bits=countBits(num);let r=a;for(let i=bits-2;i>=0;i--){r=this.sqr(r);if(num>>i&1)r=this.mul(r,a)}return r}isqr(a){return this.imul(a,a)}sqr(a){return this.mul(a,a)}isqrt(x){return this.sqrt(x)._move(x)}sqrt(x){this._verify1(x);if(this.prime)return this.prime.sqrt(x);if(this.m.andln(3)===3)return this.sqrt3mod4(x);if(this.m.andln(7)===5){if(this.sm1!=null)return this.sqrt5mod8sm1(x);return this.sqrt5mod8(x)}return this.sqrt0(x)}sqrt3mod4(x){const e=this.m.addn(1).iushrn(2);const b=this.pow(x,e);if(!this.sqr(b).eq(x))throw new SquareRootError(b);return b}sqrt5mod8(x){const one=new BN(1).toRed(this);const e=this.m.ushrn(3);const x2=this.add(x,x);const alpha=this.pow(x2,e);const beta=this.mul(x2,this.sqr(alpha));const b=this.mul(this.mul(alpha,x),this.isub(beta,one));if(!this.sqr(b).eq(x))throw new SquareRootError(b);return b}sqrt5mod8sm1(x){const e=this.m.addn(3).iushrn(3);const b=this.pow(x,e);if(this.sqr(b).eq(x))return b;const c=this.mul(b,this.sm1);if(this.sqr(c).eq(x))return c;throw new SquareRootError(b)}sqrt0(x){if(this.m.cmpn(1)===0||!this.m.isOdd())throw new Error("Invalid prime.");switch(this.jacobi(x)){case-1:throw new SquareRootError(x);case 0:return x.clone()}const one=new BN(1).toRed(this);const s=this.m.subn(1);const e=s._makeOdd();const n=new BN(2).toRed(this);while(this.jacobi(n)!==-1)this.iadd(n,one);let g=this.pow(n,s);let b=this.pow(x,s);let y=this.pow(x,s.iaddn(1).iushrn(1));let k=e;for(;;){let t=b;let m=0;while(!t.eq(one)&&m=0;return this.kronecker(a)>=0}ishl(a,num){this._verify1(a);return this.imod(a.iushl(num))}shl(a,num){return this.ishl(a.clone(),num)}ishln(a,num){this._verify1(a);a.iushln(num);if(num<=4){while(a.ucmp(this.m)>=0)a._isub(a,this.m)}else{this.imod(a)}return a}shln(a,num){return this.ishln(a.clone(),num)}ineg(a){this._verify1(a);if(!a.isZero())a._isub(this.m,a);return a}neg(a){return this.ineg(a.clone())}eq(a,b){this._verify2(a,b);return a.ucmp(b)===0}eqn(a,num){this._verify1(a);if(this.m.length===1){num%=this.m.words[0];if(num<0)num+=this.m.words[0];return a.ucmpn(num)===0}if(num<0){this.m._isubn(-num);const cmp=a.ucmp(this.m);this.m._iaddn(-num);return cmp===0}return a.ucmpn(num)===0}isHigh(a){return!this.isLow(a)}isLow(a){this._verify1(a);return a.ucmp(this.m.ushrn(1))<=0}isOdd(a){this._verify1(a);return a.isOdd()}isEven(a){this._verify1(a);return a.isEven()}legendre(num){this._verify1(num);if(this.m.isEven())throw new Error("legendre: `num` must be odd.");const e=this.m.subn(1).iushrn(1);const symbol=this.pow(num,e);if(symbol.isZero())return 0;const one=new BN(1).toRed(this);if(symbol.eq(one))return 1;if(symbol.eq(this.ineg(one)))return-1;throw new Error("Invalid prime.")}jacobi(a){this._verify1(a);return a.jacobi(this.m)}kronecker(a){this._verify1(a);return a.kronecker(this.m)}iinvert(a){return this.invert(a)._move(a)}invert(a){this._verify1(a);return a.invert(this.m)._forceRed(this)}ifermat(a){return this.fermat(a)._move(a)}fermat(a){this._verify1(a);if(a.isZero()||this.m.cmpn(1)===0)throw new RangeError("Not invertible.");if(this.prime)return this.prime.fermat(a);return this.pow(a,this.m.subn(2))}invertAll(elems){enforce(Array.isArray(elems),"elems","array");for(const elem of elems){enforce(BN.isBN(elem),"elem","bignum");this._verify1(elem)}if(this.m.cmpn(1)===0||this.m.isEven())throw new RangeError("Not invertible.");const len=elems.length;const invs=new Array(len);if(len===0)return invs;let acc=new BN(1).toRed(this);for(let i=0;i=0;i--){if(elems[i].isZero())continue;invs[i]=this.mul(acc,invs[i]);acc=this.mul(acc,elems[i])}return invs}[custom](){if(this.prime)return``;return``}}class Barrett extends Red{constructor(m){super(m);this.prime=null;this.n=this.m.bitLength();if(this.n%26!==0)this.n+=26-this.n%26;this.k=this.n*2;this.w=this.k/26;this.b=BN.shift(1,this.k).div(this.m)}convertTo(num){if(num.length>this.w)return super.convertTo(num);return this.imod(num.clone())}_shift(q){let i=0;let j=this.w;while(j=0)a._isub(a,this.m);if(neg&&!a.isZero())a._isub(this.m,a);a.red=this;return a}}class Mont extends Red{constructor(m){super(m);this.prime=null;this.n=this.m.length*26;this.r=BN.shift(1,this.n);this.r2=BN.shift(1,this.n*2).imod(this.m);this.ri=this.r.invert(this.m);this.mi=this.r.mul(this.ri).isubn(1).div(this.m);this.rib=null}get mont(){return true}convertTo(num){if(num.isNeg()||num.ucmp(this.m)>=0)return this.imod(num.ushln(this.n));return this.mul(num,this.r2)}convertFrom(num){const r=this.mul(num,new BN(1));r.red=null;return r}intTo(a){return(a<=0)u._isub(u,this.m);return u._forceRed(this)}imuln(a,num){this._verify1(a);if(a.isZero())return a;if(num===0){a.words[0]=0;a.length=1;return a}const neg=num<0;if(neg)num=-num;if(this.m.length===1)num%=this.m.words[0];const bits=countBits(num);if(bits>5){this.imul(a,this.convertTo(new BN(num)))}else if((num&num-1)===0){for(let i=0;i=0;i--){this.iadd(a,a);if(num>>i&1)this.iadd(a,c)}}if(neg)this.ineg(a);return a}eqn(a,num){this._verify1(a);if(num===0)return a.isZero();return a.ucmp(this.convertTo(new BN(num)))===0}isLow(a){this._verify1(a);return this.convertFrom(a).ucmp(this.m.ushrn(1))<=0}isOdd(a){this._verify1(a);return this.convertFrom(a).isOdd()}isEven(a){this._verify1(a);return this.convertFrom(a).isEven()}invert(a){this._verify1(a);return this.imod(a.invert(this.m).mul(this.r2))}}function makeError(Error,msg,start){const err=new Error(msg);if(Error.captureStackTrace)Error.captureStackTrace(err,start);return err}function assert(value,message){if(!value){const msg=message||"Assertion failed.";throw makeError(Error,msg,assert)}}function enforce(value,name,type){if(!value){const msg=`"${name}" must be a(n) ${type}.`;throw makeError(TypeError,msg,enforce)}}function range(value,name){if(!value){const msg=`"${name}" only works with positive numbers.`;throw makeError(RangeError,msg,range)}}function red(value,name){if(!value){const msg=`"${name}" only works with red numbers.`;throw makeError(TypeError,msg,red)}}function nonred(value,name){if(!value){const msg=`"${name}" only works with normal numbers.`;throw makeError(TypeError,msg,nonred)}}function nonzero(value){if(!value){const msg="Cannot divide by zero.";throw makeError(RangeError,msg,nonzero)}}class SquareRootError extends Error{constructor(result){super();this.name="SquareRootError";this.message="X is not a square mod P.";this.result=result.fromRed();if(Error.captureStackTrace)Error.captureStackTrace(this,SquareRootError)}}function isInteger(num){return Number.isSafeInteger(num)}function isSMI(num){return isInteger(num)&&num>=-67108863&&num<=67108863}function allocate(ArrayType,size){if(ArrayType.allocUnsafeSlow)return ArrayType.allocUnsafeSlow(size);return new ArrayType(size)}function getBase(base){if(base==null)return 10;if(typeof base==="number")return base;switch(base){case"bin":return 2;case"oct":return 8;case"dec":return 10;case"hex":return 16}return 0}function countBits(w){if(Math.clz32)return 32-Math.clz32(w);let t=w;let r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}function zeroBits(w){if(w===0)return 26;let t=w;let r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0)r+=1;return r}function parseHex(str,start,end){const len=Math.min(str.length,end);let r=0;let z=0;for(let i=start;i=49&&c<=54){b=c-49+10}else if(c>=17&&c<=22){b=c-17+10}else{b=c}r|=b;z|=b}if(z&-16)throw new Error("Invalid string.");return r}function parseBase(str,start,end,mul){const len=Math.min(str.length,end);let r=0;for(let i=start;i=49){b=c-49+10}else if(c>=17){b=c-17+10}else{b=c}if(c<0||c>207||b>=mul)throw new Error("Invalid string.");r+=b}return r}function powInt(x,e,m){const one=BigInt(1);const wnd=new Array(WND_SIZE);const x2=x*x%m;wnd[0]=x;for(let i=1;i=WND_WIDTH){let width=WND_WIDTH;let bits=e.bits(i-width,width);if(bits>=1}if(r===one){r=wnd[bits>>1]}else{r=sqrn(r,width,m);r=r*wnd[bits>>1]%m}i-=width}if(i>0){const bits=e.bits(0,i);while(i--){r=r*r%m;if(bits>>i&1)r=r*x%m}}return r}function sqrn(x,n,m){for(let i=0;i>>26;let rword=carry&67108863;const min=Math.max(0,k-self.length+1);const max=Math.min(k,num.length-1);for(let j=min;j<=max;j++){const i=k-j;const a=self.words[i];const b=num.words[j];const r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0)out.words[k]=carry|0;else out.length-=1;return out._strip()}function bigMulTo(self,num,out){const len=self.length+num.length;out.negative=self.negative^num.negative;out._alloc(len);out.length=len;let carry=0;let hncarry=0;let k=0;for(;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0)out.words[k]=carry;else out.length-=1;return out._strip()}function jumboMulTo(x,y,out){if(!HAS_BIGINT||x.length+y.length>82595519)return bigMulTo(x,y,out);const zero=BigInt(0);const mask=BigInt(67108863);const shift=BigInt(26);let z=x.toBigInt()*y.toBigInt();const neg=zzero){out.words[i++]=Number(z&mask);z>>=shift}if(i===0)out.words[i++]=0;out.length=i;out.negative=neg;return out}function comb10MulTo(self,num,out){const a=self.words;const b=num.words;const o=out.words;const a0=a[0]|0;const al0=a0&8191;const ah0=a0>>>13;const a1=a[1]|0;const al1=a1&8191;const ah1=a1>>>13;const a2=a[2]|0;const al2=a2&8191;const ah2=a2>>>13;const a3=a[3]|0;const al3=a3&8191;const ah3=a3>>>13;const a4=a[4]|0;const al4=a4&8191;const ah4=a4>>>13;const a5=a[5]|0;const al5=a5&8191;const ah5=a5>>>13;const a6=a[6]|0;const al6=a6&8191;const ah6=a6>>>13;const a7=a[7]|0;const al7=a7&8191;const ah7=a7>>>13;const a8=a[8]|0;const al8=a8&8191;const ah8=a8>>>13;const a9=a[9]|0;const al9=a9&8191;const ah9=a9>>>13;const b0=b[0]|0;const bl0=b0&8191;const bh0=b0>>>13;const b1=b[1]|0;const bl1=b1&8191;const bh1=b1>>>13;const b2=b[2]|0;const bl2=b2&8191;const bh2=b2>>>13;const b3=b[3]|0;const bl3=b3&8191;const bh3=b3>>>13;const b4=b[4]|0;const bl4=b4&8191;const bh4=b4>>>13;const b5=b[5]|0;const bl5=b5&8191;const bh5=b5>>>13;const b6=b[6]|0;const bl6=b6&8191;const bh6=b6>>>13;const b7=b[7]|0;const bl7=b7&8191;const bh7=b7>>>13;const b8=b[8]|0;const bl8=b8&8191;const bh8=b8>>>13;const b9=b[9]|0;const bl9=b9&8191;const bh9=b9>>>13;let c=0;let lo,mid,hi;out.negative=self.negative^num.negative;out._alloc(20);out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);let w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;let w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;let w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;let w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;let w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;let w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;let w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;let w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;let w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;let w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;let w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;let w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;let w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;let w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;let w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;let w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;let w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;let w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);let w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length+=1}return out}if(!Math.imul)comb10MulTo=smallMulTo;BN.Red=Red;bn=BN;return bn}var bnBrowser;var hasRequiredBnBrowser;function requireBnBrowser(){if(hasRequiredBnBrowser)return bnBrowser;hasRequiredBnBrowser=1;bnBrowser=requireBn();return bnBrowser}var chacha20;var hasRequiredChacha20;function requireChacha20(){if(hasRequiredChacha20)return chacha20;hasRequiredChacha20=1;const assert=requireAssert();const BIG_ENDIAN=new Int8Array(new Int16Array([1]).buffer)[0]===0;class ChaCha20{constructor(){this.state=new Uint32Array(16);this.stream=new Uint32Array(16);this.bytes=new Uint8Array(this.stream.buffer);this.pos=-1;if(BIG_ENDIAN)this.bytes=bufferExports.Buffer.alloc(64)}init(key,nonce,counter){if(counter==null)counter=0;assert(bufferExports.Buffer.isBuffer(key));assert(bufferExports.Buffer.isBuffer(nonce));assert(Number.isSafeInteger(counter));if(key.length!==16&&key.length!==32)throw new RangeError("Invalid key size.");if(nonce.length>=24){key=ChaCha20.derive(key,nonce.slice(0,16));nonce=nonce.slice(16)}this.state[0]=1634760805;this.state[1]=key.length<32?824206446:857760878;this.state[2]=key.length<32?2036477238:2036477234;this.state[3]=1797285236;this.state[4]=readU32(key,0);this.state[5]=readU32(key,4);this.state[6]=readU32(key,8);this.state[7]=readU32(key,12);this.state[8]=readU32(key,16%key.length);this.state[9]=readU32(key,20%key.length);this.state[10]=readU32(key,24%key.length);this.state[11]=readU32(key,28%key.length);this.state[12]=counter>>>0;if(nonce.length===8){this.state[13]=counter/4294967296>>>0;this.state[14]=readU32(nonce,0);this.state[15]=readU32(nonce,4)}else if(nonce.length===12){this.state[13]=readU32(nonce,0);this.state[14]=readU32(nonce,4);this.state[15]=readU32(nonce,8)}else if(nonce.length===16){this.state[12]=readU32(nonce,0);this.state[13]=readU32(nonce,4);this.state[14]=readU32(nonce,8);this.state[15]=readU32(nonce,12)}else{throw new RangeError("Invalid nonce size.")}this.pos=0;return this}encrypt(data){assert(bufferExports.Buffer.isBuffer(data));if(this.pos===-1)throw new Error("Context is not initialized.");for(let i=0;i>>32-b}function readU32(data,off){return data[off++]+data[off++]*256+data[off++]*65536+data[off]*16777216}function writeU32(dst,num,off){dst[off++]=num;num>>>=8;dst[off++]=num;num>>>=8;dst[off++]=num;num>>>=8;dst[off++]=num;return off}chacha20=ChaCha20;return chacha20}var chacha20Browser;var hasRequiredChacha20Browser;function requireChacha20Browser(){if(hasRequiredChacha20Browser)return chacha20Browser;hasRequiredChacha20Browser=1;chacha20Browser=requireChacha20();return chacha20Browser}var hmac;var hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;const assert=requireAssert();class HMAC{constructor(Hash,size,x=[],y=[]){assert(typeof Hash==="function");assert(size>>>0===size);assert(Array.isArray(x));assert(Array.isArray(y));this.hash=Hash;this.size=size;this.x=x;this.y=y;this.inner=new Hash;this.outer=new Hash}init(key){assert(bufferExports.Buffer.isBuffer(key));if(key.length>this.size){const Hash=this.hash;const h=new Hash;h.init(...this.x);h.update(key);key=h.final(...this.y);assert(key.length<=this.size)}const pad=bufferExports.Buffer.alloc(this.size);for(let i=0;i0){let want=64-pos;if(want>len)want=len;data.copy(this.block,pos,off,off+want);pos+=want;len-=want;off+=want;if(pos<64)return;this._transform(this.block,0)}while(len>=64){this._transform(data,off);off+=64;len-=64}if(len>0)data.copy(this.block,0,off,off+len)}_final(out){assert(this.size!==FINALIZED,"Context is not initialized.");const pos=this.size&63;const len=this.size*8;writeU32(DESC,len*(1/4294967296)>>>0,0);writeU32(DESC,len>>>0,4);this._update(PADDING,1+(119-pos&63));this._update(DESC,8);for(let i=0;i<8;i++){writeU32(out,this.state[i],i*4);this.state[i]=0}for(let i=0;i<64;i++)this.msg[i]=0;for(let i=0;i<64;i++)this.block[i]=0;this.size=FINALIZED;return out}_transform(chunk,pos){const W=this.msg;let a=this.state[0];let b=this.state[1];let c=this.state[2];let d=this.state[3];let e=this.state[4];let f=this.state[5];let g=this.state[6];let h=this.state[7];let i=0;for(;i<16;i++)W[i]=readU32(chunk,pos+i*4);for(;i<64;i++)W[i]=sigma1(W[i-2])+W[i-7]+sigma0(W[i-15])+W[i-16];for(i=0;i<64;i++){const t1=h+Sigma1(e)+Ch(e,f,g)+K[i]+W[i];const t2=Sigma0(a)+Maj(a,b,c);h=g;g=f;f=e;e=d+t1>>>0;d=c;c=b;b=a;a=t1+t2>>>0}this.state[0]+=a;this.state[1]+=b;this.state[2]+=c;this.state[3]+=d;this.state[4]+=e;this.state[5]+=f;this.state[6]+=g;this.state[7]+=h}static hash(){return new SHA256}static hmac(){return new HMAC(SHA256,64)}static digest(data){return SHA256.ctx.init().update(data).final()}static root(left,right){assert(bufferExports.Buffer.isBuffer(left)&&left.length===32);assert(bufferExports.Buffer.isBuffer(right)&&right.length===32);return SHA256.ctx.init().update(left).update(right).final()}static multi(x,y,z){const{ctx}=SHA256;ctx.init();ctx.update(x);ctx.update(y);if(z)ctx.update(z);return ctx.final()}static mac(data,key){return SHA256.hmac().init(key).update(data).final()}}SHA256.native=0;SHA256.id="SHA256";SHA256.size=32;SHA256.bits=256;SHA256.blockSize=64;SHA256.zero=bufferExports.Buffer.alloc(32,0);SHA256.ctx=new SHA256;function Sigma0(x){return(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function Sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function sigma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function sigma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}function Ch(x,y,z){return z^x&(y^z)}function Maj(x,y,z){return x&y|z&(x|y)}function readU32(data,off){return data[off++]*16777216+data[off++]*65536+data[off++]*256+data[off]}function writeU32(data,num,off){data[off++]=num>>>24;data[off++]=num>>>16;data[off++]=num>>>8;data[off++]=num;return off}sha256$1=SHA256;return sha256$1}var sha256Browser;var hasRequiredSha256Browser;function requireSha256Browser(){if(hasRequiredSha256Browser)return sha256Browser;hasRequiredSha256Browser=1;sha256Browser=requireSha256();return sha256Browser}var batchRng;var hasRequiredBatchRng;function requireBatchRng(){if(hasRequiredBatchRng)return batchRng;hasRequiredBatchRng=1;const assert=requireAssert();const BN=requireBnBrowser();const ChaCha20=requireChacha20Browser();const SHA256=requireSha256Browser();class BatchRNG{constructor(curve,encode=key=>key){this.curve=curve;this.encode=encode;this.hash=new SHA256;this.chacha=new ChaCha20;this.key=bufferExports.Buffer.alloc(32,0);this.iv=bufferExports.Buffer.alloc(8,0);this.cache=[new BN(1),new BN(1)]}init(batch){assert(Array.isArray(batch));this.hash.init();for(const[msg,sig,key]of batch){this.hash.update(SHA256.digest(msg));this.hash.update(sig);this.hash.update(this.encode(key))}this.key=this.hash.final();this.cache[0]=new BN(1);this.cache[1]=new BN(1);return this}encrypt(counter){const size=this.curve.scalarSize*2;const data=bufferExports.Buffer.alloc(size,0);const left=data.slice(0,this.curve.scalarSize);const right=data.slice(this.curve.scalarSize);this.chacha.init(this.key,this.iv,counter);this.chacha.encrypt(data);return[this.curve.decodeScalar(left),this.curve.decodeScalar(right)]}refresh(counter){let overflow=0;for(;;){this.iv[4]=overflow;this.iv[5]=overflow>>>8;this.iv[6]=overflow>>>16;this.iv[7]=overflow>>>24;overflow+=1;const[s1,s2]=this.encrypt(counter);if(s1.isZero()||s1.cmp(this.curve.n)>=0)continue;if(s2.isZero()||s2.cmp(this.curve.n)>=0)continue;this.cache[0]=s1;this.cache[1]=s2;break}}generate(index){assert(index>>>0===index);if(index&1)this.refresh(index>>>1);return this.cache[index&1]}}batchRng=BatchRNG;return batchRng}var elliptic={};var hasRequiredElliptic;function requireElliptic(){if(hasRequiredElliptic)return elliptic;hasRequiredElliptic=1;const{custom}=requireCustomBrowser();const BN=requireBnBrowser();const types={AFFINE:0,JACOBIAN:1,PROJECTIVE:2,EXTENDED:3};const jsfIndex=[-3,-1,-5,-7,0,7,5,1,3];let uid=0;class Curve{constructor(Point,type,conf){this.Point=null;this.id=null;this.uid=uid++;this.ossl=null;this.type="base";this.endian="be";this.hash=null;this.prefix=null;this.context=false;this.prime=null;this.p=null;this.red=null;this.fieldSize=0;this.fieldBits=0;this.adjustedSize=0;this.signBit=0;this.mask=0;this.n=null;this.h=null;this.q=null;this.z=null;this.g=null;this.nh=null;this.scalarSize=0;this.scalarBits=0;this.zero=null;this.one=null;this.two=null;this.three=null;this.four=null;this.i2=null;this.i3=null;this.i4=null;this.i6=null;this.torsion=null;this.endo=null;this.hi=null;this._init(Point,type,conf)}_init(Point,type,conf){assert(typeof Point==="function");assert(typeof type==="string");assert(conf&&typeof conf==="object");assert(conf.red==null||conf.red instanceof BN.Red);assert(conf.p!=null,"Must pass a prime.");assert(conf.id==null||typeof conf.id==="string");assert(conf.ossl==null||typeof conf.ossl==="string");assert(conf.endian==null||typeof conf.endian==="string");assert(conf.hash==null||typeof conf.hash==="string");assert(conf.prefix==null||typeof conf.prefix==="string");assert(conf.context==null||typeof conf.context==="boolean");assert(conf.prime==null||typeof conf.prime==="string");assert(conf.torsion==null||Array.isArray(conf.torsion));this.Point=Point;this.id=conf.id||null;this.ossl=conf.ossl||null;this.type=type;this.endian=conf.endian||(type==="short"?"be":"le");this.hash=conf.hash||null;this.prefix=conf.prefix?bufferExports.Buffer.from(conf.prefix,"binary"):null;this.context=conf.context||false;this.prime=conf.prime||null;this.p=BN.fromJSON(conf.p);if(conf.red){this.red=conf.red}else{this.red=conf.prime?BN.red(conf.prime):BN.mont(this.p);this.red.precompute()}this.fieldSize=this.p.byteLength();this.fieldBits=this.p.bitLength();this.adjustedSize=this.fieldSize+((this.fieldBits&7)===0);this.signBit=this.adjustedSize*8-1;this.mask=255;if((this.fieldBits&7)!==0)this.mask=(1<<(this.fieldBits&7))-1;this.n=BN.fromJSON(conf.n||"0");this.h=BN.fromJSON(conf.h||"1");this.q=this.n.mul(this.h);this.z=BN.fromJSON(conf.z||"0").toRed(this.red);this.g=null;this.nh=this.n.ushrn(1);this.scalarSize=this.n.byteLength();this.scalarBits=this.n.bitLength();this.zero=new BN(0).toRed(this.red);this.one=new BN(1).toRed(this.red);this.two=new BN(2).toRed(this.red);this.three=new BN(3).toRed(this.red);this.four=new BN(4).toRed(this.red);this.i2=this.two.redInvert();this.i3=this.three.redInvert();this.i4=this.i2.redSqr();this.i6=this.i2.redMul(this.i3);this.torsion=new Array(this.h.word(0));for(let i=0;i0&&this.p.isOdd());assert(this.n.sign()>=0);assert(this.h.sign()>0&&this.h.cmpn(255)<=0);assert(this.endian==="be"||this.endian==="le");return this}_finalize(conf){assert(conf&&typeof conf==="object");this.g=conf.g?this.pointFromJSON(conf.g):this.point();if(conf.torsion){assert(conf.torsion.length===this.torsion.length);for(let i=0;ia.cmp(b));while(out.length>>0;let acc=this.jpoint();for(let i=0;i0;i--){for(let j=0;j=0;i--){const z=naf[i];if(i!==naf.length-1)acc=acc.dbl();if(z>0)acc=acc.add(points[z-1>>1]);else if(z<0)acc=acc.sub(points[-z-1>>1])}return acc}_wnafMulAdd(w,points,coeffs){assert(w>>>0===w);assert(Array.isArray(points));assert(Array.isArray(coeffs));assert(points.length===coeffs.length);const length=points.length;const wnd=new Array(length);const naf=new Array(length);let max=0;for(let i=0;i0&&point.type!==points[i-1].type)throw new Error("Cannot mix points.");wnd[i]=null;naf[i]=null;max=Math.max(max,coeff.bitLength()+1)}let ppoint=null;let pcoeff=null;let len=0;for(let i=0;i=0;i--){if(i!==max-1)acc=acc.dbl();for(let j=0;j0)acc=acc.add(wnd[j][z-1>>1]);else if(z<0)acc=acc.sub(wnd[j][-z-1>>1])}}return acc}_endoWnafMulAdd(points,coeffs){throw new Error("Not implemented.")}_scale(curve,invert){assert(curve instanceof Curve);assert(curve.p.eq(this.p));switch(curve.type){case"short":return this._scaleShort(curve,invert);case"mont":return this._scaleMont(curve,invert);case"edwards":return this._scaleEdwards(curve,invert);default:throw new Error("Not implemented.")}}_scaleShort(curve,invert){throw new Error("Not implemented.")}_scaleMont(curve,invert){throw new Error("Not implemented.")}_scaleEdwards(curve,invert){throw new Error("Not implemented.")}isElliptic(){throw new Error("Not implemented.")}jinv(){throw new Error("Not implemented.")}isComplete(){return false}precompute(rng){assert(!this.g.isInfinity(),"Must have base point.");assert(!this.n.isZero(),"Must have order.");this.g.precompute(this.n.bitLength(),rng);return this}scalar(num,base,endian){const k=new BN(num,base,endian);assert(!k.red);if(this.n.isZero())return k;return k.imod(this.n)}field(num,base,endian){const x=BN.cast(num,base,endian);if(x.red)return x.forceRed(this.red);return x.toRed(this.red)}point(x,y){throw new Error("Not implemented.")}jpoint(x,y,z){throw new Error("Not implemented.")}xpoint(x,z){throw new Error("Not implemented.")}cpoint(xx,xz,yy,yz){assert(xx instanceof BN);assert(xz instanceof BN);assert(yy instanceof BN);assert(yz instanceof BN);if(xz.isZero()||yz.isZero())return this.point();const z=xz.redMul(yz).redInvert();const x=xx.redMul(yz).redMul(z);const y=yy.redMul(xz).redMul(z);return this.point(x,y)}solveX2(y){throw new Error("Not implemented.")}solveX(y){return this.solveX2(y).redSqrt()}solveY2(x){throw new Error("Not implemented.")}solveY(x){return this.solveY2(x).redSqrt()}validate(point){throw new Error("Not implemented.")}pointFromX(x,sign){throw new Error("Not implemented.")}pointFromY(y,sign){throw new Error("Not implemented.")}isIsomorphic(curve){throw new Error("Not implemented.")}isIsogenous(curve){throw new Error("Not implemented.")}pointFromShort(point){throw new Error("Not implemented.")}pointFromMont(point,sign){throw new Error("Not implemented.")}pointFromEdwards(point){throw new Error("Not implemented.")}pointFromUniform(u){throw new Error("Not implemented.")}pointToUniform(p){throw new Error("Not implemented.")}pointFromHash(bytes,pake=false){assert(bufferExports.Buffer.isBuffer(bytes));assert(typeof pake==="boolean");if(bytes.length!==this.fieldSize*2)throw new Error("Invalid hash size.");const s1=bytes.slice(0,this.fieldSize);const s2=bytes.slice(this.fieldSize);const u1=this.decodeUniform(s1);const u2=this.decodeUniform(s2);const p1=this.pointFromUniform(u1);const p2=this.pointFromUniform(u2);const p3=p1.add(p2);return pake?p3.mulH():p3}pointToHash(p,subgroup,rng){assert(p instanceof this.Point);assert(subgroup>>>0===subgroup);const i=subgroup%this.torsion.length;const p0=p.add(this.torsion[i]);for(;;){const u1=this.randomField(rng);const p1=this.pointFromUniform(u1);if(p1.neg().eq(p1))continue;const p2=p0.sub(p1);const hint=randomInt(rng);let u2;try{u2=this.pointToUniform(p2,hint&15)}catch(e){if(e.message==="Invalid point.")continue;throw e}const s1=this.encodeUniform(u1,hint>>>8);const s2=this.encodeUniform(u2,hint>>>16);return bufferExports.Buffer.concat([s1,s2])}}randomScalar(rng){const max=this.n.isZero()?this.p:this.n;return BN.random(rng,1,max)}randomField(rng){return BN.random(rng,1,this.p).toRed(this.red)}randomPoint(rng){let p;for(;;){const x=this.randomField(rng);const sign=(randomInt(rng)&1)!==0;try{p=this.pointFromX(x,sign)}catch(e){continue}assert(p.validate());return p.mulH()}}mulAll(points,coeffs){return this.jmulAll(points,coeffs)}jmulAll(points,coeffs){assert(Array.isArray(points));assert(points.length===0||points[0]instanceof Point);if(this.endo&&points.length>0&&points[0].type===types.AFFINE)return this._endoWnafMulAdd(points,coeffs);return this._wnafMulAdd(5,points,coeffs)}mulH(k){assert(k instanceof BN);return this.imulH(k.clone())}imulH(k){assert(k instanceof BN);assert(!k.red);const word=this.h.word(0);if((word&word-1)===0){const bits=this.h.bitLength();return k.iushln(bits-1).imod(this.n)}return k.imuln(word).imod(this.n)}normalizeAll(points){assert(Array.isArray(points));const len=points.length;const z=new Array(len);for(let i=0;i>>0===bits);const msb=this.endian==="le"?this.fieldSize-1:0;const bytes=x.fromRed().encode(this.endian,this.fieldSize);bytes[msb]|=bits&~this.mask&255;return bytes}decodeUniform(bytes){assert(bufferExports.Buffer.isBuffer(bytes));if(bytes.length!==this.fieldSize)throw new Error("Invalid field size.");const x=BN.decode(bytes,this.endian);x.iumaskn(this.fieldBits);return x.toRed(this.red)}encodePoint(point,compact){assert(point instanceof Point);return point.encode(compact)}decodePoint(bytes){throw new Error("Not implemented.")}encodeX(point){throw new Error("Not implemented.")}decodeX(bytes){throw new Error("Not implemented.")}decodeEven(bytes){throw new Error("Not implemented.")}decodeSquare(bytes){throw new Error("Not implemented.")}toShort(){throw new Error("Not implemented.")}toMont(b0){throw new Error("Not implemented.")}toEdwards(a0){throw new Error("Not implemented.")}pointToJSON(point,pre){assert(point instanceof Point);return point.toJSON(pre)}pointFromJSON(json){throw new Error("Not implemented.")}toJSON(pre){let prefix,context;let n,z,endo;if(this.type==="edwards"){prefix=this.prefix?this.prefix.toString():null;context=this.context}if(!this.n.isZero())n=this.n.toJSON();if(!this.z.isZero()){z=this.z.fromRed();if(this.z.redIsHigh())z.isub(this.p);z=z.toString(16)}if(this.endo)endo=this.endo.toJSON();return{id:this.id,ossl:this.ossl,type:this.type,endian:this.endian,hash:this.hash,prefix:prefix,context:context,prime:this.prime,p:this.p.toJSON(),a:undefined,b:undefined,d:undefined,n:n,h:this.h.toString(16),s:undefined,z:z,c:undefined,g:this.g.toJSON(pre),endo:endo}}static fromJSON(json){return new this(json)}}class Point{constructor(curve,type){assert(curve instanceof Curve);assert(type>>>0===type);this.curve=curve;this.type=type;this.pre=null}_init(){throw new Error("Not implemented.")}_safeNAF(width){assert(width>>>0===width);if(this.pre&&this.pre.naf)return this.pre.naf;if(width===0)return null;const size=1<>>0===width);if(this.pre&&this.pre.naf)return this.pre.naf;if(width===0)return null;const odds=this._safeNAF(width).points;const points=this.curve.affinizeAll(odds);return new NAF(width,points)}_getWindows(width,bits){assert(width>>>0===width);assert(bits>>>0===bits);if(this.pre&&this.pre.windows)return this.pre.windows;if(width===0)return null;const size=1<>>0;const wnds=new Array(steps*size);let g=this.toJ();for(let i=0;i>>0===step);assert(power>>>0===power);if(this.pre&&this.pre.doubles)return this.pre.doubles;if(step===0)return null;const len=Math.ceil(power/step)+1;const dbls=new Array(len);let acc=this.toJ();let k=0;dbls[k++]=acc;for(let i=0;i>>0;return k.bitLength()<=steps*width}_hasDoubles(k){assert(k instanceof BN);if(!this.pre||!this.pre.doubles)return false;const{step,points}=this.pre.doubles;const power=k.bitLength()+1;return points.length>=Math.ceil(power/step)+1}_getJNAF(point){assert(point instanceof Point);assert(point.type===this.type);return[this,this.add(point),this.sub(point),point]}_blind(k,rng){assert(k instanceof BN);assert(!k.red);if(this.pre&&this.pre.blinding){const{blind,unblind}=this.pre.blinding;const t=k.sub(blind);return[this,t,unblind]}if(!rng)return[this,k,null];if(this.pre){if(this.curve.n.isZero())return[this,k,null];const a=this.curve.randomScalar(rng);const r=a.mul(this.curve.n);const t=r.iadd(k);return[this,t,null]}const p=this.randomize(rng);return[p,k,null]}clone(){throw new Error("Not implemented.")}precompute(bits,rng){assert(bits>>>0===bits);if(!this.pre)this.pre=new Precomp;if(!this.pre.naf)this.pre.naf=this._getNAF(9);if(!this.pre.doubles)this.pre.doubles=this._getDoubles(4,bits+1);if(!this.pre.beta)this.pre.beta=this._getBeta();if(!this.pre.blinding)this.pre.blinding=this._getBlinding(rng);return this}validate(){return this.curve.validate(this)}normalize(){return this}scale(a){throw new Error("Not implemented.")}randomize(rng){const z=this.curve.randomField(rng);return this.scale(z)}neg(){throw new Error("Not implemented.")}add(point){throw new Error("Not implemented.")}sub(point){assert(point instanceof Point);return this.add(point.neg())}dbl(){throw new Error("Not implemented.")}dblp(pow){assert(pow>>>0===pow);let r=this;for(let i=0;i0){q=n.clone();break}p=p.add(this)}return q}mul(k){return this.jmul(k)}muln(k){return this.jmuln(k)}mulBlind(k,rng){return this.jmulBlind(k,rng)}mulAdd(k1,p2,k2){return this.jmulAdd(k1,p2,k2)}mulH(){return this.jmulH()}div(k){return this.jdiv(k)}divn(k){return this.jdivn(k)}divH(){return this.jdivH()}jmul(k){if(this._hasDoubles(k))return this.curve._fixedNafMul(this,k);if(this.curve.endo&&this.type===types.AFFINE)return this.curve._endoWnafMulAdd([this],[k]);return this.curve._wnafMul(5,this,k)}jmuln(k){assert((k|0)===k);return this.jmul(new BN(k))}jmulBlind(k,rng=null){const[p,t,unblind]=this._blind(k,rng);const q=p.jmul(t);if(unblind)return q.add(unblind);return q}jmulAdd(k1,p2,k2){if(this.curve.endo&&this.type===types.AFFINE)return this.curve._endoWnafMulAdd([this,p2],[k1,k2]);return this.curve._wnafMulAdd(5,[this,p2],[k1,k2])}jmulH(){const word=this.curve.h.word(0);if((word&word-1)===0){const bits=this.curve.h.bitLength();return this.toJ().dblp(bits-1)}return this.jmul(this.curve.h)}jdiv(k){assert(k instanceof BN);assert(!k.red);return this.jmul(k.invert(this.curve.n))}jdivn(k){assert(!this.curve.n.isZero());if(this.curve.h.cmpn(k)===0)return this.jdivH();return this.jdiv(new BN(k))}jdivH(){if(this.curve.n.isZero())return this.toJ();if(this.curve.h.cmpn(1)===0)return this.toJ();if(this.curve.hi===null)this.curve.hi=this.curve.h.invert(this.curve.n);return this.jmul(this.curve.hi)}toP(){return this.normalize()}toJ(){return this}toX(){return this}key(){if(this.isInfinity())return`${this.curve.uid}:oo`;this.normalize();const x=this.getX().toString(16);const y=this.getY().toString(16);return`${this.curve.uid}:${x},${y}`}encode(compact){throw new Error("Not implemented.")}static decode(curve,bytes){throw new Error("Not implemented.")}encodeX(){throw new Error("Not implemented.")}static decodeX(curve,bytes){throw new Error("Not implemented.")}static decodeEven(curve,bytes){throw new Error("Not implemented.")}static decodeSquare(curve,bytes){throw new Error("Not implemented.")}toJSON(pre){throw new Error("Not implemented.")}static fromJSON(curve,json){throw new Error("Not implemented.")}[custom](){return""}}class ShortCurve extends Curve{constructor(conf){super(ShortPoint,"short",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.b=BN.fromJSON(conf.b).toRed(this.red);this.c=BN.fromJSON(conf.c||"0").toRed(this.red);this.ai=this.a.isZero()?this.zero:this.a.redInvert();this.zi=this.z.isZero()?this.zero:this.z.redInvert();this.zeroA=this.a.isZero();this.threeA=this.a.eq(this.three.redNeg());this.redN=this.n.toRed(this.red);this.pmodn=this.p.clone();this.highOrder=this.n.cmp(this.p)>=0;this.smallGap=false;this._finalize(conf)}_finalize(conf){super._finalize(conf);if(conf.endo!=null)this.endo=Endo.fromJSON(this,conf.endo);else this.endo=this._getEndomorphism();if(!this.n.isZero()){this.pmodn=this.p.mod(this.n);this.smallGap=this.p.div(this.n).cmpn(1)<=0}return this}static _isomorphism(curveA,curveB,custom,odd){assert(curveA instanceof BN);assert(curveB instanceof BN);assert(custom instanceof BN);assert(odd==null||typeof odd==="boolean");assert(!curveA.isZero()||!curveB.isZero());if(custom.isZero())throw new Error("Invalid coefficient.");if(curveA.isZero()){const customB=custom;const u6=customB.redDiv(curveB);const u2=uncube(u6);assert(u2.redJacobi()===1);return[curveA.clone(),customB.clone()]}if(curveB.isZero()){const customA=custom;const u4=customA.redDiv(curveA);const u2=u4.redSqrt();if(u2.redJacobi()!==1)u2.redINeg();if(u2.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");return[customA.clone(),curveB.clone()]}const customA=custom;const u4=customA.redDiv(curveA);const u2=u4.redSqrt();if(odd!=null){if(u2.redIsOdd()!==odd)u2.redINeg()}else{if(u2.redJacobi()!==1)u2.redINeg()}if(u2.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");const u6=u4.redMul(u2);const a=curveA.redMul(u4);const b=curveB.redMul(u6);assert(a.eq(customA));return[a,b]}_short(a0,odd){return ShortCurve._isomorphism(this.a,this.b,a0,odd)}_mont(b0,odd){const[r,s]=this._findRS(odd);const b=s.redInvert();const a=r.redMuln(3).redMul(b);if(b0!=null)return MontCurve._isomorphism(a,b,b0);return[a,b]}_edwards(a0,odd){const[r,s]=this._findRS(odd);const r3=r.redMuln(3);const s2=s.redMuln(2);const a=r3.redAdd(s2);const d=r3.redSub(s2);if(a0!=null)return EdwardsCurve._isomorphism(a,d,a0);return[a,d]}_findRS(sign){assert(sign==null||typeof sign==="boolean");assert(this.h.word(0)>=4);assert(!this.n.isZero());const x=this.one.redNeg();let p;for(;;){x.redIAdd(this.one);try{p=this.pointFromX(x.clone())}catch(e){continue}p=p.mul(this.n);if(p.isInfinity())continue;if(!p.y.isZero())continue;break}const r=p.x;const r2=r.redSqr();const s=r2.redMuln(3).redIAdd(this.a).redSqrt();if(sign!=null){if(s.redIsOdd()!==sign)s.redINeg()}return[r,s]}_scale0(a,b){assert(this.a.isZero()===a.isZero());assert(this.b.isZero()===b.isZero());if(this.a.isZero()){const u6=this.b.redDiv(this.field(b));const u2=uncube(u6);const u=u2.redSqrt();const u3=u2.redMul(u);assert(u3.redSqr().eq(u6));assert(!u.isZero());return[u2,u3]}if(this.b.isZero()){const u4=this.a.redDiv(this.field(a));const u2=u4.redSqrt();if(u2.redJacobi()!==1)u2.redINeg();const u=u2.redSqrt();const u3=u2.redMul(u);assert(u3.redMul(u).eq(u4));assert(!u.isZero());return[u2,u3]}const u4=this.a.redDiv(this.field(a));const u6=this.b.redDiv(this.field(b));const u2=u4.redSqrt();if(!u4.redMul(u2).eq(u6))u2.redINeg();assert(u4.redMul(u2).eq(u6));const u=u2.redSqrt();const u3=u2.redMul(u);assert(!u.isZero());return[u2,u3]}_scale1(x,y){const u2=this.g.x.redDiv(this.field(x));const u3=this.g.y.redDiv(this.field(y));const u=u2.redSqrt();if(!u2.redMul(u).eq(u3))u.redINeg();assert(u2.redMul(u).eq(u3));assert(!u.isZero());return[u2,u3]}_scaleShort(curve){assert(curve instanceof ShortCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this._scale0(curve.a,curve.b);return this._scale1(curve.g.x,curve.g.y)}_scaleMont(curve){assert(curve instanceof MontCurve);if(this.g.isInfinity()||curve.g.isInfinity()){const[a,b]=curve._short();return this._scale0(a,b)}const{x,y}=curve.g;const nx=x.redAdd(curve.a3).redMul(curve.bi);const ny=y.redMul(curve.bi);return this._scale1(nx,ny)}_scaleEdwards(curve){assert(curve instanceof EdwardsCurve);if(this.g.isInfinity()||curve.g.isInfinity()){const[a,b]=curve._short();return this._scale0(a,b)}const{x,y,z}=curve.g;const a5=curve.a.redMuln(5);const d5=curve.d.redMuln(5);const dma=curve.d.redSub(curve.a);const d5a=d5.redSub(curve.a);const da5=curve.d.redSub(a5);const ypz=y.redAdd(z);const ymz=y.redSub(z);const xx=d5a.redMul(y).redIAdd(da5.redMul(z));const xz=ymz.redMuln(12);const yy=dma.redMul(ypz).redMul(z);const yz=ymz.redMul(x).redIMuln(4);const zi=xz.redMul(yz).redInvert();const nx=xx.redMul(yz).redMul(zi);const ny=yy.redMul(xz).redMul(zi);return this._scale1(nx,ny)}_getEndomorphism(index=0){if(this.n.isZero()||this.g.isInfinity())return null;if(!this.zeroA||this.p.modrn(3)!==1||this.n.modrn(3)!==1)return null;const[b1,b2]=this._getEndoRoots(this.p);const beta=[b1,b2][index&1].toRed(this.red);const[l1,l2]=this._getEndoRoots(this.n);const p=this.point(this.g.x.redMul(beta),this.g.y);let lambda;if(this.g.mul(l1).eq(p)){lambda=l1}else{assert(this.g.mul(l2).eq(p));lambda=l2}const basis=this._getEndoBasis(lambda);const pre=this._getEndoPrecomp(basis);return new Endo(beta,lambda,basis,pre)}_getEndoRoots(num){const red=num===this.p?this.red:BN.mont(num);const two=new BN(2).toRed(red);const three=new BN(3).toRed(red);const i2=two.redInvert();const s1=three.redNeg().redSqrt().redMul(i2);const s2=s1.redNeg();const r1=s1.redSub(i2).fromRed();const r2=s2.redSub(i2).fromRed();return[r1,r2].sort(BN.cmp)}_getEndoBasis(lambda){const[rl,tl,rl1,tl1,rl2,tl2]=this._egcdSqrt(lambda);const a1=rl1;const b1=tl1.neg();const lhs=rl.sqr().iadd(tl.sqr());const rhs=rl2.sqr().iadd(tl2.sqr());let a2,b2;if(lhs.cmp(rhs)<=0){a2=rl;b2=tl.neg()}else{a2=rl2;b2=tl2.neg()}return[new Vector(a1,b1),new Vector(a2,b2)]}_egcdSqrt(lambda){assert(lambda instanceof BN);assert(!lambda.red);assert(lambda.sign()>0);assert(this.n.sign()>0);const sqrtn=this.n.ushrn(this.n.bitLength()>>>1);let u=lambda;let v=this.n.clone();let x1=new BN(1);let y1=new BN(0);let x2=new BN(0);let y2=new BN(1);let rl,tl;let rl1,tl1;let i=0;let j=0;let p;while(!u.isZero()&&i<2){const q=v.quo(u);const r=v.sub(q.mul(u));const x=x2.sub(q.mul(x1));const y=y2.sub(q.mul(y1));if(j===0&&r.cmp(sqrtn)<0){rl=p;tl=x1;rl1=r;tl1=x;j=1}p=r;v=u;u=r;x2=x1;x1=x;y2=y1;y1=y;i+=j}assert(j!==0,"Could not find r < sqrt(n).");const rl2=x2;const tl2=x1;return[rl,tl,rl1,tl1,rl2,tl2]}_getEndoPrecomp(basis){assert(Array.isArray(basis));assert(basis.length===2);assert(basis[0]instanceof Vector);assert(basis[1]instanceof Vector);const[v1,v2]=basis;const d=v1.a.mul(v2.b).isub(v1.b.mul(v2.a));const bits=d.bitLength();const align=bits>=160;assert(d.eq(this.n));let shift=bits+Math.ceil(bits/2)+1;let g1,g2;if(align)shift-=shift&63;while(shift>bits){g1=v2.b.ushln(shift).divRound(d);g2=v1.b.ushln(shift).divRound(d);if(g1.ucmp(d)<0&&g2.ucmp(d)<0)break;if(align)shift-=64;else shift-=1}if(shift<=bits)throw new Error("Could not calculate g1 and g2.");return[shift,g1,g2]}_endoSplit(k){assert(k instanceof BN);assert(!k.red);assert(!this.n.isZero());const[v1,v2]=this.endo.basis;const c1=v2.b.mul(k).divRound(this.n);const c2=v1.b.neg().mul(k).divRound(this.n);const p1=c1.mul(v1.a);const p2=c2.mul(v2.a);const q1=c1.ineg().mul(v1.b);const q2=c2.mul(v2.b);const k1=k.sub(p1).isub(p2);const k2=q1.isub(q2);return[k1,k2]}_endoBeta(point){assert(point instanceof ShortPoint);return[point,point._getBeta()]}_endoWnafMulAdd(points,coeffs){assert(Array.isArray(points));assert(Array.isArray(coeffs));assert(points.length===coeffs.length);assert(this.endo!=null);const len=points.length;const npoints=new Array(len*2);const ncoeffs=new Array(len*2);for(let i=0;i>>1];const u=n.redDivSqrt(d);if(u.redIsOdd()!==y.redIsOdd())u.redINeg();return u}_svdwf(u){const{c,z,zi,i2,i3}=this;const gz=this.solveY2(z);const z3=i3.redMul(zi.redSqr());const u2=u.redSqr();const u4=u2.redSqr();const t1=u2.redAdd(gz);const u2t1=u2.redMul(t1);const t2=u2t1.isZero()?u2t1:u2t1.redInvert();const t3=u4.redMul(t2).redMul(c);const t4=t1.redSqr().redMul(t1);const x1=c.redSub(z).redMul(i2).redISub(t3);const x2=t3.redSub(c.redAdd(z).redMul(i2));const x3=z.redSub(t4.redMul(t2).redMul(z3));const y1=this.solveY2(x1);const y2=this.solveY2(x2);const y3=this.solveY2(x3);const alpha=y1.redJacobi()|1;const beta=y2.redJacobi()|1;const i=mod((alpha-1)*beta,3);const x=[x1,x2,x3][i];const y=[y1,y2,y3][i];return[x,y]}_svdw(u){const[x,yy]=this._svdwf(u);const y=yy.redSqrt();if(y.redIsOdd()!==u.redIsOdd())y.redINeg();return this.point(x,y)}_svdwi(p,hint){const{b,c,z,zero,two}=this;const{x,y}=p;const r=hint&3;const z2=z.redSqr();const z3=z2.redMul(z);const z4=z2.redSqr();const gz=z3.redAdd(b);const gz2=gz.redMuln(2);const xx=x.redSqr();const x2z=x.redMuln(2).redIAdd(z);const xz2=x.redMul(z2);const c0=c.redSub(x2z);const c1=c.redAdd(x2z);const t0=xx.redMul(z2).redIAdd(z4).redIMuln(9);const t1=x.redMul(z3).redIMuln(18);const t2=gz.redMul(x.redSub(z)).redIMuln(12);const t3=r>=2?t0.redISub(t1).redIAdd(t2).redSqrt():zero;const t4=t3.redMul(z);const t5=z3.redISub(xz2).redIMuln(3).redISub(gz2);const n0=gz.redMul(c0);const n1=gz.redMul(c1);const n2=t5.redAdd(t4);const n3=t5.redSub(t4);const d2=two;const n=[n0,n1,n2,n3][r];const d=[c1,c0,d2,d2][r];const u=n.redDivSqrt(d);const[x0]=this._svdwf(u);if(!x0.eq(x))throw new Error("Invalid point.");if(u.redIsOdd()!==y.redIsOdd())u.redINeg();return u}isElliptic(){const{a,b}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const d=b2.redMuln(27).redIAdd(a3.redMuln(4));return!d.isZero()}jinv(){const{a,b}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const t0=a3.redMuln(4);const lhs=t0.redMuln(1728);const rhs=b2.redMuln(27).redIAdd(t0);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}point(x,y){return new ShortPoint(this,x,y)}jpoint(x,y,z){return new JPoint(this,x,y,z)}solveX(y){assert(y instanceof BN);if(!this.a.isZero())throw new Error("Not implemented.");const y2=y.redSqr();const x3=y2.redSub(this.b);return cubeRoots(x3)}solveY2(x){assert(x instanceof BN);const x3=x.redSqr().redMul(x);const y2=x3.redIAdd(this.b);if(!this.zeroA){if(this.threeA)y2.redIAdd(x.redMuln(-3));else y2.redIAdd(this.a.redMul(x))}return y2}validate(point){assert(point instanceof ShortPoint);if(point.inf)return true;const{x,y}=point;const y2=this.solveY2(x);return y.redSqr().eq(y2)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(this.h.cmpn(1)>0){if(y.isZero()&&sign)throw new Error("Invalid point.")}if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}pointFromY(y,index=0){assert(y instanceof BN);assert(index>>>0===index);if(!y.red)y=y.toRed(this.red);const coords=this.solveX(y);if(index>=coords.length)throw new Error("Invalid X coordinate index.");const x=coords[index];return this.point(x,y)}isIsomorphic(curve){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;let u2,u3;try{[u2,u3]=this._scale(curve)}catch(e){return false}if(curve.type==="short"){const a=this.field(curve.a).redMul(u2.redSqr());const b=this.field(curve.b).redMul(u3.redSqr());return this.a.eq(a)&&this.b.eq(b)}if(curve.type==="mont"){const{a3,bi}=curve;const x=this.field(a3.redMul(bi)).redMul(u2);const y2=this.solveY2(x);return y2.isZero()}if(curve.type==="edwards"){const x=this.field(curve.ad6).redMul(u2);const y2=this.solveY2(x);return y2.isZero()}return false}isIsogenous(curve){assert(curve instanceof Curve);return false}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const[u2,u3]=this._scale(point.curve);const x=this.field(point.x);const y=this.field(point.y);const nx=x.redMul(u2);const ny=y.redMul(u3);return this.point(nx,ny)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const{a3,bi}=point.curve;const[u2,u3]=this._scale(point.curve);const nx=point.x.redAdd(a3).redMul(bi);const ny=point.y.redMul(bi);return this.point(this.field(nx).redMul(u2),this.field(ny).redMul(u3))}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);if(this.isIsomorphic(point.curve)){const{a,d,ad6}=point.curve;const[u2,u3]=this._scale(point.curve);if(point.isInfinity())return this.point();if(point.x.isZero()){const x=this.field(ad6).redMul(u2);return this.point(x,this.zero)}const{x,y,z}=point;const a5=a.redMuln(5);const d5=d.redMuln(5);const dma=d.redSub(a);const d5a=d5.redSub(a);const da5=d.redSub(a5);const ypz=y.redAdd(z);const ymz=y.redSub(z);const xx=d5a.redMul(y).redIAdd(da5.redMul(z));const xz=ymz.redMuln(12);const yy=dma.redMul(ypz).redMul(z);const yz=ymz.redMul(x).redIMuln(4);return this.cpoint(this.field(xx).redMul(u2),this.field(xz),this.field(yy).redMul(u3),this.field(yz))}throw new Error("Not implemented.")}pointFromUniform(u){assert(u instanceof BN);if(this.z.isZero()||this.b.isZero())throw new Error("Not implemented.");if(!this.a.isZero())return this._sswu(u);if(!this.c.isZero())return this._svdw(u);throw new Error("Not implemented.")}pointToUniform(p,hint){assert(p instanceof ShortPoint);assert(hint>>>0===hint);if(this.z.isZero()||this.b.isZero())throw new Error("Not implemented.");if(p.isInfinity())throw new Error("Invalid point.");const i=(hint>>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);return wrapErrors(()=>{if(!this.a.isZero())return this._sswui(q,hint);if(!this.c.isZero())return this._svdwi(q,hint);throw new Error("Not implemented.")})}mulAll(points,coeffs){return super.mulAll(points,coeffs).toP()}affinizeAll(points){const out=this.normalizeAll(points);for(let i=0;i{const xb=point.x.redMul(this.curve.endo.beta);return this.curve.point(xb,point.y)});this.pre.beta=beta}return beta}_getJNAF(point){assert(point instanceof ShortPoint);if(this.inf||point.inf)return super._getJNAF(point);const comb=[this,null,null,point];if(this.y.eq(point.y)){comb[1]=this.add(point);comb[2]=this.toJ().sub(point)}else if(this.y.eq(point.y.redNeg())){comb[1]=this.toJ().add(point);comb[2]=this.sub(point)}else{comb[1]=this.toJ().add(point);comb[2]=this.toJ().sub(point)}return comb}clone(){if(this.inf)return this.curve.point();return this.curve.point(this.x,this.y)}scale(a){return this.toJ().scale(a)}neg(){if(this.inf)return this;return this.curve.point(this.x,this.y.redNeg())}add(p){assert(p instanceof ShortPoint);if(this.inf)return p;if(p.inf)return this;if(this.x.eq(p.x)){if(!this.y.eq(p.y))return this.curve.point();return this.dbl()}if(this.y.eq(p.y)){const nx=this.x.redNeg().redISub(p.x);const ny=this.y.redNeg();return this.curve.point(nx,ny)}const h=this.x.redSub(p.x);const r=this.y.redSub(p.y);const l=r.redDiv(h);const nx=l.redSqr().redISub(this.x).redISub(p.x);const ny=l.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)}dbl(){if(this.inf)return this;if(this.y.isZero())return this.curve.point();const xx=this.x.redSqr();const m=xx.redIMuln(3).redIAdd(this.curve.a);const z=this.y.redMuln(2);const l=m.redDiv(z);const nx=l.redSqr().redISub(this.x).redISub(this.x);const ny=l.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)}dblp(pow){return this.toJ().dblp(pow).toP()}getX(){if(this.inf)throw new Error("Invalid point.");return this.x.fromRed()}getY(){if(this.inf)throw new Error("Invalid point.");return this.y.fromRed()}eq(p){assert(p instanceof ShortPoint);if(this===p)return true;if(this.inf)return p.inf;if(p.inf)return false;return this.x.eq(p.x)&&this.y.eq(p.y)}cmp(point){assert(point instanceof ShortPoint);if(this.inf&&!point.inf)return-1;if(!this.inf&&point.inf)return 1;if(this.inf&&point.inf)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())||this.getY().cmp(point.getY())}isInfinity(){return this.inf}isOrder2(){if(this.inf)return false;return this.y.isZero()}isOdd(){if(this.inf)return false;return this.y.redIsOdd()}isEven(){if(this.inf)return false;return this.y.redIsEven()}isSquare(){if(this.inf)return false;return this.y.redJacobi()!==-1}eqX(x){assert(x instanceof BN);assert(!x.red);if(this.inf)return false;return this.getX().eq(x)}eqR(x){assert(x instanceof BN);assert(!x.red);assert(!this.curve.n.isZero());if(this.inf)return false;return this.getX().imod(this.curve.n).eq(x)}mul(k){return super.mul(k).toP()}muln(k){return super.muln(k).toP()}mulBlind(k,rng){return super.mulBlind(k,rng).toP()}mulAdd(k1,p2,k2){return super.mulAdd(k1,p2,k2).toP()}mulH(){return super.mulH().toP()}div(k){return super.div(k).toP()}divn(k){return super.divn(k).toP()}divH(){return super.divH().toP()}toP(){return this}toJ(){if(this.inf)return this.curve.jpoint();return this.curve.jpoint(this.x,this.y,this.curve.one)}encode(compact){if(compact==null)compact=true;assert(typeof compact==="boolean");const{fieldSize}=this.curve;if(this.inf)throw new Error("Invalid point.");if(compact){const p=bufferExports.Buffer.alloc(1+fieldSize);const x=this.curve.encodeField(this.getX());p[0]=2|this.y.redIsOdd();x.copy(p,1);return p}const p=bufferExports.Buffer.alloc(1+fieldSize*2);const x=this.curve.encodeField(this.getX());const y=this.curve.encodeField(this.getY());p[0]=4;x.copy(p,1);y.copy(p,1+fieldSize);return p}static decode(curve,bytes){assert(curve instanceof ShortCurve);assert(bufferExports.Buffer.isBuffer(bytes));const len=curve.fieldSize;if(bytes.length<1+len)throw new Error("Not a point.");const form=bytes[0];switch(form){case 2:case 3:{if(bytes.length!==1+len)throw new Error("Invalid point size for compressed.");const x=curve.decodeField(bytes.slice(1,1+len));if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");const p=curve.pointFromX(x,form===3);assert(!p.isInfinity());return p}case 4:case 6:case 7:{if(bytes.length!==1+len*2)throw new Error("Invalid point size for uncompressed.");const x=curve.decodeField(bytes.slice(1,1+len));const y=curve.decodeField(bytes.slice(1+len,1+2*len));if(x.cmp(curve.p)>=0||y.cmp(curve.p)>=0)throw new Error("Invalid point.");if(form!==4&&form!==(6|y.isOdd()))throw new Error("Invalid hybrid encoding.");const p=curve.point(x,y);if(!p.validate())throw new Error("Invalid point.");assert(!p.isInfinity());return p}default:{throw new Error("Unknown point format.")}}}encodeX(){return this.curve.encodeField(this.getX())}static decodeEven(curve,bytes){assert(curve instanceof ShortCurve);const x=curve.decodeField(bytes);if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");return curve.pointFromX(x,false)}static decodeSquare(curve,bytes){assert(curve instanceof ShortCurve);const x=curve.decodeField(bytes);if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");return curve.pointFromX(x)}toJSON(pre){if(this.inf)return[];const x=this.getX().toJSON();const y=this.getY().toJSON();if(pre===true&&this.pre)return[x,y,this.pre.toJSON()];return[x,y]}toPretty(){if(this.inf)return[];const size=this.curve.fieldSize*2;const x=toPretty(this.getX(),size);const y=toPretty(this.getY(),size);return[x,y]}static fromJSON(curve,json){assert(curve instanceof ShortCurve);assert(Array.isArray(json));assert(json.length===0||json.length===2||json.length===3);if(json.length===0)return curve.point();const x=BN.fromJSON(json[0]);const y=BN.fromJSON(json[1]);const point=curve.point(x,y);if(json.length>2&&json[2]!=null)point.pre=Precomp.fromJSON(point,json[2]);return point}[custom](){if(this.inf)return"";return""}}class JPoint extends Point{constructor(curve,x,y,z){assert(curve instanceof ShortCurve);super(curve,types.JACOBIAN);this.x=this.curve.one;this.y=this.curve.one;this.z=this.curve.zero;this.zOne=false;if(x!=null)this._init(x,y,z)}_init(x,y,z){assert(x instanceof BN);assert(y instanceof BN);assert(z==null||z instanceof BN);this.x=x;this.y=y;this.z=z||this.curve.one;if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z.eq(this.curve.one)}clone(){return this.curve.jpoint(this.x,this.y,this.z)}validate(){const{a,b}=this.curve;if(this.isInfinity())return true;if(this.zOne)return this.curve.validate(this.toP());const lhs=this.y.redSqr();const x3=this.x.redSqr().redMul(this.x);const z2=this.z.redSqr();const z4=z2.redSqr();const z6=z4.redMul(z2);const rhs=x3.redIAdd(b.redMul(z6));if(!this.curve.zeroA){if(this.curve.threeA)rhs.redIAdd(z4.redIMuln(-3).redMul(this.x));else rhs.redIAdd(a.redMul(z4).redMul(this.x))}return lhs.eq(rhs)}normalize(){if(this.zOne)return this;if(this.isInfinity())return this;const a=this.z.redInvert();const aa=a.redSqr();this.x=this.x.redMul(aa);this.y=this.y.redMul(aa).redMul(a);this.z=this.curve.one;this.zOne=true;return this}scale(a){assert(a instanceof BN);if(this.isInfinity())return this.curve.jpoint();const aa=a.redSqr();const nx=this.x.redMul(aa);const ny=this.y.redMul(aa).redMul(a);const nz=this.z.redMul(a);return this.curve.jpoint(nx,ny,nz)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(p){assert(p instanceof Point);if(p.type===types.AFFINE)return this._mixedAdd(p);return this._add(p)}_add(p){assert(p instanceof JPoint);if(this.isInfinity())return p;if(p.isInfinity())return this;if(this.zOne)return p._addJA(this);if(p.zOne)return this._addJA(p);return this._addJJ(p)}_mixedAdd(p){assert(p instanceof ShortPoint);if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;return this._addJA(p)}_addJJ(p){const z1z1=this.z.redSqr();const z2z2=p.z.redSqr();const u1=this.x.redMul(z2z2);const u2=p.x.redMul(z1z1);const s1=this.y.redMul(p.z).redMul(z2z2);const s2=p.y.redMul(this.z).redMul(z1z1);const h=u2.redISub(u1);const r=s2.redISub(s1);if(h.isZero()){if(!r.isZero())return this.curve.jpoint();return this.dbl()}const hh=h.redSqr();const hhh=h.redMul(hh);const v=u1.redMul(hh);const nx=r.redSqr().redISub(hhh).redISub(v).redISub(v);const ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh));const nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)}_addJA(p){const z1z1=this.z.redSqr();const u2=p.x.redMul(z1z1);const s2=p.y.redMul(this.z).redMul(z1z1);const h=u2.redISub(this.x);const r=s2.redISub(this.y).redIMuln(2);if(h.isZero()){if(!r.isZero())return this.curve.jpoint();return this.dbl()}const i=h.redMuln(2).redSqr();const j=h.redMul(i);const v=this.x.redMul(i);const nx=r.redSqr().redISub(j).redISub(v).redISub(v);const ny=r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2));const nz=this.z.redMul(h).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}dbl(){if(this.isInfinity())return this;if(this.y.isZero())return this.curve.jpoint();if(this.curve.zeroA)return this._dbl0();if(this.curve.threeA)return this._dbl3();return this._dblJ()}_dblJ(){const xx=this.x.redSqr();const yy=this.y.redSqr();const zz=this.z.redSqr();const s=this.x.redMul(yy).redIMuln(4);const m=xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr()));const t=m.redSqr().redISub(s).redISub(s);const nx=t;const ny=m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8));const nz=this.y.redMul(this.z).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}_dbl0(){const a=this.x.redSqr();const b=this.y.redSqr();const c=b.redSqr();const xb2=b.redIAdd(this.x).redSqr();const d=xb2.redISub(a).redISub(c).redIMuln(2);const e=a.redIMuln(3);const f=e.redSqr();const nx=f.redISub(d).redISub(d);const ny=e.redMul(d.redISub(nx)).redISub(c.redIMuln(8));const nz=this.y.redMul(this.z).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}_dbl3(){const delta=this.z.redSqr();const gamma=this.y.redSqr();const beta=this.x.redMul(gamma);const xmdelta=this.x.redSub(delta);const xpdelta=this.x.redAdd(delta);const alpha=xmdelta.redMul(xpdelta).redIMuln(3);const beta4=beta.redIMuln(4);const beta8=beta4.redMuln(2);const gamma28=gamma.redSqr().redIMuln(8);const nx=alpha.redSqr().redISub(beta8);const nz=this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);const ny=alpha.redMul(beta4.redISub(nx)).redISub(gamma28);return this.curve.jpoint(nx,ny,nz)}getX(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.x.fromRed()}getY(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.y.fromRed()}eq(p){assert(p instanceof JPoint);if(this===p)return true;if(this.isInfinity())return p.isInfinity();if(p.isInfinity())return false;if(this.z.eq(p.z)){return this.x.eq(p.x)&&this.y.eq(p.y)}const zz1=this.z.redSqr();const zz2=p.z.redSqr();const x1=this.x.redMul(zz2);const x2=p.x.redMul(zz1);if(!x1.eq(x2))return false;const zzz1=zz1.redMul(this.z);const zzz2=zz2.redMul(p.z);const y1=this.y.redMul(zzz2);const y2=p.y.redMul(zzz1);return y1.eq(y2)}cmp(point){assert(point instanceof JPoint);const inf1=this.isInfinity();const inf2=point.isInfinity();if(inf1&&!inf2)return-1;if(!inf1&&inf2)return 1;if(inf1&&inf2)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())||this.getY().cmp(point.getY())}isInfinity(){return this.z.isZero()}isOrder2(){if(this.isInfinity())return false;return this.y.isZero()}isOdd(){if(this.isInfinity())return false;this.normalize();return this.y.redIsOdd()}isEven(){if(this.isInfinity())return false;this.normalize();return this.y.redIsEven()}isSquare(){if(this.isInfinity())return false;return this.y.redMul(this.z).redJacobi()!==-1}eqX(x){assert(x instanceof BN);assert(!x.red);if(this.isInfinity())return false;const zz=this.z.redSqr();const rx=x.toRed(this.curve.red).redMul(zz);return this.x.eq(rx)}eqR(x){assert(x instanceof BN);assert(!x.red);if(!this.curve.smallGap)return this.toP().eqR(x);if(this.isInfinity())return false;if(x.cmp(this.curve.p)>=0)return false;const zz=this.z.redSqr();const rx=x.toRed(this.curve.red).redMul(zz);if(this.x.eq(rx))return true;if(this.curve.highOrder)return false;if(x.cmp(this.curve.pmodn)>=0)return false;const rn=this.curve.redN.redMul(zz);rx.redIAdd(rn);return this.x.eq(rx)}toP(){if(this.isInfinity())return this.curve.point();this.normalize();return this.curve.point(this.x,this.y)}toJ(){return this}encode(compact){return this.toP().encode(compact)}static decode(curve,bytes){return ShortPoint.decode(curve,bytes).toJ()}encodeX(){return this.toP().encodeX()}static decodeEven(curve,bytes){return ShortPoint.decodeEven(curve,bytes).toJ()}static decodeSquare(curve,bytes){return ShortPoint.decodeSquare(curve,bytes).toJ()}toJSON(pre){return this.toP().toJSON(pre)}toPretty(){return this.toP().toPretty()}static fromJSON(curve,json){return ShortPoint.fromJSON(curve,json).toJ()}[custom](){if(this.isInfinity())return"";return""}}class MontCurve extends Curve{constructor(conf){super(MontPoint,"mont",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.b=BN.fromJSON(conf.b).toRed(this.red);this.bi=this.b.redInvert();this.a2=this.a.redAdd(this.two);this.a24=this.a2.redMul(this.i4);this.a3=this.a.redMul(this.i3);this.a0=this.a.redMul(this.bi);this.b0=this.bi.redSqr();this._finalize(conf)}static _isomorphism(curveA,curveB,customB){assert(curveA instanceof BN);assert(curveB instanceof BN);assert(customB instanceof BN);const a=curveA.clone();const b=customB.clone();const c=curveB.redDiv(customB);if(c.redJacobi()!==1)throw new Error("Invalid `b` coefficient.");return[a,b]}_short(a0,odd){const{a,b,three}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const b3=b2.redMul(b);const n0=three.redSub(a2);const d0=b2.redMuln(3);const n1=a3.redMuln(2).redISub(a.redMuln(9));const d1=b3.redMuln(27);const wa=n0.redDiv(d0);const wb=n1.redDiv(d1);if(a0!=null)return ShortCurve._isomorphism(wa,wb,a0,odd);return[wa,wb]}_mont(b0){return MontCurve._isomorphism(this.a,this.b,b0)}_edwards(a0,invert=false){assert(typeof invert==="boolean");const{two,bi}=this;const a=this.a.redAdd(two).redMul(bi);const d=this.a.redSub(two).redMul(bi);if(invert)a.swap(d);if(a0!=null)return EdwardsCurve._isomorphism(a,d,a0);return[a,d]}_scaleShort(curve){assert(curve instanceof ShortCurve);const[u2,u3]=curve._scale(this);return[this.field(u2.redInvert()),this.field(u3.redInvert())]}_scaleMont(curve){assert(curve instanceof MontCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this.field(curve.b).redDivSqrt(this.b);return this.g.y.redDiv(this.field(curve.g.y))}_scaleEdwards(curve,invert){assert(curve instanceof EdwardsCurve);const c=curve._scale(this,invert);return this.field(c)}_solveY0(x){assert(x instanceof BN);const a=this.a0;const b=this.b0;const x2=x.redSqr();const x3=x2.redMul(x);const y2=x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x));return y2}_elligator2(u){const lhs=this.a0.redNeg();const rhs=this.one.redAdd(this.z.redMul(u.redSqr()));if(rhs.isZero())rhs.inject(this.one);const x1=lhs.redMul(rhs.redInvert());const x2=x1.redNeg().redISub(this.a0);const y1=this._solveY0(x1);const y2=this._solveY0(x2);const alpha=y1.redIsSquare()|0;const x0=[x1,x2][alpha^1];const y0=[y1,y2][alpha^1].redSqrt();if(y0.redIsOdd()!==u.redIsOdd())y0.redINeg();const x=this.b.redMul(x0);const y=this.b.redMul(y0);return this.point(x,y)}_invert2(p,hint){const{x,y}=p;const r=hint&1;const x0=x.redMul(this.bi);const y0=y.redMul(this.bi);const n=x0.redAdd(this.a0);const d=x0;const lhs=[n,d][r].redINeg();const rhs=[d,n][r].redMul(this.z);const u=lhs.redDivSqrt(rhs);if(u.redIsOdd()!==y0.redIsOdd())u.redINeg();return u}isElliptic(){const a2=this.a.redSqr();const d=this.b.redMul(a2.redSub(this.four));return!d.isZero()}jinv(){const{a,three,four}=this;const a2=a.redSqr();const t0=a2.redSub(three);const lhs=t0.redPown(3).redIMuln(256);const rhs=a2.redSub(four);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}point(x,y){return new MontPoint(this,x,y)}jpoint(x,y,z){assert(x==null&&y==null&&z==null);return this.point()}xpoint(x,z){return new XPoint(this,x,z)}solveY2(x){assert(x instanceof BN);const x2=x.redSqr();const x3=x2.redMul(x);const by2=x3.redIAdd(this.a.redMul(x2)).redIAdd(x);const y2=by2.redMul(this.bi);return y2}validate(point){assert(point instanceof MontPoint);if(point.isInfinity())return true;const{x,y}=point;const y2=this.solveY2(x);return y.redSqr().eq(y2)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(y.isZero()&&sign)throw new Error("Invalid point.");if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}isIsomorphic(curve,invert){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;if(curve.type==="mont"){const a=this.field(curve.a);const b=this.field(curve.b);if(!this.a.eq(a))return false;if(this.b.isZero())return false;const c=b.redDiv(this.b);return c.redJacobi()===1}return curve.isIsomorphic(this,invert)}isIsogenous(curve){assert(curve instanceof Curve);if(curve.type==="mont")return false;return curve.isIsogenous(this)}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const{a3,b}=this;const[u2,u3]=this._scale(point.curve);const x=this.field(point.x).redMul(u2);const y=this.field(point.y).redMul(u3);const u=b.redMul(x).redISub(a3);const v=b.redMul(y);return this.point(u,v)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const c=this._scale(point.curve);const u=this.field(point.x);const v=this.field(point.y);const nu=u;const nv=c.redMul(v);return this.point(nu,nv)}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);assert(point.curve.p.eq(this.p));const x=this.field(point.x);const y=this.field(point.y);const z=this.field(point.z);if(this.isIsogenous(point.curve)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=z.redSqr().redIMuln(2);const uu=y.redSqr();const uz=x.redSqr();const vv=c.redISub(uz).redISub(uu).redMul(y);const vz=uz.redMul(x);return this.cpoint(uu,uz,vv,vz)}if(this.isIsomorphic(point.curve,true)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=this._scale(point.curve,true);const uu=y.redAdd(z);const uz=y.redSub(z);const vv=c.redMul(z).redMul(uu);const vz=x.redMul(uz);return this.cpoint(uu,uz,vv,vz)}if(this.isIsomorphic(point.curve,false)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=this._scale(point.curve,false);const uu=z.redAdd(y);const uz=z.redSub(y);const vv=c.redMul(z).redMul(uu);const vz=x.redMul(uz);return this.cpoint(uu,uz,vv,vz)}throw new Error("Not implemented.")}pointFromUniform(u){assert(u instanceof BN);if(this.z.isZero()||this.a.isZero())throw new Error("Not implemented.");return this._elligator2(u)}pointToUniform(p,hint){assert(p instanceof MontPoint);assert(hint>>>0===hint);if(this.z.isZero()||this.a.isZero())throw new Error("Not implemented.");if(p.isInfinity())throw new Error("Invalid point.");const i=(hint>>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);return wrapErrors(()=>{return this._invert2(q,hint)})}decodePoint(bytes,sign){return MontPoint.decode(this,bytes,sign)}encodeX(point){assert(point instanceof XPoint);return point.encode()}decodeX(bytes){return XPoint.decode(this,bytes)}toShort(a0,odd,sign=null){const[a,b]=this._short(a0,odd);const curve=new ShortCurve({red:this.red,prime:this.prime,p:this.p,a:a,b:b,n:this.n,h:this.h});if(sign!=null){const[,u3]=curve._scale(this);if(u3.redIsOdd()!==sign)u3.redINeg()}if(!this.g.isInfinity())curve.g=curve.pointFromMont(this.g);for(let i=0;i";return""}}class XPoint extends Point{constructor(curve,x,z){assert(curve instanceof MontCurve);super(curve,types.PROJECTIVE);this.x=this.curve.one;this.z=this.curve.zero;if(x!=null)this._init(x,z)}_init(x,z){assert(x instanceof BN);assert(z==null||z instanceof BN);this.x=x;this.z=z||this.curve.one;if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}clone(){return this.curve.xpoint(this.x,this.z)}precompute(power,rng){return this}validate(){if(this.isInfinity())return true;const{x,z}=this;const x2=x.redSqr();const x3=x2.redMul(x);const z2=z.redSqr();const ax2=this.curve.a.redMul(x2).redMul(z);const by2=x3.redIAdd(ax2).redIAdd(x.redMul(z2));const y2=by2.redMul(this.curve.bi);return y2.redMul(z).redJacobi()!==-1}normalize(){if(this.isInfinity())return this;if(this.z.eq(this.curve.one))return this;this.x=this.x.redDiv(this.z);this.z=this.curve.one;return this}scale(a){assert(a instanceof BN);if(this.isInfinity())return this.curve.xpoint();const nx=this.x.redMul(a);const nz=this.z.redMul(a);return this.curve.xpoint(nx,nz)}neg(){return this}dbl(){const a=this.x.redAdd(this.z);const aa=a.redSqr();const b=this.x.redSub(this.z);const bb=b.redSqr();const c=aa.redSub(bb);const nx=aa.redMul(bb);const nz=c.redMul(bb.redIAdd(this.curve.a24.redMul(c)));return this.curve.xpoint(nx,nz)}diffAddDbl(p2,p3){assert(p2 instanceof XPoint);assert(p3 instanceof XPoint);const a=p2.x.redAdd(p2.z);const aa=a.redSqr();const b=p2.x.redSub(p2.z);const bb=b.redSqr();const e=aa.redSub(bb);const c=p3.x.redAdd(p3.z);const d=p3.x.redSub(p3.z);const da=d.redMul(a);const cb=c.redMul(b);const x5=this.z.redMul(da.redAdd(cb).redSqr());const z5=this.x.redMul(da.redISub(cb).redSqr());const x4=aa.redMul(bb);const z4=e.redMul(bb.redIAdd(this.curve.a24.redMul(e)));return[this.curve.xpoint(x4,z4),this.curve.xpoint(x5,z5)]}getX(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.x.fromRed()}getY(sign){return this.toP(sign).getY()}eq(p){assert(p instanceof XPoint);if(this===p)return true;if(this.isInfinity())return p.isInfinity();if(p.isInfinity())return false;if(this.z.eq(p.z))return this.x.eq(p.x);const x1=this.x.redMul(p.z);const x2=p.x.redMul(this.z);return x1.eq(x2)}cmp(point){assert(point instanceof XPoint);const inf1=this.isInfinity();const inf2=point.isInfinity();if(inf1&&!inf2)return-1;if(!inf1&&inf2)return 1;if(inf1&&inf2)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())}isInfinity(){return this.z.isZero()}isOrder2(){if(this.isInfinity())return false;return this.x.isZero()}isOdd(){return false}isEven(){return false}hasTorsion(){if(this.isInfinity())return false;if(this.x.isZero())return true;return super.hasTorsion()}order(){try{return this.toP().order()}catch(e){return new BN(1)}}jmul(k){assert(k instanceof BN);assert(!k.red);const bits=k.bitLength();let a=this.curve.xpoint();let b=this;for(let i=bits-1;i>=0;i--){const bit=k.bit(i);if(bit===0)[a,b]=this.diffAddDbl(a,b);else[b,a]=this.diffAddDbl(b,a)}return a}jmulBlind(k,rng){if(!rng)return this.jmul(k);return this.randomize(rng).jmul(k)}jmulAdd(k1,p2,k2){throw new Error("Not implemented.")}toP(sign=null){assert(sign==null||typeof sign==="boolean");if(this.isInfinity())return this.curve.point();this.normalize();return this.curve.pointFromX(this.x,sign)}toJ(){return this}toX(){return this}key(){if(this.isInfinity())return`${this.curve.uid}:oo`;this.normalize();const x=this.getX().toString(16);return`${this.curve.uid}:${x}`}encode(){return this.curve.encodeField(this.getX())}static decode(curve,bytes){assert(curve instanceof MontCurve);const x=curve.decodeField(bytes);x.iumaskn(curve.fieldBits);const p=curve.xpoint(x,curve.one);assert(!p.isInfinity());return p}toJSON(pre){return this.toP().toJSON(pre)}toPretty(){return this.toP().toPretty()}static fromJSON(curve,json){return MontPoint.fromJSON(curve,json).toX()}[custom](){if(this.isInfinity())return"";return""}}class EdwardsCurve extends Curve{constructor(conf){super(EdwardsPoint,"edwards",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.d=BN.fromJSON(conf.d).toRed(this.red);this.s=BN.fromJSON(conf.s||"0").toRed(this.red);this.si=this.s.isZero()?this.zero:this.s.redInvert();this.k=this.d.redMuln(2);this.smi=-this.d.redNeg().word(0);this.ad6=this.a.redAdd(this.d).redMul(this.i6);this.twisted=!this.a.eq(this.one);this.oneA=this.a.eq(this.one);this.mOneA=this.a.eq(this.one.redNeg());this.smallD=this.prime!=null&&this.d.redNeg().length===1;this.alt=null;this._finalize(conf)}static _isomorphism(curveA,curveD,customA){assert(curveA instanceof BN);assert(curveD instanceof BN);assert(customA instanceof BN);const a=customA.clone();const d=customA.redMul(curveD).redDiv(curveA);const c=curveA.redDiv(customA);if(c.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");return[a,d]}_short(a0,odd){const{a,d}=this;const a2=a.redSqr();const a3=a2.redMul(a);const d2=d.redSqr();const d3=d2.redMul(d);const ad14=a.redMul(d).redIMuln(14);const a2d=a2.redMul(d);const ad2=a.redMul(d2);const t0=a2d.redIAdd(ad2).redIMuln(33);const wa=a2.redAdd(ad14).redIAdd(d2).redDivn(-48);const wb=t0.redISub(a3).redISub(d3).redDivn(864);if(a0!=null)return ShortCurve._isomorphism(wa,wb,a0,odd);return[wa,wb]}_mont(b0,invert=false){assert(typeof invert==="boolean");let apd,amd;if(invert){apd=this.d.redAdd(this.a);amd=this.d.redSub(this.a)}else{apd=this.a.redAdd(this.d);amd=this.a.redSub(this.d)}const z=amd.redInvert();const a=apd.redMuln(2).redMul(z);const b=z.redMuln(4);if(b0!=null)return MontCurve._isomorphism(a,b,b0);return[a,b]}_edwards(a0){return EdwardsCurve._isomorphism(this.a,this.d,a0)}_scaleShort(curve){assert(curve instanceof ShortCurve);const[u2,u3]=curve._scale(this);return[this.field(u2.redInvert()),this.field(u3.redInvert())]}_scaleMont(curve,invert=false){assert(curve instanceof MontCurve);assert(typeof invert==="boolean");if(this.g.isInfinity()||curve.g.isInfinity()){const[a]=curve._edwards(null,invert);return this.field(a).redDivSqrt(this.a)}const x=curve.g.x.redDiv(curve.g.y);return this.g.x.redDiv(this.field(x))}_scaleEdwards(curve){assert(curve instanceof EdwardsCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this.field(curve.a).redDivSqrt(this.a);return this.g.x.redDiv(this.field(curve.g.x))}_mulA(num){assert(num instanceof BN);if(this.oneA)return num.clone();if(this.mOneA)return num.redNeg();return this.a.redMul(num)}_mulD(num){assert(num instanceof BN);if(this.smallD)return num.redMuln(this.smi);return this.d.redMul(num)}_elligator1(t){const{s,si,i2,one,two}=this;const c=si.redSqr().redIMuln(2);const ci=s.redSqr().redMul(i2);const ci2=ci.redSqr();const r=c.redAdd(ci);const r2=r.redSqr().redISub(two);const cm1=c.redSub(one);const uu=one.redSub(t);const uz=one.redAdd(t);const u=uz.isZero()?uz:uu.redDiv(uz);const u2=u.redSqr();const u3=u2.redMul(u);const u5=u3.redMul(u2);const v=u5.redAdd(r2.redMul(u3)).redIAdd(u);const f0=this.field(v.redJacobi());const f1=this.field(u2.redAdd(ci2).redJacobi());const f2=f0.redMul(f1);const X=f0.redMul(u);const Y=f0.redMul(v).redSqrt().redMul(f2);const X1=one.redAdd(X);const rX=r.redMul(X);const X12=X1.redSqr();const xx=cm1.redMul(s).redMul(X).redMul(X1);const xz=u.isZero()?this.one:Y;const yy=rX.redSub(X12);const yz=rX.redAdd(X12);return this.cpoint(xx,xz,yy,yz)}_invert1(p,hint){const{s,si,i2,one}=this;const{x,y,z}=p;const sign=hint&1;const c=si.redSqr().redIMuln(2);const ci=s.redSqr().redMul(i2);const ci2=ci.redSqr();const r=c.redAdd(ci);const cm1=c.redSub(one);const nn=y.redSub(z);const nz=y.redAdd(z).redIMuln(2);const n=nz.isZero()?nz:nn.redDiv(nz);const nr1=one.redAdd(n.redMul(r));const w2=nr1.redSqr().redISub(one);const w=w2.redSqrt();const X=w.redSub(nr1);const X1=one.redAdd(X);const YY=cm1.redMul(s).redMul(X).redMul(X1);const Y=YY.redMul(x.redMul(z));const X2=X.redSqr().redIAdd(ci2);const Z=this.field(Y.redMul(X2).redJacobi());const u=Z.redMul(X);const tt=one.redSub(u);const tz=one.redAdd(u);const t=tz.isZero()?tz:tt.redDiv(tz);if(t.redIsOdd()!==Boolean(sign))t.redINeg();return t}_alt(){if(!this.alt)this.alt=this.toMont();return this.alt}isElliptic(){const ad=this.a.redMul(this.d);const amd=this.a.redSub(this.d);return!ad.redMul(amd).isZero()}jinv(){const{a,d}=this;const ad=a.redMul(d);const amd4=a.redSub(d).redPown(4);const a2=a.redSqr();const d2=d.redSqr();const t0=a2.redAdd(ad.redMuln(14)).redIAdd(d2);const lhs=t0.redPown(3).redIMuln(16);const rhs=ad.redMul(amd4);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}isComplete(){return this.a.redJacobi()===1&&this.d.redJacobi()===-1}point(x,y,z,t){return new EdwardsPoint(this,x,y,z,t)}jpoint(x,y,z){assert(x==null&&y==null&&z==null);return this.point()}cpoint(xx,xz,yy,yz){assert(xx instanceof BN);assert(xz instanceof BN);assert(yy instanceof BN);assert(yz instanceof BN);const x=xx.redMul(yz);const y=yy.redMul(xz);const z=xz.redMul(yz);const t=xx.redMul(yy);return this.point(x,y,z,t)}solveX2(y){assert(y instanceof BN);const y2=y.redSqr();const rhs=this._mulD(y2).redISub(this.a);const lhs=y2.redISub(this.one);const x2=lhs.redDiv(rhs);return x2}solveX(y){const y2=y.redSqr();const rhs=this._mulD(y2).redISub(this.a);const lhs=y2.redISub(this.one);return lhs.redDivSqrt(rhs)}solveY2(x){assert(x instanceof BN);const x2=x.redSqr();const lhs=this._mulA(x2).redISub(this.one);const rhs=this._mulD(x2).redISub(this.one);const y2=lhs.redDiv(rhs);return y2}solveY(x){const x2=x.redSqr();const lhs=this._mulA(x2).redISub(this.one);const rhs=this._mulD(x2).redISub(this.one);return lhs.redDivSqrt(rhs)}validate(point){assert(point instanceof EdwardsPoint);if(point.zOne){const x2=point.x.redSqr();const y2=point.y.redSqr();const dxy=this._mulD(x2).redMul(y2);const lhs=this._mulA(x2).redIAdd(y2);const rhs=this.one.redAdd(dxy);const tz=point.t;const xy=point.x.redMul(point.y);return lhs.eq(rhs)&&tz.eq(xy)}const x2=point.x.redSqr();const y2=point.y.redSqr();const z2=point.z.redSqr();const z4=z2.redSqr();const dxy=this._mulD(x2).redMul(y2);const lhs=this._mulA(x2).redIAdd(y2).redMul(z2);const rhs=z4.redIAdd(dxy);const tz=point.t.redMul(point.z);const xy=point.x.redMul(point.y);return lhs.eq(rhs)&&tz.eq(xy)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(y.isZero()&&sign)throw new Error("Invalid point.");if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}pointFromY(y,sign=null){assert(y instanceof BN);assert(sign==null||typeof sign==="boolean");if(!y.red)y=y.toRed(this.red);const x=this.solveX(y);if(sign!=null){if(x.isZero()&&sign)throw new Error("Invalid point.");if(x.redIsOdd()!==sign)x.redINeg()}return this.point(x,y)}isIsomorphic(curve,invert=false){assert(curve instanceof Curve);assert(typeof invert==="boolean");if(!curve.p.eq(this.p))return false;if(curve.type==="short")return curve.isIsomorphic(this);if(curve.type==="mont"){const a=this.field(curve.a);let apd,amd;if(invert){apd=this.d.redAdd(this.a);amd=this.d.redSub(this.a)}else{apd=this.a.redAdd(this.d);amd=this.a.redSub(this.d)}return a.redMul(amd).eq(apd.redIMuln(2))}if(curve.type==="edwards"){const a=this.field(curve.a);const d=this.field(curve.d);return this.a.redMul(d).eq(a.redMul(this.d))}return false}isIsogenous(curve){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;if(curve.type==="mont"){if(!this.a.eq(this.one))return false;const a=this.field(curve.a);const b=this.field(curve.b);const d24=this.two.redSub(this.d.redMuln(4));return a.eq(d24)&&b.eq(this.one)}if(curve.type==="edwards"){const a=this.field(curve.a);const d=this.field(curve.d);return a.eq(this.a.redNeg())&&d.eq(this.d.redSub(this.a))}return false}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();if(point.y.isZero())return this.point(this.zero,this.one.redNeg());const{a,d}=this;const[u2,u3]=this._scale(point.curve);const a5=a.redMuln(5);const d5=d.redMuln(5);const x=this.field(point.x).redMul(u2);const y=this.field(point.y).redMul(u3);const x6=x.redMuln(6);const x12=x.redMuln(12);const xx=x6.redSub(a).redISub(d);const xz=y.redMuln(6);const yy=x12.redSub(a5).redIAdd(d);const yz=x12.redAdd(a).redISub(d5);return this.cpoint(xx,xz,yy,yz)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);assert(point.curve.p.eq(this.p));const u=this.field(point.x);const v=this.field(point.y);if(this.isIsogenous(point.curve)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point();const u2=u.redSqr();const u3=u2.redMul(u);const u4=u3.redMul(u);const u5=u4.redMul(u);const v2=v.redSqr();const a=v.redMuln(4);const b=u2.redSub(this.one);const c=u2.redMuln(2);const d=v2.redMuln(4);const e=u3.redIMuln(2);const f=u.redMul(v2).redIMuln(4);const g=u2.redMul(v2).redIMuln(2);const h=v2.redIMuln(2);const xx=a.redMul(b);const xz=u4.redISub(c).redIAdd(d).redIAdd(this.one);const yy=u5.redSub(e).redISub(f).redIAdd(u).redINeg();const yz=u5.redISub(g).redISub(e).redISub(h).redIAdd(u);return this.cpoint(xx,xz,yy,yz).divn(4)}if(this.isIsomorphic(point.curve,true)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.one.redNeg());const c=this._scale(point.curve,true);const xx=c.redMul(u);const xz=v;const yy=u.redAdd(this.one);const yz=u.redSub(this.one);return this.cpoint(xx,xz,yy,yz)}if(this.isIsomorphic(point.curve,false)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.one.redNeg());const c=this._scale(point.curve,false);const xx=c.redMul(u);const xz=v;const yy=u.redSub(this.one);const yz=u.redAdd(this.one);return this.cpoint(xx,xz,yy,yz)}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);assert(point.curve.p.eq(this.p));const a=this.field(point.curve.a);const x=this.field(point.x);const y=this.field(point.y);const z=this.field(point.z);const t=this.field(point.t);if(this.isIsogenous(point.curve)){const xy=x.redMul(y);const x2=x.redSqr();const y2=y.redSqr();const z2=z.redSqr();const ax2=a.redMul(x2);const xx=xy.redIMuln(2);const xz=y2.redSub(ax2);const yy=y2.redAdd(ax2);const yz=z2.redIMuln(2).redISub(yy);const p=this.cpoint(xx,xz,yy,yz);return!this.twisted?p.divn(4):p}if(this.isIsomorphic(point.curve)){const c=this._scale(point.curve);const nx=c.redMul(x);const ny=y;const nz=z;const nt=c.redMul(t);return this.point(nx,ny,nz,nt)}throw new Error("Not implemented.")}pointFromUniform(u,curve=null){assert(u instanceof BN);assert(u.red===this.red);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const u0=curve.field(u);const p0=curve.pointFromUniform(u0);return this.pointFromMont(p0)}pointToUniform(p,hint,curve=null){assert(p instanceof EdwardsPoint);assert(hint>>>0===hint);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const i=(hint>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);const p0=curve.pointFromEdwards(q);const u0=curve.pointToUniform(p0,hint&15);return this.field(u0)}pointFromHash(bytes,pake,curve=null){assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const p0=curve.pointFromHash(bytes,pake);return this.pointFromMont(p0)}pointToHash(p,subgroup,rng,curve=null){assert(p instanceof EdwardsPoint);assert(subgroup>>>0===subgroup);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const i=subgroup%this.torsion.length;const q=p.add(this.torsion[i]);const p0=curve.pointFromEdwards(q);return curve.pointToHash(p0,0,rng)}decodePoint(bytes){return EdwardsPoint.decode(this,bytes)}toShort(a0,odd,sign=null){const[a,b]=this._short(a0,odd);const curve=new ShortCurve({red:this.red,prime:this.prime,p:this.p,a:a,b:b,n:this.n,h:this.h});if(sign!=null){const[,u3]=curve._scale(this);if(u3.redIsOdd()!==sign)u3.redINeg()}if(!this.g.isInfinity())curve.g=curve.pointFromEdwards(this.g);for(let i=0;i=0)throw new Error("Invalid point.");return curve.pointFromY(y,sign)}toJSON(pre){if(this.isInfinity())return[];const x=this.getX().toJSON();const y=this.getY().toJSON();if(pre===true&&this.pre)return[x,y,this.pre.toJSON()];return[x,y]}toPretty(){const size=this.curve.fieldSize*2;const x=toPretty(this.getX(),size);const y=toPretty(this.getY(),size);return[x,y]}static fromJSON(curve,json){assert(curve instanceof EdwardsCurve);assert(Array.isArray(json));assert(json.length===0||json.length===2||json.length===3);if(json.length===0)return curve.point();const x=BN.fromJSON(json[0]);const y=BN.fromJSON(json[1]);const point=curve.point(x,y);if(json.length>2&&json[2]!=null)point.pre=Precomp.fromJSON(point,json[2]);return point}[custom](){if(this.isInfinity())return"";return""}}class Precomp{constructor(){this.naf=null;this.windows=null;this.doubles=null;this.blinding=null;this.beta=null}map(func){assert(typeof func==="function");const out=new this.constructor;if(this.naf)out.naf=this.naf.map(func);if(this.doubles)out.doubles=this.doubles.map(func);return out}toJSON(){return{naf:this.naf?this.naf.toJSON():null,windows:this.windows?this.windows.toJSON():null,doubles:this.doubles?this.doubles.toJSON():null,blinding:this.blinding?this.blinding.toJSON():undefined}}fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");if(json.naf!=null)this.naf=NAF.fromJSON(point,json.naf);if(json.windows!=null)this.windows=Windows.fromJSON(point,json.windows);if(json.doubles!=null)this.doubles=Doubles.fromJSON(point,json.doubles);if(json.blinding!=null)this.blinding=Blinding.fromJSON(point,json.blinding);return this}static fromJSON(point,json){return(new this).fromJSON(point,json)}}class NAF{constructor(width,points){this.width=width;this.points=points}map(func){assert(typeof func==="function");const{width}=this;const points=[];for(const point of this.points)points.push(func(point));return new this.constructor(width,points)}toJSON(){return{width:this.width,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.width>>>0===json.width);assert(Array.isArray(json.points));const{curve}=point;const{width}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(width,points)}}class Windows{constructor(width,bits,points){this.width=width;this.bits=bits;this.points=points}toJSON(){return{width:this.width,bits:this.bits,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.width>>>0===json.width);assert(json.bits>>>0===json.bits);assert(Array.isArray(json.points));const{curve}=point;const{width,bits}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(width,bits,points)}}class Doubles{constructor(step,points){this.step=step;this.points=points}map(func){assert(typeof func==="function");const{step}=this;const points=[];for(const point of this.points)points.push(func(point));return new this.constructor(step,points)}toJSON(){return{step:this.step,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.step>>>0===json.step);assert(Array.isArray(json.points));const{curve}=point;const{step}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(step,points)}}class Blinding{constructor(blind,unblind){this.blind=blind;this.unblind=unblind}toJSON(){return{blind:this.blind.toJSON(),unblind:this.unblind.toJSON()}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");const{curve}=point;const blind=BN.fromJSON(json.blind);const unblind=curve.pointFromJSON(json.unblind);return new this(blind,unblind)}}class Endo{constructor(beta,lambda,basis,pre){this.beta=beta;this.lambda=lambda;this.basis=basis;this.pre=pre}toJSON(){return{beta:this.beta.fromRed().toJSON(),lambda:this.lambda.toJSON(),basis:[this.basis[0].toJSON(),this.basis[1].toJSON()],pre:[this.pre[0],this.pre[1].toJSON(),this.pre[2].toJSON()]}}static fromJSON(curve,json){assert(curve instanceof Curve);assert(json&&typeof json==="object");assert(Array.isArray(json.basis));assert(Array.isArray(json.pre));assert(json.basis.length===2);assert(json.pre.length===3);assert(json.pre[0]>>>0===json.pre[0]);const beta=BN.fromJSON(json.beta).toRed(curve.red);const lambda=BN.fromJSON(json.lambda);const basis=[Vector.fromJSON(json.basis[0]),Vector.fromJSON(json.basis[1])];const pre=[json.pre[0],BN.fromJSON(json.pre[1]),BN.fromJSON(json.pre[2])];return new this(beta,lambda,basis,pre)}}class Vector{constructor(a,b){this.a=a;this.b=b}toJSON(){return{a:this.a.toJSON(),b:this.b.toJSON()}}static fromJSON(json){assert(json&&typeof json==="object");const a=BN.fromJSON(json.a);const b=BN.fromJSON(json.b);return new this(a,b)}}class P192 extends ShortCurve{constructor(pre){super({id:"P192",ossl:"prime192v1",type:"short",endian:"be",hash:"SHA256",prime:"p192",p:["ffffffff ffffffff ffffffff fffffffe","ffffffff ffffffff"],a:["ffffffff ffffffff ffffffff fffffffe","ffffffff fffffffc"],b:["64210519 e59c80e7 0fa7e9ab 72243049","feb8deec c146b9b1"],n:["ffffffff ffffffff ffffffff 99def836","146bc9b1 b4d22831"],h:"1",z:"-5",g:[["188da80e b03090f6 7cbf20eb 43a18800","f4ff0afd 82ff1012"],["07192b95 ffc8da78 631011ed 6b24cdd5","73f977a1 1e794811"],pre]})}}class P224 extends ShortCurve{constructor(pre){super({id:"P224",ossl:"secp224r1",type:"short",endian:"be",hash:"SHA256",prime:"p224",p:["ffffffff ffffffff ffffffff ffffffff","00000000 00000000 00000001"],a:["ffffffff ffffffff ffffffff fffffffe","ffffffff ffffffff fffffffe"],b:["b4050a85 0c04b3ab f5413256 5044b0b7","d7bfd8ba 270b3943 2355ffb4"],n:["ffffffff ffffffff ffffffff ffff16a2","e0b8f03e 13dd2945 5c5c2a3d"],h:"1",z:"1f",g:[["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3","56c21122 343280d6 115c1d21"],["bd376388 b5f723fb 4c22dfe6 cd4375a0","5a074764 44d58199 85007e34"],pre]})}}class P256 extends ShortCurve{constructor(pre){super({id:"P256",ossl:"prime256v1",type:"short",endian:"be",hash:"SHA256",prime:null,p:["ffffffff 00000001 00000000 00000000","00000000 ffffffff ffffffff ffffffff"],a:["ffffffff 00000001 00000000 00000000","00000000 ffffffff ffffffff fffffffc"],b:["5ac635d8 aa3a93e7 b3ebbd55 769886bc","651d06b0 cc53b0f6 3bce3c3e 27d2604b"],n:["ffffffff 00000000 ffffffff ffffffff","bce6faad a7179e84 f3b9cac2 fc632551"],h:"1",z:"-a",g:[["6b17d1f2 e12c4247 f8bce6e5 63a440f2","77037d81 2deb33a0 f4a13945 d898c296"],["4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16","2bce3357 6b315ece cbb64068 37bf51f5"],pre]})}}class P384 extends ShortCurve{constructor(pre){super({id:"P384",ossl:"secp384r1",type:"short",endian:"be",hash:"SHA384",prime:null,p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff fffffffe","ffffffff 00000000 00000000 ffffffff"],a:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff fffffffe","ffffffff 00000000 00000000 fffffffc"],b:["b3312fa7 e23ee7e4 988e056b e3f82d19","181d9c6e fe814112 0314088f 5013875a","c656398d 8a2ed19d 2a85c8ed d3ec2aef"],n:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff c7634d81 f4372ddf","581a0db2 48b0a77a ecec196a ccc52973"],h:"1",z:"-c",g:[["aa87ca22 be8b0537 8eb1c71e f320ad74","6e1d3b62 8ba79b98 59f741e0 82542a38","5502f25d bf55296c 3a545e38 72760ab7"],["3617de4a 96262c6f 5d9e98bf 9292dc29","f8f41dbd 289a147c e9da3113 b5f0b8c0","0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"],pre]})}}class P521 extends ShortCurve{constructor(pre){super({id:"P521",ossl:"secp521r1",type:"short",endian:"be",hash:"SHA512",prime:"p521",p:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff"],a:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","fffffffc"],b:["00000051 953eb961 8e1c9a1f 929a21a0","b68540ee a2da725b 99b315f3 b8b48991","8ef109e1 56193951 ec7e937b 1652c0bd","3bb1bf07 3573df88 3d2c34f1 ef451fd4","6b503f00"],n:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","fffffffa 51868783 bf2f966b 7fcc0148","f709a5d0 3bb5c9b8 899c47ae bb6fb71e","91386409"],h:"1",z:"-4",g:[["000000c6 858e06b7 0404e9cd 9e3ecb66","2395b442 9c648139 053fb521 f828af60","6b4d3dba a14b5e77 efe75928 fe1dc127","a2ffa8de 3348b3c1 856a429b f97e7e31","c2e5bd66"],["00000118 39296a78 9a3bc004 5c8a5fb4","2c7d1bd9 98f54449 579b4468 17afbd17","273e662c 97ee7299 5ef42640 c550b901","3fad0761 353c7086 a272c240 88be9476","9fd16650"],pre]})}}class SECP256K1 extends ShortCurve{constructor(pre){super({id:"SECP256K1",ossl:"secp256k1",type:"short",endian:"be",hash:"SHA256",prime:"k256",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe fffffc2f"],a:"0",b:"7",n:["ffffffff ffffffff ffffffff fffffffe","baaedce6 af48a03b bfd25e8c d0364141"],h:"1",z:"1",c:["0a2d2ba9 3507f1df 233770c2 a797962c","c61f6d15 da14ecd4 7d8d27ae 1cd5f852"],g:[["79be667e f9dcbbac 55a06295 ce870b07","029bfcdb 2dce28d9 59f2815b 16f81798"],["483ada77 26a3c465 5da4fbfc 0e1108a8","fd17b448 a6855419 9c47d08f fb10d4b8"],pre],endo:{beta:["7ae96a2b 657c0710 6e64479e ac3434e9","9cf04975 12f58995 c1396c28 719501ee"],lambda:["5363ad4c c05c30e0 a5261c02 8812645a","122e22ea 20816678 df02967c 1b23bd72"],basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],pre:[384,["3086d221 a7d46bcd e86c90e4 9284eb15","3daa8a14 71e8ca7f e893209a 45dbb031"],["-","e4437ed6 010e8828 6f547fa9 0abfe4c4","221208ac 9df506c6 1571b4ae 8ac47f71"]]}})}}class BRAINPOOLP256 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP256",ossl:"brainpoolP256r1",type:"short",endian:"be",hash:"SHA256",prime:null,p:["a9fb57db a1eea9bc 3e660a90 9d838d72","6e3bf623 d5262028 2013481d 1f6e5377"],a:["7d5a0975 fc2c3057 eef67530 417affe7","fb8055c1 26dc5c6c e94a4b44 f330b5d9"],b:["26dc5c6c e94a4b44 f330b5d9 bbd77cbf","95841629 5cf7e1ce 6bccdc18 ff8c07b6"],n:["a9fb57db a1eea9bc 3e660a90 9d838d71","8c397aa3 b561a6f7 901e0e82 974856a7"],h:"1",z:"-2",g:[["8bd2aeb9 cb7e57cb 2c4b482f fc81b7af","b9de27e1 e3bd23c2 3a4453bd 9ace3262"],["547ef835 c3dac4fd 97f8461a 14611dc9","c2774513 2ded8e54 5c1d54c7 2f046997"],pre]})}}class BRAINPOOLP384 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP384",ossl:"brainpoolP384r1",type:"short",endian:"be",hash:"SHA384",prime:null,p:["8cb91e82 a3386d28 0f5d6f7e 50e641df","152f7109 ed5456b4 12b1da19 7fb71123","acd3a729 901d1a71 87470013 3107ec53"],a:["7bc382c6 3d8c150c 3c72080a ce05afa0","c2bea28e 4fb22787 139165ef ba91f90f","8aa5814a 503ad4eb 04a8c7dd 22ce2826"],b:["04a8c7dd 22ce2826 8b39b554 16f0447c","2fb77de1 07dcd2a6 2e880ea5 3eeb62d5","7cb43902 95dbc994 3ab78696 fa504c11"],n:["8cb91e82 a3386d28 0f5d6f7e 50e641df","152f7109 ed5456b3 1f166e6c ac0425a7","cf3ab6af 6b7fc310 3b883202 e9046565"],h:"1",z:"-5",g:[["1d1c64f0 68cf45ff a2a63a81 b7c13f6b","8847a3e7 7ef14fe3 db7fcafe 0cbd10e8","e826e034 36d646aa ef87b2e2 47d4af1e"],["8abe1d75 20f9c2a4 5cb1eb8e 95cfd552","62b70b29 feec5864 e19c054f f9912928","0e464621 77918111 42820341 263c5315"],pre]})}}class BRAINPOOLP512 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP512",ossl:"brainpoolP512r1",type:"short",endian:"be",hash:"SHA512",prime:null,p:["aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07","cb308db3 b3c9d20e d6639cca 70330871","7d4d9b00 9bc66842 aecda12a e6a380e6","2881ff2f 2d82c685 28aa6056 583a48f3"],a:["7830a331 8b603b89 e2327145 ac234cc5","94cbdd8d 3df91610 a83441ca ea9863bc","2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5","7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca"],b:["3df91610 a83441ca ea9863bc 2ded5d5a","a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7","2bf2c7b9 e7c1ac4d 77fc94ca dc083e67","984050b7 5ebae5dd 2809bd63 8016f723"],n:["aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07","cb308db3 b3c9d20e d6639cca 70330870","553e5c41 4ca92619 41866119 7fac1047","1db1d381 085ddadd b5879682 9ca90069"],h:"1",z:"7",g:[["81aee4bd d82ed964 5a21322e 9c4c6a93","85ed9f70 b5d916c1 b43b62ee f4d0098e","ff3b1f78 e2d0d48d 50d1687b 93b97d5f","7c6d5047 406a5e68 8b352209 bcb9f822"],["7dde385d 566332ec c0eabfa9 cf7822fd","f209f700 24a57b1a a000c55b 881f8111","b2dcde49 4a5f485e 5bca4bd8 8a2763ae","d1ca2b2f a8f05406 78cd1e0f 3ad80892"],pre]})}}class X25519 extends MontCurve{constructor(){super({id:"X25519",ossl:"X25519",type:"mont",endian:"le",hash:"SHA512",prime:"p25519",p:["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffed"],a:"76d06",b:"1",n:["10000000 00000000 00000000 00000000","14def9de a2f79cd6 5812631a 5cf5d3ed"],h:"8",z:"2",g:[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000009"],["5f51e65e 475f794b 1fe122d3 88b72eb3","6dc2b281 92839e4d d6163a5d 81312c14"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"],["6be4f497 f9a9c2af c21fa77a d7f4a6ef","635a11c7 284a9363 e9a248ef 9c884415"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"],["141b0b68 06563d50 3de05885 280b5910","9ca5ee38 d7b56c9c 165db710 6377bbd8"]],[["57119fd0 dd4e22d8 868e1c58 c45c4404","5bef839c 55b1d0b1 248c50a3 bc959c5f"],["68c59389 3d458e64 31c6ca00 45fb5015","20a44346 8eaa68dd 0f103842 048065b7"]],[["57119fd0 dd4e22d8 868e1c58 c45c4404","5bef839c 55b1d0b1 248c50a3 bc959c5f"],["173a6c76 c2ba719b ce3935ff ba04afea","df5bbcb9 71559722 f0efc7bd fb7f9a36"]],[["00b8495f 16056286 fdb1329c eb8d09da","6ac49ff1 fae35616 aeb8413b 7c7aebe0"],["3931c129 569e83a5 29482c14 e628b457","933bfc29 ed801b4d 68871483 92507b1a"]],[["00b8495f 16056286 fdb1329c eb8d09da","6ac49ff1 fae35616 aeb8413b 7c7aebe0"],["46ce3ed6 a9617c5a d6b7d3eb 19d74ba8","6cc403d6 127fe4b2 9778eb7c 6daf84d3"]]]})}}class X448 extends MontCurve{constructor(){super({id:"X448",ossl:"X448",type:"mont",endian:"le",hash:"SHAKE256",prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"262a6",b:"1",n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000005"],["7d235d12 95f5b1f6 6c98ab6e 58326fce","cbae5d34 f55545d0 60f75dc2 8df3f6ed","b8027e23 46430d21 1312c4b1 50677af7","6fd7223d 457b5b1a"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["ba4d3a08 29b6112f 8812e51b a0bb2abe","bc1cb08e b48e5569 36ba50fd d2e7d68a","f8cb3216 0522425b 3f990812 abbe635a","d37a21e1 7551b193"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["45b2c5f7 d649eed0 77ed1ae4 5f44d541","43e34f71 4b71aa96 c945af01 2d182975","0734cde9 faddbda4 c066f7ed 54419ca5","2c85de1e 8aae4e6c"]]]})}}class MONT448 extends MontCurve{constructor(){super({id:"MONT448",ossl:null,type:"mont",endian:"le",hash:"SHAKE256",prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:["b2cf97d2 d43459a9 31ed36b1 fc4e3cb5","5d93f8d2 22746997 60ccffc6 49961ed6","c5b05fca c24864ed 6fb59697 931b78da","84ddecd8 ca2b5cfb"],b:"1",n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["ac0d24cc c6c75cb0 eb71f81e 7a6edf51","48e88aee 009a2a24 e795687e c28e125a","3e6730a6 0d46367b aa7fe99d 152128dc","41321bc7 7817f059"],["5a4437f6 80c0d0db 9b061276 d5d0ffcc","e786ff33 b6a53d30 98746425 82e66f09","4433dae7 7244a6e2 6b11e905 7228f483","556c41a5 913f55fe"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["bec92fd0 6da2acf2 b4e261e8 7cef0d34","22e75c18 3c589857 b71924e5 73c2f9ce","e18da5f2 466e2f39 3c2eedf0 f105a60a","b40c717d 4f1e1fd7"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["4136d02f 925d530d 4b1d9e17 8310f2cb","dd18a3e7 c3a767a8 48e6db19 8c3d0631","1e725a0d b991d0c6 c3d1120f 0efa59f5","4bf38e82 b0e1e028"]]]})}}class ED25519 extends EdwardsCurve{constructor(pre){super({id:"ED25519",ossl:"ED25519",type:"edwards",endian:"le",hash:"SHA512",prefix:"SigEd25519 no Ed25519 collisions",context:false,prime:"p25519",p:["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffed"],a:"-1",d:["52036cee 2b6ffe73 8cc74079 7779e898","00700a4d 4141d8ab 75eb4dca 135978a3"],n:["10000000 00000000 00000000 00000000","14def9de a2f79cd6 5812631a 5cf5d3ed"],h:"8",z:"2",g:[["216936d3 cd6e53fe c0a4e231 fdd6dc5c","692cc760 9525a7b2 c9562d60 8f25d51a"],["66666666 66666666 66666666 66666666","66666666 66666666 66666666 66666658"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffec"]],[["2b832480 4fc1df0b 2b4d0099 3dfbd7a7","2f431806 ad2fe478 c4ee1b27 4a0ea0b0"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["547cdb7f b03e20f4 d4b2ff66 c2042858","d0bce7f9 52d01b87 3b11e4d8 b5f15f3d"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["1fd5b9a0 06394a28 e9339932 38de4abb","5c193c70 13e5e238 dea14646 c545d14a"],["05fc536d 880238b1 3933c6d3 05acdfd5","f098eff2 89f4c345 b027b2c2 8f95e826"]],[["602a465f f9c6b5d7 16cc66cd c721b544","a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3"],["05fc536d 880238b1 3933c6d3 05acdfd5","f098eff2 89f4c345 b027b2c2 8f95e826"]],[["1fd5b9a0 06394a28 e9339932 38de4abb","5c193c70 13e5e238 dea14646 c545d14a"],["7a03ac92 77fdc74e c6cc392c fa53202a","0f67100d 760b3cba 4fd84d3d 706a17c7"]],[["602a465f f9c6b5d7 16cc66cd c721b544","a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3"],["7a03ac92 77fdc74e c6cc392c fa53202a","0f67100d 760b3cba 4fd84d3d 706a17c7"]]]})}}class ISO448 extends EdwardsCurve{constructor(pre){super({id:"ISO448",ossl:null,type:"edwards",endian:"le",hash:"SHAKE256",prefix:"SigEd448",context:true,prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"1",d:["d78b4bdc 7f0daf19 f24f38c2 9373a2cc","ad461572 42a50f37 809b1da3 412a12e7","9ccc9c81 264cfe9a d0809970 58fb61c4","243cc32d baa156b9"],n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["79a70b2b 70400553 ae7c9df4 16c792c6","1128751a c9296924 0c25a07d 728bdc93","e21f7787 ed697224 9de732f3 8496cd11","69871309 3e9c04fc"],["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 80000000","00000000 00000000 00000000 00000000","00000000 00000001"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]]]})}}class ED448 extends EdwardsCurve{constructor(pre){super({id:"ED448",ossl:"ED448",type:"edwards",endian:"le",hash:"SHAKE256",prefix:"SigEd448",context:true,prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"1",d:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffff6756"],n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["4f1970c6 6bed0ded 221d15a6 22bf36da","9e146570 470f1767 ea6de324 a3d3a464","12ae1af7 2ab66511 433b80e1 8b00938e","2626a82b c70cc05e"],["693f4671 6eb6bc24 88762037 56c9c762","4bea7373 6ca39840 87789c1e 05a0c2d7","3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad","9808795b f230fa14"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]]]})}}const curves={__proto__:null,P192:P192,P224:P224,P256:P256,P384:P384,P521:P521,SECP256K1:SECP256K1,BRAINPOOLP256:BRAINPOOLP256,BRAINPOOLP384:BRAINPOOLP384,BRAINPOOLP512:BRAINPOOLP512,X25519:X25519,X448:X448,MONT448:MONT448,ED25519:ED25519,ISO448:ISO448,ED448:ED448};const cache={__proto__:null,P192:null,P224:null,P256:null,P384:null,P521:null,SECP256K1:null,BRAINPOOLP256:null,BRAINPOOLP384:null,BRAINPOOLP512:null,X25519:null,X448:null,MONT448:null,ED25519:null,ISO448:null,ED448:null};function curve(name,...args){assert(typeof name==="string");const key=name.toUpperCase();let curve=cache[key];if(!curve){const Curve=curves[key];if(!Curve)throw new Error(`Curve not found: "${name}".`);curve=new Curve(...args);cache[key]=curve}return curve}function register(name,Curve){assert(typeof name==="string");assert(typeof Curve==="function");const key=name.toUpperCase();if(curves[key])throw new Error(`Curve already registered: "${name}".`);curves[key]=Curve;cache[key]=null}function getNAF(k,width,max){assert(k instanceof BN);assert(!k.red);assert(width>>>0===width);assert(max>>>0===max);const naf=new Array(max);const bits=k.bitLength()+1;const sign=k.sign()|1;assert(bits<=max);for(let i=0;i>width-1&1;word-=carry<>>0===step);const naf=getNAF(k,width,max);const len=Math.ceil(naf.length/step);const repr=new Array(len);let i=0;for(let j=0;j=j;k--)nafW=(nafW<<1)+naf[k];repr[i++]=nafW}assert(i===len);return repr}function getJSF(k1,k2,max){assert(k1 instanceof BN);assert(k2 instanceof BN);assert(!k1.red);assert(!k2.red);assert(max>>>0===max);const jsf=[new Array(max),new Array(max)];const bits=Math.max(k1.bitLength(),k2.bitLength())+1;const s1=k1.sign()|1;const s2=k2.sign()|1;assert(bits<=max);let d1=0;let d2=0;for(let i=0;i=0)return root}throw new Error("X^(1/3) is not a square mod P.")}function randomInt(rng){return BN.randomBits(rng,32).toNumber()}function memoize(method,self){const cache=new WeakMap;return function memoized(curve,invert){const i=invert&1;const item=cache.get(curve);if(item&&item[i]!==null)return item[i];const result=method.call(self,curve,invert);if(!cache.has(curve))cache.set(curve,[null,null]);cache.get(curve)[i]=result;return result}}function toPretty(x,size){assert(x instanceof BN);assert(size>>>0===size);if(size&7)size+=8-(size&7);const str=x.toString(16,size);const chunks=[];const out=[];assert((str.length&7)===0);for(let i=0;i>>0===size);const data=bufferExports.Buffer.alloc(size);randomFillSync(data,0,size);return data}function randomFill(data,off,size){assert(bufferExports.Buffer.isBuffer(data));if(off==null)off=0;assert(off>>>0===off);if(size==null)size=data.length-off;assert(size>>>0===size);assert(off+size<=data.length);randomFillSync(data,off,size);return data}function randomInt(){if((poolPos&15)===0){getRandomValues(pool);poolPos=0}return pool[poolPos++]}function randomRange(min,max){assert(min>>>0===min);assert(max>>>0===max);assert(max>=min);const space=max-min;if(space===0)return min;const top=-space>>>0;let x,r;do{x=randomInt();r=x%space}while(x-r>top);return r+min}function getRandomValues(array){if(!HAS_CRYPTO)throw new Error("Entropy source not available.");return randomValues(array)}function randomFillSync(data,off,size){assert(bufferExports.Buffer.isBuffer(data));assert(data.buffer instanceof ArrayBuffer);assert(data.byteOffset>>>0===data.byteOffset);assert(data.byteLength>>>0===data.byteLength);assert(off>>>0===off);assert(size>>>0===size);assert(off+size<=data.byteLength);if(size>2**31-1)throw new RangeError('The value "size" is out of range.');const offset=data.byteOffset+off;const array=new Uint8Array(data.buffer,offset,size);if(array.length>MAX_BYTES){for(let i=0;iarray.length)j=array.length;getRandomValues(array.subarray(i,j))}}else{if(array.length>0)getRandomValues(array)}}random.native=0;random.randomBytes=randomBytes;random.randomFill=randomFill;random.randomInt=randomInt;random.randomRange=randomRange;return random}var randomBrowser;var hasRequiredRandomBrowser;function requireRandomBrowser(){if(hasRequiredRandomBrowser)return randomBrowser;hasRequiredRandomBrowser=1;randomBrowser=requireRandom();return randomBrowser}var eddsa;var hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;const assert=requireAssert();const BatchRNG=requireBatchRng();const BN=requireBnBrowser();const elliptic=requireElliptic();const rng=requireRandomBrowser();class EDDSA{constructor(id,mid,eid,hash,pre){assert(typeof id==="string");assert(!mid||typeof mid==="string");assert(!eid||typeof eid==="string");assert(hash);this.id=id;this.type="eddsa";this.mid=mid||null;this.eid=eid||null;this.hash=hash;this.native=0;this._pre=pre||null;this._curve=null;this._mont=null;this._iso=null;this._rng=null}get curve(){if(!this._curve){this._curve=elliptic.curve(this.id,this._pre);this._curve.precompute(rng);this._pre=null}return this._curve}get mont(){if(this.mid&&!this._mont)this._mont=elliptic.curve(this.mid);return this._mont}get iso(){if(!this.eid)return this.mont;if(!this._iso)this._iso=elliptic.curve(this.eid);return this._iso}get rng(){if(!this._rng)this._rng=new BatchRNG(this.curve);return this._rng}get size(){return this.curve.adjustedSize}get bits(){return this.curve.fieldBits}hashNonce(prefix,msg,ph,ctx){const hash=new Hash(this);hash.init(ph,ctx);hash.update(prefix);hash.update(msg);return hash.final()}hashChallenge(R,A,m,ph,ctx){const hash=new Hash(this);hash.init(ph,ctx);hash.update(R);hash.update(A);hash.update(m);return hash.final()}privateKeyGenerate(){return rng.randomBytes(this.curve.adjustedSize)}scalarGenerate(){const scalar=rng.randomBytes(this.curve.scalarSize);return this.curve.clamp(scalar)}privateKeyExpand(secret){assert(bufferExports.Buffer.isBuffer(secret));assert(secret.length===this.curve.adjustedSize);const hash=this.hash.digest(secret,this.curve.adjustedSize*2);return this.curve.splitHash(hash)}privateKeyConvert(secret){const[key]=this.privateKeyExpand(secret);return key}privateKeyVerify(secret){assert(bufferExports.Buffer.isBuffer(secret));return secret.length===this.curve.adjustedSize}scalarVerify(scalar){assert(bufferExports.Buffer.isBuffer(scalar));return scalar.length===this.curve.scalarSize}scalarIsZero(scalar){assert(bufferExports.Buffer.isBuffer(scalar));let k;try{k=this.curve.decodeScalar(scalar).imod(this.curve.n)}catch(e){return false}return k.isZero()}scalarClamp(scalar){assert(bufferExports.Buffer.isBuffer(scalar));assert(scalar.length===this.curve.scalarSize);return this.curve.clamp(bufferExports.Buffer.from(scalar))}privateKeyExport(secret){const pub=this.publicKeyCreate(secret);const{x,y}=this.publicKeyExport(pub);return{d:bufferExports.Buffer.from(secret),x:x,y:y}}privateKeyImport(json){assert(json&&typeof json==="object");assert(bufferExports.Buffer.isBuffer(json.d));if(json.d.length!==this.curve.adjustedSize)throw new Error("Invalid private key.");return bufferExports.Buffer.from(json.d)}scalarTweakAdd(scalar,tweak){const a=this.curve.decodeScalar(scalar);const t=this.curve.decodeScalar(tweak);const k=a.add(t).imod(this.curve.n);return this.curve.encodeScalar(k)}scalarTweakMul(scalar,tweak){const a=this.curve.decodeScalar(scalar);const t=this.curve.decodeScalar(tweak);const k=a.mul(t).imod(this.curve.n);return this.curve.encodeScalar(k)}scalarReduce(scalar){const a=this.curve.decodeScalar(scalar);const k=a.imod(this.curve.n);return this.curve.encodeScalar(k)}scalarNegate(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);const k=a.neg().imod(this.curve.n);return this.curve.encodeScalar(k)}scalarInvert(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);if(a.isZero())return this.curve.encodeScalar(a);const k=a.invert(this.curve.n);return this.curve.encodeScalar(k)}publicKeyCreate(secret){const key=this.privateKeyConvert(secret);return this.publicKeyFromScalar(key)}publicKeyFromScalar(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);const A=this.curve.g.mulBlind(a);return A.encode()}publicKeyConvert(key){if(!this.mont)throw new Error("No equivalent montgomery curve.");const A=this.curve.decodePoint(key);const P=this.mont.pointFromEdwards(A);return P.encode()}publicKeyFromUniform(bytes){const u=this.curve.decodeUniform(bytes);const A=this.curve.pointFromUniform(u,this.iso);return A.encode()}publicKeyToUniform(key,hint=rng.randomInt()){const A=this.curve.decodePoint(key);const u=this.curve.pointToUniform(A,hint,this.iso);return this.curve.encodeUniform(u,hint>>>8)}publicKeyFromHash(bytes,pake=false){const A=this.curve.pointFromHash(bytes,pake,this.iso);return A.encode()}publicKeyToHash(key,subgroup=rng.randomInt()){const A=this.curve.decodePoint(key);return this.curve.pointToHash(A,subgroup,rng,this.iso)}publicKeyVerify(key){assert(bufferExports.Buffer.isBuffer(key));try{this.curve.decodePoint(key)}catch(e){return false}return true}publicKeyIsInfinity(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.isInfinity()}publicKeyIsSmall(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.isSmall()}publicKeyHasTorsion(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.hasTorsion()}publicKeyExport(key){const{x,y}=this.curve.decodePoint(key);return{x:this.curve.encodeField(x.fromRed()),y:this.curve.encodeField(y.fromRed())}}publicKeyImport(json){assert(json&&typeof json==="object");let x=null;let y=null;let A;if(json.x!=null){x=BN.decode(json.x,this.curve.endian);if(x.cmp(this.curve.p)>=0)throw new Error("Invalid point.")}if(json.y!=null){y=BN.decode(json.y,this.curve.endian);if(y.cmp(this.curve.p)>=0)throw new Error("Invalid point.")}if(x&&y){A=this.curve.point(x,y);if(!A.validate())throw new Error("Invalid point.")}else if(x){A=this.curve.pointFromX(x,json.sign)}else if(y){A=this.curve.pointFromY(y,json.sign)}else{throw new Error("Invalid point.")}return A.encode()}publicKeyTweakAdd(key,tweak){const t=this.curve.decodeScalar(tweak).imod(this.curve.n);const A=this.curve.decodePoint(key);const T=this.curve.g.mul(t);const P=T.add(A);return P.encode()}publicKeyTweakMul(key,tweak){const t=this.curve.decodeScalar(tweak);const A=this.curve.decodePoint(key);const P=A.mul(t);return P.encode()}publicKeyCombine(keys){assert(Array.isArray(keys));let P=this.curve.point();for(const key of keys){const A=this.curve.decodePoint(key);P=P.add(A)}return P.encode()}publicKeyNegate(key){const A=this.curve.decodePoint(key);const P=A.neg();return P.encode()}sign(msg,secret,ph,ctx){const[key,prefix]=this.privateKeyExpand(secret);return this.signWithScalar(msg,key,prefix,ph,ctx)}signWithScalar(msg,scalar,prefix,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(prefix));assert(prefix.length===this.curve.adjustedSize);const{n}=this.curve;const G=this.curve.g;const k=this.hashNonce(prefix,msg,ph,ctx);const Rraw=G.mulBlind(k).encode();const a=this.curve.decodeScalar(scalar);const Araw=G.mulBlind(a).encode();const e=this.hashChallenge(Rraw,Araw,msg,ph,ctx);const s=k.add(e.mul(a)).imod(n);return bufferExports.Buffer.concat([Rraw,this.curve.encodeAdjusted(s)])}signTweakAdd(msg,secret,tweak,ph,ctx){const[key_,prefix_]=this.privateKeyExpand(secret);const key=this.scalarTweakAdd(key_,tweak);const expanded=this.hash.multi(prefix_,tweak,null,this.curve.adjustedSize*2);const prefix=expanded.slice(0,this.curve.adjustedSize);return this.signWithScalar(msg,key,prefix,ph,ctx)}signTweakMul(msg,secret,tweak,ph,ctx){const[key_,prefix_]=this.privateKeyExpand(secret);const key=this.scalarTweakMul(key_,tweak);const expanded=this.hash.multi(prefix_,tweak,null,this.curve.adjustedSize*2);const prefix=expanded.slice(0,this.curve.adjustedSize);return this.signWithScalar(msg,key,prefix,ph,ctx)}verify(msg,sig,key,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false;try{return this._verify(msg,sig,key,ph,ctx)}catch(e){return false}}_verify(msg,sig,key,ph,ctx){const{n}=this.curve;const G=this.curve.g;const Rraw=sig.slice(0,this.curve.adjustedSize);const sraw=sig.slice(this.curve.adjustedSize);const R=this.curve.decodePoint(Rraw);const s=this.curve.decodeAdjusted(sraw);const A=this.curve.decodePoint(key);if(s.cmp(n)>=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);return G.mulAdd(s,A.neg(),e).eq(R)}verifySingle(msg,sig,key,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false;try{return this._verifySingle(msg,sig,key,ph,ctx)}catch(e){return false}}_verifySingle(msg,sig,key,ph,ctx){const{n}=this.curve;const G=this.curve.g;const Rraw=sig.slice(0,this.curve.adjustedSize);const sraw=sig.slice(this.curve.adjustedSize);const R=this.curve.decodePoint(Rraw);const s=this.curve.decodeAdjusted(sraw);const A=this.curve.decodePoint(key);if(s.cmp(n)>=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);const sh=this.curve.imulH(s);const Ah=A.mulH();const Rh=R.mulH();return G.mulAdd(sh,Ah.neg(),e).eq(Rh)}verifyBatch(batch,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(Array.isArray(batch));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));for(const item of batch){assert(Array.isArray(item)&&item.length===3);const[msg,sig,key]=item;assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false}try{return this._verifyBatch(batch,ph,ctx)}catch(e){return false}}_verifyBatch(batch,ph,ctx){const{n}=this.curve;const G=this.curve.g;const points=new Array(1+batch.length*2);const coeffs=new Array(1+batch.length*2);const sum=new BN(0);this.rng.init(batch);points[0]=G;coeffs[0]=sum;for(let i=0;i=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);const a=this.rng.generate(i);const ea=e.mul(a).imod(n);sum.iadd(s.mul(a)).imod(n);points[1+i*2+0]=R.mulH();coeffs[1+i*2+0]=a;points[1+i*2+1]=A.mulH();coeffs[1+i*2+1]=ea}this.curve.imulH(sum.ineg());return this.curve.mulAll(points,coeffs).isInfinity()}derive(pub,secret){const scalar=this.privateKeyConvert(secret);return this.deriveWithScalar(pub,scalar)}deriveWithScalar(pub,scalar){const A=this.curve.decodePoint(pub);const a=this.curve.decodeClamped(scalar);const P=A.mulBlind(a,rng);if(P.isInfinity())throw new Error("Invalid point.");return P.encode()}}class Hash{constructor(eddsa){this.curve=eddsa.curve;this.hash=new eddsa.hash}init(ph,ctx){assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(ctx.length>255)ctx=ctx.slice(0,255);this.hash.init();if(this.curve.context||ph!=null||ctx.length>0){if(this.curve.prefix)this.hash.update(this.curve.prefix);this.hash.update(byte(ph));this.hash.update(byte(ctx.length));this.hash.update(ctx)}return this}update(data){this.hash.update(data);return this}final(){const hash=this.hash.final(this.curve.adjustedSize*2);const num=BN.decode(hash,this.curve.endian);return num.imod(this.curve.n)}}function byte(ch){const buf=bufferExports.Buffer.alloc(1);buf[0]=ch&255;return buf}eddsa=EDDSA;return eddsa}var keccak;var hasRequiredKeccak;function requireKeccak(){if(hasRequiredKeccak)return keccak;hasRequiredKeccak=1;const assert=requireAssert();const HMAC=requireHmac();const FINALIZED=2147483648;const ROUND_CONST=new Uint32Array([1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648]);class Keccak{constructor(){this.state=new Uint32Array(50);this.block=bufferExports.Buffer.alloc(200);this.bs=136;this.pos=FINALIZED}init(bits){if(bits==null)bits=256;assert(bits>>>0===bits);assert(bits>=128);assert(bits<=512);const rate=1600-bits*2;assert(rate>=0&&(rate&63)===0);this.bs=rate>>>3;this.pos=0;return this}update(data){assert(bufferExports.Buffer.isBuffer(data));assert(!(this.pos&FINALIZED),"Context is not initialized.");let len=data.length;let pos=this.pos;let off=0;this.pos=(this.pos+len)%this.bs;if(pos>0){let want=this.bs-pos;if(want>len)want=len;data.copy(this.block,pos,off,off+want);pos+=want;len-=want;off+=want;if(pos=this.bs){this._transform(data,off);off+=this.bs;len-=this.bs}if(len>0)data.copy(this.block,0,off,off+len);return this}final(pad,len){if(pad==null)pad=1;if(len==null||len===0)len=100-(this.bs>>>1);assert((pad&255)===pad);assert(len>>>0===len);assert(!(this.pos&FINALIZED),"Context is not initialized.");this.block.fill(0,this.pos,this.bs);this.block[this.pos]|=pad;this.block[this.bs-1]|=128;this._transform(this.block,0);this.pos=FINALIZED;assert(len<=this.bs);const out=bufferExports.Buffer.alloc(len);for(let i=0;i>>2]>>>8*(i&3);for(let i=0;i<50;i++)this.state[i]=0;for(let i=0;i>>2;const s=this.state;for(let i=0;i>>31);const l0=c9^(c3<<1|c2>>>31);const h1=c0^(c4<<1|c5>>>31);const l1=c1^(c5<<1|c4>>>31);const h2=c2^(c6<<1|c7>>>31);const l2=c3^(c7<<1|c6>>>31);const h3=c4^(c8<<1|c9>>>31);const l3=c5^(c9<<1|c8>>>31);const h4=c6^(c0<<1|c1>>>31);const l4=c7^(c1<<1|c0>>>31);s[0]^=h0;s[1]^=l0;s[10]^=h0;s[11]^=l0;s[20]^=h0;s[21]^=l0;s[30]^=h0;s[31]^=l0;s[40]^=h0;s[41]^=l0;s[2]^=h1;s[3]^=l1;s[12]^=h1;s[13]^=l1;s[22]^=h1;s[23]^=l1;s[32]^=h1;s[33]^=l1;s[42]^=h1;s[43]^=l1;s[4]^=h2;s[5]^=l2;s[14]^=h2;s[15]^=l2;s[24]^=h2;s[25]^=l2;s[34]^=h2;s[35]^=l2;s[44]^=h2;s[45]^=l2;s[6]^=h3;s[7]^=l3;s[16]^=h3;s[17]^=l3;s[26]^=h3;s[27]^=l3;s[36]^=h3;s[37]^=l3;s[46]^=h3;s[47]^=l3;s[8]^=h4;s[9]^=l4;s[18]^=h4;s[19]^=l4;s[28]^=h4;s[29]^=l4;s[38]^=h4;s[39]^=l4;s[48]^=h4;s[49]^=l4;const b0=s[0];const b1=s[1];const b32=s[11]<<4|s[10]>>>28;const b33=s[10]<<4|s[11]>>>28;const b14=s[20]<<3|s[21]>>>29;const b15=s[21]<<3|s[20]>>>29;const b46=s[31]<<9|s[30]>>>23;const b47=s[30]<<9|s[31]>>>23;const b28=s[40]<<18|s[41]>>>14;const b29=s[41]<<18|s[40]>>>14;const b20=s[2]<<1|s[3]>>>31;const b21=s[3]<<1|s[2]>>>31;const b2=s[13]<<12|s[12]>>>20;const b3=s[12]<<12|s[13]>>>20;const b34=s[22]<<10|s[23]>>>22;const b35=s[23]<<10|s[22]>>>22;const b16=s[33]<<13|s[32]>>>19;const b17=s[32]<<13|s[33]>>>19;const b48=s[42]<<2|s[43]>>>30;const b49=s[43]<<2|s[42]>>>30;const b40=s[5]<<30|s[4]>>>2;const b41=s[4]<<30|s[5]>>>2;const b22=s[14]<<6|s[15]>>>26;const b23=s[15]<<6|s[14]>>>26;const b4=s[25]<<11|s[24]>>>21;const b5=s[24]<<11|s[25]>>>21;const b36=s[34]<<15|s[35]>>>17;const b37=s[35]<<15|s[34]>>>17;const b18=s[45]<<29|s[44]>>>3;const b19=s[44]<<29|s[45]>>>3;const b10=s[6]<<28|s[7]>>>4;const b11=s[7]<<28|s[6]>>>4;const b42=s[17]<<23|s[16]>>>9;const b43=s[16]<<23|s[17]>>>9;const b24=s[26]<<25|s[27]>>>7;const b25=s[27]<<25|s[26]>>>7;const b6=s[36]<<21|s[37]>>>11;const b7=s[37]<<21|s[36]>>>11;const b38=s[47]<<24|s[46]>>>8;const b39=s[46]<<24|s[47]>>>8;const b30=s[8]<<27|s[9]>>>5;const b31=s[9]<<27|s[8]>>>5;const b12=s[18]<<20|s[19]>>>12;const b13=s[19]<<20|s[18]>>>12;const b44=s[29]<<7|s[28]>>>25;const b45=s[28]<<7|s[29]>>>25;const b26=s[38]<<8|s[39]>>>24;const b27=s[39]<<8|s[38]>>>24;const b8=s[48]<<14|s[49]>>>18;const b9=s[49]<<14|s[48]>>>18;s[0]=b0^~b2&b4;s[1]=b1^~b3&b5;s[10]=b10^~b12&b14;s[11]=b11^~b13&b15;s[20]=b20^~b22&b24;s[21]=b21^~b23&b25;s[30]=b30^~b32&b34;s[31]=b31^~b33&b35;s[40]=b40^~b42&b44;s[41]=b41^~b43&b45;s[2]=b2^~b4&b6;s[3]=b3^~b5&b7;s[12]=b12^~b14&b16;s[13]=b13^~b15&b17;s[22]=b22^~b24&b26;s[23]=b23^~b25&b27;s[32]=b32^~b34&b36;s[33]=b33^~b35&b37;s[42]=b42^~b44&b46;s[43]=b43^~b45&b47;s[4]=b4^~b6&b8;s[5]=b5^~b7&b9;s[14]=b14^~b16&b18;s[15]=b15^~b17&b19;s[24]=b24^~b26&b28;s[25]=b25^~b27&b29;s[34]=b34^~b36&b38;s[35]=b35^~b37&b39;s[44]=b44^~b46&b48;s[45]=b45^~b47&b49;s[6]=b6^~b8&b0;s[7]=b7^~b9&b1;s[16]=b16^~b18&b10;s[17]=b17^~b19&b11;s[26]=b26^~b28&b20;s[27]=b27^~b29&b21;s[36]=b36^~b38&b30;s[37]=b37^~b39&b31;s[46]=b46^~b48&b40;s[47]=b47^~b49&b41;s[8]=b8^~b0&b2;s[9]=b9^~b1&b3;s[18]=b18^~b10&b12;s[19]=b19^~b11&b13;s[28]=b28^~b20&b22;s[29]=b29^~b21&b23;s[38]=b38^~b30&b32;s[39]=b39^~b31&b33;s[48]=b48^~b40&b42;s[49]=b49^~b41&b43;s[0]^=ROUND_CONST[n+0];s[1]^=ROUND_CONST[n+1]}}static hash(){return new Keccak}static hmac(bits,pad,len){if(bits==null)bits=256;assert(bits>>>0===bits);const rate=1600-bits*2;assert(rate>=0&&(rate&63)===0);return new HMAC(Keccak,rate>>>3,[bits],[pad,len])}static digest(data,bits,pad,len){return Keccak.ctx.init(bits).update(data).final(pad,len)}static root(left,right,bits,pad,len){if(bits==null)bits=256;if(len==null)len=0;if(len===0)len=bits>>>3;assert(bits>>>0===bits);assert((bits&7)===0);assert(len>>>0===len);assert(bufferExports.Buffer.isBuffer(left)&&left.length===len);assert(bufferExports.Buffer.isBuffer(right)&&right.length===len);return Keccak.ctx.init(bits).update(left).update(right).final(pad,len)}static multi(x,y,z,bits,pad,len){const{ctx}=Keccak;ctx.init(bits);ctx.update(x);ctx.update(y);if(z)ctx.update(z);return ctx.final(pad,len)}static mac(data,key,bits,pad,len){return Keccak.hmac(bits,pad,len).init(key).update(data).final()}}Keccak.native=0;Keccak.id="KECCAK256";Keccak.size=32;Keccak.bits=256;Keccak.blockSize=136;Keccak.zero=bufferExports.Buffer.alloc(32,0);Keccak.ctx=new Keccak;function readU32(data,off){return data[off++]+data[off++]*256+data[off++]*65536+data[off]*16777216}keccak=Keccak;return keccak}var keccakBrowser;var hasRequiredKeccakBrowser;function requireKeccakBrowser(){if(hasRequiredKeccakBrowser)return keccakBrowser;hasRequiredKeccakBrowser=1;keccakBrowser=requireKeccak();return keccakBrowser}var shake;var hasRequiredShake;function requireShake(){if(hasRequiredShake)return shake;hasRequiredShake=1;const Keccak=requireKeccakBrowser();class SHAKE extends Keccak{constructor(){super()}final(len){return super.final(31,len)}static hash(){return new SHAKE}static hmac(bits,len){return super.hmac(bits,31,len)}static digest(data,bits,len){return super.digest(data,bits,31,len)}static root(left,right,bits,len){return super.root(left,right,bits,31,len)}static multi(x,y,z,bits,len){return super.multi(x,y,z,bits,31,len)}static mac(data,key,bits,len){return super.mac(data,key,bits,31,len)}}SHAKE.native=Keccak.native;SHAKE.id="SHAKE256";SHAKE.size=32;SHAKE.bits=256;SHAKE.blockSize=136;SHAKE.zero=bufferExports.Buffer.alloc(32,0);SHAKE.ctx=new SHAKE;shake=SHAKE;return shake}var shake256;var hasRequiredShake256;function requireShake256(){if(hasRequiredShake256)return shake256;hasRequiredShake256=1;const SHAKE=requireShake();class SHAKE256 extends SHAKE{constructor(){super()}init(){return super.init(256)}static hash(){return new SHAKE256}static hmac(len){return super.hmac(256,len)}static digest(data,len){return super.digest(data,256,len)}static root(left,right,len){return super.root(left,right,256,len)}static multi(x,y,z,len){return super.multi(x,y,z,256,len)}static mac(data,key,len){return super.mac(data,key,256,len)}}SHAKE256.native=SHAKE.native;SHAKE256.id="SHAKE256";SHAKE256.size=32;SHAKE256.bits=256;SHAKE256.blockSize=136;SHAKE256.zero=bufferExports.Buffer.alloc(32,0);SHAKE256.ctx=new SHAKE256;shake256=SHAKE256;return shake256}var ed448$1;var hasRequiredEd448;function requireEd448(){if(hasRequiredEd448)return ed448$1;hasRequiredEd448=1;const EDDSA=requireEddsa();const SHAKE256=requireShake256();ed448$1=new EDDSA("ED448","X448","MONT448",SHAKE256);return ed448$1}var ed448Browser;var hasRequiredEd448Browser;function requireEd448Browser(){if(hasRequiredEd448Browser)return ed448Browser;hasRequiredEd448Browser=1;ed448Browser=requireEd448();return ed448Browser}var ed448BrowserExports=requireEd448Browser();var backend=getDefaultExportFromCjs(ed448BrowserExports);const ed448=backend;const BN_0$9=BigInt(0);const BN_1$5=BigInt(1);const maxValue=9007199254740991;function fromTwos(_value,_width){const value=getUint(_value,"value");const width=BigInt(getNumber(_width,"width"));assert(value>>width===BN_0$9,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:_value});if(value>>width-BN_1$5){const mask=(BN_1$5<=-maxValue&&value<=maxValue,"overflow",name||"value",value);return BigInt(value);case"string":try{if(value===""){throw new Error("empty string")}if(value[0]==="-"&&value[1]!=="-"){return-BigInt(value.substring(1))}return BigInt(value)}catch(e){assertArgument(false,`invalid BigNumberish string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid BigNumberish value",name||"value",value)}function getUint(value,name){const result=getBigInt(value,name);assert(result>=BN_0$9,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:value});return result}const Nibbles="0123456789abcdef";function toBigInt(value){if(value instanceof Uint8Array){let result="0x0";for(const v of value){result+=Nibbles[v>>4];result+=Nibbles[v&15]}return BigInt(result)}return getBigInt(value)}function getNumber(value,name){switch(typeof value){case"bigint":assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return Number(value);case"number":assertArgument(Number.isInteger(value),"underflow",name||"value",value);assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return value;case"string":try{if(value===""){throw new Error("empty string")}return getNumber(BigInt(value),name)}catch(e){assertArgument(false,`invalid numeric string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid numeric value",name||"value",value)}function toNumber(value){return getNumber(toBigInt(value))}function toBeHex(_value,_width){const value=getUint(_value,"value");let result=value.toString(16);if(_width==null){if(result.length%2){result="0"+result}}else{const width=getNumber(_width,"width");assert(width*2>=result.length,`value exceeds width (${width} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:_value});while(result.length>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){if(form!=null){assertNormalize(form);str=str.normalize(form)}let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}function toUtf8CodePoints(str,form){return getUtf8CodePoints(toUtf8Bytes(str,form))}async function getUrl(req,_signal){const protocol=req.url.split(":")[0].toLowerCase();assert(protocol==="http"||protocol==="https",`unsupported protocol ${protocol}`,"UNSUPPORTED_OPERATION",{info:{protocol:protocol},operation:"request"});assert(protocol==="https"||!req.credentials||req.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let signal=undefined;if(_signal){const controller=new AbortController;signal=controller.signal;_signal.addListener(()=>{controller.abort()})}const init={method:req.method,headers:new Headers(Array.from(req)),body:req.body||undefined,signal:signal};try{const resp=await fetch(req.url,init);const headers={};resp.headers.forEach((value,key)=>{headers[key.toLowerCase()]=value});const respBody=await resp.arrayBuffer();const body=respBody==null?null:new Uint8Array(respBody);return{statusCode:resp.status,statusMessage:resp.statusText,headers:headers,body:body}}catch(error){console.log({error:error});return undefined}}const MAX_ATTEMPTS=12;const SLOT_INTERVAL=250;let getUrlFunc=getUrl;const reData=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i");const reIpfs=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let locked$5=false;async function dataGatewayFunc(url,signal){try{const match=url.match(reData);if(!match){throw new Error("invalid data")}return new FetchResponse(200,"OK",{"content-type":match[1]||"text/plain"},match[2]?decodeBase64(match[3]):unpercent(match[3]))}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(url))}}function getIpfsGatewayFunc(baseUrl){async function gatewayIpfs(url,signal){try{const match=url.match(reIpfs);if(!match){throw new Error("invalid link")}return new FetchRequest(`${baseUrl}${match[2]}`)}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(url))}}return gatewayIpfs}const Gateways={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")};const fetchSignals=new WeakMap;class FetchCancelSignal{#listeners;#cancelled;constructor(request){this.#listeners=[];this.#cancelled=false;fetchSignals.set(request,()=>{if(this.#cancelled){return}this.#cancelled=true;for(const listener of this.#listeners){setTimeout(()=>{listener()},0)}this.#listeners=[]})}addListener(listener){assert(!this.#cancelled,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"});this.#listeners.push(listener)}get cancelled(){return this.#cancelled}checkSignal(){assert(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(signal){if(signal==null){throw new Error("missing signal; should not happen")}signal.checkSignal();return signal}class FetchRequest{#allowInsecure;#gzip;#headers;#method;#timeout;#url;#body;#bodyType;#creds;#preflight;#process;#retry;#signal;#throttle;get url(){return this.#url}set url(url){this.#url=String(url)}get body(){if(this.#body==null){return null}return new Uint8Array(this.#body)}set body(body){if(body==null){this.#body=undefined;this.#bodyType=undefined}else if(typeof body==="string"){this.#body=toUtf8Bytes(body);this.#bodyType="text/plain"}else if(body instanceof Uint8Array){this.#body=body;this.#bodyType="application/octet-stream"}else if(typeof body==="object"){this.#body=toUtf8Bytes(JSON.stringify(body));this.#bodyType="application/json"}else{throw new Error("invalid body")}}hasBody(){return this.#body!=null}get method(){if(this.#method){return this.#method}if(this.hasBody()){return"POST"}return"GET"}set method(method){if(method==null){method=""}this.#method=String(method).toUpperCase()}get headers(){const headers=Object.assign({},this.#headers);if(this.#creds){headers["authorization"]=`Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`}if(this.allowGzip){headers["accept-encoding"]="gzip"}if(headers["content-type"]==null&&this.#bodyType){headers["content-type"]=this.#bodyType}if(this.body){headers["content-length"]=String(this.body.length)}return headers}getHeader(key){return this.headers[key.toLowerCase()]}setHeader(key,value){this.#headers[String(key).toLowerCase()]=String(value)}clearHeaders(){this.#headers={}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index=0,"timeout must be non-zero","timeout",timeout);this.#timeout=timeout}get preflightFunc(){return this.#preflight||null}set preflightFunc(preflight){this.#preflight=preflight}get processFunc(){return this.#process||null}set processFunc(process){this.#process=process}get retryFunc(){return this.#retry||null}set retryFunc(retry){this.#retry=retry}constructor(url){this.#url=String(url);this.#allowInsecure=false;this.#gzip=true;this.#headers={};this.#method="";this.#timeout=3e5;this.#throttle={slotInterval:SLOT_INTERVAL,maxAttempts:MAX_ATTEMPTS}}toString(){return``}setThrottleParams(params){if(params.slotInterval!=null){this.#throttle.slotInterval=params.slotInterval}if(params.maxAttempts!=null){this.#throttle.maxAttempts=params.maxAttempts}}async#send(attempt,expires,delay,_request,_response){if(attempt>=this.#throttle.maxAttempts){return _response.makeServerError("exceeded maximum retry limit")}assert(getTime$2()<=expires,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:_request});if(delay>0){await wait(delay)}let req=this.clone();const scheme=(req.url.split(":")[0]||"").toLowerCase();if(scheme in Gateways){const result=await Gateways[scheme](req.url,checkSignal(_request.#signal));if(result instanceof FetchResponse){let response=result;if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}}}return response}req=result}if(this.preflightFunc){req=await this.preflightFunc(req)}const resp=await getUrlFunc(req,checkSignal(_request.#signal));let response=new FetchResponse(resp.statusCode,resp.statusMessage,resp.headers,resp.body,_request);if(response.statusCode===301||response.statusCode===302){try{const location=response.headers.location||"";return req.redirect(location).#send(attempt+1,expires,0,_request,response)}catch(error){}return response}else if(response.statusCode===429){if(this.retryFunc==null||await this.retryFunc(req,response,attempt)){const retryAfter=response.headers["retry-after"];let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(typeof retryAfter==="string"&&retryAfter.match(/^[1-9][0-9]*$/)){delay=parseInt(retryAfter)}return req.clone().#send(attempt+1,expires,delay,_request,response)}}if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(error.stall>=0){delay=error.stall}return req.clone().#send(attempt+1,expires,delay,_request,response)}}return response}send(){assert(this.#signal==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"});this.#signal=new FetchCancelSignal(this);return this.#send(0,getTime$2()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){assert(this.#signal!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const signal=fetchSignals.get(this);if(!signal){throw new Error("missing signal; should not happen")}signal()}redirect(location){const current=this.url.split(":")[0].toLowerCase();const target=location.split(":")[0].toLowerCase();assert(this.method==="GET"&&(current!=="https"||target!=="http")&&location.match(/^https?:/),`unsupported redirect`,"UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`});const req=new FetchRequest(location);req.method="GET";req.allowGzip=this.allowGzip;req.timeout=this.timeout;req.#headers=Object.assign({},this.#headers);if(this.#body){req.#body=new Uint8Array(this.#body)}req.#bodyType=this.#bodyType;return req}clone(){const clone=new FetchRequest(this.url);clone.#method=this.#method;if(this.#body){clone.#body=this.#body}clone.#bodyType=this.#bodyType;clone.#headers=Object.assign({},this.#headers);clone.#creds=this.#creds;if(this.allowGzip){clone.allowGzip=true}clone.timeout=this.timeout;if(this.allowInsecureAuthentication){clone.allowInsecureAuthentication=true}clone.#preflight=this.#preflight;clone.#process=this.#process;clone.#retry=this.#retry;return clone}static lockConfig(){locked$5=true}static getGateway(scheme){return Gateways[scheme.toLowerCase()]||null}static registerGateway(scheme,func){scheme=scheme.toLowerCase();if(scheme==="http"||scheme==="https"){throw new Error(`cannot intercept ${scheme}; use registerGetUrl`)}if(locked$5){throw new Error("gateways locked")}Gateways[scheme]=func}static registerGetUrl(getUrl){if(locked$5){throw new Error("gateways locked")}getUrlFunc=getUrl}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(baseUrl){return getIpfsGatewayFunc(baseUrl)}}class FetchResponse{#statusCode;#statusMessage;#headers;#body;#request;#error;toString(){return``}get statusCode(){return this.#statusCode}get statusMessage(){return this.#statusMessage}get headers(){return Object.assign({},this.#headers)}get body(){return this.#body==null?null:new Uint8Array(this.#body)}get bodyText(){try{return this.#body==null?"":toUtf8String(this.#body)}catch(error){assert(false,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(error){assert(false,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index{accum[k.toLowerCase()]=String(headers[k]);return accum},{});this.#body=body==null?null:new Uint8Array(body);this.#request=request||null;this.#error={message:""}}makeServerError(message,error){let statusMessage;if(!message){message=`${this.statusCode} ${this.statusMessage}`;statusMessage=`CLIENT ESCALATED SERVER ERROR (${message})`}else{statusMessage=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`}const response=new FetchResponse(599,statusMessage,this.headers,this.body,this.#request||undefined);response.#error={message:message,error:error};return response}throwThrottleError(message,stall){if(stall==null){stall=-1}else{assertArgument(Number.isInteger(stall)&&stall>=0,"invalid stall timeout","stall",stall)}const error=new Error(message||"throttling requests");defineProperties(error,{stall:stall,throttle:true});throw error}getHeader(key){return this.headers[key.toLowerCase()]}hasBody(){return this.#body!=null}get request(){return this.#request}ok(){return this.#error.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok()){return}let{message,error}=this.#error;if(message===""){message=`server response ${this.statusCode} ${this.statusMessage}`}assert(false,message,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:error})}}function getTime$2(){return(new Date).getTime()}function unpercent(value){return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi,(all,code)=>{return String.fromCharCode(parseInt(code,16))}))}function wait(delay){return new Promise(resolve=>setTimeout(resolve,delay))}var _a$1;const BN_N1=BigInt(-1);const BN_0$7=BigInt(0);const BN_1$4=BigInt(1);const BN_5=BigInt(5);const _guard$5={};let Zeros="0000";while(Zeros.length<80){Zeros+=Zeros}function getTens(decimals){let result=Zeros;while(result.length=-limit&&valBN_0$7){val=fromTwos(mask(val,width),width)}else{val=-fromTwos(mask(-val,width),width)}}else{const limit=BN_1$4<=0&&val{if(v[key]==null){return defaultValue}assertArgument(typeof v[key]===type,"invalid fixed format ("+key+" not "+type+")","format."+key,v[key]);return v[key]};signed=check("signed","boolean",signed);width=check("width","number",width);decimals=check("decimals","number",decimals)}assertArgument(width%8===0,"invalid FixedNumber width (not byte aligned)","format.width",width);assertArgument(decimals<=80,"invalid FixedNumber decimals (too large)","format.decimals",decimals);const name=(signed?"":"u")+"fixed"+String(width)+"x"+String(decimals);return{signed:signed,width:width,decimals:decimals,name:name}}function toString(val,decimals){let negative="";if(val0){b*=getTens(delta)}else if(delta<0){a*=getTens(-delta)}if(ab){return-1}return 0}eq(other){return this.cmp(other)===0}lt(other){return this.cmp(other)<0}lte(other){return this.cmp(other)<=0}gt(other){return this.cmp(other)>0}gte(other){return this.cmp(other)>=0}floor(){let val=this.#val;if(this.#valBN_0$7){val+=this.#tens-BN_1$4}val=this.#val/this.#tens*this.#tens;return this.#checkValue(val,"ceiling")}round(decimals){if(decimals==null){decimals=0}if(decimals>=this.decimals){return this}const delta=this.decimals-decimals;const bump=BN_5*getTens(delta-1);let value=this.value+bump;const tens=getTens(delta);value=value/tens*tens;checkValue(value,this.#format,"round");return new _a$1(_guard$5,value,this.#format)}isZero(){return this.#val===BN_0$7}isNegative(){return this.#val0){const tens=getTens(delta);assert(value%tens===BN_0$7,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:_value});value/=tens}else if(delta<0){value*=getTens(-delta)}checkValue(value,format,"fromValue");return new _a$1(_guard$5,value,format)}static fromString(_value,_format){const match=_value.match(/^(-?)([0-9]*)\.?([0-9]*)$/);assertArgument(match&&match[2].length+match[3].length>0,"invalid FixedNumber string value","value",_value);const format=getFormat(_format);let whole=match[2]||"0",decimal=match[3]||"";while(decimal.length{assert(offset<=data.length,"data short segment too short","BUFFER_OVERRUN",{buffer:data,length:data.length,offset:offset})};if(data[offset]>=248){const lengthLength=data[offset]-247;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);return _decodeChildren(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;checkOffset(offset+1+length);return _decodeChildren(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;checkOffset(offset+1+length);const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlifyByte(data[offset])}}function decodeRlp(_data){const data=getBytes(_data,"data");const decoded=_decode(data,0);assertArgument(decoded.consumed===data.length,"unexpected junk after rlp payload","data",_data);return decoded.result}function arrayifyInteger(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function _encode(object){if(Array.isArray(object)){let payload=[];object.forEach(function(child){payload=payload.concat(_encode(child))});if(payload.length<=55){payload.unshift(192+payload.length);return payload}const length=arrayifyInteger(payload.length);length.unshift(247+length.length);return length.concat(payload)}const data=Array.prototype.slice.call(getBytes(object,"object"));if(data.length===1&&data[0]<=127){return data}else if(data.length<=55){data.unshift(128+data.length);return data}const length=arrayifyInteger(data.length);length.unshift(183+length.length);return length.concat(data)}const nibbles="0123456789abcdef";function encodeRlp(object){let result="0x";for(const v of _encode(object)){result+=nibbles[v>>4];result+=nibbles[v&15]}return result}const names=["ore","fecore","picore","nacore","mcore","micore","core"];function formatUnits(value,unit){let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromValue(value,decimals,{decimals:decimals}).toString()}const scientificToDecimal=num=>{var nsign=Math.sign(num);num=Math.abs(num);if(/\d+\.?\d*e[\+\-]*\d+/i.test(num)){var zero="0",parts=String(num).toLowerCase().split("e"),e=parts.pop(),l=Math.abs(e),sign=e/l,coeff_array=parts[0].split(".");if(sign===-1){l=l-coeff_array[0].length;if(l<0){num=coeff_array[0].slice(0,l)+"."+coeff_array[0].slice(l)+(coeff_array.length===2?coeff_array[1]:"")}else{num=zero+"."+new Array(l+1).join(zero)+coeff_array.join("")}}else{var dec=coeff_array[1];if(dec)l=l-dec.length;if(l<0){num=coeff_array[0]+dec.slice(0,l)+"."+dec.slice(l)}else{num=coeff_array.join("")+new Array(l+1).join(zero)}}}return nsign<0?"-"+num:num};const trimDecimals=(n,decimals=18)=>{n+="";if(n.indexOf(".")===-1)return n;const arr=n.split(".");const fraction=arr[1].substr(0,decimals);return arr[0]+"."+fraction};function parseUnits(value,unit){assertArgument(typeof value==="string","value must be a string","value",value);if(value.includes("e")){value=scientificToDecimal(value).toString()}let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index;value=trimDecimals(value,decimals)}else if(unit!=null){decimals=getNumber(unit,"unit");value=trimDecimals(value,decimals)}return FixedNumber.fromString(value,{decimals:decimals}).value}function formatXCB(ore){return formatUnits(ore,18)}function parseXCB(xcb){return parseUnits(xcb,18)}function uuidV4(randomBytes){const bytes=getBytes(randomBytes,"randomBytes");bytes[6]=bytes[6]&15|64;bytes[8]=bytes[8]&63|128;const value=hexlify(bytes);return[value.substring(2,10),value.substring(10,14),value.substring(14,18),value.substring(18,22),value.substring(22,34)].join("-")}var pbkdf2$2={};var hasRequiredPbkdf2;function requirePbkdf2(){if(hasRequiredPbkdf2)return pbkdf2$2;hasRequiredPbkdf2=1;const assert=requireAssert();const crypto=commonjsGlobal.crypto||commonjsGlobal.msCrypto||{};const subtle=crypto.subtle||{};function derive(hash,pass,salt,iter,len){if(typeof pass==="string")pass=bufferExports.Buffer.from(pass,"utf8");if(typeof salt==="string")salt=bufferExports.Buffer.from(salt,"utf8");if(salt==null)salt=bufferExports.Buffer.alloc(0);assert(hash&&typeof hash.id==="string");assert(bufferExports.Buffer.isBuffer(pass));assert(bufferExports.Buffer.isBuffer(salt));assert(iter>>>0===iter);assert(len>>>0===len);const size=hash.size;const blocks=Math.ceil(len/size);const out=bufferExports.Buffer.alloc(blocks*size);const state=bufferExports.Buffer.alloc(salt.length+4);salt.copy(state,0);if(pass.length>hash.blockSize){pass=hash.digest(pass);assert(pass.length<=hash.blockSize)}for(let i=0;i>>24;state[salt.length+1]=round>>>16;state[salt.length+2]=round>>>8;state[salt.length+3]=round;const block=hash.mac(state,pass);let mac=block;for(let j=1;j>>0===iter);assert(len>>>0===len);const name=getHash(hash);if(!subtle.importKey||!subtle.deriveBits||!name)return derive(hash,pass,salt,iter,len);const algo={name:"PBKDF2"};const use=["deriveBits"];const options={name:"PBKDF2",salt:salt,iterations:iter,hash:name};const key=await subtle.importKey("raw",pass,algo,false,use);const out=await subtle.deriveBits(options,key,len*8);return bufferExports.Buffer.from(out)}function getHash(hash){switch(hash.id){case"SHA1":return"SHA-1";case"SHA256":return"SHA-256";case"SHA384":return"SHA-384";case"SHA512":return"SHA-512";default:return null}}pbkdf2$2.native=0;pbkdf2$2.derive=derive;pbkdf2$2.deriveAsync=deriveAsync;return pbkdf2$2}var pbkdf2Browser;var hasRequiredPbkdf2Browser;function requirePbkdf2Browser(){if(hasRequiredPbkdf2Browser)return pbkdf2Browser;hasRequiredPbkdf2Browser=1;pbkdf2Browser=requirePbkdf2();return pbkdf2Browser}var pbkdf2BrowserExports=requirePbkdf2Browser();var pbkdf2$1=getDefaultExportFromCjs(pbkdf2BrowserExports);var sha3;var hasRequiredSha3;function requireSha3(){if(hasRequiredSha3)return sha3;hasRequiredSha3=1;const Keccak=requireKeccak();class SHA3 extends Keccak{constructor(){super()}final(){return super.final(6,null)}static hash(){return new SHA3}static hmac(bits){return super.hmac(bits,6,null)}static digest(data,bits){return super.digest(data,bits,6,null)}static root(left,right,bits){return super.root(left,right,bits,6,null)}static multi(x,y,z,bits){return super.multi(x,y,z,bits,6,null)}static mac(data,key,bits){return super.mac(data,key,bits,6,null)}}SHA3.native=0;SHA3.id="SHA3_256";SHA3.size=32;SHA3.bits=256;SHA3.blockSize=136;SHA3.zero=bufferExports.Buffer.alloc(32,0);SHA3.ctx=new SHA3;sha3=SHA3;return sha3}var sha3Browser;var hasRequiredSha3Browser;function requireSha3Browser(){if(hasRequiredSha3Browser)return sha3Browser;hasRequiredSha3Browser=1;sha3Browser=requireSha3();return sha3Browser}var sha3512;var hasRequiredSha3512;function requireSha3512(){if(hasRequiredSha3512)return sha3512;hasRequiredSha3512=1;const SHA3=requireSha3Browser();class SHA3_512 extends SHA3{constructor(){super()}init(){return super.init(512)}static hash(){return new SHA3_512}static hmac(){return super.hmac(512)}static digest(data){return super.digest(data,512)}static root(left,right){return super.root(left,right,512)}static multi(x,y,z){return super.multi(x,y,z,512)}static mac(data,key){return super.mac(data,key,512)}}SHA3_512.native=SHA3.native;SHA3_512.id="SHA3_512";SHA3_512.size=64;SHA3_512.bits=512;SHA3_512.blockSize=72;SHA3_512.zero=bufferExports.Buffer.alloc(64,0);SHA3_512.ctx=new SHA3_512;sha3512=SHA3_512;return sha3512}var sha3512Exports=requireSha3512();var SHA3_512=getDefaultExportFromCjs(sha3512Exports);class Ed448Goldilock{static _channel=ed448;static generatePrivateKey(){var privateKey=ed448.privateKeyGenerate();privateKey[56]&=127;return privateKey}static getPublicKeyFromPrivateKey(privateKey){var secret=bufferExports.Buffer.from(privateKey,"hex");if(secret[56]>127){var scalar=secret.slice(0,56);scalar[0]&=252;scalar[55]|=128;var publicKey=this._channel.publicKeyFromScalar(scalar);return bufferExports.Buffer.from(publicKey).toString("hex")}else{var publicKey=this._channel.publicKeyCreate(secret);return bufferExports.Buffer.from(publicKey).toString("hex")}}static signWithPrivateKey(privateKey,msg){var msgToSign=bufferExports.Buffer.from(msg,"hex");var secret=bufferExports.Buffer.from(privateKey,"hex");if(secret[56]>127){var prefix=secret.slice(0,57);prefix[0]&=252;prefix[56]=0;prefix[55]|=128;var scalar=prefix.slice(0,56);var signedMessage=this._channel.signWithScalar(msgToSign,scalar,prefix);return bufferExports.Buffer.from(signedMessage).toString("hex")}else{var signedMessage=this._channel.sign(msgToSign,secret);return bufferExports.Buffer.from(signedMessage).toString("hex")}}static signWithPrivateKeyNConcatPubkey(privateKey,msg){var signedMessage=Ed448Goldilock.signWithPrivateKey(privateKey,msg);var publicKey=Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);return signedMessage+publicKey}static verifySignature(msgHash,signedMsg,pubKey){return this._channel.verify(bufferExports.Buffer.from(msgHash,"hex"),bufferExports.Buffer.from(signedMsg,"hex"),bufferExports.Buffer.from(pubKey,"hex"))}static SHA512Hash(password,salt){var p1=bufferExports.Buffer.from(password,"hex");var s1=bufferExports.Buffer.from(salt,"hex");return bufferExports.Buffer.from(pbkdf2$1.derive(SHA3_512,p1,s1,2048,57)).toString("hex")}static concatenateAndHex(prefix,key,index,salt){var ind=bufferExports.Buffer.alloc(4);var p=bufferExports.Buffer.alloc(1);p[0]=prefix%256;var j=index;for(let i=0;i<4;i++){ind[i]=j%256;j=Math.floor(j/256)}var t=p.toString("hex")+key+ind.toString("hex");return Ed448Goldilock.SHA512Hash(t,salt)}static addScalar(a,b){var a1=bufferExports.Buffer.from(a,"hex");var b1=bufferExports.Buffer.from(b.substr(0,106)+"00000000","hex");b1[0]&=252;var c=bufferExports.Buffer.alloc(57);var hold=0;for(let i=0;i<57;i++){hold+=a1[i]+b1[i];c[i]=hold%256;hold=Math.floor(hold/256)}return c.toString("hex")}static seedToExtendedPrivate(seed){var s1=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f72746865636861696e");var s2=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f727468656b6579");var b=bufferExports.Buffer.from(s2,"hex");b[56]|=128;b[55]|=128;b[55]&=191;var s3=b.toString("hex");return s1+s3}static childPrivateToPrivate(s,index){var s0=s.substr(0,114);var s1=s.substr(114,228);var r0,r1;if(index>=2147483648){r0=Ed448Goldilock.concatenateAndHex(1,s1,index,s0);r1=Ed448Goldilock.concatenateAndHex(0,s1,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}else{var pub=Ed448Goldilock.getPublicKeyFromPrivateKey(s1);r0=Ed448Goldilock.concatenateAndHex(3,pub,index,s0);r1=Ed448Goldilock.concatenateAndHex(2,pub,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}}static HDWalletGenerateKeyFromSeed(seed,index){var m=Ed448Goldilock.seedToExtendedPrivate(seed);var k1=Ed448Goldilock.childPrivateToPrivate(m,2147483648+44);var k2=Ed448Goldilock.childPrivateToPrivate(k1,2147483648+654);var k3=Ed448Goldilock.childPrivateToPrivate(k2,2147483648+0);var k4=Ed448Goldilock.childPrivateToPrivate(k3,2147483648+0);var k5=Ed448Goldilock.childPrivateToPrivate(k4,index);return k5.substr(114,228)}}function getGlobal$1(){if(typeof globalThis!=="undefined")return globalThis;if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal$1();const crypto=anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"ripemd160":return ripemd160$1.create();case"sha256":return sha256$2.create();case"sha512":return sha512$1.create();case"sha3-256":return sha3_256.create();case"sha3-512":return sha3_512.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}function createHmac(_algo,key){const algo={sha256:sha256$2,sha512:sha512$1,"sha3-256":sha3_256,"sha3-512":sha3_512}[_algo];assertArgument(algo!=null,"invalid hmac algorithm","algorithm",_algo);return hmac$1.create(algo,key)}function pbkdf2Sync(password,salt,iterations,keylen,_algo){const algo={sha256:sha256$2,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid pbkdf2 algorithm","algorithm",_algo);return pbkdf2$3(algo,password,salt,{c:iterations,dkLen:keylen})}function randomBytes$1(length){assert(crypto!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});assertArgument(Number.isInteger(length)&&length>0&&length<=1024,"invalid length","length",length);const result=new Uint8Array(length);crypto.getRandomValues(result);return result}const _sha256=data=>hexlify(createHash("sha3-256").update(data).digest());const _sha512=data=>hexlify(createHash("sha3-512").update(data).digest());let __sha256=_sha256;let __sha512=_sha512;let locked256=false,locked512=false;var SupportedAlgorithm;(function(SupportedAlgorithm){SupportedAlgorithm["sha256"]="sha256";SupportedAlgorithm["sha512"]="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));function sha256(data){return hexlify(__sha256(getBytes(data)))}function legacySha256(data){const _data=getBytes(data,"data");const hexlified=hexlify(createHash("sha256").update(_data).digest());return hexlified}sha256._=_sha256;sha256.lock=function(){locked256=true};sha256.register=function(func){if(locked256){throw new Error("sha256 is locked")}__sha256=func};Object.freeze(sha256);function sha512(data){return hexlify(__sha512(getBytes(data)))}sha512._=_sha512;sha512.lock=function(){locked512=true};sha512.register=function(func){if(locked512){throw new Error("sha512 is locked")}__sha512=func};Object.freeze(sha512);const logger$3=new Logger("address/0.0.1");const precompiledAddresses=["0000000000000000000000000000000000000000000000000000000000000000","0000000000000000000000000000000000000000000000000000000000000001","0000000000000000000000000000000000000000000000000000000000000002","0000000000000000000000000000000000000000000000000000000000000003","0000000000000000000000000000000000000000000000000000000000000004","0000000000000000000000000000000000000000000000000000000000000005","0000000000000000000000000000000000000000000000000000000000000006","0000000000000000000000000000000000000000000000000000000000000007","0000000000000000000000000000000000000000000000000000000000000008","0000000000000000000000000000000000000000000000000000000000000009"];function removeHexPrefix$1(val){return val.substring(0,2)==="0x"?val.substring(2):val}function calculateCheckSum(_address,_prefix){const address=getBytes("0x"+_address.replace("0x",""));const prefix=getBytes("0x"+_prefix.replace("0x",""));const tmpConcated=new Uint8Array([...address,...prefix]);const hexedConcat=hexlify(tmpConcated).replace("0x","")+"00";const mods=Array.from(hexedConcat.toUpperCase(),c=>{const charCode=c.charCodeAt(0);return charCode>64&&charCode<91?(charCode-55).toString():(charCode-48).toString()}).join("");const bigVal=BigInt(mods);const val97=BigInt(97);const val98=BigInt(98);const remainder=bigVal%val97;const checkSum=val98-remainder;const result=checkSum>9?checkSum.toString():"0"+checkSum.toString();return result}function getAddress(address){if(typeof address!=="string"){logger$3.throwArgumentError("invalid address","address",address)}if(!address.match(/^(0x)?[0-9a-fA-F]{44}$/)){logger$3.throwArgumentError("invalid address","address",address)}const raw=removeHexPrefix$1(address);if(precompiledAddresses.includes(raw)){return"0x"+raw}const prefix=raw.substring(0,2);const val=raw.substring(4);const checksum=calculateCheckSum(val,prefix);if(checksum!==raw.substring(2,4)){logger$3.throwArgumentError("bad address checksum","address",address)}return"0x"+prefix+checksum+val}function networkIdToPrefix(networkId){if(networkId==1){return"cb"}else if(networkId==3||networkId==4){return"ab"}else if(networkId>10||networkId==0){return"ce"}else{logger$3.throwArgumentError("bad networkId","networkId",networkId);return""}}let locked$4=false;const _computeHmac=function(algorithm,key,data){return createHmac(algorithm,key).update(data).digest()};let __computeHmac=_computeHmac;function computeHmac(algorithm,_key,_data){const key=getBytes(_key,"key");const data=getBytes(_data,"data");return hexlify(__computeHmac(algorithm,key,data))}computeHmac._=_computeHmac;computeHmac.lock=function(){locked$4=true};computeHmac.register=function(func){if(locked$4){throw new Error("computeHmac is locked")}__computeHmac=func};Object.freeze(computeHmac);let locked$3=false;const _ripemd160=function(data){return ripemd160$1(data)};let __ripemd160=_ripemd160;function ripemd160(_data){const data=getBytes(_data,"data");return hexlify(__ripemd160(data))}ripemd160._=_ripemd160;ripemd160.lock=function(){locked$3=true};ripemd160.register=function(func){if(locked$3){throw new TypeError("ripemd160 is locked")}__ripemd160=func};Object.freeze(ripemd160);let locked$2=false;const _pbkdf2=function(password,salt,iterations,keylen,algo){return pbkdf2Sync(password,salt,iterations,keylen,algo)};let __pbkdf2=_pbkdf2;function pbkdf2(_password,_salt,iterations,keylen,algo){const password=getBytes(_password,"password");const salt=getBytes(_salt,"salt");return hexlify(__pbkdf2(password,salt,iterations,keylen,algo))}pbkdf2._=_pbkdf2;pbkdf2.lock=function(){locked$2=true};pbkdf2.register=function(func){if(locked$2){throw new Error("pbkdf2 is locked")}__pbkdf2=func};Object.freeze(pbkdf2);let locked$1=false;const _randomBytes=function(length){return new Uint8Array(randomBytes$1(length))};let __randomBytes=_randomBytes;function randomBytes(length){return __randomBytes(length)}randomBytes._=_randomBytes;randomBytes.lock=function(){locked$1=true};randomBytes.register=function(func){if(locked$1){throw new Error("randomBytes is locked")}__randomBytes=func};Object.freeze(randomBytes);function XorAndSalsa(prev,pi,input,ii,out,oi){let y00=prev[pi++]^input[ii++],y01=prev[pi++]^input[ii++];let y02=prev[pi++]^input[ii++],y03=prev[pi++]^input[ii++];let y04=prev[pi++]^input[ii++],y05=prev[pi++]^input[ii++];let y06=prev[pi++]^input[ii++],y07=prev[pi++]^input[ii++];let y08=prev[pi++]^input[ii++],y09=prev[pi++]^input[ii++];let y10=prev[pi++]^input[ii++],y11=prev[pi++]^input[ii++];let y12=prev[pi++]^input[ii++],y13=prev[pi++]^input[ii++];let y14=prev[pi++]^input[ii++],y15=prev[pi++]^input[ii++];let x00=y00,x01=y01,x02=y02,x03=y03,x04=y04,x05=y05,x06=y06,x07=y07,x08=y08,x09=y09,x10=y10,x11=y11,x12=y12,x13=y13,x14=y14,x15=y15;for(let i=0;i<8;i+=2){x04^=rotl(x00+x12|0,7);x08^=rotl(x04+x00|0,9);x12^=rotl(x08+x04|0,13);x00^=rotl(x12+x08|0,18);x09^=rotl(x05+x01|0,7);x13^=rotl(x09+x05|0,9);x01^=rotl(x13+x09|0,13);x05^=rotl(x01+x13|0,18);x14^=rotl(x10+x06|0,7);x02^=rotl(x14+x10|0,9);x06^=rotl(x02+x14|0,13);x10^=rotl(x06+x02|0,18);x03^=rotl(x15+x11|0,7);x07^=rotl(x03+x15|0,9);x11^=rotl(x07+x03|0,13);x15^=rotl(x11+x07|0,18);x01^=rotl(x00+x03|0,7);x02^=rotl(x01+x00|0,9);x03^=rotl(x02+x01|0,13);x00^=rotl(x03+x02|0,18);x06^=rotl(x05+x04|0,7);x07^=rotl(x06+x05|0,9);x04^=rotl(x07+x06|0,13);x05^=rotl(x04+x07|0,18);x11^=rotl(x10+x09|0,7);x08^=rotl(x11+x10|0,9);x09^=rotl(x08+x11|0,13);x10^=rotl(x09+x08|0,18);x12^=rotl(x15+x14|0,7);x13^=rotl(x12+x15|0,9);x14^=rotl(x13+x12|0,13);x15^=rotl(x14+x13|0,18)}out[oi++]=y00+x00|0;out[oi++]=y01+x01|0;out[oi++]=y02+x02|0;out[oi++]=y03+x03|0;out[oi++]=y04+x04|0;out[oi++]=y05+x05|0;out[oi++]=y06+x06|0;out[oi++]=y07+x07|0;out[oi++]=y08+x08|0;out[oi++]=y09+x09|0;out[oi++]=y10+x10|0;out[oi++]=y11+x11|0;out[oi++]=y12+x12|0;out[oi++]=y13+x13|0;out[oi++]=y14+x14|0;out[oi++]=y15+x15|0}function BlockMix(input,ii,out,oi,r){let head=oi+0;let tail=oi+16*r;for(let i=0;i<16;i++)out[tail+i]=input[ii+(2*r-1)*16+i];for(let i=0;i0)tail+=16;XorAndSalsa(out,head,input,ii+=16,out,tail)}}const SCRYPT_DEFAULT_MAXMEM=128*8*(2**20+1+1);function scryptInit(password,salt,_opts){const opts=checkOpts({dkLen:32,asyncTick:10,maxmem:SCRYPT_DEFAULT_MAXMEM},_opts);const{N,r,p,dkLen,asyncTick,maxmem,onProgress}=opts;anumber(N,"N");anumber(r,"r");anumber(p,"p");anumber(dkLen,"dkLen");anumber(asyncTick,"asyncTick");anumber(maxmem,"maxmem");if(onProgress!==undefined&&typeof onProgress!=="function")throw new Error('"onProgress" must be a function');if(r<1)throw new Error('"r" expected integer >= 1');const blockSize=128*r;const blockSize32=blockSize/4;const pow32=Math.pow(2,32);if(N<=1||(N&N-1)!==0||N>pow32)throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32');if(p<1||p>(pow32-1)*32/blockSize)throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)');if(dkLen<1||dkLen>(pow32-1)*32)throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32');const memUsed=blockSize*(N+p+1);if(memUsed>maxmem)throw new Error('"maxmem" limit was hit: memUsed(128*r*(N+p+1))='+memUsed+", maxmem="+maxmem);const B=pbkdf2$3(sha256$2,password,salt,{c:1,dkLen:blockSize*p});const B32=u32(B);const V=u32(new Uint8Array(blockSize*N));const tmp=u32(new Uint8Array(blockSize));let blockMixCb=()=>{};if(onProgress){const totalBlockMix=2*N*p;const callbackPer=Math.max(Math.floor(totalBlockMix/1e4),1);let blockMixCnt=0;blockMixCb=()=>{blockMixCnt++;if(onProgress&&(!(blockMixCnt%callbackPer)||blockMixCnt===totalBlockMix)){try{onProgress(blockMixCnt/totalBlockMix)}catch(e){clean(B,V,tmp);throw e}}}}return{N:N,r:r,p:p,dkLen:dkLen,blockSize32:blockSize32,V:V,B32:B32,B:B,tmp:tmp,blockMixCb:blockMixCb,asyncTick:asyncTick}}function scryptOutput(password,dkLen,B,V,tmp){const res=pbkdf2$3(sha256$2,password,B,{c:1,dkLen:dkLen});clean(B,V,tmp);return res}function scrypt$1(password,salt,opts){const{N,r,p,dkLen,blockSize32,V,B32,B,tmp,blockMixCb}=scryptInit(password,salt,opts);swap32IfBE(B32);for(let pi=0;pi>>0;for(let k=0;kclean(B,V,tmp);swap32IfBE(B32);for(let pi=0;pi{BlockMix(V,pos,V,pos+=blockSize32,r);blockMixCb()},abort);BlockMix(V,(N-1)*blockSize32,B32,Pi,r);blockMixCb();await asyncLoop(N,asyncTick,()=>{const j=(B32[Pi+blockSize32-16]&N-1)>>>0;for(let k=0;k127){const prefix=keyBuffer.slice(0,57);prefix[0]&=252;prefix[55]|=128;prefix[56]=0;const scalar=prefix.slice(0,56);const bufferDigest=bufferExports.Buffer.from(digestBuffer);const bufferPrfx=bufferExports.Buffer.from(prefix);const bufferScalar=bufferExports.Buffer.from(scalar);const sig=ed448.signWithScalar(bufferDigest,bufferScalar,bufferPrfx);const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}const sig=ed448.sign(bufferExports.Buffer.from(digestBuffer),bufferExports.Buffer.from(keyBuffer));const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}computeSharedSecret(other){const pub=bufferExports.Buffer.from(getBytesCopy(other));assertArgument(pub.length===57&&ed448.publicKeyVerify(pub),"invalid public key","other",other);const key=bufferExports.Buffer.from(getBytesCopy(this.#privateKey));if(key[56]>127){const scalar=key.subarray(0,56);scalar[0]&=252;scalar[55]|=128;return hexlify(ed448.deriveWithScalar(pub,scalar))}return hexlify(ed448.derive(pub,key))}static computePublicKey(key,compressed){const bytes=bufferExports.Buffer.from(arrayify(key));if(bytes.length!==57){logger$2.throwArgumentError("invalid private key","key","[REDACTED]")}if(bytes[56]>127){const scalar=bytes.slice(0,56);scalar[0]&=252;scalar[55]|=128;const pub=ed448.publicKeyFromScalar(scalar);return hexlify(pub)}const pub=ed448.publicKeyCreate(bytes);return hexlify(pub)}static recoverPublicKey(digest,signature){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const digestBuffer=bufferExports.Buffer.from(arrayify(digest));const sigBuffer=bufferExports.Buffer.from(arrayify(signature));if(sigBuffer.length!==171){logger$2.throwArgumentError("invalid signature","signature",signature)}const sig=sigBuffer.slice(0,114);const pub=sigBuffer.slice(114);if(ed448.verify(digestBuffer,sig,pub)){return hexlify(pub)}logger$2.throwArgumentError("invalid signature","signature",signature);return""}static addPoints(p0,p1,compressed){const points=[p0,p1].map(point=>{const bytes=bufferExports.Buffer.from(getBytesCopy(point));assertArgument(bytes.length===57&&ed448.publicKeyVerify(bytes),"invalid public key","point",point);return bytes});return hexlify(ed448.publicKeyCombine(points))}}const BN_0$6=BigInt(0);const BN_1$3=BigInt(1);const BN_2$1=BigInt(2);const BN_27=BigInt(27);const BN_28=BigInt(28);const BN_35=BigInt(35);const _guard$4={};class Signature{#r;#s;#v;#networkV;get r(){return this.#r}set r(value){assertArgument(dataLength(value)===32,"invalid r","value",value);this.#r=hexlify(value)}get s(){return this.#s}set s(_value){assertArgument(dataLength(_value)===32,"invalid s","value",_value);const value=hexlify(_value);assertArgument(parseInt(value.substring(0,3))<8,"non-canonical s","value",value);this.#s=value}get v(){return this.#v}set v(value){const v=getNumber(value,"value");assertArgument(v===27||v===28,"invalid v","v",value);this.#v=v}get networkV(){return this.#networkV}get legacynetworkId(){const v=this.networkV;if(v==null){return null}return Signature.getnetworkId(v)}get yParity(){return this.v===27?0:1}get yParityAndS(){const yParityAndS=getBytes(this.s);if(this.yParity){yParityAndS[0]|=128}return hexlify(yParityAndS)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(guard,r,s,v){assertPrivate(guard,_guard$4,"Signature");this.#r=r;this.#s=s;this.#v=v;this.#networkV=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const clone=new Signature(_guard$4,this.r,this.s,this.v);if(this.networkV){clone.#networkV=this.networkV}return clone}toJSON(){const networkV=this.networkV;return{_type:"signature",networkV:networkV!=null?networkV.toString():null,r:this.r,s:this.s,v:this.v}}static getnetworkId(v){const bv=getBigInt(v,"v");if(bv==BN_27||bv==BN_28){return BN_0$6}assertArgument(bv>=BN_35,"invalid EIP-155 v","v",v);return(bv-BN_35)/BN_2$1}static getnetworkIdV(networkId,v){return getBigInt(networkId)*BN_2$1+BigInt(35+v-27)}static getNormalizedV(v){const bv=getBigInt(v);if(bv===BN_0$6||bv===BN_27){return 27}if(bv===BN_1$3||bv===BN_28){return 28}assertArgument(bv>=BN_35,"invalid v","v",v);return bv&BN_1$3?27:28}}function lock(){computeHmac.lock();pbkdf2.lock();randomBytes.lock();ripemd160.lock();scrypt.lock();scryptSync.lock();sha256.lock();sha512.lock();randomBytes.lock()}function removeHexPrefix(val){return val.substring(0,2)==="0x"?val.substring(2):val}function publicToAddress(key,prefix){const val=hexDataSlice(sha256(key),12);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function computeAddress(key,prefix){let pubkey;if(typeof key==="string"){pubkey=SigningKey.computePublicKey(key,false)}else{pubkey=key.publicKey}return publicToAddress(pubkey,prefix)}function recoverAddress(digest,signature,prefix){const publicKey=SigningKey.recoverPublicKey(arrayify(digest),signature);return publicToAddress(publicKey,prefix)}function extractPrefix(address){address=getAddress(address);return address.substring(2,4)}const WordSize=32;const Padding=new Uint8Array(WordSize);const passProperties$1=["then"];const _guard$3={};function throwError(name,error){const wrapped=new Error(`deferred error during ABI decoding triggered accessing ${name}`);wrapped.error=error;throw wrapped}class Result extends Array{#names;constructor(...args){const guard=args[0];let items=args[1];let names=(args[2]||[]).slice();let wrap=true;if(guard!==_guard$3){items=args;names=[];wrap=false}super(items.length);items.forEach((item,index)=>{this[index]=item});const nameCounts=names.reduce((accum,name)=>{if(typeof name==="string"){accum.set(name,(accum.get(name)||0)+1)}return accum},new Map);this.#names=Object.freeze(items.map((item,index)=>{const name=names[index];if(name!=null&&nameCounts.get(name)===1){return name}return null}));if(!wrap){return}Object.freeze(this);return new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="string"){if(prop.match(/^[0-9]+$/)){const index=getNumber(prop,"%index");if(index<0||index>=this.length){throw new RangeError("out of result range")}const item=target[index];if(item instanceof Error){throwError(`index ${index}`,item)}return item}if(passProperties$1.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}const value=target[prop];if(value instanceof Function){return function(...args){return value.apply(this===receiver?target:this,args)}}else if(!(prop in target)){return target.getValue.apply(this===receiver?target:this,[prop])}}return Reflect.get(target,prop,receiver)}})}toArray(){const result=[];this.forEach((item,index)=>{if(item instanceof Error){throwError(`index ${index}`,item)}result.push(item)});return result}toObject(){return this.#names.reduce((accum,name,index)=>{assert(name!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"});if(!(name in accum)){accum[name]=this.getValue(name)}return accum},{})}slice(start,end){if(start==null){start=0}if(start<0){start+=this.length;if(start<0){start=0}}if(end==null){end=this.length}if(end<0){end+=this.length;if(end<0){end=0}}if(end>this.length){end=this.length}const result=[],names=[];for(let i=start;i{this.#data[offset]=getValue$1(value)}}}class Reader{allowLoose;#data;#offset;constructor(data,allowLoose){defineProperties(this,{allowLoose:!!allowLoose});this.#data=getBytesCopy(data);this.#offset=0}get data(){return hexlify(this.#data)}get dataLength(){return this.#data.length}get consumed(){return this.#offset}get bytes(){return new Uint8Array(this.#data)}#peekBytes(offset,length,loose){let alignedLength=Math.ceil(length/WordSize)*WordSize;if(this.#offset+alignedLength>this.#data.length){if(this.allowLoose&&loose&&this.#offset+length<=this.#data.length){alignedLength=length}else{assert(false,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),length:this.#data.length,offset:this.#offset+alignedLength})}}return this.#data.slice(this.#offset,this.#offset+alignedLength)}subReader(offset){return new Reader(this.#data.slice(this.#offset+offset),this.allowLoose)}readBytes(length,loose){let bytes=this.#peekBytes(0,length,!!loose);this.#offset+=bytes.length;return bytes.slice(0,length)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}}const _gaurd={};function n(value,width){let signed=false;if(width<0){signed=true;width*=-1}return new Typed(_gaurd,`${signed?"":"u"}int${width}`,value,{signed:signed,width:width})}function b(value,size){return new Typed(_gaurd,`bytes${size?size:""}`,value,{size:size})}const _typedSymbol=Symbol.for("_corebc_typed");class Typed{type;value;#options;_typedSymbol;constructor(gaurd,type,value,options){if(options==null){options=null}assertPrivate(_gaurd,gaurd,"Typed");defineProperties(this,{_typedSymbol:_typedSymbol,type:type,value:value});this.#options=options;this.format()}format(){if(this.type==="array"){throw new Error("")}else if(this.type==="dynamicArray"){throw new Error("")}else if(this.type==="tuple"){return`tuple(${this.value.map(v=>v.format()).join(",")})`}return this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple"){throw TypeError("not a tuple")}return this.#options}get arrayLength(){if(this.type!=="array"){throw TypeError("not an array")}if(this.#options===true){return-1}if(this.#options===false){return this.value.length}return null}static from(type,value){return new Typed(_gaurd,type,value)}static uint8(v){return n(v,8)}static uint16(v){return n(v,16)}static uint24(v){return n(v,24)}static uint32(v){return n(v,32)}static uint40(v){return n(v,40)}static uint48(v){return n(v,48)}static uint56(v){return n(v,56)}static uint64(v){return n(v,64)}static uint72(v){return n(v,72)}static uint80(v){return n(v,80)}static uint88(v){return n(v,88)}static uint96(v){return n(v,96)}static uint104(v){return n(v,104)}static uint112(v){return n(v,112)}static uint120(v){return n(v,120)}static uint128(v){return n(v,128)}static uint136(v){return n(v,136)}static uint144(v){return n(v,144)}static uint152(v){return n(v,152)}static uint160(v){return n(v,160)}static uint168(v){return n(v,168)}static uint176(v){return n(v,176)}static uint184(v){return n(v,184)}static uint192(v){return n(v,192)}static uint200(v){return n(v,200)}static uint208(v){return n(v,208)}static uint216(v){return n(v,216)}static uint224(v){return n(v,224)}static uint232(v){return n(v,232)}static uint240(v){return n(v,240)}static uint248(v){return n(v,248)}static uint256(v){return n(v,256)}static uint(v){return n(v,256)}static int8(v){return n(v,-8)}static int16(v){return n(v,-16)}static int24(v){return n(v,-24)}static int32(v){return n(v,-32)}static int40(v){return n(v,-40)}static int48(v){return n(v,-48)}static int56(v){return n(v,-56)}static int64(v){return n(v,-64)}static int72(v){return n(v,-72)}static int80(v){return n(v,-80)}static int88(v){return n(v,-88)}static int96(v){return n(v,-96)}static int104(v){return n(v,-104)}static int112(v){return n(v,-112)}static int120(v){return n(v,-120)}static int128(v){return n(v,-128)}static int136(v){return n(v,-136)}static int144(v){return n(v,-144)}static int152(v){return n(v,-152)}static int160(v){return n(v,-160)}static int168(v){return n(v,-168)}static int176(v){return n(v,-176)}static int184(v){return n(v,-184)}static int192(v){return n(v,-192)}static int200(v){return n(v,-200)}static int208(v){return n(v,-208)}static int216(v){return n(v,-216)}static int224(v){return n(v,-224)}static int232(v){return n(v,-232)}static int240(v){return n(v,-240)}static int248(v){return n(v,-248)}static int256(v){return n(v,-256)}static int(v){return n(v,-256)}static bytes1(v){return b(v,1)}static bytes2(v){return b(v,2)}static bytes3(v){return b(v,3)}static bytes4(v){return b(v,4)}static bytes5(v){return b(v,5)}static bytes6(v){return b(v,6)}static bytes7(v){return b(v,7)}static bytes8(v){return b(v,8)}static bytes9(v){return b(v,9)}static bytes10(v){return b(v,10)}static bytes11(v){return b(v,11)}static bytes12(v){return b(v,12)}static bytes13(v){return b(v,13)}static bytes14(v){return b(v,14)}static bytes15(v){return b(v,15)}static bytes16(v){return b(v,16)}static bytes17(v){return b(v,17)}static bytes18(v){return b(v,18)}static bytes19(v){return b(v,19)}static bytes20(v){return b(v,20)}static bytes21(v){return b(v,21)}static bytes22(v){return b(v,22)}static bytes23(v){return b(v,23)}static bytes24(v){return b(v,24)}static bytes25(v){return b(v,25)}static bytes26(v){return b(v,26)}static bytes27(v){return b(v,27)}static bytes28(v){return b(v,28)}static bytes29(v){return b(v,29)}static bytes30(v){return b(v,30)}static bytes31(v){return b(v,31)}static bytes32(v){return b(v,32)}static address(v){return new Typed(_gaurd,"address",v)}static bool(v){return new Typed(_gaurd,"bool",!!v)}static bytes(v){return new Typed(_gaurd,"bytes",v)}static string(v){return new Typed(_gaurd,"string",v)}static array(v,dynamic){throw new Error("not implemented yet")}static tuple(v,name){throw new Error("not implemented yet")}static overrides(v){return new Typed(_gaurd,"overrides",Object.assign({},v))}static isTyped(value){return value&&value._typedSymbol===_typedSymbol}static dereference(value,type){if(Typed.isTyped(value)){if(value.type!==type){throw new Error(`invalid type: expecetd ${type}, got ${value.type}`)}return value.value}return value}}class AddressCoder extends Coder{constructor(localName){super("address","address",localName,false)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(writer,_value){let value=Typed.dereference(_value,"string");try{value=getAddress(value)}catch(error){return this._throwError(error.message,_value)}return writer.writeValue(value)}decode(reader){return getAddress(toBeHex(reader.readValue(),22))}}class AnonymousCoder extends Coder{coder;constructor(coder){super(coder.name,coder.type,"_",coder.dynamic);this.coder=coder}defaultValue(){return this.coder.defaultValue()}encode(writer,value){return this.coder.encode(writer,value)}decode(reader){return this.coder.decode(reader)}}function pack(writer,coders,values){let arrayValues=[];if(Array.isArray(values)){arrayValues=values}else if(values&&typeof values==="object"){let unique={};arrayValues=coders.map(coder=>{const name=coder.localName;assert(name,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});assert(!unique[name],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});unique[name]=true;return values[name]})}else{assertArgument(false,"invalid tuple value","tuple",values)}assertArgument(coders.length===arrayValues.length,"types/value length mismatch","tuple",values);let staticWriter=new Writer;let dynamicWriter=new Writer;let updateFuncs=[];coders.forEach((coder,index)=>{let value=arrayValues[index];if(coder.dynamic){let dynamicOffset=dynamicWriter.length;coder.encode(dynamicWriter,value);let updateFunc=staticWriter.writeUpdatableValue();updateFuncs.push(baseOffset=>{updateFunc(baseOffset+dynamicOffset)})}else{coder.encode(staticWriter,value)}});updateFuncs.forEach(func=>{func(staticWriter.length)});let length=writer.appendWriter(staticWriter);length+=writer.appendWriter(dynamicWriter);return length}function unpack(reader,coders){let values=[];let keys=[];let baseReader=reader.subReader(0);coders.forEach(coder=>{let value=null;if(coder.dynamic){let offset=reader.readIndex();let offsetReader=baseReader.subReader(offset);try{value=coder.decode(offsetReader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}else{try{value=coder.decode(reader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}if(value==undefined){throw new Error("investigate")}values.push(value);keys.push(coder.localName||null)});return Result.fromItems(values,keys)}class ArrayCoder extends Coder{coder;length;constructor(coder,length,localName){const type=coder.type+"["+(length>=0?length:"")+"]";const dynamic=length===-1||coder.dynamic;super("array",type,localName,dynamic);defineProperties(this,{coder:coder,length:length})}defaultValue(){const defaultChild=this.coder.defaultValue();const result=[];for(let i=0;ibounds||value<-(bounds+BN_1$2)){this._throwError("value out-of-bounds",_value)}value=toTwos(value,8*WordSize)}else if(valuemask(maxUintValue,this.size*8)){this._throwError("value out-of-bounds",_value)}return writer.writeValue(value)}decode(reader){let value=mask(reader.readValue(),this.size*8);if(this.signed){value=fromTwos(value,this.size*8)}return value}}class StringCoder extends DynamicBytesCoder{constructor(localName){super("string",localName)}defaultValue(){return""}encode(writer,_value){return super.encode(writer,toUtf8Bytes(Typed.dereference(_value,"string")))}decode(reader){return toUtf8String(super.decode(reader))}}class TupleCoder extends Coder{coders;constructor(coders,localName){let dynamic=false;const types=[];coders.forEach(coder=>{if(coder.dynamic){dynamic=true}types.push(coder.type)});const type="tuple("+types.join(",")+")";super("tuple",type,localName,dynamic);defineProperties(this,{coders:Object.freeze(coders.slice())})}defaultValue(){const values=[];this.coders.forEach(coder=>{values.push(coder.defaultValue())});const uniqueNames=this.coders.reduce((accum,coder)=>{const name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});this.coders.forEach((coder,index)=>{let name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}values[name]=values[index]});return Object.freeze(values)}encode(writer,_value){const value=Typed.dereference(_value,"tuple");return pack(writer,this.coders,value)}decode(reader){return unpack(reader,this.coders)}}function id(value,useKeccak){if(useKeccak){return keccak256(toUtf8Bytes(value))}return sha256(toUtf8Bytes(value))}const ZeroAddress="0x0000000000000000000000000000000000000000";const ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000";const N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const OrePerXCB=BigInt("1000000000000000000");const MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);const MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const CoreSymbol="Ξ";const MessagePrefix="Core Signed Message:\n";function accessSetify(addr,storageKeys){return{address:getAddress(addr),storageKeys:storageKeys.map((storageKey,index)=>{assertArgument(isHexString(storageKey,32),"invalid slot",`storageKeys[${index}]`,storageKey);return storageKey.toLowerCase()})}}function accessListify(value){if(Array.isArray(value)){return value.map((set,index)=>{if(Array.isArray(set)){assertArgument(set.length===2,"invalid slot set",`value[${index}]`,set);return accessSetify(set[0],set[1])}assertArgument(set!=null&&typeof set==="object","invalid address-slot set","value",value);return accessSetify(set.address,set.storageKeys)})}assertArgument(value!=null&&typeof value==="object","invalid access list","value",value);const result=Object.keys(value).map(addr=>{const storageKeys=value[addr].reduce((accum,storageKey)=>{accum[storageKey]=true;return accum},{});return accessSetify(addr,Object.keys(storageKeys).sort())});result.sort((a,b)=>a.address.localeCompare(b.address));return result}const logger$1=new Logger("transaction/0.0.1");const BN_0$4=BigInt(0);function handleAddress(value){if(value==="0x"){return null}return getAddress(value)}function parse(data){const handleNumber=value=>{if(value==="0x"){return BigNumber.from(0)}return BigNumber.from(value)};const transaction=decode$1(data);if(transaction.length!==7&&transaction.length!==8){logger$1.throwArgumentError("invalid raw transaction","data",data)}const isSigned=transaction.length===8;const tx={nonce:Number(handleNumber(transaction[0])),energyPrice:handleNumber(transaction[1]).toBigInt(),energyLimit:handleNumber(transaction[2]).toBigInt(),networkId:handleNumber(transaction[isSigned?3:6]).toBigInt(),to:handleAddress(transaction[isSigned?4:3]),value:handleNumber(transaction[isSigned?5:4]).toBigInt(),data:transaction[isSigned?6:5]};if(transaction.length===8){const prefix=networkIdToPrefix(Number(tx.networkId));const digest=sha256(serialize(tx));tx.hash=sha256(serialize(tx,transaction[7]));tx.from=recoverAddress(digest,transaction[7],prefix);tx.signature=transaction[7]}return tx}const unsignedTransactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"},{name:"networkId",maxLength:32,numeric:true}];const transactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"networkId",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"}];const allowedTransactionKeys={networkId:true,data:true,energyLimit:true,energyPrice:true,nonce:true,to:true,value:true};function serialize(transaction,signature){checkProperties(transaction,allowedTransactionKeys);const raw=[];(!!signature?transactionFields:unsignedTransactionFields).forEach(function({numeric,maxLength,name,length}){let value=transaction[name]||[];const options={};if(numeric){options.hexPad="left"}const tmpHexlified=hexlify(value,options);value=arrayify(tmpHexlified);if(length&&value.length!==length&&value.length>0){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}if(maxLength){value=stripZeros(value);if(value.length>maxLength){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}}const hexlified=hexlify(value);raw.push(hexlified)});if(!!signature){raw.push(hexlify(signature))}const finalValue=encode(raw);return finalValue}class Transaction{#to;#data;#nonce;#energyLimit;#energyPrice;#value;#networkId;#sig;get to(){return this.#to}set to(value){this.#to=value==null?null:getAddress(value)}get nonce(){return this.#nonce}set nonce(value){this.#nonce=getNumber(value,"value")}get energyLimit(){return this.#energyLimit}set energyLimit(value){this.#energyLimit=getBigInt(value)}get energyPrice(){const value=this.#energyPrice;if(value==null){return BN_0$4}return value}set energyPrice(value){this.#energyPrice=value==null?null:getBigInt(value,"energyPrice")}get data(){return this.#data}set data(value){this.#data=hexlify(value)}get value(){return this.#value}set value(value){this.#value=getBigInt(value,"value")}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value)}get signature(){return this.#sig||null}set signature(value){this.#sig=value==null?null:value}constructor(){this.#to=null;this.#nonce=0;this.#energyLimit=BigInt(0);this.#energyPrice=null;this.#data="0x";this.#value=BigInt(0);this.#networkId=BigInt(0);this.#sig=null}get hash(){if(this.signature==null){return null}return sha256(this.serialized)}get unsignedHash(){return sha256(this.unsignedSerialized)}get from(){if(this.signature==null){return null}const prefix=networkIdToPrefix(Number(this.#networkId));return recoverAddress(this.unsignedHash,this.signature,prefix)}get fromPublicKey(){if(this.signature==null){return null}return SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){assert(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});return serialize(this,this.signature)}get unsignedSerialized(){return serialize(this)}clone(){return Transaction.from(this)}toJSON(){const s=v=>{if(v==null){return null}return v.toString()};return{to:this.to,data:this.data,nonce:this.nonce,energyLimit:s(this.energyLimit),energyPrice:s(this.energyPrice),value:s(this.value),networkId:s(this.networkId),sig:this.signature?this.signature:null}}static from(tx){if(tx==null){return new Transaction}if(typeof tx==="string"){const payload=getBytes(tx);return Transaction.from(parse(payload))}const result=new Transaction;if(tx.to!=null){result.to=tx.to}if(tx.nonce!=null){result.nonce=tx.nonce}if(tx.energyLimit!=null){result.energyLimit=tx.energyLimit}if(tx.energyPrice!=null){result.energyPrice=tx.energyPrice}if(tx.data!=null){result.data=tx.data}if(tx.value!=null){result.value=tx.value}if(tx.networkId!=null){result.networkId=tx.networkId}if(tx.signature!=null){result.signature=tx.signature}if(tx.hash!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define hash","tx",tx);assertArgument(result.hash===tx.hash,"hash mismatch","tx",tx)}if(tx.from!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define from","tx",tx);assertArgument(result.from.toLowerCase()===(tx.from||"").toLowerCase(),"from mismatch","tx",tx)}return result}}function hashMessage(message){if(typeof message==="string"){message=toUtf8Bytes(message)}return sha256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(message.length)),message]))}function verifyMessage(message,sig,prefix){const digest=hashMessage(message);return recoverAddress(digest,sig,prefix)}const regexBytes=new RegExp("^bytes([0-9]+)$");const regexNumber=new RegExp("^(u?int)([0-9]*)$");const regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$");function _pack(type,value,isArray){switch(type){case"address":if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(getAddress(value));case"string":return toUtf8Bytes(value);case"bytes":return getBytes(value);case"bool":value=!!value?"0x01":"0x00";if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(value)}let match=type.match(regexNumber);if(match){let signed=match[1]==="int";let size=parseInt(match[2]||"256");assertArgument((!match[2]||match[2]===String(size))&&size%8===0&&size!==0&&size<=256,"invalid number type","type",type);if(isArray){size=256}if(signed){value=toTwos(value,size)}return getBytes(zeroPadValue(toBeArray(value),size/8))}match=type.match(regexBytes);if(match){const size=parseInt(match[1]);assertArgument(String(size)===match[1]&&size!==0&&size<=32,"invalid bytes type","type",type);assertArgument(dataLength(value)===size,`invalid value for ${type}`,"value",value);if(isArray){return getBytes(zeroPadBytes(value,32))}return value}match=type.match(regexArray);if(match&&Array.isArray(value)){const baseType=match[1];const count=parseInt(match[2]||String(value.length));assertArgument(count===value.length,`invalid array length for ${type}`,"value",value);const result=[];value.forEach(function(value){result.push(_pack(baseType,value,true))});return getBytes(concat(result))}assertArgument(false,"invalid type","type",type)}function solidityPacked(types,values){assertArgument(types.length===values.length,"wrong number of values; expected ${ types.length }","values",values);const tight=[];types.forEach(function(type,index){tight.push(_pack(type,values[index]))});return hexlify(concat(tight))}function solidityPackedSha256(types,values){return sha256(solidityPacked(types,values))}const padding=new Uint8Array(32);padding.fill(0);const BN__1=BigInt(-1);const BN_0$3=BigInt(0);const BN_1$1=BigInt(1);const BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(value){const bytes=getBytes(value);const padOffset=bytes.length%32;if(padOffset){return concat([bytes,padding.slice(padOffset)])}return hexlify(bytes)}const hexTrue=toBeHex(BN_1$1,32);const hexFalse=toBeHex(BN_0$3,32);const domainFieldTypes={name:"string",version:"string",networkId:"uint256",verifyingContract:"address",salt:"bytes32"};const domainFieldNames=["name","version","networkId","verifyingContract","salt"];function checkString(key){return function(value){assertArgument(typeof value==="string",`invalid domain value for ${JSON.stringify(key)}`,`domain.${key}`,value);return value}}const domainChecks={name:checkString("name"),version:checkString("version"),networkId:function(_value){const value=getBigInt(_value,"domain.networkId");assertArgument(value>=0,"invalid chain ID","domain.networkId",_value);if(Number.isSafeInteger(value)){return Number(value)}return toQuantity(value)},verifyingContract:function(value){try{return getAddress(value).toLowerCase()}catch(error){}assertArgument(false,`invalid domain value "verifyingContract"`,"domain.verifyingContract",value)},salt:function(value){const bytes=getBytes(value,"domain.salt");assertArgument(bytes.length===32,`invalid domain value "salt"`,"domain.salt",value);return hexlify(bytes)}};function getBaseEncoder(type){{const match=type.match(/^(u?)int(\d*)$/);if(match){const signed=match[1]==="";const width=parseInt(match[2]||"256");assertArgument(width%8===0&&width!==0&&width<=256&&(match[2]==null||match[2]===String(width)),"invalid numeric width","type",type);const boundsUpper=mask(BN_MAX_UINT256,signed?width-1:width);const boundsLower=signed?(boundsUpper+BN_1$1)*BN__1:BN_0$3;return function(_value){const value=getBigInt(_value,"value");assertArgument(value>=boundsLower&&value<=boundsUpper,`value out-of-bounds for ${type}`,"value",value);return toBeHex(signed?toTwos(value,256):value,32)}}}{const match=type.match(/^bytes(\d+)$/);if(match){const width=parseInt(match[1]);assertArgument(width!==0&&width<=32&&match[1]===String(width),"invalid bytes width","type",type);return function(value){const bytes=getBytes(value);assertArgument(bytes.length===width,`invalid length for ${type}`,"value",value);return hexPadRight(value)}}}switch(type){case"address":return function(value){return zeroPadValue(getAddress(value),32)};case"bool":return function(value){return!value?hexFalse:hexTrue};case"bytes":return function(value){return sha256(value)};case"string":return function(value){return id(value)}}return null}function encodeType(name,fields){return`${name}(${fields.map(({name,type})=>type+" "+name).join(",")})`}class TypedDataEncoder{primaryType;#types;get types(){return JSON.parse(this.#types)}#fullTypes;#encoderCache;constructor(types){this.#types=JSON.stringify(types);this.#fullTypes=new Map;this.#encoderCache=new Map;const links=new Map;const parents=new Map;const subtypes=new Map;Object.keys(types).forEach(type=>{links.set(type,new Set);parents.set(type,[]);subtypes.set(type,new Set)});for(const name in types){const uniqueNames=new Set;for(const field of types[name]){assertArgument(!uniqueNames.has(field.name),`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`,"types",types);uniqueNames.add(field.name);const baseType=field.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;assertArgument(baseType!==name,`circular type reference to ${JSON.stringify(baseType)}`,"types",types);const encoder=getBaseEncoder(baseType);if(encoder){continue}assertArgument(parents.has(baseType),`unknown type ${JSON.stringify(baseType)}`,"types",types);parents.get(baseType).push(name);links.get(name).add(baseType)}}const primaryTypes=Array.from(parents.keys()).filter(n=>parents.get(n).length===0);assertArgument(primaryTypes.length!==0,"missing primary type","types",types);assertArgument(primaryTypes.length===1,`ambiguous primary types or unused types: ${primaryTypes.map(t=>JSON.stringify(t)).join(", ")}`,"types",types);defineProperties(this,{primaryType:primaryTypes[0]});function checkCircular(type,found){assertArgument(!found.has(type),`circular type reference to ${JSON.stringify(type)}`,"types",types);found.add(type);for(const child of links.get(type)){if(!parents.has(child)){continue}checkCircular(child,found);for(const subtype of found){subtypes.get(subtype).add(child)}}found.delete(type)}checkCircular(this.primaryType,new Set);for(const[name,set]of subtypes){const st=Array.from(set);st.sort();this.#fullTypes.set(name,encodeType(name,types[name])+st.map(t=>encodeType(t,types[t])).join(""))}}getEncoder(type){let encoder=this.#encoderCache.get(type);if(!encoder){encoder=this.#getEncoder(type);this.#encoderCache.set(type,encoder)}return encoder}#getEncoder(type){{const encoder=getBaseEncoder(type);if(encoder){return encoder}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){const subtype=match[1];const subEncoder=this.getEncoder(subtype);return value=>{assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);let result=value.map(subEncoder);if(this.#fullTypes.has(subtype)){result=result.map(sha256)}return sha256(concat(result))}}const fields=this.types[type];if(fields){const encodedType=id(this.#fullTypes.get(type));return value=>{const values=fields.map(({name,type})=>{const result=this.getEncoder(type)(value[name]);if(this.#fullTypes.has(type)){return sha256(result)}return result});values.unshift(encodedType);return concat(values)}}assertArgument(false,`unknown type: ${type}`,"type",type)}encodeType(name){const result=this.#fullTypes.get(name);assertArgument(result,`unknown type: ${JSON.stringify(name)}`,"name",name);return result}encodeData(type,value){return this.getEncoder(type)(value)}hashStruct(name,value){return sha256(this.encodeData(name,value))}encode(value){return this.encodeData(this.primaryType,value)}hash(value){return this.hashStruct(this.primaryType,value)}_visit(type,value,callback){{const encoder=getBaseEncoder(type);if(encoder){return callback(type,value)}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);return value.map(v=>this._visit(match[1],v,callback))}const fields=this.types[type];if(fields){return fields.reduce((accum,{name,type})=>{accum[name]=this._visit(type,value[name],callback);return accum},{})}assertArgument(false,`unknown type: ${type}`,"type",type)}visit(value,callback){return this._visit(this.primaryType,value,callback)}static from(types){return new TypedDataEncoder(types)}static getPrimaryType(types){return TypedDataEncoder.from(types).primaryType}static hashStruct(name,types,value){return TypedDataEncoder.from(types).hashStruct(name,value)}static hashDomain(domain){const domainFields=[];for(const name in domain){if(domain[name]==null){continue}const type=domainFieldTypes[name];assertArgument(type,`invalid typed-data domain key: ${JSON.stringify(name)}`,"domain",domain);domainFields.push({name:name,type:type})}domainFields.sort((a,b)=>{return domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(b.name)});return TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:domainFields},domain)}static encode(domain,types,value){return concat(["0x1901",TypedDataEncoder.hashDomain(domain),TypedDataEncoder.from(types).hash(value)])}static hash(domain,types,value){return sha256(TypedDataEncoder.encode(domain,types,value))}static async resolveNames(domain,types,value,resolveName){domain=Object.assign({},domain);for(const key in domain){if(domain[key]==null){delete domain[key]}}const ensCache={};if(domain.verifyingContract&&!isHexString(domain.verifyingContract,20)){ensCache[domain.verifyingContract]="0x"}const encoder=TypedDataEncoder.from(types);encoder.visit(value,(type,value)=>{if(type==="address"&&!isHexString(value,20)){ensCache[value]="0x"}return value});for(const name in ensCache){ensCache[name]=await resolveName(name)}if(domain.verifyingContract&&ensCache[domain.verifyingContract]){domain.verifyingContract=ensCache[domain.verifyingContract]}value=encoder.visit(value,(type,value)=>{if(type==="address"&&ensCache[value]){return ensCache[value]}return value});return{domain:domain,value:value}}static getPayload(domain,types,value){TypedDataEncoder.hashDomain(domain);const domainValues={};const domainTypes=[];domainFieldNames.forEach(name=>{const value=domain[name];if(value==null){return}domainValues[name]=domainChecks[name](value);domainTypes.push({name:name,type:domainFieldTypes[name]})});const encoder=TypedDataEncoder.from(types);const typesWithDomain=Object.assign({},types);assertArgument(typesWithDomain.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",types);typesWithDomain.EIP712Domain=domainTypes;encoder.encode(value);return{types:typesWithDomain,domain:domainValues,primaryType:encoder.primaryType,message:encoder.visit(value,(type,value)=>{if(type.match(/^bytes(\d*)/)){return hexlify(getBytes(value))}if(type.match(/^u?int/)){return getBigInt(value).toString()}switch(type){case"address":return value.toLowerCase();case"bool":return!!value;case"string":assertArgument(typeof value==="string","invalid string","value",value);return value}assertArgument(false,"unsupported type","type",type)})}}}function verifyTypedData(domain,types,value,signature,prefix){return recoverAddress(TypedDataEncoder.hash(domain,types,value),signature,prefix)}var _a;function setify(items){const result=new Set;items.forEach(k=>result.add(k));return Object.freeze(result)}const _kwVisib="constant external internal payable private public pure view";const KwVisib=setify(_kwVisib.split(" "));const _kwTypes="constructor error event fallback function receive struct";const KwTypes=setify(_kwTypes.split(" "));const _kwModifiers="calldata memory storage payable indexed";const KwModifiers=setify(_kwModifiers.split(" "));const _kwOther="tuple returns";const _keywords=[_kwTypes,_kwModifiers,_kwOther,_kwVisib].join(" ");const Keywords=setify(_keywords.split(" "));const SimpleTokens={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"};const regexWhitespacePrefix=new RegExp("^(\\s*)");const regexNumberPrefix=new RegExp("^([0-9]+)");const regexIdPrefix=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");const regexId=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");const regexType=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class TokenString{#offset;#tokens;get offset(){return this.#offset}get length(){return this.#tokens.length-this.#offset}constructor(tokens){this.#offset=0;this.#tokens=tokens.slice()}clone(){return new _a(this.#tokens)}reset(){this.#offset=0}#subTokenString(from=0,to=0){return new _a(this.#tokens.slice(from,to).map(t=>{return Object.freeze(Object.assign({},t,{match:t.match-from,linkBack:t.linkBack-from,linkNext:t.linkNext-from}))}))}popKeyword(allowed){const top=this.peek();if(top.type!=="KEYWORD"||!allowed.has(top.text)){throw new Error(`expected keyword ${top.text}`)}return this.pop().text}popType(type){if(this.peek().type!==type){throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`)}return this.pop().text}popParen(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=this.#subTokenString(this.#offset+1,top.match+1);this.#offset=top.match+1;return result}popParams(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=[];while(this.#offset=this.#tokens.length){throw new Error("out-of-bounds")}return this.#tokens[this.#offset]}peekKeyword(allowed){const top=this.peekType("KEYWORD");return top!=null&&allowed.has(top)?top:null}peekType(type){if(this.length===0){return null}const top=this.peek();return top.type===type?top.text:null}pop(){const result=this.peek();this.#offset++;return result}toString(){const tokens=[];for(let i=this.#offset;i`}}_a=TokenString;function lex(text){const tokens=[];const throwError=message=>{const token=offset0&&tokens[tokens.length-1].type==="NUMBER"){const value=tokens.pop().text;suffix=value+suffix;tokens[tokens.length-1].value=getNumber(value)}if(tokens.length===0||tokens[tokens.length-1].type!=="BRACKET"){throw new Error("missing opening bracket")}tokens[tokens.length-1].text+=suffix}continue}match=cur.match(regexIdPrefix);if(match){token.text=match[1];offset+=token.text.length;if(Keywords.has(token.text)){token.type="KEYWORD";continue}if(token.text.match(regexType)){token.type="TYPE";continue}token.type="ID";continue}match=cur.match(regexNumberPrefix);if(match){token.text=match[1];token.type="NUMBER";offset+=token.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`)}return new TokenString(tokens.map(t=>Object.freeze(t)))}function allowSingle(set,allowed){let included=[];for(const key in allowed.keys()){if(set.has(key)){included.push(key)}}if(included.length>1){throw new Error(`conflicting types: ${included.join(", ")}`)}}function consumeName(type,tokens){if(tokens.peekKeyword(KwTypes)){const keyword=tokens.pop().text;if(keyword!==type){throw new Error(`expected ${type}, got ${keyword}`)}}return tokens.popType("ID")}function consumeKeywords(tokens,allowed){const keywords=new Set;while(true){const keyword=tokens.peekType("KEYWORD");if(keyword==null||allowed&&!allowed.has(keyword)){break}tokens.pop();if(keywords.has(keyword)){throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`)}keywords.add(keyword)}return Object.freeze(keywords)}function consumeMutability(tokens){let modifiers=consumeKeywords(tokens,KwVisib);allowSingle(modifiers,setify("constant payable nonpayable".split(" ")));allowSingle(modifiers,setify("pure view payable nonpayable".split(" ")));if(modifiers.has("view")){return"view"}if(modifiers.has("pure")){return"pure"}if(modifiers.has("payable")){return"payable"}if(modifiers.has("nonpayable")){return"nonpayable"}if(modifiers.has("constant")){return"view"}return"nonpayable"}function consumeParams(tokens,allowIndexed){return tokens.popParams().map(t=>ParamType.from(t,allowIndexed))}function consumeEnergy(tokens){if(tokens.peekType("AT")){tokens.pop();if(tokens.peekType("NUMBER")){return getBigInt(tokens.pop().text)}throw new Error("invalid energy")}return null}function consumeEoi(tokens){if(tokens.length){throw new Error(`unexpected tokens: ${tokens.toString()}`)}}const regexArrayType=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(type){const match=type.match(regexType);assertArgument(match,"invalid type","type",type);if(type==="uint"){return"uint256"}if(type==="int"){return"int256"}if(match[2]){const length=parseInt(match[2]);assertArgument(length!==0&&length<=32,"invalid bytes length","type",type)}else if(match[3]){const size=parseInt(match[3]);assertArgument(size!==0&&size<=256&&size%8===0,"invalid numeric width","type",type)}return type}const _guard$2={};const internal$1=Symbol.for("_corebc_internal");const ParamTypeInternal="_ParamTypeInternal";const ErrorFragmentInternal="_ErrorInternal";const EventFragmentInternal="_EventInternal";const ConstructorFragmentInternal="_ConstructorInternal";const FallbackFragmentInternal="_FallbackInternal";const FunctionFragmentInternal="_FunctionInternal";const StructFragmentInternal="_StructInternal";class ParamType{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(guard,name,type,baseType,indexed,components,arrayLength,arrayChildren){assertPrivate(guard,_guard$2,"ParamType");Object.defineProperty(this,internal$1,{value:ParamTypeInternal});if(components){components=Object.freeze(components.slice())}if(baseType==="array"){if(arrayLength==null||arrayChildren==null){throw new Error("")}}else if(arrayLength!=null||arrayChildren!=null){throw new Error("")}if(baseType==="tuple"){if(components==null){throw new Error("")}}else if(components!=null){throw new Error("")}defineProperties(this,{name:name,type:type,baseType:baseType,indexed:indexed,components:components,arrayLength:arrayLength,arrayChildren:arrayChildren})}format(format){if(format==null){format="sighash"}if(format==="json"){let result={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||undefined};if(typeof this.indexed==="boolean"){result.indexed=this.indexed}if(this.isTuple()){result.components=this.components.map(c=>JSON.parse(c.format(format)))}return JSON.stringify(result)}let result="";if(this.isArray()){result+=this.arrayChildren.format(format);result+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`}else{if(this.isTuple()){if(format!=="sighash"){result+=this.type}result+="("+this.components.map(comp=>comp.format(format)).join(format==="full"?", ":",")+")"}else{result+=this.type}}if(format!=="sighash"){if(this.indexed===true){result+=" indexed"}if(format==="full"&&this.name){result+=" "+this.name}}return result}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(value,process){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const _this=this;return value.map(v=>_this.arrayChildren.walk(v,process))}if(this.isTuple()){if(!Array.isArray(value)){throw new Error("invalid tuple value")}if(value.length!==this.components.length){throw new Error("array is wrong length")}const _this=this;return value.map((v,i)=>_this.components[i].walk(v,process))}return process(this.type,value)}#walkAsync(promises,value,process,setValue){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const childType=this.arrayChildren;const result=value.slice();result.forEach((value,index)=>{childType.#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}if(this.isTuple()){const components=this.components;let result;if(Array.isArray(value)){result=value.slice()}else{if(value==null||typeof value!=="object"){throw new Error("invalid tuple value")}result=components.map(param=>{if(!param.name){throw new Error("cannot use object value with unnamed components")}if(!(param.name in value)){throw new Error(`missing value for component ${param.name}`)}return value[param.name]})}if(result.length!==this.components.length){throw new Error("array is wrong length")}result.forEach((value,index)=>{components[index].#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}const result=process(this.type,value);if(result.then){promises.push(async function(){setValue(await result)}())}else{setValue(result)}}async walkAsync(value,process){const promises=[];const result=[value];this.#walkAsync(promises,value,process,value=>{result[0]=value});if(promises.length){await Promise.all(promises)}return result[0]}static from(obj,allowIndexed){if(ParamType.isParamType(obj)){return obj}if(typeof obj==="string"){return ParamType.from(lex(obj),allowIndexed)}else if(obj instanceof TokenString){let type="",baseType="";let comps=null;if(consumeKeywords(obj,setify(["tuple"])).has("tuple")||obj.peekType("OPEN_PAREN")){baseType="tuple";comps=obj.popParams().map(t=>ParamType.from(t));type=`tuple(${comps.map(c=>c.format()).join(",")})`}else{type=verifyBasicType(obj.popType("TYPE"));baseType=type}let arrayChildren=null;let arrayLength=null;while(obj.length&&obj.peekType("BRACKET")){const bracket=obj.pop();arrayChildren=new ParamType(_guard$2,"",type,baseType,null,comps,arrayLength,arrayChildren);arrayLength=bracket.value;type+=bracket.text;baseType="array";comps=null}let indexed=null;const keywords=consumeKeywords(obj,KwModifiers);if(keywords.has("indexed")){if(!allowIndexed){throw new Error("")}indexed=true}const name=obj.peekType("ID")?obj.pop().text:"";if(obj.length){throw new Error("leftover tokens")}return new ParamType(_guard$2,name,type,baseType,indexed,comps,arrayLength,arrayChildren)}const name=obj.name;assertArgument(!name||typeof name==="string"&&name.match(regexId),"invalid name","obj.name",name);let indexed=obj.indexed;if(indexed!=null){assertArgument(allowIndexed,"parameter cannot be indexed","obj.indexed",obj.indexed);indexed=!!indexed}let type=obj.type;let arrayMatch=type.match(regexArrayType);if(arrayMatch){const arrayLength=parseInt(arrayMatch[2]||"-1");const arrayChildren=ParamType.from({type:arrayMatch[1],components:obj.components});return new ParamType(_guard$2,name||"",type,"array",indexed,null,arrayLength,arrayChildren)}if(type==="tuple"||type.startsWith("tuple(")||type.startsWith("(")){const comps=obj.components!=null?obj.components.map(c=>ParamType.from(c)):null;const tuple=new ParamType(_guard$2,name||"",type,"tuple",indexed,comps,null,null);return tuple}type=verifyBasicType(obj.type);return new ParamType(_guard$2,name||"",type,type,indexed,null,null,null)}static isParamType(value){return value&&value[internal$1]===ParamTypeInternal}}class Fragment{type;inputs;constructor(guard,type,inputs){assertPrivate(guard,_guard$2,"Fragment");inputs=Object.freeze(inputs.slice());defineProperties(this,{type:type,inputs:inputs})}static from(obj){if(typeof obj==="string"){try{Fragment.from(JSON.parse(obj))}catch(e){}return Fragment.from(lex(obj))}if(obj instanceof TokenString){const type=obj.peekKeyword(KwTypes);switch(type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}}else if(typeof obj==="object"){switch(obj.type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}assert(false,`unsupported type: ${obj.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(false,"unsupported frgament object","obj",obj)}static isConstructor(value){return ConstructorFragment.isFragment(value)}static isError(value){return ErrorFragment.isFragment(value)}static isEvent(value){return EventFragment.isFragment(value)}static isFunction(value){return FunctionFragment.isFragment(value)}static isStruct(value){return StructFragment.isFragment(value)}}class NamedFragment extends Fragment{name;constructor(guard,type,name,inputs){super(guard,type,inputs);assertArgument(typeof name==="string"&&name.match(regexId),"invalid identifier","name",name);inputs=Object.freeze(inputs.slice());defineProperties(this,{name:name})}}function joinParams(format,params){return"("+params.map(p=>p.format(format)).join(format==="full"?", ":",")+")"}class ErrorFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"error",name,inputs);Object.defineProperty(this,internal$1,{value:ErrorFragmentInternal})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(format)))})}const result=[];if(format!=="sighash"){result.push("error")}result.push(this.name+joinParams(format,this.inputs));return result.join(" ")}static from(obj){if(ErrorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ErrorFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("error",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new ErrorFragment(_guard$2,name,inputs)}return new ErrorFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===ErrorFragmentInternal}}class EventFragment extends NamedFragment{anonymous;constructor(guard,name,inputs,anonymous){super(guard,"event",name,inputs);Object.defineProperty(this,internal$1,{value:EventFragmentInternal});defineProperties(this,{anonymous:anonymous})}get topicHash(){return id(this.format("sighash"))}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[];if(format!=="sighash"){result.push("event")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"&&this.anonymous){result.push("anonymous")}return result.join(" ")}static getTopicHash(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new EventFragment(_guard$2,name,params,false);return fragment.topicHash}static from(obj){if(EventFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return EventFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("event",obj);const inputs=consumeParams(obj,true);const anonymous=!!consumeKeywords(obj,setify(["anonymous"])).has("anonymous");consumeEoi(obj);return new EventFragment(_guard$2,name,inputs,anonymous)}return new EventFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(p=>ParamType.from(p,true)):[],!!obj.anonymous)}static isFragment(value){return value&&value[internal$1]===EventFragmentInternal}}class ConstructorFragment extends Fragment{payable;energy;constructor(guard,type,inputs,payable,energy){super(guard,type,inputs);Object.defineProperty(this,internal$1,{value:ConstructorFragmentInternal});defineProperties(this,{payable:payable,energy:energy})}format(format){assert(format!=null&&format!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"});if(format==="json"){return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[`constructor${joinParams(format,this.inputs)}`];result.push(this.payable?"payable":"nonpayable");if(this.energy!=null){result.push(`@${this.energy.toString()}`)}return result.join(" ")}static from(obj){if(ConstructorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ConstructorFragment.from(lex(obj))}else if(obj instanceof TokenString){consumeKeywords(obj,setify(["constructor"]));const inputs=consumeParams(obj);const payable=!!consumeKeywords(obj,setify(["payable"])).has("payable");const energy=consumeEnergy(obj);consumeEoi(obj);return new ConstructorFragment(_guard$2,"constructor",inputs,payable,energy)}return new ConstructorFragment(_guard$2,"constructor",obj.inputs?obj.inputs.map(ParamType.from):[],!!obj.payable,obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===ConstructorFragmentInternal}}class FallbackFragment extends Fragment{payable;constructor(guard,inputs,payable){super(guard,"fallback",inputs);Object.defineProperty(this,internal$1,{value:FallbackFragmentInternal});defineProperties(this,{payable:payable})}format(format){const type=this.inputs.length===0?"receive":"fallback";if(format==="json"){const stateMutability=this.payable?"payable":"nonpayable";return JSON.stringify({type:type,stateMutability:stateMutability})}return`${type}()${this.payable?" payable":""}`}static from(obj){if(FallbackFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FallbackFragment.from(lex(obj))}else if(obj instanceof TokenString){const errorObj=obj.toString();const topIsValid=obj.peekKeyword(setify(["fallback","receive"]));assertArgument(topIsValid,"type must be fallback or receive","obj",errorObj);const type=obj.popKeyword(setify(["fallback","receive"]));if(type==="receive"){const inputs=consumeParams(obj);assertArgument(inputs.length===0,`receive cannot have arguments`,"obj.inputs",inputs);consumeKeywords(obj,setify(["payable"]));consumeEoi(obj);return new FallbackFragment(_guard$2,[],true)}let inputs=consumeParams(obj);if(inputs.length){assertArgument(inputs.length===1&&inputs[0].type==="bytes","invalid fallback inputs","obj.inputs",inputs.map(i=>i.format("minimal")).join(", "))}else{inputs=[ParamType.from("bytes")]}const mutability=consumeMutability(obj);assertArgument(mutability==="nonpayable"||mutability==="payable","fallback cannot be constants","obj.stateMutability",mutability);if(consumeKeywords(obj,setify(["returns"])).has("returns")){const outputs=consumeParams(obj);assertArgument(outputs.length===1&&outputs[0].type==="bytes","invalid fallback outputs","obj.outputs",outputs.map(i=>i.format("minimal")).join(", "))}consumeEoi(obj);return new FallbackFragment(_guard$2,inputs,mutability==="payable")}if(obj.type==="receive"){return new FallbackFragment(_guard$2,[],true)}if(obj.type==="fallback"){const inputs=[ParamType.from("bytes")];const payable=obj.stateMutability==="payable";return new FallbackFragment(_guard$2,inputs,payable)}assertArgument(false,"invalid fallback description","obj",obj)}static isFragment(value){return value&&value[internal$1]===FallbackFragmentInternal}}class FunctionFragment extends NamedFragment{constant;outputs;stateMutability;payable;energy;constructor(guard,name,stateMutability,inputs,outputs,energy){super(guard,"function",name,inputs);Object.defineProperty(this,internal$1,{value:FunctionFragmentInternal});outputs=Object.freeze(outputs.slice());const constant=stateMutability==="view"||stateMutability==="pure";const payable=stateMutability==="payable";defineProperties(this,{constant:constant,energy:energy,outputs:outputs,payable:payable,stateMutability:stateMutability})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format))),outputs:this.outputs.map(o=>JSON.parse(o.format(format)))})}const result=[];if(format!=="sighash"){result.push("function")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"){if(this.stateMutability!=="nonpayable"){result.push(this.stateMutability)}if(this.outputs&&this.outputs.length){result.push("returns");result.push(joinParams(format,this.outputs))}if(this.energy!=null){result.push(`@${this.energy.toString()}`)}}return result.join(" ")}static getSelector(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new FunctionFragment(_guard$2,name,"view",params,[],null);return fragment.selector}static from(obj){if(FunctionFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FunctionFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("function",obj);const inputs=consumeParams(obj);const mutability=consumeMutability(obj);let outputs=[];if(consumeKeywords(obj,setify(["returns"])).has("returns")){outputs=consumeParams(obj)}const energy=consumeEnergy(obj);consumeEoi(obj);return new FunctionFragment(_guard$2,name,mutability,inputs,outputs,energy)}let stateMutability=obj.stateMutability;if(stateMutability==null){stateMutability="payable";if(typeof obj.constant==="boolean"){stateMutability="view";if(!obj.constant){stateMutability="payable";if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}}else if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}return new FunctionFragment(_guard$2,obj.name,stateMutability,obj.inputs?obj.inputs.map(ParamType.from):[],obj.outputs?obj.outputs.map(ParamType.from):[],obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===FunctionFragmentInternal}}class StructFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"struct",name,inputs);Object.defineProperty(this,internal$1,{value:StructFragmentInternal})}format(){throw new Error("@TODO")}static from(obj){if(typeof obj==="string"){return StructFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("struct",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new StructFragment(_guard$2,name,inputs)}return new StructFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===StructFragmentInternal}}const PanicReasons$1=new Map;PanicReasons$1.set(0,"GENERIC_PANIC");PanicReasons$1.set(1,"ASSERT_FALSE");PanicReasons$1.set(17,"OVERFLOW");PanicReasons$1.set(18,"DIVIDE_BY_ZERO");PanicReasons$1.set(33,"ENUM_RANGE_ERROR");PanicReasons$1.set(34,"BAD_STORAGE_DATA");PanicReasons$1.set(49,"STACK_UNDERFLOW");PanicReasons$1.set(50,"ARRAY_RANGE_ERROR");PanicReasons$1.set(65,"OUT_OF_MEMORY");PanicReasons$1.set(81,"UNINITIALIZED_FUNCTION_CALL");const paramTypeBytes=new RegExp(/^bytes([0-9]*)$/);const paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);let defaultCoder=null;function getBuiltinCallException(action,tx,data,abiCoder){let message="missing revert data";let reason=null;const invocation=null;let revert=null;if(data){message="execution reverted";const bytes=getBytes(data);data=hexlify(data);if(bytes.length===0){message+=" (no data present; likely require(false) occurred";reason="require(false)"}else if(bytes.length%32!==4){message+=" (could not decode reason; invalid data length)"}else if(hexlify(bytes.slice(0,4))==="0x08c379a0"){try{reason=abiCoder.decode(["string"],bytes.slice(4))[0];revert={signature:"Error(string)",name:"Error",args:[reason]};message+=`: ${JSON.stringify(reason)}`}catch(error){message+=" (could not decode reason; invalid string data)"}}else if(hexlify(bytes.slice(0,4))==="0x4e487b71"){try{const code=Number(abiCoder.decode(["uint256"],bytes.slice(4))[0]);revert={signature:"Panic(uint256)",name:"Panic",args:[code]};reason=`Panic due to ${PanicReasons$1.get(code)||"UNKNOWN"}(${code})`;message+=`: ${reason}`}catch(error){message+=" (could not decode panic code)"}}else{message+=" (unknown custom error)"}}const transaction={to:tx.to?getAddress(tx.to):null,data:tx.data||"0x"};if(tx.from){transaction.from=getAddress(tx.from)}return makeError(message,"CALL_EXCEPTION",{action:action,data:data,reason:reason,transaction:transaction,invocation:invocation,revert:revert})}class AbiCoder{#getCoder(param){if(param.isArray()){return new ArrayCoder(this.#getCoder(param.arrayChildren),param.arrayLength,param.name)}if(param.isTuple()){return new TupleCoder(param.components.map(c=>this.#getCoder(c)),param.name)}switch(param.baseType){case"address":return new AddressCoder(param.name);case"bool":return new BooleanCoder(param.name);case"string":return new StringCoder(param.name);case"bytes":return new BytesCoder(param.name);case"":return new NullCoder(param.name)}let match=param.type.match(paramTypeNumber);if(match){let size=parseInt(match[2]||"256");assertArgument(size!==0&&size<=256&&size%8===0,"invalid "+match[1]+" bit length","param",param);return new NumberCoder(size/8,match[1]==="int",param.name)}match=param.type.match(paramTypeBytes);if(match){let size=parseInt(match[1]);assertArgument(size!==0&&size<=32,"invalid bytes length","param",param);return new FixedBytesCoder(size,param.name)}assertArgument(false,"invalid type","type",param.type)}getDefaultValue(types){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.defaultValue()}encode(types,values){assertArgumentCount(values.length,types.length,"types/values length mismatch");const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");const writer=new Writer;coder.encode(writer,values);return writer.data}decode(types,data,loose){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.decode(new Reader(data,loose))}static defaultAbiCoder(){if(defaultCoder==null){defaultCoder=new AbiCoder}return defaultCoder}static getBuiltinCallException(action,tx,data){return getBuiltinCallException(action,tx,data,AbiCoder.defaultAbiCoder())}}function encodeBytes32String(text){const bytes=toUtf8Bytes(text);if(bytes.length>31){throw new Error("bytes32 string must be less than 32 bytes")}return zeroPadBytes(bytes,32)}function decodeBytes32String(_bytes){const data=getBytes(_bytes,"bytes");if(data.length!==32){throw new Error("invalid bytes32 - not 32 bytes long")}if(data[31]!==0){throw new Error("invalid bytes32 string - no null terminator")}let length=31;while(data[length-1]===0){length--}return toUtf8String(data.slice(0,length))}class LogDescription{fragment;name;signature;topic;args;constructor(fragment,topic,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,signature:signature,topic:topic,args:args})}}class TransactionDescription{fragment;name;args;signature;selector;value;constructor(fragment,selector,args,value){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector,value:value})}}class ErrorDescription{fragment;name;args;signature;selector;constructor(fragment,selector,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector})}}class Indexed{hash;_isIndexed;static isIndexed(value){return!!(value&&value._isIndexed)}constructor(hash){defineProperties(this,{hash:hash,_isIndexed:true})}}const PanicReasons={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"};const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:message=>{return`reverted with reason string ${JSON.stringify(message)}`}},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:code=>{let reason="unknown panic code";if(code>=0&&code<=255&&PanicReasons[code.toString()]){reason=PanicReasons[code.toString()]}return`reverted with panic code 0x${code.toString(16)} (${reason})`}}};class Interface{fragments;deploy;fallback;receive;#errors;#events;#functions;#abiCoder;constructor(fragments){let abi=[];if(typeof fragments==="string"){abi=JSON.parse(fragments)}else{abi=fragments}this.#functions=new Map;this.#errors=new Map;this.#events=new Map;const frags=[];for(const a of abi){try{frags.push(Fragment.from(a))}catch(error){console.log("EE",error)}}defineProperties(this,{fragments:Object.freeze(frags)});let fallback=null;let receive=false;this.#abiCoder=this.getAbiCoder();this.fragments.forEach((fragment,index)=>{let bucket;switch(fragment.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}defineProperties(this,{deploy:fragment});return;case"fallback":if(fragment.inputs.length===0){receive=true}else{assertArgument(!fallback||fragment.payable!==fallback.payable,"conflicting fallback fragments",`fragments[${index}]`,fragment);fallback=fragment;receive=fallback.payable}return;case"function":bucket=this.#functions;break;case"event":bucket=this.#events;break;case"error":bucket=this.#errors;break;default:return}const signature=fragment.format();if(bucket.has(signature)){return}bucket.set(signature,fragment)});if(!this.deploy){defineProperties(this,{deploy:ConstructorFragment.from("constructor()")})}defineProperties(this,{fallback:fallback,receive:receive})}format(minimal){const format=minimal?"minimal":"full";const abi=this.fragments.map(f=>f.format(format));return abi}formatJson(){const abi=this.fragments.map(f=>f.format("json"));return JSON.stringify(abi.map(j=>JSON.parse(j)))}getAbiCoder(){return AbiCoder.defaultAbiCoder()}#getFunction(key,values,forceUnique){if(isHexString(key)){const selector=key.toLowerCase();for(const fragment of this.#functions.values()){if(selector===fragment.selector){return fragment}}return null}if(key.indexOf("(")===-1){const matching=[];for(const[name,fragment]of this.#functions){if(name.split("(")[0]===key){matching.push(fragment)}}if(values){const lastValue=values.length>0?values[values.length-1]:null;let valueLength=values.length;let allowOptions=true;if(Typed.isTyped(lastValue)&&lastValue.type==="overrides"){allowOptions=false;valueLength--}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs.length;if(inputs!==valueLength&&(!allowOptions||inputs!==valueLength-1)){matching.splice(i,1)}}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs;for(let j=0;j=inputs.length){if(values[j].type==="overrides"){continue}matching.splice(i,1);break}if(values[j].type!==inputs[j].baseType){matching.splice(i,1);break}}}}if(matching.length===1&&values&&values.length!==matching[0].inputs.length){const lastArg=values[values.length-1];if(lastArg==null||Array.isArray(lastArg)||typeof lastArg!=="object"){matching.splice(0,1)}}if(matching.length===0){return null}if(matching.length>1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous function description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#functions.get(FunctionFragment.from(key).format());if(result){return result}return null}getFunctionName(key){const fragment=this.#getFunction(key,null,false);assertArgument(fragment,"no matching function","key",key);return fragment.name}hasFunction(key){return!!this.#getFunction(key,null,false)}getFunction(key,values){return this.#getFunction(key,values||null,true)}forEachFunction(callback){const names=Array.from(this.#functions.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i=0;i--){if(matching[i].inputs.length=0;i--){const inputs=matching[i].inputs;for(let j=0;j1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous event description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#events.get(EventFragment.from(key).format());if(result){return result}return null}getEventName(key){const fragment=this.#getEvent(key,null,false);assertArgument(fragment,"no matching event","key",key);return fragment.name}hasEvent(key){return!!this.#getEvent(key,null,false)}getEvent(key,values){return this.#getEvent(key,values||null,true)}forEachEvent(callback){const names=Array.from(this.#events.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i1){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous error description (i.e. ${matchStr})`,"name",key)}return matching[0]}key=ErrorFragment.from(key).format();if(key==="Error(string)"){return ErrorFragment.from("error Error(string)")}if(key==="Panic(uint256)"){return ErrorFragment.from("error Panic(uint256)")}const result=this.#errors.get(key);if(result){return result}return null}forEachError(callback){const names=Array.from(this.#errors.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i{if(param.type==="string"){return id(value)}else if(param.type==="bytes"){return sha256(hexlify(value))}if(param.type==="bool"&&typeof value==="boolean"){value=value?"0x01":"0x00"}if(param.type.match(/^u?int/)){value=toBeHex(value)}if(param.type==="address"){this.#abiCoder.encode(["address"],[value])}return zeroPadValue(hexlify(value),32)};values.forEach((value,index)=>{const param=fragment.inputs[index];if(!param.indexed){assertArgument(value==null,"cannot filter non-indexed parameters; must be null","contract."+param.name,value);return}if(value==null){topics.push(null)}else if(param.baseType==="array"||param.baseType==="tuple"){assertArgument(false,"filtering with tuples or arrays not supported","contract."+param.name,value)}else if(Array.isArray(value)){topics.push(value.map(value=>encodeTopic(param,value)))}else{topics.push(encodeTopic(param,value))}});while(topics.length&&topics[topics.length-1]===null){topics.pop()}return topics}encodeEventLog(fragment,values){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}const topics=[];const dataTypes=[];const dataValues=[];if(!fragment.anonymous){topics.push(fragment.topicHash)}assertArgument(values.length===fragment.inputs.length,"event arguments/values mismatch","values",values);fragment.inputs.forEach((param,index)=>{const value=values[index];if(param.indexed){if(param.type==="string"){topics.push(id(value))}else if(param.type==="bytes"){topics.push(sha256(value))}else if(param.baseType==="tuple"||param.baseType==="array"){throw new Error("not implemented")}else{topics.push(this.#abiCoder.encode([param.type],[value]))}}else{dataTypes.push(param);dataValues.push(value)}});return{data:this.#abiCoder.encode(dataTypes,dataValues),topics:topics}}decodeEventLog(fragment,data,topics){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}if(topics!=null&&!fragment.anonymous){const eventTopic=fragment.topicHash;assertArgument(isHexString(topics[0],32)&&topics[0].toLowerCase()===eventTopic,"fragment/topic mismatch","topics[0]",topics[0]);topics=topics.slice(1)}const indexed=[];const nonIndexed=[];const dynamic=[];fragment.inputs.forEach((param,index)=>{if(param.indexed){if(param.type==="string"||param.type==="bytes"||param.baseType==="tuple"||param.baseType==="array"){indexed.push(ParamType.from({type:"bytes32",name:param.name}));dynamic.push(true)}else{indexed.push(param);dynamic.push(false)}}else{nonIndexed.push(param);dynamic.push(false)}});const resultIndexed=topics!=null?this.#abiCoder.decode(indexed,concat(topics)):null;const resultNonIndexed=this.#abiCoder.decode(nonIndexed,data,true);const values=[];const keys=[];let nonIndexedIndex=0,indexedIndex=0;fragment.inputs.forEach((param,index)=>{let value=null;if(param.indexed){if(resultIndexed==null){value=new Indexed(null)}else if(dynamic[index]){value=new Indexed(resultIndexed[indexedIndex++])}else{try{value=resultIndexed[indexedIndex++]}catch(error){value=error}}}else{try{value=resultNonIndexed[nonIndexedIndex++]}catch(error){value=error}}values.push(value);keys.push(param.name||null)});return Result.fromItems(values,keys)}parseTransaction(tx){const data=getBytes(tx.data,"tx.data");const value=getBigInt(tx.value!=null?tx.value:0,"tx.value");const fragment=this.getFunction(hexlify(data.slice(0,4)));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,data.slice(4));return new TransactionDescription(fragment,fragment.selector,args,value)}parseCallResult(data){throw new Error("@TODO")}parseLog(log){const fragment=this.getEvent(log.topics[0]);if(!fragment||fragment.anonymous){return null}return new LogDescription(fragment,fragment.topicHash,this.decodeEventLog(fragment,log.data,log.topics))}parseError(data){const hexData=hexlify(data);const fragment=this.getError(dataSlice(hexData,0,4));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,dataSlice(hexData,4));return new ErrorDescription(fragment,fragment.selector,args)}static from(value){if(value instanceof Interface){return value}if(typeof value==="string"){return new Interface(JSON.parse(value))}if(typeof value.format==="function"){return new Interface(value.format("json"))}return new Interface(value)}}const logger=new Logger("contract-address/0.0.1");function getCreateAddress(tx){const from=getAddress(tx.from);const nonce=getBigInt(tx.nonce,"tx.nonce");let nonceHex=nonce.toString(16);if(nonceHex==="0"){nonceHex="0x"}else if(nonceHex.length%2){nonceHex="0x0"+nonceHex}else{nonceHex="0x"+nonceHex}return getAddress(from)}function getCreate2Address(from,salt,initCodeHash){if(hexDataLength(salt)!==32){logger.throwArgumentError("salt must be 32 bytes","salt",salt)}if(hexDataLength(initCodeHash)!==32){logger.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",initCodeHash)}const val=hexDataSlice(sha256(concat(["0xff",getAddress(from),salt,initCodeHash])),12);console.log({"contract-address/74=>should be string":val});const prefix=from.substring(2,4);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function isAddressable(value){return value&&typeof value.getAddress==="function"}function isAddress(value){try{getAddress(value);return true}catch(error){}return false}async function checkAddress(target,promise){const result=await promise;if(result==null||result==="0x0000000000000000000000000000000000000000"){assert(typeof target!=="string","unconfigured name","UNCONFIGURED_NAME",{value:target});assertArgument(false,"invalid AddressLike value; did not resolve to a value address","target",target)}return getAddress(result)}function resolveAddress(target){if(typeof target==="string"){return getAddress(target)}else if(isAddressable(target)){return checkAddress(target,target.getAddress())}else if(target&&typeof target.then==="function"){return checkAddress(target,target)}assertArgument(false,"unsupported addressable value","target",target)}const BN_0$2=BigInt(0);function getValue(value){if(value==null){return null}return value}function toJson(value){if(value==null){return null}return value.toString()}class FeeData{energyPrice;constructor(energyPrice){defineProperties(this,{energyPrice:getValue(energyPrice)})}toJSON(){const{energyPrice}=this;return{_type:"FeeData",energyPrice:toJson(energyPrice)}}}function copyRequest(req){const result={};if(req.to){result.to=req.to}if(req.from){result.from=req.from}if(req.data){result.data=hexlify(req.data)}const bigIntKeys="networkId,energyLimit,energyPrice,value".split(/,/);for(const key of bigIntKeys){if(!(key in req)||req[key]==null){continue}result[key]=getBigInt(req[key],`request.${key}`)}const numberKeys="type,nonce".split(/,/);for(const key of numberKeys){if(!(key in req)||req[key]==null){continue}result[key]=getNumber(req[key],`request.${key}`)}if("blockTag"in req){result.blockTag=req.blockTag}if("enableCcipRead"in req){result.enableCcipReadEnabled=!!req.enableCcipRead}if("customData"in req){result.customData=req.customData}return result}class Block{provider;number;hash;timestamp;parentHash;nonce;difficulty;energyLimit;energyUsed;miner;extraData;baseFeePerEnergy;#transactions;constructor(block,provider){this.#transactions=block.transactions.map(tx=>{if(typeof tx!=="string"){return new TransactionResponse(tx,provider)}return tx});defineProperties(this,{provider:provider,hash:getValue(block.hash),number:block.number,timestamp:block.timestamp,parentHash:block.parentHash,nonce:block.nonce,difficulty:block.difficulty,energyLimit:block.energyLimit,energyUsed:block.energyUsed,miner:block.miner,extraData:block.extraData,baseFeePerEnergy:getValue(block.baseFeePerEnergy)})}get transactions(){return this.#transactions.map(tx=>{if(typeof tx==="string"){return tx}return tx.hash})}get prefetchedTransactions(){const txs=this.#transactions.slice();if(txs.length===0){return[]}assert(typeof txs[0]==="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"});return txs}toJSON(){const{baseFeePerEnergy,difficulty,extraData,energyLimit,energyUsed,hash,miner,nonce,number,parentHash,timestamp,transactions}=this;return{_type:"Block",baseFeePerEnergy:toJson(baseFeePerEnergy),difficulty:toJson(difficulty),extraData:extraData,energyLimit:toJson(energyLimit),energyUsed:toJson(energyUsed),hash:hash,miner:miner,nonce:nonce,number:number,parentHash:parentHash,timestamp:timestamp,transactions:transactions}}[Symbol.iterator](){let index=0;const txs=this.transactions;return{next:()=>{if(index{return new Log(log,provider)}));defineProperties(this,{provider:provider,to:tx.to,from:tx.from,contractAddress:tx.contractAddress,hash:tx.hash,index:tx.index,blockHash:tx.blockHash,blockNumber:tx.blockNumber,logsBloom:tx.logsBloom,energyUsed:tx.energyUsed,cumulativeEnergyUsed:tx.cumulativeEnergyUsed,energyPrice:tx.effectiveEnergyPrice||tx.energyPrice,status:tx.status,root:tx.root})}get logs(){return this.#logs}toJSON(){const{to,from,contractAddress,hash,index,blockHash,blockNumber,logsBloom,logs,status,root}=this;return{_type:"TransactionReceipt",blockHash:blockHash,blockNumber:blockNumber,contractAddress:contractAddress,cumulativeEnergyUsed:toJson(this.cumulativeEnergyUsed),from:from,energyPrice:toJson(this.energyPrice),energyUsed:toJson(this.energyUsed),hash:hash,index:index,logs:logs,logsBloom:logsBloom,root:root,status:status,to:to}}get length(){return this.logs.length}[Symbol.iterator](){let index=0;return{next:()=>{if(index{if(stopScanning){return null}const{blockNumber,nonce}=await resolveProperties({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(nonce=confirms){return receipt}}else{await checkReplacement();if(confirms===0){return null}}const waiter=new Promise((resolve,reject)=>{const cancellers=[];const cancel=()=>{cancellers.forEach(c=>c())};cancellers.push(()=>{stopScanning=true});if(timeout>0){const timer=setTimeout(()=>{cancel();reject(makeError("wait for transaction timeout","TIMEOUT"))},timeout);cancellers.push(()=>{clearTimeout(timer)})}const txListener=async receipt=>{if(await receipt.confirmations()>=confirms){cancel();resolve(receipt)}};cancellers.push(()=>{this.provider.off(this.hash,txListener)});this.provider.on(this.hash,txListener);if(startBlock>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(error){if(isError(error,"TRANSACTION_REPLACED")){cancel();reject(error);return}}if(!stopScanning){this.provider.once("block",replaceListener)}};cancellers.push(()=>{this.provider.off("block",replaceListener)});this.provider.once("block",replaceListener)}});return await waiter}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}removedEvent(){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createRemovedTransactionFilter(this)}reorderedEvent(other){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});assert(!other||other.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createReorderedTransactionFilter(this,other)}replaceableTransaction(startBlock){assertArgument(Number.isInteger(startBlock)&&startBlock>=0,"invalid startBlock","startBlock",startBlock);const tx=new TransactionResponse(this,this.provider);tx.#startBlock=startBlock;return tx}}function createOrphanedBlockFilter(block){return{orphan:"drop-block",hash:block.hash,number:block.number}}function createReorderedTransactionFilter(tx,other){return{orphan:"reorder-transaction",tx:tx,other:other}}function createRemovedTransactionFilter(tx){return{orphan:"drop-transaction",tx:tx}}function createRemovedLogFilter(log){return{orphan:"drop-log",log:{transactionHash:log.transactionHash,blockHash:log.blockHash,blockNumber:log.blockNumber,address:log.address,data:log.data,topics:Object.freeze(log.topics.slice()),index:log.index}}}class EventLog extends Log{interface;fragment;args;constructor(log,iface,fragment){super(log,log.provider);const args=iface.decodeEventLog(fragment,log.data,log.topics);defineProperties(this,{args:args,fragment:fragment,interface:iface})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class ContractTransactionReceipt extends TransactionReceipt{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}get logs(){return super.logs.map(log=>{const fragment=log.topics.length?this.#iface.getEvent(log.topics[0]):null;if(fragment){return new EventLog(log,this.#iface,fragment)}else{return log}})}}class ContractTransactionResponse extends TransactionResponse{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}async wait(confirms){const receipt=await super.wait();if(receipt==null){return null}return new ContractTransactionReceipt(this.#iface,this.provider,receipt)}}class ContractUnknownEventPayload extends EventPayload{log;constructor(contract,listener,filter,log){super(contract,listener,filter);defineProperties(this,{log:log})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class ContractEventPayload extends ContractUnknownEventPayload{constructor(contract,listener,filter,fragment,_log){super(contract,listener,filter,new EventLog(_log,contract.interface,fragment));const args=contract.interface.decodeEventLog(fragment,this.log.data,this.log.topics);defineProperties(this,{args:args,fragment:fragment})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const BN_0$1=BigInt(0);function canCall(value){return value&&typeof value.call==="function"}function canEstimate(value){return value&&typeof value.estimateEnergy==="function"}function canResolve(value){return value&&typeof value.resolveName==="function"}function canSend(value){return value&&typeof value.sendTransaction==="function"}class PreparedTopicFilter{#filter;fragment;constructor(contract,fragment,args){defineProperties(this,{fragment:fragment});if(fragment.inputs.length{const arg=args[index];if(arg==null){return null}return param.walkAsync(args[index],(type,value)=>{if(type==="address"){return resolveAddress(value)}return value})}));return contract.interface.encodeFilterTopics(fragment,resolvedArgs)}()}getTopicFilter(){return this.#filter}}function getRunner(value,feature){if(value==null){return null}if(typeof value[feature]==="function"){return value}if(value.provider&&typeof value.provider[feature]==="function"){return value.provider}return null}function getProvider(value){if(value==null){return null}return value.provider||null}async function copyOverrides(arg,allowed){const overrides=copyRequest(Typed.dereference(arg,"overrides"));assertArgument(overrides.to==null||(allowed||[]).indexOf("to")>=0,"cannot override to","overrides.to",overrides.to);assertArgument(overrides.data==null||(allowed||[]).indexOf("data")>=0,"cannot override data","overrides.data",overrides.data);if(overrides.from){overrides.from=await resolveAddress(overrides.from)}return overrides}async function resolveArgs(_runner,inputs,args){return await Promise.all(inputs.map((param,index)=>{return param.walkAsync(args[index],(type,value)=>{value=Typed.dereference(value,type);if(type==="address"){return resolveAddress(value)}return value})}))}function buildWrappedFallback(contract){const populateTransaction=async function(overrides){const tx=await copyOverrides(overrides,["data"]);tx.to=await contract.getAddress();const iface=contract.interface;const payable=iface.receive||iface.fallback&&iface.fallback.payable;assertArgument(payable||(tx.value||BN_0$1)===BN_0$1,"cannot send value to non-payable contract","overrides.value",tx.value);assertArgument(iface.fallback||(tx.data||"0x")==="0x","cannot send data to receive-only contract","overrides.data",tx.data);return tx};const staticCall=async function(overrides){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(overrides);try{return await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}};const send=async function(overrides){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(overrides));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(overrides){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(overrides))};const method=async overrides=>{return await send(overrides)};defineProperties(method,{_contract:contract,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall});return method}function buildWrappedMethod(contract,key){const getFragment=function(...args){const fragment=contract.interface.getFunction(key,args);assert(fragment,"no matching fragment in getFragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const populateTransaction=async function(...args){const fragment=getFragment(...args);let overrides={};if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("internal error: fragment inputs doesn't match arguments; should not happen")}const resolvedArgs=await resolveArgs(contract.runner,fragment.inputs,args);return Object.assign({},overrides,await resolveProperties({to:contract.getAddress(),data:contract.interface.encodeFunctionData(fragment,resolvedArgs)}))};const staticCall=async function(...args){const result=await staticCallResult(...args);if(result.length===1){return result[0]}return result};const send=async function(...args){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(...args));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(...args){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(...args))};const staticCallResult=async function(...args){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(...args);let result="0x";try{result=await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}const fragment=getFragment(...args);return contract.interface.decodeFunctionResult(fragment,result)};const method=async(...args)=>{const fragment=getFragment(...args);if(fragment.constant){return await staticCall(...args)}return await send(...args)};defineProperties(method,{name:contract.interface.getFunctionName(key),_contract:contract,_key:key,getFragment:getFragment,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getFunction(key);assert(fragment,"no matching fragment in defineProperty","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}function buildWrappedEvent(contract,key){const getFragment=function(...args){const fragment=contract.interface.getEvent(key,args);assert(fragment,"no matching fragment in","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const method=function(...args){return new PreparedTopicFilter(contract,getFragment(...args),args)};defineProperties(method,{name:contract.interface.getEventName(key),_contract:contract,_key:key,getFragment:getFragment});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getEvent(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}const internal=Symbol.for("_corebcInternal_contract");const internalValues=new WeakMap;function setInternal(contract,values){internalValues.set(contract[internal],values)}function getInternal(contract){return internalValues.get(contract[internal])}function isDeferred(value){return value&&typeof value==="object"&&"getTopicFilter"in value&&typeof value.getTopicFilter==="function"&&value.fragment}async function getSubInfo(contract,event){let topics;let fragment=null;if(Array.isArray(event)){const topicHashify=function(name){if(isHexString(name,32)){return name}const fragment=contract.interface.getEvent(name);assertArgument(fragment,"unknown fragment","name",name);return fragment.topicHash};topics=event.map(e=>{if(e==null){return null}if(Array.isArray(e)){return e.map(topicHashify)}return topicHashify(e)})}else if(event==="*"){topics=[null]}else if(typeof event==="string"){if(isHexString(event,32)){topics=[event]}else{fragment=contract.interface.getEvent(event);assertArgument(fragment,"unknown fragment","event",event);topics=[fragment.topicHash]}}else if(isDeferred(event)){topics=await event.getTopicFilter()}else if("fragment"in event){fragment=event.fragment;topics=[fragment.topicHash]}else{assertArgument(false,"unknown event name","event",event)}topics=topics.map(t=>{if(t==null){return null}if(Array.isArray(t)){const items=Array.from(new Set(t.map(t=>t.toLowerCase())).values());if(items.length===1){return items[0]}items.sort();return items}return t.toLowerCase()});const tag=topics.map(t=>{if(t==null){return"null"}if(Array.isArray(t)){return t.join("|")}return t}).join("&");return{fragment:fragment,tag:tag,topics:topics}}async function hasSub(contract,event){const{subs}=getInternal(contract);return subs.get((await getSubInfo(contract,event)).tag)||null}async function getSub(contract,operation,event){const provider=getProvider(contract.runner);assert(provider,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:operation});const{fragment,tag,topics}=await getSubInfo(contract,event);const{addr,subs}=getInternal(contract);let sub=subs.get(tag);if(!sub){const address=addr?addr:contract;const filter={address:address,topics:topics};const listener=log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=contract.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){const _foundFragment=foundFragment;const args=fragment?contract.interface.decodeEventLog(fragment,log.data,log.topics):[];emit(contract,event,args,listener=>{return new ContractEventPayload(contract,listener,event,_foundFragment,log)})}else{emit(contract,event,[],listener=>{return new ContractUnknownEventPayload(contract,listener,event,log)})}};let starting=[];const start=()=>{if(starting.length){return}starting.push(provider.on(filter,listener))};const stop=async()=>{if(starting.length==0){return}let started=starting;starting=[];await Promise.all(started);provider.off(filter,listener)};sub={tag:tag,listeners:[],start:start,stop:stop};subs.set(tag,sub)}return sub}let lastEmit=Promise.resolve();async function _emit(contract,event,args,payloadFunc){await lastEmit;const sub=await hasSub(contract,event);if(!sub){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const passArgs=Array.from(args);if(payloadFunc){passArgs.push(payloadFunc(once?null:listener))}try{listener.call(contract,...passArgs)}catch(error){}return!once});return count>0}async function emit(contract,event,args,payloadFunc){try{await lastEmit}catch(error){}const resultPromise=_emit(contract,event,args,payloadFunc);lastEmit=resultPromise;return await resultPromise}const passProperties=["then"];class BaseContract{target;interface;runner;filters;[internal];fallback;constructor(target,abi,runner,_deployTx){if(runner==null){runner=null}const iface=Interface.from(abi);defineProperties(this,{target:target,runner:runner,interface:iface});Object.defineProperty(this,internal,{value:{}});let addrPromise;let addr=null;let deployTx=null;if(_deployTx){const provider=getProvider(runner);deployTx=new ContractTransactionResponse(this.interface,provider,_deployTx)}let subs=new Map;if(typeof target==="string"){if(isHexString(target)){addr=target;addrPromise=Promise.resolve(target)}else{const resolver=getRunner(runner,"resolveName");if(!canResolve(resolver)){throw makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"})}addrPromise=resolver.resolveName(target).then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}}else{addrPromise=target.getAddress().then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}setInternal(this,{addrPromise:addrPromise,addr:addr,deployTx:deployTx,subs:subs});const filters=new Proxy({},{get:(target,_prop,receiver)=>{if(passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=this.getEvent(prop);if(result){return result}throw new Error(`unknown contract event: ${prop}`)},has:(target,prop)=>{if(passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return Reflect.has(target,prop)||this.interface.hasEvent(String(prop))}});defineProperties(this,{filters:filters});defineProperties(this,{fallback:iface.receive||iface.fallback?buildWrappedFallback(this):null});return new Proxy(this,{get:(target,_prop,receiver)=>{if(_prop in target||passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=target.getFunction(prop);if(result){return result}throw new Error(`unknown contract method: ${prop}`)},has:(target,prop)=>{if(prop in target||passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return target.interface.hasFunction(String(prop))}})}connect(runner){return new BaseContract(this.target,this.interface,runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const provider=getProvider(this.runner);assert(provider,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const code=await provider.getCode(await this.getAddress());if(code==="0x"){return null}return code}async waitForDeployment(){const deployTx=this.deploymentTransaction();if(deployTx){await deployTx.wait();return this}const code=await this.getDeployedCode();if(code!=null){return this}const provider=getProvider(this.runner);assert(provider!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"});return new Promise((resolve,reject)=>{const checkCode=async()=>{try{const code=await this.getDeployedCode();if(code!=null){return resolve(this)}provider.once("block",checkCode)}catch(error){reject(error)}};checkCode()})}deploymentTransaction(){return getInternal(this).deployTx}getFunction(key){if(typeof key!=="string"){key=key.format()}const func=buildWrappedMethod(this,key);return func}getEvent(key){if(typeof key!=="string"){key=key.format()}return buildWrappedEvent(this,key)}async queryTransaction(hash){throw new Error("@TODO")}async queryFilter(event,fromBlock,toBlock){if(fromBlock==null){fromBlock=0}if(toBlock==null){toBlock="latest"}const{addr,addrPromise}=getInternal(this);const address=addr?addr:await addrPromise;const{fragment,topics}=await getSubInfo(this,event);const filter={address:address,topics:topics,fromBlock:fromBlock,toBlock:toBlock};const provider=getProvider(this.runner);assert(provider,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"});return(await provider.getLogs(filter)).map(log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=this.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){return new EventLog(log,this.interface,foundFragment)}else{return new Log(log,provider)}})}async on(event,listener){const sub=await getSub(this,"on",event);sub.listeners.push({listener:listener,once:false});sub.start();return this}async once(event,listener){const sub=await getSub(this,"once",event);sub.listeners.push({listener:listener,once:true});sub.start();return this}async emit(event,...args){return await emit(this,event,args,null)}async listenerCount(event){if(event){const sub=await hasSub(this,event);if(!sub){return 0}return sub.listeners.length}const{subs}=getInternal(this);let total=0;for(const{listeners}of subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}const{subs}=getInternal(this);let result=[];for(const{listeners}of subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await hasSub(this,event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(listener==null||sub.listeners.length===0){sub.stop();getInternal(this).subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return this}sub.stop();getInternal(this).subs.delete(sub.tag)}else{const{subs}=getInternal(this);for(const{tag,stop}of subs.values()){stop();subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return await this.off(event,listener)}static buildClass(abi){class CustomContract extends BaseContract{constructor(address,runner=null){super(address,abi,runner)}}return CustomContract}static from(target,abi,runner){if(runner==null){runner=null}const contract=new this(target,abi,runner);return contract}static isIndexed(value){return Indexed.isIndexed(value)}}function _ContractBase(){return BaseContract}class Contract extends _ContractBase(){}class ContractFactory{interface;bytecode;runner;constructor(abi,bytecode,runner){const iface=Interface.from(abi);if(bytecode instanceof Uint8Array){bytecode=hexlify(getBytes(bytecode))}else if(typeof bytecode==="string"){bytecode=bytecode}else if(isBytes$1(bytecode)){bytecode=hexlify(bytecode)}else if(bytecode&&typeof bytecode.object==="string"){bytecode=bytecode.object}else{bytecode="!"}defineProperties(this,{bytecode:bytecode,interface:iface,runner:runner||null})}async getDeployTransaction(...args){let overrides={};const fragment=this.interface.deploy;if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("incorrect number of arguments to constructor")}const resolvedArgs=await resolveArgs(this.runner,fragment.inputs,args);const data=concat([this.bytecode,this.interface.encodeDeploy(resolvedArgs)]);return Object.assign({},overrides,{data:data})}async deploy(...args){const tx=await this.getDeployTransaction(...args);assert(this.runner&&typeof this.runner.sendTransaction==="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const sentTx=await this.runner.sendTransaction(tx);const address=getCreateAddress(sentTx);return new BaseContract(address,this.interface,this.runner,sentTx)}connect(runner){return new ContractFactory(this.interface,this.bytecode,runner)}static fromSolidity(output,runner){assertArgument(output!=null,"bad compiler output","output",output);if(typeof output==="string"){output=JSON.parse(output)}const abi=output.abi;let bytecode="";if(output.bytecode){bytecode=output.bytecode}else if(output.evm&&output.evm.bytecode){bytecode=output.evm.bytecode}return new this(abi,bytecode,runner)}}const BN_0=BigInt(0);function allowNull(format,nullValue){return function(value){if(value==null){return nullValue}return format(value)}}function arrayOf(format){return array=>{if(!Array.isArray(array)){throw new Error("not an array")}return array.map(i=>format(i))}}function object(format,altNames){return value=>{const result={};for(const key in format){let srcKey=key;if(altNames&&key in altNames&&!(srcKey in value)){for(const altKey of altNames[key]){if(altKey in value){srcKey=altKey;break}}}try{const nv=format[key](value[srcKey]);if(nv!==undefined){result[key]=nv}}catch(error){const message=error instanceof Error?error.message:"not-an-error";assert(false,`invalid value for value.${key} (${message})`,"BAD_DATA",{value:value})}}return result}}function formatBoolean(value){switch(value){case true:case"true":return true;case false:case"false":return false}assertArgument(false,`invalid boolean; ${JSON.stringify(value)}`,"value",value)}function formatData(value){assertArgument(isHexString(value,true),"invalid data","value",value);return value}function formatHash(value){assertArgument(isHexString(value,32),"invalid hash","value",value);return value}const _formatLog=object({address:getAddress,blockHash:formatHash,blockNumber:getNumber,data:formatData,index:getNumber,removed:allowNull(formatBoolean,false),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:getNumber},{index:["logIndex"]});function formatLog(value){return _formatLog(value)}const _formatBlock=object({hash:allowNull(formatHash),parentHash:formatHash,number:getNumber,timestamp:getNumber,nonce:allowNull(formatData),difficulty:getBigInt,energyLimit:getBigInt,energyUsed:getBigInt,miner:allowNull(getAddress),extraData:formatData,baseFeePerEnergy:allowNull(getBigInt)});function formatBlock(value){const result=_formatBlock(value);result.transactions=value.transactions.map(tx=>{if(typeof tx==="string"){return tx}return formatTransactionResponse(tx)});return result}const _formatReceiptLog=object({transactionIndex:getNumber,blockNumber:getNumber,transactionHash:formatHash,address:getAddress,topics:arrayOf(formatHash),data:formatData,index:getNumber,blockHash:formatHash},{index:["logIndex"]});function formatReceiptLog(value){return _formatReceiptLog(value)}const _formatTransactionReceipt=object({to:allowNull(getAddress,null),from:allowNull(getAddress,null),contractAddress:allowNull(getAddress,null),index:getNumber,root:allowNull(hexlify),energyUsed:getBigInt,logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf(formatReceiptLog),blockNumber:getNumber,cumulativeEnergyUsed:getBigInt,effectiveEnergyPrice:allowNull(getBigInt),status:allowNull(getNumber),type:allowNull(getNumber,0)},{effectiveEnergyPrice:["energyPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionReceipt(value){return _formatTransactionReceipt(value)}function formatTransactionResponse(value){if(value.to&&!getAddress(value.to)&&getBigInt(value.to)===BN_0){value.to="0x0000000000000000000000000000000000000000"}const result=object({hash:formatHash,type:value=>{if(value==="0x"||value==null){return 0}return getNumber(value)},accessList:allowNull(accessListify,null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(getNumber,null),transactionIndex:allowNull(getNumber,null),from:getAddress,maxFeePerEnergy:allowNull(getBigInt),energyLimit:getBigInt,to:allowNull(getAddress,null),value:getBigInt,nonce:getNumber,data:formatData,creates:allowNull(getAddress,null),networkId:allowNull(getBigInt,null)},{data:["input"],energyLimit:["energy"]})(value);if(result.to==null&&result.creates==null){result.creates=getCreateAddress(result)}if(value.signature){result.signature=value.signature}else{result.signature=value}if(result.networkId==null){const networkId=result.signature.legacynetworkId;if(networkId!=null){result.networkId=networkId}}if(result.blockHash&&getBigInt(result.blockHash)===BN_0){result.blockHash=null}return result}class NetworkPlugin{name;constructor(name){defineProperties(this,{name:name})}clone(){return new NetworkPlugin(this.name)}}class EnergyCostPlugin extends NetworkPlugin{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(effectiveBlock,costs){if(effectiveBlock==null){effectiveBlock=0}super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock||0}`);const props={effectiveBlock:effectiveBlock};function set(name,nullish){let value=(costs||{})[name];if(value==null){value=nullish}assertArgument(typeof value==="number",`invalud value for ${name}`,"costs",costs);props[name]=value}set("txBase",21e3);set("txCreate",32e3);set("txDataZero",4);set("txDataNonzero",16);set("txAccessListStorageKey",1900);set("txAccessListAddress",2400);defineProperties(this,props)}clone(){return new EnergyCostPlugin(this.effectiveBlock,this)}}class FeeDataNetworkPlugin extends NetworkPlugin{#feeDataFunc;get feeDataFunc(){return this.#feeDataFunc}constructor(feeDataFunc){super("org.corebc.plugins.network.FeeData");this.#feeDataFunc=feeDataFunc}async getFeeData(provider){return await this.#feeDataFunc(provider)}clone(){return new FeeDataNetworkPlugin(this.#feeDataFunc)}}const Networks=new Map;class Network{#name;#networkId;#plugins;constructor(name,networkId){this.#name=name;this.#networkId=getBigInt(networkId);this.#plugins=new Map}toJSON(){return{name:this.name,networkId:String(this.networkId)}}get name(){return this.#name}set name(value){this.#name=value}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value,"networkId")}matches(other){if(other==null){return false}if(typeof other==="string"){try{return this.networkId===getBigInt(other)}catch(error){}return this.name===other}if(typeof other==="number"||typeof other==="bigint"){try{return this.networkId===getBigInt(other)}catch(error){}return false}if(typeof other==="object"){if(other.networkId!=null){try{return this.networkId===getBigInt(other.networkId)}catch(error){}return false}if(other.name!=null){return this.name===other.name}return false}return false}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.clone());return this}getPlugin(name){return this.#plugins.get(name)||null}getPlugins(basename){return this.plugins.filter(p=>p.name.split("#")[0]===basename)}clone(){const clone=new Network(this.name,this.networkId);this.plugins.forEach(plugin=>{clone.attachPlugin(plugin.clone())});return clone}computeIntrinsicEnergy(tx){const costs=this.getPlugin("org.corebc.plugins.network.EnergyCost")||new EnergyCostPlugin;let energy=costs.txBase;if(tx.to==null){energy+=costs.txCreate}if(tx.data){for(let i=2;i{Network.register(name,func)})}}registerEth("mainnet",1,{altNames:["homestead"]});registerEth("ropsten",3,{});registerEth("rinkeby",4,{});registerEth("goerli",5,{});registerEth("kovan",42,{});registerEth("sepolia",11155111,{});registerEth("classic",61,{});registerEth("classicKotti",6,{});registerEth("xdai",100,{})}function copy$2(obj){return JSON.parse(JSON.stringify(obj))}class PollingBlockSubscriber{#provider;#poller;#interval;#blockNumber;constructor(provider){this.#provider=provider;this.#poller=null;this.#interval=4e3;this.#blockNumber=-2}get pollingInterval(){return this.#interval}set pollingInterval(value){this.#interval=value}async#poll(){try{const blockNumber=await this.#provider.getBlockNumber();if(this.#blockNumber===-2){this.#blockNumber=blockNumber;return}if(blockNumber!==this.#blockNumber){for(let b=this.#blockNumber+1;b<=blockNumber;b++){if(this.#poller==null){return}await this.#provider.emit("block",b)}this.#blockNumber=blockNumber}}catch(error){}if(this.#poller==null){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval)}start(){if(this.#poller){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval);this.#poll()}stop(){if(!this.#poller){return}this.#provider._clearTimeout(this.#poller);this.#poller=null}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}class OnBlockSubscriber{#provider;#poll;#running;constructor(provider){this.#provider=provider;this.#running=false;this.#poll=blockNumber=>{this._poll(blockNumber,this.#provider)}}async _poll(blockNumber,provider){throw new Error("sub-classes must override this")}start(){if(this.#running){return}this.#running=true;this.#poll(-2);this.#provider.on("block",this.#poll)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poll)}pause(dropWhilePaused){this.stop()}resume(){this.start()}}class PollingOrphanSubscriber extends OnBlockSubscriber{#filter;constructor(provider,filter){super(provider);this.#filter=copy$2(filter)}async _poll(blockNumber,provider){throw new Error("@TODO")}}class PollingTransactionSubscriber extends OnBlockSubscriber{#hash;constructor(provider,hash){super(provider);this.#hash=hash}async _poll(blockNumber,provider){const tx=await provider.getTransactionReceipt(this.#hash);if(tx){provider.emit(this.#hash,tx)}}}class PollingEventSubscriber{#provider;#filter;#poller;#running;#blockNumber;constructor(provider,filter){this.#provider=provider;this.#filter=copy$2(filter);this.#poller=this.#poll.bind(this);this.#running=false;this.#blockNumber=-2}async#poll(blockNumber){if(this.#blockNumber===-2){return}const filter=copy$2(this.#filter);filter.fromBlock=this.#blockNumber+1;filter.toBlock=blockNumber;const logs=await this.#provider.getLogs(filter);if(logs.length===0){if(this.#blockNumber{this.#blockNumber=blockNumber})}this.#provider.on("block",this.#poller)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poller)}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}const MAX_CCIP_REDIRECTS=10;function isPromise(value){return value&&typeof value.then==="function"}function getTag(prefix,value){return prefix+":"+JSON.stringify(value,(k,v)=>{if(v==null){return"null"}if(typeof v==="bigint"){return`bigint:${v.toString()}`}if(typeof v==="string"){return v.toLowerCase()}if(typeof v==="object"&&!Array.isArray(v)){const keys=Object.keys(v);keys.sort();return keys.reduce((accum,key)=>{accum[key]=v[key];return accum},{})}return v})}class UnmanagedSubscriber{name;constructor(name){defineProperties(this,{name:name})}start(){}stop(){}pause(dropWhilePaused){}resume(){}}function copy$1(value){return JSON.parse(JSON.stringify(value))}function concisify(items){items=Array.from(new Set(items).values());items.sort();return items}async function getSubscription(_event,provider){if(_event==null){throw new Error("invalid event")}if(Array.isArray(_event)){_event={topics:_event}}if(typeof _event==="string"){switch(_event){case"block":case"pending":case"debug":case"error":case"network":{return{type:_event,tag:_event}}}}if(isHexString(_event,32)){const hash=_event.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:hash}),hash:hash}}if(_event.orphan){const event=_event;return{type:"orphan",tag:getTag("orphan",event),filter:copy$1(event)}}if(_event.address||_event.topics){const event=_event;const filter={topics:(event.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()})};if(event.address){const addresses=[];const promises=[];const addAddress=addr=>{if(isHexString(addr)){addresses.push(addr)}else{promises.push((async()=>{addresses.push(await resolveAddress(addr))})())}};if(Array.isArray(event.address)){event.address.forEach(addAddress)}else{addAddress(event.address)}if(promises.length){await Promise.all(promises)}filter.address=concisify(addresses.map(a=>a.toLowerCase()))}return{filter:filter,tag:getTag("event",filter),type:"event"}}assertArgument(false,"unknown ProviderEvent","event",_event)}function getTime$1(){return(new Date).getTime()}class AbstractProvider{#subs;#plugins;#pausedState;#networkPromise;#anyNetwork;#performCache;#lastBlockNumber;#nextTimer;#timers;#disableCcipRead;constructor(_network){if(_network==="any"){this.#anyNetwork=true;this.#networkPromise=null}else if(_network){const network=Network.from(_network);this.#anyNetwork=false;this.#networkPromise=Promise.resolve(network);setTimeout(()=>{this.emit("network",network,null)},0)}else{this.#anyNetwork=false;this.#networkPromise=null}this.#lastBlockNumber=-1;this.#performCache=new Map;this.#subs=new Map;this.#plugins=new Map;this.#pausedState=null;this.#nextTimer=1;this.#timers=new Map;this.#disableCcipRead=false}get provider(){return this}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.connect(this));return this}getPlugin(name){return this.#plugins.get(name)||null}get disableCcipRead(){return this.#disableCcipRead}set disableCcipRead(value){this.#disableCcipRead=!!value}async#perform(req){const tag=getTag(req.method,req);let perform=this.#performCache.get(tag);if(!perform){perform=this._perform(req);this.#performCache.set(tag,perform);setTimeout(()=>{if(this.#performCache.get(tag)===perform){this.#performCache.delete(tag)}},250)}return await perform}async ccipReadFetch(tx,calldata,urls){if(this.disableCcipRead||urls.length===0||tx.to==null){return null}const sender=tx.to.toLowerCase();const data=calldata.toLowerCase();const errorMessages=[];for(let i=0;i=500,`response not found during CCIP fetch: ${errorMessage}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:tx,info:{url:url,errorMessage:errorMessage}});errorMessages.push(errorMessage)}assert(false,`error encountered during CCIP fetch: ${errorMessages.map(m=>JSON.stringify(m)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:tx,info:{urls:urls,errorMessages:errorMessages}})}_wrapBlock(value,network){return new Block(formatBlock(value),this)}_wrapLog(value,network){return new Log(formatLog(value),this)}_wrapTransactionReceipt(value,network){return new TransactionReceipt(formatTransactionReceipt(value),this)}_wrapTransactionResponse(tx,network){return new TransactionResponse(formatTransactionResponse(tx),this)}_detectNetwork(){assert(false,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(req){assert(false,`unsupported method: ${req.method}`,"UNSUPPORTED_OPERATION",{operation:req.method,info:req})}async getBlockNumber(){const blockNumber=getNumber(await this.#perform({method:"getBlockNumber"}),"%response");if(this.#lastBlockNumber>=0){this.#lastBlockNumber=blockNumber}return blockNumber}_getAddress(address){return resolveAddress(address)}_getBlockTag(blockTag){if(blockTag==null){return"latest"}switch(blockTag){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return blockTag}if(isHexString(blockTag)){if(isHexString(blockTag,32)){return blockTag}return toQuantity(blockTag)}if(typeof blockTag==="bigint"){blockTag=getNumber(blockTag,"blockTag")}if(typeof blockTag==="number"){if(blockTag>=0){return toQuantity(blockTag)}if(this.#lastBlockNumber>=0){return toQuantity(this.#lastBlockNumber+blockTag)}return this.getBlockNumber().then(b=>toQuantity(b+blockTag))}assertArgument(false,"invalid blockTag","blockTag",blockTag)}_getFilter(filter){const topics=(filter.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()});const blockHash="blockHash"in filter?filter.blockHash:undefined;const resolve=(_address,fromBlock,toBlock)=>{let address=undefined;switch(_address.length){case 0:break;case 1:address=_address[0];break;default:_address.sort();address=_address}if(blockHash){if(fromBlock!=null||toBlock!=null){throw new Error("invalid filter")}}const filter={};if(address){filter.address=address}if(topics.length){filter.topics=topics}if(fromBlock){filter.fromBlock=fromBlock}if(toBlock){filter.toBlock=toBlock}if(blockHash){filter.blockHash=blockHash}return filter};let address=[];if(filter.address){if(Array.isArray(filter.address)){for(const addr of filter.address){address.push(this._getAddress(addr))}}else{address.push(this._getAddress(filter.address))}}let fromBlock=undefined;if("fromBlock"in filter){fromBlock=this._getBlockTag(filter.fromBlock)}let toBlock=undefined;if("toBlock"in filter){toBlock=this._getBlockTag(filter.toBlock)}if(address.filter(a=>typeof a!=="string").length||fromBlock!=null&&typeof fromBlock!=="string"||toBlock!=null&&typeof toBlock!=="string"){return Promise.all([Promise.all(address),fromBlock,toBlock]).then(result=>{return resolve(result[0],result[1],result[2])})}return resolve(address,fromBlock,toBlock)}_getTransactionRequest(_request){const request=copyRequest(_request);const promises=[];["to","from"].forEach(key=>{if(request[key]==null){return}const addr=resolveAddress(request[key]);if(isPromise(addr)){promises.push(async function(){request[key]=await addr}())}else{request[key]=addr}});if(request.blockTag!=null){const blockTag=this._getBlockTag(request.blockTag);if(isPromise(blockTag)){promises.push(async function(){request.blockTag=await blockTag}())}else{request.blockTag=blockTag}}if(promises.length){return async function(){await Promise.all(promises);return request}()}return request}async getNetwork(){if(this.#networkPromise==null){const detectNetwork=this._detectNetwork().then(network=>{this.emit("network",network,null);return network},error=>{if(this.#networkPromise===detectNetwork){this.#networkPromise=null}throw error});this.#networkPromise=detectNetwork;return(await detectNetwork).clone()}const networkPromise=this.#networkPromise;const[expected,actual]=await Promise.all([networkPromise,this._detectNetwork()]);if(expected.networkId!==actual.networkId){if(this.#anyNetwork){this.emit("network",actual,expected);if(this.#networkPromise===networkPromise){this.#networkPromise=Promise.resolve(actual)}}else{assert(false,`network changed: ${expected.networkId} => ${actual.networkId} `,"NETWORK_ERROR",{event:"changed"})}}return expected.clone()}async getEnergyPrice(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async getFeeData(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async estimateEnergy(_tx){let tx=this._getTransactionRequest(_tx);if(isPromise(tx)){tx=await tx}return getBigInt(await this.#perform({method:"estimateEnergy",transaction:tx}),"%response")}async#call(tx,blockTag,attempt){assert(attempt=0&&blockTag==="latest"&&transaction.to!=null&&dataSlice(error.data,0,4)==="0x556f1830"){const data=error.data;const txSender=await resolveAddress(transaction.to);let ccipArgs;try{ccipArgs=parseOffchainLookup(dataSlice(error.data,4))}catch(error){assert(false,error.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:transaction,info:{data:data}})}assert(ccipArgs.sender.toLowerCase()===txSender.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:data,reason:"OffchainLookup",transaction:transaction,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ccipArgs.errorArgs}});const ccipResult=await this.ccipReadFetch(transaction,ccipArgs.calldata,ccipArgs.urls);assert(ccipResult!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:transaction,info:{data:error.data,errorArgs:ccipArgs.errorArgs}});const tx={to:txSender,data:concat([ccipArgs.selector,encodeBytes([ccipResult,ccipArgs.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:tx});try{const result=await this.#call(tx,blockTag,attempt+1);this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},tx),result:result});return result}catch(error){this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},tx),error:error});throw error}}throw error}}async#checkNetwork(promise){const{value}=await resolveProperties({network:this.getNetwork(),value:promise});return value}async call(_tx){const{tx,blockTag}=await resolveProperties({tx:this._getTransactionRequest(_tx),blockTag:this._getBlockTag(_tx.blockTag)});return await this.#checkNetwork(this.#call(tx,blockTag,_tx.enableCcipRead?0:-1))}async#getAccountValue(request,_address,_blockTag){let address=this._getAddress(_address);let blockTag=this._getBlockTag(_blockTag);if(typeof address!=="string"||typeof blockTag!=="string"){[address,blockTag]=await Promise.all([address,blockTag])}return await this.#checkNetwork(this.#perform(Object.assign(request,{address:address,blockTag:blockTag})))}async getBalance(address,blockTag){return getBigInt(await this.#getAccountValue({method:"getBalance"},address,blockTag),"%response")}async getTransactionCount(address,blockTag){return getNumber(await this.#getAccountValue({method:"getTransactionCount"},address,blockTag),"%response")}async getCode(address,blockTag){return hexlify(await this.#getAccountValue({method:"getCode"},address,blockTag))}async getStorage(address,_position,blockTag){const position=getBigInt(_position,"position");return hexlify(await this.#getAccountValue({method:"getStorage",position:position},address,blockTag))}async broadcastTransaction(signedTx){const{blockNumber,hash,network}=await resolveProperties({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:signedTx}),network:this.getNetwork()});const tx=Transaction.from(signedTx);if(tx.hash!==hash){throw new Error("@TODO: the returned hash did not match")}return this._wrapTransactionResponse(tx,network).replaceableTransaction(blockNumber)}async#getBlock(block,includeTransactions){if(isHexString(block,32)){return await this.#perform({method:"getBlock",blockHash:block,includeTransactions:includeTransactions})}let blockTag=this._getBlockTag(block);if(typeof blockTag!=="string"){blockTag=await blockTag}return await this.#perform({method:"getBlock",blockTag:blockTag,includeTransactions:includeTransactions})}async getBlock(block,prefetchTxs){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#getBlock(block,!!prefetchTxs)});if(params==null){return null}return this._wrapBlock(params,network)}async getTransaction(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransaction",hash:hash})});if(params==null){return null}return this._wrapTransactionResponse(params,network)}async getTransactionReceipt(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransactionReceipt",hash:hash})});if(params==null){return null}if(params.energyPrice==null&¶ms.effectiveEnergyPrice==null){const tx=await this.#perform({method:"getTransaction",hash:hash});if(tx==null){throw new Error("report this; could not find tx or effectiveEnergyPrice")}params.effectiveEnergyPrice=tx.energyPrice}return this._wrapTransactionReceipt(params,network)}async getTransactionResult(hash){const{result}=await resolveProperties({network:this.getNetwork(),result:this.#perform({method:"getTransactionResult",hash:hash})});if(result==null){return null}return hexlify(result)}async getLogs(_filter){let filter=this._getFilter(_filter);if(isPromise(filter)){filter=await filter}const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getLogs",filter:filter})});return params.map(p=>this._wrapLog(p,network))}_getProvider(networkId){assert(false,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async waitForTransaction(hash,_confirms,timeout){const confirms=_confirms!=null?_confirms:1;if(confirms===0){return this.getTransactionReceipt(hash)}return new Promise(async(resolve,reject)=>{let timer=null;const listener=async blockNumber=>{try{const receipt=await this.getTransactionReceipt(hash);if(receipt!=null){if(blockNumber-receipt.blockNumber+1>=confirms){resolve(receipt);if(timer){clearTimeout(timer);timer=null}return}}}catch(error){console.log("EEE",error)}this.once("block",listener)};if(timeout!=null){timer=setTimeout(()=>{if(timer==null){return}timer=null;this.off("block",listener);reject(makeError("timeout","TIMEOUT",{reason:"timeout"}))},timeout)}listener(await this.getBlockNumber())})}async waitForBlock(blockTag){assert(false,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(timerId){const timer=this.#timers.get(timerId);if(!timer){return}if(timer.timer){clearTimeout(timer.timer)}this.#timers.delete(timerId)}_setTimeout(_func,timeout){if(timeout==null){timeout=0}const timerId=this.#nextTimer++;const func=()=>{this.#timers.delete(timerId);_func()};if(this.paused){this.#timers.set(timerId,{timer:null,func:func,time:timeout})}else{const timer=setTimeout(func,timeout);this.#timers.set(timerId,{timer:timer,func:func,time:getTime$1()})}return timerId}_forEachSubscriber(func){for(const sub of this.#subs.values()){func(sub.subscriber)}}_getSubscriber(sub){switch(sub.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(sub.type);case"block":return new PollingBlockSubscriber(this);case"event":return new PollingEventSubscriber(this,sub.filter);case"transaction":return new PollingTransactionSubscriber(this,sub.hash);case"orphan":return new PollingOrphanSubscriber(this,sub.filter)}throw new Error(`unsupported event: ${sub.type}`)}_recoverSubscriber(oldSub,newSub){for(const sub of this.#subs.values()){if(sub.subscriber===oldSub){if(sub.started){sub.subscriber.stop()}sub.subscriber=newSub;if(sub.started){newSub.start()}if(this.#pausedState!=null){newSub.pause(this.#pausedState)}break}}}async#hasSub(event,emitArgs){let sub=await getSubscription(event);if(sub.type==="event"&&emitArgs&&emitArgs.length>0&&emitArgs[0].removed===true){sub=await getSubscription({orphan:"drop-log",log:emitArgs[0]})}return this.#subs.get(sub.tag)||null}async#getSub(event){const subscription=await getSubscription(event);const tag=subscription.tag;let sub=this.#subs.get(tag);if(!sub){const subscriber=this._getSubscriber(subscription);const addressableMap=new WeakMap;const nameMap=new Map;sub={subscriber:subscriber,tag:tag,addressableMap:addressableMap,nameMap:nameMap,started:false,listeners:[]};this.#subs.set(tag,sub)}return sub}async on(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:false});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async once(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:true});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async emit(event,...args){const sub=await this.#hasSub(event,args);if(!sub||sub.listeners.length===0){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const payload=new EventPayload(this,once?null:listener,event);try{listener.call(this,...args,payload)}catch(error){}return!once});if(sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return count>0}async listenerCount(event){if(event){const sub=await this.#hasSub(event);if(!sub){return 0}return sub.listeners.length}let total=0;for(const{listeners}of this.#subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await this.#hasSub(event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}let result=[];for(const{listeners}of this.#subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await this.#hasSub(event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(!listener||sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const{tag,started,subscriber}=await this.#getSub(event);if(started){subscriber.stop()}this.#subs.delete(tag)}else{for(const[tag,{started,subscriber}]of this.#subs){if(started){subscriber.stop()}this.#subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return this.off(event,listener)}destroy(){this.removeAllListeners();for(const timerId of this.#timers.keys()){this._clearTimeout(timerId)}}get paused(){return this.#pausedState!=null}set paused(pause){if(!!pause===this.paused){return}if(this.paused){this.resume()}else{this.pause(false)}}pause(dropWhilePaused){this.#lastBlockNumber=-1;if(this.#pausedState!=null){if(this.#pausedState==!!dropWhilePaused){return}assert(false,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(s=>s.pause(dropWhilePaused));this.#pausedState=!!dropWhilePaused;for(const timer of this.#timers.values()){if(timer.timer){clearTimeout(timer.timer)}timer.time=getTime$1()-timer.time}}resume(){if(this.#pausedState==null){return}this._forEachSubscriber(s=>s.resume());this.#pausedState=null;for(const timer of this.#timers.values()){let timeout=timer.time;if(timeout<0){timeout=0}timer.time=getTime$1();setTimeout(timer.func,timeout)}}}function _parseString(result,start){try{const bytes=_parseBytes(result,start);if(bytes){return toUtf8String(bytes)}}catch(error){}return null}function _parseBytes(result,start){if(result==="0x"){return null}try{const offset=getNumber(dataSlice(result,start,start+32));const length=getNumber(dataSlice(result,offset,offset+32));return dataSlice(result,offset+32,offset+32+length)}catch(error){}return null}function numPad(value){const result=toBeArray(value);if(result.length>32){throw new Error("internal; should not happen")}const padded=new Uint8Array(32);padded.set(result,32-result.length);return padded}function bytesPad(value){if(value.length%32===0){return value}const result=new Uint8Array(Math.ceil(value.length/32)*32);result.set(value);return result}const empty=new Uint8Array([]);function encodeBytes(datas){const result=[];let byteCount=0;for(let i=0;i=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const sender=dataSlice(data,0,32);assert(dataSlice(sender,0,12)===dataSlice(zeros,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"});result.sender=dataSlice(sender,12);try{const urls=[];const urlsOffset=getNumber(dataSlice(data,32,64));const urlsLength=getNumber(dataSlice(data,urlsOffset,urlsOffset+32));const urlsData=dataSlice(data,urlsOffset+32);for(let u=0;uresult[k]);return result}function checkProvider(signer,operation){if(signer.provider){return signer.provider}assert(false,"missing provider","UNSUPPORTED_OPERATION",{operation:operation})}async function populate(signer,tx){let pop=copyRequest(tx);if(pop.to!=null){pop.to=resolveAddress(pop.to)}if(pop.from!=null){const from=pop.from;pop.from=Promise.all([signer.getAddress(),resolveAddress(from)]).then(([address,from])=>{assertArgument(address.toLowerCase()===from.toLowerCase(),"transaction from mismatch","tx.from",from);return address})}else{pop.from=signer.getAddress()}return await resolveProperties(pop)}class AbstractSigner{provider;constructor(provider){defineProperties(this,{provider:provider||null})}async getNonce(blockTag){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),blockTag)}async populateCall(tx){const pop=await populate(this,tx);return pop}async populateTransaction(tx){const provider=checkProvider(this,"populateTransaction");const pop=await populate(this,tx);if(pop.nonce==null){pop.nonce=await this.getNonce("pending")}if(pop.energyLimit==null){pop.energyLimit=await this.estimateEnergy(pop)}const network=await this.provider.getNetwork();if(pop.networkId!=null){const networkId=getBigInt(pop.networkId);assertArgument(networkId===network.networkId,"transaction networkId mismatch","tx.networkId",tx.networkId)}else{pop.networkId=network.networkId}const feeData=await provider.getFeeData();if(feeData.energyPrice!=null){if(pop.energyPrice==null){pop.energyPrice=feeData.energyPrice}}else{assert(false,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"})}return await resolveProperties(pop)}async estimateEnergy(tx){return checkProvider(this,"estimateEnergy").estimateEnergy(await this.populateCall(tx))}async call(tx){return checkProvider(this,"call").call(await this.populateCall(tx))}async resolveName(name){return getAddress(name)}async sendTransaction(tx){const provider=checkProvider(this,"sendTransaction");const pop=await this.populateTransaction(tx);delete pop.from;const txObj=Transaction.from(pop);return await provider.broadcastTransaction(await this.signTransaction(txObj))}}class VoidSigner extends AbstractSigner{address;constructor(address,provider){super(provider);defineProperties(this,{address:address})}async getAddress(){return this.address}connect(provider){return new VoidSigner(this.address,provider)}#throwUnsupported(suffix,operation){assert(false,`VoidSigner cannot sign ${suffix}`,"UNSUPPORTED_OPERATION",{operation:operation})}async signTransaction(tx){this.#throwUnsupported("transactions","signTransaction")}async signMessage(message){this.#throwUnsupported("messages","signMessage")}async signTypedData(domain,types,value){this.#throwUnsupported("typed-data","signTypedData")}}const shown=new Set;function showThrottleMessage(service){if(shown.has(service)){return}shown.add(service);console.log("========= NOTICE =========");console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);console.log("");console.log("The default API keys for each service are provided as a highly-throttled,");console.log("community resource for low-traffic projects and early prototyping.");console.log("");console.log("While your application will continue to function, we highly recommended");console.log("signing up for your own API keys to improve performance, increase your");console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");console.log("")}function copy(obj){return JSON.parse(JSON.stringify(obj))}class FilterIdSubscriber{#provider;#filterIdPromise;#poller;#running;#network;#hault;constructor(provider){this.#provider=provider;this.#filterIdPromise=null;this.#poller=this.#poll.bind(this);this.#running=false;this.#network=null;this.#hault=false}_subscribe(provider){throw new Error("subclasses must override this")}_emitResults(provider,result){throw new Error("subclasses must override this")}_recover(provider){throw new Error("subclasses must override this")}async#poll(blockNumber){try{if(this.#filterIdPromise==null){this.#filterIdPromise=this._subscribe(this.#provider)}let filterId=null;try{filterId=await this.#filterIdPromise}catch(error){if(!isError(error,"UNSUPPORTED_OPERATION")||error.operation!=="xcb_newFilter"){throw error}}if(filterId==null){this.#filterIdPromise=null;this.#provider._recoverSubscriber(this,this._recover(this.#provider));return}const network=await this.#provider.getNetwork();if(!this.#network){this.#network=network}if(this.#network.networkId!==network.networkId){throw new Error("chaid changed")}if(this.#hault){return}const result=await this.#provider.send("xcb_getFilterChanges",[filterId]);await this._emitResults(this.#provider,result)}catch(error){console.log("@TODO",error)}this.#provider.once("block",this.#poller)}#teardown(){const filterIdPromise=this.#filterIdPromise;if(filterIdPromise){this.#filterIdPromise=null;filterIdPromise.then(filterId=>{this.#provider.send("xcb_uninstallFilter",[filterId])})}}start(){if(this.#running){return}this.#running=true;this.#poll(-2)}stop(){if(!this.#running){return}this.#running=false;this.#hault=true;this.#teardown();this.#provider.off("block",this.#poller)}pause(dropWhilePaused){if(dropWhilePaused){this.#teardown()}this.#provider.off("block",this.#poller)}resume(){this.start()}}class FilterIdEventSubscriber extends FilterIdSubscriber{#event;constructor(provider,filter){super(provider);this.#event=copy(filter)}_recover(provider){return new PollingEventSubscriber(provider,this.#event)}async _subscribe(provider){const filterId=await provider.send("xcb_newFilter",[this.#event]);return filterId}async _emitResults(provider,results){for(const result of results){provider.emit(this.#event,provider._wrapLog(result,provider._network))}}}class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(provider){return await provider.send("xcb_newPendingTransactionFilter",[])}async _emitResults(provider,results){for(const result of results){provider.emit("pending",result)}}}const Primitive="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy(value){if(value==null||Primitive.indexOf(typeof value)>=0){return value}if(typeof value.getAddress==="function"){return value}if(Array.isArray(value)){return value.map(deepCopy)}if(typeof value==="object"){return Object.keys(value).reduce((accum,key)=>{accum[key]=value[key];return accum},{})}throw new Error(`should not happen: ${value} (${typeof value})`)}function stall$3(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getLowerCase(value){if(value){return value.toLowerCase()}return value}function isPollable(value){return value&&typeof value.pollingInterval==="number"}const defaultOptions={polling:false,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100};class JsonRpcSigner extends AbstractSigner{address;constructor(provider,address){super(provider);address=getAddress(address);defineProperties(this,{address:address})}connect(provider){assert(false,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(tx){return await this.populateCall(tx)}async sendUncheckedTransaction(_tx){const tx=deepCopy(_tx);const promises=[];if(tx.from){const _from=tx.from;promises.push((async()=>{const from=await resolveAddress(_from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from})())}else{tx.from=this.address}if(tx.energyLimit==null){promises.push((async()=>{tx.energyLimit=await this.provider.estimateEnergy({...tx,from:this.address})})())}if(tx.to!=null){const _to=tx.to;promises.push((async()=>{tx.to=await resolveAddress(_to)})())}if(promises.length){await Promise.all(promises)}const hexTx=this.provider.getRpcTransaction(tx);return this.provider.send("xcb_sendTransaction",[hexTx])}async sendTransaction(tx){const blockNumber=await this.provider.getBlockNumber();const hash=await this.sendUncheckedTransaction(tx);return await new Promise((resolve,reject)=>{const timeouts=[1e3,100];const checkTx=async()=>{const tx=await this.provider.getTransaction(hash);if(tx!=null){resolve(tx.replaceableTransaction(blockNumber));return}this.provider._setTimeout(()=>{checkTx()},timeouts.pop()||4e3)};checkTx()})}async signTransaction(_tx){const tx=deepCopy(_tx);if(tx.from){const from=await resolveAddress(tx.from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from}else{tx.from=this.address}const hexTx=this.provider.getRpcTransaction(tx);return await this.provider.send("xcb_signTransaction",[hexTx])}async signMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("personal_sign",[hexlify(message),this.address.toLowerCase()])}async signTypedData(domain,types,_value){const value=deepCopy(_value);const populated=await TypedDataEncoder.resolveNames(domain,types,value,async value=>{const address=await resolveAddress(value);assertArgument(address!=null,"TypedData does not support null address","value",value);return address});return await this.provider.send("xcb_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(populated.domain,types,populated.value))])}async unlock(password){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),password,null])}async _legacySignMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("xcb_sign",[this.address.toLowerCase(),hexlify(message)])}}class JsonRpcApiProvider extends AbstractProvider{#options;#nextId;#payloads;#drainTimer;#notReady;#network;#scheduleDrain(){if(this.#drainTimer){return}const stallTime=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#drainTimer=setTimeout(()=>{this.#drainTimer=null;const payloads=this.#payloads;this.#payloads=[];while(payloads.length){const batch=[payloads.shift()];while(payloads.length){if(batch.length===this.#options.batchMaxCount){break}batch.push(payloads.shift());const bytes=JSON.stringify(batch.map(p=>p.payload));if(bytes.length>this.#options.batchMaxSize){payloads.unshift(batch.pop());break}}(async()=>{const payload=batch.length===1?batch[0].payload:batch.map(p=>p.payload);this.emit("debug",{action:"sendRpcPayload",payload:payload});try{const result=await this._send(payload);this.emit("debug",{action:"receiveRpcResult",result:result});for(const{resolve,reject,payload}of batch){const resp=result.filter(r=>r.id===payload.id)[0];if(resp==null){return reject(makeError("no response from server","BAD_DATA",{value:result,info:{payload:payload}}))}if("error"in resp){return reject(this.getRpcError(payload,resp))}resolve(resp.result)}}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});for(const{reject}of batch){reject(error)}}})()}},stallTime)}constructor(network,options){super(network);this.#nextId=1;this.#options=Object.assign({},defaultOptions,options||{});this.#payloads=[];this.#drainTimer=null;this.#network=null;{let resolve=null;const promise=new Promise(_resolve=>{resolve=_resolve});this.#notReady={promise:promise,resolve:resolve}}const staticNetwork=this._getOption("staticNetwork");if(staticNetwork){assertArgument(network==null||staticNetwork.matches(network),"staticNetwork MUST match network object","options",options);this.#network=staticNetwork}}_getOption(key){return this.#options[key]}get _network(){assert(this.#network,"network is not available yet","NETWORK_ERROR");return this.#network}async _perform(req){const request=this.getRpcRequest(req);if(request!=null){return await this.send(request.method,request.args)}return super._perform(req)}async _detectNetwork(){const network=this._getOption("staticNetwork");if(network){return network}if(this.ready){return Network.from(getBigInt(await this.send("xcb_networkId",[])))}const payload={id:this.#nextId++,method:"xcb_networkId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:payload});let result;try{result=(await this._send(payload))[0]}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});throw error}this.emit("debug",{action:"receiveRpcResult",result:result});if("result"in result){return Network.from(getBigInt(result.result))}throw this.getRpcError(payload,result)}_start(){if(this.#notReady==null||this.#notReady.resolve==null){return}this.#notReady.resolve();this.#notReady=null;(async()=>{while(this.#network==null){try{this.#network=await this._detectNetwork()}catch(error){console.log("JsonRpcProvider failed to startup; retry in 1s");await stall$3(1e3)}}this.#scheduleDrain()})()}async _waitUntilReady(){if(this.#notReady==null){return}return await this.#notReady.promise}_getSubscriber(sub){if(sub.type==="pending"){return new FilterIdPendingSubscriber(this)}if(sub.type==="event"){if(this._getOption("polling")){return new PollingEventSubscriber(this,sub.filter)}return new FilterIdEventSubscriber(this,sub.filter)}if(sub.type==="orphan"&&sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("orphan")}return super._getSubscriber(sub)}get ready(){return this.#notReady==null}getRpcTransaction(tx){const result={};["networkId","energyLimit","energyPrice","type","nonce","value"].forEach(key=>{if(tx[key]==null){return}let dstKey=key;if(key==="energyLimit"){dstKey="energy"}result[dstKey]=toQuantity(getBigInt(tx[key],`tx.${key}`))});["from","to","data"].forEach(key=>{if(tx[key]==null){return}result[key]=hexlify(tx[key])});return result}getRpcRequest(req){switch(req.method){case"networkId":return{method:"xcb_networkId",args:[]};case"getBlockNumber":return{method:"xcb_blockNumber",args:[]};case"getEnergyPrice":return{method:"xcb_energyPrice",args:[]};case"getBalance":{return{method:"xcb_getBalance",args:[getLowerCase(req.address),req.blockTag]}}case"getTransactionCount":return{method:"xcb_getTransactionCount",args:[getLowerCase(req.address),req.blockTag]};case"getCode":return{method:"xcb_getCode",args:[getLowerCase(req.address),req.blockTag]};case"getStorage":return{method:"xcb_getStorageAt",args:[getLowerCase(req.address),"0x"+req.position.toString(16),req.blockTag]};case"broadcastTransaction":return{method:"xcb_sendRawTransaction",args:[req.signedTransaction]};case"getBlock":if("blockTag"in req){return{method:"xcb_getBlockByNumber",args:[req.blockTag,!!req.includeTransactions]}}else if("blockHash"in req){return{method:"xcb_getBlockByHash",args:[req.blockHash,!!req.includeTransactions]}}break;case"getTransaction":return{method:"xcb_getTransactionByHash",args:[req.hash]};case"getTransactionReceipt":return{method:"xcb_getTransactionReceipt",args:[req.hash]};case"call":return{method:"xcb_call",args:[this.getRpcTransaction(req.transaction),req.blockTag]};case"estimateEnergy":{return{method:"xcb_estimateEnergy",args:[this.getRpcTransaction(req.transaction)]}}case"getLogs":if(req.filter&&req.filter.address!=null){if(Array.isArray(req.filter.address)){req.filter.address=req.filter.address.map(getLowerCase)}else{req.filter.address=getLowerCase(req.filter.address)}}return{method:"xcb_getLogs",args:[req.filter]}}return null}getRpcError(payload,_error){const{method}=payload;const{error}=_error;if(method==="xcb_estimateEnergy"&&error.message){const msg=error.message;if(!msg.match(/revert/i)&&msg.match(/insufficient funds/i)){return makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:payload.params[0],info:{payload:payload,error:error}})}}if(method==="xcb_call"||method==="xcb_estimateEnergy"){const result=spelunkData(error);const e=AbiCoder.getBuiltinCallException(method==="xcb_call"?"call":"estimateEnergy",payload.params[0],result?result.data:null);e.info={error:error,payload:payload};return e}const message=JSON.stringify(spelunkMessage(error));if(typeof error.message==="string"&&error.message.match(/user denied|corebc-user-denied/i)){const actionMap={xcb_sign:"signMessage",personal_sign:"signMessage",xcb_signTypedData_v4:"signTypedData",xcb_signTransaction:"signTransaction",xcb_sendTransaction:"sendTransaction",xcb_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return makeError(`user rejected action`,"ACTION_REJECTED",{action:actionMap[method]||"unknown",reason:"rejected",info:{payload:payload,error:error}})}if(method==="xcb_sendRawTransaction"||method==="xcb_sendTransaction"){const transaction=payload.params[0];if(message.match(/insufficient funds|base fee exceeds energy limit/i)){return makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction,info:{error:error}})}if(message.match(/nonce/i)&&message.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:transaction,info:{error:error}})}if(message.match(/replacement transaction/i)&&message.match(/underpriced/i)){return makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction,info:{error:error}})}if(message.match(/only replay-protected/i)){return makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:method,info:{transaction:transaction,info:{error:error}}})}}if(message.match(/the method .* does not exist/i)){return makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:payload.method,info:{error:error}})}return makeError("could not coalesce error","UNKNOWN_ERROR",{error:error})}send(method,params){const id=this.#nextId++;const promise=new Promise((resolve,reject)=>{this.#payloads.push({resolve:resolve,reject:reject,payload:{method:method,params:params,id:id,jsonrpc:"2.0"}})});this.#scheduleDrain();return promise}async getSigner(address){if(address==null){address=0}const accountsPromise=this.send("xcb_accounts",[]);if(typeof address==="number"){const accounts=await accountsPromise;if(address>=accounts.length){throw new Error("no such account")}return new JsonRpcSigner(this,accounts[address])}const{accounts}=await resolveProperties({network:this.getNetwork(),accounts:accountsPromise});address=getAddress(address);for(const account of accounts){if(getAddress(account)===address){return new JsonRpcSigner(this,address)}}throw new Error("invalid account")}async listAccounts(){const accounts=await this.send("xcb_accounts",[]);return accounts.map(a=>new JsonRpcSigner(this,a))}}class JsonRpcApiPollingProvider extends JsonRpcApiProvider{#pollingInterval;constructor(network,options){super(network,options);this.#pollingInterval=4e3}_getSubscriber(sub){const subscriber=super._getSubscriber(sub);if(isPollable(subscriber)){subscriber.pollingInterval=this.#pollingInterval}return subscriber}get pollingInterval(){return this.#pollingInterval}set pollingInterval(value){if(!Number.isInteger(value)||value<0){throw new Error("invalid interval")}this.#pollingInterval=value;this._forEachSubscriber(sub=>{if(isPollable(sub)){sub.pollingInterval=this.#pollingInterval}})}}class JsonRpcProvider extends JsonRpcApiPollingProvider{#connect;constructor(url,network,options){if(url==null){url="http://localhost:8545"}super(network,options);if(typeof url==="string"){this.#connect=new FetchRequest(url)}else{this.#connect=url.clone()}}_getConnection(){return this.#connect.clone()}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){const request=this._getConnection();request.body=JSON.stringify(payload);request.setHeader("content-type","application/json");const response=await request.send();response.assertOk();let resp=response.bodyJson;if(!Array.isArray(resp)){resp=[resp]}return resp}}function spelunkData(value){if(value==null){return null}if(typeof value.message==="string"&&value.message.match("reverted")&&isHexString(value.data)){return{message:value.message,data:value.data}}if(typeof value==="object"){for(const key in value){const result=spelunkData(value[key]);if(result){return result}}return null}if(typeof value==="string"){try{return spelunkData(JSON.parse(value))}catch(error){}}return null}function _spelunkMessage(value,result){if(value==null){return}if(typeof value.message==="string"){result.push(value.message)}if(typeof value==="object"){for(const key in value){_spelunkMessage(value[key],result)}}if(typeof value==="string"){try{return _spelunkMessage(JSON.parse(value),result)}catch(error){}}}function spelunkMessage(value){const result=[];_spelunkMessage(value,result);return result}const defaultApiKey$1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function getHost$4(name){switch(name){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/xcb_goerli";case"matic":return"rpc.ankr.com/polygon";case"arbitrum":return"rpc.ankr.com/arbitrum"}assertArgument(false,"unsupported network","network",name)}class AnkrProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey$1}const options={polling:true,staticNetwork:network};const request=AnkrProvider.getRequest(network,apiKey);super(request,network,options);defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AnkrProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey$1}const request=new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey$1){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("AnkrProvider");return true}}return request}getRpcError(payload,error){if(payload.method==="xcb_sendRawTransaction"){if(error&&error.error&&error.error.message==="INTERNAL_ERROR: could not replace existing tx"){error.error.message="replacement transaction underpriced"}}return super.getRpcError(payload,error)}isCommunityResource(){return this.apiKey===defaultApiKey$1}}const defaultApiKey="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function getHost$3(name){switch(name){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com"}assertArgument(false,"unsupported network","network",name)}class AlchemyProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey}const request=AlchemyProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AlchemyProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}async _perform(req){if(req.method==="getTransactionResult"){const{trace,tx}=await resolveProperties({trace:this.send("trace_transaction",[req.hash]),tx:this.getTransaction(req.hash)});if(trace==null||tx==null){return null}let data;let error=false;try{data=trace[0].result.output;error=trace[0].error==="Reverted"}catch(error){}if(data){assert(!error,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:data,reason:null,transaction:tx,invocation:null,revert:null});return data}assert(false,"could not parse trace result","BAD_DATA",{value:trace})}return await super._perform(req)}isCommunityResource(){return this.apiKey===defaultApiKey}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey}const request=new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("alchemy");return true}}return request}}class CloudflareProvider extends JsonRpcProvider{constructor(_network){if(_network==null){_network="mainnet"}const network=Network.from(_network);assertArgument(network.name==="mainnet","unsupported network","network",_network);super("https://cloudflare-eth.com/",network,{staticNetwork:network})}}function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const _WebSocket=getGlobal().WebSocket;class SocketSubscriber{#provider;#filter;get filter(){return JSON.parse(this.#filter)}#filterId;#paused;#emitPromise;constructor(provider,filter){this.#provider=provider;this.#filter=JSON.stringify(filter);this.#filterId=null;this.#paused=null;this.#emitPromise=null}start(){this.#filterId=this.#provider.send("xcb_subscribe",this.filter).then(filterId=>{this.#provider._register(filterId,this);return filterId})}stop(){this.#filterId.then(filterId=>{this.#provider.send("xcb_unsubscribe",[filterId])});this.#filterId=null}pause(dropWhilePaused){assert(dropWhilePaused,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"});this.#paused=!!dropWhilePaused}resume(){this.#paused=null}_handleMessage(message){if(this.#filterId==null){return}if(this.#paused===null){let emitPromise=this.#emitPromise;if(emitPromise==null){emitPromise=this._emit(this.#provider,message)}else{emitPromise=emitPromise.then(async()=>{await this._emit(this.#provider,message)})}this.#emitPromise=emitPromise.then(()=>{if(this.#emitPromise===emitPromise){this.#emitPromise=null}})}}async _emit(provider,message){throw new Error("sub-classes must implemente this; _emit")}}class SocketBlockSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newHeads"])}async _emit(provider,message){provider.emit("block",parseInt(message.number))}}class SocketPendingSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newPendingTransactions"])}async _emit(provider,message){provider.emit("pending",message)}}class SocketEventSubscriber extends SocketSubscriber{#logFilter;get logFilter(){return JSON.parse(this.#logFilter)}constructor(provider,filter){super(provider,["logs",filter]);this.#logFilter=JSON.stringify(filter)}async _emit(provider,message){provider.emit(this.logFilter,provider._wrapLog(message,provider._network))}}class SocketProvider extends JsonRpcApiProvider{#callbacks;#subs;#pending;constructor(network){super(network,{batchMaxCount:1});this.#callbacks=new Map;this.#subs=new Map;this.#pending=new Map}_getSubscriber(sub){switch(sub.type){case"close":return new UnmanagedSubscriber("close");case"block":return new SocketBlockSubscriber(this);case"pending":return new SocketPendingSubscriber(this);case"event":return new SocketEventSubscriber(this,sub.filter);case"orphan":if(sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("drop-log")}}return super._getSubscriber(sub)}_register(filterId,subscriber){this.#subs.set(filterId,subscriber);const pending=this.#pending.get(filterId);if(pending){for(const message of pending){subscriber._handleMessage(message)}this.#pending.delete(filterId)}}async _send(payload){assertArgument(!Array.isArray(payload),"WebSocket does not support batch send","payload",payload);const promise=new Promise((resolve,reject)=>{this.#callbacks.set(payload.id,{payload:payload,resolve:resolve,reject:reject})});await this._waitUntilReady();await this._write(JSON.stringify(payload));return[await promise]}async _processMessage(message){const result=JSON.parse(message);if("id"in result){const callback=this.#callbacks.get(result.id);if(callback==null){this.emit("error",makeError("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:result}));return}this.#callbacks.delete(result.id);callback.resolve(result)}else if(result.method==="xcb_subscription"){const filterId=result.params.subscription;const subscriber=this.#subs.get(filterId);if(subscriber){subscriber._handleMessage(result.params.result)}else{let pending=this.#pending.get(filterId);if(pending==null){pending=[];this.#pending.set(filterId,pending)}pending.push(result.params.result)}}}async _write(message){throw new Error("sub-classes must override this")}}class WebSocketProvider extends SocketProvider{#connect;#websocket;get websocket(){if(this.#websocket==null){throw new Error("websocket closed")}return this.#websocket}constructor(url,network){super(network);if(typeof url==="string"){this.#connect=()=>{return new _WebSocket(url)};this.#websocket=this.#connect()}else if(typeof url==="function"){this.#connect=url;this.#websocket=url()}else{this.#connect=null;this.#websocket=url}this.websocket.onopen=async()=>{try{await this._start();this.resume()}catch(error){console.log("failed to start WebsocketProvider",error)}};this.websocket.onmessage=message=>{this._processMessage(message.data)}}async _write(message){this.websocket.send(message)}async destroy(){if(this.#websocket!=null){this.#websocket.close();this.#websocket=null}super.destroy()}}const defaultProjectId="84842078b09946638c03157f83405213";function getHost$2(name){switch(name){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io"}assertArgument(false,"unsupported network","network",name)}class InfuraWebSocketProvider extends WebSocketProvider{projectId;projectSecret;constructor(network,projectId){const provider=new InfuraProvider(network,projectId);const req=provider._getConnection();assert(!req.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const url=req.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(url,network);defineProperties(this,{projectId:provider.projectId,projectSecret:provider.projectSecret})}isCommunityResource(){return this.projectId===defaultProjectId}}class InfuraProvider extends JsonRpcProvider{projectId;projectSecret;constructor(_network,projectId,projectSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=InfuraProvider.getRequest(network,projectId,projectSecret);super(request,network,{staticNetwork:network});defineProperties(this,{projectId:projectId,projectSecret:projectSecret})}_getProvider(networkId){try{return new InfuraProvider(networkId,this.projectId,this.projectSecret)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.projectId===defaultProjectId}static getWebSocketProvider(network,projectId){return new InfuraWebSocketProvider(network,projectId)}static getRequest(network,projectId,projectSecret){if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`);request.allowGzip=true;if(projectSecret){request.setCredentials("",projectSecret)}if(projectId===defaultProjectId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("InfuraProvider");return true}}return request}}const defaultToken="919b412a057b5e9c9b6dce193c5a60242d6efadb";function getHost$1(name){switch(name){case"mainnet":return"corebc.quiknode.pro";case"arbitrum":return"corebc.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"corebc.arbitrum-goerli.quiknode.pro";case"matic":return"corebc.matic.quiknode.pro";case"matic-mumbai":return"corebc.matic-testnet.quiknode.pro";case"optimism":return"corebc.optimism.quiknode.pro";case"optimism-goerli":return"corebc.optimism-goerli.quiknode.pro"}assertArgument(false,"unsupported network","network",name)}class QuickNodeProvider extends JsonRpcProvider{token;constructor(_network,token){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(token==null){token=defaultToken}const request=QuickNodeProvider.getRequest(network,token);super(request,network,{staticNetwork:network});defineProperties(this,{token:token})}_getProvider(networkId){try{return new QuickNodeProvider(networkId,this.token)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.token===defaultToken}static getRequest(network,token){if(token==null){token=defaultToken}const request=new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`);request.allowGzip=true;if(token===defaultToken){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("QuickNodeProvider");return true}}return request}}const BN_1=BigInt("1");const BN_2=BigInt("2");function shuffle(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));const tmp=array[i];array[i]=array[j];array[j]=tmp}}function stall$2(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getTime(){return(new Date).getTime()}function stringify(value){return JSON.stringify(value,(key,value)=>{if(typeof value==="bigint"){return{type:"bigint",value:value.toString()}}return value})}const defaultConfig={stallTimeout:400,priority:1,weight:1};const defaultState={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0};async function waitForSync(config,blockNumber){while(config.blockNumber<0||config.blockNumber{const blockNumber=await config.provider.getBlockNumber();if(blockNumber>config.blockNumber){config.blockNumber=blockNumber}config._updateNumber=null})()}await config._updateNumber;config.outOfSync++}}function _normalize(value){if(value==null){return"null"}if(Array.isArray(value)){return"["+value.map(_normalize).join(",")+"]"}if(typeof value==="object"&&typeof value.toJSON==="function"){return _normalize(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":case"number":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{"+keys.map(k=>`${JSON.stringify(k)}:${_normalize(value[k])}`).join(",")+"}"}}console.log("Could not serialize",value);throw new Error("Hmm...")}function normalizeResult(value){if("error"in value){const error=value.error;return{tag:_normalize(error),value:error}}const result=value.result;return{tag:_normalize(result),value:result}}function checkQuorum(quorum,results){const tally=new Map;for(const{value,tag,weight}of results){const t=tally.get(tag)||{value:value,weight:0};t.weight+=weight;tally.set(tag,t)}let best=null;for(const r of tally.values()){if(r.weight>=quorum&&(!best||r.weight>best.weight)){best=r}}if(best){return best.value}return undefined}function getMedian(quorum,results){let resultWeight=0;const errorMap=new Map;let bestError=null;const values=[];for(const{value,tag,weight}of results){if(value instanceof Error){const e=errorMap.get(tag)||{value:value,weight:0};e.weight+=weight;errorMap.set(tag,e);if(bestError==null||e.weight>bestError.weight){bestError=e}}else{values.push(BigInt(value));resultWeight+=weight}}if(resultWeight=quorum){return bestError.value}return undefined}values.sort((a,b)=>aa?1:0);const mid=Math.floor(values.length/2);if(values.length%2){return values[mid]}return(values[mid-1]+values[mid]+BN_1)/BN_2}function getAnyResult(quorum,results){const result=checkQuorum(quorum,results);if(result!==undefined){return result}for(const r of results){if(r.value){return r.value}}return undefined}function getFuzzyMode(quorum,results){if(quorum===1){return getNumber(getMedian(quorum,results),"%internal")}const tally=new Map;const add=(result,weight)=>{const t=tally.get(result)||{result:result,weight:0};t.weight+=weight;tally.set(result,t)};for(const{weight,value}of results){const r=getNumber(value);add(r-1,weight);add(r,weight);add(r+1,weight)}let bestWeight=0;let bestResult=undefined;for(const{weight,result}of tally.values()){if(weight>=quorum&&(weight>bestWeight||bestResult!=null&&weight===bestWeight&&result>bestResult)){bestWeight=weight;bestResult=result}}return bestResult}class FallbackProvider extends AbstractProvider{quorum;eventQuorum;eventWorkers;#configs;#height;#initialSyncPromise;constructor(providers,network){super(network);this.#configs=providers.map(p=>{if(p instanceof AbstractProvider){return Object.assign({provider:p},defaultConfig,defaultState)}else{return Object.assign({},defaultConfig,p,defaultState)}});this.#height=-2;this.#initialSyncPromise=null;this.quorum=2;this.eventQuorum=1;this.eventWorkers=1;assertArgument(this.quorum<=this.#configs.reduce((a,c)=>a+c.weight,0),"quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return this.#configs.map(c=>{const result=Object.assign({},c);for(const key in result){if(key[0]==="_"){delete result[key]}}return result})}async _detectNetwork(){return Network.from(getBigInt(await this._perform({method:"networkId"})))}async _translatePerform(provider,req){switch(req.method){case"broadcastTransaction":return await provider.broadcastTransaction(req.signedTransaction);case"call":return await provider.call(Object.assign({},req.transaction,{blockTag:req.blockTag}));case"networkId":return(await provider.getNetwork()).networkId;case"estimateEnergy":return await provider.estimateEnergy(req.transaction);case"getBalance":return await provider.getBalance(req.address,req.blockTag);case"getBlock":{const block="blockHash"in req?req.blockHash:req.blockTag;return await provider.getBlock(block,req.includeTransactions)}case"getBlockNumber":return await provider.getBlockNumber();case"getCode":return await provider.getCode(req.address,req.blockTag);case"getEnergyPrice":return(await provider.getFeeData()).energyPrice;case"getLogs":return await provider.getLogs(req.filter);case"getStorage":return await provider.getStorage(req.address,req.position,req.blockTag);case"getTransaction":return await provider.getTransaction(req.hash);case"getTransactionCount":return await provider.getTransactionCount(req.address,req.blockTag);case"getTransactionReceipt":return await provider.getTransactionReceipt(req.hash);case"getTransactionResult":return await provider.getTransactionResult(req.hash)}}#getNextConfig(running){const configs=Array.from(running).map(r=>r.config);const allConfigs=this.#configs.slice();shuffle(allConfigs);allConfigs.sort((a,b)=>b.priority-a.priority);for(const config of allConfigs){if(configs.indexOf(config)===-1){return config}}return null}#addRunner(running,req){const config=this.#getNextConfig(running);if(config==null){return null}const runner={config:config,result:null,didBump:false,perform:null,staller:null};const now=getTime();runner.perform=(async()=>{try{config.requests++;const result=await this._translatePerform(config.provider,req);runner.result={result:result}}catch(error){config.errorResponses++;runner.result={error:error}}const dt=getTime()-now;config._totalTime+=dt;config.rollingDuration=.95*config.rollingDuration+.05*dt;runner.perform=null})();runner.staller=(async()=>{await stall$2(config.stallTimeout);runner.staller=null})();running.add(runner);return runner}async#initialSync(){let initialSync=this.#initialSyncPromise;if(!initialSync){const promises=[];this.#configs.forEach(config=>{promises.push(waitForSync(config,0));promises.push((async()=>{config._network=await config.provider.getNetwork()})())});this.#initialSyncPromise=initialSync=(async()=>{await Promise.all(promises);let networkId=null;for(const config of this.#configs){const network=config._network;if(networkId==null){networkId=network.networkId}else if(network.networkId!==networkId){assert(false,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}}})()}await initialSync}async#checkQuorum(running,req){const results=[];for(const runner of running){if(runner.result!=null){const{tag,value}=normalizeResult(runner.result);results.push({tag:tag,value:value,weight:runner.config.weight})}}if(results.reduce((a,r)=>a+r.weight,0)({value:c.blockNumber,tag:getNumber(c.blockNumber).toString(),weight:c.weight})))))}const mode=getFuzzyMode(this.quorum,results);if(mode===undefined){return undefined}if(mode>this.#height){this.#height=mode}return this.#height}case"getEnergyPrice":case"estimateEnergy":return getMedian(this.quorum,results);case"getBlock":if("blockTag"in req&&req.blockTag==="pending"){return getAnyResult(this.quorum,results)}return checkQuorum(this.quorum,results);case"call":case"networkId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return checkQuorum(this.quorum,results);case"broadcastTransaction":return getAnyResult(this.quorum,results)}assert(false,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${stringify(req.method)})`})}async#waitForQuorum(running,req){if(running.size===0){throw new Error("no runners?!")}const interesting=[];let newRunners=0;for(const runner of running){if(runner.perform){interesting.push(runner.perform)}if(runner.staller){interesting.push(runner.staller);continue}if(runner.didBump){continue}runner.didBump=true;newRunners++}const value=await this.#checkQuorum(running,req);if(value!==undefined){if(value instanceof Error){throw value}return value}for(let i=0;i0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:Array.from(running).map(r=>stringify(r.result))}});await Promise.race(interesting);return await this.#waitForQuorum(running,req)}async _perform(req){if(req.method==="broadcastTransaction"){const results=await Promise.all(this.#configs.map(async({provider,weight})=>{try{const result=await provider._perform(req);return Object.assign(normalizeResult({result:result}),{weight:weight})}catch(error){return Object.assign(normalizeResult({error:error}),{weight:weight})}}));const result=getAnyResult(this.quorum,results);assert(result!==undefined,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:results.map(stringify)}});if(result instanceof Error){throw result}return result}await this.#initialSync();const running=new Set;for(let i=0;i{const payload={method:method,params:params};this.emit("debug",{action:"sendEip1193Request",payload:payload});try{const result=await core.request(payload);this.emit("debug",{action:"receiveEip1193Result",result:result});return result}catch(e){const error=new Error(e.message);error.code=e.code;error.data=e.data;error.payload=payload;this.emit("debug",{action:"receiveEip1193Error",error:error});throw error}}}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){assertArgument(!Array.isArray(payload),"EIP-1193 does not support batch request","payload",payload);try{const result=await this.#request(payload.method,payload.params||[]);return[{id:payload.id,result:result}]}catch(e){return[{id:payload.id,error:{code:e.code,data:e.data,message:e.message}}]}}getRpcError(payload,error){error=JSON.parse(JSON.stringify(error));switch(error.error.code||-1){case 4001:error.error.message=`corebc-user-denied: ${error.error.message}`;break;case 4200:error.error.message=`corebc-unsupported: ${error.error.message}`;break}return super.getRpcError(payload,error)}async hasSigner(address){if(address==null){address=0}const accounts=await this.send("xcb_accounts",[]);if(typeof address==="number"){return accounts.length>address}address=address.toLowerCase();return accounts.filter(a=>a.toLowerCase()===address).length!==0}async getSigner(address){if(address==null){address=0}if(!await this.hasSigner(address)){try{await this.#request("xcb_requestAccounts",[])}catch(error){const payload=error.payload;throw this.getRpcError(payload,{id:payload.id,error:error})}}return await super.getSigner(address)}}const defaultApplicationId="62e1ad51b37b8e00394bda3b";function getHost(name){switch(name){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}assertArgument(false,"unsupported network","network",name)}class PocketProvider extends JsonRpcProvider{applicationId;applicationSecret;constructor(_network,applicationId,applicationSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(applicationId==null){applicationId=defaultApplicationId}if(applicationSecret==null){applicationSecret=null}const options={staticNetwork:network};const request=PocketProvider.getRequest(network,applicationId,applicationSecret);super(request,network,options);defineProperties(this,{applicationId:applicationId,applicationSecret:applicationSecret})}_getProvider(networkId){try{return new PocketProvider(networkId,this.applicationId,this.applicationSecret)}catch(error){}return super._getProvider(networkId)}static getRequest(network,applicationId,applicationSecret){if(applicationId==null){applicationId=defaultApplicationId}const request=new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`);request.allowGzip=true;if(applicationSecret){request.setCredentials("",applicationSecret)}if(applicationId===defaultApplicationId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("PocketProvider");return true}}return request}isCommunityResource(){return this.applicationId===defaultApplicationId}}const IpcSocketProvider=undefined;class BaseWallet extends AbstractSigner{address;prefix;#signingKey;constructor({signingKey,prefix,provider}){super(provider);this.prefix=prefix;assertArgument(signingKey&&typeof signingKey.sign==="function","invalid signingKey key","signingKey","[ REDACTED ]");this.#signingKey=signingKey;const address=computeAddress(this.#signingKey,prefix);defineProperties(this,{address:address})}get signingKey(){return this.#signingKey}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(provider){return new BaseWallet({signingKey:this.#signingKey,prefix:this.prefix,provider:provider})}async signTransaction(tx){const{to,from}=await resolveProperties({to:tx.to||undefined,from:tx.from||undefined});if(to!=null){tx.to=to}if(from!=null){tx.from=from}if(tx.from!=null){assertArgument(getAddress(tx.from)===this.address,"transaction from address mismatch","tx.from",tx.from);delete tx.from}const btx=Transaction.from(tx);const unSignedSerialized=btx.unsignedSerialized;const unsignedHash=sha256(unSignedSerialized);btx.signature=this.signingKey.sign(unsignedHash);return btx.serialized}async signMessage(message){return this.signMessageSync(message)}signMessageSync(message){return this.signingKey.sign(hashMessage(message))}async signTypedData(domain,types,value){const populated=await TypedDataEncoder.resolveNames(domain,types,value,async name=>{assert(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:name}});const address=getAddress(name);assert(address!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:name});return address});return this.signingKey.sign(TypedDataEncoder.hash(populated.domain,types,populated.value))}}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}static check(wordlist){const words=[];for(let i=0;i<2048;i++){const word=wordlist.getWord(i);if(i!==wordlist.getWordIndex(word)){return"0x"}words.push(word)}return id(words.join("\n")+"\n")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n",true);if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value)}return output}function checkScalarValue(codePoint){if(codePoint>=55296&&codePoint<=57343){throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value")}}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint){if((codePoint&4294967168)==0){return stringFromCharCode(codePoint)}var symbol="";if((codePoint&4294965248)==0){symbol=stringFromCharCode(codePoint>>6&31|192)}else if((codePoint&4294901760)==0){checkScalarValue(codePoint);symbol=stringFromCharCode(codePoint>>12&15|224);symbol+=createByte(codePoint,6)}else if((codePoint&4292870144)==0){symbol=stringFromCharCode(codePoint>>18&7|240);symbol+=createByte(codePoint,12);symbol+=createByte(codePoint,6)}symbol+=stringFromCharCode(codePoint&63|128);return symbol}function utf8encode(string){var codePoints=ucs2decode(string);var length=codePoints.length;var index=-1;var codePoint;var byteString="";while(++index=byteCount){throw Error("Invalid byte index")}var continuationByte=byteArray[byteIndex]&255;byteIndex++;if((continuationByte&192)==128){return continuationByte&63}throw Error("Invalid continuation byte")}function decodeSymbol(){var byte1;var byte2;var byte3;var byte4;var codePoint;if(byteIndex>byteCount){throw Error("Invalid byte index")}if(byteIndex==byteCount){return false}byte1=byteArray[byteIndex]&255;byteIndex++;if((byte1&128)==0){return byte1}if((byte1&224)==192){byte2=readContinuationByte();codePoint=(byte1&31)<<6|byte2;if(codePoint>=128){return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&240)==224){byte2=readContinuationByte();byte3=readContinuationByte();codePoint=(byte1&15)<<12|byte2<<6|byte3;if(codePoint>=2048){checkScalarValue(codePoint);return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&248)==240){byte2=readContinuationByte();byte3=readContinuationByte();byte4=readContinuationByte();codePoint=(byte1&7)<<18|byte2<<12|byte3<<6|byte4;if(codePoint>=65536&&codePoint<=1114111){return codePoint}}throw Error("Invalid UTF-8 detected")}var byteArray;var byteCount;var byteIndex;function utf8decode(byteString){byteArray=ucs2decode(byteString);byteCount=byteArray.length;byteIndex=0;var codePoints=[];var tmp;while((tmp=decodeSymbol())!==false){codePoints.push(tmp)}return ucs2encode(codePoints)}root.version="3.0.0";root.encode=utf8encode;root.decode=utf8decode})(exports)})(utf8$1);return utf8$1}var utf8Exports=requireUtf8();var utf8=getDefaultExportFromCjs(utf8Exports);function mnemonicToSeed(mnemonic,password){if(!password){password=""}const t=generateSeed(mnemonic,password);return t.goldilock}const generateSeed=(mnemonic,password)=>{const goldilockSaltPrefix="mnemonic";const aesSaltPrefix="mnemonicfortheAESkey";const goldilockSalt=utf8.encode(goldilockSaltPrefix+password);const aesSalt=utf8.encode(aesSaltPrefix+password);const goldilockKey=pbkdf2Sync(bufferExports.Buffer.from(mnemonic),bufferExports.Buffer.from(goldilockSalt),2048,64,"sha512");const aesKeySeed=pbkdf2Sync(bufferExports.Buffer.from(mnemonic),bufferExports.Buffer.from(aesSalt),2048,64,"sha512");return{aes:bufferExports.Buffer.from(aesKeySeed).toString("hex"),goldilock:bufferExports.Buffer.from(goldilockKey).toString("hex")}};function getUpperMask(bits){return(1<=12&&words.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const entropy=new Uint8Array(Math.ceil(11*words.length/8));let offset=0;for(let i=0;i=0,`invalid mnemonic word at index ${i}`,"mnemonic","[ REDACTED ]");for(let bit=0;bit<11;bit++){if(index&1<<10-bit){entropy[offset>>3]|=1<<7-offset%8}offset++}}const entropyBits=32*words.length/3;const checksumBits=words.length/3;const checksumMask=getUpperMask(checksumBits);const checksum=getBytes(legacySha256(entropy.slice(0,entropyBits/8)))[0]&checksumMask;assertArgument(checksum===(entropy[entropy.length-1]&checksumMask),"invalid mnemonic checksum","mnemonic","[ REDACTED ]");return hexlify(entropy.slice(0,entropyBits/8))}function entropyToMnemonic(entropy,wordlist){assertArgument(entropy.length%4===0&&entropy.length>=16&&entropy.length<=32,"invalid entropy size","entropy","[ REDACTED ]");if(wordlist==null){wordlist=LangEn.wordlist()}const indices=[0];let remainingBits=11;for(let i=0;i8){indices[indices.length-1]<<=8;indices[indices.length-1]|=entropy[i];remainingBits-=8}else{indices[indices.length-1]<<=remainingBits;indices[indices.length-1]|=entropy[i]>>8-remainingBits;indices.push(entropy[i]&getLowerMask(8-remainingBits));remainingBits+=3}}const checksumBits=entropy.length/4;const checksum=parseInt(legacySha256(entropy).substring(2,4),16)&getUpperMask(checksumBits);indices[indices.length-1]<<=checksumBits;indices[indices.length-1]|=checksum>>8-checksumBits;return wordlist.join(indices.map(index=>wordlist.getWord(index)))}const _guard$1={};class Mnemonic{phrase;password;wordlist;entropy;constructor(guard,entropy,phrase,password,wordlist){if(password==null){password=""}if(wordlist==null){wordlist=LangEn.wordlist()}assertPrivate(guard,_guard$1,"Mnemonic");defineProperties(this,{phrase:phrase,password:password,wordlist:wordlist,entropy:entropy})}computeSeed(){return mnemonicToSeed(this.phrase,this.password)}static fromPhrase({phrase,password,wordlist}){const entropy=mnemonicToEntropy(phrase,wordlist);phrase=entropyToMnemonic(getBytes(entropy),wordlist);return new Mnemonic(_guard$1,entropy,phrase,password,wordlist)}static fromEntropy(_entropy,password,wordlist){const entropy=getBytes(_entropy,"entropy");const phrase=entropyToMnemonic(entropy,wordlist);return new Mnemonic(_guard$1,hexlify(entropy),phrase,password,wordlist)}static entropyToPhrase(_entropy,wordlist){const entropy=getBytes(_entropy,"entropy");return entropyToMnemonic(entropy,wordlist)}static phraseToEntropy(phrase,wordlist){return mnemonicToEntropy(phrase,wordlist)}static isValidMnemonic(phrase,wordlist){try{mnemonicToEntropy(phrase,wordlist);return true}catch(error){}return false}}var aesJs={exports:{}};var hasRequiredAesJs;function requireAesJs(){if(hasRequiredAesJs)return aesJs.exports;hasRequiredAesJs=1;(function(module,exports){(function(root){function checkInt(value){return parseInt(value)===value}function checkInts(arrayish){if(!checkInt(arrayish.length)){return false}for(var i=0;i255){return false}}return true}function coerceArray(arg,copy){if(arg.buffer&&arg.name==="Uint8Array"){if(copy){if(arg.slice){arg=arg.slice()}else{arg=Array.prototype.slice.call(arg)}}return arg}if(Array.isArray(arg)){if(!checkInts(arg)){throw new Error("Array contains invalid value: "+arg)}return new Uint8Array(arg)}if(checkInt(arg.length)&&checkInts(arg)){return new Uint8Array(arg)}throw new Error("unsupported array-like object")}function createArray(length){return new Uint8Array(length)}function copyArray(sourceArray,targetArray,targetStart,sourceStart,sourceEnd){if(sourceStart!=null||sourceEnd!=null){if(sourceArray.slice){sourceArray=sourceArray.slice(sourceStart,sourceEnd)}else{sourceArray=Array.prototype.slice.call(sourceArray,sourceStart,sourceEnd)}}targetArray.set(sourceArray,targetStart)}var convertUtf8=function(){function toBytes(text){var result=[],i=0;text=encodeURI(text);while(i191&&c<224){result.push(String.fromCharCode((c&31)<<6|bytes[i+1]&63));i+=2}else{result.push(String.fromCharCode((c&15)<<12|(bytes[i+1]&63)<<6|bytes[i+2]&63));i+=3}}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var convertHex=function(){function toBytes(text){var result=[];for(var i=0;i>4]+Hex[v&15])}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var numberOfRounds={16:10,24:12,32:14};var rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];var S=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];var Si=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];var T1=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986];var T2=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766];var T3=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126];var T4=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436];var T5=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890];var T6=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935];var T7=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600];var T8=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480];var U1=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795];var U2=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855];var U3=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150];var U4=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(bytes){var result=[];for(var i=0;i>2;this._Ke[index][i%4]=tk[i];this._Kd[rounds-index][i%4]=tk[i]}var rconpointer=0;var t=KC,tt;while(t>16&255]<<24^S[tt>>8&255]<<16^S[tt&255]<<8^S[tt>>24&255]^rcon[rconpointer]<<24;rconpointer+=1;if(KC!=8){for(var i=1;i>8&255]<<8^S[tt>>16&255]<<16^S[tt>>24&255]<<24;for(var i=KC/2+1;i>2;c=t%4;this._Ke[r][c]=tk[i];this._Kd[rounds-r][c]=tk[i++];t++}}for(var r=1;r>24&255]^U2[tt>>16&255]^U3[tt>>8&255]^U4[tt&255]}}};AES.prototype.encrypt=function(plaintext){if(plaintext.length!=16){throw new Error("invalid plaintext size (must be 16 bytes)")}var rounds=this._Ke.length-1;var a=[0,0,0,0];var t=convertToInt32(plaintext);for(var i=0;i<4;i++){t[i]^=this._Ke[0][i]}for(var r=1;r>24&255]^T2[t[(i+1)%4]>>16&255]^T3[t[(i+2)%4]>>8&255]^T4[t[(i+3)%4]&255]^this._Ke[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Ke[rounds][i];result[4*i]=(S[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(S[t[(i+1)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(S[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(S[t[(i+3)%4]&255]^tt)&255}return result};AES.prototype.decrypt=function(ciphertext){if(ciphertext.length!=16){throw new Error("invalid ciphertext size (must be 16 bytes)")}var rounds=this._Kd.length-1;var a=[0,0,0,0];var t=convertToInt32(ciphertext);for(var i=0;i<4;i++){t[i]^=this._Kd[0][i]}for(var r=1;r>24&255]^T6[t[(i+3)%4]>>16&255]^T7[t[(i+2)%4]>>8&255]^T8[t[(i+1)%4]&255]^this._Kd[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Kd[rounds][i];result[4*i]=(Si[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(Si[t[(i+3)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(Si[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(Si[t[(i+1)%4]&255]^tt)&255}return result};var ModeOfOperationECB=function(key){if(!(this instanceof ModeOfOperationECB)){throw Error("AES must be instanitated with `new`")}this.description="Electronic Code Block";this.name="ecb";this._aes=new AES(key)};ModeOfOperationECB.prototype.encrypt=function(plaintext){plaintext=coerceArray(plaintext);if(plaintext.length%16!==0){throw new Error("invalid plaintext size (must be multiple of 16 bytes)")}var ciphertext=createArray(plaintext.length);var block=createArray(16);for(var i=0;iNumber.MAX_SAFE_INTEGER){throw new Error("integer value out of safe range")}for(var index=15;index>=0;--index){this._counter[index]=value%256;value=parseInt(value/256)}};Counter.prototype.setBytes=function(bytes){bytes=coerceArray(bytes,true);if(bytes.length!=16){throw new Error("invalid counter bytes size (must be 16 bytes)")}this._counter=bytes};Counter.prototype.increment=function(){for(var i=15;i>=0;i--){if(this._counter[i]===255){this._counter[i]=0}else{this._counter[i]++;break}}};var ModeOfOperationCTR=function(key,counter){if(!(this instanceof ModeOfOperationCTR)){throw Error("AES must be instanitated with `new`")}this.description="Counter";this.name="ctr";if(!(counter instanceof Counter)){counter=new Counter(counter)}this._counter=counter;this._remainingCounter=null;this._remainingCounterIndex=16;this._aes=new AES(key)};ModeOfOperationCTR.prototype.encrypt=function(plaintext){var encrypted=coerceArray(plaintext,true);for(var i=0;i16){throw new Error("PKCS#7 padding byte out of range")}var length=data.length-padder;for(var i=0;i1&&N<=1048576&&(N&N-1)===0,"unsafe scrypt N","kdf.N",N);assertArgument(Number.isSafeInteger(r)&&Number.isSafeInteger(p)&&r>0&&p>0&&r*p<=1048576&&128*N*r<=256*1024*1024,"unsafe scrypt work or memory requirement","kdf",{N:N,r:r,p:p})}function getDecryptKdfParams(data){const kdf=spelunk(data,"crypto.kdf:string");if(kdf&&typeof kdf==="string"){if(kdf.toLowerCase()==="scrypt"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const N=spelunk(data,"crypto.kdfparams.n:int!");const r=spelunk(data,"crypto.kdfparams.r:int!");const p=spelunk(data,"crypto.kdfparams.p:int!");validateScrypt(N,r,p);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dflen",dkLen);return{name:"scrypt",salt:salt,N:N,r:r,p:p,dkLen:64}}else if(kdf.toLowerCase()==="pbkdf2"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const prf=spelunk(data,"crypto.kdfparams.prf:string!");const algorithm=prf.split("-").pop();assertArgument(prf==="hmac-sha256"||prf==="hmac-sha512","invalid kdf.pdf","kdf.pdf",prf);const count=spelunk(data,"crypto.kdfparams.c:int!");assertArgument(Number.isSafeInteger(count)&&count>0&&count<=1e7,"unsafe PBKDF2 iteration count","kdf.c",count);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dklen",dkLen);return{name:"pbkdf2",salt:salt,count:count,dkLen:dkLen,algorithm:algorithm}}}assertArgument(false,"unsupported key-derivation function","kdf",kdf)}function decryptKeystoreJsonSync(json,_password){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=scryptSync(password,salt,N,r,p,dkLen);return getAccount(data,key)}function stall$1(duration){return new Promise(resolve=>{setTimeout(()=>{resolve()},duration)})}async function decryptKeystoreJson(json,_password,progress){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){if(progress){progress(0);await stall$1(0)}const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);if(progress){progress(1);await stall$1(0)}return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=await scrypt(password,salt,N,r,p,dkLen,progress);return getAccount(data,key)}function getEncryptKdfParams(options){const salt=options.salt!=null?getBytes(options.salt,"options.salt"):randomBytes(32);let N=1<<17,r=8,p=1;if(options.scrypt){if(options.scrypt.N!=null){N=options.scrypt.N}if(options.scrypt.r!=null){r=options.scrypt.r}if(options.scrypt.p!=null){p=options.scrypt.p}}validateScrypt(N,r,p);return{name:"scrypt",dkLen:32,salt:salt,N:N,r:r,p:p}}function _encryptKeystore(key,kdf,account,options){const privateKey=getBytes(account.privateKey,"privateKey");const iv=options.iv!=null?getBytes(options.iv,"options.iv"):randomBytes(16);assertArgument(iv.length===16,"invalid options.iv length","options.iv",options.iv);const uuidRandom=options.uuid!=null?getBytes(options.uuid,"options.uuid"):randomBytes(16);assertArgument(uuidRandom.length===16,"invalid options.uuid length","options.uuid",options.iv);const derivedKey=key.slice(0,16);const macPrefix=key.slice(16,32);const aesCtr=new CTR(derivedKey,new Counter(iv));const ciphertext=getBytes(aesCtr.encrypt(privateKey));const mac=sha256(concat([macPrefix,ciphertext]));const data={address:account.address.substring(2).toLowerCase(),id:uuidV4(uuidRandom),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(iv).substring(2)},ciphertext:hexlify(ciphertext).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify(kdf.salt).substring(2),n:kdf.N,dklen:32,p:kdf.p,r:kdf.r},mac:mac.substring(2)}};if(account.mnemonic){const client=options.client!=null?options.client:`corebc/${version}`;const path=account.mnemonic.path||defaultPath$1;const locale=account.mnemonic.locale||"en";const mnemonicKey=key.slice(32,64);const entropy=getBytes(account.mnemonic.entropy,"account.mnemonic.entropy");const mnemonicIv=randomBytes(16);const mnemonicAesCtr=new CTR(mnemonicKey,new Counter(mnemonicIv));const mnemonicCiphertext=getBytes(mnemonicAesCtr.encrypt(entropy));const now=new Date;const timestamp=now.getUTCFullYear()+"-"+zpad(now.getUTCMonth()+1,2)+"-"+zpad(now.getUTCDate(),2)+"T"+zpad(now.getUTCHours(),2)+"-"+zpad(now.getUTCMinutes(),2)+"-"+zpad(now.getUTCSeconds(),2)+".0Z";const gethFilename="UTC--"+timestamp+"--"+data.address;data["x-corebc"]={client:client,gethFilename:gethFilename,path:path,locale:locale,mnemonicCounter:hexlify(mnemonicIv).substring(2),mnemonicCiphertext:hexlify(mnemonicCiphertext).substring(2),version:"0.1"}}return JSON.stringify(data)}function encryptKeystoreJsonSync(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=scryptSync(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64);return _encryptKeystore(getBytes(key),kdf,account,options)}async function encryptKeystoreJson(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=await scrypt(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64,options.progressCallback);return _encryptKeystore(getBytes(key),kdf,account,options)}const defaultPath="m";const HardenedBit=2147483648;const _guard={};function derivePath(node,path){const components=path.split("/");assertArgument(components.length>0&&(components[0]==="m"||node.depth>0),"invalid path","path",path);if(components[0]==="m"){components.shift()}let result=node;for(let i=0;i=0&&index=0&&index{setTimeout(()=>{resolve()},duration)})}class Wallet extends BaseWallet{constructor({key,prefix,provider}){if(typeof key==="string"&&!key.startsWith("0x")){key="0x"+key}let signingKey=typeof key==="string"?new SigningKey(key):key;super({signingKey:signingKey,prefix:prefix,provider:provider})}connect(provider){return new Wallet({key:this.signingKey,prefix:this.prefix,provider:provider})}async encrypt(password,progressCallback){const account={address:this.address,privateKey:this.privateKey};return await encryptKeystoreJson(account,password,{progressCallback:progressCallback})}encryptSync(password){const account={address:this.address,privateKey:this.privateKey};return encryptKeystoreJsonSync(account,password)}static#fromAccount(account){assertArgument(account,"invalid JSON wallet","json","[ REDACTED ]");const address=account.address;const prefix=extractPrefix(address);if("mnemonic"in account&&account.mnemonic&&account.mnemonic.locale==="en"){const mnemonic=Mnemonic.fromEntropy(account.mnemonic.entropy);const wallet=HDNodeWallet.fromMnemonic(mnemonic,prefix,account.mnemonic.path);if(wallet.address===account.address&&wallet.privateKey===account.privateKey){return wallet}console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const wallet=new Wallet({key:account.privateKey,prefix:prefix});assertArgument(wallet.address===account.address,"address/privateKey mismatch","json","[ REDACTED ]");return wallet}static async fromEncryptedJson(json,password,progress){let account=null;if(isKeystoreJson(json)){account=await decryptKeystoreJson(json,password,progress)}else if(isCrowdsaleJson(json)){if(progress){progress(0);await stall(0)}account=decryptCrowdsaleJson(json,password);if(progress){progress(1);await stall(0)}}return Wallet.#fromAccount(account)}static fromEncryptedJsonSync(json,password){let account=null;if(isKeystoreJson(json)){account=decryptKeystoreJsonSync(json,password)}else if(isCrowdsaleJson(json)){account=decryptCrowdsaleJson(json,password)}else{assertArgument(false,"invalid JSON wallet","json","[ REDACTED ]")}return Wallet.#fromAccount(account)}static createRandom(prefix,provider){const wallet=HDNodeWallet.createRandom(prefix,undefined,undefined,undefined);if(provider){return wallet.connect(provider)}return wallet}static fromPhrase({phrase,prefix,provider,password}){const wallet=HDNodeWallet.fromPhrase({phrase:phrase,prefix:prefix,password:password});if(provider){return wallet.connect(provider)}return wallet}static fromSeed({seed,prefix,provider,path}){const wallet=HDNodeWallet.fromSeed({seed:seed,prefix:prefix,path:path||defaultPath});if(provider){return wallet.connect(provider)}return wallet}}const Base64=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function decodeBits(width,data){const maxValue=(1<=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const wordlists={en:LangEn.wordlist()};const customUnitAbi=Object.freeze(["function supportsUnit(string unit) view returns (bool)","function supportedUnits() view returns (string[])","function preferredUnit() view returns (string)","function balanceOf(address account) view returns (uint256)","function balanceOfUnit(address account, string unit) view returns (uint256)"]);class CustomUnitDiscovery{preferredUnit;supportedUnits;constructor(units,preferredUnit){this.preferredUnit=preferredUnit;this.supportedUnits=Object.freeze([...units])}get isValid(){return this.supports("units")&&this.preferredUnit!==""&&this.supports(this.preferredUnit)}supports(unit){return this.supportedUnits.includes(unit)}}class CustomUnitBalance{canonicalAmount;unitAmount;unit;constructor(canonicalAmount,unitAmount,unit){this.canonicalAmount=canonicalAmount;this.unitAmount=unitAmount;this.unit=unit}get multiplierNumerator(){return this.unitAmount}get multiplierDenominator(){return this.canonicalAmount}}class CustomUnitToken{contract;constructor(address,runner){this.contract=new Contract(address,customUnitAbi,runner)}async supportsUnit(unit,blockTag){return unit.trim()!==""&&await this.contract.supportsUnit(unit.trim(),{blockTag:blockTag})}async supportedUnits(blockTag){return Object.freeze(Array.from(await this.contract.supportedUnits({blockTag:blockTag})))}async preferredUnit(blockTag){return(await this.contract.preferredUnit({blockTag:blockTag})).trim()}async discover(blockTag){if(!await this.supportsUnit("units",blockTag))return null;const discovery=new CustomUnitDiscovery(await this.supportedUnits(blockTag),await this.preferredUnit(blockTag));return discovery.isValid?discovery:null}canonicalBalance(account,blockTag){return this.contract.balanceOf(account,{blockTag:blockTag})}balanceOfUnit(account,unit,blockTag){if(!unit.trim())throw new TypeError("unit must not be empty");return this.contract.balanceOfUnit(account,unit.trim(),{blockTag:blockTag})}async balance(account,unit,blockTag){const resolved=unit?.trim()||await this.preferredUnit(blockTag);const[canonical,calculated]=await Promise.all([this.canonicalBalance(account,blockTag),this.balanceOfUnit(account,resolved,blockTag)]);return new CustomUnitBalance(canonical,calculated,resolved)}}const cip150Abi=Object.freeze(["function getMetadataValue(string key) view returns (string value)","function hasMetadataKey(string key) view returns (bool exists)","function isMetadataSealed(string key) view returns (bool sealed)","function listMetadataKeys() view returns (string[] keys)","function getMetadataByIndex(uint256 index) view returns (string key, string value)","function metadataCount() view returns (uint256 total)","function setMetadataValue(string key, string value)","function sealMetadataKey(string key)"]);const cip151TokenExpirationKey="tokenExpiration";const cip151TradingStopKey="tradingStop";const cip152LabKey="lab";class Cip151Lifecycle{tokenExpiration;tradingStop;constructor(metadata={}){const parse=key=>{const value=metadata[key];if(value==null||value==="")return null;if(!/^\d+$/.test(value))throw new TypeError(`${key} must be a non-negative Unix timestamp`);return BigInt(value)};this.tokenExpiration=parse(cip151TokenExpirationKey);this.tradingStop=parse(cip151TradingStopKey)}isExpiredAt(seconds){return this.tokenExpiration!==null&&seconds>=this.tokenExpiration}isTradingStoppedAt(seconds){return this.tradingStop!==null&&seconds>=this.tradingStop}}class Cip152LabCertificate{measurements;constructor(json){if(json===null||typeof json!=="object"||Array.isArray(json))throw new TypeError("CIP-152 lab.json must be an object");const measurements=Object.create(null);for(const[key,property]of Object.entries(json)){if(!property||typeof property!=="object"||Array.isArray(property)||!Object.hasOwn(property,"value"))throw new TypeError(`CIP-152 property ${key} must contain a value`);const{value,unit}=property;if(!(typeof value==="string"||typeof value==="number"&&Number.isFinite(value)))throw new TypeError(`CIP-152 property ${key} has an invalid value`);if(unit!=null&&typeof unit!=="string")throw new TypeError(`CIP-152 property ${key} has an invalid unit`);measurements[key]=Object.freeze(unit==null?{value:value}:{value:value,unit:unit})}this.measurements=Object.freeze(measurements)}}class Cip150MetadataContract{contract;constructor(address,runner){this.contract=new Contract(address,cip150Abi,runner)}getValue(key,blockTag){return this.contract.getMetadataValue(key,{blockTag:blockTag})}hasKey(key,blockTag){return this.contract.hasMetadataKey(key,{blockTag:blockTag})}isSealed(key,blockTag){return this.contract.isMetadataSealed(key,{blockTag:blockTag})}async listKeys(blockTag){return Object.freeze(Array.from(await this.contract.listMetadataKeys({blockTag:blockTag})))}async getByIndex(index,blockTag){const[key,value]=await this.contract.getMetadataByIndex(index,{blockTag:blockTag});return Object.freeze({key:key,value:value})}count(blockTag){return this.contract.metadataCount({blockTag:blockTag})}async readAll(blockTag,includeSealedState=true){const entries=[];for(const key of await this.listKeys(blockTag)){const value=await this.getValue(key,blockTag);entries.push(Object.freeze(includeSealedState?{key:key,value:value,sealed:await this.isSealed(key,blockTag)}:{key:key,value:value}))}return Object.freeze(entries)}setValue(key,value,overrides={}){return this.contract.setMetadataValue(key,value,overrides)}sealKey(key,overrides={}){return this.contract.sealMetadataKey(key,overrides)}async readLifecycle(blockTag){const metadata={};for(const key of[cip151TokenExpirationKey,cip151TradingStopKey]){if(await this.hasKey(key,blockTag))metadata[key]=await this.getValue(key,blockTag)}return new Cip151Lifecycle(metadata)}async readLabCertificate(gateway,blockTag){if(!await this.hasKey(cip152LabKey,blockTag))return null;const reference=await this.getValue(cip152LabKey,blockTag);if(!gateway.resolve(reference).pathname.endsWith("/lab.json"))throw new TypeError("CIP-152 reference must point to lab.json");return new Cip152LabCertificate(await gateway.readJson(reference))}}const defaultIpfsGatewayTemplate="https://ipf.sk/{cid}";class IpfsGateway{template;maxResponseBytes;timeoutMs;#fetch;constructor(options={}){this.template=options.template??defaultIpfsGatewayTemplate;this.maxResponseBytes=options.maxResponseBytes??1024*1024;this.timeoutMs=options.timeoutMs??3e4;this.#fetch=options.fetch??globalThis.fetch;const templateUrl=new URL(this.template.replace("{cid}","cid"));if(!/^https?:$/.test(templateUrl.protocol)||this.template.split("{cid}").length!==2)throw new TypeError("gateway template must be HTTP(S) and contain one {cid}");for(const value of[this.maxResponseBytes,this.timeoutMs])if(!Number.isSafeInteger(value)||value<=0)throw new TypeError("gateway limits must be positive safe integers")}resolve(reference){const value=reference.trim();if(/^https?:\/\//i.test(value))return new URL(value);const path=value.replace(/^ipfs:\/\//,"").replace(/^\/?ipfs\//,"");if(!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path)||path.split("/").some(part=>part==="."||part===".."))throw new TypeError("invalid IPFS reference");return new URL(this.template.replace("{cid}",path.split("/").map(encodeURIComponent).join("/")))}async readJson(reference){const controller=new AbortController;const timer=setTimeout(()=>controller.abort(),this.timeoutMs);let reader;try{const response=await this.#fetch(this.resolve(reference),{headers:{accept:"application/json"},signal:controller.signal});if(!response.ok){await response.body?.cancel();throw new Error(`IPFS gateway returned HTTP ${response.status}`)}if(!response.body)throw new Error("IPFS gateway returned an empty body");reader=response.body.getReader();const chunks=[];let length=0;while(true){const{done,value}=await reader.read();if(done)break;length+=value.length;if(length>this.maxResponseBytes)throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);chunks.push(value)}const bytes=new Uint8Array(length);let offset=0;for(const chunk of chunks){bytes.set(chunk,offset);offset+=chunk.length}return JSON.parse(new TextDecoder("utf-8",{fatal:true}).decode(bytes))}finally{clearTimeout(timer);await reader?.cancel().catch(()=>{});reader?.releaseLock()}}}var corebc=Object.freeze({__proto__:null,AbiCoder:AbiCoder,AbstractProvider:AbstractProvider,AbstractSigner:AbstractSigner,AlchemyProvider:AlchemyProvider,AnkrProvider:AnkrProvider,BaseContract:BaseContract,BaseWallet:BaseWallet,BigNumber:BigNumber,Block:Block,BrowserProvider:BrowserProvider,Cip150MetadataContract:Cip150MetadataContract,Cip151Lifecycle:Cip151Lifecycle,Cip152LabCertificate:Cip152LabCertificate,CloudflareProvider:CloudflareProvider,ConstructorFragment:ConstructorFragment,Contract:Contract,ContractEventPayload:ContractEventPayload,ContractFactory:ContractFactory,ContractTransactionReceipt:ContractTransactionReceipt,ContractTransactionResponse:ContractTransactionResponse,ContractUnknownEventPayload:ContractUnknownEventPayload,CoreSymbol:CoreSymbol,CustomUnitBalance:CustomUnitBalance,CustomUnitDiscovery:CustomUnitDiscovery,CustomUnitToken:CustomUnitToken,Ed448Goldilock:Ed448Goldilock,EnergyCostPlugin:EnergyCostPlugin,ErrorDescription:ErrorDescription,ErrorFragment:ErrorFragment,EventFragment:EventFragment,EventLog:EventLog,EventPayload:EventPayload,FallbackFragment:FallbackFragment,FallbackProvider:FallbackProvider,FeeData:FeeData,FeeDataNetworkPlugin:FeeDataNetworkPlugin,FetchCancelSignal:FetchCancelSignal,FetchRequest:FetchRequest,FetchResponse:FetchResponse,FixedNumber:FixedNumber,Fragment:Fragment,FunctionFragment:FunctionFragment,HDNodeWallet:HDNodeWallet,Indexed:Indexed,InfuraProvider:InfuraProvider,InfuraWebSocketProvider:InfuraWebSocketProvider,Interface:Interface,IpcSocketProvider:IpcSocketProvider,IpfsGateway:IpfsGateway,JsonRpcApiProvider:JsonRpcApiProvider,JsonRpcProvider:JsonRpcProvider,JsonRpcSigner:JsonRpcSigner,LangEn:LangEn,Log:Log,LogDescription:LogDescription,MaxInt256:MaxInt256,MaxUint256:MaxUint256,MessagePrefix:MessagePrefix,MinInt256:MinInt256,Mnemonic:Mnemonic,N:N,NamedFragment:NamedFragment,Network:Network,NetworkPlugin:NetworkPlugin,NonceManager:NonceManager,OrePerXCB:OrePerXCB,ParamType:ParamType,PocketProvider:PocketProvider,QuickNodeProvider:QuickNodeProvider,Result:Result,Signature:Signature,SigningKey:SigningKey,SocketBlockSubscriber:SocketBlockSubscriber,SocketEventSubscriber:SocketEventSubscriber,SocketPendingSubscriber:SocketPendingSubscriber,SocketProvider:SocketProvider,SocketSubscriber:SocketSubscriber,StructFragment:StructFragment,Transaction:Transaction,TransactionDescription:TransactionDescription,TransactionReceipt:TransactionReceipt,TransactionResponse:TransactionResponse,Typed:Typed,TypedDataEncoder:TypedDataEncoder,UnmanagedSubscriber:UnmanagedSubscriber,Utf8ErrorFuncs:Utf8ErrorFuncs,VoidSigner:VoidSigner,Wallet:Wallet,WebSocketProvider:WebSocketProvider,Wordlist:Wordlist,WordlistOwl:WordlistOwl,WordlistOwlA:WordlistOwlA,ZeroAddress:ZeroAddress,ZeroHash:ZeroHash,accessListify:accessListify,arrayify:arrayify,assert:assert,assertArgument:assertArgument,assertArgumentCount:assertArgumentCount,assertNormalize:assertNormalize,assertPrivate:assertPrivate,checkResultErrors:checkResultErrors,cip150Abi:cip150Abi,cip151TokenExpirationKey:cip151TokenExpirationKey,cip151TradingStopKey:cip151TradingStopKey,cip152LabKey:cip152LabKey,computeAddress:computeAddress,computeHmac:computeHmac,concat:concat,copyRequest:copyRequest,customUnitAbi:customUnitAbi,dataLength:dataLength,dataSlice:dataSlice,decodeBase58:decodeBase58,decodeBase64:decodeBase64,decodeBytes32String:decodeBytes32String,decodeRlp:decodeRlp,decryptCrowdsaleJson:decryptCrowdsaleJson,decryptKeystoreJson:decryptKeystoreJson,decryptKeystoreJsonSync:decryptKeystoreJsonSync,defaultIpfsGatewayTemplate:defaultIpfsGatewayTemplate,defaultPath:defaultPath,defineProperties:defineProperties,encodeBase58:encodeBase58,encodeBase64:encodeBase64,encodeBytes32String:encodeBytes32String,encodeRlp:encodeRlp,encryptKeystoreJson:encryptKeystoreJson,encryptKeystoreJsonSync:encryptKeystoreJsonSync,formatUnits:formatUnits,formatXCB:formatXCB,fromTwos:fromTwos,getAccountPath:getAccountPath,getAddress:getAddress,getBigInt:getBigInt,getBytes:getBytes,getBytesCopy:getBytesCopy,getCreate2Address:getCreate2Address,getCreateAddress:getCreateAddress,getDefaultProvider:getDefaultProvider,getIndexedAccountPath:getIndexedAccountPath,getNumber:getNumber,getUint:getUint,hashMessage:hashMessage,hexConcat:hexConcat,hexlify:hexlify,id:id,isAddress:isAddress,isAddressable:isAddressable,isBytesLike:isBytesLike,isCallException:isCallException,isCrowdsaleJson:isCrowdsaleJson,isError:isError,isHexString:isHexString,isKeystoreJson:isKeystoreJson,keccak256:keccak256,lock:lock,makeError:makeError,mask:mask,networkIdToPrefix:networkIdToPrefix,parseUnits:parseUnits,parseXCB:parseXCB,pbkdf2:pbkdf2,publicToAddress:publicToAddress,randomBytes:randomBytes,recoverAddress:recoverAddress,resolveAddress:resolveAddress,resolveProperties:resolveProperties,ripemd160:ripemd160,scrypt:scrypt,scryptSync:scryptSync,sha256:sha256,sha512:sha512,showThrottleMessage:showThrottleMessage,solidityPacked:solidityPacked,solidityPackedSha256:solidityPackedSha256,stripZerosLeft:stripZerosLeft,toBeArray:toBeArray,toBeHex:toBeHex,toBigInt:toBigInt,toNumber:toNumber,toQuantity:toQuantity,toTwos:toTwos,toUtf8Bytes:toUtf8Bytes,toUtf8CodePoints:toUtf8CodePoints,toUtf8String:toUtf8String,uuidV4:uuidV4,verifyMessage:verifyMessage,verifyTypedData:verifyTypedData,version:version,wordlists:wordlists,zeroPadBytes:zeroPadBytes,zeroPadValue:zeroPadValue});var Buffer=bufferExports.Buffer;export{AbiCoder,AbstractProvider,AbstractSigner,AlchemyProvider,AnkrProvider,BaseContract,BaseWallet,BigNumber,Block,BrowserProvider,Buffer,Cip150MetadataContract,Cip151Lifecycle,Cip152LabCertificate,CloudflareProvider,ConstructorFragment,Contract,ContractEventPayload,ContractFactory,ContractTransactionReceipt,ContractTransactionResponse,ContractUnknownEventPayload,CoreSymbol,CustomUnitBalance,CustomUnitDiscovery,CustomUnitToken,Ed448Goldilock,EnergyCostPlugin,ErrorDescription,ErrorFragment,EventFragment,EventLog,EventPayload,FallbackFragment,FallbackProvider,FeeData,FeeDataNetworkPlugin,FetchCancelSignal,FetchRequest,FetchResponse,FixedNumber,Fragment,FunctionFragment,HDNodeWallet,Indexed,InfuraProvider,InfuraWebSocketProvider,Interface,IpcSocketProvider,IpfsGateway,JsonRpcApiProvider,JsonRpcProvider,JsonRpcSigner,LangEn,Log,LogDescription,MaxInt256,MaxUint256,MessagePrefix,MinInt256,Mnemonic,N,NamedFragment,Network,NetworkPlugin,NonceManager,OrePerXCB,ParamType,PocketProvider,QuickNodeProvider,Result,Signature,SigningKey,SocketBlockSubscriber,SocketEventSubscriber,SocketPendingSubscriber,SocketProvider,SocketSubscriber,StructFragment,Transaction,TransactionDescription,TransactionReceipt,TransactionResponse,Typed,TypedDataEncoder,UnmanagedSubscriber,Utf8ErrorFuncs,VoidSigner,Wallet,WebSocketProvider,Wordlist,WordlistOwl,WordlistOwlA,ZeroAddress,ZeroHash,accessListify,arrayify,assert,assertArgument,assertArgumentCount,assertNormalize,assertPrivate,checkResultErrors,cip150Abi,cip151TokenExpirationKey,cip151TradingStopKey,cip152LabKey,computeAddress,computeHmac,concat,copyRequest,corebc,customUnitAbi,dataLength,dataSlice,decodeBase58,decodeBase64,decodeBytes32String,decodeRlp,decryptCrowdsaleJson,decryptKeystoreJson,decryptKeystoreJsonSync,defaultIpfsGatewayTemplate,defaultPath,defineProperties,encodeBase58,encodeBase64,encodeBytes32String,encodeRlp,encryptKeystoreJson,encryptKeystoreJsonSync,formatUnits,formatXCB,fromTwos,getAccountPath,getAddress,getBigInt,getBytes,getBytesCopy,getCreate2Address,getCreateAddress,getDefaultProvider,getIndexedAccountPath,getNumber,getUint,hashMessage,hexConcat,hexlify,id,isAddress,isAddressable,isBytesLike,isCallException,isCrowdsaleJson,isError,isHexString,isKeystoreJson,keccak256,lock,makeError,mask,networkIdToPrefix,parseUnits,parseXCB,pbkdf2,publicToAddress,randomBytes,recoverAddress,resolveAddress,resolveProperties,ripemd160,scrypt,scryptSync,sha256,sha512,showThrottleMessage,solidityPacked,solidityPackedSha256,stripZerosLeft,toBeArray,toBeHex,toBigInt,toNumber,toQuantity,toTwos,toUtf8Bytes,toUtf8CodePoints,toUtf8String,uuidV4,verifyMessage,verifyTypedData,version,wordlists,zeroPadBytes,zeroPadValue}; \ No newline at end of file diff --git a/dist/corebc.umd.js b/dist/corebc.umd.js deleted file mode 100644 index 97c11736c..000000000 --- a/dist/corebc.umd.js +++ /dev/null @@ -1,46361 +0,0 @@ -const __$G = (typeof globalThis !== 'undefined' ? globalThis: typeof window !== 'undefined' ? window: typeof global !== 'undefined' ? global: typeof self !== 'undefined' ? self: {}); -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : - typeof define === 'function' && define.amd ? define(['exports'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.corebc = {})); -})(this, (function (exports) { 'use strict'; - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; - } - - function getAugmentedNamespace(n) { - if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n; - var f = n.default; - if (typeof f == "function") { - var a = function a () { - var isInstance = false; - try { - isInstance = this instanceof a; - } catch (e) {} - if (isInstance) { - return Reflect.construct(f, arguments, this.constructor); - } - return f.apply(this, arguments); - }; - a.prototype = f.prototype; - } else a = {}; - Object.defineProperty(a, '__esModule', {value: true}); - Object.keys(n).forEach(function (k) { - var d = Object.getOwnPropertyDescriptor(n, k); - Object.defineProperty(a, k, d.get ? d : { - enumerable: true, - get: function () { - return n[k]; - } - }); - }); - return a; - } - - var buffer = {}; - - var base64Js = {}; - - var hasRequiredBase64Js; - - function requireBase64Js () { - if (hasRequiredBase64Js) return base64Js; - hasRequiredBase64Js = 1; - - base64Js.byteLength = byteLength; - base64Js.toByteArray = toByteArray; - base64Js.fromByteArray = fromByteArray; - - var lookup = []; - var revLookup = []; - var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; - - var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } - - // Support decoding URL-safe base64 strings, as Node.js does. - // See: https://en.wikipedia.org/wiki/Base64#URL_applications - revLookup['-'.charCodeAt(0)] = 62; - revLookup['_'.charCodeAt(0)] = 63; - - function getLens (b64) { - var len = b64.length; - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('='); - if (validLen === -1) validLen = len; - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4); - - return [validLen, placeHoldersLen] - } - - // base64 is 4/3 + up to two characters of the original data - function byteLength (b64) { - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen - } - - function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen - } - - function toByteArray (b64) { - var tmp; - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); - - var curByte = 0; - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen; - - var i; - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)]; - arr[curByte++] = (tmp >> 16) & 0xFF; - arr[curByte++] = (tmp >> 8) & 0xFF; - arr[curByte++] = tmp & 0xFF; - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4); - arr[curByte++] = tmp & 0xFF; - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2); - arr[curByte++] = (tmp >> 8) & 0xFF; - arr[curByte++] = tmp & 0xFF; - } - - return arr - } - - function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] - } - - function encodeChunk (uint8, start, end) { - var tmp; - var output = []; - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF); - output.push(tripletToBase64(tmp)); - } - return output.join('') - } - - function fromByteArray (uint8) { - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var parts = []; - var maxChunkLength = 16383; // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1]; - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ); - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1]; - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ); - } - - return parts.join('') - } - return base64Js; - } - - var ieee754 = {}; - - /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ - - var hasRequiredIeee754; - - function requireIeee754 () { - if (hasRequiredIeee754) return ieee754; - hasRequiredIeee754 = 1; - ieee754.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = (nBytes * 8) - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? (nBytes - 1) : 0; - var d = isLE ? -1 : 1; - var s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) - }; - - ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = (nBytes * 8) - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); - var i = isLE ? 0 : (nBytes - 1); - var d = isLE ? 1 : -1; - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128; - }; - return ieee754; - } - - /*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ - - var hasRequiredBuffer; - - function requireBuffer () { - if (hasRequiredBuffer) return buffer; - hasRequiredBuffer = 1; - (function (exports) { - - const base64 = requireBase64Js(); - const ieee754 = requireIeee754(); - const customInspectSymbol = - (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation - ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation - : null; - - exports.Buffer = Buffer; - exports.SlowBuffer = SlowBuffer; - exports.INSPECT_MAX_BYTES = 50; - - const K_MAX_LENGTH = 0x7fffffff; - exports.kMaxLength = K_MAX_LENGTH; - - /** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an Object - * implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */ - Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); - - if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && - typeof console.error === 'function') { - console.error( - 'This browser lacks typed array (Uint8Array) support which is required by ' + - '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' - ); - } - - function typedArraySupport () { - // Can typed array instances can be augmented? - try { - const arr = new Uint8Array(1); - const proto = { foo: function () { return 42 } }; - Object.setPrototypeOf(proto, Uint8Array.prototype); - Object.setPrototypeOf(arr, proto); - return arr.foo() === 42 - } catch (e) { - return false - } - } - - Object.defineProperty(Buffer.prototype, 'parent', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.buffer - } - }); - - Object.defineProperty(Buffer.prototype, 'offset', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.byteOffset - } - }); - - function createBuffer (length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"') - } - // Return an augmented `Uint8Array` instance - const buf = new Uint8Array(length); - Object.setPrototypeOf(buf, Buffer.prototype); - return buf - } - - /** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - - function Buffer (arg, encodingOrOffset, length) { - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new TypeError( - 'The "string" argument must be of type string. Received type number' - ) - } - return allocUnsafe(arg) - } - return from(arg, encodingOrOffset, length) - } - - Buffer.poolSize = 8192; // not used by this implementation - - function from (value, encodingOrOffset, length) { - if (typeof value === 'string') { - return fromString(value, encodingOrOffset) - } - - if (ArrayBuffer.isView(value)) { - return fromArrayView(value) - } - - if (value == null) { - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) - } - - if (isInstance(value, ArrayBuffer) || - (value && isInstance(value.buffer, ArrayBuffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof SharedArrayBuffer !== 'undefined' && - (isInstance(value, SharedArrayBuffer) || - (value && isInstance(value.buffer, SharedArrayBuffer)))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof value === 'number') { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number' - ) - } - - const valueOf = value.valueOf && value.valueOf(); - if (valueOf != null && valueOf !== value) { - return Buffer.from(valueOf, encodingOrOffset, length) - } - - const b = fromObject(value); - if (b) return b - - if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && - typeof value[Symbol.toPrimitive] === 'function') { - return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length) - } - - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) - } - - /** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ - Buffer.from = function (value, encodingOrOffset, length) { - return from(value, encodingOrOffset, length) - }; - - // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: - // https://github.com/feross/buffer/pull/148 - Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); - Object.setPrototypeOf(Buffer, Uint8Array); - - function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be of type number') - } else if (size < 0) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } - } - - function alloc (size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpreted as a start offset. - return typeof encoding === 'string' - ? createBuffer(size).fill(fill, encoding) - : createBuffer(size).fill(fill) - } - return createBuffer(size) - } - - /** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ - Buffer.alloc = function (size, fill, encoding) { - return alloc(size, fill, encoding) - }; - - function allocUnsafe (size) { - assertSize(size); - return createBuffer(size < 0 ? 0 : checked(size) | 0) - } - - /** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ - Buffer.allocUnsafe = function (size) { - return allocUnsafe(size) - }; - /** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ - Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(size) - }; - - function fromString (string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8'; - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - - const length = byteLength(string, encoding) | 0; - let buf = createBuffer(length); - - const actual = buf.write(string, encoding); - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - buf = buf.slice(0, actual); - } - - return buf - } - - function fromArrayLike (array) { - const length = array.length < 0 ? 0 : checked(array.length) | 0; - const buf = createBuffer(length); - for (let i = 0; i < length; i += 1) { - buf[i] = array[i] & 255; - } - return buf - } - - function fromArrayView (arrayView) { - if (isInstance(arrayView, Uint8Array)) { - const copy = new Uint8Array(arrayView); - return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) - } - return fromArrayLike(arrayView) - } - - function fromArrayBuffer (array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds') - } - - let buf; - if (byteOffset === undefined && length === undefined) { - buf = new Uint8Array(array); - } else if (length === undefined) { - buf = new Uint8Array(array, byteOffset); - } else { - buf = new Uint8Array(array, byteOffset, length); - } - - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(buf, Buffer.prototype); - - return buf - } - - function fromObject (obj) { - if (Buffer.isBuffer(obj)) { - const len = checked(obj.length) | 0; - const buf = createBuffer(len); - - if (buf.length === 0) { - return buf - } - - obj.copy(buf, 0, 0, len); - return buf - } - - if (obj.length !== undefined) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) - } - return fromArrayLike(obj) - } - - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) - } - } - - function checked (length) { - // Note: cannot use `length < K_MAX_LENGTH` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= K_MAX_LENGTH) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') - } - return length | 0 - } - - function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0; - } - return Buffer.alloc(+length) - } - - Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true && - b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false - }; - - Buffer.compare = function compare (a, b) { - if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); - if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' - ) - } - - if (a === b) return 0 - - let x = a.length; - let y = b.length; - - for (let i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } - }; - - Buffer.concat = function concat (list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - let i; - if (length === undefined) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - - const buffer = Buffer.allocUnsafe(length); - let pos = 0; - for (i = 0; i < list.length; ++i) { - let buf = list[i]; - if (isInstance(buf, Uint8Array)) { - if (pos + buf.length > buffer.length) { - if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); - buf.copy(buffer, pos); - } else { - Uint8Array.prototype.set.call( - buffer, - buf, - pos - ); - } - } else if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } else { - buf.copy(buffer, pos); - } - pos += buf.length; - } - return buffer - }; - - function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + - 'Received type ' + typeof string - ) - } - - const len = string.length; - const mustMatch = (arguments.length > 2 && arguments[2] === true); - if (!mustMatch && len === 0) return 0 - - // Use a for loop to avoid recursion - let loweredCase = false; - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) { - return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 - } - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - } - Buffer.byteLength = byteLength; - - function slowToString (encoding, start, end) { - let loweredCase = false; - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0; - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length; - } - - if (end <= 0) { - return '' - } - - // Force coercion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0; - start >>>= 0; - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8'; - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase(); - loweredCase = true; - } - } - } - - // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) - // to detect a Buffer instance. It's not possible to use `instanceof Buffer` - // reliably in a browserify context because there could be multiple different - // copies of the 'buffer' package in use. This method works even for Buffer - // instances that were created from another copy of the `buffer` package. - // See: https://github.com/feross/buffer/issues/154 - Buffer.prototype._isBuffer = true; - - function swap (b, n, m) { - const i = b[n]; - b[n] = b[m]; - b[m] = i; - } - - Buffer.prototype.swap16 = function swap16 () { - const len = this.length; - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (let i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this - }; - - Buffer.prototype.swap32 = function swap32 () { - const len = this.length; - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (let i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this - }; - - Buffer.prototype.swap64 = function swap64 () { - const len = this.length; - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (let i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this - }; - - Buffer.prototype.toString = function toString () { - const length = this.length; - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) - }; - - Buffer.prototype.toLocaleString = Buffer.prototype.toString; - - Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 - }; - - Buffer.prototype.inspect = function inspect () { - let str = ''; - const max = exports.INSPECT_MAX_BYTES; - str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); - if (this.length > max) str += ' ... '; - return '' - }; - if (customInspectSymbol) { - Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; - } - - Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer.from(target, target.offset, target.byteLength); - } - if (!Buffer.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. ' + - 'Received type ' + (typeof target) - ) - } - - if (start === undefined) { - start = 0; - } - if (end === undefined) { - end = target ? target.length : 0; - } - if (thisStart === undefined) { - thisStart = 0; - } - if (thisEnd === undefined) { - thisEnd = this.length; - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - - if (this === target) return 0 - - let x = thisEnd - thisStart; - let y = end - start; - const len = Math.min(x, y); - - const thisCopy = this.slice(thisStart, thisEnd); - const targetCopy = target.slice(start, end); - - for (let i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, - // OR the last index of `val` in `buffer` at offset <= `byteOffset`. - // - // Arguments: - // - buffer - a Buffer to search - // - val - a string, Buffer, or number - // - byteOffset - an index into `buffer`; will be clamped to an int32 - // - encoding - an optional encoding, relevant is val is a string - // - dir - true for indexOf, false for lastIndexOf - function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff; - } else if (byteOffset < -2147483648) { - byteOffset = -2147483648; - } - byteOffset = +byteOffset; // Coerce to Number. - if (numberIsNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1); - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset; - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1; - } else if (byteOffset < 0) { - if (dir) byteOffset = 0; - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding); - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF; // Search for a byte value [0-255] - if (typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') - } - - function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - let indexSize = 1; - let arrLength = arr.length; - let valLength = val.length; - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase(); - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - let i; - if (dir) { - let foundIndex = -1; - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i; - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - let found = true; - for (let j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break - } - } - if (found) return i - } - } - - return -1 - } - - Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 - }; - - Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) - }; - - Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) - }; - - function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0; - const remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - - const strLen = string.length; - - if (length > strLen / 2) { - length = strLen / 2; - } - let i; - for (i = 0; i < length; ++i) { - const parsed = parseInt(string.substr(i * 2, 2), 16); - if (numberIsNaN(parsed)) return i - buf[offset + i] = parsed; - } - return i - } - - function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) - } - - function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) - } - - function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) - } - - function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) - } - - Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8'; - length = this.length; - offset = 0; - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset; - length = this.length; - offset = 0; - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset >>> 0; - if (isFinite(length)) { - length = length >>> 0; - if (encoding === undefined) encoding = 'utf8'; - } else { - encoding = length; - length = undefined; - } - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - const remaining = this.length - offset; - if (length === undefined || length > remaining) length = remaining; - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8'; - - let loweredCase = false; - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - case 'latin1': - case 'binary': - return asciiWrite(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - }; - - Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } - }; - - function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } - } - - function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end); - const res = []; - - let i = start; - while (i < end) { - const firstByte = buf[i]; - let codePoint = null; - let bytesPerSequence = (firstByte > 0xEF) - ? 4 - : (firstByte > 0xDF) - ? 3 - : (firstByte > 0xBF) - ? 2 - : 1; - - if (i + bytesPerSequence <= end) { - let secondByte, thirdByte, fourthByte, tempCodePoint; - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte; - } - break - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint; - } - } - break - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint; - } - } - break - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint; - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD; - bytesPerSequence = 1; - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000; - res.push(codePoint >>> 10 & 0x3FF | 0xD800); - codePoint = 0xDC00 | codePoint & 0x3FF; - } - - res.push(codePoint); - i += bytesPerSequence; - } - - return decodeCodePointsArray(res) - } - - // Based on http://stackoverflow.com/a/22747272/680742, the browser with - // the lowest limit is Chrome, with 0x10000 args. - // We go 1 magnitude less, for safety - const MAX_ARGUMENTS_LENGTH = 0x1000; - - function decodeCodePointsArray (codePoints) { - const len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - let res = ''; - let i = 0; - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ); - } - return res - } - - function asciiSlice (buf, start, end) { - let ret = ''; - end = Math.min(buf.length, end); - - for (let i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F); - } - return ret - } - - function latin1Slice (buf, start, end) { - let ret = ''; - end = Math.min(buf.length, end); - - for (let i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret - } - - function hexSlice (buf, start, end) { - const len = buf.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - let out = ''; - for (let i = start; i < end; ++i) { - out += hexSliceLookupTable[buf[i]]; - } - return out - } - - function utf16leSlice (buf, start, end) { - const bytes = buf.slice(start, end); - let res = ''; - // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) - for (let i = 0; i < bytes.length - 1; i += 2) { - res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)); - } - return res - } - - Buffer.prototype.slice = function slice (start, end) { - const len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - - if (start < 0) { - start += len; - if (start < 0) start = 0; - } else if (start > len) { - start = len; - } - - if (end < 0) { - end += len; - if (end < 0) end = 0; - } else if (end > len) { - end = len; - } - - if (end < start) end = start; - - const newBuf = this.subarray(start, end); - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(newBuf, Buffer.prototype); - - return newBuf - }; - - /* - * Need to make sure that buffer isn't trying to write out of bounds. - */ - function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') - } - - Buffer.prototype.readUintLE = - Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - let val = this[offset]; - let mul = 1; - let i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - - return val - }; - - Buffer.prototype.readUintBE = - Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - checkOffset(offset, byteLength, this.length); - } - - let val = this[offset + --byteLength]; - let mul = 1; - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul; - } - - return val - }; - - Buffer.prototype.readUint8 = - Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - return this[offset] - }; - - Buffer.prototype.readUint16LE = - Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] | (this[offset + 1] << 8) - }; - - Buffer.prototype.readUint16BE = - Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return (this[offset] << 8) | this[offset + 1] - }; - - Buffer.prototype.readUint32LE = - Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) - }; - - Buffer.prototype.readUint32BE = - Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) - }; - - Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const lo = first + - this[++offset] * 2 ** 8 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 24; - - const hi = this[++offset] + - this[++offset] * 2 ** 8 + - this[++offset] * 2 ** 16 + - last * 2 ** 24; - - return BigInt(lo) + (BigInt(hi) << BigInt(32)) - }); - - Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const hi = first * 2 ** 24 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - this[++offset]; - - const lo = this[++offset] * 2 ** 24 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - last; - - return (BigInt(hi) << BigInt(32)) + BigInt(lo) - }); - - Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - let val = this[offset]; - let mul = 1; - let i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - let i = byteLength; - let mul = 1; - let val = this[offset + --i]; - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) - }; - - Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - const val = this[offset] | (this[offset + 1] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - const val = this[offset + 1] | (this[offset] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) - }; - - Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) - }; - - Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const val = this[offset + 4] + - this[offset + 5] * 2 ** 8 + - this[offset + 6] * 2 ** 16 + - (last << 24); // Overflow - - return (BigInt(val) << BigInt(32)) + - BigInt(first + - this[++offset] * 2 ** 8 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 24) - }); - - Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const val = (first << 24) + // Overflow - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - this[++offset]; - - return (BigInt(val) << BigInt(32)) + - BigInt(this[++offset] * 2 ** 24 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - last) - }); - - Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, true, 23, 4) - }; - - Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, false, 23, 4) - }; - - Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, true, 52, 8) - }; - - Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, false, 52, 8) - }; - - function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') - } - - Buffer.prototype.writeUintLE = - Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - let mul = 1; - let i = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUintBE = - Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - let i = byteLength - 1; - let mul = 1; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUint8 = - Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); - this[offset] = (value & 0xff); - return offset + 1 - }; - - Buffer.prototype.writeUint16LE = - Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - return offset + 2 - }; - - Buffer.prototype.writeUint16BE = - Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - return offset + 2 - }; - - Buffer.prototype.writeUint32LE = - Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - this[offset + 3] = (value >>> 24); - this[offset + 2] = (value >>> 16); - this[offset + 1] = (value >>> 8); - this[offset] = (value & 0xff); - return offset + 4 - }; - - Buffer.prototype.writeUint32BE = - Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - return offset + 4 - }; - - function wrtBigUInt64LE (buf, value, offset, min, max) { - checkIntBI(value, min, max, buf, offset, 7); - - let lo = Number(value & BigInt(0xffffffff)); - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - return offset - } - - function wrtBigUInt64BE (buf, value, offset, min, max) { - checkIntBI(value, min, max, buf, offset, 7); - - let lo = Number(value & BigInt(0xffffffff)); - buf[offset + 7] = lo; - lo = lo >> 8; - buf[offset + 6] = lo; - lo = lo >> 8; - buf[offset + 5] = lo; - lo = lo >> 8; - buf[offset + 4] = lo; - let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); - buf[offset + 3] = hi; - hi = hi >> 8; - buf[offset + 2] = hi; - hi = hi >> 8; - buf[offset + 1] = hi; - hi = hi >> 8; - buf[offset] = hi; - return offset + 8 - } - - Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) { - return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) - }); - - Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) { - return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) - }); - - Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - const limit = Math.pow(2, (8 * byteLength) - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - let i = 0; - let mul = 1; - let sub = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - const limit = Math.pow(2, (8 * byteLength) - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - let i = byteLength - 1; - let mul = 1; - let sub = 0; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128); - if (value < 0) value = 0xff + value + 1; - this[offset] = (value & 0xff); - return offset + 1 - }; - - Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - return offset + 2 - }; - - Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - return offset + 2 - }; - - Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - this[offset + 2] = (value >>> 16); - this[offset + 3] = (value >>> 24); - return offset + 4 - }; - - Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); - if (value < 0) value = 0xffffffff + value + 1; - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - return offset + 4 - }; - - Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) { - return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) - }); - - Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) { - return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) - }); - - function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') - } - - function writeFloat (buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 4); - } - ieee754.write(buf, value, offset, littleEndian, 23, 4); - return offset + 4 - } - - Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) - }; - - function writeDouble (buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 8); - } - ieee754.write(buf, value, offset, littleEndian, 52, 8); - return offset + 8 - } - - Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) - }; - - // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) - Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') - if (!start) start = 0; - if (!end && end !== 0) end = this.length; - if (targetStart >= target.length) targetStart = target.length; - if (!targetStart) targetStart = 0; - if (end > 0 && end < start) end = start; - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('Index out of range') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - - const len = end - start; - - if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { - // Use built-in when available, missing from IE11 - this.copyWithin(targetStart, start, end); - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart - ); - } - - return len - }; - - // Usage: - // buffer.fill(number[, offset[, end]]) - // buffer.fill(buffer[, offset[, end]]) - // buffer.fill(string[, offset[, end]][, encoding]) - Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === 'string') { - encoding = end; - end = this.length; - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - if (val.length === 1) { - const code = val.charCodeAt(0); - if ((encoding === 'utf8' && code < 128) || - encoding === 'latin1') { - // Fast path: If `val` fits into a single byte, use that numeric value. - val = code; - } - } - } else if (typeof val === 'number') { - val = val & 255; - } else if (typeof val === 'boolean') { - val = Number(val); - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0; - end = end === undefined ? this.length : end >>> 0; - - if (!val) val = 0; - - let i; - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - const bytes = Buffer.isBuffer(val) - ? val - : Buffer.from(val, encoding); - const len = bytes.length; - if (len === 0) { - throw new TypeError('The value "' + val + - '" is invalid for argument "value"') - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - - return this - }; - - // CUSTOM ERRORS - // ============= - - // Simplified versions from Node, changed for Buffer-only usage - const errors = {}; - function E (sym, getMessage, Base) { - errors[sym] = class NodeError extends Base { - constructor () { - super(); - - Object.defineProperty(this, 'message', { - value: getMessage.apply(this, arguments), - writable: true, - configurable: true - }); - - // Add the error code to the name to include it in the stack trace. - this.name = `${this.name} [${sym}]`; - // Access the stack to generate the error message including the error code - // from the name. - this.stack; // eslint-disable-line no-unused-expressions - // Reset the name to the actual name. - delete this.name; - } - - get code () { - return sym - } - - set code (value) { - Object.defineProperty(this, 'code', { - configurable: true, - enumerable: true, - value, - writable: true - }); - } - - toString () { - return `${this.name} [${sym}]: ${this.message}` - } - }; - } - - E('ERR_BUFFER_OUT_OF_BOUNDS', - function (name) { - if (name) { - return `${name} is outside of buffer bounds` - } - - return 'Attempt to access memory outside buffer bounds' - }, RangeError); - E('ERR_INVALID_ARG_TYPE', - function (name, actual) { - return `The "${name}" argument must be of type number. Received type ${typeof actual}` - }, TypeError); - E('ERR_OUT_OF_RANGE', - function (str, range, input) { - let msg = `The value of "${str}" is out of range.`; - let received = input; - if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { - received = addNumericalSeparator(String(input)); - } else if (typeof input === 'bigint') { - received = String(input); - if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { - received = addNumericalSeparator(received); - } - received += 'n'; - } - msg += ` It must be ${range}. Received ${received}`; - return msg - }, RangeError); - - function addNumericalSeparator (val) { - let res = ''; - let i = val.length; - const start = val[0] === '-' ? 1 : 0; - for (; i >= start + 4; i -= 3) { - res = `_${val.slice(i - 3, i)}${res}`; - } - return `${val.slice(0, i)}${res}` - } - - // CHECK FUNCTIONS - // =============== - - function checkBounds (buf, offset, byteLength) { - validateNumber(offset, 'offset'); - if (buf[offset] === undefined || buf[offset + byteLength] === undefined) { - boundsError(offset, buf.length - (byteLength + 1)); - } - } - - function checkIntBI (value, min, max, buf, offset, byteLength) { - if (value > max || value < min) { - const n = typeof min === 'bigint' ? 'n' : ''; - let range; - { - if (min === 0 || min === BigInt(0)) { - range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`; - } else { - range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + - `${(byteLength + 1) * 8 - 1}${n}`; - } - } - throw new errors.ERR_OUT_OF_RANGE('value', range, value) - } - checkBounds(buf, offset, byteLength); - } - - function validateNumber (value, name) { - if (typeof value !== 'number') { - throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value) - } - } - - function boundsError (value, length, type) { - if (Math.floor(value) !== value) { - validateNumber(value, type); - throw new errors.ERR_OUT_OF_RANGE('offset', 'an integer', value) - } - - if (length < 0) { - throw new errors.ERR_BUFFER_OUT_OF_BOUNDS() - } - - throw new errors.ERR_OUT_OF_RANGE('offset', - `>= ${0} and <= ${length}`, - value) - } - - // HELPER FUNCTIONS - // ================ - - const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; - - function base64clean (str) { - // Node takes equal signs as end of the Base64 encoding - str = str.split('=')[0]; - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = str.trim().replace(INVALID_BASE64_RE, ''); - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '='; - } - return str - } - - function utf8ToBytes (string, units) { - units = units || Infinity; - let codePoint; - const length = string.length; - let leadSurrogate = null; - const bytes = []; - - for (let i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } - - // valid lead - leadSurrogate = codePoint; - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - leadSurrogate = codePoint; - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - } - - leadSurrogate = null; - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint); - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else { - throw new Error('Invalid code point') - } - } - - return bytes - } - - function asciiToBytes (str) { - const byteArray = []; - for (let i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF); - } - return byteArray - } - - function utf16leToBytes (str, units) { - let c, hi, lo; - const byteArray = []; - for (let i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - - return byteArray - } - - function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) - } - - function blitBuffer (src, dst, offset, length) { - let i; - for (i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i]; - } - return i - } - - // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass - // the `instanceof` check but they should be treated as of that type. - // See: https://github.com/feross/buffer/issues/166 - function isInstance (obj, type) { - return obj instanceof type || - (obj != null && obj.constructor != null && obj.constructor.name != null && - obj.constructor.name === type.name) - } - function numberIsNaN (obj) { - // For IE11 support - return obj !== obj // eslint-disable-line no-self-compare - } - - // Create lookup table for `toString('hex')` - // See: https://github.com/feross/buffer/issues/219 - const hexSliceLookupTable = (function () { - const alphabet = '0123456789abcdef'; - const table = new Array(256); - for (let i = 0; i < 16; ++i) { - const i16 = i * 16; - for (let j = 0; j < 16; ++j) { - table[i16 + j] = alphabet[i] + alphabet[j]; - } - } - return table - })(); - - // Return not function with Error if BigInt not supported - function defineBigIntMethod (fn) { - return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn - } - - function BufferBigIntNotDefined () { - throw new Error('BigInt not supported') - } - } (buffer)); - return buffer; - } - - var bufferExports = requireBuffer(); - - /** The current version of corebc; keep in sync with package.json. */ - const version = "0.4.1"; - - var bn$2 = {exports: {}}; - - var _nodeResolve_empty = {}; - - var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - default: _nodeResolve_empty - }); - - var require$$0 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1); - - var bn$1 = bn$2.exports; - - var hasRequiredBn$1; - - function requireBn$1 () { - if (hasRequiredBn$1) return bn$2.exports; - hasRequiredBn$1 = 1; - (function (module) { - (function (module, exports) { - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - if (BN.isBN(number)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') { - Buffer = window.Buffer; - } else { - Buffer = require$$0.Buffer; - } - } catch (e) { - } - - BN.isBN = function isBN (num) { - if (num instanceof BN) { - return true; - } - - return num !== null && typeof num === 'object' && - num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); - }; - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - this.negative = 1; - } - - if (start < number.length) { - if (base === 16) { - this._parseHex(number, start, endian); - } else { - this._parseBase(number, base, start); - if (endian === 'le') { - this._initArray(this.toArray(), base, endian); - } - } - } - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [number & 0x3ffffff]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [0]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this._strip(); - }; - - function parseHex4Bits (string, index) { - var c = string.charCodeAt(index); - // '0' - '9' - if (c >= 48 && c <= 57) { - return c - 48; - // 'A' - 'F' - } else if (c >= 65 && c <= 70) { - return c - 55; - // 'a' - 'f' - } else if (c >= 97 && c <= 102) { - return c - 87; - } else { - assert(false, 'Invalid character in ' + string); - } - } - - function parseHexByte (string, lowerBound, index) { - var r = parseHex4Bits(string, index); - if (index - 1 >= lowerBound) { - r |= parseHex4Bits(string, index - 1) << 4; - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start, endian) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - // 24-bits chunks - var off = 0; - var j = 0; - - var w; - if (endian === 'be') { - for (i = number.length - 1; i >= start; i -= 2) { - w = parseHexByte(number, start, i) << off; - this.words[j] |= w & 0x3ffffff; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } else { - var parseLength = number.length - start; - for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) { - w = parseHexByte(number, start, i) << off; - this.words[j] |= w & 0x3ffffff; - if (off >= 18) { - off -= 18; - j += 1; - this.words[j] |= w >>> 26; - } else { - off += 8; - } - } - } - - this._strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var b = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - b = c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - b = c - 17 + 0xa; - - // '0' - '9' - } else { - b = c; - } - assert(c >= 0 && b < mul, 'Invalid character'); - r += b; - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [0]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - this._strip(); - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - function move (dest, src) { - dest.words = src.words; - dest.length = src.length; - dest.negative = src.negative; - dest.red = src.red; - } - - BN.prototype._move = function _move (dest) { - move(dest, this); - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - BN.prototype._expand = function _expand (size) { - while (this.length < size) { - this.words[this.length++] = 0; - } - return this; - }; - - // Remove leading `0` from `this` - BN.prototype._strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - // Check Symbol.for because not everywhere where Symbol defined - // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility - if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') { - try { - BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect; - } catch (e) { - BN.prototype.inspect = inspect; - } - } else { - BN.prototype.inspect = inspect; - } - - function inspect () { - return (this.red ? ''; - } - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '0', - '00', - '000', - '0000', - '00000', - '000000', - '0000000', - '00000000', - '000000000', - '0000000000', - '00000000000', - '000000000000', - '0000000000000', - '00000000000000', - '000000000000000', - '0000000000000000', - '00000000000000000', - '000000000000000000', - '0000000000000000000', - '00000000000000000000', - '000000000000000000000', - '0000000000000000000000', - '00000000000000000000000', - '000000000000000000000000', - '0000000000000000000000000' - ]; - - var groupSizes = [ - 0, 0, - 25, 16, 12, 11, 10, 9, 8, - 8, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 5, 5, - 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modrn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var ret = this.words[0]; - if (this.length === 2) { - ret += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // NOTE: at this stage it is known that the top bit is set - ret += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16, 2); - }; - - if (Buffer) { - BN.prototype.toBuffer = function toBuffer (endian, length) { - return this.toArrayLike(Buffer, endian, length); - }; - } - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - var allocate = function allocate (ArrayType, size) { - if (ArrayType.allocUnsafe) { - return ArrayType.allocUnsafe(size); - } - return new ArrayType(size); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - this._strip(); - - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - var res = allocate(ArrayType, reqLength); - var postfix = endian === 'le' ? 'LE' : 'BE'; - this['_toArrayLike' + postfix](res, byteLength); - return res; - }; - - BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) { - var position = 0; - var carry = 0; - - for (var i = 0, shift = 0; i < this.length; i++) { - var word = (this.words[i] << shift) | carry; - - res[position++] = word & 0xff; - if (position < res.length) { - res[position++] = (word >> 8) & 0xff; - } - if (position < res.length) { - res[position++] = (word >> 16) & 0xff; - } - - if (shift === 6) { - if (position < res.length) { - res[position++] = (word >> 24) & 0xff; - } - carry = 0; - shift = 0; - } else { - carry = word >>> 24; - shift += 2; - } - } - - if (position < res.length) { - res[position++] = carry; - - while (position < res.length) { - res[position++] = 0; - } - } - }; - - BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) { - var position = res.length - 1; - var carry = 0; - - for (var i = 0, shift = 0; i < this.length; i++) { - var word = (this.words[i] << shift) | carry; - - res[position--] = word & 0xff; - if (position >= 0) { - res[position--] = (word >> 8) & 0xff; - } - if (position >= 0) { - res[position--] = (word >> 16) & 0xff; - } - - if (shift === 6) { - if (position >= 0) { - res[position--] = (word >> 24) & 0xff; - } - carry = 0; - shift = 0; - } else { - carry = word >>> 24; - shift += 2; - } - } - - if (position >= 0) { - res[position--] = carry; - - while (position >= 0) { - res[position--] = 0; - } - } - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] >>> wbit) & 0x01; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this._strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this._strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this._strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - this._expand(bytesNeeded); - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - i++; - } - - // Clear words above the requested width so the result stays below 2 ** width - for (; i < this.length; i++) { - this.words[i] = 0; - } - - // And remove leading zeroes - return this._strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - this._expand(off + 1); - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this._strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } - - return this._strip(); - }; - - // Subtract `num` from `this` - BN.prototype.sub = function sub (num) { - return this.clone().isub(num); - }; - - function smallMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - var len = (self.length + num.length) | 0; - out.length = len; - len = (len - 1) | 0; - - // Peel one iteration (compiler can't do it, because of code complexity) - var a = self.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - var carry = (r / 0x4000000) | 0; - out.words[0] = lo; - - for (var k = 1; k < len; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = carry >>> 26; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = (k - j) | 0; - a = self.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - - return out._strip(); - } - - // TODO(indutny): it may be reasonable to omit it for users who don't need - // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit - // multiplication (like elliptic secp256k1). - var comb10MulTo = function comb10MulTo (self, num, out) { - var a = self.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 0x1fff; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 0x1fff; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 0x1fff; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 0x1fff; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 0x1fff; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 0x1fff; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 0x1fff; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 0x1fff; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 0x1fff; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 0x1fff; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 0x1fff; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 0x1fff; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 0x1fff; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 0x1fff; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 0x1fff; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 0x1fff; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 0x1fff; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 0x1fff; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 0x1fff; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 0x1fff; - var bh9 = b9 >>> 13; - - out.negative = self.negative ^ num.negative; - out.length = 19; - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - - // Polyfill comb - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - - function bigMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - out.length = self.length + num.length; - - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - - return out._strip(); - } - - function jumboMulTo (self, num, out) { - // Temporary disable, see https://github.com/indutny/bn.js/issues/211 - // var fftm = new FFTM(); - // return fftm.mulp(self, num, out); - return bigMulTo(self, num, out); - } - - BN.prototype.mulTo = function mulTo (num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - - return res; - }; - - // Multiply `this` by `num` - BN.prototype.mul = function mul (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - - // Multiply employing FFT - BN.prototype.mulf = function mulf (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - - // In-place Multiplication - BN.prototype.imul = function imul (num) { - return this.clone().mulTo(num, this); - }; - - BN.prototype.imuln = function imuln (num) { - var isNegNum = num < 0; - if (isNegNum) num = -num; - - assert(typeof num === 'number'); - assert(num < 0x4000000); - - // Carry - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - carry >>= 26; - carry += (w / 0x4000000) | 0; - // NOTE: lo is 27bit maximum - carry += lo >>> 26; - this.words[i] = lo & 0x3ffffff; - } - - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - if (num === 0) { - this.length = 1; - this._normSign(); - } - - return isNegNum ? this.ineg() : this; - }; - - BN.prototype.muln = function muln (num) { - return this.clone().imuln(num); - }; - - // `this` * `this` - BN.prototype.sqr = function sqr () { - return this.mul(this); - }; - - // `this` * `this` in-place - BN.prototype.isqr = function isqr () { - return this.imul(this.clone()); - }; - - // Math.pow(`this`, `num`) - BN.prototype.pow = function pow (num) { - var w = toBitArray(num); - if (w.length === 0) return new BN(1); - - // Skip leading zeroes - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) break; - } - - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) continue; - - res = res.mul(q); - } - } - - return res; - }; - - // Shift-left in-place - BN.prototype.iushln = function iushln (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); - var i; - - if (r !== 0) { - var carry = 0; - - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = ((this.words[i] | 0) - newCarry) << r; - this.words[i] = c | carry; - carry = newCarry >>> (26 - r); - } - - if (carry) { - this.words[i] = carry; - this.length++; - } - } - - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - - this.length += s; - } - - return this._strip(); - }; - - BN.prototype.ishln = function ishln (bits) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushln(bits); - }; - - // Shift-right in-place - // NOTE: `hint` is a lowest bit before trailing zeroes - // NOTE: if `extended` is present - it will be filled with destroyed bits - BN.prototype.iushrn = function iushrn (bits, hint, extended) { - assert(typeof bits === 'number' && bits >= 0); - var h; - if (hint) { - h = (hint - (hint % 26)) / 26; - } else { - h = 0; - } - - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - var maskedWords = extended; - - h -= s; - h = Math.max(0, h); - - // Extended mode, copy masked part - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - - if (s === 0) ; else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = (carry << (26 - r)) | (word >>> r); - carry = word & mask; - } - - // Push carried bits as a mask - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this._strip(); - }; - - BN.prototype.ishrn = function ishrn (bits, hint, extended) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - - // Shift-left - BN.prototype.shln = function shln (bits) { - return this.clone().ishln(bits); - }; - - BN.prototype.ushln = function ushln (bits) { - return this.clone().iushln(bits); - }; - - // Shift-right - BN.prototype.shrn = function shrn (bits) { - return this.clone().ishrn(bits); - }; - - BN.prototype.ushrn = function ushrn (bits) { - return this.clone().iushrn(bits); - }; - - // Test if n bit is set - BN.prototype.testn = function testn (bit) { - assert(typeof bit === 'number' && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) return false; - - // Check bit and return - var w = this.words[s]; - - return !!(w & q); - }; - - // Return only lowers bits of number (in-place) - BN.prototype.imaskn = function imaskn (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - - assert(this.negative === 0, 'imaskn works only with positive numbers'); - - if (this.length <= s) { - return this; - } - - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - - if (r !== 0) { - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - this.words[this.length - 1] &= mask; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this._strip(); - }; - - // Return only lowers bits of number - BN.prototype.maskn = function maskn (bits) { - return this.clone().imaskn(bits); - }; - - // Add plain number `num` to `this` - BN.prototype.iaddn = function iaddn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.isubn(-num); - - // Possible sign change - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) <= num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - - // Add without checks - return this._iaddn(num); - }; - - BN.prototype._iaddn = function _iaddn (num) { - this.words[0] += num; - - // Carry - for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - - return this; - }; - - // Subtract plain number `num` from `this` - BN.prototype.isubn = function isubn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.iaddn(-num); - - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - - this.words[0] -= num; - - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - // Carry - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - } - - return this._strip(); - }; - - BN.prototype.addn = function addn (num) { - return this.clone().iaddn(num); - }; - - BN.prototype.subn = function subn (num) { - return this.clone().isubn(num); - }; - - BN.prototype.iabs = function iabs () { - this.negative = 0; - - return this; - }; - - BN.prototype.abs = function abs () { - return this.clone().iabs(); - }; - - BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { - var len = num.length + shift; - var i; - - this._expand(len); - - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 0x3ffffff; - carry = (w >> 26) - ((right / 0x4000000) | 0); - this.words[i + shift] = w & 0x3ffffff; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) return this._strip(); - - // Subtraction overflow - assert(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 0x3ffffff; - } - this.negative = 1; - - return this._strip(); - }; - - BN.prototype._wordDiv = function _wordDiv (num, mode) { - var shift = this.length - num.length; - - var a = this.clone(); - var b = num; - - // Normalize - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - - // Initialize quotient - var m = a.length - b.length; - var q; - - if (mode !== 'mod') { - q = new BN(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 0x4000000 + - (a.words[b.length + j - 1] | 0); - - // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max - // (0x7ffffff) - qj = Math.min((qj / bhi) | 0, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q._strip(); - } - a._strip(); - - // Denormalize - if (mode !== 'div' && shift !== 0) { - a.iushrn(shift); - } - - return { - div: q || null, - mod: a - }; - }; - - // NOTE: 1) `mode` can be set to `mod` to request mod only, - // to `div` to request div only, or be absent to - // request both div & mod - // 2) `positive` is true if unsigned mod is requested - BN.prototype.divmod = function divmod (num, mode, positive) { - assert(!num.isZero()); - - if (this.isZero()) { - return { - div: new BN(0), - mod: new BN(0) - }; - } - - var div, mod, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.iadd(num); - } - } - - return { - div: div, - mod: mod - }; - } - - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - return { - div: div, - mod: res.mod - }; - } - - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.isub(num); - } - } - - return { - div: res.div, - mod: mod - }; - } - - // Both numbers are positive at this point - - // Strip both numbers to approximate shift value - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN(0), - mod: this - }; - } - - // Very short reduction - if (num.length === 1) { - if (mode === 'div') { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - - if (mode === 'mod') { - return { - div: null, - mod: new BN(this.modrn(num.words[0])) - }; - } - - return { - div: this.divn(num.words[0]), - mod: new BN(this.modrn(num.words[0])) - }; - } - - return this._wordDiv(num, mode); - }; - - // Find `this` / `num` - BN.prototype.div = function div (num) { - return this.divmod(num, 'div', false).div; - }; - - // Find `this` % `num` - BN.prototype.mod = function mod (num) { - return this.divmod(num, 'mod', false).mod; - }; - - BN.prototype.umod = function umod (num) { - return this.divmod(num, 'mod', true).mod; - }; - - // Find Round(`this` / `num`) - BN.prototype.divRound = function divRound (num) { - var dm = this.divmod(num); - - // Fast case - exact division - if (dm.mod.isZero()) return dm.div; - - var mod = dm.mod.abs(); - - var half = num.abs().iushrn(1); - var r2 = num.words[0] & 1; - var cmp = mod.cmp(half); - - // Round down - if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div; - - // Round up, away from zero - var up = new BN(1); - up.negative = this.negative ^ num.negative; - return dm.div.iadd(up); - }; - - BN.prototype.modrn = function modrn (num) { - var isNegNum = num < 0; - if (isNegNum) num = -num; - - assert(num <= 0x3ffffff); - var p = (1 << 26) % num; - - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - - return isNegNum ? -acc : acc; - }; - - // WARNING: DEPRECATED - BN.prototype.modn = function modn (num) { - return this.modrn(num); - }; - - // In-place division by number - BN.prototype.idivn = function idivn (num) { - var isNegNum = num < 0; - if (isNegNum) num = -num; - - assert(num <= 0x3ffffff); - - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 0x4000000; - this.words[i] = (w / num) | 0; - carry = w % num; - } - - this._strip(); - return isNegNum ? this.ineg() : this; - }; - - BN.prototype.divn = function divn (num) { - return this.clone().idivn(num); - }; - - BN.prototype.egcd = function egcd (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var x = this; - var y = p.clone(); - - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - - // A * x + B * y = x - var A = new BN(1); - var B = new BN(0); - - // C * x + D * y = y - var C = new BN(0); - var D = new BN(1); - - var g = 0; - - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - - var yp = y.clone(); - var xp = x.clone(); - - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - } - - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - - // This is reduced incarnation of the binary EEA - // above, designated to invert members of the - // _prime_ fields F(p) at a maximal speed - BN.prototype._invmp = function _invmp (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var a = this; - var b = p.clone(); - - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - - var x1 = new BN(1); - var x2 = new BN(0); - - var delta = b.clone(); - - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - - x1.iushrn(1); - } - } - - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - - x2.iushrn(1); - } - } - - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - - if (res.cmpn(0) < 0) { - res.iadd(p); - } - - return res; - }; - - BN.prototype.gcd = function gcd (num) { - if (this.isZero()) return num.abs(); - if (num.isZero()) return this.abs(); - - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - - // Remove common factor of two - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - - var r = a.cmp(b); - if (r < 0) { - // Swap `a` and `b` to make `a` always bigger than `b` - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - - a.isub(b); - } while (true); - - return b.iushln(shift); - }; - - // Invert number in the field F(num) - BN.prototype.invm = function invm (num) { - return this.egcd(num).a.umod(num); - }; - - BN.prototype.isEven = function isEven () { - return (this.words[0] & 1) === 0; - }; - - BN.prototype.isOdd = function isOdd () { - return (this.words[0] & 1) === 1; - }; - - // And first word and num - BN.prototype.andln = function andln (num) { - return this.words[0] & num; - }; - - // Increment at the bit position in-line - BN.prototype.bincn = function bincn (bit) { - assert(typeof bit === 'number'); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) { - this._expand(s + 1); - this.words[s] |= q; - return this; - } - - // Add bit and propagate, if needed - var carry = q; - for (var i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 0x3ffffff; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - - BN.prototype.isZero = function isZero () { - return this.length === 1 && this.words[0] === 0; - }; - - BN.prototype.cmpn = function cmpn (num) { - var negative = num < 0; - - if (this.negative !== 0 && !negative) return -1; - if (this.negative === 0 && negative) return 1; - - this._strip(); - - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - - assert(num <= 0x3ffffff, 'Number is too big'); - - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Compare two numbers and return: - // 1 - if `this` > `num` - // 0 - if `this` == `num` - // -1 - if `this` < `num` - BN.prototype.cmp = function cmp (num) { - if (this.negative !== 0 && num.negative === 0) return -1; - if (this.negative === 0 && num.negative !== 0) return 1; - - var res = this.ucmp(num); - if (this.negative !== 0) return -res | 0; - return res; - }; - - // Unsigned comparison - BN.prototype.ucmp = function ucmp (num) { - // At this point both numbers have the same sign - if (this.length > num.length) return 1; - if (this.length < num.length) return -1; - - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - - if (a === b) continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - - BN.prototype.gtn = function gtn (num) { - return this.cmpn(num) === 1; - }; - - BN.prototype.gt = function gt (num) { - return this.cmp(num) === 1; - }; - - BN.prototype.gten = function gten (num) { - return this.cmpn(num) >= 0; - }; - - BN.prototype.gte = function gte (num) { - return this.cmp(num) >= 0; - }; - - BN.prototype.ltn = function ltn (num) { - return this.cmpn(num) === -1; - }; - - BN.prototype.lt = function lt (num) { - return this.cmp(num) === -1; - }; - - BN.prototype.lten = function lten (num) { - return this.cmpn(num) <= 0; - }; - - BN.prototype.lte = function lte (num) { - return this.cmp(num) <= 0; - }; - - BN.prototype.eqn = function eqn (num) { - return this.cmpn(num) === 0; - }; - - BN.prototype.eq = function eq (num) { - return this.cmp(num) === 0; - }; - - // - // A reduce context, could be using montgomery or something better, depending - // on the `m` itself. - // - BN.red = function red (num) { - return new Red(num); - }; - - BN.prototype.toRed = function toRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - assert(this.negative === 0, 'red works only with positives'); - return ctx.convertTo(this)._forceRed(ctx); - }; - - BN.prototype.fromRed = function fromRed () { - assert(this.red, 'fromRed works only with numbers in reduction context'); - return this.red.convertFrom(this); - }; - - BN.prototype._forceRed = function _forceRed (ctx) { - this.red = ctx; - return this; - }; - - BN.prototype.forceRed = function forceRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - return this._forceRed(ctx); - }; - - BN.prototype.redAdd = function redAdd (num) { - assert(this.red, 'redAdd works only with red numbers'); - return this.red.add(this, num); - }; - - BN.prototype.redIAdd = function redIAdd (num) { - assert(this.red, 'redIAdd works only with red numbers'); - return this.red.iadd(this, num); - }; - - BN.prototype.redSub = function redSub (num) { - assert(this.red, 'redSub works only with red numbers'); - return this.red.sub(this, num); - }; - - BN.prototype.redISub = function redISub (num) { - assert(this.red, 'redISub works only with red numbers'); - return this.red.isub(this, num); - }; - - BN.prototype.redShl = function redShl (num) { - assert(this.red, 'redShl works only with red numbers'); - return this.red.shl(this, num); - }; - - BN.prototype.redMul = function redMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - - BN.prototype.redIMul = function redIMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - - BN.prototype.redSqr = function redSqr () { - assert(this.red, 'redSqr works only with red numbers'); - this.red._verify1(this); - return this.red.sqr(this); - }; - - BN.prototype.redISqr = function redISqr () { - assert(this.red, 'redISqr works only with red numbers'); - this.red._verify1(this); - return this.red.isqr(this); - }; - - // Square root over p - BN.prototype.redSqrt = function redSqrt () { - assert(this.red, 'redSqrt works only with red numbers'); - this.red._verify1(this); - return this.red.sqrt(this); - }; - - BN.prototype.redInvm = function redInvm () { - assert(this.red, 'redInvm works only with red numbers'); - this.red._verify1(this); - return this.red.invm(this); - }; - - // Return negative clone of `this` % `red modulo` - BN.prototype.redNeg = function redNeg () { - assert(this.red, 'redNeg works only with red numbers'); - this.red._verify1(this); - return this.red.neg(this); - }; - - BN.prototype.redPow = function redPow (num) { - assert(this.red && !num.red, 'redPow(normalNum)'); - this.red._verify1(this); - return this.red.pow(this, num); - }; - - // Prime numbers with efficient reduction - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - - // Pseudo-Mersenne prime - function MPrime (name, p) { - // P = 2 ^ N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = new BN(1).iushln(this.n).isub(this.p); - - this.tmp = this._tmp(); - } - - MPrime.prototype._tmp = function _tmp () { - var tmp = new BN(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - - MPrime.prototype.ireduce = function ireduce (num) { - // Assumes that `num` is less than `P^2` - // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) - var r = num; - var rlen; - - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - if (r.strip !== undefined) { - // r is a BN v4 instance - r.strip(); - } else { - // r is a BN v5 instance - r._strip(); - } - } - - return r; - }; - - MPrime.prototype.split = function split (input, out) { - input.iushrn(this.n, 0, out); - }; - - MPrime.prototype.imulK = function imulK (num) { - return num.imul(this.k); - }; - - function K256 () { - MPrime.call( - this, - 'k256', - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); - } - inherits(K256, MPrime); - - K256.prototype.split = function split (input, output) { - // 256 = 9 * 26 + 22 - var mask = 0x3fffff; - - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs - var prev = input.words[9]; - output.words[output.length++] = prev & mask; - - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - - K256.prototype.imulK = function imulK (num) { - // K = 0x1000003d1 = [ 0x40, 0x3d1 ] - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - - // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 0x3d1; - num.words[i] = lo & 0x3ffffff; - lo = w * 0x40 + ((lo / 0x4000000) | 0); - } - - // Fast length reduction - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - - function P224 () { - MPrime.call( - this, - 'p224', - 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); - } - inherits(P224, MPrime); - - function P192 () { - MPrime.call( - this, - 'p192', - 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); - } - inherits(P192, MPrime); - - function P25519 () { - // 2 ^ 255 - 19 - MPrime.call( - this, - '25519', - '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); - } - inherits(P25519, MPrime); - - P25519.prototype.imulK = function imulK (num) { - // K = 0x13 - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 0x13 + carry; - var lo = hi & 0x3ffffff; - hi >>>= 26; - - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - - // Exported mostly for testing purposes, use plain name instead - BN._prime = function prime (name) { - // Cached version of prime - if (primes[name]) return primes[name]; - - var prime; - if (name === 'k256') { - prime = new K256(); - } else if (name === 'p224') { - prime = new P224(); - } else if (name === 'p192') { - prime = new P192(); - } else if (name === 'p25519') { - prime = new P25519(); - } else { - throw new Error('Unknown prime ' + name); - } - primes[name] = prime; - - return prime; - }; - - // - // Base reduction engine - // - function Red (m) { - if (typeof m === 'string') { - var prime = BN._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - assert(m.gtn(1), 'modulus must be greater than 1'); - this.m = m; - this.prime = null; - } - } - - Red.prototype._verify1 = function _verify1 (a) { - assert(a.negative === 0, 'red works only with positives'); - assert(a.red, 'red works only with red numbers'); - }; - - Red.prototype._verify2 = function _verify2 (a, b) { - assert((a.negative | b.negative) === 0, 'red works only with positives'); - assert(a.red && a.red === b.red, - 'red works only with red numbers'); - }; - - Red.prototype.imod = function imod (a) { - if (this.prime) return this.prime.ireduce(a)._forceRed(this); - - move(a, a.umod(this.m)._forceRed(this)); - return a; - }; - - Red.prototype.neg = function neg (a) { - if (a.isZero()) { - return a.clone(); - } - - return this.m.sub(a)._forceRed(this); - }; - - Red.prototype.add = function add (a, b) { - this._verify2(a, b); - - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.iadd = function iadd (a, b) { - this._verify2(a, b); - - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - - Red.prototype.sub = function sub (a, b) { - this._verify2(a, b); - - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.isub = function isub (a, b) { - this._verify2(a, b); - - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - - Red.prototype.shl = function shl (a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - - Red.prototype.imul = function imul (a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - - Red.prototype.mul = function mul (a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - - Red.prototype.isqr = function isqr (a) { - return this.imul(a, a.clone()); - }; - - Red.prototype.sqr = function sqr (a) { - return this.mul(a, a); - }; - - Red.prototype.sqrt = function sqrt (a) { - if (a.isZero()) return a.clone(); - - var mod3 = this.m.andln(3); - assert(mod3 % 2 === 1); - - // Fast case - if (mod3 === 3) { - var pow = this.m.add(new BN(1)).iushrn(2); - return this.pow(a, pow); - } - - // Tonelli-Shanks algorithm (Totally unoptimized and slow) - // - // Find Q and S, that Q * 2 ^ S = (P - 1) - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert(!q.isZero()); - - var one = new BN(1).toRed(this); - var nOne = one.redNeg(); - - // Find quadratic non-residue - // NOTE: Max is such because of generalized Riemann hypothesis. - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN(2 * z * z).toRed(this); - - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert(i < m); - var b = this.pow(c, new BN(1).iushln(m - i - 1)); - - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - - return r; - }; - - Red.prototype.invm = function invm (a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - - Red.prototype.pow = function pow (a, num) { - if (num.isZero()) return new BN(1).toRed(this); - if (num.cmpn(1) === 0) return a.clone(); - - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = (word >> j) & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; - - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - - return res; - }; - - Red.prototype.convertTo = function convertTo (num) { - var r = num.umod(this.m); - - return r === num ? r.clone() : r; - }; - - Red.prototype.convertFrom = function convertFrom (num) { - var res = num.clone(); - res.red = null; - return res; - }; - - // - // Montgomery method engine - // - - BN.mont = function mont (num) { - return new Mont(num); - }; - - function Mont (m) { - Red.call(this, m); - - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - (this.shift % 26); - } - - this.r = new BN(1).iushln(this.shift); - this.r2 = this.imod(this.r.sqr()); - this.rinv = this.r._invmp(this.m); - - this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); - this.minv = this.minv.umod(this.r); - this.minv = this.r.sub(this.minv); - } - inherits(Mont, Red); - - Mont.prototype.convertTo = function convertTo (num) { - return this.imod(num.ushln(this.shift)); - }; - - Mont.prototype.convertFrom = function convertFrom (num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - - Mont.prototype.imul = function imul (a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.mul = function mul (a, b) { - if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); - - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.invm = function invm (a) { - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; - })(module, bn$1); - } (bn$2)); - return bn$2.exports; - } - - var bnExports = requireBn$1(); - var _BN = /*@__PURE__*/getDefaultExportFromCjs(bnExports); - - let _permanentCensorErrors = false; - let _censorErrors = false; - const LogLevels = { - debug: 1, - default: 2, - info: 2, - warning: 3, - error: 4, - off: 5, - }; - let _logLevel = LogLevels["default"]; - let _globalLogger = null; - function _checkNormalize() { - try { - const missing = []; - // Make sure all forms of normalization are supported - ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { - try { - if ("test".normalize(form) !== "test") { - throw new Error("bad normalize"); - } - } - catch (error) { - missing.push(form); - } - }); - if (missing.length) { - throw new Error("missing " + missing.join(", ")); - } - if (String.fromCharCode(0xe9).normalize("NFD") !== - String.fromCharCode(0x65, 0x0301)) { - throw new Error("broken implementation"); - } - } - catch (error) { - return error.message; - } - return null; - } - const _normalizeError = _checkNormalize(); - var LogLevel; - (function (LogLevel) { - LogLevel["DEBUG"] = "DEBUG"; - LogLevel["INFO"] = "INFO"; - LogLevel["WARNING"] = "WARNING"; - LogLevel["ERROR"] = "ERROR"; - LogLevel["OFF"] = "OFF"; - })(LogLevel || (LogLevel = {})); - var ErrorCode; - (function (ErrorCode) { - /////////////////// - // Generic Errors - // Unknown Error - ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR"; - // Not Implemented - ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED"; - // Unsupported Operation - // - operation - ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION"; - // Network Error (i.e. Core Network, such as an invalid network ID) - // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) - ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR"; - // Some sort of bad response from the server - ErrorCode["SERVER_ERROR"] = "SERVER_ERROR"; - // Timeout - ErrorCode["TIMEOUT"] = "TIMEOUT"; - /////////////////// - // Operational Errors - // Buffer Overrun - ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN"; - // Numeric Fault - // - operation: the operation being executed - // - fault: the reason this faulted - ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT"; - /////////////////// - // Argument Errors - // Missing new operator to an object - // - name: The name of the class - ErrorCode["MISSING_NEW"] = "MISSING_NEW"; - // Invalid argument (e.g. value is incompatible with type) to a function: - // - argument: The argument name that was invalid - // - value: The value of the argument - ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT"; - // Missing argument to a function: - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT"; - // Too many arguments - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT"; - /////////////////// - // Blockchain Errors - // Call exception - // - transaction: the transaction - // - address?: the contract address - // - args?: The arguments passed into the function - // - method?: The Solidity method signature - // - errorSignature?: The EIP848 error signature - // - errorArgs?: The EIP848 error parameters - // - reason: The reason (only for EIP848 "Error(string)") - ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION"; - // Insufficient funds (< value + energyLimit * energyPrice) - // - transaction: the transaction attempted - ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS"; - // Nonce has already been used - // - transaction: the transaction attempted - ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED"; - // The replacement fee for the transaction is too low - // - transaction: the transaction attempted - ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED"; - // The energy limit could not be estimated - // - transaction: the transaction passed to estimateEnergy - ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"] = "UNPREDICTABLE_ENERGY_LIMIT"; - // The transaction was replaced by one with a higher energy price - // - reason: "cancelled", "replaced" or "repriced" - // - cancelled: true if reason == "cancelled" or reason == "replaced") - // - hash: original transaction hash - // - replacement: the full TransactionsResponse for the replacement - // - receipt: the receipt of the replacement - ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; - })(ErrorCode || (ErrorCode = {})); - const HEX = "0123456789abcdef"; - class Logger { - version = "0.0.1"; - static errors = ErrorCode; - static levels = LogLevel; - constructor(version) { - Object.defineProperty(this, "version", { - enumerable: true, - value: version, - writable: false, - }); - } - _log(logLevel, args) { - const level = logLevel.toLowerCase(); - if (LogLevels[level] == null) { - this.throwArgumentError("invalid log level name", "logLevel", logLevel); - } - if (_logLevel > LogLevels[level]) { - return; - } - console.log.apply(console, args); - } - debug(...args) { - this._log(Logger.levels.DEBUG, args); - } - info(...args) { - this._log(Logger.levels.INFO, args); - } - warn(...args) { - this._log(Logger.levels.WARNING, args); - } - makeError(message, code, params) { - // Errors are being censored - if (_censorErrors) { - return this.makeError("censored error", code, {}); - } - if (!code) { - code = Logger.errors.UNKNOWN_ERROR; - } - if (!params) { - params = {}; - } - const messageDetails = []; - Object.keys(params).forEach((key) => { - const value = params[key]; - try { - if (value instanceof Uint8Array) { - let hex = ""; - for (let i = 0; i < value.length; i++) { - hex += HEX[value[i] >> 4]; - hex += HEX[value[i] & 0x0f]; - } - messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); - } - else { - messageDetails.push(key + "=" + JSON.stringify(value)); - } - } - catch (error) { - messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); - } - }); - messageDetails.push(`code=${code}`); - messageDetails.push(`version=${this.version}`); - const reason = message; - if (messageDetails.length) { - message += " (" + messageDetails.join(", ") + ")"; - } - // @TODO: Any?? - const error = new Error(message); - error.reason = reason; - error.code = code; - Object.keys(params).forEach(function (key) { - error[key] = params[key]; - }); - return error; - } - throwError(message, code, params) { - throw this.makeError(message, code, params); - } - throwArgumentError(message, name, value) { - return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { - argument: name, - value: value, - }); - } - assert(condition, message, code, params) { - if (!!condition) { - return; - } - this.throwError(message, code, params); - } - assertArgument(condition, message, name, value) { - if (!!condition) { - return; - } - this.throwArgumentError(message, name, value); - } - checkNormalize(message) { - if (_normalizeError) { - this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "String.prototype.normalize", - form: _normalizeError, - }); - } - } - checkSafeUint53(value, message) { - if (typeof value !== "number") { - return; - } - if (message == null) { - message = "value not safe"; - } - if (value < 0 || value >= 0x1fffffffffffff) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "out-of-safe-range", - value: value, - }); - } - if (value % 1) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "non-integer", - value: value, - }); - } - } - checkArgumentCount(count, expectedCount, message) { - if (message) { - message = ": " + message; - } - else { - message = ""; - } - if (count < expectedCount) { - this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - if (count > expectedCount) { - this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - } - checkNew(target, kind) { - if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - checkAbstract(target, kind) { - if (target === kind) { - this.throwError("cannot instantiate abstract class " + - JSON.stringify(kind.name) + - " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }); - } - else if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - static globalLogger() { - if (!_globalLogger) { - _globalLogger = new Logger("logger/0.0.1"); - } - return _globalLogger; - } - static setCensorship(censorship, permanent) { - if (!censorship && permanent) { - this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - if (_permanentCensorErrors) { - if (!censorship) { - return; - } - this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - _censorErrors = !!censorship; - _permanentCensorErrors = !!permanent; - } - static setLogLevel(logLevel) { - const level = LogLevels[logLevel.toLowerCase()]; - if (level == null) { - Logger.globalLogger().warn("invalid log level - " + logLevel); - return; - } - _logLevel = level; - } - static from(version) { - return new Logger(version); - } - } - - /** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ - const logger$7 = new Logger("utils/properties/0.0.1"); - function checkType(value, type, name) { - const types = type.split("|").map((t) => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof value === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; - } - /** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ - async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); - } - /** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ - function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = types ? types[key] : null; - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { - enumerable: true, - value, - writable: false, - }); - } - } - function checkProperties(object, properties) { - if (!object || typeof object !== "object") { - logger$7.throwArgumentError("invalid object", "object", object); - } - Object.keys(object).forEach((key) => { - if (!properties[key]) { - logger$7.throwArgumentError("invalid object key - " + key, "transaction:" + key, object); - } - }); - } - - /** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ - function stringify$1(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[ " + value.map(stringify$1).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return stringify$1(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "number": - return value.toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{ " + - keys.map((k) => `${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ") + - " }"); - } - } - return `[ COULD NOT SERIALIZE ]`; - } - /** - * Returns true if the %%error%% matches an error thrown by corebc - * that matches the error %%code%%. - * - * In TypeScript envornoments, this can be used to check that %%error%% - * matches an corebcError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ - function isError(error, code) { - return error && error.code === code; - } - /** - * Returns true if %%error%% is a [[CallExceptionError]. - */ - function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); - } - /** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ - function makeError(message, code, info) { - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify$1(info)}`); - } - for (const key in info) { - const value = info[key]; - // try { - details.push(key + "=" + stringify$1(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - return error; - } - /** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ - function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } - } - /** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ - function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); - } - function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing arguemnt" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); - assert(count <= expectedCount, "too many arguemnts" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); - } - const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; - }, []); - /** - * Throws if the normalization %%form%% is not supported. - */ - function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", - info: { form }, - }); - } - /** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ - function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation, - }); - } - } - - /** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ - const logger$6 = new Logger("utils/data/0.0.1"); - function isHexable(value) { - return !!value.toHexString; - } - function isInteger(value) { - return typeof value === "number" && value == value && value % 1 === 0; - } - function isBytes$1(value) { - if (value == null) { - return false; - } - if (value.constructor === Uint8Array) { - return true; - } - if (typeof value === "string") { - return false; - } - if (!isInteger(value.length) || value.length < 0) { - return false; - } - for (let i = 0; i < value.length; i++) { - const v = value[i]; - if (!isInteger(v) || v < 0 || v >= 256) { - return false; - } - } - return true; - } - function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); - } - /** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ - function getBytes(value, name) { - return _getBytes(value, name, false); - } - /** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ - function getBytesCopy(value, name) { - return _getBytes(value, name, true); - } - /** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ - function isHexString(value, length) { - if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof length === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && value.length % 2 !== 0) { - return false; - } - return true; - } - /** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ - function isBytesLike(value) { - return isHexString(value, true) || value instanceof Uint8Array; - } - const HexCharacters = "0123456789abcdef"; - /** - * Returns a [[DataHexString]] representation of %%data%%. - */ - function hexlify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "string") { - if (value.includes(",") && value.startsWith("0x")) { - const v = value - .replace("0x", "") - .split(",") - .map((item) => Number(item)); - // @ts-ignore - value = new Uint8Array(v); - } - } - if (typeof value === "number") { - logger$6.checkSafeUint53(value, "invalid hexlify value"); - let hex = ""; - while (value) { - hex = HexCharacters[value & 0xf] + hex; - value = Math.floor(value / 16); - } - if (hex.length) { - if (hex.length % 2) { - hex = "0" + hex; - } - return "0x" + hex; - } - return "0x00"; - } - if (typeof value === "bigint") { - value = value.toString(16); - if (value.length % 2) { - return "0x0" + value; - } - return "0x" + value; - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - return value.toHexString(); - } - if (isHexString(value)) { - if (value.length % 2) { - if (options.hexPad === "left") { - value = "0x0" + value.substring(2); - } - else if (options.hexPad === "right") { - value += "0"; - } - else { - logger$6.throwArgumentError("hex data is odd-length", "value", value); - } - } - return value.toLowerCase(); - } - if (isBytes$1(value)) { - let result = "0x"; - for (let i = 0; i < value.length; i++) { - let v = value[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; - } - return logger$6.throwArgumentError("invalid hexlify value", "value", value); - } - /** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ - function concat(items) { - return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); - } - function hexDataSlice(data, offset, endOffset) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - logger$6.throwArgumentError("invalid hexData", "value", data); - } - offset = 2 + 2 * offset; - return "0x" + data.substring(offset); - } - function hexDataLength(data) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - return null; - } - return (data.length - 2) / 2; - } - /** - * Returns the length of %%data%%, in bytes. - */ - function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; - } - /** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ - function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: bytes.length, - offset: end, - }); - } - return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); - } - /** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ - function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; - } - function zeroPad(data, length, left) { - const bytes = getBytes(data); - assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1, - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); - } - /** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ - function zeroPadValue(data, length) { - return zeroPad(data, length, true); - } - /** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ - function zeroPadBytes(data, length) { - return zeroPad(data, length, false); - } - function stripZeros(value) { - let result = arrayify(value); - if (result.length === 0) { - return result; - } - // Find the first non-zero entry - let start = 0; - while (start < result.length && result[start] === 0) { - start++; - } - // If we started with zeros, strip them - if (start) { - result = result.slice(start); - } - return result; - } - function arrayify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "number") { - logger$6.checkSafeUint53(value, "invalid arrayify value"); - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value = parseInt(String(value / 256)); - } - if (result.length === 0) { - result.push(0); - } - return new Uint8Array(result); - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - value = value.toHexString(); - } - if (isHexString(value)) { - let hex = value.substring(2); - if (hex.length % 2) { - if (options.hexPad === "left") { - hex = "0x0" + hex.substring(2); - } - else if (options.hexPad === "right") { - hex += "0"; - } - else { - logger$6.throwArgumentError("hex data is odd-length", "value", value); - } - } - const result = []; - for (let i = 0; i < hex.length; i += 2) { - // @ts-ignore - result.push(parseInt(hex.substring(i, i + 2), 16)); - } - return new Uint8Array(result); - } - if (isBytes$1(value)) { - return new Uint8Array(value); - } - return logger$6.throwArgumentError("invalid arrayify value", "value", value); - } - function hexConcat(items) { - let result = "0x"; - items.forEach((item) => { - result += hexlify(item).substring(2); - }); - return result; - } - - var BN = _BN.BN; - const logger$5 = new Logger("bigNumber/0.0.1"); - const _constructorGuard = {}; - const MAX_SAFE = 0x1fffffffffffff; - // Only warn about passing 10 into radix once - let _warnedToStringRadix = false; - class BigNumber { - _hex; - _isBigNumber; - constructor(constructorGuard, hex) { - logger$5.checkNew(new.target, BigNumber); - if (constructorGuard !== _constructorGuard) { - logger$5.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "new (BigNumber)", - }); - } - this._hex = hex; - this._isBigNumber = true; - Object.freeze(this); - } - fromTwos(value) { - return toBigNumber(toBN(this).fromTwos(value)); - } - toTwos(value) { - return toBigNumber(toBN(this).toTwos(value)); - } - abs() { - if (this._hex[0] === "-") { - return BigNumber.from(this._hex.substring(1)); - } - return this; - } - add(other) { - return toBigNumber(toBN(this).add(toBN(other))); - } - sub(other) { - return toBigNumber(toBN(this).sub(toBN(other))); - } - div(other) { - const o = BigNumber.from(other); - if (o.isZero()) { - throwFault("division by zero", "div"); - } - return toBigNumber(toBN(this).div(toBN(other))); - } - mul(other) { - return toBigNumber(toBN(this).mul(toBN(other))); - } - mod(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot modulo negative values", "mod"); - } - return toBigNumber(toBN(this).umod(value)); - } - pow(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot raise to negative values", "pow"); - } - return toBigNumber(toBN(this).pow(value)); - } - and(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'and' negative values", "and"); - } - return toBigNumber(toBN(this).and(value)); - } - or(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'or' negative values", "or"); - } - return toBigNumber(toBN(this).or(value)); - } - xor(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'xor' negative values", "xor"); - } - return toBigNumber(toBN(this).xor(value)); - } - mask(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot mask negative values", "mask"); - } - return toBigNumber(toBN(this).maskn(value)); - } - shl(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shl"); - } - return toBigNumber(toBN(this).shln(value)); - } - shr(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shr"); - } - return toBigNumber(toBN(this).shrn(value)); - } - eq(other) { - return toBN(this).eq(toBN(other)); - } - lt(other) { - return toBN(this).lt(toBN(other)); - } - lte(other) { - return toBN(this).lte(toBN(other)); - } - gt(other) { - return toBN(this).gt(toBN(other)); - } - gte(other) { - return toBN(this).gte(toBN(other)); - } - isNegative() { - return this._hex[0] === "-"; - } - isZero() { - return toBN(this).isZero(); - } - toNumber() { - try { - return toBN(this).toNumber(); - } - catch (error) { - throwFault("overflow", "toNumber", this.toString()); - } - // @ts-ignore - return null; - } - toBigInt() { - try { - return BigInt(this.toString()); - } - catch (e) { } - return logger$5.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, { - value: this.toString(), - }); - } - toString() { - // Lots of people expect this, which we do not support, so check (See: #889) - if (arguments.length > 0) { - if (arguments[0] === 10) { - if (!_warnedToStringRadix) { - _warnedToStringRadix = true; - logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed"); - } - } - else if (arguments[0] === 16) { - logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - else { - logger$5.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - } - return toBN(this).toString(10); - } - toHexString() { - return this._hex; - } - toJSON(key) { - return { type: "BigNumber", hex: this.toHexString() }; - } - static from(value) { - if (value instanceof BigNumber) { - return value; - } - if (typeof value === "string") { - if (value.match(/^-?0x[0-9a-f]+$/i)) { - return new BigNumber(_constructorGuard, toHex(value)); - } - if (value.match(/^-?[0-9]+$/)) { - return new BigNumber(_constructorGuard, toHex(new BN(value))); - } - return logger$5.throwArgumentError("invalid BigNumber string", "value", value); - } - if (typeof value === "number") { - if (value % 1) { - throwFault("underflow", "BigNumber.from", value); - } - if (value >= MAX_SAFE || value <= -MAX_SAFE) { - throwFault("overflow", "BigNumber.from", value); - } - return BigNumber.from(String(value)); - } - const anyValue = value; - if (typeof anyValue === "bigint") { - return BigNumber.from(anyValue.toString()); - } - if (isBytes$1(anyValue)) { - return BigNumber.from(hexlify(anyValue)); - } - if (anyValue) { - // Hexable interface (takes priority) - if (anyValue.toHexString) { - const hex = anyValue.toHexString(); - if (typeof hex === "string") { - return BigNumber.from(hex); - } - } - else { - // For now, handle legacy JSON-ified values (goes away in v6) - let hex = anyValue._hex; - // New-form JSON - if (hex == null && anyValue.type === "BigNumber") { - hex = anyValue.hex; - } - if (typeof hex === "string") { - if (isHexString(hex) || - (hex[0] === "-" && isHexString(hex.substring(1)))) { - return BigNumber.from(hex); - } - } - } - } - return logger$5.throwArgumentError("invalid BigNumber value", "value", value); - } - static isBigNumber(value) { - return !!(value && value._isBigNumber); - } - } - // Normalize the hex string - // @ts-ignore - function toHex(value) { - // For BN, call on the hex string - if (typeof value !== "string") { - return toHex(value.toString(16)); - } - // If negative, prepend the negative sign to the normalized positive value - if (value[0] === "-") { - // Strip off the negative sign - value = value.substring(1); - // Cannot have multiple negative signs (e.g. "--0x04") - if (value[0] === "-") { - logger$5.throwArgumentError("invalid hex", "value", value); - } - // Call toHex on the positive component - value = toHex(value); - // Do not allow "-0x00" - if (value === "0x00") { - return value; - } - // Negate the value - return "-" + value; - } - // Add a "0x" prefix if missing - if (value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - // Normalize zero - if (value === "0x") { - return "0x00"; - } - // Make the string even length - if (value.length % 2) { - value = "0x0" + value.substring(2); - } - // Trim to smallest even-length string - while (value.length > 4 && value.substring(0, 4) === "0x00") { - value = "0x" + value.substring(4); - } - return value; - } - // @ts-ignore - function toBigNumber(value) { - return BigNumber.from(toHex(value)); - } - // @ts-ignore - function toBN(value) { - const hex = BigNumber.from(value).toHexString(); - if (hex[0] === "-") { - return new BN("-" + hex.substring(3), 16); - } - return new BN(hex.substring(2), 16); - } - function throwFault(fault, operation, value) { - const params = { fault: fault, operation: operation }; - if (value != null) { - params.value = value; - } - return logger$5.throwError(fault, Logger.errors.NUMERIC_FAULT, params); - } - - const logger$4 = new Logger("rlp/0.0.1"); - function arrayifyInteger$1(value) { - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value >>= 8; - } - return result; - } - function unarrayifyInteger$1(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; - } - function _encode$1(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode$1(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger$1(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - if (!isBytesLike(object)) { - logger$4.throwArgumentError("RLP object must be BytesLike", "object", object); - } - const data = Array.prototype.slice.call(arrayify(object)); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger$1(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); - } - function encode(object) { - return hexlify(_encode$1(object)); - } - function _decodeChildren$1(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode$1(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - if (childOffset > offset + 1 + length) { - logger$4.throwError("child data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - } - return { consumed: 1 + length, result: result }; - } - // returns { consumed: number, result: Object } - function _decode$1(data, offset) { - if (data.length === 0) { - logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - if (offset + 1 + lengthLength > data.length) { - logger$4.throwError("data short segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger$1(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger$4.throwError("data long segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren$1(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - if (offset + 1 + length > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren$1(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - if (offset + 1 + lengthLength > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger$1(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger$4.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - if (offset + 1 + length > data.length) { - logger$4.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlify(data[offset]) }; - } - function decode$1(data) { - const bytes = arrayify(data); - const decoded = _decode$1(bytes, 0); - if (decoded.consumed !== bytes.length) { - logger$4.throwArgumentError("invalid rlp data", "data", data); - } - return decoded.result; - } - - const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))(); - const _32n = /* @__PURE__ */ BigInt(32); - // Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high - // }` to match little-endian word order rather than the property names. - function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; - } - // Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array - // holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`. - function split(lst, le = false) { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; - } - // Split a JS number into u32 halves without a BigInt allocation. Exact only for integers - // `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below - // that (an ArrayBuffer cannot exceed 2**53 - 1 bytes). - const fromNumH = (n) => (n / 2 ** 32) | 0; - const fromNumL = (n) => n >>> 0; - // Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call - // BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`. - function setU64FromNum(view, byteOffset, n, isLE) { - const h = fromNumH(n); - const l = fromNumL(n); - view.setUint32(byteOffset, isLE ? l : h, isLE); - view.setUint32(byteOffset + 4, isLE ? h : l, isLE); - } - // High 32-bit half of a 64-bit logical right shift for `s` in `0..31`. - const shrSH = (h, _l, s) => h >>> s; - // Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`. - const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); - // High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. - const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); - // Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. - const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); - // High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. - const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); - // Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. - const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); - // 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps - // local copies so V8 inlines them into keccakP. - // Add two split 64-bit words and return the split `{ h, l }` sum. - // JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out - // of the low sum and instead use division. - function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; - } - // Addition with more than 2 elements - // Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`. - const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); - // High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`. - const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; - // Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`. - const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); - // High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`. - const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; - // Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`. - const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); - // High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`. - const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; - - /** - * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. - * @param a - value to test - * @returns `true` when the value is a Uint8Array-compatible view. - * @example - * Check whether a value is a Uint8Array-compatible view. - * ```ts - * isBytes(new Uint8Array([1, 2, 3])); - * ``` - */ - function isBytes(a) { - // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases. - // The fallback still requires a real ArrayBuffer view, so plain - // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and - // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views. - return (a instanceof Uint8Array || - (ArrayBuffer.isView(a) && - a.constructor.name === 'Uint8Array' && - 'BYTES_PER_ELEMENT' in a && - a.BYTES_PER_ELEMENT === 1)); - } - // Shared error-message prefix builder. Only called on throw paths, so assert - // success paths never pay for the string concatenation. - const atitle = (title) => (title ? `"${title}" ` : ''); - /** - * Asserts something is a non-negative integer. - * @param n - number to validate - * @param title - label included in thrown errors - * @returns The validated number. - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Validate a non-negative integer option. - * ```ts - * anumber(32, 'length'); - * ``` - */ - function anumber(n, title = '') { - if (typeof n !== 'number') - throw new TypeError(atitle(title) + 'expected number, got ' + typeof n); - if (!Number.isSafeInteger(n) || n < 0) - throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n); - return n; - } - /** - * Asserts something is a boolean. - * @param value - value to validate - * @param title - label included in thrown errors - * @returns The validated boolean. - * @throws On wrong argument types. {@link TypeError} - * @example - * Validate a boolean option. - * ```ts - * abool(true, 'enableXOF'); - * ``` - */ - function abool(value, title = '') { - if (typeof value !== 'boolean') - throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value); - return value; - } - /** - * Asserts something is Uint8Array. - * @param value - value to validate - * @param length - optional exact length constraint - * @param title - label included in thrown errors - * @returns The validated byte array. - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Validate that a value is a byte array. - * ```ts - * abytes(new Uint8Array([1, 2, 3])); - * ``` - */ - function abytes(value, length, title = '') { - // Success path first: this runs at the start of every update() / digestInto(), and the - // common `abytes(data)` form must not pay for length handling it does not use. - if (isBytes(value) && (length === undefined)) - return value; - const bytes = isBytes(value); - const ofLen = ''; - const got = bytes ? `length=${value.length}` : `type=${typeof value}`; - const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got; - if (!bytes) - throw new TypeError(message); - throw new RangeError(message); - } - /** - * Asserts something is a wrapped hash constructor. - * @param h - hash constructor to validate - * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError} - * @throws On invalid hash metadata ranges or values. {@link RangeError} - * @throws If the hash metadata allows empty outputs or block sizes. {@link Error} - * @example - * Validate a callable hash wrapper. - * ```ts - * import { ahash } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * ahash(sha256); - * ``` - */ - function ahash(h) { - if (typeof h !== 'function' || typeof h.create !== 'function') - throw new TypeError('expected hash wrapped by utils.createHasher'); - anumber(h.outputLen); - anumber(h.blockLen); - // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass - // validation and can produce empty outputs instead of failing fast. - if (h.outputLen < 1 || h.blockLen < 1) - throw new Error('hash blockLen / outputLen must be >= 1'); - } - const aobject = (value, label) => { - if (value === null || typeof value !== 'object' || Array.isArray(value)) - throw new TypeError((label === 'object' ? '' : `"${label}" `) + 'expected object, got type=' + typeof value); - }; - const aopts = (value, label) => { - aobject(value, label); - const proto = Object.getPrototypeOf(value); - if (proto !== Object.prototype && proto !== null) - throw new TypeError(`"${label}" expected plain object`); - // Object.assign() treats an own "__proto__" source key as a write to the target's legacy - // prototype setter. Reject it before merging so inherited option values cannot be injected. - if (Object.hasOwn(value, '__proto__')) - throw new TypeError(`"${label}.__proto__" is not allowed`); - }; - /** - * Asserts a hash instance has not been destroyed or finished. - * @param instance - hash instance to validate - * @param checkFinished - whether to reject finalized instances - * @throws If the hash instance has already been destroyed or finalized. {@link Error} - * @example - * Validate that a hash instance is still usable. - * ```ts - * import { aexists } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const hash = sha256.create(); - * aexists(hash); - * ``` - */ - function aexists(instance, checkFinished = true) { - // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their - // truthiness is checked - re-validating their type per call was pure hot-path overhead. - if (instance.destroyed) - throw new Error('hash was destroyed'); - if (checkFinished && instance.finished) - throw new Error('digest() was already called'); - } - /** - * Asserts output is a sufficiently-sized byte array. - * @param out - destination buffer - * @param instance - hash instance providing output length - * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes. - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Validate a caller-provided digest buffer. - * ```ts - * import { aoutput } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const hash = sha256.create(); - * aoutput(new Uint8Array(hash.outputLen), hash); - * ``` - */ - function aoutput(out, instance) { - abytes(out, undefined, 'output'); - // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast - // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call. - const min = instance.outputLen; - if (!(out.length >= min)) { - throw new RangeError('"output" expected length >= ' + min); - } - } - /** - * Casts a typed array view to Uint32Array. - * `arr.byteOffset` must already be 4-byte aligned or the platform - * Uint32Array constructor will throw. - * @param arr - source typed array - * @returns Uint32Array view over the same buffer. - * @example - * Reinterpret a byte array as 32-bit words. - * ```ts - * u32(new Uint8Array(8)); - * ``` - */ - function u32(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); - } - /** - * Zeroizes typed arrays in place. Warning: JS provides no guarantees. - * @param arrays - arrays to overwrite with zeros - * @example - * Zeroize sensitive buffers in place. - * ```ts - * clean(new Uint8Array([1, 2, 3])); - * ``` - */ - function clean(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } - } - /** - * Creates a DataView for byte-level manipulation. - * @param arr - source typed array - * @returns DataView over the same buffer region. - * @example - * Create a DataView over an existing buffer. - * ```ts - * createView(new Uint8Array(4)); - * ``` - */ - function createView(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); - } - /** - * Rotate-right operation for uint32 values. - * @param word - source word - * @param shift - shift amount in bits - * @returns Rotated word. - * @example - * Rotate a 32-bit word to the right. - * ```ts - * rotr(0x12345678, 8); - * ``` - */ - function rotr(word, shift) { - return (word << (32 - shift)) | (word >>> shift); - } - /** - * Rotate-left operation for uint32 values. - * @param word - source word - * @param shift - shift amount in bits - * @returns Rotated word. - * @example - * Rotate a 32-bit word to the left. - * ```ts - * rotl(0x12345678, 8); - * ``` - */ - function rotl(word, shift) { - return (word << shift) | ((word >>> (32 - shift)) >>> 0); - } - /** Whether the current platform is little-endian. */ - const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); - /** - * Byte-swap operation for uint32 values. - * @param word - source word - * @returns Word with reversed byte order. - * @example - * Reverse the byte order of a 32-bit word. - * ```ts - * byteSwap(0x11223344); - * ``` - */ - function byteSwap(word) { - return (((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff)); - } - /** - * Byte-swaps every word of a Uint32Array in place. - * @param arr - array to mutate - * @returns The same array after mutation; callers pass live state arrays here. - * @example - * Reverse the byte order of every word in place. - * ```ts - * byteSwap32(new Uint32Array([0x11223344])); - * ``` - */ - function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } - return arr; - } - /** - * Conditionally byte-swaps a Uint32Array on big-endian platforms. - * @param u - array to normalize for host endianness - * @returns Original or byte-swapped array depending on platform endianness. - * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`. - * @example - * Normalize a word array for host endianness. - * ```ts - * swap32IfBE(new Uint32Array([0x11223344])); - * ``` - */ - const swap32IfBE = isLE - ? (u) => u - : byteSwap32; - /** - * Yields to the host task scheduler so timers, I/O, and rendering can make progress. - * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback. - * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so - * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while - * still allowing other event-loop work to proceed. - * @param onReject - optional cleanup invoked only if the host yield fails - * @example - * Yield to the next scheduler tick. - * ```ts - * await nextTick(); - * ``` - */ - function nextTick(onReject) { - const host = globalThis; - if (typeof host.scheduler?.yield === 'function') { - const promise = host.scheduler.yield(); - // Keep the original scheduler rejection; this handler exists only for cleanup. - if (onReject) - promise.catch(onReject); - return promise; - } - return new Promise((resolve) => host.setTimeout(resolve, 0)); - } - /** - * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops. - * @param iters - number of loop iterations to run - * @param tick - maximum time slice in milliseconds - * @param cb - callback executed on each iteration - * @param onReject - optional cleanup invoked only if a host yield fails - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Run a loop that periodically yields back to the event loop. - * ```ts - * await asyncLoop(2, 0, () => {}); - * ``` - */ - async function asyncLoop(iters, tick, cb, onReject) { - anumber(iters, 'iters'); - anumber(tick, 'tick'); - if (typeof cb !== 'function') - throw new TypeError('callback must be a function'); - // Callback is synchronous by contract; asyncLoop only yields between sync work windows. - let ts = Date.now(); - for (let i = 0; i < iters; i++) { - cb(i); - // Date.now() is not monotonic, so in case if clock goes backwards we return return control too - const diff = Date.now() - ts; - if (diff >= 0 && diff < tick) - continue; - await nextTick(onReject); - // Track only synchronous work time; scheduler delay after yielding is outside our budget. - ts = Date.now(); - } - } - /** - * Converts string to bytes using UTF8 encoding. - * Built-in doesn't validate input to be string: we do the check. - * Non-ASCII details are delegated to the platform `TextEncoder`. - * @param str - string to encode - * @returns UTF-8 encoded bytes. - * @throws On wrong argument types. {@link TypeError} - * @example - * Encode a string as UTF-8 bytes. - * ```ts - * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99]) - * ``` - */ - function utf8ToBytes(str) { - if (typeof str !== 'string') - throw new TypeError('string expected'); - const encoded = new TextEncoder().encode(str); - try { - // Copy into the current realm for Firefox extension contexts. Callers that own the returned - // buffer can then wipe it independently of TextEncoder's temporary result. - return new Uint8Array(encoded); // https://bugzil.la/1681809 - } - finally { - clean(encoded); - } - } - /** - * Helper for KDFs: consumes Uint8Array or string. - * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer. - * @param data - user-provided KDF input - * @param errorTitle - label included in thrown errors - * @returns Byte representation of the input. - * @throws On wrong argument types. {@link TypeError} - * @example - * Normalize KDF input to bytes. - * ```ts - * kdfInputToBytes('password'); - * ``` - */ - function kdfInputToBytes(data, errorTitle = '') { - if (typeof data === 'string') - return utf8ToBytes(data); - return abytes(data, undefined, errorTitle); - } - /** - * Merges default options and passed options. - * @param defaults - base option object - * @param opts - user overrides - * @param title - label included in thrown override errors - * @returns Fresh merged option object with a null prototype. - * @throws On wrong argument types. {@link TypeError} - * @example - * Merge user overrides onto default options. - * ```ts - * checkOpts({ dkLen: 32 }, { asyncTick: 10 }); - * ``` - */ - function checkOpts(defaults, opts, title = 'opts') { - aopts(defaults, 'defaults'); - if (opts !== undefined) - aopts(opts, title); - // Callers read optional fields directly, so omitted values must not fall through to ambient - // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output). - const merged = Object.assign(Object.create(null), defaults, opts); - return merged; - } - /** - * Creates a callable hash function from a stateful class constructor. - * @param hashCons - hash constructor or factory - * @param info - optional metadata such as DER OID - * @returns Frozen callable hash wrapper with `.create()`. - * Wrapper construction eagerly calls `hashCons(undefined)` once to read - * `outputLen` / `blockLen`, so constructor side effects happen at module - * init time. - * @throws On wrong argument types. {@link TypeError} - * @example - * Wrap a stateful hash constructor into a callable helper. - * ```ts - * import { createHasher } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const wrapped = createHasher(sha256.create, { oid: sha256.oid }); - * wrapped(new Uint8Array([1])); - * ``` - */ - function createHasher(hashCons, info = {}) { - if (typeof hashCons !== 'function') - throw new TypeError('"hashCons" expected function, got type=' + typeof hashCons); - info = checkOpts({}, info, 'info'); - const hashC = (msg, opts) => hashCons(opts) - .update(msg) - .digest(); - const tmp = hashCons(undefined); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.canXOF = tmp.canXOF; - hashC.create = (opts) => hashCons(opts); - Object.assign(hashC, info); - return Object.freeze(hashC); - } - /** - * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`. - * @param suffix - final OID byte for the selected hash. - * The helper accepts any byte even though only the documented NIST hash - * suffixes are meaningful downstream. - * @returns Object containing the DER-encoded OID. - * @example - * Build OID metadata for a NIST hash. - * ```ts - * oidNist(0x01); - * ``` - */ - const oidNist = (suffix) => ({ - // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet. - // Larger suffix values would need base-128 OID encoding and a different length byte. - oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]), - }); - - /** - * Internal Merkle-Damgard hash utils. - * @module - */ - /** - * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`. - * Returns bits from `b` when `a` is set, otherwise from `c`. - * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never - * set the same bit. - * @param a - selector word - * @param b - word chosen when selector bit is set - * @param c - word chosen when selector bit is clear - * @returns Mixed 32-bit word. - * @example - * Combine three words with the shared 32-bit choice primitive. - * ```ts - * Chi(0xffffffff, 0x12345678, 0x87654321); - * ``` - */ - function Chi(a, b, c) { - return (a & b) ^ (~a & c); - } - /** - * Shared 32-bit majority primitive reused by SHA-256 and SHA-1. - * Returns bits shared by at least two inputs. - * @param a - first input word - * @param b - second input word - * @param c - third input word - * @returns Mixed 32-bit word. - * @example - * Combine three words with the shared 32-bit majority primitive. - * ```ts - * Maj(0xffffffff, 0x12345678, 0x87654321); - * ``` - */ - function Maj(a, b, c) { - return (a & b) ^ (a & c) ^ (b & c); - } - /** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit - * strings with partial-byte tails. - * @param blockLen - internal block size in bytes - * @param outputLen - digest size in bytes - * @param padOffset - trailing length field size in bytes - * @param isLE - whether length and state words are encoded in little-endian - * @example - * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow. - * ```ts - * import { _SHA1 } from '@noble/hashes/legacy.js'; - * const hash = new _SHA1(); - * hash.update(new Uint8Array([97, 98, 99])); - * hash.digest(); - * ``` - */ - class HashMD { - blockLen; - outputLen; - canXOF = false; - padOffset; - isLE; - // For partial updates less than block size - buffer; - view; - finished = false; - length = 0; - pos = 0; - destroyed = false; - constructor(blockLen, outputLen, padOffset, isLE) { - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - aexists(this); - abytes(data); - const { view, buffer, blockLen } = this; - const len = data.length; - let processed = false; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path only when there is no buffered partial block: `take === blockLen` implies - // `this.pos === 0`, so we can process full blocks directly from the input view. - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - processed = true; - continue; - } - // When the whole input is buffered in one go (common for short messages), passing `data` - // directly avoids allocating a subarray view. - buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - processed = true; - } - } - this.length += data.length; - // Shared schedule buffers only pick up input-derived words inside process(); if everything - // was buffered without processing, there is nothing to zero. - if (processed) - this.roundClean(); - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message, then zero-pad the rest of the block - buffer[pos++] = 0b10000000; - buffer.fill(0, pos); - // we have less than padOffset left in buffer, so we cannot put length in - // current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - buffer.fill(0); - } - // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from - // the padding fill above, and JS will overflow before user input can make that half non-zero. - // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an - // integer below 2**53, so the split inside the helper stays exact). - setU64FromNum(view, blockLen - 8, this.length * 8, isLE); - this.process(view, 0); - // The final block above is processed outside update(), so the shared message-schedule - // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest(). - this.roundClean(); - // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one. - const oview = out === buffer ? view : createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT - const outLen = len / 4; - const state = this.get(); - // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state. - if (len % 4 || outLen > state.length) - throw new Error('invalid outputLen'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return - // fresh bytes to the caller. - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneIntoMeta(to) { - const { buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and - // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it. - if (pos) - to.buffer.set(buffer); // Avoid a hot modulo guard. - return to; - } - clone() { - return this._cloneInto(); - } - } - /** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ - /** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the - * square roots of the first eight prime numbers. Exported as a shared table; callers must treat - * it as read-only because constructors copy words from it by index. */ - const SHA256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, - ]); - /** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen - * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first - * eight prime numbers. Exported as a shared table; callers must treat it as read-only because - * constructors copy halves from it by index. */ - const SHA512_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, - ]); - - /** - - SHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions. - RFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors, - not the base RIPEMD-160 compression spec. - Don't use them in a new protocol. What "weak" means: - - - Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. - - No practical pre-image attacks (only theoretical, 2^123.4) - - HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151 - * @module - */ - // RIPEMD-160 - // Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables. - const Rho160 = /* @__PURE__ */ Uint8Array.from([ - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, - ]); - const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); - const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); - // Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds. - const idxLR = /* @__PURE__ */ (() => { - const L = [Id160]; - const R = [Pi160]; - const res = [L, R]; - for (let i = 0; i < 4; i++) - for (let j of res) - j.push(j[i].map((k) => Rho160[k])); - return res; - })(); - const idxL = /* @__PURE__ */ (() => idxLR[0])(); - const idxR = /* @__PURE__ */ (() => idxLR[1])(); - // const [idxL, idxR] = idxLR; - // Base per-group shift table before the left/right message-order permutations are applied. - const shifts160 = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], - ].map((i) => Uint8Array.from(i)); - const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); - const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); - // Five left-lane additive constants for RIPEMD-160. - const Kl160 = /* @__PURE__ */ Uint32Array.from([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, - ]); - // Five right-lane additive constants for RIPEMD-160. - const Kr160 = /* @__PURE__ */ Uint32Array.from([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, - ]); - // Called `f()` in the spec; valid `group` values are 0..4, and out-of-range - // inputs currently fall through to the group-4 branch. - function ripemd_f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - if (group === 1) - return (x & y) | (~x & z); - if (group === 2) - return (x | ~y) ^ z; - if (group === 3) - return (x & z) | (y & ~z); - return x ^ (y | ~z); - } - // Reusable 16-word RIPEMD-160 message block buffer. - const BUF_160 = /* @__PURE__ */ new Uint32Array(16); - /** - * Internal RIPEMD-160 legacy hash class. - * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification. - */ - class _RIPEMD160 extends HashMD { - h0 = 0x67452301 | 0; - h1 = 0xefcdab89 | 0; - h2 = 0x98badcfe | 0; - h3 = 0x10325476 | 0; - h4 = 0xc3d2e1f0 | 0; - constructor() { - super(64, 20, 8, true); - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - _cloneInto(to) { - (to ||= new this.constructor()).set(...this.get()); - return this._cloneIntoMeta(to); - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF_160[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order. - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - clean(BUF_160); - } - destroy() { - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0); - } - } - /** - * RIPEMD-160 - a legacy hash function from 1990s. - * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point - * at the base RIPEMD-160 references. - * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html} - * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf} - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with RIPEMD-160. - * ```ts - * ripemd160(new Uint8Array([97, 98, 99])); - * ``` - */ - const ripemd160$1 = /* @__PURE__ */ createHasher(() => new _RIPEMD160()); - - /** - * HMAC: RFC2104 message authentication code. - * @module - */ - /** - * Internal class for HMAC. - * Accepts any byte key, although RFC 2104 §3 recommends keys at least - * `HashLen` bytes long. - */ - class _HMAC { - oHash; - iHash; - blockLen; - outputLen; - canXOF = false; - finished = false; - destroyed = false; - constructor(hash, key) { - ahash(hash); - abytes(key, undefined, 'key'); - this.iHash = hash.create(); - if (typeof this.iHash.update !== 'function') - throw new Error('expected Hash instance'); - this.blockLen = this.iHash.blockLen; - this.outputLen = this.iHash.outputLen; - const blockLen = this.blockLen; - const pad = new Uint8Array(blockLen); - // blockLen can be bigger than outputLen - pad.set(key.length > blockLen ? hash.create().update(key).digest() : key); - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36; - this.iHash.update(pad); - // By doing update (processing of the first block) of the outer hash here, - // we can re-use it between multiple calls via clone. - this.oHash = hash.create(); - // Undo internal XOR && apply outer XOR - for (let i = 0; i < pad.length; i++) - pad[i] ^= 0x36 ^ 0x5c; - this.oHash.update(pad); - clean(pad); - } - update(buf) { - aexists(this); - this.iHash.update(buf); - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - const buf = out.subarray(0, this.outputLen); - // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before - // overwriting that same prefix with the final tag, leaving any oversized tail untouched. - this.iHash.digestInto(buf); - this.oHash.update(buf); - this.oHash.digestInto(buf); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.oHash.outputLen); - this.digestInto(out); - return out; - } - _cloneInto(to) { - // Create new instance without calling constructor since the key - // is already in state and we don't know it. - to ||= Object.create(Object.getPrototypeOf(this), {}); - const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this; - to = to; - to.finished = finished; - to.destroyed = destroyed; - to.blockLen = blockLen; - to.outputLen = outputLen; - to.canXOF = canXOF; - to.oHash = oHash._cloneInto(to.oHash); - to.iHash = iHash._cloneInto(to.iHash); - return to; - } - clone() { - return this._cloneInto(); - } - destroy() { - this.destroyed = true; - this.oHash.destroy(); - this.iHash.destroy(); - } - } - const hmac$1 = /* @__PURE__ */ (() => { - const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest()); - hmac_.create = (hash, key) => new _HMAC(hash, key); - return hmac_; - })(); - - /** - * PBKDF (RFC 2898). Can be used to create a key from password and salt. - * @module - */ - // Common validation and per-call state setup for sync/async functions. - function pbkdf2Init(hash, _password, _salt, _opts) { - ahash(hash); - const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts); - const { c, dkLen, asyncTick } = opts; - anumber(c, 'c'); - anumber(dkLen, 'dkLen'); - anumber(asyncTick, 'asyncTick'); - if (c < 1) - throw new Error('"c" (iterations) must be >= 1'); - // RFC 8018 §5.2 defines `dkLen` as "a positive integer". - if (dkLen < 1) - throw new Error('"dkLen" must be >= 1'); - // RFC 8018 §5.2 step 1 requires rejecting oversize `dkLen` - // before allocating the destination buffer. - if (dkLen > (2 ** 32 - 1) * hash.outputLen) - throw new Error('derived key too long'); - const p = kdfInputToBytes(_password, 'password'); - try { - const s = kdfInputToBytes(_salt, 'salt'); - try { - // DK = PBKDF2(PRF, Password, Salt, c, dkLen); - const DK = new Uint8Array(dkLen); - const { iHash, oHash, outputLen } = hmac$1.create(hash, p); - // Drive keyed hashes directly; the wrapper is only needed to initialize their HMAC midstates. - const u = new Uint8Array(outputLen); - const eng = pbkdf2Engine(iHash, oHash, s, u); - return { c, dkLen, asyncTick, DK, outputLen, eng }; - } - finally { - // Uint8Array inputs belong to the caller; only wipe our UTF-8 conversion. - if (typeof _salt === 'string') - clean(s); - } - } - finally { - if (typeof _password === 'string') - clean(p); - } - } - // Per-call PRF driver writes U1 into both `u` and `Ti`, then later digests into `u`; - // shared by the sync and async variants. - function pbkdf2Engine(iHash, oHash, salt, u) { - const counter = new Uint8Array(4); - const view = createView(counter); - // Full clones retain tree/config state; absorb salt before async yields without cloning input. - const salted = iHash._cloneInto().update(salt); - // u1() overwrites the worker before reading it. Seed from the outer midstate so a long salt - // cannot pre-populate a tree stack that the first reset would abandon without wiping. - const work = oHash._cloneInto(); - const iClone = iHash._cloneInto; // Capture before mixed feedback can materialize state tuples. - const oClone = oHash._cloneInto; - return { - u1: (ti, Ti) => { - view.setInt32(0, ti, false); - salted._cloneInto(work).update(counter).digestInto(u); - oHash._cloneInto(work).update(u).digestInto(u); - Ti.set(u.subarray(0, Ti.length)); - }, - // Whole `F` inner loop for the sync variant: one optimized function owns the hot loop. - rounds: (c, Ti) => { - for (let ui = 1; ui < c; ui++) { - iClone.call(iHash, work).update(u).digestInto(u); - oClone.call(oHash, work).update(u).digestInto(u); - for (let i = 0; i < Ti.length; i++) - Ti[i] ^= u[i]; - } - }, - output: (DK) => { - // Keyed templates and derived worker states are secret material. - iHash.destroy(); - oHash.destroy(); - salted.destroy(); - work.destroy(); - // Shared sync/async cleanup point: wipe transient PRF state - // while preserving the derived key buffer. - clean(u); - return DK; - }, - }; - } - /** - * PBKDF2-HMAC: RFC 8018 key derivation function. - * @param hash - hash function that would be used e.g. sha256 - * @param password - password from which a derived key is generated; - * JS string inputs are UTF-8 encoded first - * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first - * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided, - * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}. - * @returns Derived key bytes. - * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error} - * @example - * PBKDF2-HMAC: RFC 2898 key derivation function. - * ```ts - * import { pbkdf2 } from '@noble/hashes/pbkdf2.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) }); - * ``` - */ - function pbkdf2$3(hash, password, salt, opts) { - const { c, dkLen, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts); - // DK = T1 + T2 + ⋯ + Tdklen/hlen - for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) { - // Ti = F(Password, Salt, c, i) - // The last Ti view can be shorter than hLen, which applies - // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies. - const Ti = DK.subarray(pos, pos + outputLen); - // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc - // U1 = PRF(Password, Salt + INT_32_BE(i)) - eng.u1(ti, Ti); - // Uc = PRF(Password, Uc−1); Ti ^= Uc - eng.rounds(c, Ti); - } - return eng.output(DK); - } - - /** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and - * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}. - * @module - */ - /** - * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits - * of the cube roots of the first 64 primes (2..311). - */ - // prettier-ignore - const SHA256_K = /* @__PURE__ */ Uint32Array.from([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 - ]); - /** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */ - const SHA256_W = /* @__PURE__ */ new Uint32Array(64); - /** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */ - class SHA2_32B extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // Numeric initializers matter: starting the fields as `undefined` changes - // V8's field representation and makes sha256 3x slower (measured). - A = 0; - B = 0; - C = 0; - D = 0; - E = 0; - F = 0; - G = 0; - H = 0; - constructor(outputLen, IV) { - super(64, outputLen, 8, false); - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - _cloneInto(to) { - (to ||= new this.constructor()).set(...this.get()); - return this._cloneIntoMeta(to); - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - clean(SHA256_W); - } - destroy() { - // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves - // update()/digest() callable on reused instances. - this.destroyed = true; - this.set(0, 0, 0, 0, 0, 0, 0, 0); - clean(this.buffer); - } - } - /** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */ - class _SHA256 extends SHA2_32B { - constructor() { - super(32, SHA256_IV); - } - } - // SHA2-512 is slower than sha256 in js because u64 operations are slow. - // SHA-384 / SHA-512 round constants from RFC 6234 §5.2: - // 80 full 64-bit words split into high/low halves. - // prettier-ignore - const K512 = /* @__PURE__ */ (() => split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' - ].map(n => BigInt(n))))(); - const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); - const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); - // Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. - const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); - // Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. - const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); - /** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */ - class SHA2_64B extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // h -- high 32 bits, l -- low 32 bits - // Numeric initializers matter: starting the fields as `undefined` changes - // V8's field representation and slows hashing down (measured on sha256). - Ah = 0; - Al = 0; - Bh = 0; - Bl = 0; - Ch = 0; - Cl = 0; - Dh = 0; - Dl = 0; - Eh = 0; - El = 0; - Fh = 0; - Fl = 0; - Gh = 0; - Gl = 0; - Hh = 0; - Hl = 0; - constructor(outputLen, IV) { - super(128, outputLen, 16, false); - this.Ah = IV[0] | 0; - this.Al = IV[1] | 0; - this.Bh = IV[2] | 0; - this.Bl = IV[3] | 0; - this.Ch = IV[4] | 0; - this.Cl = IV[5] | 0; - this.Dh = IV[6] | 0; - this.Dl = IV[7] | 0; - this.Eh = IV[8] | 0; - this.El = IV[9] | 0; - this.Fh = IV[10] | 0; - this.Fl = IV[11] | 0; - this.Gh = IV[12] | 0; - this.Gl = IV[13] | 0; - this.Hh = IV[14] | 0; - this.Hl = IV[15] | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - _cloneInto(to) { - (to ||= new this.constructor()).set(...this.get()); - return this._cloneIntoMeta(to); - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7); - const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6); - const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6); - // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16]; - const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41); - const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39); - const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = add3L(T1l, sigma0l, MAJl); - Ah = add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - clean(SHA512_W_H, SHA512_W_L); - } - destroy() { - // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves - // update()/digest() callable on reused instances. - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } - } - /** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */ - class _SHA512 extends SHA2_64B { - constructor() { - super(64, SHA512_IV); - } - } - /** - * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info: - * - * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack. - * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - Each sha256 hash is executing 2^18 bit operations. - * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA2-256. - * ```ts - * sha256(new Uint8Array([97, 98, 99])); - * ``` - */ - const sha256$2 = /* @__PURE__ */ createHasher(() => new _SHA256(), - /* @__PURE__ */ oidNist(0x01)); - /** - * SHA2-512 hash function from RFC 4634. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA2-512. - * ```ts - * sha512(new Uint8Array([97, 98, 99])); - * ``` - */ - const sha512$1 = /* @__PURE__ */ createHasher(() => new _SHA512(), - /* @__PURE__ */ oidNist(0x03)); - - /** - * SHA3 (keccak) hash function, based on a new "Sponge function" design. - * Different from older hashes, the internal state is bigger than output size. - * - * Check out - * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202}, - * {@link https://keccak.team/keccak.html | Website}, and - * {@link https://crypto.stackexchange.com/q/15727 | the differences between - * SHA-3 and Keccak}. - * - * Check out `sha3-addons` module for cSHAKE, k12, and others. - * @module - */ - // No __PURE__ annotations in sha3 header: - // EVERYTHING is in fact used on every export. - // Various per round constants calculations - const _0n = BigInt(0); - const _1n = BigInt(1); - const _2n = BigInt(2); - const _7n = BigInt(7); - const _256n = BigInt(256); - // FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors - // taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`. - const _0x71n = BigInt(0x71); - const SHA3_PI = []; - const SHA3_ROTL = []; - const _SHA3_IOTA = []; // no pure annotation: var is always used - for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); - } - const IOTAS = split(_SHA3_IOTA, true); - // `split(..., true)` keeps the local little-endian lane-word layout used by - // `state32`, so these `H` / `L` tables follow the file's first-word / - // second-word lane slots rather than `_u64.ts`'s usual high/low naming. - const SHA3_IOTA_H = IOTAS[0]; - const SHA3_IOTA_L = IOTAS[1]; - // 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can - // inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only - // consumer of left-rotates; other hashes use right-rotates from _u64. - // Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64. - const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); - const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); - const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); - const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); - const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); - const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); - // Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2. - // keccakP never calls user code, so the shared buffer cannot be observed mid-permutation. - const B = new Uint32Array(5 * 2); - /** - * `keccakf1600` internal permutation, additionally allows adjusting the round count. - * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words - * in this file's local little-endian lane-word order - * @param rounds - number of rounds to execute - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @throws If `rounds` is outside the supported `1..24` range. {@link Error} - * @example - * Permute a Keccak state with the default 24 rounds. - * ```ts - * keccakP(new Uint32Array(50)); - * ``` - */ - function keccakP(s, rounds = 24) { - if (!(s instanceof Uint32Array)) - throw new TypeError('"s" expected Uint32Array(50), got type=' + typeof s); - if (s.length !== 50) - throw new RangeError('"s" expected Uint32Array(50), got length=' + s.length); - anumber(rounds, 'rounds'); - // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table. - if (rounds < 1 || rounds > 24) - throw new Error('"rounds" expected integer 1..24'); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - // Same as: - // for (let x = 0; x < 10; x++) B[x] = s[y + x]; - // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - for (let y = 0; y < 50; y += 10) { - const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3]; - s[y] ^= ~s[y + 2] & s[y + 4]; - s[y + 1] ^= ~s[y + 3] & s[y + 5]; - s[y + 2] ^= ~s[y + 4] & s[y + 6]; - s[y + 3] ^= ~s[y + 5] & s[y + 7]; - s[y + 4] ^= ~s[y + 6] & s[y + 8]; - s[y + 5] ^= ~s[y + 7] & s[y + 9]; - s[y + 6] ^= ~s[y + 8] & b0; - s[y + 7] ^= ~s[y + 9] & b1; - s[y + 8] ^= ~b0 & b2; - s[y + 9] ^= ~b1 & b3; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - clean(B); - } - /** - * Keccak sponge function. - * @param blockLen - absorb/squeeze rate in bytes - * @param suffix - domain separation suffix byte - * @param outputLen - default digest length in bytes. This base sponge only - * requires a non-negative integer; wrappers that need positive output - * lengths must enforce that themselves. - * @param enableXOF - whether XOF output is allowed - * @param rounds - number of Keccak-f rounds - * @example - * Build a sponge state, absorb bytes, then finalize a digest. - * ```ts - * const hash = new Keccak(136, 0x06, 32); - * hash.update(new Uint8Array([1, 2, 3])); - * hash.digest(); - * ``` - */ - class Keccak { - state; - pos = 0; - posOut = 0; - finished = false; - state32; - destroyed = false; - blockLen; - suffix; - outputLen; - canXOF; - enableXOF = false; - rounds; - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - anumber(blockLen, 'blockLen'); - anumber(suffix, 'suffix'); - anumber(rounds, 'rounds'); - abool(enableXOF, 'enableXOF'); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.canXOF = enableXOF; - this.rounds = rounds; - // Can be passed from user as dkLen - anumber(outputLen, 'outputLen'); - // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state. - if (!(0 < blockLen && blockLen < 200)) - throw new Error('"blockLen" must be 1..199'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - clone() { - return this._cloneInto(); - } - keccak() { - swap32IfBE(this.state32); - keccakP(this.state32, this.rounds); - swap32IfBE(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data) { - aexists(this); - abytes(data); - const { blockLen, state, state32 } = this; - const len = data.length; - // Absorb full blocks with u32 XORs when both sides are 4-byte aligned. - // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe. - const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0; - const blockLen32 = blockLen / 4; - const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined; - for (let pos = 0; pos < len;) { - if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) { - for (let i = 0, o = pos / 4; i < blockLen32; i++) - state32[i] ^= data32[o + i]; - pos += blockLen; - // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override, - // so it must reflect the fully-absorbed block before the permutation fires. - this.pos = blockLen; - this.keccak(); - continue; - } - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1. - // These byte values already include the first padding bit, while the - // final `0x80` below supplies the closing `1` bit in the last rate byte. - state[pos] ^= suffix; - // If that combined suffix lands in the last rate byte and already sets - // bit 7, absorb it first so the final pad10*1 bit can be xored into a - // fresh block. - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - aexists(this, false); - abytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base - // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/ - // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF. - if (!this.enableXOF) - throw new Error('XOF is not enabled'); - return this.writeInto(out); - } - xof(bytes) { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - aoutput(out, this); - if (this.finished) - throw new Error('digest() was already called'); - // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest. - this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen)); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.outputLen); - this.digestInto(out); - return out; - } - destroy() { - this.destroyed = true; - clean(this.state); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); - // Reused destinations can come from a different rate/capacity variant, so clone must rewrite - // the sponge geometry as well as the state words. - to.blockLen = blockLen; - to.state32.set(this.state32); - // Sponge padding and XOF output are positional, so both offsets are part of the clone state. - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone - // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie. - to.canXOF = this.canXOF; - to.destroyed = this.destroyed; - return to; - } - } - const genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info); - /** - * SHA3-256 hash function. Different from keccak-256. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA3-256. - * ```ts - * sha3_256(new Uint8Array([97, 98, 99])); - * ``` - */ - const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, - /* @__PURE__ */ oidNist(0x08)); - /** - * SHA3-512 hash function. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA3-512. - * ```ts - * sha3_512(new Uint8Array([97, 98, 99])); - * ``` - */ - const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, - /* @__PURE__ */ oidNist(0x0a)); - /** - * Keccak-256 hash function. Different from SHA3-256. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with Keccak-256. - * ```ts - * keccak_256(new Uint8Array([97, 98, 99])); - * ``` - */ - const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32); - - /*! - * assert.js - assert for bcrypto - * Copyright (c) 2020, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var assert_1; - var hasRequiredAssert; - - function requireAssert () { - if (hasRequiredAssert) return assert_1; - hasRequiredAssert = 1; - - /* - * Assert - */ - - function assert(val, msg) { - if (!val) { - const err = new Error(msg || 'Assertion failed'); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, assert); - - throw err; - } - } - - /* - * Expose - */ - - assert_1 = assert; - return assert_1; - } - - var customBrowser = {}; - - /*! - * custom.js - custom inspect symbol for bcrypto - * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var hasRequiredCustomBrowser; - - function requireCustomBrowser () { - if (hasRequiredCustomBrowser) return customBrowser; - hasRequiredCustomBrowser = 1; - - customBrowser.custom = 'inspect'; - return customBrowser; - } - - var bn; - var hasRequiredBn; - - function requireBn () { - if (hasRequiredBn) return bn; - hasRequiredBn = 1; - - const {custom} = requireCustomBrowser(); - - /* - * Constants - */ - - const zeros = [ - '', - '0', - '00', - '000', - '0000', - '00000', - '000000', - '0000000', - '00000000', - '000000000', - '0000000000', - '00000000000', - '000000000000', - '0000000000000', - '00000000000000', - '000000000000000', - '0000000000000000', - '00000000000000000', - '000000000000000000', - '0000000000000000000', - '00000000000000000000', - '000000000000000000000', - '0000000000000000000000', - '00000000000000000000000', - '000000000000000000000000', - '0000000000000000000000000' - ]; - - const groupSizes = [ - 0x00, 0x19, 0x10, 0x0c, 0x0b, 0x0a, - 0x09, 0x08, 0x08, 0x07, 0x07, 0x07, - 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05 - ]; - - const groupBases = [ - 0x00000000, 0x02000000, 0x0290d741, 0x01000000, - 0x02e90edd, 0x039aa400, 0x0267bf47, 0x01000000, - 0x0290d741, 0x00989680, 0x012959c3, 0x0222c000, - 0x03bd7765, 0x0072e440, 0x00adcea1, 0x01000000, - 0x01704f61, 0x0206fc40, 0x02cddcf9, 0x03d09000, - 0x003e5185, 0x004ea360, 0x006235f7, 0x00798000, - 0x009502f9, 0x00b54ba0, 0x00daf26b, 0x01069c00, - 0x0138f9ad, 0x0172c9e0, 0x01b4d89f, 0x02000000, - 0x025528a1, 0x02b54a20, 0x03216b93, 0x039aa400 - ]; - - const primes = { - p192: null, - p224: null, - p521: null, - k256: null, - p251: null, - p25519: null, - p448: null - }; - - const modes = { - NONE: 0, - QUO: 1, - REM: 2, - BOTH: 3, - EUCLID: 4, - ALL: 7 - }; - - const WND_WIDTH = 4; - const WND_SIZE = 1 << (WND_WIDTH - 1); - - const HAS_BIGINT = typeof BigInt === 'function'; - - /** - * BN - */ - - class BN { - constructor(num, base, endian) { - this.words = [0]; - this.length = 1; - this.negative = 0; - this.red = null; - this.from(num, base, endian); - } - - /* - * Addition Engine - */ - - _iadd(a, b) { - let carry = 0; - let i = 0; - - // a.length > b.length - if (a.length < b.length) - [a, b] = [b, a]; - - if (a !== this) - this._alloc(a.length); - - for (; i < b.length; i++) { - const r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - - this.words[i] = r & 0x3ffffff; - - carry = r >>> 26; - } - - for (; carry !== 0 && i < a.length; i++) { - const r = (a.words[i] | 0) + carry; - - this.words[i] = r & 0x3ffffff; - - carry = r >>> 26; - } - - this.length = a.length; - - if (carry !== 0) { - this._alloc(this.length + 1); - this.words[this.length++] = carry; - } else if (a !== this) { - // Copy the rest of the words. - for (; i < a.length; i++) - this.words[i] = a.words[i]; - } - - // Note: we shouldn't need to strip here. - return this; - } - - _iaddn(num) { - this.words[0] += num; - - if (this.words[0] < 0x4000000) - return this; - - // Carry. - let i = 0; - - this._alloc(this.length + 1); - - this.words[this.length] = 0; - - for (; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - this.words[i + 1] += 1; - } - - this.length = Math.max(this.length, i + 1); - - // Note: we shouldn't need to strip here. - return this; - } - - /* - * Addition - */ - - iadd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.negative === num.negative) { - // x + y == x + y - // (-x) + (-y) == -(x + y) - this._iadd(this, num); - } else { - // x + (-y) == x - y == -(y - x) - // (-x) + y == y - x == -(x - y) - const cmp = this.ucmp(num); - - // x + (-x) == (-x) + x == 0 - if (cmp === 0) { - this.words[0] = 0; - this.length = 1; - this.negative = 0; - return this; - } - - if (cmp < 0) { - this._isub(num, this); - this.negative ^= 1; - } else { - this._isub(this, num); - } - } - - return this; - } - - iaddn(num) { - enforce(isSMI(num), 'num', 'smi'); - - const negative = (num < 0) | 0; - - if (negative) - num = -num; - - if (this.negative === negative) { - // x + y == x + y - // (-x) + (-y) == -(x + y) - this._iaddn(num); - } else { - // x + (-y) == x - y == -(y - x) - // (-x) + y == y - x == -(x - y) - if (this.length === 1 && this.words[0] < num) { - this.words[0] = num - this.words[0]; - this.negative ^= 1; - } else { - this._isubn(num); - } - } - - return this; - } - - add(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (num.length > this.length) - return num.clone().iadd(this); - - return this.clone().iadd(num); - } - - addn(num) { - return this.clone().iaddn(num); - } - - /* - * Subtraction Engine - */ - - _isub(a, b) { - let carry = 0; - let i = 0; - - // a > b - assert(a.length >= b.length); - - if (a !== this) - this._alloc(a.length); - - for (; i < b.length; i++) { - const r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - - carry = r >> 26; - - this.words[i] = r & 0x3ffffff; - } - - for (; carry !== 0 && i < a.length; i++) { - const r = (a.words[i] | 0) + carry; - - carry = r >> 26; - - this.words[i] = r & 0x3ffffff; - } - - assert(carry === 0); - - // Copy rest of the words. - if (a !== this) { - for (; i < a.length; i++) - this.words[i] = a.words[i]; - } - - this.length = Math.max(this.length, i); - - return this._strip(); - } - - _isubn(num) { - this.words[0] -= num; - - if (this.words[0] >= 0) - return this._normalize(); - - assert(this.length !== 1); - - // Carry. - this._alloc(this.length + 1); - - for (let i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - - this.words[this.length] = 0; - - return this._strip(); - } - - /* - * Subtraction - */ - - isub(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.negative !== num.negative) { - // x - (-y) == x + y - // (-x) - y == -(x + y) - this._iadd(this, num); - } else { - // x - y == x - y == -(y - x) - // (-x) - (-y) == y - x == -(x - y) - const cmp = this.ucmp(num); - - // x - x == 0 - if (cmp === 0) { - this.words[0] = 0; - this.length = 1; - this.negative = 0; - return this; - } - - if (cmp < 0) { - this._isub(num, this); - this.negative ^= 1; - } else { - this._isub(this, num); - } - } - - return this; - } - - isubn(num) { - enforce(isSMI(num), 'num', 'smi'); - - const negative = (num < 0) | 0; - - if (negative) - num = -num; - - if (this.negative !== negative) { - // x - (-y) == x + y - // (-x) - y == -(x + y) - this._iaddn(num); - } else { - // x - y == x - y == -(y - x) - // (-x) - (-y) == y - x == -(x - y) - if (this.length === 1 && this.words[0] < num) { - this.words[0] = num - this.words[0]; - this.negative ^= 1; - } else { - this._isubn(num); - } - } - - return this; - } - - sub(num) { - return this.clone().isub(num); - } - - subn(num) { - return this.clone().isubn(num); - } - - /* - * Multiplication Engine - */ - - _mul(num, out) { - enforce(BN.isBN(num), 'num', 'bignum'); - enforce(BN.isBN(out), 'out', 'bignum'); - - if (this.length === 10 && num.length === 10) - return comb10MulTo(this, num, out); - - const len = this.length + num.length; - - if (len < 63) - return smallMulTo(this, num, out); - - if (len < 1024) - return bigMulTo(this, num, out); - - return jumboMulTo(this, num, out); - } - - /* - * Multiplication - */ - - imul(num) { - return this.mul(num)._move(this); - } - - imuln(num) { - enforce(isSMI(num), 'num', 'smi'); - - const neg = (num < 0) | 0; - - if (neg) - num = -num; - - // Carry. - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const w = this.words[i] * num; - const lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - - carry >>= 26; - carry += (w / 0x4000000) | 0; - carry += lo >>> 26; - - this.words[i] = lo & 0x3ffffff; - } - - this.negative ^= neg; - - if (carry !== 0) { - this._alloc(this.length + 1); - this.words[this.length++] = carry; - } else { - this._strip(); - } - - return this; - } - - mul(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - const len = this.length + num.length; - const out = new BN(); - - out.words = new Array(len); - - for (let i = 0; i < len; i ++) - out.words[i] = 0; - - return this._mul(num, out); - } - - muln(num) { - return this.clone().imuln(num); - } - - /* - * Multiplication + Shift - */ - - mulShift(num, bits) { - enforce(BN.isBN(num), 'num', 'bignum'); - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - const r = this.mul(num); - const b = r.utestn(bits - 1); - - r.iushrn(bits); - - if (this.negative ^ num.negative) - return r.isubn(b); - - return r.iaddn(b); - } - - /* - * Division Engine - */ - - _div(num, flags) { - enforce(BN.isBN(num), 'num', 'bignum'); - assert((flags & modes.ALL) === flags); - assert(flags !== modes.NONE); - - const a = this; - const b = num; - - nonzero(!b.isZero()); - - if (a.isZero()) - return [new BN(0), new BN(0)]; - - const as = a.negative; - const bs = b.negative; - - a.negative = 0; - b.negative = 0; - - let q = null; - let r = null; - - if (a.ucmp(b) < 0) { - if (flags & modes.QUO) - q = new BN(0); - - if (flags & modes.REM) - r = a.clone(); - } else if (b.length === 1) { - if (flags & modes.QUO) - q = a.quon(b.words[0]); - - if (flags & modes.REM) - r = a.remn(b.words[0]); - } else { - [q, r] = a._wordDiv(b, flags); - } - - a.negative = as; - b.negative = bs; - - if (flags & modes.QUO) { - q.negative = a.negative ^ b.negative; - q._normalize(); - } - - if (flags & modes.REM) { - r.negative = a.negative; - r._normalize(); - } - - if (flags & modes.EUCLID) { - if (flags & modes.QUO) { - assert((flags & modes.REM) !== 0); - - if (r.negative !== 0) { - if (b.negative !== 0) - q.iaddn(1); - else - q.isubn(1); - } - } - - if (flags & modes.REM) { - if (r.negative !== 0) { - if (b.negative !== 0) - r.isub(b); - else - r.iadd(b); - } - } - } - - return [q, r]; - } - - _wordDiv(num, flags) { - let a = this.clone(); - let b = num; - let q = null; - let hi; - - // Normalize. - const word = b.words[b.length - 1] | 0; - const shift = 26 - countBits(word); - - if (shift !== 0) { - b = b.clone(); - - a.iushln(shift); - b.iushln(shift); - - hi = b.words[b.length - 1] | 0; - } else { - hi = word; - } - - // Initialize quotient. - const m = a.length - b.length; - - assert(m >= 0); - - if (flags & modes.QUO) { - q = new BN(0); - q.length = m + 1; - q.words = new Array(q.length); - - for (let i = 0; i < q.length; i++) - q.words[i] = 0; - } - - // Diff. - const d = a.clone(); - - d._ishlnsubmul(b, 1, m); - - if (d.negative === 0) { - if (q) - q.words[m] = 1; - - a = d; - } - - // Divide. - for (let j = m - 1; j >= 0; j--) { - const ahi = a.words[b.length + j]; - const alo = a.words[b.length + j - 1]; - const quo = ((ahi * 0x4000000 + alo) / hi) | 0; - - let qj = Math.min(quo, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - - while (a.negative !== 0) { - qj -= 1; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - a.ineg(); - } - - if (q) - q.words[j] = qj; - } - - // Strip. - if (q) - q._strip(); - - // Denormalize. - // Note: we shouldn't need to strip `a` here. - if ((flags & modes.REM) && shift !== 0) - a.iushrn(shift); - - return [q, a]; - } - - _ishlnsubmul(num, mul, shift) { - let carry = 0; - let i = 0; - - this._expand(num.length + shift); - - for (; i < num.length; i++) { - const k = (this.words[i + shift] | 0) + carry; - const r = num.words[i] * mul; - const w = k - (r & 0x3ffffff); - - carry = (w >> 26) - ((r / 0x4000000) | 0); - - this.words[i + shift] = w & 0x3ffffff; - } - - for (; i < this.length - shift; i++) { - const w = (this.words[i + shift] | 0) + carry; - - carry = w >> 26; - - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) - return this._strip(); - - // Subtraction overflow. - assert(carry === -1); - - carry = 0; - - for (let i = 0; i < this.length; i++) { - const w = -(this.words[i] | 0) + carry; - - carry = w >> 26; - - this.words[i] = w & 0x3ffffff; - } - - this.negative = 1; - - return this._strip(); - } - - /* - * Truncation Division + Modulo - */ - - quorem(num) { - return this._div(num, modes.BOTH); - } - - /* - * Truncation Division - */ - - iquo(num) { - return this.quo(num)._move(this); - } - - iquon(num) { - enforce(isSMI(num), 'num', 'smi'); - nonzero(num !== 0); - - const neg = (num < 0) | 0; - - if (neg) - num = -num; - - let carry = 0; - - for (let i = this.length - 1; i >= 0; i--) { - const w = (this.words[i] | 0) + carry * 0x4000000; - - this.words[i] = (w / num) | 0; - - carry = w % num; - } - - this.negative ^= neg; - - return this._strip(); - } - - quo(num) { - return this._div(num, modes.QUO)[0]; - } - - quon(num) { - return this.clone().iquon(num); - } - - /* - * Truncation Modulo - */ - - irem(num) { - return this.rem(num)._move(this); - } - - iremn(num) { - let m = this.remrn(num); - - if (m < 0) - m = -m; - - this.words[0] = m; - this.length = 1; - - return this._normalize(); - } - - rem(num) { - return this._div(num, modes.REM)[1]; - } - - remn(num) { - return this.clone().iremn(num); - } - - remrn(num) { - enforce(isSMI(num), 'num', 'smi'); - nonzero(num !== 0); - - if (num < 0) - num = -num; - - const p = (1 << 26) % num; - - let acc = 0; - - for (let i = this.length - 1; i >= 0; i--) - acc = (p * acc + (this.words[i] | 0)) % num; - - return this.negative !== 0 ? (-acc | 0) : acc; - } - - /* - * Euclidean Division + Modulo - */ - - divmod(num) { - return this._div(num, modes.BOTH | modes.EUCLID); - } - - /* - * Euclidean Division - */ - - idiv(num) { - return this.div(num)._move(this); - } - - idivn(num) { - if (this.negative === 0) - return this.iquon(num); - - const r = this.remrn(num); - - this.iquon(num); - - if (r < 0) { - if (num < 0) - this.iaddn(1); - else - this.isubn(1); - } - - return this; - } - - div(num) { - return this._div(num, modes.BOTH | modes.EUCLID)[0]; - } - - divn(num) { - return this.clone().idivn(num); - } - - /* - * Euclidean Modulo - */ - - imod(num) { - if (this.ucmp(num) < 0) { - if (this.negative !== 0) { - this._isub(num, this); - this.negative = 0; - } - return this; - } - - return this.mod(num)._move(this); - } - - imodn(num) { - this.words[0] = this.modrn(num); - this.length = 1; - this.negative = 0; - return this; - } - - mod(num) { - return this._div(num, modes.REM | modes.EUCLID)[1]; - } - - modn(num) { - return this.clone().imodn(num); - } - - modrn(num) { - enforce(isSMI(num), 'num', 'smi'); - - let r = this.remrn(num); - - if (r < 0) { - if (num < 0) - r -= num; - else - r += num; - } - - return r; - } - - /* - * Round Division - */ - - divRound(num) { - const [q, r] = this.quorem(num); - - // Fast case - exact division. - if (r.isZero()) - return q; - - const bit = num.words[0] & 1; - - num.iushrn(1); - - const cmp = r.ucmp(num); - - num.iushln(1); - - num.words[0] |= bit; - - // Round down. - if (cmp < 0 || (num.isOdd() && cmp === 0)) - return q; - - // Round up. - if (this.negative ^ num.negative) - return q.isubn(1); - - return q.iaddn(1); - } - - /* - * Exponentiation - */ - - ipow(num) { - return this.pow(num)._move(this); - } - - ipown(num) { - return this.pown(num)._move(this); - } - - pow(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let b = countBits(num.words[num.length - 1]); - let r = new BN(1); - - for (let i = num.length - 1; i >= 0; i--) { - const word = num.words[i]; - - for (let j = b - 1; j >= 0; j--) { - r = r.sqr(); - - if ((word >> j) & 1) - r = r.mul(this); - } - - b = 26; - } - - return r; - } - - pown(num) { - enforce(isSMI(num), 'num', 'smi'); - - if (num < 0) - num = -num; - - if (num === 0) - return new BN(1); - - if (num === 1) - return this.clone(); - - const bits = countBits(num); - - let r = this; - - for (let i = bits - 2; i >= 0; i--) { - r = r.sqr(); - - if ((num >> i) & 1) - r = r.mul(this); - } - - return r; - } - - isqr() { - return this.imul(this); - } - - sqr() { - return this.mul(this); - } - - /* - * Roots Engine - */ - - _rootrem(pow, rem) { - enforce((pow >>> 0) === pow, 'num', 'uint32'); - - if (pow === 0) - throw new RangeError('Zeroth root.'); - - if (~pow & this.negative) - throw new RangeError('Negative with even root.'); - - if (this.ucmpn(1) <= 0) - return [this.clone(), new BN(0)]; - - let u = new BN(0); - let t = BN.shift(1, this.bitLength() / pow + 1 | 0); - let v, r; - - if (this.negative !== 0) - t.ineg(); - - if (pow === 2) { - do { - u = t; - t = this.quo(u); - t.iadd(u); - t.iushrn(1); - } while (t.ucmp(u) < 0); - } else { - do { - u = t; - t = u.pown(pow - 1); - t = this.quo(t); - v = u.muln(pow - 1); - t.iadd(v); - t = t.quon(pow); - } while (t.ucmp(u) < 0); - } - - if (rem) { - t = u.pown(pow); - r = this.sub(t); - } - - return [u, r]; - } - - /* - * Roots - */ - - rootrem(pow) { - return this._rootrem(pow, 1); - } - - iroot(pow) { - return this.root(pow)._move(this); - } - - root(pow) { - return this._rootrem(pow, 0)[0]; - } - - isPower(pow) { - enforce((pow >>> 0) === pow, 'num', 'uint32'); - - if (pow === 0 || (~pow & this.negative)) - return false; - - const [, r] = this.rootrem(pow); - - return r.sign() === 0; - } - - sqrtrem() { - return this.rootrem(2); - } - - isqrt() { - return this.sqrt()._move(this); - } - - sqrt() { - return this.root(2); - } - - isSquare() { - return this.isPower(2); - } - - /* - * AND - */ - - iand(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let x = this; - let y = num; - - if (x === y) - return x; - - if ((x.negative | y.negative) === 0) - return x.iuand(y); - - if ((x.negative & y.negative) === 1) { - // (-x) & (-y) == ~(x-1) & ~(y-1) - // == ~((x-1) | (y-1)) - // == -(((x-1) | (y-1)) + 1) - x.iaddn(1); - y.iaddn(1); - x.iuor(y); - x.isubn(1); - y.isubn(1); - return x; - } - - // Assume x is the positive number. - if (x.negative !== 0) - [x, y] = [y.clone(), x]; - - // x & (-y) == x & ~(y-1) - // == x & ~(y-1) - const width = x.bitLength(); - - y.iaddn(1); - y.inotn(width); - x.iuand(y); - y.inotn(width); - y.isubn(1); - - return x._move(this); - } - - iandn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if ((this.negative | (num < 0)) !== 0) - return this.iand(new BN(num)); - - this.words[0] &= num; - this.length = 1; - - return this; - } - - and(num) { - return this.clone().iand(num); - } - - andn(num) { - return this.clone().iandn(num); - } - - andrn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if ((this.negative | (num < 0)) !== 0) { - const n = this.iand(new BN(num)); - - if (n.length > 1) - throw new RangeError('Number exceeds 26 bits.'); - - return n.negative !== 0 ? -n.words[0] : n.words[0]; - } - - return this.words[0] & num; - } - - /* - * Unsigned AND - */ - - iuand(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - this.length = Math.min(this.length, num.length); - - for (let i = 0; i < this.length; i++) - this.words[i] &= num.words[i]; - - return this._strip(); - } - - iuandn(num) { - enforce(isSMI(num), 'num', 'smi'); - - this.words[0] &= Math.abs(num); - this.length = 1; - - return this._normalize(); - } - - uand(num) { - return this.clone().iuand(num); - } - - uandn(num) { - return this.clone().iuandn(num); - } - - uandrn(num) { - enforce(isSMI(num), 'num', 'smi'); - - const n = this.words[0] & Math.abs(num); - - return this.negative !== 0 ? (-n | 0) : n; - } - - /* - * OR - */ - - ior(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let x = this; - let y = num; - - if (x === y) - return x; - - if ((x.negative | y.negative) === 0) - return x.iuor(y); - - if ((x.negative & y.negative) === 1) { - // (-x) | (-y) == ~(x-1) | ~(y-1) - // == ~((x-1) & (y-1)) - // == -(((x-1) & (y-1)) + 1) - x.iaddn(1); - y.iaddn(1); - x.iuand(y); - x.isubn(1); - y.isubn(1); - return x; - } - - // Assume x is the positive number. - y = y.clone(); - - if (x.negative !== 0) - [x, y] = [y, x]; - - // x | (-y) == x | ~(y-1) - // == ~((y-1) & ~x) - // == -(((y-1) & ~x) + 1) - y.iaddn(1); - x.inotn(y.bitLength()); - y.iuand(x); - y.isubn(1); - - return y._move(this); - } - - iorn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if ((this.negative | (num < 0)) !== 0) - return this.ior(new BN(num)); - - this.words[0] |= num; - - return this; - } - - or(num) { - return this.clone().ior(num); - } - - orn(num) { - return this.clone().iorn(num); - } - - /* - * Unsigned OR - */ - - iuor(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - this._expand(num.length); - - for (let i = 0; i < num.length; i++) - this.words[i] |= num.words[i]; - - // Note: we shouldn't need to strip here. - return this; - } - - iuorn(num) { - enforce(isSMI(num), 'num', 'smi'); - - this.words[0] |= Math.abs(num); - - return this; - } - - uor(num) { - return this.clone().iuor(num); - } - - uorn(num) { - return this.clone().iuorn(num); - } - - /* - * XOR - */ - - ixor(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let x = this; - let y = num; - - if (x === y) { - x.words[0] = 0; - x.length = 1; - x.negative = 0; - return x; - } - - if ((x.negative | y.negative) === 0) - return x.iuxor(y); - - if ((x.negative & y.negative) === 1) { - // (-x) ^ (-y) == ~(x-1) ^ ~(y-1) - // == (x-1) ^ (y-1) - x.iaddn(1); - y.iaddn(1); - x.iuxor(y); - x.ineg(); - y.isubn(1); - return x; - } - - // Assume x is the positive number. - if (x.negative !== 0) - [x, y] = [y.clone(), x]; - - // x ^ (-y) == x ^ ~(y-1) - // == ~(x ^ (y-1)) - // == -((x ^ (y-1)) + 1) - y.iaddn(1); - x.iuxor(y); - x.iaddn(1); - x.ineg(); - y.isubn(1); - - return x._move(this); - } - - ixorn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if ((this.negative | (num < 0)) !== 0) - return this.ixor(new BN(num)); - - this.words[0] ^= num; - - return this; - } - - xor(num) { - return this.clone().ixor(num); - } - - xorn(num) { - return this.clone().ixorn(num); - } - - /* - * Unsigned XOR - */ - - iuxor(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - let a = this; - let b = num; - - if (a.length < b.length) - [a, b] = [b, a]; - - let i = 0; - - for (; i < b.length; i++) - this.words[i] = a.words[i] ^ b.words[i]; - - if (a !== this) { - this._alloc(a.length); - - for (; i < a.length; i++) - this.words[i] = a.words[i]; - } - - this.length = a.length; - - return this._strip(); - } - - iuxorn(num) { - enforce(isSMI(num), 'num', 'smi'); - - this.words[0] ^= Math.abs(num); - - return this._normalize(); - } - - uxor(num) { - return this.clone().iuxor(num); - } - - uxorn(num) { - return this.clone().iuxorn(num); - } - - /* - * NOT - */ - - inot() { - if (this.negative !== 0) { - // ~(-x) == ~(~(x-1)) == x-1 - this.ineg().isubn(1); - } else { - // ~x == -x-1 == -(x+1) - this.iaddn(1).ineg(); - } - return this; - } - - not() { - return this.clone().inot(); - } - - inotn(width) { - enforce((width >>> 0) === width, 'width', 'uint32'); - - const r = width % 26; - - let s = Math.ceil(width / 26); - let i = 0; - - // Extend the buffer with leading zeroes. - this._expand(s); - - if (r > 0) - s -= 1; - - // Handle complete words. - for (; i < s; i++) - this.words[i] ^= 0x3ffffff; - - // Handle the residue. - if (r > 0) - this.words[i] ^= (1 << r) - 1; - - // And remove leading zeroes. - return this._strip(); - } - - notn(width) { - return this.clone().inotn(width); - } - - /* - * Left Shift - */ - - ishl(num) { - enforce(BN.isBN(num), 'bits', 'bignum'); - enforce(num.bitLength() <= 32, 'bits', 'uint32'); - return this.ishln(num.toNumber()); - } - - ishln(bits) { - return this.iushln(bits); - } - - shl(num) { - return this.clone().ishl(num); - } - - shln(bits) { - return this.clone().ishln(bits); - } - - /* - * Unsigned Left Shift - */ - - iushl(num) { - enforce(BN.isBN(num), 'bits', 'bignum'); - enforce(num.bitLength() <= 32, 'bits', 'uint32'); - return this.iushln(num.toNumber()); - } - - iushln(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - const r = bits % 26; - const s = (bits - r) / 26; - const mask = ((1 << r) - 1) << (26 - r); - - if (r !== 0) { - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const ncarry = this.words[i] & mask; - const c = ((this.words[i] | 0) - ncarry) << r; - - this.words[i] = c | carry; - - carry = ncarry >>> (26 - r); - } - - if (carry !== 0) { - this._alloc(this.length + 1); - this.words[this.length++] = carry; - } - } - - if (s !== 0) { - this._alloc(this.length + s); - - for (let i = this.length - 1; i >= 0; i--) - this.words[i + s] = this.words[i]; - - for (let i = 0; i < s; i++) - this.words[i] = 0; - - this.length += s; - } - - return this._strip(); - } - - ushl(num) { - return this.clone().iushl(num); - } - - ushln(bits) { - return this.clone().iushln(bits); - } - - /* - * Right Shift Engine - */ - - _split(bits, output) { - const r = bits % 26; - const s = Math.min((bits - r) / 26, this.length); - const mask = (1 << r) - 1; - - // Extended mode, copy masked part. - if (output) { - output._alloc(s); - - for (let i = 0; i < s; i++) - output.words[i] = this.words[i]; - - output.length = s; - } - - if (s === 0) ; else if (this.length > s) { - this.length -= s; - for (let i = 0; i < this.length; i++) - this.words[i] = this.words[i + s]; - } else { - this.words[0] = 0; - this.length = 1; - } - - let carry = 0; - - if (r !== 0) { - for (let i = this.length - 1; i >= 0; i--) { - const word = this.words[i] | 0; - - this.words[i] = (carry << (26 - r)) | (word >>> r); - - carry = word & mask; - } - } - - // Push carried bits as a mask. - if (output) { - if (carry !== 0) { - output._alloc(output.length + 1); - output.words[output.length++] = carry; - } else { - if (output.length === 0) - output.words[output.length++] = 0; - - output._strip(); - } - } - - return this._strip(); - } - - /* - * Right Shift - */ - - ishr(num) { - enforce(BN.isBN(num), 'bits', 'bignum'); - enforce(num.bitLength() <= 32, 'bits', 'uint32'); - return this.ishrn(num.toNumber()); - } - - ishrn(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - if (this.negative !== 0) { - // (-x) >> y == ~(x-1) >> y - // == ~((x-1) >> y) - // == -(((x-1) >> y) + 1) - this.iaddn(1); - this.iushrn(bits); - this.isubn(1); - return this; - } - - return this.iushrn(bits); - } - - shr(num) { - return this.clone().ishr(num); - } - - shrn(bits) { - return this.clone().ishrn(bits); - } - - /* - * Unsigned Right Shift - */ - - iushr(num) { - enforce(BN.isBN(num), 'bits', 'bignum'); - enforce(num.bitLength() <= 32, 'bits', 'uint32'); - return this.iushrn(num.toNumber()); - } - - iushrn(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - return this._split(bits, null); - } - - ushr(num) { - return this.clone().iushr(num); - } - - ushrn(bits) { - return this.clone().iushrn(bits); - } - - /* - * Bit Manipulation - */ - - setn(bit, val) { - enforce((bit >>> 0) === bit, 'bit', 'uint32'); - - if (this.negative !== 0) { - this.iaddn(1); - this.usetn(bit, !val); - this.isubn(1); - return this; - } - - return this.usetn(bit, val); - } - - usetn(bit, val) { - enforce((bit >>> 0) === bit, 'bit', 'uint32'); - - const r = bit % 26; - const s = (bit - r) / 26; - - this._expand(s + 1); - - if (val) - this.words[s] |= (1 << r); - else - this.words[s] &= ~(1 << r); - - return this._strip(); - } - - testn(bit) { - enforce((bit >>> 0) === bit, 'bit', 'uint32'); - - const r = bit % 26; - const s = (bit - r) / 26; - - // Fast case: bit is much higher than all existing words. - if (this.length <= s) - return this.negative; - - // Check bit and return. - const w = this.words[s]; - const val = (w >> r) & 1; - - if (this.negative !== 0) { - if (r > 0 && (w & ((1 << r) - 1))) - return val ^ 1; - - let j = s; - - while (j--) { - if (this.words[j] > 0) - return val ^ 1; - } - } - - return val; - } - - utestn(bit) { - enforce((bit >>> 0) === bit, 'bit', 'uint32'); - - const r = bit % 26; - const s = (bit - r) / 26; - - // Fast case: bit is much higher than all existing words. - if (this.length <= s) - return 0; - - // Check bit and return. - return (this.words[s] >> r) & 1; - } - - imaskn(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - if (this.negative !== 0) { - this.iaddn(1); - this.inotn(bits + 1); - this.ineg(); - } - - return this.iumaskn(bits); - } - - maskn(bits) { - return this.clone().imaskn(bits); - } - - iumaskn(bits) { - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - const r = bits % 26; - - let s = (bits - r) / 26; - - if (this.length <= s) - return this; - - if (r !== 0) - s += 1; - - this.length = Math.min(s, this.length); - - if (r !== 0) - this.words[this.length - 1] &= (1 << r) - 1; - - if (this.length === 0) - this.words[this.length++] = 0; - - return this._strip(); - } - - umaskn(bits) { - return this.clone().iumaskn(bits); - } - - andln(num) { - return this.words[0] & num; - } - - bit(pos) { - return this.utestn(pos); - } - - bits(pos, width) { - enforce((pos >>> 0) === pos, 'pos', 'uint32'); - enforce((width >>> 0) === width, 'width', 'uint32'); - enforce(width <= 26, 'width', 'width'); - - const shift = pos % 26; - const index = (pos - shift) / 26; - - if (index >= this.length) - return 0; - - let bits = (this.words[index] >> shift) & ((1 << width) - 1); - - if (shift + width > 26 && index + 1 < this.length) { - const more = shift + width - 26; - const next = this.words[index + 1] & ((1 << more) - 1); - - bits |= next << (26 - shift); - } - - return bits; - } - - /* - * Negation - */ - - ineg() { - if (!this.isZero()) - this.negative ^= 1; - - return this; - } - - neg() { - return this.clone().ineg(); - } - - iabs() { - this.negative = 0; - return this; - } - - abs() { - return this.clone().iabs(); - } - - /* - * Comparison - */ - - cmp(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.negative !== num.negative) - return num.negative - this.negative; - - const res = this.ucmp(num); - - if (this.negative !== 0) - return -res | 0; - - return res; - } - - cmpn(num) { - enforce(isSMI(num), 'num', 'smi'); - - const negative = (num < 0) | 0; - - if (this.negative !== negative) - return negative - this.negative; - - const res = this.ucmpn(num); - - if (this.negative !== 0) - return -res | 0; - - return res; - } - - eq(num) { - return this.cmp(num) === 0; - } - - eqn(num) { - return this.cmpn(num) === 0; - } - - gt(num) { - return this.cmp(num) > 0; - } - - gtn(num) { - return this.cmpn(num) > 0; - } - - gte(num) { - return this.cmp(num) >= 0; - } - - gten(num) { - return this.cmpn(num) >= 0; - } - - lt(num) { - return this.cmp(num) < 0; - } - - ltn(num) { - return this.cmpn(num) < 0; - } - - lte(num) { - return this.cmp(num) <= 0; - } - - lten(num) { - return this.cmpn(num) <= 0; - } - - sign() { - if (this.negative !== 0) - return -1; - - if (this.length === 1 && this.words[0] === 0) - return 0; - - return 1; - } - - isZero() { - return this.length === 1 && this.words[0] === 0; - } - - isNeg() { - return this.negative !== 0; - } - - isPos() { - return this.negative === 0; - } - - isOdd() { - return (this.words[0] & 1) === 1; - } - - isEven() { - return (this.words[0] & 1) === 0; - } - - /* - * Unsigned Comparison - */ - - ucmp(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.length < num.length) - return -1; - - if (this.length > num.length) - return 1; - - for (let i = this.length - 1; i >= 0; i--) { - const a = this.words[i] | 0; - const b = num.words[i] | 0; - - if (a === b) - continue; - - return (a > b) - (a < b); - } - - return 0; - } - - ucmpn(num) { - enforce(isSMI(num), 'num', 'smi'); - - if (this.length > 1) - return 1; - - const w = this.words[0] | 0; - - if (num < 0) - num = -num; - - return (w > num) - (w < num); - } - - /* - * Number Theoretic Functions - */ - - legendre(num) { - const red = HAS_BIGINT ? BN.red(num) : BN.mont(num); - return this.toRed(red).redLegendre(); - } - - jacobi(num) { - // See: A Binary Algorithm for the Jacobi Symbol - // J. Shallit, J. Sorenson - // Page 3, Section 3 - enforce(BN.isBN(num), 'num', 'bignum'); - - if (num.isZero() || num.isEven()) - throw new Error('jacobi: `num` must be odd.'); - - let a = this._cloneNormal(); - let b = num.clone(); - let j = 1; - - if (b.isNeg()) { - if (a.isNeg()) - j = -1; - b.ineg(); - } - - if (a.isNeg() || a.ucmp(b) >= 0) - a.imod(b); - - while (!a.isZero()) { - const bits = a._makeOdd(); - - if (bits & 1) { - const bmod8 = b.andln(7); - - if (bmod8 === 3 || bmod8 === 5) - j = -j; - } - - if (a.ucmp(b) < 0) { - [a, b] = [b, a]; - - if (a.andln(3) === 3 && b.andln(3) === 3) - j = -j; - } - - a._isub(a, b).iushrn(1); - - const bmod8 = b.andln(7); - - if (bmod8 === 3 || bmod8 === 5) - j = -j; - } - - if (b.cmpn(1) !== 0) - return 0; - - return j; - } - - kronecker(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.isZero()) - return num.ucmpn(1) === 0 ? 1 : 0; - - if (num.isZero()) - return this.ucmpn(1) === 0 ? 1 : 0; - - if (((this.words[0] | num.words[0]) & 1) === 0) - return 0; - - const x = this; - const y = num.clone(); - const bits = y._makeOdd(); - const table = [0, 1, 0, -1, 0, -1, 0, 1]; - - let k = x.jacobi(y); - - if (bits & 1) - k *= table[x.andln(7)]; - - return k | 0; - } - - igcd(num) { - return this.gcd(num)._move(this); - } - - gcd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.isZero()) - return num.abs(); - - if (num.isZero()) - return this.abs(); - - let a = this.clone(); - let b = num.clone(); - - a.negative = 0; - b.negative = 0; - - // Remove common factor of two. - const shift = a._factor2(b); - - if (shift !== 0) { - a.iushrn(shift); - b.iushrn(shift); - } - - for (;;) { - a._makeOdd(); - b._makeOdd(); - - const cmp = a.ucmp(b); - - if (cmp < 0) { - // a > b - [a, b] = [b, a]; - } else if (cmp === 0 || b.ucmpn(1) === 0) { - // Break if a == b. - // Break if b == 1 to avoid repeated subtraction. - break; - } - - a._isub(a, b); - } - - return b.iushln(shift); - } - - ilcm(num) { - return this.lcm(num)._move(this); - } - - lcm(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.isZero() || num.isZero()) - return new BN(0); - - return this.quo(this.gcd(num)).mul(num).iabs(); - } - - egcd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (this.isZero()) { - return [ - new BN(0), - new BN(num.sign()), - num.abs() - ]; - } - - if (num.isZero()) { - return [ - new BN(this.sign()), - new BN(0), - this.abs() - ]; - } - - const x = this.clone(); - const y = num.clone(); - - x.negative = 0; - y.negative = 0; - - // A * x + B * y = x - const A = new BN(1); - const B = new BN(0); - - // C * x + D * y = y - const C = new BN(0); - const D = new BN(1); - - // Remove common factor of two. - const g = x._factor2(y); - - if (g > 0) { - x.iushrn(g); - y.iushrn(g); - } - - const xp = x.clone(); - const yp = y.clone(); - - while (!x.isZero()) { - let i = x._makeOdd(); - let j = y._makeOdd(); - - while (i--) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - - while (j--) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - if (this.negative !== 0) - C.ineg(); - - if (num.negative !== 0) - D.ineg(); - - return [C, D, y.iushln(g)]; - } - - iinvert(num) { - return this.invert(num)._move(this); - } - - invert(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - range(num.sign() > 0, 'invert'); - - if (num.isOdd()) - return this._invertp(num); - - if (num.cmpn(1) === 0) - throw new RangeError('Not invertible.'); - - const [s,, g] = this.egcd(num); - - if (g.cmpn(1) !== 0) - throw new RangeError('Not invertible.'); - - return s.imod(num); - } - - ifermat(num) { - return this.fermat(num)._move(this); - } - - fermat(num) { - const red = HAS_BIGINT ? BN.red(num) : BN.mont(num); - return this.toRed(red).redFermat().fromRed(); - } - - ipowm(y, m, mont) { - return this.powm(y, m, mont)._move(this); - } - - powm(y, m, mont) { - const red = !HAS_BIGINT && mont ? BN.mont(m) : BN.red(m); - return this.toRed(red).redPow(y).fromRed(); - } - - ipowmn(y, m, mont) { - return this.powmn(y, m, mont)._move(this); - } - - powmn(y, m, mont) { - const red = mont ? BN.mont(m) : BN.red(m); - return this.toRed(red).redPown(y).fromRed(); - } - - isqrtm(p) { - return this.sqrtm(p)._move(this); - } - - sqrtm(p) { - enforce(BN.isBN(p), 'p', 'bignum'); - - let red; - - if (p.andln(3) === 3 || p.andln(7) === 5) { - // Probably not worth the setup. - red = BN.red(p); - } else { - red = BN.mont(p); - } - - return this.toRed(red).redSqrt().fromRed(); - } - - isqrtpq(p, q) { - return this.sqrtpq(p, q)._move(this); - } - - sqrtpq(p, q) { - const sp = this.sqrtm(p); - const sq = this.sqrtm(q); - const [mp, mq] = p.egcd(q); - const lhs = sq.mul(mp).mul(p); - const rhs = sp.mul(mq).mul(q); - const n = p.mul(q); - - return lhs.iadd(rhs).imod(n); - } - - /* - * Primality Testing - */ - - isPrime(rng, reps, limit) { - enforce((reps >>> 0) === reps, 'reps', 'uint32'); - - if (!this.isPrimeMR(rng, reps + 1, true)) - return false; - - if (!this.isPrimeLucas(limit)) - return false; - - return true; - } - - isPrimeMR(rng, reps, force2 = false) { - enforce((reps >>> 0) === reps, 'reps', 'uint32'); - enforce(reps > 0, 'reps', 'integer'); - enforce(typeof force2 === 'boolean', 'force2', 'boolean'); - - const n = this; - - if (n.cmpn(7) < 0) { - return n.cmpn(2) === 0 - || n.cmpn(3) === 0 - || n.cmpn(5) === 0; - } - - if (n.isEven()) - return false; - - const nm1 = n.subn(1); - const nm3 = nm1.subn(2); - const k = nm1.zeroBits(); - const q = nm1.ushrn(k); - - const red = BN.red(n); - const rnm1 = nm1.toRed(red); - const rone = new BN(1).toRed(red); - - next: - for (let i = 0; i < reps; i++) { - let x; - - if (i === reps - 1 && force2) { - x = new BN(2); - } else { - x = BN.random(rng, 0, nm3); - x.iaddn(2); - } - - let y = x.toRed(red).redPow(q); - - if (y.cmp(rone) === 0 || y.cmp(rnm1) === 0) - continue; - - for (let j = 1; j < k; j++) { - y = y.redSqr(); - - if (y.cmp(rnm1) === 0) - continue next; - - if (y.cmp(rone) === 0) - return false; - } - - return false; - } - - return true; - } - - isPrimeLucas(limit = 0) { - enforce((limit >>> 0) === limit, 'limit', 'uint32'); - - const n = this; - - // Ignore 0 and 1. - if (n.cmpn(1) <= 0) - return false; - - // Two is the only even prime. - if (n.isEven()) - return n.cmpn(2) === 0; - - let p = 3; - - for (;;) { - if (p > 10000) { - // Thought to be impossible. - throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`); - } - - if (limit !== 0 && p > limit) { - // Optional DoS limit. - return false; - } - - const d = new BN(p * p - 4); - const j = d.jacobi(n); - - if (j === -1) - break; - - if (j === 0) - return n.cmpn(p + 2) === 0; - - if (p === 40) { - if (n.isSquare()) - return false; - } - - p += 1; - } - - const s = n.addn(1); - const r = s._makeOdd(); - - let vk = new BN(2); - let vk1 = new BN(p); - - for (let i = s.bitLength(); i >= 0; i--) { - if (s.utestn(i)) { - vk = vk.mul(vk1).isubn(p).imod(n); - vk1 = vk1.sqr().isubn(2).imod(n); - } else { - vk1 = vk1.mul(vk).isubn(p).imod(n); - vk = vk.sqr().isubn(2).imod(n); - } - } - - if (vk.cmpn(2) === 0 || vk.cmp(n.subn(2)) === 0) { - const a = vk.muln(p).imod(n); - const b = vk1.ushln(1).imod(n); - - if (a.cmp(b) === 0) - return true; - } - - for (let t = 0; t < r - 1; t++) { - if (vk.isZero()) - return true; - - if (vk.cmpn(2) === 0) - return false; - - vk = vk.sqr().isubn(2).imod(n); - } - - return false; - } - - /* - * Twos Complement - */ - - toTwos(width) { - if (this.negative !== 0) - return this.abs().inotn(width).iaddn(1); - - return this.clone(); - } - - fromTwos(width) { - enforce((width >>> 0) === width, 'width', 'uint32'); - range(width > 0, 'width'); - - if (this.testn(width - 1)) - return this.notn(width).iaddn(1).ineg(); - - return this.clone(); - } - - /* - * Reduction Context - */ - - toRed(ctx) { - enforce(ctx instanceof Red, 'ctx', 'reduction context'); - - if (this.red) - throw new Error('Already in reduction context.'); - - return ctx.convertTo(this); - } - - fromRed() { - red(this.red, 'fromRed'); - return this.red.convertFrom(this); - } - - forceRed(ctx) { - enforce(ctx instanceof Red, 'ctx', 'reduction context'); - - if (this.red) { - if (!ctx.m.eq(this.red.m) || ctx.mont !== this.red.mont) - throw new Error('Already in reduction context.'); - } else { - range(this.negative === 0, 'red'); - range(this.ucmp(ctx.m) < 0, 'red'); - } - - return this.clone()._forceRed(ctx); - } - - redIAdd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIAdd'); - return this.red.iadd(this, num); - } - - redAdd(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redAdd'); - return this.red.add(this, num); - } - - redIAddn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redIAddn'); - return this.red.iaddn(this, num); - } - - redAddn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redAddn'); - return this.red.addn(this, num); - } - - redISub(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redISub'); - return this.red.isub(this, num); - } - - redSub(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redSub'); - return this.red.sub(this, num); - } - - redISubn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redISubn'); - return this.red.isubn(this, num); - } - - redSubn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redSubn'); - return this.red.subn(this, num); - } - - redIMul(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIMul'); - return this.red.imul(this, num); - } - - redMul(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redMul'); - return this.red.mul(this, num); - } - - redIMuln(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redIMuln'); - return this.red.imuln(this, num); - } - - redMuln(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redMuln'); - return this.red.muln(this, num); - } - - redIDiv(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIDiv'); - return this.red.idiv(this, num); - } - - redDiv(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redDiv'); - return this.red.div(this, num); - } - - redIDivn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redIDivn'); - return this.red.idivn(this, num); - } - - redDivn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redDivn'); - return this.red.divn(this, num); - } - - redIPow(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIPow'); - nonred(!num.red, 'redIPow'); - return this.red.ipow(this, num); - } - - redPow(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redPow'); - nonred(!num.red, 'redPow'); - return this.red.pow(this, num); - } - - redIPown(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redIPown'); - return this.red.ipown(this, num); - } - - redPown(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redPown'); - return this.red.pown(this, num); - } - - redISqr() { - red(this.red, 'redISqr'); - return this.red.isqr(this); - } - - redSqr() { - red(this.red, 'redSqr'); - return this.red.sqr(this); - } - - redISqrt() { - red(this.red, 'redISqrt'); - return this.red.isqrt(this); - } - - redSqrt() { - red(this.red, 'redSqrt'); - return this.red.sqrt(this); - } - - redIDivSqrt(v) { - red(this.red, 'redIDivSqrt'); - return this.red.idivsqrt(this, v); - } - - redDivSqrt(v) { - red(this.red, 'redDivSqrt'); - return this.red.divsqrt(this, v); - } - - redIsSquare() { - red(this.red, 'redIsSquare'); - return this.red.isSquare(this); - } - - redIShl(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redIShl'); - nonred(!num.red, 'redIShl'); - return this.red.ishl(this, num); - } - - redShl(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redShl'); - nonred(!num.red, 'redShl'); - return this.red.shl(this, num); - } - - redIShln(num) { - enforce((num >>> 0) === num, 'num', 'uint32'); - red(this.red, 'redIShln'); - return this.red.ishln(this, num); - } - - redShln(num) { - enforce((num >>> 0) === num, 'num', 'uint32'); - red(this.red, 'redShln'); - return this.red.shln(this, num); - } - - redINeg() { - red(this.red, 'redINeg'); - return this.red.ineg(this); - } - - redNeg() { - red(this.red, 'redNeg'); - return this.red.neg(this); - } - - redEq(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - red(this.red, 'redEq'); - return this.red.eq(this, num); - } - - redEqn(num) { - enforce(isSMI(num), 'num', 'smi'); - red(this.red, 'redEqn'); - return this.red.eqn(this, num); - } - - redIsHigh() { - red(this.red, 'redIsHigh'); - return this.red.isHigh(this); - } - - redIsLow() { - red(this.red, 'redIsLow'); - return this.red.isLow(this); - } - - redIsOdd() { - red(this.red, 'redIsOdd'); - return this.red.isOdd(this); - } - - redIsEven() { - red(this.red, 'redIsEven'); - return this.red.isEven(this); - } - - redLegendre() { - red(this.red, 'redLegendre'); - return this.red.legendre(this); - } - - redJacobi() { - red(this.red, 'redJacobi'); - return this.red.jacobi(this); - } - - redKronecker() { - red(this.red, 'redKronecker'); - return this.red.kronecker(this); - } - - redIInvert() { - red(this.red, 'redIInvert'); - return this.red.iinvert(this); - } - - redInvert() { - red(this.red, 'redInvert'); - return this.red.invert(this); - } - - redIFermat() { - red(this.red, 'redIFermat'); - return this.red.ifermat(this); - } - - redFermat() { - red(this.red, 'redFermat'); - return this.red.fermat(this); - } - - /* - * Internal - */ - - _move(dest) { - dest.words = this.words; - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - return dest; - } - - _alloc(size) { - while (this.words.length < size) - this.words.push(0); - - return this; - } - - _expand(size) { - this._alloc(size); - - while (this.length < size) - this.words[this.length++] = 0; - - return this; - } - - _strip() { - while (this.length > 1 && this.words[this.length - 1] === 0) - this.length -= 1; - - return this._normalize(); - } - - _normalize() { - assert(this.length > 0); - - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) - this.negative = 0; - - return this; - } - - _check() { - // We never have a zero length number. - assert(this.length > 0); - - // Cannot exceed array bounds. - assert(this.length <= this.words.length); - - if (this.length === 1) { - // Must be normalized. - if (this.words[0] === 0) - assert(this.negative === 0); - return this; - } - - // Must be stripped. - assert(this.words[this.length - 1] !== 0); - - return this; - } - - _invertp(p) { - // Penk's right shift binary EGCD. - // - // See: The Art of Computer Programming, - // Volume 2, Seminumerical Algorithms - // Donald E. Knuth - // Exercise 4.5.2.39 - enforce(BN.isBN(p), 'p', 'bignum'); - range(p.sign() > 0, 'invert'); - assert(p.isOdd()); - - if (p.cmpn(1) === 0) - throw new RangeError('Not invertible.'); - - const a = this.clone(); - const b = p.clone(); - const u = new BN(1); - const v = new BN(0); - - if (a.isNeg() || a.ucmp(b) >= 0) - a.imod(b); - - while (!a.isZero()) { - let i = a._makeOdd(); - let j = b._makeOdd(); - - while (i--) { - if (u.isOdd()) - u._iadd(u, p); - - u.iushrn(1); - } - - while (j--) { - if (v.isOdd()) - v._iadd(v, p); - - v.iushrn(1); - } - - if (a.ucmp(b) >= 0) { - a._isub(a, b); - if (u.ucmp(v) < 0) { - u._isub(v, u); - u._isub(p, u); - } else { - u._isub(u, v); - } - } else { - b._isub(b, a); - if (v.ucmp(u) < 0) { - v._isub(u, v); - v._isub(p, v); - } else { - v._isub(v, u); - } - } - } - - if (b.cmpn(1) !== 0) - throw new RangeError('Not invertible.'); - - assert(v.negative === 0); - assert(v.ucmp(p) < 0); - - return v; - } - - _makeOdd() { - const shift = this.zeroBits(); - - if (shift > 0) - this.iushrn(shift); - - return shift; - } - - _factor2(num) { - // Find common factor of two. - // Expects inputs to be non-zero. - if ((this.words[0] | num.words[0]) & 1) - return 0; - - const len = Math.min(this.length, num.length); - - let r = 0; - - for (let i = 0; i < len; i++) { - const b = zeroBits(this.words[i] | num.words[i]); - - r += b; - - if (b !== 26) - break; - } - - return r; - } - - _cloneNormal() { - return this.red ? this.fromRed() : this.clone(); - } - - _forceRed(ctx) { - this.red = ctx; - return this; - } - - /* - * Helpers - */ - - clone() { - const copy = new BN(); - - copy.words = new Array(this.length); - - for (let i = 0; i < this.length; i++) - copy.words[i] = this.words[i]; - - copy.length = this.length; - copy.negative = this.negative; - copy.red = this.red; - - return copy; - } - - inject(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - this._alloc(num.length); - - for (let i = 0; i < num.length; i++) - this.words[i] = num.words[i]; - - this.length = num.length; - this.negative = num.negative; - this.red = num.red; - - return this; - } - - set(num, endian) { - return this.fromNumber(num, endian); - } - - swap(num) { - enforce(BN.isBN(num), 'num', 'bignum'); - - const x = this; - const y = num; - - [x.words, y.words] = [y.words, x.words]; - [x.length, y.length] = [y.length, x.length]; - [x.negative, y.negative] = [y.negative, x.negative]; - [x.red, y.red] = [y.red, x.red]; - - return x; - } - - reverse() { - const neg = this.negative; - - this.fromBuffer(this.toBuffer('be'), 'le'); - this.negative = neg; - - return this; - } - - byteLength() { - return Math.ceil(this.bitLength() / 8); - } - - bitLength() { - const w = this.words[this.length - 1]; - const hi = countBits(w); - return (this.length - 1) * 26 + hi; - } - - zeroBits() { - if (this.isZero()) - return 0; - - if (this.isOdd()) - return 0; - - let r = 0; - - for (let i = 0; i < this.length; i++) { - const b = zeroBits(this.words[i]); - - r += b; - - if (b !== 26) - break; - } - - return r; - } - - isSafe() { - if (this.length <= 2) - return true; - - if (this.length === 3 && this.words[2] === 0x01) - return true; - - return false; - } - - word(pos) { - enforce((pos >>> 0) === pos, 'pos', 'uint32'); - - if (pos >= this.length) - return 0; - - return this.words[pos]; - } - - [custom]() { - let prefix = 'BN'; - - if (this.red) - prefix = 'BN-R'; - - return `<${prefix}: ${this.toString(10)}>`; - } - - /* - * Conversion - */ - - toNumber() { - let num = this.words[0]; - - if (this.length === 2) { - num += this.words[1] * 0x4000000; - } else if (this.length === 3 && this.words[2] === 0x01) { - // Note: at this stage it is known that the top bit is set. - num += 0x10000000000000 + (this.words[1] * 0x4000000); - } else if (this.length > 2) { - throw new RangeError('Number can only safely store up to 53 bits.'); - } - - return this.negative !== 0 ? -num : num; - } - - toDouble() { - let num = 0; - - for (let i = this.length - 1; i >= 0; i--) - num = (num * 0x4000000) + this.words[i]; - - return this.negative !== 0 ? -num : num; - } - - valueOf() { - return this.toDouble(); - } - - toBigInt() { - if (!HAS_BIGINT) - throw new Error('BigInt is not supported!'); - - const s52 = BigInt(52); - const s26 = BigInt(26); - - let i = this.length - 1; - let num = BigInt(0); - - for (; i >= 1; i -= 2) { - const hi = this.words[i] * 0x4000000; - const lo = this.words[i - 1]; - - num = (num << s52) | BigInt(hi + lo); - } - - if (i >= 0) - num = (num << s26) | BigInt(this.words[0]); - - return this.negative !== 0 ? -num : num; - } - - toBool() { - return !this.isZero(); - } - - toString(base, padding) { - base = getBase(base); - - if (padding == null) - padding = 0; - - if (padding === 0) - padding = 1; - - enforce((base >>> 0) === base, 'base', 'uint32'); - enforce((padding >>> 0) === padding, 'padding', 'uint32'); - - if (base < 2 || base > 36) - throw new RangeError('Base ranges between 2 and 36.'); - - this._check(); - - if (base === 16) { - let out = ''; - let off = 0; - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const w = this.words[i]; - const word = (((w << off) | carry) & 0xffffff).toString(16); - - carry = (w >>> (24 - off)) & 0xffffff; - - if (carry !== 0 || i !== this.length - 1) - out = zeros[6 - word.length] + word + out; - else - out = word + out; - - off += 2; - - if (off >= 26) { - off -= 26; - i -= 1; - } - } - - if (carry !== 0) - out = carry.toString(16) + out; - - while (out.length % padding !== 0) - out = '0' + out; - - if (this.negative !== 0) - out = '-' + out; - - return out; - } - - const groupSize = groupSizes[base - 1]; - const groupBase = groupBases[base - 1]; - const c = this.clone(); - - let out = ''; - - c.negative = 0; - - while (!c.isZero()) { - const r = c.remrn(groupBase).toString(base); - - c.iquon(groupBase); - - if (!c.isZero()) - out = zeros[groupSize - r.length] + r + out; - else - out = r + out; - } - - if (this.isZero()) - out = '0'; - - while (out.length % padding !== 0) - out = '0' + out; - - if (this.negative !== 0) - out = '-' + out; - - return out; - } - - toJSON() { - return this.toString(16, 2); - } - - toArray(endian, length) { - return this.toArrayLike(Array, endian, length); - } - - toBuffer(endian, length) { - return this.toArrayLike(bufferExports.Buffer, endian, length); - } - - toArrayLike(ArrayType, endian, length) { - if (endian == null) - endian = 'be'; - - if (length == null) - length = 0; - - enforce(typeof ArrayType === 'function', 'ArrayType', 'function'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - enforce((length >>> 0) === length, 'length', 'uint32'); - - this._check(); - - const bytes = this.byteLength(); - const size = length || Math.max(1, bytes); - - if (bytes > size) - throw new RangeError('Byte array longer than desired length.'); - - const res = allocate(ArrayType, size); - - // See: https://github.com/indutny/bn.js/pull/222 - if (endian === 'be') { - let pos = res.length - 1; - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const shift = (i & 3) << 1; - const word = (this.words[i] << shift) | carry; - - res[pos--] = word & 0xff; - - if (pos >= 0) - res[pos--] = (word >>> 8) & 0xff; - - if (pos >= 0) - res[pos--] = (word >>> 16) & 0xff; - - if (shift === 6) { - if (pos >= 0) - res[pos--] = (word >>> 24) & 0xff; - - carry = 0; - } else { - carry = word >>> 24; - } - } - - if (pos >= 0) { - res[pos--] = carry; - - while (pos >= 0) - res[pos--] = 0; - - carry = 0; - } - - assert(carry === 0); - } else { - let pos = 0; - let carry = 0; - - for (let i = 0; i < this.length; i++) { - const shift = (i & 3) << 1; - const word = (this.words[i] << shift) | carry; - - res[pos++] = word & 0xff; - - if (pos < res.length) - res[pos++] = (word >>> 8) & 0xff; - - if (pos < res.length) - res[pos++] = (word >>> 16) & 0xff; - - if (shift === 6) { - if (pos < res.length) - res[pos++] = (word >>> 24) & 0xff; - - carry = 0; - } else { - carry = word >>> 24; - } - } - - if (pos < res.length) { - res[pos++] = carry; - - while (pos < res.length) - res[pos++] = 0; - - carry = 0; - } - - assert(carry === 0); - } - - return res; - } - - encode(endian, length) { - return this.toBuffer(endian, length); - } - - /* - * Instantiation - */ - - of(num, endian) { - return this.fromNumber(num, endian); - } - - fromNumber(num, endian) { - if (endian == null) - endian = 'be'; - - enforce(isInteger(num), 'num', 'integer'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - const neg = (num < 0) | 0; - - if (neg) - num = -num; - - if (num < 0x4000000) { - this.words[0] = num & 0x3ffffff; - this.length = 1; - } else if (num < 0x10000000000000) { - this.words = [ - num & 0x3ffffff, - (num / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - this.words = [ - num & 0x3ffffff, - (num / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - this.negative = neg; - - if (endian === 'le') - this.reverse(); - - return this; - } - - fromDouble(num, endian) { - if (endian == null) - endian = 'be'; - - enforce(typeof num === 'number', 'num', 'double'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - if (!isFinite(num)) - num = 0; - - const neg = (num <= -1) | 0; - - if (num < 0) - num = -num; - - num = Math.floor(num); - - this.words = []; - - while (num > 0) { - const lo = num % 0x4000000; - const hi = (num - lo) / 0x4000000; - - this.words.push(lo); - - num = hi; - } - - if (this.words.length === 0) - this.words.push(0); - - this.length = this.words.length; - this.negative = neg; - - if (endian === 'le') - this.reverse(); - - return this; - } - - fromBigInt(num, endian) { - if (endian == null) - endian = 'be'; - - enforce(typeof num === 'bigint', 'num', 'bigint'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - if (!HAS_BIGINT) - throw new Error('BigInt is not supported!'); - - // You know the implementation has a - // problem when strings are twice - // as fast as bigints. - const start = (num < BigInt(0)) | 0; - - this._fromHex(num.toString(16), start); - this.negative = start; - - if (endian === 'le') - this.reverse(); - - return this; - } - - fromBool(value) { - enforce(typeof value === 'boolean', 'value', 'boolean'); - - this.words[0] = value | 0; - this.length = 1; - this.negative = 0; - - return this; - } - - fromString(str, base, endian) { - if (base === 'le' || base === 'be') - [base, endian] = [endian, base]; - - base = getBase(base); - - if (endian == null) - endian = 'be'; - - enforce(typeof str === 'string', 'string', 'string'); - enforce((base >>> 0) === base, 'base', 'uint32'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - if (base < 2 || base > 36) - throw new Error('Base ranges between 2 and 36.'); - - str = str.replace(/\s+/g, ''); - - let start = 0; - - if (str.length > 0 && str.charCodeAt(0) === 0x2d) - start = 1; - - if (base === 16) - this._fromHex(str, start); - else - this._fromBase(str, base, start); - - this.negative = start; - - this._normalize(); - - if (endian === 'le') - this.reverse(); - - return this; - } - - _fromHex(str, start) { - this.length = Math.max(2, Math.ceil((str.length - start) / 6)); - this.words = new Array(this.length); - - for (let i = 0; i < this.length; i++) - this.words[i] = 0; - - // Scan 24-bit chunks and add them to the number. - let off = 0; - let i = str.length - 6; - let j = 0; - - for (; i >= start; i -= 6) { - const w = parseHex(str, i, i + 6); - - this.words[j] |= (w << off) & 0x3ffffff; - - // `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb. - this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff; - - off += 24; - - if (off >= 26) { - off -= 26; - j += 1; - } - } - - if (i + 6 !== start) { - const w = parseHex(str, start, i + 6); - - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff; - } - - return this._strip(); - } - - _fromBase(str, base, start) { - // Initialize as zero. - this.words[0] = 0; - this.length = 1; - this.negative = 0; - - // Find length of limb in base. - let limbLen = 0; - let limbPow = 1; - - for (; limbPow <= 0x3ffffff; limbPow *= base) - limbLen += 1; - - limbLen -= 1; - limbPow = (limbPow / base) | 0; - - const total = str.length - start; - const mod = total % limbLen; - const end = Math.min(total, total - mod) + start; - - let i = start; - - for (; i < end; i += limbLen) { - const word = parseBase(str, i, i + limbLen, base); - - this.imuln(limbPow); - this._iaddn(word); - } - - if (mod !== 0) { - const pow = Math.pow(base, mod); - const word = parseBase(str, i, str.length, base); - - this.imuln(pow); - this._iaddn(word); - } - - return this; - } - - fromJSON(json) { - if (BN.isBN(json)) { - if (json.red) - return json.fromRed(); - - return json.clone(); - } - - if (Array.isArray(json)) { - for (const chunk of json) - enforce(typeof chunk === 'string', 'chunk', 'string'); - - json = json.join(''); - } - - return this.fromString(json, 16); - } - - fromBN(num) { - return this.inject(num); - } - - fromArray(data, endian) { - enforce(Array.isArray(data), 'data', 'array'); - return this.fromArrayLike(data, endian); - } - - fromBuffer(data, endian) { - enforce(bufferExports.Buffer.isBuffer(data), 'data', 'buffer'); - return this.fromArrayLike(data, endian); - } - - fromArrayLike(data, endian) { - if (endian == null) - endian = 'be'; - - enforce(data && (data.length >>> 0) === data.length, 'data', 'array-like'); - enforce(endian === 'be' || endian === 'le', 'endian', 'endianness'); - - if (data.length === 0) { - this.words[0] = 0; - this.length = 1; - this.negative = 0; - return this; - } - - this.length = Math.max(2, Math.ceil(data.length / 3)); - this.words = new Array(this.length); - this.negative = 0; - - for (let i = 0; i < this.length; i++) - this.words[i] = 0; - - const left = data.length % 3; - - let off = 0; - let j = 0; - let w = 0; - - if (endian === 'be') { - for (let i = data.length - 1; i >= 2; i -= 3) { - const w = data[i] | (data[i - 1] << 8) | (data[i - 2] << 16); - - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - - off += 24; - - if (off >= 26) { - off -= 26; - j += 1; - } - } - - switch (left) { - case 2: - w = data[1] | (data[0] << 8); - break; - case 1: - w = data[0]; - break; - } - } else { - const len = data.length - left; - - for (let i = 0; i < len; i += 3) { - const w = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16); - - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - - off += 24; - - if (off >= 26) { - off -= 26; - j += 1; - } - } - - switch (left) { - case 2: - w = data[len] | (data[len + 1] << 8); - break; - case 1: - w = data[len]; - break; - } - } - - if (left > 0) { - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - } - - return this._strip(); - } - - decode(data, endian) { - return this.fromBuffer(data, endian); - } - - from(num, base, endian) { - if (num == null) - return this; - - if (base === 'le' || base === 'be') - [base, endian] = [endian, base]; - - if (typeof num === 'number') - return this.fromNumber(num, endian); - - if (typeof num === 'bigint') - return this.fromBigInt(num, endian); - - if (typeof num === 'string') - return this.fromString(num, base, endian); - - if (typeof num === 'object') { - if (BN.isBN(num)) - return this.fromBN(num, endian); - - if ((num.length >>> 0) === num.length) - return this.fromArrayLike(num, endian); - } - - if (typeof num === 'boolean') - return this.fromBool(num); - - throw new TypeError('Non-numeric object passed to BN.'); - } - - /* - * Static Methods - */ - - static min(...args) { - let min = null; - - for (const num of args) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (!min || num.cmp(min) < 0) - min = num; - } - - return min || new BN(0); - } - - static max(...args) { - let max = null; - - for (const num of args) { - enforce(BN.isBN(num), 'num', 'bignum'); - - if (!max || num.cmp(max) > 0) - max = num; - } - - return max || new BN(0); - } - - static cmp(a, b) { - enforce(BN.isBN(a), 'a', 'bignum'); - return a.cmp(b); - } - - static ucmp(a, b) { - enforce(BN.isBN(a), 'a', 'bignum'); - return a.ucmp(b); - } - - static red(num) { - return new Red(num); - } - - static barrett(num) { - return new Barrett(num); - } - - static mont(num) { - return new Mont(num); - } - - static _prime(name) { - if (primes[name]) - return primes[name]; - - let prime; - - if (name === 'p192') - prime = new P192(); - else if (name === 'p224') - prime = new P224(); - else if (name === 'p521') - prime = new P521(); - else if (name === 'k256') - prime = new K256(); - else if (name === 'p251') - prime = new P251(); - else if (name === 'p25519') - prime = new P25519(); - else if (name === 'p448') - prime = new P448(); - else - throw new Error(`Unknown prime: "${name}".`); - - primes[name] = prime; - - return prime; - } - - static prime(name) { - return BN._prime(name).p.clone(); - } - - static pow(num, exp) { - if (num === 2) - return BN.shift(1, exp); - - return new BN().fromNumber(num).pown(exp); - } - - static shift(num, bits) { - if (num === 1) - return new BN(0).usetn(bits, 1); - - return new BN().fromNumber(num).ishln(bits); - } - - static mask(bits) { - return BN.shift(1, bits).isubn(1); - } - - static randomBits(rng, bits) { - enforce(rng != null, 'rng', 'rng'); - enforce((bits >>> 0) === bits, 'bits', 'uint32'); - - if (typeof rng === 'object') { - enforce(typeof rng.randomBytes === 'function', 'rng', 'rng'); - - const size = (bits + 7) >>> 3; - const total = size * 8; - const bytes = rng.randomBytes(size); - - enforce(bufferExports.Buffer.isBuffer(bytes), 'bytes', 'buffer'); - - if (bytes.length !== size) - throw new RangeError('Invalid number of bytes returned from RNG.'); - - const num = BN.fromBuffer(bytes); - - if (total > bits) - num.iushrn(total - bits); - - return num; - } - - enforce(typeof rng === 'function', 'rng', 'rng'); - - const num = rng(bits); - - enforce(BN.isBN(num), 'num', 'bignum'); - range(num.negative === 0, 'RNG'); - nonred(!num.red, 'RNG'); - - if (num.bitLength() > bits) - throw new RangeError('Invalid number of bits returned from RNG.'); - - return num; - } - - static random(rng, min, max) { - min = BN.cast(min, 16); - max = BN.cast(max, 16); - - if (min.cmp(max) > 0) - throw new RangeError('Minimum cannot be greater than maximum.'); - - const space = max.sub(min).iabs(); - const bits = space.bitLength(); - - if (bits === 0) - return min.clone(); - - for (;;) { - const num = BN.randomBits(rng, bits); - - // Maximum is _exclusive_! - if (num.cmp(space) >= 0) - continue; - - // Minimum is _inclusive_! - num.iadd(min); - - return num; - } - } - - static of(num, endian) { - return new BN().of(num, endian); - } - - static fromNumber(num, endian) { - return new BN().fromNumber(num, endian); - } - - static fromDouble(num, endian) { - return new BN().fromDouble(num, endian); - } - - static fromBigInt(num, endian) { - return new BN().fromBigInt(num, endian); - } - - static fromBool(value) { - return new BN().fromBool(value); - } - - static fromString(str, base, endian) { - return new BN().fromString(str, base, endian); - } - - static fromJSON(json) { - return new BN().fromJSON(json); - } - - static fromBN(num) { - return new BN().fromBN(num); - } - - static fromArray(data, endian) { - return new BN().fromArray(data, endian); - } - - static fromBuffer(data, endian) { - return new BN().fromBuffer(data, endian); - } - - static fromArrayLike(data, endian) { - return new BN().fromArrayLike(data, endian); - } - - static decode(data, endian) { - return new BN().decode(data, endian); - } - - static from(num, base, endian) { - return new BN().from(num, base, endian); - } - - static cast(num, base, endian) { - if (BN.isBN(num)) - return num; - - return new BN(num, base, endian); - } - - static isBN(obj) { - return obj instanceof BN; - } - } - - /* - * Static - */ - - BN.BN = BN; - BN.wordSize = 26; - BN.native = 0; - - /** - * Prime - */ - - class Prime { - constructor(name, p) { - // P = 2^N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = BN.shift(1, this.n).isub(this.p); - this.lo = this.p.clone(); - this.one = this.p.clone(); - } - - ireduce(num) { - // Assumes that `num` is less than `P^2`: - // num = HI * (2^N - K) + HI * K + LO = HI * K + LO (mod P) - const neg = num.negative !== 0; - - // Track bits. - let bits = num.bitLength(); - - // Must be less than P^2. - assert(bits <= this.n * 2); - - // Ensure positive. - num.negative = 0; - - // Reduce. - while (bits > this.n) { - // lo = num & ((1 << n) - 1) - // num = num >> n - this.split(num, this.lo); - - // num = num * K - this.imulK(num); - - // num = num + lo - num._iadd(num, this.lo); - - // bits = bitlen(num) - bits = num.bitLength(); - } - - // Final reduction. - const cmp = bits < this.n ? -1 : num.ucmp(this.p); - - if (cmp === 0) { - num.words[0] = 0; - num.length = 1; - } else if (cmp > 0) { - num._isub(num, this.p); - } else ; - - // Adjust sign. - if (neg && !num.isZero()) - num._isub(this.p, num); - - return num; - } - - split(input, out) { - input._split(this.n, out); - } - - imulK(num) { - return num.imul(this.k); - } - - pm2(x1) { - // Exponent: p - 2 - throw new Error('Not implemented.'); - } - - fermat(x) { - return this.pm2(x); - } - } - - /** - * Prime (3 mod 4) - */ - - class Prime34 extends Prime { - constructor(name, p) { - super(name, p); - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - throw new Error('Not implemented.'); - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - throw new Error('Not implemented.'); - } - - sqrt(x) { - // r = x^((p + 1) / 4) mod p - const {red} = x; - const r = this.pp1d4(x); - - if (!red.sqr(r).eq(x)) - throw new SquareRootError(r); - - return r; - } - - divsqrt(u, v) { - // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p - const {red} = u; - const u2 = red.sqr(u); - const u3 = red.mul(u2, u); - const u5 = red.mul(u3, u2); - const v3 = red.mul(red.sqr(v), v); - const p = this.pm3d4(red.mul(u5, v3)); - const x = red.mul(red.mul(u3, v), p); - const c = red.mul(v, red.sqr(x)); - - if (c.eq(u)) - return x; - - throw new SquareRootError(x); - } - } - - /** - * Prime (5 mod 8) - */ - - class Prime58 extends Prime { - constructor(name, p, sm1) { - super(name, p); - - this.sm1 = new BN(sm1, 16); - } - - pm5d8(x1) { - // Exponent: (p - 5) / 8 - throw new Error('Not implemented.'); - } - - pp3d8(x1) { - // Exponent: (p + 3) / 8 - throw new Error('Not implemented.'); - } - - sqrt(x) { - // r = x^((p + 3) / 8) mod p - const {red} = x; - const sm1 = this.sm1._forceRed(red); - const r = this.pp3d8(x); - - if (red.sqr(r).eq(x)) - return r; - - const c = red.mul(r, sm1); - - if (red.sqr(c).eq(x)) - return c; - - throw new SquareRootError(r); - } - - divsqrt(u, v) { - // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p - const {red} = u; - const sm1 = this.sm1._forceRed(red); - const v3 = red.mul(red.sqr(v), v); - const v7 = red.mul(red.sqr(v3), v); - const p = this.pm5d8(red.mul(u, v7)); - const x = red.mul(red.mul(u, v3), p); - const c = red.mul(v, red.sqr(x)); - - if (c.eq(u)) - return x; - - const mc = red.ineg(c); - - if (mc.eq(u)) - return red.mul(x, sm1); - - if (mc.eq(red.mul(u, sm1))) - throw new SquareRootError(red.mul(x, sm1)); - - throw new SquareRootError(x); - } - } - - /** - * Prime (1 mod 16) - */ - - class Prime116 extends Prime { - constructor(name, p, g) { - super(name, p); - - this.g = new BN(g, 16); - this.z = this.p.subn(1).zeroBits(); - } - - powS(x1) { - // Exponent: (p - 1) / 2^k - throw new Error('Not implemented.'); - } - - powE(x1) { - // Exponent: (s + 1) / 2 - throw new Error('Not implemented.'); - } - - sqrt(x) { - // Tonelli-Shanks (variable time). - // - // Constants: - // - // k = factors of 2 for (p - 1) - // s = (p - 1) / 2^k - // e = (s + 1) / 2 - // n = first non-square in F(p) - // - // Algorithm: - // - // g = n^s mod p - // y = x^e mod p - // b = x^s mod p - // - // loop: - // t = b - // m = 0 - // - // while t != 1: - // t = t^2 mod p - // m += 1 - // - // if m == 0: - // break - // - // if m >= k: - // fail - // - // t = g^(2^(k - m - 1)) mod p - // g = t^2 mod p - // y = y * t mod p - // b = b * g mod p - // k = m - // - // return y - // - const {red} = x; - - switch (red.jacobi(x)) { - case -1: - throw new SquareRootError(x); - case 0: - return x.clone(); - } - - let g = this.g._forceRed(red); - let y = this.powE(x); - let b = this.powS(x); - let k = this.z; - - for (;;) { - let t = b; - let m = 0; - - while (t.cmpn(1) !== 0 && m < k) { - t = red.sqr(t); - m += 1; - } - - if (m === 0) - break; - - assert(m < k); - - t = red.sqrn(g, k - m - 1); - g = red.sqr(t); - y = red.mul(y, t); - b = red.mul(b, g); - k = m; - } - - return y; - } - - divsqrt(u, v) { - const {red} = u; - - if (v.isZero()) - throw new SquareRootError(v); - - return this.sqrt(red.div(u, v)); - } - } - - /** - * P192 - */ - - class P192 extends Prime34 { - constructor() { - // 2^192 - 2^64 - 1 (= 3 mod 4) - super('p192', 'ffffffff ffffffff ffffffff fffffffe' - + 'ffffffff ffffffff'); - } - - imulK(num) { - // K = 0x10000000000000001 - // K = 2^64 + 1 - const one = this.one.inject(num); - return num.iushln(64)._iadd(num, one); - } - - core(x1) { - // Exponent: (p - 3) / 4 - // Bits: 127x1 1x0 62x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x12 = red.sqrnmul(x6, 6, x6); - const x24 = red.sqrnmul(x12, 12, x12); - const x30 = red.sqrnmul(x24, 6, x6); - const x31 = red.sqrnmul(x30, 1, x1); - const x62 = red.sqrnmul(x31, 31, x31); - const x124 = red.sqrnmul(x62, 62, x62); - const x127 = red.sqrnmul(x124, 3, x3); - const r0 = red.sqrn(x127, 1); - const r1 = red.sqrnmul(r0, 62, x62); - - return r1; - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - // Bits: 127x1 1x0 62x1 - return this.core(x1); - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 127x1 1x0 62x1 1x0 1x1 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 128x1 62x0 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x4 = red.sqrnmul(x2, 2, x2); - const x8 = red.sqrnmul(x4, 4, x4); - const x16 = red.sqrnmul(x8, 8, x8); - const x32 = red.sqrnmul(x16, 16, x16); - const x64 = red.sqrnmul(x32, 32, x32); - const x128 = red.sqrnmul(x64, 64, x64); - const r0 = red.sqrn(x128, 62); - - return r0; - } - } - - /** - * P224 - */ - - class P224 extends Prime116 { - constructor() { - // 2^224 - 2^96 + 1 (1 mod 16) - super('p224', 'ffffffff ffffffff ffffffff ffffffff' - + '00000000 00000000 00000001', - '6a0fec67 8598a792 0c55b2d4 0b2d6ffb' - + 'bea3d8ce f3fb3632 dc691b74'); - } - - imulK(num) { - // K = 0xffffffffffffffffffffffff - // K = 2^96 - 1 - const one = this.one.inject(num); - return num.iushln(96)._isub(num, one); - } - - powS(x1) { - // Exponent: 2^128 - 1 - // Bits: 128x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x4 = red.sqrnmul(x2, 2, x2); - const x8 = red.sqrnmul(x4, 4, x4); - const x16 = red.sqrnmul(x8, 8, x8); - const x32 = red.sqrnmul(x16, 16, x16); - const x64 = red.sqrnmul(x32, 32, x32); - const x128 = red.sqrnmul(x64, 64, x64); - - return x128; - } - - powE(x1) { - // Exponent: 2^127 - // Bits: 1x1 127x0 - const {red} = x1; - const r0 = red.sqrn(x1, 127); - - return r0; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 127x1 1x0 96x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x12 = red.sqrnmul(x6, 6, x6); - const x24 = red.sqrnmul(x12, 12, x12); - const x48 = red.sqrnmul(x24, 24, x24); - const x96 = red.sqrnmul(x48, 48, x48); - const x120 = red.sqrnmul(x96, 24, x24); - const x126 = red.sqrnmul(x120, 6, x6); - const x127 = red.sqrnmul(x126, 1, x1); - const r0 = red.sqrn(x127, 1); - const r1 = red.sqrnmul(r0, 96, x96); - - return r1; - } - } - - /** - * P521 - */ - - class P521 extends Prime34 { - constructor() { - // 2^521 - 1 (= 3 mod 4) - super('p521', '000001ff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff'); - } - - imulK(num) { - // K = 0x01 - return num; - } - - core(x1) { - // Exponent: 2^519 - 1 - // Bits: 519x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x7 = red.sqrnmul(x6, 1, x1); - const x8 = red.sqrnmul(x7, 1, x1); - const x16 = red.sqrnmul(x8, 8, x8); - const x32 = red.sqrnmul(x16, 16, x16); - const x64 = red.sqrnmul(x32, 32, x32); - const x128 = red.sqrnmul(x64, 64, x64); - const x256 = red.sqrnmul(x128, 128, x128); - const x512 = red.sqrnmul(x256, 256, x256); - const x519 = red.sqrnmul(x512, 7, x7); - - return x519; - } - - pm3d4(x1) { - // Exponent: 2^519 - 1 - // Bits: 519x1 - return this.core(x1); - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 519x1 1x0 1x1 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 1x1 519x0 - const {red} = x1; - const r0 = red.sqrn(x1, 519); - - return r0; - } - } - - /** - * K256 - */ - - class K256 extends Prime34 { - constructor() { - // 2^256 - 2^32 - 977 (= 3 mod 4) - super('k256', 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff fffffffe fffffc2f'); - } - - split(input, output) { - // 256 = 9 * 26 + 22 - const mask = 0x3fffff; - const len = Math.min(input.length, 9); - - output._alloc(len + 1); - - for (let i = 0; i < len; i++) - output.words[i] = input.words[i]; - - output.length = len; - - if (input.length <= 9) { - output._strip(); - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs. - let prev = input.words[9]; - let i = 10; - - output.words[output.length++] = prev & mask; - output._strip(); - - for (; i < input.length; i++) { - const next = input.words[i] | 0; - - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - - prev = next; - } - - prev >>>= 22; - - input.words[i - 10] = prev; - - if (prev === 0 && input.length > 10) - input.length -= 10; - else - input.length -= 9; - - input._strip(); // Unsure if we need this. - } - - imulK(num) { - // K = 0x1000003d1 = [0x40, 0x3d1] - // K = 2^32 + 977 - num._expand(num.length + 2); - - // Bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - let lo = 0; - - for (let i = 0; i < num.length; i++) { - const w = num.words[i]; - - lo += w * 0x3d1; - - num.words[i] = lo & 0x3ffffff; - - lo = w * 0x40 + Math.floor(lo / 0x4000000); - } - - // Fast length reduction. - if (num.words[num.length - 1] === 0) { - num.length -= 1; - if (num.words[num.length - 1] === 0) - num.length -= 1; - } - - // Note: we shouldn't need to strip here. - return num; - } - - core(x1, x2) { - // Exponent: (p - 47) / 64 - // Bits: 223x1 1x0 22x1 4x0 - const {red} = x1; - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x9 = red.sqrnmul(x6, 3, x3); - const x11 = red.sqrnmul(x9, 2, x2); - const x22 = red.sqrnmul(x11, 11, x11); - const x44 = red.sqrnmul(x22, 22, x22); - const x88 = red.sqrnmul(x44, 44, x44); - const x176 = red.sqrnmul(x88, 88, x88); - const x220 = red.sqrnmul(x176, 44, x44); - const x223 = red.sqrnmul(x220, 3, x3); - const r0 = red.sqrn(x223, 1); - const r1 = red.sqrnmul(r0, 22, x22); - const r2 = red.sqrn(r1, 4); - - return r2; - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r2 = this.core(x1, x2); - const r3 = red.sqrnmul(r2, 1, x1); - const r4 = red.sqrn(r3, 1); - const r5 = red.sqrnmul(r4, 2, x2); - - return r5; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 1x0 1x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r2 = this.core(x1, x2); - const r3 = red.sqrnmul(r2, 1, x1); - const r4 = red.sqrn(r3, 1); - const r5 = red.sqrnmul(r4, 2, x2); - const r6 = red.sqrn(r5, 1); - const r7 = red.sqrnmul(r6, 1, x1); - - return r7; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 223x1 1x0 22x1 4x0 2x1 2x0 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r2 = this.core(x1, x2); - const r3 = red.sqrnmul(r2, 2, x2); - const r4 = red.sqrn(r3, 2); - - return r4; - } - } - - /** - * P251 - */ - - class P251 extends Prime34 { - constructor() { - // 2^251 - 9 - super('p251', '07ffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff fffffff7'); - } - - imulK(num) { - // K = 0x09 - if (num.isZero()) - return num; - - let carry = 0; - - for (let i = 0; i < num.length; i++) { - const w = num.words[i] * 0x09 + carry; - - carry = w >>> 26; - - num.words[i] = w & 0x3ffffff; - } - - if (carry !== 0) { - num._alloc(num.length + 1); - num.words[num.length++] = carry; - } - - // Note: we shouldn't need to strip here. - return num; - } - - core(x1) { - // Exponent: 2^247 - 1 - // Bits: 247x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x12 = red.sqrnmul(x6, 6, x6); - const x24 = red.sqrnmul(x12, 12, x12); - const x48 = red.sqrnmul(x24, 24, x24); - const x96 = red.sqrnmul(x48, 48, x48); - const x192 = red.sqrnmul(x96, 96, x96); - const x240 = red.sqrnmul(x192, 48, x48); - const x246 = red.sqrnmul(x240, 6, x6); - const x247 = red.sqrnmul(x246, 1, x1); - - return x247; - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - // Bits: 247x1 1x0 1x1 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 247x1 1x0 1x1 1x0 1x1 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - const r3 = red.sqrn(r2, 1); - const r4 = red.sqrnmul(r3, 1, x1); - - return r4; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 248x1 1x0 - const {red} = x1; - const r0 = this.core(x1); - const r1 = red.sqrnmul(r0, 1, x1); - const r2 = red.sqrn(r1, 1); - - return r2; - } - } - - /** - * P25519 - */ - - class P25519 extends Prime58 { - constructor() { - // 2^255 - 19 (= 5 mod 8) - super('p25519', '7fffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff ffffffff ffffffed', - '2b832480 4fc1df0b 2b4d0099 3dfbd7a7' - + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'); - } - - imulK(num) { - // K = 0x13 - let carry = 0; - - for (let i = 0; i < num.length; i++) { - const w = num.words[i] * 0x13 + carry; - - carry = w >>> 26; - - num.words[i] = w & 0x3ffffff; - } - - if (carry !== 0) { - num._alloc(num.length + 1); - num.words[num.length++] = carry; - } - - // Note: we shouldn't need to strip here. - return num; - } - - core(x1, x2) { - // Exponent: 2^250 - 1 - // Bits: 250x1 - const {red} = x1; - const x4 = red.sqrnmul(x2, 2, x2); - const x5 = red.sqrnmul(x4, 1, x1); - const x10 = red.sqrnmul(x5, 5, x5); - const x20 = red.sqrnmul(x10, 10, x10); - const x40 = red.sqrnmul(x20, 20, x20); - const x50 = red.sqrnmul(x40, 10, x10); - const x100 = red.sqrnmul(x50, 50, x50); - const x200 = red.sqrnmul(x100, 100, x100); - const x250 = red.sqrnmul(x200, 50, x50); - - return x250; - } - - pm5d8(x1) { - // Exponent: (p - 5) / 8 - // Bits: 250x1 1x0 1x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r0 = this.core(x1, x2); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 250x1 1x0 1x1 1x0 2x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r0 = this.core(x1, x2); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - const r3 = red.sqrn(r2, 1); - const r4 = red.sqrnmul(r3, 2, x2); - - return r4; - } - - pp3d8(x1) { - // Exponent: (p + 3) / 8 - // Bits: 251x1 1x0 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r0 = this.core(x1, x2); - const r1 = red.sqrnmul(r0, 1, x1); - const r2 = red.sqrn(r1, 1); - - return r2; - } - } - - /** - * P448 - */ - - class P448 extends Prime34 { - constructor() { - // 2^448 - 2^224 - 1 (= 3 mod 4) - super('p448', 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff fffffffe ffffffff' - + 'ffffffff ffffffff ffffffff ffffffff' - + 'ffffffff ffffffff'); - } - - imulK(num) { - // K = 0x100000000000000000000000000000000000000000000000000000001 - // K = 2^224 + 1 - const one = this.one.inject(num); - return num.iushln(224)._iadd(num, one); - } - - core(x1, x2) { - // Exponent: 2^222 - 1 - // Bits: 222x1 - const {red} = x1; - const x3 = red.sqrnmul(x2, 1, x1); - const x6 = red.sqrnmul(x3, 3, x3); - const x9 = red.sqrnmul(x6, 3, x3); - const x11 = red.sqrnmul(x9, 2, x2); - const x22 = red.sqrnmul(x11, 11, x11); - const x44 = red.sqrnmul(x22, 22, x22); - const x88 = red.sqrnmul(x44, 44, x44); - const x176 = red.sqrnmul(x88, 88, x88); - const x220 = red.sqrnmul(x176, 44, x44); - const x222 = red.sqrnmul(x220, 2, x2); - - return x222; - } - - pm3d4(x1) { - // Exponent: (p - 3) / 4 - // Bits: 223x1 1x0 222x1 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const x222 = this.core(x1, x2); - const r0 = red.sqrnmul(x222, 1, x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 222, x222); - - return r2; - } - - pm2(x1) { - // Exponent: p - 2 - // Bits: 223x1 1x0 222x1 1x0 1x1 - const {red} = x1; - const r0 = this.pm3d4(x1); - const r1 = red.sqrn(r0, 1); - const r2 = red.sqrnmul(r1, 1, x1); - - return r2; - } - - pp1d4(x1) { - // Exponent: (p + 1) / 4 - // Bits: 224x1 222x0 - const {red} = x1; - const x2 = red.sqrnmul(x1, 1, x1); - const r0 = this.core(x1, x2); - const r1 = red.sqrnmul(r0, 2, x2); - const r2 = red.sqrn(r1, 222); - - return r2; - } - } - - /** - * Reduction Engine - */ - - class Red { - constructor(m) { - let prime = null; - - if (typeof m === 'string') { - prime = BN._prime(m); - m = prime.p; - } - - enforce(BN.isBN(m), 'm', 'bignum'); - nonred(!m.red, 'reduction'); - range(m.sign() > 0, 'reduction'); - - this.m = m; - this.prime = prime; - this.mb = null; - this.sm1 = null; - } - - _verify1(a) { - range(a.negative === 0, 'red'); - red(a.red != null, 'red'); - } - - _verify2(a, b) { - range((a.negative | b.negative) === 0, 'red'); - red(a.red != null && a.red === b.red, 'red'); - } - - get mont() { - return false; - } - - precompute() { - // Precompute `sqrt(-1)` for primes congruent to 5 mod 8. - if (this.sm1 === null && this.m.andln(7) === 5) { - if (this.prime) { - this.sm1 = this.prime.sm1.clone()._forceRed(this); - } else { - const x = new BN(2).toRed(this); - const e = this.m.subn(1).iushrn(2); - - // sqrt(-1) = 2^((p - 1) / 4) mod p - this.sm1 = this.pow(x, e); - } - } - - return this; - } - - convertTo(num) { - const res = num.mod(this.m); - res.red = this; - return res; - } - - convertFrom(num) { - const res = num.clone(); - res.red = null; - return res; - } - - intTo(a) { - return a; - } - - intFrom(a) { - return a; - } - - imod(a) { - if (this.prime) - return this.prime.ireduce(a)._forceRed(this); - - return a.imod(this.m)._forceRed(this); - } - - iadd(a, b) { - this._verify2(a, b); - - a._iadd(a, b); - - if (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - - return a; - } - - add(a, b) { - if (a.length < b.length) - return this.iadd(b.clone(), a); - - return this.iadd(a.clone(), b); - } - - iaddn(a, num) { - this._verify1(a); - - if (num < 0) - return this.isubn(a, -num); - - if (this.m.length === 1) - num %= this.m.words[0]; - - a._iaddn(num); - - if (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - - return a; - } - - addn(a, num) { - return this.iaddn(a.clone(), num); - } - - isub(a, b) { - this._verify2(a, b); - - // 0: a - a mod m == 0 - // -1: a - b mod m == m - (b - a) - // +1: a - b mod m == a - b - const cmp = a.ucmp(b); - - if (cmp === 0) { - a.words[0] = 0; - a.length = 1; - return a; - } - - if (cmp < 0) { - a._isub(b, a); - a._isub(this.m, a); - } else { - a._isub(a, b); - } - - return a; - } - - sub(a, b) { - return this.isub(a.clone(), b); - } - - isubn(a, num) { - this._verify1(a); - - if (num < 0) - return this.iaddn(a, -num); - - if (this.m.length === 1) - num %= this.m.words[0]; - - // <: a - b mod m == m - (b - a) - // >=: a - b mod m == a - b - if (a.length === 1 && a.words[0] < num) { - a.words[0] = num - a.words[0]; - a._isub(this.m, a); - } else { - a._isubn(num); - } - - return a; - } - - subn(a, num) { - return this.isubn(a.clone(), num); - } - - imul(a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - } - - mul(a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - } - - imuln(a, num) { - this._verify1(a); - - if (a.isZero()) - return a; - - if (num === 0) { - a.words[0] = 0; - a.length = 1; - return a; - } - - const neg = num < 0; - - if (neg) - num = -num; - - if (this.m.length === 1) - num %= this.m.words[0]; - - a.imuln(num); - - if (num <= 16) { - // Quick reduction. - while (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - } else { - this.imod(a); - } - - if (neg) - this.ineg(a); - - return a; - } - - muln(a, num) { - return this.imuln(a.clone(), num); - } - - idiv(a, b) { - return this.div(a, b)._move(a); - } - - div(a, b) { - return this.mul(a, this.invert(b)); - } - - idivn(a, num) { - return this.divn(a, num)._move(a); - } - - divn(a, num) { - return this.div(a, this.convertTo(new BN(num))); - } - - ipow(a, num) { - return this.pow(a, num)._move(a); - } - - pow(a, num) { - this._verify1(a); - - if (num.isNeg()) - a = this.invert(a); - - // Small exponent. - if (num.length === 1) - return this.pown(a, num.words[0]); - - // Call out to BigInt. - if (HAS_BIGINT && !this.prime) - return this.powInt(a, num); - - // Otherwise, a BN implementation. - return this.powNum(a, num); - } - - powNum(a, num) { - // Sliding window (odd multiples only). - const one = new BN(1).toRed(this); - const wnd = new Array(WND_SIZE); - const a2 = this.sqr(a); - - wnd[0] = a; - - for (let i = 1; i < WND_SIZE; i++) - wnd[i] = this.mul(wnd[i - 1], a2); - - let i = num.bitLength(); - let r = one; - - while (i >= WND_WIDTH) { - let width = WND_WIDTH; - let bits = num.bits(i - width, width); - - if (bits < WND_SIZE) { - r = this.sqr(r); - i -= 1; - continue; - } - - while ((bits & 1) === 0) { - width -= 1; - bits >>= 1; - } - - if (r === one) { - r = wnd[bits >> 1].clone(); - } else { - r = this.sqrn(r, width); - r = this.mul(r, wnd[bits >> 1]); - } - - i -= width; - } - - if (i > 0) { - const bits = num.bits(0, i); - - while (i--) { - r = this.sqr(r); - - if ((bits >> i) & 1) - r = this.mul(r, a); - } - } - - return r; - } - - powInt(a, num) { - if (this.mb === null) - this.mb = this.m.toBigInt(); - - const x = this.intFrom(a.toBigInt()); - const y = powInt(x, num, this.mb); - const z = this.intTo(y); - - return BN.fromBigInt(z)._forceRed(this); - } - - sqrn(a, n) { - while (n--) - a = this.sqr(a); - - return a; - } - - sqrnmul(a, n, b) { - return this.mul(this.sqrn(a, n), b); - } - - ipown(a, num) { - return this.pown(a, num)._move(a); - } - - pown(a, num) { - this._verify1(a); - - if (num < 0) { - a = this.invert(a); - num = -num; - } - - if (num === 0) - return new BN(1).toRed(this); - - if (num === 1) - return a.clone(); - - const bits = countBits(num); - - let r = a; - - for (let i = bits - 2; i >= 0; i--) { - r = this.sqr(r); - - if ((num >> i) & 1) - r = this.mul(r, a); - } - - return r; - } - - isqr(a) { - return this.imul(a, a); - } - - sqr(a) { - return this.mul(a, a); - } - - isqrt(x) { - return this.sqrt(x)._move(x); - } - - sqrt(x) { - this._verify1(x); - - // Optimized square root chain. - if (this.prime) - return this.prime.sqrt(x); - - // Fast case (p = 3 mod 4). - if (this.m.andln(3) === 3) - return this.sqrt3mod4(x); - - // Fast case (p = 5 mod 8). - if (this.m.andln(7) === 5) { - if (this.sm1 != null) - return this.sqrt5mod8sm1(x); - return this.sqrt5mod8(x); - } - - // Slow case (Tonelli-Shanks). - return this.sqrt0(x); - } - - sqrt3mod4(x) { - const e = this.m.addn(1).iushrn(2); // (p + 1) / 4 - const b = this.pow(x, e); - - if (!this.sqr(b).eq(x)) - throw new SquareRootError(b); - - return b; - } - - sqrt5mod8(x) { - // Atkin's Algorithm. - const one = new BN(1).toRed(this); - const e = this.m.ushrn(3); // (p - 5) / 8 - const x2 = this.add(x, x); - const alpha = this.pow(x2, e); - const beta = this.mul(x2, this.sqr(alpha)); - const b = this.mul(this.mul(alpha, x), this.isub(beta, one)); - - if (!this.sqr(b).eq(x)) - throw new SquareRootError(b); - - return b; - } - - sqrt5mod8sm1(x) { - const e = this.m.addn(3).iushrn(3); // (p + 3) / 8 - const b = this.pow(x, e); - - if (this.sqr(b).eq(x)) - return b; - - const c = this.mul(b, this.sm1); - - if (this.sqr(c).eq(x)) - return c; - - throw new SquareRootError(b); - } - - sqrt0(x) { - if (this.m.cmpn(1) === 0 || !this.m.isOdd()) - throw new Error('Invalid prime.'); - - switch (this.jacobi(x)) { - case -1: - throw new SquareRootError(x); - case 0: - return x.clone(); - } - - const one = new BN(1).toRed(this); - const s = this.m.subn(1); - const e = s._makeOdd(); - const n = new BN(2).toRed(this); - - while (this.jacobi(n) !== -1) - this.iadd(n, one); - - let g = this.pow(n, s); - let b = this.pow(x, s); - let y = this.pow(x, s.iaddn(1).iushrn(1)); - let k = e; - - for (;;) { - let t = b; - let m = 0; - - while (!t.eq(one) && m < k) { - t = this.sqr(t); - m += 1; - } - - if (m === 0) - break; - - assert(m < k); - - t = this.sqrn(g, k - m - 1); - g = this.sqr(t); - y = this.mul(y, t); - b = this.mul(b, g); - k = m; - } - - return y; - } - - idivsqrt(u, v) { - return this.divsqrt(u, v)._move(u); - } - - divsqrt(u, v) { - this._verify2(u, v); - - // u = 0, v = 0 - if (u.isZero() && v.isZero()) - throw new SquareRootError(v); - - // Optimized inverse square root chain. - if (this.prime) - return this.prime.divsqrt(u, v); - - // p = 3 mod 4 - if (this.m.andln(3) === 3) - return this.divsqrt3mod4(u, v); - - // p = 5 mod 8 - if (this.sm1 != null && this.m.andln(7) === 5) - return this.divsqrt5mod8(u, v); - - // v = 0 - if (v.isZero()) - throw new SquareRootError(v); - - return this.sqrt(this.div(u, v)); - } - - divsqrt3mod4(u, v) { - // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p - const e = this.m.subn(3).iushrn(2); - const u2 = this.sqr(u); - const u3 = this.mul(u2, u); - const u5 = this.mul(u3, u2); - const v3 = this.mul(this.sqr(v), v); - const p = this.pow(this.mul(u5, v3), e); - const x = this.mul(this.mul(u3, v), p); - const c = this.mul(v, this.sqr(x)); - - if (c.eq(u)) - return x; - - throw new SquareRootError(x); - } - - divsqrt5mod8(u, v) { - // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p - const e = this.m.subn(5).iushrn(3); - const v3 = this.mul(this.sqr(v), v); - const v7 = this.mul(this.sqr(v3), v); - const p = this.pow(this.mul(u, v7), e); - const x = this.mul(this.mul(u, v3), p); - const c = this.mul(v, this.sqr(x)); - - if (c.eq(u)) - return x; - - const mc = this.ineg(c); - - if (mc.eq(u)) - return this.mul(x, this.sm1); - - if (mc.eq(this.mul(u, this.sm1))) - throw new SquareRootError(this.mul(x, this.sm1)); - - throw new SquareRootError(x); - } - - isSquare(a) { - if (this.m.isOdd()) - return this.jacobi(a) >= 0; - - return this.kronecker(a) >= 0; - } - - ishl(a, num) { - this._verify1(a); - return this.imod(a.iushl(num)); - } - - shl(a, num) { - return this.ishl(a.clone(), num); - } - - ishln(a, num) { - this._verify1(a); - - a.iushln(num); - - if (num <= 4) { - // Quick reduction. - while (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - } else { - this.imod(a); - } - - return a; - } - - shln(a, num) { - return this.ishln(a.clone(), num); - } - - ineg(a) { - this._verify1(a); - - if (!a.isZero()) - a._isub(this.m, a); - - return a; - } - - neg(a) { - return this.ineg(a.clone()); - } - - eq(a, b) { - this._verify2(a, b); - return a.ucmp(b) === 0; - } - - eqn(a, num) { - this._verify1(a); - - if (this.m.length === 1) { - num %= this.m.words[0]; - - if (num < 0) - num += this.m.words[0]; - - return a.ucmpn(num) === 0; - } - - if (num < 0) { - this.m._isubn(-num); - - const cmp = a.ucmp(this.m); - - this.m._iaddn(-num); - - return cmp === 0; - } - - return a.ucmpn(num) === 0; - } - - isHigh(a) { - return !this.isLow(a); - } - - isLow(a) { - this._verify1(a); - return a.ucmp(this.m.ushrn(1)) <= 0; - } - - isOdd(a) { - this._verify1(a); - return a.isOdd(); - } - - isEven(a) { - this._verify1(a); - return a.isEven(); - } - - legendre(num) { - this._verify1(num); - - if (this.m.isEven()) - throw new Error('legendre: `num` must be odd.'); - - // Euler's criterion. - const e = this.m.subn(1).iushrn(1); // (p - 1) / 2 - const symbol = this.pow(num, e); - - if (symbol.isZero()) - return 0; - - const one = new BN(1).toRed(this); - - if (symbol.eq(one)) - return 1; - - if (symbol.eq(this.ineg(one))) - return -1; - - throw new Error('Invalid prime.'); - } - - jacobi(a) { - this._verify1(a); - return a.jacobi(this.m); - } - - kronecker(a) { - this._verify1(a); - return a.kronecker(this.m); - } - - iinvert(a) { - return this.invert(a)._move(a); - } - - invert(a) { - this._verify1(a); - return a.invert(this.m)._forceRed(this); - } - - ifermat(a) { - return this.fermat(a)._move(a); - } - - fermat(a) { - this._verify1(a); - - if (a.isZero() || this.m.cmpn(1) === 0) - throw new RangeError('Not invertible.'); - - // Optimized inversion chain. - if (this.prime) - return this.prime.fermat(a); - - // Invert using fermat's little theorem. - return this.pow(a, this.m.subn(2)); - } - - invertAll(elems) { - // Montgomery's trick. - enforce(Array.isArray(elems), 'elems', 'array'); - - for (const elem of elems) { - enforce(BN.isBN(elem), 'elem', 'bignum'); - - this._verify1(elem); - } - - if (this.m.cmpn(1) === 0 || this.m.isEven()) - throw new RangeError('Not invertible.'); - - const len = elems.length; - const invs = new Array(len); - - if (len === 0) - return invs; - - let acc = new BN(1).toRed(this); - - for (let i = 0; i < len; i++) { - if (elems[i].isZero()) { - invs[i] = elems[i].clone(); - continue; - } - - invs[i] = acc; - acc = this.mul(acc, elems[i]); - } - - acc = this.invert(acc); - - for (let i = len - 1; i >= 0; i--) { - if (elems[i].isZero()) - continue; - - invs[i] = this.mul(acc, invs[i]); - acc = this.mul(acc, elems[i]); - } - - return invs; - } - - [custom]() { - if (this.prime) - return ``; - - return ``; - } - } - - /** - * Barrett Engine - */ - - class Barrett extends Red { - constructor(m) { - super(m); - - this.prime = null; - this.n = this.m.bitLength(); - - if ((this.n % 26) !== 0) - this.n += 26 - (this.n % 26); - - this.k = this.n * 2; - this.w = this.k / 26; - this.b = BN.shift(1, this.k).div(this.m); - } - - convertTo(num) { - if (num.length > this.w) - return super.convertTo(num); - - return this.imod(num.clone()); - } - - _shift(q) { - let i = 0; - let j = this.w; - - while (j < q.length) - q.words[i++] = q.words[j++]; - - if (i === 0) - q.words[i++] = 0; - - q.length = i; - } - - imod(a) { - const neg = a.negative; - - assert(a.length <= this.w); - - a.negative = 0; - - const q = a.mul(this.b); - - // Shift right by `k` bits. - this._shift(q); - - a._isub(a, q.mul(this.m)); - - if (a.ucmp(this.m) >= 0) - a._isub(a, this.m); - - if (neg && !a.isZero()) - a._isub(this.m, a); - - a.red = this; - - return a; - } - } - - /** - * Montgomery Engine - */ - - class Mont extends Red { - constructor(m) { - super(m); - - // Note that: - // - // mi = (-m^-1 mod (2^(n * 2))) mod r - // - // and: - // - // mi = (((2^n)^-1 mod m) * r^-1 - 1) / m - // - // are equivalent. - this.prime = null; - this.n = this.m.length * 26; - this.r = BN.shift(1, this.n); - this.r2 = BN.shift(1, this.n * 2).imod(this.m); - this.ri = this.r.invert(this.m); - this.mi = this.r.mul(this.ri).isubn(1).div(this.m); - this.rib = null; - } - - get mont() { - return true; - } - - convertTo(num) { - if (num.isNeg() || num.ucmp(this.m) >= 0) - return this.imod(num.ushln(this.n)); - - // Equivalent to: (num * 2^n) mod m - return this.mul(num, this.r2); - } - - convertFrom(num) { - // Equivalent to: num * r^-1 mod m - const r = this.mul(num, new BN(1)); - r.red = null; - return r; - } - - intTo(a) { - return (a << BigInt(this.n)) % this.mb; - } - - intFrom(a) { - if (this.rib === null) - this.rib = this.ri.toBigInt(); - - return (a * this.rib) % this.mb; - } - - iaddn(a, num) { - return this.iadd(a, this.convertTo(new BN(num))); - } - - isubn(a, num) { - return this.isub(a, this.convertTo(new BN(num))); - } - - imul(a, b) { - return this.mul(a, b)._move(a); - } - - mul(a, b) { - if (a.isZero() || b.isZero()) - return new BN(0)._forceRed(this); - - const t = a.mul(b); - const c = t.umaskn(this.n).mul(this.mi).iumaskn(this.n); - const u = t.iadd(c.mul(this.m)).iushrn(this.n); - - if (u.ucmp(this.m) >= 0) - u._isub(u, this.m); - - return u._forceRed(this); - } - - imuln(a, num) { - this._verify1(a); - - if (a.isZero()) - return a; - - if (num === 0) { - a.words[0] = 0; - a.length = 1; - return a; - } - - const neg = num < 0; - - if (neg) - num = -num; - - if (this.m.length === 1) - num %= this.m.words[0]; - - const bits = countBits(num); - - // Potentially compute with additions. - // This avoids an expensive division. - if (bits > 5) { - // Slow case (num > 31). - this.imul(a, this.convertTo(new BN(num))); - } else if ((num & (num - 1)) === 0) { - // Optimize for powers of two. - for (let i = 0; i < bits - 1; i++) - this.iadd(a, a); - } else { - // Multiply left to right. - const c = a.clone(); - - for (let i = bits - 2; i >= 0; i--) { - this.iadd(a, a); - - if ((num >> i) & 1) - this.iadd(a, c); - } - } - - if (neg) - this.ineg(a); - - return a; - } - - eqn(a, num) { - this._verify1(a); - - if (num === 0) - return a.isZero(); - - return a.ucmp(this.convertTo(new BN(num))) === 0; - } - - isLow(a) { - this._verify1(a); - return this.convertFrom(a).ucmp(this.m.ushrn(1)) <= 0; - } - - isOdd(a) { - this._verify1(a); - return this.convertFrom(a).isOdd(); - } - - isEven(a) { - this._verify1(a); - return this.convertFrom(a).isEven(); - } - - invert(a) { - this._verify1(a); - - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - return this.imod(a.invert(this.m).mul(this.r2)); - } - } - - /* - * Helpers - */ - - function makeError(Error, msg, start) { - const err = new Error(msg); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, start); - - return err; - } - - function assert(value, message) { - if (!value) { - const msg = message || 'Assertion failed.'; - throw makeError(Error, msg, assert); - } - } - - function enforce(value, name, type) { - if (!value) { - const msg = `"${name}" must be a(n) ${type}.`; - throw makeError(TypeError, msg, enforce); - } - } - - function range(value, name) { - if (!value) { - const msg = `"${name}" only works with positive numbers.`; - throw makeError(RangeError, msg, range); - } - } - - function red(value, name) { - if (!value) { - const msg = `"${name}" only works with red numbers.`; - throw makeError(TypeError, msg, red); - } - } - - function nonred(value, name) { - if (!value) { - const msg = `"${name}" only works with normal numbers.`; - throw makeError(TypeError, msg, nonred); - } - } - - function nonzero(value) { - if (!value) { - const msg = 'Cannot divide by zero.'; - throw makeError(RangeError, msg, nonzero); - } - } - - class SquareRootError extends Error { - constructor(result) { - super(); - - this.name = 'SquareRootError'; - this.message = 'X is not a square mod P.'; - this.result = result.fromRed(); - - if (Error.captureStackTrace) - Error.captureStackTrace(this, SquareRootError); - } - } - - function isInteger(num) { - return Number.isSafeInteger(num); - } - - function isSMI(num) { - return isInteger(num) - && num >= -67108863 - && num <= 0x3ffffff; - } - - function allocate(ArrayType, size) { - if (ArrayType.allocUnsafeSlow) - return ArrayType.allocUnsafeSlow(size); - - return new ArrayType(size); - } - - function getBase(base) { - if (base == null) - return 10; - - if (typeof base === 'number') - return base; - - switch (base) { - case 'bin': - return 2; - case 'oct': - return 8; - case 'dec': - return 10; - case 'hex': - return 16; - } - - return 0; - } - - /* - * Internal - */ - - function countBits(w) { - if (Math.clz32) - return 32 - Math.clz32(w); - - let t = w; - let r = 0; - - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - - return r + t; - } - - function zeroBits(w) { - // Shortcut. - if (w === 0) - return 26; - - let t = w; - let r = 0; - - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - - if ((t & 0x1) === 0) - r += 1; - - return r; - } - - function parseHex(str, start, end) { - const len = Math.min(str.length, end); - - let r = 0; - let z = 0; - - for (let i = start; i < len; i++) { - const c = str.charCodeAt(i) - 48; - - r <<= 4; - - let b; - - if (c >= 49 && c <= 54) { - // 'a' - 'f' - b = c - 49 + 0xa; - } else if (c >= 17 && c <= 22) { - // 'A' - 'F' - b = c - 17 + 0xa; - } else { - // '0' - '9' - b = c; - } - - r |= b; - z |= b; - } - - if (z & -16) - throw new Error('Invalid string.'); - - return r; - } - - function parseBase(str, start, end, mul) { - const len = Math.min(str.length, end); - - let r = 0; - - for (let i = start; i < len; i++) { - const c = str.charCodeAt(i) - 48; - - r *= mul; - - let b; - - if (c >= 49) { - // 'a' - b = c - 49 + 0xa; - } else if (c >= 17) { - // 'A' - b = c - 17 + 0xa; - } else { - // '0' - '9' - b = c; - } - - if (c < 0 || c > 207 || b >= mul) - throw new Error('Invalid string.'); - - r += b; - } - - return r; - } - - /* - * Exponentiation (bigint) - */ - - function powInt(x, e, m) { - // Sliding window (odd multiples only). - const one = BigInt(1); - const wnd = new Array(WND_SIZE); - const x2 = (x * x) % m; - - wnd[0] = x; - - for (let i = 1; i < WND_SIZE; i++) - wnd[i] = (wnd[i - 1] * x2) % m; - - let i = e.bitLength(); - let r = one; - - while (i >= WND_WIDTH) { - let width = WND_WIDTH; - let bits = e.bits(i - width, width); - - if (bits < WND_SIZE) { - r = (r * r) % m; - i -= 1; - continue; - } - - while ((bits & 1) === 0) { - width -= 1; - bits >>= 1; - } - - if (r === one) { - r = wnd[bits >> 1]; - } else { - r = sqrn(r, width, m); - r = (r * wnd[bits >> 1]) % m; - } - - i -= width; - } - - if (i > 0) { - const bits = e.bits(0, i); - - while (i--) { - r = (r * r) % m; - - if ((bits >> i) & 1) - r = (r * x) % m; - } - } - - return r; - } - - function sqrn(x, n, m) { - for (let i = 0; i < n; i++) - x = (x * x) % m; - return x; - } - - /* - * Multiplication - */ - - function smallMulTo(self, num, out) { - const len = self.length + num.length; - - out.negative = self.negative ^ num.negative; - out._alloc(len); - out.length = len; - - // Peel one iteration (compiler can't - // do it, because of code complexity). - const a = self.words[0]; - const b = num.words[0]; - const r = a * b; - const lo = r & 0x3ffffff; - - let carry = (r / 0x4000000) | 0; - let k = 1; - - out.words[0] = lo; - - for (; k < out.length - 1; k++) { - // Sum all words with the same - // `i + j = k` and accumulate - // `ncarry`, note that ncarry - // could be >= 0x3ffffff. - let ncarry = carry >>> 26; - let rword = carry & 0x3ffffff; - - const min = Math.max(0, k - self.length + 1); - const max = Math.min(k, num.length - 1); - - for (let j = min; j <= max; j++) { - const i = k - j; - const a = self.words[i]; - const b = num.words[j]; - const r = a * b + rword; - - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - - out.words[k] = rword | 0; - carry = ncarry | 0; - } - - if (carry !== 0) - out.words[k] = carry | 0; - else - out.length -= 1; - - return out._strip(); - } - - function bigMulTo(self, num, out) { - const len = self.length + num.length; - - out.negative = self.negative ^ num.negative; - out._alloc(len); - out.length = len; - - let carry = 0; - let hncarry = 0; - let k = 0; - - for (; k < out.length - 1; k++) { - // Sum all words with the same - // `i + j = k` and accumulate - // `ncarry`, note that ncarry - // could be >= 0x3ffffff. - let ncarry = hncarry; - - hncarry = 0; - - let rword = carry & 0x3ffffff; - - const min = Math.max(0, k - self.length + 1); - const max = Math.min(k, num.length - 1); - - for (let j = min; j <= max; j++) { - const i = k - j; - const a = self.words[i]; - const b = num.words[j]; - const r = a * b; - - let lo = r & 0x3ffffff; - - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - - if (carry !== 0) - out.words[k] = carry; - else - out.length -= 1; - - return out._strip(); - } - - function jumboMulTo(x, y, out) { - // v8 has a 2147483519 bit max (~256mb). - if (!HAS_BIGINT || x.length + y.length > 82595519) - return bigMulTo(x, y, out); - - const zero = BigInt(0); - const mask = BigInt(0x3ffffff); - const shift = BigInt(26); - - let z = x.toBigInt() * y.toBigInt(); - - const neg = (z < zero) | 0; - - if (neg) - z = -z; - - let i = 0; - - while (z > zero) { - out.words[i++] = Number(z & mask); - z >>= shift; - } - - if (i === 0) - out.words[i++] = 0; - - out.length = i; - out.negative = neg; - - return out; - } - - function comb10MulTo(self, num, out) { - const a = self.words; - const b = num.words; - const o = out.words; - const a0 = a[0] | 0; - const al0 = a0 & 0x1fff; - const ah0 = a0 >>> 13; - const a1 = a[1] | 0; - const al1 = a1 & 0x1fff; - const ah1 = a1 >>> 13; - const a2 = a[2] | 0; - const al2 = a2 & 0x1fff; - const ah2 = a2 >>> 13; - const a3 = a[3] | 0; - const al3 = a3 & 0x1fff; - const ah3 = a3 >>> 13; - const a4 = a[4] | 0; - const al4 = a4 & 0x1fff; - const ah4 = a4 >>> 13; - const a5 = a[5] | 0; - const al5 = a5 & 0x1fff; - const ah5 = a5 >>> 13; - const a6 = a[6] | 0; - const al6 = a6 & 0x1fff; - const ah6 = a6 >>> 13; - const a7 = a[7] | 0; - const al7 = a7 & 0x1fff; - const ah7 = a7 >>> 13; - const a8 = a[8] | 0; - const al8 = a8 & 0x1fff; - const ah8 = a8 >>> 13; - const a9 = a[9] | 0; - const al9 = a9 & 0x1fff; - const ah9 = a9 >>> 13; - const b0 = b[0] | 0; - const bl0 = b0 & 0x1fff; - const bh0 = b0 >>> 13; - const b1 = b[1] | 0; - const bl1 = b1 & 0x1fff; - const bh1 = b1 >>> 13; - const b2 = b[2] | 0; - const bl2 = b2 & 0x1fff; - const bh2 = b2 >>> 13; - const b3 = b[3] | 0; - const bl3 = b3 & 0x1fff; - const bh3 = b3 >>> 13; - const b4 = b[4] | 0; - const bl4 = b4 & 0x1fff; - const bh4 = b4 >>> 13; - const b5 = b[5] | 0; - const bl5 = b5 & 0x1fff; - const bh5 = b5 >>> 13; - const b6 = b[6] | 0; - const bl6 = b6 & 0x1fff; - const bh6 = b6 >>> 13; - const b7 = b[7] | 0; - const bl7 = b7 & 0x1fff; - const bh7 = b7 >>> 13; - const b8 = b[8] | 0; - const bl8 = b8 & 0x1fff; - const bh8 = b8 >>> 13; - const b9 = b[9] | 0; - const bl9 = b9 & 0x1fff; - const bh9 = b9 >>> 13; - - let c = 0; - let lo, mid, hi; - - out.negative = self.negative ^ num.negative; - out._alloc(20); - out.length = 19; - - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid = (mid + Math.imul(ah0, bl0)) | 0; - hi = Math.imul(ah0, bh0); - - let w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; - w0 &= 0x3ffffff; - - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid = (mid + Math.imul(ah1, bl0)) | 0; - hi = Math.imul(ah1, bh0); - lo = (lo + Math.imul(al0, bl1)) | 0; - mid = (mid + Math.imul(al0, bh1)) | 0; - mid = (mid + Math.imul(ah0, bl1)) | 0; - hi = (hi + Math.imul(ah0, bh1)) | 0; - - let w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; - w1 &= 0x3ffffff; - - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid = (mid + Math.imul(ah2, bl0)) | 0; - hi = Math.imul(ah2, bh0); - lo = (lo + Math.imul(al1, bl1)) | 0; - mid = (mid + Math.imul(al1, bh1)) | 0; - mid = (mid + Math.imul(ah1, bl1)) | 0; - hi = (hi + Math.imul(ah1, bh1)) | 0; - lo = (lo + Math.imul(al0, bl2)) | 0; - mid = (mid + Math.imul(al0, bh2)) | 0; - mid = (mid + Math.imul(ah0, bl2)) | 0; - hi = (hi + Math.imul(ah0, bh2)) | 0; - - let w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; - w2 &= 0x3ffffff; - - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid = (mid + Math.imul(ah3, bl0)) | 0; - hi = Math.imul(ah3, bh0); - lo = (lo + Math.imul(al2, bl1)) | 0; - mid = (mid + Math.imul(al2, bh1)) | 0; - mid = (mid + Math.imul(ah2, bl1)) | 0; - hi = (hi + Math.imul(ah2, bh1)) | 0; - lo = (lo + Math.imul(al1, bl2)) | 0; - mid = (mid + Math.imul(al1, bh2)) | 0; - mid = (mid + Math.imul(ah1, bl2)) | 0; - hi = (hi + Math.imul(ah1, bh2)) | 0; - lo = (lo + Math.imul(al0, bl3)) | 0; - mid = (mid + Math.imul(al0, bh3)) | 0; - mid = (mid + Math.imul(ah0, bl3)) | 0; - hi = (hi + Math.imul(ah0, bh3)) | 0; - - let w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; - w3 &= 0x3ffffff; - - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid = (mid + Math.imul(ah4, bl0)) | 0; - hi = Math.imul(ah4, bh0); - lo = (lo + Math.imul(al3, bl1)) | 0; - mid = (mid + Math.imul(al3, bh1)) | 0; - mid = (mid + Math.imul(ah3, bl1)) | 0; - hi = (hi + Math.imul(ah3, bh1)) | 0; - lo = (lo + Math.imul(al2, bl2)) | 0; - mid = (mid + Math.imul(al2, bh2)) | 0; - mid = (mid + Math.imul(ah2, bl2)) | 0; - hi = (hi + Math.imul(ah2, bh2)) | 0; - lo = (lo + Math.imul(al1, bl3)) | 0; - mid = (mid + Math.imul(al1, bh3)) | 0; - mid = (mid + Math.imul(ah1, bl3)) | 0; - hi = (hi + Math.imul(ah1, bh3)) | 0; - lo = (lo + Math.imul(al0, bl4)) | 0; - mid = (mid + Math.imul(al0, bh4)) | 0; - mid = (mid + Math.imul(ah0, bl4)) | 0; - hi = (hi + Math.imul(ah0, bh4)) | 0; - - let w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; - w4 &= 0x3ffffff; - - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid = (mid + Math.imul(ah5, bl0)) | 0; - hi = Math.imul(ah5, bh0); - lo = (lo + Math.imul(al4, bl1)) | 0; - mid = (mid + Math.imul(al4, bh1)) | 0; - mid = (mid + Math.imul(ah4, bl1)) | 0; - hi = (hi + Math.imul(ah4, bh1)) | 0; - lo = (lo + Math.imul(al3, bl2)) | 0; - mid = (mid + Math.imul(al3, bh2)) | 0; - mid = (mid + Math.imul(ah3, bl2)) | 0; - hi = (hi + Math.imul(ah3, bh2)) | 0; - lo = (lo + Math.imul(al2, bl3)) | 0; - mid = (mid + Math.imul(al2, bh3)) | 0; - mid = (mid + Math.imul(ah2, bl3)) | 0; - hi = (hi + Math.imul(ah2, bh3)) | 0; - lo = (lo + Math.imul(al1, bl4)) | 0; - mid = (mid + Math.imul(al1, bh4)) | 0; - mid = (mid + Math.imul(ah1, bl4)) | 0; - hi = (hi + Math.imul(ah1, bh4)) | 0; - lo = (lo + Math.imul(al0, bl5)) | 0; - mid = (mid + Math.imul(al0, bh5)) | 0; - mid = (mid + Math.imul(ah0, bl5)) | 0; - hi = (hi + Math.imul(ah0, bh5)) | 0; - - let w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; - w5 &= 0x3ffffff; - - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid = (mid + Math.imul(ah6, bl0)) | 0; - hi = Math.imul(ah6, bh0); - lo = (lo + Math.imul(al5, bl1)) | 0; - mid = (mid + Math.imul(al5, bh1)) | 0; - mid = (mid + Math.imul(ah5, bl1)) | 0; - hi = (hi + Math.imul(ah5, bh1)) | 0; - lo = (lo + Math.imul(al4, bl2)) | 0; - mid = (mid + Math.imul(al4, bh2)) | 0; - mid = (mid + Math.imul(ah4, bl2)) | 0; - hi = (hi + Math.imul(ah4, bh2)) | 0; - lo = (lo + Math.imul(al3, bl3)) | 0; - mid = (mid + Math.imul(al3, bh3)) | 0; - mid = (mid + Math.imul(ah3, bl3)) | 0; - hi = (hi + Math.imul(ah3, bh3)) | 0; - lo = (lo + Math.imul(al2, bl4)) | 0; - mid = (mid + Math.imul(al2, bh4)) | 0; - mid = (mid + Math.imul(ah2, bl4)) | 0; - hi = (hi + Math.imul(ah2, bh4)) | 0; - lo = (lo + Math.imul(al1, bl5)) | 0; - mid = (mid + Math.imul(al1, bh5)) | 0; - mid = (mid + Math.imul(ah1, bl5)) | 0; - hi = (hi + Math.imul(ah1, bh5)) | 0; - lo = (lo + Math.imul(al0, bl6)) | 0; - mid = (mid + Math.imul(al0, bh6)) | 0; - mid = (mid + Math.imul(ah0, bl6)) | 0; - hi = (hi + Math.imul(ah0, bh6)) | 0; - - let w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; - w6 &= 0x3ffffff; - - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid = (mid + Math.imul(ah7, bl0)) | 0; - hi = Math.imul(ah7, bh0); - lo = (lo + Math.imul(al6, bl1)) | 0; - mid = (mid + Math.imul(al6, bh1)) | 0; - mid = (mid + Math.imul(ah6, bl1)) | 0; - hi = (hi + Math.imul(ah6, bh1)) | 0; - lo = (lo + Math.imul(al5, bl2)) | 0; - mid = (mid + Math.imul(al5, bh2)) | 0; - mid = (mid + Math.imul(ah5, bl2)) | 0; - hi = (hi + Math.imul(ah5, bh2)) | 0; - lo = (lo + Math.imul(al4, bl3)) | 0; - mid = (mid + Math.imul(al4, bh3)) | 0; - mid = (mid + Math.imul(ah4, bl3)) | 0; - hi = (hi + Math.imul(ah4, bh3)) | 0; - lo = (lo + Math.imul(al3, bl4)) | 0; - mid = (mid + Math.imul(al3, bh4)) | 0; - mid = (mid + Math.imul(ah3, bl4)) | 0; - hi = (hi + Math.imul(ah3, bh4)) | 0; - lo = (lo + Math.imul(al2, bl5)) | 0; - mid = (mid + Math.imul(al2, bh5)) | 0; - mid = (mid + Math.imul(ah2, bl5)) | 0; - hi = (hi + Math.imul(ah2, bh5)) | 0; - lo = (lo + Math.imul(al1, bl6)) | 0; - mid = (mid + Math.imul(al1, bh6)) | 0; - mid = (mid + Math.imul(ah1, bl6)) | 0; - hi = (hi + Math.imul(ah1, bh6)) | 0; - lo = (lo + Math.imul(al0, bl7)) | 0; - mid = (mid + Math.imul(al0, bh7)) | 0; - mid = (mid + Math.imul(ah0, bl7)) | 0; - hi = (hi + Math.imul(ah0, bh7)) | 0; - - let w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; - w7 &= 0x3ffffff; - - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid = (mid + Math.imul(ah8, bl0)) | 0; - hi = Math.imul(ah8, bh0); - lo = (lo + Math.imul(al7, bl1)) | 0; - mid = (mid + Math.imul(al7, bh1)) | 0; - mid = (mid + Math.imul(ah7, bl1)) | 0; - hi = (hi + Math.imul(ah7, bh1)) | 0; - lo = (lo + Math.imul(al6, bl2)) | 0; - mid = (mid + Math.imul(al6, bh2)) | 0; - mid = (mid + Math.imul(ah6, bl2)) | 0; - hi = (hi + Math.imul(ah6, bh2)) | 0; - lo = (lo + Math.imul(al5, bl3)) | 0; - mid = (mid + Math.imul(al5, bh3)) | 0; - mid = (mid + Math.imul(ah5, bl3)) | 0; - hi = (hi + Math.imul(ah5, bh3)) | 0; - lo = (lo + Math.imul(al4, bl4)) | 0; - mid = (mid + Math.imul(al4, bh4)) | 0; - mid = (mid + Math.imul(ah4, bl4)) | 0; - hi = (hi + Math.imul(ah4, bh4)) | 0; - lo = (lo + Math.imul(al3, bl5)) | 0; - mid = (mid + Math.imul(al3, bh5)) | 0; - mid = (mid + Math.imul(ah3, bl5)) | 0; - hi = (hi + Math.imul(ah3, bh5)) | 0; - lo = (lo + Math.imul(al2, bl6)) | 0; - mid = (mid + Math.imul(al2, bh6)) | 0; - mid = (mid + Math.imul(ah2, bl6)) | 0; - hi = (hi + Math.imul(ah2, bh6)) | 0; - lo = (lo + Math.imul(al1, bl7)) | 0; - mid = (mid + Math.imul(al1, bh7)) | 0; - mid = (mid + Math.imul(ah1, bl7)) | 0; - hi = (hi + Math.imul(ah1, bh7)) | 0; - lo = (lo + Math.imul(al0, bl8)) | 0; - mid = (mid + Math.imul(al0, bh8)) | 0; - mid = (mid + Math.imul(ah0, bl8)) | 0; - hi = (hi + Math.imul(ah0, bh8)) | 0; - - let w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; - w8 &= 0x3ffffff; - - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid = (mid + Math.imul(ah9, bl0)) | 0; - hi = Math.imul(ah9, bh0); - lo = (lo + Math.imul(al8, bl1)) | 0; - mid = (mid + Math.imul(al8, bh1)) | 0; - mid = (mid + Math.imul(ah8, bl1)) | 0; - hi = (hi + Math.imul(ah8, bh1)) | 0; - lo = (lo + Math.imul(al7, bl2)) | 0; - mid = (mid + Math.imul(al7, bh2)) | 0; - mid = (mid + Math.imul(ah7, bl2)) | 0; - hi = (hi + Math.imul(ah7, bh2)) | 0; - lo = (lo + Math.imul(al6, bl3)) | 0; - mid = (mid + Math.imul(al6, bh3)) | 0; - mid = (mid + Math.imul(ah6, bl3)) | 0; - hi = (hi + Math.imul(ah6, bh3)) | 0; - lo = (lo + Math.imul(al5, bl4)) | 0; - mid = (mid + Math.imul(al5, bh4)) | 0; - mid = (mid + Math.imul(ah5, bl4)) | 0; - hi = (hi + Math.imul(ah5, bh4)) | 0; - lo = (lo + Math.imul(al4, bl5)) | 0; - mid = (mid + Math.imul(al4, bh5)) | 0; - mid = (mid + Math.imul(ah4, bl5)) | 0; - hi = (hi + Math.imul(ah4, bh5)) | 0; - lo = (lo + Math.imul(al3, bl6)) | 0; - mid = (mid + Math.imul(al3, bh6)) | 0; - mid = (mid + Math.imul(ah3, bl6)) | 0; - hi = (hi + Math.imul(ah3, bh6)) | 0; - lo = (lo + Math.imul(al2, bl7)) | 0; - mid = (mid + Math.imul(al2, bh7)) | 0; - mid = (mid + Math.imul(ah2, bl7)) | 0; - hi = (hi + Math.imul(ah2, bh7)) | 0; - lo = (lo + Math.imul(al1, bl8)) | 0; - mid = (mid + Math.imul(al1, bh8)) | 0; - mid = (mid + Math.imul(ah1, bl8)) | 0; - hi = (hi + Math.imul(ah1, bh8)) | 0; - lo = (lo + Math.imul(al0, bl9)) | 0; - mid = (mid + Math.imul(al0, bh9)) | 0; - mid = (mid + Math.imul(ah0, bl9)) | 0; - hi = (hi + Math.imul(ah0, bh9)) | 0; - - let w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; - w9 &= 0x3ffffff; - - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid = (mid + Math.imul(ah9, bl1)) | 0; - hi = Math.imul(ah9, bh1); - lo = (lo + Math.imul(al8, bl2)) | 0; - mid = (mid + Math.imul(al8, bh2)) | 0; - mid = (mid + Math.imul(ah8, bl2)) | 0; - hi = (hi + Math.imul(ah8, bh2)) | 0; - lo = (lo + Math.imul(al7, bl3)) | 0; - mid = (mid + Math.imul(al7, bh3)) | 0; - mid = (mid + Math.imul(ah7, bl3)) | 0; - hi = (hi + Math.imul(ah7, bh3)) | 0; - lo = (lo + Math.imul(al6, bl4)) | 0; - mid = (mid + Math.imul(al6, bh4)) | 0; - mid = (mid + Math.imul(ah6, bl4)) | 0; - hi = (hi + Math.imul(ah6, bh4)) | 0; - lo = (lo + Math.imul(al5, bl5)) | 0; - mid = (mid + Math.imul(al5, bh5)) | 0; - mid = (mid + Math.imul(ah5, bl5)) | 0; - hi = (hi + Math.imul(ah5, bh5)) | 0; - lo = (lo + Math.imul(al4, bl6)) | 0; - mid = (mid + Math.imul(al4, bh6)) | 0; - mid = (mid + Math.imul(ah4, bl6)) | 0; - hi = (hi + Math.imul(ah4, bh6)) | 0; - lo = (lo + Math.imul(al3, bl7)) | 0; - mid = (mid + Math.imul(al3, bh7)) | 0; - mid = (mid + Math.imul(ah3, bl7)) | 0; - hi = (hi + Math.imul(ah3, bh7)) | 0; - lo = (lo + Math.imul(al2, bl8)) | 0; - mid = (mid + Math.imul(al2, bh8)) | 0; - mid = (mid + Math.imul(ah2, bl8)) | 0; - hi = (hi + Math.imul(ah2, bh8)) | 0; - lo = (lo + Math.imul(al1, bl9)) | 0; - mid = (mid + Math.imul(al1, bh9)) | 0; - mid = (mid + Math.imul(ah1, bl9)) | 0; - hi = (hi + Math.imul(ah1, bh9)) | 0; - - let w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; - w10 &= 0x3ffffff; - - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid = (mid + Math.imul(ah9, bl2)) | 0; - hi = Math.imul(ah9, bh2); - lo = (lo + Math.imul(al8, bl3)) | 0; - mid = (mid + Math.imul(al8, bh3)) | 0; - mid = (mid + Math.imul(ah8, bl3)) | 0; - hi = (hi + Math.imul(ah8, bh3)) | 0; - lo = (lo + Math.imul(al7, bl4)) | 0; - mid = (mid + Math.imul(al7, bh4)) | 0; - mid = (mid + Math.imul(ah7, bl4)) | 0; - hi = (hi + Math.imul(ah7, bh4)) | 0; - lo = (lo + Math.imul(al6, bl5)) | 0; - mid = (mid + Math.imul(al6, bh5)) | 0; - mid = (mid + Math.imul(ah6, bl5)) | 0; - hi = (hi + Math.imul(ah6, bh5)) | 0; - lo = (lo + Math.imul(al5, bl6)) | 0; - mid = (mid + Math.imul(al5, bh6)) | 0; - mid = (mid + Math.imul(ah5, bl6)) | 0; - hi = (hi + Math.imul(ah5, bh6)) | 0; - lo = (lo + Math.imul(al4, bl7)) | 0; - mid = (mid + Math.imul(al4, bh7)) | 0; - mid = (mid + Math.imul(ah4, bl7)) | 0; - hi = (hi + Math.imul(ah4, bh7)) | 0; - lo = (lo + Math.imul(al3, bl8)) | 0; - mid = (mid + Math.imul(al3, bh8)) | 0; - mid = (mid + Math.imul(ah3, bl8)) | 0; - hi = (hi + Math.imul(ah3, bh8)) | 0; - lo = (lo + Math.imul(al2, bl9)) | 0; - mid = (mid + Math.imul(al2, bh9)) | 0; - mid = (mid + Math.imul(ah2, bl9)) | 0; - hi = (hi + Math.imul(ah2, bh9)) | 0; - - let w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; - w11 &= 0x3ffffff; - - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid = (mid + Math.imul(ah9, bl3)) | 0; - hi = Math.imul(ah9, bh3); - lo = (lo + Math.imul(al8, bl4)) | 0; - mid = (mid + Math.imul(al8, bh4)) | 0; - mid = (mid + Math.imul(ah8, bl4)) | 0; - hi = (hi + Math.imul(ah8, bh4)) | 0; - lo = (lo + Math.imul(al7, bl5)) | 0; - mid = (mid + Math.imul(al7, bh5)) | 0; - mid = (mid + Math.imul(ah7, bl5)) | 0; - hi = (hi + Math.imul(ah7, bh5)) | 0; - lo = (lo + Math.imul(al6, bl6)) | 0; - mid = (mid + Math.imul(al6, bh6)) | 0; - mid = (mid + Math.imul(ah6, bl6)) | 0; - hi = (hi + Math.imul(ah6, bh6)) | 0; - lo = (lo + Math.imul(al5, bl7)) | 0; - mid = (mid + Math.imul(al5, bh7)) | 0; - mid = (mid + Math.imul(ah5, bl7)) | 0; - hi = (hi + Math.imul(ah5, bh7)) | 0; - lo = (lo + Math.imul(al4, bl8)) | 0; - mid = (mid + Math.imul(al4, bh8)) | 0; - mid = (mid + Math.imul(ah4, bl8)) | 0; - hi = (hi + Math.imul(ah4, bh8)) | 0; - lo = (lo + Math.imul(al3, bl9)) | 0; - mid = (mid + Math.imul(al3, bh9)) | 0; - mid = (mid + Math.imul(ah3, bl9)) | 0; - hi = (hi + Math.imul(ah3, bh9)) | 0; - - let w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; - w12 &= 0x3ffffff; - - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid = (mid + Math.imul(ah9, bl4)) | 0; - hi = Math.imul(ah9, bh4); - lo = (lo + Math.imul(al8, bl5)) | 0; - mid = (mid + Math.imul(al8, bh5)) | 0; - mid = (mid + Math.imul(ah8, bl5)) | 0; - hi = (hi + Math.imul(ah8, bh5)) | 0; - lo = (lo + Math.imul(al7, bl6)) | 0; - mid = (mid + Math.imul(al7, bh6)) | 0; - mid = (mid + Math.imul(ah7, bl6)) | 0; - hi = (hi + Math.imul(ah7, bh6)) | 0; - lo = (lo + Math.imul(al6, bl7)) | 0; - mid = (mid + Math.imul(al6, bh7)) | 0; - mid = (mid + Math.imul(ah6, bl7)) | 0; - hi = (hi + Math.imul(ah6, bh7)) | 0; - lo = (lo + Math.imul(al5, bl8)) | 0; - mid = (mid + Math.imul(al5, bh8)) | 0; - mid = (mid + Math.imul(ah5, bl8)) | 0; - hi = (hi + Math.imul(ah5, bh8)) | 0; - lo = (lo + Math.imul(al4, bl9)) | 0; - mid = (mid + Math.imul(al4, bh9)) | 0; - mid = (mid + Math.imul(ah4, bl9)) | 0; - hi = (hi + Math.imul(ah4, bh9)) | 0; - - let w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; - w13 &= 0x3ffffff; - - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid = (mid + Math.imul(ah9, bl5)) | 0; - hi = Math.imul(ah9, bh5); - lo = (lo + Math.imul(al8, bl6)) | 0; - mid = (mid + Math.imul(al8, bh6)) | 0; - mid = (mid + Math.imul(ah8, bl6)) | 0; - hi = (hi + Math.imul(ah8, bh6)) | 0; - lo = (lo + Math.imul(al7, bl7)) | 0; - mid = (mid + Math.imul(al7, bh7)) | 0; - mid = (mid + Math.imul(ah7, bl7)) | 0; - hi = (hi + Math.imul(ah7, bh7)) | 0; - lo = (lo + Math.imul(al6, bl8)) | 0; - mid = (mid + Math.imul(al6, bh8)) | 0; - mid = (mid + Math.imul(ah6, bl8)) | 0; - hi = (hi + Math.imul(ah6, bh8)) | 0; - lo = (lo + Math.imul(al5, bl9)) | 0; - mid = (mid + Math.imul(al5, bh9)) | 0; - mid = (mid + Math.imul(ah5, bl9)) | 0; - hi = (hi + Math.imul(ah5, bh9)) | 0; - - let w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; - w14 &= 0x3ffffff; - - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid = (mid + Math.imul(ah9, bl6)) | 0; - hi = Math.imul(ah9, bh6); - lo = (lo + Math.imul(al8, bl7)) | 0; - mid = (mid + Math.imul(al8, bh7)) | 0; - mid = (mid + Math.imul(ah8, bl7)) | 0; - hi = (hi + Math.imul(ah8, bh7)) | 0; - lo = (lo + Math.imul(al7, bl8)) | 0; - mid = (mid + Math.imul(al7, bh8)) | 0; - mid = (mid + Math.imul(ah7, bl8)) | 0; - hi = (hi + Math.imul(ah7, bh8)) | 0; - lo = (lo + Math.imul(al6, bl9)) | 0; - mid = (mid + Math.imul(al6, bh9)) | 0; - mid = (mid + Math.imul(ah6, bl9)) | 0; - hi = (hi + Math.imul(ah6, bh9)) | 0; - - let w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; - w15 &= 0x3ffffff; - - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid = (mid + Math.imul(ah9, bl7)) | 0; - hi = Math.imul(ah9, bh7); - lo = (lo + Math.imul(al8, bl8)) | 0; - mid = (mid + Math.imul(al8, bh8)) | 0; - mid = (mid + Math.imul(ah8, bl8)) | 0; - hi = (hi + Math.imul(ah8, bh8)) | 0; - lo = (lo + Math.imul(al7, bl9)) | 0; - mid = (mid + Math.imul(al7, bh9)) | 0; - mid = (mid + Math.imul(ah7, bl9)) | 0; - hi = (hi + Math.imul(ah7, bh9)) | 0; - - let w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; - w16 &= 0x3ffffff; - - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid = (mid + Math.imul(ah9, bl8)) | 0; - hi = Math.imul(ah9, bh8); - lo = (lo + Math.imul(al8, bl9)) | 0; - mid = (mid + Math.imul(al8, bh9)) | 0; - mid = (mid + Math.imul(ah8, bl9)) | 0; - hi = (hi + Math.imul(ah8, bh9)) | 0; - - let w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; - w17 &= 0x3ffffff; - - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid = (mid + Math.imul(ah9, bl9)) | 0; - hi = Math.imul(ah9, bh9); - - let w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; - c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; - w18 &= 0x3ffffff; - - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - - if (c !== 0) { - o[19] = c; - out.length += 1; - } - - // Note: we shouldn't need to strip here. - return out; - } - - // Polyfill comb. - if (!Math.imul) - comb10MulTo = smallMulTo; - - /* - * Expose - */ - - BN.Red = Red; - - bn = BN; - return bn; - } - - /*! - * bn.js - big numbers for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var bnBrowser; - var hasRequiredBnBrowser; - - function requireBnBrowser () { - if (hasRequiredBnBrowser) return bnBrowser; - hasRequiredBnBrowser = 1; - - bnBrowser = requireBn(); - return bnBrowser; - } - - var chacha20; - var hasRequiredChacha20; - - function requireChacha20 () { - if (hasRequiredChacha20) return chacha20; - hasRequiredChacha20 = 1; - - const assert = requireAssert(); - - /* - * Constants - */ - - const BIG_ENDIAN = new Int8Array(new Int16Array([1]).buffer)[0] === 0; - - /** - * ChaCha20 - */ - - class ChaCha20 { - /** - * Create a ChaCha20 context. - * @constructor - */ - - constructor() { - this.state = new Uint32Array(16); - this.stream = new Uint32Array(16); - this.bytes = new Uint8Array(this.stream.buffer); - this.pos = -1; - - if (BIG_ENDIAN) - this.bytes = bufferExports.Buffer.alloc(64); - } - - /** - * Initialize chacha20 with a key, nonce, and counter. - * @param {Buffer} key - * @param {Buffer} nonce - * @param {Number} counter - */ - - init(key, nonce, counter) { - if (counter == null) - counter = 0; - - assert(bufferExports.Buffer.isBuffer(key)); - assert(bufferExports.Buffer.isBuffer(nonce)); - assert(Number.isSafeInteger(counter)); - - if (key.length !== 16 && key.length !== 32) - throw new RangeError('Invalid key size.'); - - if (nonce.length >= 24) { - key = ChaCha20.derive(key, nonce.slice(0, 16)); - nonce = nonce.slice(16); - } - - this.state[0] = 0x61707865; - this.state[1] = key.length < 32 ? 0x3120646e : 0x3320646e; - this.state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32; - this.state[3] = 0x6b206574; - this.state[4] = readU32(key, 0); - this.state[5] = readU32(key, 4); - this.state[6] = readU32(key, 8); - this.state[7] = readU32(key, 12); - this.state[8] = readU32(key, 16 % key.length); - this.state[9] = readU32(key, 20 % key.length); - this.state[10] = readU32(key, 24 % key.length); - this.state[11] = readU32(key, 28 % key.length); - this.state[12] = counter >>> 0; - - if (nonce.length === 8) { - this.state[13] = (counter / 0x100000000) >>> 0; - this.state[14] = readU32(nonce, 0); - this.state[15] = readU32(nonce, 4); - } else if (nonce.length === 12) { - this.state[13] = readU32(nonce, 0); - this.state[14] = readU32(nonce, 4); - this.state[15] = readU32(nonce, 8); - } else if (nonce.length === 16) { - this.state[12] = readU32(nonce, 0); - this.state[13] = readU32(nonce, 4); - this.state[14] = readU32(nonce, 8); - this.state[15] = readU32(nonce, 12); - } else { - throw new RangeError('Invalid nonce size.'); - } - - this.pos = 0; - - return this; - } - - /** - * Encrypt/decrypt data. - * @param {Buffer} data - Will be mutated. - * @returns {Buffer} - */ - - encrypt(data) { - assert(bufferExports.Buffer.isBuffer(data)); - - if (this.pos === -1) - throw new Error('Context is not initialized.'); - - for (let i = 0; i < data.length; i++) { - if ((this.pos & 63) === 0) { - this._block(); - this.pos = 0; - } - - data[i] ^= this.bytes[this.pos++]; - } - - return data; - } - - /** - * Stir the stream. - */ - - _block() { - for (let i = 0; i < 16; i++) - this.stream[i] = this.state[i]; - - for (let i = 0; i < 10; i++) { - qround(this.stream, 0, 4, 8, 12); - qround(this.stream, 1, 5, 9, 13); - qround(this.stream, 2, 6, 10, 14); - qround(this.stream, 3, 7, 11, 15); - qround(this.stream, 0, 5, 10, 15); - qround(this.stream, 1, 6, 11, 12); - qround(this.stream, 2, 7, 8, 13); - qround(this.stream, 3, 4, 9, 14); - } - - for (let i = 0; i < 16; i++) - this.stream[i] += this.state[i]; - - if (BIG_ENDIAN) { - for (let i = 0; i < 16; i++) - writeU32(this.bytes, this.stream[i], i * 4); - } - - this.state[12] += 1; - - if (this.state[12] === 0) - this.state[13] += 1; - } - - /** - * Destroy context. - */ - - destroy() { - for (let i = 0; i < 16; i++) { - this.state[i] = 0; - this.stream[i] = 0; - } - - if (BIG_ENDIAN) { - for (let i = 0; i < 64; i++) - this.bytes[i] = 0; - } - - this.pos = -1; - - return this; - } - - /** - * Derive key with XChaCha20. - * @param {Buffer} key - * @param {Buffer} nonce - * @returns {Buffer} - */ - - static derive(key, nonce) { - assert(bufferExports.Buffer.isBuffer(key)); - assert(bufferExports.Buffer.isBuffer(nonce)); - - if (key.length !== 16 && key.length !== 32) - throw new RangeError('Invalid key size.'); - - if (nonce.length !== 16) - throw new RangeError('Invalid nonce size.'); - - const state = new Uint32Array(16); - - state[0] = 0x61707865; - state[1] = key.length < 32 ? 0x3120646e : 0x3320646e; - state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32; - state[3] = 0x6b206574; - state[4] = readU32(key, 0); - state[5] = readU32(key, 4); - state[6] = readU32(key, 8); - state[7] = readU32(key, 12); - state[8] = readU32(key, 16 % key.length); - state[9] = readU32(key, 20 % key.length); - state[10] = readU32(key, 24 % key.length); - state[11] = readU32(key, 28 % key.length); - state[12] = readU32(nonce, 0); - state[13] = readU32(nonce, 4); - state[14] = readU32(nonce, 8); - state[15] = readU32(nonce, 12); - - for (let i = 0; i < 10; i++) { - qround(state, 0, 4, 8, 12); - qround(state, 1, 5, 9, 13); - qround(state, 2, 6, 10, 14); - qround(state, 3, 7, 11, 15); - qround(state, 0, 5, 10, 15); - qround(state, 1, 6, 11, 12); - qround(state, 2, 7, 8, 13); - qround(state, 3, 4, 9, 14); - } - - const out = bufferExports.Buffer.alloc(32); - - writeU32(out, state[0], 0); - writeU32(out, state[1], 4); - writeU32(out, state[2], 8); - writeU32(out, state[3], 12); - writeU32(out, state[12], 16); - writeU32(out, state[13], 20); - writeU32(out, state[14], 24); - writeU32(out, state[15], 28); - - return out; - } - } - - /* - * Static - */ - - ChaCha20.native = 0; - - /* - * Helpers - */ - - function qround(x, a, b, c, d) { - x[a] += x[b]; - x[d] = rotl32(x[d] ^ x[a], 16); - - x[c] += x[d]; - x[b] = rotl32(x[b] ^ x[c], 12); - - x[a] += x[b]; - x[d] = rotl32(x[d] ^ x[a], 8); - - x[c] += x[d]; - x[b] = rotl32(x[b] ^ x[c], 7); - } - - function rotl32(w, b) { - return (w << b) | (w >>> (32 - b)); - } - - function readU32(data, off) { - return (data[off++] - + data[off++] * 0x100 - + data[off++] * 0x10000 - + data[off] * 0x1000000); - } - - function writeU32(dst, num, off) { - dst[off++] = num; - num >>>= 8; - dst[off++] = num; - num >>>= 8; - dst[off++] = num; - num >>>= 8; - dst[off++] = num; - return off; - } - - /* - * Expose - */ - - chacha20 = ChaCha20; - return chacha20; - } - - /*! - * chacha20.js - chacha20 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var chacha20Browser; - var hasRequiredChacha20Browser; - - function requireChacha20Browser () { - if (hasRequiredChacha20Browser) return chacha20Browser; - hasRequiredChacha20Browser = 1; - - chacha20Browser = requireChacha20(); - return chacha20Browser; - } - - var hmac; - var hasRequiredHmac; - - function requireHmac () { - if (hasRequiredHmac) return hmac; - hasRequiredHmac = 1; - - const assert = requireAssert(); - - /** - * HMAC - */ - - class HMAC { - /** - * Create an HMAC. - * @param {Function} Hash - * @param {Number} size - * @param {Array} [x=[]] - * @param {Array} [y=[]] - */ - - constructor(Hash, size, x = [], y = []) { - assert(typeof Hash === 'function'); - assert((size >>> 0) === size); - assert(Array.isArray(x)); - assert(Array.isArray(y)); - - this.hash = Hash; - this.size = size; - this.x = x; - this.y = y; - - this.inner = new Hash(); - this.outer = new Hash(); - } - - /** - * Initialize HMAC context. - * @param {Buffer} data - */ - - init(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - // Shorten key - if (key.length > this.size) { - const Hash = this.hash; - const h = new Hash(); - - h.init(...this.x); - h.update(key); - - key = h.final(...this.y); - - assert(key.length <= this.size); - } - - // Pad key - const pad = bufferExports.Buffer.alloc(this.size); - - for (let i = 0; i < key.length; i++) - pad[i] = key[i] ^ 0x36; - - for (let i = key.length; i < pad.length; i++) - pad[i] = 0x36; - - this.inner.init(...this.x); - this.inner.update(pad); - - for (let i = 0; i < key.length; i++) - pad[i] = key[i] ^ 0x5c; - - for (let i = key.length; i < pad.length; i++) - pad[i] = 0x5c; - - this.outer.init(...this.x); - this.outer.update(pad); - - return this; - } - - /** - * Update HMAC context. - * @param {Buffer} data - */ - - update(data) { - this.inner.update(data); - return this; - } - - /** - * Finalize HMAC context. - * @returns {Buffer} - */ - - final() { - this.outer.update(this.inner.final(...this.y)); - return this.outer.final(...this.y); - } - } - - /* - * Expose - */ - - hmac = HMAC; - return hmac; - } - - var sha256$1; - var hasRequiredSha256; - - function requireSha256 () { - if (hasRequiredSha256) return sha256$1; - hasRequiredSha256 = 1; - - const assert = requireAssert(); - const HMAC = requireHmac(); - - /* - * Constants - */ - - const FINALIZED = -1; - const DESC = bufferExports.Buffer.alloc(8, 0x00); - const PADDING = bufferExports.Buffer.alloc(64, 0x00); - - PADDING[0] = 0x80; - - const K = new Uint32Array([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, - 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, - 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, - 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, - 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, - 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, - 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, - 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, - 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 - ]); - - /** - * SHA256 - */ - - class SHA256 { - constructor() { - this.state = new Uint32Array(8); - this.msg = new Uint32Array(64); - this.block = bufferExports.Buffer.alloc(64); - this.size = FINALIZED; - } - - init() { - this.state[0] = 0x6a09e667; - this.state[1] = 0xbb67ae85; - this.state[2] = 0x3c6ef372; - this.state[3] = 0xa54ff53a; - this.state[4] = 0x510e527f; - this.state[5] = 0x9b05688c; - this.state[6] = 0x1f83d9ab; - this.state[7] = 0x5be0cd19; - this.size = 0; - return this; - } - - update(data) { - assert(bufferExports.Buffer.isBuffer(data)); - this._update(data, data.length); - return this; - } - - final() { - return this._final(bufferExports.Buffer.alloc(32)); - } - - _update(data, len) { - assert(this.size !== FINALIZED, 'Context is not initialized.'); - - let pos = this.size & 63; - let off = 0; - - this.size += len; - - if (pos > 0) { - let want = 64 - pos; - - if (want > len) - want = len; - - data.copy(this.block, pos, off, off + want); - - pos += want; - len -= want; - off += want; - - if (pos < 64) - return; - - this._transform(this.block, 0); - } - - while (len >= 64) { - this._transform(data, off); - off += 64; - len -= 64; - } - - if (len > 0) - data.copy(this.block, 0, off, off + len); - } - - _final(out) { - assert(this.size !== FINALIZED, 'Context is not initialized.'); - - const pos = this.size & 63; - const len = this.size * 8; - - writeU32(DESC, (len * (1 / 0x100000000)) >>> 0, 0); - writeU32(DESC, len >>> 0, 4); - - this._update(PADDING, 1 + ((119 - pos) & 63)); - this._update(DESC, 8); - - for (let i = 0; i < 8; i++) { - writeU32(out, this.state[i], i * 4); - this.state[i] = 0; - } - - for (let i = 0; i < 64; i++) - this.msg[i] = 0; - - for (let i = 0; i < 64; i++) - this.block[i] = 0; - - this.size = FINALIZED; - - return out; - } - - _transform(chunk, pos) { - const W = this.msg; - - let a = this.state[0]; - let b = this.state[1]; - let c = this.state[2]; - let d = this.state[3]; - let e = this.state[4]; - let f = this.state[5]; - let g = this.state[6]; - let h = this.state[7]; - let i = 0; - - for (; i < 16; i++) - W[i] = readU32(chunk, pos + i * 4); - - for (; i < 64; i++) - W[i] = sigma1(W[i - 2]) + W[i - 7] + sigma0(W[i - 15]) + W[i - 16]; - - for (i = 0; i < 64; i++) { - const t1 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; - const t2 = Sigma0(a) + Maj(a, b, c); - - h = g; - g = f; - f = e; - - e = (d + t1) >>> 0; - - d = c; - c = b; - b = a; - - a = (t1 + t2) >>> 0; - } - - this.state[0] += a; - this.state[1] += b; - this.state[2] += c; - this.state[3] += d; - this.state[4] += e; - this.state[5] += f; - this.state[6] += g; - this.state[7] += h; - } - - static hash() { - return new SHA256(); - } - - static hmac() { - return new HMAC(SHA256, 64); - } - - static digest(data) { - return SHA256.ctx.init().update(data).final(); - } - - static root(left, right) { - assert(bufferExports.Buffer.isBuffer(left) && left.length === 32); - assert(bufferExports.Buffer.isBuffer(right) && right.length === 32); - return SHA256.ctx.init().update(left).update(right).final(); - } - - static multi(x, y, z) { - const {ctx} = SHA256; - - ctx.init(); - ctx.update(x); - ctx.update(y); - - if (z) - ctx.update(z); - - return ctx.final(); - } - - static mac(data, key) { - return SHA256.hmac().init(key).update(data).final(); - } - } - - /* - * Static - */ - - SHA256.native = 0; - SHA256.id = 'SHA256'; - SHA256.size = 32; - SHA256.bits = 256; - SHA256.blockSize = 64; - SHA256.zero = bufferExports.Buffer.alloc(32, 0x00); - SHA256.ctx = new SHA256(); - - /* - * Helpers - */ - - function Sigma0(x) { - return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10); - } - - function Sigma1(x) { - return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7); - } - - function sigma0(x) { - return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3); - } - - function sigma1(x) { - return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10); - } - - function Ch(x, y, z) { - return z ^ (x & (y ^ z)); - } - - function Maj(x, y, z) { - return (x & y) | (z & (x | y)); - } - - function readU32(data, off) { - return (data[off++] * 0x1000000 - + data[off++] * 0x10000 - + data[off++] * 0x100 - + data[off]); - } - - function writeU32(data, num, off) { - data[off++] = num >>> 24; - data[off++] = num >>> 16; - data[off++] = num >>> 8; - data[off++] = num; - return off; - } - - /* - * Expose - */ - - sha256$1 = SHA256; - return sha256$1; - } - - /*! - * sha256.js - sha256 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var sha256Browser; - var hasRequiredSha256Browser; - - function requireSha256Browser () { - if (hasRequiredSha256Browser) return sha256Browser; - hasRequiredSha256Browser = 1; - - sha256Browser = requireSha256(); - return sha256Browser; - } - - var batchRng; - var hasRequiredBatchRng; - - function requireBatchRng () { - if (hasRequiredBatchRng) return batchRng; - hasRequiredBatchRng = 1; - - const assert = requireAssert(); - const BN = requireBnBrowser(); - const ChaCha20 = requireChacha20Browser(); - const SHA256 = requireSha256Browser(); - - /** - * BatchRNG - */ - - class BatchRNG { - constructor(curve, encode = key => key) { - this.curve = curve; - this.encode = encode; - this.hash = new SHA256(); - this.chacha = new ChaCha20(); - this.key = bufferExports.Buffer.alloc(32, 0x00); - this.iv = bufferExports.Buffer.alloc(8, 0x00); - this.cache = [new BN(1), new BN(1)]; - } - - init(batch) { - assert(Array.isArray(batch)); - - this.hash.init(); - - for (const [msg, sig, key] of batch) { - this.hash.update(SHA256.digest(msg)); - this.hash.update(sig); - this.hash.update(this.encode(key)); - } - - this.key = this.hash.final(); - this.cache[0] = new BN(1); - this.cache[1] = new BN(1); - - return this; - } - - encrypt(counter) { - const size = this.curve.scalarSize * 2; - const data = bufferExports.Buffer.alloc(size, 0x00); - const left = data.slice(0, this.curve.scalarSize); - const right = data.slice(this.curve.scalarSize); - - this.chacha.init(this.key, this.iv, counter); - this.chacha.encrypt(data); - - return [ - this.curve.decodeScalar(left), - this.curve.decodeScalar(right) - ]; - } - - refresh(counter) { - let overflow = 0; - - for (;;) { - // First word is always zero. - this.iv[4] = overflow; - this.iv[5] = overflow >>> 8; - this.iv[6] = overflow >>> 16; - this.iv[7] = overflow >>> 24; - - overflow += 1; - - const [s1, s2] = this.encrypt(counter); - - if (s1.isZero() || s1.cmp(this.curve.n) >= 0) - continue; - - if (s2.isZero() || s2.cmp(this.curve.n) >= 0) - continue; - - this.cache[0] = s1; - this.cache[1] = s2; - - break; - } - } - - generate(index) { - assert((index >>> 0) === index); - - if (index & 1) - this.refresh(index >>> 1); - - return this.cache[index & 1]; - } - } - - /* - * Expose - */ - - batchRng = BatchRNG; - return batchRng; - } - - var elliptic = {}; - - var hasRequiredElliptic; - - function requireElliptic () { - if (hasRequiredElliptic) return elliptic; - hasRequiredElliptic = 1; - - const {custom} = requireCustomBrowser(); - const BN = requireBnBrowser(); - - /* - * Constants - */ - - const types = { - AFFINE: 0, - JACOBIAN: 1, - PROJECTIVE: 2, - EXTENDED: 3 - }; - - const jsfIndex = [ - -3, // -1 -1 - -1, // -1 0 - -5, // -1 1 - -7, // 0 -1 - 0, // 0 0 - 7, // 0 1 - 5, // 1 -1 - 1, // 1 0 - 3 // 1 1 - ]; - - let uid = 0; - - /** - * Curve - */ - - class Curve { - constructor(Point, type, conf) { - this.Point = null; - this.id = null; - this.uid = uid++; - this.ossl = null; - this.type = 'base'; - this.endian = 'be'; - this.hash = null; - this.prefix = null; - this.context = false; - this.prime = null; - this.p = null; - this.red = null; - this.fieldSize = 0; - this.fieldBits = 0; - this.adjustedSize = 0; - this.signBit = 0; - this.mask = 0; - this.n = null; - this.h = null; - this.q = null; - this.z = null; - this.g = null; - this.nh = null; - this.scalarSize = 0; - this.scalarBits = 0; - this.zero = null; - this.one = null; - this.two = null; - this.three = null; - this.four = null; - this.i2 = null; - this.i3 = null; - this.i4 = null; - this.i6 = null; - this.torsion = null; - this.endo = null; - this.hi = null; - this._init(Point, type, conf); - } - - _init(Point, type, conf) { - assert(typeof Point === 'function'); - assert(typeof type === 'string'); - assert(conf && typeof conf === 'object'); - assert(conf.red == null || (conf.red instanceof BN.Red)); - assert(conf.p != null, 'Must pass a prime.'); - assert(conf.id == null || typeof conf.id === 'string'); - assert(conf.ossl == null || typeof conf.ossl === 'string'); - assert(conf.endian == null || typeof conf.endian === 'string'); - assert(conf.hash == null || typeof conf.hash === 'string'); - assert(conf.prefix == null || typeof conf.prefix === 'string'); - assert(conf.context == null || typeof conf.context === 'boolean'); - assert(conf.prime == null || typeof conf.prime === 'string'); - assert(conf.torsion == null || Array.isArray(conf.torsion)); - - // Point class. - this.Point = Point; - - // Meta. - this.id = conf.id || null; - this.ossl = conf.ossl || null; - this.type = type; - this.endian = conf.endian || (type === 'short' ? 'be' : 'le'); - this.hash = conf.hash || null; - this.prefix = conf.prefix ? bufferExports.Buffer.from(conf.prefix, 'binary') : null; - this.context = conf.context || false; - this.prime = conf.prime || null; - - // Prime. - this.p = BN.fromJSON(conf.p); - - // Reduction. - if (conf.red) { - this.red = conf.red; - } else { - // Use Montgomery when there is no fast reduction for the prime. - this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p); - this.red.precompute(); - } - - // Precalculate encoding length. - this.fieldSize = this.p.byteLength(); - this.fieldBits = this.p.bitLength(); - this.adjustedSize = this.fieldSize + ((this.fieldBits & 7) === 0); - this.signBit = this.adjustedSize * 8 - 1; - this.mask = 0xff; - - if ((this.fieldBits & 7) !== 0) - this.mask = (1 << (this.fieldBits & 7)) - 1; - - // Curve configuration, optional. - this.n = BN.fromJSON(conf.n || '0'); - this.h = BN.fromJSON(conf.h || '1'); - this.q = this.n.mul(this.h); - this.z = BN.fromJSON(conf.z || '0').toRed(this.red); - this.g = null; - this.nh = this.n.ushrn(1); - this.scalarSize = this.n.byteLength(); - this.scalarBits = this.n.bitLength(); - - // Useful for many curves. - this.zero = new BN(0).toRed(this.red); - this.one = new BN(1).toRed(this.red); - this.two = new BN(2).toRed(this.red); - this.three = new BN(3).toRed(this.red); - this.four = new BN(4).toRed(this.red); - - // Inverses. - this.i2 = this.two.redInvert(); - this.i3 = this.three.redInvert(); - this.i4 = this.i2.redSqr(); - this.i6 = this.i2.redMul(this.i3); - - // Torsion. - this.torsion = new Array(this.h.word(0)); - - for (let i = 0; i < this.torsion.length; i++) - this.torsion[i] = this.point(); - - // Endomorphism. - this.endo = null; - - // Cache. - this.hi = null; - - // Memoize. - this._scale = memoize(this._scale, this); - this.isIsomorphic = memoize(this.isIsomorphic, this); - this.isIsogenous = memoize(this.isIsogenous, this); - - // Sanity checks. - assert(this.p.sign() > 0 && this.p.isOdd()); - assert(this.n.sign() >= 0); - assert(this.h.sign() > 0 && this.h.cmpn(255) <= 0); - assert(this.endian === 'be' || this.endian === 'le'); - - return this; - } - - _finalize(conf) { - assert(conf && typeof conf === 'object'); - - // Create base point. - this.g = conf.g ? this.pointFromJSON(conf.g) : this.point(); - - // Parse small order points. - if (conf.torsion) { - assert(conf.torsion.length === this.torsion.length); - - for (let i = 0; i < this.torsion.length; i++) - this.torsion[i] = this.pointFromJSON(conf.torsion[i]); - } - - return this; - } - - _findTorsion() { - // Find all torsion points by grinding. - assert(!this.n.isZero()); - - const h = this.h.word(0); - const x = this.one.redNeg(); - const out = [this.point()]; - const set = new Set(); - - let len = h; - - while (out.length < len) { - let p; - - x.redIAdd(this.one); - - try { - p = this.pointFromX(x.clone()); - } catch (e) { - continue; - } - - try { - p = p.mul(this.n); - } catch (e) { - len = 2; - continue; - } - - if (p.isInfinity()) - continue; - - p.normalize(); - - for (const point of [p, p.neg()]) { - const key = point.key(); - - if (!set.has(key)) { - out.push(point); - set.add(key); - } - } - } - - out.sort((a, b) => a.cmp(b)); - - while (out.length < h) - out.push(this.point()); - - return out; - } - - _fixedMul(p, k) { - // Fixed-base method for point multiplication. - // - // [ECPM] "Windowed method". - // [GECC] Page 95, Section 3.3. - // - // Windows are appropriately shifted to avoid any - // doublings. This reduces a 256 bit multiplication - // down to 64 additions with a window size of 4. - assert(p instanceof Point); - assert(k instanceof BN); - assert(p.pre && p.pre.windows); - - // Get precomputed windows. - const {width, points} = p._getWindows(0, 0); - - // Recompute window size. - const size = 1 << width; - - // Recompute steps. - const bits = k.bitLength(); - const steps = ((bits + width - 1) / width) >>> 0; - - // Multiply. - let acc = this.jpoint(); - - for (let i = 0; i < steps; i++) { - const bits = k.bits(i * width, width); - - acc = acc.add(points[i * size + bits]); - } - - // Adjust sign. - if (k.isNeg()) - acc = acc.neg(); - - return acc; - } - - _fixedNafMul(p, k) { - // Fixed-base NAF windowing method for point multiplication. - // - // [GECC] Algorithm 3.42, Page 105, Section 3.3. - assert(p instanceof Point); - assert(k instanceof BN); - assert(p.pre && p.pre.doubles); - - // Get precomputed doubles. - const {step, points} = p._getDoubles(0, 0); - - // Get fixed NAF (in a more windowed form). - const naf = getFixedNAF(k, 2, k.bitLength() + 1, step); - - // Compute steps. - const I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3; - - // Multiply. - let a = this.jpoint(); - let b = this.jpoint(); - - for (let i = I; i > 0; i--) { - for (let j = 0; j < naf.length; j++) { - const nafW = naf[j]; - - if (nafW === i) - b = b.add(points[j]); - else if (nafW === -i) - b = b.sub(points[j]); - } - - a = a.add(b); - } - - return a; - } - - _wnafMul(w, p, k) { - // Window NAF method for point multiplication. - // - // [GECC] Algorithm 3.36, Page 100, Section 3.3. - assert(p instanceof Point); - assert(k instanceof BN); - - // Precompute window. - const {width, points} = p._safeNAF(w); - - // Get NAF form. - const naf = getNAF(k, width, k.bitLength() + 1); - - // Add `this`*(N+1) for every w-NAF index. - let acc = this.jpoint(); - - for (let i = naf.length - 1; i >= 0; i--) { - const z = naf[i]; - - if (i !== naf.length - 1) - acc = acc.dbl(); - - if (z > 0) - acc = acc.add(points[(z - 1) >> 1]); - else if (z < 0) - acc = acc.sub(points[(-z - 1) >> 1]); - } - - return acc; - } - - _wnafMulAdd(w, points, coeffs) { - // Multiple point multiplication, also known - // as "Shamir's trick" (with interleaved NAFs). - // - // [GECC] Algorithm 3.48, Page 109, Section 3.3.3. - // Algorithm 3.51, Page 112, Section 3.3. - // - // This is particularly useful for signature - // verifications and mutiplications after an - // endomorphism split. - assert((w >>> 0) === w); - assert(Array.isArray(points)); - assert(Array.isArray(coeffs)); - assert(points.length === coeffs.length); - - const length = points.length; - const wnd = new Array(length); - const naf = new Array(length); - - // Check arrays and calculate size. - let max = 0; - - for (let i = 0; i < length; i++) { - const point = points[i]; - const coeff = coeffs[i]; - - assert(point instanceof Point); - assert(coeff instanceof BN); - - if (i > 0 && point.type !== points[i - 1].type) - throw new Error('Cannot mix points.'); - - // Avoid sparse arrays. - wnd[i] = null; - naf[i] = null; - - // Compute max scalar size. - max = Math.max(max, coeff.bitLength() + 1); - } - - // Compute NAFs. - let ppoint = null; - let pcoeff = null; - let len = 0; - - for (let i = 0; i < length; i++) { - const point = points[i]; - const coeff = coeffs[i]; - const pre = point._getNAF(0); - - // Use precomputation if available. - if (pre) { - wnd[len] = pre.points; - naf[len] = getNAF(coeff, pre.width, max); - len += 1; - continue; - } - - // Save last non-precomputed point. - if (!ppoint) { - ppoint = point; - pcoeff = coeff; - continue; - } - - // Compute JSF in NAF form. - wnd[len] = ppoint._getJNAF(point); - naf[len] = getJNAF(pcoeff, coeff, max); - - ppoint = null; - pcoeff = null; - - len += 1; - } - - // Regular NAF for odd points. - if (ppoint) { - const nafw = ppoint._safeNAF(w); - - wnd[len] = nafw.points; - naf[len] = getNAF(pcoeff, nafw.width, max); - - len += 1; - } - - // Multiply and add. - let acc = this.jpoint(); - - for (let i = max - 1; i >= 0; i--) { - if (i !== max - 1) - acc = acc.dbl(); - - for (let j = 0; j < len; j++) { - const z = naf[j][i]; - - if (z > 0) - acc = acc.add(wnd[j][(z - 1) >> 1]); - else if (z < 0) - acc = acc.sub(wnd[j][(-z - 1) >> 1]); - } - } - - return acc; - } - - _endoWnafMulAdd(points, coeffs) { - throw new Error('Not implemented.'); - } - - _scale(curve, invert) { - assert(curve instanceof Curve); - assert(curve.p.eq(this.p)); - - switch (curve.type) { - case 'short': - return this._scaleShort(curve, invert); - case 'mont': - return this._scaleMont(curve, invert); - case 'edwards': - return this._scaleEdwards(curve, invert); - default: - throw new Error('Not implemented.'); - } - } - - _scaleShort(curve, invert) { - throw new Error('Not implemented.'); - } - - _scaleMont(curve, invert) { - throw new Error('Not implemented.'); - } - - _scaleEdwards(curve, invert) { - throw new Error('Not implemented.'); - } - - isElliptic() { - throw new Error('Not implemented.'); - } - - jinv() { - throw new Error('Not implemented.'); - } - - isComplete() { - return false; - } - - precompute(rng) { - assert(!this.g.isInfinity(), 'Must have base point.'); - assert(!this.n.isZero(), 'Must have order.'); - - this.g.precompute(this.n.bitLength(), rng); - - return this; - } - - scalar(num, base, endian) { - const k = new BN(num, base, endian); - - assert(!k.red); - - if (this.n.isZero()) - return k; - - return k.imod(this.n); - } - - field(num, base, endian) { - const x = BN.cast(num, base, endian); - - if (x.red) - return x.forceRed(this.red); - - return x.toRed(this.red); - } - - point(x, y) { - throw new Error('Not implemented.'); - } - - jpoint(x, y, z) { - throw new Error('Not implemented.'); - } - - xpoint(x, z) { - throw new Error('Not implemented.'); - } - - cpoint(xx, xz, yy, yz) { - assert(xx instanceof BN); - assert(xz instanceof BN); - assert(yy instanceof BN); - assert(yz instanceof BN); - - if (xz.isZero() || yz.isZero()) - return this.point(); - - const z = xz.redMul(yz).redInvert(); - const x = xx.redMul(yz).redMul(z); - const y = yy.redMul(xz).redMul(z); - - return this.point(x, y); - } - - solveX2(y) { - throw new Error('Not implemented.'); - } - - solveX(y) { - return this.solveX2(y).redSqrt(); - } - - solveY2(x) { - throw new Error('Not implemented.'); - } - - solveY(x) { - return this.solveY2(x).redSqrt(); - } - - validate(point) { - throw new Error('Not implemented.'); - } - - pointFromX(x, sign) { - throw new Error('Not implemented.'); - } - - pointFromY(y, sign) { - throw new Error('Not implemented.'); - } - - isIsomorphic(curve) { - throw new Error('Not implemented.'); - } - - isIsogenous(curve) { - throw new Error('Not implemented.'); - } - - pointFromShort(point) { - throw new Error('Not implemented.'); - } - - pointFromMont(point, sign) { - throw new Error('Not implemented.'); - } - - pointFromEdwards(point) { - throw new Error('Not implemented.'); - } - - pointFromUniform(u) { - throw new Error('Not implemented.'); - } - - pointToUniform(p) { - throw new Error('Not implemented.'); - } - - pointFromHash(bytes, pake = false) { - // [H2EC] "Roadmap". - assert(bufferExports.Buffer.isBuffer(bytes)); - assert(typeof pake === 'boolean'); - - if (bytes.length !== this.fieldSize * 2) - throw new Error('Invalid hash size.'); - - // Random oracle encoding. - // Ensure a proper distribution. - const s1 = bytes.slice(0, this.fieldSize); - const s2 = bytes.slice(this.fieldSize); - const u1 = this.decodeUniform(s1); - const u2 = this.decodeUniform(s2); - const p1 = this.pointFromUniform(u1); - const p2 = this.pointFromUniform(u2); - const p3 = p1.add(p2); - - return pake ? p3.mulH() : p3; - } - - pointToHash(p, subgroup, rng) { - // [SQUARED] Algorithm 1, Page 8, Section 3.3. - assert(p instanceof this.Point); - assert((subgroup >>> 0) === subgroup); - - // Add a random torsion component. - const i = subgroup % this.torsion.length; - const p0 = p.add(this.torsion[i]); - - // Average Cost (R = sqrt): - // - // SSWU (~4 iterations) => 8I + 16R - // SVDW (~4 iterations) => 12I + 28R - // Elligator 1 (~2 iterations) => 6I + 10R - // Elligator 2 (~2 iterations) => 4I + 6R - // Ristretto (~1 iteration) => 1I + 2R + h*1R - for (;;) { - const u1 = this.randomField(rng); - const p1 = this.pointFromUniform(u1); - - // Avoid 2-torsion points: - // Short Weierstrass: ((A / 3) / B, 0) - // Montgomery: (0, 0) - // Twisted Edwards: (0, -1) - if (p1.neg().eq(p1)) - continue; - - const p2 = p0.sub(p1); - const hint = randomInt(rng); - - let u2; - try { - u2 = this.pointToUniform(p2, hint & 15); - } catch (e) { - if (e.message === 'Invalid point.') - continue; - throw e; - } - - const s1 = this.encodeUniform(u1, hint >>> 8); - const s2 = this.encodeUniform(u2, hint >>> 16); - - return bufferExports.Buffer.concat([s1, s2]); - } - } - - randomScalar(rng) { - const max = this.n.isZero() ? this.p : this.n; - return BN.random(rng, 1, max); - } - - randomField(rng) { - return BN.random(rng, 1, this.p).toRed(this.red); - } - - randomPoint(rng) { - let p; - - for (;;) { - const x = this.randomField(rng); - const sign = (randomInt(rng) & 1) !== 0; - - try { - p = this.pointFromX(x, sign); - } catch (e) { - continue; - } - - assert(p.validate()); - - return p.mulH(); - } - } - - mulAll(points, coeffs) { - return this.jmulAll(points, coeffs); - } - - jmulAll(points, coeffs) { - assert(Array.isArray(points)); - assert(points.length === 0 || (points[0] instanceof Point)); - - // Multiply with endomorphism if we're using affine points. - if (this.endo && points.length > 0 && points[0].type === types.AFFINE) - return this._endoWnafMulAdd(points, coeffs); - - // Otherwise, a regular Shamir's trick. - return this._wnafMulAdd(5, points, coeffs); - } - - mulH(k) { - assert(k instanceof BN); - return this.imulH(k.clone()); - } - - imulH(k) { - assert(k instanceof BN); - assert(!k.red); - - const word = this.h.word(0); - - // Optimize for powers of two. - if ((word & (word - 1)) === 0) { - const bits = this.h.bitLength(); - return k.iushln(bits - 1).imod(this.n); - } - - return k.imuln(word).imod(this.n); - } - - normalizeAll(points) { - assert(Array.isArray(points)); - - const len = points.length; - const z = new Array(len); - - for (let i = 0; i < len; i++) { - const p = points[i]; - - assert(p instanceof Point); - assert(p.curve === this); - - if (p.type === types.AFFINE) { - z[i] = this.one; - continue; - } - - z[i] = p.z; - } - - const zi = this.red.invertAll(z); - const out = new Array(len); - - for (let i = 0; i < len; i++) - out[i] = points[i].scale(zi[i]); - - return out; - } - - affinizeAll(points) { - return this.normalizeAll(points); - } - - clamp(scalar) { - // [RFC7748] Page 8, Section 5. - // [RFC8032] Section 5.1.5 & 5.2.5. - assert(bufferExports.Buffer.isBuffer(scalar)); - assert(scalar.length === this.scalarSize); - assert(this.scalarSize <= this.fieldSize); - - let top = (this.fieldBits & 7) || 8; - let lsb = 0; - let msb = this.scalarSize - 1; - - // Swap endianness. - if (this.endian === 'be') - [lsb, msb] = [msb, lsb]; - - // Adjust for low order. - if (this.scalarSize < this.fieldSize) - top = 8; - - // Ensure a multiple of the cofactor. - scalar[lsb] &= -this.h.word(0) & 0xff; - - // Clamp to the prime. - scalar[msb] &= (1 << top) - 1; - - // Set the high bit. - scalar[msb] |= 1 << (top - 1); - - return scalar; - } - - splitHash(bytes) { - // [RFC8032] Section 5.1.6 & 5.2.6. - assert(bufferExports.Buffer.isBuffer(bytes)); - assert(bytes.length === this.adjustedSize * 2); - assert(this.scalarSize <= this.adjustedSize); - - let off = 0; - - if (this.endian === 'be') - off = this.adjustedSize - this.scalarSize; - - const scalar = bytes.slice(off, off + this.scalarSize); - const prefix = bytes.slice(this.adjustedSize); - - this.clamp(scalar); - - return [scalar, prefix]; - } - - encodeField(x) { - // [SEC1] Page 12, Section 2.3.5. - assert(x instanceof BN); - assert(!x.red); - - return x.encode(this.endian, this.fieldSize); - } - - decodeField(bytes) { - // [SEC1] Page 13, Section 2.3.6. - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.fieldSize) - throw new Error('Invalid field element size.'); - - return BN.decode(bytes, this.endian); - } - - encodeAdjusted(x) { - assert(x instanceof BN); - assert(!x.red); - - return x.encode(this.endian, this.adjustedSize); - } - - decodeAdjusted(bytes) { - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.adjustedSize) - throw new Error('Invalid field element size.'); - - return BN.decode(bytes, this.endian); - } - - encodeScalar(k) { - // [SEC1] Page 13, Section 2.3.7. - assert(k instanceof BN); - assert(!k.red); - - return k.encode(this.endian, this.scalarSize); - } - - decodeScalar(bytes) { - // [SEC1] Page 14, Section 2.3.8. - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.scalarSize) - throw new Error('Invalid scalar size.'); - - return BN.decode(bytes, this.endian); - } - - encodeClamped(k) { - // [RFC7748] Page 8, Section 5. - // [RFC8032] Section 5.1.5 & 5.2.5. - return this.clamp(this.encodeScalar(k)); - } - - decodeClamped(bytes) { - // [RFC7748] Page 8, Section 5. - // [RFC8032] Section 5.1.5 & 5.2.5. - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.scalarSize) - throw new Error('Invalid scalar size.'); - - const clamped = this.clamp(bufferExports.Buffer.from(bytes)); - - return BN.decode(clamped, this.endian); - } - - encodeUniform(x, bits) { - assert(x instanceof BN); - assert((bits >>> 0) === bits); - - const msb = this.endian === 'le' ? this.fieldSize - 1 : 0; - const bytes = x.fromRed().encode(this.endian, this.fieldSize); - - bytes[msb] |= (bits & ~this.mask) & 0xff; - - return bytes; - } - - decodeUniform(bytes) { - assert(bufferExports.Buffer.isBuffer(bytes)); - - if (bytes.length !== this.fieldSize) - throw new Error('Invalid field size.'); - - const x = BN.decode(bytes, this.endian); - - x.iumaskn(this.fieldBits); - - return x.toRed(this.red); - } - - encodePoint(point, compact) { - assert(point instanceof Point); - return point.encode(compact); - } - - decodePoint(bytes) { - throw new Error('Not implemented.'); - } - - encodeX(point) { - throw new Error('Not implemented.'); - } - - decodeX(bytes) { - throw new Error('Not implemented.'); - } - - decodeEven(bytes) { - throw new Error('Not implemented.'); - } - - decodeSquare(bytes) { - throw new Error('Not implemented.'); - } - - toShort() { - throw new Error('Not implemented.'); - } - - toMont(b0) { - throw new Error('Not implemented.'); - } - - toEdwards(a0) { - throw new Error('Not implemented.'); - } - - pointToJSON(point, pre) { - assert(point instanceof Point); - return point.toJSON(pre); - } - - pointFromJSON(json) { - throw new Error('Not implemented.'); - } - - toJSON(pre) { - let prefix, context; - let n, z, endo; - - if (this.type === 'edwards') { - prefix = this.prefix ? this.prefix.toString() : null; - context = this.context; - } - - if (!this.n.isZero()) - n = this.n.toJSON(); - - if (!this.z.isZero()) { - z = this.z.fromRed(); - - if (this.z.redIsHigh()) - z.isub(this.p); - - z = z.toString(16); - } - - if (this.endo) - endo = this.endo.toJSON(); - - return { - id: this.id, - ossl: this.ossl, - type: this.type, - endian: this.endian, - hash: this.hash, - prefix, - context, - prime: this.prime, - p: this.p.toJSON(), - a: undefined, - b: undefined, - d: undefined, - n, - h: this.h.toString(16), - s: undefined, - z, - c: undefined, - g: this.g.toJSON(pre), - endo - }; - } - - static fromJSON(json) { - return new this(json); - } - } - - /** - * Point - */ - - class Point { - constructor(curve, type) { - assert(curve instanceof Curve); - assert((type >>> 0) === type); - - this.curve = curve; - this.type = type; - this.pre = null; - } - - _init() { - throw new Error('Not implemented.'); - } - - _safeNAF(width) { - assert((width >>> 0) === width); - - if (this.pre && this.pre.naf) - return this.pre.naf; - - if (width === 0) - return null; - - const size = 1 << (width - 2); - const points = new Array(size); - const p = this.toJ(); - const dbl = size === 1 ? null : p.dbl(); - - points[0] = p; - - for (let i = 1; i < size; i++) - points[i] = points[i - 1].add(dbl); - - return new NAF(width, points); - } - - _getNAF(width) { - assert((width >>> 0) === width); - - if (this.pre && this.pre.naf) - return this.pre.naf; - - if (width === 0) - return null; - - const odds = this._safeNAF(width).points; - const points = this.curve.affinizeAll(odds); - - return new NAF(width, points); - } - - _getWindows(width, bits) { - assert((width >>> 0) === width); - assert((bits >>> 0) === bits); - - if (this.pre && this.pre.windows) - return this.pre.windows; - - if (width === 0) - return null; - - const size = 1 << width; - const steps = ((bits + width - 1) / width) >>> 0; - const wnds = new Array(steps * size); - - let g = this.toJ(); - - for (let i = 0; i < steps; i++) { - wnds[i * size] = this.curve.jpoint(); - - for (let j = 1; j < size; j++) - wnds[i * size + j] = wnds[i * size + j - 1].add(g); - - g = g.dblp(width); - } - - const points = this.curve.affinizeAll(wnds); - - return new Windows(width, bits, points); - } - - _getDoubles(step, power) { - assert((step >>> 0) === step); - assert((power >>> 0) === power); - - if (this.pre && this.pre.doubles) - return this.pre.doubles; - - if (step === 0) - return null; - - const len = Math.ceil(power / step) + 1; - const dbls = new Array(len); - - let acc = this.toJ(); - let k = 0; - - dbls[k++] = acc; - - for (let i = 0; i < power; i += step) { - for (let j = 0; j < step; j++) - acc = acc.dbl(); - - dbls[k++] = acc; - } - - assert(k === len); - - const points = this.curve.affinizeAll(dbls); - - return new Doubles(step, points); - } - - _getBeta() { - return null; - } - - _getBlinding(rng) { - if (this.pre && this.pre.blinding) - return this.pre.blinding; - - if (!rng) - return null; - - if (this.curve.n.isZero()) - return null; - - // Pregenerate a random blinding value: - // - // blind = random integer in [1,n-1] - // unblind = G * blind - // - // We intend to subtract the blinding value - // from scalars before multiplication. We - // can add the unblinding point once the - // multiplication is complete. - const blind = this.curve.randomScalar(rng); - const unblind = this.mul(blind); - - return new Blinding(blind, unblind); - } - - _hasWindows(k) { - assert(k instanceof BN); - - if (!this.pre || !this.pre.windows) - return false; - - const {width, bits} = this.pre.windows; - const steps = ((bits + width - 1) / width) >>> 0; - - return k.bitLength() <= steps * width; - } - - _hasDoubles(k) { - assert(k instanceof BN); - - if (!this.pre || !this.pre.doubles) - return false; - - const {step, points} = this.pre.doubles; - const power = k.bitLength() + 1; - - return points.length >= Math.ceil(power / step) + 1; - } - - _getJNAF(point) { - assert(point instanceof Point); - assert(point.type === this.type); - - // Create comb for JSF. - return [ - this, // 1 - this.add(point), // 3 - this.sub(point), // 5 - point // 7 - ]; - } - - _blind(k, rng) { - // [SIDE1] Page 5, Section 4. - // [BLIND] Page 20, Section 7. - assert(k instanceof BN); - assert(!k.red); - - // Scalar splitting (requires precomputation). - // - // Blind a multiplication by first subtracting - // a blinding value from the scalar. Example: - // - // b = random integer in [1,n-1] - // B = P * b (precomputed) - // Q = P * (k - b) + B - // - // Note that Joye describes a different method - // (multiplier randomization) which computes: - // - // B = random point in E - // Q = (P + B) * k - B * k - // - // Our method is more similar to the "scalar - // splitting" technique described in the - // second source above. - // - // The blinding value and its corresponding - // point are randomly generated and computed - // on boot. As long as an attacker is not - // able to observe the boot, this should give - // a decent bit of protection against various - // channel attacks. - if (this.pre && this.pre.blinding) { - const {blind, unblind} = this.pre.blinding; - const t = k.sub(blind); - - return [this, t, unblind]; - } - - // Randomization is not possible without - // an RNG. Do a normal multiplication. - if (!rng) - return [this, k, null]; - - // If we have no precomputed blinding - // factor, there are two possibilities - // for randomization: - // - // 1. Randomize the multiplier by adding - // a random multiple of `n`. - // - // 2. Re-scale the point itself by a - // random factor. - // - // The first option can be accomplished - // with some like: - // - // a = random integer in [1,n-1] - // r = a * n - // Q = P * (k + r) - // - // The second is accomplished with: - // - // a = random element in F(p) - // R = (x * a^2, y * a^3, z * a) - // Q = R * k - // - // If we have precomputed doubles / naf - // points, we opt for the first method - // to avoid randomizing everything. - if (this.pre) { - if (this.curve.n.isZero()) - return [this, k, null]; - - const a = this.curve.randomScalar(rng); - const r = a.mul(this.curve.n); - const t = r.iadd(k); - - return [this, t, null]; - } - - // If there is no precomputation _at all_, - // we opt for the second method. - const p = this.randomize(rng); - - return [p, k, null]; - } - - clone() { - throw new Error('Not implemented.'); - } - - precompute(bits, rng) { - assert((bits >>> 0) === bits); - - if (!this.pre) - this.pre = new Precomp(); - - if (!this.pre.naf) - this.pre.naf = this._getNAF(9); - - if (!this.pre.doubles) - this.pre.doubles = this._getDoubles(4, bits + 1); - - if (!this.pre.beta) - this.pre.beta = this._getBeta(); - - if (!this.pre.blinding) - this.pre.blinding = this._getBlinding(rng); - - return this; - } - - validate() { - return this.curve.validate(this); - } - - normalize() { - return this; - } - - scale(a) { - throw new Error('Not implemented.'); - } - - randomize(rng) { - const z = this.curve.randomField(rng); - return this.scale(z); - } - - neg() { - throw new Error('Not implemented.'); - } - - add(point) { - throw new Error('Not implemented.'); - } - - sub(point) { - assert(point instanceof Point); - return this.add(point.neg()); - } - - dbl() { - throw new Error('Not implemented.'); - } - - dblp(pow) { - // Repeated doubling. This can - // be optimized by child classes. - assert((pow >>> 0) === pow); - - let r = this; - - for (let i = 0; i < pow; i++) - r = r.dbl(); - - return r; - } - - diffAddDbl(p, q) { - throw new Error('Not implemented.'); - } - - getX() { - throw new Error('Not implemented.'); - } - - getY() { - throw new Error('Not implemented.'); - } - - eq(point) { - throw new Error('Not implemented.'); - } - - cmp(point) { - throw new Error('Not implemented.'); - } - - isInfinity() { - throw new Error('Not implemented.'); - } - - isOrder2() { - throw new Error('Not implemented.'); - } - - isOdd() { - throw new Error('Not implemented.'); - } - - isEven() { - throw new Error('Not implemented.'); - } - - isSquare() { - throw new Error('Not implemented.'); - } - - eqX(x) { - throw new Error('Not implemented.'); - } - - eqR(x) { - throw new Error('Not implemented.'); - } - - isSmall() { - // Test whether the point is of small order. - if (this.isInfinity()) - return false; - - // P * h = O - return this.jmulH().isInfinity(); - } - - hasTorsion() { - // Test whether the point is in another subgroup. - if (this.isInfinity()) - return false; - - // P * n != O - return !this.jmul(this.curve.n).isInfinity(); - } - - order() { - // Calculate point order. - const {h, n} = this.curve; - - let p = this.toJ(); - let q = new BN(1); - - while (!p.isInfinity()) { - q.iaddn(1); - - if (q.cmp(h) > 0) { - q = n.clone(); - break; - } - - p = p.add(this); - } - - return q; - } - - mul(k) { - return this.jmul(k); - } - - muln(k) { - return this.jmuln(k); - } - - mulBlind(k, rng) { - return this.jmulBlind(k, rng); - } - - mulAdd(k1, p2, k2) { - return this.jmulAdd(k1, p2, k2); - } - - mulH() { - return this.jmulH(); - } - - div(k) { - return this.jdiv(k); - } - - divn(k) { - return this.jdivn(k); - } - - divH() { - return this.jdivH(); - } - - jmul(k) { - - if (this._hasDoubles(k)) - return this.curve._fixedNafMul(this, k); - - if (this.curve.endo && this.type === types.AFFINE) - return this.curve._endoWnafMulAdd([this], [k]); - - return this.curve._wnafMul(5, this, k); - } - - jmuln(k) { - assert((k | 0) === k); - return this.jmul(new BN(k)); - } - - jmulBlind(k, rng = null) { - const [p, t, unblind] = this._blind(k, rng); - const q = p.jmul(t); - - if (unblind) - return q.add(unblind); - - return q; - } - - jmulAdd(k1, p2, k2) { - if (this.curve.endo && this.type === types.AFFINE) - return this.curve._endoWnafMulAdd([this, p2], [k1, k2]); - - return this.curve._wnafMulAdd(5, [this, p2], [k1, k2]); - } - - jmulH() { - const word = this.curve.h.word(0); - - // Optimize for powers of two. - if ((word & (word - 1)) === 0) { - const bits = this.curve.h.bitLength(); - return this.toJ().dblp(bits - 1); - } - - return this.jmul(this.curve.h); - } - - jdiv(k) { - assert(k instanceof BN); - assert(!k.red); - - return this.jmul(k.invert(this.curve.n)); - } - - jdivn(k) { - assert(!this.curve.n.isZero()); - - if (this.curve.h.cmpn(k) === 0) - return this.jdivH(); - - return this.jdiv(new BN(k)); - } - - jdivH() { - if (this.curve.n.isZero()) - return this.toJ(); - - if (this.curve.h.cmpn(1) === 0) - return this.toJ(); - - if (this.curve.hi === null) - this.curve.hi = this.curve.h.invert(this.curve.n); - - return this.jmul(this.curve.hi); - } - - toP() { - return this.normalize(); - } - - toJ() { - return this; - } - - toX() { - return this; - } - - key() { - if (this.isInfinity()) - return `${this.curve.uid}:oo`; - - this.normalize(); - - const x = this.getX().toString(16); - const y = this.getY().toString(16); - - return `${this.curve.uid}:${x},${y}`; - } - - encode(compact) { - throw new Error('Not implemented.'); - } - - static decode(curve, bytes) { - throw new Error('Not implemented.'); - } - - encodeX() { - throw new Error('Not implemented.'); - } - - static decodeX(curve, bytes) { - throw new Error('Not implemented.'); - } - - static decodeEven(curve, bytes) { - throw new Error('Not implemented.'); - } - - static decodeSquare(curve, bytes) { - throw new Error('Not implemented.'); - } - - toJSON(pre) { - throw new Error('Not implemented.'); - } - - static fromJSON(curve, json) { - throw new Error('Not implemented.'); - } - - [custom]() { - return ''; - } - } - - /** - * ShortCurve - */ - - class ShortCurve extends Curve { - constructor(conf) { - super(ShortPoint, 'short', conf); - - this.a = BN.fromJSON(conf.a).toRed(this.red); - this.b = BN.fromJSON(conf.b).toRed(this.red); - this.c = BN.fromJSON(conf.c || '0').toRed(this.red); - this.ai = this.a.isZero() ? this.zero : this.a.redInvert(); - this.zi = this.z.isZero() ? this.zero : this.z.redInvert(); - - this.zeroA = this.a.isZero(); - this.threeA = this.a.eq(this.three.redNeg()); - this.redN = this.n.toRed(this.red); - this.pmodn = this.p.clone(); - this.highOrder = this.n.cmp(this.p) >= 0; - this.smallGap = false; - - this._finalize(conf); - } - - _finalize(conf) { - super._finalize(conf); - - // Precalculate endomorphism. - if (conf.endo != null) - this.endo = Endo.fromJSON(this, conf.endo); - else - this.endo = this._getEndomorphism(); - - if (!this.n.isZero()) { - this.pmodn = this.p.mod(this.n); - - // Check for Maxwell's trick (see eqR). - this.smallGap = this.p.div(this.n).cmpn(1) <= 0; - } - - return this; - } - - static _isomorphism(curveA, curveB, custom, odd) { - // Short Weierstrass Isomorphism. - // - // [GECC] Page 84, Section 3.1.5. - // [ARITH1] Page 274, Section 13.1.5. - // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves). - // - // Find `u` such that `a * u^4 = a'` and `b * u^6 = b'`. - // - // Transformation: - // - // u4 = a' / a - // u2 = +-sqrt(u4) - // u6 = u4 * u2 - // a' = a * u4 - // b' = b * u6 - // - // Where `u2` is any root that is square. - // - // If a = 0, we can do: - // - // a' = 0 - // b' = b' - // - // Where (b' / b)^(1 / 3) is square. - // - // If b = 0, we can do: - // - // a' = a' - // b' = 0 - // - // Where sqrt(a' / a) is square. - assert(curveA instanceof BN); - assert(curveB instanceof BN); - assert(custom instanceof BN); - assert(odd == null || typeof odd === 'boolean'); - assert(!curveA.isZero() || !curveB.isZero()); - - if (custom.isZero()) - throw new Error('Invalid coefficient.'); - - if (curveA.isZero()) { - const customB = custom; - const u6 = customB.redDiv(curveB); - // Todo: allow index flag. - const u2 = uncube(u6); - - // Already checked in uncube(). - assert(u2.redJacobi() === 1); - - return [curveA.clone(), customB.clone()]; - } - - if (curveB.isZero()) { - const customA = custom; - const u4 = customA.redDiv(curveA); - const u2 = u4.redSqrt(); - - // Todo: allow odd flag. - if (u2.redJacobi() !== 1) - u2.redINeg(); - - if (u2.redJacobi() !== 1) - throw new Error('Invalid `a` coefficient.'); - - return [customA.clone(), curveB.clone()]; - } - - const customA = custom; - const u4 = customA.redDiv(curveA); - const u2 = u4.redSqrt(); - - if (odd != null) { - if (u2.redIsOdd() !== odd) - u2.redINeg(); - } else { - if (u2.redJacobi() !== 1) - u2.redINeg(); - } - - if (u2.redJacobi() !== 1) - throw new Error('Invalid `a` coefficient.'); - - const u6 = u4.redMul(u2); - const a = curveA.redMul(u4); - const b = curveB.redMul(u6); - - assert(a.eq(customA)); - - return [a, b]; - } - - _short(a0, odd) { - return ShortCurve._isomorphism(this.a, this.b, a0, odd); - } - - _mont(b0, odd) { - // Short Weierstrass->Montgomery Equivalence. - // - // [ARITH1] Page 286, Section 13.2.3.c. - // [SAFE] "Ladders". - // - // Transformation: - // - // r = A / (3 * B) - // s = +-sqrt(3 * r^2 + a) - // A = 3 * r / s - // B = 1 / s - const [r, s] = this._findRS(odd); - const b = s.redInvert(); - const a = r.redMuln(3).redMul(b); - - if (b0 != null) - return MontCurve._isomorphism(a, b, b0); - - return [a, b]; - } - - _edwards(a0, odd) { - // Short Weierstrass->Twisted Edwards Equivalence. - // - // [TWISTEQ] Section 1. - // - // Transformation: - // - // r = (a' + d') / 6 - // s = +-sqrt(3 * r^2 + a) - // a' = 3 * r + 2 * s - // d' = 3 * r - 2 * s - const [r, s] = this._findRS(odd); - const r3 = r.redMuln(3); - const s2 = s.redMuln(2); - const a = r3.redAdd(s2); - const d = r3.redSub(s2); - - if (a0 != null) - return EdwardsCurve._isomorphism(a, d, a0); - - return [a, d]; - } - - _findRS(sign) { - // Find `r` and `s` for equivalence. - // - // [ARITH1] Page 286, Section 13.2.3.c. - // [SAFE] "Ladders". - // - // Computation: - // - // r = solve(r^3 + a * r + b == 0, r) - // s = +-sqrt(3 * r^2 + a) - // - // Computing `r` is non-trivial. We need - // to solve `r^3 + a * r + b = 0`, but we - // don't have a polynomial solver, so we - // loop over random points until we find - // one with 2-torsion. Multiplying by the - // subgroup order should yield a point of - // ((A / 3) / B, 0) which is a solution. - assert(sign == null || typeof sign === 'boolean'); - assert(this.h.word(0) >= 4); - assert(!this.n.isZero()); - - const x = this.one.redNeg(); - - let p; - - for (;;) { - x.redIAdd(this.one); - - try { - p = this.pointFromX(x.clone()); - } catch (e) { - continue; - } - - p = p.mul(this.n); - - if (p.isInfinity()) - continue; - - if (!p.y.isZero()) - continue; - - break; - } - - const r = p.x; - const r2 = r.redSqr(); - const s = r2.redMuln(3).redIAdd(this.a).redSqrt(); - - if (sign != null) { - if (s.redIsOdd() !== sign) - s.redINeg(); - } - - return [r, s]; - } - - _scale0(a, b) { - // We can extract the isomorphism factors with: - // - // u4 = a' / a - // u6 = b' / b - // u2 = +-sqrt(u4) - // u = +-sqrt(u2) - // u3 = u2 * u - // - // `u2` should be picked such that `u4 * u2 = u6`. - // - // If a = 0, we can do: - // - // u6 = b' / b - // u2 = u6^(1 / 3) - // u = +-sqrt(u2) - // u3 = u2 * u - // - // Where `u2` is any root that is square. - // - // If b = 0, we can do: - // - // u4 = a' / a - // u2 = +-sqrt(u4) - // u = +-sqrt(u2) - // u3 = u2 * u - // - // Where `u2` is any root that is square. - assert(this.a.isZero() === a.isZero()); - assert(this.b.isZero() === b.isZero()); - - if (this.a.isZero()) { - const u6 = this.b.redDiv(this.field(b)); - // Todo: figure out how to check index. - const u2 = uncube(u6); - const u = u2.redSqrt(); - const u3 = u2.redMul(u); - - assert(u3.redSqr().eq(u6)); - assert(!u.isZero()); - - return [u2, u3]; - } - - if (this.b.isZero()) { - const u4 = this.a.redDiv(this.field(a)); - const u2 = u4.redSqrt(); - - // Todo: figure out how to check oddness. - if (u2.redJacobi() !== 1) - u2.redINeg(); - - const u = u2.redSqrt(); - const u3 = u2.redMul(u); - - assert(u3.redMul(u).eq(u4)); - assert(!u.isZero()); - - return [u2, u3]; - } - - const u4 = this.a.redDiv(this.field(a)); - const u6 = this.b.redDiv(this.field(b)); - const u2 = u4.redSqrt(); - - if (!u4.redMul(u2).eq(u6)) - u2.redINeg(); - - assert(u4.redMul(u2).eq(u6)); - - const u = u2.redSqrt(); - const u3 = u2.redMul(u); - - assert(!u.isZero()); - - return [u2, u3]; - } - - _scale1(x, y) { - // If base points are available, it is much - // easier, with: - // - // u2 = x' / x - // u3 = y' / y - // u = +-sqrt(u2) - // - // `u` should be picked such that `u2 * u = u3`. - const u2 = this.g.x.redDiv(this.field(x)); - const u3 = this.g.y.redDiv(this.field(y)); - const u = u2.redSqrt(); - - if (!u2.redMul(u).eq(u3)) - u.redINeg(); - - assert(u2.redMul(u).eq(u3)); - assert(!u.isZero()); - - return [u2, u3]; - } - - _scaleShort(curve) { - assert(curve instanceof ShortCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) - return this._scale0(curve.a, curve.b); - - return this._scale1(curve.g.x, curve.g.y); - } - - _scaleMont(curve) { - assert(curve instanceof MontCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) { - const [a, b] = curve._short(); - return this._scale0(a, b); - } - - const {x, y} = curve.g; - const nx = x.redAdd(curve.a3).redMul(curve.bi); - const ny = y.redMul(curve.bi); - - return this._scale1(nx, ny); - } - - _scaleEdwards(curve) { - assert(curve instanceof EdwardsCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) { - const [a, b] = curve._short(); - return this._scale0(a, b); - } - - const {x, y, z} = curve.g; - const a5 = curve.a.redMuln(5); - const d5 = curve.d.redMuln(5); - const dma = curve.d.redSub(curve.a); - const d5a = d5.redSub(curve.a); - const da5 = curve.d.redSub(a5); - const ypz = y.redAdd(z); - const ymz = y.redSub(z); - const xx = d5a.redMul(y).redIAdd(da5.redMul(z)); - const xz = ymz.redMuln(12); - const yy = dma.redMul(ypz).redMul(z); - const yz = ymz.redMul(x).redIMuln(4); - const zi = xz.redMul(yz).redInvert(); - const nx = xx.redMul(yz).redMul(zi); - const ny = yy.redMul(xz).redMul(zi); - - return this._scale1(nx, ny); - } - - _getEndomorphism(index = 0) { - // Compute endomorphism. - // - // [GECC] Example 3.76, Page 128, Section 3.5. - - // No curve params. - if (this.n.isZero() || this.g.isInfinity()) - return null; - - // No efficient endomorphism. - if (!this.zeroA || this.p.modrn(3) !== 1 || this.n.modrn(3) !== 1) - return null; - - // Solve beta^3 mod p = 1. - const [b1, b2] = this._getEndoRoots(this.p); - - // Choose the smallest beta by default. - const beta = [b1, b2][index & 1].toRed(this.red); - - // Solve lambda^3 mod n = 1. - const [l1, l2] = this._getEndoRoots(this.n); - - // Choose the lambda matching selected beta. - // Note that P * lambda = (x * beta, y). - const p = this.point(this.g.x.redMul(beta), this.g.y); - - let lambda; - - if (this.g.mul(l1).eq(p)) { - lambda = l1; - } else { - assert(this.g.mul(l2).eq(p)); - lambda = l2; - } - - // Get basis vectors. - const basis = this._getEndoBasis(lambda); - - // Precompute `g1` and `g2`. - const pre = this._getEndoPrecomp(basis); - - return new Endo(beta, lambda, basis, pre); - } - - _getEndoRoots(num) { - // Find roots for x^2 + x + 1 in F. - // - // [GECC] Example 3.76, Page 128, Section 3.5. - // [GLV] Page 192, Section 2 (Endomorphisms). - // - // The above document doesn't fully explain how - // to derive these and only "hints" at it, as - // mentioned by Hal Finney[1], but we're basically - // computing two possible cube roots of 1 here. - // - // Note that we could also compute[2]: - // - // beta = 2^((p - 1) / 3) mod p - // lambda = 3^((n - 1) / 3) mod n - // - // As an extension of Fermat's little theorem: - // - // g^(p - 1) mod p == 1 - // - // It is suspected[3] this is how Hal Finney[4] - // computed his original endomorphism roots. - // - // @indutny's method for computing cube roots - // of unity[5] appears to be the method described - // on wikipedia[6][7]. - // - // Sage produces the same solution: - // - // sage: solve(x^2 + x + 1 == 0, x) - // [x == -1/2*I*sqrt(3) - 1/2, x == 1/2*I*sqrt(3) - 1/2] - // - // This can be reduced to: - // - // x = (+-sqrt(-3) - 1) / 2 - // - // [1] https://bitcointalk.org/index.php?topic=3238.msg45565#msg45565 - // [2] https://crypto.stackexchange.com/a/22739 - // [3] https://bitcoin.stackexchange.com/a/35872 - // [4] https://github.com/halfinney/bitcoin/commit/dc411b5 - // [5] https://en.wikipedia.org/wiki/Cube_root_of_unity - // [6] https://en.wikipedia.org/wiki/Splitting_field#Cubic_example - // [7] http://mathworld.wolfram.com/SplittingField.html - const red = num === this.p ? this.red : BN.mont(num); - const two = new BN(2).toRed(red); - const three = new BN(3).toRed(red); - const i2 = two.redInvert(); - - // S1 = sqrt(-3) / 2 - const s1 = three.redNeg().redSqrt().redMul(i2); - - // S2 = -S1 - const s2 = s1.redNeg(); - - // R1 = S1 - 1 / 2 - const r1 = s1.redSub(i2).fromRed(); - - // R2 = S2 - 1 / 2 - const r2 = s2.redSub(i2).fromRed(); - - return [r1, r2].sort(BN.cmp); - } - - _getEndoBasis(lambda) { - // Compute endomorphic basis. - // - // This essentially computes Cornacchia's algorithm - // for solving x^2 + d * y^2 = m (d = lambda, m = order). - // - // https://en.wikipedia.org/wiki/Cornacchia%27s_algorithm - // - // [GECC] Algorithm 3.74, Page 127, Section 3.5. - // [GLV] Page 196, Section 4 (Decomposing K). - // - // Balanced length-two representation of a multiplier. - // - // 1. Run the extended euclidean algorithm with inputs n - // and lambda. The algorithm produces a sequence of - // equations si*n + ti*lam = ri where s0=1, t0=0, - // r0=n, s1=0, t1=1, r1=lam, and the remainders ri - // and are non-negative and strictly decreasing. Let - // l be the greatest index for which rl >= sqrt(n). - const [rl, tl, rl1, tl1, rl2, tl2] = this._egcdSqrt(lambda); - - // 2. Set (a1, b1) <- (rl+1, -tl+1). - const a1 = rl1; - const b1 = tl1.neg(); - - // 3. If (rl^2 + tl^2) <= (rl+2^2 + tl+2^2) - // then set (a2, b2) <- (rl, -tl). - // else set (a2, b2) <- (rl+2, -tl+2). - const lhs = rl.sqr().iadd(tl.sqr()); - const rhs = rl2.sqr().iadd(tl2.sqr()); - - let a2, b2; - - if (lhs.cmp(rhs) <= 0) { - a2 = rl; - b2 = tl.neg(); - } else { - a2 = rl2; - b2 = tl2.neg(); - } - - return [ - new Vector(a1, b1), - new Vector(a2, b2) - ]; - } - - _egcdSqrt(lambda) { - // Extended Euclidean algorithm for integers. - // - // [GECC] Algorithm 2.19, Page 40, Section 2.2. - // [GLV] Page 196, Section 4 (Decomposing K). - assert(lambda instanceof BN); - assert(!lambda.red); - assert(lambda.sign() > 0); - assert(this.n.sign() > 0); - - // Note that we insert the approximate square - // root checks as described in algorithm 3.74. - // - // Algorithm 2.19 is defined as: - // - // 1. u <- a - // v <- b - // - // 2. x1 <- 1 - // y1 <- 0 - // x2 <- 0 - // y2 <- 1 - // - // 3. while u != 0 do - // - // 3.1. q <- floor(v / u) - // r <- v - q * u - // x <- x2 - q * x1 - // y <- y2 - q * y1 - // - // 3.2. v <- u - // u <- r - // x2 <- x1 - // x1 <- x - // y2 <- y1 - // y1 <- y - // - // 4. d <- v - // x <- x2 - // y <- y2 - // - // 5. Return (d, x, y). - - // Start with an approximate square root of n. - const sqrtn = this.n.ushrn(this.n.bitLength() >>> 1); - - let u = lambda; // r1 - let v = this.n.clone(); // r0 - let x1 = new BN(1); // t1 - let y1 = new BN(0); // t0 - let x2 = new BN(0); // s1 - let y2 = new BN(1); // s0 - - // All vectors are roots of: a + b * lambda = 0 (mod n). - let rl, tl; - - // First vector. - let rl1, tl1; - - // Inner. - let i = 0; - let j = 0; - let p; - - // Compute EGCD. - while (!u.isZero() && i < 2) { - const q = v.quo(u); - const r = v.sub(q.mul(u)); - const x = x2.sub(q.mul(x1)); - const y = y2.sub(q.mul(y1)); - - // Check for r < sqrt(n). - if (j === 0 && r.cmp(sqrtn) < 0) { - rl = p; - tl = x1; - rl1 = r; - tl1 = x; - j = 1; // 1 more round. - } - - p = r; - v = u; - u = r; - x2 = x1; - x1 = x; - y2 = y1; - y1 = y; - - i += j; - } - - // Should never happen. - assert(j !== 0, 'Could not find r < sqrt(n).'); - - // Second vector. - const rl2 = x2; - const tl2 = x1; - - return [ - rl, - tl, - rl1, - tl1, - rl2, - tl2 - ]; - } - - _getEndoPrecomp(basis) { - // Precompute `g1` and `g2` to avoid round division. - // - // [JCEN12] Page 5, Section 4.3. - // - // Computation: - // - // d = a1 * b2 - b1 * a2 - // t = ceil(log2(d+1)) + p - // g1 = round((2^t * b2) / d) - // g2 = round((2^t * b1) / d) - // - // Where: - // - // `p` is the number of precision bits. - // `d` is equal to `n` (the curve order). - // - // The paper above uses 2 as the value of `p`, - // whereas libsecp256k1 uses 128 (total=384). - // - // We pick precision for `g1` and `g2` such that: - // - // abs(g1) < n - // abs(g2) < n - // - // This ensures maximum precision for the constants - // while also ensuring they fit into a fixed number - // of scalar limbs in more optimized implementations. - // - // Furthermore, we attempt to align to a limb width - // of 64 bits. This allows us to optimize the shift, - // a la libsecp256k1[1]. - // - // [1] https://github.com/bitcoin-core/secp256k1/pull/822 - assert(Array.isArray(basis)); - assert(basis.length === 2); - assert(basis[0] instanceof Vector); - assert(basis[1] instanceof Vector); - - const [v1, v2] = basis; - const d = v1.a.mul(v2.b).isub(v1.b.mul(v2.a)); - const bits = d.bitLength(); - const align = bits >= 160; - - assert(d.eq(this.n)); - - // Start with a rough estimate. - let shift = bits + Math.ceil(bits / 2) + 1; - let g1, g2; - - if (align) - shift -= shift & 63; - - while (shift > bits) { - g1 = v2.b.ushln(shift).divRound(d); - g2 = v1.b.ushln(shift).divRound(d); - - if (g1.ucmp(d) < 0 && g2.ucmp(d) < 0) - break; - - if (align) - shift -= 64; - else - shift -= 1; - } - - if (shift <= bits) - throw new Error('Could not calculate g1 and g2.'); - - return [shift, g1, g2]; - } - - _endoSplit(k) { - // Balanced length-two representation of a multiplier. - // - // [GECC] Algorithm 3.74, Page 127, Section 3.5. - // - // Also note that it is possible to precompute[1] - // values in order to avoid the division[2][3][4]. - // - // This involves precomputing `g1` and `g2 (see - // above). `c1` and `c2` can then be computed as - // follows: - // - // t = ceil(log2(n+1)) + p - // c1 = (k * g1) >> t - // c2 = -((k * g2) >> t) - // - // Where `>>` is an _unsigned_ right shift. Also - // note that the last bit discarded in the shift - // must be stored. If it is 1, then add 1 to the - // scalar (absolute addition). - // - // It's worth noting that libsecp256k1 uses a - // different calculation along the lines of: - // - // t = ceil(log2(n+1)) + p - // c1 = ((k * g1) >> t) * -b1 - // c2 = ((k * -g2) >> t) * -b2 - // k2 = c1 + c2 - // k1 = k2 * -lambda + k - // - // So, in the future, we can consider changing - // step 4 to: - // - // 4. Compute c1 = (k * g1) >> t - // and c2 = -((k * g2) >> t). - // - // const [shift, g1, g2] = this.endo.pre; - // const c1 = k.mulShift(g1, shift); - // const c2 = k.mulShift(g2, shift).ineg(); - // - // Once we're brave enough, that is. - // - // [1] [JCEN12] Page 5, Section 4.3. - // [2] https://github.com/bitcoin-core/secp256k1/blob/0b70241/src/scalar_impl.h#L259 - // [3] https://github.com/bitcoin-core/secp256k1/pull/21 - // [4] https://github.com/bitcoin-core/secp256k1/pull/127 - assert(k instanceof BN); - assert(!k.red); - assert(!this.n.isZero()); - - const [v1, v2] = this.endo.basis; - - // 4. Compute c1 = round(b2 * k / n) - // and c2 = round(-b1 * k / n). - const c1 = v2.b.mul(k).divRound(this.n); - const c2 = v1.b.neg().mul(k).divRound(this.n); - - // 5. Compute k1 = k - c1 * a1 - c2 * a2 - // and k2 = -c1 * b1 - c2 * b2. - const p1 = c1.mul(v1.a); - const p2 = c2.mul(v2.a); - const q1 = c1.ineg().mul(v1.b); - const q2 = c2.mul(v2.b); - - // Calculate answer. - const k1 = k.sub(p1).isub(p2); - const k2 = q1.isub(q2); - - // 6. Return (k1, k2). - return [k1, k2]; - } - - _endoBeta(point) { - assert(point instanceof ShortPoint); - return [point, point._getBeta()]; - } - - _endoWnafMulAdd(points, coeffs) { - // Point multiplication with efficiently computable endomorphisms. - // - // [GECC] Algorithm 3.77, Page 129, Section 3.5. - // [GLV] Page 193, Section 3 (Using Efficient Endomorphisms). - // - // Note it may be possible to do this 4-dimensionally [4GLV]. - assert(Array.isArray(points)); - assert(Array.isArray(coeffs)); - assert(points.length === coeffs.length); - assert(this.endo != null); - - const len = points.length; - const npoints = new Array(len * 2); - const ncoeffs = new Array(len * 2); - - for (let i = 0; i < len; i++) { - const [p1, p2] = this._endoBeta(points[i]); - const [k1, k2] = this._endoSplit(coeffs[i]); - - npoints[i * 2 + 0] = p1; - ncoeffs[i * 2 + 0] = k1; - npoints[i * 2 + 1] = p2; - ncoeffs[i * 2 + 1] = k2; - } - - return this._wnafMulAdd(5, npoints, ncoeffs); - } - - _sswu(u) { - // Simplified Shallue-Woestijne-Ulas Method. - // - // Distribution: 3/8. - // - // [SSWU1] Page 15-16, Section 7. Appendix G. - // [SSWU2] Page 5, Theorem 2.3. - // [H2EC] "Simplified Shallue-van de Woestijne-Ulas Method". - // - // Assumptions: - // - // - a != 0, b != 0. - // - Let z be a non-square in F(p). - // - z != -1. - // - The polynomial g(x) - z is irreducible over F(p). - // - g(b / (z * a)) is square in F(p). - // - u != 0, u != +-sqrt(-1 / z). - // - // Map: - // - // g(x) = x^3 + a * x + b - // t1 = 1 / (z^2 * u^4 + z * u^2) - // x1 = (-b / a) * (1 + t1) - // x1 = b / (z * a), if t1 = 0 - // x2 = z * u^2 * x1 - // x = x1, if g(x1) is square - // = x2, otherwise - // y = sign(u) * abs(sqrt(g(x))) - const {b, z, ai, zi, one} = this; - const z2 = z.redSqr(); - const ba = b.redNeg().redMul(ai); - const bza = b.redMul(zi).redMul(ai); - const u2 = u.redSqr(); - const u4 = u2.redSqr(); - const t0 = z2.redMul(u4).redIAdd(z.redMul(u2)); - const t1 = t0.isZero() ? t0 : t0.redInvert(); - const x1 = t1.isZero() ? bza : ba.redMul(one.redAdd(t1)); - const x2 = z.redMul(u2).redMul(x1); - const y1 = this.solveY2(x1); - const y2 = this.solveY2(x2); - const alpha = y1.redIsSquare() | 0; - const x = [x1, x2][alpha ^ 1]; - const y = [y1, y2][alpha ^ 1].redSqrt(); - - if (y.redIsOdd() !== u.redIsOdd()) - y.redINeg(); - - return this.point(x, y); - } - - _sswui(p, hint) { - // Inverting the Map (Simplified Shallue-Woestijne-Ulas). - // - // Assumptions: - // - // - a^2 * x^2 - 2 * a * b * x - 3 * b^2 is square in F(p). - // - If r < 3 then x != -b / a. - // - // Unlike SVDW, the preimages here are evenly - // distributed (more or less). SSWU covers ~3/8 - // of the curve points. Each preimage has a 1/2 - // chance of mapping to either x1 or x2. - // - // Assuming the point is within that set, each - // point has a 1/4 chance of inverting to any - // of the preimages. This means we can simply - // randomly select a preimage if one exists. - // - // However, the [SVDW2] sampling method seems - // slighly faster in practice for [SQUARED]. - // - // Map: - // - // c = sqrt(a^2 * x^2 - 2 * a * b * x - 3 * b^2) - // u1 = -(a * x + b - c) / (2 * (a * x + b) * z) - // u2 = -(a * x + b + c) / (2 * (a * x + b) * z) - // u3 = -(a * x + b - c) / (2 * b * z) - // u4 = -(a * x + b + c) / (2 * b * z) - // r = random integer in [1,4] - // u = sign(y) * abs(sqrt(ur)) - const {a, b, z} = this; - const {x, y} = p; - const r = hint & 3; - const a2x2 = a.redSqr().redMul(x.redSqr()); - const abx2 = a.redMul(b).redMul(x).redIMuln(2); - const b23 = b.redSqr().redMuln(3); - const axb = a.redMul(x).redIAdd(b); - const c = a2x2.redISub(abx2).redISub(b23).redSqrt(); - const n0 = axb.redSub(c).redINeg(); - const n1 = axb.redAdd(c).redINeg(); - const d0 = axb.redMul(z).redIMuln(2); - const d1 = b.redMul(z).redIMuln(2); - const n = [n0, n1][r & 1]; // r = 1 or 3 - const d = [d0, d1][r >>> 1]; // r = 2 or 3 - const u = n.redDivSqrt(d); - - if (u.redIsOdd() !== y.redIsOdd()) - u.redINeg(); - - return u; - } - - _svdwf(u) { - // Shallue-van de Woestijne Method. - // - // Distribution: 9/16. - // - // [SVDW1] Section 5. - // [SVDW2] Page 8, Section 3. - // Page 15, Section 6, Algorithm 1. - // [H2EC] "Shallue-van de Woestijne Method". - // - // Assumptions: - // - // - p = 1 (mod 3). - // - a = 0, b != 0. - // - Let z be a unique element in F(p). - // - g((sqrt(-3 * z^2) - z) / 2) is square in F(p). - // - u != 0, u != +-sqrt(-g(z)). - // - // Map: - // - // g(x) = x^3 + b - // c = sqrt(-3 * z^2) - // t1 = u^2 + g(z) - // t2 = 1 / (u^2 * t1) - // t3 = u^4 * t2 * c - // x1 = (c - z) / 2 - t3 - // x2 = t3 - (c + z) / 2 - // x3 = z - t1^3 * t2 / (3 * z^2) - // x = x1, if g(x1) is square - // = x2, if g(x2) is square - // = x3, otherwise - // y = sign(u) * abs(sqrt(g(x))) - const {c, z, zi, i2, i3} = this; - const gz = this.solveY2(z); - const z3 = i3.redMul(zi.redSqr()); - const u2 = u.redSqr(); - const u4 = u2.redSqr(); - const t1 = u2.redAdd(gz); - const u2t1 = u2.redMul(t1); - const t2 = u2t1.isZero() ? u2t1 : u2t1.redInvert(); - const t3 = u4.redMul(t2).redMul(c); - const t4 = t1.redSqr().redMul(t1); - const x1 = c.redSub(z).redMul(i2).redISub(t3); - const x2 = t3.redSub(c.redAdd(z).redMul(i2)); - const x3 = z.redSub(t4.redMul(t2).redMul(z3)); - const y1 = this.solveY2(x1); - const y2 = this.solveY2(x2); - const y3 = this.solveY2(x3); - const alpha = y1.redJacobi() | 1; - const beta = y2.redJacobi() | 1; - const i = mod((alpha - 1) * beta, 3); - const x = [x1, x2, x3][i]; - const y = [y1, y2, y3][i]; - - return [x, y]; - } - - _svdw(u) { - const [x, yy] = this._svdwf(u); - const y = yy.redSqrt(); - - if (y.redIsOdd() !== u.redIsOdd()) - y.redINeg(); - - return this.point(x, y); - } - - _svdwi(p, hint) { - // Inverting the Map (Shallue-van de Woestijne). - // - // [SQUARED] Algorithm 1, Page 8, Section 3.3. - // [SVDW2] Page 12, Section 5. - // [SVDW3] "Inverting the map". - // - // Assumptions: - // - // - If r = 1 then x != -(c + z) / 2. - // - If r = 2 then x != (c - z) / 2. - // - If r > 2 then (t0 - t1 + t2) is square in F(p). - // - f(f^-1(x)) = x where f is the map function. - // - // We use the sampling method from [SVDW2], - // _not_ [SQUARED]. This seems to have a - // better distribution in practice. - // - // Note that [SVDW3] also appears to be - // incorrect in terms of distribution. - // - // The distribution of f(u), assuming u is - // random, is (1/2, 1/4, 1/4). - // - // To mirror this, f^-1(x) should simply - // pick (1/2, 1/4, 1/8, 1/8). - // - // To anyone running the forward map, our - // strings will appear to be random. - // - // Map: - // - // g(x) = x^3 + b - // c = sqrt(-3 * z^2) - // t0 = 9 * (x^2 * z^2 + z^4) - // t1 = 18 * x * z^3 - // t2 = 12 * g(z) * (x - z) - // t3 = sqrt(t0 - t1 + t2) - // t4 = t3 * z - // u1 = g(z) * (c - 2 * x - z) / (c + 2 * x + z) - // u2 = g(z) * (c + 2 * x + z) / (c - 2 * x - z) - // u3 = (3 * (z^3 - x * z^2) - 2 * g(z) + t4) / 2 - // u4 = (3 * (z^3 - x * z^2) - 2 * g(z) - t4) / 2 - // r = random integer in [1,4] - // u = sign(y) * abs(sqrt(ur)) - const {b, c, z, zero, two} = this; - const {x, y} = p; - const r = hint & 3; - const z2 = z.redSqr(); - const z3 = z2.redMul(z); - const z4 = z2.redSqr(); - const gz = z3.redAdd(b); - const gz2 = gz.redMuln(2); - const xx = x.redSqr(); - const x2z = x.redMuln(2).redIAdd(z); - const xz2 = x.redMul(z2); - const c0 = c.redSub(x2z); - const c1 = c.redAdd(x2z); - const t0 = xx.redMul(z2).redIAdd(z4).redIMuln(9); - const t1 = x.redMul(z3).redIMuln(18); - const t2 = gz.redMul(x.redSub(z)).redIMuln(12); - const t3 = r >= 2 ? t0.redISub(t1).redIAdd(t2).redSqrt() : zero; - const t4 = t3.redMul(z); - const t5 = z3.redISub(xz2).redIMuln(3).redISub(gz2); - const n0 = gz.redMul(c0); - const n1 = gz.redMul(c1); - const n2 = t5.redAdd(t4); - const n3 = t5.redSub(t4); - const d2 = two; - const n = [n0, n1, n2, n3][r]; - const d = [c1, c0, d2, d2][r]; - const u = n.redDivSqrt(d); - const [x0] = this._svdwf(u); - - if (!x0.eq(x)) - throw new Error('Invalid point.'); - - if (u.redIsOdd() !== y.redIsOdd()) - u.redINeg(); - - return u; - } - - isElliptic() { - const {a, b} = this; - const a2 = a.redSqr(); - const a3 = a2.redMul(a); - const b2 = b.redSqr(); - const d = b2.redMuln(27).redIAdd(a3.redMuln(4)); - - // 4 * a^3 + 27 * b^2 != 0 - return !d.isZero(); - } - - jinv() { - // [ARITH1] Page 71, Section 4.4. - // http://mathworld.wolfram.com/j-Invariant.html - const {a, b} = this; - const a2 = a.redSqr(); - const a3 = a2.redMul(a); - const b2 = b.redSqr(); - const t0 = a3.redMuln(4); - const lhs = t0.redMuln(1728); - const rhs = b2.redMuln(27).redIAdd(t0); - - if (rhs.isZero()) - throw new Error('Curve is not elliptic.'); - - // (1728 * 4 * a^3) / (4 * a^3 + 27 * b^2) - return lhs.redDiv(rhs).fromRed(); - } - - point(x, y) { - return new ShortPoint(this, x, y); - } - - jpoint(x, y, z) { - return new JPoint(this, x, y, z); - } - - solveX(y) { - assert(y instanceof BN); - - if (!this.a.isZero()) - throw new Error('Not implemented.'); - - // x^3 = y^2 - b - const y2 = y.redSqr(); - const x3 = y2.redSub(this.b); - - return cubeRoots(x3); - } - - solveY2(x) { - // [GECC] Page 89, Section 3.2.2. - // https://hyperelliptic.org/EFD/g1p/auto-shortw.html - assert(x instanceof BN); - - // y^2 = x^3 + a * x + b - const x3 = x.redSqr().redMul(x); - const y2 = x3.redIAdd(this.b); - - if (!this.zeroA) { - // Save some cycles for a = -3. - if (this.threeA) - y2.redIAdd(x.redMuln(-3)); - else - y2.redIAdd(this.a.redMul(x)); - } - - return y2; - } - - validate(point) { - assert(point instanceof ShortPoint); - - if (point.inf) - return true; - - const {x, y} = point; - const y2 = this.solveY2(x); - - return y.redSqr().eq(y2); - } - - pointFromX(x, sign = null) { - assert(x instanceof BN); - assert(sign == null || typeof sign === 'boolean'); - - if (!x.red) - x = x.toRed(this.red); - - const y = this.solveY(x); - - if (sign != null) { - if (this.h.cmpn(1) > 0) { - if (y.isZero() && sign) - throw new Error('Invalid point.'); - } - - if (y.redIsOdd() !== sign) - y.redINeg(); - } - - return this.point(x, y); - } - - pointFromY(y, index = 0) { - assert(y instanceof BN); - assert((index >>> 0) === index); - - if (!y.red) - y = y.toRed(this.red); - - const coords = this.solveX(y); - - if (index >= coords.length) - throw new Error('Invalid X coordinate index.'); - - const x = coords[index]; - - return this.point(x, y); - } - - isIsomorphic(curve) { - // [GECC] Page 84, Section 3.1.5. - // [ARITH1] Page 286, Section 13.2.3.c. - assert(curve instanceof Curve); - - if (!curve.p.eq(this.p)) - return false; - - let u2, u3; - try { - [u2, u3] = this._scale(curve); - } catch (e) { - return false; - } - - // E(a,b) <-> E(au^4,bu^6) - if (curve.type === 'short') { - // a' = a * u^4, b' = b * u^6 - const a = this.field(curve.a).redMul(u2.redSqr()); - const b = this.field(curve.b).redMul(u3.redSqr()); - - return this.a.eq(a) && this.b.eq(b); - } - - // E(a,b) <-> M(A,B) - if (curve.type === 'mont') { - // (A / (3 * B))^3 + a * (A / (3 * B)) + b = 0 - const {a3, bi} = curve; - const x = this.field(a3.redMul(bi)).redMul(u2); - const y2 = this.solveY2(x); - - return y2.isZero(); - } - - // E(a,b) <-> E(a,d) - if (curve.type === 'edwards') { - // ((a' + d') / 6)^3 + a * ((a' + d') / 6) + b = 0 - const x = this.field(curve.ad6).redMul(u2); - const y2 = this.solveY2(x); - - return y2.isZero(); - } - - return false; - } - - isIsogenous(curve) { - assert(curve instanceof Curve); - return false; - } - - pointFromShort(point) { - // [GECC] Page 84, Section 3.1.5. - // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves). - assert(point instanceof ShortPoint); - - if (this.isIsomorphic(point.curve)) { - // Isomorphic maps for E(a,b)<->E(au^4,bu^6): - // - // x' = x * u^2 - // y' = y * u^3 - // - // Where a * u^4 = a' and b * u^6 = b'. - if (point.isInfinity()) - return this.point(); - - const [u2, u3] = this._scale(point.curve); - const x = this.field(point.x); - const y = this.field(point.y); - const nx = x.redMul(u2); - const ny = y.redMul(u3); - - return this.point(nx, ny); - } - - throw new Error('Not implemented.'); - } - - pointFromMont(point) { - // [ALT] Appendix E.2 (Switching between Alternative Representations). - // [MONT2] "Equivalence with Weierstrass curves" - assert(point instanceof MontPoint); - - if (this.isIsomorphic(point.curve)) { - // Equivalence for M(A,B)->E(a,b): - // - // x = (u + A / 3) / B - // y = v / B - // - // Undefined if ((u^3 + A * u^2 + u) / B) is not square. - if (point.isInfinity()) - return this.point(); - - const {a3, bi} = point.curve; - const [u2, u3] = this._scale(point.curve); - const nx = point.x.redAdd(a3).redMul(bi); - const ny = point.y.redMul(bi); - - return this.point(this.field(nx).redMul(u2), - this.field(ny).redMul(u3)); - } - - throw new Error('Not implemented.'); - } - - pointFromEdwards(point) { - // [TWISTEQ] Section 2. - assert(point instanceof EdwardsPoint); - - if (this.isIsomorphic(point.curve)) { - // Equivalence for E(a,d)->E(a',b'): - // - // x' = ((5 * d - a) * y + d - 5 * a) / (12 * (y - 1)) - // y' = (d - a) * (y + 1) / (4 * x * (y - 1)) - // - // Undefined for x = 0 or y = 1. - // - // Exceptional Cases: - // - (0, 1) -> O - // - (0, -1) -> ((a + d) / 6, 0) - // - // Unexceptional Cases: - // - (sqrt(1 / a), 0) -> ((5 * a - d) / 12, (a - d) / 4 * sqrt(a)) - const {a, d, ad6} = point.curve; - const [u2, u3] = this._scale(point.curve); - - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) { - const x = this.field(ad6).redMul(u2); - return this.point(x, this.zero); - } - - const {x, y, z} = point; - const a5 = a.redMuln(5); - const d5 = d.redMuln(5); - const dma = d.redSub(a); - const d5a = d5.redSub(a); - const da5 = d.redSub(a5); - const ypz = y.redAdd(z); - const ymz = y.redSub(z); - const xx = d5a.redMul(y).redIAdd(da5.redMul(z)); - const xz = ymz.redMuln(12); - const yy = dma.redMul(ypz).redMul(z); - const yz = ymz.redMul(x).redIMuln(4); - - return this.cpoint(this.field(xx).redMul(u2), - this.field(xz), - this.field(yy).redMul(u3), - this.field(yz)); - } - - throw new Error('Not implemented.'); - } - - pointFromUniform(u) { - assert(u instanceof BN); - - // z = 0 or b = 0 - if (this.z.isZero() || this.b.isZero()) - throw new Error('Not implemented.'); - - // a != 0, b != 0 - if (!this.a.isZero()) - return this._sswu(u); - - // p = 1 mod 3, a = 0, b != 0 - if (!this.c.isZero()) - return this._svdw(u); - - throw new Error('Not implemented.'); - } - - pointToUniform(p, hint) { - // Convert a short weierstrass point to a field - // element by inverting either the SSWU or SVDW - // map. - // - // Hint Layout: - // - // [00000000] [0000] [0000] - // | | | - // | | +-- preimage index - // | +--- subgroup - // +-- bits to OR with uniform bytes - assert(p instanceof ShortPoint); - assert((hint >>> 0) === hint); - - // z = 0 or b = 0 - if (this.z.isZero() || this.b.isZero()) - throw new Error('Not implemented.'); - - // P = O - if (p.isInfinity()) - throw new Error('Invalid point.'); - - // Add a random torsion component. - const i = ((hint >>> 4) & 15) % this.torsion.length; - const q = p.add(this.torsion[i]); - - return wrapErrors(() => { - // a != 0, b != 0 - if (!this.a.isZero()) - return this._sswui(q, hint); - - // p = 1 mod 3, a = 0, b != 0 - if (!this.c.isZero()) - return this._svdwi(q, hint); - - throw new Error('Not implemented.'); - }); - } - - mulAll(points, coeffs) { - return super.mulAll(points, coeffs).toP(); - } - - affinizeAll(points) { - const out = this.normalizeAll(points); - - for (let i = 0; i < out.length; i++) - out[i] = out[i].toP(); - - return out; - } - - decodePoint(bytes) { - return ShortPoint.decode(this, bytes); - } - - encodeX(point) { - assert(point instanceof Point); - return point.encodeX(); - } - - decodeEven(bytes) { - return ShortPoint.decodeEven(this, bytes); - } - - decodeSquare(bytes) { - return ShortPoint.decodeSquare(this, bytes); - } - - toShort(a0, odd, sign = null) { - const [a, b] = this._short(a0, odd); - - const curve = new ShortCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = curve._scale(this); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromShort(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromShort(this.torsion[i]); - - return curve; - } - - toMont(b0, odd, sign = null) { - const [a, b] = this._mont(b0, odd); - - const curve = new MontCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = this._scale(curve); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromShort(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromShort(this.torsion[i]); - - return curve; - } - - toEdwards(a0, odd, sign = null) { - const [a, d] = this._edwards(a0, odd); - - const curve = new EdwardsCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - d: d, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = this._scale(curve); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) { - curve.g = curve.pointFromShort(this.g); - curve.g.normalize(); - } - - if (curve.isComplete()) { - for (let i = 0; i < this.h.word(0); i++) { - curve.torsion[i] = curve.pointFromShort(this.torsion[i]); - curve.torsion[i].normalize(); - } - } - - return curve; - } - - pointFromJSON(json) { - return ShortPoint.fromJSON(this, json); - } - - toJSON(pre) { - const json = super.toJSON(pre); - - json.a = this.a.fromRed().toJSON(); - json.b = this.b.fromRed().toJSON(); - - if (!this.c.isZero()) - json.c = this.c.fromRed().toJSON(); - - return json; - } - } - - /** - * ShortPoint - */ - - class ShortPoint extends Point { - constructor(curve, x, y) { - assert(curve instanceof ShortCurve); - - super(curve, types.AFFINE); - - this.x = this.curve.zero; - this.y = this.curve.zero; - this.inf = true; - - if (x != null) - this._init(x, y); - } - - _init(x, y) { - assert(x instanceof BN); - assert(y instanceof BN); - - this.x = x; - this.y = y; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - - this.inf = false; - } - - _getBeta() { - if (!this.curve.endo) - return null; - - if (this.pre && this.pre.beta) - return this.pre.beta; - - // Augment the point with our beta value. - // This is the counterpart to `k2` after - // the endomorphism split of `k`. - // - // Note that if we have precomputation, - // we have to clone and update all of the - // precomputed points below. - const xb = this.x.redMul(this.curve.endo.beta); - const beta = this.curve.point(xb, this.y); - - if (this.pre) { - beta.pre = this.pre.map((point) => { - const xb = point.x.redMul(this.curve.endo.beta); - return this.curve.point(xb, point.y); - }); - - this.pre.beta = beta; - } - - return beta; - } - - _getJNAF(point) { - assert(point instanceof ShortPoint); - - if (this.inf || point.inf) - return super._getJNAF(point); - - // Create comb for JSF. - const comb = [ - this, // 1 - null, // 3 - null, // 5 - point // 7 - ]; - - // Try to avoid Jacobian points, if possible. - if (this.y.eq(point.y)) { - comb[1] = this.add(point); - comb[2] = this.toJ().sub(point); - } else if (this.y.eq(point.y.redNeg())) { - comb[1] = this.toJ().add(point); - comb[2] = this.sub(point); - } else { - comb[1] = this.toJ().add(point); - comb[2] = this.toJ().sub(point); - } - - return comb; - } - - clone() { - if (this.inf) - return this.curve.point(); - - return this.curve.point(this.x, this.y); - } - - scale(a) { - return this.toJ().scale(a); - } - - neg() { - // P = O - if (this.inf) - return this; - - // -(X1, Y1) = (X1, -Y1) - return this.curve.point(this.x, this.y.redNeg()); - } - - add(p) { - // [GECC] Page 80, Section 3.1.2. - // - // Addition Law: - // - // l = (y1 - y2) / (x1 - x2) - // x3 = l^2 - x1 - x2 - // y3 = l * (x1 - x3) - y1 - // - // 1I + 2M + 1S + 6A - assert(p instanceof ShortPoint); - - // O + P = P - if (this.inf) - return p; - - // P + O = P - if (p.inf) - return this; - - // P + P, P + -P - if (this.x.eq(p.x)) { - // P + -P = O - if (!this.y.eq(p.y)) - return this.curve.point(); - - // P + P = 2P - return this.dbl(); - } - - // X1 != X2, Y1 = Y2 - if (this.y.eq(p.y)) { - // X3 = -X1 - X2 - const nx = this.x.redNeg().redISub(p.x); - - // Y3 = -Y1 - const ny = this.y.redNeg(); - - // Skip the inverse. - return this.curve.point(nx, ny); - } - - // H = X1 - X2 - const h = this.x.redSub(p.x); - - // R = Y1 - Y2 - const r = this.y.redSub(p.y); - - // L = R / H - const l = r.redDiv(h); - - // X3 = L^2 - X1 - X2 - const nx = l.redSqr().redISub(this.x).redISub(p.x); - - // Y3 = L * (X1 - X3) - Y1 - const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); - - return this.curve.point(nx, ny); - } - - dbl() { - // [GECC] Page 80, Section 3.1.2. - // - // Addition Law (doubling): - // - // l = (3 * x1^2 + a) / (2 * y1) - // x3 = l^2 - 2 * x1 - // y3 = l * (x1 - x3) - y1 - // - // 1I + 2M + 2S + 3A + 2*2 + 1*3 - - // P = O - if (this.inf) - return this; - - // Y1 = 0 - if (this.y.isZero()) - return this.curve.point(); - - // XX = X1^2 - const xx = this.x.redSqr(); - - // M = 3 * XX + a - const m = xx.redIMuln(3).redIAdd(this.curve.a); - - // Z = 2 * Y1 - const z = this.y.redMuln(2); - - // L = M / Z - const l = m.redDiv(z); - - // X3 = L^2 - 2 * X1 - const nx = l.redSqr().redISub(this.x).redISub(this.x); - - // Y3 = L * (X1 - X3) - Y1 - const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); - - return this.curve.point(nx, ny); - } - - dblp(pow) { - return this.toJ().dblp(pow).toP(); - } - - getX() { - if (this.inf) - throw new Error('Invalid point.'); - - return this.x.fromRed(); - } - - getY() { - if (this.inf) - throw new Error('Invalid point.'); - - return this.y.fromRed(); - } - - eq(p) { - assert(p instanceof ShortPoint); - - // P = Q - if (this === p) - return true; - - // P = O - if (this.inf) - return p.inf; - - // Q = O - if (p.inf) - return false; - - // X1 = X2, Y1 = Y2 - return this.x.eq(p.x) - && this.y.eq(p.y); - } - - cmp(point) { - assert(point instanceof ShortPoint); - - if (this.inf && !point.inf) - return -1; - - if (!this.inf && point.inf) - return 1; - - if (this.inf && point.inf) - return 0; - - return this.order().cmp(point.order()) - || this.getX().cmp(point.getX()) - || this.getY().cmp(point.getY()); - } - - isInfinity() { - // Infinity cannot be represented in - // the affine space, except by a flag. - return this.inf; - } - - isOrder2() { - if (this.inf) - return false; - - return this.y.isZero(); - } - - isOdd() { - if (this.inf) - return false; - - return this.y.redIsOdd(); - } - - isEven() { - if (this.inf) - return false; - - return this.y.redIsEven(); - } - - isSquare() { - if (this.inf) - return false; - - return this.y.redJacobi() !== -1; - } - - eqX(x) { - assert(x instanceof BN); - assert(!x.red); - - if (this.inf) - return false; - - return this.getX().eq(x); - } - - eqR(x) { - assert(x instanceof BN); - assert(!x.red); - assert(!this.curve.n.isZero()); - - if (this.inf) - return false; - - return this.getX().imod(this.curve.n).eq(x); - } - - mul(k) { - return super.mul(k).toP(); - } - - muln(k) { - return super.muln(k).toP(); - } - - mulBlind(k, rng) { - return super.mulBlind(k, rng).toP(); - } - - mulAdd(k1, p2, k2) { - return super.mulAdd(k1, p2, k2).toP(); - } - - mulH() { - return super.mulH().toP(); - } - - div(k) { - return super.div(k).toP(); - } - - divn(k) { - return super.divn(k).toP(); - } - - divH() { - return super.divH().toP(); - } - - toP() { - return this; - } - - toJ() { - // (X3, Y3, Z3) = (1, 1, 0) - if (this.inf) - return this.curve.jpoint(); - - // (X3, Y3, Z3) = (X1, Y1, 1) - return this.curve.jpoint(this.x, this.y, this.curve.one); - } - - encode(compact) { - // [SEC1] Page 10, Section 2.3.3. - if (compact == null) - compact = true; - - assert(typeof compact === 'boolean'); - - const {fieldSize} = this.curve; - - // We do not serialize points at infinity. - if (this.inf) - throw new Error('Invalid point.'); - - // Compressed form (0x02 = even, 0x03 = odd). - if (compact) { - const p = bufferExports.Buffer.alloc(1 + fieldSize); - const x = this.curve.encodeField(this.getX()); - - p[0] = 0x02 | this.y.redIsOdd(); - x.copy(p, 1); - - return p; - } - - // Uncompressed form (0x04). - const p = bufferExports.Buffer.alloc(1 + fieldSize * 2); - const x = this.curve.encodeField(this.getX()); - const y = this.curve.encodeField(this.getY()); - - p[0] = 0x04; - x.copy(p, 1); - y.copy(p, 1 + fieldSize); - - return p; - } - - static decode(curve, bytes) { - // [SEC1] Page 11, Section 2.3.4. - assert(curve instanceof ShortCurve); - assert(bufferExports.Buffer.isBuffer(bytes)); - - const len = curve.fieldSize; - - if (bytes.length < 1 + len) - throw new Error('Not a point.'); - - // Point forms: - // - // 0x00 -> Infinity (openssl, unsupported) - // 0x02 -> Compressed Even - // 0x03 -> Compressed Odd - // 0x04 -> Uncompressed - // 0x06 -> Hybrid Even (openssl) - // 0x07 -> Hybrid Odd (openssl) - // - // Note that openssl supports serializing points - // at infinity as {0}. We choose not to support it - // because it's strange and not terribly useful. - const form = bytes[0]; - - switch (form) { - case 0x02: - case 0x03: { - if (bytes.length !== 1 + len) - throw new Error('Invalid point size for compressed.'); - - const x = curve.decodeField(bytes.slice(1, 1 + len)); - - if (x.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - const p = curve.pointFromX(x, form === 0x03); - - assert(!p.isInfinity()); - - return p; - } - - case 0x04: - case 0x06: - case 0x07: { - if (bytes.length !== 1 + len * 2) - throw new Error('Invalid point size for uncompressed.'); - - const x = curve.decodeField(bytes.slice(1, 1 + len)); - const y = curve.decodeField(bytes.slice(1 + len, 1 + 2 * len)); - - // [GECC] Algorithm 4.3, Page 180, Section 4. - if (x.cmp(curve.p) >= 0 || y.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - // OpenSSL hybrid encoding. - if (form !== 0x04 && form !== (0x06 | y.isOdd())) - throw new Error('Invalid hybrid encoding.'); - - const p = curve.point(x, y); - - if (!p.validate()) - throw new Error('Invalid point.'); - - assert(!p.isInfinity()); - - return p; - } - - default: { - throw new Error('Unknown point format.'); - } - } - } - - encodeX() { - // [SCHNORR] "Specification". - // [BIP340] "Specification". - return this.curve.encodeField(this.getX()); - } - - static decodeEven(curve, bytes) { - // [BIP340] "Specification". - assert(curve instanceof ShortCurve); - - const x = curve.decodeField(bytes); - - if (x.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - return curve.pointFromX(x, false); - } - - static decodeSquare(curve, bytes) { - // [SCHNORR] "Specification". - assert(curve instanceof ShortCurve); - - const x = curve.decodeField(bytes); - - if (x.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - return curve.pointFromX(x); - } - - toJSON(pre) { - if (this.inf) - return []; - - const x = this.getX().toJSON(); - const y = this.getY().toJSON(); - - if (pre === true && this.pre) - return [x, y, this.pre.toJSON()]; - - return [x, y]; - } - - toPretty() { - if (this.inf) - return []; - - const size = this.curve.fieldSize * 2; - const x = toPretty(this.getX(), size); - const y = toPretty(this.getY(), size); - - return [x, y]; - } - - static fromJSON(curve, json) { - assert(curve instanceof ShortCurve); - assert(Array.isArray(json)); - assert(json.length === 0 - || json.length === 2 - || json.length === 3); - - if (json.length === 0) - return curve.point(); - - const x = BN.fromJSON(json[0]); - const y = BN.fromJSON(json[1]); - const point = curve.point(x, y); - - if (json.length > 2 && json[2] != null) - point.pre = Precomp.fromJSON(point, json[2]); - - return point; - } - - [custom]() { - if (this.inf) - return ''; - - return ''; - } - } - - /** - * JPoint - */ - - class JPoint extends Point { - constructor(curve, x, y, z) { - assert(curve instanceof ShortCurve); - - super(curve, types.JACOBIAN); - - this.x = this.curve.one; - this.y = this.curve.one; - this.z = this.curve.zero; - this.zOne = false; - - if (x != null) - this._init(x, y, z); - } - - _init(x, y, z) { - assert(x instanceof BN); - assert(y instanceof BN); - assert(z == null || (z instanceof BN)); - - this.x = x; - this.y = y; - this.z = z || this.curve.one; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - - this.zOne = this.z.eq(this.curve.one); - } - - clone() { - return this.curve.jpoint(this.x, this.y, this.z); - } - - validate() { - // [GECC] Example 3.20, Page 88, Section 3. - const {a, b} = this.curve; - - // P = O - if (this.isInfinity()) - return true; - - // Z1 = 1 - if (this.zOne) - return this.curve.validate(this.toP()); - - // y^2 = x^3 + a * x * z^4 + b * z^6 - const lhs = this.y.redSqr(); - const x3 = this.x.redSqr().redMul(this.x); - const z2 = this.z.redSqr(); - const z4 = z2.redSqr(); - const z6 = z4.redMul(z2); - const rhs = x3.redIAdd(b.redMul(z6)); - - if (!this.curve.zeroA) { - // Save some cycles for a = -3. - if (this.curve.threeA) - rhs.redIAdd(z4.redIMuln(-3).redMul(this.x)); - else - rhs.redIAdd(a.redMul(z4).redMul(this.x)); - } - - return lhs.eq(rhs); - } - - normalize() { - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#scaling-z - // 1I + 3M + 1S - - // Z = 1 - if (this.zOne) - return this; - - // P = O - if (this.isInfinity()) - return this; - - // A = 1 / Z1 - const a = this.z.redInvert(); - - // AA = A^2 - const aa = a.redSqr(); - - // X3 = X1 * AA - this.x = this.x.redMul(aa); - - // Y3 = Y1 * AA * A - this.y = this.y.redMul(aa).redMul(a); - - // Z3 = 1 - this.z = this.curve.one; - this.zOne = true; - - return this; - } - - scale(a) { - assert(a instanceof BN); - - // P = O - if (this.isInfinity()) - return this.curve.jpoint(); - - // AA = A^2 - const aa = a.redSqr(); - - // X3 = X1 * AA - const nx = this.x.redMul(aa); - - // Y3 = Y1 * AA * A - const ny = this.y.redMul(aa).redMul(a); - - // Z3 = Z1 * A - const nz = this.z.redMul(a); - - return this.curve.jpoint(nx, ny, nz); - } - - neg() { - // -(X1, Y1, Z1) = (X1, -Y1, Z1) - return this.curve.jpoint(this.x, this.y.redNeg(), this.z); - } - - add(p) { - assert(p instanceof Point); - - if (p.type === types.AFFINE) - return this._mixedAdd(p); - - return this._add(p); - } - - _add(p) { - assert(p instanceof JPoint); - - // O + P = P - if (this.isInfinity()) - return p; - - // P + O = P - if (p.isInfinity()) - return this; - - // Z1 = 1 - if (this.zOne) - return p._addJA(this); - - // Z2 = 1 - if (p.zOne) - return this._addJA(p); - - return this._addJJ(p); - } - - _mixedAdd(p) { - assert(p instanceof ShortPoint); - - // O + P = P - if (this.isInfinity()) - return p.toJ(); - - // P + O = P - if (p.isInfinity()) - return this; - - return this._addJA(p); - } - - _addJJ(p) { - // No assumptions. - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-1998-cmo-2 - // 12M + 4S + 6A + 1*2 (implemented as: 12M + 4S + 7A) - - // Z1Z1 = Z1^2 - const z1z1 = this.z.redSqr(); - - // Z2Z2 = Z2^2 - const z2z2 = p.z.redSqr(); - - // U1 = X1 * Z2Z2 - const u1 = this.x.redMul(z2z2); - - // U2 = X2 * Z1Z1 - const u2 = p.x.redMul(z1z1); - - // S1 = Y1 * Z2 * Z2Z2 - const s1 = this.y.redMul(p.z).redMul(z2z2); - - // S2 = Y2 * Z1 * Z1Z1 - const s2 = p.y.redMul(this.z).redMul(z1z1); - - // H = U2 - U1 - const h = u2.redISub(u1); - - // r = S2 - S1 - const r = s2.redISub(s1); - - // H = 0 - if (h.isZero()) { - if (!r.isZero()) - return this.curve.jpoint(); - - return this.dbl(); - } - - // HH = H^2 - const hh = h.redSqr(); - - // HHH = H * HH - const hhh = h.redMul(hh); - - // V = U1 * HH - const v = u1.redMul(hh); - - // X3 = r^2 - HHH - 2 * V - const nx = r.redSqr().redISub(hhh).redISub(v).redISub(v); - - // Y3 = r * (V - X3) - S1 * HHH - const ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh)); - - // Z3 = Z1 * Z2 * H - const nz = this.z.redMul(p.z).redMul(h); - - return this.curve.jpoint(nx, ny, nz); - } - - _addJA(p) { - // Assumes Z2 = 1. - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-madd - // 8M + 3S + 6A + 5*2 (implemented as: 8M + 3S + 7A + 4*2) - - // Z1Z1 = Z1^2 - const z1z1 = this.z.redSqr(); - - // U2 = X2 * Z1Z1 - const u2 = p.x.redMul(z1z1); - - // S2 = Y2 * Z1 * Z1Z1 - const s2 = p.y.redMul(this.z).redMul(z1z1); - - // H = U2 - X1 - const h = u2.redISub(this.x); - - // r = 2 * (S2 - Y1) - const r = s2.redISub(this.y).redIMuln(2); - - // H = 0 - if (h.isZero()) { - if (!r.isZero()) - return this.curve.jpoint(); - - return this.dbl(); - } - - // I = (2 * H)^2 - const i = h.redMuln(2).redSqr(); - - // J = H * I - const j = h.redMul(i); - - // V = X1 * I - const v = this.x.redMul(i); - - // X3 = r^2 - J - 2 * V - const nx = r.redSqr().redISub(j).redISub(v).redISub(v); - - // Y3 = r * (V - X3) - 2 * Y1 * J - const ny = r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2)); - - // Z3 = 2 * Z1 * H - const nz = this.z.redMul(h).redIMuln(2); - - return this.curve.jpoint(nx, ny, nz); - } - - dbl() { - // P = O - if (this.isInfinity()) - return this; - - // Y1 = 0 - if (this.y.isZero()) - return this.curve.jpoint(); - - // a = 0 - if (this.curve.zeroA) - return this._dbl0(); - - // a = -3 - if (this.curve.threeA) - return this._dbl3(); - - return this._dblJ(); - } - - _dblJ() { - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-1998-cmo-2 - // 3M + 6S + 4A + 1*a + 2*2 + 1*3 + 1*4 + 1*8 - // (implemented as: 3M + 6S + 5A + 1*a + 1*2 + 1*3 + 1*4 + 1*8) - - // XX = X1^2 - const xx = this.x.redSqr(); - - // YY = Y1^2 - const yy = this.y.redSqr(); - - // ZZ = Z1^2 - const zz = this.z.redSqr(); - - // S = 4 * X1 * YY - const s = this.x.redMul(yy).redIMuln(4); - - // M = 3 * XX + a * ZZ^2 - const m = xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr())); - - // T = M^2 - 2 * S - const t = m.redSqr().redISub(s).redISub(s); - - // X3 = T - const nx = t; - - // Y3 = M * (S - T) - 8 * YY^2 - const ny = m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8)); - - // Z3 = 2 * Y1 * Z1 - const nz = this.y.redMul(this.z).redIMuln(2); - - return this.curve.jpoint(nx, ny, nz); - } - - _dbl0() { - // Assumes a = 0. - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l - // 2M + 5S + 6A + 3*2 + 1*3 + 1*8 - // (implemented as: 2M + 5S + 7A + 2*2 + 1*3 + 1*8) - - // A = X1^2 - const a = this.x.redSqr(); - - // B = Y1^2 - const b = this.y.redSqr(); - - // C = B^2 - const c = b.redSqr(); - - // + XB2 = (X1 + B)^2 - const xb2 = b.redIAdd(this.x).redSqr(); - - // D = 2 * ((X1 + B)^2 - A - C) - const d = xb2.redISub(a).redISub(c).redIMuln(2); - - // E = 3 * A - const e = a.redIMuln(3); - - // F = E^2 - const f = e.redSqr(); - - // X3 = F - 2 * D - const nx = f.redISub(d).redISub(d); - - // Y3 = E * (D - X3) - 8 * C - const ny = e.redMul(d.redISub(nx)).redISub(c.redIMuln(8)); - - // Z3 = 2 * Y1 * Z1 - const nz = this.y.redMul(this.z).redIMuln(2); - - return this.curve.jpoint(nx, ny, nz); - } - - _dbl3() { - // Assumes a = -3. - // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b - // 3M + 5S + 8A + 1*3 + 1*4 + 2*8 - // (implemented as: 3M + 5S + 8A + 1*2 + 1*3 + 1*4 + 1*8) - - // delta = Z1^2 - const delta = this.z.redSqr(); - - // gamma = Y1^2 - const gamma = this.y.redSqr(); - - // beta = X1 * gamma - const beta = this.x.redMul(gamma); - - // + xmdelta = X1 - delta - const xmdelta = this.x.redSub(delta); - - // + xpdelta = X1 + delta - const xpdelta = this.x.redAdd(delta); - - // alpha = 3 * (X1 - delta) * (X1 + delta) - const alpha = xmdelta.redMul(xpdelta).redIMuln(3); - - // + beta4 = 4 * beta - const beta4 = beta.redIMuln(4); - - // + beta8 = 2 * beta4 - const beta8 = beta4.redMuln(2); - - // + gamma28 = 8 * gamma^2 - const gamma28 = gamma.redSqr().redIMuln(8); - - // X3 = alpha^2 - 8 * beta - const nx = alpha.redSqr().redISub(beta8); - - // Z3 = (Y1 + Z1)^2 - gamma - delta - const nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta); - - // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2 - const ny = alpha.redMul(beta4.redISub(nx)).redISub(gamma28); - - return this.curve.jpoint(nx, ny, nz); - } - - getX() { - if (this.isInfinity()) - throw new Error('Invalid point.'); - - this.normalize(); - - return this.x.fromRed(); - } - - getY() { - if (this.isInfinity()) - throw new Error('Invalid point.'); - - this.normalize(); - - return this.y.fromRed(); - } - - eq(p) { - assert(p instanceof JPoint); - - // P = Q - if (this === p) - return true; - - // P = O - if (this.isInfinity()) - return p.isInfinity(); - - // Q = O - if (p.isInfinity()) - return false; - - // Z1 = Z2 - if (this.z.eq(p.z)) { - return this.x.eq(p.x) - && this.y.eq(p.y); - } - - // X1 * Z2^2 = X2 * Z1^2 - const zz1 = this.z.redSqr(); - const zz2 = p.z.redSqr(); - const x1 = this.x.redMul(zz2); - const x2 = p.x.redMul(zz1); - - if (!x1.eq(x2)) - return false; - - // Y1 * Z2^3 = Y2 * Z1^3 - const zzz1 = zz1.redMul(this.z); - const zzz2 = zz2.redMul(p.z); - const y1 = this.y.redMul(zzz2); - const y2 = p.y.redMul(zzz1); - - return y1.eq(y2); - } - - cmp(point) { - assert(point instanceof JPoint); - - const inf1 = this.isInfinity(); - const inf2 = point.isInfinity(); - - if (inf1 && !inf2) - return -1; - - if (!inf1 && inf2) - return 1; - - if (inf1 && inf2) - return 0; - - return this.order().cmp(point.order()) - || this.getX().cmp(point.getX()) - || this.getY().cmp(point.getY()); - } - - isInfinity() { - // Z1 = 0 - return this.z.isZero(); - } - - isOrder2() { - if (this.isInfinity()) - return false; - - return this.y.isZero(); - } - - isOdd() { - if (this.isInfinity()) - return false; - - this.normalize(); - - return this.y.redIsOdd(); - } - - isEven() { - if (this.isInfinity()) - return false; - - this.normalize(); - - return this.y.redIsEven(); - } - - isSquare() { - if (this.isInfinity()) - return false; - - return this.y.redMul(this.z).redJacobi() !== -1; - } - - eqX(x) { - // Verify that integer `x` is equal to field - // element `x` by scaling it by our z coordinate. - // This optimization is mentioned in and used for - // bip-schnorr[1]. This avoids having to affinize - // the resulting point during verification. - // - // [1] [SCHNORR] "Optimizations". - assert(x instanceof BN); - assert(!x.red); - - if (this.isInfinity()) - return false; - - const zz = this.z.redSqr(); - const rx = x.toRed(this.curve.red).redMul(zz); - - return this.x.eq(rx); - } - - eqR(x) { - // Similar to the optimization above, this - // optimization, suggested by Maxwell[1], - // compares an integer to an X coordinate - // by scaling it. - // - // Since a signature's R value is modulo N - // in ECDSA, we may be dealing with an R - // value greater than N in actuality. - // - // If the equality check fails, we can - // scale N itself by Z and add it to the - // X field element. - // - // [1] https://github.com/bitcoin-core/secp256k1/commit/ce7eb6f - assert(x instanceof BN); - assert(!x.red); - - if (!this.curve.smallGap) - return this.toP().eqR(x); - - if (this.isInfinity()) - return false; - - if (x.cmp(this.curve.p) >= 0) - return false; - - const zz = this.z.redSqr(); - const rx = x.toRed(this.curve.red).redMul(zz); - - if (this.x.eq(rx)) - return true; - - if (this.curve.highOrder) - return false; - - if (x.cmp(this.curve.pmodn) >= 0) - return false; - - const rn = this.curve.redN.redMul(zz); - - rx.redIAdd(rn); - - return this.x.eq(rx); - } - - toP() { - // P = O - if (this.isInfinity()) - return this.curve.point(); - - this.normalize(); - - // (X3, Y3) = (X1 / Z1^2, Y1 / Z1^3) - return this.curve.point(this.x, this.y); - } - - toJ() { - return this; - } - - encode(compact) { - return this.toP().encode(compact); - } - - static decode(curve, bytes) { - return ShortPoint.decode(curve, bytes).toJ(); - } - - encodeX() { - return this.toP().encodeX(); - } - - static decodeEven(curve, bytes) { - return ShortPoint.decodeEven(curve, bytes).toJ(); - } - - static decodeSquare(curve, bytes) { - return ShortPoint.decodeSquare(curve, bytes).toJ(); - } - - toJSON(pre) { - return this.toP().toJSON(pre); - } - - toPretty() { - return this.toP().toPretty(); - } - - static fromJSON(curve, json) { - return ShortPoint.fromJSON(curve, json).toJ(); - } - - [custom]() { - if (this.isInfinity()) - return ''; - - return ''; - } - } - - /** - * MontCurve - */ - - class MontCurve extends Curve { - constructor(conf) { - super(MontPoint, 'mont', conf); - - this.a = BN.fromJSON(conf.a).toRed(this.red); - this.b = BN.fromJSON(conf.b).toRed(this.red); - - this.bi = this.b.redInvert(); - this.a2 = this.a.redAdd(this.two); - this.a24 = this.a2.redMul(this.i4); - this.a3 = this.a.redMul(this.i3); - this.a0 = this.a.redMul(this.bi); - this.b0 = this.bi.redSqr(); - - this._finalize(conf); - } - - static _isomorphism(curveA, curveB, customB) { - // Montgomery Isomorphism. - // - // [MONT3] Page 3, Section 2.1. - // - // Transformation: - // - // A' = A - // B' = B' - // - // Where (B / B') is square. - assert(curveA instanceof BN); - assert(curveB instanceof BN); - assert(customB instanceof BN); - - const a = curveA.clone(); - const b = customB.clone(); - const c = curveB.redDiv(customB); - - if (c.redJacobi() !== 1) - throw new Error('Invalid `b` coefficient.'); - - return [a, b]; - } - - _short(a0, odd) { - // Montgomery->Short Weierstrass Equivalence. - // - // [MONT2] "Equivalence with Weierstrass curves". - // - // Transformation: - // - // a = (3 - A^2) / (3 * B^2) - // b = (2 * A^3 - 9 * A) / (27 * B^3) - const {a, b, three} = this; - const a2 = a.redSqr(); - const a3 = a2.redMul(a); - const b2 = b.redSqr(); - const b3 = b2.redMul(b); - const n0 = three.redSub(a2); - const d0 = b2.redMuln(3); - const n1 = a3.redMuln(2).redISub(a.redMuln(9)); - const d1 = b3.redMuln(27); - const wa = n0.redDiv(d0); - const wb = n1.redDiv(d1); - - if (a0 != null) - return ShortCurve._isomorphism(wa, wb, a0, odd); - - return [wa, wb]; - } - - _mont(b0) { - return MontCurve._isomorphism(this.a, this.b, b0); - } - - _edwards(a0, invert = false) { - // Montgomery->Twisted Edwards Transformation. - // - // [MONT1] Page 11, Section 4.3.5. - // [TWISTED] Theorem 3.2, Page 4, Section 3. - // - // Equivalence: - // - // a = (A + 2) / B - // d = (A - 2) / B - // - // Isomorphism: - // - // a = a' - // d = a' * (A - 2) / (A + 2) - // - // Where ((A + 2) / (B * a')) is square. - // - // If `d` is square, we can usually find - // a complete curve by using the `invert` - // option. This will create an isomorphism - // chain of: M(A,B)->E(a,d)->E(d,a). - // - // The equivalence between E(a,d) and - // E(d,a) is: - // - // (x, y) = (x, 1 / y) - // - // Meaning our map to E(d,a) is: - // - // x = u / v - // y = 1 / ((u - 1) / (u + 1)) - // = (u + 1) / (u - 1) - assert(typeof invert === 'boolean'); - - const {two, bi} = this; - const a = this.a.redAdd(two).redMul(bi); - const d = this.a.redSub(two).redMul(bi); - - if (invert) - a.swap(d); - - if (a0 != null) - return EdwardsCurve._isomorphism(a, d, a0); - - return [a, d]; - } - - _scaleShort(curve) { - assert(curve instanceof ShortCurve); - - const [u2, u3] = curve._scale(this); - - return [this.field(u2.redInvert()), - this.field(u3.redInvert())]; - } - - _scaleMont(curve) { - // We can extract the isomorphism factor with: - // - // c = +-sqrt(B / B') - // - // If base points are available, we can do: - // - // c = v' / v - assert(curve instanceof MontCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) - return this.field(curve.b).redDivSqrt(this.b); - - return this.g.y.redDiv(this.field(curve.g.y)); - } - - _scaleEdwards(curve, invert) { - // We _could_ do something like: - // - // B = 4 / (a - d) - // c = +-sqrt(B / B') - // - // Which can be reduced to: - // - // c = +-sqrt(4 / ((a - d) * B')) - // - // If base points are available: - // - // v = u' / x - // c = v' / v - // - // Which can be reduced to: - // - // c = v' * x / u' - // - // However, the way our maps are - // written, we can re-use the Edwards - // isomorphism factor when going the - // other direction. - assert(curve instanceof EdwardsCurve); - - const c = curve._scale(this, invert); - - return this.field(c); - } - - _solveY0(x) { - assert(x instanceof BN); - - // y^2 = x^3 + A * x^2 + B * x - const a = this.a0; - const b = this.b0; - const x2 = x.redSqr(); - const x3 = x2.redMul(x); - const y2 = x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x)); - - return y2; - } - - _elligator2(u) { - // Elligator 2. - // - // Distribution: 1/2. - // - // [ELL2] Page 11, Section 5.2. - // [H2EC] "Elligator 2 Method". - // "Mappings for Montgomery curves". - // [SAFE] "Indistinguishability from uniform random strings". - // - // Assumptions: - // - // - y^2 = x^3 + A * x^2 + B * x. - // - A != 0, B != 0. - // - A^2 - 4 * B is non-zero and non-square in F(p). - // - Let z be a non-square in F(p). - // - u != +-sqrt(-1 / z). - // - // Note that Elligator 2 is defined over the form: - // - // y'^2 = x'^3 + A' * x'^2 + B' * x' - // - // Instead of: - // - // B * y^2 = x^3 + A * x^2 + x - // - // Where: - // - // A' = A / B - // B' = 1 / B^2 - // x' = x / B - // y' = y / B - // - // And: - // - // x = B * x' - // y = B * y' - // - // This is presumably the result of Elligator 2 - // being designed in long Weierstrass form. If - // we want to support B != 1, we need to do the - // conversion. - // - // Map: - // - // g(x) = x^3 + A * x^2 + B * x - // x1 = -A / (1 + z * u^2) - // x1 = -A, if x1 = 0 - // x2 = -x1 - A - // x = x1, if g(x1) is square - // = x2, otherwise - // y = sign(u) * abs(sqrt(g(x))) - const lhs = this.a0.redNeg(); - const rhs = this.one.redAdd(this.z.redMul(u.redSqr())); - - if (rhs.isZero()) - rhs.inject(this.one); - - const x1 = lhs.redMul(rhs.redInvert()); - const x2 = x1.redNeg().redISub(this.a0); - const y1 = this._solveY0(x1); - const y2 = this._solveY0(x2); - const alpha = y1.redIsSquare() | 0; - const x0 = [x1, x2][alpha ^ 1]; - const y0 = [y1, y2][alpha ^ 1].redSqrt(); - - if (y0.redIsOdd() !== u.redIsOdd()) - y0.redINeg(); - - const x = this.b.redMul(x0); - const y = this.b.redMul(y0); - - return this.point(x, y); - } - - _invert2(p, hint) { - // Inverting the Map (Elligator 2). - // - // [ELL2] Page 12, Section 5.3. - // - // Assumptions: - // - // - -z * x * (x + A) is square in F(p). - // - If r = 1 then x != 0. - // - If r = 2 then x != -A. - // - // Map: - // - // u1 = -(x + A) / (x * z) - // u2 = -x / ((x + A) * z) - // r = random integer in [1,2] - // u = sign(y) * abs(sqrt(ur)) - // - // Note that `0 / 0` can only occur if A = 0 - // (this violates the assumptions of Elligator 2). - const {x, y} = p; - const r = hint & 1; - const x0 = x.redMul(this.bi); - const y0 = y.redMul(this.bi); - const n = x0.redAdd(this.a0); - const d = x0; - const lhs = [n, d][r].redINeg(); - const rhs = [d, n][r].redMul(this.z); - const u = lhs.redDivSqrt(rhs); - - if (u.redIsOdd() !== y0.redIsOdd()) - u.redINeg(); - - return u; - } - - isElliptic() { - const a2 = this.a.redSqr(); - const d = this.b.redMul(a2.redSub(this.four)); - - // B * (A^2 - 4) != 0 - return !d.isZero(); - } - - jinv() { - // [MONT3] Page 3, Section 2. - const {a, three, four} = this; - const a2 = a.redSqr(); - const t0 = a2.redSub(three); - const lhs = t0.redPown(3).redIMuln(256); - const rhs = a2.redSub(four); - - if (rhs.isZero()) - throw new Error('Curve is not elliptic.'); - - // (256 * (A^2 - 3)^3) / (A^2 - 4) - return lhs.redDiv(rhs).fromRed(); - } - - point(x, y) { - return new MontPoint(this, x, y); - } - - jpoint(x, y, z) { - assert(x == null && y == null && z == null); - return this.point(); - } - - xpoint(x, z) { - return new XPoint(this, x, z); - } - - solveY2(x) { - // [MONT3] Page 3, Section 2. - // https://hyperelliptic.org/EFD/g1p/auto-montgom.html - assert(x instanceof BN); - - // B * y^2 = x^3 + A * x^2 + x - const x2 = x.redSqr(); - const x3 = x2.redMul(x); - const by2 = x3.redIAdd(this.a.redMul(x2)).redIAdd(x); - const y2 = by2.redMul(this.bi); - - return y2; - } - - validate(point) { - assert(point instanceof MontPoint); - - if (point.isInfinity()) - return true; - - const {x, y} = point; - const y2 = this.solveY2(x); - - return y.redSqr().eq(y2); - } - - pointFromX(x, sign = null) { - assert(x instanceof BN); - assert(sign == null || typeof sign === 'boolean'); - - if (!x.red) - x = x.toRed(this.red); - - const y = this.solveY(x); - - if (sign != null) { - if (y.isZero() && sign) - throw new Error('Invalid point.'); - - if (y.redIsOdd() !== sign) - y.redINeg(); - } - - return this.point(x, y); - } - - isIsomorphic(curve, invert) { - // [MONT3] Page 3, Section 2.1. - assert(curve instanceof Curve); - - if (!curve.p.eq(this.p)) - return false; - - // M(A,B) <-> M(A,B') - if (curve.type === 'mont') { - const a = this.field(curve.a); - const b = this.field(curve.b); - - // A' = A - if (!this.a.eq(a)) - return false; - - // B' != 0 - if (this.b.isZero()) - return false; - - // jacobi(B / B') = 1 - const c = b.redDiv(this.b); - - return c.redJacobi() === 1; - } - - return curve.isIsomorphic(this, invert); - } - - isIsogenous(curve) { - assert(curve instanceof Curve); - - if (curve.type === 'mont') - return false; - - return curve.isIsogenous(this); - } - - pointFromShort(point) { - // [ALT] Appendix E.2 (Switching between Alternative Representations). - // [MONT2] "Equivalence with Weierstrass curves" - assert(point instanceof ShortPoint); - - if (this.isIsomorphic(point.curve)) { - // Equivalence for E(a,b)->M(A,B): - // - // u = B * x - A / 3 - // v = B * y - // - // Undefined if ((u^3 + A * u^2 + u) / B) is not square. - if (point.isInfinity()) - return this.point(); - - const {a3, b} = this; - const [u2, u3] = this._scale(point.curve); - const x = this.field(point.x).redMul(u2); - const y = this.field(point.y).redMul(u3); - const u = b.redMul(x).redISub(a3); - const v = b.redMul(y); - - return this.point(u, v); - } - - throw new Error('Not implemented.'); - } - - pointFromMont(point) { - // [MONT3] Page 3, Section 2.1. - assert(point instanceof MontPoint); - - if (this.isIsomorphic(point.curve)) { - // Isomorphic maps for M(A,B)<->M(A,B'): - // - // u' = u - // v' = +-sqrt(B / B') * v - // - // Undefined if (B / B') is not square. - if (point.isInfinity()) - return this.point(); - - const c = this._scale(point.curve); - const u = this.field(point.x); - const v = this.field(point.y); - const nu = u; - const nv = c.redMul(v); - - return this.point(nu, nv); - } - - throw new Error('Not implemented.'); - } - - pointFromEdwards(point) { - // [RFC7748] Section 4.1 & 4.2. - // [MONT3] Page 6, Section 2.5. - // [TWISTED] Theorem 3.2, Page 4, Section 3. - assert(point instanceof EdwardsPoint); - assert(point.curve.p.eq(this.p)); - - // Edwards `x`, `y`, `z`. - const x = this.field(point.x); - const y = this.field(point.y); - const z = this.field(point.z); - - if (this.isIsogenous(point.curve)) { - // 4-isogeny maps for E(1,d)->M(2-4d,1): - // - // u = y^2 / x^2 - // v = (2 - x^2 - y^2) * y / x^3 - // - // Undefined for x = 0. - // - // Exceptional Cases: - // - (0, 1) -> O - // - (0, -1) -> (0, 0) - // - // Unexceptional Cases: - // - (+-1, 0) -> (0, 0) - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.zero); - - const c = z.redSqr().redIMuln(2); - const uu = y.redSqr(); - const uz = x.redSqr(); - const vv = c.redISub(uz).redISub(uu).redMul(y); - const vz = uz.redMul(x); - - return this.cpoint(uu, uz, vv, vz); - } - - if (this.isIsomorphic(point.curve, true)) { - // Isomorphic maps for E(d,a)->M(A,B): - // - // u = (y + 1) / (y - 1) - // v = +-sqrt((A - 2) / (B * a)) * u / x - // - // Undefined for x = 0 or y = 1. - // - // Exceptional Cases: - // - (0, 1) -> O - // - (0, -1) -> (0, 0) - // - // Unexceptional Cases: - // - (+-sqrt(1 / a), 0) -> (-1, +-sqrt((A - 2) / B)) - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.zero); - - const c = this._scale(point.curve, true); - const uu = y.redAdd(z); - const uz = y.redSub(z); - const vv = c.redMul(z).redMul(uu); - const vz = x.redMul(uz); - - return this.cpoint(uu, uz, vv, vz); - } - - if (this.isIsomorphic(point.curve, false)) { - // Isomorphic maps for E(a,d)->M(A,B): - // - // u = (1 + y) / (1 - y) - // v = +-sqrt((A + 2) / (B * a)) * u / x - // - // Undefined for x = 0 or y = 1. - // - // Exceptional Cases: - // - (0, 1) -> O - // - (0, -1) -> (0, 0) - // - // Unexceptional Cases: - // - (+-sqrt(1 / a), 0) -> (1, +-sqrt((A + 2) / B)) - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.zero); - - const c = this._scale(point.curve, false); - const uu = z.redAdd(y); - const uz = z.redSub(y); - const vv = c.redMul(z).redMul(uu); - const vz = x.redMul(uz); - - return this.cpoint(uu, uz, vv, vz); - } - - throw new Error('Not implemented.'); - } - - pointFromUniform(u) { - assert(u instanceof BN); - - // z = 0 or A = 0 - if (this.z.isZero() || this.a.isZero()) - throw new Error('Not implemented.'); - - return this._elligator2(u); - } - - pointToUniform(p, hint) { - // Convert a montgomery point to a field - // element by inverting the elligator2 map. - // - // Hint Layout: - // - // [00000000] [0000] [0000] - // | | | - // | | +-- preimage index - // | +--- subgroup - // +-- bits to OR with uniform bytes - assert(p instanceof MontPoint); - assert((hint >>> 0) === hint); - - // z = 0 or A = 0 - if (this.z.isZero() || this.a.isZero()) - throw new Error('Not implemented.'); - - // P = O - if (p.isInfinity()) - throw new Error('Invalid point.'); - - // Add a random torsion component. - const i = ((hint >>> 4) & 15) % this.torsion.length; - const q = p.add(this.torsion[i]); - - return wrapErrors(() => { - return this._invert2(q, hint); - }); - } - - decodePoint(bytes, sign) { - return MontPoint.decode(this, bytes, sign); - } - - encodeX(point) { - assert(point instanceof XPoint); - return point.encode(); - } - - decodeX(bytes) { - return XPoint.decode(this, bytes); - } - - toShort(a0, odd, sign = null) { - const [a, b] = this._short(a0, odd); - - const curve = new ShortCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = curve._scale(this); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromMont(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromMont(this.torsion[i]); - - return curve; - } - - toMont(b0, sign = null) { - const [a, b] = this._mont(b0); - - const curve = new MontCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h, - z: this.z - }); - - if (sign != null) { - const c = curve._scale(this); - - if (c.redIsOdd() !== sign) - c.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromMont(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromMont(this.torsion[i]); - - return curve; - } - - toEdwards(a0, invert, sign = null) { - const [a, d] = this._edwards(a0, invert); - - const curve = new EdwardsCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - d: d, - n: this.n, - h: this.h, - z: this.z - }); - - if (sign != null) { - const c = curve._scale(this, invert); - - if (c.redIsOdd() !== sign) - c.redINeg(); - } - - if (!this.g.isInfinity()) { - curve.g = curve.pointFromMont(this.g); - curve.g.normalize(); - } - - if (curve.isComplete()) { - for (let i = 0; i < this.h.word(0); i++) { - curve.torsion[i] = curve.pointFromMont(this.torsion[i]); - curve.torsion[i].normalize(); - } - } - - return curve; - } - - pointFromJSON(json) { - return MontPoint.fromJSON(this, json); - } - - toJSON(pre) { - const json = super.toJSON(pre); - json.a = this.a.fromRed().toJSON(); - json.b = this.b.fromRed().toJSON(); - return json; - } - } - - /** - * MontPoint - */ - - class MontPoint extends Point { - constructor(curve, x, y) { - assert(curve instanceof MontCurve); - - super(curve, types.AFFINE); - - this.x = this.curve.zero; - this.y = this.curve.zero; - this.inf = true; - - if (x != null) - this._init(x, y); - } - - _init(x, y) { - assert(x instanceof BN); - assert(y instanceof BN); - - this.x = x; - this.y = y; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - - this.inf = false; - } - - clone() { - if (this.inf) - return this.curve.point(); - - return this.curve.point(this.x, this.y); - } - - scale(a) { - return this.clone(); - } - - randomize(rng) { - return this.clone(); - } - - neg() { - // P = O - if (this.inf) - return this; - - // -(X1, Y1) = (X1, -Y1) - return this.curve.point(this.x, this.y.redNeg()); - } - - add(p) { - // [MONT1] Page 8, Section 4.3.2. - // - // Addition Law: - // - // l = (y2 - y1) / (x2 - x1) - // x3 = b * l^2 - a - x1 - x2 - // y3 = l * (x1 - x3) - y1 - // - // 1I + 2M + 1S + 7A + 1*b - assert(p instanceof MontPoint); - - // O + P = P - if (this.inf) - return p; - - // P + O = P - if (p.inf) - return this; - - // P + P, P + -P - if (this.x.eq(p.x)) { - // P + -P = O - if (!this.y.eq(p.y)) - return this.curve.point(); - - // P + P = 2P - return this.dbl(); - } - - // H = X2 - X1 - const h = p.x.redSub(this.x); - - // R = Y2 - Y1 - const r = p.y.redSub(this.y); - - // L = R / H - const l = r.redDiv(h); - - // K = b * L^2 - const k = this.curve.b.redMul(l.redSqr()); - - // X3 = K - a - X1 - X2 - const nx = k.redISub(this.curve.a).redISub(this.x).redISub(p.x); - - // Y3 = L * (X1 - X3) - Y1 - const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); - - return this.curve.point(nx, ny); - } - - dbl() { - // [MONT1] Page 8, Section 4.3.2. - // - // Addition Law (doubling): - // - // l = (3 * x1^2 + 2 * a * x1 + 1) / (2 * b * y1) - // x3 = b * l^2 - a - 2 * x1 - // y3 = l * (x1 - x3) - y1 - // - // 1I + 3M + 2S + 7A + 1*a + 1*b + 1*b + 2*2 + 1*3 - - // P = O - if (this.inf) - return this; - - // Y1 = 0 - if (this.y.isZero()) - return this.curve.point(); - - // M1 = 3 * X1^2 - const m1 = this.x.redSqr().redIMuln(3); - - // M2 = 2 * a * X1 - const m2 = this.curve.a.redMul(this.x).redIMuln(2); - - // M = M1 + M2 + 1 - const m = m1.redIAdd(m2).redIAdd(this.curve.one); - - // Z = 2 * b * Y1 - const z = this.curve.b.redMul(this.y).redIMuln(2); - - // L = M / Z - const l = m.redDiv(z); - - // K = b * L^2 - const k = this.curve.b.redMul(l.redSqr()); - - // X3 = K - a - 2 * X1 - const nx = k.redISub(this.curve.a).redISub(this.x).redISub(this.x); - - // Y3 = L * (X1 - X3) - Y1 - const ny = l.redMul(this.x.redSub(nx)).redISub(this.y); - - return this.curve.point(nx, ny); - } - - getX() { - if (this.inf) - throw new Error('Invalid point.'); - - return this.x.fromRed(); - } - - getY() { - if (this.inf) - throw new Error('Invalid point.'); - - return this.y.fromRed(); - } - - eq(p) { - assert(p instanceof MontPoint); - - // P = Q - if (this === p) - return true; - - // P = O - if (this.inf) - return p.inf; - - // Q = O - if (p.inf) - return false; - - // X1 = X2, Y1 = Y2 - return this.x.eq(p.x) - && this.y.eq(p.y); - } - - cmp(point) { - assert(point instanceof MontPoint); - - if (this.inf && !point.inf) - return -1; - - if (!this.inf && point.inf) - return 1; - - if (this.inf && point.inf) - return 0; - - return this.order().cmp(point.order()) - || this.getX().cmp(point.getX()) - || this.getY().cmp(point.getY()); - } - - isInfinity() { - // Infinity cannot be represented in - // the affine space, except by a flag. - return this.inf; - } - - isOrder2() { - if (this.inf) - return false; - - return this.y.isZero(); - } - - isOdd() { - if (this.inf) - return false; - - return this.y.redIsOdd(); - } - - isEven() { - if (this.inf) - return false; - - return this.y.redIsEven(); - } - - toP() { - return this; - } - - toJ() { - return this; - } - - toX() { - // (X3, Z3) = (1, 0) - if (this.inf) - return this.curve.xpoint(); - - // (X3, Z3) = (X1, 1) - return this.curve.xpoint(this.x, this.curve.one); - } - - encode() { - return this.toX().encode(); - } - - static decode(curve, bytes, sign) { - assert(curve instanceof MontCurve); - return curve.decodeX(bytes).toP(sign); - } - - toJSON(pre) { - if (this.inf) - return []; - - const x = this.getX().toJSON(); - const y = this.getY().toJSON(); - - return [x, y]; - } - - toPretty() { - if (this.inf) - return []; - - const size = this.curve.fieldSize * 2; - const x = toPretty(this.getX(), size); - const y = toPretty(this.getY(), size); - - return [x, y]; - } - - static fromJSON(curve, json) { - assert(curve instanceof MontCurve); - assert(Array.isArray(json)); - assert(json.length === 0 - || json.length === 2 - || json.length === 3); - - if (json.length === 0) - return curve.point(); - - const x = BN.fromJSON(json[0]); - const y = BN.fromJSON(json[1]); - - return curve.point(x, y); - } - - [custom]() { - if (this.inf) - return ''; - - return ''; - } - } - - /** - * XPoint - */ - - class XPoint extends Point { - constructor(curve, x, z) { - assert(curve instanceof MontCurve); - - super(curve, types.PROJECTIVE); - - this.x = this.curve.one; - this.z = this.curve.zero; - - if (x != null) - this._init(x, z); - } - - _init(x, z) { - assert(x instanceof BN); - assert(z == null || (z instanceof BN)); - - this.x = x; - this.z = z || this.curve.one; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - } - - clone() { - return this.curve.xpoint(this.x, this.z); - } - - precompute(power, rng) { - // No-op. - return this; - } - - validate() { - if (this.isInfinity()) - return true; - - // B * y^2 * z = x^3 + A * x^2 * z + x * z^2 - const {x, z} = this; - const x2 = x.redSqr(); - const x3 = x2.redMul(x); - const z2 = z.redSqr(); - const ax2 = this.curve.a.redMul(x2).redMul(z); - const by2 = x3.redIAdd(ax2).redIAdd(x.redMul(z2)); - const y2 = by2.redMul(this.curve.bi); - - // sqrt(y^2 * z^4) = y * z^2 - return y2.redMul(z).redJacobi() !== -1; - } - - normalize() { - // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#scaling-scale - // 1I + 1M - - // P = O - if (this.isInfinity()) - return this; - - // Z1 = 1 - if (this.z.eq(this.curve.one)) - return this; - - // X3 = X1 / Z1 - this.x = this.x.redDiv(this.z); - - // Z3 = 1 - this.z = this.curve.one; - - return this; - } - - scale(a) { - assert(a instanceof BN); - - // P = O - if (this.isInfinity()) - return this.curve.xpoint(); - - // X3 = X1 * A - const nx = this.x.redMul(a); - - // Y3 = Y1 * A - const nz = this.z.redMul(a); - - return this.curve.xpoint(nx, nz); - } - - neg() { - // -(X1, Z1) = (X1, Z1) - return this; - } - - dbl() { - // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3 - // 2M + 2S + 4A + 1*a24 - - // A = X1 + Z1 - const a = this.x.redAdd(this.z); - - // AA = A^2 - const aa = a.redSqr(); - - // B = X1 - Z1 - const b = this.x.redSub(this.z); - - // BB = B^2 - const bb = b.redSqr(); - - // C = AA - BB - const c = aa.redSub(bb); - - // X3 = AA * BB - const nx = aa.redMul(bb); - - // Z3 = C * (BB + a24 * C) - const nz = c.redMul(bb.redIAdd(this.curve.a24.redMul(c))); - - return this.curve.xpoint(nx, nz); - } - - diffAddDbl(p2, p3) { - // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#ladder-ladd-1987-m-3 - // 6M + 4S + 8A + 1*a24 - assert(p2 instanceof XPoint); - assert(p3 instanceof XPoint); - - // A = X2 + Z2 - const a = p2.x.redAdd(p2.z); - - // AA = A^2 - const aa = a.redSqr(); - - // B = X2 - Z2 - const b = p2.x.redSub(p2.z); - - // BB = B^2 - const bb = b.redSqr(); - - // E = AA - BB - const e = aa.redSub(bb); - - // C = X3 + Z3 - const c = p3.x.redAdd(p3.z); - - // D = X3 - Z3 - const d = p3.x.redSub(p3.z); - - // DA = D * A - const da = d.redMul(a); - - // CB = C * B - const cb = c.redMul(b); - - // X5 = Z1 * (DA + CB)^2 - const x5 = this.z.redMul(da.redAdd(cb).redSqr()); - - // Z5 = X1 * (DA - CB)^2 - const z5 = this.x.redMul(da.redISub(cb).redSqr()); - - // X4 = AA * BB - const x4 = aa.redMul(bb); - - // Z4 = E * (BB + a24 * E) - const z4 = e.redMul(bb.redIAdd(this.curve.a24.redMul(e))); - - return [ - this.curve.xpoint(x4, z4), - this.curve.xpoint(x5, z5) - ]; - } - - getX() { - if (this.isInfinity()) - throw new Error('Invalid point.'); - - this.normalize(); - - return this.x.fromRed(); - } - - getY(sign) { - return this.toP(sign).getY(); - } - - eq(p) { - assert(p instanceof XPoint); - - // P = Q - if (this === p) - return true; - - // P = O - if (this.isInfinity()) - return p.isInfinity(); - - // Q = O - if (p.isInfinity()) - return false; - - // Z1 = Z2 - if (this.z.eq(p.z)) - return this.x.eq(p.x); - - // X1 * Z2 = X2 * Z1 - const x1 = this.x.redMul(p.z); - const x2 = p.x.redMul(this.z); - - return x1.eq(x2); - } - - cmp(point) { - assert(point instanceof XPoint); - - const inf1 = this.isInfinity(); - const inf2 = point.isInfinity(); - - if (inf1 && !inf2) - return -1; - - if (!inf1 && inf2) - return 1; - - if (inf1 && inf2) - return 0; - - return this.order().cmp(point.order()) - || this.getX().cmp(point.getX()); - } - - isInfinity() { - // Z1 = 0 - return this.z.isZero(); - } - - isOrder2() { - if (this.isInfinity()) - return false; - - return this.x.isZero(); - } - - isOdd() { - return false; - } - - isEven() { - return false; - } - - hasTorsion() { - if (this.isInfinity()) - return false; - - // X1 = 0, Z1 != 0 (edge case) - if (this.x.isZero()) - return true; - - return super.hasTorsion(); - } - - order() { - try { - return this.toP().order(); - } catch (e) { - return new BN(1); - } - } - - jmul(k) { - // Multiply with the Montgomery Ladder. - // - // [MONT3] Algorithm 4, Page 12, Section 4.2. - // - // Note that any clamping is meant to - // be done _outside_ of this function. - assert(k instanceof BN); - assert(!k.red); - - const bits = k.bitLength(); - - let a = this.curve.xpoint(); - let b = this; - - for (let i = bits - 1; i >= 0; i--) { - const bit = k.bit(i); - - if (bit === 0) - [a, b] = this.diffAddDbl(a, b); - else - [b, a] = this.diffAddDbl(b, a); - } - - return a; - } - - jmulBlind(k, rng) { - if (!rng) - return this.jmul(k); - - // Randomize if available. - return this.randomize(rng).jmul(k); - } - - jmulAdd(k1, p2, k2) { - throw new Error('Not implemented.'); - } - - toP(sign = null) { - assert(sign == null || typeof sign === 'boolean'); - - if (this.isInfinity()) - return this.curve.point(); - - this.normalize(); - - return this.curve.pointFromX(this.x, sign); - } - - toJ() { - return this; - } - - toX() { - return this; - } - - key() { - if (this.isInfinity()) - return `${this.curve.uid}:oo`; - - this.normalize(); - - const x = this.getX().toString(16); - - return `${this.curve.uid}:${x}`; - } - - encode() { - // [RFC7748] Section 5. - return this.curve.encodeField(this.getX()); - } - - static decode(curve, bytes) { - assert(curve instanceof MontCurve); - - // [RFC7748] Section 5. - const x = curve.decodeField(bytes); - - // We're supposed to ignore the hi bit - // on montgomery points... I think. If - // we don't, the X25519 test vectors - // break, which is pretty convincing - // evidence. This is a no-op for X448. - x.iumaskn(curve.fieldBits); - - // Note: montgomery points are meant to be - // reduced by the prime and do not have to - // be explicitly validated in order to do - // the montgomery ladder. - const p = curve.xpoint(x, curve.one); - - assert(!p.isInfinity()); - - return p; - } - - toJSON(pre) { - return this.toP().toJSON(pre); - } - - toPretty() { - return this.toP().toPretty(); - } - - static fromJSON(curve, json) { - return MontPoint.fromJSON(curve, json).toX(); - } - - [custom]() { - if (this.isInfinity()) - return ''; - - return ''; - } - } - - /** - * EdwardsCurve - */ - - class EdwardsCurve extends Curve { - constructor(conf) { - super(EdwardsPoint, 'edwards', conf); - - this.a = BN.fromJSON(conf.a).toRed(this.red); - this.d = BN.fromJSON(conf.d).toRed(this.red); - this.s = BN.fromJSON(conf.s || '0').toRed(this.red); - this.si = this.s.isZero() ? this.zero : this.s.redInvert(); - - this.k = this.d.redMuln(2); - this.smi = -this.d.redNeg().word(0); - this.ad6 = this.a.redAdd(this.d).redMul(this.i6); - - this.twisted = !this.a.eq(this.one); - this.oneA = this.a.eq(this.one); - this.mOneA = this.a.eq(this.one.redNeg()); - this.smallD = this.prime != null && this.d.redNeg().length === 1; - this.alt = null; - - this._finalize(conf); - } - - static _isomorphism(curveA, curveD, customA) { - // Twisted Edwards Isomorphism. - // - // [TWISTED] Definition 2.1, Page 3, Section 2. - // - // Transformation: - // - // a' = a' - // d' = a' * d / a - // - // Where (a / a') is square. - assert(curveA instanceof BN); - assert(curveD instanceof BN); - assert(customA instanceof BN); - - const a = customA.clone(); - const d = customA.redMul(curveD).redDiv(curveA); - const c = curveA.redDiv(customA); - - if (c.redJacobi() !== 1) - throw new Error('Invalid `a` coefficient.'); - - return [a, d]; - } - - _short(a0, odd) { - // Twisted Edwards->Short Weierstrass Equivalence. - // - // [TWISTEQ] Section 2. - // - // Transformation: - // - // a' = -(a^2 + 14 * a * d + d^2) / 48 - // b' = (33 * (a^2 * d + a * d^2) - a^3 - d^3) / 864 - const {a, d} = this; - const a2 = a.redSqr(); - const a3 = a2.redMul(a); - const d2 = d.redSqr(); - const d3 = d2.redMul(d); - const ad14 = a.redMul(d).redIMuln(14); - const a2d = a2.redMul(d); - const ad2 = a.redMul(d2); - const t0 = a2d.redIAdd(ad2).redIMuln(33); - const wa = a2.redAdd(ad14).redIAdd(d2).redDivn(-48); - const wb = t0.redISub(a3).redISub(d3).redDivn(864); - - if (a0 != null) - return ShortCurve._isomorphism(wa, wb, a0, odd); - - return [wa, wb]; - } - - _mont(b0, invert = false) { - // Twisted Edwards->Montgomery Transformation. - // - // [TWISTED] Theorem 3.2, Page 4, Section 3. - // - // Equivalence: - // - // A = 2 * (a + d) / (a - d) - // B = 4 / (a - d) - // - // Isomorphism: - // - // A = 2 * (a + d) / (a - d) - // B = B' - // - // Where ((4 / (a - d)) / B') is square. - // - // If `4 / (a - d)` is non-square, we can - // usually force B=1 by using the `invert` - // option. This will create an isomorphism - // chain of: E(a,d)->E(d,a)->M(-A,-B). - // - // The equivalence between E(a,d) and E(d,a) - // is: - // - // (x, y) = (x, 1 / y) - // - // Meaning our map to M(-A,-B) is: - // - // u = (1 + 1 / y) / (1 - 1 / y) - // = (y + 1) / (y - 1) - // v = u / x - assert(typeof invert === 'boolean'); - - let apd, amd; - - if (invert) { - apd = this.d.redAdd(this.a); - amd = this.d.redSub(this.a); - } else { - apd = this.a.redAdd(this.d); - amd = this.a.redSub(this.d); - } - - const z = amd.redInvert(); - const a = apd.redMuln(2).redMul(z); - const b = z.redMuln(4); - - if (b0 != null) - return MontCurve._isomorphism(a, b, b0); - - return [a, b]; - } - - _edwards(a0) { - return EdwardsCurve._isomorphism(this.a, this.d, a0); - } - - _scaleShort(curve) { - assert(curve instanceof ShortCurve); - - const [u2, u3] = curve._scale(this); - - return [this.field(u2.redInvert()), - this.field(u3.redInvert())]; - } - - _scaleMont(curve, invert = false) { - // Calculate isomorphism factor between - // Twisted Edwards and Montgomery with: - // - // a = (A + 2) / B - // c = +-sqrt(a / a') - // - // Which can be reduced to: - // - // c = +-sqrt((A + 2) / (B * a')) - // - // If base points are available, we can do: - // - // x = u / v - // c = x' / x - // - // Which can be reduced to: - // - // c = v * x' / u - // - // We can now calculate the Edwards `x` with: - // - // x' = c * u / v - // - // And likewise, the Montgomery `v`: - // - // v = c * u / x' - assert(curve instanceof MontCurve); - assert(typeof invert === 'boolean'); - - if (this.g.isInfinity() || curve.g.isInfinity()) { - const [a] = curve._edwards(null, invert); - - return this.field(a).redDivSqrt(this.a); - } - - const x = curve.g.x.redDiv(curve.g.y); - - return this.g.x.redDiv(this.field(x)); - } - - _scaleEdwards(curve) { - // We can extract the isomorphism factor with: - // - // c = +-sqrt(a / a') - // - // If base points are available, we can do: - // - // c = x' / x - assert(curve instanceof EdwardsCurve); - - if (this.g.isInfinity() || curve.g.isInfinity()) - return this.field(curve.a).redDivSqrt(this.a); - - return this.g.x.redDiv(this.field(curve.g.x)); - } - - _mulA(num) { - assert(num instanceof BN); - - // n * a = n - if (this.oneA) - return num.clone(); - - // n * a = -n - if (this.mOneA) - return num.redNeg(); - - return this.a.redMul(num); - } - - _mulD(num) { - assert(num instanceof BN); - - // -d < 0x4000000 - if (this.smallD) - return num.redMuln(this.smi); - - return this.d.redMul(num); - } - - _elligator1(t) { - // Elligator 1. - // - // Distribution: 1/2. - // - // [ELL1] Page 6, Section 3. - // Page 15, Appendix A. - // [ELL2] Page 7, Section 3.2. - // - // Assumptions: - // - // - Let p be a prime power congruent to 3 mod 4. - // - Let s be a nonzero element of F(p). - // - Let c = 2 / s^2. - // - Let r = c + 1 / c. - // - Let d = -(c + 1)^2 / (c - 1)^2. - // - (s^2 - 2) * (s^2 + 2) != 0. - // - c * (c - 1) * (c + 1) != 0. - // - r != 0. - // - d is not square. - // - x^2 + y^2 = 1 + d * x^2 * y^2. - // - u * v * X * Y * x * (Y + 1) != 0. - // - Y^2 = X^5 + (r^2 - 2) * X^3 + X. - // - // Elligator 1, as devised by Fouque et al, - // takes place on the hyperelliptic curve of: - // - // y^2 = x^5 + (r^2 - 2) * x^3 + x - // - // Not only must our Edwards curve be complete, - // with a prime congruent to 3 mod 4, and a = 1, - // our curve must be isomorphic to a hyperelliptic - // curve of the above form. Roughly one half of - // all Edwards curves are isomorphic to a curve - // of said form. - // - // We can derive the isomorphism with: - // - // c = (d +- 2 * sqrt(-d) - 1) / (d + 1) - // s = +-sqrt(2 / c) - // r = c + 1 / c - // - // Note that even if your curve is an Elligator 1 - // curve, Elligator 2 is probably still preferable, - // as it has nearly the same properties (i.e. the - // same distribution), and is much less complex. - // - // Map: - // - // f(a) = a^((p - 1) / 2) - // u = (1 - t) / (1 + t) - // v = u^5 + (r^2 - 2) * u^3 + u - // X = f(v) * u - // Y = (f(v) * v)^((p + 1) / 4) * f(v) * f(u^2 + 1 / c^2) - // Y = 1, if u = 0 - // x = (c - 1) * s * X * (1 + X) / Y - // y = (r * X - (1 + X)^2) / (r * X + (1 + X)^2) - // - // When t = +-1, we create the hyperelliptic - // 2-torsion point of (0, 0). This needs to be - // mapped to (0, -1) in Edwards form, but the x - // denominator becomes zero. As far as I can - // tell, this is the only exceptional case. - // - // The only other exceptional case initially - // appears to be when the y denominator sums to - // zero (when t = sqrt(4 / r + 1)), however, the - // hyperelliptic `X` is negated by the sign of - // `v`, making this impossible. - const {s, si, i2, one, two} = this; - const c = si.redSqr().redIMuln(2); - const ci = s.redSqr().redMul(i2); - const ci2 = ci.redSqr(); - const r = c.redAdd(ci); - const r2 = r.redSqr().redISub(two); - const cm1 = c.redSub(one); - const uu = one.redSub(t); - const uz = one.redAdd(t); - const u = uz.isZero() ? uz : uu.redDiv(uz); - const u2 = u.redSqr(); - const u3 = u2.redMul(u); - const u5 = u3.redMul(u2); - const v = u5.redAdd(r2.redMul(u3)).redIAdd(u); - const f0 = this.field(v.redJacobi()); - const f1 = this.field(u2.redAdd(ci2).redJacobi()); - const f2 = f0.redMul(f1); - const X = f0.redMul(u); - const Y = f0.redMul(v).redSqrt().redMul(f2); - const X1 = one.redAdd(X); - const rX = r.redMul(X); - const X12 = X1.redSqr(); - const xx = cm1.redMul(s).redMul(X).redMul(X1); - const xz = u.isZero() ? this.one : Y; - const yy = rX.redSub(X12); - const yz = rX.redAdd(X12); - - return this.cpoint(xx, xz, yy, yz); - } - - _invert1(p, hint) { - // Inverting the Map (Elligator 1). - // - // [ELL1] Page 6, Section 3. - // Page 15, Appendix A. - // [ELL2] Page 7, Section 3.3. - // - // Assumptions: - // - // - y + 1 != 0. - // - (1 + n * r)^2 - 1 is square in F(p). - // - If n * r = -2 then x = 2 * s * (c - 1) * f(c) / r. - // - Y = (c - 1) * s * X * (1 + X) / x. - // - // Map: - // - // f(a) = a^((p - 1) / 2) - // n = (y - 1) / (2 * (y + 1)) - // X = -(1 + n * r) + ((1 + n * r)^2 - 1)^((p + 1) / 4) - // z = f((c - 1) * s * X * (1 + X) * x * (X^2 + 1 / c^2)) - // u = z * X - // t = (1 - u) / (1 + u) - const {s, si, i2, one} = this; - const {x, y, z} = p; - const sign = hint & 1; - const c = si.redSqr().redIMuln(2); - const ci = s.redSqr().redMul(i2); - const ci2 = ci.redSqr(); - const r = c.redAdd(ci); - const cm1 = c.redSub(one); - const nn = y.redSub(z); - const nz = y.redAdd(z).redIMuln(2); - const n = nz.isZero() ? nz : nn.redDiv(nz); - const nr1 = one.redAdd(n.redMul(r)); - const w2 = nr1.redSqr().redISub(one); - const w = w2.redSqrt(); - const X = w.redSub(nr1); - const X1 = one.redAdd(X); - const YY = cm1.redMul(s).redMul(X).redMul(X1); - const Y = YY.redMul(x.redMul(z)); - const X2 = X.redSqr().redIAdd(ci2); - const Z = this.field(Y.redMul(X2).redJacobi()); - const u = Z.redMul(X); - const tt = one.redSub(u); - const tz = one.redAdd(u); - const t = tz.isZero() ? tz : tt.redDiv(tz); - - if (t.redIsOdd() !== Boolean(sign)) - t.redINeg(); - - return t; - } - - _alt() { - if (!this.alt) - this.alt = this.toMont(); - - return this.alt; - } - - isElliptic() { - const ad = this.a.redMul(this.d); - const amd = this.a.redSub(this.d); - - // a * d * (a - d) != 0 - return !ad.redMul(amd).isZero(); - } - - jinv() { - // [TWISTED] Definition 2.1, Page 3, Section 2. - const {a, d} = this; - const ad = a.redMul(d); - const amd4 = a.redSub(d).redPown(4); - const a2 = a.redSqr(); - const d2 = d.redSqr(); - const t0 = a2.redAdd(ad.redMuln(14)).redIAdd(d2); - const lhs = t0.redPown(3).redIMuln(16); - const rhs = ad.redMul(amd4); - - if (rhs.isZero()) - throw new Error('Curve is not elliptic.'); - - // 16 * (a^2 + 14 * a * d + d^2)^3 / (a * d * (a - d)^4) - return lhs.redDiv(rhs).fromRed(); - } - - isComplete() { - return this.a.redJacobi() === 1 - && this.d.redJacobi() === -1; - } - - point(x, y, z, t) { - return new EdwardsPoint(this, x, y, z, t); - } - - jpoint(x, y, z) { - assert(x == null && y == null && z == null); - return this.point(); - } - - cpoint(xx, xz, yy, yz) { - assert(xx instanceof BN); - assert(xz instanceof BN); - assert(yy instanceof BN); - assert(yz instanceof BN); - - const x = xx.redMul(yz); - const y = yy.redMul(xz); - const z = xz.redMul(yz); - const t = xx.redMul(yy); - - return this.point(x, y, z, t); - } - - solveX2(y) { - // [RFC8032] Section 5.1.3 & 5.2.3. - assert(y instanceof BN); - - // x^2 = (y^2 - 1) / (d * y^2 - a) - const y2 = y.redSqr(); - const rhs = this._mulD(y2).redISub(this.a); - const lhs = y2.redISub(this.one); - const x2 = lhs.redDiv(rhs); - - return x2; - } - - solveX(y) { - // Optimize with inverse square root trick. - // - // Note that `0 / 0` can only occur if - // `a == d` (i.e. the curve is singular). - const y2 = y.redSqr(); - const rhs = this._mulD(y2).redISub(this.a); - const lhs = y2.redISub(this.one); - - return lhs.redDivSqrt(rhs); - } - - solveY2(x) { - assert(x instanceof BN); - - // y^2 = (a * x^2 - 1) / (d * x^2 - 1) - const x2 = x.redSqr(); - const lhs = this._mulA(x2).redISub(this.one); - const rhs = this._mulD(x2).redISub(this.one); - const y2 = lhs.redDiv(rhs); - - return y2; - } - - solveY(x) { - // Optimize with inverse square root trick. - // - // Note that `0 / 0` can only occur if - // `a == d` (i.e. the curve is singular). - const x2 = x.redSqr(); - const lhs = this._mulA(x2).redISub(this.one); - const rhs = this._mulD(x2).redISub(this.one); - - return lhs.redDivSqrt(rhs); - } - - validate(point) { - // [TWISTED] Definition 2.1, Page 3, Section 2. - // Page 11, Section 6. - assert(point instanceof EdwardsPoint); - - // Z1 = 1 - if (point.zOne) { - // a * x^2 + y^2 = 1 + d * x^2 * y^2 - const x2 = point.x.redSqr(); - const y2 = point.y.redSqr(); - const dxy = this._mulD(x2).redMul(y2); - const lhs = this._mulA(x2).redIAdd(y2); - const rhs = this.one.redAdd(dxy); - const tz = point.t; - const xy = point.x.redMul(point.y); - - return lhs.eq(rhs) && tz.eq(xy); - } - - // (a * x^2 + y^2) * z^2 = z^4 + d * x^2 * y^2 - const x2 = point.x.redSqr(); - const y2 = point.y.redSqr(); - const z2 = point.z.redSqr(); - const z4 = z2.redSqr(); - const dxy = this._mulD(x2).redMul(y2); - const lhs = this._mulA(x2).redIAdd(y2).redMul(z2); - const rhs = z4.redIAdd(dxy); - const tz = point.t.redMul(point.z); - const xy = point.x.redMul(point.y); - - return lhs.eq(rhs) && tz.eq(xy); - } - - pointFromX(x, sign = null) { - assert(x instanceof BN); - assert(sign == null || typeof sign === 'boolean'); - - if (!x.red) - x = x.toRed(this.red); - - const y = this.solveY(x); - - if (sign != null) { - if (y.isZero() && sign) - throw new Error('Invalid point.'); - - if (y.redIsOdd() !== sign) - y.redINeg(); - } - - return this.point(x, y); - } - - pointFromY(y, sign = null) { - assert(y instanceof BN); - assert(sign == null || typeof sign === 'boolean'); - - if (!y.red) - y = y.toRed(this.red); - - const x = this.solveX(y); - - if (sign != null) { - if (x.isZero() && sign) - throw new Error('Invalid point.'); - - if (x.redIsOdd() !== sign) - x.redINeg(); - } - - return this.point(x, y); - } - - isIsomorphic(curve, invert = false) { - // [TWISTED] Theorem 3.2, Page 4, Section 3. - // Definition 2.1, Page 3, Section 2. - assert(curve instanceof Curve); - assert(typeof invert === 'boolean'); - - if (!curve.p.eq(this.p)) - return false; - - // E(a,d) <-> E(a,b) - if (curve.type === 'short') - return curve.isIsomorphic(this); - - // E(a,d) <-> M(A,B) - // E(a,d) <-> M(-A,-B) - if (curve.type === 'mont') { - // A * (a - d) = 2 * (a + d) - const a = this.field(curve.a); - - let apd, amd; - - if (invert) { - apd = this.d.redAdd(this.a); - amd = this.d.redSub(this.a); - } else { - apd = this.a.redAdd(this.d); - amd = this.a.redSub(this.d); - } - - return a.redMul(amd).eq(apd.redIMuln(2)); - } - - // E(a,d) <-> E(a',a'd/a) - if (curve.type === 'edwards') { - // a' * d = a * d' - const a = this.field(curve.a); - const d = this.field(curve.d); - - return this.a.redMul(d).eq(a.redMul(this.d)); - } - - return false; - } - - isIsogenous(curve) { - // Check for the 4-isogenies described by Hamburg: - // https://moderncrypto.org/mail-archive/curves/2016/000806.html - assert(curve instanceof Curve); - - if (!curve.p.eq(this.p)) - return false; - - // E(1,d) <-> M(2-4d,1) - if (curve.type === 'mont') { - if (!this.a.eq(this.one)) - return false; - - const a = this.field(curve.a); - const b = this.field(curve.b); - const d24 = this.two.redSub(this.d.redMuln(4)); - - return a.eq(d24) && b.eq(this.one); - } - - // E(a,d) <-> E(-a,d-a) - if (curve.type === 'edwards') { - const a = this.field(curve.a); - const d = this.field(curve.d); - - return a.eq(this.a.redNeg()) - && d.eq(this.d.redSub(this.a)); - } - - return false; - } - - pointFromShort(point) { - // [TWISTEQ] Section 1. - assert(point instanceof ShortPoint); - - if (this.isIsomorphic(point.curve)) { - // Equivalence for E(a,b)->E(a',d'): - // - // x' = (6 * x - a' - d') / (6 * y) - // y' = (12 * x - 5 * a' + d') / (12 * x + a' - 5 * d') - // - // Undefined for x = (5 * d' - a') / 12 or y = 0. - // - // Exceptional Cases: - // - O -> (0, 1) - // - ((a' + d') / 6, 0) -> (0, -1) - // - ((5 * d' - a') / 12, (d' - a') / 4 * sqrt(d')) -> (sqrt(1/d'), oo) - // - // Unexceptional Cases: - // - ((5 * a' - d') / 12, (a' - d') / 4 * sqrt(a')) -> (sqrt(1/a'), 0) - if (point.isInfinity()) - return this.point(); - - if (point.y.isZero()) - return this.point(this.zero, this.one.redNeg()); - - const {a, d} = this; - const [u2, u3] = this._scale(point.curve); - const a5 = a.redMuln(5); - const d5 = d.redMuln(5); - const x = this.field(point.x).redMul(u2); - const y = this.field(point.y).redMul(u3); - const x6 = x.redMuln(6); - const x12 = x.redMuln(12); - const xx = x6.redSub(a).redISub(d); - const xz = y.redMuln(6); - const yy = x12.redSub(a5).redIAdd(d); - const yz = x12.redAdd(a).redISub(d5); - - return this.cpoint(xx, xz, yy, yz); - } - - throw new Error('Not implemented.'); - } - - pointFromMont(point) { - // [RFC7748] Section 4.1 & 4.2. - // [MONT3] Page 6, Section 2.5. - // [TWISTED] Theorem 3.2, Page 4, Section 3. - assert(point instanceof MontPoint); - assert(point.curve.p.eq(this.p)); - - // Montgomery `u`, `v`. - const u = this.field(point.x); - const v = this.field(point.y); - - if (this.isIsogenous(point.curve)) { - // 4-isogeny maps for M(2-4d,1)->E(1,d): - // - // x = 4 * v * (u^2 - 1) / (u^4 - 2 * u^2 + 4 * v^2 + 1) - // y = -(u^5 - 2 * u^3 - 4 * u * v^2 + u) / - // (u^5 - 2 * u^2 * v^2 - 2 * u^3 - 2 * v^2 + u) - // - // Undefined for u = 0 and v = 0. - // - // Exceptional Cases: - // - O -> (0, 1) - // - (0, 0) -> (0, 1) - // - // Unexceptional Cases: - // - (-1, +-sqrt(A - 2)) -> (0, 1) - // - (1, +-sqrt(A + 2)) -> (0, -1) - // - // The point (1, v) is invalid on Curve448. - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(); - - const u2 = u.redSqr(); - const u3 = u2.redMul(u); - const u4 = u3.redMul(u); - const u5 = u4.redMul(u); - const v2 = v.redSqr(); - const a = v.redMuln(4); - const b = u2.redSub(this.one); - const c = u2.redMuln(2); - const d = v2.redMuln(4); - const e = u3.redIMuln(2); - const f = u.redMul(v2).redIMuln(4); - const g = u2.redMul(v2).redIMuln(2); - const h = v2.redIMuln(2); - const xx = a.redMul(b); - const xz = u4.redISub(c).redIAdd(d).redIAdd(this.one); - const yy = u5.redSub(e).redISub(f).redIAdd(u).redINeg(); - const yz = u5.redISub(g).redISub(e).redISub(h).redIAdd(u); - - return this.cpoint(xx, xz, yy, yz).divn(4); - } - - if (this.isIsomorphic(point.curve, true)) { - // Isomorphic maps for M(-A,-B)->E(a,d): - // - // x = +-sqrt((A - 2) / (B * a)) * u / v - // y = (u + 1) / (u - 1) - // - // Undefined for u = 1 or v = 0. - // - // Exceptional Cases: - // - O -> (0, 1) - // - (0, 0) -> (0, -1) - // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / d), oo) - // - // Unexceptional Cases: - // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / a), 0) - // - // The point (1, v) is invalid on Curve448. - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.one.redNeg()); - - const c = this._scale(point.curve, true); - const xx = c.redMul(u); - const xz = v; - const yy = u.redAdd(this.one); - const yz = u.redSub(this.one); - - return this.cpoint(xx, xz, yy, yz); - } - - if (this.isIsomorphic(point.curve, false)) { - // Isomorphic maps for M(A,B)->E(a,d): - // - // x = +-sqrt((A + 2) / (B * a)) * u / v - // y = (u - 1) / (u + 1) - // - // Undefined for u = -1 or v = 0. - // - // Exceptional Cases: - // - O -> (0, 1) - // - (0, 0) -> (0, -1) - // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / d), oo) - // - // Unexceptional Cases: - // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / a), 0) - // - // The point (-1, v) is invalid on Curve25519. - if (point.isInfinity()) - return this.point(); - - if (point.x.isZero()) - return this.point(this.zero, this.one.redNeg()); - - const c = this._scale(point.curve, false); - const xx = c.redMul(u); - const xz = v; - const yy = u.redSub(this.one); - const yz = u.redAdd(this.one); - - return this.cpoint(xx, xz, yy, yz); - } - - throw new Error('Not implemented.'); - } - - pointFromEdwards(point) { - // [TWISTED] Definition 2.1, Page 3, Section 2. - // [ISOGENY] Page 2, Section 2. - assert(point instanceof EdwardsPoint); - assert(point.curve.p.eq(this.p)); - - // Edwards `x`, `y`, `z`, `t`. - const a = this.field(point.curve.a); - const x = this.field(point.x); - const y = this.field(point.y); - const z = this.field(point.z); - const t = this.field(point.t); - - if (this.isIsogenous(point.curve)) { - // 4-isogeny maps for E(a,d)<->E(-a,d-a): - // - // x' = (2 * x * y) / (y^2 - a * x^2) - // y' = (y^2 + a * x^2) / (2 - y^2 - a * x^2) - // - // Undefined for y^2 - a * x^2 = 0 - // or y^2 + a * x^2 = 2. - const xy = x.redMul(y); - const x2 = x.redSqr(); - const y2 = y.redSqr(); - const z2 = z.redSqr(); - const ax2 = a.redMul(x2); - const xx = xy.redIMuln(2); - const xz = y2.redSub(ax2); - const yy = y2.redAdd(ax2); - const yz = z2.redIMuln(2).redISub(yy); - const p = this.cpoint(xx, xz, yy, yz); - - return !this.twisted ? p.divn(4) : p; - } - - if (this.isIsomorphic(point.curve)) { - // Isomorphic maps for E(a,d)<->E(a',a'd/a): - // - // x' = +-sqrt(a / a') * x - // y' = y - // - // Undefined when (a / a') is not square. - const c = this._scale(point.curve); - const nx = c.redMul(x); - const ny = y; - const nz = z; - const nt = c.redMul(t); - - return this.point(nx, ny, nz, nt); - } - - throw new Error('Not implemented.'); - } - - pointFromUniform(u, curve = null) { - assert(u instanceof BN); - assert(u.red === this.red); - assert(curve == null || (curve instanceof MontCurve)); - - if (!curve) - curve = this._alt(); - - const u0 = curve.field(u); - const p0 = curve.pointFromUniform(u0); - - return this.pointFromMont(p0); - } - - pointToUniform(p, hint, curve = null) { - // Convert an edwards point to a field - // element by inverting the elligator2 map. - // - // Hint Layout: - // - // [00000000] [0000] [0000] - // | | | - // | | +-- preimage index - // | +--- subgroup - // +-- bits to OR with uniform bytes - assert(p instanceof EdwardsPoint); - assert((hint >>> 0) === hint); - assert(curve == null || (curve instanceof MontCurve)); - - if (!curve) - curve = this._alt(); - - // Add a random torsion component. - const i = ((hint >> 4) & 15) % this.torsion.length; - const q = p.add(this.torsion[i]); - - // Convert and invert. - const p0 = curve.pointFromEdwards(q); - const u0 = curve.pointToUniform(p0, hint & 15); - - return this.field(u0); - } - - pointFromHash(bytes, pake, curve = null) { - assert(curve == null || (curve instanceof MontCurve)); - - if (!curve) - curve = this._alt(); - - const p0 = curve.pointFromHash(bytes, pake); - - return this.pointFromMont(p0); - } - - pointToHash(p, subgroup, rng, curve = null) { - assert(p instanceof EdwardsPoint); - assert((subgroup >>> 0) === subgroup); - assert(curve == null || (curve instanceof MontCurve)); - - if (!curve) - curve = this._alt(); - - // Add a random torsion component. - const i = subgroup % this.torsion.length; - const q = p.add(this.torsion[i]); - - // Convert and invert. - const p0 = curve.pointFromEdwards(q); - - return curve.pointToHash(p0, 0, rng); - } - - decodePoint(bytes) { - return EdwardsPoint.decode(this, bytes); - } - - toShort(a0, odd, sign = null) { - const [a, b] = this._short(a0, odd); - - const curve = new ShortCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h - }); - - if (sign != null) { - const [, u3] = curve._scale(this); - - if (u3.redIsOdd() !== sign) - u3.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromEdwards(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); - - return curve; - } - - toMont(b0, invert, sign = null) { - const [a, b] = this._mont(b0, invert); - - const curve = new MontCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - b: b, - n: this.n, - h: this.h, - z: this.z - }); - - if (sign != null) { - const c = this._scale(curve, invert); - - if (c.redIsOdd() !== sign) - c.redINeg(); - } - - if (!this.g.isInfinity()) - curve.g = curve.pointFromEdwards(this.g); - - for (let i = 0; i < this.h.word(0); i++) - curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); - - return curve; - } - - toEdwards(a0, sign = null) { - const [a, d] = this._edwards(a0); - - const curve = new EdwardsCurve({ - red: this.red, - prime: this.prime, - p: this.p, - a: a, - d: d, - n: this.n, - h: this.h, - z: this.z - }); - - if (sign != null) { - const c = curve._scale(this); - - if (c.redIsOdd() !== sign) - c.redINeg(); - } - - if (!this.g.isInfinity()) { - curve.g = curve.pointFromEdwards(this.g); - curve.g.normalize(); - } - - if (curve.isComplete()) { - for (let i = 0; i < this.h.word(0); i++) { - curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]); - curve.torsion[i].normalize(); - } - } - - return curve; - } - - pointFromJSON(json) { - return EdwardsPoint.fromJSON(this, json); - } - - toJSON(pre) { - const json = super.toJSON(pre); - - json.a = this.a.fromRed().toJSON(); - json.d = this.d.fromRed().toJSON(); - - if (!this.s.isZero()) - json.s = this.s.fromRed().toJSON(); - - return json; - } - } - - /** - * EdwardsPoint - */ - - class EdwardsPoint extends Point { - constructor(curve, x, y, z, t) { - assert(curve instanceof EdwardsCurve); - - super(curve, types.EXTENDED); - - this.x = this.curve.zero; - this.y = this.curve.one; - this.z = this.curve.one; - this.t = this.curve.zero; - this.zOne = true; - - if (x != null) - this._init(x, y, z, t); - } - - _init(x, y, z, t) { - assert(x instanceof BN); - assert(y instanceof BN); - assert(z == null || (z instanceof BN)); - assert(t == null || (t instanceof BN)); - - this.x = x; - this.y = y; - this.z = z || this.curve.one; - this.t = t || null; - - if (!this.x.red) - this.x = this.x.toRed(this.curve.red); - - if (!this.y.red) - this.y = this.y.toRed(this.curve.red); - - if (!this.z.red) - this.z = this.z.toRed(this.curve.red); - - if (this.t && !this.t.red) - this.t = this.t.toRed(this.curve.red); - - this.zOne = this.z.eq(this.curve.one); - - this._check(); - - if (!this.t) { - this.t = this.x.redMul(this.y); - if (!this.zOne) - this.t = this.t.redDiv(this.z); - } - } - - _check() { - // In order to achieve complete - // addition formulas, `a` must - // be a square (always the case - // for a=1), and `d` must be a - // non-square. - // - // If this is not the case, the - // addition formulas may have - // exceptional cases where Z3=0. - // - // In particular, this can occur - // when: Q*h = -P*h and Q != -P. - // - // This is assuming 4-torsion is - // involved (the 4-torsion point - // is _not_ representable when - // `d` is square). - if (this.z.isZero()) - throw new Error('Invalid point.'); - } - - clone() { - return this.curve.point(this.x, this.y, this.z, this.t); - } - - normalize() { - // https://hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#scaling-z - // 1I + 2M (+ 1M if extended) - - // Z1 = 1 - if (this.zOne) - return this; - - // A = 1 / Z1 - const a = this.z.redInvert(); - - // X3 = X1 * A - this.x = this.x.redMul(a); - - // Y3 = Y1 * A - this.y = this.y.redMul(a); - - // T3 = T1 * A - this.t = this.t.redMul(a); - - // Z3 = 1 - this.z = this.curve.one; - this.zOne = true; - - return this; - } - - scale(a) { - assert(a instanceof BN); - - // X3 = X1 * A - const nx = this.x.redMul(a); - - // Y3 = Y1 * A - const ny = this.y.redMul(a); - - // Z3 = Z1 * A - const nz = this.z.redMul(a); - - // T3 = T1 * A - const nt = this.t.redMul(a); - - return this.curve.point(nx, ny, nz, nt); - } - - neg() { - // -(X1, Y1, Z1, T1) = (-X1, Y1, Z1, -T1) - const nx = this.x.redNeg(); - const ny = this.y; - const nz = this.z; - const nt = this.t.redNeg(); - - return this.curve.point(nx, ny, nz, nt); - } - - add(p) { - assert(p instanceof EdwardsPoint); - - // P = O - if (this.isInfinity()) - return p; - - // Q = O - if (p.isInfinity()) - return this; - - // Z1 = 1 - if (this.zOne) - return p._add(this); - - return this._add(p); - } - - _add(p) { - // a = -1 - if (this.curve.mOneA) - return this._addM1(p); - - return this._addA(p); - } - - _addM1(p) { - // Assumes a = -1. - // - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-3 - // 8M + 8A + 1*k + 1*2 - // - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-madd-2008-hwcd-3 - // 7M + 8A + 1*k + 1*2 - - // A = (Y1 - X1) * (Y2 - X2) - const a = this.y.redSub(this.x).redMul(p.y.redSub(p.x)); - - // B = (Y1 + X1) * (Y2 + X2) - const b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x)); - - // C = T1 * k * T2 - const c = this.t.redMul(this.curve.k).redMul(p.t); - - // D = Z1 * 2 * Z2 - const d = p.zOne ? this.z.redAdd(this.z) : this.z.redMul(p.z).redIMuln(2); - - // E = B - A - const e = b.redSub(a); - - // F = D - C - const f = d.redSub(c); - - // G = D + C - const g = d.redIAdd(c); - - // H = B + A - const h = b.redIAdd(a); - - // X3 = E * F - const nx = e.redMul(f); - - // Y3 = G * H - const ny = g.redMul(h); - - // T3 = E * H - const nt = e.redMul(h); - - // Z3 = F * G - const nz = f.redMul(g); - - return this.curve.point(nx, ny, nz, nt); - } - - _addA(p) { - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd - // 9M + 7A + 1*a + 1*d - // - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-madd-2008-hwcd - // 8M + 7A + 1*a + 1*d - - // A = X1 * X2 - const a = this.x.redMul(p.x); - - // B = Y1 * Y2 - const b = this.y.redMul(p.y); - - // C = T1 * d * T2 - const c = this.curve._mulD(this.t).redMul(p.t); - - // D = Z1 * Z2 - const d = p.zOne ? this.z.clone() : this.z.redMul(p.z); - - // + XYXY = (X1 + Y1) * (X2 + Y2) - const xyxy = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)); - - // E = (X1 + Y1) * (X2 + Y2) - A - B - const e = xyxy.redISub(a).redISub(b); - - // F = D - C - const f = d.redSub(c); - - // G = D + C - const g = d.redIAdd(c); - - // H = B - a * A - const h = b.redISub(this.curve._mulA(a)); - - // X3 = E * F - const nx = e.redMul(f); - - // Y3 = G * H - const ny = g.redMul(h); - - // T3 = E * H - const nt = e.redMul(h); - - // Z3 = F * G - const nz = f.redMul(g); - - return this.curve.point(nx, ny, nz, nt); - } - - dbl() { - // P = O - if (this.isInfinity()) - return this; - - return this._dbl(); - } - - _dbl() { - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd - // 4M + 4S + 6A + 1*a + 1*2 - // - // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-mdbl-2008-hwcd - // 3M + 4S + 7A + 1*a + 1*2 - - // A = X1^2 - const a = this.x.redSqr(); - - // B = Y1^2 - const b = this.y.redSqr(); - - // C = 2 * Z1^2 - const c = this.zOne ? this.curve.two : this.z.redSqr().redIMuln(2); - - // D = a * A - const d = this.curve._mulA(a); - - // E = (X1 + Y1)^2 - A - B - const e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b); - - // G = D + B - const g = d.redAdd(b); - - // F = G - C - const f = g.redSub(c); - - // H = D - B - const h = d.redISub(b); - - // X3 = E * F - const nx = e.redMul(f); - - // Y3 = G * H - const ny = g.redMul(h); - - // T3 = E * H - const nt = e.redMul(h); - - // Z3 = F * G - const nz = f.redMul(g); - - return this.curve.point(nx, ny, nz, nt); - } - - getX() { - this.normalize(); - return this.x.fromRed(); - } - - getY() { - this.normalize(); - return this.y.fromRed(); - } - - eq(p) { - assert(p instanceof EdwardsPoint); - assert(!this.z.isZero()); - assert(!p.z.isZero()); - - // P = Q - if (this === p) - return true; - - // Z1 = Z2 - if (this.z.eq(p.z)) { - return this.x.eq(p.x) - && this.y.eq(p.y); - } - - // X1 * Z2 = X2 * Z1 - const x1 = this.x.redMul(p.z); - const x2 = p.x.redMul(this.z); - - if (!x1.eq(x2)) - return false; - - const y1 = this.y.redMul(p.z); - const y2 = p.y.redMul(this.z); - - return y1.eq(y2); - } - - cmp(point) { - assert(point instanceof EdwardsPoint); - - return this.order().cmp(point.order()) - || this.getY().cmp(point.getY()) - || this.getX().cmp(point.getX()); - } - - isInfinity() { - assert(!this.z.isZero()); - - // X1 = 0 - if (!this.x.isZero()) - return false; - - // Y1 = Z1 - return this.y.eq(this.z); - } - - isOrder2() { - if (this.isInfinity()) - return false; - - return this.x.isZero(); - } - - isOdd() { - this.normalize(); - return this.x.redIsOdd(); - } - - isEven() { - this.normalize(); - return this.x.redIsEven(); - } - - toP() { - return this.normalize(); - } - - toJ() { - return this; - } - - encode() { - // [RFC8032] Section 5.1.2. - const y = this.getY(); - - // Note: `x` normalized from `getY()` call. - y.setn(this.curve.signBit, this.x.redIsOdd()); - - return this.curve.encodeAdjusted(y); - } - - static decode(curve, bytes) { - // [RFC8032] Section 5.1.3. - assert(curve instanceof EdwardsCurve); - - const y = curve.decodeAdjusted(bytes); - const sign = y.testn(curve.signBit) !== 0; - - y.setn(curve.signBit, 0); - - if (y.cmp(curve.p) >= 0) - throw new Error('Invalid point.'); - - return curve.pointFromY(y, sign); - } - - toJSON(pre) { - if (this.isInfinity()) - return []; - - const x = this.getX().toJSON(); - const y = this.getY().toJSON(); - - if (pre === true && this.pre) - return [x, y, this.pre.toJSON()]; - - return [x, y]; - } - - toPretty() { - const size = this.curve.fieldSize * 2; - const x = toPretty(this.getX(), size); - const y = toPretty(this.getY(), size); - - return [x, y]; - } - - static fromJSON(curve, json) { - assert(curve instanceof EdwardsCurve); - assert(Array.isArray(json)); - assert(json.length === 0 - || json.length === 2 - || json.length === 3); - - if (json.length === 0) - return curve.point(); - - const x = BN.fromJSON(json[0]); - const y = BN.fromJSON(json[1]); - const point = curve.point(x, y); - - if (json.length > 2 && json[2] != null) - point.pre = Precomp.fromJSON(point, json[2]); - - return point; - } - - [custom]() { - if (this.isInfinity()) - return ''; - - return ''; - } - } - - /** - * Precomp - */ - - class Precomp { - constructor() { - this.naf = null; - this.windows = null; - this.doubles = null; - this.blinding = null; - this.beta = null; - } - - map(func) { - assert(typeof func === 'function'); - - const out = new this.constructor(); - - if (this.naf) - out.naf = this.naf.map(func); - - if (this.doubles) - out.doubles = this.doubles.map(func); - - return out; - } - - toJSON() { - return { - naf: this.naf ? this.naf.toJSON() : null, - windows: this.windows ? this.windows.toJSON() : null, - doubles: this.doubles ? this.doubles.toJSON() : null, - blinding: this.blinding ? this.blinding.toJSON() : undefined - }; - } - - fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - - if (json.naf != null) - this.naf = NAF.fromJSON(point, json.naf); - - if (json.windows != null) - this.windows = Windows.fromJSON(point, json.windows); - - if (json.doubles != null) - this.doubles = Doubles.fromJSON(point, json.doubles); - - if (json.blinding != null) - this.blinding = Blinding.fromJSON(point, json.blinding); - - return this; - } - - static fromJSON(point, json) { - return new this().fromJSON(point, json); - } - } - - /** - * NAF - */ - - class NAF { - constructor(width, points) { - this.width = width; - this.points = points; - } - - map(func) { - assert(typeof func === 'function'); - - const {width} = this; - const points = []; - - for (const point of this.points) - points.push(func(point)); - - return new this.constructor(width, points); - } - - toJSON() { - return { - width: this.width, - points: this.points.slice(1).map((point) => { - return point.toJSON(); - }) - }; - } - - static fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - assert((json.width >>> 0) === json.width); - assert(Array.isArray(json.points)); - - const {curve} = point; - const {width} = json; - const points = [point]; - - for (const item of json.points) - points.push(curve.pointFromJSON(item)); - - return new this(width, points); - } - } - - /** - * Windows - */ - - class Windows { - constructor(width, bits, points) { - this.width = width; - this.bits = bits; - this.points = points; - } - - toJSON() { - return { - width: this.width, - bits: this.bits, - points: this.points.slice(1).map((point) => { - return point.toJSON(); - }) - }; - } - - static fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - assert((json.width >>> 0) === json.width); - assert((json.bits >>> 0) === json.bits); - assert(Array.isArray(json.points)); - - const {curve} = point; - const {width, bits} = json; - const points = [point]; - - for (const item of json.points) - points.push(curve.pointFromJSON(item)); - - return new this(width, bits, points); - } - } - - /** - * Doubles - */ - - class Doubles { - constructor(step, points) { - this.step = step; - this.points = points; - } - - map(func) { - assert(typeof func === 'function'); - - const {step} = this; - const points = []; - - for (const point of this.points) - points.push(func(point)); - - return new this.constructor(step, points); - } - - toJSON() { - return { - step: this.step, - points: this.points.slice(1).map((point) => { - return point.toJSON(); - }) - }; - } - - static fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - assert((json.step >>> 0) === json.step); - assert(Array.isArray(json.points)); - - const {curve} = point; - const {step} = json; - const points = [point]; - - for (const item of json.points) - points.push(curve.pointFromJSON(item)); - - return new this(step, points); - } - } - - /** - * Blinding - */ - - class Blinding { - constructor(blind, unblind) { - this.blind = blind; - this.unblind = unblind; - } - - toJSON() { - return { - blind: this.blind.toJSON(), - unblind: this.unblind.toJSON() - }; - } - - static fromJSON(point, json) { - assert(point instanceof Point); - assert(json && typeof json === 'object'); - - const {curve} = point; - const blind = BN.fromJSON(json.blind); - const unblind = curve.pointFromJSON(json.unblind); - - return new this(blind, unblind); - } - } - - /** - * Endo - */ - - class Endo { - constructor(beta, lambda, basis, pre) { - this.beta = beta; - this.lambda = lambda; - this.basis = basis; - this.pre = pre; - } - - toJSON() { - return { - beta: this.beta.fromRed().toJSON(), - lambda: this.lambda.toJSON(), - basis: [ - this.basis[0].toJSON(), - this.basis[1].toJSON() - ], - pre: [ - this.pre[0], - this.pre[1].toJSON(), - this.pre[2].toJSON() - ] - }; - } - - static fromJSON(curve, json) { - assert(curve instanceof Curve); - assert(json && typeof json === 'object'); - assert(Array.isArray(json.basis)); - assert(Array.isArray(json.pre)); - assert(json.basis.length === 2); - assert(json.pre.length === 3); - assert((json.pre[0] >>> 0) === json.pre[0]); - - const beta = BN.fromJSON(json.beta).toRed(curve.red); - const lambda = BN.fromJSON(json.lambda); - - const basis = [ - Vector.fromJSON(json.basis[0]), - Vector.fromJSON(json.basis[1]) - ]; - - const pre = [ - json.pre[0], - BN.fromJSON(json.pre[1]), - BN.fromJSON(json.pre[2]) - ]; - - return new this(beta, lambda, basis, pre); - } - } - - /** - * Vector - */ - - class Vector { - constructor(a, b) { - this.a = a; - this.b = b; - } - - toJSON() { - return { - a: this.a.toJSON(), - b: this.b.toJSON() - }; - } - - static fromJSON(json) { - assert(json && typeof json === 'object'); - - const a = BN.fromJSON(json.a); - const b = BN.fromJSON(json.b); - - return new this(a, b); - } - } - - /** - * P192 - * https://tinyurl.com/fips-186-2 (page 29) - * https://tinyurl.com/fips-186-3 (page 88) - */ - - class P192 extends ShortCurve { - constructor(pre) { - super({ - id: 'P192', - ossl: 'prime192v1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: 'p192', - // 2^192 - 2^64 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff fffffffe', - 'ffffffff ffffffff'], - // -3 mod p - a: ['ffffffff ffffffff ffffffff fffffffe', - 'ffffffff fffffffc'], - b: ['64210519 e59c80e7 0fa7e9ab 72243049', - 'feb8deec c146b9b1'], - n: ['ffffffff ffffffff ffffffff 99def836', - '146bc9b1 b4d22831'], - h: '1', - // Icart - z: '-5', - g: [ - ['188da80e b03090f6 7cbf20eb 43a18800', - 'f4ff0afd 82ff1012'], - ['07192b95 ffc8da78 631011ed 6b24cdd5', - '73f977a1 1e794811'], - pre - ] - }); - } - } - - /** - * P224 - * https://tinyurl.com/fips-186-2 (page 30) - * https://tinyurl.com/fips-186-3 (page 88) - */ - - class P224 extends ShortCurve { - constructor(pre) { - super({ - id: 'P224', - ossl: 'secp224r1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: 'p224', - // 2^224 - 2^96 + 1 (1 mod 16) - p: ['ffffffff ffffffff ffffffff ffffffff', - '00000000 00000000 00000001'], - // -3 mod p - a: ['ffffffff ffffffff ffffffff fffffffe', - 'ffffffff ffffffff fffffffe'], - b: ['b4050a85 0c04b3ab f5413256 5044b0b7', - 'd7bfd8ba 270b3943 2355ffb4'], - n: ['ffffffff ffffffff ffffffff ffff16a2', - 'e0b8f03e 13dd2945 5c5c2a3d'], - h: '1', - // SSWU - z: '1f', - g: [ - ['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3', - '56c21122 343280d6 115c1d21'], - ['bd376388 b5f723fb 4c22dfe6 cd4375a0', - '5a074764 44d58199 85007e34'], - pre - ] - }); - } - } - - /** - * P256 - * https://tinyurl.com/fips-186-2 (page 31) - * https://tinyurl.com/fips-186-3 (page 89) - */ - - class P256 extends ShortCurve { - constructor(pre) { - super({ - id: 'P256', - ossl: 'prime256v1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: null, - // 2^256 - 2^224 + 2^192 + 2^96 - 1 (= 3 mod 4) - p: ['ffffffff 00000001 00000000 00000000', - '00000000 ffffffff ffffffff ffffffff'], - // -3 mod p - a: ['ffffffff 00000001 00000000 00000000', - '00000000 ffffffff ffffffff fffffffc'], - b: ['5ac635d8 aa3a93e7 b3ebbd55 769886bc', - '651d06b0 cc53b0f6 3bce3c3e 27d2604b'], - n: ['ffffffff 00000000 ffffffff ffffffff', - 'bce6faad a7179e84 f3b9cac2 fc632551'], - h: '1', - // SSWU - z: '-a', - g: [ - ['6b17d1f2 e12c4247 f8bce6e5 63a440f2', - '77037d81 2deb33a0 f4a13945 d898c296'], - ['4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16', - '2bce3357 6b315ece cbb64068 37bf51f5'], - pre - ] - }); - } - } - - /** - * P384 - * https://tinyurl.com/fips-186-2 (page 32) - * https://tinyurl.com/fips-186-3 (page 89) - */ - - class P384 extends ShortCurve { - constructor(pre) { - super({ - id: 'P384', - ossl: 'secp384r1', - type: 'short', - endian: 'be', - hash: 'SHA384', - prime: null, - // 2^384 - 2^128 - 2^96 + 2^32 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff fffffffe', - 'ffffffff 00000000 00000000 ffffffff'], - // -3 mod p - a: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff fffffffe', - 'ffffffff 00000000 00000000 fffffffc'], - b: ['b3312fa7 e23ee7e4 988e056b e3f82d19', - '181d9c6e fe814112 0314088f 5013875a', - 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'], - n: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff c7634d81 f4372ddf', - '581a0db2 48b0a77a ecec196a ccc52973'], - h: '1', - // Icart - z: '-c', - g: [ - ['aa87ca22 be8b0537 8eb1c71e f320ad74', - '6e1d3b62 8ba79b98 59f741e0 82542a38', - '5502f25d bf55296c 3a545e38 72760ab7'], - ['3617de4a 96262c6f 5d9e98bf 9292dc29', - 'f8f41dbd 289a147c e9da3113 b5f0b8c0', - '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'], - pre - ] - }); - } - } - - /** - * P521 - * https://tinyurl.com/fips-186-2 (page 33) - * https://tinyurl.com/fips-186-3 (page 90) - */ - - class P521 extends ShortCurve { - constructor(pre) { - super({ - id: 'P521', - ossl: 'secp521r1', - type: 'short', - endian: 'be', - hash: 'SHA512', - prime: 'p521', - // 2^521 - 1 (= 3 mod 4) - p: ['000001ff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff'], - // -3 mod p - a: ['000001ff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'fffffffc'], - b: ['00000051 953eb961 8e1c9a1f 929a21a0', - 'b68540ee a2da725b 99b315f3 b8b48991', - '8ef109e1 56193951 ec7e937b 1652c0bd', - '3bb1bf07 3573df88 3d2c34f1 ef451fd4', - '6b503f00'], - n: ['000001ff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'fffffffa 51868783 bf2f966b 7fcc0148', - 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e', - '91386409'], - h: '1', - // SSWU - z: '-4', - g: [ - ['000000c6 858e06b7 0404e9cd 9e3ecb66', - '2395b442 9c648139 053fb521 f828af60', - '6b4d3dba a14b5e77 efe75928 fe1dc127', - 'a2ffa8de 3348b3c1 856a429b f97e7e31', - 'c2e5bd66'], - ['00000118 39296a78 9a3bc004 5c8a5fb4', - '2c7d1bd9 98f54449 579b4468 17afbd17', - '273e662c 97ee7299 5ef42640 c550b901', - '3fad0761 353c7086 a272c240 88be9476', - '9fd16650'], - pre - ] - }); - } - } - - /** - * SECP256K1 - * https://www.secg.org/SEC2-Ver-1.0.pdf (page 15, section 2.7.1) - * https://www.secg.org/sec2-v2.pdf (page 9, section 2.4.1) - */ - - class SECP256K1 extends ShortCurve { - constructor(pre) { - super({ - id: 'SECP256K1', - ossl: 'secp256k1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: 'k256', - // 2^256 - 2^32 - 977 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe fffffc2f'], - a: '0', - b: '7', - n: ['ffffffff ffffffff ffffffff fffffffe', - 'baaedce6 af48a03b bfd25e8c d0364141'], - h: '1', - // SVDW - z: '1', - // sqrt(-3) - c: ['0a2d2ba9 3507f1df 233770c2 a797962c', - 'c61f6d15 da14ecd4 7d8d27ae 1cd5f852'], - g: [ - ['79be667e f9dcbbac 55a06295 ce870b07', - '029bfcdb 2dce28d9 59f2815b 16f81798'], - ['483ada77 26a3c465 5da4fbfc 0e1108a8', - 'fd17b448 a6855419 9c47d08f fb10d4b8'], - pre - ], - // Precomputed endomorphism. - endo: { - beta: ['7ae96a2b 657c0710 6e64479e ac3434e9', - '9cf04975 12f58995 c1396c28 719501ee'], - lambda: ['5363ad4c c05c30e0 a5261c02 8812645a', - '122e22ea 20816678 df02967c 1b23bd72'], - basis: [ - { - a: '3086d221a7d46bcde86c90e49284eb15', - b: '-e4437ed6010e88286f547fa90abfe4c3' - }, - { - a: '114ca50f7a8e2f3f657c1108d9d44cfd8', - b: '3086d221a7d46bcde86c90e49284eb15' - } - ], - pre: [ - 384, - ['3086d221 a7d46bcd e86c90e4 9284eb15', - '3daa8a14 71e8ca7f e893209a 45dbb031'], - ['-', - 'e4437ed6 010e8828 6f547fa9 0abfe4c4', - '221208ac 9df506c6 1571b4ae 8ac47f71'] - ] - } - }); - } - } - - /** - * BRAINPOOLP256 - * https://tools.ietf.org/html/rfc5639#section-3.4 - */ - - class BRAINPOOLP256 extends ShortCurve { - constructor(pre) { - super({ - id: 'BRAINPOOLP256', - ossl: 'brainpoolP256r1', - type: 'short', - endian: 'be', - hash: 'SHA256', - prime: null, - // (= 3 mod 4) - p: ['a9fb57db a1eea9bc 3e660a90 9d838d72', - '6e3bf623 d5262028 2013481d 1f6e5377'], - a: ['7d5a0975 fc2c3057 eef67530 417affe7', - 'fb8055c1 26dc5c6c e94a4b44 f330b5d9'], - b: ['26dc5c6c e94a4b44 f330b5d9 bbd77cbf', - '95841629 5cf7e1ce 6bccdc18 ff8c07b6'], - n: ['a9fb57db a1eea9bc 3e660a90 9d838d71', - '8c397aa3 b561a6f7 901e0e82 974856a7'], - h: '1', - // Icart - z: '-2', - g: [ - ['8bd2aeb9 cb7e57cb 2c4b482f fc81b7af', - 'b9de27e1 e3bd23c2 3a4453bd 9ace3262'], - ['547ef835 c3dac4fd 97f8461a 14611dc9', - 'c2774513 2ded8e54 5c1d54c7 2f046997'], - pre - ] - }); - } - } - - /** - * BRAINPOOLP384 - * https://tools.ietf.org/html/rfc5639#section-3.6 - */ - - class BRAINPOOLP384 extends ShortCurve { - constructor(pre) { - super({ - id: 'BRAINPOOLP384', - ossl: 'brainpoolP384r1', - type: 'short', - endian: 'be', - hash: 'SHA384', - prime: null, - // (= 3 mod 4) - p: ['8cb91e82 a3386d28 0f5d6f7e 50e641df', - '152f7109 ed5456b4 12b1da19 7fb71123', - 'acd3a729 901d1a71 87470013 3107ec53'], - a: ['7bc382c6 3d8c150c 3c72080a ce05afa0', - 'c2bea28e 4fb22787 139165ef ba91f90f', - '8aa5814a 503ad4eb 04a8c7dd 22ce2826'], - b: ['04a8c7dd 22ce2826 8b39b554 16f0447c', - '2fb77de1 07dcd2a6 2e880ea5 3eeb62d5', - '7cb43902 95dbc994 3ab78696 fa504c11'], - n: ['8cb91e82 a3386d28 0f5d6f7e 50e641df', - '152f7109 ed5456b3 1f166e6c ac0425a7', - 'cf3ab6af 6b7fc310 3b883202 e9046565'], - h: '1', - // SSWU - z: '-5', - g: [ - ['1d1c64f0 68cf45ff a2a63a81 b7c13f6b', - '8847a3e7 7ef14fe3 db7fcafe 0cbd10e8', - 'e826e034 36d646aa ef87b2e2 47d4af1e'], - ['8abe1d75 20f9c2a4 5cb1eb8e 95cfd552', - '62b70b29 feec5864 e19c054f f9912928', - '0e464621 77918111 42820341 263c5315'], - pre - ] - }); - } - } - - /** - * BRAINPOOLP512 - * https://tools.ietf.org/html/rfc5639#section-3.7 - */ - - class BRAINPOOLP512 extends ShortCurve { - constructor(pre) { - super({ - id: 'BRAINPOOLP512', - ossl: 'brainpoolP512r1', - type: 'short', - endian: 'be', - hash: 'SHA512', - prime: null, - // (= 3 mod 4) - p: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07', - 'cb308db3 b3c9d20e d6639cca 70330871', - '7d4d9b00 9bc66842 aecda12a e6a380e6', - '2881ff2f 2d82c685 28aa6056 583a48f3'], - a: ['7830a331 8b603b89 e2327145 ac234cc5', - '94cbdd8d 3df91610 a83441ca ea9863bc', - '2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5', - '7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca'], - b: ['3df91610 a83441ca ea9863bc 2ded5d5a', - 'a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7', - '2bf2c7b9 e7c1ac4d 77fc94ca dc083e67', - '984050b7 5ebae5dd 2809bd63 8016f723'], - n: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07', - 'cb308db3 b3c9d20e d6639cca 70330870', - '553e5c41 4ca92619 41866119 7fac1047', - '1db1d381 085ddadd b5879682 9ca90069'], - h: '1', - // Icart - z: '7', - g: [ - ['81aee4bd d82ed964 5a21322e 9c4c6a93', - '85ed9f70 b5d916c1 b43b62ee f4d0098e', - 'ff3b1f78 e2d0d48d 50d1687b 93b97d5f', - '7c6d5047 406a5e68 8b352209 bcb9f822'], - ['7dde385d 566332ec c0eabfa9 cf7822fd', - 'f209f700 24a57b1a a000c55b 881f8111', - 'b2dcde49 4a5f485e 5bca4bd8 8a2763ae', - 'd1ca2b2f a8f05406 78cd1e0f 3ad80892'], - pre - ] - }); - } - } - - /** - * X25519 - * https://tools.ietf.org/html/rfc7748#section-4.1 - */ - - class X25519 extends MontCurve { - constructor() { - super({ - id: 'X25519', - ossl: 'X25519', - type: 'mont', - endian: 'le', - hash: 'SHA512', - prime: 'p25519', - // 2^255 - 19 (= 5 mod 8) - p: ['7fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffed'], - // 486662 - a: '76d06', - b: '1', - n: ['10000000 00000000 00000000 00000000', - '14def9de a2f79cd6 5812631a 5cf5d3ed'], - h: '8', - // Elligator 2 - z: '2', - g: [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000009'], - // See: https://www.rfc-editor.org/errata/eid4730 - ['5f51e65e 475f794b 1fe122d3 88b72eb3', - '6dc2b281 92839e4d d6163a5d 81312c14'] - ], - torsion: [ - [], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000001'], - ['6be4f497 f9a9c2af c21fa77a d7f4a6ef', - '635a11c7 284a9363 e9a248ef 9c884415'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000001'], - ['141b0b68 06563d50 3de05885 280b5910', - '9ca5ee38 d7b56c9c 165db710 6377bbd8'] - ], - [ - ['57119fd0 dd4e22d8 868e1c58 c45c4404', - '5bef839c 55b1d0b1 248c50a3 bc959c5f'], - ['68c59389 3d458e64 31c6ca00 45fb5015', - '20a44346 8eaa68dd 0f103842 048065b7'] - ], - [ - ['57119fd0 dd4e22d8 868e1c58 c45c4404', - '5bef839c 55b1d0b1 248c50a3 bc959c5f'], - ['173a6c76 c2ba719b ce3935ff ba04afea', - 'df5bbcb9 71559722 f0efc7bd fb7f9a36'] - ], - [ - ['00b8495f 16056286 fdb1329c eb8d09da', - '6ac49ff1 fae35616 aeb8413b 7c7aebe0'], - ['3931c129 569e83a5 29482c14 e628b457', - '933bfc29 ed801b4d 68871483 92507b1a'] - ], - [ - ['00b8495f 16056286 fdb1329c eb8d09da', - '6ac49ff1 fae35616 aeb8413b 7c7aebe0'], - ['46ce3ed6 a9617c5a d6b7d3eb 19d74ba8', - '6cc403d6 127fe4b2 9778eb7c 6daf84d3'] - ] - ] - }); - } - } - - /** - * X448 - * https://tools.ietf.org/html/rfc7748#section-4.2 - */ - - class X448 extends MontCurve { - constructor() { - super({ - id: 'X448', - ossl: 'X448', - type: 'mont', - endian: 'le', - hash: 'SHAKE256', - prime: 'p448', - // 2^448 - 2^224 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff'], - // 156326 - a: '262a6', - b: '1', - n: ['3fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 7cca23e9', - 'c44edb49 aed63690 216cc272 8dc58f55', - '2378c292 ab5844f3'], - h: '4', - // Elligator 2 - z: '-1', - g: [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000005'], - ['7d235d12 95f5b1f6 6c98ab6e 58326fce', - 'cbae5d34 f55545d0 60f75dc2 8df3f6ed', - 'b8027e23 46430d21 1312c4b1 50677af7', - '6fd7223d 457b5b1a'] - ], - torsion: [ - [], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['ba4d3a08 29b6112f 8812e51b a0bb2abe', - 'bc1cb08e b48e5569 36ba50fd d2e7d68a', - 'f8cb3216 0522425b 3f990812 abbe635a', - 'd37a21e1 7551b193'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['45b2c5f7 d649eed0 77ed1ae4 5f44d541', - '43e34f71 4b71aa96 c945af01 2d182975', - '0734cde9 faddbda4 c066f7ed 54419ca5', - '2c85de1e 8aae4e6c'] - ] - ] - }); - } - } - - /** - * MONT448 - * Isomorphic to Ed448-Goldilocks. - */ - - class MONT448 extends MontCurve { - constructor() { - super({ - id: 'MONT448', - ossl: null, - type: 'mont', - endian: 'le', - hash: 'SHAKE256', - prime: 'p448', - // 2^448 - 2^224 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff'], - // -78160 / -39082 mod p - a: ['b2cf97d2 d43459a9 31ed36b1 fc4e3cb5', - '5d93f8d2 22746997 60ccffc6 49961ed6', - 'c5b05fca c24864ed 6fb59697 931b78da', - '84ddecd8 ca2b5cfb'], - b: '1', - n: ['3fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 7cca23e9', - 'c44edb49 aed63690 216cc272 8dc58f55', - '2378c292 ab5844f3'], - h: '4', - // Elligator 2 - z: '-1', - g: [ - ['ac0d24cc c6c75cb0 eb71f81e 7a6edf51', - '48e88aee 009a2a24 e795687e c28e125a', - '3e6730a6 0d46367b aa7fe99d 152128dc', - '41321bc7 7817f059'], - ['5a4437f6 80c0d0db 9b061276 d5d0ffcc', - 'e786ff33 b6a53d30 98746425 82e66f09', - '4433dae7 7244a6e2 6b11e905 7228f483', - '556c41a5 913f55fe'] - ], - torsion: [ - [], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['bec92fd0 6da2acf2 b4e261e8 7cef0d34', - '22e75c18 3c589857 b71924e5 73c2f9ce', - 'e18da5f2 466e2f39 3c2eedf0 f105a60a', - 'b40c717d 4f1e1fd7'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['4136d02f 925d530d 4b1d9e17 8310f2cb', - 'dd18a3e7 c3a767a8 48e6db19 8c3d0631', - '1e725a0d b991d0c6 c3d1120f 0efa59f5', - '4bf38e82 b0e1e028'] - ] - ] - }); - } - } - - /** - * ED25519 - * https://tools.ietf.org/html/rfc8032#section-5.1 - */ - - class ED25519 extends EdwardsCurve { - constructor(pre) { - super({ - id: 'ED25519', - ossl: 'ED25519', - type: 'edwards', - endian: 'le', - hash: 'SHA512', - prefix: 'SigEd25519 no Ed25519 collisions', - context: false, - prime: 'p25519', - // 2^255 - 19 (= 5 mod 8) - p: ['7fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffed'], - a: '-1', - // -121665 / 121666 mod p - d: ['52036cee 2b6ffe73 8cc74079 7779e898', - '00700a4d 4141d8ab 75eb4dca 135978a3'], - n: ['10000000 00000000 00000000 00000000', - '14def9de a2f79cd6 5812631a 5cf5d3ed'], - h: '8', - // Elligator 2 - z: '2', - g: [ - ['216936d3 cd6e53fe c0a4e231 fdd6dc5c', - '692cc760 9525a7b2 c9562d60 8f25d51a'], - // 4/5 - ['66666666 66666666 66666666 66666666', - '66666666 66666666 66666666 66666658'], - pre - ], - torsion: [ - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000001'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'], - ['7fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff ffffffec'] - ], - [ - ['2b832480 4fc1df0b 2b4d0099 3dfbd7a7', - '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'] - ], - [ - ['547cdb7f b03e20f4 d4b2ff66 c2042858', - 'd0bce7f9 52d01b87 3b11e4d8 b5f15f3d'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000'] - ], - [ - ['1fd5b9a0 06394a28 e9339932 38de4abb', - '5c193c70 13e5e238 dea14646 c545d14a'], - ['05fc536d 880238b1 3933c6d3 05acdfd5', - 'f098eff2 89f4c345 b027b2c2 8f95e826'] - ], - [ - ['602a465f f9c6b5d7 16cc66cd c721b544', - 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'], - ['05fc536d 880238b1 3933c6d3 05acdfd5', - 'f098eff2 89f4c345 b027b2c2 8f95e826'] - ], - [ - ['1fd5b9a0 06394a28 e9339932 38de4abb', - '5c193c70 13e5e238 dea14646 c545d14a'], - ['7a03ac92 77fdc74e c6cc392c fa53202a', - '0f67100d 760b3cba 4fd84d3d 706a17c7'] - ], - [ - ['602a465f f9c6b5d7 16cc66cd c721b544', - 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'], - ['7a03ac92 77fdc74e c6cc392c fa53202a', - '0f67100d 760b3cba 4fd84d3d 706a17c7'] - ] - ] - }); - } - } - - /** - * ISO448 - * https://tools.ietf.org/html/rfc7748#section-4.2 - * https://git.zx2c4.com/goldilocks/tree/_aux/ristretto/ristretto.sage#n658 - */ - - class ISO448 extends EdwardsCurve { - constructor(pre) { - super({ - id: 'ISO448', - ossl: null, - type: 'edwards', - endian: 'le', - hash: 'SHAKE256', - prefix: 'SigEd448', - context: true, - prime: 'p448', - // 2^448 - 2^224 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff'], - a: '1', - // 39082 / 39081 mod p - d: ['d78b4bdc 7f0daf19 f24f38c2 9373a2cc', - 'ad461572 42a50f37 809b1da3 412a12e7', - '9ccc9c81 264cfe9a d0809970 58fb61c4', - '243cc32d baa156b9'], - n: ['3fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 7cca23e9', - 'c44edb49 aed63690 216cc272 8dc58f55', - '2378c292 ab5844f3'], - h: '4', - // Elligator 2 - z: '-1', - g: [ - ['79a70b2b 70400553 ae7c9df4 16c792c6', - '1128751a c9296924 0c25a07d 728bdc93', - 'e21f7787 ed697224 9de732f3 8496cd11', - '69871309 3e9c04fc'], - // Note: the RFC has this wrong. - ['7fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 80000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'], - pre - ], - torsion: [ - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ] - ] - }); - } - } - - /** - * ED448 - * https://tools.ietf.org/html/rfc8032#section-5.2 - */ - - class ED448 extends EdwardsCurve { - constructor(pre) { - super({ - id: 'ED448', - ossl: 'ED448', - type: 'edwards', - endian: 'le', - hash: 'SHAKE256', - prefix: 'SigEd448', - context: true, - prime: 'p448', - // 2^448 - 2^224 - 1 (= 3 mod 4) - p: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff'], - a: '1', - // -39081 mod p - d: ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffff6756'], - n: ['3fffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff ffffffff 7cca23e9', - 'c44edb49 aed63690 216cc272 8dc58f55', - '2378c292 ab5844f3'], - h: '4', - // Elligator 2 - z: '-1', - g: [ - ['4f1970c6 6bed0ded 221d15a6 22bf36da', - '9e146570 470f1767 ea6de324 a3d3a464', - '12ae1af7 2ab66511 433b80e1 8b00938e', - '2626a82b c70cc05e'], - ['693f4671 6eb6bc24 88762037 56c9c762', - '4bea7373 6ca39840 87789c1e 05a0c2d7', - '3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad', - '9808795b f230fa14'], - pre - ], - torsion: [ - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'], - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'] - ], - [ - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000001'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ], - [ - ['ffffffff ffffffff ffffffff ffffffff', - 'ffffffff ffffffff fffffffe ffffffff', - 'ffffffff ffffffff ffffffff ffffffff', - 'ffffffff fffffffe'], - ['00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000 00000000 00000000', - '00000000 00000000'] - ] - ] - }); - } - } - - /* - * Curve Registry - */ - - const curves = { - __proto__: null, - P192, - P224, - P256, - P384, - P521, - SECP256K1, - BRAINPOOLP256, - BRAINPOOLP384, - BRAINPOOLP512, - X25519, - X448, - MONT448, - ED25519, - ISO448, - ED448 - }; - - const cache = { - __proto__: null, - P192: null, - P224: null, - P256: null, - P384: null, - P521: null, - SECP256K1: null, - BRAINPOOLP256: null, - BRAINPOOLP384: null, - BRAINPOOLP512: null, - X25519: null, - X448: null, - MONT448: null, - ED25519: null, - ISO448: null, - ED448: null - }; - - function curve(name, ...args) { - assert(typeof name === 'string'); - - const key = name.toUpperCase(); - - let curve = cache[key]; - - if (!curve) { - const Curve = curves[key]; - - if (!Curve) - throw new Error(`Curve not found: "${name}".`); - - curve = new Curve(...args); - cache[key] = curve; - } - - return curve; - } - - function register(name, Curve) { - assert(typeof name === 'string'); - assert(typeof Curve === 'function'); - - const key = name.toUpperCase(); - - if (curves[key]) - throw new Error(`Curve already registered: "${name}".`); - - curves[key] = Curve; - cache[key] = null; - } - - /* - * Scalar Recoding - */ - - function getNAF(k, width, max) { - // Computing the width-w NAF of a positive integer. - // - // [GECC] Algorithm 3.35, Page 100, Section 3.3. - // - // The above document describes a rather abstract - // method of recoding. The more optimal method - // below was ported from libsecp256k1. - assert(k instanceof BN); - assert(!k.red); - assert((width >>> 0) === width); - assert((max >>> 0) === max); - - const naf = new Array(max); - const bits = k.bitLength() + 1; - const sign = k.sign() | 1; - - assert(bits <= max); - - for (let i = 0; i < max; i++) - naf[i] = 0; - - let i = 0; - let carry = 0; - let word; - - while (i < bits) { - if (k.bit(i) === carry) { - i += 1; - continue; - } - - word = k.bits(i, width) + carry; - carry = (word >> (width - 1)) & 1; - word -= carry << width; - - naf[i] = sign * word; - - i += width; - } - - assert(carry === 0); - - return naf; - } - - function getFixedNAF(k, width, max, step) { - assert((step >>> 0) === step); - - // Recode to NAF. - const naf = getNAF(k, width, max); - - // Translate into more windowed form. - const len = Math.ceil(naf.length / step); - const repr = new Array(len); - - let i = 0; - - for (let j = 0; j < naf.length; j += step) { - let nafW = 0; - - for (let k = j + step - 1; k >= j; k--) - nafW = (nafW << 1) + naf[k]; - - repr[i++] = nafW; - } - - assert(i === len); - - return repr; - } - - function getJSF(k1, k2, max) { - // Joint sparse form. - // - // [GECC] Algorithm 3.50, Page 111, Section 3.3. - assert(k1 instanceof BN); - assert(k2 instanceof BN); - assert(!k1.red); - assert(!k2.red); - assert((max >>> 0) === max); - - const jsf = [new Array(max), new Array(max)]; - const bits = Math.max(k1.bitLength(), k2.bitLength()) + 1; - const s1 = k1.sign() | 1; - const s2 = k2.sign() | 1; - - assert(bits <= max); - - let d1 = 0; - let d2 = 0; - - for (let i = 0; i < bits; i++) { - const b1 = k1.bits(i, 3); - const b2 = k2.bits(i, 3); - - // First phase. - let m14 = ((b1 & 3) + d1) & 3; - let m24 = ((b2 & 3) + d2) & 3; - let u1 = 0; - let u2 = 0; - - if (m14 === 3) - m14 = -1; - - if (m24 === 3) - m24 = -1; - - if (m14 & 1) { - const m8 = ((b1 & 7) + d1) & 7; - - if ((m8 === 3 || m8 === 5) && m24 === 2) - u1 = -m14; - else - u1 = m14; - } - - if (m24 & 1) { - const m8 = ((b2 & 7) + d2) & 7; - - if ((m8 === 3 || m8 === 5) && m14 === 2) - u2 = -m24; - else - u2 = m24; - } - - jsf[0][i] = u1 * s1; - jsf[1][i] = u2 * s2; - - // Second phase. - if (2 * d1 === 1 + u1) - d1 = 1 - d1; - - if (2 * d2 === 1 + u2) - d2 = 1 - d2; - } - - for (let i = bits; i < max; i++) { - jsf[0][i] = 0; - jsf[1][i] = 0; - } - - return jsf; - } - - function getJNAF(c1, c2, max) { - const jsf = getJSF(c1, c2, max); - const naf = new Array(max); - - // JSF -> NAF conversion. - for (let i = 0; i < max; i++) { - const ja = jsf[0][i]; - const jb = jsf[1][i]; - - naf[i] = jsfIndex[(ja + 1) * 3 + (jb + 1)]; - } - - return naf; - } - - /* - * Helpers - */ - - function assert(val, msg) { - if (!val) { - const err = new Error(msg || 'Assertion failed'); - - if (Error.captureStackTrace) - Error.captureStackTrace(err, assert); - - throw err; - } - } - - function wrapErrors(fn) { - assert(typeof fn === 'function'); - - try { - return fn(); - } catch (e) { - if (e.message === 'X is not a square mod P.' - || e.message === 'Not invertible.') { - throw new Error('Invalid point.'); - } - throw e; - } - } - - function mod(x, y) { - // Euclidean modulo. - let r = x % y; - - if (r < 0) { - r += y; - } - - return r; - } - - function cubeRoot(x) { - assert(x instanceof BN); - assert(x.red); - - const p = x.red.m; - - if (p.cmpn(3) <= 0) - return x.clone(); - - // p = 2 mod 3 - if (p.modrn(3) === 2) { - // e = (2 * p - 1) / 3 - const e = p.ushln(1).isubn(1).idivn(3); - return x.redPow(e); - } - - const mod9 = p.modrn(9); - - // p = 4 mod 9 - if (mod9 === 4) { - // e = (2 * p + 1) / 9 - const e = p.ushln(1).iaddn(1).idivn(9); - const r = x.redPow(e); - const c = r.redSqr().redMul(r); - - if (!c.eq(x)) - throw new Error('X is not a cube mod P.'); - - return r; - } - - // p = 7 mod 9 - if (mod9 === 7) { - // e = (p + 2) / 9 - const e = p.addn(2).idivn(9); - const r = x.redPow(e); - const c = r.redSqr().redMul(r); - - if (!c.eq(x)) - throw new Error('X is not a cube mod P.'); - - return r; - } - - throw new Error('Not implemented.'); - } - - function cubeRoots(x) { - const r0 = cubeRoot(x); - - // p = 1 mod 3 - if (x.red.m.modrn(3) === 1) { - // Multiply by roots of unity to find other roots. - const two = new BN(2).toRed(x.red); - const three = new BN(3).toRed(x.red); - const i2 = two.redInvert(); - const s1 = three.redNeg().redSqrt().redMul(i2); - const s2 = s1.redNeg(); - const u1 = s1.redSub(i2); - const u2 = s2.redSub(i2); - const r1 = r0.redMul(u1); - const r2 = r0.redMul(u2); - - return [r0, r1, r2]; - } - - // p = 2 mod 3 guarantees 1 cube root per element. - return [r0]; - } - - function uncube(x) { - // Find a cube root which is also a quadratic residue. - for (const root of cubeRoots(x)) { - if (root.redJacobi() >= 0) - return root; - } - - throw new Error('X^(1/3) is not a square mod P.'); - } - - function randomInt(rng) { - return BN.randomBits(rng, 32).toNumber(); - } - - function memoize(method, self) { - const cache = new WeakMap(); - - return function memoized(curve, invert) { - const i = invert & 1; - const item = cache.get(curve); - - if (item && item[i] !== null) - return item[i]; - - const result = method.call(self, curve, invert); - - if (!cache.has(curve)) - cache.set(curve, [null, null]); - - cache.get(curve)[i] = result; - - return result; - }; - } - - function toPretty(x, size) { - assert(x instanceof BN); - assert((size >>> 0) === size); - - if (size & 7) - size += 8 - (size & 7); - - const str = x.toString(16, size); - const chunks = []; - const out = []; - - assert((str.length & 7) === 0); - - for (let i = 0; i < str.length; i += 8) - chunks.push(str.slice(i, i + 8)); - - for (let i = 0; i < chunks.length; i += 4) - out.push(chunks.slice(i, i + 4).join(' ')); - - return out; - } - - /* - * Expose - */ - - elliptic.Curve = Curve; - elliptic.Point = Point; - elliptic.ShortCurve = ShortCurve; - elliptic.ShortPoint = ShortPoint; - elliptic.JPoint = JPoint; - elliptic.MontCurve = MontCurve; - elliptic.MontPoint = MontPoint; - elliptic.XPoint = XPoint; - elliptic.EdwardsCurve = EdwardsCurve; - elliptic.EdwardsPoint = EdwardsPoint; - elliptic.curves = curves; - elliptic.curve = curve; - elliptic.register = register; - return elliptic; - } - - var random = {}; - - var hasRequiredRandom; - - function requireRandom () { - if (hasRequiredRandom) return random; - hasRequiredRandom = 1; - - const assert = requireAssert(); - - /* - * Constants - */ - - const crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto; - const HAS_CRYPTO = crypto && typeof crypto.getRandomValues === 'function'; - const randomValues = HAS_CRYPTO ? crypto.getRandomValues.bind(crypto) : null; - const pool = new Uint32Array(16); - const MAX_BYTES = 65536; - - let poolPos = 0; - - /** - * Generate pseudo-random bytes. - * @param {Number} size - * @returns {Buffer} - */ - - function randomBytes(size) { - assert((size >>> 0) === size); - - const data = bufferExports.Buffer.alloc(size); - - randomFillSync(data, 0, size); - - return data; - } - - /** - * Generate pseudo-random bytes. - * @param {Buffer} data - * @param {Number} [off=0] - * @param {Number} [size=data.length-off] - * @returns {Buffer} - */ - - function randomFill(data, off, size) { - assert(bufferExports.Buffer.isBuffer(data)); - - if (off == null) - off = 0; - - assert((off >>> 0) === off); - - if (size == null) - size = data.length - off; - - assert((size >>> 0) === size); - assert(off + size <= data.length); - - randomFillSync(data, off, size); - - return data; - } - - /** - * Generate a random uint32. - * @returns {Number} - */ - - function randomInt() { - if ((poolPos & 15) === 0) { - getRandomValues(pool); - poolPos = 0; - } - - return pool[poolPos++]; - } - - /** - * Generate a random uint32 within a range. - * @param {Number} min - Inclusive. - * @param {Number} max - Exclusive. - * @returns {Number} - */ - - function randomRange(min, max) { - assert((min >>> 0) === min); - assert((max >>> 0) === max); - assert(max >= min); - - const space = max - min; - - if (space === 0) - return min; - - const top = -space >>> 0; - - let x, r; - - do { - x = randomInt(); - r = x % space; - } while (x - r > top); - - return r + min; - } - - /* - * Helpers - */ - - function getRandomValues(array) { - if (!HAS_CRYPTO) - throw new Error('Entropy source not available.'); - - return randomValues(array); - } - - function randomFillSync(data, off, size) { - assert(bufferExports.Buffer.isBuffer(data)); - assert(data.buffer instanceof ArrayBuffer); - assert((data.byteOffset >>> 0) === data.byteOffset); - assert((data.byteLength >>> 0) === data.byteLength); - assert((off >>> 0) === off); - assert((size >>> 0) === size); - assert(off + size <= data.byteLength); - - if (size > 2 ** 31 - 1) - throw new RangeError('The value "size" is out of range.'); - - const offset = data.byteOffset + off; - const array = new Uint8Array(data.buffer, offset, size); - - if (array.length > MAX_BYTES) { - for (let i = 0; i < array.length; i += MAX_BYTES) { - let j = i + MAX_BYTES; - - if (j > array.length) - j = array.length; - - getRandomValues(array.subarray(i, j)); - } - } else { - if (array.length > 0) - getRandomValues(array); - } - } - - /* - * Expose - */ - - random.native = 0; - random.randomBytes = randomBytes; - random.randomFill = randomFill; - random.randomInt = randomInt; - random.randomRange = randomRange; - return random; - } - - /*! - * random.js - random for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var randomBrowser; - var hasRequiredRandomBrowser; - - function requireRandomBrowser () { - if (hasRequiredRandomBrowser) return randomBrowser; - hasRequiredRandomBrowser = 1; - - randomBrowser = requireRandom(); - return randomBrowser; - } - - var eddsa; - var hasRequiredEddsa; - - function requireEddsa () { - if (hasRequiredEddsa) return eddsa; - hasRequiredEddsa = 1; - - const assert = requireAssert(); - const BatchRNG = requireBatchRng(); - const BN = requireBnBrowser(); - const elliptic = requireElliptic(); - const rng = requireRandomBrowser(); - - /* - * EDDSA - */ - - class EDDSA { - constructor(id, mid, eid, hash, pre) { - assert(typeof id === 'string'); - assert(!mid || typeof mid === 'string'); - assert(!eid || typeof eid === 'string'); - assert(hash); - - this.id = id; - this.type = 'eddsa'; - this.mid = mid || null; - this.eid = eid || null; - this.hash = hash; - this.native = 0; - - this._pre = pre || null; - this._curve = null; - this._mont = null; - this._iso = null; - this._rng = null; - } - - get curve() { - if (!this._curve) { - this._curve = elliptic.curve(this.id, this._pre); - this._curve.precompute(rng); - this._pre = null; - } - return this._curve; - } - - get mont() { - if (this.mid && !this._mont) - this._mont = elliptic.curve(this.mid); - return this._mont; - } - - get iso() { - if (!this.eid) - return this.mont; - - if (!this._iso) - this._iso = elliptic.curve(this.eid); - - return this._iso; - } - - get rng() { - if (!this._rng) - this._rng = new BatchRNG(this.curve); - - return this._rng; - } - - get size() { - return this.curve.adjustedSize; - } - - get bits() { - return this.curve.fieldBits; - } - - hashNonce(prefix, msg, ph, ctx) { - const hash = new Hash(this); - - hash.init(ph, ctx); - hash.update(prefix); - hash.update(msg); - - return hash.final(); - } - - hashChallenge(R, A, m, ph, ctx) { - const hash = new Hash(this); - - hash.init(ph, ctx); - hash.update(R); - hash.update(A); - hash.update(m); - - return hash.final(); - } - - privateKeyGenerate() { - return rng.randomBytes(this.curve.adjustedSize); - } - - scalarGenerate() { - const scalar = rng.randomBytes(this.curve.scalarSize); - return this.curve.clamp(scalar); - } - - privateKeyExpand(secret) { - assert(bufferExports.Buffer.isBuffer(secret)); - assert(secret.length === this.curve.adjustedSize); - - const hash = this.hash.digest(secret, this.curve.adjustedSize * 2); - - return this.curve.splitHash(hash); - } - - privateKeyConvert(secret) { - const [key] = this.privateKeyExpand(secret); - return key; - } - - privateKeyVerify(secret) { - assert(bufferExports.Buffer.isBuffer(secret)); - return secret.length === this.curve.adjustedSize; - } - - scalarVerify(scalar) { - assert(bufferExports.Buffer.isBuffer(scalar)); - return scalar.length === this.curve.scalarSize; - } - - scalarIsZero(scalar) { - assert(bufferExports.Buffer.isBuffer(scalar)); - - let k; - try { - k = this.curve.decodeScalar(scalar).imod(this.curve.n); - } catch (e) { - return false; - } - - return k.isZero(); - } - - scalarClamp(scalar) { - assert(bufferExports.Buffer.isBuffer(scalar)); - assert(scalar.length === this.curve.scalarSize); - - return this.curve.clamp(bufferExports.Buffer.from(scalar)); - } - - privateKeyExport(secret) { - const pub = this.publicKeyCreate(secret); - const {x, y} = this.publicKeyExport(pub); - - return { - d: bufferExports.Buffer.from(secret), - x, - y - }; - } - - privateKeyImport(json) { - assert(json && typeof json === 'object'); - assert(bufferExports.Buffer.isBuffer(json.d)); - - if (json.d.length !== this.curve.adjustedSize) - throw new Error('Invalid private key.'); - - return bufferExports.Buffer.from(json.d); - } - - scalarTweakAdd(scalar, tweak) { - const a = this.curve.decodeScalar(scalar); - const t = this.curve.decodeScalar(tweak); - const k = a.add(t).imod(this.curve.n); - - return this.curve.encodeScalar(k); - } - - scalarTweakMul(scalar, tweak) { - const a = this.curve.decodeScalar(scalar); - const t = this.curve.decodeScalar(tweak); - const k = a.mul(t).imod(this.curve.n); - - return this.curve.encodeScalar(k); - } - - scalarReduce(scalar) { - const a = this.curve.decodeScalar(scalar); - const k = a.imod(this.curve.n); - - return this.curve.encodeScalar(k); - } - - scalarNegate(scalar) { - const a = this.curve.decodeScalar(scalar).imod(this.curve.n); - const k = a.neg().imod(this.curve.n); - - return this.curve.encodeScalar(k); - } - - scalarInvert(scalar) { - const a = this.curve.decodeScalar(scalar).imod(this.curve.n); - - if (a.isZero()) - return this.curve.encodeScalar(a); - - const k = a.invert(this.curve.n); - - return this.curve.encodeScalar(k); - } - - publicKeyCreate(secret) { - const key = this.privateKeyConvert(secret); - return this.publicKeyFromScalar(key); - } - - publicKeyFromScalar(scalar) { - const a = this.curve.decodeScalar(scalar).imod(this.curve.n); - const A = this.curve.g.mulBlind(a); - - return A.encode(); - } - - publicKeyConvert(key) { - if (!this.mont) - throw new Error('No equivalent montgomery curve.'); - - const A = this.curve.decodePoint(key); - const P = this.mont.pointFromEdwards(A); - - return P.encode(); - } - - publicKeyFromUniform(bytes) { - const u = this.curve.decodeUniform(bytes); - const A = this.curve.pointFromUniform(u, this.iso); - - return A.encode(); - } - - publicKeyToUniform(key, hint = rng.randomInt()) { - const A = this.curve.decodePoint(key); - const u = this.curve.pointToUniform(A, hint, this.iso); - - return this.curve.encodeUniform(u, hint >>> 8); - } - - publicKeyFromHash(bytes, pake = false) { - const A = this.curve.pointFromHash(bytes, pake, this.iso); - return A.encode(); - } - - publicKeyToHash(key, subgroup = rng.randomInt()) { - const A = this.curve.decodePoint(key); - return this.curve.pointToHash(A, subgroup, rng, this.iso); - } - - publicKeyVerify(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - try { - this.curve.decodePoint(key); - } catch (e) { - return false; - } - - return true; - } - - publicKeyIsInfinity(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - let A; - try { - A = this.curve.decodePoint(key); - } catch (e) { - return false; - } - - return A.isInfinity(); - } - - publicKeyIsSmall(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - let A; - try { - A = this.curve.decodePoint(key); - } catch (e) { - return false; - } - - return A.isSmall(); - } - - publicKeyHasTorsion(key) { - assert(bufferExports.Buffer.isBuffer(key)); - - let A; - try { - A = this.curve.decodePoint(key); - } catch (e) { - return false; - } - - return A.hasTorsion(); - } - - publicKeyExport(key) { - const {x, y} = this.curve.decodePoint(key); - - return { - x: this.curve.encodeField(x.fromRed()), - y: this.curve.encodeField(y.fromRed()) - }; - } - - publicKeyImport(json) { - assert(json && typeof json === 'object'); - - let x = null; - let y = null; - let A; - - if (json.x != null) { - x = BN.decode(json.x, this.curve.endian); - - if (x.cmp(this.curve.p) >= 0) - throw new Error('Invalid point.'); - } - - if (json.y != null) { - y = BN.decode(json.y, this.curve.endian); - - if (y.cmp(this.curve.p) >= 0) - throw new Error('Invalid point.'); - } - - if (x && y) { - A = this.curve.point(x, y); - - if (!A.validate()) - throw new Error('Invalid point.'); - } else if (x) { - A = this.curve.pointFromX(x, json.sign); - } else if (y) { - A = this.curve.pointFromY(y, json.sign); - } else { - throw new Error('Invalid point.'); - } - - return A.encode(); - } - - publicKeyTweakAdd(key, tweak) { - const t = this.curve.decodeScalar(tweak).imod(this.curve.n); - const A = this.curve.decodePoint(key); - const T = this.curve.g.mul(t); - const P = T.add(A); - - return P.encode(); - } - - publicKeyTweakMul(key, tweak) { - const t = this.curve.decodeScalar(tweak); - const A = this.curve.decodePoint(key); - const P = A.mul(t); - - return P.encode(); - } - - publicKeyCombine(keys) { - assert(Array.isArray(keys)); - - let P = this.curve.point(); - - for (const key of keys) { - const A = this.curve.decodePoint(key); - - P = P.add(A); - } - - return P.encode(); - } - - publicKeyNegate(key) { - const A = this.curve.decodePoint(key); - const P = A.neg(); - - return P.encode(); - } - - sign(msg, secret, ph, ctx) { - const [key, prefix] = this.privateKeyExpand(secret); - return this.signWithScalar(msg, key, prefix, ph, ctx); - } - - signWithScalar(msg, scalar, prefix, ph, ctx) { - // EdDSA Signing. - // - // [EDDSA] Page 12, Section 4. - // [RFC8032] Page 8, Section 3.3. - // - // Assumptions: - // - // - Let `H` be a cryptographic hash function. - // - Let `m` be a byte array of arbitrary size. - // - Let `a` be a secret scalar. - // - Let `w` be a secret byte array. - // - // Computation: - // - // k = H(w, m) mod n - // R = G * k - // A = G * a - // e = H(R, A, m) mod n - // s = (k + e * a) mod n - // S = (R, s) - // - // Note that `k` must remain secret, - // otherwise an attacker can compute: - // - // a = (s - k) / e mod n - // - // The same is true of `w` as `k` - // can be re-derived as `H(w, m)`. - if (ctx == null) - ctx = bufferExports.Buffer.alloc(0); - - assert(bufferExports.Buffer.isBuffer(msg)); - assert(bufferExports.Buffer.isBuffer(prefix)); - assert(prefix.length === this.curve.adjustedSize); - - const {n} = this.curve; - const G = this.curve.g; - const k = this.hashNonce(prefix, msg, ph, ctx); - const Rraw = G.mulBlind(k).encode(); - const a = this.curve.decodeScalar(scalar); - const Araw = G.mulBlind(a).encode(); - const e = this.hashChallenge(Rraw, Araw, msg, ph, ctx); - const s = k.add(e.mul(a)).imod(n); - - return bufferExports.Buffer.concat([Rraw, this.curve.encodeAdjusted(s)]); - } - - signTweakAdd(msg, secret, tweak, ph, ctx) { - const [key_, prefix_] = this.privateKeyExpand(secret); - const key = this.scalarTweakAdd(key_, tweak); - const expanded = this.hash.multi(prefix_, tweak, null, - this.curve.adjustedSize * 2); - const prefix = expanded.slice(0, this.curve.adjustedSize); - - return this.signWithScalar(msg, key, prefix, ph, ctx); - } - - signTweakMul(msg, secret, tweak, ph, ctx) { - const [key_, prefix_] = this.privateKeyExpand(secret); - const key = this.scalarTweakMul(key_, tweak); - const expanded = this.hash.multi(prefix_, tweak, null, - this.curve.adjustedSize * 2); - const prefix = expanded.slice(0, this.curve.adjustedSize); - - return this.signWithScalar(msg, key, prefix, ph, ctx); - } - - verify(msg, sig, key, ph, ctx) { - if (ctx == null) - ctx = bufferExports.Buffer.alloc(0); - - assert(bufferExports.Buffer.isBuffer(msg)); - assert(bufferExports.Buffer.isBuffer(sig)); - assert(bufferExports.Buffer.isBuffer(key)); - assert(ph == null || typeof ph === 'boolean'); - assert(bufferExports.Buffer.isBuffer(ctx)); - - if (sig.length !== this.curve.adjustedSize * 2) - return false; - - if (key.length !== this.curve.adjustedSize) - return false; - - try { - return this._verify(msg, sig, key, ph, ctx); - } catch (e) { - return false; - } - } - - _verify(msg, sig, key, ph, ctx) { - // EdDSA Verification. - // - // [EDDSA] Page 15, Section 5. - // [RFC8032] Page 8, Section 3.4. - // - // Assumptions: - // - // - Let `H` be a cryptographic hash function. - // - Let `m` be a byte array of arbitrary size. - // - Let `R` and `s` be signature elements. - // - Let `A` be a valid group element. - // - s < n. - // - // Computation: - // - // e = H(R, A, m) mod n - // G * s == R + A * e - // - // Alternatively, we can compute: - // - // R == G * s - A * e - // - // This allows us to make use of a - // multi-exponentiation algorithm. - const {n} = this.curve; - const G = this.curve.g; - const Rraw = sig.slice(0, this.curve.adjustedSize); - const sraw = sig.slice(this.curve.adjustedSize); - const R = this.curve.decodePoint(Rraw); - const s = this.curve.decodeAdjusted(sraw); - const A = this.curve.decodePoint(key); - - if (s.cmp(n) >= 0) - return false; - - const e = this.hashChallenge(Rraw, key, msg, ph, ctx); - - return G.mulAdd(s, A.neg(), e).eq(R); - } - - verifySingle(msg, sig, key, ph, ctx) { - if (ctx == null) - ctx = bufferExports.Buffer.alloc(0); - - assert(bufferExports.Buffer.isBuffer(msg)); - assert(bufferExports.Buffer.isBuffer(sig)); - assert(bufferExports.Buffer.isBuffer(key)); - assert(ph == null || typeof ph === 'boolean'); - assert(bufferExports.Buffer.isBuffer(ctx)); - - if (sig.length !== this.curve.adjustedSize * 2) - return false; - - if (key.length !== this.curve.adjustedSize) - return false; - - try { - return this._verifySingle(msg, sig, key, ph, ctx); - } catch (e) { - return false; - } - } - - _verifySingle(msg, sig, key, ph, ctx) { - // EdDSA Verification (with cofactor multiplication). - // - // [EDDSA] Page 15, Section 5. - // [RFC8032] Page 8, Section 3.4. - // - // Assumptions: - // - // - Let `H` be a cryptographic hash function. - // - Let `m` be a byte array of arbitrary size. - // - Let `R` and `s` be signature elements. - // - Let `A` be a valid group element. - // - s < n. - // - // Computation: - // - // e = H(R, A, m) mod n - // (G * s) * h == (R + A * e) * h - // - // Alternatively, we can compute: - // - // R * h == G * (s * h) - (A * h) * e - // - // This allows us to make use of a - // multi-exponentiation algorithm. - const {n} = this.curve; - const G = this.curve.g; - const Rraw = sig.slice(0, this.curve.adjustedSize); - const sraw = sig.slice(this.curve.adjustedSize); - const R = this.curve.decodePoint(Rraw); - const s = this.curve.decodeAdjusted(sraw); - const A = this.curve.decodePoint(key); - - if (s.cmp(n) >= 0) - return false; - - const e = this.hashChallenge(Rraw, key, msg, ph, ctx); - const sh = this.curve.imulH(s); - const Ah = A.mulH(); - const Rh = R.mulH(); - - return G.mulAdd(sh, Ah.neg(), e).eq(Rh); - } - - verifyBatch(batch, ph, ctx) { - if (ctx == null) - ctx = bufferExports.Buffer.alloc(0); - - assert(Array.isArray(batch)); - assert(ph == null || typeof ph === 'boolean'); - assert(bufferExports.Buffer.isBuffer(ctx)); - - for (const item of batch) { - assert(Array.isArray(item) && item.length === 3); - - const [msg, sig, key] = item; - - assert(bufferExports.Buffer.isBuffer(msg)); - assert(bufferExports.Buffer.isBuffer(sig)); - assert(bufferExports.Buffer.isBuffer(key)); - - if (sig.length !== this.curve.adjustedSize * 2) - return false; - - if (key.length !== this.curve.adjustedSize) - return false; - } - - try { - return this._verifyBatch(batch, ph, ctx); - } catch (e) { - return false; - } - } - - _verifyBatch(batch, ph, ctx) { - // EdDSA Batch Verification. - // - // [EDDSA] Page 16, Section 5. - // - // Assumptions: - // - // - Let `H` be a cryptographic hash function. - // - Let `R` and `s` be signature elements. - // - Let `A` be a valid group element. - // - Let `i` be the batch item index. - // - s < n. - // - a1 = 1 mod n. - // - // Computation: - // - // ei = H(Ri, Ai, mi) mod n - // ai = random integer in [1,n-1] - // lhs = (si * ai + ...) * h mod n - // rhs = (Ri * h) * ai + (Ai * h) * (ei * ai mod n) + ... - // G * -lhs + rhs == O - const {n} = this.curve; - const G = this.curve.g; - const points = new Array(1 + batch.length * 2); - const coeffs = new Array(1 + batch.length * 2); - const sum = new BN(0); - - this.rng.init(batch); - - points[0] = G; - coeffs[0] = sum; - - for (let i = 0; i < batch.length; i++) { - const [msg, sig, key] = batch[i]; - const Rraw = sig.slice(0, this.curve.adjustedSize); - const sraw = sig.slice(this.curve.adjustedSize); - const R = this.curve.decodePoint(Rraw); - const s = this.curve.decodeAdjusted(sraw); - const A = this.curve.decodePoint(key); - - if (s.cmp(n) >= 0) - return false; - - const e = this.hashChallenge(Rraw, key, msg, ph, ctx); - const a = this.rng.generate(i); - const ea = e.mul(a).imod(n); - - sum.iadd(s.mul(a)).imod(n); - - points[1 + i * 2 + 0] = R.mulH(); - coeffs[1 + i * 2 + 0] = a; - points[1 + i * 2 + 1] = A.mulH(); - coeffs[1 + i * 2 + 1] = ea; - } - - this.curve.imulH(sum.ineg()); - - return this.curve.mulAll(points, coeffs).isInfinity(); - } - - derive(pub, secret) { - const scalar = this.privateKeyConvert(secret); - return this.deriveWithScalar(pub, scalar); - } - - deriveWithScalar(pub, scalar) { - const A = this.curve.decodePoint(pub); - const a = this.curve.decodeClamped(scalar); - const P = A.mulBlind(a, rng); - - if (P.isInfinity()) - throw new Error('Invalid point.'); - - return P.encode(); - } - } - - /* - * Hash - */ - - class Hash { - constructor(eddsa) { - this.curve = eddsa.curve; - // eslint-disable-next-line - this.hash = new eddsa.hash(); - } - - init(ph, ctx) { - assert(ph == null || typeof ph === 'boolean'); - assert(bufferExports.Buffer.isBuffer(ctx)); - - if (ctx.length > 255) - ctx = ctx.slice(0, 255); - - this.hash.init(); - - if (this.curve.context || ph != null || ctx.length > 0) { - if (this.curve.prefix) - this.hash.update(this.curve.prefix); - - this.hash.update(byte(ph)); - this.hash.update(byte(ctx.length)); - this.hash.update(ctx); - } - - return this; - } - - update(data) { - this.hash.update(data); - return this; - } - - final() { - const hash = this.hash.final(this.curve.adjustedSize * 2); - const num = BN.decode(hash, this.curve.endian); - - return num.imod(this.curve.n); - } - } - - /* - * Helpers - */ - - function byte(ch) { - const buf = bufferExports.Buffer.alloc(1); - buf[0] = ch & 0xff; - return buf; - } - - /* - * Expose - */ - - eddsa = EDDSA; - return eddsa; - } - - var keccak; - var hasRequiredKeccak; - - function requireKeccak () { - if (hasRequiredKeccak) return keccak; - hasRequiredKeccak = 1; - - const assert = requireAssert(); - const HMAC = requireHmac(); - - /* - * Constants - */ - - const FINALIZED = 0x80000000; - - const ROUND_CONST = new Uint32Array([ - 0x00000001, 0x00000000, 0x00008082, 0x00000000, - 0x0000808a, 0x80000000, 0x80008000, 0x80000000, - 0x0000808b, 0x00000000, 0x80000001, 0x00000000, - 0x80008081, 0x80000000, 0x00008009, 0x80000000, - 0x0000008a, 0x00000000, 0x00000088, 0x00000000, - 0x80008009, 0x00000000, 0x8000000a, 0x00000000, - 0x8000808b, 0x00000000, 0x0000008b, 0x80000000, - 0x00008089, 0x80000000, 0x00008003, 0x80000000, - 0x00008002, 0x80000000, 0x00000080, 0x80000000, - 0x0000800a, 0x00000000, 0x8000000a, 0x80000000, - 0x80008081, 0x80000000, 0x00008080, 0x80000000, - 0x80000001, 0x00000000, 0x80008008, 0x80000000 - ]); - - /** - * Keccak - */ - - class Keccak { - constructor() { - this.state = new Uint32Array(50); - this.block = bufferExports.Buffer.alloc(200); - this.bs = 136; - this.pos = FINALIZED; - } - - init(bits) { - if (bits == null) - bits = 256; - - assert((bits >>> 0) === bits); - assert(bits >= 128); - assert(bits <= 512); - - const rate = 1600 - bits * 2; - - assert(rate >= 0 && (rate & 63) === 0); - - this.bs = rate >>> 3; - this.pos = 0; - - return this; - } - - update(data) { - assert(bufferExports.Buffer.isBuffer(data)); - assert(!(this.pos & FINALIZED), 'Context is not initialized.'); - - let len = data.length; - let pos = this.pos; - let off = 0; - - this.pos = (this.pos + len) % this.bs; - - if (pos > 0) { - let want = this.bs - pos; - - if (want > len) - want = len; - - data.copy(this.block, pos, off, off + want); - - pos += want; - len -= want; - off += want; - - if (pos < this.bs) - return this; - - this._transform(this.block, 0); - } - - while (len >= this.bs) { - this._transform(data, off); - off += this.bs; - len -= this.bs; - } - - if (len > 0) - data.copy(this.block, 0, off, off + len); - - return this; - } - - final(pad, len) { - if (pad == null) - pad = 0x01; - - if (len == null || len === 0) - len = 100 - (this.bs >>> 1); - - assert((pad & 0xff) === pad); - assert((len >>> 0) === len); - assert(!(this.pos & FINALIZED), 'Context is not initialized.'); - - this.block.fill(0, this.pos, this.bs); - this.block[this.pos] |= pad; - this.block[this.bs - 1] |= 0x80; - this._transform(this.block, 0); - this.pos = FINALIZED; - - assert(len <= this.bs); - - const out = bufferExports.Buffer.alloc(len); - - for (let i = 0; i < len; i++) - out[i] = this.state[i >>> 2] >>> (8 * (i & 3)); - - for (let i = 0; i < 50; i++) - this.state[i] = 0; - - for (let i = 0; i < this.bs; i++) - this.block[i] = 0; - - return out; - } - - _transform(block, off) { - const count = this.bs >>> 2; - const s = this.state; - - for (let i = 0; i < count; i++) - s[i] ^= readU32(block, off + i * 4); - - for (let n = 0; n < 48; n += 2) { - const c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]; - const c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]; - const c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]; - const c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43]; - const c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44]; - const c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45]; - const c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46]; - const c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47]; - const c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48]; - const c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49]; - - const h0 = c8 ^ ((c2 << 1) | (c3 >>> 31)); - const l0 = c9 ^ ((c3 << 1) | (c2 >>> 31)); - const h1 = c0 ^ ((c4 << 1) | (c5 >>> 31)); - const l1 = c1 ^ ((c5 << 1) | (c4 >>> 31)); - const h2 = c2 ^ ((c6 << 1) | (c7 >>> 31)); - const l2 = c3 ^ ((c7 << 1) | (c6 >>> 31)); - const h3 = c4 ^ ((c8 << 1) | (c9 >>> 31)); - const l3 = c5 ^ ((c9 << 1) | (c8 >>> 31)); - const h4 = c6 ^ ((c0 << 1) | (c1 >>> 31)); - const l4 = c7 ^ ((c1 << 1) | (c0 >>> 31)); - - s[0] ^= h0; - s[1] ^= l0; - s[10] ^= h0; - s[11] ^= l0; - s[20] ^= h0; - s[21] ^= l0; - s[30] ^= h0; - s[31] ^= l0; - s[40] ^= h0; - s[41] ^= l0; - - s[2] ^= h1; - s[3] ^= l1; - s[12] ^= h1; - s[13] ^= l1; - s[22] ^= h1; - s[23] ^= l1; - s[32] ^= h1; - s[33] ^= l1; - s[42] ^= h1; - s[43] ^= l1; - - s[4] ^= h2; - s[5] ^= l2; - s[14] ^= h2; - s[15] ^= l2; - s[24] ^= h2; - s[25] ^= l2; - s[34] ^= h2; - s[35] ^= l2; - s[44] ^= h2; - s[45] ^= l2; - - s[6] ^= h3; - s[7] ^= l3; - s[16] ^= h3; - s[17] ^= l3; - s[26] ^= h3; - s[27] ^= l3; - s[36] ^= h3; - s[37] ^= l3; - s[46] ^= h3; - s[47] ^= l3; - - s[8] ^= h4; - s[9] ^= l4; - s[18] ^= h4; - s[19] ^= l4; - s[28] ^= h4; - s[29] ^= l4; - s[38] ^= h4; - s[39] ^= l4; - s[48] ^= h4; - s[49] ^= l4; - - const b0 = s[0]; - const b1 = s[1]; - const b32 = (s[11] << 4) | (s[10] >>> 28); - const b33 = (s[10] << 4) | (s[11] >>> 28); - const b14 = (s[20] << 3) | (s[21] >>> 29); - const b15 = (s[21] << 3) | (s[20] >>> 29); - const b46 = (s[31] << 9) | (s[30] >>> 23); - const b47 = (s[30] << 9) | (s[31] >>> 23); - const b28 = (s[40] << 18) | (s[41] >>> 14); - const b29 = (s[41] << 18) | (s[40] >>> 14); - const b20 = (s[2] << 1) | (s[3] >>> 31); - const b21 = (s[3] << 1) | (s[2] >>> 31); - const b2 = (s[13] << 12) | (s[12] >>> 20); - const b3 = (s[12] << 12) | (s[13] >>> 20); - const b34 = (s[22] << 10) | (s[23] >>> 22); - const b35 = (s[23] << 10) | (s[22] >>> 22); - const b16 = (s[33] << 13) | (s[32] >>> 19); - const b17 = (s[32] << 13) | (s[33] >>> 19); - const b48 = (s[42] << 2) | (s[43] >>> 30); - const b49 = (s[43] << 2) | (s[42] >>> 30); - const b40 = (s[5] << 30) | (s[4] >>> 2); - const b41 = (s[4] << 30) | (s[5] >>> 2); - const b22 = (s[14] << 6) | (s[15] >>> 26); - const b23 = (s[15] << 6) | (s[14] >>> 26); - const b4 = (s[25] << 11) | (s[24] >>> 21); - const b5 = (s[24] << 11) | (s[25] >>> 21); - const b36 = (s[34] << 15) | (s[35] >>> 17); - const b37 = (s[35] << 15) | (s[34] >>> 17); - const b18 = (s[45] << 29) | (s[44] >>> 3); - const b19 = (s[44] << 29) | (s[45] >>> 3); - const b10 = (s[6] << 28) | (s[7] >>> 4); - const b11 = (s[7] << 28) | (s[6] >>> 4); - const b42 = (s[17] << 23) | (s[16] >>> 9); - const b43 = (s[16] << 23) | (s[17] >>> 9); - const b24 = (s[26] << 25) | (s[27] >>> 7); - const b25 = (s[27] << 25) | (s[26] >>> 7); - const b6 = (s[36] << 21) | (s[37] >>> 11); - const b7 = (s[37] << 21) | (s[36] >>> 11); - const b38 = (s[47] << 24) | (s[46] >>> 8); - const b39 = (s[46] << 24) | (s[47] >>> 8); - const b30 = (s[8] << 27) | (s[9] >>> 5); - const b31 = (s[9] << 27) | (s[8] >>> 5); - const b12 = (s[18] << 20) | (s[19] >>> 12); - const b13 = (s[19] << 20) | (s[18] >>> 12); - const b44 = (s[29] << 7) | (s[28] >>> 25); - const b45 = (s[28] << 7) | (s[29] >>> 25); - const b26 = (s[38] << 8) | (s[39] >>> 24); - const b27 = (s[39] << 8) | (s[38] >>> 24); - const b8 = (s[48] << 14) | (s[49] >>> 18); - const b9 = (s[49] << 14) | (s[48] >>> 18); - - s[0] = b0 ^ (~b2 & b4); - s[1] = b1 ^ (~b3 & b5); - s[10] = b10 ^ (~b12 & b14); - s[11] = b11 ^ (~b13 & b15); - s[20] = b20 ^ (~b22 & b24); - s[21] = b21 ^ (~b23 & b25); - s[30] = b30 ^ (~b32 & b34); - s[31] = b31 ^ (~b33 & b35); - s[40] = b40 ^ (~b42 & b44); - s[41] = b41 ^ (~b43 & b45); - s[2] = b2 ^ (~b4 & b6); - s[3] = b3 ^ (~b5 & b7); - s[12] = b12 ^ (~b14 & b16); - s[13] = b13 ^ (~b15 & b17); - s[22] = b22 ^ (~b24 & b26); - s[23] = b23 ^ (~b25 & b27); - s[32] = b32 ^ (~b34 & b36); - s[33] = b33 ^ (~b35 & b37); - s[42] = b42 ^ (~b44 & b46); - s[43] = b43 ^ (~b45 & b47); - s[4] = b4 ^ (~b6 & b8); - s[5] = b5 ^ (~b7 & b9); - s[14] = b14 ^ (~b16 & b18); - s[15] = b15 ^ (~b17 & b19); - s[24] = b24 ^ (~b26 & b28); - s[25] = b25 ^ (~b27 & b29); - s[34] = b34 ^ (~b36 & b38); - s[35] = b35 ^ (~b37 & b39); - s[44] = b44 ^ (~b46 & b48); - s[45] = b45 ^ (~b47 & b49); - s[6] = b6 ^ (~b8 & b0); - s[7] = b7 ^ (~b9 & b1); - s[16] = b16 ^ (~b18 & b10); - s[17] = b17 ^ (~b19 & b11); - s[26] = b26 ^ (~b28 & b20); - s[27] = b27 ^ (~b29 & b21); - s[36] = b36 ^ (~b38 & b30); - s[37] = b37 ^ (~b39 & b31); - s[46] = b46 ^ (~b48 & b40); - s[47] = b47 ^ (~b49 & b41); - s[8] = b8 ^ (~b0 & b2); - s[9] = b9 ^ (~b1 & b3); - s[18] = b18 ^ (~b10 & b12); - s[19] = b19 ^ (~b11 & b13); - s[28] = b28 ^ (~b20 & b22); - s[29] = b29 ^ (~b21 & b23); - s[38] = b38 ^ (~b30 & b32); - s[39] = b39 ^ (~b31 & b33); - s[48] = b48 ^ (~b40 & b42); - s[49] = b49 ^ (~b41 & b43); - - s[0] ^= ROUND_CONST[n + 0]; - s[1] ^= ROUND_CONST[n + 1]; - } - } - - static hash() { - return new Keccak(); - } - - static hmac(bits, pad, len) { - if (bits == null) - bits = 256; - - assert((bits >>> 0) === bits); - - const rate = 1600 - bits * 2; - - assert(rate >= 0 && (rate & 63) === 0); - - return new HMAC(Keccak, rate >>> 3, [bits], [pad, len]); - } - - static digest(data, bits, pad, len) { - return Keccak.ctx.init(bits).update(data).final(pad, len); - } - - static root(left, right, bits, pad, len) { - if (bits == null) - bits = 256; - - if (len == null) - len = 0; - - if (len === 0) - len = bits >>> 3; - - assert((bits >>> 0) === bits); - assert((bits & 7) === 0); - assert((len >>> 0) === len); - assert(bufferExports.Buffer.isBuffer(left) && left.length === len); - assert(bufferExports.Buffer.isBuffer(right) && right.length === len); - - return Keccak.ctx.init(bits).update(left).update(right).final(pad, len); - } - - static multi(x, y, z, bits, pad, len) { - const {ctx} = Keccak; - - ctx.init(bits); - ctx.update(x); - ctx.update(y); - - if (z) - ctx.update(z); - - return ctx.final(pad, len); - } - - static mac(data, key, bits, pad, len) { - return Keccak.hmac(bits, pad, len).init(key).update(data).final(); - } - } - - /* - * Static - */ - - Keccak.native = 0; - Keccak.id = 'KECCAK256'; - Keccak.size = 32; - Keccak.bits = 256; - Keccak.blockSize = 136; - Keccak.zero = bufferExports.Buffer.alloc(32, 0x00); - Keccak.ctx = new Keccak(); - - /* - * Helpers - */ - - function readU32(data, off) { - return (data[off++] - + data[off++] * 0x100 - + data[off++] * 0x10000 - + data[off] * 0x1000000); - } - - /* - * Expose - */ - - keccak = Keccak; - return keccak; - } - - /*! - * keccak.js - keccak for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var keccakBrowser; - var hasRequiredKeccakBrowser; - - function requireKeccakBrowser () { - if (hasRequiredKeccakBrowser) return keccakBrowser; - hasRequiredKeccakBrowser = 1; - - keccakBrowser = requireKeccak(); - return keccakBrowser; - } - - var shake; - var hasRequiredShake; - - function requireShake () { - if (hasRequiredShake) return shake; - hasRequiredShake = 1; - - const Keccak = requireKeccakBrowser(); - - /** - * SHAKE - */ - - class SHAKE extends Keccak { - /** - * Create a SHAKE Context. - * @constructor - */ - - constructor() { - super(); - } - - final(len) { - return super.final(0x1f, len); - } - - static hash() { - return new SHAKE(); - } - - static hmac(bits, len) { - return super.hmac(bits, 0x1f, len); - } - - static digest(data, bits, len) { - return super.digest(data, bits, 0x1f, len); - } - - static root(left, right, bits, len) { - return super.root(left, right, bits, 0x1f, len); - } - - static multi(x, y, z, bits, len) { - return super.multi(x, y, z, bits, 0x1f, len); - } - - static mac(data, key, bits, len) { - return super.mac(data, key, bits, 0x1f, len); - } - } - - /* - * Static - */ - - SHAKE.native = Keccak.native; - SHAKE.id = 'SHAKE256'; - SHAKE.size = 32; - SHAKE.bits = 256; - SHAKE.blockSize = 136; - SHAKE.zero = bufferExports.Buffer.alloc(32, 0x00); - SHAKE.ctx = new SHAKE(); - - /* - * Expose - */ - - shake = SHAKE; - return shake; - } - - var shake256; - var hasRequiredShake256; - - function requireShake256 () { - if (hasRequiredShake256) return shake256; - hasRequiredShake256 = 1; - - const SHAKE = requireShake(); - - /** - * SHAKE256 - */ - - class SHAKE256 extends SHAKE { - constructor() { - super(); - } - - init() { - return super.init(256); - } - - static hash() { - return new SHAKE256(); - } - - static hmac(len) { - return super.hmac(256, len); - } - - static digest(data, len) { - return super.digest(data, 256, len); - } - - static root(left, right, len) { - return super.root(left, right, 256, len); - } - - static multi(x, y, z, len) { - return super.multi(x, y, z, 256, len); - } - - static mac(data, key, len) { - return super.mac(data, key, 256, len); - } - } - - /* - * Static - */ - - SHAKE256.native = SHAKE.native; - SHAKE256.id = 'SHAKE256'; - SHAKE256.size = 32; - SHAKE256.bits = 256; - SHAKE256.blockSize = 136; - SHAKE256.zero = bufferExports.Buffer.alloc(32, 0x00); - SHAKE256.ctx = new SHAKE256(); - - /* - * Expose - */ - - shake256 = SHAKE256; - return shake256; - } - - /*! - * ed448.js - ed448 for bcrypto - * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - * - * Resources: - * https://eprint.iacr.org/2015/625.pdf - * https://tools.ietf.org/html/rfc8032#section-5.2 - */ - - var ed448$1; - var hasRequiredEd448; - - function requireEd448 () { - if (hasRequiredEd448) return ed448$1; - hasRequiredEd448 = 1; - - const EDDSA = requireEddsa(); - const SHAKE256 = requireShake256(); - - /* - * Expose - */ - - ed448$1 = new EDDSA('ED448', 'X448', 'MONT448', SHAKE256); - return ed448$1; - } - - /*! - * ed448.js - ed448 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var ed448Browser; - var hasRequiredEd448Browser; - - function requireEd448Browser () { - if (hasRequiredEd448Browser) return ed448Browser; - hasRequiredEd448Browser = 1; - - ed448Browser = requireEd448(); - return ed448Browser; - } - - var ed448BrowserExports = requireEd448Browser(); - var backend = /*@__PURE__*/getDefaultExportFromCjs(ed448BrowserExports); - - // bcrypto does not ship TypeScript declarations. - // @ts-ignore - const ed448 = backend; - - /** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ - const BN_0$9 = BigInt(0); - const BN_1$5 = BigInt(1); - //const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; - // IEEE 754 support 53-bits of mantissa - const maxValue = 0x1fffffffffffff; - /** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ - function fromTwos(_value, _width) { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - assert(value >> width === BN_0$9, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", - fault: "overflow", - value: _value, - }); - // Top bit set; treat as a negative value - if (value >> (width - BN_1$5)) { - const mask = (BN_1$5 << width) - BN_1$5; - return -((~value & mask) + BN_1$5); - } - return value; - } - /** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ - function toTwos(_value, _width) { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = BN_1$5 << (width - BN_1$5); - if (value < BN_0$9) { - value = -value; - assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - const mask = (BN_1$5 << width) - BN_1$5; - return (~value & mask) + BN_1$5; - } - else { - assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - } - return value; - } - /** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ - function mask(_value, _bits) { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1$5 << bits) - BN_1$5); - } - /** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ - function getBigInt(value, name) { - switch (typeof value) { - case "bigint": - return value; - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } - catch (e) { - assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid BigNumberish value", name || "value", value); - } - function getUint(value, name) { - const result = getBigInt(value, name); - assert(result >= BN_0$9, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", - operation: "getUint", - value, - }); - return result; - } - const Nibbles = "0123456789abcdef"; - /* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ - function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles[v >> 4]; - result += Nibbles[v & 0x0f]; - } - return BigInt(result); - } - return getBigInt(value); - } - /** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ - function getNumber(value, name) { - switch (typeof value) { - case "bigint": - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } - catch (e) { - assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid numeric value", name || "value", value); - } - /** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ - function toNumber(value) { - return getNumber(toBigInt(value)); - } - /** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ - function toBeHex(_value, _width) { - const value = getUint(_value, "value"); - let result = value.toString(16); - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } - else { - const width = getNumber(_width, "width"); - assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value, - }); - // Pad the value to the required width - while (result.length < width * 2) { - result = "0" + result; - } - } - return "0x" + result; - } - /** - * Converts %%value%% to a Big Endian Uint8Array. - */ - function toBeArray(_value) { - const value = getUint(_value, "value"); - if (value === BN_0$9) { - return new Uint8Array([]); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - return result; - } - /** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ - function toQuantity(value) { - let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; - } - - /** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ - const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; - let Lookup = null; - function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; - } - const BN_0$8 = BigInt(0); - const BN_58 = BigInt(58); - /** - * Encode %%value%% as a Base58-encoded string. - */ - function encodeBase58(_value) { - let value = toBigInt(getBytes(_value)); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - return result; - } - /** - * Decode the Base58-encoded %%value%%. - */ - function decodeBase58(value) { - let result = BN_0$8; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; - } - - // utils/base64-browser - function decodeBase64(textData) { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return getBytes(data); - } - function encodeBase64(_data) { - const data = getBytes(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); - } - - /** - * Explain events... - * - * @_section api/utils/events:Events [about-events] - */ - /** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ - class EventPayload { - /** - * The event filter. - */ - filter; - /** - * The **EventEmitterable**. - */ - emitter; - #listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter, listener, filter) { - this.#listener = listener; - defineProperties(this, { emitter, filter }); - } - /** - * Unregister the triggered listener for future events. - */ - async removeListener() { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } - } - - /** - * Using strings in Core (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ - function errorFunc(reason, offset, bytes, output, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); - } - function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; - } - function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes); - } - /** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ - const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc, - }); - // http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 - function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; - } - // http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array - /** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ - function toUtf8Bytes(str, form) { - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); - } - //export - function _toUtf8String(codePoints) { - return codePoints - .map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00); - }) - .join(""); - } - /** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ - function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); - } - /** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ - function toUtf8CodePoints(str, form) { - return getUtf8CodePoints(toUtf8Bytes(str, form)); - } - - // @TODO: timeout is completely ignored; start a Promise.any with a reject? - // @ts-ignore - async function getUrl(req, _signal) { - const protocol = req.url.split(":")[0].toLowerCase(); - assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request", - }); - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request", - }); - let signal = undefined; - if (_signal) { - const controller = new AbortController(); - signal = controller.signal; - _signal.addListener(() => { - controller.abort(); - }); - } - const init = { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal, - }; - try { - const resp = await fetch(req.url, init); - const headers = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - const respBody = await resp.arrayBuffer(); - const body = respBody == null ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, - body, - }; - } - catch (error) { - console.log({ error }); - return undefined; - } - } - - /** - * Explain fetching here... - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ - const MAX_ATTEMPTS = 12; - const SLOT_INTERVAL = 250; - // The global FetchGetUrlFunc implementation. - let getUrlFunc = getUrl; - const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); - const reIpfs = new RegExp("^ipfs://(ipfs/)?(.*)$", "i"); - // If locked, new Gateways cannot be added - let locked$5 = false; - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs - async function dataGatewayFunc(url, signal) { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse(200, "OK", { - "content-type": match[1] || "text/plain", - }, match[2] ? decodeBase64(match[3]) : unpercent(match[3])); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); - } - } - /** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ - function getIpfsGatewayFunc(baseUrl) { - async function gatewayIpfs(url, signal) { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); - } - } - return gatewayIpfs; - } - const Gateways = { - data: dataGatewayFunc, - ipfs: getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/"), - }; - const fetchSignals = new WeakMap(); - /** - * @_ignore - */ - class FetchCancelSignal { - #listeners; - #cancelled; - constructor(request) { - this.#listeners = []; - this.#cancelled = false; - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - for (const listener of this.#listeners) { - setTimeout(() => { - listener(); - }, 0); - } - this.#listeners = []; - }); - } - addListener(listener) { - assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener", - }); - this.#listeners.push(listener); - } - get cancelled() { - return this.#cancelled; - } - checkSignal() { - assert(!this.cancelled, "cancelled", "CANCELLED", {}); - } - } - // Check the signal, throwing if it is cancelled - function checkSignal(signal) { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; - } - /** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ - class FetchRequest { - #allowInsecure; - #gzip; - #headers; - #method; - #timeout; - #url; - #body; - #bodyType; - #creds; - // Hooks - #preflight; - #process; - #retry; - #signal; - #throttle; - /** - * The fetch URI to requrest. - */ - get url() { - return this.#url; - } - set url(url) { - this.#url = String(url); - } - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . - * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrincis ``Content-Type`` is - * set to ``application/json``. - */ - get body() { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } - else if (typeof body === "string") { - this.#body = toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } - else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } - else if (typeof body === "object") { - this.#body = toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } - else { - throw new Error("invalid body"); - } - } - /** - * Returns true if the request has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method() { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any chnages will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers() { - const headers = Object.assign({}, this.#headers); - if (this.#creds) { - headers["authorization"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`; - } - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - return headers; - } - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key, value) { - this.#headers[String(key).toLowerCase()] = String(value); - } - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders() { - this.#headers = {}; - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials() { - return this.#creds || null; - } - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username, password) { - assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${username}:${password}`; - } - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip() { - return this.#gzip; - } - set allowGzip(value) { - this.#gzip = !!value; - } - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication() { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value) { - this.#allowInsecure = !!value; - } - /** - * The timeout (in milliseconds) to wait for a complere response. - * //(default: 5 minutes)// - */ - get timeout() { - return this.#timeout; - } - set timeout(timeout) { - assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc() { - return this.#preflight || null; - } - set preflightFunc(preflight) { - this.#preflight = preflight; - } - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc() { - return this.#process || null; - } - set processFunc(process) { - this.#process = process; - } - /** - * This function is called on each retry attempt. - */ - get retryFunc() { - return this.#retry || null; - } - set retryFunc(retry) { - this.#retry = retry; - } - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url) { - this.#url = String(url); - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS, - }; - } - toString() { - return ``; - } - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params) { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - async #send(attempt, expires, delay, _request, _response) { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - assert(getTime$2() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", - reason: "timeout", - request: _request, - }); - if (delay > 0) { - await wait(delay); - } - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Ignore throttling - } - } - return response; - } - req = result; - } - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - const resp = await getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req - .redirect(location) - .#send(attempt + 1, expires, 0, _request, response); - } - catch (error) { } - // Things won't get any better on another attempt; abort - return response; - } - else if (response.statusCode === 429) { - // Throttle - if (this.retryFunc == null || - (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof retryAfter === "string" && - retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Throttle - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (error.stall >= 0) { - delay = error.stall; - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - return response; - } - /** - * Resolves to the response by sending the request. - */ - send() { - assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime$2() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); - } - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel() { - assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location) { - // Redirection; for now we only support absolute locataions - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - assert(this.method === "GET" && - (current !== "https" || target !== "http") && - location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`, - }); - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - return req; - } - /** - * Create a new copy of this request. - */ - clone() { - const clone = new FetchRequest(this.url); - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - if (this.allowGzip) { - clone.allowGzip = true; - } - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - return clone; - } - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig() { - locked$5 = true; - } - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme) { - return Gateways[scheme.toLowerCase()] || null; - } - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme, func) { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked$5) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl) { - if (locked$5) { - throw new Error("gateways locked"); - } - getUrlFunc = getUrl; - } - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway() { - return dataGatewayFunc; - } - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl) { - return getIpfsGatewayFunc(baseUrl); - } - } - /** - * The response for a FetchREquest. - */ - class FetchResponse { - #statusCode; - #statusMessage; - #headers; - #body; - #request; - #error; - toString() { - return ``; - } - /** - * The response status code. - */ - get statusCode() { - return this.#statusCode; - } - /** - * The response status message. - */ - get statusMessage() { - return this.#statusMessage; - } - /** - * The response headers. All keys are lower-case. - */ - get headers() { - return Object.assign({}, this.#headers); - } - /** - * The response body, or ``null`` if there was no body. - */ - get body() { - return this.#body == null ? null : new Uint8Array(this.#body); - } - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText() { - try { - return this.#body == null ? "" : toUtf8String(this.#body); - } - catch (error) { - assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", - info: { response: this }, - }); - } - } - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson() { - try { - return JSON.parse(this.bodyText); - } - catch (error) { - assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", - info: { response: this }, - }); - } - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - constructor(statusCode, statusMessage, headers, body, request) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, {}); - this.#body = body == null ? null : new Uint8Array(body); - this.#request = request || null; - this.#error = { message: "" }; - } - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message, error) { - let statusMessage; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } - else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message, stall) { - if (stall == null) { - stall = -1; - } - else { - assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - const error = new Error(message || "throttling requests"); - defineProperties(error, { stall, throttle: true }); - throw error; - } - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Returns true of the response has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The request made for this response. - */ - get request() { - return this.#request; - } - /** - * Returns true if this response was a success statusCode. - */ - ok() { - return (this.#error.message === "" && - this.statusCode >= 200 && - this.statusCode < 300); - } - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk() { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - assert(false, message, "SERVER_ERROR", { - request: this.request || "unknown request", - response: this, - error, - }); - } - } - function getTime$2() { - return new Date().getTime(); - } - function unpercent(value) { - return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); - } - function wait(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); - } - - var _a$1; - const BN_N1 = BigInt(-1); - const BN_0$7 = BigInt(0); - const BN_1$4 = BigInt(1); - const BN_5 = BigInt(5); - const _guard$5 = {}; - // Constant to pull zeros from for multipliers - let Zeros = "0000"; - while (Zeros.length < 80) { - Zeros += Zeros; - } - // Returns a string "1" followed by decimal "0"s - function getTens(decimals) { - let result = Zeros; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); - } - function checkValue(val, format, safeOp) { - const width = BigInt(format.width); - if (format.signed) { - const limit = BN_1$4 << (width - BN_1$4); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - if (val > BN_0$7) { - val = fromTwos(mask(val, width), width); - } - else { - val = -fromTwos(mask(-val, width), width); - } - } - else { - const limit = BN_1$4 << width; - assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - val = (((val % limit) + limit) % limit) & (limit - BN_1$4); - } - return val; - } - function getFormat(value) { - if (typeof value === "number") { - value = `fixed128x${value}`; - } - let signed = true; - let width = 128; - let decimals = 18; - if (typeof value === "string") { - // Parse the format string - if (value === "fixed") ; - else if (value === "ufixed") { - signed = false; - } - else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - assertArgument(match, "invalid fixed format", "format", value); - signed = match[1] !== "u"; - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } - else if (value) { - // Extract the values from the object - const v = value; - const check = (key, type, defaultValue) => { - if (v[key] == null) { - return defaultValue; - } - assertArgument(typeof v[key] === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - assertArgument(width % 8 === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - return { signed, width, decimals, name }; - } - function toString(val, decimals) { - let negative = ""; - if (val < BN_0$7) { - negative = "-"; - val *= BN_N1; - } - let str = val.toString(); - // No decimal point for whole values - if (decimals === 0) { - return negative + str; - } - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros + str; - } - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - return negative + str; - } - /** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, an value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ - class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - format; - #format; - // The actual value (accounting for decimals) - #val; - // A base-10 value to multiple values by to maintain the magnitude - #tens; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - _value; - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - /** - * @private - */ - constructor(guard, value, format) { - assertPrivate(guard, _guard$5, "FixedNumber"); - this.#val = value; - this.#format = format; - const _value = toString(value, format.decimals); - defineProperties(this, { format: format.name, _value }); - this.#tens = getTens(format.decimals); - } - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed() { - return this.#format.signed; - } - /** - * The number of bits available to store the value. - */ - get width() { - return this.#format.width; - } - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals() { - return this.#format.decimals; - } - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value() { - return this.#val; - } - #checkFormat(other) { - assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); - } - #checkValue(val, safeOp) { - /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } - */ - val = checkValue(val, this.#format, safeOp); - return new _a$1(_guard$5, val, this.#format); - } - #add(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other) { - return this.#add(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other) { - return this.#add(other, "add"); - } - #sub(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other) { - return this.#sub(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other) { - return this.#sub(other, "sub"); - } - #mul(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other) { - return this.#mul(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other) { - return this.#mul(other, "mul"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other) { - this.#checkFormat(other); - const value = this.#val * other.#val; - assert(value % this.#tens === BN_0$7, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - #div(o, safeOp) { - assert(o.#val !== BN_0$7, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other) { - return this.#div(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other) { - return this.#div(other, "div"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other) { - assert(other.#val !== BN_0$7, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(other); - const value = this.#val * this.#tens; - assert(value % other.#val === BN_0$7, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%other%% is larger and ``0`` implies - * both are equal. - */ - cmp(other) { - let a = this.value, b = other.value; - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } - else if (delta < 0) { - a *= getTens(-delta); - } - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return -1; - } - return 0; - } - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other) { - return this.cmp(other) === 0; - } - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other) { - return this.cmp(other) < 0; - } - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other) { - return this.cmp(other) <= 0; - } - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other) { - return this.cmp(other) > 0; - } - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other) { - return this.cmp(other) >= 0; - } - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor() { - let val = this.#val; - if (this.#val < BN_0$7) { - val -= this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling() { - let val = this.#val; - if (this.#val > BN_0$7) { - val += this.#tens - BN_1$4; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals) { - if (decimals == null) { - decimals = 0; - } - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - checkValue(value, this.#format, "round"); - return new _a$1(_guard$5, value, this.#format); - } - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero() { - return this.#val === BN_0$7; - } - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative() { - return this.#val < BN_0$7; - } - /** - * Returns the string representation of %%this%%. - */ - toString() { - return this._value; - } - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat() { - return parseFloat(this.toString()); - } - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format) { - return _a$1.fromString(this.toString(), format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value, decimals, _format) { - if (decimals == null) { - decimals = 0; - } - const format = getFormat(_format); - let value = getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - assert(value % tens === BN_0$7, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", - fault: "underflow", - value: _value, - }); - value /= tens; - } - else if (delta < 0) { - value *= getTens(-delta); - } - checkValue(value, format, "fromValue"); - return new _a$1(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value, _format) { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - assertArgument(match && match[2].length + match[3].length > 0, "invalid FixedNumber string value", "value", _value); - const format = getFormat(_format); - let whole = match[2] || "0", decimal = match[3] || ""; - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros; - } - // Check precision is safe - assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", - fault: "underflow", - value: _value, - }); - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - const value = BigInt(match[1] + whole + decimal); - checkValue(value, format, "fromString"); - return new _a$1(_guard$5, value, format); - } - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value, _format) { - let value = toBigInt(getBytes(_value, "value")); - const format = getFormat(_format); - if (format.signed) { - value = fromTwos(value, format.width); - } - checkValue(value, format, "fromBytes"); - return new _a$1(_guard$5, value, format); - } - } - _a$1 = FixedNumber; - //const f1 = FixedNumber.fromString("12.56", "fixed16x2"); - //const f2 = FixedNumber.fromString("0.3", "fixed16x2"); - //console.log(f1.divSignal(f2)); - //const BUMP = FixedNumber.from("0.5"); - - function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; - } - function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; - } - function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, - length, - offset, - }); - } - return { consumed: 1 + length, result: result }; - } - // returns { consumed: number, result: Object } - function _decode(data, offset) { - assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, - length: 0, - offset: 1, - }); - const checkOffset = (offset) => { - assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, - length: data.length, - offset, - }); - }; - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - return _decodeChildren(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlifyByte(data[offset]) }; - } - /** - * Decodes %%data%% into the structured data it represents. - */ - function decodeRlp(_data) { - const data = getBytes(_data, "data"); - const decoded = _decode(data, 0); - assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; - } - - function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; - } - function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - const data = Array.prototype.slice.call(getBytes(object, "object")); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); - } - const nibbles = "0123456789abcdef"; - /** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ - function encodeRlp(object) { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; - } - - /** - * Most interactions with Core requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Core, //Core// is divisible to 18 decimal places, - * where each individual unit is called a //ore//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ - const names = [ - ///Ore, the smallest and atomic amount of Core - "ore", - ///fecore, 1000 ore - "fecore", - ///Picore, one million ore - "picore", - ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices. - "nacore", - ///Μcore, 10^12 ore or 1 μCore - "mcore", - ///micore, 10^15 ore or 1 mcore - "micore", - "core", - ]; - /** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit - * - */ - function formatUnits(value, unit) { - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromValue(value, decimals, { decimals }).toString(); - } - /** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit. - */ - const scientificToDecimal = (num) => { - // @ts-ignore - var nsign = Math.sign(num); - //remove the sign - // @ts-ignore - num = Math.abs(num); - //if the number is in scientific notation remove it - // @ts-ignore - if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) { - var zero = "0", - // @ts-ignore - parts = String(num).toLowerCase().split("e"), //split into coeff and exponent - e = parts.pop(), //store the exponential part - // @ts-ignore - l = Math.abs(e), //get the number of zeros - // @ts-ignore - sign = e / l, coeff_array = parts[0].split("."); - if (sign === -1) { - l = l - coeff_array[0].length; - if (l < 0) { - // @ts-ignore - num = - coeff_array[0].slice(0, l) + - "." + - coeff_array[0].slice(l) + - (coeff_array.length === 2 ? coeff_array[1] : ""); - } - else { - // @ts-ignore - num = zero + "." + new Array(l + 1).join(zero) + coeff_array.join(""); - } - } - else { - var dec = coeff_array[1]; - if (dec) - l = l - dec.length; - if (l < 0) { - // @ts-ignore - num = coeff_array[0] + dec.slice(0, l) + "." + dec.slice(l); - } - else { - // @ts-ignore - num = coeff_array.join("") + new Array(l + 1).join(zero); - } - } - } - // @ts-ignore - return nsign < 0 ? "-" + num : num; - }; - const trimDecimals = (n, decimals = 18) => { - n += ""; - if (n.indexOf(".") === -1) - return n; - const arr = n.split("."); - const fraction = arr[1].substr(0, decimals); - return arr[0] + "." + fraction; - }; - function parseUnits(value, unit) { - assertArgument(typeof value === "string", "value must be a string", "value", value); - if (value.includes("e")) { - value = scientificToDecimal(value).toString(); - } - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - value = trimDecimals(value, decimals); - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - value = trimDecimals(value, decimals); - } - return FixedNumber.fromString(value, { decimals }).value; - } - /** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ - function formatXCB(ore) { - return formatUnits(ore, 18); - } - /** - * Converts the //decimal string// %%xcb%% to a BigInt, using 18 - * decimal places. - */ - function parseXCB(xcb) { - return parseUnits(xcb, 18); - } - - /** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ - /** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ - function uuidV4(randomBytes) { - const bytes = getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); - } - - var pbkdf2$2 = {}; - - var hasRequiredPbkdf2; - - function requirePbkdf2 () { - if (hasRequiredPbkdf2) return pbkdf2$2; - hasRequiredPbkdf2 = 1; - - const assert = requireAssert(); - const crypto = commonjsGlobal.crypto || commonjsGlobal.msCrypto || {}; - const subtle = crypto.subtle || {}; - - /** - * Perform key derivation using PBKDF2. - * @param {Function} hash - * @param {Buffer} pass - * @param {Buffer} salt - * @param {Number} iter - * @param {Number} len - * @returns {Buffer} - */ - - function derive(hash, pass, salt, iter, len) { - if (typeof pass === 'string') - pass = bufferExports.Buffer.from(pass, 'utf8'); - - if (typeof salt === 'string') - salt = bufferExports.Buffer.from(salt, 'utf8'); - - if (salt == null) - salt = bufferExports.Buffer.alloc(0); - - assert(hash && typeof hash.id === 'string'); - assert(bufferExports.Buffer.isBuffer(pass)); - assert(bufferExports.Buffer.isBuffer(salt)); - assert((iter >>> 0) === iter); - assert((len >>> 0) === len); - - const size = hash.size; - const blocks = Math.ceil(len / size); - const out = bufferExports.Buffer.alloc(blocks * size); - const state = bufferExports.Buffer.alloc(salt.length + 4); - - salt.copy(state, 0); - - // Preemptively shorten key. - if (pass.length > hash.blockSize) { - pass = hash.digest(pass); - assert(pass.length <= hash.blockSize); - } - - for (let i = 0; i < blocks; i++) { - const round = i + 1; - - state[salt.length + 0] = round >>> 24; - state[salt.length + 1] = round >>> 16; - state[salt.length + 2] = round >>> 8; - state[salt.length + 3] = round; - - const block = hash.mac(state, pass); - - let mac = block; - - for (let j = 1; j < iter; j++) { - mac = hash.mac(mac, pass); - - for (let k = 0; k < size; k++) - block[k] ^= mac[k]; - } - - block.copy(out, i * size); - } - - return out.slice(0, len); - } - - /** - * Execute pbkdf2 asynchronously. - * @param {Function} hash - * @param {Buffer} pass - * @param {Buffer} salt - * @param {Number} iter - * @param {Number} len - * @returns {Promise} - */ - - async function deriveAsync(hash, pass, salt, iter, len) { - if (typeof pass === 'string') - pass = bufferExports.Buffer.from(pass, 'utf8'); - - if (typeof salt === 'string') - salt = bufferExports.Buffer.from(salt, 'utf8'); - - if (salt == null) - salt = bufferExports.Buffer.alloc(0); - - assert(hash && typeof hash.id === 'string'); - assert(bufferExports.Buffer.isBuffer(pass)); - assert(bufferExports.Buffer.isBuffer(salt)); - assert((iter >>> 0) === iter); - assert((len >>> 0) === len); - - const name = getHash(hash); - - if (!subtle.importKey || !subtle.deriveBits || !name) - return derive(hash, pass, salt, iter, len); - - const algo = { name: 'PBKDF2' }; - const use = ['deriveBits']; - - const options = { - name: 'PBKDF2', - salt: salt, - iterations: iter, - hash: name - }; - - const key = await subtle.importKey('raw', pass, algo, false, use); - const out = await subtle.deriveBits(options, key, len * 8); - - return bufferExports.Buffer.from(out); - } - - /* - * Helpers - */ - - function getHash(hash) { - switch (hash.id) { - case 'SHA1': - return 'SHA-1'; - case 'SHA256': - return 'SHA-256'; - case 'SHA384': - return 'SHA-384'; - case 'SHA512': - return 'SHA-512'; - default: - return null; - } - } - - /* - * Expose - */ - - pbkdf2$2.native = 0; - pbkdf2$2.derive = derive; - pbkdf2$2.deriveAsync = deriveAsync; - return pbkdf2$2; - } - - /*! - * pbkdf2.js - pbkdf2 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var pbkdf2Browser; - var hasRequiredPbkdf2Browser; - - function requirePbkdf2Browser () { - if (hasRequiredPbkdf2Browser) return pbkdf2Browser; - hasRequiredPbkdf2Browser = 1; - - pbkdf2Browser = requirePbkdf2(); - return pbkdf2Browser; - } - - var pbkdf2BrowserExports = requirePbkdf2Browser(); - var pbkdf2$1 = /*@__PURE__*/getDefaultExportFromCjs(pbkdf2BrowserExports); - - var sha3; - var hasRequiredSha3; - - function requireSha3 () { - if (hasRequiredSha3) return sha3; - hasRequiredSha3 = 1; - - const Keccak = requireKeccak(); - - /** - * SHA3 - */ - - class SHA3 extends Keccak { - constructor() { - super(); - } - - final() { - return super.final(0x06, null); - } - - static hash() { - return new SHA3(); - } - - static hmac(bits) { - return super.hmac(bits, 0x06, null); - } - - static digest(data, bits) { - return super.digest(data, bits, 0x06, null); - } - - static root(left, right, bits) { - return super.root(left, right, bits, 0x06, null); - } - - static multi(x, y, z, bits) { - return super.multi(x, y, z, bits, 0x06, null); - } - - static mac(data, key, bits) { - return super.mac(data, key, bits, 0x06, null); - } - } - - /* - * Static - */ - - SHA3.native = 0; - SHA3.id = 'SHA3_256'; - SHA3.size = 32; - SHA3.bits = 256; - SHA3.blockSize = 136; - SHA3.zero = bufferExports.Buffer.alloc(32, 0x00); - SHA3.ctx = new SHA3(); - - /* - * Expose - */ - - sha3 = SHA3; - return sha3; - } - - /*! - * sha3.js - sha3 for bcrypto - * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License). - * https://github.com/bcoin-org/bcrypto - */ - - var sha3Browser; - var hasRequiredSha3Browser; - - function requireSha3Browser () { - if (hasRequiredSha3Browser) return sha3Browser; - hasRequiredSha3Browser = 1; - - sha3Browser = requireSha3(); - return sha3Browser; - } - - var sha3512; - var hasRequiredSha3512; - - function requireSha3512 () { - if (hasRequiredSha3512) return sha3512; - hasRequiredSha3512 = 1; - - const SHA3 = requireSha3Browser(); - - /** - * SHA3-512 - */ - - class SHA3_512 extends SHA3 { - constructor() { - super(); - } - - init() { - return super.init(512); - } - - static hash() { - return new SHA3_512(); - } - - static hmac() { - return super.hmac(512); - } - - static digest(data) { - return super.digest(data, 512); - } - - static root(left, right) { - return super.root(left, right, 512); - } - - static multi(x, y, z) { - return super.multi(x, y, z, 512); - } - - static mac(data, key) { - return super.mac(data, key, 512); - } - } - - /* - * Static - */ - - SHA3_512.native = SHA3.native; - SHA3_512.id = 'SHA3_512'; - SHA3_512.size = 64; - SHA3_512.bits = 512; - SHA3_512.blockSize = 72; - SHA3_512.zero = bufferExports.Buffer.alloc(64, 0x00); - SHA3_512.ctx = new SHA3_512(); - - /* - * Expose - */ - - sha3512 = SHA3_512; - return sha3512; - } - - var sha3512Exports = requireSha3512(); - var SHA3_512 = /*@__PURE__*/getDefaultExportFromCjs(sha3512Exports); - - class Ed448Goldilock { - static _channel = ed448; - static generatePrivateKey() { - var privateKey = ed448.privateKeyGenerate(); - privateKey[56] &= 0x7f; - return privateKey; - } - static getPublicKeyFromPrivateKey(privateKey) { - var secret = bufferExports.Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var scalar = secret.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - var publicKey = this._channel.publicKeyFromScalar(scalar); - return bufferExports.Buffer.from(publicKey).toString("hex"); - } - else { - var publicKey = this._channel.publicKeyCreate(secret); - return bufferExports.Buffer.from(publicKey).toString("hex"); - } - } - static signWithPrivateKey(privateKey, msg) { - var msgToSign = bufferExports.Buffer.from(msg, "hex"); - var secret = bufferExports.Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var prefix = secret.slice(0, 57); - prefix[0] &= 0xfc; - prefix[56] = 0; - prefix[55] |= 0x80; - var scalar = prefix.slice(0, 56); - var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return bufferExports.Buffer.from(signedMessage).toString("hex"); - } - else { - var signedMessage = this._channel.sign(msgToSign, secret); - return bufferExports.Buffer.from(signedMessage).toString("hex"); - } - } - static signWithPrivateKeyNConcatPubkey(privateKey, msg) { - var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); - var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); - return signedMessage + publicKey; - } - static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(bufferExports.Buffer.from(msgHash, "hex"), bufferExports.Buffer.from(signedMsg, "hex"), bufferExports.Buffer.from(pubKey, "hex")); - } - static SHA512Hash(password, salt) { - var p1 = bufferExports.Buffer.from(password, "hex"); - var s1 = bufferExports.Buffer.from(salt, "hex"); - return bufferExports.Buffer.from(pbkdf2$1.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); - } - static concatenateAndHex(prefix, key, index, salt) { - var ind = bufferExports.Buffer.alloc(4); - var p = bufferExports.Buffer.alloc(1); - p[0] = prefix % 256; - var j = index; - for (let i = 0; i < 4; i++) { - ind[i] = j % 256; - j = Math.floor(j / 256); - } - var t = p.toString("hex") + key + ind.toString("hex"); - return Ed448Goldilock.SHA512Hash(t, salt); - } - static addScalar(a, b) { - var a1 = bufferExports.Buffer.from(a, "hex"); - var b1 = bufferExports.Buffer.from(b.substr(0, 106) + "00000000", "hex"); - b1[0] &= 0xfc; - var c = bufferExports.Buffer.alloc(57); - var hold = 0; - for (let i = 0; i < 57; i++) { - hold += a1[i] + b1[i]; - c[i] = hold % 256; - hold = Math.floor(hold / 256); - } - return c.toString("hex"); - } - static seedToExtendedPrivate(seed) { - var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); - var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = bufferExports.Buffer.from(s2, "hex"); - b[56] |= 0x80; - b[55] |= 0x80; - b[55] &= 0xbf; - var s3 = b.toString("hex"); - return s1 + s3; - } - static childPrivateToPrivate(s, index) { - var s0 = s.substr(0, 114); - var s1 = s.substr(114, 228); - var r0, r1; - if (index >= 0x80000000) { - r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - else { - var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); - r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - } - static HDWalletGenerateKeyFromSeed(seed, index) { - var m = Ed448Goldilock.seedToExtendedPrivate(seed); - var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); - var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); - var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); - var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); - var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); - return k5.substr(114, 228); - } - } - - /* Browser Crypto Shims */ - function getGlobal$1() { - if (typeof globalThis !== "undefined") - return globalThis; - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); - } - const anyGlobal = getGlobal$1(); - const crypto = anyGlobal.crypto || anyGlobal.msCrypto; - function createHash(algo) { - switch (algo) { - case "ripemd160": - return ripemd160$1.create(); - case "sha256": - return sha256$2.create(); - case "sha512": - return sha512$1.create(); - case "sha3-256": - return sha3_256.create(); - case "sha3-512": - return sha3_512.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); - } - function createHmac(_algo, key) { - const algo = { sha256: sha256$2, sha512: sha512$1, "sha3-256": sha3_256, "sha3-512": sha3_512 }[_algo]; - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac$1.create(algo, key); - } - function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = { sha256: sha256$2, sha512: sha512$1 }[_algo]; - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2$3(algo, password, salt, { c: iterations, dkLen: keylen }); - } - function randomBytes$1(length) { - assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes", - }); - assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; - } - - const _sha256 = (data) => hexlify(createHash("sha3-256").update(data).digest()); - const _sha512 = (data) => hexlify(createHash("sha3-512").update(data).digest()); - let __sha256 = _sha256; - let __sha512 = _sha512; - let locked256 = false, locked512 = false; - /** - * Compute the cryptographic SHA3-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ - var SupportedAlgorithm; - (function (SupportedAlgorithm) { - SupportedAlgorithm["sha256"] = "sha256"; - SupportedAlgorithm["sha512"] = "sha512"; - })(SupportedAlgorithm || (SupportedAlgorithm = {})); - function sha256(data) { - return hexlify(__sha256(getBytes(data))); - } - function legacySha256(data) { - const _data = getBytes(data, "data"); - const hexlified = hexlify(createHash("sha256").update(_data).digest()); - return hexlified; - } - sha256._ = _sha256; - sha256.lock = function () { - locked256 = true; - }; - sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; - }; - Object.freeze(sha256); - /** - * Compute the cryptographic SHA3-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ - function sha512(data) { - return hexlify(__sha512(getBytes(data))); - } - sha512._ = _sha512; - sha512.lock = function () { - locked512 = true; - }; - sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; - }; - Object.freeze(sha512); - - /** - * Addresses are a fundamental part of interacting with Core. They - * represent the gloabal identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Core Naming Service (CNS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ - const logger$3 = new Logger("address/0.0.1"); - const precompiledAddresses = [ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000002", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000005", - "0000000000000000000000000000000000000000000000000000000000000006", - "0000000000000000000000000000000000000000000000000000000000000007", - "0000000000000000000000000000000000000000000000000000000000000008", - "0000000000000000000000000000000000000000000000000000000000000009", - ]; - function removeHexPrefix$1(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; - } - function calculateCheckSum(_address, _prefix) { - const address = getBytes("0x" + _address.replace("0x", "")); - const prefix = getBytes("0x" + _prefix.replace("0x", "")); - const tmpConcated = new Uint8Array([...address, ...prefix]); - const hexedConcat = hexlify(tmpConcated).replace("0x", "") + "00"; - const mods = Array.from(hexedConcat.toUpperCase(), (c) => { - const charCode = c.charCodeAt(0); - return charCode > 64 && charCode < 91 - ? (charCode - 55).toString() - : (charCode - 48).toString(); - }).join(""); - const bigVal = BigInt(mods); - const val97 = BigInt(97); - const val98 = BigInt(98); - const remainder = bigVal % val97; - const checkSum = val98 - remainder; - const result = checkSum > 9 ? checkSum.toString() : "0" + checkSum.toString(); - return result; - } - /** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Core uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ - function getAddress(address) { - if (typeof address !== "string") { - logger$3.throwArgumentError("invalid address", "address", address); - } - if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) { - logger$3.throwArgumentError("invalid address", "address", address); - } - const raw = removeHexPrefix$1(address); - if (precompiledAddresses.includes(raw)) { - return "0x" + raw; - } - const prefix = raw.substring(0, 2); - const val = raw.substring(4); - const checksum = calculateCheckSum(val, prefix); - if (checksum !== raw.substring(2, 4)) { - logger$3.throwArgumentError("bad address checksum", "address", address); - } - return "0x" + prefix + checksum + val; - } - function networkIdToPrefix(networkId) { - if (networkId == 1) { - return "cb"; - } - else if (networkId == 3 || networkId == 4) { - return "ab"; - } - else if (networkId > 10 || networkId == 0) { - return "ce"; - } - else { - logger$3.throwArgumentError("bad networkId", "networkId", networkId); - return ""; - } - } - - /** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ - let locked$4 = false; - const _computeHmac = function (algorithm, key, data) { - return createHmac(algorithm, key).update(data).digest(); - }; - let __computeHmac = _computeHmac; - /** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ - function computeHmac(algorithm, _key, _data) { - const key = getBytes(_key, "key"); - const data = getBytes(_data, "data"); - return hexlify(__computeHmac(algorithm, key, data)); - } - computeHmac._ = _computeHmac; - computeHmac.lock = function () { - locked$4 = true; - }; - computeHmac.register = function (func) { - if (locked$4) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; - }; - Object.freeze(computeHmac); - - let locked$3 = false; - const _ripemd160 = function (data) { - return ripemd160$1(data); - }; - let __ripemd160 = _ripemd160; - /** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ - function ripemd160(_data) { - const data = getBytes(_data, "data"); - return hexlify(__ripemd160(data)); - } - ripemd160._ = _ripemd160; - ripemd160.lock = function () { - locked$3 = true; - }; - ripemd160.register = function (func) { - if (locked$3) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; - }; - Object.freeze(ripemd160); - - /** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ - let locked$2 = false; - const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return pbkdf2Sync(password, salt, iterations, keylen, algo); - }; - let __pbkdf2 = _pbkdf2; - /** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ - function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); - } - pbkdf2._ = _pbkdf2; - pbkdf2.lock = function () { - locked$2 = true; - }; - pbkdf2.register = function (func) { - if (locked$2) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; - }; - Object.freeze(pbkdf2); - - /** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ - let locked$1 = false; - const _randomBytes = function (length) { - return new Uint8Array(randomBytes$1(length)); - }; - let __randomBytes = _randomBytes; - /** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ - function randomBytes(length) { - return __randomBytes(length); - } - randomBytes._ = _randomBytes; - randomBytes.lock = function () { - locked$1 = true; - }; - randomBytes.register = function (func) { - if (locked$1) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; - }; - Object.freeze(randomBytes); - - /** - * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt. - * @module - */ - // The main Scrypt loop: uses Salsa extensively. - // Six versions of the function were tried, this is the fastest one. - // RFC 7914 §3 / §4 step 2 applies Salsa20/8 to one 16-word (64-byte) block - // after xor'ing two such blocks. - // The local `y*` snapshot keeps the xor input stable even when `out` aliases `prev` or `input`. - // prettier-ignore - function XorAndSalsa(prev, pi, input, ii, out, oi) { - // Based on https://cr.yp.to/salsa20.html and RFC 7914's Salsa20/8 core. - // Xor blocks - let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++]; - let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++]; - let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++]; - let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++]; - let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++]; - let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++]; - let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++]; - let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++]; - // Save state to temporary variables (salsa) - let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15; - // Main loop (salsa) - for (let i = 0; i < 8; i += 2) { - x04 ^= rotl(x00 + x12 | 0, 7); - x08 ^= rotl(x04 + x00 | 0, 9); - x12 ^= rotl(x08 + x04 | 0, 13); - x00 ^= rotl(x12 + x08 | 0, 18); - x09 ^= rotl(x05 + x01 | 0, 7); - x13 ^= rotl(x09 + x05 | 0, 9); - x01 ^= rotl(x13 + x09 | 0, 13); - x05 ^= rotl(x01 + x13 | 0, 18); - x14 ^= rotl(x10 + x06 | 0, 7); - x02 ^= rotl(x14 + x10 | 0, 9); - x06 ^= rotl(x02 + x14 | 0, 13); - x10 ^= rotl(x06 + x02 | 0, 18); - x03 ^= rotl(x15 + x11 | 0, 7); - x07 ^= rotl(x03 + x15 | 0, 9); - x11 ^= rotl(x07 + x03 | 0, 13); - x15 ^= rotl(x11 + x07 | 0, 18); - x01 ^= rotl(x00 + x03 | 0, 7); - x02 ^= rotl(x01 + x00 | 0, 9); - x03 ^= rotl(x02 + x01 | 0, 13); - x00 ^= rotl(x03 + x02 | 0, 18); - x06 ^= rotl(x05 + x04 | 0, 7); - x07 ^= rotl(x06 + x05 | 0, 9); - x04 ^= rotl(x07 + x06 | 0, 13); - x05 ^= rotl(x04 + x07 | 0, 18); - x11 ^= rotl(x10 + x09 | 0, 7); - x08 ^= rotl(x11 + x10 | 0, 9); - x09 ^= rotl(x08 + x11 | 0, 13); - x10 ^= rotl(x09 + x08 | 0, 18); - x12 ^= rotl(x15 + x14 | 0, 7); - x13 ^= rotl(x12 + x15 | 0, 9); - x14 ^= rotl(x13 + x12 | 0, 13); - x15 ^= rotl(x14 + x13 | 0, 18); - } - // Write output (salsa) - out[oi++] = (y00 + x00) | 0; - out[oi++] = (y01 + x01) | 0; - out[oi++] = (y02 + x02) | 0; - out[oi++] = (y03 + x03) | 0; - out[oi++] = (y04 + x04) | 0; - out[oi++] = (y05 + x05) | 0; - out[oi++] = (y06 + x06) | 0; - out[oi++] = (y07 + x07) | 0; - out[oi++] = (y08 + x08) | 0; - out[oi++] = (y09 + x09) | 0; - out[oi++] = (y10 + x10) | 0; - out[oi++] = (y11 + x11) | 0; - out[oi++] = (y12 + x12) | 0; - out[oi++] = (y13 + x13) | 0; - out[oi++] = (y14 + x14) | 0; - out[oi++] = (y15 + x15) | 0; - } - function BlockMix(input, ii, out, oi, r) { - // The block B is `r` 128-byte chunks, i.e. `2r` 16-word (64-byte) Salsa blocks. - let head = oi + 0; - let tail = oi + 16 * r; - for (let i = 0; i < 16; i++) - out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1] - for (let i = 0; i < r; i++, head += 16, ii += 16) { - // RFC 7914 §4 step 3 outputs `Y[0], Y[2], ...` first, then `Y[1], Y[3], ...`; - // `head` and `tail` lay out those even/odd halves in place. - XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1]) - if (i > 0) - tail += 16; // First iteration overwrites tmp value in tail - // tail[i] = Salsa(blockIn[2*i+1] ^ head[i]) - XorAndSalsa(out, head, input, (ii += 16), out, tail); - } - } - // 128*r*(N+p+1) for N=2**20, r=8, p=1: 1 GiB main table plus 2 KiB workspace. - const SCRYPT_DEFAULT_MAXMEM = 128 * 8 * (2 ** 20 + 1 + 1); - // Common prologue and epilogue for sync/async functions - function scryptInit(password, salt, _opts) { - const opts = checkOpts({ - dkLen: 32, - asyncTick: 10, - maxmem: SCRYPT_DEFAULT_MAXMEM, - }, _opts); - const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts; - anumber(N, 'N'); - anumber(r, 'r'); - anumber(p, 'p'); - anumber(dkLen, 'dkLen'); - anumber(asyncTick, 'asyncTick'); - anumber(maxmem, 'maxmem'); - if (onProgress !== undefined && typeof onProgress !== 'function') - throw new Error('"onProgress" must be a function'); - // Without this, r=0 slips through: blockSize=0 turns the `p` upper bound into - // Infinity and the failure surfaces later as a confusing pbkdf2 dkLen error. - if (r < 1) - throw new Error('"r" expected integer >= 1'); - const blockSize = 128 * r; - const blockSize32 = blockSize / 4; - // Max N is 2^32 (Integrify is 32-bit). - // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB. - // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs, - // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error: - // https://www.rfc-editor.org/errata_search.php?rfc=7914 - const pow32 = Math.pow(2, 32); - if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32) - throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32'); - if (p < 1 || p > ((pow32 - 1) * 32) / blockSize) - throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)'); - // RFC 7914 §2 defines `dkLen` as a positive integer. - if (dkLen < 1 || dkLen > (pow32 - 1) * 32) - throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32'); - // Include the shared `tmp` scratch block so `maxmem` matches noble's actual temporary allocation. - // Node requires more headroom here, so this accounting is intentionally noble-specific. - const memUsed = blockSize * (N + p + 1); - if (memUsed > maxmem) - throw new Error('"maxmem" limit was hit: memUsed(128*r*(N+p+1))=' + memUsed + ', maxmem=' + maxmem); - // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor) - // Since it has only one iteration there is no reason to use async variant - const B = pbkdf2$3(sha256$2, password, salt, { c: 1, dkLen: blockSize * p }); - const B32 = u32(B); - // Re-used between parallel iterations. Array(iterations) of B - const V = u32(new Uint8Array(blockSize * N)); - const tmp = u32(new Uint8Array(blockSize)); - let blockMixCb = () => { }; - if (onProgress) { - const totalBlockMix = 2 * N * p; - // Invoke callback if progress changes from 10.01 to 10.02 - // Allows to draw smooth progress bar on up to 8K screen - const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1); - let blockMixCnt = 0; - blockMixCb = () => { - blockMixCnt++; - if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) { - // Wiping here instead of a try/catch around the main loops keeps them - // try-free: measured ~1% slower at N=2^21 with the loops inside a try. - // onProgress is the only user code that can throw mid-derivation. - try { - onProgress(blockMixCnt / totalBlockMix); - } - catch (e) { - clean(B, V, tmp); - throw e; - } - } - }; - } - return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick }; - } - function scryptOutput(password, dkLen, B, V, tmp) { - // Shared final PBKDF2-and-cleanup step: keep the derived key, wipe the scrypt workspace. - const res = pbkdf2$3(sha256$2, password, B, { c: 1, dkLen }); - clean(B, V, tmp); - return res; - } - /** - * Scrypt KDF from RFC 7914. See {@link ScryptOpts}. - * @param password - password or key material to derive from; - * JS string inputs are UTF-8 encoded first - * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first - * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided, - * must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}. - * @returns Derived key bytes. - * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error} - * @example - * Derive a key with scrypt. - * ```ts - * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - * ``` - * @example - * Derive a key with small demo costs and progress/memory controls. - * ```ts - * const progressLog: number[] = []; - * scrypt('password', 'salt', { - * N: 16, - * r: 8, - * p: 1, - * dkLen: 32, - * maxmem: 1024 * 1024, - * asyncTick: 10, - * onProgress(progress) { - * progressLog.push(progress); - * }, - * }); - * ``` - */ - function scrypt$1(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - for (let i = 0, pos = 0; i < N - 1; i++) { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - } - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - for (let i = 0; i < N; i++) { - // First u32 of the last 64-byte block (u32 is LE) - // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N - // only depends on the low word here because N is a power of two and - // this implementation caps N at 2^32. - // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked - // above; >>> 0 for unsigned, input fits in u32. - const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations - // tmp = B ^ V[j] - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - } - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); - } - /** - * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}. - * @param password - password or key material to derive from; - * JS string inputs are UTF-8 encoded first - * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first - * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided, - * must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local - * scheduler-yield control for this JS wrapper, not part of RFC 7914. - * See {@link ScryptOpts}. - * @returns Promise resolving to derived key bytes. - * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error} - * @example - * Derive a key with scrypt asynchronously. - * ```ts - * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 }); - * ``` - * @example - * Derive a key asynchronously with small demo costs and progress/memory controls. - * ```ts - * await scryptAsync('password', 'salt', { - * N: 16, - * r: 8, - * p: 1, - * dkLen: 32, - * maxmem: 1024 * 1024, - * asyncTick: 1, - * onProgress(progress) { - * if (progress > 1) throw new Error('invalid progress'); - * }, - * }); - * ``` - */ - async function scryptAsync(password, salt, opts) { - const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts); - // One failure handler covers both yield boundaries without putting the hot loops in a try block. - const abort = () => clean(B, V, tmp); - swap32IfBE(B32); - for (let pi = 0; pi < p; pi++) { - const Pi = blockSize32 * pi; - for (let i = 0; i < blockSize32; i++) - V[i] = B32[Pi + i]; // V[0] = B[i] - let pos = 0; - await asyncLoop(N - 1, asyncTick, () => { - BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]); - blockMixCb(); - }, abort); - BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element - blockMixCb(); - await asyncLoop(N, asyncTick, () => { - // First u32 of the last 64-byte block (u32 is LE) - // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N - // only depends on the low word here because N is a power of two and - // this implementation caps N at 2^32. - // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked - // above; >>> 0 for unsigned, input fits in u32. - const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations - // tmp = B ^ V[j] - for (let k = 0; k < blockSize32; k++) - tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k]; - BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j]) - blockMixCb(); - }, abort); - } - swap32IfBE(B32); - return scryptOutput(password, dkLen, B, V, tmp); - } - - let lockedSync = false, lockedAsync = false; - const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await scryptAsync(passwd, salt, { N, r, p, dkLen, onProgress }); - }; - const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return scrypt$1(passwd, salt, { N, r, p, dkLen }); - }; - let __scryptAsync = _scryptAsync; - let __scryptSync = _scryptSync; - /** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ - async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); - } - scrypt._ = _scryptAsync; - scrypt.lock = function () { - lockedAsync = true; - }; - scrypt.register = function (func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; - }; - Object.freeze(scrypt); - /** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ - function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return hexlify(__scryptSync(passwd, salt, N, r, p, dkLen)); - } - scryptSync._ = _scryptSync; - scryptSync.lock = function () { - lockedSync = true; - }; - scryptSync.register = function (func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; - }; - Object.freeze(scryptSync); - - /** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ - let locked = false; - const _keccak256 = function (data) { - return keccak_256(data); - }; - let __keccak256 = _keccak256; - /** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ - function keccak256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); - } - keccak256._ = _keccak256; - keccak256.lock = function () { - locked = true; - }; - keccak256.register = function (func) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; - }; - Object.freeze(keccak256); - - /** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ - const logger$2 = new Logger("signing-key/0.0.1"); - /** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ - class SigningKey { - #privateKey; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - const normalized = typeof privateKey === "string" && !privateKey.startsWith("0x") - ? "0x" + privateKey - : privateKey; - assertArgument(dataLength(normalized) === 57, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify(normalized); - } - /** - * The private key. - */ - get privateKey() { - return this.#privateKey; - } - /** The 57-byte Ed448 public key encoded as hex. */ - get publicKey() { - return SigningKey.computePublicKey(this.#privateKey); - } - /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ - get compressedPublicKey() { - return SigningKey.computePublicKey(this.#privateKey, true); - } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest) { - const key = getBytesCopy(this.#privateKey); - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const keyBuffer = new Uint8Array(arrayify(key)); - if (keyBuffer.length !== 57) { - logger$2.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - const digestBuffer = new Uint8Array(arrayify(digest)); - if (digestBuffer.length !== 32) { - logger$2.throwArgumentError("bad digest length", "digest", digest); - } - if (keyBuffer[56] > 127) { - const prefix = keyBuffer.slice(0, 57); - prefix[0] &= 0xfc; - prefix[55] |= 0x80; - prefix[56] = 0; - const scalar = prefix.slice(0, 56); - const bufferDigest = bufferExports.Buffer.from(digestBuffer); - const bufferPrfx = bufferExports.Buffer.from(prefix); - const bufferScalar = bufferExports.Buffer.from(scalar); - const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - const sig = ed448.sign(bufferExports.Buffer.from(digestBuffer), bufferExports.Buffer.from(keyBuffer)); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ - computeSharedSecret(other) { - const pub = bufferExports.Buffer.from(getBytesCopy(other)); - assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), "invalid public key", "other", other); - const key = bufferExports.Buffer.from(getBytesCopy(this.#privateKey)); - if (key[56] > 127) { - const scalar = key.subarray(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - return hexlify(ed448.deriveWithScalar(pub, scalar)); - } - return hexlify(ed448.derive(pub, key)); - } - /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ - static computePublicKey(key, compressed) { - const bytes = bufferExports.Buffer.from(arrayify(key)); - if (bytes.length !== 57) { - logger$2.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - if (bytes[56] > 127) { - const scalar = bytes.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - const pub = ed448.publicKeyFromScalar(scalar); - return hexlify(pub); - } - const pub = ed448.publicKeyCreate(bytes); - return hexlify(pub); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest, signature) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const digestBuffer = bufferExports.Buffer.from(arrayify(digest)); - const sigBuffer = bufferExports.Buffer.from(arrayify(signature)); - if (sigBuffer.length !== 171) { - logger$2.throwArgumentError("invalid signature", "signature", signature); - } - const sig = sigBuffer.slice(0, 114); - const pub = sigBuffer.slice(114); - if (ed448.verify(digestBuffer, sig, pub)) { - return hexlify(pub); - } - logger$2.throwArgumentError("invalid signature", "signature", signature); - return ""; - } - /** Adds two encoded Ed448 public points. The compression flag is ignored. */ - static addPoints(p0, p1, compressed) { - const points = [p0, p1].map((point) => { - const bytes = bufferExports.Buffer.from(getBytesCopy(point)); - assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), "invalid public key", "point", point); - return bytes; - }); - return hexlify(ed448.publicKeyCombine(points)); - } - } - - // Constants - const BN_0$6 = BigInt(0); - const BN_1$3 = BigInt(1); - const BN_2$1 = BigInt(2); - const BN_27 = BigInt(27); - const BN_28 = BigInt(28); - const BN_35 = BigInt(35); - const _guard$4 = {}; - /** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ - class Signature { - #r; - #s; - #v; - #networkV; - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { - return this.#r; - } - set r(value) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - this.#r = hexlify(value); - } - /** - * The ``s`` value for a signature. - */ - get s() { - return this.#s; - } - set s(_value) { - assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); - const value = hexlify(_value); - assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); - this.#s = value; - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { - return this.#v; - } - set v(value) { - const v = getNumber(value, "value"); - assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { - return this.#networkV; - } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacynetworkId() { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getnetworkId(v); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return this.v === 27 ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - // The EIP-2098 compact representation - const yParityAndS = getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return hexlify(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return concat([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); - } - /** - * @private - */ - constructor(guard, r, s, v) { - assertPrivate(guard, _guard$4, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - [Symbol.for("nodejs.util.inspect.custom")]() { - return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone = new Signature(_guard$4, this.r, this.s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: networkV != null ? networkV.toString() : null, - r: this.r, - s: this.s, - v: this.v, - }; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getnetworkId(45) - * //_result: - * - * Signature.getnetworkId(46) - * //_result: - */ - static getnetworkId(v) { - const bv = getBigInt(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if (bv == BN_27 || bv == BN_28) { - return BN_0$6; - } - // Bad value for an EIP-155 v - assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); - return (bv - BN_35) / BN_2$1; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getnetworkIdV(5, 27) - * //_result: - * - * Signature.getnetworkIdV(5, 28) - * //_result: - * - */ - static getnetworkIdV(networkId, v) { - return getBigInt(networkId) * BN_2$1 + BigInt(35 + v - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v) { - const bv = getBigInt(v); - if (bv === BN_0$6 || bv === BN_27) { - return 27; - } - if (bv === BN_1$3 || bv === BN_28) { - return 28; - } - assertArgument(bv >= BN_35, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return bv & BN_1$3 ? 27 : 28; - } - } - - /** - * A fundamental building block of Core is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ - function lock() { - computeHmac.lock(); - pbkdf2.lock(); - randomBytes.lock(); - ripemd160.lock(); - scrypt.lock(); - scryptSync.lock(); - sha256.lock(); - sha512.lock(); - randomBytes.lock(); - } - - /** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ - function removeHexPrefix(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; - } - function publicToAddress(key, prefix) { - const val = hexDataSlice(sha256(key), 12); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); - } - function computeAddress(key, prefix) { - let pubkey; - if (typeof key === "string") { - pubkey = SigningKey.computePublicKey(key, false); - } - else { - pubkey = key.publicKey; - } - return publicToAddress(pubkey, prefix); // getAddress(sha256("0x" + pubkey.substring(4)).substring(26)); - } - /** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ - function recoverAddress(digest, signature, prefix) { - // return computeAddress(SigningKey.recoverPublicKey(digest, signature)); - const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature); - return publicToAddress(publicKey, prefix); - } - function extractPrefix(address) { - address = getAddress(address); - return address.substring(2, 4); - } - - /** - * @_ignore: - */ - const WordSize = 32; - const Padding = new Uint8Array(WordSize); - // Properties used to immediate pass through to the underlying object - // - `then` is used to detect if an object is a Promise for await - const passProperties$1 = ["then"]; - const _guard$3 = {}; - function throwError(name, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); - wrapped.error = error; - throw wrapped; - } - /** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ - class Result extends Array { - #names; - /** - * @private - */ - constructor(...args) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap = true; - if (guard !== _guard$3) { - items = args; - names = []; - wrap = false; - } - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { - this[index] = item; - }); - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof name === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, new Map()); - // Remove any key thats not unique - this.#names = Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - })); - if (!wrap) { - return; - } - // A wrapped Result is immutable - Object.freeze(this); - // Proxy indices and names so we can trap deferred errors - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof prop === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - // Pass important checks (like `then` for Promise) through - if (passProperties$1.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (...args) { - return value.apply(this === receiver ? target : this, args); - }; - } - else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply(this === receiver ? target : this, [ - prop, - ]); - } - } - return Reflect.get(target, prop, receiver); - }, - }); - } - /** - * Returns the Result as a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray() { - const result = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject() { - return this.#names.reduce((accum, name, index) => { - assert(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", { - operation: "toObject()", - }); - // Add values for names that don't conflict - if (!(name in accum)) { - accum[name] = this.getValue(name); - } - return accum; - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const result = [], names = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(this.#names[i]); - } - return new Result(_guard$3, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const result = [], names = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(this.#names[i]); - } - } - return new Result(_guard$3, result, names); - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name) { - const index = this.#names.indexOf(name); - if (index === -1) { - return undefined; - } - const value = this[index]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys) { - return new Result(_guard$3, items, keys); - } - } - /** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ - function checkResultErrors(result) { - // Find the first error (if any) - const errors = []; - const checkErrors = function (path, object) { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - try { - checkErrors(childPath, object[key]); - } - catch (error) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - return errors; - } - function getValue$1(value) { - let bytes = toBeArray(value); - assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: WordSize, - offset: bytes.length, - }); - if (bytes.length !== WordSize) { - bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes])); - } - return bytes; - } - /** - * @_ignore - */ - class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - name; - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - type; - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - localName; - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - dynamic; - constructor(name, type, localName, dynamic) { - defineProperties(this, { name, type, localName, dynamic }, { - name: "string", - type: "string", - localName: "string", - dynamic: "boolean", - }); - } - _throwError(message, value) { - assertArgument(false, message, this.localName, value); - } - } - /** - * @_ignore - */ - class Writer { - // An array of WordSize lengthed objects to concatenation - #data; - #dataLength; - constructor() { - this.#data = []; - this.#dataLength = 0; - } - get data() { - return concat(this.#data); - } - get length() { - return this.#dataLength; - } - #writeData(data) { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - appendWriter(writer) { - return this.#writeData(getBytesCopy(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes = getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return this.#writeData(getValue$1(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value) => { - this.#data[offset] = getValue$1(value); - }; - } - } - /** - * @_ignore - */ - class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - allowLoose; - #data; - #offset; - constructor(data, allowLoose) { - defineProperties(this, { allowLoose: !!allowLoose }); - this.#data = getBytesCopy(data); - this.#offset = 0; - } - get data() { - return hexlify(this.#data); - } - get dataLength() { - return this.#data.length; - } - get consumed() { - return this.#offset; - } - get bytes() { - return new Uint8Array(this.#data); - } - #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && - loose && - this.#offset + length <= this.#data.length) { - alignedLength = length; - } - else { - assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength, - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset) { - return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose); - } - // Read bytes - readBytes(length, loose) { - let bytes = this.#peekBytes(0, length, !!loose); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - // Read a numeric values - readValue() { - return toBigInt(this.readBytes(WordSize)); - } - readIndex() { - return toNumber(this.readBytes(WordSize)); - } - } - - /** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ - const _gaurd = {}; - function n(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { - signed, - width, - }); - } - function b(value, size) { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size }); - } - const _typedSymbol = Symbol.for("_corebc_typed"); - class Typed { - type; - value; - #options; - _typedSymbol; - constructor(gaurd, type, value, options) { - if (options == null) { - options = null; - } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - // Check the value is valid - this.format(); - } - format() { - if (this.type === "array") { - throw new Error(""); - } - else if (this.type === "dynamicArray") { - throw new Error(""); - } - else if (this.type === "tuple") { - return `tuple(${this.value.map((v) => v.format()).join(",")})`; - } - return this.type; - } - defaultValue() { - return 0; - } - minValue() { - return 0; - } - maxValue() { - return 0; - } - isBigInt() { - return !!this.type.match(/^u?int[0-9]+$/); - } - isData() { - return this.type.startsWith("bytes"); - } - isString() { - return this.type === "string"; - } - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return this.value.length; - } - return null; - } - static from(type, value) { - return new Typed(_gaurd, type, value); - } - static uint8(v) { - return n(v, 8); - } - static uint16(v) { - return n(v, 16); - } - static uint24(v) { - return n(v, 24); - } - static uint32(v) { - return n(v, 32); - } - static uint40(v) { - return n(v, 40); - } - static uint48(v) { - return n(v, 48); - } - static uint56(v) { - return n(v, 56); - } - static uint64(v) { - return n(v, 64); - } - static uint72(v) { - return n(v, 72); - } - static uint80(v) { - return n(v, 80); - } - static uint88(v) { - return n(v, 88); - } - static uint96(v) { - return n(v, 96); - } - static uint104(v) { - return n(v, 104); - } - static uint112(v) { - return n(v, 112); - } - static uint120(v) { - return n(v, 120); - } - static uint128(v) { - return n(v, 128); - } - static uint136(v) { - return n(v, 136); - } - static uint144(v) { - return n(v, 144); - } - static uint152(v) { - return n(v, 152); - } - static uint160(v) { - return n(v, 160); - } - static uint168(v) { - return n(v, 168); - } - static uint176(v) { - return n(v, 176); - } - static uint184(v) { - return n(v, 184); - } - static uint192(v) { - return n(v, 192); - } - static uint200(v) { - return n(v, 200); - } - static uint208(v) { - return n(v, 208); - } - static uint216(v) { - return n(v, 216); - } - static uint224(v) { - return n(v, 224); - } - static uint232(v) { - return n(v, 232); - } - static uint240(v) { - return n(v, 240); - } - static uint248(v) { - return n(v, 248); - } - static uint256(v) { - return n(v, 256); - } - static uint(v) { - return n(v, 256); - } - static int8(v) { - return n(v, -8); - } - static int16(v) { - return n(v, -16); - } - static int24(v) { - return n(v, -24); - } - static int32(v) { - return n(v, -32); - } - static int40(v) { - return n(v, -40); - } - static int48(v) { - return n(v, -48); - } - static int56(v) { - return n(v, -56); - } - static int64(v) { - return n(v, -64); - } - static int72(v) { - return n(v, -72); - } - static int80(v) { - return n(v, -80); - } - static int88(v) { - return n(v, -88); - } - static int96(v) { - return n(v, -96); - } - static int104(v) { - return n(v, -104); - } - static int112(v) { - return n(v, -112); - } - static int120(v) { - return n(v, -120); - } - static int128(v) { - return n(v, -128); - } - static int136(v) { - return n(v, -136); - } - static int144(v) { - return n(v, -144); - } - static int152(v) { - return n(v, -152); - } - static int160(v) { - return n(v, -160); - } - static int168(v) { - return n(v, -168); - } - static int176(v) { - return n(v, -176); - } - static int184(v) { - return n(v, -184); - } - static int192(v) { - return n(v, -192); - } - static int200(v) { - return n(v, -200); - } - static int208(v) { - return n(v, -208); - } - static int216(v) { - return n(v, -216); - } - static int224(v) { - return n(v, -224); - } - static int232(v) { - return n(v, -232); - } - static int240(v) { - return n(v, -240); - } - static int248(v) { - return n(v, -248); - } - static int256(v) { - return n(v, -256); - } - static int(v) { - return n(v, -256); - } - static bytes1(v) { - return b(v, 1); - } - static bytes2(v) { - return b(v, 2); - } - static bytes3(v) { - return b(v, 3); - } - static bytes4(v) { - return b(v, 4); - } - static bytes5(v) { - return b(v, 5); - } - static bytes6(v) { - return b(v, 6); - } - static bytes7(v) { - return b(v, 7); - } - static bytes8(v) { - return b(v, 8); - } - static bytes9(v) { - return b(v, 9); - } - static bytes10(v) { - return b(v, 10); - } - static bytes11(v) { - return b(v, 11); - } - static bytes12(v) { - return b(v, 12); - } - static bytes13(v) { - return b(v, 13); - } - static bytes14(v) { - return b(v, 14); - } - static bytes15(v) { - return b(v, 15); - } - static bytes16(v) { - return b(v, 16); - } - static bytes17(v) { - return b(v, 17); - } - static bytes18(v) { - return b(v, 18); - } - static bytes19(v) { - return b(v, 19); - } - static bytes20(v) { - return b(v, 20); - } - static bytes21(v) { - return b(v, 21); - } - static bytes22(v) { - return b(v, 22); - } - static bytes23(v) { - return b(v, 23); - } - static bytes24(v) { - return b(v, 24); - } - static bytes25(v) { - return b(v, 25); - } - static bytes26(v) { - return b(v, 26); - } - static bytes27(v) { - return b(v, 27); - } - static bytes28(v) { - return b(v, 28); - } - static bytes29(v) { - return b(v, 29); - } - static bytes30(v) { - return b(v, 30); - } - static bytes31(v) { - return b(v, 31); - } - static bytes32(v) { - return b(v, 32); - } - static address(v) { - return new Typed(_gaurd, "address", v); - } - static bool(v) { - return new Typed(_gaurd, "bool", !!v); - } - static bytes(v) { - return new Typed(_gaurd, "bytes", v); - } - static string(v) { - return new Typed(_gaurd, "string", v); - } - static array(v, dynamic) { - throw new Error("not implemented yet"); - } - static tuple(v, name) { - throw new Error("not implemented yet"); - } - static overrides(v) { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return value && value._typedSymbol === _typedSymbol; - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type) { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } - } - - /** - * @_ignore - */ - class AddressCoder extends Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value) { - let value = Typed.dereference(_value, "string"); - try { - value = getAddress(value); - } - catch (error) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - decode(reader) { - return getAddress(toBeHex(reader.readValue(), 22)); - } - } - - /** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ - class AnonymousCoder extends Coder { - coder; - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } - } - - /** - * @_ignore - */ - function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } - else if (values && typeof values === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name = coder.localName; - assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name] = true; - return values[name]; - }); - } - else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - let updateFuncs = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } - else { - coder.encode(staticWriter, value); - } - }); - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { - func(staticWriter.length); - }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; - } - /** - * @_ignore - */ - function unpack(reader, coders) { - let values = []; - let keys = []; - // A reader anchored to this base - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - else { - try { - value = coder.decode(reader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == undefined) { - throw new Error("investigate"); - } - values.push(value); - keys.push(coder.localName || null); - }); - return Result.fromItems(values, keys); - } - /** - * @_ignore - */ - class ArrayCoder extends Coder { - coder; - length; - constructor(coder, length, localName) { - const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; - const dynamic = length === -1 || coder.dynamic; - super("array", type, localName, dynamic); - defineProperties(this, { coder, length }); - } - defaultValue() { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { - buffer: reader.bytes, - offset: count * WordSize, - length: reader.dataLength, - }); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } - } - - /** - * @_ignore - */ - class BooleanCoder extends Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } - } - - /** - * @_ignore - */ - class DynamicBytesCoder extends Coder { - constructor(type, localName) { - super(type, type, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } - } - /** - * @_ignore - */ - class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return hexlify(super.decode(reader)); - } - } - - /** - * @_ignore - */ - class FixedBytesCoder extends Coder { - size; - constructor(size, localName) { - let name = "bytes" + String(size); - super(name, name, localName, false); - defineProperties(this, { size }, { size: "number" }); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); - } - encode(writer, _value) { - let data = getBytesCopy(Typed.dereference(_value, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data); - } - decode(reader) { - return hexlify(reader.readBytes(this.size)); - } - } - - const Empty = new Uint8Array([]); - /** - * @_ignore - */ - class NullCoder extends Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } - } - - const BN_0$5 = BigInt(0); - const BN_1$2 = BigInt(1); - const BN_MAX_UINT256$1 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - /** - * @_ignore - */ - class NumberCoder extends Coder { - size; - signed; - constructor(size, signed, localName) { - const name = (signed ? "int" : "uint") + size * 8; - super(name, name, localName, false); - defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value) { - let value = getBigInt(Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = mask(BN_MAX_UINT256$1, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, this.size * 8 - 1); - if (value > bounds || value < -(bounds + BN_1$2)) { - this._throwError("value out-of-bounds", _value); - } - value = toTwos(value, 8 * WordSize); - } - else if (value < BN_0$5 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - return writer.writeValue(value); - } - decode(reader) { - let value = mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = fromTwos(value, this.size * 8); - } - return value; - } - } - - /** - * @_ignore - */ - class StringCoder extends DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value) { - return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); - } - decode(reader) { - return toUtf8String(super.decode(reader)); - } - } - - /** - * @_ignore - */ - class TupleCoder extends Coder { - coders; - constructor(coders, localName) { - let dynamic = false; - const types = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = "tuple(" + types.join(",") + ")"; - super("tuple", type, localName, dynamic); - defineProperties(this, { - coders: Object.freeze(coders.slice()), - }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, {}); - // Add named values - this.coders.forEach((coder, index) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } - if (name === "length") { - name = "_length"; - } - if (values[name] != null) { - return; - } - values[name] = values[index]; - }); - return Object.freeze(values); - } - encode(writer, _value) { - const value = Typed.dereference(_value, "tuple"); - return pack(writer, this.coders, value); - } - decode(reader) { - return unpack(reader, this.coders); - } - } - - /** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * - * @example: - * id("hello world") - * //_result: - */ - function id(value, useKeccak) { - if (useKeccak) { - return keccak256(toUtf8Bytes(value)); - } - return sha256(toUtf8Bytes(value)); - } - - /** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ - const ZeroAddress = "0x0000000000000000000000000000000000000000"; - - /** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ - const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; - - /** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ - const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); - /** - * A constant for the number of ore in a single xcb. - * - * (**i.e.** ``1000000000000000000n``) - */ - const OrePerXCB = BigInt("1000000000000000000"); - /** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ - const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - /** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ - const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * - BigInt(-1); - /** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ - const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - - // NFKC (composed) // (decomposed) - /** - * A constant for the core symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ - const CoreSymbol = "\u039e"; // "\uD835\uDF63"; - /** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Core Signed Message:\\n"``) - */ - const MessagePrefix = "\x19Core Signed Message:\n"; - - function accessSetify(addr, storageKeys) { - return { - address: getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); - return storageKey.toLowerCase(); - }), - }; - } - /** - * Returns a [[AccessList]] from any corebcsupported access-list structure. - */ - function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set, index) => { - if (Array.isArray(set)) { - assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); - return accessSetify(set[0], set[1]); - } - assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => a.address.localeCompare(b.address)); - return result; - } - - const logger$1 = new Logger("transaction/0.0.1"); - const BN_0$4 = BigInt(0); - function handleAddress(value) { - if (value === "0x") { - return null; - } - return getAddress(value); - } - function parse(data) { - const handleNumber = (value) => { - // @ts-ignore - if (value === "0x") { - return BigNumber.from(0); - } - return BigNumber.from(value); - }; - const transaction = decode$1(data); - if (transaction.length !== 7 && transaction.length !== 8) { - logger$1.throwArgumentError("invalid raw transaction", "data", data); - } - const isSigned = transaction.length === 8; - const tx = { - nonce: Number(handleNumber(transaction[0])), - energyPrice: handleNumber(transaction[1]).toBigInt(), - energyLimit: handleNumber(transaction[2]).toBigInt(), - networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(), - to: handleAddress(transaction[isSigned ? 4 : 3]), - value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(), - data: transaction[isSigned ? 6 : 5], - }; - if (transaction.length === 8) { - const prefix = networkIdToPrefix(Number(tx.networkId)); - const digest = sha256(serialize(tx)); - tx.hash = sha256(serialize(tx, transaction[7])); - tx.from = recoverAddress(digest, transaction[7], prefix); - tx.signature = transaction[7]; - } - return tx; - } - const unsignedTransactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, - { name: "networkId", maxLength: 32, numeric: true }, - ]; - const transactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "networkId", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, - ]; - const allowedTransactionKeys = { - networkId: true, - data: true, - energyLimit: true, - energyPrice: true, - nonce: true, - to: true, - value: true, - }; - function serialize(transaction, signature) { - checkProperties(transaction, allowedTransactionKeys); - const raw = []; - (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) { - let value = transaction[name] || []; - const options = {}; - if (numeric) { - options.hexPad = "left"; - } - const tmpHexlified = hexlify(value, options); - value = arrayify(tmpHexlified); - // Fixed-width field - if (length && value.length !== length && value.length > 0) { - logger$1.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - // Variable-width (with a maximum) - if (maxLength) { - value = stripZeros(value); - if (value.length > maxLength) { - logger$1.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - } - const hexlified = hexlify(value); - raw.push(hexlified); - }); - if (!!signature) { - raw.push(hexlify(signature)); - } - const finalValue = encode(raw); - return finalValue; - } - /** - * A **Transaction** describes an operation to be executed on - * Core by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in corebc) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ - class Transaction { - #to; - #data; - #nonce; - #energyLimit; - #energyPrice; - #value; - #networkId; - #sig; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - return this.#to; - } - set to(value) { - this.#to = value == null ? null : getAddress(value); - } - /** - * The transaction nonce. - */ - get nonce() { - return this.#nonce; - } - set nonce(value) { - this.#nonce = getNumber(value, "value"); - } - /** - * The energy limit. - */ - get energyLimit() { - return this.#energyLimit; - } - set energyLimit(value) { - this.#energyLimit = getBigInt(value); - } - /** - * The energy price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get energyPrice() { - const value = this.#energyPrice; - if (value == null) { - return BN_0$4; - } - return value; - } - set energyPrice(value) { - this.#energyPrice = value == null ? null : getBigInt(value, "energyPrice"); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { - return this.#data; - } - set data(value) { - this.#data = hexlify(value); - } - /** - * The amount of xcb (in ore) to send in this transactions. - */ - get value() { - return this.#value; - } - set value(value) { - this.#value = getBigInt(value, "value"); - } - /** - * The chain ID this transaction is valid on. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = getBigInt(value); - } - /** - * If signed, the signature for this transaction. - */ - get signature() { - return this.#sig || null; - } - set signature(value) { - this.#sig = value == null ? null : value; - } - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#to = null; - this.#nonce = 0; - this.#energyLimit = BigInt(0); - this.#energyPrice = null; - this.#data = "0x"; - this.#value = BigInt(0); - this.#networkId = BigInt(0); - this.#sig = null; - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return sha256(this.serialized); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return sha256(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - const prefix = networkIdToPrefix(Number(this.#networkId)); - return recoverAddress(this.unsignedHash, this.signature, prefix); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - //isSigned(): this is SignedTransaction { - return this.signature != null; - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - assert(this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - return serialize(this, this.signature); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return serialize(this); - } - /** - * Create a copy of this transaciton. - */ - clone() { - return Transaction.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s = (v) => { - if (v == null) { - return null; - } - return v.toString(); - }; - return { - to: this.to, - data: this.data, - nonce: this.nonce, - energyLimit: s(this.energyLimit), - energyPrice: s(this.energyPrice), - value: s(this.value), - networkId: s(this.networkId), - sig: this.signature ? this.signature : null, - }; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new Transaction(); - } - if (typeof tx === "string") { - const payload = getBytes(tx); - return Transaction.from(parse(payload)); - } - const result = new Transaction(); - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.energyLimit != null) { - result.energyLimit = tx.energyLimit; - } - if (tx.energyPrice != null) { - result.energyPrice = tx.energyPrice; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.networkId != null) { - result.networkId = tx.networkId; - } - if (tx.signature != null) { - result.signature = tx.signature; - } - if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); - assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } - } - - /** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ - function hashMessage(message) { - if (typeof message === "string") { - message = toUtf8Bytes(message); - } - return sha256(concat([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message.length)), - message, - ])); - } - /** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ - function verifyMessage(message, sig, prefix) { - const digest = hashMessage(message); - return recoverAddress(digest, sig, prefix); - } - - const regexBytes = new RegExp("^bytes([0-9]+)$"); - const regexNumber = new RegExp("^(u?int)([0-9]*)$"); - const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); - function _pack(type, value, isArray) { - switch (type) { - case "address": - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(getAddress(value)); - case "string": - return toUtf8Bytes(value); - case "bytes": - return getBytes(value); - case "bool": - value = !!value ? "0x01" : "0x00"; - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(value); - } - let match = type.match(regexNumber); - if (match) { - let signed = match[1] === "int"; - let size = parseInt(match[2] || "256"); - assertArgument((!match[2] || match[2] === String(size)) && - size % 8 === 0 && - size !== 0 && - size <= 256, "invalid number type", "type", type); - if (isArray) { - size = 256; - } - if (signed) { - value = toTwos(value, size); - } - return getBytes(zeroPadValue(toBeArray(value), size / 8)); - } - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - assertArgument(dataLength(value) === size, `invalid value for ${type}`, "value", value); - if (isArray) { - return getBytes(zeroPadBytes(value, 32)); - } - return value; - } - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); - const result = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return getBytes(concat(result)); - } - assertArgument(false, "invalid type", "type", type); - } - // @TODO: Array Enum - /** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ - function solidityPacked(types, values) { - assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - const tight = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return hexlify(concat(tight)); - } - /** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ - function solidityPackedSha256(types, values) { - return sha256(solidityPacked(types, values)); - } - - const padding = new Uint8Array(32); - padding.fill(0); - const BN__1 = BigInt(-1); - const BN_0$3 = BigInt(0); - const BN_1$1 = BigInt(1); - const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - function hexPadRight(value) { - const bytes = getBytes(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return concat([bytes, padding.slice(padOffset)]); - } - return hexlify(bytes); - } - const hexTrue = toBeHex(BN_1$1, 32); - const hexFalse = toBeHex(BN_0$3, 32); - const domainFieldTypes = { - name: "string", - version: "string", - networkId: "uint256", - verifyingContract: "address", - salt: "bytes32", - }; - const domainFieldNames = [ - "name", - "version", - "networkId", - "verifyingContract", - "salt", - ]; - function checkString(key) { - return function (value) { - assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); - return value; - }; - } - const domainChecks = { - name: checkString("name"), - version: checkString("version"), - networkId: function (_value) { - const value = getBigInt(_value, "domain.networkId"); - assertArgument(value >= 0, "invalid chain ID", "domain.networkId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function (value) { - try { - return getAddress(value).toLowerCase(); - } - catch (error) { } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function (value) { - const bytes = getBytes(value, "domain.salt"); - assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes); - }, - }; - function getBaseEncoder(type) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d*)$/); - if (match) { - const signed = match[1] === ""; - const width = parseInt(match[2] || "256"); - assertArgument(width % 8 === 0 && - width !== 0 && - width <= 256 && - (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type); - const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); - const boundsLower = signed ? (boundsUpper + BN_1$1) * BN__1 : BN_0$3; - return function (_value) { - const value = getBigInt(_value, "value"); - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - return function (value) { - const bytes = getBytes(value); - assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type) { - case "address": - return function (value) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": - return function (value) { - return !value ? hexFalse : hexTrue; - }; - case "bytes": - return function (value) { - return sha256(value); - }; - case "string": - return function (value) { - return id(value); - }; - } - return null; - } - function encodeType(name, fields) { - return `${name}(${fields - .map(({ name, type }) => type + " " + name) - .join(",")})`; - } - class TypedDataEncoder { - primaryType; - #types; - get types() { - return JSON.parse(this.#types); - } - #fullTypes; - #encoderCache; - constructor(types) { - this.#types = JSON.stringify(types); - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - // Link struct types to their direct child structs - const links = new Map(); - // Link structs to structs which contain them as a child - const parents = new Map(); - // Link all subtypes within a given struct - const subtypes = new Map(); - Object.keys(types).forEach((type) => { - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - for (const name in types) { - const uniqueNames = new Set(); - for (const field of types[name]) { - // Check each field has a unique name - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types); - uniqueNames.add(field.name); - // Get the base type (drop any array specifiers) - const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1] || null; - assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types); - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types); - // Add linkage - parents.get(baseType).push(name); - links.get(name).add(baseType); - } - } - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => parents.get(n).length === 0); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", types); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes - .map((t) => JSON.stringify(t)) - .join(", ")}`, "types", types); - defineProperties(this, { primaryType: primaryTypes[0] }); - // Check for circular type references - function checkCircular(type, found) { - assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types); - found.add(type); - for (const child of links.get(type)) { - if (!parents.has(child)) { - continue; - } - // Recursively check children - checkCircular(child, found); - // Mark all ancestors as having this decendant - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + - st.map((t) => encodeType(t, types[t])).join("")); - } - } - getEncoder(type) { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - #getEncoder(type) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - const subtype = match[1]; - const subEncoder = this.getEncoder(subtype); - return (value) => { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(sha256); - } - return sha256(concat(result)); - }; - } - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id(this.#fullTypes.get(type)); - return (value) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return sha256(result); - } - return result; - }); - values.unshift(encodedType); - return concat(values); - }; - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - encodeType(name) { - const result = this.#fullTypes.get(name); - assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); - return result; - } - encodeData(type, value) { - return this.getEncoder(type)(value); - } - hashStruct(name, value) { - return sha256(this.encodeData(name, value)); - } - encode(value) { - return this.encodeData(this.primaryType, value); - } - hash(value) { - return this.hashStruct(this.primaryType, value); - } - _visit(type, value, callback) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - return value.map((v) => this._visit(match[1], v, callback)); - } - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, {}); - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - static from(types) { - return new TypedDataEncoder(types); - } - static getPrimaryType(types) { - return TypedDataEncoder.from(types).primaryType; - } - static hashStruct(name, types, value) { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - static hashDomain(domain) { - const domainFields = []; - for (const name in domain) { - if (domain[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); - domainFields.push({ name, type }); - } - domainFields.sort((a, b) => { - return (domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name)); - }); - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - static encode(domain, types, value) { - return concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value), - ]); - } - static hash(domain, types, value) { - return sha256(TypedDataEncoder.encode(domain, types, value)); - } - // Replaces all address types with ENS names with their looked up address - static async resolveNames(domain, types, value, resolveName) { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - // Allow passing null to ignore value - for (const key in domain) { - if (domain[key] == null) { - delete domain[key]; - } - } - // Look up all ENS names - const ensCache = {}; - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && - !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - // Get a list of all the addresses - encoder.visit(value, (type, value) => { - if (type === "address" && !isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - // Replace all ENS names with their address - value = encoder.visit(value, (type, value) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - return { domain, value }; - } - static getPayload(domain, types, value) { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - // Derive the EIP712Domain Struct reference type - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name) => { - const value = domain[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - const encoder = TypedDataEncoder.from(types); - const typesWithDomain = Object.assign({}, types); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - typesWithDomain.EIP712Domain = domainTypes; - // Validate the data structures and types - encoder.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type, value) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value)); - } - // uint or int - if (type.match(/^u?int/)) { - return getBigInt(value).toString(); - } - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - assertArgument(typeof value === "string", "invalid string", "value", value); - return value; - } - assertArgument(false, "unsupported type", "type", type); - }), - }; - } - } - /** - * Compute the address used to sign the typed data for the %%signature%%. - */ - function verifyTypedData(domain, types, value, signature, prefix) { - return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix); - } - - /** - * About frgaments... - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ - var _a; - // [ "a", "b" ] => { "a": 1, "b": 1 } - function setify(items) { - const result = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); - } - // Visibility Keywords - const _kwVisib = "constant external internal payable private public pure view"; - const KwVisib = setify(_kwVisib.split(" ")); - const _kwTypes = "constructor error event fallback function receive struct"; - const KwTypes = setify(_kwTypes.split(" ")); - const _kwModifiers = "calldata memory storage payable indexed"; - const KwModifiers = setify(_kwModifiers.split(" ")); - const _kwOther = "tuple returns"; - // All Keywords - const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); - const Keywords = setify(_keywords.split(" ")); - // Single character tokens - const SimpleTokens = { - "(": "OPEN_PAREN", - ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", - "]": "CLOSE_BRACKET", - ",": "COMMA", - "@": "AT", - }; - // Parser regexes to consume the next token - const regexWhitespacePrefix = new RegExp("^(\\s*)"); - const regexNumberPrefix = new RegExp("^([0-9]+)"); - const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); - // Parser regexs to check validity - const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); - const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); - class TokenString { - #offset; - #tokens; - get offset() { - return this.#offset; - } - get length() { - return this.#tokens.length - this.#offset; - } - constructor(tokens) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - clone() { - return new _a(this.#tokens); - } - reset() { - this.#offset = 0; - } - #subTokenString(from = 0, to = 0) { - return new _a(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({}, t, { - match: t.match - from, - linkBack: t.linkBack - from, - linkNext: t.linkNext - from, - })); - })); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type) { - if (this.peek().type !== type) { - throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - this.#offset = top.match + 1; - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return top != null && allowed.has(top) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return top.type === type ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - this.#offset++; - return result; - } - toString() { - const tokens = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } - } - _a = TokenString; - function lex(text) { - const tokens = []; - const throwError = (message) => { - const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - let brackets = []; - let commas = []; - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - const token = { - depth: brackets.length, - linkBack: -1, - linkNext: -1, - match: -1, - type: "", - text: "", - offset, - value: -1, - }; - tokens.push(token); - let type = SimpleTokens[cur[0]] || ""; - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } - else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - token.match = brackets.pop(); - tokens[token.match].match = tokens.length - 1; - token.depth--; - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - } - else if (type === "COMMA") { - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } - else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } - else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - tokens[tokens.length - 1].value = - getNumber(value); - } - if (tokens.length === 0 || - tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - tokens[tokens.length - 1].text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - token.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); - } - return new TokenString(tokens.map((t) => Object.freeze(t))); - } - // Check only one of `allowed` is in `set` - function allowSingle(set, allowed) { - let included = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } - } - // Functions to process a Solidity Signature TokenString from left-to-right for... - // ...the name with an optional type, returning the name - function consumeName(type, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - return tokens.popType("ID"); - } - // ...all keywords matching allowed, returning the keywords - function consumeKeywords(tokens, allowed) { - const keywords = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - return Object.freeze(keywords); - } - // ...all visibility keywords, returning the coalesced mutability - function consumeMutability(tokens) { - let modifiers = consumeKeywords(tokens, KwVisib); - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; - } - // ...a parameter list, returning the ParamType list - function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); - } - // ...a energy limit, returning a BigNumber or null if none - function consumeEnergy(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid energy"); - } - return null; - } - function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens: ${tokens.toString()}`); - } - } - const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); - function verifyBasicType(type) { - const match = type.match(regexType); - assertArgument(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); - } - else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3]); - assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid numeric width", "type", type); - } - return type; - } - // Make the Fragment constructors effectively private - const _guard$2 = {}; - const internal$1 = Symbol.for("_corebc_internal"); - const ParamTypeInternal = "_ParamTypeInternal"; - const ErrorFragmentInternal = "_ErrorInternal"; - const EventFragmentInternal = "_EventInternal"; - const ConstructorFragmentInternal = "_ConstructorInternal"; - const FallbackFragmentInternal = "_FallbackInternal"; - const FunctionFragmentInternal = "_FunctionInternal"; - const StructFragmentInternal = "_StructInternal"; - /** - * Each input and output of a [[Fragment]] is an Array of **PAramType**. - */ - class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - name; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - type; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - baseType; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - indexed; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - components; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - arrayLength; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - arrayChildren; - /** - * @private - */ - constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - assertPrivate(guard, _guard$2, "ParamType"); - Object.defineProperty(this, internal$1, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } - else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } - else if (components != null) { - throw new Error(""); - } - defineProperties(this, { - name, - type, - baseType, - indexed, - components, - arrayLength, - arrayChildren, - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - let result = { - type: this.baseType === "tuple" ? "tuple" : this.type, - name: this.name || undefined, - }; - if (typeof this.indexed === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - let result = ""; - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; - } - else { - if (this.isTuple()) { - if (format !== "sighash") { - result += this.type; - } - result += - "(" + - this.components - .map((comp) => comp.format(format)) - .join(format === "full" ? ", " : ",") + - ")"; - } - else { - result += this.type; - } - } - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /* - * Returns true if %%value%% is an Array type. - * - * This provides a type gaurd ensuring that the - * [[arrayChildren]] and [[arrayLength]] are non-null. - */ - //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } { - // return value && (value.baseType === "array") - //} - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return this.baseType === "array"; - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return this.baseType === "tuple"; - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return this.indexed != null; - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => _this.arrayChildren.walk(v, process)); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => _this.components[i].walk(v, process)); - } - return process(this.type, value); - } - #walkAsync(promises, value, process, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - if (this.isTuple()) { - const components = this.components; - // Convert the object into an array - let result; - if (Array.isArray(value)) { - result = value.slice(); - } - else { - if (value == null || typeof value !== "object") { - throw new Error("invalid tuple value"); - } - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - const result = process(this.type, value); - if (result.then) { - promises.push((async function () { - setValue(await result); - })()); - } - else { - setValue(result); - } - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process) { - const promises = []; - const result = [value]; - this.#walkAsync(promises, value, process, (value) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (ParamType.isParamType(obj)) { - return obj; - } - if (typeof obj === "string") { - return ParamType.from(lex(obj), allowIndexed); - } - else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || - obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } - else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - // Check for Array - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard$2, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - let indexed = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - const name = obj.peekType("ID") ? obj.pop().text : ""; - if (obj.length) { - throw new Error("leftover tokens"); - } - return new ParamType(_guard$2, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - const name = obj.name; - assertArgument(!name || (typeof name === "string" && name.match(regexId)), "invalid name", "obj.name", name); - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type = obj.type; - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components, - }); - return new ParamType(_guard$2, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - if (type === "tuple" || - type.startsWith("tuple(" /* fix: ) */) || - type.startsWith("(" /* fix: ) */)) { - const comps = obj.components != null - ? obj.components.map((c) => ParamType.from(c)) - : null; - const tuple = new ParamType(_guard$2, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - type = verifyBasicType(obj.type); - return new ParamType(_guard$2, name || "", type, type, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return value && value[internal$1] === ParamTypeInternal; - } - } - /** - * An abstract class to represent An individual fragment from a parse ABI. - */ - class Fragment { - /** - * The type of the fragment. - */ - type; - /** - * The inputs for the fragment. - */ - inputs; - /** - * @private - */ - constructor(guard, type, inputs) { - assertPrivate(guard, _guard$2, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof obj === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } - catch (e) { } - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - const type = obj.peekKeyword(KwTypes); - switch (type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - } - else if (typeof obj === "object") { - // JSON ABI - switch (obj.type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from", - }); - } - assertArgument(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } - } - /** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ - class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - name; - /** - * @private - */ - constructor(guard, type, name, inputs) { - super(guard, type, inputs); - assertArgument(typeof name === "string" && name.match(regexId), "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name }); - } - } - function joinParams(format, params) { - return ("(" + - params.map((p) => p.format(format)).join(format === "full" ? ", " : ",") + - ")"); - } - /** - * A Fragment which represents a //Custom Error//. - */ - class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal$1, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ErrorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard$2, name, inputs); - } - return new ErrorFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal$1] === ErrorFragmentInternal; - } - } - /** - * A Fragment which represents an Event. - */ - class EventFragment extends NamedFragment { - anonymous; - /** - * @private - */ - constructor(guard, name, inputs, anonymous) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal$1, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return id(this.format("sighash")); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - static getTopicHash(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard$2, name, params, false); - return fragment.topicHash; - } - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return EventFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard$2, name, inputs, anonymous); - } - return new EventFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); - } - static isFragment(value) { - return value && value[internal$1] === EventFragmentInternal; - } - } - /** - * A Fragment which represents a constructor. - */ - class ConstructorFragment extends Fragment { - payable; - energy; - /** - * @private - */ - constructor(guard, type, inputs, payable, energy) { - super(guard, type, inputs); - Object.defineProperty(this, internal$1, { - value: ConstructorFragmentInternal, - }); - defineProperties(this, { payable, energy }); - } - format(format) { - assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: this.payable ? "payable" : "undefined", - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = [`constructor${joinParams(format, this.inputs)}`]; - result.push(this.payable ? "payable" : "nonpayable"); - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - return result.join(" "); - } - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ConstructorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable"); - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard$2, "constructor", inputs, payable, energy); - } - return new ConstructorFragment(_guard$2, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal$1] === ConstructorFragmentInternal; - } - } - /** - * A Fragment which represents a method. - */ - class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - payable; - constructor(guard, inputs, payable) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal$1, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - format(format) { - const type = this.inputs.length === 0 ? "receive" : "fallback"; - if (format === "json") { - const stateMutability = this.payable ? "payable" : "nonpayable"; - return JSON.stringify({ type, stateMutability }); - } - return `${type}()${this.payable ? " payable" : ""}`; - } - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FallbackFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type = obj.popKeyword(setify(["fallback", "receive"])); - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard$2, [], true); - } - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); - } - else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard$2, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard$2, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = obj.stateMutability === "payable"; - return new FallbackFragment(_guard$2, inputs, payable); - } - assertArgument(false, "invalid fallback description", "obj", obj); - } - static isFragment(value) { - return value && value[internal$1] === FallbackFragmentInternal; - } - } - /** - * A Fragment which represents a method. - */ - class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - constant; - /** - * The returned types for the result of calling this function. - */ - outputs; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - stateMutability; - /** - * If the function can be sent value during invocation. - */ - payable; - /** - * The amount of energy to send when calling this function - */ - energy; - /** - * @private - */ - constructor(guard, name, stateMutability, inputs, outputs, energy) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal$1, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = stateMutability === "view" || stateMutability === "pure"; - const payable = stateMutability === "payable"; - defineProperties(this, { - constant, - energy, - outputs, - payable, - stateMutability, - }); - } - /** - * The Function selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: this.stateMutability !== "nonpayable" - ? this.stateMutability - : undefined, - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - } - return result.join(" "); - } - static getSelector(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard$2, name, "view", params, [], null); - return fragment.selector; - } - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FunctionFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new FunctionFragment(_guard$2, name, mutability, inputs, outputs, energy); - } - let stateMutability = obj.stateMutability; - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof obj.constant === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } - else if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - return new FunctionFragment(_guard$2, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal$1] === FunctionFragmentInternal; - } - } - /** - * A Fragment which represents a structure. - */ - class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal$1, { value: StructFragmentInternal }); - } - format() { - throw new Error("@TODO"); - } - static from(obj) { - if (typeof obj === "string") { - return StructFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard$2, name, inputs); - } - return new StructFragment(_guard$2, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal$1] === StructFragmentInternal; - } - } - - /** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ - // https://docs.soliditylang.org/en/v0.8.17/control-structures.html - const PanicReasons$1 = new Map(); - PanicReasons$1.set(0x00, "GENERIC_PANIC"); - PanicReasons$1.set(0x01, "ASSERT_FALSE"); - PanicReasons$1.set(0x11, "OVERFLOW"); - PanicReasons$1.set(0x12, "DIVIDE_BY_ZERO"); - PanicReasons$1.set(0x21, "ENUM_RANGE_ERROR"); - PanicReasons$1.set(0x22, "BAD_STORAGE_DATA"); - PanicReasons$1.set(0x31, "STACK_UNDERFLOW"); - PanicReasons$1.set(0x32, "ARRAY_RANGE_ERROR"); - PanicReasons$1.set(0x41, "OUT_OF_MEMORY"); - PanicReasons$1.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); - const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); - const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); - let defaultCoder = null; - function getBuiltinCallException(action, tx, data, abiCoder) { - let message = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data) { - message = "execution reverted"; - const bytes = getBytes(data); - data = hexlify(data); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } - else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } - else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason], - }; - message += `: ${JSON.stringify(reason)}`; - } - catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } - else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code], - }; - reason = `Panic due to ${PanicReasons$1.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } - catch (error) { - message += " (could not decode panic code)"; - } - } - else { - message += " (unknown custom error)"; - } - } - const transaction = { - to: tx.to ? getAddress(tx.to) : null, - data: tx.data || "0x", - }; - if (tx.from) { - transaction.from = getAddress(tx.from); - } - return makeError(message, "CALL_EXCEPTION", { - action, - data, - reason, - transaction, - invocation, - revert, - }); - } - /** - * About AbiCoder - */ - class AbiCoder { - #getCoder(param) { - if (param.isArray()) { - return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param); - return new NumberCoder(size / 8, match[1] === "int", param.name); - } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new FixedBytesCoder(size, param.name); - } - assertArgument(false, "invalid type", "type", param.type); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types, values) { - assertArgumentCount(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose)); - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an corebc-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } - } - - /** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ - /** - * Encodes %%text%% as a Bytes32 string. - */ - function encodeBytes32String(text) { - // Get the bytes - const bytes = toUtf8Bytes(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } - // Zero-pad (implicitly null-terminates) - return zeroPadBytes(bytes, 32); - } - /** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ - function decodeBytes32String(_bytes) { - const data = getBytes(_bytes, "bytes"); - // Must be 32 bytes with a null-termination - if (data.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { - length--; - } - // Determine the string value - return toUtf8String(data.slice(0, length)); - } - - /** - * About Interface - * - * @_subsection api/abi:Interfaces [interfaces] - */ - class LogDescription { - fragment; - name; - signature; - topic; - args; - constructor(fragment, topic, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - signature, - topic, - args, - }); - } - } - class TransactionDescription { - fragment; - name; - args; - signature; - selector; - value; - constructor(fragment, selector, args, value) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - value, - }); - } - } - class ErrorDescription { - fragment; - name; - args; - signature; - selector; - constructor(fragment, selector, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - }); - } - } - class Indexed { - hash; - _isIndexed; - static isIndexed(value) { - return !!(value && value._isIndexed); - } - constructor(hash) { - defineProperties(this, { hash, _isIndexed: true }); - } - } - // https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require - const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", - }; - const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message) => { - return `reverted with reason string ${JSON.stringify(message)}`; - }, - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - }, - }, - }; - /** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ - class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - fragments; - /** - * The Contract constructor. - */ - deploy; - /** - * The Fallback method, if any. - */ - fallback; - /** - * If receiving xcb is supported. - */ - receive; - #errors; - #events; - #functions; - // #structs: Map; - #abiCoder; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments) { - let abi = []; - if (typeof fragments === "string") { - abi = JSON.parse(fragments); - } - else { - abi = fragments; - } - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - const frags = []; - for (const a of abi) { - try { - frags.push(Fragment.from(a)); - } - catch (error) { - console.log("EE", error); - } - } - defineProperties(this, { - fragments: Object.freeze(frags), - }); - let fallback = null; - let receive = false; - this.#abiCoder = this.getAbiCoder(); - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - defineProperties(this, { - deploy: fragment, - }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } - else { - assertArgument(!fallback || - fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - case "error": - bucket = this.#errors; - break; - default: - return; - } - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - bucket.set(signature, fragment); - }); - // If we do not have a constructor add a default - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()"), - }); - } - defineProperties(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format = minimal ? "minimal" : "full"; - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi = this.fragments.map((f) => f.format("json")); - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return AbiCoder.defaultAbiCoder(); - } - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key, values, forceUnique) { - // Selector - if (isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - const lastValue = values.length > 0 ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && - (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && - values && - values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || - Array.isArray(lastArg) || - typeof lastArg !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#functions.get(FunctionFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key) { - const fragment = this.#getFunction(key, null, false); - assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key) { - return !!this.#getFunction(key, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key, values) { - return this.#getFunction(key, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#functions.get(name), i); - } - } - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key, values, forceUnique) { - // EventTopic - if (isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#events.get(EventFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key) { - const fragment = this.#getEvent(key, null, false); - assertArgument(fragment, "no matching event", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key) { - return !!this.#getEvent(key, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key, values) { - return this.#getEvent(key, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#events.get(name), i); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key, values) { - if (isHexString(key)) { - const selector = key.toLowerCase(); - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key === "Error") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return ErrorFragment.from("error Panic(uint256)"); - } - return null; - } - else if (matching.length > 1) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - key = ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return ErrorFragment.from("error Panic(uint256)"); - } - const result = this.#errors.get(key); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#errors.get(name), i); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return this.#abiCoder.decode(params, data); - } - _encodeParams(params, values) { - return this.#abiCoder.encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - let message = "invalid length for result data"; - const bytes = getBytesCopy(data); - if (bytes.length % 32 === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } - catch (error) { - message = "could not decode result data"; - } - } - // Call returned data with no error, but the data is junk - assert(false, message, "BAD_DATA", { - value: hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() }, - }); - } - makeError(_data, tx) { - const data = getBytes(_data, "data"); - const error = AbiCoder.getBuiltinCallException("call", tx, data); - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, - signature: ef.format(), - args, - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } - catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args, - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } - */ - // Create the filter for the event with search criteria (e.g. for xcb_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param, value) => { - if (param.type === "string") { - return id(value); - } - else if (param.type === "bytes") { - return sha256(hexlify(value)); - } - if (param.type === "bool" && typeof value === "boolean") { - value = value ? "0x01" : "0x00"; - } - if (param.type.match(/^u?int/)) { - value = toBeHex(value); - } - // Check addresses are valid - if (param.type === "address") { - this.#abiCoder.encode(["address"], [value]); - } - return zeroPadValue(hexlify(value), 32); - //@TOOD should probably be return toHex(value, 32) - }; - values.forEach((value, index) => { - const param = fragment.inputs[index]; - if (!param.indexed) { - assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); - return; - } - if (value == null) { - topics.push(null); - } - else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); - } - else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } - else { - topics.push(encodeTopic(param, value)); - } - }); - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)); - } - else if (param.type === "bytes") { - topics.push(sha256(value)); - } - else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } - else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } - else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics, - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || - param.type === "bytes" || - param.baseType === "tuple" || - param.baseType === "array") { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } - else { - indexed.push(param); - dynamic.push(false); - } - } - else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values = []; - const keys = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } - else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } - else { - try { - value = resultIndexed[indexedIndex++]; - } - catch (error) { - value = error; - } - } - } - else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } - catch (error) { - value = error; - } - } - values.push(value); - keys.push(param.name || null); - }); - return Result.fromItems(values, keys); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log) { - const fragment = this.getEvent(log.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data) { - const hexData = hexlify(data); - const fragment = this.getError(dataSlice(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - // JSON - if (typeof value === "string") { - return new Interface(JSON.parse(value)); - } - // Maybe an interface from an older version, or from a symlinked copy - if (typeof value.format === "function") { - return new Interface(value.format("json")); - } - // Array of fragments - return new Interface(value); - } - } - - const logger = new Logger("contract-address/0.0.1"); - /** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ - function getCreateAddress(tx) { - const from = getAddress(tx.from); - const nonce = getBigInt(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } - else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } - else { - nonceHex = "0x" + nonceHex; - } - return getAddress(from); - } - /** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ - function getCreate2Address(from, salt, initCodeHash) { - if (hexDataLength(salt) !== 32) { - logger.throwArgumentError("salt must be 32 bytes", "salt", salt); - } - if (hexDataLength(initCodeHash) !== 32) { - logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash); - } - const val = hexDataSlice(sha256(concat(["0xff", getAddress(from), salt, initCodeHash])), 12); - console.log({ "contract-address/74=>should be string": val }); - const prefix = from.substring(2, 4); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); - } - - /** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.corebc.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ - function isAddressable(value) { - return value && typeof value.getAddress === "function"; - } - /** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ - function isAddress(value) { - try { - getAddress(value); - return true; - } - catch (error) { } - return false; - } - async function checkAddress(target, promise) { - const result = await promise; - if (result == null || - result === "0x0000000000000000000000000000000000000000") { - assert(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return getAddress(result); - } - /** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ - function resolveAddress(target) { - if (typeof target === "string") { - return getAddress(target); - // assert(resolver != null, "ENS resolution requires a provider", - // "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - // return checkAddress(target, resolver.resolveName(target)); - } - else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } - else if (target && typeof target.then === "function") { - return checkAddress(target, target); - } - assertArgument(false, "unsupported addressable value", "target", target); - } - - const BN_0$2 = BigInt(0); - // ----------------------- - function getValue(value) { - if (value == null) { - return null; - } - return value; - } - function toJson(value) { - if (value == null) { - return null; - } - return value.toString(); - } - // @TODO? implements Required - /** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ - class FeeData { - /** - * The energy price for legacy networks. - */ - energyPrice; - constructor(energyPrice) { - defineProperties(this, { - energyPrice: getValue(energyPrice), - }); - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { energyPrice } = this; - return { - _type: "FeeData", - energyPrice: toJson(energyPrice), - }; - } - } - function copyRequest(req) { - const result = {}; - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = hexlify(req.data); - } - const bigIntKeys = "networkId,energyLimit,energyPrice,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getBigInt(req[key], `request.${key}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getNumber(req[key], `request.${key}`); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipReadEnabled = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - return result; - } - /** - * A **Block** represents the data associated with a full block on - * Core. - */ - class Block { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - number; - /** - * The block hash. - */ - hash; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - timestamp; - /** - * The block hash of the parent block. - */ - parentHash; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - nonce; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - difficulty; - /** - * The total energy limit for this block. - */ - energyLimit; - /** - * The total energy used in this block. - */ - energyUsed; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - miner; - /** - * Any extra data the validator wished to include. - */ - extraData; - /** - * The base fee per energy that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - baseFeePerEnergy; - #transactions; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block, provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof tx !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - defineProperties(this, { - provider, - hash: getValue(block.hash), - number: block.number, - timestamp: block.timestamp, - parentHash: block.parentHash, - nonce: block.nonce, - difficulty: block.difficulty, - energyLimit: block.energyLimit, - energyUsed: block.energyUsed, - miner: block.miner, - extraData: block.extraData, - baseFeePerEnergy: getValue(block.baseFeePerEnergy), - }); - } - /** - * Returns the list of transaction hashes. - */ - get transactions() { - return this.#transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return tx.hash; - }); - } - /** - * Returns the complete transactions for blocks which - * prefetched them, by passing ``true`` to %%prefetchTxs%% - * into [[provider_getBlock]]. - */ - get prefetchedTransactions() { - const txs = this.#transactions.slice(); - // Doesn't matter... - if (txs.length === 0) { - return []; - } - // Make sure we prefetched the transactions - assert(typeof txs[0] === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()", - }); - return txs; - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this; - return { - _type: "Block", - baseFeePerEnergy: toJson(baseFeePerEnergy), - difficulty: toJson(difficulty), - extraData, - energyLimit: toJson(energyLimit), - energyUsed: toJson(energyUsed), - hash, - miner, - nonce, - number, - parentHash, - timestamp, - transactions, - }; - } - [Symbol.iterator]() { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The number of transactions in this block. - */ - get length() { - return this.#transactions.length; - } - /** - * The [[link-js-date]] this block was included at. - */ - get date() { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash) { - // Find the internal value by its index or hash - let tx = undefined; - if (typeof indexOrHash === "number") { - tx = this.#transactions[indexOrHash]; - } - else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof v === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } - else { - if (v.hash === hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - if (typeof tx === "string") { - return await this.provider.getTransaction(tx); - } - else { - return tx; - } - } - getPrefetchedTransaction(indexOrHash) { - const txs = this.prefetchedTransactions; - if (typeof indexOrHash === "number") { - return txs[indexOrHash]; - } - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); - } - /** - * Has this block been mined. - * - * If true, the block has been typed-gaurded that all mined - * properties are non-null. - */ - isMined() { - return !!this.hash; - } - /** - * - */ - isLondon() { - return !!this.baseFeePerEnergy; - } - orphanedEvent() { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } - } - ////////////////////// - // Log - class Log { - provider; - transactionHash; - blockHash; - blockNumber; - removed; - address; - data; - topics; - index; - transactionIndex; - constructor(log, provider) { - this.provider = provider; - const topics = Object.freeze(log.topics.slice()); - defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - removed: log.removed, - address: log.address, - data: log.data, - topics, - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - toJSON() { - const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this; - return { - _type: "log", - address, - blockHash, - blockNumber, - data, - index, - removed, - topics, - transactionHash, - transactionIndex, - }; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.transactionHash); - assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - async getTransactionReceipt() { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); - return receipt; - } - removedEvent() { - return createRemovedLogFilter(this); - } - } - ////////////////////// - // Transaction Receipt - /* - export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; - } - - export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; - } - */ - class TransactionReceipt { - provider; - to; - from; - contractAddress; - hash; - index; - blockHash; - blockNumber; - logsBloom; - energyUsed; - cumulativeEnergyUsed; - energyPrice; - type; - //readonly byzantium!: boolean; - status; - root; - #logs; - constructor(tx, provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - defineProperties(this, { - provider, - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - hash: tx.hash, - index: tx.index, - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - logsBloom: tx.logsBloom, - energyUsed: tx.energyUsed, - cumulativeEnergyUsed: tx.cumulativeEnergyUsed, - energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice), - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root, - }); - } - get logs() { - return this.#logs; - } - toJSON() { - const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, - status, root, } = this; - return { - _type: "TransactionReceipt", - blockHash, - blockNumber, - //byzantium, - contractAddress, - cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed), - from, - energyPrice: toJson(this.energyPrice), - energyUsed: toJson(this.energyUsed), - hash, - index, - logs, - logsBloom, - root, - status, - to, - }; - } - get length() { - return this.logs.length; - } - [Symbol.iterator]() { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - }, - }; - } - get fee() { - return this.energyUsed * this.energyPrice; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - async getResult() { - return await this.provider.getTransactionResult(this.hash); - } - async confirmations() { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - removedEvent() { - return createRemovedTransactionFilter(this); - } - reorderedEvent(other) { - assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } - } - /* - export type ReplacementDetectionSetup = { - to: string; - from: string; - value: bigint; - data: string; - nonce: number; - block: number; - }; - */ - class TransactionResponse { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockNumber; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockHash; - /** - * The index within the block that this transaction resides at. - */ - index; - /** - * The transaction hash. - */ - hash; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - type; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - to; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - from; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - nonce; - /** - * The maximum units of energy this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - energyLimit; - /** - * The energy price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective energy price// (the fee per energy that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerEnergy]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of energy the transaction - * consumes. - */ - energyPrice; - /** - * The data. - */ - data; - /** - * The value, in ore. Use [[formatXCB]] to format this value - * as xcb. - */ - value; - /** - * The chain ID. - */ - networkId; - /** - * The signature. - */ - signature; - #startBlock; - /** - * Create a new TransactionResponse with %%tx%% parameters - * connected to %%provider%%. - */ - constructor(tx, provider) { - this.provider = provider; - this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null; - this.blockHash = tx.blockHash != null ? tx.blockHash : null; - this.hash = tx.hash; - this.index = tx.index; - this.from = tx.from; - this.to = tx.to || null; - this.energyLimit = tx.energyLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - this.energyPrice = tx.energyPrice; - this.networkId = tx.networkId; - this.signature = tx.signature; - this.#startBlock = -1; - } - /** - * Returns a JSON representation of this transaction. - */ - toJSON() { - const { index, hash, type, to, from, nonce, data, signature } = this; - return { - _type: "TransactionReceipt", - networkId: toJson(this.networkId), - data, - from, - energyLimit: toJson(this.energyLimit), - energyPrice: toJson(this.energyPrice), - hash, - nonce, - signature, - to, - index, - type, - value: toJson(this.value), - }; - } - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock() { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction() { - return this.provider.getTransaction(this.hash); - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms, _timeout) { - const confirms = _confirms == null ? 1 : _confirms; - const timeout = _timeout == null ? 0 : _timeout; - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = startBlock === -1 ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from), - }); - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - // We were replaced; start scanning for that transaction - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx = await block.getTransaction(i); - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - // We will retry this on the next block (this case could be optimized) - if (blockNumber - receipt.blockNumber + 1 < confirms) { - return; - } - // The reason we were replaced - let reason = "replaced"; - if (tx.data === this.data && - tx.to === this.to && - tx.value === this.value) { - reason = "repriced"; - } - else if (tx.data === "0x" && - tx.from === tx.to && - tx.value === BN_0$2) { - reason = "cancelled"; - } - assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: reason === "replaced" || reason === "cancelled", - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt, - }); - } - } - nextScan++; - } - return; - }; - const receipt = await this.provider.getTransactionReceipt(this.hash); - if (receipt) { - if ((await receipt.confirmations()) >= confirms) { - return receipt; - } - } - else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers = []; - const cancel = () => { - cancellers.forEach((c) => c()); - }; - // On cancel, stop scanning for replacements - cancellers.push(() => { - stopScanning = true; - }); - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { - clearTimeout(timer); - }); - } - const txListener = async (receipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - resolve(receipt); - } - }; - cancellers.push(() => { - this.provider.off(this.hash, txListener); - }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } - catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { - this.provider.off("block", replaceListener); - }); - this.provider.once("block", replaceListener); - } - }); - return await waiter; - } - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined() { - return this.blockHash != null; - } - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy() { - return this.type === 0; - } - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent() { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other) { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createReorderedTransactionFilter(this, other); - } - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock) { - assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } - } - function createOrphanedBlockFilter(block) { - return { orphan: "drop-block", hash: block.hash, number: block.number }; - } - function createReorderedTransactionFilter(tx, other) { - return { orphan: "reorder-transaction", tx, other }; - } - function createRemovedTransactionFilter(tx) { - return { orphan: "drop-transaction", tx }; - } - function createRemovedLogFilter(log) { - return { - orphan: "drop-log", - log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index, - }, - }; - } - - class EventLog extends Log { - interface; - fragment; - args; - constructor(log, iface, fragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - defineProperties(this, { args, fragment, interface: iface }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } - } - class ContractTransactionReceipt extends TransactionReceipt { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - get logs() { - return super.logs.map((log) => { - const fragment = log.topics.length - ? this.#iface.getEvent(log.topics[0]) - : null; - if (fragment) { - return new EventLog(log, this.#iface, fragment); - } - else { - return log; - } - }); - } - } - class ContractTransactionResponse extends TransactionResponse { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - async wait(confirms) { - const receipt = await super.wait(); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } - } - class ContractUnknownEventPayload extends EventPayload { - log; - constructor(contract, listener, filter, log) { - super(contract, listener, filter); - defineProperties(this, { log }); - } - async getBlock() { - return await this.log.getBlock(); - } - async getTransaction() { - return await this.log.getTransaction(); - } - async getTransactionReceipt() { - return await this.log.getTransactionReceipt(); - } - } - class ContractEventPayload extends ContractUnknownEventPayload { - constructor(contract, listener, filter, fragment, _log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - defineProperties(this, { args, fragment }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } - } - - const BN_0$1 = BigInt(0); - function canCall(value) { - return value && typeof value.call === "function"; - } - function canEstimate(value) { - return value && typeof value.estimateEnergy === "function"; - } - function canResolve(value) { - return value && typeof value.resolveName === "function"; - } - function canSend(value) { - return value && typeof value.sendTransaction === "function"; - } - class PreparedTopicFilter { - #filter; - fragment; - constructor(contract, fragment, args) { - defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - // Recursively descend into args and resolve any addresses - this.#filter = (async function () { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - })); - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - getTopicFilter() { - return this.#filter; - } - } - // A = Arguments passed in as a tuple - // R = The result type of the call (i.e. if only one return type, - // the qualified type, otherwise Result) - // D = The type the default call will return (i.e. R for view/pure, - // TransactionResponse otherwise) - //export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { - function getRunner(value, feature) { - if (value == null) { - return null; - } - if (typeof value[feature] === "function") { - return value; - } - if (value.provider && typeof value.provider[feature] === "function") { - return value.provider; - } - return null; - } - function getProvider(value) { - if (value == null) { - return null; - } - return value.provider || null; - } - /** - * @_ignore: - */ - async function copyOverrides(arg, allowed) { - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = copyRequest(Typed.dereference(arg, "overrides")); - assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); - // Resolve any from - if (overrides.from) { - overrides.from = await resolveAddress(overrides.from); - } - return overrides; - } - /** - * @_ignore: - */ - async function resolveArgs(_runner, inputs, args) { - // Recursively descend into args and resolve any addresses - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = Typed.dereference(value, type); - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - })); - } - function buildWrappedFallback(contract) { - const populateTransaction = async function (overrides) { - // If an overrides was passed in, copy it and normalize the values - const tx = (await copyOverrides(overrides, ["data"])); - tx.to = await contract.getAddress(); - const iface = contract.interface; - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - assertArgument(payable || (tx.value || BN_0$1) === BN_0$1, "cannot send value to non-payable contract", "overrides.value", tx.value); - // Only allow fallback contracts to set non-empty data - assertArgument(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data); - return tx; - }; - const staticCall = async function (overrides) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(overrides); - try { - return await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - const send = async function (overrides) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (overrides) { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(overrides)); - }; - const method = async (overrides) => { - return await send(overrides); - }; - defineProperties(method, { - _contract: contract, - estimateEnergy, - populateTransaction, - send, - staticCall, - }); - return method; - } - function buildWrappedMethod(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getFunction(key, args); - assert(fragment, "no matching fragment in getFragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const populateTransaction = async function (...args) { - const fragment = getFragment(...args); - // If an overrides was passed in, copy it and normalize the values - let overrides = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs), - })); - }; - const staticCall = async function (...args) { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return result; - }; - const send = async function (...args) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (...args) { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(...args)); - }; - const staticCallResult = async function (...args) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(...args); - let result = "0x"; - try { - result = await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - const method = async (...args) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, - _key: key, - getFragment, - estimateEnergy, - populateTransaction, - send, - staticCall, - staticCallResult, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - assert(fragment, "no matching fragment in defineProperty", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; - } - function buildWrappedEvent(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getEvent(key, args); - assert(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const method = function (...args) { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, - _key: key, - getFragment, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; - } - // The combination of TypeScrype, Private Fields and Proxies makes - // the world go boom; so we hide variables with some trickery keeping - // a symbol attached to each BaseContract which its sub-class (even - // via a Proxy) can reach and use to look up its internal values. - const internal = Symbol.for("_corebcInternal_contract"); - const internalValues = new WeakMap(); - function setInternal(contract, values) { - internalValues.set(contract[internal], values); - } - function getInternal(contract) { - return internalValues.get(contract[internal]); - } - function isDeferred(value) { - return (value && - typeof value === "object" && - "getTopicFilter" in value && - typeof value.getTopicFilter === "function" && - value.fragment); - } - async function getSubInfo(contract, event) { - let topics; - let fragment = null; - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - if (Array.isArray(event)) { - const topicHashify = function (name) { - if (isHexString(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } - else if (event === "*") { - topics = [null]; - } - else if (typeof event === "string") { - if (isHexString(event, 32)) { - // Topic Hash - topics = [event]; - } - else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - assertArgument(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } - else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } - else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } - else { - assertArgument(false, "unknown event name", "event", event); - } - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - const tag = topics - .map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }) - .join("&"); - return { fragment, tag, topics }; - } - async function hasSub(contract, event) { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; - } - async function getSub(contract, operation, event) { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); - const { fragment, tag, topics } = await getSubInfo(contract, event); - const { addr, subs } = getInternal(contract); - let sub = subs.get(tag); - if (!sub) { - const address = addr ? addr : contract; - const filter = { address, topics }; - const listener = (log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - // If fragment is null, we do not deconstruct the args to emit - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment - ? contract.interface.decodeEventLog(fragment, log.data, log.topics) - : []; - emit(contract, event, args, (listener) => { - return new ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } - else { - emit(contract, event, [], (listener) => { - return new ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - let starting = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - const stop = async () => { - if (starting.length == 0) { - return; - } - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; - } - // We use this to ensure one emit resolves before firing the next to - // ensure correct ordering (note this cannot throw and just adds the - // notice to the event queu using setTimeout). - let lastEmit = Promise.resolve(); - async function _emit(contract, event, args, payloadFunc) { - await lastEmit; - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } - catch (error) { } - return !once; - }); - return count > 0; - } - async function emit(contract, event, args, payloadFunc) { - try { - await lastEmit; - } - catch (error) { } - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; - } - const passProperties = ["then"]; - class BaseContract { - target; - interface; - runner; - filters; - [internal]; - fallback; - constructor(target, abi, runner, _deployTx) { - if (runner == null) { - runner = null; - } - const iface = Interface.from(abi); - defineProperties(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - let addrPromise; - let addr = null; - let deployTx = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); - } - let subs = new Map(); - // Resolve the target as the address - if (typeof target === "string") { - if (isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } - else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - }); - } - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - } - else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - // Add the event filters - const filters = new Proxy({}, { - get: (target, _prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = this.getEvent(prop); - if (result) { - return result; - } - throw new Error(`unknown contract event: ${prop}`); - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop))); - }, - }); - defineProperties(this, { filters }); - defineProperties(this, { - fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null, - }); - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, _prop, receiver) => { - if (_prop in target || passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = target.getFunction(prop); - if (result) { - return result; - } - throw new Error(`unknown contract method: ${prop}`); - }, - has: (target, prop) => { - if (prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return target.interface.hasFunction(String(prop)); - }, - }); - } - connect(runner) { - return new BaseContract(this.target, this.interface, runner); - } - async getAddress() { - return await getInternal(this).addrPromise; - } - async getDeployedCode() { - const provider = getProvider(this.runner); - assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - async waitForDeployment() { - // We have the deployement transaction; just use that (throws if deployement fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } - catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - deploymentTransaction() { - return getInternal(this).deployTx; - } - getFunction(key) { - if (typeof key !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - getEvent(key) { - if (typeof key !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - async queryTransaction(hash) { - // Is this useful? - throw new Error("@TODO"); - } - async queryFilter(event, fromBlock, toBlock) { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = addr ? addr : await addrPromise; - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - if (foundFragment) { - return new EventLog(log, this.interface, foundFragment); - } - else { - return new Log(log, provider); - } - }); - } - async on(event, listener) { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - async once(event, listener) { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - async emit(event, ...args) { - return await emit(this, event, args, null); - } - async listenerCount(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - const { subs } = getInternal(this); - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - const { subs } = getInternal(this); - let result = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return await this.off(event, listener); - } - static buildClass(abi) { - class CustomContract extends BaseContract { - constructor(address, runner = null) { - super(address, abi, runner); - } - } - return CustomContract; - } - static from(target, abi, runner) { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract; - } - static isIndexed(value) { - return Indexed.isIndexed(value); - } - } - function _ContractBase() { - return BaseContract; - } - class Contract extends _ContractBase() { - } - - // A = Arguments to the constructor - // I = Interface of deployed contracts - class ContractFactory { - interface; - bytecode; - runner; - constructor(abi, bytecode, runner) { - const iface = Interface.from(abi); - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = hexlify(getBytes(bytecode)); - } - else if (typeof bytecode === "string") { - bytecode = bytecode; - } - else if (isBytes$1(bytecode)) { - bytecode = hexlify(bytecode); - } - else if (bytecode && typeof bytecode.object === "string") { - // Allow the bytecode object from the Solidity compiler - bytecode = bytecode.object; - } - else { - // Crash in the next verification step - bytecode = "!"; - } - defineProperties(this, { - // @ts-ignore - bytecode, - interface: iface, - runner: runner || null, - }); - } - async getDeployTransaction(...args) { - let overrides = {}; - const fragment = this.interface.deploy; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); - const data = concat([ - this.bytecode, - this.interface.encodeDeploy(resolvedArgs), - ]); - return Object.assign({}, overrides, { data }); - } - async deploy(...args) { - const tx = await this.getDeployTransaction(...args); - assert(this.runner && typeof this.runner.sendTransaction === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction", - }); - const sentTx = await this.runner.sendTransaction(tx); - const address = getCreateAddress(sentTx); - return new BaseContract(address, this.interface, this.runner, sentTx); - } - connect(runner) { - return new ContractFactory(this.interface, this.bytecode, runner); - } - static fromSolidity(output, runner) { - assertArgument(output != null, "bad compiler output", "output", output); - if (typeof output === "string") { - output = JSON.parse(output); - } - const abi = output.abi; - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } - else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - return new this(abi, bytecode, runner); - } - } - - /** - * @_ignore - */ - const BN_0 = BigInt(0); - function allowNull(format, nullValue) { - return function (value) { - if (value == null) { - return nullValue; - } - return format(value); - }; - } - function arrayOf(format) { - return (array) => { - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }; - } - // Requires an object which matches a fleet of other formatters - // Any FormatFunc may return `undefined` to have the value omitted - // from the result object. Calls preserve `this`. - function object(format, altNames) { - return (value) => { - const result = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } - catch (error) { - const message = error instanceof Error ? error.message : "not-an-error"; - assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); - } - } - return result; - }; - } - function formatBoolean(value) { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); - } - function formatData(value) { - assertArgument(isHexString(value, true), "invalid data", "value", value); - return value; - } - function formatHash(value) { - assertArgument(isHexString(value, 32), "invalid hash", "value", value); - return value; - } - const _formatLog = object({ - address: getAddress, - blockHash: formatHash, - blockNumber: getNumber, - data: formatData, - index: getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: getNumber, - }, { - index: ["logIndex"], - }); - function formatLog(value) { - return _formatLog(value); - } - const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - number: getNumber, - timestamp: getNumber, - nonce: allowNull(formatData), - difficulty: getBigInt, - energyLimit: getBigInt, - energyUsed: getBigInt, - miner: allowNull(getAddress), - extraData: formatData, - baseFeePerEnergy: allowNull(getBigInt), - }); - function formatBlock(value) { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return formatTransactionResponse(tx); - }); - return result; - } - const _formatReceiptLog = object({ - transactionIndex: getNumber, - blockNumber: getNumber, - transactionHash: formatHash, - address: getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: getNumber, - blockHash: formatHash, - }, { - index: ["logIndex"], - }); - function formatReceiptLog(value) { - return _formatReceiptLog(value); - } - const _formatTransactionReceipt = object({ - to: allowNull(getAddress, null), - from: allowNull(getAddress, null), - contractAddress: allowNull(getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: getNumber, - root: allowNull(hexlify), - energyUsed: getBigInt, - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeEnergyUsed: getBigInt, - effectiveEnergyPrice: allowNull(getBigInt), - status: allowNull(getNumber), - type: allowNull(getNumber, 0), - }, { - effectiveEnergyPrice: ["energyPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], - }); - function formatTransactionReceipt(value) { - return _formatTransactionReceipt(value); - } - function formatTransactionResponse(value) { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && !getAddress(value.to) && getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - const result = object({ - hash: formatHash, - type: (value) => { - if (value === "0x" || value == null) { - return 0; - } - return getNumber(value); - }, - accessList: allowNull(accessListify, null), - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(getNumber, null), - transactionIndex: allowNull(getNumber, null), - //confirmations: allowNull(getNumber, null), - from: getAddress, - maxFeePerEnergy: allowNull(getBigInt), - energyLimit: getBigInt, - to: allowNull(getAddress, null), - value: getBigInt, - nonce: getNumber, - data: formatData, - creates: allowNull(getAddress, null), - networkId: allowNull(getBigInt, null), - }, { - data: ["input"], - energyLimit: ["energy"], - })(value); - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = getCreateAddress(result); - } - // Compute the signature - if (value.signature) { - result.signature = value.signature; - } - else { - result.signature = value; - } - // Some backends omit networkId on legacy transactions, but we can compute it - if (result.networkId == null) { - const networkId = result.signature.legacynetworkId; - if (networkId != null) { - result.networkId = networkId; - } - } - // @TODO: check networkId - /* - if (value.networkId != null) { - let networkId = value.networkId; - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - result.networkId = networkId; - - } else { - let networkId = value.networkId; - - // geth-etc returns networkId - if (networkId == null && result.v == null) { - networkId = value.networkId; - } - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - if (typeof(networkId) !== "number" && result.v != null) { - networkId = (result.v - 35) / 2; - if (networkId < 0) { networkId = 0; } - networkId = parseInt(networkId); - } - - if (typeof(networkId) !== "number") { networkId = 0; } - - result.networkId = networkId; - } - */ - // 0x0000... should actually be null - if (result.blockHash && getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } - return result; - } - - class NetworkPlugin { - name; - constructor(name) { - defineProperties(this, { name }); - } - clone() { - return new NetworkPlugin(this.name); - } - } - class EnergyCostPlugin extends NetworkPlugin { - effectiveBlock; - txBase; - txCreate; - txDataZero; - txDataNonzero; - txAccessListStorageKey; - txAccessListAddress; - constructor(effectiveBlock, costs) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock || 0}`); - const props = { effectiveBlock }; - function set(name, nullish) { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs); - props[name] = value; - } - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - defineProperties(this, props); - } - clone() { - return new EnergyCostPlugin(this.effectiveBlock, this); - } - } - class FeeDataNetworkPlugin extends NetworkPlugin { - #feeDataFunc; - get feeDataFunc() { - return this.#feeDataFunc; - } - constructor(feeDataFunc) { - super("org.corebc.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - async getFeeData(provider) { - return await this.#feeDataFunc(provider); - } - clone() { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } - } - /* - export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } - } - */ - - /** - * About networks - * - * @_subsection: api/providers:Networks [networks] - */ - /* * * * - // Networks which operation against an L2 can use this plugin to - // specify how to access L1, for the purpose of resolving ENS, - // for example. - export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; - */ - // Networks or clients with a higher need for security (such as clients - // that may automatically make CCIP requests without user interaction) - // can use this plugin to anonymize requests or intercept CCIP requests - // to notify and/or receive authorization from the user - const Networks = new Map(); - class Network { - #name; - #networkId; - #plugins; - constructor(name, networkId) { - this.#name = name; - this.#networkId = getBigInt(networkId); - this.#plugins = new Map(); - } - toJSON() { - return { name: this.name, networkId: String(this.networkId) }; - } - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name() { - return this.#name; - } - set name(value) { - this.#name = value; - } - /** - * The network chain ID. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = getBigInt(value, "networkId"); - } - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other) { - if (other == null) { - return false; - } - if (typeof other === "string") { - try { - return this.networkId === getBigInt(other); - } - catch (error) { } - return this.name === other; - } - if (typeof other === "number" || typeof other === "bigint") { - try { - return this.networkId === getBigInt(other); - } - catch (error) { } - return false; - } - if (typeof other === "object") { - if (other.networkId != null) { - try { - return this.networkId === getBigInt(other.networkId); - } - catch (error) { } - return false; - } - if (other.name != null) { - return this.name === other.name; - } - return false; - } - return false; - } - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name) { - return this.#plugins.get(name) || null; - } - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename) { - return (this.plugins.filter((p) => p.name.split("#")[0] === basename)); - } - /** - * Create a copy of this Network. - */ - clone() { - const clone = new Network(this.name, this.networkId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - /** - * Compute the intrinsic energy required for a transaction. - * - * A EnergyCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicEnergy(tx) { - const costs = this.getPlugin("org.corebc.plugins.network.EnergyCost") || new EnergyCostPlugin(); - let energy = costs.txBase; - if (tx.to == null) { - energy += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - energy += costs.txDataZero; - } - else { - energy += costs.txDataNonzero; - } - } - } - return energy; - } - /** - * Returns a new Network for the %%network%% name or networkId. - */ - static from(network) { - injectCommonNetworks(); - // Default network - if (network == null) { - return Network.from("mainnet"); - } - // Canonical name or chain ID - if (typeof network === "number") { - network = BigInt(network); - } - if (typeof network === "string" || typeof network === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof network === "bigint") { - return new Network("unknown", network); - } - assertArgument(false, "unknown network", "network", network); - } - // Clonable with network-like abilities - if (typeof network.clone === "function") { - const clone = network.clone(); - //if (typeof(network.name) !== "string" || typeof(network.networkId) !== "number") { - //} - return clone; - } - // Networkish - if (typeof network === "object") { - assertArgument(typeof network.name === "string" && - typeof network.networkId === "number", "invalid network object name or networkId", "network", network); - const custom = new Network(network.name, network.networkId); - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - return custom; - } - assertArgument(false, "invalid network", "network", network); - } - /** - * Register %%nameOrnetworkId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrnetworkId, networkFunc) { - if (typeof nameOrnetworkId === "number") { - nameOrnetworkId = BigInt(nameOrnetworkId); - } - const existing = Networks.get(nameOrnetworkId); - if (existing) { - assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrnetworkId", nameOrnetworkId); - } - Networks.set(nameOrnetworkId, networkFunc); - } - } - // See: https://chainlist.org - let injected = false; - function injectCommonNetworks() { - if (injected) { - return; - } - injected = true; - /// Register popular Core networks - function registerEth(name, networkId, options) { - const func = function () { - const network = new Network(name, networkId); - network.attachPlugin(new EnergyCostPlugin()); - return network; - }; - // Register the network by name and chain ID - Network.register(name, func); - Network.register(networkId, func); - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - registerEth("mainnet", 1, { altNames: ["homestead"] }); - registerEth("ropsten", 3, { }); - registerEth("rinkeby", 4, { }); - registerEth("goerli", 5, { }); - registerEth("kovan", 42, { }); - registerEth("sepolia", 11155111, {}); - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - registerEth("xdai", 100, { }); - } - - function copy$2(obj) { - return JSON.parse(JSON.stringify(obj)); - } - // @TODO: refactor this - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class PollingBlockSubscriber { - #provider; - #poller; - #interval; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - this.#blockNumber = -2; - } - get pollingInterval() { - return this.#interval; - } - set pollingInterval(value) { - this.#interval = value; - } - async #poll() { - try { - const blockNumber = await this.#provider.getBlockNumber(); - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - // @TODO: Put a cap on the maximum number of events per loop? - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - await this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - } - } - catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - // We have been stopped - if (this.#poller == null) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - start() { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - stop() { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } - } - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class OnBlockSubscriber { - #provider; - #poll; - #running; - constructor(provider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber) => { - this._poll(blockNumber, this.#provider); - }; - } - async _poll(blockNumber, provider) { - throw new Error("sub-classes must override this"); - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poll); - } - pause(dropWhilePaused) { - this.stop(); - } - resume() { - this.start(); - } - } - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter; - constructor(provider, filter) { - super(provider); - this.#filter = copy$2(filter); - } - async _poll(blockNumber, provider) { - throw new Error("@TODO"); - } - } - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash; - constructor(provider, hash) { - super(provider); - this.#hash = hash; - } - async _poll(blockNumber, provider) { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } - } - /** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ - class PollingEventSubscriber { - #provider; - #filter; - #poller; - #running; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = copy$2(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - async #poll(blockNumber) { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - const filter = copy$2(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - this.#blockNumber = blockNumber; - for (const log of logs) { - this.#provider.emit(this.#filter, log); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } - } - - /** - * About Subclassing the Provider... - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ - // @TODO - // Event coalescence - // When we register an event with an async value (e.g. address is a Signer - // or ENS name), we need to add it immeidately for the Event API, but also - // need time to resolve the address. Upon resolving the address, we need to - // migrate the listener to the static event. We also need to maintain a map - // of Signer/ENS name to address so we can sync respond to listenerCount. - const MAX_CCIP_REDIRECTS = 10; - function isPromise(value) { - return value && typeof value.then === "function"; - } - function getTag(prefix, value) { - return (prefix + - ":" + - JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof v === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof v === "string") { - return v.toLowerCase(); - } - // Sort object keys - if (typeof v === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, {}); - } - return v; - })); - } - class UnmanagedSubscriber { - name; - constructor(name) { - defineProperties(this, { name }); - } - start() { } - stop() { } - pause(dropWhilePaused) { } - resume() { } - } - function copy$1(value) { - return JSON.parse(JSON.stringify(value)); - } - function concisify(items) { - items = Array.from(new Set(items).values()); - items.sort(); - return items; - } - async function getSubscription(_event, provider) { - if (_event == null) { - throw new Error("invalid event"); - } - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - if (typeof _event === "string") { - switch (_event) { - case "block": - case "pending": - case "debug": - case "error": - case "network": { - return { type: _event, tag: _event }; - } - } - } - if (isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - if (_event.orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { - type: "orphan", - tag: getTag("orphan", event), - filter: copy$1(event), - }; - } - if (_event.address || _event.topics) { - const event = _event; - const filter = { - topics: (event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }), - }; - if (event.address) { - const addresses = []; - const promises = []; - const addAddress = (addr) => { - if (isHexString(addr)) { - addresses.push(addr); - } - else { - promises.push((async () => { - addresses.push(await resolveAddress(addr)); - })()); - } - }; - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } - else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - return { filter, tag: getTag("event", filter), type: "event" }; - } - assertArgument(false, "unknown ProviderEvent", "event", _event); - } - function getTime$1() { - return new Date().getTime(); - } - class AbstractProvider { - #subs; - #plugins; - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState; - #networkPromise; - #anyNetwork; - #performCache; - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber; - #nextTimer; - #timers; - #disableCcipRead; - // @TODO: This should be a () => Promise so network can be - // done when needed; or rely entirely on _detectNetwork? - constructor(_network) { - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } - else if (_network) { - const network = Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { - this.emit("network", network, null); - }, 0); - } - else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - this.#lastBlockNumber = -1; - this.#performCache = new Map(); - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - this.#nextTimer = 1; - this.#timers = new Map(); - this.#disableCcipRead = false; - } - get provider() { - return this; - } - get plugins() { - return Array.from(this.#plugins.values()); - } - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - getPlugin(name) { - return this.#plugins.get(name) || null; - } - get disableCcipRead() { - return this.#disableCcipRead; - } - set disableCcipRead(value) { - this.#disableCcipRead = !!value; - } - // Shares multiple identical requests made during the same 250ms - async #perform(req) { - // Create a tag - const tag = getTag(req.method, req); - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, 250); - } - return await perform; - } - async ccipReadFetch(tx, calldata, urls) { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - const errorMessages = []; - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - this.emit("debug", { - action: "sendCcipReadFetchRequest", - request, - index: i, - urls, - }); - let errorMessage = "unknown error"; - const resp = await request.send(); - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { - action: "receiveCcipReadFetchResult", - request, - result, - }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { - action: "receiveCcipReadFetchError", - request, - result, - }); - } - catch (error) { } - // 4xx indicates the result is not present; stop - 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 }, - }); - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - assert(false, `error encountered during CCIP fetch: ${errorMessages - .map((m) => JSON.stringify(m)) - .join(", ")}`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, - info: { urls, errorMessages }, - }); - } - _wrapBlock(value, network) { - return new Block(formatBlock(value), this); - } - _wrapLog(value, network) { - return new Log(formatLog(value), this); - } - _wrapTransactionReceipt(value, network) { - return new TransactionReceipt(formatTransactionReceipt(value), this); - } - _wrapTransactionResponse(tx, network) { - return new TransactionResponse(formatTransactionResponse(tx), this); - } - _detectNetwork() { - assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork", - }); - } - // Sub-classes should override this and handle PerformActionRequest requests, calling - // the super for any unhandled actions. - async _perform(req) { - assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req, - }); - } - // State - async getBlockNumber() { - const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - _getAddress(address) { - return resolveAddress(address); - } - _getBlockTag(blockTag) { - if (blockTag == null) { - return "latest"; - } - switch (blockTag) { - case "earliest": - return "0x0"; - case "latest": - case "pending": - case "safe": - case "finalized": - return blockTag; - } - if (isHexString(blockTag)) { - if (isHexString(blockTag, 32)) { - return blockTag; - } - return toQuantity(blockTag); - } - if (typeof blockTag === "bigint") { - blockTag = getNumber(blockTag, "blockTag"); - } - if (typeof blockTag === "number") { - if (blockTag >= 0) { - return toQuantity(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return toQuantity(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => toQuantity(b + blockTag)); - } - assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - _getFilter(filter) { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - const blockHash = "blockHash" in filter ? filter.blockHash : undefined; - const resolve = (_address, fromBlock, toBlock) => { - let address = undefined; - switch (_address.length) { - case 0: - break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - return filter; - }; - // Addresses could be async (ENS names or Addressables) - let address = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } - else { - address.push(this._getAddress(filter.address)); - } - } - let fromBlock = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - let toBlock = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - if (address.filter((a) => typeof a !== "string").length || - (fromBlock != null && typeof fromBlock !== "string") || - (toBlock != null && typeof toBlock !== "string")) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - return resolve(address, fromBlock, toBlock); - } - _getTransactionRequest(_request) { - const request = copyRequest(_request); - const promises = []; - ["to", "from"].forEach((key) => { - if (request[key] == null) { - return; - } - const addr = resolveAddress(request[key]); - if (isPromise(addr)) { - promises.push((async function () { - request[key] = await addr; - })()); - } - else { - request[key] = addr; - } - }); - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise(blockTag)) { - promises.push((async function () { - request.blockTag = await blockTag; - })()); - } - else { - request.blockTag = blockTag; - } - } - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - return request; - } - async getNetwork() { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = this._detectNetwork().then((network) => { - this.emit("network", network, null); - return network; - }, (error) => { - // Reset the networkPromise on failure, so we will try again - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - }); - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - const networkPromise = this.#networkPromise; - const [expected, actual] = await Promise.all([ - networkPromise, // Possibly an explicit Network - this._detectNetwork(), // The actual connected network - ]); - if (expected.networkId !== actual.networkId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } - else { - // Otherwise, we do not allow changes to the underlying network - assert(false, `network changed: ${expected.networkId} => ${actual.networkId} `, "NETWORK_ERROR", { - event: "changed", - }); - } - } - return expected.clone(); - } - async getEnergyPrice() { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new FeeData(energyPrice); - } - async getFeeData() { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new FeeData(energyPrice); - } - async estimateEnergy(_tx) { - let tx = this._getTransactionRequest(_tx); - if (isPromise(tx)) { - tx = await tx; - } - return getBigInt(await this.#perform({ - method: "estimateEnergy", - transaction: tx, - }), "%response"); - } - async #call(tx, blockTag, attempt) { - assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }), - }); - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = copyRequest(tx); - try { - return hexlify(await this._perform({ method: "call", transaction, blockTag })); - } - catch (error) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && - isCallException(error) && - error.data && - attempt >= 0 && - blockTag === "latest" && - transaction.to != null && - dataSlice(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - const txSender = await resolveAddress(transaction.to); - // Parse the CCIP Read Arguments - let ccipArgs; - try { - ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); - } - catch (error) { - assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", - transaction, - info: { data }, - }); - } - // Check the sender of the OffchainLookup matches the transaction - assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, // @TODO: populate data? - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs, - }, - }); - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", - transaction, - info: { data: error.data, errorArgs: ccipArgs.errorArgs }, - }); - const tx = { - to: txSender, - data: concat([ - ccipArgs.selector, - encodeBytes([ccipResult, ccipArgs.extraData]), - ]), - }; - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { - action: "receiveCcipReadCallResult", - transaction: Object.assign({}, tx), - result, - }); - return result; - } - catch (error) { - this.emit("debug", { - action: "receiveCcipReadCallError", - transaction: Object.assign({}, tx), - error, - }); - throw error; - } - } - throw error; - } - } - async #checkNetwork(promise) { - const { value } = await resolveProperties({ - network: this.getNetwork(), - value: promise, - }); - return value; - } - async call(_tx) { - const { tx, blockTag } = await resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag), - }); - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); - } - // Account - async #getAccountValue(request, _address, _blockTag) { - let address = this._getAddress(_address); - let blockTag = this._getBlockTag(_blockTag); - if (typeof address !== "string" || typeof blockTag !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - async getBalance(address, blockTag) { - return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - async getTransactionCount(address, blockTag) { - return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - async getCode(address, blockTag) { - return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - async getStorage(address, _position, blockTag) { - const position = getBigInt(_position, "position"); - return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - // Write - async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx, - }), - network: this.getNetwork(), - }); - const tx = Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - async #getBlock(block, includeTransactions) { - // @TODO: Add CustomBlockPlugin check - if (isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", - blockHash: block, - includeTransactions, - }); - } - let blockTag = this._getBlockTag(block); - if (typeof blockTag !== "string") { - blockTag = await blockTag; - } - return await this.#perform({ - method: "getBlock", - blockTag, - includeTransactions, - }); - } - // Queries - async getBlock(block, prefetchTxs) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs), - }); - if (params == null) { - return null; - } - return this._wrapBlock(params, network); - } - async getTransaction(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }), - }); - if (params == null) { - return null; - } - return this._wrapTransactionResponse(params, network); - } - async getTransactionReceipt(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }), - }); - if (params == null) { - return null; - } - // Some backends did not backfill the effectiveEnergyPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.energyPrice == null && params.effectiveEnergyPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error("report this; could not find tx or effectiveEnergyPrice"); - } - params.effectiveEnergyPrice = tx.energyPrice; - } - return this._wrapTransactionReceipt(params, network); - } - async getTransactionResult(hash) { - const { result } = await resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }), - }); - if (result == null) { - return null; - } - return hexlify(result); - } - // Bloom-filter Queries - async getLogs(_filter) { - let filter = this._getFilter(_filter); - if (isPromise(filter)) { - filter = await filter; - } - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getLogs", filter }), - }); - return params.map((p) => this._wrapLog(p, network)); - } - // ENS - _getProvider(networkId) { - assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()", - }); - } - async waitForTransaction(hash, _confirms, timeout) { - const confirms = _confirms != null ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - return new Promise(async (resolve, reject) => { - let timer = null; - const listener = async (blockNumber) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } - catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }; - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - listener(await this.getBlockNumber()); - }); - } - async waitForBlock(blockTag) { - assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock", - }); - } - _clearTimeout(timerId) { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - _setTimeout(_func, timeout) { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } - else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime$1() }); - } - return timerId; - } - _forEachSubscriber(func) { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - // Event API; sub-classes should override this; any supported - // event filter will have been munged into an EventFilter - _getSubscriber(sub) { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": - return new PollingBlockSubscriber(this); - case "event": - return new PollingEventSubscriber(this, sub.filter); - case "transaction": - return new PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new PollingOrphanSubscriber(this, sub.filter); - } - throw new Error(`unsupported event: ${sub.type}`); - } - _recoverSubscriber(oldSub, newSub) { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - async #hasSub(event, emitArgs) { - let sub = await getSubscription(event); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && - emitArgs && - emitArgs.length > 0 && - emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }); - } - return this.#subs.get(sub.tag) || null; - } - async #getSub(event) { - const subscription = await getSubscription(event); - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { - subscriber, - tag, - addressableMap, - nameMap, - started: false, - listeners: [], - }; - this.#subs.set(tag, sub); - } - return sub; - } - async on(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async once(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async emit(event, ...args) { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new EventPayload(this, once ? null : listener, event); - try { - listener.call(this, ...args, payload); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return count > 0; - } - async listenerCount(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return this.off(event, listener); - } - // Sub-classes should override this to shutdown any sockets, etc. - // but MUST call this super.shutdown. - destroy() { - // Stop all listeners - this.removeAllListeners(); - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - } - get paused() { - return this.#pausedState != null; - } - set paused(pause) { - if (!!pause === this.paused) { - return; - } - if (this.paused) { - this.resume(); - } - else { - this.pause(false); - } - } - pause(dropWhilePaused) { - this.#lastBlockNumber = -1; - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause", - }); - } - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - // Remaining time needed for when we become unpaused - timer.time = getTime$1() - timer.time; - } - } - resume() { - if (this.#pausedState == null) { - return; - } - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime$1(); - // Start the timer - setTimeout(timer.func, timeout); - } - } - } - function _parseString(result, start) { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return toUtf8String(bytes); - } - } - catch (error) { } - return null; - } - function _parseBytes(result, start) { - if (result === "0x") { - return null; - } - try { - const offset = getNumber(dataSlice(result, start, start + 32)); - const length = getNumber(dataSlice(result, offset, offset + 32)); - return dataSlice(result, offset + 32, offset + 32 + length); - } - catch (error) { } - return null; - } - function numPad(value) { - const result = toBeArray(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; - } - function bytesPad(value) { - if (value.length % 32 === 0) { - return value; - } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; - } - const empty = new Uint8Array([]); - // ABI Encodes a series of (bytes, bytes, ...) - function encodeBytes(datas) { - const result = []; - let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - for (let i = 0; i < datas.length; i++) { - const data = getBytes(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } - return concat(result); - } - const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; - function parseOffchainLookup(data) { - const result = { - sender: "", - urls: [], - calldata: "", - selector: "", - extraData: "", - errorArgs: [], - }; - assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data", - }); - const sender = dataSlice(data, 0, 32); - assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender", - }); - result.sender = dataSlice(sender, 12); - // Read the URLs from the response - try { - const urls = []; - const urlsOffset = getNumber(dataSlice(data, 32, 64)); - const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); - const urlsData = dataSlice(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } - catch (error) { - assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls", - }); - } - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } - catch (error) { - assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata", - }); - } - // Get the callbackSelector (bytes4) - assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector", - }); - result.selector = dataSlice(data, 96, 100); - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } - catch (error) { - assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData", - }); - } - result.errorArgs = "sender,urls,calldata,selector,extraData" - .split(/,/) - .map((k) => result[k]); - return result; - } - - /** - * About Abstract Signer and subclassing - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ - function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); - } - async function populate(signer, tx) { - let pop = copyRequest(tx); - if (pop.to != null) { - pop.to = resolveAddress(pop.to); - } - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).then(([address, from]) => { - assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); - return address; - }); - } - else { - pop.from = signer.getAddress(); - } - return await resolveProperties(pop); - } - class AbstractSigner { - provider; - constructor(provider) { - defineProperties(this, { provider: provider || null }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.energyLimit == null) { - pop.energyLimit = await this.estimateEnergy(pop); - } - // Populate the chain ID - const network = await this.provider.getNetwork(); - if (pop.networkId != null) { - const networkId = getBigInt(pop.networkId); - assertArgument(networkId === network.networkId, "transaction networkId mismatch", "tx.networkId", tx.networkId); - } - else { - pop.networkId = network.networkId; - } - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - // We need to auto-detect the intended type of this transaction... - if (feeData.energyPrice != null) { - // Network doesn't support EIP-1559... - // Populate missing fee data - if (pop.energyPrice == null) { - pop.energyPrice = feeData.energyPrice; - } - } - else { - // getFeeData has failed us. - assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData", - }); - } - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await resolveProperties(pop); - } - async estimateEnergy(tx) { - return checkProvider(this, "estimateEnergy").estimateEnergy(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name) { - return getAddress(name); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } - } - class VoidSigner extends AbstractSigner { - address; - constructor(address, provider) { - super(provider); - defineProperties(this, { address }); - } - async getAddress() { - return this.address; - } - connect(provider) { - return new VoidSigner(this.address, provider); - } - #throwUnsupported(suffix, operation) { - assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { - operation, - }); - } - async signTransaction(tx) { - this.#throwUnsupported("transactions", "signTransaction"); - } - async signMessage(message) { - this.#throwUnsupported("messages", "signMessage"); - } - async signTypedData(domain, types, value) { - this.#throwUnsupported("typed-data", "signTypedData"); - } - } - - /** - * There are many awesome community services that provide Core - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ - // Show the throttle message only once per service - const shown = new Set(); - /** - * Displays a warning in tht console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ - function showThrottleMessage(service) { - if (shown.has(service)) { - return; - } - shown.add(service); - console.log("========= NOTICE ========="); - console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); - } - - function copy(obj) { - return JSON.parse(JSON.stringify(obj)); - } - /** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ - class FilterIdSubscriber { - #provider; - #filterIdPromise; - #poller; - #running; - #network; - #hault; - constructor(provider) { - this.#provider = provider; - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#network = null; - this.#hault = false; - } - _subscribe(provider) { - throw new Error("subclasses must override this"); - } - _emitResults(provider, result) { - throw new Error("subclasses must override this"); - } - _recover(provider) { - throw new Error("subclasses must override this"); - } - async #poll(blockNumber) { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - // Get the Filter ID - let filterId = null; - try { - filterId = await this.#filterIdPromise; - } - catch (error) { - if (!isError(error, "UNSUPPORTED_OPERATION") || - error.operation !== "xcb_newFilter") { - throw error; - } - } - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - if (this.#network.networkId !== network.networkId) { - throw new Error("chaid changed"); - } - if (this.#hault) { - return; - } - const result = await this.#provider.send("xcb_getFilterChanges", [ - filterId, - ]); - await this._emitResults(this.#provider, result); - } - catch (error) { - console.log("@TODO", error); - } - this.#provider.once("block", this.#poller); - } - #teardown() { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - this.#provider.send("xcb_uninstallFilter", [filterId]); - }); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - resume() { - this.start(); - } - } - /** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ - class FilterIdEventSubscriber extends FilterIdSubscriber { - #event; - constructor(provider, filter) { - super(provider); - this.#event = copy(filter); - } - _recover(provider) { - return new PollingEventSubscriber(provider, this.#event); - } - async _subscribe(provider) { - const filterId = await provider.send("xcb_newFilter", [this.#event]); - return filterId; - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } - } - /** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ - class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider) { - return await provider.send("xcb_newPendingTransactionFilter", []); - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit("pending", result); - } - } - } - - /** - * About JSON-RPC... - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ - // @TODO: - // - Add the batching API - const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); - //const Methods = "getAddress,then".split(/,/g); - function deepCopy(value) { - if (value == null || Primitive.indexOf(typeof value) >= 0) { - return value; - } - // Keep any Addressable - if (typeof value.getAddress === "function") { - return value; - } - if (Array.isArray(value)) { - return value.map(deepCopy); - } - if (typeof value === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = value[key]; - return accum; - }, {}); - } - throw new Error(`should not happen: ${value} (${typeof value})`); - } - function stall$3(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); - } - function getLowerCase(value) { - if (value) { - return value.toLowerCase(); - } - return value; - } - function isPollable(value) { - return value && typeof value.pollingInterval === "number"; - } - const defaultOptions = { - polling: false, - staticNetwork: null, - batchStallTime: 10, // 10ms - batchMaxSize: 1 << 20, // 1Mb - batchMaxCount: 100, // 100 requests - }; - // @TODO: Unchecked Signers - class JsonRpcSigner extends AbstractSigner { - address; - constructor(provider, address) { - super(provider); - address = getAddress(address); - defineProperties(this, { address }); - } - connect(provider) { - assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect", - }); - } - async getAddress() { - return this.address; - } - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx) { - return await this.populateCall(tx); - } - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx) { - const tx = deepCopy(_tx); - const promises = []; - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await resolveAddress(_from); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } - else { - tx.from = this.address; - } - // The JSON-RPC for xcb_sendTransaction uses 90000 energy; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.energyLimit == null) { - promises.push((async () => { - tx.energyLimit = await this.provider.estimateEnergy({ - ...tx, - from: this.address, - }); - })()); - } - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await resolveAddress(_to); - })()); - } - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - const hexTx = this.provider.getRpcTransaction(tx); - return this.provider.send("xcb_sendTransaction", [hexTx]); - } - async sendTransaction(tx) { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - const checkTx = async () => { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - // Wait another 4 seconds - this.provider._setTimeout(() => { - checkTx(); - }, timeouts.pop() || 4000); - }; - checkTx(); - }); - } - async signTransaction(_tx) { - const tx = deepCopy(_tx); - // Make sure the from matches the sender - if (tx.from) { - const from = await resolveAddress(tx.from); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - } - else { - tx.from = this.address; - } - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("xcb_signTransaction", [hexTx]); - } - async signMessage(_message) { - const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("personal_sign", [ - hexlify(message), - this.address.toLowerCase(), - ]); - } - async signTypedData(domain, types, _value) { - const value = deepCopy(_value); - // Populate any ENS names (in-place) - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await resolveAddress(value); - assertArgument(address != null, "TypedData does not support null address", "value", value); - return address; - }); - return await this.provider.send("xcb_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value)), - ]); - } - async unlock(password) { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), - password, - null, - ]); - } - async _legacySignMessage(_message) { - const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("xcb_sign", [ - this.address.toLowerCase(), - hexlify(message), - ]); - } - } - /** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ - class JsonRpcApiProvider extends AbstractProvider { - #options; - // The next ID to use for the JSON-RPC ID field - #nextId; - // Payloads are queued and triggered in batches using the drainTimer - #payloads; - #drainTimer; - #notReady; - #network; - #scheduleDrain() { - if (this.#drainTimer) { - return; - } - // If we aren't using batching, no hard in sending it immeidately - const stallTime = this._getOption("batchMaxCount") === 1 - ? 0 - : this._getOption("batchStallTime"); - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - const payloads = this.#payloads; - this.#payloads = []; - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [payloads.shift()]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push(payloads.shift()); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift(batch.pop()); - break; - } - } - // Process the result to each payload - (async () => { - const payload = batch.length === 1 ? batch[0].payload : batch.map((p) => p.payload); - this.emit("debug", { action: "sendRpcPayload", payload }); - try { - // console.log({payload}) - const result = await this._send(payload); - // console.log({result}) - this.emit("debug", { action: "receiveRpcResult", result }); - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - // Find the matching result - const resp = result.filter((r) => r.id === payload.id)[0]; - // No result; the node failed us in unexpected ways - if (resp == null) { - return reject(makeError("no response from server", "BAD_DATA", { - value: result, - info: { payload }, - })); - } - // The response is an error - if ("error" in resp) { - return reject(this.getRpcError(payload, resp)); - } - // All good; send the result - resolve(resp.result); - } - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - constructor(network, options) { - super(network); - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - this.#payloads = []; - this.#drainTimer = null; - this.#network = null; - { - let resolve = null; - const promise = new Promise((_resolve) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - // Make sure any static network is compatbile with the provided netwrok - const staticNetwork = this._getOption("staticNetwork"); - if (staticNetwork) { - assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key) { - return this.#options[key]; - } - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network() { - assert(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - /* - { - assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { - operation: "jsonRpcApiProvider._send" - }); - } - */ - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req) { - const request = this.getRpcRequest(req); - if (request != null) { - return await this.send(request.method, request.args); - } - return super._perform(req); - } - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork() { - const network = this._getOption("staticNetwork"); - if (network) { - return network; - } - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - return Network.from(getBigInt(await this.send("xcb_networkId", []))); - } - // We are not ready yet; use the primitive _send - const payload = { - id: this.#nextId++, - method: "xcb_networkId", - params: [], - jsonrpc: "2.0", - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return Network.from(getBigInt(result.result)); - } - throw this.getRpcError(payload, result); - } - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start() { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - this.#notReady.resolve(); - this.#notReady = null; - (async () => { - // Bootstrap the network - while (this.#network == null) { - try { - this.#network = await this._detectNetwork(); - } - catch (error) { - console.log("JsonRpcProvider failed to startup; retry in 1s"); - await stall$3(1000); - } - } - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady() { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub) { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new FilterIdPendingSubscriber(this); - } - if (sub.type === "event") { - if (this._getOption("polling")) { - return new PollingEventSubscriber(this, sub.filter); - } - return new FilterIdEventSubscriber(this, sub.filter); - } - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("orphan"); - } - return super._getSubscriber(sub); - } - /** - * Returns true only if the [[_start]] has been called. - */ - get ready() { - return this.#notReady == null; - } - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx) { - const result = {}; - // JSON-RPC now requires numeric values to be "quantity" values - [ - "networkId", - "energyLimit", - "energyPrice", - "type", - "nonce", - "value", - ].forEach((key) => { - if (tx[key] == null) { - return; - } - let dstKey = key; - if (key === "energyLimit") { - dstKey = "energy"; - } - result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`)); - }); - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if (tx[key] == null) { - return; - } - result[key] = hexlify(tx[key]); - }); - return result; - } - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req) { - switch (req.method) { - case "networkId": - return { method: "xcb_networkId", args: [] }; - case "getBlockNumber": - return { method: "xcb_blockNumber", args: [] }; - case "getEnergyPrice": - return { method: "xcb_energyPrice", args: [] }; - case "getBalance": { - return { - method: "xcb_getBalance", - args: [getLowerCase(req.address), req.blockTag], - }; - } - case "getTransactionCount": - return { - method: "xcb_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getCode": - return { - method: "xcb_getCode", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getStorage": - return { - method: "xcb_getStorageAt", - args: [ - getLowerCase(req.address), - "0x" + req.position.toString(16), - req.blockTag, - ], - }; - case "broadcastTransaction": - return { - method: "xcb_sendRawTransaction", - args: [req.signedTransaction], - }; - case "getBlock": - if ("blockTag" in req) { - return { - method: "xcb_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions], - }; - } - else if ("blockHash" in req) { - return { - method: "xcb_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions], - }; - } - break; - case "getTransaction": - return { - method: "xcb_getTransactionByHash", - args: [req.hash], - }; - case "getTransactionReceipt": - return { - method: "xcb_getTransactionReceipt", - args: [req.hash], - }; - case "call": - return { - method: "xcb_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag], - }; - case "estimateEnergy": { - return { - method: "xcb_estimateEnergy", - args: [this.getRpcTransaction(req.transaction)], - }; - } - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } - else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "xcb_getLogs", args: [req.filter] }; - } - return null; - } - /** - * Returns an CoreBC-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload, _error) { - const { method } = payload; - const { error } = _error; - if (method === "xcb_estimateEnergy" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: payload.params[0], - info: { payload, error }, - }); - } - } - if (method === "xcb_call" || method === "xcb_estimateEnergy") { - const result = spelunkData(error); - const e = AbiCoder.getBuiltinCallException(method === "xcb_call" ? "call" : "estimateEnergy", payload.params[0], result ? result.data : null); - e.info = { error, payload }; - return e; - } - // Only estimateEnergy and call can return arbitrary contract-defined text, so now we - // we can process text safely. - const message = JSON.stringify(spelunkMessage(error)); - if (typeof error.message === "string" && - error.message.match(/user denied|corebc-user-denied/i)) { - const actionMap = { - xcb_sign: "signMessage", - personal_sign: "signMessage", - xcb_signTypedData_v4: "signTypedData", - xcb_signTransaction: "signTransaction", - xcb_sendTransaction: "sendTransaction", - xcb_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - return makeError(`user rejected action`, "ACTION_REJECTED", { - action: actionMap[method] || "unknown", - reason: "rejected", - info: { payload, error }, - }); - } - if (method === "xcb_sendRawTransaction" || - method === "xcb_sendTransaction") { - const transaction = payload.params[0]; - if (message.match(/insufficient funds|base fee exceeds energy limit/i)) { - return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, - info: { error }, - }); - } - if (message.match(/nonce/i) && message.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction, - info: { error }, - }); - } - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && - message.match(/underpriced/i)) { - return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction, - info: { error }, - }); - } - if (message.match(/only replay-protected/i)) { - return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, - info: { transaction, info: { error } }, - }); - } - } - if (message.match(/the method .* does not exist/i)) { - return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, - info: { error }, - }); - } - return makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); - } - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method, params) { - // @TODO: cache networkId?? purge on switch_networks - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, - reject, - payload: { method, params, id, jsonrpc: "2.0" }, - }); - }); - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - return promise; - } - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address) { - if (address == null) { - address = 0; - } - const accountsPromise = this.send("xcb_accounts", []); - // Account index - if (typeof address === "number") { - const accounts = await accountsPromise; - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - const { accounts } = await resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise, - }); - // Account address - address = getAddress(address); - for (const account of accounts) { - if (getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - throw new Error("invalid account"); - } - async listAccounts() { - const accounts = await this.send("xcb_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } - } - class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval; - constructor(network, options) { - super(network, options); - this.#pollingInterval = 4000; - } - _getSubscriber(sub) { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval() { - return this.#pollingInterval; - } - set pollingInterval(value) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } - } - /** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ - class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect; - constructor(url, network, options) { - if (url == null) { - url = "http://localhost:8545"; - } - super(network, options); - if (typeof url === "string") { - this.#connect = new FetchRequest(url); - } - else { - this.#connect = url.clone(); - } - } - _getConnection() { - return this.#connect.clone(); - } - async send(method, params) { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. xcb_networkId) until we absolutely have to. - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - return resp; - } - } - function spelunkData(value) { - if (value == null) { - return null; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string" && - value.message.match("reverted") && - isHexString(value.data)) { - return { message: value.message, data: value.data }; - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return spelunkData(JSON.parse(value)); - } - catch (error) { } - } - return null; - } - function _spelunkMessage(value, result) { - if (value == null) { - return; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string") { - result.push(value.message); - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } - catch (error) { } - } - } - function spelunkMessage(value) { - const result = []; - _spelunkMessage(value, result); - return result; - } - - /** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ - const defaultApiKey$1 = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; - function getHost$4(name) { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/xcb_goerli"; - case "matic": - return "rpc.ankr.com/polygon"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ - class AnkrProvider extends JsonRpcProvider { - /** - * The API key for the Ankr connection. - */ - apiKey; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AnkrProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey$1; - } - const request = new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey$1) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("AnkrProvider"); - return true; - }; - } - return request; - } - getRpcError(payload, error) { - if (payload.method === "xcb_sendRawTransaction") { - if (error && - error.error && - error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - return super.getRpcError(payload, error); - } - isCommunityResource() { - return this.apiKey === defaultApiKey$1; - } - } - - /** - * About Alchemy - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ - const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; - function getHost$3(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.alchemyapi.io"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ - class AlchemyProvider extends JsonRpcProvider { - apiKey; - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AlchemyProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - async _perform(req) { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await resolveProperties({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash), - }); - if (trace == null || tx == null) { - return null; - } - let data; - let error = false; - try { - data = trace[0].result.output; - error = trace[0].error === "Reverted"; - } - catch (error) { } - if (data) { - assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null, // @TODO - }); - return data; - } - assert(false, "could not parse trace result", "BAD_DATA", { - value: trace, - }); - } - return await super._perform(req); - } - isCommunityResource() { - return this.apiKey === defaultApiKey; - } - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("alchemy"); - return true; - }; - } - return request; - } - } - - /** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ - /** - * About Cloudflare... - */ - class CloudflareProvider extends JsonRpcProvider { - constructor(_network) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - assertArgument(network.name === "mainnet", "unsupported network", "network", _network); - super("https://cloudflare-eth.com/", network, { staticNetwork: network }); - } - } - - function getGlobal() { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); - } - const _WebSocket = getGlobal().WebSocket; - - /** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider - */ - class SocketSubscriber { - #provider; - #filter; - get filter() { - return JSON.parse(this.#filter); - } - #filterId; - #paused; - #emitPromise; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - start() { - this.#filterId = this.#provider - .send("xcb_subscribe", this.filter) - .then((filterId) => { - this.#provider._register(filterId, this); - return filterId; - }); - } - stop() { - this.#filterId.then((filterId) => { - this.#provider.send("xcb_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused) { - assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - resume() { - this.#paused = null; - } - _handleMessage(message) { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } - else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - async _emit(provider, message) { - throw new Error("sub-classes must implemente this; _emit"); - } - } - class SocketBlockSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newHeads"]); - } - async _emit(provider, message) { - provider.emit("block", parseInt(message.number)); - } - } - class SocketPendingSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newPendingTransactions"]); - } - async _emit(provider, message) { - provider.emit("pending", message); - } - } - class SocketEventSubscriber extends SocketSubscriber { - #logFilter; - get logFilter() { - return JSON.parse(this.#logFilter); - } - constructor(provider, filter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - async _emit(provider, message) { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } - } - /** - * SocketProvider... - * - */ - class SocketProvider extends JsonRpcApiProvider { - #callbacks; - // Maps each filterId to its subscriber - #subs; - // If any events come in before a subscriber has finished - // registering, queue them - #pending; - constructor(network) { - super(network, { batchMaxCount: 1 }); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - _getSubscriber(sub) { - switch (sub.type) { - case "close": - return new UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - _register(filterId, subscriber) { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - async _send(payload) { - // WebSocket provider doesn't accept batches - assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - // @TODO: stringify payloads here and store to prevent mutations - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - // Write the request to the socket - await this._write(JSON.stringify(payload)); - return [await promise]; - } - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - // Sub-classes must call this for each message - async _processMessage(message) { - const result = (JSON.parse(message)); - if ("id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result, - })); - return; - } - this.#callbacks.delete(result.id); - callback.resolve(result); - } - else if (result.method === "xcb_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } - else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - } - async _write(message) { - throw new Error("sub-classes must override this"); - } - } - - class WebSocketProvider extends SocketProvider { - #connect; - #websocket; - get websocket() { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } - constructor(url, network) { - super(network); - if (typeof url === "string") { - this.#connect = () => { - return new _WebSocket(url); - }; - this.#websocket = this.#connect(); - } - else if (typeof url === "function") { - this.#connect = url; - this.#websocket = url(); - } - else { - this.#connect = null; - this.#websocket = url; - } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } - catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - this.websocket.onmessage = (message) => { - this._processMessage(message.data); - }; - /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; - */ - } - async _write(message) { - this.websocket.send(message); - } - async destroy() { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } - } - - /** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ - const defaultProjectId = "84842078b09946638c03157f83405213"; - function getHost$2(name) { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ - class InfuraWebSocketProvider extends WebSocketProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network, projectId) { - const provider = new InfuraProvider(network, projectId); - const req = provider._getConnection(); - assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, network); - defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret, - }); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } - } - /** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ - class InfuraProvider extends JsonRpcProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network, projectId, projectSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - defineProperties(this, { projectId, projectSecret }); - } - _getProvider(networkId) { - try { - return new InfuraProvider(networkId, this.projectId, this.projectSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network, projectId) { - return new InfuraWebSocketProvider(network, projectId); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network, projectId, projectSecret) { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("InfuraProvider"); - return true; - }; - } - return request; - } - } - - /** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ - const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; - function getHost$1(name) { - switch (name) { - case "mainnet": - return "corebc.quiknode.pro"; - case "arbitrum": - return "corebc.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "corebc.arbitrum-goerli.quiknode.pro"; - case "matic": - return "corebc.matic.quiknode.pro"; - case "matic-mumbai": - return "corebc.matic-testnet.quiknode.pro"; - case "optimism": - return "corebc.optimism.quiknode.pro"; - case "optimism-goerli": - return "corebc.optimism-goerli.quiknode.pro"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ - class QuickNodeProvider extends JsonRpcProvider { - /** - * The API token. - */ - token; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network, token) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (token == null) { - token = defaultToken; - } - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - defineProperties(this, { token }); - } - _getProvider(networkId) { - try { - return new QuickNodeProvider(networkId, this.token); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.token === defaultToken; - } - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network, token) { - if (token == null) { - token = defaultToken; - } - const request = new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - return request; - } - } - - /** - * Explain all the nitty-gritty about the **FallbackProvider**. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ - const BN_1 = BigInt("1"); - const BN_2 = BigInt("2"); - function shuffle(array) { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } - } - function stall$2(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); - } - function getTime() { - return new Date().getTime(); - } - function stringify(value) { - return JSON.stringify(value, (key, value) => { - if (typeof value === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); - } - const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; - const defaultState = { - blockNumber: -2, - requests: 0, - lateResponses: 0, - errorResponses: 0, - outOfSync: -1, - unsupportedEvents: 0, - rollingDuration: 0, - score: 0, - _network: null, - _updateNumber: null, - _totalTime: 0, - }; - async function waitForSync(config, blockNumber) { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - } - } - function _normalize(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[" + value.map(_normalize).join(",") + "]"; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return _normalize(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{" + - keys - .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`) - .join(",") + - "}"); - } - } - console.log("Could not serialize", value); - throw new Error("Hmm..."); - } - function normalizeResult(value) { - if ("error" in value) { - const error = value.error; - return { tag: _normalize(error), value: error }; - } - const result = value.result; - return { tag: _normalize(result), value: result }; - } - // This strategy picks the highest weight result, as long as the weight is - // equal to or greater than quorum - function checkQuorum(quorum, results) { - const tally = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - let best = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - if (best) { - return best.value; - } - return undefined; - } - function getMedian(quorum, results) { - let resultWeight = 0; - const errorMap = new Map(); - let bestError = null; - const values = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } - else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - // We do not have quorum for a result - return undefined; - } - // Get the sorted values - values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0)); - const mid = Math.floor(values.length / 2); - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; - } - function getAnyResult(quorum, results) { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - // Nope! - return undefined; - } - function getFuzzyMode(quorum, results) { - if (quorum === 1) { - return getNumber(getMedian(quorum, results), "%internal"); - } - const tally = new Map(); - const add = (result, weight) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - for (const { weight, value } of results) { - const r = getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - let bestWeight = 0; - let bestResult = undefined; - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && - (weight > bestWeight || - (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - return bestResult; - } - /** - * A Fallback Provider. - * - */ - class FallbackProvider extends AbstractProvider { - quorum; - eventQuorum; - eventWorkers; - #configs; - #height; - #initialSyncPromise; - constructor(providers, network) { - super(network); - this.#configs = providers.map((p) => { - if (p instanceof AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } - else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - this.#height = -2; - this.#initialSyncPromise = null; - this.quorum = 2; //Math.ceil(providers.length / 2); - this.eventQuorum = 1; - this.eventWorkers = 1; - assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), "quorum exceed provider wieght", "quorum", this.quorum); - } - get providerConfigs() { - return this.#configs.map((c) => { - const result = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - async _detectNetwork() { - return Network.from(getBigInt(await this._perform({ method: "networkId" }))); - } - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - async _translatePerform(provider, req) { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); - case "networkId": - return (await provider.getNetwork()).networkId; - case "estimateEnergy": - return await provider.estimateEnergy(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = "blockHash" in req ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getEnergyPrice": - return (await provider.getFeeData()).energyPrice; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running) { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - const configs = Array.from(running).map((r) => r.config); - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => b.priority - a.priority); - for (const config of allConfigs) { - if (configs.indexOf(config) === -1) { - return config; - } - } - return null; - } - // Adds a new runner (if available) to running. - #addRunner(running, req) { - const config = this.#getNextConfig(running); - // No runners available - if (config == null) { - return null; - } - // Create a new runner - const runner = { - config, - result: null, - didBump: false, - perform: null, - staller: null, - }; - const now = getTime(); - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } - catch (error) { - config.errorResponses++; - runner.result = { error }; - } - const dt = getTime() - now; - config._totalTime += dt; - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - runner.perform = null; - })(); - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall$2(config.stallTimeout); - runner.staller = null; - })(); - running.add(runner); - return runner; - } - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync() { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises = []; - this.#configs.forEach((config) => { - promises.push(waitForSync(config, 0)); - promises.push((async () => { - config._network = await config.provider.getNetwork(); - })()); - }); - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - // Check all the networks match - let networkId = null; - for (const config of this.#configs) { - const network = config._network; - if (networkId == null) { - networkId = network.networkId; - } - else if (network.networkId !== networkId) { - assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider", - }); - } - } - })(); - } - await initialSync; - } - async #checkQuorum(running, req) { - // Get all the result objects - const results = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) { - return undefined; - } - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({ - value: c.blockNumber, - tag: getNumber(c.blockNumber).toString(), - weight: c.weight, - }))))); - } - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - case "getEnergyPrice": - case "estimateEnergy": - return getMedian(this.quorum, results); - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - case "call": - case "networkId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify(req.method)})`, - }); - } - async #waitForQuorum(running, req) { - if (running.size === 0) { - throw new Error("no runners?!"); - } - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting = []; - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - // All providers have returned, and we have no result - assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { - request: req, - results: Array.from(running).map((r) => stringify(r.result)), - }, - }); - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - async _perform(req) { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => { - try { - const result = await provider._perform(req); - return Object.assign(normalizeResult({ result }), { weight }); - } - catch (error) { - return Object.assign(normalizeResult({ error }), { weight }); - } - })); - const result = getAnyResult(this.quorum, results); - assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) }, - }); - if (result instanceof Error) { - throw result; - } - return result; - } - await this.#initialSync(); - // Bootstrap enough runners to meet quorum - const running = new Set(); - for (let i = 0; i < this.quorum; i++) { - this.#addRunner(running, req); - } - const result = await this.#waitForQuorum(running, req); - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - return result; - } - async destroy() { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } - } - - function isWebSocketLike(value) { - return (value && - typeof value.send === "function" && - typeof value.close === "function"); - } - function getDefaultProvider(network, options) { - if (options == null) { - options = {}; - } - if (typeof network === "string" && network.match(/^https?:/)) { - return new JsonRpcProvider(network); - } - if ((typeof network === "string" && network.match(/^wss?:/)) || - isWebSocketLike(network)) { - return new WebSocketProvider(network); - } - const providers = []; - if (options.alchemy !== "-") { - try { - providers.push(new AlchemyProvider(network, options.alchemy)); - } - catch (error) { - console.log(error); - } - } - if (options.ankr !== "-" && options.ankr != null) { - try { - providers.push(new AnkrProvider(network, options.ankr)); - } - catch (error) { - console.log(error); - } - } - if (options.cloudflare !== "-") { - try { - providers.push(new CloudflareProvider(network)); - } - catch (error) { - console.log(error); - } - } - if (options.infura !== "-") { - try { - let projectId = options.infura; - let projectSecret = undefined; - if (typeof projectId === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new InfuraProvider(network, projectId, projectSecret)); - } - catch (error) { - console.log(error); - } - } - /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } - */ - if (options.quicknode !== "-") { - try { - let token = options.quicknode; - providers.push(new QuickNodeProvider(network, token)); - } - catch (error) { - console.log(error); - } - } - assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider", - }); - if (providers.length === 1) { - return providers[0]; - } - return new FallbackProvider(providers); - } - - class NonceManager extends AbstractSigner { - signer; - #noncePromise; - #delta; - constructor(signer) { - super(signer.provider); - defineProperties(this, { signer }); - this.#noncePromise = null; - this.#delta = 0; - } - async getAddress() { - return this.signer.getAddress(); - } - connect(provider) { - return new NonceManager(this.signer.connect(provider)); - } - async getNonce(blockTag) { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - return super.getNonce(blockTag); - } - increment() { - this.#delta++; - } - reset() { - this.#delta = 0; - this.#noncePromise = null; - } - async sendTransaction(tx) { - const noncePromise = this.getNonce("pending"); - this.increment(); - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - signTransaction(tx) { - return this.signer.signTransaction(tx); - } - signMessage(message) { - return this.signer.signMessage(message); - } - signTypedData(domain, types, value) { - return this.signer.signTypedData(domain, types, value); - } - } - - class BrowserProvider extends JsonRpcApiPollingProvider { - #request; - constructor(core, network) { - super(network, { batchMaxCount: 1 }); - this.#request = async (method, params) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await core.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } - catch (e) { - const error = new Error(e.message); - error.code = e.code; - error.data = e.data; - error.payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - async send(method, params) { - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } - catch (e) { - return [ - { - id: payload.id, - error: { code: e.code, data: e.data, message: e.message }, - }, - ]; - } - } - getRpcError(payload, error) { - error = JSON.parse(JSON.stringify(error)); - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into - switch (error.error.code || -1) { - case 4001: - error.error.message = `corebc-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `corebc-unsupported: ${error.error.message}`; - break; - } - return super.getRpcError(payload, error); - } - async hasSigner(address) { - if (address == null) { - address = 0; - } - const accounts = await this.send("xcb_accounts", []); - if (typeof address === "number") { - return accounts.length > address; - } - address = address.toLowerCase(); - return (accounts.filter((a) => a.toLowerCase() === address).length !== 0); - } - async getSigner(address) { - if (address == null) { - address = 0; - } - if (!(await this.hasSigner(address))) { - try { - //const resp = - await this.#request("xcb_requestAccounts", []); - //console.log("RESP", resp); - } - catch (error) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - return await super.getSigner(address); - } - } - - /** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ - const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; - function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - assertArgument(false, "unsupported network", "network", name); - } - /** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ - class PocketProvider extends JsonRpcProvider { - /** - * The Application ID for the Pocket connection. - */ - applicationId; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - applicationSecret; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, applicationId, applicationSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - const options = { staticNetwork: network }; - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - defineProperties(this, { - applicationId, - applicationSecret, - }); - } - _getProvider(networkId) { - try { - return new PocketProvider(networkId, this.applicationId, this.applicationSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network, applicationId, applicationSecret) { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); - request.allowGzip = true; - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("PocketProvider"); - return true; - }; - } - return request; - } - isCommunityResource() { - return this.applicationId === defaultApplicationId; - } - } - - const IpcSocketProvider = undefined; - - /** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ - class BaseWallet extends AbstractSigner { - /** - * The wallet address. - */ - address; - prefix; - #signingKey; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor({ signingKey, prefix, provider, }) { - super(provider); - this.prefix = prefix; - assertArgument(signingKey && typeof signingKey.sign === "function", "invalid signingKey key", "signingKey", "[ REDACTED ]"); - this.#signingKey = signingKey; - const address = computeAddress(this.#signingKey, prefix); - defineProperties(this, { address }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { - return this.#signingKey; - } - /** - * The private key for this wallet. - */ - get privateKey() { - return this.signingKey.privateKey; - } - async getAddress() { - return this.address; - } - connect(provider) { - return new BaseWallet({ - signingKey: this.#signingKey, - prefix: this.prefix, - provider, - }); - } - async signTransaction(tx) { - // Replace any Addressable or ENS name with an address - const { to, from } = await resolveProperties({ - to: tx.to || undefined, - from: tx.from || undefined, - }); - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - assertArgument(getAddress(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - // Build the transaction - const btx = Transaction.from(tx); - const unSignedSerialized = btx.unsignedSerialized; - const unsignedHash = sha256(unSignedSerialized); - // sha256(btx.unsignedSerialized) - btx.signature = this.signingKey.sign(unsignedHash); - return btx.serialized; - } - async signMessage(message) { - return this.signMessageSync(message); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message) { - return this.signingKey.sign(hashMessage(message)); - } - async signTypedData(domain, types, value) { - // Populate any ENS names - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name }, - }); - const address = getAddress(name); - assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name, - }); - return address; - }); - return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)); - } - } - - const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; - const Word = /^[a-z]*$/i; - function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); - } - /** - * @_ignore - */ - function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); - } - /** - * @_ignore - */ - function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); - } - - /** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ - class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } - static check(wordlist) { - const words = []; - for (let i = 0; i < 2048; i++) { - const word = wordlist.getWord(i); - /* istanbul ignore if */ - if (i !== wordlist.getWordIndex(word)) { - return "0x"; - } - words.push(word); - } - return id(words.join("\n") + "\n"); - } - } - - // Use the encode-latin.js script to create the necessary - // data files to be consumed by this class - /** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ - class WordlistOwl extends Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - get _data() { - return this.#data; - } - _decodeWords() { - return decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n", true); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } - } - - const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$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ySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; - const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; - let wordlist = null; - /** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ - class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { - super("en", words, checksum); - } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } - } - - var utf8$1 = {}; - - /*! https://mths.be/utf8js v3.0.0 by @mathias */ - - var hasRequiredUtf8; - - function requireUtf8 () { - if (hasRequiredUtf8) return utf8$1; - hasRequiredUtf8 = 1; - (function (exports) { - (function(root) { - - var stringFromCharCode = String.fromCharCode; - - // Taken from https://mths.be/punycode - function ucs2decode(string) { - var output = []; - var counter = 0; - var length = string.length; - var value; - var extra; - while (counter < length) { - value = string.charCodeAt(counter++); - if (value >= 0xD800 && value <= 0xDBFF && counter < length) { - // high surrogate, and there is a next character - extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { // low surrogate - output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); - } else { - // unmatched surrogate; only append this code unit, in case the next - // code unit is the high surrogate of a surrogate pair - output.push(value); - counter--; - } - } else { - output.push(value); - } - } - return output; - } - - // Taken from https://mths.be/punycode - function ucs2encode(array) { - var length = array.length; - var index = -1; - var value; - var output = ''; - while (++index < length) { - value = array[index]; - if (value > 0xFFFF) { - value -= 0x10000; - output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); - value = 0xDC00 | value & 0x3FF; - } - output += stringFromCharCode(value); - } - return output; - } - - function checkScalarValue(codePoint) { - if (codePoint >= 0xD800 && codePoint <= 0xDFFF) { - throw Error( - 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() + - ' is not a scalar value' - ); - } - } - /*--------------------------------------------------------------------------*/ - - function createByte(codePoint, shift) { - return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80); - } - - function encodeCodePoint(codePoint) { - if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence - return stringFromCharCode(codePoint); - } - var symbol = ''; - if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence - symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0); - } - else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence - checkScalarValue(codePoint); - symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0); - symbol += createByte(codePoint, 6); - } - else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence - symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0); - symbol += createByte(codePoint, 12); - symbol += createByte(codePoint, 6); - } - symbol += stringFromCharCode((codePoint & 0x3F) | 0x80); - return symbol; - } - - function utf8encode(string) { - var codePoints = ucs2decode(string); - var length = codePoints.length; - var index = -1; - var codePoint; - var byteString = ''; - while (++index < length) { - codePoint = codePoints[index]; - byteString += encodeCodePoint(codePoint); - } - return byteString; - } - - /*--------------------------------------------------------------------------*/ - - function readContinuationByte() { - if (byteIndex >= byteCount) { - throw Error('Invalid byte index'); - } - - var continuationByte = byteArray[byteIndex] & 0xFF; - byteIndex++; - - if ((continuationByte & 0xC0) == 0x80) { - return continuationByte & 0x3F; - } - - // If we end up here, it’s not a continuation byte - throw Error('Invalid continuation byte'); - } - - function decodeSymbol() { - var byte1; - var byte2; - var byte3; - var byte4; - var codePoint; - - if (byteIndex > byteCount) { - throw Error('Invalid byte index'); - } - - if (byteIndex == byteCount) { - return false; - } - - // Read first byte - byte1 = byteArray[byteIndex] & 0xFF; - byteIndex++; - - // 1-byte sequence (no continuation bytes) - if ((byte1 & 0x80) == 0) { - return byte1; - } - - // 2-byte sequence - if ((byte1 & 0xE0) == 0xC0) { - byte2 = readContinuationByte(); - codePoint = ((byte1 & 0x1F) << 6) | byte2; - if (codePoint >= 0x80) { - return codePoint; - } else { - throw Error('Invalid continuation byte'); - } - } - - // 3-byte sequence (may include unpaired surrogates) - if ((byte1 & 0xF0) == 0xE0) { - byte2 = readContinuationByte(); - byte3 = readContinuationByte(); - codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3; - if (codePoint >= 0x0800) { - checkScalarValue(codePoint); - return codePoint; - } else { - throw Error('Invalid continuation byte'); - } - } - - // 4-byte sequence - if ((byte1 & 0xF8) == 0xF0) { - byte2 = readContinuationByte(); - byte3 = readContinuationByte(); - byte4 = readContinuationByte(); - codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) | - (byte3 << 0x06) | byte4; - if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { - return codePoint; - } - } - - throw Error('Invalid UTF-8 detected'); - } - - var byteArray; - var byteCount; - var byteIndex; - function utf8decode(byteString) { - byteArray = ucs2decode(byteString); - byteCount = byteArray.length; - byteIndex = 0; - var codePoints = []; - var tmp; - while ((tmp = decodeSymbol()) !== false) { - codePoints.push(tmp); - } - return ucs2encode(codePoints); - } - - /*--------------------------------------------------------------------------*/ - - root.version = '3.0.0'; - root.encode = utf8encode; - root.decode = utf8decode; - - }(exports)); - } (utf8$1)); - return utf8$1; - } - - var utf8Exports = requireUtf8(); - var utf8 = /*@__PURE__*/getDefaultExportFromCjs(utf8Exports); - - function mnemonicToSeed(mnemonic, password) { - if (!password) { - password = ""; - } - const t = generateSeed(mnemonic, password); - return t.goldilock; - } - const generateSeed = (mnemonic, password) => { - const goldilockSaltPrefix = "mnemonic"; - const aesSaltPrefix = "mnemonicfortheAESkey"; - const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); - const aesSalt = utf8.encode(aesSaltPrefix + password); - const goldilockKey = pbkdf2Sync(bufferExports.Buffer.from(mnemonic), bufferExports.Buffer.from(goldilockSalt), 2048, 64, "sha512"); - const aesKeySeed = pbkdf2Sync(bufferExports.Buffer.from(mnemonic), bufferExports.Buffer.from(aesSalt), 2048, 64, "sha512"); - return { - aes: bufferExports.Buffer.from(aesKeySeed).toString("hex"), - goldilock: bufferExports.Buffer.from(goldilockKey).toString("hex"), - }; - }; - - // Returns a byte with the MSB bits set - function getUpperMask(bits) { - return (((1 << bits) - 1) << (8 - bits)) & 0xff; - } - // Returns a byte with the LSB bits set - function getLowerMask(bits) { - return ((1 << bits) - 1) & 0xff; - } - function mnemonicToEntropy(mnemonic, wordlist) { - assertNormalize("NFKD"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const words = wordlist.split(mnemonic); - assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8)); - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= 1 << (7 - (offset % 8)); - } - offset++; - } - } - const entropyBits = (32 * words.length) / 3; - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return hexlify(entropy.slice(0, entropyBits / 8)); - } - function entropyToMnemonic(entropy, wordlist) { - assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - remainingBits -= 8; - // This byte will complete an 11-bit index - } - else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) & - getUpperMask(checksumBits); - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= checksum >> (8 - checksumBits); - return wordlist.join(indices.map((index) => wordlist.getWord(index))); - } - const _guard$1 = {}; - /** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ - class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - phrase; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - password; - /** - * The wordlist for this mnemonic. - */ - wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - entropy; - /** - * @private - */ - constructor(guard, entropy, phrase, password, wordlist) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - assertPrivate(guard, _guard$1, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - return mnemonicToSeed(this.phrase, this.password); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase({ phrase, password, wordlist, }) { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(getBytes(entropy), wordlist); - return new Mnemonic(_guard$1, entropy, phrase, password, wordlist); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard$1, hexlify(entropy), phrase, password, wordlist); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist) { - return mnemonicToEntropy(phrase, wordlist); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist) { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } - catch (error) { } - return false; - } - } - - var aesJs = {exports: {}}; - - /*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ - - var hasRequiredAesJs; - - function requireAesJs () { - if (hasRequiredAesJs) return aesJs.exports; - hasRequiredAesJs = 1; - (function (module, exports) { - (function(root) { - - function checkInt(value) { - return (parseInt(value) === value); - } - - function checkInts(arrayish) { - if (!checkInt(arrayish.length)) { return false; } - - for (var i = 0; i < arrayish.length; i++) { - if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) { - return false; - } - } - - return true; - } - - function coerceArray(arg, copy) { - - // ArrayBuffer view - if (arg.buffer && arg.name === 'Uint8Array') { - - if (copy) { - if (arg.slice) { - arg = arg.slice(); - } else { - arg = Array.prototype.slice.call(arg); - } - } - - return arg; - } - - // It's an array; check it is a valid representation of a byte - if (Array.isArray(arg)) { - if (!checkInts(arg)) { - throw new Error('Array contains invalid value: ' + arg); - } - - return new Uint8Array(arg); - } - - // Something else, but behaves like an array (maybe a Buffer? Arguments?) - if (checkInt(arg.length) && checkInts(arg)) { - return new Uint8Array(arg); - } - - throw new Error('unsupported array-like object'); - } - - function createArray(length) { - return new Uint8Array(length); - } - - function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) { - if (sourceStart != null || sourceEnd != null) { - if (sourceArray.slice) { - sourceArray = sourceArray.slice(sourceStart, sourceEnd); - } else { - sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd); - } - } - targetArray.set(sourceArray, targetStart); - } - - - - var convertUtf8 = (function() { - function toBytes(text) { - var result = [], i = 0; - text = encodeURI(text); - while (i < text.length) { - var c = text.charCodeAt(i++); - - // if it is a % sign, encode the following 2 bytes as a hex value - if (c === 37) { - result.push(parseInt(text.substr(i, 2), 16)); - i += 2; - - // otherwise, just the actual byte - } else { - result.push(c); - } - } - - return coerceArray(result); - } - - function fromBytes(bytes) { - var result = [], i = 0; - - while (i < bytes.length) { - var c = bytes[i]; - - if (c < 128) { - result.push(String.fromCharCode(c)); - i++; - } else if (c > 191 && c < 224) { - result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f))); - i += 2; - } else { - result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f))); - i += 3; - } - } - - return result.join(''); - } - - return { - toBytes: toBytes, - fromBytes: fromBytes, - } - })(); - - var convertHex = (function() { - function toBytes(text) { - var result = []; - for (var i = 0; i < text.length; i += 2) { - result.push(parseInt(text.substr(i, 2), 16)); - } - - return result; - } - - // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html - var Hex = '0123456789abcdef'; - - function fromBytes(bytes) { - var result = []; - for (var i = 0; i < bytes.length; i++) { - var v = bytes[i]; - result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]); - } - return result.join(''); - } - - return { - toBytes: toBytes, - fromBytes: fromBytes, - } - })(); - - - // Number of rounds by keysize - var numberOfRounds = {16: 10, 24: 12, 32: 14}; - - // Round constant words - var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; - - // S-box and Inverse S-box (S is for Substitution) - var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 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 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; - - // Transformations for encryption - var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; - var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; - var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; - var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; - - // Transformations for decryption - var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; - var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; - var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; - var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; - - // Transformations for decryption key expansion - var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; - var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; - var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; - var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; - - function convertToInt32(bytes) { - var result = []; - for (var i = 0; i < bytes.length; i += 4) { - result.push( - (bytes[i ] << 24) | - (bytes[i + 1] << 16) | - (bytes[i + 2] << 8) | - bytes[i + 3] - ); - } - return result; - } - - var AES = function(key) { - if (!(this instanceof AES)) { - throw Error('AES must be instanitated with `new`'); - } - - Object.defineProperty(this, 'key', { - value: coerceArray(key, true) - }); - - this._prepare(); - }; - - - AES.prototype._prepare = function() { - - var rounds = numberOfRounds[this.key.length]; - if (rounds == null) { - throw new Error('invalid key size (must be 16, 24 or 32 bytes)'); - } - - // encryption round keys - this._Ke = []; - - // decryption round keys - this._Kd = []; - - for (var i = 0; i <= rounds; i++) { - this._Ke.push([0, 0, 0, 0]); - this._Kd.push([0, 0, 0, 0]); - } - - var roundKeyCount = (rounds + 1) * 4; - var KC = this.key.length / 4; - - // convert the key into ints - var tk = convertToInt32(this.key); - - // copy values into round key arrays - var index; - for (var i = 0; i < KC; i++) { - index = i >> 2; - this._Ke[index][i % 4] = tk[i]; - this._Kd[rounds - index][i % 4] = tk[i]; - } - - // key expansion (fips-197 section 5.2) - var rconpointer = 0; - var t = KC, tt; - while (t < roundKeyCount) { - tt = tk[KC - 1]; - tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ - (S[(tt >> 8) & 0xFF] << 16) ^ - (S[ tt & 0xFF] << 8) ^ - S[(tt >> 24) & 0xFF] ^ - (rcon[rconpointer] << 24)); - rconpointer += 1; - - // key expansion (for non-256 bit) - if (KC != 8) { - for (var i = 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - - // key expansion for 256-bit keys is "slightly different" (fips-197) - } else { - for (var i = 1; i < (KC / 2); i++) { - tk[i] ^= tk[i - 1]; - } - tt = tk[(KC / 2) - 1]; - - tk[KC / 2] ^= (S[ tt & 0xFF] ^ - (S[(tt >> 8) & 0xFF] << 8) ^ - (S[(tt >> 16) & 0xFF] << 16) ^ - (S[(tt >> 24) & 0xFF] << 24)); - - for (var i = (KC / 2) + 1; i < KC; i++) { - tk[i] ^= tk[i - 1]; - } - } - - // copy values into round key arrays - var i = 0, r, c; - while (i < KC && t < roundKeyCount) { - r = t >> 2; - c = t % 4; - this._Ke[r][c] = tk[i]; - this._Kd[rounds - r][c] = tk[i++]; - t++; - } - } - - // inverse-cipher-ify the decryption round key (fips-197 section 5.3) - for (var r = 1; r < rounds; r++) { - for (var c = 0; c < 4; c++) { - tt = this._Kd[r][c]; - this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^ - U2[(tt >> 16) & 0xFF] ^ - U3[(tt >> 8) & 0xFF] ^ - U4[ tt & 0xFF]); - } - } - }; - - AES.prototype.encrypt = function(plaintext) { - if (plaintext.length != 16) { - throw new Error('invalid plaintext size (must be 16 bytes)'); - } - - var rounds = this._Ke.length - 1; - var a = [0, 0, 0, 0]; - - // convert plaintext to (ints ^ key) - var t = convertToInt32(plaintext); - for (var i = 0; i < 4; i++) { - t[i] ^= this._Ke[0][i]; - } - - // apply round transforms - for (var r = 1; r < rounds; r++) { - for (var i = 0; i < 4; i++) { - a[i] = (T1[(t[ i ] >> 24) & 0xff] ^ - T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ - T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T4[ t[(i + 3) % 4] & 0xff] ^ - this._Ke[r][i]); - } - t = a.slice(); - } - - // the last round is special - var result = createArray(16), tt; - for (var i = 0; i < 4; i++) { - tt = this._Ke[rounds][i]; - result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff; - } - - return result; - }; - - AES.prototype.decrypt = function(ciphertext) { - if (ciphertext.length != 16) { - throw new Error('invalid ciphertext size (must be 16 bytes)'); - } - - var rounds = this._Kd.length - 1; - var a = [0, 0, 0, 0]; - - // convert plaintext to (ints ^ key) - var t = convertToInt32(ciphertext); - for (var i = 0; i < 4; i++) { - t[i] ^= this._Kd[0][i]; - } - - // apply round transforms - for (var r = 1; r < rounds; r++) { - for (var i = 0; i < 4; i++) { - a[i] = (T5[(t[ i ] >> 24) & 0xff] ^ - T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ - T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ - T8[ t[(i + 1) % 4] & 0xff] ^ - this._Kd[r][i]); - } - t = a.slice(); - } - - // the last round is special - var result = createArray(16), tt; - for (var i = 0; i < 4; i++) { - tt = this._Kd[rounds][i]; - result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; - result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; - result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; - result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff; - } - - return result; - }; - - - /** - * Mode Of Operation - Electonic Codebook (ECB) - */ - var ModeOfOperationECB = function(key) { - if (!(this instanceof ModeOfOperationECB)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Electronic Code Block"; - this.name = "ecb"; - - this._aes = new AES(key); - }; - - ModeOfOperationECB.prototype.encrypt = function(plaintext) { - plaintext = coerceArray(plaintext); - - if ((plaintext.length % 16) !== 0) { - throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); - } - - var ciphertext = createArray(plaintext.length); - var block = createArray(16); - - for (var i = 0; i < plaintext.length; i += 16) { - copyArray(plaintext, block, 0, i, i + 16); - block = this._aes.encrypt(block); - copyArray(block, ciphertext, i); - } - - return ciphertext; - }; - - ModeOfOperationECB.prototype.decrypt = function(ciphertext) { - ciphertext = coerceArray(ciphertext); - - if ((ciphertext.length % 16) !== 0) { - throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); - } - - var plaintext = createArray(ciphertext.length); - var block = createArray(16); - - for (var i = 0; i < ciphertext.length; i += 16) { - copyArray(ciphertext, block, 0, i, i + 16); - block = this._aes.decrypt(block); - copyArray(block, plaintext, i); - } - - return plaintext; - }; - - - /** - * Mode Of Operation - Cipher Block Chaining (CBC) - */ - var ModeOfOperationCBC = function(key, iv) { - if (!(this instanceof ModeOfOperationCBC)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Cipher Block Chaining"; - this.name = "cbc"; - - if (!iv) { - iv = createArray(16); - - } else if (iv.length != 16) { - throw new Error('invalid initialation vector size (must be 16 bytes)'); - } - - this._lastCipherblock = coerceArray(iv, true); - - this._aes = new AES(key); - }; - - ModeOfOperationCBC.prototype.encrypt = function(plaintext) { - plaintext = coerceArray(plaintext); - - if ((plaintext.length % 16) !== 0) { - throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); - } - - var ciphertext = createArray(plaintext.length); - var block = createArray(16); - - for (var i = 0; i < plaintext.length; i += 16) { - copyArray(plaintext, block, 0, i, i + 16); - - for (var j = 0; j < 16; j++) { - block[j] ^= this._lastCipherblock[j]; - } - - this._lastCipherblock = this._aes.encrypt(block); - copyArray(this._lastCipherblock, ciphertext, i); - } - - return ciphertext; - }; - - ModeOfOperationCBC.prototype.decrypt = function(ciphertext) { - ciphertext = coerceArray(ciphertext); - - if ((ciphertext.length % 16) !== 0) { - throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); - } - - var plaintext = createArray(ciphertext.length); - var block = createArray(16); - - for (var i = 0; i < ciphertext.length; i += 16) { - copyArray(ciphertext, block, 0, i, i + 16); - block = this._aes.decrypt(block); - - for (var j = 0; j < 16; j++) { - plaintext[i + j] = block[j] ^ this._lastCipherblock[j]; - } - - copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16); - } - - return plaintext; - }; - - - /** - * Mode Of Operation - Cipher Feedback (CFB) - */ - var ModeOfOperationCFB = function(key, iv, segmentSize) { - if (!(this instanceof ModeOfOperationCFB)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Cipher Feedback"; - this.name = "cfb"; - - if (!iv) { - iv = createArray(16); - - } else if (iv.length != 16) { - throw new Error('invalid initialation vector size (must be 16 size)'); - } - - if (!segmentSize) { segmentSize = 1; } - - this.segmentSize = segmentSize; - - this._shiftRegister = coerceArray(iv, true); - - this._aes = new AES(key); - }; - - ModeOfOperationCFB.prototype.encrypt = function(plaintext) { - if ((plaintext.length % this.segmentSize) != 0) { - throw new Error('invalid plaintext size (must be segmentSize bytes)'); - } - - var encrypted = coerceArray(plaintext, true); - - var xorSegment; - for (var i = 0; i < encrypted.length; i += this.segmentSize) { - xorSegment = this._aes.encrypt(this._shiftRegister); - for (var j = 0; j < this.segmentSize; j++) { - encrypted[i + j] ^= xorSegment[j]; - } - - // Shift the register - copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); - copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); - } - - return encrypted; - }; - - ModeOfOperationCFB.prototype.decrypt = function(ciphertext) { - if ((ciphertext.length % this.segmentSize) != 0) { - throw new Error('invalid ciphertext size (must be segmentSize bytes)'); - } - - var plaintext = coerceArray(ciphertext, true); - - var xorSegment; - for (var i = 0; i < plaintext.length; i += this.segmentSize) { - xorSegment = this._aes.encrypt(this._shiftRegister); - - for (var j = 0; j < this.segmentSize; j++) { - plaintext[i + j] ^= xorSegment[j]; - } - - // Shift the register - copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); - copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); - } - - return plaintext; - }; - - /** - * Mode Of Operation - Output Feedback (OFB) - */ - var ModeOfOperationOFB = function(key, iv) { - if (!(this instanceof ModeOfOperationOFB)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Output Feedback"; - this.name = "ofb"; - - if (!iv) { - iv = createArray(16); - - } else if (iv.length != 16) { - throw new Error('invalid initialation vector size (must be 16 bytes)'); - } - - this._lastPrecipher = coerceArray(iv, true); - this._lastPrecipherIndex = 16; - - this._aes = new AES(key); - }; - - ModeOfOperationOFB.prototype.encrypt = function(plaintext) { - var encrypted = coerceArray(plaintext, true); - - for (var i = 0; i < encrypted.length; i++) { - if (this._lastPrecipherIndex === 16) { - this._lastPrecipher = this._aes.encrypt(this._lastPrecipher); - this._lastPrecipherIndex = 0; - } - encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++]; - } - - return encrypted; - }; - - // Decryption is symetric - ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt; - - - /** - * Counter object for CTR common mode of operation - */ - var Counter = function(initialValue) { - if (!(this instanceof Counter)) { - throw Error('Counter must be instanitated with `new`'); - } - - // We allow 0, but anything false-ish uses the default 1 - if (initialValue !== 0 && !initialValue) { initialValue = 1; } - - if (typeof(initialValue) === 'number') { - this._counter = createArray(16); - this.setValue(initialValue); - - } else { - this.setBytes(initialValue); - } - }; - - Counter.prototype.setValue = function(value) { - if (typeof(value) !== 'number' || parseInt(value) != value) { - throw new Error('invalid counter value (must be an integer)'); - } - - // We cannot safely handle numbers beyond the safe range for integers - if (value > Number.MAX_SAFE_INTEGER) { - throw new Error('integer value out of safe range'); - } - - for (var index = 15; index >= 0; --index) { - this._counter[index] = value % 256; - value = parseInt(value / 256); - } - }; - - Counter.prototype.setBytes = function(bytes) { - bytes = coerceArray(bytes, true); - - if (bytes.length != 16) { - throw new Error('invalid counter bytes size (must be 16 bytes)'); - } - - this._counter = bytes; - }; - - Counter.prototype.increment = function() { - for (var i = 15; i >= 0; i--) { - if (this._counter[i] === 255) { - this._counter[i] = 0; - } else { - this._counter[i]++; - break; - } - } - }; - - - /** - * Mode Of Operation - Counter (CTR) - */ - var ModeOfOperationCTR = function(key, counter) { - if (!(this instanceof ModeOfOperationCTR)) { - throw Error('AES must be instanitated with `new`'); - } - - this.description = "Counter"; - this.name = "ctr"; - - if (!(counter instanceof Counter)) { - counter = new Counter(counter); - } - - this._counter = counter; - - this._remainingCounter = null; - this._remainingCounterIndex = 16; - - this._aes = new AES(key); - }; - - ModeOfOperationCTR.prototype.encrypt = function(plaintext) { - var encrypted = coerceArray(plaintext, true); - - for (var i = 0; i < encrypted.length; i++) { - if (this._remainingCounterIndex === 16) { - this._remainingCounter = this._aes.encrypt(this._counter._counter); - this._remainingCounterIndex = 0; - this._counter.increment(); - } - encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++]; - } - - return encrypted; - }; - - // Decryption is symetric - ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt; - - - /////////////////////// - // Padding - - // See:https://tools.ietf.org/html/rfc2315 - function pkcs7pad(data) { - data = coerceArray(data, true); - var padder = 16 - (data.length % 16); - var result = createArray(data.length + padder); - copyArray(data, result); - for (var i = data.length; i < result.length; i++) { - result[i] = padder; - } - return result; - } - - function pkcs7strip(data) { - data = coerceArray(data, true); - if (data.length < 16) { throw new Error('PKCS#7 invalid length'); } - - var padder = data[data.length - 1]; - if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); } - - var length = data.length - padder; - for (var i = 0; i < padder; i++) { - if (data[length + i] !== padder) { - throw new Error('PKCS#7 invalid padding byte'); - } - } - - var result = createArray(length); - copyArray(data, result, 0, 0, length); - return result; - } - - /////////////////////// - // Exporting - - - // The block cipher - var aesjs = { - AES: AES, - Counter: Counter, - - ModeOfOperation: { - ecb: ModeOfOperationECB, - cbc: ModeOfOperationCBC, - cfb: ModeOfOperationCFB, - ofb: ModeOfOperationOFB, - ctr: ModeOfOperationCTR - }, - - utils: { - hex: convertHex, - utf8: convertUtf8 - }, - - padding: { - pkcs7: { - pad: pkcs7pad, - strip: pkcs7strip - } - }, - - _arrayTest: { - coerceArray: coerceArray, - createArray: createArray, - copyArray: copyArray, - } - }; - - - // node.js - { - module.exports = aesjs; - - // RequireJS/AMD - // http://www.requirejs.org/docs/api.html - // https://github.com/amdjs/amdjs-api/wiki/AMD - } - - - })(); - } (aesJs)); - return aesJs.exports; - } - - var aesJsExports = requireAesJs(); - var pkg = /*@__PURE__*/getDefaultExportFromCjs(aesJsExports); - - /** - * @_ignore - */ - function looseArrayify(hexString) { - if (typeof hexString === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return getBytesCopy(hexString); - } - function zpad(value, length) { - value = String(value); - while (value.length < length) { - value = "0" + value; - } - return value; - } - function getPassword(password) { - if (typeof password === "string") { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); - } - function spelunk(object, _path) { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - assertArgument(match != null, "invalid path", "path", _path); - const path = match[1]; - const type = match[3]; - const reqd = match[4] === "!"; - let cur = object; - for (const comp of path.toLowerCase().split(".")) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } - else if (typeof cur === "object") { - let found = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } - else { - cur = null; - } - if (cur == null) { - break; - } - } - assertArgument(!reqd || cur != null, "missing required value", "path", path); - if (type && cur != null) { - if (type === "int") { - if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } - else if (Number.isSafeInteger(cur)) { - return cur; - } - } - if (type === "number") { - if (typeof cur === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - if (type === "data") { - if (typeof cur === "string") { - return looseArrayify(cur); - } - } - if (type === "array" && Array.isArray(cur)) { - return cur; - } - if (type === typeof cur) { - return cur; - } - assertArgument(false, `wrong type found for ${type} `, "path", path); - } - return cur; - } - /* - export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; - } - - // "path/to/something:type!" - export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); - } - */ - // See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - /* - export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); - } - */ - - /** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Core along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ - // @ts-ignore - const { Counter, ModeOfOperation: { ctr: CTR }, } = pkg; - const defaultPath$1 = "m/44'/60'/0'/0/0"; - /** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ - function isKeystoreJson(json) { - try { - const data = JSON.parse(json); - const version = data.version != null ? parseInt(data.version) : 0; - if (version === 3) { - return true; - } - } - catch (error) { } - return false; - } - function decrypt(data, key, ciphertext) { - const cipher = spelunk(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, new Counter(iv)); - return hexlify(aesCtr.decrypt(ciphertext)); - } - assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt", - }); - } - function getAccount(data, _key) { - const key = getBytes(_key); - const ciphertext = spelunk(data, "crypto.ciphertext:data!"); - const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2); - const expectedMAC = spelunk(data, "crypto.mac:string!"); - let difference = 0; - const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC); - if (validMAC) { - const actual = getBytes("0x" + computedMAC); - const expected = getBytes("0x" + expectedMAC); - for (let i = 0; i < actual.length; i++) - difference |= actual[i] ^ expected[i]; - } - assertArgument(validMAC && difference === 0, "incorrect password", "password", "[REDACTED]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - const address = getAddress(data.address); - const prefix = extractPrefix(address); - if (computeAddress(privateKey, prefix) !== address) { - throw new Error("address mismatch"); - } - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); - } - const account = { address, privateKey }; - // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase - const version = spelunk(data, "x-corebc.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = spelunk(data, "x-corebc.mnemonicCiphertext:data!"); - const mnemonicIv = spelunk(data, "x-corebc.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); - account.mnemonic = { - path: spelunk(data, "x-corebc.path:string") || defaultPath$1, - locale: spelunk(data, "x-corebc.locale:string") || "en", - entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))), - }; - } - return account; - } - // Match Core Web3Dart's wallet KDF resource limits. - function validateScrypt(N, r, p) { - assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, "unsafe scrypt N", "kdf.N", N); - assertArgument(Number.isSafeInteger(r) && - Number.isSafeInteger(p) && - r > 0 && - p > 0 && - r * p <= 1048576 && - 128 * N * r <= 256 * 1024 * 1024, "unsafe scrypt work or memory requirement", "kdf", { N, r, p }); - } - function getDecryptKdfParams(data) { - const kdf = spelunk(data, "crypto.kdf:string"); - if (kdf && typeof kdf === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const N = spelunk(data, "crypto.kdfparams.n:int!"); - const r = spelunk(data, "crypto.kdfparams.r:int!"); - const p = spelunk(data, "crypto.kdfparams.p:int!"); - validateScrypt(N, r, p); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } - else if (kdf.toLowerCase() === "pbkdf2") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const prf = spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - assertArgument(prf === "hmac-sha256" || prf === "hmac-sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = spelunk(data, "crypto.kdfparams.c:int!"); - assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, "unsafe PBKDF2 iteration count", "kdf.c", count); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { - name: "pbkdf2", - salt, - count, - dkLen, - algorithm: algorithm, - }; - } - } - assertArgument(false, "unsupported key-derivation function", "kdf", kdf); - } - /** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ - function decryptKeystoreJsonSync(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); - } - function stall$1(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); - } - /** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ - async function decryptKeystoreJson(json, _password, progress) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall$1(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall$1(0); - } - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = await scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); - } - function getEncryptKdfParams(options) { - // Check/generate the salt - const salt = options.salt != null - ? getBytes(options.salt, "options.salt") - : randomBytes(32); - // Override the scrypt password-based key derivation function parameters - let N = 1 << 17, r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N != null) { - N = options.scrypt.N; - } - if (options.scrypt.r != null) { - r = options.scrypt.r; - } - if (options.scrypt.p != null) { - p = options.scrypt.p; - } - } - validateScrypt(N, r, p); - return { name: "scrypt", dkLen: 32, salt, N, r, p }; - } - function _encryptKeystore(key, kdf, account, options) { - const privateKey = getBytes(account.privateKey, "privateKey"); - // Override initialization vector - const iv = options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); - assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - // Override the uuid - const uuidRandom = options.uuid != null - ? getBytes(options.uuid, "options.uuid") - : randomBytes(16); - assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - // Encrypt the private key - const aesCtr = new CTR(derivedKey, new Counter(iv)); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - // Compute the message authentication code, used to check the password - const mac = sha256(concat([macPrefix, ciphertext])); - const data = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv).substring(2), - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r, - }, - mac: mac.substring(2), - }, - }; - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = options.client != null ? options.client : `corebc/${version}`; - const path = account.mnemonic.path || defaultPath$1; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key.slice(32, 64); - const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - const now = new Date(); - const timestamp = now.getUTCFullYear() + - "-" + - zpad(now.getUTCMonth() + 1, 2) + - "-" + - zpad(now.getUTCDate(), 2) + - "T" + - zpad(now.getUTCHours(), 2) + - "-" + - zpad(now.getUTCMinutes(), 2) + - "-" + - zpad(now.getUTCSeconds(), 2) + - ".0Z"; - const gethFilename = "UTC--" + timestamp + "--" + data.address; - data["x-corebc"] = { - client, - gethFilename, - path, - locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1", - }; - } - return JSON.stringify(data); - } - /** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ - function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key), kdf, account, options); - } - /** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ - async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(getBytes(key), kdf, account, options); - } - - /** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ - // import { arrayify, - // // hexDataSlice - // } from "../utils/data.js"; - // function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array { - // const p = getBytes(password); - // const s = getBytes(salt); - // return getBytes(pbkdf2(p, s, 2048, 57, "sha512")); - // } - /** - * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ - const defaultPath = "m"; - // "Bitcoin seed" - // const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); - const HardenedBit = 0x80000000; - // function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array { - // b = getBytes(concat([b.slice(0, 53), "0x00000000"])); - // b[0] &= 0xfc; - // const c = new Uint8Array(57); - // let hold = 0; - // for (let i = 0; i < 57; i++) { - // hold += a[i] + b[i]; - // c[i] = hold % 256; - // hold = Math.floor(hold / 256); - // } - // return c; - // }; - const _guard = {}; - function derivePath(node, path) { - const components = path.split("/"); - assertArgument(components.length > 0 && (components[0] === "m" || node.depth > 0), "invalid path", "path", path); - if (components[0] === "m") { - components.shift(); - } - let result = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(HardenedBit + index); - } - else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(index); - } - else { - assertArgument(false, "invalid path component", `path[${i}]`, component); - } - } - return result; - } - /** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ - class HDNodeWallet extends BaseWallet { - /** - * The compressed public key. - */ - publicKey; - prefix; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent fingerprint. - */ - parentFingerprint; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - mnemonic; - #seed; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) { - super({ - signingKey, - prefix, - provider, - }); - assertPrivate(guard, _guard, "HDNodeWallet"); - defineProperties(this, { publicKey: signingKey.publicKey }); - this.prefix = prefix; - this.#seed = seed; - const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, - fingerprint, - path, - index, - depth, - }); - defineProperties(this, { mnemonic }); - } - connect(provider) { - return new HDNodeWallet({ - guard: _guard, - signingKey: this.signingKey, - parentFingerprint: this.parentFingerprint, - path: this.path, - index: this.index, - depth: this.depth, - seed: this.#seed, - mnemonic: this.mnemonic, - provider, - prefix: this.prefix, - }); - } - #account() { - const account = { - address: this.address, - privateKey: this.privateKey, - }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy, - }; - } - return account; - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await encryptKeystoreJson(this.#account(), password, { - progressCallback, - }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return encryptKeystoreJsonSync(this.#account(), password); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { - return this.path != null; - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index)); - const newSigningKey = new SigningKey(newPrivateKey); - // Base path - let path = this.path; - if (path) { - path += "/" + (_index & ~HardenedBit); - if (_index & HardenedBit) { - path += "'"; - } - } - return new HDNodeWallet({ - guard: _guard, - signingKey: newSigningKey, - parentFingerprint: this.fingerprint, - path, - index: _index, - seed: this.#seed, - depth: this.depth + 1, - mnemonic: this.mnemonic, - provider: this.provider, - prefix: this.prefix, - }); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - static #fromSeed({ _seed, mnemonic, prefix, path, }) { - const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0); - const signingKey = new SigningKey(extendetPrivateKey); - // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length }) - return new HDNodeWallet({ - seed: _seed, - guard: _guard, - signingKey, - parentFingerprint: "0x00000000", - path: path || defaultPath, - index: 0, - depth: 0, - mnemonic, - provider: null, - prefix, - }); - } - /** - * Creates a new random HDNode. - */ - static createRandom(prefix, password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist); - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - /** - * Create am HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, prefix, path) { - if (!path) { - path = defaultPath; - } - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - static mnemonicToSeed(mnemonic, password) { - const seed = mnemonicToSeed(mnemonic, password); - return seed; - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase({ phrase, prefix, password, path, wordlist, }) { - if (!password) { - password = ""; - } - if (!path) { - path = defaultPath; - } - if (!wordlist) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist }); - const _seed = mnemonic.computeSeed(); - return HDNodeWallet.#fromSeed({ - _seed, - mnemonic, - prefix, - }).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed({ seed, prefix, path, }) { - return HDNodeWallet.#fromSeed({ - _seed: seed, - mnemonic: null, - path: path || defaultPath, - prefix, - }); - } - } - /* - export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } - } - */ - /** - * Returns the [[link-bip-32]] path for the acount at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ - function getAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${index}'/0/0`; - } - /** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ - function getIndexedAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${index}`; - } - - /** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ - // @ts-ignore - const { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg; - /** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ - function isCrowdsaleJson(json) { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } - catch (error) { } - return false; - } - /** - * Before Core launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive xcb - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ - function decryptCrowdsaleJson(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - // Core Address - const address = getAddress(spelunk(data, "ethaddr:string!")); - // Encrypted Seed - const encseed = looseArrayify(spelunk(data, "encseed:string!")); - assertArgument(encseed && encseed.length % 16 === 0, "invalid encseed", "json", json); - const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - return { address, privateKey: id(seedHex) }; - } - - function stall(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); - } - /** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ - class Wallet extends BaseWallet { - /** - * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected - * to %%provider%%. - */ - constructor({ key, prefix, provider, }) { - if (typeof key === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - let signingKey = typeof key === "string" ? new SigningKey(key) : key; - super({ - signingKey, - prefix, - provider, - }); - } - connect(provider) { - return new Wallet({ - key: this.signingKey, - prefix: this.prefix, - provider, - }); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - const account = { address: this.address, privateKey: this.privateKey }; - return await encryptKeystoreJson(account, password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - const account = { address: this.address, privateKey: this.privateKey }; - return encryptKeystoreJsonSync(account, password); - } - static #fromAccount(account) { - assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - const address = account.address; - const prefix = extractPrefix(address); - if ("mnemonic" in account && - account.mnemonic && - account.mnemonic.locale === "en") { - const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path); - if (wallet.address === account.address && - wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - const wallet = new Wallet({ - key: account.privateKey, - prefix, - }); - assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); - return wallet; - } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json, password, progress) { - let account = null; - if (isKeystoreJson(json)) { - account = await decryptKeystoreJson(json, password, progress); - } - else if (isCrowdsaleJson(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = decryptCrowdsaleJson(json, password); - if (progress) { - progress(1); - await stall(0); - } - } - return Wallet.#fromAccount(account); - } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json, password) { - let account = null; - if (isKeystoreJson(json)) { - account = decryptKeystoreJsonSync(json, password); - } - else if (isCrowdsaleJson(json)) { - account = decryptCrowdsaleJson(json, password); - } - else { - assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - return Wallet.#fromAccount(account); - } - /** - * Creates a new random [[HDNodeWallet]] using the avavilable - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(prefix, provider) { - const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase({ phrase, prefix, provider, password, }) { - const wallet = HDNodeWallet.fromPhrase({ - phrase, - prefix, - password, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - static fromSeed({ seed, prefix, provider, path, }) { - const wallet = HDNodeWallet.fromSeed({ - seed, - prefix, - path: path || defaultPath, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - } - - const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; - /** - * @_ignore - */ - function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = (accum << 6) | Base64.indexOf(data[i]); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = accum >> (bits - width); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; - } - - /** - * @_ignore - */ - function decodeOwlA(data, accents) { - let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); - } - - /** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ - class WordlistOwlA extends WordlistOwl { - #accent; - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - get _accent() { - return this.#accent; - } - _decodeWords() { - return decodeOwlA(this._data, this._accent); - } - } - - const wordlists = { - en: LangEn.wordlist(), - }; - - const customUnitAbi = Object.freeze([ - "function supportsUnit(string unit) view returns (bool)", - "function supportedUnits() view returns (string[])", - "function preferredUnit() view returns (string)", - "function balanceOf(address account) view returns (uint256)", - "function balanceOfUnit(address account, string unit) view returns (uint256)", - ]); - class CustomUnitDiscovery { - preferredUnit; - supportedUnits; - constructor(units, preferredUnit) { - this.preferredUnit = preferredUnit; - this.supportedUnits = Object.freeze([...units]); - } - get isValid() { - return (this.supports("units") && - this.preferredUnit !== "" && - this.supports(this.preferredUnit)); - } - supports(unit) { - return this.supportedUnits.includes(unit); - } - } - /** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ - class CustomUnitBalance { - canonicalAmount; - unitAmount; - unit; - constructor(canonicalAmount, unitAmount, unit) { - this.canonicalAmount = canonicalAmount; - this.unitAmount = unitAmount; - this.unit = unit; - } - get multiplierNumerator() { - return this.unitAmount; - } - get multiplierDenominator() { - return this.canonicalAmount; - } - } - /** Core custom-unit contract convention used by Tone and Core API. */ - class CustomUnitToken { - contract; - constructor(address, runner) { - this.contract = new Contract(address, customUnitAbi, runner); - } - async supportsUnit(unit, blockTag) { - return (unit.trim() !== "" && - (await this.contract.supportsUnit(unit.trim(), { blockTag }))); - } - async supportedUnits(blockTag) { - return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag }))); - } - async preferredUnit(blockTag) { - return (await this.contract.preferredUnit({ blockTag })).trim(); - } - async discover(blockTag) { - if (!(await this.supportsUnit("units", blockTag))) - return null; - const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag)); - return discovery.isValid ? discovery : null; - } - canonicalBalance(account, blockTag) { - return this.contract.balanceOf(account, { blockTag }); - } - balanceOfUnit(account, unit, blockTag) { - if (!unit.trim()) - throw new TypeError("unit must not be empty"); - return this.contract.balanceOfUnit(account, unit.trim(), { blockTag }); - } - async balance(account, unit, blockTag) { - const resolved = unit?.trim() || (await this.preferredUnit(blockTag)); - const [canonical, calculated] = await Promise.all([ - this.canonicalBalance(account, blockTag), - this.balanceOfUnit(account, resolved, blockTag), - ]); - return new CustomUnitBalance(canonical, calculated, resolved); - } - } - - /** On-chain interface defined by CIP-150. */ - const cip150Abi = Object.freeze([ - "function getMetadataValue(string key) view returns (string value)", - "function hasMetadataKey(string key) view returns (bool exists)", - "function isMetadataSealed(string key) view returns (bool sealed)", - "function listMetadataKeys() view returns (string[] keys)", - "function getMetadataByIndex(uint256 index) view returns (string key, string value)", - "function metadataCount() view returns (uint256 total)", - "function setMetadataValue(string key, string value)", - "function sealMetadataKey(string key)", - ]); - const cip151TokenExpirationKey = "tokenExpiration"; - const cip151TradingStopKey = "tradingStop"; - const cip152LabKey = "lab"; - /** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ - class Cip151Lifecycle { - tokenExpiration; - tradingStop; - constructor(metadata = {}) { - const parse = (key) => { - const value = metadata[key]; - if (value == null || value === "") - return null; - if (!/^\d+$/.test(value)) - throw new TypeError(`${key} must be a non-negative Unix timestamp`); - return BigInt(value); - }; - this.tokenExpiration = parse(cip151TokenExpirationKey); - this.tradingStop = parse(cip151TradingStopKey); - } - isExpiredAt(seconds) { - return this.tokenExpiration !== null && seconds >= this.tokenExpiration; - } - isTradingStoppedAt(seconds) { - return this.tradingStop !== null && seconds >= this.tradingStop; - } - } - /** Validates certificate structure, not the authenticity of its issuer. */ - class Cip152LabCertificate { - measurements; - constructor(json) { - if (json === null || typeof json !== "object" || Array.isArray(json)) - throw new TypeError("CIP-152 lab.json must be an object"); - const measurements = Object.create(null); - for (const [key, property] of Object.entries(json)) { - if (!property || - typeof property !== "object" || - Array.isArray(property) || - !Object.hasOwn(property, "value")) - throw new TypeError(`CIP-152 property ${key} must contain a value`); - const { value, unit } = property; - if (!(typeof value === "string" || - (typeof value === "number" && Number.isFinite(value)))) - throw new TypeError(`CIP-152 property ${key} has an invalid value`); - if (unit != null && typeof unit !== "string") - throw new TypeError(`CIP-152 property ${key} has an invalid unit`); - measurements[key] = Object.freeze(unit == null ? { value } : { value, unit }); - } - this.measurements = Object.freeze(measurements); - } - } - /** Typed metadata reader and writer. Writes require a signer as runner. */ - class Cip150MetadataContract { - contract; - constructor(address, runner) { - this.contract = new Contract(address, cip150Abi, runner); - } - getValue(key, blockTag) { - return this.contract.getMetadataValue(key, { blockTag }); - } - hasKey(key, blockTag) { - return this.contract.hasMetadataKey(key, { blockTag }); - } - isSealed(key, blockTag) { - return this.contract.isMetadataSealed(key, { blockTag }); - } - async listKeys(blockTag) { - return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag }))); - } - async getByIndex(index, blockTag) { - const [key, value] = await this.contract.getMetadataByIndex(index, { - blockTag, - }); - return Object.freeze({ key, value }); - } - count(blockTag) { - return this.contract.metadataCount({ blockTag }); - } - async readAll(blockTag, includeSealedState = true) { - const entries = []; - for (const key of await this.listKeys(blockTag)) { - const value = await this.getValue(key, blockTag); - entries.push(Object.freeze(includeSealedState - ? { key, value, sealed: await this.isSealed(key, blockTag) } - : { key, value })); - } - return Object.freeze(entries); - } - setValue(key, value, overrides = {}) { - return this.contract.setMetadataValue(key, value, overrides); - } - sealKey(key, overrides = {}) { - return this.contract.sealMetadataKey(key, overrides); - } - async readLifecycle(blockTag) { - const metadata = {}; - for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) { - if (await this.hasKey(key, blockTag)) - metadata[key] = await this.getValue(key, blockTag); - } - return new Cip151Lifecycle(metadata); - } - async readLabCertificate(gateway, blockTag) { - if (!(await this.hasKey(cip152LabKey, blockTag))) - return null; - const reference = await this.getValue(cip152LabKey, blockTag); - if (!gateway.resolve(reference).pathname.endsWith("/lab.json")) - throw new TypeError("CIP-152 reference must point to lab.json"); - return new Cip152LabCertificate(await gateway.readJson(reference)); - } - } - - const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; - /** Configurable IPFS resolution and bounded JSON loading. */ - class IpfsGateway { - template; - maxResponseBytes; - timeoutMs; - #fetch; - constructor(options = {}) { - this.template = options.template ?? defaultIpfsGatewayTemplate; - this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024; - this.timeoutMs = options.timeoutMs ?? 30_000; - this.#fetch = options.fetch ?? globalThis.fetch; - const templateUrl = new URL(this.template.replace("{cid}", "cid")); - if (!/^https?:$/.test(templateUrl.protocol) || - this.template.split("{cid}").length !== 2) - throw new TypeError("gateway template must be HTTP(S) and contain one {cid}"); - for (const value of [this.maxResponseBytes, this.timeoutMs]) - if (!Number.isSafeInteger(value) || value <= 0) - throw new TypeError("gateway limits must be positive safe integers"); - } - resolve(reference) { - const value = reference.trim(); - if (/^https?:\/\//i.test(value)) - return new URL(value); - const path = value.replace(/^ipfs:\/\//, "").replace(/^\/?ipfs\//, ""); - if (!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path) || - path.split("/").some((part) => part === "." || part === "..")) - throw new TypeError("invalid IPFS reference"); - return new URL(this.template.replace("{cid}", path.split("/").map(encodeURIComponent).join("/"))); - } - async readJson(reference) { - const controller = new AbortController(); - const timer = setTimeout(() => controller.abort(), this.timeoutMs); - let reader; - try { - const response = await this.#fetch(this.resolve(reference), { - headers: { accept: "application/json" }, - signal: controller.signal, - }); - if (!response.ok) { - await response.body?.cancel(); - throw new Error(`IPFS gateway returned HTTP ${response.status}`); - } - if (!response.body) - throw new Error("IPFS gateway returned an empty body"); - reader = response.body.getReader(); - const chunks = []; - let length = 0; - while (true) { - const { done, value } = await reader.read(); - if (done) - break; - length += value.length; - if (length > this.maxResponseBytes) - throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`); - chunks.push(value); - } - const bytes = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - bytes.set(chunk, offset); - offset += chunk.length; - } - return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)); - } - finally { - clearTimeout(timer); - await reader?.cancel().catch(() => { }); - reader?.releaseLock(); - } - } - } - - var corebc = /*#__PURE__*/Object.freeze({ - __proto__: null, - AbiCoder: AbiCoder, - AbstractProvider: AbstractProvider, - AbstractSigner: AbstractSigner, - AlchemyProvider: AlchemyProvider, - AnkrProvider: AnkrProvider, - BaseContract: BaseContract, - BaseWallet: BaseWallet, - BigNumber: BigNumber, - Block: Block, - BrowserProvider: BrowserProvider, - Cip150MetadataContract: Cip150MetadataContract, - Cip151Lifecycle: Cip151Lifecycle, - Cip152LabCertificate: Cip152LabCertificate, - CloudflareProvider: CloudflareProvider, - ConstructorFragment: ConstructorFragment, - Contract: Contract, - ContractEventPayload: ContractEventPayload, - ContractFactory: ContractFactory, - ContractTransactionReceipt: ContractTransactionReceipt, - ContractTransactionResponse: ContractTransactionResponse, - ContractUnknownEventPayload: ContractUnknownEventPayload, - CoreSymbol: CoreSymbol, - CustomUnitBalance: CustomUnitBalance, - CustomUnitDiscovery: CustomUnitDiscovery, - CustomUnitToken: CustomUnitToken, - Ed448Goldilock: Ed448Goldilock, - EnergyCostPlugin: EnergyCostPlugin, - ErrorDescription: ErrorDescription, - ErrorFragment: ErrorFragment, - EventFragment: EventFragment, - EventLog: EventLog, - EventPayload: EventPayload, - FallbackFragment: FallbackFragment, - FallbackProvider: FallbackProvider, - FeeData: FeeData, - FeeDataNetworkPlugin: FeeDataNetworkPlugin, - FetchCancelSignal: FetchCancelSignal, - FetchRequest: FetchRequest, - FetchResponse: FetchResponse, - FixedNumber: FixedNumber, - Fragment: Fragment, - FunctionFragment: FunctionFragment, - HDNodeWallet: HDNodeWallet, - Indexed: Indexed, - InfuraProvider: InfuraProvider, - InfuraWebSocketProvider: InfuraWebSocketProvider, - Interface: Interface, - IpcSocketProvider: IpcSocketProvider, - IpfsGateway: IpfsGateway, - JsonRpcApiProvider: JsonRpcApiProvider, - JsonRpcProvider: JsonRpcProvider, - JsonRpcSigner: JsonRpcSigner, - LangEn: LangEn, - Log: Log, - LogDescription: LogDescription, - MaxInt256: MaxInt256, - MaxUint256: MaxUint256, - MessagePrefix: MessagePrefix, - MinInt256: MinInt256, - Mnemonic: Mnemonic, - N: N, - NamedFragment: NamedFragment, - Network: Network, - NetworkPlugin: NetworkPlugin, - NonceManager: NonceManager, - OrePerXCB: OrePerXCB, - ParamType: ParamType, - PocketProvider: PocketProvider, - QuickNodeProvider: QuickNodeProvider, - Result: Result, - Signature: Signature, - SigningKey: SigningKey, - SocketBlockSubscriber: SocketBlockSubscriber, - SocketEventSubscriber: SocketEventSubscriber, - SocketPendingSubscriber: SocketPendingSubscriber, - SocketProvider: SocketProvider, - SocketSubscriber: SocketSubscriber, - StructFragment: StructFragment, - Transaction: Transaction, - TransactionDescription: TransactionDescription, - TransactionReceipt: TransactionReceipt, - TransactionResponse: TransactionResponse, - Typed: Typed, - TypedDataEncoder: TypedDataEncoder, - UnmanagedSubscriber: UnmanagedSubscriber, - Utf8ErrorFuncs: Utf8ErrorFuncs, - VoidSigner: VoidSigner, - Wallet: Wallet, - WebSocketProvider: WebSocketProvider, - Wordlist: Wordlist, - WordlistOwl: WordlistOwl, - WordlistOwlA: WordlistOwlA, - ZeroAddress: ZeroAddress, - ZeroHash: ZeroHash, - accessListify: accessListify, - arrayify: arrayify, - assert: assert, - assertArgument: assertArgument, - assertArgumentCount: assertArgumentCount, - assertNormalize: assertNormalize, - assertPrivate: assertPrivate, - checkResultErrors: checkResultErrors, - cip150Abi: cip150Abi, - cip151TokenExpirationKey: cip151TokenExpirationKey, - cip151TradingStopKey: cip151TradingStopKey, - cip152LabKey: cip152LabKey, - computeAddress: computeAddress, - computeHmac: computeHmac, - concat: concat, - copyRequest: copyRequest, - customUnitAbi: customUnitAbi, - dataLength: dataLength, - dataSlice: dataSlice, - decodeBase58: decodeBase58, - decodeBase64: decodeBase64, - decodeBytes32String: decodeBytes32String, - decodeRlp: decodeRlp, - decryptCrowdsaleJson: decryptCrowdsaleJson, - decryptKeystoreJson: decryptKeystoreJson, - decryptKeystoreJsonSync: decryptKeystoreJsonSync, - defaultIpfsGatewayTemplate: defaultIpfsGatewayTemplate, - defaultPath: defaultPath, - defineProperties: defineProperties, - encodeBase58: encodeBase58, - encodeBase64: encodeBase64, - encodeBytes32String: encodeBytes32String, - encodeRlp: encodeRlp, - encryptKeystoreJson: encryptKeystoreJson, - encryptKeystoreJsonSync: encryptKeystoreJsonSync, - formatUnits: formatUnits, - formatXCB: formatXCB, - fromTwos: fromTwos, - getAccountPath: getAccountPath, - getAddress: getAddress, - getBigInt: getBigInt, - getBytes: getBytes, - getBytesCopy: getBytesCopy, - getCreate2Address: getCreate2Address, - getCreateAddress: getCreateAddress, - getDefaultProvider: getDefaultProvider, - getIndexedAccountPath: getIndexedAccountPath, - getNumber: getNumber, - getUint: getUint, - hashMessage: hashMessage, - hexConcat: hexConcat, - hexlify: hexlify, - id: id, - isAddress: isAddress, - isAddressable: isAddressable, - isBytesLike: isBytesLike, - isCallException: isCallException, - isCrowdsaleJson: isCrowdsaleJson, - isError: isError, - isHexString: isHexString, - isKeystoreJson: isKeystoreJson, - keccak256: keccak256, - lock: lock, - makeError: makeError, - mask: mask, - networkIdToPrefix: networkIdToPrefix, - parseUnits: parseUnits, - parseXCB: parseXCB, - pbkdf2: pbkdf2, - publicToAddress: publicToAddress, - randomBytes: randomBytes, - recoverAddress: recoverAddress, - resolveAddress: resolveAddress, - resolveProperties: resolveProperties, - ripemd160: ripemd160, - scrypt: scrypt, - scryptSync: scryptSync, - sha256: sha256, - sha512: sha512, - showThrottleMessage: showThrottleMessage, - solidityPacked: solidityPacked, - solidityPackedSha256: solidityPackedSha256, - stripZerosLeft: stripZerosLeft, - toBeArray: toBeArray, - toBeHex: toBeHex, - toBigInt: toBigInt, - toNumber: toNumber, - toQuantity: toQuantity, - toTwos: toTwos, - toUtf8Bytes: toUtf8Bytes, - toUtf8CodePoints: toUtf8CodePoints, - toUtf8String: toUtf8String, - uuidV4: uuidV4, - verifyMessage: verifyMessage, - verifyTypedData: verifyTypedData, - version: version, - wordlists: wordlists, - zeroPadBytes: zeroPadBytes, - zeroPadValue: zeroPadValue - }); - - exports.AbiCoder = AbiCoder; - exports.AbstractProvider = AbstractProvider; - exports.AbstractSigner = AbstractSigner; - exports.AlchemyProvider = AlchemyProvider; - exports.AnkrProvider = AnkrProvider; - exports.BaseContract = BaseContract; - exports.BaseWallet = BaseWallet; - exports.BigNumber = BigNumber; - exports.Block = Block; - exports.BrowserProvider = BrowserProvider; - exports.Buffer = bufferExports.Buffer; - exports.Cip150MetadataContract = Cip150MetadataContract; - exports.Cip151Lifecycle = Cip151Lifecycle; - exports.Cip152LabCertificate = Cip152LabCertificate; - exports.CloudflareProvider = CloudflareProvider; - exports.ConstructorFragment = ConstructorFragment; - exports.Contract = Contract; - exports.ContractEventPayload = ContractEventPayload; - exports.ContractFactory = ContractFactory; - exports.ContractTransactionReceipt = ContractTransactionReceipt; - exports.ContractTransactionResponse = ContractTransactionResponse; - exports.ContractUnknownEventPayload = ContractUnknownEventPayload; - exports.CoreSymbol = CoreSymbol; - exports.CustomUnitBalance = CustomUnitBalance; - exports.CustomUnitDiscovery = CustomUnitDiscovery; - exports.CustomUnitToken = CustomUnitToken; - exports.Ed448Goldilock = Ed448Goldilock; - exports.EnergyCostPlugin = EnergyCostPlugin; - exports.ErrorDescription = ErrorDescription; - exports.ErrorFragment = ErrorFragment; - exports.EventFragment = EventFragment; - exports.EventLog = EventLog; - exports.EventPayload = EventPayload; - exports.FallbackFragment = FallbackFragment; - exports.FallbackProvider = FallbackProvider; - exports.FeeData = FeeData; - exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin; - exports.FetchCancelSignal = FetchCancelSignal; - exports.FetchRequest = FetchRequest; - exports.FetchResponse = FetchResponse; - exports.FixedNumber = FixedNumber; - exports.Fragment = Fragment; - exports.FunctionFragment = FunctionFragment; - exports.HDNodeWallet = HDNodeWallet; - exports.Indexed = Indexed; - exports.InfuraProvider = InfuraProvider; - exports.InfuraWebSocketProvider = InfuraWebSocketProvider; - exports.Interface = Interface; - exports.IpcSocketProvider = IpcSocketProvider; - exports.IpfsGateway = IpfsGateway; - exports.JsonRpcApiProvider = JsonRpcApiProvider; - exports.JsonRpcProvider = JsonRpcProvider; - exports.JsonRpcSigner = JsonRpcSigner; - exports.LangEn = LangEn; - exports.Log = Log; - exports.LogDescription = LogDescription; - exports.MaxInt256 = MaxInt256; - exports.MaxUint256 = MaxUint256; - exports.MessagePrefix = MessagePrefix; - exports.MinInt256 = MinInt256; - exports.Mnemonic = Mnemonic; - exports.N = N; - exports.NamedFragment = NamedFragment; - exports.Network = Network; - exports.NetworkPlugin = NetworkPlugin; - exports.NonceManager = NonceManager; - exports.OrePerXCB = OrePerXCB; - exports.ParamType = ParamType; - exports.PocketProvider = PocketProvider; - exports.QuickNodeProvider = QuickNodeProvider; - exports.Result = Result; - exports.Signature = Signature; - exports.SigningKey = SigningKey; - exports.SocketBlockSubscriber = SocketBlockSubscriber; - exports.SocketEventSubscriber = SocketEventSubscriber; - exports.SocketPendingSubscriber = SocketPendingSubscriber; - exports.SocketProvider = SocketProvider; - exports.SocketSubscriber = SocketSubscriber; - exports.StructFragment = StructFragment; - exports.Transaction = Transaction; - exports.TransactionDescription = TransactionDescription; - exports.TransactionReceipt = TransactionReceipt; - exports.TransactionResponse = TransactionResponse; - exports.Typed = Typed; - exports.TypedDataEncoder = TypedDataEncoder; - exports.UnmanagedSubscriber = UnmanagedSubscriber; - exports.Utf8ErrorFuncs = Utf8ErrorFuncs; - exports.VoidSigner = VoidSigner; - exports.Wallet = Wallet; - exports.WebSocketProvider = WebSocketProvider; - exports.Wordlist = Wordlist; - exports.WordlistOwl = WordlistOwl; - exports.WordlistOwlA = WordlistOwlA; - exports.ZeroAddress = ZeroAddress; - exports.ZeroHash = ZeroHash; - exports.accessListify = accessListify; - exports.arrayify = arrayify; - exports.assert = assert; - exports.assertArgument = assertArgument; - exports.assertArgumentCount = assertArgumentCount; - exports.assertNormalize = assertNormalize; - exports.assertPrivate = assertPrivate; - exports.checkResultErrors = checkResultErrors; - exports.cip150Abi = cip150Abi; - exports.cip151TokenExpirationKey = cip151TokenExpirationKey; - exports.cip151TradingStopKey = cip151TradingStopKey; - exports.cip152LabKey = cip152LabKey; - exports.computeAddress = computeAddress; - exports.computeHmac = computeHmac; - exports.concat = concat; - exports.copyRequest = copyRequest; - exports.corebc = corebc; - exports.customUnitAbi = customUnitAbi; - exports.dataLength = dataLength; - exports.dataSlice = dataSlice; - exports.decodeBase58 = decodeBase58; - exports.decodeBase64 = decodeBase64; - exports.decodeBytes32String = decodeBytes32String; - exports.decodeRlp = decodeRlp; - exports.decryptCrowdsaleJson = decryptCrowdsaleJson; - exports.decryptKeystoreJson = decryptKeystoreJson; - exports.decryptKeystoreJsonSync = decryptKeystoreJsonSync; - exports.defaultIpfsGatewayTemplate = defaultIpfsGatewayTemplate; - exports.defaultPath = defaultPath; - exports.defineProperties = defineProperties; - exports.encodeBase58 = encodeBase58; - exports.encodeBase64 = encodeBase64; - exports.encodeBytes32String = encodeBytes32String; - exports.encodeRlp = encodeRlp; - exports.encryptKeystoreJson = encryptKeystoreJson; - exports.encryptKeystoreJsonSync = encryptKeystoreJsonSync; - exports.formatUnits = formatUnits; - exports.formatXCB = formatXCB; - exports.fromTwos = fromTwos; - exports.getAccountPath = getAccountPath; - exports.getAddress = getAddress; - exports.getBigInt = getBigInt; - exports.getBytes = getBytes; - exports.getBytesCopy = getBytesCopy; - exports.getCreate2Address = getCreate2Address; - exports.getCreateAddress = getCreateAddress; - exports.getDefaultProvider = getDefaultProvider; - exports.getIndexedAccountPath = getIndexedAccountPath; - exports.getNumber = getNumber; - exports.getUint = getUint; - exports.hashMessage = hashMessage; - exports.hexConcat = hexConcat; - exports.hexlify = hexlify; - exports.id = id; - exports.isAddress = isAddress; - exports.isAddressable = isAddressable; - exports.isBytesLike = isBytesLike; - exports.isCallException = isCallException; - exports.isCrowdsaleJson = isCrowdsaleJson; - exports.isError = isError; - exports.isHexString = isHexString; - exports.isKeystoreJson = isKeystoreJson; - exports.keccak256 = keccak256; - exports.lock = lock; - exports.makeError = makeError; - exports.mask = mask; - exports.networkIdToPrefix = networkIdToPrefix; - exports.parseUnits = parseUnits; - exports.parseXCB = parseXCB; - exports.pbkdf2 = pbkdf2; - exports.publicToAddress = publicToAddress; - exports.randomBytes = randomBytes; - exports.recoverAddress = recoverAddress; - exports.resolveAddress = resolveAddress; - exports.resolveProperties = resolveProperties; - exports.ripemd160 = ripemd160; - exports.scrypt = scrypt; - exports.scryptSync = scryptSync; - exports.sha256 = sha256; - exports.sha512 = sha512; - exports.showThrottleMessage = showThrottleMessage; - exports.solidityPacked = solidityPacked; - exports.solidityPackedSha256 = solidityPackedSha256; - exports.stripZerosLeft = stripZerosLeft; - exports.toBeArray = toBeArray; - exports.toBeHex = toBeHex; - exports.toBigInt = toBigInt; - exports.toNumber = toNumber; - exports.toQuantity = toQuantity; - exports.toTwos = toTwos; - exports.toUtf8Bytes = toUtf8Bytes; - exports.toUtf8CodePoints = toUtf8CodePoints; - exports.toUtf8String = toUtf8String; - exports.uuidV4 = uuidV4; - exports.verifyMessage = verifyMessage; - exports.verifyTypedData = verifyTypedData; - exports.version = version; - exports.wordlists = wordlists; - exports.zeroPadBytes = zeroPadBytes; - exports.zeroPadValue = zeroPadValue; - -})); -//# sourceMappingURL=corebc.umd.js.map diff --git a/dist/corebc.umd.js.map b/dist/corebc.umd.js.map deleted file mode 100644 index 2e6d2bd6e..000000000 --- a/dist/corebc.umd.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"corebc.umd.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../lib.esm/_version.js","../node_modules/bn.js/lib/bn.js","../lib.esm/logger/logger.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/bigNumber/bigNumber.js","../lib.esm/crypto/rlp.js","../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/_md.js","../node_modules/@noble/hashes/legacy.js","../node_modules/@noble/hashes/hmac.js","../node_modules/@noble/hashes/pbkdf2.js","../node_modules/@noble/hashes/sha2.js","../node_modules/@noble/hashes/sha3.js","../node_modules/bcrypto/lib/internal/assert.js","../node_modules/bcrypto/lib/internal/custom-browser.js","../node_modules/bcrypto/lib/js/bn.js","../node_modules/bcrypto/lib/bn-browser.js","../node_modules/bcrypto/lib/js/chacha20.js","../node_modules/bcrypto/lib/chacha20-browser.js","../node_modules/bcrypto/lib/internal/hmac.js","../node_modules/bcrypto/lib/js/sha256.js","../node_modules/bcrypto/lib/sha256-browser.js","../node_modules/bcrypto/lib/js/batch-rng.js","../node_modules/bcrypto/lib/js/elliptic.js","../node_modules/bcrypto/lib/js/random.js","../node_modules/bcrypto/lib/random-browser.js","../node_modules/bcrypto/lib/js/eddsa.js","../node_modules/bcrypto/lib/js/keccak.js","../node_modules/bcrypto/lib/keccak-browser.js","../node_modules/bcrypto/lib/shake.js","../node_modules/bcrypto/lib/shake256.js","../node_modules/bcrypto/lib/js/ed448.js","../node_modules/bcrypto/lib/ed448-browser.js","../lib.esm/crypto/browser-ed448.js","../lib.esm/utils/maths.js","../lib.esm/utils/base58.js","../lib.esm/utils/base64-browser.js","../lib.esm/utils/events.js","../lib.esm/utils/utf8.js","../lib.esm/utils/geturl-browser.js","../lib.esm/utils/fetch.js","../lib.esm/utils/fixednumber.js","../lib.esm/utils/rlp-decode.js","../lib.esm/utils/rlp-encode.js","../lib.esm/utils/units.js","../lib.esm/utils/uuid.js","../node_modules/bcrypto/lib/js/pbkdf2.js","../node_modules/bcrypto/lib/pbkdf2-browser.js","../node_modules/bcrypto/lib/js/sha3.js","../node_modules/bcrypto/lib/sha3-browser.js","../node_modules/bcrypto/lib/sha3-512.js","../lib.esm/crypto/ed448goldilock-browser.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/sha3.js","../lib.esm/address/index.js","../lib.esm/crypto/hmac.js","../lib.esm/crypto/ripemd160.js","../lib.esm/crypto/pbkdf2.js","../lib.esm/crypto/random.js","../node_modules/@noble/hashes/scrypt.js","../lib.esm/crypto/scrypt.js","../lib.esm/crypto/keccak.js","../lib.esm/crypto/signing-key.js","../lib.esm/crypto/signature.js","../lib.esm/crypto/index.js","../lib.esm/transaction/address.js","../lib.esm/abi/coders/abstract-coder.js","../lib.esm/abi/typed.js","../lib.esm/abi/coders/address.js","../lib.esm/abi/coders/anonymous.js","../lib.esm/abi/coders/array.js","../lib.esm/abi/coders/boolean.js","../lib.esm/abi/coders/bytes.js","../lib.esm/abi/coders/fixed-bytes.js","../lib.esm/abi/coders/null.js","../lib.esm/abi/coders/number.js","../lib.esm/abi/coders/string.js","../lib.esm/abi/coders/tuple.js","../lib.esm/hash/id.js","../lib.esm/constants/addresses.js","../lib.esm/constants/hashes.js","../lib.esm/constants/numbers.js","../lib.esm/constants/strings.js","../lib.esm/transaction/accesslist.js","../lib.esm/transaction/transaction.js","../lib.esm/hash/message.js","../lib.esm/hash/solidity.js","../lib.esm/hash/typed-data.js","../lib.esm/abi/fragments.js","../lib.esm/abi/abi-coder.js","../lib.esm/abi/bytes32.js","../lib.esm/abi/interface.js","../lib.esm/address/contract-address.js","../lib.esm/address/checks.js","../lib.esm/providers/provider.js","../lib.esm/contract/wrappers.js","../lib.esm/contract/contract.js","../lib.esm/contract/factory.js","../lib.esm/providers/format.js","../lib.esm/providers/plugins-network.js","../lib.esm/providers/network.js","../lib.esm/providers/subscriber-polling.js","../lib.esm/providers/abstract-provider.js","../lib.esm/providers/abstract-signer.js","../lib.esm/providers/community.js","../lib.esm/providers/subscriber-filterid.js","../lib.esm/providers/provider-jsonrpc.js","../lib.esm/providers/provider-ankr.js","../lib.esm/providers/provider-alchemy.js","../lib.esm/providers/provider-cloudflare.js","../lib.esm/providers/ws-browser.js","../lib.esm/providers/provider-socket.js","../lib.esm/providers/provider-websocket.js","../lib.esm/providers/provider-infura.js","../lib.esm/providers/provider-quicknode.js","../lib.esm/providers/provider-fallback.js","../lib.esm/providers/default-provider.js","../lib.esm/providers/signer-noncemanager.js","../lib.esm/providers/provider-browser.js","../lib.esm/providers/provider-pocket.js","../lib.esm/providers/provider-ipcsocket-browser.js","../lib.esm/wallet/base-wallet.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-en.js","../node_modules/utf8/utf8.js","../lib.esm/wallet/mnemonicToSeed.js","../lib.esm/wallet/mnemonic.js","../node_modules/aes-js/index.js","../lib.esm/wallet/utils.js","../lib.esm/wallet/json-keystore.js","../lib.esm/wallet/hdwallet.js","../lib.esm/wallet/json-crowdsale.js","../lib.esm/wallet/wallet.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/wordlists-browser.js","../lib.esm/cip/custom-units.js","../lib.esm/cip/index.js","../lib.esm/ipfs/index.js"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","/** The current version of corebc; keep in sync with package.json. */\nexport const version = \"0.4.1\";\n//# sourceMappingURL=_version.js.map","(function (module, exports) {\n 'use strict';\n\n // Utils\n function assert (val, msg) {\n if (!val) throw new Error(msg || 'Assertion failed');\n }\n\n // Could use `inherits` module, but don't want to move from single file\n // architecture yet.\n function inherits (ctor, superCtor) {\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n\n // BN\n\n function BN (number, base, endian) {\n if (BN.isBN(number)) {\n return number;\n }\n\n this.negative = 0;\n this.words = null;\n this.length = 0;\n\n // Reduction context\n this.red = null;\n\n if (number !== null) {\n if (base === 'le' || base === 'be') {\n endian = base;\n base = 10;\n }\n\n this._init(number || 0, base || 10, endian || 'be');\n }\n }\n if (typeof module === 'object') {\n module.exports = BN;\n } else {\n exports.BN = BN;\n }\n\n BN.BN = BN;\n BN.wordSize = 26;\n\n var Buffer;\n try {\n if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') {\n Buffer = window.Buffer;\n } else {\n Buffer = require('buffer').Buffer;\n }\n } catch (e) {\n }\n\n BN.isBN = function isBN (num) {\n if (num instanceof BN) {\n return true;\n }\n\n return num !== null && typeof num === 'object' &&\n num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n };\n\n BN.max = function max (left, right) {\n if (left.cmp(right) > 0) return left;\n return right;\n };\n\n BN.min = function min (left, right) {\n if (left.cmp(right) < 0) return left;\n return right;\n };\n\n BN.prototype._init = function init (number, base, endian) {\n if (typeof number === 'number') {\n return this._initNumber(number, base, endian);\n }\n\n if (typeof number === 'object') {\n return this._initArray(number, base, endian);\n }\n\n if (base === 'hex') {\n base = 16;\n }\n assert(base === (base | 0) && base >= 2 && base <= 36);\n\n number = number.toString().replace(/\\s+/g, '');\n var start = 0;\n if (number[0] === '-') {\n start++;\n this.negative = 1;\n }\n\n if (start < number.length) {\n if (base === 16) {\n this._parseHex(number, start, endian);\n } else {\n this._parseBase(number, base, start);\n if (endian === 'le') {\n this._initArray(this.toArray(), base, endian);\n }\n }\n }\n };\n\n BN.prototype._initNumber = function _initNumber (number, base, endian) {\n if (number < 0) {\n this.negative = 1;\n number = -number;\n }\n if (number < 0x4000000) {\n this.words = [number & 0x3ffffff];\n this.length = 1;\n } else if (number < 0x10000000000000) {\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n this.words = [\n number & 0x3ffffff,\n (number / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n if (endian !== 'le') return;\n\n // Reverse the bytes\n this._initArray(this.toArray(), base, endian);\n };\n\n BN.prototype._initArray = function _initArray (number, base, endian) {\n // Perhaps a Uint8Array\n assert(typeof number.length === 'number');\n if (number.length <= 0) {\n this.words = [0];\n this.length = 1;\n return this;\n }\n\n this.length = Math.ceil(number.length / 3);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n var j, w;\n var off = 0;\n if (endian === 'be') {\n for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n } else if (endian === 'le') {\n for (i = 0, j = 0; i < number.length; i += 3) {\n w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n off += 24;\n if (off >= 26) {\n off -= 26;\n j++;\n }\n }\n }\n return this._strip();\n };\n\n function parseHex4Bits (string, index) {\n var c = string.charCodeAt(index);\n // '0' - '9'\n if (c >= 48 && c <= 57) {\n return c - 48;\n // 'A' - 'F'\n } else if (c >= 65 && c <= 70) {\n return c - 55;\n // 'a' - 'f'\n } else if (c >= 97 && c <= 102) {\n return c - 87;\n } else {\n assert(false, 'Invalid character in ' + string);\n }\n }\n\n function parseHexByte (string, lowerBound, index) {\n var r = parseHex4Bits(string, index);\n if (index - 1 >= lowerBound) {\n r |= parseHex4Bits(string, index - 1) << 4;\n }\n return r;\n }\n\n BN.prototype._parseHex = function _parseHex (number, start, endian) {\n // Create possibly bigger array to ensure that it fits the number\n this.length = Math.ceil((number.length - start) / 6);\n this.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // 24-bits chunks\n var off = 0;\n var j = 0;\n\n var w;\n if (endian === 'be') {\n for (i = number.length - 1; i >= start; i -= 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n } else {\n var parseLength = number.length - start;\n for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {\n w = parseHexByte(number, start, i) << off;\n this.words[j] |= w & 0x3ffffff;\n if (off >= 18) {\n off -= 18;\n j += 1;\n this.words[j] |= w >>> 26;\n } else {\n off += 8;\n }\n }\n }\n\n this._strip();\n };\n\n function parseBase (str, start, end, mul) {\n var r = 0;\n var b = 0;\n var len = Math.min(str.length, end);\n for (var i = start; i < len; i++) {\n var c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n // 'a'\n if (c >= 49) {\n b = c - 49 + 0xa;\n\n // 'A'\n } else if (c >= 17) {\n b = c - 17 + 0xa;\n\n // '0' - '9'\n } else {\n b = c;\n }\n assert(c >= 0 && b < mul, 'Invalid character');\n r += b;\n }\n return r;\n }\n\n BN.prototype._parseBase = function _parseBase (number, base, start) {\n // Initialize as zero\n this.words = [0];\n this.length = 1;\n\n // Find length of limb in base\n for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n limbLen++;\n }\n limbLen--;\n limbPow = (limbPow / base) | 0;\n\n var total = number.length - start;\n var mod = total % limbLen;\n var end = Math.min(total, total - mod) + start;\n\n var word = 0;\n for (var i = start; i < end; i += limbLen) {\n word = parseBase(number, i, i + limbLen, base);\n\n this.imuln(limbPow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n if (mod !== 0) {\n var pow = 1;\n word = parseBase(number, i, number.length, base);\n\n for (i = 0; i < mod; i++) {\n pow *= base;\n }\n\n this.imuln(pow);\n if (this.words[0] + word < 0x4000000) {\n this.words[0] += word;\n } else {\n this._iaddn(word);\n }\n }\n\n this._strip();\n };\n\n BN.prototype.copy = function copy (dest) {\n dest.words = new Array(this.length);\n for (var i = 0; i < this.length; i++) {\n dest.words[i] = this.words[i];\n }\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n };\n\n function move (dest, src) {\n dest.words = src.words;\n dest.length = src.length;\n dest.negative = src.negative;\n dest.red = src.red;\n }\n\n BN.prototype._move = function _move (dest) {\n move(dest, this);\n };\n\n BN.prototype.clone = function clone () {\n var r = new BN(null);\n this.copy(r);\n return r;\n };\n\n BN.prototype._expand = function _expand (size) {\n while (this.length < size) {\n this.words[this.length++] = 0;\n }\n return this;\n };\n\n // Remove leading `0` from `this`\n BN.prototype._strip = function strip () {\n while (this.length > 1 && this.words[this.length - 1] === 0) {\n this.length--;\n }\n return this._normSign();\n };\n\n BN.prototype._normSign = function _normSign () {\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0) {\n this.negative = 0;\n }\n return this;\n };\n\n // Check Symbol.for because not everywhere where Symbol defined\n // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#Browser_compatibility\n if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') {\n try {\n BN.prototype[Symbol.for('nodejs.util.inspect.custom')] = inspect;\n } catch (e) {\n BN.prototype.inspect = inspect;\n }\n } else {\n BN.prototype.inspect = inspect;\n }\n\n function inspect () {\n return (this.red ? '';\n }\n\n /*\n\n var zeros = [];\n var groupSizes = [];\n var groupBases = [];\n\n var s = '';\n var i = -1;\n while (++i < BN.wordSize) {\n zeros[i] = s;\n s += '0';\n }\n groupSizes[0] = 0;\n groupSizes[1] = 0;\n groupBases[0] = 0;\n groupBases[1] = 0;\n var base = 2 - 1;\n while (++base < 36 + 1) {\n var groupSize = 0;\n var groupBase = 1;\n while (groupBase < (1 << BN.wordSize) / base) {\n groupBase *= base;\n groupSize += 1;\n }\n groupSizes[base] = groupSize;\n groupBases[base] = groupBase;\n }\n\n */\n\n var zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n ];\n\n var groupSizes = [\n 0, 0,\n 25, 16, 12, 11, 10, 9, 8,\n 8, 7, 7, 7, 7, 6, 6,\n 6, 6, 6, 6, 6, 5, 5,\n 5, 5, 5, 5, 5, 5, 5,\n 5, 5, 5, 5, 5, 5, 5\n ];\n\n var groupBases = [\n 0, 0,\n 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n ];\n\n BN.prototype.toString = function toString (base, padding) {\n base = base || 10;\n padding = padding | 0 || 1;\n\n var out;\n if (base === 16 || base === 'hex') {\n out = '';\n var off = 0;\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = this.words[i];\n var word = (((w << off) | carry) & 0xffffff).toString(16);\n carry = (w >>> (24 - off)) & 0xffffff;\n off += 2;\n if (off >= 26) {\n off -= 26;\n i--;\n }\n if (carry !== 0 || i !== this.length - 1) {\n out = zeros[6 - word.length] + word + out;\n } else {\n out = word + out;\n }\n }\n if (carry !== 0) {\n out = carry.toString(16) + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n if (base === (base | 0) && base >= 2 && base <= 36) {\n // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n var groupSize = groupSizes[base];\n // var groupBase = Math.pow(base, groupSize);\n var groupBase = groupBases[base];\n out = '';\n var c = this.clone();\n c.negative = 0;\n while (!c.isZero()) {\n var r = c.modrn(groupBase).toString(base);\n c = c.idivn(groupBase);\n\n if (!c.isZero()) {\n out = zeros[groupSize - r.length] + r + out;\n } else {\n out = r + out;\n }\n }\n if (this.isZero()) {\n out = '0' + out;\n }\n while (out.length % padding !== 0) {\n out = '0' + out;\n }\n if (this.negative !== 0) {\n out = '-' + out;\n }\n return out;\n }\n\n assert(false, 'Base should be between 2 and 36');\n };\n\n BN.prototype.toNumber = function toNumber () {\n var ret = this.words[0];\n if (this.length === 2) {\n ret += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // NOTE: at this stage it is known that the top bit is set\n ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n assert(false, 'Number can only safely store up to 53 bits');\n }\n return (this.negative !== 0) ? -ret : ret;\n };\n\n BN.prototype.toJSON = function toJSON () {\n return this.toString(16, 2);\n };\n\n if (Buffer) {\n BN.prototype.toBuffer = function toBuffer (endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n };\n }\n\n BN.prototype.toArray = function toArray (endian, length) {\n return this.toArrayLike(Array, endian, length);\n };\n\n var allocate = function allocate (ArrayType, size) {\n if (ArrayType.allocUnsafe) {\n return ArrayType.allocUnsafe(size);\n }\n return new ArrayType(size);\n };\n\n BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n this._strip();\n\n var byteLength = this.byteLength();\n var reqLength = length || Math.max(1, byteLength);\n assert(byteLength <= reqLength, 'byte array longer than desired length');\n assert(reqLength > 0, 'Requested array length <= 0');\n\n var res = allocate(ArrayType, reqLength);\n var postfix = endian === 'le' ? 'LE' : 'BE';\n this['_toArrayLike' + postfix](res, byteLength);\n return res;\n };\n\n BN.prototype._toArrayLikeLE = function _toArrayLikeLE (res, byteLength) {\n var position = 0;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position++] = word & 0xff;\n if (position < res.length) {\n res[position++] = (word >> 8) & 0xff;\n }\n if (position < res.length) {\n res[position++] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position < res.length) {\n res[position++] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position < res.length) {\n res[position++] = carry;\n\n while (position < res.length) {\n res[position++] = 0;\n }\n }\n };\n\n BN.prototype._toArrayLikeBE = function _toArrayLikeBE (res, byteLength) {\n var position = res.length - 1;\n var carry = 0;\n\n for (var i = 0, shift = 0; i < this.length; i++) {\n var word = (this.words[i] << shift) | carry;\n\n res[position--] = word & 0xff;\n if (position >= 0) {\n res[position--] = (word >> 8) & 0xff;\n }\n if (position >= 0) {\n res[position--] = (word >> 16) & 0xff;\n }\n\n if (shift === 6) {\n if (position >= 0) {\n res[position--] = (word >> 24) & 0xff;\n }\n carry = 0;\n shift = 0;\n } else {\n carry = word >>> 24;\n shift += 2;\n }\n }\n\n if (position >= 0) {\n res[position--] = carry;\n\n while (position >= 0) {\n res[position--] = 0;\n }\n }\n };\n\n if (Math.clz32) {\n BN.prototype._countBits = function _countBits (w) {\n return 32 - Math.clz32(w);\n };\n } else {\n BN.prototype._countBits = function _countBits (w) {\n var t = w;\n var r = 0;\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n return r + t;\n };\n }\n\n BN.prototype._zeroBits = function _zeroBits (w) {\n // Short-cut\n if (w === 0) return 26;\n\n var t = w;\n var r = 0;\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n if ((t & 0x1) === 0) {\n r++;\n }\n return r;\n };\n\n // Return number of used bits in a BN\n BN.prototype.bitLength = function bitLength () {\n var w = this.words[this.length - 1];\n var hi = this._countBits(w);\n return (this.length - 1) * 26 + hi;\n };\n\n function toBitArray (num) {\n var w = new Array(num.bitLength());\n\n for (var bit = 0; bit < w.length; bit++) {\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n w[bit] = (num.words[off] >>> wbit) & 0x01;\n }\n\n return w;\n }\n\n // Number of trailing zero bits\n BN.prototype.zeroBits = function zeroBits () {\n if (this.isZero()) return 0;\n\n var r = 0;\n for (var i = 0; i < this.length; i++) {\n var b = this._zeroBits(this.words[i]);\n r += b;\n if (b !== 26) break;\n }\n return r;\n };\n\n BN.prototype.byteLength = function byteLength () {\n return Math.ceil(this.bitLength() / 8);\n };\n\n BN.prototype.toTwos = function toTwos (width) {\n if (this.negative !== 0) {\n return this.abs().inotn(width).iaddn(1);\n }\n return this.clone();\n };\n\n BN.prototype.fromTwos = function fromTwos (width) {\n if (this.testn(width - 1)) {\n return this.notn(width).iaddn(1).ineg();\n }\n return this.clone();\n };\n\n BN.prototype.isNeg = function isNeg () {\n return this.negative !== 0;\n };\n\n // Return negative clone of `this`\n BN.prototype.neg = function neg () {\n return this.clone().ineg();\n };\n\n BN.prototype.ineg = function ineg () {\n if (!this.isZero()) {\n this.negative ^= 1;\n }\n\n return this;\n };\n\n // Or `num` with `this` in-place\n BN.prototype.iuor = function iuor (num) {\n while (this.length < num.length) {\n this.words[this.length++] = 0;\n }\n\n for (var i = 0; i < num.length; i++) {\n this.words[i] = this.words[i] | num.words[i];\n }\n\n return this._strip();\n };\n\n BN.prototype.ior = function ior (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuor(num);\n };\n\n // Or `num` with `this`\n BN.prototype.or = function or (num) {\n if (this.length > num.length) return this.clone().ior(num);\n return num.clone().ior(this);\n };\n\n BN.prototype.uor = function uor (num) {\n if (this.length > num.length) return this.clone().iuor(num);\n return num.clone().iuor(this);\n };\n\n // And `num` with `this` in-place\n BN.prototype.iuand = function iuand (num) {\n // b = min-length(num, this)\n var b;\n if (this.length > num.length) {\n b = num;\n } else {\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = this.words[i] & num.words[i];\n }\n\n this.length = b.length;\n\n return this._strip();\n };\n\n BN.prototype.iand = function iand (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuand(num);\n };\n\n // And `num` with `this`\n BN.prototype.and = function and (num) {\n if (this.length > num.length) return this.clone().iand(num);\n return num.clone().iand(this);\n };\n\n BN.prototype.uand = function uand (num) {\n if (this.length > num.length) return this.clone().iuand(num);\n return num.clone().iuand(this);\n };\n\n // Xor `num` with `this` in-place\n BN.prototype.iuxor = function iuxor (num) {\n // a.length > b.length\n var a;\n var b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n for (var i = 0; i < b.length; i++) {\n this.words[i] = a.words[i] ^ b.words[i];\n }\n\n if (this !== a) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = a.length;\n\n return this._strip();\n };\n\n BN.prototype.ixor = function ixor (num) {\n assert((this.negative | num.negative) === 0);\n return this.iuxor(num);\n };\n\n // Xor `num` with `this`\n BN.prototype.xor = function xor (num) {\n if (this.length > num.length) return this.clone().ixor(num);\n return num.clone().ixor(this);\n };\n\n BN.prototype.uxor = function uxor (num) {\n if (this.length > num.length) return this.clone().iuxor(num);\n return num.clone().iuxor(this);\n };\n\n // Not ``this`` with ``width`` bitwidth\n BN.prototype.inotn = function inotn (width) {\n assert(typeof width === 'number' && width >= 0);\n\n var bytesNeeded = Math.ceil(width / 26) | 0;\n var bitsLeft = width % 26;\n\n // Extend the buffer with leading zeroes\n this._expand(bytesNeeded);\n\n if (bitsLeft > 0) {\n bytesNeeded--;\n }\n\n // Handle complete words\n for (var i = 0; i < bytesNeeded; i++) {\n this.words[i] = ~this.words[i] & 0x3ffffff;\n }\n\n // Handle the residue\n if (bitsLeft > 0) {\n this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n i++;\n }\n\n // Clear words above the requested width so the result stays below 2 ** width\n for (; i < this.length; i++) {\n this.words[i] = 0;\n }\n\n // And remove leading zeroes\n return this._strip();\n };\n\n BN.prototype.notn = function notn (width) {\n return this.clone().inotn(width);\n };\n\n // Set `bit` of `this`\n BN.prototype.setn = function setn (bit, val) {\n assert(typeof bit === 'number' && bit >= 0);\n\n var off = (bit / 26) | 0;\n var wbit = bit % 26;\n\n this._expand(off + 1);\n\n if (val) {\n this.words[off] = this.words[off] | (1 << wbit);\n } else {\n this.words[off] = this.words[off] & ~(1 << wbit);\n }\n\n return this._strip();\n };\n\n // Add `num` to `this` in-place\n BN.prototype.iadd = function iadd (num) {\n var r;\n\n // negative + positive\n if (this.negative !== 0 && num.negative === 0) {\n this.negative = 0;\n r = this.isub(num);\n this.negative ^= 1;\n return this._normSign();\n\n // positive + negative\n } else if (this.negative === 0 && num.negative !== 0) {\n num.negative = 0;\n r = this.isub(num);\n num.negative = 1;\n return r._normSign();\n }\n\n // a.length > b.length\n var a, b;\n if (this.length > num.length) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n this.words[i] = r & 0x3ffffff;\n carry = r >>> 26;\n }\n\n this.length = a.length;\n if (carry !== 0) {\n this.words[this.length] = carry;\n this.length++;\n // Copy the rest of the words\n } else if (a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n return this;\n };\n\n // Add `num` to `this`\n BN.prototype.add = function add (num) {\n var res;\n if (num.negative !== 0 && this.negative === 0) {\n num.negative = 0;\n res = this.sub(num);\n num.negative ^= 1;\n return res;\n } else if (num.negative === 0 && this.negative !== 0) {\n this.negative = 0;\n res = num.sub(this);\n this.negative = 1;\n return res;\n }\n\n if (this.length > num.length) return this.clone().iadd(num);\n\n return num.clone().iadd(this);\n };\n\n // Subtract `num` from `this` in-place\n BN.prototype.isub = function isub (num) {\n // this - (-num) = this + num\n if (num.negative !== 0) {\n num.negative = 0;\n var r = this.iadd(num);\n num.negative = 1;\n return r._normSign();\n\n // -this - num = -(this + num)\n } else if (this.negative !== 0) {\n this.negative = 0;\n this.iadd(num);\n this.negative = 1;\n return this._normSign();\n }\n\n // At this point both numbers are positive\n var cmp = this.cmp(num);\n\n // Optimization - zeroify\n if (cmp === 0) {\n this.negative = 0;\n this.length = 1;\n this.words[0] = 0;\n return this;\n }\n\n // a > b\n var a, b;\n if (cmp > 0) {\n a = this;\n b = num;\n } else {\n a = num;\n b = this;\n }\n\n var carry = 0;\n for (var i = 0; i < b.length; i++) {\n r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n for (; carry !== 0 && i < a.length; i++) {\n r = (a.words[i] | 0) + carry;\n carry = r >> 26;\n this.words[i] = r & 0x3ffffff;\n }\n\n // Copy rest of the words\n if (carry === 0 && i < a.length && a !== this) {\n for (; i < a.length; i++) {\n this.words[i] = a.words[i];\n }\n }\n\n this.length = Math.max(this.length, i);\n\n if (a !== this) {\n this.negative = 1;\n }\n\n return this._strip();\n };\n\n // Subtract `num` from `this`\n BN.prototype.sub = function sub (num) {\n return this.clone().isub(num);\n };\n\n function smallMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n var len = (self.length + num.length) | 0;\n out.length = len;\n len = (len - 1) | 0;\n\n // Peel one iteration (compiler can't do it, because of code complexity)\n var a = self.words[0] | 0;\n var b = num.words[0] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n var carry = (r / 0x4000000) | 0;\n out.words[0] = lo;\n\n for (var k = 1; k < len; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = carry >>> 26;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = (k - j) | 0;\n a = self.words[i] | 0;\n b = num.words[j] | 0;\n r = a * b + rword;\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n if (carry !== 0) {\n out.words[k] = carry | 0;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n // TODO(indutny): it may be reasonable to omit it for users who don't need\n // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n // multiplication (like elliptic secp256k1).\n var comb10MulTo = function comb10MulTo (self, num, out) {\n var a = self.words;\n var b = num.words;\n var o = out.words;\n var c = 0;\n var lo;\n var mid;\n var hi;\n var a0 = a[0] | 0;\n var al0 = a0 & 0x1fff;\n var ah0 = a0 >>> 13;\n var a1 = a[1] | 0;\n var al1 = a1 & 0x1fff;\n var ah1 = a1 >>> 13;\n var a2 = a[2] | 0;\n var al2 = a2 & 0x1fff;\n var ah2 = a2 >>> 13;\n var a3 = a[3] | 0;\n var al3 = a3 & 0x1fff;\n var ah3 = a3 >>> 13;\n var a4 = a[4] | 0;\n var al4 = a4 & 0x1fff;\n var ah4 = a4 >>> 13;\n var a5 = a[5] | 0;\n var al5 = a5 & 0x1fff;\n var ah5 = a5 >>> 13;\n var a6 = a[6] | 0;\n var al6 = a6 & 0x1fff;\n var ah6 = a6 >>> 13;\n var a7 = a[7] | 0;\n var al7 = a7 & 0x1fff;\n var ah7 = a7 >>> 13;\n var a8 = a[8] | 0;\n var al8 = a8 & 0x1fff;\n var ah8 = a8 >>> 13;\n var a9 = a[9] | 0;\n var al9 = a9 & 0x1fff;\n var ah9 = a9 >>> 13;\n var b0 = b[0] | 0;\n var bl0 = b0 & 0x1fff;\n var bh0 = b0 >>> 13;\n var b1 = b[1] | 0;\n var bl1 = b1 & 0x1fff;\n var bh1 = b1 >>> 13;\n var b2 = b[2] | 0;\n var bl2 = b2 & 0x1fff;\n var bh2 = b2 >>> 13;\n var b3 = b[3] | 0;\n var bl3 = b3 & 0x1fff;\n var bh3 = b3 >>> 13;\n var b4 = b[4] | 0;\n var bl4 = b4 & 0x1fff;\n var bh4 = b4 >>> 13;\n var b5 = b[5] | 0;\n var bl5 = b5 & 0x1fff;\n var bh5 = b5 >>> 13;\n var b6 = b[6] | 0;\n var bl6 = b6 & 0x1fff;\n var bh6 = b6 >>> 13;\n var b7 = b[7] | 0;\n var bl7 = b7 & 0x1fff;\n var bh7 = b7 >>> 13;\n var b8 = b[8] | 0;\n var bl8 = b8 & 0x1fff;\n var bh8 = b8 >>> 13;\n var b9 = b[9] | 0;\n var bl9 = b9 & 0x1fff;\n var bh9 = b9 >>> 13;\n\n out.negative = self.negative ^ num.negative;\n out.length = 19;\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n if (c !== 0) {\n o[19] = c;\n out.length++;\n }\n return out;\n };\n\n // Polyfill comb\n if (!Math.imul) {\n comb10MulTo = smallMulTo;\n }\n\n function bigMulTo (self, num, out) {\n out.negative = num.negative ^ self.negative;\n out.length = self.length + num.length;\n\n var carry = 0;\n var hncarry = 0;\n for (var k = 0; k < out.length - 1; k++) {\n // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n // note that ncarry could be >= 0x3ffffff\n var ncarry = hncarry;\n hncarry = 0;\n var rword = carry & 0x3ffffff;\n var maxJ = Math.min(k, num.length - 1);\n for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n var i = k - j;\n var a = self.words[i] | 0;\n var b = num.words[j] | 0;\n var r = a * b;\n\n var lo = r & 0x3ffffff;\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n if (carry !== 0) {\n out.words[k] = carry;\n } else {\n out.length--;\n }\n\n return out._strip();\n }\n\n function jumboMulTo (self, num, out) {\n // Temporary disable, see https://github.com/indutny/bn.js/issues/211\n // var fftm = new FFTM();\n // return fftm.mulp(self, num, out);\n return bigMulTo(self, num, out);\n }\n\n BN.prototype.mulTo = function mulTo (num, out) {\n var res;\n var len = this.length + num.length;\n if (this.length === 10 && num.length === 10) {\n res = comb10MulTo(this, num, out);\n } else if (len < 63) {\n res = smallMulTo(this, num, out);\n } else if (len < 1024) {\n res = bigMulTo(this, num, out);\n } else {\n res = jumboMulTo(this, num, out);\n }\n\n return res;\n };\n\n // Cooley-Tukey algorithm for FFT\n // slightly revisited to rely on looping instead of recursion\n\n function FFTM (x, y) {\n this.x = x;\n this.y = y;\n }\n\n FFTM.prototype.makeRBT = function makeRBT (N) {\n var t = new Array(N);\n var l = BN.prototype._countBits(N) - 1;\n for (var i = 0; i < N; i++) {\n t[i] = this.revBin(i, l, N);\n }\n\n return t;\n };\n\n // Returns binary-reversed representation of `x`\n FFTM.prototype.revBin = function revBin (x, l, N) {\n if (x === 0 || x === N - 1) return x;\n\n var rb = 0;\n for (var i = 0; i < l; i++) {\n rb |= (x & 1) << (l - i - 1);\n x >>= 1;\n }\n\n return rb;\n };\n\n // Performs \"tweedling\" phase, therefore 'emulating'\n // behaviour of the recursive algorithm\n FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n for (var i = 0; i < N; i++) {\n rtws[i] = rws[rbt[i]];\n itws[i] = iws[rbt[i]];\n }\n };\n\n FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n this.permute(rbt, rws, iws, rtws, itws, N);\n\n for (var s = 1; s < N; s <<= 1) {\n var l = s << 1;\n\n var rtwdf = Math.cos(2 * Math.PI / l);\n var itwdf = Math.sin(2 * Math.PI / l);\n\n for (var p = 0; p < N; p += l) {\n var rtwdf_ = rtwdf;\n var itwdf_ = itwdf;\n\n for (var j = 0; j < s; j++) {\n var re = rtws[p + j];\n var ie = itws[p + j];\n\n var ro = rtws[p + j + s];\n var io = itws[p + j + s];\n\n var rx = rtwdf_ * ro - itwdf_ * io;\n\n io = rtwdf_ * io + itwdf_ * ro;\n ro = rx;\n\n rtws[p + j] = re + ro;\n itws[p + j] = ie + io;\n\n rtws[p + j + s] = re - ro;\n itws[p + j + s] = ie - io;\n\n /* jshint maxdepth : false */\n if (j !== l) {\n rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n rtwdf_ = rx;\n }\n }\n }\n }\n };\n\n FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n var N = Math.max(m, n) | 1;\n var odd = N & 1;\n var i = 0;\n for (N = N / 2 | 0; N; N = N >>> 1) {\n i++;\n }\n\n return 1 << i + 1 + odd;\n };\n\n FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n if (N <= 1) return;\n\n for (var i = 0; i < N / 2; i++) {\n var t = rws[i];\n\n rws[i] = rws[N - i - 1];\n rws[N - i - 1] = t;\n\n t = iws[i];\n\n iws[i] = -iws[N - i - 1];\n iws[N - i - 1] = -t;\n }\n };\n\n FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n var carry = 0;\n for (var i = 0; i < N / 2; i++) {\n var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n Math.round(ws[2 * i] / N) +\n carry;\n\n ws[i] = w & 0x3ffffff;\n\n if (w < 0x4000000) {\n carry = 0;\n } else {\n carry = w / 0x4000000 | 0;\n }\n }\n\n return ws;\n };\n\n FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n var carry = 0;\n for (var i = 0; i < len; i++) {\n carry = carry + (ws[i] | 0);\n\n rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n }\n\n // Pad with zeroes\n for (i = 2 * len; i < N; ++i) {\n rws[i] = 0;\n }\n\n assert(carry === 0);\n assert((carry & ~0x1fff) === 0);\n };\n\n FFTM.prototype.stub = function stub (N) {\n var ph = new Array(N);\n for (var i = 0; i < N; i++) {\n ph[i] = 0;\n }\n\n return ph;\n };\n\n FFTM.prototype.mulp = function mulp (x, y, out) {\n var N = 2 * this.guessLen13b(x.length, y.length);\n\n var rbt = this.makeRBT(N);\n\n var _ = this.stub(N);\n\n var rws = new Array(N);\n var rwst = new Array(N);\n var iwst = new Array(N);\n\n var nrws = new Array(N);\n var nrwst = new Array(N);\n var niwst = new Array(N);\n\n var rmws = out.words;\n rmws.length = N;\n\n this.convert13b(x.words, x.length, rws, N);\n this.convert13b(y.words, y.length, nrws, N);\n\n this.transform(rws, _, rwst, iwst, N, rbt);\n this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n for (var i = 0; i < N; i++) {\n var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n rwst[i] = rx;\n }\n\n this.conjugate(rwst, iwst, N);\n this.transform(rwst, iwst, rmws, _, N, rbt);\n this.conjugate(rmws, _, N);\n this.normalize13b(rmws, N);\n\n out.negative = x.negative ^ y.negative;\n out.length = x.length + y.length;\n return out._strip();\n };\n\n // Multiply `this` by `num`\n BN.prototype.mul = function mul (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return this.mulTo(num, out);\n };\n\n // Multiply employing FFT\n BN.prototype.mulf = function mulf (num) {\n var out = new BN(null);\n out.words = new Array(this.length + num.length);\n return jumboMulTo(this, num, out);\n };\n\n // In-place Multiplication\n BN.prototype.imul = function imul (num) {\n return this.clone().mulTo(num, this);\n };\n\n BN.prototype.imuln = function imuln (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n\n // Carry\n var carry = 0;\n for (var i = 0; i < this.length; i++) {\n var w = (this.words[i] | 0) * num;\n var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n // NOTE: lo is 27bit maximum\n carry += lo >>> 26;\n this.words[i] = lo & 0x3ffffff;\n }\n\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n if (num === 0) {\n this.length = 1;\n this._normSign();\n }\n\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.muln = function muln (num) {\n return this.clone().imuln(num);\n };\n\n // `this` * `this`\n BN.prototype.sqr = function sqr () {\n return this.mul(this);\n };\n\n // `this` * `this` in-place\n BN.prototype.isqr = function isqr () {\n return this.imul(this.clone());\n };\n\n // Math.pow(`this`, `num`)\n BN.prototype.pow = function pow (num) {\n var w = toBitArray(num);\n if (w.length === 0) return new BN(1);\n\n // Skip leading zeroes\n var res = this;\n for (var i = 0; i < w.length; i++, res = res.sqr()) {\n if (w[i] !== 0) break;\n }\n\n if (++i < w.length) {\n for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n if (w[i] === 0) continue;\n\n res = res.mul(q);\n }\n }\n\n return res;\n };\n\n // Shift-left in-place\n BN.prototype.iushln = function iushln (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n var i;\n\n if (r !== 0) {\n var carry = 0;\n\n for (i = 0; i < this.length; i++) {\n var newCarry = this.words[i] & carryMask;\n var c = ((this.words[i] | 0) - newCarry) << r;\n this.words[i] = c | carry;\n carry = newCarry >>> (26 - r);\n }\n\n if (carry) {\n this.words[i] = carry;\n this.length++;\n }\n }\n\n if (s !== 0) {\n for (i = this.length - 1; i >= 0; i--) {\n this.words[i + s] = this.words[i];\n }\n\n for (i = 0; i < s; i++) {\n this.words[i] = 0;\n }\n\n this.length += s;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishln = function ishln (bits) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushln(bits);\n };\n\n // Shift-right in-place\n // NOTE: `hint` is a lowest bit before trailing zeroes\n // NOTE: if `extended` is present - it will be filled with destroyed bits\n BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n assert(typeof bits === 'number' && bits >= 0);\n var h;\n if (hint) {\n h = (hint - (hint % 26)) / 26;\n } else {\n h = 0;\n }\n\n var r = bits % 26;\n var s = Math.min((bits - r) / 26, this.length);\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n var maskedWords = extended;\n\n h -= s;\n h = Math.max(0, h);\n\n // Extended mode, copy masked part\n if (maskedWords) {\n for (var i = 0; i < s; i++) {\n maskedWords.words[i] = this.words[i];\n }\n maskedWords.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all\n } else if (this.length > s) {\n this.length -= s;\n for (i = 0; i < this.length; i++) {\n this.words[i] = this.words[i + s];\n }\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n var carry = 0;\n for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n var word = this.words[i] | 0;\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n carry = word & mask;\n }\n\n // Push carried bits as a mask\n if (maskedWords && carry !== 0) {\n maskedWords.words[maskedWords.length++] = carry;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n // TODO(indutny): implement me\n assert(this.negative === 0);\n return this.iushrn(bits, hint, extended);\n };\n\n // Shift-left\n BN.prototype.shln = function shln (bits) {\n return this.clone().ishln(bits);\n };\n\n BN.prototype.ushln = function ushln (bits) {\n return this.clone().iushln(bits);\n };\n\n // Shift-right\n BN.prototype.shrn = function shrn (bits) {\n return this.clone().ishrn(bits);\n };\n\n BN.prototype.ushrn = function ushrn (bits) {\n return this.clone().iushrn(bits);\n };\n\n // Test if n bit is set\n BN.prototype.testn = function testn (bit) {\n assert(typeof bit === 'number' && bit >= 0);\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) return false;\n\n // Check bit and return\n var w = this.words[s];\n\n return !!(w & q);\n };\n\n // Return only lowers bits of number (in-place)\n BN.prototype.imaskn = function imaskn (bits) {\n assert(typeof bits === 'number' && bits >= 0);\n var r = bits % 26;\n var s = (bits - r) / 26;\n\n assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n if (this.length <= s) {\n return this;\n }\n\n if (r !== 0) {\n s++;\n }\n this.length = Math.min(s, this.length);\n\n if (r !== 0) {\n var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n this.words[this.length - 1] &= mask;\n }\n\n if (this.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n }\n\n return this._strip();\n };\n\n // Return only lowers bits of number\n BN.prototype.maskn = function maskn (bits) {\n return this.clone().imaskn(bits);\n };\n\n // Add plain number `num` to `this`\n BN.prototype.iaddn = function iaddn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.isubn(-num);\n\n // Possible sign change\n if (this.negative !== 0) {\n if (this.length === 1 && (this.words[0] | 0) <= num) {\n this.words[0] = num - (this.words[0] | 0);\n this.negative = 0;\n return this;\n }\n\n this.negative = 0;\n this.isubn(num);\n this.negative = 1;\n return this;\n }\n\n // Add without checks\n return this._iaddn(num);\n };\n\n BN.prototype._iaddn = function _iaddn (num) {\n this.words[0] += num;\n\n // Carry\n for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n if (i === this.length - 1) {\n this.words[i + 1] = 1;\n } else {\n this.words[i + 1]++;\n }\n }\n this.length = Math.max(this.length, i + 1);\n\n return this;\n };\n\n // Subtract plain number `num` from `this`\n BN.prototype.isubn = function isubn (num) {\n assert(typeof num === 'number');\n assert(num < 0x4000000);\n if (num < 0) return this.iaddn(-num);\n\n if (this.negative !== 0) {\n this.negative = 0;\n this.iaddn(num);\n this.negative = 1;\n return this;\n }\n\n this.words[0] -= num;\n\n if (this.length === 1 && this.words[0] < 0) {\n this.words[0] = -this.words[0];\n this.negative = 1;\n } else {\n // Carry\n for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n }\n\n return this._strip();\n };\n\n BN.prototype.addn = function addn (num) {\n return this.clone().iaddn(num);\n };\n\n BN.prototype.subn = function subn (num) {\n return this.clone().isubn(num);\n };\n\n BN.prototype.iabs = function iabs () {\n this.negative = 0;\n\n return this;\n };\n\n BN.prototype.abs = function abs () {\n return this.clone().iabs();\n };\n\n BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n var len = num.length + shift;\n var i;\n\n this._expand(len);\n\n var w;\n var carry = 0;\n for (i = 0; i < num.length; i++) {\n w = (this.words[i + shift] | 0) + carry;\n var right = (num.words[i] | 0) * mul;\n w -= right & 0x3ffffff;\n carry = (w >> 26) - ((right / 0x4000000) | 0);\n this.words[i + shift] = w & 0x3ffffff;\n }\n for (; i < this.length - shift; i++) {\n w = (this.words[i + shift] | 0) + carry;\n carry = w >> 26;\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0) return this._strip();\n\n // Subtraction overflow\n assert(carry === -1);\n carry = 0;\n for (i = 0; i < this.length; i++) {\n w = -(this.words[i] | 0) + carry;\n carry = w >> 26;\n this.words[i] = w & 0x3ffffff;\n }\n this.negative = 1;\n\n return this._strip();\n };\n\n BN.prototype._wordDiv = function _wordDiv (num, mode) {\n var shift = this.length - num.length;\n\n var a = this.clone();\n var b = num;\n\n // Normalize\n var bhi = b.words[b.length - 1] | 0;\n var bhiBits = this._countBits(bhi);\n shift = 26 - bhiBits;\n if (shift !== 0) {\n b = b.ushln(shift);\n a.iushln(shift);\n bhi = b.words[b.length - 1] | 0;\n }\n\n // Initialize quotient\n var m = a.length - b.length;\n var q;\n\n if (mode !== 'mod') {\n q = new BN(null);\n q.length = m + 1;\n q.words = new Array(q.length);\n for (var i = 0; i < q.length; i++) {\n q.words[i] = 0;\n }\n }\n\n var diff = a.clone()._ishlnsubmul(b, 1, m);\n if (diff.negative === 0) {\n a = diff;\n if (q) {\n q.words[m] = 1;\n }\n }\n\n for (var j = m - 1; j >= 0; j--) {\n var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n (a.words[b.length + j - 1] | 0);\n\n // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n // (0x7ffffff)\n qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n while (a.negative !== 0) {\n qj--;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n if (!a.isZero()) {\n a.negative ^= 1;\n }\n }\n if (q) {\n q.words[j] = qj;\n }\n }\n if (q) {\n q._strip();\n }\n a._strip();\n\n // Denormalize\n if (mode !== 'div' && shift !== 0) {\n a.iushrn(shift);\n }\n\n return {\n div: q || null,\n mod: a\n };\n };\n\n // NOTE: 1) `mode` can be set to `mod` to request mod only,\n // to `div` to request div only, or be absent to\n // request both div & mod\n // 2) `positive` is true if unsigned mod is requested\n BN.prototype.divmod = function divmod (num, mode, positive) {\n assert(!num.isZero());\n\n if (this.isZero()) {\n return {\n div: new BN(0),\n mod: new BN(0)\n };\n }\n\n var div, mod, res;\n if (this.negative !== 0 && num.negative === 0) {\n res = this.neg().divmod(num, mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.iadd(num);\n }\n }\n\n return {\n div: div,\n mod: mod\n };\n }\n\n if (this.negative === 0 && num.negative !== 0) {\n res = this.divmod(num.neg(), mode);\n\n if (mode !== 'mod') {\n div = res.div.neg();\n }\n\n return {\n div: div,\n mod: res.mod\n };\n }\n\n if ((this.negative & num.negative) !== 0) {\n res = this.neg().divmod(num.neg(), mode);\n\n if (mode !== 'div') {\n mod = res.mod.neg();\n if (positive && mod.negative !== 0) {\n mod.isub(num);\n }\n }\n\n return {\n div: res.div,\n mod: mod\n };\n }\n\n // Both numbers are positive at this point\n\n // Strip both numbers to approximate shift value\n if (num.length > this.length || this.cmp(num) < 0) {\n return {\n div: new BN(0),\n mod: this\n };\n }\n\n // Very short reduction\n if (num.length === 1) {\n if (mode === 'div') {\n return {\n div: this.divn(num.words[0]),\n mod: null\n };\n }\n\n if (mode === 'mod') {\n return {\n div: null,\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return {\n div: this.divn(num.words[0]),\n mod: new BN(this.modrn(num.words[0]))\n };\n }\n\n return this._wordDiv(num, mode);\n };\n\n // Find `this` / `num`\n BN.prototype.div = function div (num) {\n return this.divmod(num, 'div', false).div;\n };\n\n // Find `this` % `num`\n BN.prototype.mod = function mod (num) {\n return this.divmod(num, 'mod', false).mod;\n };\n\n BN.prototype.umod = function umod (num) {\n return this.divmod(num, 'mod', true).mod;\n };\n\n // Find Round(`this` / `num`)\n BN.prototype.divRound = function divRound (num) {\n var dm = this.divmod(num);\n\n // Fast case - exact division\n if (dm.mod.isZero()) return dm.div;\n\n var mod = dm.mod.abs();\n\n var half = num.abs().iushrn(1);\n var r2 = num.words[0] & 1;\n var cmp = mod.cmp(half);\n\n // Round down\n if (cmp < 0 || (r2 === 1 && cmp === 0)) return dm.div;\n\n // Round up, away from zero\n var up = new BN(1);\n up.negative = this.negative ^ num.negative;\n return dm.div.iadd(up);\n };\n\n BN.prototype.modrn = function modrn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n var p = (1 << 26) % num;\n\n var acc = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n acc = (p * acc + (this.words[i] | 0)) % num;\n }\n\n return isNegNum ? -acc : acc;\n };\n\n // WARNING: DEPRECATED\n BN.prototype.modn = function modn (num) {\n return this.modrn(num);\n };\n\n // In-place division by number\n BN.prototype.idivn = function idivn (num) {\n var isNegNum = num < 0;\n if (isNegNum) num = -num;\n\n assert(num <= 0x3ffffff);\n\n var carry = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var w = (this.words[i] | 0) + carry * 0x4000000;\n this.words[i] = (w / num) | 0;\n carry = w % num;\n }\n\n this._strip();\n return isNegNum ? this.ineg() : this;\n };\n\n BN.prototype.divn = function divn (num) {\n return this.clone().idivn(num);\n };\n\n BN.prototype.egcd = function egcd (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var x = this;\n var y = p.clone();\n\n if (x.negative !== 0) {\n x = x.umod(p);\n } else {\n x = x.clone();\n }\n\n // A * x + B * y = x\n var A = new BN(1);\n var B = new BN(0);\n\n // C * x + D * y = y\n var C = new BN(0);\n var D = new BN(1);\n\n var g = 0;\n\n while (x.isEven() && y.isEven()) {\n x.iushrn(1);\n y.iushrn(1);\n ++g;\n }\n\n var yp = y.clone();\n var xp = x.clone();\n\n while (!x.isZero()) {\n for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n x.iushrn(i);\n while (i-- > 0) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n y.iushrn(j);\n while (j-- > 0) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n return {\n a: C,\n b: D,\n gcd: y.iushln(g)\n };\n };\n\n // This is reduced incarnation of the binary EEA\n // above, designated to invert members of the\n // _prime_ fields F(p) at a maximal speed\n BN.prototype._invmp = function _invmp (p) {\n assert(p.negative === 0);\n assert(!p.isZero());\n\n var a = this;\n var b = p.clone();\n\n if (a.negative !== 0) {\n a = a.umod(p);\n } else {\n a = a.clone();\n }\n\n var x1 = new BN(1);\n var x2 = new BN(0);\n\n var delta = b.clone();\n\n while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n if (i > 0) {\n a.iushrn(i);\n while (i-- > 0) {\n if (x1.isOdd()) {\n x1.iadd(delta);\n }\n\n x1.iushrn(1);\n }\n }\n\n for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n if (j > 0) {\n b.iushrn(j);\n while (j-- > 0) {\n if (x2.isOdd()) {\n x2.iadd(delta);\n }\n\n x2.iushrn(1);\n }\n }\n\n if (a.cmp(b) >= 0) {\n a.isub(b);\n x1.isub(x2);\n } else {\n b.isub(a);\n x2.isub(x1);\n }\n }\n\n var res;\n if (a.cmpn(1) === 0) {\n res = x1;\n } else {\n res = x2;\n }\n\n if (res.cmpn(0) < 0) {\n res.iadd(p);\n }\n\n return res;\n };\n\n BN.prototype.gcd = function gcd (num) {\n if (this.isZero()) return num.abs();\n if (num.isZero()) return this.abs();\n\n var a = this.clone();\n var b = num.clone();\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two\n for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n a.iushrn(1);\n b.iushrn(1);\n }\n\n do {\n while (a.isEven()) {\n a.iushrn(1);\n }\n while (b.isEven()) {\n b.iushrn(1);\n }\n\n var r = a.cmp(b);\n if (r < 0) {\n // Swap `a` and `b` to make `a` always bigger than `b`\n var t = a;\n a = b;\n b = t;\n } else if (r === 0 || b.cmpn(1) === 0) {\n break;\n }\n\n a.isub(b);\n } while (true);\n\n return b.iushln(shift);\n };\n\n // Invert number in the field F(num)\n BN.prototype.invm = function invm (num) {\n return this.egcd(num).a.umod(num);\n };\n\n BN.prototype.isEven = function isEven () {\n return (this.words[0] & 1) === 0;\n };\n\n BN.prototype.isOdd = function isOdd () {\n return (this.words[0] & 1) === 1;\n };\n\n // And first word and num\n BN.prototype.andln = function andln (num) {\n return this.words[0] & num;\n };\n\n // Increment at the bit position in-line\n BN.prototype.bincn = function bincn (bit) {\n assert(typeof bit === 'number');\n var r = bit % 26;\n var s = (bit - r) / 26;\n var q = 1 << r;\n\n // Fast case: bit is much higher than all existing words\n if (this.length <= s) {\n this._expand(s + 1);\n this.words[s] |= q;\n return this;\n }\n\n // Add bit and propagate, if needed\n var carry = q;\n for (var i = s; carry !== 0 && i < this.length; i++) {\n var w = this.words[i] | 0;\n w += carry;\n carry = w >>> 26;\n w &= 0x3ffffff;\n this.words[i] = w;\n }\n if (carry !== 0) {\n this.words[i] = carry;\n this.length++;\n }\n return this;\n };\n\n BN.prototype.isZero = function isZero () {\n return this.length === 1 && this.words[0] === 0;\n };\n\n BN.prototype.cmpn = function cmpn (num) {\n var negative = num < 0;\n\n if (this.negative !== 0 && !negative) return -1;\n if (this.negative === 0 && negative) return 1;\n\n this._strip();\n\n var res;\n if (this.length > 1) {\n res = 1;\n } else {\n if (negative) {\n num = -num;\n }\n\n assert(num <= 0x3ffffff, 'Number is too big');\n\n var w = this.words[0] | 0;\n res = w === num ? 0 : w < num ? -1 : 1;\n }\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Compare two numbers and return:\n // 1 - if `this` > `num`\n // 0 - if `this` == `num`\n // -1 - if `this` < `num`\n BN.prototype.cmp = function cmp (num) {\n if (this.negative !== 0 && num.negative === 0) return -1;\n if (this.negative === 0 && num.negative !== 0) return 1;\n\n var res = this.ucmp(num);\n if (this.negative !== 0) return -res | 0;\n return res;\n };\n\n // Unsigned comparison\n BN.prototype.ucmp = function ucmp (num) {\n // At this point both numbers have the same sign\n if (this.length > num.length) return 1;\n if (this.length < num.length) return -1;\n\n var res = 0;\n for (var i = this.length - 1; i >= 0; i--) {\n var a = this.words[i] | 0;\n var b = num.words[i] | 0;\n\n if (a === b) continue;\n if (a < b) {\n res = -1;\n } else if (a > b) {\n res = 1;\n }\n break;\n }\n return res;\n };\n\n BN.prototype.gtn = function gtn (num) {\n return this.cmpn(num) === 1;\n };\n\n BN.prototype.gt = function gt (num) {\n return this.cmp(num) === 1;\n };\n\n BN.prototype.gten = function gten (num) {\n return this.cmpn(num) >= 0;\n };\n\n BN.prototype.gte = function gte (num) {\n return this.cmp(num) >= 0;\n };\n\n BN.prototype.ltn = function ltn (num) {\n return this.cmpn(num) === -1;\n };\n\n BN.prototype.lt = function lt (num) {\n return this.cmp(num) === -1;\n };\n\n BN.prototype.lten = function lten (num) {\n return this.cmpn(num) <= 0;\n };\n\n BN.prototype.lte = function lte (num) {\n return this.cmp(num) <= 0;\n };\n\n BN.prototype.eqn = function eqn (num) {\n return this.cmpn(num) === 0;\n };\n\n BN.prototype.eq = function eq (num) {\n return this.cmp(num) === 0;\n };\n\n //\n // A reduce context, could be using montgomery or something better, depending\n // on the `m` itself.\n //\n BN.red = function red (num) {\n return new Red(num);\n };\n\n BN.prototype.toRed = function toRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n assert(this.negative === 0, 'red works only with positives');\n return ctx.convertTo(this)._forceRed(ctx);\n };\n\n BN.prototype.fromRed = function fromRed () {\n assert(this.red, 'fromRed works only with numbers in reduction context');\n return this.red.convertFrom(this);\n };\n\n BN.prototype._forceRed = function _forceRed (ctx) {\n this.red = ctx;\n return this;\n };\n\n BN.prototype.forceRed = function forceRed (ctx) {\n assert(!this.red, 'Already a number in reduction context');\n return this._forceRed(ctx);\n };\n\n BN.prototype.redAdd = function redAdd (num) {\n assert(this.red, 'redAdd works only with red numbers');\n return this.red.add(this, num);\n };\n\n BN.prototype.redIAdd = function redIAdd (num) {\n assert(this.red, 'redIAdd works only with red numbers');\n return this.red.iadd(this, num);\n };\n\n BN.prototype.redSub = function redSub (num) {\n assert(this.red, 'redSub works only with red numbers');\n return this.red.sub(this, num);\n };\n\n BN.prototype.redISub = function redISub (num) {\n assert(this.red, 'redISub works only with red numbers');\n return this.red.isub(this, num);\n };\n\n BN.prototype.redShl = function redShl (num) {\n assert(this.red, 'redShl works only with red numbers');\n return this.red.shl(this, num);\n };\n\n BN.prototype.redMul = function redMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.mul(this, num);\n };\n\n BN.prototype.redIMul = function redIMul (num) {\n assert(this.red, 'redMul works only with red numbers');\n this.red._verify2(this, num);\n return this.red.imul(this, num);\n };\n\n BN.prototype.redSqr = function redSqr () {\n assert(this.red, 'redSqr works only with red numbers');\n this.red._verify1(this);\n return this.red.sqr(this);\n };\n\n BN.prototype.redISqr = function redISqr () {\n assert(this.red, 'redISqr works only with red numbers');\n this.red._verify1(this);\n return this.red.isqr(this);\n };\n\n // Square root over p\n BN.prototype.redSqrt = function redSqrt () {\n assert(this.red, 'redSqrt works only with red numbers');\n this.red._verify1(this);\n return this.red.sqrt(this);\n };\n\n BN.prototype.redInvm = function redInvm () {\n assert(this.red, 'redInvm works only with red numbers');\n this.red._verify1(this);\n return this.red.invm(this);\n };\n\n // Return negative clone of `this` % `red modulo`\n BN.prototype.redNeg = function redNeg () {\n assert(this.red, 'redNeg works only with red numbers');\n this.red._verify1(this);\n return this.red.neg(this);\n };\n\n BN.prototype.redPow = function redPow (num) {\n assert(this.red && !num.red, 'redPow(normalNum)');\n this.red._verify1(this);\n return this.red.pow(this, num);\n };\n\n // Prime numbers with efficient reduction\n var primes = {\n k256: null,\n p224: null,\n p192: null,\n p25519: null\n };\n\n // Pseudo-Mersenne prime\n function MPrime (name, p) {\n // P = 2 ^ N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = new BN(1).iushln(this.n).isub(this.p);\n\n this.tmp = this._tmp();\n }\n\n MPrime.prototype._tmp = function _tmp () {\n var tmp = new BN(null);\n tmp.words = new Array(Math.ceil(this.n / 13));\n return tmp;\n };\n\n MPrime.prototype.ireduce = function ireduce (num) {\n // Assumes that `num` is less than `P^2`\n // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n var r = num;\n var rlen;\n\n do {\n this.split(r, this.tmp);\n r = this.imulK(r);\n r = r.iadd(this.tmp);\n rlen = r.bitLength();\n } while (rlen > this.n);\n\n var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n if (cmp === 0) {\n r.words[0] = 0;\n r.length = 1;\n } else if (cmp > 0) {\n r.isub(this.p);\n } else {\n if (r.strip !== undefined) {\n // r is a BN v4 instance\n r.strip();\n } else {\n // r is a BN v5 instance\n r._strip();\n }\n }\n\n return r;\n };\n\n MPrime.prototype.split = function split (input, out) {\n input.iushrn(this.n, 0, out);\n };\n\n MPrime.prototype.imulK = function imulK (num) {\n return num.imul(this.k);\n };\n\n function K256 () {\n MPrime.call(\n this,\n 'k256',\n 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n }\n inherits(K256, MPrime);\n\n K256.prototype.split = function split (input, output) {\n // 256 = 9 * 26 + 22\n var mask = 0x3fffff;\n\n var outLen = Math.min(input.length, 9);\n for (var i = 0; i < outLen; i++) {\n output.words[i] = input.words[i];\n }\n output.length = outLen;\n\n if (input.length <= 9) {\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs\n var prev = input.words[9];\n output.words[output.length++] = prev & mask;\n\n for (i = 10; i < input.length; i++) {\n var next = input.words[i] | 0;\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n prev = next;\n }\n prev >>>= 22;\n input.words[i - 10] = prev;\n if (prev === 0 && input.length > 10) {\n input.length -= 10;\n } else {\n input.length -= 9;\n }\n };\n\n K256.prototype.imulK = function imulK (num) {\n // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n num.words[num.length] = 0;\n num.words[num.length + 1] = 0;\n num.length += 2;\n\n // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n var lo = 0;\n for (var i = 0; i < num.length; i++) {\n var w = num.words[i] | 0;\n lo += w * 0x3d1;\n num.words[i] = lo & 0x3ffffff;\n lo = w * 0x40 + ((lo / 0x4000000) | 0);\n }\n\n // Fast length reduction\n if (num.words[num.length - 1] === 0) {\n num.length--;\n if (num.words[num.length - 1] === 0) {\n num.length--;\n }\n }\n return num;\n };\n\n function P224 () {\n MPrime.call(\n this,\n 'p224',\n 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n }\n inherits(P224, MPrime);\n\n function P192 () {\n MPrime.call(\n this,\n 'p192',\n 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n }\n inherits(P192, MPrime);\n\n function P25519 () {\n // 2 ^ 255 - 19\n MPrime.call(\n this,\n '25519',\n '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n }\n inherits(P25519, MPrime);\n\n P25519.prototype.imulK = function imulK (num) {\n // K = 0x13\n var carry = 0;\n for (var i = 0; i < num.length; i++) {\n var hi = (num.words[i] | 0) * 0x13 + carry;\n var lo = hi & 0x3ffffff;\n hi >>>= 26;\n\n num.words[i] = lo;\n carry = hi;\n }\n if (carry !== 0) {\n num.words[num.length++] = carry;\n }\n return num;\n };\n\n // Exported mostly for testing purposes, use plain name instead\n BN._prime = function prime (name) {\n // Cached version of prime\n if (primes[name]) return primes[name];\n\n var prime;\n if (name === 'k256') {\n prime = new K256();\n } else if (name === 'p224') {\n prime = new P224();\n } else if (name === 'p192') {\n prime = new P192();\n } else if (name === 'p25519') {\n prime = new P25519();\n } else {\n throw new Error('Unknown prime ' + name);\n }\n primes[name] = prime;\n\n return prime;\n };\n\n //\n // Base reduction engine\n //\n function Red (m) {\n if (typeof m === 'string') {\n var prime = BN._prime(m);\n this.m = prime.p;\n this.prime = prime;\n } else {\n assert(m.gtn(1), 'modulus must be greater than 1');\n this.m = m;\n this.prime = null;\n }\n }\n\n Red.prototype._verify1 = function _verify1 (a) {\n assert(a.negative === 0, 'red works only with positives');\n assert(a.red, 'red works only with red numbers');\n };\n\n Red.prototype._verify2 = function _verify2 (a, b) {\n assert((a.negative | b.negative) === 0, 'red works only with positives');\n assert(a.red && a.red === b.red,\n 'red works only with red numbers');\n };\n\n Red.prototype.imod = function imod (a) {\n if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n\n move(a, a.umod(this.m)._forceRed(this));\n return a;\n };\n\n Red.prototype.neg = function neg (a) {\n if (a.isZero()) {\n return a.clone();\n }\n\n return this.m.sub(a)._forceRed(this);\n };\n\n Red.prototype.add = function add (a, b) {\n this._verify2(a, b);\n\n var res = a.add(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.iadd = function iadd (a, b) {\n this._verify2(a, b);\n\n var res = a.iadd(b);\n if (res.cmp(this.m) >= 0) {\n res.isub(this.m);\n }\n return res;\n };\n\n Red.prototype.sub = function sub (a, b) {\n this._verify2(a, b);\n\n var res = a.sub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res._forceRed(this);\n };\n\n Red.prototype.isub = function isub (a, b) {\n this._verify2(a, b);\n\n var res = a.isub(b);\n if (res.cmpn(0) < 0) {\n res.iadd(this.m);\n }\n return res;\n };\n\n Red.prototype.shl = function shl (a, num) {\n this._verify1(a);\n return this.imod(a.ushln(num));\n };\n\n Red.prototype.imul = function imul (a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n };\n\n Red.prototype.mul = function mul (a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n };\n\n Red.prototype.isqr = function isqr (a) {\n return this.imul(a, a.clone());\n };\n\n Red.prototype.sqr = function sqr (a) {\n return this.mul(a, a);\n };\n\n Red.prototype.sqrt = function sqrt (a) {\n if (a.isZero()) return a.clone();\n\n var mod3 = this.m.andln(3);\n assert(mod3 % 2 === 1);\n\n // Fast case\n if (mod3 === 3) {\n var pow = this.m.add(new BN(1)).iushrn(2);\n return this.pow(a, pow);\n }\n\n // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n //\n // Find Q and S, that Q * 2 ^ S = (P - 1)\n var q = this.m.subn(1);\n var s = 0;\n while (!q.isZero() && q.andln(1) === 0) {\n s++;\n q.iushrn(1);\n }\n assert(!q.isZero());\n\n var one = new BN(1).toRed(this);\n var nOne = one.redNeg();\n\n // Find quadratic non-residue\n // NOTE: Max is such because of generalized Riemann hypothesis.\n var lpow = this.m.subn(1).iushrn(1);\n var z = this.m.bitLength();\n z = new BN(2 * z * z).toRed(this);\n\n while (this.pow(z, lpow).cmp(nOne) !== 0) {\n z.redIAdd(nOne);\n }\n\n var c = this.pow(z, q);\n var r = this.pow(a, q.addn(1).iushrn(1));\n var t = this.pow(a, q);\n var m = s;\n while (t.cmp(one) !== 0) {\n var tmp = t;\n for (var i = 0; tmp.cmp(one) !== 0; i++) {\n tmp = tmp.redSqr();\n }\n assert(i < m);\n var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n r = r.redMul(b);\n c = b.redSqr();\n t = t.redMul(c);\n m = i;\n }\n\n return r;\n };\n\n Red.prototype.invm = function invm (a) {\n var inv = a._invmp(this.m);\n if (inv.negative !== 0) {\n inv.negative = 0;\n return this.imod(inv).redNeg();\n } else {\n return this.imod(inv);\n }\n };\n\n Red.prototype.pow = function pow (a, num) {\n if (num.isZero()) return new BN(1).toRed(this);\n if (num.cmpn(1) === 0) return a.clone();\n\n var windowSize = 4;\n var wnd = new Array(1 << windowSize);\n wnd[0] = new BN(1).toRed(this);\n wnd[1] = a;\n for (var i = 2; i < wnd.length; i++) {\n wnd[i] = this.mul(wnd[i - 1], a);\n }\n\n var res = wnd[0];\n var current = 0;\n var currentLen = 0;\n var start = num.bitLength() % 26;\n if (start === 0) {\n start = 26;\n }\n\n for (i = num.length - 1; i >= 0; i--) {\n var word = num.words[i];\n for (var j = start - 1; j >= 0; j--) {\n var bit = (word >> j) & 1;\n if (res !== wnd[0]) {\n res = this.sqr(res);\n }\n\n if (bit === 0 && current === 0) {\n currentLen = 0;\n continue;\n }\n\n current <<= 1;\n current |= bit;\n currentLen++;\n if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n res = this.mul(res, wnd[current]);\n currentLen = 0;\n current = 0;\n }\n start = 26;\n }\n\n return res;\n };\n\n Red.prototype.convertTo = function convertTo (num) {\n var r = num.umod(this.m);\n\n return r === num ? r.clone() : r;\n };\n\n Red.prototype.convertFrom = function convertFrom (num) {\n var res = num.clone();\n res.red = null;\n return res;\n };\n\n //\n // Montgomery method engine\n //\n\n BN.mont = function mont (num) {\n return new Mont(num);\n };\n\n function Mont (m) {\n Red.call(this, m);\n\n this.shift = this.m.bitLength();\n if (this.shift % 26 !== 0) {\n this.shift += 26 - (this.shift % 26);\n }\n\n this.r = new BN(1).iushln(this.shift);\n this.r2 = this.imod(this.r.sqr());\n this.rinv = this.r._invmp(this.m);\n\n this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n this.minv = this.minv.umod(this.r);\n this.minv = this.r.sub(this.minv);\n }\n inherits(Mont, Red);\n\n Mont.prototype.convertTo = function convertTo (num) {\n return this.imod(num.ushln(this.shift));\n };\n\n Mont.prototype.convertFrom = function convertFrom (num) {\n var r = this.imod(num.mul(this.rinv));\n r.red = null;\n return r;\n };\n\n Mont.prototype.imul = function imul (a, b) {\n if (a.isZero() || b.isZero()) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n var t = a.imul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.mul = function mul (a, b) {\n if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n var t = a.mul(b);\n var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n var u = t.isub(c).iushrn(this.shift);\n var res = u;\n if (u.cmp(this.m) >= 0) {\n res = u.isub(this.m);\n } else if (u.cmpn(0) < 0) {\n res = u.iadd(this.m);\n }\n\n return res._forceRed(this);\n };\n\n Mont.prototype.invm = function invm (a) {\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n var res = this.imod(a._invmp(this.m).mul(this.r2));\n return res._forceRed(this);\n };\n})(typeof module === 'undefined' || module, this);\n","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map","import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map","/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return new Uint8Array(result);\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return new Uint8Array(result);\n }\n if (isBytes(value)) {\n return new Uint8Array(value);\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map","\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { isBytes, hexlify, isHexString, } from \"../utils/data.js\";\nvar BN = _BN.BN;\nconst logger = new Logger(\"bigNumber/0.0.1\");\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null &&\n (BigNumber.isBigNumber(value) ||\n (typeof value === \"number\" && value % 1 === 0) ||\n (typeof value === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n typeof value === \"bigint\" ||\n isBytes(value)));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n _hex;\n _isBigNumber;\n constructor(constructorGuard, hex) {\n logger.checkNew(new.target, BigNumber);\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\",\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division by zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return this._hex[0] === \"-\";\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n // @ts-ignore\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString(),\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof value === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof value === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof anyValue === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof hex === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof hex === \"string\") {\n if (isHexString(hex) ||\n (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\n// @ts-ignore\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof value !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\n// @ts-ignore\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\n// @ts-ignore\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return new BN(\"-\" + hex.substring(3), 16);\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return new BN(value, 36).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return new BN(value, 16).toString(36);\n}\n//# sourceMappingURL=bigNumber.js.map","\"use strict\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify, isBytesLike } from \"../utils/data.js\";\nconst logger = new Logger(\"rlp/0.0.1\");\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return 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 _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 if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(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}\nexport function encode(object) {\n return hexlify(_encode(object));\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 if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: 1 + length, result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\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 if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: 1 + length, result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=rlp.js.map","const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();\nconst _32n = /* @__PURE__ */ BigInt(32);\n// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high\n// }` to match little-endian word order rather than the property names.\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array\n// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS\n// bitwise results back to uint32 first, and little-endian callers must swap.\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers\n// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below\n// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes).\nconst fromNumH = (n) => (n / 2 ** 32) | 0;\nconst fromNumL = (n) => n >>> 0;\n// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call\n// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`.\nfunction setU64FromNum(view, byteOffset, n, isLE) {\n const h = fromNumH(n);\n const l = fromNumL(n);\n view.setUint32(byteOffset, isLE ? l : h, isLE);\n view.setUint32(byteOffset + 4, isLE ? h : l, isLE);\n}\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s) => h >>> s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.\nconst rotr32H = (_h, l) => l;\n// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.\nconst rotr32L = (h, _l) => h;\n// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps\n// local copies so V8 inlines them into keccakP.\n// Add two split 64-bit words and return the split `{ h, l }` sum.\n// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out\n// of the low sum and instead use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\n// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\n// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\n// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, fromNumH, fromNumL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, setU64FromNum, shrSH, shrSL, split, toBig };\n","/**\n * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.\n * @param a - value to test\n * @returns `true` when the value is a Uint8Array-compatible view.\n * @example\n * Check whether a value is a Uint8Array-compatible view.\n * ```ts\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n// Shared error-message prefix builder. Only called on throw paths, so assert\n// success paths never pay for the string concatenation.\nconst atitle = (title) => (title ? `\"${title}\" ` : '');\n/**\n * Asserts something is a non-negative integer.\n * @param n - number to validate\n * @param title - label included in thrown errors\n * @returns The validated number.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a non-negative integer option.\n * ```ts\n * anumber(32, 'length');\n * ```\n */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number')\n throw new TypeError(atitle(title) + 'expected number, got ' + typeof n);\n if (!Number.isSafeInteger(n) || n < 0)\n throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n);\n return n;\n}\n/**\n * Asserts something is a boolean.\n * @param value - value to validate\n * @param title - label included in thrown errors\n * @returns The validated boolean.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a boolean option.\n * ```ts\n * abool(true, 'enableXOF');\n * ```\n */\nexport function abool(value, title = '') {\n if (typeof value !== 'boolean')\n throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);\n return value;\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - value to validate\n * @param length - optional exact length constraint\n * @param title - label included in thrown errors\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate that a value is a byte array.\n * ```ts\n * abytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function abytes(value, length, title = '') {\n // Success path first: this runs at the start of every update() / digestInto(), and the\n // common `abytes(data)` form must not pay for length handling it does not use.\n if (isBytes(value) && (length === undefined || value.length === length))\n return value;\n // Error path: recompute freely to build the exact message.\n if (length !== undefined)\n anumber(length, 'length');\n const bytes = isBytes(value);\n const ofLen = length !== undefined ? ` of length ${length}` : '';\n const got = bytes ? `length=${value.length}` : `type=${typeof value}`;\n const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Asserts something is a wrapped hash constructor.\n * @param h - hash constructor to validate\n * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}\n * @throws On invalid hash metadata ranges or values. {@link RangeError}\n * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}\n * @example\n * Validate a callable hash wrapper.\n * ```ts\n * import { ahash } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('expected hash wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1 || h.blockLen < 1)\n throw new Error('hash blockLen / outputLen must be >= 1');\n}\nconst aobject = (value, label) => {\n if (value === null || typeof value !== 'object' || Array.isArray(value))\n throw new TypeError((label === 'object' ? '' : `\"${label}\" `) + 'expected object, got type=' + typeof value);\n};\nconst aopts = (value, label) => {\n aobject(value, label);\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null)\n throw new TypeError(`\"${label}\" expected plain object`);\n // Object.assign() treats an own \"__proto__\" source key as a write to the target's legacy\n // prototype setter. Reject it before merging so inherited option values cannot be injected.\n if (Object.hasOwn(value, '__proto__'))\n throw new TypeError(`\"${label}.__proto__\" is not allowed`);\n};\n/**\n * Asserts a hash instance has not been destroyed or finished.\n * @param instance - hash instance to validate\n * @param checkFinished - whether to reject finalized instances\n * @throws If the hash instance has already been destroyed or finalized. {@link Error}\n * @example\n * Validate that a hash instance is still usable.\n * ```ts\n * import { aexists } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aexists(hash);\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their\n // truthiness is checked - re-validating their type per call was pure hot-path overhead.\n if (instance.destroyed)\n throw new Error('hash was destroyed');\n if (checkFinished && instance.finished)\n throw new Error('digest() was already called');\n}\n/**\n * Asserts output is a sufficiently-sized byte array.\n * @param out - destination buffer\n * @param instance - hash instance providing output length\n * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a caller-provided digest buffer.\n * ```ts\n * import { aoutput } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aoutput(new Uint8Array(hash.outputLen), hash);\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast\n // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call.\n const min = instance.outputLen;\n if (!(out.length >= min)) {\n throw new RangeError('\"output\" expected length >= ' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed array view to Uint32Array.\n * `arr.byteOffset` must already be 4-byte aligned or the platform\n * Uint32Array constructor will throw.\n * @param arr - source typed array\n * @returns Uint32Array view over the same buffer.\n * @example\n * Reinterpret a byte array as 32-bit words.\n * ```ts\n * u32(new Uint8Array(8));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Zeroizes typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros\n * @example\n * Zeroize sensitive buffers in place.\n * ```ts\n * clean(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/**\n * Creates a DataView for byte-level manipulation.\n * @param arr - source typed array\n * @returns DataView over the same buffer region.\n * @example\n * Create a DataView over an existing buffer.\n * ```ts\n * createView(new Uint8Array(4));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Rotate-right operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the right.\n * ```ts\n * rotr(0x12345678, 8);\n * ```\n */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Rotate-left operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the left.\n * ```ts\n * rotl(0x12345678, 8);\n * ```\n */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/**\n * Byte-swap operation for uint32 values.\n * @param word - source word\n * @returns Word with reversed byte order.\n * @example\n * Reverse the byte order of a 32-bit word.\n * ```ts\n * byteSwap(0x11223344);\n * ```\n */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\n/**\n * Byte-swaps every word of a Uint32Array in place.\n * @param arr - array to mutate\n * @returns The same array after mutation; callers pass live state arrays here.\n * @example\n * Reverse the byte order of every word in place.\n * ```ts\n * byteSwap32(new Uint32Array([0x11223344]));\n * ```\n */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n/**\n * Conditionally byte-swaps a Uint32Array on big-endian platforms.\n * @param u - array to normalize for host endianness\n * @returns Original or byte-swapped array depending on platform endianness.\n * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.\n * @example\n * Normalize a word array for host endianness.\n * ```ts\n * swap32IfBE(new Uint32Array([0x11223344]));\n * ```\n */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\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}\n// Strict ASCII nibble parser: non-ASCII hex lookalikes are rejected as undefined.\n// ASCII codes: '0'..'9' = 48..57, 'A'..'F' = 65..70, 'a'..'f' = 97..102.\n// prettier-ignore\nfunction asciiToBase16(ch) {\n return ch >= 48 && ch <= 57 ? ch - 48 // '2' => 50-48\n : ch >= 65 && ch <= 70 ? ch - (65 - 10) // 'B' => 66-(65-10)\n : ch >= 97 && ch <= 102 ? ch - (97 - 10) // 'b' => 98-(97-10)\n : undefined;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi)); // parse first char, multiply it by 16\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); // parse second char\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // example: 'A9' => 10*16 + 9\n }\n return array;\n}\n/**\n * Yields to the host task scheduler so timers, I/O, and rendering can make progress.\n * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback.\n * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so\n * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while\n * still allowing other event-loop work to proceed.\n * @param onReject - optional cleanup invoked only if the host yield fails\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport function nextTick(onReject) {\n const host = globalThis;\n if (typeof host.scheduler?.yield === 'function') {\n const promise = host.scheduler.yield();\n // Keep the original scheduler rejection; this handler exists only for cleanup.\n if (onReject)\n promise.catch(onReject);\n return promise;\n }\n return new Promise((resolve) => host.setTimeout(resolve, 0));\n}\n/**\n * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @param onReject - optional cleanup invoked only if a host yield fails\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb, onReject) {\n anumber(iters, 'iters');\n anumber(tick, 'tick');\n if (typeof cb !== 'function')\n throw new TypeError('callback must be a function');\n // Callback is synchronous by contract; asyncLoop only yields between sync work windows.\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick(onReject);\n // Track only synchronous work time; scheduler delay after yielding is outside our budget.\n ts = Date.now();\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n const encoded = new TextEncoder().encode(str);\n try {\n // Copy into the current realm for Firefox extension contexts. Callers that own the returned\n // buffer can then wipe it independently of TextEncoder's temporary result.\n return new Uint8Array(encoded); // https://bugzil.la/1681809\n }\n finally {\n clean(encoded);\n }\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Validates declared required and optional field types on a plain object.\n * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct\n * one-line guards such as `abytes()`, `abool()`, or `anumber()` instead.\n * @param object - object to validate\n * @param fields - map of required field names to expected types\n * @param optFields - map of optional field names to expected types\n * @param title - label included in thrown errors\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate required and optional option fields.\n * ```ts\n * validateObject({ N: 1024, dkLen: 32 }, { N: 'number' }, { dkLen: 'number' });\n * ```\n */\nexport const validateObject = (object, fields = {}, optFields = {}, title = 'object') => {\n aobject(object, title);\n aobject(fields, 'fields');\n aobject(optFields, 'optFields');\n function checkField(fieldName, expectedType, isOpt) {\n const label = title === 'object' ? `param \"${String(fieldName)}\"` : `\"${title}.${String(fieldName)}\"`;\n // Config fields must be explicit own properties. Optional inherited values are rejected too\n // because callers keep reading the same options object after validation.\n const val = object[fieldName];\n // Runtime objects such as Field instances intentionally satisfy required method slots\n // via their shared prototype.\n if (!Object.hasOwn(object, fieldName) &&\n (isOpt ? val !== undefined : expectedType !== 'function')) {\n throw new TypeError(`${label} is invalid: expected own property`);\n }\n if (isOpt && val === undefined)\n return;\n const current = typeof val;\n if (current !== expectedType || val === null)\n throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);\n }\n const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));\n iter(fields, false);\n iter(optFields, true);\n};\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @param title - label included in thrown override errors\n * @returns Fresh merged option object with a null prototype.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts, title = 'opts') {\n aopts(defaults, 'defaults');\n if (opts !== undefined)\n aopts(opts, title);\n // Callers read optional fields directly, so omitted values must not fall through to ambient\n // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).\n const merged = Object.assign(Object.create(null), defaults, opts);\n return merged;\n}\n/**\n * Creates a callable hash function from a stateful class constructor.\n * @param hashCons - hash constructor or factory\n * @param info - optional metadata such as DER OID\n * @returns Frozen callable hash wrapper with `.create()`.\n * Wrapper construction eagerly calls `hashCons(undefined)` once to read\n * `outputLen` / `blockLen`, so constructor side effects happen at module\n * init time.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Wrap a stateful hash constructor into a callable helper.\n * ```ts\n * import { createHasher } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const wrapped = createHasher(sha256.create, { oid: sha256.oid });\n * wrapped(new Uint8Array([1]));\n * ```\n */\nexport function createHasher(hashCons, info = {}) {\n if (typeof hashCons !== 'function')\n throw new TypeError('\"hashCons\" expected function, got type=' + typeof hashCons);\n info = checkOpts({}, info, 'info');\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.canXOF = tmp.canXOF;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 §10.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.\n * @param suffix - final OID byte for the selected hash.\n * The helper accepts any byte even though only the documented NIST hash\n * suffixes are meaningful downstream.\n * @returns Object containing the DER-encoded OID.\n * @example\n * Build OID metadata for a NIST hash.\n * ```ts\n * oidNist(0x01);\n * ```\n */\nexport const oidNist = (suffix) => ({\n // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.\n // Larger suffix values would need base-128 OID encoding and a different length byte.\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { setU64FromNum } from \"./_u64.js\";\nimport { abytes, aexists, aoutput, createView } from \"./utils.js\";\n/**\n * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.\n * Returns bits from `b` when `a` is set, otherwise from `c`.\n * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never\n * set the same bit.\n * @param a - selector word\n * @param b - word chosen when selector bit is set\n * @param c - word chosen when selector bit is clear\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit choice primitive.\n * ```ts\n * Chi(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/**\n * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.\n * Returns bits shared by at least two inputs.\n * @param a - first input word\n * @param b - second input word\n * @param c - third input word\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit majority primitive.\n * ```ts\n * Maj(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit\n * strings with partial-byte tails.\n * @param blockLen - internal block size in bytes\n * @param outputLen - digest size in bytes\n * @param padOffset - trailing length field size in bytes\n * @param isLE - whether length and state words are encoded in little-endian\n * @example\n * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.\n * ```ts\n * import { _SHA1 } from '@noble/hashes/legacy.js';\n * const hash = new _SHA1();\n * hash.update(new Uint8Array([97, 98, 99]));\n * hash.digest();\n * ```\n */\nexport class HashMD {\n blockLen;\n outputLen;\n canXOF = false;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n let processed = false;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path only when there is no buffered partial block: `take === blockLen` implies\n // `this.pos === 0`, so we can process full blocks directly from the input view.\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n processed = true;\n continue;\n }\n // When the whole input is buffered in one go (common for short messages), passing `data`\n // directly avoids allocating a subarray view.\n buffer.set(pos === 0 && take === len ? data : 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 processed = true;\n }\n }\n this.length += data.length;\n // Shared schedule buffers only pick up input-derived words inside process(); if everything\n // was buffered without processing, there is nothing to zero.\n if (processed)\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(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, then zero-pad the rest of the block\n buffer[pos++] = 0b10000000;\n buffer.fill(0, pos);\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n buffer.fill(0);\n }\n // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from\n // the padding fill above, and JS will overflow before user input can make that half non-zero.\n // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an\n // integer below 2**53, so the split inside the helper stays exact).\n setU64FromNum(view, blockLen - 8, this.length * 8, isLE);\n this.process(view, 0);\n // The final block above is processed outside update(), so the shared message-schedule\n // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest().\n this.roundClean();\n // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.\n const oview = out === buffer ? view : createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n const outLen = len / 4;\n const state = this.get();\n // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state.\n if (len % 4 || outLen > state.length)\n throw new Error('invalid outputLen');\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 // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return\n // fresh bytes to the caller.\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneIntoMeta(to) {\n const { buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and\n // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it.\n if (pos)\n to.buffer.set(buffer); // Avoid a hot modulo guard.\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the\n * square roots of the first eight prime numbers. Exported as a shared table; callers must treat\n * it as read-only because constructors copy words from it by index. */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state `H(0)` from RFC 6234 §6.1. Exported as a shared table; callers must\n * treat it as read-only because constructors copy words from it by index. */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the ninth\n * through sixteenth prime numbers. Exported as a shared table; callers must treat it as read-only\n * because constructors copy halves from it by index. */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first\n * eight prime numbers. Exported as a shared table; callers must treat it as read-only because\n * constructors copy halves from it by index. */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n","/**\n\nSHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions.\nRFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors,\nnot the base RIPEMD-160 compression spec.\nDon't use them in a new protocol. What \"weak\" means:\n\n- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.\n- No practical pre-image attacks (only theoretical, 2^123.4)\n- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151\n * @module\n */\nimport { Chi, HashMD, Maj } from \"./_md.js\";\nimport { clean, createHasher, rotl } from \"./utils.js\";\n/** Initial SHA-1 state from RFC 3174 §6.1. */\nconst SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\n// Reusable 80-word SHA-1 message schedule buffer.\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA1 legacy hash class. */\nexport class _SHA1 extends HashMD {\n A = SHA1_IV[0] | 0;\n B = SHA1_IV[1] | 0;\n C = SHA1_IV[2] | 0;\n D = SHA1_IV[3] | 0;\n E = SHA1_IV[4] | 0;\n constructor() {\n super(64, 20, 8, false);\n }\n get() {\n const { A, B, C, D, E } = this;\n return [A, B, C, D, E];\n }\n set(A, B, C, D, E) {\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 }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n SHA1_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 80; i++)\n SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n // Compression function main loop, 80 rounds\n let { A, B, C, D, E } = this;\n for (let i = 0; i < 80; i++) {\n let F, K;\n if (i < 20) {\n F = Chi(B, C, D);\n K = 0x5a827999;\n }\n else if (i < 40) {\n F = B ^ C ^ D;\n K = 0x6ed9eba1;\n }\n else if (i < 60) {\n F = Maj(B, C, D);\n K = 0x8f1bbcdc;\n }\n else {\n F = B ^ C ^ D;\n K = 0xca62c1d6;\n }\n const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0;\n E = D;\n D = C;\n C = rotl(B, 30);\n B = A;\n A = T;\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 this.set(A, B, C, D, E);\n }\n roundClean() {\n clean(SHA1_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA1.\n * ```ts\n * sha1(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha1 = /* @__PURE__ */ createHasher(() => new _SHA1());\n/** RFC 1321 `T[i]` uses `floor(2^32 * abs(sin(i)))`; this is the shared `2^32` scale factor. */\nconst p32 = /* @__PURE__ */ Math.pow(2, 32);\n/** RFC 1321 `T[1..64]` table. */\nconst K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));\n/** MD5 initial state from RFC 1321, stored as 4 u32 words. */\nconst MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);\n// Reusable 16-word MD5 message block buffer.\nconst MD5_W = /* @__PURE__ */ new Uint32Array(16);\n// RFC 1321 §3.4 per-round rotate amounts, flattened to 64 entries so the round loop\n// avoids allocating a 4-element array literal every round (measured ~5% of md5).\nconst MD5_SHIFTS = /* @__PURE__ */ (() => {\n const S = [\n [7, 12, 17, 22],\n [5, 9, 14, 20],\n [4, 11, 16, 23],\n [6, 10, 15, 21],\n ];\n return Uint8Array.from({ length: 64 }, (_, i) => S[Math.floor(i / 16)][i % 4]);\n})();\n/** Internal MD5 legacy hash class. */\nexport class _MD5 extends HashMD {\n A = MD5_IV[0] | 0;\n B = MD5_IV[1] | 0;\n C = MD5_IV[2] | 0;\n D = MD5_IV[3] | 0;\n constructor() {\n super(64, 16, 8, true);\n }\n get() {\n const { A, B, C, D } = this;\n return [A, B, C, D];\n }\n set(A, B, C, D) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n MD5_W[i] = view.getUint32(offset, true);\n // Compression function main loop, 64 rounds\n let { A, B, C, D } = this;\n for (let i = 0; i < 64; i++) {\n let F, g;\n if (i < 16) {\n F = Chi(B, C, D);\n g = i;\n }\n else if (i < 32) {\n // RFC 1321 round 2 uses G(B,C,D) = (B & D) | (C & ~D), which is `Chi(D, B, C)`.\n F = Chi(D, B, C);\n g = (5 * i + 1) % 16;\n }\n else if (i < 48) {\n F = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n }\n else {\n F = C ^ (B | ~D);\n g = (7 * i) % 16;\n }\n F = F + A + K[i] + MD5_W[g];\n A = D;\n D = C;\n C = B;\n B = B + rotl(F, MD5_SHIFTS[i]);\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 this.set(A, B, C, D);\n }\n roundClean() {\n clean(MD5_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.\n * MD5 architecture is similar to SHA1, with some differences:\n * - Reduced output length: 16 bytes (128 bit) instead of 20\n * - 64 rounds, instead of 80\n * - Little-endian: could be faster, but will require more code\n * - Non-linear index selection: huge speed-up for unroll\n * - Per round constants: more memory accesses, additional speed-up for unroll\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with MD5.\n * ```ts\n * md5(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const md5 = /* @__PURE__ */ createHasher(() => new _MD5());\n// RIPEMD-160\n// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables.\nconst Rho160 = /* @__PURE__ */ Uint8Array.from([\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n]);\nconst Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();\nconst Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();\n// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds.\nconst idxLR = /* @__PURE__ */ (() => {\n const L = [Id160];\n const R = [Pi160];\n const res = [L, R];\n for (let i = 0; i < 4; i++)\n for (let j of res)\n j.push(j[i].map((k) => Rho160[k]));\n return res;\n})();\nconst idxL = /* @__PURE__ */ (() => idxLR[0])();\nconst idxR = /* @__PURE__ */ (() => idxLR[1])();\n// const [idxL, idxR] = idxLR;\n// Base per-group shift table before the left/right message-order permutations are applied.\nconst shifts160 = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => Uint8Array.from(i));\nconst shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));\nconst shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));\n// Five left-lane additive constants for RIPEMD-160.\nconst Kl160 = /* @__PURE__ */ Uint32Array.from([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\n// Five right-lane additive constants for RIPEMD-160.\nconst Kr160 = /* @__PURE__ */ Uint32Array.from([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range\n// inputs currently fall through to the group-4 branch.\nfunction ripemd_f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n if (group === 1)\n return (x & y) | (~x & z);\n if (group === 2)\n return (x | ~y) ^ z;\n if (group === 3)\n return (x & z) | (y & ~z);\n return x ^ (y | ~z);\n}\n// Reusable 16-word RIPEMD-160 message block buffer.\nconst BUF_160 = /* @__PURE__ */ new Uint32Array(16);\n/**\n * Internal RIPEMD-160 legacy hash class.\n * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification.\n */\nexport class _RIPEMD160 extends HashMD {\n h0 = 0x67452301 | 0;\n h1 = 0xefcdab89 | 0;\n h2 = 0x98badcfe | 0;\n h3 = 0x10325476 | 0;\n h4 = 0xc3d2e1f0 | 0;\n constructor() {\n super(64, 20, 8, true);\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF_160[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order.\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n clean(BUF_160);\n }\n destroy() {\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a legacy hash function from 1990s.\n * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point\n * at the base RIPEMD-160 references.\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html}\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf}\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with RIPEMD-160.\n * ```ts\n * ripemd160(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160());\n","/**\n * HMAC: RFC2104 message authentication code.\n * @module\n */\nimport { abytes, aexists, ahash, aoutput, clean, } from \"./utils.js\";\n/**\n * Internal class for HMAC.\n * Accepts any byte key, although RFC 2104 §3 recommends keys at least\n * `HashLen` bytes long.\n */\nexport class _HMAC {\n oHash;\n iHash;\n blockLen;\n outputLen;\n canXOF = false;\n finished = false;\n destroyed = false;\n constructor(hash, key) {\n ahash(hash);\n abytes(key, undefined, 'key');\n this.iHash = hash.create();\n if (typeof this.iHash.update !== 'function')\n throw new Error('expected Hash instance');\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 the first block) of the outer hash here,\n // 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 clean(pad);\n }\n update(buf) {\n aexists(this);\n this.iHash.update(buf);\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(out, this);\n this.finished = true;\n const buf = out.subarray(0, this.outputLen);\n // Reuse the first outputLen bytes for the inner digest; the outer hash consumes them before\n // overwriting that same prefix with the final tag, leaving any oversized tail untouched.\n this.iHash.digestInto(buf);\n this.oHash.update(buf);\n this.oHash.digestInto(buf);\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 the key\n // is already in state and we don't know it.\n to ||= Object.create(Object.getPrototypeOf(this), {});\n const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this;\n to = to;\n to.finished = finished;\n to.destroyed = destroyed;\n to.blockLen = blockLen;\n to.outputLen = outputLen;\n to.canXOF = canXOF;\n to.oHash = oHash._cloneInto(to.oHash);\n to.iHash = iHash._cloneInto(to.iHash);\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n destroy() {\n this.destroyed = true;\n this.oHash.destroy();\n this.iHash.destroy();\n }\n}\nexport const hmac = /* @__PURE__ */ (() => {\n const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest());\n hmac_.create = (hash, key) => new _HMAC(hash, key);\n return hmac_;\n})();\n","/**\n * PBKDF (RFC 2898). Can be used to create a key from password and salt.\n * @module\n */\nimport { hmac } from \"./hmac.js\";\n// prettier-ignore\nimport { ahash, anumber, asyncLoop, checkOpts, clean, createView, kdfInputToBytes } from \"./utils.js\";\n// Common validation and per-call state setup for sync/async functions.\nfunction pbkdf2Init(hash, _password, _salt, _opts) {\n ahash(hash);\n const opts = checkOpts({ dkLen: 32, asyncTick: 10 }, _opts);\n const { c, dkLen, asyncTick } = opts;\n anumber(c, 'c');\n anumber(dkLen, 'dkLen');\n anumber(asyncTick, 'asyncTick');\n if (c < 1)\n throw new Error('\"c\" (iterations) must be >= 1');\n // RFC 8018 §5.2 defines `dkLen` as \"a positive integer\".\n if (dkLen < 1)\n throw new Error('\"dkLen\" must be >= 1');\n // RFC 8018 §5.2 step 1 requires rejecting oversize `dkLen`\n // before allocating the destination buffer.\n if (dkLen > (2 ** 32 - 1) * hash.outputLen)\n throw new Error('derived key too long');\n const p = kdfInputToBytes(_password, 'password');\n try {\n const s = kdfInputToBytes(_salt, 'salt');\n try {\n // DK = PBKDF2(PRF, Password, Salt, c, dkLen);\n const DK = new Uint8Array(dkLen);\n const { iHash, oHash, outputLen } = hmac.create(hash, p);\n // Drive keyed hashes directly; the wrapper is only needed to initialize their HMAC midstates.\n const u = new Uint8Array(outputLen);\n const eng = pbkdf2Engine(iHash, oHash, s, u);\n return { c, dkLen, asyncTick, DK, outputLen, eng };\n }\n finally {\n // Uint8Array inputs belong to the caller; only wipe our UTF-8 conversion.\n if (typeof _salt === 'string')\n clean(s);\n }\n }\n finally {\n if (typeof _password === 'string')\n clean(p);\n }\n}\n// Per-call PRF driver writes U1 into both `u` and `Ti`, then later digests into `u`;\n// shared by the sync and async variants.\nfunction pbkdf2Engine(iHash, oHash, salt, u) {\n const counter = new Uint8Array(4);\n const view = createView(counter);\n // Full clones retain tree/config state; absorb salt before async yields without cloning input.\n const salted = iHash._cloneInto().update(salt);\n // u1() overwrites the worker before reading it. Seed from the outer midstate so a long salt\n // cannot pre-populate a tree stack that the first reset would abandon without wiping.\n const work = oHash._cloneInto();\n const iClone = iHash._cloneInto; // Capture before mixed feedback can materialize state tuples.\n const oClone = oHash._cloneInto;\n return {\n u1: (ti, Ti) => {\n view.setInt32(0, ti, false);\n salted._cloneInto(work).update(counter).digestInto(u);\n oHash._cloneInto(work).update(u).digestInto(u);\n Ti.set(u.subarray(0, Ti.length));\n },\n // Whole `F` inner loop for the sync variant: one optimized function owns the hot loop.\n rounds: (c, Ti) => {\n for (let ui = 1; ui < c; ui++) {\n iClone.call(iHash, work).update(u).digestInto(u);\n oClone.call(oHash, work).update(u).digestInto(u);\n for (let i = 0; i < Ti.length; i++)\n Ti[i] ^= u[i];\n }\n },\n output: (DK) => {\n // Keyed templates and derived worker states are secret material.\n iHash.destroy();\n oHash.destroy();\n salted.destroy();\n work.destroy();\n // Shared sync/async cleanup point: wipe transient PRF state\n // while preserving the derived key buffer.\n clean(u);\n return DK;\n },\n };\n}\n/**\n * PBKDF2-HMAC: RFC 8018 key derivation function.\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated;\n * JS string inputs are UTF-8 encoded first\n * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first\n * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,\n * must be `>= 1` per RFC 8018 §5.2. See {@link Pbkdf2Opt}.\n * @returns Derived key bytes.\n * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error}\n * @example\n * PBKDF2-HMAC: RFC 2898 key derivation function.\n * ```ts\n * import { pbkdf2 } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = pbkdf2(sha256, 'password', 'salt', { dkLen: 32, c: Math.pow(2, 18) });\n * ```\n */\nexport function pbkdf2(hash, password, salt, opts) {\n const { c, dkLen, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts);\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) {\n // Ti = F(Password, Salt, c, i)\n // The last Ti view can be shorter than hLen, which applies\n // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies.\n const Ti = DK.subarray(pos, pos + outputLen);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n eng.u1(ti, Ti);\n // Uc = PRF(Password, Uc−1); Ti ^= Uc\n eng.rounds(c, Ti);\n }\n return eng.output(DK);\n}\n/**\n * PBKDF2-HMAC: RFC 8018 key derivation function. Async version.\n * @param hash - hash function that would be used e.g. sha256\n * @param password - password from which a derived key is generated;\n * JS string inputs are UTF-8 encoded first\n * @param salt - cryptographic salt; JS string inputs are UTF-8 encoded first\n * @param opts - PBKDF2 work factor and output settings. `dkLen`, if provided,\n * must be `>= 1` per RFC 8018 §5.2. `asyncTick` is only a local\n * scheduler-yield knob for this JS wrapper, not part of RFC 8018.\n * See {@link Pbkdf2Opt}.\n * @returns Promise resolving to derived key bytes.\n * @throws If the PBKDF2 iteration count or derived-key settings are invalid. {@link Error}\n * @example\n * PBKDF2-HMAC: RFC 2898 key derivation function.\n * ```ts\n * import { pbkdf2Async } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = await pbkdf2Async(sha256, 'password', 'salt', { dkLen: 32, c: 500_000 });\n * ```\n * @example\n * Tune the async PBKDF2 scheduler for short UI tasks.\n * ```ts\n * import { pbkdf2Async } from '@noble/hashes/pbkdf2.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const key = await pbkdf2Async(sha256, 'password', 'salt', {\n * dkLen: 32,\n * c: 32,\n * asyncTick: 1,\n * });\n * ```\n */\nexport async function pbkdf2Async(hash, password, salt, opts) {\n const { c, dkLen, asyncTick, DK, outputLen, eng } = pbkdf2Init(hash, password, salt, opts);\n // Reuse normal state destruction, then wipe the incomplete output if a host yield aborts.\n const abort = () => {\n eng.output(DK);\n clean(DK);\n };\n // DK = T1 + T2 + ⋯ + Tdklen/hlen\n for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += outputLen) {\n // Ti = F(Password, Salt, c, i)\n // The last Ti view can be shorter than hLen, which applies\n // RFC 8018 §5.2 step 4's T_l<0..r-1> truncation without extra copies.\n const Ti = DK.subarray(pos, pos + outputLen);\n // F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc\n // U1 = PRF(Password, Salt + INT_32_BE(i))\n eng.u1(ti, Ti);\n await asyncLoop(c - 1, asyncTick, () => {\n // Uc = PRF(Password, Uc−1)\n eng.rounds(2, Ti); // c=2 runs exactly one PRF iteration per callback.\n }, abort);\n }\n return eng.output(DK);\n}\n","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\n/**\n * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits\n * of the cube roots of the first 64 primes (2..311).\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\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/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */\nclass SHA2_32B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and makes sha256 3x slower (measured).\n A = 0;\n B = 0;\n C = 0;\n D = 0;\n E = 0;\n F = 0;\n G = 0;\n H = 0;\n constructor(outputLen, IV) {\n super(64, outputLen, 8, false);\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 _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\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 clean(SHA256_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */\nexport class _SHA256 extends SHA2_32B {\n constructor() {\n super(32, SHA256_IV);\n }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */\nexport class _SHA224 extends SHA2_32B {\n constructor() {\n super(28, SHA224_IV);\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// SHA-384 / SHA-512 round constants from RFC 6234 §5.2:\n// 80 full 64-bit words split into high/low halves.\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\n// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */\nclass SHA2_64B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and slows hashing down (measured on sha256).\n Ah = 0;\n Al = 0;\n Bh = 0;\n Bl = 0;\n Ch = 0;\n Cl = 0;\n Dh = 0;\n Dl = 0;\n Eh = 0;\n El = 0;\n Fh = 0;\n Fl = 0;\n Gh = 0;\n Gl = 0;\n Hh = 0;\n Hl = 0;\n constructor(outputLen, IV) {\n super(128, outputLen, 16, false);\n this.Ah = IV[0] | 0;\n this.Al = IV[1] | 0;\n this.Bh = IV[2] | 0;\n this.Bl = IV[3] | 0;\n this.Ch = IV[4] | 0;\n this.Cl = IV[5] | 0;\n this.Dh = IV[6] | 0;\n this.Dl = IV[7] | 0;\n this.Eh = IV[8] | 0;\n this.El = IV[9] | 0;\n this.Fh = IV[10] | 0;\n this.Fl = IV[11] | 0;\n this.Gh = IV[12] | 0;\n this.Gl = IV[13] | 0;\n this.Hh = IV[14] | 0;\n this.Hl = IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA512 extends SHA2_64B {\n constructor() {\n super(64, SHA512_IV);\n }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA384 extends SHA2_64B {\n constructor() {\n super(48, SHA384_IV);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.\n * These IV literals are checked against that script rather than a dedicated\n * local RFC section.\n */\n/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_224 extends SHA2_64B {\n constructor() {\n super(28, T224_IV);\n }\n}\n/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_256 extends SHA2_64B {\n constructor() {\n super(32, T256_IV);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-256.\n * ```ts\n * sha256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__PURE__ */ oidNist(0x01));\n/**\n * SHA2-224 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-224.\n * ```ts\n * sha224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__PURE__ */ oidNist(0x04));\n/**\n * SHA2-512 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512.\n * ```ts\n * sha512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__PURE__ */ oidNist(0x03));\n/**\n * SHA2-384 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-384.\n * ```ts\n * sha384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/256.\n * ```ts\n * sha512_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/224.\n * ```ts\n * sha512_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202},\n * {@link https://keccak.team/keccak.html | Website}, and\n * {@link https://crypto.stackexchange.com/q/15727 | the differences between\n * SHA-3 and Keccak}.\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { split } from \"./_u64.js\";\n// prettier-ignore\nimport { abool, abytes, aexists, anumber, aoutput, checkOpts, clean, createHasher, oidNist, swap32IfBE, u32 } from \"./utils.js\";\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\n// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors\n// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`.\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = []; // no pure annotation: var is always used\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\n// `split(..., true)` keeps the local little-endian lane-word layout used by\n// `state32`, so these `H` / `L` tables follow the file's first-word /\n// second-word lane slots rather than `_u64.ts`'s usual high/low naming.\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can\n// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only\n// consumer of left-rotates; other hashes use right-rotates from _u64.\n// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64.\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2.\n// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation.\nconst B = new Uint32Array(5 * 2);\n/**\n * `keccakf1600` internal permutation, additionally allows adjusting the round count.\n * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words\n * in this file's local little-endian lane-word order\n * @param rounds - number of rounds to execute\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If `rounds` is outside the supported `1..24` range. {@link Error}\n * @example\n * Permute a Keccak state with the default 24 rounds.\n * ```ts\n * keccakP(new Uint32Array(50));\n * ```\n */\nexport function keccakP(s, rounds = 24) {\n if (!(s instanceof Uint32Array))\n throw new TypeError('\"s\" expected Uint32Array(50), got type=' + typeof s);\n if (s.length !== 50)\n throw new RangeError('\"s\" expected Uint32Array(50), got length=' + s.length);\n anumber(rounds, 'rounds');\n // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table.\n if (rounds < 1 || rounds > 24)\n throw new Error('\"rounds\" expected integer 1..24');\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n // Same as:\n // for (let x = 0; x < 10; x++) B[x] = s[y + x];\n // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n for (let y = 0; y < 50; y += 10) {\n const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3];\n s[y] ^= ~s[y + 2] & s[y + 4];\n s[y + 1] ^= ~s[y + 3] & s[y + 5];\n s[y + 2] ^= ~s[y + 4] & s[y + 6];\n s[y + 3] ^= ~s[y + 5] & s[y + 7];\n s[y + 4] ^= ~s[y + 6] & s[y + 8];\n s[y + 5] ^= ~s[y + 7] & s[y + 9];\n s[y + 6] ^= ~s[y + 8] & b0;\n s[y + 7] ^= ~s[y + 9] & b1;\n s[y + 8] ^= ~b0 & b2;\n s[y + 9] ^= ~b1 & b3;\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n/**\n * Keccak sponge function.\n * @param blockLen - absorb/squeeze rate in bytes\n * @param suffix - domain separation suffix byte\n * @param outputLen - default digest length in bytes. This base sponge only\n * requires a non-negative integer; wrappers that need positive output\n * lengths must enforce that themselves.\n * @param enableXOF - whether XOF output is allowed\n * @param rounds - number of Keccak-f rounds\n * @example\n * Build a sponge state, absorb bytes, then finalize a digest.\n * ```ts\n * const hash = new Keccak(136, 0x06, 32);\n * hash.update(new Uint8Array([1, 2, 3]));\n * hash.digest();\n * ```\n */\nexport class Keccak {\n state;\n pos = 0;\n posOut = 0;\n finished = false;\n state32;\n destroyed = false;\n blockLen;\n suffix;\n outputLen;\n canXOF;\n enableXOF = false;\n rounds;\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n anumber(blockLen, 'blockLen');\n anumber(suffix, 'suffix');\n anumber(rounds, 'rounds');\n abool(enableXOF, 'enableXOF');\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.canXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen, 'outputLen');\n // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state.\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('\"blockLen\" must be 1..199');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone() {\n return this._cloneInto();\n }\n keccak() {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { blockLen, state, state32 } = this;\n const len = data.length;\n // Absorb full blocks with u32 XORs when both sides are 4-byte aligned.\n // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe.\n const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0;\n const blockLen32 = blockLen / 4;\n const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined;\n for (let pos = 0; pos < len;) {\n if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) {\n for (let i = 0, o = pos / 4; i < blockLen32; i++)\n state32[i] ^= data32[o + i];\n pos += blockLen;\n // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override,\n // so it must reflect the fully-absorbed block before the permutation fires.\n this.pos = blockLen;\n this.keccak();\n continue;\n }\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1.\n // These byte values already include the first padding bit, while the\n // final `0x80` below supplies the closing `1` bit in the last rate byte.\n state[pos] ^= suffix;\n // If that combined suffix lands in the last rate byte and already sets\n // bit 7, absorb it first so the final pad10*1 bit can be xored into a\n // fresh block.\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base\n // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/\n // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF.\n if (!this.enableXOF)\n throw new Error('XOF is not enabled');\n return this.writeInto(out);\n }\n xof(bytes) {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n aoutput(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest.\n this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen));\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.outputLen);\n this.digestInto(out);\n return out;\n }\n destroy() {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);\n // Reused destinations can come from a different rate/capacity variant, so clone must rewrite\n // the sponge geometry as well as the state words.\n to.blockLen = blockLen;\n to.state32.set(this.state32);\n // Sponge padding and XOF output are positional, so both offsets are part of the clone state.\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone\n // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie.\n to.canXOF = this.canXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info);\n/**\n * SHA3-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-224.\n * ```ts\n * sha3_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_224 = /* @__PURE__ */ genKeccak(0x06, 144, 28, \n/* @__PURE__ */ oidNist(0x07));\n/**\n * SHA3-256 hash function. Different from keccak-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-256.\n * ```ts\n * sha3_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, \n/* @__PURE__ */ oidNist(0x08));\n/**\n * SHA3-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-384.\n * ```ts\n * sha3_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_384 = /* @__PURE__ */ genKeccak(0x06, 104, 48, \n/* @__PURE__ */ oidNist(0x09));\n/**\n * SHA3-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-512.\n * ```ts\n * sha3_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, \n/* @__PURE__ */ oidNist(0x0a));\n/**\n * Keccak-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-224.\n * ```ts\n * keccak_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_224 = /* @__PURE__ */ genKeccak(0x01, 144, 28);\n/**\n * Keccak-256 hash function. Different from SHA3-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-256.\n * ```ts\n * keccak_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32);\n/**\n * Keccak-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-384.\n * ```ts\n * keccak_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_384 = /* @__PURE__ */ genKeccak(0x01, 104, 48);\n/**\n * Keccak-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-512.\n * ```ts\n * keccak_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_512 = /* @__PURE__ */ genKeccak(0x01, 72, 64);\nconst genShake = (suffix, blockLen, outputLen, info = {}) => createHasher((opts = {}) => {\n opts = checkOpts({}, opts);\n return new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true);\n}, info);\n/**\n * SHAKE128 XOF with 128-bit security and a 16-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128.\n * ```ts\n * shake128(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 16, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 256-bit security and a 32-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256.\n * ```ts\n * shake256(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 32, /* @__PURE__ */ oidNist(0x0c));\n/**\n * SHAKE128 XOF with 256-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128 using a 32-byte default output.\n * ```ts\n * shake128_32(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128_32 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 32, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 512-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256 using a 64-byte default output.\n * ```ts\n * shake256_64(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256_64 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 64, /* @__PURE__ */ oidNist(0x0c));\n","/*!\n * assert.js - assert for bcrypto\n * Copyright (c) 2020, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\n/*\n * Assert\n */\n\nfunction assert(val, msg) {\n if (!val) {\n const err = new Error(msg || 'Assertion failed');\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, assert);\n\n throw err;\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = assert;\n","/*!\n * custom.js - custom inspect symbol for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nexports.custom = 'inspect';\n","/*!\n * bn.js - big numbers for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/bn.js:\n * Copyright (c) 2015, Fedor Indutny (MIT License).\n * https://github.com/indutny/bn.js\n *\n * Parts of this software are based on golang/go:\n * Copyright (c) 2009, The Go Authors. All rights reserved.\n * https://github.com/golang/go\n *\n * Parts of this software are based on openssl/openssl:\n * Copyright (c) 1998-2018, The OpenSSL Project (Apache License v2.0).\n * Copyright (c) 1995-1998, Eric A. Young, Tim J. Hudson. All rights reserved.\n * https://github.com/openssl/openssl\n *\n * Parts of this software are based on libgmp:\n * Copyright (c) 1991-1997, 1999-2014, Free Software Foundation, Inc.\n * https://gmplib.org/\n *\n * Parts of this software are based on v8/v8:\n * Copyright (c) 2017, The V8 Project Authors (BSD-Style License).\n * https://github.com/v8/v8\n *\n * Resources:\n * https://github.com/indutny/bn.js/blob/master/lib/bn.js\n * https://github.com/indutny/miller-rabin/blob/master/lib/mr.js\n * https://github.com/golang/go/blob/master/src/math/big/int.go\n * https://github.com/golang/go/blob/master/src/math/big/nat.go\n * https://github.com/golang/go/blob/master/src/math/big/prime.go\n * https://github.com/openssl/openssl/tree/master/crypto/bn\n * https://github.com/openssl/openssl/blob/master/crypto/bn/bn_kron.c\n * https://github.com/gnutls/nettle/blob/master/mini-gmp.c\n * https://github.com/v8/v8/blob/master/src/objects/bigint.cc\n */\n\n/* eslint valid-typeof: \"off\" */\n\n'use strict';\n\nconst {custom} = require('../internal/custom');\n\n/*\n * Constants\n */\n\nconst zeros = [\n '',\n '0',\n '00',\n '000',\n '0000',\n '00000',\n '000000',\n '0000000',\n '00000000',\n '000000000',\n '0000000000',\n '00000000000',\n '000000000000',\n '0000000000000',\n '00000000000000',\n '000000000000000',\n '0000000000000000',\n '00000000000000000',\n '000000000000000000',\n '0000000000000000000',\n '00000000000000000000',\n '000000000000000000000',\n '0000000000000000000000',\n '00000000000000000000000',\n '000000000000000000000000',\n '0000000000000000000000000'\n];\n\nconst groupSizes = [\n 0x00, 0x19, 0x10, 0x0c, 0x0b, 0x0a,\n 0x09, 0x08, 0x08, 0x07, 0x07, 0x07,\n 0x07, 0x06, 0x06, 0x06, 0x06, 0x06,\n 0x06, 0x06, 0x05, 0x05, 0x05, 0x05,\n 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,\n 0x05, 0x05, 0x05, 0x05, 0x05, 0x05\n];\n\nconst groupBases = [\n 0x00000000, 0x02000000, 0x0290d741, 0x01000000,\n 0x02e90edd, 0x039aa400, 0x0267bf47, 0x01000000,\n 0x0290d741, 0x00989680, 0x012959c3, 0x0222c000,\n 0x03bd7765, 0x0072e440, 0x00adcea1, 0x01000000,\n 0x01704f61, 0x0206fc40, 0x02cddcf9, 0x03d09000,\n 0x003e5185, 0x004ea360, 0x006235f7, 0x00798000,\n 0x009502f9, 0x00b54ba0, 0x00daf26b, 0x01069c00,\n 0x0138f9ad, 0x0172c9e0, 0x01b4d89f, 0x02000000,\n 0x025528a1, 0x02b54a20, 0x03216b93, 0x039aa400\n];\n\nconst primes = {\n p192: null,\n p224: null,\n p521: null,\n k256: null,\n p251: null,\n p25519: null,\n p448: null\n};\n\nconst modes = {\n NONE: 0,\n QUO: 1,\n REM: 2,\n BOTH: 3,\n EUCLID: 4,\n ALL: 7\n};\n\nconst WND_WIDTH = 4;\nconst WND_SIZE = 1 << (WND_WIDTH - 1);\n\nconst HAS_BIGINT = typeof BigInt === 'function';\n\n/**\n * BN\n */\n\nclass BN {\n constructor(num, base, endian) {\n this.words = [0];\n this.length = 1;\n this.negative = 0;\n this.red = null;\n this.from(num, base, endian);\n }\n\n /*\n * Addition Engine\n */\n\n _iadd(a, b) {\n let carry = 0;\n let i = 0;\n\n // a.length > b.length\n if (a.length < b.length)\n [a, b] = [b, a];\n\n if (a !== this)\n this._alloc(a.length);\n\n for (; i < b.length; i++) {\n const r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n\n this.words[i] = r & 0x3ffffff;\n\n carry = r >>> 26;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n const r = (a.words[i] | 0) + carry;\n\n this.words[i] = r & 0x3ffffff;\n\n carry = r >>> 26;\n }\n\n this.length = a.length;\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n } else if (a !== this) {\n // Copy the rest of the words.\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n _iaddn(num) {\n this.words[0] += num;\n\n if (this.words[0] < 0x4000000)\n return this;\n\n // Carry.\n let i = 0;\n\n this._alloc(this.length + 1);\n\n this.words[this.length] = 0;\n\n for (; i < this.length && this.words[i] >= 0x4000000; i++) {\n this.words[i] -= 0x4000000;\n this.words[i + 1] += 1;\n }\n\n this.length = Math.max(this.length, i + 1);\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n /*\n * Addition\n */\n\n iadd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative === num.negative) {\n // x + y == x + y\n // (-x) + (-y) == -(x + y)\n this._iadd(this, num);\n } else {\n // x + (-y) == x - y == -(y - x)\n // (-x) + y == y - x == -(x - y)\n const cmp = this.ucmp(num);\n\n // x + (-x) == (-x) + x == 0\n if (cmp === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n if (cmp < 0) {\n this._isub(num, this);\n this.negative ^= 1;\n } else {\n this._isub(this, num);\n }\n }\n\n return this;\n }\n\n iaddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (negative)\n num = -num;\n\n if (this.negative === negative) {\n // x + y == x + y\n // (-x) + (-y) == -(x + y)\n this._iaddn(num);\n } else {\n // x + (-y) == x - y == -(y - x)\n // (-x) + y == y - x == -(x - y)\n if (this.length === 1 && this.words[0] < num) {\n this.words[0] = num - this.words[0];\n this.negative ^= 1;\n } else {\n this._isubn(num);\n }\n }\n\n return this;\n }\n\n add(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (num.length > this.length)\n return num.clone().iadd(this);\n\n return this.clone().iadd(num);\n }\n\n addn(num) {\n return this.clone().iaddn(num);\n }\n\n /*\n * Subtraction Engine\n */\n\n _isub(a, b) {\n let carry = 0;\n let i = 0;\n\n // a > b\n assert(a.length >= b.length);\n\n if (a !== this)\n this._alloc(a.length);\n\n for (; i < b.length; i++) {\n const r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n\n carry = r >> 26;\n\n this.words[i] = r & 0x3ffffff;\n }\n\n for (; carry !== 0 && i < a.length; i++) {\n const r = (a.words[i] | 0) + carry;\n\n carry = r >> 26;\n\n this.words[i] = r & 0x3ffffff;\n }\n\n assert(carry === 0);\n\n // Copy rest of the words.\n if (a !== this) {\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n this.length = Math.max(this.length, i);\n\n return this._strip();\n }\n\n _isubn(num) {\n this.words[0] -= num;\n\n if (this.words[0] >= 0)\n return this._normalize();\n\n assert(this.length !== 1);\n\n // Carry.\n this._alloc(this.length + 1);\n\n for (let i = 0; i < this.length && this.words[i] < 0; i++) {\n this.words[i] += 0x4000000;\n this.words[i + 1] -= 1;\n }\n\n this.words[this.length] = 0;\n\n return this._strip();\n }\n\n /*\n * Subtraction\n */\n\n isub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative !== num.negative) {\n // x - (-y) == x + y\n // (-x) - y == -(x + y)\n this._iadd(this, num);\n } else {\n // x - y == x - y == -(y - x)\n // (-x) - (-y) == y - x == -(x - y)\n const cmp = this.ucmp(num);\n\n // x - x == 0\n if (cmp === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n if (cmp < 0) {\n this._isub(num, this);\n this.negative ^= 1;\n } else {\n this._isub(this, num);\n }\n }\n\n return this;\n }\n\n isubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (negative)\n num = -num;\n\n if (this.negative !== negative) {\n // x - (-y) == x + y\n // (-x) - y == -(x + y)\n this._iaddn(num);\n } else {\n // x - y == x - y == -(y - x)\n // (-x) - (-y) == y - x == -(x - y)\n if (this.length === 1 && this.words[0] < num) {\n this.words[0] = num - this.words[0];\n this.negative ^= 1;\n } else {\n this._isubn(num);\n }\n }\n\n return this;\n }\n\n sub(num) {\n return this.clone().isub(num);\n }\n\n subn(num) {\n return this.clone().isubn(num);\n }\n\n /*\n * Multiplication Engine\n */\n\n _mul(num, out) {\n enforce(BN.isBN(num), 'num', 'bignum');\n enforce(BN.isBN(out), 'out', 'bignum');\n\n if (this.length === 10 && num.length === 10)\n return comb10MulTo(this, num, out);\n\n const len = this.length + num.length;\n\n if (len < 63)\n return smallMulTo(this, num, out);\n\n if (len < 1024)\n return bigMulTo(this, num, out);\n\n return jumboMulTo(this, num, out);\n }\n\n /*\n * Multiplication\n */\n\n imul(num) {\n return this.mul(num)._move(this);\n }\n\n imuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n // Carry.\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = this.words[i] * num;\n const lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n\n carry >>= 26;\n carry += (w / 0x4000000) | 0;\n carry += lo >>> 26;\n\n this.words[i] = lo & 0x3ffffff;\n }\n\n this.negative ^= neg;\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n } else {\n this._strip();\n }\n\n return this;\n }\n\n mul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n const len = this.length + num.length;\n const out = new BN();\n\n out.words = new Array(len);\n\n for (let i = 0; i < len; i ++)\n out.words[i] = 0;\n\n return this._mul(num, out);\n }\n\n muln(num) {\n return this.clone().imuln(num);\n }\n\n /*\n * Multiplication + Shift\n */\n\n mulShift(num, bits) {\n enforce(BN.isBN(num), 'num', 'bignum');\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = this.mul(num);\n const b = r.utestn(bits - 1);\n\n r.iushrn(bits);\n\n if (this.negative ^ num.negative)\n return r.isubn(b);\n\n return r.iaddn(b);\n }\n\n /*\n * Division Engine\n */\n\n _div(num, flags) {\n enforce(BN.isBN(num), 'num', 'bignum');\n assert((flags & modes.ALL) === flags);\n assert(flags !== modes.NONE);\n\n const a = this;\n const b = num;\n\n nonzero(!b.isZero());\n\n if (a.isZero())\n return [new BN(0), new BN(0)];\n\n const as = a.negative;\n const bs = b.negative;\n\n a.negative = 0;\n b.negative = 0;\n\n let q = null;\n let r = null;\n\n if (a.ucmp(b) < 0) {\n if (flags & modes.QUO)\n q = new BN(0);\n\n if (flags & modes.REM)\n r = a.clone();\n } else if (b.length === 1) {\n if (flags & modes.QUO)\n q = a.quon(b.words[0]);\n\n if (flags & modes.REM)\n r = a.remn(b.words[0]);\n } else {\n [q, r] = a._wordDiv(b, flags);\n }\n\n a.negative = as;\n b.negative = bs;\n\n if (flags & modes.QUO) {\n q.negative = a.negative ^ b.negative;\n q._normalize();\n }\n\n if (flags & modes.REM) {\n r.negative = a.negative;\n r._normalize();\n }\n\n if (flags & modes.EUCLID) {\n if (flags & modes.QUO) {\n assert((flags & modes.REM) !== 0);\n\n if (r.negative !== 0) {\n if (b.negative !== 0)\n q.iaddn(1);\n else\n q.isubn(1);\n }\n }\n\n if (flags & modes.REM) {\n if (r.negative !== 0) {\n if (b.negative !== 0)\n r.isub(b);\n else\n r.iadd(b);\n }\n }\n }\n\n return [q, r];\n }\n\n _wordDiv(num, flags) {\n let a = this.clone();\n let b = num;\n let q = null;\n let hi;\n\n // Normalize.\n const word = b.words[b.length - 1] | 0;\n const shift = 26 - countBits(word);\n\n if (shift !== 0) {\n b = b.clone();\n\n a.iushln(shift);\n b.iushln(shift);\n\n hi = b.words[b.length - 1] | 0;\n } else {\n hi = word;\n }\n\n // Initialize quotient.\n const m = a.length - b.length;\n\n assert(m >= 0);\n\n if (flags & modes.QUO) {\n q = new BN(0);\n q.length = m + 1;\n q.words = new Array(q.length);\n\n for (let i = 0; i < q.length; i++)\n q.words[i] = 0;\n }\n\n // Diff.\n const d = a.clone();\n\n d._ishlnsubmul(b, 1, m);\n\n if (d.negative === 0) {\n if (q)\n q.words[m] = 1;\n\n a = d;\n }\n\n // Divide.\n for (let j = m - 1; j >= 0; j--) {\n const ahi = a.words[b.length + j];\n const alo = a.words[b.length + j - 1];\n const quo = ((ahi * 0x4000000 + alo) / hi) | 0;\n\n let qj = Math.min(quo, 0x3ffffff);\n\n a._ishlnsubmul(b, qj, j);\n\n while (a.negative !== 0) {\n qj -= 1;\n a.negative = 0;\n a._ishlnsubmul(b, 1, j);\n a.ineg();\n }\n\n if (q)\n q.words[j] = qj;\n }\n\n // Strip.\n if (q)\n q._strip();\n\n // Denormalize.\n // Note: we shouldn't need to strip `a` here.\n if ((flags & modes.REM) && shift !== 0)\n a.iushrn(shift);\n\n return [q, a];\n }\n\n _ishlnsubmul(num, mul, shift) {\n let carry = 0;\n let i = 0;\n\n this._expand(num.length + shift);\n\n for (; i < num.length; i++) {\n const k = (this.words[i + shift] | 0) + carry;\n const r = num.words[i] * mul;\n const w = k - (r & 0x3ffffff);\n\n carry = (w >> 26) - ((r / 0x4000000) | 0);\n\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n for (; i < this.length - shift; i++) {\n const w = (this.words[i + shift] | 0) + carry;\n\n carry = w >> 26;\n\n this.words[i + shift] = w & 0x3ffffff;\n }\n\n if (carry === 0)\n return this._strip();\n\n // Subtraction overflow.\n assert(carry === -1);\n\n carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = -(this.words[i] | 0) + carry;\n\n carry = w >> 26;\n\n this.words[i] = w & 0x3ffffff;\n }\n\n this.negative = 1;\n\n return this._strip();\n }\n\n /*\n * Truncation Division + Modulo\n */\n\n quorem(num) {\n return this._div(num, modes.BOTH);\n }\n\n /*\n * Truncation Division\n */\n\n iquo(num) {\n return this.quo(num)._move(this);\n }\n\n iquon(num) {\n enforce(isSMI(num), 'num', 'smi');\n nonzero(num !== 0);\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n let carry = 0;\n\n for (let i = this.length - 1; i >= 0; i--) {\n const w = (this.words[i] | 0) + carry * 0x4000000;\n\n this.words[i] = (w / num) | 0;\n\n carry = w % num;\n }\n\n this.negative ^= neg;\n\n return this._strip();\n }\n\n quo(num) {\n return this._div(num, modes.QUO)[0];\n }\n\n quon(num) {\n return this.clone().iquon(num);\n }\n\n /*\n * Truncation Modulo\n */\n\n irem(num) {\n return this.rem(num)._move(this);\n }\n\n iremn(num) {\n let m = this.remrn(num);\n\n if (m < 0)\n m = -m;\n\n this.words[0] = m;\n this.length = 1;\n\n return this._normalize();\n }\n\n rem(num) {\n return this._div(num, modes.REM)[1];\n }\n\n remn(num) {\n return this.clone().iremn(num);\n }\n\n remrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n nonzero(num !== 0);\n\n if (num < 0)\n num = -num;\n\n const p = (1 << 26) % num;\n\n let acc = 0;\n\n for (let i = this.length - 1; i >= 0; i--)\n acc = (p * acc + (this.words[i] | 0)) % num;\n\n return this.negative !== 0 ? (-acc | 0) : acc;\n }\n\n /*\n * Euclidean Division + Modulo\n */\n\n divmod(num) {\n return this._div(num, modes.BOTH | modes.EUCLID);\n }\n\n /*\n * Euclidean Division\n */\n\n idiv(num) {\n return this.div(num)._move(this);\n }\n\n idivn(num) {\n if (this.negative === 0)\n return this.iquon(num);\n\n const r = this.remrn(num);\n\n this.iquon(num);\n\n if (r < 0) {\n if (num < 0)\n this.iaddn(1);\n else\n this.isubn(1);\n }\n\n return this;\n }\n\n div(num) {\n return this._div(num, modes.BOTH | modes.EUCLID)[0];\n }\n\n divn(num) {\n return this.clone().idivn(num);\n }\n\n /*\n * Euclidean Modulo\n */\n\n imod(num) {\n if (this.ucmp(num) < 0) {\n if (this.negative !== 0) {\n this._isub(num, this);\n this.negative = 0;\n }\n return this;\n }\n\n return this.mod(num)._move(this);\n }\n\n imodn(num) {\n this.words[0] = this.modrn(num);\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n mod(num) {\n return this._div(num, modes.REM | modes.EUCLID)[1];\n }\n\n modn(num) {\n return this.clone().imodn(num);\n }\n\n modrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n let r = this.remrn(num);\n\n if (r < 0) {\n if (num < 0)\n r -= num;\n else\n r += num;\n }\n\n return r;\n }\n\n /*\n * Round Division\n */\n\n divRound(num) {\n const [q, r] = this.quorem(num);\n\n // Fast case - exact division.\n if (r.isZero())\n return q;\n\n const bit = num.words[0] & 1;\n\n num.iushrn(1);\n\n const cmp = r.ucmp(num);\n\n num.iushln(1);\n\n num.words[0] |= bit;\n\n // Round down.\n if (cmp < 0 || (num.isOdd() && cmp === 0))\n return q;\n\n // Round up.\n if (this.negative ^ num.negative)\n return q.isubn(1);\n\n return q.iaddn(1);\n }\n\n /*\n * Exponentiation\n */\n\n ipow(num) {\n return this.pow(num)._move(this);\n }\n\n ipown(num) {\n return this.pown(num)._move(this);\n }\n\n pow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let b = countBits(num.words[num.length - 1]);\n let r = new BN(1);\n\n for (let i = num.length - 1; i >= 0; i--) {\n const word = num.words[i];\n\n for (let j = b - 1; j >= 0; j--) {\n r = r.sqr();\n\n if ((word >> j) & 1)\n r = r.mul(this);\n }\n\n b = 26;\n }\n\n return r;\n }\n\n pown(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if (num < 0)\n num = -num;\n\n if (num === 0)\n return new BN(1);\n\n if (num === 1)\n return this.clone();\n\n const bits = countBits(num);\n\n let r = this;\n\n for (let i = bits - 2; i >= 0; i--) {\n r = r.sqr();\n\n if ((num >> i) & 1)\n r = r.mul(this);\n }\n\n return r;\n }\n\n isqr() {\n return this.imul(this);\n }\n\n sqr() {\n return this.mul(this);\n }\n\n /*\n * Roots Engine\n */\n\n _rootrem(pow, rem) {\n enforce((pow >>> 0) === pow, 'num', 'uint32');\n\n if (pow === 0)\n throw new RangeError('Zeroth root.');\n\n if (~pow & this.negative)\n throw new RangeError('Negative with even root.');\n\n if (this.ucmpn(1) <= 0)\n return [this.clone(), new BN(0)];\n\n let u = new BN(0);\n let t = BN.shift(1, this.bitLength() / pow + 1 | 0);\n let v, r;\n\n if (this.negative !== 0)\n t.ineg();\n\n if (pow === 2) {\n do {\n u = t;\n t = this.quo(u);\n t.iadd(u);\n t.iushrn(1);\n } while (t.ucmp(u) < 0);\n } else {\n do {\n u = t;\n t = u.pown(pow - 1);\n t = this.quo(t);\n v = u.muln(pow - 1);\n t.iadd(v);\n t = t.quon(pow);\n } while (t.ucmp(u) < 0);\n }\n\n if (rem) {\n t = u.pown(pow);\n r = this.sub(t);\n }\n\n return [u, r];\n }\n\n /*\n * Roots\n */\n\n rootrem(pow) {\n return this._rootrem(pow, 1);\n }\n\n iroot(pow) {\n return this.root(pow)._move(this);\n }\n\n root(pow) {\n return this._rootrem(pow, 0)[0];\n }\n\n isPower(pow) {\n enforce((pow >>> 0) === pow, 'num', 'uint32');\n\n if (pow === 0 || (~pow & this.negative))\n return false;\n\n const [, r] = this.rootrem(pow);\n\n return r.sign() === 0;\n }\n\n sqrtrem() {\n return this.rootrem(2);\n }\n\n isqrt() {\n return this.sqrt()._move(this);\n }\n\n sqrt() {\n return this.root(2);\n }\n\n isSquare() {\n return this.isPower(2);\n }\n\n /*\n * AND\n */\n\n iand(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y)\n return x;\n\n if ((x.negative | y.negative) === 0)\n return x.iuand(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) & (-y) == ~(x-1) & ~(y-1)\n // == ~((x-1) | (y-1))\n // == -(((x-1) | (y-1)) + 1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuor(y);\n x.isubn(1);\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n if (x.negative !== 0)\n [x, y] = [y.clone(), x];\n\n // x & (-y) == x & ~(y-1)\n // == x & ~(y-1)\n const width = x.bitLength();\n\n y.iaddn(1);\n y.inotn(width);\n x.iuand(y);\n y.inotn(width);\n y.isubn(1);\n\n return x._move(this);\n }\n\n iandn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.iand(new BN(num));\n\n this.words[0] &= num;\n this.length = 1;\n\n return this;\n }\n\n and(num) {\n return this.clone().iand(num);\n }\n\n andn(num) {\n return this.clone().iandn(num);\n }\n\n andrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0) {\n const n = this.iand(new BN(num));\n\n if (n.length > 1)\n throw new RangeError('Number exceeds 26 bits.');\n\n return n.negative !== 0 ? -n.words[0] : n.words[0];\n }\n\n return this.words[0] & num;\n }\n\n /*\n * Unsigned AND\n */\n\n iuand(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this.length = Math.min(this.length, num.length);\n\n for (let i = 0; i < this.length; i++)\n this.words[i] &= num.words[i];\n\n return this._strip();\n }\n\n iuandn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] &= Math.abs(num);\n this.length = 1;\n\n return this._normalize();\n }\n\n uand(num) {\n return this.clone().iuand(num);\n }\n\n uandn(num) {\n return this.clone().iuandn(num);\n }\n\n uandrn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const n = this.words[0] & Math.abs(num);\n\n return this.negative !== 0 ? (-n | 0) : n;\n }\n\n /*\n * OR\n */\n\n ior(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y)\n return x;\n\n if ((x.negative | y.negative) === 0)\n return x.iuor(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) | (-y) == ~(x-1) | ~(y-1)\n // == ~((x-1) & (y-1))\n // == -(((x-1) & (y-1)) + 1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuand(y);\n x.isubn(1);\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n y = y.clone();\n\n if (x.negative !== 0)\n [x, y] = [y, x];\n\n // x | (-y) == x | ~(y-1)\n // == ~((y-1) & ~x)\n // == -(((y-1) & ~x) + 1)\n y.iaddn(1);\n x.inotn(y.bitLength());\n y.iuand(x);\n y.isubn(1);\n\n return y._move(this);\n }\n\n iorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.ior(new BN(num));\n\n this.words[0] |= num;\n\n return this;\n }\n\n or(num) {\n return this.clone().ior(num);\n }\n\n orn(num) {\n return this.clone().iorn(num);\n }\n\n /*\n * Unsigned OR\n */\n\n iuor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this._expand(num.length);\n\n for (let i = 0; i < num.length; i++)\n this.words[i] |= num.words[i];\n\n // Note: we shouldn't need to strip here.\n return this;\n }\n\n iuorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] |= Math.abs(num);\n\n return this;\n }\n\n uor(num) {\n return this.clone().iuor(num);\n }\n\n uorn(num) {\n return this.clone().iuorn(num);\n }\n\n /*\n * XOR\n */\n\n ixor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let x = this;\n let y = num;\n\n if (x === y) {\n x.words[0] = 0;\n x.length = 1;\n x.negative = 0;\n return x;\n }\n\n if ((x.negative | y.negative) === 0)\n return x.iuxor(y);\n\n if ((x.negative & y.negative) === 1) {\n // (-x) ^ (-y) == ~(x-1) ^ ~(y-1)\n // == (x-1) ^ (y-1)\n x.iaddn(1);\n y.iaddn(1);\n x.iuxor(y);\n x.ineg();\n y.isubn(1);\n return x;\n }\n\n // Assume x is the positive number.\n if (x.negative !== 0)\n [x, y] = [y.clone(), x];\n\n // x ^ (-y) == x ^ ~(y-1)\n // == ~(x ^ (y-1))\n // == -((x ^ (y-1)) + 1)\n y.iaddn(1);\n x.iuxor(y);\n x.iaddn(1);\n x.ineg();\n y.isubn(1);\n\n return x._move(this);\n }\n\n ixorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if ((this.negative | (num < 0)) !== 0)\n return this.ixor(new BN(num));\n\n this.words[0] ^= num;\n\n return this;\n }\n\n xor(num) {\n return this.clone().ixor(num);\n }\n\n xorn(num) {\n return this.clone().ixorn(num);\n }\n\n /*\n * Unsigned XOR\n */\n\n iuxor(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n let a = this;\n let b = num;\n\n if (a.length < b.length)\n [a, b] = [b, a];\n\n let i = 0;\n\n for (; i < b.length; i++)\n this.words[i] = a.words[i] ^ b.words[i];\n\n if (a !== this) {\n this._alloc(a.length);\n\n for (; i < a.length; i++)\n this.words[i] = a.words[i];\n }\n\n this.length = a.length;\n\n return this._strip();\n }\n\n iuxorn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n this.words[0] ^= Math.abs(num);\n\n return this._normalize();\n }\n\n uxor(num) {\n return this.clone().iuxor(num);\n }\n\n uxorn(num) {\n return this.clone().iuxorn(num);\n }\n\n /*\n * NOT\n */\n\n inot() {\n if (this.negative !== 0) {\n // ~(-x) == ~(~(x-1)) == x-1\n this.ineg().isubn(1);\n } else {\n // ~x == -x-1 == -(x+1)\n this.iaddn(1).ineg();\n }\n return this;\n }\n\n not() {\n return this.clone().inot();\n }\n\n inotn(width) {\n enforce((width >>> 0) === width, 'width', 'uint32');\n\n const r = width % 26;\n\n let s = Math.ceil(width / 26);\n let i = 0;\n\n // Extend the buffer with leading zeroes.\n this._expand(s);\n\n if (r > 0)\n s -= 1;\n\n // Handle complete words.\n for (; i < s; i++)\n this.words[i] ^= 0x3ffffff;\n\n // Handle the residue.\n if (r > 0)\n this.words[i] ^= (1 << r) - 1;\n\n // And remove leading zeroes.\n return this._strip();\n }\n\n notn(width) {\n return this.clone().inotn(width);\n }\n\n /*\n * Left Shift\n */\n\n ishl(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.ishln(num.toNumber());\n }\n\n ishln(bits) {\n return this.iushln(bits);\n }\n\n shl(num) {\n return this.clone().ishl(num);\n }\n\n shln(bits) {\n return this.clone().ishln(bits);\n }\n\n /*\n * Unsigned Left Shift\n */\n\n iushl(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.iushln(num.toNumber());\n }\n\n iushln(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = bits % 26;\n const s = (bits - r) / 26;\n const mask = ((1 << r) - 1) << (26 - r);\n\n if (r !== 0) {\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const ncarry = this.words[i] & mask;\n const c = ((this.words[i] | 0) - ncarry) << r;\n\n this.words[i] = c | carry;\n\n carry = ncarry >>> (26 - r);\n }\n\n if (carry !== 0) {\n this._alloc(this.length + 1);\n this.words[this.length++] = carry;\n }\n }\n\n if (s !== 0) {\n this._alloc(this.length + s);\n\n for (let i = this.length - 1; i >= 0; i--)\n this.words[i + s] = this.words[i];\n\n for (let i = 0; i < s; i++)\n this.words[i] = 0;\n\n this.length += s;\n }\n\n return this._strip();\n }\n\n ushl(num) {\n return this.clone().iushl(num);\n }\n\n ushln(bits) {\n return this.clone().iushln(bits);\n }\n\n /*\n * Right Shift Engine\n */\n\n _split(bits, output) {\n const r = bits % 26;\n const s = Math.min((bits - r) / 26, this.length);\n const mask = (1 << r) - 1;\n\n // Extended mode, copy masked part.\n if (output) {\n output._alloc(s);\n\n for (let i = 0; i < s; i++)\n output.words[i] = this.words[i];\n\n output.length = s;\n }\n\n if (s === 0) {\n // No-op, we should not move anything at all.\n } else if (this.length > s) {\n this.length -= s;\n for (let i = 0; i < this.length; i++)\n this.words[i] = this.words[i + s];\n } else {\n this.words[0] = 0;\n this.length = 1;\n }\n\n let carry = 0;\n\n if (r !== 0) {\n for (let i = this.length - 1; i >= 0; i--) {\n const word = this.words[i] | 0;\n\n this.words[i] = (carry << (26 - r)) | (word >>> r);\n\n carry = word & mask;\n }\n }\n\n // Push carried bits as a mask.\n if (output) {\n if (carry !== 0) {\n output._alloc(output.length + 1);\n output.words[output.length++] = carry;\n } else {\n if (output.length === 0)\n output.words[output.length++] = 0;\n\n output._strip();\n }\n }\n\n return this._strip();\n }\n\n /*\n * Right Shift\n */\n\n ishr(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.ishrn(num.toNumber());\n }\n\n ishrn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (this.negative !== 0) {\n // (-x) >> y == ~(x-1) >> y\n // == ~((x-1) >> y)\n // == -(((x-1) >> y) + 1)\n this.iaddn(1);\n this.iushrn(bits);\n this.isubn(1);\n return this;\n }\n\n return this.iushrn(bits);\n }\n\n shr(num) {\n return this.clone().ishr(num);\n }\n\n shrn(bits) {\n return this.clone().ishrn(bits);\n }\n\n /*\n * Unsigned Right Shift\n */\n\n iushr(num) {\n enforce(BN.isBN(num), 'bits', 'bignum');\n enforce(num.bitLength() <= 32, 'bits', 'uint32');\n return this.iushrn(num.toNumber());\n }\n\n iushrn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n return this._split(bits, null);\n }\n\n ushr(num) {\n return this.clone().iushr(num);\n }\n\n ushrn(bits) {\n return this.clone().iushrn(bits);\n }\n\n /*\n * Bit Manipulation\n */\n\n setn(bit, val) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n if (this.negative !== 0) {\n this.iaddn(1);\n this.usetn(bit, !val);\n this.isubn(1);\n return this;\n }\n\n return this.usetn(bit, val);\n }\n\n usetn(bit, val) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n this._expand(s + 1);\n\n if (val)\n this.words[s] |= (1 << r);\n else\n this.words[s] &= ~(1 << r);\n\n return this._strip();\n }\n\n testn(bit) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n // Fast case: bit is much higher than all existing words.\n if (this.length <= s)\n return this.negative;\n\n // Check bit and return.\n const w = this.words[s];\n const val = (w >> r) & 1;\n\n if (this.negative !== 0) {\n if (r > 0 && (w & ((1 << r) - 1)))\n return val ^ 1;\n\n let j = s;\n\n while (j--) {\n if (this.words[j] > 0)\n return val ^ 1;\n }\n }\n\n return val;\n }\n\n utestn(bit) {\n enforce((bit >>> 0) === bit, 'bit', 'uint32');\n\n const r = bit % 26;\n const s = (bit - r) / 26;\n\n // Fast case: bit is much higher than all existing words.\n if (this.length <= s)\n return 0;\n\n // Check bit and return.\n return (this.words[s] >> r) & 1;\n }\n\n imaskn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (this.negative !== 0) {\n this.iaddn(1);\n this.inotn(bits + 1);\n this.ineg();\n }\n\n return this.iumaskn(bits);\n }\n\n maskn(bits) {\n return this.clone().imaskn(bits);\n }\n\n iumaskn(bits) {\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n const r = bits % 26;\n\n let s = (bits - r) / 26;\n\n if (this.length <= s)\n return this;\n\n if (r !== 0)\n s += 1;\n\n this.length = Math.min(s, this.length);\n\n if (r !== 0)\n this.words[this.length - 1] &= (1 << r) - 1;\n\n if (this.length === 0)\n this.words[this.length++] = 0;\n\n return this._strip();\n }\n\n umaskn(bits) {\n return this.clone().iumaskn(bits);\n }\n\n andln(num) {\n return this.words[0] & num;\n }\n\n bit(pos) {\n return this.utestn(pos);\n }\n\n bits(pos, width) {\n enforce((pos >>> 0) === pos, 'pos', 'uint32');\n enforce((width >>> 0) === width, 'width', 'uint32');\n enforce(width <= 26, 'width', 'width');\n\n const shift = pos % 26;\n const index = (pos - shift) / 26;\n\n if (index >= this.length)\n return 0;\n\n let bits = (this.words[index] >> shift) & ((1 << width) - 1);\n\n if (shift + width > 26 && index + 1 < this.length) {\n const more = shift + width - 26;\n const next = this.words[index + 1] & ((1 << more) - 1);\n\n bits |= next << (26 - shift);\n }\n\n return bits;\n }\n\n /*\n * Negation\n */\n\n ineg() {\n if (!this.isZero())\n this.negative ^= 1;\n\n return this;\n }\n\n neg() {\n return this.clone().ineg();\n }\n\n iabs() {\n this.negative = 0;\n return this;\n }\n\n abs() {\n return this.clone().iabs();\n }\n\n /*\n * Comparison\n */\n\n cmp(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.negative !== num.negative)\n return num.negative - this.negative;\n\n const res = this.ucmp(num);\n\n if (this.negative !== 0)\n return -res | 0;\n\n return res;\n }\n\n cmpn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n const negative = (num < 0) | 0;\n\n if (this.negative !== negative)\n return negative - this.negative;\n\n const res = this.ucmpn(num);\n\n if (this.negative !== 0)\n return -res | 0;\n\n return res;\n }\n\n eq(num) {\n return this.cmp(num) === 0;\n }\n\n eqn(num) {\n return this.cmpn(num) === 0;\n }\n\n gt(num) {\n return this.cmp(num) > 0;\n }\n\n gtn(num) {\n return this.cmpn(num) > 0;\n }\n\n gte(num) {\n return this.cmp(num) >= 0;\n }\n\n gten(num) {\n return this.cmpn(num) >= 0;\n }\n\n lt(num) {\n return this.cmp(num) < 0;\n }\n\n ltn(num) {\n return this.cmpn(num) < 0;\n }\n\n lte(num) {\n return this.cmp(num) <= 0;\n }\n\n lten(num) {\n return this.cmpn(num) <= 0;\n }\n\n sign() {\n if (this.negative !== 0)\n return -1;\n\n if (this.length === 1 && this.words[0] === 0)\n return 0;\n\n return 1;\n }\n\n isZero() {\n return this.length === 1 && this.words[0] === 0;\n }\n\n isNeg() {\n return this.negative !== 0;\n }\n\n isPos() {\n return this.negative === 0;\n }\n\n isOdd() {\n return (this.words[0] & 1) === 1;\n }\n\n isEven() {\n return (this.words[0] & 1) === 0;\n }\n\n /*\n * Unsigned Comparison\n */\n\n ucmp(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.length < num.length)\n return -1;\n\n if (this.length > num.length)\n return 1;\n\n for (let i = this.length - 1; i >= 0; i--) {\n const a = this.words[i] | 0;\n const b = num.words[i] | 0;\n\n if (a === b)\n continue;\n\n return (a > b) - (a < b);\n }\n\n return 0;\n }\n\n ucmpn(num) {\n enforce(isSMI(num), 'num', 'smi');\n\n if (this.length > 1)\n return 1;\n\n const w = this.words[0] | 0;\n\n if (num < 0)\n num = -num;\n\n return (w > num) - (w < num);\n }\n\n /*\n * Number Theoretic Functions\n */\n\n legendre(num) {\n const red = HAS_BIGINT ? BN.red(num) : BN.mont(num);\n return this.toRed(red).redLegendre();\n }\n\n jacobi(num) {\n // See: A Binary Algorithm for the Jacobi Symbol\n // J. Shallit, J. Sorenson\n // Page 3, Section 3\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (num.isZero() || num.isEven())\n throw new Error('jacobi: `num` must be odd.');\n\n let a = this._cloneNormal();\n let b = num.clone();\n let j = 1;\n\n if (b.isNeg()) {\n if (a.isNeg())\n j = -1;\n b.ineg();\n }\n\n if (a.isNeg() || a.ucmp(b) >= 0)\n a.imod(b);\n\n while (!a.isZero()) {\n const bits = a._makeOdd();\n\n if (bits & 1) {\n const bmod8 = b.andln(7);\n\n if (bmod8 === 3 || bmod8 === 5)\n j = -j;\n }\n\n if (a.ucmp(b) < 0) {\n [a, b] = [b, a];\n\n if (a.andln(3) === 3 && b.andln(3) === 3)\n j = -j;\n }\n\n a._isub(a, b).iushrn(1);\n\n const bmod8 = b.andln(7);\n\n if (bmod8 === 3 || bmod8 === 5)\n j = -j;\n }\n\n if (b.cmpn(1) !== 0)\n return 0;\n\n return j;\n }\n\n kronecker(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero())\n return num.ucmpn(1) === 0 ? 1 : 0;\n\n if (num.isZero())\n return this.ucmpn(1) === 0 ? 1 : 0;\n\n if (((this.words[0] | num.words[0]) & 1) === 0)\n return 0;\n\n const x = this;\n const y = num.clone();\n const bits = y._makeOdd();\n const table = [0, 1, 0, -1, 0, -1, 0, 1];\n\n let k = x.jacobi(y);\n\n if (bits & 1)\n k *= table[x.andln(7)];\n\n return k | 0;\n }\n\n igcd(num) {\n return this.gcd(num)._move(this);\n }\n\n gcd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero())\n return num.abs();\n\n if (num.isZero())\n return this.abs();\n\n let a = this.clone();\n let b = num.clone();\n\n a.negative = 0;\n b.negative = 0;\n\n // Remove common factor of two.\n const shift = a._factor2(b);\n\n if (shift !== 0) {\n a.iushrn(shift);\n b.iushrn(shift);\n }\n\n for (;;) {\n a._makeOdd();\n b._makeOdd();\n\n const cmp = a.ucmp(b);\n\n if (cmp < 0) {\n // a > b\n [a, b] = [b, a];\n } else if (cmp === 0 || b.ucmpn(1) === 0) {\n // Break if a == b.\n // Break if b == 1 to avoid repeated subtraction.\n break;\n }\n\n a._isub(a, b);\n }\n\n return b.iushln(shift);\n }\n\n ilcm(num) {\n return this.lcm(num)._move(this);\n }\n\n lcm(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero() || num.isZero())\n return new BN(0);\n\n return this.quo(this.gcd(num)).mul(num).iabs();\n }\n\n egcd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (this.isZero()) {\n return [\n new BN(0),\n new BN(num.sign()),\n num.abs()\n ];\n }\n\n if (num.isZero()) {\n return [\n new BN(this.sign()),\n new BN(0),\n this.abs()\n ];\n }\n\n const x = this.clone();\n const y = num.clone();\n\n x.negative = 0;\n y.negative = 0;\n\n // A * x + B * y = x\n const A = new BN(1);\n const B = new BN(0);\n\n // C * x + D * y = y\n const C = new BN(0);\n const D = new BN(1);\n\n // Remove common factor of two.\n const g = x._factor2(y);\n\n if (g > 0) {\n x.iushrn(g);\n y.iushrn(g);\n }\n\n const xp = x.clone();\n const yp = y.clone();\n\n while (!x.isZero()) {\n let i = x._makeOdd();\n let j = y._makeOdd();\n\n while (i--) {\n if (A.isOdd() || B.isOdd()) {\n A.iadd(yp);\n B.isub(xp);\n }\n\n A.iushrn(1);\n B.iushrn(1);\n }\n\n while (j--) {\n if (C.isOdd() || D.isOdd()) {\n C.iadd(yp);\n D.isub(xp);\n }\n\n C.iushrn(1);\n D.iushrn(1);\n }\n\n if (x.cmp(y) >= 0) {\n x.isub(y);\n A.isub(C);\n B.isub(D);\n } else {\n y.isub(x);\n C.isub(A);\n D.isub(B);\n }\n }\n\n if (this.negative !== 0)\n C.ineg();\n\n if (num.negative !== 0)\n D.ineg();\n\n return [C, D, y.iushln(g)];\n }\n\n iinvert(num) {\n return this.invert(num)._move(this);\n }\n\n invert(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n range(num.sign() > 0, 'invert');\n\n if (num.isOdd())\n return this._invertp(num);\n\n if (num.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n const [s,, g] = this.egcd(num);\n\n if (g.cmpn(1) !== 0)\n throw new RangeError('Not invertible.');\n\n return s.imod(num);\n }\n\n ifermat(num) {\n return this.fermat(num)._move(this);\n }\n\n fermat(num) {\n const red = HAS_BIGINT ? BN.red(num) : BN.mont(num);\n return this.toRed(red).redFermat().fromRed();\n }\n\n ipowm(y, m, mont) {\n return this.powm(y, m, mont)._move(this);\n }\n\n powm(y, m, mont) {\n const red = !HAS_BIGINT && mont ? BN.mont(m) : BN.red(m);\n return this.toRed(red).redPow(y).fromRed();\n }\n\n ipowmn(y, m, mont) {\n return this.powmn(y, m, mont)._move(this);\n }\n\n powmn(y, m, mont) {\n const red = mont ? BN.mont(m) : BN.red(m);\n return this.toRed(red).redPown(y).fromRed();\n }\n\n isqrtm(p) {\n return this.sqrtm(p)._move(this);\n }\n\n sqrtm(p) {\n enforce(BN.isBN(p), 'p', 'bignum');\n\n let red;\n\n if (p.andln(3) === 3 || p.andln(7) === 5) {\n // Probably not worth the setup.\n red = BN.red(p);\n } else {\n red = BN.mont(p);\n }\n\n return this.toRed(red).redSqrt().fromRed();\n }\n\n isqrtpq(p, q) {\n return this.sqrtpq(p, q)._move(this);\n }\n\n sqrtpq(p, q) {\n const sp = this.sqrtm(p);\n const sq = this.sqrtm(q);\n const [mp, mq] = p.egcd(q);\n const lhs = sq.mul(mp).mul(p);\n const rhs = sp.mul(mq).mul(q);\n const n = p.mul(q);\n\n return lhs.iadd(rhs).imod(n);\n }\n\n /*\n * Primality Testing\n */\n\n isPrime(rng, reps, limit) {\n enforce((reps >>> 0) === reps, 'reps', 'uint32');\n\n if (!this.isPrimeMR(rng, reps + 1, true))\n return false;\n\n if (!this.isPrimeLucas(limit))\n return false;\n\n return true;\n }\n\n isPrimeMR(rng, reps, force2 = false) {\n enforce((reps >>> 0) === reps, 'reps', 'uint32');\n enforce(reps > 0, 'reps', 'integer');\n enforce(typeof force2 === 'boolean', 'force2', 'boolean');\n\n const n = this;\n\n if (n.cmpn(7) < 0) {\n return n.cmpn(2) === 0\n || n.cmpn(3) === 0\n || n.cmpn(5) === 0;\n }\n\n if (n.isEven())\n return false;\n\n const nm1 = n.subn(1);\n const nm3 = nm1.subn(2);\n const k = nm1.zeroBits();\n const q = nm1.ushrn(k);\n\n const red = BN.red(n);\n const rnm1 = nm1.toRed(red);\n const rone = new BN(1).toRed(red);\n\nnext:\n for (let i = 0; i < reps; i++) {\n let x;\n\n if (i === reps - 1 && force2) {\n x = new BN(2);\n } else {\n x = BN.random(rng, 0, nm3);\n x.iaddn(2);\n }\n\n let y = x.toRed(red).redPow(q);\n\n if (y.cmp(rone) === 0 || y.cmp(rnm1) === 0)\n continue;\n\n for (let j = 1; j < k; j++) {\n y = y.redSqr();\n\n if (y.cmp(rnm1) === 0)\n continue next;\n\n if (y.cmp(rone) === 0)\n return false;\n }\n\n return false;\n }\n\n return true;\n }\n\n isPrimeLucas(limit = 0) {\n enforce((limit >>> 0) === limit, 'limit', 'uint32');\n\n const n = this;\n\n // Ignore 0 and 1.\n if (n.cmpn(1) <= 0)\n return false;\n\n // Two is the only even prime.\n if (n.isEven())\n return n.cmpn(2) === 0;\n\n let p = 3;\n\n for (;;) {\n if (p > 10000) {\n // Thought to be impossible.\n throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`);\n }\n\n if (limit !== 0 && p > limit) {\n // Optional DoS limit.\n return false;\n }\n\n const d = new BN(p * p - 4);\n const j = d.jacobi(n);\n\n if (j === -1)\n break;\n\n if (j === 0)\n return n.cmpn(p + 2) === 0;\n\n if (p === 40) {\n if (n.isSquare())\n return false;\n }\n\n p += 1;\n }\n\n const s = n.addn(1);\n const r = s._makeOdd();\n\n let vk = new BN(2);\n let vk1 = new BN(p);\n\n for (let i = s.bitLength(); i >= 0; i--) {\n if (s.utestn(i)) {\n vk = vk.mul(vk1).isubn(p).imod(n);\n vk1 = vk1.sqr().isubn(2).imod(n);\n } else {\n vk1 = vk1.mul(vk).isubn(p).imod(n);\n vk = vk.sqr().isubn(2).imod(n);\n }\n }\n\n if (vk.cmpn(2) === 0 || vk.cmp(n.subn(2)) === 0) {\n const a = vk.muln(p).imod(n);\n const b = vk1.ushln(1).imod(n);\n\n if (a.cmp(b) === 0)\n return true;\n }\n\n for (let t = 0; t < r - 1; t++) {\n if (vk.isZero())\n return true;\n\n if (vk.cmpn(2) === 0)\n return false;\n\n vk = vk.sqr().isubn(2).imod(n);\n }\n\n return false;\n }\n\n /*\n * Twos Complement\n */\n\n toTwos(width) {\n if (this.negative !== 0)\n return this.abs().inotn(width).iaddn(1);\n\n return this.clone();\n }\n\n fromTwos(width) {\n enforce((width >>> 0) === width, 'width', 'uint32');\n range(width > 0, 'width');\n\n if (this.testn(width - 1))\n return this.notn(width).iaddn(1).ineg();\n\n return this.clone();\n }\n\n /*\n * Reduction Context\n */\n\n toRed(ctx) {\n enforce(ctx instanceof Red, 'ctx', 'reduction context');\n\n if (this.red)\n throw new Error('Already in reduction context.');\n\n return ctx.convertTo(this);\n }\n\n fromRed() {\n red(this.red, 'fromRed');\n return this.red.convertFrom(this);\n }\n\n forceRed(ctx) {\n enforce(ctx instanceof Red, 'ctx', 'reduction context');\n\n if (this.red) {\n if (!ctx.m.eq(this.red.m) || ctx.mont !== this.red.mont)\n throw new Error('Already in reduction context.');\n } else {\n range(this.negative === 0, 'red');\n range(this.ucmp(ctx.m) < 0, 'red');\n }\n\n return this.clone()._forceRed(ctx);\n }\n\n redIAdd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIAdd');\n return this.red.iadd(this, num);\n }\n\n redAdd(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redAdd');\n return this.red.add(this, num);\n }\n\n redIAddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIAddn');\n return this.red.iaddn(this, num);\n }\n\n redAddn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redAddn');\n return this.red.addn(this, num);\n }\n\n redISub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redISub');\n return this.red.isub(this, num);\n }\n\n redSub(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redSub');\n return this.red.sub(this, num);\n }\n\n redISubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redISubn');\n return this.red.isubn(this, num);\n }\n\n redSubn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redSubn');\n return this.red.subn(this, num);\n }\n\n redIMul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIMul');\n return this.red.imul(this, num);\n }\n\n redMul(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redMul');\n return this.red.mul(this, num);\n }\n\n redIMuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIMuln');\n return this.red.imuln(this, num);\n }\n\n redMuln(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redMuln');\n return this.red.muln(this, num);\n }\n\n redIDiv(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIDiv');\n return this.red.idiv(this, num);\n }\n\n redDiv(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redDiv');\n return this.red.div(this, num);\n }\n\n redIDivn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIDivn');\n return this.red.idivn(this, num);\n }\n\n redDivn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redDivn');\n return this.red.divn(this, num);\n }\n\n redIPow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIPow');\n nonred(!num.red, 'redIPow');\n return this.red.ipow(this, num);\n }\n\n redPow(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redPow');\n nonred(!num.red, 'redPow');\n return this.red.pow(this, num);\n }\n\n redIPown(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redIPown');\n return this.red.ipown(this, num);\n }\n\n redPown(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redPown');\n return this.red.pown(this, num);\n }\n\n redISqr() {\n red(this.red, 'redISqr');\n return this.red.isqr(this);\n }\n\n redSqr() {\n red(this.red, 'redSqr');\n return this.red.sqr(this);\n }\n\n redISqrt() {\n red(this.red, 'redISqrt');\n return this.red.isqrt(this);\n }\n\n redSqrt() {\n red(this.red, 'redSqrt');\n return this.red.sqrt(this);\n }\n\n redIDivSqrt(v) {\n red(this.red, 'redIDivSqrt');\n return this.red.idivsqrt(this, v);\n }\n\n redDivSqrt(v) {\n red(this.red, 'redDivSqrt');\n return this.red.divsqrt(this, v);\n }\n\n redIsSquare() {\n red(this.red, 'redIsSquare');\n return this.red.isSquare(this);\n }\n\n redIShl(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redIShl');\n nonred(!num.red, 'redIShl');\n return this.red.ishl(this, num);\n }\n\n redShl(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redShl');\n nonred(!num.red, 'redShl');\n return this.red.shl(this, num);\n }\n\n redIShln(num) {\n enforce((num >>> 0) === num, 'num', 'uint32');\n red(this.red, 'redIShln');\n return this.red.ishln(this, num);\n }\n\n redShln(num) {\n enforce((num >>> 0) === num, 'num', 'uint32');\n red(this.red, 'redShln');\n return this.red.shln(this, num);\n }\n\n redINeg() {\n red(this.red, 'redINeg');\n return this.red.ineg(this);\n }\n\n redNeg() {\n red(this.red, 'redNeg');\n return this.red.neg(this);\n }\n\n redEq(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n red(this.red, 'redEq');\n return this.red.eq(this, num);\n }\n\n redEqn(num) {\n enforce(isSMI(num), 'num', 'smi');\n red(this.red, 'redEqn');\n return this.red.eqn(this, num);\n }\n\n redIsHigh() {\n red(this.red, 'redIsHigh');\n return this.red.isHigh(this);\n }\n\n redIsLow() {\n red(this.red, 'redIsLow');\n return this.red.isLow(this);\n }\n\n redIsOdd() {\n red(this.red, 'redIsOdd');\n return this.red.isOdd(this);\n }\n\n redIsEven() {\n red(this.red, 'redIsEven');\n return this.red.isEven(this);\n }\n\n redLegendre() {\n red(this.red, 'redLegendre');\n return this.red.legendre(this);\n }\n\n redJacobi() {\n red(this.red, 'redJacobi');\n return this.red.jacobi(this);\n }\n\n redKronecker() {\n red(this.red, 'redKronecker');\n return this.red.kronecker(this);\n }\n\n redIInvert() {\n red(this.red, 'redIInvert');\n return this.red.iinvert(this);\n }\n\n redInvert() {\n red(this.red, 'redInvert');\n return this.red.invert(this);\n }\n\n redIFermat() {\n red(this.red, 'redIFermat');\n return this.red.ifermat(this);\n }\n\n redFermat() {\n red(this.red, 'redFermat');\n return this.red.fermat(this);\n }\n\n /*\n * Internal\n */\n\n _move(dest) {\n dest.words = this.words;\n dest.length = this.length;\n dest.negative = this.negative;\n dest.red = this.red;\n return dest;\n }\n\n _alloc(size) {\n while (this.words.length < size)\n this.words.push(0);\n\n return this;\n }\n\n _expand(size) {\n this._alloc(size);\n\n while (this.length < size)\n this.words[this.length++] = 0;\n\n return this;\n }\n\n _strip() {\n while (this.length > 1 && this.words[this.length - 1] === 0)\n this.length -= 1;\n\n return this._normalize();\n }\n\n _normalize() {\n assert(this.length > 0);\n\n // -0 = 0\n if (this.length === 1 && this.words[0] === 0)\n this.negative = 0;\n\n return this;\n }\n\n _check() {\n // We never have a zero length number.\n assert(this.length > 0);\n\n // Cannot exceed array bounds.\n assert(this.length <= this.words.length);\n\n if (this.length === 1) {\n // Must be normalized.\n if (this.words[0] === 0)\n assert(this.negative === 0);\n return this;\n }\n\n // Must be stripped.\n assert(this.words[this.length - 1] !== 0);\n\n return this;\n }\n\n _invertp(p) {\n // Penk's right shift binary EGCD.\n //\n // See: The Art of Computer Programming,\n // Volume 2, Seminumerical Algorithms\n // Donald E. Knuth\n // Exercise 4.5.2.39\n enforce(BN.isBN(p), 'p', 'bignum');\n range(p.sign() > 0, 'invert');\n assert(p.isOdd());\n\n if (p.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n const a = this.clone();\n const b = p.clone();\n const u = new BN(1);\n const v = new BN(0);\n\n if (a.isNeg() || a.ucmp(b) >= 0)\n a.imod(b);\n\n while (!a.isZero()) {\n let i = a._makeOdd();\n let j = b._makeOdd();\n\n while (i--) {\n if (u.isOdd())\n u._iadd(u, p);\n\n u.iushrn(1);\n }\n\n while (j--) {\n if (v.isOdd())\n v._iadd(v, p);\n\n v.iushrn(1);\n }\n\n if (a.ucmp(b) >= 0) {\n a._isub(a, b);\n if (u.ucmp(v) < 0) {\n u._isub(v, u);\n u._isub(p, u);\n } else {\n u._isub(u, v);\n }\n } else {\n b._isub(b, a);\n if (v.ucmp(u) < 0) {\n v._isub(u, v);\n v._isub(p, v);\n } else {\n v._isub(v, u);\n }\n }\n }\n\n if (b.cmpn(1) !== 0)\n throw new RangeError('Not invertible.');\n\n assert(v.negative === 0);\n assert(v.ucmp(p) < 0);\n\n return v;\n }\n\n _makeOdd() {\n const shift = this.zeroBits();\n\n if (shift > 0)\n this.iushrn(shift);\n\n return shift;\n }\n\n _factor2(num) {\n // Find common factor of two.\n // Expects inputs to be non-zero.\n if ((this.words[0] | num.words[0]) & 1)\n return 0;\n\n const len = Math.min(this.length, num.length);\n\n let r = 0;\n\n for (let i = 0; i < len; i++) {\n const b = zeroBits(this.words[i] | num.words[i]);\n\n r += b;\n\n if (b !== 26)\n break;\n }\n\n return r;\n }\n\n _cloneNormal() {\n return this.red ? this.fromRed() : this.clone();\n }\n\n _forceRed(ctx) {\n this.red = ctx;\n return this;\n }\n\n /*\n * Helpers\n */\n\n clone() {\n const copy = new BN();\n\n copy.words = new Array(this.length);\n\n for (let i = 0; i < this.length; i++)\n copy.words[i] = this.words[i];\n\n copy.length = this.length;\n copy.negative = this.negative;\n copy.red = this.red;\n\n return copy;\n }\n\n inject(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n this._alloc(num.length);\n\n for (let i = 0; i < num.length; i++)\n this.words[i] = num.words[i];\n\n this.length = num.length;\n this.negative = num.negative;\n this.red = num.red;\n\n return this;\n }\n\n set(num, endian) {\n return this.fromNumber(num, endian);\n }\n\n swap(num) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n const x = this;\n const y = num;\n\n [x.words, y.words] = [y.words, x.words];\n [x.length, y.length] = [y.length, x.length];\n [x.negative, y.negative] = [y.negative, x.negative];\n [x.red, y.red] = [y.red, x.red];\n\n return x;\n }\n\n reverse() {\n const neg = this.negative;\n\n this.fromBuffer(this.toBuffer('be'), 'le');\n this.negative = neg;\n\n return this;\n }\n\n byteLength() {\n return Math.ceil(this.bitLength() / 8);\n }\n\n bitLength() {\n const w = this.words[this.length - 1];\n const hi = countBits(w);\n return (this.length - 1) * 26 + hi;\n }\n\n zeroBits() {\n if (this.isZero())\n return 0;\n\n if (this.isOdd())\n return 0;\n\n let r = 0;\n\n for (let i = 0; i < this.length; i++) {\n const b = zeroBits(this.words[i]);\n\n r += b;\n\n if (b !== 26)\n break;\n }\n\n return r;\n }\n\n isSafe() {\n if (this.length <= 2)\n return true;\n\n if (this.length === 3 && this.words[2] === 0x01)\n return true;\n\n return false;\n }\n\n word(pos) {\n enforce((pos >>> 0) === pos, 'pos', 'uint32');\n\n if (pos >= this.length)\n return 0;\n\n return this.words[pos];\n }\n\n [custom]() {\n let prefix = 'BN';\n\n if (this.red)\n prefix = 'BN-R';\n\n return `<${prefix}: ${this.toString(10)}>`;\n }\n\n /*\n * Conversion\n */\n\n toNumber() {\n let num = this.words[0];\n\n if (this.length === 2) {\n num += this.words[1] * 0x4000000;\n } else if (this.length === 3 && this.words[2] === 0x01) {\n // Note: at this stage it is known that the top bit is set.\n num += 0x10000000000000 + (this.words[1] * 0x4000000);\n } else if (this.length > 2) {\n throw new RangeError('Number can only safely store up to 53 bits.');\n }\n\n return this.negative !== 0 ? -num : num;\n }\n\n toDouble() {\n let num = 0;\n\n for (let i = this.length - 1; i >= 0; i--)\n num = (num * 0x4000000) + this.words[i];\n\n return this.negative !== 0 ? -num : num;\n }\n\n valueOf() {\n return this.toDouble();\n }\n\n toBigInt() {\n if (!HAS_BIGINT)\n throw new Error('BigInt is not supported!');\n\n const s52 = BigInt(52);\n const s26 = BigInt(26);\n\n let i = this.length - 1;\n let num = BigInt(0);\n\n for (; i >= 1; i -= 2) {\n const hi = this.words[i] * 0x4000000;\n const lo = this.words[i - 1];\n\n num = (num << s52) | BigInt(hi + lo);\n }\n\n if (i >= 0)\n num = (num << s26) | BigInt(this.words[0]);\n\n return this.negative !== 0 ? -num : num;\n }\n\n toBool() {\n return !this.isZero();\n }\n\n toString(base, padding) {\n base = getBase(base);\n\n if (padding == null)\n padding = 0;\n\n if (padding === 0)\n padding = 1;\n\n enforce((base >>> 0) === base, 'base', 'uint32');\n enforce((padding >>> 0) === padding, 'padding', 'uint32');\n\n if (base < 2 || base > 36)\n throw new RangeError('Base ranges between 2 and 36.');\n\n this._check();\n\n if (base === 16) {\n let out = '';\n let off = 0;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const w = this.words[i];\n const word = (((w << off) | carry) & 0xffffff).toString(16);\n\n carry = (w >>> (24 - off)) & 0xffffff;\n\n if (carry !== 0 || i !== this.length - 1)\n out = zeros[6 - word.length] + word + out;\n else\n out = word + out;\n\n off += 2;\n\n if (off >= 26) {\n off -= 26;\n i -= 1;\n }\n }\n\n if (carry !== 0)\n out = carry.toString(16) + out;\n\n while (out.length % padding !== 0)\n out = '0' + out;\n\n if (this.negative !== 0)\n out = '-' + out;\n\n return out;\n }\n\n const groupSize = groupSizes[base - 1];\n const groupBase = groupBases[base - 1];\n const c = this.clone();\n\n let out = '';\n\n c.negative = 0;\n\n while (!c.isZero()) {\n const r = c.remrn(groupBase).toString(base);\n\n c.iquon(groupBase);\n\n if (!c.isZero())\n out = zeros[groupSize - r.length] + r + out;\n else\n out = r + out;\n }\n\n if (this.isZero())\n out = '0';\n\n while (out.length % padding !== 0)\n out = '0' + out;\n\n if (this.negative !== 0)\n out = '-' + out;\n\n return out;\n }\n\n toJSON() {\n return this.toString(16, 2);\n }\n\n toArray(endian, length) {\n return this.toArrayLike(Array, endian, length);\n }\n\n toBuffer(endian, length) {\n return this.toArrayLike(Buffer, endian, length);\n }\n\n toArrayLike(ArrayType, endian, length) {\n if (endian == null)\n endian = 'be';\n\n if (length == null)\n length = 0;\n\n enforce(typeof ArrayType === 'function', 'ArrayType', 'function');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n enforce((length >>> 0) === length, 'length', 'uint32');\n\n this._check();\n\n const bytes = this.byteLength();\n const size = length || Math.max(1, bytes);\n\n if (bytes > size)\n throw new RangeError('Byte array longer than desired length.');\n\n const res = allocate(ArrayType, size);\n\n // See: https://github.com/indutny/bn.js/pull/222\n if (endian === 'be') {\n let pos = res.length - 1;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const shift = (i & 3) << 1;\n const word = (this.words[i] << shift) | carry;\n\n res[pos--] = word & 0xff;\n\n if (pos >= 0)\n res[pos--] = (word >>> 8) & 0xff;\n\n if (pos >= 0)\n res[pos--] = (word >>> 16) & 0xff;\n\n if (shift === 6) {\n if (pos >= 0)\n res[pos--] = (word >>> 24) & 0xff;\n\n carry = 0;\n } else {\n carry = word >>> 24;\n }\n }\n\n if (pos >= 0) {\n res[pos--] = carry;\n\n while (pos >= 0)\n res[pos--] = 0;\n\n carry = 0;\n }\n\n assert(carry === 0);\n } else {\n let pos = 0;\n let carry = 0;\n\n for (let i = 0; i < this.length; i++) {\n const shift = (i & 3) << 1;\n const word = (this.words[i] << shift) | carry;\n\n res[pos++] = word & 0xff;\n\n if (pos < res.length)\n res[pos++] = (word >>> 8) & 0xff;\n\n if (pos < res.length)\n res[pos++] = (word >>> 16) & 0xff;\n\n if (shift === 6) {\n if (pos < res.length)\n res[pos++] = (word >>> 24) & 0xff;\n\n carry = 0;\n } else {\n carry = word >>> 24;\n }\n }\n\n if (pos < res.length) {\n res[pos++] = carry;\n\n while (pos < res.length)\n res[pos++] = 0;\n\n carry = 0;\n }\n\n assert(carry === 0);\n }\n\n return res;\n }\n\n encode(endian, length) {\n return this.toBuffer(endian, length);\n }\n\n /*\n * Instantiation\n */\n\n of(num, endian) {\n return this.fromNumber(num, endian);\n }\n\n fromNumber(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(isInteger(num), 'num', 'integer');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n const neg = (num < 0) | 0;\n\n if (neg)\n num = -num;\n\n if (num < 0x4000000) {\n this.words[0] = num & 0x3ffffff;\n this.length = 1;\n } else if (num < 0x10000000000000) {\n this.words = [\n num & 0x3ffffff,\n (num / 0x4000000) & 0x3ffffff\n ];\n this.length = 2;\n } else {\n this.words = [\n num & 0x3ffffff,\n (num / 0x4000000) & 0x3ffffff,\n 1\n ];\n this.length = 3;\n }\n\n this.negative = neg;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromDouble(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(typeof num === 'number', 'num', 'double');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (!isFinite(num))\n num = 0;\n\n const neg = (num <= -1) | 0;\n\n if (num < 0)\n num = -num;\n\n num = Math.floor(num);\n\n this.words = [];\n\n while (num > 0) {\n const lo = num % 0x4000000;\n const hi = (num - lo) / 0x4000000;\n\n this.words.push(lo);\n\n num = hi;\n }\n\n if (this.words.length === 0)\n this.words.push(0);\n\n this.length = this.words.length;\n this.negative = neg;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromBigInt(num, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(typeof num === 'bigint', 'num', 'bigint');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (!HAS_BIGINT)\n throw new Error('BigInt is not supported!');\n\n // You know the implementation has a\n // problem when strings are twice\n // as fast as bigints.\n const start = (num < BigInt(0)) | 0;\n\n this._fromHex(num.toString(16), start);\n this.negative = start;\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n fromBool(value) {\n enforce(typeof value === 'boolean', 'value', 'boolean');\n\n this.words[0] = value | 0;\n this.length = 1;\n this.negative = 0;\n\n return this;\n }\n\n fromString(str, base, endian) {\n if (base === 'le' || base === 'be')\n [base, endian] = [endian, base];\n\n base = getBase(base);\n\n if (endian == null)\n endian = 'be';\n\n enforce(typeof str === 'string', 'string', 'string');\n enforce((base >>> 0) === base, 'base', 'uint32');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (base < 2 || base > 36)\n throw new Error('Base ranges between 2 and 36.');\n\n str = str.replace(/\\s+/g, '');\n\n let start = 0;\n\n if (str.length > 0 && str.charCodeAt(0) === 0x2d)\n start = 1;\n\n if (base === 16)\n this._fromHex(str, start);\n else\n this._fromBase(str, base, start);\n\n this.negative = start;\n\n this._normalize();\n\n if (endian === 'le')\n this.reverse();\n\n return this;\n }\n\n _fromHex(str, start) {\n this.length = Math.max(2, Math.ceil((str.length - start) / 6));\n this.words = new Array(this.length);\n\n for (let i = 0; i < this.length; i++)\n this.words[i] = 0;\n\n // Scan 24-bit chunks and add them to the number.\n let off = 0;\n let i = str.length - 6;\n let j = 0;\n\n for (; i >= start; i -= 6) {\n const w = parseHex(str, i, i + 6);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n\n // `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb.\n this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n if (i + 6 !== start) {\n const w = parseHex(str, start, i + 6);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] |= (w >>> (26 - off)) & 0x3fffff;\n }\n\n return this._strip();\n }\n\n _fromBase(str, base, start) {\n // Initialize as zero.\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n\n // Find length of limb in base.\n let limbLen = 0;\n let limbPow = 1;\n\n for (; limbPow <= 0x3ffffff; limbPow *= base)\n limbLen += 1;\n\n limbLen -= 1;\n limbPow = (limbPow / base) | 0;\n\n const total = str.length - start;\n const mod = total % limbLen;\n const end = Math.min(total, total - mod) + start;\n\n let i = start;\n\n for (; i < end; i += limbLen) {\n const word = parseBase(str, i, i + limbLen, base);\n\n this.imuln(limbPow);\n this._iaddn(word);\n }\n\n if (mod !== 0) {\n const pow = Math.pow(base, mod);\n const word = parseBase(str, i, str.length, base);\n\n this.imuln(pow);\n this._iaddn(word);\n }\n\n return this;\n }\n\n fromJSON(json) {\n if (BN.isBN(json)) {\n if (json.red)\n return json.fromRed();\n\n return json.clone();\n }\n\n if (Array.isArray(json)) {\n for (const chunk of json)\n enforce(typeof chunk === 'string', 'chunk', 'string');\n\n json = json.join('');\n }\n\n return this.fromString(json, 16);\n }\n\n fromBN(num) {\n return this.inject(num);\n }\n\n fromArray(data, endian) {\n enforce(Array.isArray(data), 'data', 'array');\n return this.fromArrayLike(data, endian);\n }\n\n fromBuffer(data, endian) {\n enforce(Buffer.isBuffer(data), 'data', 'buffer');\n return this.fromArrayLike(data, endian);\n }\n\n fromArrayLike(data, endian) {\n if (endian == null)\n endian = 'be';\n\n enforce(data && (data.length >>> 0) === data.length, 'data', 'array-like');\n enforce(endian === 'be' || endian === 'le', 'endian', 'endianness');\n\n if (data.length === 0) {\n this.words[0] = 0;\n this.length = 1;\n this.negative = 0;\n return this;\n }\n\n this.length = Math.max(2, Math.ceil(data.length / 3));\n this.words = new Array(this.length);\n this.negative = 0;\n\n for (let i = 0; i < this.length; i++)\n this.words[i] = 0;\n\n const left = data.length % 3;\n\n let off = 0;\n let j = 0;\n let w = 0;\n\n if (endian === 'be') {\n for (let i = data.length - 1; i >= 2; i -= 3) {\n const w = data[i] | (data[i - 1] << 8) | (data[i - 2] << 16);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n switch (left) {\n case 2:\n w = data[1] | (data[0] << 8);\n break;\n case 1:\n w = data[0];\n break;\n }\n } else {\n const len = data.length - left;\n\n for (let i = 0; i < len; i += 3) {\n const w = data[i] | (data[i + 1] << 8) | (data[i + 2] << 16);\n\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n\n off += 24;\n\n if (off >= 26) {\n off -= 26;\n j += 1;\n }\n }\n\n switch (left) {\n case 2:\n w = data[len] | (data[len + 1] << 8);\n break;\n case 1:\n w = data[len];\n break;\n }\n }\n\n if (left > 0) {\n this.words[j] |= (w << off) & 0x3ffffff;\n this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n }\n\n return this._strip();\n }\n\n decode(data, endian) {\n return this.fromBuffer(data, endian);\n }\n\n from(num, base, endian) {\n if (num == null)\n return this;\n\n if (base === 'le' || base === 'be')\n [base, endian] = [endian, base];\n\n if (typeof num === 'number')\n return this.fromNumber(num, endian);\n\n if (typeof num === 'bigint')\n return this.fromBigInt(num, endian);\n\n if (typeof num === 'string')\n return this.fromString(num, base, endian);\n\n if (typeof num === 'object') {\n if (BN.isBN(num))\n return this.fromBN(num, endian);\n\n if ((num.length >>> 0) === num.length)\n return this.fromArrayLike(num, endian);\n }\n\n if (typeof num === 'boolean')\n return this.fromBool(num);\n\n throw new TypeError('Non-numeric object passed to BN.');\n }\n\n /*\n * Static Methods\n */\n\n static min(...args) {\n let min = null;\n\n for (const num of args) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (!min || num.cmp(min) < 0)\n min = num;\n }\n\n return min || new BN(0);\n }\n\n static max(...args) {\n let max = null;\n\n for (const num of args) {\n enforce(BN.isBN(num), 'num', 'bignum');\n\n if (!max || num.cmp(max) > 0)\n max = num;\n }\n\n return max || new BN(0);\n }\n\n static cmp(a, b) {\n enforce(BN.isBN(a), 'a', 'bignum');\n return a.cmp(b);\n }\n\n static ucmp(a, b) {\n enforce(BN.isBN(a), 'a', 'bignum');\n return a.ucmp(b);\n }\n\n static red(num) {\n return new Red(num);\n }\n\n static barrett(num) {\n return new Barrett(num);\n }\n\n static mont(num) {\n return new Mont(num);\n }\n\n static _prime(name) {\n if (primes[name])\n return primes[name];\n\n let prime;\n\n if (name === 'p192')\n prime = new P192();\n else if (name === 'p224')\n prime = new P224();\n else if (name === 'p521')\n prime = new P521();\n else if (name === 'k256')\n prime = new K256();\n else if (name === 'p251')\n prime = new P251();\n else if (name === 'p25519')\n prime = new P25519();\n else if (name === 'p448')\n prime = new P448();\n else\n throw new Error(`Unknown prime: \"${name}\".`);\n\n primes[name] = prime;\n\n return prime;\n }\n\n static prime(name) {\n return BN._prime(name).p.clone();\n }\n\n static pow(num, exp) {\n if (num === 2)\n return BN.shift(1, exp);\n\n return new BN().fromNumber(num).pown(exp);\n }\n\n static shift(num, bits) {\n if (num === 1)\n return new BN(0).usetn(bits, 1);\n\n return new BN().fromNumber(num).ishln(bits);\n }\n\n static mask(bits) {\n return BN.shift(1, bits).isubn(1);\n }\n\n static randomBits(rng, bits) {\n enforce(rng != null, 'rng', 'rng');\n enforce((bits >>> 0) === bits, 'bits', 'uint32');\n\n if (typeof rng === 'object') {\n enforce(typeof rng.randomBytes === 'function', 'rng', 'rng');\n\n const size = (bits + 7) >>> 3;\n const total = size * 8;\n const bytes = rng.randomBytes(size);\n\n enforce(Buffer.isBuffer(bytes), 'bytes', 'buffer');\n\n if (bytes.length !== size)\n throw new RangeError('Invalid number of bytes returned from RNG.');\n\n const num = BN.fromBuffer(bytes);\n\n if (total > bits)\n num.iushrn(total - bits);\n\n return num;\n }\n\n enforce(typeof rng === 'function', 'rng', 'rng');\n\n const num = rng(bits);\n\n enforce(BN.isBN(num), 'num', 'bignum');\n range(num.negative === 0, 'RNG');\n nonred(!num.red, 'RNG');\n\n if (num.bitLength() > bits)\n throw new RangeError('Invalid number of bits returned from RNG.');\n\n return num;\n }\n\n static random(rng, min, max) {\n min = BN.cast(min, 16);\n max = BN.cast(max, 16);\n\n if (min.cmp(max) > 0)\n throw new RangeError('Minimum cannot be greater than maximum.');\n\n const space = max.sub(min).iabs();\n const bits = space.bitLength();\n\n if (bits === 0)\n return min.clone();\n\n for (;;) {\n const num = BN.randomBits(rng, bits);\n\n // Maximum is _exclusive_!\n if (num.cmp(space) >= 0)\n continue;\n\n // Minimum is _inclusive_!\n num.iadd(min);\n\n return num;\n }\n }\n\n static of(num, endian) {\n return new BN().of(num, endian);\n }\n\n static fromNumber(num, endian) {\n return new BN().fromNumber(num, endian);\n }\n\n static fromDouble(num, endian) {\n return new BN().fromDouble(num, endian);\n }\n\n static fromBigInt(num, endian) {\n return new BN().fromBigInt(num, endian);\n }\n\n static fromBool(value) {\n return new BN().fromBool(value);\n }\n\n static fromString(str, base, endian) {\n return new BN().fromString(str, base, endian);\n }\n\n static fromJSON(json) {\n return new BN().fromJSON(json);\n }\n\n static fromBN(num) {\n return new BN().fromBN(num);\n }\n\n static fromArray(data, endian) {\n return new BN().fromArray(data, endian);\n }\n\n static fromBuffer(data, endian) {\n return new BN().fromBuffer(data, endian);\n }\n\n static fromArrayLike(data, endian) {\n return new BN().fromArrayLike(data, endian);\n }\n\n static decode(data, endian) {\n return new BN().decode(data, endian);\n }\n\n static from(num, base, endian) {\n return new BN().from(num, base, endian);\n }\n\n static cast(num, base, endian) {\n if (BN.isBN(num))\n return num;\n\n return new BN(num, base, endian);\n }\n\n static isBN(obj) {\n return obj instanceof BN;\n }\n}\n\n/*\n * Static\n */\n\nBN.BN = BN;\nBN.wordSize = 26;\nBN.native = 0;\n\n/**\n * Prime\n */\n\nclass Prime {\n constructor(name, p) {\n // P = 2^N - K\n this.name = name;\n this.p = new BN(p, 16);\n this.n = this.p.bitLength();\n this.k = BN.shift(1, this.n).isub(this.p);\n this.lo = this.p.clone();\n this.one = this.p.clone();\n }\n\n ireduce(num) {\n // Assumes that `num` is less than `P^2`:\n // num = HI * (2^N - K) + HI * K + LO = HI * K + LO (mod P)\n const neg = num.negative !== 0;\n\n // Track bits.\n let bits = num.bitLength();\n\n // Must be less than P^2.\n assert(bits <= this.n * 2);\n\n // Ensure positive.\n num.negative = 0;\n\n // Reduce.\n while (bits > this.n) {\n // lo = num & ((1 << n) - 1)\n // num = num >> n\n this.split(num, this.lo);\n\n // num = num * K\n this.imulK(num);\n\n // num = num + lo\n num._iadd(num, this.lo);\n\n // bits = bitlen(num)\n bits = num.bitLength();\n }\n\n // Final reduction.\n const cmp = bits < this.n ? -1 : num.ucmp(this.p);\n\n if (cmp === 0) {\n num.words[0] = 0;\n num.length = 1;\n } else if (cmp > 0) {\n num._isub(num, this.p);\n } else {\n // Note: we shouldn't need to strip here.\n }\n\n // Adjust sign.\n if (neg && !num.isZero())\n num._isub(this.p, num);\n\n return num;\n }\n\n split(input, out) {\n input._split(this.n, out);\n }\n\n imulK(num) {\n return num.imul(this.k);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n throw new Error('Not implemented.');\n }\n\n fermat(x) {\n return this.pm2(x);\n }\n}\n\n/**\n * Prime (3 mod 4)\n */\n\nclass Prime34 extends Prime {\n constructor(name, p) {\n super(name, p);\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n throw new Error('Not implemented.');\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // r = x^((p + 1) / 4) mod p\n const {red} = x;\n const r = this.pp1d4(x);\n\n if (!red.sqr(r).eq(x))\n throw new SquareRootError(r);\n\n return r;\n }\n\n divsqrt(u, v) {\n // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p\n const {red} = u;\n const u2 = red.sqr(u);\n const u3 = red.mul(u2, u);\n const u5 = red.mul(u3, u2);\n const v3 = red.mul(red.sqr(v), v);\n const p = this.pm3d4(red.mul(u5, v3));\n const x = red.mul(red.mul(u3, v), p);\n const c = red.mul(v, red.sqr(x));\n\n if (c.eq(u))\n return x;\n\n throw new SquareRootError(x);\n }\n}\n\n/**\n * Prime (5 mod 8)\n */\n\nclass Prime58 extends Prime {\n constructor(name, p, sm1) {\n super(name, p);\n\n this.sm1 = new BN(sm1, 16);\n }\n\n pm5d8(x1) {\n // Exponent: (p - 5) / 8\n throw new Error('Not implemented.');\n }\n\n pp3d8(x1) {\n // Exponent: (p + 3) / 8\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // r = x^((p + 3) / 8) mod p\n const {red} = x;\n const sm1 = this.sm1._forceRed(red);\n const r = this.pp3d8(x);\n\n if (red.sqr(r).eq(x))\n return r;\n\n const c = red.mul(r, sm1);\n\n if (red.sqr(c).eq(x))\n return c;\n\n throw new SquareRootError(r);\n }\n\n divsqrt(u, v) {\n // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p\n const {red} = u;\n const sm1 = this.sm1._forceRed(red);\n const v3 = red.mul(red.sqr(v), v);\n const v7 = red.mul(red.sqr(v3), v);\n const p = this.pm5d8(red.mul(u, v7));\n const x = red.mul(red.mul(u, v3), p);\n const c = red.mul(v, red.sqr(x));\n\n if (c.eq(u))\n return x;\n\n const mc = red.ineg(c);\n\n if (mc.eq(u))\n return red.mul(x, sm1);\n\n if (mc.eq(red.mul(u, sm1)))\n throw new SquareRootError(red.mul(x, sm1));\n\n throw new SquareRootError(x);\n }\n}\n\n/**\n * Prime (1 mod 16)\n */\n\nclass Prime116 extends Prime {\n constructor(name, p, g) {\n super(name, p);\n\n this.g = new BN(g, 16);\n this.z = this.p.subn(1).zeroBits();\n }\n\n powS(x1) {\n // Exponent: (p - 1) / 2^k\n throw new Error('Not implemented.');\n }\n\n powE(x1) {\n // Exponent: (s + 1) / 2\n throw new Error('Not implemented.');\n }\n\n sqrt(x) {\n // Tonelli-Shanks (variable time).\n //\n // Constants:\n //\n // k = factors of 2 for (p - 1)\n // s = (p - 1) / 2^k\n // e = (s + 1) / 2\n // n = first non-square in F(p)\n //\n // Algorithm:\n //\n // g = n^s mod p\n // y = x^e mod p\n // b = x^s mod p\n //\n // loop:\n // t = b\n // m = 0\n //\n // while t != 1:\n // t = t^2 mod p\n // m += 1\n //\n // if m == 0:\n // break\n //\n // if m >= k:\n // fail\n //\n // t = g^(2^(k - m - 1)) mod p\n // g = t^2 mod p\n // y = y * t mod p\n // b = b * g mod p\n // k = m\n //\n // return y\n //\n const {red} = x;\n\n switch (red.jacobi(x)) {\n case -1:\n throw new SquareRootError(x);\n case 0:\n return x.clone();\n case 1:\n break;\n }\n\n let g = this.g._forceRed(red);\n let y = this.powE(x);\n let b = this.powS(x);\n let k = this.z;\n\n for (;;) {\n let t = b;\n let m = 0;\n\n while (t.cmpn(1) !== 0 && m < k) {\n t = red.sqr(t);\n m += 1;\n }\n\n if (m === 0)\n break;\n\n assert(m < k);\n\n t = red.sqrn(g, k - m - 1);\n g = red.sqr(t);\n y = red.mul(y, t);\n b = red.mul(b, g);\n k = m;\n }\n\n return y;\n }\n\n divsqrt(u, v) {\n const {red} = u;\n\n if (v.isZero())\n throw new SquareRootError(v);\n\n return this.sqrt(red.div(u, v));\n }\n}\n\n/**\n * P192\n */\n\nclass P192 extends Prime34 {\n constructor() {\n // 2^192 - 2^64 - 1 (= 3 mod 4)\n super('p192', 'ffffffff ffffffff ffffffff fffffffe'\n + 'ffffffff ffffffff');\n }\n\n imulK(num) {\n // K = 0x10000000000000001\n // K = 2^64 + 1\n const one = this.one.inject(num);\n return num.iushln(64)._iadd(num, one);\n }\n\n core(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 127x1 1x0 62x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x30 = red.sqrnmul(x24, 6, x6);\n const x31 = red.sqrnmul(x30, 1, x1);\n const x62 = red.sqrnmul(x31, 31, x31);\n const x124 = red.sqrnmul(x62, 62, x62);\n const x127 = red.sqrnmul(x124, 3, x3);\n const r0 = red.sqrn(x127, 1);\n const r1 = red.sqrnmul(r0, 62, x62);\n\n return r1;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 127x1 1x0 62x1\n return this.core(x1);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 127x1 1x0 62x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 128x1 62x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x4 = red.sqrnmul(x2, 2, x2);\n const x8 = red.sqrnmul(x4, 4, x4);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n const r0 = red.sqrn(x128, 62);\n\n return r0;\n }\n}\n\n/**\n * P224\n */\n\nclass P224 extends Prime116 {\n constructor() {\n // 2^224 - 2^96 + 1 (1 mod 16)\n super('p224', 'ffffffff ffffffff ffffffff ffffffff'\n + '00000000 00000000 00000001',\n '6a0fec67 8598a792 0c55b2d4 0b2d6ffb'\n + 'bea3d8ce f3fb3632 dc691b74');\n }\n\n imulK(num) {\n // K = 0xffffffffffffffffffffffff\n // K = 2^96 - 1\n const one = this.one.inject(num);\n return num.iushln(96)._isub(num, one);\n }\n\n powS(x1) {\n // Exponent: 2^128 - 1\n // Bits: 128x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x4 = red.sqrnmul(x2, 2, x2);\n const x8 = red.sqrnmul(x4, 4, x4);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n\n return x128;\n }\n\n powE(x1) {\n // Exponent: 2^127\n // Bits: 1x1 127x0\n const {red} = x1;\n const r0 = red.sqrn(x1, 127);\n\n return r0;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 127x1 1x0 96x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x48 = red.sqrnmul(x24, 24, x24);\n const x96 = red.sqrnmul(x48, 48, x48);\n const x120 = red.sqrnmul(x96, 24, x24);\n const x126 = red.sqrnmul(x120, 6, x6);\n const x127 = red.sqrnmul(x126, 1, x1);\n const r0 = red.sqrn(x127, 1);\n const r1 = red.sqrnmul(r0, 96, x96);\n\n return r1;\n }\n}\n\n/**\n * P521\n */\n\nclass P521 extends Prime34 {\n constructor() {\n // 2^521 - 1 (= 3 mod 4)\n super('p521', '000001ff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff');\n }\n\n imulK(num) {\n // K = 0x01\n return num;\n }\n\n core(x1) {\n // Exponent: 2^519 - 1\n // Bits: 519x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x7 = red.sqrnmul(x6, 1, x1);\n const x8 = red.sqrnmul(x7, 1, x1);\n const x16 = red.sqrnmul(x8, 8, x8);\n const x32 = red.sqrnmul(x16, 16, x16);\n const x64 = red.sqrnmul(x32, 32, x32);\n const x128 = red.sqrnmul(x64, 64, x64);\n const x256 = red.sqrnmul(x128, 128, x128);\n const x512 = red.sqrnmul(x256, 256, x256);\n const x519 = red.sqrnmul(x512, 7, x7);\n\n return x519;\n }\n\n pm3d4(x1) {\n // Exponent: 2^519 - 1\n // Bits: 519x1\n return this.core(x1);\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 519x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 1x1 519x0\n const {red} = x1;\n const r0 = red.sqrn(x1, 519);\n\n return r0;\n }\n}\n\n/**\n * K256\n */\n\nclass K256 extends Prime34 {\n constructor() {\n // 2^256 - 2^32 - 977 (= 3 mod 4)\n super('k256', 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff fffffffe fffffc2f');\n }\n\n split(input, output) {\n // 256 = 9 * 26 + 22\n const mask = 0x3fffff;\n const len = Math.min(input.length, 9);\n\n output._alloc(len + 1);\n\n for (let i = 0; i < len; i++)\n output.words[i] = input.words[i];\n\n output.length = len;\n\n if (input.length <= 9) {\n output._strip();\n input.words[0] = 0;\n input.length = 1;\n return;\n }\n\n // Shift by 9 limbs.\n let prev = input.words[9];\n let i = 10;\n\n output.words[output.length++] = prev & mask;\n output._strip();\n\n for (; i < input.length; i++) {\n const next = input.words[i] | 0;\n\n input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n\n prev = next;\n }\n\n prev >>>= 22;\n\n input.words[i - 10] = prev;\n\n if (prev === 0 && input.length > 10)\n input.length -= 10;\n else\n input.length -= 9;\n\n input._strip(); // Unsure if we need this.\n }\n\n imulK(num) {\n // K = 0x1000003d1 = [0x40, 0x3d1]\n // K = 2^32 + 977\n num._expand(num.length + 2);\n\n // Bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n let lo = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i];\n\n lo += w * 0x3d1;\n\n num.words[i] = lo & 0x3ffffff;\n\n lo = w * 0x40 + Math.floor(lo / 0x4000000);\n }\n\n // Fast length reduction.\n if (num.words[num.length - 1] === 0) {\n num.length -= 1;\n if (num.words[num.length - 1] === 0)\n num.length -= 1;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1, x2) {\n // Exponent: (p - 47) / 64\n // Bits: 223x1 1x0 22x1 4x0\n const {red} = x1;\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x9 = red.sqrnmul(x6, 3, x3);\n const x11 = red.sqrnmul(x9, 2, x2);\n const x22 = red.sqrnmul(x11, 11, x11);\n const x44 = red.sqrnmul(x22, 22, x22);\n const x88 = red.sqrnmul(x44, 44, x44);\n const x176 = red.sqrnmul(x88, 88, x88);\n const x220 = red.sqrnmul(x176, 44, x44);\n const x223 = red.sqrnmul(x220, 3, x3);\n const r0 = red.sqrn(x223, 1);\n const r1 = red.sqrnmul(r0, 22, x22);\n const r2 = red.sqrn(r1, 4);\n\n return r2;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 1, x1);\n const r4 = red.sqrn(r3, 1);\n const r5 = red.sqrnmul(r4, 2, x2);\n\n return r5;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 223x1 1x0 22x1 4x0 1x1 1x0 2x1 1x0 1x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 1, x1);\n const r4 = red.sqrn(r3, 1);\n const r5 = red.sqrnmul(r4, 2, x2);\n const r6 = red.sqrn(r5, 1);\n const r7 = red.sqrnmul(r6, 1, x1);\n\n return r7;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 223x1 1x0 22x1 4x0 2x1 2x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r2 = this.core(x1, x2);\n const r3 = red.sqrnmul(r2, 2, x2);\n const r4 = red.sqrn(r3, 2);\n\n return r4;\n }\n}\n\n/**\n * P251\n */\n\nclass P251 extends Prime34 {\n constructor() {\n // 2^251 - 9\n super('p251', '07ffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff fffffff7');\n }\n\n imulK(num) {\n // K = 0x09\n if (num.isZero())\n return num;\n\n let carry = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i] * 0x09 + carry;\n\n carry = w >>> 26;\n\n num.words[i] = w & 0x3ffffff;\n }\n\n if (carry !== 0) {\n num._alloc(num.length + 1);\n num.words[num.length++] = carry;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1) {\n // Exponent: 2^247 - 1\n // Bits: 247x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x12 = red.sqrnmul(x6, 6, x6);\n const x24 = red.sqrnmul(x12, 12, x12);\n const x48 = red.sqrnmul(x24, 24, x24);\n const x96 = red.sqrnmul(x48, 48, x48);\n const x192 = red.sqrnmul(x96, 96, x96);\n const x240 = red.sqrnmul(x192, 48, x48);\n const x246 = red.sqrnmul(x240, 6, x6);\n const x247 = red.sqrnmul(x246, 1, x1);\n\n return x247;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 247x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 247x1 1x0 1x1 1x0 1x1\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n const r3 = red.sqrn(r2, 1);\n const r4 = red.sqrnmul(r3, 1, x1);\n\n return r4;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 248x1 1x0\n const {red} = x1;\n const r0 = this.core(x1);\n const r1 = red.sqrnmul(r0, 1, x1);\n const r2 = red.sqrn(r1, 1);\n\n return r2;\n }\n}\n\n/**\n * P25519\n */\n\nclass P25519 extends Prime58 {\n constructor() {\n // 2^255 - 19 (= 5 mod 8)\n super('p25519', '7fffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffed',\n '2b832480 4fc1df0b 2b4d0099 3dfbd7a7'\n + '2f431806 ad2fe478 c4ee1b27 4a0ea0b0');\n }\n\n imulK(num) {\n // K = 0x13\n let carry = 0;\n\n for (let i = 0; i < num.length; i++) {\n const w = num.words[i] * 0x13 + carry;\n\n carry = w >>> 26;\n\n num.words[i] = w & 0x3ffffff;\n }\n\n if (carry !== 0) {\n num._alloc(num.length + 1);\n num.words[num.length++] = carry;\n }\n\n // Note: we shouldn't need to strip here.\n return num;\n }\n\n core(x1, x2) {\n // Exponent: 2^250 - 1\n // Bits: 250x1\n const {red} = x1;\n const x4 = red.sqrnmul(x2, 2, x2);\n const x5 = red.sqrnmul(x4, 1, x1);\n const x10 = red.sqrnmul(x5, 5, x5);\n const x20 = red.sqrnmul(x10, 10, x10);\n const x40 = red.sqrnmul(x20, 20, x20);\n const x50 = red.sqrnmul(x40, 10, x10);\n const x100 = red.sqrnmul(x50, 50, x50);\n const x200 = red.sqrnmul(x100, 100, x100);\n const x250 = red.sqrnmul(x200, 50, x50);\n\n return x250;\n }\n\n pm5d8(x1) {\n // Exponent: (p - 5) / 8\n // Bits: 250x1 1x0 1x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 250x1 1x0 1x1 1x0 2x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n const r3 = red.sqrn(r2, 1);\n const r4 = red.sqrnmul(r3, 2, x2);\n\n return r4;\n }\n\n pp3d8(x1) {\n // Exponent: (p + 3) / 8\n // Bits: 251x1 1x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrnmul(r0, 1, x1);\n const r2 = red.sqrn(r1, 1);\n\n return r2;\n }\n}\n\n/**\n * P448\n */\n\nclass P448 extends Prime34 {\n constructor() {\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n super('p448', 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff fffffffe ffffffff'\n + 'ffffffff ffffffff ffffffff ffffffff'\n + 'ffffffff ffffffff');\n }\n\n imulK(num) {\n // K = 0x100000000000000000000000000000000000000000000000000000001\n // K = 2^224 + 1\n const one = this.one.inject(num);\n return num.iushln(224)._iadd(num, one);\n }\n\n core(x1, x2) {\n // Exponent: 2^222 - 1\n // Bits: 222x1\n const {red} = x1;\n const x3 = red.sqrnmul(x2, 1, x1);\n const x6 = red.sqrnmul(x3, 3, x3);\n const x9 = red.sqrnmul(x6, 3, x3);\n const x11 = red.sqrnmul(x9, 2, x2);\n const x22 = red.sqrnmul(x11, 11, x11);\n const x44 = red.sqrnmul(x22, 22, x22);\n const x88 = red.sqrnmul(x44, 44, x44);\n const x176 = red.sqrnmul(x88, 88, x88);\n const x220 = red.sqrnmul(x176, 44, x44);\n const x222 = red.sqrnmul(x220, 2, x2);\n\n return x222;\n }\n\n pm3d4(x1) {\n // Exponent: (p - 3) / 4\n // Bits: 223x1 1x0 222x1\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const x222 = this.core(x1, x2);\n const r0 = red.sqrnmul(x222, 1, x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 222, x222);\n\n return r2;\n }\n\n pm2(x1) {\n // Exponent: p - 2\n // Bits: 223x1 1x0 222x1 1x0 1x1\n const {red} = x1;\n const r0 = this.pm3d4(x1);\n const r1 = red.sqrn(r0, 1);\n const r2 = red.sqrnmul(r1, 1, x1);\n\n return r2;\n }\n\n pp1d4(x1) {\n // Exponent: (p + 1) / 4\n // Bits: 224x1 222x0\n const {red} = x1;\n const x2 = red.sqrnmul(x1, 1, x1);\n const r0 = this.core(x1, x2);\n const r1 = red.sqrnmul(r0, 2, x2);\n const r2 = red.sqrn(r1, 222);\n\n return r2;\n }\n}\n\n/**\n * Reduction Engine\n */\n\nclass Red {\n constructor(m) {\n let prime = null;\n\n if (typeof m === 'string') {\n prime = BN._prime(m);\n m = prime.p;\n }\n\n enforce(BN.isBN(m), 'm', 'bignum');\n nonred(!m.red, 'reduction');\n range(m.sign() > 0, 'reduction');\n\n this.m = m;\n this.prime = prime;\n this.mb = null;\n this.sm1 = null;\n }\n\n _verify1(a) {\n range(a.negative === 0, 'red');\n red(a.red != null, 'red');\n }\n\n _verify2(a, b) {\n range((a.negative | b.negative) === 0, 'red');\n red(a.red != null && a.red === b.red, 'red');\n }\n\n get mont() {\n return false;\n }\n\n precompute() {\n // Precompute `sqrt(-1)` for primes congruent to 5 mod 8.\n if (this.sm1 === null && this.m.andln(7) === 5) {\n if (this.prime) {\n this.sm1 = this.prime.sm1.clone()._forceRed(this);\n } else {\n const x = new BN(2).toRed(this);\n const e = this.m.subn(1).iushrn(2);\n\n // sqrt(-1) = 2^((p - 1) / 4) mod p\n this.sm1 = this.pow(x, e);\n }\n }\n\n return this;\n }\n\n convertTo(num) {\n const res = num.mod(this.m);\n res.red = this;\n return res;\n }\n\n convertFrom(num) {\n const res = num.clone();\n res.red = null;\n return res;\n }\n\n intTo(a) {\n return a;\n }\n\n intFrom(a) {\n return a;\n }\n\n imod(a) {\n if (this.prime)\n return this.prime.ireduce(a)._forceRed(this);\n\n return a.imod(this.m)._forceRed(this);\n }\n\n iadd(a, b) {\n this._verify2(a, b);\n\n a._iadd(a, b);\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n return a;\n }\n\n add(a, b) {\n if (a.length < b.length)\n return this.iadd(b.clone(), a);\n\n return this.iadd(a.clone(), b);\n }\n\n iaddn(a, num) {\n this._verify1(a);\n\n if (num < 0)\n return this.isubn(a, -num);\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n a._iaddn(num);\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n return a;\n }\n\n addn(a, num) {\n return this.iaddn(a.clone(), num);\n }\n\n isub(a, b) {\n this._verify2(a, b);\n\n // 0: a - a mod m == 0\n // -1: a - b mod m == m - (b - a)\n // +1: a - b mod m == a - b\n const cmp = a.ucmp(b);\n\n if (cmp === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n if (cmp < 0) {\n a._isub(b, a);\n a._isub(this.m, a);\n } else {\n a._isub(a, b);\n }\n\n return a;\n }\n\n sub(a, b) {\n return this.isub(a.clone(), b);\n }\n\n isubn(a, num) {\n this._verify1(a);\n\n if (num < 0)\n return this.iaddn(a, -num);\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n // <: a - b mod m == m - (b - a)\n // >=: a - b mod m == a - b\n if (a.length === 1 && a.words[0] < num) {\n a.words[0] = num - a.words[0];\n a._isub(this.m, a);\n } else {\n a._isubn(num);\n }\n\n return a;\n }\n\n subn(a, num) {\n return this.isubn(a.clone(), num);\n }\n\n imul(a, b) {\n this._verify2(a, b);\n return this.imod(a.imul(b));\n }\n\n mul(a, b) {\n this._verify2(a, b);\n return this.imod(a.mul(b));\n }\n\n imuln(a, num) {\n this._verify1(a);\n\n if (a.isZero())\n return a;\n\n if (num === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n const neg = num < 0;\n\n if (neg)\n num = -num;\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n a.imuln(num);\n\n if (num <= 16) {\n // Quick reduction.\n while (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n } else {\n this.imod(a);\n }\n\n if (neg)\n this.ineg(a);\n\n return a;\n }\n\n muln(a, num) {\n return this.imuln(a.clone(), num);\n }\n\n idiv(a, b) {\n return this.div(a, b)._move(a);\n }\n\n div(a, b) {\n return this.mul(a, this.invert(b));\n }\n\n idivn(a, num) {\n return this.divn(a, num)._move(a);\n }\n\n divn(a, num) {\n return this.div(a, this.convertTo(new BN(num)));\n }\n\n ipow(a, num) {\n return this.pow(a, num)._move(a);\n }\n\n pow(a, num) {\n this._verify1(a);\n\n if (num.isNeg())\n a = this.invert(a);\n\n // Small exponent.\n if (num.length === 1)\n return this.pown(a, num.words[0]);\n\n // Call out to BigInt.\n if (HAS_BIGINT && !this.prime)\n return this.powInt(a, num);\n\n // Otherwise, a BN implementation.\n return this.powNum(a, num);\n }\n\n powNum(a, num) {\n // Sliding window (odd multiples only).\n const one = new BN(1).toRed(this);\n const wnd = new Array(WND_SIZE);\n const a2 = this.sqr(a);\n\n wnd[0] = a;\n\n for (let i = 1; i < WND_SIZE; i++)\n wnd[i] = this.mul(wnd[i - 1], a2);\n\n let i = num.bitLength();\n let r = one;\n\n while (i >= WND_WIDTH) {\n let width = WND_WIDTH;\n let bits = num.bits(i - width, width);\n\n if (bits < WND_SIZE) {\n r = this.sqr(r);\n i -= 1;\n continue;\n }\n\n while ((bits & 1) === 0) {\n width -= 1;\n bits >>= 1;\n }\n\n if (r === one) {\n r = wnd[bits >> 1].clone();\n } else {\n r = this.sqrn(r, width);\n r = this.mul(r, wnd[bits >> 1]);\n }\n\n i -= width;\n }\n\n if (i > 0) {\n const bits = num.bits(0, i);\n\n while (i--) {\n r = this.sqr(r);\n\n if ((bits >> i) & 1)\n r = this.mul(r, a);\n }\n }\n\n return r;\n }\n\n powInt(a, num) {\n if (this.mb === null)\n this.mb = this.m.toBigInt();\n\n const x = this.intFrom(a.toBigInt());\n const y = powInt(x, num, this.mb);\n const z = this.intTo(y);\n\n return BN.fromBigInt(z)._forceRed(this);\n }\n\n sqrn(a, n) {\n while (n--)\n a = this.sqr(a);\n\n return a;\n }\n\n sqrnmul(a, n, b) {\n return this.mul(this.sqrn(a, n), b);\n }\n\n ipown(a, num) {\n return this.pown(a, num)._move(a);\n }\n\n pown(a, num) {\n this._verify1(a);\n\n if (num < 0) {\n a = this.invert(a);\n num = -num;\n }\n\n if (num === 0)\n return new BN(1).toRed(this);\n\n if (num === 1)\n return a.clone();\n\n const bits = countBits(num);\n\n let r = a;\n\n for (let i = bits - 2; i >= 0; i--) {\n r = this.sqr(r);\n\n if ((num >> i) & 1)\n r = this.mul(r, a);\n }\n\n return r;\n }\n\n isqr(a) {\n return this.imul(a, a);\n }\n\n sqr(a) {\n return this.mul(a, a);\n }\n\n isqrt(x) {\n return this.sqrt(x)._move(x);\n }\n\n sqrt(x) {\n this._verify1(x);\n\n // Optimized square root chain.\n if (this.prime)\n return this.prime.sqrt(x);\n\n // Fast case (p = 3 mod 4).\n if (this.m.andln(3) === 3)\n return this.sqrt3mod4(x);\n\n // Fast case (p = 5 mod 8).\n if (this.m.andln(7) === 5) {\n if (this.sm1 != null)\n return this.sqrt5mod8sm1(x);\n return this.sqrt5mod8(x);\n }\n\n // Slow case (Tonelli-Shanks).\n return this.sqrt0(x);\n }\n\n sqrt3mod4(x) {\n const e = this.m.addn(1).iushrn(2); // (p + 1) / 4\n const b = this.pow(x, e);\n\n if (!this.sqr(b).eq(x))\n throw new SquareRootError(b);\n\n return b;\n }\n\n sqrt5mod8(x) {\n // Atkin's Algorithm.\n const one = new BN(1).toRed(this);\n const e = this.m.ushrn(3); // (p - 5) / 8\n const x2 = this.add(x, x);\n const alpha = this.pow(x2, e);\n const beta = this.mul(x2, this.sqr(alpha));\n const b = this.mul(this.mul(alpha, x), this.isub(beta, one));\n\n if (!this.sqr(b).eq(x))\n throw new SquareRootError(b);\n\n return b;\n }\n\n sqrt5mod8sm1(x) {\n const e = this.m.addn(3).iushrn(3); // (p + 3) / 8\n const b = this.pow(x, e);\n\n if (this.sqr(b).eq(x))\n return b;\n\n const c = this.mul(b, this.sm1);\n\n if (this.sqr(c).eq(x))\n return c;\n\n throw new SquareRootError(b);\n }\n\n sqrt0(x) {\n if (this.m.cmpn(1) === 0 || !this.m.isOdd())\n throw new Error('Invalid prime.');\n\n switch (this.jacobi(x)) {\n case -1:\n throw new SquareRootError(x);\n case 0:\n return x.clone();\n case 1:\n break;\n }\n\n const one = new BN(1).toRed(this);\n const s = this.m.subn(1);\n const e = s._makeOdd();\n const n = new BN(2).toRed(this);\n\n while (this.jacobi(n) !== -1)\n this.iadd(n, one);\n\n let g = this.pow(n, s);\n let b = this.pow(x, s);\n let y = this.pow(x, s.iaddn(1).iushrn(1));\n let k = e;\n\n for (;;) {\n let t = b;\n let m = 0;\n\n while (!t.eq(one) && m < k) {\n t = this.sqr(t);\n m += 1;\n }\n\n if (m === 0)\n break;\n\n assert(m < k);\n\n t = this.sqrn(g, k - m - 1);\n g = this.sqr(t);\n y = this.mul(y, t);\n b = this.mul(b, g);\n k = m;\n }\n\n return y;\n }\n\n idivsqrt(u, v) {\n return this.divsqrt(u, v)._move(u);\n }\n\n divsqrt(u, v) {\n this._verify2(u, v);\n\n // u = 0, v = 0\n if (u.isZero() && v.isZero())\n throw new SquareRootError(v);\n\n // Optimized inverse square root chain.\n if (this.prime)\n return this.prime.divsqrt(u, v);\n\n // p = 3 mod 4\n if (this.m.andln(3) === 3)\n return this.divsqrt3mod4(u, v);\n\n // p = 5 mod 8\n if (this.sm1 != null && this.m.andln(7) === 5)\n return this.divsqrt5mod8(u, v);\n\n // v = 0\n if (v.isZero())\n throw new SquareRootError(v);\n\n return this.sqrt(this.div(u, v));\n }\n\n divsqrt3mod4(u, v) {\n // x = u^3 * v * (u^5 * v^3)^((p - 3) / 4) mod p\n const e = this.m.subn(3).iushrn(2);\n const u2 = this.sqr(u);\n const u3 = this.mul(u2, u);\n const u5 = this.mul(u3, u2);\n const v3 = this.mul(this.sqr(v), v);\n const p = this.pow(this.mul(u5, v3), e);\n const x = this.mul(this.mul(u3, v), p);\n const c = this.mul(v, this.sqr(x));\n\n if (c.eq(u))\n return x;\n\n throw new SquareRootError(x);\n }\n\n divsqrt5mod8(u, v) {\n // x = u * v^3 * (u * v^7)^((p - 5) / 8) mod p\n const e = this.m.subn(5).iushrn(3);\n const v3 = this.mul(this.sqr(v), v);\n const v7 = this.mul(this.sqr(v3), v);\n const p = this.pow(this.mul(u, v7), e);\n const x = this.mul(this.mul(u, v3), p);\n const c = this.mul(v, this.sqr(x));\n\n if (c.eq(u))\n return x;\n\n const mc = this.ineg(c);\n\n if (mc.eq(u))\n return this.mul(x, this.sm1);\n\n if (mc.eq(this.mul(u, this.sm1)))\n throw new SquareRootError(this.mul(x, this.sm1));\n\n throw new SquareRootError(x);\n }\n\n isSquare(a) {\n if (this.m.isOdd())\n return this.jacobi(a) >= 0;\n\n return this.kronecker(a) >= 0;\n }\n\n ishl(a, num) {\n this._verify1(a);\n return this.imod(a.iushl(num));\n }\n\n shl(a, num) {\n return this.ishl(a.clone(), num);\n }\n\n ishln(a, num) {\n this._verify1(a);\n\n a.iushln(num);\n\n if (num <= 4) {\n // Quick reduction.\n while (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n } else {\n this.imod(a);\n }\n\n return a;\n }\n\n shln(a, num) {\n return this.ishln(a.clone(), num);\n }\n\n ineg(a) {\n this._verify1(a);\n\n if (!a.isZero())\n a._isub(this.m, a);\n\n return a;\n }\n\n neg(a) {\n return this.ineg(a.clone());\n }\n\n eq(a, b) {\n this._verify2(a, b);\n return a.ucmp(b) === 0;\n }\n\n eqn(a, num) {\n this._verify1(a);\n\n if (this.m.length === 1) {\n num %= this.m.words[0];\n\n if (num < 0)\n num += this.m.words[0];\n\n return a.ucmpn(num) === 0;\n }\n\n if (num < 0) {\n this.m._isubn(-num);\n\n const cmp = a.ucmp(this.m);\n\n this.m._iaddn(-num);\n\n return cmp === 0;\n }\n\n return a.ucmpn(num) === 0;\n }\n\n isHigh(a) {\n return !this.isLow(a);\n }\n\n isLow(a) {\n this._verify1(a);\n return a.ucmp(this.m.ushrn(1)) <= 0;\n }\n\n isOdd(a) {\n this._verify1(a);\n return a.isOdd();\n }\n\n isEven(a) {\n this._verify1(a);\n return a.isEven();\n }\n\n legendre(num) {\n this._verify1(num);\n\n if (this.m.isEven())\n throw new Error('legendre: `num` must be odd.');\n\n // Euler's criterion.\n const e = this.m.subn(1).iushrn(1); // (p - 1) / 2\n const symbol = this.pow(num, e);\n\n if (symbol.isZero())\n return 0;\n\n const one = new BN(1).toRed(this);\n\n if (symbol.eq(one))\n return 1;\n\n if (symbol.eq(this.ineg(one)))\n return -1;\n\n throw new Error('Invalid prime.');\n }\n\n jacobi(a) {\n this._verify1(a);\n return a.jacobi(this.m);\n }\n\n kronecker(a) {\n this._verify1(a);\n return a.kronecker(this.m);\n }\n\n iinvert(a) {\n return this.invert(a)._move(a);\n }\n\n invert(a) {\n this._verify1(a);\n return a.invert(this.m)._forceRed(this);\n }\n\n ifermat(a) {\n return this.fermat(a)._move(a);\n }\n\n fermat(a) {\n this._verify1(a);\n\n if (a.isZero() || this.m.cmpn(1) === 0)\n throw new RangeError('Not invertible.');\n\n // Optimized inversion chain.\n if (this.prime)\n return this.prime.fermat(a);\n\n // Invert using fermat's little theorem.\n return this.pow(a, this.m.subn(2));\n }\n\n invertAll(elems) {\n // Montgomery's trick.\n enforce(Array.isArray(elems), 'elems', 'array');\n\n for (const elem of elems) {\n enforce(BN.isBN(elem), 'elem', 'bignum');\n\n this._verify1(elem);\n }\n\n if (this.m.cmpn(1) === 0 || this.m.isEven())\n throw new RangeError('Not invertible.');\n\n const len = elems.length;\n const invs = new Array(len);\n\n if (len === 0)\n return invs;\n\n let acc = new BN(1).toRed(this);\n\n for (let i = 0; i < len; i++) {\n if (elems[i].isZero()) {\n invs[i] = elems[i].clone();\n continue;\n }\n\n invs[i] = acc;\n acc = this.mul(acc, elems[i]);\n }\n\n acc = this.invert(acc);\n\n for (let i = len - 1; i >= 0; i--) {\n if (elems[i].isZero())\n continue;\n\n invs[i] = this.mul(acc, invs[i]);\n acc = this.mul(acc, elems[i]);\n }\n\n return invs;\n }\n\n [custom]() {\n if (this.prime)\n return ``;\n\n return ``;\n }\n}\n\n/**\n * Barrett Engine\n */\n\nclass Barrett extends Red {\n constructor(m) {\n super(m);\n\n this.prime = null;\n this.n = this.m.bitLength();\n\n if ((this.n % 26) !== 0)\n this.n += 26 - (this.n % 26);\n\n this.k = this.n * 2;\n this.w = this.k / 26;\n this.b = BN.shift(1, this.k).div(this.m);\n }\n\n convertTo(num) {\n if (num.length > this.w)\n return super.convertTo(num);\n\n return this.imod(num.clone());\n }\n\n _shift(q) {\n let i = 0;\n let j = this.w;\n\n while (j < q.length)\n q.words[i++] = q.words[j++];\n\n if (i === 0)\n q.words[i++] = 0;\n\n q.length = i;\n }\n\n imod(a) {\n const neg = a.negative;\n\n assert(a.length <= this.w);\n\n a.negative = 0;\n\n const q = a.mul(this.b);\n\n // Shift right by `k` bits.\n this._shift(q);\n\n a._isub(a, q.mul(this.m));\n\n if (a.ucmp(this.m) >= 0)\n a._isub(a, this.m);\n\n if (neg && !a.isZero())\n a._isub(this.m, a);\n\n a.red = this;\n\n return a;\n }\n}\n\n/**\n * Montgomery Engine\n */\n\nclass Mont extends Red {\n constructor(m) {\n super(m);\n\n // Note that:\n //\n // mi = (-m^-1 mod (2^(n * 2))) mod r\n //\n // and:\n //\n // mi = (((2^n)^-1 mod m) * r^-1 - 1) / m\n //\n // are equivalent.\n this.prime = null;\n this.n = this.m.length * 26;\n this.r = BN.shift(1, this.n);\n this.r2 = BN.shift(1, this.n * 2).imod(this.m);\n this.ri = this.r.invert(this.m);\n this.mi = this.r.mul(this.ri).isubn(1).div(this.m);\n this.rib = null;\n }\n\n get mont() {\n return true;\n }\n\n convertTo(num) {\n if (num.isNeg() || num.ucmp(this.m) >= 0)\n return this.imod(num.ushln(this.n));\n\n // Equivalent to: (num * 2^n) mod m\n return this.mul(num, this.r2);\n }\n\n convertFrom(num) {\n // Equivalent to: num * r^-1 mod m\n const r = this.mul(num, new BN(1));\n r.red = null;\n return r;\n }\n\n intTo(a) {\n return (a << BigInt(this.n)) % this.mb;\n }\n\n intFrom(a) {\n if (this.rib === null)\n this.rib = this.ri.toBigInt();\n\n return (a * this.rib) % this.mb;\n }\n\n iaddn(a, num) {\n return this.iadd(a, this.convertTo(new BN(num)));\n }\n\n isubn(a, num) {\n return this.isub(a, this.convertTo(new BN(num)));\n }\n\n imul(a, b) {\n return this.mul(a, b)._move(a);\n }\n\n mul(a, b) {\n if (a.isZero() || b.isZero())\n return new BN(0)._forceRed(this);\n\n const t = a.mul(b);\n const c = t.umaskn(this.n).mul(this.mi).iumaskn(this.n);\n const u = t.iadd(c.mul(this.m)).iushrn(this.n);\n\n if (u.ucmp(this.m) >= 0)\n u._isub(u, this.m);\n\n return u._forceRed(this);\n }\n\n imuln(a, num) {\n this._verify1(a);\n\n if (a.isZero())\n return a;\n\n if (num === 0) {\n a.words[0] = 0;\n a.length = 1;\n return a;\n }\n\n const neg = num < 0;\n\n if (neg)\n num = -num;\n\n if (this.m.length === 1)\n num %= this.m.words[0];\n\n const bits = countBits(num);\n\n // Potentially compute with additions.\n // This avoids an expensive division.\n if (bits > 5) {\n // Slow case (num > 31).\n this.imul(a, this.convertTo(new BN(num)));\n } else if ((num & (num - 1)) === 0) {\n // Optimize for powers of two.\n for (let i = 0; i < bits - 1; i++)\n this.iadd(a, a);\n } else {\n // Multiply left to right.\n const c = a.clone();\n\n for (let i = bits - 2; i >= 0; i--) {\n this.iadd(a, a);\n\n if ((num >> i) & 1)\n this.iadd(a, c);\n }\n }\n\n if (neg)\n this.ineg(a);\n\n return a;\n }\n\n eqn(a, num) {\n this._verify1(a);\n\n if (num === 0)\n return a.isZero();\n\n return a.ucmp(this.convertTo(new BN(num))) === 0;\n }\n\n isLow(a) {\n this._verify1(a);\n return this.convertFrom(a).ucmp(this.m.ushrn(1)) <= 0;\n }\n\n isOdd(a) {\n this._verify1(a);\n return this.convertFrom(a).isOdd();\n }\n\n isEven(a) {\n this._verify1(a);\n return this.convertFrom(a).isEven();\n }\n\n invert(a) {\n this._verify1(a);\n\n // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n return this.imod(a.invert(this.m).mul(this.r2));\n }\n}\n\n/*\n * Helpers\n */\n\nfunction makeError(Error, msg, start) {\n const err = new Error(msg);\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, start);\n\n return err;\n}\n\nfunction assert(value, message) {\n if (!value) {\n const msg = message || 'Assertion failed.';\n throw makeError(Error, msg, assert);\n }\n}\n\nfunction enforce(value, name, type) {\n if (!value) {\n const msg = `\"${name}\" must be a(n) ${type}.`;\n throw makeError(TypeError, msg, enforce);\n }\n}\n\nfunction range(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with positive numbers.`;\n throw makeError(RangeError, msg, range);\n }\n}\n\nfunction red(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with red numbers.`;\n throw makeError(TypeError, msg, red);\n }\n}\n\nfunction nonred(value, name) {\n if (!value) {\n const msg = `\"${name}\" only works with normal numbers.`;\n throw makeError(TypeError, msg, nonred);\n }\n}\n\nfunction nonzero(value) {\n if (!value) {\n const msg = 'Cannot divide by zero.';\n throw makeError(RangeError, msg, nonzero);\n }\n}\n\nclass SquareRootError extends Error {\n constructor(result) {\n super();\n\n this.name = 'SquareRootError';\n this.message = 'X is not a square mod P.';\n this.result = result.fromRed();\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, SquareRootError);\n }\n}\n\nfunction isInteger(num) {\n return Number.isSafeInteger(num);\n}\n\nfunction isSMI(num) {\n return isInteger(num)\n && num >= -0x3ffffff\n && num <= 0x3ffffff;\n}\n\nfunction allocate(ArrayType, size) {\n if (ArrayType.allocUnsafeSlow)\n return ArrayType.allocUnsafeSlow(size);\n\n return new ArrayType(size);\n}\n\nfunction getBase(base) {\n if (base == null)\n return 10;\n\n if (typeof base === 'number')\n return base;\n\n switch (base) {\n case 'bin':\n return 2;\n case 'oct':\n return 8;\n case 'dec':\n return 10;\n case 'hex':\n return 16;\n }\n\n return 0;\n}\n\n/*\n * Internal\n */\n\nfunction countBits(w) {\n if (Math.clz32)\n return 32 - Math.clz32(w);\n\n let t = w;\n let r = 0;\n\n if (t >= 0x1000) {\n r += 13;\n t >>>= 13;\n }\n\n if (t >= 0x40) {\n r += 7;\n t >>>= 7;\n }\n\n if (t >= 0x8) {\n r += 4;\n t >>>= 4;\n }\n\n if (t >= 0x02) {\n r += 2;\n t >>>= 2;\n }\n\n return r + t;\n}\n\nfunction zeroBits(w) {\n // Shortcut.\n if (w === 0)\n return 26;\n\n let t = w;\n let r = 0;\n\n if ((t & 0x1fff) === 0) {\n r += 13;\n t >>>= 13;\n }\n\n if ((t & 0x7f) === 0) {\n r += 7;\n t >>>= 7;\n }\n\n if ((t & 0xf) === 0) {\n r += 4;\n t >>>= 4;\n }\n\n if ((t & 0x3) === 0) {\n r += 2;\n t >>>= 2;\n }\n\n if ((t & 0x1) === 0)\n r += 1;\n\n return r;\n}\n\nfunction parseHex(str, start, end) {\n const len = Math.min(str.length, end);\n\n let r = 0;\n let z = 0;\n\n for (let i = start; i < len; i++) {\n const c = str.charCodeAt(i) - 48;\n\n r <<= 4;\n\n let b;\n\n if (c >= 49 && c <= 54) {\n // 'a' - 'f'\n b = c - 49 + 0xa;\n } else if (c >= 17 && c <= 22) {\n // 'A' - 'F'\n b = c - 17 + 0xa;\n } else {\n // '0' - '9'\n b = c;\n }\n\n r |= b;\n z |= b;\n }\n\n if (z & ~15)\n throw new Error('Invalid string.');\n\n return r;\n}\n\nfunction parseBase(str, start, end, mul) {\n const len = Math.min(str.length, end);\n\n let r = 0;\n\n for (let i = start; i < len; i++) {\n const c = str.charCodeAt(i) - 48;\n\n r *= mul;\n\n let b;\n\n if (c >= 49) {\n // 'a'\n b = c - 49 + 0xa;\n } else if (c >= 17) {\n // 'A'\n b = c - 17 + 0xa;\n } else {\n // '0' - '9'\n b = c;\n }\n\n if (c < 0 || c > 207 || b >= mul)\n throw new Error('Invalid string.');\n\n r += b;\n }\n\n return r;\n}\n\n/*\n * Exponentiation (bigint)\n */\n\nfunction powInt(x, e, m) {\n // Sliding window (odd multiples only).\n const one = BigInt(1);\n const wnd = new Array(WND_SIZE);\n const x2 = (x * x) % m;\n\n wnd[0] = x;\n\n for (let i = 1; i < WND_SIZE; i++)\n wnd[i] = (wnd[i - 1] * x2) % m;\n\n let i = e.bitLength();\n let r = one;\n\n while (i >= WND_WIDTH) {\n let width = WND_WIDTH;\n let bits = e.bits(i - width, width);\n\n if (bits < WND_SIZE) {\n r = (r * r) % m;\n i -= 1;\n continue;\n }\n\n while ((bits & 1) === 0) {\n width -= 1;\n bits >>= 1;\n }\n\n if (r === one) {\n r = wnd[bits >> 1];\n } else {\n r = sqrn(r, width, m);\n r = (r * wnd[bits >> 1]) % m;\n }\n\n i -= width;\n }\n\n if (i > 0) {\n const bits = e.bits(0, i);\n\n while (i--) {\n r = (r * r) % m;\n\n if ((bits >> i) & 1)\n r = (r * x) % m;\n }\n }\n\n return r;\n}\n\nfunction sqrn(x, n, m) {\n for (let i = 0; i < n; i++)\n x = (x * x) % m;\n return x;\n}\n\n/*\n * Multiplication\n */\n\nfunction smallMulTo(self, num, out) {\n const len = self.length + num.length;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(len);\n out.length = len;\n\n // Peel one iteration (compiler can't\n // do it, because of code complexity).\n const a = self.words[0];\n const b = num.words[0];\n const r = a * b;\n const lo = r & 0x3ffffff;\n\n let carry = (r / 0x4000000) | 0;\n let k = 1;\n\n out.words[0] = lo;\n\n for (; k < out.length - 1; k++) {\n // Sum all words with the same\n // `i + j = k` and accumulate\n // `ncarry`, note that ncarry\n // could be >= 0x3ffffff.\n let ncarry = carry >>> 26;\n let rword = carry & 0x3ffffff;\n\n const min = Math.max(0, k - self.length + 1);\n const max = Math.min(k, num.length - 1);\n\n for (let j = min; j <= max; j++) {\n const i = k - j;\n const a = self.words[i];\n const b = num.words[j];\n const r = a * b + rword;\n\n ncarry += (r / 0x4000000) | 0;\n rword = r & 0x3ffffff;\n }\n\n out.words[k] = rword | 0;\n carry = ncarry | 0;\n }\n\n if (carry !== 0)\n out.words[k] = carry | 0;\n else\n out.length -= 1;\n\n return out._strip();\n}\n\nfunction bigMulTo(self, num, out) {\n const len = self.length + num.length;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(len);\n out.length = len;\n\n let carry = 0;\n let hncarry = 0;\n let k = 0;\n\n for (; k < out.length - 1; k++) {\n // Sum all words with the same\n // `i + j = k` and accumulate\n // `ncarry`, note that ncarry\n // could be >= 0x3ffffff.\n let ncarry = hncarry;\n\n hncarry = 0;\n\n let rword = carry & 0x3ffffff;\n\n const min = Math.max(0, k - self.length + 1);\n const max = Math.min(k, num.length - 1);\n\n for (let j = min; j <= max; j++) {\n const i = k - j;\n const a = self.words[i];\n const b = num.words[j];\n const r = a * b;\n\n let lo = r & 0x3ffffff;\n\n ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n lo = (lo + rword) | 0;\n rword = lo & 0x3ffffff;\n ncarry = (ncarry + (lo >>> 26)) | 0;\n\n hncarry += ncarry >>> 26;\n ncarry &= 0x3ffffff;\n }\n\n out.words[k] = rword;\n carry = ncarry;\n ncarry = hncarry;\n }\n\n if (carry !== 0)\n out.words[k] = carry;\n else\n out.length -= 1;\n\n return out._strip();\n}\n\nfunction jumboMulTo(x, y, out) {\n // v8 has a 2147483519 bit max (~256mb).\n if (!HAS_BIGINT || x.length + y.length > 82595519)\n return bigMulTo(x, y, out);\n\n const zero = BigInt(0);\n const mask = BigInt(0x3ffffff);\n const shift = BigInt(26);\n\n let z = x.toBigInt() * y.toBigInt();\n\n const neg = (z < zero) | 0;\n\n if (neg)\n z = -z;\n\n let i = 0;\n\n while (z > zero) {\n out.words[i++] = Number(z & mask);\n z >>= shift;\n }\n\n if (i === 0)\n out.words[i++] = 0;\n\n out.length = i;\n out.negative = neg;\n\n return out;\n}\n\nfunction comb10MulTo(self, num, out) {\n const a = self.words;\n const b = num.words;\n const o = out.words;\n const a0 = a[0] | 0;\n const al0 = a0 & 0x1fff;\n const ah0 = a0 >>> 13;\n const a1 = a[1] | 0;\n const al1 = a1 & 0x1fff;\n const ah1 = a1 >>> 13;\n const a2 = a[2] | 0;\n const al2 = a2 & 0x1fff;\n const ah2 = a2 >>> 13;\n const a3 = a[3] | 0;\n const al3 = a3 & 0x1fff;\n const ah3 = a3 >>> 13;\n const a4 = a[4] | 0;\n const al4 = a4 & 0x1fff;\n const ah4 = a4 >>> 13;\n const a5 = a[5] | 0;\n const al5 = a5 & 0x1fff;\n const ah5 = a5 >>> 13;\n const a6 = a[6] | 0;\n const al6 = a6 & 0x1fff;\n const ah6 = a6 >>> 13;\n const a7 = a[7] | 0;\n const al7 = a7 & 0x1fff;\n const ah7 = a7 >>> 13;\n const a8 = a[8] | 0;\n const al8 = a8 & 0x1fff;\n const ah8 = a8 >>> 13;\n const a9 = a[9] | 0;\n const al9 = a9 & 0x1fff;\n const ah9 = a9 >>> 13;\n const b0 = b[0] | 0;\n const bl0 = b0 & 0x1fff;\n const bh0 = b0 >>> 13;\n const b1 = b[1] | 0;\n const bl1 = b1 & 0x1fff;\n const bh1 = b1 >>> 13;\n const b2 = b[2] | 0;\n const bl2 = b2 & 0x1fff;\n const bh2 = b2 >>> 13;\n const b3 = b[3] | 0;\n const bl3 = b3 & 0x1fff;\n const bh3 = b3 >>> 13;\n const b4 = b[4] | 0;\n const bl4 = b4 & 0x1fff;\n const bh4 = b4 >>> 13;\n const b5 = b[5] | 0;\n const bl5 = b5 & 0x1fff;\n const bh5 = b5 >>> 13;\n const b6 = b[6] | 0;\n const bl6 = b6 & 0x1fff;\n const bh6 = b6 >>> 13;\n const b7 = b[7] | 0;\n const bl7 = b7 & 0x1fff;\n const bh7 = b7 >>> 13;\n const b8 = b[8] | 0;\n const bl8 = b8 & 0x1fff;\n const bh8 = b8 >>> 13;\n const b9 = b[9] | 0;\n const bl9 = b9 & 0x1fff;\n const bh9 = b9 >>> 13;\n\n let c = 0;\n let lo, mid, hi;\n\n out.negative = self.negative ^ num.negative;\n out._alloc(20);\n out.length = 19;\n\n /* k = 0 */\n lo = Math.imul(al0, bl0);\n mid = Math.imul(al0, bh0);\n mid = (mid + Math.imul(ah0, bl0)) | 0;\n hi = Math.imul(ah0, bh0);\n\n let w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n w0 &= 0x3ffffff;\n\n /* k = 1 */\n lo = Math.imul(al1, bl0);\n mid = Math.imul(al1, bh0);\n mid = (mid + Math.imul(ah1, bl0)) | 0;\n hi = Math.imul(ah1, bh0);\n lo = (lo + Math.imul(al0, bl1)) | 0;\n mid = (mid + Math.imul(al0, bh1)) | 0;\n mid = (mid + Math.imul(ah0, bl1)) | 0;\n hi = (hi + Math.imul(ah0, bh1)) | 0;\n\n let w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n w1 &= 0x3ffffff;\n\n /* k = 2 */\n lo = Math.imul(al2, bl0);\n mid = Math.imul(al2, bh0);\n mid = (mid + Math.imul(ah2, bl0)) | 0;\n hi = Math.imul(ah2, bh0);\n lo = (lo + Math.imul(al1, bl1)) | 0;\n mid = (mid + Math.imul(al1, bh1)) | 0;\n mid = (mid + Math.imul(ah1, bl1)) | 0;\n hi = (hi + Math.imul(ah1, bh1)) | 0;\n lo = (lo + Math.imul(al0, bl2)) | 0;\n mid = (mid + Math.imul(al0, bh2)) | 0;\n mid = (mid + Math.imul(ah0, bl2)) | 0;\n hi = (hi + Math.imul(ah0, bh2)) | 0;\n\n let w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n w2 &= 0x3ffffff;\n\n /* k = 3 */\n lo = Math.imul(al3, bl0);\n mid = Math.imul(al3, bh0);\n mid = (mid + Math.imul(ah3, bl0)) | 0;\n hi = Math.imul(ah3, bh0);\n lo = (lo + Math.imul(al2, bl1)) | 0;\n mid = (mid + Math.imul(al2, bh1)) | 0;\n mid = (mid + Math.imul(ah2, bl1)) | 0;\n hi = (hi + Math.imul(ah2, bh1)) | 0;\n lo = (lo + Math.imul(al1, bl2)) | 0;\n mid = (mid + Math.imul(al1, bh2)) | 0;\n mid = (mid + Math.imul(ah1, bl2)) | 0;\n hi = (hi + Math.imul(ah1, bh2)) | 0;\n lo = (lo + Math.imul(al0, bl3)) | 0;\n mid = (mid + Math.imul(al0, bh3)) | 0;\n mid = (mid + Math.imul(ah0, bl3)) | 0;\n hi = (hi + Math.imul(ah0, bh3)) | 0;\n\n let w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n w3 &= 0x3ffffff;\n\n /* k = 4 */\n lo = Math.imul(al4, bl0);\n mid = Math.imul(al4, bh0);\n mid = (mid + Math.imul(ah4, bl0)) | 0;\n hi = Math.imul(ah4, bh0);\n lo = (lo + Math.imul(al3, bl1)) | 0;\n mid = (mid + Math.imul(al3, bh1)) | 0;\n mid = (mid + Math.imul(ah3, bl1)) | 0;\n hi = (hi + Math.imul(ah3, bh1)) | 0;\n lo = (lo + Math.imul(al2, bl2)) | 0;\n mid = (mid + Math.imul(al2, bh2)) | 0;\n mid = (mid + Math.imul(ah2, bl2)) | 0;\n hi = (hi + Math.imul(ah2, bh2)) | 0;\n lo = (lo + Math.imul(al1, bl3)) | 0;\n mid = (mid + Math.imul(al1, bh3)) | 0;\n mid = (mid + Math.imul(ah1, bl3)) | 0;\n hi = (hi + Math.imul(ah1, bh3)) | 0;\n lo = (lo + Math.imul(al0, bl4)) | 0;\n mid = (mid + Math.imul(al0, bh4)) | 0;\n mid = (mid + Math.imul(ah0, bl4)) | 0;\n hi = (hi + Math.imul(ah0, bh4)) | 0;\n\n let w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n w4 &= 0x3ffffff;\n\n /* k = 5 */\n lo = Math.imul(al5, bl0);\n mid = Math.imul(al5, bh0);\n mid = (mid + Math.imul(ah5, bl0)) | 0;\n hi = Math.imul(ah5, bh0);\n lo = (lo + Math.imul(al4, bl1)) | 0;\n mid = (mid + Math.imul(al4, bh1)) | 0;\n mid = (mid + Math.imul(ah4, bl1)) | 0;\n hi = (hi + Math.imul(ah4, bh1)) | 0;\n lo = (lo + Math.imul(al3, bl2)) | 0;\n mid = (mid + Math.imul(al3, bh2)) | 0;\n mid = (mid + Math.imul(ah3, bl2)) | 0;\n hi = (hi + Math.imul(ah3, bh2)) | 0;\n lo = (lo + Math.imul(al2, bl3)) | 0;\n mid = (mid + Math.imul(al2, bh3)) | 0;\n mid = (mid + Math.imul(ah2, bl3)) | 0;\n hi = (hi + Math.imul(ah2, bh3)) | 0;\n lo = (lo + Math.imul(al1, bl4)) | 0;\n mid = (mid + Math.imul(al1, bh4)) | 0;\n mid = (mid + Math.imul(ah1, bl4)) | 0;\n hi = (hi + Math.imul(ah1, bh4)) | 0;\n lo = (lo + Math.imul(al0, bl5)) | 0;\n mid = (mid + Math.imul(al0, bh5)) | 0;\n mid = (mid + Math.imul(ah0, bl5)) | 0;\n hi = (hi + Math.imul(ah0, bh5)) | 0;\n\n let w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n w5 &= 0x3ffffff;\n\n /* k = 6 */\n lo = Math.imul(al6, bl0);\n mid = Math.imul(al6, bh0);\n mid = (mid + Math.imul(ah6, bl0)) | 0;\n hi = Math.imul(ah6, bh0);\n lo = (lo + Math.imul(al5, bl1)) | 0;\n mid = (mid + Math.imul(al5, bh1)) | 0;\n mid = (mid + Math.imul(ah5, bl1)) | 0;\n hi = (hi + Math.imul(ah5, bh1)) | 0;\n lo = (lo + Math.imul(al4, bl2)) | 0;\n mid = (mid + Math.imul(al4, bh2)) | 0;\n mid = (mid + Math.imul(ah4, bl2)) | 0;\n hi = (hi + Math.imul(ah4, bh2)) | 0;\n lo = (lo + Math.imul(al3, bl3)) | 0;\n mid = (mid + Math.imul(al3, bh3)) | 0;\n mid = (mid + Math.imul(ah3, bl3)) | 0;\n hi = (hi + Math.imul(ah3, bh3)) | 0;\n lo = (lo + Math.imul(al2, bl4)) | 0;\n mid = (mid + Math.imul(al2, bh4)) | 0;\n mid = (mid + Math.imul(ah2, bl4)) | 0;\n hi = (hi + Math.imul(ah2, bh4)) | 0;\n lo = (lo + Math.imul(al1, bl5)) | 0;\n mid = (mid + Math.imul(al1, bh5)) | 0;\n mid = (mid + Math.imul(ah1, bl5)) | 0;\n hi = (hi + Math.imul(ah1, bh5)) | 0;\n lo = (lo + Math.imul(al0, bl6)) | 0;\n mid = (mid + Math.imul(al0, bh6)) | 0;\n mid = (mid + Math.imul(ah0, bl6)) | 0;\n hi = (hi + Math.imul(ah0, bh6)) | 0;\n\n let w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n w6 &= 0x3ffffff;\n\n /* k = 7 */\n lo = Math.imul(al7, bl0);\n mid = Math.imul(al7, bh0);\n mid = (mid + Math.imul(ah7, bl0)) | 0;\n hi = Math.imul(ah7, bh0);\n lo = (lo + Math.imul(al6, bl1)) | 0;\n mid = (mid + Math.imul(al6, bh1)) | 0;\n mid = (mid + Math.imul(ah6, bl1)) | 0;\n hi = (hi + Math.imul(ah6, bh1)) | 0;\n lo = (lo + Math.imul(al5, bl2)) | 0;\n mid = (mid + Math.imul(al5, bh2)) | 0;\n mid = (mid + Math.imul(ah5, bl2)) | 0;\n hi = (hi + Math.imul(ah5, bh2)) | 0;\n lo = (lo + Math.imul(al4, bl3)) | 0;\n mid = (mid + Math.imul(al4, bh3)) | 0;\n mid = (mid + Math.imul(ah4, bl3)) | 0;\n hi = (hi + Math.imul(ah4, bh3)) | 0;\n lo = (lo + Math.imul(al3, bl4)) | 0;\n mid = (mid + Math.imul(al3, bh4)) | 0;\n mid = (mid + Math.imul(ah3, bl4)) | 0;\n hi = (hi + Math.imul(ah3, bh4)) | 0;\n lo = (lo + Math.imul(al2, bl5)) | 0;\n mid = (mid + Math.imul(al2, bh5)) | 0;\n mid = (mid + Math.imul(ah2, bl5)) | 0;\n hi = (hi + Math.imul(ah2, bh5)) | 0;\n lo = (lo + Math.imul(al1, bl6)) | 0;\n mid = (mid + Math.imul(al1, bh6)) | 0;\n mid = (mid + Math.imul(ah1, bl6)) | 0;\n hi = (hi + Math.imul(ah1, bh6)) | 0;\n lo = (lo + Math.imul(al0, bl7)) | 0;\n mid = (mid + Math.imul(al0, bh7)) | 0;\n mid = (mid + Math.imul(ah0, bl7)) | 0;\n hi = (hi + Math.imul(ah0, bh7)) | 0;\n\n let w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n w7 &= 0x3ffffff;\n\n /* k = 8 */\n lo = Math.imul(al8, bl0);\n mid = Math.imul(al8, bh0);\n mid = (mid + Math.imul(ah8, bl0)) | 0;\n hi = Math.imul(ah8, bh0);\n lo = (lo + Math.imul(al7, bl1)) | 0;\n mid = (mid + Math.imul(al7, bh1)) | 0;\n mid = (mid + Math.imul(ah7, bl1)) | 0;\n hi = (hi + Math.imul(ah7, bh1)) | 0;\n lo = (lo + Math.imul(al6, bl2)) | 0;\n mid = (mid + Math.imul(al6, bh2)) | 0;\n mid = (mid + Math.imul(ah6, bl2)) | 0;\n hi = (hi + Math.imul(ah6, bh2)) | 0;\n lo = (lo + Math.imul(al5, bl3)) | 0;\n mid = (mid + Math.imul(al5, bh3)) | 0;\n mid = (mid + Math.imul(ah5, bl3)) | 0;\n hi = (hi + Math.imul(ah5, bh3)) | 0;\n lo = (lo + Math.imul(al4, bl4)) | 0;\n mid = (mid + Math.imul(al4, bh4)) | 0;\n mid = (mid + Math.imul(ah4, bl4)) | 0;\n hi = (hi + Math.imul(ah4, bh4)) | 0;\n lo = (lo + Math.imul(al3, bl5)) | 0;\n mid = (mid + Math.imul(al3, bh5)) | 0;\n mid = (mid + Math.imul(ah3, bl5)) | 0;\n hi = (hi + Math.imul(ah3, bh5)) | 0;\n lo = (lo + Math.imul(al2, bl6)) | 0;\n mid = (mid + Math.imul(al2, bh6)) | 0;\n mid = (mid + Math.imul(ah2, bl6)) | 0;\n hi = (hi + Math.imul(ah2, bh6)) | 0;\n lo = (lo + Math.imul(al1, bl7)) | 0;\n mid = (mid + Math.imul(al1, bh7)) | 0;\n mid = (mid + Math.imul(ah1, bl7)) | 0;\n hi = (hi + Math.imul(ah1, bh7)) | 0;\n lo = (lo + Math.imul(al0, bl8)) | 0;\n mid = (mid + Math.imul(al0, bh8)) | 0;\n mid = (mid + Math.imul(ah0, bl8)) | 0;\n hi = (hi + Math.imul(ah0, bh8)) | 0;\n\n let w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n w8 &= 0x3ffffff;\n\n /* k = 9 */\n lo = Math.imul(al9, bl0);\n mid = Math.imul(al9, bh0);\n mid = (mid + Math.imul(ah9, bl0)) | 0;\n hi = Math.imul(ah9, bh0);\n lo = (lo + Math.imul(al8, bl1)) | 0;\n mid = (mid + Math.imul(al8, bh1)) | 0;\n mid = (mid + Math.imul(ah8, bl1)) | 0;\n hi = (hi + Math.imul(ah8, bh1)) | 0;\n lo = (lo + Math.imul(al7, bl2)) | 0;\n mid = (mid + Math.imul(al7, bh2)) | 0;\n mid = (mid + Math.imul(ah7, bl2)) | 0;\n hi = (hi + Math.imul(ah7, bh2)) | 0;\n lo = (lo + Math.imul(al6, bl3)) | 0;\n mid = (mid + Math.imul(al6, bh3)) | 0;\n mid = (mid + Math.imul(ah6, bl3)) | 0;\n hi = (hi + Math.imul(ah6, bh3)) | 0;\n lo = (lo + Math.imul(al5, bl4)) | 0;\n mid = (mid + Math.imul(al5, bh4)) | 0;\n mid = (mid + Math.imul(ah5, bl4)) | 0;\n hi = (hi + Math.imul(ah5, bh4)) | 0;\n lo = (lo + Math.imul(al4, bl5)) | 0;\n mid = (mid + Math.imul(al4, bh5)) | 0;\n mid = (mid + Math.imul(ah4, bl5)) | 0;\n hi = (hi + Math.imul(ah4, bh5)) | 0;\n lo = (lo + Math.imul(al3, bl6)) | 0;\n mid = (mid + Math.imul(al3, bh6)) | 0;\n mid = (mid + Math.imul(ah3, bl6)) | 0;\n hi = (hi + Math.imul(ah3, bh6)) | 0;\n lo = (lo + Math.imul(al2, bl7)) | 0;\n mid = (mid + Math.imul(al2, bh7)) | 0;\n mid = (mid + Math.imul(ah2, bl7)) | 0;\n hi = (hi + Math.imul(ah2, bh7)) | 0;\n lo = (lo + Math.imul(al1, bl8)) | 0;\n mid = (mid + Math.imul(al1, bh8)) | 0;\n mid = (mid + Math.imul(ah1, bl8)) | 0;\n hi = (hi + Math.imul(ah1, bh8)) | 0;\n lo = (lo + Math.imul(al0, bl9)) | 0;\n mid = (mid + Math.imul(al0, bh9)) | 0;\n mid = (mid + Math.imul(ah0, bl9)) | 0;\n hi = (hi + Math.imul(ah0, bh9)) | 0;\n\n let w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n w9 &= 0x3ffffff;\n\n /* k = 10 */\n lo = Math.imul(al9, bl1);\n mid = Math.imul(al9, bh1);\n mid = (mid + Math.imul(ah9, bl1)) | 0;\n hi = Math.imul(ah9, bh1);\n lo = (lo + Math.imul(al8, bl2)) | 0;\n mid = (mid + Math.imul(al8, bh2)) | 0;\n mid = (mid + Math.imul(ah8, bl2)) | 0;\n hi = (hi + Math.imul(ah8, bh2)) | 0;\n lo = (lo + Math.imul(al7, bl3)) | 0;\n mid = (mid + Math.imul(al7, bh3)) | 0;\n mid = (mid + Math.imul(ah7, bl3)) | 0;\n hi = (hi + Math.imul(ah7, bh3)) | 0;\n lo = (lo + Math.imul(al6, bl4)) | 0;\n mid = (mid + Math.imul(al6, bh4)) | 0;\n mid = (mid + Math.imul(ah6, bl4)) | 0;\n hi = (hi + Math.imul(ah6, bh4)) | 0;\n lo = (lo + Math.imul(al5, bl5)) | 0;\n mid = (mid + Math.imul(al5, bh5)) | 0;\n mid = (mid + Math.imul(ah5, bl5)) | 0;\n hi = (hi + Math.imul(ah5, bh5)) | 0;\n lo = (lo + Math.imul(al4, bl6)) | 0;\n mid = (mid + Math.imul(al4, bh6)) | 0;\n mid = (mid + Math.imul(ah4, bl6)) | 0;\n hi = (hi + Math.imul(ah4, bh6)) | 0;\n lo = (lo + Math.imul(al3, bl7)) | 0;\n mid = (mid + Math.imul(al3, bh7)) | 0;\n mid = (mid + Math.imul(ah3, bl7)) | 0;\n hi = (hi + Math.imul(ah3, bh7)) | 0;\n lo = (lo + Math.imul(al2, bl8)) | 0;\n mid = (mid + Math.imul(al2, bh8)) | 0;\n mid = (mid + Math.imul(ah2, bl8)) | 0;\n hi = (hi + Math.imul(ah2, bh8)) | 0;\n lo = (lo + Math.imul(al1, bl9)) | 0;\n mid = (mid + Math.imul(al1, bh9)) | 0;\n mid = (mid + Math.imul(ah1, bl9)) | 0;\n hi = (hi + Math.imul(ah1, bh9)) | 0;\n\n let w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n w10 &= 0x3ffffff;\n\n /* k = 11 */\n lo = Math.imul(al9, bl2);\n mid = Math.imul(al9, bh2);\n mid = (mid + Math.imul(ah9, bl2)) | 0;\n hi = Math.imul(ah9, bh2);\n lo = (lo + Math.imul(al8, bl3)) | 0;\n mid = (mid + Math.imul(al8, bh3)) | 0;\n mid = (mid + Math.imul(ah8, bl3)) | 0;\n hi = (hi + Math.imul(ah8, bh3)) | 0;\n lo = (lo + Math.imul(al7, bl4)) | 0;\n mid = (mid + Math.imul(al7, bh4)) | 0;\n mid = (mid + Math.imul(ah7, bl4)) | 0;\n hi = (hi + Math.imul(ah7, bh4)) | 0;\n lo = (lo + Math.imul(al6, bl5)) | 0;\n mid = (mid + Math.imul(al6, bh5)) | 0;\n mid = (mid + Math.imul(ah6, bl5)) | 0;\n hi = (hi + Math.imul(ah6, bh5)) | 0;\n lo = (lo + Math.imul(al5, bl6)) | 0;\n mid = (mid + Math.imul(al5, bh6)) | 0;\n mid = (mid + Math.imul(ah5, bl6)) | 0;\n hi = (hi + Math.imul(ah5, bh6)) | 0;\n lo = (lo + Math.imul(al4, bl7)) | 0;\n mid = (mid + Math.imul(al4, bh7)) | 0;\n mid = (mid + Math.imul(ah4, bl7)) | 0;\n hi = (hi + Math.imul(ah4, bh7)) | 0;\n lo = (lo + Math.imul(al3, bl8)) | 0;\n mid = (mid + Math.imul(al3, bh8)) | 0;\n mid = (mid + Math.imul(ah3, bl8)) | 0;\n hi = (hi + Math.imul(ah3, bh8)) | 0;\n lo = (lo + Math.imul(al2, bl9)) | 0;\n mid = (mid + Math.imul(al2, bh9)) | 0;\n mid = (mid + Math.imul(ah2, bl9)) | 0;\n hi = (hi + Math.imul(ah2, bh9)) | 0;\n\n let w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n w11 &= 0x3ffffff;\n\n /* k = 12 */\n lo = Math.imul(al9, bl3);\n mid = Math.imul(al9, bh3);\n mid = (mid + Math.imul(ah9, bl3)) | 0;\n hi = Math.imul(ah9, bh3);\n lo = (lo + Math.imul(al8, bl4)) | 0;\n mid = (mid + Math.imul(al8, bh4)) | 0;\n mid = (mid + Math.imul(ah8, bl4)) | 0;\n hi = (hi + Math.imul(ah8, bh4)) | 0;\n lo = (lo + Math.imul(al7, bl5)) | 0;\n mid = (mid + Math.imul(al7, bh5)) | 0;\n mid = (mid + Math.imul(ah7, bl5)) | 0;\n hi = (hi + Math.imul(ah7, bh5)) | 0;\n lo = (lo + Math.imul(al6, bl6)) | 0;\n mid = (mid + Math.imul(al6, bh6)) | 0;\n mid = (mid + Math.imul(ah6, bl6)) | 0;\n hi = (hi + Math.imul(ah6, bh6)) | 0;\n lo = (lo + Math.imul(al5, bl7)) | 0;\n mid = (mid + Math.imul(al5, bh7)) | 0;\n mid = (mid + Math.imul(ah5, bl7)) | 0;\n hi = (hi + Math.imul(ah5, bh7)) | 0;\n lo = (lo + Math.imul(al4, bl8)) | 0;\n mid = (mid + Math.imul(al4, bh8)) | 0;\n mid = (mid + Math.imul(ah4, bl8)) | 0;\n hi = (hi + Math.imul(ah4, bh8)) | 0;\n lo = (lo + Math.imul(al3, bl9)) | 0;\n mid = (mid + Math.imul(al3, bh9)) | 0;\n mid = (mid + Math.imul(ah3, bl9)) | 0;\n hi = (hi + Math.imul(ah3, bh9)) | 0;\n\n let w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n w12 &= 0x3ffffff;\n\n /* k = 13 */\n lo = Math.imul(al9, bl4);\n mid = Math.imul(al9, bh4);\n mid = (mid + Math.imul(ah9, bl4)) | 0;\n hi = Math.imul(ah9, bh4);\n lo = (lo + Math.imul(al8, bl5)) | 0;\n mid = (mid + Math.imul(al8, bh5)) | 0;\n mid = (mid + Math.imul(ah8, bl5)) | 0;\n hi = (hi + Math.imul(ah8, bh5)) | 0;\n lo = (lo + Math.imul(al7, bl6)) | 0;\n mid = (mid + Math.imul(al7, bh6)) | 0;\n mid = (mid + Math.imul(ah7, bl6)) | 0;\n hi = (hi + Math.imul(ah7, bh6)) | 0;\n lo = (lo + Math.imul(al6, bl7)) | 0;\n mid = (mid + Math.imul(al6, bh7)) | 0;\n mid = (mid + Math.imul(ah6, bl7)) | 0;\n hi = (hi + Math.imul(ah6, bh7)) | 0;\n lo = (lo + Math.imul(al5, bl8)) | 0;\n mid = (mid + Math.imul(al5, bh8)) | 0;\n mid = (mid + Math.imul(ah5, bl8)) | 0;\n hi = (hi + Math.imul(ah5, bh8)) | 0;\n lo = (lo + Math.imul(al4, bl9)) | 0;\n mid = (mid + Math.imul(al4, bh9)) | 0;\n mid = (mid + Math.imul(ah4, bl9)) | 0;\n hi = (hi + Math.imul(ah4, bh9)) | 0;\n\n let w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n w13 &= 0x3ffffff;\n\n /* k = 14 */\n lo = Math.imul(al9, bl5);\n mid = Math.imul(al9, bh5);\n mid = (mid + Math.imul(ah9, bl5)) | 0;\n hi = Math.imul(ah9, bh5);\n lo = (lo + Math.imul(al8, bl6)) | 0;\n mid = (mid + Math.imul(al8, bh6)) | 0;\n mid = (mid + Math.imul(ah8, bl6)) | 0;\n hi = (hi + Math.imul(ah8, bh6)) | 0;\n lo = (lo + Math.imul(al7, bl7)) | 0;\n mid = (mid + Math.imul(al7, bh7)) | 0;\n mid = (mid + Math.imul(ah7, bl7)) | 0;\n hi = (hi + Math.imul(ah7, bh7)) | 0;\n lo = (lo + Math.imul(al6, bl8)) | 0;\n mid = (mid + Math.imul(al6, bh8)) | 0;\n mid = (mid + Math.imul(ah6, bl8)) | 0;\n hi = (hi + Math.imul(ah6, bh8)) | 0;\n lo = (lo + Math.imul(al5, bl9)) | 0;\n mid = (mid + Math.imul(al5, bh9)) | 0;\n mid = (mid + Math.imul(ah5, bl9)) | 0;\n hi = (hi + Math.imul(ah5, bh9)) | 0;\n\n let w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n w14 &= 0x3ffffff;\n\n /* k = 15 */\n lo = Math.imul(al9, bl6);\n mid = Math.imul(al9, bh6);\n mid = (mid + Math.imul(ah9, bl6)) | 0;\n hi = Math.imul(ah9, bh6);\n lo = (lo + Math.imul(al8, bl7)) | 0;\n mid = (mid + Math.imul(al8, bh7)) | 0;\n mid = (mid + Math.imul(ah8, bl7)) | 0;\n hi = (hi + Math.imul(ah8, bh7)) | 0;\n lo = (lo + Math.imul(al7, bl8)) | 0;\n mid = (mid + Math.imul(al7, bh8)) | 0;\n mid = (mid + Math.imul(ah7, bl8)) | 0;\n hi = (hi + Math.imul(ah7, bh8)) | 0;\n lo = (lo + Math.imul(al6, bl9)) | 0;\n mid = (mid + Math.imul(al6, bh9)) | 0;\n mid = (mid + Math.imul(ah6, bl9)) | 0;\n hi = (hi + Math.imul(ah6, bh9)) | 0;\n\n let w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n w15 &= 0x3ffffff;\n\n /* k = 16 */\n lo = Math.imul(al9, bl7);\n mid = Math.imul(al9, bh7);\n mid = (mid + Math.imul(ah9, bl7)) | 0;\n hi = Math.imul(ah9, bh7);\n lo = (lo + Math.imul(al8, bl8)) | 0;\n mid = (mid + Math.imul(al8, bh8)) | 0;\n mid = (mid + Math.imul(ah8, bl8)) | 0;\n hi = (hi + Math.imul(ah8, bh8)) | 0;\n lo = (lo + Math.imul(al7, bl9)) | 0;\n mid = (mid + Math.imul(al7, bh9)) | 0;\n mid = (mid + Math.imul(ah7, bl9)) | 0;\n hi = (hi + Math.imul(ah7, bh9)) | 0;\n\n let w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n w16 &= 0x3ffffff;\n\n /* k = 17 */\n lo = Math.imul(al9, bl8);\n mid = Math.imul(al9, bh8);\n mid = (mid + Math.imul(ah9, bl8)) | 0;\n hi = Math.imul(ah9, bh8);\n lo = (lo + Math.imul(al8, bl9)) | 0;\n mid = (mid + Math.imul(al8, bh9)) | 0;\n mid = (mid + Math.imul(ah8, bl9)) | 0;\n hi = (hi + Math.imul(ah8, bh9)) | 0;\n\n let w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n w17 &= 0x3ffffff;\n\n /* k = 18 */\n lo = Math.imul(al9, bl9);\n mid = Math.imul(al9, bh9);\n mid = (mid + Math.imul(ah9, bl9)) | 0;\n hi = Math.imul(ah9, bh9);\n\n let w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n w18 &= 0x3ffffff;\n\n o[0] = w0;\n o[1] = w1;\n o[2] = w2;\n o[3] = w3;\n o[4] = w4;\n o[5] = w5;\n o[6] = w6;\n o[7] = w7;\n o[8] = w8;\n o[9] = w9;\n o[10] = w10;\n o[11] = w11;\n o[12] = w12;\n o[13] = w13;\n o[14] = w14;\n o[15] = w15;\n o[16] = w16;\n o[17] = w17;\n o[18] = w18;\n\n if (c !== 0) {\n o[19] = c;\n out.length += 1;\n }\n\n // Note: we shouldn't need to strip here.\n return out;\n}\n\n// Polyfill comb.\nif (!Math.imul)\n comb10MulTo = smallMulTo;\n\n/*\n * Expose\n */\n\nBN.Red = Red;\n\nmodule.exports = BN;\n","/*!\n * bn.js - big numbers for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/bn');\n","/*!\n * chacha20.js - chacha20 for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources\n * https://en.wikipedia.org/wiki/Chacha20\n * https://tools.ietf.org/html/rfc7539#section-2\n * https://cr.yp.to/chacha.html\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/*\n * Constants\n */\n\nconst BIG_ENDIAN = new Int8Array(new Int16Array([1]).buffer)[0] === 0;\n\n/**\n * ChaCha20\n */\n\nclass ChaCha20 {\n /**\n * Create a ChaCha20 context.\n * @constructor\n */\n\n constructor() {\n this.state = new Uint32Array(16);\n this.stream = new Uint32Array(16);\n this.bytes = new Uint8Array(this.stream.buffer);\n this.pos = -1;\n\n if (BIG_ENDIAN)\n this.bytes = Buffer.alloc(64);\n }\n\n /**\n * Initialize chacha20 with a key, nonce, and counter.\n * @param {Buffer} key\n * @param {Buffer} nonce\n * @param {Number} counter\n */\n\n init(key, nonce, counter) {\n if (counter == null)\n counter = 0;\n\n assert(Buffer.isBuffer(key));\n assert(Buffer.isBuffer(nonce));\n assert(Number.isSafeInteger(counter));\n\n if (key.length !== 16 && key.length !== 32)\n throw new RangeError('Invalid key size.');\n\n if (nonce.length >= 24) {\n key = ChaCha20.derive(key, nonce.slice(0, 16));\n nonce = nonce.slice(16);\n }\n\n this.state[0] = 0x61707865;\n this.state[1] = key.length < 32 ? 0x3120646e : 0x3320646e;\n this.state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32;\n this.state[3] = 0x6b206574;\n this.state[4] = readU32(key, 0);\n this.state[5] = readU32(key, 4);\n this.state[6] = readU32(key, 8);\n this.state[7] = readU32(key, 12);\n this.state[8] = readU32(key, 16 % key.length);\n this.state[9] = readU32(key, 20 % key.length);\n this.state[10] = readU32(key, 24 % key.length);\n this.state[11] = readU32(key, 28 % key.length);\n this.state[12] = counter >>> 0;\n\n if (nonce.length === 8) {\n this.state[13] = (counter / 0x100000000) >>> 0;\n this.state[14] = readU32(nonce, 0);\n this.state[15] = readU32(nonce, 4);\n } else if (nonce.length === 12) {\n this.state[13] = readU32(nonce, 0);\n this.state[14] = readU32(nonce, 4);\n this.state[15] = readU32(nonce, 8);\n } else if (nonce.length === 16) {\n this.state[12] = readU32(nonce, 0);\n this.state[13] = readU32(nonce, 4);\n this.state[14] = readU32(nonce, 8);\n this.state[15] = readU32(nonce, 12);\n } else {\n throw new RangeError('Invalid nonce size.');\n }\n\n this.pos = 0;\n\n return this;\n }\n\n /**\n * Encrypt/decrypt data.\n * @param {Buffer} data - Will be mutated.\n * @returns {Buffer}\n */\n\n encrypt(data) {\n assert(Buffer.isBuffer(data));\n\n if (this.pos === -1)\n throw new Error('Context is not initialized.');\n\n for (let i = 0; i < data.length; i++) {\n if ((this.pos & 63) === 0) {\n this._block();\n this.pos = 0;\n }\n\n data[i] ^= this.bytes[this.pos++];\n }\n\n return data;\n }\n\n /**\n * Stir the stream.\n */\n\n _block() {\n for (let i = 0; i < 16; i++)\n this.stream[i] = this.state[i];\n\n for (let i = 0; i < 10; i++) {\n qround(this.stream, 0, 4, 8, 12);\n qround(this.stream, 1, 5, 9, 13);\n qround(this.stream, 2, 6, 10, 14);\n qround(this.stream, 3, 7, 11, 15);\n qround(this.stream, 0, 5, 10, 15);\n qround(this.stream, 1, 6, 11, 12);\n qround(this.stream, 2, 7, 8, 13);\n qround(this.stream, 3, 4, 9, 14);\n }\n\n for (let i = 0; i < 16; i++)\n this.stream[i] += this.state[i];\n\n if (BIG_ENDIAN) {\n for (let i = 0; i < 16; i++)\n writeU32(this.bytes, this.stream[i], i * 4);\n }\n\n this.state[12] += 1;\n\n if (this.state[12] === 0)\n this.state[13] += 1;\n }\n\n /**\n * Destroy context.\n */\n\n destroy() {\n for (let i = 0; i < 16; i++) {\n this.state[i] = 0;\n this.stream[i] = 0;\n }\n\n if (BIG_ENDIAN) {\n for (let i = 0; i < 64; i++)\n this.bytes[i] = 0;\n }\n\n this.pos = -1;\n\n return this;\n }\n\n /**\n * Derive key with XChaCha20.\n * @param {Buffer} key\n * @param {Buffer} nonce\n * @returns {Buffer}\n */\n\n static derive(key, nonce) {\n assert(Buffer.isBuffer(key));\n assert(Buffer.isBuffer(nonce));\n\n if (key.length !== 16 && key.length !== 32)\n throw new RangeError('Invalid key size.');\n\n if (nonce.length !== 16)\n throw new RangeError('Invalid nonce size.');\n\n const state = new Uint32Array(16);\n\n state[0] = 0x61707865;\n state[1] = key.length < 32 ? 0x3120646e : 0x3320646e;\n state[2] = key.length < 32 ? 0x79622d36 : 0x79622d32;\n state[3] = 0x6b206574;\n state[4] = readU32(key, 0);\n state[5] = readU32(key, 4);\n state[6] = readU32(key, 8);\n state[7] = readU32(key, 12);\n state[8] = readU32(key, 16 % key.length);\n state[9] = readU32(key, 20 % key.length);\n state[10] = readU32(key, 24 % key.length);\n state[11] = readU32(key, 28 % key.length);\n state[12] = readU32(nonce, 0);\n state[13] = readU32(nonce, 4);\n state[14] = readU32(nonce, 8);\n state[15] = readU32(nonce, 12);\n\n for (let i = 0; i < 10; i++) {\n qround(state, 0, 4, 8, 12);\n qround(state, 1, 5, 9, 13);\n qround(state, 2, 6, 10, 14);\n qround(state, 3, 7, 11, 15);\n qround(state, 0, 5, 10, 15);\n qround(state, 1, 6, 11, 12);\n qround(state, 2, 7, 8, 13);\n qround(state, 3, 4, 9, 14);\n }\n\n const out = Buffer.alloc(32);\n\n writeU32(out, state[0], 0);\n writeU32(out, state[1], 4);\n writeU32(out, state[2], 8);\n writeU32(out, state[3], 12);\n writeU32(out, state[12], 16);\n writeU32(out, state[13], 20);\n writeU32(out, state[14], 24);\n writeU32(out, state[15], 28);\n\n return out;\n }\n}\n\n/*\n * Static\n */\n\nChaCha20.native = 0;\n\n/*\n * Helpers\n */\n\nfunction qround(x, a, b, c, d) {\n x[a] += x[b];\n x[d] = rotl32(x[d] ^ x[a], 16);\n\n x[c] += x[d];\n x[b] = rotl32(x[b] ^ x[c], 12);\n\n x[a] += x[b];\n x[d] = rotl32(x[d] ^ x[a], 8);\n\n x[c] += x[d];\n x[b] = rotl32(x[b] ^ x[c], 7);\n}\n\nfunction rotl32(w, b) {\n return (w << b) | (w >>> (32 - b));\n}\n\nfunction readU32(data, off) {\n return (data[off++]\n + data[off++] * 0x100\n + data[off++] * 0x10000\n + data[off] * 0x1000000);\n}\n\nfunction writeU32(dst, num, off) {\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n num >>>= 8;\n dst[off++] = num;\n return off;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = ChaCha20;\n","/*!\n * chacha20.js - chacha20 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/chacha20');\n","/*!\n * hmac.js - hmac for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/hash.js:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/hash.js\n *\n * Resources:\n * https://en.wikipedia.org/wiki/HMAC\n * https://tools.ietf.org/html/rfc2104\n * https://github.com/indutny/hash.js/blob/master/lib/hash/hmac.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/**\n * HMAC\n */\n\nclass HMAC {\n /**\n * Create an HMAC.\n * @param {Function} Hash\n * @param {Number} size\n * @param {Array} [x=[]]\n * @param {Array} [y=[]]\n */\n\n constructor(Hash, size, x = [], y = []) {\n assert(typeof Hash === 'function');\n assert((size >>> 0) === size);\n assert(Array.isArray(x));\n assert(Array.isArray(y));\n\n this.hash = Hash;\n this.size = size;\n this.x = x;\n this.y = y;\n\n this.inner = new Hash();\n this.outer = new Hash();\n }\n\n /**\n * Initialize HMAC context.\n * @param {Buffer} data\n */\n\n init(key) {\n assert(Buffer.isBuffer(key));\n\n // Shorten key\n if (key.length > this.size) {\n const Hash = this.hash;\n const h = new Hash();\n\n h.init(...this.x);\n h.update(key);\n\n key = h.final(...this.y);\n\n assert(key.length <= this.size);\n }\n\n // Pad key\n const pad = Buffer.alloc(this.size);\n\n for (let i = 0; i < key.length; i++)\n pad[i] = key[i] ^ 0x36;\n\n for (let i = key.length; i < pad.length; i++)\n pad[i] = 0x36;\n\n this.inner.init(...this.x);\n this.inner.update(pad);\n\n for (let i = 0; i < key.length; i++)\n pad[i] = key[i] ^ 0x5c;\n\n for (let i = key.length; i < pad.length; i++)\n pad[i] = 0x5c;\n\n this.outer.init(...this.x);\n this.outer.update(pad);\n\n return this;\n }\n\n /**\n * Update HMAC context.\n * @param {Buffer} data\n */\n\n update(data) {\n this.inner.update(data);\n return this;\n }\n\n /**\n * Finalize HMAC context.\n * @returns {Buffer}\n */\n\n final() {\n this.outer.update(this.inner.final(...this.y));\n return this.outer.final(...this.y);\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = HMAC;\n","/*!\n * sha256.js - SHA256 implementation for bcrypto\n * Copyright (c) 2016-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/hash.js:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/hash.js\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-2\n * https://tools.ietf.org/html/rfc4634\n * https://github.com/indutny/hash.js/blob/master/lib/hash/sha/256.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst HMAC = require('../internal/hmac');\n\n/*\n * Constants\n */\n\nconst FINALIZED = -1;\nconst DESC = Buffer.alloc(8, 0x00);\nconst PADDING = Buffer.alloc(64, 0x00);\n\nPADDING[0] = 0x80;\n\nconst K = new Uint32Array([\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n]);\n\n/**\n * SHA256\n */\n\nclass SHA256 {\n constructor() {\n this.state = new Uint32Array(8);\n this.msg = new Uint32Array(64);\n this.block = Buffer.alloc(64);\n this.size = FINALIZED;\n }\n\n init() {\n this.state[0] = 0x6a09e667;\n this.state[1] = 0xbb67ae85;\n this.state[2] = 0x3c6ef372;\n this.state[3] = 0xa54ff53a;\n this.state[4] = 0x510e527f;\n this.state[5] = 0x9b05688c;\n this.state[6] = 0x1f83d9ab;\n this.state[7] = 0x5be0cd19;\n this.size = 0;\n return this;\n }\n\n update(data) {\n assert(Buffer.isBuffer(data));\n this._update(data, data.length);\n return this;\n }\n\n final() {\n return this._final(Buffer.alloc(32));\n }\n\n _update(data, len) {\n assert(this.size !== FINALIZED, 'Context is not initialized.');\n\n let pos = this.size & 63;\n let off = 0;\n\n this.size += len;\n\n if (pos > 0) {\n let want = 64 - pos;\n\n if (want > len)\n want = len;\n\n data.copy(this.block, pos, off, off + want);\n\n pos += want;\n len -= want;\n off += want;\n\n if (pos < 64)\n return;\n\n this._transform(this.block, 0);\n }\n\n while (len >= 64) {\n this._transform(data, off);\n off += 64;\n len -= 64;\n }\n\n if (len > 0)\n data.copy(this.block, 0, off, off + len);\n }\n\n _final(out) {\n assert(this.size !== FINALIZED, 'Context is not initialized.');\n\n const pos = this.size & 63;\n const len = this.size * 8;\n\n writeU32(DESC, (len * (1 / 0x100000000)) >>> 0, 0);\n writeU32(DESC, len >>> 0, 4);\n\n this._update(PADDING, 1 + ((119 - pos) & 63));\n this._update(DESC, 8);\n\n for (let i = 0; i < 8; i++) {\n writeU32(out, this.state[i], i * 4);\n this.state[i] = 0;\n }\n\n for (let i = 0; i < 64; i++)\n this.msg[i] = 0;\n\n for (let i = 0; i < 64; i++)\n this.block[i] = 0;\n\n this.size = FINALIZED;\n\n return out;\n }\n\n _transform(chunk, pos) {\n const W = this.msg;\n\n let a = this.state[0];\n let b = this.state[1];\n let c = this.state[2];\n let d = this.state[3];\n let e = this.state[4];\n let f = this.state[5];\n let g = this.state[6];\n let h = this.state[7];\n let i = 0;\n\n for (; i < 16; i++)\n W[i] = readU32(chunk, pos + i * 4);\n\n for (; i < 64; i++)\n W[i] = sigma1(W[i - 2]) + W[i - 7] + sigma0(W[i - 15]) + W[i - 16];\n\n for (i = 0; i < 64; i++) {\n const t1 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i];\n const t2 = Sigma0(a) + Maj(a, b, c);\n\n h = g;\n g = f;\n f = e;\n\n e = (d + t1) >>> 0;\n\n d = c;\n c = b;\n b = a;\n\n a = (t1 + t2) >>> 0;\n }\n\n this.state[0] += a;\n this.state[1] += b;\n this.state[2] += c;\n this.state[3] += d;\n this.state[4] += e;\n this.state[5] += f;\n this.state[6] += g;\n this.state[7] += h;\n }\n\n static hash() {\n return new SHA256();\n }\n\n static hmac() {\n return new HMAC(SHA256, 64);\n }\n\n static digest(data) {\n return SHA256.ctx.init().update(data).final();\n }\n\n static root(left, right) {\n assert(Buffer.isBuffer(left) && left.length === 32);\n assert(Buffer.isBuffer(right) && right.length === 32);\n return SHA256.ctx.init().update(left).update(right).final();\n }\n\n static multi(x, y, z) {\n const {ctx} = SHA256;\n\n ctx.init();\n ctx.update(x);\n ctx.update(y);\n\n if (z)\n ctx.update(z);\n\n return ctx.final();\n }\n\n static mac(data, key) {\n return SHA256.hmac().init(key).update(data).final();\n }\n}\n\n/*\n * Static\n */\n\nSHA256.native = 0;\nSHA256.id = 'SHA256';\nSHA256.size = 32;\nSHA256.bits = 256;\nSHA256.blockSize = 64;\nSHA256.zero = Buffer.alloc(32, 0x00);\nSHA256.ctx = new SHA256();\n\n/*\n * Helpers\n */\n\nfunction Sigma0(x) {\n return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);\n}\n\nfunction Sigma1(x) {\n return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);\n}\n\nfunction sigma0(x) {\n return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3);\n}\n\nfunction sigma1(x) {\n return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10);\n}\n\nfunction Ch(x, y, z) {\n return z ^ (x & (y ^ z));\n}\n\nfunction Maj(x, y, z) {\n return (x & y) | (z & (x | y));\n}\n\nfunction readU32(data, off) {\n return (data[off++] * 0x1000000\n + data[off++] * 0x10000\n + data[off++] * 0x100\n + data[off]);\n}\n\nfunction writeU32(data, num, off) {\n data[off++] = num >>> 24;\n data[off++] = num >>> 16;\n data[off++] = num >>> 8;\n data[off++] = num;\n return off;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = SHA256;\n","/*!\n * sha256.js - sha256 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/sha256');\n","/*!\n * batch-rng.js - batch rng for bcrypto\n * Copyright (c) 2019-2020, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on ElementsProject/secp256k1-zkp:\n * Copyright (c) 2013, Pieter Wuille.\n * https://github.com/ElementsProject/secp256k1-zkp\n *\n * Resources:\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/modules/schnorrsig/main_impl.h#L166\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/scalar_4x64_impl.h#L972\n * https://github.com/ElementsProject/secp256k1-zkp/blob/11af701/src/scalar_8x32_impl.h#L747\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst BN = require('../bn');\nconst ChaCha20 = require('../chacha20');\nconst SHA256 = require('../sha256');\n\n/**\n * BatchRNG\n */\n\nclass BatchRNG {\n constructor(curve, encode = key => key) {\n this.curve = curve;\n this.encode = encode;\n this.hash = new SHA256();\n this.chacha = new ChaCha20();\n this.key = Buffer.alloc(32, 0x00);\n this.iv = Buffer.alloc(8, 0x00);\n this.cache = [new BN(1), new BN(1)];\n }\n\n init(batch) {\n assert(Array.isArray(batch));\n\n this.hash.init();\n\n for (const [msg, sig, key] of batch) {\n this.hash.update(SHA256.digest(msg));\n this.hash.update(sig);\n this.hash.update(this.encode(key));\n }\n\n this.key = this.hash.final();\n this.cache[0] = new BN(1);\n this.cache[1] = new BN(1);\n\n return this;\n }\n\n encrypt(counter) {\n const size = this.curve.scalarSize * 2;\n const data = Buffer.alloc(size, 0x00);\n const left = data.slice(0, this.curve.scalarSize);\n const right = data.slice(this.curve.scalarSize);\n\n this.chacha.init(this.key, this.iv, counter);\n this.chacha.encrypt(data);\n\n return [\n this.curve.decodeScalar(left),\n this.curve.decodeScalar(right)\n ];\n }\n\n refresh(counter) {\n let overflow = 0;\n\n for (;;) {\n // First word is always zero.\n this.iv[4] = overflow;\n this.iv[5] = overflow >>> 8;\n this.iv[6] = overflow >>> 16;\n this.iv[7] = overflow >>> 24;\n\n overflow += 1;\n\n const [s1, s2] = this.encrypt(counter);\n\n if (s1.isZero() || s1.cmp(this.curve.n) >= 0)\n continue;\n\n if (s2.isZero() || s2.cmp(this.curve.n) >= 0)\n continue;\n\n this.cache[0] = s1;\n this.cache[1] = s2;\n\n break;\n }\n }\n\n generate(index) {\n assert((index >>> 0) === index);\n\n if (index & 1)\n this.refresh(index >>> 1);\n\n return this.cache[index & 1];\n }\n}\n\n/*\n * Expose\n */\n\nmodule.exports = BatchRNG;\n","/*!\n * elliptic.js - elliptic curves for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/elliptic:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/elliptic\n *\n * Formulas from DJB and Tanja Lange [EFD].\n *\n * References:\n *\n * [GECC] Guide to Elliptic Curve Cryptography\n * D. Hankerson, A. Menezes, and S. Vanstone\n * https://tinyurl.com/guide-to-ecc\n *\n * [GLV] Faster Point Multiplication on Elliptic Curves\n * R. Gallant, R. Lambert, and S. Vanstone\n * https://link.springer.com/content/pdf/10.1007/3-540-44647-8_11.pdf\n *\n * [MONT1] Montgomery curves and the Montgomery ladder\n * Daniel J. Bernstein, Tanja Lange\n * https://eprint.iacr.org/2017/293.pdf\n *\n * [SQUARED] Elligator Squared\n * Mehdi Tibouchi\n * https://eprint.iacr.org/2014/043.pdf\n *\n * [SEC1] SEC 1 - Standards for Efficient Cryptography Group\n * Certicom Research\n * https://www.secg.org/sec1-v2.pdf\n *\n * [SEC2] SEC 2: Recommended Elliptic Curve Domain Parameters\n * Certicom Research\n * https://www.secg.org/sec2-v2.pdf\n *\n * [SIDE1] Elliptic Curves and Side-Channel Attacks\n * Marc Joye\n * https://pdfs.semanticscholar.org/8d69/9645033e25d74fcfd4cbf07a770d2e943e14.pdf\n *\n * [BLIND] Side-Channel Analysis on Blinding Regular Scalar Multiplications\n * B. Feix, M. Roussellet, A. Venelli\n * https://eprint.iacr.org/2014/191.pdf\n *\n * [ALT] Alternative Elliptic Curve Representations\n * R. Struik\n * https://tools.ietf.org/id/draft-ietf-lwig-curve-representations-02.html\n *\n * [ARITH1] Arithmetic of Elliptic Curves\n * Christophe Doche, Tanja Lange\n * Handbook of Elliptic and Hyperelliptic Curve Cryptography\n * Page 267, Section 13 (978-1-58488-518-4)\n * https://hyperelliptic.org/HEHCC/index.html\n *\n * [ARITH2] The Arithmetic of Elliptic Curves, 2nd Edition\n * Joseph H. Silverman\n * http://www.pdmi.ras.ru/~lowdimma/BSD/Silverman-Arithmetic_of_EC.pdf\n *\n * [EFD] Explicit-Formulas Database\n * Daniel J. Bernstein, Tanja Lange\n * https://hyperelliptic.org/EFD/index.html\n *\n * [SAFE] SafeCurves: choosing safe curves for elliptic-curve cryptography\n * Daniel J. Bernstein\n * https://safecurves.cr.yp.to/\n *\n * [4GLV] Refinement of the Four-Dimensional GLV Method on Elliptic Curves\n * Hairong Yi, Yuqing Zhu, and Dongdai Lin\n * http://www.site.uottawa.ca/~cadams/papers/prepro/paper_19_slides.pdf\n *\n * [SSWU1] Efficient Indifferentiable Hashing into Ordinary Elliptic Curves\n * E. Brier, J. Coron, T. Icart, D. Madore, H. Randriam, M. Tibouchi\n * https://eprint.iacr.org/2009/340.pdf\n *\n * [SSWU2] Rational points on certain hyperelliptic curves over finite fields\n * Maciej Ulas\n * https://arxiv.org/abs/0706.1448\n *\n * [H2EC] Hashing to Elliptic Curves\n * A. Faz-Hernandez, S. Scott, N. Sullivan, R. S. Wahby, C. A. Wood\n * https://git.io/JeWz6\n * https://github.com/cfrg/draft-irtf-cfrg-hash-to-curve\n *\n * [SVDW1] Construction of Rational Points on Elliptic Curves\n * A. Shallue, C. E. van de Woestijne\n * https://works.bepress.com/andrew_shallue/1/download/\n *\n * [SVDW2] Indifferentiable Hashing to Barreto-Naehrig Curves\n * Pierre-Alain Fouque, Mehdi Tibouchi\n * https://www.di.ens.fr/~fouque/pub/latincrypt12.pdf\n *\n * [SVDW3] Covert ECDH over secp256k1\n * Pieter Wuille\n * https://gist.github.com/sipa/29118d3fcfac69f9930d57433316c039\n *\n * [MONT2] Montgomery Curve (wikipedia)\n * https://en.wikipedia.org/wiki/Montgomery_curve\n *\n * [MONT3] Montgomery Curves and their arithmetic\n * C. Costello, B. Smith\n * https://eprint.iacr.org/2017/212.pdf\n *\n * [ELL2] Elliptic-curve points indistinguishable from uniform random strings\n * D. Bernstein, M. Hamburg, A. Krasnova, T. Lange\n * https://elligator.cr.yp.to/elligator-20130828.pdf\n *\n * [RFC7748] Elliptic Curves for Security\n * A. Langley, M. Hamburg, S. Turner\n * https://tools.ietf.org/html/rfc7748\n *\n * [TWISTED] Twisted Edwards Curves\n * D. Bernstein, P. Birkner, M. Joye, T. Lange, C. Peters\n * https://eprint.iacr.org/2008/013.pdf\n *\n * [ELL1] Injective Encodings to Elliptic Curves\n * P. Fouque, A. Joux, M. Tibouchi\n * https://eprint.iacr.org/2013/373.pdf\n *\n * [ISOGENY] Twisting Edwards curves with isogenies\n * Mike Hamburg\n * https://www.shiftleft.org/papers/isogeny/isogeny.pdf\n *\n * [RFC8032] Edwards-Curve Digital Signature Algorithm (EdDSA)\n * S. Josefsson, SJD AB, I. Liusvaara\n * https://tools.ietf.org/html/rfc8032\n *\n * [SCHNORR] Schnorr Signatures for secp256k1\n * Pieter Wuille\n * https://github.com/sipa/bips/blob/d194620/bip-schnorr.mediawiki\n *\n * [BIP340] Schnorr Signatures for secp256k1\n * Pieter Wuille, Jonas Nick, Tim Ruffing\n * https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki\n *\n * [JCEN12] Efficient Software Implementation of Public-Key Cryptography\n * on Sensor Networks Using the MSP430X Microcontroller\n * C. P. L. Gouvea, L. B. Oliveira, J. Lopez\n * http://conradoplg.cryptoland.net/files/2010/12/jcen12.pdf\n *\n * [FIPS186] Federal Information Processing Standards Publication\n * National Institute of Standards and Technology\n * https://tinyurl.com/fips-186-3\n *\n * [RFC5639] Elliptic Curve Cryptography (ECC) Brainpool\n * Standard Curves and Curve Generation\n * M. Lochter, BSI, J. Merkle\n * https://tools.ietf.org/html/rfc5639\n *\n * [TWISTEQ] Twisted Edwards & Short Weierstrass Equivalence\n * Christopher Jeffrey\n * https://gist.github.com/chjj/16ba7fa08d64e8dda269a9fe5b2a8bbc\n *\n * [ECPM] Elliptic Curve Point Multiplication (wikipedia)\n * https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication\n */\n\n'use strict';\n\nconst {custom} = require('../internal/custom');\nconst BN = require('../bn');\n\n/*\n * Constants\n */\n\nconst types = {\n AFFINE: 0,\n JACOBIAN: 1,\n PROJECTIVE: 2,\n EXTENDED: 3\n};\n\nconst jsfIndex = [\n -3, // -1 -1\n -1, // -1 0\n -5, // -1 1\n -7, // 0 -1\n 0, // 0 0\n 7, // 0 1\n 5, // 1 -1\n 1, // 1 0\n 3 // 1 1\n];\n\nconst USE_FIXED = false;\n\nlet uid = 0;\n\n/**\n * Curve\n */\n\nclass Curve {\n constructor(Point, type, conf) {\n this.Point = null;\n this.id = null;\n this.uid = uid++;\n this.ossl = null;\n this.type = 'base';\n this.endian = 'be';\n this.hash = null;\n this.prefix = null;\n this.context = false;\n this.prime = null;\n this.p = null;\n this.red = null;\n this.fieldSize = 0;\n this.fieldBits = 0;\n this.adjustedSize = 0;\n this.signBit = 0;\n this.mask = 0;\n this.n = null;\n this.h = null;\n this.q = null;\n this.z = null;\n this.g = null;\n this.nh = null;\n this.scalarSize = 0;\n this.scalarBits = 0;\n this.zero = null;\n this.one = null;\n this.two = null;\n this.three = null;\n this.four = null;\n this.i2 = null;\n this.i3 = null;\n this.i4 = null;\n this.i6 = null;\n this.torsion = null;\n this.endo = null;\n this.hi = null;\n this._init(Point, type, conf);\n }\n\n _init(Point, type, conf) {\n assert(typeof Point === 'function');\n assert(typeof type === 'string');\n assert(conf && typeof conf === 'object');\n assert(conf.red == null || (conf.red instanceof BN.Red));\n assert(conf.p != null, 'Must pass a prime.');\n assert(conf.id == null || typeof conf.id === 'string');\n assert(conf.ossl == null || typeof conf.ossl === 'string');\n assert(conf.endian == null || typeof conf.endian === 'string');\n assert(conf.hash == null || typeof conf.hash === 'string');\n assert(conf.prefix == null || typeof conf.prefix === 'string');\n assert(conf.context == null || typeof conf.context === 'boolean');\n assert(conf.prime == null || typeof conf.prime === 'string');\n assert(conf.torsion == null || Array.isArray(conf.torsion));\n\n // Point class.\n this.Point = Point;\n\n // Meta.\n this.id = conf.id || null;\n this.ossl = conf.ossl || null;\n this.type = type;\n this.endian = conf.endian || (type === 'short' ? 'be' : 'le');\n this.hash = conf.hash || null;\n this.prefix = conf.prefix ? Buffer.from(conf.prefix, 'binary') : null;\n this.context = conf.context || false;\n this.prime = conf.prime || null;\n\n // Prime.\n this.p = BN.fromJSON(conf.p);\n\n // Reduction.\n if (conf.red) {\n this.red = conf.red;\n } else {\n // Use Montgomery when there is no fast reduction for the prime.\n this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n this.red.precompute();\n }\n\n // Precalculate encoding length.\n this.fieldSize = this.p.byteLength();\n this.fieldBits = this.p.bitLength();\n this.adjustedSize = this.fieldSize + ((this.fieldBits & 7) === 0);\n this.signBit = this.adjustedSize * 8 - 1;\n this.mask = 0xff;\n\n if ((this.fieldBits & 7) !== 0)\n this.mask = (1 << (this.fieldBits & 7)) - 1;\n\n // Curve configuration, optional.\n this.n = BN.fromJSON(conf.n || '0');\n this.h = BN.fromJSON(conf.h || '1');\n this.q = this.n.mul(this.h);\n this.z = BN.fromJSON(conf.z || '0').toRed(this.red);\n this.g = null;\n this.nh = this.n.ushrn(1);\n this.scalarSize = this.n.byteLength();\n this.scalarBits = this.n.bitLength();\n\n // Useful for many curves.\n this.zero = new BN(0).toRed(this.red);\n this.one = new BN(1).toRed(this.red);\n this.two = new BN(2).toRed(this.red);\n this.three = new BN(3).toRed(this.red);\n this.four = new BN(4).toRed(this.red);\n\n // Inverses.\n this.i2 = this.two.redInvert();\n this.i3 = this.three.redInvert();\n this.i4 = this.i2.redSqr();\n this.i6 = this.i2.redMul(this.i3);\n\n // Torsion.\n this.torsion = new Array(this.h.word(0));\n\n for (let i = 0; i < this.torsion.length; i++)\n this.torsion[i] = this.point();\n\n // Endomorphism.\n this.endo = null;\n\n // Cache.\n this.hi = null;\n\n // Memoize.\n this._scale = memoize(this._scale, this);\n this.isIsomorphic = memoize(this.isIsomorphic, this);\n this.isIsogenous = memoize(this.isIsogenous, this);\n\n // Sanity checks.\n assert(this.p.sign() > 0 && this.p.isOdd());\n assert(this.n.sign() >= 0);\n assert(this.h.sign() > 0 && this.h.cmpn(255) <= 0);\n assert(this.endian === 'be' || this.endian === 'le');\n\n return this;\n }\n\n _finalize(conf) {\n assert(conf && typeof conf === 'object');\n\n // Create base point.\n this.g = conf.g ? this.pointFromJSON(conf.g) : this.point();\n\n // Parse small order points.\n if (conf.torsion) {\n assert(conf.torsion.length === this.torsion.length);\n\n for (let i = 0; i < this.torsion.length; i++)\n this.torsion[i] = this.pointFromJSON(conf.torsion[i]);\n }\n\n return this;\n }\n\n _findTorsion() {\n // Find all torsion points by grinding.\n assert(!this.n.isZero());\n\n const h = this.h.word(0);\n const x = this.one.redNeg();\n const out = [this.point()];\n const set = new Set();\n\n let len = h;\n\n while (out.length < len) {\n let p;\n\n x.redIAdd(this.one);\n\n try {\n p = this.pointFromX(x.clone());\n } catch (e) {\n continue;\n }\n\n try {\n p = p.mul(this.n);\n } catch (e) {\n len = 2;\n continue;\n }\n\n if (p.isInfinity())\n continue;\n\n p.normalize();\n\n for (const point of [p, p.neg()]) {\n const key = point.key();\n\n if (!set.has(key)) {\n out.push(point);\n set.add(key);\n }\n }\n }\n\n out.sort((a, b) => a.cmp(b));\n\n while (out.length < h)\n out.push(this.point());\n\n return out;\n }\n\n _fixedMul(p, k) {\n // Fixed-base method for point multiplication.\n //\n // [ECPM] \"Windowed method\".\n // [GECC] Page 95, Section 3.3.\n //\n // Windows are appropriately shifted to avoid any\n // doublings. This reduces a 256 bit multiplication\n // down to 64 additions with a window size of 4.\n assert(p instanceof Point);\n assert(k instanceof BN);\n assert(p.pre && p.pre.windows);\n\n // Get precomputed windows.\n const {width, points} = p._getWindows(0, 0);\n\n // Recompute window size.\n const size = 1 << width;\n\n // Recompute steps.\n const bits = k.bitLength();\n const steps = ((bits + width - 1) / width) >>> 0;\n\n // Multiply.\n let acc = this.jpoint();\n\n for (let i = 0; i < steps; i++) {\n const bits = k.bits(i * width, width);\n\n acc = acc.add(points[i * size + bits]);\n }\n\n // Adjust sign.\n if (k.isNeg())\n acc = acc.neg();\n\n return acc;\n }\n\n _fixedNafMul(p, k) {\n // Fixed-base NAF windowing method for point multiplication.\n //\n // [GECC] Algorithm 3.42, Page 105, Section 3.3.\n assert(p instanceof Point);\n assert(k instanceof BN);\n assert(p.pre && p.pre.doubles);\n\n // Get precomputed doubles.\n const {step, points} = p._getDoubles(0, 0);\n\n // Get fixed NAF (in a more windowed form).\n const naf = getFixedNAF(k, 2, k.bitLength() + 1, step);\n\n // Compute steps.\n const I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3;\n\n // Multiply.\n let a = this.jpoint();\n let b = this.jpoint();\n\n for (let i = I; i > 0; i--) {\n for (let j = 0; j < naf.length; j++) {\n const nafW = naf[j];\n\n if (nafW === i)\n b = b.add(points[j]);\n else if (nafW === -i)\n b = b.sub(points[j]);\n }\n\n a = a.add(b);\n }\n\n return a;\n }\n\n _wnafMul(w, p, k) {\n // Window NAF method for point multiplication.\n //\n // [GECC] Algorithm 3.36, Page 100, Section 3.3.\n assert(p instanceof Point);\n assert(k instanceof BN);\n\n // Precompute window.\n const {width, points} = p._safeNAF(w);\n\n // Get NAF form.\n const naf = getNAF(k, width, k.bitLength() + 1);\n\n // Add `this`*(N+1) for every w-NAF index.\n let acc = this.jpoint();\n\n for (let i = naf.length - 1; i >= 0; i--) {\n const z = naf[i];\n\n if (i !== naf.length - 1)\n acc = acc.dbl();\n\n if (z > 0)\n acc = acc.add(points[(z - 1) >> 1]);\n else if (z < 0)\n acc = acc.sub(points[(-z - 1) >> 1]);\n }\n\n return acc;\n }\n\n _wnafMulAdd(w, points, coeffs) {\n // Multiple point multiplication, also known\n // as \"Shamir's trick\" (with interleaved NAFs).\n //\n // [GECC] Algorithm 3.48, Page 109, Section 3.3.3.\n // Algorithm 3.51, Page 112, Section 3.3.\n //\n // This is particularly useful for signature\n // verifications and mutiplications after an\n // endomorphism split.\n assert((w >>> 0) === w);\n assert(Array.isArray(points));\n assert(Array.isArray(coeffs));\n assert(points.length === coeffs.length);\n\n const length = points.length;\n const wnd = new Array(length);\n const naf = new Array(length);\n\n // Check arrays and calculate size.\n let max = 0;\n\n for (let i = 0; i < length; i++) {\n const point = points[i];\n const coeff = coeffs[i];\n\n assert(point instanceof Point);\n assert(coeff instanceof BN);\n\n if (i > 0 && point.type !== points[i - 1].type)\n throw new Error('Cannot mix points.');\n\n // Avoid sparse arrays.\n wnd[i] = null;\n naf[i] = null;\n\n // Compute max scalar size.\n max = Math.max(max, coeff.bitLength() + 1);\n }\n\n // Compute NAFs.\n let ppoint = null;\n let pcoeff = null;\n let len = 0;\n\n for (let i = 0; i < length; i++) {\n const point = points[i];\n const coeff = coeffs[i];\n const pre = point._getNAF(0);\n\n // Use precomputation if available.\n if (pre) {\n wnd[len] = pre.points;\n naf[len] = getNAF(coeff, pre.width, max);\n len += 1;\n continue;\n }\n\n // Save last non-precomputed point.\n if (!ppoint) {\n ppoint = point;\n pcoeff = coeff;\n continue;\n }\n\n // Compute JSF in NAF form.\n wnd[len] = ppoint._getJNAF(point);\n naf[len] = getJNAF(pcoeff, coeff, max);\n\n ppoint = null;\n pcoeff = null;\n\n len += 1;\n }\n\n // Regular NAF for odd points.\n if (ppoint) {\n const nafw = ppoint._safeNAF(w);\n\n wnd[len] = nafw.points;\n naf[len] = getNAF(pcoeff, nafw.width, max);\n\n len += 1;\n }\n\n // Multiply and add.\n let acc = this.jpoint();\n\n for (let i = max - 1; i >= 0; i--) {\n if (i !== max - 1)\n acc = acc.dbl();\n\n for (let j = 0; j < len; j++) {\n const z = naf[j][i];\n\n if (z > 0)\n acc = acc.add(wnd[j][(z - 1) >> 1]);\n else if (z < 0)\n acc = acc.sub(wnd[j][(-z - 1) >> 1]);\n }\n }\n\n return acc;\n }\n\n _endoWnafMulAdd(points, coeffs) {\n throw new Error('Not implemented.');\n }\n\n _scale(curve, invert) {\n assert(curve instanceof Curve);\n assert(curve.p.eq(this.p));\n\n switch (curve.type) {\n case 'short':\n return this._scaleShort(curve, invert);\n case 'mont':\n return this._scaleMont(curve, invert);\n case 'edwards':\n return this._scaleEdwards(curve, invert);\n default:\n throw new Error('Not implemented.');\n }\n }\n\n _scaleShort(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n _scaleMont(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n _scaleEdwards(curve, invert) {\n throw new Error('Not implemented.');\n }\n\n isElliptic() {\n throw new Error('Not implemented.');\n }\n\n jinv() {\n throw new Error('Not implemented.');\n }\n\n isComplete() {\n return false;\n }\n\n precompute(rng) {\n assert(!this.g.isInfinity(), 'Must have base point.');\n assert(!this.n.isZero(), 'Must have order.');\n\n this.g.precompute(this.n.bitLength(), rng);\n\n return this;\n }\n\n scalar(num, base, endian) {\n const k = new BN(num, base, endian);\n\n assert(!k.red);\n\n if (this.n.isZero())\n return k;\n\n return k.imod(this.n);\n }\n\n field(num, base, endian) {\n const x = BN.cast(num, base, endian);\n\n if (x.red)\n return x.forceRed(this.red);\n\n return x.toRed(this.red);\n }\n\n point(x, y) {\n throw new Error('Not implemented.');\n }\n\n jpoint(x, y, z) {\n throw new Error('Not implemented.');\n }\n\n xpoint(x, z) {\n throw new Error('Not implemented.');\n }\n\n cpoint(xx, xz, yy, yz) {\n assert(xx instanceof BN);\n assert(xz instanceof BN);\n assert(yy instanceof BN);\n assert(yz instanceof BN);\n\n if (xz.isZero() || yz.isZero())\n return this.point();\n\n const z = xz.redMul(yz).redInvert();\n const x = xx.redMul(yz).redMul(z);\n const y = yy.redMul(xz).redMul(z);\n\n return this.point(x, y);\n }\n\n solveX2(y) {\n throw new Error('Not implemented.');\n }\n\n solveX(y) {\n return this.solveX2(y).redSqrt();\n }\n\n solveY2(x) {\n throw new Error('Not implemented.');\n }\n\n solveY(x) {\n return this.solveY2(x).redSqrt();\n }\n\n validate(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromX(x, sign) {\n throw new Error('Not implemented.');\n }\n\n pointFromY(y, sign) {\n throw new Error('Not implemented.');\n }\n\n isIsomorphic(curve) {\n throw new Error('Not implemented.');\n }\n\n isIsogenous(curve) {\n throw new Error('Not implemented.');\n }\n\n pointFromShort(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point, sign) {\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n throw new Error('Not implemented.');\n }\n\n pointToUniform(p) {\n throw new Error('Not implemented.');\n }\n\n pointFromHash(bytes, pake = false) {\n // [H2EC] \"Roadmap\".\n assert(Buffer.isBuffer(bytes));\n assert(typeof pake === 'boolean');\n\n if (bytes.length !== this.fieldSize * 2)\n throw new Error('Invalid hash size.');\n\n // Random oracle encoding.\n // Ensure a proper distribution.\n const s1 = bytes.slice(0, this.fieldSize);\n const s2 = bytes.slice(this.fieldSize);\n const u1 = this.decodeUniform(s1);\n const u2 = this.decodeUniform(s2);\n const p1 = this.pointFromUniform(u1);\n const p2 = this.pointFromUniform(u2);\n const p3 = p1.add(p2);\n\n return pake ? p3.mulH() : p3;\n }\n\n pointToHash(p, subgroup, rng) {\n // [SQUARED] Algorithm 1, Page 8, Section 3.3.\n assert(p instanceof this.Point);\n assert((subgroup >>> 0) === subgroup);\n\n // Add a random torsion component.\n const i = subgroup % this.torsion.length;\n const p0 = p.add(this.torsion[i]);\n\n // Average Cost (R = sqrt):\n //\n // SSWU (~4 iterations) => 8I + 16R\n // SVDW (~4 iterations) => 12I + 28R\n // Elligator 1 (~2 iterations) => 6I + 10R\n // Elligator 2 (~2 iterations) => 4I + 6R\n // Ristretto (~1 iteration) => 1I + 2R + h*1R\n for (;;) {\n const u1 = this.randomField(rng);\n const p1 = this.pointFromUniform(u1);\n\n // Avoid 2-torsion points:\n // Short Weierstrass: ((A / 3) / B, 0)\n // Montgomery: (0, 0)\n // Twisted Edwards: (0, -1)\n if (p1.neg().eq(p1))\n continue;\n\n const p2 = p0.sub(p1);\n const hint = randomInt(rng);\n\n let u2;\n try {\n u2 = this.pointToUniform(p2, hint & 15);\n } catch (e) {\n if (e.message === 'Invalid point.')\n continue;\n throw e;\n }\n\n const s1 = this.encodeUniform(u1, hint >>> 8);\n const s2 = this.encodeUniform(u2, hint >>> 16);\n\n return Buffer.concat([s1, s2]);\n }\n }\n\n randomScalar(rng) {\n const max = this.n.isZero() ? this.p : this.n;\n return BN.random(rng, 1, max);\n }\n\n randomField(rng) {\n return BN.random(rng, 1, this.p).toRed(this.red);\n }\n\n randomPoint(rng) {\n let p;\n\n for (;;) {\n const x = this.randomField(rng);\n const sign = (randomInt(rng) & 1) !== 0;\n\n try {\n p = this.pointFromX(x, sign);\n } catch (e) {\n continue;\n }\n\n assert(p.validate());\n\n return p.mulH();\n }\n }\n\n mulAll(points, coeffs) {\n return this.jmulAll(points, coeffs);\n }\n\n jmulAll(points, coeffs) {\n assert(Array.isArray(points));\n assert(points.length === 0 || (points[0] instanceof Point));\n\n // Multiply with endomorphism if we're using affine points.\n if (this.endo && points.length > 0 && points[0].type === types.AFFINE)\n return this._endoWnafMulAdd(points, coeffs);\n\n // Otherwise, a regular Shamir's trick.\n return this._wnafMulAdd(5, points, coeffs);\n }\n\n mulH(k) {\n assert(k instanceof BN);\n return this.imulH(k.clone());\n }\n\n imulH(k) {\n assert(k instanceof BN);\n assert(!k.red);\n\n const word = this.h.word(0);\n\n // Optimize for powers of two.\n if ((word & (word - 1)) === 0) {\n const bits = this.h.bitLength();\n return k.iushln(bits - 1).imod(this.n);\n }\n\n return k.imuln(word).imod(this.n);\n }\n\n normalizeAll(points) {\n assert(Array.isArray(points));\n\n const len = points.length;\n const z = new Array(len);\n\n for (let i = 0; i < len; i++) {\n const p = points[i];\n\n assert(p instanceof Point);\n assert(p.curve === this);\n\n if (p.type === types.AFFINE) {\n z[i] = this.one;\n continue;\n }\n\n z[i] = p.z;\n }\n\n const zi = this.red.invertAll(z);\n const out = new Array(len);\n\n for (let i = 0; i < len; i++)\n out[i] = points[i].scale(zi[i]);\n\n return out;\n }\n\n affinizeAll(points) {\n return this.normalizeAll(points);\n }\n\n clamp(scalar) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n assert(Buffer.isBuffer(scalar));\n assert(scalar.length === this.scalarSize);\n assert(this.scalarSize <= this.fieldSize);\n\n let top = (this.fieldBits & 7) || 8;\n let lsb = 0;\n let msb = this.scalarSize - 1;\n\n // Swap endianness.\n if (this.endian === 'be')\n [lsb, msb] = [msb, lsb];\n\n // Adjust for low order.\n if (this.scalarSize < this.fieldSize)\n top = 8;\n\n // Ensure a multiple of the cofactor.\n scalar[lsb] &= -this.h.word(0) & 0xff;\n\n // Clamp to the prime.\n scalar[msb] &= (1 << top) - 1;\n\n // Set the high bit.\n scalar[msb] |= 1 << (top - 1);\n\n return scalar;\n }\n\n splitHash(bytes) {\n // [RFC8032] Section 5.1.6 & 5.2.6.\n assert(Buffer.isBuffer(bytes));\n assert(bytes.length === this.adjustedSize * 2);\n assert(this.scalarSize <= this.adjustedSize);\n\n let off = 0;\n\n if (this.endian === 'be')\n off = this.adjustedSize - this.scalarSize;\n\n const scalar = bytes.slice(off, off + this.scalarSize);\n const prefix = bytes.slice(this.adjustedSize);\n\n this.clamp(scalar);\n\n return [scalar, prefix];\n }\n\n encodeField(x) {\n // [SEC1] Page 12, Section 2.3.5.\n assert(x instanceof BN);\n assert(!x.red);\n\n return x.encode(this.endian, this.fieldSize);\n }\n\n decodeField(bytes) {\n // [SEC1] Page 13, Section 2.3.6.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.fieldSize)\n throw new Error('Invalid field element size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeAdjusted(x) {\n assert(x instanceof BN);\n assert(!x.red);\n\n return x.encode(this.endian, this.adjustedSize);\n }\n\n decodeAdjusted(bytes) {\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.adjustedSize)\n throw new Error('Invalid field element size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeScalar(k) {\n // [SEC1] Page 13, Section 2.3.7.\n assert(k instanceof BN);\n assert(!k.red);\n\n return k.encode(this.endian, this.scalarSize);\n }\n\n decodeScalar(bytes) {\n // [SEC1] Page 14, Section 2.3.8.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.scalarSize)\n throw new Error('Invalid scalar size.');\n\n return BN.decode(bytes, this.endian);\n }\n\n encodeClamped(k) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n return this.clamp(this.encodeScalar(k));\n }\n\n decodeClamped(bytes) {\n // [RFC7748] Page 8, Section 5.\n // [RFC8032] Section 5.1.5 & 5.2.5.\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.scalarSize)\n throw new Error('Invalid scalar size.');\n\n const clamped = this.clamp(Buffer.from(bytes));\n\n return BN.decode(clamped, this.endian);\n }\n\n encodeUniform(x, bits) {\n assert(x instanceof BN);\n assert((bits >>> 0) === bits);\n\n const msb = this.endian === 'le' ? this.fieldSize - 1 : 0;\n const bytes = x.fromRed().encode(this.endian, this.fieldSize);\n\n bytes[msb] |= (bits & ~this.mask) & 0xff;\n\n return bytes;\n }\n\n decodeUniform(bytes) {\n assert(Buffer.isBuffer(bytes));\n\n if (bytes.length !== this.fieldSize)\n throw new Error('Invalid field size.');\n\n const x = BN.decode(bytes, this.endian);\n\n x.iumaskn(this.fieldBits);\n\n return x.toRed(this.red);\n }\n\n encodePoint(point, compact) {\n assert(point instanceof Point);\n return point.encode(compact);\n }\n\n decodePoint(bytes) {\n throw new Error('Not implemented.');\n }\n\n encodeX(point) {\n throw new Error('Not implemented.');\n }\n\n decodeX(bytes) {\n throw new Error('Not implemented.');\n }\n\n decodeEven(bytes) {\n throw new Error('Not implemented.');\n }\n\n decodeSquare(bytes) {\n throw new Error('Not implemented.');\n }\n\n toShort() {\n throw new Error('Not implemented.');\n }\n\n toMont(b0) {\n throw new Error('Not implemented.');\n }\n\n toEdwards(a0) {\n throw new Error('Not implemented.');\n }\n\n pointToJSON(point, pre) {\n assert(point instanceof Point);\n return point.toJSON(pre);\n }\n\n pointFromJSON(json) {\n throw new Error('Not implemented.');\n }\n\n toJSON(pre) {\n let prefix, context;\n let n, z, endo;\n\n if (this.type === 'edwards') {\n prefix = this.prefix ? this.prefix.toString() : null;\n context = this.context;\n }\n\n if (!this.n.isZero())\n n = this.n.toJSON();\n\n if (!this.z.isZero()) {\n z = this.z.fromRed();\n\n if (this.z.redIsHigh())\n z.isub(this.p);\n\n z = z.toString(16);\n }\n\n if (this.endo)\n endo = this.endo.toJSON();\n\n return {\n id: this.id,\n ossl: this.ossl,\n type: this.type,\n endian: this.endian,\n hash: this.hash,\n prefix,\n context,\n prime: this.prime,\n p: this.p.toJSON(),\n a: undefined,\n b: undefined,\n d: undefined,\n n,\n h: this.h.toString(16),\n s: undefined,\n z,\n c: undefined,\n g: this.g.toJSON(pre),\n endo\n };\n }\n\n static fromJSON(json) {\n return new this(json);\n }\n}\n\n/**\n * Point\n */\n\nclass Point {\n constructor(curve, type) {\n assert(curve instanceof Curve);\n assert((type >>> 0) === type);\n\n this.curve = curve;\n this.type = type;\n this.pre = null;\n }\n\n _init() {\n throw new Error('Not implemented.');\n }\n\n _safeNAF(width) {\n assert((width >>> 0) === width);\n\n if (this.pre && this.pre.naf)\n return this.pre.naf;\n\n if (width === 0)\n return null;\n\n const size = 1 << (width - 2);\n const points = new Array(size);\n const p = this.toJ();\n const dbl = size === 1 ? null : p.dbl();\n\n points[0] = p;\n\n for (let i = 1; i < size; i++)\n points[i] = points[i - 1].add(dbl);\n\n return new NAF(width, points);\n }\n\n _getNAF(width) {\n assert((width >>> 0) === width);\n\n if (this.pre && this.pre.naf)\n return this.pre.naf;\n\n if (width === 0)\n return null;\n\n const odds = this._safeNAF(width).points;\n const points = this.curve.affinizeAll(odds);\n\n return new NAF(width, points);\n }\n\n _getWindows(width, bits) {\n assert((width >>> 0) === width);\n assert((bits >>> 0) === bits);\n\n if (this.pre && this.pre.windows)\n return this.pre.windows;\n\n if (width === 0)\n return null;\n\n const size = 1 << width;\n const steps = ((bits + width - 1) / width) >>> 0;\n const wnds = new Array(steps * size);\n\n let g = this.toJ();\n\n for (let i = 0; i < steps; i++) {\n wnds[i * size] = this.curve.jpoint();\n\n for (let j = 1; j < size; j++)\n wnds[i * size + j] = wnds[i * size + j - 1].add(g);\n\n g = g.dblp(width);\n }\n\n const points = this.curve.affinizeAll(wnds);\n\n return new Windows(width, bits, points);\n }\n\n _getDoubles(step, power) {\n assert((step >>> 0) === step);\n assert((power >>> 0) === power);\n\n if (this.pre && this.pre.doubles)\n return this.pre.doubles;\n\n if (step === 0)\n return null;\n\n const len = Math.ceil(power / step) + 1;\n const dbls = new Array(len);\n\n let acc = this.toJ();\n let k = 0;\n\n dbls[k++] = acc;\n\n for (let i = 0; i < power; i += step) {\n for (let j = 0; j < step; j++)\n acc = acc.dbl();\n\n dbls[k++] = acc;\n }\n\n assert(k === len);\n\n const points = this.curve.affinizeAll(dbls);\n\n return new Doubles(step, points);\n }\n\n _getBeta() {\n return null;\n }\n\n _getBlinding(rng) {\n if (this.pre && this.pre.blinding)\n return this.pre.blinding;\n\n if (!rng)\n return null;\n\n if (this.curve.n.isZero())\n return null;\n\n // Pregenerate a random blinding value:\n //\n // blind = random integer in [1,n-1]\n // unblind = G * blind\n //\n // We intend to subtract the blinding value\n // from scalars before multiplication. We\n // can add the unblinding point once the\n // multiplication is complete.\n const blind = this.curve.randomScalar(rng);\n const unblind = this.mul(blind);\n\n return new Blinding(blind, unblind);\n }\n\n _hasWindows(k) {\n assert(k instanceof BN);\n\n if (!this.pre || !this.pre.windows)\n return false;\n\n const {width, bits} = this.pre.windows;\n const steps = ((bits + width - 1) / width) >>> 0;\n\n return k.bitLength() <= steps * width;\n }\n\n _hasDoubles(k) {\n assert(k instanceof BN);\n\n if (!this.pre || !this.pre.doubles)\n return false;\n\n const {step, points} = this.pre.doubles;\n const power = k.bitLength() + 1;\n\n return points.length >= Math.ceil(power / step) + 1;\n }\n\n _getJNAF(point) {\n assert(point instanceof Point);\n assert(point.type === this.type);\n\n // Create comb for JSF.\n return [\n this, // 1\n this.add(point), // 3\n this.sub(point), // 5\n point // 7\n ];\n }\n\n _blind(k, rng) {\n // [SIDE1] Page 5, Section 4.\n // [BLIND] Page 20, Section 7.\n assert(k instanceof BN);\n assert(!k.red);\n\n // Scalar splitting (requires precomputation).\n //\n // Blind a multiplication by first subtracting\n // a blinding value from the scalar. Example:\n //\n // b = random integer in [1,n-1]\n // B = P * b (precomputed)\n // Q = P * (k - b) + B\n //\n // Note that Joye describes a different method\n // (multiplier randomization) which computes:\n //\n // B = random point in E\n // Q = (P + B) * k - B * k\n //\n // Our method is more similar to the \"scalar\n // splitting\" technique described in the\n // second source above.\n //\n // The blinding value and its corresponding\n // point are randomly generated and computed\n // on boot. As long as an attacker is not\n // able to observe the boot, this should give\n // a decent bit of protection against various\n // channel attacks.\n if (this.pre && this.pre.blinding) {\n const {blind, unblind} = this.pre.blinding;\n const t = k.sub(blind);\n\n return [this, t, unblind];\n }\n\n // Randomization is not possible without\n // an RNG. Do a normal multiplication.\n if (!rng)\n return [this, k, null];\n\n // If we have no precomputed blinding\n // factor, there are two possibilities\n // for randomization:\n //\n // 1. Randomize the multiplier by adding\n // a random multiple of `n`.\n //\n // 2. Re-scale the point itself by a\n // random factor.\n //\n // The first option can be accomplished\n // with some like:\n //\n // a = random integer in [1,n-1]\n // r = a * n\n // Q = P * (k + r)\n //\n // The second is accomplished with:\n //\n // a = random element in F(p)\n // R = (x * a^2, y * a^3, z * a)\n // Q = R * k\n //\n // If we have precomputed doubles / naf\n // points, we opt for the first method\n // to avoid randomizing everything.\n if (this.pre) {\n if (this.curve.n.isZero())\n return [this, k, null];\n\n const a = this.curve.randomScalar(rng);\n const r = a.mul(this.curve.n);\n const t = r.iadd(k);\n\n return [this, t, null];\n }\n\n // If there is no precomputation _at all_,\n // we opt for the second method.\n const p = this.randomize(rng);\n\n return [p, k, null];\n }\n\n clone() {\n throw new Error('Not implemented.');\n }\n\n precompute(bits, rng) {\n assert((bits >>> 0) === bits);\n\n if (!this.pre)\n this.pre = new Precomp();\n\n if (!this.pre.naf)\n this.pre.naf = this._getNAF(9);\n\n if (USE_FIXED && !this.pre.windows)\n this.pre.windows = this._getWindows(4, bits);\n\n if (!this.pre.doubles)\n this.pre.doubles = this._getDoubles(4, bits + 1);\n\n if (!this.pre.beta)\n this.pre.beta = this._getBeta();\n\n if (!this.pre.blinding)\n this.pre.blinding = this._getBlinding(rng);\n\n return this;\n }\n\n validate() {\n return this.curve.validate(this);\n }\n\n normalize() {\n return this;\n }\n\n scale(a) {\n throw new Error('Not implemented.');\n }\n\n randomize(rng) {\n const z = this.curve.randomField(rng);\n return this.scale(z);\n }\n\n neg() {\n throw new Error('Not implemented.');\n }\n\n add(point) {\n throw new Error('Not implemented.');\n }\n\n sub(point) {\n assert(point instanceof Point);\n return this.add(point.neg());\n }\n\n dbl() {\n throw new Error('Not implemented.');\n }\n\n dblp(pow) {\n // Repeated doubling. This can\n // be optimized by child classes.\n assert((pow >>> 0) === pow);\n\n let r = this;\n\n for (let i = 0; i < pow; i++)\n r = r.dbl();\n\n return r;\n }\n\n diffAddDbl(p, q) {\n throw new Error('Not implemented.');\n }\n\n getX() {\n throw new Error('Not implemented.');\n }\n\n getY() {\n throw new Error('Not implemented.');\n }\n\n eq(point) {\n throw new Error('Not implemented.');\n }\n\n cmp(point) {\n throw new Error('Not implemented.');\n }\n\n isInfinity() {\n throw new Error('Not implemented.');\n }\n\n isOrder2() {\n throw new Error('Not implemented.');\n }\n\n isOdd() {\n throw new Error('Not implemented.');\n }\n\n isEven() {\n throw new Error('Not implemented.');\n }\n\n isSquare() {\n throw new Error('Not implemented.');\n }\n\n eqX(x) {\n throw new Error('Not implemented.');\n }\n\n eqR(x) {\n throw new Error('Not implemented.');\n }\n\n isSmall() {\n // Test whether the point is of small order.\n if (this.isInfinity())\n return false;\n\n // P * h = O\n return this.jmulH().isInfinity();\n }\n\n hasTorsion() {\n // Test whether the point is in another subgroup.\n if (this.isInfinity())\n return false;\n\n // P * n != O\n return !this.jmul(this.curve.n).isInfinity();\n }\n\n order() {\n // Calculate point order.\n const {h, n} = this.curve;\n\n let p = this.toJ();\n let q = new BN(1);\n\n while (!p.isInfinity()) {\n q.iaddn(1);\n\n if (q.cmp(h) > 0) {\n q = n.clone();\n break;\n }\n\n p = p.add(this);\n }\n\n return q;\n }\n\n mul(k) {\n return this.jmul(k);\n }\n\n muln(k) {\n return this.jmuln(k);\n }\n\n mulBlind(k, rng) {\n return this.jmulBlind(k, rng);\n }\n\n mulAdd(k1, p2, k2) {\n return this.jmulAdd(k1, p2, k2);\n }\n\n mulH() {\n return this.jmulH();\n }\n\n div(k) {\n return this.jdiv(k);\n }\n\n divn(k) {\n return this.jdivn(k);\n }\n\n divH() {\n return this.jdivH();\n }\n\n jmul(k) {\n if (USE_FIXED && this._hasWindows(k))\n return this.curve._fixedMul(this, k);\n\n if (this._hasDoubles(k))\n return this.curve._fixedNafMul(this, k);\n\n if (this.curve.endo && this.type === types.AFFINE)\n return this.curve._endoWnafMulAdd([this], [k]);\n\n return this.curve._wnafMul(5, this, k);\n }\n\n jmuln(k) {\n assert((k | 0) === k);\n return this.jmul(new BN(k));\n }\n\n jmulBlind(k, rng = null) {\n const [p, t, unblind] = this._blind(k, rng);\n const q = p.jmul(t);\n\n if (unblind)\n return q.add(unblind);\n\n return q;\n }\n\n jmulAdd(k1, p2, k2) {\n if (this.curve.endo && this.type === types.AFFINE)\n return this.curve._endoWnafMulAdd([this, p2], [k1, k2]);\n\n return this.curve._wnafMulAdd(5, [this, p2], [k1, k2]);\n }\n\n jmulH() {\n const word = this.curve.h.word(0);\n\n // Optimize for powers of two.\n if ((word & (word - 1)) === 0) {\n const bits = this.curve.h.bitLength();\n return this.toJ().dblp(bits - 1);\n }\n\n return this.jmul(this.curve.h);\n }\n\n jdiv(k) {\n assert(k instanceof BN);\n assert(!k.red);\n\n return this.jmul(k.invert(this.curve.n));\n }\n\n jdivn(k) {\n assert(!this.curve.n.isZero());\n\n if (this.curve.h.cmpn(k) === 0)\n return this.jdivH();\n\n return this.jdiv(new BN(k));\n }\n\n jdivH() {\n if (this.curve.n.isZero())\n return this.toJ();\n\n if (this.curve.h.cmpn(1) === 0)\n return this.toJ();\n\n if (this.curve.hi === null)\n this.curve.hi = this.curve.h.invert(this.curve.n);\n\n return this.jmul(this.curve.hi);\n }\n\n toP() {\n return this.normalize();\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n return this;\n }\n\n key() {\n if (this.isInfinity())\n return `${this.curve.uid}:oo`;\n\n this.normalize();\n\n const x = this.getX().toString(16);\n const y = this.getY().toString(16);\n\n return `${this.curve.uid}:${x},${y}`;\n }\n\n encode(compact) {\n throw new Error('Not implemented.');\n }\n\n static decode(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n encodeX() {\n throw new Error('Not implemented.');\n }\n\n static decodeX(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n static decodeEven(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n static decodeSquare(curve, bytes) {\n throw new Error('Not implemented.');\n }\n\n toJSON(pre) {\n throw new Error('Not implemented.');\n }\n\n static fromJSON(curve, json) {\n throw new Error('Not implemented.');\n }\n\n [custom]() {\n return '';\n }\n}\n\n/**\n * ShortCurve\n */\n\nclass ShortCurve extends Curve {\n constructor(conf) {\n super(ShortPoint, 'short', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.b = BN.fromJSON(conf.b).toRed(this.red);\n this.c = BN.fromJSON(conf.c || '0').toRed(this.red);\n this.ai = this.a.isZero() ? this.zero : this.a.redInvert();\n this.zi = this.z.isZero() ? this.zero : this.z.redInvert();\n\n this.zeroA = this.a.isZero();\n this.threeA = this.a.eq(this.three.redNeg());\n this.redN = this.n.toRed(this.red);\n this.pmodn = this.p.clone();\n this.highOrder = this.n.cmp(this.p) >= 0;\n this.smallGap = false;\n\n this._finalize(conf);\n }\n\n _finalize(conf) {\n super._finalize(conf);\n\n // Precalculate endomorphism.\n if (conf.endo != null)\n this.endo = Endo.fromJSON(this, conf.endo);\n else\n this.endo = this._getEndomorphism();\n\n if (!this.n.isZero()) {\n this.pmodn = this.p.mod(this.n);\n\n // Check for Maxwell's trick (see eqR).\n this.smallGap = this.p.div(this.n).cmpn(1) <= 0;\n }\n\n return this;\n }\n\n static _isomorphism(curveA, curveB, custom, odd) {\n // Short Weierstrass Isomorphism.\n //\n // [GECC] Page 84, Section 3.1.5.\n // [ARITH1] Page 274, Section 13.1.5.\n // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves).\n //\n // Find `u` such that `a * u^4 = a'` and `b * u^6 = b'`.\n //\n // Transformation:\n //\n // u4 = a' / a\n // u2 = +-sqrt(u4)\n // u6 = u4 * u2\n // a' = a * u4\n // b' = b * u6\n //\n // Where `u2` is any root that is square.\n //\n // If a = 0, we can do:\n //\n // a' = 0\n // b' = b'\n //\n // Where (b' / b)^(1 / 3) is square.\n //\n // If b = 0, we can do:\n //\n // a' = a'\n // b' = 0\n //\n // Where sqrt(a' / a) is square.\n assert(curveA instanceof BN);\n assert(curveB instanceof BN);\n assert(custom instanceof BN);\n assert(odd == null || typeof odd === 'boolean');\n assert(!curveA.isZero() || !curveB.isZero());\n\n if (custom.isZero())\n throw new Error('Invalid coefficient.');\n\n if (curveA.isZero()) {\n const customB = custom;\n const u6 = customB.redDiv(curveB);\n // Todo: allow index flag.\n const u2 = uncube(u6);\n\n // Already checked in uncube().\n assert(u2.redJacobi() === 1);\n\n return [curveA.clone(), customB.clone()];\n }\n\n if (curveB.isZero()) {\n const customA = custom;\n const u4 = customA.redDiv(curveA);\n const u2 = u4.redSqrt();\n\n // Todo: allow odd flag.\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n\n if (u2.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n return [customA.clone(), curveB.clone()];\n }\n\n const customA = custom;\n const u4 = customA.redDiv(curveA);\n const u2 = u4.redSqrt();\n\n if (odd != null) {\n if (u2.redIsOdd() !== odd)\n u2.redINeg();\n } else {\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n }\n\n if (u2.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n const u6 = u4.redMul(u2);\n const a = curveA.redMul(u4);\n const b = curveB.redMul(u6);\n\n assert(a.eq(customA));\n\n return [a, b];\n }\n\n _short(a0, odd) {\n return ShortCurve._isomorphism(this.a, this.b, a0, odd);\n }\n\n _mont(b0, odd) {\n // Short Weierstrass->Montgomery Equivalence.\n //\n // [ARITH1] Page 286, Section 13.2.3.c.\n // [SAFE] \"Ladders\".\n //\n // Transformation:\n //\n // r = A / (3 * B)\n // s = +-sqrt(3 * r^2 + a)\n // A = 3 * r / s\n // B = 1 / s\n const [r, s] = this._findRS(odd);\n const b = s.redInvert();\n const a = r.redMuln(3).redMul(b);\n\n if (b0 != null)\n return MontCurve._isomorphism(a, b, b0);\n\n return [a, b];\n }\n\n _edwards(a0, odd) {\n // Short Weierstrass->Twisted Edwards Equivalence.\n //\n // [TWISTEQ] Section 1.\n //\n // Transformation:\n //\n // r = (a' + d') / 6\n // s = +-sqrt(3 * r^2 + a)\n // a' = 3 * r + 2 * s\n // d' = 3 * r - 2 * s\n const [r, s] = this._findRS(odd);\n const r3 = r.redMuln(3);\n const s2 = s.redMuln(2);\n const a = r3.redAdd(s2);\n const d = r3.redSub(s2);\n\n if (a0 != null)\n return EdwardsCurve._isomorphism(a, d, a0);\n\n return [a, d];\n }\n\n _findRS(sign) {\n // Find `r` and `s` for equivalence.\n //\n // [ARITH1] Page 286, Section 13.2.3.c.\n // [SAFE] \"Ladders\".\n //\n // Computation:\n //\n // r = solve(r^3 + a * r + b == 0, r)\n // s = +-sqrt(3 * r^2 + a)\n //\n // Computing `r` is non-trivial. We need\n // to solve `r^3 + a * r + b = 0`, but we\n // don't have a polynomial solver, so we\n // loop over random points until we find\n // one with 2-torsion. Multiplying by the\n // subgroup order should yield a point of\n // ((A / 3) / B, 0) which is a solution.\n assert(sign == null || typeof sign === 'boolean');\n assert(this.h.word(0) >= 4);\n assert(!this.n.isZero());\n\n const x = this.one.redNeg();\n\n let p;\n\n for (;;) {\n x.redIAdd(this.one);\n\n try {\n p = this.pointFromX(x.clone());\n } catch (e) {\n continue;\n }\n\n p = p.mul(this.n);\n\n if (p.isInfinity())\n continue;\n\n if (!p.y.isZero())\n continue;\n\n break;\n }\n\n const r = p.x;\n const r2 = r.redSqr();\n const s = r2.redMuln(3).redIAdd(this.a).redSqrt();\n\n if (sign != null) {\n if (s.redIsOdd() !== sign)\n s.redINeg();\n }\n\n return [r, s];\n }\n\n _scale0(a, b) {\n // We can extract the isomorphism factors with:\n //\n // u4 = a' / a\n // u6 = b' / b\n // u2 = +-sqrt(u4)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // `u2` should be picked such that `u4 * u2 = u6`.\n //\n // If a = 0, we can do:\n //\n // u6 = b' / b\n // u2 = u6^(1 / 3)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // Where `u2` is any root that is square.\n //\n // If b = 0, we can do:\n //\n // u4 = a' / a\n // u2 = +-sqrt(u4)\n // u = +-sqrt(u2)\n // u3 = u2 * u\n //\n // Where `u2` is any root that is square.\n assert(this.a.isZero() === a.isZero());\n assert(this.b.isZero() === b.isZero());\n\n if (this.a.isZero()) {\n const u6 = this.b.redDiv(this.field(b));\n // Todo: figure out how to check index.\n const u2 = uncube(u6);\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(u3.redSqr().eq(u6));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n if (this.b.isZero()) {\n const u4 = this.a.redDiv(this.field(a));\n const u2 = u4.redSqrt();\n\n // Todo: figure out how to check oddness.\n if (u2.redJacobi() !== 1)\n u2.redINeg();\n\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(u3.redMul(u).eq(u4));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n const u4 = this.a.redDiv(this.field(a));\n const u6 = this.b.redDiv(this.field(b));\n const u2 = u4.redSqrt();\n\n if (!u4.redMul(u2).eq(u6))\n u2.redINeg();\n\n assert(u4.redMul(u2).eq(u6));\n\n const u = u2.redSqrt();\n const u3 = u2.redMul(u);\n\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n _scale1(x, y) {\n // If base points are available, it is much\n // easier, with:\n //\n // u2 = x' / x\n // u3 = y' / y\n // u = +-sqrt(u2)\n //\n // `u` should be picked such that `u2 * u = u3`.\n const u2 = this.g.x.redDiv(this.field(x));\n const u3 = this.g.y.redDiv(this.field(y));\n const u = u2.redSqrt();\n\n if (!u2.redMul(u).eq(u3))\n u.redINeg();\n\n assert(u2.redMul(u).eq(u3));\n assert(!u.isZero());\n\n return [u2, u3];\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this._scale0(curve.a, curve.b);\n\n return this._scale1(curve.g.x, curve.g.y);\n }\n\n _scaleMont(curve) {\n assert(curve instanceof MontCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a, b] = curve._short();\n return this._scale0(a, b);\n }\n\n const {x, y} = curve.g;\n const nx = x.redAdd(curve.a3).redMul(curve.bi);\n const ny = y.redMul(curve.bi);\n\n return this._scale1(nx, ny);\n }\n\n _scaleEdwards(curve) {\n assert(curve instanceof EdwardsCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a, b] = curve._short();\n return this._scale0(a, b);\n }\n\n const {x, y, z} = curve.g;\n const a5 = curve.a.redMuln(5);\n const d5 = curve.d.redMuln(5);\n const dma = curve.d.redSub(curve.a);\n const d5a = d5.redSub(curve.a);\n const da5 = curve.d.redSub(a5);\n const ypz = y.redAdd(z);\n const ymz = y.redSub(z);\n const xx = d5a.redMul(y).redIAdd(da5.redMul(z));\n const xz = ymz.redMuln(12);\n const yy = dma.redMul(ypz).redMul(z);\n const yz = ymz.redMul(x).redIMuln(4);\n const zi = xz.redMul(yz).redInvert();\n const nx = xx.redMul(yz).redMul(zi);\n const ny = yy.redMul(xz).redMul(zi);\n\n return this._scale1(nx, ny);\n }\n\n _getEndomorphism(index = 0) {\n // Compute endomorphism.\n //\n // [GECC] Example 3.76, Page 128, Section 3.5.\n\n // No curve params.\n if (this.n.isZero() || this.g.isInfinity())\n return null;\n\n // No efficient endomorphism.\n if (!this.zeroA || this.p.modrn(3) !== 1 || this.n.modrn(3) !== 1)\n return null;\n\n // Solve beta^3 mod p = 1.\n const [b1, b2] = this._getEndoRoots(this.p);\n\n // Choose the smallest beta by default.\n const beta = [b1, b2][index & 1].toRed(this.red);\n\n // Solve lambda^3 mod n = 1.\n const [l1, l2] = this._getEndoRoots(this.n);\n\n // Choose the lambda matching selected beta.\n // Note that P * lambda = (x * beta, y).\n const p = this.point(this.g.x.redMul(beta), this.g.y);\n\n let lambda;\n\n if (this.g.mul(l1).eq(p)) {\n lambda = l1;\n } else {\n assert(this.g.mul(l2).eq(p));\n lambda = l2;\n }\n\n // Get basis vectors.\n const basis = this._getEndoBasis(lambda);\n\n // Precompute `g1` and `g2`.\n const pre = this._getEndoPrecomp(basis);\n\n return new Endo(beta, lambda, basis, pre);\n }\n\n _getEndoRoots(num) {\n // Find roots for x^2 + x + 1 in F.\n //\n // [GECC] Example 3.76, Page 128, Section 3.5.\n // [GLV] Page 192, Section 2 (Endomorphisms).\n //\n // The above document doesn't fully explain how\n // to derive these and only \"hints\" at it, as\n // mentioned by Hal Finney[1], but we're basically\n // computing two possible cube roots of 1 here.\n //\n // Note that we could also compute[2]:\n //\n // beta = 2^((p - 1) / 3) mod p\n // lambda = 3^((n - 1) / 3) mod n\n //\n // As an extension of Fermat's little theorem:\n //\n // g^(p - 1) mod p == 1\n //\n // It is suspected[3] this is how Hal Finney[4]\n // computed his original endomorphism roots.\n //\n // @indutny's method for computing cube roots\n // of unity[5] appears to be the method described\n // on wikipedia[6][7].\n //\n // Sage produces the same solution:\n //\n // sage: solve(x^2 + x + 1 == 0, x)\n // [x == -1/2*I*sqrt(3) - 1/2, x == 1/2*I*sqrt(3) - 1/2]\n //\n // This can be reduced to:\n //\n // x = (+-sqrt(-3) - 1) / 2\n //\n // [1] https://bitcointalk.org/index.php?topic=3238.msg45565#msg45565\n // [2] https://crypto.stackexchange.com/a/22739\n // [3] https://bitcoin.stackexchange.com/a/35872\n // [4] https://github.com/halfinney/bitcoin/commit/dc411b5\n // [5] https://en.wikipedia.org/wiki/Cube_root_of_unity\n // [6] https://en.wikipedia.org/wiki/Splitting_field#Cubic_example\n // [7] http://mathworld.wolfram.com/SplittingField.html\n const red = num === this.p ? this.red : BN.mont(num);\n const two = new BN(2).toRed(red);\n const three = new BN(3).toRed(red);\n const i2 = two.redInvert();\n\n // S1 = sqrt(-3) / 2\n const s1 = three.redNeg().redSqrt().redMul(i2);\n\n // S2 = -S1\n const s2 = s1.redNeg();\n\n // R1 = S1 - 1 / 2\n const r1 = s1.redSub(i2).fromRed();\n\n // R2 = S2 - 1 / 2\n const r2 = s2.redSub(i2).fromRed();\n\n return [r1, r2].sort(BN.cmp);\n }\n\n _getEndoBasis(lambda) {\n // Compute endomorphic basis.\n //\n // This essentially computes Cornacchia's algorithm\n // for solving x^2 + d * y^2 = m (d = lambda, m = order).\n //\n // https://en.wikipedia.org/wiki/Cornacchia%27s_algorithm\n //\n // [GECC] Algorithm 3.74, Page 127, Section 3.5.\n // [GLV] Page 196, Section 4 (Decomposing K).\n //\n // Balanced length-two representation of a multiplier.\n //\n // 1. Run the extended euclidean algorithm with inputs n\n // and lambda. The algorithm produces a sequence of\n // equations si*n + ti*lam = ri where s0=1, t0=0,\n // r0=n, s1=0, t1=1, r1=lam, and the remainders ri\n // and are non-negative and strictly decreasing. Let\n // l be the greatest index for which rl >= sqrt(n).\n const [rl, tl, rl1, tl1, rl2, tl2] = this._egcdSqrt(lambda);\n\n // 2. Set (a1, b1) <- (rl+1, -tl+1).\n const a1 = rl1;\n const b1 = tl1.neg();\n\n // 3. If (rl^2 + tl^2) <= (rl+2^2 + tl+2^2)\n // then set (a2, b2) <- (rl, -tl).\n // else set (a2, b2) <- (rl+2, -tl+2).\n const lhs = rl.sqr().iadd(tl.sqr());\n const rhs = rl2.sqr().iadd(tl2.sqr());\n\n let a2, b2;\n\n if (lhs.cmp(rhs) <= 0) {\n a2 = rl;\n b2 = tl.neg();\n } else {\n a2 = rl2;\n b2 = tl2.neg();\n }\n\n return [\n new Vector(a1, b1),\n new Vector(a2, b2)\n ];\n }\n\n _egcdSqrt(lambda) {\n // Extended Euclidean algorithm for integers.\n //\n // [GECC] Algorithm 2.19, Page 40, Section 2.2.\n // [GLV] Page 196, Section 4 (Decomposing K).\n assert(lambda instanceof BN);\n assert(!lambda.red);\n assert(lambda.sign() > 0);\n assert(this.n.sign() > 0);\n\n // Note that we insert the approximate square\n // root checks as described in algorithm 3.74.\n //\n // Algorithm 2.19 is defined as:\n //\n // 1. u <- a\n // v <- b\n //\n // 2. x1 <- 1\n // y1 <- 0\n // x2 <- 0\n // y2 <- 1\n //\n // 3. while u != 0 do\n //\n // 3.1. q <- floor(v / u)\n // r <- v - q * u\n // x <- x2 - q * x1\n // y <- y2 - q * y1\n //\n // 3.2. v <- u\n // u <- r\n // x2 <- x1\n // x1 <- x\n // y2 <- y1\n // y1 <- y\n //\n // 4. d <- v\n // x <- x2\n // y <- y2\n //\n // 5. Return (d, x, y).\n\n // Start with an approximate square root of n.\n const sqrtn = this.n.ushrn(this.n.bitLength() >>> 1);\n\n let u = lambda; // r1\n let v = this.n.clone(); // r0\n let x1 = new BN(1); // t1\n let y1 = new BN(0); // t0\n let x2 = new BN(0); // s1\n let y2 = new BN(1); // s0\n\n // All vectors are roots of: a + b * lambda = 0 (mod n).\n let rl, tl;\n\n // First vector.\n let rl1, tl1;\n\n // Inner.\n let i = 0;\n let j = 0;\n let p;\n\n // Compute EGCD.\n while (!u.isZero() && i < 2) {\n const q = v.quo(u);\n const r = v.sub(q.mul(u));\n const x = x2.sub(q.mul(x1));\n const y = y2.sub(q.mul(y1));\n\n // Check for r < sqrt(n).\n if (j === 0 && r.cmp(sqrtn) < 0) {\n rl = p;\n tl = x1;\n rl1 = r;\n tl1 = x;\n j = 1; // 1 more round.\n }\n\n p = r;\n v = u;\n u = r;\n x2 = x1;\n x1 = x;\n y2 = y1;\n y1 = y;\n\n i += j;\n }\n\n // Should never happen.\n assert(j !== 0, 'Could not find r < sqrt(n).');\n\n // Second vector.\n const rl2 = x2;\n const tl2 = x1;\n\n return [\n rl,\n tl,\n rl1,\n tl1,\n rl2,\n tl2\n ];\n }\n\n _getEndoPrecomp(basis) {\n // Precompute `g1` and `g2` to avoid round division.\n //\n // [JCEN12] Page 5, Section 4.3.\n //\n // Computation:\n //\n // d = a1 * b2 - b1 * a2\n // t = ceil(log2(d+1)) + p\n // g1 = round((2^t * b2) / d)\n // g2 = round((2^t * b1) / d)\n //\n // Where:\n //\n // `p` is the number of precision bits.\n // `d` is equal to `n` (the curve order).\n //\n // The paper above uses 2 as the value of `p`,\n // whereas libsecp256k1 uses 128 (total=384).\n //\n // We pick precision for `g1` and `g2` such that:\n //\n // abs(g1) < n\n // abs(g2) < n\n //\n // This ensures maximum precision for the constants\n // while also ensuring they fit into a fixed number\n // of scalar limbs in more optimized implementations.\n //\n // Furthermore, we attempt to align to a limb width\n // of 64 bits. This allows us to optimize the shift,\n // a la libsecp256k1[1].\n //\n // [1] https://github.com/bitcoin-core/secp256k1/pull/822\n assert(Array.isArray(basis));\n assert(basis.length === 2);\n assert(basis[0] instanceof Vector);\n assert(basis[1] instanceof Vector);\n\n const [v1, v2] = basis;\n const d = v1.a.mul(v2.b).isub(v1.b.mul(v2.a));\n const bits = d.bitLength();\n const align = bits >= 160;\n\n assert(d.eq(this.n));\n\n // Start with a rough estimate.\n let shift = bits + Math.ceil(bits / 2) + 1;\n let g1, g2;\n\n if (align)\n shift -= shift & 63;\n\n while (shift > bits) {\n g1 = v2.b.ushln(shift).divRound(d);\n g2 = v1.b.ushln(shift).divRound(d);\n\n if (g1.ucmp(d) < 0 && g2.ucmp(d) < 0)\n break;\n\n if (align)\n shift -= 64;\n else\n shift -= 1;\n }\n\n if (shift <= bits)\n throw new Error('Could not calculate g1 and g2.');\n\n return [shift, g1, g2];\n }\n\n _endoSplit(k) {\n // Balanced length-two representation of a multiplier.\n //\n // [GECC] Algorithm 3.74, Page 127, Section 3.5.\n //\n // Also note that it is possible to precompute[1]\n // values in order to avoid the division[2][3][4].\n //\n // This involves precomputing `g1` and `g2 (see\n // above). `c1` and `c2` can then be computed as\n // follows:\n //\n // t = ceil(log2(n+1)) + p\n // c1 = (k * g1) >> t\n // c2 = -((k * g2) >> t)\n //\n // Where `>>` is an _unsigned_ right shift. Also\n // note that the last bit discarded in the shift\n // must be stored. If it is 1, then add 1 to the\n // scalar (absolute addition).\n //\n // It's worth noting that libsecp256k1 uses a\n // different calculation along the lines of:\n //\n // t = ceil(log2(n+1)) + p\n // c1 = ((k * g1) >> t) * -b1\n // c2 = ((k * -g2) >> t) * -b2\n // k2 = c1 + c2\n // k1 = k2 * -lambda + k\n //\n // So, in the future, we can consider changing\n // step 4 to:\n //\n // 4. Compute c1 = (k * g1) >> t\n // and c2 = -((k * g2) >> t).\n //\n // const [shift, g1, g2] = this.endo.pre;\n // const c1 = k.mulShift(g1, shift);\n // const c2 = k.mulShift(g2, shift).ineg();\n //\n // Once we're brave enough, that is.\n //\n // [1] [JCEN12] Page 5, Section 4.3.\n // [2] https://github.com/bitcoin-core/secp256k1/blob/0b70241/src/scalar_impl.h#L259\n // [3] https://github.com/bitcoin-core/secp256k1/pull/21\n // [4] https://github.com/bitcoin-core/secp256k1/pull/127\n assert(k instanceof BN);\n assert(!k.red);\n assert(!this.n.isZero());\n\n const [v1, v2] = this.endo.basis;\n\n // 4. Compute c1 = round(b2 * k / n)\n // and c2 = round(-b1 * k / n).\n const c1 = v2.b.mul(k).divRound(this.n);\n const c2 = v1.b.neg().mul(k).divRound(this.n);\n\n // 5. Compute k1 = k - c1 * a1 - c2 * a2\n // and k2 = -c1 * b1 - c2 * b2.\n const p1 = c1.mul(v1.a);\n const p2 = c2.mul(v2.a);\n const q1 = c1.ineg().mul(v1.b);\n const q2 = c2.mul(v2.b);\n\n // Calculate answer.\n const k1 = k.sub(p1).isub(p2);\n const k2 = q1.isub(q2);\n\n // 6. Return (k1, k2).\n return [k1, k2];\n }\n\n _endoBeta(point) {\n assert(point instanceof ShortPoint);\n return [point, point._getBeta()];\n }\n\n _endoWnafMulAdd(points, coeffs) {\n // Point multiplication with efficiently computable endomorphisms.\n //\n // [GECC] Algorithm 3.77, Page 129, Section 3.5.\n // [GLV] Page 193, Section 3 (Using Efficient Endomorphisms).\n //\n // Note it may be possible to do this 4-dimensionally [4GLV].\n assert(Array.isArray(points));\n assert(Array.isArray(coeffs));\n assert(points.length === coeffs.length);\n assert(this.endo != null);\n\n const len = points.length;\n const npoints = new Array(len * 2);\n const ncoeffs = new Array(len * 2);\n\n for (let i = 0; i < len; i++) {\n const [p1, p2] = this._endoBeta(points[i]);\n const [k1, k2] = this._endoSplit(coeffs[i]);\n\n npoints[i * 2 + 0] = p1;\n ncoeffs[i * 2 + 0] = k1;\n npoints[i * 2 + 1] = p2;\n ncoeffs[i * 2 + 1] = k2;\n }\n\n return this._wnafMulAdd(5, npoints, ncoeffs);\n }\n\n _sswu(u) {\n // Simplified Shallue-Woestijne-Ulas Method.\n //\n // Distribution: 3/8.\n //\n // [SSWU1] Page 15-16, Section 7. Appendix G.\n // [SSWU2] Page 5, Theorem 2.3.\n // [H2EC] \"Simplified Shallue-van de Woestijne-Ulas Method\".\n //\n // Assumptions:\n //\n // - a != 0, b != 0.\n // - Let z be a non-square in F(p).\n // - z != -1.\n // - The polynomial g(x) - z is irreducible over F(p).\n // - g(b / (z * a)) is square in F(p).\n // - u != 0, u != +-sqrt(-1 / z).\n //\n // Map:\n //\n // g(x) = x^3 + a * x + b\n // t1 = 1 / (z^2 * u^4 + z * u^2)\n // x1 = (-b / a) * (1 + t1)\n // x1 = b / (z * a), if t1 = 0\n // x2 = z * u^2 * x1\n // x = x1, if g(x1) is square\n // = x2, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const {b, z, ai, zi, one} = this;\n const z2 = z.redSqr();\n const ba = b.redNeg().redMul(ai);\n const bza = b.redMul(zi).redMul(ai);\n const u2 = u.redSqr();\n const u4 = u2.redSqr();\n const t0 = z2.redMul(u4).redIAdd(z.redMul(u2));\n const t1 = t0.isZero() ? t0 : t0.redInvert();\n const x1 = t1.isZero() ? bza : ba.redMul(one.redAdd(t1));\n const x2 = z.redMul(u2).redMul(x1);\n const y1 = this.solveY2(x1);\n const y2 = this.solveY2(x2);\n const alpha = y1.redIsSquare() | 0;\n const x = [x1, x2][alpha ^ 1];\n const y = [y1, y2][alpha ^ 1].redSqrt();\n\n if (y.redIsOdd() !== u.redIsOdd())\n y.redINeg();\n\n return this.point(x, y);\n }\n\n _sswui(p, hint) {\n // Inverting the Map (Simplified Shallue-Woestijne-Ulas).\n //\n // Assumptions:\n //\n // - a^2 * x^2 - 2 * a * b * x - 3 * b^2 is square in F(p).\n // - If r < 3 then x != -b / a.\n //\n // Unlike SVDW, the preimages here are evenly\n // distributed (more or less). SSWU covers ~3/8\n // of the curve points. Each preimage has a 1/2\n // chance of mapping to either x1 or x2.\n //\n // Assuming the point is within that set, each\n // point has a 1/4 chance of inverting to any\n // of the preimages. This means we can simply\n // randomly select a preimage if one exists.\n //\n // However, the [SVDW2] sampling method seems\n // slighly faster in practice for [SQUARED].\n //\n // Map:\n //\n // c = sqrt(a^2 * x^2 - 2 * a * b * x - 3 * b^2)\n // u1 = -(a * x + b - c) / (2 * (a * x + b) * z)\n // u2 = -(a * x + b + c) / (2 * (a * x + b) * z)\n // u3 = -(a * x + b - c) / (2 * b * z)\n // u4 = -(a * x + b + c) / (2 * b * z)\n // r = random integer in [1,4]\n // u = sign(y) * abs(sqrt(ur))\n const {a, b, z} = this;\n const {x, y} = p;\n const r = hint & 3;\n const a2x2 = a.redSqr().redMul(x.redSqr());\n const abx2 = a.redMul(b).redMul(x).redIMuln(2);\n const b23 = b.redSqr().redMuln(3);\n const axb = a.redMul(x).redIAdd(b);\n const c = a2x2.redISub(abx2).redISub(b23).redSqrt();\n const n0 = axb.redSub(c).redINeg();\n const n1 = axb.redAdd(c).redINeg();\n const d0 = axb.redMul(z).redIMuln(2);\n const d1 = b.redMul(z).redIMuln(2);\n const n = [n0, n1][r & 1]; // r = 1 or 3\n const d = [d0, d1][r >>> 1]; // r = 2 or 3\n const u = n.redDivSqrt(d);\n\n if (u.redIsOdd() !== y.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n _svdwf(u) {\n // Shallue-van de Woestijne Method.\n //\n // Distribution: 9/16.\n //\n // [SVDW1] Section 5.\n // [SVDW2] Page 8, Section 3.\n // Page 15, Section 6, Algorithm 1.\n // [H2EC] \"Shallue-van de Woestijne Method\".\n //\n // Assumptions:\n //\n // - p = 1 (mod 3).\n // - a = 0, b != 0.\n // - Let z be a unique element in F(p).\n // - g((sqrt(-3 * z^2) - z) / 2) is square in F(p).\n // - u != 0, u != +-sqrt(-g(z)).\n //\n // Map:\n //\n // g(x) = x^3 + b\n // c = sqrt(-3 * z^2)\n // t1 = u^2 + g(z)\n // t2 = 1 / (u^2 * t1)\n // t3 = u^4 * t2 * c\n // x1 = (c - z) / 2 - t3\n // x2 = t3 - (c + z) / 2\n // x3 = z - t1^3 * t2 / (3 * z^2)\n // x = x1, if g(x1) is square\n // = x2, if g(x2) is square\n // = x3, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const {c, z, zi, i2, i3} = this;\n const gz = this.solveY2(z);\n const z3 = i3.redMul(zi.redSqr());\n const u2 = u.redSqr();\n const u4 = u2.redSqr();\n const t1 = u2.redAdd(gz);\n const u2t1 = u2.redMul(t1);\n const t2 = u2t1.isZero() ? u2t1 : u2t1.redInvert();\n const t3 = u4.redMul(t2).redMul(c);\n const t4 = t1.redSqr().redMul(t1);\n const x1 = c.redSub(z).redMul(i2).redISub(t3);\n const x2 = t3.redSub(c.redAdd(z).redMul(i2));\n const x3 = z.redSub(t4.redMul(t2).redMul(z3));\n const y1 = this.solveY2(x1);\n const y2 = this.solveY2(x2);\n const y3 = this.solveY2(x3);\n const alpha = y1.redJacobi() | 1;\n const beta = y2.redJacobi() | 1;\n const i = mod((alpha - 1) * beta, 3);\n const x = [x1, x2, x3][i];\n const y = [y1, y2, y3][i];\n\n return [x, y];\n }\n\n _svdw(u) {\n const [x, yy] = this._svdwf(u);\n const y = yy.redSqrt();\n\n if (y.redIsOdd() !== u.redIsOdd())\n y.redINeg();\n\n return this.point(x, y);\n }\n\n _svdwi(p, hint) {\n // Inverting the Map (Shallue-van de Woestijne).\n //\n // [SQUARED] Algorithm 1, Page 8, Section 3.3.\n // [SVDW2] Page 12, Section 5.\n // [SVDW3] \"Inverting the map\".\n //\n // Assumptions:\n //\n // - If r = 1 then x != -(c + z) / 2.\n // - If r = 2 then x != (c - z) / 2.\n // - If r > 2 then (t0 - t1 + t2) is square in F(p).\n // - f(f^-1(x)) = x where f is the map function.\n //\n // We use the sampling method from [SVDW2],\n // _not_ [SQUARED]. This seems to have a\n // better distribution in practice.\n //\n // Note that [SVDW3] also appears to be\n // incorrect in terms of distribution.\n //\n // The distribution of f(u), assuming u is\n // random, is (1/2, 1/4, 1/4).\n //\n // To mirror this, f^-1(x) should simply\n // pick (1/2, 1/4, 1/8, 1/8).\n //\n // To anyone running the forward map, our\n // strings will appear to be random.\n //\n // Map:\n //\n // g(x) = x^3 + b\n // c = sqrt(-3 * z^2)\n // t0 = 9 * (x^2 * z^2 + z^4)\n // t1 = 18 * x * z^3\n // t2 = 12 * g(z) * (x - z)\n // t3 = sqrt(t0 - t1 + t2)\n // t4 = t3 * z\n // u1 = g(z) * (c - 2 * x - z) / (c + 2 * x + z)\n // u2 = g(z) * (c + 2 * x + z) / (c - 2 * x - z)\n // u3 = (3 * (z^3 - x * z^2) - 2 * g(z) + t4) / 2\n // u4 = (3 * (z^3 - x * z^2) - 2 * g(z) - t4) / 2\n // r = random integer in [1,4]\n // u = sign(y) * abs(sqrt(ur))\n const {b, c, z, zero, two} = this;\n const {x, y} = p;\n const r = hint & 3;\n const z2 = z.redSqr();\n const z3 = z2.redMul(z);\n const z4 = z2.redSqr();\n const gz = z3.redAdd(b);\n const gz2 = gz.redMuln(2);\n const xx = x.redSqr();\n const x2z = x.redMuln(2).redIAdd(z);\n const xz2 = x.redMul(z2);\n const c0 = c.redSub(x2z);\n const c1 = c.redAdd(x2z);\n const t0 = xx.redMul(z2).redIAdd(z4).redIMuln(9);\n const t1 = x.redMul(z3).redIMuln(18);\n const t2 = gz.redMul(x.redSub(z)).redIMuln(12);\n const t3 = r >= 2 ? t0.redISub(t1).redIAdd(t2).redSqrt() : zero;\n const t4 = t3.redMul(z);\n const t5 = z3.redISub(xz2).redIMuln(3).redISub(gz2);\n const n0 = gz.redMul(c0);\n const n1 = gz.redMul(c1);\n const n2 = t5.redAdd(t4);\n const n3 = t5.redSub(t4);\n const d2 = two;\n const n = [n0, n1, n2, n3][r];\n const d = [c1, c0, d2, d2][r];\n const u = n.redDivSqrt(d);\n const [x0] = this._svdwf(u);\n\n if (!x0.eq(x))\n throw new Error('Invalid point.');\n\n if (u.redIsOdd() !== y.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n isElliptic() {\n const {a, b} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const d = b2.redMuln(27).redIAdd(a3.redMuln(4));\n\n // 4 * a^3 + 27 * b^2 != 0\n return !d.isZero();\n }\n\n jinv() {\n // [ARITH1] Page 71, Section 4.4.\n // http://mathworld.wolfram.com/j-Invariant.html\n const {a, b} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const t0 = a3.redMuln(4);\n const lhs = t0.redMuln(1728);\n const rhs = b2.redMuln(27).redIAdd(t0);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // (1728 * 4 * a^3) / (4 * a^3 + 27 * b^2)\n return lhs.redDiv(rhs).fromRed();\n }\n\n point(x, y) {\n return new ShortPoint(this, x, y);\n }\n\n jpoint(x, y, z) {\n return new JPoint(this, x, y, z);\n }\n\n solveX(y) {\n assert(y instanceof BN);\n\n if (!this.a.isZero())\n throw new Error('Not implemented.');\n\n // x^3 = y^2 - b\n const y2 = y.redSqr();\n const x3 = y2.redSub(this.b);\n\n return cubeRoots(x3);\n }\n\n solveY2(x) {\n // [GECC] Page 89, Section 3.2.2.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw.html\n assert(x instanceof BN);\n\n // y^2 = x^3 + a * x + b\n const x3 = x.redSqr().redMul(x);\n const y2 = x3.redIAdd(this.b);\n\n if (!this.zeroA) {\n // Save some cycles for a = -3.\n if (this.threeA)\n y2.redIAdd(x.redMuln(-3));\n else\n y2.redIAdd(this.a.redMul(x));\n }\n\n return y2;\n }\n\n validate(point) {\n assert(point instanceof ShortPoint);\n\n if (point.inf)\n return true;\n\n const {x, y} = point;\n const y2 = this.solveY2(x);\n\n return y.redSqr().eq(y2);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (this.h.cmpn(1) > 0) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n }\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n pointFromY(y, index = 0) {\n assert(y instanceof BN);\n assert((index >>> 0) === index);\n\n if (!y.red)\n y = y.toRed(this.red);\n\n const coords = this.solveX(y);\n\n if (index >= coords.length)\n throw new Error('Invalid X coordinate index.');\n\n const x = coords[index];\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve) {\n // [GECC] Page 84, Section 3.1.5.\n // [ARITH1] Page 286, Section 13.2.3.c.\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n let u2, u3;\n try {\n [u2, u3] = this._scale(curve);\n } catch (e) {\n return false;\n }\n\n // E(a,b) <-> E(au^4,bu^6)\n if (curve.type === 'short') {\n // a' = a * u^4, b' = b * u^6\n const a = this.field(curve.a).redMul(u2.redSqr());\n const b = this.field(curve.b).redMul(u3.redSqr());\n\n return this.a.eq(a) && this.b.eq(b);\n }\n\n // E(a,b) <-> M(A,B)\n if (curve.type === 'mont') {\n // (A / (3 * B))^3 + a * (A / (3 * B)) + b = 0\n const {a3, bi} = curve;\n const x = this.field(a3.redMul(bi)).redMul(u2);\n const y2 = this.solveY2(x);\n\n return y2.isZero();\n }\n\n // E(a,b) <-> E(a,d)\n if (curve.type === 'edwards') {\n // ((a' + d') / 6)^3 + a * ((a' + d') / 6) + b = 0\n const x = this.field(curve.ad6).redMul(u2);\n const y2 = this.solveY2(x);\n\n return y2.isZero();\n }\n\n return false;\n }\n\n isIsogenous(curve) {\n assert(curve instanceof Curve);\n return false;\n }\n\n pointFromShort(point) {\n // [GECC] Page 84, Section 3.1.5.\n // [ALT] Appendix F.3 (Isomorphic Mapping between Weierstrass Curves).\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for E(a,b)<->E(au^4,bu^6):\n //\n // x' = x * u^2\n // y' = y * u^3\n //\n // Where a * u^4 = a' and b * u^6 = b'.\n if (point.isInfinity())\n return this.point();\n\n const [u2, u3] = this._scale(point.curve);\n const x = this.field(point.x);\n const y = this.field(point.y);\n const nx = x.redMul(u2);\n const ny = y.redMul(u3);\n\n return this.point(nx, ny);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [ALT] Appendix E.2 (Switching between Alternative Representations).\n // [MONT2] \"Equivalence with Weierstrass curves\"\n assert(point instanceof MontPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for M(A,B)->E(a,b):\n //\n // x = (u + A / 3) / B\n // y = v / B\n //\n // Undefined if ((u^3 + A * u^2 + u) / B) is not square.\n if (point.isInfinity())\n return this.point();\n\n const {a3, bi} = point.curve;\n const [u2, u3] = this._scale(point.curve);\n const nx = point.x.redAdd(a3).redMul(bi);\n const ny = point.y.redMul(bi);\n\n return this.point(this.field(nx).redMul(u2),\n this.field(ny).redMul(u3));\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [TWISTEQ] Section 2.\n assert(point instanceof EdwardsPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,d)->E(a',b'):\n //\n // x' = ((5 * d - a) * y + d - 5 * a) / (12 * (y - 1))\n // y' = (d - a) * (y + 1) / (4 * x * (y - 1))\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> ((a + d) / 6, 0)\n //\n // Unexceptional Cases:\n // - (sqrt(1 / a), 0) -> ((5 * a - d) / 12, (a - d) / 4 * sqrt(a))\n const {a, d, ad6} = point.curve;\n const [u2, u3] = this._scale(point.curve);\n\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero()) {\n const x = this.field(ad6).redMul(u2);\n return this.point(x, this.zero);\n }\n\n const {x, y, z} = point;\n const a5 = a.redMuln(5);\n const d5 = d.redMuln(5);\n const dma = d.redSub(a);\n const d5a = d5.redSub(a);\n const da5 = d.redSub(a5);\n const ypz = y.redAdd(z);\n const ymz = y.redSub(z);\n const xx = d5a.redMul(y).redIAdd(da5.redMul(z));\n const xz = ymz.redMuln(12);\n const yy = dma.redMul(ypz).redMul(z);\n const yz = ymz.redMul(x).redIMuln(4);\n\n return this.cpoint(this.field(xx).redMul(u2),\n this.field(xz),\n this.field(yy).redMul(u3),\n this.field(yz));\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n assert(u instanceof BN);\n\n // z = 0 or b = 0\n if (this.z.isZero() || this.b.isZero())\n throw new Error('Not implemented.');\n\n // a != 0, b != 0\n if (!this.a.isZero())\n return this._sswu(u);\n\n // p = 1 mod 3, a = 0, b != 0\n if (!this.c.isZero())\n return this._svdw(u);\n\n throw new Error('Not implemented.');\n }\n\n pointToUniform(p, hint) {\n // Convert a short weierstrass point to a field\n // element by inverting either the SSWU or SVDW\n // map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof ShortPoint);\n assert((hint >>> 0) === hint);\n\n // z = 0 or b = 0\n if (this.z.isZero() || this.b.isZero())\n throw new Error('Not implemented.');\n\n // P = O\n if (p.isInfinity())\n throw new Error('Invalid point.');\n\n // Add a random torsion component.\n const i = ((hint >>> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n return wrapErrors(() => {\n // a != 0, b != 0\n if (!this.a.isZero())\n return this._sswui(q, hint);\n\n // p = 1 mod 3, a = 0, b != 0\n if (!this.c.isZero())\n return this._svdwi(q, hint);\n\n throw new Error('Not implemented.');\n });\n }\n\n mulAll(points, coeffs) {\n return super.mulAll(points, coeffs).toP();\n }\n\n affinizeAll(points) {\n const out = this.normalizeAll(points);\n\n for (let i = 0; i < out.length; i++)\n out[i] = out[i].toP();\n\n return out;\n }\n\n decodePoint(bytes) {\n return ShortPoint.decode(this, bytes);\n }\n\n encodeX(point) {\n assert(point instanceof Point);\n return point.encodeX();\n }\n\n decodeEven(bytes) {\n return ShortPoint.decodeEven(this, bytes);\n }\n\n decodeSquare(bytes) {\n return ShortPoint.decodeSquare(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromShort(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, odd, sign = null) {\n const [a, b] = this._mont(b0, odd);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = this._scale(curve);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromShort(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, odd, sign = null) {\n const [a, d] = this._edwards(a0, odd);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = this._scale(curve);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromShort(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromShort(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return ShortPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n\n json.a = this.a.fromRed().toJSON();\n json.b = this.b.fromRed().toJSON();\n\n if (!this.c.isZero())\n json.c = this.c.fromRed().toJSON();\n\n return json;\n }\n}\n\n/**\n * ShortPoint\n */\n\nclass ShortPoint extends Point {\n constructor(curve, x, y) {\n assert(curve instanceof ShortCurve);\n\n super(curve, types.AFFINE);\n\n this.x = this.curve.zero;\n this.y = this.curve.zero;\n this.inf = true;\n\n if (x != null)\n this._init(x, y);\n }\n\n _init(x, y) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n\n this.x = x;\n this.y = y;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n this.inf = false;\n }\n\n _getBeta() {\n if (!this.curve.endo)\n return null;\n\n if (this.pre && this.pre.beta)\n return this.pre.beta;\n\n // Augment the point with our beta value.\n // This is the counterpart to `k2` after\n // the endomorphism split of `k`.\n //\n // Note that if we have precomputation,\n // we have to clone and update all of the\n // precomputed points below.\n const xb = this.x.redMul(this.curve.endo.beta);\n const beta = this.curve.point(xb, this.y);\n\n if (this.pre) {\n beta.pre = this.pre.map((point) => {\n const xb = point.x.redMul(this.curve.endo.beta);\n return this.curve.point(xb, point.y);\n });\n\n this.pre.beta = beta;\n }\n\n return beta;\n }\n\n _getJNAF(point) {\n assert(point instanceof ShortPoint);\n\n if (this.inf || point.inf)\n return super._getJNAF(point);\n\n // Create comb for JSF.\n const comb = [\n this, // 1\n null, // 3\n null, // 5\n point // 7\n ];\n\n // Try to avoid Jacobian points, if possible.\n if (this.y.eq(point.y)) {\n comb[1] = this.add(point);\n comb[2] = this.toJ().sub(point);\n } else if (this.y.eq(point.y.redNeg())) {\n comb[1] = this.toJ().add(point);\n comb[2] = this.sub(point);\n } else {\n comb[1] = this.toJ().add(point);\n comb[2] = this.toJ().sub(point);\n }\n\n return comb;\n }\n\n clone() {\n if (this.inf)\n return this.curve.point();\n\n return this.curve.point(this.x, this.y);\n }\n\n scale(a) {\n return this.toJ().scale(a);\n }\n\n neg() {\n // P = O\n if (this.inf)\n return this;\n\n // -(X1, Y1) = (X1, -Y1)\n return this.curve.point(this.x, this.y.redNeg());\n }\n\n add(p) {\n // [GECC] Page 80, Section 3.1.2.\n //\n // Addition Law:\n //\n // l = (y1 - y2) / (x1 - x2)\n // x3 = l^2 - x1 - x2\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 1S + 6A\n assert(p instanceof ShortPoint);\n\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P, P + -P\n if (this.x.eq(p.x)) {\n // P + -P = O\n if (!this.y.eq(p.y))\n return this.curve.point();\n\n // P + P = 2P\n return this.dbl();\n }\n\n // X1 != X2, Y1 = Y2\n if (this.y.eq(p.y)) {\n // X3 = -X1 - X2\n const nx = this.x.redNeg().redISub(p.x);\n\n // Y3 = -Y1\n const ny = this.y.redNeg();\n\n // Skip the inverse.\n return this.curve.point(nx, ny);\n }\n\n // H = X1 - X2\n const h = this.x.redSub(p.x);\n\n // R = Y1 - Y2\n const r = this.y.redSub(p.y);\n\n // L = R / H\n const l = r.redDiv(h);\n\n // X3 = L^2 - X1 - X2\n const nx = l.redSqr().redISub(this.x).redISub(p.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dbl() {\n // [GECC] Page 80, Section 3.1.2.\n //\n // Addition Law (doubling):\n //\n // l = (3 * x1^2 + a) / (2 * y1)\n // x3 = l^2 - 2 * x1\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 2S + 3A + 2*2 + 1*3\n\n // P = O\n if (this.inf)\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.point();\n\n // XX = X1^2\n const xx = this.x.redSqr();\n\n // M = 3 * XX + a\n const m = xx.redIMuln(3).redIAdd(this.curve.a);\n\n // Z = 2 * Y1\n const z = this.y.redMuln(2);\n\n // L = M / Z\n const l = m.redDiv(z);\n\n // X3 = L^2 - 2 * X1\n const nx = l.redSqr().redISub(this.x).redISub(this.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dblp(pow) {\n return this.toJ().dblp(pow).toP();\n }\n\n getX() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof ShortPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.inf)\n return p.inf;\n\n // Q = O\n if (p.inf)\n return false;\n\n // X1 = X2, Y1 = Y2\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n cmp(point) {\n assert(point instanceof ShortPoint);\n\n if (this.inf && !point.inf)\n return -1;\n\n if (!this.inf && point.inf)\n return 1;\n\n if (this.inf && point.inf)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Infinity cannot be represented in\n // the affine space, except by a flag.\n return this.inf;\n }\n\n isOrder2() {\n if (this.inf)\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.inf)\n return false;\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.inf)\n return false;\n\n return this.y.redIsEven();\n }\n\n isSquare() {\n if (this.inf)\n return false;\n\n return this.y.redJacobi() !== -1;\n }\n\n eqX(x) {\n assert(x instanceof BN);\n assert(!x.red);\n\n if (this.inf)\n return false;\n\n return this.getX().eq(x);\n }\n\n eqR(x) {\n assert(x instanceof BN);\n assert(!x.red);\n assert(!this.curve.n.isZero());\n\n if (this.inf)\n return false;\n\n return this.getX().imod(this.curve.n).eq(x);\n }\n\n mul(k) {\n return super.mul(k).toP();\n }\n\n muln(k) {\n return super.muln(k).toP();\n }\n\n mulBlind(k, rng) {\n return super.mulBlind(k, rng).toP();\n }\n\n mulAdd(k1, p2, k2) {\n return super.mulAdd(k1, p2, k2).toP();\n }\n\n mulH() {\n return super.mulH().toP();\n }\n\n div(k) {\n return super.div(k).toP();\n }\n\n divn(k) {\n return super.divn(k).toP();\n }\n\n divH() {\n return super.divH().toP();\n }\n\n toP() {\n return this;\n }\n\n toJ() {\n // (X3, Y3, Z3) = (1, 1, 0)\n if (this.inf)\n return this.curve.jpoint();\n\n // (X3, Y3, Z3) = (X1, Y1, 1)\n return this.curve.jpoint(this.x, this.y, this.curve.one);\n }\n\n encode(compact) {\n // [SEC1] Page 10, Section 2.3.3.\n if (compact == null)\n compact = true;\n\n assert(typeof compact === 'boolean');\n\n const {fieldSize} = this.curve;\n\n // We do not serialize points at infinity.\n if (this.inf)\n throw new Error('Invalid point.');\n\n // Compressed form (0x02 = even, 0x03 = odd).\n if (compact) {\n const p = Buffer.alloc(1 + fieldSize);\n const x = this.curve.encodeField(this.getX());\n\n p[0] = 0x02 | this.y.redIsOdd();\n x.copy(p, 1);\n\n return p;\n }\n\n // Uncompressed form (0x04).\n const p = Buffer.alloc(1 + fieldSize * 2);\n const x = this.curve.encodeField(this.getX());\n const y = this.curve.encodeField(this.getY());\n\n p[0] = 0x04;\n x.copy(p, 1);\n y.copy(p, 1 + fieldSize);\n\n return p;\n }\n\n static decode(curve, bytes) {\n // [SEC1] Page 11, Section 2.3.4.\n assert(curve instanceof ShortCurve);\n assert(Buffer.isBuffer(bytes));\n\n const len = curve.fieldSize;\n\n if (bytes.length < 1 + len)\n throw new Error('Not a point.');\n\n // Point forms:\n //\n // 0x00 -> Infinity (openssl, unsupported)\n // 0x02 -> Compressed Even\n // 0x03 -> Compressed Odd\n // 0x04 -> Uncompressed\n // 0x06 -> Hybrid Even (openssl)\n // 0x07 -> Hybrid Odd (openssl)\n //\n // Note that openssl supports serializing points\n // at infinity as {0}. We choose not to support it\n // because it's strange and not terribly useful.\n const form = bytes[0];\n\n switch (form) {\n case 0x02:\n case 0x03: {\n if (bytes.length !== 1 + len)\n throw new Error('Invalid point size for compressed.');\n\n const x = curve.decodeField(bytes.slice(1, 1 + len));\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n const p = curve.pointFromX(x, form === 0x03);\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n case 0x04:\n case 0x06:\n case 0x07: {\n if (bytes.length !== 1 + len * 2)\n throw new Error('Invalid point size for uncompressed.');\n\n const x = curve.decodeField(bytes.slice(1, 1 + len));\n const y = curve.decodeField(bytes.slice(1 + len, 1 + 2 * len));\n\n // [GECC] Algorithm 4.3, Page 180, Section 4.\n if (x.cmp(curve.p) >= 0 || y.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n // OpenSSL hybrid encoding.\n if (form !== 0x04 && form !== (0x06 | y.isOdd()))\n throw new Error('Invalid hybrid encoding.');\n\n const p = curve.point(x, y);\n\n if (!p.validate())\n throw new Error('Invalid point.');\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n default: {\n throw new Error('Unknown point format.');\n }\n }\n }\n\n encodeX() {\n // [SCHNORR] \"Specification\".\n // [BIP340] \"Specification\".\n return this.curve.encodeField(this.getX());\n }\n\n static decodeEven(curve, bytes) {\n // [BIP340] \"Specification\".\n assert(curve instanceof ShortCurve);\n\n const x = curve.decodeField(bytes);\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromX(x, false);\n }\n\n static decodeSquare(curve, bytes) {\n // [SCHNORR] \"Specification\".\n assert(curve instanceof ShortCurve);\n\n const x = curve.decodeField(bytes);\n\n if (x.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromX(x);\n }\n\n toJSON(pre) {\n if (this.inf)\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n if (pre === true && this.pre)\n return [x, y, this.pre.toJSON()];\n\n return [x, y];\n }\n\n toPretty() {\n if (this.inf)\n return [];\n\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof ShortCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n const point = curve.point(x, y);\n\n if (json.length > 2 && json[2] != null)\n point.pre = Precomp.fromJSON(point, json[2]);\n\n return point;\n }\n\n [custom]() {\n if (this.inf)\n return '';\n\n return '';\n }\n}\n\n/**\n * JPoint\n */\n\nclass JPoint extends Point {\n constructor(curve, x, y, z) {\n assert(curve instanceof ShortCurve);\n\n super(curve, types.JACOBIAN);\n\n this.x = this.curve.one;\n this.y = this.curve.one;\n this.z = this.curve.zero;\n this.zOne = false;\n\n if (x != null)\n this._init(x, y, z);\n }\n\n _init(x, y, z) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n assert(z == null || (z instanceof BN));\n\n this.x = x;\n this.y = y;\n this.z = z || this.curve.one;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n this.zOne = this.z.eq(this.curve.one);\n }\n\n clone() {\n return this.curve.jpoint(this.x, this.y, this.z);\n }\n\n validate() {\n // [GECC] Example 3.20, Page 88, Section 3.\n const {a, b} = this.curve;\n\n // P = O\n if (this.isInfinity())\n return true;\n\n // Z1 = 1\n if (this.zOne)\n return this.curve.validate(this.toP());\n\n // y^2 = x^3 + a * x * z^4 + b * z^6\n const lhs = this.y.redSqr();\n const x3 = this.x.redSqr().redMul(this.x);\n const z2 = this.z.redSqr();\n const z4 = z2.redSqr();\n const z6 = z4.redMul(z2);\n const rhs = x3.redIAdd(b.redMul(z6));\n\n if (!this.curve.zeroA) {\n // Save some cycles for a = -3.\n if (this.curve.threeA)\n rhs.redIAdd(z4.redIMuln(-3).redMul(this.x));\n else\n rhs.redIAdd(a.redMul(z4).redMul(this.x));\n }\n\n return lhs.eq(rhs);\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#scaling-z\n // 1I + 3M + 1S\n\n // Z = 1\n if (this.zOne)\n return this;\n\n // P = O\n if (this.isInfinity())\n return this;\n\n // A = 1 / Z1\n const a = this.z.redInvert();\n\n // AA = A^2\n const aa = a.redSqr();\n\n // X3 = X1 * AA\n this.x = this.x.redMul(aa);\n\n // Y3 = Y1 * AA * A\n this.y = this.y.redMul(aa).redMul(a);\n\n // Z3 = 1\n this.z = this.curve.one;\n this.zOne = true;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // P = O\n if (this.isInfinity())\n return this.curve.jpoint();\n\n // AA = A^2\n const aa = a.redSqr();\n\n // X3 = X1 * AA\n const nx = this.x.redMul(aa);\n\n // Y3 = Y1 * AA * A\n const ny = this.y.redMul(aa).redMul(a);\n\n // Z3 = Z1 * A\n const nz = this.z.redMul(a);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n neg() {\n // -(X1, Y1, Z1) = (X1, -Y1, Z1)\n return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n }\n\n add(p) {\n assert(p instanceof Point);\n\n if (p.type === types.AFFINE)\n return this._mixedAdd(p);\n\n return this._add(p);\n }\n\n _add(p) {\n assert(p instanceof JPoint);\n\n // O + P = P\n if (this.isInfinity())\n return p;\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.zOne)\n return p._addJA(this);\n\n // Z2 = 1\n if (p.zOne)\n return this._addJA(p);\n\n return this._addJJ(p);\n }\n\n _mixedAdd(p) {\n assert(p instanceof ShortPoint);\n\n // O + P = P\n if (this.isInfinity())\n return p.toJ();\n\n // P + O = P\n if (p.isInfinity())\n return this;\n\n return this._addJA(p);\n }\n\n _addJJ(p) {\n // No assumptions.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-1998-cmo-2\n // 12M + 4S + 6A + 1*2 (implemented as: 12M + 4S + 7A)\n\n // Z1Z1 = Z1^2\n const z1z1 = this.z.redSqr();\n\n // Z2Z2 = Z2^2\n const z2z2 = p.z.redSqr();\n\n // U1 = X1 * Z2Z2\n const u1 = this.x.redMul(z2z2);\n\n // U2 = X2 * Z1Z1\n const u2 = p.x.redMul(z1z1);\n\n // S1 = Y1 * Z2 * Z2Z2\n const s1 = this.y.redMul(p.z).redMul(z2z2);\n\n // S2 = Y2 * Z1 * Z1Z1\n const s2 = p.y.redMul(this.z).redMul(z1z1);\n\n // H = U2 - U1\n const h = u2.redISub(u1);\n\n // r = S2 - S1\n const r = s2.redISub(s1);\n\n // H = 0\n if (h.isZero()) {\n if (!r.isZero())\n return this.curve.jpoint();\n\n return this.dbl();\n }\n\n // HH = H^2\n const hh = h.redSqr();\n\n // HHH = H * HH\n const hhh = h.redMul(hh);\n\n // V = U1 * HH\n const v = u1.redMul(hh);\n\n // X3 = r^2 - HHH - 2 * V\n const nx = r.redSqr().redISub(hhh).redISub(v).redISub(v);\n\n // Y3 = r * (V - X3) - S1 * HHH\n const ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh));\n\n // Z3 = Z1 * Z2 * H\n const nz = this.z.redMul(p.z).redMul(h);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _addJA(p) {\n // Assumes Z2 = 1.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-madd\n // 8M + 3S + 6A + 5*2 (implemented as: 8M + 3S + 7A + 4*2)\n\n // Z1Z1 = Z1^2\n const z1z1 = this.z.redSqr();\n\n // U2 = X2 * Z1Z1\n const u2 = p.x.redMul(z1z1);\n\n // S2 = Y2 * Z1 * Z1Z1\n const s2 = p.y.redMul(this.z).redMul(z1z1);\n\n // H = U2 - X1\n const h = u2.redISub(this.x);\n\n // r = 2 * (S2 - Y1)\n const r = s2.redISub(this.y).redIMuln(2);\n\n // H = 0\n if (h.isZero()) {\n if (!r.isZero())\n return this.curve.jpoint();\n\n return this.dbl();\n }\n\n // I = (2 * H)^2\n const i = h.redMuln(2).redSqr();\n\n // J = H * I\n const j = h.redMul(i);\n\n // V = X1 * I\n const v = this.x.redMul(i);\n\n // X3 = r^2 - J - 2 * V\n const nx = r.redSqr().redISub(j).redISub(v).redISub(v);\n\n // Y3 = r * (V - X3) - 2 * Y1 * J\n const ny = r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2));\n\n // Z3 = 2 * Z1 * H\n const nz = this.z.redMul(h).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n dbl() {\n // P = O\n if (this.isInfinity())\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.jpoint();\n\n // a = 0\n if (this.curve.zeroA)\n return this._dbl0();\n\n // a = -3\n if (this.curve.threeA)\n return this._dbl3();\n\n return this._dblJ();\n }\n\n _dblJ() {\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-1998-cmo-2\n // 3M + 6S + 4A + 1*a + 2*2 + 1*3 + 1*4 + 1*8\n // (implemented as: 3M + 6S + 5A + 1*a + 1*2 + 1*3 + 1*4 + 1*8)\n\n // XX = X1^2\n const xx = this.x.redSqr();\n\n // YY = Y1^2\n const yy = this.y.redSqr();\n\n // ZZ = Z1^2\n const zz = this.z.redSqr();\n\n // S = 4 * X1 * YY\n const s = this.x.redMul(yy).redIMuln(4);\n\n // M = 3 * XX + a * ZZ^2\n const m = xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr()));\n\n // T = M^2 - 2 * S\n const t = m.redSqr().redISub(s).redISub(s);\n\n // X3 = T\n const nx = t;\n\n // Y3 = M * (S - T) - 8 * YY^2\n const ny = m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8));\n\n // Z3 = 2 * Y1 * Z1\n const nz = this.y.redMul(this.z).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _dbl0() {\n // Assumes a = 0.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l\n // 2M + 5S + 6A + 3*2 + 1*3 + 1*8\n // (implemented as: 2M + 5S + 7A + 2*2 + 1*3 + 1*8)\n\n // A = X1^2\n const a = this.x.redSqr();\n\n // B = Y1^2\n const b = this.y.redSqr();\n\n // C = B^2\n const c = b.redSqr();\n\n // + XB2 = (X1 + B)^2\n const xb2 = b.redIAdd(this.x).redSqr();\n\n // D = 2 * ((X1 + B)^2 - A - C)\n const d = xb2.redISub(a).redISub(c).redIMuln(2);\n\n // E = 3 * A\n const e = a.redIMuln(3);\n\n // F = E^2\n const f = e.redSqr();\n\n // X3 = F - 2 * D\n const nx = f.redISub(d).redISub(d);\n\n // Y3 = E * (D - X3) - 8 * C\n const ny = e.redMul(d.redISub(nx)).redISub(c.redIMuln(8));\n\n // Z3 = 2 * Y1 * Z1\n const nz = this.y.redMul(this.z).redIMuln(2);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n _dbl3() {\n // Assumes a = -3.\n // https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n // 3M + 5S + 8A + 1*3 + 1*4 + 2*8\n // (implemented as: 3M + 5S + 8A + 1*2 + 1*3 + 1*4 + 1*8)\n\n // delta = Z1^2\n const delta = this.z.redSqr();\n\n // gamma = Y1^2\n const gamma = this.y.redSqr();\n\n // beta = X1 * gamma\n const beta = this.x.redMul(gamma);\n\n // + xmdelta = X1 - delta\n const xmdelta = this.x.redSub(delta);\n\n // + xpdelta = X1 + delta\n const xpdelta = this.x.redAdd(delta);\n\n // alpha = 3 * (X1 - delta) * (X1 + delta)\n const alpha = xmdelta.redMul(xpdelta).redIMuln(3);\n\n // + beta4 = 4 * beta\n const beta4 = beta.redIMuln(4);\n\n // + beta8 = 2 * beta4\n const beta8 = beta4.redMuln(2);\n\n // + gamma28 = 8 * gamma^2\n const gamma28 = gamma.redSqr().redIMuln(8);\n\n // X3 = alpha^2 - 8 * beta\n const nx = alpha.redSqr().redISub(beta8);\n\n // Z3 = (Y1 + Z1)^2 - gamma - delta\n const nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n\n // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n const ny = alpha.redMul(beta4.redISub(nx)).redISub(gamma28);\n\n return this.curve.jpoint(nx, ny, nz);\n }\n\n getX() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof JPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.isInfinity())\n return p.isInfinity();\n\n // Q = O\n if (p.isInfinity())\n return false;\n\n // Z1 = Z2\n if (this.z.eq(p.z)) {\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n // X1 * Z2^2 = X2 * Z1^2\n const zz1 = this.z.redSqr();\n const zz2 = p.z.redSqr();\n const x1 = this.x.redMul(zz2);\n const x2 = p.x.redMul(zz1);\n\n if (!x1.eq(x2))\n return false;\n\n // Y1 * Z2^3 = Y2 * Z1^3\n const zzz1 = zz1.redMul(this.z);\n const zzz2 = zz2.redMul(p.z);\n const y1 = this.y.redMul(zzz2);\n const y2 = p.y.redMul(zzz1);\n\n return y1.eq(y2);\n }\n\n cmp(point) {\n assert(point instanceof JPoint);\n\n const inf1 = this.isInfinity();\n const inf2 = point.isInfinity();\n\n if (inf1 && !inf2)\n return -1;\n\n if (!inf1 && inf2)\n return 1;\n\n if (inf1 && inf2)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Z1 = 0\n return this.z.isZero();\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.isInfinity())\n return false;\n\n this.normalize();\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.isInfinity())\n return false;\n\n this.normalize();\n\n return this.y.redIsEven();\n }\n\n isSquare() {\n if (this.isInfinity())\n return false;\n\n return this.y.redMul(this.z).redJacobi() !== -1;\n }\n\n eqX(x) {\n // Verify that integer `x` is equal to field\n // element `x` by scaling it by our z coordinate.\n // This optimization is mentioned in and used for\n // bip-schnorr[1]. This avoids having to affinize\n // the resulting point during verification.\n //\n // [1] [SCHNORR] \"Optimizations\".\n assert(x instanceof BN);\n assert(!x.red);\n\n if (this.isInfinity())\n return false;\n\n const zz = this.z.redSqr();\n const rx = x.toRed(this.curve.red).redMul(zz);\n\n return this.x.eq(rx);\n }\n\n eqR(x) {\n // Similar to the optimization above, this\n // optimization, suggested by Maxwell[1],\n // compares an integer to an X coordinate\n // by scaling it.\n //\n // Since a signature's R value is modulo N\n // in ECDSA, we may be dealing with an R\n // value greater than N in actuality.\n //\n // If the equality check fails, we can\n // scale N itself by Z and add it to the\n // X field element.\n //\n // [1] https://github.com/bitcoin-core/secp256k1/commit/ce7eb6f\n assert(x instanceof BN);\n assert(!x.red);\n\n if (!this.curve.smallGap)\n return this.toP().eqR(x);\n\n if (this.isInfinity())\n return false;\n\n if (x.cmp(this.curve.p) >= 0)\n return false;\n\n const zz = this.z.redSqr();\n const rx = x.toRed(this.curve.red).redMul(zz);\n\n if (this.x.eq(rx))\n return true;\n\n if (this.curve.highOrder)\n return false;\n\n if (x.cmp(this.curve.pmodn) >= 0)\n return false;\n\n const rn = this.curve.redN.redMul(zz);\n\n rx.redIAdd(rn);\n\n return this.x.eq(rx);\n }\n\n toP() {\n // P = O\n if (this.isInfinity())\n return this.curve.point();\n\n this.normalize();\n\n // (X3, Y3) = (X1 / Z1^2, Y1 / Z1^3)\n return this.curve.point(this.x, this.y);\n }\n\n toJ() {\n return this;\n }\n\n encode(compact) {\n return this.toP().encode(compact);\n }\n\n static decode(curve, bytes) {\n return ShortPoint.decode(curve, bytes).toJ();\n }\n\n encodeX() {\n return this.toP().encodeX();\n }\n\n static decodeEven(curve, bytes) {\n return ShortPoint.decodeEven(curve, bytes).toJ();\n }\n\n static decodeSquare(curve, bytes) {\n return ShortPoint.decodeSquare(curve, bytes).toJ();\n }\n\n toJSON(pre) {\n return this.toP().toJSON(pre);\n }\n\n toPretty() {\n return this.toP().toPretty();\n }\n\n static fromJSON(curve, json) {\n return ShortPoint.fromJSON(curve, json).toJ();\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * MontCurve\n */\n\nclass MontCurve extends Curve {\n constructor(conf) {\n super(MontPoint, 'mont', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.b = BN.fromJSON(conf.b).toRed(this.red);\n\n this.bi = this.b.redInvert();\n this.a2 = this.a.redAdd(this.two);\n this.a24 = this.a2.redMul(this.i4);\n this.a3 = this.a.redMul(this.i3);\n this.a0 = this.a.redMul(this.bi);\n this.b0 = this.bi.redSqr();\n\n this._finalize(conf);\n }\n\n static _isomorphism(curveA, curveB, customB) {\n // Montgomery Isomorphism.\n //\n // [MONT3] Page 3, Section 2.1.\n //\n // Transformation:\n //\n // A' = A\n // B' = B'\n //\n // Where (B / B') is square.\n assert(curveA instanceof BN);\n assert(curveB instanceof BN);\n assert(customB instanceof BN);\n\n const a = curveA.clone();\n const b = customB.clone();\n const c = curveB.redDiv(customB);\n\n if (c.redJacobi() !== 1)\n throw new Error('Invalid `b` coefficient.');\n\n return [a, b];\n }\n\n _short(a0, odd) {\n // Montgomery->Short Weierstrass Equivalence.\n //\n // [MONT2] \"Equivalence with Weierstrass curves\".\n //\n // Transformation:\n //\n // a = (3 - A^2) / (3 * B^2)\n // b = (2 * A^3 - 9 * A) / (27 * B^3)\n const {a, b, three} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const b2 = b.redSqr();\n const b3 = b2.redMul(b);\n const n0 = three.redSub(a2);\n const d0 = b2.redMuln(3);\n const n1 = a3.redMuln(2).redISub(a.redMuln(9));\n const d1 = b3.redMuln(27);\n const wa = n0.redDiv(d0);\n const wb = n1.redDiv(d1);\n\n if (a0 != null)\n return ShortCurve._isomorphism(wa, wb, a0, odd);\n\n return [wa, wb];\n }\n\n _mont(b0) {\n return MontCurve._isomorphism(this.a, this.b, b0);\n }\n\n _edwards(a0, invert = false) {\n // Montgomery->Twisted Edwards Transformation.\n //\n // [MONT1] Page 11, Section 4.3.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n //\n // Equivalence:\n //\n // a = (A + 2) / B\n // d = (A - 2) / B\n //\n // Isomorphism:\n //\n // a = a'\n // d = a' * (A - 2) / (A + 2)\n //\n // Where ((A + 2) / (B * a')) is square.\n //\n // If `d` is square, we can usually find\n // a complete curve by using the `invert`\n // option. This will create an isomorphism\n // chain of: M(A,B)->E(a,d)->E(d,a).\n //\n // The equivalence between E(a,d) and\n // E(d,a) is:\n //\n // (x, y) = (x, 1 / y)\n //\n // Meaning our map to E(d,a) is:\n //\n // x = u / v\n // y = 1 / ((u - 1) / (u + 1))\n // = (u + 1) / (u - 1)\n assert(typeof invert === 'boolean');\n\n const {two, bi} = this;\n const a = this.a.redAdd(two).redMul(bi);\n const d = this.a.redSub(two).redMul(bi);\n\n if (invert)\n a.swap(d);\n\n if (a0 != null)\n return EdwardsCurve._isomorphism(a, d, a0);\n\n return [a, d];\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n const [u2, u3] = curve._scale(this);\n\n return [this.field(u2.redInvert()),\n this.field(u3.redInvert())];\n }\n\n _scaleMont(curve) {\n // We can extract the isomorphism factor with:\n //\n // c = +-sqrt(B / B')\n //\n // If base points are available, we can do:\n //\n // c = v' / v\n assert(curve instanceof MontCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this.field(curve.b).redDivSqrt(this.b);\n\n return this.g.y.redDiv(this.field(curve.g.y));\n }\n\n _scaleEdwards(curve, invert) {\n // We _could_ do something like:\n //\n // B = 4 / (a - d)\n // c = +-sqrt(B / B')\n //\n // Which can be reduced to:\n //\n // c = +-sqrt(4 / ((a - d) * B'))\n //\n // If base points are available:\n //\n // v = u' / x\n // c = v' / v\n //\n // Which can be reduced to:\n //\n // c = v' * x / u'\n //\n // However, the way our maps are\n // written, we can re-use the Edwards\n // isomorphism factor when going the\n // other direction.\n assert(curve instanceof EdwardsCurve);\n\n const c = curve._scale(this, invert);\n\n return this.field(c);\n }\n\n _solveY0(x) {\n assert(x instanceof BN);\n\n // y^2 = x^3 + A * x^2 + B * x\n const a = this.a0;\n const b = this.b0;\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const y2 = x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x));\n\n return y2;\n }\n\n _elligator2(u) {\n // Elligator 2.\n //\n // Distribution: 1/2.\n //\n // [ELL2] Page 11, Section 5.2.\n // [H2EC] \"Elligator 2 Method\".\n // \"Mappings for Montgomery curves\".\n // [SAFE] \"Indistinguishability from uniform random strings\".\n //\n // Assumptions:\n //\n // - y^2 = x^3 + A * x^2 + B * x.\n // - A != 0, B != 0.\n // - A^2 - 4 * B is non-zero and non-square in F(p).\n // - Let z be a non-square in F(p).\n // - u != +-sqrt(-1 / z).\n //\n // Note that Elligator 2 is defined over the form:\n //\n // y'^2 = x'^3 + A' * x'^2 + B' * x'\n //\n // Instead of:\n //\n // B * y^2 = x^3 + A * x^2 + x\n //\n // Where:\n //\n // A' = A / B\n // B' = 1 / B^2\n // x' = x / B\n // y' = y / B\n //\n // And:\n //\n // x = B * x'\n // y = B * y'\n //\n // This is presumably the result of Elligator 2\n // being designed in long Weierstrass form. If\n // we want to support B != 1, we need to do the\n // conversion.\n //\n // Map:\n //\n // g(x) = x^3 + A * x^2 + B * x\n // x1 = -A / (1 + z * u^2)\n // x1 = -A, if x1 = 0\n // x2 = -x1 - A\n // x = x1, if g(x1) is square\n // = x2, otherwise\n // y = sign(u) * abs(sqrt(g(x)))\n const lhs = this.a0.redNeg();\n const rhs = this.one.redAdd(this.z.redMul(u.redSqr()));\n\n if (rhs.isZero())\n rhs.inject(this.one);\n\n const x1 = lhs.redMul(rhs.redInvert());\n const x2 = x1.redNeg().redISub(this.a0);\n const y1 = this._solveY0(x1);\n const y2 = this._solveY0(x2);\n const alpha = y1.redIsSquare() | 0;\n const x0 = [x1, x2][alpha ^ 1];\n const y0 = [y1, y2][alpha ^ 1].redSqrt();\n\n if (y0.redIsOdd() !== u.redIsOdd())\n y0.redINeg();\n\n const x = this.b.redMul(x0);\n const y = this.b.redMul(y0);\n\n return this.point(x, y);\n }\n\n _invert2(p, hint) {\n // Inverting the Map (Elligator 2).\n //\n // [ELL2] Page 12, Section 5.3.\n //\n // Assumptions:\n //\n // - -z * x * (x + A) is square in F(p).\n // - If r = 1 then x != 0.\n // - If r = 2 then x != -A.\n //\n // Map:\n //\n // u1 = -(x + A) / (x * z)\n // u2 = -x / ((x + A) * z)\n // r = random integer in [1,2]\n // u = sign(y) * abs(sqrt(ur))\n //\n // Note that `0 / 0` can only occur if A = 0\n // (this violates the assumptions of Elligator 2).\n const {x, y} = p;\n const r = hint & 1;\n const x0 = x.redMul(this.bi);\n const y0 = y.redMul(this.bi);\n const n = x0.redAdd(this.a0);\n const d = x0;\n const lhs = [n, d][r].redINeg();\n const rhs = [d, n][r].redMul(this.z);\n const u = lhs.redDivSqrt(rhs);\n\n if (u.redIsOdd() !== y0.redIsOdd())\n u.redINeg();\n\n return u;\n }\n\n isElliptic() {\n const a2 = this.a.redSqr();\n const d = this.b.redMul(a2.redSub(this.four));\n\n // B * (A^2 - 4) != 0\n return !d.isZero();\n }\n\n jinv() {\n // [MONT3] Page 3, Section 2.\n const {a, three, four} = this;\n const a2 = a.redSqr();\n const t0 = a2.redSub(three);\n const lhs = t0.redPown(3).redIMuln(256);\n const rhs = a2.redSub(four);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // (256 * (A^2 - 3)^3) / (A^2 - 4)\n return lhs.redDiv(rhs).fromRed();\n }\n\n point(x, y) {\n return new MontPoint(this, x, y);\n }\n\n jpoint(x, y, z) {\n assert(x == null && y == null && z == null);\n return this.point();\n }\n\n xpoint(x, z) {\n return new XPoint(this, x, z);\n }\n\n solveY2(x) {\n // [MONT3] Page 3, Section 2.\n // https://hyperelliptic.org/EFD/g1p/auto-montgom.html\n assert(x instanceof BN);\n\n // B * y^2 = x^3 + A * x^2 + x\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const by2 = x3.redIAdd(this.a.redMul(x2)).redIAdd(x);\n const y2 = by2.redMul(this.bi);\n\n return y2;\n }\n\n validate(point) {\n assert(point instanceof MontPoint);\n\n if (point.isInfinity())\n return true;\n\n const {x, y} = point;\n const y2 = this.solveY2(x);\n\n return y.redSqr().eq(y2);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve, invert) {\n // [MONT3] Page 3, Section 2.1.\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n // M(A,B) <-> M(A,B')\n if (curve.type === 'mont') {\n const a = this.field(curve.a);\n const b = this.field(curve.b);\n\n // A' = A\n if (!this.a.eq(a))\n return false;\n\n // B' != 0\n if (this.b.isZero())\n return false;\n\n // jacobi(B / B') = 1\n const c = b.redDiv(this.b);\n\n return c.redJacobi() === 1;\n }\n\n return curve.isIsomorphic(this, invert);\n }\n\n isIsogenous(curve) {\n assert(curve instanceof Curve);\n\n if (curve.type === 'mont')\n return false;\n\n return curve.isIsogenous(this);\n }\n\n pointFromShort(point) {\n // [ALT] Appendix E.2 (Switching between Alternative Representations).\n // [MONT2] \"Equivalence with Weierstrass curves\"\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,b)->M(A,B):\n //\n // u = B * x - A / 3\n // v = B * y\n //\n // Undefined if ((u^3 + A * u^2 + u) / B) is not square.\n if (point.isInfinity())\n return this.point();\n\n const {a3, b} = this;\n const [u2, u3] = this._scale(point.curve);\n const x = this.field(point.x).redMul(u2);\n const y = this.field(point.y).redMul(u3);\n const u = b.redMul(x).redISub(a3);\n const v = b.redMul(y);\n\n return this.point(u, v);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [MONT3] Page 3, Section 2.1.\n assert(point instanceof MontPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for M(A,B)<->M(A,B'):\n //\n // u' = u\n // v' = +-sqrt(B / B') * v\n //\n // Undefined if (B / B') is not square.\n if (point.isInfinity())\n return this.point();\n\n const c = this._scale(point.curve);\n const u = this.field(point.x);\n const v = this.field(point.y);\n const nu = u;\n const nv = c.redMul(v);\n\n return this.point(nu, nv);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [RFC7748] Section 4.1 & 4.2.\n // [MONT3] Page 6, Section 2.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n assert(point instanceof EdwardsPoint);\n assert(point.curve.p.eq(this.p));\n\n // Edwards `x`, `y`, `z`.\n const x = this.field(point.x);\n const y = this.field(point.y);\n const z = this.field(point.z);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for E(1,d)->M(2-4d,1):\n //\n // u = y^2 / x^2\n // v = (2 - x^2 - y^2) * y / x^3\n //\n // Undefined for x = 0.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-1, 0) -> (0, 0)\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = z.redSqr().redIMuln(2);\n const uu = y.redSqr();\n const uz = x.redSqr();\n const vv = c.redISub(uz).redISub(uu).redMul(y);\n const vz = uz.redMul(x);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n if (this.isIsomorphic(point.curve, true)) {\n // Isomorphic maps for E(d,a)->M(A,B):\n //\n // u = (y + 1) / (y - 1)\n // v = +-sqrt((A - 2) / (B * a)) * u / x\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-sqrt(1 / a), 0) -> (-1, +-sqrt((A - 2) / B))\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = this._scale(point.curve, true);\n const uu = y.redAdd(z);\n const uz = y.redSub(z);\n const vv = c.redMul(z).redMul(uu);\n const vz = x.redMul(uz);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n if (this.isIsomorphic(point.curve, false)) {\n // Isomorphic maps for E(a,d)->M(A,B):\n //\n // u = (1 + y) / (1 - y)\n // v = +-sqrt((A + 2) / (B * a)) * u / x\n //\n // Undefined for x = 0 or y = 1.\n //\n // Exceptional Cases:\n // - (0, 1) -> O\n // - (0, -1) -> (0, 0)\n //\n // Unexceptional Cases:\n // - (+-sqrt(1 / a), 0) -> (1, +-sqrt((A + 2) / B))\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.zero);\n\n const c = this._scale(point.curve, false);\n const uu = z.redAdd(y);\n const uz = z.redSub(y);\n const vv = c.redMul(z).redMul(uu);\n const vz = x.redMul(uz);\n\n return this.cpoint(uu, uz, vv, vz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u) {\n assert(u instanceof BN);\n\n // z = 0 or A = 0\n if (this.z.isZero() || this.a.isZero())\n throw new Error('Not implemented.');\n\n return this._elligator2(u);\n }\n\n pointToUniform(p, hint) {\n // Convert a montgomery point to a field\n // element by inverting the elligator2 map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof MontPoint);\n assert((hint >>> 0) === hint);\n\n // z = 0 or A = 0\n if (this.z.isZero() || this.a.isZero())\n throw new Error('Not implemented.');\n\n // P = O\n if (p.isInfinity())\n throw new Error('Invalid point.');\n\n // Add a random torsion component.\n const i = ((hint >>> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n return wrapErrors(() => {\n return this._invert2(q, hint);\n });\n }\n\n decodePoint(bytes, sign) {\n return MontPoint.decode(this, bytes, sign);\n }\n\n encodeX(point) {\n assert(point instanceof XPoint);\n return point.encode();\n }\n\n decodeX(bytes) {\n return XPoint.decode(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromMont(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, sign = null) {\n const [a, b] = this._mont(b0);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromMont(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, invert, sign = null) {\n const [a, d] = this._edwards(a0, invert);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this, invert);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromMont(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromMont(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return MontPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n json.a = this.a.fromRed().toJSON();\n json.b = this.b.fromRed().toJSON();\n return json;\n }\n}\n\n/**\n * MontPoint\n */\n\nclass MontPoint extends Point {\n constructor(curve, x, y) {\n assert(curve instanceof MontCurve);\n\n super(curve, types.AFFINE);\n\n this.x = this.curve.zero;\n this.y = this.curve.zero;\n this.inf = true;\n\n if (x != null)\n this._init(x, y);\n }\n\n _init(x, y) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n\n this.x = x;\n this.y = y;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n this.inf = false;\n }\n\n clone() {\n if (this.inf)\n return this.curve.point();\n\n return this.curve.point(this.x, this.y);\n }\n\n scale(a) {\n return this.clone();\n }\n\n randomize(rng) {\n return this.clone();\n }\n\n neg() {\n // P = O\n if (this.inf)\n return this;\n\n // -(X1, Y1) = (X1, -Y1)\n return this.curve.point(this.x, this.y.redNeg());\n }\n\n add(p) {\n // [MONT1] Page 8, Section 4.3.2.\n //\n // Addition Law:\n //\n // l = (y2 - y1) / (x2 - x1)\n // x3 = b * l^2 - a - x1 - x2\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 2M + 1S + 7A + 1*b\n assert(p instanceof MontPoint);\n\n // O + P = P\n if (this.inf)\n return p;\n\n // P + O = P\n if (p.inf)\n return this;\n\n // P + P, P + -P\n if (this.x.eq(p.x)) {\n // P + -P = O\n if (!this.y.eq(p.y))\n return this.curve.point();\n\n // P + P = 2P\n return this.dbl();\n }\n\n // H = X2 - X1\n const h = p.x.redSub(this.x);\n\n // R = Y2 - Y1\n const r = p.y.redSub(this.y);\n\n // L = R / H\n const l = r.redDiv(h);\n\n // K = b * L^2\n const k = this.curve.b.redMul(l.redSqr());\n\n // X3 = K - a - X1 - X2\n const nx = k.redISub(this.curve.a).redISub(this.x).redISub(p.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n dbl() {\n // [MONT1] Page 8, Section 4.3.2.\n //\n // Addition Law (doubling):\n //\n // l = (3 * x1^2 + 2 * a * x1 + 1) / (2 * b * y1)\n // x3 = b * l^2 - a - 2 * x1\n // y3 = l * (x1 - x3) - y1\n //\n // 1I + 3M + 2S + 7A + 1*a + 1*b + 1*b + 2*2 + 1*3\n\n // P = O\n if (this.inf)\n return this;\n\n // Y1 = 0\n if (this.y.isZero())\n return this.curve.point();\n\n // M1 = 3 * X1^2\n const m1 = this.x.redSqr().redIMuln(3);\n\n // M2 = 2 * a * X1\n const m2 = this.curve.a.redMul(this.x).redIMuln(2);\n\n // M = M1 + M2 + 1\n const m = m1.redIAdd(m2).redIAdd(this.curve.one);\n\n // Z = 2 * b * Y1\n const z = this.curve.b.redMul(this.y).redIMuln(2);\n\n // L = M / Z\n const l = m.redDiv(z);\n\n // K = b * L^2\n const k = this.curve.b.redMul(l.redSqr());\n\n // X3 = K - a - 2 * X1\n const nx = k.redISub(this.curve.a).redISub(this.x).redISub(this.x);\n\n // Y3 = L * (X1 - X3) - Y1\n const ny = l.redMul(this.x.redSub(nx)).redISub(this.y);\n\n return this.curve.point(nx, ny);\n }\n\n getX() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.x.fromRed();\n }\n\n getY() {\n if (this.inf)\n throw new Error('Invalid point.');\n\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof MontPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.inf)\n return p.inf;\n\n // Q = O\n if (p.inf)\n return false;\n\n // X1 = X2, Y1 = Y2\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n cmp(point) {\n assert(point instanceof MontPoint);\n\n if (this.inf && !point.inf)\n return -1;\n\n if (!this.inf && point.inf)\n return 1;\n\n if (this.inf && point.inf)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX())\n || this.getY().cmp(point.getY());\n }\n\n isInfinity() {\n // Infinity cannot be represented in\n // the affine space, except by a flag.\n return this.inf;\n }\n\n isOrder2() {\n if (this.inf)\n return false;\n\n return this.y.isZero();\n }\n\n isOdd() {\n if (this.inf)\n return false;\n\n return this.y.redIsOdd();\n }\n\n isEven() {\n if (this.inf)\n return false;\n\n return this.y.redIsEven();\n }\n\n toP() {\n return this;\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n // (X3, Z3) = (1, 0)\n if (this.inf)\n return this.curve.xpoint();\n\n // (X3, Z3) = (X1, 1)\n return this.curve.xpoint(this.x, this.curve.one);\n }\n\n encode() {\n return this.toX().encode();\n }\n\n static decode(curve, bytes, sign) {\n assert(curve instanceof MontCurve);\n return curve.decodeX(bytes).toP(sign);\n }\n\n toJSON(pre) {\n if (this.inf)\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n return [x, y];\n }\n\n toPretty() {\n if (this.inf)\n return [];\n\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof MontCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n\n return curve.point(x, y);\n }\n\n [custom]() {\n if (this.inf)\n return '';\n\n return '';\n }\n}\n\n/**\n * XPoint\n */\n\nclass XPoint extends Point {\n constructor(curve, x, z) {\n assert(curve instanceof MontCurve);\n\n super(curve, types.PROJECTIVE);\n\n this.x = this.curve.one;\n this.z = this.curve.zero;\n\n if (x != null)\n this._init(x, z);\n }\n\n _init(x, z) {\n assert(x instanceof BN);\n assert(z == null || (z instanceof BN));\n\n this.x = x;\n this.z = z || this.curve.one;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n }\n\n clone() {\n return this.curve.xpoint(this.x, this.z);\n }\n\n precompute(power, rng) {\n // No-op.\n return this;\n }\n\n validate() {\n if (this.isInfinity())\n return true;\n\n // B * y^2 * z = x^3 + A * x^2 * z + x * z^2\n const {x, z} = this;\n const x2 = x.redSqr();\n const x3 = x2.redMul(x);\n const z2 = z.redSqr();\n const ax2 = this.curve.a.redMul(x2).redMul(z);\n const by2 = x3.redIAdd(ax2).redIAdd(x.redMul(z2));\n const y2 = by2.redMul(this.curve.bi);\n\n // sqrt(y^2 * z^4) = y * z^2\n return y2.redMul(z).redJacobi() !== -1;\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#scaling-scale\n // 1I + 1M\n\n // P = O\n if (this.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.z.eq(this.curve.one))\n return this;\n\n // X3 = X1 / Z1\n this.x = this.x.redDiv(this.z);\n\n // Z3 = 1\n this.z = this.curve.one;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // P = O\n if (this.isInfinity())\n return this.curve.xpoint();\n\n // X3 = X1 * A\n const nx = this.x.redMul(a);\n\n // Y3 = Y1 * A\n const nz = this.z.redMul(a);\n\n return this.curve.xpoint(nx, nz);\n }\n\n neg() {\n // -(X1, Z1) = (X1, Z1)\n return this;\n }\n\n dbl() {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n // 2M + 2S + 4A + 1*a24\n\n // A = X1 + Z1\n const a = this.x.redAdd(this.z);\n\n // AA = A^2\n const aa = a.redSqr();\n\n // B = X1 - Z1\n const b = this.x.redSub(this.z);\n\n // BB = B^2\n const bb = b.redSqr();\n\n // C = AA - BB\n const c = aa.redSub(bb);\n\n // X3 = AA * BB\n const nx = aa.redMul(bb);\n\n // Z3 = C * (BB + a24 * C)\n const nz = c.redMul(bb.redIAdd(this.curve.a24.redMul(c)));\n\n return this.curve.xpoint(nx, nz);\n }\n\n diffAddDbl(p2, p3) {\n // https://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#ladder-ladd-1987-m-3\n // 6M + 4S + 8A + 1*a24\n assert(p2 instanceof XPoint);\n assert(p3 instanceof XPoint);\n\n // A = X2 + Z2\n const a = p2.x.redAdd(p2.z);\n\n // AA = A^2\n const aa = a.redSqr();\n\n // B = X2 - Z2\n const b = p2.x.redSub(p2.z);\n\n // BB = B^2\n const bb = b.redSqr();\n\n // E = AA - BB\n const e = aa.redSub(bb);\n\n // C = X3 + Z3\n const c = p3.x.redAdd(p3.z);\n\n // D = X3 - Z3\n const d = p3.x.redSub(p3.z);\n\n // DA = D * A\n const da = d.redMul(a);\n\n // CB = C * B\n const cb = c.redMul(b);\n\n // X5 = Z1 * (DA + CB)^2\n const x5 = this.z.redMul(da.redAdd(cb).redSqr());\n\n // Z5 = X1 * (DA - CB)^2\n const z5 = this.x.redMul(da.redISub(cb).redSqr());\n\n // X4 = AA * BB\n const x4 = aa.redMul(bb);\n\n // Z4 = E * (BB + a24 * E)\n const z4 = e.redMul(bb.redIAdd(this.curve.a24.redMul(e)));\n\n return [\n this.curve.xpoint(x4, z4),\n this.curve.xpoint(x5, z5)\n ];\n }\n\n getX() {\n if (this.isInfinity())\n throw new Error('Invalid point.');\n\n this.normalize();\n\n return this.x.fromRed();\n }\n\n getY(sign) {\n return this.toP(sign).getY();\n }\n\n eq(p) {\n assert(p instanceof XPoint);\n\n // P = Q\n if (this === p)\n return true;\n\n // P = O\n if (this.isInfinity())\n return p.isInfinity();\n\n // Q = O\n if (p.isInfinity())\n return false;\n\n // Z1 = Z2\n if (this.z.eq(p.z))\n return this.x.eq(p.x);\n\n // X1 * Z2 = X2 * Z1\n const x1 = this.x.redMul(p.z);\n const x2 = p.x.redMul(this.z);\n\n return x1.eq(x2);\n }\n\n cmp(point) {\n assert(point instanceof XPoint);\n\n const inf1 = this.isInfinity();\n const inf2 = point.isInfinity();\n\n if (inf1 && !inf2)\n return -1;\n\n if (!inf1 && inf2)\n return 1;\n\n if (inf1 && inf2)\n return 0;\n\n return this.order().cmp(point.order())\n || this.getX().cmp(point.getX());\n }\n\n isInfinity() {\n // Z1 = 0\n return this.z.isZero();\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.x.isZero();\n }\n\n isOdd() {\n return false;\n }\n\n isEven() {\n return false;\n }\n\n hasTorsion() {\n if (this.isInfinity())\n return false;\n\n // X1 = 0, Z1 != 0 (edge case)\n if (this.x.isZero())\n return true;\n\n return super.hasTorsion();\n }\n\n order() {\n try {\n return this.toP().order();\n } catch (e) {\n return new BN(1);\n }\n }\n\n jmul(k) {\n // Multiply with the Montgomery Ladder.\n //\n // [MONT3] Algorithm 4, Page 12, Section 4.2.\n //\n // Note that any clamping is meant to\n // be done _outside_ of this function.\n assert(k instanceof BN);\n assert(!k.red);\n\n const bits = k.bitLength();\n\n let a = this.curve.xpoint();\n let b = this;\n\n for (let i = bits - 1; i >= 0; i--) {\n const bit = k.bit(i);\n\n if (bit === 0)\n [a, b] = this.diffAddDbl(a, b);\n else\n [b, a] = this.diffAddDbl(b, a);\n }\n\n return a;\n }\n\n jmulBlind(k, rng) {\n if (!rng)\n return this.jmul(k);\n\n // Randomize if available.\n return this.randomize(rng).jmul(k);\n }\n\n jmulAdd(k1, p2, k2) {\n throw new Error('Not implemented.');\n }\n\n toP(sign = null) {\n assert(sign == null || typeof sign === 'boolean');\n\n if (this.isInfinity())\n return this.curve.point();\n\n this.normalize();\n\n return this.curve.pointFromX(this.x, sign);\n }\n\n toJ() {\n return this;\n }\n\n toX() {\n return this;\n }\n\n key() {\n if (this.isInfinity())\n return `${this.curve.uid}:oo`;\n\n this.normalize();\n\n const x = this.getX().toString(16);\n\n return `${this.curve.uid}:${x}`;\n }\n\n encode() {\n // [RFC7748] Section 5.\n return this.curve.encodeField(this.getX());\n }\n\n static decode(curve, bytes) {\n assert(curve instanceof MontCurve);\n\n // [RFC7748] Section 5.\n const x = curve.decodeField(bytes);\n\n // We're supposed to ignore the hi bit\n // on montgomery points... I think. If\n // we don't, the X25519 test vectors\n // break, which is pretty convincing\n // evidence. This is a no-op for X448.\n x.iumaskn(curve.fieldBits);\n\n // Note: montgomery points are meant to be\n // reduced by the prime and do not have to\n // be explicitly validated in order to do\n // the montgomery ladder.\n const p = curve.xpoint(x, curve.one);\n\n assert(!p.isInfinity());\n\n return p;\n }\n\n toJSON(pre) {\n return this.toP().toJSON(pre);\n }\n\n toPretty() {\n return this.toP().toPretty();\n }\n\n static fromJSON(curve, json) {\n return MontPoint.fromJSON(curve, json).toX();\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * EdwardsCurve\n */\n\nclass EdwardsCurve extends Curve {\n constructor(conf) {\n super(EdwardsPoint, 'edwards', conf);\n\n this.a = BN.fromJSON(conf.a).toRed(this.red);\n this.d = BN.fromJSON(conf.d).toRed(this.red);\n this.s = BN.fromJSON(conf.s || '0').toRed(this.red);\n this.si = this.s.isZero() ? this.zero : this.s.redInvert();\n\n this.k = this.d.redMuln(2);\n this.smi = -this.d.redNeg().word(0);\n this.ad6 = this.a.redAdd(this.d).redMul(this.i6);\n\n this.twisted = !this.a.eq(this.one);\n this.oneA = this.a.eq(this.one);\n this.mOneA = this.a.eq(this.one.redNeg());\n this.smallD = this.prime != null && this.d.redNeg().length === 1;\n this.alt = null;\n\n this._finalize(conf);\n }\n\n static _isomorphism(curveA, curveD, customA) {\n // Twisted Edwards Isomorphism.\n //\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n //\n // Transformation:\n //\n // a' = a'\n // d' = a' * d / a\n //\n // Where (a / a') is square.\n assert(curveA instanceof BN);\n assert(curveD instanceof BN);\n assert(customA instanceof BN);\n\n const a = customA.clone();\n const d = customA.redMul(curveD).redDiv(curveA);\n const c = curveA.redDiv(customA);\n\n if (c.redJacobi() !== 1)\n throw new Error('Invalid `a` coefficient.');\n\n return [a, d];\n }\n\n _short(a0, odd) {\n // Twisted Edwards->Short Weierstrass Equivalence.\n //\n // [TWISTEQ] Section 2.\n //\n // Transformation:\n //\n // a' = -(a^2 + 14 * a * d + d^2) / 48\n // b' = (33 * (a^2 * d + a * d^2) - a^3 - d^3) / 864\n const {a, d} = this;\n const a2 = a.redSqr();\n const a3 = a2.redMul(a);\n const d2 = d.redSqr();\n const d3 = d2.redMul(d);\n const ad14 = a.redMul(d).redIMuln(14);\n const a2d = a2.redMul(d);\n const ad2 = a.redMul(d2);\n const t0 = a2d.redIAdd(ad2).redIMuln(33);\n const wa = a2.redAdd(ad14).redIAdd(d2).redDivn(-48);\n const wb = t0.redISub(a3).redISub(d3).redDivn(864);\n\n if (a0 != null)\n return ShortCurve._isomorphism(wa, wb, a0, odd);\n\n return [wa, wb];\n }\n\n _mont(b0, invert = false) {\n // Twisted Edwards->Montgomery Transformation.\n //\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n //\n // Equivalence:\n //\n // A = 2 * (a + d) / (a - d)\n // B = 4 / (a - d)\n //\n // Isomorphism:\n //\n // A = 2 * (a + d) / (a - d)\n // B = B'\n //\n // Where ((4 / (a - d)) / B') is square.\n //\n // If `4 / (a - d)` is non-square, we can\n // usually force B=1 by using the `invert`\n // option. This will create an isomorphism\n // chain of: E(a,d)->E(d,a)->M(-A,-B).\n //\n // The equivalence between E(a,d) and E(d,a)\n // is:\n //\n // (x, y) = (x, 1 / y)\n //\n // Meaning our map to M(-A,-B) is:\n //\n // u = (1 + 1 / y) / (1 - 1 / y)\n // = (y + 1) / (y - 1)\n // v = u / x\n assert(typeof invert === 'boolean');\n\n let apd, amd;\n\n if (invert) {\n apd = this.d.redAdd(this.a);\n amd = this.d.redSub(this.a);\n } else {\n apd = this.a.redAdd(this.d);\n amd = this.a.redSub(this.d);\n }\n\n const z = amd.redInvert();\n const a = apd.redMuln(2).redMul(z);\n const b = z.redMuln(4);\n\n if (b0 != null)\n return MontCurve._isomorphism(a, b, b0);\n\n return [a, b];\n }\n\n _edwards(a0) {\n return EdwardsCurve._isomorphism(this.a, this.d, a0);\n }\n\n _scaleShort(curve) {\n assert(curve instanceof ShortCurve);\n\n const [u2, u3] = curve._scale(this);\n\n return [this.field(u2.redInvert()),\n this.field(u3.redInvert())];\n }\n\n _scaleMont(curve, invert = false) {\n // Calculate isomorphism factor between\n // Twisted Edwards and Montgomery with:\n //\n // a = (A + 2) / B\n // c = +-sqrt(a / a')\n //\n // Which can be reduced to:\n //\n // c = +-sqrt((A + 2) / (B * a'))\n //\n // If base points are available, we can do:\n //\n // x = u / v\n // c = x' / x\n //\n // Which can be reduced to:\n //\n // c = v * x' / u\n //\n // We can now calculate the Edwards `x` with:\n //\n // x' = c * u / v\n //\n // And likewise, the Montgomery `v`:\n //\n // v = c * u / x'\n assert(curve instanceof MontCurve);\n assert(typeof invert === 'boolean');\n\n if (this.g.isInfinity() || curve.g.isInfinity()) {\n const [a] = curve._edwards(null, invert);\n\n return this.field(a).redDivSqrt(this.a);\n }\n\n const x = curve.g.x.redDiv(curve.g.y);\n\n return this.g.x.redDiv(this.field(x));\n }\n\n _scaleEdwards(curve) {\n // We can extract the isomorphism factor with:\n //\n // c = +-sqrt(a / a')\n //\n // If base points are available, we can do:\n //\n // c = x' / x\n assert(curve instanceof EdwardsCurve);\n\n if (this.g.isInfinity() || curve.g.isInfinity())\n return this.field(curve.a).redDivSqrt(this.a);\n\n return this.g.x.redDiv(this.field(curve.g.x));\n }\n\n _mulA(num) {\n assert(num instanceof BN);\n\n // n * a = n\n if (this.oneA)\n return num.clone();\n\n // n * a = -n\n if (this.mOneA)\n return num.redNeg();\n\n return this.a.redMul(num);\n }\n\n _mulD(num) {\n assert(num instanceof BN);\n\n // -d < 0x4000000\n if (this.smallD)\n return num.redMuln(this.smi);\n\n return this.d.redMul(num);\n }\n\n _elligator1(t) {\n // Elligator 1.\n //\n // Distribution: 1/2.\n //\n // [ELL1] Page 6, Section 3.\n // Page 15, Appendix A.\n // [ELL2] Page 7, Section 3.2.\n //\n // Assumptions:\n //\n // - Let p be a prime power congruent to 3 mod 4.\n // - Let s be a nonzero element of F(p).\n // - Let c = 2 / s^2.\n // - Let r = c + 1 / c.\n // - Let d = -(c + 1)^2 / (c - 1)^2.\n // - (s^2 - 2) * (s^2 + 2) != 0.\n // - c * (c - 1) * (c + 1) != 0.\n // - r != 0.\n // - d is not square.\n // - x^2 + y^2 = 1 + d * x^2 * y^2.\n // - u * v * X * Y * x * (Y + 1) != 0.\n // - Y^2 = X^5 + (r^2 - 2) * X^3 + X.\n //\n // Elligator 1, as devised by Fouque et al,\n // takes place on the hyperelliptic curve of:\n //\n // y^2 = x^5 + (r^2 - 2) * x^3 + x\n //\n // Not only must our Edwards curve be complete,\n // with a prime congruent to 3 mod 4, and a = 1,\n // our curve must be isomorphic to a hyperelliptic\n // curve of the above form. Roughly one half of\n // all Edwards curves are isomorphic to a curve\n // of said form.\n //\n // We can derive the isomorphism with:\n //\n // c = (d +- 2 * sqrt(-d) - 1) / (d + 1)\n // s = +-sqrt(2 / c)\n // r = c + 1 / c\n //\n // Note that even if your curve is an Elligator 1\n // curve, Elligator 2 is probably still preferable,\n // as it has nearly the same properties (i.e. the\n // same distribution), and is much less complex.\n //\n // Map:\n //\n // f(a) = a^((p - 1) / 2)\n // u = (1 - t) / (1 + t)\n // v = u^5 + (r^2 - 2) * u^3 + u\n // X = f(v) * u\n // Y = (f(v) * v)^((p + 1) / 4) * f(v) * f(u^2 + 1 / c^2)\n // Y = 1, if u = 0\n // x = (c - 1) * s * X * (1 + X) / Y\n // y = (r * X - (1 + X)^2) / (r * X + (1 + X)^2)\n //\n // When t = +-1, we create the hyperelliptic\n // 2-torsion point of (0, 0). This needs to be\n // mapped to (0, -1) in Edwards form, but the x\n // denominator becomes zero. As far as I can\n // tell, this is the only exceptional case.\n //\n // The only other exceptional case initially\n // appears to be when the y denominator sums to\n // zero (when t = sqrt(4 / r + 1)), however, the\n // hyperelliptic `X` is negated by the sign of\n // `v`, making this impossible.\n const {s, si, i2, one, two} = this;\n const c = si.redSqr().redIMuln(2);\n const ci = s.redSqr().redMul(i2);\n const ci2 = ci.redSqr();\n const r = c.redAdd(ci);\n const r2 = r.redSqr().redISub(two);\n const cm1 = c.redSub(one);\n const uu = one.redSub(t);\n const uz = one.redAdd(t);\n const u = uz.isZero() ? uz : uu.redDiv(uz);\n const u2 = u.redSqr();\n const u3 = u2.redMul(u);\n const u5 = u3.redMul(u2);\n const v = u5.redAdd(r2.redMul(u3)).redIAdd(u);\n const f0 = this.field(v.redJacobi());\n const f1 = this.field(u2.redAdd(ci2).redJacobi());\n const f2 = f0.redMul(f1);\n const X = f0.redMul(u);\n const Y = f0.redMul(v).redSqrt().redMul(f2);\n const X1 = one.redAdd(X);\n const rX = r.redMul(X);\n const X12 = X1.redSqr();\n const xx = cm1.redMul(s).redMul(X).redMul(X1);\n const xz = u.isZero() ? this.one : Y;\n const yy = rX.redSub(X12);\n const yz = rX.redAdd(X12);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n _invert1(p, hint) {\n // Inverting the Map (Elligator 1).\n //\n // [ELL1] Page 6, Section 3.\n // Page 15, Appendix A.\n // [ELL2] Page 7, Section 3.3.\n //\n // Assumptions:\n //\n // - y + 1 != 0.\n // - (1 + n * r)^2 - 1 is square in F(p).\n // - If n * r = -2 then x = 2 * s * (c - 1) * f(c) / r.\n // - Y = (c - 1) * s * X * (1 + X) / x.\n //\n // Map:\n //\n // f(a) = a^((p - 1) / 2)\n // n = (y - 1) / (2 * (y + 1))\n // X = -(1 + n * r) + ((1 + n * r)^2 - 1)^((p + 1) / 4)\n // z = f((c - 1) * s * X * (1 + X) * x * (X^2 + 1 / c^2))\n // u = z * X\n // t = (1 - u) / (1 + u)\n const {s, si, i2, one} = this;\n const {x, y, z} = p;\n const sign = hint & 1;\n const c = si.redSqr().redIMuln(2);\n const ci = s.redSqr().redMul(i2);\n const ci2 = ci.redSqr();\n const r = c.redAdd(ci);\n const cm1 = c.redSub(one);\n const nn = y.redSub(z);\n const nz = y.redAdd(z).redIMuln(2);\n const n = nz.isZero() ? nz : nn.redDiv(nz);\n const nr1 = one.redAdd(n.redMul(r));\n const w2 = nr1.redSqr().redISub(one);\n const w = w2.redSqrt();\n const X = w.redSub(nr1);\n const X1 = one.redAdd(X);\n const YY = cm1.redMul(s).redMul(X).redMul(X1);\n const Y = YY.redMul(x.redMul(z));\n const X2 = X.redSqr().redIAdd(ci2);\n const Z = this.field(Y.redMul(X2).redJacobi());\n const u = Z.redMul(X);\n const tt = one.redSub(u);\n const tz = one.redAdd(u);\n const t = tz.isZero() ? tz : tt.redDiv(tz);\n\n if (t.redIsOdd() !== Boolean(sign))\n t.redINeg();\n\n return t;\n }\n\n _alt() {\n if (!this.alt)\n this.alt = this.toMont();\n\n return this.alt;\n }\n\n isElliptic() {\n const ad = this.a.redMul(this.d);\n const amd = this.a.redSub(this.d);\n\n // a * d * (a - d) != 0\n return !ad.redMul(amd).isZero();\n }\n\n jinv() {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n const {a, d} = this;\n const ad = a.redMul(d);\n const amd4 = a.redSub(d).redPown(4);\n const a2 = a.redSqr();\n const d2 = d.redSqr();\n const t0 = a2.redAdd(ad.redMuln(14)).redIAdd(d2);\n const lhs = t0.redPown(3).redIMuln(16);\n const rhs = ad.redMul(amd4);\n\n if (rhs.isZero())\n throw new Error('Curve is not elliptic.');\n\n // 16 * (a^2 + 14 * a * d + d^2)^3 / (a * d * (a - d)^4)\n return lhs.redDiv(rhs).fromRed();\n }\n\n isComplete() {\n return this.a.redJacobi() === 1\n && this.d.redJacobi() === -1;\n }\n\n point(x, y, z, t) {\n return new EdwardsPoint(this, x, y, z, t);\n }\n\n jpoint(x, y, z) {\n assert(x == null && y == null && z == null);\n return this.point();\n }\n\n cpoint(xx, xz, yy, yz) {\n assert(xx instanceof BN);\n assert(xz instanceof BN);\n assert(yy instanceof BN);\n assert(yz instanceof BN);\n\n const x = xx.redMul(yz);\n const y = yy.redMul(xz);\n const z = xz.redMul(yz);\n const t = xx.redMul(yy);\n\n return this.point(x, y, z, t);\n }\n\n solveX2(y) {\n // [RFC8032] Section 5.1.3 & 5.2.3.\n assert(y instanceof BN);\n\n // x^2 = (y^2 - 1) / (d * y^2 - a)\n const y2 = y.redSqr();\n const rhs = this._mulD(y2).redISub(this.a);\n const lhs = y2.redISub(this.one);\n const x2 = lhs.redDiv(rhs);\n\n return x2;\n }\n\n solveX(y) {\n // Optimize with inverse square root trick.\n //\n // Note that `0 / 0` can only occur if\n // `a == d` (i.e. the curve is singular).\n const y2 = y.redSqr();\n const rhs = this._mulD(y2).redISub(this.a);\n const lhs = y2.redISub(this.one);\n\n return lhs.redDivSqrt(rhs);\n }\n\n solveY2(x) {\n assert(x instanceof BN);\n\n // y^2 = (a * x^2 - 1) / (d * x^2 - 1)\n const x2 = x.redSqr();\n const lhs = this._mulA(x2).redISub(this.one);\n const rhs = this._mulD(x2).redISub(this.one);\n const y2 = lhs.redDiv(rhs);\n\n return y2;\n }\n\n solveY(x) {\n // Optimize with inverse square root trick.\n //\n // Note that `0 / 0` can only occur if\n // `a == d` (i.e. the curve is singular).\n const x2 = x.redSqr();\n const lhs = this._mulA(x2).redISub(this.one);\n const rhs = this._mulD(x2).redISub(this.one);\n\n return lhs.redDivSqrt(rhs);\n }\n\n validate(point) {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n // Page 11, Section 6.\n assert(point instanceof EdwardsPoint);\n\n // Z1 = 1\n if (point.zOne) {\n // a * x^2 + y^2 = 1 + d * x^2 * y^2\n const x2 = point.x.redSqr();\n const y2 = point.y.redSqr();\n const dxy = this._mulD(x2).redMul(y2);\n const lhs = this._mulA(x2).redIAdd(y2);\n const rhs = this.one.redAdd(dxy);\n const tz = point.t;\n const xy = point.x.redMul(point.y);\n\n return lhs.eq(rhs) && tz.eq(xy);\n }\n\n // (a * x^2 + y^2) * z^2 = z^4 + d * x^2 * y^2\n const x2 = point.x.redSqr();\n const y2 = point.y.redSqr();\n const z2 = point.z.redSqr();\n const z4 = z2.redSqr();\n const dxy = this._mulD(x2).redMul(y2);\n const lhs = this._mulA(x2).redIAdd(y2).redMul(z2);\n const rhs = z4.redIAdd(dxy);\n const tz = point.t.redMul(point.z);\n const xy = point.x.redMul(point.y);\n\n return lhs.eq(rhs) && tz.eq(xy);\n }\n\n pointFromX(x, sign = null) {\n assert(x instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!x.red)\n x = x.toRed(this.red);\n\n const y = this.solveY(x);\n\n if (sign != null) {\n if (y.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (y.redIsOdd() !== sign)\n y.redINeg();\n }\n\n return this.point(x, y);\n }\n\n pointFromY(y, sign = null) {\n assert(y instanceof BN);\n assert(sign == null || typeof sign === 'boolean');\n\n if (!y.red)\n y = y.toRed(this.red);\n\n const x = this.solveX(y);\n\n if (sign != null) {\n if (x.isZero() && sign)\n throw new Error('Invalid point.');\n\n if (x.redIsOdd() !== sign)\n x.redINeg();\n }\n\n return this.point(x, y);\n }\n\n isIsomorphic(curve, invert = false) {\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n // Definition 2.1, Page 3, Section 2.\n assert(curve instanceof Curve);\n assert(typeof invert === 'boolean');\n\n if (!curve.p.eq(this.p))\n return false;\n\n // E(a,d) <-> E(a,b)\n if (curve.type === 'short')\n return curve.isIsomorphic(this);\n\n // E(a,d) <-> M(A,B)\n // E(a,d) <-> M(-A,-B)\n if (curve.type === 'mont') {\n // A * (a - d) = 2 * (a + d)\n const a = this.field(curve.a);\n\n let apd, amd;\n\n if (invert) {\n apd = this.d.redAdd(this.a);\n amd = this.d.redSub(this.a);\n } else {\n apd = this.a.redAdd(this.d);\n amd = this.a.redSub(this.d);\n }\n\n return a.redMul(amd).eq(apd.redIMuln(2));\n }\n\n // E(a,d) <-> E(a',a'd/a)\n if (curve.type === 'edwards') {\n // a' * d = a * d'\n const a = this.field(curve.a);\n const d = this.field(curve.d);\n\n return this.a.redMul(d).eq(a.redMul(this.d));\n }\n\n return false;\n }\n\n isIsogenous(curve) {\n // Check for the 4-isogenies described by Hamburg:\n // https://moderncrypto.org/mail-archive/curves/2016/000806.html\n assert(curve instanceof Curve);\n\n if (!curve.p.eq(this.p))\n return false;\n\n // E(1,d) <-> M(2-4d,1)\n if (curve.type === 'mont') {\n if (!this.a.eq(this.one))\n return false;\n\n const a = this.field(curve.a);\n const b = this.field(curve.b);\n const d24 = this.two.redSub(this.d.redMuln(4));\n\n return a.eq(d24) && b.eq(this.one);\n }\n\n // E(a,d) <-> E(-a,d-a)\n if (curve.type === 'edwards') {\n const a = this.field(curve.a);\n const d = this.field(curve.d);\n\n return a.eq(this.a.redNeg())\n && d.eq(this.d.redSub(this.a));\n }\n\n return false;\n }\n\n pointFromShort(point) {\n // [TWISTEQ] Section 1.\n assert(point instanceof ShortPoint);\n\n if (this.isIsomorphic(point.curve)) {\n // Equivalence for E(a,b)->E(a',d'):\n //\n // x' = (6 * x - a' - d') / (6 * y)\n // y' = (12 * x - 5 * a' + d') / (12 * x + a' - 5 * d')\n //\n // Undefined for x = (5 * d' - a') / 12 or y = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - ((a' + d') / 6, 0) -> (0, -1)\n // - ((5 * d' - a') / 12, (d' - a') / 4 * sqrt(d')) -> (sqrt(1/d'), oo)\n //\n // Unexceptional Cases:\n // - ((5 * a' - d') / 12, (a' - d') / 4 * sqrt(a')) -> (sqrt(1/a'), 0)\n if (point.isInfinity())\n return this.point();\n\n if (point.y.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const {a, d} = this;\n const [u2, u3] = this._scale(point.curve);\n const a5 = a.redMuln(5);\n const d5 = d.redMuln(5);\n const x = this.field(point.x).redMul(u2);\n const y = this.field(point.y).redMul(u3);\n const x6 = x.redMuln(6);\n const x12 = x.redMuln(12);\n const xx = x6.redSub(a).redISub(d);\n const xz = y.redMuln(6);\n const yy = x12.redSub(a5).redIAdd(d);\n const yz = x12.redAdd(a).redISub(d5);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromMont(point) {\n // [RFC7748] Section 4.1 & 4.2.\n // [MONT3] Page 6, Section 2.5.\n // [TWISTED] Theorem 3.2, Page 4, Section 3.\n assert(point instanceof MontPoint);\n assert(point.curve.p.eq(this.p));\n\n // Montgomery `u`, `v`.\n const u = this.field(point.x);\n const v = this.field(point.y);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for M(2-4d,1)->E(1,d):\n //\n // x = 4 * v * (u^2 - 1) / (u^4 - 2 * u^2 + 4 * v^2 + 1)\n // y = -(u^5 - 2 * u^3 - 4 * u * v^2 + u) /\n // (u^5 - 2 * u^2 * v^2 - 2 * u^3 - 2 * v^2 + u)\n //\n // Undefined for u = 0 and v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, 1)\n //\n // Unexceptional Cases:\n // - (-1, +-sqrt(A - 2)) -> (0, 1)\n // - (1, +-sqrt(A + 2)) -> (0, -1)\n //\n // The point (1, v) is invalid on Curve448.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point();\n\n const u2 = u.redSqr();\n const u3 = u2.redMul(u);\n const u4 = u3.redMul(u);\n const u5 = u4.redMul(u);\n const v2 = v.redSqr();\n const a = v.redMuln(4);\n const b = u2.redSub(this.one);\n const c = u2.redMuln(2);\n const d = v2.redMuln(4);\n const e = u3.redIMuln(2);\n const f = u.redMul(v2).redIMuln(4);\n const g = u2.redMul(v2).redIMuln(2);\n const h = v2.redIMuln(2);\n const xx = a.redMul(b);\n const xz = u4.redISub(c).redIAdd(d).redIAdd(this.one);\n const yy = u5.redSub(e).redISub(f).redIAdd(u).redINeg();\n const yz = u5.redISub(g).redISub(e).redISub(h).redIAdd(u);\n\n return this.cpoint(xx, xz, yy, yz).divn(4);\n }\n\n if (this.isIsomorphic(point.curve, true)) {\n // Isomorphic maps for M(-A,-B)->E(a,d):\n //\n // x = +-sqrt((A - 2) / (B * a)) * u / v\n // y = (u + 1) / (u - 1)\n //\n // Undefined for u = 1 or v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, -1)\n // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / d), oo)\n //\n // Unexceptional Cases:\n // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / a), 0)\n //\n // The point (1, v) is invalid on Curve448.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const c = this._scale(point.curve, true);\n const xx = c.redMul(u);\n const xz = v;\n const yy = u.redAdd(this.one);\n const yz = u.redSub(this.one);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n if (this.isIsomorphic(point.curve, false)) {\n // Isomorphic maps for M(A,B)->E(a,d):\n //\n // x = +-sqrt((A + 2) / (B * a)) * u / v\n // y = (u - 1) / (u + 1)\n //\n // Undefined for u = -1 or v = 0.\n //\n // Exceptional Cases:\n // - O -> (0, 1)\n // - (0, 0) -> (0, -1)\n // - (-1, +-sqrt((A - 2) / B)) -> (+-sqrt(1 / d), oo)\n //\n // Unexceptional Cases:\n // - (1, +-sqrt((A + 2) / B)) -> (+-sqrt(1 / a), 0)\n //\n // The point (-1, v) is invalid on Curve25519.\n if (point.isInfinity())\n return this.point();\n\n if (point.x.isZero())\n return this.point(this.zero, this.one.redNeg());\n\n const c = this._scale(point.curve, false);\n const xx = c.redMul(u);\n const xz = v;\n const yy = u.redSub(this.one);\n const yz = u.redAdd(this.one);\n\n return this.cpoint(xx, xz, yy, yz);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromEdwards(point) {\n // [TWISTED] Definition 2.1, Page 3, Section 2.\n // [ISOGENY] Page 2, Section 2.\n assert(point instanceof EdwardsPoint);\n assert(point.curve.p.eq(this.p));\n\n // Edwards `x`, `y`, `z`, `t`.\n const a = this.field(point.curve.a);\n const x = this.field(point.x);\n const y = this.field(point.y);\n const z = this.field(point.z);\n const t = this.field(point.t);\n\n if (this.isIsogenous(point.curve)) {\n // 4-isogeny maps for E(a,d)<->E(-a,d-a):\n //\n // x' = (2 * x * y) / (y^2 - a * x^2)\n // y' = (y^2 + a * x^2) / (2 - y^2 - a * x^2)\n //\n // Undefined for y^2 - a * x^2 = 0\n // or y^2 + a * x^2 = 2.\n const xy = x.redMul(y);\n const x2 = x.redSqr();\n const y2 = y.redSqr();\n const z2 = z.redSqr();\n const ax2 = a.redMul(x2);\n const xx = xy.redIMuln(2);\n const xz = y2.redSub(ax2);\n const yy = y2.redAdd(ax2);\n const yz = z2.redIMuln(2).redISub(yy);\n const p = this.cpoint(xx, xz, yy, yz);\n\n return !this.twisted ? p.divn(4) : p;\n }\n\n if (this.isIsomorphic(point.curve)) {\n // Isomorphic maps for E(a,d)<->E(a',a'd/a):\n //\n // x' = +-sqrt(a / a') * x\n // y' = y\n //\n // Undefined when (a / a') is not square.\n const c = this._scale(point.curve);\n const nx = c.redMul(x);\n const ny = y;\n const nz = z;\n const nt = c.redMul(t);\n\n return this.point(nx, ny, nz, nt);\n }\n\n throw new Error('Not implemented.');\n }\n\n pointFromUniform(u, curve = null) {\n assert(u instanceof BN);\n assert(u.red === this.red);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n const u0 = curve.field(u);\n const p0 = curve.pointFromUniform(u0);\n\n return this.pointFromMont(p0);\n }\n\n pointToUniform(p, hint, curve = null) {\n // Convert an edwards point to a field\n // element by inverting the elligator2 map.\n //\n // Hint Layout:\n //\n // [00000000] [0000] [0000]\n // | | |\n // | | +-- preimage index\n // | +--- subgroup\n // +-- bits to OR with uniform bytes\n assert(p instanceof EdwardsPoint);\n assert((hint >>> 0) === hint);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n // Add a random torsion component.\n const i = ((hint >> 4) & 15) % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n // Convert and invert.\n const p0 = curve.pointFromEdwards(q);\n const u0 = curve.pointToUniform(p0, hint & 15);\n\n return this.field(u0);\n }\n\n pointFromHash(bytes, pake, curve = null) {\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n const p0 = curve.pointFromHash(bytes, pake);\n\n return this.pointFromMont(p0);\n }\n\n pointToHash(p, subgroup, rng, curve = null) {\n assert(p instanceof EdwardsPoint);\n assert((subgroup >>> 0) === subgroup);\n assert(curve == null || (curve instanceof MontCurve));\n\n if (!curve)\n curve = this._alt();\n\n // Add a random torsion component.\n const i = subgroup % this.torsion.length;\n const q = p.add(this.torsion[i]);\n\n // Convert and invert.\n const p0 = curve.pointFromEdwards(q);\n\n return curve.pointToHash(p0, 0, rng);\n }\n\n decodePoint(bytes) {\n return EdwardsPoint.decode(this, bytes);\n }\n\n toShort(a0, odd, sign = null) {\n const [a, b] = this._short(a0, odd);\n\n const curve = new ShortCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h\n });\n\n if (sign != null) {\n const [, u3] = curve._scale(this);\n\n if (u3.redIsOdd() !== sign)\n u3.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromEdwards(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n\n return curve;\n }\n\n toMont(b0, invert, sign = null) {\n const [a, b] = this._mont(b0, invert);\n\n const curve = new MontCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n b: b,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = this._scale(curve, invert);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity())\n curve.g = curve.pointFromEdwards(this.g);\n\n for (let i = 0; i < this.h.word(0); i++)\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n\n return curve;\n }\n\n toEdwards(a0, sign = null) {\n const [a, d] = this._edwards(a0);\n\n const curve = new EdwardsCurve({\n red: this.red,\n prime: this.prime,\n p: this.p,\n a: a,\n d: d,\n n: this.n,\n h: this.h,\n z: this.z\n });\n\n if (sign != null) {\n const c = curve._scale(this);\n\n if (c.redIsOdd() !== sign)\n c.redINeg();\n }\n\n if (!this.g.isInfinity()) {\n curve.g = curve.pointFromEdwards(this.g);\n curve.g.normalize();\n }\n\n if (curve.isComplete()) {\n for (let i = 0; i < this.h.word(0); i++) {\n curve.torsion[i] = curve.pointFromEdwards(this.torsion[i]);\n curve.torsion[i].normalize();\n }\n }\n\n return curve;\n }\n\n pointFromJSON(json) {\n return EdwardsPoint.fromJSON(this, json);\n }\n\n toJSON(pre) {\n const json = super.toJSON(pre);\n\n json.a = this.a.fromRed().toJSON();\n json.d = this.d.fromRed().toJSON();\n\n if (!this.s.isZero())\n json.s = this.s.fromRed().toJSON();\n\n return json;\n }\n}\n\n/**\n * EdwardsPoint\n */\n\nclass EdwardsPoint extends Point {\n constructor(curve, x, y, z, t) {\n assert(curve instanceof EdwardsCurve);\n\n super(curve, types.EXTENDED);\n\n this.x = this.curve.zero;\n this.y = this.curve.one;\n this.z = this.curve.one;\n this.t = this.curve.zero;\n this.zOne = true;\n\n if (x != null)\n this._init(x, y, z, t);\n }\n\n _init(x, y, z, t) {\n assert(x instanceof BN);\n assert(y instanceof BN);\n assert(z == null || (z instanceof BN));\n assert(t == null || (t instanceof BN));\n\n this.x = x;\n this.y = y;\n this.z = z || this.curve.one;\n this.t = t || null;\n\n if (!this.x.red)\n this.x = this.x.toRed(this.curve.red);\n\n if (!this.y.red)\n this.y = this.y.toRed(this.curve.red);\n\n if (!this.z.red)\n this.z = this.z.toRed(this.curve.red);\n\n if (this.t && !this.t.red)\n this.t = this.t.toRed(this.curve.red);\n\n this.zOne = this.z.eq(this.curve.one);\n\n this._check();\n\n if (!this.t) {\n this.t = this.x.redMul(this.y);\n if (!this.zOne)\n this.t = this.t.redDiv(this.z);\n }\n }\n\n _check() {\n // In order to achieve complete\n // addition formulas, `a` must\n // be a square (always the case\n // for a=1), and `d` must be a\n // non-square.\n //\n // If this is not the case, the\n // addition formulas may have\n // exceptional cases where Z3=0.\n //\n // In particular, this can occur\n // when: Q*h = -P*h and Q != -P.\n //\n // This is assuming 4-torsion is\n // involved (the 4-torsion point\n // is _not_ representable when\n // `d` is square).\n if (this.z.isZero())\n throw new Error('Invalid point.');\n }\n\n clone() {\n return this.curve.point(this.x, this.y, this.z, this.t);\n }\n\n normalize() {\n // https://hyperelliptic.org/EFD/g1p/auto-edwards-projective.html#scaling-z\n // 1I + 2M (+ 1M if extended)\n\n // Z1 = 1\n if (this.zOne)\n return this;\n\n // A = 1 / Z1\n const a = this.z.redInvert();\n\n // X3 = X1 * A\n this.x = this.x.redMul(a);\n\n // Y3 = Y1 * A\n this.y = this.y.redMul(a);\n\n // T3 = T1 * A\n this.t = this.t.redMul(a);\n\n // Z3 = 1\n this.z = this.curve.one;\n this.zOne = true;\n\n return this;\n }\n\n scale(a) {\n assert(a instanceof BN);\n\n // X3 = X1 * A\n const nx = this.x.redMul(a);\n\n // Y3 = Y1 * A\n const ny = this.y.redMul(a);\n\n // Z3 = Z1 * A\n const nz = this.z.redMul(a);\n\n // T3 = T1 * A\n const nt = this.t.redMul(a);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n neg() {\n // -(X1, Y1, Z1, T1) = (-X1, Y1, Z1, -T1)\n const nx = this.x.redNeg();\n const ny = this.y;\n const nz = this.z;\n const nt = this.t.redNeg();\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n add(p) {\n assert(p instanceof EdwardsPoint);\n\n // P = O\n if (this.isInfinity())\n return p;\n\n // Q = O\n if (p.isInfinity())\n return this;\n\n // Z1 = 1\n if (this.zOne)\n return p._add(this);\n\n return this._add(p);\n }\n\n _add(p) {\n // a = -1\n if (this.curve.mOneA)\n return this._addM1(p);\n\n return this._addA(p);\n }\n\n _addM1(p) {\n // Assumes a = -1.\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-add-2008-hwcd-3\n // 8M + 8A + 1*k + 1*2\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html#addition-madd-2008-hwcd-3\n // 7M + 8A + 1*k + 1*2\n\n // A = (Y1 - X1) * (Y2 - X2)\n const a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n\n // B = (Y1 + X1) * (Y2 + X2)\n const b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n\n // C = T1 * k * T2\n const c = this.t.redMul(this.curve.k).redMul(p.t);\n\n // D = Z1 * 2 * Z2\n const d = p.zOne ? this.z.redAdd(this.z) : this.z.redMul(p.z).redIMuln(2);\n\n // E = B - A\n const e = b.redSub(a);\n\n // F = D - C\n const f = d.redSub(c);\n\n // G = D + C\n const g = d.redIAdd(c);\n\n // H = B + A\n const h = b.redIAdd(a);\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n _addA(p) {\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-add-2008-hwcd\n // 9M + 7A + 1*a + 1*d\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#addition-madd-2008-hwcd\n // 8M + 7A + 1*a + 1*d\n\n // A = X1 * X2\n const a = this.x.redMul(p.x);\n\n // B = Y1 * Y2\n const b = this.y.redMul(p.y);\n\n // C = T1 * d * T2\n const c = this.curve._mulD(this.t).redMul(p.t);\n\n // D = Z1 * Z2\n const d = p.zOne ? this.z.clone() : this.z.redMul(p.z);\n\n // + XYXY = (X1 + Y1) * (X2 + Y2)\n const xyxy = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y));\n\n // E = (X1 + Y1) * (X2 + Y2) - A - B\n const e = xyxy.redISub(a).redISub(b);\n\n // F = D - C\n const f = d.redSub(c);\n\n // G = D + C\n const g = d.redIAdd(c);\n\n // H = B - a * A\n const h = b.redISub(this.curve._mulA(a));\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n dbl() {\n // P = O\n if (this.isInfinity())\n return this;\n\n return this._dbl();\n }\n\n _dbl() {\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-dbl-2008-hwcd\n // 4M + 4S + 6A + 1*a + 1*2\n //\n // https://hyperelliptic.org/EFD/g1p/auto-twisted-extended.html#doubling-mdbl-2008-hwcd\n // 3M + 4S + 7A + 1*a + 1*2\n\n // A = X1^2\n const a = this.x.redSqr();\n\n // B = Y1^2\n const b = this.y.redSqr();\n\n // C = 2 * Z1^2\n const c = this.zOne ? this.curve.two : this.z.redSqr().redIMuln(2);\n\n // D = a * A\n const d = this.curve._mulA(a);\n\n // E = (X1 + Y1)^2 - A - B\n const e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n\n // G = D + B\n const g = d.redAdd(b);\n\n // F = G - C\n const f = g.redSub(c);\n\n // H = D - B\n const h = d.redISub(b);\n\n // X3 = E * F\n const nx = e.redMul(f);\n\n // Y3 = G * H\n const ny = g.redMul(h);\n\n // T3 = E * H\n const nt = e.redMul(h);\n\n // Z3 = F * G\n const nz = f.redMul(g);\n\n return this.curve.point(nx, ny, nz, nt);\n }\n\n getX() {\n this.normalize();\n return this.x.fromRed();\n }\n\n getY() {\n this.normalize();\n return this.y.fromRed();\n }\n\n eq(p) {\n assert(p instanceof EdwardsPoint);\n assert(!this.z.isZero());\n assert(!p.z.isZero());\n\n // P = Q\n if (this === p)\n return true;\n\n // Z1 = Z2\n if (this.z.eq(p.z)) {\n return this.x.eq(p.x)\n && this.y.eq(p.y);\n }\n\n // X1 * Z2 = X2 * Z1\n const x1 = this.x.redMul(p.z);\n const x2 = p.x.redMul(this.z);\n\n if (!x1.eq(x2))\n return false;\n\n const y1 = this.y.redMul(p.z);\n const y2 = p.y.redMul(this.z);\n\n return y1.eq(y2);\n }\n\n cmp(point) {\n assert(point instanceof EdwardsPoint);\n\n return this.order().cmp(point.order())\n || this.getY().cmp(point.getY())\n || this.getX().cmp(point.getX());\n }\n\n isInfinity() {\n assert(!this.z.isZero());\n\n // X1 = 0\n if (!this.x.isZero())\n return false;\n\n // Y1 = Z1\n return this.y.eq(this.z);\n }\n\n isOrder2() {\n if (this.isInfinity())\n return false;\n\n return this.x.isZero();\n }\n\n isOdd() {\n this.normalize();\n return this.x.redIsOdd();\n }\n\n isEven() {\n this.normalize();\n return this.x.redIsEven();\n }\n\n toP() {\n return this.normalize();\n }\n\n toJ() {\n return this;\n }\n\n encode() {\n // [RFC8032] Section 5.1.2.\n const y = this.getY();\n\n // Note: `x` normalized from `getY()` call.\n y.setn(this.curve.signBit, this.x.redIsOdd());\n\n return this.curve.encodeAdjusted(y);\n }\n\n static decode(curve, bytes) {\n // [RFC8032] Section 5.1.3.\n assert(curve instanceof EdwardsCurve);\n\n const y = curve.decodeAdjusted(bytes);\n const sign = y.testn(curve.signBit) !== 0;\n\n y.setn(curve.signBit, 0);\n\n if (y.cmp(curve.p) >= 0)\n throw new Error('Invalid point.');\n\n return curve.pointFromY(y, sign);\n }\n\n toJSON(pre) {\n if (this.isInfinity())\n return [];\n\n const x = this.getX().toJSON();\n const y = this.getY().toJSON();\n\n if (pre === true && this.pre)\n return [x, y, this.pre.toJSON()];\n\n return [x, y];\n }\n\n toPretty() {\n const size = this.curve.fieldSize * 2;\n const x = toPretty(this.getX(), size);\n const y = toPretty(this.getY(), size);\n\n return [x, y];\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof EdwardsCurve);\n assert(Array.isArray(json));\n assert(json.length === 0\n || json.length === 2\n || json.length === 3);\n\n if (json.length === 0)\n return curve.point();\n\n const x = BN.fromJSON(json[0]);\n const y = BN.fromJSON(json[1]);\n const point = curve.point(x, y);\n\n if (json.length > 2 && json[2] != null)\n point.pre = Precomp.fromJSON(point, json[2]);\n\n return point;\n }\n\n [custom]() {\n if (this.isInfinity())\n return '';\n\n return '';\n }\n}\n\n/**\n * Precomp\n */\n\nclass Precomp {\n constructor() {\n this.naf = null;\n this.windows = null;\n this.doubles = null;\n this.blinding = null;\n this.beta = null;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const out = new this.constructor();\n\n if (this.naf)\n out.naf = this.naf.map(func);\n\n if (this.doubles)\n out.doubles = this.doubles.map(func);\n\n return out;\n }\n\n toJSON() {\n return {\n naf: this.naf ? this.naf.toJSON() : null,\n windows: this.windows ? this.windows.toJSON() : null,\n doubles: this.doubles ? this.doubles.toJSON() : null,\n blinding: this.blinding ? this.blinding.toJSON() : undefined\n };\n }\n\n fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n\n if (json.naf != null)\n this.naf = NAF.fromJSON(point, json.naf);\n\n if (json.windows != null)\n this.windows = Windows.fromJSON(point, json.windows);\n\n if (json.doubles != null)\n this.doubles = Doubles.fromJSON(point, json.doubles);\n\n if (json.blinding != null)\n this.blinding = Blinding.fromJSON(point, json.blinding);\n\n return this;\n }\n\n static fromJSON(point, json) {\n return new this().fromJSON(point, json);\n }\n}\n\n/**\n * NAF\n */\n\nclass NAF {\n constructor(width, points) {\n this.width = width;\n this.points = points;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const {width} = this;\n const points = [];\n\n for (const point of this.points)\n points.push(func(point));\n\n return new this.constructor(width, points);\n }\n\n toJSON() {\n return {\n width: this.width,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.width >>> 0) === json.width);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {width} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(width, points);\n }\n}\n\n/**\n * Windows\n */\n\nclass Windows {\n constructor(width, bits, points) {\n this.width = width;\n this.bits = bits;\n this.points = points;\n }\n\n toJSON() {\n return {\n width: this.width,\n bits: this.bits,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.width >>> 0) === json.width);\n assert((json.bits >>> 0) === json.bits);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {width, bits} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(width, bits, points);\n }\n}\n\n/**\n * Doubles\n */\n\nclass Doubles {\n constructor(step, points) {\n this.step = step;\n this.points = points;\n }\n\n map(func) {\n assert(typeof func === 'function');\n\n const {step} = this;\n const points = [];\n\n for (const point of this.points)\n points.push(func(point));\n\n return new this.constructor(step, points);\n }\n\n toJSON() {\n return {\n step: this.step,\n points: this.points.slice(1).map((point) => {\n return point.toJSON();\n })\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n assert((json.step >>> 0) === json.step);\n assert(Array.isArray(json.points));\n\n const {curve} = point;\n const {step} = json;\n const points = [point];\n\n for (const item of json.points)\n points.push(curve.pointFromJSON(item));\n\n return new this(step, points);\n }\n}\n\n/**\n * Blinding\n */\n\nclass Blinding {\n constructor(blind, unblind) {\n this.blind = blind;\n this.unblind = unblind;\n }\n\n toJSON() {\n return {\n blind: this.blind.toJSON(),\n unblind: this.unblind.toJSON()\n };\n }\n\n static fromJSON(point, json) {\n assert(point instanceof Point);\n assert(json && typeof json === 'object');\n\n const {curve} = point;\n const blind = BN.fromJSON(json.blind);\n const unblind = curve.pointFromJSON(json.unblind);\n\n return new this(blind, unblind);\n }\n}\n\n/**\n * Endo\n */\n\nclass Endo {\n constructor(beta, lambda, basis, pre) {\n this.beta = beta;\n this.lambda = lambda;\n this.basis = basis;\n this.pre = pre;\n }\n\n toJSON() {\n return {\n beta: this.beta.fromRed().toJSON(),\n lambda: this.lambda.toJSON(),\n basis: [\n this.basis[0].toJSON(),\n this.basis[1].toJSON()\n ],\n pre: [\n this.pre[0],\n this.pre[1].toJSON(),\n this.pre[2].toJSON()\n ]\n };\n }\n\n static fromJSON(curve, json) {\n assert(curve instanceof Curve);\n assert(json && typeof json === 'object');\n assert(Array.isArray(json.basis));\n assert(Array.isArray(json.pre));\n assert(json.basis.length === 2);\n assert(json.pre.length === 3);\n assert((json.pre[0] >>> 0) === json.pre[0]);\n\n const beta = BN.fromJSON(json.beta).toRed(curve.red);\n const lambda = BN.fromJSON(json.lambda);\n\n const basis = [\n Vector.fromJSON(json.basis[0]),\n Vector.fromJSON(json.basis[1])\n ];\n\n const pre = [\n json.pre[0],\n BN.fromJSON(json.pre[1]),\n BN.fromJSON(json.pre[2])\n ];\n\n return new this(beta, lambda, basis, pre);\n }\n}\n\n/**\n * Vector\n */\n\nclass Vector {\n constructor(a, b) {\n this.a = a;\n this.b = b;\n }\n\n toJSON() {\n return {\n a: this.a.toJSON(),\n b: this.b.toJSON()\n };\n }\n\n static fromJSON(json) {\n assert(json && typeof json === 'object');\n\n const a = BN.fromJSON(json.a);\n const b = BN.fromJSON(json.b);\n\n return new this(a, b);\n }\n}\n\n/**\n * P192\n * https://tinyurl.com/fips-186-2 (page 29)\n * https://tinyurl.com/fips-186-3 (page 88)\n */\n\nclass P192 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P192',\n ossl: 'prime192v1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'p192',\n // 2^192 - 2^64 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff ffffffff'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff fffffffc'],\n b: ['64210519 e59c80e7 0fa7e9ab 72243049',\n 'feb8deec c146b9b1'],\n n: ['ffffffff ffffffff ffffffff 99def836',\n '146bc9b1 b4d22831'],\n h: '1',\n // Icart\n z: '-5',\n g: [\n ['188da80e b03090f6 7cbf20eb 43a18800',\n 'f4ff0afd 82ff1012'],\n ['07192b95 ffc8da78 631011ed 6b24cdd5',\n '73f977a1 1e794811'],\n pre\n ]\n });\n }\n}\n\n/**\n * P224\n * https://tinyurl.com/fips-186-2 (page 30)\n * https://tinyurl.com/fips-186-3 (page 88)\n */\n\nclass P224 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P224',\n ossl: 'secp224r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'p224',\n // 2^224 - 2^96 + 1 (1 mod 16)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n '00000000 00000000 00000001'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff ffffffff fffffffe'],\n b: ['b4050a85 0c04b3ab f5413256 5044b0b7',\n 'd7bfd8ba 270b3943 2355ffb4'],\n n: ['ffffffff ffffffff ffffffff ffff16a2',\n 'e0b8f03e 13dd2945 5c5c2a3d'],\n h: '1',\n // SSWU\n z: '1f',\n g: [\n ['b70e0cbd 6bb4bf7f 321390b9 4a03c1d3',\n '56c21122 343280d6 115c1d21'],\n ['bd376388 b5f723fb 4c22dfe6 cd4375a0',\n '5a074764 44d58199 85007e34'],\n pre\n ]\n });\n }\n}\n\n/**\n * P256\n * https://tinyurl.com/fips-186-2 (page 31)\n * https://tinyurl.com/fips-186-3 (page 89)\n */\n\nclass P256 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P256',\n ossl: 'prime256v1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: null,\n // 2^256 - 2^224 + 2^192 + 2^96 - 1 (= 3 mod 4)\n p: ['ffffffff 00000001 00000000 00000000',\n '00000000 ffffffff ffffffff ffffffff'],\n // -3 mod p\n a: ['ffffffff 00000001 00000000 00000000',\n '00000000 ffffffff ffffffff fffffffc'],\n b: ['5ac635d8 aa3a93e7 b3ebbd55 769886bc',\n '651d06b0 cc53b0f6 3bce3c3e 27d2604b'],\n n: ['ffffffff 00000000 ffffffff ffffffff',\n 'bce6faad a7179e84 f3b9cac2 fc632551'],\n h: '1',\n // SSWU\n z: '-a',\n g: [\n ['6b17d1f2 e12c4247 f8bce6e5 63a440f2',\n '77037d81 2deb33a0 f4a13945 d898c296'],\n ['4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16',\n '2bce3357 6b315ece cbb64068 37bf51f5'],\n pre\n ]\n });\n }\n}\n\n/**\n * P384\n * https://tinyurl.com/fips-186-2 (page 32)\n * https://tinyurl.com/fips-186-3 (page 89)\n */\n\nclass P384 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P384',\n ossl: 'secp384r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA384',\n prime: null,\n // 2^384 - 2^128 - 2^96 + 2^32 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff 00000000 00000000 ffffffff'],\n // -3 mod p\n a: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff fffffffe',\n 'ffffffff 00000000 00000000 fffffffc'],\n b: ['b3312fa7 e23ee7e4 988e056b e3f82d19',\n '181d9c6e fe814112 0314088f 5013875a',\n 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'],\n n: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff c7634d81 f4372ddf',\n '581a0db2 48b0a77a ecec196a ccc52973'],\n h: '1',\n // Icart\n z: '-c',\n g: [\n ['aa87ca22 be8b0537 8eb1c71e f320ad74',\n '6e1d3b62 8ba79b98 59f741e0 82542a38',\n '5502f25d bf55296c 3a545e38 72760ab7'],\n ['3617de4a 96262c6f 5d9e98bf 9292dc29',\n 'f8f41dbd 289a147c e9da3113 b5f0b8c0',\n '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'],\n pre\n ]\n });\n }\n}\n\n/**\n * P521\n * https://tinyurl.com/fips-186-2 (page 33)\n * https://tinyurl.com/fips-186-3 (page 90)\n */\n\nclass P521 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'P521',\n ossl: 'secp521r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA512',\n prime: 'p521',\n // 2^521 - 1 (= 3 mod 4)\n p: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff'],\n // -3 mod p\n a: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'fffffffc'],\n b: ['00000051 953eb961 8e1c9a1f 929a21a0',\n 'b68540ee a2da725b 99b315f3 b8b48991',\n '8ef109e1 56193951 ec7e937b 1652c0bd',\n '3bb1bf07 3573df88 3d2c34f1 ef451fd4',\n '6b503f00'],\n n: ['000001ff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'fffffffa 51868783 bf2f966b 7fcc0148',\n 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e',\n '91386409'],\n h: '1',\n // SSWU\n z: '-4',\n g: [\n ['000000c6 858e06b7 0404e9cd 9e3ecb66',\n '2395b442 9c648139 053fb521 f828af60',\n '6b4d3dba a14b5e77 efe75928 fe1dc127',\n 'a2ffa8de 3348b3c1 856a429b f97e7e31',\n 'c2e5bd66'],\n ['00000118 39296a78 9a3bc004 5c8a5fb4',\n '2c7d1bd9 98f54449 579b4468 17afbd17',\n '273e662c 97ee7299 5ef42640 c550b901',\n '3fad0761 353c7086 a272c240 88be9476',\n '9fd16650'],\n pre\n ]\n });\n }\n}\n\n/**\n * SECP256K1\n * https://www.secg.org/SEC2-Ver-1.0.pdf (page 15, section 2.7.1)\n * https://www.secg.org/sec2-v2.pdf (page 9, section 2.4.1)\n */\n\nclass SECP256K1 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'SECP256K1',\n ossl: 'secp256k1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: 'k256',\n // 2^256 - 2^32 - 977 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe fffffc2f'],\n a: '0',\n b: '7',\n n: ['ffffffff ffffffff ffffffff fffffffe',\n 'baaedce6 af48a03b bfd25e8c d0364141'],\n h: '1',\n // SVDW\n z: '1',\n // sqrt(-3)\n c: ['0a2d2ba9 3507f1df 233770c2 a797962c',\n 'c61f6d15 da14ecd4 7d8d27ae 1cd5f852'],\n g: [\n ['79be667e f9dcbbac 55a06295 ce870b07',\n '029bfcdb 2dce28d9 59f2815b 16f81798'],\n ['483ada77 26a3c465 5da4fbfc 0e1108a8',\n 'fd17b448 a6855419 9c47d08f fb10d4b8'],\n pre\n ],\n // Precomputed endomorphism.\n endo: {\n beta: ['7ae96a2b 657c0710 6e64479e ac3434e9',\n '9cf04975 12f58995 c1396c28 719501ee'],\n lambda: ['5363ad4c c05c30e0 a5261c02 8812645a',\n '122e22ea 20816678 df02967c 1b23bd72'],\n basis: [\n {\n a: '3086d221a7d46bcde86c90e49284eb15',\n b: '-e4437ed6010e88286f547fa90abfe4c3'\n },\n {\n a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n b: '3086d221a7d46bcde86c90e49284eb15'\n }\n ],\n pre: [\n 384,\n ['3086d221 a7d46bcd e86c90e4 9284eb15',\n '3daa8a14 71e8ca7f e893209a 45dbb031'],\n ['-',\n 'e4437ed6 010e8828 6f547fa9 0abfe4c4',\n '221208ac 9df506c6 1571b4ae 8ac47f71']\n ]\n }\n });\n }\n}\n\n/**\n * BRAINPOOLP256\n * https://tools.ietf.org/html/rfc5639#section-3.4\n */\n\nclass BRAINPOOLP256 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP256',\n ossl: 'brainpoolP256r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA256',\n prime: null,\n // (= 3 mod 4)\n p: ['a9fb57db a1eea9bc 3e660a90 9d838d72',\n '6e3bf623 d5262028 2013481d 1f6e5377'],\n a: ['7d5a0975 fc2c3057 eef67530 417affe7',\n 'fb8055c1 26dc5c6c e94a4b44 f330b5d9'],\n b: ['26dc5c6c e94a4b44 f330b5d9 bbd77cbf',\n '95841629 5cf7e1ce 6bccdc18 ff8c07b6'],\n n: ['a9fb57db a1eea9bc 3e660a90 9d838d71',\n '8c397aa3 b561a6f7 901e0e82 974856a7'],\n h: '1',\n // Icart\n z: '-2',\n g: [\n ['8bd2aeb9 cb7e57cb 2c4b482f fc81b7af',\n 'b9de27e1 e3bd23c2 3a4453bd 9ace3262'],\n ['547ef835 c3dac4fd 97f8461a 14611dc9',\n 'c2774513 2ded8e54 5c1d54c7 2f046997'],\n pre\n ]\n });\n }\n}\n\n/**\n * BRAINPOOLP384\n * https://tools.ietf.org/html/rfc5639#section-3.6\n */\n\nclass BRAINPOOLP384 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP384',\n ossl: 'brainpoolP384r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA384',\n prime: null,\n // (= 3 mod 4)\n p: ['8cb91e82 a3386d28 0f5d6f7e 50e641df',\n '152f7109 ed5456b4 12b1da19 7fb71123',\n 'acd3a729 901d1a71 87470013 3107ec53'],\n a: ['7bc382c6 3d8c150c 3c72080a ce05afa0',\n 'c2bea28e 4fb22787 139165ef ba91f90f',\n '8aa5814a 503ad4eb 04a8c7dd 22ce2826'],\n b: ['04a8c7dd 22ce2826 8b39b554 16f0447c',\n '2fb77de1 07dcd2a6 2e880ea5 3eeb62d5',\n '7cb43902 95dbc994 3ab78696 fa504c11'],\n n: ['8cb91e82 a3386d28 0f5d6f7e 50e641df',\n '152f7109 ed5456b3 1f166e6c ac0425a7',\n 'cf3ab6af 6b7fc310 3b883202 e9046565'],\n h: '1',\n // SSWU\n z: '-5',\n g: [\n ['1d1c64f0 68cf45ff a2a63a81 b7c13f6b',\n '8847a3e7 7ef14fe3 db7fcafe 0cbd10e8',\n 'e826e034 36d646aa ef87b2e2 47d4af1e'],\n ['8abe1d75 20f9c2a4 5cb1eb8e 95cfd552',\n '62b70b29 feec5864 e19c054f f9912928',\n '0e464621 77918111 42820341 263c5315'],\n pre\n ]\n });\n }\n}\n\n/**\n * BRAINPOOLP512\n * https://tools.ietf.org/html/rfc5639#section-3.7\n */\n\nclass BRAINPOOLP512 extends ShortCurve {\n constructor(pre) {\n super({\n id: 'BRAINPOOLP512',\n ossl: 'brainpoolP512r1',\n type: 'short',\n endian: 'be',\n hash: 'SHA512',\n prime: null,\n // (= 3 mod 4)\n p: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07',\n 'cb308db3 b3c9d20e d6639cca 70330871',\n '7d4d9b00 9bc66842 aecda12a e6a380e6',\n '2881ff2f 2d82c685 28aa6056 583a48f3'],\n a: ['7830a331 8b603b89 e2327145 ac234cc5',\n '94cbdd8d 3df91610 a83441ca ea9863bc',\n '2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5',\n '7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca'],\n b: ['3df91610 a83441ca ea9863bc 2ded5d5a',\n 'a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7',\n '2bf2c7b9 e7c1ac4d 77fc94ca dc083e67',\n '984050b7 5ebae5dd 2809bd63 8016f723'],\n n: ['aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07',\n 'cb308db3 b3c9d20e d6639cca 70330870',\n '553e5c41 4ca92619 41866119 7fac1047',\n '1db1d381 085ddadd b5879682 9ca90069'],\n h: '1',\n // Icart\n z: '7',\n g: [\n ['81aee4bd d82ed964 5a21322e 9c4c6a93',\n '85ed9f70 b5d916c1 b43b62ee f4d0098e',\n 'ff3b1f78 e2d0d48d 50d1687b 93b97d5f',\n '7c6d5047 406a5e68 8b352209 bcb9f822'],\n ['7dde385d 566332ec c0eabfa9 cf7822fd',\n 'f209f700 24a57b1a a000c55b 881f8111',\n 'b2dcde49 4a5f485e 5bca4bd8 8a2763ae',\n 'd1ca2b2f a8f05406 78cd1e0f 3ad80892'],\n pre\n ]\n });\n }\n}\n\n/**\n * X25519\n * https://tools.ietf.org/html/rfc7748#section-4.1\n */\n\nclass X25519 extends MontCurve {\n constructor() {\n super({\n id: 'X25519',\n ossl: 'X25519',\n type: 'mont',\n endian: 'le',\n hash: 'SHA512',\n prime: 'p25519',\n // 2^255 - 19 (= 5 mod 8)\n p: ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffed'],\n // 486662\n a: '76d06',\n b: '1',\n n: ['10000000 00000000 00000000 00000000',\n '14def9de a2f79cd6 5812631a 5cf5d3ed'],\n h: '8',\n // Elligator 2\n z: '2',\n g: [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000009'],\n // See: https://www.rfc-editor.org/errata/eid4730\n ['5f51e65e 475f794b 1fe122d3 88b72eb3',\n '6dc2b281 92839e4d d6163a5d 81312c14']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001'],\n ['6be4f497 f9a9c2af c21fa77a d7f4a6ef',\n '635a11c7 284a9363 e9a248ef 9c884415']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001'],\n ['141b0b68 06563d50 3de05885 280b5910',\n '9ca5ee38 d7b56c9c 165db710 6377bbd8']\n ],\n [\n ['57119fd0 dd4e22d8 868e1c58 c45c4404',\n '5bef839c 55b1d0b1 248c50a3 bc959c5f'],\n ['68c59389 3d458e64 31c6ca00 45fb5015',\n '20a44346 8eaa68dd 0f103842 048065b7']\n ],\n [\n ['57119fd0 dd4e22d8 868e1c58 c45c4404',\n '5bef839c 55b1d0b1 248c50a3 bc959c5f'],\n ['173a6c76 c2ba719b ce3935ff ba04afea',\n 'df5bbcb9 71559722 f0efc7bd fb7f9a36']\n ],\n [\n ['00b8495f 16056286 fdb1329c eb8d09da',\n '6ac49ff1 fae35616 aeb8413b 7c7aebe0'],\n ['3931c129 569e83a5 29482c14 e628b457',\n '933bfc29 ed801b4d 68871483 92507b1a']\n ],\n [\n ['00b8495f 16056286 fdb1329c eb8d09da',\n '6ac49ff1 fae35616 aeb8413b 7c7aebe0'],\n ['46ce3ed6 a9617c5a d6b7d3eb 19d74ba8',\n '6cc403d6 127fe4b2 9778eb7c 6daf84d3']\n ]\n ]\n });\n }\n}\n\n/**\n * X448\n * https://tools.ietf.org/html/rfc7748#section-4.2\n */\n\nclass X448 extends MontCurve {\n constructor() {\n super({\n id: 'X448',\n ossl: 'X448',\n type: 'mont',\n endian: 'le',\n hash: 'SHAKE256',\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n // 156326\n a: '262a6',\n b: '1',\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000005'],\n ['7d235d12 95f5b1f6 6c98ab6e 58326fce',\n 'cbae5d34 f55545d0 60f75dc2 8df3f6ed',\n 'b8027e23 46430d21 1312c4b1 50677af7',\n '6fd7223d 457b5b1a']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['ba4d3a08 29b6112f 8812e51b a0bb2abe',\n 'bc1cb08e b48e5569 36ba50fd d2e7d68a',\n 'f8cb3216 0522425b 3f990812 abbe635a',\n 'd37a21e1 7551b193']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['45b2c5f7 d649eed0 77ed1ae4 5f44d541',\n '43e34f71 4b71aa96 c945af01 2d182975',\n '0734cde9 faddbda4 c066f7ed 54419ca5',\n '2c85de1e 8aae4e6c']\n ]\n ]\n });\n }\n}\n\n/**\n * MONT448\n * Isomorphic to Ed448-Goldilocks.\n */\n\nclass MONT448 extends MontCurve {\n constructor() {\n super({\n id: 'MONT448',\n ossl: null,\n type: 'mont',\n endian: 'le',\n hash: 'SHAKE256',\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n // -78160 / -39082 mod p\n a: ['b2cf97d2 d43459a9 31ed36b1 fc4e3cb5',\n '5d93f8d2 22746997 60ccffc6 49961ed6',\n 'c5b05fca c24864ed 6fb59697 931b78da',\n '84ddecd8 ca2b5cfb'],\n b: '1',\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['ac0d24cc c6c75cb0 eb71f81e 7a6edf51',\n '48e88aee 009a2a24 e795687e c28e125a',\n '3e6730a6 0d46367b aa7fe99d 152128dc',\n '41321bc7 7817f059'],\n ['5a4437f6 80c0d0db 9b061276 d5d0ffcc',\n 'e786ff33 b6a53d30 98746425 82e66f09',\n '4433dae7 7244a6e2 6b11e905 7228f483',\n '556c41a5 913f55fe']\n ],\n torsion: [\n [],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['bec92fd0 6da2acf2 b4e261e8 7cef0d34',\n '22e75c18 3c589857 b71924e5 73c2f9ce',\n 'e18da5f2 466e2f39 3c2eedf0 f105a60a',\n 'b40c717d 4f1e1fd7']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['4136d02f 925d530d 4b1d9e17 8310f2cb',\n 'dd18a3e7 c3a767a8 48e6db19 8c3d0631',\n '1e725a0d b991d0c6 c3d1120f 0efa59f5',\n '4bf38e82 b0e1e028']\n ]\n ]\n });\n }\n}\n\n/**\n * ED25519\n * https://tools.ietf.org/html/rfc8032#section-5.1\n */\n\nclass ED25519 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ED25519',\n ossl: 'ED25519',\n type: 'edwards',\n endian: 'le',\n hash: 'SHA512',\n prefix: 'SigEd25519 no Ed25519 collisions',\n context: false,\n prime: 'p25519',\n // 2^255 - 19 (= 5 mod 8)\n p: ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffed'],\n a: '-1',\n // -121665 / 121666 mod p\n d: ['52036cee 2b6ffe73 8cc74079 7779e898',\n '00700a4d 4141d8ab 75eb4dca 135978a3'],\n n: ['10000000 00000000 00000000 00000000',\n '14def9de a2f79cd6 5812631a 5cf5d3ed'],\n h: '8',\n // Elligator 2\n z: '2',\n g: [\n ['216936d3 cd6e53fe c0a4e231 fdd6dc5c',\n '692cc760 9525a7b2 c9562d60 8f25d51a'],\n // 4/5\n ['66666666 66666666 66666666 66666666',\n '66666666 66666666 66666666 66666658'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000'],\n ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff ffffffec']\n ],\n [\n ['2b832480 4fc1df0b 2b4d0099 3dfbd7a7',\n '2f431806 ad2fe478 c4ee1b27 4a0ea0b0'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['547cdb7f b03e20f4 d4b2ff66 c2042858',\n 'd0bce7f9 52d01b87 3b11e4d8 b5f15f3d'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000']\n ],\n [\n ['1fd5b9a0 06394a28 e9339932 38de4abb',\n '5c193c70 13e5e238 dea14646 c545d14a'],\n ['05fc536d 880238b1 3933c6d3 05acdfd5',\n 'f098eff2 89f4c345 b027b2c2 8f95e826']\n ],\n [\n ['602a465f f9c6b5d7 16cc66cd c721b544',\n 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'],\n ['05fc536d 880238b1 3933c6d3 05acdfd5',\n 'f098eff2 89f4c345 b027b2c2 8f95e826']\n ],\n [\n ['1fd5b9a0 06394a28 e9339932 38de4abb',\n '5c193c70 13e5e238 dea14646 c545d14a'],\n ['7a03ac92 77fdc74e c6cc392c fa53202a',\n '0f67100d 760b3cba 4fd84d3d 706a17c7']\n ],\n [\n ['602a465f f9c6b5d7 16cc66cd c721b544',\n 'a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3'],\n ['7a03ac92 77fdc74e c6cc392c fa53202a',\n '0f67100d 760b3cba 4fd84d3d 706a17c7']\n ]\n ]\n });\n }\n}\n\n/**\n * ISO448\n * https://tools.ietf.org/html/rfc7748#section-4.2\n * https://git.zx2c4.com/goldilocks/tree/_aux/ristretto/ristretto.sage#n658\n */\n\nclass ISO448 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ISO448',\n ossl: null,\n type: 'edwards',\n endian: 'le',\n hash: 'SHAKE256',\n prefix: 'SigEd448',\n context: true,\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n a: '1',\n // 39082 / 39081 mod p\n d: ['d78b4bdc 7f0daf19 f24f38c2 9373a2cc',\n 'ad461572 42a50f37 809b1da3 412a12e7',\n '9ccc9c81 264cfe9a d0809970 58fb61c4',\n '243cc32d baa156b9'],\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['79a70b2b 70400553 ae7c9df4 16c792c6',\n '1128751a c9296924 0c25a07d 728bdc93',\n 'e21f7787 ed697224 9de732f3 8496cd11',\n '69871309 3e9c04fc'],\n // Note: the RFC has this wrong.\n ['7fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 80000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ]\n ]\n });\n }\n}\n\n/**\n * ED448\n * https://tools.ietf.org/html/rfc8032#section-5.2\n */\n\nclass ED448 extends EdwardsCurve {\n constructor(pre) {\n super({\n id: 'ED448',\n ossl: 'ED448',\n type: 'edwards',\n endian: 'le',\n hash: 'SHAKE256',\n prefix: 'SigEd448',\n context: true,\n prime: 'p448',\n // 2^448 - 2^224 - 1 (= 3 mod 4)\n p: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff'],\n a: '1',\n // -39081 mod p\n d: ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffff6756'],\n n: ['3fffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff ffffffff 7cca23e9',\n 'c44edb49 aed63690 216cc272 8dc58f55',\n '2378c292 ab5844f3'],\n h: '4',\n // Elligator 2\n z: '-1',\n g: [\n ['4f1970c6 6bed0ded 221d15a6 22bf36da',\n '9e146570 470f1767 ea6de324 a3d3a464',\n '12ae1af7 2ab66511 433b80e1 8b00938e',\n '2626a82b c70cc05e'],\n ['693f4671 6eb6bc24 88762037 56c9c762',\n '4bea7373 6ca39840 87789c1e 05a0c2d7',\n '3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad',\n '9808795b f230fa14'],\n pre\n ],\n torsion: [\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000'],\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe']\n ],\n [\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000001'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ],\n [\n ['ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff ffffffff fffffffe ffffffff',\n 'ffffffff ffffffff ffffffff ffffffff',\n 'ffffffff fffffffe'],\n ['00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000 00000000 00000000',\n '00000000 00000000']\n ]\n ]\n });\n }\n}\n\n/*\n * Curve Registry\n */\n\nconst curves = {\n __proto__: null,\n P192,\n P224,\n P256,\n P384,\n P521,\n SECP256K1,\n BRAINPOOLP256,\n BRAINPOOLP384,\n BRAINPOOLP512,\n X25519,\n X448,\n MONT448,\n ED25519,\n ISO448,\n ED448\n};\n\nconst cache = {\n __proto__: null,\n P192: null,\n P224: null,\n P256: null,\n P384: null,\n P521: null,\n SECP256K1: null,\n BRAINPOOLP256: null,\n BRAINPOOLP384: null,\n BRAINPOOLP512: null,\n X25519: null,\n X448: null,\n MONT448: null,\n ED25519: null,\n ISO448: null,\n ED448: null\n};\n\nfunction curve(name, ...args) {\n assert(typeof name === 'string');\n\n const key = name.toUpperCase();\n\n let curve = cache[key];\n\n if (!curve) {\n const Curve = curves[key];\n\n if (!Curve)\n throw new Error(`Curve not found: \"${name}\".`);\n\n curve = new Curve(...args);\n cache[key] = curve;\n }\n\n return curve;\n}\n\nfunction register(name, Curve) {\n assert(typeof name === 'string');\n assert(typeof Curve === 'function');\n\n const key = name.toUpperCase();\n\n if (curves[key])\n throw new Error(`Curve already registered: \"${name}\".`);\n\n curves[key] = Curve;\n cache[key] = null;\n}\n\n/*\n * Scalar Recoding\n */\n\nfunction getNAF(k, width, max) {\n // Computing the width-w NAF of a positive integer.\n //\n // [GECC] Algorithm 3.35, Page 100, Section 3.3.\n //\n // The above document describes a rather abstract\n // method of recoding. The more optimal method\n // below was ported from libsecp256k1.\n assert(k instanceof BN);\n assert(!k.red);\n assert((width >>> 0) === width);\n assert((max >>> 0) === max);\n\n const naf = new Array(max);\n const bits = k.bitLength() + 1;\n const sign = k.sign() | 1;\n\n assert(bits <= max);\n\n for (let i = 0; i < max; i++)\n naf[i] = 0;\n\n let i = 0;\n let carry = 0;\n let word;\n\n while (i < bits) {\n if (k.bit(i) === carry) {\n i += 1;\n continue;\n }\n\n word = k.bits(i, width) + carry;\n carry = (word >> (width - 1)) & 1;\n word -= carry << width;\n\n naf[i] = sign * word;\n\n i += width;\n }\n\n assert(carry === 0);\n\n return naf;\n}\n\nfunction getFixedNAF(k, width, max, step) {\n assert((step >>> 0) === step);\n\n // Recode to NAF.\n const naf = getNAF(k, width, max);\n\n // Translate into more windowed form.\n const len = Math.ceil(naf.length / step);\n const repr = new Array(len);\n\n let i = 0;\n\n for (let j = 0; j < naf.length; j += step) {\n let nafW = 0;\n\n for (let k = j + step - 1; k >= j; k--)\n nafW = (nafW << 1) + naf[k];\n\n repr[i++] = nafW;\n }\n\n assert(i === len);\n\n return repr;\n}\n\nfunction getJSF(k1, k2, max) {\n // Joint sparse form.\n //\n // [GECC] Algorithm 3.50, Page 111, Section 3.3.\n assert(k1 instanceof BN);\n assert(k2 instanceof BN);\n assert(!k1.red);\n assert(!k2.red);\n assert((max >>> 0) === max);\n\n const jsf = [new Array(max), new Array(max)];\n const bits = Math.max(k1.bitLength(), k2.bitLength()) + 1;\n const s1 = k1.sign() | 1;\n const s2 = k2.sign() | 1;\n\n assert(bits <= max);\n\n let d1 = 0;\n let d2 = 0;\n\n for (let i = 0; i < bits; i++) {\n const b1 = k1.bits(i, 3);\n const b2 = k2.bits(i, 3);\n\n // First phase.\n let m14 = ((b1 & 3) + d1) & 3;\n let m24 = ((b2 & 3) + d2) & 3;\n let u1 = 0;\n let u2 = 0;\n\n if (m14 === 3)\n m14 = -1;\n\n if (m24 === 3)\n m24 = -1;\n\n if (m14 & 1) {\n const m8 = ((b1 & 7) + d1) & 7;\n\n if ((m8 === 3 || m8 === 5) && m24 === 2)\n u1 = -m14;\n else\n u1 = m14;\n }\n\n if (m24 & 1) {\n const m8 = ((b2 & 7) + d2) & 7;\n\n if ((m8 === 3 || m8 === 5) && m14 === 2)\n u2 = -m24;\n else\n u2 = m24;\n }\n\n jsf[0][i] = u1 * s1;\n jsf[1][i] = u2 * s2;\n\n // Second phase.\n if (2 * d1 === 1 + u1)\n d1 = 1 - d1;\n\n if (2 * d2 === 1 + u2)\n d2 = 1 - d2;\n }\n\n for (let i = bits; i < max; i++) {\n jsf[0][i] = 0;\n jsf[1][i] = 0;\n }\n\n return jsf;\n}\n\nfunction getJNAF(c1, c2, max) {\n const jsf = getJSF(c1, c2, max);\n const naf = new Array(max);\n\n // JSF -> NAF conversion.\n for (let i = 0; i < max; i++) {\n const ja = jsf[0][i];\n const jb = jsf[1][i];\n\n naf[i] = jsfIndex[(ja + 1) * 3 + (jb + 1)];\n }\n\n return naf;\n}\n\n/*\n * Helpers\n */\n\nfunction assert(val, msg) {\n if (!val) {\n const err = new Error(msg || 'Assertion failed');\n\n if (Error.captureStackTrace)\n Error.captureStackTrace(err, assert);\n\n throw err;\n }\n}\n\nfunction wrapErrors(fn) {\n assert(typeof fn === 'function');\n\n try {\n return fn();\n } catch (e) {\n if (e.message === 'X is not a square mod P.'\n || e.message === 'Not invertible.') {\n throw new Error('Invalid point.');\n }\n throw e;\n }\n}\n\nfunction mod(x, y) {\n // Euclidean modulo.\n let r = x % y;\n\n if (r < 0) {\n if (y < 0)\n r -= y;\n else\n r += y;\n }\n\n return r;\n}\n\nfunction cubeRoot(x) {\n assert(x instanceof BN);\n assert(x.red);\n\n const p = x.red.m;\n\n if (p.cmpn(3) <= 0)\n return x.clone();\n\n // p = 2 mod 3\n if (p.modrn(3) === 2) {\n // e = (2 * p - 1) / 3\n const e = p.ushln(1).isubn(1).idivn(3);\n return x.redPow(e);\n }\n\n const mod9 = p.modrn(9);\n\n // p = 4 mod 9\n if (mod9 === 4) {\n // e = (2 * p + 1) / 9\n const e = p.ushln(1).iaddn(1).idivn(9);\n const r = x.redPow(e);\n const c = r.redSqr().redMul(r);\n\n if (!c.eq(x))\n throw new Error('X is not a cube mod P.');\n\n return r;\n }\n\n // p = 7 mod 9\n if (mod9 === 7) {\n // e = (p + 2) / 9\n const e = p.addn(2).idivn(9);\n const r = x.redPow(e);\n const c = r.redSqr().redMul(r);\n\n if (!c.eq(x))\n throw new Error('X is not a cube mod P.');\n\n return r;\n }\n\n throw new Error('Not implemented.');\n}\n\nfunction cubeRoots(x) {\n const r0 = cubeRoot(x);\n\n // p = 1 mod 3\n if (x.red.m.modrn(3) === 1) {\n // Multiply by roots of unity to find other roots.\n const two = new BN(2).toRed(x.red);\n const three = new BN(3).toRed(x.red);\n const i2 = two.redInvert();\n const s1 = three.redNeg().redSqrt().redMul(i2);\n const s2 = s1.redNeg();\n const u1 = s1.redSub(i2);\n const u2 = s2.redSub(i2);\n const r1 = r0.redMul(u1);\n const r2 = r0.redMul(u2);\n\n return [r0, r1, r2];\n }\n\n // p = 2 mod 3 guarantees 1 cube root per element.\n return [r0];\n}\n\nfunction uncube(x) {\n // Find a cube root which is also a quadratic residue.\n for (const root of cubeRoots(x)) {\n if (root.redJacobi() >= 0)\n return root;\n }\n\n throw new Error('X^(1/3) is not a square mod P.');\n}\n\nfunction randomInt(rng) {\n return BN.randomBits(rng, 32).toNumber();\n}\n\nfunction memoize(method, self) {\n const cache = new WeakMap();\n\n return function memoized(curve, invert) {\n const i = invert & 1;\n const item = cache.get(curve);\n\n if (item && item[i] !== null)\n return item[i];\n\n const result = method.call(self, curve, invert);\n\n if (!cache.has(curve))\n cache.set(curve, [null, null]);\n\n cache.get(curve)[i] = result;\n\n return result;\n };\n}\n\nfunction toPretty(x, size) {\n assert(x instanceof BN);\n assert((size >>> 0) === size);\n\n if (size & 7)\n size += 8 - (size & 7);\n\n const str = x.toString(16, size);\n const chunks = [];\n const out = [];\n\n assert((str.length & 7) === 0);\n\n for (let i = 0; i < str.length; i += 8)\n chunks.push(str.slice(i, i + 8));\n\n for (let i = 0; i < chunks.length; i += 4)\n out.push(chunks.slice(i, i + 4).join(' '));\n\n return out;\n}\n\n/*\n * Expose\n */\n\nexports.Curve = Curve;\nexports.Point = Point;\nexports.ShortCurve = ShortCurve;\nexports.ShortPoint = ShortPoint;\nexports.JPoint = JPoint;\nexports.MontCurve = MontCurve;\nexports.MontPoint = MontPoint;\nexports.XPoint = XPoint;\nexports.EdwardsCurve = EdwardsCurve;\nexports.EdwardsPoint = EdwardsPoint;\nexports.curves = curves;\nexports.curve = curve;\nexports.register = register;\n","/*!\n * random.js - random number generator for bcrypto\n * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://wiki.openssl.org/index.php/Random_Numbers\n * https://csrc.nist.gov/projects/random-bit-generation/\n * http://www.pcg-random.org/posts/bounded-rands.html\n * https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\n\n/*\n * Constants\n */\n\nconst crypto = global.crypto || global.msCrypto;\nconst HAS_CRYPTO = crypto && typeof crypto.getRandomValues === 'function';\nconst randomValues = HAS_CRYPTO ? crypto.getRandomValues.bind(crypto) : null;\nconst pool = new Uint32Array(16);\nconst MAX_BYTES = 65536;\n\nlet poolPos = 0;\n\n/**\n * Generate pseudo-random bytes.\n * @param {Number} size\n * @returns {Buffer}\n */\n\nfunction randomBytes(size) {\n assert((size >>> 0) === size);\n\n const data = Buffer.alloc(size);\n\n randomFillSync(data, 0, size);\n\n return data;\n}\n\n/**\n * Generate pseudo-random bytes.\n * @param {Buffer} data\n * @param {Number} [off=0]\n * @param {Number} [size=data.length-off]\n * @returns {Buffer}\n */\n\nfunction randomFill(data, off, size) {\n assert(Buffer.isBuffer(data));\n\n if (off == null)\n off = 0;\n\n assert((off >>> 0) === off);\n\n if (size == null)\n size = data.length - off;\n\n assert((size >>> 0) === size);\n assert(off + size <= data.length);\n\n randomFillSync(data, off, size);\n\n return data;\n}\n\n/**\n * Generate a random uint32.\n * @returns {Number}\n */\n\nfunction randomInt() {\n if ((poolPos & 15) === 0) {\n getRandomValues(pool);\n poolPos = 0;\n }\n\n return pool[poolPos++];\n}\n\n/**\n * Generate a random uint32 within a range.\n * @param {Number} min - Inclusive.\n * @param {Number} max - Exclusive.\n * @returns {Number}\n */\n\nfunction randomRange(min, max) {\n assert((min >>> 0) === min);\n assert((max >>> 0) === max);\n assert(max >= min);\n\n const space = max - min;\n\n if (space === 0)\n return min;\n\n const top = -space >>> 0;\n\n let x, r;\n\n do {\n x = randomInt();\n r = x % space;\n } while (x - r > top);\n\n return r + min;\n}\n\n/*\n * Helpers\n */\n\nfunction getRandomValues(array) {\n if (!HAS_CRYPTO)\n throw new Error('Entropy source not available.');\n\n return randomValues(array);\n}\n\nfunction randomFillSync(data, off, size) {\n assert(Buffer.isBuffer(data));\n assert(data.buffer instanceof ArrayBuffer);\n assert((data.byteOffset >>> 0) === data.byteOffset);\n assert((data.byteLength >>> 0) === data.byteLength);\n assert((off >>> 0) === off);\n assert((size >>> 0) === size);\n assert(off + size <= data.byteLength);\n\n if (size > 2 ** 31 - 1)\n throw new RangeError('The value \"size\" is out of range.');\n\n const offset = data.byteOffset + off;\n const array = new Uint8Array(data.buffer, offset, size);\n\n if (array.length > MAX_BYTES) {\n for (let i = 0; i < array.length; i += MAX_BYTES) {\n let j = i + MAX_BYTES;\n\n if (j > array.length)\n j = array.length;\n\n getRandomValues(array.subarray(i, j));\n }\n } else {\n if (array.length > 0)\n getRandomValues(array);\n }\n}\n\n/*\n * Expose\n */\n\nexports.native = 0;\nexports.randomBytes = randomBytes;\nexports.randomFill = randomFill;\nexports.randomInt = randomInt;\nexports.randomRange = randomRange;\n","/*!\n * random.js - random for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/random');\n","/*!\n * eddsa.js - EdDSA for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on indutny/elliptic:\n * Copyright (c) 2014, Fedor Indutny (MIT License).\n * https://github.com/indutny/elliptic\n *\n * References:\n *\n * [EDDSA] High-speed high-security signatures\n * D. J. Bernstein, N. Duif, T. Lange, P. Schwabe, B. Yang\n * https://ed25519.cr.yp.to/ed25519-20110926.pdf\n *\n * [RFC8032] Edwards-Curve Digital Signature Algorithm (EdDSA)\n * S. Josefsson, I. Liusvaara\n * https://tools.ietf.org/html/rfc8032\n *\n * Implementation Notes:\n *\n * - In contrast to the ECDSA backend, we allow points at\n * infinity (in all functions).\n *\n * - Mike Hamburg's Ed448-Goldilocks rejects both infinity as\n * well as the torsion point (0, -1). We do not replicate\n * this behavior.\n *\n * - For Ed25519, we do \"cofactor-less\" verification by default.\n * This means torsion components will affect the result of the\n * verification.\n *\n * - For Ed448, we do cofactor verification by default to mimic\n * OpenSSL and Mike Hamburg's Ed448-Goldilocks implementation.\n *\n * - `verifySingle`/`verifyBatch` do cofactor verification. Do\n * not use `verifyBatch` expecting the same results as the\n * regular `verify` call[1]. This will not be the case for\n * Ed25519.\n *\n * - All functions are completely unaware of points of small\n * order and torsion components (in other words, points will\n * not be explicitly checked for this, anywhere).\n *\n * - `deriveWithScalar` and `exchangeWithScalar` automatically\n * clamp scalars before multiplying (meaning torsion components\n * are removed from the result and points of small order will\n * be normalized to infinity).\n *\n * - The HD function, `publicKeyTweakMul`, _does not_ clamp\n * automatically. It is possible to end up with a torsion\n * component in the resulting point (assuming the input\n * point had one).\n *\n * - Ed448-Goldilocks is 4-isogenous to Curve448. This means\n * that when converting to Curve448, small order points will\n * be normalized to (0, 0). When converting back to Ed448,\n * any small order points will be normalized to infinity,\n * and any torsion components will be removed completely.\n * Also note that when converting back, the implementation\n * needs to divide the point by 4. This is a major perf hit,\n * so treat `x448.publicKeyConvert` as if it were a point\n * multiplication.\n *\n * - Elligators should not be used with Edwards curves. As\n * Tibouchi notes[2], regular public keys will map to\n * _distinguishable_ field elements as they are always in\n * the primary subgroup. Either the Ristretto Elligator[3],\n * or a prime order curve with an Elligator Squared[2]\n * construction are suitable alternatives here.\n *\n * - These notes also spell out why you should avoid using\n * Edwards curves on a blockchain[4].\n *\n * [1] https://moderncrypto.org/mail-archive/curves/2016/000836.html\n * [2] https://eprint.iacr.org/2014/043.pdf\n * [3] https://ristretto.group/formulas/elligator.html\n * [4] https://src.getmonero.org/2017/05/17/disclosure-of-a-major-bug-in-cryptonote-based-currencies.html\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst BatchRNG = require('./batch-rng');\nconst BN = require('../bn');\nconst elliptic = require('./elliptic');\nconst rng = require('../random');\n\n/*\n * EDDSA\n */\n\nclass EDDSA {\n constructor(id, mid, eid, hash, pre) {\n assert(typeof id === 'string');\n assert(!mid || typeof mid === 'string');\n assert(!eid || typeof eid === 'string');\n assert(hash);\n\n this.id = id;\n this.type = 'eddsa';\n this.mid = mid || null;\n this.eid = eid || null;\n this.hash = hash;\n this.native = 0;\n\n this._pre = pre || null;\n this._curve = null;\n this._mont = null;\n this._iso = null;\n this._rng = null;\n }\n\n get curve() {\n if (!this._curve) {\n this._curve = elliptic.curve(this.id, this._pre);\n this._curve.precompute(rng);\n this._pre = null;\n }\n return this._curve;\n }\n\n get mont() {\n if (this.mid && !this._mont)\n this._mont = elliptic.curve(this.mid);\n return this._mont;\n }\n\n get iso() {\n if (!this.eid)\n return this.mont;\n\n if (!this._iso)\n this._iso = elliptic.curve(this.eid);\n\n return this._iso;\n }\n\n get rng() {\n if (!this._rng)\n this._rng = new BatchRNG(this.curve);\n\n return this._rng;\n }\n\n get size() {\n return this.curve.adjustedSize;\n }\n\n get bits() {\n return this.curve.fieldBits;\n }\n\n hashNonce(prefix, msg, ph, ctx) {\n const hash = new Hash(this);\n\n hash.init(ph, ctx);\n hash.update(prefix);\n hash.update(msg);\n\n return hash.final();\n }\n\n hashChallenge(R, A, m, ph, ctx) {\n const hash = new Hash(this);\n\n hash.init(ph, ctx);\n hash.update(R);\n hash.update(A);\n hash.update(m);\n\n return hash.final();\n }\n\n privateKeyGenerate() {\n return rng.randomBytes(this.curve.adjustedSize);\n }\n\n scalarGenerate() {\n const scalar = rng.randomBytes(this.curve.scalarSize);\n return this.curve.clamp(scalar);\n }\n\n privateKeyExpand(secret) {\n assert(Buffer.isBuffer(secret));\n assert(secret.length === this.curve.adjustedSize);\n\n const hash = this.hash.digest(secret, this.curve.adjustedSize * 2);\n\n return this.curve.splitHash(hash);\n }\n\n privateKeyConvert(secret) {\n const [key] = this.privateKeyExpand(secret);\n return key;\n }\n\n privateKeyVerify(secret) {\n assert(Buffer.isBuffer(secret));\n return secret.length === this.curve.adjustedSize;\n }\n\n scalarVerify(scalar) {\n assert(Buffer.isBuffer(scalar));\n return scalar.length === this.curve.scalarSize;\n }\n\n scalarIsZero(scalar) {\n assert(Buffer.isBuffer(scalar));\n\n let k;\n try {\n k = this.curve.decodeScalar(scalar).imod(this.curve.n);\n } catch (e) {\n return false;\n }\n\n return k.isZero();\n }\n\n scalarClamp(scalar) {\n assert(Buffer.isBuffer(scalar));\n assert(scalar.length === this.curve.scalarSize);\n\n return this.curve.clamp(Buffer.from(scalar));\n }\n\n privateKeyExport(secret) {\n const pub = this.publicKeyCreate(secret);\n const {x, y} = this.publicKeyExport(pub);\n\n return {\n d: Buffer.from(secret),\n x,\n y\n };\n }\n\n privateKeyImport(json) {\n assert(json && typeof json === 'object');\n assert(Buffer.isBuffer(json.d));\n\n if (json.d.length !== this.curve.adjustedSize)\n throw new Error('Invalid private key.');\n\n return Buffer.from(json.d);\n }\n\n scalarTweakAdd(scalar, tweak) {\n const a = this.curve.decodeScalar(scalar);\n const t = this.curve.decodeScalar(tweak);\n const k = a.add(t).imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarTweakMul(scalar, tweak) {\n const a = this.curve.decodeScalar(scalar);\n const t = this.curve.decodeScalar(tweak);\n const k = a.mul(t).imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarReduce(scalar) {\n const a = this.curve.decodeScalar(scalar);\n const k = a.imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarNegate(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n const k = a.neg().imod(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n scalarInvert(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n\n if (a.isZero())\n return this.curve.encodeScalar(a);\n\n const k = a.invert(this.curve.n);\n\n return this.curve.encodeScalar(k);\n }\n\n publicKeyCreate(secret) {\n const key = this.privateKeyConvert(secret);\n return this.publicKeyFromScalar(key);\n }\n\n publicKeyFromScalar(scalar) {\n const a = this.curve.decodeScalar(scalar).imod(this.curve.n);\n const A = this.curve.g.mulBlind(a);\n\n return A.encode();\n }\n\n publicKeyConvert(key) {\n if (!this.mont)\n throw new Error('No equivalent montgomery curve.');\n\n const A = this.curve.decodePoint(key);\n const P = this.mont.pointFromEdwards(A);\n\n return P.encode();\n }\n\n publicKeyFromUniform(bytes) {\n const u = this.curve.decodeUniform(bytes);\n const A = this.curve.pointFromUniform(u, this.iso);\n\n return A.encode();\n }\n\n publicKeyToUniform(key, hint = rng.randomInt()) {\n const A = this.curve.decodePoint(key);\n const u = this.curve.pointToUniform(A, hint, this.iso);\n\n return this.curve.encodeUniform(u, hint >>> 8);\n }\n\n publicKeyFromHash(bytes, pake = false) {\n const A = this.curve.pointFromHash(bytes, pake, this.iso);\n return A.encode();\n }\n\n publicKeyToHash(key, subgroup = rng.randomInt()) {\n const A = this.curve.decodePoint(key);\n return this.curve.pointToHash(A, subgroup, rng, this.iso);\n }\n\n publicKeyVerify(key) {\n assert(Buffer.isBuffer(key));\n\n try {\n this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return true;\n }\n\n publicKeyIsInfinity(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.isInfinity();\n }\n\n publicKeyIsSmall(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.isSmall();\n }\n\n publicKeyHasTorsion(key) {\n assert(Buffer.isBuffer(key));\n\n let A;\n try {\n A = this.curve.decodePoint(key);\n } catch (e) {\n return false;\n }\n\n return A.hasTorsion();\n }\n\n publicKeyExport(key) {\n const {x, y} = this.curve.decodePoint(key);\n\n return {\n x: this.curve.encodeField(x.fromRed()),\n y: this.curve.encodeField(y.fromRed())\n };\n }\n\n publicKeyImport(json) {\n assert(json && typeof json === 'object');\n\n let x = null;\n let y = null;\n let A;\n\n if (json.x != null) {\n x = BN.decode(json.x, this.curve.endian);\n\n if (x.cmp(this.curve.p) >= 0)\n throw new Error('Invalid point.');\n }\n\n if (json.y != null) {\n y = BN.decode(json.y, this.curve.endian);\n\n if (y.cmp(this.curve.p) >= 0)\n throw new Error('Invalid point.');\n }\n\n if (x && y) {\n A = this.curve.point(x, y);\n\n if (!A.validate())\n throw new Error('Invalid point.');\n } else if (x) {\n A = this.curve.pointFromX(x, json.sign);\n } else if (y) {\n A = this.curve.pointFromY(y, json.sign);\n } else {\n throw new Error('Invalid point.');\n }\n\n return A.encode();\n }\n\n publicKeyTweakAdd(key, tweak) {\n const t = this.curve.decodeScalar(tweak).imod(this.curve.n);\n const A = this.curve.decodePoint(key);\n const T = this.curve.g.mul(t);\n const P = T.add(A);\n\n return P.encode();\n }\n\n publicKeyTweakMul(key, tweak) {\n const t = this.curve.decodeScalar(tweak);\n const A = this.curve.decodePoint(key);\n const P = A.mul(t);\n\n return P.encode();\n }\n\n publicKeyCombine(keys) {\n assert(Array.isArray(keys));\n\n let P = this.curve.point();\n\n for (const key of keys) {\n const A = this.curve.decodePoint(key);\n\n P = P.add(A);\n }\n\n return P.encode();\n }\n\n publicKeyNegate(key) {\n const A = this.curve.decodePoint(key);\n const P = A.neg();\n\n return P.encode();\n }\n\n sign(msg, secret, ph, ctx) {\n const [key, prefix] = this.privateKeyExpand(secret);\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n signWithScalar(msg, scalar, prefix, ph, ctx) {\n // EdDSA Signing.\n //\n // [EDDSA] Page 12, Section 4.\n // [RFC8032] Page 8, Section 3.3.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `a` be a secret scalar.\n // - Let `w` be a secret byte array.\n //\n // Computation:\n //\n // k = H(w, m) mod n\n // R = G * k\n // A = G * a\n // e = H(R, A, m) mod n\n // s = (k + e * a) mod n\n // S = (R, s)\n //\n // Note that `k` must remain secret,\n // otherwise an attacker can compute:\n //\n // a = (s - k) / e mod n\n //\n // The same is true of `w` as `k`\n // can be re-derived as `H(w, m)`.\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(prefix));\n assert(prefix.length === this.curve.adjustedSize);\n\n const {n} = this.curve;\n const G = this.curve.g;\n const k = this.hashNonce(prefix, msg, ph, ctx);\n const Rraw = G.mulBlind(k).encode();\n const a = this.curve.decodeScalar(scalar);\n const Araw = G.mulBlind(a).encode();\n const e = this.hashChallenge(Rraw, Araw, msg, ph, ctx);\n const s = k.add(e.mul(a)).imod(n);\n\n return Buffer.concat([Rraw, this.curve.encodeAdjusted(s)]);\n }\n\n signTweakAdd(msg, secret, tweak, ph, ctx) {\n const [key_, prefix_] = this.privateKeyExpand(secret);\n const key = this.scalarTweakAdd(key_, tweak);\n const expanded = this.hash.multi(prefix_, tweak, null,\n this.curve.adjustedSize * 2);\n const prefix = expanded.slice(0, this.curve.adjustedSize);\n\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n signTweakMul(msg, secret, tweak, ph, ctx) {\n const [key_, prefix_] = this.privateKeyExpand(secret);\n const key = this.scalarTweakMul(key_, tweak);\n const expanded = this.hash.multi(prefix_, tweak, null,\n this.curve.adjustedSize * 2);\n const prefix = expanded.slice(0, this.curve.adjustedSize);\n\n return this.signWithScalar(msg, key, prefix, ph, ctx);\n }\n\n verify(msg, sig, key, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n\n try {\n return this._verify(msg, sig, key, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verify(msg, sig, key, ph, ctx) {\n // EdDSA Verification.\n //\n // [EDDSA] Page 15, Section 5.\n // [RFC8032] Page 8, Section 3.4.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - s < n.\n //\n // Computation:\n //\n // e = H(R, A, m) mod n\n // G * s == R + A * e\n //\n // Alternatively, we can compute:\n //\n // R == G * s - A * e\n //\n // This allows us to make use of a\n // multi-exponentiation algorithm.\n const {n} = this.curve;\n const G = this.curve.g;\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n\n return G.mulAdd(s, A.neg(), e).eq(R);\n }\n\n verifySingle(msg, sig, key, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n\n try {\n return this._verifySingle(msg, sig, key, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verifySingle(msg, sig, key, ph, ctx) {\n // EdDSA Verification (with cofactor multiplication).\n //\n // [EDDSA] Page 15, Section 5.\n // [RFC8032] Page 8, Section 3.4.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `m` be a byte array of arbitrary size.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - s < n.\n //\n // Computation:\n //\n // e = H(R, A, m) mod n\n // (G * s) * h == (R + A * e) * h\n //\n // Alternatively, we can compute:\n //\n // R * h == G * (s * h) - (A * h) * e\n //\n // This allows us to make use of a\n // multi-exponentiation algorithm.\n const {n} = this.curve;\n const G = this.curve.g;\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n const sh = this.curve.imulH(s);\n const Ah = A.mulH();\n const Rh = R.mulH();\n\n return G.mulAdd(sh, Ah.neg(), e).eq(Rh);\n }\n\n verifyBatch(batch, ph, ctx) {\n if (ctx == null)\n ctx = Buffer.alloc(0);\n\n assert(Array.isArray(batch));\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n for (const item of batch) {\n assert(Array.isArray(item) && item.length === 3);\n\n const [msg, sig, key] = item;\n\n assert(Buffer.isBuffer(msg));\n assert(Buffer.isBuffer(sig));\n assert(Buffer.isBuffer(key));\n\n if (sig.length !== this.curve.adjustedSize * 2)\n return false;\n\n if (key.length !== this.curve.adjustedSize)\n return false;\n }\n\n try {\n return this._verifyBatch(batch, ph, ctx);\n } catch (e) {\n return false;\n }\n }\n\n _verifyBatch(batch, ph, ctx) {\n // EdDSA Batch Verification.\n //\n // [EDDSA] Page 16, Section 5.\n //\n // Assumptions:\n //\n // - Let `H` be a cryptographic hash function.\n // - Let `R` and `s` be signature elements.\n // - Let `A` be a valid group element.\n // - Let `i` be the batch item index.\n // - s < n.\n // - a1 = 1 mod n.\n //\n // Computation:\n //\n // ei = H(Ri, Ai, mi) mod n\n // ai = random integer in [1,n-1]\n // lhs = (si * ai + ...) * h mod n\n // rhs = (Ri * h) * ai + (Ai * h) * (ei * ai mod n) + ...\n // G * -lhs + rhs == O\n const {n} = this.curve;\n const G = this.curve.g;\n const points = new Array(1 + batch.length * 2);\n const coeffs = new Array(1 + batch.length * 2);\n const sum = new BN(0);\n\n this.rng.init(batch);\n\n points[0] = G;\n coeffs[0] = sum;\n\n for (let i = 0; i < batch.length; i++) {\n const [msg, sig, key] = batch[i];\n const Rraw = sig.slice(0, this.curve.adjustedSize);\n const sraw = sig.slice(this.curve.adjustedSize);\n const R = this.curve.decodePoint(Rraw);\n const s = this.curve.decodeAdjusted(sraw);\n const A = this.curve.decodePoint(key);\n\n if (s.cmp(n) >= 0)\n return false;\n\n const e = this.hashChallenge(Rraw, key, msg, ph, ctx);\n const a = this.rng.generate(i);\n const ea = e.mul(a).imod(n);\n\n sum.iadd(s.mul(a)).imod(n);\n\n points[1 + i * 2 + 0] = R.mulH();\n coeffs[1 + i * 2 + 0] = a;\n points[1 + i * 2 + 1] = A.mulH();\n coeffs[1 + i * 2 + 1] = ea;\n }\n\n this.curve.imulH(sum.ineg());\n\n return this.curve.mulAll(points, coeffs).isInfinity();\n }\n\n derive(pub, secret) {\n const scalar = this.privateKeyConvert(secret);\n return this.deriveWithScalar(pub, scalar);\n }\n\n deriveWithScalar(pub, scalar) {\n const A = this.curve.decodePoint(pub);\n const a = this.curve.decodeClamped(scalar);\n const P = A.mulBlind(a, rng);\n\n if (P.isInfinity())\n throw new Error('Invalid point.');\n\n return P.encode();\n }\n}\n\n/*\n * Hash\n */\n\nclass Hash {\n constructor(eddsa) {\n this.curve = eddsa.curve;\n // eslint-disable-next-line\n this.hash = new eddsa.hash();\n }\n\n init(ph, ctx) {\n assert(ph == null || typeof ph === 'boolean');\n assert(Buffer.isBuffer(ctx));\n\n if (ctx.length > 255)\n ctx = ctx.slice(0, 255);\n\n this.hash.init();\n\n if (this.curve.context || ph != null || ctx.length > 0) {\n if (this.curve.prefix)\n this.hash.update(this.curve.prefix);\n\n this.hash.update(byte(ph));\n this.hash.update(byte(ctx.length));\n this.hash.update(ctx);\n }\n\n return this;\n }\n\n update(data) {\n this.hash.update(data);\n return this;\n }\n\n final() {\n const hash = this.hash.final(this.curve.adjustedSize * 2);\n const num = BN.decode(hash, this.curve.endian);\n\n return num.imod(this.curve.n);\n }\n}\n\n/*\n * Helpers\n */\n\nfunction byte(ch) {\n const buf = Buffer.alloc(1);\n buf[0] = ch & 0xff;\n return buf;\n}\n\n/*\n * Expose\n */\n\nmodule.exports = EDDSA;\n","/*!\n * keccak.js - Keccak/SHA3 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Parts of this software are based on emn178/js-sha3:\n * Copyright (c) 2015-2017, Chen, Yi-Cyuan (MIT License).\n * https://github.com/emn178/js-sha3\n *\n * Parts of this software are based on rhash/RHash:\n * Copyright (c) 2005-2014, Aleksey Kravchenko\n * https://github.com/rhash/RHash\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n * https://github.com/rhash/RHash/blob/master/librhash/sha3.c\n * https://github.com/emn178/js-sha3/blob/master/src/sha3.js\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst HMAC = require('../internal/hmac');\n\n/*\n * Constants\n */\n\nconst FINALIZED = 0x80000000;\n\nconst ROUND_CONST = new Uint32Array([\n 0x00000001, 0x00000000, 0x00008082, 0x00000000,\n 0x0000808a, 0x80000000, 0x80008000, 0x80000000,\n 0x0000808b, 0x00000000, 0x80000001, 0x00000000,\n 0x80008081, 0x80000000, 0x00008009, 0x80000000,\n 0x0000008a, 0x00000000, 0x00000088, 0x00000000,\n 0x80008009, 0x00000000, 0x8000000a, 0x00000000,\n 0x8000808b, 0x00000000, 0x0000008b, 0x80000000,\n 0x00008089, 0x80000000, 0x00008003, 0x80000000,\n 0x00008002, 0x80000000, 0x00000080, 0x80000000,\n 0x0000800a, 0x00000000, 0x8000000a, 0x80000000,\n 0x80008081, 0x80000000, 0x00008080, 0x80000000,\n 0x80000001, 0x00000000, 0x80008008, 0x80000000\n]);\n\n/**\n * Keccak\n */\n\nclass Keccak {\n constructor() {\n this.state = new Uint32Array(50);\n this.block = Buffer.alloc(200);\n this.bs = 136;\n this.pos = FINALIZED;\n }\n\n init(bits) {\n if (bits == null)\n bits = 256;\n\n assert((bits >>> 0) === bits);\n assert(bits >= 128);\n assert(bits <= 512);\n\n const rate = 1600 - bits * 2;\n\n assert(rate >= 0 && (rate & 63) === 0);\n\n this.bs = rate >>> 3;\n this.pos = 0;\n\n return this;\n }\n\n update(data) {\n assert(Buffer.isBuffer(data));\n assert(!(this.pos & FINALIZED), 'Context is not initialized.');\n\n let len = data.length;\n let pos = this.pos;\n let off = 0;\n\n this.pos = (this.pos + len) % this.bs;\n\n if (pos > 0) {\n let want = this.bs - pos;\n\n if (want > len)\n want = len;\n\n data.copy(this.block, pos, off, off + want);\n\n pos += want;\n len -= want;\n off += want;\n\n if (pos < this.bs)\n return this;\n\n this._transform(this.block, 0);\n }\n\n while (len >= this.bs) {\n this._transform(data, off);\n off += this.bs;\n len -= this.bs;\n }\n\n if (len > 0)\n data.copy(this.block, 0, off, off + len);\n\n return this;\n }\n\n final(pad, len) {\n if (pad == null)\n pad = 0x01;\n\n if (len == null || len === 0)\n len = 100 - (this.bs >>> 1);\n\n assert((pad & 0xff) === pad);\n assert((len >>> 0) === len);\n assert(!(this.pos & FINALIZED), 'Context is not initialized.');\n\n this.block.fill(0, this.pos, this.bs);\n this.block[this.pos] |= pad;\n this.block[this.bs - 1] |= 0x80;\n this._transform(this.block, 0);\n this.pos = FINALIZED;\n\n assert(len <= this.bs);\n\n const out = Buffer.alloc(len);\n\n for (let i = 0; i < len; i++)\n out[i] = this.state[i >>> 2] >>> (8 * (i & 3));\n\n for (let i = 0; i < 50; i++)\n this.state[i] = 0;\n\n for (let i = 0; i < this.bs; i++)\n this.block[i] = 0;\n\n return out;\n }\n\n _transform(block, off) {\n const count = this.bs >>> 2;\n const s = this.state;\n\n for (let i = 0; i < count; i++)\n s[i] ^= readU32(block, off + i * 4);\n\n for (let n = 0; n < 48; n += 2) {\n const c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n const c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n const c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n const c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n const c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n const c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n const c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n const c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n const c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n const c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n const h0 = c8 ^ ((c2 << 1) | (c3 >>> 31));\n const l0 = c9 ^ ((c3 << 1) | (c2 >>> 31));\n const h1 = c0 ^ ((c4 << 1) | (c5 >>> 31));\n const l1 = c1 ^ ((c5 << 1) | (c4 >>> 31));\n const h2 = c2 ^ ((c6 << 1) | (c7 >>> 31));\n const l2 = c3 ^ ((c7 << 1) | (c6 >>> 31));\n const h3 = c4 ^ ((c8 << 1) | (c9 >>> 31));\n const l3 = c5 ^ ((c9 << 1) | (c8 >>> 31));\n const h4 = c6 ^ ((c0 << 1) | (c1 >>> 31));\n const l4 = c7 ^ ((c1 << 1) | (c0 >>> 31));\n\n s[0] ^= h0;\n s[1] ^= l0;\n s[10] ^= h0;\n s[11] ^= l0;\n s[20] ^= h0;\n s[21] ^= l0;\n s[30] ^= h0;\n s[31] ^= l0;\n s[40] ^= h0;\n s[41] ^= l0;\n\n s[2] ^= h1;\n s[3] ^= l1;\n s[12] ^= h1;\n s[13] ^= l1;\n s[22] ^= h1;\n s[23] ^= l1;\n s[32] ^= h1;\n s[33] ^= l1;\n s[42] ^= h1;\n s[43] ^= l1;\n\n s[4] ^= h2;\n s[5] ^= l2;\n s[14] ^= h2;\n s[15] ^= l2;\n s[24] ^= h2;\n s[25] ^= l2;\n s[34] ^= h2;\n s[35] ^= l2;\n s[44] ^= h2;\n s[45] ^= l2;\n\n s[6] ^= h3;\n s[7] ^= l3;\n s[16] ^= h3;\n s[17] ^= l3;\n s[26] ^= h3;\n s[27] ^= l3;\n s[36] ^= h3;\n s[37] ^= l3;\n s[46] ^= h3;\n s[47] ^= l3;\n\n s[8] ^= h4;\n s[9] ^= l4;\n s[18] ^= h4;\n s[19] ^= l4;\n s[28] ^= h4;\n s[29] ^= l4;\n s[38] ^= h4;\n s[39] ^= l4;\n s[48] ^= h4;\n s[49] ^= l4;\n\n const b0 = s[0];\n const b1 = s[1];\n const b32 = (s[11] << 4) | (s[10] >>> 28);\n const b33 = (s[10] << 4) | (s[11] >>> 28);\n const b14 = (s[20] << 3) | (s[21] >>> 29);\n const b15 = (s[21] << 3) | (s[20] >>> 29);\n const b46 = (s[31] << 9) | (s[30] >>> 23);\n const b47 = (s[30] << 9) | (s[31] >>> 23);\n const b28 = (s[40] << 18) | (s[41] >>> 14);\n const b29 = (s[41] << 18) | (s[40] >>> 14);\n const b20 = (s[2] << 1) | (s[3] >>> 31);\n const b21 = (s[3] << 1) | (s[2] >>> 31);\n const b2 = (s[13] << 12) | (s[12] >>> 20);\n const b3 = (s[12] << 12) | (s[13] >>> 20);\n const b34 = (s[22] << 10) | (s[23] >>> 22);\n const b35 = (s[23] << 10) | (s[22] >>> 22);\n const b16 = (s[33] << 13) | (s[32] >>> 19);\n const b17 = (s[32] << 13) | (s[33] >>> 19);\n const b48 = (s[42] << 2) | (s[43] >>> 30);\n const b49 = (s[43] << 2) | (s[42] >>> 30);\n const b40 = (s[5] << 30) | (s[4] >>> 2);\n const b41 = (s[4] << 30) | (s[5] >>> 2);\n const b22 = (s[14] << 6) | (s[15] >>> 26);\n const b23 = (s[15] << 6) | (s[14] >>> 26);\n const b4 = (s[25] << 11) | (s[24] >>> 21);\n const b5 = (s[24] << 11) | (s[25] >>> 21);\n const b36 = (s[34] << 15) | (s[35] >>> 17);\n const b37 = (s[35] << 15) | (s[34] >>> 17);\n const b18 = (s[45] << 29) | (s[44] >>> 3);\n const b19 = (s[44] << 29) | (s[45] >>> 3);\n const b10 = (s[6] << 28) | (s[7] >>> 4);\n const b11 = (s[7] << 28) | (s[6] >>> 4);\n const b42 = (s[17] << 23) | (s[16] >>> 9);\n const b43 = (s[16] << 23) | (s[17] >>> 9);\n const b24 = (s[26] << 25) | (s[27] >>> 7);\n const b25 = (s[27] << 25) | (s[26] >>> 7);\n const b6 = (s[36] << 21) | (s[37] >>> 11);\n const b7 = (s[37] << 21) | (s[36] >>> 11);\n const b38 = (s[47] << 24) | (s[46] >>> 8);\n const b39 = (s[46] << 24) | (s[47] >>> 8);\n const b30 = (s[8] << 27) | (s[9] >>> 5);\n const b31 = (s[9] << 27) | (s[8] >>> 5);\n const b12 = (s[18] << 20) | (s[19] >>> 12);\n const b13 = (s[19] << 20) | (s[18] >>> 12);\n const b44 = (s[29] << 7) | (s[28] >>> 25);\n const b45 = (s[28] << 7) | (s[29] >>> 25);\n const b26 = (s[38] << 8) | (s[39] >>> 24);\n const b27 = (s[39] << 8) | (s[38] >>> 24);\n const b8 = (s[48] << 14) | (s[49] >>> 18);\n const 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] ^= ROUND_CONST[n + 0];\n s[1] ^= ROUND_CONST[n + 1];\n }\n }\n\n static hash() {\n return new Keccak();\n }\n\n static hmac(bits, pad, len) {\n if (bits == null)\n bits = 256;\n\n assert((bits >>> 0) === bits);\n\n const rate = 1600 - bits * 2;\n\n assert(rate >= 0 && (rate & 63) === 0);\n\n return new HMAC(Keccak, rate >>> 3, [bits], [pad, len]);\n }\n\n static digest(data, bits, pad, len) {\n return Keccak.ctx.init(bits).update(data).final(pad, len);\n }\n\n static root(left, right, bits, pad, len) {\n if (bits == null)\n bits = 256;\n\n if (len == null)\n len = 0;\n\n if (len === 0)\n len = bits >>> 3;\n\n assert((bits >>> 0) === bits);\n assert((bits & 7) === 0);\n assert((len >>> 0) === len);\n assert(Buffer.isBuffer(left) && left.length === len);\n assert(Buffer.isBuffer(right) && right.length === len);\n\n return Keccak.ctx.init(bits).update(left).update(right).final(pad, len);\n }\n\n static multi(x, y, z, bits, pad, len) {\n const {ctx} = Keccak;\n\n ctx.init(bits);\n ctx.update(x);\n ctx.update(y);\n\n if (z)\n ctx.update(z);\n\n return ctx.final(pad, len);\n }\n\n static mac(data, key, bits, pad, len) {\n return Keccak.hmac(bits, pad, len).init(key).update(data).final();\n }\n}\n\n/*\n * Static\n */\n\nKeccak.native = 0;\nKeccak.id = 'KECCAK256';\nKeccak.size = 32;\nKeccak.bits = 256;\nKeccak.blockSize = 136;\nKeccak.zero = Buffer.alloc(32, 0x00);\nKeccak.ctx = new Keccak();\n\n/*\n * Helpers\n */\n\nfunction readU32(data, off) {\n return (data[off++]\n + data[off++] * 0x100\n + data[off++] * 0x10000\n + data[off] * 0x1000000);\n}\n\n/*\n * Expose\n */\n\nmodule.exports = Keccak;\n","/*!\n * keccak.js - keccak for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/keccak');\n","/*!\n * shake.js - SHAKE implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n */\n\n'use strict';\n\nconst Keccak = require('./keccak');\n\n/**\n * SHAKE\n */\n\nclass SHAKE extends Keccak {\n /**\n * Create a SHAKE Context.\n * @constructor\n */\n\n constructor() {\n super();\n }\n\n final(len) {\n return super.final(0x1f, len);\n }\n\n static hash() {\n return new SHAKE();\n }\n\n static hmac(bits, len) {\n return super.hmac(bits, 0x1f, len);\n }\n\n static digest(data, bits, len) {\n return super.digest(data, bits, 0x1f, len);\n }\n\n static root(left, right, bits, len) {\n return super.root(left, right, bits, 0x1f, len);\n }\n\n static multi(x, y, z, bits, len) {\n return super.multi(x, y, z, bits, 0x1f, len);\n }\n\n static mac(data, key, bits, len) {\n return super.mac(data, key, bits, 0x1f, len);\n }\n}\n\n/*\n * Static\n */\n\nSHAKE.native = Keccak.native;\nSHAKE.id = 'SHAKE256';\nSHAKE.size = 32;\nSHAKE.bits = 256;\nSHAKE.blockSize = 136;\nSHAKE.zero = Buffer.alloc(32, 0x00);\nSHAKE.ctx = new SHAKE();\n\n/*\n * Expose\n */\n\nmodule.exports = SHAKE;\n","/*!\n * shake256.js - SHAKE256 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nconst SHAKE = require('./shake');\n\n/**\n * SHAKE256\n */\n\nclass SHAKE256 extends SHAKE {\n constructor() {\n super();\n }\n\n init() {\n return super.init(256);\n }\n\n static hash() {\n return new SHAKE256();\n }\n\n static hmac(len) {\n return super.hmac(256, len);\n }\n\n static digest(data, len) {\n return super.digest(data, 256, len);\n }\n\n static root(left, right, len) {\n return super.root(left, right, 256, len);\n }\n\n static multi(x, y, z, len) {\n return super.multi(x, y, z, 256, len);\n }\n\n static mac(data, key, len) {\n return super.mac(data, key, 256, len);\n }\n}\n\n/*\n * Static\n */\n\nSHAKE256.native = SHAKE.native;\nSHAKE256.id = 'SHAKE256';\nSHAKE256.size = 32;\nSHAKE256.bits = 256;\nSHAKE256.blockSize = 136;\nSHAKE256.zero = Buffer.alloc(32, 0x00);\nSHAKE256.ctx = new SHAKE256();\n\n/*\n * Expose\n */\n\nmodule.exports = SHAKE256;\n","/*!\n * ed448.js - ed448 for bcrypto\n * Copyright (c) 2018-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://eprint.iacr.org/2015/625.pdf\n * https://tools.ietf.org/html/rfc8032#section-5.2\n */\n\n'use strict';\n\nconst EDDSA = require('./eddsa');\nconst SHAKE256 = require('../shake256');\n\n/*\n * Expose\n */\n\nmodule.exports = new EDDSA('ED448', 'X448', 'MONT448', SHAKE256);\n","/*!\n * ed448.js - ed448 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/ed448');\n","// bcrypto does not ship TypeScript declarations.\n// @ts-ignore\nimport backend from \"bcrypto/lib/ed448-browser.js\";\nconst ed448 = backend;\nexport default ed448;\n//# sourceMappingURL=browser-ed448.js.map","/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert(value >> width === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\",\n fault: \"overflow\",\n value: _value,\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -((~value & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = BN_1 << (width - BN_1);\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n const mask = (BN_1 << width) - BN_1;\n return (~value & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof value) {\n case \"bigint\":\n return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\",\n operation: \"getUint\",\n value,\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof value) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value,\n });\n // Pad the value to the required width\n while (result.length < width * 2) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n return new Uint8Array([]);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map","/**\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 let value = toBigInt(getBytes(_value));\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\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","// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map","/**\n * Explain events...\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map","/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","import { assert } from \"./errors.js\";\n// @TODO: timeout is completely ignored; start a Promise.any with a reject?\n// @ts-ignore\nexport async function getUrl(req, _signal) {\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 let signal = undefined;\n if (_signal) {\n const controller = new AbortController();\n signal = controller.signal;\n _signal.addListener(() => {\n controller.abort();\n });\n }\n const init = {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal,\n };\n try {\n const resp = await fetch(req.url, init);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = respBody == null ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers,\n body,\n };\n }\n catch (error) {\n console.log({ error });\n return undefined;\n }\n}\n//# sourceMappingURL=geturl-browser.js.map","/**\n * Explain fetching here...\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 { getUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet getUrlFunc = getUrl;\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(() => {\n listener();\n }, 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() {\n return this.#cancelled;\n }\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 /**\n * The fetch URI to requrest.\n */\n get url() {\n return this.#url;\n }\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``) and the .\n *\n * If %%body%% is a string, the intrincis ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrincis ``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 chnages 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 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]],\n 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 complere response.\n * //(default: 5 minutes)//\n */\n get timeout() {\n return this.#timeout;\n }\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 * 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 }\n toString() {\n return ``;\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\",\n reason: \"timeout\",\n 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\n .makeServerError(\"error in post-processing function\", error)\n .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 getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req\n .redirect(location)\n .#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 ||\n (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof retryAfter === \"string\" &&\n retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req\n .clone()\n .#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\n .makeServerError(\"error in post-processing function\", error)\n .assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req\n .clone()\n .#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 locataions\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" &&\n (current !== \"https\" || target !== \"http\") &&\n 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 = \"GET\";\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 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 getUrlFunc = getUrl;\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 * 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 ``;\n }\n /**\n * The response status code.\n */\n get statusCode() {\n return this.#statusCode;\n }\n /**\n * The response status message.\n */\n get statusMessage() {\n return this.#statusMessage;\n }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() {\n return Object.assign({}, this.#headers);\n }\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\",\n 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\",\n 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]],\n 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 of 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() {\n return this.#request;\n }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" &&\n this.statusCode >= 200 &&\n 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 assert(false, message, \"SERVER_ERROR\", {\n request: this.request || \"unknown request\",\n response: this,\n error,\n });\n }\n}\nfunction getTime() {\n return new Date().getTime();\n}\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","var _a;\n/**\n * About fixed-point math...\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = BN_1 << (width - BN_1);\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = BN_1 << width;\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n val = (((val % limit) + limit) % limit) & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof value === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof value === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = match[1] !== \"u\";\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof v[key] === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument(width % 8 === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return negative + str;\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return negative + str;\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, an value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() {\n return this.#format.signed;\n }\n /**\n * The number of bits available to store the value.\n */\n get width() {\n return this.#format.width;\n }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() {\n return this.#format.decimals;\n }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() {\n return this.#val;\n }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n\n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n*/\n val = checkValue(val, this.#format, safeOp);\n return new _a(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) {\n return this.#add(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) {\n return this.#add(other, \"add\");\n }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) {\n return this.#sub(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) {\n return this.#sub(other, \"sub\");\n }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) {\n return this.#mul(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) {\n return this.#mul(other, \"mul\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert(value % this.#tens === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) {\n return this.#div(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) {\n return this.#div(other, \"div\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(other);\n const value = this.#val * this.#tens;\n assert(value % other.#val === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%other%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return -1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) {\n return this.cmp(other) === 0;\n }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) {\n return this.cmp(other) < 0;\n }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) {\n return this.cmp(other) <= 0;\n }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) {\n return this.cmp(other) > 0;\n }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) {\n return this.cmp(other) >= 0;\n }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new _a(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() {\n return this.#val === BN_0;\n }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() {\n return this.#val < BN_0;\n }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() {\n return this._value;\n }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() {\n return parseFloat(this.toString());\n }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return _a.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, decimals, _format) {\n if (decimals == null) {\n decimals = 0;\n }\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert(value % tens === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\",\n fault: \"underflow\",\n value: _value,\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && match[2].length + match[3].length > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = match[2] || \"0\", decimal = match[3] || \"\";\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\",\n fault: \"underflow\",\n value: _value,\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new _a(_guard, value, format);\n }\n}\n_a = FixedNumber;\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map","import { 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,\n length,\n 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,\n length: 0,\n offset: 1,\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data,\n length: data.length,\n 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","import { 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","/**\n * Most interactions with Core requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Core, //Core// is divisible to 18 decimal places,\n * where each individual unit is called a //ore//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n ///Ore, the smallest and atomic amount of Core\n \"ore\",\n ///fecore, 1000 ore\n \"fecore\",\n ///Picore, one million ore\n \"picore\",\n ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices.\n \"nacore\",\n ///Μcore, 10^12 ore or 1 μCore\n \"mcore\",\n ///micore, 10^15 ore or 1 mcore\n \"micore\",\n \"core\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit.\n */\nexport const scientificToDecimal = (num) => {\n // @ts-ignore\n var nsign = Math.sign(num);\n //remove the sign\n // @ts-ignore\n num = Math.abs(num);\n //if the number is in scientific notation remove it\n // @ts-ignore\n if (/\\d+\\.?\\d*e[\\+\\-]*\\d+/i.test(num)) {\n var zero = \"0\", \n // @ts-ignore\n parts = String(num).toLowerCase().split(\"e\"), //split into coeff and exponent\n e = parts.pop(), //store the exponential part\n // @ts-ignore\n l = Math.abs(e), //get the number of zeros\n // @ts-ignore\n sign = e / l, coeff_array = parts[0].split(\".\");\n if (sign === -1) {\n l = l - coeff_array[0].length;\n if (l < 0) {\n // @ts-ignore\n num =\n coeff_array[0].slice(0, l) +\n \".\" +\n coeff_array[0].slice(l) +\n (coeff_array.length === 2 ? coeff_array[1] : \"\");\n }\n else {\n // @ts-ignore\n num = zero + \".\" + new Array(l + 1).join(zero) + coeff_array.join(\"\");\n }\n }\n else {\n var dec = coeff_array[1];\n if (dec)\n l = l - dec.length;\n if (l < 0) {\n // @ts-ignore\n num = coeff_array[0] + dec.slice(0, l) + \".\" + dec.slice(l);\n }\n else {\n // @ts-ignore\n num = coeff_array.join(\"\") + new Array(l + 1).join(zero);\n }\n }\n }\n // @ts-ignore\n return nsign < 0 ? \"-\" + num : num;\n};\nexport const trimDecimals = (n, decimals = 18) => {\n n += \"\";\n if (n.indexOf(\".\") === -1)\n return n;\n const arr = n.split(\".\");\n const fraction = arr[1].substr(0, decimals);\n return arr[0] + \".\" + fraction;\n};\nexport function parseUnits(value, unit) {\n assertArgument(typeof value === \"string\", \"value must be a string\", \"value\", value);\n if (value.includes(\"e\")) {\n value = scientificToDecimal(value).toString();\n }\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n value = trimDecimals(value, decimals);\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n value = trimDecimals(value, decimals);\n }\n return FixedNumber.fromString(value, { decimals }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatXCB(ore) {\n return formatUnits(ore, 18);\n}\n/**\n * Converts the //decimal string// %%xcb%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseXCB(xcb) {\n return parseUnits(xcb, 18);\n}\n//# sourceMappingURL=units.js.map","/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map","/*!\n * pbkdf2.js - pbkdf2 for bcrypto\n * Copyright (c) 2014-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/PBKDF2\n * https://tools.ietf.org/html/rfc2898\n * https://tools.ietf.org/html/rfc2898#section-5.2\n * https://tools.ietf.org/html/rfc6070\n * https://www.emc.com/collateral/white-papers/h11302-pkcs5v2-1-password-based-cryptography-standard-wp.pdf\n * http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\n */\n\n'use strict';\n\nconst assert = require('../internal/assert');\nconst crypto = global.crypto || global.msCrypto || {};\nconst subtle = crypto.subtle || {};\n\n/**\n * Perform key derivation using PBKDF2.\n * @param {Function} hash\n * @param {Buffer} pass\n * @param {Buffer} salt\n * @param {Number} iter\n * @param {Number} len\n * @returns {Buffer}\n */\n\nfunction derive(hash, pass, salt, iter, len) {\n if (typeof pass === 'string')\n pass = Buffer.from(pass, 'utf8');\n\n if (typeof salt === 'string')\n salt = Buffer.from(salt, 'utf8');\n\n if (salt == null)\n salt = Buffer.alloc(0);\n\n assert(hash && typeof hash.id === 'string');\n assert(Buffer.isBuffer(pass));\n assert(Buffer.isBuffer(salt));\n assert((iter >>> 0) === iter);\n assert((len >>> 0) === len);\n\n const size = hash.size;\n const blocks = Math.ceil(len / size);\n const out = Buffer.alloc(blocks * size);\n const state = Buffer.alloc(salt.length + 4);\n\n salt.copy(state, 0);\n\n // Preemptively shorten key.\n if (pass.length > hash.blockSize) {\n pass = hash.digest(pass);\n assert(pass.length <= hash.blockSize);\n }\n\n for (let i = 0; i < blocks; i++) {\n const round = i + 1;\n\n state[salt.length + 0] = round >>> 24;\n state[salt.length + 1] = round >>> 16;\n state[salt.length + 2] = round >>> 8;\n state[salt.length + 3] = round;\n\n const block = hash.mac(state, pass);\n\n let mac = block;\n\n for (let j = 1; j < iter; j++) {\n mac = hash.mac(mac, pass);\n\n for (let k = 0; k < size; k++)\n block[k] ^= mac[k];\n }\n\n block.copy(out, i * size);\n }\n\n return out.slice(0, len);\n}\n\n/**\n * Execute pbkdf2 asynchronously.\n * @param {Function} hash\n * @param {Buffer} pass\n * @param {Buffer} salt\n * @param {Number} iter\n * @param {Number} len\n * @returns {Promise}\n */\n\nasync function deriveAsync(hash, pass, salt, iter, len) {\n if (typeof pass === 'string')\n pass = Buffer.from(pass, 'utf8');\n\n if (typeof salt === 'string')\n salt = Buffer.from(salt, 'utf8');\n\n if (salt == null)\n salt = Buffer.alloc(0);\n\n assert(hash && typeof hash.id === 'string');\n assert(Buffer.isBuffer(pass));\n assert(Buffer.isBuffer(salt));\n assert((iter >>> 0) === iter);\n assert((len >>> 0) === len);\n\n const name = getHash(hash);\n\n if (!subtle.importKey || !subtle.deriveBits || !name)\n return derive(hash, pass, salt, iter, len);\n\n const algo = { name: 'PBKDF2' };\n const use = ['deriveBits'];\n\n const options = {\n name: 'PBKDF2',\n salt: salt,\n iterations: iter,\n hash: name\n };\n\n const key = await subtle.importKey('raw', pass, algo, false, use);\n const out = await subtle.deriveBits(options, key, len * 8);\n\n return Buffer.from(out);\n}\n\n/*\n * Helpers\n */\n\nfunction getHash(hash) {\n switch (hash.id) {\n case 'SHA1':\n return 'SHA-1';\n case 'SHA256':\n return 'SHA-256';\n case 'SHA384':\n return 'SHA-384';\n case 'SHA512':\n return 'SHA-512';\n default:\n return null;\n }\n}\n\n/*\n * Expose\n */\n\nexports.native = 0;\nexports.derive = derive;\nexports.deriveAsync = deriveAsync;\n","/*!\n * pbkdf2.js - pbkdf2 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/pbkdf2');\n","/*!\n * sha3.js - SHA3 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n *\n * Resources:\n * https://en.wikipedia.org/wiki/SHA-3\n * https://keccak.team/specifications.html\n * https://csrc.nist.gov/projects/hash-functions/sha-3-project/sha-3-standardization\n * http://dx.doi.org/10.6028/NIST.FIPS.202\n */\n\n'use strict';\n\nconst Keccak = require('./keccak');\n\n/**\n * SHA3\n */\n\nclass SHA3 extends Keccak {\n constructor() {\n super();\n }\n\n final() {\n return super.final(0x06, null);\n }\n\n static hash() {\n return new SHA3();\n }\n\n static hmac(bits) {\n return super.hmac(bits, 0x06, null);\n }\n\n static digest(data, bits) {\n return super.digest(data, bits, 0x06, null);\n }\n\n static root(left, right, bits) {\n return super.root(left, right, bits, 0x06, null);\n }\n\n static multi(x, y, z, bits) {\n return super.multi(x, y, z, bits, 0x06, null);\n }\n\n static mac(data, key, bits) {\n return super.mac(data, key, bits, 0x06, null);\n }\n}\n\n/*\n * Static\n */\n\nSHA3.native = 0;\nSHA3.id = 'SHA3_256';\nSHA3.size = 32;\nSHA3.bits = 256;\nSHA3.blockSize = 136;\nSHA3.zero = Buffer.alloc(32, 0x00);\nSHA3.ctx = new SHA3();\n\n/*\n * Expose\n */\n\nmodule.exports = SHA3;\n","/*!\n * sha3.js - sha3 for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nmodule.exports = require('./js/sha3');\n","/*!\n * sha3-512.js - sha3-512 implementation for bcrypto\n * Copyright (c) 2017-2019, Christopher Jeffrey (MIT License).\n * https://github.com/bcoin-org/bcrypto\n */\n\n'use strict';\n\nconst SHA3 = require('./sha3');\n\n/**\n * SHA3-512\n */\n\nclass SHA3_512 extends SHA3 {\n constructor() {\n super();\n }\n\n init() {\n return super.init(512);\n }\n\n static hash() {\n return new SHA3_512();\n }\n\n static hmac() {\n return super.hmac(512);\n }\n\n static digest(data) {\n return super.digest(data, 512);\n }\n\n static root(left, right) {\n return super.root(left, right, 512);\n }\n\n static multi(x, y, z) {\n return super.multi(x, y, z, 512);\n }\n\n static mac(data, key) {\n return super.mac(data, key, 512);\n }\n}\n\n/*\n * Static\n */\n\nSHA3_512.native = SHA3.native;\nSHA3_512.id = 'SHA3_512';\nSHA3_512.size = 64;\nSHA3_512.bits = 512;\nSHA3_512.blockSize = 72;\nSHA3_512.zero = Buffer.alloc(64, 0x00);\nSHA3_512.ctx = new SHA3_512();\n\n/*\n * Expose\n */\n\nmodule.exports = SHA3_512;\n","import { Buffer } from \"buffer\";\n// @ts-ignore\nimport ed448 from \"./browser-ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"./pbkdf2-browser.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(Buffer.from(msgHash, \"hex\"), Buffer.from(signedMsg, \"hex\"), Buffer.from(pubKey, \"hex\"));\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock-browser.js.map","/* Browser Crypto Shims */\nimport { ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"ripemd160\":\n return ripemd160.create();\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512, \"sha3-256\": sha3_256, \"sha3-512\": sha3_512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = (data) => hexlify(createHash(\"sha3-256\").update(data).digest());\nconst _sha512 = (data) => hexlify(createHash(\"sha3-512\").update(data).digest());\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA3-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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n return hexlify(createHash(\"ripemd160\").update(getBytes(data)).digest());\n}\nexport function sha256(data) {\n return hexlify(__sha256(getBytes(data)));\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(createHmac(\"sha3-256\", k).update(d).digest());\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(createHmac(\"sha3-512\", k).update(d).digest());\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 SHA3-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 return hexlify(__sha512(getBytes(data)));\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha512);\n//# sourceMappingURL=sha3.js.map","/**\n * Addresses are a fundamental part of interacting with Core. They\n * represent the gloabal identity of Externally Owned Accounts (accounts\n * backed by a private key) and contracts.\n *\n * The Core Naming Service (CNS) provides an interconnected ecosystem\n * of contracts, standards and libraries which enable looking up an\n * address for an ENS name.\n *\n * These functions help convert between various formats, validate\n * addresses and safely resolve ENS names.\n *\n * @_section: api/address:Addresses [about-addresses]\n */\nnull;\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { encode } from \"../crypto/rlp.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexDataSlice, hexlify, stripZeros, } from \"../utils/data.js\";\nconst logger = new Logger(\"address/0.0.1\");\nconst precompiledAddresses = [\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n \"0000000000000000000000000000000000000000000000000000000000000001\",\n \"0000000000000000000000000000000000000000000000000000000000000002\",\n \"0000000000000000000000000000000000000000000000000000000000000003\",\n \"0000000000000000000000000000000000000000000000000000000000000004\",\n \"0000000000000000000000000000000000000000000000000000000000000005\",\n \"0000000000000000000000000000000000000000000000000000000000000006\",\n \"0000000000000000000000000000000000000000000000000000000000000007\",\n \"0000000000000000000000000000000000000000000000000000000000000008\",\n \"0000000000000000000000000000000000000000000000000000000000000009\",\n];\nfunction removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nfunction calculateCheckSum(_address, _prefix) {\n const address = getBytes(\"0x\" + _address.replace(\"0x\", \"\"));\n const prefix = getBytes(\"0x\" + _prefix.replace(\"0x\", \"\"));\n const tmpConcated = new Uint8Array([...address, ...prefix]);\n const hexedConcat = hexlify(tmpConcated).replace(\"0x\", \"\") + \"00\";\n const mods = Array.from(hexedConcat.toUpperCase(), (c) => {\n const charCode = c.charCodeAt(0);\n return charCode > 64 && charCode < 91\n ? (charCode - 55).toString()\n : (charCode - 48).toString();\n }).join(\"\");\n const bigVal = BigInt(mods);\n const val97 = BigInt(97);\n const val98 = BigInt(98);\n const remainder = bigVal % val97;\n const checkSum = val98 - remainder;\n const result = checkSum > 9 ? checkSum.toString() : \"0\" + checkSum.toString();\n return result;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address\n .split(\"\")\n .map((c) => {\n return ibanLookup[c];\n })\n .join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Core uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nfunction getAddress(address) {\n if (typeof address !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n const raw = removeHexPrefix(address);\n if (precompiledAddresses.includes(raw)) {\n return \"0x\" + raw;\n }\n const prefix = raw.substring(0, 2);\n const val = raw.substring(4);\n const checksum = calculateCheckSum(val, prefix);\n if (checksum !== raw.substring(2, 4)) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n return \"0x\" + prefix + checksum + val;\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nfunction getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\nfunction networkIdToPrefix(networkId) {\n if (networkId == 1) {\n return \"cb\";\n }\n else if (networkId == 3 || networkId == 4) {\n return \"ab\";\n }\n else if (networkId > 10 || networkId == 0) {\n return \"ce\";\n }\n else {\n logger.throwArgumentError(\"bad networkId\", \"networkId\", networkId);\n return \"\";\n }\n}\nfunction getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n const val = hexDataSlice(sha256(encode([from, nonce])), 12);\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, };\n//# sourceMappingURL=index.js.map","/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () {\n locked = true;\n};\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map","import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () {\n locked = true;\n};\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map","/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () {\n locked = true;\n};\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map","/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () {\n locked = true;\n};\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map","/**\n * RFC 7914 Scrypt KDF. Can be used to create a key from password and salt.\n * @module\n */\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { sha256 } from \"./sha2.js\";\n// prettier-ignore\nimport { anumber, asyncLoop, checkOpts, clean, rotl, swap32IfBE, u32 } from \"./utils.js\";\n// The main Scrypt loop: uses Salsa extensively.\n// Six versions of the function were tried, this is the fastest one.\n// RFC 7914 §3 / §4 step 2 applies Salsa20/8 to one 16-word (64-byte) block\n// after xor'ing two such blocks.\n// The local `y*` snapshot keeps the xor input stable even when `out` aliases `prev` or `input`.\n// prettier-ignore\nfunction XorAndSalsa(prev, pi, input, ii, out, oi) {\n // Based on https://cr.yp.to/salsa20.html and RFC 7914's Salsa20/8 core.\n // Xor blocks\n let y00 = prev[pi++] ^ input[ii++], y01 = prev[pi++] ^ input[ii++];\n let y02 = prev[pi++] ^ input[ii++], y03 = prev[pi++] ^ input[ii++];\n let y04 = prev[pi++] ^ input[ii++], y05 = prev[pi++] ^ input[ii++];\n let y06 = prev[pi++] ^ input[ii++], y07 = prev[pi++] ^ input[ii++];\n let y08 = prev[pi++] ^ input[ii++], y09 = prev[pi++] ^ input[ii++];\n let y10 = prev[pi++] ^ input[ii++], y11 = prev[pi++] ^ input[ii++];\n let y12 = prev[pi++] ^ input[ii++], y13 = prev[pi++] ^ input[ii++];\n let y14 = prev[pi++] ^ input[ii++], y15 = prev[pi++] ^ input[ii++];\n // Save state to temporary variables (salsa)\n let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;\n // Main loop (salsa)\n for (let i = 0; i < 8; i += 2) {\n x04 ^= rotl(x00 + x12 | 0, 7);\n x08 ^= rotl(x04 + x00 | 0, 9);\n x12 ^= rotl(x08 + x04 | 0, 13);\n x00 ^= rotl(x12 + x08 | 0, 18);\n x09 ^= rotl(x05 + x01 | 0, 7);\n x13 ^= rotl(x09 + x05 | 0, 9);\n x01 ^= rotl(x13 + x09 | 0, 13);\n x05 ^= rotl(x01 + x13 | 0, 18);\n x14 ^= rotl(x10 + x06 | 0, 7);\n x02 ^= rotl(x14 + x10 | 0, 9);\n x06 ^= rotl(x02 + x14 | 0, 13);\n x10 ^= rotl(x06 + x02 | 0, 18);\n x03 ^= rotl(x15 + x11 | 0, 7);\n x07 ^= rotl(x03 + x15 | 0, 9);\n x11 ^= rotl(x07 + x03 | 0, 13);\n x15 ^= rotl(x11 + x07 | 0, 18);\n x01 ^= rotl(x00 + x03 | 0, 7);\n x02 ^= rotl(x01 + x00 | 0, 9);\n x03 ^= rotl(x02 + x01 | 0, 13);\n x00 ^= rotl(x03 + x02 | 0, 18);\n x06 ^= rotl(x05 + x04 | 0, 7);\n x07 ^= rotl(x06 + x05 | 0, 9);\n x04 ^= rotl(x07 + x06 | 0, 13);\n x05 ^= rotl(x04 + x07 | 0, 18);\n x11 ^= rotl(x10 + x09 | 0, 7);\n x08 ^= rotl(x11 + x10 | 0, 9);\n x09 ^= rotl(x08 + x11 | 0, 13);\n x10 ^= rotl(x09 + x08 | 0, 18);\n x12 ^= rotl(x15 + x14 | 0, 7);\n x13 ^= rotl(x12 + x15 | 0, 9);\n x14 ^= rotl(x13 + x12 | 0, 13);\n x15 ^= rotl(x14 + x13 | 0, 18);\n }\n // Write output (salsa)\n out[oi++] = (y00 + x00) | 0;\n out[oi++] = (y01 + x01) | 0;\n out[oi++] = (y02 + x02) | 0;\n out[oi++] = (y03 + x03) | 0;\n out[oi++] = (y04 + x04) | 0;\n out[oi++] = (y05 + x05) | 0;\n out[oi++] = (y06 + x06) | 0;\n out[oi++] = (y07 + x07) | 0;\n out[oi++] = (y08 + x08) | 0;\n out[oi++] = (y09 + x09) | 0;\n out[oi++] = (y10 + x10) | 0;\n out[oi++] = (y11 + x11) | 0;\n out[oi++] = (y12 + x12) | 0;\n out[oi++] = (y13 + x13) | 0;\n out[oi++] = (y14 + x14) | 0;\n out[oi++] = (y15 + x15) | 0;\n}\nfunction BlockMix(input, ii, out, oi, r) {\n // The block B is `r` 128-byte chunks, i.e. `2r` 16-word (64-byte) Salsa blocks.\n let head = oi + 0;\n let tail = oi + 16 * r;\n for (let i = 0; i < 16; i++)\n out[tail + i] = input[ii + (2 * r - 1) * 16 + i]; // X ← B[2r−1]\n for (let i = 0; i < r; i++, head += 16, ii += 16) {\n // RFC 7914 §4 step 3 outputs `Y[0], Y[2], ...` first, then `Y[1], Y[3], ...`;\n // `head` and `tail` lay out those even/odd halves in place.\n XorAndSalsa(out, tail, input, ii, out, head); // head[i] = Salsa(blockIn[2*i] ^ tail[i-1])\n if (i > 0)\n tail += 16; // First iteration overwrites tmp value in tail\n // tail[i] = Salsa(blockIn[2*i+1] ^ head[i])\n XorAndSalsa(out, head, input, (ii += 16), out, tail);\n }\n}\n// 128*r*(N+p+1) for N=2**20, r=8, p=1: 1 GiB main table plus 2 KiB workspace.\nconst SCRYPT_DEFAULT_MAXMEM = 128 * 8 * (2 ** 20 + 1 + 1);\n// Common prologue and epilogue for sync/async functions\nfunction scryptInit(password, salt, _opts) {\n const opts = checkOpts({\n dkLen: 32,\n asyncTick: 10,\n maxmem: SCRYPT_DEFAULT_MAXMEM,\n }, _opts);\n const { N, r, p, dkLen, asyncTick, maxmem, onProgress } = opts;\n anumber(N, 'N');\n anumber(r, 'r');\n anumber(p, 'p');\n anumber(dkLen, 'dkLen');\n anumber(asyncTick, 'asyncTick');\n anumber(maxmem, 'maxmem');\n if (onProgress !== undefined && typeof onProgress !== 'function')\n throw new Error('\"onProgress\" must be a function');\n // Without this, r=0 slips through: blockSize=0 turns the `p` upper bound into\n // Infinity and the failure surfaces later as a confusing pbkdf2 dkLen error.\n if (r < 1)\n throw new Error('\"r\" expected integer >= 1');\n const blockSize = 128 * r;\n const blockSize32 = blockSize / 4;\n // Max N is 2^32 (Integrify is 32-bit).\n // Real limit can be 2^22: some JS engines limit Uint8Array to 4GB.\n // Spec check `N >= 2^(blockSize / 8)` is not done for compat with popular libs,\n // which used incorrect r: 1, p: 8. Also, the check seems to be a spec error:\n // https://www.rfc-editor.org/errata_search.php?rfc=7914\n const pow32 = Math.pow(2, 32);\n if (N <= 1 || (N & (N - 1)) !== 0 || N > pow32)\n throw new Error('\"N\" expected a power of 2, and 2^1 <= N <= 2^32');\n if (p < 1 || p > ((pow32 - 1) * 32) / blockSize)\n throw new Error('\"p\" expected integer 1..((2^32 - 1) * 32) / (128 * r)');\n // RFC 7914 §2 defines `dkLen` as a positive integer.\n if (dkLen < 1 || dkLen > (pow32 - 1) * 32)\n throw new Error('\"dkLen\" expected integer 1..(2^32 - 1) * 32');\n // Include the shared `tmp` scratch block so `maxmem` matches noble's actual temporary allocation.\n // Node requires more headroom here, so this accounting is intentionally noble-specific.\n const memUsed = blockSize * (N + p + 1);\n if (memUsed > maxmem)\n throw new Error('\"maxmem\" limit was hit: memUsed(128*r*(N+p+1))=' + memUsed + ', maxmem=' + maxmem);\n // [B0...Bp−1] ← PBKDF2HMAC-SHA256(Passphrase, Salt, 1, blockSize*ParallelizationFactor)\n // Since it has only one iteration there is no reason to use async variant\n const B = pbkdf2(sha256, password, salt, { c: 1, dkLen: blockSize * p });\n const B32 = u32(B);\n // Re-used between parallel iterations. Array(iterations) of B\n const V = u32(new Uint8Array(blockSize * N));\n const tmp = u32(new Uint8Array(blockSize));\n let blockMixCb = () => { };\n if (onProgress) {\n const totalBlockMix = 2 * N * p;\n // Invoke callback if progress changes from 10.01 to 10.02\n // Allows to draw smooth progress bar on up to 8K screen\n const callbackPer = Math.max(Math.floor(totalBlockMix / 10000), 1);\n let blockMixCnt = 0;\n blockMixCb = () => {\n blockMixCnt++;\n if (onProgress && (!(blockMixCnt % callbackPer) || blockMixCnt === totalBlockMix)) {\n // Wiping here instead of a try/catch around the main loops keeps them\n // try-free: measured ~1% slower at N=2^21 with the loops inside a try.\n // onProgress is the only user code that can throw mid-derivation.\n try {\n onProgress(blockMixCnt / totalBlockMix);\n }\n catch (e) {\n clean(B, V, tmp);\n throw e;\n }\n }\n };\n }\n return { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick };\n}\nfunction scryptOutput(password, dkLen, B, V, tmp) {\n // Shared final PBKDF2-and-cleanup step: keep the derived key, wipe the scrypt workspace.\n const res = pbkdf2(sha256, password, B, { c: 1, dkLen });\n clean(B, V, tmp);\n return res;\n}\n/**\n * Scrypt KDF from RFC 7914. See {@link ScryptOpts}.\n * @param password - password or key material to derive from;\n * JS string inputs are UTF-8 encoded first\n * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first\n * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,\n * must be `>= 1` per RFC 7914 §2. See {@link ScryptOpts}.\n * @returns Derived key bytes.\n * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}\n * @example\n * Derive a key with scrypt.\n * ```ts\n * scrypt('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });\n * ```\n * @example\n * Derive a key with small demo costs and progress/memory controls.\n * ```ts\n * const progressLog: number[] = [];\n * scrypt('password', 'salt', {\n * N: 16,\n * r: 8,\n * p: 1,\n * dkLen: 32,\n * maxmem: 1024 * 1024,\n * asyncTick: 10,\n * onProgress(progress) {\n * progressLog.push(progress);\n * },\n * });\n * ```\n */\nexport function scrypt(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb } = scryptInit(password, salt, opts);\n swap32IfBE(B32);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n for (let i = 0, pos = 0; i < N - 1; i++) {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n for (let i = 0; i < N; i++) {\n // First u32 of the last 64-byte block (u32 is LE)\n // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N\n // only depends on the low word here because N is a power of two and\n // this implementation caps N at 2^32.\n // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked\n // above; >>> 0 for unsigned, input fits in u32.\n const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations\n // tmp = B ^ V[j]\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }\n }\n swap32IfBE(B32);\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n/**\n * Scrypt KDF from RFC 7914. Async version. See {@link ScryptOpts}.\n * @param password - password or key material to derive from;\n * JS string inputs are UTF-8 encoded first\n * @param salt - unique salt bytes or string; JS string inputs are UTF-8 encoded first\n * @param opts - Scrypt cost and memory parameters. `dkLen`, if provided,\n * must be `>= 1` per RFC 7914 §2. `asyncTick` is only a local\n * scheduler-yield control for this JS wrapper, not part of RFC 7914.\n * See {@link ScryptOpts}.\n * @returns Promise resolving to derived key bytes.\n * @throws If the Scrypt cost, memory, or callback options are invalid. {@link Error}\n * @example\n * Derive a key with scrypt asynchronously.\n * ```ts\n * await scryptAsync('password', 'salt', { N: 2**18, r: 8, p: 1, dkLen: 32 });\n * ```\n * @example\n * Derive a key asynchronously with small demo costs and progress/memory controls.\n * ```ts\n * await scryptAsync('password', 'salt', {\n * N: 16,\n * r: 8,\n * p: 1,\n * dkLen: 32,\n * maxmem: 1024 * 1024,\n * asyncTick: 1,\n * onProgress(progress) {\n * if (progress > 1) throw new Error('invalid progress');\n * },\n * });\n * ```\n */\nexport async function scryptAsync(password, salt, opts) {\n const { N, r, p, dkLen, blockSize32, V, B32, B, tmp, blockMixCb, asyncTick } = scryptInit(password, salt, opts);\n // One failure handler covers both yield boundaries without putting the hot loops in a try block.\n const abort = () => clean(B, V, tmp);\n swap32IfBE(B32);\n for (let pi = 0; pi < p; pi++) {\n const Pi = blockSize32 * pi;\n for (let i = 0; i < blockSize32; i++)\n V[i] = B32[Pi + i]; // V[0] = B[i]\n let pos = 0;\n await asyncLoop(N - 1, asyncTick, () => {\n BlockMix(V, pos, V, (pos += blockSize32), r); // V[i] = BlockMix(V[i-1]);\n blockMixCb();\n }, abort);\n BlockMix(V, (N - 1) * blockSize32, B32, Pi, r); // Process last element\n blockMixCb();\n await asyncLoop(N, asyncTick, () => {\n // First u32 of the last 64-byte block (u32 is LE)\n // RFC 7914 Integerify(X) uses the whole last 64-byte block, but mod N\n // only depends on the low word here because N is a power of two and\n // this implementation caps N at 2^32.\n // & (N - 1) is % N as N is a power of 2, N & (N - 1) = 0 is checked\n // above; >>> 0 for unsigned, input fits in u32.\n const j = (B32[Pi + blockSize32 - 16] & (N - 1)) >>> 0; // j = Integrify(X) % iterations\n // tmp = B ^ V[j]\n for (let k = 0; k < blockSize32; k++)\n tmp[k] = B32[Pi + k] ^ V[j * blockSize32 + k];\n BlockMix(tmp, 0, B32, Pi, r); // B = BlockMix(B ^ V[j])\n blockMixCb();\n }, abort);\n }\n swap32IfBE(B32);\n return scryptOutput(password, dkLen, B, V, tmp);\n}\n","import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from \"@noble/hashes/scrypt.js\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () {\n lockedAsync = true;\n};\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () {\n lockedSync = true;\n};\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport { dataLength, getBytesCopy, hexlify, assertArgument, } from \"../utils/index.js\";\nimport { arrayify, hexConcat } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { ed448 } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"signing-key/0.0.1\");\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 const normalized = typeof privateKey === \"string\" && !privateKey.startsWith(\"0x\")\n ? \"0x\" + privateKey\n : privateKey;\n assertArgument(dataLength(normalized) === 57, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(normalized);\n }\n /**\n * The private key.\n */\n get privateKey() {\n return this.#privateKey;\n }\n /** The 57-byte Ed448 public key encoded as hex. */\n get publicKey() {\n return SigningKey.computePublicKey(this.#privateKey);\n }\n /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */\n get compressedPublicKey() {\n return SigningKey.computePublicKey(this.#privateKey, true);\n }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n const key = getBytesCopy(this.#privateKey);\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const keyBuffer = new Uint8Array(arrayify(key));\n if (keyBuffer.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n const digestBuffer = new Uint8Array(arrayify(digest));\n if (digestBuffer.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n if (keyBuffer[56] > 127) {\n const prefix = keyBuffer.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[55] |= 0x80;\n prefix[56] = 0;\n const scalar = prefix.slice(0, 56);\n const bufferDigest = Buffer.from(digestBuffer);\n const bufferPrfx = Buffer.from(prefix);\n const bufferScalar = Buffer.from(scalar);\n const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx);\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer));\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */\n computeSharedSecret(other) {\n const pub = Buffer.from(getBytesCopy(other));\n assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), \"invalid public key\", \"other\", other);\n const key = Buffer.from(getBytesCopy(this.#privateKey));\n if (key[56] > 127) {\n const scalar = key.subarray(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n return hexlify(ed448.deriveWithScalar(pub, scalar));\n }\n return hexlify(ed448.derive(pub, key));\n }\n /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */\n static computePublicKey(key, compressed) {\n const bytes = Buffer.from(arrayify(key));\n if (bytes.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n if (bytes[56] > 127) {\n const scalar = bytes.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n const pub = ed448.publicKeyFromScalar(scalar);\n return hexlify(pub);\n }\n const pub = ed448.publicKeyCreate(bytes);\n return hexlify(pub);\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 digestBuffer = Buffer.from(arrayify(digest));\n const sigBuffer = Buffer.from(arrayify(signature));\n if (sigBuffer.length !== 171) {\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n }\n const sig = sigBuffer.slice(0, 114);\n const pub = sigBuffer.slice(114);\n if (ed448.verify(digestBuffer, sig, pub)) {\n return hexlify(pub);\n }\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n return \"\";\n }\n /** Adds two encoded Ed448 public points. The compression flag is ignored. */\n static addPoints(p0, p1, compressed) {\n const points = [p0, p1].map((point) => {\n const bytes = Buffer.from(getBytesCopy(point));\n assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), \"invalid public key\", \"point\", point);\n return bytes;\n });\n return hexlify(ed448.publicKeyCombine(points));\n }\n}\n//# sourceMappingURL=signing-key.js.map","import { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate, } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst _guard = {};\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signautre.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() {\n return this.#r;\n }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n const value = hexlify(_value);\n assertArgument(parseInt(value.substring(0, 3)) < 8, \"non-canonical s\", \"value\", value);\n this.#s = value;\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() {\n return this.#v;\n }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() {\n return this.#networkV;\n }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacynetworkId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getnetworkId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return this.v === 27 ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, this.yParity ? \"0x1c\" : \"0x1b\"]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return `Signature { r: \"${this.r}\", s: \"${this.s}\", yParity: ${this.yParity}, networkV: ${this.networkV} }`;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this.s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: networkV != null ? networkV.toString() : null,\n r: this.r,\n s: this.s,\n v: this.v,\n };\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getnetworkId(45)\n * //_result:\n *\n * Signature.getnetworkId(46)\n * //_result:\n */\n static getnetworkId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if (bv == BN_27 || bv == BN_28) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getnetworkIdV(5, 27)\n * //_result:\n *\n * Signature.getnetworkIdV(5, 28)\n * //_result:\n *\n */\n static getnetworkIdV(networkId, v) {\n return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return bv & BN_1 ? 27 : 28;\n }\n}\n//# sourceMappingURL=signature.js.map","/**\n * A fundamental building block of Core is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha3.js\";\nimport { Ed448Goldilock } from \"./crypto.js\";\nimport { keccak256 } from \"./keccak.js\";\nexport { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\nfunction lock() {\n computeHmac.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { arrayify, hexDataSlice } from \"../utils/data.js\";\nimport { calculateCheckSum } from \"../address/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 removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nexport function publicToAddress(key, prefix) {\n const val = hexDataSlice(sha256(key), 12);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport function computeAddress(key, prefix) {\n let pubkey;\n if (typeof key === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return publicToAddress(pubkey, prefix); // getAddress(sha256(\"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, prefix) {\n // return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature);\n return publicToAddress(publicKey, prefix);\n}\nexport function extractPrefix(address) {\n address = getAddress(address);\n return address.substring(2, 4);\n}\n//# sourceMappingURL=address.js.map","import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument, } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => {\n this[index] = item;\n });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof name === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, new Map());\n // Remove any key thats not unique\n this.#names = Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n }));\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof prop === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply(this === receiver ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply(this === receiver ? target : this, [\n prop,\n ]);\n }\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n }\n /**\n * Returns the Result as a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray() {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject() {\n return this.#names.reduce((accum, name, index) => {\n assert(name != null, \"value at index ${ index } unnamed\", \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\",\n });\n // Add values for names that don't conflict\n if (!(name in accum)) {\n accum[name] = this.getValue(name);\n }\n return accum;\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(this.#names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(this.#names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = this.#names.indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: WordSize,\n offset: bytes.length,\n });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\",\n type: \"string\",\n localName: \"string\",\n dynamic: \"boolean\",\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() {\n return this.#dataLength;\n }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n constructor(data, allowLoose) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#offset = 0;\n }\n get data() {\n return hexlify(this.#data);\n }\n get dataLength() {\n return this.#data.length;\n }\n get consumed() {\n return this.#offset;\n }\n get bytes() {\n return new Uint8Array(this.#data);\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose &&\n loose &&\n this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength,\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose);\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map","/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, {\n signed,\n width,\n });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${size ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_corebc_typed\");\nexport class Typed {\n type;\n value;\n #options;\n _typedSymbol;\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n defaultValue() {\n return 0;\n }\n minValue() {\n return 0;\n }\n maxValue() {\n return 0;\n }\n isBigInt() {\n return !!this.type.match(/^u?int[0-9]+$/);\n }\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n isString() {\n return this.type === \"string\";\n }\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return this.value.length;\n }\n return null;\n }\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n static uint8(v) {\n return n(v, 8);\n }\n static uint16(v) {\n return n(v, 16);\n }\n static uint24(v) {\n return n(v, 24);\n }\n static uint32(v) {\n return n(v, 32);\n }\n static uint40(v) {\n return n(v, 40);\n }\n static uint48(v) {\n return n(v, 48);\n }\n static uint56(v) {\n return n(v, 56);\n }\n static uint64(v) {\n return n(v, 64);\n }\n static uint72(v) {\n return n(v, 72);\n }\n static uint80(v) {\n return n(v, 80);\n }\n static uint88(v) {\n return n(v, 88);\n }\n static uint96(v) {\n return n(v, 96);\n }\n static uint104(v) {\n return n(v, 104);\n }\n static uint112(v) {\n return n(v, 112);\n }\n static uint120(v) {\n return n(v, 120);\n }\n static uint128(v) {\n return n(v, 128);\n }\n static uint136(v) {\n return n(v, 136);\n }\n static uint144(v) {\n return n(v, 144);\n }\n static uint152(v) {\n return n(v, 152);\n }\n static uint160(v) {\n return n(v, 160);\n }\n static uint168(v) {\n return n(v, 168);\n }\n static uint176(v) {\n return n(v, 176);\n }\n static uint184(v) {\n return n(v, 184);\n }\n static uint192(v) {\n return n(v, 192);\n }\n static uint200(v) {\n return n(v, 200);\n }\n static uint208(v) {\n return n(v, 208);\n }\n static uint216(v) {\n return n(v, 216);\n }\n static uint224(v) {\n return n(v, 224);\n }\n static uint232(v) {\n return n(v, 232);\n }\n static uint240(v) {\n return n(v, 240);\n }\n static uint248(v) {\n return n(v, 248);\n }\n static uint256(v) {\n return n(v, 256);\n }\n static uint(v) {\n return n(v, 256);\n }\n static int8(v) {\n return n(v, -8);\n }\n static int16(v) {\n return n(v, -16);\n }\n static int24(v) {\n return n(v, -24);\n }\n static int32(v) {\n return n(v, -32);\n }\n static int40(v) {\n return n(v, -40);\n }\n static int48(v) {\n return n(v, -48);\n }\n static int56(v) {\n return n(v, -56);\n }\n static int64(v) {\n return n(v, -64);\n }\n static int72(v) {\n return n(v, -72);\n }\n static int80(v) {\n return n(v, -80);\n }\n static int88(v) {\n return n(v, -88);\n }\n static int96(v) {\n return n(v, -96);\n }\n static int104(v) {\n return n(v, -104);\n }\n static int112(v) {\n return n(v, -112);\n }\n static int120(v) {\n return n(v, -120);\n }\n static int128(v) {\n return n(v, -128);\n }\n static int136(v) {\n return n(v, -136);\n }\n static int144(v) {\n return n(v, -144);\n }\n static int152(v) {\n return n(v, -152);\n }\n static int160(v) {\n return n(v, -160);\n }\n static int168(v) {\n return n(v, -168);\n }\n static int176(v) {\n return n(v, -176);\n }\n static int184(v) {\n return n(v, -184);\n }\n static int192(v) {\n return n(v, -192);\n }\n static int200(v) {\n return n(v, -200);\n }\n static int208(v) {\n return n(v, -208);\n }\n static int216(v) {\n return n(v, -216);\n }\n static int224(v) {\n return n(v, -224);\n }\n static int232(v) {\n return n(v, -232);\n }\n static int240(v) {\n return n(v, -240);\n }\n static int248(v) {\n return n(v, -248);\n }\n static int256(v) {\n return n(v, -256);\n }\n static int(v) {\n return n(v, -256);\n }\n static bytes1(v) {\n return b(v, 1);\n }\n static bytes2(v) {\n return b(v, 2);\n }\n static bytes3(v) {\n return b(v, 3);\n }\n static bytes4(v) {\n return b(v, 4);\n }\n static bytes5(v) {\n return b(v, 5);\n }\n static bytes6(v) {\n return b(v, 6);\n }\n static bytes7(v) {\n return b(v, 7);\n }\n static bytes8(v) {\n return b(v, 8);\n }\n static bytes9(v) {\n return b(v, 9);\n }\n static bytes10(v) {\n return b(v, 10);\n }\n static bytes11(v) {\n return b(v, 11);\n }\n static bytes12(v) {\n return b(v, 12);\n }\n static bytes13(v) {\n return b(v, 13);\n }\n static bytes14(v) {\n return b(v, 14);\n }\n static bytes15(v) {\n return b(v, 15);\n }\n static bytes16(v) {\n return b(v, 16);\n }\n static bytes17(v) {\n return b(v, 17);\n }\n static bytes18(v) {\n return b(v, 18);\n }\n static bytes19(v) {\n return b(v, 19);\n }\n static bytes20(v) {\n return b(v, 20);\n }\n static bytes21(v) {\n return b(v, 21);\n }\n static bytes22(v) {\n return b(v, 22);\n }\n static bytes23(v) {\n return b(v, 23);\n }\n static bytes24(v) {\n return b(v, 24);\n }\n static bytes25(v) {\n return b(v, 25);\n }\n static bytes26(v) {\n return b(v, 26);\n }\n static bytes27(v) {\n return b(v, 27);\n }\n static bytes28(v) {\n return b(v, 28);\n }\n static bytes29(v) {\n return b(v, 29);\n }\n static bytes30(v) {\n return b(v, 30);\n }\n static bytes31(v) {\n return b(v, 31);\n }\n static bytes32(v) {\n return b(v, 32);\n }\n static address(v) {\n return new Typed(_gaurd, \"address\", v);\n }\n static bool(v) {\n return new Typed(_gaurd, \"bool\", !!v);\n }\n static bytes(v) {\n return new Typed(_gaurd, \"bytes\", v);\n }\n static string(v) {\n return new Typed(_gaurd, \"string\", v);\n }\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return value && value._typedSymbol === _typedSymbol;\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map","import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 22));\n }\n}\n//# sourceMappingURL=address.js.map","import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map","import { defineProperties, isError, assert, assertArgument, assertArgumentCount, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof values === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => {\n func(staticWriter.length);\n });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\";\n const dynamic = length === -1 || coder.dynamic;\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? \" \" + this.localName : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", {\n buffer: reader.bytes,\n offset: count * WordSize,\n length: reader.dataLength,\n });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map","import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map","import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map","import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\".substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map","import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map","import { defineProperties, fromTwos, getBigInt, mask, toTwos, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = (signed ? \"int\" : \"uint\") + size * 8;\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, this.size * 8 - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map","import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map","import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = \"tuple(\" + types.join(\",\") + \")\";\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, {\n coders: Object.freeze(coders.slice()),\n });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map","import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.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 * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map","/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of ore in a single xcb.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const OrePerXCB = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") *\n BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nexport const NegativeOne = /*#__PURE__*/ BigInt(-1);\nexport const Zero = /*#__PURE__*/ BigInt(0);\nexport const One = /*#__PURE__*/ BigInt(1);\nexport const Two = /*#__PURE__*/ BigInt(2);\n//# sourceMappingURL=numbers.js.map","// NFKC (composed) // (decomposed)\n/**\n * A constant for the core symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const CoreSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Core Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Core Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map","import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n }),\n };\n}\n/**\n * Returns a [[AccessList]] from any corebcsupported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof set === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof value === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => a.address.localeCompare(b.address));\n return result;\n}\n//# sourceMappingURL=accesslist.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { recoverAddress } from \"./address.js\";\nimport { checkProperties } from \"../utils/properties.js\";\nimport { arrayify, stripZeros } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport * as RLP from \"../crypto/rlp.js\";\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst logger = new Logger(\"transaction/0.0.1\");\nconst BN_0 = BigInt(0);\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction parse(data) {\n const handleNumber = (value) => {\n // @ts-ignore\n if (value === \"0x\") {\n return BigNumber.from(0);\n }\n return BigNumber.from(value);\n };\n const transaction = RLP.decode(data);\n if (transaction.length !== 7 && transaction.length !== 8) {\n logger.throwArgumentError(\"invalid raw transaction\", \"data\", data);\n }\n const isSigned = transaction.length === 8;\n const tx = {\n nonce: Number(handleNumber(transaction[0])),\n energyPrice: handleNumber(transaction[1]).toBigInt(),\n energyLimit: handleNumber(transaction[2]).toBigInt(),\n networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(),\n to: handleAddress(transaction[isSigned ? 4 : 3]),\n value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(),\n data: transaction[isSigned ? 6 : 5],\n };\n if (transaction.length === 8) {\n const prefix = networkIdToPrefix(Number(tx.networkId));\n const digest = sha256(serialize(tx));\n tx.hash = sha256(serialize(tx, transaction[7]));\n tx.from = recoverAddress(digest, transaction[7], prefix);\n tx.signature = transaction[7];\n }\n return tx;\n}\nconst unsignedTransactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n { name: \"networkId\", maxLength: 32, numeric: true },\n];\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"networkId\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n networkId: true,\n data: true,\n energyLimit: true,\n energyPrice: true,\n nonce: true,\n to: true,\n value: true,\n};\nfunction serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) {\n let value = transaction[name] || [];\n const options = {};\n if (numeric) {\n options.hexPad = \"left\";\n }\n const tmpHexlified = hexlify(value, options);\n value = arrayify(tmpHexlified);\n // Fixed-width field\n if (length && value.length !== length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n // Variable-width (with a maximum)\n if (maxLength) {\n value = stripZeros(value);\n if (value.length > maxLength) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n }\n const hexlified = hexlify(value);\n raw.push(hexlified);\n });\n if (!!signature) {\n raw.push(hexlify(signature));\n }\n const finalValue = RLP.encode(raw);\n return finalValue;\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Core by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in corebc) 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 #to;\n #data;\n #nonce;\n #energyLimit;\n #energyPrice;\n #value;\n #networkId;\n #sig;\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n return this.#to;\n }\n set to(value) {\n this.#to = value == null ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() {\n return this.#nonce;\n }\n set nonce(value) {\n this.#nonce = getNumber(value, \"value\");\n }\n /**\n * The energy limit.\n */\n get energyLimit() {\n return this.#energyLimit;\n }\n set energyLimit(value) {\n this.#energyLimit = getBigInt(value);\n }\n /**\n * The energy 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 energyPrice() {\n const value = this.#energyPrice;\n if (value == null) {\n return BN_0;\n }\n return value;\n }\n set energyPrice(value) {\n this.#energyPrice = value == null ? null : getBigInt(value, \"energyPrice\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() {\n return this.#data;\n }\n set data(value) {\n this.#data = hexlify(value);\n }\n /**\n * The amount of xcb (in ore) to send in this transactions.\n */\n get value() {\n return this.#value;\n }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value);\n }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() {\n return this.#sig || null;\n }\n set signature(value) {\n this.#sig = value == null ? null : value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#to = null;\n this.#nonce = 0;\n this.#energyLimit = BigInt(0);\n this.#energyPrice = null;\n this.#data = \"0x\";\n this.#value = BigInt(0);\n this.#networkId = BigInt(0);\n this.#sig = 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 sha256(this.serialized);\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 sha256(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 const prefix = networkIdToPrefix(Number(this.#networkId));\n return recoverAddress(this.unsignedHash, this.signature, prefix);\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);\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 //isSigned(): this is SignedTransaction {\n return this.signature != null;\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 assert(this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n return serialize(this, this.signature);\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 serialize(this);\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 to: this.to,\n data: this.data,\n nonce: this.nonce,\n energyLimit: s(this.energyLimit),\n energyPrice: s(this.energyPrice),\n value: s(this.value),\n networkId: s(this.networkId),\n sig: this.signature ? this.signature : null,\n };\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 return Transaction.from(parse(payload));\n }\n const result = new Transaction();\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.energyLimit != null) {\n result.energyLimit = tx.energyLimit;\n }\n if (tx.energyPrice != null) {\n result.energyPrice = tx.energyPrice;\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.networkId != null) {\n result.networkId = tx.networkId;\n }\n if (tx.signature != null) {\n result.signature = tx.signature;\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 { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof message === \"string\") {\n message = toUtf8Bytes(message);\n }\n return sha256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message,\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig, prefix) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig, prefix);\n}\n//# sourceMappingURL=message.js.map","import { getAddress } from \"../address/index.js\";\nimport { sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument, } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = !!value ? \"0x01\" : \"0x00\";\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = match[1] === \"int\";\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) &&\n size % 8 === 0 &&\n size !== 0 &&\n size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map","import { getAddress } from \"../address/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\";\nimport { sha256 } from \"../crypto/index.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\");\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 networkId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\",\n};\nconst domainFieldNames = [\n \"name\",\n \"version\",\n \"networkId\",\n \"verifyingContract\",\n \"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 networkId: function (_value) {\n const value = getBigInt(_value, \"domain.networkId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.networkId\", _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] || \"256\");\n assertArgument(width % 8 === 0 &&\n width !== 0 &&\n width <= 256 &&\n (match[2] == null || 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\":\n return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\":\n return function (value) {\n return !value ? hexFalse : hexTrue;\n };\n case \"bytes\":\n return function (value) {\n return sha256(value);\n };\n case \"string\":\n return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields\n .map(({ name, type }) => type + \" \" + name)\n .join(\",\")})`;\n}\nexport class TypedDataEncoder {\n primaryType;\n #types;\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n constructor(types) {\n this.#types = JSON.stringify(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 Object.keys(types).forEach((type) => {\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\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 = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1] || null;\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\n .map((t) => JSON.stringify(t))\n .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]) +\n st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(sha256);\n }\n return sha256(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 sha256(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 encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return sha256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n return value.map((v) => this._visit(match[1], 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 visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\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 static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value),\n ]);\n }\n static hash(domain, types, value) {\n return sha256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\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 &&\n !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 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 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, prefix) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix);\n}\n//# sourceMappingURL=typed-data.js.map","/**\n * About frgaments...\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nvar _a;\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\",\n \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\",\n \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\",\n \"@\": \"AT\",\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() {\n return this.#offset;\n }\n get length() {\n return this.#tokens.length - this.#offset;\n }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() {\n return new _a(this.#tokens);\n }\n reset() {\n this.#offset = 0;\n }\n #subTokenString(from = 0, to = 0) {\n return new _a(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: t.match - from,\n linkBack: t.linkBack - from,\n linkNext: t.linkNext - from,\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return top != null && allowed.has(top) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return top.type === type ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\n_a = TokenString;\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = offset < text.length ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = {\n depth: brackets.length,\n linkBack: -1,\n linkNext: -1,\n match: -1,\n type: \"\",\n text: \"\",\n offset,\n value: -1,\n };\n tokens.push(token);\n let type = SimpleTokens[cur[0]] || \"\";\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n tokens[token.match].match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n tokens[tokens.length - 1].value =\n getNumber(value);\n }\n if (tokens.length === 0 ||\n tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n tokens[tokens.length - 1].text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a energy limit, returning a BigNumber or null if none\nfunction consumeEnergy(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid energy\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_corebc_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **PAramType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name,\n type,\n baseType,\n indexed,\n components,\n arrayLength,\n arrayChildren,\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n let result = {\n type: this.baseType === \"tuple\" ? \"tuple\" : this.type,\n name: this.name || undefined,\n };\n if (typeof this.indexed === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${this.arrayLength < 0 ? \"\" : String(this.arrayLength)}]`;\n }\n else {\n if (this.isTuple()) {\n if (format !== \"sighash\") {\n result += this.type;\n }\n result +=\n \"(\" +\n this.components\n .map((comp) => comp.format(format))\n .join(format === \"full\" ? \", \" : \",\") +\n \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /*\n * Returns true if %%value%% is an Array type.\n *\n * This provides a type gaurd ensuring that the\n * [[arrayChildren]] and [[arrayLength]] are non-null.\n */\n //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } {\n // return value && (value.baseType === \"array\")\n //}\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return this.baseType === \"array\";\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return this.baseType === \"tuple\";\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return this.indexed != null;\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => _this.arrayChildren.walk(v, process));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => _this.components[i].walk(v, process));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof value !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () {\n setValue(await result);\n })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS naes by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ParamType.from(lex(obj), allowIndexed);\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") ||\n obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = obj.peekType(\"ID\") ? obj.pop().text : \"\";\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof name === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components,\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" ||\n type.startsWith(\"tuple(\" /* fix: ) */) ||\n type.startsWith(\"(\" /* fix: ) */)) {\n const comps = obj.components != null\n ? obj.components.map((c) => ParamType.from(c))\n : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return value && value[internal] === ParamTypeInternal;\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof obj === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n }\n else if (typeof obj === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\",\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof name === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return (\"(\" +\n params.map((p) => p.format(format)).join(format === \"full\" ? \", \" : \",\") +\n \")\");\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === ErrorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return EventFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n static isFragment(value) {\n return value && value[internal] === EventFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n payable;\n energy;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, energy) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, {\n value: ConstructorFragmentInternal,\n });\n defineProperties(this, { payable, energy });\n }\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: this.payable ? \"payable\" : \"undefined\",\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n result.push(this.payable ? \"payable\" : \"nonpayable\");\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n return result.join(\" \");\n }\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ConstructorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, setify([\"payable\"])).has(\"payable\");\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, energy);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === ConstructorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n format(format) {\n const type = this.inputs.length === 0 ? \"receive\" : \"fallback\";\n if (format === \"json\") {\n const stateMutability = this.payable ? \"payable\" : \"nonpayable\";\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FallbackFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = obj.stateMutability === \"payable\";\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n static isFragment(value) {\n return value && value[internal] === FallbackFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The amount of energy to send when calling this function\n */\n energy;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, energy) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = stateMutability === \"view\" || stateMutability === \"pure\";\n const payable = stateMutability === \"payable\";\n defineProperties(this, {\n constant,\n energy,\n outputs,\n payable,\n stateMutability,\n });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: this.stateMutability !== \"nonpayable\"\n ? this.stateMutability\n : undefined,\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n }\n return result.join(\" \");\n }\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FunctionFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof obj.constant === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === FunctionFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n format() {\n throw new Error(\"@TODO\");\n }\n static from(obj) {\n if (typeof obj === \"string\") {\n return StructFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === StructFragmentInternal;\n }\n}\n//# sourceMappingURL=fragments.js.map","/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason],\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code],\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: tx.to ? getAddress(tx.to) : null,\n data: tx.data || \"0x\",\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action,\n data,\n reason,\n transaction,\n invocation,\n revert,\n });\n}\n/**\n * About AbiCoder\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, match[1] === \"int\", param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose));\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an corebc-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map","/**\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","/**\n * About Interface\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert, } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nexport { checkResultErrors, Result };\nexport class LogDescription {\n fragment;\n name;\n signature;\n topic;\n args;\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n signature,\n topic,\n args,\n });\n }\n}\nexport class TransactionDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n value;\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n value,\n });\n }\n}\nexport class ErrorDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n });\n }\n}\nexport class Indexed {\n hash;\n _isIndexed;\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n },\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n },\n },\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving xcb is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof fragments === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(\"EE\", error);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags),\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, {\n deploy: fragment,\n });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback ||\n fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\"),\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = minimal ? \"minimal\" : \"full\";\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = values.length > 0 ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength &&\n (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 &&\n values &&\n values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null ||\n Array.isArray(lastArg) ||\n typeof lastArg !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#functions.get(name), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#events.get(name), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#errors.get(name), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\n getSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n\n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n\n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n\n fragment = matches[0];\n }\n\n return dataSlice(id(fragment.format()), 0, 4);\n }\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if (bytes.length % 32 === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() },\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name,\n signature: ef.format(),\n args,\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args,\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n\n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n };\n\n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n*/\n // Create the filter for the event with search criteria (e.g. for xcb_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return sha256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof value === \"boolean\") {\n value = value ? \"0x01\" : \"0x00\";\n }\n if (param.type.match(/^u?int/)) {\n value = toBeHex(value);\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n //@TOOD should probably be return toHex(value, 32)\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", \"contract.\" + param.name, value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", \"contract.\" + param.name, value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(sha256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics,\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" ||\n param.type === \"bytes\" ||\n param.baseType === \"tuple\" ||\n param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt(tx.value != null ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof value === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // Maybe an interface from an older version, or from a symlinked copy\n if (typeof value.format === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map","import { concat, \n// dataSlice,\ngetBigInt,\n// encodeRlp\n } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { hexDataLength, hexDataSlice } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { removeHexPrefix } from \"../transaction/address.js\";\nimport { calculateCheckSum } from \"./index.js\";\nconst logger = new Logger(\"contract-address/0.0.1\");\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(from);\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\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 * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n const val = hexDataSlice(sha256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12);\n console.log({ \"contract-address/74=>should be string\": val });\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\n//# sourceMappingURL=contract-address.js.map","import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.corebc.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return value && typeof value.getAddress === \"function\";\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null ||\n result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof target !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target) {\n if (typeof target === \"string\") {\n return getAddress(target);\n // assert(resolver != null, \"ENS resolution requires a provider\",\n // \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n // return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof target.then === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map","import { defineProperties, getBigInt, getNumber, hexlify, resolveProperties, assert, assertArgument, isError, makeError, } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The energy price for legacy networks.\n */\n energyPrice;\n constructor(energyPrice) {\n defineProperties(this, {\n energyPrice: getValue(energyPrice),\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { energyPrice } = this;\n return {\n _type: \"FeeData\",\n energyPrice: toJson(energyPrice),\n };\n }\n}\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"networkId,energyLimit,energyPrice,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipReadEnabled = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Core.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total energy limit for this block.\n */\n energyLimit;\n /**\n * The total energy used in this block.\n */\n energyUsed;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per energy that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerEnergy;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof tx !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n nonce: block.nonce,\n difficulty: block.difficulty,\n energyLimit: block.energyLimit,\n energyUsed: block.energyUsed,\n miner: block.miner,\n extraData: block.extraData,\n baseFeePerEnergy: getValue(block.baseFeePerEnergy),\n });\n }\n /**\n * Returns the list of transaction hashes.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof tx === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions for blocks which\n * prefetched them, by passing ``true`` to %%prefetchTxs%%\n * into [[provider_getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof txs[0] === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\",\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this;\n return {\n _type: \"Block\",\n baseFeePerEnergy: toJson(baseFeePerEnergy),\n difficulty: toJson(difficulty),\n extraData,\n energyLimit: toJson(energyLimit),\n energyUsed: toJson(energyUsed),\n hash,\n miner,\n nonce,\n number,\n parentHash,\n timestamp,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++],\n done: false,\n };\n }\n return { value: undefined, done: true };\n },\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() {\n return this.#transactions.length;\n }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof indexOrHash === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof v === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash === hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof tx === \"string\") {\n return await this.provider.getTransaction(tx);\n }\n else {\n return tx;\n }\n }\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof indexOrHash === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Has this block been mined.\n *\n * If true, the block has been typed-gaurded that all mined\n * properties are non-null.\n */\n isMined() {\n return !!this.hash;\n }\n /**\n *\n */\n isLondon() {\n return !!this.baseFeePerEnergy;\n }\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\nexport class Log {\n provider;\n transactionHash;\n blockHash;\n blockNumber;\n removed;\n address;\n data;\n topics;\n index;\n transactionIndex;\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this;\n return {\n _type: \"log\",\n address,\n blockHash,\n blockNumber,\n data,\n index,\n removed,\n topics,\n transactionHash,\n transactionIndex,\n };\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\nexport class TransactionReceipt {\n provider;\n to;\n from;\n contractAddress;\n hash;\n index;\n blockHash;\n blockNumber;\n logsBloom;\n energyUsed;\n cumulativeEnergyUsed;\n energyPrice;\n type;\n //readonly byzantium!: boolean;\n status;\n root;\n #logs;\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n energyUsed: tx.energyUsed,\n cumulativeEnergyUsed: tx.cumulativeEnergyUsed,\n energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice),\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root,\n });\n }\n get logs() {\n return this.#logs;\n }\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,\n status, root, } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash,\n blockNumber,\n //byzantium,\n contractAddress,\n cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed),\n from,\n energyPrice: toJson(this.energyPrice),\n energyUsed: toJson(this.energyUsed),\n hash,\n index,\n logs,\n logsBloom,\n root,\n status,\n to,\n };\n }\n get length() {\n return this.logs.length;\n }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n },\n };\n }\n get fee() {\n return this.energyUsed * this.energyPrice;\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n async getResult() {\n return await this.provider.getTransactionResult(this.hash);\n }\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/*\nexport type ReplacementDetectionSetup = {\n to: string;\n from: string;\n value: bigint;\n data: string;\n nonce: number;\n block: number;\n};\n*/\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of energy this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n energyLimit;\n /**\n * The energy price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective energy price// (the fee per energy that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerEnergy]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of energy the transaction\n * consumes.\n */\n energyPrice;\n /**\n * The data.\n */\n data;\n /**\n * The value, in ore. Use [[formatXCB]] to format this value\n * as xcb.\n */\n value;\n /**\n * The chain ID.\n */\n networkId;\n /**\n * The signature.\n */\n signature;\n #startBlock;\n /**\n * Create a new TransactionResponse with %%tx%% parameters\n * connected to %%provider%%.\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null;\n this.blockHash = tx.blockHash != null ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.from = tx.from;\n this.to = tx.to || null;\n this.energyLimit = tx.energyLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.energyPrice = tx.energyPrice;\n this.networkId = tx.networkId;\n this.signature = tx.signature;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON representation of this transaction.\n */\n toJSON() {\n const { index, hash, type, to, from, nonce, data, signature } = this;\n return {\n _type: \"TransactionReceipt\",\n networkId: toJson(this.networkId),\n data,\n from,\n energyLimit: toJson(this.energyLimit),\n energyPrice: toJson(this.energyPrice),\n hash,\n nonce,\n signature,\n to,\n index,\n type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = _confirms == null ? 1 : _confirms;\n const timeout = _timeout == null ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = startBlock === -1 ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from),\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if (blockNumber - receipt.blockNumber + 1 < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data &&\n tx.to === this.to &&\n tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" &&\n tx.from === tx.to &&\n tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: reason === \"replaced\" || reason === \"cancelled\",\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt,\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (receipt) {\n if ((await receipt.confirmations()) >= confirms) {\n return receipt;\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => {\n cancellers.forEach((c) => c());\n };\n // On cancel, stop scanning for replacements\n cancellers.push(() => {\n stopScanning = true;\n });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => {\n clearTimeout(timer);\n });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n resolve(receipt);\n }\n };\n cancellers.push(() => {\n this.provider.off(this.hash, txListener);\n });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => {\n this.provider.off(\"block\", replaceListener);\n });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return this.blockHash != null;\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return this.type === 0;\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return {\n orphan: \"drop-log\",\n log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index,\n },\n };\n}\n//# sourceMappingURL=provider.js.map","import { Log, TransactionReceipt, TransactionResponse, } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\nexport class EventLog extends Log {\n interface;\n fragment;\n args;\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length\n ? this.#iface.getEvent(log.topics[0])\n : null;\n if (fragment) {\n return new EventLog(log, this.#iface, fragment);\n }\n else {\n return log;\n }\n });\n }\n}\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n async wait(confirms) {\n const receipt = await super.wait();\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\nexport class ContractUnknownEventPayload extends EventPayload {\n log;\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n async getBlock() {\n return await this.log.getBlock();\n }\n async getTransaction() {\n return await this.log.getTransaction();\n }\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map","import { Indexed, Interface, Typed } from \"../abi/index.js\";\nimport { resolveAddress } from \"../address/checks.js\";\nimport { copyRequest, Log, } from \"../providers/provider.js\";\nimport { defineProperties, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument, } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return value && typeof value.call === \"function\";\n}\nfunction canEstimate(value) {\n return value && typeof value.estimateEnergy === \"function\";\n}\nfunction canResolve(value) {\n return value && typeof value.resolveName === \"function\";\n}\nfunction canSend(value) {\n return value && typeof value.sendTransaction === \"function\";\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof value[feature] === \"function\") {\n return value;\n }\n if (value.provider && typeof value.provider[feature] === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(Typed.dereference(arg, \"overrides\"));\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from);\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n const iface = contract.interface;\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || (tx.value || BN_0) === BN_0, \"cannot send value to non-payable contract\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || (tx.data || \"0x\") === \"0x\", \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment in getFragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs),\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract,\n _key: key,\n getFragment,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment in defineProperty\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment in\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract,\n _key: key,\n getFragment,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_corebcInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value &&\n typeof value === \"object\" &&\n \"getTopicFilter\" in value &&\n typeof value.getTopicFilter === \"function\" &&\n value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof event === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics\n .map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n })\n .join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = addr ? addr : contract;\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment\n ? contract.interface.decodeEventLog(fragment, log.data, log.topics)\n : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n return count > 0;\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n target;\n interface;\n runner;\n filters;\n [internal];\n fallback;\n constructor(target, abi, runner, _deployTx) {\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof target === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, _prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = this.getEvent(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract event: ${prop}`);\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop)));\n },\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null,\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, _prop, receiver) => {\n if (_prop in target || passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = target.getFunction(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract method: ${prop}`);\n },\n has: (target, prop) => {\n if (prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(String(prop));\n },\n });\n }\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n async getAddress() {\n return await getInternal(this).addrPromise;\n }\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n async waitForDeployment() {\n // We have the deployement transaction; just use that (throws if deployement fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n getFunction(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n getEvent(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n async queryTransaction(hash) {\n // Is this useful?\n throw new Error(\"@TODO\");\n }\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = addr ? addr : await addrPromise;\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n return new EventLog(log, this.interface, foundFragment);\n }\n else {\n return new Log(log, provider);\n }\n });\n }\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners\n .map(({ listener }) => listener)\n .indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n 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 await this.off(event, listener);\n }\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map","import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\nimport { isBytes } from \"../utils/data.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\nexport class ContractFactory {\n interface;\n bytecode;\n runner;\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else if (typeof bytecode === \"string\") {\n bytecode = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecode = hexlify(bytecode);\n }\n else if (bytecode && typeof bytecode.object === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecode = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecode = \"!\";\n }\n defineProperties(this, {\n // @ts-ignore\n bytecode,\n interface: iface,\n runner: runner || null,\n });\n }\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([\n this.bytecode,\n this.interface.encodeDeploy(resolvedArgs),\n ]);\n return Object.assign({}, overrides, { data });\n }\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof this.runner.sendTransaction === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\",\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof output === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map","/**\n * @_ignore\n */\nimport { getAddress } from \"../address/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.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) {\n return (array) => {\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 number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n energyLimit: getBigInt,\n energyUsed: getBigInt,\n miner: allowNull(getAddress),\n extraData: formatData,\n baseFeePerEnergy: allowNull(getBigInt),\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 energyUsed: getBigInt,\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeEnergyUsed: getBigInt,\n effectiveEnergyPrice: allowNull(getBigInt),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0),\n}, {\n effectiveEnergyPrice: [\"energyPrice\"],\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 && !getAddress(value.to) && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n //confirmations: allowNull(getNumber, null),\n from: getAddress,\n maxFeePerEnergy: allowNull(getBigInt),\n energyLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n networkId: allowNull(getBigInt, null),\n }, {\n data: [\"input\"],\n energyLimit: [\"energy\"],\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 // Compute the signature\n if (value.signature) {\n result.signature = value.signature;\n }\n else {\n result.signature = value;\n }\n // Some backends omit networkId on legacy transactions, but we can compute it\n if (result.networkId == null) {\n const networkId = result.signature.legacynetworkId;\n if (networkId != null) {\n result.networkId = networkId;\n }\n }\n // @TODO: check networkId\n /*\n if (value.networkId != null) {\n let networkId = value.networkId;\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n result.networkId = networkId;\n\n } else {\n let networkId = value.networkId;\n\n // geth-etc returns networkId\n if (networkId == null && result.v == null) {\n networkId = value.networkId;\n }\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n if (typeof(networkId) !== \"number\" && result.v != null) {\n networkId = (result.v - 35) / 2;\n if (networkId < 0) { networkId = 0; }\n networkId = parseInt(networkId);\n }\n\n if (typeof(networkId) !== \"number\") { networkId = 0; }\n\n result.networkId = networkId;\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 { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nexport class NetworkPlugin {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\nexport class EnergyCostPlugin extends NetworkPlugin {\n effectiveBlock;\n txBase;\n txCreate;\n txDataZero;\n txDataNonzero;\n txAccessListStorageKey;\n txAccessListAddress;\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.corebc.network.plugins.EnergyCost#${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 clone() {\n return new EnergyCostPlugin(this.effectiveBlock, this);\n }\n}\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n constructor(feeDataFunc) {\n super(\"org.corebc.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\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 * About networks\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { getBigInt, assertArgument } from \"../utils/index.js\";\nimport { EnergyCostPlugin } from \"./plugins-network.js\";\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*/\n// Networks or clients with a higher need for security (such as clients\n// that may automatically make CCIP requests without user interaction)\n// can use this plugin to anonymize requests or intercept CCIP requests\n// to notify and/or receive authorization from the user\nconst Networks = new Map();\nexport class Network {\n #name;\n #networkId;\n #plugins;\n constructor(name, networkId) {\n this.#name = name;\n this.#networkId = getBigInt(networkId);\n this.#plugins = new Map();\n }\n toJSON() {\n return { name: this.name, networkId: String(this.networkId) };\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() {\n return this.#name;\n }\n set name(value) {\n this.#name = value;\n }\n /**\n * The network chain ID.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value, \"networkId\");\n }\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.networkId === 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.networkId === getBigInt(other);\n }\n catch (error) { }\n return false;\n }\n if (typeof other === \"object\") {\n if (other.networkId != null) {\n try {\n return this.networkId === getBigInt(other.networkId);\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.networkId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic energy required for a transaction.\n *\n * A EnergyCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicEnergy(tx) {\n const costs = this.getPlugin(\"org.corebc.plugins.network.EnergyCost\") || new EnergyCostPlugin();\n let energy = costs.txBase;\n if (tx.to == null) {\n energy += 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 energy += costs.txDataZero;\n }\n else {\n energy += costs.txDataNonzero;\n }\n }\n }\n return energy;\n }\n /**\n * Returns a new Network for the %%network%% name or networkId.\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.networkId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof network === \"object\") {\n assertArgument(typeof network.name === \"string\" &&\n typeof network.networkId === \"number\", \"invalid network object name or networkId\", \"network\", network);\n const custom = new Network(network.name, network.networkId);\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrnetworkId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrnetworkId, networkFunc) {\n if (typeof nameOrnetworkId === \"number\") {\n nameOrnetworkId = BigInt(nameOrnetworkId);\n }\n const existing = Networks.get(nameOrnetworkId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrnetworkId\", nameOrnetworkId);\n }\n Networks.set(nameOrnetworkId, networkFunc);\n }\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Core networks\n function registerEth(name, networkId, options) {\n const func = function () {\n const network = new Network(name, networkId);\n network.attachPlugin(new EnergyCostPlugin());\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(networkId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\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 registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map","import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * @TODO\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\",\n info: { event },\n });\n}\n// @TODO: refactor this\n/**\n * @TODO\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 constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n get pollingInterval() {\n return this.#interval;\n }\n set pollingInterval(value) {\n this.#interval = value;\n }\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\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) {\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n/**\n * @TODO\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\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 * @TODO\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 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 this.#blockNumber = blockNumber;\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\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 * About Subclassing the Provider...\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/checks.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 { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse, } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse, } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber, } from \"./subscriber-polling.js\";\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return value && typeof value.then === \"function\";\n}\nfunction getTag(prefix, value) {\n return (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 // 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}\nexport class UnmanagedSubscriber {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\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 \"pending\":\n case \"debug\":\n case \"error\":\n case \"network\": {\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 {\n type: \"orphan\",\n tag: getTag(\"orphan\", event),\n filter: copy(event),\n };\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));\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() {\n return new Date().getTime();\n}\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\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 // @TODO: This should be a () => Promise so network can be\n // done when needed; or rely entirely on _detectNetwork?\n constructor(_network) {\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(() => {\n this.emit(\"network\", network, null);\n }, 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.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get provider() {\n return this;\n }\n get plugins() {\n return Array.from(this.#plugins.values());\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 getPlugin(name) {\n return this.#plugins.get(name) || null;\n }\n get disableCcipRead() {\n return this.#disableCcipRead;\n }\n set disableCcipRead(value) {\n this.#disableCcipRead = !!value;\n }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\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 }, 250);\n }\n return await perform;\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\", {\n action: \"sendCcipReadFetchRequest\",\n request,\n index: i,\n urls,\n });\n let errorMessage = \"unknown error\";\n const resp = await request.send();\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchResult\",\n request,\n result,\n });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchError\",\n request,\n result,\n });\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\", {\n reason: \"404_MISSING_RESOURCE\",\n transaction: tx,\n info: { url, errorMessage },\n });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages\n .map((m) => JSON.stringify(m))\n .join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx,\n info: { urls, errorMessages },\n });\n }\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\",\n });\n }\n // Sub-classes should override this and handle PerformActionRequest requests, calling\n // the super for any unhandled actions.\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 _getAddress(address) {\n return resolveAddress(address);\n }\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"latest\":\n case \"pending\":\n case \"safe\":\n case \"finalized\":\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 _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:\n 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 _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]);\n if (isPromise(addr)) {\n promises.push((async function () {\n request[key] = await addr;\n })());\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 () {\n request.blockTag = await blockTag;\n })());\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 = this._detectNetwork().then((network) => {\n this.emit(\"network\", network, null);\n return network;\n }, (error) => {\n // Reset the networkPromise on failure, so we will try again\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\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, // Possibly an explicit Network\n this._detectNetwork(), // The actual connected network\n ]);\n if (expected.networkId !== actual.networkId) {\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.networkId} => ${actual.networkId} `, \"NETWORK_ERROR\", {\n event: \"changed\",\n });\n }\n }\n return expected.clone();\n }\n async getEnergyPrice() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async getFeeData() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async estimateEnergy(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateEnergy\",\n 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 return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead &&\n isCallException(error) &&\n error.data &&\n attempt >= 0 &&\n blockTag === \"latest\" &&\n transaction.to != null &&\n dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to);\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\",\n transaction,\n 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, // @TODO: populate data?\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\",\n transaction,\n info: { data: error.data, errorArgs: ccipArgs.errorArgs },\n });\n const tx = {\n to: txSender,\n data: concat([\n ccipArgs.selector,\n encodeBytes([ccipResult, ccipArgs.extraData]),\n ]),\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\", {\n action: \"receiveCcipReadCallResult\",\n transaction: Object.assign({}, tx),\n result,\n });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadCallError\",\n transaction: Object.assign({}, tx),\n error,\n });\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\",\n blockHash: block,\n 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\",\n blockTag,\n 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 effectiveEnergyPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.energyPrice == null && params.effectiveEnergyPrice == 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 effectiveEnergyPrice\");\n }\n params.effectiveEnergyPrice = tx.energyPrice;\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(networkId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\",\n });\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 _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 _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 _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n // Event API; sub-classes should override this; any supported\n // event filter will have been munged into an EventFilter\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 return new PollingBlockSubscriber(this);\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 _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\" &&\n emitArgs &&\n emitArgs.length > 0 &&\n 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 = {\n subscriber,\n tag,\n addressableMap,\n nameMap,\n started: false,\n listeners: [],\n };\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 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\n .map(({ listener }) => listener)\n .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 // Sub-classes should override this to shutdown any sockets, etc.\n // but MUST call this super.shutdown.\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 }\n get paused() {\n return this.#pausedState != null;\n }\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 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 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: \"\",\n urls: [],\n calldata: \"\",\n selector: \"\",\n extraData: \"\",\n 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\"\n .split(/,/)\n .map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map","/**\n * About Abstract Signer and subclassing\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/checks.js\";\nimport { getAddress } 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);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).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}\nexport class AbstractSigner {\n provider;\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.energyLimit == null) {\n pop.energyLimit = await this.estimateEnergy(pop);\n }\n // Populate the chain ID\n const network = await this.provider.getNetwork();\n if (pop.networkId != null) {\n const networkId = getBigInt(pop.networkId);\n assertArgument(networkId === network.networkId, \"transaction networkId mismatch\", \"tx.networkId\", tx.networkId);\n }\n else {\n pop.networkId = network.networkId;\n }\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n // We need to auto-detect the intended type of this transaction...\n if (feeData.energyPrice != null) {\n // Network doesn't support EIP-1559...\n // Populate missing fee data\n if (pop.energyPrice == null) {\n pop.energyPrice = feeData.energyPrice;\n }\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 //@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 estimateEnergy(tx) {\n return checkProvider(this, \"estimateEnergy\").estimateEnergy(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 return getAddress(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}\nexport class VoidSigner extends AbstractSigner {\n address;\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\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","/**\n * There are many awesome community services that provide Core\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in tht console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n}\n//# sourceMappingURL=community.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 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 _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\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\") ||\n error.operation !== \"xcb_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.networkId !== network.networkId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"xcb_getFilterChanges\", [\n filterId,\n ]);\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 this.#provider.send(\"xcb_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() {\n this.start();\n }\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 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(\"xcb_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(\"xcb_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 * About JSON-RPC...\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, 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\";\nimport { resolveAddress } from \"../address/checks.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) => {\n setTimeout(resolve, duration);\n });\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, // 10ms\n batchMaxSize: 1 << 20, // 1Mb\n batchMaxCount: 100, // 100 requests\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);\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 xcb_sendTransaction uses 90000 energy; 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.energyLimit == null) {\n promises.push((async () => {\n tx.energyLimit = await this.provider.estimateEnergy({\n ...tx,\n from: this.address,\n });\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);\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(\"xcb_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 const checkTx = async () => {\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 // Wait another 4 seconds\n this.provider._setTimeout(() => {\n checkTx();\n }, 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);\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(\"xcb_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),\n 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(\"xcb_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(),\n password,\n null,\n ]);\n }\n async _legacySignMessage(_message) {\n const message = typeof _message === \"string\" ? toUtf8Bytes(_message) : _message;\n return await this.provider.send(\"xcb_sign\", [\n this.address.toLowerCase(),\n 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 #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no hard in sending it immeidately\n const stallTime = this._getOption(\"batchMaxCount\") === 1\n ? 0\n : 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 // console.log({payload})\n const result = await this._send(payload);\n // console.log({result})\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\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 return reject(makeError(\"no response from server\", \"BAD_DATA\", {\n value: result,\n info: { payload },\n }));\n }\n // The response is an error\n if (\"error\" in resp) {\n return reject(this.getRpcError(payload, resp));\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);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n // Make sure any static network is compatbile with the provided netwrok\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (staticNetwork) {\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 {\n assert(false, \"sub-classes must override _send\", \"UNSUPPORTED_OPERATION\", {\n operation: \"jsonRpcApiProvider._send\"\n });\n }\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 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 return network;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n return Network.from(getBigInt(await this.send(\"xcb_networkId\", [])));\n }\n // We are not ready yet; use the primitive _send\n const payload = {\n id: this.#nextId++,\n method: \"xcb_networkId\",\n params: [],\n jsonrpc: \"2.0\",\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n }\n catch (error) {\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 /**\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) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n console.log(\"JsonRpcProvider failed to startup; retry in 1s\");\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() {\n return this.#notReady == null;\n }\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 [\n \"networkId\",\n \"energyLimit\",\n \"energyPrice\",\n \"type\",\n \"nonce\",\n \"value\",\n ].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"energyLimit\") {\n dstKey = \"energy\";\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 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 \"networkId\":\n return { method: \"xcb_networkId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"xcb_blockNumber\", args: [] };\n case \"getEnergyPrice\":\n return { method: \"xcb_energyPrice\", args: [] };\n case \"getBalance\": {\n return {\n method: \"xcb_getBalance\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n }\n case \"getTransactionCount\":\n return {\n method: \"xcb_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getCode\":\n return {\n method: \"xcb_getCode\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getStorage\":\n return {\n method: \"xcb_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: \"xcb_sendRawTransaction\",\n args: [req.signedTransaction],\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"xcb_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions],\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"xcb_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions],\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"xcb_getTransactionByHash\",\n args: [req.hash],\n };\n case \"getTransactionReceipt\":\n return {\n method: \"xcb_getTransactionReceipt\",\n args: [req.hash],\n };\n case \"call\":\n return {\n method: \"xcb_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag],\n };\n case \"estimateEnergy\": {\n return {\n method: \"xcb_estimateEnergy\",\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: \"xcb_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an CoreBC-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 === \"xcb_estimateEnergy\" && 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 }\n if (method === \"xcb_call\" || method === \"xcb_estimateEnergy\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException(method === \"xcb_call\" ? \"call\" : \"estimateEnergy\", payload.params[0], result ? result.data : null);\n e.info = { error, payload };\n return e;\n }\n // Only estimateEnergy 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\" &&\n error.message.match(/user denied|corebc-user-denied/i)) {\n const actionMap = {\n xcb_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n xcb_signTypedData_v4: \"signTypedData\",\n xcb_signTransaction: \"signTransaction\",\n xcb_sendTransaction: \"sendTransaction\",\n xcb_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 === \"xcb_sendRawTransaction\" ||\n method === \"xcb_sendTransaction\") {\n const transaction = payload.params[0];\n if (message.match(/insufficient funds|base fee exceeds energy limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction,\n 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\", {\n transaction,\n info: { error },\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) &&\n message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction,\n info: { error },\n });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method,\n info: { transaction, info: { error } },\n });\n }\n }\n if (message.match(/the method .* does not exist/i)) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method,\n info: { error },\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error });\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 networkId?? purge on switch_networks\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve,\n 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(\"xcb_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(\"xcb_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n}\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n this.#pollingInterval = 4000;\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() {\n return this.#pollingInterval;\n }\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. xcb_networkId) 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\" &&\n value.message.match(\"reverted\") &&\n 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 * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/xcb_goerli\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AnkrProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"xcb_sendRawTransaction\") {\n if (error &&\n error.error &&\n error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n}\n//# sourceMappingURL=provider-ankr.js.map","/**\n * About Alchemy\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.alchemyapi.io\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AlchemyProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash),\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = trace[0].error === \"Reverted\";\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null, // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", {\n value: trace,\n });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map","/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https://cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map","function getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map","/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\nexport class SocketSubscriber {\n #provider;\n #filter;\n get filter() {\n return JSON.parse(this.#filter);\n }\n #filterId;\n #paused;\n #emitPromise;\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider\n .send(\"xcb_subscribe\", this.filter)\n .then((filterId) => {\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n this.#filterId.then((filterId) => {\n this.#provider.send(\"xcb_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\nexport class SocketBlockSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\nexport class SocketPendingSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n get logFilter() {\n return JSON.parse(this.#logFilter);\n }\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * SocketProvider...\n *\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n constructor(network) {\n super(network, { batchMaxCount: 1 });\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n\n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n\n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n // Sub-classes must call this for each message\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (\"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result,\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result.method === \"xcb_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n }\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map","import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network) {\n super(network);\n if (typeof url === \"string\") {\n this.#connect = () => {\n return new _WebSocket(url);\n };\n this.#websocket = this.#connect();\n }\n else if (typeof url === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n*/\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map","/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret,\n });\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(networkId) {\n try {\n return new InfuraProvider(networkId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map","/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"corebc.quiknode.pro\";\n case \"arbitrum\":\n return \"corebc.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"corebc.arbitrum-goerli.quiknode.pro\";\n case \"matic\":\n return \"corebc.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"corebc.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"corebc.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"corebc.optimism-goerli.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(networkId) {\n try {\n return new QuickNodeProvider(networkId, this.token);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.token === defaultToken;\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map","/**\n * Explain all the nitty-gritty about the **FallbackProvider**.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { getBigInt, getNumber, assert, assertArgument, } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\nfunction getTime() {\n return new Date().getTime();\n}\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof value === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2,\n requests: 0,\n lateResponses: 0,\n errorResponses: 0,\n outOfSync: -1,\n unsupportedEvents: 0,\n rollingDuration: 0,\n score: 0,\n _network: null,\n _updateNumber: null,\n _totalTime: 0,\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + value.map(_normalize).join(\",\") + \"]\";\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{\" +\n keys\n .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`)\n .join(\",\") +\n \"}\");\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(value) {\n if (\"error\" in value) {\n const error = value.error;\n return { tag: _normalize(error), value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum &&\n (weight > bestWeight ||\n (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A Fallback Provider.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n quorum;\n eventQuorum;\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n constructor(providers, network) {\n super(network);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n this.quorum = 2; //Math.ceil(providers.length / 2);\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), \"quorum exceed provider wieght\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"networkId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"networkId\":\n return (await provider.getNetwork()).networkId;\n case \"estimateEnergy\":\n return await provider.estimateEnergy(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = \"blockHash\" in req ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getEnergyPrice\":\n return (await provider.getFeeData()).energyPrice;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => b.priority - a.priority);\n for (const config of allConfigs) {\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config,\n result: null,\n didBump: false,\n perform: null,\n staller: null,\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = getTime() - now;\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push(waitForSync(config, 0));\n promises.push((async () => {\n config._network = await config.provider.getNetwork();\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let networkId = null;\n for (const config of this.#configs) {\n const network = config._network;\n if (networkId == null) {\n networkId = network.networkId;\n }\n else if (network.networkId !== networkId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\",\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight,\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getEnergyPrice\":\n case \"estimateEnergy\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"networkId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`,\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: {\n request: req,\n results: Array.from(running).map((r) => stringify(r.result)),\n },\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => {\n try {\n const result = await provider._perform(req);\n return Object.assign(normalizeResult({ result }), { weight });\n }\n catch (error) {\n return Object.assign(normalizeResult({ error }), { weight });\n }\n }));\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) },\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n for (let i = 0; i < this.quorum; i++) {\n this.#addRunner(running, req);\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map","import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value &&\n typeof value.send === \"function\" &&\n typeof value.close === \"function\");\n}\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n if (typeof network === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if ((typeof network === \"string\" && network.match(/^wss?:/)) ||\n isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n const providers = [];\n if (options.alchemy !== \"-\") {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.ankr !== \"-\" && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.cloudflare !== \"-\") {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.infura !== \"-\") {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof projectId === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) {\n console.log(error);\n }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n*/\n if (options.quicknode !== \"-\") {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) {\n console.log(error);\n }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\",\n });\n if (providers.length === 1) {\n return providers[0];\n }\n return new FallbackProvider(providers);\n}\n//# sourceMappingURL=default-provider.js.map","import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nexport class NonceManager extends AbstractSigner {\n signer;\n #noncePromise;\n #delta;\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n increment() {\n this.#delta++;\n }\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n constructor(core, network) {\n super(network, { batchMaxCount: 1 });\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await core.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [\n {\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message },\n },\n ];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `corebc-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `corebc-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"xcb_accounts\", []);\n if (typeof address === \"number\") {\n return accounts.length > address;\n }\n address = address.toLowerCase();\n return (accounts.filter((a) => a.toLowerCase() === address).length !== 0);\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n //const resp =\n await this.#request(\"xcb_requestAccounts\", []);\n //console.log(\"RESP\", resp);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n}\n//# sourceMappingURL=provider-browser.js.map","/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, {\n applicationId,\n applicationSecret,\n });\n }\n _getProvider(networkId) {\n try {\n return new PocketProvider(networkId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return this.applicationId === defaultApplicationId;\n }\n}\n//# sourceMappingURL=provider-pocket.js.map","const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map","import { getAddress } from \"../address/index.js\";\nimport { hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, resolveProperties, assert, assertArgument, } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n prefix;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor({ signingKey, prefix, provider, }) {\n super(provider);\n this.prefix = prefix;\n assertArgument(signingKey && typeof signingKey.sign === \"function\", \"invalid signingKey key\", \"signingKey\", \"[ REDACTED ]\");\n this.#signingKey = signingKey;\n const address = computeAddress(this.#signingKey, prefix);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() {\n return this.#signingKey;\n }\n /**\n * The private key for this wallet.\n */\n get privateKey() {\n return this.signingKey.privateKey;\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new BaseWallet({\n signingKey: this.#signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n async signTransaction(tx) {\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: tx.to || undefined,\n from: tx.from || undefined,\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress(tx.from) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n const unSignedSerialized = btx.unsignedSerialized;\n const unsignedHash = sha256(unSignedSerialized);\n // sha256(btx.unsignedSerialized)\n btx.signature = this.signingKey.sign(unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name },\n });\n const address = getAddress(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name,\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value));\n }\n}\n//# sourceMappingURL=base-wallet.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeO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TeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"en\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map","/*! https://mths.be/utf8js v3.0.0 by @mathias */\n;(function(root) {\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tthrow Error(\n\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t' is not a scalar value'\n\t\t\t);\n\t\t}\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tcheckScalarValue(codePoint);\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string) {\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol() {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\tcheckScalarValue(codePoint);\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString) {\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol()) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\troot.version = '3.0.0';\n\troot.encode = utf8encode;\n\troot.decode = utf8decode;\n\n}(typeof exports === 'undefined' ? this.utf8 = {} : exports));\n","import { Buffer } from \"buffer\";\nimport { pbkdf2Sync } from \"../crypto/crypto.js\";\nimport utf8 from \"utf8\";\nexport function mnemonicToSeed(mnemonic, password) {\n if (!password) {\n password = \"\";\n }\n const t = generateSeed(mnemonic, password);\n return t.goldilock;\n}\nconst generateSeed = (mnemonic, password) => {\n const goldilockSaltPrefix = \"mnemonic\";\n const aesSaltPrefix = \"mnemonicfortheAESkey\";\n const goldilockSalt = utf8.encode(goldilockSaltPrefix + password);\n const aesSalt = utf8.encode(aesSaltPrefix + password);\n const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(goldilockSalt), 2048, 64, \"sha512\");\n const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(aesSalt), 2048, 64, \"sha512\");\n return {\n aes: Buffer.from(aesKeySeed).toString(\"hex\"),\n goldilock: Buffer.from(goldilockKey).toString(\"hex\"),\n };\n};\n//# sourceMappingURL=mnemonicToSeed.js.map","import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { legacySha256 } from \"../crypto/sha3.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return (((1 << bits) - 1) << (8 - bits)) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset++;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) &\n getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n return mnemonicToSeed(this.phrase, this.password);\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase({ phrase, password, wordlist, }) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingURL=mnemonic.js.map","/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */\n(function(root) {\n \"use strict\";\n\n function checkInt(value) {\n return (parseInt(value) === value);\n }\n\n function checkInts(arrayish) {\n if (!checkInt(arrayish.length)) { return false; }\n\n for (var i = 0; i < arrayish.length; i++) {\n if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {\n return false;\n }\n }\n\n return true;\n }\n\n function coerceArray(arg, copy) {\n\n // ArrayBuffer view\n if (arg.buffer && arg.name === 'Uint8Array') {\n\n if (copy) {\n if (arg.slice) {\n arg = arg.slice();\n } else {\n arg = Array.prototype.slice.call(arg);\n }\n }\n\n return arg;\n }\n\n // It's an array; check it is a valid representation of a byte\n if (Array.isArray(arg)) {\n if (!checkInts(arg)) {\n throw new Error('Array contains invalid value: ' + arg);\n }\n\n return new Uint8Array(arg);\n }\n\n // Something else, but behaves like an array (maybe a Buffer? Arguments?)\n if (checkInt(arg.length) && checkInts(arg)) {\n return new Uint8Array(arg);\n }\n\n throw new Error('unsupported array-like object');\n }\n\n function createArray(length) {\n return new Uint8Array(length);\n }\n\n function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {\n if (sourceStart != null || sourceEnd != null) {\n if (sourceArray.slice) {\n sourceArray = sourceArray.slice(sourceStart, sourceEnd);\n } else {\n sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);\n }\n }\n targetArray.set(sourceArray, targetStart);\n }\n\n\n\n var convertUtf8 = (function() {\n function toBytes(text) {\n var result = [], i = 0;\n text = encodeURI(text);\n while (i < text.length) {\n var c = text.charCodeAt(i++);\n\n // if it is a % sign, encode the following 2 bytes as a hex value\n if (c === 37) {\n result.push(parseInt(text.substr(i, 2), 16))\n i += 2;\n\n // otherwise, just the actual byte\n } else {\n result.push(c)\n }\n }\n\n return coerceArray(result);\n }\n\n function fromBytes(bytes) {\n var result = [], i = 0;\n\n while (i < bytes.length) {\n var c = bytes[i];\n\n if (c < 128) {\n result.push(String.fromCharCode(c));\n i++;\n } else if (c > 191 && c < 224) {\n result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f)));\n i += 2;\n } else {\n result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f)));\n i += 3;\n }\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n var convertHex = (function() {\n function toBytes(text) {\n var result = [];\n for (var i = 0; i < text.length; i += 2) {\n result.push(parseInt(text.substr(i, 2), 16));\n }\n\n return result;\n }\n\n // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html\n var Hex = '0123456789abcdef';\n\n function fromBytes(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i++) {\n var v = bytes[i];\n result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]);\n }\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n\n // Number of rounds by keysize\n var numberOfRounds = {16: 10, 24: 12, 32: 14}\n\n // Round constant words\n var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n\n // S-box and Inverse S-box (S is for Substitution)\n var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21,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x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n\n // Transformations for encryption\n var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\n var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\n var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\n var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n\n // Transformations for decryption\n var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\n var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\n var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\n var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n\n // Transformations for decryption key expansion\n var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\n var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\n var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\n var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\n\n function convertToInt32(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i += 4) {\n result.push(\n (bytes[i ] << 24) |\n (bytes[i + 1] << 16) |\n (bytes[i + 2] << 8) |\n bytes[i + 3]\n );\n }\n return result;\n }\n\n var AES = function(key) {\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n Object.defineProperty(this, 'key', {\n value: coerceArray(key, true)\n });\n\n this._prepare();\n }\n\n\n AES.prototype._prepare = function() {\n\n var rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new Error('invalid key size (must be 16, 24 or 32 bytes)');\n }\n\n // encryption round keys\n this._Ke = [];\n\n // decryption round keys\n this._Kd = [];\n\n for (var i = 0; i <= rounds; i++) {\n this._Ke.push([0, 0, 0, 0]);\n this._Kd.push([0, 0, 0, 0]);\n }\n\n var roundKeyCount = (rounds + 1) * 4;\n var KC = this.key.length / 4;\n\n // convert the key into ints\n var tk = convertToInt32(this.key);\n\n // copy values into round key arrays\n var index;\n for (var i = 0; i < KC; i++) {\n index = i >> 2;\n this._Ke[index][i % 4] = tk[i];\n this._Kd[rounds - index][i % 4] = tk[i];\n }\n\n // key expansion (fips-197 section 5.2)\n var rconpointer = 0;\n var t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[ tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (var i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n } else {\n for (var i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n\n tk[KC / 2] ^= (S[ tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n\n for (var i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n\n // copy values into round key arrays\n var i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n this._Ke[r][c] = tk[i];\n this._Kd[rounds - r][c] = tk[i++];\n t++;\n }\n }\n\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (var r = 1; r < rounds; r++) {\n for (var c = 0; c < 4; c++) {\n tt = this._Kd[r][c];\n this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[ tt & 0xFF]);\n }\n }\n }\n\n AES.prototype.encrypt = function(plaintext) {\n if (plaintext.length != 16) {\n throw new Error('invalid plaintext size (must be 16 bytes)');\n }\n\n var rounds = this._Ke.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(plaintext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Ke[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T1[(t[ i ] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[ t[(i + 3) % 4] & 0xff] ^\n this._Ke[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Ke[rounds][i];\n result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n AES.prototype.decrypt = function(ciphertext) {\n if (ciphertext.length != 16) {\n throw new Error('invalid ciphertext size (must be 16 bytes)');\n }\n\n var rounds = this._Kd.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(ciphertext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Kd[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T5[(t[ i ] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[ t[(i + 1) % 4] & 0xff] ^\n this._Kd[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Kd[rounds][i];\n result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n\n /**\n * Mode Of Operation - Electonic Codebook (ECB)\n */\n var ModeOfOperationECB = function(key) {\n if (!(this instanceof ModeOfOperationECB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Electronic Code Block\";\n this.name = \"ecb\";\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationECB.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n block = this._aes.encrypt(block);\n copyArray(block, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationECB.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n copyArray(block, plaintext, i);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Block Chaining (CBC)\n */\n var ModeOfOperationCBC = function(key, iv) {\n if (!(this instanceof ModeOfOperationCBC)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Block Chaining\";\n this.name = \"cbc\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastCipherblock = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCBC.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n\n for (var j = 0; j < 16; j++) {\n block[j] ^= this._lastCipherblock[j];\n }\n\n this._lastCipherblock = this._aes.encrypt(block);\n copyArray(this._lastCipherblock, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n\n for (var j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ this._lastCipherblock[j];\n }\n\n copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Feedback (CFB)\n */\n var ModeOfOperationCFB = function(key, iv, segmentSize) {\n if (!(this instanceof ModeOfOperationCFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Feedback\";\n this.name = \"cfb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 size)');\n }\n\n if (!segmentSize) { segmentSize = 1; }\n\n this.segmentSize = segmentSize;\n\n this._shiftRegister = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCFB.prototype.encrypt = function(plaintext) {\n if ((plaintext.length % this.segmentSize) != 0) {\n throw new Error('invalid plaintext size (must be segmentSize bytes)');\n }\n\n var encrypted = coerceArray(plaintext, true);\n\n var xorSegment;\n for (var i = 0; i < encrypted.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n for (var j = 0; j < this.segmentSize; j++) {\n encrypted[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return encrypted;\n }\n\n ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {\n if ((ciphertext.length % this.segmentSize) != 0) {\n throw new Error('invalid ciphertext size (must be segmentSize bytes)');\n }\n\n var plaintext = coerceArray(ciphertext, true);\n\n var xorSegment;\n for (var i = 0; i < plaintext.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n plaintext[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return plaintext;\n }\n\n /**\n * Mode Of Operation - Output Feedback (OFB)\n */\n var ModeOfOperationOFB = function(key, iv) {\n if (!(this instanceof ModeOfOperationOFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Output Feedback\";\n this.name = \"ofb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastPrecipher = coerceArray(iv, true);\n this._lastPrecipherIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationOFB.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._lastPrecipherIndex === 16) {\n this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);\n this._lastPrecipherIndex = 0;\n }\n encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;\n\n\n /**\n * Counter object for CTR common mode of operation\n */\n var Counter = function(initialValue) {\n if (!(this instanceof Counter)) {\n throw Error('Counter must be instanitated with `new`');\n }\n\n // We allow 0, but anything false-ish uses the default 1\n if (initialValue !== 0 && !initialValue) { initialValue = 1; }\n\n if (typeof(initialValue) === 'number') {\n this._counter = createArray(16);\n this.setValue(initialValue);\n\n } else {\n this.setBytes(initialValue);\n }\n }\n\n Counter.prototype.setValue = function(value) {\n if (typeof(value) !== 'number' || parseInt(value) != value) {\n throw new Error('invalid counter value (must be an integer)');\n }\n\n // We cannot safely handle numbers beyond the safe range for integers\n if (value > Number.MAX_SAFE_INTEGER) {\n throw new Error('integer value out of safe range');\n }\n\n for (var index = 15; index >= 0; --index) {\n this._counter[index] = value % 256;\n value = parseInt(value / 256);\n }\n }\n\n Counter.prototype.setBytes = function(bytes) {\n bytes = coerceArray(bytes, true);\n\n if (bytes.length != 16) {\n throw new Error('invalid counter bytes size (must be 16 bytes)');\n }\n\n this._counter = bytes;\n };\n\n Counter.prototype.increment = function() {\n for (var i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n\n\n /**\n * Mode Of Operation - Counter (CTR)\n */\n var ModeOfOperationCTR = function(key, counter) {\n if (!(this instanceof ModeOfOperationCTR)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Counter\";\n this.name = \"ctr\";\n\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter)\n }\n\n this._counter = counter;\n\n this._remainingCounter = null;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCTR.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = this._aes.encrypt(this._counter._counter);\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;\n\n\n ///////////////////////\n // Padding\n\n // See:https://tools.ietf.org/html/rfc2315\n function pkcs7pad(data) {\n data = coerceArray(data, true);\n var padder = 16 - (data.length % 16);\n var result = createArray(data.length + padder);\n copyArray(data, result);\n for (var i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n }\n\n function pkcs7strip(data) {\n data = coerceArray(data, true);\n if (data.length < 16) { throw new Error('PKCS#7 invalid length'); }\n\n var padder = data[data.length - 1];\n if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); }\n\n var length = data.length - padder;\n for (var i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new Error('PKCS#7 invalid padding byte');\n }\n }\n\n var result = createArray(length);\n copyArray(data, result, 0, 0, length);\n return result;\n }\n\n ///////////////////////\n // Exporting\n\n\n // The block cipher\n var aesjs = {\n AES: AES,\n Counter: Counter,\n\n ModeOfOperation: {\n ecb: ModeOfOperationECB,\n cbc: ModeOfOperationCBC,\n cfb: ModeOfOperationCFB,\n ofb: ModeOfOperationOFB,\n ctr: ModeOfOperationCTR\n },\n\n utils: {\n hex: convertHex,\n utf8: convertUtf8\n },\n\n padding: {\n pkcs7: {\n pad: pkcs7pad,\n strip: pkcs7strip\n }\n },\n\n _arrayTest: {\n coerceArray: coerceArray,\n createArray: createArray,\n copyArray: copyArray,\n }\n };\n\n\n // node.js\n if (typeof exports !== 'undefined') {\n module.exports = aesjs\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define([], function() { return aesjs; });\n\n // Web Browsers\n } else {\n\n // If there was an existing library at \"aesjs\" make sure it's still available\n if (root.aesjs) {\n aesjs._aesjs = root.aesjs;\n }\n\n root.aesjs = aesjs;\n }\n\n\n})(this);\n","/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof hexString === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = \"0\" + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof password === \"string\") {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = match[4] === \"!\";\n let cur = object;\n for (const comp of path.toLowerCase().split(\".\")) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof cur === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof cur === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof cur) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map","/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Core along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { Counter, ModeOfOperation: { ctr: CTR }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from \"../crypto/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nimport { computeAddress, extractPrefix } from \"../transaction/address.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = data.version != null ? parseInt(data.version) : 0;\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, new Counter(iv));\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\",\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n const expectedMAC = spelunk(data, \"crypto.mac:string!\");\n let difference = 0;\n const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC);\n if (validMAC) {\n const actual = getBytes(\"0x\" + computedMAC);\n const expected = getBytes(\"0x\" + expectedMAC);\n for (let i = 0; i < actual.length; i++)\n difference |= actual[i] ^ expected[i];\n }\n assertArgument(validMAC && difference === 0, \"incorrect password\", \"password\", \"[REDACTED]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = getAddress(data.address);\n const prefix = extractPrefix(address);\n if (computeAddress(privateKey, prefix) !== address) {\n throw new Error(\"address mismatch\");\n }\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-corebc.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-corebc.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-corebc.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n account.mnemonic = {\n path: spelunk(data, \"x-corebc.path:string\") || defaultPath,\n locale: spelunk(data, \"x-corebc.locale:string\") || \"en\",\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))),\n };\n }\n return account;\n}\n// Match Core Web3Dart's wallet KDF resource limits.\nfunction validateScrypt(N, r, p) {\n assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, \"unsafe scrypt N\", \"kdf.N\", N);\n assertArgument(Number.isSafeInteger(r) &&\n Number.isSafeInteger(p) &&\n r > 0 &&\n p > 0 &&\n r * p <= 1048576 &&\n 128 * N * r <= 256 * 1024 * 1024, \"unsafe scrypt work or memory requirement\", \"kdf\", { N, r, p });\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof kdf === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n validateScrypt(N, r, p);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(prf === \"hmac-sha256\" || prf === \"hmac-sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, \"unsafe PBKDF2 iteration count\", \"kdf.c\", count);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return {\n name: \"pbkdf2\",\n salt,\n count,\n dkLen,\n algorithm: algorithm,\n };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = options.salt != null\n ? getBytes(options.salt, \"options.salt\")\n : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = 1 << 17, r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N != null) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r != null) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p != null) {\n p = options.scrypt.p;\n }\n }\n validateScrypt(N, r, p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = options.iv != null ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = options.uuid != null\n ? getBytes(options.uuid, \"options.uuid\")\n : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, new Counter(iv));\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = sha256(concat([macPrefix, ciphertext]));\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r,\n },\n mac: mac.substring(2),\n },\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = options.client != null ? options.client : `corebc/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = now.getUTCFullYear() +\n \"-\" +\n zpad(now.getUTCMonth() + 1, 2) +\n \"-\" +\n zpad(now.getUTCDate(), 2) +\n \"T\" +\n zpad(now.getUTCHours(), 2) +\n \"-\" +\n zpad(now.getUTCMinutes(), 2) +\n \"-\" +\n zpad(now.getUTCSeconds(), 2) +\n \".0Z\";\n const gethFilename = \"UTC--\" + timestamp + \"--\" + data.address;\n data[\"x-corebc\"] = {\n client,\n gethFilename,\n path,\n locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\",\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map","/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { dataSlice, defineProperties, getNumber, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\nimport { Ed448Goldilock } from \"../crypto/crypto.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// import { arrayify,\n// // hexDataSlice\n// } from \"../utils/data.js\";\n// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array {\n// const p = getBytes(password);\n// const s = getBytes(salt);\n// return getBytes(pbkdf2(p, s, 2048, 57, \"sha512\"));\n// }\n/**\n * The default derivation path for Core HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m\";\n// \"Bitcoin seed\"\n// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\n// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array {\n// b = getBytes(concat([b.slice(0, 53), \"0x00000000\"]));\n// b[0] &= 0xfc;\n// const c = new Uint8Array(57);\n// let hold = 0;\n// for (let i = 0; i < 57; i++) {\n// hold += a[i] + b[i];\n// c[i] = hold % 256;\n// hold = Math.floor(hold / 256);\n// }\n// return c;\n// };\nconst _guard = {};\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0 && (components[0] === \"m\" || node.depth > 0), \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n prefix;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n #seed;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) {\n super({\n signingKey,\n prefix,\n provider,\n });\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.publicKey });\n this.prefix = prefix;\n this.#seed = seed;\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint,\n fingerprint,\n path,\n index,\n depth,\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet({\n guard: _guard,\n signingKey: this.signingKey,\n parentFingerprint: this.parentFingerprint,\n path: this.path,\n index: this.index,\n depth: this.depth,\n seed: this.#seed,\n mnemonic: this.mnemonic,\n provider,\n prefix: this.prefix,\n });\n }\n #account() {\n const account = {\n address: this.address,\n privateKey: this.privateKey,\n };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy,\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, {\n progressCallback,\n });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() {\n return this.path != null;\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index));\n const newSigningKey = new SigningKey(newPrivateKey);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (_index & ~HardenedBit);\n if (_index & HardenedBit) {\n path += \"'\";\n }\n }\n return new HDNodeWallet({\n guard: _guard,\n signingKey: newSigningKey,\n parentFingerprint: this.fingerprint,\n path,\n index: _index,\n seed: this.#seed,\n depth: this.depth + 1,\n mnemonic: this.mnemonic,\n provider: this.provider,\n prefix: this.prefix,\n });\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed({ _seed, mnemonic, prefix, path, }) {\n const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0);\n const signingKey = new SigningKey(extendetPrivateKey);\n // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length })\n return new HDNodeWallet({\n seed: _seed,\n guard: _guard,\n signingKey,\n parentFingerprint: \"0x00000000\",\n path: path || defaultPath,\n index: 0,\n depth: 0,\n mnemonic,\n provider: null,\n prefix,\n });\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(prefix, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist);\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Create am HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, prefix, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n static mnemonicToSeed(mnemonic, password) {\n const seed = mnemonicToSeed(mnemonic, password);\n return seed;\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, password, path, wordlist, }) {\n if (!password) {\n password = \"\";\n }\n if (!path) {\n path = defaultPath;\n }\n if (!wordlist) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist });\n const _seed = mnemonic.computeSeed();\n return HDNodeWallet.#fromSeed({\n _seed,\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed({ seed, prefix, path, }) {\n return HDNodeWallet.#fromSeed({\n _seed: seed,\n mnemonic: null,\n path: path || defaultPath,\n prefix,\n });\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the acount at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map","/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n/**\n * Before Core launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive xcb\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Core Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && encseed.length % 16 === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map","import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { defaultPath, HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson, } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { extractPrefix } from \"../transaction/address.js\";\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected\n * to %%provider%%.\n */\n constructor({ key, prefix, provider, }) {\n if (typeof key === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = typeof key === \"string\" ? new SigningKey(key) : key;\n super({\n signingKey,\n prefix,\n provider,\n });\n }\n connect(provider) {\n return new Wallet({\n key: this.signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n const address = account.address;\n const prefix = extractPrefix(address);\n if (\"mnemonic\" in account &&\n account.mnemonic &&\n account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path);\n if (wallet.address === account.address &&\n wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet({\n key: account.privateKey,\n prefix,\n });\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the avavilable\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(prefix, provider) {\n const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, provider, password, }) {\n const wallet = HDNodeWallet.fromPhrase({\n phrase,\n prefix,\n password,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n static fromSeed({ seed, prefix, provider, path, }) {\n const wallet = HDNodeWallet.fromSeed({\n seed,\n prefix,\n path: path || defaultPath,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map","import { Contract } from \"../contract/index.js\";\nexport const customUnitAbi = Object.freeze([\n \"function supportsUnit(string unit) view returns (bool)\",\n \"function supportedUnits() view returns (string[])\",\n \"function preferredUnit() view returns (string)\",\n \"function balanceOf(address account) view returns (uint256)\",\n \"function balanceOfUnit(address account, string unit) view returns (uint256)\",\n]);\nexport class CustomUnitDiscovery {\n preferredUnit;\n supportedUnits;\n constructor(units, preferredUnit) {\n this.preferredUnit = preferredUnit;\n this.supportedUnits = Object.freeze([...units]);\n }\n get isValid() {\n return (this.supports(\"units\") &&\n this.preferredUnit !== \"\" &&\n this.supports(this.preferredUnit));\n }\n supports(unit) {\n return this.supportedUnits.includes(unit);\n }\n}\n/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */\nexport class CustomUnitBalance {\n canonicalAmount;\n unitAmount;\n unit;\n constructor(canonicalAmount, unitAmount, unit) {\n this.canonicalAmount = canonicalAmount;\n this.unitAmount = unitAmount;\n this.unit = unit;\n }\n get multiplierNumerator() {\n return this.unitAmount;\n }\n get multiplierDenominator() {\n return this.canonicalAmount;\n }\n}\n/** Core custom-unit contract convention used by Tone and Core API. */\nexport class CustomUnitToken {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, customUnitAbi, runner);\n }\n async supportsUnit(unit, blockTag) {\n return (unit.trim() !== \"\" &&\n (await this.contract.supportsUnit(unit.trim(), { blockTag })));\n }\n async supportedUnits(blockTag) {\n return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag })));\n }\n async preferredUnit(blockTag) {\n return (await this.contract.preferredUnit({ blockTag })).trim();\n }\n async discover(blockTag) {\n if (!(await this.supportsUnit(\"units\", blockTag)))\n return null;\n const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag));\n return discovery.isValid ? discovery : null;\n }\n canonicalBalance(account, blockTag) {\n return this.contract.balanceOf(account, { blockTag });\n }\n balanceOfUnit(account, unit, blockTag) {\n if (!unit.trim())\n throw new TypeError(\"unit must not be empty\");\n return this.contract.balanceOfUnit(account, unit.trim(), { blockTag });\n }\n async balance(account, unit, blockTag) {\n const resolved = unit?.trim() || (await this.preferredUnit(blockTag));\n const [canonical, calculated] = await Promise.all([\n this.canonicalBalance(account, blockTag),\n this.balanceOfUnit(account, resolved, blockTag),\n ]);\n return new CustomUnitBalance(canonical, calculated, resolved);\n }\n}\n//# sourceMappingURL=custom-units.js.map","import { Contract } from \"../contract/index.js\";\n/** On-chain interface defined by CIP-150. */\nexport const cip150Abi = Object.freeze([\n \"function getMetadataValue(string key) view returns (string value)\",\n \"function hasMetadataKey(string key) view returns (bool exists)\",\n \"function isMetadataSealed(string key) view returns (bool sealed)\",\n \"function listMetadataKeys() view returns (string[] keys)\",\n \"function getMetadataByIndex(uint256 index) view returns (string key, string value)\",\n \"function metadataCount() view returns (uint256 total)\",\n \"function setMetadataValue(string key, string value)\",\n \"function sealMetadataKey(string key)\",\n]);\nexport const cip151TokenExpirationKey = \"tokenExpiration\";\nexport const cip151TradingStopKey = \"tradingStop\";\nexport const cip152LabKey = \"lab\";\n/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */\nexport class Cip151Lifecycle {\n tokenExpiration;\n tradingStop;\n constructor(metadata = {}) {\n const parse = (key) => {\n const value = metadata[key];\n if (value == null || value === \"\")\n return null;\n if (!/^\\d+$/.test(value))\n throw new TypeError(`${key} must be a non-negative Unix timestamp`);\n return BigInt(value);\n };\n this.tokenExpiration = parse(cip151TokenExpirationKey);\n this.tradingStop = parse(cip151TradingStopKey);\n }\n isExpiredAt(seconds) {\n return this.tokenExpiration !== null && seconds >= this.tokenExpiration;\n }\n isTradingStoppedAt(seconds) {\n return this.tradingStop !== null && seconds >= this.tradingStop;\n }\n}\n/** Validates certificate structure, not the authenticity of its issuer. */\nexport class Cip152LabCertificate {\n measurements;\n constructor(json) {\n if (json === null || typeof json !== \"object\" || Array.isArray(json))\n throw new TypeError(\"CIP-152 lab.json must be an object\");\n const measurements = Object.create(null);\n for (const [key, property] of Object.entries(json)) {\n if (!property ||\n typeof property !== \"object\" ||\n Array.isArray(property) ||\n !Object.hasOwn(property, \"value\"))\n throw new TypeError(`CIP-152 property ${key} must contain a value`);\n const { value, unit } = property;\n if (!(typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value))))\n throw new TypeError(`CIP-152 property ${key} has an invalid value`);\n if (unit != null && typeof unit !== \"string\")\n throw new TypeError(`CIP-152 property ${key} has an invalid unit`);\n measurements[key] = Object.freeze(unit == null ? { value } : { value, unit });\n }\n this.measurements = Object.freeze(measurements);\n }\n}\n/** Typed metadata reader and writer. Writes require a signer as runner. */\nexport class Cip150MetadataContract {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, cip150Abi, runner);\n }\n getValue(key, blockTag) {\n return this.contract.getMetadataValue(key, { blockTag });\n }\n hasKey(key, blockTag) {\n return this.contract.hasMetadataKey(key, { blockTag });\n }\n isSealed(key, blockTag) {\n return this.contract.isMetadataSealed(key, { blockTag });\n }\n async listKeys(blockTag) {\n return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag })));\n }\n async getByIndex(index, blockTag) {\n const [key, value] = await this.contract.getMetadataByIndex(index, {\n blockTag,\n });\n return Object.freeze({ key, value });\n }\n count(blockTag) {\n return this.contract.metadataCount({ blockTag });\n }\n async readAll(blockTag, includeSealedState = true) {\n const entries = [];\n for (const key of await this.listKeys(blockTag)) {\n const value = await this.getValue(key, blockTag);\n entries.push(Object.freeze(includeSealedState\n ? { key, value, sealed: await this.isSealed(key, blockTag) }\n : { key, value }));\n }\n return Object.freeze(entries);\n }\n setValue(key, value, overrides = {}) {\n return this.contract.setMetadataValue(key, value, overrides);\n }\n sealKey(key, overrides = {}) {\n return this.contract.sealMetadataKey(key, overrides);\n }\n async readLifecycle(blockTag) {\n const metadata = {};\n for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) {\n if (await this.hasKey(key, blockTag))\n metadata[key] = await this.getValue(key, blockTag);\n }\n return new Cip151Lifecycle(metadata);\n }\n async readLabCertificate(gateway, blockTag) {\n if (!(await this.hasKey(cip152LabKey, blockTag)))\n return null;\n const reference = await this.getValue(cip152LabKey, blockTag);\n if (!gateway.resolve(reference).pathname.endsWith(\"/lab.json\"))\n throw new TypeError(\"CIP-152 reference must point to lab.json\");\n return new Cip152LabCertificate(await gateway.readJson(reference));\n }\n}\nexport { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from \"./custom-units.js\";\n//# sourceMappingURL=index.js.map","export const defaultIpfsGatewayTemplate = \"https://ipf.sk/{cid}\";\n/** Configurable IPFS resolution and bounded JSON loading. */\nexport class IpfsGateway {\n template;\n maxResponseBytes;\n timeoutMs;\n #fetch;\n constructor(options = {}) {\n this.template = options.template ?? defaultIpfsGatewayTemplate;\n this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024;\n this.timeoutMs = options.timeoutMs ?? 30_000;\n this.#fetch = options.fetch ?? globalThis.fetch;\n const templateUrl = new URL(this.template.replace(\"{cid}\", \"cid\"));\n if (!/^https?:$/.test(templateUrl.protocol) ||\n this.template.split(\"{cid}\").length !== 2)\n throw new TypeError(\"gateway template must be HTTP(S) and contain one {cid}\");\n for (const value of [this.maxResponseBytes, this.timeoutMs])\n if (!Number.isSafeInteger(value) || value <= 0)\n throw new TypeError(\"gateway limits must be positive safe integers\");\n }\n resolve(reference) {\n const value = reference.trim();\n if (/^https?:\\/\\//i.test(value))\n return new URL(value);\n const path = value.replace(/^ipfs:\\/\\//, \"\").replace(/^\\/?ipfs\\//, \"\");\n if (!/^[A-Za-z0-9]+(?:\\/[^?#]*)?$/.test(path) ||\n path.split(\"/\").some((part) => part === \".\" || part === \"..\"))\n throw new TypeError(\"invalid IPFS reference\");\n return new URL(this.template.replace(\"{cid}\", path.split(\"/\").map(encodeURIComponent).join(\"/\")));\n }\n async readJson(reference) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n let reader;\n try {\n const response = await this.#fetch(this.resolve(reference), {\n headers: { accept: \"application/json\" },\n signal: controller.signal,\n });\n if (!response.ok) {\n await response.body?.cancel();\n throw new Error(`IPFS gateway returned HTTP ${response.status}`);\n }\n if (!response.body)\n throw new Error(\"IPFS gateway returned an empty body\");\n reader = response.body.getReader();\n const chunks = [];\n let length = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done)\n break;\n length += value.length;\n if (length > this.maxResponseBytes)\n throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);\n chunks.push(value);\n }\n const bytes = new Uint8Array(length);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.length;\n }\n return JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes));\n }\n finally {\n clearTimeout(timer);\n await reader?.cancel().catch(() => { });\n reader?.releaseLock();\n }\n }\n}\n//# sourceMappingURL=index.js.map"],"names":["require$$0","require$$1","this","logger","stringify","isBytes","arrayifyInteger","unarrayifyInteger","_encode","_decodeChildren","_decode","decode","ripemd160","hmac","pbkdf2","u64.split","u64.rotrSH","u64.shrSH","u64.rotrSL","u64.shrSL","u64.rotrBH","u64.rotrBL","u64.add4L","u64.add4H","u64.add5L","u64.add5H","u64.add","u64.add3L","u64.add3H","sha256","sha512","Buffer","require$$2","require$$3","global","require$$4","ed448","BN_0","BN_1","locked","getTime","_a","_guard","getGlobal","randomBytes","removeHexPrefix","noble_ripemd160","crypto_random","scrypt","_nobleAsync","_nobleSync","H","BN_2","passProperties","getValue","BN_MAX_UINT256","RLP.decode","RLP.encode","_sha256","internal","PanicReasons","copy","stall","defaultApiKey","getHost","defaultPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEA,CAAA,QAAA,CAAA,UAAkB,GAAG;CACrB,CAAA,QAAA,CAAA,WAAmB,GAAG;CACtB,CAAA,QAAA,CAAA,aAAqB,GAAG;;CAExB,CAAA,IAAI,MAAM,GAAG;CACb,CAAA,IAAI,SAAS,GAAG;EAChB,IAAI,GAAG,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,UAAU,GAAG;;CAE3D,CAAA,IAAI,IAAI,GAAG;CACX,CAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CA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AC1B,YAAY,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;CACxC,gBAAgB,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC;CACxC,gBAAgB,MAAM,IAAI,KAAK,CAAC,MAAM;CACtC,YAAY;CACZ,YAAY,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;CACtF,QAAQ;CACR,gBAAgB;CAChB,YAAY,YAAY,CAAC,KAAK,CAAC;CAC/B,YAAY,MAAM,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;CACnD,YAAY,MAAM,EAAE,WAAW,EAAE;CACjC,QAAQ;CACR,IAAI;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1,2,4,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,52,53,54,55,56,65,132,135]} \ No newline at end of file diff --git a/dist/corebc.umd.min.js b/dist/corebc.umd.min.js deleted file mode 100644 index 1bbbbec8f..000000000 --- a/dist/corebc.umd.min.js +++ /dev/null @@ -1 +0,0 @@ -const __$G=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory(global.corebc={}))})(this,function(exports){"use strict";var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x["default"]:x}function getAugmentedNamespace(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var f=n.default;if(typeof f=="function"){var a=function a(){var isInstance=false;try{isInstance=this instanceof a}catch(e){}if(isInstance){return Reflect.construct(f,arguments,this.constructor)}return f.apply(this,arguments)};a.prototype=f.prototype}else a={};Object.defineProperty(a,"__esModule",{value:true});Object.keys(n).forEach(function(k){var d=Object.getOwnPropertyDescriptor(n,k);Object.defineProperty(a,k,d.get?d:{enumerable:true,get:function(){return n[k]}})});return a}var buffer={};var base64Js={};var hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1;base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){if(hasRequiredIeee754)return ieee754;hasRequiredIeee754=1;ieee754.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};ieee754.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128};return ieee754}var hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;(function(exports){const base64=requireBase64Js();const ieee754=requireIeee754();const customInspectSymbol=typeof Symbol==="function"&&typeof Symbol["for"]==="function"?Symbol["for"]("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;const K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{const arr=new Uint8Array(1);const proto={foo:function(){return 42}};Object.setPrototypeOf(proto,Uint8Array.prototype);Object.setPrototypeOf(arr,proto);return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}const buf=new Uint8Array(length);Object.setPrototypeOf(buf,Buffer.prototype);return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayView(value)}if(value==null){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof SharedArrayBuffer!=="undefined"&&(isInstance(value,SharedArrayBuffer)||value&&isInstance(value.buffer,SharedArrayBuffer))){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}const valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}const b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}const length=byteLength(string,encoding)|0;let buf=createBuffer(length);const actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){const length=array.length<0?0:checked(array.length)|0;const buf=createBuffer(length);for(let i=0;i=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;let x=a.length;let y=b.length;for(let i=0,len=Math.min(x,y);ibuffer.length){if(!Buffer.isBuffer(buf))buf=Buffer.from(buf);buf.copy(buffer,pos)}else{Uint8Array.prototype.set.call(buffer,buf,pos)}}else if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}else{buf.copy(buffer,pos)}pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(ArrayBuffer.isView(string)||isInstance(string,ArrayBuffer)){return string.byteLength}if(typeof string!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof string)}const len=string.length;const mustMatch=arguments.length>2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;let loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){let loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){const i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){const len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(let i=0;imax)str+=" ... ";return""};if(customInspectSymbol){Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect}Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;let x=thisEnd-thisStart;let y=end-start;const len=Math.min(x,y);const thisCopy=this.slice(thisStart,thisEnd);const targetCopy=target.slice(start,end);for(let i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){let indexSize=1;let arrLength=arr.length;let valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}let i;if(dir){let foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){let found=true;for(let j=0;jremaining){length=remaining}}const strLen=string.length;if(length>strLen/2){length=strLen/2}let i;for(i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}const remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";let loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":case"latin1":case"binary":return asciiWrite(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);const res=[];let i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){let secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}const MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){const len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}let res="";let i=0;while(ilen)end=len;let out="";for(let i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}let val=this[offset+--byteLength];let mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readBigUInt64LE=defineBigIntMethod(function readBigUInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const lo=first+this[++offset]*2**8+this[++offset]*2**16+this[++offset]*2**24;const hi=this[++offset]+this[++offset]*2**8+this[++offset]*2**16+last*2**24;return BigInt(lo)+(BigInt(hi)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const hi=first*2**24+this[++offset]*2**16+this[++offset]*2**8+this[++offset];const lo=this[++offset]*2**24+this[++offset]*2**16+this[++offset]*2**8+last;return(BigInt(hi)<>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let i=byteLength;let mul=1;let val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readBigInt64LE=defineBigIntMethod(function readBigInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=this[offset+4]+this[offset+5]*2**8+this[offset+6]*2**16+(last<<24);return(BigInt(val)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=(first<<24)+this[++offset]*2**16+this[++offset]*2**8+this[++offset];return(BigInt(val)<>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let mul=1;let i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let i=byteLength-1;let mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function wrtBigUInt64LE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;return offset}function wrtBigUInt64BE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset+7]=lo;lo=lo>>8;buf[offset+6]=lo;lo=lo>>8;buf[offset+5]=lo;lo=lo>>8;buf[offset+4]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset+3]=hi;hi=hi>>8;buf[offset+2]=hi;hi=hi>>8;buf[offset+1]=hi;hi=hi>>8;buf[offset]=hi;return offset+8}Buffer.prototype.writeBigUInt64LE=defineBigIntMethod(function writeBigUInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeBigUInt64BE=defineBigIntMethod(function writeBigUInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=0;let mul=1;let sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=byteLength-1;let mul=1;let sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeBigInt64LE=defineBigIntMethod(function writeBigInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Buffer.prototype.writeBigInt64BE=defineBigIntMethod(function writeBigInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;let i;if(typeof val==="number"){for(i=start;i2**32){received=addNumericalSeparator(String(input))}else if(typeof input==="bigint"){received=String(input);if(input>BigInt(2)**BigInt(32)||input<-(BigInt(2)**BigInt(32))){received=addNumericalSeparator(received)}received+="n"}msg+=` It must be ${range}. Received ${received}`;return msg},RangeError);function addNumericalSeparator(val){let res="";let i=val.length;const start=val[0]==="-"?1:0;for(;i>=start+4;i-=3){res=`_${val.slice(i-3,i)}${res}`}return`${val.slice(0,i)}${res}`}function checkBounds(buf,offset,byteLength){validateNumber(offset,"offset");if(buf[offset]===undefined||buf[offset+byteLength]===undefined){boundsError(offset,buf.length-(byteLength+1))}}function checkIntBI(value,min,max,buf,offset,byteLength){if(value>max||value= 0${n} and < 2${n} ** ${(byteLength+1)*8}${n}`}else{range=`>= -(2${n} ** ${(byteLength+1)*8-1}${n}) and < 2 ** `+`${(byteLength+1)*8-1}${n}`}}throw new errors.ERR_OUT_OF_RANGE("value",range,value)}checkBounds(buf,offset,byteLength)}function validateNumber(value,name){if(typeof value!=="number"){throw new errors.ERR_INVALID_ARG_TYPE(name,"number",value)}}function boundsError(value,length,type){if(Math.floor(value)!==value){validateNumber(value,type);throw new errors.ERR_OUT_OF_RANGE("offset","an integer",value)}if(length<0){throw new errors.ERR_BUFFER_OUT_OF_BOUNDS}throw new errors.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${length}`,value)}const INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(str){str=str.split("=")[0];str=str.trim().replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function utf8ToBytes(string,units){units=units||Infinity;let codePoint;const length=string.length;let leadSurrogate=null;const bytes=[];for(let i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){const byteArray=[];for(let i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){let i;for(i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}const hexSliceLookupTable=function(){const alphabet="0123456789abcdef";const table=new Array(256);for(let i=0;i<16;++i){const i16=i*16;for(let j=0;j<16;++j){table[i16+j]=alphabet[i]+alphabet[j]}}return table}();function defineBigIntMethod(fn){return typeof BigInt==="undefined"?BufferBigIntNotDefined:fn}function BufferBigIntNotDefined(){throw new Error("BigInt not supported")}})(buffer);return buffer}var bufferExports=requireBuffer();const version="0.4.1";var bn$2={exports:{}};var _nodeResolve_empty={};var _nodeResolve_empty$1=Object.freeze({__proto__:null,default:_nodeResolve_empty});var require$$0=getAugmentedNamespace(_nodeResolve_empty$1);var bn$1=bn$2.exports;var hasRequiredBn$1;function requireBn$1(){if(hasRequiredBn$1)return bn$2.exports;hasRequiredBn$1=1;(function(module){(function(module,exports){function assert(val,msg){if(!val)throw new Error(msg||"Assertion failed")}function inherits(ctor,superCtor){ctor.super_=superCtor;var TempCtor=function(){};TempCtor.prototype=superCtor.prototype;ctor.prototype=new TempCtor;ctor.prototype.constructor=ctor}function BN(number,base,endian){if(BN.isBN(number)){return number}this.negative=0;this.words=null;this.length=0;this.red=null;if(number!==null){if(base==="le"||base==="be"){endian=base;base=10}this._init(number||0,base||10,endian||"be")}}if(typeof module==="object"){module.exports=BN}else{exports.BN=BN}BN.BN=BN;BN.wordSize=26;var Buffer;try{if(typeof window!=="undefined"&&typeof window.Buffer!=="undefined"){Buffer=window.Buffer}else{Buffer=require$$0.Buffer}}catch(e){}BN.isBN=function isBN(num){if(num instanceof BN){return true}return num!==null&&typeof num==="object"&&num.constructor.wordSize===BN.wordSize&&Array.isArray(num.words)};BN.max=function max(left,right){if(left.cmp(right)>0)return left;return right};BN.min=function min(left,right){if(left.cmp(right)<0)return left;return right};BN.prototype._init=function init(number,base,endian){if(typeof number==="number"){return this._initNumber(number,base,endian)}if(typeof number==="object"){return this._initArray(number,base,endian)}if(base==="hex"){base=16}assert(base===(base|0)&&base>=2&&base<=36);number=number.toString().replace(/\s+/g,"");var start=0;if(number[0]==="-"){start++;this.negative=1}if(start=0;i-=3){w=number[i]|number[i-1]<<8|number[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}else if(endian==="le"){for(i=0,j=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j++}}}return this._strip()};function parseHex4Bits(string,index){var c=string.charCodeAt(index);if(c>=48&&c<=57){return c-48}else if(c>=65&&c<=70){return c-55}else if(c>=97&&c<=102){return c-87}else{assert(false,"Invalid character in "+string)}}function parseHexByte(string,lowerBound,index){var r=parseHex4Bits(string,index);if(index-1>=lowerBound){r|=parseHex4Bits(string,index-1)<<4}return r}BN.prototype._parseHex=function _parseHex(number,start,endian){this.length=Math.ceil((number.length-start)/6);this.words=new Array(this.length);for(var i=0;i=start;i-=2){w=parseHexByte(number,start,i)<=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}else{var parseLength=number.length-start;for(i=parseLength%2===0?start+1:start;i=18){off-=18;j+=1;this.words[j]|=w>>>26}else{off+=8}}}this._strip()};function parseBase(str,start,end,mul){var r=0;var b=0;var len=Math.min(str.length,end);for(var i=start;i=49){b=c-49+10}else if(c>=17){b=c-17+10}else{b=c}assert(c>=0&&b1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};if(typeof Symbol!=="undefined"&&typeof Symbol.for==="function"){try{BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect}catch(e){BN.prototype.inspect=inspect}}else{BN.prototype.inspect=inspect}function inspect(){return(this.red?""}var zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(base,padding){base=base||10;padding=padding|0||1;var out;if(base===16||base==="hex"){out="";var off=0;var carry=0;for(var i=0;i>>24-off&16777215;off+=2;if(off>=26){off-=26;i--}if(carry!==0||i!==this.length-1){out=zeros[6-word.length]+word+out}else{out=word+out}}if(carry!==0){out=carry.toString(16)+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}if(base===(base|0)&&base>=2&&base<=36){var groupSize=groupSizes[base];var groupBase=groupBases[base];out="";var c=this.clone();c.negative=0;while(!c.isZero()){var r=c.modrn(groupBase).toString(base);c=c.idivn(groupBase);if(!c.isZero()){out=zeros[groupSize-r.length]+r+out}else{out=r+out}}if(this.isZero()){out="0"+out}while(out.length%padding!==0){out="0"+out}if(this.negative!==0){out="-"+out}return out}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var ret=this.words[0];if(this.length===2){ret+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){ret+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-ret:ret};BN.prototype.toJSON=function toJSON(){return this.toString(16,2)};if(Buffer){BN.prototype.toBuffer=function toBuffer(endian,length){return this.toArrayLike(Buffer,endian,length)}}BN.prototype.toArray=function toArray(endian,length){return this.toArrayLike(Array,endian,length)};var allocate=function allocate(ArrayType,size){if(ArrayType.allocUnsafe){return ArrayType.allocUnsafe(size)}return new ArrayType(size)};BN.prototype.toArrayLike=function toArrayLike(ArrayType,endian,length){this._strip();var byteLength=this.byteLength();var reqLength=length||Math.max(1,byteLength);assert(byteLength<=reqLength,"byte array longer than desired length");assert(reqLength>0,"Requested array length <= 0");var res=allocate(ArrayType,reqLength);var postfix=endian==="le"?"LE":"BE";this["_toArrayLike"+postfix](res,byteLength);return res};BN.prototype._toArrayLikeLE=function _toArrayLikeLE(res,byteLength){var position=0;var carry=0;for(var i=0,shift=0;i>8&255}if(position>16&255}if(shift===6){if(position>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position=0){res[position--]=word>>8&255}if(position>=0){res[position--]=word>>16&255}if(shift===6){if(position>=0){res[position--]=word>>24&255}carry=0;shift=0}else{carry=word>>>24;shift+=2}}if(position>=0){res[position--]=carry;while(position>=0){res[position--]=0}}};if(Math.clz32){BN.prototype._countBits=function _countBits(w){return 32-Math.clz32(w)}}else{BN.prototype._countBits=function _countBits(w){var t=w;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(w){if(w===0)return 26;var t=w;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var w=this.words[this.length-1];var hi=this._countBits(w);return(this.length-1)*26+hi};function toBitArray(num){var w=new Array(num.bitLength());for(var bit=0;bit>>wbit&1}return w}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var r=0;for(var i=0;inum.length)return this.clone().ior(num);return num.clone().ior(this)};BN.prototype.uor=function uor(num){if(this.length>num.length)return this.clone().iuor(num);return num.clone().iuor(this)};BN.prototype.iuand=function iuand(num){var b;if(this.length>num.length){b=num}else{b=this}for(var i=0;inum.length)return this.clone().iand(num);return num.clone().iand(this)};BN.prototype.uand=function uand(num){if(this.length>num.length)return this.clone().iuand(num);return num.clone().iuand(this)};BN.prototype.iuxor=function iuxor(num){var a;var b;if(this.length>num.length){a=this;b=num}else{a=num;b=this}for(var i=0;inum.length)return this.clone().ixor(num);return num.clone().ixor(this)};BN.prototype.uxor=function uxor(num){if(this.length>num.length)return this.clone().iuxor(num);return num.clone().iuxor(this)};BN.prototype.inotn=function inotn(width){assert(typeof width==="number"&&width>=0);var bytesNeeded=Math.ceil(width/26)|0;var bitsLeft=width%26;this._expand(bytesNeeded);if(bitsLeft>0){bytesNeeded--}for(var i=0;i0){this.words[i]=~this.words[i]&67108863>>26-bitsLeft;i++}for(;i=0);var off=bit/26|0;var wbit=bit%26;this._expand(off+1);if(val){this.words[off]=this.words[off]|1<num.length){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this.words[this.length]=carry;this.length++}else if(a!==this){for(;inum.length)return this.clone().iadd(num);return num.clone().iadd(this)};BN.prototype.isub=function isub(num){if(num.negative!==0){num.negative=0;var r=this.iadd(num);num.negative=1;return r._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(num);this.negative=1;return this._normSign()}var cmp=this.cmp(num);if(cmp===0){this.negative=0;this.length=1;this.words[0]=0;return this}var a,b;if(cmp>0){a=this;b=num}else{a=num;b=this}var carry=0;for(var i=0;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}if(carry===0&&i>>26;var rword=carry&67108863;var maxJ=Math.min(k,num.length-1);for(var j=Math.max(0,k-self.length+1);j<=maxJ;j++){var i=k-j|0;a=self.words[i]|0;b=num.words[j]|0;r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0){out.words[k]=carry|0}else{out.length--}return out._strip()}var comb10MulTo=function comb10MulTo(self,num,out){var a=self.words;var b=num.words;var o=out.words;var c=0;var lo;var mid;var hi;var a0=a[0]|0;var al0=a0&8191;var ah0=a0>>>13;var a1=a[1]|0;var al1=a1&8191;var ah1=a1>>>13;var a2=a[2]|0;var al2=a2&8191;var ah2=a2>>>13;var a3=a[3]|0;var al3=a3&8191;var ah3=a3>>>13;var a4=a[4]|0;var al4=a4&8191;var ah4=a4>>>13;var a5=a[5]|0;var al5=a5&8191;var ah5=a5>>>13;var a6=a[6]|0;var al6=a6&8191;var ah6=a6>>>13;var a7=a[7]|0;var al7=a7&8191;var ah7=a7>>>13;var a8=a[8]|0;var al8=a8&8191;var ah8=a8>>>13;var a9=a[9]|0;var al9=a9&8191;var ah9=a9>>>13;var b0=b[0]|0;var bl0=b0&8191;var bh0=b0>>>13;var b1=b[1]|0;var bl1=b1&8191;var bh1=b1>>>13;var b2=b[2]|0;var bl2=b2&8191;var bh2=b2>>>13;var b3=b[3]|0;var bl3=b3&8191;var bh3=b3>>>13;var b4=b[4]|0;var bl4=b4&8191;var bh4=b4>>>13;var b5=b[5]|0;var bl5=b5&8191;var bh5=b5>>>13;var b6=b[6]|0;var bl6=b6&8191;var bh6=b6>>>13;var b7=b[7]|0;var bl7=b7&8191;var bh7=b7>>>13;var b8=b[8]|0;var bl8=b8&8191;var bh8=b8>>>13;var b9=b[9]|0;var bl9=b9&8191;var bh9=b9>>>13;out.negative=self.negative^num.negative;out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);var w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;var w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;var w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;var w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;var w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;var w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;var w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;var w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;var w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;var w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;var w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;var w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;var w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;var w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;var w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;var w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;var w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;var w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);var w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length++}return out};if(!Math.imul){comb10MulTo=smallMulTo}function bigMulTo(self,num,out){out.negative=num.negative^self.negative;out.length=self.length+num.length;var carry=0;var hncarry=0;for(var k=0;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0){out.words[k]=carry}else{out.length--}return out._strip()}function jumboMulTo(self,num,out){return bigMulTo(self,num,out)}BN.prototype.mulTo=function mulTo(num,out){var res;var len=this.length+num.length;if(this.length===10&&num.length===10){res=comb10MulTo(this,num,out)}else if(len<63){res=smallMulTo(this,num,out)}else if(len<1024){res=bigMulTo(this,num,out)}else{res=jumboMulTo(this,num,out)}return res};BN.prototype.mul=function mul(num){var out=new BN(null);out.words=new Array(this.length+num.length);return this.mulTo(num,out)};BN.prototype.mulf=function mulf(num){var out=new BN(null);out.words=new Array(this.length+num.length);return jumboMulTo(this,num,out)};BN.prototype.imul=function imul(num){return this.clone().mulTo(num,this)};BN.prototype.imuln=function imuln(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(typeof num==="number");assert(num<67108864);var carry=0;for(var i=0;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}if(carry!==0){this.words[i]=carry;this.length++}if(num===0){this.length=1;this._normSign()}return isNegNum?this.ineg():this};BN.prototype.muln=function muln(num){return this.clone().imuln(num)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(num){var w=toBitArray(num);if(w.length===0)return new BN(1);var res=this;for(var i=0;i=0);var r=bits%26;var s=(bits-r)/26;var carryMask=67108863>>>26-r<<26-r;var i;if(r!==0){var carry=0;for(i=0;i>>26-r}if(carry){this.words[i]=carry;this.length++}}if(s!==0){for(i=this.length-1;i>=0;i--){this.words[i+s]=this.words[i]}for(i=0;i=0);var h;if(hint){h=(hint-hint%26)/26}else{h=0}var r=bits%26;var s=Math.min((bits-r)/26,this.length);var mask=67108863^67108863>>>r<s){this.length-=s;for(i=0;i=0&&(carry!==0||i>=h);i--){var word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}if(maskedWords&&carry!==0){maskedWords.words[maskedWords.length++]=carry}if(this.length===0){this.words[0]=0;this.length=1}return this._strip()};BN.prototype.ishrn=function ishrn(bits,hint,extended){assert(this.negative===0);return this.iushrn(bits,hint,extended)};BN.prototype.shln=function shln(bits){return this.clone().ishln(bits)};BN.prototype.ushln=function ushln(bits){return this.clone().iushln(bits)};BN.prototype.shrn=function shrn(bits){return this.clone().ishrn(bits)};BN.prototype.ushrn=function ushrn(bits){return this.clone().iushrn(bits)};BN.prototype.testn=function testn(bit){assert(typeof bit==="number"&&bit>=0);var r=bit%26;var s=(bit-r)/26;var q=1<=0);var r=bits%26;var s=(bits-r)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=s){return this}if(r!==0){s++}this.length=Math.min(s,this.length);if(r!==0){var mask=67108863^67108863>>>r<=67108864;i++){this.words[i]-=67108864;if(i===this.length-1){this.words[i+1]=1}else{this.words[i+1]++}}this.length=Math.max(this.length,i+1);return this};BN.prototype.isubn=function isubn(num){assert(typeof num==="number");assert(num<67108864);if(num<0)return this.iaddn(-num);if(this.negative!==0){this.negative=0;this.iaddn(num);this.negative=1;return this}this.words[0]-=num;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var i=0;i>26)-(right/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this._strip();assert(carry===-1);carry=0;for(i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this._strip()};BN.prototype._wordDiv=function _wordDiv(num,mode){var shift=this.length-num.length;var a=this.clone();var b=num;var bhi=b.words[b.length-1]|0;var bhiBits=this._countBits(bhi);shift=26-bhiBits;if(shift!==0){b=b.ushln(shift);a.iushln(shift);bhi=b.words[b.length-1]|0}var m=a.length-b.length;var q;if(mode!=="mod"){q=new BN(null);q.length=m+1;q.words=new Array(q.length);for(var i=0;i=0;j--){var qj=(a.words[b.length+j]|0)*67108864+(a.words[b.length+j-1]|0);qj=Math.min(qj/bhi|0,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj--;a.negative=0;a._ishlnsubmul(b,1,j);if(!a.isZero()){a.negative^=1}}if(q){q.words[j]=qj}}if(q){q._strip()}a._strip();if(mode!=="div"&&shift!==0){a.iushrn(shift)}return{div:q||null,mod:a}};BN.prototype.divmod=function divmod(num,mode,positive){assert(!num.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var div,mod,res;if(this.negative!==0&&num.negative===0){res=this.neg().divmod(num,mode);if(mode!=="mod"){div=res.div.neg()}if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.iadd(num)}}return{div:div,mod:mod}}if(this.negative===0&&num.negative!==0){res=this.divmod(num.neg(),mode);if(mode!=="mod"){div=res.div.neg()}return{div:div,mod:res.mod}}if((this.negative&num.negative)!==0){res=this.neg().divmod(num.neg(),mode);if(mode!=="div"){mod=res.mod.neg();if(positive&&mod.negative!==0){mod.isub(num)}}return{div:res.div,mod:mod}}if(num.length>this.length||this.cmp(num)<0){return{div:new BN(0),mod:this}}if(num.length===1){if(mode==="div"){return{div:this.divn(num.words[0]),mod:null}}if(mode==="mod"){return{div:null,mod:new BN(this.modrn(num.words[0]))}}return{div:this.divn(num.words[0]),mod:new BN(this.modrn(num.words[0]))}}return this._wordDiv(num,mode)};BN.prototype.div=function div(num){return this.divmod(num,"div",false).div};BN.prototype.mod=function mod(num){return this.divmod(num,"mod",false).mod};BN.prototype.umod=function umod(num){return this.divmod(num,"mod",true).mod};BN.prototype.divRound=function divRound(num){var dm=this.divmod(num);if(dm.mod.isZero())return dm.div;var mod=dm.mod.abs();var half=num.abs().iushrn(1);var r2=num.words[0]&1;var cmp=mod.cmp(half);if(cmp<0||r2===1&&cmp===0)return dm.div;var up=new BN(1);up.negative=this.negative^num.negative;return dm.div.iadd(up)};BN.prototype.modrn=function modrn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var p=(1<<26)%num;var acc=0;for(var i=this.length-1;i>=0;i--){acc=(p*acc+(this.words[i]|0))%num}return isNegNum?-acc:acc};BN.prototype.modn=function modn(num){return this.modrn(num)};BN.prototype.idivn=function idivn(num){var isNegNum=num<0;if(isNegNum)num=-num;assert(num<=67108863);var carry=0;for(var i=this.length-1;i>=0;i--){var w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}this._strip();return isNegNum?this.ineg():this};BN.prototype.divn=function divn(num){return this.clone().idivn(num)};BN.prototype.egcd=function egcd(p){assert(p.negative===0);assert(!p.isZero());var x=this;var y=p.clone();if(x.negative!==0){x=x.umod(p)}else{x=x.clone()}var A=new BN(1);var B=new BN(0);var C=new BN(0);var D=new BN(1);var g=0;while(x.isEven()&&y.isEven()){x.iushrn(1);y.iushrn(1);++g}var yp=y.clone();var xp=x.clone();while(!x.isZero()){for(var i=0,im=1;(x.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){x.iushrn(i);while(i-- >0){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}}for(var j=0,jm=1;(y.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){y.iushrn(j);while(j-- >0){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}return{a:C,b:D,gcd:y.iushln(g)}};BN.prototype._invmp=function _invmp(p){assert(p.negative===0);assert(!p.isZero());var a=this;var b=p.clone();if(a.negative!==0){a=a.umod(p)}else{a=a.clone()}var x1=new BN(1);var x2=new BN(0);var delta=b.clone();while(a.cmpn(1)>0&&b.cmpn(1)>0){for(var i=0,im=1;(a.words[0]&im)===0&&i<26;++i,im<<=1);if(i>0){a.iushrn(i);while(i-- >0){if(x1.isOdd()){x1.iadd(delta)}x1.iushrn(1)}}for(var j=0,jm=1;(b.words[0]&jm)===0&&j<26;++j,jm<<=1);if(j>0){b.iushrn(j);while(j-- >0){if(x2.isOdd()){x2.iadd(delta)}x2.iushrn(1)}}if(a.cmp(b)>=0){a.isub(b);x1.isub(x2)}else{b.isub(a);x2.isub(x1)}}var res;if(a.cmpn(1)===0){res=x1}else{res=x2}if(res.cmpn(0)<0){res.iadd(p)}return res};BN.prototype.gcd=function gcd(num){if(this.isZero())return num.abs();if(num.isZero())return this.abs();var a=this.clone();var b=num.clone();a.negative=0;b.negative=0;for(var shift=0;a.isEven()&&b.isEven();shift++){a.iushrn(1);b.iushrn(1)}do{while(a.isEven()){a.iushrn(1)}while(b.isEven()){b.iushrn(1)}var r=a.cmp(b);if(r<0){var t=a;a=b;b=t}else if(r===0||b.cmpn(1)===0){break}a.isub(b)}while(true);return b.iushln(shift)};BN.prototype.invm=function invm(num){return this.egcd(num).a.umod(num)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(num){return this.words[0]&num};BN.prototype.bincn=function bincn(bit){assert(typeof bit==="number");var r=bit%26;var s=(bit-r)/26;var q=1<>>26;w&=67108863;this.words[i]=w}if(carry!==0){this.words[i]=carry;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(num){var negative=num<0;if(this.negative!==0&&!negative)return-1;if(this.negative===0&&negative)return 1;this._strip();var res;if(this.length>1){res=1}else{if(negative){num=-num}assert(num<=67108863,"Number is too big");var w=this.words[0]|0;res=w===num?0:wnum.length)return 1;if(this.length=0;i--){var a=this.words[i]|0;var b=num.words[i]|0;if(a===b)continue;if(ab){res=1}break}return res};BN.prototype.gtn=function gtn(num){return this.cmpn(num)===1};BN.prototype.gt=function gt(num){return this.cmp(num)===1};BN.prototype.gten=function gten(num){return this.cmpn(num)>=0};BN.prototype.gte=function gte(num){return this.cmp(num)>=0};BN.prototype.ltn=function ltn(num){return this.cmpn(num)===-1};BN.prototype.lt=function lt(num){return this.cmp(num)===-1};BN.prototype.lten=function lten(num){return this.cmpn(num)<=0};BN.prototype.lte=function lte(num){return this.cmp(num)<=0};BN.prototype.eqn=function eqn(num){return this.cmpn(num)===0};BN.prototype.eq=function eq(num){return this.cmp(num)===0};BN.red=function red(num){return new Red(num)};BN.prototype.toRed=function toRed(ctx){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return ctx.convertTo(this)._forceRed(ctx)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(ctx){this.red=ctx;return this};BN.prototype.forceRed=function forceRed(ctx){assert(!this.red,"Already a number in reduction context");return this._forceRed(ctx)};BN.prototype.redAdd=function redAdd(num){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,num)};BN.prototype.redIAdd=function redIAdd(num){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,num)};BN.prototype.redSub=function redSub(num){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,num)};BN.prototype.redISub=function redISub(num){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,num)};BN.prototype.redShl=function redShl(num){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,num)};BN.prototype.redMul=function redMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.mul(this,num)};BN.prototype.redIMul=function redIMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);return this.red.imul(this,num)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(num){assert(this.red&&!num.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,num)};var primes={k256:null,p224:null,p192:null,p25519:null};function MPrime(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var tmp=new BN(null);tmp.words=new Array(Math.ceil(this.n/13));return tmp};MPrime.prototype.ireduce=function ireduce(num){var r=num;var rlen;do{this.split(r,this.tmp);r=this.imulK(r);r=r.iadd(this.tmp);rlen=r.bitLength()}while(rlen>this.n);var cmp=rlen0){r.isub(this.p)}else{if(r.strip!==undefined){r.strip()}else{r._strip()}}return r};MPrime.prototype.split=function split(input,out){input.iushrn(this.n,0,out)};MPrime.prototype.imulK=function imulK(num){return num.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(input,output){var mask=4194303;var outLen=Math.min(input.length,9);for(var i=0;i>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10){input.length-=10}else{input.length-=9}};K256.prototype.imulK=function imulK(num){num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;var lo=0;for(var i=0;i>>=26;num.words[i]=lo;carry=hi}if(carry!==0){num.words[num.length++]=carry}return num};BN._prime=function prime(name){if(primes[name])return primes[name];var prime;if(name==="k256"){prime=new K256}else if(name==="p224"){prime=new P224}else if(name==="p192"){prime=new P192}else if(name==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+name)}primes[name]=prime;return prime};function Red(m){if(typeof m==="string"){var prime=BN._prime(m);this.m=prime.p;this.prime=prime}else{assert(m.gtn(1),"modulus must be greater than 1");this.m=m;this.prime=null}}Red.prototype._verify1=function _verify1(a){assert(a.negative===0,"red works only with positives");assert(a.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(a,b){assert((a.negative|b.negative)===0,"red works only with positives");assert(a.red&&a.red===b.red,"red works only with red numbers")};Red.prototype.imod=function imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);move(a,a.umod(this.m)._forceRed(this));return a};Red.prototype.neg=function neg(a){if(a.isZero()){return a.clone()}return this.m.sub(a)._forceRed(this)};Red.prototype.add=function add(a,b){this._verify2(a,b);var res=a.add(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res._forceRed(this)};Red.prototype.iadd=function iadd(a,b){this._verify2(a,b);var res=a.iadd(b);if(res.cmp(this.m)>=0){res.isub(this.m)}return res};Red.prototype.sub=function sub(a,b){this._verify2(a,b);var res=a.sub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res._forceRed(this)};Red.prototype.isub=function isub(a,b){this._verify2(a,b);var res=a.isub(b);if(res.cmpn(0)<0){res.iadd(this.m)}return res};Red.prototype.shl=function shl(a,num){this._verify1(a);return this.imod(a.ushln(num))};Red.prototype.imul=function imul(a,b){this._verify2(a,b);return this.imod(a.imul(b))};Red.prototype.mul=function mul(a,b){this._verify2(a,b);return this.imod(a.mul(b))};Red.prototype.isqr=function isqr(a){return this.imul(a,a.clone())};Red.prototype.sqr=function sqr(a){return this.mul(a,a)};Red.prototype.sqrt=function sqrt(a){if(a.isZero())return a.clone();var mod3=this.m.andln(3);assert(mod3%2===1);if(mod3===3){var pow=this.m.add(new BN(1)).iushrn(2);return this.pow(a,pow)}var q=this.m.subn(1);var s=0;while(!q.isZero()&&q.andln(1)===0){s++;q.iushrn(1)}assert(!q.isZero());var one=new BN(1).toRed(this);var nOne=one.redNeg();var lpow=this.m.subn(1).iushrn(1);var z=this.m.bitLength();z=new BN(2*z*z).toRed(this);while(this.pow(z,lpow).cmp(nOne)!==0){z.redIAdd(nOne)}var c=this.pow(z,q);var r=this.pow(a,q.addn(1).iushrn(1));var t=this.pow(a,q);var m=s;while(t.cmp(one)!==0){var tmp=t;for(var i=0;tmp.cmp(one)!==0;i++){tmp=tmp.redSqr()}assert(i=0;i--){var word=num.words[i];for(var j=start-1;j>=0;j--){var bit=word>>j&1;if(res!==wnd[0]){res=this.sqr(res)}if(bit===0&¤t===0){currentLen=0;continue}current<<=1;current|=bit;currentLen++;if(currentLen!==windowSize&&(i!==0||j!==0))continue;res=this.mul(res,wnd[current]);currentLen=0;current=0}start=26}return res};Red.prototype.convertTo=function convertTo(num){var r=num.umod(this.m);return r===num?r.clone():r};Red.prototype.convertFrom=function convertFrom(num){var res=num.clone();res.red=null;return res};BN.mont=function mont(num){return new Mont(num)};function Mont(m){Red.call(this,m);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(num){return this.imod(num.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(num){var r=this.imod(num.mul(this.rinv));r.red=null;return r};Mont.prototype.imul=function imul(a,b){if(a.isZero()||b.isZero()){a.words[0]=0;a.length=1;return a}var t=a.imul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.mul=function mul(a,b){if(a.isZero()||b.isZero())return new BN(0)._forceRed(this);var t=a.mul(b);var c=t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var u=t.isub(c).iushrn(this.shift);var res=u;if(u.cmp(this.m)>=0){res=u.isub(this.m)}else if(u.cmpn(0)<0){res=u.iadd(this.m)}return res._forceRed(this)};Mont.prototype.invm=function invm(a){var res=this.imod(a._invmp(this.m).mul(this.r2));return res._forceRed(this)}})(module,bn$1)})(bn$2);return bn$2.exports}var bnExports=requireBn$1();var _BN=getDefaultExportFromCjs(bnExports);let _permanentCensorErrors=false;let _censorErrors=false;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels["default"];let _globalLogger=null;function _checkNormalize(){try{const missing=[];["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing.push(form)}});if(missing.length){throw new Error("missing "+missing.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"]="UNPREDICTABLE_ENERGY_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{version="0.0.1";static errors=ErrorCode;static levels=LogLevel;constructor(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}_log(logLevel,args){const level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)}debug(...args){this._log(Logger.levels.DEBUG,args)}info(...args){this._log(Logger.levels.INFO,args)}warn(...args){this._log(Logger.levels.WARNING,args)}makeError(message,code,params){if(_censorErrors){return this.makeError("censored error",code,{})}if(!code){code=Logger.errors.UNKNOWN_ERROR}if(!params){params={}}const messageDetails=[];Object.keys(params).forEach(key=>{const value=params[key];try{if(value instanceof Uint8Array){let hex="";for(let i=0;i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push(`code=${code}`);messageDetails.push(`version=${this.version}`);const reason=message;if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}const error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error}throwError(message,code,params){throw this.makeError(message,code,params)}throwArgumentError(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})}assert(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)}assertArgument(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)}checkNormalize(message){if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}}checkSafeUint53(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}}checkArgumentCount(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}}checkNew(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}checkAbstract(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}static globalLogger(){if(!_globalLogger){_globalLogger=new Logger("logger/0.0.1")}return _globalLogger}static setCensorship(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent}static setLogLevel(logLevel){const level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level}static from(version){return new Logger(version)}}const logger$7=new Logger("utils/properties/0.0.1");function checkType(value,type,name){const types=type.split("|").map(t=>t.trim());for(let i=0;iPromise.resolve(value[k])));return results.reduce((accum,v,index)=>{accum[keys[index]]=v;return accum},{})}function defineProperties(target,values,types){for(let key in values){let value=values[key];const type=types?types[key]:null;if(type){checkType(value,type,key)}Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function checkProperties(object,properties){if(!object||typeof object!=="object"){logger$7.throwArgumentError("invalid object","object",object)}Object.keys(object).forEach(key=>{if(!properties[key]){logger$7.throwArgumentError("invalid object key - "+key,"transaction:"+key,object)}})}function stringify$1(value){if(value==null){return"null"}if(Array.isArray(value)){return"[ "+value.map(stringify$1).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify$1(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"number":return value.toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify$1(k)}: ${stringify$1(value[k])}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function isError(error,code){return error&&error.code===code}function isCallException(error){return isError(error,"CALL_EXCEPTION")}function makeError(message,code,info){{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify$1(info)}`)}for(const key in info){const value=info[key];details.push(key+"="+stringify$1(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}function assertArgumentCount(count,expectedCount,message){if(message==null){message=""}if(message){message=": "+message}assert(count>=expectedCount,"missing arguemnt"+message,"MISSING_ARGUMENT",{count:count,expectedCount:expectedCount});assert(count<=expectedCount,"too many arguemnts"+message,"UNEXPECTED_ARGUMENT",{count:count,expectedCount:expectedCount})}const _normalizeForms=["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);function assertNormalize(form){assert(_normalizeForms.indexOf(form)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:form}})}function assertPrivate(givenGuard,guard,className){if(className==null){className=""}if(givenGuard!==guard){let method=className,operation="new";if(className){method+=".";operation+=" "+className}assert(false,`private constructor; use ${method}from* methods`,"UNSUPPORTED_OPERATION",{operation:operation})}}const logger$6=new Logger("utils/data/0.0.1");function isHexable(value){return!!value.toHexString}function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes$1(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(let i=0;i=256){return false}}return true}function _getBytes(value,name,copy){if(value instanceof Uint8Array){if(copy){return new Uint8Array(value)}return value}if(typeof value==="string"&&value.match(/^0x([0-9a-f][0-9a-f])*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;iNumber(item));value=new Uint8Array(v)}}if(typeof value==="number"){logger$6.checkSafeUint53(value,"invalid hexlify value");let hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger$6.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes$1(value)){let result="0x";for(let i=0;i>4]+HexCharacters[v&15]}return result}return logger$6.throwArgumentError("invalid hexlify value","value",value)}function concat(items){return"0x"+items.map(d=>hexlify(d).substring(2)).join("")}function hexDataSlice(data,offset,endOffset){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){logger$6.throwArgumentError("invalid hexData","value",data)}offset=2+2*offset;return"0x"+data.substring(offset)}function hexDataLength(data){if(typeof data!=="string"){data=hexlify(data)}else if(!isHexString(data)||data.length%2){return null}return(data.length-2)/2}function dataLength(data){if(isHexString(data,true)){return(data.length-2)/2}return getBytes(data).length}function dataSlice(data,start,end){const bytes=getBytes(data);if(end!=null&&end>bytes.length){assert(false,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:bytes,length:bytes.length,offset:end})}return hexlify(bytes.slice(start==null?0:start,end==null?bytes.length:end))}function stripZerosLeft(data){let bytes=hexlify(data).substring(2);while(bytes.startsWith("00")){bytes=bytes.substring(2)}return"0x"+bytes}function zeroPad(data,length,left){const bytes=getBytes(data);assert(length>=bytes.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(bytes),length:length,offset:length+1});const result=new Uint8Array(length);result.fill(0);if(left){result.set(bytes,length-bytes.length)}else{result.set(bytes,0)}return hexlify(result)}function zeroPadValue(data,length){return zeroPad(data,length,true)}function zeroPadBytes(data,length){return zeroPad(data,length,false)}function stripZeros(value){let result=arrayify(value);if(result.length===0){return result}let start=0;while(start{result+=hexlify(item).substring(2)});return result}var BN=_BN.BN;const logger$5=new Logger("bigNumber/0.0.1");const _constructorGuard={};const MAX_SAFE=9007199254740991;let _warnedToStringRadix=false;class BigNumber{_hex;_isBigNumber;constructor(constructorGuard,hex){logger$5.checkNew(new.target,BigNumber);if(constructorGuard!==_constructorGuard){logger$5.throwError("cannot call constructor directly; use BigNumber.from",Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"})}this._hex=hex;this._isBigNumber=true;Object.freeze(this)}fromTwos(value){return toBigNumber(toBN(this).fromTwos(value))}toTwos(value){return toBigNumber(toBN(this).toTwos(value))}abs(){if(this._hex[0]==="-"){return BigNumber.from(this._hex.substring(1))}return this}add(other){return toBigNumber(toBN(this).add(toBN(other)))}sub(other){return toBigNumber(toBN(this).sub(toBN(other)))}div(other){const o=BigNumber.from(other);if(o.isZero()){throwFault("division by zero","div")}return toBigNumber(toBN(this).div(toBN(other)))}mul(other){return toBigNumber(toBN(this).mul(toBN(other)))}mod(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot modulo negative values","mod")}return toBigNumber(toBN(this).umod(value))}pow(other){const value=toBN(other);if(value.isNeg()){throwFault("cannot raise to negative values","pow")}return toBigNumber(toBN(this).pow(value))}and(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'and' negative values","and")}return toBigNumber(toBN(this).and(value))}or(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'or' negative values","or")}return toBigNumber(toBN(this).or(value))}xor(other){const value=toBN(other);if(this.isNegative()||value.isNeg()){throwFault("cannot 'xor' negative values","xor")}return toBigNumber(toBN(this).xor(value))}mask(value){if(this.isNegative()||value<0){throwFault("cannot mask negative values","mask")}return toBigNumber(toBN(this).maskn(value))}shl(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shl")}return toBigNumber(toBN(this).shln(value))}shr(value){if(this.isNegative()||value<0){throwFault("cannot shift negative values","shr")}return toBigNumber(toBN(this).shrn(value))}eq(other){return toBN(this).eq(toBN(other))}lt(other){return toBN(this).lt(toBN(other))}lte(other){return toBN(this).lte(toBN(other))}gt(other){return toBN(this).gt(toBN(other))}gte(other){return toBN(this).gte(toBN(other))}isNegative(){return this._hex[0]==="-"}isZero(){return toBN(this).isZero()}toNumber(){try{return toBN(this).toNumber()}catch(error){throwFault("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return logger$5.throwError("this platform does not support BigInt",Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){if(arguments.length>0){if(arguments[0]===10){if(!_warnedToStringRadix){_warnedToStringRadix=true;logger$5.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")}}else if(arguments[0]===16){logger$5.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Logger.errors.UNEXPECTED_ARGUMENT,{})}else{logger$5.throwError("BigNumber.toString does not accept parameters",Logger.errors.UNEXPECTED_ARGUMENT,{})}}return toBN(this).toString(10)}toHexString(){return this._hex}toJSON(key){return{type:"BigNumber",hex:this.toHexString()}}static from(value){if(value instanceof BigNumber){return value}if(typeof value==="string"){if(value.match(/^-?0x[0-9a-f]+$/i)){return new BigNumber(_constructorGuard,toHex(value))}if(value.match(/^-?[0-9]+$/)){return new BigNumber(_constructorGuard,toHex(new BN(value)))}return logger$5.throwArgumentError("invalid BigNumber string","value",value)}if(typeof value==="number"){if(value%1){throwFault("underflow","BigNumber.from",value)}if(value>=MAX_SAFE||value<=-MAX_SAFE){throwFault("overflow","BigNumber.from",value)}return BigNumber.from(String(value))}const anyValue=value;if(typeof anyValue==="bigint"){return BigNumber.from(anyValue.toString())}if(isBytes$1(anyValue)){return BigNumber.from(hexlify(anyValue))}if(anyValue){if(anyValue.toHexString){const hex=anyValue.toHexString();if(typeof hex==="string"){return BigNumber.from(hex)}}else{let hex=anyValue._hex;if(hex==null&&anyValue.type==="BigNumber"){hex=anyValue.hex}if(typeof hex==="string"){if(isHexString(hex)||hex[0]==="-"&&isHexString(hex.substring(1))){return BigNumber.from(hex)}}}}return logger$5.throwArgumentError("invalid BigNumber value","value",value)}static isBigNumber(value){return!!(value&&value._isBigNumber)}}function toHex(value){if(typeof value!=="string"){return toHex(value.toString(16))}if(value[0]==="-"){value=value.substring(1);if(value[0]==="-"){logger$5.throwArgumentError("invalid hex","value",value)}value=toHex(value);if(value==="0x00"){return value}return"-"+value}if(value.substring(0,2)!=="0x"){value="0x"+value}if(value==="0x"){return"0x00"}if(value.length%2){value="0x0"+value.substring(2)}while(value.length>4&&value.substring(0,4)==="0x00"){value="0x"+value.substring(4)}return value}function toBigNumber(value){return BigNumber.from(toHex(value))}function toBN(value){const hex=BigNumber.from(value).toHexString();if(hex[0]==="-"){return new BN("-"+hex.substring(3),16)}return new BN(hex.substring(2),16)}function throwFault(fault,operation,value){const params={fault:fault,operation:operation};if(value!=null){params.value=value}return logger$5.throwError(fault,Logger.errors.NUMERIC_FAULT,params)}const logger$4=new Logger("rlp/0.0.1");function arrayifyInteger$1(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function unarrayifyInteger$1(data,offset,length){let result=0;for(let i=0;ioffset+1+length){logger$4.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}}return{consumed:1+length,result:result}}function _decode$1(data,offset){if(data.length===0){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}if(data[offset]>=248){const lengthLength=data[offset]-247;if(offset+1+lengthLength>data.length){logger$4.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;if(offset+1+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}return _decodeChildren$1(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;if(offset+1+lengthLength>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const length=unarrayifyInteger$1(data,offset+1,lengthLength);if(offset+1+lengthLength+length>data.length){logger$4.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;if(offset+1+length>data.length){logger$4.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{})}const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlify(data[offset])}}function decode$1(data){const bytes=arrayify(data);const decoded=_decode$1(bytes,0);if(decoded.consumed!==bytes.length){logger$4.throwArgumentError("invalid rlp data","data",data)}return decoded.result}const U32_MASK64=(()=>BigInt(2**32-1))();const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){const len=lst.length;let Ah=new Uint32Array(len);let Al=new Uint32Array(len);for(let i=0;in/2**32|0;const fromNumL=n=>n>>>0;function setU64FromNum(view,byteOffset,n,isLE){const h=fromNumH(n);const l=fromNumL(n);view.setUint32(byteOffset,isLE?l:h,isLE);view.setUint32(byteOffset+4,isLE?h:l,isLE)}const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;function isBytes(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in a&&a.BYTES_PER_ELEMENT===1}const atitle=title=>title?`"${title}" `:"";function anumber(n,title=""){if(typeof n!=="number")throw new TypeError(atitle(title)+"expected number, got "+typeof n);if(!Number.isSafeInteger(n)||n<0)throw new RangeError(atitle(title)+"expected integer >= 0, got "+n);return n}function abool(value,title=""){if(typeof value!=="boolean")throw new TypeError(atitle(title)+"expected boolean, got type="+typeof value);return value}function abytes(value,length,title=""){if(isBytes(value)&&length===undefined)return value;const bytes=isBytes(value);const ofLen="";const got=bytes?`length=${value.length}`:`type=${typeof value}`;const message=atitle(title)+"expected Uint8Array"+ofLen+", got "+got;if(!bytes)throw new TypeError(message);throw new RangeError(message)}function ahash(h){if(typeof h!=="function"||typeof h.create!=="function")throw new TypeError("expected hash wrapped by utils.createHasher");anumber(h.outputLen);anumber(h.blockLen);if(h.outputLen<1||h.blockLen<1)throw new Error("hash blockLen / outputLen must be >= 1")}const aobject=(value,label)=>{if(value===null||typeof value!=="object"||Array.isArray(value))throw new TypeError((label==="object"?"":`"${label}" `)+"expected object, got type="+typeof value)};const aopts=(value,label)=>{aobject(value,label);const proto=Object.getPrototypeOf(value);if(proto!==Object.prototype&&proto!==null)throw new TypeError(`"${label}" expected plain object`);if(Object.hasOwn(value,"__proto__"))throw new TypeError(`"${label}.__proto__" is not allowed`)};function aexists(instance,checkFinished=true){if(instance.destroyed)throw new Error("hash was destroyed");if(checkFinished&&instance.finished)throw new Error("digest() was already called")}function aoutput(out,instance){abytes(out,undefined,"output");const min=instance.outputLen;if(!(out.length>=min)){throw new RangeError('"output" expected length >= '+min)}}function u32(arr){return new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4))}function clean(...arrays){for(let i=0;i>>shift}function rotl(word,shift){return word<>>32-shift>>>0}const isLE=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function byteSwap(word){return word<<24&4278190080|word<<8&16711680|word>>>8&65280|word>>>24&255}function byteSwap32(arr){for(let i=0;iu:byteSwap32;function nextTick(onReject){const host=globalThis;if(typeof host.scheduler?.yield==="function"){const promise=host.scheduler.yield();if(onReject)promise.catch(onReject);return promise}return new Promise(resolve=>host.setTimeout(resolve,0))}async function asyncLoop(iters,tick,cb,onReject){anumber(iters,"iters");anumber(tick,"tick");if(typeof cb!=="function")throw new TypeError("callback must be a function");let ts=Date.now();for(let i=0;i=0&&diff= 1');if(dkLen<1)throw new Error('"dkLen" must be >= 1');if(dkLen>(2**32-1)*hash.outputLen)throw new Error("derived key too long");const p=kdfInputToBytes(_password,"password");try{const s=kdfInputToBytes(_salt,"salt");try{const DK=new Uint8Array(dkLen);const{iHash,oHash,outputLen}=hmac$1.create(hash,p);const u=new Uint8Array(outputLen);const eng=pbkdf2Engine(iHash,oHash,s,u);return{c:c,dkLen:dkLen,asyncTick:asyncTick,DK:DK,outputLen:outputLen,eng:eng}}finally{if(typeof _salt==="string")clean(s)}}finally{if(typeof _password==="string")clean(p)}}function pbkdf2Engine(iHash,oHash,salt,u){const counter=new Uint8Array(4);const view=createView(counter);const salted=iHash._cloneInto().update(salt);const work=oHash._cloneInto();const iClone=iHash._cloneInto;const oClone=oHash._cloneInto;return{u1:(ti,Ti)=>{view.setInt32(0,ti,false);salted._cloneInto(work).update(counter).digestInto(u);oHash._cloneInto(work).update(u).digestInto(u);Ti.set(u.subarray(0,Ti.length))},rounds:(c,Ti)=>{for(let ui=1;ui{iHash.destroy();oHash.destroy();salted.destroy();work.destroy();clean(u);return DK}}}function pbkdf2$3(hash,password,salt,opts){const{c,dkLen,DK,outputLen,eng}=pbkdf2Init(hash,password,salt,opts);for(let ti=1,pos=0;pos>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){clean(SHA256_W)}destroy(){this.destroyed=true;this.set(0,0,0,0,0,0,0,0);clean(this.buffer)}}class _SHA256 extends SHA2_32B{constructor(){super(32,SHA256_IV)}}const K512=(()=>split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_Kh=(()=>K512[0])();const SHA512_Kl=(()=>K512[1])();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA2_64B extends HashMD{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(outputLen,IV){super(128,outputLen,16,false);this.Ah=IV[0]|0;this.Al=IV[1]|0;this.Bh=IV[2]|0;this.Bl=IV[3]|0;this.Ch=IV[4]|0;this.Cl=IV[5]|0;this.Dh=IV[6]|0;this.Dl=IV[7]|0;this.Eh=IV[8]|0;this.El=IV[9]|0;this.Fh=IV[10]|0;this.Fl=IV[11]|0;this.Gh=IV[12]|0;this.Gl=IV[13]|0;this.Hh=IV[14]|0;this.Hl=IV[15]|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=rotrSH(W15h,W15l,1)^rotrSH(W15h,W15l,8)^shrSH(W15h,W15l,7);const s0l=rotrSL(W15h,W15l,1)^rotrSL(W15h,W15l,8)^shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=rotrSH(W2h,W2l,19)^rotrBH(W2h,W2l,61)^shrSH(W2h,W2l,6);const s1l=rotrSL(W2h,W2l,19)^rotrBL(W2h,W2l,61)^shrSL(W2h,W2l,6);const SUMl=add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=rotrSH(Eh,El,14)^rotrSH(Eh,El,18)^rotrBH(Eh,El,41);const sigma1l=rotrSL(Eh,El,14)^rotrSL(Eh,El,18)^rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=rotrSH(Ah,Al,28)^rotrBH(Ah,Al,34)^rotrBH(Ah,Al,39);const sigma0l=rotrSL(Ah,Al,28)^rotrBL(Ah,Al,34)^rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=add3L(T1l,sigma0l,MAJl);Ah=add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){clean(SHA512_W_H,SHA512_W_L)}destroy(){this.destroyed=true;clean(this.buffer);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class _SHA512 extends SHA2_64B{constructor(){super(64,SHA512_IV)}}const sha256$2=createHasher(()=>new _SHA256,oidNist(1));const sha512$1=createHasher(()=>new _SHA512,oidNist(3));const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);const SHA3_PI=[];const SHA3_ROTL=[];const _SHA3_IOTA=[];for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;const rotlH=(h,l,s)=>s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);const B=new Uint32Array(5*2);function keccakP(s,rounds=24){if(!(s instanceof Uint32Array))throw new TypeError('"s" expected Uint32Array(50), got type='+typeof s);if(s.length!==50)throw new RangeError('"s" expected Uint32Array(50), got length='+s.length);anumber(rounds,"rounds");if(rounds<1||rounds>24)throw new Error('"rounds" expected integer 1..24');for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){const b0=s[y],b1=s[y+1],b2=s[y+2],b3=s[y+3];s[y]^=~s[y+2]&s[y+4];s[y+1]^=~s[y+3]&s[y+5];s[y+2]^=~s[y+4]&s[y+6];s[y+3]^=~s[y+5]&s[y+7];s[y+4]^=~s[y+6]&s[y+8];s[y+5]^=~s[y+7]&s[y+9];s[y+6]^=~s[y+8]&b0;s[y+7]^=~s[y+9]&b1;s[y+8]^=~b0&b2;s[y+9]^=~b1&b3}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}clean(B)}class Keccak{state;pos=0;posOut=0;finished=false;state32;destroyed=false;blockLen;suffix;outputLen;canXOF;enableXOF=false;rounds;constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){anumber(blockLen,"blockLen");anumber(suffix,"suffix");anumber(rounds,"rounds");abool(enableXOF,"enableXOF");this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.canXOF=enableXOF;this.rounds=rounds;anumber(outputLen,"outputLen");if(!(0=blockLen?u32(data):undefined;for(let pos=0;pos=blockLen){for(let i=0,o=pos/4;i=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not enabled");return this.writeInto(out)}xof(bytes){anumber(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){aoutput(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out.length===this.outputLen?out:out.subarray(0,this.outputLen));this.destroy()}digest(){const out=new Uint8Array(this.outputLen);this.digestInto(out);return out}destroy(){this.destroyed=true;clean(this.state)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds);to.blockLen=blockLen;to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.canXOF=this.canXOF;to.destroyed=this.destroyed;return to}}const genKeccak=(suffix,blockLen,outputLen,info={})=>createHasher(()=>new Keccak(blockLen,suffix,outputLen),info);const sha3_256=genKeccak(6,136,32,oidNist(8));const sha3_512=genKeccak(6,72,64,oidNist(10));const keccak_256=genKeccak(1,136,32);var assert_1;var hasRequiredAssert;function requireAssert(){if(hasRequiredAssert)return assert_1;hasRequiredAssert=1;function assert(val,msg){if(!val){const err=new Error(msg||"Assertion failed");if(Error.captureStackTrace)Error.captureStackTrace(err,assert);throw err}}assert_1=assert;return assert_1}var customBrowser={};var hasRequiredCustomBrowser;function requireCustomBrowser(){if(hasRequiredCustomBrowser)return customBrowser;hasRequiredCustomBrowser=1;customBrowser.custom="inspect";return customBrowser}var bn;var hasRequiredBn;function requireBn(){if(hasRequiredBn)return bn;hasRequiredBn=1;const{custom}=requireCustomBrowser();const zeros=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];const groupSizes=[0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];const groupBases=[0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];const primes={p192:null,p224:null,p521:null,k256:null,p251:null,p25519:null,p448:null};const modes={NONE:0,QUO:1,REM:2,BOTH:3,EUCLID:4,ALL:7};const WND_WIDTH=4;const WND_SIZE=1<>>26}for(;carry!==0&&i>>26}this.length=a.length;if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}else if(a!==this){for(;i=67108864;i++){this.words[i]-=67108864;this.words[i+1]+=1}this.length=Math.max(this.length,i+1);return this}iadd(num){enforce(BN.isBN(num),"num","bignum");if(this.negative===num.negative){this._iadd(this,num)}else{const cmp=this.ucmp(num);if(cmp===0){this.words[0]=0;this.length=1;this.negative=0;return this}if(cmp<0){this._isub(num,this);this.negative^=1}else{this._isub(this,num)}}return this}iaddn(num){enforce(isSMI(num),"num","smi");const negative=num<0|0;if(negative)num=-num;if(this.negative===negative){this._iaddn(num)}else{if(this.length===1&&this.words[0]this.length)return num.clone().iadd(this);return this.clone().iadd(num)}addn(num){return this.clone().iaddn(num)}_isub(a,b){let carry=0;let i=0;assert(a.length>=b.length);if(a!==this)this._alloc(a.length);for(;i>26;this.words[i]=r&67108863}for(;carry!==0&&i>26;this.words[i]=r&67108863}assert(carry===0);if(a!==this){for(;i=0)return this._normalize();assert(this.length!==1);this._alloc(this.length+1);for(let i=0;i>=26;carry+=w/67108864|0;carry+=lo>>>26;this.words[i]=lo&67108863}this.negative^=neg;if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}else{this._strip()}return this}mul(num){enforce(BN.isBN(num),"num","bignum");const len=this.length+num.length;const out=new BN;out.words=new Array(len);for(let i=0;i>>0===bits,"bits","uint32");const r=this.mul(num);const b=r.utestn(bits-1);r.iushrn(bits);if(this.negative^num.negative)return r.isubn(b);return r.iaddn(b)}_div(num,flags){enforce(BN.isBN(num),"num","bignum");assert((flags&modes.ALL)===flags);assert(flags!==modes.NONE);const a=this;const b=num;nonzero(!b.isZero());if(a.isZero())return[new BN(0),new BN(0)];const as=a.negative;const bs=b.negative;a.negative=0;b.negative=0;let q=null;let r=null;if(a.ucmp(b)<0){if(flags&modes.QUO)q=new BN(0);if(flags&modes.REM)r=a.clone()}else if(b.length===1){if(flags&modes.QUO)q=a.quon(b.words[0]);if(flags&modes.REM)r=a.remn(b.words[0])}else{[q,r]=a._wordDiv(b,flags)}a.negative=as;b.negative=bs;if(flags&modes.QUO){q.negative=a.negative^b.negative;q._normalize()}if(flags&modes.REM){r.negative=a.negative;r._normalize()}if(flags&modes.EUCLID){if(flags&modes.QUO){assert((flags&modes.REM)!==0);if(r.negative!==0){if(b.negative!==0)q.iaddn(1);else q.isubn(1)}}if(flags&modes.REM){if(r.negative!==0){if(b.negative!==0)r.isub(b);else r.iadd(b)}}}return[q,r]}_wordDiv(num,flags){let a=this.clone();let b=num;let q=null;let hi;const word=b.words[b.length-1]|0;const shift=26-countBits(word);if(shift!==0){b=b.clone();a.iushln(shift);b.iushln(shift);hi=b.words[b.length-1]|0}else{hi=word}const m=a.length-b.length;assert(m>=0);if(flags&modes.QUO){q=new BN(0);q.length=m+1;q.words=new Array(q.length);for(let i=0;i=0;j--){const ahi=a.words[b.length+j];const alo=a.words[b.length+j-1];const quo=(ahi*67108864+alo)/hi|0;let qj=Math.min(quo,67108863);a._ishlnsubmul(b,qj,j);while(a.negative!==0){qj-=1;a.negative=0;a._ishlnsubmul(b,1,j);a.ineg()}if(q)q.words[j]=qj}if(q)q._strip();if(flags&modes.REM&&shift!==0)a.iushrn(shift);return[q,a]}_ishlnsubmul(num,mul,shift){let carry=0;let i=0;this._expand(num.length+shift);for(;i>26)-(r/67108864|0);this.words[i+shift]=w&67108863}for(;i>26;this.words[i+shift]=w&67108863}if(carry===0)return this._strip();assert(carry===-1);carry=0;for(let i=0;i>26;this.words[i]=w&67108863}this.negative=1;return this._strip()}quorem(num){return this._div(num,modes.BOTH)}iquo(num){return this.quo(num)._move(this)}iquon(num){enforce(isSMI(num),"num","smi");nonzero(num!==0);const neg=num<0|0;if(neg)num=-num;let carry=0;for(let i=this.length-1;i>=0;i--){const w=(this.words[i]|0)+carry*67108864;this.words[i]=w/num|0;carry=w%num}this.negative^=neg;return this._strip()}quo(num){return this._div(num,modes.QUO)[0]}quon(num){return this.clone().iquon(num)}irem(num){return this.rem(num)._move(this)}iremn(num){let m=this.remrn(num);if(m<0)m=-m;this.words[0]=m;this.length=1;return this._normalize()}rem(num){return this._div(num,modes.REM)[1]}remn(num){return this.clone().iremn(num)}remrn(num){enforce(isSMI(num),"num","smi");nonzero(num!==0);if(num<0)num=-num;const p=(1<<26)%num;let acc=0;for(let i=this.length-1;i>=0;i--)acc=(p*acc+(this.words[i]|0))%num;return this.negative!==0?-acc|0:acc}divmod(num){return this._div(num,modes.BOTH|modes.EUCLID)}idiv(num){return this.div(num)._move(this)}idivn(num){if(this.negative===0)return this.iquon(num);const r=this.remrn(num);this.iquon(num);if(r<0){if(num<0)this.iaddn(1);else this.isubn(1)}return this}div(num){return this._div(num,modes.BOTH|modes.EUCLID)[0]}divn(num){return this.clone().idivn(num)}imod(num){if(this.ucmp(num)<0){if(this.negative!==0){this._isub(num,this);this.negative=0}return this}return this.mod(num)._move(this)}imodn(num){this.words[0]=this.modrn(num);this.length=1;this.negative=0;return this}mod(num){return this._div(num,modes.REM|modes.EUCLID)[1]}modn(num){return this.clone().imodn(num)}modrn(num){enforce(isSMI(num),"num","smi");let r=this.remrn(num);if(r<0){if(num<0)r-=num;else r+=num}return r}divRound(num){const[q,r]=this.quorem(num);if(r.isZero())return q;const bit=num.words[0]&1;num.iushrn(1);const cmp=r.ucmp(num);num.iushln(1);num.words[0]|=bit;if(cmp<0||num.isOdd()&&cmp===0)return q;if(this.negative^num.negative)return q.isubn(1);return q.iaddn(1)}ipow(num){return this.pow(num)._move(this)}ipown(num){return this.pown(num)._move(this)}pow(num){enforce(BN.isBN(num),"num","bignum");let b=countBits(num.words[num.length-1]);let r=new BN(1);for(let i=num.length-1;i>=0;i--){const word=num.words[i];for(let j=b-1;j>=0;j--){r=r.sqr();if(word>>j&1)r=r.mul(this)}b=26}return r}pown(num){enforce(isSMI(num),"num","smi");if(num<0)num=-num;if(num===0)return new BN(1);if(num===1)return this.clone();const bits=countBits(num);let r=this;for(let i=bits-2;i>=0;i--){r=r.sqr();if(num>>i&1)r=r.mul(this)}return r}isqr(){return this.imul(this)}sqr(){return this.mul(this)}_rootrem(pow,rem){enforce(pow>>>0===pow,"num","uint32");if(pow===0)throw new RangeError("Zeroth root.");if(~pow&this.negative)throw new RangeError("Negative with even root.");if(this.ucmpn(1)<=0)return[this.clone(),new BN(0)];let u=new BN(0);let t=BN.shift(1,this.bitLength()/pow+1|0);let v,r;if(this.negative!==0)t.ineg();if(pow===2){do{u=t;t=this.quo(u);t.iadd(u);t.iushrn(1)}while(t.ucmp(u)<0)}else{do{u=t;t=u.pown(pow-1);t=this.quo(t);v=u.muln(pow-1);t.iadd(v);t=t.quon(pow)}while(t.ucmp(u)<0)}if(rem){t=u.pown(pow);r=this.sub(t)}return[u,r]}rootrem(pow){return this._rootrem(pow,1)}iroot(pow){return this.root(pow)._move(this)}root(pow){return this._rootrem(pow,0)[0]}isPower(pow){enforce(pow>>>0===pow,"num","uint32");if(pow===0||~pow&this.negative)return false;const[,r]=this.rootrem(pow);return r.sign()===0}sqrtrem(){return this.rootrem(2)}isqrt(){return this.sqrt()._move(this)}sqrt(){return this.root(2)}isSquare(){return this.isPower(2)}iand(num){enforce(BN.isBN(num),"num","bignum");let x=this;let y=num;if(x===y)return x;if((x.negative|y.negative)===0)return x.iuand(y);if((x.negative&y.negative)===1){x.iaddn(1);y.iaddn(1);x.iuor(y);x.isubn(1);y.isubn(1);return x}if(x.negative!==0)[x,y]=[y.clone(),x];const width=x.bitLength();y.iaddn(1);y.inotn(width);x.iuand(y);y.inotn(width);y.isubn(1);return x._move(this)}iandn(num){enforce(isSMI(num),"num","smi");if((this.negative|num<0)!==0)return this.iand(new BN(num));this.words[0]&=num;this.length=1;return this}and(num){return this.clone().iand(num)}andn(num){return this.clone().iandn(num)}andrn(num){enforce(isSMI(num),"num","smi");if((this.negative|num<0)!==0){const n=this.iand(new BN(num));if(n.length>1)throw new RangeError("Number exceeds 26 bits.");return n.negative!==0?-n.words[0]:n.words[0]}return this.words[0]&num}iuand(num){enforce(BN.isBN(num),"num","bignum");this.length=Math.min(this.length,num.length);for(let i=0;i>>0===width,"width","uint32");const r=width%26;let s=Math.ceil(width/26);let i=0;this._expand(s);if(r>0)s-=1;for(;i0)this.words[i]^=(1<>>0===bits,"bits","uint32");const r=bits%26;const s=(bits-r)/26;const mask=(1<>>26-r}if(carry!==0){this._alloc(this.length+1);this.words[this.length++]=carry}}if(s!==0){this._alloc(this.length+s);for(let i=this.length-1;i>=0;i--)this.words[i+s]=this.words[i];for(let i=0;is){this.length-=s;for(let i=0;i=0;i--){const word=this.words[i]|0;this.words[i]=carry<<26-r|word>>>r;carry=word&mask}}if(output){if(carry!==0){output._alloc(output.length+1);output.words[output.length++]=carry}else{if(output.length===0)output.words[output.length++]=0;output._strip()}}return this._strip()}ishr(num){enforce(BN.isBN(num),"bits","bignum");enforce(num.bitLength()<=32,"bits","uint32");return this.ishrn(num.toNumber())}ishrn(bits){enforce(bits>>>0===bits,"bits","uint32");if(this.negative!==0){this.iaddn(1);this.iushrn(bits);this.isubn(1);return this}return this.iushrn(bits)}shr(num){return this.clone().ishr(num)}shrn(bits){return this.clone().ishrn(bits)}iushr(num){enforce(BN.isBN(num),"bits","bignum");enforce(num.bitLength()<=32,"bits","uint32");return this.iushrn(num.toNumber())}iushrn(bits){enforce(bits>>>0===bits,"bits","uint32");return this._split(bits,null)}ushr(num){return this.clone().iushr(num)}ushrn(bits){return this.clone().iushrn(bits)}setn(bit,val){enforce(bit>>>0===bit,"bit","uint32");if(this.negative!==0){this.iaddn(1);this.usetn(bit,!val);this.isubn(1);return this}return this.usetn(bit,val)}usetn(bit,val){enforce(bit>>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;this._expand(s+1);if(val)this.words[s]|=1<>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;if(this.length<=s)return this.negative;const w=this.words[s];const val=w>>r&1;if(this.negative!==0){if(r>0&&w&(1<0)return val^1}}return val}utestn(bit){enforce(bit>>>0===bit,"bit","uint32");const r=bit%26;const s=(bit-r)/26;if(this.length<=s)return 0;return this.words[s]>>r&1}imaskn(bits){enforce(bits>>>0===bits,"bits","uint32");if(this.negative!==0){this.iaddn(1);this.inotn(bits+1);this.ineg()}return this.iumaskn(bits)}maskn(bits){return this.clone().imaskn(bits)}iumaskn(bits){enforce(bits>>>0===bits,"bits","uint32");const r=bits%26;let s=(bits-r)/26;if(this.length<=s)return this;if(r!==0)s+=1;this.length=Math.min(s,this.length);if(r!==0)this.words[this.length-1]&=(1<>>0===pos,"pos","uint32");enforce(width>>>0===width,"width","uint32");enforce(width<=26,"width","width");const shift=pos%26;const index=(pos-shift)/26;if(index>=this.length)return 0;let bits=this.words[index]>>shift&(1<26&&index+10}gtn(num){return this.cmpn(num)>0}gte(num){return this.cmp(num)>=0}gten(num){return this.cmpn(num)>=0}lt(num){return this.cmp(num)<0}ltn(num){return this.cmpn(num)<0}lte(num){return this.cmp(num)<=0}lten(num){return this.cmpn(num)<=0}sign(){if(this.negative!==0)return-1;if(this.length===1&&this.words[0]===0)return 0;return 1}isZero(){return this.length===1&&this.words[0]===0}isNeg(){return this.negative!==0}isPos(){return this.negative===0}isOdd(){return(this.words[0]&1)===1}isEven(){return(this.words[0]&1)===0}ucmp(num){enforce(BN.isBN(num),"num","bignum");if(this.lengthnum.length)return 1;for(let i=this.length-1;i>=0;i--){const a=this.words[i]|0;const b=num.words[i]|0;if(a===b)continue;return(a>b)-(a1)return 1;const w=this.words[0]|0;if(num<0)num=-num;return(w>num)-(w=0)a.imod(b);while(!a.isZero()){const bits=a._makeOdd();if(bits&1){const bmod8=b.andln(7);if(bmod8===3||bmod8===5)j=-j}if(a.ucmp(b)<0){[a,b]=[b,a];if(a.andln(3)===3&&b.andln(3)===3)j=-j}a._isub(a,b).iushrn(1);const bmod8=b.andln(7);if(bmod8===3||bmod8===5)j=-j}if(b.cmpn(1)!==0)return 0;return j}kronecker(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero())return num.ucmpn(1)===0?1:0;if(num.isZero())return this.ucmpn(1)===0?1:0;if(((this.words[0]|num.words[0])&1)===0)return 0;const x=this;const y=num.clone();const bits=y._makeOdd();const table=[0,1,0,-1,0,-1,0,1];let k=x.jacobi(y);if(bits&1)k*=table[x.andln(7)];return k|0}igcd(num){return this.gcd(num)._move(this)}gcd(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero())return num.abs();if(num.isZero())return this.abs();let a=this.clone();let b=num.clone();a.negative=0;b.negative=0;const shift=a._factor2(b);if(shift!==0){a.iushrn(shift);b.iushrn(shift)}for(;;){a._makeOdd();b._makeOdd();const cmp=a.ucmp(b);if(cmp<0){[a,b]=[b,a]}else if(cmp===0||b.ucmpn(1)===0){break}a._isub(a,b)}return b.iushln(shift)}ilcm(num){return this.lcm(num)._move(this)}lcm(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero()||num.isZero())return new BN(0);return this.quo(this.gcd(num)).mul(num).iabs()}egcd(num){enforce(BN.isBN(num),"num","bignum");if(this.isZero()){return[new BN(0),new BN(num.sign()),num.abs()]}if(num.isZero()){return[new BN(this.sign()),new BN(0),this.abs()]}const x=this.clone();const y=num.clone();x.negative=0;y.negative=0;const A=new BN(1);const B=new BN(0);const C=new BN(0);const D=new BN(1);const g=x._factor2(y);if(g>0){x.iushrn(g);y.iushrn(g)}const xp=x.clone();const yp=y.clone();while(!x.isZero()){let i=x._makeOdd();let j=y._makeOdd();while(i--){if(A.isOdd()||B.isOdd()){A.iadd(yp);B.isub(xp)}A.iushrn(1);B.iushrn(1)}while(j--){if(C.isOdd()||D.isOdd()){C.iadd(yp);D.isub(xp)}C.iushrn(1);D.iushrn(1)}if(x.cmp(y)>=0){x.isub(y);A.isub(C);B.isub(D)}else{y.isub(x);C.isub(A);D.isub(B)}}if(this.negative!==0)C.ineg();if(num.negative!==0)D.ineg();return[C,D,y.iushln(g)]}iinvert(num){return this.invert(num)._move(this)}invert(num){enforce(BN.isBN(num),"num","bignum");range(num.sign()>0,"invert");if(num.isOdd())return this._invertp(num);if(num.cmpn(1)===0)throw new RangeError("Not invertible.");const[s,,g]=this.egcd(num);if(g.cmpn(1)!==0)throw new RangeError("Not invertible.");return s.imod(num)}ifermat(num){return this.fermat(num)._move(this)}fermat(num){const red=HAS_BIGINT?BN.red(num):BN.mont(num);return this.toRed(red).redFermat().fromRed()}ipowm(y,m,mont){return this.powm(y,m,mont)._move(this)}powm(y,m,mont){const red=!HAS_BIGINT&&mont?BN.mont(m):BN.red(m);return this.toRed(red).redPow(y).fromRed()}ipowmn(y,m,mont){return this.powmn(y,m,mont)._move(this)}powmn(y,m,mont){const red=mont?BN.mont(m):BN.red(m);return this.toRed(red).redPown(y).fromRed()}isqrtm(p){return this.sqrtm(p)._move(this)}sqrtm(p){enforce(BN.isBN(p),"p","bignum");let red;if(p.andln(3)===3||p.andln(7)===5){red=BN.red(p)}else{red=BN.mont(p)}return this.toRed(red).redSqrt().fromRed()}isqrtpq(p,q){return this.sqrtpq(p,q)._move(this)}sqrtpq(p,q){const sp=this.sqrtm(p);const sq=this.sqrtm(q);const[mp,mq]=p.egcd(q);const lhs=sq.mul(mp).mul(p);const rhs=sp.mul(mq).mul(q);const n=p.mul(q);return lhs.iadd(rhs).imod(n)}isPrime(rng,reps,limit){enforce(reps>>>0===reps,"reps","uint32");if(!this.isPrimeMR(rng,reps+1,true))return false;if(!this.isPrimeLucas(limit))return false;return true}isPrimeMR(rng,reps,force2=false){enforce(reps>>>0===reps,"reps","uint32");enforce(reps>0,"reps","integer");enforce(typeof force2==="boolean","force2","boolean");const n=this;if(n.cmpn(7)<0){return n.cmpn(2)===0||n.cmpn(3)===0||n.cmpn(5)===0}if(n.isEven())return false;const nm1=n.subn(1);const nm3=nm1.subn(2);const k=nm1.zeroBits();const q=nm1.ushrn(k);const red=BN.red(n);const rnm1=nm1.toRed(red);const rone=new BN(1).toRed(red);next:for(let i=0;i>>0===limit,"limit","uint32");const n=this;if(n.cmpn(1)<=0)return false;if(n.isEven())return n.cmpn(2)===0;let p=3;for(;;){if(p>1e4){throw new Error(`Cannot find (D/n) = -1 for ${n.toString(10)}.`)}if(limit!==0&&p>limit){return false}const d=new BN(p*p-4);const j=d.jacobi(n);if(j===-1)break;if(j===0)return n.cmpn(p+2)===0;if(p===40){if(n.isSquare())return false}p+=1}const s=n.addn(1);const r=s._makeOdd();let vk=new BN(2);let vk1=new BN(p);for(let i=s.bitLength();i>=0;i--){if(s.utestn(i)){vk=vk.mul(vk1).isubn(p).imod(n);vk1=vk1.sqr().isubn(2).imod(n)}else{vk1=vk1.mul(vk).isubn(p).imod(n);vk=vk.sqr().isubn(2).imod(n)}}if(vk.cmpn(2)===0||vk.cmp(n.subn(2))===0){const a=vk.muln(p).imod(n);const b=vk1.ushln(1).imod(n);if(a.cmp(b)===0)return true}for(let t=0;t>>0===width,"width","uint32");range(width>0,"width");if(this.testn(width-1))return this.notn(width).iaddn(1).ineg();return this.clone()}toRed(ctx){enforce(ctx instanceof Red,"ctx","reduction context");if(this.red)throw new Error("Already in reduction context.");return ctx.convertTo(this)}fromRed(){red(this.red,"fromRed");return this.red.convertFrom(this)}forceRed(ctx){enforce(ctx instanceof Red,"ctx","reduction context");if(this.red){if(!ctx.m.eq(this.red.m)||ctx.mont!==this.red.mont)throw new Error("Already in reduction context.")}else{range(this.negative===0,"red");range(this.ucmp(ctx.m)<0,"red")}return this.clone()._forceRed(ctx)}redIAdd(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIAdd");return this.red.iadd(this,num)}redAdd(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redAdd");return this.red.add(this,num)}redIAddn(num){enforce(isSMI(num),"num","smi");red(this.red,"redIAddn");return this.red.iaddn(this,num)}redAddn(num){enforce(isSMI(num),"num","smi");red(this.red,"redAddn");return this.red.addn(this,num)}redISub(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redISub");return this.red.isub(this,num)}redSub(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redSub");return this.red.sub(this,num)}redISubn(num){enforce(isSMI(num),"num","smi");red(this.red,"redISubn");return this.red.isubn(this,num)}redSubn(num){enforce(isSMI(num),"num","smi");red(this.red,"redSubn");return this.red.subn(this,num)}redIMul(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIMul");return this.red.imul(this,num)}redMul(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redMul");return this.red.mul(this,num)}redIMuln(num){enforce(isSMI(num),"num","smi");red(this.red,"redIMuln");return this.red.imuln(this,num)}redMuln(num){enforce(isSMI(num),"num","smi");red(this.red,"redMuln");return this.red.muln(this,num)}redIDiv(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIDiv");return this.red.idiv(this,num)}redDiv(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redDiv");return this.red.div(this,num)}redIDivn(num){enforce(isSMI(num),"num","smi");red(this.red,"redIDivn");return this.red.idivn(this,num)}redDivn(num){enforce(isSMI(num),"num","smi");red(this.red,"redDivn");return this.red.divn(this,num)}redIPow(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIPow");nonred(!num.red,"redIPow");return this.red.ipow(this,num)}redPow(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redPow");nonred(!num.red,"redPow");return this.red.pow(this,num)}redIPown(num){enforce(isSMI(num),"num","smi");red(this.red,"redIPown");return this.red.ipown(this,num)}redPown(num){enforce(isSMI(num),"num","smi");red(this.red,"redPown");return this.red.pown(this,num)}redISqr(){red(this.red,"redISqr");return this.red.isqr(this)}redSqr(){red(this.red,"redSqr");return this.red.sqr(this)}redISqrt(){red(this.red,"redISqrt");return this.red.isqrt(this)}redSqrt(){red(this.red,"redSqrt");return this.red.sqrt(this)}redIDivSqrt(v){red(this.red,"redIDivSqrt");return this.red.idivsqrt(this,v)}redDivSqrt(v){red(this.red,"redDivSqrt");return this.red.divsqrt(this,v)}redIsSquare(){red(this.red,"redIsSquare");return this.red.isSquare(this)}redIShl(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redIShl");nonred(!num.red,"redIShl");return this.red.ishl(this,num)}redShl(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redShl");nonred(!num.red,"redShl");return this.red.shl(this,num)}redIShln(num){enforce(num>>>0===num,"num","uint32");red(this.red,"redIShln");return this.red.ishln(this,num)}redShln(num){enforce(num>>>0===num,"num","uint32");red(this.red,"redShln");return this.red.shln(this,num)}redINeg(){red(this.red,"redINeg");return this.red.ineg(this)}redNeg(){red(this.red,"redNeg");return this.red.neg(this)}redEq(num){enforce(BN.isBN(num),"num","bignum");red(this.red,"redEq");return this.red.eq(this,num)}redEqn(num){enforce(isSMI(num),"num","smi");red(this.red,"redEqn");return this.red.eqn(this,num)}redIsHigh(){red(this.red,"redIsHigh");return this.red.isHigh(this)}redIsLow(){red(this.red,"redIsLow");return this.red.isLow(this)}redIsOdd(){red(this.red,"redIsOdd");return this.red.isOdd(this)}redIsEven(){red(this.red,"redIsEven");return this.red.isEven(this)}redLegendre(){red(this.red,"redLegendre");return this.red.legendre(this)}redJacobi(){red(this.red,"redJacobi");return this.red.jacobi(this)}redKronecker(){red(this.red,"redKronecker");return this.red.kronecker(this)}redIInvert(){red(this.red,"redIInvert");return this.red.iinvert(this)}redInvert(){red(this.red,"redInvert");return this.red.invert(this)}redIFermat(){red(this.red,"redIFermat");return this.red.ifermat(this)}redFermat(){red(this.red,"redFermat");return this.red.fermat(this)}_move(dest){dest.words=this.words;dest.length=this.length;dest.negative=this.negative;dest.red=this.red;return dest}_alloc(size){while(this.words.length1&&this.words[this.length-1]===0)this.length-=1;return this._normalize()}_normalize(){assert(this.length>0);if(this.length===1&&this.words[0]===0)this.negative=0;return this}_check(){assert(this.length>0);assert(this.length<=this.words.length);if(this.length===1){if(this.words[0]===0)assert(this.negative===0);return this}assert(this.words[this.length-1]!==0);return this}_invertp(p){enforce(BN.isBN(p),"p","bignum");range(p.sign()>0,"invert");assert(p.isOdd());if(p.cmpn(1)===0)throw new RangeError("Not invertible.");const a=this.clone();const b=p.clone();const u=new BN(1);const v=new BN(0);if(a.isNeg()||a.ucmp(b)>=0)a.imod(b);while(!a.isZero()){let i=a._makeOdd();let j=b._makeOdd();while(i--){if(u.isOdd())u._iadd(u,p);u.iushrn(1)}while(j--){if(v.isOdd())v._iadd(v,p);v.iushrn(1)}if(a.ucmp(b)>=0){a._isub(a,b);if(u.ucmp(v)<0){u._isub(v,u);u._isub(p,u)}else{u._isub(u,v)}}else{b._isub(b,a);if(v.ucmp(u)<0){v._isub(u,v);v._isub(p,v)}else{v._isub(v,u)}}}if(b.cmpn(1)!==0)throw new RangeError("Not invertible.");assert(v.negative===0);assert(v.ucmp(p)<0);return v}_makeOdd(){const shift=this.zeroBits();if(shift>0)this.iushrn(shift);return shift}_factor2(num){if((this.words[0]|num.words[0])&1)return 0;const len=Math.min(this.length,num.length);let r=0;for(let i=0;i>>0===pos,"pos","uint32");if(pos>=this.length)return 0;return this.words[pos]}[custom](){let prefix="BN";if(this.red)prefix="BN-R";return`<${prefix}: ${this.toString(10)}>`}toNumber(){let num=this.words[0];if(this.length===2){num+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){num+=4503599627370496+this.words[1]*67108864}else if(this.length>2){throw new RangeError("Number can only safely store up to 53 bits.")}return this.negative!==0?-num:num}toDouble(){let num=0;for(let i=this.length-1;i>=0;i--)num=num*67108864+this.words[i];return this.negative!==0?-num:num}valueOf(){return this.toDouble()}toBigInt(){if(!HAS_BIGINT)throw new Error("BigInt is not supported!");const s52=BigInt(52);const s26=BigInt(26);let i=this.length-1;let num=BigInt(0);for(;i>=1;i-=2){const hi=this.words[i]*67108864;const lo=this.words[i-1];num=num<=0)num=num<>>0===base,"base","uint32");enforce(padding>>>0===padding,"padding","uint32");if(base<2||base>36)throw new RangeError("Base ranges between 2 and 36.");this._check();if(base===16){let out="";let off=0;let carry=0;for(let i=0;i>>24-off&16777215;if(carry!==0||i!==this.length-1)out=zeros[6-word.length]+word+out;else out=word+out;off+=2;if(off>=26){off-=26;i-=1}}if(carry!==0)out=carry.toString(16)+out;while(out.length%padding!==0)out="0"+out;if(this.negative!==0)out="-"+out;return out}const groupSize=groupSizes[base-1];const groupBase=groupBases[base-1];const c=this.clone();let out="";c.negative=0;while(!c.isZero()){const r=c.remrn(groupBase).toString(base);c.iquon(groupBase);if(!c.isZero())out=zeros[groupSize-r.length]+r+out;else out=r+out}if(this.isZero())out="0";while(out.length%padding!==0)out="0"+out;if(this.negative!==0)out="-"+out;return out}toJSON(){return this.toString(16,2)}toArray(endian,length){return this.toArrayLike(Array,endian,length)}toBuffer(endian,length){return this.toArrayLike(bufferExports.Buffer,endian,length)}toArrayLike(ArrayType,endian,length){if(endian==null)endian="be";if(length==null)length=0;enforce(typeof ArrayType==="function","ArrayType","function");enforce(endian==="be"||endian==="le","endian","endianness");enforce(length>>>0===length,"length","uint32");this._check();const bytes=this.byteLength();const size=length||Math.max(1,bytes);if(bytes>size)throw new RangeError("Byte array longer than desired length.");const res=allocate(ArrayType,size);if(endian==="be"){let pos=res.length-1;let carry=0;for(let i=0;i=0)res[pos--]=word>>>8&255;if(pos>=0)res[pos--]=word>>>16&255;if(shift===6){if(pos>=0)res[pos--]=word>>>24&255;carry=0}else{carry=word>>>24}}if(pos>=0){res[pos--]=carry;while(pos>=0)res[pos--]=0;carry=0}assert(carry===0)}else{let pos=0;let carry=0;for(let i=0;i>>8&255;if(pos>>16&255;if(shift===6){if(pos>>24&255;carry=0}else{carry=word>>>24}}if(pos0){const lo=num%67108864;const hi=(num-lo)/67108864;this.words.push(lo);num=hi}if(this.words.length===0)this.words.push(0);this.length=this.words.length;this.negative=neg;if(endian==="le")this.reverse();return this}fromBigInt(num,endian){if(endian==null)endian="be";enforce(typeof num==="bigint","num","bigint");enforce(endian==="be"||endian==="le","endian","endianness");if(!HAS_BIGINT)throw new Error("BigInt is not supported!");const start=num>>0===base,"base","uint32");enforce(endian==="be"||endian==="le","endian","endianness");if(base<2||base>36)throw new Error("Base ranges between 2 and 36.");str=str.replace(/\s+/g,"");let start=0;if(str.length>0&&str.charCodeAt(0)===45)start=1;if(base===16)this._fromHex(str,start);else this._fromBase(str,base,start);this.negative=start;this._normalize();if(endian==="le")this.reverse();return this}_fromHex(str,start){this.length=Math.max(2,Math.ceil((str.length-start)/6));this.words=new Array(this.length);for(let i=0;i=start;i-=6){const w=parseHex(str,i,i+6);this.words[j]|=w<>>26-off&4194303;off+=24;if(off>=26){off-=26;j+=1}}if(i+6!==start){const w=parseHex(str,start,i+6);this.words[j]|=w<>>26-off&4194303}return this._strip()}_fromBase(str,base,start){this.words[0]=0;this.length=1;this.negative=0;let limbLen=0;let limbPow=1;for(;limbPow<=67108863;limbPow*=base)limbLen+=1;limbLen-=1;limbPow=limbPow/base|0;const total=str.length-start;const mod=total%limbLen;const end=Math.min(total,total-mod)+start;let i=start;for(;i>>0===data.length,"data","array-like");enforce(endian==="be"||endian==="le","endian","endianness");if(data.length===0){this.words[0]=0;this.length=1;this.negative=0;return this}this.length=Math.max(2,Math.ceil(data.length/3));this.words=new Array(this.length);this.negative=0;for(let i=0;i=2;i-=3){const w=data[i]|data[i-1]<<8|data[i-2]<<16;this.words[j]|=w<>>26-off&67108863;off+=24;if(off>=26){off-=26;j+=1}}switch(left){case 2:w=data[1]|data[0]<<8;break;case 1:w=data[0];break}}else{const len=data.length-left;for(let i=0;i>>26-off&67108863;off+=24;if(off>=26){off-=26;j+=1}}switch(left){case 2:w=data[len]|data[len+1]<<8;break;case 1:w=data[len];break}}if(left>0){this.words[j]|=w<>>26-off&67108863}return this._strip()}decode(data,endian){return this.fromBuffer(data,endian)}from(num,base,endian){if(num==null)return this;if(base==="le"||base==="be")[base,endian]=[endian,base];if(typeof num==="number")return this.fromNumber(num,endian);if(typeof num==="bigint")return this.fromBigInt(num,endian);if(typeof num==="string")return this.fromString(num,base,endian);if(typeof num==="object"){if(BN.isBN(num))return this.fromBN(num,endian);if(num.length>>>0===num.length)return this.fromArrayLike(num,endian)}if(typeof num==="boolean")return this.fromBool(num);throw new TypeError("Non-numeric object passed to BN.")}static min(...args){let min=null;for(const num of args){enforce(BN.isBN(num),"num","bignum");if(!min||num.cmp(min)<0)min=num}return min||new BN(0)}static max(...args){let max=null;for(const num of args){enforce(BN.isBN(num),"num","bignum");if(!max||num.cmp(max)>0)max=num}return max||new BN(0)}static cmp(a,b){enforce(BN.isBN(a),"a","bignum");return a.cmp(b)}static ucmp(a,b){enforce(BN.isBN(a),"a","bignum");return a.ucmp(b)}static red(num){return new Red(num)}static barrett(num){return new Barrett(num)}static mont(num){return new Mont(num)}static _prime(name){if(primes[name])return primes[name];let prime;if(name==="p192")prime=new P192;else if(name==="p224")prime=new P224;else if(name==="p521")prime=new P521;else if(name==="k256")prime=new K256;else if(name==="p251")prime=new P251;else if(name==="p25519")prime=new P25519;else if(name==="p448")prime=new P448;else throw new Error(`Unknown prime: "${name}".`);primes[name]=prime;return prime}static prime(name){return BN._prime(name).p.clone()}static pow(num,exp){if(num===2)return BN.shift(1,exp);return(new BN).fromNumber(num).pown(exp)}static shift(num,bits){if(num===1)return new BN(0).usetn(bits,1);return(new BN).fromNumber(num).ishln(bits)}static mask(bits){return BN.shift(1,bits).isubn(1)}static randomBits(rng,bits){enforce(rng!=null,"rng","rng");enforce(bits>>>0===bits,"bits","uint32");if(typeof rng==="object"){enforce(typeof rng.randomBytes==="function","rng","rng");const size=bits+7>>>3;const total=size*8;const bytes=rng.randomBytes(size);enforce(bufferExports.Buffer.isBuffer(bytes),"bytes","buffer");if(bytes.length!==size)throw new RangeError("Invalid number of bytes returned from RNG.");const num=BN.fromBuffer(bytes);if(total>bits)num.iushrn(total-bits);return num}enforce(typeof rng==="function","rng","rng");const num=rng(bits);enforce(BN.isBN(num),"num","bignum");range(num.negative===0,"RNG");nonred(!num.red,"RNG");if(num.bitLength()>bits)throw new RangeError("Invalid number of bits returned from RNG.");return num}static random(rng,min,max){min=BN.cast(min,16);max=BN.cast(max,16);if(min.cmp(max)>0)throw new RangeError("Minimum cannot be greater than maximum.");const space=max.sub(min).iabs();const bits=space.bitLength();if(bits===0)return min.clone();for(;;){const num=BN.randomBits(rng,bits);if(num.cmp(space)>=0)continue;num.iadd(min);return num}}static of(num,endian){return(new BN).of(num,endian)}static fromNumber(num,endian){return(new BN).fromNumber(num,endian)}static fromDouble(num,endian){return(new BN).fromDouble(num,endian)}static fromBigInt(num,endian){return(new BN).fromBigInt(num,endian)}static fromBool(value){return(new BN).fromBool(value)}static fromString(str,base,endian){return(new BN).fromString(str,base,endian)}static fromJSON(json){return(new BN).fromJSON(json)}static fromBN(num){return(new BN).fromBN(num)}static fromArray(data,endian){return(new BN).fromArray(data,endian)}static fromBuffer(data,endian){return(new BN).fromBuffer(data,endian)}static fromArrayLike(data,endian){return(new BN).fromArrayLike(data,endian)}static decode(data,endian){return(new BN).decode(data,endian)}static from(num,base,endian){return(new BN).from(num,base,endian)}static cast(num,base,endian){if(BN.isBN(num))return num;return new BN(num,base,endian)}static isBN(obj){return obj instanceof BN}}BN.BN=BN;BN.wordSize=26;BN.native=0;class Prime{constructor(name,p){this.name=name;this.p=new BN(p,16);this.n=this.p.bitLength();this.k=BN.shift(1,this.n).isub(this.p);this.lo=this.p.clone();this.one=this.p.clone()}ireduce(num){const neg=num.negative!==0;let bits=num.bitLength();assert(bits<=this.n*2);num.negative=0;while(bits>this.n){this.split(num,this.lo);this.imulK(num);num._iadd(num,this.lo);bits=num.bitLength()}const cmp=bits0){num._isub(num,this.p)}else;if(neg&&!num.isZero())num._isub(this.p,num);return num}split(input,out){input._split(this.n,out)}imulK(num){return num.imul(this.k)}pm2(x1){throw new Error("Not implemented.")}fermat(x){return this.pm2(x)}}class Prime34 extends Prime{constructor(name,p){super(name,p)}pm3d4(x1){throw new Error("Not implemented.")}pp1d4(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;const r=this.pp1d4(x);if(!red.sqr(r).eq(x))throw new SquareRootError(r);return r}divsqrt(u,v){const{red}=u;const u2=red.sqr(u);const u3=red.mul(u2,u);const u5=red.mul(u3,u2);const v3=red.mul(red.sqr(v),v);const p=this.pm3d4(red.mul(u5,v3));const x=red.mul(red.mul(u3,v),p);const c=red.mul(v,red.sqr(x));if(c.eq(u))return x;throw new SquareRootError(x)}}class Prime58 extends Prime{constructor(name,p,sm1){super(name,p);this.sm1=new BN(sm1,16)}pm5d8(x1){throw new Error("Not implemented.")}pp3d8(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;const sm1=this.sm1._forceRed(red);const r=this.pp3d8(x);if(red.sqr(r).eq(x))return r;const c=red.mul(r,sm1);if(red.sqr(c).eq(x))return c;throw new SquareRootError(r)}divsqrt(u,v){const{red}=u;const sm1=this.sm1._forceRed(red);const v3=red.mul(red.sqr(v),v);const v7=red.mul(red.sqr(v3),v);const p=this.pm5d8(red.mul(u,v7));const x=red.mul(red.mul(u,v3),p);const c=red.mul(v,red.sqr(x));if(c.eq(u))return x;const mc=red.ineg(c);if(mc.eq(u))return red.mul(x,sm1);if(mc.eq(red.mul(u,sm1)))throw new SquareRootError(red.mul(x,sm1));throw new SquareRootError(x)}}class Prime116 extends Prime{constructor(name,p,g){super(name,p);this.g=new BN(g,16);this.z=this.p.subn(1).zeroBits()}powS(x1){throw new Error("Not implemented.")}powE(x1){throw new Error("Not implemented.")}sqrt(x){const{red}=x;switch(red.jacobi(x)){case-1:throw new SquareRootError(x);case 0:return x.clone()}let g=this.g._forceRed(red);let y=this.powE(x);let b=this.powS(x);let k=this.z;for(;;){let t=b;let m=0;while(t.cmpn(1)!==0&&m>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10)input.length-=10;else input.length-=9;input._strip()}imulK(num){num._expand(num.length+2);let lo=0;for(let i=0;i>>26;num.words[i]=w&67108863}if(carry!==0){num._alloc(num.length+1);num.words[num.length++]=carry}return num}core(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const x3=red.sqrnmul(x2,1,x1);const x6=red.sqrnmul(x3,3,x3);const x12=red.sqrnmul(x6,6,x6);const x24=red.sqrnmul(x12,12,x12);const x48=red.sqrnmul(x24,24,x24);const x96=red.sqrnmul(x48,48,x48);const x192=red.sqrnmul(x96,96,x96);const x240=red.sqrnmul(x192,48,x48);const x246=red.sqrnmul(x240,6,x6);const x247=red.sqrnmul(x246,1,x1);return x247}pm3d4(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pm2(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);const r3=red.sqrn(r2,1);const r4=red.sqrnmul(r3,1,x1);return r4}pp1d4(x1){const{red}=x1;const r0=this.core(x1);const r1=red.sqrnmul(r0,1,x1);const r2=red.sqrn(r1,1);return r2}}class P25519 extends Prime58{constructor(){super("p25519","7fffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff ffffffff ffffffed","2b832480 4fc1df0b 2b4d0099 3dfbd7a7"+"2f431806 ad2fe478 c4ee1b27 4a0ea0b0")}imulK(num){let carry=0;for(let i=0;i>>26;num.words[i]=w&67108863}if(carry!==0){num._alloc(num.length+1);num.words[num.length++]=carry}return num}core(x1,x2){const{red}=x1;const x4=red.sqrnmul(x2,2,x2);const x5=red.sqrnmul(x4,1,x1);const x10=red.sqrnmul(x5,5,x5);const x20=red.sqrnmul(x10,10,x10);const x40=red.sqrnmul(x20,20,x20);const x50=red.sqrnmul(x40,10,x10);const x100=red.sqrnmul(x50,50,x50);const x200=red.sqrnmul(x100,100,x100);const x250=red.sqrnmul(x200,50,x50);return x250}pm5d8(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pm2(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);const r3=red.sqrn(r2,1);const r4=red.sqrnmul(r3,2,x2);return r4}pp3d8(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrnmul(r0,1,x1);const r2=red.sqrn(r1,1);return r2}}class P448 extends Prime34{constructor(){super("p448","ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff fffffffe ffffffff"+"ffffffff ffffffff ffffffff ffffffff"+"ffffffff ffffffff")}imulK(num){const one=this.one.inject(num);return num.iushln(224)._iadd(num,one)}core(x1,x2){const{red}=x1;const x3=red.sqrnmul(x2,1,x1);const x6=red.sqrnmul(x3,3,x3);const x9=red.sqrnmul(x6,3,x3);const x11=red.sqrnmul(x9,2,x2);const x22=red.sqrnmul(x11,11,x11);const x44=red.sqrnmul(x22,22,x22);const x88=red.sqrnmul(x44,44,x44);const x176=red.sqrnmul(x88,88,x88);const x220=red.sqrnmul(x176,44,x44);const x222=red.sqrnmul(x220,2,x2);return x222}pm3d4(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const x222=this.core(x1,x2);const r0=red.sqrnmul(x222,1,x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,222,x222);return r2}pm2(x1){const{red}=x1;const r0=this.pm3d4(x1);const r1=red.sqrn(r0,1);const r2=red.sqrnmul(r1,1,x1);return r2}pp1d4(x1){const{red}=x1;const x2=red.sqrnmul(x1,1,x1);const r0=this.core(x1,x2);const r1=red.sqrnmul(r0,2,x2);const r2=red.sqrn(r1,222);return r2}}class Red{constructor(m){let prime=null;if(typeof m==="string"){prime=BN._prime(m);m=prime.p}enforce(BN.isBN(m),"m","bignum");nonred(!m.red,"reduction");range(m.sign()>0,"reduction");this.m=m;this.prime=prime;this.mb=null;this.sm1=null}_verify1(a){range(a.negative===0,"red");red(a.red!=null,"red")}_verify2(a,b){range((a.negative|b.negative)===0,"red");red(a.red!=null&&a.red===b.red,"red")}get mont(){return false}precompute(){if(this.sm1===null&&this.m.andln(7)===5){if(this.prime){this.sm1=this.prime.sm1.clone()._forceRed(this)}else{const x=new BN(2).toRed(this);const e=this.m.subn(1).iushrn(2);this.sm1=this.pow(x,e)}}return this}convertTo(num){const res=num.mod(this.m);res.red=this;return res}convertFrom(num){const res=num.clone();res.red=null;return res}intTo(a){return a}intFrom(a){return a}imod(a){if(this.prime)return this.prime.ireduce(a)._forceRed(this);return a.imod(this.m)._forceRed(this)}iadd(a,b){this._verify2(a,b);a._iadd(a,b);if(a.ucmp(this.m)>=0)a._isub(a,this.m);return a}add(a,b){if(a.length=0)a._isub(a,this.m);return a}addn(a,num){return this.iaddn(a.clone(),num)}isub(a,b){this._verify2(a,b);const cmp=a.ucmp(b);if(cmp===0){a.words[0]=0;a.length=1;return a}if(cmp<0){a._isub(b,a);a._isub(this.m,a)}else{a._isub(a,b)}return a}sub(a,b){return this.isub(a.clone(),b)}isubn(a,num){this._verify1(a);if(num<0)return this.iaddn(a,-num);if(this.m.length===1)num%=this.m.words[0];if(a.length===1&&a.words[0]=0)a._isub(a,this.m)}else{this.imod(a)}if(neg)this.ineg(a);return a}muln(a,num){return this.imuln(a.clone(),num)}idiv(a,b){return this.div(a,b)._move(a)}div(a,b){return this.mul(a,this.invert(b))}idivn(a,num){return this.divn(a,num)._move(a)}divn(a,num){return this.div(a,this.convertTo(new BN(num)))}ipow(a,num){return this.pow(a,num)._move(a)}pow(a,num){this._verify1(a);if(num.isNeg())a=this.invert(a);if(num.length===1)return this.pown(a,num.words[0]);if(HAS_BIGINT&&!this.prime)return this.powInt(a,num);return this.powNum(a,num)}powNum(a,num){const one=new BN(1).toRed(this);const wnd=new Array(WND_SIZE);const a2=this.sqr(a);wnd[0]=a;for(let i=1;i=WND_WIDTH){let width=WND_WIDTH;let bits=num.bits(i-width,width);if(bits>=1}if(r===one){r=wnd[bits>>1].clone()}else{r=this.sqrn(r,width);r=this.mul(r,wnd[bits>>1])}i-=width}if(i>0){const bits=num.bits(0,i);while(i--){r=this.sqr(r);if(bits>>i&1)r=this.mul(r,a)}}return r}powInt(a,num){if(this.mb===null)this.mb=this.m.toBigInt();const x=this.intFrom(a.toBigInt());const y=powInt(x,num,this.mb);const z=this.intTo(y);return BN.fromBigInt(z)._forceRed(this)}sqrn(a,n){while(n--)a=this.sqr(a);return a}sqrnmul(a,n,b){return this.mul(this.sqrn(a,n),b)}ipown(a,num){return this.pown(a,num)._move(a)}pown(a,num){this._verify1(a);if(num<0){a=this.invert(a);num=-num}if(num===0)return new BN(1).toRed(this);if(num===1)return a.clone();const bits=countBits(num);let r=a;for(let i=bits-2;i>=0;i--){r=this.sqr(r);if(num>>i&1)r=this.mul(r,a)}return r}isqr(a){return this.imul(a,a)}sqr(a){return this.mul(a,a)}isqrt(x){return this.sqrt(x)._move(x)}sqrt(x){this._verify1(x);if(this.prime)return this.prime.sqrt(x);if(this.m.andln(3)===3)return this.sqrt3mod4(x);if(this.m.andln(7)===5){if(this.sm1!=null)return this.sqrt5mod8sm1(x);return this.sqrt5mod8(x)}return this.sqrt0(x)}sqrt3mod4(x){const e=this.m.addn(1).iushrn(2);const b=this.pow(x,e);if(!this.sqr(b).eq(x))throw new SquareRootError(b);return b}sqrt5mod8(x){const one=new BN(1).toRed(this);const e=this.m.ushrn(3);const x2=this.add(x,x);const alpha=this.pow(x2,e);const beta=this.mul(x2,this.sqr(alpha));const b=this.mul(this.mul(alpha,x),this.isub(beta,one));if(!this.sqr(b).eq(x))throw new SquareRootError(b);return b}sqrt5mod8sm1(x){const e=this.m.addn(3).iushrn(3);const b=this.pow(x,e);if(this.sqr(b).eq(x))return b;const c=this.mul(b,this.sm1);if(this.sqr(c).eq(x))return c;throw new SquareRootError(b)}sqrt0(x){if(this.m.cmpn(1)===0||!this.m.isOdd())throw new Error("Invalid prime.");switch(this.jacobi(x)){case-1:throw new SquareRootError(x);case 0:return x.clone()}const one=new BN(1).toRed(this);const s=this.m.subn(1);const e=s._makeOdd();const n=new BN(2).toRed(this);while(this.jacobi(n)!==-1)this.iadd(n,one);let g=this.pow(n,s);let b=this.pow(x,s);let y=this.pow(x,s.iaddn(1).iushrn(1));let k=e;for(;;){let t=b;let m=0;while(!t.eq(one)&&m=0;return this.kronecker(a)>=0}ishl(a,num){this._verify1(a);return this.imod(a.iushl(num))}shl(a,num){return this.ishl(a.clone(),num)}ishln(a,num){this._verify1(a);a.iushln(num);if(num<=4){while(a.ucmp(this.m)>=0)a._isub(a,this.m)}else{this.imod(a)}return a}shln(a,num){return this.ishln(a.clone(),num)}ineg(a){this._verify1(a);if(!a.isZero())a._isub(this.m,a);return a}neg(a){return this.ineg(a.clone())}eq(a,b){this._verify2(a,b);return a.ucmp(b)===0}eqn(a,num){this._verify1(a);if(this.m.length===1){num%=this.m.words[0];if(num<0)num+=this.m.words[0];return a.ucmpn(num)===0}if(num<0){this.m._isubn(-num);const cmp=a.ucmp(this.m);this.m._iaddn(-num);return cmp===0}return a.ucmpn(num)===0}isHigh(a){return!this.isLow(a)}isLow(a){this._verify1(a);return a.ucmp(this.m.ushrn(1))<=0}isOdd(a){this._verify1(a);return a.isOdd()}isEven(a){this._verify1(a);return a.isEven()}legendre(num){this._verify1(num);if(this.m.isEven())throw new Error("legendre: `num` must be odd.");const e=this.m.subn(1).iushrn(1);const symbol=this.pow(num,e);if(symbol.isZero())return 0;const one=new BN(1).toRed(this);if(symbol.eq(one))return 1;if(symbol.eq(this.ineg(one)))return-1;throw new Error("Invalid prime.")}jacobi(a){this._verify1(a);return a.jacobi(this.m)}kronecker(a){this._verify1(a);return a.kronecker(this.m)}iinvert(a){return this.invert(a)._move(a)}invert(a){this._verify1(a);return a.invert(this.m)._forceRed(this)}ifermat(a){return this.fermat(a)._move(a)}fermat(a){this._verify1(a);if(a.isZero()||this.m.cmpn(1)===0)throw new RangeError("Not invertible.");if(this.prime)return this.prime.fermat(a);return this.pow(a,this.m.subn(2))}invertAll(elems){enforce(Array.isArray(elems),"elems","array");for(const elem of elems){enforce(BN.isBN(elem),"elem","bignum");this._verify1(elem)}if(this.m.cmpn(1)===0||this.m.isEven())throw new RangeError("Not invertible.");const len=elems.length;const invs=new Array(len);if(len===0)return invs;let acc=new BN(1).toRed(this);for(let i=0;i=0;i--){if(elems[i].isZero())continue;invs[i]=this.mul(acc,invs[i]);acc=this.mul(acc,elems[i])}return invs}[custom](){if(this.prime)return``;return``}}class Barrett extends Red{constructor(m){super(m);this.prime=null;this.n=this.m.bitLength();if(this.n%26!==0)this.n+=26-this.n%26;this.k=this.n*2;this.w=this.k/26;this.b=BN.shift(1,this.k).div(this.m)}convertTo(num){if(num.length>this.w)return super.convertTo(num);return this.imod(num.clone())}_shift(q){let i=0;let j=this.w;while(j=0)a._isub(a,this.m);if(neg&&!a.isZero())a._isub(this.m,a);a.red=this;return a}}class Mont extends Red{constructor(m){super(m);this.prime=null;this.n=this.m.length*26;this.r=BN.shift(1,this.n);this.r2=BN.shift(1,this.n*2).imod(this.m);this.ri=this.r.invert(this.m);this.mi=this.r.mul(this.ri).isubn(1).div(this.m);this.rib=null}get mont(){return true}convertTo(num){if(num.isNeg()||num.ucmp(this.m)>=0)return this.imod(num.ushln(this.n));return this.mul(num,this.r2)}convertFrom(num){const r=this.mul(num,new BN(1));r.red=null;return r}intTo(a){return(a<=0)u._isub(u,this.m);return u._forceRed(this)}imuln(a,num){this._verify1(a);if(a.isZero())return a;if(num===0){a.words[0]=0;a.length=1;return a}const neg=num<0;if(neg)num=-num;if(this.m.length===1)num%=this.m.words[0];const bits=countBits(num);if(bits>5){this.imul(a,this.convertTo(new BN(num)))}else if((num&num-1)===0){for(let i=0;i=0;i--){this.iadd(a,a);if(num>>i&1)this.iadd(a,c)}}if(neg)this.ineg(a);return a}eqn(a,num){this._verify1(a);if(num===0)return a.isZero();return a.ucmp(this.convertTo(new BN(num)))===0}isLow(a){this._verify1(a);return this.convertFrom(a).ucmp(this.m.ushrn(1))<=0}isOdd(a){this._verify1(a);return this.convertFrom(a).isOdd()}isEven(a){this._verify1(a);return this.convertFrom(a).isEven()}invert(a){this._verify1(a);return this.imod(a.invert(this.m).mul(this.r2))}}function makeError(Error,msg,start){const err=new Error(msg);if(Error.captureStackTrace)Error.captureStackTrace(err,start);return err}function assert(value,message){if(!value){const msg=message||"Assertion failed.";throw makeError(Error,msg,assert)}}function enforce(value,name,type){if(!value){const msg=`"${name}" must be a(n) ${type}.`;throw makeError(TypeError,msg,enforce)}}function range(value,name){if(!value){const msg=`"${name}" only works with positive numbers.`;throw makeError(RangeError,msg,range)}}function red(value,name){if(!value){const msg=`"${name}" only works with red numbers.`;throw makeError(TypeError,msg,red)}}function nonred(value,name){if(!value){const msg=`"${name}" only works with normal numbers.`;throw makeError(TypeError,msg,nonred)}}function nonzero(value){if(!value){const msg="Cannot divide by zero.";throw makeError(RangeError,msg,nonzero)}}class SquareRootError extends Error{constructor(result){super();this.name="SquareRootError";this.message="X is not a square mod P.";this.result=result.fromRed();if(Error.captureStackTrace)Error.captureStackTrace(this,SquareRootError)}}function isInteger(num){return Number.isSafeInteger(num)}function isSMI(num){return isInteger(num)&&num>=-67108863&&num<=67108863}function allocate(ArrayType,size){if(ArrayType.allocUnsafeSlow)return ArrayType.allocUnsafeSlow(size);return new ArrayType(size)}function getBase(base){if(base==null)return 10;if(typeof base==="number")return base;switch(base){case"bin":return 2;case"oct":return 8;case"dec":return 10;case"hex":return 16}return 0}function countBits(w){if(Math.clz32)return 32-Math.clz32(w);let t=w;let r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}function zeroBits(w){if(w===0)return 26;let t=w;let r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0)r+=1;return r}function parseHex(str,start,end){const len=Math.min(str.length,end);let r=0;let z=0;for(let i=start;i=49&&c<=54){b=c-49+10}else if(c>=17&&c<=22){b=c-17+10}else{b=c}r|=b;z|=b}if(z&-16)throw new Error("Invalid string.");return r}function parseBase(str,start,end,mul){const len=Math.min(str.length,end);let r=0;for(let i=start;i=49){b=c-49+10}else if(c>=17){b=c-17+10}else{b=c}if(c<0||c>207||b>=mul)throw new Error("Invalid string.");r+=b}return r}function powInt(x,e,m){const one=BigInt(1);const wnd=new Array(WND_SIZE);const x2=x*x%m;wnd[0]=x;for(let i=1;i=WND_WIDTH){let width=WND_WIDTH;let bits=e.bits(i-width,width);if(bits>=1}if(r===one){r=wnd[bits>>1]}else{r=sqrn(r,width,m);r=r*wnd[bits>>1]%m}i-=width}if(i>0){const bits=e.bits(0,i);while(i--){r=r*r%m;if(bits>>i&1)r=r*x%m}}return r}function sqrn(x,n,m){for(let i=0;i>>26;let rword=carry&67108863;const min=Math.max(0,k-self.length+1);const max=Math.min(k,num.length-1);for(let j=min;j<=max;j++){const i=k-j;const a=self.words[i];const b=num.words[j];const r=a*b+rword;ncarry+=r/67108864|0;rword=r&67108863}out.words[k]=rword|0;carry=ncarry|0}if(carry!==0)out.words[k]=carry|0;else out.length-=1;return out._strip()}function bigMulTo(self,num,out){const len=self.length+num.length;out.negative=self.negative^num.negative;out._alloc(len);out.length=len;let carry=0;let hncarry=0;let k=0;for(;k>>26)|0;hncarry+=ncarry>>>26;ncarry&=67108863}out.words[k]=rword;carry=ncarry;ncarry=hncarry}if(carry!==0)out.words[k]=carry;else out.length-=1;return out._strip()}function jumboMulTo(x,y,out){if(!HAS_BIGINT||x.length+y.length>82595519)return bigMulTo(x,y,out);const zero=BigInt(0);const mask=BigInt(67108863);const shift=BigInt(26);let z=x.toBigInt()*y.toBigInt();const neg=zzero){out.words[i++]=Number(z&mask);z>>=shift}if(i===0)out.words[i++]=0;out.length=i;out.negative=neg;return out}function comb10MulTo(self,num,out){const a=self.words;const b=num.words;const o=out.words;const a0=a[0]|0;const al0=a0&8191;const ah0=a0>>>13;const a1=a[1]|0;const al1=a1&8191;const ah1=a1>>>13;const a2=a[2]|0;const al2=a2&8191;const ah2=a2>>>13;const a3=a[3]|0;const al3=a3&8191;const ah3=a3>>>13;const a4=a[4]|0;const al4=a4&8191;const ah4=a4>>>13;const a5=a[5]|0;const al5=a5&8191;const ah5=a5>>>13;const a6=a[6]|0;const al6=a6&8191;const ah6=a6>>>13;const a7=a[7]|0;const al7=a7&8191;const ah7=a7>>>13;const a8=a[8]|0;const al8=a8&8191;const ah8=a8>>>13;const a9=a[9]|0;const al9=a9&8191;const ah9=a9>>>13;const b0=b[0]|0;const bl0=b0&8191;const bh0=b0>>>13;const b1=b[1]|0;const bl1=b1&8191;const bh1=b1>>>13;const b2=b[2]|0;const bl2=b2&8191;const bh2=b2>>>13;const b3=b[3]|0;const bl3=b3&8191;const bh3=b3>>>13;const b4=b[4]|0;const bl4=b4&8191;const bh4=b4>>>13;const b5=b[5]|0;const bl5=b5&8191;const bh5=b5>>>13;const b6=b[6]|0;const bl6=b6&8191;const bh6=b6>>>13;const b7=b[7]|0;const bl7=b7&8191;const bh7=b7>>>13;const b8=b[8]|0;const bl8=b8&8191;const bh8=b8>>>13;const b9=b[9]|0;const bl9=b9&8191;const bh9=b9>>>13;let c=0;let lo,mid,hi;out.negative=self.negative^num.negative;out._alloc(20);out.length=19;lo=Math.imul(al0,bl0);mid=Math.imul(al0,bh0);mid=mid+Math.imul(ah0,bl0)|0;hi=Math.imul(ah0,bh0);let w0=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w0>>>26)|0;w0&=67108863;lo=Math.imul(al1,bl0);mid=Math.imul(al1,bh0);mid=mid+Math.imul(ah1,bl0)|0;hi=Math.imul(ah1,bh0);lo=lo+Math.imul(al0,bl1)|0;mid=mid+Math.imul(al0,bh1)|0;mid=mid+Math.imul(ah0,bl1)|0;hi=hi+Math.imul(ah0,bh1)|0;let w1=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w1>>>26)|0;w1&=67108863;lo=Math.imul(al2,bl0);mid=Math.imul(al2,bh0);mid=mid+Math.imul(ah2,bl0)|0;hi=Math.imul(ah2,bh0);lo=lo+Math.imul(al1,bl1)|0;mid=mid+Math.imul(al1,bh1)|0;mid=mid+Math.imul(ah1,bl1)|0;hi=hi+Math.imul(ah1,bh1)|0;lo=lo+Math.imul(al0,bl2)|0;mid=mid+Math.imul(al0,bh2)|0;mid=mid+Math.imul(ah0,bl2)|0;hi=hi+Math.imul(ah0,bh2)|0;let w2=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w2>>>26)|0;w2&=67108863;lo=Math.imul(al3,bl0);mid=Math.imul(al3,bh0);mid=mid+Math.imul(ah3,bl0)|0;hi=Math.imul(ah3,bh0);lo=lo+Math.imul(al2,bl1)|0;mid=mid+Math.imul(al2,bh1)|0;mid=mid+Math.imul(ah2,bl1)|0;hi=hi+Math.imul(ah2,bh1)|0;lo=lo+Math.imul(al1,bl2)|0;mid=mid+Math.imul(al1,bh2)|0;mid=mid+Math.imul(ah1,bl2)|0;hi=hi+Math.imul(ah1,bh2)|0;lo=lo+Math.imul(al0,bl3)|0;mid=mid+Math.imul(al0,bh3)|0;mid=mid+Math.imul(ah0,bl3)|0;hi=hi+Math.imul(ah0,bh3)|0;let w3=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w3>>>26)|0;w3&=67108863;lo=Math.imul(al4,bl0);mid=Math.imul(al4,bh0);mid=mid+Math.imul(ah4,bl0)|0;hi=Math.imul(ah4,bh0);lo=lo+Math.imul(al3,bl1)|0;mid=mid+Math.imul(al3,bh1)|0;mid=mid+Math.imul(ah3,bl1)|0;hi=hi+Math.imul(ah3,bh1)|0;lo=lo+Math.imul(al2,bl2)|0;mid=mid+Math.imul(al2,bh2)|0;mid=mid+Math.imul(ah2,bl2)|0;hi=hi+Math.imul(ah2,bh2)|0;lo=lo+Math.imul(al1,bl3)|0;mid=mid+Math.imul(al1,bh3)|0;mid=mid+Math.imul(ah1,bl3)|0;hi=hi+Math.imul(ah1,bh3)|0;lo=lo+Math.imul(al0,bl4)|0;mid=mid+Math.imul(al0,bh4)|0;mid=mid+Math.imul(ah0,bl4)|0;hi=hi+Math.imul(ah0,bh4)|0;let w4=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w4>>>26)|0;w4&=67108863;lo=Math.imul(al5,bl0);mid=Math.imul(al5,bh0);mid=mid+Math.imul(ah5,bl0)|0;hi=Math.imul(ah5,bh0);lo=lo+Math.imul(al4,bl1)|0;mid=mid+Math.imul(al4,bh1)|0;mid=mid+Math.imul(ah4,bl1)|0;hi=hi+Math.imul(ah4,bh1)|0;lo=lo+Math.imul(al3,bl2)|0;mid=mid+Math.imul(al3,bh2)|0;mid=mid+Math.imul(ah3,bl2)|0;hi=hi+Math.imul(ah3,bh2)|0;lo=lo+Math.imul(al2,bl3)|0;mid=mid+Math.imul(al2,bh3)|0;mid=mid+Math.imul(ah2,bl3)|0;hi=hi+Math.imul(ah2,bh3)|0;lo=lo+Math.imul(al1,bl4)|0;mid=mid+Math.imul(al1,bh4)|0;mid=mid+Math.imul(ah1,bl4)|0;hi=hi+Math.imul(ah1,bh4)|0;lo=lo+Math.imul(al0,bl5)|0;mid=mid+Math.imul(al0,bh5)|0;mid=mid+Math.imul(ah0,bl5)|0;hi=hi+Math.imul(ah0,bh5)|0;let w5=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w5>>>26)|0;w5&=67108863;lo=Math.imul(al6,bl0);mid=Math.imul(al6,bh0);mid=mid+Math.imul(ah6,bl0)|0;hi=Math.imul(ah6,bh0);lo=lo+Math.imul(al5,bl1)|0;mid=mid+Math.imul(al5,bh1)|0;mid=mid+Math.imul(ah5,bl1)|0;hi=hi+Math.imul(ah5,bh1)|0;lo=lo+Math.imul(al4,bl2)|0;mid=mid+Math.imul(al4,bh2)|0;mid=mid+Math.imul(ah4,bl2)|0;hi=hi+Math.imul(ah4,bh2)|0;lo=lo+Math.imul(al3,bl3)|0;mid=mid+Math.imul(al3,bh3)|0;mid=mid+Math.imul(ah3,bl3)|0;hi=hi+Math.imul(ah3,bh3)|0;lo=lo+Math.imul(al2,bl4)|0;mid=mid+Math.imul(al2,bh4)|0;mid=mid+Math.imul(ah2,bl4)|0;hi=hi+Math.imul(ah2,bh4)|0;lo=lo+Math.imul(al1,bl5)|0;mid=mid+Math.imul(al1,bh5)|0;mid=mid+Math.imul(ah1,bl5)|0;hi=hi+Math.imul(ah1,bh5)|0;lo=lo+Math.imul(al0,bl6)|0;mid=mid+Math.imul(al0,bh6)|0;mid=mid+Math.imul(ah0,bl6)|0;hi=hi+Math.imul(ah0,bh6)|0;let w6=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w6>>>26)|0;w6&=67108863;lo=Math.imul(al7,bl0);mid=Math.imul(al7,bh0);mid=mid+Math.imul(ah7,bl0)|0;hi=Math.imul(ah7,bh0);lo=lo+Math.imul(al6,bl1)|0;mid=mid+Math.imul(al6,bh1)|0;mid=mid+Math.imul(ah6,bl1)|0;hi=hi+Math.imul(ah6,bh1)|0;lo=lo+Math.imul(al5,bl2)|0;mid=mid+Math.imul(al5,bh2)|0;mid=mid+Math.imul(ah5,bl2)|0;hi=hi+Math.imul(ah5,bh2)|0;lo=lo+Math.imul(al4,bl3)|0;mid=mid+Math.imul(al4,bh3)|0;mid=mid+Math.imul(ah4,bl3)|0;hi=hi+Math.imul(ah4,bh3)|0;lo=lo+Math.imul(al3,bl4)|0;mid=mid+Math.imul(al3,bh4)|0;mid=mid+Math.imul(ah3,bl4)|0;hi=hi+Math.imul(ah3,bh4)|0;lo=lo+Math.imul(al2,bl5)|0;mid=mid+Math.imul(al2,bh5)|0;mid=mid+Math.imul(ah2,bl5)|0;hi=hi+Math.imul(ah2,bh5)|0;lo=lo+Math.imul(al1,bl6)|0;mid=mid+Math.imul(al1,bh6)|0;mid=mid+Math.imul(ah1,bl6)|0;hi=hi+Math.imul(ah1,bh6)|0;lo=lo+Math.imul(al0,bl7)|0;mid=mid+Math.imul(al0,bh7)|0;mid=mid+Math.imul(ah0,bl7)|0;hi=hi+Math.imul(ah0,bh7)|0;let w7=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w7>>>26)|0;w7&=67108863;lo=Math.imul(al8,bl0);mid=Math.imul(al8,bh0);mid=mid+Math.imul(ah8,bl0)|0;hi=Math.imul(ah8,bh0);lo=lo+Math.imul(al7,bl1)|0;mid=mid+Math.imul(al7,bh1)|0;mid=mid+Math.imul(ah7,bl1)|0;hi=hi+Math.imul(ah7,bh1)|0;lo=lo+Math.imul(al6,bl2)|0;mid=mid+Math.imul(al6,bh2)|0;mid=mid+Math.imul(ah6,bl2)|0;hi=hi+Math.imul(ah6,bh2)|0;lo=lo+Math.imul(al5,bl3)|0;mid=mid+Math.imul(al5,bh3)|0;mid=mid+Math.imul(ah5,bl3)|0;hi=hi+Math.imul(ah5,bh3)|0;lo=lo+Math.imul(al4,bl4)|0;mid=mid+Math.imul(al4,bh4)|0;mid=mid+Math.imul(ah4,bl4)|0;hi=hi+Math.imul(ah4,bh4)|0;lo=lo+Math.imul(al3,bl5)|0;mid=mid+Math.imul(al3,bh5)|0;mid=mid+Math.imul(ah3,bl5)|0;hi=hi+Math.imul(ah3,bh5)|0;lo=lo+Math.imul(al2,bl6)|0;mid=mid+Math.imul(al2,bh6)|0;mid=mid+Math.imul(ah2,bl6)|0;hi=hi+Math.imul(ah2,bh6)|0;lo=lo+Math.imul(al1,bl7)|0;mid=mid+Math.imul(al1,bh7)|0;mid=mid+Math.imul(ah1,bl7)|0;hi=hi+Math.imul(ah1,bh7)|0;lo=lo+Math.imul(al0,bl8)|0;mid=mid+Math.imul(al0,bh8)|0;mid=mid+Math.imul(ah0,bl8)|0;hi=hi+Math.imul(ah0,bh8)|0;let w8=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w8>>>26)|0;w8&=67108863;lo=Math.imul(al9,bl0);mid=Math.imul(al9,bh0);mid=mid+Math.imul(ah9,bl0)|0;hi=Math.imul(ah9,bh0);lo=lo+Math.imul(al8,bl1)|0;mid=mid+Math.imul(al8,bh1)|0;mid=mid+Math.imul(ah8,bl1)|0;hi=hi+Math.imul(ah8,bh1)|0;lo=lo+Math.imul(al7,bl2)|0;mid=mid+Math.imul(al7,bh2)|0;mid=mid+Math.imul(ah7,bl2)|0;hi=hi+Math.imul(ah7,bh2)|0;lo=lo+Math.imul(al6,bl3)|0;mid=mid+Math.imul(al6,bh3)|0;mid=mid+Math.imul(ah6,bl3)|0;hi=hi+Math.imul(ah6,bh3)|0;lo=lo+Math.imul(al5,bl4)|0;mid=mid+Math.imul(al5,bh4)|0;mid=mid+Math.imul(ah5,bl4)|0;hi=hi+Math.imul(ah5,bh4)|0;lo=lo+Math.imul(al4,bl5)|0;mid=mid+Math.imul(al4,bh5)|0;mid=mid+Math.imul(ah4,bl5)|0;hi=hi+Math.imul(ah4,bh5)|0;lo=lo+Math.imul(al3,bl6)|0;mid=mid+Math.imul(al3,bh6)|0;mid=mid+Math.imul(ah3,bl6)|0;hi=hi+Math.imul(ah3,bh6)|0;lo=lo+Math.imul(al2,bl7)|0;mid=mid+Math.imul(al2,bh7)|0;mid=mid+Math.imul(ah2,bl7)|0;hi=hi+Math.imul(ah2,bh7)|0;lo=lo+Math.imul(al1,bl8)|0;mid=mid+Math.imul(al1,bh8)|0;mid=mid+Math.imul(ah1,bl8)|0;hi=hi+Math.imul(ah1,bh8)|0;lo=lo+Math.imul(al0,bl9)|0;mid=mid+Math.imul(al0,bh9)|0;mid=mid+Math.imul(ah0,bl9)|0;hi=hi+Math.imul(ah0,bh9)|0;let w9=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w9>>>26)|0;w9&=67108863;lo=Math.imul(al9,bl1);mid=Math.imul(al9,bh1);mid=mid+Math.imul(ah9,bl1)|0;hi=Math.imul(ah9,bh1);lo=lo+Math.imul(al8,bl2)|0;mid=mid+Math.imul(al8,bh2)|0;mid=mid+Math.imul(ah8,bl2)|0;hi=hi+Math.imul(ah8,bh2)|0;lo=lo+Math.imul(al7,bl3)|0;mid=mid+Math.imul(al7,bh3)|0;mid=mid+Math.imul(ah7,bl3)|0;hi=hi+Math.imul(ah7,bh3)|0;lo=lo+Math.imul(al6,bl4)|0;mid=mid+Math.imul(al6,bh4)|0;mid=mid+Math.imul(ah6,bl4)|0;hi=hi+Math.imul(ah6,bh4)|0;lo=lo+Math.imul(al5,bl5)|0;mid=mid+Math.imul(al5,bh5)|0;mid=mid+Math.imul(ah5,bl5)|0;hi=hi+Math.imul(ah5,bh5)|0;lo=lo+Math.imul(al4,bl6)|0;mid=mid+Math.imul(al4,bh6)|0;mid=mid+Math.imul(ah4,bl6)|0;hi=hi+Math.imul(ah4,bh6)|0;lo=lo+Math.imul(al3,bl7)|0;mid=mid+Math.imul(al3,bh7)|0;mid=mid+Math.imul(ah3,bl7)|0;hi=hi+Math.imul(ah3,bh7)|0;lo=lo+Math.imul(al2,bl8)|0;mid=mid+Math.imul(al2,bh8)|0;mid=mid+Math.imul(ah2,bl8)|0;hi=hi+Math.imul(ah2,bh8)|0;lo=lo+Math.imul(al1,bl9)|0;mid=mid+Math.imul(al1,bh9)|0;mid=mid+Math.imul(ah1,bl9)|0;hi=hi+Math.imul(ah1,bh9)|0;let w10=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w10>>>26)|0;w10&=67108863;lo=Math.imul(al9,bl2);mid=Math.imul(al9,bh2);mid=mid+Math.imul(ah9,bl2)|0;hi=Math.imul(ah9,bh2);lo=lo+Math.imul(al8,bl3)|0;mid=mid+Math.imul(al8,bh3)|0;mid=mid+Math.imul(ah8,bl3)|0;hi=hi+Math.imul(ah8,bh3)|0;lo=lo+Math.imul(al7,bl4)|0;mid=mid+Math.imul(al7,bh4)|0;mid=mid+Math.imul(ah7,bl4)|0;hi=hi+Math.imul(ah7,bh4)|0;lo=lo+Math.imul(al6,bl5)|0;mid=mid+Math.imul(al6,bh5)|0;mid=mid+Math.imul(ah6,bl5)|0;hi=hi+Math.imul(ah6,bh5)|0;lo=lo+Math.imul(al5,bl6)|0;mid=mid+Math.imul(al5,bh6)|0;mid=mid+Math.imul(ah5,bl6)|0;hi=hi+Math.imul(ah5,bh6)|0;lo=lo+Math.imul(al4,bl7)|0;mid=mid+Math.imul(al4,bh7)|0;mid=mid+Math.imul(ah4,bl7)|0;hi=hi+Math.imul(ah4,bh7)|0;lo=lo+Math.imul(al3,bl8)|0;mid=mid+Math.imul(al3,bh8)|0;mid=mid+Math.imul(ah3,bl8)|0;hi=hi+Math.imul(ah3,bh8)|0;lo=lo+Math.imul(al2,bl9)|0;mid=mid+Math.imul(al2,bh9)|0;mid=mid+Math.imul(ah2,bl9)|0;hi=hi+Math.imul(ah2,bh9)|0;let w11=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w11>>>26)|0;w11&=67108863;lo=Math.imul(al9,bl3);mid=Math.imul(al9,bh3);mid=mid+Math.imul(ah9,bl3)|0;hi=Math.imul(ah9,bh3);lo=lo+Math.imul(al8,bl4)|0;mid=mid+Math.imul(al8,bh4)|0;mid=mid+Math.imul(ah8,bl4)|0;hi=hi+Math.imul(ah8,bh4)|0;lo=lo+Math.imul(al7,bl5)|0;mid=mid+Math.imul(al7,bh5)|0;mid=mid+Math.imul(ah7,bl5)|0;hi=hi+Math.imul(ah7,bh5)|0;lo=lo+Math.imul(al6,bl6)|0;mid=mid+Math.imul(al6,bh6)|0;mid=mid+Math.imul(ah6,bl6)|0;hi=hi+Math.imul(ah6,bh6)|0;lo=lo+Math.imul(al5,bl7)|0;mid=mid+Math.imul(al5,bh7)|0;mid=mid+Math.imul(ah5,bl7)|0;hi=hi+Math.imul(ah5,bh7)|0;lo=lo+Math.imul(al4,bl8)|0;mid=mid+Math.imul(al4,bh8)|0;mid=mid+Math.imul(ah4,bl8)|0;hi=hi+Math.imul(ah4,bh8)|0;lo=lo+Math.imul(al3,bl9)|0;mid=mid+Math.imul(al3,bh9)|0;mid=mid+Math.imul(ah3,bl9)|0;hi=hi+Math.imul(ah3,bh9)|0;let w12=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w12>>>26)|0;w12&=67108863;lo=Math.imul(al9,bl4);mid=Math.imul(al9,bh4);mid=mid+Math.imul(ah9,bl4)|0;hi=Math.imul(ah9,bh4);lo=lo+Math.imul(al8,bl5)|0;mid=mid+Math.imul(al8,bh5)|0;mid=mid+Math.imul(ah8,bl5)|0;hi=hi+Math.imul(ah8,bh5)|0;lo=lo+Math.imul(al7,bl6)|0;mid=mid+Math.imul(al7,bh6)|0;mid=mid+Math.imul(ah7,bl6)|0;hi=hi+Math.imul(ah7,bh6)|0;lo=lo+Math.imul(al6,bl7)|0;mid=mid+Math.imul(al6,bh7)|0;mid=mid+Math.imul(ah6,bl7)|0;hi=hi+Math.imul(ah6,bh7)|0;lo=lo+Math.imul(al5,bl8)|0;mid=mid+Math.imul(al5,bh8)|0;mid=mid+Math.imul(ah5,bl8)|0;hi=hi+Math.imul(ah5,bh8)|0;lo=lo+Math.imul(al4,bl9)|0;mid=mid+Math.imul(al4,bh9)|0;mid=mid+Math.imul(ah4,bl9)|0;hi=hi+Math.imul(ah4,bh9)|0;let w13=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w13>>>26)|0;w13&=67108863;lo=Math.imul(al9,bl5);mid=Math.imul(al9,bh5);mid=mid+Math.imul(ah9,bl5)|0;hi=Math.imul(ah9,bh5);lo=lo+Math.imul(al8,bl6)|0;mid=mid+Math.imul(al8,bh6)|0;mid=mid+Math.imul(ah8,bl6)|0;hi=hi+Math.imul(ah8,bh6)|0;lo=lo+Math.imul(al7,bl7)|0;mid=mid+Math.imul(al7,bh7)|0;mid=mid+Math.imul(ah7,bl7)|0;hi=hi+Math.imul(ah7,bh7)|0;lo=lo+Math.imul(al6,bl8)|0;mid=mid+Math.imul(al6,bh8)|0;mid=mid+Math.imul(ah6,bl8)|0;hi=hi+Math.imul(ah6,bh8)|0;lo=lo+Math.imul(al5,bl9)|0;mid=mid+Math.imul(al5,bh9)|0;mid=mid+Math.imul(ah5,bl9)|0;hi=hi+Math.imul(ah5,bh9)|0;let w14=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w14>>>26)|0;w14&=67108863;lo=Math.imul(al9,bl6);mid=Math.imul(al9,bh6);mid=mid+Math.imul(ah9,bl6)|0;hi=Math.imul(ah9,bh6);lo=lo+Math.imul(al8,bl7)|0;mid=mid+Math.imul(al8,bh7)|0;mid=mid+Math.imul(ah8,bl7)|0;hi=hi+Math.imul(ah8,bh7)|0;lo=lo+Math.imul(al7,bl8)|0;mid=mid+Math.imul(al7,bh8)|0;mid=mid+Math.imul(ah7,bl8)|0;hi=hi+Math.imul(ah7,bh8)|0;lo=lo+Math.imul(al6,bl9)|0;mid=mid+Math.imul(al6,bh9)|0;mid=mid+Math.imul(ah6,bl9)|0;hi=hi+Math.imul(ah6,bh9)|0;let w15=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w15>>>26)|0;w15&=67108863;lo=Math.imul(al9,bl7);mid=Math.imul(al9,bh7);mid=mid+Math.imul(ah9,bl7)|0;hi=Math.imul(ah9,bh7);lo=lo+Math.imul(al8,bl8)|0;mid=mid+Math.imul(al8,bh8)|0;mid=mid+Math.imul(ah8,bl8)|0;hi=hi+Math.imul(ah8,bh8)|0;lo=lo+Math.imul(al7,bl9)|0;mid=mid+Math.imul(al7,bh9)|0;mid=mid+Math.imul(ah7,bl9)|0;hi=hi+Math.imul(ah7,bh9)|0;let w16=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w16>>>26)|0;w16&=67108863;lo=Math.imul(al9,bl8);mid=Math.imul(al9,bh8);mid=mid+Math.imul(ah9,bl8)|0;hi=Math.imul(ah9,bh8);lo=lo+Math.imul(al8,bl9)|0;mid=mid+Math.imul(al8,bh9)|0;mid=mid+Math.imul(ah8,bl9)|0;hi=hi+Math.imul(ah8,bh9)|0;let w17=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w17>>>26)|0;w17&=67108863;lo=Math.imul(al9,bl9);mid=Math.imul(al9,bh9);mid=mid+Math.imul(ah9,bl9)|0;hi=Math.imul(ah9,bh9);let w18=(c+lo|0)+((mid&8191)<<13)|0;c=(hi+(mid>>>13)|0)+(w18>>>26)|0;w18&=67108863;o[0]=w0;o[1]=w1;o[2]=w2;o[3]=w3;o[4]=w4;o[5]=w5;o[6]=w6;o[7]=w7;o[8]=w8;o[9]=w9;o[10]=w10;o[11]=w11;o[12]=w12;o[13]=w13;o[14]=w14;o[15]=w15;o[16]=w16;o[17]=w17;o[18]=w18;if(c!==0){o[19]=c;out.length+=1}return out}if(!Math.imul)comb10MulTo=smallMulTo;BN.Red=Red;bn=BN;return bn}var bnBrowser;var hasRequiredBnBrowser;function requireBnBrowser(){if(hasRequiredBnBrowser)return bnBrowser;hasRequiredBnBrowser=1;bnBrowser=requireBn();return bnBrowser}var chacha20;var hasRequiredChacha20;function requireChacha20(){if(hasRequiredChacha20)return chacha20;hasRequiredChacha20=1;const assert=requireAssert();const BIG_ENDIAN=new Int8Array(new Int16Array([1]).buffer)[0]===0;class ChaCha20{constructor(){this.state=new Uint32Array(16);this.stream=new Uint32Array(16);this.bytes=new Uint8Array(this.stream.buffer);this.pos=-1;if(BIG_ENDIAN)this.bytes=bufferExports.Buffer.alloc(64)}init(key,nonce,counter){if(counter==null)counter=0;assert(bufferExports.Buffer.isBuffer(key));assert(bufferExports.Buffer.isBuffer(nonce));assert(Number.isSafeInteger(counter));if(key.length!==16&&key.length!==32)throw new RangeError("Invalid key size.");if(nonce.length>=24){key=ChaCha20.derive(key,nonce.slice(0,16));nonce=nonce.slice(16)}this.state[0]=1634760805;this.state[1]=key.length<32?824206446:857760878;this.state[2]=key.length<32?2036477238:2036477234;this.state[3]=1797285236;this.state[4]=readU32(key,0);this.state[5]=readU32(key,4);this.state[6]=readU32(key,8);this.state[7]=readU32(key,12);this.state[8]=readU32(key,16%key.length);this.state[9]=readU32(key,20%key.length);this.state[10]=readU32(key,24%key.length);this.state[11]=readU32(key,28%key.length);this.state[12]=counter>>>0;if(nonce.length===8){this.state[13]=counter/4294967296>>>0;this.state[14]=readU32(nonce,0);this.state[15]=readU32(nonce,4)}else if(nonce.length===12){this.state[13]=readU32(nonce,0);this.state[14]=readU32(nonce,4);this.state[15]=readU32(nonce,8)}else if(nonce.length===16){this.state[12]=readU32(nonce,0);this.state[13]=readU32(nonce,4);this.state[14]=readU32(nonce,8);this.state[15]=readU32(nonce,12)}else{throw new RangeError("Invalid nonce size.")}this.pos=0;return this}encrypt(data){assert(bufferExports.Buffer.isBuffer(data));if(this.pos===-1)throw new Error("Context is not initialized.");for(let i=0;i>>32-b}function readU32(data,off){return data[off++]+data[off++]*256+data[off++]*65536+data[off]*16777216}function writeU32(dst,num,off){dst[off++]=num;num>>>=8;dst[off++]=num;num>>>=8;dst[off++]=num;num>>>=8;dst[off++]=num;return off}chacha20=ChaCha20;return chacha20}var chacha20Browser;var hasRequiredChacha20Browser;function requireChacha20Browser(){if(hasRequiredChacha20Browser)return chacha20Browser;hasRequiredChacha20Browser=1;chacha20Browser=requireChacha20();return chacha20Browser}var hmac;var hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;const assert=requireAssert();class HMAC{constructor(Hash,size,x=[],y=[]){assert(typeof Hash==="function");assert(size>>>0===size);assert(Array.isArray(x));assert(Array.isArray(y));this.hash=Hash;this.size=size;this.x=x;this.y=y;this.inner=new Hash;this.outer=new Hash}init(key){assert(bufferExports.Buffer.isBuffer(key));if(key.length>this.size){const Hash=this.hash;const h=new Hash;h.init(...this.x);h.update(key);key=h.final(...this.y);assert(key.length<=this.size)}const pad=bufferExports.Buffer.alloc(this.size);for(let i=0;i0){let want=64-pos;if(want>len)want=len;data.copy(this.block,pos,off,off+want);pos+=want;len-=want;off+=want;if(pos<64)return;this._transform(this.block,0)}while(len>=64){this._transform(data,off);off+=64;len-=64}if(len>0)data.copy(this.block,0,off,off+len)}_final(out){assert(this.size!==FINALIZED,"Context is not initialized.");const pos=this.size&63;const len=this.size*8;writeU32(DESC,len*(1/4294967296)>>>0,0);writeU32(DESC,len>>>0,4);this._update(PADDING,1+(119-pos&63));this._update(DESC,8);for(let i=0;i<8;i++){writeU32(out,this.state[i],i*4);this.state[i]=0}for(let i=0;i<64;i++)this.msg[i]=0;for(let i=0;i<64;i++)this.block[i]=0;this.size=FINALIZED;return out}_transform(chunk,pos){const W=this.msg;let a=this.state[0];let b=this.state[1];let c=this.state[2];let d=this.state[3];let e=this.state[4];let f=this.state[5];let g=this.state[6];let h=this.state[7];let i=0;for(;i<16;i++)W[i]=readU32(chunk,pos+i*4);for(;i<64;i++)W[i]=sigma1(W[i-2])+W[i-7]+sigma0(W[i-15])+W[i-16];for(i=0;i<64;i++){const t1=h+Sigma1(e)+Ch(e,f,g)+K[i]+W[i];const t2=Sigma0(a)+Maj(a,b,c);h=g;g=f;f=e;e=d+t1>>>0;d=c;c=b;b=a;a=t1+t2>>>0}this.state[0]+=a;this.state[1]+=b;this.state[2]+=c;this.state[3]+=d;this.state[4]+=e;this.state[5]+=f;this.state[6]+=g;this.state[7]+=h}static hash(){return new SHA256}static hmac(){return new HMAC(SHA256,64)}static digest(data){return SHA256.ctx.init().update(data).final()}static root(left,right){assert(bufferExports.Buffer.isBuffer(left)&&left.length===32);assert(bufferExports.Buffer.isBuffer(right)&&right.length===32);return SHA256.ctx.init().update(left).update(right).final()}static multi(x,y,z){const{ctx}=SHA256;ctx.init();ctx.update(x);ctx.update(y);if(z)ctx.update(z);return ctx.final()}static mac(data,key){return SHA256.hmac().init(key).update(data).final()}}SHA256.native=0;SHA256.id="SHA256";SHA256.size=32;SHA256.bits=256;SHA256.blockSize=64;SHA256.zero=bufferExports.Buffer.alloc(32,0);SHA256.ctx=new SHA256;function Sigma0(x){return(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10)}function Sigma1(x){return(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7)}function sigma0(x){return(x>>>7|x<<25)^(x>>>18|x<<14)^x>>>3}function sigma1(x){return(x>>>17|x<<15)^(x>>>19|x<<13)^x>>>10}function Ch(x,y,z){return z^x&(y^z)}function Maj(x,y,z){return x&y|z&(x|y)}function readU32(data,off){return data[off++]*16777216+data[off++]*65536+data[off++]*256+data[off]}function writeU32(data,num,off){data[off++]=num>>>24;data[off++]=num>>>16;data[off++]=num>>>8;data[off++]=num;return off}sha256$1=SHA256;return sha256$1}var sha256Browser;var hasRequiredSha256Browser;function requireSha256Browser(){if(hasRequiredSha256Browser)return sha256Browser;hasRequiredSha256Browser=1;sha256Browser=requireSha256();return sha256Browser}var batchRng;var hasRequiredBatchRng;function requireBatchRng(){if(hasRequiredBatchRng)return batchRng;hasRequiredBatchRng=1;const assert=requireAssert();const BN=requireBnBrowser();const ChaCha20=requireChacha20Browser();const SHA256=requireSha256Browser();class BatchRNG{constructor(curve,encode=key=>key){this.curve=curve;this.encode=encode;this.hash=new SHA256;this.chacha=new ChaCha20;this.key=bufferExports.Buffer.alloc(32,0);this.iv=bufferExports.Buffer.alloc(8,0);this.cache=[new BN(1),new BN(1)]}init(batch){assert(Array.isArray(batch));this.hash.init();for(const[msg,sig,key]of batch){this.hash.update(SHA256.digest(msg));this.hash.update(sig);this.hash.update(this.encode(key))}this.key=this.hash.final();this.cache[0]=new BN(1);this.cache[1]=new BN(1);return this}encrypt(counter){const size=this.curve.scalarSize*2;const data=bufferExports.Buffer.alloc(size,0);const left=data.slice(0,this.curve.scalarSize);const right=data.slice(this.curve.scalarSize);this.chacha.init(this.key,this.iv,counter);this.chacha.encrypt(data);return[this.curve.decodeScalar(left),this.curve.decodeScalar(right)]}refresh(counter){let overflow=0;for(;;){this.iv[4]=overflow;this.iv[5]=overflow>>>8;this.iv[6]=overflow>>>16;this.iv[7]=overflow>>>24;overflow+=1;const[s1,s2]=this.encrypt(counter);if(s1.isZero()||s1.cmp(this.curve.n)>=0)continue;if(s2.isZero()||s2.cmp(this.curve.n)>=0)continue;this.cache[0]=s1;this.cache[1]=s2;break}}generate(index){assert(index>>>0===index);if(index&1)this.refresh(index>>>1);return this.cache[index&1]}}batchRng=BatchRNG;return batchRng}var elliptic={};var hasRequiredElliptic;function requireElliptic(){if(hasRequiredElliptic)return elliptic;hasRequiredElliptic=1;const{custom}=requireCustomBrowser();const BN=requireBnBrowser();const types={AFFINE:0,JACOBIAN:1,PROJECTIVE:2,EXTENDED:3};const jsfIndex=[-3,-1,-5,-7,0,7,5,1,3];let uid=0;class Curve{constructor(Point,type,conf){this.Point=null;this.id=null;this.uid=uid++;this.ossl=null;this.type="base";this.endian="be";this.hash=null;this.prefix=null;this.context=false;this.prime=null;this.p=null;this.red=null;this.fieldSize=0;this.fieldBits=0;this.adjustedSize=0;this.signBit=0;this.mask=0;this.n=null;this.h=null;this.q=null;this.z=null;this.g=null;this.nh=null;this.scalarSize=0;this.scalarBits=0;this.zero=null;this.one=null;this.two=null;this.three=null;this.four=null;this.i2=null;this.i3=null;this.i4=null;this.i6=null;this.torsion=null;this.endo=null;this.hi=null;this._init(Point,type,conf)}_init(Point,type,conf){assert(typeof Point==="function");assert(typeof type==="string");assert(conf&&typeof conf==="object");assert(conf.red==null||conf.red instanceof BN.Red);assert(conf.p!=null,"Must pass a prime.");assert(conf.id==null||typeof conf.id==="string");assert(conf.ossl==null||typeof conf.ossl==="string");assert(conf.endian==null||typeof conf.endian==="string");assert(conf.hash==null||typeof conf.hash==="string");assert(conf.prefix==null||typeof conf.prefix==="string");assert(conf.context==null||typeof conf.context==="boolean");assert(conf.prime==null||typeof conf.prime==="string");assert(conf.torsion==null||Array.isArray(conf.torsion));this.Point=Point;this.id=conf.id||null;this.ossl=conf.ossl||null;this.type=type;this.endian=conf.endian||(type==="short"?"be":"le");this.hash=conf.hash||null;this.prefix=conf.prefix?bufferExports.Buffer.from(conf.prefix,"binary"):null;this.context=conf.context||false;this.prime=conf.prime||null;this.p=BN.fromJSON(conf.p);if(conf.red){this.red=conf.red}else{this.red=conf.prime?BN.red(conf.prime):BN.mont(this.p);this.red.precompute()}this.fieldSize=this.p.byteLength();this.fieldBits=this.p.bitLength();this.adjustedSize=this.fieldSize+((this.fieldBits&7)===0);this.signBit=this.adjustedSize*8-1;this.mask=255;if((this.fieldBits&7)!==0)this.mask=(1<<(this.fieldBits&7))-1;this.n=BN.fromJSON(conf.n||"0");this.h=BN.fromJSON(conf.h||"1");this.q=this.n.mul(this.h);this.z=BN.fromJSON(conf.z||"0").toRed(this.red);this.g=null;this.nh=this.n.ushrn(1);this.scalarSize=this.n.byteLength();this.scalarBits=this.n.bitLength();this.zero=new BN(0).toRed(this.red);this.one=new BN(1).toRed(this.red);this.two=new BN(2).toRed(this.red);this.three=new BN(3).toRed(this.red);this.four=new BN(4).toRed(this.red);this.i2=this.two.redInvert();this.i3=this.three.redInvert();this.i4=this.i2.redSqr();this.i6=this.i2.redMul(this.i3);this.torsion=new Array(this.h.word(0));for(let i=0;i0&&this.p.isOdd());assert(this.n.sign()>=0);assert(this.h.sign()>0&&this.h.cmpn(255)<=0);assert(this.endian==="be"||this.endian==="le");return this}_finalize(conf){assert(conf&&typeof conf==="object");this.g=conf.g?this.pointFromJSON(conf.g):this.point();if(conf.torsion){assert(conf.torsion.length===this.torsion.length);for(let i=0;ia.cmp(b));while(out.length>>0;let acc=this.jpoint();for(let i=0;i0;i--){for(let j=0;j=0;i--){const z=naf[i];if(i!==naf.length-1)acc=acc.dbl();if(z>0)acc=acc.add(points[z-1>>1]);else if(z<0)acc=acc.sub(points[-z-1>>1])}return acc}_wnafMulAdd(w,points,coeffs){assert(w>>>0===w);assert(Array.isArray(points));assert(Array.isArray(coeffs));assert(points.length===coeffs.length);const length=points.length;const wnd=new Array(length);const naf=new Array(length);let max=0;for(let i=0;i0&&point.type!==points[i-1].type)throw new Error("Cannot mix points.");wnd[i]=null;naf[i]=null;max=Math.max(max,coeff.bitLength()+1)}let ppoint=null;let pcoeff=null;let len=0;for(let i=0;i=0;i--){if(i!==max-1)acc=acc.dbl();for(let j=0;j0)acc=acc.add(wnd[j][z-1>>1]);else if(z<0)acc=acc.sub(wnd[j][-z-1>>1])}}return acc}_endoWnafMulAdd(points,coeffs){throw new Error("Not implemented.")}_scale(curve,invert){assert(curve instanceof Curve);assert(curve.p.eq(this.p));switch(curve.type){case"short":return this._scaleShort(curve,invert);case"mont":return this._scaleMont(curve,invert);case"edwards":return this._scaleEdwards(curve,invert);default:throw new Error("Not implemented.")}}_scaleShort(curve,invert){throw new Error("Not implemented.")}_scaleMont(curve,invert){throw new Error("Not implemented.")}_scaleEdwards(curve,invert){throw new Error("Not implemented.")}isElliptic(){throw new Error("Not implemented.")}jinv(){throw new Error("Not implemented.")}isComplete(){return false}precompute(rng){assert(!this.g.isInfinity(),"Must have base point.");assert(!this.n.isZero(),"Must have order.");this.g.precompute(this.n.bitLength(),rng);return this}scalar(num,base,endian){const k=new BN(num,base,endian);assert(!k.red);if(this.n.isZero())return k;return k.imod(this.n)}field(num,base,endian){const x=BN.cast(num,base,endian);if(x.red)return x.forceRed(this.red);return x.toRed(this.red)}point(x,y){throw new Error("Not implemented.")}jpoint(x,y,z){throw new Error("Not implemented.")}xpoint(x,z){throw new Error("Not implemented.")}cpoint(xx,xz,yy,yz){assert(xx instanceof BN);assert(xz instanceof BN);assert(yy instanceof BN);assert(yz instanceof BN);if(xz.isZero()||yz.isZero())return this.point();const z=xz.redMul(yz).redInvert();const x=xx.redMul(yz).redMul(z);const y=yy.redMul(xz).redMul(z);return this.point(x,y)}solveX2(y){throw new Error("Not implemented.")}solveX(y){return this.solveX2(y).redSqrt()}solveY2(x){throw new Error("Not implemented.")}solveY(x){return this.solveY2(x).redSqrt()}validate(point){throw new Error("Not implemented.")}pointFromX(x,sign){throw new Error("Not implemented.")}pointFromY(y,sign){throw new Error("Not implemented.")}isIsomorphic(curve){throw new Error("Not implemented.")}isIsogenous(curve){throw new Error("Not implemented.")}pointFromShort(point){throw new Error("Not implemented.")}pointFromMont(point,sign){throw new Error("Not implemented.")}pointFromEdwards(point){throw new Error("Not implemented.")}pointFromUniform(u){throw new Error("Not implemented.")}pointToUniform(p){throw new Error("Not implemented.")}pointFromHash(bytes,pake=false){assert(bufferExports.Buffer.isBuffer(bytes));assert(typeof pake==="boolean");if(bytes.length!==this.fieldSize*2)throw new Error("Invalid hash size.");const s1=bytes.slice(0,this.fieldSize);const s2=bytes.slice(this.fieldSize);const u1=this.decodeUniform(s1);const u2=this.decodeUniform(s2);const p1=this.pointFromUniform(u1);const p2=this.pointFromUniform(u2);const p3=p1.add(p2);return pake?p3.mulH():p3}pointToHash(p,subgroup,rng){assert(p instanceof this.Point);assert(subgroup>>>0===subgroup);const i=subgroup%this.torsion.length;const p0=p.add(this.torsion[i]);for(;;){const u1=this.randomField(rng);const p1=this.pointFromUniform(u1);if(p1.neg().eq(p1))continue;const p2=p0.sub(p1);const hint=randomInt(rng);let u2;try{u2=this.pointToUniform(p2,hint&15)}catch(e){if(e.message==="Invalid point.")continue;throw e}const s1=this.encodeUniform(u1,hint>>>8);const s2=this.encodeUniform(u2,hint>>>16);return bufferExports.Buffer.concat([s1,s2])}}randomScalar(rng){const max=this.n.isZero()?this.p:this.n;return BN.random(rng,1,max)}randomField(rng){return BN.random(rng,1,this.p).toRed(this.red)}randomPoint(rng){let p;for(;;){const x=this.randomField(rng);const sign=(randomInt(rng)&1)!==0;try{p=this.pointFromX(x,sign)}catch(e){continue}assert(p.validate());return p.mulH()}}mulAll(points,coeffs){return this.jmulAll(points,coeffs)}jmulAll(points,coeffs){assert(Array.isArray(points));assert(points.length===0||points[0]instanceof Point);if(this.endo&&points.length>0&&points[0].type===types.AFFINE)return this._endoWnafMulAdd(points,coeffs);return this._wnafMulAdd(5,points,coeffs)}mulH(k){assert(k instanceof BN);return this.imulH(k.clone())}imulH(k){assert(k instanceof BN);assert(!k.red);const word=this.h.word(0);if((word&word-1)===0){const bits=this.h.bitLength();return k.iushln(bits-1).imod(this.n)}return k.imuln(word).imod(this.n)}normalizeAll(points){assert(Array.isArray(points));const len=points.length;const z=new Array(len);for(let i=0;i>>0===bits);const msb=this.endian==="le"?this.fieldSize-1:0;const bytes=x.fromRed().encode(this.endian,this.fieldSize);bytes[msb]|=bits&~this.mask&255;return bytes}decodeUniform(bytes){assert(bufferExports.Buffer.isBuffer(bytes));if(bytes.length!==this.fieldSize)throw new Error("Invalid field size.");const x=BN.decode(bytes,this.endian);x.iumaskn(this.fieldBits);return x.toRed(this.red)}encodePoint(point,compact){assert(point instanceof Point);return point.encode(compact)}decodePoint(bytes){throw new Error("Not implemented.")}encodeX(point){throw new Error("Not implemented.")}decodeX(bytes){throw new Error("Not implemented.")}decodeEven(bytes){throw new Error("Not implemented.")}decodeSquare(bytes){throw new Error("Not implemented.")}toShort(){throw new Error("Not implemented.")}toMont(b0){throw new Error("Not implemented.")}toEdwards(a0){throw new Error("Not implemented.")}pointToJSON(point,pre){assert(point instanceof Point);return point.toJSON(pre)}pointFromJSON(json){throw new Error("Not implemented.")}toJSON(pre){let prefix,context;let n,z,endo;if(this.type==="edwards"){prefix=this.prefix?this.prefix.toString():null;context=this.context}if(!this.n.isZero())n=this.n.toJSON();if(!this.z.isZero()){z=this.z.fromRed();if(this.z.redIsHigh())z.isub(this.p);z=z.toString(16)}if(this.endo)endo=this.endo.toJSON();return{id:this.id,ossl:this.ossl,type:this.type,endian:this.endian,hash:this.hash,prefix:prefix,context:context,prime:this.prime,p:this.p.toJSON(),a:undefined,b:undefined,d:undefined,n:n,h:this.h.toString(16),s:undefined,z:z,c:undefined,g:this.g.toJSON(pre),endo:endo}}static fromJSON(json){return new this(json)}}class Point{constructor(curve,type){assert(curve instanceof Curve);assert(type>>>0===type);this.curve=curve;this.type=type;this.pre=null}_init(){throw new Error("Not implemented.")}_safeNAF(width){assert(width>>>0===width);if(this.pre&&this.pre.naf)return this.pre.naf;if(width===0)return null;const size=1<>>0===width);if(this.pre&&this.pre.naf)return this.pre.naf;if(width===0)return null;const odds=this._safeNAF(width).points;const points=this.curve.affinizeAll(odds);return new NAF(width,points)}_getWindows(width,bits){assert(width>>>0===width);assert(bits>>>0===bits);if(this.pre&&this.pre.windows)return this.pre.windows;if(width===0)return null;const size=1<>>0;const wnds=new Array(steps*size);let g=this.toJ();for(let i=0;i>>0===step);assert(power>>>0===power);if(this.pre&&this.pre.doubles)return this.pre.doubles;if(step===0)return null;const len=Math.ceil(power/step)+1;const dbls=new Array(len);let acc=this.toJ();let k=0;dbls[k++]=acc;for(let i=0;i>>0;return k.bitLength()<=steps*width}_hasDoubles(k){assert(k instanceof BN);if(!this.pre||!this.pre.doubles)return false;const{step,points}=this.pre.doubles;const power=k.bitLength()+1;return points.length>=Math.ceil(power/step)+1}_getJNAF(point){assert(point instanceof Point);assert(point.type===this.type);return[this,this.add(point),this.sub(point),point]}_blind(k,rng){assert(k instanceof BN);assert(!k.red);if(this.pre&&this.pre.blinding){const{blind,unblind}=this.pre.blinding;const t=k.sub(blind);return[this,t,unblind]}if(!rng)return[this,k,null];if(this.pre){if(this.curve.n.isZero())return[this,k,null];const a=this.curve.randomScalar(rng);const r=a.mul(this.curve.n);const t=r.iadd(k);return[this,t,null]}const p=this.randomize(rng);return[p,k,null]}clone(){throw new Error("Not implemented.")}precompute(bits,rng){assert(bits>>>0===bits);if(!this.pre)this.pre=new Precomp;if(!this.pre.naf)this.pre.naf=this._getNAF(9);if(!this.pre.doubles)this.pre.doubles=this._getDoubles(4,bits+1);if(!this.pre.beta)this.pre.beta=this._getBeta();if(!this.pre.blinding)this.pre.blinding=this._getBlinding(rng);return this}validate(){return this.curve.validate(this)}normalize(){return this}scale(a){throw new Error("Not implemented.")}randomize(rng){const z=this.curve.randomField(rng);return this.scale(z)}neg(){throw new Error("Not implemented.")}add(point){throw new Error("Not implemented.")}sub(point){assert(point instanceof Point);return this.add(point.neg())}dbl(){throw new Error("Not implemented.")}dblp(pow){assert(pow>>>0===pow);let r=this;for(let i=0;i0){q=n.clone();break}p=p.add(this)}return q}mul(k){return this.jmul(k)}muln(k){return this.jmuln(k)}mulBlind(k,rng){return this.jmulBlind(k,rng)}mulAdd(k1,p2,k2){return this.jmulAdd(k1,p2,k2)}mulH(){return this.jmulH()}div(k){return this.jdiv(k)}divn(k){return this.jdivn(k)}divH(){return this.jdivH()}jmul(k){if(this._hasDoubles(k))return this.curve._fixedNafMul(this,k);if(this.curve.endo&&this.type===types.AFFINE)return this.curve._endoWnafMulAdd([this],[k]);return this.curve._wnafMul(5,this,k)}jmuln(k){assert((k|0)===k);return this.jmul(new BN(k))}jmulBlind(k,rng=null){const[p,t,unblind]=this._blind(k,rng);const q=p.jmul(t);if(unblind)return q.add(unblind);return q}jmulAdd(k1,p2,k2){if(this.curve.endo&&this.type===types.AFFINE)return this.curve._endoWnafMulAdd([this,p2],[k1,k2]);return this.curve._wnafMulAdd(5,[this,p2],[k1,k2])}jmulH(){const word=this.curve.h.word(0);if((word&word-1)===0){const bits=this.curve.h.bitLength();return this.toJ().dblp(bits-1)}return this.jmul(this.curve.h)}jdiv(k){assert(k instanceof BN);assert(!k.red);return this.jmul(k.invert(this.curve.n))}jdivn(k){assert(!this.curve.n.isZero());if(this.curve.h.cmpn(k)===0)return this.jdivH();return this.jdiv(new BN(k))}jdivH(){if(this.curve.n.isZero())return this.toJ();if(this.curve.h.cmpn(1)===0)return this.toJ();if(this.curve.hi===null)this.curve.hi=this.curve.h.invert(this.curve.n);return this.jmul(this.curve.hi)}toP(){return this.normalize()}toJ(){return this}toX(){return this}key(){if(this.isInfinity())return`${this.curve.uid}:oo`;this.normalize();const x=this.getX().toString(16);const y=this.getY().toString(16);return`${this.curve.uid}:${x},${y}`}encode(compact){throw new Error("Not implemented.")}static decode(curve,bytes){throw new Error("Not implemented.")}encodeX(){throw new Error("Not implemented.")}static decodeX(curve,bytes){throw new Error("Not implemented.")}static decodeEven(curve,bytes){throw new Error("Not implemented.")}static decodeSquare(curve,bytes){throw new Error("Not implemented.")}toJSON(pre){throw new Error("Not implemented.")}static fromJSON(curve,json){throw new Error("Not implemented.")}[custom](){return""}}class ShortCurve extends Curve{constructor(conf){super(ShortPoint,"short",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.b=BN.fromJSON(conf.b).toRed(this.red);this.c=BN.fromJSON(conf.c||"0").toRed(this.red);this.ai=this.a.isZero()?this.zero:this.a.redInvert();this.zi=this.z.isZero()?this.zero:this.z.redInvert();this.zeroA=this.a.isZero();this.threeA=this.a.eq(this.three.redNeg());this.redN=this.n.toRed(this.red);this.pmodn=this.p.clone();this.highOrder=this.n.cmp(this.p)>=0;this.smallGap=false;this._finalize(conf)}_finalize(conf){super._finalize(conf);if(conf.endo!=null)this.endo=Endo.fromJSON(this,conf.endo);else this.endo=this._getEndomorphism();if(!this.n.isZero()){this.pmodn=this.p.mod(this.n);this.smallGap=this.p.div(this.n).cmpn(1)<=0}return this}static _isomorphism(curveA,curveB,custom,odd){assert(curveA instanceof BN);assert(curveB instanceof BN);assert(custom instanceof BN);assert(odd==null||typeof odd==="boolean");assert(!curveA.isZero()||!curveB.isZero());if(custom.isZero())throw new Error("Invalid coefficient.");if(curveA.isZero()){const customB=custom;const u6=customB.redDiv(curveB);const u2=uncube(u6);assert(u2.redJacobi()===1);return[curveA.clone(),customB.clone()]}if(curveB.isZero()){const customA=custom;const u4=customA.redDiv(curveA);const u2=u4.redSqrt();if(u2.redJacobi()!==1)u2.redINeg();if(u2.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");return[customA.clone(),curveB.clone()]}const customA=custom;const u4=customA.redDiv(curveA);const u2=u4.redSqrt();if(odd!=null){if(u2.redIsOdd()!==odd)u2.redINeg()}else{if(u2.redJacobi()!==1)u2.redINeg()}if(u2.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");const u6=u4.redMul(u2);const a=curveA.redMul(u4);const b=curveB.redMul(u6);assert(a.eq(customA));return[a,b]}_short(a0,odd){return ShortCurve._isomorphism(this.a,this.b,a0,odd)}_mont(b0,odd){const[r,s]=this._findRS(odd);const b=s.redInvert();const a=r.redMuln(3).redMul(b);if(b0!=null)return MontCurve._isomorphism(a,b,b0);return[a,b]}_edwards(a0,odd){const[r,s]=this._findRS(odd);const r3=r.redMuln(3);const s2=s.redMuln(2);const a=r3.redAdd(s2);const d=r3.redSub(s2);if(a0!=null)return EdwardsCurve._isomorphism(a,d,a0);return[a,d]}_findRS(sign){assert(sign==null||typeof sign==="boolean");assert(this.h.word(0)>=4);assert(!this.n.isZero());const x=this.one.redNeg();let p;for(;;){x.redIAdd(this.one);try{p=this.pointFromX(x.clone())}catch(e){continue}p=p.mul(this.n);if(p.isInfinity())continue;if(!p.y.isZero())continue;break}const r=p.x;const r2=r.redSqr();const s=r2.redMuln(3).redIAdd(this.a).redSqrt();if(sign!=null){if(s.redIsOdd()!==sign)s.redINeg()}return[r,s]}_scale0(a,b){assert(this.a.isZero()===a.isZero());assert(this.b.isZero()===b.isZero());if(this.a.isZero()){const u6=this.b.redDiv(this.field(b));const u2=uncube(u6);const u=u2.redSqrt();const u3=u2.redMul(u);assert(u3.redSqr().eq(u6));assert(!u.isZero());return[u2,u3]}if(this.b.isZero()){const u4=this.a.redDiv(this.field(a));const u2=u4.redSqrt();if(u2.redJacobi()!==1)u2.redINeg();const u=u2.redSqrt();const u3=u2.redMul(u);assert(u3.redMul(u).eq(u4));assert(!u.isZero());return[u2,u3]}const u4=this.a.redDiv(this.field(a));const u6=this.b.redDiv(this.field(b));const u2=u4.redSqrt();if(!u4.redMul(u2).eq(u6))u2.redINeg();assert(u4.redMul(u2).eq(u6));const u=u2.redSqrt();const u3=u2.redMul(u);assert(!u.isZero());return[u2,u3]}_scale1(x,y){const u2=this.g.x.redDiv(this.field(x));const u3=this.g.y.redDiv(this.field(y));const u=u2.redSqrt();if(!u2.redMul(u).eq(u3))u.redINeg();assert(u2.redMul(u).eq(u3));assert(!u.isZero());return[u2,u3]}_scaleShort(curve){assert(curve instanceof ShortCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this._scale0(curve.a,curve.b);return this._scale1(curve.g.x,curve.g.y)}_scaleMont(curve){assert(curve instanceof MontCurve);if(this.g.isInfinity()||curve.g.isInfinity()){const[a,b]=curve._short();return this._scale0(a,b)}const{x,y}=curve.g;const nx=x.redAdd(curve.a3).redMul(curve.bi);const ny=y.redMul(curve.bi);return this._scale1(nx,ny)}_scaleEdwards(curve){assert(curve instanceof EdwardsCurve);if(this.g.isInfinity()||curve.g.isInfinity()){const[a,b]=curve._short();return this._scale0(a,b)}const{x,y,z}=curve.g;const a5=curve.a.redMuln(5);const d5=curve.d.redMuln(5);const dma=curve.d.redSub(curve.a);const d5a=d5.redSub(curve.a);const da5=curve.d.redSub(a5);const ypz=y.redAdd(z);const ymz=y.redSub(z);const xx=d5a.redMul(y).redIAdd(da5.redMul(z));const xz=ymz.redMuln(12);const yy=dma.redMul(ypz).redMul(z);const yz=ymz.redMul(x).redIMuln(4);const zi=xz.redMul(yz).redInvert();const nx=xx.redMul(yz).redMul(zi);const ny=yy.redMul(xz).redMul(zi);return this._scale1(nx,ny)}_getEndomorphism(index=0){if(this.n.isZero()||this.g.isInfinity())return null;if(!this.zeroA||this.p.modrn(3)!==1||this.n.modrn(3)!==1)return null;const[b1,b2]=this._getEndoRoots(this.p);const beta=[b1,b2][index&1].toRed(this.red);const[l1,l2]=this._getEndoRoots(this.n);const p=this.point(this.g.x.redMul(beta),this.g.y);let lambda;if(this.g.mul(l1).eq(p)){lambda=l1}else{assert(this.g.mul(l2).eq(p));lambda=l2}const basis=this._getEndoBasis(lambda);const pre=this._getEndoPrecomp(basis);return new Endo(beta,lambda,basis,pre)}_getEndoRoots(num){const red=num===this.p?this.red:BN.mont(num);const two=new BN(2).toRed(red);const three=new BN(3).toRed(red);const i2=two.redInvert();const s1=three.redNeg().redSqrt().redMul(i2);const s2=s1.redNeg();const r1=s1.redSub(i2).fromRed();const r2=s2.redSub(i2).fromRed();return[r1,r2].sort(BN.cmp)}_getEndoBasis(lambda){const[rl,tl,rl1,tl1,rl2,tl2]=this._egcdSqrt(lambda);const a1=rl1;const b1=tl1.neg();const lhs=rl.sqr().iadd(tl.sqr());const rhs=rl2.sqr().iadd(tl2.sqr());let a2,b2;if(lhs.cmp(rhs)<=0){a2=rl;b2=tl.neg()}else{a2=rl2;b2=tl2.neg()}return[new Vector(a1,b1),new Vector(a2,b2)]}_egcdSqrt(lambda){assert(lambda instanceof BN);assert(!lambda.red);assert(lambda.sign()>0);assert(this.n.sign()>0);const sqrtn=this.n.ushrn(this.n.bitLength()>>>1);let u=lambda;let v=this.n.clone();let x1=new BN(1);let y1=new BN(0);let x2=new BN(0);let y2=new BN(1);let rl,tl;let rl1,tl1;let i=0;let j=0;let p;while(!u.isZero()&&i<2){const q=v.quo(u);const r=v.sub(q.mul(u));const x=x2.sub(q.mul(x1));const y=y2.sub(q.mul(y1));if(j===0&&r.cmp(sqrtn)<0){rl=p;tl=x1;rl1=r;tl1=x;j=1}p=r;v=u;u=r;x2=x1;x1=x;y2=y1;y1=y;i+=j}assert(j!==0,"Could not find r < sqrt(n).");const rl2=x2;const tl2=x1;return[rl,tl,rl1,tl1,rl2,tl2]}_getEndoPrecomp(basis){assert(Array.isArray(basis));assert(basis.length===2);assert(basis[0]instanceof Vector);assert(basis[1]instanceof Vector);const[v1,v2]=basis;const d=v1.a.mul(v2.b).isub(v1.b.mul(v2.a));const bits=d.bitLength();const align=bits>=160;assert(d.eq(this.n));let shift=bits+Math.ceil(bits/2)+1;let g1,g2;if(align)shift-=shift&63;while(shift>bits){g1=v2.b.ushln(shift).divRound(d);g2=v1.b.ushln(shift).divRound(d);if(g1.ucmp(d)<0&&g2.ucmp(d)<0)break;if(align)shift-=64;else shift-=1}if(shift<=bits)throw new Error("Could not calculate g1 and g2.");return[shift,g1,g2]}_endoSplit(k){assert(k instanceof BN);assert(!k.red);assert(!this.n.isZero());const[v1,v2]=this.endo.basis;const c1=v2.b.mul(k).divRound(this.n);const c2=v1.b.neg().mul(k).divRound(this.n);const p1=c1.mul(v1.a);const p2=c2.mul(v2.a);const q1=c1.ineg().mul(v1.b);const q2=c2.mul(v2.b);const k1=k.sub(p1).isub(p2);const k2=q1.isub(q2);return[k1,k2]}_endoBeta(point){assert(point instanceof ShortPoint);return[point,point._getBeta()]}_endoWnafMulAdd(points,coeffs){assert(Array.isArray(points));assert(Array.isArray(coeffs));assert(points.length===coeffs.length);assert(this.endo!=null);const len=points.length;const npoints=new Array(len*2);const ncoeffs=new Array(len*2);for(let i=0;i>>1];const u=n.redDivSqrt(d);if(u.redIsOdd()!==y.redIsOdd())u.redINeg();return u}_svdwf(u){const{c,z,zi,i2,i3}=this;const gz=this.solveY2(z);const z3=i3.redMul(zi.redSqr());const u2=u.redSqr();const u4=u2.redSqr();const t1=u2.redAdd(gz);const u2t1=u2.redMul(t1);const t2=u2t1.isZero()?u2t1:u2t1.redInvert();const t3=u4.redMul(t2).redMul(c);const t4=t1.redSqr().redMul(t1);const x1=c.redSub(z).redMul(i2).redISub(t3);const x2=t3.redSub(c.redAdd(z).redMul(i2));const x3=z.redSub(t4.redMul(t2).redMul(z3));const y1=this.solveY2(x1);const y2=this.solveY2(x2);const y3=this.solveY2(x3);const alpha=y1.redJacobi()|1;const beta=y2.redJacobi()|1;const i=mod((alpha-1)*beta,3);const x=[x1,x2,x3][i];const y=[y1,y2,y3][i];return[x,y]}_svdw(u){const[x,yy]=this._svdwf(u);const y=yy.redSqrt();if(y.redIsOdd()!==u.redIsOdd())y.redINeg();return this.point(x,y)}_svdwi(p,hint){const{b,c,z,zero,two}=this;const{x,y}=p;const r=hint&3;const z2=z.redSqr();const z3=z2.redMul(z);const z4=z2.redSqr();const gz=z3.redAdd(b);const gz2=gz.redMuln(2);const xx=x.redSqr();const x2z=x.redMuln(2).redIAdd(z);const xz2=x.redMul(z2);const c0=c.redSub(x2z);const c1=c.redAdd(x2z);const t0=xx.redMul(z2).redIAdd(z4).redIMuln(9);const t1=x.redMul(z3).redIMuln(18);const t2=gz.redMul(x.redSub(z)).redIMuln(12);const t3=r>=2?t0.redISub(t1).redIAdd(t2).redSqrt():zero;const t4=t3.redMul(z);const t5=z3.redISub(xz2).redIMuln(3).redISub(gz2);const n0=gz.redMul(c0);const n1=gz.redMul(c1);const n2=t5.redAdd(t4);const n3=t5.redSub(t4);const d2=two;const n=[n0,n1,n2,n3][r];const d=[c1,c0,d2,d2][r];const u=n.redDivSqrt(d);const[x0]=this._svdwf(u);if(!x0.eq(x))throw new Error("Invalid point.");if(u.redIsOdd()!==y.redIsOdd())u.redINeg();return u}isElliptic(){const{a,b}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const d=b2.redMuln(27).redIAdd(a3.redMuln(4));return!d.isZero()}jinv(){const{a,b}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const t0=a3.redMuln(4);const lhs=t0.redMuln(1728);const rhs=b2.redMuln(27).redIAdd(t0);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}point(x,y){return new ShortPoint(this,x,y)}jpoint(x,y,z){return new JPoint(this,x,y,z)}solveX(y){assert(y instanceof BN);if(!this.a.isZero())throw new Error("Not implemented.");const y2=y.redSqr();const x3=y2.redSub(this.b);return cubeRoots(x3)}solveY2(x){assert(x instanceof BN);const x3=x.redSqr().redMul(x);const y2=x3.redIAdd(this.b);if(!this.zeroA){if(this.threeA)y2.redIAdd(x.redMuln(-3));else y2.redIAdd(this.a.redMul(x))}return y2}validate(point){assert(point instanceof ShortPoint);if(point.inf)return true;const{x,y}=point;const y2=this.solveY2(x);return y.redSqr().eq(y2)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(this.h.cmpn(1)>0){if(y.isZero()&&sign)throw new Error("Invalid point.")}if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}pointFromY(y,index=0){assert(y instanceof BN);assert(index>>>0===index);if(!y.red)y=y.toRed(this.red);const coords=this.solveX(y);if(index>=coords.length)throw new Error("Invalid X coordinate index.");const x=coords[index];return this.point(x,y)}isIsomorphic(curve){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;let u2,u3;try{[u2,u3]=this._scale(curve)}catch(e){return false}if(curve.type==="short"){const a=this.field(curve.a).redMul(u2.redSqr());const b=this.field(curve.b).redMul(u3.redSqr());return this.a.eq(a)&&this.b.eq(b)}if(curve.type==="mont"){const{a3,bi}=curve;const x=this.field(a3.redMul(bi)).redMul(u2);const y2=this.solveY2(x);return y2.isZero()}if(curve.type==="edwards"){const x=this.field(curve.ad6).redMul(u2);const y2=this.solveY2(x);return y2.isZero()}return false}isIsogenous(curve){assert(curve instanceof Curve);return false}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const[u2,u3]=this._scale(point.curve);const x=this.field(point.x);const y=this.field(point.y);const nx=x.redMul(u2);const ny=y.redMul(u3);return this.point(nx,ny)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const{a3,bi}=point.curve;const[u2,u3]=this._scale(point.curve);const nx=point.x.redAdd(a3).redMul(bi);const ny=point.y.redMul(bi);return this.point(this.field(nx).redMul(u2),this.field(ny).redMul(u3))}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);if(this.isIsomorphic(point.curve)){const{a,d,ad6}=point.curve;const[u2,u3]=this._scale(point.curve);if(point.isInfinity())return this.point();if(point.x.isZero()){const x=this.field(ad6).redMul(u2);return this.point(x,this.zero)}const{x,y,z}=point;const a5=a.redMuln(5);const d5=d.redMuln(5);const dma=d.redSub(a);const d5a=d5.redSub(a);const da5=d.redSub(a5);const ypz=y.redAdd(z);const ymz=y.redSub(z);const xx=d5a.redMul(y).redIAdd(da5.redMul(z));const xz=ymz.redMuln(12);const yy=dma.redMul(ypz).redMul(z);const yz=ymz.redMul(x).redIMuln(4);return this.cpoint(this.field(xx).redMul(u2),this.field(xz),this.field(yy).redMul(u3),this.field(yz))}throw new Error("Not implemented.")}pointFromUniform(u){assert(u instanceof BN);if(this.z.isZero()||this.b.isZero())throw new Error("Not implemented.");if(!this.a.isZero())return this._sswu(u);if(!this.c.isZero())return this._svdw(u);throw new Error("Not implemented.")}pointToUniform(p,hint){assert(p instanceof ShortPoint);assert(hint>>>0===hint);if(this.z.isZero()||this.b.isZero())throw new Error("Not implemented.");if(p.isInfinity())throw new Error("Invalid point.");const i=(hint>>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);return wrapErrors(()=>{if(!this.a.isZero())return this._sswui(q,hint);if(!this.c.isZero())return this._svdwi(q,hint);throw new Error("Not implemented.")})}mulAll(points,coeffs){return super.mulAll(points,coeffs).toP()}affinizeAll(points){const out=this.normalizeAll(points);for(let i=0;i{const xb=point.x.redMul(this.curve.endo.beta);return this.curve.point(xb,point.y)});this.pre.beta=beta}return beta}_getJNAF(point){assert(point instanceof ShortPoint);if(this.inf||point.inf)return super._getJNAF(point);const comb=[this,null,null,point];if(this.y.eq(point.y)){comb[1]=this.add(point);comb[2]=this.toJ().sub(point)}else if(this.y.eq(point.y.redNeg())){comb[1]=this.toJ().add(point);comb[2]=this.sub(point)}else{comb[1]=this.toJ().add(point);comb[2]=this.toJ().sub(point)}return comb}clone(){if(this.inf)return this.curve.point();return this.curve.point(this.x,this.y)}scale(a){return this.toJ().scale(a)}neg(){if(this.inf)return this;return this.curve.point(this.x,this.y.redNeg())}add(p){assert(p instanceof ShortPoint);if(this.inf)return p;if(p.inf)return this;if(this.x.eq(p.x)){if(!this.y.eq(p.y))return this.curve.point();return this.dbl()}if(this.y.eq(p.y)){const nx=this.x.redNeg().redISub(p.x);const ny=this.y.redNeg();return this.curve.point(nx,ny)}const h=this.x.redSub(p.x);const r=this.y.redSub(p.y);const l=r.redDiv(h);const nx=l.redSqr().redISub(this.x).redISub(p.x);const ny=l.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)}dbl(){if(this.inf)return this;if(this.y.isZero())return this.curve.point();const xx=this.x.redSqr();const m=xx.redIMuln(3).redIAdd(this.curve.a);const z=this.y.redMuln(2);const l=m.redDiv(z);const nx=l.redSqr().redISub(this.x).redISub(this.x);const ny=l.redMul(this.x.redSub(nx)).redISub(this.y);return this.curve.point(nx,ny)}dblp(pow){return this.toJ().dblp(pow).toP()}getX(){if(this.inf)throw new Error("Invalid point.");return this.x.fromRed()}getY(){if(this.inf)throw new Error("Invalid point.");return this.y.fromRed()}eq(p){assert(p instanceof ShortPoint);if(this===p)return true;if(this.inf)return p.inf;if(p.inf)return false;return this.x.eq(p.x)&&this.y.eq(p.y)}cmp(point){assert(point instanceof ShortPoint);if(this.inf&&!point.inf)return-1;if(!this.inf&&point.inf)return 1;if(this.inf&&point.inf)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())||this.getY().cmp(point.getY())}isInfinity(){return this.inf}isOrder2(){if(this.inf)return false;return this.y.isZero()}isOdd(){if(this.inf)return false;return this.y.redIsOdd()}isEven(){if(this.inf)return false;return this.y.redIsEven()}isSquare(){if(this.inf)return false;return this.y.redJacobi()!==-1}eqX(x){assert(x instanceof BN);assert(!x.red);if(this.inf)return false;return this.getX().eq(x)}eqR(x){assert(x instanceof BN);assert(!x.red);assert(!this.curve.n.isZero());if(this.inf)return false;return this.getX().imod(this.curve.n).eq(x)}mul(k){return super.mul(k).toP()}muln(k){return super.muln(k).toP()}mulBlind(k,rng){return super.mulBlind(k,rng).toP()}mulAdd(k1,p2,k2){return super.mulAdd(k1,p2,k2).toP()}mulH(){return super.mulH().toP()}div(k){return super.div(k).toP()}divn(k){return super.divn(k).toP()}divH(){return super.divH().toP()}toP(){return this}toJ(){if(this.inf)return this.curve.jpoint();return this.curve.jpoint(this.x,this.y,this.curve.one)}encode(compact){if(compact==null)compact=true;assert(typeof compact==="boolean");const{fieldSize}=this.curve;if(this.inf)throw new Error("Invalid point.");if(compact){const p=bufferExports.Buffer.alloc(1+fieldSize);const x=this.curve.encodeField(this.getX());p[0]=2|this.y.redIsOdd();x.copy(p,1);return p}const p=bufferExports.Buffer.alloc(1+fieldSize*2);const x=this.curve.encodeField(this.getX());const y=this.curve.encodeField(this.getY());p[0]=4;x.copy(p,1);y.copy(p,1+fieldSize);return p}static decode(curve,bytes){assert(curve instanceof ShortCurve);assert(bufferExports.Buffer.isBuffer(bytes));const len=curve.fieldSize;if(bytes.length<1+len)throw new Error("Not a point.");const form=bytes[0];switch(form){case 2:case 3:{if(bytes.length!==1+len)throw new Error("Invalid point size for compressed.");const x=curve.decodeField(bytes.slice(1,1+len));if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");const p=curve.pointFromX(x,form===3);assert(!p.isInfinity());return p}case 4:case 6:case 7:{if(bytes.length!==1+len*2)throw new Error("Invalid point size for uncompressed.");const x=curve.decodeField(bytes.slice(1,1+len));const y=curve.decodeField(bytes.slice(1+len,1+2*len));if(x.cmp(curve.p)>=0||y.cmp(curve.p)>=0)throw new Error("Invalid point.");if(form!==4&&form!==(6|y.isOdd()))throw new Error("Invalid hybrid encoding.");const p=curve.point(x,y);if(!p.validate())throw new Error("Invalid point.");assert(!p.isInfinity());return p}default:{throw new Error("Unknown point format.")}}}encodeX(){return this.curve.encodeField(this.getX())}static decodeEven(curve,bytes){assert(curve instanceof ShortCurve);const x=curve.decodeField(bytes);if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");return curve.pointFromX(x,false)}static decodeSquare(curve,bytes){assert(curve instanceof ShortCurve);const x=curve.decodeField(bytes);if(x.cmp(curve.p)>=0)throw new Error("Invalid point.");return curve.pointFromX(x)}toJSON(pre){if(this.inf)return[];const x=this.getX().toJSON();const y=this.getY().toJSON();if(pre===true&&this.pre)return[x,y,this.pre.toJSON()];return[x,y]}toPretty(){if(this.inf)return[];const size=this.curve.fieldSize*2;const x=toPretty(this.getX(),size);const y=toPretty(this.getY(),size);return[x,y]}static fromJSON(curve,json){assert(curve instanceof ShortCurve);assert(Array.isArray(json));assert(json.length===0||json.length===2||json.length===3);if(json.length===0)return curve.point();const x=BN.fromJSON(json[0]);const y=BN.fromJSON(json[1]);const point=curve.point(x,y);if(json.length>2&&json[2]!=null)point.pre=Precomp.fromJSON(point,json[2]);return point}[custom](){if(this.inf)return"";return""}}class JPoint extends Point{constructor(curve,x,y,z){assert(curve instanceof ShortCurve);super(curve,types.JACOBIAN);this.x=this.curve.one;this.y=this.curve.one;this.z=this.curve.zero;this.zOne=false;if(x!=null)this._init(x,y,z)}_init(x,y,z){assert(x instanceof BN);assert(y instanceof BN);assert(z==null||z instanceof BN);this.x=x;this.y=y;this.z=z||this.curve.one;if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z.eq(this.curve.one)}clone(){return this.curve.jpoint(this.x,this.y,this.z)}validate(){const{a,b}=this.curve;if(this.isInfinity())return true;if(this.zOne)return this.curve.validate(this.toP());const lhs=this.y.redSqr();const x3=this.x.redSqr().redMul(this.x);const z2=this.z.redSqr();const z4=z2.redSqr();const z6=z4.redMul(z2);const rhs=x3.redIAdd(b.redMul(z6));if(!this.curve.zeroA){if(this.curve.threeA)rhs.redIAdd(z4.redIMuln(-3).redMul(this.x));else rhs.redIAdd(a.redMul(z4).redMul(this.x))}return lhs.eq(rhs)}normalize(){if(this.zOne)return this;if(this.isInfinity())return this;const a=this.z.redInvert();const aa=a.redSqr();this.x=this.x.redMul(aa);this.y=this.y.redMul(aa).redMul(a);this.z=this.curve.one;this.zOne=true;return this}scale(a){assert(a instanceof BN);if(this.isInfinity())return this.curve.jpoint();const aa=a.redSqr();const nx=this.x.redMul(aa);const ny=this.y.redMul(aa).redMul(a);const nz=this.z.redMul(a);return this.curve.jpoint(nx,ny,nz)}neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}add(p){assert(p instanceof Point);if(p.type===types.AFFINE)return this._mixedAdd(p);return this._add(p)}_add(p){assert(p instanceof JPoint);if(this.isInfinity())return p;if(p.isInfinity())return this;if(this.zOne)return p._addJA(this);if(p.zOne)return this._addJA(p);return this._addJJ(p)}_mixedAdd(p){assert(p instanceof ShortPoint);if(this.isInfinity())return p.toJ();if(p.isInfinity())return this;return this._addJA(p)}_addJJ(p){const z1z1=this.z.redSqr();const z2z2=p.z.redSqr();const u1=this.x.redMul(z2z2);const u2=p.x.redMul(z1z1);const s1=this.y.redMul(p.z).redMul(z2z2);const s2=p.y.redMul(this.z).redMul(z1z1);const h=u2.redISub(u1);const r=s2.redISub(s1);if(h.isZero()){if(!r.isZero())return this.curve.jpoint();return this.dbl()}const hh=h.redSqr();const hhh=h.redMul(hh);const v=u1.redMul(hh);const nx=r.redSqr().redISub(hhh).redISub(v).redISub(v);const ny=r.redMul(v.redISub(nx)).redISub(s1.redMul(hhh));const nz=this.z.redMul(p.z).redMul(h);return this.curve.jpoint(nx,ny,nz)}_addJA(p){const z1z1=this.z.redSqr();const u2=p.x.redMul(z1z1);const s2=p.y.redMul(this.z).redMul(z1z1);const h=u2.redISub(this.x);const r=s2.redISub(this.y).redIMuln(2);if(h.isZero()){if(!r.isZero())return this.curve.jpoint();return this.dbl()}const i=h.redMuln(2).redSqr();const j=h.redMul(i);const v=this.x.redMul(i);const nx=r.redSqr().redISub(j).redISub(v).redISub(v);const ny=r.redMul(v.redISub(nx)).redISub(this.y.redMul(j).redIMuln(2));const nz=this.z.redMul(h).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}dbl(){if(this.isInfinity())return this;if(this.y.isZero())return this.curve.jpoint();if(this.curve.zeroA)return this._dbl0();if(this.curve.threeA)return this._dbl3();return this._dblJ()}_dblJ(){const xx=this.x.redSqr();const yy=this.y.redSqr();const zz=this.z.redSqr();const s=this.x.redMul(yy).redIMuln(4);const m=xx.redIMuln(3).redIAdd(this.curve.a.redMul(zz.redSqr()));const t=m.redSqr().redISub(s).redISub(s);const nx=t;const ny=m.redMul(s.redISub(t)).redISub(yy.redSqr().redIMuln(8));const nz=this.y.redMul(this.z).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}_dbl0(){const a=this.x.redSqr();const b=this.y.redSqr();const c=b.redSqr();const xb2=b.redIAdd(this.x).redSqr();const d=xb2.redISub(a).redISub(c).redIMuln(2);const e=a.redIMuln(3);const f=e.redSqr();const nx=f.redISub(d).redISub(d);const ny=e.redMul(d.redISub(nx)).redISub(c.redIMuln(8));const nz=this.y.redMul(this.z).redIMuln(2);return this.curve.jpoint(nx,ny,nz)}_dbl3(){const delta=this.z.redSqr();const gamma=this.y.redSqr();const beta=this.x.redMul(gamma);const xmdelta=this.x.redSub(delta);const xpdelta=this.x.redAdd(delta);const alpha=xmdelta.redMul(xpdelta).redIMuln(3);const beta4=beta.redIMuln(4);const beta8=beta4.redMuln(2);const gamma28=gamma.redSqr().redIMuln(8);const nx=alpha.redSqr().redISub(beta8);const nz=this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);const ny=alpha.redMul(beta4.redISub(nx)).redISub(gamma28);return this.curve.jpoint(nx,ny,nz)}getX(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.x.fromRed()}getY(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.y.fromRed()}eq(p){assert(p instanceof JPoint);if(this===p)return true;if(this.isInfinity())return p.isInfinity();if(p.isInfinity())return false;if(this.z.eq(p.z)){return this.x.eq(p.x)&&this.y.eq(p.y)}const zz1=this.z.redSqr();const zz2=p.z.redSqr();const x1=this.x.redMul(zz2);const x2=p.x.redMul(zz1);if(!x1.eq(x2))return false;const zzz1=zz1.redMul(this.z);const zzz2=zz2.redMul(p.z);const y1=this.y.redMul(zzz2);const y2=p.y.redMul(zzz1);return y1.eq(y2)}cmp(point){assert(point instanceof JPoint);const inf1=this.isInfinity();const inf2=point.isInfinity();if(inf1&&!inf2)return-1;if(!inf1&&inf2)return 1;if(inf1&&inf2)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())||this.getY().cmp(point.getY())}isInfinity(){return this.z.isZero()}isOrder2(){if(this.isInfinity())return false;return this.y.isZero()}isOdd(){if(this.isInfinity())return false;this.normalize();return this.y.redIsOdd()}isEven(){if(this.isInfinity())return false;this.normalize();return this.y.redIsEven()}isSquare(){if(this.isInfinity())return false;return this.y.redMul(this.z).redJacobi()!==-1}eqX(x){assert(x instanceof BN);assert(!x.red);if(this.isInfinity())return false;const zz=this.z.redSqr();const rx=x.toRed(this.curve.red).redMul(zz);return this.x.eq(rx)}eqR(x){assert(x instanceof BN);assert(!x.red);if(!this.curve.smallGap)return this.toP().eqR(x);if(this.isInfinity())return false;if(x.cmp(this.curve.p)>=0)return false;const zz=this.z.redSqr();const rx=x.toRed(this.curve.red).redMul(zz);if(this.x.eq(rx))return true;if(this.curve.highOrder)return false;if(x.cmp(this.curve.pmodn)>=0)return false;const rn=this.curve.redN.redMul(zz);rx.redIAdd(rn);return this.x.eq(rx)}toP(){if(this.isInfinity())return this.curve.point();this.normalize();return this.curve.point(this.x,this.y)}toJ(){return this}encode(compact){return this.toP().encode(compact)}static decode(curve,bytes){return ShortPoint.decode(curve,bytes).toJ()}encodeX(){return this.toP().encodeX()}static decodeEven(curve,bytes){return ShortPoint.decodeEven(curve,bytes).toJ()}static decodeSquare(curve,bytes){return ShortPoint.decodeSquare(curve,bytes).toJ()}toJSON(pre){return this.toP().toJSON(pre)}toPretty(){return this.toP().toPretty()}static fromJSON(curve,json){return ShortPoint.fromJSON(curve,json).toJ()}[custom](){if(this.isInfinity())return"";return""}}class MontCurve extends Curve{constructor(conf){super(MontPoint,"mont",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.b=BN.fromJSON(conf.b).toRed(this.red);this.bi=this.b.redInvert();this.a2=this.a.redAdd(this.two);this.a24=this.a2.redMul(this.i4);this.a3=this.a.redMul(this.i3);this.a0=this.a.redMul(this.bi);this.b0=this.bi.redSqr();this._finalize(conf)}static _isomorphism(curveA,curveB,customB){assert(curveA instanceof BN);assert(curveB instanceof BN);assert(customB instanceof BN);const a=curveA.clone();const b=customB.clone();const c=curveB.redDiv(customB);if(c.redJacobi()!==1)throw new Error("Invalid `b` coefficient.");return[a,b]}_short(a0,odd){const{a,b,three}=this;const a2=a.redSqr();const a3=a2.redMul(a);const b2=b.redSqr();const b3=b2.redMul(b);const n0=three.redSub(a2);const d0=b2.redMuln(3);const n1=a3.redMuln(2).redISub(a.redMuln(9));const d1=b3.redMuln(27);const wa=n0.redDiv(d0);const wb=n1.redDiv(d1);if(a0!=null)return ShortCurve._isomorphism(wa,wb,a0,odd);return[wa,wb]}_mont(b0){return MontCurve._isomorphism(this.a,this.b,b0)}_edwards(a0,invert=false){assert(typeof invert==="boolean");const{two,bi}=this;const a=this.a.redAdd(two).redMul(bi);const d=this.a.redSub(two).redMul(bi);if(invert)a.swap(d);if(a0!=null)return EdwardsCurve._isomorphism(a,d,a0);return[a,d]}_scaleShort(curve){assert(curve instanceof ShortCurve);const[u2,u3]=curve._scale(this);return[this.field(u2.redInvert()),this.field(u3.redInvert())]}_scaleMont(curve){assert(curve instanceof MontCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this.field(curve.b).redDivSqrt(this.b);return this.g.y.redDiv(this.field(curve.g.y))}_scaleEdwards(curve,invert){assert(curve instanceof EdwardsCurve);const c=curve._scale(this,invert);return this.field(c)}_solveY0(x){assert(x instanceof BN);const a=this.a0;const b=this.b0;const x2=x.redSqr();const x3=x2.redMul(x);const y2=x3.redIAdd(a.redMul(x2)).redIAdd(b.redMul(x));return y2}_elligator2(u){const lhs=this.a0.redNeg();const rhs=this.one.redAdd(this.z.redMul(u.redSqr()));if(rhs.isZero())rhs.inject(this.one);const x1=lhs.redMul(rhs.redInvert());const x2=x1.redNeg().redISub(this.a0);const y1=this._solveY0(x1);const y2=this._solveY0(x2);const alpha=y1.redIsSquare()|0;const x0=[x1,x2][alpha^1];const y0=[y1,y2][alpha^1].redSqrt();if(y0.redIsOdd()!==u.redIsOdd())y0.redINeg();const x=this.b.redMul(x0);const y=this.b.redMul(y0);return this.point(x,y)}_invert2(p,hint){const{x,y}=p;const r=hint&1;const x0=x.redMul(this.bi);const y0=y.redMul(this.bi);const n=x0.redAdd(this.a0);const d=x0;const lhs=[n,d][r].redINeg();const rhs=[d,n][r].redMul(this.z);const u=lhs.redDivSqrt(rhs);if(u.redIsOdd()!==y0.redIsOdd())u.redINeg();return u}isElliptic(){const a2=this.a.redSqr();const d=this.b.redMul(a2.redSub(this.four));return!d.isZero()}jinv(){const{a,three,four}=this;const a2=a.redSqr();const t0=a2.redSub(three);const lhs=t0.redPown(3).redIMuln(256);const rhs=a2.redSub(four);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}point(x,y){return new MontPoint(this,x,y)}jpoint(x,y,z){assert(x==null&&y==null&&z==null);return this.point()}xpoint(x,z){return new XPoint(this,x,z)}solveY2(x){assert(x instanceof BN);const x2=x.redSqr();const x3=x2.redMul(x);const by2=x3.redIAdd(this.a.redMul(x2)).redIAdd(x);const y2=by2.redMul(this.bi);return y2}validate(point){assert(point instanceof MontPoint);if(point.isInfinity())return true;const{x,y}=point;const y2=this.solveY2(x);return y.redSqr().eq(y2)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(y.isZero()&&sign)throw new Error("Invalid point.");if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}isIsomorphic(curve,invert){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;if(curve.type==="mont"){const a=this.field(curve.a);const b=this.field(curve.b);if(!this.a.eq(a))return false;if(this.b.isZero())return false;const c=b.redDiv(this.b);return c.redJacobi()===1}return curve.isIsomorphic(this,invert)}isIsogenous(curve){assert(curve instanceof Curve);if(curve.type==="mont")return false;return curve.isIsogenous(this)}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const{a3,b}=this;const[u2,u3]=this._scale(point.curve);const x=this.field(point.x).redMul(u2);const y=this.field(point.y).redMul(u3);const u=b.redMul(x).redISub(a3);const v=b.redMul(y);return this.point(u,v)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();const c=this._scale(point.curve);const u=this.field(point.x);const v=this.field(point.y);const nu=u;const nv=c.redMul(v);return this.point(nu,nv)}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);assert(point.curve.p.eq(this.p));const x=this.field(point.x);const y=this.field(point.y);const z=this.field(point.z);if(this.isIsogenous(point.curve)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=z.redSqr().redIMuln(2);const uu=y.redSqr();const uz=x.redSqr();const vv=c.redISub(uz).redISub(uu).redMul(y);const vz=uz.redMul(x);return this.cpoint(uu,uz,vv,vz)}if(this.isIsomorphic(point.curve,true)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=this._scale(point.curve,true);const uu=y.redAdd(z);const uz=y.redSub(z);const vv=c.redMul(z).redMul(uu);const vz=x.redMul(uz);return this.cpoint(uu,uz,vv,vz)}if(this.isIsomorphic(point.curve,false)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.zero);const c=this._scale(point.curve,false);const uu=z.redAdd(y);const uz=z.redSub(y);const vv=c.redMul(z).redMul(uu);const vz=x.redMul(uz);return this.cpoint(uu,uz,vv,vz)}throw new Error("Not implemented.")}pointFromUniform(u){assert(u instanceof BN);if(this.z.isZero()||this.a.isZero())throw new Error("Not implemented.");return this._elligator2(u)}pointToUniform(p,hint){assert(p instanceof MontPoint);assert(hint>>>0===hint);if(this.z.isZero()||this.a.isZero())throw new Error("Not implemented.");if(p.isInfinity())throw new Error("Invalid point.");const i=(hint>>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);return wrapErrors(()=>{return this._invert2(q,hint)})}decodePoint(bytes,sign){return MontPoint.decode(this,bytes,sign)}encodeX(point){assert(point instanceof XPoint);return point.encode()}decodeX(bytes){return XPoint.decode(this,bytes)}toShort(a0,odd,sign=null){const[a,b]=this._short(a0,odd);const curve=new ShortCurve({red:this.red,prime:this.prime,p:this.p,a:a,b:b,n:this.n,h:this.h});if(sign!=null){const[,u3]=curve._scale(this);if(u3.redIsOdd()!==sign)u3.redINeg()}if(!this.g.isInfinity())curve.g=curve.pointFromMont(this.g);for(let i=0;i";return""}}class XPoint extends Point{constructor(curve,x,z){assert(curve instanceof MontCurve);super(curve,types.PROJECTIVE);this.x=this.curve.one;this.z=this.curve.zero;if(x!=null)this._init(x,z)}_init(x,z){assert(x instanceof BN);assert(z==null||z instanceof BN);this.x=x;this.z=z||this.curve.one;if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}clone(){return this.curve.xpoint(this.x,this.z)}precompute(power,rng){return this}validate(){if(this.isInfinity())return true;const{x,z}=this;const x2=x.redSqr();const x3=x2.redMul(x);const z2=z.redSqr();const ax2=this.curve.a.redMul(x2).redMul(z);const by2=x3.redIAdd(ax2).redIAdd(x.redMul(z2));const y2=by2.redMul(this.curve.bi);return y2.redMul(z).redJacobi()!==-1}normalize(){if(this.isInfinity())return this;if(this.z.eq(this.curve.one))return this;this.x=this.x.redDiv(this.z);this.z=this.curve.one;return this}scale(a){assert(a instanceof BN);if(this.isInfinity())return this.curve.xpoint();const nx=this.x.redMul(a);const nz=this.z.redMul(a);return this.curve.xpoint(nx,nz)}neg(){return this}dbl(){const a=this.x.redAdd(this.z);const aa=a.redSqr();const b=this.x.redSub(this.z);const bb=b.redSqr();const c=aa.redSub(bb);const nx=aa.redMul(bb);const nz=c.redMul(bb.redIAdd(this.curve.a24.redMul(c)));return this.curve.xpoint(nx,nz)}diffAddDbl(p2,p3){assert(p2 instanceof XPoint);assert(p3 instanceof XPoint);const a=p2.x.redAdd(p2.z);const aa=a.redSqr();const b=p2.x.redSub(p2.z);const bb=b.redSqr();const e=aa.redSub(bb);const c=p3.x.redAdd(p3.z);const d=p3.x.redSub(p3.z);const da=d.redMul(a);const cb=c.redMul(b);const x5=this.z.redMul(da.redAdd(cb).redSqr());const z5=this.x.redMul(da.redISub(cb).redSqr());const x4=aa.redMul(bb);const z4=e.redMul(bb.redIAdd(this.curve.a24.redMul(e)));return[this.curve.xpoint(x4,z4),this.curve.xpoint(x5,z5)]}getX(){if(this.isInfinity())throw new Error("Invalid point.");this.normalize();return this.x.fromRed()}getY(sign){return this.toP(sign).getY()}eq(p){assert(p instanceof XPoint);if(this===p)return true;if(this.isInfinity())return p.isInfinity();if(p.isInfinity())return false;if(this.z.eq(p.z))return this.x.eq(p.x);const x1=this.x.redMul(p.z);const x2=p.x.redMul(this.z);return x1.eq(x2)}cmp(point){assert(point instanceof XPoint);const inf1=this.isInfinity();const inf2=point.isInfinity();if(inf1&&!inf2)return-1;if(!inf1&&inf2)return 1;if(inf1&&inf2)return 0;return this.order().cmp(point.order())||this.getX().cmp(point.getX())}isInfinity(){return this.z.isZero()}isOrder2(){if(this.isInfinity())return false;return this.x.isZero()}isOdd(){return false}isEven(){return false}hasTorsion(){if(this.isInfinity())return false;if(this.x.isZero())return true;return super.hasTorsion()}order(){try{return this.toP().order()}catch(e){return new BN(1)}}jmul(k){assert(k instanceof BN);assert(!k.red);const bits=k.bitLength();let a=this.curve.xpoint();let b=this;for(let i=bits-1;i>=0;i--){const bit=k.bit(i);if(bit===0)[a,b]=this.diffAddDbl(a,b);else[b,a]=this.diffAddDbl(b,a)}return a}jmulBlind(k,rng){if(!rng)return this.jmul(k);return this.randomize(rng).jmul(k)}jmulAdd(k1,p2,k2){throw new Error("Not implemented.")}toP(sign=null){assert(sign==null||typeof sign==="boolean");if(this.isInfinity())return this.curve.point();this.normalize();return this.curve.pointFromX(this.x,sign)}toJ(){return this}toX(){return this}key(){if(this.isInfinity())return`${this.curve.uid}:oo`;this.normalize();const x=this.getX().toString(16);return`${this.curve.uid}:${x}`}encode(){return this.curve.encodeField(this.getX())}static decode(curve,bytes){assert(curve instanceof MontCurve);const x=curve.decodeField(bytes);x.iumaskn(curve.fieldBits);const p=curve.xpoint(x,curve.one);assert(!p.isInfinity());return p}toJSON(pre){return this.toP().toJSON(pre)}toPretty(){return this.toP().toPretty()}static fromJSON(curve,json){return MontPoint.fromJSON(curve,json).toX()}[custom](){if(this.isInfinity())return"";return""}}class EdwardsCurve extends Curve{constructor(conf){super(EdwardsPoint,"edwards",conf);this.a=BN.fromJSON(conf.a).toRed(this.red);this.d=BN.fromJSON(conf.d).toRed(this.red);this.s=BN.fromJSON(conf.s||"0").toRed(this.red);this.si=this.s.isZero()?this.zero:this.s.redInvert();this.k=this.d.redMuln(2);this.smi=-this.d.redNeg().word(0);this.ad6=this.a.redAdd(this.d).redMul(this.i6);this.twisted=!this.a.eq(this.one);this.oneA=this.a.eq(this.one);this.mOneA=this.a.eq(this.one.redNeg());this.smallD=this.prime!=null&&this.d.redNeg().length===1;this.alt=null;this._finalize(conf)}static _isomorphism(curveA,curveD,customA){assert(curveA instanceof BN);assert(curveD instanceof BN);assert(customA instanceof BN);const a=customA.clone();const d=customA.redMul(curveD).redDiv(curveA);const c=curveA.redDiv(customA);if(c.redJacobi()!==1)throw new Error("Invalid `a` coefficient.");return[a,d]}_short(a0,odd){const{a,d}=this;const a2=a.redSqr();const a3=a2.redMul(a);const d2=d.redSqr();const d3=d2.redMul(d);const ad14=a.redMul(d).redIMuln(14);const a2d=a2.redMul(d);const ad2=a.redMul(d2);const t0=a2d.redIAdd(ad2).redIMuln(33);const wa=a2.redAdd(ad14).redIAdd(d2).redDivn(-48);const wb=t0.redISub(a3).redISub(d3).redDivn(864);if(a0!=null)return ShortCurve._isomorphism(wa,wb,a0,odd);return[wa,wb]}_mont(b0,invert=false){assert(typeof invert==="boolean");let apd,amd;if(invert){apd=this.d.redAdd(this.a);amd=this.d.redSub(this.a)}else{apd=this.a.redAdd(this.d);amd=this.a.redSub(this.d)}const z=amd.redInvert();const a=apd.redMuln(2).redMul(z);const b=z.redMuln(4);if(b0!=null)return MontCurve._isomorphism(a,b,b0);return[a,b]}_edwards(a0){return EdwardsCurve._isomorphism(this.a,this.d,a0)}_scaleShort(curve){assert(curve instanceof ShortCurve);const[u2,u3]=curve._scale(this);return[this.field(u2.redInvert()),this.field(u3.redInvert())]}_scaleMont(curve,invert=false){assert(curve instanceof MontCurve);assert(typeof invert==="boolean");if(this.g.isInfinity()||curve.g.isInfinity()){const[a]=curve._edwards(null,invert);return this.field(a).redDivSqrt(this.a)}const x=curve.g.x.redDiv(curve.g.y);return this.g.x.redDiv(this.field(x))}_scaleEdwards(curve){assert(curve instanceof EdwardsCurve);if(this.g.isInfinity()||curve.g.isInfinity())return this.field(curve.a).redDivSqrt(this.a);return this.g.x.redDiv(this.field(curve.g.x))}_mulA(num){assert(num instanceof BN);if(this.oneA)return num.clone();if(this.mOneA)return num.redNeg();return this.a.redMul(num)}_mulD(num){assert(num instanceof BN);if(this.smallD)return num.redMuln(this.smi);return this.d.redMul(num)}_elligator1(t){const{s,si,i2,one,two}=this;const c=si.redSqr().redIMuln(2);const ci=s.redSqr().redMul(i2);const ci2=ci.redSqr();const r=c.redAdd(ci);const r2=r.redSqr().redISub(two);const cm1=c.redSub(one);const uu=one.redSub(t);const uz=one.redAdd(t);const u=uz.isZero()?uz:uu.redDiv(uz);const u2=u.redSqr();const u3=u2.redMul(u);const u5=u3.redMul(u2);const v=u5.redAdd(r2.redMul(u3)).redIAdd(u);const f0=this.field(v.redJacobi());const f1=this.field(u2.redAdd(ci2).redJacobi());const f2=f0.redMul(f1);const X=f0.redMul(u);const Y=f0.redMul(v).redSqrt().redMul(f2);const X1=one.redAdd(X);const rX=r.redMul(X);const X12=X1.redSqr();const xx=cm1.redMul(s).redMul(X).redMul(X1);const xz=u.isZero()?this.one:Y;const yy=rX.redSub(X12);const yz=rX.redAdd(X12);return this.cpoint(xx,xz,yy,yz)}_invert1(p,hint){const{s,si,i2,one}=this;const{x,y,z}=p;const sign=hint&1;const c=si.redSqr().redIMuln(2);const ci=s.redSqr().redMul(i2);const ci2=ci.redSqr();const r=c.redAdd(ci);const cm1=c.redSub(one);const nn=y.redSub(z);const nz=y.redAdd(z).redIMuln(2);const n=nz.isZero()?nz:nn.redDiv(nz);const nr1=one.redAdd(n.redMul(r));const w2=nr1.redSqr().redISub(one);const w=w2.redSqrt();const X=w.redSub(nr1);const X1=one.redAdd(X);const YY=cm1.redMul(s).redMul(X).redMul(X1);const Y=YY.redMul(x.redMul(z));const X2=X.redSqr().redIAdd(ci2);const Z=this.field(Y.redMul(X2).redJacobi());const u=Z.redMul(X);const tt=one.redSub(u);const tz=one.redAdd(u);const t=tz.isZero()?tz:tt.redDiv(tz);if(t.redIsOdd()!==Boolean(sign))t.redINeg();return t}_alt(){if(!this.alt)this.alt=this.toMont();return this.alt}isElliptic(){const ad=this.a.redMul(this.d);const amd=this.a.redSub(this.d);return!ad.redMul(amd).isZero()}jinv(){const{a,d}=this;const ad=a.redMul(d);const amd4=a.redSub(d).redPown(4);const a2=a.redSqr();const d2=d.redSqr();const t0=a2.redAdd(ad.redMuln(14)).redIAdd(d2);const lhs=t0.redPown(3).redIMuln(16);const rhs=ad.redMul(amd4);if(rhs.isZero())throw new Error("Curve is not elliptic.");return lhs.redDiv(rhs).fromRed()}isComplete(){return this.a.redJacobi()===1&&this.d.redJacobi()===-1}point(x,y,z,t){return new EdwardsPoint(this,x,y,z,t)}jpoint(x,y,z){assert(x==null&&y==null&&z==null);return this.point()}cpoint(xx,xz,yy,yz){assert(xx instanceof BN);assert(xz instanceof BN);assert(yy instanceof BN);assert(yz instanceof BN);const x=xx.redMul(yz);const y=yy.redMul(xz);const z=xz.redMul(yz);const t=xx.redMul(yy);return this.point(x,y,z,t)}solveX2(y){assert(y instanceof BN);const y2=y.redSqr();const rhs=this._mulD(y2).redISub(this.a);const lhs=y2.redISub(this.one);const x2=lhs.redDiv(rhs);return x2}solveX(y){const y2=y.redSqr();const rhs=this._mulD(y2).redISub(this.a);const lhs=y2.redISub(this.one);return lhs.redDivSqrt(rhs)}solveY2(x){assert(x instanceof BN);const x2=x.redSqr();const lhs=this._mulA(x2).redISub(this.one);const rhs=this._mulD(x2).redISub(this.one);const y2=lhs.redDiv(rhs);return y2}solveY(x){const x2=x.redSqr();const lhs=this._mulA(x2).redISub(this.one);const rhs=this._mulD(x2).redISub(this.one);return lhs.redDivSqrt(rhs)}validate(point){assert(point instanceof EdwardsPoint);if(point.zOne){const x2=point.x.redSqr();const y2=point.y.redSqr();const dxy=this._mulD(x2).redMul(y2);const lhs=this._mulA(x2).redIAdd(y2);const rhs=this.one.redAdd(dxy);const tz=point.t;const xy=point.x.redMul(point.y);return lhs.eq(rhs)&&tz.eq(xy)}const x2=point.x.redSqr();const y2=point.y.redSqr();const z2=point.z.redSqr();const z4=z2.redSqr();const dxy=this._mulD(x2).redMul(y2);const lhs=this._mulA(x2).redIAdd(y2).redMul(z2);const rhs=z4.redIAdd(dxy);const tz=point.t.redMul(point.z);const xy=point.x.redMul(point.y);return lhs.eq(rhs)&&tz.eq(xy)}pointFromX(x,sign=null){assert(x instanceof BN);assert(sign==null||typeof sign==="boolean");if(!x.red)x=x.toRed(this.red);const y=this.solveY(x);if(sign!=null){if(y.isZero()&&sign)throw new Error("Invalid point.");if(y.redIsOdd()!==sign)y.redINeg()}return this.point(x,y)}pointFromY(y,sign=null){assert(y instanceof BN);assert(sign==null||typeof sign==="boolean");if(!y.red)y=y.toRed(this.red);const x=this.solveX(y);if(sign!=null){if(x.isZero()&&sign)throw new Error("Invalid point.");if(x.redIsOdd()!==sign)x.redINeg()}return this.point(x,y)}isIsomorphic(curve,invert=false){assert(curve instanceof Curve);assert(typeof invert==="boolean");if(!curve.p.eq(this.p))return false;if(curve.type==="short")return curve.isIsomorphic(this);if(curve.type==="mont"){const a=this.field(curve.a);let apd,amd;if(invert){apd=this.d.redAdd(this.a);amd=this.d.redSub(this.a)}else{apd=this.a.redAdd(this.d);amd=this.a.redSub(this.d)}return a.redMul(amd).eq(apd.redIMuln(2))}if(curve.type==="edwards"){const a=this.field(curve.a);const d=this.field(curve.d);return this.a.redMul(d).eq(a.redMul(this.d))}return false}isIsogenous(curve){assert(curve instanceof Curve);if(!curve.p.eq(this.p))return false;if(curve.type==="mont"){if(!this.a.eq(this.one))return false;const a=this.field(curve.a);const b=this.field(curve.b);const d24=this.two.redSub(this.d.redMuln(4));return a.eq(d24)&&b.eq(this.one)}if(curve.type==="edwards"){const a=this.field(curve.a);const d=this.field(curve.d);return a.eq(this.a.redNeg())&&d.eq(this.d.redSub(this.a))}return false}pointFromShort(point){assert(point instanceof ShortPoint);if(this.isIsomorphic(point.curve)){if(point.isInfinity())return this.point();if(point.y.isZero())return this.point(this.zero,this.one.redNeg());const{a,d}=this;const[u2,u3]=this._scale(point.curve);const a5=a.redMuln(5);const d5=d.redMuln(5);const x=this.field(point.x).redMul(u2);const y=this.field(point.y).redMul(u3);const x6=x.redMuln(6);const x12=x.redMuln(12);const xx=x6.redSub(a).redISub(d);const xz=y.redMuln(6);const yy=x12.redSub(a5).redIAdd(d);const yz=x12.redAdd(a).redISub(d5);return this.cpoint(xx,xz,yy,yz)}throw new Error("Not implemented.")}pointFromMont(point){assert(point instanceof MontPoint);assert(point.curve.p.eq(this.p));const u=this.field(point.x);const v=this.field(point.y);if(this.isIsogenous(point.curve)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point();const u2=u.redSqr();const u3=u2.redMul(u);const u4=u3.redMul(u);const u5=u4.redMul(u);const v2=v.redSqr();const a=v.redMuln(4);const b=u2.redSub(this.one);const c=u2.redMuln(2);const d=v2.redMuln(4);const e=u3.redIMuln(2);const f=u.redMul(v2).redIMuln(4);const g=u2.redMul(v2).redIMuln(2);const h=v2.redIMuln(2);const xx=a.redMul(b);const xz=u4.redISub(c).redIAdd(d).redIAdd(this.one);const yy=u5.redSub(e).redISub(f).redIAdd(u).redINeg();const yz=u5.redISub(g).redISub(e).redISub(h).redIAdd(u);return this.cpoint(xx,xz,yy,yz).divn(4)}if(this.isIsomorphic(point.curve,true)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.one.redNeg());const c=this._scale(point.curve,true);const xx=c.redMul(u);const xz=v;const yy=u.redAdd(this.one);const yz=u.redSub(this.one);return this.cpoint(xx,xz,yy,yz)}if(this.isIsomorphic(point.curve,false)){if(point.isInfinity())return this.point();if(point.x.isZero())return this.point(this.zero,this.one.redNeg());const c=this._scale(point.curve,false);const xx=c.redMul(u);const xz=v;const yy=u.redSub(this.one);const yz=u.redAdd(this.one);return this.cpoint(xx,xz,yy,yz)}throw new Error("Not implemented.")}pointFromEdwards(point){assert(point instanceof EdwardsPoint);assert(point.curve.p.eq(this.p));const a=this.field(point.curve.a);const x=this.field(point.x);const y=this.field(point.y);const z=this.field(point.z);const t=this.field(point.t);if(this.isIsogenous(point.curve)){const xy=x.redMul(y);const x2=x.redSqr();const y2=y.redSqr();const z2=z.redSqr();const ax2=a.redMul(x2);const xx=xy.redIMuln(2);const xz=y2.redSub(ax2);const yy=y2.redAdd(ax2);const yz=z2.redIMuln(2).redISub(yy);const p=this.cpoint(xx,xz,yy,yz);return!this.twisted?p.divn(4):p}if(this.isIsomorphic(point.curve)){const c=this._scale(point.curve);const nx=c.redMul(x);const ny=y;const nz=z;const nt=c.redMul(t);return this.point(nx,ny,nz,nt)}throw new Error("Not implemented.")}pointFromUniform(u,curve=null){assert(u instanceof BN);assert(u.red===this.red);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const u0=curve.field(u);const p0=curve.pointFromUniform(u0);return this.pointFromMont(p0)}pointToUniform(p,hint,curve=null){assert(p instanceof EdwardsPoint);assert(hint>>>0===hint);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const i=(hint>>4&15)%this.torsion.length;const q=p.add(this.torsion[i]);const p0=curve.pointFromEdwards(q);const u0=curve.pointToUniform(p0,hint&15);return this.field(u0)}pointFromHash(bytes,pake,curve=null){assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const p0=curve.pointFromHash(bytes,pake);return this.pointFromMont(p0)}pointToHash(p,subgroup,rng,curve=null){assert(p instanceof EdwardsPoint);assert(subgroup>>>0===subgroup);assert(curve==null||curve instanceof MontCurve);if(!curve)curve=this._alt();const i=subgroup%this.torsion.length;const q=p.add(this.torsion[i]);const p0=curve.pointFromEdwards(q);return curve.pointToHash(p0,0,rng)}decodePoint(bytes){return EdwardsPoint.decode(this,bytes)}toShort(a0,odd,sign=null){const[a,b]=this._short(a0,odd);const curve=new ShortCurve({red:this.red,prime:this.prime,p:this.p,a:a,b:b,n:this.n,h:this.h});if(sign!=null){const[,u3]=curve._scale(this);if(u3.redIsOdd()!==sign)u3.redINeg()}if(!this.g.isInfinity())curve.g=curve.pointFromEdwards(this.g);for(let i=0;i=0)throw new Error("Invalid point.");return curve.pointFromY(y,sign)}toJSON(pre){if(this.isInfinity())return[];const x=this.getX().toJSON();const y=this.getY().toJSON();if(pre===true&&this.pre)return[x,y,this.pre.toJSON()];return[x,y]}toPretty(){const size=this.curve.fieldSize*2;const x=toPretty(this.getX(),size);const y=toPretty(this.getY(),size);return[x,y]}static fromJSON(curve,json){assert(curve instanceof EdwardsCurve);assert(Array.isArray(json));assert(json.length===0||json.length===2||json.length===3);if(json.length===0)return curve.point();const x=BN.fromJSON(json[0]);const y=BN.fromJSON(json[1]);const point=curve.point(x,y);if(json.length>2&&json[2]!=null)point.pre=Precomp.fromJSON(point,json[2]);return point}[custom](){if(this.isInfinity())return"";return""}}class Precomp{constructor(){this.naf=null;this.windows=null;this.doubles=null;this.blinding=null;this.beta=null}map(func){assert(typeof func==="function");const out=new this.constructor;if(this.naf)out.naf=this.naf.map(func);if(this.doubles)out.doubles=this.doubles.map(func);return out}toJSON(){return{naf:this.naf?this.naf.toJSON():null,windows:this.windows?this.windows.toJSON():null,doubles:this.doubles?this.doubles.toJSON():null,blinding:this.blinding?this.blinding.toJSON():undefined}}fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");if(json.naf!=null)this.naf=NAF.fromJSON(point,json.naf);if(json.windows!=null)this.windows=Windows.fromJSON(point,json.windows);if(json.doubles!=null)this.doubles=Doubles.fromJSON(point,json.doubles);if(json.blinding!=null)this.blinding=Blinding.fromJSON(point,json.blinding);return this}static fromJSON(point,json){return(new this).fromJSON(point,json)}}class NAF{constructor(width,points){this.width=width;this.points=points}map(func){assert(typeof func==="function");const{width}=this;const points=[];for(const point of this.points)points.push(func(point));return new this.constructor(width,points)}toJSON(){return{width:this.width,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.width>>>0===json.width);assert(Array.isArray(json.points));const{curve}=point;const{width}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(width,points)}}class Windows{constructor(width,bits,points){this.width=width;this.bits=bits;this.points=points}toJSON(){return{width:this.width,bits:this.bits,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.width>>>0===json.width);assert(json.bits>>>0===json.bits);assert(Array.isArray(json.points));const{curve}=point;const{width,bits}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(width,bits,points)}}class Doubles{constructor(step,points){this.step=step;this.points=points}map(func){assert(typeof func==="function");const{step}=this;const points=[];for(const point of this.points)points.push(func(point));return new this.constructor(step,points)}toJSON(){return{step:this.step,points:this.points.slice(1).map(point=>{return point.toJSON()})}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");assert(json.step>>>0===json.step);assert(Array.isArray(json.points));const{curve}=point;const{step}=json;const points=[point];for(const item of json.points)points.push(curve.pointFromJSON(item));return new this(step,points)}}class Blinding{constructor(blind,unblind){this.blind=blind;this.unblind=unblind}toJSON(){return{blind:this.blind.toJSON(),unblind:this.unblind.toJSON()}}static fromJSON(point,json){assert(point instanceof Point);assert(json&&typeof json==="object");const{curve}=point;const blind=BN.fromJSON(json.blind);const unblind=curve.pointFromJSON(json.unblind);return new this(blind,unblind)}}class Endo{constructor(beta,lambda,basis,pre){this.beta=beta;this.lambda=lambda;this.basis=basis;this.pre=pre}toJSON(){return{beta:this.beta.fromRed().toJSON(),lambda:this.lambda.toJSON(),basis:[this.basis[0].toJSON(),this.basis[1].toJSON()],pre:[this.pre[0],this.pre[1].toJSON(),this.pre[2].toJSON()]}}static fromJSON(curve,json){assert(curve instanceof Curve);assert(json&&typeof json==="object");assert(Array.isArray(json.basis));assert(Array.isArray(json.pre));assert(json.basis.length===2);assert(json.pre.length===3);assert(json.pre[0]>>>0===json.pre[0]);const beta=BN.fromJSON(json.beta).toRed(curve.red);const lambda=BN.fromJSON(json.lambda);const basis=[Vector.fromJSON(json.basis[0]),Vector.fromJSON(json.basis[1])];const pre=[json.pre[0],BN.fromJSON(json.pre[1]),BN.fromJSON(json.pre[2])];return new this(beta,lambda,basis,pre)}}class Vector{constructor(a,b){this.a=a;this.b=b}toJSON(){return{a:this.a.toJSON(),b:this.b.toJSON()}}static fromJSON(json){assert(json&&typeof json==="object");const a=BN.fromJSON(json.a);const b=BN.fromJSON(json.b);return new this(a,b)}}class P192 extends ShortCurve{constructor(pre){super({id:"P192",ossl:"prime192v1",type:"short",endian:"be",hash:"SHA256",prime:"p192",p:["ffffffff ffffffff ffffffff fffffffe","ffffffff ffffffff"],a:["ffffffff ffffffff ffffffff fffffffe","ffffffff fffffffc"],b:["64210519 e59c80e7 0fa7e9ab 72243049","feb8deec c146b9b1"],n:["ffffffff ffffffff ffffffff 99def836","146bc9b1 b4d22831"],h:"1",z:"-5",g:[["188da80e b03090f6 7cbf20eb 43a18800","f4ff0afd 82ff1012"],["07192b95 ffc8da78 631011ed 6b24cdd5","73f977a1 1e794811"],pre]})}}class P224 extends ShortCurve{constructor(pre){super({id:"P224",ossl:"secp224r1",type:"short",endian:"be",hash:"SHA256",prime:"p224",p:["ffffffff ffffffff ffffffff ffffffff","00000000 00000000 00000001"],a:["ffffffff ffffffff ffffffff fffffffe","ffffffff ffffffff fffffffe"],b:["b4050a85 0c04b3ab f5413256 5044b0b7","d7bfd8ba 270b3943 2355ffb4"],n:["ffffffff ffffffff ffffffff ffff16a2","e0b8f03e 13dd2945 5c5c2a3d"],h:"1",z:"1f",g:[["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3","56c21122 343280d6 115c1d21"],["bd376388 b5f723fb 4c22dfe6 cd4375a0","5a074764 44d58199 85007e34"],pre]})}}class P256 extends ShortCurve{constructor(pre){super({id:"P256",ossl:"prime256v1",type:"short",endian:"be",hash:"SHA256",prime:null,p:["ffffffff 00000001 00000000 00000000","00000000 ffffffff ffffffff ffffffff"],a:["ffffffff 00000001 00000000 00000000","00000000 ffffffff ffffffff fffffffc"],b:["5ac635d8 aa3a93e7 b3ebbd55 769886bc","651d06b0 cc53b0f6 3bce3c3e 27d2604b"],n:["ffffffff 00000000 ffffffff ffffffff","bce6faad a7179e84 f3b9cac2 fc632551"],h:"1",z:"-a",g:[["6b17d1f2 e12c4247 f8bce6e5 63a440f2","77037d81 2deb33a0 f4a13945 d898c296"],["4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16","2bce3357 6b315ece cbb64068 37bf51f5"],pre]})}}class P384 extends ShortCurve{constructor(pre){super({id:"P384",ossl:"secp384r1",type:"short",endian:"be",hash:"SHA384",prime:null,p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff fffffffe","ffffffff 00000000 00000000 ffffffff"],a:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff fffffffe","ffffffff 00000000 00000000 fffffffc"],b:["b3312fa7 e23ee7e4 988e056b e3f82d19","181d9c6e fe814112 0314088f 5013875a","c656398d 8a2ed19d 2a85c8ed d3ec2aef"],n:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff c7634d81 f4372ddf","581a0db2 48b0a77a ecec196a ccc52973"],h:"1",z:"-c",g:[["aa87ca22 be8b0537 8eb1c71e f320ad74","6e1d3b62 8ba79b98 59f741e0 82542a38","5502f25d bf55296c 3a545e38 72760ab7"],["3617de4a 96262c6f 5d9e98bf 9292dc29","f8f41dbd 289a147c e9da3113 b5f0b8c0","0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"],pre]})}}class P521 extends ShortCurve{constructor(pre){super({id:"P521",ossl:"secp521r1",type:"short",endian:"be",hash:"SHA512",prime:"p521",p:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff"],a:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","fffffffc"],b:["00000051 953eb961 8e1c9a1f 929a21a0","b68540ee a2da725b 99b315f3 b8b48991","8ef109e1 56193951 ec7e937b 1652c0bd","3bb1bf07 3573df88 3d2c34f1 ef451fd4","6b503f00"],n:["000001ff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffff","fffffffa 51868783 bf2f966b 7fcc0148","f709a5d0 3bb5c9b8 899c47ae bb6fb71e","91386409"],h:"1",z:"-4",g:[["000000c6 858e06b7 0404e9cd 9e3ecb66","2395b442 9c648139 053fb521 f828af60","6b4d3dba a14b5e77 efe75928 fe1dc127","a2ffa8de 3348b3c1 856a429b f97e7e31","c2e5bd66"],["00000118 39296a78 9a3bc004 5c8a5fb4","2c7d1bd9 98f54449 579b4468 17afbd17","273e662c 97ee7299 5ef42640 c550b901","3fad0761 353c7086 a272c240 88be9476","9fd16650"],pre]})}}class SECP256K1 extends ShortCurve{constructor(pre){super({id:"SECP256K1",ossl:"secp256k1",type:"short",endian:"be",hash:"SHA256",prime:"k256",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe fffffc2f"],a:"0",b:"7",n:["ffffffff ffffffff ffffffff fffffffe","baaedce6 af48a03b bfd25e8c d0364141"],h:"1",z:"1",c:["0a2d2ba9 3507f1df 233770c2 a797962c","c61f6d15 da14ecd4 7d8d27ae 1cd5f852"],g:[["79be667e f9dcbbac 55a06295 ce870b07","029bfcdb 2dce28d9 59f2815b 16f81798"],["483ada77 26a3c465 5da4fbfc 0e1108a8","fd17b448 a6855419 9c47d08f fb10d4b8"],pre],endo:{beta:["7ae96a2b 657c0710 6e64479e ac3434e9","9cf04975 12f58995 c1396c28 719501ee"],lambda:["5363ad4c c05c30e0 a5261c02 8812645a","122e22ea 20816678 df02967c 1b23bd72"],basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],pre:[384,["3086d221 a7d46bcd e86c90e4 9284eb15","3daa8a14 71e8ca7f e893209a 45dbb031"],["-","e4437ed6 010e8828 6f547fa9 0abfe4c4","221208ac 9df506c6 1571b4ae 8ac47f71"]]}})}}class BRAINPOOLP256 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP256",ossl:"brainpoolP256r1",type:"short",endian:"be",hash:"SHA256",prime:null,p:["a9fb57db a1eea9bc 3e660a90 9d838d72","6e3bf623 d5262028 2013481d 1f6e5377"],a:["7d5a0975 fc2c3057 eef67530 417affe7","fb8055c1 26dc5c6c e94a4b44 f330b5d9"],b:["26dc5c6c e94a4b44 f330b5d9 bbd77cbf","95841629 5cf7e1ce 6bccdc18 ff8c07b6"],n:["a9fb57db a1eea9bc 3e660a90 9d838d71","8c397aa3 b561a6f7 901e0e82 974856a7"],h:"1",z:"-2",g:[["8bd2aeb9 cb7e57cb 2c4b482f fc81b7af","b9de27e1 e3bd23c2 3a4453bd 9ace3262"],["547ef835 c3dac4fd 97f8461a 14611dc9","c2774513 2ded8e54 5c1d54c7 2f046997"],pre]})}}class BRAINPOOLP384 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP384",ossl:"brainpoolP384r1",type:"short",endian:"be",hash:"SHA384",prime:null,p:["8cb91e82 a3386d28 0f5d6f7e 50e641df","152f7109 ed5456b4 12b1da19 7fb71123","acd3a729 901d1a71 87470013 3107ec53"],a:["7bc382c6 3d8c150c 3c72080a ce05afa0","c2bea28e 4fb22787 139165ef ba91f90f","8aa5814a 503ad4eb 04a8c7dd 22ce2826"],b:["04a8c7dd 22ce2826 8b39b554 16f0447c","2fb77de1 07dcd2a6 2e880ea5 3eeb62d5","7cb43902 95dbc994 3ab78696 fa504c11"],n:["8cb91e82 a3386d28 0f5d6f7e 50e641df","152f7109 ed5456b3 1f166e6c ac0425a7","cf3ab6af 6b7fc310 3b883202 e9046565"],h:"1",z:"-5",g:[["1d1c64f0 68cf45ff a2a63a81 b7c13f6b","8847a3e7 7ef14fe3 db7fcafe 0cbd10e8","e826e034 36d646aa ef87b2e2 47d4af1e"],["8abe1d75 20f9c2a4 5cb1eb8e 95cfd552","62b70b29 feec5864 e19c054f f9912928","0e464621 77918111 42820341 263c5315"],pre]})}}class BRAINPOOLP512 extends ShortCurve{constructor(pre){super({id:"BRAINPOOLP512",ossl:"brainpoolP512r1",type:"short",endian:"be",hash:"SHA512",prime:null,p:["aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07","cb308db3 b3c9d20e d6639cca 70330871","7d4d9b00 9bc66842 aecda12a e6a380e6","2881ff2f 2d82c685 28aa6056 583a48f3"],a:["7830a331 8b603b89 e2327145 ac234cc5","94cbdd8d 3df91610 a83441ca ea9863bc","2ded5d5a a8253aa1 0a2ef1c9 8b9ac8b5","7f1117a7 2bf2c7b9 e7c1ac4d 77fc94ca"],b:["3df91610 a83441ca ea9863bc 2ded5d5a","a8253aa1 0a2ef1c9 8b9ac8b5 7f1117a7","2bf2c7b9 e7c1ac4d 77fc94ca dc083e67","984050b7 5ebae5dd 2809bd63 8016f723"],n:["aadd9db8 dbe9c48b 3fd4e6ae 33c9fc07","cb308db3 b3c9d20e d6639cca 70330870","553e5c41 4ca92619 41866119 7fac1047","1db1d381 085ddadd b5879682 9ca90069"],h:"1",z:"7",g:[["81aee4bd d82ed964 5a21322e 9c4c6a93","85ed9f70 b5d916c1 b43b62ee f4d0098e","ff3b1f78 e2d0d48d 50d1687b 93b97d5f","7c6d5047 406a5e68 8b352209 bcb9f822"],["7dde385d 566332ec c0eabfa9 cf7822fd","f209f700 24a57b1a a000c55b 881f8111","b2dcde49 4a5f485e 5bca4bd8 8a2763ae","d1ca2b2f a8f05406 78cd1e0f 3ad80892"],pre]})}}class X25519 extends MontCurve{constructor(){super({id:"X25519",ossl:"X25519",type:"mont",endian:"le",hash:"SHA512",prime:"p25519",p:["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffed"],a:"76d06",b:"1",n:["10000000 00000000 00000000 00000000","14def9de a2f79cd6 5812631a 5cf5d3ed"],h:"8",z:"2",g:[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000009"],["5f51e65e 475f794b 1fe122d3 88b72eb3","6dc2b281 92839e4d d6163a5d 81312c14"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"],["6be4f497 f9a9c2af c21fa77a d7f4a6ef","635a11c7 284a9363 e9a248ef 9c884415"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"],["141b0b68 06563d50 3de05885 280b5910","9ca5ee38 d7b56c9c 165db710 6377bbd8"]],[["57119fd0 dd4e22d8 868e1c58 c45c4404","5bef839c 55b1d0b1 248c50a3 bc959c5f"],["68c59389 3d458e64 31c6ca00 45fb5015","20a44346 8eaa68dd 0f103842 048065b7"]],[["57119fd0 dd4e22d8 868e1c58 c45c4404","5bef839c 55b1d0b1 248c50a3 bc959c5f"],["173a6c76 c2ba719b ce3935ff ba04afea","df5bbcb9 71559722 f0efc7bd fb7f9a36"]],[["00b8495f 16056286 fdb1329c eb8d09da","6ac49ff1 fae35616 aeb8413b 7c7aebe0"],["3931c129 569e83a5 29482c14 e628b457","933bfc29 ed801b4d 68871483 92507b1a"]],[["00b8495f 16056286 fdb1329c eb8d09da","6ac49ff1 fae35616 aeb8413b 7c7aebe0"],["46ce3ed6 a9617c5a d6b7d3eb 19d74ba8","6cc403d6 127fe4b2 9778eb7c 6daf84d3"]]]})}}class X448 extends MontCurve{constructor(){super({id:"X448",ossl:"X448",type:"mont",endian:"le",hash:"SHAKE256",prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"262a6",b:"1",n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000005"],["7d235d12 95f5b1f6 6c98ab6e 58326fce","cbae5d34 f55545d0 60f75dc2 8df3f6ed","b8027e23 46430d21 1312c4b1 50677af7","6fd7223d 457b5b1a"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["ba4d3a08 29b6112f 8812e51b a0bb2abe","bc1cb08e b48e5569 36ba50fd d2e7d68a","f8cb3216 0522425b 3f990812 abbe635a","d37a21e1 7551b193"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["45b2c5f7 d649eed0 77ed1ae4 5f44d541","43e34f71 4b71aa96 c945af01 2d182975","0734cde9 faddbda4 c066f7ed 54419ca5","2c85de1e 8aae4e6c"]]]})}}class MONT448 extends MontCurve{constructor(){super({id:"MONT448",ossl:null,type:"mont",endian:"le",hash:"SHAKE256",prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:["b2cf97d2 d43459a9 31ed36b1 fc4e3cb5","5d93f8d2 22746997 60ccffc6 49961ed6","c5b05fca c24864ed 6fb59697 931b78da","84ddecd8 ca2b5cfb"],b:"1",n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["ac0d24cc c6c75cb0 eb71f81e 7a6edf51","48e88aee 009a2a24 e795687e c28e125a","3e6730a6 0d46367b aa7fe99d 152128dc","41321bc7 7817f059"],["5a4437f6 80c0d0db 9b061276 d5d0ffcc","e786ff33 b6a53d30 98746425 82e66f09","4433dae7 7244a6e2 6b11e905 7228f483","556c41a5 913f55fe"]],torsion:[[],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["bec92fd0 6da2acf2 b4e261e8 7cef0d34","22e75c18 3c589857 b71924e5 73c2f9ce","e18da5f2 466e2f39 3c2eedf0 f105a60a","b40c717d 4f1e1fd7"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["4136d02f 925d530d 4b1d9e17 8310f2cb","dd18a3e7 c3a767a8 48e6db19 8c3d0631","1e725a0d b991d0c6 c3d1120f 0efa59f5","4bf38e82 b0e1e028"]]]})}}class ED25519 extends EdwardsCurve{constructor(pre){super({id:"ED25519",ossl:"ED25519",type:"edwards",endian:"le",hash:"SHA512",prefix:"SigEd25519 no Ed25519 collisions",context:false,prime:"p25519",p:["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffed"],a:"-1",d:["52036cee 2b6ffe73 8cc74079 7779e898","00700a4d 4141d8ab 75eb4dca 135978a3"],n:["10000000 00000000 00000000 00000000","14def9de a2f79cd6 5812631a 5cf5d3ed"],h:"8",z:"2",g:[["216936d3 cd6e53fe c0a4e231 fdd6dc5c","692cc760 9525a7b2 c9562d60 8f25d51a"],["66666666 66666666 66666666 66666666","66666666 66666666 66666666 66666658"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"],["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff ffffffec"]],[["2b832480 4fc1df0b 2b4d0099 3dfbd7a7","2f431806 ad2fe478 c4ee1b27 4a0ea0b0"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["547cdb7f b03e20f4 d4b2ff66 c2042858","d0bce7f9 52d01b87 3b11e4d8 b5f15f3d"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000"]],[["1fd5b9a0 06394a28 e9339932 38de4abb","5c193c70 13e5e238 dea14646 c545d14a"],["05fc536d 880238b1 3933c6d3 05acdfd5","f098eff2 89f4c345 b027b2c2 8f95e826"]],[["602a465f f9c6b5d7 16cc66cd c721b544","a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3"],["05fc536d 880238b1 3933c6d3 05acdfd5","f098eff2 89f4c345 b027b2c2 8f95e826"]],[["1fd5b9a0 06394a28 e9339932 38de4abb","5c193c70 13e5e238 dea14646 c545d14a"],["7a03ac92 77fdc74e c6cc392c fa53202a","0f67100d 760b3cba 4fd84d3d 706a17c7"]],[["602a465f f9c6b5d7 16cc66cd c721b544","a3e6c38f ec1a1dc7 215eb9b9 3aba2ea3"],["7a03ac92 77fdc74e c6cc392c fa53202a","0f67100d 760b3cba 4fd84d3d 706a17c7"]]]})}}class ISO448 extends EdwardsCurve{constructor(pre){super({id:"ISO448",ossl:null,type:"edwards",endian:"le",hash:"SHAKE256",prefix:"SigEd448",context:true,prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"1",d:["d78b4bdc 7f0daf19 f24f38c2 9373a2cc","ad461572 42a50f37 809b1da3 412a12e7","9ccc9c81 264cfe9a d0809970 58fb61c4","243cc32d baa156b9"],n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["79a70b2b 70400553 ae7c9df4 16c792c6","1128751a c9296924 0c25a07d 728bdc93","e21f7787 ed697224 9de732f3 8496cd11","69871309 3e9c04fc"],["7fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 80000000","00000000 00000000 00000000 00000000","00000000 00000001"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]]]})}}class ED448 extends EdwardsCurve{constructor(pre){super({id:"ED448",ossl:"ED448",type:"edwards",endian:"le",hash:"SHAKE256",prefix:"SigEd448",context:true,prime:"p448",p:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff"],a:"1",d:["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff ffff6756"],n:["3fffffff ffffffff ffffffff ffffffff","ffffffff ffffffff ffffffff 7cca23e9","c44edb49 aed63690 216cc272 8dc58f55","2378c292 ab5844f3"],h:"4",z:"-1",g:[["4f1970c6 6bed0ded 221d15a6 22bf36da","9e146570 470f1767 ea6de324 a3d3a464","12ae1af7 2ab66511 433b80e1 8b00938e","2626a82b c70cc05e"],["693f4671 6eb6bc24 88762037 56c9c762","4bea7373 6ca39840 87789c1e 05a0c2d7","3ad3ff1c e67c39c4 fdbd132c 4ed7c8ad","9808795b f230fa14"],pre],torsion:[[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"],["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"]],[["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000001"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]],[["ffffffff ffffffff ffffffff ffffffff","ffffffff ffffffff fffffffe ffffffff","ffffffff ffffffff ffffffff ffffffff","ffffffff fffffffe"],["00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000 00000000 00000000","00000000 00000000"]]]})}}const curves={__proto__:null,P192:P192,P224:P224,P256:P256,P384:P384,P521:P521,SECP256K1:SECP256K1,BRAINPOOLP256:BRAINPOOLP256,BRAINPOOLP384:BRAINPOOLP384,BRAINPOOLP512:BRAINPOOLP512,X25519:X25519,X448:X448,MONT448:MONT448,ED25519:ED25519,ISO448:ISO448,ED448:ED448};const cache={__proto__:null,P192:null,P224:null,P256:null,P384:null,P521:null,SECP256K1:null,BRAINPOOLP256:null,BRAINPOOLP384:null,BRAINPOOLP512:null,X25519:null,X448:null,MONT448:null,ED25519:null,ISO448:null,ED448:null};function curve(name,...args){assert(typeof name==="string");const key=name.toUpperCase();let curve=cache[key];if(!curve){const Curve=curves[key];if(!Curve)throw new Error(`Curve not found: "${name}".`);curve=new Curve(...args);cache[key]=curve}return curve}function register(name,Curve){assert(typeof name==="string");assert(typeof Curve==="function");const key=name.toUpperCase();if(curves[key])throw new Error(`Curve already registered: "${name}".`);curves[key]=Curve;cache[key]=null}function getNAF(k,width,max){assert(k instanceof BN);assert(!k.red);assert(width>>>0===width);assert(max>>>0===max);const naf=new Array(max);const bits=k.bitLength()+1;const sign=k.sign()|1;assert(bits<=max);for(let i=0;i>width-1&1;word-=carry<>>0===step);const naf=getNAF(k,width,max);const len=Math.ceil(naf.length/step);const repr=new Array(len);let i=0;for(let j=0;j=j;k--)nafW=(nafW<<1)+naf[k];repr[i++]=nafW}assert(i===len);return repr}function getJSF(k1,k2,max){assert(k1 instanceof BN);assert(k2 instanceof BN);assert(!k1.red);assert(!k2.red);assert(max>>>0===max);const jsf=[new Array(max),new Array(max)];const bits=Math.max(k1.bitLength(),k2.bitLength())+1;const s1=k1.sign()|1;const s2=k2.sign()|1;assert(bits<=max);let d1=0;let d2=0;for(let i=0;i=0)return root}throw new Error("X^(1/3) is not a square mod P.")}function randomInt(rng){return BN.randomBits(rng,32).toNumber()}function memoize(method,self){const cache=new WeakMap;return function memoized(curve,invert){const i=invert&1;const item=cache.get(curve);if(item&&item[i]!==null)return item[i];const result=method.call(self,curve,invert);if(!cache.has(curve))cache.set(curve,[null,null]);cache.get(curve)[i]=result;return result}}function toPretty(x,size){assert(x instanceof BN);assert(size>>>0===size);if(size&7)size+=8-(size&7);const str=x.toString(16,size);const chunks=[];const out=[];assert((str.length&7)===0);for(let i=0;i>>0===size);const data=bufferExports.Buffer.alloc(size);randomFillSync(data,0,size);return data}function randomFill(data,off,size){assert(bufferExports.Buffer.isBuffer(data));if(off==null)off=0;assert(off>>>0===off);if(size==null)size=data.length-off;assert(size>>>0===size);assert(off+size<=data.length);randomFillSync(data,off,size);return data}function randomInt(){if((poolPos&15)===0){getRandomValues(pool);poolPos=0}return pool[poolPos++]}function randomRange(min,max){assert(min>>>0===min);assert(max>>>0===max);assert(max>=min);const space=max-min;if(space===0)return min;const top=-space>>>0;let x,r;do{x=randomInt();r=x%space}while(x-r>top);return r+min}function getRandomValues(array){if(!HAS_CRYPTO)throw new Error("Entropy source not available.");return randomValues(array)}function randomFillSync(data,off,size){assert(bufferExports.Buffer.isBuffer(data));assert(data.buffer instanceof ArrayBuffer);assert(data.byteOffset>>>0===data.byteOffset);assert(data.byteLength>>>0===data.byteLength);assert(off>>>0===off);assert(size>>>0===size);assert(off+size<=data.byteLength);if(size>2**31-1)throw new RangeError('The value "size" is out of range.');const offset=data.byteOffset+off;const array=new Uint8Array(data.buffer,offset,size);if(array.length>MAX_BYTES){for(let i=0;iarray.length)j=array.length;getRandomValues(array.subarray(i,j))}}else{if(array.length>0)getRandomValues(array)}}random.native=0;random.randomBytes=randomBytes;random.randomFill=randomFill;random.randomInt=randomInt;random.randomRange=randomRange;return random}var randomBrowser;var hasRequiredRandomBrowser;function requireRandomBrowser(){if(hasRequiredRandomBrowser)return randomBrowser;hasRequiredRandomBrowser=1;randomBrowser=requireRandom();return randomBrowser}var eddsa;var hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;const assert=requireAssert();const BatchRNG=requireBatchRng();const BN=requireBnBrowser();const elliptic=requireElliptic();const rng=requireRandomBrowser();class EDDSA{constructor(id,mid,eid,hash,pre){assert(typeof id==="string");assert(!mid||typeof mid==="string");assert(!eid||typeof eid==="string");assert(hash);this.id=id;this.type="eddsa";this.mid=mid||null;this.eid=eid||null;this.hash=hash;this.native=0;this._pre=pre||null;this._curve=null;this._mont=null;this._iso=null;this._rng=null}get curve(){if(!this._curve){this._curve=elliptic.curve(this.id,this._pre);this._curve.precompute(rng);this._pre=null}return this._curve}get mont(){if(this.mid&&!this._mont)this._mont=elliptic.curve(this.mid);return this._mont}get iso(){if(!this.eid)return this.mont;if(!this._iso)this._iso=elliptic.curve(this.eid);return this._iso}get rng(){if(!this._rng)this._rng=new BatchRNG(this.curve);return this._rng}get size(){return this.curve.adjustedSize}get bits(){return this.curve.fieldBits}hashNonce(prefix,msg,ph,ctx){const hash=new Hash(this);hash.init(ph,ctx);hash.update(prefix);hash.update(msg);return hash.final()}hashChallenge(R,A,m,ph,ctx){const hash=new Hash(this);hash.init(ph,ctx);hash.update(R);hash.update(A);hash.update(m);return hash.final()}privateKeyGenerate(){return rng.randomBytes(this.curve.adjustedSize)}scalarGenerate(){const scalar=rng.randomBytes(this.curve.scalarSize);return this.curve.clamp(scalar)}privateKeyExpand(secret){assert(bufferExports.Buffer.isBuffer(secret));assert(secret.length===this.curve.adjustedSize);const hash=this.hash.digest(secret,this.curve.adjustedSize*2);return this.curve.splitHash(hash)}privateKeyConvert(secret){const[key]=this.privateKeyExpand(secret);return key}privateKeyVerify(secret){assert(bufferExports.Buffer.isBuffer(secret));return secret.length===this.curve.adjustedSize}scalarVerify(scalar){assert(bufferExports.Buffer.isBuffer(scalar));return scalar.length===this.curve.scalarSize}scalarIsZero(scalar){assert(bufferExports.Buffer.isBuffer(scalar));let k;try{k=this.curve.decodeScalar(scalar).imod(this.curve.n)}catch(e){return false}return k.isZero()}scalarClamp(scalar){assert(bufferExports.Buffer.isBuffer(scalar));assert(scalar.length===this.curve.scalarSize);return this.curve.clamp(bufferExports.Buffer.from(scalar))}privateKeyExport(secret){const pub=this.publicKeyCreate(secret);const{x,y}=this.publicKeyExport(pub);return{d:bufferExports.Buffer.from(secret),x:x,y:y}}privateKeyImport(json){assert(json&&typeof json==="object");assert(bufferExports.Buffer.isBuffer(json.d));if(json.d.length!==this.curve.adjustedSize)throw new Error("Invalid private key.");return bufferExports.Buffer.from(json.d)}scalarTweakAdd(scalar,tweak){const a=this.curve.decodeScalar(scalar);const t=this.curve.decodeScalar(tweak);const k=a.add(t).imod(this.curve.n);return this.curve.encodeScalar(k)}scalarTweakMul(scalar,tweak){const a=this.curve.decodeScalar(scalar);const t=this.curve.decodeScalar(tweak);const k=a.mul(t).imod(this.curve.n);return this.curve.encodeScalar(k)}scalarReduce(scalar){const a=this.curve.decodeScalar(scalar);const k=a.imod(this.curve.n);return this.curve.encodeScalar(k)}scalarNegate(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);const k=a.neg().imod(this.curve.n);return this.curve.encodeScalar(k)}scalarInvert(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);if(a.isZero())return this.curve.encodeScalar(a);const k=a.invert(this.curve.n);return this.curve.encodeScalar(k)}publicKeyCreate(secret){const key=this.privateKeyConvert(secret);return this.publicKeyFromScalar(key)}publicKeyFromScalar(scalar){const a=this.curve.decodeScalar(scalar).imod(this.curve.n);const A=this.curve.g.mulBlind(a);return A.encode()}publicKeyConvert(key){if(!this.mont)throw new Error("No equivalent montgomery curve.");const A=this.curve.decodePoint(key);const P=this.mont.pointFromEdwards(A);return P.encode()}publicKeyFromUniform(bytes){const u=this.curve.decodeUniform(bytes);const A=this.curve.pointFromUniform(u,this.iso);return A.encode()}publicKeyToUniform(key,hint=rng.randomInt()){const A=this.curve.decodePoint(key);const u=this.curve.pointToUniform(A,hint,this.iso);return this.curve.encodeUniform(u,hint>>>8)}publicKeyFromHash(bytes,pake=false){const A=this.curve.pointFromHash(bytes,pake,this.iso);return A.encode()}publicKeyToHash(key,subgroup=rng.randomInt()){const A=this.curve.decodePoint(key);return this.curve.pointToHash(A,subgroup,rng,this.iso)}publicKeyVerify(key){assert(bufferExports.Buffer.isBuffer(key));try{this.curve.decodePoint(key)}catch(e){return false}return true}publicKeyIsInfinity(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.isInfinity()}publicKeyIsSmall(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.isSmall()}publicKeyHasTorsion(key){assert(bufferExports.Buffer.isBuffer(key));let A;try{A=this.curve.decodePoint(key)}catch(e){return false}return A.hasTorsion()}publicKeyExport(key){const{x,y}=this.curve.decodePoint(key);return{x:this.curve.encodeField(x.fromRed()),y:this.curve.encodeField(y.fromRed())}}publicKeyImport(json){assert(json&&typeof json==="object");let x=null;let y=null;let A;if(json.x!=null){x=BN.decode(json.x,this.curve.endian);if(x.cmp(this.curve.p)>=0)throw new Error("Invalid point.")}if(json.y!=null){y=BN.decode(json.y,this.curve.endian);if(y.cmp(this.curve.p)>=0)throw new Error("Invalid point.")}if(x&&y){A=this.curve.point(x,y);if(!A.validate())throw new Error("Invalid point.")}else if(x){A=this.curve.pointFromX(x,json.sign)}else if(y){A=this.curve.pointFromY(y,json.sign)}else{throw new Error("Invalid point.")}return A.encode()}publicKeyTweakAdd(key,tweak){const t=this.curve.decodeScalar(tweak).imod(this.curve.n);const A=this.curve.decodePoint(key);const T=this.curve.g.mul(t);const P=T.add(A);return P.encode()}publicKeyTweakMul(key,tweak){const t=this.curve.decodeScalar(tweak);const A=this.curve.decodePoint(key);const P=A.mul(t);return P.encode()}publicKeyCombine(keys){assert(Array.isArray(keys));let P=this.curve.point();for(const key of keys){const A=this.curve.decodePoint(key);P=P.add(A)}return P.encode()}publicKeyNegate(key){const A=this.curve.decodePoint(key);const P=A.neg();return P.encode()}sign(msg,secret,ph,ctx){const[key,prefix]=this.privateKeyExpand(secret);return this.signWithScalar(msg,key,prefix,ph,ctx)}signWithScalar(msg,scalar,prefix,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(prefix));assert(prefix.length===this.curve.adjustedSize);const{n}=this.curve;const G=this.curve.g;const k=this.hashNonce(prefix,msg,ph,ctx);const Rraw=G.mulBlind(k).encode();const a=this.curve.decodeScalar(scalar);const Araw=G.mulBlind(a).encode();const e=this.hashChallenge(Rraw,Araw,msg,ph,ctx);const s=k.add(e.mul(a)).imod(n);return bufferExports.Buffer.concat([Rraw,this.curve.encodeAdjusted(s)])}signTweakAdd(msg,secret,tweak,ph,ctx){const[key_,prefix_]=this.privateKeyExpand(secret);const key=this.scalarTweakAdd(key_,tweak);const expanded=this.hash.multi(prefix_,tweak,null,this.curve.adjustedSize*2);const prefix=expanded.slice(0,this.curve.adjustedSize);return this.signWithScalar(msg,key,prefix,ph,ctx)}signTweakMul(msg,secret,tweak,ph,ctx){const[key_,prefix_]=this.privateKeyExpand(secret);const key=this.scalarTweakMul(key_,tweak);const expanded=this.hash.multi(prefix_,tweak,null,this.curve.adjustedSize*2);const prefix=expanded.slice(0,this.curve.adjustedSize);return this.signWithScalar(msg,key,prefix,ph,ctx)}verify(msg,sig,key,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false;try{return this._verify(msg,sig,key,ph,ctx)}catch(e){return false}}_verify(msg,sig,key,ph,ctx){const{n}=this.curve;const G=this.curve.g;const Rraw=sig.slice(0,this.curve.adjustedSize);const sraw=sig.slice(this.curve.adjustedSize);const R=this.curve.decodePoint(Rraw);const s=this.curve.decodeAdjusted(sraw);const A=this.curve.decodePoint(key);if(s.cmp(n)>=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);return G.mulAdd(s,A.neg(),e).eq(R)}verifySingle(msg,sig,key,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false;try{return this._verifySingle(msg,sig,key,ph,ctx)}catch(e){return false}}_verifySingle(msg,sig,key,ph,ctx){const{n}=this.curve;const G=this.curve.g;const Rraw=sig.slice(0,this.curve.adjustedSize);const sraw=sig.slice(this.curve.adjustedSize);const R=this.curve.decodePoint(Rraw);const s=this.curve.decodeAdjusted(sraw);const A=this.curve.decodePoint(key);if(s.cmp(n)>=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);const sh=this.curve.imulH(s);const Ah=A.mulH();const Rh=R.mulH();return G.mulAdd(sh,Ah.neg(),e).eq(Rh)}verifyBatch(batch,ph,ctx){if(ctx==null)ctx=bufferExports.Buffer.alloc(0);assert(Array.isArray(batch));assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));for(const item of batch){assert(Array.isArray(item)&&item.length===3);const[msg,sig,key]=item;assert(bufferExports.Buffer.isBuffer(msg));assert(bufferExports.Buffer.isBuffer(sig));assert(bufferExports.Buffer.isBuffer(key));if(sig.length!==this.curve.adjustedSize*2)return false;if(key.length!==this.curve.adjustedSize)return false}try{return this._verifyBatch(batch,ph,ctx)}catch(e){return false}}_verifyBatch(batch,ph,ctx){const{n}=this.curve;const G=this.curve.g;const points=new Array(1+batch.length*2);const coeffs=new Array(1+batch.length*2);const sum=new BN(0);this.rng.init(batch);points[0]=G;coeffs[0]=sum;for(let i=0;i=0)return false;const e=this.hashChallenge(Rraw,key,msg,ph,ctx);const a=this.rng.generate(i);const ea=e.mul(a).imod(n);sum.iadd(s.mul(a)).imod(n);points[1+i*2+0]=R.mulH();coeffs[1+i*2+0]=a;points[1+i*2+1]=A.mulH();coeffs[1+i*2+1]=ea}this.curve.imulH(sum.ineg());return this.curve.mulAll(points,coeffs).isInfinity()}derive(pub,secret){const scalar=this.privateKeyConvert(secret);return this.deriveWithScalar(pub,scalar)}deriveWithScalar(pub,scalar){const A=this.curve.decodePoint(pub);const a=this.curve.decodeClamped(scalar);const P=A.mulBlind(a,rng);if(P.isInfinity())throw new Error("Invalid point.");return P.encode()}}class Hash{constructor(eddsa){this.curve=eddsa.curve;this.hash=new eddsa.hash}init(ph,ctx){assert(ph==null||typeof ph==="boolean");assert(bufferExports.Buffer.isBuffer(ctx));if(ctx.length>255)ctx=ctx.slice(0,255);this.hash.init();if(this.curve.context||ph!=null||ctx.length>0){if(this.curve.prefix)this.hash.update(this.curve.prefix);this.hash.update(byte(ph));this.hash.update(byte(ctx.length));this.hash.update(ctx)}return this}update(data){this.hash.update(data);return this}final(){const hash=this.hash.final(this.curve.adjustedSize*2);const num=BN.decode(hash,this.curve.endian);return num.imod(this.curve.n)}}function byte(ch){const buf=bufferExports.Buffer.alloc(1);buf[0]=ch&255;return buf}eddsa=EDDSA;return eddsa}var keccak;var hasRequiredKeccak;function requireKeccak(){if(hasRequiredKeccak)return keccak;hasRequiredKeccak=1;const assert=requireAssert();const HMAC=requireHmac();const FINALIZED=2147483648;const ROUND_CONST=new Uint32Array([1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648]);class Keccak{constructor(){this.state=new Uint32Array(50);this.block=bufferExports.Buffer.alloc(200);this.bs=136;this.pos=FINALIZED}init(bits){if(bits==null)bits=256;assert(bits>>>0===bits);assert(bits>=128);assert(bits<=512);const rate=1600-bits*2;assert(rate>=0&&(rate&63)===0);this.bs=rate>>>3;this.pos=0;return this}update(data){assert(bufferExports.Buffer.isBuffer(data));assert(!(this.pos&FINALIZED),"Context is not initialized.");let len=data.length;let pos=this.pos;let off=0;this.pos=(this.pos+len)%this.bs;if(pos>0){let want=this.bs-pos;if(want>len)want=len;data.copy(this.block,pos,off,off+want);pos+=want;len-=want;off+=want;if(pos=this.bs){this._transform(data,off);off+=this.bs;len-=this.bs}if(len>0)data.copy(this.block,0,off,off+len);return this}final(pad,len){if(pad==null)pad=1;if(len==null||len===0)len=100-(this.bs>>>1);assert((pad&255)===pad);assert(len>>>0===len);assert(!(this.pos&FINALIZED),"Context is not initialized.");this.block.fill(0,this.pos,this.bs);this.block[this.pos]|=pad;this.block[this.bs-1]|=128;this._transform(this.block,0);this.pos=FINALIZED;assert(len<=this.bs);const out=bufferExports.Buffer.alloc(len);for(let i=0;i>>2]>>>8*(i&3);for(let i=0;i<50;i++)this.state[i]=0;for(let i=0;i>>2;const s=this.state;for(let i=0;i>>31);const l0=c9^(c3<<1|c2>>>31);const h1=c0^(c4<<1|c5>>>31);const l1=c1^(c5<<1|c4>>>31);const h2=c2^(c6<<1|c7>>>31);const l2=c3^(c7<<1|c6>>>31);const h3=c4^(c8<<1|c9>>>31);const l3=c5^(c9<<1|c8>>>31);const h4=c6^(c0<<1|c1>>>31);const l4=c7^(c1<<1|c0>>>31);s[0]^=h0;s[1]^=l0;s[10]^=h0;s[11]^=l0;s[20]^=h0;s[21]^=l0;s[30]^=h0;s[31]^=l0;s[40]^=h0;s[41]^=l0;s[2]^=h1;s[3]^=l1;s[12]^=h1;s[13]^=l1;s[22]^=h1;s[23]^=l1;s[32]^=h1;s[33]^=l1;s[42]^=h1;s[43]^=l1;s[4]^=h2;s[5]^=l2;s[14]^=h2;s[15]^=l2;s[24]^=h2;s[25]^=l2;s[34]^=h2;s[35]^=l2;s[44]^=h2;s[45]^=l2;s[6]^=h3;s[7]^=l3;s[16]^=h3;s[17]^=l3;s[26]^=h3;s[27]^=l3;s[36]^=h3;s[37]^=l3;s[46]^=h3;s[47]^=l3;s[8]^=h4;s[9]^=l4;s[18]^=h4;s[19]^=l4;s[28]^=h4;s[29]^=l4;s[38]^=h4;s[39]^=l4;s[48]^=h4;s[49]^=l4;const b0=s[0];const b1=s[1];const b32=s[11]<<4|s[10]>>>28;const b33=s[10]<<4|s[11]>>>28;const b14=s[20]<<3|s[21]>>>29;const b15=s[21]<<3|s[20]>>>29;const b46=s[31]<<9|s[30]>>>23;const b47=s[30]<<9|s[31]>>>23;const b28=s[40]<<18|s[41]>>>14;const b29=s[41]<<18|s[40]>>>14;const b20=s[2]<<1|s[3]>>>31;const b21=s[3]<<1|s[2]>>>31;const b2=s[13]<<12|s[12]>>>20;const b3=s[12]<<12|s[13]>>>20;const b34=s[22]<<10|s[23]>>>22;const b35=s[23]<<10|s[22]>>>22;const b16=s[33]<<13|s[32]>>>19;const b17=s[32]<<13|s[33]>>>19;const b48=s[42]<<2|s[43]>>>30;const b49=s[43]<<2|s[42]>>>30;const b40=s[5]<<30|s[4]>>>2;const b41=s[4]<<30|s[5]>>>2;const b22=s[14]<<6|s[15]>>>26;const b23=s[15]<<6|s[14]>>>26;const b4=s[25]<<11|s[24]>>>21;const b5=s[24]<<11|s[25]>>>21;const b36=s[34]<<15|s[35]>>>17;const b37=s[35]<<15|s[34]>>>17;const b18=s[45]<<29|s[44]>>>3;const b19=s[44]<<29|s[45]>>>3;const b10=s[6]<<28|s[7]>>>4;const b11=s[7]<<28|s[6]>>>4;const b42=s[17]<<23|s[16]>>>9;const b43=s[16]<<23|s[17]>>>9;const b24=s[26]<<25|s[27]>>>7;const b25=s[27]<<25|s[26]>>>7;const b6=s[36]<<21|s[37]>>>11;const b7=s[37]<<21|s[36]>>>11;const b38=s[47]<<24|s[46]>>>8;const b39=s[46]<<24|s[47]>>>8;const b30=s[8]<<27|s[9]>>>5;const b31=s[9]<<27|s[8]>>>5;const b12=s[18]<<20|s[19]>>>12;const b13=s[19]<<20|s[18]>>>12;const b44=s[29]<<7|s[28]>>>25;const b45=s[28]<<7|s[29]>>>25;const b26=s[38]<<8|s[39]>>>24;const b27=s[39]<<8|s[38]>>>24;const b8=s[48]<<14|s[49]>>>18;const b9=s[49]<<14|s[48]>>>18;s[0]=b0^~b2&b4;s[1]=b1^~b3&b5;s[10]=b10^~b12&b14;s[11]=b11^~b13&b15;s[20]=b20^~b22&b24;s[21]=b21^~b23&b25;s[30]=b30^~b32&b34;s[31]=b31^~b33&b35;s[40]=b40^~b42&b44;s[41]=b41^~b43&b45;s[2]=b2^~b4&b6;s[3]=b3^~b5&b7;s[12]=b12^~b14&b16;s[13]=b13^~b15&b17;s[22]=b22^~b24&b26;s[23]=b23^~b25&b27;s[32]=b32^~b34&b36;s[33]=b33^~b35&b37;s[42]=b42^~b44&b46;s[43]=b43^~b45&b47;s[4]=b4^~b6&b8;s[5]=b5^~b7&b9;s[14]=b14^~b16&b18;s[15]=b15^~b17&b19;s[24]=b24^~b26&b28;s[25]=b25^~b27&b29;s[34]=b34^~b36&b38;s[35]=b35^~b37&b39;s[44]=b44^~b46&b48;s[45]=b45^~b47&b49;s[6]=b6^~b8&b0;s[7]=b7^~b9&b1;s[16]=b16^~b18&b10;s[17]=b17^~b19&b11;s[26]=b26^~b28&b20;s[27]=b27^~b29&b21;s[36]=b36^~b38&b30;s[37]=b37^~b39&b31;s[46]=b46^~b48&b40;s[47]=b47^~b49&b41;s[8]=b8^~b0&b2;s[9]=b9^~b1&b3;s[18]=b18^~b10&b12;s[19]=b19^~b11&b13;s[28]=b28^~b20&b22;s[29]=b29^~b21&b23;s[38]=b38^~b30&b32;s[39]=b39^~b31&b33;s[48]=b48^~b40&b42;s[49]=b49^~b41&b43;s[0]^=ROUND_CONST[n+0];s[1]^=ROUND_CONST[n+1]}}static hash(){return new Keccak}static hmac(bits,pad,len){if(bits==null)bits=256;assert(bits>>>0===bits);const rate=1600-bits*2;assert(rate>=0&&(rate&63)===0);return new HMAC(Keccak,rate>>>3,[bits],[pad,len])}static digest(data,bits,pad,len){return Keccak.ctx.init(bits).update(data).final(pad,len)}static root(left,right,bits,pad,len){if(bits==null)bits=256;if(len==null)len=0;if(len===0)len=bits>>>3;assert(bits>>>0===bits);assert((bits&7)===0);assert(len>>>0===len);assert(bufferExports.Buffer.isBuffer(left)&&left.length===len);assert(bufferExports.Buffer.isBuffer(right)&&right.length===len);return Keccak.ctx.init(bits).update(left).update(right).final(pad,len)}static multi(x,y,z,bits,pad,len){const{ctx}=Keccak;ctx.init(bits);ctx.update(x);ctx.update(y);if(z)ctx.update(z);return ctx.final(pad,len)}static mac(data,key,bits,pad,len){return Keccak.hmac(bits,pad,len).init(key).update(data).final()}}Keccak.native=0;Keccak.id="KECCAK256";Keccak.size=32;Keccak.bits=256;Keccak.blockSize=136;Keccak.zero=bufferExports.Buffer.alloc(32,0);Keccak.ctx=new Keccak;function readU32(data,off){return data[off++]+data[off++]*256+data[off++]*65536+data[off]*16777216}keccak=Keccak;return keccak}var keccakBrowser;var hasRequiredKeccakBrowser;function requireKeccakBrowser(){if(hasRequiredKeccakBrowser)return keccakBrowser;hasRequiredKeccakBrowser=1;keccakBrowser=requireKeccak();return keccakBrowser}var shake;var hasRequiredShake;function requireShake(){if(hasRequiredShake)return shake;hasRequiredShake=1;const Keccak=requireKeccakBrowser();class SHAKE extends Keccak{constructor(){super()}final(len){return super.final(31,len)}static hash(){return new SHAKE}static hmac(bits,len){return super.hmac(bits,31,len)}static digest(data,bits,len){return super.digest(data,bits,31,len)}static root(left,right,bits,len){return super.root(left,right,bits,31,len)}static multi(x,y,z,bits,len){return super.multi(x,y,z,bits,31,len)}static mac(data,key,bits,len){return super.mac(data,key,bits,31,len)}}SHAKE.native=Keccak.native;SHAKE.id="SHAKE256";SHAKE.size=32;SHAKE.bits=256;SHAKE.blockSize=136;SHAKE.zero=bufferExports.Buffer.alloc(32,0);SHAKE.ctx=new SHAKE;shake=SHAKE;return shake}var shake256;var hasRequiredShake256;function requireShake256(){if(hasRequiredShake256)return shake256;hasRequiredShake256=1;const SHAKE=requireShake();class SHAKE256 extends SHAKE{constructor(){super()}init(){return super.init(256)}static hash(){return new SHAKE256}static hmac(len){return super.hmac(256,len)}static digest(data,len){return super.digest(data,256,len)}static root(left,right,len){return super.root(left,right,256,len)}static multi(x,y,z,len){return super.multi(x,y,z,256,len)}static mac(data,key,len){return super.mac(data,key,256,len)}}SHAKE256.native=SHAKE.native;SHAKE256.id="SHAKE256";SHAKE256.size=32;SHAKE256.bits=256;SHAKE256.blockSize=136;SHAKE256.zero=bufferExports.Buffer.alloc(32,0);SHAKE256.ctx=new SHAKE256;shake256=SHAKE256;return shake256}var ed448$1;var hasRequiredEd448;function requireEd448(){if(hasRequiredEd448)return ed448$1;hasRequiredEd448=1;const EDDSA=requireEddsa();const SHAKE256=requireShake256();ed448$1=new EDDSA("ED448","X448","MONT448",SHAKE256);return ed448$1}var ed448Browser;var hasRequiredEd448Browser;function requireEd448Browser(){if(hasRequiredEd448Browser)return ed448Browser;hasRequiredEd448Browser=1;ed448Browser=requireEd448();return ed448Browser}var ed448BrowserExports=requireEd448Browser();var backend=getDefaultExportFromCjs(ed448BrowserExports);const ed448=backend;const BN_0$9=BigInt(0);const BN_1$5=BigInt(1);const maxValue=9007199254740991;function fromTwos(_value,_width){const value=getUint(_value,"value");const width=BigInt(getNumber(_width,"width"));assert(value>>width===BN_0$9,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:_value});if(value>>width-BN_1$5){const mask=(BN_1$5<=-maxValue&&value<=maxValue,"overflow",name||"value",value);return BigInt(value);case"string":try{if(value===""){throw new Error("empty string")}if(value[0]==="-"&&value[1]!=="-"){return-BigInt(value.substring(1))}return BigInt(value)}catch(e){assertArgument(false,`invalid BigNumberish string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid BigNumberish value",name||"value",value)}function getUint(value,name){const result=getBigInt(value,name);assert(result>=BN_0$9,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:value});return result}const Nibbles="0123456789abcdef";function toBigInt(value){if(value instanceof Uint8Array){let result="0x0";for(const v of value){result+=Nibbles[v>>4];result+=Nibbles[v&15]}return BigInt(result)}return getBigInt(value)}function getNumber(value,name){switch(typeof value){case"bigint":assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return Number(value);case"number":assertArgument(Number.isInteger(value),"underflow",name||"value",value);assertArgument(value>=-maxValue&&value<=maxValue,"overflow",name||"value",value);return value;case"string":try{if(value===""){throw new Error("empty string")}return getNumber(BigInt(value),name)}catch(e){assertArgument(false,`invalid numeric string: ${e.message}`,name||"value",value)}}assertArgument(false,"invalid numeric value",name||"value",value)}function toNumber(value){return getNumber(toBigInt(value))}function toBeHex(_value,_width){const value=getUint(_value,"value");let result=value.toString(16);if(_width==null){if(result.length%2){result="0"+result}}else{const width=getNumber(_width,"width");assert(width*2>=result.length,`value exceeds width (${width} bits)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:_value});while(result.length>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){if(form!=null){assertNormalize(form);str=str.normalize(form)}let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}function toUtf8CodePoints(str,form){return getUtf8CodePoints(toUtf8Bytes(str,form))}async function getUrl(req,_signal){const protocol=req.url.split(":")[0].toLowerCase();assert(protocol==="http"||protocol==="https",`unsupported protocol ${protocol}`,"UNSUPPORTED_OPERATION",{info:{protocol:protocol},operation:"request"});assert(protocol==="https"||!req.credentials||req.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let signal=undefined;if(_signal){const controller=new AbortController;signal=controller.signal;_signal.addListener(()=>{controller.abort()})}const init={method:req.method,headers:new Headers(Array.from(req)),body:req.body||undefined,signal:signal};try{const resp=await fetch(req.url,init);const headers={};resp.headers.forEach((value,key)=>{headers[key.toLowerCase()]=value});const respBody=await resp.arrayBuffer();const body=respBody==null?null:new Uint8Array(respBody);return{statusCode:resp.status,statusMessage:resp.statusText,headers:headers,body:body}}catch(error){console.log({error:error});return undefined}}const MAX_ATTEMPTS=12;const SLOT_INTERVAL=250;let getUrlFunc=getUrl;const reData=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i");const reIpfs=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let locked$5=false;async function dataGatewayFunc(url,signal){try{const match=url.match(reData);if(!match){throw new Error("invalid data")}return new FetchResponse(200,"OK",{"content-type":match[1]||"text/plain"},match[2]?decodeBase64(match[3]):unpercent(match[3]))}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid data: URI)",{},null,new FetchRequest(url))}}function getIpfsGatewayFunc(baseUrl){async function gatewayIpfs(url,signal){try{const match=url.match(reIpfs);if(!match){throw new Error("invalid link")}return new FetchRequest(`${baseUrl}${match[2]}`)}catch(error){return new FetchResponse(599,"BAD REQUEST (invalid IPFS URI)",{},null,new FetchRequest(url))}}return gatewayIpfs}const Gateways={data:dataGatewayFunc,ipfs:getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/")};const fetchSignals=new WeakMap;class FetchCancelSignal{#listeners;#cancelled;constructor(request){this.#listeners=[];this.#cancelled=false;fetchSignals.set(request,()=>{if(this.#cancelled){return}this.#cancelled=true;for(const listener of this.#listeners){setTimeout(()=>{listener()},0)}this.#listeners=[]})}addListener(listener){assert(!this.#cancelled,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"});this.#listeners.push(listener)}get cancelled(){return this.#cancelled}checkSignal(){assert(!this.cancelled,"cancelled","CANCELLED",{})}}function checkSignal(signal){if(signal==null){throw new Error("missing signal; should not happen")}signal.checkSignal();return signal}class FetchRequest{#allowInsecure;#gzip;#headers;#method;#timeout;#url;#body;#bodyType;#creds;#preflight;#process;#retry;#signal;#throttle;get url(){return this.#url}set url(url){this.#url=String(url)}get body(){if(this.#body==null){return null}return new Uint8Array(this.#body)}set body(body){if(body==null){this.#body=undefined;this.#bodyType=undefined}else if(typeof body==="string"){this.#body=toUtf8Bytes(body);this.#bodyType="text/plain"}else if(body instanceof Uint8Array){this.#body=body;this.#bodyType="application/octet-stream"}else if(typeof body==="object"){this.#body=toUtf8Bytes(JSON.stringify(body));this.#bodyType="application/json"}else{throw new Error("invalid body")}}hasBody(){return this.#body!=null}get method(){if(this.#method){return this.#method}if(this.hasBody()){return"POST"}return"GET"}set method(method){if(method==null){method=""}this.#method=String(method).toUpperCase()}get headers(){const headers=Object.assign({},this.#headers);if(this.#creds){headers["authorization"]=`Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`}if(this.allowGzip){headers["accept-encoding"]="gzip"}if(headers["content-type"]==null&&this.#bodyType){headers["content-type"]=this.#bodyType}if(this.body){headers["content-length"]=String(this.body.length)}return headers}getHeader(key){return this.headers[key.toLowerCase()]}setHeader(key,value){this.#headers[String(key).toLowerCase()]=String(value)}clearHeaders(){this.#headers={}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index=0,"timeout must be non-zero","timeout",timeout);this.#timeout=timeout}get preflightFunc(){return this.#preflight||null}set preflightFunc(preflight){this.#preflight=preflight}get processFunc(){return this.#process||null}set processFunc(process){this.#process=process}get retryFunc(){return this.#retry||null}set retryFunc(retry){this.#retry=retry}constructor(url){this.#url=String(url);this.#allowInsecure=false;this.#gzip=true;this.#headers={};this.#method="";this.#timeout=3e5;this.#throttle={slotInterval:SLOT_INTERVAL,maxAttempts:MAX_ATTEMPTS}}toString(){return``}setThrottleParams(params){if(params.slotInterval!=null){this.#throttle.slotInterval=params.slotInterval}if(params.maxAttempts!=null){this.#throttle.maxAttempts=params.maxAttempts}}async#send(attempt,expires,delay,_request,_response){if(attempt>=this.#throttle.maxAttempts){return _response.makeServerError("exceeded maximum retry limit")}assert(getTime$2()<=expires,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:_request});if(delay>0){await wait(delay)}let req=this.clone();const scheme=(req.url.split(":")[0]||"").toLowerCase();if(scheme in Gateways){const result=await Gateways[scheme](req.url,checkSignal(_request.#signal));if(result instanceof FetchResponse){let response=result;if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}}}return response}req=result}if(this.preflightFunc){req=await this.preflightFunc(req)}const resp=await getUrlFunc(req,checkSignal(_request.#signal));let response=new FetchResponse(resp.statusCode,resp.statusMessage,resp.headers,resp.body,_request);if(response.statusCode===301||response.statusCode===302){try{const location=response.headers.location||"";return req.redirect(location).#send(attempt+1,expires,0,_request,response)}catch(error){}return response}else if(response.statusCode===429){if(this.retryFunc==null||await this.retryFunc(req,response,attempt)){const retryAfter=response.headers["retry-after"];let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(typeof retryAfter==="string"&&retryAfter.match(/^[1-9][0-9]*$/)){delay=parseInt(retryAfter)}return req.clone().#send(attempt+1,expires,delay,_request,response)}}if(this.processFunc){checkSignal(_request.#signal);try{response=await this.processFunc(req,response)}catch(error){if(error.throttle==null||typeof error.stall!=="number"){response.makeServerError("error in post-processing function",error).assertOk()}let delay=this.#throttle.slotInterval*Math.trunc(Math.random()*Math.pow(2,attempt));if(error.stall>=0){delay=error.stall}return req.clone().#send(attempt+1,expires,delay,_request,response)}}return response}send(){assert(this.#signal==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"});this.#signal=new FetchCancelSignal(this);return this.#send(0,getTime$2()+this.timeout,0,this,new FetchResponse(0,"",{},null,this))}cancel(){assert(this.#signal!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const signal=fetchSignals.get(this);if(!signal){throw new Error("missing signal; should not happen")}signal()}redirect(location){const current=this.url.split(":")[0].toLowerCase();const target=location.split(":")[0].toLowerCase();assert(this.method==="GET"&&(current!=="https"||target!=="http")&&location.match(/^https?:/),`unsupported redirect`,"UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`});const req=new FetchRequest(location);req.method="GET";req.allowGzip=this.allowGzip;req.timeout=this.timeout;req.#headers=Object.assign({},this.#headers);if(this.#body){req.#body=new Uint8Array(this.#body)}req.#bodyType=this.#bodyType;return req}clone(){const clone=new FetchRequest(this.url);clone.#method=this.#method;if(this.#body){clone.#body=this.#body}clone.#bodyType=this.#bodyType;clone.#headers=Object.assign({},this.#headers);clone.#creds=this.#creds;if(this.allowGzip){clone.allowGzip=true}clone.timeout=this.timeout;if(this.allowInsecureAuthentication){clone.allowInsecureAuthentication=true}clone.#preflight=this.#preflight;clone.#process=this.#process;clone.#retry=this.#retry;return clone}static lockConfig(){locked$5=true}static getGateway(scheme){return Gateways[scheme.toLowerCase()]||null}static registerGateway(scheme,func){scheme=scheme.toLowerCase();if(scheme==="http"||scheme==="https"){throw new Error(`cannot intercept ${scheme}; use registerGetUrl`)}if(locked$5){throw new Error("gateways locked")}Gateways[scheme]=func}static registerGetUrl(getUrl){if(locked$5){throw new Error("gateways locked")}getUrlFunc=getUrl}static createDataGateway(){return dataGatewayFunc}static createIpfsGatewayFunc(baseUrl){return getIpfsGatewayFunc(baseUrl)}}class FetchResponse{#statusCode;#statusMessage;#headers;#body;#request;#error;toString(){return``}get statusCode(){return this.#statusCode}get statusMessage(){return this.#statusMessage}get headers(){return Object.assign({},this.#headers)}get body(){return this.#body==null?null:new Uint8Array(this.#body)}get bodyText(){try{return this.#body==null?"":toUtf8String(this.#body)}catch(error){assert(false,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(error){assert(false,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const headers=this.headers;const keys=Object.keys(headers);let index=0;return{next:()=>{if(index{accum[k.toLowerCase()]=String(headers[k]);return accum},{});this.#body=body==null?null:new Uint8Array(body);this.#request=request||null;this.#error={message:""}}makeServerError(message,error){let statusMessage;if(!message){message=`${this.statusCode} ${this.statusMessage}`;statusMessage=`CLIENT ESCALATED SERVER ERROR (${message})`}else{statusMessage=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`}const response=new FetchResponse(599,statusMessage,this.headers,this.body,this.#request||undefined);response.#error={message:message,error:error};return response}throwThrottleError(message,stall){if(stall==null){stall=-1}else{assertArgument(Number.isInteger(stall)&&stall>=0,"invalid stall timeout","stall",stall)}const error=new Error(message||"throttling requests");defineProperties(error,{stall:stall,throttle:true});throw error}getHeader(key){return this.headers[key.toLowerCase()]}hasBody(){return this.#body!=null}get request(){return this.#request}ok(){return this.#error.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok()){return}let{message,error}=this.#error;if(message===""){message=`server response ${this.statusCode} ${this.statusMessage}`}assert(false,message,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:error})}}function getTime$2(){return(new Date).getTime()}function unpercent(value){return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi,(all,code)=>{return String.fromCharCode(parseInt(code,16))}))}function wait(delay){return new Promise(resolve=>setTimeout(resolve,delay))}var _a$1;const BN_N1=BigInt(-1);const BN_0$7=BigInt(0);const BN_1$4=BigInt(1);const BN_5=BigInt(5);const _guard$5={};let Zeros="0000";while(Zeros.length<80){Zeros+=Zeros}function getTens(decimals){let result=Zeros;while(result.length=-limit&&valBN_0$7){val=fromTwos(mask(val,width),width)}else{val=-fromTwos(mask(-val,width),width)}}else{const limit=BN_1$4<=0&&val{if(v[key]==null){return defaultValue}assertArgument(typeof v[key]===type,"invalid fixed format ("+key+" not "+type+")","format."+key,v[key]);return v[key]};signed=check("signed","boolean",signed);width=check("width","number",width);decimals=check("decimals","number",decimals)}assertArgument(width%8===0,"invalid FixedNumber width (not byte aligned)","format.width",width);assertArgument(decimals<=80,"invalid FixedNumber decimals (too large)","format.decimals",decimals);const name=(signed?"":"u")+"fixed"+String(width)+"x"+String(decimals);return{signed:signed,width:width,decimals:decimals,name:name}}function toString(val,decimals){let negative="";if(val0){b*=getTens(delta)}else if(delta<0){a*=getTens(-delta)}if(ab){return-1}return 0}eq(other){return this.cmp(other)===0}lt(other){return this.cmp(other)<0}lte(other){return this.cmp(other)<=0}gt(other){return this.cmp(other)>0}gte(other){return this.cmp(other)>=0}floor(){let val=this.#val;if(this.#valBN_0$7){val+=this.#tens-BN_1$4}val=this.#val/this.#tens*this.#tens;return this.#checkValue(val,"ceiling")}round(decimals){if(decimals==null){decimals=0}if(decimals>=this.decimals){return this}const delta=this.decimals-decimals;const bump=BN_5*getTens(delta-1);let value=this.value+bump;const tens=getTens(delta);value=value/tens*tens;checkValue(value,this.#format,"round");return new _a$1(_guard$5,value,this.#format)}isZero(){return this.#val===BN_0$7}isNegative(){return this.#val0){const tens=getTens(delta);assert(value%tens===BN_0$7,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:_value});value/=tens}else if(delta<0){value*=getTens(-delta)}checkValue(value,format,"fromValue");return new _a$1(_guard$5,value,format)}static fromString(_value,_format){const match=_value.match(/^(-?)([0-9]*)\.?([0-9]*)$/);assertArgument(match&&match[2].length+match[3].length>0,"invalid FixedNumber string value","value",_value);const format=getFormat(_format);let whole=match[2]||"0",decimal=match[3]||"";while(decimal.length{assert(offset<=data.length,"data short segment too short","BUFFER_OVERRUN",{buffer:data,length:data.length,offset:offset})};if(data[offset]>=248){const lengthLength=data[offset]-247;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);return _decodeChildren(data,offset,offset+1+lengthLength,lengthLength+length)}else if(data[offset]>=192){const length=data[offset]-192;checkOffset(offset+1+length);return _decodeChildren(data,offset,offset+1,length)}else if(data[offset]>=184){const lengthLength=data[offset]-183;checkOffset(offset+1+lengthLength);const length=unarrayifyInteger(data,offset+1,lengthLength);checkOffset(offset+1+lengthLength+length);const result=hexlify(data.slice(offset+1+lengthLength,offset+1+lengthLength+length));return{consumed:1+lengthLength+length,result:result}}else if(data[offset]>=128){const length=data[offset]-128;checkOffset(offset+1+length);const result=hexlify(data.slice(offset+1,offset+1+length));return{consumed:1+length,result:result}}return{consumed:1,result:hexlifyByte(data[offset])}}function decodeRlp(_data){const data=getBytes(_data,"data");const decoded=_decode(data,0);assertArgument(decoded.consumed===data.length,"unexpected junk after rlp payload","data",_data);return decoded.result}function arrayifyInteger(value){const result=[];while(value){result.unshift(value&255);value>>=8}return result}function _encode(object){if(Array.isArray(object)){let payload=[];object.forEach(function(child){payload=payload.concat(_encode(child))});if(payload.length<=55){payload.unshift(192+payload.length);return payload}const length=arrayifyInteger(payload.length);length.unshift(247+length.length);return length.concat(payload)}const data=Array.prototype.slice.call(getBytes(object,"object"));if(data.length===1&&data[0]<=127){return data}else if(data.length<=55){data.unshift(128+data.length);return data}const length=arrayifyInteger(data.length);length.unshift(183+length.length);return length.concat(data)}const nibbles="0123456789abcdef";function encodeRlp(object){let result="0x";for(const v of _encode(object)){result+=nibbles[v>>4];result+=nibbles[v&15]}return result}const names=["ore","fecore","picore","nacore","mcore","micore","core"];function formatUnits(value,unit){let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index}else if(unit!=null){decimals=getNumber(unit,"unit")}return FixedNumber.fromValue(value,decimals,{decimals:decimals}).toString()}const scientificToDecimal=num=>{var nsign=Math.sign(num);num=Math.abs(num);if(/\d+\.?\d*e[\+\-]*\d+/i.test(num)){var zero="0",parts=String(num).toLowerCase().split("e"),e=parts.pop(),l=Math.abs(e),sign=e/l,coeff_array=parts[0].split(".");if(sign===-1){l=l-coeff_array[0].length;if(l<0){num=coeff_array[0].slice(0,l)+"."+coeff_array[0].slice(l)+(coeff_array.length===2?coeff_array[1]:"")}else{num=zero+"."+new Array(l+1).join(zero)+coeff_array.join("")}}else{var dec=coeff_array[1];if(dec)l=l-dec.length;if(l<0){num=coeff_array[0]+dec.slice(0,l)+"."+dec.slice(l)}else{num=coeff_array.join("")+new Array(l+1).join(zero)}}}return nsign<0?"-"+num:num};const trimDecimals=(n,decimals=18)=>{n+="";if(n.indexOf(".")===-1)return n;const arr=n.split(".");const fraction=arr[1].substr(0,decimals);return arr[0]+"."+fraction};function parseUnits(value,unit){assertArgument(typeof value==="string","value must be a string","value",value);if(value.includes("e")){value=scientificToDecimal(value).toString()}let decimals=18;if(typeof unit==="string"){const index=names.indexOf(unit);assertArgument(index>=0,"invalid unit","unit",unit);decimals=3*index;value=trimDecimals(value,decimals)}else if(unit!=null){decimals=getNumber(unit,"unit");value=trimDecimals(value,decimals)}return FixedNumber.fromString(value,{decimals:decimals}).value}function formatXCB(ore){return formatUnits(ore,18)}function parseXCB(xcb){return parseUnits(xcb,18)}function uuidV4(randomBytes){const bytes=getBytes(randomBytes,"randomBytes");bytes[6]=bytes[6]&15|64;bytes[8]=bytes[8]&63|128;const value=hexlify(bytes);return[value.substring(2,10),value.substring(10,14),value.substring(14,18),value.substring(18,22),value.substring(22,34)].join("-")}var pbkdf2$2={};var hasRequiredPbkdf2;function requirePbkdf2(){if(hasRequiredPbkdf2)return pbkdf2$2;hasRequiredPbkdf2=1;const assert=requireAssert();const crypto=commonjsGlobal.crypto||commonjsGlobal.msCrypto||{};const subtle=crypto.subtle||{};function derive(hash,pass,salt,iter,len){if(typeof pass==="string")pass=bufferExports.Buffer.from(pass,"utf8");if(typeof salt==="string")salt=bufferExports.Buffer.from(salt,"utf8");if(salt==null)salt=bufferExports.Buffer.alloc(0);assert(hash&&typeof hash.id==="string");assert(bufferExports.Buffer.isBuffer(pass));assert(bufferExports.Buffer.isBuffer(salt));assert(iter>>>0===iter);assert(len>>>0===len);const size=hash.size;const blocks=Math.ceil(len/size);const out=bufferExports.Buffer.alloc(blocks*size);const state=bufferExports.Buffer.alloc(salt.length+4);salt.copy(state,0);if(pass.length>hash.blockSize){pass=hash.digest(pass);assert(pass.length<=hash.blockSize)}for(let i=0;i>>24;state[salt.length+1]=round>>>16;state[salt.length+2]=round>>>8;state[salt.length+3]=round;const block=hash.mac(state,pass);let mac=block;for(let j=1;j>>0===iter);assert(len>>>0===len);const name=getHash(hash);if(!subtle.importKey||!subtle.deriveBits||!name)return derive(hash,pass,salt,iter,len);const algo={name:"PBKDF2"};const use=["deriveBits"];const options={name:"PBKDF2",salt:salt,iterations:iter,hash:name};const key=await subtle.importKey("raw",pass,algo,false,use);const out=await subtle.deriveBits(options,key,len*8);return bufferExports.Buffer.from(out)}function getHash(hash){switch(hash.id){case"SHA1":return"SHA-1";case"SHA256":return"SHA-256";case"SHA384":return"SHA-384";case"SHA512":return"SHA-512";default:return null}}pbkdf2$2.native=0;pbkdf2$2.derive=derive;pbkdf2$2.deriveAsync=deriveAsync;return pbkdf2$2}var pbkdf2Browser;var hasRequiredPbkdf2Browser;function requirePbkdf2Browser(){if(hasRequiredPbkdf2Browser)return pbkdf2Browser;hasRequiredPbkdf2Browser=1;pbkdf2Browser=requirePbkdf2();return pbkdf2Browser}var pbkdf2BrowserExports=requirePbkdf2Browser();var pbkdf2$1=getDefaultExportFromCjs(pbkdf2BrowserExports);var sha3;var hasRequiredSha3;function requireSha3(){if(hasRequiredSha3)return sha3;hasRequiredSha3=1;const Keccak=requireKeccak();class SHA3 extends Keccak{constructor(){super()}final(){return super.final(6,null)}static hash(){return new SHA3}static hmac(bits){return super.hmac(bits,6,null)}static digest(data,bits){return super.digest(data,bits,6,null)}static root(left,right,bits){return super.root(left,right,bits,6,null)}static multi(x,y,z,bits){return super.multi(x,y,z,bits,6,null)}static mac(data,key,bits){return super.mac(data,key,bits,6,null)}}SHA3.native=0;SHA3.id="SHA3_256";SHA3.size=32;SHA3.bits=256;SHA3.blockSize=136;SHA3.zero=bufferExports.Buffer.alloc(32,0);SHA3.ctx=new SHA3;sha3=SHA3;return sha3}var sha3Browser;var hasRequiredSha3Browser;function requireSha3Browser(){if(hasRequiredSha3Browser)return sha3Browser;hasRequiredSha3Browser=1;sha3Browser=requireSha3();return sha3Browser}var sha3512;var hasRequiredSha3512;function requireSha3512(){if(hasRequiredSha3512)return sha3512;hasRequiredSha3512=1;const SHA3=requireSha3Browser();class SHA3_512 extends SHA3{constructor(){super()}init(){return super.init(512)}static hash(){return new SHA3_512}static hmac(){return super.hmac(512)}static digest(data){return super.digest(data,512)}static root(left,right){return super.root(left,right,512)}static multi(x,y,z){return super.multi(x,y,z,512)}static mac(data,key){return super.mac(data,key,512)}}SHA3_512.native=SHA3.native;SHA3_512.id="SHA3_512";SHA3_512.size=64;SHA3_512.bits=512;SHA3_512.blockSize=72;SHA3_512.zero=bufferExports.Buffer.alloc(64,0);SHA3_512.ctx=new SHA3_512;sha3512=SHA3_512;return sha3512}var sha3512Exports=requireSha3512();var SHA3_512=getDefaultExportFromCjs(sha3512Exports);class Ed448Goldilock{static _channel=ed448;static generatePrivateKey(){var privateKey=ed448.privateKeyGenerate();privateKey[56]&=127;return privateKey}static getPublicKeyFromPrivateKey(privateKey){var secret=bufferExports.Buffer.from(privateKey,"hex");if(secret[56]>127){var scalar=secret.slice(0,56);scalar[0]&=252;scalar[55]|=128;var publicKey=this._channel.publicKeyFromScalar(scalar);return bufferExports.Buffer.from(publicKey).toString("hex")}else{var publicKey=this._channel.publicKeyCreate(secret);return bufferExports.Buffer.from(publicKey).toString("hex")}}static signWithPrivateKey(privateKey,msg){var msgToSign=bufferExports.Buffer.from(msg,"hex");var secret=bufferExports.Buffer.from(privateKey,"hex");if(secret[56]>127){var prefix=secret.slice(0,57);prefix[0]&=252;prefix[56]=0;prefix[55]|=128;var scalar=prefix.slice(0,56);var signedMessage=this._channel.signWithScalar(msgToSign,scalar,prefix);return bufferExports.Buffer.from(signedMessage).toString("hex")}else{var signedMessage=this._channel.sign(msgToSign,secret);return bufferExports.Buffer.from(signedMessage).toString("hex")}}static signWithPrivateKeyNConcatPubkey(privateKey,msg){var signedMessage=Ed448Goldilock.signWithPrivateKey(privateKey,msg);var publicKey=Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);return signedMessage+publicKey}static verifySignature(msgHash,signedMsg,pubKey){return this._channel.verify(bufferExports.Buffer.from(msgHash,"hex"),bufferExports.Buffer.from(signedMsg,"hex"),bufferExports.Buffer.from(pubKey,"hex"))}static SHA512Hash(password,salt){var p1=bufferExports.Buffer.from(password,"hex");var s1=bufferExports.Buffer.from(salt,"hex");return bufferExports.Buffer.from(pbkdf2$1.derive(SHA3_512,p1,s1,2048,57)).toString("hex")}static concatenateAndHex(prefix,key,index,salt){var ind=bufferExports.Buffer.alloc(4);var p=bufferExports.Buffer.alloc(1);p[0]=prefix%256;var j=index;for(let i=0;i<4;i++){ind[i]=j%256;j=Math.floor(j/256)}var t=p.toString("hex")+key+ind.toString("hex");return Ed448Goldilock.SHA512Hash(t,salt)}static addScalar(a,b){var a1=bufferExports.Buffer.from(a,"hex");var b1=bufferExports.Buffer.from(b.substr(0,106)+"00000000","hex");b1[0]&=252;var c=bufferExports.Buffer.alloc(57);var hold=0;for(let i=0;i<57;i++){hold+=a1[i]+b1[i];c[i]=hold%256;hold=Math.floor(hold/256)}return c.toString("hex")}static seedToExtendedPrivate(seed){var s1=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f72746865636861696e");var s2=Ed448Goldilock.SHA512Hash(seed,"6d6e656d6f6e6963666f727468656b6579");var b=bufferExports.Buffer.from(s2,"hex");b[56]|=128;b[55]|=128;b[55]&=191;var s3=b.toString("hex");return s1+s3}static childPrivateToPrivate(s,index){var s0=s.substr(0,114);var s1=s.substr(114,228);var r0,r1;if(index>=2147483648){r0=Ed448Goldilock.concatenateAndHex(1,s1,index,s0);r1=Ed448Goldilock.concatenateAndHex(0,s1,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}else{var pub=Ed448Goldilock.getPublicKeyFromPrivateKey(s1);r0=Ed448Goldilock.concatenateAndHex(3,pub,index,s0);r1=Ed448Goldilock.concatenateAndHex(2,pub,index,s0);return r0+Ed448Goldilock.addScalar(s1,r1)}}static HDWalletGenerateKeyFromSeed(seed,index){var m=Ed448Goldilock.seedToExtendedPrivate(seed);var k1=Ed448Goldilock.childPrivateToPrivate(m,2147483648+44);var k2=Ed448Goldilock.childPrivateToPrivate(k1,2147483648+654);var k3=Ed448Goldilock.childPrivateToPrivate(k2,2147483648+0);var k4=Ed448Goldilock.childPrivateToPrivate(k3,2147483648+0);var k5=Ed448Goldilock.childPrivateToPrivate(k4,index);return k5.substr(114,228)}}function getGlobal$1(){if(typeof globalThis!=="undefined")return globalThis;if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal$1();const crypto=anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"ripemd160":return ripemd160$1.create();case"sha256":return sha256$2.create();case"sha512":return sha512$1.create();case"sha3-256":return sha3_256.create();case"sha3-512":return sha3_512.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}function createHmac(_algo,key){const algo={sha256:sha256$2,sha512:sha512$1,"sha3-256":sha3_256,"sha3-512":sha3_512}[_algo];assertArgument(algo!=null,"invalid hmac algorithm","algorithm",_algo);return hmac$1.create(algo,key)}function pbkdf2Sync(password,salt,iterations,keylen,_algo){const algo={sha256:sha256$2,sha512:sha512$1}[_algo];assertArgument(algo!=null,"invalid pbkdf2 algorithm","algorithm",_algo);return pbkdf2$3(algo,password,salt,{c:iterations,dkLen:keylen})}function randomBytes$1(length){assert(crypto!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"});assertArgument(Number.isInteger(length)&&length>0&&length<=1024,"invalid length","length",length);const result=new Uint8Array(length);crypto.getRandomValues(result);return result}const _sha256=data=>hexlify(createHash("sha3-256").update(data).digest());const _sha512=data=>hexlify(createHash("sha3-512").update(data).digest());let __sha256=_sha256;let __sha512=_sha512;let locked256=false,locked512=false;var SupportedAlgorithm;(function(SupportedAlgorithm){SupportedAlgorithm["sha256"]="sha256";SupportedAlgorithm["sha512"]="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));function sha256(data){return hexlify(__sha256(getBytes(data)))}function legacySha256(data){const _data=getBytes(data,"data");const hexlified=hexlify(createHash("sha256").update(_data).digest());return hexlified}sha256._=_sha256;sha256.lock=function(){locked256=true};sha256.register=function(func){if(locked256){throw new Error("sha256 is locked")}__sha256=func};Object.freeze(sha256);function sha512(data){return hexlify(__sha512(getBytes(data)))}sha512._=_sha512;sha512.lock=function(){locked512=true};sha512.register=function(func){if(locked512){throw new Error("sha512 is locked")}__sha512=func};Object.freeze(sha512);const logger$3=new Logger("address/0.0.1");const precompiledAddresses=["0000000000000000000000000000000000000000000000000000000000000000","0000000000000000000000000000000000000000000000000000000000000001","0000000000000000000000000000000000000000000000000000000000000002","0000000000000000000000000000000000000000000000000000000000000003","0000000000000000000000000000000000000000000000000000000000000004","0000000000000000000000000000000000000000000000000000000000000005","0000000000000000000000000000000000000000000000000000000000000006","0000000000000000000000000000000000000000000000000000000000000007","0000000000000000000000000000000000000000000000000000000000000008","0000000000000000000000000000000000000000000000000000000000000009"];function removeHexPrefix$1(val){return val.substring(0,2)==="0x"?val.substring(2):val}function calculateCheckSum(_address,_prefix){const address=getBytes("0x"+_address.replace("0x",""));const prefix=getBytes("0x"+_prefix.replace("0x",""));const tmpConcated=new Uint8Array([...address,...prefix]);const hexedConcat=hexlify(tmpConcated).replace("0x","")+"00";const mods=Array.from(hexedConcat.toUpperCase(),c=>{const charCode=c.charCodeAt(0);return charCode>64&&charCode<91?(charCode-55).toString():(charCode-48).toString()}).join("");const bigVal=BigInt(mods);const val97=BigInt(97);const val98=BigInt(98);const remainder=bigVal%val97;const checkSum=val98-remainder;const result=checkSum>9?checkSum.toString():"0"+checkSum.toString();return result}function getAddress(address){if(typeof address!=="string"){logger$3.throwArgumentError("invalid address","address",address)}if(!address.match(/^(0x)?[0-9a-fA-F]{44}$/)){logger$3.throwArgumentError("invalid address","address",address)}const raw=removeHexPrefix$1(address);if(precompiledAddresses.includes(raw)){return"0x"+raw}const prefix=raw.substring(0,2);const val=raw.substring(4);const checksum=calculateCheckSum(val,prefix);if(checksum!==raw.substring(2,4)){logger$3.throwArgumentError("bad address checksum","address",address)}return"0x"+prefix+checksum+val}function networkIdToPrefix(networkId){if(networkId==1){return"cb"}else if(networkId==3||networkId==4){return"ab"}else if(networkId>10||networkId==0){return"ce"}else{logger$3.throwArgumentError("bad networkId","networkId",networkId);return""}}let locked$4=false;const _computeHmac=function(algorithm,key,data){return createHmac(algorithm,key).update(data).digest()};let __computeHmac=_computeHmac;function computeHmac(algorithm,_key,_data){const key=getBytes(_key,"key");const data=getBytes(_data,"data");return hexlify(__computeHmac(algorithm,key,data))}computeHmac._=_computeHmac;computeHmac.lock=function(){locked$4=true};computeHmac.register=function(func){if(locked$4){throw new Error("computeHmac is locked")}__computeHmac=func};Object.freeze(computeHmac);let locked$3=false;const _ripemd160=function(data){return ripemd160$1(data)};let __ripemd160=_ripemd160;function ripemd160(_data){const data=getBytes(_data,"data");return hexlify(__ripemd160(data))}ripemd160._=_ripemd160;ripemd160.lock=function(){locked$3=true};ripemd160.register=function(func){if(locked$3){throw new TypeError("ripemd160 is locked")}__ripemd160=func};Object.freeze(ripemd160);let locked$2=false;const _pbkdf2=function(password,salt,iterations,keylen,algo){return pbkdf2Sync(password,salt,iterations,keylen,algo)};let __pbkdf2=_pbkdf2;function pbkdf2(_password,_salt,iterations,keylen,algo){const password=getBytes(_password,"password");const salt=getBytes(_salt,"salt");return hexlify(__pbkdf2(password,salt,iterations,keylen,algo))}pbkdf2._=_pbkdf2;pbkdf2.lock=function(){locked$2=true};pbkdf2.register=function(func){if(locked$2){throw new Error("pbkdf2 is locked")}__pbkdf2=func};Object.freeze(pbkdf2);let locked$1=false;const _randomBytes=function(length){return new Uint8Array(randomBytes$1(length))};let __randomBytes=_randomBytes;function randomBytes(length){return __randomBytes(length)}randomBytes._=_randomBytes;randomBytes.lock=function(){locked$1=true};randomBytes.register=function(func){if(locked$1){throw new Error("randomBytes is locked")}__randomBytes=func};Object.freeze(randomBytes);function XorAndSalsa(prev,pi,input,ii,out,oi){let y00=prev[pi++]^input[ii++],y01=prev[pi++]^input[ii++];let y02=prev[pi++]^input[ii++],y03=prev[pi++]^input[ii++];let y04=prev[pi++]^input[ii++],y05=prev[pi++]^input[ii++];let y06=prev[pi++]^input[ii++],y07=prev[pi++]^input[ii++];let y08=prev[pi++]^input[ii++],y09=prev[pi++]^input[ii++];let y10=prev[pi++]^input[ii++],y11=prev[pi++]^input[ii++];let y12=prev[pi++]^input[ii++],y13=prev[pi++]^input[ii++];let y14=prev[pi++]^input[ii++],y15=prev[pi++]^input[ii++];let x00=y00,x01=y01,x02=y02,x03=y03,x04=y04,x05=y05,x06=y06,x07=y07,x08=y08,x09=y09,x10=y10,x11=y11,x12=y12,x13=y13,x14=y14,x15=y15;for(let i=0;i<8;i+=2){x04^=rotl(x00+x12|0,7);x08^=rotl(x04+x00|0,9);x12^=rotl(x08+x04|0,13);x00^=rotl(x12+x08|0,18);x09^=rotl(x05+x01|0,7);x13^=rotl(x09+x05|0,9);x01^=rotl(x13+x09|0,13);x05^=rotl(x01+x13|0,18);x14^=rotl(x10+x06|0,7);x02^=rotl(x14+x10|0,9);x06^=rotl(x02+x14|0,13);x10^=rotl(x06+x02|0,18);x03^=rotl(x15+x11|0,7);x07^=rotl(x03+x15|0,9);x11^=rotl(x07+x03|0,13);x15^=rotl(x11+x07|0,18);x01^=rotl(x00+x03|0,7);x02^=rotl(x01+x00|0,9);x03^=rotl(x02+x01|0,13);x00^=rotl(x03+x02|0,18);x06^=rotl(x05+x04|0,7);x07^=rotl(x06+x05|0,9);x04^=rotl(x07+x06|0,13);x05^=rotl(x04+x07|0,18);x11^=rotl(x10+x09|0,7);x08^=rotl(x11+x10|0,9);x09^=rotl(x08+x11|0,13);x10^=rotl(x09+x08|0,18);x12^=rotl(x15+x14|0,7);x13^=rotl(x12+x15|0,9);x14^=rotl(x13+x12|0,13);x15^=rotl(x14+x13|0,18)}out[oi++]=y00+x00|0;out[oi++]=y01+x01|0;out[oi++]=y02+x02|0;out[oi++]=y03+x03|0;out[oi++]=y04+x04|0;out[oi++]=y05+x05|0;out[oi++]=y06+x06|0;out[oi++]=y07+x07|0;out[oi++]=y08+x08|0;out[oi++]=y09+x09|0;out[oi++]=y10+x10|0;out[oi++]=y11+x11|0;out[oi++]=y12+x12|0;out[oi++]=y13+x13|0;out[oi++]=y14+x14|0;out[oi++]=y15+x15|0}function BlockMix(input,ii,out,oi,r){let head=oi+0;let tail=oi+16*r;for(let i=0;i<16;i++)out[tail+i]=input[ii+(2*r-1)*16+i];for(let i=0;i0)tail+=16;XorAndSalsa(out,head,input,ii+=16,out,tail)}}const SCRYPT_DEFAULT_MAXMEM=128*8*(2**20+1+1);function scryptInit(password,salt,_opts){const opts=checkOpts({dkLen:32,asyncTick:10,maxmem:SCRYPT_DEFAULT_MAXMEM},_opts);const{N,r,p,dkLen,asyncTick,maxmem,onProgress}=opts;anumber(N,"N");anumber(r,"r");anumber(p,"p");anumber(dkLen,"dkLen");anumber(asyncTick,"asyncTick");anumber(maxmem,"maxmem");if(onProgress!==undefined&&typeof onProgress!=="function")throw new Error('"onProgress" must be a function');if(r<1)throw new Error('"r" expected integer >= 1');const blockSize=128*r;const blockSize32=blockSize/4;const pow32=Math.pow(2,32);if(N<=1||(N&N-1)!==0||N>pow32)throw new Error('"N" expected a power of 2, and 2^1 <= N <= 2^32');if(p<1||p>(pow32-1)*32/blockSize)throw new Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)');if(dkLen<1||dkLen>(pow32-1)*32)throw new Error('"dkLen" expected integer 1..(2^32 - 1) * 32');const memUsed=blockSize*(N+p+1);if(memUsed>maxmem)throw new Error('"maxmem" limit was hit: memUsed(128*r*(N+p+1))='+memUsed+", maxmem="+maxmem);const B=pbkdf2$3(sha256$2,password,salt,{c:1,dkLen:blockSize*p});const B32=u32(B);const V=u32(new Uint8Array(blockSize*N));const tmp=u32(new Uint8Array(blockSize));let blockMixCb=()=>{};if(onProgress){const totalBlockMix=2*N*p;const callbackPer=Math.max(Math.floor(totalBlockMix/1e4),1);let blockMixCnt=0;blockMixCb=()=>{blockMixCnt++;if(onProgress&&(!(blockMixCnt%callbackPer)||blockMixCnt===totalBlockMix)){try{onProgress(blockMixCnt/totalBlockMix)}catch(e){clean(B,V,tmp);throw e}}}}return{N:N,r:r,p:p,dkLen:dkLen,blockSize32:blockSize32,V:V,B32:B32,B:B,tmp:tmp,blockMixCb:blockMixCb,asyncTick:asyncTick}}function scryptOutput(password,dkLen,B,V,tmp){const res=pbkdf2$3(sha256$2,password,B,{c:1,dkLen:dkLen});clean(B,V,tmp);return res}function scrypt$1(password,salt,opts){const{N,r,p,dkLen,blockSize32,V,B32,B,tmp,blockMixCb}=scryptInit(password,salt,opts);swap32IfBE(B32);for(let pi=0;pi>>0;for(let k=0;kclean(B,V,tmp);swap32IfBE(B32);for(let pi=0;pi{BlockMix(V,pos,V,pos+=blockSize32,r);blockMixCb()},abort);BlockMix(V,(N-1)*blockSize32,B32,Pi,r);blockMixCb();await asyncLoop(N,asyncTick,()=>{const j=(B32[Pi+blockSize32-16]&N-1)>>>0;for(let k=0;k127){const prefix=keyBuffer.slice(0,57);prefix[0]&=252;prefix[55]|=128;prefix[56]=0;const scalar=prefix.slice(0,56);const bufferDigest=bufferExports.Buffer.from(digestBuffer);const bufferPrfx=bufferExports.Buffer.from(prefix);const bufferScalar=bufferExports.Buffer.from(scalar);const sig=ed448.signWithScalar(bufferDigest,bufferScalar,bufferPrfx);const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}const sig=ed448.sign(bufferExports.Buffer.from(digestBuffer),bufferExports.Buffer.from(keyBuffer));const hexlified=hexlify(sig);return hexConcat([hexlified,this.publicKey])}computeSharedSecret(other){const pub=bufferExports.Buffer.from(getBytesCopy(other));assertArgument(pub.length===57&&ed448.publicKeyVerify(pub),"invalid public key","other",other);const key=bufferExports.Buffer.from(getBytesCopy(this.#privateKey));if(key[56]>127){const scalar=key.subarray(0,56);scalar[0]&=252;scalar[55]|=128;return hexlify(ed448.deriveWithScalar(pub,scalar))}return hexlify(ed448.derive(pub,key))}static computePublicKey(key,compressed){const bytes=bufferExports.Buffer.from(arrayify(key));if(bytes.length!==57){logger$2.throwArgumentError("invalid private key","key","[REDACTED]")}if(bytes[56]>127){const scalar=bytes.slice(0,56);scalar[0]&=252;scalar[55]|=128;const pub=ed448.publicKeyFromScalar(scalar);return hexlify(pub)}const pub=ed448.publicKeyCreate(bytes);return hexlify(pub)}static recoverPublicKey(digest,signature){assertArgument(dataLength(digest)===32,"invalid digest length","digest",digest);const digestBuffer=bufferExports.Buffer.from(arrayify(digest));const sigBuffer=bufferExports.Buffer.from(arrayify(signature));if(sigBuffer.length!==171){logger$2.throwArgumentError("invalid signature","signature",signature)}const sig=sigBuffer.slice(0,114);const pub=sigBuffer.slice(114);if(ed448.verify(digestBuffer,sig,pub)){return hexlify(pub)}logger$2.throwArgumentError("invalid signature","signature",signature);return""}static addPoints(p0,p1,compressed){const points=[p0,p1].map(point=>{const bytes=bufferExports.Buffer.from(getBytesCopy(point));assertArgument(bytes.length===57&&ed448.publicKeyVerify(bytes),"invalid public key","point",point);return bytes});return hexlify(ed448.publicKeyCombine(points))}}const BN_0$6=BigInt(0);const BN_1$3=BigInt(1);const BN_2$1=BigInt(2);const BN_27=BigInt(27);const BN_28=BigInt(28);const BN_35=BigInt(35);const _guard$4={};class Signature{#r;#s;#v;#networkV;get r(){return this.#r}set r(value){assertArgument(dataLength(value)===32,"invalid r","value",value);this.#r=hexlify(value)}get s(){return this.#s}set s(_value){assertArgument(dataLength(_value)===32,"invalid s","value",_value);const value=hexlify(_value);assertArgument(parseInt(value.substring(0,3))<8,"non-canonical s","value",value);this.#s=value}get v(){return this.#v}set v(value){const v=getNumber(value,"value");assertArgument(v===27||v===28,"invalid v","v",value);this.#v=v}get networkV(){return this.#networkV}get legacynetworkId(){const v=this.networkV;if(v==null){return null}return Signature.getnetworkId(v)}get yParity(){return this.v===27?0:1}get yParityAndS(){const yParityAndS=getBytes(this.s);if(this.yParity){yParityAndS[0]|=128}return hexlify(yParityAndS)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(guard,r,s,v){assertPrivate(guard,_guard$4,"Signature");this.#r=r;this.#s=s;this.#v=v;this.#networkV=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const clone=new Signature(_guard$4,this.r,this.s,this.v);if(this.networkV){clone.#networkV=this.networkV}return clone}toJSON(){const networkV=this.networkV;return{_type:"signature",networkV:networkV!=null?networkV.toString():null,r:this.r,s:this.s,v:this.v}}static getnetworkId(v){const bv=getBigInt(v,"v");if(bv==BN_27||bv==BN_28){return BN_0$6}assertArgument(bv>=BN_35,"invalid EIP-155 v","v",v);return(bv-BN_35)/BN_2$1}static getnetworkIdV(networkId,v){return getBigInt(networkId)*BN_2$1+BigInt(35+v-27)}static getNormalizedV(v){const bv=getBigInt(v);if(bv===BN_0$6||bv===BN_27){return 27}if(bv===BN_1$3||bv===BN_28){return 28}assertArgument(bv>=BN_35,"invalid v","v",v);return bv&BN_1$3?27:28}}function lock(){computeHmac.lock();pbkdf2.lock();randomBytes.lock();ripemd160.lock();scrypt.lock();scryptSync.lock();sha256.lock();sha512.lock();randomBytes.lock()}function removeHexPrefix(val){return val.substring(0,2)==="0x"?val.substring(2):val}function publicToAddress(key,prefix){const val=hexDataSlice(sha256(key),12);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function computeAddress(key,prefix){let pubkey;if(typeof key==="string"){pubkey=SigningKey.computePublicKey(key,false)}else{pubkey=key.publicKey}return publicToAddress(pubkey,prefix)}function recoverAddress(digest,signature,prefix){const publicKey=SigningKey.recoverPublicKey(arrayify(digest),signature);return publicToAddress(publicKey,prefix)}function extractPrefix(address){address=getAddress(address);return address.substring(2,4)}const WordSize=32;const Padding=new Uint8Array(WordSize);const passProperties$1=["then"];const _guard$3={};function throwError(name,error){const wrapped=new Error(`deferred error during ABI decoding triggered accessing ${name}`);wrapped.error=error;throw wrapped}class Result extends Array{#names;constructor(...args){const guard=args[0];let items=args[1];let names=(args[2]||[]).slice();let wrap=true;if(guard!==_guard$3){items=args;names=[];wrap=false}super(items.length);items.forEach((item,index)=>{this[index]=item});const nameCounts=names.reduce((accum,name)=>{if(typeof name==="string"){accum.set(name,(accum.get(name)||0)+1)}return accum},new Map);this.#names=Object.freeze(items.map((item,index)=>{const name=names[index];if(name!=null&&nameCounts.get(name)===1){return name}return null}));if(!wrap){return}Object.freeze(this);return new Proxy(this,{get:(target,prop,receiver)=>{if(typeof prop==="string"){if(prop.match(/^[0-9]+$/)){const index=getNumber(prop,"%index");if(index<0||index>=this.length){throw new RangeError("out of result range")}const item=target[index];if(item instanceof Error){throwError(`index ${index}`,item)}return item}if(passProperties$1.indexOf(prop)>=0){return Reflect.get(target,prop,receiver)}const value=target[prop];if(value instanceof Function){return function(...args){return value.apply(this===receiver?target:this,args)}}else if(!(prop in target)){return target.getValue.apply(this===receiver?target:this,[prop])}}return Reflect.get(target,prop,receiver)}})}toArray(){const result=[];this.forEach((item,index)=>{if(item instanceof Error){throwError(`index ${index}`,item)}result.push(item)});return result}toObject(){return this.#names.reduce((accum,name,index)=>{assert(name!=null,"value at index ${ index } unnamed","UNSUPPORTED_OPERATION",{operation:"toObject()"});if(!(name in accum)){accum[name]=this.getValue(name)}return accum},{})}slice(start,end){if(start==null){start=0}if(start<0){start+=this.length;if(start<0){start=0}}if(end==null){end=this.length}if(end<0){end+=this.length;if(end<0){end=0}}if(end>this.length){end=this.length}const result=[],names=[];for(let i=start;i{this.#data[offset]=getValue$1(value)}}}class Reader{allowLoose;#data;#offset;constructor(data,allowLoose){defineProperties(this,{allowLoose:!!allowLoose});this.#data=getBytesCopy(data);this.#offset=0}get data(){return hexlify(this.#data)}get dataLength(){return this.#data.length}get consumed(){return this.#offset}get bytes(){return new Uint8Array(this.#data)}#peekBytes(offset,length,loose){let alignedLength=Math.ceil(length/WordSize)*WordSize;if(this.#offset+alignedLength>this.#data.length){if(this.allowLoose&&loose&&this.#offset+length<=this.#data.length){alignedLength=length}else{assert(false,"data out-of-bounds","BUFFER_OVERRUN",{buffer:getBytesCopy(this.#data),length:this.#data.length,offset:this.#offset+alignedLength})}}return this.#data.slice(this.#offset,this.#offset+alignedLength)}subReader(offset){return new Reader(this.#data.slice(this.#offset+offset),this.allowLoose)}readBytes(length,loose){let bytes=this.#peekBytes(0,length,!!loose);this.#offset+=bytes.length;return bytes.slice(0,length)}readValue(){return toBigInt(this.readBytes(WordSize))}readIndex(){return toNumber(this.readBytes(WordSize))}}const _gaurd={};function n(value,width){let signed=false;if(width<0){signed=true;width*=-1}return new Typed(_gaurd,`${signed?"":"u"}int${width}`,value,{signed:signed,width:width})}function b(value,size){return new Typed(_gaurd,`bytes${size?size:""}`,value,{size:size})}const _typedSymbol=Symbol.for("_corebc_typed");class Typed{type;value;#options;_typedSymbol;constructor(gaurd,type,value,options){if(options==null){options=null}assertPrivate(_gaurd,gaurd,"Typed");defineProperties(this,{_typedSymbol:_typedSymbol,type:type,value:value});this.#options=options;this.format()}format(){if(this.type==="array"){throw new Error("")}else if(this.type==="dynamicArray"){throw new Error("")}else if(this.type==="tuple"){return`tuple(${this.value.map(v=>v.format()).join(",")})`}return this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple"){throw TypeError("not a tuple")}return this.#options}get arrayLength(){if(this.type!=="array"){throw TypeError("not an array")}if(this.#options===true){return-1}if(this.#options===false){return this.value.length}return null}static from(type,value){return new Typed(_gaurd,type,value)}static uint8(v){return n(v,8)}static uint16(v){return n(v,16)}static uint24(v){return n(v,24)}static uint32(v){return n(v,32)}static uint40(v){return n(v,40)}static uint48(v){return n(v,48)}static uint56(v){return n(v,56)}static uint64(v){return n(v,64)}static uint72(v){return n(v,72)}static uint80(v){return n(v,80)}static uint88(v){return n(v,88)}static uint96(v){return n(v,96)}static uint104(v){return n(v,104)}static uint112(v){return n(v,112)}static uint120(v){return n(v,120)}static uint128(v){return n(v,128)}static uint136(v){return n(v,136)}static uint144(v){return n(v,144)}static uint152(v){return n(v,152)}static uint160(v){return n(v,160)}static uint168(v){return n(v,168)}static uint176(v){return n(v,176)}static uint184(v){return n(v,184)}static uint192(v){return n(v,192)}static uint200(v){return n(v,200)}static uint208(v){return n(v,208)}static uint216(v){return n(v,216)}static uint224(v){return n(v,224)}static uint232(v){return n(v,232)}static uint240(v){return n(v,240)}static uint248(v){return n(v,248)}static uint256(v){return n(v,256)}static uint(v){return n(v,256)}static int8(v){return n(v,-8)}static int16(v){return n(v,-16)}static int24(v){return n(v,-24)}static int32(v){return n(v,-32)}static int40(v){return n(v,-40)}static int48(v){return n(v,-48)}static int56(v){return n(v,-56)}static int64(v){return n(v,-64)}static int72(v){return n(v,-72)}static int80(v){return n(v,-80)}static int88(v){return n(v,-88)}static int96(v){return n(v,-96)}static int104(v){return n(v,-104)}static int112(v){return n(v,-112)}static int120(v){return n(v,-120)}static int128(v){return n(v,-128)}static int136(v){return n(v,-136)}static int144(v){return n(v,-144)}static int152(v){return n(v,-152)}static int160(v){return n(v,-160)}static int168(v){return n(v,-168)}static int176(v){return n(v,-176)}static int184(v){return n(v,-184)}static int192(v){return n(v,-192)}static int200(v){return n(v,-200)}static int208(v){return n(v,-208)}static int216(v){return n(v,-216)}static int224(v){return n(v,-224)}static int232(v){return n(v,-232)}static int240(v){return n(v,-240)}static int248(v){return n(v,-248)}static int256(v){return n(v,-256)}static int(v){return n(v,-256)}static bytes1(v){return b(v,1)}static bytes2(v){return b(v,2)}static bytes3(v){return b(v,3)}static bytes4(v){return b(v,4)}static bytes5(v){return b(v,5)}static bytes6(v){return b(v,6)}static bytes7(v){return b(v,7)}static bytes8(v){return b(v,8)}static bytes9(v){return b(v,9)}static bytes10(v){return b(v,10)}static bytes11(v){return b(v,11)}static bytes12(v){return b(v,12)}static bytes13(v){return b(v,13)}static bytes14(v){return b(v,14)}static bytes15(v){return b(v,15)}static bytes16(v){return b(v,16)}static bytes17(v){return b(v,17)}static bytes18(v){return b(v,18)}static bytes19(v){return b(v,19)}static bytes20(v){return b(v,20)}static bytes21(v){return b(v,21)}static bytes22(v){return b(v,22)}static bytes23(v){return b(v,23)}static bytes24(v){return b(v,24)}static bytes25(v){return b(v,25)}static bytes26(v){return b(v,26)}static bytes27(v){return b(v,27)}static bytes28(v){return b(v,28)}static bytes29(v){return b(v,29)}static bytes30(v){return b(v,30)}static bytes31(v){return b(v,31)}static bytes32(v){return b(v,32)}static address(v){return new Typed(_gaurd,"address",v)}static bool(v){return new Typed(_gaurd,"bool",!!v)}static bytes(v){return new Typed(_gaurd,"bytes",v)}static string(v){return new Typed(_gaurd,"string",v)}static array(v,dynamic){throw new Error("not implemented yet")}static tuple(v,name){throw new Error("not implemented yet")}static overrides(v){return new Typed(_gaurd,"overrides",Object.assign({},v))}static isTyped(value){return value&&value._typedSymbol===_typedSymbol}static dereference(value,type){if(Typed.isTyped(value)){if(value.type!==type){throw new Error(`invalid type: expecetd ${type}, got ${value.type}`)}return value.value}return value}}class AddressCoder extends Coder{constructor(localName){super("address","address",localName,false)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(writer,_value){let value=Typed.dereference(_value,"string");try{value=getAddress(value)}catch(error){return this._throwError(error.message,_value)}return writer.writeValue(value)}decode(reader){return getAddress(toBeHex(reader.readValue(),22))}}class AnonymousCoder extends Coder{coder;constructor(coder){super(coder.name,coder.type,"_",coder.dynamic);this.coder=coder}defaultValue(){return this.coder.defaultValue()}encode(writer,value){return this.coder.encode(writer,value)}decode(reader){return this.coder.decode(reader)}}function pack(writer,coders,values){let arrayValues=[];if(Array.isArray(values)){arrayValues=values}else if(values&&typeof values==="object"){let unique={};arrayValues=coders.map(coder=>{const name=coder.localName;assert(name,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});assert(!unique[name],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:coder},value:values});unique[name]=true;return values[name]})}else{assertArgument(false,"invalid tuple value","tuple",values)}assertArgument(coders.length===arrayValues.length,"types/value length mismatch","tuple",values);let staticWriter=new Writer;let dynamicWriter=new Writer;let updateFuncs=[];coders.forEach((coder,index)=>{let value=arrayValues[index];if(coder.dynamic){let dynamicOffset=dynamicWriter.length;coder.encode(dynamicWriter,value);let updateFunc=staticWriter.writeUpdatableValue();updateFuncs.push(baseOffset=>{updateFunc(baseOffset+dynamicOffset)})}else{coder.encode(staticWriter,value)}});updateFuncs.forEach(func=>{func(staticWriter.length)});let length=writer.appendWriter(staticWriter);length+=writer.appendWriter(dynamicWriter);return length}function unpack(reader,coders){let values=[];let keys=[];let baseReader=reader.subReader(0);coders.forEach(coder=>{let value=null;if(coder.dynamic){let offset=reader.readIndex();let offsetReader=baseReader.subReader(offset);try{value=coder.decode(offsetReader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}else{try{value=coder.decode(reader)}catch(error){if(isError(error,"BUFFER_OVERRUN")){throw error}value=error;value.baseType=coder.name;value.name=coder.localName;value.type=coder.type}}if(value==undefined){throw new Error("investigate")}values.push(value);keys.push(coder.localName||null)});return Result.fromItems(values,keys)}class ArrayCoder extends Coder{coder;length;constructor(coder,length,localName){const type=coder.type+"["+(length>=0?length:"")+"]";const dynamic=length===-1||coder.dynamic;super("array",type,localName,dynamic);defineProperties(this,{coder:coder,length:length})}defaultValue(){const defaultChild=this.coder.defaultValue();const result=[];for(let i=0;ibounds||value<-(bounds+BN_1$2)){this._throwError("value out-of-bounds",_value)}value=toTwos(value,8*WordSize)}else if(valuemask(maxUintValue,this.size*8)){this._throwError("value out-of-bounds",_value)}return writer.writeValue(value)}decode(reader){let value=mask(reader.readValue(),this.size*8);if(this.signed){value=fromTwos(value,this.size*8)}return value}}class StringCoder extends DynamicBytesCoder{constructor(localName){super("string",localName)}defaultValue(){return""}encode(writer,_value){return super.encode(writer,toUtf8Bytes(Typed.dereference(_value,"string")))}decode(reader){return toUtf8String(super.decode(reader))}}class TupleCoder extends Coder{coders;constructor(coders,localName){let dynamic=false;const types=[];coders.forEach(coder=>{if(coder.dynamic){dynamic=true}types.push(coder.type)});const type="tuple("+types.join(",")+")";super("tuple",type,localName,dynamic);defineProperties(this,{coders:Object.freeze(coders.slice())})}defaultValue(){const values=[];this.coders.forEach(coder=>{values.push(coder.defaultValue())});const uniqueNames=this.coders.reduce((accum,coder)=>{const name=coder.localName;if(name){if(!accum[name]){accum[name]=0}accum[name]++}return accum},{});this.coders.forEach((coder,index)=>{let name=coder.localName;if(!name||uniqueNames[name]!==1){return}if(name==="length"){name="_length"}if(values[name]!=null){return}values[name]=values[index]});return Object.freeze(values)}encode(writer,_value){const value=Typed.dereference(_value,"tuple");return pack(writer,this.coders,value)}decode(reader){return unpack(reader,this.coders)}}function id(value,useKeccak){if(useKeccak){return keccak256(toUtf8Bytes(value))}return sha256(toUtf8Bytes(value))}const ZeroAddress="0x0000000000000000000000000000000000000000";const ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000";const N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");const OrePerXCB=BigInt("1000000000000000000");const MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);const MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const CoreSymbol="Ξ";const MessagePrefix="Core Signed Message:\n";function accessSetify(addr,storageKeys){return{address:getAddress(addr),storageKeys:storageKeys.map((storageKey,index)=>{assertArgument(isHexString(storageKey,32),"invalid slot",`storageKeys[${index}]`,storageKey);return storageKey.toLowerCase()})}}function accessListify(value){if(Array.isArray(value)){return value.map((set,index)=>{if(Array.isArray(set)){assertArgument(set.length===2,"invalid slot set",`value[${index}]`,set);return accessSetify(set[0],set[1])}assertArgument(set!=null&&typeof set==="object","invalid address-slot set","value",value);return accessSetify(set.address,set.storageKeys)})}assertArgument(value!=null&&typeof value==="object","invalid access list","value",value);const result=Object.keys(value).map(addr=>{const storageKeys=value[addr].reduce((accum,storageKey)=>{accum[storageKey]=true;return accum},{});return accessSetify(addr,Object.keys(storageKeys).sort())});result.sort((a,b)=>a.address.localeCompare(b.address));return result}const logger$1=new Logger("transaction/0.0.1");const BN_0$4=BigInt(0);function handleAddress(value){if(value==="0x"){return null}return getAddress(value)}function parse(data){const handleNumber=value=>{if(value==="0x"){return BigNumber.from(0)}return BigNumber.from(value)};const transaction=decode$1(data);if(transaction.length!==7&&transaction.length!==8){logger$1.throwArgumentError("invalid raw transaction","data",data)}const isSigned=transaction.length===8;const tx={nonce:Number(handleNumber(transaction[0])),energyPrice:handleNumber(transaction[1]).toBigInt(),energyLimit:handleNumber(transaction[2]).toBigInt(),networkId:handleNumber(transaction[isSigned?3:6]).toBigInt(),to:handleAddress(transaction[isSigned?4:3]),value:handleNumber(transaction[isSigned?5:4]).toBigInt(),data:transaction[isSigned?6:5]};if(transaction.length===8){const prefix=networkIdToPrefix(Number(tx.networkId));const digest=sha256(serialize(tx));tx.hash=sha256(serialize(tx,transaction[7]));tx.from=recoverAddress(digest,transaction[7],prefix);tx.signature=transaction[7]}return tx}const unsignedTransactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"},{name:"networkId",maxLength:32,numeric:true}];const transactionFields=[{name:"nonce",maxLength:32,numeric:true},{name:"energyPrice",maxLength:32,numeric:true},{name:"energyLimit",maxLength:32,numeric:true},{name:"networkId",maxLength:32,numeric:true},{name:"to",length:22},{name:"value",maxLength:32,numeric:true},{name:"data"}];const allowedTransactionKeys={networkId:true,data:true,energyLimit:true,energyPrice:true,nonce:true,to:true,value:true};function serialize(transaction,signature){checkProperties(transaction,allowedTransactionKeys);const raw=[];(!!signature?transactionFields:unsignedTransactionFields).forEach(function({numeric,maxLength,name,length}){let value=transaction[name]||[];const options={};if(numeric){options.hexPad="left"}const tmpHexlified=hexlify(value,options);value=arrayify(tmpHexlified);if(length&&value.length!==length&&value.length>0){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}if(maxLength){value=stripZeros(value);if(value.length>maxLength){logger$1.throwArgumentError("invalid length for "+name,"transaction:"+name,value)}}const hexlified=hexlify(value);raw.push(hexlified)});if(!!signature){raw.push(hexlify(signature))}const finalValue=encode(raw);return finalValue}class Transaction{#to;#data;#nonce;#energyLimit;#energyPrice;#value;#networkId;#sig;get to(){return this.#to}set to(value){this.#to=value==null?null:getAddress(value)}get nonce(){return this.#nonce}set nonce(value){this.#nonce=getNumber(value,"value")}get energyLimit(){return this.#energyLimit}set energyLimit(value){this.#energyLimit=getBigInt(value)}get energyPrice(){const value=this.#energyPrice;if(value==null){return BN_0$4}return value}set energyPrice(value){this.#energyPrice=value==null?null:getBigInt(value,"energyPrice")}get data(){return this.#data}set data(value){this.#data=hexlify(value)}get value(){return this.#value}set value(value){this.#value=getBigInt(value,"value")}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value)}get signature(){return this.#sig||null}set signature(value){this.#sig=value==null?null:value}constructor(){this.#to=null;this.#nonce=0;this.#energyLimit=BigInt(0);this.#energyPrice=null;this.#data="0x";this.#value=BigInt(0);this.#networkId=BigInt(0);this.#sig=null}get hash(){if(this.signature==null){return null}return sha256(this.serialized)}get unsignedHash(){return sha256(this.unsignedSerialized)}get from(){if(this.signature==null){return null}const prefix=networkIdToPrefix(Number(this.#networkId));return recoverAddress(this.unsignedHash,this.signature,prefix)}get fromPublicKey(){if(this.signature==null){return null}return SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){assert(this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});return serialize(this,this.signature)}get unsignedSerialized(){return serialize(this)}clone(){return Transaction.from(this)}toJSON(){const s=v=>{if(v==null){return null}return v.toString()};return{to:this.to,data:this.data,nonce:this.nonce,energyLimit:s(this.energyLimit),energyPrice:s(this.energyPrice),value:s(this.value),networkId:s(this.networkId),sig:this.signature?this.signature:null}}static from(tx){if(tx==null){return new Transaction}if(typeof tx==="string"){const payload=getBytes(tx);return Transaction.from(parse(payload))}const result=new Transaction;if(tx.to!=null){result.to=tx.to}if(tx.nonce!=null){result.nonce=tx.nonce}if(tx.energyLimit!=null){result.energyLimit=tx.energyLimit}if(tx.energyPrice!=null){result.energyPrice=tx.energyPrice}if(tx.data!=null){result.data=tx.data}if(tx.value!=null){result.value=tx.value}if(tx.networkId!=null){result.networkId=tx.networkId}if(tx.signature!=null){result.signature=tx.signature}if(tx.hash!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define hash","tx",tx);assertArgument(result.hash===tx.hash,"hash mismatch","tx",tx)}if(tx.from!=null){assertArgument(result.isSigned(),"unsigned transaction cannot define from","tx",tx);assertArgument(result.from.toLowerCase()===(tx.from||"").toLowerCase(),"from mismatch","tx",tx)}return result}}function hashMessage(message){if(typeof message==="string"){message=toUtf8Bytes(message)}return sha256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(message.length)),message]))}function verifyMessage(message,sig,prefix){const digest=hashMessage(message);return recoverAddress(digest,sig,prefix)}const regexBytes=new RegExp("^bytes([0-9]+)$");const regexNumber=new RegExp("^(u?int)([0-9]*)$");const regexArray=new RegExp("^(.*)\\[([0-9]*)\\]$");function _pack(type,value,isArray){switch(type){case"address":if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(getAddress(value));case"string":return toUtf8Bytes(value);case"bytes":return getBytes(value);case"bool":value=!!value?"0x01":"0x00";if(isArray){return getBytes(zeroPadValue(value,32))}return getBytes(value)}let match=type.match(regexNumber);if(match){let signed=match[1]==="int";let size=parseInt(match[2]||"256");assertArgument((!match[2]||match[2]===String(size))&&size%8===0&&size!==0&&size<=256,"invalid number type","type",type);if(isArray){size=256}if(signed){value=toTwos(value,size)}return getBytes(zeroPadValue(toBeArray(value),size/8))}match=type.match(regexBytes);if(match){const size=parseInt(match[1]);assertArgument(String(size)===match[1]&&size!==0&&size<=32,"invalid bytes type","type",type);assertArgument(dataLength(value)===size,`invalid value for ${type}`,"value",value);if(isArray){return getBytes(zeroPadBytes(value,32))}return value}match=type.match(regexArray);if(match&&Array.isArray(value)){const baseType=match[1];const count=parseInt(match[2]||String(value.length));assertArgument(count===value.length,`invalid array length for ${type}`,"value",value);const result=[];value.forEach(function(value){result.push(_pack(baseType,value,true))});return getBytes(concat(result))}assertArgument(false,"invalid type","type",type)}function solidityPacked(types,values){assertArgument(types.length===values.length,"wrong number of values; expected ${ types.length }","values",values);const tight=[];types.forEach(function(type,index){tight.push(_pack(type,values[index]))});return hexlify(concat(tight))}function solidityPackedSha256(types,values){return sha256(solidityPacked(types,values))}const padding=new Uint8Array(32);padding.fill(0);const BN__1=BigInt(-1);const BN_0$3=BigInt(0);const BN_1$1=BigInt(1);const BN_MAX_UINT256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function hexPadRight(value){const bytes=getBytes(value);const padOffset=bytes.length%32;if(padOffset){return concat([bytes,padding.slice(padOffset)])}return hexlify(bytes)}const hexTrue=toBeHex(BN_1$1,32);const hexFalse=toBeHex(BN_0$3,32);const domainFieldTypes={name:"string",version:"string",networkId:"uint256",verifyingContract:"address",salt:"bytes32"};const domainFieldNames=["name","version","networkId","verifyingContract","salt"];function checkString(key){return function(value){assertArgument(typeof value==="string",`invalid domain value for ${JSON.stringify(key)}`,`domain.${key}`,value);return value}}const domainChecks={name:checkString("name"),version:checkString("version"),networkId:function(_value){const value=getBigInt(_value,"domain.networkId");assertArgument(value>=0,"invalid chain ID","domain.networkId",_value);if(Number.isSafeInteger(value)){return Number(value)}return toQuantity(value)},verifyingContract:function(value){try{return getAddress(value).toLowerCase()}catch(error){}assertArgument(false,`invalid domain value "verifyingContract"`,"domain.verifyingContract",value)},salt:function(value){const bytes=getBytes(value,"domain.salt");assertArgument(bytes.length===32,`invalid domain value "salt"`,"domain.salt",value);return hexlify(bytes)}};function getBaseEncoder(type){{const match=type.match(/^(u?)int(\d*)$/);if(match){const signed=match[1]==="";const width=parseInt(match[2]||"256");assertArgument(width%8===0&&width!==0&&width<=256&&(match[2]==null||match[2]===String(width)),"invalid numeric width","type",type);const boundsUpper=mask(BN_MAX_UINT256,signed?width-1:width);const boundsLower=signed?(boundsUpper+BN_1$1)*BN__1:BN_0$3;return function(_value){const value=getBigInt(_value,"value");assertArgument(value>=boundsLower&&value<=boundsUpper,`value out-of-bounds for ${type}`,"value",value);return toBeHex(signed?toTwos(value,256):value,32)}}}{const match=type.match(/^bytes(\d+)$/);if(match){const width=parseInt(match[1]);assertArgument(width!==0&&width<=32&&match[1]===String(width),"invalid bytes width","type",type);return function(value){const bytes=getBytes(value);assertArgument(bytes.length===width,`invalid length for ${type}`,"value",value);return hexPadRight(value)}}}switch(type){case"address":return function(value){return zeroPadValue(getAddress(value),32)};case"bool":return function(value){return!value?hexFalse:hexTrue};case"bytes":return function(value){return sha256(value)};case"string":return function(value){return id(value)}}return null}function encodeType(name,fields){return`${name}(${fields.map(({name,type})=>type+" "+name).join(",")})`}class TypedDataEncoder{primaryType;#types;get types(){return JSON.parse(this.#types)}#fullTypes;#encoderCache;constructor(types){this.#types=JSON.stringify(types);this.#fullTypes=new Map;this.#encoderCache=new Map;const links=new Map;const parents=new Map;const subtypes=new Map;Object.keys(types).forEach(type=>{links.set(type,new Set);parents.set(type,[]);subtypes.set(type,new Set)});for(const name in types){const uniqueNames=new Set;for(const field of types[name]){assertArgument(!uniqueNames.has(field.name),`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`,"types",types);uniqueNames.add(field.name);const baseType=field.type.match(/^([^\x5b]*)(\x5b|$)/)[1]||null;assertArgument(baseType!==name,`circular type reference to ${JSON.stringify(baseType)}`,"types",types);const encoder=getBaseEncoder(baseType);if(encoder){continue}assertArgument(parents.has(baseType),`unknown type ${JSON.stringify(baseType)}`,"types",types);parents.get(baseType).push(name);links.get(name).add(baseType)}}const primaryTypes=Array.from(parents.keys()).filter(n=>parents.get(n).length===0);assertArgument(primaryTypes.length!==0,"missing primary type","types",types);assertArgument(primaryTypes.length===1,`ambiguous primary types or unused types: ${primaryTypes.map(t=>JSON.stringify(t)).join(", ")}`,"types",types);defineProperties(this,{primaryType:primaryTypes[0]});function checkCircular(type,found){assertArgument(!found.has(type),`circular type reference to ${JSON.stringify(type)}`,"types",types);found.add(type);for(const child of links.get(type)){if(!parents.has(child)){continue}checkCircular(child,found);for(const subtype of found){subtypes.get(subtype).add(child)}}found.delete(type)}checkCircular(this.primaryType,new Set);for(const[name,set]of subtypes){const st=Array.from(set);st.sort();this.#fullTypes.set(name,encodeType(name,types[name])+st.map(t=>encodeType(t,types[t])).join(""))}}getEncoder(type){let encoder=this.#encoderCache.get(type);if(!encoder){encoder=this.#getEncoder(type);this.#encoderCache.set(type,encoder)}return encoder}#getEncoder(type){{const encoder=getBaseEncoder(type);if(encoder){return encoder}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){const subtype=match[1];const subEncoder=this.getEncoder(subtype);return value=>{assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);let result=value.map(subEncoder);if(this.#fullTypes.has(subtype)){result=result.map(sha256)}return sha256(concat(result))}}const fields=this.types[type];if(fields){const encodedType=id(this.#fullTypes.get(type));return value=>{const values=fields.map(({name,type})=>{const result=this.getEncoder(type)(value[name]);if(this.#fullTypes.has(type)){return sha256(result)}return result});values.unshift(encodedType);return concat(values)}}assertArgument(false,`unknown type: ${type}`,"type",type)}encodeType(name){const result=this.#fullTypes.get(name);assertArgument(result,`unknown type: ${JSON.stringify(name)}`,"name",name);return result}encodeData(type,value){return this.getEncoder(type)(value)}hashStruct(name,value){return sha256(this.encodeData(name,value))}encode(value){return this.encodeData(this.primaryType,value)}hash(value){return this.hashStruct(this.primaryType,value)}_visit(type,value,callback){{const encoder=getBaseEncoder(type);if(encoder){return callback(type,value)}}const match=type.match(/^(.*)(\x5b(\d*)\x5d)$/);if(match){assertArgument(!match[3]||parseInt(match[3])===value.length,`array length mismatch; expected length ${parseInt(match[3])}`,"value",value);return value.map(v=>this._visit(match[1],v,callback))}const fields=this.types[type];if(fields){return fields.reduce((accum,{name,type})=>{accum[name]=this._visit(type,value[name],callback);return accum},{})}assertArgument(false,`unknown type: ${type}`,"type",type)}visit(value,callback){return this._visit(this.primaryType,value,callback)}static from(types){return new TypedDataEncoder(types)}static getPrimaryType(types){return TypedDataEncoder.from(types).primaryType}static hashStruct(name,types,value){return TypedDataEncoder.from(types).hashStruct(name,value)}static hashDomain(domain){const domainFields=[];for(const name in domain){if(domain[name]==null){continue}const type=domainFieldTypes[name];assertArgument(type,`invalid typed-data domain key: ${JSON.stringify(name)}`,"domain",domain);domainFields.push({name:name,type:type})}domainFields.sort((a,b)=>{return domainFieldNames.indexOf(a.name)-domainFieldNames.indexOf(b.name)});return TypedDataEncoder.hashStruct("EIP712Domain",{EIP712Domain:domainFields},domain)}static encode(domain,types,value){return concat(["0x1901",TypedDataEncoder.hashDomain(domain),TypedDataEncoder.from(types).hash(value)])}static hash(domain,types,value){return sha256(TypedDataEncoder.encode(domain,types,value))}static async resolveNames(domain,types,value,resolveName){domain=Object.assign({},domain);for(const key in domain){if(domain[key]==null){delete domain[key]}}const ensCache={};if(domain.verifyingContract&&!isHexString(domain.verifyingContract,20)){ensCache[domain.verifyingContract]="0x"}const encoder=TypedDataEncoder.from(types);encoder.visit(value,(type,value)=>{if(type==="address"&&!isHexString(value,20)){ensCache[value]="0x"}return value});for(const name in ensCache){ensCache[name]=await resolveName(name)}if(domain.verifyingContract&&ensCache[domain.verifyingContract]){domain.verifyingContract=ensCache[domain.verifyingContract]}value=encoder.visit(value,(type,value)=>{if(type==="address"&&ensCache[value]){return ensCache[value]}return value});return{domain:domain,value:value}}static getPayload(domain,types,value){TypedDataEncoder.hashDomain(domain);const domainValues={};const domainTypes=[];domainFieldNames.forEach(name=>{const value=domain[name];if(value==null){return}domainValues[name]=domainChecks[name](value);domainTypes.push({name:name,type:domainFieldTypes[name]})});const encoder=TypedDataEncoder.from(types);const typesWithDomain=Object.assign({},types);assertArgument(typesWithDomain.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",types);typesWithDomain.EIP712Domain=domainTypes;encoder.encode(value);return{types:typesWithDomain,domain:domainValues,primaryType:encoder.primaryType,message:encoder.visit(value,(type,value)=>{if(type.match(/^bytes(\d*)/)){return hexlify(getBytes(value))}if(type.match(/^u?int/)){return getBigInt(value).toString()}switch(type){case"address":return value.toLowerCase();case"bool":return!!value;case"string":assertArgument(typeof value==="string","invalid string","value",value);return value}assertArgument(false,"unsupported type","type",type)})}}}function verifyTypedData(domain,types,value,signature,prefix){return recoverAddress(TypedDataEncoder.hash(domain,types,value),signature,prefix)}var _a;function setify(items){const result=new Set;items.forEach(k=>result.add(k));return Object.freeze(result)}const _kwVisib="constant external internal payable private public pure view";const KwVisib=setify(_kwVisib.split(" "));const _kwTypes="constructor error event fallback function receive struct";const KwTypes=setify(_kwTypes.split(" "));const _kwModifiers="calldata memory storage payable indexed";const KwModifiers=setify(_kwModifiers.split(" "));const _kwOther="tuple returns";const _keywords=[_kwTypes,_kwModifiers,_kwOther,_kwVisib].join(" ");const Keywords=setify(_keywords.split(" "));const SimpleTokens={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"};const regexWhitespacePrefix=new RegExp("^(\\s*)");const regexNumberPrefix=new RegExp("^([0-9]+)");const regexIdPrefix=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)");const regexId=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$");const regexType=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$");class TokenString{#offset;#tokens;get offset(){return this.#offset}get length(){return this.#tokens.length-this.#offset}constructor(tokens){this.#offset=0;this.#tokens=tokens.slice()}clone(){return new _a(this.#tokens)}reset(){this.#offset=0}#subTokenString(from=0,to=0){return new _a(this.#tokens.slice(from,to).map(t=>{return Object.freeze(Object.assign({},t,{match:t.match-from,linkBack:t.linkBack-from,linkNext:t.linkNext-from}))}))}popKeyword(allowed){const top=this.peek();if(top.type!=="KEYWORD"||!allowed.has(top.text)){throw new Error(`expected keyword ${top.text}`)}return this.pop().text}popType(type){if(this.peek().type!==type){throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`)}return this.pop().text}popParen(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=this.#subTokenString(this.#offset+1,top.match+1);this.#offset=top.match+1;return result}popParams(){const top=this.peek();if(top.type!=="OPEN_PAREN"){throw new Error("bad start")}const result=[];while(this.#offset=this.#tokens.length){throw new Error("out-of-bounds")}return this.#tokens[this.#offset]}peekKeyword(allowed){const top=this.peekType("KEYWORD");return top!=null&&allowed.has(top)?top:null}peekType(type){if(this.length===0){return null}const top=this.peek();return top.type===type?top.text:null}pop(){const result=this.peek();this.#offset++;return result}toString(){const tokens=[];for(let i=this.#offset;i`}}_a=TokenString;function lex(text){const tokens=[];const throwError=message=>{const token=offset0&&tokens[tokens.length-1].type==="NUMBER"){const value=tokens.pop().text;suffix=value+suffix;tokens[tokens.length-1].value=getNumber(value)}if(tokens.length===0||tokens[tokens.length-1].type!=="BRACKET"){throw new Error("missing opening bracket")}tokens[tokens.length-1].text+=suffix}continue}match=cur.match(regexIdPrefix);if(match){token.text=match[1];offset+=token.text.length;if(Keywords.has(token.text)){token.type="KEYWORD";continue}if(token.text.match(regexType)){token.type="TYPE";continue}token.type="ID";continue}match=cur.match(regexNumberPrefix);if(match){token.text=match[1];token.type="NUMBER";offset+=token.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`)}return new TokenString(tokens.map(t=>Object.freeze(t)))}function allowSingle(set,allowed){let included=[];for(const key in allowed.keys()){if(set.has(key)){included.push(key)}}if(included.length>1){throw new Error(`conflicting types: ${included.join(", ")}`)}}function consumeName(type,tokens){if(tokens.peekKeyword(KwTypes)){const keyword=tokens.pop().text;if(keyword!==type){throw new Error(`expected ${type}, got ${keyword}`)}}return tokens.popType("ID")}function consumeKeywords(tokens,allowed){const keywords=new Set;while(true){const keyword=tokens.peekType("KEYWORD");if(keyword==null||allowed&&!allowed.has(keyword)){break}tokens.pop();if(keywords.has(keyword)){throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`)}keywords.add(keyword)}return Object.freeze(keywords)}function consumeMutability(tokens){let modifiers=consumeKeywords(tokens,KwVisib);allowSingle(modifiers,setify("constant payable nonpayable".split(" ")));allowSingle(modifiers,setify("pure view payable nonpayable".split(" ")));if(modifiers.has("view")){return"view"}if(modifiers.has("pure")){return"pure"}if(modifiers.has("payable")){return"payable"}if(modifiers.has("nonpayable")){return"nonpayable"}if(modifiers.has("constant")){return"view"}return"nonpayable"}function consumeParams(tokens,allowIndexed){return tokens.popParams().map(t=>ParamType.from(t,allowIndexed))}function consumeEnergy(tokens){if(tokens.peekType("AT")){tokens.pop();if(tokens.peekType("NUMBER")){return getBigInt(tokens.pop().text)}throw new Error("invalid energy")}return null}function consumeEoi(tokens){if(tokens.length){throw new Error(`unexpected tokens: ${tokens.toString()}`)}}const regexArrayType=new RegExp(/^(.*)\[([0-9]*)\]$/);function verifyBasicType(type){const match=type.match(regexType);assertArgument(match,"invalid type","type",type);if(type==="uint"){return"uint256"}if(type==="int"){return"int256"}if(match[2]){const length=parseInt(match[2]);assertArgument(length!==0&&length<=32,"invalid bytes length","type",type)}else if(match[3]){const size=parseInt(match[3]);assertArgument(size!==0&&size<=256&&size%8===0,"invalid numeric width","type",type)}return type}const _guard$2={};const internal$1=Symbol.for("_corebc_internal");const ParamTypeInternal="_ParamTypeInternal";const ErrorFragmentInternal="_ErrorInternal";const EventFragmentInternal="_EventInternal";const ConstructorFragmentInternal="_ConstructorInternal";const FallbackFragmentInternal="_FallbackInternal";const FunctionFragmentInternal="_FunctionInternal";const StructFragmentInternal="_StructInternal";class ParamType{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(guard,name,type,baseType,indexed,components,arrayLength,arrayChildren){assertPrivate(guard,_guard$2,"ParamType");Object.defineProperty(this,internal$1,{value:ParamTypeInternal});if(components){components=Object.freeze(components.slice())}if(baseType==="array"){if(arrayLength==null||arrayChildren==null){throw new Error("")}}else if(arrayLength!=null||arrayChildren!=null){throw new Error("")}if(baseType==="tuple"){if(components==null){throw new Error("")}}else if(components!=null){throw new Error("")}defineProperties(this,{name:name,type:type,baseType:baseType,indexed:indexed,components:components,arrayLength:arrayLength,arrayChildren:arrayChildren})}format(format){if(format==null){format="sighash"}if(format==="json"){let result={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||undefined};if(typeof this.indexed==="boolean"){result.indexed=this.indexed}if(this.isTuple()){result.components=this.components.map(c=>JSON.parse(c.format(format)))}return JSON.stringify(result)}let result="";if(this.isArray()){result+=this.arrayChildren.format(format);result+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`}else{if(this.isTuple()){if(format!=="sighash"){result+=this.type}result+="("+this.components.map(comp=>comp.format(format)).join(format==="full"?", ":",")+")"}else{result+=this.type}}if(format!=="sighash"){if(this.indexed===true){result+=" indexed"}if(format==="full"&&this.name){result+=" "+this.name}}return result}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(value,process){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const _this=this;return value.map(v=>_this.arrayChildren.walk(v,process))}if(this.isTuple()){if(!Array.isArray(value)){throw new Error("invalid tuple value")}if(value.length!==this.components.length){throw new Error("array is wrong length")}const _this=this;return value.map((v,i)=>_this.components[i].walk(v,process))}return process(this.type,value)}#walkAsync(promises,value,process,setValue){if(this.isArray()){if(!Array.isArray(value)){throw new Error("invalid array value")}if(this.arrayLength!==-1&&value.length!==this.arrayLength){throw new Error("array is wrong length")}const childType=this.arrayChildren;const result=value.slice();result.forEach((value,index)=>{childType.#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}if(this.isTuple()){const components=this.components;let result;if(Array.isArray(value)){result=value.slice()}else{if(value==null||typeof value!=="object"){throw new Error("invalid tuple value")}result=components.map(param=>{if(!param.name){throw new Error("cannot use object value with unnamed components")}if(!(param.name in value)){throw new Error(`missing value for component ${param.name}`)}return value[param.name]})}if(result.length!==this.components.length){throw new Error("array is wrong length")}result.forEach((value,index)=>{components[index].#walkAsync(promises,value,process,value=>{result[index]=value})});setValue(result);return}const result=process(this.type,value);if(result.then){promises.push(async function(){setValue(await result)}())}else{setValue(result)}}async walkAsync(value,process){const promises=[];const result=[value];this.#walkAsync(promises,value,process,value=>{result[0]=value});if(promises.length){await Promise.all(promises)}return result[0]}static from(obj,allowIndexed){if(ParamType.isParamType(obj)){return obj}if(typeof obj==="string"){return ParamType.from(lex(obj),allowIndexed)}else if(obj instanceof TokenString){let type="",baseType="";let comps=null;if(consumeKeywords(obj,setify(["tuple"])).has("tuple")||obj.peekType("OPEN_PAREN")){baseType="tuple";comps=obj.popParams().map(t=>ParamType.from(t));type=`tuple(${comps.map(c=>c.format()).join(",")})`}else{type=verifyBasicType(obj.popType("TYPE"));baseType=type}let arrayChildren=null;let arrayLength=null;while(obj.length&&obj.peekType("BRACKET")){const bracket=obj.pop();arrayChildren=new ParamType(_guard$2,"",type,baseType,null,comps,arrayLength,arrayChildren);arrayLength=bracket.value;type+=bracket.text;baseType="array";comps=null}let indexed=null;const keywords=consumeKeywords(obj,KwModifiers);if(keywords.has("indexed")){if(!allowIndexed){throw new Error("")}indexed=true}const name=obj.peekType("ID")?obj.pop().text:"";if(obj.length){throw new Error("leftover tokens")}return new ParamType(_guard$2,name,type,baseType,indexed,comps,arrayLength,arrayChildren)}const name=obj.name;assertArgument(!name||typeof name==="string"&&name.match(regexId),"invalid name","obj.name",name);let indexed=obj.indexed;if(indexed!=null){assertArgument(allowIndexed,"parameter cannot be indexed","obj.indexed",obj.indexed);indexed=!!indexed}let type=obj.type;let arrayMatch=type.match(regexArrayType);if(arrayMatch){const arrayLength=parseInt(arrayMatch[2]||"-1");const arrayChildren=ParamType.from({type:arrayMatch[1],components:obj.components});return new ParamType(_guard$2,name||"",type,"array",indexed,null,arrayLength,arrayChildren)}if(type==="tuple"||type.startsWith("tuple(")||type.startsWith("(")){const comps=obj.components!=null?obj.components.map(c=>ParamType.from(c)):null;const tuple=new ParamType(_guard$2,name||"",type,"tuple",indexed,comps,null,null);return tuple}type=verifyBasicType(obj.type);return new ParamType(_guard$2,name||"",type,type,indexed,null,null,null)}static isParamType(value){return value&&value[internal$1]===ParamTypeInternal}}class Fragment{type;inputs;constructor(guard,type,inputs){assertPrivate(guard,_guard$2,"Fragment");inputs=Object.freeze(inputs.slice());defineProperties(this,{type:type,inputs:inputs})}static from(obj){if(typeof obj==="string"){try{Fragment.from(JSON.parse(obj))}catch(e){}return Fragment.from(lex(obj))}if(obj instanceof TokenString){const type=obj.peekKeyword(KwTypes);switch(type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}}else if(typeof obj==="object"){switch(obj.type){case"constructor":return ConstructorFragment.from(obj);case"error":return ErrorFragment.from(obj);case"event":return EventFragment.from(obj);case"fallback":case"receive":return FallbackFragment.from(obj);case"function":return FunctionFragment.from(obj);case"struct":return StructFragment.from(obj)}assert(false,`unsupported type: ${obj.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}assertArgument(false,"unsupported frgament object","obj",obj)}static isConstructor(value){return ConstructorFragment.isFragment(value)}static isError(value){return ErrorFragment.isFragment(value)}static isEvent(value){return EventFragment.isFragment(value)}static isFunction(value){return FunctionFragment.isFragment(value)}static isStruct(value){return StructFragment.isFragment(value)}}class NamedFragment extends Fragment{name;constructor(guard,type,name,inputs){super(guard,type,inputs);assertArgument(typeof name==="string"&&name.match(regexId),"invalid identifier","name",name);inputs=Object.freeze(inputs.slice());defineProperties(this,{name:name})}}function joinParams(format,params){return"("+params.map(p=>p.format(format)).join(format==="full"?", ":",")+")"}class ErrorFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"error",name,inputs);Object.defineProperty(this,internal$1,{value:ErrorFragmentInternal})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(input=>JSON.parse(input.format(format)))})}const result=[];if(format!=="sighash"){result.push("error")}result.push(this.name+joinParams(format,this.inputs));return result.join(" ")}static from(obj){if(ErrorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ErrorFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("error",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new ErrorFragment(_guard$2,name,inputs)}return new ErrorFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===ErrorFragmentInternal}}class EventFragment extends NamedFragment{anonymous;constructor(guard,name,inputs,anonymous){super(guard,"event",name,inputs);Object.defineProperty(this,internal$1,{value:EventFragmentInternal});defineProperties(this,{anonymous:anonymous})}get topicHash(){return id(this.format("sighash"))}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[];if(format!=="sighash"){result.push("event")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"&&this.anonymous){result.push("anonymous")}return result.join(" ")}static getTopicHash(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new EventFragment(_guard$2,name,params,false);return fragment.topicHash}static from(obj){if(EventFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return EventFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("event",obj);const inputs=consumeParams(obj,true);const anonymous=!!consumeKeywords(obj,setify(["anonymous"])).has("anonymous");consumeEoi(obj);return new EventFragment(_guard$2,name,inputs,anonymous)}return new EventFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(p=>ParamType.from(p,true)):[],!!obj.anonymous)}static isFragment(value){return value&&value[internal$1]===EventFragmentInternal}}class ConstructorFragment extends Fragment{payable;energy;constructor(guard,type,inputs,payable,energy){super(guard,type,inputs);Object.defineProperty(this,internal$1,{value:ConstructorFragmentInternal});defineProperties(this,{payable:payable,energy:energy})}format(format){assert(format!=null&&format!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"});if(format==="json"){return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format)))})}const result=[`constructor${joinParams(format,this.inputs)}`];result.push(this.payable?"payable":"nonpayable");if(this.energy!=null){result.push(`@${this.energy.toString()}`)}return result.join(" ")}static from(obj){if(ConstructorFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return ConstructorFragment.from(lex(obj))}else if(obj instanceof TokenString){consumeKeywords(obj,setify(["constructor"]));const inputs=consumeParams(obj);const payable=!!consumeKeywords(obj,setify(["payable"])).has("payable");const energy=consumeEnergy(obj);consumeEoi(obj);return new ConstructorFragment(_guard$2,"constructor",inputs,payable,energy)}return new ConstructorFragment(_guard$2,"constructor",obj.inputs?obj.inputs.map(ParamType.from):[],!!obj.payable,obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===ConstructorFragmentInternal}}class FallbackFragment extends Fragment{payable;constructor(guard,inputs,payable){super(guard,"fallback",inputs);Object.defineProperty(this,internal$1,{value:FallbackFragmentInternal});defineProperties(this,{payable:payable})}format(format){const type=this.inputs.length===0?"receive":"fallback";if(format==="json"){const stateMutability=this.payable?"payable":"nonpayable";return JSON.stringify({type:type,stateMutability:stateMutability})}return`${type}()${this.payable?" payable":""}`}static from(obj){if(FallbackFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FallbackFragment.from(lex(obj))}else if(obj instanceof TokenString){const errorObj=obj.toString();const topIsValid=obj.peekKeyword(setify(["fallback","receive"]));assertArgument(topIsValid,"type must be fallback or receive","obj",errorObj);const type=obj.popKeyword(setify(["fallback","receive"]));if(type==="receive"){const inputs=consumeParams(obj);assertArgument(inputs.length===0,`receive cannot have arguments`,"obj.inputs",inputs);consumeKeywords(obj,setify(["payable"]));consumeEoi(obj);return new FallbackFragment(_guard$2,[],true)}let inputs=consumeParams(obj);if(inputs.length){assertArgument(inputs.length===1&&inputs[0].type==="bytes","invalid fallback inputs","obj.inputs",inputs.map(i=>i.format("minimal")).join(", "))}else{inputs=[ParamType.from("bytes")]}const mutability=consumeMutability(obj);assertArgument(mutability==="nonpayable"||mutability==="payable","fallback cannot be constants","obj.stateMutability",mutability);if(consumeKeywords(obj,setify(["returns"])).has("returns")){const outputs=consumeParams(obj);assertArgument(outputs.length===1&&outputs[0].type==="bytes","invalid fallback outputs","obj.outputs",outputs.map(i=>i.format("minimal")).join(", "))}consumeEoi(obj);return new FallbackFragment(_guard$2,inputs,mutability==="payable")}if(obj.type==="receive"){return new FallbackFragment(_guard$2,[],true)}if(obj.type==="fallback"){const inputs=[ParamType.from("bytes")];const payable=obj.stateMutability==="payable";return new FallbackFragment(_guard$2,inputs,payable)}assertArgument(false,"invalid fallback description","obj",obj)}static isFragment(value){return value&&value[internal$1]===FallbackFragmentInternal}}class FunctionFragment extends NamedFragment{constant;outputs;stateMutability;payable;energy;constructor(guard,name,stateMutability,inputs,outputs,energy){super(guard,"function",name,inputs);Object.defineProperty(this,internal$1,{value:FunctionFragmentInternal});outputs=Object.freeze(outputs.slice());const constant=stateMutability==="view"||stateMutability==="pure";const payable=stateMutability==="payable";defineProperties(this,{constant:constant,energy:energy,outputs:outputs,payable:payable,stateMutability:stateMutability})}get selector(){return id(this.format("sighash")).substring(0,10)}format(format){if(format==null){format="sighash"}if(format==="json"){return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:undefined,payable:this.payable,energy:this.energy!=null?this.energy:undefined,inputs:this.inputs.map(i=>JSON.parse(i.format(format))),outputs:this.outputs.map(o=>JSON.parse(o.format(format)))})}const result=[];if(format!=="sighash"){result.push("function")}result.push(this.name+joinParams(format,this.inputs));if(format!=="sighash"){if(this.stateMutability!=="nonpayable"){result.push(this.stateMutability)}if(this.outputs&&this.outputs.length){result.push("returns");result.push(joinParams(format,this.outputs))}if(this.energy!=null){result.push(`@${this.energy.toString()}`)}}return result.join(" ")}static getSelector(name,params){params=(params||[]).map(p=>ParamType.from(p));const fragment=new FunctionFragment(_guard$2,name,"view",params,[],null);return fragment.selector}static from(obj){if(FunctionFragment.isFragment(obj)){return obj}if(typeof obj==="string"){return FunctionFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("function",obj);const inputs=consumeParams(obj);const mutability=consumeMutability(obj);let outputs=[];if(consumeKeywords(obj,setify(["returns"])).has("returns")){outputs=consumeParams(obj)}const energy=consumeEnergy(obj);consumeEoi(obj);return new FunctionFragment(_guard$2,name,mutability,inputs,outputs,energy)}let stateMutability=obj.stateMutability;if(stateMutability==null){stateMutability="payable";if(typeof obj.constant==="boolean"){stateMutability="view";if(!obj.constant){stateMutability="payable";if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}}else if(typeof obj.payable==="boolean"&&!obj.payable){stateMutability="nonpayable"}}return new FunctionFragment(_guard$2,obj.name,stateMutability,obj.inputs?obj.inputs.map(ParamType.from):[],obj.outputs?obj.outputs.map(ParamType.from):[],obj.energy!=null?obj.energy:null)}static isFragment(value){return value&&value[internal$1]===FunctionFragmentInternal}}class StructFragment extends NamedFragment{constructor(guard,name,inputs){super(guard,"struct",name,inputs);Object.defineProperty(this,internal$1,{value:StructFragmentInternal})}format(){throw new Error("@TODO")}static from(obj){if(typeof obj==="string"){return StructFragment.from(lex(obj))}else if(obj instanceof TokenString){const name=consumeName("struct",obj);const inputs=consumeParams(obj);consumeEoi(obj);return new StructFragment(_guard$2,name,inputs)}return new StructFragment(_guard$2,obj.name,obj.inputs?obj.inputs.map(ParamType.from):[])}static isFragment(value){return value&&value[internal$1]===StructFragmentInternal}}const PanicReasons$1=new Map;PanicReasons$1.set(0,"GENERIC_PANIC");PanicReasons$1.set(1,"ASSERT_FALSE");PanicReasons$1.set(17,"OVERFLOW");PanicReasons$1.set(18,"DIVIDE_BY_ZERO");PanicReasons$1.set(33,"ENUM_RANGE_ERROR");PanicReasons$1.set(34,"BAD_STORAGE_DATA");PanicReasons$1.set(49,"STACK_UNDERFLOW");PanicReasons$1.set(50,"ARRAY_RANGE_ERROR");PanicReasons$1.set(65,"OUT_OF_MEMORY");PanicReasons$1.set(81,"UNINITIALIZED_FUNCTION_CALL");const paramTypeBytes=new RegExp(/^bytes([0-9]*)$/);const paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/);let defaultCoder=null;function getBuiltinCallException(action,tx,data,abiCoder){let message="missing revert data";let reason=null;const invocation=null;let revert=null;if(data){message="execution reverted";const bytes=getBytes(data);data=hexlify(data);if(bytes.length===0){message+=" (no data present; likely require(false) occurred";reason="require(false)"}else if(bytes.length%32!==4){message+=" (could not decode reason; invalid data length)"}else if(hexlify(bytes.slice(0,4))==="0x08c379a0"){try{reason=abiCoder.decode(["string"],bytes.slice(4))[0];revert={signature:"Error(string)",name:"Error",args:[reason]};message+=`: ${JSON.stringify(reason)}`}catch(error){message+=" (could not decode reason; invalid string data)"}}else if(hexlify(bytes.slice(0,4))==="0x4e487b71"){try{const code=Number(abiCoder.decode(["uint256"],bytes.slice(4))[0]);revert={signature:"Panic(uint256)",name:"Panic",args:[code]};reason=`Panic due to ${PanicReasons$1.get(code)||"UNKNOWN"}(${code})`;message+=`: ${reason}`}catch(error){message+=" (could not decode panic code)"}}else{message+=" (unknown custom error)"}}const transaction={to:tx.to?getAddress(tx.to):null,data:tx.data||"0x"};if(tx.from){transaction.from=getAddress(tx.from)}return makeError(message,"CALL_EXCEPTION",{action:action,data:data,reason:reason,transaction:transaction,invocation:invocation,revert:revert})}class AbiCoder{#getCoder(param){if(param.isArray()){return new ArrayCoder(this.#getCoder(param.arrayChildren),param.arrayLength,param.name)}if(param.isTuple()){return new TupleCoder(param.components.map(c=>this.#getCoder(c)),param.name)}switch(param.baseType){case"address":return new AddressCoder(param.name);case"bool":return new BooleanCoder(param.name);case"string":return new StringCoder(param.name);case"bytes":return new BytesCoder(param.name);case"":return new NullCoder(param.name)}let match=param.type.match(paramTypeNumber);if(match){let size=parseInt(match[2]||"256");assertArgument(size!==0&&size<=256&&size%8===0,"invalid "+match[1]+" bit length","param",param);return new NumberCoder(size/8,match[1]==="int",param.name)}match=param.type.match(paramTypeBytes);if(match){let size=parseInt(match[1]);assertArgument(size!==0&&size<=32,"invalid bytes length","param",param);return new FixedBytesCoder(size,param.name)}assertArgument(false,"invalid type","type",param.type)}getDefaultValue(types){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.defaultValue()}encode(types,values){assertArgumentCount(values.length,types.length,"types/values length mismatch");const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");const writer=new Writer;coder.encode(writer,values);return writer.data}decode(types,data,loose){const coders=types.map(type=>this.#getCoder(ParamType.from(type)));const coder=new TupleCoder(coders,"_");return coder.decode(new Reader(data,loose))}static defaultAbiCoder(){if(defaultCoder==null){defaultCoder=new AbiCoder}return defaultCoder}static getBuiltinCallException(action,tx,data){return getBuiltinCallException(action,tx,data,AbiCoder.defaultAbiCoder())}}function encodeBytes32String(text){const bytes=toUtf8Bytes(text);if(bytes.length>31){throw new Error("bytes32 string must be less than 32 bytes")}return zeroPadBytes(bytes,32)}function decodeBytes32String(_bytes){const data=getBytes(_bytes,"bytes");if(data.length!==32){throw new Error("invalid bytes32 - not 32 bytes long")}if(data[31]!==0){throw new Error("invalid bytes32 string - no null terminator")}let length=31;while(data[length-1]===0){length--}return toUtf8String(data.slice(0,length))}class LogDescription{fragment;name;signature;topic;args;constructor(fragment,topic,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,signature:signature,topic:topic,args:args})}}class TransactionDescription{fragment;name;args;signature;selector;value;constructor(fragment,selector,args,value){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector,value:value})}}class ErrorDescription{fragment;name;args;signature;selector;constructor(fragment,selector,args){const name=fragment.name,signature=fragment.format();defineProperties(this,{fragment:fragment,name:name,args:args,signature:signature,selector:selector})}}class Indexed{hash;_isIndexed;static isIndexed(value){return!!(value&&value._isIndexed)}constructor(hash){defineProperties(this,{hash:hash,_isIndexed:true})}}const PanicReasons={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"};const BuiltinErrors={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:message=>{return`reverted with reason string ${JSON.stringify(message)}`}},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:code=>{let reason="unknown panic code";if(code>=0&&code<=255&&PanicReasons[code.toString()]){reason=PanicReasons[code.toString()]}return`reverted with panic code 0x${code.toString(16)} (${reason})`}}};class Interface{fragments;deploy;fallback;receive;#errors;#events;#functions;#abiCoder;constructor(fragments){let abi=[];if(typeof fragments==="string"){abi=JSON.parse(fragments)}else{abi=fragments}this.#functions=new Map;this.#errors=new Map;this.#events=new Map;const frags=[];for(const a of abi){try{frags.push(Fragment.from(a))}catch(error){console.log("EE",error)}}defineProperties(this,{fragments:Object.freeze(frags)});let fallback=null;let receive=false;this.#abiCoder=this.getAbiCoder();this.fragments.forEach((fragment,index)=>{let bucket;switch(fragment.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}defineProperties(this,{deploy:fragment});return;case"fallback":if(fragment.inputs.length===0){receive=true}else{assertArgument(!fallback||fragment.payable!==fallback.payable,"conflicting fallback fragments",`fragments[${index}]`,fragment);fallback=fragment;receive=fallback.payable}return;case"function":bucket=this.#functions;break;case"event":bucket=this.#events;break;case"error":bucket=this.#errors;break;default:return}const signature=fragment.format();if(bucket.has(signature)){return}bucket.set(signature,fragment)});if(!this.deploy){defineProperties(this,{deploy:ConstructorFragment.from("constructor()")})}defineProperties(this,{fallback:fallback,receive:receive})}format(minimal){const format=minimal?"minimal":"full";const abi=this.fragments.map(f=>f.format(format));return abi}formatJson(){const abi=this.fragments.map(f=>f.format("json"));return JSON.stringify(abi.map(j=>JSON.parse(j)))}getAbiCoder(){return AbiCoder.defaultAbiCoder()}#getFunction(key,values,forceUnique){if(isHexString(key)){const selector=key.toLowerCase();for(const fragment of this.#functions.values()){if(selector===fragment.selector){return fragment}}return null}if(key.indexOf("(")===-1){const matching=[];for(const[name,fragment]of this.#functions){if(name.split("(")[0]===key){matching.push(fragment)}}if(values){const lastValue=values.length>0?values[values.length-1]:null;let valueLength=values.length;let allowOptions=true;if(Typed.isTyped(lastValue)&&lastValue.type==="overrides"){allowOptions=false;valueLength--}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs.length;if(inputs!==valueLength&&(!allowOptions||inputs!==valueLength-1)){matching.splice(i,1)}}for(let i=matching.length-1;i>=0;i--){const inputs=matching[i].inputs;for(let j=0;j=inputs.length){if(values[j].type==="overrides"){continue}matching.splice(i,1);break}if(values[j].type!==inputs[j].baseType){matching.splice(i,1);break}}}}if(matching.length===1&&values&&values.length!==matching[0].inputs.length){const lastArg=values[values.length-1];if(lastArg==null||Array.isArray(lastArg)||typeof lastArg!=="object"){matching.splice(0,1)}}if(matching.length===0){return null}if(matching.length>1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous function description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#functions.get(FunctionFragment.from(key).format());if(result){return result}return null}getFunctionName(key){const fragment=this.#getFunction(key,null,false);assertArgument(fragment,"no matching function","key",key);return fragment.name}hasFunction(key){return!!this.#getFunction(key,null,false)}getFunction(key,values){return this.#getFunction(key,values||null,true)}forEachFunction(callback){const names=Array.from(this.#functions.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i=0;i--){if(matching[i].inputs.length=0;i--){const inputs=matching[i].inputs;for(let j=0;j1&&forceUnique){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous event description (i.e. matches ${matchStr})`,"key",key)}return matching[0]}const result=this.#events.get(EventFragment.from(key).format());if(result){return result}return null}getEventName(key){const fragment=this.#getEvent(key,null,false);assertArgument(fragment,"no matching event","key",key);return fragment.name}hasEvent(key){return!!this.#getEvent(key,null,false)}getEvent(key,values){return this.#getEvent(key,values||null,true)}forEachEvent(callback){const names=Array.from(this.#events.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i1){const matchStr=matching.map(m=>JSON.stringify(m.format())).join(", ");assertArgument(false,`ambiguous error description (i.e. ${matchStr})`,"name",key)}return matching[0]}key=ErrorFragment.from(key).format();if(key==="Error(string)"){return ErrorFragment.from("error Error(string)")}if(key==="Panic(uint256)"){return ErrorFragment.from("error Panic(uint256)")}const result=this.#errors.get(key);if(result){return result}return null}forEachError(callback){const names=Array.from(this.#errors.keys());names.sort((a,b)=>a.localeCompare(b));for(let i=0;i{if(param.type==="string"){return id(value)}else if(param.type==="bytes"){return sha256(hexlify(value))}if(param.type==="bool"&&typeof value==="boolean"){value=value?"0x01":"0x00"}if(param.type.match(/^u?int/)){value=toBeHex(value)}if(param.type==="address"){this.#abiCoder.encode(["address"],[value])}return zeroPadValue(hexlify(value),32)};values.forEach((value,index)=>{const param=fragment.inputs[index];if(!param.indexed){assertArgument(value==null,"cannot filter non-indexed parameters; must be null","contract."+param.name,value);return}if(value==null){topics.push(null)}else if(param.baseType==="array"||param.baseType==="tuple"){assertArgument(false,"filtering with tuples or arrays not supported","contract."+param.name,value)}else if(Array.isArray(value)){topics.push(value.map(value=>encodeTopic(param,value)))}else{topics.push(encodeTopic(param,value))}});while(topics.length&&topics[topics.length-1]===null){topics.pop()}return topics}encodeEventLog(fragment,values){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}const topics=[];const dataTypes=[];const dataValues=[];if(!fragment.anonymous){topics.push(fragment.topicHash)}assertArgument(values.length===fragment.inputs.length,"event arguments/values mismatch","values",values);fragment.inputs.forEach((param,index)=>{const value=values[index];if(param.indexed){if(param.type==="string"){topics.push(id(value))}else if(param.type==="bytes"){topics.push(sha256(value))}else if(param.baseType==="tuple"||param.baseType==="array"){throw new Error("not implemented")}else{topics.push(this.#abiCoder.encode([param.type],[value]))}}else{dataTypes.push(param);dataValues.push(value)}});return{data:this.#abiCoder.encode(dataTypes,dataValues),topics:topics}}decodeEventLog(fragment,data,topics){if(typeof fragment==="string"){const f=this.getEvent(fragment);assertArgument(f,"unknown event","eventFragment",fragment);fragment=f}if(topics!=null&&!fragment.anonymous){const eventTopic=fragment.topicHash;assertArgument(isHexString(topics[0],32)&&topics[0].toLowerCase()===eventTopic,"fragment/topic mismatch","topics[0]",topics[0]);topics=topics.slice(1)}const indexed=[];const nonIndexed=[];const dynamic=[];fragment.inputs.forEach((param,index)=>{if(param.indexed){if(param.type==="string"||param.type==="bytes"||param.baseType==="tuple"||param.baseType==="array"){indexed.push(ParamType.from({type:"bytes32",name:param.name}));dynamic.push(true)}else{indexed.push(param);dynamic.push(false)}}else{nonIndexed.push(param);dynamic.push(false)}});const resultIndexed=topics!=null?this.#abiCoder.decode(indexed,concat(topics)):null;const resultNonIndexed=this.#abiCoder.decode(nonIndexed,data,true);const values=[];const keys=[];let nonIndexedIndex=0,indexedIndex=0;fragment.inputs.forEach((param,index)=>{let value=null;if(param.indexed){if(resultIndexed==null){value=new Indexed(null)}else if(dynamic[index]){value=new Indexed(resultIndexed[indexedIndex++])}else{try{value=resultIndexed[indexedIndex++]}catch(error){value=error}}}else{try{value=resultNonIndexed[nonIndexedIndex++]}catch(error){value=error}}values.push(value);keys.push(param.name||null)});return Result.fromItems(values,keys)}parseTransaction(tx){const data=getBytes(tx.data,"tx.data");const value=getBigInt(tx.value!=null?tx.value:0,"tx.value");const fragment=this.getFunction(hexlify(data.slice(0,4)));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,data.slice(4));return new TransactionDescription(fragment,fragment.selector,args,value)}parseCallResult(data){throw new Error("@TODO")}parseLog(log){const fragment=this.getEvent(log.topics[0]);if(!fragment||fragment.anonymous){return null}return new LogDescription(fragment,fragment.topicHash,this.decodeEventLog(fragment,log.data,log.topics))}parseError(data){const hexData=hexlify(data);const fragment=this.getError(dataSlice(hexData,0,4));if(!fragment){return null}const args=this.#abiCoder.decode(fragment.inputs,dataSlice(hexData,4));return new ErrorDescription(fragment,fragment.selector,args)}static from(value){if(value instanceof Interface){return value}if(typeof value==="string"){return new Interface(JSON.parse(value))}if(typeof value.format==="function"){return new Interface(value.format("json"))}return new Interface(value)}}const logger=new Logger("contract-address/0.0.1");function getCreateAddress(tx){const from=getAddress(tx.from);const nonce=getBigInt(tx.nonce,"tx.nonce");let nonceHex=nonce.toString(16);if(nonceHex==="0"){nonceHex="0x"}else if(nonceHex.length%2){nonceHex="0x0"+nonceHex}else{nonceHex="0x"+nonceHex}return getAddress(from)}function getCreate2Address(from,salt,initCodeHash){if(hexDataLength(salt)!==32){logger.throwArgumentError("salt must be 32 bytes","salt",salt)}if(hexDataLength(initCodeHash)!==32){logger.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",initCodeHash)}const val=hexDataSlice(sha256(concat(["0xff",getAddress(from),salt,initCodeHash])),12);console.log({"contract-address/74=>should be string":val});const prefix=from.substring(2,4);const checksum=calculateCheckSum(val,prefix);return"0x"+prefix+checksum+removeHexPrefix(val)}function isAddressable(value){return value&&typeof value.getAddress==="function"}function isAddress(value){try{getAddress(value);return true}catch(error){}return false}async function checkAddress(target,promise){const result=await promise;if(result==null||result==="0x0000000000000000000000000000000000000000"){assert(typeof target!=="string","unconfigured name","UNCONFIGURED_NAME",{value:target});assertArgument(false,"invalid AddressLike value; did not resolve to a value address","target",target)}return getAddress(result)}function resolveAddress(target){if(typeof target==="string"){return getAddress(target)}else if(isAddressable(target)){return checkAddress(target,target.getAddress())}else if(target&&typeof target.then==="function"){return checkAddress(target,target)}assertArgument(false,"unsupported addressable value","target",target)}const BN_0$2=BigInt(0);function getValue(value){if(value==null){return null}return value}function toJson(value){if(value==null){return null}return value.toString()}class FeeData{energyPrice;constructor(energyPrice){defineProperties(this,{energyPrice:getValue(energyPrice)})}toJSON(){const{energyPrice}=this;return{_type:"FeeData",energyPrice:toJson(energyPrice)}}}function copyRequest(req){const result={};if(req.to){result.to=req.to}if(req.from){result.from=req.from}if(req.data){result.data=hexlify(req.data)}const bigIntKeys="networkId,energyLimit,energyPrice,value".split(/,/);for(const key of bigIntKeys){if(!(key in req)||req[key]==null){continue}result[key]=getBigInt(req[key],`request.${key}`)}const numberKeys="type,nonce".split(/,/);for(const key of numberKeys){if(!(key in req)||req[key]==null){continue}result[key]=getNumber(req[key],`request.${key}`)}if("blockTag"in req){result.blockTag=req.blockTag}if("enableCcipRead"in req){result.enableCcipReadEnabled=!!req.enableCcipRead}if("customData"in req){result.customData=req.customData}return result}class Block{provider;number;hash;timestamp;parentHash;nonce;difficulty;energyLimit;energyUsed;miner;extraData;baseFeePerEnergy;#transactions;constructor(block,provider){this.#transactions=block.transactions.map(tx=>{if(typeof tx!=="string"){return new TransactionResponse(tx,provider)}return tx});defineProperties(this,{provider:provider,hash:getValue(block.hash),number:block.number,timestamp:block.timestamp,parentHash:block.parentHash,nonce:block.nonce,difficulty:block.difficulty,energyLimit:block.energyLimit,energyUsed:block.energyUsed,miner:block.miner,extraData:block.extraData,baseFeePerEnergy:getValue(block.baseFeePerEnergy)})}get transactions(){return this.#transactions.map(tx=>{if(typeof tx==="string"){return tx}return tx.hash})}get prefetchedTransactions(){const txs=this.#transactions.slice();if(txs.length===0){return[]}assert(typeof txs[0]==="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"});return txs}toJSON(){const{baseFeePerEnergy,difficulty,extraData,energyLimit,energyUsed,hash,miner,nonce,number,parentHash,timestamp,transactions}=this;return{_type:"Block",baseFeePerEnergy:toJson(baseFeePerEnergy),difficulty:toJson(difficulty),extraData:extraData,energyLimit:toJson(energyLimit),energyUsed:toJson(energyUsed),hash:hash,miner:miner,nonce:nonce,number:number,parentHash:parentHash,timestamp:timestamp,transactions:transactions}}[Symbol.iterator](){let index=0;const txs=this.transactions;return{next:()=>{if(index{return new Log(log,provider)}));defineProperties(this,{provider:provider,to:tx.to,from:tx.from,contractAddress:tx.contractAddress,hash:tx.hash,index:tx.index,blockHash:tx.blockHash,blockNumber:tx.blockNumber,logsBloom:tx.logsBloom,energyUsed:tx.energyUsed,cumulativeEnergyUsed:tx.cumulativeEnergyUsed,energyPrice:tx.effectiveEnergyPrice||tx.energyPrice,status:tx.status,root:tx.root})}get logs(){return this.#logs}toJSON(){const{to,from,contractAddress,hash,index,blockHash,blockNumber,logsBloom,logs,status,root}=this;return{_type:"TransactionReceipt",blockHash:blockHash,blockNumber:blockNumber,contractAddress:contractAddress,cumulativeEnergyUsed:toJson(this.cumulativeEnergyUsed),from:from,energyPrice:toJson(this.energyPrice),energyUsed:toJson(this.energyUsed),hash:hash,index:index,logs:logs,logsBloom:logsBloom,root:root,status:status,to:to}}get length(){return this.logs.length}[Symbol.iterator](){let index=0;return{next:()=>{if(index{if(stopScanning){return null}const{blockNumber,nonce}=await resolveProperties({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(nonce=confirms){return receipt}}else{await checkReplacement();if(confirms===0){return null}}const waiter=new Promise((resolve,reject)=>{const cancellers=[];const cancel=()=>{cancellers.forEach(c=>c())};cancellers.push(()=>{stopScanning=true});if(timeout>0){const timer=setTimeout(()=>{cancel();reject(makeError("wait for transaction timeout","TIMEOUT"))},timeout);cancellers.push(()=>{clearTimeout(timer)})}const txListener=async receipt=>{if(await receipt.confirmations()>=confirms){cancel();resolve(receipt)}};cancellers.push(()=>{this.provider.off(this.hash,txListener)});this.provider.on(this.hash,txListener);if(startBlock>=0){const replaceListener=async()=>{try{await checkReplacement()}catch(error){if(isError(error,"TRANSACTION_REPLACED")){cancel();reject(error);return}}if(!stopScanning){this.provider.once("block",replaceListener)}};cancellers.push(()=>{this.provider.off("block",replaceListener)});this.provider.once("block",replaceListener)}});return await waiter}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}removedEvent(){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createRemovedTransactionFilter(this)}reorderedEvent(other){assert(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});assert(!other||other.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"});return createReorderedTransactionFilter(this,other)}replaceableTransaction(startBlock){assertArgument(Number.isInteger(startBlock)&&startBlock>=0,"invalid startBlock","startBlock",startBlock);const tx=new TransactionResponse(this,this.provider);tx.#startBlock=startBlock;return tx}}function createOrphanedBlockFilter(block){return{orphan:"drop-block",hash:block.hash,number:block.number}}function createReorderedTransactionFilter(tx,other){return{orphan:"reorder-transaction",tx:tx,other:other}}function createRemovedTransactionFilter(tx){return{orphan:"drop-transaction",tx:tx}}function createRemovedLogFilter(log){return{orphan:"drop-log",log:{transactionHash:log.transactionHash,blockHash:log.blockHash,blockNumber:log.blockNumber,address:log.address,data:log.data,topics:Object.freeze(log.topics.slice()),index:log.index}}}class EventLog extends Log{interface;fragment;args;constructor(log,iface,fragment){super(log,log.provider);const args=iface.decodeEventLog(fragment,log.data,log.topics);defineProperties(this,{args:args,fragment:fragment,interface:iface})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class ContractTransactionReceipt extends TransactionReceipt{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}get logs(){return super.logs.map(log=>{const fragment=log.topics.length?this.#iface.getEvent(log.topics[0]):null;if(fragment){return new EventLog(log,this.#iface,fragment)}else{return log}})}}class ContractTransactionResponse extends TransactionResponse{#iface;constructor(iface,provider,tx){super(tx,provider);this.#iface=iface}async wait(confirms){const receipt=await super.wait();if(receipt==null){return null}return new ContractTransactionReceipt(this.#iface,this.provider,receipt)}}class ContractUnknownEventPayload extends EventPayload{log;constructor(contract,listener,filter,log){super(contract,listener,filter);defineProperties(this,{log:log})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class ContractEventPayload extends ContractUnknownEventPayload{constructor(contract,listener,filter,fragment,_log){super(contract,listener,filter,new EventLog(_log,contract.interface,fragment));const args=contract.interface.decodeEventLog(fragment,this.log.data,this.log.topics);defineProperties(this,{args:args,fragment:fragment})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const BN_0$1=BigInt(0);function canCall(value){return value&&typeof value.call==="function"}function canEstimate(value){return value&&typeof value.estimateEnergy==="function"}function canResolve(value){return value&&typeof value.resolveName==="function"}function canSend(value){return value&&typeof value.sendTransaction==="function"}class PreparedTopicFilter{#filter;fragment;constructor(contract,fragment,args){defineProperties(this,{fragment:fragment});if(fragment.inputs.length{const arg=args[index];if(arg==null){return null}return param.walkAsync(args[index],(type,value)=>{if(type==="address"){return resolveAddress(value)}return value})}));return contract.interface.encodeFilterTopics(fragment,resolvedArgs)}()}getTopicFilter(){return this.#filter}}function getRunner(value,feature){if(value==null){return null}if(typeof value[feature]==="function"){return value}if(value.provider&&typeof value.provider[feature]==="function"){return value.provider}return null}function getProvider(value){if(value==null){return null}return value.provider||null}async function copyOverrides(arg,allowed){const overrides=copyRequest(Typed.dereference(arg,"overrides"));assertArgument(overrides.to==null||(allowed||[]).indexOf("to")>=0,"cannot override to","overrides.to",overrides.to);assertArgument(overrides.data==null||(allowed||[]).indexOf("data")>=0,"cannot override data","overrides.data",overrides.data);if(overrides.from){overrides.from=await resolveAddress(overrides.from)}return overrides}async function resolveArgs(_runner,inputs,args){return await Promise.all(inputs.map((param,index)=>{return param.walkAsync(args[index],(type,value)=>{value=Typed.dereference(value,type);if(type==="address"){return resolveAddress(value)}return value})}))}function buildWrappedFallback(contract){const populateTransaction=async function(overrides){const tx=await copyOverrides(overrides,["data"]);tx.to=await contract.getAddress();const iface=contract.interface;const payable=iface.receive||iface.fallback&&iface.fallback.payable;assertArgument(payable||(tx.value||BN_0$1)===BN_0$1,"cannot send value to non-payable contract","overrides.value",tx.value);assertArgument(iface.fallback||(tx.data||"0x")==="0x","cannot send data to receive-only contract","overrides.data",tx.data);return tx};const staticCall=async function(overrides){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(overrides);try{return await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}};const send=async function(overrides){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(overrides));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(overrides){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(overrides))};const method=async overrides=>{return await send(overrides)};defineProperties(method,{_contract:contract,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall});return method}function buildWrappedMethod(contract,key){const getFragment=function(...args){const fragment=contract.interface.getFunction(key,args);assert(fragment,"no matching fragment in getFragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const populateTransaction=async function(...args){const fragment=getFragment(...args);let overrides={};if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("internal error: fragment inputs doesn't match arguments; should not happen")}const resolvedArgs=await resolveArgs(contract.runner,fragment.inputs,args);return Object.assign({},overrides,await resolveProperties({to:contract.getAddress(),data:contract.interface.encodeFunctionData(fragment,resolvedArgs)}))};const staticCall=async function(...args){const result=await staticCallResult(...args);if(result.length===1){return result[0]}return result};const send=async function(...args){const runner=contract.runner;assert(canSend(runner),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const tx=await runner.sendTransaction(await populateTransaction(...args));const provider=getProvider(contract.runner);return new ContractTransactionResponse(contract.interface,provider,tx)};const estimateEnergy=async function(...args){const runner=getRunner(contract.runner,"estimateEnergy");assert(canEstimate(runner),"contract runner does not support energy estimation","UNSUPPORTED_OPERATION",{operation:"estimateEnergy"});return await runner.estimateEnergy(await populateTransaction(...args))};const staticCallResult=async function(...args){const runner=getRunner(contract.runner,"call");assert(canCall(runner),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const tx=await populateTransaction(...args);let result="0x";try{result=await runner.call(tx)}catch(error){if(isCallException(error)&&error.data){throw contract.interface.makeError(error.data,tx)}throw error}const fragment=getFragment(...args);return contract.interface.decodeFunctionResult(fragment,result)};const method=async(...args)=>{const fragment=getFragment(...args);if(fragment.constant){return await staticCall(...args)}return await send(...args)};defineProperties(method,{name:contract.interface.getFunctionName(key),_contract:contract,_key:key,getFragment:getFragment,estimateEnergy:estimateEnergy,populateTransaction:populateTransaction,send:send,staticCall:staticCall,staticCallResult:staticCallResult});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getFunction(key);assert(fragment,"no matching fragment in defineProperty","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}function buildWrappedEvent(contract,key){const getFragment=function(...args){const fragment=contract.interface.getEvent(key,args);assert(fragment,"no matching fragment in","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment};const method=function(...args){return new PreparedTopicFilter(contract,getFragment(...args),args)};defineProperties(method,{name:contract.interface.getEventName(key),_contract:contract,_key:key,getFragment:getFragment});Object.defineProperty(method,"fragment",{configurable:false,enumerable:true,get:()=>{const fragment=contract.interface.getEvent(key);assert(fragment,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment"});return fragment}});return method}const internal=Symbol.for("_corebcInternal_contract");const internalValues=new WeakMap;function setInternal(contract,values){internalValues.set(contract[internal],values)}function getInternal(contract){return internalValues.get(contract[internal])}function isDeferred(value){return value&&typeof value==="object"&&"getTopicFilter"in value&&typeof value.getTopicFilter==="function"&&value.fragment}async function getSubInfo(contract,event){let topics;let fragment=null;if(Array.isArray(event)){const topicHashify=function(name){if(isHexString(name,32)){return name}const fragment=contract.interface.getEvent(name);assertArgument(fragment,"unknown fragment","name",name);return fragment.topicHash};topics=event.map(e=>{if(e==null){return null}if(Array.isArray(e)){return e.map(topicHashify)}return topicHashify(e)})}else if(event==="*"){topics=[null]}else if(typeof event==="string"){if(isHexString(event,32)){topics=[event]}else{fragment=contract.interface.getEvent(event);assertArgument(fragment,"unknown fragment","event",event);topics=[fragment.topicHash]}}else if(isDeferred(event)){topics=await event.getTopicFilter()}else if("fragment"in event){fragment=event.fragment;topics=[fragment.topicHash]}else{assertArgument(false,"unknown event name","event",event)}topics=topics.map(t=>{if(t==null){return null}if(Array.isArray(t)){const items=Array.from(new Set(t.map(t=>t.toLowerCase())).values());if(items.length===1){return items[0]}items.sort();return items}return t.toLowerCase()});const tag=topics.map(t=>{if(t==null){return"null"}if(Array.isArray(t)){return t.join("|")}return t}).join("&");return{fragment:fragment,tag:tag,topics:topics}}async function hasSub(contract,event){const{subs}=getInternal(contract);return subs.get((await getSubInfo(contract,event)).tag)||null}async function getSub(contract,operation,event){const provider=getProvider(contract.runner);assert(provider,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:operation});const{fragment,tag,topics}=await getSubInfo(contract,event);const{addr,subs}=getInternal(contract);let sub=subs.get(tag);if(!sub){const address=addr?addr:contract;const filter={address:address,topics:topics};const listener=log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=contract.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){const _foundFragment=foundFragment;const args=fragment?contract.interface.decodeEventLog(fragment,log.data,log.topics):[];emit(contract,event,args,listener=>{return new ContractEventPayload(contract,listener,event,_foundFragment,log)})}else{emit(contract,event,[],listener=>{return new ContractUnknownEventPayload(contract,listener,event,log)})}};let starting=[];const start=()=>{if(starting.length){return}starting.push(provider.on(filter,listener))};const stop=async()=>{if(starting.length==0){return}let started=starting;starting=[];await Promise.all(started);provider.off(filter,listener)};sub={tag:tag,listeners:[],start:start,stop:stop};subs.set(tag,sub)}return sub}let lastEmit=Promise.resolve();async function _emit(contract,event,args,payloadFunc){await lastEmit;const sub=await hasSub(contract,event);if(!sub){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const passArgs=Array.from(args);if(payloadFunc){passArgs.push(payloadFunc(once?null:listener))}try{listener.call(contract,...passArgs)}catch(error){}return!once});return count>0}async function emit(contract,event,args,payloadFunc){try{await lastEmit}catch(error){}const resultPromise=_emit(contract,event,args,payloadFunc);lastEmit=resultPromise;return await resultPromise}const passProperties=["then"];class BaseContract{target;interface;runner;filters;[internal];fallback;constructor(target,abi,runner,_deployTx){if(runner==null){runner=null}const iface=Interface.from(abi);defineProperties(this,{target:target,runner:runner,interface:iface});Object.defineProperty(this,internal,{value:{}});let addrPromise;let addr=null;let deployTx=null;if(_deployTx){const provider=getProvider(runner);deployTx=new ContractTransactionResponse(this.interface,provider,_deployTx)}let subs=new Map;if(typeof target==="string"){if(isHexString(target)){addr=target;addrPromise=Promise.resolve(target)}else{const resolver=getRunner(runner,"resolveName");if(!canResolve(resolver)){throw makeError("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"})}addrPromise=resolver.resolveName(target).then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}}else{addrPromise=target.getAddress().then(addr=>{if(addr==null){throw new Error("TODO")}getInternal(this).addr=addr;return addr})}setInternal(this,{addrPromise:addrPromise,addr:addr,deployTx:deployTx,subs:subs});const filters=new Proxy({},{get:(target,_prop,receiver)=>{if(passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=this.getEvent(prop);if(result){return result}throw new Error(`unknown contract event: ${prop}`)},has:(target,prop)=>{if(passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return Reflect.has(target,prop)||this.interface.hasEvent(String(prop))}});defineProperties(this,{filters:filters});defineProperties(this,{fallback:iface.receive||iface.fallback?buildWrappedFallback(this):null});return new Proxy(this,{get:(target,_prop,receiver)=>{if(_prop in target||passProperties.indexOf(_prop)>=0){return Reflect.get(target,_prop,receiver)}const prop=String(_prop);const result=target.getFunction(prop);if(result){return result}throw new Error(`unknown contract method: ${prop}`)},has:(target,prop)=>{if(prop in target||passProperties.indexOf(prop)>=0){return Reflect.has(target,prop)}return target.interface.hasFunction(String(prop))}})}connect(runner){return new BaseContract(this.target,this.interface,runner)}async getAddress(){return await getInternal(this).addrPromise}async getDeployedCode(){const provider=getProvider(this.runner);assert(provider,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const code=await provider.getCode(await this.getAddress());if(code==="0x"){return null}return code}async waitForDeployment(){const deployTx=this.deploymentTransaction();if(deployTx){await deployTx.wait();return this}const code=await this.getDeployedCode();if(code!=null){return this}const provider=getProvider(this.runner);assert(provider!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"});return new Promise((resolve,reject)=>{const checkCode=async()=>{try{const code=await this.getDeployedCode();if(code!=null){return resolve(this)}provider.once("block",checkCode)}catch(error){reject(error)}};checkCode()})}deploymentTransaction(){return getInternal(this).deployTx}getFunction(key){if(typeof key!=="string"){key=key.format()}const func=buildWrappedMethod(this,key);return func}getEvent(key){if(typeof key!=="string"){key=key.format()}return buildWrappedEvent(this,key)}async queryTransaction(hash){throw new Error("@TODO")}async queryFilter(event,fromBlock,toBlock){if(fromBlock==null){fromBlock=0}if(toBlock==null){toBlock="latest"}const{addr,addrPromise}=getInternal(this);const address=addr?addr:await addrPromise;const{fragment,topics}=await getSubInfo(this,event);const filter={address:address,topics:topics,fromBlock:fromBlock,toBlock:toBlock};const provider=getProvider(this.runner);assert(provider,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"});return(await provider.getLogs(filter)).map(log=>{let foundFragment=fragment;if(foundFragment==null){try{foundFragment=this.interface.getEvent(log.topics[0])}catch(error){}}if(foundFragment){return new EventLog(log,this.interface,foundFragment)}else{return new Log(log,provider)}})}async on(event,listener){const sub=await getSub(this,"on",event);sub.listeners.push({listener:listener,once:false});sub.start();return this}async once(event,listener){const sub=await getSub(this,"once",event);sub.listeners.push({listener:listener,once:true});sub.start();return this}async emit(event,...args){return await emit(this,event,args,null)}async listenerCount(event){if(event){const sub=await hasSub(this,event);if(!sub){return 0}return sub.listeners.length}const{subs}=getInternal(this);let total=0;for(const{listeners}of subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}const{subs}=getInternal(this);let result=[];for(const{listeners}of subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await hasSub(this,event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(listener==null||sub.listeners.length===0){sub.stop();getInternal(this).subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const sub=await hasSub(this,event);if(!sub){return this}sub.stop();getInternal(this).subs.delete(sub.tag)}else{const{subs}=getInternal(this);for(const{tag,stop}of subs.values()){stop();subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return await this.off(event,listener)}static buildClass(abi){class CustomContract extends BaseContract{constructor(address,runner=null){super(address,abi,runner)}}return CustomContract}static from(target,abi,runner){if(runner==null){runner=null}const contract=new this(target,abi,runner);return contract}static isIndexed(value){return Indexed.isIndexed(value)}}function _ContractBase(){return BaseContract}class Contract extends _ContractBase(){}class ContractFactory{interface;bytecode;runner;constructor(abi,bytecode,runner){const iface=Interface.from(abi);if(bytecode instanceof Uint8Array){bytecode=hexlify(getBytes(bytecode))}else if(typeof bytecode==="string"){bytecode=bytecode}else if(isBytes$1(bytecode)){bytecode=hexlify(bytecode)}else if(bytecode&&typeof bytecode.object==="string"){bytecode=bytecode.object}else{bytecode="!"}defineProperties(this,{bytecode:bytecode,interface:iface,runner:runner||null})}async getDeployTransaction(...args){let overrides={};const fragment=this.interface.deploy;if(fragment.inputs.length+1===args.length){overrides=await copyOverrides(args.pop())}if(fragment.inputs.length!==args.length){throw new Error("incorrect number of arguments to constructor")}const resolvedArgs=await resolveArgs(this.runner,fragment.inputs,args);const data=concat([this.bytecode,this.interface.encodeDeploy(resolvedArgs)]);return Object.assign({},overrides,{data:data})}async deploy(...args){const tx=await this.getDeployTransaction(...args);assert(this.runner&&typeof this.runner.sendTransaction==="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const sentTx=await this.runner.sendTransaction(tx);const address=getCreateAddress(sentTx);return new BaseContract(address,this.interface,this.runner,sentTx)}connect(runner){return new ContractFactory(this.interface,this.bytecode,runner)}static fromSolidity(output,runner){assertArgument(output!=null,"bad compiler output","output",output);if(typeof output==="string"){output=JSON.parse(output)}const abi=output.abi;let bytecode="";if(output.bytecode){bytecode=output.bytecode}else if(output.evm&&output.evm.bytecode){bytecode=output.evm.bytecode}return new this(abi,bytecode,runner)}}const BN_0=BigInt(0);function allowNull(format,nullValue){return function(value){if(value==null){return nullValue}return format(value)}}function arrayOf(format){return array=>{if(!Array.isArray(array)){throw new Error("not an array")}return array.map(i=>format(i))}}function object(format,altNames){return value=>{const result={};for(const key in format){let srcKey=key;if(altNames&&key in altNames&&!(srcKey in value)){for(const altKey of altNames[key]){if(altKey in value){srcKey=altKey;break}}}try{const nv=format[key](value[srcKey]);if(nv!==undefined){result[key]=nv}}catch(error){const message=error instanceof Error?error.message:"not-an-error";assert(false,`invalid value for value.${key} (${message})`,"BAD_DATA",{value:value})}}return result}}function formatBoolean(value){switch(value){case true:case"true":return true;case false:case"false":return false}assertArgument(false,`invalid boolean; ${JSON.stringify(value)}`,"value",value)}function formatData(value){assertArgument(isHexString(value,true),"invalid data","value",value);return value}function formatHash(value){assertArgument(isHexString(value,32),"invalid hash","value",value);return value}const _formatLog=object({address:getAddress,blockHash:formatHash,blockNumber:getNumber,data:formatData,index:getNumber,removed:allowNull(formatBoolean,false),topics:arrayOf(formatHash),transactionHash:formatHash,transactionIndex:getNumber},{index:["logIndex"]});function formatLog(value){return _formatLog(value)}const _formatBlock=object({hash:allowNull(formatHash),parentHash:formatHash,number:getNumber,timestamp:getNumber,nonce:allowNull(formatData),difficulty:getBigInt,energyLimit:getBigInt,energyUsed:getBigInt,miner:allowNull(getAddress),extraData:formatData,baseFeePerEnergy:allowNull(getBigInt)});function formatBlock(value){const result=_formatBlock(value);result.transactions=value.transactions.map(tx=>{if(typeof tx==="string"){return tx}return formatTransactionResponse(tx)});return result}const _formatReceiptLog=object({transactionIndex:getNumber,blockNumber:getNumber,transactionHash:formatHash,address:getAddress,topics:arrayOf(formatHash),data:formatData,index:getNumber,blockHash:formatHash},{index:["logIndex"]});function formatReceiptLog(value){return _formatReceiptLog(value)}const _formatTransactionReceipt=object({to:allowNull(getAddress,null),from:allowNull(getAddress,null),contractAddress:allowNull(getAddress,null),index:getNumber,root:allowNull(hexlify),energyUsed:getBigInt,logsBloom:allowNull(formatData),blockHash:formatHash,hash:formatHash,logs:arrayOf(formatReceiptLog),blockNumber:getNumber,cumulativeEnergyUsed:getBigInt,effectiveEnergyPrice:allowNull(getBigInt),status:allowNull(getNumber),type:allowNull(getNumber,0)},{effectiveEnergyPrice:["energyPrice"],hash:["transactionHash"],index:["transactionIndex"]});function formatTransactionReceipt(value){return _formatTransactionReceipt(value)}function formatTransactionResponse(value){if(value.to&&!getAddress(value.to)&&getBigInt(value.to)===BN_0){value.to="0x0000000000000000000000000000000000000000"}const result=object({hash:formatHash,type:value=>{if(value==="0x"||value==null){return 0}return getNumber(value)},accessList:allowNull(accessListify,null),blockHash:allowNull(formatHash,null),blockNumber:allowNull(getNumber,null),transactionIndex:allowNull(getNumber,null),from:getAddress,maxFeePerEnergy:allowNull(getBigInt),energyLimit:getBigInt,to:allowNull(getAddress,null),value:getBigInt,nonce:getNumber,data:formatData,creates:allowNull(getAddress,null),networkId:allowNull(getBigInt,null)},{data:["input"],energyLimit:["energy"]})(value);if(result.to==null&&result.creates==null){result.creates=getCreateAddress(result)}if(value.signature){result.signature=value.signature}else{result.signature=value}if(result.networkId==null){const networkId=result.signature.legacynetworkId;if(networkId!=null){result.networkId=networkId}}if(result.blockHash&&getBigInt(result.blockHash)===BN_0){result.blockHash=null}return result}class NetworkPlugin{name;constructor(name){defineProperties(this,{name:name})}clone(){return new NetworkPlugin(this.name)}}class EnergyCostPlugin extends NetworkPlugin{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(effectiveBlock,costs){if(effectiveBlock==null){effectiveBlock=0}super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock||0}`);const props={effectiveBlock:effectiveBlock};function set(name,nullish){let value=(costs||{})[name];if(value==null){value=nullish}assertArgument(typeof value==="number",`invalud value for ${name}`,"costs",costs);props[name]=value}set("txBase",21e3);set("txCreate",32e3);set("txDataZero",4);set("txDataNonzero",16);set("txAccessListStorageKey",1900);set("txAccessListAddress",2400);defineProperties(this,props)}clone(){return new EnergyCostPlugin(this.effectiveBlock,this)}}class FeeDataNetworkPlugin extends NetworkPlugin{#feeDataFunc;get feeDataFunc(){return this.#feeDataFunc}constructor(feeDataFunc){super("org.corebc.plugins.network.FeeData");this.#feeDataFunc=feeDataFunc}async getFeeData(provider){return await this.#feeDataFunc(provider)}clone(){return new FeeDataNetworkPlugin(this.#feeDataFunc)}}const Networks=new Map;class Network{#name;#networkId;#plugins;constructor(name,networkId){this.#name=name;this.#networkId=getBigInt(networkId);this.#plugins=new Map}toJSON(){return{name:this.name,networkId:String(this.networkId)}}get name(){return this.#name}set name(value){this.#name=value}get networkId(){return this.#networkId}set networkId(value){this.#networkId=getBigInt(value,"networkId")}matches(other){if(other==null){return false}if(typeof other==="string"){try{return this.networkId===getBigInt(other)}catch(error){}return this.name===other}if(typeof other==="number"||typeof other==="bigint"){try{return this.networkId===getBigInt(other)}catch(error){}return false}if(typeof other==="object"){if(other.networkId!=null){try{return this.networkId===getBigInt(other.networkId)}catch(error){}return false}if(other.name!=null){return this.name===other.name}return false}return false}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.clone());return this}getPlugin(name){return this.#plugins.get(name)||null}getPlugins(basename){return this.plugins.filter(p=>p.name.split("#")[0]===basename)}clone(){const clone=new Network(this.name,this.networkId);this.plugins.forEach(plugin=>{clone.attachPlugin(plugin.clone())});return clone}computeIntrinsicEnergy(tx){const costs=this.getPlugin("org.corebc.plugins.network.EnergyCost")||new EnergyCostPlugin;let energy=costs.txBase;if(tx.to==null){energy+=costs.txCreate}if(tx.data){for(let i=2;i{Network.register(name,func)})}}registerEth("mainnet",1,{altNames:["homestead"]});registerEth("ropsten",3,{});registerEth("rinkeby",4,{});registerEth("goerli",5,{});registerEth("kovan",42,{});registerEth("sepolia",11155111,{});registerEth("classic",61,{});registerEth("classicKotti",6,{});registerEth("xdai",100,{})}function copy$2(obj){return JSON.parse(JSON.stringify(obj))}class PollingBlockSubscriber{#provider;#poller;#interval;#blockNumber;constructor(provider){this.#provider=provider;this.#poller=null;this.#interval=4e3;this.#blockNumber=-2}get pollingInterval(){return this.#interval}set pollingInterval(value){this.#interval=value}async#poll(){try{const blockNumber=await this.#provider.getBlockNumber();if(this.#blockNumber===-2){this.#blockNumber=blockNumber;return}if(blockNumber!==this.#blockNumber){for(let b=this.#blockNumber+1;b<=blockNumber;b++){if(this.#poller==null){return}await this.#provider.emit("block",b)}this.#blockNumber=blockNumber}}catch(error){}if(this.#poller==null){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval)}start(){if(this.#poller){return}this.#poller=this.#provider._setTimeout(this.#poll.bind(this),this.#interval);this.#poll()}stop(){if(!this.#poller){return}this.#provider._clearTimeout(this.#poller);this.#poller=null}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}class OnBlockSubscriber{#provider;#poll;#running;constructor(provider){this.#provider=provider;this.#running=false;this.#poll=blockNumber=>{this._poll(blockNumber,this.#provider)}}async _poll(blockNumber,provider){throw new Error("sub-classes must override this")}start(){if(this.#running){return}this.#running=true;this.#poll(-2);this.#provider.on("block",this.#poll)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poll)}pause(dropWhilePaused){this.stop()}resume(){this.start()}}class PollingOrphanSubscriber extends OnBlockSubscriber{#filter;constructor(provider,filter){super(provider);this.#filter=copy$2(filter)}async _poll(blockNumber,provider){throw new Error("@TODO")}}class PollingTransactionSubscriber extends OnBlockSubscriber{#hash;constructor(provider,hash){super(provider);this.#hash=hash}async _poll(blockNumber,provider){const tx=await provider.getTransactionReceipt(this.#hash);if(tx){provider.emit(this.#hash,tx)}}}class PollingEventSubscriber{#provider;#filter;#poller;#running;#blockNumber;constructor(provider,filter){this.#provider=provider;this.#filter=copy$2(filter);this.#poller=this.#poll.bind(this);this.#running=false;this.#blockNumber=-2}async#poll(blockNumber){if(this.#blockNumber===-2){return}const filter=copy$2(this.#filter);filter.fromBlock=this.#blockNumber+1;filter.toBlock=blockNumber;const logs=await this.#provider.getLogs(filter);if(logs.length===0){if(this.#blockNumber{this.#blockNumber=blockNumber})}this.#provider.on("block",this.#poller)}stop(){if(!this.#running){return}this.#running=false;this.#provider.off("block",this.#poller)}pause(dropWhilePaused){this.stop();if(dropWhilePaused){this.#blockNumber=-2}}resume(){this.start()}}const MAX_CCIP_REDIRECTS=10;function isPromise(value){return value&&typeof value.then==="function"}function getTag(prefix,value){return prefix+":"+JSON.stringify(value,(k,v)=>{if(v==null){return"null"}if(typeof v==="bigint"){return`bigint:${v.toString()}`}if(typeof v==="string"){return v.toLowerCase()}if(typeof v==="object"&&!Array.isArray(v)){const keys=Object.keys(v);keys.sort();return keys.reduce((accum,key)=>{accum[key]=v[key];return accum},{})}return v})}class UnmanagedSubscriber{name;constructor(name){defineProperties(this,{name:name})}start(){}stop(){}pause(dropWhilePaused){}resume(){}}function copy$1(value){return JSON.parse(JSON.stringify(value))}function concisify(items){items=Array.from(new Set(items).values());items.sort();return items}async function getSubscription(_event,provider){if(_event==null){throw new Error("invalid event")}if(Array.isArray(_event)){_event={topics:_event}}if(typeof _event==="string"){switch(_event){case"block":case"pending":case"debug":case"error":case"network":{return{type:_event,tag:_event}}}}if(isHexString(_event,32)){const hash=_event.toLowerCase();return{type:"transaction",tag:getTag("tx",{hash:hash}),hash:hash}}if(_event.orphan){const event=_event;return{type:"orphan",tag:getTag("orphan",event),filter:copy$1(event)}}if(_event.address||_event.topics){const event=_event;const filter={topics:(event.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()})};if(event.address){const addresses=[];const promises=[];const addAddress=addr=>{if(isHexString(addr)){addresses.push(addr)}else{promises.push((async()=>{addresses.push(await resolveAddress(addr))})())}};if(Array.isArray(event.address)){event.address.forEach(addAddress)}else{addAddress(event.address)}if(promises.length){await Promise.all(promises)}filter.address=concisify(addresses.map(a=>a.toLowerCase()))}return{filter:filter,tag:getTag("event",filter),type:"event"}}assertArgument(false,"unknown ProviderEvent","event",_event)}function getTime$1(){return(new Date).getTime()}class AbstractProvider{#subs;#plugins;#pausedState;#networkPromise;#anyNetwork;#performCache;#lastBlockNumber;#nextTimer;#timers;#disableCcipRead;constructor(_network){if(_network==="any"){this.#anyNetwork=true;this.#networkPromise=null}else if(_network){const network=Network.from(_network);this.#anyNetwork=false;this.#networkPromise=Promise.resolve(network);setTimeout(()=>{this.emit("network",network,null)},0)}else{this.#anyNetwork=false;this.#networkPromise=null}this.#lastBlockNumber=-1;this.#performCache=new Map;this.#subs=new Map;this.#plugins=new Map;this.#pausedState=null;this.#nextTimer=1;this.#timers=new Map;this.#disableCcipRead=false}get provider(){return this}get plugins(){return Array.from(this.#plugins.values())}attachPlugin(plugin){if(this.#plugins.get(plugin.name)){throw new Error(`cannot replace existing plugin: ${plugin.name} `)}this.#plugins.set(plugin.name,plugin.connect(this));return this}getPlugin(name){return this.#plugins.get(name)||null}get disableCcipRead(){return this.#disableCcipRead}set disableCcipRead(value){this.#disableCcipRead=!!value}async#perform(req){const tag=getTag(req.method,req);let perform=this.#performCache.get(tag);if(!perform){perform=this._perform(req);this.#performCache.set(tag,perform);setTimeout(()=>{if(this.#performCache.get(tag)===perform){this.#performCache.delete(tag)}},250)}return await perform}async ccipReadFetch(tx,calldata,urls){if(this.disableCcipRead||urls.length===0||tx.to==null){return null}const sender=tx.to.toLowerCase();const data=calldata.toLowerCase();const errorMessages=[];for(let i=0;i=500,`response not found during CCIP fetch: ${errorMessage}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:tx,info:{url:url,errorMessage:errorMessage}});errorMessages.push(errorMessage)}assert(false,`error encountered during CCIP fetch: ${errorMessages.map(m=>JSON.stringify(m)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:tx,info:{urls:urls,errorMessages:errorMessages}})}_wrapBlock(value,network){return new Block(formatBlock(value),this)}_wrapLog(value,network){return new Log(formatLog(value),this)}_wrapTransactionReceipt(value,network){return new TransactionReceipt(formatTransactionReceipt(value),this)}_wrapTransactionResponse(tx,network){return new TransactionResponse(formatTransactionResponse(tx),this)}_detectNetwork(){assert(false,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(req){assert(false,`unsupported method: ${req.method}`,"UNSUPPORTED_OPERATION",{operation:req.method,info:req})}async getBlockNumber(){const blockNumber=getNumber(await this.#perform({method:"getBlockNumber"}),"%response");if(this.#lastBlockNumber>=0){this.#lastBlockNumber=blockNumber}return blockNumber}_getAddress(address){return resolveAddress(address)}_getBlockTag(blockTag){if(blockTag==null){return"latest"}switch(blockTag){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return blockTag}if(isHexString(blockTag)){if(isHexString(blockTag,32)){return blockTag}return toQuantity(blockTag)}if(typeof blockTag==="bigint"){blockTag=getNumber(blockTag,"blockTag")}if(typeof blockTag==="number"){if(blockTag>=0){return toQuantity(blockTag)}if(this.#lastBlockNumber>=0){return toQuantity(this.#lastBlockNumber+blockTag)}return this.getBlockNumber().then(b=>toQuantity(b+blockTag))}assertArgument(false,"invalid blockTag","blockTag",blockTag)}_getFilter(filter){const topics=(filter.topics||[]).map(t=>{if(t==null){return null}if(Array.isArray(t)){return concisify(t.map(t=>t.toLowerCase()))}return t.toLowerCase()});const blockHash="blockHash"in filter?filter.blockHash:undefined;const resolve=(_address,fromBlock,toBlock)=>{let address=undefined;switch(_address.length){case 0:break;case 1:address=_address[0];break;default:_address.sort();address=_address}if(blockHash){if(fromBlock!=null||toBlock!=null){throw new Error("invalid filter")}}const filter={};if(address){filter.address=address}if(topics.length){filter.topics=topics}if(fromBlock){filter.fromBlock=fromBlock}if(toBlock){filter.toBlock=toBlock}if(blockHash){filter.blockHash=blockHash}return filter};let address=[];if(filter.address){if(Array.isArray(filter.address)){for(const addr of filter.address){address.push(this._getAddress(addr))}}else{address.push(this._getAddress(filter.address))}}let fromBlock=undefined;if("fromBlock"in filter){fromBlock=this._getBlockTag(filter.fromBlock)}let toBlock=undefined;if("toBlock"in filter){toBlock=this._getBlockTag(filter.toBlock)}if(address.filter(a=>typeof a!=="string").length||fromBlock!=null&&typeof fromBlock!=="string"||toBlock!=null&&typeof toBlock!=="string"){return Promise.all([Promise.all(address),fromBlock,toBlock]).then(result=>{return resolve(result[0],result[1],result[2])})}return resolve(address,fromBlock,toBlock)}_getTransactionRequest(_request){const request=copyRequest(_request);const promises=[];["to","from"].forEach(key=>{if(request[key]==null){return}const addr=resolveAddress(request[key]);if(isPromise(addr)){promises.push(async function(){request[key]=await addr}())}else{request[key]=addr}});if(request.blockTag!=null){const blockTag=this._getBlockTag(request.blockTag);if(isPromise(blockTag)){promises.push(async function(){request.blockTag=await blockTag}())}else{request.blockTag=blockTag}}if(promises.length){return async function(){await Promise.all(promises);return request}()}return request}async getNetwork(){if(this.#networkPromise==null){const detectNetwork=this._detectNetwork().then(network=>{this.emit("network",network,null);return network},error=>{if(this.#networkPromise===detectNetwork){this.#networkPromise=null}throw error});this.#networkPromise=detectNetwork;return(await detectNetwork).clone()}const networkPromise=this.#networkPromise;const[expected,actual]=await Promise.all([networkPromise,this._detectNetwork()]);if(expected.networkId!==actual.networkId){if(this.#anyNetwork){this.emit("network",actual,expected);if(this.#networkPromise===networkPromise){this.#networkPromise=Promise.resolve(actual)}}else{assert(false,`network changed: ${expected.networkId} => ${actual.networkId} `,"NETWORK_ERROR",{event:"changed"})}}return expected.clone()}async getEnergyPrice(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async getFeeData(){const{energyPrice}=await resolveProperties({block:this.getBlock("latest"),energyPrice:(async()=>{try{const energyPrice=await this.#perform({method:"getEnergyPrice"});return getBigInt(energyPrice,"%response")}catch(error){}return null})()});return new FeeData(energyPrice)}async estimateEnergy(_tx){let tx=this._getTransactionRequest(_tx);if(isPromise(tx)){tx=await tx}return getBigInt(await this.#perform({method:"estimateEnergy",transaction:tx}),"%response")}async#call(tx,blockTag,attempt){assert(attempt=0&&blockTag==="latest"&&transaction.to!=null&&dataSlice(error.data,0,4)==="0x556f1830"){const data=error.data;const txSender=await resolveAddress(transaction.to);let ccipArgs;try{ccipArgs=parseOffchainLookup(dataSlice(error.data,4))}catch(error){assert(false,error.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:transaction,info:{data:data}})}assert(ccipArgs.sender.toLowerCase()===txSender.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:data,reason:"OffchainLookup",transaction:transaction,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:ccipArgs.errorArgs}});const ccipResult=await this.ccipReadFetch(transaction,ccipArgs.calldata,ccipArgs.urls);assert(ccipResult!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:transaction,info:{data:error.data,errorArgs:ccipArgs.errorArgs}});const tx={to:txSender,data:concat([ccipArgs.selector,encodeBytes([ccipResult,ccipArgs.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:tx});try{const result=await this.#call(tx,blockTag,attempt+1);this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},tx),result:result});return result}catch(error){this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},tx),error:error});throw error}}throw error}}async#checkNetwork(promise){const{value}=await resolveProperties({network:this.getNetwork(),value:promise});return value}async call(_tx){const{tx,blockTag}=await resolveProperties({tx:this._getTransactionRequest(_tx),blockTag:this._getBlockTag(_tx.blockTag)});return await this.#checkNetwork(this.#call(tx,blockTag,_tx.enableCcipRead?0:-1))}async#getAccountValue(request,_address,_blockTag){let address=this._getAddress(_address);let blockTag=this._getBlockTag(_blockTag);if(typeof address!=="string"||typeof blockTag!=="string"){[address,blockTag]=await Promise.all([address,blockTag])}return await this.#checkNetwork(this.#perform(Object.assign(request,{address:address,blockTag:blockTag})))}async getBalance(address,blockTag){return getBigInt(await this.#getAccountValue({method:"getBalance"},address,blockTag),"%response")}async getTransactionCount(address,blockTag){return getNumber(await this.#getAccountValue({method:"getTransactionCount"},address,blockTag),"%response")}async getCode(address,blockTag){return hexlify(await this.#getAccountValue({method:"getCode"},address,blockTag))}async getStorage(address,_position,blockTag){const position=getBigInt(_position,"position");return hexlify(await this.#getAccountValue({method:"getStorage",position:position},address,blockTag))}async broadcastTransaction(signedTx){const{blockNumber,hash,network}=await resolveProperties({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:signedTx}),network:this.getNetwork()});const tx=Transaction.from(signedTx);if(tx.hash!==hash){throw new Error("@TODO: the returned hash did not match")}return this._wrapTransactionResponse(tx,network).replaceableTransaction(blockNumber)}async#getBlock(block,includeTransactions){if(isHexString(block,32)){return await this.#perform({method:"getBlock",blockHash:block,includeTransactions:includeTransactions})}let blockTag=this._getBlockTag(block);if(typeof blockTag!=="string"){blockTag=await blockTag}return await this.#perform({method:"getBlock",blockTag:blockTag,includeTransactions:includeTransactions})}async getBlock(block,prefetchTxs){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#getBlock(block,!!prefetchTxs)});if(params==null){return null}return this._wrapBlock(params,network)}async getTransaction(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransaction",hash:hash})});if(params==null){return null}return this._wrapTransactionResponse(params,network)}async getTransactionReceipt(hash){const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getTransactionReceipt",hash:hash})});if(params==null){return null}if(params.energyPrice==null&¶ms.effectiveEnergyPrice==null){const tx=await this.#perform({method:"getTransaction",hash:hash});if(tx==null){throw new Error("report this; could not find tx or effectiveEnergyPrice")}params.effectiveEnergyPrice=tx.energyPrice}return this._wrapTransactionReceipt(params,network)}async getTransactionResult(hash){const{result}=await resolveProperties({network:this.getNetwork(),result:this.#perform({method:"getTransactionResult",hash:hash})});if(result==null){return null}return hexlify(result)}async getLogs(_filter){let filter=this._getFilter(_filter);if(isPromise(filter)){filter=await filter}const{network,params}=await resolveProperties({network:this.getNetwork(),params:this.#perform({method:"getLogs",filter:filter})});return params.map(p=>this._wrapLog(p,network))}_getProvider(networkId){assert(false,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async waitForTransaction(hash,_confirms,timeout){const confirms=_confirms!=null?_confirms:1;if(confirms===0){return this.getTransactionReceipt(hash)}return new Promise(async(resolve,reject)=>{let timer=null;const listener=async blockNumber=>{try{const receipt=await this.getTransactionReceipt(hash);if(receipt!=null){if(blockNumber-receipt.blockNumber+1>=confirms){resolve(receipt);if(timer){clearTimeout(timer);timer=null}return}}}catch(error){console.log("EEE",error)}this.once("block",listener)};if(timeout!=null){timer=setTimeout(()=>{if(timer==null){return}timer=null;this.off("block",listener);reject(makeError("timeout","TIMEOUT",{reason:"timeout"}))},timeout)}listener(await this.getBlockNumber())})}async waitForBlock(blockTag){assert(false,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(timerId){const timer=this.#timers.get(timerId);if(!timer){return}if(timer.timer){clearTimeout(timer.timer)}this.#timers.delete(timerId)}_setTimeout(_func,timeout){if(timeout==null){timeout=0}const timerId=this.#nextTimer++;const func=()=>{this.#timers.delete(timerId);_func()};if(this.paused){this.#timers.set(timerId,{timer:null,func:func,time:timeout})}else{const timer=setTimeout(func,timeout);this.#timers.set(timerId,{timer:timer,func:func,time:getTime$1()})}return timerId}_forEachSubscriber(func){for(const sub of this.#subs.values()){func(sub.subscriber)}}_getSubscriber(sub){switch(sub.type){case"debug":case"error":case"network":return new UnmanagedSubscriber(sub.type);case"block":return new PollingBlockSubscriber(this);case"event":return new PollingEventSubscriber(this,sub.filter);case"transaction":return new PollingTransactionSubscriber(this,sub.hash);case"orphan":return new PollingOrphanSubscriber(this,sub.filter)}throw new Error(`unsupported event: ${sub.type}`)}_recoverSubscriber(oldSub,newSub){for(const sub of this.#subs.values()){if(sub.subscriber===oldSub){if(sub.started){sub.subscriber.stop()}sub.subscriber=newSub;if(sub.started){newSub.start()}if(this.#pausedState!=null){newSub.pause(this.#pausedState)}break}}}async#hasSub(event,emitArgs){let sub=await getSubscription(event);if(sub.type==="event"&&emitArgs&&emitArgs.length>0&&emitArgs[0].removed===true){sub=await getSubscription({orphan:"drop-log",log:emitArgs[0]})}return this.#subs.get(sub.tag)||null}async#getSub(event){const subscription=await getSubscription(event);const tag=subscription.tag;let sub=this.#subs.get(tag);if(!sub){const subscriber=this._getSubscriber(subscription);const addressableMap=new WeakMap;const nameMap=new Map;sub={subscriber:subscriber,tag:tag,addressableMap:addressableMap,nameMap:nameMap,started:false,listeners:[]};this.#subs.set(tag,sub)}return sub}async on(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:false});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async once(event,listener){const sub=await this.#getSub(event);sub.listeners.push({listener:listener,once:true});if(!sub.started){sub.subscriber.start();sub.started=true;if(this.#pausedState!=null){sub.subscriber.pause(this.#pausedState)}}return this}async emit(event,...args){const sub=await this.#hasSub(event,args);if(!sub||sub.listeners.length===0){return false}const count=sub.listeners.length;sub.listeners=sub.listeners.filter(({listener,once})=>{const payload=new EventPayload(this,once?null:listener,event);try{listener.call(this,...args,payload)}catch(error){}return!once});if(sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return count>0}async listenerCount(event){if(event){const sub=await this.#hasSub(event);if(!sub){return 0}return sub.listeners.length}let total=0;for(const{listeners}of this.#subs.values()){total+=listeners.length}return total}async listeners(event){if(event){const sub=await this.#hasSub(event);if(!sub){return[]}return sub.listeners.map(({listener})=>listener)}let result=[];for(const{listeners}of this.#subs.values()){result=result.concat(listeners.map(({listener})=>listener))}return result}async off(event,listener){const sub=await this.#hasSub(event);if(!sub){return this}if(listener){const index=sub.listeners.map(({listener})=>listener).indexOf(listener);if(index>=0){sub.listeners.splice(index,1)}}if(!listener||sub.listeners.length===0){if(sub.started){sub.subscriber.stop()}this.#subs.delete(sub.tag)}return this}async removeAllListeners(event){if(event){const{tag,started,subscriber}=await this.#getSub(event);if(started){subscriber.stop()}this.#subs.delete(tag)}else{for(const[tag,{started,subscriber}]of this.#subs){if(started){subscriber.stop()}this.#subs.delete(tag)}}return this}async addListener(event,listener){return await this.on(event,listener)}async removeListener(event,listener){return this.off(event,listener)}destroy(){this.removeAllListeners();for(const timerId of this.#timers.keys()){this._clearTimeout(timerId)}}get paused(){return this.#pausedState!=null}set paused(pause){if(!!pause===this.paused){return}if(this.paused){this.resume()}else{this.pause(false)}}pause(dropWhilePaused){this.#lastBlockNumber=-1;if(this.#pausedState!=null){if(this.#pausedState==!!dropWhilePaused){return}assert(false,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(s=>s.pause(dropWhilePaused));this.#pausedState=!!dropWhilePaused;for(const timer of this.#timers.values()){if(timer.timer){clearTimeout(timer.timer)}timer.time=getTime$1()-timer.time}}resume(){if(this.#pausedState==null){return}this._forEachSubscriber(s=>s.resume());this.#pausedState=null;for(const timer of this.#timers.values()){let timeout=timer.time;if(timeout<0){timeout=0}timer.time=getTime$1();setTimeout(timer.func,timeout)}}}function _parseString(result,start){try{const bytes=_parseBytes(result,start);if(bytes){return toUtf8String(bytes)}}catch(error){}return null}function _parseBytes(result,start){if(result==="0x"){return null}try{const offset=getNumber(dataSlice(result,start,start+32));const length=getNumber(dataSlice(result,offset,offset+32));return dataSlice(result,offset+32,offset+32+length)}catch(error){}return null}function numPad(value){const result=toBeArray(value);if(result.length>32){throw new Error("internal; should not happen")}const padded=new Uint8Array(32);padded.set(result,32-result.length);return padded}function bytesPad(value){if(value.length%32===0){return value}const result=new Uint8Array(Math.ceil(value.length/32)*32);result.set(value);return result}const empty=new Uint8Array([]);function encodeBytes(datas){const result=[];let byteCount=0;for(let i=0;i=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const sender=dataSlice(data,0,32);assert(dataSlice(sender,0,12)===dataSlice(zeros,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"});result.sender=dataSlice(sender,12);try{const urls=[];const urlsOffset=getNumber(dataSlice(data,32,64));const urlsLength=getNumber(dataSlice(data,urlsOffset,urlsOffset+32));const urlsData=dataSlice(data,urlsOffset+32);for(let u=0;uresult[k]);return result}function checkProvider(signer,operation){if(signer.provider){return signer.provider}assert(false,"missing provider","UNSUPPORTED_OPERATION",{operation:operation})}async function populate(signer,tx){let pop=copyRequest(tx);if(pop.to!=null){pop.to=resolveAddress(pop.to)}if(pop.from!=null){const from=pop.from;pop.from=Promise.all([signer.getAddress(),resolveAddress(from)]).then(([address,from])=>{assertArgument(address.toLowerCase()===from.toLowerCase(),"transaction from mismatch","tx.from",from);return address})}else{pop.from=signer.getAddress()}return await resolveProperties(pop)}class AbstractSigner{provider;constructor(provider){defineProperties(this,{provider:provider||null})}async getNonce(blockTag){return checkProvider(this,"getTransactionCount").getTransactionCount(await this.getAddress(),blockTag)}async populateCall(tx){const pop=await populate(this,tx);return pop}async populateTransaction(tx){const provider=checkProvider(this,"populateTransaction");const pop=await populate(this,tx);if(pop.nonce==null){pop.nonce=await this.getNonce("pending")}if(pop.energyLimit==null){pop.energyLimit=await this.estimateEnergy(pop)}const network=await this.provider.getNetwork();if(pop.networkId!=null){const networkId=getBigInt(pop.networkId);assertArgument(networkId===network.networkId,"transaction networkId mismatch","tx.networkId",tx.networkId)}else{pop.networkId=network.networkId}const feeData=await provider.getFeeData();if(feeData.energyPrice!=null){if(pop.energyPrice==null){pop.energyPrice=feeData.energyPrice}}else{assert(false,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"})}return await resolveProperties(pop)}async estimateEnergy(tx){return checkProvider(this,"estimateEnergy").estimateEnergy(await this.populateCall(tx))}async call(tx){return checkProvider(this,"call").call(await this.populateCall(tx))}async resolveName(name){return getAddress(name)}async sendTransaction(tx){const provider=checkProvider(this,"sendTransaction");const pop=await this.populateTransaction(tx);delete pop.from;const txObj=Transaction.from(pop);return await provider.broadcastTransaction(await this.signTransaction(txObj))}}class VoidSigner extends AbstractSigner{address;constructor(address,provider){super(provider);defineProperties(this,{address:address})}async getAddress(){return this.address}connect(provider){return new VoidSigner(this.address,provider)}#throwUnsupported(suffix,operation){assert(false,`VoidSigner cannot sign ${suffix}`,"UNSUPPORTED_OPERATION",{operation:operation})}async signTransaction(tx){this.#throwUnsupported("transactions","signTransaction")}async signMessage(message){this.#throwUnsupported("messages","signMessage")}async signTypedData(domain,types,value){this.#throwUnsupported("typed-data","signTypedData")}}const shown=new Set;function showThrottleMessage(service){if(shown.has(service)){return}shown.add(service);console.log("========= NOTICE =========");console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);console.log("");console.log("The default API keys for each service are provided as a highly-throttled,");console.log("community resource for low-traffic projects and early prototyping.");console.log("");console.log("While your application will continue to function, we highly recommended");console.log("signing up for your own API keys to improve performance, increase your");console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");console.log("")}function copy(obj){return JSON.parse(JSON.stringify(obj))}class FilterIdSubscriber{#provider;#filterIdPromise;#poller;#running;#network;#hault;constructor(provider){this.#provider=provider;this.#filterIdPromise=null;this.#poller=this.#poll.bind(this);this.#running=false;this.#network=null;this.#hault=false}_subscribe(provider){throw new Error("subclasses must override this")}_emitResults(provider,result){throw new Error("subclasses must override this")}_recover(provider){throw new Error("subclasses must override this")}async#poll(blockNumber){try{if(this.#filterIdPromise==null){this.#filterIdPromise=this._subscribe(this.#provider)}let filterId=null;try{filterId=await this.#filterIdPromise}catch(error){if(!isError(error,"UNSUPPORTED_OPERATION")||error.operation!=="xcb_newFilter"){throw error}}if(filterId==null){this.#filterIdPromise=null;this.#provider._recoverSubscriber(this,this._recover(this.#provider));return}const network=await this.#provider.getNetwork();if(!this.#network){this.#network=network}if(this.#network.networkId!==network.networkId){throw new Error("chaid changed")}if(this.#hault){return}const result=await this.#provider.send("xcb_getFilterChanges",[filterId]);await this._emitResults(this.#provider,result)}catch(error){console.log("@TODO",error)}this.#provider.once("block",this.#poller)}#teardown(){const filterIdPromise=this.#filterIdPromise;if(filterIdPromise){this.#filterIdPromise=null;filterIdPromise.then(filterId=>{this.#provider.send("xcb_uninstallFilter",[filterId])})}}start(){if(this.#running){return}this.#running=true;this.#poll(-2)}stop(){if(!this.#running){return}this.#running=false;this.#hault=true;this.#teardown();this.#provider.off("block",this.#poller)}pause(dropWhilePaused){if(dropWhilePaused){this.#teardown()}this.#provider.off("block",this.#poller)}resume(){this.start()}}class FilterIdEventSubscriber extends FilterIdSubscriber{#event;constructor(provider,filter){super(provider);this.#event=copy(filter)}_recover(provider){return new PollingEventSubscriber(provider,this.#event)}async _subscribe(provider){const filterId=await provider.send("xcb_newFilter",[this.#event]);return filterId}async _emitResults(provider,results){for(const result of results){provider.emit(this.#event,provider._wrapLog(result,provider._network))}}}class FilterIdPendingSubscriber extends FilterIdSubscriber{async _subscribe(provider){return await provider.send("xcb_newPendingTransactionFilter",[])}async _emitResults(provider,results){for(const result of results){provider.emit("pending",result)}}}const Primitive="bigint,boolean,function,number,string,symbol".split(/,/g);function deepCopy(value){if(value==null||Primitive.indexOf(typeof value)>=0){return value}if(typeof value.getAddress==="function"){return value}if(Array.isArray(value)){return value.map(deepCopy)}if(typeof value==="object"){return Object.keys(value).reduce((accum,key)=>{accum[key]=value[key];return accum},{})}throw new Error(`should not happen: ${value} (${typeof value})`)}function stall$3(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getLowerCase(value){if(value){return value.toLowerCase()}return value}function isPollable(value){return value&&typeof value.pollingInterval==="number"}const defaultOptions={polling:false,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100};class JsonRpcSigner extends AbstractSigner{address;constructor(provider,address){super(provider);address=getAddress(address);defineProperties(this,{address:address})}connect(provider){assert(false,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(tx){return await this.populateCall(tx)}async sendUncheckedTransaction(_tx){const tx=deepCopy(_tx);const promises=[];if(tx.from){const _from=tx.from;promises.push((async()=>{const from=await resolveAddress(_from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from})())}else{tx.from=this.address}if(tx.energyLimit==null){promises.push((async()=>{tx.energyLimit=await this.provider.estimateEnergy({...tx,from:this.address})})())}if(tx.to!=null){const _to=tx.to;promises.push((async()=>{tx.to=await resolveAddress(_to)})())}if(promises.length){await Promise.all(promises)}const hexTx=this.provider.getRpcTransaction(tx);return this.provider.send("xcb_sendTransaction",[hexTx])}async sendTransaction(tx){const blockNumber=await this.provider.getBlockNumber();const hash=await this.sendUncheckedTransaction(tx);return await new Promise((resolve,reject)=>{const timeouts=[1e3,100];const checkTx=async()=>{const tx=await this.provider.getTransaction(hash);if(tx!=null){resolve(tx.replaceableTransaction(blockNumber));return}this.provider._setTimeout(()=>{checkTx()},timeouts.pop()||4e3)};checkTx()})}async signTransaction(_tx){const tx=deepCopy(_tx);if(tx.from){const from=await resolveAddress(tx.from);assertArgument(from!=null&&from.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",_tx);tx.from=from}else{tx.from=this.address}const hexTx=this.provider.getRpcTransaction(tx);return await this.provider.send("xcb_signTransaction",[hexTx])}async signMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("personal_sign",[hexlify(message),this.address.toLowerCase()])}async signTypedData(domain,types,_value){const value=deepCopy(_value);const populated=await TypedDataEncoder.resolveNames(domain,types,value,async value=>{const address=await resolveAddress(value);assertArgument(address!=null,"TypedData does not support null address","value",value);return address});return await this.provider.send("xcb_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(TypedDataEncoder.getPayload(populated.domain,types,populated.value))])}async unlock(password){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),password,null])}async _legacySignMessage(_message){const message=typeof _message==="string"?toUtf8Bytes(_message):_message;return await this.provider.send("xcb_sign",[this.address.toLowerCase(),hexlify(message)])}}class JsonRpcApiProvider extends AbstractProvider{#options;#nextId;#payloads;#drainTimer;#notReady;#network;#scheduleDrain(){if(this.#drainTimer){return}const stallTime=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#drainTimer=setTimeout(()=>{this.#drainTimer=null;const payloads=this.#payloads;this.#payloads=[];while(payloads.length){const batch=[payloads.shift()];while(payloads.length){if(batch.length===this.#options.batchMaxCount){break}batch.push(payloads.shift());const bytes=JSON.stringify(batch.map(p=>p.payload));if(bytes.length>this.#options.batchMaxSize){payloads.unshift(batch.pop());break}}(async()=>{const payload=batch.length===1?batch[0].payload:batch.map(p=>p.payload);this.emit("debug",{action:"sendRpcPayload",payload:payload});try{const result=await this._send(payload);this.emit("debug",{action:"receiveRpcResult",result:result});for(const{resolve,reject,payload}of batch){const resp=result.filter(r=>r.id===payload.id)[0];if(resp==null){return reject(makeError("no response from server","BAD_DATA",{value:result,info:{payload:payload}}))}if("error"in resp){return reject(this.getRpcError(payload,resp))}resolve(resp.result)}}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});for(const{reject}of batch){reject(error)}}})()}},stallTime)}constructor(network,options){super(network);this.#nextId=1;this.#options=Object.assign({},defaultOptions,options||{});this.#payloads=[];this.#drainTimer=null;this.#network=null;{let resolve=null;const promise=new Promise(_resolve=>{resolve=_resolve});this.#notReady={promise:promise,resolve:resolve}}const staticNetwork=this._getOption("staticNetwork");if(staticNetwork){assertArgument(network==null||staticNetwork.matches(network),"staticNetwork MUST match network object","options",options);this.#network=staticNetwork}}_getOption(key){return this.#options[key]}get _network(){assert(this.#network,"network is not available yet","NETWORK_ERROR");return this.#network}async _perform(req){const request=this.getRpcRequest(req);if(request!=null){return await this.send(request.method,request.args)}return super._perform(req)}async _detectNetwork(){const network=this._getOption("staticNetwork");if(network){return network}if(this.ready){return Network.from(getBigInt(await this.send("xcb_networkId",[])))}const payload={id:this.#nextId++,method:"xcb_networkId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:payload});let result;try{result=(await this._send(payload))[0]}catch(error){this.emit("debug",{action:"receiveRpcError",error:error});throw error}this.emit("debug",{action:"receiveRpcResult",result:result});if("result"in result){return Network.from(getBigInt(result.result))}throw this.getRpcError(payload,result)}_start(){if(this.#notReady==null||this.#notReady.resolve==null){return}this.#notReady.resolve();this.#notReady=null;(async()=>{while(this.#network==null){try{this.#network=await this._detectNetwork()}catch(error){console.log("JsonRpcProvider failed to startup; retry in 1s");await stall$3(1e3)}}this.#scheduleDrain()})()}async _waitUntilReady(){if(this.#notReady==null){return}return await this.#notReady.promise}_getSubscriber(sub){if(sub.type==="pending"){return new FilterIdPendingSubscriber(this)}if(sub.type==="event"){if(this._getOption("polling")){return new PollingEventSubscriber(this,sub.filter)}return new FilterIdEventSubscriber(this,sub.filter)}if(sub.type==="orphan"&&sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("orphan")}return super._getSubscriber(sub)}get ready(){return this.#notReady==null}getRpcTransaction(tx){const result={};["networkId","energyLimit","energyPrice","type","nonce","value"].forEach(key=>{if(tx[key]==null){return}let dstKey=key;if(key==="energyLimit"){dstKey="energy"}result[dstKey]=toQuantity(getBigInt(tx[key],`tx.${key}`))});["from","to","data"].forEach(key=>{if(tx[key]==null){return}result[key]=hexlify(tx[key])});return result}getRpcRequest(req){switch(req.method){case"networkId":return{method:"xcb_networkId",args:[]};case"getBlockNumber":return{method:"xcb_blockNumber",args:[]};case"getEnergyPrice":return{method:"xcb_energyPrice",args:[]};case"getBalance":{return{method:"xcb_getBalance",args:[getLowerCase(req.address),req.blockTag]}}case"getTransactionCount":return{method:"xcb_getTransactionCount",args:[getLowerCase(req.address),req.blockTag]};case"getCode":return{method:"xcb_getCode",args:[getLowerCase(req.address),req.blockTag]};case"getStorage":return{method:"xcb_getStorageAt",args:[getLowerCase(req.address),"0x"+req.position.toString(16),req.blockTag]};case"broadcastTransaction":return{method:"xcb_sendRawTransaction",args:[req.signedTransaction]};case"getBlock":if("blockTag"in req){return{method:"xcb_getBlockByNumber",args:[req.blockTag,!!req.includeTransactions]}}else if("blockHash"in req){return{method:"xcb_getBlockByHash",args:[req.blockHash,!!req.includeTransactions]}}break;case"getTransaction":return{method:"xcb_getTransactionByHash",args:[req.hash]};case"getTransactionReceipt":return{method:"xcb_getTransactionReceipt",args:[req.hash]};case"call":return{method:"xcb_call",args:[this.getRpcTransaction(req.transaction),req.blockTag]};case"estimateEnergy":{return{method:"xcb_estimateEnergy",args:[this.getRpcTransaction(req.transaction)]}}case"getLogs":if(req.filter&&req.filter.address!=null){if(Array.isArray(req.filter.address)){req.filter.address=req.filter.address.map(getLowerCase)}else{req.filter.address=getLowerCase(req.filter.address)}}return{method:"xcb_getLogs",args:[req.filter]}}return null}getRpcError(payload,_error){const{method}=payload;const{error}=_error;if(method==="xcb_estimateEnergy"&&error.message){const msg=error.message;if(!msg.match(/revert/i)&&msg.match(/insufficient funds/i)){return makeError("insufficient funds","INSUFFICIENT_FUNDS",{transaction:payload.params[0],info:{payload:payload,error:error}})}}if(method==="xcb_call"||method==="xcb_estimateEnergy"){const result=spelunkData(error);const e=AbiCoder.getBuiltinCallException(method==="xcb_call"?"call":"estimateEnergy",payload.params[0],result?result.data:null);e.info={error:error,payload:payload};return e}const message=JSON.stringify(spelunkMessage(error));if(typeof error.message==="string"&&error.message.match(/user denied|corebc-user-denied/i)){const actionMap={xcb_sign:"signMessage",personal_sign:"signMessage",xcb_signTypedData_v4:"signTypedData",xcb_signTransaction:"signTransaction",xcb_sendTransaction:"sendTransaction",xcb_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return makeError(`user rejected action`,"ACTION_REJECTED",{action:actionMap[method]||"unknown",reason:"rejected",info:{payload:payload,error:error}})}if(method==="xcb_sendRawTransaction"||method==="xcb_sendTransaction"){const transaction=payload.params[0];if(message.match(/insufficient funds|base fee exceeds energy limit/i)){return makeError("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:transaction,info:{error:error}})}if(message.match(/nonce/i)&&message.match(/too low/i)){return makeError("nonce has already been used","NONCE_EXPIRED",{transaction:transaction,info:{error:error}})}if(message.match(/replacement transaction/i)&&message.match(/underpriced/i)){return makeError("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:transaction,info:{error:error}})}if(message.match(/only replay-protected/i)){return makeError("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:method,info:{transaction:transaction,info:{error:error}}})}}if(message.match(/the method .* does not exist/i)){return makeError("unsupported operation","UNSUPPORTED_OPERATION",{operation:payload.method,info:{error:error}})}return makeError("could not coalesce error","UNKNOWN_ERROR",{error:error})}send(method,params){const id=this.#nextId++;const promise=new Promise((resolve,reject)=>{this.#payloads.push({resolve:resolve,reject:reject,payload:{method:method,params:params,id:id,jsonrpc:"2.0"}})});this.#scheduleDrain();return promise}async getSigner(address){if(address==null){address=0}const accountsPromise=this.send("xcb_accounts",[]);if(typeof address==="number"){const accounts=await accountsPromise;if(address>=accounts.length){throw new Error("no such account")}return new JsonRpcSigner(this,accounts[address])}const{accounts}=await resolveProperties({network:this.getNetwork(),accounts:accountsPromise});address=getAddress(address);for(const account of accounts){if(getAddress(account)===address){return new JsonRpcSigner(this,address)}}throw new Error("invalid account")}async listAccounts(){const accounts=await this.send("xcb_accounts",[]);return accounts.map(a=>new JsonRpcSigner(this,a))}}class JsonRpcApiPollingProvider extends JsonRpcApiProvider{#pollingInterval;constructor(network,options){super(network,options);this.#pollingInterval=4e3}_getSubscriber(sub){const subscriber=super._getSubscriber(sub);if(isPollable(subscriber)){subscriber.pollingInterval=this.#pollingInterval}return subscriber}get pollingInterval(){return this.#pollingInterval}set pollingInterval(value){if(!Number.isInteger(value)||value<0){throw new Error("invalid interval")}this.#pollingInterval=value;this._forEachSubscriber(sub=>{if(isPollable(sub)){sub.pollingInterval=this.#pollingInterval}})}}class JsonRpcProvider extends JsonRpcApiPollingProvider{#connect;constructor(url,network,options){if(url==null){url="http://localhost:8545"}super(network,options);if(typeof url==="string"){this.#connect=new FetchRequest(url)}else{this.#connect=url.clone()}}_getConnection(){return this.#connect.clone()}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){const request=this._getConnection();request.body=JSON.stringify(payload);request.setHeader("content-type","application/json");const response=await request.send();response.assertOk();let resp=response.bodyJson;if(!Array.isArray(resp)){resp=[resp]}return resp}}function spelunkData(value){if(value==null){return null}if(typeof value.message==="string"&&value.message.match("reverted")&&isHexString(value.data)){return{message:value.message,data:value.data}}if(typeof value==="object"){for(const key in value){const result=spelunkData(value[key]);if(result){return result}}return null}if(typeof value==="string"){try{return spelunkData(JSON.parse(value))}catch(error){}}return null}function _spelunkMessage(value,result){if(value==null){return}if(typeof value.message==="string"){result.push(value.message)}if(typeof value==="object"){for(const key in value){_spelunkMessage(value[key],result)}}if(typeof value==="string"){try{return _spelunkMessage(JSON.parse(value),result)}catch(error){}}}function spelunkMessage(value){const result=[];_spelunkMessage(value,result);return result}const defaultApiKey$1="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function getHost$4(name){switch(name){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/xcb_goerli";case"matic":return"rpc.ankr.com/polygon";case"arbitrum":return"rpc.ankr.com/arbitrum"}assertArgument(false,"unsupported network","network",name)}class AnkrProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey$1}const options={polling:true,staticNetwork:network};const request=AnkrProvider.getRequest(network,apiKey);super(request,network,options);defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AnkrProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey$1}const request=new FetchRequest(`https:/\/${getHost$4(network.name)}/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey$1){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("AnkrProvider");return true}}return request}getRpcError(payload,error){if(payload.method==="xcb_sendRawTransaction"){if(error&&error.error&&error.error.message==="INTERNAL_ERROR: could not replace existing tx"){error.error.message="replacement transaction underpriced"}}return super.getRpcError(payload,error)}isCommunityResource(){return this.apiKey===defaultApiKey$1}}const defaultApiKey="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function getHost$3(name){switch(name){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com"}assertArgument(false,"unsupported network","network",name)}class AlchemyProvider extends JsonRpcProvider{apiKey;constructor(_network,apiKey){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(apiKey==null){apiKey=defaultApiKey}const request=AlchemyProvider.getRequest(network,apiKey);super(request,network,{staticNetwork:network});defineProperties(this,{apiKey:apiKey})}_getProvider(networkId){try{return new AlchemyProvider(networkId,this.apiKey)}catch(error){}return super._getProvider(networkId)}async _perform(req){if(req.method==="getTransactionResult"){const{trace,tx}=await resolveProperties({trace:this.send("trace_transaction",[req.hash]),tx:this.getTransaction(req.hash)});if(trace==null||tx==null){return null}let data;let error=false;try{data=trace[0].result.output;error=trace[0].error==="Reverted"}catch(error){}if(data){assert(!error,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:data,reason:null,transaction:tx,invocation:null,revert:null});return data}assert(false,"could not parse trace result","BAD_DATA",{value:trace})}return await super._perform(req)}isCommunityResource(){return this.apiKey===defaultApiKey}static getRequest(network,apiKey){if(apiKey==null){apiKey=defaultApiKey}const request=new FetchRequest(`https:/\/${getHost$3(network.name)}/v2/${apiKey}`);request.allowGzip=true;if(apiKey===defaultApiKey){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("alchemy");return true}}return request}}class CloudflareProvider extends JsonRpcProvider{constructor(_network){if(_network==null){_network="mainnet"}const network=Network.from(_network);assertArgument(network.name==="mainnet","unsupported network","network",_network);super("https://cloudflare-eth.com/",network,{staticNetwork:network})}}function getGlobal(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const _WebSocket=getGlobal().WebSocket;class SocketSubscriber{#provider;#filter;get filter(){return JSON.parse(this.#filter)}#filterId;#paused;#emitPromise;constructor(provider,filter){this.#provider=provider;this.#filter=JSON.stringify(filter);this.#filterId=null;this.#paused=null;this.#emitPromise=null}start(){this.#filterId=this.#provider.send("xcb_subscribe",this.filter).then(filterId=>{this.#provider._register(filterId,this);return filterId})}stop(){this.#filterId.then(filterId=>{this.#provider.send("xcb_unsubscribe",[filterId])});this.#filterId=null}pause(dropWhilePaused){assert(dropWhilePaused,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"});this.#paused=!!dropWhilePaused}resume(){this.#paused=null}_handleMessage(message){if(this.#filterId==null){return}if(this.#paused===null){let emitPromise=this.#emitPromise;if(emitPromise==null){emitPromise=this._emit(this.#provider,message)}else{emitPromise=emitPromise.then(async()=>{await this._emit(this.#provider,message)})}this.#emitPromise=emitPromise.then(()=>{if(this.#emitPromise===emitPromise){this.#emitPromise=null}})}}async _emit(provider,message){throw new Error("sub-classes must implemente this; _emit")}}class SocketBlockSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newHeads"])}async _emit(provider,message){provider.emit("block",parseInt(message.number))}}class SocketPendingSubscriber extends SocketSubscriber{constructor(provider){super(provider,["newPendingTransactions"])}async _emit(provider,message){provider.emit("pending",message)}}class SocketEventSubscriber extends SocketSubscriber{#logFilter;get logFilter(){return JSON.parse(this.#logFilter)}constructor(provider,filter){super(provider,["logs",filter]);this.#logFilter=JSON.stringify(filter)}async _emit(provider,message){provider.emit(this.logFilter,provider._wrapLog(message,provider._network))}}class SocketProvider extends JsonRpcApiProvider{#callbacks;#subs;#pending;constructor(network){super(network,{batchMaxCount:1});this.#callbacks=new Map;this.#subs=new Map;this.#pending=new Map}_getSubscriber(sub){switch(sub.type){case"close":return new UnmanagedSubscriber("close");case"block":return new SocketBlockSubscriber(this);case"pending":return new SocketPendingSubscriber(this);case"event":return new SocketEventSubscriber(this,sub.filter);case"orphan":if(sub.filter.orphan==="drop-log"){return new UnmanagedSubscriber("drop-log")}}return super._getSubscriber(sub)}_register(filterId,subscriber){this.#subs.set(filterId,subscriber);const pending=this.#pending.get(filterId);if(pending){for(const message of pending){subscriber._handleMessage(message)}this.#pending.delete(filterId)}}async _send(payload){assertArgument(!Array.isArray(payload),"WebSocket does not support batch send","payload",payload);const promise=new Promise((resolve,reject)=>{this.#callbacks.set(payload.id,{payload:payload,resolve:resolve,reject:reject})});await this._waitUntilReady();await this._write(JSON.stringify(payload));return[await promise]}async _processMessage(message){const result=JSON.parse(message);if("id"in result){const callback=this.#callbacks.get(result.id);if(callback==null){this.emit("error",makeError("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:result}));return}this.#callbacks.delete(result.id);callback.resolve(result)}else if(result.method==="xcb_subscription"){const filterId=result.params.subscription;const subscriber=this.#subs.get(filterId);if(subscriber){subscriber._handleMessage(result.params.result)}else{let pending=this.#pending.get(filterId);if(pending==null){pending=[];this.#pending.set(filterId,pending)}pending.push(result.params.result)}}}async _write(message){throw new Error("sub-classes must override this")}}class WebSocketProvider extends SocketProvider{#connect;#websocket;get websocket(){if(this.#websocket==null){throw new Error("websocket closed")}return this.#websocket}constructor(url,network){super(network);if(typeof url==="string"){this.#connect=()=>{return new _WebSocket(url)};this.#websocket=this.#connect()}else if(typeof url==="function"){this.#connect=url;this.#websocket=url()}else{this.#connect=null;this.#websocket=url}this.websocket.onopen=async()=>{try{await this._start();this.resume()}catch(error){console.log("failed to start WebsocketProvider",error)}};this.websocket.onmessage=message=>{this._processMessage(message.data)}}async _write(message){this.websocket.send(message)}async destroy(){if(this.#websocket!=null){this.#websocket.close();this.#websocket=null}super.destroy()}}const defaultProjectId="84842078b09946638c03157f83405213";function getHost$2(name){switch(name){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io"}assertArgument(false,"unsupported network","network",name)}class InfuraWebSocketProvider extends WebSocketProvider{projectId;projectSecret;constructor(network,projectId){const provider=new InfuraProvider(network,projectId);const req=provider._getConnection();assert(!req.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});const url=req.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(url,network);defineProperties(this,{projectId:provider.projectId,projectSecret:provider.projectSecret})}isCommunityResource(){return this.projectId===defaultProjectId}}class InfuraProvider extends JsonRpcProvider{projectId;projectSecret;constructor(_network,projectId,projectSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=InfuraProvider.getRequest(network,projectId,projectSecret);super(request,network,{staticNetwork:network});defineProperties(this,{projectId:projectId,projectSecret:projectSecret})}_getProvider(networkId){try{return new InfuraProvider(networkId,this.projectId,this.projectSecret)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.projectId===defaultProjectId}static getWebSocketProvider(network,projectId){return new InfuraWebSocketProvider(network,projectId)}static getRequest(network,projectId,projectSecret){if(projectId==null){projectId=defaultProjectId}if(projectSecret==null){projectSecret=null}const request=new FetchRequest(`https:/\/${getHost$2(network.name)}/v3/${projectId}`);request.allowGzip=true;if(projectSecret){request.setCredentials("",projectSecret)}if(projectId===defaultProjectId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("InfuraProvider");return true}}return request}}const defaultToken="919b412a057b5e9c9b6dce193c5a60242d6efadb";function getHost$1(name){switch(name){case"mainnet":return"corebc.quiknode.pro";case"arbitrum":return"corebc.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"corebc.arbitrum-goerli.quiknode.pro";case"matic":return"corebc.matic.quiknode.pro";case"matic-mumbai":return"corebc.matic-testnet.quiknode.pro";case"optimism":return"corebc.optimism.quiknode.pro";case"optimism-goerli":return"corebc.optimism-goerli.quiknode.pro"}assertArgument(false,"unsupported network","network",name)}class QuickNodeProvider extends JsonRpcProvider{token;constructor(_network,token){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(token==null){token=defaultToken}const request=QuickNodeProvider.getRequest(network,token);super(request,network,{staticNetwork:network});defineProperties(this,{token:token})}_getProvider(networkId){try{return new QuickNodeProvider(networkId,this.token)}catch(error){}return super._getProvider(networkId)}isCommunityResource(){return this.token===defaultToken}static getRequest(network,token){if(token==null){token=defaultToken}const request=new FetchRequest(`https:/\/${getHost$1(network.name)}/${token}`);request.allowGzip=true;if(token===defaultToken){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("QuickNodeProvider");return true}}return request}}const BN_1=BigInt("1");const BN_2=BigInt("2");function shuffle(array){for(let i=array.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));const tmp=array[i];array[i]=array[j];array[j]=tmp}}function stall$2(duration){return new Promise(resolve=>{setTimeout(resolve,duration)})}function getTime(){return(new Date).getTime()}function stringify(value){return JSON.stringify(value,(key,value)=>{if(typeof value==="bigint"){return{type:"bigint",value:value.toString()}}return value})}const defaultConfig={stallTimeout:400,priority:1,weight:1};const defaultState={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0};async function waitForSync(config,blockNumber){while(config.blockNumber<0||config.blockNumber{const blockNumber=await config.provider.getBlockNumber();if(blockNumber>config.blockNumber){config.blockNumber=blockNumber}config._updateNumber=null})()}await config._updateNumber;config.outOfSync++}}function _normalize(value){if(value==null){return"null"}if(Array.isArray(value)){return"["+value.map(_normalize).join(",")+"]"}if(typeof value==="object"&&typeof value.toJSON==="function"){return _normalize(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":case"number":return BigInt(value).toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{"+keys.map(k=>`${JSON.stringify(k)}:${_normalize(value[k])}`).join(",")+"}"}}console.log("Could not serialize",value);throw new Error("Hmm...")}function normalizeResult(value){if("error"in value){const error=value.error;return{tag:_normalize(error),value:error}}const result=value.result;return{tag:_normalize(result),value:result}}function checkQuorum(quorum,results){const tally=new Map;for(const{value,tag,weight}of results){const t=tally.get(tag)||{value:value,weight:0};t.weight+=weight;tally.set(tag,t)}let best=null;for(const r of tally.values()){if(r.weight>=quorum&&(!best||r.weight>best.weight)){best=r}}if(best){return best.value}return undefined}function getMedian(quorum,results){let resultWeight=0;const errorMap=new Map;let bestError=null;const values=[];for(const{value,tag,weight}of results){if(value instanceof Error){const e=errorMap.get(tag)||{value:value,weight:0};e.weight+=weight;errorMap.set(tag,e);if(bestError==null||e.weight>bestError.weight){bestError=e}}else{values.push(BigInt(value));resultWeight+=weight}}if(resultWeight=quorum){return bestError.value}return undefined}values.sort((a,b)=>aa?1:0);const mid=Math.floor(values.length/2);if(values.length%2){return values[mid]}return(values[mid-1]+values[mid]+BN_1)/BN_2}function getAnyResult(quorum,results){const result=checkQuorum(quorum,results);if(result!==undefined){return result}for(const r of results){if(r.value){return r.value}}return undefined}function getFuzzyMode(quorum,results){if(quorum===1){return getNumber(getMedian(quorum,results),"%internal")}const tally=new Map;const add=(result,weight)=>{const t=tally.get(result)||{result:result,weight:0};t.weight+=weight;tally.set(result,t)};for(const{weight,value}of results){const r=getNumber(value);add(r-1,weight);add(r,weight);add(r+1,weight)}let bestWeight=0;let bestResult=undefined;for(const{weight,result}of tally.values()){if(weight>=quorum&&(weight>bestWeight||bestResult!=null&&weight===bestWeight&&result>bestResult)){bestWeight=weight;bestResult=result}}return bestResult}class FallbackProvider extends AbstractProvider{quorum;eventQuorum;eventWorkers;#configs;#height;#initialSyncPromise;constructor(providers,network){super(network);this.#configs=providers.map(p=>{if(p instanceof AbstractProvider){return Object.assign({provider:p},defaultConfig,defaultState)}else{return Object.assign({},defaultConfig,p,defaultState)}});this.#height=-2;this.#initialSyncPromise=null;this.quorum=2;this.eventQuorum=1;this.eventWorkers=1;assertArgument(this.quorum<=this.#configs.reduce((a,c)=>a+c.weight,0),"quorum exceed provider wieght","quorum",this.quorum)}get providerConfigs(){return this.#configs.map(c=>{const result=Object.assign({},c);for(const key in result){if(key[0]==="_"){delete result[key]}}return result})}async _detectNetwork(){return Network.from(getBigInt(await this._perform({method:"networkId"})))}async _translatePerform(provider,req){switch(req.method){case"broadcastTransaction":return await provider.broadcastTransaction(req.signedTransaction);case"call":return await provider.call(Object.assign({},req.transaction,{blockTag:req.blockTag}));case"networkId":return(await provider.getNetwork()).networkId;case"estimateEnergy":return await provider.estimateEnergy(req.transaction);case"getBalance":return await provider.getBalance(req.address,req.blockTag);case"getBlock":{const block="blockHash"in req?req.blockHash:req.blockTag;return await provider.getBlock(block,req.includeTransactions)}case"getBlockNumber":return await provider.getBlockNumber();case"getCode":return await provider.getCode(req.address,req.blockTag);case"getEnergyPrice":return(await provider.getFeeData()).energyPrice;case"getLogs":return await provider.getLogs(req.filter);case"getStorage":return await provider.getStorage(req.address,req.position,req.blockTag);case"getTransaction":return await provider.getTransaction(req.hash);case"getTransactionCount":return await provider.getTransactionCount(req.address,req.blockTag);case"getTransactionReceipt":return await provider.getTransactionReceipt(req.hash);case"getTransactionResult":return await provider.getTransactionResult(req.hash)}}#getNextConfig(running){const configs=Array.from(running).map(r=>r.config);const allConfigs=this.#configs.slice();shuffle(allConfigs);allConfigs.sort((a,b)=>b.priority-a.priority);for(const config of allConfigs){if(configs.indexOf(config)===-1){return config}}return null}#addRunner(running,req){const config=this.#getNextConfig(running);if(config==null){return null}const runner={config:config,result:null,didBump:false,perform:null,staller:null};const now=getTime();runner.perform=(async()=>{try{config.requests++;const result=await this._translatePerform(config.provider,req);runner.result={result:result}}catch(error){config.errorResponses++;runner.result={error:error}}const dt=getTime()-now;config._totalTime+=dt;config.rollingDuration=.95*config.rollingDuration+.05*dt;runner.perform=null})();runner.staller=(async()=>{await stall$2(config.stallTimeout);runner.staller=null})();running.add(runner);return runner}async#initialSync(){let initialSync=this.#initialSyncPromise;if(!initialSync){const promises=[];this.#configs.forEach(config=>{promises.push(waitForSync(config,0));promises.push((async()=>{config._network=await config.provider.getNetwork()})())});this.#initialSyncPromise=initialSync=(async()=>{await Promise.all(promises);let networkId=null;for(const config of this.#configs){const network=config._network;if(networkId==null){networkId=network.networkId}else if(network.networkId!==networkId){assert(false,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}}})()}await initialSync}async#checkQuorum(running,req){const results=[];for(const runner of running){if(runner.result!=null){const{tag,value}=normalizeResult(runner.result);results.push({tag:tag,value:value,weight:runner.config.weight})}}if(results.reduce((a,r)=>a+r.weight,0)({value:c.blockNumber,tag:getNumber(c.blockNumber).toString(),weight:c.weight})))))}const mode=getFuzzyMode(this.quorum,results);if(mode===undefined){return undefined}if(mode>this.#height){this.#height=mode}return this.#height}case"getEnergyPrice":case"estimateEnergy":return getMedian(this.quorum,results);case"getBlock":if("blockTag"in req&&req.blockTag==="pending"){return getAnyResult(this.quorum,results)}return checkQuorum(this.quorum,results);case"call":case"networkId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return checkQuorum(this.quorum,results);case"broadcastTransaction":return getAnyResult(this.quorum,results)}assert(false,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${stringify(req.method)})`})}async#waitForQuorum(running,req){if(running.size===0){throw new Error("no runners?!")}const interesting=[];let newRunners=0;for(const runner of running){if(runner.perform){interesting.push(runner.perform)}if(runner.staller){interesting.push(runner.staller);continue}if(runner.didBump){continue}runner.didBump=true;newRunners++}const value=await this.#checkQuorum(running,req);if(value!==undefined){if(value instanceof Error){throw value}return value}for(let i=0;i0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:Array.from(running).map(r=>stringify(r.result))}});await Promise.race(interesting);return await this.#waitForQuorum(running,req)}async _perform(req){if(req.method==="broadcastTransaction"){const results=await Promise.all(this.#configs.map(async({provider,weight})=>{try{const result=await provider._perform(req);return Object.assign(normalizeResult({result:result}),{weight:weight})}catch(error){return Object.assign(normalizeResult({error:error}),{weight:weight})}}));const result=getAnyResult(this.quorum,results);assert(result!==undefined,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:req,results:results.map(stringify)}});if(result instanceof Error){throw result}return result}await this.#initialSync();const running=new Set;for(let i=0;i{const payload={method:method,params:params};this.emit("debug",{action:"sendEip1193Request",payload:payload});try{const result=await core.request(payload);this.emit("debug",{action:"receiveEip1193Result",result:result});return result}catch(e){const error=new Error(e.message);error.code=e.code;error.data=e.data;error.payload=payload;this.emit("debug",{action:"receiveEip1193Error",error:error});throw error}}}async send(method,params){await this._start();return await super.send(method,params)}async _send(payload){assertArgument(!Array.isArray(payload),"EIP-1193 does not support batch request","payload",payload);try{const result=await this.#request(payload.method,payload.params||[]);return[{id:payload.id,result:result}]}catch(e){return[{id:payload.id,error:{code:e.code,data:e.data,message:e.message}}]}}getRpcError(payload,error){error=JSON.parse(JSON.stringify(error));switch(error.error.code||-1){case 4001:error.error.message=`corebc-user-denied: ${error.error.message}`;break;case 4200:error.error.message=`corebc-unsupported: ${error.error.message}`;break}return super.getRpcError(payload,error)}async hasSigner(address){if(address==null){address=0}const accounts=await this.send("xcb_accounts",[]);if(typeof address==="number"){return accounts.length>address}address=address.toLowerCase();return accounts.filter(a=>a.toLowerCase()===address).length!==0}async getSigner(address){if(address==null){address=0}if(!await this.hasSigner(address)){try{await this.#request("xcb_requestAccounts",[])}catch(error){const payload=error.payload;throw this.getRpcError(payload,{id:payload.id,error:error})}}return await super.getSigner(address)}}const defaultApplicationId="62e1ad51b37b8e00394bda3b";function getHost(name){switch(name){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}assertArgument(false,"unsupported network","network",name)}class PocketProvider extends JsonRpcProvider{applicationId;applicationSecret;constructor(_network,applicationId,applicationSecret){if(_network==null){_network="mainnet"}const network=Network.from(_network);if(applicationId==null){applicationId=defaultApplicationId}if(applicationSecret==null){applicationSecret=null}const options={staticNetwork:network};const request=PocketProvider.getRequest(network,applicationId,applicationSecret);super(request,network,options);defineProperties(this,{applicationId:applicationId,applicationSecret:applicationSecret})}_getProvider(networkId){try{return new PocketProvider(networkId,this.applicationId,this.applicationSecret)}catch(error){}return super._getProvider(networkId)}static getRequest(network,applicationId,applicationSecret){if(applicationId==null){applicationId=defaultApplicationId}const request=new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`);request.allowGzip=true;if(applicationSecret){request.setCredentials("",applicationSecret)}if(applicationId===defaultApplicationId){request.retryFunc=async(request,response,attempt)=>{showThrottleMessage("PocketProvider");return true}}return request}isCommunityResource(){return this.applicationId===defaultApplicationId}}const IpcSocketProvider=undefined;class BaseWallet extends AbstractSigner{address;prefix;#signingKey;constructor({signingKey,prefix,provider}){super(provider);this.prefix=prefix;assertArgument(signingKey&&typeof signingKey.sign==="function","invalid signingKey key","signingKey","[ REDACTED ]");this.#signingKey=signingKey;const address=computeAddress(this.#signingKey,prefix);defineProperties(this,{address:address})}get signingKey(){return this.#signingKey}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(provider){return new BaseWallet({signingKey:this.#signingKey,prefix:this.prefix,provider:provider})}async signTransaction(tx){const{to,from}=await resolveProperties({to:tx.to||undefined,from:tx.from||undefined});if(to!=null){tx.to=to}if(from!=null){tx.from=from}if(tx.from!=null){assertArgument(getAddress(tx.from)===this.address,"transaction from address mismatch","tx.from",tx.from);delete tx.from}const btx=Transaction.from(tx);const unSignedSerialized=btx.unsignedSerialized;const unsignedHash=sha256(unSignedSerialized);btx.signature=this.signingKey.sign(unsignedHash);return btx.serialized}async signMessage(message){return this.signMessageSync(message)}signMessageSync(message){return this.signingKey.sign(hashMessage(message))}async signTypedData(domain,types,value){const populated=await TypedDataEncoder.resolveNames(domain,types,value,async name=>{assert(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:name}});const address=getAddress(name);assert(address!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:name});return address});return this.signingKey.sign(TypedDataEncoder.hash(populated.domain,types,populated.value))}}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}static check(wordlist){const words=[];for(let i=0;i<2048;i++){const word=wordlist.getWord(i);if(i!==wordlist.getWordIndex(word)){return"0x"}words.push(word)}return id(words.join("\n")+"\n")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n",true);if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=55296&&value<=56319&&counter65535){value-=65536;output+=stringFromCharCode(value>>>10&1023|55296);value=56320|value&1023}output+=stringFromCharCode(value)}return output}function checkScalarValue(codePoint){if(codePoint>=55296&&codePoint<=57343){throw Error("Lone surrogate U+"+codePoint.toString(16).toUpperCase()+" is not a scalar value")}}function createByte(codePoint,shift){return stringFromCharCode(codePoint>>shift&63|128)}function encodeCodePoint(codePoint){if((codePoint&4294967168)==0){return stringFromCharCode(codePoint)}var symbol="";if((codePoint&4294965248)==0){symbol=stringFromCharCode(codePoint>>6&31|192)}else if((codePoint&4294901760)==0){checkScalarValue(codePoint);symbol=stringFromCharCode(codePoint>>12&15|224);symbol+=createByte(codePoint,6)}else if((codePoint&4292870144)==0){symbol=stringFromCharCode(codePoint>>18&7|240);symbol+=createByte(codePoint,12);symbol+=createByte(codePoint,6)}symbol+=stringFromCharCode(codePoint&63|128);return symbol}function utf8encode(string){var codePoints=ucs2decode(string);var length=codePoints.length;var index=-1;var codePoint;var byteString="";while(++index=byteCount){throw Error("Invalid byte index")}var continuationByte=byteArray[byteIndex]&255;byteIndex++;if((continuationByte&192)==128){return continuationByte&63}throw Error("Invalid continuation byte")}function decodeSymbol(){var byte1;var byte2;var byte3;var byte4;var codePoint;if(byteIndex>byteCount){throw Error("Invalid byte index")}if(byteIndex==byteCount){return false}byte1=byteArray[byteIndex]&255;byteIndex++;if((byte1&128)==0){return byte1}if((byte1&224)==192){byte2=readContinuationByte();codePoint=(byte1&31)<<6|byte2;if(codePoint>=128){return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&240)==224){byte2=readContinuationByte();byte3=readContinuationByte();codePoint=(byte1&15)<<12|byte2<<6|byte3;if(codePoint>=2048){checkScalarValue(codePoint);return codePoint}else{throw Error("Invalid continuation byte")}}if((byte1&248)==240){byte2=readContinuationByte();byte3=readContinuationByte();byte4=readContinuationByte();codePoint=(byte1&7)<<18|byte2<<12|byte3<<6|byte4;if(codePoint>=65536&&codePoint<=1114111){return codePoint}}throw Error("Invalid UTF-8 detected")}var byteArray;var byteCount;var byteIndex;function utf8decode(byteString){byteArray=ucs2decode(byteString);byteCount=byteArray.length;byteIndex=0;var codePoints=[];var tmp;while((tmp=decodeSymbol())!==false){codePoints.push(tmp)}return ucs2encode(codePoints)}root.version="3.0.0";root.encode=utf8encode;root.decode=utf8decode})(exports)})(utf8$1);return utf8$1}var utf8Exports=requireUtf8();var utf8=getDefaultExportFromCjs(utf8Exports);function mnemonicToSeed(mnemonic,password){if(!password){password=""}const t=generateSeed(mnemonic,password);return t.goldilock}const generateSeed=(mnemonic,password)=>{const goldilockSaltPrefix="mnemonic";const aesSaltPrefix="mnemonicfortheAESkey";const goldilockSalt=utf8.encode(goldilockSaltPrefix+password);const aesSalt=utf8.encode(aesSaltPrefix+password);const goldilockKey=pbkdf2Sync(bufferExports.Buffer.from(mnemonic),bufferExports.Buffer.from(goldilockSalt),2048,64,"sha512");const aesKeySeed=pbkdf2Sync(bufferExports.Buffer.from(mnemonic),bufferExports.Buffer.from(aesSalt),2048,64,"sha512");return{aes:bufferExports.Buffer.from(aesKeySeed).toString("hex"),goldilock:bufferExports.Buffer.from(goldilockKey).toString("hex")}};function getUpperMask(bits){return(1<=12&&words.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");const entropy=new Uint8Array(Math.ceil(11*words.length/8));let offset=0;for(let i=0;i=0,`invalid mnemonic word at index ${i}`,"mnemonic","[ REDACTED ]");for(let bit=0;bit<11;bit++){if(index&1<<10-bit){entropy[offset>>3]|=1<<7-offset%8}offset++}}const entropyBits=32*words.length/3;const checksumBits=words.length/3;const checksumMask=getUpperMask(checksumBits);const checksum=getBytes(legacySha256(entropy.slice(0,entropyBits/8)))[0]&checksumMask;assertArgument(checksum===(entropy[entropy.length-1]&checksumMask),"invalid mnemonic checksum","mnemonic","[ REDACTED ]");return hexlify(entropy.slice(0,entropyBits/8))}function entropyToMnemonic(entropy,wordlist){assertArgument(entropy.length%4===0&&entropy.length>=16&&entropy.length<=32,"invalid entropy size","entropy","[ REDACTED ]");if(wordlist==null){wordlist=LangEn.wordlist()}const indices=[0];let remainingBits=11;for(let i=0;i8){indices[indices.length-1]<<=8;indices[indices.length-1]|=entropy[i];remainingBits-=8}else{indices[indices.length-1]<<=remainingBits;indices[indices.length-1]|=entropy[i]>>8-remainingBits;indices.push(entropy[i]&getLowerMask(8-remainingBits));remainingBits+=3}}const checksumBits=entropy.length/4;const checksum=parseInt(legacySha256(entropy).substring(2,4),16)&getUpperMask(checksumBits);indices[indices.length-1]<<=checksumBits;indices[indices.length-1]|=checksum>>8-checksumBits;return wordlist.join(indices.map(index=>wordlist.getWord(index)))}const _guard$1={};class Mnemonic{phrase;password;wordlist;entropy;constructor(guard,entropy,phrase,password,wordlist){if(password==null){password=""}if(wordlist==null){wordlist=LangEn.wordlist()}assertPrivate(guard,_guard$1,"Mnemonic");defineProperties(this,{phrase:phrase,password:password,wordlist:wordlist,entropy:entropy})}computeSeed(){return mnemonicToSeed(this.phrase,this.password)}static fromPhrase({phrase,password,wordlist}){const entropy=mnemonicToEntropy(phrase,wordlist);phrase=entropyToMnemonic(getBytes(entropy),wordlist);return new Mnemonic(_guard$1,entropy,phrase,password,wordlist)}static fromEntropy(_entropy,password,wordlist){const entropy=getBytes(_entropy,"entropy");const phrase=entropyToMnemonic(entropy,wordlist);return new Mnemonic(_guard$1,hexlify(entropy),phrase,password,wordlist)}static entropyToPhrase(_entropy,wordlist){const entropy=getBytes(_entropy,"entropy");return entropyToMnemonic(entropy,wordlist)}static phraseToEntropy(phrase,wordlist){return mnemonicToEntropy(phrase,wordlist)}static isValidMnemonic(phrase,wordlist){try{mnemonicToEntropy(phrase,wordlist);return true}catch(error){}return false}}var aesJs={exports:{}};var hasRequiredAesJs;function requireAesJs(){if(hasRequiredAesJs)return aesJs.exports;hasRequiredAesJs=1;(function(module,exports){(function(root){function checkInt(value){return parseInt(value)===value}function checkInts(arrayish){if(!checkInt(arrayish.length)){return false}for(var i=0;i255){return false}}return true}function coerceArray(arg,copy){if(arg.buffer&&arg.name==="Uint8Array"){if(copy){if(arg.slice){arg=arg.slice()}else{arg=Array.prototype.slice.call(arg)}}return arg}if(Array.isArray(arg)){if(!checkInts(arg)){throw new Error("Array contains invalid value: "+arg)}return new Uint8Array(arg)}if(checkInt(arg.length)&&checkInts(arg)){return new Uint8Array(arg)}throw new Error("unsupported array-like object")}function createArray(length){return new Uint8Array(length)}function copyArray(sourceArray,targetArray,targetStart,sourceStart,sourceEnd){if(sourceStart!=null||sourceEnd!=null){if(sourceArray.slice){sourceArray=sourceArray.slice(sourceStart,sourceEnd)}else{sourceArray=Array.prototype.slice.call(sourceArray,sourceStart,sourceEnd)}}targetArray.set(sourceArray,targetStart)}var convertUtf8=function(){function toBytes(text){var result=[],i=0;text=encodeURI(text);while(i191&&c<224){result.push(String.fromCharCode((c&31)<<6|bytes[i+1]&63));i+=2}else{result.push(String.fromCharCode((c&15)<<12|(bytes[i+1]&63)<<6|bytes[i+2]&63));i+=3}}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var convertHex=function(){function toBytes(text){var result=[];for(var i=0;i>4]+Hex[v&15])}return result.join("")}return{toBytes:toBytes,fromBytes:fromBytes}}();var numberOfRounds={16:10,24:12,32:14};var rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145];var S=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22];var Si=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];var T1=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986];var T2=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766];var T3=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126];var T4=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436];var T5=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890];var T6=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935];var T7=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600];var T8=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480];var U1=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795];var U2=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855];var U3=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150];var U4=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function convertToInt32(bytes){var result=[];for(var i=0;i>2;this._Ke[index][i%4]=tk[i];this._Kd[rounds-index][i%4]=tk[i]}var rconpointer=0;var t=KC,tt;while(t>16&255]<<24^S[tt>>8&255]<<16^S[tt&255]<<8^S[tt>>24&255]^rcon[rconpointer]<<24;rconpointer+=1;if(KC!=8){for(var i=1;i>8&255]<<8^S[tt>>16&255]<<16^S[tt>>24&255]<<24;for(var i=KC/2+1;i>2;c=t%4;this._Ke[r][c]=tk[i];this._Kd[rounds-r][c]=tk[i++];t++}}for(var r=1;r>24&255]^U2[tt>>16&255]^U3[tt>>8&255]^U4[tt&255]}}};AES.prototype.encrypt=function(plaintext){if(plaintext.length!=16){throw new Error("invalid plaintext size (must be 16 bytes)")}var rounds=this._Ke.length-1;var a=[0,0,0,0];var t=convertToInt32(plaintext);for(var i=0;i<4;i++){t[i]^=this._Ke[0][i]}for(var r=1;r>24&255]^T2[t[(i+1)%4]>>16&255]^T3[t[(i+2)%4]>>8&255]^T4[t[(i+3)%4]&255]^this._Ke[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Ke[rounds][i];result[4*i]=(S[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(S[t[(i+1)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(S[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(S[t[(i+3)%4]&255]^tt)&255}return result};AES.prototype.decrypt=function(ciphertext){if(ciphertext.length!=16){throw new Error("invalid ciphertext size (must be 16 bytes)")}var rounds=this._Kd.length-1;var a=[0,0,0,0];var t=convertToInt32(ciphertext);for(var i=0;i<4;i++){t[i]^=this._Kd[0][i]}for(var r=1;r>24&255]^T6[t[(i+3)%4]>>16&255]^T7[t[(i+2)%4]>>8&255]^T8[t[(i+1)%4]&255]^this._Kd[r][i]}t=a.slice()}var result=createArray(16),tt;for(var i=0;i<4;i++){tt=this._Kd[rounds][i];result[4*i]=(Si[t[i]>>24&255]^tt>>24)&255;result[4*i+1]=(Si[t[(i+3)%4]>>16&255]^tt>>16)&255;result[4*i+2]=(Si[t[(i+2)%4]>>8&255]^tt>>8)&255;result[4*i+3]=(Si[t[(i+1)%4]&255]^tt)&255}return result};var ModeOfOperationECB=function(key){if(!(this instanceof ModeOfOperationECB)){throw Error("AES must be instanitated with `new`")}this.description="Electronic Code Block";this.name="ecb";this._aes=new AES(key)};ModeOfOperationECB.prototype.encrypt=function(plaintext){plaintext=coerceArray(plaintext);if(plaintext.length%16!==0){throw new Error("invalid plaintext size (must be multiple of 16 bytes)")}var ciphertext=createArray(plaintext.length);var block=createArray(16);for(var i=0;iNumber.MAX_SAFE_INTEGER){throw new Error("integer value out of safe range")}for(var index=15;index>=0;--index){this._counter[index]=value%256;value=parseInt(value/256)}};Counter.prototype.setBytes=function(bytes){bytes=coerceArray(bytes,true);if(bytes.length!=16){throw new Error("invalid counter bytes size (must be 16 bytes)")}this._counter=bytes};Counter.prototype.increment=function(){for(var i=15;i>=0;i--){if(this._counter[i]===255){this._counter[i]=0}else{this._counter[i]++;break}}};var ModeOfOperationCTR=function(key,counter){if(!(this instanceof ModeOfOperationCTR)){throw Error("AES must be instanitated with `new`")}this.description="Counter";this.name="ctr";if(!(counter instanceof Counter)){counter=new Counter(counter)}this._counter=counter;this._remainingCounter=null;this._remainingCounterIndex=16;this._aes=new AES(key)};ModeOfOperationCTR.prototype.encrypt=function(plaintext){var encrypted=coerceArray(plaintext,true);for(var i=0;i16){throw new Error("PKCS#7 padding byte out of range")}var length=data.length-padder;for(var i=0;i1&&N<=1048576&&(N&N-1)===0,"unsafe scrypt N","kdf.N",N);assertArgument(Number.isSafeInteger(r)&&Number.isSafeInteger(p)&&r>0&&p>0&&r*p<=1048576&&128*N*r<=256*1024*1024,"unsafe scrypt work or memory requirement","kdf",{N:N,r:r,p:p})}function getDecryptKdfParams(data){const kdf=spelunk(data,"crypto.kdf:string");if(kdf&&typeof kdf==="string"){if(kdf.toLowerCase()==="scrypt"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const N=spelunk(data,"crypto.kdfparams.n:int!");const r=spelunk(data,"crypto.kdfparams.r:int!");const p=spelunk(data,"crypto.kdfparams.p:int!");validateScrypt(N,r,p);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dflen",dkLen);return{name:"scrypt",salt:salt,N:N,r:r,p:p,dkLen:64}}else if(kdf.toLowerCase()==="pbkdf2"){const salt=spelunk(data,"crypto.kdfparams.salt:data!");const prf=spelunk(data,"crypto.kdfparams.prf:string!");const algorithm=prf.split("-").pop();assertArgument(prf==="hmac-sha256"||prf==="hmac-sha512","invalid kdf.pdf","kdf.pdf",prf);const count=spelunk(data,"crypto.kdfparams.c:int!");assertArgument(Number.isSafeInteger(count)&&count>0&&count<=1e7,"unsafe PBKDF2 iteration count","kdf.c",count);const dkLen=spelunk(data,"crypto.kdfparams.dklen:int!");assertArgument(dkLen===32,"invalid kdf.dklen","kdf.dklen",dkLen);return{name:"pbkdf2",salt:salt,count:count,dkLen:dkLen,algorithm:algorithm}}}assertArgument(false,"unsupported key-derivation function","kdf",kdf)}function decryptKeystoreJsonSync(json,_password){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=scryptSync(password,salt,N,r,p,dkLen);return getAccount(data,key)}function stall$1(duration){return new Promise(resolve=>{setTimeout(()=>{resolve()},duration)})}async function decryptKeystoreJson(json,_password,progress){const data=JSON.parse(json);const password=getPassword(_password);const params=getDecryptKdfParams(data);if(params.name==="pbkdf2"){if(progress){progress(0);await stall$1(0)}const{salt,count,dkLen,algorithm}=params;const key=pbkdf2(password,salt,count,dkLen,algorithm);if(progress){progress(1);await stall$1(0)}return getAccount(data,key)}assert(params.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:params});const{salt,N,r,p,dkLen}=params;const key=await scrypt(password,salt,N,r,p,dkLen,progress);return getAccount(data,key)}function getEncryptKdfParams(options){const salt=options.salt!=null?getBytes(options.salt,"options.salt"):randomBytes(32);let N=1<<17,r=8,p=1;if(options.scrypt){if(options.scrypt.N!=null){N=options.scrypt.N}if(options.scrypt.r!=null){r=options.scrypt.r}if(options.scrypt.p!=null){p=options.scrypt.p}}validateScrypt(N,r,p);return{name:"scrypt",dkLen:32,salt:salt,N:N,r:r,p:p}}function _encryptKeystore(key,kdf,account,options){const privateKey=getBytes(account.privateKey,"privateKey");const iv=options.iv!=null?getBytes(options.iv,"options.iv"):randomBytes(16);assertArgument(iv.length===16,"invalid options.iv length","options.iv",options.iv);const uuidRandom=options.uuid!=null?getBytes(options.uuid,"options.uuid"):randomBytes(16);assertArgument(uuidRandom.length===16,"invalid options.uuid length","options.uuid",options.iv);const derivedKey=key.slice(0,16);const macPrefix=key.slice(16,32);const aesCtr=new CTR(derivedKey,new Counter(iv));const ciphertext=getBytes(aesCtr.encrypt(privateKey));const mac=sha256(concat([macPrefix,ciphertext]));const data={address:account.address.substring(2).toLowerCase(),id:uuidV4(uuidRandom),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:hexlify(iv).substring(2)},ciphertext:hexlify(ciphertext).substring(2),kdf:"scrypt",kdfparams:{salt:hexlify(kdf.salt).substring(2),n:kdf.N,dklen:32,p:kdf.p,r:kdf.r},mac:mac.substring(2)}};if(account.mnemonic){const client=options.client!=null?options.client:`corebc/${version}`;const path=account.mnemonic.path||defaultPath$1;const locale=account.mnemonic.locale||"en";const mnemonicKey=key.slice(32,64);const entropy=getBytes(account.mnemonic.entropy,"account.mnemonic.entropy");const mnemonicIv=randomBytes(16);const mnemonicAesCtr=new CTR(mnemonicKey,new Counter(mnemonicIv));const mnemonicCiphertext=getBytes(mnemonicAesCtr.encrypt(entropy));const now=new Date;const timestamp=now.getUTCFullYear()+"-"+zpad(now.getUTCMonth()+1,2)+"-"+zpad(now.getUTCDate(),2)+"T"+zpad(now.getUTCHours(),2)+"-"+zpad(now.getUTCMinutes(),2)+"-"+zpad(now.getUTCSeconds(),2)+".0Z";const gethFilename="UTC--"+timestamp+"--"+data.address;data["x-corebc"]={client:client,gethFilename:gethFilename,path:path,locale:locale,mnemonicCounter:hexlify(mnemonicIv).substring(2),mnemonicCiphertext:hexlify(mnemonicCiphertext).substring(2),version:"0.1"}}return JSON.stringify(data)}function encryptKeystoreJsonSync(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=scryptSync(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64);return _encryptKeystore(getBytes(key),kdf,account,options)}async function encryptKeystoreJson(account,password,options){if(options==null){options={}}const passwordBytes=getPassword(password);const kdf=getEncryptKdfParams(options);const key=await scrypt(passwordBytes,kdf.salt,kdf.N,kdf.r,kdf.p,64,options.progressCallback);return _encryptKeystore(getBytes(key),kdf,account,options)}const defaultPath="m";const HardenedBit=2147483648;const _guard={};function derivePath(node,path){const components=path.split("/");assertArgument(components.length>0&&(components[0]==="m"||node.depth>0),"invalid path","path",path);if(components[0]==="m"){components.shift()}let result=node;for(let i=0;i=0&&index=0&&index{setTimeout(()=>{resolve()},duration)})}class Wallet extends BaseWallet{constructor({key,prefix,provider}){if(typeof key==="string"&&!key.startsWith("0x")){key="0x"+key}let signingKey=typeof key==="string"?new SigningKey(key):key;super({signingKey:signingKey,prefix:prefix,provider:provider})}connect(provider){return new Wallet({key:this.signingKey,prefix:this.prefix,provider:provider})}async encrypt(password,progressCallback){const account={address:this.address,privateKey:this.privateKey};return await encryptKeystoreJson(account,password,{progressCallback:progressCallback})}encryptSync(password){const account={address:this.address,privateKey:this.privateKey};return encryptKeystoreJsonSync(account,password)}static#fromAccount(account){assertArgument(account,"invalid JSON wallet","json","[ REDACTED ]");const address=account.address;const prefix=extractPrefix(address);if("mnemonic"in account&&account.mnemonic&&account.mnemonic.locale==="en"){const mnemonic=Mnemonic.fromEntropy(account.mnemonic.entropy);const wallet=HDNodeWallet.fromMnemonic(mnemonic,prefix,account.mnemonic.path);if(wallet.address===account.address&&wallet.privateKey===account.privateKey){return wallet}console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}const wallet=new Wallet({key:account.privateKey,prefix:prefix});assertArgument(wallet.address===account.address,"address/privateKey mismatch","json","[ REDACTED ]");return wallet}static async fromEncryptedJson(json,password,progress){let account=null;if(isKeystoreJson(json)){account=await decryptKeystoreJson(json,password,progress)}else if(isCrowdsaleJson(json)){if(progress){progress(0);await stall(0)}account=decryptCrowdsaleJson(json,password);if(progress){progress(1);await stall(0)}}return Wallet.#fromAccount(account)}static fromEncryptedJsonSync(json,password){let account=null;if(isKeystoreJson(json)){account=decryptKeystoreJsonSync(json,password)}else if(isCrowdsaleJson(json)){account=decryptCrowdsaleJson(json,password)}else{assertArgument(false,"invalid JSON wallet","json","[ REDACTED ]")}return Wallet.#fromAccount(account)}static createRandom(prefix,provider){const wallet=HDNodeWallet.createRandom(prefix,undefined,undefined,undefined);if(provider){return wallet.connect(provider)}return wallet}static fromPhrase({phrase,prefix,provider,password}){const wallet=HDNodeWallet.fromPhrase({phrase:phrase,prefix:prefix,password:password});if(provider){return wallet.connect(provider)}return wallet}static fromSeed({seed,prefix,provider,path}){const wallet=HDNodeWallet.fromSeed({seed:seed,prefix:prefix,path:path||defaultPath});if(provider){return wallet.connect(provider)}return wallet}}const Base64=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function decodeBits(width,data){const maxValue=(1<=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const wordlists={en:LangEn.wordlist()};const customUnitAbi=Object.freeze(["function supportsUnit(string unit) view returns (bool)","function supportedUnits() view returns (string[])","function preferredUnit() view returns (string)","function balanceOf(address account) view returns (uint256)","function balanceOfUnit(address account, string unit) view returns (uint256)"]);class CustomUnitDiscovery{preferredUnit;supportedUnits;constructor(units,preferredUnit){this.preferredUnit=preferredUnit;this.supportedUnits=Object.freeze([...units])}get isValid(){return this.supports("units")&&this.preferredUnit!==""&&this.supports(this.preferredUnit)}supports(unit){return this.supportedUnits.includes(unit)}}class CustomUnitBalance{canonicalAmount;unitAmount;unit;constructor(canonicalAmount,unitAmount,unit){this.canonicalAmount=canonicalAmount;this.unitAmount=unitAmount;this.unit=unit}get multiplierNumerator(){return this.unitAmount}get multiplierDenominator(){return this.canonicalAmount}}class CustomUnitToken{contract;constructor(address,runner){this.contract=new Contract(address,customUnitAbi,runner)}async supportsUnit(unit,blockTag){return unit.trim()!==""&&await this.contract.supportsUnit(unit.trim(),{blockTag:blockTag})}async supportedUnits(blockTag){return Object.freeze(Array.from(await this.contract.supportedUnits({blockTag:blockTag})))}async preferredUnit(blockTag){return(await this.contract.preferredUnit({blockTag:blockTag})).trim()}async discover(blockTag){if(!await this.supportsUnit("units",blockTag))return null;const discovery=new CustomUnitDiscovery(await this.supportedUnits(blockTag),await this.preferredUnit(blockTag));return discovery.isValid?discovery:null}canonicalBalance(account,blockTag){return this.contract.balanceOf(account,{blockTag:blockTag})}balanceOfUnit(account,unit,blockTag){if(!unit.trim())throw new TypeError("unit must not be empty");return this.contract.balanceOfUnit(account,unit.trim(),{blockTag:blockTag})}async balance(account,unit,blockTag){const resolved=unit?.trim()||await this.preferredUnit(blockTag);const[canonical,calculated]=await Promise.all([this.canonicalBalance(account,blockTag),this.balanceOfUnit(account,resolved,blockTag)]);return new CustomUnitBalance(canonical,calculated,resolved)}}const cip150Abi=Object.freeze(["function getMetadataValue(string key) view returns (string value)","function hasMetadataKey(string key) view returns (bool exists)","function isMetadataSealed(string key) view returns (bool sealed)","function listMetadataKeys() view returns (string[] keys)","function getMetadataByIndex(uint256 index) view returns (string key, string value)","function metadataCount() view returns (uint256 total)","function setMetadataValue(string key, string value)","function sealMetadataKey(string key)"]);const cip151TokenExpirationKey="tokenExpiration";const cip151TradingStopKey="tradingStop";const cip152LabKey="lab";class Cip151Lifecycle{tokenExpiration;tradingStop;constructor(metadata={}){const parse=key=>{const value=metadata[key];if(value==null||value==="")return null;if(!/^\d+$/.test(value))throw new TypeError(`${key} must be a non-negative Unix timestamp`);return BigInt(value)};this.tokenExpiration=parse(cip151TokenExpirationKey);this.tradingStop=parse(cip151TradingStopKey)}isExpiredAt(seconds){return this.tokenExpiration!==null&&seconds>=this.tokenExpiration}isTradingStoppedAt(seconds){return this.tradingStop!==null&&seconds>=this.tradingStop}}class Cip152LabCertificate{measurements;constructor(json){if(json===null||typeof json!=="object"||Array.isArray(json))throw new TypeError("CIP-152 lab.json must be an object");const measurements=Object.create(null);for(const[key,property]of Object.entries(json)){if(!property||typeof property!=="object"||Array.isArray(property)||!Object.hasOwn(property,"value"))throw new TypeError(`CIP-152 property ${key} must contain a value`);const{value,unit}=property;if(!(typeof value==="string"||typeof value==="number"&&Number.isFinite(value)))throw new TypeError(`CIP-152 property ${key} has an invalid value`);if(unit!=null&&typeof unit!=="string")throw new TypeError(`CIP-152 property ${key} has an invalid unit`);measurements[key]=Object.freeze(unit==null?{value:value}:{value:value,unit:unit})}this.measurements=Object.freeze(measurements)}}class Cip150MetadataContract{contract;constructor(address,runner){this.contract=new Contract(address,cip150Abi,runner)}getValue(key,blockTag){return this.contract.getMetadataValue(key,{blockTag:blockTag})}hasKey(key,blockTag){return this.contract.hasMetadataKey(key,{blockTag:blockTag})}isSealed(key,blockTag){return this.contract.isMetadataSealed(key,{blockTag:blockTag})}async listKeys(blockTag){return Object.freeze(Array.from(await this.contract.listMetadataKeys({blockTag:blockTag})))}async getByIndex(index,blockTag){const[key,value]=await this.contract.getMetadataByIndex(index,{blockTag:blockTag});return Object.freeze({key:key,value:value})}count(blockTag){return this.contract.metadataCount({blockTag:blockTag})}async readAll(blockTag,includeSealedState=true){const entries=[];for(const key of await this.listKeys(blockTag)){const value=await this.getValue(key,blockTag);entries.push(Object.freeze(includeSealedState?{key:key,value:value,sealed:await this.isSealed(key,blockTag)}:{key:key,value:value}))}return Object.freeze(entries)}setValue(key,value,overrides={}){return this.contract.setMetadataValue(key,value,overrides)}sealKey(key,overrides={}){return this.contract.sealMetadataKey(key,overrides)}async readLifecycle(blockTag){const metadata={};for(const key of[cip151TokenExpirationKey,cip151TradingStopKey]){if(await this.hasKey(key,blockTag))metadata[key]=await this.getValue(key,blockTag)}return new Cip151Lifecycle(metadata)}async readLabCertificate(gateway,blockTag){if(!await this.hasKey(cip152LabKey,blockTag))return null;const reference=await this.getValue(cip152LabKey,blockTag);if(!gateway.resolve(reference).pathname.endsWith("/lab.json"))throw new TypeError("CIP-152 reference must point to lab.json");return new Cip152LabCertificate(await gateway.readJson(reference))}}const defaultIpfsGatewayTemplate="https://ipf.sk/{cid}";class IpfsGateway{template;maxResponseBytes;timeoutMs;#fetch;constructor(options={}){this.template=options.template??defaultIpfsGatewayTemplate;this.maxResponseBytes=options.maxResponseBytes??1024*1024;this.timeoutMs=options.timeoutMs??3e4;this.#fetch=options.fetch??globalThis.fetch;const templateUrl=new URL(this.template.replace("{cid}","cid"));if(!/^https?:$/.test(templateUrl.protocol)||this.template.split("{cid}").length!==2)throw new TypeError("gateway template must be HTTP(S) and contain one {cid}");for(const value of[this.maxResponseBytes,this.timeoutMs])if(!Number.isSafeInteger(value)||value<=0)throw new TypeError("gateway limits must be positive safe integers")}resolve(reference){const value=reference.trim();if(/^https?:\/\//i.test(value))return new URL(value);const path=value.replace(/^ipfs:\/\//,"").replace(/^\/?ipfs\//,"");if(!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path)||path.split("/").some(part=>part==="."||part===".."))throw new TypeError("invalid IPFS reference");return new URL(this.template.replace("{cid}",path.split("/").map(encodeURIComponent).join("/")))}async readJson(reference){const controller=new AbortController;const timer=setTimeout(()=>controller.abort(),this.timeoutMs);let reader;try{const response=await this.#fetch(this.resolve(reference),{headers:{accept:"application/json"},signal:controller.signal});if(!response.ok){await response.body?.cancel();throw new Error(`IPFS gateway returned HTTP ${response.status}`)}if(!response.body)throw new Error("IPFS gateway returned an empty body");reader=response.body.getReader();const chunks=[];let length=0;while(true){const{done,value}=await reader.read();if(done)break;length+=value.length;if(length>this.maxResponseBytes)throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);chunks.push(value)}const bytes=new Uint8Array(length);let offset=0;for(const chunk of chunks){bytes.set(chunk,offset);offset+=chunk.length}return JSON.parse(new TextDecoder("utf-8",{fatal:true}).decode(bytes))}finally{clearTimeout(timer);await reader?.cancel().catch(()=>{});reader?.releaseLock()}}}var corebc=Object.freeze({__proto__:null,AbiCoder:AbiCoder,AbstractProvider:AbstractProvider,AbstractSigner:AbstractSigner,AlchemyProvider:AlchemyProvider,AnkrProvider:AnkrProvider,BaseContract:BaseContract,BaseWallet:BaseWallet,BigNumber:BigNumber,Block:Block,BrowserProvider:BrowserProvider,Cip150MetadataContract:Cip150MetadataContract,Cip151Lifecycle:Cip151Lifecycle,Cip152LabCertificate:Cip152LabCertificate,CloudflareProvider:CloudflareProvider,ConstructorFragment:ConstructorFragment,Contract:Contract,ContractEventPayload:ContractEventPayload,ContractFactory:ContractFactory,ContractTransactionReceipt:ContractTransactionReceipt,ContractTransactionResponse:ContractTransactionResponse,ContractUnknownEventPayload:ContractUnknownEventPayload,CoreSymbol:CoreSymbol,CustomUnitBalance:CustomUnitBalance,CustomUnitDiscovery:CustomUnitDiscovery,CustomUnitToken:CustomUnitToken,Ed448Goldilock:Ed448Goldilock,EnergyCostPlugin:EnergyCostPlugin,ErrorDescription:ErrorDescription,ErrorFragment:ErrorFragment,EventFragment:EventFragment,EventLog:EventLog,EventPayload:EventPayload,FallbackFragment:FallbackFragment,FallbackProvider:FallbackProvider,FeeData:FeeData,FeeDataNetworkPlugin:FeeDataNetworkPlugin,FetchCancelSignal:FetchCancelSignal,FetchRequest:FetchRequest,FetchResponse:FetchResponse,FixedNumber:FixedNumber,Fragment:Fragment,FunctionFragment:FunctionFragment,HDNodeWallet:HDNodeWallet,Indexed:Indexed,InfuraProvider:InfuraProvider,InfuraWebSocketProvider:InfuraWebSocketProvider,Interface:Interface,IpcSocketProvider:IpcSocketProvider,IpfsGateway:IpfsGateway,JsonRpcApiProvider:JsonRpcApiProvider,JsonRpcProvider:JsonRpcProvider,JsonRpcSigner:JsonRpcSigner,LangEn:LangEn,Log:Log,LogDescription:LogDescription,MaxInt256:MaxInt256,MaxUint256:MaxUint256,MessagePrefix:MessagePrefix,MinInt256:MinInt256,Mnemonic:Mnemonic,N:N,NamedFragment:NamedFragment,Network:Network,NetworkPlugin:NetworkPlugin,NonceManager:NonceManager,OrePerXCB:OrePerXCB,ParamType:ParamType,PocketProvider:PocketProvider,QuickNodeProvider:QuickNodeProvider,Result:Result,Signature:Signature,SigningKey:SigningKey,SocketBlockSubscriber:SocketBlockSubscriber,SocketEventSubscriber:SocketEventSubscriber,SocketPendingSubscriber:SocketPendingSubscriber,SocketProvider:SocketProvider,SocketSubscriber:SocketSubscriber,StructFragment:StructFragment,Transaction:Transaction,TransactionDescription:TransactionDescription,TransactionReceipt:TransactionReceipt,TransactionResponse:TransactionResponse,Typed:Typed,TypedDataEncoder:TypedDataEncoder,UnmanagedSubscriber:UnmanagedSubscriber,Utf8ErrorFuncs:Utf8ErrorFuncs,VoidSigner:VoidSigner,Wallet:Wallet,WebSocketProvider:WebSocketProvider,Wordlist:Wordlist,WordlistOwl:WordlistOwl,WordlistOwlA:WordlistOwlA,ZeroAddress:ZeroAddress,ZeroHash:ZeroHash,accessListify:accessListify,arrayify:arrayify,assert:assert,assertArgument:assertArgument,assertArgumentCount:assertArgumentCount,assertNormalize:assertNormalize,assertPrivate:assertPrivate,checkResultErrors:checkResultErrors,cip150Abi:cip150Abi,cip151TokenExpirationKey:cip151TokenExpirationKey,cip151TradingStopKey:cip151TradingStopKey,cip152LabKey:cip152LabKey,computeAddress:computeAddress,computeHmac:computeHmac,concat:concat,copyRequest:copyRequest,customUnitAbi:customUnitAbi,dataLength:dataLength,dataSlice:dataSlice,decodeBase58:decodeBase58,decodeBase64:decodeBase64,decodeBytes32String:decodeBytes32String,decodeRlp:decodeRlp,decryptCrowdsaleJson:decryptCrowdsaleJson,decryptKeystoreJson:decryptKeystoreJson,decryptKeystoreJsonSync:decryptKeystoreJsonSync,defaultIpfsGatewayTemplate:defaultIpfsGatewayTemplate,defaultPath:defaultPath,defineProperties:defineProperties,encodeBase58:encodeBase58,encodeBase64:encodeBase64,encodeBytes32String:encodeBytes32String,encodeRlp:encodeRlp,encryptKeystoreJson:encryptKeystoreJson,encryptKeystoreJsonSync:encryptKeystoreJsonSync,formatUnits:formatUnits,formatXCB:formatXCB,fromTwos:fromTwos,getAccountPath:getAccountPath,getAddress:getAddress,getBigInt:getBigInt,getBytes:getBytes,getBytesCopy:getBytesCopy,getCreate2Address:getCreate2Address,getCreateAddress:getCreateAddress,getDefaultProvider:getDefaultProvider,getIndexedAccountPath:getIndexedAccountPath,getNumber:getNumber,getUint:getUint,hashMessage:hashMessage,hexConcat:hexConcat,hexlify:hexlify,id:id,isAddress:isAddress,isAddressable:isAddressable,isBytesLike:isBytesLike,isCallException:isCallException,isCrowdsaleJson:isCrowdsaleJson,isError:isError,isHexString:isHexString,isKeystoreJson:isKeystoreJson,keccak256:keccak256,lock:lock,makeError:makeError,mask:mask,networkIdToPrefix:networkIdToPrefix,parseUnits:parseUnits,parseXCB:parseXCB,pbkdf2:pbkdf2,publicToAddress:publicToAddress,randomBytes:randomBytes,recoverAddress:recoverAddress,resolveAddress:resolveAddress,resolveProperties:resolveProperties,ripemd160:ripemd160,scrypt:scrypt,scryptSync:scryptSync,sha256:sha256,sha512:sha512,showThrottleMessage:showThrottleMessage,solidityPacked:solidityPacked,solidityPackedSha256:solidityPackedSha256,stripZerosLeft:stripZerosLeft,toBeArray:toBeArray,toBeHex:toBeHex,toBigInt:toBigInt,toNumber:toNumber,toQuantity:toQuantity,toTwos:toTwos,toUtf8Bytes:toUtf8Bytes,toUtf8CodePoints:toUtf8CodePoints,toUtf8String:toUtf8String,uuidV4:uuidV4,verifyMessage:verifyMessage,verifyTypedData:verifyTypedData,version:version,wordlists:wordlists,zeroPadBytes:zeroPadBytes,zeroPadValue:zeroPadValue});exports.AbiCoder=AbiCoder;exports.AbstractProvider=AbstractProvider;exports.AbstractSigner=AbstractSigner;exports.AlchemyProvider=AlchemyProvider;exports.AnkrProvider=AnkrProvider;exports.BaseContract=BaseContract;exports.BaseWallet=BaseWallet;exports.BigNumber=BigNumber;exports.Block=Block;exports.BrowserProvider=BrowserProvider;exports.Buffer=bufferExports.Buffer;exports.Cip150MetadataContract=Cip150MetadataContract;exports.Cip151Lifecycle=Cip151Lifecycle;exports.Cip152LabCertificate=Cip152LabCertificate;exports.CloudflareProvider=CloudflareProvider;exports.ConstructorFragment=ConstructorFragment;exports.Contract=Contract;exports.ContractEventPayload=ContractEventPayload;exports.ContractFactory=ContractFactory;exports.ContractTransactionReceipt=ContractTransactionReceipt;exports.ContractTransactionResponse=ContractTransactionResponse;exports.ContractUnknownEventPayload=ContractUnknownEventPayload;exports.CoreSymbol=CoreSymbol;exports.CustomUnitBalance=CustomUnitBalance;exports.CustomUnitDiscovery=CustomUnitDiscovery;exports.CustomUnitToken=CustomUnitToken;exports.Ed448Goldilock=Ed448Goldilock;exports.EnergyCostPlugin=EnergyCostPlugin;exports.ErrorDescription=ErrorDescription;exports.ErrorFragment=ErrorFragment;exports.EventFragment=EventFragment;exports.EventLog=EventLog;exports.EventPayload=EventPayload;exports.FallbackFragment=FallbackFragment;exports.FallbackProvider=FallbackProvider;exports.FeeData=FeeData;exports.FeeDataNetworkPlugin=FeeDataNetworkPlugin;exports.FetchCancelSignal=FetchCancelSignal;exports.FetchRequest=FetchRequest;exports.FetchResponse=FetchResponse;exports.FixedNumber=FixedNumber;exports.Fragment=Fragment;exports.FunctionFragment=FunctionFragment;exports.HDNodeWallet=HDNodeWallet;exports.Indexed=Indexed;exports.InfuraProvider=InfuraProvider;exports.InfuraWebSocketProvider=InfuraWebSocketProvider;exports.Interface=Interface;exports.IpcSocketProvider=IpcSocketProvider;exports.IpfsGateway=IpfsGateway;exports.JsonRpcApiProvider=JsonRpcApiProvider;exports.JsonRpcProvider=JsonRpcProvider;exports.JsonRpcSigner=JsonRpcSigner;exports.LangEn=LangEn;exports.Log=Log;exports.LogDescription=LogDescription;exports.MaxInt256=MaxInt256;exports.MaxUint256=MaxUint256;exports.MessagePrefix=MessagePrefix;exports.MinInt256=MinInt256;exports.Mnemonic=Mnemonic;exports.N=N;exports.NamedFragment=NamedFragment;exports.Network=Network;exports.NetworkPlugin=NetworkPlugin;exports.NonceManager=NonceManager;exports.OrePerXCB=OrePerXCB;exports.ParamType=ParamType;exports.PocketProvider=PocketProvider;exports.QuickNodeProvider=QuickNodeProvider;exports.Result=Result;exports.Signature=Signature;exports.SigningKey=SigningKey;exports.SocketBlockSubscriber=SocketBlockSubscriber;exports.SocketEventSubscriber=SocketEventSubscriber;exports.SocketPendingSubscriber=SocketPendingSubscriber;exports.SocketProvider=SocketProvider;exports.SocketSubscriber=SocketSubscriber;exports.StructFragment=StructFragment;exports.Transaction=Transaction;exports.TransactionDescription=TransactionDescription;exports.TransactionReceipt=TransactionReceipt;exports.TransactionResponse=TransactionResponse;exports.Typed=Typed;exports.TypedDataEncoder=TypedDataEncoder;exports.UnmanagedSubscriber=UnmanagedSubscriber;exports.Utf8ErrorFuncs=Utf8ErrorFuncs;exports.VoidSigner=VoidSigner;exports.Wallet=Wallet;exports.WebSocketProvider=WebSocketProvider;exports.Wordlist=Wordlist;exports.WordlistOwl=WordlistOwl;exports.WordlistOwlA=WordlistOwlA;exports.ZeroAddress=ZeroAddress;exports.ZeroHash=ZeroHash;exports.accessListify=accessListify;exports.arrayify=arrayify;exports.assert=assert;exports.assertArgument=assertArgument;exports.assertArgumentCount=assertArgumentCount;exports.assertNormalize=assertNormalize;exports.assertPrivate=assertPrivate;exports.checkResultErrors=checkResultErrors;exports.cip150Abi=cip150Abi;exports.cip151TokenExpirationKey=cip151TokenExpirationKey;exports.cip151TradingStopKey=cip151TradingStopKey;exports.cip152LabKey=cip152LabKey;exports.computeAddress=computeAddress;exports.computeHmac=computeHmac;exports.concat=concat;exports.copyRequest=copyRequest;exports.corebc=corebc;exports.customUnitAbi=customUnitAbi;exports.dataLength=dataLength;exports.dataSlice=dataSlice;exports.decodeBase58=decodeBase58;exports.decodeBase64=decodeBase64;exports.decodeBytes32String=decodeBytes32String;exports.decodeRlp=decodeRlp;exports.decryptCrowdsaleJson=decryptCrowdsaleJson;exports.decryptKeystoreJson=decryptKeystoreJson;exports.decryptKeystoreJsonSync=decryptKeystoreJsonSync;exports.defaultIpfsGatewayTemplate=defaultIpfsGatewayTemplate;exports.defaultPath=defaultPath;exports.defineProperties=defineProperties;exports.encodeBase58=encodeBase58;exports.encodeBase64=encodeBase64;exports.encodeBytes32String=encodeBytes32String;exports.encodeRlp=encodeRlp;exports.encryptKeystoreJson=encryptKeystoreJson;exports.encryptKeystoreJsonSync=encryptKeystoreJsonSync;exports.formatUnits=formatUnits;exports.formatXCB=formatXCB;exports.fromTwos=fromTwos;exports.getAccountPath=getAccountPath;exports.getAddress=getAddress;exports.getBigInt=getBigInt;exports.getBytes=getBytes;exports.getBytesCopy=getBytesCopy;exports.getCreate2Address=getCreate2Address;exports.getCreateAddress=getCreateAddress;exports.getDefaultProvider=getDefaultProvider;exports.getIndexedAccountPath=getIndexedAccountPath;exports.getNumber=getNumber;exports.getUint=getUint;exports.hashMessage=hashMessage;exports.hexConcat=hexConcat;exports.hexlify=hexlify;exports.id=id;exports.isAddress=isAddress;exports.isAddressable=isAddressable;exports.isBytesLike=isBytesLike;exports.isCallException=isCallException;exports.isCrowdsaleJson=isCrowdsaleJson;exports.isError=isError;exports.isHexString=isHexString;exports.isKeystoreJson=isKeystoreJson;exports.keccak256=keccak256;exports.lock=lock;exports.makeError=makeError;exports.mask=mask;exports.networkIdToPrefix=networkIdToPrefix;exports.parseUnits=parseUnits;exports.parseXCB=parseXCB;exports.pbkdf2=pbkdf2;exports.publicToAddress=publicToAddress;exports.randomBytes=randomBytes;exports.recoverAddress=recoverAddress;exports.resolveAddress=resolveAddress;exports.resolveProperties=resolveProperties;exports.ripemd160=ripemd160;exports.scrypt=scrypt;exports.scryptSync=scryptSync;exports.sha256=sha256;exports.sha512=sha512;exports.showThrottleMessage=showThrottleMessage;exports.solidityPacked=solidityPacked;exports.solidityPackedSha256=solidityPackedSha256;exports.stripZerosLeft=stripZerosLeft;exports.toBeArray=toBeArray;exports.toBeHex=toBeHex;exports.toBigInt=toBigInt;exports.toNumber=toNumber;exports.toQuantity=toQuantity;exports.toTwos=toTwos;exports.toUtf8Bytes=toUtf8Bytes;exports.toUtf8CodePoints=toUtf8CodePoints;exports.toUtf8String=toUtf8String;exports.uuidV4=uuidV4;exports.verifyMessage=verifyMessage;exports.verifyTypedData=verifyTypedData;exports.version=version;exports.wordlists=wordlists;exports.zeroPadBytes=zeroPadBytes;exports.zeroPadValue=zeroPadValue}); \ No newline at end of file diff --git a/dist/wordlists-extra.js b/dist/wordlists-extra.js deleted file mode 100644 index 6d4535cdb..000000000 --- a/dist/wordlists-extra.js +++ /dev/null @@ -1,5563 +0,0 @@ -const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))(); -const _32n = /* @__PURE__ */ BigInt(32); -// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high -// }` to match little-endian word order rather than the property names. -function fromBig(n, le = false) { - if (le) - return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) }; - return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 }; -} -// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array -// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`. -function split(lst, le = false) { - const len = lst.length; - let Ah = new Uint32Array(len); - let Al = new Uint32Array(len); - for (let i = 0; i < len; i++) { - const { h, l } = fromBig(lst[i], le); - [Ah[i], Al[i]] = [h, l]; - } - return [Ah, Al]; -} -// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers -// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below -// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes). -const fromNumH = (n) => (n / 2 ** 32) | 0; -const fromNumL = (n) => n >>> 0; -// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call -// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`. -function setU64FromNum(view, byteOffset, n, isLE) { - const h = fromNumH(n); - const l = fromNumL(n); - view.setUint32(byteOffset, isLE ? l : h, isLE); - view.setUint32(byteOffset + 4, isLE ? h : l, isLE); -} -// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`. -const shrSH = (h, _l, s) => h >>> s; -// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`. -const shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. -const rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s)); -// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`. -const rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s); -// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. -const rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32)); -// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`. -const rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s)); -// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps -// local copies so V8 inlines them into keccakP. -// Add two split 64-bit words and return the split `{ h, l }` sum. -// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out -// of the low sum and instead use division. -function add(Ah, Al, Bh, Bl) { - const l = (Al >>> 0) + (Bl >>> 0); - return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 }; -} -// Addition with more than 2 elements -// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`. -const add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0); -// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`. -const add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0; -// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`. -const add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0); -// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`. -const add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0; -// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`. -const add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0); -// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`. -const add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0; - -/** - * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true. - * @param a - value to test - * @returns `true` when the value is a Uint8Array-compatible view. - * @example - * Check whether a value is a Uint8Array-compatible view. - * ```ts - * isBytes(new Uint8Array([1, 2, 3])); - * ``` - */ -function isBytes$1(a) { - // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases. - // The fallback still requires a real ArrayBuffer view, so plain - // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and - // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views. - return (a instanceof Uint8Array || - (ArrayBuffer.isView(a) && - a.constructor.name === 'Uint8Array' && - 'BYTES_PER_ELEMENT' in a && - a.BYTES_PER_ELEMENT === 1)); -} -// Shared error-message prefix builder. Only called on throw paths, so assert -// success paths never pay for the string concatenation. -const atitle = (title) => (title ? `"${title}" ` : ''); -/** - * Asserts something is a non-negative integer. - * @param n - number to validate - * @param title - label included in thrown errors - * @returns The validated number. - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Validate a non-negative integer option. - * ```ts - * anumber(32, 'length'); - * ``` - */ -function anumber(n, title = '') { - if (typeof n !== 'number') - throw new TypeError(atitle(title) + 'expected number, got ' + typeof n); - if (!Number.isSafeInteger(n) || n < 0) - throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n); - return n; -} -/** - * Asserts something is a boolean. - * @param value - value to validate - * @param title - label included in thrown errors - * @returns The validated boolean. - * @throws On wrong argument types. {@link TypeError} - * @example - * Validate a boolean option. - * ```ts - * abool(true, 'enableXOF'); - * ``` - */ -function abool(value, title = '') { - if (typeof value !== 'boolean') - throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value); - return value; -} -/** - * Asserts something is Uint8Array. - * @param value - value to validate - * @param length - optional exact length constraint - * @param title - label included in thrown errors - * @returns The validated byte array. - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Validate that a value is a byte array. - * ```ts - * abytes(new Uint8Array([1, 2, 3])); - * ``` - */ -function abytes(value, length, title = '') { - // Success path first: this runs at the start of every update() / digestInto(), and the - // common `abytes(data)` form must not pay for length handling it does not use. - if (isBytes$1(value) && (length === undefined)) - return value; - const bytes = isBytes$1(value); - const ofLen = ''; - const got = bytes ? `length=${value.length}` : `type=${typeof value}`; - const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got; - if (!bytes) - throw new TypeError(message); - throw new RangeError(message); -} -const aobject = (value, label) => { - if (value === null || typeof value !== 'object' || Array.isArray(value)) - throw new TypeError((label === 'object' ? '' : `"${label}" `) + 'expected object, got type=' + typeof value); -}; -const aopts = (value, label) => { - aobject(value, label); - const proto = Object.getPrototypeOf(value); - if (proto !== Object.prototype && proto !== null) - throw new TypeError(`"${label}" expected plain object`); - // Object.assign() treats an own "__proto__" source key as a write to the target's legacy - // prototype setter. Reject it before merging so inherited option values cannot be injected. - if (Object.hasOwn(value, '__proto__')) - throw new TypeError(`"${label}.__proto__" is not allowed`); -}; -/** - * Asserts a hash instance has not been destroyed or finished. - * @param instance - hash instance to validate - * @param checkFinished - whether to reject finalized instances - * @throws If the hash instance has already been destroyed or finalized. {@link Error} - * @example - * Validate that a hash instance is still usable. - * ```ts - * import { aexists } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const hash = sha256.create(); - * aexists(hash); - * ``` - */ -function aexists(instance, checkFinished = true) { - // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their - // truthiness is checked - re-validating their type per call was pure hot-path overhead. - if (instance.destroyed) - throw new Error('hash was destroyed'); - if (checkFinished && instance.finished) - throw new Error('digest() was already called'); -} -/** - * Asserts output is a sufficiently-sized byte array. - * @param out - destination buffer - * @param instance - hash instance providing output length - * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes. - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @example - * Validate a caller-provided digest buffer. - * ```ts - * import { aoutput } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const hash = sha256.create(); - * aoutput(new Uint8Array(hash.outputLen), hash); - * ``` - */ -function aoutput(out, instance) { - abytes(out, undefined, 'output'); - // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast - // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call. - const min = instance.outputLen; - if (!(out.length >= min)) { - throw new RangeError('"output" expected length >= ' + min); - } -} -/** - * Casts a typed array view to Uint32Array. - * `arr.byteOffset` must already be 4-byte aligned or the platform - * Uint32Array constructor will throw. - * @param arr - source typed array - * @returns Uint32Array view over the same buffer. - * @example - * Reinterpret a byte array as 32-bit words. - * ```ts - * u32(new Uint8Array(8)); - * ``` - */ -function u32(arr) { - return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4)); -} -/** - * Zeroizes typed arrays in place. Warning: JS provides no guarantees. - * @param arrays - arrays to overwrite with zeros - * @example - * Zeroize sensitive buffers in place. - * ```ts - * clean(new Uint8Array([1, 2, 3])); - * ``` - */ -function clean(...arrays) { - for (let i = 0; i < arrays.length; i++) { - arrays[i].fill(0); - } -} -/** - * Creates a DataView for byte-level manipulation. - * @param arr - source typed array - * @returns DataView over the same buffer region. - * @example - * Create a DataView over an existing buffer. - * ```ts - * createView(new Uint8Array(4)); - * ``` - */ -function createView(arr) { - return new DataView(arr.buffer, arr.byteOffset, arr.byteLength); -} -/** - * Rotate-right operation for uint32 values. - * @param word - source word - * @param shift - shift amount in bits - * @returns Rotated word. - * @example - * Rotate a 32-bit word to the right. - * ```ts - * rotr(0x12345678, 8); - * ``` - */ -function rotr(word, shift) { - return (word << (32 - shift)) | (word >>> shift); -} -/** - * Rotate-left operation for uint32 values. - * @param word - source word - * @param shift - shift amount in bits - * @returns Rotated word. - * @example - * Rotate a 32-bit word to the left. - * ```ts - * rotl(0x12345678, 8); - * ``` - */ -function rotl(word, shift) { - return (word << shift) | ((word >>> (32 - shift)) >>> 0); -} -/** Whether the current platform is little-endian. */ -const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)(); -/** - * Byte-swap operation for uint32 values. - * @param word - source word - * @returns Word with reversed byte order. - * @example - * Reverse the byte order of a 32-bit word. - * ```ts - * byteSwap(0x11223344); - * ``` - */ -function byteSwap(word) { - return (((word << 24) & 0xff000000) | - ((word << 8) & 0xff0000) | - ((word >>> 8) & 0xff00) | - ((word >>> 24) & 0xff)); -} -/** - * Byte-swaps every word of a Uint32Array in place. - * @param arr - array to mutate - * @returns The same array after mutation; callers pass live state arrays here. - * @example - * Reverse the byte order of every word in place. - * ```ts - * byteSwap32(new Uint32Array([0x11223344])); - * ``` - */ -function byteSwap32(arr) { - for (let i = 0; i < arr.length; i++) { - arr[i] = byteSwap(arr[i]); - } - return arr; -} -/** - * Conditionally byte-swaps a Uint32Array on big-endian platforms. - * @param u - array to normalize for host endianness - * @returns Original or byte-swapped array depending on platform endianness. - * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`. - * @example - * Normalize a word array for host endianness. - * ```ts - * swap32IfBE(new Uint32Array([0x11223344])); - * ``` - */ -const swap32IfBE = isLE - ? (u) => u - : byteSwap32; -/** - * Merges default options and passed options. - * @param defaults - base option object - * @param opts - user overrides - * @param title - label included in thrown override errors - * @returns Fresh merged option object with a null prototype. - * @throws On wrong argument types. {@link TypeError} - * @example - * Merge user overrides onto default options. - * ```ts - * checkOpts({ dkLen: 32 }, { asyncTick: 10 }); - * ``` - */ -function checkOpts(defaults, opts, title = 'opts') { - aopts(defaults, 'defaults'); - if (opts !== undefined) - aopts(opts, title); - // Callers read optional fields directly, so omitted values must not fall through to ambient - // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output). - const merged = Object.assign(Object.create(null), defaults, opts); - return merged; -} -/** - * Creates a callable hash function from a stateful class constructor. - * @param hashCons - hash constructor or factory - * @param info - optional metadata such as DER OID - * @returns Frozen callable hash wrapper with `.create()`. - * Wrapper construction eagerly calls `hashCons(undefined)` once to read - * `outputLen` / `blockLen`, so constructor side effects happen at module - * init time. - * @throws On wrong argument types. {@link TypeError} - * @example - * Wrap a stateful hash constructor into a callable helper. - * ```ts - * import { createHasher } from '@noble/hashes/utils.js'; - * import { sha256 } from '@noble/hashes/sha2.js'; - * const wrapped = createHasher(sha256.create, { oid: sha256.oid }); - * wrapped(new Uint8Array([1])); - * ``` - */ -function createHasher(hashCons, info = {}) { - if (typeof hashCons !== 'function') - throw new TypeError('"hashCons" expected function, got type=' + typeof hashCons); - info = checkOpts({}, info, 'info'); - const hashC = (msg, opts) => hashCons(opts) - .update(msg) - .digest(); - const tmp = hashCons(undefined); - hashC.outputLen = tmp.outputLen; - hashC.blockLen = tmp.blockLen; - hashC.canXOF = tmp.canXOF; - hashC.create = (opts) => hashCons(opts); - Object.assign(hashC, info); - return Object.freeze(hashC); -} -/** - * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`. - * @param suffix - final OID byte for the selected hash. - * The helper accepts any byte even though only the documented NIST hash - * suffixes are meaningful downstream. - * @returns Object containing the DER-encoded OID. - * @example - * Build OID metadata for a NIST hash. - * ```ts - * oidNist(0x01); - * ``` - */ -const oidNist = (suffix) => ({ - // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet. - // Larger suffix values would need base-128 OID encoding and a different length byte. - oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]), -}); - -/** - * SHA3 (keccak) hash function, based on a new "Sponge function" design. - * Different from older hashes, the internal state is bigger than output size. - * - * Check out - * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202}, - * {@link https://keccak.team/keccak.html | Website}, and - * {@link https://crypto.stackexchange.com/q/15727 | the differences between - * SHA-3 and Keccak}. - * - * Check out `sha3-addons` module for cSHAKE, k12, and others. - * @module - */ -// No __PURE__ annotations in sha3 header: -// EVERYTHING is in fact used on every export. -// Various per round constants calculations -const _0n = BigInt(0); -const _1n = BigInt(1); -const _2n = BigInt(2); -const _7n = BigInt(7); -const _256n = BigInt(256); -// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors -// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`. -const _0x71n = BigInt(0x71); -const SHA3_PI = []; -const SHA3_ROTL = []; -const _SHA3_IOTA = []; // no pure annotation: var is always used -for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) { - // Pi - [x, y] = [y, (2 * x + 3 * y) % 5]; - SHA3_PI.push(2 * (5 * y + x)); - // Rotational - SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64); - // Iota - let t = _0n; - for (let j = 0; j < 7; j++) { - R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n; - if (R & _2n) - t ^= _1n << ((_1n << BigInt(j)) - _1n); - } - _SHA3_IOTA.push(t); -} -const IOTAS = split(_SHA3_IOTA, true); -// `split(..., true)` keeps the local little-endian lane-word layout used by -// `state32`, so these `H` / `L` tables follow the file's first-word / -// second-word lane slots rather than `_u64.ts`'s usual high/low naming. -const SHA3_IOTA_H = IOTAS[0]; -const SHA3_IOTA_L = IOTAS[1]; -// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can -// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only -// consumer of left-rotates; other hashes use right-rotates from _u64. -// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64. -const rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s)); -const rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s)); -const rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s)); -const rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s)); -const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s)); -const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s)); -// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2. -// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation. -const B = new Uint32Array(5 * 2); -/** - * `keccakf1600` internal permutation, additionally allows adjusting the round count. - * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words - * in this file's local little-endian lane-word order - * @param rounds - number of rounds to execute - * @throws On wrong argument types. {@link TypeError} - * @throws On wrong argument ranges or values. {@link RangeError} - * @throws If `rounds` is outside the supported `1..24` range. {@link Error} - * @example - * Permute a Keccak state with the default 24 rounds. - * ```ts - * keccakP(new Uint32Array(50)); - * ``` - */ -function keccakP(s, rounds = 24) { - if (!(s instanceof Uint32Array)) - throw new TypeError('"s" expected Uint32Array(50), got type=' + typeof s); - if (s.length !== 50) - throw new RangeError('"s" expected Uint32Array(50), got length=' + s.length); - anumber(rounds, 'rounds'); - // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table. - if (rounds < 1 || rounds > 24) - throw new Error('"rounds" expected integer 1..24'); - // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js) - for (let round = 24 - rounds; round < 24; round++) { - // Theta θ - for (let x = 0; x < 10; x++) - B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40]; - for (let x = 0; x < 10; x += 2) { - const idx1 = (x + 8) % 10; - const idx0 = (x + 2) % 10; - const B0 = B[idx0]; - const B1 = B[idx0 + 1]; - const Th = rotlH(B0, B1, 1) ^ B[idx1]; - const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1]; - for (let y = 0; y < 50; y += 10) { - s[x + y] ^= Th; - s[x + y + 1] ^= Tl; - } - } - // Rho (ρ) and Pi (π) - let curH = s[2]; - let curL = s[3]; - for (let t = 0; t < 24; t++) { - const shift = SHA3_ROTL[t]; - const Th = rotlH(curH, curL, shift); - const Tl = rotlL(curH, curL, shift); - const PI = SHA3_PI[t]; - curH = s[PI]; - curL = s[PI + 1]; - s[PI] = Th; - s[PI + 1] = Tl; - } - // Chi (χ) - // Same as: - // for (let x = 0; x < 10; x++) B[x] = s[y + x]; - // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10]; - for (let y = 0; y < 50; y += 10) { - const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3]; - s[y] ^= ~s[y + 2] & s[y + 4]; - s[y + 1] ^= ~s[y + 3] & s[y + 5]; - s[y + 2] ^= ~s[y + 4] & s[y + 6]; - s[y + 3] ^= ~s[y + 5] & s[y + 7]; - s[y + 4] ^= ~s[y + 6] & s[y + 8]; - s[y + 5] ^= ~s[y + 7] & s[y + 9]; - s[y + 6] ^= ~s[y + 8] & b0; - s[y + 7] ^= ~s[y + 9] & b1; - s[y + 8] ^= ~b0 & b2; - s[y + 9] ^= ~b1 & b3; - } - // Iota (ι) - s[0] ^= SHA3_IOTA_H[round]; - s[1] ^= SHA3_IOTA_L[round]; - } - clean(B); -} -/** - * Keccak sponge function. - * @param blockLen - absorb/squeeze rate in bytes - * @param suffix - domain separation suffix byte - * @param outputLen - default digest length in bytes. This base sponge only - * requires a non-negative integer; wrappers that need positive output - * lengths must enforce that themselves. - * @param enableXOF - whether XOF output is allowed - * @param rounds - number of Keccak-f rounds - * @example - * Build a sponge state, absorb bytes, then finalize a digest. - * ```ts - * const hash = new Keccak(136, 0x06, 32); - * hash.update(new Uint8Array([1, 2, 3])); - * hash.digest(); - * ``` - */ -class Keccak { - state; - pos = 0; - posOut = 0; - finished = false; - state32; - destroyed = false; - blockLen; - suffix; - outputLen; - canXOF; - enableXOF = false; - rounds; - // NOTE: we accept arguments in bytes instead of bits here. - constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) { - anumber(blockLen, 'blockLen'); - anumber(suffix, 'suffix'); - anumber(rounds, 'rounds'); - abool(enableXOF, 'enableXOF'); - this.blockLen = blockLen; - this.suffix = suffix; - this.outputLen = outputLen; - this.enableXOF = enableXOF; - this.canXOF = enableXOF; - this.rounds = rounds; - // Can be passed from user as dkLen - anumber(outputLen, 'outputLen'); - // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state. - if (!(0 < blockLen && blockLen < 200)) - throw new Error('"blockLen" must be 1..199'); - this.state = new Uint8Array(200); - this.state32 = u32(this.state); - } - clone() { - return this._cloneInto(); - } - keccak() { - swap32IfBE(this.state32); - keccakP(this.state32, this.rounds); - swap32IfBE(this.state32); - this.posOut = 0; - this.pos = 0; - } - update(data) { - aexists(this); - abytes(data); - const { blockLen, state, state32 } = this; - const len = data.length; - // Absorb full blocks with u32 XORs when both sides are 4-byte aligned. - // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe. - const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0; - const blockLen32 = blockLen / 4; - const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined; - for (let pos = 0; pos < len;) { - if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) { - for (let i = 0, o = pos / 4; i < blockLen32; i++) - state32[i] ^= data32[o + i]; - pos += blockLen; - // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override, - // so it must reflect the fully-absorbed block before the permutation fires. - this.pos = blockLen; - this.keccak(); - continue; - } - const take = Math.min(blockLen - this.pos, len - pos); - for (let i = 0; i < take; i++) - state[this.pos++] ^= data[pos++]; - if (this.pos === blockLen) - this.keccak(); - } - return this; - } - finish() { - if (this.finished) - return; - this.finished = true; - const { state, suffix, pos, blockLen } = this; - // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1. - // These byte values already include the first padding bit, while the - // final `0x80` below supplies the closing `1` bit in the last rate byte. - state[pos] ^= suffix; - // If that combined suffix lands in the last rate byte and already sets - // bit 7, absorb it first so the final pad10*1 bit can be xored into a - // fresh block. - if ((suffix & 0x80) !== 0 && pos === blockLen - 1) - this.keccak(); - state[blockLen - 1] ^= 0x80; - this.keccak(); - } - writeInto(out) { - aexists(this, false); - abytes(out); - this.finish(); - const bufferOut = this.state; - const { blockLen } = this; - for (let pos = 0, len = out.length; pos < len;) { - if (this.posOut >= blockLen) - this.keccak(); - const take = Math.min(blockLen - this.posOut, len - pos); - out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos); - this.posOut += take; - pos += take; - } - return out; - } - xofInto(out) { - // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base - // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/ - // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF. - if (!this.enableXOF) - throw new Error('XOF is not enabled'); - return this.writeInto(out); - } - xof(bytes) { - anumber(bytes); - return this.xofInto(new Uint8Array(bytes)); - } - digestInto(out) { - aoutput(out, this); - if (this.finished) - throw new Error('digest() was already called'); - // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest. - this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen)); - this.destroy(); - } - digest() { - const out = new Uint8Array(this.outputLen); - this.digestInto(out); - return out; - } - destroy() { - this.destroyed = true; - clean(this.state); - } - _cloneInto(to) { - const { blockLen, suffix, outputLen, rounds, enableXOF } = this; - to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds); - // Reused destinations can come from a different rate/capacity variant, so clone must rewrite - // the sponge geometry as well as the state words. - to.blockLen = blockLen; - to.state32.set(this.state32); - // Sponge padding and XOF output are positional, so both offsets are part of the clone state. - to.pos = this.pos; - to.posOut = this.posOut; - to.finished = this.finished; - to.rounds = rounds; - // Suffix can change in cSHAKE - to.suffix = suffix; - to.outputLen = outputLen; - to.enableXOF = enableXOF; - // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone - // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie. - to.canXOF = this.canXOF; - to.destroyed = this.destroyed; - return to; - } -} -const genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info); -/** - * SHA3-256 hash function. Different from keccak-256. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA3-256. - * ```ts - * sha3_256(new Uint8Array([97, 98, 99])); - * ``` - */ -const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, -/* @__PURE__ */ oidNist(0x08)); -/** - * SHA3-512 hash function. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA3-512. - * ```ts - * sha3_512(new Uint8Array([97, 98, 99])); - * ``` - */ -const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, -/* @__PURE__ */ oidNist(0x0a)); -/** - * Keccak-256 hash function. Different from SHA3-256. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with Keccak-256. - * ```ts - * keccak_256(new Uint8Array([97, 98, 99])); - * ``` - */ -const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32); - -let _permanentCensorErrors = false; -let _censorErrors = false; -const LogLevels = { - debug: 1, - default: 2, - info: 2, - warning: 3, - error: 4, - off: 5, -}; -let _logLevel = LogLevels["default"]; -let _globalLogger = null; -function _checkNormalize() { - try { - const missing = []; - // Make sure all forms of normalization are supported - ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { - try { - if ("test".normalize(form) !== "test") { - throw new Error("bad normalize"); - } - } - catch (error) { - missing.push(form); - } - }); - if (missing.length) { - throw new Error("missing " + missing.join(", ")); - } - if (String.fromCharCode(0xe9).normalize("NFD") !== - String.fromCharCode(0x65, 0x0301)) { - throw new Error("broken implementation"); - } - } - catch (error) { - return error.message; - } - return null; -} -const _normalizeError = _checkNormalize(); -var LogLevel; -(function (LogLevel) { - LogLevel["DEBUG"] = "DEBUG"; - LogLevel["INFO"] = "INFO"; - LogLevel["WARNING"] = "WARNING"; - LogLevel["ERROR"] = "ERROR"; - LogLevel["OFF"] = "OFF"; -})(LogLevel || (LogLevel = {})); -var ErrorCode; -(function (ErrorCode) { - /////////////////// - // Generic Errors - // Unknown Error - ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR"; - // Not Implemented - ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED"; - // Unsupported Operation - // - operation - ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION"; - // Network Error (i.e. Core Network, such as an invalid network ID) - // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) - ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR"; - // Some sort of bad response from the server - ErrorCode["SERVER_ERROR"] = "SERVER_ERROR"; - // Timeout - ErrorCode["TIMEOUT"] = "TIMEOUT"; - /////////////////// - // Operational Errors - // Buffer Overrun - ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN"; - // Numeric Fault - // - operation: the operation being executed - // - fault: the reason this faulted - ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT"; - /////////////////// - // Argument Errors - // Missing new operator to an object - // - name: The name of the class - ErrorCode["MISSING_NEW"] = "MISSING_NEW"; - // Invalid argument (e.g. value is incompatible with type) to a function: - // - argument: The argument name that was invalid - // - value: The value of the argument - ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT"; - // Missing argument to a function: - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT"; - // Too many arguments - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT"; - /////////////////// - // Blockchain Errors - // Call exception - // - transaction: the transaction - // - address?: the contract address - // - args?: The arguments passed into the function - // - method?: The Solidity method signature - // - errorSignature?: The EIP848 error signature - // - errorArgs?: The EIP848 error parameters - // - reason: The reason (only for EIP848 "Error(string)") - ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION"; - // Insufficient funds (< value + energyLimit * energyPrice) - // - transaction: the transaction attempted - ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS"; - // Nonce has already been used - // - transaction: the transaction attempted - ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED"; - // The replacement fee for the transaction is too low - // - transaction: the transaction attempted - ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED"; - // The energy limit could not be estimated - // - transaction: the transaction passed to estimateEnergy - ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"] = "UNPREDICTABLE_ENERGY_LIMIT"; - // The transaction was replaced by one with a higher energy price - // - reason: "cancelled", "replaced" or "repriced" - // - cancelled: true if reason == "cancelled" or reason == "replaced") - // - hash: original transaction hash - // - replacement: the full TransactionsResponse for the replacement - // - receipt: the receipt of the replacement - ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; -})(ErrorCode || (ErrorCode = {})); -const HEX = "0123456789abcdef"; -class Logger { - version = "0.0.1"; - static errors = ErrorCode; - static levels = LogLevel; - constructor(version) { - Object.defineProperty(this, "version", { - enumerable: true, - value: version, - writable: false, - }); - } - _log(logLevel, args) { - const level = logLevel.toLowerCase(); - if (LogLevels[level] == null) { - this.throwArgumentError("invalid log level name", "logLevel", logLevel); - } - if (_logLevel > LogLevels[level]) { - return; - } - console.log.apply(console, args); - } - debug(...args) { - this._log(Logger.levels.DEBUG, args); - } - info(...args) { - this._log(Logger.levels.INFO, args); - } - warn(...args) { - this._log(Logger.levels.WARNING, args); - } - makeError(message, code, params) { - // Errors are being censored - if (_censorErrors) { - return this.makeError("censored error", code, {}); - } - if (!code) { - code = Logger.errors.UNKNOWN_ERROR; - } - if (!params) { - params = {}; - } - const messageDetails = []; - Object.keys(params).forEach((key) => { - const value = params[key]; - try { - if (value instanceof Uint8Array) { - let hex = ""; - for (let i = 0; i < value.length; i++) { - hex += HEX[value[i] >> 4]; - hex += HEX[value[i] & 0x0f]; - } - messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); - } - else { - messageDetails.push(key + "=" + JSON.stringify(value)); - } - } - catch (error) { - messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); - } - }); - messageDetails.push(`code=${code}`); - messageDetails.push(`version=${this.version}`); - const reason = message; - if (messageDetails.length) { - message += " (" + messageDetails.join(", ") + ")"; - } - // @TODO: Any?? - const error = new Error(message); - error.reason = reason; - error.code = code; - Object.keys(params).forEach(function (key) { - error[key] = params[key]; - }); - return error; - } - throwError(message, code, params) { - throw this.makeError(message, code, params); - } - throwArgumentError(message, name, value) { - return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { - argument: name, - value: value, - }); - } - assert(condition, message, code, params) { - if (!!condition) { - return; - } - this.throwError(message, code, params); - } - assertArgument(condition, message, name, value) { - if (!!condition) { - return; - } - this.throwArgumentError(message, name, value); - } - checkNormalize(message) { - if (_normalizeError) { - this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "String.prototype.normalize", - form: _normalizeError, - }); - } - } - checkSafeUint53(value, message) { - if (typeof value !== "number") { - return; - } - if (message == null) { - message = "value not safe"; - } - if (value < 0 || value >= 0x1fffffffffffff) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "out-of-safe-range", - value: value, - }); - } - if (value % 1) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "non-integer", - value: value, - }); - } - } - checkArgumentCount(count, expectedCount, message) { - if (message) { - message = ": " + message; - } - else { - message = ""; - } - if (count < expectedCount) { - this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - if (count > expectedCount) { - this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - } - checkNew(target, kind) { - if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - checkAbstract(target, kind) { - if (target === kind) { - this.throwError("cannot instantiate abstract class " + - JSON.stringify(kind.name) + - " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }); - } - else if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - static globalLogger() { - if (!_globalLogger) { - _globalLogger = new Logger("logger/0.0.1"); - } - return _globalLogger; - } - static setCensorship(censorship, permanent) { - if (!censorship && permanent) { - this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - if (_permanentCensorErrors) { - if (!censorship) { - return; - } - this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - _censorErrors = !!censorship; - _permanentCensorErrors = !!permanent; - } - static setLogLevel(logLevel) { - const level = LogLevels[logLevel.toLowerCase()]; - if (level == null) { - Logger.globalLogger().warn("invalid log level - " + logLevel); - return; - } - _logLevel = level; - } - static from(version) { - return new Logger(version); - } -} - -/** The current version of corebc; keep in sync with package.json. */ -const version = "0.4.1"; - -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - Object.defineProperty(target, key, { - enumerable: true, - value, - writable: false, - }); - } -} - -/** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -function stringify(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[ " + value.map(stringify).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return stringify(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "number": - return value.toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{ " + - keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(", ") + - " }"); - } - } - return `[ COULD NOT SERIALIZE ]`; -} -/** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ -function makeError(message, code, info) { - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify(info)}`); - } - for (const key in info) { - const value = info[key]; - // try { - details.push(key + "=" + stringify(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - return error; -} -/** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } -} -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} -["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; -}, []); - -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -const logger = new Logger("utils/data/0.0.1"); -function isHexable(value) { - return !!value.toHexString; -} -function isInteger(value) { - return typeof value === "number" && value == value && value % 1 === 0; -} -function isBytes(value) { - if (value == null) { - return false; - } - if (value.constructor === Uint8Array) { - return true; - } - if (typeof value === "string") { - return false; - } - if (!isInteger(value.length) || value.length < 0) { - return false; - } - for (let i = 0; i < value.length; i++) { - const v = value[i]; - if (!isInteger(v) || v < 0 || v >= 256) { - return false; - } - } - return true; -} -function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - return value; - } - if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); -} -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -function getBytes(value, name) { - return _getBytes(value, name); -} -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -function isHexString(value, length) { - if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - return true; -} -const HexCharacters = "0123456789abcdef"; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -function hexlify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "string") { - if (value.includes(",") && value.startsWith("0x")) { - const v = value - .replace("0x", "") - .split(",") - .map((item) => Number(item)); - // @ts-ignore - value = new Uint8Array(v); - } - } - if (typeof value === "number") { - logger.checkSafeUint53(value, "invalid hexlify value"); - let hex = ""; - while (value) { - hex = HexCharacters[value & 0xf] + hex; - value = Math.floor(value / 16); - } - if (hex.length) { - if (hex.length % 2) { - hex = "0" + hex; - } - return "0x" + hex; - } - return "0x00"; - } - if (typeof value === "bigint") { - value = value.toString(16); - if (value.length % 2) { - return "0x0" + value; - } - return "0x" + value; - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - return value.toHexString(); - } - if (isHexString(value)) { - if (value.length % 2) { - if (options.hexPad === "left") { - value = "0x0" + value.substring(2); - } - else if (options.hexPad === "right") { - value += "0"; - } - else { - logger.throwArgumentError("hex data is odd-length", "value", value); - } - } - return value.toLowerCase(); - } - if (isBytes(value)) { - let result = "0x"; - for (let i = 0; i < value.length; i++) { - let v = value[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; - } - return logger.throwArgumentError("invalid hexlify value", "value", value); -} - -/** - * Using strings in Core (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ -function errorFunc(reason, offset, bytes, output, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); -} -function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; -} -function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes); -} -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc, -}); -// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 -function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; -} -// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8Bytes(str, form) { - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); -} -//export -function _toUtf8String(codePoints) { - return codePoints - .map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00); - }) - .join(""); -} -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); -} - -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -let locked = false; -const _keccak256 = function (data) { - return keccak_256(data); -}; -let __keccak256 = _keccak256; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -function keccak256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); -} -keccak256._ = _keccak256; -keccak256.lock = function () { - locked = true; -}; -keccak256.register = function (func) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; -}; -Object.freeze(keccak256); - -/** - * Internal Merkle-Damgard hash utils. - * @module - */ -/** - * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`. - * Returns bits from `b` when `a` is set, otherwise from `c`. - * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never - * set the same bit. - * @param a - selector word - * @param b - word chosen when selector bit is set - * @param c - word chosen when selector bit is clear - * @returns Mixed 32-bit word. - * @example - * Combine three words with the shared 32-bit choice primitive. - * ```ts - * Chi(0xffffffff, 0x12345678, 0x87654321); - * ``` - */ -function Chi(a, b, c) { - return (a & b) ^ (~a & c); -} -/** - * Shared 32-bit majority primitive reused by SHA-256 and SHA-1. - * Returns bits shared by at least two inputs. - * @param a - first input word - * @param b - second input word - * @param c - third input word - * @returns Mixed 32-bit word. - * @example - * Combine three words with the shared 32-bit majority primitive. - * ```ts - * Maj(0xffffffff, 0x12345678, 0x87654321); - * ``` - */ -function Maj(a, b, c) { - return (a & b) ^ (a & c) ^ (b & c); -} -/** - * Merkle-Damgard hash construction base class. - * Could be used to create MD5, RIPEMD, SHA1, SHA2. - * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit - * strings with partial-byte tails. - * @param blockLen - internal block size in bytes - * @param outputLen - digest size in bytes - * @param padOffset - trailing length field size in bytes - * @param isLE - whether length and state words are encoded in little-endian - * @example - * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow. - * ```ts - * import { _SHA1 } from '@noble/hashes/legacy.js'; - * const hash = new _SHA1(); - * hash.update(new Uint8Array([97, 98, 99])); - * hash.digest(); - * ``` - */ -class HashMD { - blockLen; - outputLen; - canXOF = false; - padOffset; - isLE; - // For partial updates less than block size - buffer; - view; - finished = false; - length = 0; - pos = 0; - destroyed = false; - constructor(blockLen, outputLen, padOffset, isLE) { - this.blockLen = blockLen; - this.outputLen = outputLen; - this.padOffset = padOffset; - this.isLE = isLE; - this.buffer = new Uint8Array(blockLen); - this.view = createView(this.buffer); - } - update(data) { - aexists(this); - abytes(data); - const { view, buffer, blockLen } = this; - const len = data.length; - let processed = false; - for (let pos = 0; pos < len;) { - const take = Math.min(blockLen - this.pos, len - pos); - // Fast path only when there is no buffered partial block: `take === blockLen` implies - // `this.pos === 0`, so we can process full blocks directly from the input view. - if (take === blockLen) { - const dataView = createView(data); - for (; blockLen <= len - pos; pos += blockLen) - this.process(dataView, pos); - processed = true; - continue; - } - // When the whole input is buffered in one go (common for short messages), passing `data` - // directly avoids allocating a subarray view. - buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos); - this.pos += take; - pos += take; - if (this.pos === blockLen) { - this.process(view, 0); - this.pos = 0; - processed = true; - } - } - this.length += data.length; - // Shared schedule buffers only pick up input-derived words inside process(); if everything - // was buffered without processing, there is nothing to zero. - if (processed) - this.roundClean(); - return this; - } - digestInto(out) { - aexists(this); - aoutput(out, this); - this.finished = true; - // Padding - // We can avoid allocation of buffer for padding completely if it - // was previously not allocated here. But it won't change performance. - const { buffer, view, blockLen, isLE } = this; - let { pos } = this; - // append the bit '1' to the message, then zero-pad the rest of the block - buffer[pos++] = 0b10000000; - buffer.fill(0, pos); - // we have less than padOffset left in buffer, so we cannot put length in - // current block, need process it and pad again - if (this.padOffset > blockLen - pos) { - this.process(view, 0); - buffer.fill(0); - } - // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from - // the padding fill above, and JS will overflow before user input can make that half non-zero. - // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an - // integer below 2**53, so the split inside the helper stays exact). - setU64FromNum(view, blockLen - 8, this.length * 8, isLE); - this.process(view, 0); - // The final block above is processed outside update(), so the shared message-schedule - // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest(). - this.roundClean(); - // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one. - const oview = out === buffer ? view : createView(out); - const len = this.outputLen; - // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT - const outLen = len / 4; - const state = this.get(); - // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state. - if (len % 4 || outLen > state.length) - throw new Error('invalid outputLen'); - for (let i = 0; i < outLen; i++) - oview.setUint32(4 * i, state[i], isLE); - } - digest() { - const { buffer, outputLen } = this; - this.digestInto(buffer); - // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return - // fresh bytes to the caller. - const res = buffer.slice(0, outputLen); - this.destroy(); - return res; - } - _cloneIntoMeta(to) { - const { buffer, length, finished, destroyed, pos } = this; - to.destroyed = destroyed; - to.finished = finished; - to.length = length; - to.pos = pos; - // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and - // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it. - if (pos) - to.buffer.set(buffer); // Avoid a hot modulo guard. - return to; - } - clone() { - return this._cloneInto(); - } -} -/** - * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53. - * Check out `test/misc/sha2-gen-iv.js` for recomputation guide. - */ -/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the - * square roots of the first eight prime numbers. Exported as a shared table; callers must treat - * it as read-only because constructors copy words from it by index. */ -const SHA256_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, -]); -/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen - * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first - * eight prime numbers. Exported as a shared table; callers must treat it as read-only because - * constructors copy halves from it by index. */ -const SHA512_IV = /* @__PURE__ */ Uint32Array.from([ - 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, - 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179, -]); - -/** - -SHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions. -RFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors, -not the base RIPEMD-160 compression spec. -Don't use them in a new protocol. What "weak" means: - -- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160. -- No practical pre-image attacks (only theoretical, 2^123.4) -- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151 - * @module - */ -// RIPEMD-160 -// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables. -const Rho160 = /* @__PURE__ */ Uint8Array.from([ - 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, -]); -const Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))(); -const Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))(); -// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds. -const idxLR = /* @__PURE__ */ (() => { - const L = [Id160]; - const R = [Pi160]; - const res = [L, R]; - for (let i = 0; i < 4; i++) - for (let j of res) - j.push(j[i].map((k) => Rho160[k])); - return res; -})(); -const idxL = /* @__PURE__ */ (() => idxLR[0])(); -const idxR = /* @__PURE__ */ (() => idxLR[1])(); -// const [idxL, idxR] = idxLR; -// Base per-group shift table before the left/right message-order permutations are applied. -const shifts160 = /* @__PURE__ */ [ - [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8], - [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7], - [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9], - [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6], - [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5], -].map((i) => Uint8Array.from(i)); -const shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j])); -const shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j])); -// Five left-lane additive constants for RIPEMD-160. -const Kl160 = /* @__PURE__ */ Uint32Array.from([ - 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e, -]); -// Five right-lane additive constants for RIPEMD-160. -const Kr160 = /* @__PURE__ */ Uint32Array.from([ - 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000, -]); -// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range -// inputs currently fall through to the group-4 branch. -function ripemd_f(group, x, y, z) { - if (group === 0) - return x ^ y ^ z; - if (group === 1) - return (x & y) | (~x & z); - if (group === 2) - return (x | ~y) ^ z; - if (group === 3) - return (x & z) | (y & ~z); - return x ^ (y | ~z); -} -// Reusable 16-word RIPEMD-160 message block buffer. -const BUF_160 = /* @__PURE__ */ new Uint32Array(16); -/** - * Internal RIPEMD-160 legacy hash class. - * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification. - */ -class _RIPEMD160 extends HashMD { - h0 = 0x67452301 | 0; - h1 = 0xefcdab89 | 0; - h2 = 0x98badcfe | 0; - h3 = 0x10325476 | 0; - h4 = 0xc3d2e1f0 | 0; - constructor() { - super(64, 20, 8, true); - } - get() { - const { h0, h1, h2, h3, h4 } = this; - return [h0, h1, h2, h3, h4]; - } - set(h0, h1, h2, h3, h4) { - this.h0 = h0 | 0; - this.h1 = h1 | 0; - this.h2 = h2 | 0; - this.h3 = h3 | 0; - this.h4 = h4 | 0; - } - _cloneInto(to) { - (to ||= new this.constructor()).set(...this.get()); - return this._cloneIntoMeta(to); - } - process(view, offset) { - for (let i = 0; i < 16; i++, offset += 4) - BUF_160[i] = view.getUint32(offset, true); - // prettier-ignore - let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el; - // Instead of iterating 0 to 80, we split it into 5 groups - // And use the groups in constants, functions, etc. Much simpler - for (let group = 0; group < 5; group++) { - const rGroup = 4 - group; - const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore - const rl = idxL[group], rr = idxR[group]; // prettier-ignore - const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore - for (let i = 0; i < 16; i++) { - const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0; - al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore - } - // 2 loops are 10% faster - for (let i = 0; i < 16; i++) { - const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0; - ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore - } - } - // Add the compressed chunk to the current hash value - // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order. - this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0); - } - roundClean() { - clean(BUF_160); - } - destroy() { - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0); - } -} -/** - * RIPEMD-160 - a legacy hash function from 1990s. - * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point - * at the base RIPEMD-160 references. - * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html} - * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf} - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with RIPEMD-160. - * ```ts - * ripemd160(new Uint8Array([97, 98, 99])); - * ``` - */ -const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160()); - -/** - * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256. - * SHA256 is the fastest hash implementable in JS, even faster than Blake3. - * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and - * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}. - * @module - */ -/** - * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits - * of the cube roots of the first 64 primes (2..311). - */ -// prettier-ignore -const SHA256_K = /* @__PURE__ */ Uint32Array.from([ - 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, - 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, - 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, - 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, - 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, - 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, - 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, - 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 -]); -/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */ -const SHA256_W = /* @__PURE__ */ new Uint32Array(64); -/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */ -class SHA2_32B extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // Numeric initializers matter: starting the fields as `undefined` changes - // V8's field representation and makes sha256 3x slower (measured). - A = 0; - B = 0; - C = 0; - D = 0; - E = 0; - F = 0; - G = 0; - H = 0; - constructor(outputLen, IV) { - super(64, outputLen, 8, false); - this.A = IV[0] | 0; - this.B = IV[1] | 0; - this.C = IV[2] | 0; - this.D = IV[3] | 0; - this.E = IV[4] | 0; - this.F = IV[5] | 0; - this.G = IV[6] | 0; - this.H = IV[7] | 0; - } - get() { - const { A, B, C, D, E, F, G, H } = this; - return [A, B, C, D, E, F, G, H]; - } - // prettier-ignore - set(A, B, C, D, E, F, G, H) { - this.A = A | 0; - this.B = B | 0; - this.C = C | 0; - this.D = D | 0; - this.E = E | 0; - this.F = F | 0; - this.G = G | 0; - this.H = H | 0; - } - _cloneInto(to) { - (to ||= new this.constructor()).set(...this.get()); - return this._cloneIntoMeta(to); - } - process(view, offset) { - // Extend the first 16 words into the remaining 48 words w[16..63] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) - SHA256_W[i] = view.getUint32(offset, false); - for (let i = 16; i < 64; i++) { - const W15 = SHA256_W[i - 15]; - const W2 = SHA256_W[i - 2]; - const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ (W15 >>> 3); - const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ (W2 >>> 10); - SHA256_W[i] = (s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16]) | 0; - } - // Compression function main loop, 64 rounds - let { A, B, C, D, E, F, G, H } = this; - for (let i = 0; i < 64; i++) { - const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25); - const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22); - const T2 = (sigma0 + Maj(A, B, C)) | 0; - H = G; - G = F; - F = E; - E = (D + T1) | 0; - D = C; - C = B; - B = A; - A = (T1 + T2) | 0; - } - // Add the compressed chunk to the current hash value - A = (A + this.A) | 0; - B = (B + this.B) | 0; - C = (C + this.C) | 0; - D = (D + this.D) | 0; - E = (E + this.E) | 0; - F = (F + this.F) | 0; - G = (G + this.G) | 0; - H = (H + this.H) | 0; - this.set(A, B, C, D, E, F, G, H); - } - roundClean() { - clean(SHA256_W); - } - destroy() { - // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves - // update()/digest() callable on reused instances. - this.destroyed = true; - this.set(0, 0, 0, 0, 0, 0, 0, 0); - clean(this.buffer); - } -} -/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */ -class _SHA256 extends SHA2_32B { - constructor() { - super(32, SHA256_IV); - } -} -// SHA2-512 is slower than sha256 in js because u64 operations are slow. -// SHA-384 / SHA-512 round constants from RFC 6234 §5.2: -// 80 full 64-bit words split into high/low halves. -// prettier-ignore -const K512 = /* @__PURE__ */ (() => split([ - '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc', - '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118', - '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2', - '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694', - '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65', - '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5', - '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4', - '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70', - '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df', - '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b', - '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30', - '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8', - '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8', - '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3', - '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec', - '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b', - '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178', - '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b', - '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c', - '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817' -].map(n => BigInt(n))))(); -const SHA512_Kh = /* @__PURE__ */ (() => K512[0])(); -const SHA512_Kl = /* @__PURE__ */ (() => K512[1])(); -// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. -const SHA512_W_H = /* @__PURE__ */ new Uint32Array(80); -// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words. -const SHA512_W_L = /* @__PURE__ */ new Uint32Array(80); -/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */ -class SHA2_64B extends HashMD { - // We cannot use array here since array allows indexing by variable - // which means optimizer/compiler cannot use registers. - // h -- high 32 bits, l -- low 32 bits - // Numeric initializers matter: starting the fields as `undefined` changes - // V8's field representation and slows hashing down (measured on sha256). - Ah = 0; - Al = 0; - Bh = 0; - Bl = 0; - Ch = 0; - Cl = 0; - Dh = 0; - Dl = 0; - Eh = 0; - El = 0; - Fh = 0; - Fl = 0; - Gh = 0; - Gl = 0; - Hh = 0; - Hl = 0; - constructor(outputLen, IV) { - super(128, outputLen, 16, false); - this.Ah = IV[0] | 0; - this.Al = IV[1] | 0; - this.Bh = IV[2] | 0; - this.Bl = IV[3] | 0; - this.Ch = IV[4] | 0; - this.Cl = IV[5] | 0; - this.Dh = IV[6] | 0; - this.Dl = IV[7] | 0; - this.Eh = IV[8] | 0; - this.El = IV[9] | 0; - this.Fh = IV[10] | 0; - this.Fl = IV[11] | 0; - this.Gh = IV[12] | 0; - this.Gl = IV[13] | 0; - this.Hh = IV[14] | 0; - this.Hl = IV[15] | 0; - } - // prettier-ignore - get() { - const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl]; - } - // prettier-ignore - set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) { - this.Ah = Ah | 0; - this.Al = Al | 0; - this.Bh = Bh | 0; - this.Bl = Bl | 0; - this.Ch = Ch | 0; - this.Cl = Cl | 0; - this.Dh = Dh | 0; - this.Dl = Dl | 0; - this.Eh = Eh | 0; - this.El = El | 0; - this.Fh = Fh | 0; - this.Fl = Fl | 0; - this.Gh = Gh | 0; - this.Gl = Gl | 0; - this.Hh = Hh | 0; - this.Hl = Hl | 0; - } - _cloneInto(to) { - (to ||= new this.constructor()).set(...this.get()); - return this._cloneIntoMeta(to); - } - process(view, offset) { - // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array - for (let i = 0; i < 16; i++, offset += 4) { - SHA512_W_H[i] = view.getUint32(offset); - SHA512_W_L[i] = view.getUint32((offset += 4)); - } - for (let i = 16; i < 80; i++) { - // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7) - const W15h = SHA512_W_H[i - 15] | 0; - const W15l = SHA512_W_L[i - 15] | 0; - const s0h = rotrSH(W15h, W15l, 1) ^ rotrSH(W15h, W15l, 8) ^ shrSH(W15h, W15l, 7); - const s0l = rotrSL(W15h, W15l, 1) ^ rotrSL(W15h, W15l, 8) ^ shrSL(W15h, W15l, 7); - // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6) - const W2h = SHA512_W_H[i - 2] | 0; - const W2l = SHA512_W_L[i - 2] | 0; - const s1h = rotrSH(W2h, W2l, 19) ^ rotrBH(W2h, W2l, 61) ^ shrSH(W2h, W2l, 6); - const s1l = rotrSL(W2h, W2l, 19) ^ rotrBL(W2h, W2l, 61) ^ shrSL(W2h, W2l, 6); - // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16]; - const SUMl = add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]); - const SUMh = add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]); - SHA512_W_H[i] = SUMh | 0; - SHA512_W_L[i] = SUMl | 0; - } - let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this; - // Compression function main loop, 80 rounds - for (let i = 0; i < 80; i++) { - // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41) - const sigma1h = rotrSH(Eh, El, 14) ^ rotrSH(Eh, El, 18) ^ rotrBH(Eh, El, 41); - const sigma1l = rotrSL(Eh, El, 14) ^ rotrSL(Eh, El, 18) ^ rotrBL(Eh, El, 41); - //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0; - const CHIh = (Eh & Fh) ^ (~Eh & Gh); - const CHIl = (El & Fl) ^ (~El & Gl); - // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i] - // prettier-ignore - const T1ll = add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]); - const T1h = add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]); - const T1l = T1ll | 0; - // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39) - const sigma0h = rotrSH(Ah, Al, 28) ^ rotrBH(Ah, Al, 34) ^ rotrBH(Ah, Al, 39); - const sigma0l = rotrSL(Ah, Al, 28) ^ rotrBL(Ah, Al, 34) ^ rotrBL(Ah, Al, 39); - const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch); - const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl); - Hh = Gh | 0; - Hl = Gl | 0; - Gh = Fh | 0; - Gl = Fl | 0; - Fh = Eh | 0; - Fl = El | 0; - ({ h: Eh, l: El } = add(Dh | 0, Dl | 0, T1h | 0, T1l | 0)); - Dh = Ch | 0; - Dl = Cl | 0; - Ch = Bh | 0; - Cl = Bl | 0; - Bh = Ah | 0; - Bl = Al | 0; - const All = add3L(T1l, sigma0l, MAJl); - Ah = add3H(All, T1h, sigma0h, MAJh); - Al = All | 0; - } - // Add the compressed chunk to the current hash value - ({ h: Ah, l: Al } = add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0)); - ({ h: Bh, l: Bl } = add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0)); - ({ h: Ch, l: Cl } = add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0)); - ({ h: Dh, l: Dl } = add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0)); - ({ h: Eh, l: El } = add(this.Eh | 0, this.El | 0, Eh | 0, El | 0)); - ({ h: Fh, l: Fl } = add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0)); - ({ h: Gh, l: Gl } = add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0)); - ({ h: Hh, l: Hl } = add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0)); - this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl); - } - roundClean() { - clean(SHA512_W_H, SHA512_W_L); - } - destroy() { - // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves - // update()/digest() callable on reused instances. - this.destroyed = true; - clean(this.buffer); - this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); - } -} -/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */ -class _SHA512 extends SHA2_64B { - constructor() { - super(64, SHA512_IV); - } -} -/** - * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info: - * - * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack. - * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025. - * - Each sha256 hash is executing 2^18 bit operations. - * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA2-256. - * ```ts - * sha256(new Uint8Array([97, 98, 99])); - * ``` - */ -const sha256$1 = /* @__PURE__ */ createHasher(() => new _SHA256(), -/* @__PURE__ */ oidNist(0x01)); -/** - * SHA2-512 hash function from RFC 4634. - * @param msg - message bytes to hash - * @param opts - Reserved hash options. - * @returns Digest bytes. - * @example - * Hash a message with SHA2-512. - * ```ts - * sha512(new Uint8Array([97, 98, 99])); - * ``` - */ -const sha512$1 = /* @__PURE__ */ createHasher(() => new _SHA512(), -/* @__PURE__ */ oidNist(0x03)); - -var buffer = {}; - -var base64Js = {}; - -var hasRequiredBase64Js; - -function requireBase64Js () { - if (hasRequiredBase64Js) return base64Js; - hasRequiredBase64Js = 1; - - base64Js.byteLength = byteLength; - base64Js.toByteArray = toByteArray; - base64Js.fromByteArray = fromByteArray; - - var lookup = []; - var revLookup = []; - var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; - - var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } - - // Support decoding URL-safe base64 strings, as Node.js does. - // See: https://en.wikipedia.org/wiki/Base64#URL_applications - revLookup['-'.charCodeAt(0)] = 62; - revLookup['_'.charCodeAt(0)] = 63; - - function getLens (b64) { - var len = b64.length; - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('='); - if (validLen === -1) validLen = len; - - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4); - - return [validLen, placeHoldersLen] - } - - // base64 is 4/3 + up to two characters of the original data - function byteLength (b64) { - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen - } - - function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen - } - - function toByteArray (b64) { - var tmp; - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); - - var curByte = 0; - - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen; - - var i; - for (i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)]; - arr[curByte++] = (tmp >> 16) & 0xFF; - arr[curByte++] = (tmp >> 8) & 0xFF; - arr[curByte++] = tmp & 0xFF; - } - - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4); - arr[curByte++] = tmp & 0xFF; - } - - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2); - arr[curByte++] = (tmp >> 8) & 0xFF; - arr[curByte++] = tmp & 0xFF; - } - - return arr - } - - function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] - } - - function encodeChunk (uint8, start, end) { - var tmp; - var output = []; - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF); - output.push(tripletToBase64(tmp)); - } - return output.join('') - } - - function fromByteArray (uint8) { - var tmp; - var len = uint8.length; - var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes - var parts = []; - var maxChunkLength = 16383; // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))); - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1]; - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ); - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1]; - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ); - } - - return parts.join('') - } - return base64Js; -} - -var ieee754 = {}; - -/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ - -var hasRequiredIeee754; - -function requireIeee754 () { - if (hasRequiredIeee754) return ieee754; - hasRequiredIeee754 = 1; - ieee754.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = (nBytes * 8) - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? (nBytes - 1) : 0; - var d = isLE ? -1 : 1; - var s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) - }; - - ieee754.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = (nBytes * 8) - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); - var i = isLE ? 0 : (nBytes - 1); - var d = isLE ? 1 : -1; - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; - - value = Math.abs(value); - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128; - }; - return ieee754; -} - -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ - -var hasRequiredBuffer; - -function requireBuffer () { - if (hasRequiredBuffer) return buffer; - hasRequiredBuffer = 1; - (function (exports) { - - const base64 = requireBase64Js(); - const ieee754 = requireIeee754(); - const customInspectSymbol = - (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation - ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation - : null; - - exports.Buffer = Buffer; - exports.SlowBuffer = SlowBuffer; - exports.INSPECT_MAX_BYTES = 50; - - const K_MAX_LENGTH = 0x7fffffff; - exports.kMaxLength = K_MAX_LENGTH; - - /** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Print warning and recommend using `buffer` v4.x which has an Object - * implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * We report that the browser does not support typed arrays if the are not subclassable - * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` - * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support - * for __proto__ and has a buggy typed array implementation. - */ - Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); - - if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && - typeof console.error === 'function') { - console.error( - 'This browser lacks typed array (Uint8Array) support which is required by ' + - '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' - ); - } - - function typedArraySupport () { - // Can typed array instances can be augmented? - try { - const arr = new Uint8Array(1); - const proto = { foo: function () { return 42 } }; - Object.setPrototypeOf(proto, Uint8Array.prototype); - Object.setPrototypeOf(arr, proto); - return arr.foo() === 42 - } catch (e) { - return false - } - } - - Object.defineProperty(Buffer.prototype, 'parent', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.buffer - } - }); - - Object.defineProperty(Buffer.prototype, 'offset', { - enumerable: true, - get: function () { - if (!Buffer.isBuffer(this)) return undefined - return this.byteOffset - } - }); - - function createBuffer (length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"') - } - // Return an augmented `Uint8Array` instance - const buf = new Uint8Array(length); - Object.setPrototypeOf(buf, Buffer.prototype); - return buf - } - - /** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - - function Buffer (arg, encodingOrOffset, length) { - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new TypeError( - 'The "string" argument must be of type string. Received type number' - ) - } - return allocUnsafe(arg) - } - return from(arg, encodingOrOffset, length) - } - - Buffer.poolSize = 8192; // not used by this implementation - - function from (value, encodingOrOffset, length) { - if (typeof value === 'string') { - return fromString(value, encodingOrOffset) - } - - if (ArrayBuffer.isView(value)) { - return fromArrayView(value) - } - - if (value == null) { - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) - } - - if (isInstance(value, ArrayBuffer) || - (value && isInstance(value.buffer, ArrayBuffer))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof SharedArrayBuffer !== 'undefined' && - (isInstance(value, SharedArrayBuffer) || - (value && isInstance(value.buffer, SharedArrayBuffer)))) { - return fromArrayBuffer(value, encodingOrOffset, length) - } - - if (typeof value === 'number') { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number' - ) - } - - const valueOf = value.valueOf && value.valueOf(); - if (valueOf != null && valueOf !== value) { - return Buffer.from(valueOf, encodingOrOffset, length) - } - - const b = fromObject(value); - if (b) return b - - if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && - typeof value[Symbol.toPrimitive] === 'function') { - return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length) - } - - throw new TypeError( - 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + - 'or Array-like Object. Received type ' + (typeof value) - ) - } - - /** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ - Buffer.from = function (value, encodingOrOffset, length) { - return from(value, encodingOrOffset, length) - }; - - // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: - // https://github.com/feross/buffer/pull/148 - Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); - Object.setPrototypeOf(Buffer, Uint8Array); - - function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be of type number') - } else if (size < 0) { - throw new RangeError('The value "' + size + '" is invalid for option "size"') - } - } - - function alloc (size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpreted as a start offset. - return typeof encoding === 'string' - ? createBuffer(size).fill(fill, encoding) - : createBuffer(size).fill(fill) - } - return createBuffer(size) - } - - /** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ - Buffer.alloc = function (size, fill, encoding) { - return alloc(size, fill, encoding) - }; - - function allocUnsafe (size) { - assertSize(size); - return createBuffer(size < 0 ? 0 : checked(size) | 0) - } - - /** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ - Buffer.allocUnsafe = function (size) { - return allocUnsafe(size) - }; - /** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ - Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(size) - }; - - function fromString (string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8'; - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - - const length = byteLength(string, encoding) | 0; - let buf = createBuffer(length); - - const actual = buf.write(string, encoding); - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - buf = buf.slice(0, actual); - } - - return buf - } - - function fromArrayLike (array) { - const length = array.length < 0 ? 0 : checked(array.length) | 0; - const buf = createBuffer(length); - for (let i = 0; i < length; i += 1) { - buf[i] = array[i] & 255; - } - return buf - } - - function fromArrayView (arrayView) { - if (isInstance(arrayView, Uint8Array)) { - const copy = new Uint8Array(arrayView); - return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) - } - return fromArrayLike(arrayView) - } - - function fromArrayBuffer (array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds') - } - - let buf; - if (byteOffset === undefined && length === undefined) { - buf = new Uint8Array(array); - } else if (length === undefined) { - buf = new Uint8Array(array, byteOffset); - } else { - buf = new Uint8Array(array, byteOffset, length); - } - - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(buf, Buffer.prototype); - - return buf - } - - function fromObject (obj) { - if (Buffer.isBuffer(obj)) { - const len = checked(obj.length) | 0; - const buf = createBuffer(len); - - if (buf.length === 0) { - return buf - } - - obj.copy(buf, 0, 0, len); - return buf - } - - if (obj.length !== undefined) { - if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { - return createBuffer(0) - } - return fromArrayLike(obj) - } - - if (obj.type === 'Buffer' && Array.isArray(obj.data)) { - return fromArrayLike(obj.data) - } - } - - function checked (length) { - // Note: cannot use `length < K_MAX_LENGTH` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= K_MAX_LENGTH) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') - } - return length | 0 - } - - function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0; - } - return Buffer.alloc(+length) - } - - Buffer.isBuffer = function isBuffer (b) { - return b != null && b._isBuffer === true && - b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false - }; - - Buffer.compare = function compare (a, b) { - if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); - if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' - ) - } - - if (a === b) return 0 - - let x = a.length; - let y = b.length; - - for (let i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } - }; - - Buffer.concat = function concat (list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - let i; - if (length === undefined) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - - const buffer = Buffer.allocUnsafe(length); - let pos = 0; - for (i = 0; i < list.length; ++i) { - let buf = list[i]; - if (isInstance(buf, Uint8Array)) { - if (pos + buf.length > buffer.length) { - if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf); - buf.copy(buffer, pos); - } else { - Uint8Array.prototype.set.call( - buffer, - buf, - pos - ); - } - } else if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } else { - buf.copy(buffer, pos); - } - pos += buf.length; - } - return buffer - }; - - function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + - 'Received type ' + typeof string - ) - } - - const len = string.length; - const mustMatch = (arguments.length > 2 && arguments[2] === true); - if (!mustMatch && len === 0) return 0 - - // Use a for loop to avoid recursion - let loweredCase = false; - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) { - return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 - } - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - } - Buffer.byteLength = byteLength; - - function slowToString (encoding, start, end) { - let loweredCase = false; - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0; - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length; - } - - if (end <= 0) { - return '' - } - - // Force coercion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0; - start >>>= 0; - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8'; - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase(); - loweredCase = true; - } - } - } - - // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) - // to detect a Buffer instance. It's not possible to use `instanceof Buffer` - // reliably in a browserify context because there could be multiple different - // copies of the 'buffer' package in use. This method works even for Buffer - // instances that were created from another copy of the `buffer` package. - // See: https://github.com/feross/buffer/issues/154 - Buffer.prototype._isBuffer = true; - - function swap (b, n, m) { - const i = b[n]; - b[n] = b[m]; - b[m] = i; - } - - Buffer.prototype.swap16 = function swap16 () { - const len = this.length; - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (let i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this - }; - - Buffer.prototype.swap32 = function swap32 () { - const len = this.length; - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (let i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this - }; - - Buffer.prototype.swap64 = function swap64 () { - const len = this.length; - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (let i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this - }; - - Buffer.prototype.toString = function toString () { - const length = this.length; - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) - }; - - Buffer.prototype.toLocaleString = Buffer.prototype.toString; - - Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 - }; - - Buffer.prototype.inspect = function inspect () { - let str = ''; - const max = exports.INSPECT_MAX_BYTES; - str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); - if (this.length > max) str += ' ... '; - return '' - }; - if (customInspectSymbol) { - Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; - } - - Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer.from(target, target.offset, target.byteLength); - } - if (!Buffer.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. ' + - 'Received type ' + (typeof target) - ) - } - - if (start === undefined) { - start = 0; - } - if (end === undefined) { - end = target ? target.length : 0; - } - if (thisStart === undefined) { - thisStart = 0; - } - if (thisEnd === undefined) { - thisEnd = this.length; - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - - if (this === target) return 0 - - let x = thisEnd - thisStart; - let y = end - start; - const len = Math.min(x, y); - - const thisCopy = this.slice(thisStart, thisEnd); - const targetCopy = target.slice(start, end); - - for (let i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 - }; - - // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, - // OR the last index of `val` in `buffer` at offset <= `byteOffset`. - // - // Arguments: - // - buffer - a Buffer to search - // - val - a string, Buffer, or number - // - byteOffset - an index into `buffer`; will be clamped to an int32 - // - encoding - an optional encoding, relevant is val is a string - // - dir - true for indexOf, false for lastIndexOf - function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff; - } else if (byteOffset < -2147483648) { - byteOffset = -2147483648; - } - byteOffset = +byteOffset; // Coerce to Number. - if (numberIsNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1); - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset; - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1; - } else if (byteOffset < 0) { - if (dir) byteOffset = 0; - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding); - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF; // Search for a byte value [0-255] - if (typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') - } - - function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - let indexSize = 1; - let arrLength = arr.length; - let valLength = val.length; - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase(); - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - let i; - if (dir) { - let foundIndex = -1; - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i; - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - let found = true; - for (let j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break - } - } - if (found) return i - } - } - - return -1 - } - - Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 - }; - - Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) - }; - - Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) - }; - - function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0; - const remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - - const strLen = string.length; - - if (length > strLen / 2) { - length = strLen / 2; - } - let i; - for (i = 0; i < length; ++i) { - const parsed = parseInt(string.substr(i * 2, 2), 16); - if (numberIsNaN(parsed)) return i - buf[offset + i] = parsed; - } - return i - } - - function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) - } - - function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) - } - - function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) - } - - function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) - } - - Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8'; - length = this.length; - offset = 0; - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset; - length = this.length; - offset = 0; - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset >>> 0; - if (isFinite(length)) { - length = length >>> 0; - if (encoding === undefined) encoding = 'utf8'; - } else { - encoding = length; - length = undefined; - } - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - const remaining = this.length - offset; - if (length === undefined || length > remaining) length = remaining; - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8'; - - let loweredCase = false; - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - case 'latin1': - case 'binary': - return asciiWrite(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase(); - loweredCase = true; - } - } - }; - - Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } - }; - - function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } - } - - function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end); - const res = []; - - let i = start; - while (i < end) { - const firstByte = buf[i]; - let codePoint = null; - let bytesPerSequence = (firstByte > 0xEF) - ? 4 - : (firstByte > 0xDF) - ? 3 - : (firstByte > 0xBF) - ? 2 - : 1; - - if (i + bytesPerSequence <= end) { - let secondByte, thirdByte, fourthByte, tempCodePoint; - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte; - } - break - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F); - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint; - } - } - break - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F); - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint; - } - } - break - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F); - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint; - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD; - bytesPerSequence = 1; - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000; - res.push(codePoint >>> 10 & 0x3FF | 0xD800); - codePoint = 0xDC00 | codePoint & 0x3FF; - } - - res.push(codePoint); - i += bytesPerSequence; - } - - return decodeCodePointsArray(res) - } - - // Based on http://stackoverflow.com/a/22747272/680742, the browser with - // the lowest limit is Chrome, with 0x10000 args. - // We go 1 magnitude less, for safety - const MAX_ARGUMENTS_LENGTH = 0x1000; - - function decodeCodePointsArray (codePoints) { - const len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - let res = ''; - let i = 0; - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ); - } - return res - } - - function asciiSlice (buf, start, end) { - let ret = ''; - end = Math.min(buf.length, end); - - for (let i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F); - } - return ret - } - - function latin1Slice (buf, start, end) { - let ret = ''; - end = Math.min(buf.length, end); - - for (let i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret - } - - function hexSlice (buf, start, end) { - const len = buf.length; - - if (!start || start < 0) start = 0; - if (!end || end < 0 || end > len) end = len; - - let out = ''; - for (let i = start; i < end; ++i) { - out += hexSliceLookupTable[buf[i]]; - } - return out - } - - function utf16leSlice (buf, start, end) { - const bytes = buf.slice(start, end); - let res = ''; - // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) - for (let i = 0; i < bytes.length - 1; i += 2) { - res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)); - } - return res - } - - Buffer.prototype.slice = function slice (start, end) { - const len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - - if (start < 0) { - start += len; - if (start < 0) start = 0; - } else if (start > len) { - start = len; - } - - if (end < 0) { - end += len; - if (end < 0) end = 0; - } else if (end > len) { - end = len; - } - - if (end < start) end = start; - - const newBuf = this.subarray(start, end); - // Return an augmented `Uint8Array` instance - Object.setPrototypeOf(newBuf, Buffer.prototype); - - return newBuf - }; - - /* - * Need to make sure that buffer isn't trying to write out of bounds. - */ - function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') - } - - Buffer.prototype.readUintLE = - Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - let val = this[offset]; - let mul = 1; - let i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - - return val - }; - - Buffer.prototype.readUintBE = - Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - checkOffset(offset, byteLength, this.length); - } - - let val = this[offset + --byteLength]; - let mul = 1; - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul; - } - - return val - }; - - Buffer.prototype.readUint8 = - Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - return this[offset] - }; - - Buffer.prototype.readUint16LE = - Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return this[offset] | (this[offset + 1] << 8) - }; - - Buffer.prototype.readUint16BE = - Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - return (this[offset] << 8) | this[offset + 1] - }; - - Buffer.prototype.readUint32LE = - Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) - }; - - Buffer.prototype.readUint32BE = - Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) - }; - - Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const lo = first + - this[++offset] * 2 ** 8 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 24; - - const hi = this[++offset] + - this[++offset] * 2 ** 8 + - this[++offset] * 2 ** 16 + - last * 2 ** 24; - - return BigInt(lo) + (BigInt(hi) << BigInt(32)) - }); - - Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const hi = first * 2 ** 24 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - this[++offset]; - - const lo = this[++offset] * 2 ** 24 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - last; - - return (BigInt(hi) << BigInt(32)) + BigInt(lo) - }); - - Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - let val = this[offset]; - let mul = 1; - let i = 0; - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) checkOffset(offset, byteLength, this.length); - - let i = byteLength; - let mul = 1; - let val = this[offset + --i]; - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul; - } - mul *= 0x80; - - if (val >= mul) val -= Math.pow(2, 8 * byteLength); - - return val - }; - - Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 1, this.length); - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) - }; - - Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - const val = this[offset] | (this[offset + 1] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 2, this.length); - const val = this[offset + 1] | (this[offset] << 8); - return (val & 0x8000) ? val | 0xFFFF0000 : val - }; - - Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) - }; - - Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) - }; - - Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const val = this[offset + 4] + - this[offset + 5] * 2 ** 8 + - this[offset + 6] * 2 ** 16 + - (last << 24); // Overflow - - return (BigInt(val) << BigInt(32)) + - BigInt(first + - this[++offset] * 2 ** 8 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 24) - }); - - Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) { - offset = offset >>> 0; - validateNumber(offset, 'offset'); - const first = this[offset]; - const last = this[offset + 7]; - if (first === undefined || last === undefined) { - boundsError(offset, this.length - 8); - } - - const val = (first << 24) + // Overflow - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - this[++offset]; - - return (BigInt(val) << BigInt(32)) + - BigInt(this[++offset] * 2 ** 24 + - this[++offset] * 2 ** 16 + - this[++offset] * 2 ** 8 + - last) - }); - - Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, true, 23, 4) - }; - - Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, false, 23, 4) - }; - - Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, true, 52, 8) - }; - - Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, false, 52, 8) - }; - - function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') - } - - Buffer.prototype.writeUintLE = - Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - let mul = 1; - let i = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUintBE = - Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - byteLength = byteLength >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength) - 1; - checkInt(this, value, offset, byteLength, maxBytes, 0); - } - - let i = byteLength - 1; - let mul = 1; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeUint8 = - Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); - this[offset] = (value & 0xff); - return offset + 1 - }; - - Buffer.prototype.writeUint16LE = - Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - return offset + 2 - }; - - Buffer.prototype.writeUint16BE = - Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - return offset + 2 - }; - - Buffer.prototype.writeUint32LE = - Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - this[offset + 3] = (value >>> 24); - this[offset + 2] = (value >>> 16); - this[offset + 1] = (value >>> 8); - this[offset] = (value & 0xff); - return offset + 4 - }; - - Buffer.prototype.writeUint32BE = - Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - return offset + 4 - }; - - function wrtBigUInt64LE (buf, value, offset, min, max) { - checkIntBI(value, min, max, buf, offset, 7); - - let lo = Number(value & BigInt(0xffffffff)); - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - return offset - } - - function wrtBigUInt64BE (buf, value, offset, min, max) { - checkIntBI(value, min, max, buf, offset, 7); - - let lo = Number(value & BigInt(0xffffffff)); - buf[offset + 7] = lo; - lo = lo >> 8; - buf[offset + 6] = lo; - lo = lo >> 8; - buf[offset + 5] = lo; - lo = lo >> 8; - buf[offset + 4] = lo; - let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)); - buf[offset + 3] = hi; - hi = hi >> 8; - buf[offset + 2] = hi; - hi = hi >> 8; - buf[offset + 1] = hi; - hi = hi >> 8; - buf[offset] = hi; - return offset + 8 - } - - Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) { - return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) - }); - - Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) { - return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) - }); - - Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - const limit = Math.pow(2, (8 * byteLength) - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - let i = 0; - let mul = 1; - let sub = 0; - this[offset] = value & 0xFF; - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - const limit = Math.pow(2, (8 * byteLength) - 1); - - checkInt(this, value, offset, byteLength, limit - 1, -limit); - } - - let i = byteLength - 1; - let mul = 1; - let sub = 0; - this[offset + i] = value & 0xFF; - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF; - } - - return offset + byteLength - }; - - Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128); - if (value < 0) value = 0xff + value + 1; - this[offset] = (value & 0xff); - return offset + 1 - }; - - Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - return offset + 2 - }; - - Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); - this[offset] = (value >>> 8); - this[offset + 1] = (value & 0xff); - return offset + 2 - }; - - Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); - this[offset] = (value & 0xff); - this[offset + 1] = (value >>> 8); - this[offset + 2] = (value >>> 16); - this[offset + 3] = (value >>> 24); - return offset + 4 - }; - - Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); - if (value < 0) value = 0xffffffff + value + 1; - this[offset] = (value >>> 24); - this[offset + 1] = (value >>> 16); - this[offset + 2] = (value >>> 8); - this[offset + 3] = (value & 0xff); - return offset + 4 - }; - - Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) { - return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) - }); - - Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) { - return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) - }); - - function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') - } - - function writeFloat (buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 4); - } - ieee754.write(buf, value, offset, littleEndian, 23, 4); - return offset + 4 - } - - Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) - }; - - function writeDouble (buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 8); - } - ieee754.write(buf, value, offset, littleEndian, 52, 8); - return offset + 8 - } - - Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) - }; - - Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) - }; - - // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) - Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') - if (!start) start = 0; - if (!end && end !== 0) end = this.length; - if (targetStart >= target.length) targetStart = target.length; - if (!targetStart) targetStart = 0; - if (end > 0 && end < start) end = start; - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('Index out of range') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - - const len = end - start; - - if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { - // Use built-in when available, missing from IE11 - this.copyWithin(targetStart, start, end); - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart - ); - } - - return len - }; - - // Usage: - // buffer.fill(number[, offset[, end]]) - // buffer.fill(buffer[, offset[, end]]) - // buffer.fill(string[, offset[, end]][, encoding]) - Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === 'string') { - encoding = end; - end = this.length; - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - if (val.length === 1) { - const code = val.charCodeAt(0); - if ((encoding === 'utf8' && code < 128) || - encoding === 'latin1') { - // Fast path: If `val` fits into a single byte, use that numeric value. - val = code; - } - } - } else if (typeof val === 'number') { - val = val & 255; - } else if (typeof val === 'boolean') { - val = Number(val); - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0; - end = end === undefined ? this.length : end >>> 0; - - if (!val) val = 0; - - let i; - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - const bytes = Buffer.isBuffer(val) - ? val - : Buffer.from(val, encoding); - const len = bytes.length; - if (len === 0) { - throw new TypeError('The value "' + val + - '" is invalid for argument "value"') - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - - return this - }; - - // CUSTOM ERRORS - // ============= - - // Simplified versions from Node, changed for Buffer-only usage - const errors = {}; - function E (sym, getMessage, Base) { - errors[sym] = class NodeError extends Base { - constructor () { - super(); - - Object.defineProperty(this, 'message', { - value: getMessage.apply(this, arguments), - writable: true, - configurable: true - }); - - // Add the error code to the name to include it in the stack trace. - this.name = `${this.name} [${sym}]`; - // Access the stack to generate the error message including the error code - // from the name. - this.stack; // eslint-disable-line no-unused-expressions - // Reset the name to the actual name. - delete this.name; - } - - get code () { - return sym - } - - set code (value) { - Object.defineProperty(this, 'code', { - configurable: true, - enumerable: true, - value, - writable: true - }); - } - - toString () { - return `${this.name} [${sym}]: ${this.message}` - } - }; - } - - E('ERR_BUFFER_OUT_OF_BOUNDS', - function (name) { - if (name) { - return `${name} is outside of buffer bounds` - } - - return 'Attempt to access memory outside buffer bounds' - }, RangeError); - E('ERR_INVALID_ARG_TYPE', - function (name, actual) { - return `The "${name}" argument must be of type number. Received type ${typeof actual}` - }, TypeError); - E('ERR_OUT_OF_RANGE', - function (str, range, input) { - let msg = `The value of "${str}" is out of range.`; - let received = input; - if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { - received = addNumericalSeparator(String(input)); - } else if (typeof input === 'bigint') { - received = String(input); - if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { - received = addNumericalSeparator(received); - } - received += 'n'; - } - msg += ` It must be ${range}. Received ${received}`; - return msg - }, RangeError); - - function addNumericalSeparator (val) { - let res = ''; - let i = val.length; - const start = val[0] === '-' ? 1 : 0; - for (; i >= start + 4; i -= 3) { - res = `_${val.slice(i - 3, i)}${res}`; - } - return `${val.slice(0, i)}${res}` - } - - // CHECK FUNCTIONS - // =============== - - function checkBounds (buf, offset, byteLength) { - validateNumber(offset, 'offset'); - if (buf[offset] === undefined || buf[offset + byteLength] === undefined) { - boundsError(offset, buf.length - (byteLength + 1)); - } - } - - function checkIntBI (value, min, max, buf, offset, byteLength) { - if (value > max || value < min) { - const n = typeof min === 'bigint' ? 'n' : ''; - let range; - { - if (min === 0 || min === BigInt(0)) { - range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`; - } else { - range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + - `${(byteLength + 1) * 8 - 1}${n}`; - } - } - throw new errors.ERR_OUT_OF_RANGE('value', range, value) - } - checkBounds(buf, offset, byteLength); - } - - function validateNumber (value, name) { - if (typeof value !== 'number') { - throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value) - } - } - - function boundsError (value, length, type) { - if (Math.floor(value) !== value) { - validateNumber(value, type); - throw new errors.ERR_OUT_OF_RANGE('offset', 'an integer', value) - } - - if (length < 0) { - throw new errors.ERR_BUFFER_OUT_OF_BOUNDS() - } - - throw new errors.ERR_OUT_OF_RANGE('offset', - `>= ${0} and <= ${length}`, - value) - } - - // HELPER FUNCTIONS - // ================ - - const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; - - function base64clean (str) { - // Node takes equal signs as end of the Base64 encoding - str = str.split('=')[0]; - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = str.trim().replace(INVALID_BASE64_RE, ''); - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '='; - } - return str - } - - function utf8ToBytes (string, units) { - units = units || Infinity; - let codePoint; - const length = string.length; - let leadSurrogate = null; - const bytes = []; - - for (let i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - continue - } - - // valid lead - leadSurrogate = codePoint; - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - leadSurrogate = codePoint; - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); - } - - leadSurrogate = null; - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint); - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ); - } else { - throw new Error('Invalid code point') - } - } - - return bytes - } - - function asciiToBytes (str) { - const byteArray = []; - for (let i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF); - } - return byteArray - } - - function utf16leToBytes (str, units) { - let c, hi, lo; - const byteArray = []; - for (let i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - - return byteArray - } - - function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) - } - - function blitBuffer (src, dst, offset, length) { - let i; - for (i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i]; - } - return i - } - - // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass - // the `instanceof` check but they should be treated as of that type. - // See: https://github.com/feross/buffer/issues/166 - function isInstance (obj, type) { - return obj instanceof type || - (obj != null && obj.constructor != null && obj.constructor.name != null && - obj.constructor.name === type.name) - } - function numberIsNaN (obj) { - // For IE11 support - return obj !== obj // eslint-disable-line no-self-compare - } - - // Create lookup table for `toString('hex')` - // See: https://github.com/feross/buffer/issues/219 - const hexSliceLookupTable = (function () { - const alphabet = '0123456789abcdef'; - const table = new Array(256); - for (let i = 0; i < 16; ++i) { - const i16 = i * 16; - for (let j = 0; j < 16; ++j) { - table[i16 + j] = alphabet[i] + alphabet[j]; - } - } - return table - })(); - - // Return not function with Error if BigInt not supported - function defineBigIntMethod (fn) { - return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn - } - - function BufferBigIntNotDefined () { - throw new Error('BigInt not supported') - } - } (buffer)); - return buffer; -} - -requireBuffer(); - -/* Browser Crypto Shims */ -function getGlobal() { - if (typeof globalThis !== "undefined") - return globalThis; - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); -} -const anyGlobal = getGlobal(); -anyGlobal.crypto || anyGlobal.msCrypto; -function createHash(algo) { - switch (algo) { - case "ripemd160": - return ripemd160.create(); - case "sha256": - return sha256$1.create(); - case "sha512": - return sha512$1.create(); - case "sha3-256": - return sha3_256.create(); - case "sha3-512": - return sha3_512.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); -} - -const _sha256 = (data) => hexlify(createHash("sha3-256").update(data).digest()); -const _sha512 = (data) => hexlify(createHash("sha3-512").update(data).digest()); -let __sha256 = _sha256; -let __sha512 = _sha512; -let locked256 = false, locked512 = false; -/** - * Compute the cryptographic SHA3-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -var SupportedAlgorithm; -(function (SupportedAlgorithm) { - SupportedAlgorithm["sha256"] = "sha256"; - SupportedAlgorithm["sha512"] = "sha512"; -})(SupportedAlgorithm || (SupportedAlgorithm = {})); -function sha256(data) { - return hexlify(__sha256(getBytes(data))); -} -sha256._ = _sha256; -sha256.lock = function () { - locked256 = true; -}; -sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; -}; -Object.freeze(sha256); -/** - * Compute the cryptographic SHA3-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -function sha512(data) { - return hexlify(__sha512(getBytes(data))); -} -sha512._ = _sha512; -sha512.lock = function () { - locked512 = true; -}; -sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; -}; -Object.freeze(sha512); - -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * - * @example: - * id("hello world") - * //_result: - */ -function id(value, useKeccak) { - if (useKeccak) { - return keccak256(toUtf8Bytes(value)); - } - return sha256(toUtf8Bytes(value)); -} - -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; -function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); -} -/** - * @_ignore - */ -function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); -} -/** - * @_ignore - */ -function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); -} - -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } - static check(wordlist) { - const words = []; - for (let i = 0; i < 2048; i++) { - const word = wordlist.getWord(i); - /* istanbul ignore if */ - if (i !== wordlist.getWordIndex(word)) { - return "0x"; - } - words.push(word); - } - return id(words.join("\n") + "\n"); - } -} - -// Use the encode-latin.js script to create the necessary -// data files to be consumed by this class -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -class WordlistOwl extends Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - get _data() { - return this.#data; - } - _decodeWords() { - return decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n", true); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } -} - -const words$4 = "0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNzZ(2O&2KolivUv!4It_N(0Dn(Ke)KrPot0Ak~AlIkRkot2Kli$a:L-oRe[T_Tum1E,1B!a}'#Cib_Fic Fla%KlKr{Mokr!PreseRbyS#T-tiv3Kob,zKt|O^P]mSkSp+jV`]Vo/2AhaOuhoUhopis1Es0BroByt-C@t}ut DnesH+dHo^H,JemJn?Kl`KolaKtAzeDolObn(OgerieOzdSn(T Z(2B@}'noD-HaH'#S SnoT(0Oj?Or>2Nam :9O]gOnomie0EktronIpsa0AilIseO%P!ie2Izo^O/aOpejOs2EjEn%K<)Kymo0Ike)0FR&S]Zky3StOhOup(T!Ub.U/o)0AtO)Yz0IsOjivoOut0Bl.Boj}DinyDl!Dno)D|Jn(KejLin#L#LubMo+N [No,%RalR^RizontRkoRliv>RmonRn.RoskopR$voSpo^St.T'(U[UfUp!Us#V<2Ad[An?Av(Az^Bo+kD.D]D(N-Ob#Oma^OtOu^Oz@St#Ub(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+tNe/!Nik!Nut P`!Pl! P,v Pu$ Raz R'n!Rv!Sl' SokoS)v Su~Syp!Tas Tes!Tr! Vi~Vol!Vrh_Zdob Zn!0AduBud }op DJ{Ji$ K+p!K*p Lep Mez Mot!Mys+tNe/!Nik!Pl! Poj Ps!Raz S)v Su~Taj Temn Tk~Ujm=Val Ve+tVin Vol!Vrt!Zvon 0Av RusuUd|Yt-1A+#ArmaAtn(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk"; -const checksum$4 = "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; -let wordlist$6 = null; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor() { - super("cz", words$4, checksum$4); - } - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist$6 == null) { - wordlist$6 = new LangCz(); - } - return wordlist$6; - } -} - -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -/** - * @_ignore - */ -function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = (accum << 6) | Base64.indexOf(data[i]); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = accum >> (bits - width); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; -} - -/** - * @_ignore - */ -function decodeOwlA(data, accents) { - let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); -} - -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -class WordlistOwlA extends WordlistOwl { - #accent; - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - get _accent() { - return this.#accent; - } - _decodeWords() { - return decodeOwlA(this._data, this._accent); - } -} - -const words$3 = "0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe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ma'Mb^Ng}quePaPe)P@P.Qu?l(deRe(if(je%RotR+R%TuajeU+ZaZ.3At+|oC]CnicaJa&J!Ji&L/efo'MaM^Mp=NazNd!N!NisNRmi'Rnur(+rSisSo+StigoT!aX#Z3B$Bu+nEmpoEn{Er[EPoR(.TanT!eTu=Za5Al]B?=C Ci'DoG/&M N}#P PeQueRaxR!oRm,%RneoRoRpe&R_RS!Xi>2AbajoAc#rA!Afi>AgoAjeAmoAnceA#AumaAz EbolEguaEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv! b) { - return 1; - } - return 0; - } - // Load all the words - for (let length = 3; length <= 9; length++) { - const d = data$2[length - 3]; - for (let offset = 0; offset < d.length; offset += length) { - const word = []; - for (let i = 0; i < length; i++) { - const k = mapping.indexOf(d[offset + i]); - word.push(227); - word.push(k & 0x40 ? 130 : 129); - word.push((k & 0x3f) + 128); - } - wordlist.push(toString(word)); - } - } - wordlist.sort(sortJapanese); - // For some reason kyoku and kiyoku are flipped in node (!!). - // The order SHOULD be: - // - kyoku - // - kiyoku - // This should ignore "if", but that doesn't work here?? - /* c8 ignore start */ - if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) { - const tmp = wordlist[442]; - wordlist[442] = wordlist[443]; - wordlist[443] = tmp; - } - /* c8 ignore stop */ - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== - "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600") { - throw new Error("BIP39 Wordlist for ja (Japanese) FAILED"); - } - /* c8 ignore stop */ - _wordlist$2 = wordlist; - return wordlist; -} -let wordlist$3 = null; -/** - * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangJa extends Wordlist { - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ja"); - } - getWord(index) { - const words = loadWords$2(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords$2().indexOf(word); - } - split(phrase) { - //logger.assertNormalize(); - return phrase.split(/(?:\u3000| )+/g); - } - join(words) { - return words.join("\u3000"); - } - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist$3 == null) { - wordlist$3 = new LangJa(); - } - return wordlist$3; - } -} - -const data$1 = [ - "OYAa", - "ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrG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6ATFToMX8AXMT8MX8FkMT8MX8HTrDUMX8ScoSnMYJT6CTvMgAcrMXoMg8SToAfMlvAXLg3MnFl3AnvOT3AnFl3OUoATHT8OU3RnLXrOXrOXrSnObPbvFn6Og8HgrSnOg8OX8DbPTvAgoJgPU3RYLnrPXrDnJZrPb8CTGgvPlrLTDlvPlvFUJnoQUvFXrQlQeMnoAl3QlrQlrSnRTFTrJUoSTDlLiLXSTFg6HT3STJgoMn4STrFTJTrSTrLZFl3ST4FnMXoSUrDlHUoScvHTvSnSfLkvMXo", - "AUoAcrMXoAZ8HboAg8AbOg6ATFgAg8AloMXoAl3AT8JTrAl8MX8MXoCT3SToJU8Cl8Db8MXoDT8HgrATrDboOT8MXoGTOTrATMnGT8LhrAZ8GnvFnGnQXHToGgvAcrHTvAXvLl3HbrAZoMXoHgBlFXLg3HgMnFXrSnHgrSb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg", - "HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb", - "AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl", -]; -const codes$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"; -function getHangul(code) { - if (code >= 40) { - code = code + 168 - 40; - } - else if (code >= 19) { - code = code + 97 - 19; - } - return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128])); -} -let _wordlist$1 = null; -function loadWords$1() { - if (_wordlist$1 != null) { - return _wordlist$1; - } - const wordlist = []; - data$1.forEach((data, length) => { - length += 4; - for (let i = 0; i < data.length; i += length) { - let word = ""; - for (let j = 0; j < length; j++) { - word += getHangul(codes$1.indexOf(data[i + j])); - } - wordlist.push(word); - } - }); - wordlist.sort(); - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== - "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a") { - throw new Error("BIP39 Wordlist for ko (Korean) FAILED"); - } - /* c8 ignore stop */ - _wordlist$1 = wordlist; - return wordlist; -} -let wordlist$2 = null; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ko"); - } - getWord(index) { - const words = loadWords$1(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords$1().indexOf(word); - } - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist$2 == null) { - wordlist$2 = new LangKo(); - } - return wordlist$2; - } -} - -const words$1 = "0torea noica!iosorolotaleratelanena%oiadoencotivomai t ca%a0A]Bagl'Bin#E.Is(Oli!Rasi_Rog#0Cade!C[$Cus#E Roba+U 0Ag'Deb{DomeEgu#Eri!IpeOtt&Ul&1Fabi,Fe|Fis(F-n Oris`O(R~$0AveEn.E_,Ganc'I!It&OnismoR>*Rume Uzzo4AbardaA Bat)Ber#BoBumeCeCol>E|Ertu-OdePari!Pe^ Pogg'P)@Pun Ri,1Ab~AchideAgos+Ald~Anc'Atu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Du Ge+,I]*Lc)Li=Llu LoceN#Ndemm?N RaceRba,Rgog=Rif~RoRru}Rt~,Sc~Ssil*S+,Te-$Tri=Tus 3Andan.B-n.C[daChingoCi=nzaDim&Gil?G< Go!LeL/$MiniNc{!O/Pe-Rgo/Ro*goRu,n S](S'5Cche)Fo*LuPpa"; -const checksum$1 = "0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620"; -let wordlist$1 = null; -/** - * The [[link-bip39-it]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangIt extends WordlistOwl { - /** - * Creates a new instance of the Italian language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langIt]] should suffice. - * - * @_ignore: - */ - constructor() { - super("it", words$1, checksum$1); - } - /** - * Returns a singleton instance of a ``LangIt``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist$1 == null) { - wordlist$1 = new LangIt(); - } - return wordlist$1; - } -} - -const words = "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi?PoQue%lRagemRdi&Rne)R}h>p|&R[ioR%joRuj>voSs-oS%laT}e%U_UveVilZ*]2A%+AvoEcheE=rEmeErEspoI^Im*&Io~oIseItic Os)UaUz{o2B+m SafioSbo.Sc<,S-/Sfi#Sgas%Sigu&SlizeSmam SovaSpesaS)queSvi T&h T-$rT} Tri$UsaV(Vi=Vot#Z-a3Ag+maAle$Da)Fu,Gi.Lat#Lu-%M*u'Nast@Nh{oOceseRe$Sc[)Sf ceSp oSque%Ssip S)n%T?UrnoV(,Vi,rV~g Z(5Br?L|i=M?M*#NativoNz`>m-%Rs&SagemUr#U$r2EnagemIbleOg @2El EndeE$PloQues><%Vi=,:1Lod'O Olog@0Ific It&Uc#1Ei$Etiv 3E.1Ab| Eg(Ei$rEncoEv?Im* Ogi 0B goBol#Br~/Buti=EndaErg'Is,rPat@P-/P*#Polg P[goPurr Ul?0CaixeC-#Ch-%C}t_Deus Doss Faix Fei%FimGaj#G-/Glob Gom#G+x Gu@Jo La.Qu<$Raiz Rol#Rug SaioSe^S*oSop#T<$Te#Tid!eT|.Tr^T~/V(g Vi#Volv(XameX($Xof[Xu$1Id(me0Uip 0E$Gui=Ra)VaVil]0Bopeu0Acu Ap| AsivoEntu&Id-%Olu'1Ag(oAl Am* A$Aus$Ces,Ci.Clam Ecu.EmploIb'Ig-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uL?9Mb Olog@5Mbi="; -const checksum = "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; -let wordlist = null; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor() { - super("pt", words, checksum); - } - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangPt(); - } - return wordlist; - } -} - -const data = "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN> 2), - 128 + codes.indexOf(data[i * 3 + 1]), - 128 + codes.indexOf(data[i * 3 + 2]), - ]; - if (locale === "zh_tw") { - const common = s % 4; - for (let i = common; i < 3; i++) { - bytes[i] = - codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128); - } - } - wordlist.push(toUtf8String(new Uint8Array(bytes))); - } - // Verify the computed list matches the official list - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== Checks[locale]) { - throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`); - } - /* c8 ignore stop */ - _wordlist[locale] = wordlist; - return wordlist; -} -const wordlists = {}; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect) { - super("zh_" + dialect); - } - getWord(index) { - const words = loadWords(this.locale); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords(this.locale).indexOf(word); - } - split(phrase) { - phrase = phrase.replace(/(?:\u3000| )+/g, ""); - return phrase.split(""); - } - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect) { - if (wordlists[dialect] == null) { - wordlists[dialect] = new LangZh(dialect); - } - return wordlists[dialect]; - } -} - -export { LangCz, LangEs, LangFr, LangIt, LangJa, LangKo, LangPt, LangZh }; -//# sourceMappingURL=wordlists-extra.js.map diff --git a/dist/wordlists-extra.js.map b/dist/wordlists-extra.js.map deleted file mode 100644 index dd35ccb85..000000000 --- a/dist/wordlists-extra.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.js","sources":["../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/sha3.js","../lib.esm/logger/logger.js","../lib.esm/_version.js","../lib.esm/utils/properties.js","../lib.esm/utils/errors.js","../lib.esm/utils/data.js","../lib.esm/utils/utf8.js","../lib.esm/crypto/keccak.js","../node_modules/@noble/hashes/_md.js","../node_modules/@noble/hashes/legacy.js","../node_modules/@noble/hashes/sha2.js","../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../lib.esm/crypto/crypto-browser.js","../lib.esm/crypto/sha3.js","../lib.esm/hash/id.js","../lib.esm/wordlists/decode-owl.js","../lib.esm/wordlists/wordlist.js","../lib.esm/wordlists/wordlist-owl.js","../lib.esm/wordlists/lang-cz.js","../lib.esm/wordlists/bit-reader.js","../lib.esm/wordlists/decode-owla.js","../lib.esm/wordlists/wordlist-owla.js","../lib.esm/wordlists/lang-es.js","../lib.esm/wordlists/lang-fr.js","../lib.esm/wordlists/lang-ja.js","../lib.esm/wordlists/lang-ko.js","../lib.esm/wordlists/lang-it.js","../lib.esm/wordlists/lang-pt.js","../lib.esm/wordlists/lang-zh.js"],"sourcesContent":["const U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();\nconst _32n = /* @__PURE__ */ BigInt(32);\n// Split bigint into two 32-bit halves. With `le=true`, returned fields become `{ h: low, l: high\n// }` to match little-endian word order rather than the property names.\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\n// Split bigint list into `[highWords, lowWords]` when `le=false`; with `le=true`, the first array\n// holds the low halves because `fromBig(...)` swaps the semantic meaning of `h` and `l`.\nfunction split(lst, le = false) {\n const len = lst.length;\n let Ah = new Uint32Array(len);\n let Al = new Uint32Array(len);\n for (let i = 0; i < len; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\n// Combine explicit `(high, low)` 32-bit halves into a bigint; `>>> 0` normalizes signed JS\n// bitwise results back to uint32 first, and little-endian callers must swap.\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\n// Split a JS number into u32 halves without a BigInt allocation. Exact only for integers\n// `0 <= n < 2**53`; callers use it on byte / bit counters, which JS length math caps far below\n// that (an ArrayBuffer cannot exceed 2**53 - 1 bytes).\nconst fromNumH = (n) => (n / 2 ** 32) | 0;\nconst fromNumL = (n) => n >>> 0;\n// Drop-in replacement for `view.setBigUint64(byteOffset, BigInt(n), isLE)` without the per-call\n// BigInt allocation. Same `n < 2**53` precondition as `fromNumH`/`fromNumL`.\nfunction setU64FromNum(view, byteOffset, n, isLE) {\n const h = fromNumH(n);\n const l = fromNumL(n);\n view.setUint32(byteOffset, isLE ? l : h, isLE);\n view.setUint32(byteOffset + 4, isLE ? h : l, isLE);\n}\n// High 32-bit half of a 64-bit logical right shift for `s` in `0..31`.\nconst shrSH = (h, _l, s) => h >>> s;\n// Low 32-bit half of a 64-bit logical right shift, valid for `s` in `1..31`.\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `1..31`.\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\n// High 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\n// Low 32-bit half of a 64-bit right rotate, valid for `s` in `33..63`; `32` uses `rotr32*`.\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\n// High 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped low half.\nconst rotr32H = (_h, l) => l;\n// Low 32-bit half of a 64-bit right rotate for `s === 32`; this is just the swapped high half.\nconst rotr32L = (h, _l) => h;\n// 64-bit left rotates (rotl*) are not defined here: sha3.ts, their only consumer, keeps\n// local copies so V8 inlines them into keccakP.\n// Add two split 64-bit words and return the split `{ h, l }` sum.\n// JS uses 32-bit signed integers for bitwise operations, so we cannot simply shift the carry out\n// of the low sum and instead use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\n// Addition with more than 2 elements\n// Unmasked low-word accumulator for 3-way addition; pass the raw result into `add3H(...)`.\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\n// High-word finalize step for 3-way addition; `low` must be the untruncated output of `add3L(...)`.\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 4-way addition; pass the raw result into `add4H(...)`.\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\n// High-word finalize step for 4-way addition; `low` must be the untruncated output of `add4L(...)`.\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\n// Unmasked low-word accumulator for 5-way addition; pass the raw result into `add5H(...)`.\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\n// High-word finalize step for 5-way addition; `low` must be the untruncated output of `add5L(...)`.\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\n// prettier-ignore\nexport { add, add3H, add3L, add4H, add4L, add5H, add5L, fromBig, fromNumH, fromNumL, rotr32H, rotr32L, rotrBH, rotrBL, rotrSH, rotrSL, setU64FromNum, shrSH, shrSL, split, toBig };\n","/**\n * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.\n * @param a - value to test\n * @returns `true` when the value is a Uint8Array-compatible view.\n * @example\n * Check whether a value is a Uint8Array-compatible view.\n * ```ts\n * isBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function isBytes(a) {\n // Plain `instanceof Uint8Array` is too strict for some Buffer / proxy / cross-realm cases.\n // The fallback still requires a real ArrayBuffer view, so plain\n // JSON-deserialized `{ constructor: ... }` spoofing is rejected, and\n // `BYTES_PER_ELEMENT === 1` keeps the fallback on byte-oriented views.\n return (a instanceof Uint8Array ||\n (ArrayBuffer.isView(a) &&\n a.constructor.name === 'Uint8Array' &&\n 'BYTES_PER_ELEMENT' in a &&\n a.BYTES_PER_ELEMENT === 1));\n}\n// Shared error-message prefix builder. Only called on throw paths, so assert\n// success paths never pay for the string concatenation.\nconst atitle = (title) => (title ? `\"${title}\" ` : '');\n/**\n * Asserts something is a non-negative integer.\n * @param n - number to validate\n * @param title - label included in thrown errors\n * @returns The validated number.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a non-negative integer option.\n * ```ts\n * anumber(32, 'length');\n * ```\n */\nexport function anumber(n, title = '') {\n if (typeof n !== 'number')\n throw new TypeError(atitle(title) + 'expected number, got ' + typeof n);\n if (!Number.isSafeInteger(n) || n < 0)\n throw new RangeError(atitle(title) + 'expected integer >= 0, got ' + n);\n return n;\n}\n/**\n * Asserts something is a boolean.\n * @param value - value to validate\n * @param title - label included in thrown errors\n * @returns The validated boolean.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate a boolean option.\n * ```ts\n * abool(true, 'enableXOF');\n * ```\n */\nexport function abool(value, title = '') {\n if (typeof value !== 'boolean')\n throw new TypeError(atitle(title) + 'expected boolean, got type=' + typeof value);\n return value;\n}\n/**\n * Asserts something is Uint8Array.\n * @param value - value to validate\n * @param length - optional exact length constraint\n * @param title - label included in thrown errors\n * @returns The validated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate that a value is a byte array.\n * ```ts\n * abytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function abytes(value, length, title = '') {\n // Success path first: this runs at the start of every update() / digestInto(), and the\n // common `abytes(data)` form must not pay for length handling it does not use.\n if (isBytes(value) && (length === undefined || value.length === length))\n return value;\n // Error path: recompute freely to build the exact message.\n if (length !== undefined)\n anumber(length, 'length');\n const bytes = isBytes(value);\n const ofLen = length !== undefined ? ` of length ${length}` : '';\n const got = bytes ? `length=${value.length}` : `type=${typeof value}`;\n const message = atitle(title) + 'expected Uint8Array' + ofLen + ', got ' + got;\n if (!bytes)\n throw new TypeError(message);\n throw new RangeError(message);\n}\n/**\n * Copies bytes into a fresh Uint8Array.\n * Buffer-style slices can alias the same backing store, so callers that need ownership should copy.\n * @param bytes - source bytes to clone\n * @returns Freshly allocated copy of `bytes`.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Clone a byte array before mutating it.\n * ```ts\n * const copy = copyBytes(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function copyBytes(bytes) {\n // `Uint8Array.from(...)` would also accept arrays / other typed arrays. Keep this helper strict\n // because callers use it at byte-validation boundaries before mutating the detached copy.\n return Uint8Array.from(abytes(bytes));\n}\n/**\n * Asserts something is a wrapped hash constructor.\n * @param h - hash constructor to validate\n * @throws On wrong argument types or invalid hash wrapper shape. {@link TypeError}\n * @throws On invalid hash metadata ranges or values. {@link RangeError}\n * @throws If the hash metadata allows empty outputs or block sizes. {@link Error}\n * @example\n * Validate a callable hash wrapper.\n * ```ts\n * import { ahash } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * ahash(sha256);\n * ```\n */\nexport function ahash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new TypeError('expected hash wrapped by utils.createHasher');\n anumber(h.outputLen);\n anumber(h.blockLen);\n // HMAC and KDF callers treat these as real byte lengths; allowing zero lets fake wrappers pass\n // validation and can produce empty outputs instead of failing fast.\n if (h.outputLen < 1 || h.blockLen < 1)\n throw new Error('hash blockLen / outputLen must be >= 1');\n}\nconst aobject = (value, label) => {\n if (value === null || typeof value !== 'object' || Array.isArray(value))\n throw new TypeError((label === 'object' ? '' : `\"${label}\" `) + 'expected object, got type=' + typeof value);\n};\nconst aopts = (value, label) => {\n aobject(value, label);\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null)\n throw new TypeError(`\"${label}\" expected plain object`);\n // Object.assign() treats an own \"__proto__\" source key as a write to the target's legacy\n // prototype setter. Reject it before merging so inherited option values cannot be injected.\n if (Object.hasOwn(value, '__proto__'))\n throw new TypeError(`\"${label}.__proto__\" is not allowed`);\n};\n/**\n * Asserts a hash instance has not been destroyed or finished.\n * @param instance - hash instance to validate\n * @param checkFinished - whether to reject finalized instances\n * @throws If the hash instance has already been destroyed or finalized. {@link Error}\n * @example\n * Validate that a hash instance is still usable.\n * ```ts\n * import { aexists } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aexists(hash);\n * ```\n */\nexport function aexists(instance, checkFinished = true) {\n // Runs on every update()/digestInto(); the flags are library-owned booleans, so only their\n // truthiness is checked - re-validating their type per call was pure hot-path overhead.\n if (instance.destroyed)\n throw new Error('hash was destroyed');\n if (checkFinished && instance.finished)\n throw new Error('digest() was already called');\n}\n/**\n * Asserts output is a sufficiently-sized byte array.\n * @param out - destination buffer\n * @param instance - hash instance providing output length\n * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Validate a caller-provided digest buffer.\n * ```ts\n * import { aoutput } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const hash = sha256.create();\n * aoutput(new Uint8Array(hash.outputLen), hash);\n * ```\n */\nexport function aoutput(out, instance) {\n abytes(out, undefined, 'output');\n // `outputLen` is a library-owned readonly number; the negated comparison keeps failing fast\n // when it is missing/NaN (comparisons with undefined/NaN are false) without an anumber() call.\n const min = instance.outputLen;\n if (!(out.length >= min)) {\n throw new RangeError('\"output\" expected length >= ' + min);\n }\n}\n/**\n * Casts a typed array view to Uint8Array.\n * @param arr - source typed array\n * @returns Uint8Array view over the same buffer.\n * @example\n * Reinterpret a typed array as bytes.\n * ```ts\n * u8(new Uint32Array([1, 2]));\n * ```\n */\nexport function u8(arr) {\n return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Casts a typed array view to Uint32Array.\n * `arr.byteOffset` must already be 4-byte aligned or the platform\n * Uint32Array constructor will throw.\n * @param arr - source typed array\n * @returns Uint32Array view over the same buffer.\n * @example\n * Reinterpret a byte array as 32-bit words.\n * ```ts\n * u32(new Uint8Array(8));\n * ```\n */\nexport function u32(arr) {\n return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\n}\n/**\n * Zeroizes typed arrays in place. Warning: JS provides no guarantees.\n * @param arrays - arrays to overwrite with zeros\n * @example\n * Zeroize sensitive buffers in place.\n * ```ts\n * clean(new Uint8Array([1, 2, 3]));\n * ```\n */\nexport function clean(...arrays) {\n for (let i = 0; i < arrays.length; i++) {\n arrays[i].fill(0);\n }\n}\n/**\n * Creates a DataView for byte-level manipulation.\n * @param arr - source typed array\n * @returns DataView over the same buffer region.\n * @example\n * Create a DataView over an existing buffer.\n * ```ts\n * createView(new Uint8Array(4));\n * ```\n */\nexport function createView(arr) {\n return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\n}\n/**\n * Rotate-right operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the right.\n * ```ts\n * rotr(0x12345678, 8);\n * ```\n */\nexport function rotr(word, shift) {\n return (word << (32 - shift)) | (word >>> shift);\n}\n/**\n * Rotate-left operation for uint32 values.\n * @param word - source word\n * @param shift - shift amount in bits\n * @returns Rotated word.\n * @example\n * Rotate a 32-bit word to the left.\n * ```ts\n * rotl(0x12345678, 8);\n * ```\n */\nexport function rotl(word, shift) {\n return (word << shift) | ((word >>> (32 - shift)) >>> 0);\n}\n/** Whether the current platform is little-endian. */\nexport const isLE = /* @__PURE__ */ (() => new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44)();\n/**\n * Byte-swap operation for uint32 values.\n * @param word - source word\n * @returns Word with reversed byte order.\n * @example\n * Reverse the byte order of a 32-bit word.\n * ```ts\n * byteSwap(0x11223344);\n * ```\n */\nexport function byteSwap(word) {\n return (((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff));\n}\n/**\n * Conditionally byte-swaps one 32-bit word on big-endian platforms.\n * @param n - source word\n * @returns Original or byte-swapped word depending on platform endianness.\n * @example\n * Normalize a 32-bit word for host endianness.\n * ```ts\n * swap8IfBE(0x11223344);\n * ```\n */\nexport const swap8IfBE = isLE\n ? (n) => n\n : (n) => byteSwap(n) >>> 0;\n/**\n * Byte-swaps every word of a Uint32Array in place.\n * @param arr - array to mutate\n * @returns The same array after mutation; callers pass live state arrays here.\n * @example\n * Reverse the byte order of every word in place.\n * ```ts\n * byteSwap32(new Uint32Array([0x11223344]));\n * ```\n */\nexport function byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = byteSwap(arr[i]);\n }\n return arr;\n}\n/**\n * Conditionally byte-swaps a Uint32Array on big-endian platforms.\n * @param u - array to normalize for host endianness\n * @returns Original or byte-swapped array depending on platform endianness.\n * On big-endian runtimes this mutates `u` in place via `byteSwap32(...)`.\n * @example\n * Normalize a word array for host endianness.\n * ```ts\n * swap32IfBE(new Uint32Array([0x11223344]));\n * ```\n */\nexport const swap32IfBE = isLE\n ? (u) => u\n : byteSwap32;\n// Built-in hex conversion https://caniuse.com/mdn-javascript_builtins_uint8array_fromhex\nconst hasHexBuiltin = /* @__PURE__ */ (() => \n// @ts-ignore\ntypeof Uint8Array.from([]).toHex === 'function' && typeof Uint8Array.fromHex === 'function')();\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Convert byte array to hex string.\n * Uses the built-in function when available and assumes it matches the tested\n * fallback semantics.\n * @param bytes - bytes to encode\n * @returns Lowercase hexadecimal string.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Convert bytes to lowercase hexadecimal.\n * ```ts\n * bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])); // 'cafe0123'\n * ```\n */\nexport function bytesToHex(bytes) {\n abytes(bytes);\n // @ts-ignore\n if (hasHexBuiltin)\n return bytes.toHex();\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}\n// Strict ASCII nibble parser: non-ASCII hex lookalikes are rejected as undefined.\n// ASCII codes: '0'..'9' = 48..57, 'A'..'F' = 65..70, 'a'..'f' = 97..102.\n// prettier-ignore\nfunction asciiToBase16(ch) {\n return ch >= 48 && ch <= 57 ? ch - 48 // '2' => 50-48\n : ch >= 65 && ch <= 70 ? ch - (65 - 10) // 'B' => 66-(65-10)\n : ch >= 97 && ch <= 102 ? ch - (97 - 10) // 'b' => 98-(97-10)\n : undefined;\n}\n/**\n * Convert hex string to byte array. Uses built-in function, when available.\n * @param hex - hexadecimal string to decode\n * @returns Decoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Decode lowercase hexadecimal into bytes.\n * ```ts\n * hexToBytes('cafe0123'); // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n * ```\n */\nexport function hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new TypeError('hex string expected, got ' + typeof hex);\n if (hasHexBuiltin) {\n try {\n return Uint8Array.fromHex(hex);\n }\n catch (error) {\n if (error instanceof SyntaxError)\n throw new RangeError(error.message);\n throw error;\n }\n }\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new RangeError('hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi)); // parse first char, multiply it by 16\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1)); // parse second char\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new RangeError('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2; // example: 'A9' => 10*16 + 9\n }\n return array;\n}\n/**\n * Yields to the host task scheduler so timers, I/O, and rendering can make progress.\n * Uses the Web Scheduling API when available or `setTimeout` as a cross-platform fallback.\n * Host-task yields are much slower than microtasks (roughly 1ms with the timer fallback), so\n * async loops should use `asyncTick >= 10` to amortize scheduling overhead to about 10% while\n * still allowing other event-loop work to proceed.\n * @param onReject - optional cleanup invoked only if the host yield fails\n * @example\n * Yield to the next scheduler tick.\n * ```ts\n * await nextTick();\n * ```\n */\nexport function nextTick(onReject) {\n const host = globalThis;\n if (typeof host.scheduler?.yield === 'function') {\n const promise = host.scheduler.yield();\n // Keep the original scheduler rejection; this handler exists only for cleanup.\n if (onReject)\n promise.catch(onReject);\n return promise;\n }\n return new Promise((resolve) => host.setTimeout(resolve, 0));\n}\n/**\n * Returns control to the host event loop every `tick` milliseconds to avoid blocking long loops.\n * @param iters - number of loop iterations to run\n * @param tick - maximum time slice in milliseconds\n * @param cb - callback executed on each iteration\n * @param onReject - optional cleanup invoked only if a host yield fails\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @example\n * Run a loop that periodically yields back to the event loop.\n * ```ts\n * await asyncLoop(2, 0, () => {});\n * ```\n */\nexport async function asyncLoop(iters, tick, cb, onReject) {\n anumber(iters, 'iters');\n anumber(tick, 'tick');\n if (typeof cb !== 'function')\n throw new TypeError('callback must be a function');\n // Callback is synchronous by contract; asyncLoop only yields between sync work windows.\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await nextTick(onReject);\n // Track only synchronous work time; scheduler delay after yielding is outside our budget.\n ts = Date.now();\n }\n}\n/**\n * Converts string to bytes using UTF8 encoding.\n * Built-in doesn't validate input to be string: we do the check.\n * Non-ASCII details are delegated to the platform `TextEncoder`.\n * @param str - string to encode\n * @returns UTF-8 encoded bytes.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Encode a string as UTF-8 bytes.\n * ```ts\n * utf8ToBytes('abc'); // Uint8Array.from([97, 98, 99])\n * ```\n */\nexport function utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new TypeError('string expected');\n const encoded = new TextEncoder().encode(str);\n try {\n // Copy into the current realm for Firefox extension contexts. Callers that own the returned\n // buffer can then wipe it independently of TextEncoder's temporary result.\n return new Uint8Array(encoded); // https://bugzil.la/1681809\n }\n finally {\n clean(encoded);\n }\n}\n/**\n * Helper for KDFs: consumes Uint8Array or string.\n * String inputs are UTF-8 encoded; byte-array inputs stay aliased to the caller buffer.\n * @param data - user-provided KDF input\n * @param errorTitle - label included in thrown errors\n * @returns Byte representation of the input.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Normalize KDF input to bytes.\n * ```ts\n * kdfInputToBytes('password');\n * ```\n */\nexport function kdfInputToBytes(data, errorTitle = '') {\n if (typeof data === 'string')\n return utf8ToBytes(data);\n return abytes(data, undefined, errorTitle);\n}\n/**\n * Copies several Uint8Arrays into one.\n * @param arrays - arrays to concatenate\n * @returns Concatenated byte array.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Concatenate multiple byte arrays.\n * ```ts\n * concatBytes(new Uint8Array([1]), new Uint8Array([2]));\n * ```\n */\nexport function concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n abytes(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\n/**\n * Validates declared required and optional field types on a plain object.\n * This walks field schemas and formats detailed errors, so avoid it on hot paths; use direct\n * one-line guards such as `abytes()`, `abool()`, or `anumber()` instead.\n * @param object - object to validate\n * @param fields - map of required field names to expected types\n * @param optFields - map of optional field names to expected types\n * @param title - label included in thrown errors\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Validate required and optional option fields.\n * ```ts\n * validateObject({ N: 1024, dkLen: 32 }, { N: 'number' }, { dkLen: 'number' });\n * ```\n */\nexport const validateObject = (object, fields = {}, optFields = {}, title = 'object') => {\n aobject(object, title);\n aobject(fields, 'fields');\n aobject(optFields, 'optFields');\n function checkField(fieldName, expectedType, isOpt) {\n const label = title === 'object' ? `param \"${String(fieldName)}\"` : `\"${title}.${String(fieldName)}\"`;\n // Config fields must be explicit own properties. Optional inherited values are rejected too\n // because callers keep reading the same options object after validation.\n const val = object[fieldName];\n // Runtime objects such as Field instances intentionally satisfy required method slots\n // via their shared prototype.\n if (!Object.hasOwn(object, fieldName) &&\n (isOpt ? val !== undefined : expectedType !== 'function')) {\n throw new TypeError(`${label} is invalid: expected own property`);\n }\n if (isOpt && val === undefined)\n return;\n const current = typeof val;\n if (current !== expectedType || val === null)\n throw new TypeError(`${label} is invalid: expected ${expectedType}, got ${current}`);\n }\n const iter = (f, isOpt) => Object.entries(f).forEach(([k, v]) => checkField(k, v, isOpt));\n iter(fields, false);\n iter(optFields, true);\n};\n/**\n * Merges default options and passed options.\n * @param defaults - base option object\n * @param opts - user overrides\n * @param title - label included in thrown override errors\n * @returns Fresh merged option object with a null prototype.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Merge user overrides onto default options.\n * ```ts\n * checkOpts({ dkLen: 32 }, { asyncTick: 10 });\n * ```\n */\nexport function checkOpts(defaults, opts, title = 'opts') {\n aopts(defaults, 'defaults');\n if (opts !== undefined)\n aopts(opts, title);\n // Callers read optional fields directly, so omitted values must not fall through to ambient\n // Object.prototype pollution (for example a forged `dkLen` changing SHAKE's default output).\n const merged = Object.assign(Object.create(null), defaults, opts);\n return merged;\n}\n/**\n * Creates a callable hash function from a stateful class constructor.\n * @param hashCons - hash constructor or factory\n * @param info - optional metadata such as DER OID\n * @returns Frozen callable hash wrapper with `.create()`.\n * Wrapper construction eagerly calls `hashCons(undefined)` once to read\n * `outputLen` / `blockLen`, so constructor side effects happen at module\n * init time.\n * @throws On wrong argument types. {@link TypeError}\n * @example\n * Wrap a stateful hash constructor into a callable helper.\n * ```ts\n * import { createHasher } from '@noble/hashes/utils.js';\n * import { sha256 } from '@noble/hashes/sha2.js';\n * const wrapped = createHasher(sha256.create, { oid: sha256.oid });\n * wrapped(new Uint8Array([1]));\n * ```\n */\nexport function createHasher(hashCons, info = {}) {\n if (typeof hashCons !== 'function')\n throw new TypeError('\"hashCons\" expected function, got type=' + typeof hashCons);\n info = checkOpts({}, info, 'info');\n const hashC = (msg, opts) => hashCons(opts)\n .update(msg)\n .digest();\n const tmp = hashCons(undefined);\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.canXOF = tmp.canXOF;\n hashC.create = (opts) => hashCons(opts);\n Object.assign(hashC, info);\n return Object.freeze(hashC);\n}\n/**\n * Cryptographically secure PRNG backed by `crypto.getRandomValues`.\n * @param bytesLength - number of random bytes to generate\n * @returns Random bytes.\n * The platform `getRandomValues()` implementation still defines any\n * single-call length cap, and this helper rejects oversize requests\n * with a stable library `RangeError` instead of host-specific errors.\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}\n * @example\n * Generate a fresh random key or nonce.\n * ```ts\n * const key = randomBytes(16);\n * ```\n */\nexport function randomBytes(bytesLength = 32) {\n // Match the repo's other length-taking helpers instead of relying on Uint8Array coercion.\n anumber(bytesLength, 'bytesLength');\n const cr = typeof globalThis === 'object' ? globalThis.crypto : null;\n if (typeof cr?.getRandomValues !== 'function')\n throw new Error('crypto.getRandomValues must be defined');\n // Web Cryptography API Level 2 §10.1.1:\n // if `byteLength > 65536`, throw `QuotaExceededError`.\n // Keep the guard explicit so callers can see the quota in code\n // instead of discovering it by reading the spec or host errors.\n // This wrapper surfaces the same quota as a stable library RangeError.\n if (bytesLength > 65536)\n throw new RangeError(`\"bytesLength\" expected <= 65536, got ${bytesLength}`);\n return cr.getRandomValues(new Uint8Array(bytesLength));\n}\n/**\n * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.\n * @param suffix - final OID byte for the selected hash.\n * The helper accepts any byte even though only the documented NIST hash\n * suffixes are meaningful downstream.\n * @returns Object containing the DER-encoded OID.\n * @example\n * Build OID metadata for a NIST hash.\n * ```ts\n * oidNist(0x01);\n * ```\n */\nexport const oidNist = (suffix) => ({\n // Current NIST hashAlgs suffixes used here fit in one DER subidentifier octet.\n // Larger suffix values would need base-128 OID encoding and a different length byte.\n oid: Uint8Array.from([0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, suffix]),\n});\n","/**\n * SHA3 (keccak) hash function, based on a new \"Sponge function\" design.\n * Different from older hashes, the internal state is bigger than output size.\n *\n * Check out\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202},\n * {@link https://keccak.team/keccak.html | Website}, and\n * {@link https://crypto.stackexchange.com/q/15727 | the differences between\n * SHA-3 and Keccak}.\n *\n * Check out `sha3-addons` module for cSHAKE, k12, and others.\n * @module\n */\nimport { split } from \"./_u64.js\";\n// prettier-ignore\nimport { abool, abytes, aexists, anumber, aoutput, checkOpts, clean, createHasher, oidNist, swap32IfBE, u32 } from \"./utils.js\";\n// No __PURE__ annotations in sha3 header:\n// EVERYTHING is in fact used on every export.\n// Various per round constants calculations\nconst _0n = BigInt(0);\nconst _1n = BigInt(1);\nconst _2n = BigInt(2);\nconst _7n = BigInt(7);\nconst _256n = BigInt(256);\n// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors\n// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`.\nconst _0x71n = BigInt(0x71);\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = []; // no pure annotation: var is always used\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst IOTAS = split(_SHA3_IOTA, true);\n// `split(..., true)` keeps the local little-endian lane-word layout used by\n// `state32`, so these `H` / `L` tables follow the file's first-word /\n// second-word lane slots rather than `_u64.ts`'s usual high/low naming.\nconst SHA3_IOTA_H = IOTAS[0];\nconst SHA3_IOTA_L = IOTAS[1];\n// 64-bit left rotates as u32 pairs. Inlined here (not imported from _u64) so V8 can\n// inline them into keccakP — the import path costs ~24% on sha3_256. SHA3 is the only\n// consumer of left-rotates; other hashes use right-rotates from _u64.\n// Valid for s in 1..31 (SH/SL) and 33..63 (BH/BL); keccak never rotates by 0/32/64.\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nconst rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));\n// Reused Theta scratch buffer (column parities), same pattern as SHA256_W in sha2.\n// keccakP never calls user code, so the shared buffer cannot be observed mid-permutation.\nconst B = new Uint32Array(5 * 2);\n/**\n * `keccakf1600` internal permutation, additionally allows adjusting the round count.\n * @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words\n * in this file's local little-endian lane-word order\n * @param rounds - number of rounds to execute\n * @throws On wrong argument types. {@link TypeError}\n * @throws On wrong argument ranges or values. {@link RangeError}\n * @throws If `rounds` is outside the supported `1..24` range. {@link Error}\n * @example\n * Permute a Keccak state with the default 24 rounds.\n * ```ts\n * keccakP(new Uint32Array(50));\n * ```\n */\nexport function keccakP(s, rounds = 24) {\n if (!(s instanceof Uint32Array))\n throw new TypeError('\"s\" expected Uint32Array(50), got type=' + typeof s);\n if (s.length !== 50)\n throw new RangeError('\"s\" expected Uint32Array(50), got length=' + s.length);\n anumber(rounds, 'rounds');\n // This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table.\n if (rounds < 1 || rounds > 24)\n throw new Error('\"rounds\" expected integer 1..24');\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n // Same as:\n // for (let x = 0; x < 10; x++) B[x] = s[y + x];\n // for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n for (let y = 0; y < 50; y += 10) {\n const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3];\n s[y] ^= ~s[y + 2] & s[y + 4];\n s[y + 1] ^= ~s[y + 3] & s[y + 5];\n s[y + 2] ^= ~s[y + 4] & s[y + 6];\n s[y + 3] ^= ~s[y + 5] & s[y + 7];\n s[y + 4] ^= ~s[y + 6] & s[y + 8];\n s[y + 5] ^= ~s[y + 7] & s[y + 9];\n s[y + 6] ^= ~s[y + 8] & b0;\n s[y + 7] ^= ~s[y + 9] & b1;\n s[y + 8] ^= ~b0 & b2;\n s[y + 9] ^= ~b1 & b3;\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n clean(B);\n}\n/**\n * Keccak sponge function.\n * @param blockLen - absorb/squeeze rate in bytes\n * @param suffix - domain separation suffix byte\n * @param outputLen - default digest length in bytes. This base sponge only\n * requires a non-negative integer; wrappers that need positive output\n * lengths must enforce that themselves.\n * @param enableXOF - whether XOF output is allowed\n * @param rounds - number of Keccak-f rounds\n * @example\n * Build a sponge state, absorb bytes, then finalize a digest.\n * ```ts\n * const hash = new Keccak(136, 0x06, 32);\n * hash.update(new Uint8Array([1, 2, 3]));\n * hash.digest();\n * ```\n */\nexport class Keccak {\n state;\n pos = 0;\n posOut = 0;\n finished = false;\n state32;\n destroyed = false;\n blockLen;\n suffix;\n outputLen;\n canXOF;\n enableXOF = false;\n rounds;\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n anumber(blockLen, 'blockLen');\n anumber(suffix, 'suffix');\n anumber(rounds, 'rounds');\n abool(enableXOF, 'enableXOF');\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.canXOF = enableXOF;\n this.rounds = rounds;\n // Can be passed from user as dkLen\n anumber(outputLen, 'outputLen');\n // Only keccak-f1600 is supported: 1600 bits (5x5 matrix of 64bit) === 200 bytes of state.\n if (!(0 < blockLen && blockLen < 200))\n throw new Error('\"blockLen\" must be 1..199');\n this.state = new Uint8Array(200);\n this.state32 = u32(this.state);\n }\n clone() {\n return this._cloneInto();\n }\n keccak() {\n swap32IfBE(this.state32);\n keccakP(this.state32, this.rounds);\n swap32IfBE(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { blockLen, state, state32 } = this;\n const len = data.length;\n // Absorb full blocks with u32 XORs when both sides are 4-byte aligned.\n // XOR of same-position words equals XOR of same-position bytes, so this is endianness-safe.\n const canUseU32 = blockLen % 4 === 0 && data.byteOffset % 4 === 0;\n const blockLen32 = blockLen / 4;\n const data32 = canUseU32 && len >= blockLen ? u32(data) : undefined;\n for (let pos = 0; pos < len;) {\n if (data32 !== undefined && this.pos === 0 && pos % 4 === 0 && len - pos >= blockLen) {\n for (let i = 0, o = pos / 4; i < blockLen32; i++)\n state32[i] ^= data32[o + i];\n pos += blockLen;\n // Subclasses (_KeccakPRG) read `this.pos` inside their `keccak()` override,\n // so it must reflect the fully-absorbed block before the permutation fires.\n this.pos = blockLen;\n this.keccak();\n continue;\n }\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1.\n // These byte values already include the first padding bit, while the\n // final `0x80` below supplies the closing `1` bit in the last rate byte.\n state[pos] ^= suffix;\n // If that combined suffix lands in the last rate byte and already sets\n // bit 7, absorb it first so the final pad10*1 bit can be xored into a\n // fresh block.\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n aexists(this, false);\n abytes(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Plain SHA3/Keccak usage with XOF is probably a mistake, but this base\n // class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/\n // TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF.\n if (!this.enableXOF)\n throw new Error('XOF is not enabled');\n return this.writeInto(out);\n }\n xof(bytes) {\n anumber(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n aoutput(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n // `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest.\n this.writeInto(out.length === this.outputLen ? out : out.subarray(0, this.outputLen));\n this.destroy();\n }\n digest() {\n const out = new Uint8Array(this.outputLen);\n this.digestInto(out);\n return out;\n }\n destroy() {\n this.destroyed = true;\n clean(this.state);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);\n // Reused destinations can come from a different rate/capacity variant, so clone must rewrite\n // the sponge geometry as well as the state words.\n to.blockLen = blockLen;\n to.state32.set(this.state32);\n // Sponge padding and XOF output are positional, so both offsets are part of the clone state.\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n // Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone\n // tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie.\n to.canXOF = this.canXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nconst genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info);\n/**\n * SHA3-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-224.\n * ```ts\n * sha3_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_224 = /* @__PURE__ */ genKeccak(0x06, 144, 28, \n/* @__PURE__ */ oidNist(0x07));\n/**\n * SHA3-256 hash function. Different from keccak-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-256.\n * ```ts\n * sha3_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32, \n/* @__PURE__ */ oidNist(0x08));\n/**\n * SHA3-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-384.\n * ```ts\n * sha3_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_384 = /* @__PURE__ */ genKeccak(0x06, 104, 48, \n/* @__PURE__ */ oidNist(0x09));\n/**\n * SHA3-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA3-512.\n * ```ts\n * sha3_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64, \n/* @__PURE__ */ oidNist(0x0a));\n/**\n * Keccak-224 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-224.\n * ```ts\n * keccak_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_224 = /* @__PURE__ */ genKeccak(0x01, 144, 28);\n/**\n * Keccak-256 hash function. Different from SHA3-256.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-256.\n * ```ts\n * keccak_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32);\n/**\n * Keccak-384 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-384.\n * ```ts\n * keccak_384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_384 = /* @__PURE__ */ genKeccak(0x01, 104, 48);\n/**\n * Keccak-512 hash function.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with Keccak-512.\n * ```ts\n * keccak_512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const keccak_512 = /* @__PURE__ */ genKeccak(0x01, 72, 64);\nconst genShake = (suffix, blockLen, outputLen, info = {}) => createHasher((opts = {}) => {\n opts = checkOpts({}, opts);\n return new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true);\n}, info);\n/**\n * SHAKE128 XOF with 128-bit security and a 16-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128.\n * ```ts\n * shake128(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 16, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 256-bit security and a 32-byte default output.\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256.\n * ```ts\n * shake256(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 32, /* @__PURE__ */ oidNist(0x0c));\n/**\n * SHAKE128 XOF with 256-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE128 using a 32-byte default output.\n * ```ts\n * shake128_32(new Uint8Array([97, 98, 99]), { dkLen: 32 });\n * ```\n */\nexport const shake128_32 = \n/* @__PURE__ */\ngenShake(0x1f, 168, 32, /* @__PURE__ */ oidNist(0x0b));\n/**\n * SHAKE256 XOF with 512-bit output (NIST version).\n * @param msg - message bytes to hash\n * @param opts - Optional output-length override. See {@link ShakeOpts}.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHAKE256 using a 64-byte default output.\n * ```ts\n * shake256_64(new Uint8Array([97, 98, 99]), { dkLen: 64 });\n * ```\n */\nexport const shake256_64 = \n/* @__PURE__ */\ngenShake(0x1f, 136, 64, /* @__PURE__ */ oidNist(0x0c));\n","\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map","/** The current version of corebc; keep in sync with package.json. */\nexport const version = \"0.4.1\";\n//# sourceMappingURL=_version.js.map","import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }\n });\n}\n//# sourceMappingURL=properties.js.map","/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map","/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return new Uint8Array(result);\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return new Uint8Array(result);\n }\n if (isBytes(value)) {\n return new Uint8Array(value);\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map","/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map","/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map","/**\n * Internal Merkle-Damgard hash utils.\n * @module\n */\nimport { setU64FromNum } from \"./_u64.js\";\nimport { abytes, aexists, aoutput, createView } from \"./utils.js\";\n/**\n * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.\n * Returns bits from `b` when `a` is set, otherwise from `c`.\n * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never\n * set the same bit.\n * @param a - selector word\n * @param b - word chosen when selector bit is set\n * @param c - word chosen when selector bit is clear\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit choice primitive.\n * ```ts\n * Chi(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Chi(a, b, c) {\n return (a & b) ^ (~a & c);\n}\n/**\n * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.\n * Returns bits shared by at least two inputs.\n * @param a - first input word\n * @param b - second input word\n * @param c - third input word\n * @returns Mixed 32-bit word.\n * @example\n * Combine three words with the shared 32-bit majority primitive.\n * ```ts\n * Maj(0xffffffff, 0x12345678, 0x87654321);\n * ```\n */\nexport function Maj(a, b, c) {\n return (a & b) ^ (a & c) ^ (b & c);\n}\n/**\n * Merkle-Damgard hash construction base class.\n * Could be used to create MD5, RIPEMD, SHA1, SHA2.\n * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit\n * strings with partial-byte tails.\n * @param blockLen - internal block size in bytes\n * @param outputLen - digest size in bytes\n * @param padOffset - trailing length field size in bytes\n * @param isLE - whether length and state words are encoded in little-endian\n * @example\n * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.\n * ```ts\n * import { _SHA1 } from '@noble/hashes/legacy.js';\n * const hash = new _SHA1();\n * hash.update(new Uint8Array([97, 98, 99]));\n * hash.digest();\n * ```\n */\nexport class HashMD {\n blockLen;\n outputLen;\n canXOF = false;\n padOffset;\n isLE;\n // For partial updates less than block size\n buffer;\n view;\n finished = false;\n length = 0;\n pos = 0;\n destroyed = false;\n constructor(blockLen, outputLen, padOffset, isLE) {\n this.blockLen = blockLen;\n this.outputLen = outputLen;\n this.padOffset = padOffset;\n this.isLE = isLE;\n this.buffer = new Uint8Array(blockLen);\n this.view = createView(this.buffer);\n }\n update(data) {\n aexists(this);\n abytes(data);\n const { view, buffer, blockLen } = this;\n const len = data.length;\n let processed = false;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n // Fast path only when there is no buffered partial block: `take === blockLen` implies\n // `this.pos === 0`, so we can process full blocks directly from the input view.\n if (take === blockLen) {\n const dataView = createView(data);\n for (; blockLen <= len - pos; pos += blockLen)\n this.process(dataView, pos);\n processed = true;\n continue;\n }\n // When the whole input is buffered in one go (common for short messages), passing `data`\n // directly avoids allocating a subarray view.\n buffer.set(pos === 0 && take === len ? data : 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 processed = true;\n }\n }\n this.length += data.length;\n // Shared schedule buffers only pick up input-derived words inside process(); if everything\n // was buffered without processing, there is nothing to zero.\n if (processed)\n this.roundClean();\n return this;\n }\n digestInto(out) {\n aexists(this);\n aoutput(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, then zero-pad the rest of the block\n buffer[pos++] = 0b10000000;\n buffer.fill(0, pos);\n // we have less than padOffset left in buffer, so we cannot put length in\n // current block, need process it and pad again\n if (this.padOffset > blockLen - pos) {\n this.process(view, 0);\n buffer.fill(0);\n }\n // `padOffset` reserves the whole length field. For SHA-384/512 the high 64 bits stay zero from\n // the padding fill above, and JS will overflow before user input can make that half non-zero.\n // So we only need to write the low 64 bits here (`length * 8` only scales the exponent of an\n // integer below 2**53, so the split inside the helper stays exact).\n setU64FromNum(view, blockLen - 8, this.length * 8, isLE);\n this.process(view, 0);\n // The final block above is processed outside update(), so the shared message-schedule\n // buffers (e.g. SHA256_W) would otherwise retain input-derived words after digest().\n this.roundClean();\n // digest() passes our own `buffer` as `out`; reuse its cached view instead of allocating one.\n const oview = out === buffer ? view : createView(out);\n const len = this.outputLen;\n // NOTE: we do division by 4 later, which must be fused in single op with modulo by JIT\n const outLen = len / 4;\n const state = this.get();\n // Subclass-misconfiguration invariant: outputLen must be 32-bit aligned and fit the state.\n if (len % 4 || outLen > state.length)\n throw new Error('invalid outputLen');\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 // Copy before destroy(): subclasses wipe `buffer` during cleanup, but `digest()` must return\n // fresh bytes to the caller.\n const res = buffer.slice(0, outputLen);\n this.destroy();\n return res;\n }\n _cloneIntoMeta(to) {\n const { buffer, length, finished, destroyed, pos } = this;\n to.destroyed = destroyed;\n to.finished = finished;\n to.length = length;\n to.pos = pos;\n // Only partial-block bytes need copying: when `length % blockLen === 0`, `pos === 0` and\n // later `update()` / `digestInto()` overwrite `to.buffer` from the start before reading it.\n if (pos)\n to.buffer.set(buffer); // Avoid a hot modulo guard.\n return to;\n }\n clone() {\n return this._cloneInto();\n }\n}\n/**\n * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.\n * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.\n */\n/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the\n * square roots of the first eight prime numbers. Exported as a shared table; callers must treat\n * it as read-only because constructors copy words from it by index. */\nexport const SHA256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\n]);\n/** Initial SHA224 state `H(0)` from RFC 6234 §6.1. Exported as a shared table; callers must\n * treat it as read-only because constructors copy words from it by index. */\nexport const SHA224_IV = /* @__PURE__ */ Uint32Array.from([\n 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,\n]);\n/** Initial SHA384 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the ninth\n * through sixteenth prime numbers. Exported as a shared table; callers must treat it as read-only\n * because constructors copy halves from it by index. */\nexport const SHA384_IV = /* @__PURE__ */ Uint32Array.from([\n 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939,\n 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4,\n]);\n/** Initial SHA512 state from RFC 6234 §6.3: eight RFC 64-bit `H(0)` words stored as sixteen\n * big-endian 32-bit halves. Derived from the fractional parts of the square roots of the first\n * eight prime numbers. Exported as a shared table; callers must treat it as read-only because\n * constructors copy halves from it by index. */\nexport const SHA512_IV = /* @__PURE__ */ Uint32Array.from([\n 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1,\n 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179,\n]);\n","/**\n\nSHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions.\nRFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors,\nnot the base RIPEMD-160 compression spec.\nDon't use them in a new protocol. What \"weak\" means:\n\n- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.\n- No practical pre-image attacks (only theoretical, 2^123.4)\n- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151\n * @module\n */\nimport { Chi, HashMD, Maj } from \"./_md.js\";\nimport { clean, createHasher, rotl } from \"./utils.js\";\n/** Initial SHA-1 state from RFC 3174 §6.1. */\nconst SHA1_IV = /* @__PURE__ */ Uint32Array.from([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\n// Reusable 80-word SHA-1 message schedule buffer.\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA1 legacy hash class. */\nexport class _SHA1 extends HashMD {\n A = SHA1_IV[0] | 0;\n B = SHA1_IV[1] | 0;\n C = SHA1_IV[2] | 0;\n D = SHA1_IV[3] | 0;\n E = SHA1_IV[4] | 0;\n constructor() {\n super(64, 20, 8, false);\n }\n get() {\n const { A, B, C, D, E } = this;\n return [A, B, C, D, E];\n }\n set(A, B, C, D, E) {\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 }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n SHA1_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 80; i++)\n SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n // Compression function main loop, 80 rounds\n let { A, B, C, D, E } = this;\n for (let i = 0; i < 80; i++) {\n let F, K;\n if (i < 20) {\n F = Chi(B, C, D);\n K = 0x5a827999;\n }\n else if (i < 40) {\n F = B ^ C ^ D;\n K = 0x6ed9eba1;\n }\n else if (i < 60) {\n F = Maj(B, C, D);\n K = 0x8f1bbcdc;\n }\n else {\n F = B ^ C ^ D;\n K = 0xca62c1d6;\n }\n const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0;\n E = D;\n D = C;\n C = rotl(B, 30);\n B = A;\n A = T;\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 this.set(A, B, C, D, E);\n }\n roundClean() {\n clean(SHA1_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA1.\n * ```ts\n * sha1(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha1 = /* @__PURE__ */ createHasher(() => new _SHA1());\n/** RFC 1321 `T[i]` uses `floor(2^32 * abs(sin(i)))`; this is the shared `2^32` scale factor. */\nconst p32 = /* @__PURE__ */ Math.pow(2, 32);\n/** RFC 1321 `T[1..64]` table. */\nconst K = /* @__PURE__ */ Array.from({ length: 64 }, (_, i) => Math.floor(p32 * Math.abs(Math.sin(i + 1))));\n/** MD5 initial state from RFC 1321, stored as 4 u32 words. */\nconst MD5_IV = /* @__PURE__ */ SHA1_IV.slice(0, 4);\n// Reusable 16-word MD5 message block buffer.\nconst MD5_W = /* @__PURE__ */ new Uint32Array(16);\n// RFC 1321 §3.4 per-round rotate amounts, flattened to 64 entries so the round loop\n// avoids allocating a 4-element array literal every round (measured ~5% of md5).\nconst MD5_SHIFTS = /* @__PURE__ */ (() => {\n const S = [\n [7, 12, 17, 22],\n [5, 9, 14, 20],\n [4, 11, 16, 23],\n [6, 10, 15, 21],\n ];\n return Uint8Array.from({ length: 64 }, (_, i) => S[Math.floor(i / 16)][i % 4]);\n})();\n/** Internal MD5 legacy hash class. */\nexport class _MD5 extends HashMD {\n A = MD5_IV[0] | 0;\n B = MD5_IV[1] | 0;\n C = MD5_IV[2] | 0;\n D = MD5_IV[3] | 0;\n constructor() {\n super(64, 16, 8, true);\n }\n get() {\n const { A, B, C, D } = this;\n return [A, B, C, D];\n }\n set(A, B, C, D) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n MD5_W[i] = view.getUint32(offset, true);\n // Compression function main loop, 64 rounds\n let { A, B, C, D } = this;\n for (let i = 0; i < 64; i++) {\n let F, g;\n if (i < 16) {\n F = Chi(B, C, D);\n g = i;\n }\n else if (i < 32) {\n // RFC 1321 round 2 uses G(B,C,D) = (B & D) | (C & ~D), which is `Chi(D, B, C)`.\n F = Chi(D, B, C);\n g = (5 * i + 1) % 16;\n }\n else if (i < 48) {\n F = B ^ C ^ D;\n g = (3 * i + 5) % 16;\n }\n else {\n F = C ^ (B | ~D);\n g = (7 * i) % 16;\n }\n F = F + A + K[i] + MD5_W[g];\n A = D;\n D = C;\n C = B;\n B = B + rotl(F, MD5_SHIFTS[i]);\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 this.set(A, B, C, D);\n }\n roundClean() {\n clean(MD5_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/**\n * MD5 (RFC 1321) legacy hash function. It was cryptographically broken.\n * MD5 architecture is similar to SHA1, with some differences:\n * - Reduced output length: 16 bytes (128 bit) instead of 20\n * - 64 rounds, instead of 80\n * - Little-endian: could be faster, but will require more code\n * - Non-linear index selection: huge speed-up for unroll\n * - Per round constants: more memory accesses, additional speed-up for unroll\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with MD5.\n * ```ts\n * md5(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const md5 = /* @__PURE__ */ createHasher(() => new _MD5());\n// RIPEMD-160\n// Permutation repeatedly applied to derive the later RIPEMD-160 message-order tables.\nconst Rho160 = /* @__PURE__ */ Uint8Array.from([\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n]);\nconst Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();\nconst Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();\n// Five left/right message-word orderings for the RIPEMD-160 dual-lane rounds.\nconst idxLR = /* @__PURE__ */ (() => {\n const L = [Id160];\n const R = [Pi160];\n const res = [L, R];\n for (let i = 0; i < 4; i++)\n for (let j of res)\n j.push(j[i].map((k) => Rho160[k]));\n return res;\n})();\nconst idxL = /* @__PURE__ */ (() => idxLR[0])();\nconst idxR = /* @__PURE__ */ (() => idxLR[1])();\n// const [idxL, idxR] = idxLR;\n// Base per-group shift table before the left/right message-order permutations are applied.\nconst shifts160 = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => Uint8Array.from(i));\nconst shiftsL160 = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts160[i][j]));\nconst shiftsR160 = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts160[i][j]));\n// Five left-lane additive constants for RIPEMD-160.\nconst Kl160 = /* @__PURE__ */ Uint32Array.from([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\n// Five right-lane additive constants for RIPEMD-160.\nconst Kr160 = /* @__PURE__ */ Uint32Array.from([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// Called `f()` in the spec; valid `group` values are 0..4, and out-of-range\n// inputs currently fall through to the group-4 branch.\nfunction ripemd_f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n if (group === 1)\n return (x & y) | (~x & z);\n if (group === 2)\n return (x | ~y) ^ z;\n if (group === 3)\n return (x & z) | (y & ~z);\n return x ^ (y | ~z);\n}\n// Reusable 16-word RIPEMD-160 message block buffer.\nconst BUF_160 = /* @__PURE__ */ new Uint32Array(16);\n/**\n * Internal RIPEMD-160 legacy hash class.\n * RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification.\n */\nexport class _RIPEMD160 extends HashMD {\n h0 = 0x67452301 | 0;\n h1 = 0xefcdab89 | 0;\n h2 = 0x98badcfe | 0;\n h3 = 0x10325476 | 0;\n h4 = 0xc3d2e1f0 | 0;\n constructor() {\n super(64, 20, 8, true);\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF_160[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl160[group], hbr = Kr160[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL160[group], sr = shiftsR160[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + ripemd_f(group, bl, cl, dl) + BUF_160[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + ripemd_f(rGroup, br, cr, dr) + BUF_160[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n // Final recombination cross-adds the left/right lane accumulators into the next h0..h4 order.\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n clean(BUF_160);\n }\n destroy() {\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a legacy hash function from 1990s.\n * RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point\n * at the base RIPEMD-160 references.\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html}\n * * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf}\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with RIPEMD-160.\n * ```ts\n * ripemd160(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const ripemd160 = /* @__PURE__ */ createHasher(() => new _RIPEMD160());\n","/**\n * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.\n * SHA256 is the fastest hash implementable in JS, even faster than Blake3.\n * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and\n * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.\n * @module\n */\nimport { Chi, HashMD, Maj, SHA224_IV, SHA256_IV, SHA384_IV, SHA512_IV } from \"./_md.js\";\nimport * as u64 from \"./_u64.js\";\nimport { clean, createHasher, oidNist, rotr } from \"./utils.js\";\n/**\n * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits\n * of the cube roots of the first 64 primes (2..311).\n */\n// prettier-ignore\nconst SHA256_K = /* @__PURE__ */ Uint32Array.from([\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/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */\nconst SHA256_W = /* @__PURE__ */ new Uint32Array(64);\n/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */\nclass SHA2_32B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and makes sha256 3x slower (measured).\n A = 0;\n B = 0;\n C = 0;\n D = 0;\n E = 0;\n F = 0;\n G = 0;\n H = 0;\n constructor(outputLen, IV) {\n super(64, outputLen, 8, false);\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 _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\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 clean(SHA256_W);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n this.set(0, 0, 0, 0, 0, 0, 0, 0);\n clean(this.buffer);\n }\n}\n/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */\nexport class _SHA256 extends SHA2_32B {\n constructor() {\n super(32, SHA256_IV);\n }\n}\n/** Internal SHA-224 hash class grounded in RFC 6234 §6.2 and §8.5. */\nexport class _SHA224 extends SHA2_32B {\n constructor() {\n super(28, SHA224_IV);\n }\n}\n// SHA2-512 is slower than sha256 in js because u64 operations are slow.\n// SHA-384 / SHA-512 round constants from RFC 6234 §5.2:\n// 80 full 64-bit words split into high/low halves.\n// prettier-ignore\nconst K512 = /* @__PURE__ */ (() => u64.split([\n '0x428a2f98d728ae22', '0x7137449123ef65cd', '0xb5c0fbcfec4d3b2f', '0xe9b5dba58189dbbc',\n '0x3956c25bf348b538', '0x59f111f1b605d019', '0x923f82a4af194f9b', '0xab1c5ed5da6d8118',\n '0xd807aa98a3030242', '0x12835b0145706fbe', '0x243185be4ee4b28c', '0x550c7dc3d5ffb4e2',\n '0x72be5d74f27b896f', '0x80deb1fe3b1696b1', '0x9bdc06a725c71235', '0xc19bf174cf692694',\n '0xe49b69c19ef14ad2', '0xefbe4786384f25e3', '0x0fc19dc68b8cd5b5', '0x240ca1cc77ac9c65',\n '0x2de92c6f592b0275', '0x4a7484aa6ea6e483', '0x5cb0a9dcbd41fbd4', '0x76f988da831153b5',\n '0x983e5152ee66dfab', '0xa831c66d2db43210', '0xb00327c898fb213f', '0xbf597fc7beef0ee4',\n '0xc6e00bf33da88fc2', '0xd5a79147930aa725', '0x06ca6351e003826f', '0x142929670a0e6e70',\n '0x27b70a8546d22ffc', '0x2e1b21385c26c926', '0x4d2c6dfc5ac42aed', '0x53380d139d95b3df',\n '0x650a73548baf63de', '0x766a0abb3c77b2a8', '0x81c2c92e47edaee6', '0x92722c851482353b',\n '0xa2bfe8a14cf10364', '0xa81a664bbc423001', '0xc24b8b70d0f89791', '0xc76c51a30654be30',\n '0xd192e819d6ef5218', '0xd69906245565a910', '0xf40e35855771202a', '0x106aa07032bbd1b8',\n '0x19a4c116b8d2d0c8', '0x1e376c085141ab53', '0x2748774cdf8eeb99', '0x34b0bcb5e19b48a8',\n '0x391c0cb3c5c95a63', '0x4ed8aa4ae3418acb', '0x5b9cca4f7763e373', '0x682e6ff3d6b2b8a3',\n '0x748f82ee5defb2fc', '0x78a5636f43172f60', '0x84c87814a1f0ab72', '0x8cc702081a6439ec',\n '0x90befffa23631e28', '0xa4506cebde82bde9', '0xbef9a3f7b2c67915', '0xc67178f2e372532b',\n '0xca273eceea26619c', '0xd186b8c721c0c207', '0xeada7dd6cde0eb1e', '0xf57d4f7fee6ed178',\n '0x06f067aa72176fba', '0x0a637dc5a2c898a6', '0x113f9804bef90dae', '0x1b710b35131c471b',\n '0x28db77f523047d84', '0x32caab7b40c72493', '0x3c9ebe0a15c9bebc', '0x431d67c49c100d4c',\n '0x4cc5d4becb3e42b6', '0x597f299cfc657e2a', '0x5fcb6fab3ad6faec', '0x6c44198c4a475817'\n].map(n => BigInt(n))))();\nconst SHA512_Kh = /* @__PURE__ */ (() => K512[0])();\nconst SHA512_Kl = /* @__PURE__ */ (() => K512[1])();\n// Reusable high-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_H = /* @__PURE__ */ new Uint32Array(80);\n// Reusable low-half schedule buffer for the RFC 6234 §6.4 64-bit `W_t` words.\nconst SHA512_W_L = /* @__PURE__ */ new Uint32Array(80);\n/** Internal SHA-384 / SHA-512 compression engine from RFC 6234 §6.4. */\nclass SHA2_64B extends HashMD {\n // We cannot use array here since array allows indexing by variable\n // which means optimizer/compiler cannot use registers.\n // h -- high 32 bits, l -- low 32 bits\n // Numeric initializers matter: starting the fields as `undefined` changes\n // V8's field representation and slows hashing down (measured on sha256).\n Ah = 0;\n Al = 0;\n Bh = 0;\n Bl = 0;\n Ch = 0;\n Cl = 0;\n Dh = 0;\n Dl = 0;\n Eh = 0;\n El = 0;\n Fh = 0;\n Fl = 0;\n Gh = 0;\n Gl = 0;\n Hh = 0;\n Hl = 0;\n constructor(outputLen, IV) {\n super(128, outputLen, 16, false);\n this.Ah = IV[0] | 0;\n this.Al = IV[1] | 0;\n this.Bh = IV[2] | 0;\n this.Bl = IV[3] | 0;\n this.Ch = IV[4] | 0;\n this.Cl = IV[5] | 0;\n this.Dh = IV[6] | 0;\n this.Dl = IV[7] | 0;\n this.Eh = IV[8] | 0;\n this.El = IV[9] | 0;\n this.Fh = IV[10] | 0;\n this.Fl = IV[11] | 0;\n this.Gh = IV[12] | 0;\n this.Gl = IV[13] | 0;\n this.Hh = IV[14] | 0;\n this.Hl = IV[15] | 0;\n }\n // prettier-ignore\n get() {\n const { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n return [Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl];\n }\n // prettier-ignore\n set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl) {\n this.Ah = Ah | 0;\n this.Al = Al | 0;\n this.Bh = Bh | 0;\n this.Bl = Bl | 0;\n this.Ch = Ch | 0;\n this.Cl = Cl | 0;\n this.Dh = Dh | 0;\n this.Dl = Dl | 0;\n this.Eh = Eh | 0;\n this.El = El | 0;\n this.Fh = Fh | 0;\n this.Fl = Fl | 0;\n this.Gh = Gh | 0;\n this.Gl = Gl | 0;\n this.Hh = Hh | 0;\n this.Hl = Hl | 0;\n }\n _cloneInto(to) {\n (to ||= new this.constructor()).set(...this.get());\n return this._cloneIntoMeta(to);\n }\n process(view, offset) {\n // Extend the first 16 words into the remaining 64 words w[16..79] of the message schedule array\n for (let i = 0; i < 16; i++, offset += 4) {\n SHA512_W_H[i] = view.getUint32(offset);\n SHA512_W_L[i] = view.getUint32((offset += 4));\n }\n for (let i = 16; i < 80; i++) {\n // s0 := (w[i-15] rightrotate 1) xor (w[i-15] rightrotate 8) xor (w[i-15] rightshift 7)\n const W15h = SHA512_W_H[i - 15] | 0;\n const W15l = SHA512_W_L[i - 15] | 0;\n const s0h = u64.rotrSH(W15h, W15l, 1) ^ u64.rotrSH(W15h, W15l, 8) ^ u64.shrSH(W15h, W15l, 7);\n const s0l = u64.rotrSL(W15h, W15l, 1) ^ u64.rotrSL(W15h, W15l, 8) ^ u64.shrSL(W15h, W15l, 7);\n // s1 := (w[i-2] rightrotate 19) xor (w[i-2] rightrotate 61) xor (w[i-2] rightshift 6)\n const W2h = SHA512_W_H[i - 2] | 0;\n const W2l = SHA512_W_L[i - 2] | 0;\n const s1h = u64.rotrSH(W2h, W2l, 19) ^ u64.rotrBH(W2h, W2l, 61) ^ u64.shrSH(W2h, W2l, 6);\n const s1l = u64.rotrSL(W2h, W2l, 19) ^ u64.rotrBL(W2h, W2l, 61) ^ u64.shrSL(W2h, W2l, 6);\n // SHA512_W[i] = s0 + s1 + SHA512_W[i - 7] + SHA512_W[i - 16];\n const SUMl = u64.add4L(s0l, s1l, SHA512_W_L[i - 7], SHA512_W_L[i - 16]);\n const SUMh = u64.add4H(SUMl, s0h, s1h, SHA512_W_H[i - 7], SHA512_W_H[i - 16]);\n SHA512_W_H[i] = SUMh | 0;\n SHA512_W_L[i] = SUMl | 0;\n }\n let { Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl } = this;\n // Compression function main loop, 80 rounds\n for (let i = 0; i < 80; i++) {\n // S1 := (e rightrotate 14) xor (e rightrotate 18) xor (e rightrotate 41)\n const sigma1h = u64.rotrSH(Eh, El, 14) ^ u64.rotrSH(Eh, El, 18) ^ u64.rotrBH(Eh, El, 41);\n const sigma1l = u64.rotrSL(Eh, El, 14) ^ u64.rotrSL(Eh, El, 18) ^ u64.rotrBL(Eh, El, 41);\n //const T1 = (H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i]) | 0;\n const CHIh = (Eh & Fh) ^ (~Eh & Gh);\n const CHIl = (El & Fl) ^ (~El & Gl);\n // T1 = H + sigma1 + Chi(E, F, G) + SHA512_K[i] + SHA512_W[i]\n // prettier-ignore\n const T1ll = u64.add5L(Hl, sigma1l, CHIl, SHA512_Kl[i], SHA512_W_L[i]);\n const T1h = u64.add5H(T1ll, Hh, sigma1h, CHIh, SHA512_Kh[i], SHA512_W_H[i]);\n const T1l = T1ll | 0;\n // S0 := (a rightrotate 28) xor (a rightrotate 34) xor (a rightrotate 39)\n const sigma0h = u64.rotrSH(Ah, Al, 28) ^ u64.rotrBH(Ah, Al, 34) ^ u64.rotrBH(Ah, Al, 39);\n const sigma0l = u64.rotrSL(Ah, Al, 28) ^ u64.rotrBL(Ah, Al, 34) ^ u64.rotrBL(Ah, Al, 39);\n const MAJh = (Ah & Bh) ^ (Ah & Ch) ^ (Bh & Ch);\n const MAJl = (Al & Bl) ^ (Al & Cl) ^ (Bl & Cl);\n Hh = Gh | 0;\n Hl = Gl | 0;\n Gh = Fh | 0;\n Gl = Fl | 0;\n Fh = Eh | 0;\n Fl = El | 0;\n ({ h: Eh, l: El } = u64.add(Dh | 0, Dl | 0, T1h | 0, T1l | 0));\n Dh = Ch | 0;\n Dl = Cl | 0;\n Ch = Bh | 0;\n Cl = Bl | 0;\n Bh = Ah | 0;\n Bl = Al | 0;\n const All = u64.add3L(T1l, sigma0l, MAJl);\n Ah = u64.add3H(All, T1h, sigma0h, MAJh);\n Al = All | 0;\n }\n // Add the compressed chunk to the current hash value\n ({ h: Ah, l: Al } = u64.add(this.Ah | 0, this.Al | 0, Ah | 0, Al | 0));\n ({ h: Bh, l: Bl } = u64.add(this.Bh | 0, this.Bl | 0, Bh | 0, Bl | 0));\n ({ h: Ch, l: Cl } = u64.add(this.Ch | 0, this.Cl | 0, Ch | 0, Cl | 0));\n ({ h: Dh, l: Dl } = u64.add(this.Dh | 0, this.Dl | 0, Dh | 0, Dl | 0));\n ({ h: Eh, l: El } = u64.add(this.Eh | 0, this.El | 0, Eh | 0, El | 0));\n ({ h: Fh, l: Fl } = u64.add(this.Fh | 0, this.Fl | 0, Fh | 0, Fl | 0));\n ({ h: Gh, l: Gl } = u64.add(this.Gh | 0, this.Gl | 0, Gh | 0, Gl | 0));\n ({ h: Hh, l: Hl } = u64.add(this.Hh | 0, this.Hl | 0, Hh | 0, Hl | 0));\n this.set(Ah, Al, Bh, Bl, Ch, Cl, Dh, Dl, Eh, El, Fh, Fl, Gh, Gl, Hh, Hl);\n }\n roundClean() {\n clean(SHA512_W_H, SHA512_W_L);\n }\n destroy() {\n // HashMD callers route post-destroy usability through `destroyed`; zeroizing alone still leaves\n // update()/digest() callable on reused instances.\n this.destroyed = true;\n clean(this.buffer);\n this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n }\n}\n/** Internal SHA-512 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA512 extends SHA2_64B {\n constructor() {\n super(64, SHA512_IV);\n }\n}\n/** Internal SHA-384 hash class grounded in RFC 6234 §6.3 and §6.4. */\nexport class _SHA384 extends SHA2_64B {\n constructor() {\n super(48, SHA384_IV);\n }\n}\n/**\n * Truncated SHA512/256 and SHA512/224.\n * SHA512_IV is XORed with 0xa5a5a5a5a5a5a5a5, then used as \"intermediary\" IV of SHA512/t.\n * Then t hashes string to produce result IV.\n * See the repo-side derivation recipe in `test/misc/sha2-gen-iv.js`.\n * These IV literals are checked against that script rather than a dedicated\n * local RFC section.\n */\n/** SHA-512/224 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T224_IV = /* @__PURE__ */ Uint32Array.from([\n 0x8c3d37c8, 0x19544da2, 0x73e19966, 0x89dcd4d6, 0x1dfab7ae, 0x32ff9c82, 0x679dd514, 0x582f9fcf,\n 0x0f6d2b69, 0x7bd44da8, 0x77e36f73, 0x04c48942, 0x3f9d85a8, 0x6a1d36c8, 0x1112e6ad, 0x91d692a1,\n]);\n/** SHA-512/256 IV derived by the SHA-512/t recipe in `test/misc/sha2-gen-iv.js` and\n * stored as sixteen big-endian 32-bit halves. */\nconst T256_IV = /* @__PURE__ */ Uint32Array.from([\n 0x22312194, 0xfc2bf72c, 0x9f555fa3, 0xc84c64c2, 0x2393b86b, 0x6f53b151, 0x96387719, 0x5940eabd,\n 0x96283ee2, 0xa88effe3, 0xbe5e1e25, 0x53863992, 0x2b0199fc, 0x2c85b8aa, 0x0eb72ddc, 0x81c52ca2,\n]);\n/** Internal SHA-512/224 hash class using the derived `T224_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_224 extends SHA2_64B {\n constructor() {\n super(28, T224_IV);\n }\n}\n/** Internal SHA-512/256 hash class using the derived `T256_IV` and the shared\n * RFC 6234 §6.4 compression engine. */\nexport class _SHA512_256 extends SHA2_64B {\n constructor() {\n super(32, T256_IV);\n }\n}\n/**\n * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:\n *\n * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.\n * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.\n * - Each sha256 hash is executing 2^18 bit operations.\n * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-256.\n * ```ts\n * sha256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), \n/* @__PURE__ */ oidNist(0x01));\n/**\n * SHA2-224 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-224.\n * ```ts\n * sha224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha224 = /* @__PURE__ */ createHasher(() => new _SHA224(), \n/* @__PURE__ */ oidNist(0x04));\n/**\n * SHA2-512 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512.\n * ```ts\n * sha512(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512 = /* @__PURE__ */ createHasher(() => new _SHA512(), \n/* @__PURE__ */ oidNist(0x03));\n/**\n * SHA2-384 hash function from RFC 4634.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-384.\n * ```ts\n * sha384(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha384 = /* @__PURE__ */ createHasher(() => new _SHA384(), \n/* @__PURE__ */ oidNist(0x02));\n/**\n * SHA2-512/256 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/256.\n * ```ts\n * sha512_256(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_256 = /* @__PURE__ */ createHasher(() => new _SHA512_256(), \n/* @__PURE__ */ oidNist(0x06));\n/**\n * SHA2-512/224 \"truncated\" hash function, with improved resistance to length extension attacks.\n * See the paper on {@link https://eprint.iacr.org/2010/548.pdf | truncated SHA512}.\n * @param msg - message bytes to hash\n * @param opts - Reserved hash options.\n * @returns Digest bytes.\n * @example\n * Hash a message with SHA2-512/224.\n * ```ts\n * sha512_224(new Uint8Array([97, 98, 99]));\n * ```\n */\nexport const sha512_224 = /* @__PURE__ */ createHasher(() => new _SHA512_224(), \n/* @__PURE__ */ oidNist(0x05));\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","/* Browser Crypto Shims */\nimport { ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"ripemd160\":\n return ripemd160.create();\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512, \"sha3-256\": sha3_256, \"sha3-512\": sha3_512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map","import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = (data) => hexlify(createHash(\"sha3-256\").update(data).digest());\nconst _sha512 = (data) => hexlify(createHash(\"sha3-512\").update(data).digest());\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA3-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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n return hexlify(createHash(\"ripemd160\").update(getBytes(data)).digest());\n}\nexport function sha256(data) {\n return hexlify(__sha256(getBytes(data)));\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(createHmac(\"sha3-256\", k).update(d).digest());\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(createHmac(\"sha3-512\", k).update(d).digest());\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 SHA3-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 return hexlify(__sha512(getBytes(data)));\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha512);\n//# sourceMappingURL=sha3.js.map","import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.js.map","import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map","import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map","// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNzZ(2O&2KolivUv!4It_N(0Dn(Ke)KrPot0Ak~AlIkRkot2Kli$a:L-oRe[T_Tum1E,1B!a}'#Cib_Fic Fla%KlKr{Mokr!PreseRbyS#T-tiv3Kob,zKt|O^P]mSkSp+jV`]Vo/2AhaOuhoUhopis1Es0BroByt-C@t}ut DnesH+dHo^H,JemJn?Kl`KolaKtAzeDolObn(OgerieOzdSn(T Z(2B@}'noD-HaH'#S SnoT(0Oj?Or>2Nam :9O]gOnomie0EktronIpsa0AilIseO%P!ie2Izo^O/aOpejOs2EjEn%K<)Kymo0Ike)0FR&S]Zky3StOhOup(T!Ub.U/o)0AtO)Yz0IsOjivoOut0Bl.Boj}DinyDl!Dno)D|Jn(KejLin#L#LubMo+N [No,%RalR^RizontRkoRliv>RmonRn.R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/aNoklN$rumNt|NzunSazSkytStTiva%T<#Ty#U/aUdr(Zai#Z-Zol2AmKevTvolaZ{Zut(0T _1DrcF]nL!MieN?S{Ta%ZeumZi#nt3Sliv>0Da:B*r!}yt!Da%Dbyt-DhozDobroDpisHlasHn!Hodi+H,d Iv aJedn*Ji$oJm=K]n Kon>Krm LevoMaz!Mluv Nom{rOkoOpakO$roP`!PevnoPln P~Pos+dPr(oRod RubyRy/]S` S-!S+poSt!TolikV@-Vr/VzdR&Ru[RysSahSluhaS)r!UvVazVin VodVyk+Yv!_Z<0AsElEn Hl` Ho)H,&It~0BojByt}odCiz Ebr!Esl!Evzd!EzvaH`%Hod J{JinudKazK*p LivLu#Ml#Oln(P`PisPl=PLivoLu[Mf+tMls-N@#Ni#N&N|N$voNtof+Pri#Rke)RodieR)Ru#Ry[Se#Siv aSt_#T@tTro&V*kZnehtZ*r-3C#DagogJs-K]LotonNal)Ndr-NzeRiskopRoStr(Tar^T?Tro+jVn.Xeso3Ani$aHaJav?K+KnikL.Ln(Lul#Nze)Pe)S!_Sto+Tev&Vn?V'ar2A%n)Ak!Am@Ane)A$i#At Avid]AzE/Em@oEn)EsEtivoEv_Iv!N NoO/aOd.Om[OutUkYn2Bav Byt}odC Ctiv>D!D%n Deps!Dh+dDiv Dkl`Dman DnikDo[Dpo,D,zD$!aDvodDzimEzieHan#Hnut#H'S*d SpoluS)vaSud-SypTahT#nT+skTom-T,vaTupaTvo,U#zUtoUzdroVahaVidlaVlakVozVr/V$!VykVzde/Zd,vZem-Zn!-ZAp<-AseAv^IncipKnoObud O%ntoOdejOfeseOh,Oj-tO]m Omi+Onik!Op`OrokOs[OtonOut-OvazS#v#St@Udk(UtV-VohOvodTruh0Actvo0Ber)}DlKav>Kl.Kr+LtMpaNcP@SaSin#St.T|Ty#3Rami^SkT_::C-}otDia%Dn?DonFtGbyKe)K'.M@oMp*/NdeRa/R aS'&StrTo+$Zan%Zid]3Ag|Ak%CeptDaktMizd!Mo)N #Rdin#San#T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ad T*p Tup0Ip4Bav Br!}|D!D,Fot H+d!H~Hod H,d Hub Jasn J{Jm=K]p Kon!L-!Maz!Mez Miz{Mys+tNe/!Nik!Nut P`!Pl! P,v Pu$ Raz R'n!Rv!Sl' SokoS)v Su~Syp!Tas Tes!Tr! Vi~Vol!Vrh_Zdob Zn!0AduBud }op DJ{Ji$ K+p!K*p Lep Mez Mot!Mys+tNe/!Nik!Pl! Poj Ps!Raz S)v Su~Taj Temn Tk~Ujm=Val Ve+tVin Vol!Vrt!Zvon 0Av RusuUd|Yt-1A+#ArmaAtn(IvoOb RojVihYm`]0L@.ManM.Pt!Z`uZdola2At Lt~Lubo#Ot' Ru[0MaMn?0Emn 0Lam!Oum!R!#Umav#0AtoEh#O[OmO$Ozvyk0Ap|ArAt-IjeIz{Ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk\";\nconst checksum = \"0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a\";\nlet wordlist = null;\n/**\n * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangCz extends WordlistOwl {\n /**\n * Creates a new instance of the Czech language Wordlist.\n *\n * Using the constructor should be unnecessary, instead use the\n * [[wordlist]] singleton method.\n *\n * @_ignore:\n */\n constructor() {\n super(\"cz\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangCz``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangCz();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-cz.js.map","const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map","import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map","import { WordlistOwlA } from \"./wordlist-owla.js\";\nconst words = \"0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZo3Bol]D!D+Ld/eb_LoAmpuAnc]ApaAr]I>Is)IvoOqueOzaUle%Up 0Cl.EgoE=EnEr#F[G +M->NeN%P_sR>Rue]SneTaU{d2Am^AnA+AseAveI,)ImaInica2B_Cc~|i'Ci`CoDigoDoF_G!He)JinJoL/ch/eg$Lg Lin/l LmoLum`Mba)M!Mi{Mo&Mpr-deNej}g-oc!Nsej}t PaPi(az.Rba%RchoR&nR.(r!S!SmosS%2AneoAt!E Ec!Ei&EmaIaIm,Ip%IsisOmoOnicaOque%U&Uz2Ad+Ar#At+BoBr*| aEl=En#Er{Es%EvaId Lebr/p/#Mb_Mpl*N-e%O%P.Pul( R$Se'Sf[zVaVi'5BleCeL^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lp,1An-Cab#Ch Cou C!,Da%fDui!Ig['Jo'Lec%fMa(eMb]M_-M(=Na&'Nsib#N&n-Par Q)n-Re(R.ntR+{Rru!RumRvi-Sa?V*Vra.Xtup#3D =Ec#Eg Ff]G#Gn=L_-LiciumMp#Nc eNist!Ph$RopSmi^Tu 1I 3Ci=C#DiumIg[{LdatLe`Litu@Lub#Mb!M?`Mno]N@N.'N[t&No!Rc>R%rS+T%Rfa-Rica&R?n RpriC%#Il]L_tLism/L$n Mbo'Mi}Ngib#PisQu( Rd RifR%[SI$I^Itai!Iv s3AniumBa(Tic/t0A.I[UelU!0I#Op+:Car?Cc(Gab$dG)Ill/tInc!Is<|Lab#LiSe{Ss=S&3C&'Det&Get=Hicu#InardLo-Nd!diN Ng Ni?{Ntou b) {\n return 1;\n }\n return 0;\n }\n // Load all the words\n for (let length = 3; length <= 9; length++) {\n const d = data[length - 3];\n for (let offset = 0; offset < d.length; offset += length) {\n const word = [];\n for (let i = 0; i < length; i++) {\n const k = mapping.indexOf(d[offset + i]);\n word.push(227);\n word.push(k & 0x40 ? 130 : 129);\n word.push((k & 0x3f) + 128);\n }\n wordlist.push(toString(word));\n }\n }\n wordlist.sort(sortJapanese);\n // For some reason kyoku and kiyoku are flipped in node (!!).\n // The order SHOULD be:\n // - kyoku\n // - kiyoku\n // This should ignore \"if\", but that doesn't work here??\n /* c8 ignore start */\n if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {\n const tmp = wordlist[442];\n wordlist[442] = wordlist[443];\n wordlist[443] = tmp;\n }\n /* c8 ignore stop */\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600\") {\n throw new Error(\"BIP39 Wordlist for ja (Japanese) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangJa extends Wordlist {\n /**\n * Creates a new instance of the Japanese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langJa]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ja\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n split(phrase) {\n //logger.assertNormalize();\n return phrase.split(/(?:\\u3000| )+/g);\n }\n join(words) {\n return words.join(\"\\u3000\");\n }\n /**\n * Returns a singleton instance of a ``LangJa``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangJa();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ja.js.map","import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n \"OYAa\",\n \"ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8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8DTrHbDb\",\n \"AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl\",\n];\nconst codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*\";\nfunction getHangul(code) {\n if (code >= 40) {\n code = code + 168 - 40;\n }\n else if (code >= 19) {\n code = code + 97 - 19;\n }\n return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128]));\n}\nlet _wordlist = null;\nfunction loadWords() {\n if (_wordlist != null) {\n return _wordlist;\n }\n const wordlist = [];\n data.forEach((data, length) => {\n length += 4;\n for (let i = 0; i < data.length; i += length) {\n let word = \"\";\n for (let j = 0; j < length; j++) {\n word += getHangul(codes.indexOf(data[i + j]));\n }\n wordlist.push(word);\n }\n });\n wordlist.sort();\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a\") {\n throw new Error(\"BIP39 Wordlist for ko (Korean) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangKo extends Wordlist {\n /**\n * Creates a new instance of the Korean language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langKo]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ko\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n /**\n * Returns a singleton instance of a ``LangKo``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangKo();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ko.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0torea noica!iosorolotaleratelanena%oiadoencotivomai t ca%a0A]Bagl'Bin#E.Is(Oli!Rasi_Rog#0Cade!C[$Cus#E Roba+U 0Ag'Deb{DomeEgu#Eri!IpeOtt&Ul&1Fabi,Fe|Fis(F-n Oris`O(R~$0AveEn.E_,Ganc'I!It&OnismoR>*Rume Uzzo4AbardaA Bat)Ber#BoBumeCeCol>E|Ertu-OdePari!Pe^ Pogg'P)@Pun Ri,1Ab~AchideAgos+Ald~Anc'Atu-AzzoBit)Chiv'D{Eni,G[ GiSoTef%eZil*0Ciu|Col EpsiEtt>Fal I$O/Pir#P)Sagg'SeSolu Sur@TaT[u T%eT-|0Av>EismoOm>O$TesaTiv&Tor$Tr{Tua,0Sil'Str?Tis+To$moTun$0Anz#E!V[i!Vi(Volge!3IoS(Tos+Ttu U,VaVosa3C]FfaLg'LvaNdaNe_,Nig$Nzi=ReRli=Ta3Bi+CiDoR@S]Tan>T^$Zzo*2Acc'AdipoA`An}Avu-E.l/Eve|EzzaIgl?Il/n.Ind&Oc]*O@Onzi=Ul*U$2BboT+di$UffoVet+Vi,2Ass>In~O)2C]Dar@D%eE!n.G$meLl&Lm#Lo!Lpo(L^v#LzaMaMe+M`n@Mo@Mpu.rMuS+n.Ttu-V#2A.!Avat+E#Ede!Emo(Esci+E+Ice I=,IsiIt>OceO=}Os++Uc?,Us}2Ci!Cu*Gi$Ll#Po/R#!R(!R_Sci$S de:DoI$L`+Meri$Nie/N$(Nz&T#Van^Vve)3Bu|C[n'Ci(Cli$Col*C! D%#Fin{FormeG$Leg&Lfi$Lir'L+M[zaNot#Nt)Pos{Rapa+Riv&RogaScri|Ser Sider'Sume!Tersi_Vo 3Amet)Cemb!Ed)Fe(Ffu(Geri!Gi+,Luv'Nam>N=nziPin P*`Po*Rad&ReRo|RupoSag'Sc! Sf&Sge*Spos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av[ Azzo/EcieEdi!EgRappoReg#Ridu*Rozz&Ru|Ucc&UfoUp[@0B[t)C](Do!Gger{GoL+$On&PerboPpor Rgel#R)g#Ssur)Tu-0Ag&EdeseEgl'El&Enu Ez?IluppoIs+Izze-Ol+Uot&:Bac]Bul#Cci&Citur$LeLis`$MpoVer=Vo/+Zza3CaCn>Lefo$Me-r'MpoMu N@Pog-foRagg'RoTan'To*Tuban.Z'Zzo<5Cc&L,r&L Mbo/MoNfoNsil/Paz'Po*g?PpaRbaRn&R)L,t+Lo)(Lut&L_/Mpa+Ng&N{(NoN+gg'Nve-Po!Ra$Rc#R?n.S}3Det+DovaDu Ge+,I]*Lc)Li=Llu LoceN#Ndemm?N RaceRba,Rgog=Rif~RoRru}Rt~,Sc~Ssil*S+,Te-$Tri=Tus 3Andan.B-n.C[daChingoCi=nzaDim&Gil?G< Go!LeL/$MiniNc{!O/Pe-Rgo/Ro*goRu,n S](S'5Cche)Fo*LuPpa\";\nconst checksum = \"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620\";\nlet wordlist = null;\n/**\n * The [[link-bip39-it]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangIt extends WordlistOwl {\n /**\n * Creates a new instance of the Italian language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langIt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"it\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangIt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangIt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-it.js.map","import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi?PoQue%lRagemRdi&Rne)R}h>p|&R[ioR%joRuj>voSs-oS%laT}e%U_UveVilZ*]2A%+AvoEcheE=rEmeErEspoI^Im*&Io~oIseItic Os)UaUz{o2B+m SafioSbo.Sc<,S-/Sfi#Sgas%Sigu&SlizeSmam SovaSpesaS)queSvi T&h T-$rT} Tri$UsaV(Vi=Vot#Z-a3Ag+maAle$Da)Fu,Gi.Lat#Lu-%M*u'Nast@Nh{oOceseRe$Sc[)Sf ceSp oSque%Ssip S)n%T?UrnoV(,Vi,rV~g Z(5Br?L|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t?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi=\";\nconst checksum = \"0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac\";\nlet wordlist = null;\n/**\n * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangPt extends WordlistOwl {\n /**\n * Creates a new instance of the Portuguese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langPt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"pt\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangPt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangPt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-pt.js.map","import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = \"}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN?\";\nfunction loadWords(locale) {\n if (_wordlist[locale] != null) {\n return _wordlist[locale];\n }\n const wordlist = [];\n let deltaOffset = 0;\n for (let i = 0; i < 2048; i++) {\n const s = style.indexOf(data[i * 3]);\n const bytes = [\n 228 + (s >> 2),\n 128 + codes.indexOf(data[i * 3 + 1]),\n 128 + codes.indexOf(data[i * 3 + 2]),\n ];\n if (locale === \"zh_tw\") {\n const common = s % 4;\n for (let i = common; i < 3; i++) {\n bytes[i] =\n codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128);\n }\n }\n wordlist.push(toUtf8String(new Uint8Array(bytes)));\n }\n // Verify the computed list matches the official list\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== Checks[locale]) {\n throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`);\n }\n /* c8 ignore stop */\n _wordlist[locale] = wordlist;\n return wordlist;\n}\nconst wordlists = {};\n/**\n * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for\n * [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangZh extends Wordlist {\n /**\n * Creates a new instance of the Chinese language Wordlist for\n * the %%dialect%%, either ``\"cn\"`` or ``\"tw\"`` for simplified\n * or traditional, respectively.\n *\n * This should be unnecessary most of the time as the exported\n * [[langZhCn]] and [[langZhTw]] should suffice.\n *\n * @_ignore:\n */\n constructor(dialect) {\n super(\"zh_\" + dialect);\n }\n getWord(index) {\n const words = loadWords(this.locale);\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords(this.locale).indexOf(word);\n }\n split(phrase) {\n phrase = phrase.replace(/(?:\\u3000| )+/g, \"\");\n return phrase.split(\"\");\n }\n /**\n * Returns a singleton instance of a ``LangZh`` for %%dialect%%,\n * creating it if this is the first time being called.\n *\n * Use the %%dialect%% ``\"cn\"`` or ``\"tw\"`` for simplified or\n * traditional, respectively.\n */\n static wordlist(dialect) {\n if (wordlists[dialect] == null) {\n wordlists[dialect] = new LangZh(dialect);\n }\n return wordlists[dialect];\n }\n}\n//# sourceMappingURL=lang-zh.js.map"],"names":["isBytes","u64.split","u64.rotrSH","u64.shrSH","u64.rotrSL","u64.shrSL","u64.rotrBH","u64.rotrBL","u64.add4L","u64.add4H","u64.add5L","u64.add5H","u64.add","u64.add3L","u64.add3H","sha256","sha512","require$$0","require$$1","words","checksum","wordlist","accents","data","_wordlist","loadWords","codes"],"mappings":"AAAA,MAAM,UAAU,mBAAmB,CAAC,MAAM,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,GAAG;AAChE,MAAM,IAAI,mBAAmB,MAAM,CAAC,EAAE,CAAC;AACvC;AACA;AACA,SAAS,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,KAAK,EAAE;AAChC,IAAI,IAAI,EAAE;AACV,QAAQ,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,UAAU,CAAC,EAAE;AACjF,IAAI,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE;AACrF;AACA;AACA;AACA,SAAS,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE;AAChC,IAAI,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM;AAC1B,IAAI,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC;AACjC,IAAI,IAAI,EAAE,GAAG,IAAI,WAAW,CAAC,GAAG,CAAC;AACjC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAClC,QAAQ,MAAM,EA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C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,OAAO,EAAE;AACzB,QAAQ,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC;AAC9B,IAAI;AACJ,IAAI,OAAO,CAAC,KAAK,EAAE;AACnB,QAAQ,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;AAC5C,QAAQ,cAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC;AAC1G,QAAQ,OAAO,KAAK,CAAC,KAAK,CAAC;AAC3B,IAAI;AACJ,IAAI,YAAY,CAAC,IAAI,EAAE;AACvB,QAAQ,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;AACnD,IAAI;AACJ,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,QAAQ,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;AACrD,QAAQ,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAC/B,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,CAAC,OAAO,EAAE;AAC7B,QAAQ,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE;AACxC,YAAY,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC;AACpD,QAAQ;AACR,QAAQ,OAAO,SAAS,CAAC,OAAO,CAAC;AACjC,IAAI;AACJ;;","x_google_ignoreList":[0,1,2,10,11,12,13,14,15]} \ No newline at end of file diff --git a/dist/wordlists-extra.min.js b/dist/wordlists-extra.min.js deleted file mode 100644 index 030d4e30c..000000000 --- a/dist/wordlists-extra.min.js +++ /dev/null @@ -1 +0,0 @@ -const U32_MASK64=(()=>BigInt(2**32-1))();const _32n=BigInt(32);function fromBig(n,le=false){if(le)return{h:Number(n&U32_MASK64),l:Number(n>>_32n&U32_MASK64)};return{h:Number(n>>_32n&U32_MASK64)|0,l:Number(n&U32_MASK64)|0}}function split(lst,le=false){const len=lst.length;let Ah=new Uint32Array(len);let Al=new Uint32Array(len);for(let i=0;in/2**32|0;const fromNumL=n=>n>>>0;function setU64FromNum(view,byteOffset,n,isLE){const h=fromNumH(n);const l=fromNumL(n);view.setUint32(byteOffset,isLE?l:h,isLE);view.setUint32(byteOffset+4,isLE?h:l,isLE)}const shrSH=(h,_l,s)=>h>>>s;const shrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrSH=(h,l,s)=>h>>>s|l<<32-s;const rotrSL=(h,l,s)=>h<<32-s|l>>>s;const rotrBH=(h,l,s)=>h<<64-s|l>>>s-32;const rotrBL=(h,l,s)=>h>>>s-32|l<<64-s;function add(Ah,Al,Bh,Bl){const l=(Al>>>0)+(Bl>>>0);return{h:Ah+Bh+(l/2**32|0)|0,l:l|0}}const add3L=(Al,Bl,Cl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0);const add3H=(low,Ah,Bh,Ch)=>Ah+Bh+Ch+(low/2**32|0)|0;const add4L=(Al,Bl,Cl,Dl)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0);const add4H=(low,Ah,Bh,Ch,Dh)=>Ah+Bh+Ch+Dh+(low/2**32|0)|0;const add5L=(Al,Bl,Cl,Dl,El)=>(Al>>>0)+(Bl>>>0)+(Cl>>>0)+(Dl>>>0)+(El>>>0);const add5H=(low,Ah,Bh,Ch,Dh,Eh)=>Ah+Bh+Ch+Dh+Eh+(low/2**32|0)|0;function isBytes$1(a){return a instanceof Uint8Array||ArrayBuffer.isView(a)&&a.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in a&&a.BYTES_PER_ELEMENT===1}const atitle=title=>title?`"${title}" `:"";function anumber(n,title=""){if(typeof n!=="number")throw new TypeError(atitle(title)+"expected number, got "+typeof n);if(!Number.isSafeInteger(n)||n<0)throw new RangeError(atitle(title)+"expected integer >= 0, got "+n);return n}function abool(value,title=""){if(typeof value!=="boolean")throw new TypeError(atitle(title)+"expected boolean, got type="+typeof value);return value}function abytes(value,length,title=""){if(isBytes$1(value)&&length===undefined)return value;const bytes=isBytes$1(value);const ofLen="";const got=bytes?`length=${value.length}`:`type=${typeof value}`;const message=atitle(title)+"expected Uint8Array"+ofLen+", got "+got;if(!bytes)throw new TypeError(message);throw new RangeError(message)}const aobject=(value,label)=>{if(value===null||typeof value!=="object"||Array.isArray(value))throw new TypeError((label==="object"?"":`"${label}" `)+"expected object, got type="+typeof value)};const aopts=(value,label)=>{aobject(value,label);const proto=Object.getPrototypeOf(value);if(proto!==Object.prototype&&proto!==null)throw new TypeError(`"${label}" expected plain object`);if(Object.hasOwn(value,"__proto__"))throw new TypeError(`"${label}.__proto__" is not allowed`)};function aexists(instance,checkFinished=true){if(instance.destroyed)throw new Error("hash was destroyed");if(checkFinished&&instance.finished)throw new Error("digest() was already called")}function aoutput(out,instance){abytes(out,undefined,"output");const min=instance.outputLen;if(!(out.length>=min)){throw new RangeError('"output" expected length >= '+min)}}function u32(arr){return new Uint32Array(arr.buffer,arr.byteOffset,Math.floor(arr.byteLength/4))}function clean(...arrays){for(let i=0;i>>shift}function rotl(word,shift){return word<>>32-shift>>>0}const isLE=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function byteSwap(word){return word<<24&4278190080|word<<8&16711680|word>>>8&65280|word>>>24&255}function byteSwap32(arr){for(let i=0;iu:byteSwap32;function checkOpts(defaults,opts,title="opts"){aopts(defaults,"defaults");if(opts!==undefined)aopts(opts,title);const merged=Object.assign(Object.create(null),defaults,opts);return merged}function createHasher(hashCons,info={}){if(typeof hashCons!=="function")throw new TypeError('"hashCons" expected function, got type='+typeof hashCons);info=checkOpts({},info,"info");const hashC=(msg,opts)=>hashCons(opts).update(msg).digest();const tmp=hashCons(undefined);hashC.outputLen=tmp.outputLen;hashC.blockLen=tmp.blockLen;hashC.canXOF=tmp.canXOF;hashC.create=opts=>hashCons(opts);Object.assign(hashC,info);return Object.freeze(hashC)}const oidNist=suffix=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,suffix])});const _0n=BigInt(0);const _1n=BigInt(1);const _2n=BigInt(2);const _7n=BigInt(7);const _256n=BigInt(256);const _0x71n=BigInt(113);const SHA3_PI=[];const SHA3_ROTL=[];const _SHA3_IOTA=[];for(let round=0,R=_1n,x=1,y=0;round<24;round++){[x,y]=[y,(2*x+3*y)%5];SHA3_PI.push(2*(5*y+x));SHA3_ROTL.push((round+1)*(round+2)/2%64);let t=_0n;for(let j=0;j<7;j++){R=(R<<_1n^(R>>_7n)*_0x71n)%_256n;if(R&_2n)t^=_1n<<(_1n<h<>>32-s;const rotlSL=(h,l,s)=>l<>>32-s;const rotlBH=(h,l,s)=>l<>>64-s;const rotlBL=(h,l,s)=>h<>>64-s;const rotlH=(h,l,s)=>s>32?rotlBH(h,l,s):rotlSH(h,l,s);const rotlL=(h,l,s)=>s>32?rotlBL(h,l,s):rotlSL(h,l,s);const B=new Uint32Array(5*2);function keccakP(s,rounds=24){if(!(s instanceof Uint32Array))throw new TypeError('"s" expected Uint32Array(50), got type='+typeof s);if(s.length!==50)throw new RangeError('"s" expected Uint32Array(50), got length='+s.length);anumber(rounds,"rounds");if(rounds<1||rounds>24)throw new Error('"rounds" expected integer 1..24');for(let round=24-rounds;round<24;round++){for(let x=0;x<10;x++)B[x]=s[x]^s[x+10]^s[x+20]^s[x+30]^s[x+40];for(let x=0;x<10;x+=2){const idx1=(x+8)%10;const idx0=(x+2)%10;const B0=B[idx0];const B1=B[idx0+1];const Th=rotlH(B0,B1,1)^B[idx1];const Tl=rotlL(B0,B1,1)^B[idx1+1];for(let y=0;y<50;y+=10){s[x+y]^=Th;s[x+y+1]^=Tl}}let curH=s[2];let curL=s[3];for(let t=0;t<24;t++){const shift=SHA3_ROTL[t];const Th=rotlH(curH,curL,shift);const Tl=rotlL(curH,curL,shift);const PI=SHA3_PI[t];curH=s[PI];curL=s[PI+1];s[PI]=Th;s[PI+1]=Tl}for(let y=0;y<50;y+=10){const b0=s[y],b1=s[y+1],b2=s[y+2],b3=s[y+3];s[y]^=~s[y+2]&s[y+4];s[y+1]^=~s[y+3]&s[y+5];s[y+2]^=~s[y+4]&s[y+6];s[y+3]^=~s[y+5]&s[y+7];s[y+4]^=~s[y+6]&s[y+8];s[y+5]^=~s[y+7]&s[y+9];s[y+6]^=~s[y+8]&b0;s[y+7]^=~s[y+9]&b1;s[y+8]^=~b0&b2;s[y+9]^=~b1&b3}s[0]^=SHA3_IOTA_H[round];s[1]^=SHA3_IOTA_L[round]}clean(B)}class Keccak{state;pos=0;posOut=0;finished=false;state32;destroyed=false;blockLen;suffix;outputLen;canXOF;enableXOF=false;rounds;constructor(blockLen,suffix,outputLen,enableXOF=false,rounds=24){anumber(blockLen,"blockLen");anumber(suffix,"suffix");anumber(rounds,"rounds");abool(enableXOF,"enableXOF");this.blockLen=blockLen;this.suffix=suffix;this.outputLen=outputLen;this.enableXOF=enableXOF;this.canXOF=enableXOF;this.rounds=rounds;anumber(outputLen,"outputLen");if(!(0=blockLen?u32(data):undefined;for(let pos=0;pos=blockLen){for(let i=0,o=pos/4;i=blockLen)this.keccak();const take=Math.min(blockLen-this.posOut,len-pos);out.set(bufferOut.subarray(this.posOut,this.posOut+take),pos);this.posOut+=take;pos+=take}return out}xofInto(out){if(!this.enableXOF)throw new Error("XOF is not enabled");return this.writeInto(out)}xof(bytes){anumber(bytes);return this.xofInto(new Uint8Array(bytes))}digestInto(out){aoutput(out,this);if(this.finished)throw new Error("digest() was already called");this.writeInto(out.length===this.outputLen?out:out.subarray(0,this.outputLen));this.destroy()}digest(){const out=new Uint8Array(this.outputLen);this.digestInto(out);return out}destroy(){this.destroyed=true;clean(this.state)}_cloneInto(to){const{blockLen,suffix,outputLen,rounds,enableXOF}=this;to||=new Keccak(blockLen,suffix,outputLen,enableXOF,rounds);to.blockLen=blockLen;to.state32.set(this.state32);to.pos=this.pos;to.posOut=this.posOut;to.finished=this.finished;to.rounds=rounds;to.suffix=suffix;to.outputLen=outputLen;to.enableXOF=enableXOF;to.canXOF=this.canXOF;to.destroyed=this.destroyed;return to}}const genKeccak=(suffix,blockLen,outputLen,info={})=>createHasher(()=>new Keccak(blockLen,suffix,outputLen),info);const sha3_256=genKeccak(6,136,32,oidNist(8));const sha3_512=genKeccak(6,72,64,oidNist(10));const keccak_256=genKeccak(1,136,32);let _permanentCensorErrors=false;let _censorErrors=false;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels["default"];let _globalLogger=null;function _checkNormalize(){try{const missing=[];["NFD","NFC","NFKD","NFKC"].forEach(form=>{try{if("test".normalize(form)!=="test"){throw new Error("bad normalize")}}catch(error){missing.push(form)}});if(missing.length){throw new Error("missing "+missing.join(", "))}if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769)){throw new Error("broken implementation")}}catch(error){return error.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(LogLevel){LogLevel["DEBUG"]="DEBUG";LogLevel["INFO"]="INFO";LogLevel["WARNING"]="WARNING";LogLevel["ERROR"]="ERROR";LogLevel["OFF"]="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(ErrorCode){ErrorCode["UNKNOWN_ERROR"]="UNKNOWN_ERROR";ErrorCode["NOT_IMPLEMENTED"]="NOT_IMPLEMENTED";ErrorCode["UNSUPPORTED_OPERATION"]="UNSUPPORTED_OPERATION";ErrorCode["NETWORK_ERROR"]="NETWORK_ERROR";ErrorCode["SERVER_ERROR"]="SERVER_ERROR";ErrorCode["TIMEOUT"]="TIMEOUT";ErrorCode["BUFFER_OVERRUN"]="BUFFER_OVERRUN";ErrorCode["NUMERIC_FAULT"]="NUMERIC_FAULT";ErrorCode["MISSING_NEW"]="MISSING_NEW";ErrorCode["INVALID_ARGUMENT"]="INVALID_ARGUMENT";ErrorCode["MISSING_ARGUMENT"]="MISSING_ARGUMENT";ErrorCode["UNEXPECTED_ARGUMENT"]="UNEXPECTED_ARGUMENT";ErrorCode["CALL_EXCEPTION"]="CALL_EXCEPTION";ErrorCode["INSUFFICIENT_FUNDS"]="INSUFFICIENT_FUNDS";ErrorCode["NONCE_EXPIRED"]="NONCE_EXPIRED";ErrorCode["REPLACEMENT_UNDERPRICED"]="REPLACEMENT_UNDERPRICED";ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"]="UNPREDICTABLE_ENERGY_LIMIT";ErrorCode["TRANSACTION_REPLACED"]="TRANSACTION_REPLACED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{version="0.0.1";static errors=ErrorCode;static levels=LogLevel;constructor(version){Object.defineProperty(this,"version",{enumerable:true,value:version,writable:false})}_log(logLevel,args){const level=logLevel.toLowerCase();if(LogLevels[level]==null){this.throwArgumentError("invalid log level name","logLevel",logLevel)}if(_logLevel>LogLevels[level]){return}console.log.apply(console,args)}debug(...args){this._log(Logger.levels.DEBUG,args)}info(...args){this._log(Logger.levels.INFO,args)}warn(...args){this._log(Logger.levels.WARNING,args)}makeError(message,code,params){if(_censorErrors){return this.makeError("censored error",code,{})}if(!code){code=Logger.errors.UNKNOWN_ERROR}if(!params){params={}}const messageDetails=[];Object.keys(params).forEach(key=>{const value=params[key];try{if(value instanceof Uint8Array){let hex="";for(let i=0;i>4];hex+=HEX[value[i]&15]}messageDetails.push(key+"=Uint8Array(0x"+hex+")")}else{messageDetails.push(key+"="+JSON.stringify(value))}}catch(error){messageDetails.push(key+"="+JSON.stringify(params[key].toString()))}});messageDetails.push(`code=${code}`);messageDetails.push(`version=${this.version}`);const reason=message;if(messageDetails.length){message+=" ("+messageDetails.join(", ")+")"}const error=new Error(message);error.reason=reason;error.code=code;Object.keys(params).forEach(function(key){error[key]=params[key]});return error}throwError(message,code,params){throw this.makeError(message,code,params)}throwArgumentError(message,name,value){return this.throwError(message,Logger.errors.INVALID_ARGUMENT,{argument:name,value:value})}assert(condition,message,code,params){if(!!condition){return}this.throwError(message,code,params)}assertArgument(condition,message,name,value){if(!!condition){return}this.throwArgumentError(message,name,value)}checkNormalize(message){if(_normalizeError){this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}}checkSafeUint53(value,message){if(typeof value!=="number"){return}if(message==null){message="value not safe"}if(value<0||value>=9007199254740991){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:value})}if(value%1){this.throwError(message,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:value})}}checkArgumentCount(count,expectedCount,message){if(message){message=": "+message}else{message=""}if(countexpectedCount){this.throwError("too many arguments"+message,Logger.errors.UNEXPECTED_ARGUMENT,{count:count,expectedCount:expectedCount})}}checkNew(target,kind){if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}checkAbstract(target,kind){if(target===kind){this.throwError("cannot instantiate abstract class "+JSON.stringify(kind.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:target.name,operation:"new"})}else if(target===Object||target==null){this.throwError("missing new",Logger.errors.MISSING_NEW,{name:kind.name})}}static globalLogger(){if(!_globalLogger){_globalLogger=new Logger("logger/0.0.1")}return _globalLogger}static setCensorship(censorship,permanent){if(!censorship&&permanent){this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}if(_permanentCensorErrors){if(!censorship){return}this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!censorship;_permanentCensorErrors=!!permanent}static setLogLevel(logLevel){const level=LogLevels[logLevel.toLowerCase()];if(level==null){Logger.globalLogger().warn("invalid log level - "+logLevel);return}_logLevel=level}static from(version){return new Logger(version)}}const version="0.4.1";function defineProperties(target,values,types){for(let key in values){let value=values[key];Object.defineProperty(target,key,{enumerable:true,value:value,writable:false})}}function stringify(value){if(value==null){return"null"}if(Array.isArray(value)){return"[ "+value.map(stringify).join(", ")+" ]"}if(value instanceof Uint8Array){const HEX="0123456789abcdef";let result="0x";for(let i=0;i>4];result+=HEX[value[i]&15]}return result}if(typeof value==="object"&&typeof value.toJSON==="function"){return stringify(value.toJSON())}switch(typeof value){case"boolean":case"symbol":return value.toString();case"bigint":return BigInt(value).toString();case"number":return value.toString();case"string":return JSON.stringify(value);case"object":{const keys=Object.keys(value);keys.sort();return"{ "+keys.map(k=>`${stringify(k)}: ${stringify(value[k])}`).join(", ")+" }"}}return`[ COULD NOT SERIALIZE ]`}function makeError(message,code,info){{const details=[];if(info){if("message"in info||"code"in info||"name"in info){throw new Error(`value will overwrite populated values: ${stringify(info)}`)}for(const key in info){const value=info[key];details.push(key+"="+stringify(value))}}details.push(`code=${code}`);details.push(`version=${version}`);if(details.length){message+=" ("+details.join(", ")+")"}}let error;switch(code){case"INVALID_ARGUMENT":error=new TypeError(message);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":error=new RangeError(message);break;default:error=new Error(message)}defineProperties(error,{code:code});if(info){Object.assign(error,info)}return error}function assert(check,message,code,info){if(!check){throw makeError(message,code,info)}}function assertArgument(check,message,name,value){assert(check,message,"INVALID_ARGUMENT",{argument:name,value:value})}["NFD","NFC","NFKD","NFKC"].reduce((accum,form)=>{try{if("test".normalize(form)!=="test"){throw new Error("bad")}if(form==="NFD"){const check=String.fromCharCode(233).normalize("NFD");const expected=String.fromCharCode(101,769);if(check!==expected){throw new Error("broken")}}accum.push(form)}catch(error){}return accum},[]);const logger=new Logger("utils/data/0.0.1");function isHexable(value){return!!value.toHexString}function isInteger(value){return typeof value==="number"&&value==value&&value%1===0}function isBytes(value){if(value==null){return false}if(value.constructor===Uint8Array){return true}if(typeof value==="string"){return false}if(!isInteger(value.length)||value.length<0){return false}for(let i=0;i=256){return false}}return true}function _getBytes(value,name,copy){if(value instanceof Uint8Array){return value}if(typeof value==="string"&&value.match(/^0x([0-9a-f][0-9a-f])*$/i)){const result=new Uint8Array((value.length-2)/2);let offset=2;for(let i=0;iNumber(item));value=new Uint8Array(v)}}if(typeof value==="number"){logger.checkSafeUint53(value,"invalid hexlify value");let hex="";while(value){hex=HexCharacters[value&15]+hex;value=Math.floor(value/16)}if(hex.length){if(hex.length%2){hex="0"+hex}return"0x"+hex}return"0x00"}if(typeof value==="bigint"){value=value.toString(16);if(value.length%2){return"0x0"+value}return"0x"+value}if(options.allowMissingPrefix&&typeof value==="string"&&value.substring(0,2)!=="0x"){value="0x"+value}if(isHexable(value)){return value.toHexString()}if(isHexString(value)){if(value.length%2){if(options.hexPad==="left"){value="0x0"+value.substring(2)}else if(options.hexPad==="right"){value+="0"}else{logger.throwArgumentError("hex data is odd-length","value",value)}}return value.toLowerCase()}if(isBytes(value)){let result="0x";for(let i=0;i>4]+HexCharacters[v&15]}return result}return logger.throwArgumentError("invalid hexlify value","value",value)}function errorFunc(reason,offset,bytes,output,badCodepoint){assertArgument(false,`invalid codepoint at offset ${offset}; ${reason}`,"bytes",bytes)}function ignoreFunc(reason,offset,bytes,output,badCodepoint){if(reason==="BAD_PREFIX"||reason==="UNEXPECTED_CONTINUE"){let i=0;for(let o=offset+1;o>6!==2){break}i++}return i}if(reason==="OVERRUN"){return bytes.length-offset-1}return 0}function replaceFunc(reason,offset,bytes,output,badCodepoint){if(reason==="OVERLONG"){assertArgument(typeof badCodepoint==="number","invalid bad code point for replacement","badCodepoint",badCodepoint);output.push(badCodepoint);return 0}output.push(65533);return ignoreFunc(reason,offset,bytes)}const Utf8ErrorFuncs=Object.freeze({error:errorFunc,ignore:ignoreFunc,replace:replaceFunc});function getUtf8CodePoints(_bytes,onError){if(onError==null){onError=Utf8ErrorFuncs.error}const bytes=getBytes(_bytes,"bytes");const result=[];let i=0;while(i>7===0){result.push(c);continue}let extraLength=null;let overlongMask=null;if((c&224)===192){extraLength=1;overlongMask=127}else if((c&240)===224){extraLength=2;overlongMask=2047}else if((c&248)===240){extraLength=3;overlongMask=65535}else{if((c&192)===128){i+=onError("UNEXPECTED_CONTINUE",i-1,bytes,result)}else{i+=onError("BAD_PREFIX",i-1,bytes,result)}continue}if(i-1+extraLength>=bytes.length){i+=onError("OVERRUN",i-1,bytes,result);continue}let res=c&(1<<8-extraLength-1)-1;for(let j=0;j1114111){i+=onError("OUT_OF_RANGE",i-1-extraLength,bytes,result,res);continue}if(res>=55296&&res<=57343){i+=onError("UTF16_SURROGATE",i-1-extraLength,bytes,result,res);continue}if(res<=overlongMask){i+=onError("OVERLONG",i-1-extraLength,bytes,result,res);continue}result.push(res)}return result}function toUtf8Bytes(str,form){let result=[];for(let i=0;i>6|192);result.push(c&63|128)}else if((c&64512)==55296){i++;const c2=str.charCodeAt(i);assertArgument(i>18|240);result.push(pair>>12&63|128);result.push(pair>>6&63|128);result.push(pair&63|128)}else{result.push(c>>12|224);result.push(c>>6&63|128);result.push(c&63|128)}}return new Uint8Array(result)}function _toUtf8String(codePoints){return codePoints.map(codePoint=>{if(codePoint<=65535){return String.fromCharCode(codePoint)}codePoint-=65536;return String.fromCharCode((codePoint>>10&1023)+55296,(codePoint&1023)+56320)}).join("")}function toUtf8String(bytes,onError){return _toUtf8String(getUtf8CodePoints(bytes,onError))}let locked=false;const _keccak256=function(data){return keccak_256(data)};let __keccak256=_keccak256;function keccak256(_data){const data=getBytes(_data,"data");return hexlify(__keccak256(data))}keccak256._=_keccak256;keccak256.lock=function(){locked=true};keccak256.register=function(func){if(locked){throw new TypeError("keccak256 is locked")}__keccak256=func};Object.freeze(keccak256);function Chi(a,b,c){return a&b^~a&c}function Maj(a,b,c){return a&b^a&c^b&c}class HashMD{blockLen;outputLen;canXOF=false;padOffset;isLE;buffer;view;finished=false;length=0;pos=0;destroyed=false;constructor(blockLen,outputLen,padOffset,isLE){this.blockLen=blockLen;this.outputLen=outputLen;this.padOffset=padOffset;this.isLE=isLE;this.buffer=new Uint8Array(blockLen);this.view=createView(this.buffer)}update(data){aexists(this);abytes(data);const{view,buffer,blockLen}=this;const len=data.length;let processed=false;for(let pos=0;posblockLen-pos){this.process(view,0);buffer.fill(0)}setU64FromNum(view,blockLen-8,this.length*8,isLE);this.process(view,0);this.roundClean();const oview=out===buffer?view:createView(out);const len=this.outputLen;const outLen=len/4;const state=this.get();if(len%4||outLen>state.length)throw new Error("invalid outputLen");for(let i=0;iUint8Array.from(new Array(16).fill(0).map((_,i)=>i)))();const Pi160=(()=>Id160.map(i=>(9*i+5)%16))();const idxLR=(()=>{const L=[Id160];const R=[Pi160];const res=[L,R];for(let i=0;i<4;i++)for(let j of res)j.push(j[i].map(k=>Rho160[k]));return res})();const idxL=(()=>idxLR[0])();const idxR=(()=>idxLR[1])();const shifts160=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(i=>Uint8Array.from(i));const shiftsL160=idxL.map((idx,i)=>idx.map(j=>shifts160[i][j]));const shiftsR160=idxR.map((idx,i)=>idx.map(j=>shifts160[i][j]));const Kl160=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]);const Kr160=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);function ripemd_f(group,x,y,z){if(group===0)return x^y^z;if(group===1)return x&y|~x&z;if(group===2)return(x|~y)^z;if(group===3)return x&z|y&~z;return x^(y|~z)}const BUF_160=new Uint32Array(16);class _RIPEMD160 extends HashMD{h0=1732584193|0;h1=4023233417|0;h2=2562383102|0;h3=271733878|0;h4=3285377520|0;constructor(){super(64,20,8,true)}get(){const{h0,h1,h2,h3,h4}=this;return[h0,h1,h2,h3,h4]}set(h0,h1,h2,h3,h4){this.h0=h0|0;this.h1=h1|0;this.h2=h2|0;this.h3=h3|0;this.h4=h4|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4)BUF_160[i]=view.getUint32(offset,true);let al=this.h0|0,ar=al,bl=this.h1|0,br=bl,cl=this.h2|0,cr=cl,dl=this.h3|0,dr=dl,el=this.h4|0,er=el;for(let group=0;group<5;group++){const rGroup=4-group;const hbl=Kl160[group],hbr=Kr160[group];const rl=idxL[group],rr=idxR[group];const sl=shiftsL160[group],sr=shiftsR160[group];for(let i=0;i<16;i++){const tl=rotl(al+ripemd_f(group,bl,cl,dl)+BUF_160[rl[i]]+hbl,sl[i])+el|0;al=el,el=dl,dl=rotl(cl,10)|0,cl=bl,bl=tl}for(let i=0;i<16;i++){const tr=rotl(ar+ripemd_f(rGroup,br,cr,dr)+BUF_160[rr[i]]+hbr,sr[i])+er|0;ar=er,er=dr,dr=rotl(cr,10)|0,cr=br,br=tr}}this.set(this.h1+cl+dr|0,this.h2+dl+er|0,this.h3+el+ar|0,this.h4+al+br|0,this.h0+bl+cr|0)}roundClean(){clean(BUF_160)}destroy(){this.destroyed=true;clean(this.buffer);this.set(0,0,0,0,0)}}const ripemd160=createHasher(()=>new _RIPEMD160);const SHA256_K=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);const SHA256_W=new Uint32Array(64);class SHA2_32B extends HashMD{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(outputLen,IV){super(64,outputLen,8,false);this.A=IV[0]|0;this.B=IV[1]|0;this.C=IV[2]|0;this.D=IV[3]|0;this.E=IV[4]|0;this.F=IV[5]|0;this.G=IV[6]|0;this.H=IV[7]|0}get(){const{A,B,C,D,E,F,G,H}=this;return[A,B,C,D,E,F,G,H]}set(A,B,C,D,E,F,G,H){this.A=A|0;this.B=B|0;this.C=C|0;this.D=D|0;this.E=E|0;this.F=F|0;this.G=G|0;this.H=H|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4)SHA256_W[i]=view.getUint32(offset,false);for(let i=16;i<64;i++){const W15=SHA256_W[i-15];const W2=SHA256_W[i-2];const s0=rotr(W15,7)^rotr(W15,18)^W15>>>3;const s1=rotr(W2,17)^rotr(W2,19)^W2>>>10;SHA256_W[i]=s1+SHA256_W[i-7]+s0+SHA256_W[i-16]|0}let{A,B,C,D,E,F,G,H}=this;for(let i=0;i<64;i++){const sigma1=rotr(E,6)^rotr(E,11)^rotr(E,25);const T1=H+sigma1+Chi(E,F,G)+SHA256_K[i]+SHA256_W[i]|0;const sigma0=rotr(A,2)^rotr(A,13)^rotr(A,22);const T2=sigma0+Maj(A,B,C)|0;H=G;G=F;F=E;E=D+T1|0;D=C;C=B;B=A;A=T1+T2|0}A=A+this.A|0;B=B+this.B|0;C=C+this.C|0;D=D+this.D|0;E=E+this.E|0;F=F+this.F|0;G=G+this.G|0;H=H+this.H|0;this.set(A,B,C,D,E,F,G,H)}roundClean(){clean(SHA256_W)}destroy(){this.destroyed=true;this.set(0,0,0,0,0,0,0,0);clean(this.buffer)}}class _SHA256 extends SHA2_32B{constructor(){super(32,SHA256_IV)}}const K512=(()=>split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(n=>BigInt(n))))();const SHA512_Kh=(()=>K512[0])();const SHA512_Kl=(()=>K512[1])();const SHA512_W_H=new Uint32Array(80);const SHA512_W_L=new Uint32Array(80);class SHA2_64B extends HashMD{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(outputLen,IV){super(128,outputLen,16,false);this.Ah=IV[0]|0;this.Al=IV[1]|0;this.Bh=IV[2]|0;this.Bl=IV[3]|0;this.Ch=IV[4]|0;this.Cl=IV[5]|0;this.Dh=IV[6]|0;this.Dl=IV[7]|0;this.Eh=IV[8]|0;this.El=IV[9]|0;this.Fh=IV[10]|0;this.Fl=IV[11]|0;this.Gh=IV[12]|0;this.Gl=IV[13]|0;this.Hh=IV[14]|0;this.Hl=IV[15]|0}get(){const{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;return[Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl]}set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl){this.Ah=Ah|0;this.Al=Al|0;this.Bh=Bh|0;this.Bl=Bl|0;this.Ch=Ch|0;this.Cl=Cl|0;this.Dh=Dh|0;this.Dl=Dl|0;this.Eh=Eh|0;this.El=El|0;this.Fh=Fh|0;this.Fl=Fl|0;this.Gh=Gh|0;this.Gl=Gl|0;this.Hh=Hh|0;this.Hl=Hl|0}_cloneInto(to){(to||=new this.constructor).set(...this.get());return this._cloneIntoMeta(to)}process(view,offset){for(let i=0;i<16;i++,offset+=4){SHA512_W_H[i]=view.getUint32(offset);SHA512_W_L[i]=view.getUint32(offset+=4)}for(let i=16;i<80;i++){const W15h=SHA512_W_H[i-15]|0;const W15l=SHA512_W_L[i-15]|0;const s0h=rotrSH(W15h,W15l,1)^rotrSH(W15h,W15l,8)^shrSH(W15h,W15l,7);const s0l=rotrSL(W15h,W15l,1)^rotrSL(W15h,W15l,8)^shrSL(W15h,W15l,7);const W2h=SHA512_W_H[i-2]|0;const W2l=SHA512_W_L[i-2]|0;const s1h=rotrSH(W2h,W2l,19)^rotrBH(W2h,W2l,61)^shrSH(W2h,W2l,6);const s1l=rotrSL(W2h,W2l,19)^rotrBL(W2h,W2l,61)^shrSL(W2h,W2l,6);const SUMl=add4L(s0l,s1l,SHA512_W_L[i-7],SHA512_W_L[i-16]);const SUMh=add4H(SUMl,s0h,s1h,SHA512_W_H[i-7],SHA512_W_H[i-16]);SHA512_W_H[i]=SUMh|0;SHA512_W_L[i]=SUMl|0}let{Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl}=this;for(let i=0;i<80;i++){const sigma1h=rotrSH(Eh,El,14)^rotrSH(Eh,El,18)^rotrBH(Eh,El,41);const sigma1l=rotrSL(Eh,El,14)^rotrSL(Eh,El,18)^rotrBL(Eh,El,41);const CHIh=Eh&Fh^~Eh&Gh;const CHIl=El&Fl^~El&Gl;const T1ll=add5L(Hl,sigma1l,CHIl,SHA512_Kl[i],SHA512_W_L[i]);const T1h=add5H(T1ll,Hh,sigma1h,CHIh,SHA512_Kh[i],SHA512_W_H[i]);const T1l=T1ll|0;const sigma0h=rotrSH(Ah,Al,28)^rotrBH(Ah,Al,34)^rotrBH(Ah,Al,39);const sigma0l=rotrSL(Ah,Al,28)^rotrBL(Ah,Al,34)^rotrBL(Ah,Al,39);const MAJh=Ah&Bh^Ah&Ch^Bh&Ch;const MAJl=Al&Bl^Al&Cl^Bl&Cl;Hh=Gh|0;Hl=Gl|0;Gh=Fh|0;Gl=Fl|0;Fh=Eh|0;Fl=El|0;({h:Eh,l:El}=add(Dh|0,Dl|0,T1h|0,T1l|0));Dh=Ch|0;Dl=Cl|0;Ch=Bh|0;Cl=Bl|0;Bh=Ah|0;Bl=Al|0;const All=add3L(T1l,sigma0l,MAJl);Ah=add3H(All,T1h,sigma0h,MAJh);Al=All|0}({h:Ah,l:Al}=add(this.Ah|0,this.Al|0,Ah|0,Al|0));({h:Bh,l:Bl}=add(this.Bh|0,this.Bl|0,Bh|0,Bl|0));({h:Ch,l:Cl}=add(this.Ch|0,this.Cl|0,Ch|0,Cl|0));({h:Dh,l:Dl}=add(this.Dh|0,this.Dl|0,Dh|0,Dl|0));({h:Eh,l:El}=add(this.Eh|0,this.El|0,Eh|0,El|0));({h:Fh,l:Fl}=add(this.Fh|0,this.Fl|0,Fh|0,Fl|0));({h:Gh,l:Gl}=add(this.Gh|0,this.Gl|0,Gh|0,Gl|0));({h:Hh,l:Hl}=add(this.Hh|0,this.Hl|0,Hh|0,Hl|0));this.set(Ah,Al,Bh,Bl,Ch,Cl,Dh,Dl,Eh,El,Fh,Fl,Gh,Gl,Hh,Hl)}roundClean(){clean(SHA512_W_H,SHA512_W_L)}destroy(){this.destroyed=true;clean(this.buffer);this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class _SHA512 extends SHA2_64B{constructor(){super(64,SHA512_IV)}}const sha256$1=createHasher(()=>new _SHA256,oidNist(1));const sha512$1=createHasher(()=>new _SHA512,oidNist(3));var buffer={};var base64Js={};var hasRequiredBase64Js;function requireBase64Js(){if(hasRequiredBase64Js)return base64Js;hasRequiredBase64Js=1;base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[];var revLookup=[];var Arr=typeof Uint8Array!=="undefined"?Uint8Array:Array;var code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i0){throw new Error("Invalid string. Length must be a multiple of 4")}var validLen=b64.indexOf("=");if(validLen===-1)validLen=len;var placeHoldersLen=validLen===len?0:4-validLen%4;return[validLen,placeHoldersLen]}function byteLength(b64){var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function _byteLength(b64,validLen,placeHoldersLen){return(validLen+placeHoldersLen)*3/4-placeHoldersLen}function toByteArray(b64){var tmp;var lens=getLens(b64);var validLen=lens[0];var placeHoldersLen=lens[1];var arr=new Arr(_byteLength(b64,validLen,placeHoldersLen));var curByte=0;var len=placeHoldersLen>0?validLen-4:validLen;var i;for(i=0;i>16&255;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}if(placeHoldersLen===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[curByte++]=tmp&255}if(placeHoldersLen===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[curByte++]=tmp>>8&255;arr[curByte++]=tmp&255}return arr}function tripletToBase64(num){return lookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}function encodeChunk(uint8,start,end){var tmp;var output=[];for(var i=start;ilen2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];parts.push(lookup[tmp>>2]+lookup[tmp<<4&63]+"==")}else if(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];parts.push(lookup[tmp>>10]+lookup[tmp>>4&63]+lookup[tmp<<2&63]+"=")}return parts.join("")}return base64Js}var ieee754={};var hasRequiredIeee754;function requireIeee754(){if(hasRequiredIeee754)return ieee754;hasRequiredIeee754=1;ieee754.read=function(buffer,offset,isLE,mLen,nBytes){var e,m;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var nBits=-7;var i=isLE?nBytes-1:0;var d=isLE?-1:1;var s=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}else if(e===eMax){return m?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};ieee754.write=function(buffer,value,offset,isLE,mLen,nBytes){var e,m,c;var eLen=nBytes*8-mLen-1;var eMax=(1<>1;var rt=mLen===23?Math.pow(2,-24)-Math.pow(2,-77):0;var i=isLE?0:nBytes-1;var d=isLE?1:-1;var s=value<0||value===0&&1/value<0?1:0;value=Math.abs(value);if(isNaN(value)||value===Infinity){m=isNaN(value)?1:0;e=eMax}else{e=Math.floor(Math.log(value)/Math.LN2);if(value*(c=Math.pow(2,-e))<1){e--;c*=2}if(e+eBias>=1){value+=rt/c}else{value+=rt*Math.pow(2,1-eBias)}if(value*c>=2){e++;c/=2}if(e+eBias>=eMax){m=0;e=eMax}else if(e+eBias>=1){m=(value*c-1)*Math.pow(2,mLen);e=e+eBias}else{m=value*Math.pow(2,eBias-1)*Math.pow(2,mLen);e=0}}for(;mLen>=8;buffer[offset+i]=m&255,i+=d,m/=256,mLen-=8){}e=e<0;buffer[offset+i]=e&255,i+=d,e/=256,eLen-=8){}buffer[offset+i-d]|=s*128};return ieee754}var hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;(function(exports){const base64=requireBase64Js();const ieee754=requireIeee754();const customInspectSymbol=typeof Symbol==="function"&&typeof Symbol["for"]==="function"?Symbol["for"]("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;const K_MAX_LENGTH=2147483647;exports.kMaxLength=K_MAX_LENGTH;Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport();if(!Buffer.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){console.error("This browser lacks typed array (Uint8Array) support which is required by "+"`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")}function typedArraySupport(){try{const arr=new Uint8Array(1);const proto={foo:function(){return 42}};Object.setPrototypeOf(proto,Uint8Array.prototype);Object.setPrototypeOf(arr,proto);return arr.foo()===42}catch(e){return false}}Object.defineProperty(Buffer.prototype,"parent",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.buffer}});Object.defineProperty(Buffer.prototype,"offset",{enumerable:true,get:function(){if(!Buffer.isBuffer(this))return undefined;return this.byteOffset}});function createBuffer(length){if(length>K_MAX_LENGTH){throw new RangeError('The value "'+length+'" is invalid for option "size"')}const buf=new Uint8Array(length);Object.setPrototypeOf(buf,Buffer.prototype);return buf}function Buffer(arg,encodingOrOffset,length){if(typeof arg==="number"){if(typeof encodingOrOffset==="string"){throw new TypeError('The "string" argument must be of type string. Received type number')}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}Buffer.poolSize=8192;function from(value,encodingOrOffset,length){if(typeof value==="string"){return fromString(value,encodingOrOffset)}if(ArrayBuffer.isView(value)){return fromArrayView(value)}if(value==null){throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof SharedArrayBuffer!=="undefined"&&(isInstance(value,SharedArrayBuffer)||value&&isInstance(value.buffer,SharedArrayBuffer))){return fromArrayBuffer(value,encodingOrOffset,length)}if(typeof value==="number"){throw new TypeError('The "value" argument must not be of type number. Received type number')}const valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length)}const b=fromObject(value);if(b)return b;if(typeof Symbol!=="undefined"&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==="function"){return Buffer.from(value[Symbol.toPrimitive]("string"),encodingOrOffset,length)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, "+"or Array-like Object. Received type "+typeof value)}Buffer.from=function(value,encodingOrOffset,length){return from(value,encodingOrOffset,length)};Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype);Object.setPrototypeOf(Buffer,Uint8Array);function assertSize(size){if(typeof size!=="number"){throw new TypeError('"size" argument must be of type number')}else if(size<0){throw new RangeError('The value "'+size+'" is invalid for option "size"')}}function alloc(size,fill,encoding){assertSize(size);if(size<=0){return createBuffer(size)}if(fill!==undefined){return typeof encoding==="string"?createBuffer(size).fill(fill,encoding):createBuffer(size).fill(fill)}return createBuffer(size)}Buffer.alloc=function(size,fill,encoding){return alloc(size,fill,encoding)};function allocUnsafe(size){assertSize(size);return createBuffer(size<0?0:checked(size)|0)}Buffer.allocUnsafe=function(size){return allocUnsafe(size)};Buffer.allocUnsafeSlow=function(size){return allocUnsafe(size)};function fromString(string,encoding){if(typeof encoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){throw new TypeError("Unknown encoding: "+encoding)}const length=byteLength(string,encoding)|0;let buf=createBuffer(length);const actual=buf.write(string,encoding);if(actual!==length){buf=buf.slice(0,actual)}return buf}function fromArrayLike(array){const length=array.length<0?0:checked(array.length)|0;const buf=createBuffer(length);for(let i=0;i=K_MAX_LENGTH){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+K_MAX_LENGTH.toString(16)+" bytes")}return length|0}function SlowBuffer(length){if(+length!=length){length=0}return Buffer.alloc(+length)}Buffer.isBuffer=function isBuffer(b){return b!=null&&b._isBuffer===true&&b!==Buffer.prototype};Buffer.compare=function compare(a,b){if(isInstance(a,Uint8Array))a=Buffer.from(a,a.offset,a.byteLength);if(isInstance(b,Uint8Array))b=Buffer.from(b,b.offset,b.byteLength);if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b)){throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array')}if(a===b)return 0;let x=a.length;let y=b.length;for(let i=0,len=Math.min(x,y);ibuffer.length){if(!Buffer.isBuffer(buf))buf=Buffer.from(buf);buf.copy(buffer,pos)}else{Uint8Array.prototype.set.call(buffer,buf,pos)}}else if(!Buffer.isBuffer(buf)){throw new TypeError('"list" argument must be an Array of Buffers')}else{buf.copy(buffer,pos)}pos+=buf.length}return buffer};function byteLength(string,encoding){if(Buffer.isBuffer(string)){return string.length}if(ArrayBuffer.isView(string)||isInstance(string,ArrayBuffer)){return string.byteLength}if(typeof string!=="string"){throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. '+"Received type "+typeof string)}const len=string.length;const mustMatch=arguments.length>2&&arguments[2]===true;if(!mustMatch&&len===0)return 0;let loweredCase=false;for(;;){switch(encoding){case"ascii":case"latin1":case"binary":return len;case"utf8":case"utf-8":return utf8ToBytes(string).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return len*2;case"hex":return len>>>1;case"base64":return base64ToBytes(string).length;default:if(loweredCase){return mustMatch?-1:utf8ToBytes(string).length}encoding=(""+encoding).toLowerCase();loweredCase=true}}}Buffer.byteLength=byteLength;function slowToString(encoding,start,end){let loweredCase=false;if(start===undefined||start<0){start=0}if(start>this.length){return""}if(end===undefined||end>this.length){end=this.length}if(end<=0){return""}end>>>=0;start>>>=0;if(end<=start){return""}if(!encoding)encoding="utf8";while(true){switch(encoding){case"hex":return hexSlice(this,start,end);case"utf8":case"utf-8":return utf8Slice(this,start,end);case"ascii":return asciiSlice(this,start,end);case"latin1":case"binary":return latin1Slice(this,start,end);case"base64":return base64Slice(this,start,end);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,start,end);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(encoding+"").toLowerCase();loweredCase=true}}}Buffer.prototype._isBuffer=true;function swap(b,n,m){const i=b[n];b[n]=b[m];b[m]=i}Buffer.prototype.swap16=function swap16(){const len=this.length;if(len%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(let i=0;imax)str+=" ... ";return""};if(customInspectSymbol){Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect}Buffer.prototype.compare=function compare(target,start,end,thisStart,thisEnd){if(isInstance(target,Uint8Array)){target=Buffer.from(target,target.offset,target.byteLength)}if(!Buffer.isBuffer(target)){throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. '+"Received type "+typeof target)}if(start===undefined){start=0}if(end===undefined){end=target?target.length:0}if(thisStart===undefined){thisStart=0}if(thisEnd===undefined){thisEnd=this.length}if(start<0||end>target.length||thisStart<0||thisEnd>this.length){throw new RangeError("out of range index")}if(thisStart>=thisEnd&&start>=end){return 0}if(thisStart>=thisEnd){return-1}if(start>=end){return 1}start>>>=0;end>>>=0;thisStart>>>=0;thisEnd>>>=0;if(this===target)return 0;let x=thisEnd-thisStart;let y=end-start;const len=Math.min(x,y);const thisCopy=this.slice(thisStart,thisEnd);const targetCopy=target.slice(start,end);for(let i=0;i2147483647){byteOffset=2147483647}else if(byteOffset<-2147483648){byteOffset=-2147483648}byteOffset=+byteOffset;if(numberIsNaN(byteOffset)){byteOffset=dir?0:buffer.length-1}if(byteOffset<0)byteOffset=buffer.length+byteOffset;if(byteOffset>=buffer.length){if(dir)return-1;else byteOffset=buffer.length-1}else if(byteOffset<0){if(dir)byteOffset=0;else return-1}if(typeof val==="string"){val=Buffer.from(val,encoding)}if(Buffer.isBuffer(val)){if(val.length===0){return-1}return arrayIndexOf(buffer,val,byteOffset,encoding,dir)}else if(typeof val==="number"){val=val&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(dir){return Uint8Array.prototype.indexOf.call(buffer,val,byteOffset)}else{return Uint8Array.prototype.lastIndexOf.call(buffer,val,byteOffset)}}return arrayIndexOf(buffer,[val],byteOffset,encoding,dir)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(arr,val,byteOffset,encoding,dir){let indexSize=1;let arrLength=arr.length;let valLength=val.length;if(encoding!==undefined){encoding=String(encoding).toLowerCase();if(encoding==="ucs2"||encoding==="ucs-2"||encoding==="utf16le"||encoding==="utf-16le"){if(arr.length<2||val.length<2){return-1}indexSize=2;arrLength/=2;valLength/=2;byteOffset/=2}}function read(buf,i){if(indexSize===1){return buf[i]}else{return buf.readUInt16BE(i*indexSize)}}let i;if(dir){let foundIndex=-1;for(i=byteOffset;iarrLength)byteOffset=arrLength-valLength;for(i=byteOffset;i>=0;i--){let found=true;for(let j=0;jremaining){length=remaining}}const strLen=string.length;if(length>strLen/2){length=strLen/2}let i;for(i=0;i>>0;if(isFinite(length)){length=length>>>0;if(encoding===undefined)encoding="utf8"}else{encoding=length;length=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}const remaining=this.length-offset;if(length===undefined||length>remaining)length=remaining;if(string.length>0&&(length<0||offset<0)||offset>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!encoding)encoding="utf8";let loweredCase=false;for(;;){switch(encoding){case"hex":return hexWrite(this,string,offset,length);case"utf8":case"utf-8":return utf8Write(this,string,offset,length);case"ascii":case"latin1":case"binary":return asciiWrite(this,string,offset,length);case"base64":return base64Write(this,string,offset,length);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,string,offset,length);default:if(loweredCase)throw new TypeError("Unknown encoding: "+encoding);encoding=(""+encoding).toLowerCase();loweredCase=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(buf,start,end){if(start===0&&end===buf.length){return base64.fromByteArray(buf)}else{return base64.fromByteArray(buf.slice(start,end))}}function utf8Slice(buf,start,end){end=Math.min(buf.length,end);const res=[];let i=start;while(i239?4:firstByte>223?3:firstByte>191?2:1;if(i+bytesPerSequence<=end){let secondByte,thirdByte,fourthByte,tempCodePoint;switch(bytesPerSequence){case 1:if(firstByte<128){codePoint=firstByte}break;case 2:secondByte=buf[i+1];if((secondByte&192)===128){tempCodePoint=(firstByte&31)<<6|secondByte&63;if(tempCodePoint>127){codePoint=tempCodePoint}}break;case 3:secondByte=buf[i+1];thirdByte=buf[i+2];if((secondByte&192)===128&&(thirdByte&192)===128){tempCodePoint=(firstByte&15)<<12|(secondByte&63)<<6|thirdByte&63;if(tempCodePoint>2047&&(tempCodePoint<55296||tempCodePoint>57343)){codePoint=tempCodePoint}}break;case 4:secondByte=buf[i+1];thirdByte=buf[i+2];fourthByte=buf[i+3];if((secondByte&192)===128&&(thirdByte&192)===128&&(fourthByte&192)===128){tempCodePoint=(firstByte&15)<<18|(secondByte&63)<<12|(thirdByte&63)<<6|fourthByte&63;if(tempCodePoint>65535&&tempCodePoint<1114112){codePoint=tempCodePoint}}}}if(codePoint===null){codePoint=65533;bytesPerSequence=1}else if(codePoint>65535){codePoint-=65536;res.push(codePoint>>>10&1023|55296);codePoint=56320|codePoint&1023}res.push(codePoint);i+=bytesPerSequence}return decodeCodePointsArray(res)}const MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(codePoints){const len=codePoints.length;if(len<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,codePoints)}let res="";let i=0;while(ilen)end=len;let out="";for(let i=start;ilen){start=len}if(end<0){end+=len;if(end<0)end=0}else if(end>len){end=len}if(endlength)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUintLE=Buffer.prototype.readUIntLE=function readUIntLE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){checkOffset(offset,byteLength,this.length)}let val=this[offset+--byteLength];let mul=1;while(byteLength>0&&(mul*=256)){val+=this[offset+--byteLength]*mul}return val};Buffer.prototype.readUint8=Buffer.prototype.readUInt8=function readUInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);return this[offset]};Buffer.prototype.readUint16LE=Buffer.prototype.readUInt16LE=function readUInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]|this[offset+1]<<8};Buffer.prototype.readUint16BE=Buffer.prototype.readUInt16BE=function readUInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);return this[offset]<<8|this[offset+1]};Buffer.prototype.readUint32LE=Buffer.prototype.readUInt32LE=function readUInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return(this[offset]|this[offset+1]<<8|this[offset+2]<<16)+this[offset+3]*16777216};Buffer.prototype.readUint32BE=Buffer.prototype.readUInt32BE=function readUInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]*16777216+(this[offset+1]<<16|this[offset+2]<<8|this[offset+3])};Buffer.prototype.readBigUInt64LE=defineBigIntMethod(function readBigUInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const lo=first+this[++offset]*2**8+this[++offset]*2**16+this[++offset]*2**24;const hi=this[++offset]+this[++offset]*2**8+this[++offset]*2**16+last*2**24;return BigInt(lo)+(BigInt(hi)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const hi=first*2**24+this[++offset]*2**16+this[++offset]*2**8+this[++offset];const lo=this[++offset]*2**24+this[++offset]*2**16+this[++offset]*2**8+last;return(BigInt(hi)<>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let val=this[offset];let mul=1;let i=0;while(++i=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readIntBE=function readIntBE(offset,byteLength,noAssert){offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert)checkOffset(offset,byteLength,this.length);let i=byteLength;let mul=1;let val=this[offset+--i];while(i>0&&(mul*=256)){val+=this[offset+--i]*mul}mul*=128;if(val>=mul)val-=Math.pow(2,8*byteLength);return val};Buffer.prototype.readInt8=function readInt8(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,1,this.length);if(!(this[offset]&128))return this[offset];return(255-this[offset]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset]|this[offset+1]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt16BE=function readInt16BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,2,this.length);const val=this[offset+1]|this[offset]<<8;return val&32768?val|4294901760:val};Buffer.prototype.readInt32LE=function readInt32LE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]|this[offset+1]<<8|this[offset+2]<<16|this[offset+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return this[offset]<<24|this[offset+1]<<16|this[offset+2]<<8|this[offset+3]};Buffer.prototype.readBigInt64LE=defineBigIntMethod(function readBigInt64LE(offset){offset=offset>>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=this[offset+4]+this[offset+5]*2**8+this[offset+6]*2**16+(last<<24);return(BigInt(val)<>>0;validateNumber(offset,"offset");const first=this[offset];const last=this[offset+7];if(first===undefined||last===undefined){boundsError(offset,this.length-8)}const val=(first<<24)+this[++offset]*2**16+this[++offset]*2**8+this[++offset];return(BigInt(val)<>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,4,this.length);return ieee754.read(this,offset,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(offset,noAssert){offset=offset>>>0;if(!noAssert)checkOffset(offset,8,this.length);return ieee754.read(this,offset,false,52,8)};function checkInt(buf,value,offset,ext,max,min){if(!Buffer.isBuffer(buf))throw new TypeError('"buffer" argument must be a Buffer instance');if(value>max||valuebuf.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUintLE=Buffer.prototype.writeUIntLE=function writeUIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let mul=1;let i=0;this[offset]=value&255;while(++i>>0;byteLength=byteLength>>>0;if(!noAssert){const maxBytes=Math.pow(2,8*byteLength)-1;checkInt(this,value,offset,byteLength,maxBytes,0)}let i=byteLength-1;let mul=1;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){this[offset+i]=value/mul&255}return offset+byteLength};Buffer.prototype.writeUint8=Buffer.prototype.writeUInt8=function writeUInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,255,0);this[offset]=value&255;return offset+1};Buffer.prototype.writeUint16LE=Buffer.prototype.writeUInt16LE=function writeUInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeUint16BE=Buffer.prototype.writeUInt16BE=function writeUInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,65535,0);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeUint32LE=Buffer.prototype.writeUInt32LE=function writeUInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset+3]=value>>>24;this[offset+2]=value>>>16;this[offset+1]=value>>>8;this[offset]=value&255;return offset+4};Buffer.prototype.writeUint32BE=Buffer.prototype.writeUInt32BE=function writeUInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,4294967295,0);this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};function wrtBigUInt64LE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;lo=lo>>8;buf[offset++]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;hi=hi>>8;buf[offset++]=hi;return offset}function wrtBigUInt64BE(buf,value,offset,min,max){checkIntBI(value,min,max,buf,offset,7);let lo=Number(value&BigInt(4294967295));buf[offset+7]=lo;lo=lo>>8;buf[offset+6]=lo;lo=lo>>8;buf[offset+5]=lo;lo=lo>>8;buf[offset+4]=lo;let hi=Number(value>>BigInt(32)&BigInt(4294967295));buf[offset+3]=hi;hi=hi>>8;buf[offset+2]=hi;hi=hi>>8;buf[offset+1]=hi;hi=hi>>8;buf[offset]=hi;return offset+8}Buffer.prototype.writeBigUInt64LE=defineBigIntMethod(function writeBigUInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeBigUInt64BE=defineBigIntMethod(function writeBigUInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,BigInt(0),BigInt("0xffffffffffffffff"))});Buffer.prototype.writeIntLE=function writeIntLE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=0;let mul=1;let sub=0;this[offset]=value&255;while(++i>0)-sub&255}return offset+byteLength};Buffer.prototype.writeIntBE=function writeIntBE(value,offset,byteLength,noAssert){value=+value;offset=offset>>>0;if(!noAssert){const limit=Math.pow(2,8*byteLength-1);checkInt(this,value,offset,byteLength,limit-1,-limit)}let i=byteLength-1;let mul=1;let sub=0;this[offset+i]=value&255;while(--i>=0&&(mul*=256)){if(value<0&&sub===0&&this[offset+i+1]!==0){sub=1}this[offset+i]=(value/mul>>0)-sub&255}return offset+byteLength};Buffer.prototype.writeInt8=function writeInt8(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,1,127,-128);if(value<0)value=255+value+1;this[offset]=value&255;return offset+1};Buffer.prototype.writeInt16LE=function writeInt16LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value&255;this[offset+1]=value>>>8;return offset+2};Buffer.prototype.writeInt16BE=function writeInt16BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,2,32767,-32768);this[offset]=value>>>8;this[offset+1]=value&255;return offset+2};Buffer.prototype.writeInt32LE=function writeInt32LE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);this[offset]=value&255;this[offset+1]=value>>>8;this[offset+2]=value>>>16;this[offset+3]=value>>>24;return offset+4};Buffer.prototype.writeInt32BE=function writeInt32BE(value,offset,noAssert){value=+value;offset=offset>>>0;if(!noAssert)checkInt(this,value,offset,4,2147483647,-2147483648);if(value<0)value=4294967295+value+1;this[offset]=value>>>24;this[offset+1]=value>>>16;this[offset+2]=value>>>8;this[offset+3]=value&255;return offset+4};Buffer.prototype.writeBigInt64LE=defineBigIntMethod(function writeBigInt64LE(value,offset=0){return wrtBigUInt64LE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Buffer.prototype.writeBigInt64BE=defineBigIntMethod(function writeBigInt64BE(value,offset=0){return wrtBigUInt64BE(this,value,offset,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function checkIEEE754(buf,value,offset,ext,max,min){if(offset+ext>buf.length)throw new RangeError("Index out of range");if(offset<0)throw new RangeError("Index out of range")}function writeFloat(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,4)}ieee754.write(buf,value,offset,littleEndian,23,4);return offset+4}Buffer.prototype.writeFloatLE=function writeFloatLE(value,offset,noAssert){return writeFloat(this,value,offset,true,noAssert)};Buffer.prototype.writeFloatBE=function writeFloatBE(value,offset,noAssert){return writeFloat(this,value,offset,false,noAssert)};function writeDouble(buf,value,offset,littleEndian,noAssert){value=+value;offset=offset>>>0;if(!noAssert){checkIEEE754(buf,value,offset,8)}ieee754.write(buf,value,offset,littleEndian,52,8);return offset+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(value,offset,noAssert){return writeDouble(this,value,offset,true,noAssert)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(value,offset,noAssert){return writeDouble(this,value,offset,false,noAssert)};Buffer.prototype.copy=function copy(target,targetStart,start,end){if(!Buffer.isBuffer(target))throw new TypeError("argument should be a Buffer");if(!start)start=0;if(!end&&end!==0)end=this.length;if(targetStart>=target.length)targetStart=target.length;if(!targetStart)targetStart=0;if(end>0&&end=this.length)throw new RangeError("Index out of range");if(end<0)throw new RangeError("sourceEnd out of bounds");if(end>this.length)end=this.length;if(target.length-targetStart>>0;end=end===undefined?this.length:end>>>0;if(!val)val=0;let i;if(typeof val==="number"){for(i=start;i2**32){received=addNumericalSeparator(String(input))}else if(typeof input==="bigint"){received=String(input);if(input>BigInt(2)**BigInt(32)||input<-(BigInt(2)**BigInt(32))){received=addNumericalSeparator(received)}received+="n"}msg+=` It must be ${range}. Received ${received}`;return msg},RangeError);function addNumericalSeparator(val){let res="";let i=val.length;const start=val[0]==="-"?1:0;for(;i>=start+4;i-=3){res=`_${val.slice(i-3,i)}${res}`}return`${val.slice(0,i)}${res}`}function checkBounds(buf,offset,byteLength){validateNumber(offset,"offset");if(buf[offset]===undefined||buf[offset+byteLength]===undefined){boundsError(offset,buf.length-(byteLength+1))}}function checkIntBI(value,min,max,buf,offset,byteLength){if(value>max||value= 0${n} and < 2${n} ** ${(byteLength+1)*8}${n}`}else{range=`>= -(2${n} ** ${(byteLength+1)*8-1}${n}) and < 2 ** `+`${(byteLength+1)*8-1}${n}`}}throw new errors.ERR_OUT_OF_RANGE("value",range,value)}checkBounds(buf,offset,byteLength)}function validateNumber(value,name){if(typeof value!=="number"){throw new errors.ERR_INVALID_ARG_TYPE(name,"number",value)}}function boundsError(value,length,type){if(Math.floor(value)!==value){validateNumber(value,type);throw new errors.ERR_OUT_OF_RANGE("offset","an integer",value)}if(length<0){throw new errors.ERR_BUFFER_OUT_OF_BOUNDS}throw new errors.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${length}`,value)}const INVALID_BASE64_RE=/[^+/0-9A-Za-z-_]/g;function base64clean(str){str=str.split("=")[0];str=str.trim().replace(INVALID_BASE64_RE,"");if(str.length<2)return"";while(str.length%4!==0){str=str+"="}return str}function utf8ToBytes(string,units){units=units||Infinity;let codePoint;const length=string.length;let leadSurrogate=null;const bytes=[];for(let i=0;i55295&&codePoint<57344){if(!leadSurrogate){if(codePoint>56319){if((units-=3)>-1)bytes.push(239,191,189);continue}else if(i+1===length){if((units-=3)>-1)bytes.push(239,191,189);continue}leadSurrogate=codePoint;continue}if(codePoint<56320){if((units-=3)>-1)bytes.push(239,191,189);leadSurrogate=codePoint;continue}codePoint=(leadSurrogate-55296<<10|codePoint-56320)+65536}else if(leadSurrogate){if((units-=3)>-1)bytes.push(239,191,189)}leadSurrogate=null;if(codePoint<128){if((units-=1)<0)break;bytes.push(codePoint)}else if(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}else if(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}else if(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{throw new Error("Invalid code point")}}return bytes}function asciiToBytes(str){const byteArray=[];for(let i=0;i>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}return byteArray}function base64ToBytes(str){return base64.toByteArray(base64clean(str))}function blitBuffer(src,dst,offset,length){let i;for(i=0;i=dst.length||i>=src.length)break;dst[i+offset]=src[i]}return i}function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name}function numberIsNaN(obj){return obj!==obj}const hexSliceLookupTable=function(){const alphabet="0123456789abcdef";const table=new Array(256);for(let i=0;i<16;++i){const i16=i*16;for(let j=0;j<16;++j){table[i16+j]=alphabet[i]+alphabet[j]}}return table}();function defineBigIntMethod(fn){return typeof BigInt==="undefined"?BufferBigIntNotDefined:fn}function BufferBigIntNotDefined(){throw new Error("BigInt not supported")}})(buffer);return buffer}requireBuffer();function getGlobal(){if(typeof globalThis!=="undefined")return globalThis;if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")}const anyGlobal=getGlobal();anyGlobal.crypto||anyGlobal.msCrypto;function createHash(algo){switch(algo){case"ripemd160":return ripemd160.create();case"sha256":return sha256$1.create();case"sha512":return sha512$1.create();case"sha3-256":return sha3_256.create();case"sha3-512":return sha3_512.create()}assertArgument(false,"invalid hashing algorithm name","algorithm",algo)}const _sha256=data=>hexlify(createHash("sha3-256").update(data).digest());const _sha512=data=>hexlify(createHash("sha3-512").update(data).digest());let __sha256=_sha256;let __sha512=_sha512;let locked256=false,locked512=false;var SupportedAlgorithm;(function(SupportedAlgorithm){SupportedAlgorithm["sha256"]="sha256";SupportedAlgorithm["sha512"]="sha512"})(SupportedAlgorithm||(SupportedAlgorithm={}));function sha256(data){return hexlify(__sha256(getBytes(data)))}sha256._=_sha256;sha256.lock=function(){locked256=true};sha256.register=function(func){if(locked256){throw new Error("sha256 is locked")}__sha256=func};Object.freeze(sha256);function sha512(data){return hexlify(__sha512(getBytes(data)))}sha512._=_sha512;sha512.lock=function(){locked512=true};sha512.register=function(func){if(locked512){throw new Error("sha512 is locked")}__sha512=func};Object.freeze(sha512);function id(value,useKeccak){if(useKeccak){return keccak256(toUtf8Bytes(value))}return sha256(toUtf8Bytes(value))}const subsChrs=" !#$%&'()*+,-./<=>?@[]^_`{|}~";const Word=/^[a-z]*$/i;function unfold(words,sep){let initial=97;return words.reduce((accum,word)=>{if(word===sep){initial++}else if(word.match(Word)){accum.push(String.fromCharCode(initial)+word)}else{initial=97;accum.push(word)}return accum},[])}function decode(data,subs){for(let i=subsChrs.length-1;i>=0;i--){data=data.split(subsChrs[i]).join(subs.substring(2*i,2*i+2))}const clumps=[];const leftover=data.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(all,item,semi,word)=>{if(semi){for(let i=parseInt(semi);i>=0;i--){clumps.push(";")}}else{clumps.push(item.toLowerCase())}return""});if(leftover){throw new Error(`leftovers: ${JSON.stringify(leftover)}`)}return unfold(unfold(clumps,";"),":")}function decodeOwl(data){assertArgument(data[0]==="0","unsupported auwl data","data",data);return decode(data.substring(1+2*subsChrs.length),data.substring(1,1+2*subsChrs.length))}class Wordlist{locale;constructor(locale){defineProperties(this,{locale:locale})}split(phrase){return phrase.toLowerCase().split(/\s+/g)}join(words){return words.join(" ")}static check(wordlist){const words=[];for(let i=0;i<2048;i++){const word=wordlist.getWord(i);if(i!==wordlist.getWordIndex(word)){return"0x"}words.push(word)}return id(words.join("\n")+"\n")}}class WordlistOwl extends Wordlist{#data;#checksum;constructor(locale,data,checksum){super(locale);this.#data=data;this.#checksum=checksum;this.#words=null}get _data(){return this.#data}_decodeWords(){return decodeOwl(this.#data)}#words;#loadWords(){if(this.#words==null){const words=this._decodeWords();const checksum=id(words.join("\n")+"\n",true);if(checksum!==this.#checksum){throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`)}this.#words=words}return this.#words}getWord(index){const words=this.#loadWords();assertArgument(index>=0&&index=width){const value=accum>>bits-width;accum&=(1<{const match=accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);assertArgument(match!==null,"internal error parsing accents","accents",accents);let posOffset=0;const positions=decodeBits(parseInt(match[3]),match[4]);const charCode=parseInt(match[2]);const regex=new RegExp(`([${match[1]}])`,"g");words=words.replace(regex,(all,letter)=>{const rem=--positions[posOffset];if(rem===0){letter=String.fromCharCode(letter.charCodeAt(0),charCode);posOffset++}return letter})});return words.split(",")}class WordlistOwlA extends WordlistOwl{#accent;constructor(locale,data,accent,checksum){super(locale,data,checksum);this.#accent=accent}get _accent(){return this.#accent}_decodeWords(){return decodeOwlA(this._data,this._accent)}}const words$3="0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZo3Bol]D!D+Ld/eb_LoAmpuAnc]ApaAr]I>Is)IvoOqueOzaUle%Up 0Cl.EgoE=EnEr#F[G +M->NeN%P_sR>Rue]SneTaU{d2Am^AnA+AseAveI,)ImaInica2B_Cc~|i'Ci`CoDigoDoF_G!He)JinJoL/ch/eg$Lg Lin/l LmoLum`Mba)M!Mi{Mo&Mpr-deNej}g-oc!Nsej}t PaPi(az.Rba%RchoR&nR.(r!S!SmosS%2AneoAt!E Ec!Ei&EmaIaIm,Ip%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,EjaGa'G@Gul=I,)Ig,Il]OQues%Uga0Ad@Cu+Ez'OT[0O'Ro1EjaU=1I&Ige'0En)0O':C#D_El]Gi`GoIsJ oLabr/>Le%Li&Lm/om/p NNalNi>Nt!-ue=PaPelP?]Que)R Rcel(edR*RoRpa&RqueR[foR)S SeoS~SoS%TaT$Tr@UsaU%VoYa<3A#nCa&C!a|oDalD*G IneL L{'Le/ig+LlejoLoLuc--s N.OnOrPi'Que'R(ch(d!Rez(f?Ri>Rl(mizEgun%Em$EnsaE|!oD^Eb=Er%Es#Lg/*Lm.LpoLrNd*N%P #Pet*PoN{PaP!oSaScaSt+T 5BiB^DoE{G*I&In/e%LoMboM^Ptu[TaTi`:Ba&B!B$BleC GazG[&L/&L!oL*Lm.L.Ls/#LudLv Mb-c~Ndi-e Ng_Ni{dN}#PoQueRdin()nSt_TanU`Xof.3Cc~CoC_#C%DGu*IsL=LvaMa`M?l-d-Re'Rg*S#T?:Ba>BiqueB]BuCoC#JoL L>L,#Ll/.Ma'Mb^Ng}quePaPe)P@P.Qu?l(deRe(if(je%RotR+R%TuajeU+ZaZ.3At+|oC]CnicaJa&J!Ji&L/efo'MaM^Mp=NazNd!N!NisNRmi'Rnur(+rSisSo+StigoT!aX#Z3B$Bu+nEmpoEn{Er[EPoR(.TanT!eTu=Za5Al]B?=C Ci'DoG/&M N}#P PeQueRaxR!oRm,%RneoRoRpe&R_RS!Xi>2AbajoAc#rA!Afi>AgoAjeAmoAnceA#AumaAz EbolEguaEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv!b){return 1}return 0}for(let length=3;length<=9;length++){const d=data$2[length-3];for(let offset=0;offset=0&&index=40){code=code+168-40}else if(code>=19){code=code+97-19}return toUtf8String(new Uint8Array([225,(code>>6)+132,(code&63)+128]))}let _wordlist$1=null;function loadWords$1(){if(_wordlist$1!=null){return _wordlist$1}const wordlist=[];data$1.forEach((data,length)=>{length+=4;for(let i=0;i=0&&index>2),128+codes.indexOf(data[i*3+1]),128+codes.indexOf(data[i*3+2])];if(locale==="zh_tw"){const common=s%4;for(let i=common;i<3;i++){bytes[i]=codes.indexOf(deltaData[deltaOffset++])+(i==0?228:128)}}wordlist.push(toUtf8String(new Uint8Array(bytes)))}const checksum=id(wordlist.join("\n")+"\n");if(checksum!==Checks[locale]){throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`)}_wordlist[locale]=wordlist;return wordlist}const wordlists={};class LangZh extends Wordlist{constructor(dialect){super("zh_"+dialect)}getWord(index){const words=loadWords(this.locale);assertArgument(index>=0&&index; -} -export interface TestBlockchainBlock { - test: string; - hash: string; - parentHash: string; - number: number; - timestamp: number; - nonce: string; - difficulty: bigint; - energyLimit: bigint; - energyUsed: bigint; - miner: string; - extraData: string; - transactions: Array; - baseFeePerEnergy?: bigint; -} -export interface TestBlockchainTransaction { - test: string; - hash: string; - blockHash: string; - blockNumber: number; - type: number; - from: string; - energyPrice: bigint; - energyLimit: bigint; - to: string; - value: bigint; - nonce: number; - data: string; - signature: { - r: string; - s: string; - yParity: 0 | 1; - v: number; - networkV: null | bigint; - }; - creates: null | string; - networkId: bigint; - accessList?: Array>>; -} -export interface TestBlockchainReceipt { - test: string; - blockHash: string; - blockNumber: number; - type: number; - contractAddress: null | string; - cumulativeEnergyUsed: bigint; - from: string; - energyUsed: bigint; - energyPrice: bigint; - logs: Array<{ - address: string; - blockHash: string; - blockNumber: number; - data: string; - index: number; - topics: Array; - transactionHash: string; - transactionIndex: number; - }>; - logsBloom: string; - root: null | string; - status: null | number; - to: string; - hash: string; - index: number; -} -export declare const testAddress: Record>; -export declare const testBlock: Record>; -export declare const testTransaction: Record>; -export declare const testReceipt: Record>; -export declare const networkNames: Array; -export declare function networkFeatureAtBlock(feature: string, block: number): boolean; -//# sourceMappingURL=blockchain-data.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/blockchain-data.d.ts.map b/lib.commonjs/_tests/blockchain-data.d.ts.map deleted file mode 100644 index 640ed0edf..000000000 --- a/lib.commonjs/_tests/blockchain-data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blockchain-data.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,yBAAyB;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,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AC;IACpB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAC/B,qBAAqB,EACrB,KAAK,CAAC,qBAAqB,CAAC,CAyB5B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAC7B,qBAAqB,EACrB,KAAK,CAAC,mBAAmB,CAAC,CAiE1B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CACnC,qBAAqB,EACrB,KAAK,CAAC,yBAAyB,CAAC,CAwDhC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAC/B,qBAAqB,EACrB,KAAK,CAAC,qBAAqB,CAAC,CAiG5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,qBAAqB,CAAyB,CAAC;AAChF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQ7E"} \ No newline at end of file diff --git a/lib.commonjs/_tests/blockchain-data.js b/lib.commonjs/_tests/blockchain-data.js deleted file mode 100644 index 6dcc856bc..000000000 --- a/lib.commonjs/_tests/blockchain-data.js +++ /dev/null @@ -1,246 +0,0 @@ -'use strict'; - -const testAddress = { - mainnet: [ - { - test: "old-account", - address: "0xAC1639CF97a3A46D431e6d1216f576622894cBB5", - balance: BigInt("4813414100000000"), - nonce: 3, - code: "0x", - }, - { - test: "TheDAO-splitter-contract", - address: "0x3474627D4F63A678266BC17171D87f8570936622", - code: "0x606060405260e060020a60003504630b3ed5368114602e57806337b0574a14605257806356fa47f0146062575b005b602c6004356000546101009004600160a060020a03908116339091161460bb575b50565b60005460ff166060908152602090f35b602c60043560005460ff1615609657600160a060020a038116600034606082818181858883f193505050501515604f576002565b33600160a060020a0316600034606082818181858883f193505050501515604f576002565b600080546101009004600160a060020a03169082606082818181858883f193505050501515604f57600256", - storage: { - "0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300", - }, - }, - { - test: "ricmoo.firefly.eth", - address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72", - name: "ricmoo.firefly.eth", - }, - ], - goerli: [], -}; -const testBlock = { - mainnet: [ - { - test: "old-homestead-block", - hash: "0x3d6122660cc824376f11ee842f83addc3525e2dd6756b9bcf0affa6aa88cf741", - parentHash: "0xb495a1d7e6663152ae92708da4843337b958146015a2802f4193a410044698c9", - number: 3, - timestamp: 1438270048, - nonce: "0x2e9344e0cbde83ce", - difficulty: BigInt(17154715646), - energyLimit: BigInt("0x1388"), - energyUsed: BigInt("0"), - miner: "0x5088D623ba0fcf0131E0897a91734A4D83596AA0", - extraData: "0x476574682f76312e302e302d66633739643332642f6c696e75782f676f312e34", - transactions: [], - }, - { - test: "london-block", - number: 14413999, - hash: "0x6c79356d40ebb6ed63dc19f5d407f8f1c876047b59dc1a4598cce0e64dcabec5", - parentHash: "0xbf09b0e215f247a5066d19ece5b4c66960771d45fae62985e8d751fb1adcfe2f", - timestamp: 1647654576, - nonce: "0xb4bc9979af5369fe", - difficulty: BigInt("12841513359509721"), - energyLimit: BigInt("30087914"), - energyUsed: BigInt("2008910"), - miner: "0x2A20380DcA5bC24D052acfbf79ba23e988ad0050", - extraData: "0x706f6f6c696e2e636f6d21f7092f019bb92a76", - baseFeePerEnergy: BigInt("40911884304"), - transactions: [ - "0x1c3a398933db10634631f54b435c40c8805c13f12bbac7c3dab858ca44213fa2", - "0xd98947cbdd892cc7f679c903903e6d18a5c5afb19e94437beba79372ad71c347", - "0x4d66190deb55b5820cb0ce9adb972f646fa0f3e64eaeee674bbf3d054bf3d883", - "0x9db7bd5f4c91d6103c714bcbc35df3dc708daa668aaef7449b589dbd3be24dac", - "0x126a43ae4ade4b7fc5c8ac9ebd3dbcf7314f63c60f2804fb49aa25b5c7d80bb1", - "0x82a90aa4b3b1b7873b117c3ff1ca7165ae34b2fc0788cc0cbfd41805d588590d", - "0x7f694a6a9972457753ed3dec164f17272b1c8b1da4eab149df95e31a3e72f606", - "0xdce1cba1ff33f0c23881087d49de3b34fe84c8a6883f3edd75b04fc23e458aac", - "0xbe1c69f825279cebef42d1f0e07397dcddef7fb278b0195e295ede3e156836c4", - "0x1d2f007b3c0f894403973a30e5ffaa78589f873d963e9554c6bb1bd7a3127245", - "0x9c8c78191cf4ae9ae8eee1165153eabe24dbd8b9509b83d5f0caeea85251bb2f", - "0x42e956f4b3dd6535359b272a0d2dab995c364cb48baaf8d0a1981995f3f8c808", - "0xdc2c2e99393e24d5dc66e38665fa1d1ff007d92088ef3fd2549545fdbe862ef6", - "0xaad7be28fffd2e77e8e40bf57f2ac140aa8283ec93c7f3f61a82c79405602f53", - "0x4735f1421b7b30283e87e0799e82e54307d3e5ba14cd54ad8420b57577489a71", - "0x0b9d6aa23aa439b41e86595f2ad91f498adffa3e6e7cb26ac7d73252e59fd3de", - "0xcd93e19bd5d5c5a834fec613116fa01f46eddfd2faa20ef302271b874b9d812a", - "0x5bf1976574a637f5ac0b8bda1a792fa16cc7ce9624d32e9bd6bd9aa6a8f19d2f", - "0x2e778da4f66f10f7b681b605635c6599cdbeea167fc1c4396a097aef5d06de61", - "0xd5fd68eebc4c870ccda081786a74c75c250e9e2d8269b8935edb3adb11b80bb2", - "0x2aec42a11c1d8c1e5198d54aacbc6bebb09bcd5e78f6af81ea09d65c9064734a", - "0xbea2e364ea4959ec438d9ccc2d2f7120c7eaba3b177cc0d7df8ff65d866ef89f", - "0xf48bbb0f838353060da4126a555ce532abf497a9d1108001afffaac513a59ddf", - "0xf5664e4372cce62733a6610efb7701a4a0e552d81f8caa764d8474b3070c6617", - "0x9d3732ddbd20610008ff737da2f61120734a1cbfa864374bcbcf10051e6048cb", - "0xc4d0df5bc6fa51b34ac3c898866d779d4e51a6be4d13be1ec3084b7229b03b47", - "0x90c86ec98b8ad98049b4ee54cb3aa72c5ae743077b830e8a294aa5dc47a1fb18", - ], - }, - ], - goerli: [], -}; -const testTransaction = { - mainnet: [ - { - test: "legacy", - hash: "0xccc90ab97a74c952fb3376c4a3efb566a58a10df62eb4d44a61e106fcf10ec61", - blockHash: "0x9653f180a5720f3634816eb945a6d722adee52cc47526f6357ac10adaf368135", - blockNumber: 4097745, - // index: 18, - type: 0, - from: "0x32DEF047DeFd076DB21A2D759aff2A591c972248", - energyPrice: BigInt("0x4a817c800"), - energyLimit: BigInt("0x3d090"), - to: "0x6fC21092DA55B392b045eD78F4732bff3C580e2c", - value: BigInt("0x186cc6acd4b0000"), - nonce: 0, - data: "0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067269636d6f6f0000000000000000000000000000000000000000000000000000", - signature: { - r: "0x1e5605197a03e3f0a168f14749168dfeefc44c9228312dacbffdcbbb13263265", - s: "0x269c3e5b3558267ad91b0a887d51f9f10098771c67b82ea6cb74f29638754f54", - yParity: 1, - v: 28, - networkV: BigInt(38), - }, - creates: null, - networkId: BigInt(1), - }, - { - test: "EIP-1559", - hash: "0x8ff41d0ba5d239acc8c123ff12451a2c15721c838f657e583d355999af4a4349", - blockHash: "0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0", - blockNumber: 12966000, - // index: 185, - type: 2, - from: "0x5afFBa12E9332bbc0E221c8E7BEf7CB7cfB3F281", - to: "0x2258CcD34ae29E6B199b6CD64eb2aEF157df7CdE", - energyLimit: BigInt("21000"), - nonce: 2, - data: "0x", - value: BigInt("1100000000000000"), - energyPrice: BigInt("70578812137"), - networkId: BigInt(1), - signature: { - r: "0xdd26e5478d0aa84e334a0393d335ab24b83de8ecae9290305f15ab884ded246c", - s: "0x6494b4f61b0d9a5a82ecb86d72b301f859f404f0bec9682bbfff619903ecfbe2", - yParity: 1, - v: 28, - networkV: null, - }, - creates: null, - accessList: [], - }, - ], - goerli: [], -}; -const testReceipt = { - mainnet: [ - { - test: "legacy", - //byzantium: false, - blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", - blockNumber: 0x3c92b5, - type: 0, - contractAddress: null, - cumulativeEnergyUsed: BigInt(0x1cca2e), - from: "0x18C6045651826824FEBBD39d8560584078d1b247", - energyUsed: BigInt(0x14bb7), - energyPrice: BigInt(4100000000), - logs: [ - { - address: "0x314159265dD8dbb310642f98f50C066173C1259b", - blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", - blockNumber: 0x3c92b5, - data: "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247", - index: 0x1a, - topics: [ - "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", - "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", - "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1", - ], - transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", - transactionIndex: 0x39, - }, - { - address: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef", - blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", - blockNumber: 0x3c92b5, - data: "0x000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000595a32ce", - index: 0x1b, - topics: [ - "0x0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e670", - "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1", - "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247", - ], - transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", - transactionIndex: 0x39, - }, - ], - logsBloom: "0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000", - root: "0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590", - // Should be null for pre-byzantium, but some nodes have backfilled it - status: 1, - to: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef", - hash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", - index: 0x39, - }, - { - test: "byzantium", - //byzantium: true, - blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9", - blockNumber: 0x444f76, - type: 0, - contractAddress: null, - cumulativeEnergyUsed: BigInt(0x15bfe7), - from: "0x18C6045651826824FEBBD39d8560584078d1b247", - energyUsed: BigInt(0x1b968), - energyPrice: BigInt(1000000000), - logs: [ - { - address: "0xb90E64082D00437e65A76d4c8187596BC213480a", - blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9", - blockNumber: 0x444f76, - data: "0x", - index: 0x10, - topics: [ - "0x748d071d1992ee1bfe7a39058114d0a50d5798fe8eb3a9bfb4687f024629a2ce", - "0x5574aa58f7191ccab6de6cf75fe2ea0484f010b852fdd8c6b7ae151d6c2f4b83", - ], - transactionHash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac", - transactionIndex: 0x1e, - }, - ], - logsBloom: "0x00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000800000000000000000000000000000000000000", - root: null, - status: 1, - to: "0xb90E64082D00437e65A76d4c8187596BC213480a", - hash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac", - index: 0x1e, - }, - ], - goerli: [], -}; -const networkNames = ["mainnet", "goerli"]; -function networkFeatureAtBlock(feature, block) { - switch (feature) { - case "byzantium": - return block >= 4370000; - } - throw new Error(`unknown feature: ${feature}`); -} - -exports.networkFeatureAtBlock = networkFeatureAtBlock; -exports.networkNames = networkNames; -exports.testAddress = testAddress; -exports.testBlock = testBlock; -exports.testReceipt = testReceipt; -exports.testTransaction = testTransaction; -//# sourceMappingURL=blockchain-data.js.map diff --git a/lib.commonjs/_tests/blockchain-data.js.map b/lib.commonjs/_tests/blockchain-data.js.map deleted file mode 100644 index 89ea92d35..000000000 --- a/lib.commonjs/_tests/blockchain-data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blockchain-data.js","sources":["../../lib.esm/_tests/blockchain-data.js"],"sourcesContent":["export const testAddress = {\n mainnet: [\n {\n test: \"old-account\",\n address: \"0xAC1639CF97a3A46D431e6d1216f576622894cBB5\",\n balance: BigInt(\"4813414100000000\"),\n nonce: 3,\n code: \"0x\",\n },\n {\n test: \"TheDAO-splitter-contract\",\n address: \"0x3474627D4F63A678266BC17171D87f8570936622\",\n code: \"0x606060405260e060020a60003504630b3ed5368114602e57806337b0574a14605257806356fa47f0146062575b005b602c6004356000546101009004600160a060020a03908116339091161460bb575b50565b60005460ff166060908152602090f35b602c60043560005460ff1615609657600160a060020a038116600034606082818181858883f193505050501515604f576002565b33600160a060020a0316600034606082818181858883f193505050501515604f576002565b600080546101009004600160a060020a03169082606082818181858883f193505050501515604f57600256\",\n storage: {\n \"0\": \"0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300\",\n },\n },\n {\n test: \"ricmoo.firefly.eth\",\n address: \"0x8ba1f109551bD432803012645Ac136ddd64DBA72\",\n name: \"ricmoo.firefly.eth\",\n },\n ],\n goerli: [],\n};\nexport const testBlock = {\n mainnet: [\n {\n test: \"old-homestead-block\",\n hash: \"0x3d6122660cc824376f11ee842f83addc3525e2dd6756b9bcf0affa6aa88cf741\",\n parentHash: \"0xb495a1d7e6663152ae92708da4843337b958146015a2802f4193a410044698c9\",\n number: 3,\n timestamp: 1438270048,\n nonce: \"0x2e9344e0cbde83ce\",\n difficulty: BigInt(17154715646),\n energyLimit: BigInt(\"0x1388\"),\n energyUsed: BigInt(\"0\"),\n miner: \"0x5088D623ba0fcf0131E0897a91734A4D83596AA0\",\n extraData: \"0x476574682f76312e302e302d66633739643332642f6c696e75782f676f312e34\",\n transactions: [],\n },\n {\n test: \"london-block\",\n number: 14413999,\n hash: \"0x6c79356d40ebb6ed63dc19f5d407f8f1c876047b59dc1a4598cce0e64dcabec5\",\n parentHash: \"0xbf09b0e215f247a5066d19ece5b4c66960771d45fae62985e8d751fb1adcfe2f\",\n timestamp: 1647654576,\n nonce: \"0xb4bc9979af5369fe\",\n difficulty: BigInt(\"12841513359509721\"),\n energyLimit: BigInt(\"30087914\"),\n energyUsed: BigInt(\"2008910\"),\n miner: \"0x2A20380DcA5bC24D052acfbf79ba23e988ad0050\",\n extraData: \"0x706f6f6c696e2e636f6d21f7092f019bb92a76\",\n baseFeePerEnergy: BigInt(\"40911884304\"),\n transactions: [\n \"0x1c3a398933db10634631f54b435c40c8805c13f12bbac7c3dab858ca44213fa2\",\n \"0xd98947cbdd892cc7f679c903903e6d18a5c5afb19e94437beba79372ad71c347\",\n \"0x4d66190deb55b5820cb0ce9adb972f646fa0f3e64eaeee674bbf3d054bf3d883\",\n \"0x9db7bd5f4c91d6103c714bcbc35df3dc708daa668aaef7449b589dbd3be24dac\",\n \"0x126a43ae4ade4b7fc5c8ac9ebd3dbcf7314f63c60f2804fb49aa25b5c7d80bb1\",\n \"0x82a90aa4b3b1b7873b117c3ff1ca7165ae34b2fc0788cc0cbfd41805d588590d\",\n \"0x7f694a6a9972457753ed3dec164f17272b1c8b1da4eab149df95e31a3e72f606\",\n \"0xdce1cba1ff33f0c23881087d49de3b34fe84c8a6883f3edd75b04fc23e458aac\",\n \"0xbe1c69f825279cebef42d1f0e07397dcddef7fb278b0195e295ede3e156836c4\",\n \"0x1d2f007b3c0f894403973a30e5ffaa78589f873d963e9554c6bb1bd7a3127245\",\n \"0x9c8c78191cf4ae9ae8eee1165153eabe24dbd8b9509b83d5f0caeea85251bb2f\",\n \"0x42e956f4b3dd6535359b272a0d2dab995c364cb48baaf8d0a1981995f3f8c808\",\n \"0xdc2c2e99393e24d5dc66e38665fa1d1ff007d92088ef3fd2549545fdbe862ef6\",\n \"0xaad7be28fffd2e77e8e40bf57f2ac140aa8283ec93c7f3f61a82c79405602f53\",\n \"0x4735f1421b7b30283e87e0799e82e54307d3e5ba14cd54ad8420b57577489a71\",\n \"0x0b9d6aa23aa439b41e86595f2ad91f498adffa3e6e7cb26ac7d73252e59fd3de\",\n \"0xcd93e19bd5d5c5a834fec613116fa01f46eddfd2faa20ef302271b874b9d812a\",\n \"0x5bf1976574a637f5ac0b8bda1a792fa16cc7ce9624d32e9bd6bd9aa6a8f19d2f\",\n \"0x2e778da4f66f10f7b681b605635c6599cdbeea167fc1c4396a097aef5d06de61\",\n \"0xd5fd68eebc4c870ccda081786a74c75c250e9e2d8269b8935edb3adb11b80bb2\",\n \"0x2aec42a11c1d8c1e5198d54aacbc6bebb09bcd5e78f6af81ea09d65c9064734a\",\n \"0xbea2e364ea4959ec438d9ccc2d2f7120c7eaba3b177cc0d7df8ff65d866ef89f\",\n \"0xf48bbb0f838353060da4126a555ce532abf497a9d1108001afffaac513a59ddf\",\n \"0xf5664e4372cce62733a6610efb7701a4a0e552d81f8caa764d8474b3070c6617\",\n \"0x9d3732ddbd20610008ff737da2f61120734a1cbfa864374bcbcf10051e6048cb\",\n \"0xc4d0df5bc6fa51b34ac3c898866d779d4e51a6be4d13be1ec3084b7229b03b47\",\n \"0x90c86ec98b8ad98049b4ee54cb3aa72c5ae743077b830e8a294aa5dc47a1fb18\",\n ],\n },\n ],\n goerli: [],\n};\nexport const testTransaction = {\n mainnet: [\n {\n test: \"legacy\",\n hash: \"0xccc90ab97a74c952fb3376c4a3efb566a58a10df62eb4d44a61e106fcf10ec61\",\n blockHash: \"0x9653f180a5720f3634816eb945a6d722adee52cc47526f6357ac10adaf368135\",\n blockNumber: 4097745,\n // index: 18,\n type: 0,\n from: \"0x32DEF047DeFd076DB21A2D759aff2A591c972248\",\n energyPrice: BigInt(\"0x4a817c800\"),\n energyLimit: BigInt(\"0x3d090\"),\n to: \"0x6fC21092DA55B392b045eD78F4732bff3C580e2c\",\n value: BigInt(\"0x186cc6acd4b0000\"),\n nonce: 0,\n data: \"0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067269636d6f6f0000000000000000000000000000000000000000000000000000\",\n signature: {\n r: \"0x1e5605197a03e3f0a168f14749168dfeefc44c9228312dacbffdcbbb13263265\",\n s: \"0x269c3e5b3558267ad91b0a887d51f9f10098771c67b82ea6cb74f29638754f54\",\n yParity: 1,\n v: 28,\n networkV: BigInt(38),\n },\n creates: null,\n networkId: BigInt(1),\n },\n {\n test: \"EIP-1559\",\n hash: \"0x8ff41d0ba5d239acc8c123ff12451a2c15721c838f657e583d355999af4a4349\",\n blockHash: \"0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0\",\n blockNumber: 12966000,\n // index: 185,\n type: 2,\n from: \"0x5afFBa12E9332bbc0E221c8E7BEf7CB7cfB3F281\",\n to: \"0x2258CcD34ae29E6B199b6CD64eb2aEF157df7CdE\",\n energyLimit: BigInt(\"21000\"),\n nonce: 2,\n data: \"0x\",\n value: BigInt(\"1100000000000000\"),\n energyPrice: BigInt(\"70578812137\"),\n networkId: BigInt(1),\n signature: {\n r: \"0xdd26e5478d0aa84e334a0393d335ab24b83de8ecae9290305f15ab884ded246c\",\n s: \"0x6494b4f61b0d9a5a82ecb86d72b301f859f404f0bec9682bbfff619903ecfbe2\",\n yParity: 1,\n v: 28,\n networkV: null,\n },\n creates: null,\n accessList: [],\n },\n ],\n goerli: [],\n};\nexport const testReceipt = {\n mainnet: [\n {\n test: \"legacy\",\n //byzantium: false,\n blockHash: \"0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566\",\n blockNumber: 0x3c92b5,\n type: 0,\n contractAddress: null,\n cumulativeEnergyUsed: BigInt(0x1cca2e),\n from: \"0x18C6045651826824FEBBD39d8560584078d1b247\",\n energyUsed: BigInt(0x14bb7),\n energyPrice: BigInt(4100000000),\n logs: [\n {\n address: \"0x314159265dD8dbb310642f98f50C066173C1259b\",\n blockHash: \"0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566\",\n blockNumber: 0x3c92b5,\n data: \"0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247\",\n index: 0x1a,\n topics: [\n \"0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82\",\n \"0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae\",\n \"0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1\",\n ],\n transactionHash: \"0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616\",\n transactionIndex: 0x39,\n },\n {\n address: \"0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef\",\n blockHash: \"0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566\",\n blockNumber: 0x3c92b5,\n data: \"0x000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000595a32ce\",\n index: 0x1b,\n topics: [\n \"0x0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e670\",\n \"0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1\",\n \"0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247\",\n ],\n transactionHash: \"0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616\",\n transactionIndex: 0x39,\n },\n ],\n logsBloom: \"0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000\",\n root: \"0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590\",\n // Should be null for pre-byzantium, but some nodes have backfilled it\n status: 1,\n to: \"0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef\",\n hash: \"0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616\",\n index: 0x39,\n },\n {\n test: \"byzantium\",\n //byzantium: true,\n blockHash: \"0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9\",\n blockNumber: 0x444f76,\n type: 0,\n contractAddress: null,\n cumulativeEnergyUsed: BigInt(0x15bfe7),\n from: \"0x18C6045651826824FEBBD39d8560584078d1b247\",\n energyUsed: BigInt(0x1b968),\n energyPrice: BigInt(1000000000),\n logs: [\n {\n address: \"0xb90E64082D00437e65A76d4c8187596BC213480a\",\n blockHash: \"0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9\",\n blockNumber: 0x444f76,\n data: \"0x\",\n index: 0x10,\n topics: [\n \"0x748d071d1992ee1bfe7a39058114d0a50d5798fe8eb3a9bfb4687f024629a2ce\",\n \"0x5574aa58f7191ccab6de6cf75fe2ea0484f010b852fdd8c6b7ae151d6c2f4b83\",\n ],\n transactionHash: \"0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac\",\n transactionIndex: 0x1e,\n },\n ],\n logsBloom: \"0x00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000800000000000000000000000000000000000000\",\n root: null,\n status: 1,\n to: \"0xb90E64082D00437e65A76d4c8187596BC213480a\",\n hash: \"0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac\",\n index: 0x1e,\n },\n ],\n goerli: [],\n};\nexport const networkNames = [\"mainnet\", \"goerli\"];\nexport function networkFeatureAtBlock(feature, block) {\n switch (feature) {\n case \"byzantium\":\n return block >= 4370000;\n default:\n break;\n }\n throw new Error(`unknown feature: ${feature}`);\n}\n//# sourceMappingURL=blockchain-data.js.map"],"names":[],"mappings":";;AAAY,MAAC,WAAW,GAAG;AAC3B,IAAI,OAAO,EAAE;AACb,QAAQ;AACR,YAAY,IAAI,EAAE,aAAa;AAC/B,YAAY,OAAO,EAAE,4CAA4C;AACjE,YAAY,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC;AAC/C,YAAY,KAAK,EAAE,CAAC;AACpB,YAAY,IAAI,EAAE,IAAI;AACtB,SAAS;AACT,QAAQ;AACR,YAAY,IAAI,EAAE,0BAA0B;AAC5C,YAAY,OAAO,EAAE,4CAA4C;AACjE,YAAY,IAAI,EAAE,kdAAkd;AACpe,YAAY,OAAO,EAAE;AACrB,gBAAgB,GAAG,EAAE,oEAAoE;AACzF,aAAa;AACb,SAAS;AACT,QAAQ;AACR,YAAY,IAAI,EAAE,oBAAoB;AACtC,YAAY,OAAO,EAAE,4CAA4C;AACjE,YAAY,IAAI,EAAE,oBAAoB;AACtC,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE,EAAE;AACd;AACY,MAAC,SAAS,GAAG;AACzB,IAAI,OAAO,EAAE;AACb,QAAQ;AACR,YAAY,IAAI,EAAE,qBAAqB;AACvC,YAAY,IAAI,EAAE,oEAAoE;AACtF,YAAY,UAAU,EAAE,oEAAoE;AAC5F,YAAY,MAAM,EAAE,CAAC;AACrB,YAAY,SAAS,EAAE,UAAU;AACjC,YAAY,KAAK,EAAE,oBAAoB;AACvC,YAAY,UAAU,EAAE,MAAM,CAAC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AACnG,oBAAoB,WAAW,EAAE,QAAQ;AACzC,oBAAoB,IAAI,EAAE,IAAI;AAC9B,oBAAoB,KAAK,EAAE,IAAI;AAC/B,oBAAoB,MAAM,EAAE;AAC5B,wBAAwB,oEAAoE;AAC5F,wBAAwB,oEAAoE;AAC5F,qBAAqB;AACrB,oBAAoB,eAAe,EAAE,oEAAoE;AACzG,oBAAoB,gBAAgB,EAAE,IAAI;AAC1C,iBAAiB;AACjB,aAAa;AACb,YAAY,SAAS,EAAE,ogBAAogB;AAC3hB,YAAY,IAAI,EAAE,IAAI;AACtB,YAAY,MAAM,EAAE,CAAC;AACrB,YAAY,EAAE,EAAE,4CAA4C;AAC5D,YAAY,IAAI,EAAE,oEAAoE;AACtF,YAAY,KAAK,EAAE,IAAI;AACvB,SAAS;AACT,KAAK;AACL,IAAI,MAAM,EAAE,EAAE;AACd;AACY,MAAC,YAAY,GAAG,CAAC,SAAS,EAAE,QAAQ;AACzC,SAAS,qBAAqB,CAAC,OAAO,EAAE,KAAK,EAAE;AACtD,IAAI,QAAQ,OAAO;AACnB,QAAQ,KAAK,WAAW;AACxB,YAAY,OAAO,KAAK,IAAI,OAAO;AAGnC;AACA,IAAI,MAAM,IAAI,KAAK,CAAC,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;AAClD;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/_tests/create-provider.d.ts b/lib.commonjs/_tests/create-provider.d.ts deleted file mode 100644 index ef373e81a..000000000 --- a/lib.commonjs/_tests/create-provider.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AbstractProvider } from "../index.js"; -export declare function setupProviders(): void; -export declare const providerNames: readonly string[]; -export declare function getProviderNetworks(provider: string): Array; -export declare function getProvider(provider: string, network: string): null | AbstractProvider; -export declare function checkProvider(provider: string, network: string): boolean; -export declare function connect(network: string): AbstractProvider; -//# sourceMappingURL=create-provider.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/create-provider.d.ts.map b/lib.commonjs/_tests/create-provider.d.ts.map deleted file mode 100644 index 6a71ec23d..000000000 --- a/lib.commonjs/_tests/create-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA2EpD,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAED,eAAO,MAAM,aAAa,mBAAqD,CAAC;AAUhF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAMnE;AAED,wBAAgB,WAAW,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACb,IAAI,GAAG,gBAAgB,CAsBzB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAMzD"} \ No newline at end of file diff --git a/lib.commonjs/_tests/create-provider.js b/lib.commonjs/_tests/create-provider.js deleted file mode 100644 index f222839d7..000000000 --- a/lib.commonjs/_tests/create-provider.js +++ /dev/null @@ -1,172 +0,0 @@ -'use strict'; - -require('buffer'); -require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../crypto/signature.js'); -require('../abi/abi-coder.js'); -require('../abi/fragments.js'); -require('../constants/numbers.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -require('../contract/contract.js'); -require('../providers/provider.js'); -require('../providers/format.js'); -var providerAlchemy = require('../providers/provider-alchemy.js'); -var providerInfura = require('../providers/provider-infura.js'); -var providerQuicknode = require('../providers/provider-quicknode.js'); -var providerFallback = require('../providers/provider-fallback.js'); -require('ws'); -var providerPocket = require('../providers/provider-pocket.js'); -require('net'); -require('utf8'); -require('../wallet/json-keystore.js'); -require('../wallet/json-crowdsale.js'); -require('../bigNumber/bigNumber.js'); -require('../wordlists/wordlists.js'); - -const ethNetworks = ["default", "mainnet", "goerli"]; -//const maticNetworks = [ "matic", "maticmum" ]; -const ProviderCreators = [ - { - name: "AlchemyProvider", - networks: ethNetworks, - create: function (network) { - return new providerAlchemy.AlchemyProvider(network, "YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM"); - }, - }, - { - name: "InfuraProvider", - networks: ethNetworks, - create: function (network) { - return new providerInfura.InfuraProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); - }, - }, - { - name: "InfuraWebsocketProvider", - networks: ethNetworks, - create: function (network) { - return providerInfura.InfuraProvider.getWebSocketProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); - }, - }, - { - name: "PocketProvider", - networks: ethNetworks, - create: function (network) { - return new providerPocket.PocketProvider(network); - }, - }, - { - name: "QuickNodeProvider", - networks: ethNetworks, - create: function (network) { - return new providerQuicknode.QuickNodeProvider(network); - }, - }, - { - name: "FallbackProvider", - networks: ethNetworks, - create: function (network) { - const providers = []; - for (const providerName of [ - "AlchemyProvider", - "AnkrProvider", - "InfuraProvider", - ]) { - const provider = getProvider(providerName, network); - if (provider) { - providers.push(provider); - } - } - if (providers.length === 0) { - throw new Error("UNSUPPORTED NETWORK"); - } - return new providerFallback.FallbackProvider(providers); - }, - }, -]; -let setup = false; -const cleanup = []; -function setupProviders() { - after(function () { - for (const func of cleanup) { - func(); - } - }); - setup = true; -} -const providerNames = Object.freeze(ProviderCreators.map((c) => c.name)); -function getCreator(provider) { - const creators = ProviderCreators.filter((c) => c.name === provider); - if (creators.length === 1) { - return creators[0]; - } - return null; -} -function getProviderNetworks(provider) { - const creator = getCreator(provider); - if (creator) { - return creator.networks; - } - return []; -} -function getProvider(provider, network) { - if (setup == false) { - throw new Error("MUST CALL setupProviders in root context"); - } - const creator = getCreator(provider); - try { - if (creator) { - const provider = creator.create(network); - if (provider) { - cleanup.push(() => { - provider.destroy(); - }); - } - return provider; - } - } - catch (error) { - if (!errors.isError(error, "INVALID_ARGUMENT")) { - throw error; - } - } - return null; -} -function checkProvider(provider, network) { - const creator = getCreator(provider); - return creator != null; -} -function connect(network) { - const provider = getProvider("InfuraProvider", network); - if (provider == null) { - throw new Error(`could not connect to ${network}`); - } - return provider; -} - -exports.checkProvider = checkProvider; -exports.connect = connect; -exports.getProvider = getProvider; -exports.getProviderNetworks = getProviderNetworks; -exports.providerNames = providerNames; -exports.setupProviders = setupProviders; -//# sourceMappingURL=create-provider.js.map diff --git a/lib.commonjs/_tests/create-provider.js.map b/lib.commonjs/_tests/create-provider.js.map deleted file mode 100644 index 3530e3799..000000000 --- a/lib.commonjs/_tests/create-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-provider.js","sources":["../../lib.esm/_tests/create-provider.js"],"sourcesContent":["import { AlchemyProvider, InfuraProvider, PocketProvider, QuickNodeProvider, FallbackProvider, isError, } from \"../index.js\";\nconst ethNetworks = [\"default\", \"mainnet\", \"goerli\"];\n//const maticNetworks = [ \"matic\", \"maticmum\" ];\nconst ProviderCreators = [\n {\n name: \"AlchemyProvider\",\n networks: ethNetworks,\n create: function (network) {\n return new AlchemyProvider(network, \"YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM\");\n },\n },\n {\n name: \"InfuraProvider\",\n networks: ethNetworks,\n create: function (network) {\n return new InfuraProvider(network, \"49a0efa3aaee4fd99797bfa94d8ce2f1\");\n },\n },\n {\n name: \"InfuraWebsocketProvider\",\n networks: ethNetworks,\n create: function (network) {\n return InfuraProvider.getWebSocketProvider(network, \"49a0efa3aaee4fd99797bfa94d8ce2f1\");\n },\n },\n {\n name: \"PocketProvider\",\n networks: ethNetworks,\n create: function (network) {\n return new PocketProvider(network);\n },\n },\n {\n name: \"QuickNodeProvider\",\n networks: ethNetworks,\n create: function (network) {\n return new QuickNodeProvider(network);\n },\n },\n {\n name: \"FallbackProvider\",\n networks: ethNetworks,\n create: function (network) {\n const providers = [];\n for (const providerName of [\n \"AlchemyProvider\",\n \"AnkrProvider\",\n \"InfuraProvider\",\n ]) {\n const provider = getProvider(providerName, network);\n if (provider) {\n providers.push(provider);\n }\n }\n if (providers.length === 0) {\n throw new Error(\"UNSUPPORTED NETWORK\");\n }\n return new FallbackProvider(providers);\n },\n },\n];\nlet setup = false;\nconst cleanup = [];\nexport function setupProviders() {\n after(function () {\n for (const func of cleanup) {\n func();\n }\n });\n setup = true;\n}\nexport const providerNames = Object.freeze(ProviderCreators.map((c) => c.name));\nfunction getCreator(provider) {\n const creators = ProviderCreators.filter((c) => c.name === provider);\n if (creators.length === 1) {\n return creators[0];\n }\n return null;\n}\nexport function getProviderNetworks(provider) {\n const creator = getCreator(provider);\n if (creator) {\n return creator.networks;\n }\n return [];\n}\nexport function getProvider(provider, network) {\n if (setup == false) {\n throw new Error(\"MUST CALL setupProviders in root context\");\n }\n const creator = getCreator(provider);\n try {\n if (creator) {\n const provider = creator.create(network);\n if (provider) {\n cleanup.push(() => {\n provider.destroy();\n });\n }\n return provider;\n }\n }\n catch (error) {\n if (!isError(error, \"INVALID_ARGUMENT\")) {\n throw error;\n }\n }\n return null;\n}\nexport function checkProvider(provider, network) {\n const creator = getCreator(provider);\n return creator != null;\n}\nexport function connect(network) {\n const provider = getProvider(\"InfuraProvider\", network);\n if (provider == null) {\n throw new Error(`could not connect to ${network}`);\n }\n return provider;\n}\n//# sourceMappingURL=create-provider.js.map"],"names":["AlchemyProvider","InfuraProvider","PocketProvider","Quick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AI,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC;AAC3D,IAAI,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC1B,QAAQ,MAAM,IAAI,KAAK,CAAC,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1D,IAAI;AACJ,IAAI,OAAO,QAAQ;AACnB;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-cip.d.ts b/lib.commonjs/_tests/test-cip.d.ts deleted file mode 100644 index cc969463b..000000000 --- a/lib.commonjs/_tests/test-cip.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=test-cip.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/test-cip.d.ts.map b/lib.commonjs/_tests/test-cip.d.ts.map deleted file mode 100644 index cd282b01e..000000000 --- a/lib.commonjs/_tests/test-cip.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-cip.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-cip.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-cip.js b/lib.commonjs/_tests/test-cip.js deleted file mode 100644 index 415bc0261..000000000 --- a/lib.commonjs/_tests/test-cip.js +++ /dev/null @@ -1,194 +0,0 @@ -'use strict'; - -var assert = require('node:assert/strict'); -require('buffer'); -require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../crypto/signature.js'); -require('../abi/abi-coder.js'); -require('../abi/fragments.js'); -var _interface = require('../abi/interface.js'); -require('../constants/numbers.js'); -require('../contract/contract.js'); -require('../providers/provider.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -require('../providers/format.js'); -require('ws'); -require('../providers/provider-fallback.js'); -require('net'); -require('utf8'); -require('../wallet/json-keystore.js'); -require('../wallet/json-crowdsale.js'); -require('../bigNumber/bigNumber.js'); -require('../wordlists/wordlists.js'); -var index = require('../cip/index.js'); -var index$1 = require('../ipfs/index.js'); -var customUnits = require('../cip/custom-units.js'); - -const address = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; -describe("CIP metadata and custom units", () => { - it("uses Unix seconds and exact inclusive lifecycle boundaries", () => { - const lifecycle = new index.Cip151Lifecycle({ - tokenExpiration: "9007199254740993", - tradingStop: "0", - }); - assert.equal(lifecycle.isExpiredAt(9007199254740992n), false); - assert.equal(lifecycle.isExpiredAt(9007199254740993n), true); - assert.equal(lifecycle.isTradingStoppedAt(0n), true); - assert.equal(new index.Cip151Lifecycle().isExpiredAt(1n), false); - for (const value of ["-1", "1.5", "1e3", " 1", "NaN"]) - assert.throws(() => new index.Cip151Lifecycle({ tokenExpiration: value })); - }); - it("validates and copies lab measurements", () => { - const input = { moisture: { value: 12, unit: "%" } }; - const lab = new index.Cip152LabCertificate(input); - input.moisture.value = 99; - assert.equal(lab.measurements.moisture.value, 12); - for (const json of [ - null, - [], - { x: {} }, - { x: { value: true } }, - { x: { value: Infinity } }, - { x: { value: 1, unit: 3 } }, - ]) - assert.throws(() => new index.Cip152LabCertificate(json)); - }); - it("encodes CIP-150 calls and preserves block references", async () => { - const abi = new _interface.Interface(index.cip150Abi); - const values = { - tokenExpiration: "100", - lab: "ipfs://QmExample/lab.json", - }; - const calls = []; - const metadata = new index.Cip150MetadataContract(address, { - provider: null, - call: async (tx) => { - assert.equal(tx.blockTag, 42); - const parsed = abi.parseTransaction({ data: tx.data }); - calls.push(parsed.name); - const key = parsed.args.length ? parsed.args[0] : ""; - const result = { - listMetadataKeys: [Object.keys(values)], - metadataCount: [2n], - getMetadataByIndex: ["tokenExpiration", "100"], - hasMetadataKey: [Object.hasOwn(values, key)], - getMetadataValue: [values[key]], - isMetadataSealed: [true], - }; - return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); - }, - }); - assert.equal(await metadata.count(42), 2n); - assert.deepEqual(await metadata.getByIndex(0n, 42), { - key: "tokenExpiration", - value: "100", - }); - assert.equal((await metadata.readAll(42))[0].sealed, true); - assert.equal((await metadata.readAll(42, false))[0].sealed, undefined); - assert.equal((await metadata.readLifecycle(42)).tokenExpiration, 100n); - const gateway = new index$1.IpfsGateway({ - fetch: async () => new Response('{"pH":{"value":7}}'), - }); - assert.equal((await metadata.readLabCertificate(gateway, 42)).measurements.pH.value, 7); - values.lab = "ipfs://QmExample/wrong.json"; - await assert.rejects(metadata.readLabCertificate(gateway, 42), /lab.json/); - delete values.lab; - assert.equal(await metadata.readLabCertificate(gateway, 42), null); - await assert.rejects(metadata.setValue("x", "y"), /sendTransaction/); - assert.ok(calls.includes("isMetadataSealed")); - }); - it("discovers custom units and retains balances beyond Number precision", async () => { - const abi = new _interface.Interface(customUnits.customUnitAbi); - const canonical = 9007199254740993n; - const token = new customUnits.CustomUnitToken(address, { - provider: null, - call: async (tx) => { - assert.equal(tx.blockTag, 10); - const parsed = abi.parseTransaction({ data: tx.data }); - const result = { - supportsUnit: [parsed.args.length > 0 && parsed.args[0] === "units"], - supportedUnits: [["units", "kg"]], - preferredUnit: ["kg"], - balanceOf: [canonical], - balanceOfUnit: [canonical * 3n], - }; - if (parsed.name === "balanceOfUnit") - assert.equal(parsed.args[1], "kg"); - return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); - }, - }); - assert.equal((await token.discover(10)).supports("kg"), true); - const balance = await token.balance(address, undefined, 10); - assert.equal(balance.multiplierNumerator, canonical * 3n); - assert.equal(balance.multiplierDenominator, canonical); - assert.equal(await token.supportsUnit(" ", 10), false); - assert.throws(() => token.balanceOfUnit(address, " ")); - }); -}); -describe("IPFS gateway", () => { - it("resolves references and rejects unsupported schemes and traversal", () => { - const gateway = new index$1.IpfsGateway(); - for (const ref of [ - "ipfs://QmExample/lab.json", - "/ipfs/QmExample/lab.json", - "QmExample/lab.json", - "ipfs://ipfs/QmExample/lab.json", - ]) - assert.equal(gateway.resolve(ref).href, "https://ipf.sk/QmExample/lab.json"); - assert.equal(gateway.resolve("https://example.com/lab.json").href, "https://example.com/lab.json"); - for (const ref of ["", "file:///tmp/lab.json", "QmExample/../lab.json"]) - assert.throws(() => gateway.resolve(ref)); - assert.throws(() => new index$1.IpfsGateway({ maxResponseBytes: 0 })); - assert.throws(() => new index$1.IpfsGateway({ template: "ftp://example.com/{cid}" })); - }); - it("bounds streamed bodies and cancels oversized responses", async () => { - let cancelled = false; - const gateway = new index$1.IpfsGateway({ - maxResponseBytes: 4, - fetch: async () => new Response(new ReadableStream({ - start(c) { - c.enqueue(new Uint8Array(5)); - }, - cancel() { - cancelled = true; - }, - })), - }); - await assert.rejects(gateway.readJson("QmExample"), /exceeds/); - assert.equal(cancelled, true); - }); - it("rejects HTTP errors and invalid JSON", async () => { - await assert.rejects(new index$1.IpfsGateway({ - fetch: async () => new Response("no", { status: 404 }), - }).readJson("QmExample"), /404/); - await assert.rejects(new index$1.IpfsGateway({ fetch: async () => new Response("not json") }).readJson("QmExample"), SyntaxError); - }); - it("aborts stalled requests", async () => { - const gateway = new index$1.IpfsGateway({ - timeoutMs: 5, - fetch: async (_url, init) => new Promise((_resolve, reject) => init.signal.addEventListener("abort", () => reject(new Error("aborted")))), - }); - await assert.rejects(gateway.readJson("QmExample"), /aborted/); - }); -}); -//# sourceMappingURL=test-cip.js.map diff --git a/lib.commonjs/_tests/test-cip.js.map b/lib.commonjs/_tests/test-cip.js.map deleted file mode 100644 index d9015ecb9..000000000 --- a/lib.commonjs/_tests/test-cip.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-cip.js","sources":["../../lib.esm/_tests/test-cip.js"],"sourcesContent":["import assert from \"node:assert/strict\";\nimport { Interface, Cip150MetadataContract, Cip151Lifecycle, Cip152LabCertificate, CustomUnitToken, cip150Abi, customUnitAbi, IpfsGateway, } from \"../index.js\";\nconst address = \"0xab38254e30777140469a3aa168df81182d3d61f9843f\";\ndescribe(\"CIP metadata and custom units\", () => {\n it(\"uses Unix seconds and exact inclusive lifecycle boundaries\", () => {\n const lifecycle = new Cip151Lifecycle({\n tokenExpiration: \"9007199254740993\",\n tradingStop: \"0\",\n });\n assert.equal(lifecycle.isExpiredAt(9007199254740992n), false);\n assert.equal(lifecycle.isExpiredAt(9007199254740993n), true);\n assert.equal(lifecycle.isTradingStoppedAt(0n), true);\n assert.equal(new Cip151Lifecycle().isExpiredAt(1n), false);\n for (const value of [\"-1\", \"1.5\", \"1e3\", \" 1\", \"NaN\"])\n assert.throws(() => new Cip151Lifecycle({ tokenExpiration: value }));\n });\n it(\"validates and copies lab measurements\", () => {\n const input = { moisture: { value: 12, unit: \"%\" } };\n const lab = new Cip152LabCertificate(input);\n input.moisture.value = 99;\n assert.equal(lab.measurements.moisture.value, 12);\n for (const json of [\n null,\n [],\n { x: {} },\n { x: { value: true } },\n { x: { value: Infinity } },\n { x: { value: 1, unit: 3 } },\n ])\n assert.throws(() => new Cip152LabCertificate(json));\n });\n it(\"encodes CIP-150 calls and preserves block references\", async () => {\n const abi = new Interface(cip150Abi);\n const values = {\n tokenExpiration: \"100\",\n lab: \"ipfs://QmExample/lab.json\",\n };\n const calls = [];\n const metadata = new Cip150MetadataContract(address, {\n provider: null,\n call: async (tx) => {\n assert.equal(tx.blockTag, 42);\n const parsed = abi.parseTransaction({ data: tx.data });\n calls.push(parsed.name);\n const key = parsed.args.length ? parsed.args[0] : \"\";\n const result = {\n listMetadataKeys: [Object.keys(values)],\n metadataCount: [2n],\n getMetadataByIndex: [\"tokenExpiration\", \"100\"],\n hasMetadataKey: [Object.hasOwn(values, key)],\n getMetadataValue: [values[key]],\n isMetadataSealed: [true],\n };\n return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]);\n },\n });\n assert.equal(await metadata.count(42), 2n);\n assert.deepEqual(await metadata.getByIndex(0n, 42), {\n key: \"tokenExpiration\",\n value: \"100\",\n });\n assert.equal((await metadata.readAll(42))[0].sealed, true);\n assert.equal((await metadata.readAll(42, false))[0].sealed, undefined);\n assert.equal((await metadata.readLifecycle(42)).tokenExpiration, 100n);\n const gateway = new IpfsGateway({\n fetch: async () => new Response('{\"pH\":{\"value\":7}}'),\n });\n assert.equal((await metadata.readLabCertificate(gateway, 42)).measurements.pH.value, 7);\n values.lab = \"ipfs://QmExample/wrong.json\";\n await assert.rejects(metadata.readLabCertificate(gateway, 42), /lab.json/);\n delete values.lab;\n assert.equal(await metadata.readLabCertificate(gateway, 42), null);\n await assert.rejects(metadata.setValue(\"x\", \"y\"), /sendTransaction/);\n assert.ok(calls.includes(\"isMetadataSealed\"));\n });\n it(\"discovers custom units and retains balances beyond Number precision\", async () => {\n const abi = new Interface(customUnitAbi);\n const canonical = 9007199254740993n;\n const token = new CustomUnitToken(address, {\n provider: null,\n call: async (tx) => {\n assert.equal(tx.blockTag, 10);\n const parsed = abi.parseTransaction({ data: tx.data });\n const result = {\n supportsUnit: [parsed.args.length > 0 && parsed.args[0] === \"units\"],\n supportedUnits: [[\"units\", \"kg\"]],\n preferredUnit: [\"kg\"],\n balanceOf: [canonical],\n balanceOfUnit: [canonical * 3n],\n };\n if (parsed.name === \"balanceOfUnit\")\n assert.equal(parsed.args[1], \"kg\");\n return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]);\n },\n });\n assert.equal((await token.discover(10)).supports(\"kg\"), true);\n const balance = await token.balance(address, undefined, 10);\n assert.equal(balance.multiplierNumerator, canonical * 3n);\n assert.equal(balance.multiplierDenominator, canonical);\n assert.equal(await token.supportsUnit(\" \", 10), false);\n assert.throws(() => token.balanceOfUnit(address, \" \"));\n });\n});\ndescribe(\"IPFS gateway\", () => {\n it(\"resolves references and rejects unsupported schemes and traversal\", () => {\n const gateway = new IpfsGateway();\n for (const ref of [\n \"ipfs://QmExample/lab.json\",\n \"/ipfs/QmExample/lab.json\",\n \"QmExample/lab.json\",\n \"ipfs://ipfs/QmExample/lab.json\",\n ])\n assert.equal(gateway.resolve(ref).href, \"https://ipf.sk/QmExample/lab.json\");\n assert.equal(gateway.resolve(\"https://example.com/lab.json\").href, \"https://example.com/lab.json\");\n for (const ref of [\"\", \"file:///tmp/lab.json\", \"QmExample/../lab.json\"])\n assert.throws(() => gateway.resolve(ref));\n assert.throws(() => new IpfsGateway({ maxResponseBytes: 0 }));\n assert.throws(() => new IpfsGateway({ template: \"ftp://example.com/{cid}\" }));\n });\n it(\"bounds streamed bodies and cancels oversized responses\", async () => {\n let cancelled = false;\n const gateway = new IpfsGateway({\n maxResponseBytes: 4,\n fetch: async () => new Response(new ReadableStream({\n start(c) {\n c.enqueue(new Uint8Array(5));\n },\n cancel() {\n cancelled = true;\n },\n })),\n });\n await assert.rejects(gateway.readJson(\"QmExample\"), /exceeds/);\n assert.equal(cancelled, true);\n });\n it(\"rejects HTTP errors and invalid JSON\", async () => {\n await assert.rejects(new IpfsGateway({\n fetch: async () => new Response(\"no\", { status: 404 }),\n }).readJson(\"QmExample\"), /404/);\n await assert.rejects(new IpfsGateway({ fetch: async () => new Response(\"not json\") }).readJson(\"QmExample\"), SyntaxError);\n });\n it(\"aborts stalled requests\", async () => {\n const gateway = new IpfsGateway({\n timeoutMs: 5,\n fetch: async (_url, init) => new Promise((_resolve, reject) => init.signal.addEventListener(\"abort\", () => reject(new Error(\"aborted\")))),\n });\n await assert.rejects(gateway.readJson(\"QmExample\"), /aborted/);\n });\n});\n//# sourceMappingURL=test-cip.js.map"],"names":["Cip151Lifecycle","Cip152LabCertificate","Interface","cip150Abi","Cip150MetadataContract","IpfsGateway","customUnitAbi","CustomUnitToken"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,OAAO,GAA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M,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AACrJ,SAAS,CAAC;AACV,QAAQ,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;AACtE,IAAI,CAAC,CAAC;AACN,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-contract.d.ts b/lib.commonjs/_tests/test-contract.d.ts deleted file mode 100644 index 1427a8692..000000000 --- a/lib.commonjs/_tests/test-contract.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=test-contract.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/test-contract.d.ts.map b/lib.commonjs/_tests/test-contract.d.ts.map deleted file mode 100644 index fb6a18b4b..000000000 --- a/lib.commonjs/_tests/test-contract.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-contract.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-contract.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-contract.js b/lib.commonjs/_tests/test-contract.js deleted file mode 100644 index 707d478b9..000000000 --- a/lib.commonjs/_tests/test-contract.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -var index = require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -var signingKey$1 = require('../crypto/signing-key.js'); -require('../crypto/signature.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -require('../abi/abi-coder.js'); -require('../utils/base58.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../abi/fragments.js'); -var message = require('../hash/message.js'); -require('../hash/typed-data.js'); -var checks = require('../address/checks.js'); -require('../constants/numbers.js'); -require('../contract/contract.js'); -require('../providers/provider.js'); -var transaction$1 = require('../transaction/transaction.js'); -require('../providers/format.js'); -var defaultProvider = require('../providers/default-provider.js'); -require('../providers/provider-fallback.js'); -require('ws'); -require('net'); -var baseWallet$1 = require('../wallet/base-wallet.js'); -require('utf8'); -require('../wallet/json-keystore.js'); -require('../wallet/json-crowdsale.js'); -var wallet$1 = require('../wallet/wallet.js'); -require('../bigNumber/bigNumber.js'); -require('../wordlists/wordlists.js'); -var assert = require('assert'); - -const TIMEOUT_PERIOD = 120000; -const tesSignedTransaction = "0xf8ce800a830f423f0496ce276773ac97d16855a3c8faa45399136b56d419486081c880b8ab54bc60412c90c104a89865a43c33f335836bcb473f0cd477ecb2c82e6310676c87b708e3971d009b4a04e518f12454c3ee1aebc19a6b7df00076b834b692b7432611f3dafff0f422dfbae722ba4b989cfc82fee2e539fbbf21d652ea587df59e8421a3a8bc8ca2ba35033598954c54e10c00315484db568379ce94f9c894e3e6e4c7ee216676b713ca892d9b26746ae902a772e217a6a8bb493ce2bb313cf0cb66e76765d4c45ec6b68600"; -const testWalletPhrase = "better artwork flavor fish solve deer orient spread adapt doll attack hour sort copper super income bacon engine skate ill similar wink crack club"; -const testSeed = "ec372b08ffc451a5dd991c68006aa01a033a6a391e0e72d5690c13cff719fdcb2502812dbf5f32a6df828cd22d77a36405bb15bb2637b7e77f99fa60f00d3560"; -const tesPrivateKey = "69bb68c3a00a0cd9cbf2cab316476228c758329bbfe0b1759e8634694a9497afea05bcbf24e2aa0627eac4240484bb71de646a9296872a3c0e"; -const testAddress = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; -const testPublicKey = "0x484ed765af56534f1c98c0f3ac9fb460fbf5c3cf582e54a6cdfc319986ce1bb875d3afcc9c336764348c96264dfeef9565364d7e8e14e9aa80"; -const provider = defaultProvider.getDefaultProvider(process.env.COREBC_RPC_URL || "https://xcbapi.corecoin.cc/"); -const mnemonicWallet = wallet$1.Wallet.fromPhrase({ - phrase: testWalletPhrase, - password: "111111", - prefix: index.networkIdToPrefix(3), -}); -const mnemonicWalletWithoutPassKey = wallet$1.Wallet.fromPhrase({ - phrase: testWalletPhrase, - prefix: index.networkIdToPrefix(3), -}); -const wallet = wallet$1.Wallet.fromSeed({ - prefix: index.networkIdToPrefix(3), - seed: testSeed, - provider, -}); -const seedWallet = wallet$1.Wallet.fromSeed({ - prefix: index.networkIdToPrefix(3), - seed: testSeed, -}); -const signingKey = new signingKey$1.SigningKey(tesPrivateKey); -const baseWalletAddress = "0xab03a5fd22b9bee8b8ab877c86e0a2c21765e1d5bfc5"; -const baseWallet = new baseWallet$1.BaseWallet({ - signingKey, - prefix: index.networkIdToPrefix(3), - provider, -}); -const randomWallet = wallet$1.Wallet.createRandom(index.networkIdToPrefix(3), provider); -const transaction = transaction$1.Transaction.from({ - to: "0xce276773ac97d16855a3c8faa45399136b56d4194860", - value: 200n, - nonce: 0, - energyLimit: 999999n, - energyPrice: 10n, - networkId: 4, -}); -describe("Test wallet creation", function () { - after(() => provider.destroy()); - it("can generate a random wallet", function () { - assert.equal(mnemonicWalletWithoutPassKey.publicKey.length, 116); - assert.equal(randomWallet.mnemonic?.phrase.split(" ").length, 24, "mismatch in phrase length"); - assert.equal(checks.isAddressable(randomWallet), true, "random wallet is not addressable"); - }); -}); -describe("Test getting data from blockchain and calling smart contract", function () { - it("can correctly sign a transaction", async function () { - this.timeout(TIMEOUT_PERIOD); - const tx = await baseWallet.signTransaction(transaction); - assert.equal(tx, tesSignedTransaction, "sign transaction failed"); - }); - it("can correctly get signer from signed transaction", async function () { - this.timeout(TIMEOUT_PERIOD); - const message$1 = "my message"; - const signedMessage = await baseWallet.signMessage(message$1); - const address = message.verifyMessage(message$1, signedMessage, index.networkIdToPrefix(3)); - assert.equal(address, baseWalletAddress, "get address from signed message failed"); - }); - (process.env.COREBC_RPC_URL ? it : it.skip)("can get fee data", async function () { - this.timeout(TIMEOUT_PERIOD); - const feeData = await provider.getFeeData(); - assert.ok(feeData.energyPrice !== null && feeData.energyPrice >= 0n); - }); - it("can generate wallet", function () { - assert.equal(mnemonicWallet.address.length, 46, "mismatch in address length"); - assert.equal(mnemonicWallet.publicKey, testPublicKey, "mismatch in public key"); - assert.equal(mnemonicWallet.address, testAddress, "mismatch in generated address"); - assert.equal(seedWallet.address.length, 46, "mismatch in address length for seed wallet"); - assert.equal(seedWallet.publicKey, testPublicKey, "mismatch in public key for seed wallet"); - assert.equal(seedWallet.address, testAddress, "mismatch in seed length for seed wallet"); - assert.equal(wallet.address.length, 46, "mismatch in address length for wallet"); - assert.equal(wallet.publicKey, testPublicKey, "mismatch in public key for wallet"); - assert.equal(wallet.address, testAddress, "mismatch in seed length for wallet"); - }); -}); -//# sourceMappingURL=test-contract.js.map diff --git a/lib.commonjs/_tests/test-contract.js.map b/lib.commonjs/_tests/test-contract.js.map deleted file mode 100644 index a04e0464d..000000000 --- a/lib.commonjs/_tests/test-contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-contract.js","sources":["../../lib.esm/_tests/test-contract.js"],"sourcesContent":["import { getDefaultProvider, Wallet, Transaction, SigningKey, BaseWallet, verifyMessage, isAddressable, } from \"../corebc.js\";\nimport assert from \"assert\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst TIMEOUT_PERIOD = 120000;\nconst tesSignedTransaction = \"0xf8ce800a830f423f0496ce276773ac97d16855a3c8faa45399136b56d419486081c880b8ab54bc60412c90c104a89865a43c33f335836bcb473f0cd477ecb2c82e6310676c87b708e3971d009b4a04e518f12454c3ee1aebc19a6b7df00076b834b692b7432611f3dafff0f422dfbae722ba4b989cfc82fee2e539fbbf21d652ea587df59e8421a3a8bc8ca2ba35033598954c54e10c00315484db568379ce94f9c894e3e6e4c7ee216676b713ca892d9b26746ae902a772e217a6a8bb493ce2bb313cf0cb66e76765d4c45ec6b68600\";\nconst testWalletPhrase = \"better artwork flavor fish solve deer orient spread adapt doll attack hour sort copper super income bacon engine skate ill similar wink crack club\";\nconst testSeed = \"ec372b08ffc451a5dd991c68006aa01a033a6a391e0e72d5690c13cff719fdcb2502812dbf5f32a6df828cd22d77a36405bb15bb2637b7e77f99fa60f00d3560\";\nconst tesPrivateKey = \"69bb68c3a00a0cd9cbf2cab316476228c758329bbfe0b1759e8634694a9497afea05bcbf24e2aa0627eac4240484bb71de646a9296872a3c0e\";\nconst testAddress = \"0xab38254e30777140469a3aa168df81182d3d61f9843f\";\nconst testPublicKey = \"0x484ed765af56534f1c98c0f3ac9fb460fbf5c3cf582e54a6cdfc319986ce1bb875d3afcc9c336764348c96264dfeef9565364d7e8e14e9aa80\";\nconst provider = getDefaultProvider(process.env.COREBC_RPC_URL || \"https://xcbapi.corecoin.cc/\");\nconst mnemonicWallet = Wallet.fromPhrase({\n phrase: testWalletPhrase,\n password: \"111111\",\n prefix: networkIdToPrefix(3),\n});\nconst mnemonicWalletWithoutPassKey = Wallet.fromPhrase({\n phrase: testWalletPhrase,\n prefix: networkIdToPrefix(3),\n});\nconst wallet = Wallet.fromSeed({\n prefix: networkIdToPrefix(3),\n seed: testSeed,\n provider,\n});\nconst seedWallet = Wallet.fromSeed({\n prefix: networkIdToPrefix(3),\n seed: testSeed,\n});\nconst signingKey = new SigningKey(tesPrivateKey);\nconst baseWalletAddress = \"0xab03a5fd22b9bee8b8ab877c86e0a2c21765e1d5bfc5\";\nconst baseWallet = new BaseWallet({\n signingKey,\n prefix: networkIdToPrefix(3),\n provider,\n});\nconst randomWallet = Wallet.createRandom(networkIdToPrefix(3), provider);\nconst transaction = Transaction.from({\n to: \"0xce276773ac97d16855a3c8faa45399136b56d4194860\",\n value: 200n,\n nonce: 0,\n energyLimit: 999999n,\n energyPrice: 10n,\n networkId: 4,\n});\ndescribe(\"Test wallet creation\", function () {\n after(() => provider.destroy());\n it(\"can generate a random wallet\", function () {\n assert.equal(mnemonicWalletWithoutPassKey.publicKey.length, 116);\n assert.equal(randomWallet.mnemonic?.phrase.split(\" \").length, 24, \"mismatch in phrase length\");\n assert.equal(isAddressable(randomWallet), true, \"random wallet is not addressable\");\n });\n});\ndescribe(\"Test getting data from blockchain and calling smart contract\", function () {\n it(\"can correctly sign a transaction\", async function () {\n this.timeout(TIMEOUT_PERIOD);\n const tx = await baseWallet.signTransaction(transaction);\n assert.equal(tx, tesSignedTransaction, \"sign transaction failed\");\n });\n it(\"can correctly get signer from signed transaction\", async function () {\n this.timeout(TIMEOUT_PERIOD);\n const message = \"my message\";\n const signedMessage = await baseWallet.signMessage(message);\n const address = verifyMessage(message, signedMessage, networkIdToPrefix(3));\n assert.equal(address, baseWalletAddress, \"get address from signed message failed\");\n });\n (process.env.COREBC_RPC_URL ? it : it.skip)(\"can get fee data\", async function () {\n this.timeout(TIMEOUT_PERIOD);\n const feeData = await provider.getFeeData();\n assert.ok(feeData.energyPrice !== null && feeData.energyPrice >= 0n);\n });\n it(\"can generate wallet\", function () {\n assert.equal(mnemonicWallet.address.length, 46, \"mismatch in address length\");\n assert.equal(mnemonicWallet.publicKey, testPublicKey, \"mismatch in public key\");\n assert.equal(mnemonicWallet.address, testAddress, \"mismatch in generated address\");\n assert.equal(seedWallet.address.length, 46, \"mismatch in address length for seed wallet\");\n assert.equal(seedWallet.publicKey, testPublicKey, \"mismatch in public key for seed wallet\");\n assert.equal(seedWallet.address, testAddress, \"mismatch in seed length for seed wallet\");\n assert.equal(wallet.address.length, 46, \"mismatch in address length for wallet\");\n assert.equal(wallet.publicKey, testPublicKey, \"mismatch in public key for wallet\");\n assert.equal(wallet.address, testAddress, \"mismatch in seed length for wallet\");\n });\n});\n//# sourceMappingURL=test-contract.js.map"],"names":["getDefaultProvider","Wallet","networkIdToPrefix","SigningKey","BaseWallet","Transaction","isAddressable","message","verifyMessage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,yCAAyC,CAAC;AAChG,QAAQ,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,EAAE,uCAAuC,CAAC;AACxF,QAAQ,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE,mCAAmC,CAAC;AAC1F,QAAQ,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,EAAE,oCAAoC,CAAC;AACvF,IAAI,CAAC,CAAC;AACN,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-crypto.d.ts b/lib.commonjs/_tests/test-crypto.d.ts deleted file mode 100644 index 5e2048d9c..000000000 --- a/lib.commonjs/_tests/test-crypto.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=test-crypto.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/test-crypto.d.ts.map b/lib.commonjs/_tests/test-crypto.d.ts.map deleted file mode 100644 index bac9d8b06..000000000 --- a/lib.commonjs/_tests/test-crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-crypto.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-crypto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-crypto.js b/lib.commonjs/_tests/test-crypto.js deleted file mode 100644 index e2820e927..000000000 --- a/lib.commonjs/_tests/test-crypto.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -var assert = require('node:assert/strict'); -require('buffer'); -require('../address/index.js'); -require('../crypto/hmac.js'); -var ripemd160 = require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -var scrypt = require('../crypto/scrypt.js'); -var sha3 = require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -var keccak = require('../crypto/keccak.js'); -var signingKey = require('../crypto/signing-key.js'); -require('../crypto/signature.js'); -var data = require('../utils/data.js'); -require('../abi/abi-coder.js'); -require('../utils/base58.js'); -require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../abi/fragments.js'); -require('../constants/numbers.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -require('../contract/contract.js'); -require('../providers/provider.js'); -require('../providers/format.js'); -require('ws'); -require('../providers/provider-fallback.js'); -require('net'); -require('utf8'); -require('../wallet/json-keystore.js'); -require('../wallet/json-crowdsale.js'); -require('../bigNumber/bigNumber.js'); -require('../wordlists/wordlists.js'); -var cryptoBrowser = require('../crypto/crypto-browser.js'); - -describe("updated crypto dependencies", () => { - it("matches standard hash and scrypt vectors", async () => { - assert.equal(sha3.sha256("0x"), "0xa7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"); - assert.equal(ripemd160.ripemd160("0x"), "0x9c1185a5c5e9fc54612808977ee8f548b2258d31"); - assert.equal(keccak.keccak256("0x"), "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"); - const expected = "0x77d6576238657b203b19ca42c18a0497"; - assert.equal(scrypt.scryptSync("0x", "0x", 16, 1, 1, 16), expected); - assert.equal(await scrypt.scrypt("0x", "0x", 16, 1, 1, 16), expected); - assert.deepEqual(cryptoBrowser.createHash("sha256").update(new Uint8Array()).digest(), data.getBytes("0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")); - }); - it("copies byte private keys and validates lengths", () => { - const bytes = new Uint8Array(57).fill(1); - const key = new signingKey.SigningKey(bytes); - bytes.fill(2); - assert.equal(key.privateKey, "0x" + "01".repeat(57)); - for (const length of [0, 32, 56, 58]) - assert.throws(() => new signingKey.SigningKey(new Uint8Array(length))); - assert.throws(() => key.sign("0x00")); - }); - it("signs, rejects tampering and derives symmetric Ed448 secrets in both key modes", () => { - const a = new signingKey.SigningKey("01".repeat(57)); - const b = new signingKey.SigningKey("02".repeat(56) + "80"); - const digest = sha3.sha256("0x1234"); - for (const key of [a, b]) { - const sig = key.sign(digest); - assert.equal(signingKey.SigningKey.recoverPublicKey(digest, sig), key.publicKey); - assert.throws(() => signingKey.SigningKey.recoverPublicKey(sha3.sha256("0x1235"), sig)); - } - assert.equal(a.computeSharedSecret(b.publicKey), b.computeSharedSecret(a.publicKey)); - assert.equal(signingKey.SigningKey.addPoints(a.publicKey, b.publicKey), signingKey.SigningKey.addPoints(b.publicKey, a.publicKey)); - assert.throws(() => a.computeSharedSecret("0x00")); - }); -}); -//# sourceMappingURL=test-crypto.js.map diff --git a/lib.commonjs/_tests/test-crypto.js.map b/lib.commonjs/_tests/test-crypto.js.map deleted file mode 100644 index 85c046269..000000000 --- a/lib.commonjs/_tests/test-crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-crypto.js","sources":["../../lib.esm/_tests/test-crypto.js"],"sourcesContent":["import assert from \"node:assert/strict\";\nimport { SigningKey, getBytes, sha256, ripemd160, scryptSync, scrypt, keccak256, } from \"../index.js\";\nimport { createHash } from \"../crypto/crypto-browser.js\";\ndescribe(\"updated crypto dependencies\", () => {\n it(\"matches standard hash and scrypt vectors\", async () => {\n assert.equal(sha256(\"0x\"), \"0xa7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a\");\n assert.equal(ripemd160(\"0x\"), \"0x9c1185a5c5e9fc54612808977ee8f548b2258d31\");\n assert.equal(keccak256(\"0x\"), \"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\");\n const expected = \"0x77d6576238657b203b19ca42c18a0497\";\n assert.equal(scryptSync(\"0x\", \"0x\", 16, 1, 1, 16), expected);\n assert.equal(await scrypt(\"0x\", \"0x\", 16, 1, 1, 16), expected);\n assert.deepEqual(createHash(\"sha256\").update(new Uint8Array()).digest(), getBytes(\"0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"));\n });\n it(\"copies byte private keys and validates lengths\", () => {\n const bytes = new Uint8Array(57).fill(1);\n const key = new SigningKey(bytes);\n bytes.fill(2);\n assert.equal(key.privateKey, \"0x\" + \"01\".repeat(57));\n for (const length of [0, 32, 56, 58])\n assert.throws(() => new SigningKey(new Uint8Array(length)));\n assert.throws(() => key.sign(\"0x00\"));\n });\n it(\"signs, rejects tampering and derives symmetric Ed448 secrets in both key modes\", () => {\n const a = new SigningKey(\"01\".repeat(57));\n const b = new SigningKey(\"02\".repeat(56) + \"80\");\n const digest = sha256(\"0x1234\");\n for (const key of [a, b]) {\n const sig = key.sign(digest);\n assert.equal(SigningKey.recoverPublicKey(digest, sig), key.publicKey);\n assert.throws(() => SigningKey.recoverPublicKey(sha256(\"0x1235\"), sig));\n }\n assert.equal(a.computeSharedSecret(b.publicKey), b.computeSharedSecret(a.publicKey));\n assert.equal(SigningKey.addPoints(a.publicKey, b.publicKey), SigningKey.addPoints(b.publicKey, a.publicKey));\n assert.throws(() => a.computeSharedSecret(\"0x00\"));\n });\n});\n//# sourceMappingURL=test-crypto.js.map"],"names":["sha256","ripemd160","keccak256","scryptSync","scrypt","createHash","getBytes","SigningKey"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,QAAQ,CAAC,6BAA6B,EAAE,MAAM;AAC9C,IAAI,EAAE,CAAC,0CAA0C,EAAE,YAAY;AAC/D,QAAQ,MAAM,CAAC,KAAK,CAACA,WAAM,CAAC,IAAI,CAAC,EAAE,oEAAoE,CAAC;AACxG,QAAQ,MAAM,CAAC,KAAK,CAACC,mBAAS,CAAC,IAAI,CAAC,EAAE,4CAA4C,CAAC;AACnF,QAAQ,MAAM,CAAC,KAAK,CAACC,gBAAS,CAAC,IAAI,CAAC,EAAE,oEAAoE,CAAC;AAC3G,QAAQ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commonjs/_tests/test-keystore.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=test-keystore.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/test-keystore.d.ts.map b/lib.commonjs/_tests/test-keystore.d.ts.map deleted file mode 100644 index f298fe780..000000000 --- a/lib.commonjs/_tests/test-keystore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-keystore.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.commonjs/_tests/test-keystore.js b/lib.commonjs/_tests/test-keystore.js deleted file mode 100644 index 005b82f35..000000000 --- a/lib.commonjs/_tests/test-keystore.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; - -var assert = require('node:assert/strict'); -require('buffer'); -var index = require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../crypto/signature.js'); -require('../abi/abi-coder.js'); -require('../abi/fragments.js'); -require('../constants/numbers.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -require('../contract/contract.js'); -require('../providers/provider.js'); -require('../providers/format.js'); -require('ws'); -require('../providers/provider-fallback.js'); -require('net'); -require('utf8'); -var jsonKeystore = require('../wallet/json-keystore.js'); -require('../wallet/json-crowdsale.js'); -var wallet = require('../wallet/wallet.js'); -require('../bigNumber/bigNumber.js'); -require('../wordlists/wordlists.js'); - -describe("AES keystores", () => { - const wallet$1 = wallet.Wallet.fromSeed({ - seed: "01".repeat(64), - prefix: index.networkIdToPrefix(3), - }); - const account = { address: wallet$1.address, privateKey: wallet$1.privateKey }; - const options = { scrypt: { N: 16, r: 1, p: 1 } }; - it("round-trips Ed448 keys with sync and async encryption", async () => { - for (const json of [ - jsonKeystore.encryptKeystoreJsonSync(account, "test", options), - await jsonKeystore.encryptKeystoreJson(account, "test", options), - ]) { - assert.deepEqual(jsonKeystore.decryptKeystoreJsonSync(json, "test"), account); - assert.deepEqual(await jsonKeystore.decryptKeystoreJson(json, "test"), account); - assert.throws(() => jsonKeystore.decryptKeystoreJsonSync(json, "wrong"), /incorrect password/); - const changed = JSON.parse(json); - changed.Crypto.mac = "00".repeat(32); - await assert.rejects(jsonKeystore.decryptKeystoreJson(JSON.stringify(changed), "test"), /incorrect password/); - } - }); - it("rejects unsafe KDF parameters before allocating work", () => { - for (const scrypt of [ - { N: 0 }, - { N: 1 }, - { N: 2 ** 32 }, - { r: 0 }, - { p: 2 ** 30 }, - { N: 1048576, r: 8 }, - ]) - assert.throws(() => jsonKeystore.encryptKeystoreJsonSync(account, "test", { scrypt }), /unsafe/); - const data = JSON.parse(jsonKeystore.encryptKeystoreJsonSync(account, "test", options)); - data.Crypto.kdfparams.n = 2 ** 32; - assert.throws(() => jsonKeystore.decryptKeystoreJsonSync(JSON.stringify(data), "test"), /unsafe/); - data.Crypto.kdf = "pbkdf2"; - Object.assign(data.Crypto.kdfparams, { c: 10000001, prf: "hmac-sha256" }); - assert.throws(() => jsonKeystore.decryptKeystoreJsonSync(JSON.stringify(data), "test"), /unsafe/); - }); -}); -//# sourceMappingURL=test-keystore.js.map diff --git a/lib.commonjs/_tests/test-keystore.js.map b/lib.commonjs/_tests/test-keystore.js.map deleted file mode 100644 index 1d0bcbffb..000000000 --- a/lib.commonjs/_tests/test-keystore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-keystore.js","sources":["../../lib.esm/_tests/test-keystore.js"],"sourcesContent":["import assert from \"node:assert/strict\";\nimport { Wallet, networkIdToPrefix, encryptKeystoreJsonSync, encryptKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, } from \"../index.js\";\ndescribe(\"AES keystores\", () => {\n const wallet = Wallet.fromSeed({\n seed: \"01\".repeat(64),\n prefix: networkIdToPrefix(3),\n });\n const account = { address: wallet.address, privateKey: wallet.privateKey };\n const options = { scrypt: { N: 16, r: 1, p: 1 } };\n it(\"round-trips Ed448 keys with sync and async encryption\", async () => {\n for (const json of [\n encryptKeystoreJsonSync(account, \"test\", options),\n await encryptKeystoreJson(account, \"test\", options),\n ]) {\n assert.deepEqual(decryptKeystoreJsonSync(json, \"test\"), account);\n assert.deepEqual(await decryptKeystoreJson(json, \"test\"), account);\n assert.throws(() => decryptKeystoreJsonSync(json, \"wrong\"), /incorrect password/);\n const changed = JSON.parse(json);\n changed.Crypto.mac = \"00\".repeat(32);\n await assert.rejects(decryptKeystoreJson(JSON.stringify(changed), \"test\"), /incorrect password/);\n }\n });\n it(\"rejects unsafe KDF parameters before allocating work\", () => {\n for (const scrypt of [\n { N: 0 },\n { N: 1 },\n { N: 2 ** 32 },\n { r: 0 },\n { p: 2 ** 30 },\n { N: 1048576, r: 8 },\n ])\n assert.throws(() => encryptKeystoreJsonSync(account, \"test\", { scrypt }), /unsafe/);\n const data = JSON.parse(encryptKeystoreJsonSync(account, \"test\", options));\n data.Crypto.kdfparams.n = 2 ** 32;\n assert.throws(() => decryptKeystoreJsonSync(JSON.stringify(data), \"test\"), /unsafe/);\n data.Crypto.kdf = \"pbkdf2\";\n Object.assign(data.Crypto.kdfparams, { c: 10000001, prf: \"hmac-sha256\" });\n assert.throws(() => decryptKeystoreJsonSync(JSON.stringify(data), \"test\"), /unsafe/);\n });\n});\n//# sourceMappingURL=test-keystore.js.map"],"names":["wallet","Wallet","networkIdToPrefix","encryptKeystoreJsonSync","encryptKeystoreJson","decryptKeystoreJsonSync","decryptKeystoreJson"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,MAAM,CAAC,EAAE,QAAQ,CAAC;AAC5F,IAAI,CAAC,CAAC;AACN,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/_tests/types.d.ts b/lib.commonjs/_tests/types.d.ts deleted file mode 100644 index 153d8067f..000000000 --- a/lib.commonjs/_tests/types.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -export type TestCaseAbiVerbose = { - type: "address" | "hexstring" | "number" | "string"; - value: string; -} | { - type: "boolean"; - value: boolean; -} | { - type: "array"; - value: Array; -} | { - type: "object"; - value: Array; -}; -export interface TestCaseAbi { - name: string; - type: string; - value: any; - verbose: TestCaseAbiVerbose; - bytecode: string; - encoded: string; -} -export interface TestCaseAccount { - name: string; - privateKey: string; - address: string; - icap: string; -} -export type TestCaseCreate = { - sender: string; - creates: Array<{ - name: string; - nonce: number; - address: string; - }>; -}; -export type TestCaseCreate2 = { - sender: string; - creates: Array<{ - name: string; - salt: string; - initCode: string; - initCodeHash: string; - address: string; - }>; -}; -export interface TestCaseHash { - name: string; - data: string; - sha256: string; - sha512: string; - ripemd160: string; -} -export interface TestCasePbkdf { - name: string; - password: string; - salt: string; - dkLen: number; - pbkdf2: { - iterations: number; - algorithm: "sha256" | "sha512"; - key: string; - }; - scrypt: { - N: number; - r: number; - p: number; - key: string; - }; -} -export interface TestCaseHmac { - name: string; - data: string; - key: string; - algorithm: "sha256" | "sha512"; - hmac: string; -} -export interface TestCaseHash { - name: string; - data: string; - sha256: string; - sha512: string; - ripemd160: string; -} -export interface TestCaseTypedDataDomain { - name?: string; - version?: string; - networkId?: number; - verifyingContract?: string; - salt?: string; -} -export interface TestCaseTypedDataType { - name: string; - type: string; -} -export interface TestCaseTypedData { - name: string; - domain: TestCaseTypedDataDomain; - primaryType: string; - types: Record>; - data: any; - encoded: string; - digest: string; - privateKey?: string; - signature?: string; -} -export interface TestCaseSolidityHash { - name: string; - types: Array; - ripemd160: string; - sha256: string; - values: Array; -} -export type NestedHexString = string | Array; -export interface TestCaseRlp { - name: string; - encoded: string; - decoded: NestedHexString; -} -export interface TestCaseTransactionTx { - to?: string; - nonce?: number; - energyLimit?: string; - energyPrice?: string; - maxFeePerEnergy?: string; - data?: string; - value?: string; - accessList?: Array<{ - address: string; - storageKeys: Array; - }>; - networkId?: string; -} -export interface TestCaseTransactionSig { - r: string; - s: string; - v: string; -} -export interface TestCaseTransaction { - name: string; - transaction: TestCaseTransactionTx; - privateKey: string; - unsignedLegacy: string; - signedLegacy: string; - unsignedEip155: string; - signedEip155: string; - unsignedBerlin: string; - signedBerlin: string; - unsignedLondon: string; - signedLondon: string; - signatureLegacy: TestCaseTransactionSig; - signatureEip155: TestCaseTransactionSig; - signatureBerlin: TestCaseTransactionSig; - signatureLondon: TestCaseTransactionSig; -} -export interface TestCaseMnemonicNode { - path: string; - chainCode: string; - depth: number; - index: number; - parentFingerprint: string; - fingerprint: string; - publicKey: string; - privateKey: string; - xpriv: string; - xpub: string; -} -export interface TestCaseMnemonic { - name: string; - phrase: string; - phraseHash: string; - password: string; - locale: string; - entropy: string; - seed: string; - nodes: Array; -} -export interface TestCaseWallet { - name: string; - filename: string; - type: string; - address: string; - password: string; - content: string; -} -export interface TestCaseWordlist { - name: string; - filename: string; - locale: string; - content: string; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_tests/types.d.ts.map b/lib.commonjs/_tests/types.d.ts.map deleted file mode 100644 index db09709f7..000000000 --- a/lib.commonjs/_tests/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC3B;IACA,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpD,KAAK,EAAE,MAAM,CAAC;CACb,GACD;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CACd,GACD;IACA,IAAI,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jB,OAAO,EAAE,MAAM,CAAC;CAChB;AAKD,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB"} \ No newline at end of file diff --git a/lib.commonjs/_tests/types.js b/lib.commonjs/_tests/types.js deleted file mode 100644 index ed5ab0fb8..000000000 --- a/lib.commonjs/_tests/types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=types.js.map diff --git a/lib.commonjs/_tests/types.js.map b/lib.commonjs/_tests/types.js.map deleted file mode 100644 index 705032fd5..000000000 --- a/lib.commonjs/_tests/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/_version.d.ts b/lib.commonjs/_version.d.ts deleted file mode 100644 index 515a07b59..000000000 --- a/lib.commonjs/_version.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/** The current version of corebc; keep in sync with package.json. */ -export declare const version: string; -//# sourceMappingURL=_version.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/_version.d.ts.map b/lib.commonjs/_version.d.ts.map deleted file mode 100644 index 99992181e..000000000 --- a/lib.commonjs/_version.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/_version.js b/lib.commonjs/_version.js deleted file mode 100644 index 907326743..000000000 --- a/lib.commonjs/_version.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -/** The current version of corebc; keep in sync with package.json. */ -const version = "0.4.1"; - -exports.version = version; -//# sourceMappingURL=_version.js.map diff --git a/lib.commonjs/_version.js.map b/lib.commonjs/_version.js.map deleted file mode 100644 index d21e86ccc..000000000 --- a/lib.commonjs/_version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_version.js","sources":["../lib.esm/_version.js"],"sourcesContent":["/** The current version of corebc; keep in sync with package.json. */\nexport const version = \"0.4.1\";\n//# sourceMappingURL=_version.js.map"],"names":[],"mappings":";;AAAA;AACY,MAAC,OAAO,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes.d.ts b/lib.commonjs/abi-types/Tes.d.ts deleted file mode 100644 index ab20b2246..000000000 --- a/lib.commonjs/abi-types/Tes.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "../corebc.js"; -import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "./common.js"; -export interface TesInterface extends Interface { - getFunction(nameOrSignature: "approve" | "balanceOf" | "batchOwnerOf" | "getApproved" | "isApprovedForAll" | "mint" | "ownerOf" | "safeTransferFrom(address,address,uint256)" | "safeTransferFrom(address,address,uint256,bytes)" | "setApprovalForAll" | "tokenByIndex" | "tokenOfOwnerByIndex" | "totalSupply" | "transferFrom"): FunctionFragment; - getEvent(nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer"): EventFragment; - encodeFunctionData(functionFragment: "approve", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "balanceOf", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "batchOwnerOf", values: [BigNumberish[]]): string; - encodeFunctionData(functionFragment: "getApproved", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "isApprovedForAll", values: [AddressLike, AddressLike]): string; - encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "ownerOf", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256)", values: [AddressLike, AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", values: [AddressLike, AddressLike, BigNumberish, BytesLike]): string; - encodeFunctionData(functionFragment: "setApprovalForAll", values: [AddressLike, boolean]): string; - encodeFunctionData(functionFragment: "tokenByIndex", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "tokenOfOwnerByIndex", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "totalSupply", values?: undefined): string; - encodeFunctionData(functionFragment: "transferFrom", values: [AddressLike, AddressLike, BigNumberish]): string; - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "batchOwnerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getApproved", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "isApprovedForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "setApprovalForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenOfOwnerByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "totalSupply", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "transferFrom", data: BytesLike): Result; -} -export declare namespace ApprovalEvent { - type InputTuple = [ - owner: AddressLike, - approved: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [owner: string, approved: string, tokenId: bigint]; - interface OutputObject { - owner: string; - approved: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace ApprovalForAllEvent { - type InputTuple = [ - owner: AddressLike, - operator: AddressLike, - approved: boolean - ]; - type OutputTuple = [ - owner: string, - operator: string, - approved: boolean - ]; - interface OutputObject { - owner: string; - operator: string; - approved: boolean; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace TransferEvent { - type InputTuple = [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [from: string, to: string, tokenId: bigint]; - interface OutputObject { - from: string; - to: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export interface Tes extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; - attach(addressOrName: AddressLike): this; - deployed(): Promise; - interface: TesInterface; - queryFilter(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - queryFilter(filter: TypedDeferredTopicFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - on(event: TCEvent, listener: TypedListener): Promise; - on(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - once(event: TCEvent, listener: TypedListener): Promise; - once(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - listeners(event: TCEvent): Promise>>; - listeners(eventName?: string): Promise>; - removeAllListeners(event?: TCEvent): Promise; - approve: TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - isApprovedForAll: TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - "safeTransferFrom(address,address,uint256)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - setApprovalForAll: TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; - tokenOfOwnerByIndex: TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - totalSupply: TypedContractMethod<[], [bigint], "view">; - transferFrom: TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(key: string | FunctionFragment): T; - getFunction(nameOrSignature: "approve"): TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "balanceOf"): TypedContractMethod<[owner: AddressLike], [bigint], "view">; - getFunction(nameOrSignature: "batchOwnerOf"): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getFunction(nameOrSignature: "getApproved"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "isApprovedForAll"): TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - getFunction(nameOrSignature: "mint"): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - getFunction(nameOrSignature: "ownerOf"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "setApprovalForAll"): TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "tokenByIndex"): TypedContractMethod<[index: BigNumberish], [bigint], "view">; - getFunction(nameOrSignature: "tokenOfOwnerByIndex"): TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - getFunction(nameOrSignature: "totalSupply"): TypedContractMethod<[], [bigint], "view">; - getFunction(nameOrSignature: "transferFrom"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getEvent(key: "Approval"): TypedContractEvent; - getEvent(key: "ApprovalForAll"): TypedContractEvent; - getEvent(key: "Transfer"): TypedContractEvent; - filters: { - "Approval(address,address,uint256)": TypedContractEvent; - Approval: TypedContractEvent; - "ApprovalForAll(address,address,bool)": TypedContractEvent; - ApprovalForAll: TypedContractEvent; - "Transfer(address,address,uint256)": TypedContractEvent; - Transfer: TypedContractEvent; - }; -} -//# sourceMappingURL=Tes.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes.d.ts.map b/lib.commonjs/abi-types/Tes.d.ts.map deleted file mode 100644 index 0c7f7bc42..000000000 --- a/lib.commonjs/abi-types/Tes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB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zB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACzD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QACF,cAAc,EAAE,kBAAkB,CACjC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes.js b/lib.commonjs/abi-types/Tes.js deleted file mode 100644 index d772fc638..000000000 --- a/lib.commonjs/abi-types/Tes.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=Tes.js.map diff --git a/lib.commonjs/abi-types/Tes.js.map b/lib.commonjs/abi-types/Tes.js.map deleted file mode 100644 index 6a77541be..000000000 --- a/lib.commonjs/abi-types/Tes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes_abi.d.ts b/lib.commonjs/abi-types/Tes_abi.d.ts deleted file mode 100644 index 3df4e144e..000000000 --- a/lib.commonjs/abi-types/Tes_abi.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "../corebc.js"; -import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "./common.js"; -export interface Tes_abiInterface extends Interface { - getFunction(nameOrSignature: "approve" | "balanceOf" | "batchOwnerOf" | "getApproved" | "isApprovedForAll" | "mint" | "ownerOf" | "safeTransferFrom(address,address,uint256)" | "safeTransferFrom(address,address,uint256,bytes)" | "setApprovalForAll" | "tokenByIndex" | "tokenOfOwnerByIndex" | "totalSupply" | "transferFrom"): FunctionFragment; - getEvent(nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer"): EventFragment; - encodeFunctionData(functionFragment: "approve", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "balanceOf", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "batchOwnerOf", values: [BigNumberish[]]): string; - encodeFunctionData(functionFragment: "getApproved", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "isApprovedForAll", values: [AddressLike, AddressLike]): string; - encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "ownerOf", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256)", values: [AddressLike, AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", values: [AddressLike, AddressLike, BigNumberish, BytesLike]): string; - encodeFunctionData(functionFragment: "setApprovalForAll", values: [AddressLike, boolean]): string; - encodeFunctionData(functionFragment: "tokenByIndex", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "tokenOfOwnerByIndex", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "totalSupply", values?: undefined): string; - encodeFunctionData(functionFragment: "transferFrom", values: [AddressLike, AddressLike, BigNumberish]): string; - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "batchOwnerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getApproved", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "isApprovedForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "setApprovalForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenOfOwnerByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "totalSupply", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "transferFrom", data: BytesLike): Result; -} -export declare namespace ApprovalEvent { - type InputTuple = [ - owner: AddressLike, - approved: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [owner: string, approved: string, tokenId: bigint]; - interface OutputObject { - owner: string; - approved: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace ApprovalForAllEvent { - type InputTuple = [ - owner: AddressLike, - operator: AddressLike, - approved: boolean - ]; - type OutputTuple = [ - owner: string, - operator: string, - approved: boolean - ]; - interface OutputObject { - owner: string; - operator: string; - approved: boolean; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace TransferEvent { - type InputTuple = [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [from: string, to: string, tokenId: bigint]; - interface OutputObject { - from: string; - to: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export interface Tes_abi extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; - attach(addressOrName: AddressLike): this; - deployed(): Promise; - interface: Tes_abiInterface; - queryFilter(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - queryFilter(filter: TypedDeferredTopicFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - on(event: TCEvent, listener: TypedListener): Promise; - on(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - once(event: TCEvent, listener: TypedListener): Promise; - once(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - listeners(event: TCEvent): Promise>>; - listeners(eventName?: string): Promise>; - removeAllListeners(event?: TCEvent): Promise; - approve: TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - isApprovedForAll: TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - "safeTransferFrom(address,address,uint256)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - setApprovalForAll: TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; - tokenOfOwnerByIndex: TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - totalSupply: TypedContractMethod<[], [bigint], "view">; - transferFrom: TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(key: string | FunctionFragment): T; - getFunction(nameOrSignature: "approve"): TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "balanceOf"): TypedContractMethod<[owner: AddressLike], [bigint], "view">; - getFunction(nameOrSignature: "batchOwnerOf"): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getFunction(nameOrSignature: "getApproved"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "isApprovedForAll"): TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - getFunction(nameOrSignature: "mint"): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - getFunction(nameOrSignature: "ownerOf"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "setApprovalForAll"): TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "tokenByIndex"): TypedContractMethod<[index: BigNumberish], [bigint], "view">; - getFunction(nameOrSignature: "tokenOfOwnerByIndex"): TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - getFunction(nameOrSignature: "totalSupply"): TypedContractMethod<[], [bigint], "view">; - getFunction(nameOrSignature: "transferFrom"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getEvent(key: "Approval"): TypedContractEvent; - getEvent(key: "ApprovalForAll"): TypedContractEvent; - getEvent(key: "Transfer"): TypedContractEvent; - filters: { - "Approval(address,address,uint256)": TypedContractEvent; - Approval: TypedContractEvent; - "ApprovalForAll(address,address,bool)": TypedContractEvent; - ApprovalForAll: TypedContractEvent; - "Transfer(address,address,uint256)": TypedContractEvent; - Transfer: TypedContractEvent; - }; -} -//# sourceMappingURL=Tes_abi.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes_abi.d.ts.map b/lib.commonjs/abi-types/Tes_abi.d.ts.map deleted file mode 100644 index 152cbb189..000000000 --- a/lib.commonjs/abi-types/Tes_abi.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IAClD,WAAW,CACV,eAAe,EACZ,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,2CAA2C,GAC3C,iDAAiD,GACjD,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,cAAc,GACf,gBAAgB,CAAC;IAEpB,QAAQ,CACP,sBAAsB,EAAE,UAAU,GAAG,gBAAgB,GAAG,UAAU,GAChE,aAAa,CAAC;IAEjB,kBAAkB,CACjB,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,GACjC,MAAM,CAAC;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,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/Tes_abi.js b/lib.commonjs/abi-types/Tes_abi.js deleted file mode 100644 index e632cd515..000000000 --- a/lib.commonjs/abi-types/Tes_abi.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=Tes_abi.js.map diff --git a/lib.commonjs/abi-types/Tes_abi.js.map b/lib.commonjs/abi-types/Tes_abi.js.map deleted file mode 100644 index 21e338269..000000000 --- a/lib.commonjs/abi-types/Tes_abi.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/common.d.ts b/lib.commonjs/abi-types/common.d.ts deleted file mode 100644 index d6e86d0d7..000000000 --- a/lib.commonjs/abi-types/common.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { FunctionFragment, Typed, EventFragment, ContractTransaction, ContractTransactionResponse, DeferredTopicFilter, EventLog, TransactionRequest, LogDescription } from "../corebc.js"; -export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent> extends DeferredTopicFilter { -} -export interface TypedContractEvent = any, OutputTuple extends Array = any, OutputObject = any> { - (...args: Partial): TypedDeferredTopicFilter>; - name: string; - fragment: EventFragment; - getFragment(...args: Partial): EventFragment; -} -type __TypechainAOutputTuple = T extends TypedContractEvent ? W : never; -type __TypechainOutputObject = T extends TypedContractEvent ? V : never; -export interface TypedEventLog extends Omit { - args: __TypechainAOutputTuple & __TypechainOutputObject; -} -export interface TypedLogDescription extends Omit { - args: __TypechainAOutputTuple & __TypechainOutputObject; -} -export type TypedListener = (...listenerArg: [ - ...__TypechainAOutputTuple, - TypedEventLog, - ...undefined[] -]) => void; -export type MinCoreBCFactory = { - deploy(...a: ARGS[]): Promise; -}; -export type GetContractTypeFromFactory = F extends MinCoreBCFactory ? C : never; -export type GetARGsTypeFromFactory = F extends MinCoreBCFactory ? Parameters : never; -export type StateMutability = "nonpayable" | "payable" | "view"; -export type BaseOverrides = Omit; -export type NonPayableOverrides = Omit; -export type PayableOverrides = Omit; -export type ViewOverrides = Omit; -export type Overrides = S extends "nonpayable" ? NonPayableOverrides : S extends "payable" ? PayableOverrides : ViewOverrides; -export type PostfixOverrides, S extends StateMutability> = A | [...A, Overrides]; -export type ContractMethodArgs, S extends StateMutability> = PostfixOverrides<{ - [I in keyof A]-?: A[I] | Typed; -}, S>; -export type DefaultReturnType = R extends Array ? R[0] : R; -export interface TypedContractMethod = Array, R = any, S extends StateMutability = "payable"> { - (...args: ContractMethodArgs): S extends "view" ? Promise> : Promise; - name: string; - fragment: FunctionFragment; - getFragment(...args: ContractMethodArgs): FunctionFragment; - populateTransaction(...args: ContractMethodArgs): Promise; - staticCall(...args: ContractMethodArgs): Promise>; - send(...args: ContractMethodArgs): Promise; - estimateGas(...args: ContractMethodArgs): Promise; - staticCallResult(...args: ContractMethodArgs): Promise; -} -export {}; -//# sourceMappingURL=common.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi-types/common.d.ts.map b/lib.commonjs/abi-types/common.d.ts.map deleted file mode 100644 index b7d6fe89d..000000000 --- a/lib.commonjs/abi-types/common.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/common.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,cAAc,EACd,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,wBAAwB,CACxC,Q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C,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC9E,WAAW,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,gBAAgB,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChE"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/common.js b/lib.commonjs/abi-types/common.js deleted file mode 100644 index 0b4dbc6ce..000000000 --- a/lib.commonjs/abi-types/common.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=common.js.map diff --git a/lib.commonjs/abi-types/common.js.map b/lib.commonjs/abi-types/common.js.map deleted file mode 100644 index 8d07aa7a3..000000000 --- a/lib.commonjs/abi-types/common.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes__factory.d.ts b/lib.commonjs/abi-types/factories/Tes__factory.d.ts deleted file mode 100644 index 9fb691f6d..000000000 --- a/lib.commonjs/abi-types/factories/Tes__factory.d.ts +++ /dev/null @@ -1,280 +0,0 @@ -import { ContractRunner } from "../../corebc.js"; -import type { Tes, TesInterface } from "../Tes.js"; -export declare class Tes__factory { - static readonly abi: readonly [{ - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "approved"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Approval"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly indexed: false; - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "ApprovalForAll"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Transfer"; - readonly type: "event"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "approve"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }]; - readonly name: "balanceOf"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256[]"; - readonly name: "ids"; - readonly type: "uint256[]"; - }]; - readonly name: "batchOwnerOf"; - readonly outputs: readonly [{ - readonly internalType: "address[]"; - readonly name: ""; - readonly type: "address[]"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "getApproved"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }]; - readonly name: "isApprovedForAll"; - readonly outputs: readonly [{ - readonly internalType: "bool"; - readonly name: ""; - readonly type: "bool"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }]; - readonly name: "mint"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "ownerOf"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }, { - readonly internalType: "bytes"; - readonly name: "data"; - readonly type: "bytes"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "setApprovalForAll"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenOfOwnerByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly []; - readonly name: "totalSupply"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "transferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }]; - static createInterface(): TesInterface; - static connect(address: string, runner?: ContractRunner | null): Tes; -} -//# sourceMappingURL=Tes__factory.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes__factory.d.ts.map b/lib.commonjs/abi-types/factories/Tes__factory.d.ts.map deleted file mode 100644 index 262b59a93..000000000 --- a/lib.commonjs/abi-types/factories/Tes__factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuWnD,qBAAa,YAAY;IACxB,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,I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AAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,cAAc;;kCAEH,YAAY;uBACvB,UAAU;OAKU;IAC3B,MAAM,CAAC,eAAe,IAAI,YAAY,CAErC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,GAAG,CAEnE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes__factory.js b/lib.commonjs/abi-types/factories/Tes__factory.js deleted file mode 100644 index 5a723f0aa..000000000 --- a/lib.commonjs/abi-types/factories/Tes__factory.js +++ /dev/null @@ -1,413 +0,0 @@ -'use strict'; - -require('../../address/index.js'); -require('../../crypto/hmac.js'); -require('../../crypto/ripemd160.js'); -require('../../crypto/pbkdf2.js'); -require('../../crypto/random.js'); -require('../../crypto/scrypt.js'); -require('../../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../../crypto/keccak.js'); -require('../../utils/base58.js'); -require('../../logger/logger.js'); -require('../../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../../utils/fixednumber.js'); -require('../../utils/maths.js'); -require('../../crypto/signature.js'); -require('../../abi/abi-coder.js'); -require('../../abi/fragments.js'); -var _interface = require('../../abi/interface.js'); -require('../../constants/numbers.js'); -var contract = require('../../contract/contract.js'); -require('../../providers/provider.js'); -require('../../transaction/transaction.js'); -require('../../hash/typed-data.js'); -require('../../providers/format.js'); -require('ws'); -require('../../providers/provider-fallback.js'); -require('net'); -require('utf8'); -require('../../wallet/json-keystore.js'); -require('../../wallet/json-crowdsale.js'); -require('../../bigNumber/bigNumber.js'); -require('../../wordlists/wordlists.js'); - -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "approved", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Transfer", - type: "event", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "approve", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - ], - name: "batchOwnerOf", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "getApproved", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "isApprovedForAll", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "mint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ownerOf", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenOfOwnerByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "transferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; -class Tes__factory { - static abi = _abi; - static createInterface() { - return new _interface.Interface(_abi); - } - static connect(address, runner) { - return new contract.Contract(address, _abi, runner); - } -} - -exports.Tes__factory = Tes__factory; -//# sourceMappingURL=Tes__factory.js.map diff --git a/lib.commonjs/abi-types/factories/Tes__factory.js.map b/lib.commonjs/abi-types/factories/Tes__factory.js.map deleted file mode 100644 index b862fb40d..000000000 --- a/lib.commonjs/abi-types/factories/Tes__factory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes__factory.js","sources":["../../../lib.esm/abi-types/factories/Tes__factory.js"],"sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, Interface } from \"../../corebc.js\";\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 inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\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: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"batchOwnerOf\",\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: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\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: \"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 {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\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: \"\",\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: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenByIndex\",\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: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenOfOwnerByIndex\",\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: \"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: \"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];\nexport class Tes__factory {\n static abi = _abi;\n static createInterface() {\n return new Interface(_abi);\n }\n static connect(address, runner) {\n return new Contract(address, _abi, runner);\n }\n}\n//# sourceMappingURL=Tes__factory.js.map"],"names":["Interface","Contract"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA,MAAM,IAAI,GAAG;AACb,IAAI;AACJ,QAAQ,SAAS,EAAE,KAAK;AACxB,QAAQ,MAAM,EAAE;AAChB,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,OAAO;AAC7B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,UAAU;AAChC,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,SAAS;AAC/B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,SAAS;AACT,QAAQ,IAAI,EAAE,UAAU;AACxB,QAAQ,IAAI,EAAE,OAAO;AACrB,KAAK;AACL,IAAI;AACJ,QAAQ,SAAS,EAAE,KAAK;AACxB,QAAQ,MAAM,EAAE;AAChB,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,OAAO;AAC7B,gBAAgB,IAAI,EAAE,SAAS;AAC/B,aAAa;AACb,YAAY;AACZ,gBAAgB,OAAO,EAAE,IAAI;AAC7B,gBAAgB,YAAY,EAAE,SAAS;AACvC,gBAAgB,IAAI,EAAE,UAAU;AA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AQ,eAAe,EAAE,YAAY;AACrC,QAAQ,IAAI,EAAE,UAAU;AACxB,KAAK;AACL,CAAC;AACM,MAAM,YAAY,CAAC;AAC1B,IAAI,OAAO,GAAG,GAAG,IAAI;AACrB,IAAI,OAAO,eAAe,GAAG;AAC7B,QAAQ,OAAO,IAAIA,oBAAS,CAAC,IAAI,CAAC;AAClC,IAAI;AACJ,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE;AACpC,QAAQ,OAAO,IAAIC,iBAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC;AAClD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts b/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts deleted file mode 100644 index bd8c9ccc6..000000000 --- a/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts +++ /dev/null @@ -1,280 +0,0 @@ -import { ContractRunner } from "../../corebc.js"; -import type { Tes_abi, Tes_abiInterface } from "../Tes_abi.js"; -export declare class Tes_abi__factory { - static readonly abi: readonly [{ - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "approved"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Approval"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly indexed: false; - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "ApprovalForAll"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Transfer"; - readonly type: "event"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "approve"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }]; - readonly name: "balanceOf"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256[]"; - readonly name: "ids"; - readonly type: "uint256[]"; - }]; - readonly name: "batchOwnerOf"; - readonly outputs: readonly [{ - readonly internalType: "address[]"; - readonly name: ""; - readonly type: "address[]"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "getApproved"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }]; - readonly name: "isApprovedForAll"; - readonly outputs: readonly [{ - readonly internalType: "bool"; - readonly name: ""; - readonly type: "bool"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }]; - readonly name: "mint"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "ownerOf"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }, { - readonly internalType: "bytes"; - readonly name: "data"; - readonly type: "bytes"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "setApprovalForAll"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenOfOwnerByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly []; - readonly name: "totalSupply"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "transferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }]; - static createInterface(): Tes_abiInterface; - static connect(address: string, runner?: ContractRunner | null): Tes_abi; -} -//# sourceMappingURL=Tes_abi__factory.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts.map b/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts.map deleted file mode 100644 index 530a4f795..000000000 --- a/lib.commonjs/abi-types/factories/Tes_abi__factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuW/D,qBAAa,gBAAgB;IAC5B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE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,MAAM,CAAC,eAAe,IAAI,gBAAgB,CAEzC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAEvE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/Tes_abi__factory.js b/lib.commonjs/abi-types/factories/Tes_abi__factory.js deleted file mode 100644 index fb1a9a85d..000000000 --- a/lib.commonjs/abi-types/factories/Tes_abi__factory.js +++ /dev/null @@ -1,413 +0,0 @@ -'use strict'; - -require('../../address/index.js'); -require('../../crypto/hmac.js'); -require('../../crypto/ripemd160.js'); -require('../../crypto/pbkdf2.js'); -require('../../crypto/random.js'); -require('../../crypto/scrypt.js'); -require('../../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../../crypto/keccak.js'); -require('../../utils/base58.js'); -require('../../logger/logger.js'); -require('../../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../../utils/fixednumber.js'); -require('../../utils/maths.js'); -require('../../crypto/signature.js'); -require('../../abi/abi-coder.js'); -require('../../abi/fragments.js'); -var _interface = require('../../abi/interface.js'); -require('../../constants/numbers.js'); -var contract = require('../../contract/contract.js'); -require('../../providers/provider.js'); -require('../../transaction/transaction.js'); -require('../../hash/typed-data.js'); -require('../../providers/format.js'); -require('ws'); -require('../../providers/provider-fallback.js'); -require('net'); -require('utf8'); -require('../../wallet/json-keystore.js'); -require('../../wallet/json-crowdsale.js'); -require('../../bigNumber/bigNumber.js'); -require('../../wordlists/wordlists.js'); - -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "approved", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Transfer", - type: "event", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "approve", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - ], - name: "batchOwnerOf", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "getApproved", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "isApprovedForAll", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "mint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ownerOf", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenOfOwnerByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "transferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; -class Tes_abi__factory { - static abi = _abi; - static createInterface() { - return new _interface.Interface(_abi); - } - static connect(address, runner) { - return new contract.Contract(address, _abi, runner); - } -} - -exports.Tes_abi__factory = Tes_abi__factory; -//# sourceMappingURL=Tes_abi__factory.js.map diff --git a/lib.commonjs/abi-types/factories/Tes_abi__factory.js.map b/lib.commonjs/abi-types/factories/Tes_abi__factory.js.map deleted file mode 100644 index 221f43ffd..000000000 --- a/lib.commonjs/abi-types/factories/Tes_abi__factory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi__factory.js","sources":["../../../lib.esm/abi-types/factories/Tes_abi__factory.js"],"sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nimport { Contract, Interface } from \"../../corebc.js\";\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 inputs: [\n {\n internalType: \"address\",\n name: \"owner\",\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: \"ids\",\n type: \"uint256[]\",\n },\n ],\n name: \"batchOwnerOf\",\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: \"uint256\",\n name: \"tokenId\",\n type: \"uint256\",\n },\n ],\n name: \"getApproved\",\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: \"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 {\n internalType: \"address\",\n name: \"to\",\n type: \"address\",\n },\n ],\n name: \"mint\",\n outputs: [],\n stateMutability: \"nonpayable\",\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: \"\",\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: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenByIndex\",\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: \"owner\",\n type: \"address\",\n },\n {\n internalType: \"uint256\",\n name: \"index\",\n type: \"uint256\",\n },\n ],\n name: \"tokenOfOwnerByIndex\",\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: \"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: \"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];\nexport class Tes_abi__factory {\n static abi = _abi;\n static createInterface() {\n return new Interface(_abi);\n }\n static connect(address, runner) {\n return new Contract(address, _abi, runner);\n }\n}\n//# sourceMappingURL=Tes_abi__factory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O,eAAe,GAAG;AAC7B,QAAQ,OAAO,IAAIA,oBAAS,CAAC,IAAI,CAAC;AAClC,IAAI;AACJ,IAAI,OAAO,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE;AACpC,QAAQ,OAAO,IAAIC,iBAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC;AAClD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/index.d.ts b/lib.commonjs/abi-types/factories/index.d.ts deleted file mode 100644 index e6b4dbcc0..000000000 --- a/lib.commonjs/abi-types/factories/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { Tes__factory } from "./Tes__factory.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/index.d.ts.map b/lib.commonjs/abi-types/factories/index.d.ts.map deleted file mode 100644 index 2727001fd..000000000 --- a/lib.commonjs/abi-types/factories/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/factories/index.js b/lib.commonjs/abi-types/factories/index.js deleted file mode 100644 index 15790ca2d..000000000 --- a/lib.commonjs/abi-types/factories/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var Tes__factory = require('./Tes__factory.js'); - -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -exports.Tes__factory = Tes__factory.Tes__factory; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/abi-types/factories/index.js.map b/lib.commonjs/abi-types/factories/index.js.map deleted file mode 100644 index c7dc844a2..000000000 --- a/lib.commonjs/abi-types/factories/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../../lib.esm/abi-types/factories/index.js"],"sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\nexport { Tes__factory } from \"./Tes__factory.js\";\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;AAAA;AACA;AACA;;"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/index.d.ts b/lib.commonjs/abi-types/index.d.ts deleted file mode 100644 index ca4fb7b40..000000000 --- a/lib.commonjs/abi-types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type { Tes } from "./Tes.js"; -export * as factories from "./factories/index.js"; -export { Tes__factory } from "./factories/Tes__factory.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi-types/index.d.ts.map b/lib.commonjs/abi-types/index.d.ts.map deleted file mode 100644 index 90d11b2fc..000000000 --- a/lib.commonjs/abi-types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/abi-types/index.js b/lib.commonjs/abi-types/index.js deleted file mode 100644 index 49e690ca7..000000000 --- a/lib.commonjs/abi-types/index.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var index = require('./factories/index.js'); -var Tes__factory = require('./factories/Tes__factory.js'); - - - -exports.factories = index; -exports.Tes__factory = Tes__factory.Tes__factory; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/abi-types/index.js.map b/lib.commonjs/abi-types/index.js.map deleted file mode 100644 index 129665d24..000000000 --- a/lib.commonjs/abi-types/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/abi-coder.d.ts b/lib.commonjs/abi/abi-coder.d.ts deleted file mode 100644 index 1350031d4..000000000 --- a/lib.commonjs/abi/abi-coder.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -import { Result } from "./coders/abstract-coder.js"; -import { ParamType } from "./fragments.js"; -import type { BytesLike, CallExceptionAction, CallExceptionError } from "../utils/index.js"; -/** - * About AbiCoder - */ -export declare class AbiCoder { - #private; - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types: ReadonlyArray): Result; - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types: ReadonlyArray, values: ReadonlyArray): string; - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types: ReadonlyArray, data: BytesLike, loose?: boolean): Result; - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder(): AbiCoder; - /** - * Returns an corebc-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action: CallExceptionAction, tx: { - to?: null | string; - from?: null | string; - data?: string; - }, data: null | BytesLike): CallExceptionError; -} -//# sourceMappingURL=abi-coder.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/abi-coder.d.ts.map b/lib.commonjs/abi/abi-coder.d.ts.map deleted file mode 100644 index ad04d5ac9..000000000 --- a/lib.commonjs/abi/abi-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACX,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAElB,MAAM,mBAAmB,CAAC;AA8F3B;;GAEG;AACH,qBAAa,QAAQ;;IA2DpB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAMhE;IAED;;;;OAIG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;IAED;;;;;;OAMG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,OAAO,GACb,MAAM,CAMR;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ,CAKjC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/D,IAAI,EAAE,IAAI,GAAG,SAAS,GACpB,kBAAkB,CAOpB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/abi-coder.js b/lib.commonjs/abi/abi-coder.js deleted file mode 100644 index 3981c8d77..000000000 --- a/lib.commonjs/abi/abi-coder.js +++ /dev/null @@ -1,216 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var abstractCoder = require('./coders/abstract-coder.js'); -var address = require('./coders/address.js'); -var array = require('./coders/array.js'); -var boolean = require('./coders/boolean.js'); -var bytes = require('./coders/bytes.js'); -var fixedBytes = require('./coders/fixed-bytes.js'); -var _null = require('./coders/null.js'); -var number = require('./coders/number.js'); -var string = require('./coders/string.js'); -var tuple = require('./coders/tuple.js'); -var fragments = require('./fragments.js'); -var index = require('../address/index.js'); - -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -// https://docs.soliditylang.org/en/v0.8.17/control-structures.html -const PanicReasons = new Map(); -PanicReasons.set(0x00, "GENERIC_PANIC"); -PanicReasons.set(0x01, "ASSERT_FALSE"); -PanicReasons.set(0x11, "OVERFLOW"); -PanicReasons.set(0x12, "DIVIDE_BY_ZERO"); -PanicReasons.set(0x21, "ENUM_RANGE_ERROR"); -PanicReasons.set(0x22, "BAD_STORAGE_DATA"); -PanicReasons.set(0x31, "STACK_UNDERFLOW"); -PanicReasons.set(0x32, "ARRAY_RANGE_ERROR"); -PanicReasons.set(0x41, "OUT_OF_MEMORY"); -PanicReasons.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); -const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); -const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); -let defaultCoder = null; -function getBuiltinCallException(action, tx, data$1, abiCoder) { - let message = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data$1) { - message = "execution reverted"; - const bytes = data.getBytes(data$1); - data$1 = data.hexlify(data$1); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } - else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } - else if (data.hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason], - }; - message += `: ${JSON.stringify(reason)}`; - } - catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } - else if (data.hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code], - }; - reason = `Panic due to ${PanicReasons.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } - catch (error) { - message += " (could not decode panic code)"; - } - } - else { - message += " (unknown custom error)"; - } - } - const transaction = { - to: tx.to ? index.getAddress(tx.to) : null, - data: tx.data || "0x", - }; - if (tx.from) { - transaction.from = index.getAddress(tx.from); - } - return errors.makeError(message, "CALL_EXCEPTION", { - action, - data: data$1, - reason, - transaction, - invocation, - revert, - }); -} -/** - * About AbiCoder - */ -class AbiCoder { - #getCoder(param) { - if (param.isArray()) { - return new array.ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new tuple.TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - switch (param.baseType) { - case "address": - return new address.AddressCoder(param.name); - case "bool": - return new boolean.BooleanCoder(param.name); - case "string": - return new string.StringCoder(param.name); - case "bytes": - return new bytes.BytesCoder(param.name); - case "": - return new _null.NullCoder(param.name); - } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - errors.assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param); - return new number.NumberCoder(size / 8, match[1] === "int", param.name); - } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - errors.assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new fixedBytes.FixedBytesCoder(size, param.name); - } - errors.assertArgument(false, "invalid type", "type", param.type); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(fragments.ParamType.from(type))); - const coder = new tuple.TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types, values) { - errors.assertArgumentCount(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(fragments.ParamType.from(type))); - const coder = new tuple.TupleCoder(coders, "_"); - const writer = new abstractCoder.Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(fragments.ParamType.from(type))); - const coder = new tuple.TupleCoder(coders, "_"); - return coder.decode(new abstractCoder.Reader(data, loose)); - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an corebc-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } -} - -exports.AbiCoder = AbiCoder; -//# sourceMappingURL=abi-coder.js.map diff --git a/lib.commonjs/abi/abi-coder.js.map b/lib.commonjs/abi/abi-coder.js.map deleted file mode 100644 index 76817af83..000000000 --- a/lib.commonjs/abi/abi-coder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abi-coder.js","sources":["../../lib.esm/abi/abi-coder.js"],"sourcesContent":["/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason],\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code],\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: tx.to ? getAddress(tx.to) : null,\n data: tx.data || \"0x\",\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action,\n data,\n reason,\n transaction,\n invocation,\n revert,\n });\n}\n/**\n * About AbiCoder\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, match[1] === \"int\", param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose));\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an corebc-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map"],"names":["data","getBytes","hexlify","getAddress","makeError","ArrayCoder","TupleCoder","AddressCoder","BooleanCoder","StringCoder","BytesCoder","NullCoder","assertArgument","NumberCoder","FixedBytesCoder","ParamType","assertArgumentCount","Writer","Reader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAeA;AACA,MAAM,YAAY,GAAG,IAAI,GAAG,EAAE;AAC9B,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC;AACvC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC;AACtC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC;AAClC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,gBAAgB,CAAC;AACxC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,kBAAkB,CAAC;AAC1C,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,kBAAkB,CAAC;AAC1C,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,iBAAiB,CAAC;AACzC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,mBAAmB,CAAC;AAC3C,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC;AACvC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,6BAA6B,CAAC;AACrD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC;AACpD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC;AACvD,IAAI,YAAY,GAAG,IAAI;AACvB,SAAS,uBAAuB,CAAC,MAAM,EAAE,EAAE,EAAEA,MAAI,EAA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OAAO,uBAAuB,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,eAAe,EAAE,CAAC;AACpF,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/bytes32.d.ts b/lib.commonjs/abi/bytes32.d.ts deleted file mode 100644 index 73455cb5d..000000000 --- a/lib.commonjs/abi/bytes32.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -import type { BytesLike } from "../utils/index.js"; -/** - * Encodes %%text%% as a Bytes32 string. - */ -export declare function encodeBytes32String(text: string): string; -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -export declare function decodeBytes32String(_bytes: BytesLike): string; -//# sourceMappingURL=bytes32.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/bytes32.d.ts.map b/lib.commonjs/abi/bytes32.d.ts.map deleted file mode 100644 index 09513605d..000000000 --- a/lib.commonjs/abi/bytes32.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes32.d.ts","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWxD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAmB7D"} \ No newline at end of file diff --git a/lib.commonjs/abi/bytes32.js b/lib.commonjs/abi/bytes32.js deleted file mode 100644 index 2ad1e38e3..000000000 --- a/lib.commonjs/abi/bytes32.js +++ /dev/null @@ -1,55 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -var data = require('../utils/data.js'); -require('../utils/errors.js'); -require('../logger/logger.js'); -var utf8 = require('../utils/utf8.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -/** - * Encodes %%text%% as a Bytes32 string. - */ -function encodeBytes32String(text) { - // Get the bytes - const bytes = utf8.toUtf8Bytes(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } - // Zero-pad (implicitly null-terminates) - return data.zeroPadBytes(bytes, 32); -} -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -function decodeBytes32String(_bytes) { - const data$1 = data.getBytes(_bytes, "bytes"); - // Must be 32 bytes with a null-termination - if (data$1.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data$1[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - // Find the null termination - let length = 31; - while (data$1[length - 1] === 0) { - length--; - } - // Determine the string value - return utf8.toUtf8String(data$1.slice(0, length)); -} - -exports.decodeBytes32String = decodeBytes32String; -exports.encodeBytes32String = encodeBytes32String; -//# sourceMappingURL=bytes32.js.map diff --git a/lib.commonjs/abi/bytes32.js.map b/lib.commonjs/abi/bytes32.js.map deleted file mode 100644 index 4fa754cd0..000000000 --- a/lib.commonjs/abi/bytes32.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes32.js","sources":["../../lib.esm/abi/bytes32.js"],"sourcesContent":["/**\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"],"names":["toUtf8Bytes","zeroPadBytes","data","getBytes","toUtf8String"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,IAAI,EAAE;AAC1C;AACA,IAAI,MAAM,KAAK,GAAGA,gBAAW,CAAC,IAAI,CAAC;AACnC;AACA,IAAI,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE;AAC3B,QAAQ,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC;AACpE,IAAI;AACJ;AACA,IAAI,OAAOC,iBAAY,CAAC,KAAK,EAAE,EAAE,CAAC;AAClC;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,MAAM,EAAE;AAC5C,IAAI,MAAMC,MAAI,GAAGC,aAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;AAC1C;AACA,IAAI,IAAID,MAAI,CAAC,MAAM,KAAK,EAAE,EAAE;AAC5B,QAAQ,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC;AAC9D,IAAI;AACJ,IAAI,IAAIA,MAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE;AACxB,QAAQ,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC;AACtE,IAAI;AACJ;AACA,IAAI,IAAI,MAAM,GAAG,EAAE;AACnB,IAAI,OAAOA,MAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE;AACnC,QAAQ,MAAM,EAAE;AAChB,IAAI;AACJ;AACA,IAAI,OAAOE,iBAAY,CAACF,MAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC9C;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/abstract-coder.d.ts b/lib.commonjs/abi/coders/abstract-coder.d.ts deleted file mode 100644 index 53d1481b3..000000000 --- a/lib.commonjs/abi/coders/abstract-coder.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -import type { BigNumberish, BytesLike } from "../../utils/index.js"; -/** - * @_ignore: - */ -export declare const WordSize: number; -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -export declare class Result extends Array { - #private; - [K: string | number]: any; - /** - * @private - */ - constructor(...args: Array); - /** - * Returns the Result as a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(): Array; - /** - * Returns the Result as an Object with each name-value pair. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(): Record; - /** - * @_ignore - */ - slice(start?: number | undefined, end?: number | undefined): Result; - /** - * @_ignore - */ - filter(callback: (el: any, index: number, array: Result) => boolean, thisArg?: any): Result; - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name: string): any; - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items: Array, keys?: Array): Result; -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -export declare function checkResultErrors(result: Result): Array<{ - path: Array; - error: Error; -}>; -/** - * @_ignore - */ -export declare abstract class Coder { - readonly name: string; - readonly type: string; - readonly localName: string; - readonly dynamic: boolean; - constructor(name: string, type: string, localName: string, dynamic: boolean); - _throwError(message: string, value: any): never; - abstract encode(writer: Writer, value: any): number; - abstract decode(reader: Reader): any; - abstract defaultValue(): any; -} -/** - * @_ignore - */ -export declare class Writer { - #private; - constructor(); - get data(): string; - get length(): number; - appendWriter(writer: Writer): number; - writeBytes(value: BytesLike): number; - writeValue(value: BigNumberish): number; - writeUpdatableValue(): (value: BigNumberish) => void; -} -/** - * @_ignore - */ -export declare class Reader { - #private; - readonly allowLoose: boolean; - constructor(data: BytesLike, allowLoose?: boolean); - get data(): string; - get dataLength(): number; - get consumed(): number; - get bytes(): Uint8Array; - subReader(offset: number): Reader; - readBytes(length: number, loose?: boolean): Uint8Array; - readValue(): bigint; - readIndex(): number; -} -//# sourceMappingURL=abstract-coder.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/abstract-coder.d.ts.map b/lib.commonjs/abi/coders/abstract-coder.d.ts.map deleted file mode 100644 index df211a063..000000000 --- a/lib.commonjs/abi/coders/abstract-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AAiBnC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAGrC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE1B;;OAEG;IACH,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAgG9B;IAED;;;;;OAKG;IACH,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CASpB;IAED;;;;;OAKG;IACH,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAqB9B;IAED;;OA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AAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC;IAErC,QAAQ,CAAC,YAAY,IAAI,GAAG,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,MAAM;;IAKlB,cAGC;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAQD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnC;IAGD,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAOnC;IAGD,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAEtC;IAID,mBAAmB,IAAI,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAOnD;CACD;AAED;;GAEG;AACH,qBAAa,MAAM;;IAKlB,QAAQ,CAAC,UAAU,EAAG,OAAO,CAAC;IAK9B,YAAY,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAMhD;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,UAAU,IAAI,MAAM,CAEvB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,KAAK,IAAI,UAAU,CAEtB;IAuBD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhC;IAGD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,CAKrD;IAGD,SAAS,IAAI,MAAM,CAElB;IAED,SAAS,IAAI,MAAM,CAElB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/abstract-coder.js b/lib.commonjs/abi/coders/abstract-coder.js deleted file mode 100644 index 55b25fbf3..000000000 --- a/lib.commonjs/abi/coders/abstract-coder.js +++ /dev/null @@ -1,426 +0,0 @@ -'use strict'; - -require('../../utils/base58.js'); -var data = require('../../utils/data.js'); -var errors = require('../../utils/errors.js'); -var properties = require('../../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../../utils/fixednumber.js'); -var maths = require('../../utils/maths.js'); - -/** - * @_ignore: - */ -const WordSize = 32; -const Padding = new Uint8Array(WordSize); -// Properties used to immediate pass through to the underlying object -// - `then` is used to detect if an object is a Promise for await -const passProperties = ["then"]; -const _guard = {}; -function throwError(name, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); - wrapped.error = error; - throw wrapped; -} -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -class Result extends Array { - #names; - /** - * @private - */ - constructor(...args) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap = true; - if (guard !== _guard) { - items = args; - names = []; - wrap = false; - } - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { - this[index] = item; - }); - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof name === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, new Map()); - // Remove any key thats not unique - this.#names = Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - })); - if (!wrap) { - return; - } - // A wrapped Result is immutable - Object.freeze(this); - // Proxy indices and names so we can trap deferred errors - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof prop === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = maths.getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (...args) { - return value.apply(this === receiver ? target : this, args); - }; - } - else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply(this === receiver ? target : this, [ - prop, - ]); - } - } - return Reflect.get(target, prop, receiver); - }, - }); - } - /** - * Returns the Result as a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray() { - const result = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject() { - return this.#names.reduce((accum, name, index) => { - errors.assert(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", { - operation: "toObject()", - }); - // Add values for names that don't conflict - if (!(name in accum)) { - accum[name] = this.getValue(name); - } - return accum; - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const result = [], names = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(this.#names[i]); - } - return new Result(_guard, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const result = [], names = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(this.#names[i]); - } - } - return new Result(_guard, result, names); - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name) { - const index = this.#names.indexOf(name); - if (index === -1) { - return undefined; - } - const value = this[index]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys) { - return new Result(_guard, items, keys); - } -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -function checkResultErrors(result) { - // Find the first error (if any) - const errors = []; - const checkErrors = function (path, object) { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - try { - checkErrors(childPath, object[key]); - } - catch (error) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - return errors; -} -function getValue(value) { - let bytes = maths.toBeArray(value); - errors.assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: WordSize, - offset: bytes.length, - }); - if (bytes.length !== WordSize) { - bytes = data.getBytesCopy(data.concat([Padding.slice(bytes.length % WordSize), bytes])); - } - return bytes; -} -/** - * @_ignore - */ -class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - name; - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - type; - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - localName; - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - dynamic; - constructor(name, type, localName, dynamic) { - properties.defineProperties(this, { name, type, localName, dynamic }, { - name: "string", - type: "string", - localName: "string", - dynamic: "boolean", - }); - } - _throwError(message, value) { - errors.assertArgument(false, message, this.localName, value); - } -} -/** - * @_ignore - */ -class Writer { - // An array of WordSize lengthed objects to concatenation - #data; - #dataLength; - constructor() { - this.#data = []; - this.#dataLength = 0; - } - get data() { - return data.concat(this.#data); - } - get length() { - return this.#dataLength; - } - #writeData(data) { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - appendWriter(writer) { - return this.#writeData(data.getBytesCopy(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes = data.getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = data.getBytesCopy(data.concat([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return this.#writeData(getValue(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value) => { - this.#data[offset] = getValue(value); - }; - } -} -/** - * @_ignore - */ -class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - allowLoose; - #data; - #offset; - constructor(data$1, allowLoose) { - properties.defineProperties(this, { allowLoose: !!allowLoose }); - this.#data = data.getBytesCopy(data$1); - this.#offset = 0; - } - get data() { - return data.hexlify(this.#data); - } - get dataLength() { - return this.#data.length; - } - get consumed() { - return this.#offset; - } - get bytes() { - return new Uint8Array(this.#data); - } - #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && - loose && - this.#offset + length <= this.#data.length) { - alignedLength = length; - } - else { - errors.assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: data.getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength, - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset) { - return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose); - } - // Read bytes - readBytes(length, loose) { - let bytes = this.#peekBytes(0, length, !!loose); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - // Read a numeric values - readValue() { - return maths.toBigInt(this.readBytes(WordSize)); - } - readIndex() { - return maths.toNumber(this.readBytes(WordSize)); - } -} - -exports.Coder = Coder; -exports.Reader = Reader; -exports.Result = Result; -exports.WordSize = WordSize; -exports.Writer = Writer; -exports.checkResultErrors = checkResultErrors; -//# sourceMappingURL=abstract-coder.js.map diff --git a/lib.commonjs/abi/coders/abstract-coder.js.map b/lib.commonjs/abi/coders/abstract-coder.js.map deleted file mode 100644 index ae3831da8..000000000 --- a/lib.commonjs/abi/coders/abstract-coder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-coder.js","sources":["../../../lib.esm/abi/coders/abstract-coder.js"],"sourcesContent":["import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument, } from \"../../utils/index.js\";\n/**\n * @_ignore:\n */\nexport const WordSize = 32;\nconst Padding = new Uint8Array(WordSize);\n// Properties used to immediate pass through to the underlying object\n// - `then` is used to detect if an object is a Promise for await\nconst passProperties = [\"then\"];\nconst _guard = {};\nfunction throwError(name, error) {\n const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`);\n wrapped.error = error;\n throw wrapped;\n}\n/**\n * A [[Result]] is a sub-class of Array, which allows accessing any\n * of its values either positionally by its index or, if keys are\n * provided by its name.\n *\n * @_docloc: api/abi\n */\nexport class Result extends Array {\n #names;\n /**\n * @private\n */\n constructor(...args) {\n // To properly sub-class Array so the other built-in\n // functions work, the constructor has to behave fairly\n // well. So, in the event we are created via fromItems()\n // we build the read-only Result object we want, but on\n // any other input, we use the default constructor\n // constructor(guard: any, items: Array, keys?: Array);\n const guard = args[0];\n let items = args[1];\n let names = (args[2] || []).slice();\n let wrap = true;\n if (guard !== _guard) {\n items = args;\n names = [];\n wrap = false;\n }\n // Can't just pass in ...items since an array of length 1\n // is a special case in the super.\n super(items.length);\n items.forEach((item, index) => {\n this[index] = item;\n });\n // Find all unique keys\n const nameCounts = names.reduce((accum, name) => {\n if (typeof name === \"string\") {\n accum.set(name, (accum.get(name) || 0) + 1);\n }\n return accum;\n }, new Map());\n // Remove any key thats not unique\n this.#names = Object.freeze(items.map((item, index) => {\n const name = names[index];\n if (name != null && nameCounts.get(name) === 1) {\n return name;\n }\n return null;\n }));\n if (!wrap) {\n return;\n }\n // A wrapped Result is immutable\n Object.freeze(this);\n // Proxy indices and names so we can trap deferred errors\n return new Proxy(this, {\n get: (target, prop, receiver) => {\n if (typeof prop === \"string\") {\n // Index accessor\n if (prop.match(/^[0-9]+$/)) {\n const index = getNumber(prop, \"%index\");\n if (index < 0 || index >= this.length) {\n throw new RangeError(\"out of result range\");\n }\n const item = target[index];\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n return item;\n }\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.get(target, prop, receiver);\n }\n const value = target[prop];\n if (value instanceof Function) {\n // Make sure functions work with private variables\n // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding\n return function (...args) {\n return value.apply(this === receiver ? target : this, args);\n };\n }\n else if (!(prop in target)) {\n // Possible name accessor\n return target.getValue.apply(this === receiver ? target : this, [\n prop,\n ]);\n }\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n }\n /**\n * Returns the Result as a normal Array.\n *\n * This will throw if there are any outstanding deferred\n * errors.\n */\n toArray() {\n const result = [];\n this.forEach((item, index) => {\n if (item instanceof Error) {\n throwError(`index ${index}`, item);\n }\n result.push(item);\n });\n return result;\n }\n /**\n * Returns the Result as an Object with each name-value pair.\n *\n * This will throw if any value is unnamed, or if there are\n * any outstanding deferred errors.\n */\n toObject() {\n return this.#names.reduce((accum, name, index) => {\n assert(name != null, \"value at index ${ index } unnamed\", \"UNSUPPORTED_OPERATION\", {\n operation: \"toObject()\",\n });\n // Add values for names that don't conflict\n if (!(name in accum)) {\n accum[name] = this.getValue(name);\n }\n return accum;\n }, {});\n }\n /**\n * @_ignore\n */\n slice(start, end) {\n if (start == null) {\n start = 0;\n }\n if (start < 0) {\n start += this.length;\n if (start < 0) {\n start = 0;\n }\n }\n if (end == null) {\n end = this.length;\n }\n if (end < 0) {\n end += this.length;\n if (end < 0) {\n end = 0;\n }\n }\n if (end > this.length) {\n end = this.length;\n }\n const result = [], names = [];\n for (let i = start; i < end; i++) {\n result.push(this[i]);\n names.push(this.#names[i]);\n }\n return new Result(_guard, result, names);\n }\n /**\n * @_ignore\n */\n filter(callback, thisArg) {\n const result = [], names = [];\n for (let i = 0; i < this.length; i++) {\n const item = this[i];\n if (item instanceof Error) {\n throwError(`index ${i}`, item);\n }\n if (callback.call(thisArg, item, i, this)) {\n result.push(item);\n names.push(this.#names[i]);\n }\n }\n return new Result(_guard, result, names);\n }\n /**\n * Returns the value for %%name%%.\n *\n * Since it is possible to have a key whose name conflicts with\n * a method on a [[Result]] or its superclass Array, or any\n * JavaScript keyword, this ensures all named values are still\n * accessible by name.\n */\n getValue(name) {\n const index = this.#names.indexOf(name);\n if (index === -1) {\n return undefined;\n }\n const value = this[index];\n if (value instanceof Error) {\n throwError(`property ${JSON.stringify(name)}`, value.error);\n }\n return value;\n }\n /**\n * Creates a new [[Result]] for %%items%% with each entry\n * also accessible by its corresponding name in %%keys%%.\n */\n static fromItems(items, keys) {\n return new Result(_guard, items, keys);\n }\n}\n/**\n * Returns all errors found in a [[Result]].\n *\n * Since certain errors encountered when creating a [[Result]] do\n * not impact the ability to continue parsing data, they are\n * deferred until they are actually accessed. Hence a faulty string\n * in an Event that is never used does not impact the program flow.\n *\n * However, sometimes it may be useful to access, identify or\n * validate correctness of a [[Result]].\n *\n * @_docloc api/abi\n */\nexport function checkResultErrors(result) {\n // Find the first error (if any)\n const errors = [];\n const checkErrors = function (path, object) {\n if (!Array.isArray(object)) {\n return;\n }\n for (let key in object) {\n const childPath = path.slice();\n childPath.push(key);\n try {\n checkErrors(childPath, object[key]);\n }\n catch (error) {\n errors.push({ path: childPath, error: error });\n }\n }\n };\n checkErrors([], result);\n return errors;\n}\nfunction getValue(value) {\n let bytes = toBeArray(value);\n assert(bytes.length <= WordSize, \"value out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: WordSize,\n offset: bytes.length,\n });\n if (bytes.length !== WordSize) {\n bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes]));\n }\n return bytes;\n}\n/**\n * @_ignore\n */\nexport class Coder {\n // The coder name:\n // - address, uint256, tuple, array, etc.\n name;\n // The fully expanded type, including composite types:\n // - address, uint256, tuple(address,bytes), uint256[3][4][], etc.\n type;\n // The localName bound in the signature, in this example it is \"baz\":\n // - tuple(address foo, uint bar) baz\n localName;\n // Whether this type is dynamic:\n // - Dynamic: bytes, string, address[], tuple(boolean[]), etc.\n // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8)\n dynamic;\n constructor(name, type, localName, dynamic) {\n defineProperties(this, { name, type, localName, dynamic }, {\n name: \"string\",\n type: \"string\",\n localName: \"string\",\n dynamic: \"boolean\",\n });\n }\n _throwError(message, value) {\n assertArgument(false, message, this.localName, value);\n }\n}\n/**\n * @_ignore\n */\nexport class Writer {\n // An array of WordSize lengthed objects to concatenation\n #data;\n #dataLength;\n constructor() {\n this.#data = [];\n this.#dataLength = 0;\n }\n get data() {\n return concat(this.#data);\n }\n get length() {\n return this.#dataLength;\n }\n #writeData(data) {\n this.#data.push(data);\n this.#dataLength += data.length;\n return data.length;\n }\n appendWriter(writer) {\n return this.#writeData(getBytesCopy(writer.data));\n }\n // Arrayish item; pad on the right to *nearest* WordSize\n writeBytes(value) {\n let bytes = getBytesCopy(value);\n const paddingOffset = bytes.length % WordSize;\n if (paddingOffset) {\n bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)]));\n }\n return this.#writeData(bytes);\n }\n // Numeric item; pad on the left *to* WordSize\n writeValue(value) {\n return this.#writeData(getValue(value));\n }\n // Inserts a numeric place-holder, returning a callback that can\n // be used to asjust the value later\n writeUpdatableValue() {\n const offset = this.#data.length;\n this.#data.push(Padding);\n this.#dataLength += WordSize;\n return (value) => {\n this.#data[offset] = getValue(value);\n };\n }\n}\n/**\n * @_ignore\n */\nexport class Reader {\n // Allows incomplete unpadded data to be read; otherwise an error\n // is raised if attempting to overrun the buffer. This is required\n // to deal with an old Solidity bug, in which event data for\n // external (not public thoguh) was tightly packed.\n allowLoose;\n #data;\n #offset;\n constructor(data, allowLoose) {\n defineProperties(this, { allowLoose: !!allowLoose });\n this.#data = getBytesCopy(data);\n this.#offset = 0;\n }\n get data() {\n return hexlify(this.#data);\n }\n get dataLength() {\n return this.#data.length;\n }\n get consumed() {\n return this.#offset;\n }\n get bytes() {\n return new Uint8Array(this.#data);\n }\n #peekBytes(offset, length, loose) {\n let alignedLength = Math.ceil(length / WordSize) * WordSize;\n if (this.#offset + alignedLength > this.#data.length) {\n if (this.allowLoose &&\n loose &&\n this.#offset + length <= this.#data.length) {\n alignedLength = length;\n }\n else {\n assert(false, \"data out-of-bounds\", \"BUFFER_OVERRUN\", {\n buffer: getBytesCopy(this.#data),\n length: this.#data.length,\n offset: this.#offset + alignedLength,\n });\n }\n }\n return this.#data.slice(this.#offset, this.#offset + alignedLength);\n }\n // Create a sub-reader with the same underlying data, but offset\n subReader(offset) {\n return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose);\n }\n // Read bytes\n readBytes(length, loose) {\n let bytes = this.#peekBytes(0, length, !!loose);\n this.#offset += bytes.length;\n // @TODO: Make sure the length..end bytes are all 0?\n return bytes.slice(0, length);\n }\n // Read a numeric values\n readValue() {\n return toBigInt(this.readBytes(WordSize));\n }\n readIndex() {\n return toNumber(this.readBytes(WordSize));\n }\n}\n//# sourceMappingURL=abstract-coder.js.map"],"names":["getNumber","assert","toBeArray","getBytesCopy","concat","defineProperties","assertArgument","data","hexlify","toBigInt","toNumber"],"mappings":";;;;;;;;;;;;AACA;AACA;AACA;AACY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,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC;AACnF,IAAI;AACJ;AACA,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE;AAC7B,QAAQ,IAAI,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC;AACvD,QAAQ,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM;AACpC;AACA,QAAQ,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC;AACrC,IAAI;AACJ;AACA,IAAI,SAAS,GAAG;AAChB,QAAQ,OAAOM,cAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjD,IAAI;AACJ,IAAI,SAAS,GAAG;AAChB,QAAQ,OAAOC,cAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AACjD,IAAI;AACJ;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/address.d.ts b/lib.commonjs/abi/coders/address.d.ts deleted file mode 100644 index 8befac03a..000000000 --- a/lib.commonjs/abi/coders/address.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class AddressCoder extends Coder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/address.d.ts.map b/lib.commonjs/abi/coders/address.d.ts.map deleted file mode 100644 index 030f77d6d..000000000 --- a/lib.commonjs/abi/coders/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAQrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/address.js b/lib.commonjs/abi/coders/address.js deleted file mode 100644 index be8030cf6..000000000 --- a/lib.commonjs/abi/coders/address.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -var index = require('../../address/index.js'); -var maths = require('../../utils/maths.js'); -var typed = require('../typed.js'); -var abstractCoder = require('./abstract-coder.js'); - -/** - * @_ignore - */ -class AddressCoder extends abstractCoder.Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value) { - let value = typed.Typed.dereference(_value, "string"); - try { - value = index.getAddress(value); - } - catch (error) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - decode(reader) { - return index.getAddress(maths.toBeHex(reader.readValue(), 22)); - } -} - -exports.AddressCoder = AddressCoder; -//# sourceMappingURL=address.js.map diff --git a/lib.commonjs/abi/coders/address.js.map b/lib.commonjs/abi/coders/address.js.map deleted file mode 100644 index a279c2693..000000000 --- a/lib.commonjs/abi/coders/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sources":["../../../lib.esm/abi/coders/address.js"],"sourcesContent":["import { getAddress } from \"../../address/index.js\";\nimport { toBeHex } from \"../../utils/maths.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class AddressCoder extends Coder {\n constructor(localName) {\n super(\"address\", \"address\", localName, false);\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000\";\n }\n encode(writer, _value) {\n let value = Typed.dereference(_value, \"string\");\n try {\n value = getAddress(value);\n }\n catch (error) {\n return this._throwError(error.message, _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n return getAddress(toBeHex(reader.readValue(), 22));\n }\n}\n//# sourceMappingURL=address.js.map"],"names":["Coder","Typed","getAddress","toBeHex"],"mappings":";;;;;;;AAIA;AACA;AACA;AACO,MAAM,YAAY,SAASA,mBAAK,CAAC;AACxC,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC;AACrD,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,4CAA4C;AAC3D,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,IAAI,KAAK,GAAGC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC;AACvD,QAAQ,IAAI;AACZ,YAAY,KAAK,GAAGC,gBAAU,CAAC,KAAK,CAAC;AACrC,QAAQ;AACR,QAAQ,OAAO,KAAK,EAAE;AACtB,YAAY,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC;AAC1D,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACvC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOA,gBAAU,CAACC,aAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;AAC1D,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/anonymous.d.ts b/lib.commonjs/abi/coders/anonymous.d.ts deleted file mode 100644 index 554bf03f0..000000000 --- a/lib.commonjs/abi/coders/anonymous.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -export declare class AnonymousCoder extends Coder { - private coder; - constructor(coder: Coder); - defaultValue(): any; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=anonymous.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/anonymous.d.ts.map b/lib.commonjs/abi/coders/anonymous.d.ts.map deleted file mode 100644 index d0f9d87cb..000000000 --- a/lib.commonjs/abi/coders/anonymous.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACxC,OAAO,CAAC,KAAK,CAAQ;IAErB,YAAY,KAAK,EAAE,KAAK,EAGvB;IAED,YAAY,IAAI,GAAG,CAElB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAEzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/anonymous.js b/lib.commonjs/abi/coders/anonymous.js deleted file mode 100644 index 3b1a417c7..000000000 --- a/lib.commonjs/abi/coders/anonymous.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -var abstractCoder = require('./abstract-coder.js'); - -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -class AnonymousCoder extends abstractCoder.Coder { - coder; - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } -} - -exports.AnonymousCoder = AnonymousCoder; -//# sourceMappingURL=anonymous.js.map diff --git a/lib.commonjs/abi/coders/anonymous.js.map b/lib.commonjs/abi/coders/anonymous.js.map deleted file mode 100644 index 5a368b1d8..000000000 --- a/lib.commonjs/abi/coders/anonymous.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anonymous.js","sources":["../../../lib.esm/abi/coders/anonymous.js"],"sourcesContent":["import { Coder } from \"./abstract-coder.js\";\n/**\n * Clones the functionality of an existing Coder, but without a localName\n *\n * @_ignore\n */\nexport class AnonymousCoder extends Coder {\n coder;\n constructor(coder) {\n super(coder.name, coder.type, \"_\", coder.dynamic);\n this.coder = coder;\n }\n defaultValue() {\n return this.coder.defaultValue();\n }\n encode(writer, value) {\n return this.coder.encode(writer, value);\n }\n decode(reader) {\n return this.coder.decode(reader);\n }\n}\n//# sourceMappingURL=anonymous.js.map"],"names":["Coder"],"mappings":";;;;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,cAAc,SAASA,mBAAK,CAAC;AAC1C,IAAI,KAAK;AACT,IAAI,WAAW,CAAC,KAAK,EAAE;AACvB,QAAQ,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;AACzD,QAAQ,IAAI,CAAC,KAAK,GAAG,KAAK;AAC1B,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;AACxC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE;AAC1B,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;AAC/C,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;AACxC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/array.d.ts b/lib.commonjs/abi/coders/array.d.ts deleted file mode 100644 index 954c4e17e..000000000 --- a/lib.commonjs/abi/coders/array.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder, Result, Writer } from "./abstract-coder.js"; -import type { Reader } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare function pack(writer: Writer, coders: ReadonlyArray, values: Array | { - [name: string]: any; -}): number; -/** - * @_ignore - */ -export declare function unpack(reader: Reader, coders: ReadonlyArray): Result; -/** - * @_ignore - */ -export declare class ArrayCoder extends Coder { - readonly coder: Coder; - readonly length: number; - constructor(coder: Coder, length: number, localName: string); - defaultValue(): Array; - encode(writer: Writer, _value: Array | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=array.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/array.d.ts.map b/lib.commonjs/abi/coders/array.d.ts.map deleted file mode 100644 index 8cdb33a3b..000000000 --- a/lib.commonjs/abi/coders/array.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAC5B,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC1C,MAAM,CAuER;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAmD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB,YAAY,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAK1D;IAED,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC,CASzB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM,CA0BzD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CA2B1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/array.js b/lib.commonjs/abi/coders/array.js deleted file mode 100644 index b076e360f..000000000 --- a/lib.commonjs/abi/coders/array.js +++ /dev/null @@ -1,180 +0,0 @@ -'use strict'; - -require('../../utils/base58.js'); -require('../../logger/logger.js'); -var errors = require('../../utils/errors.js'); -var properties = require('../../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../../utils/fixednumber.js'); -require('../../utils/maths.js'); -var typed = require('../typed.js'); -var abstractCoder = require('./abstract-coder.js'); -var anonymous = require('./anonymous.js'); - -/** - * @_ignore - */ -function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } - else if (values && typeof values === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name = coder.localName; - errors.assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - errors.assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name] = true; - return values[name]; - }); - } - else { - errors.assertArgument(false, "invalid tuple value", "tuple", values); - } - errors.assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new abstractCoder.Writer(); - let dynamicWriter = new abstractCoder.Writer(); - let updateFuncs = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } - else { - coder.encode(staticWriter, value); - } - }); - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { - func(staticWriter.length); - }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; -} -/** - * @_ignore - */ -function unpack(reader, coders) { - let values = []; - let keys = []; - // A reader anchored to this base - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } - catch (error) { - // Cannot recover from this - if (errors.isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - else { - try { - value = coder.decode(reader); - } - catch (error) { - // Cannot recover from this - if (errors.isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == undefined) { - throw new Error("investigate"); - } - values.push(value); - keys.push(coder.localName || null); - }); - return abstractCoder.Result.fromItems(values, keys); -} -/** - * @_ignore - */ -class ArrayCoder extends abstractCoder.Coder { - coder; - length; - constructor(coder, length, localName) { - const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; - const dynamic = length === -1 || coder.dynamic; - super("array", type, localName, dynamic); - properties.defineProperties(this, { coder, length }); - } - defaultValue() { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value) { - const value = typed.Typed.dereference(_value, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - errors.assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - errors.assert(count * abstractCoder.WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { - buffer: reader.bytes, - offset: count * abstractCoder.WordSize, - length: reader.dataLength, - }); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new anonymous.AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } -} - -exports.ArrayCoder = ArrayCoder; -exports.pack = pack; -exports.unpack = unpack; -//# sourceMappingURL=array.js.map diff --git a/lib.commonjs/abi/coders/array.js.map b/lib.commonjs/abi/coders/array.js.map deleted file mode 100644 index 1dd3b5069..000000000 --- a/lib.commonjs/abi/coders/array.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.js","sources":["../../../lib.esm/abi/coders/array.js"],"sourcesContent":["import { defineProperties, isError, assert, assertArgument, assertArgumentCount, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, Result, WordSize, Writer } from \"./abstract-coder.js\";\nimport { AnonymousCoder } from \"./anonymous.js\";\n/**\n * @_ignore\n */\nexport function pack(writer, coders, values) {\n let arrayValues = [];\n if (Array.isArray(values)) {\n arrayValues = values;\n }\n else if (values && typeof values === \"object\") {\n let unique = {};\n arrayValues = coders.map((coder) => {\n const name = coder.localName;\n assert(name, \"cannot encode object for signature with missing names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n assert(!unique[name], \"cannot encode object for signature with duplicate names\", \"INVALID_ARGUMENT\", { argument: \"values\", info: { coder }, value: values });\n unique[name] = true;\n return values[name];\n });\n }\n else {\n assertArgument(false, \"invalid tuple value\", \"tuple\", values);\n }\n assertArgument(coders.length === arrayValues.length, \"types/value length mismatch\", \"tuple\", values);\n let staticWriter = new Writer();\n let dynamicWriter = new Writer();\n let updateFuncs = [];\n coders.forEach((coder, index) => {\n let value = arrayValues[index];\n if (coder.dynamic) {\n // Get current dynamic offset (for the future pointer)\n let dynamicOffset = dynamicWriter.length;\n // Encode the dynamic value into the dynamicWriter\n coder.encode(dynamicWriter, value);\n // Prepare to populate the correct offset once we are done\n let updateFunc = staticWriter.writeUpdatableValue();\n updateFuncs.push((baseOffset) => {\n updateFunc(baseOffset + dynamicOffset);\n });\n }\n else {\n coder.encode(staticWriter, value);\n }\n });\n // Backfill all the dynamic offsets, now that we know the static length\n updateFuncs.forEach((func) => {\n func(staticWriter.length);\n });\n let length = writer.appendWriter(staticWriter);\n length += writer.appendWriter(dynamicWriter);\n return length;\n}\n/**\n * @_ignore\n */\nexport function unpack(reader, coders) {\n let values = [];\n let keys = [];\n // A reader anchored to this base\n let baseReader = reader.subReader(0);\n coders.forEach((coder) => {\n let value = null;\n if (coder.dynamic) {\n let offset = reader.readIndex();\n let offsetReader = baseReader.subReader(offset);\n try {\n value = coder.decode(offsetReader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n else {\n try {\n value = coder.decode(reader);\n }\n catch (error) {\n // Cannot recover from this\n if (isError(error, \"BUFFER_OVERRUN\")) {\n throw error;\n }\n value = error;\n value.baseType = coder.name;\n value.name = coder.localName;\n value.type = coder.type;\n }\n }\n if (value == undefined) {\n throw new Error(\"investigate\");\n }\n values.push(value);\n keys.push(coder.localName || null);\n });\n return Result.fromItems(values, keys);\n}\n/**\n * @_ignore\n */\nexport class ArrayCoder extends Coder {\n coder;\n length;\n constructor(coder, length, localName) {\n const type = coder.type + \"[\" + (length >= 0 ? length : \"\") + \"]\";\n const dynamic = length === -1 || coder.dynamic;\n super(\"array\", type, localName, dynamic);\n defineProperties(this, { coder, length });\n }\n defaultValue() {\n // Verifies the child coder is valid (even if the array is dynamic or 0-length)\n const defaultChild = this.coder.defaultValue();\n const result = [];\n for (let i = 0; i < this.length; i++) {\n result.push(defaultChild);\n }\n return result;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"array\");\n if (!Array.isArray(value)) {\n this._throwError(\"expected array value\", value);\n }\n let count = this.length;\n if (count === -1) {\n count = value.length;\n writer.writeValue(value.length);\n }\n assertArgumentCount(value.length, count, \"coder array\" + (this.localName ? \" \" + this.localName : \"\"));\n let coders = [];\n for (let i = 0; i < value.length; i++) {\n coders.push(this.coder);\n }\n return pack(writer, coders, value);\n }\n decode(reader) {\n let count = this.length;\n if (count === -1) {\n count = reader.readIndex();\n // Check that there is *roughly* enough data to ensure\n // stray random data is not being read as a length. Each\n // slot requires at least 32 bytes for their value (or 32\n // bytes as a link to the data). This could use a much\n // tighter bound, but we are erroring on the side of safety.\n assert(count * WordSize <= reader.dataLength, \"insufficient data length\", \"BUFFER_OVERRUN\", {\n buffer: reader.bytes,\n offset: count * WordSize,\n length: reader.dataLength,\n });\n }\n let coders = [];\n for (let i = 0; i < count; i++) {\n coders.push(new AnonymousCoder(this.coder));\n }\n return unpack(reader, coders);\n }\n}\n//# sourceMappingURL=array.js.map"],"names":["assert","assertArgument","Writer","isError","Result","Coder","defineProperties","Typed","assertArgumentCount","WordSize","AnonymousCoder"],"mappings":";;;;;;;;;;;;;;;AAIA;AACA;AACA;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AE;AACvB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;AACxC,YAAY,MAAM,CAAC,IAAI,CAAC,IAAIC,wBAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACvD,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;AACrC,IAAI;AACJ;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/boolean.d.ts b/lib.commonjs/abi/coders/boolean.d.ts deleted file mode 100644 index f073e37ee..000000000 --- a/lib.commonjs/abi/coders/boolean.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class BooleanCoder extends Coder { - constructor(localName: string); - defaultValue(): boolean; - encode(writer: Writer, _value: boolean | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=boolean.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/boolean.d.ts.map b/lib.commonjs/abi/coders/boolean.d.ts.map deleted file mode 100644 index f0c2679a1..000000000 --- a/lib.commonjs/abi/coders/boolean.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,OAAO,CAEtB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAGtD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/boolean.js b/lib.commonjs/abi/coders/boolean.js deleted file mode 100644 index 77464ef03..000000000 --- a/lib.commonjs/abi/coders/boolean.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var typed = require('../typed.js'); -var abstractCoder = require('./abstract-coder.js'); - -/** - * @_ignore - */ -class BooleanCoder extends abstractCoder.Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value) { - const value = typed.Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } -} - -exports.BooleanCoder = BooleanCoder; -//# sourceMappingURL=boolean.js.map diff --git a/lib.commonjs/abi/coders/boolean.js.map b/lib.commonjs/abi/coders/boolean.js.map deleted file mode 100644 index ee5e26725..000000000 --- a/lib.commonjs/abi/coders/boolean.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolean.js","sources":["../../../lib.esm/abi/coders/boolean.js"],"sourcesContent":["import { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class BooleanCoder extends Coder {\n constructor(localName) {\n super(\"bool\", \"bool\", localName, false);\n }\n defaultValue() {\n return false;\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"bool\");\n return writer.writeValue(value ? 1 : 0);\n }\n decode(reader) {\n return !!reader.readValue();\n }\n}\n//# sourceMappingURL=boolean.js.map"],"names":["Coder","Typed"],"mappings":";;;;;AAEA;AACA;AACA;AACO,MAAM,YAAY,SAASA,mBAAK,CAAC;AACxC,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;AAC/C,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,MAAM,KAAK,GAAGC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;AACvD,QAAQ,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;AAC/C,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE;AACnC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/bytes.d.ts b/lib.commonjs/abi/coders/bytes.d.ts deleted file mode 100644 index 1e554582f..000000000 --- a/lib.commonjs/abi/coders/bytes.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class DynamicBytesCoder extends Coder { - constructor(type: string, localName: string); - defaultValue(): string; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -/** - * @_ignore - */ -export declare class BytesCoder extends DynamicBytesCoder { - constructor(localName: string); - decode(reader: Reader): any; -} -//# sourceMappingURL=bytes.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/bytes.d.ts.map b/lib.commonjs/abi/coders/bytes.d.ts.map deleted file mode 100644 index 956098f28..000000000 --- a/lib.commonjs/abi/coders/bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAE1C;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;IAChD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/bytes.js b/lib.commonjs/abi/coders/bytes.js deleted file mode 100644 index 740aaed9a..000000000 --- a/lib.commonjs/abi/coders/bytes.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -require('../../utils/base58.js'); -var data = require('../../utils/data.js'); -require('../../utils/errors.js'); -require('../../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../../utils/fixednumber.js'); -require('../../utils/maths.js'); -var abstractCoder = require('./abstract-coder.js'); - -/** - * @_ignore - */ -class DynamicBytesCoder extends abstractCoder.Coder { - constructor(type, localName) { - super(type, type, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = data.getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } -} -/** - * @_ignore - */ -class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return data.hexlify(super.decode(reader)); - } -} - -exports.BytesCoder = BytesCoder; -exports.DynamicBytesCoder = DynamicBytesCoder; -//# sourceMappingURL=bytes.js.map diff --git a/lib.commonjs/abi/coders/bytes.js.map b/lib.commonjs/abi/coders/bytes.js.map deleted file mode 100644 index bba4607ca..000000000 --- a/lib.commonjs/abi/coders/bytes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes.js","sources":["../../../lib.esm/abi/coders/bytes.js"],"sourcesContent":["import { getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class DynamicBytesCoder extends Coder {\n constructor(type, localName) {\n super(type, type, localName, true);\n }\n defaultValue() {\n return \"0x\";\n }\n encode(writer, value) {\n value = getBytesCopy(value);\n let length = writer.writeValue(value.length);\n length += writer.writeBytes(value);\n return length;\n }\n decode(reader) {\n return reader.readBytes(reader.readIndex(), true);\n }\n}\n/**\n * @_ignore\n */\nexport class BytesCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"bytes\", localName);\n }\n decode(reader) {\n return hexlify(super.decode(reader));\n }\n}\n//# sourceMappingURL=bytes.js.map"],"names":["Coder","getBytesCopy","hexlify"],"mappings":";;;;;;;;;;;;;AAEA;AACA;AACA;AACO,MAAM,iBAAiB,SAASA,mBAAK,CAAC;AAC7C,IAAI,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE;AACjC,QAAQ,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC;AAC1C,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE;AAC1B,QAAQ,KAAK,GAAGC,iBAAY,CAAC,KAAK,CAAC;AACnC,QAAQ,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;AACpD,QAAQ,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AAC1C,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC;AACzD,IAAI;AACJ;AACA;AACA;AACA;AACO,MAAM,UAAU,SAAS,iBAAiB,CAAC;AAClD,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC;AACjC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOC,YAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC5C,IAAI;AACJ;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/fixed-bytes.d.ts b/lib.commonjs/abi/coders/fixed-bytes.d.ts deleted file mode 100644 index 5c485fef6..000000000 --- a/lib.commonjs/abi/coders/fixed-bytes.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BytesLike } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class FixedBytesCoder extends Coder { - readonly size: number; - constructor(size: number, localName: string); - defaultValue(): string; - encode(writer: Writer, _value: BytesLike | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=fixed-bytes.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/fixed-bytes.d.ts.map b/lib.commonjs/abi/coders/fixed-bytes.d.ts.map deleted file mode 100644 index 9d870c078..000000000 --- a/lib.commonjs/abi/coders/fixed-bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAI1C;IAED,YAAY,IAAI,MAAM,CAKrB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/fixed-bytes.js b/lib.commonjs/abi/coders/fixed-bytes.js deleted file mode 100644 index 867c19a79..000000000 --- a/lib.commonjs/abi/coders/fixed-bytes.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -require('../../utils/base58.js'); -var data = require('../../utils/data.js'); -require('../../utils/errors.js'); -var properties = require('../../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../../utils/fixednumber.js'); -require('../../utils/maths.js'); -var typed = require('../typed.js'); -var abstractCoder = require('./abstract-coder.js'); - -/** - * @_ignore - */ -class FixedBytesCoder extends abstractCoder.Coder { - size; - constructor(size, localName) { - let name = "bytes" + String(size); - super(name, name, localName, false); - properties.defineProperties(this, { size }, { size: "number" }); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); - } - encode(writer, _value) { - let data$1 = data.getBytesCopy(typed.Typed.dereference(_value, this.type)); - if (data$1.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data$1); - } - decode(reader) { - return data.hexlify(reader.readBytes(this.size)); - } -} - -exports.FixedBytesCoder = FixedBytesCoder; -//# sourceMappingURL=fixed-bytes.js.map diff --git a/lib.commonjs/abi/coders/fixed-bytes.js.map b/lib.commonjs/abi/coders/fixed-bytes.js.map deleted file mode 100644 index 473ab444c..000000000 --- a/lib.commonjs/abi/coders/fixed-bytes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixed-bytes.js","sources":["../../../lib.esm/abi/coders/fixed-bytes.js"],"sourcesContent":["import { defineProperties, getBytesCopy, hexlify } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\n/**\n * @_ignore\n */\nexport class FixedBytesCoder extends Coder {\n size;\n constructor(size, localName) {\n let name = \"bytes\" + String(size);\n super(name, name, localName, false);\n defineProperties(this, { size }, { size: \"number\" });\n }\n defaultValue() {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\".substring(0, 2 + this.size * 2);\n }\n encode(writer, _value) {\n let data = getBytesCopy(Typed.dereference(_value, this.type));\n if (data.length !== this.size) {\n this._throwError(\"incorrect data length\", _value);\n }\n return writer.writeBytes(data);\n }\n decode(reader) {\n return hexlify(reader.readBytes(this.size));\n }\n}\n//# sourceMappingURL=fixed-bytes.js.map"],"names":["Coder","defineProperties","data","getBytesCopy","Typed","hexlify"],"mappings":";;;;;;;;;;;;;;AAGA;AACA;AACA;AACO,MAAM,eAAe,SAASA,mBAAK,CAAC;AAC3C,IAAI,IAAI;AACR,IAAI,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE;AACjC,QAAQ,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;AACzC,QAAQ,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC;AAC3C,QAAQC,2BAAgB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC5D,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,oEAAoE,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;AACnH,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,IAAIC,MAAI,GAAGC,iBAAY,CAACC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AACrE,QAAQ,IAAIF,MAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE;AACvC,YAAY,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC;AAC7D,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,UAAU,CAACA,MAAI,CAAC;AACtC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOG,YAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACnD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/null.d.ts b/lib.commonjs/abi/coders/null.d.ts deleted file mode 100644 index 5df5da342..000000000 --- a/lib.commonjs/abi/coders/null.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NullCoder extends Coder { - constructor(localName: string); - defaultValue(): null; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=null.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/null.d.ts.map b/lib.commonjs/abi/coders/null.d.ts.map deleted file mode 100644 index e2ef8ebc5..000000000 --- a/lib.commonjs/abi/coders/null.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACnC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,IAAI,CAEnB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAG1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/null.js b/lib.commonjs/abi/coders/null.js deleted file mode 100644 index ac3544de2..000000000 --- a/lib.commonjs/abi/coders/null.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -var abstractCoder = require('./abstract-coder.js'); - -const Empty = new Uint8Array([]); -/** - * @_ignore - */ -class NullCoder extends abstractCoder.Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } -} - -exports.NullCoder = NullCoder; -//# sourceMappingURL=null.js.map diff --git a/lib.commonjs/abi/coders/null.js.map b/lib.commonjs/abi/coders/null.js.map deleted file mode 100644 index a88d3ff33..000000000 --- a/lib.commonjs/abi/coders/null.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"null.js","sources":["../../../lib.esm/abi/coders/null.js"],"sourcesContent":["import { Coder } from \"./abstract-coder.js\";\nconst Empty = new Uint8Array([]);\n/**\n * @_ignore\n */\nexport class NullCoder extends Coder {\n constructor(localName) {\n super(\"null\", \"\", localName, false);\n }\n defaultValue() {\n return null;\n }\n encode(writer, value) {\n if (value != null) {\n this._throwError(\"not null\", value);\n }\n return writer.writeBytes(Empty);\n }\n decode(reader) {\n reader.readBytes(0);\n return null;\n }\n}\n//# sourceMappingURL=null.js.map"],"names":["Coder"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC;AAChC;AACA;AACA;AACO,MAAM,SAAS,SAASA,mBAAK,CAAC;AACrC,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC;AAC3C,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE;AAC1B,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;AAC3B,YAAY,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC;AAC/C,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACvC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AAC3B,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/number.d.ts b/lib.commonjs/abi/coders/number.d.ts deleted file mode 100644 index 822cc6df2..000000000 --- a/lib.commonjs/abi/coders/number.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BigNumberish } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NumberCoder extends Coder { - readonly size: number; - readonly signed: boolean; - constructor(size: number, signed: boolean, localName: string); - defaultValue(): number; - encode(writer: Writer, _value: BigNumberish | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=number.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/number.d.ts.map b/lib.commonjs/abi/coders/number.d.ts.map deleted file mode 100644 index 5af9a7edb..000000000 --- a/lib.commonjs/abi/coders/number.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAC;IAE1B,YAAY,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAS3D;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM,CAgB3D;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAQ1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/number.js b/lib.commonjs/abi/coders/number.js deleted file mode 100644 index 9c5915c6a..000000000 --- a/lib.commonjs/abi/coders/number.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -require('../../utils/base58.js'); -require('../../logger/logger.js'); -require('../../utils/errors.js'); -var properties = require('../../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../../utils/fixednumber.js'); -var maths = require('../../utils/maths.js'); -var typed = require('../typed.js'); -var abstractCoder = require('./abstract-coder.js'); - -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * @_ignore - */ -class NumberCoder extends abstractCoder.Coder { - size; - signed; - constructor(size, signed, localName) { - const name = (signed ? "int" : "uint") + size * 8; - super(name, name, localName, false); - properties.defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value) { - let value = maths.getBigInt(typed.Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = maths.mask(BN_MAX_UINT256, abstractCoder.WordSize * 8); - if (this.signed) { - let bounds = maths.mask(maxUintValue, this.size * 8 - 1); - if (value > bounds || value < -(bounds + BN_1)) { - this._throwError("value out-of-bounds", _value); - } - value = maths.toTwos(value, 8 * abstractCoder.WordSize); - } - else if (value < BN_0 || value > maths.mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - return writer.writeValue(value); - } - decode(reader) { - let value = maths.mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = maths.fromTwos(value, this.size * 8); - } - return value; - } -} - -exports.NumberCoder = NumberCoder; -//# sourceMappingURL=number.js.map diff --git a/lib.commonjs/abi/coders/number.js.map b/lib.commonjs/abi/coders/number.js.map deleted file mode 100644 index cc965a5d9..000000000 --- a/lib.commonjs/abi/coders/number.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.js","sources":["../../../lib.esm/abi/coders/number.js"],"sourcesContent":["import { defineProperties, fromTwos, getBigInt, mask, toTwos, } from \"../../utils/index.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder, WordSize } from \"./abstract-coder.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_MAX_UINT256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * @_ignore\n */\nexport class NumberCoder extends Coder {\n size;\n signed;\n constructor(size, signed, localName) {\n const name = (signed ? \"int\" : \"uint\") + size * 8;\n super(name, name, localName, false);\n defineProperties(this, { size, signed }, { size: \"number\", signed: \"boolean\" });\n }\n defaultValue() {\n return 0;\n }\n encode(writer, _value) {\n let value = getBigInt(Typed.dereference(_value, this.type));\n // Check bounds are safe for encoding\n let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8);\n if (this.signed) {\n let bounds = mask(maxUintValue, this.size * 8 - 1);\n if (value > bounds || value < -(bounds + BN_1)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n value = toTwos(value, 8 * WordSize);\n }\n else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) {\n this._throwError(\"value out-of-bounds\", _value);\n }\n return writer.writeValue(value);\n }\n decode(reader) {\n let value = mask(reader.readValue(), this.size * 8);\n if (this.signed) {\n value = fromTwos(value, this.size * 8);\n }\n return value;\n }\n}\n//# sourceMappingURL=number.js.map"],"names":["Coder","defineProperties","getBigInt","Typed","mask","WordSize","toTwos","fromTwos"],"mappings":";;;;;;;;;;;;;;AAGA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,cAAc,GAAG,MAAM,CAAC,oEAAoE,CAAC;AACnG;AACA;AACA;AACO,MAAM,WAAW,SAASA,mBAAK,CAAC;AACvC,IAAI,IAAI;AACR,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE;AACzC,QAAQ,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,KAAK,GAAG,MAAM,IAAI,IAAI,GAAG,CAAC;AACzD,QAAQ,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC;AAC3C,QAAQC,2BAAgB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACvF,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,CAAC;AAChB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,IAAI,KAAK,GAAGC,eAAS,CAACC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;AACnE;AACA,QAAQ,IAAI,YAAY,GAAGC,UAAI,CAAC,cAAc,EAAEC,sBAAQ,GAAG,CAAC,CAAC;AAC7D,QAAQ,IAAI,IAAI,CAAC,MAAM,EAAE;AACzB,YAAY,IAAI,MAAM,GAAGD,UAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;AAC9D,YAAY,IAAI,KAAK,GAAG,MAAM,IAAI,KAAK,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC,EAAE;AAC5D,gBAAgB,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC;AAC/D,YAAY;AACZ,YAAY,KAAK,GAAGE,YAAM,CAAC,KAAK,EAAE,CAAC,GAAGD,sBAAQ,CAAC;AAC/C,QAAQ;AACR,aAAa,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAGD,UAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE;AAC5E,YAAY,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,MAAM,CAAC;AAC3D,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACvC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,IAAI,KAAK,GAAGA,UAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;AAC3D,QAAQ,IAAI,IAAI,CAAC,MAAM,EAAE;AACzB,YAAY,KAAK,GAAGG,cAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;AAClD,QAAQ;AACR,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/string.d.ts b/lib.commonjs/abi/coders/string.d.ts deleted file mode 100644 index 8e1c63593..000000000 --- a/lib.commonjs/abi/coders/string.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { DynamicBytesCoder } from "./bytes.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class StringCoder extends DynamicBytesCoder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=string.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/string.d.ts.map b/lib.commonjs/abi/coders/string.d.ts.map deleted file mode 100644 index d0158dd8b..000000000 --- a/lib.commonjs/abi/coders/string.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IACjD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAKrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/string.js b/lib.commonjs/abi/coders/string.js deleted file mode 100644 index c48c51379..000000000 --- a/lib.commonjs/abi/coders/string.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var utf8 = require('../../utils/utf8.js'); -var typed = require('../typed.js'); -var bytes = require('./bytes.js'); - -/** - * @_ignore - */ -class StringCoder extends bytes.DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value) { - return super.encode(writer, utf8.toUtf8Bytes(typed.Typed.dereference(_value, "string"))); - } - decode(reader) { - return utf8.toUtf8String(super.decode(reader)); - } -} - -exports.StringCoder = StringCoder; -//# sourceMappingURL=string.js.map diff --git a/lib.commonjs/abi/coders/string.js.map b/lib.commonjs/abi/coders/string.js.map deleted file mode 100644 index 93654097c..000000000 --- a/lib.commonjs/abi/coders/string.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.js","sources":["../../../lib.esm/abi/coders/string.js"],"sourcesContent":["import { toUtf8Bytes, toUtf8String } from \"../../utils/utf8.js\";\nimport { Typed } from \"../typed.js\";\nimport { DynamicBytesCoder } from \"./bytes.js\";\n/**\n * @_ignore\n */\nexport class StringCoder extends DynamicBytesCoder {\n constructor(localName) {\n super(\"string\", localName);\n }\n defaultValue() {\n return \"\";\n }\n encode(writer, _value) {\n return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, \"string\")));\n }\n decode(reader) {\n return toUtf8String(super.decode(reader));\n }\n}\n//# sourceMappingURL=string.js.map"],"names":["DynamicBytesCoder","toUtf8Bytes","Typed","toUtf8String"],"mappings":";;;;;;AAGA;AACA;AACA;AACO,MAAM,WAAW,SAASA,uBAAiB,CAAC;AACnD,IAAI,WAAW,CAAC,SAAS,EAAE;AAC3B,QAAQ,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC;AAClC,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAO,EAAE;AACjB,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,EAAEC,gBAAW,CAACC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrF,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOC,iBAAY,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACjD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/tuple.d.ts b/lib.commonjs/abi/coders/tuple.d.ts deleted file mode 100644 index fe3ec0328..000000000 --- a/lib.commonjs/abi/coders/tuple.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class TupleCoder extends Coder { - readonly coders: ReadonlyArray; - constructor(coders: Array, localName: string); - defaultValue(): any; - encode(writer: Writer, _value: Array | { - [name: string]: any; - } | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=tuple.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/coders/tuple.d.ts.map b/lib.commonjs/abi/coders/tuple.d.ts.map deleted file mode 100644 index bc66dc09e..000000000 --- a/lib.commonjs/abi/coders/tuple.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAEvC,YAAY,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,EAelD;IAED,YAAY,IAAI,GAAG,CAwClB;IAED,MAAM,CACL,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,KAAK,GAClD,MAAM,CAGR;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/coders/tuple.js b/lib.commonjs/abi/coders/tuple.js deleted file mode 100644 index ab807bf65..000000000 --- a/lib.commonjs/abi/coders/tuple.js +++ /dev/null @@ -1,70 +0,0 @@ -'use strict'; - -var properties = require('../../utils/properties.js'); -var typed = require('../typed.js'); -var abstractCoder = require('./abstract-coder.js'); -var array = require('./array.js'); - -/** - * @_ignore - */ -class TupleCoder extends abstractCoder.Coder { - coders; - constructor(coders, localName) { - let dynamic = false; - const types = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = "tuple(" + types.join(",") + ")"; - super("tuple", type, localName, dynamic); - properties.defineProperties(this, { - coders: Object.freeze(coders.slice()), - }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, {}); - // Add named values - this.coders.forEach((coder, index) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } - if (name === "length") { - name = "_length"; - } - if (values[name] != null) { - return; - } - values[name] = values[index]; - }); - return Object.freeze(values); - } - encode(writer, _value) { - const value = typed.Typed.dereference(_value, "tuple"); - return array.pack(writer, this.coders, value); - } - decode(reader) { - return array.unpack(reader, this.coders); - } -} - -exports.TupleCoder = TupleCoder; -//# sourceMappingURL=tuple.js.map diff --git a/lib.commonjs/abi/coders/tuple.js.map b/lib.commonjs/abi/coders/tuple.js.map deleted file mode 100644 index d5f995d8f..000000000 --- a/lib.commonjs/abi/coders/tuple.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tuple.js","sources":["../../../lib.esm/abi/coders/tuple.js"],"sourcesContent":["import { defineProperties } from \"../../utils/properties.js\";\nimport { Typed } from \"../typed.js\";\nimport { Coder } from \"./abstract-coder.js\";\nimport { pack, unpack } from \"./array.js\";\n/**\n * @_ignore\n */\nexport class TupleCoder extends Coder {\n coders;\n constructor(coders, localName) {\n let dynamic = false;\n const types = [];\n coders.forEach((coder) => {\n if (coder.dynamic) {\n dynamic = true;\n }\n types.push(coder.type);\n });\n const type = \"tuple(\" + types.join(\",\") + \")\";\n super(\"tuple\", type, localName, dynamic);\n defineProperties(this, {\n coders: Object.freeze(coders.slice()),\n });\n }\n defaultValue() {\n const values = [];\n this.coders.forEach((coder) => {\n values.push(coder.defaultValue());\n });\n // We only output named properties for uniquely named coders\n const uniqueNames = this.coders.reduce((accum, coder) => {\n const name = coder.localName;\n if (name) {\n if (!accum[name]) {\n accum[name] = 0;\n }\n accum[name]++;\n }\n return accum;\n }, {});\n // Add named values\n this.coders.forEach((coder, index) => {\n let name = coder.localName;\n if (!name || uniqueNames[name] !== 1) {\n return;\n }\n if (name === \"length\") {\n name = \"_length\";\n }\n if (values[name] != null) {\n return;\n }\n values[name] = values[index];\n });\n return Object.freeze(values);\n }\n encode(writer, _value) {\n const value = Typed.dereference(_value, \"tuple\");\n return pack(writer, this.coders, value);\n }\n decode(reader) {\n return unpack(reader, this.coders);\n }\n}\n//# sourceMappingURL=tuple.js.map"],"names":["Coder","defineProperties","Typed","pack","unpack"],"mappings":";;;;;;;AAIA;AACA;AACA;AACO,MAAM,UAAU,SAASA,mBAAK,CAAC;AACtC,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE;AACnC,QAAQ,IAAI,OAAO,GAAG,KAAK;AAC3B,QAAQ,MAAM,KAAK,GAAG,EAAE;AACxB,QAAQ,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAK;AAClC,YAAY,IAAI,KAAK,CAAC,OAAO,EAAE;AAC/B,gBAAgB,OAAO,GAAG,IAAI;AAC9B,YAAY;AACZ,YAAY,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AAClC,QAAQ,CAAC,CAAC;AACV,QAAQ,MAAM,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG;AACrD,QAAQ,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;AAChD,QAAQC,2BAAgB,C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KAAK,CAAC;AACxC,QAAQ,CAAC,CAAC;AACV,QAAQ,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AACpC,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AAC3B,QAAQ,MAAM,KAAK,GAAGC,WAAK,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC;AACxD,QAAQ,OAAOC,UAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;AAC/C,IAAI;AACJ,IAAI,MAAM,CAAC,MAAM,EAAE;AACnB,QAAQ,OAAOC,YAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;AAC1C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/fragments.d.ts b/lib.commonjs/abi/fragments.d.ts deleted file mode 100644 index 6d88c3596..000000000 --- a/lib.commonjs/abi/fragments.d.ts +++ /dev/null @@ -1,372 +0,0 @@ -/** - * About frgaments... - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -/** - * A type description in a JSON API. - */ -export interface JsonFragmentType { - /** - * The parameter name. - */ - readonly name?: string; - /** - * If the parameter is indexed. - */ - readonly indexed?: boolean; - /** - * The type of the parameter. - */ - readonly type?: string; - /** - * The internal Solidity type. - */ - readonly internalType?: string; - /** - * The components for a tuple. - */ - readonly components?: ReadonlyArray; -} -/** - * A fragment for a method, event or error in a JSON API. - */ -export interface JsonFragment { - /** - * The name of the error, event, function, etc. - */ - readonly name?: string; - /** - * The type of the fragment (e.g. ``event``, ``"function"``, etc.) - */ - readonly type?: string; - /** - * If the event is anonymous. - */ - readonly anonymous?: boolean; - /** - * If the function is payable. - */ - readonly payable?: boolean; - /** - * If the function is constant. - */ - readonly constant?: boolean; - /** - * The mutability state of the function. - */ - readonly stateMutability?: string; - /** - * The input parameters. - */ - readonly inputs?: ReadonlyArray; - /** - * The output parameters. - */ - readonly outputs?: ReadonlyArray; - /** - * The energy limit to use when sending a transaction for this function. - */ - readonly energy?: string; -} -/** - * The format to serialize the output as. - */ -export type FormatType = "sighash" | "minimal" | "full" | "json"; -/** - * When [walking](ParamType-walk) a [[ParamType]], this is called - * on each component. - */ -export type ParamTypeWalkFunc = (type: string, value: any) => any; -/** - * When [walking asynchronously](ParamType-walkAsync) a [[ParamType]], - * this is called on each component. - */ -export type ParamTypeWalkAsyncFunc = (type: string, value: any) => any | Promise; -/** - * Each input and output of a [[Fragment]] is an Array of **PAramType**. - */ -export declare class ParamType { - #private; - /** - * The local name of the parameter (or ``""`` if unbound) - */ - readonly name: string; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - readonly type: string; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - readonly baseType: string; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - readonly indexed: null | boolean; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - readonly components: null | ReadonlyArray; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - readonly arrayLength: null | number; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - readonly arrayChildren: null | ParamType; - /** - * @private - */ - constructor(guard: any, name: string, type: string, baseType: string, indexed: null | boolean, components: null | ReadonlyArray, arrayLength: null | number, arrayChildren: null | ParamType); - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format?: FormatType): string; - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray(): this is ParamType & { - arrayChildren: ParamType; - arrayLength: number; - }; - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple(): this is ParamType & { - components: ReadonlyArray; - }; - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable(): this is ParamType & { - indexed: boolean; - }; - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value: any, process: ParamTypeWalkFunc): any; - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise; - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj: any, allowIndexed?: boolean): ParamType; - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value: any): value is ParamType; -} -/** - * The type of a [[Fragment]]. - */ -export type FragmentType = "constructor" | "error" | "event" | "fallback" | "function" | "struct"; -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -export declare abstract class Fragment { - /** - * The type of the fragment. - */ - readonly type: FragmentType; - /** - * The inputs for the fragment. - */ - readonly inputs: ReadonlyArray; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray); - /** - * Returns a string representation of this fragment. - */ - abstract format(format?: FormatType): string; - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj: any): Fragment; - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value: any): value is ConstructorFragment; - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value: any): value is ErrorFragment; - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value: any): value is EventFragment; - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value: any): value is FunctionFragment; - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value: any): value is StructFragment; -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -export declare abstract class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - readonly name: string; - /** - * @private - */ - constructor(guard: any, type: FragmentType, name: string, inputs: ReadonlyArray); -} -/** - * A Fragment which represents a //Custom Error//. - */ -export declare class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - /** - * The Custom Error selector. - */ - get selector(): string; - format(format?: FormatType): string; - static from(obj: any): ErrorFragment; - static isFragment(value: any): value is ErrorFragment; -} -/** - * A Fragment which represents an Event. - */ -export declare class EventFragment extends NamedFragment { - readonly anonymous: boolean; - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray, anonymous: boolean); - /** - * The Event topic hash. - */ - get topicHash(): string; - format(format?: FormatType): string; - static getTopicHash(name: string, params?: Array): string; - static from(obj: any): EventFragment; - static isFragment(value: any): value is EventFragment; -} -/** - * A Fragment which represents a constructor. - */ -export declare class ConstructorFragment extends Fragment { - readonly payable: boolean; - readonly energy: null | bigint; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray, payable: boolean, energy: null | bigint); - format(format?: FormatType): string; - static from(obj: any): ConstructorFragment; - static isFragment(value: any): value is ConstructorFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - constructor(guard: any, inputs: ReadonlyArray, payable: boolean); - format(format?: FormatType): string; - static from(obj: any): FallbackFragment; - static isFragment(value: any): value is FallbackFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - readonly constant: boolean; - /** - * The returned types for the result of calling this function. - */ - readonly outputs: ReadonlyArray; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - readonly stateMutability: "payable" | "nonpayable" | "view" | "pure"; - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - /** - * The amount of energy to send when calling this function - */ - readonly energy: null | bigint; - /** - * @private - */ - constructor(guard: any, name: string, stateMutability: "payable" | "nonpayable" | "view" | "pure", inputs: ReadonlyArray, outputs: ReadonlyArray, energy: null | bigint); - /** - * The Function selector. - */ - get selector(): string; - format(format?: FormatType): string; - static getSelector(name: string, params?: Array): string; - static from(obj: any): FunctionFragment; - static isFragment(value: any): value is FunctionFragment; -} -/** - * A Fragment which represents a structure. - */ -export declare class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - format(): string; - static from(obj: any): StructFragment; - static isFragment(value: any): value is FunctionFragment; -} -//# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/fragments.d.ts.map b/lib.commonjs/abi/fragments.d.ts.map deleted file mode 100644 index b1a1124b4..000000000 --- a/lib.commonjs/abi/fragments.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;O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I,EAAE,MAAM,EACZ,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,EAC3D,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAChC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,EACjC,MAAM,EAAE,IAAI,GAAG,MAAM,EAcrB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,CA2ClC;IAED,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAW5D;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB,CA6DtC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAChD;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAGrE;IAED,MAAM,IAAI,MAAM,CAEf;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,CAepC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/fragments.js b/lib.commonjs/abi/fragments.js deleted file mode 100644 index 1488d345f..000000000 --- a/lib.commonjs/abi/fragments.js +++ /dev/null @@ -1,1308 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -var id = require('../hash/id.js'); -require('../constants/numbers.js'); -require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); - -/** - * About frgaments... - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -var _a; -// [ "a", "b" ] => { "a": 1, "b": 1 } -function setify(items) { - const result = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); -} -// Visibility Keywords -const _kwVisib = "constant external internal payable private public pure view"; -const KwVisib = setify(_kwVisib.split(" ")); -const _kwTypes = "constructor error event fallback function receive struct"; -const KwTypes = setify(_kwTypes.split(" ")); -const _kwModifiers = "calldata memory storage payable indexed"; -const KwModifiers = setify(_kwModifiers.split(" ")); -const _kwOther = "tuple returns"; -// All Keywords -const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); -const Keywords = setify(_keywords.split(" ")); -// Single character tokens -const SimpleTokens = { - "(": "OPEN_PAREN", - ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", - "]": "CLOSE_BRACKET", - ",": "COMMA", - "@": "AT", -}; -// Parser regexes to consume the next token -const regexWhitespacePrefix = new RegExp("^(\\s*)"); -const regexNumberPrefix = new RegExp("^([0-9]+)"); -const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); -// Parser regexs to check validity -const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); -const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); -class TokenString { - #offset; - #tokens; - get offset() { - return this.#offset; - } - get length() { - return this.#tokens.length - this.#offset; - } - constructor(tokens) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - clone() { - return new _a(this.#tokens); - } - reset() { - this.#offset = 0; - } - #subTokenString(from = 0, to = 0) { - return new _a(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({}, t, { - match: t.match - from, - linkBack: t.linkBack - from, - linkNext: t.linkNext - from, - })); - })); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type) { - if (this.peek().type !== type) { - throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - this.#offset = top.match + 1; - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return top != null && allowed.has(top) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return top.type === type ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - this.#offset++; - return result; - } - toString() { - const tokens = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } -} -_a = TokenString; -function lex(text) { - const tokens = []; - const throwError = (message) => { - const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - let brackets = []; - let commas = []; - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - const token = { - depth: brackets.length, - linkBack: -1, - linkNext: -1, - match: -1, - type: "", - text: "", - offset, - value: -1, - }; - tokens.push(token); - let type = SimpleTokens[cur[0]] || ""; - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } - else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - token.match = brackets.pop(); - tokens[token.match].match = tokens.length - 1; - token.depth--; - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - } - else if (type === "COMMA") { - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } - else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } - else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - tokens[tokens.length - 1].value = - maths.getNumber(value); - } - if (tokens.length === 0 || - tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - tokens[tokens.length - 1].text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - token.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); - } - return new TokenString(tokens.map((t) => Object.freeze(t))); -} -// Check only one of `allowed` is in `set` -function allowSingle(set, allowed) { - let included = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } -} -// Functions to process a Solidity Signature TokenString from left-to-right for... -// ...the name with an optional type, returning the name -function consumeName(type, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - return tokens.popType("ID"); -} -// ...all keywords matching allowed, returning the keywords -function consumeKeywords(tokens, allowed) { - const keywords = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - return Object.freeze(keywords); -} -// ...all visibility keywords, returning the coalesced mutability -function consumeMutability(tokens) { - let modifiers = consumeKeywords(tokens, KwVisib); - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; -} -// ...a parameter list, returning the ParamType list -function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); -} -// ...a energy limit, returning a BigNumber or null if none -function consumeEnergy(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return maths.getBigInt(tokens.pop().text); - } - throw new Error("invalid energy"); - } - return null; -} -function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens: ${tokens.toString()}`); - } -} -const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); -function verifyBasicType(type) { - const match = type.match(regexType); - errors.assertArgument(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - errors.assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); - } - else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3]); - errors.assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid numeric width", "type", type); - } - return type; -} -// Make the Fragment constructors effectively private -const _guard = {}; -const internal = Symbol.for("_corebc_internal"); -const ParamTypeInternal = "_ParamTypeInternal"; -const ErrorFragmentInternal = "_ErrorInternal"; -const EventFragmentInternal = "_EventInternal"; -const ConstructorFragmentInternal = "_ConstructorInternal"; -const FallbackFragmentInternal = "_FallbackInternal"; -const FunctionFragmentInternal = "_FunctionInternal"; -const StructFragmentInternal = "_StructInternal"; -/** - * Each input and output of a [[Fragment]] is an Array of **PAramType**. - */ -class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - name; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - type; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - baseType; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - indexed; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - components; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - arrayLength; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - arrayChildren; - /** - * @private - */ - constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - errors.assertPrivate(guard, _guard, "ParamType"); - Object.defineProperty(this, internal, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } - else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } - else if (components != null) { - throw new Error(""); - } - properties.defineProperties(this, { - name, - type, - baseType, - indexed, - components, - arrayLength, - arrayChildren, - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - let result = { - type: this.baseType === "tuple" ? "tuple" : this.type, - name: this.name || undefined, - }; - if (typeof this.indexed === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - let result = ""; - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; - } - else { - if (this.isTuple()) { - if (format !== "sighash") { - result += this.type; - } - result += - "(" + - this.components - .map((comp) => comp.format(format)) - .join(format === "full" ? ", " : ",") + - ")"; - } - else { - result += this.type; - } - } - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /* - * Returns true if %%value%% is an Array type. - * - * This provides a type gaurd ensuring that the - * [[arrayChildren]] and [[arrayLength]] are non-null. - */ - //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } { - // return value && (value.baseType === "array") - //} - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return this.baseType === "array"; - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return this.baseType === "tuple"; - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return this.indexed != null; - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => _this.arrayChildren.walk(v, process)); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => _this.components[i].walk(v, process)); - } - return process(this.type, value); - } - #walkAsync(promises, value, process, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - if (this.isTuple()) { - const components = this.components; - // Convert the object into an array - let result; - if (Array.isArray(value)) { - result = value.slice(); - } - else { - if (value == null || typeof value !== "object") { - throw new Error("invalid tuple value"); - } - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - const result = process(this.type, value); - if (result.then) { - promises.push((async function () { - setValue(await result); - })()); - } - else { - setValue(result); - } - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process) { - const promises = []; - const result = [value]; - this.#walkAsync(promises, value, process, (value) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (ParamType.isParamType(obj)) { - return obj; - } - if (typeof obj === "string") { - return ParamType.from(lex(obj), allowIndexed); - } - else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || - obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } - else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - // Check for Array - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - let indexed = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - const name = obj.peekType("ID") ? obj.pop().text : ""; - if (obj.length) { - throw new Error("leftover tokens"); - } - return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - const name = obj.name; - errors.assertArgument(!name || (typeof name === "string" && name.match(regexId)), "invalid name", "obj.name", name); - let indexed = obj.indexed; - if (indexed != null) { - errors.assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type = obj.type; - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components, - }); - return new ParamType(_guard, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - if (type === "tuple" || - type.startsWith("tuple(" /* fix: ) */) || - type.startsWith("(" /* fix: ) */)) { - const comps = obj.components != null - ? obj.components.map((c) => ParamType.from(c)) - : null; - const tuple = new ParamType(_guard, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - type = verifyBasicType(obj.type); - return new ParamType(_guard, name || "", type, type, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return value && value[internal] === ParamTypeInternal; - } -} -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -class Fragment { - /** - * The type of the fragment. - */ - type; - /** - * The inputs for the fragment. - */ - inputs; - /** - * @private - */ - constructor(guard, type, inputs) { - errors.assertPrivate(guard, _guard, "Fragment"); - inputs = Object.freeze(inputs.slice()); - properties.defineProperties(this, { type, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof obj === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } - catch (e) { } - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - const type = obj.peekKeyword(KwTypes); - switch (type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - } - else if (typeof obj === "object") { - // JSON ABI - switch (obj.type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - errors.assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from", - }); - } - errors.assertArgument(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - name; - /** - * @private - */ - constructor(guard, type, name, inputs) { - super(guard, type, inputs); - errors.assertArgument(typeof name === "string" && name.match(regexId), "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - properties.defineProperties(this, { name }); - } -} -function joinParams(format, params) { - return ("(" + - params.map((p) => p.format(format)).join(format === "full" ? ", " : ",") + - ")"); -} -/** - * A Fragment which represents a //Custom Error//. - */ -class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return id.id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ErrorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard, name, inputs); - } - return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal] === ErrorFragmentInternal; - } -} -/** - * A Fragment which represents an Event. - */ -class EventFragment extends NamedFragment { - anonymous; - /** - * @private - */ - constructor(guard, name, inputs, anonymous) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal, { value: EventFragmentInternal }); - properties.defineProperties(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return id.id(this.format("sighash")); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - static getTopicHash(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard, name, params, false); - return fragment.topicHash; - } - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return EventFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard, name, inputs, anonymous); - } - return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); - } - static isFragment(value) { - return value && value[internal] === EventFragmentInternal; - } -} -/** - * A Fragment which represents a constructor. - */ -class ConstructorFragment extends Fragment { - payable; - energy; - /** - * @private - */ - constructor(guard, type, inputs, payable, energy) { - super(guard, type, inputs); - Object.defineProperty(this, internal, { - value: ConstructorFragmentInternal, - }); - properties.defineProperties(this, { payable, energy }); - } - format(format) { - errors.assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: this.payable ? "payable" : "undefined", - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = [`constructor${joinParams(format, this.inputs)}`]; - result.push(this.payable ? "payable" : "nonpayable"); - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - return result.join(" "); - } - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ConstructorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable"); - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard, "constructor", inputs, payable, energy); - } - return new ConstructorFragment(_guard, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal] === ConstructorFragmentInternal; - } -} -/** - * A Fragment which represents a method. - */ -class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - payable; - constructor(guard, inputs, payable) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); - properties.defineProperties(this, { payable }); - } - format(format) { - const type = this.inputs.length === 0 ? "receive" : "fallback"; - if (format === "json") { - const stateMutability = this.payable ? "payable" : "nonpayable"; - return JSON.stringify({ type, stateMutability }); - } - return `${type}()${this.payable ? " payable" : ""}`; - } - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FallbackFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - errors.assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type = obj.popKeyword(setify(["fallback", "receive"])); - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - errors.assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard, [], true); - } - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - errors.assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); - } - else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - errors.assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - errors.assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = obj.stateMutability === "payable"; - return new FallbackFragment(_guard, inputs, payable); - } - errors.assertArgument(false, "invalid fallback description", "obj", obj); - } - static isFragment(value) { - return value && value[internal] === FallbackFragmentInternal; - } -} -/** - * A Fragment which represents a method. - */ -class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - constant; - /** - * The returned types for the result of calling this function. - */ - outputs; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - stateMutability; - /** - * If the function can be sent value during invocation. - */ - payable; - /** - * The amount of energy to send when calling this function - */ - energy; - /** - * @private - */ - constructor(guard, name, stateMutability, inputs, outputs, energy) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = stateMutability === "view" || stateMutability === "pure"; - const payable = stateMutability === "payable"; - properties.defineProperties(this, { - constant, - energy, - outputs, - payable, - stateMutability, - }); - } - /** - * The Function selector. - */ - get selector() { - return id.id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: this.stateMutability !== "nonpayable" - ? this.stateMutability - : undefined, - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - } - return result.join(" "); - } - static getSelector(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard, name, "view", params, [], null); - return fragment.selector; - } - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FunctionFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy); - } - let stateMutability = obj.stateMutability; - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof obj.constant === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } - else if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal] === FunctionFragmentInternal; - } -} -/** - * A Fragment which represents a structure. - */ -class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal, { value: StructFragmentInternal }); - } - format() { - throw new Error("@TODO"); - } - static from(obj) { - if (typeof obj === "string") { - return StructFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard, name, inputs); - } - return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal] === StructFragmentInternal; - } -} - -exports.ConstructorFragment = ConstructorFragment; -exports.ErrorFragment = ErrorFragment; -exports.EventFragment = EventFragment; -exports.FallbackFragment = FallbackFragment; -exports.Fragment = Fragment; -exports.FunctionFragment = FunctionFragment; -exports.NamedFragment = NamedFragment; -exports.ParamType = ParamType; -exports.StructFragment = StructFragment; -//# sourceMappingURL=fragments.js.map diff --git a/lib.commonjs/abi/fragments.js.map b/lib.commonjs/abi/fragments.js.map deleted file mode 100644 index 18d2061ad..000000000 --- a/lib.commonjs/abi/fragments.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.js","sources":["../../lib.esm/abi/fragments.js"],"sourcesContent":["/**\n * About frgaments...\n *\n * @_subsection api/abi/abi-coder:Fragments [about-fragments]\n */\nvar _a;\nimport { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { id } from \"../hash/index.js\";\n// [ \"a\", \"b\" ] => { \"a\": 1, \"b\": 1 }\nfunction setify(items) {\n const result = new Set();\n items.forEach((k) => result.add(k));\n return Object.freeze(result);\n}\n// Visibility Keywords\nconst _kwVisib = \"constant external internal payable private public pure view\";\nconst KwVisib = setify(_kwVisib.split(\" \"));\nconst _kwTypes = \"constructor error event fallback function receive struct\";\nconst KwTypes = setify(_kwTypes.split(\" \"));\nconst _kwModifiers = \"calldata memory storage payable indexed\";\nconst KwModifiers = setify(_kwModifiers.split(\" \"));\nconst _kwOther = \"tuple returns\";\n// All Keywords\nconst _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(\" \");\nconst Keywords = setify(_keywords.split(\" \"));\n// Single character tokens\nconst SimpleTokens = {\n \"(\": \"OPEN_PAREN\",\n \")\": \"CLOSE_PAREN\",\n \"[\": \"OPEN_BRACKET\",\n \"]\": \"CLOSE_BRACKET\",\n \",\": \"COMMA\",\n \"@\": \"AT\",\n};\n// Parser regexes to consume the next token\nconst regexWhitespacePrefix = new RegExp(\"^(\\\\s*)\");\nconst regexNumberPrefix = new RegExp(\"^([0-9]+)\");\nconst regexIdPrefix = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)\");\n// Parser regexs to check validity\nconst regexId = new RegExp(\"^([a-zA-Z$_][a-zA-Z0-9$_]*)$\");\nconst regexType = new RegExp(\"^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$\");\nclass TokenString {\n #offset;\n #tokens;\n get offset() {\n return this.#offset;\n }\n get length() {\n return this.#tokens.length - this.#offset;\n }\n constructor(tokens) {\n this.#offset = 0;\n this.#tokens = tokens.slice();\n }\n clone() {\n return new _a(this.#tokens);\n }\n reset() {\n this.#offset = 0;\n }\n #subTokenString(from = 0, to = 0) {\n return new _a(this.#tokens.slice(from, to).map((t) => {\n return Object.freeze(Object.assign({}, t, {\n match: t.match - from,\n linkBack: t.linkBack - from,\n linkNext: t.linkNext - from,\n }));\n }));\n }\n // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens\n popKeyword(allowed) {\n const top = this.peek();\n if (top.type !== \"KEYWORD\" || !allowed.has(top.text)) {\n throw new Error(`expected keyword ${top.text}`);\n }\n return this.pop().text;\n }\n // Pops and returns the value of the next token if it is `type`; throws if out of tokens\n popType(type) {\n if (this.peek().type !== type) {\n throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`);\n }\n return this.pop().text;\n }\n // Pops and returns a \"(\" TOKENS \")\"\n popParen() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = this.#subTokenString(this.#offset + 1, top.match + 1);\n this.#offset = top.match + 1;\n return result;\n }\n // Pops and returns the items within \"(\" ITEM1 \",\" ITEM2 \",\" ... \")\"\n popParams() {\n const top = this.peek();\n if (top.type !== \"OPEN_PAREN\") {\n throw new Error(\"bad start\");\n }\n const result = [];\n while (this.#offset < top.match - 1) {\n const link = this.peek().linkNext;\n result.push(this.#subTokenString(this.#offset + 1, link));\n this.#offset = link;\n }\n this.#offset = top.match + 1;\n return result;\n }\n // Returns the top Token, throwing if out of tokens\n peek() {\n if (this.#offset >= this.#tokens.length) {\n throw new Error(\"out-of-bounds\");\n }\n return this.#tokens[this.#offset];\n }\n // Returns the next value, if it is a keyword in `allowed`\n peekKeyword(allowed) {\n const top = this.peekType(\"KEYWORD\");\n return top != null && allowed.has(top) ? top : null;\n }\n // Returns the value of the next token if it is `type`\n peekType(type) {\n if (this.length === 0) {\n return null;\n }\n const top = this.peek();\n return top.type === type ? top.text : null;\n }\n // Returns the next token; throws if out of tokens\n pop() {\n const result = this.peek();\n this.#offset++;\n return result;\n }\n toString() {\n const tokens = [];\n for (let i = this.#offset; i < this.#tokens.length; i++) {\n const token = this.#tokens[i];\n tokens.push(`${token.type}:${token.text}`);\n }\n return ``;\n }\n}\n_a = TokenString;\nfunction lex(text) {\n const tokens = [];\n const throwError = (message) => {\n const token = offset < text.length ? JSON.stringify(text[offset]) : \"$EOI\";\n throw new Error(`invalid token ${token} at ${offset}: ${message}`);\n };\n let brackets = [];\n let commas = [];\n let offset = 0;\n while (offset < text.length) {\n // Strip off any leading whitespace\n let cur = text.substring(offset);\n let match = cur.match(regexWhitespacePrefix);\n if (match) {\n offset += match[1].length;\n cur = text.substring(offset);\n }\n const token = {\n depth: brackets.length,\n linkBack: -1,\n linkNext: -1,\n match: -1,\n type: \"\",\n text: \"\",\n offset,\n value: -1,\n };\n tokens.push(token);\n let type = SimpleTokens[cur[0]] || \"\";\n if (type) {\n token.type = type;\n token.text = cur[0];\n offset++;\n if (type === \"OPEN_PAREN\") {\n brackets.push(tokens.length - 1);\n commas.push(tokens.length - 1);\n }\n else if (type == \"CLOSE_PAREN\") {\n if (brackets.length === 0) {\n throwError(\"no matching open bracket\");\n }\n token.match = brackets.pop();\n tokens[token.match].match = tokens.length - 1;\n token.depth--;\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n }\n else if (type === \"COMMA\") {\n token.linkBack = commas.pop();\n tokens[token.linkBack].linkNext = tokens.length - 1;\n commas.push(tokens.length - 1);\n }\n else if (type === \"OPEN_BRACKET\") {\n token.type = \"BRACKET\";\n }\n else if (type === \"CLOSE_BRACKET\") {\n // Remove the CLOSE_BRACKET\n let suffix = tokens.pop().text;\n if (tokens.length > 0 && tokens[tokens.length - 1].type === \"NUMBER\") {\n const value = tokens.pop().text;\n suffix = value + suffix;\n tokens[tokens.length - 1].value =\n getNumber(value);\n }\n if (tokens.length === 0 ||\n tokens[tokens.length - 1].type !== \"BRACKET\") {\n throw new Error(\"missing opening bracket\");\n }\n tokens[tokens.length - 1].text += suffix;\n }\n continue;\n }\n match = cur.match(regexIdPrefix);\n if (match) {\n token.text = match[1];\n offset += token.text.length;\n if (Keywords.has(token.text)) {\n token.type = \"KEYWORD\";\n continue;\n }\n if (token.text.match(regexType)) {\n token.type = \"TYPE\";\n continue;\n }\n token.type = \"ID\";\n continue;\n }\n match = cur.match(regexNumberPrefix);\n if (match) {\n token.text = match[1];\n token.type = \"NUMBER\";\n offset += token.text.length;\n continue;\n }\n throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`);\n }\n return new TokenString(tokens.map((t) => Object.freeze(t)));\n}\n// Check only one of `allowed` is in `set`\nfunction allowSingle(set, allowed) {\n let included = [];\n for (const key in allowed.keys()) {\n if (set.has(key)) {\n included.push(key);\n }\n }\n if (included.length > 1) {\n throw new Error(`conflicting types: ${included.join(\", \")}`);\n }\n}\n// Functions to process a Solidity Signature TokenString from left-to-right for...\n// ...the name with an optional type, returning the name\nfunction consumeName(type, tokens) {\n if (tokens.peekKeyword(KwTypes)) {\n const keyword = tokens.pop().text;\n if (keyword !== type) {\n throw new Error(`expected ${type}, got ${keyword}`);\n }\n }\n return tokens.popType(\"ID\");\n}\n// ...all keywords matching allowed, returning the keywords\nfunction consumeKeywords(tokens, allowed) {\n const keywords = new Set();\n while (true) {\n const keyword = tokens.peekType(\"KEYWORD\");\n if (keyword == null || (allowed && !allowed.has(keyword))) {\n break;\n }\n tokens.pop();\n if (keywords.has(keyword)) {\n throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`);\n }\n keywords.add(keyword);\n }\n return Object.freeze(keywords);\n}\n// ...all visibility keywords, returning the coalesced mutability\nfunction consumeMutability(tokens) {\n let modifiers = consumeKeywords(tokens, KwVisib);\n // Detect conflicting modifiers\n allowSingle(modifiers, setify(\"constant payable nonpayable\".split(\" \")));\n allowSingle(modifiers, setify(\"pure view payable nonpayable\".split(\" \")));\n // Process mutability states\n if (modifiers.has(\"view\")) {\n return \"view\";\n }\n if (modifiers.has(\"pure\")) {\n return \"pure\";\n }\n if (modifiers.has(\"payable\")) {\n return \"payable\";\n }\n if (modifiers.has(\"nonpayable\")) {\n return \"nonpayable\";\n }\n // Process legacy `constant` last\n if (modifiers.has(\"constant\")) {\n return \"view\";\n }\n return \"nonpayable\";\n}\n// ...a parameter list, returning the ParamType list\nfunction consumeParams(tokens, allowIndexed) {\n return tokens.popParams().map((t) => ParamType.from(t, allowIndexed));\n}\n// ...a energy limit, returning a BigNumber or null if none\nfunction consumeEnergy(tokens) {\n if (tokens.peekType(\"AT\")) {\n tokens.pop();\n if (tokens.peekType(\"NUMBER\")) {\n return getBigInt(tokens.pop().text);\n }\n throw new Error(\"invalid energy\");\n }\n return null;\n}\nfunction consumeEoi(tokens) {\n if (tokens.length) {\n throw new Error(`unexpected tokens: ${tokens.toString()}`);\n }\n}\nconst regexArrayType = new RegExp(/^(.*)\\[([0-9]*)\\]$/);\nfunction verifyBasicType(type) {\n const match = type.match(regexType);\n assertArgument(match, \"invalid type\", \"type\", type);\n if (type === \"uint\") {\n return \"uint256\";\n }\n if (type === \"int\") {\n return \"int256\";\n }\n if (match[2]) {\n // bytesXX\n const length = parseInt(match[2]);\n assertArgument(length !== 0 && length <= 32, \"invalid bytes length\", \"type\", type);\n }\n else if (match[3]) {\n // intXX or uintXX\n const size = parseInt(match[3]);\n assertArgument(size !== 0 && size <= 256 && size % 8 === 0, \"invalid numeric width\", \"type\", type);\n }\n return type;\n}\n// Make the Fragment constructors effectively private\nconst _guard = {};\nconst internal = Symbol.for(\"_corebc_internal\");\nconst ParamTypeInternal = \"_ParamTypeInternal\";\nconst ErrorFragmentInternal = \"_ErrorInternal\";\nconst EventFragmentInternal = \"_EventInternal\";\nconst ConstructorFragmentInternal = \"_ConstructorInternal\";\nconst FallbackFragmentInternal = \"_FallbackInternal\";\nconst FunctionFragmentInternal = \"_FunctionInternal\";\nconst StructFragmentInternal = \"_StructInternal\";\n/**\n * Each input and output of a [[Fragment]] is an Array of **PAramType**.\n */\nexport class ParamType {\n /**\n * The local name of the parameter (or ``\"\"`` if unbound)\n */\n name;\n /**\n * The fully qualified type (e.g. ``\"address\"``, ``\"tuple(address)\"``,\n * ``\"uint256[3][]\"``)\n */\n type;\n /**\n * The base type (e.g. ``\"address\"``, ``\"tuple\"``, ``\"array\"``)\n */\n baseType;\n /**\n * True if the parameters is indexed.\n *\n * For non-indexable types this is ``null``.\n */\n indexed;\n /**\n * The components for the tuple.\n *\n * For non-tuple types this is ``null``.\n */\n components;\n /**\n * The array length, or ``-1`` for dynamic-lengthed arrays.\n *\n * For non-array types this is ``null``.\n */\n arrayLength;\n /**\n * The type of each child in the array.\n *\n * For non-array types this is ``null``.\n */\n arrayChildren;\n /**\n * @private\n */\n constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) {\n assertPrivate(guard, _guard, \"ParamType\");\n Object.defineProperty(this, internal, { value: ParamTypeInternal });\n if (components) {\n components = Object.freeze(components.slice());\n }\n if (baseType === \"array\") {\n if (arrayLength == null || arrayChildren == null) {\n throw new Error(\"\");\n }\n }\n else if (arrayLength != null || arrayChildren != null) {\n throw new Error(\"\");\n }\n if (baseType === \"tuple\") {\n if (components == null) {\n throw new Error(\"\");\n }\n }\n else if (components != null) {\n throw new Error(\"\");\n }\n defineProperties(this, {\n name,\n type,\n baseType,\n indexed,\n components,\n arrayLength,\n arrayChildren,\n });\n }\n /**\n * Return a string representation of this type.\n *\n * For example,\n *\n * ``sighash\" => \"(uint256,address)\"``\n *\n * ``\"minimal\" => \"tuple(uint256,address) indexed\"``\n *\n * ``\"full\" => \"tuple(uint256 foo, address bar) indexed baz\"``\n */\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n let result = {\n type: this.baseType === \"tuple\" ? \"tuple\" : this.type,\n name: this.name || undefined,\n };\n if (typeof this.indexed === \"boolean\") {\n result.indexed = this.indexed;\n }\n if (this.isTuple()) {\n result.components = this.components.map((c) => JSON.parse(c.format(format)));\n }\n return JSON.stringify(result);\n }\n let result = \"\";\n // Array\n if (this.isArray()) {\n result += this.arrayChildren.format(format);\n result += `[${this.arrayLength < 0 ? \"\" : String(this.arrayLength)}]`;\n }\n else {\n if (this.isTuple()) {\n if (format !== \"sighash\") {\n result += this.type;\n }\n result +=\n \"(\" +\n this.components\n .map((comp) => comp.format(format))\n .join(format === \"full\" ? \", \" : \",\") +\n \")\";\n }\n else {\n result += this.type;\n }\n }\n if (format !== \"sighash\") {\n if (this.indexed === true) {\n result += \" indexed\";\n }\n if (format === \"full\" && this.name) {\n result += \" \" + this.name;\n }\n }\n return result;\n }\n /*\n * Returns true if %%value%% is an Array type.\n *\n * This provides a type gaurd ensuring that the\n * [[arrayChildren]] and [[arrayLength]] are non-null.\n */\n //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } {\n // return value && (value.baseType === \"array\")\n //}\n /**\n * Returns true if %%this%% is an Array type.\n *\n * This provides a type gaurd ensuring that [[arrayChildren]]\n * and [[arrayLength]] are non-null.\n */\n isArray() {\n return this.baseType === \"array\";\n }\n /**\n * Returns true if %%this%% is a Tuple type.\n *\n * This provides a type gaurd ensuring that [[components]]\n * is non-null.\n */\n isTuple() {\n return this.baseType === \"tuple\";\n }\n /**\n * Returns true if %%this%% is an Indexable type.\n *\n * This provides a type gaurd ensuring that [[indexed]]\n * is non-null.\n */\n isIndexable() {\n return this.indexed != null;\n }\n /**\n * Walks the **ParamType** with %%value%%, calling %%process%%\n * on each type, destructing the %%value%% recursively.\n */\n walk(value, process) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v) => _this.arrayChildren.walk(v, process));\n }\n if (this.isTuple()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid tuple value\");\n }\n if (value.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n const _this = this;\n return value.map((v, i) => _this.components[i].walk(v, process));\n }\n return process(this.type, value);\n }\n #walkAsync(promises, value, process, setValue) {\n if (this.isArray()) {\n if (!Array.isArray(value)) {\n throw new Error(\"invalid array value\");\n }\n if (this.arrayLength !== -1 && value.length !== this.arrayLength) {\n throw new Error(\"array is wrong length\");\n }\n const childType = this.arrayChildren;\n const result = value.slice();\n result.forEach((value, index) => {\n childType.#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n if (this.isTuple()) {\n const components = this.components;\n // Convert the object into an array\n let result;\n if (Array.isArray(value)) {\n result = value.slice();\n }\n else {\n if (value == null || typeof value !== \"object\") {\n throw new Error(\"invalid tuple value\");\n }\n result = components.map((param) => {\n if (!param.name) {\n throw new Error(\"cannot use object value with unnamed components\");\n }\n if (!(param.name in value)) {\n throw new Error(`missing value for component ${param.name}`);\n }\n return value[param.name];\n });\n }\n if (result.length !== this.components.length) {\n throw new Error(\"array is wrong length\");\n }\n result.forEach((value, index) => {\n components[index].#walkAsync(promises, value, process, (value) => {\n result[index] = value;\n });\n });\n setValue(result);\n return;\n }\n const result = process(this.type, value);\n if (result.then) {\n promises.push((async function () {\n setValue(await result);\n })());\n }\n else {\n setValue(result);\n }\n }\n /**\n * Walks the **ParamType** with %%value%%, asynchronously calling\n * %%process%% on each type, destructing the %%value%% recursively.\n *\n * This can be used to resolve ENS naes by walking and resolving each\n * ``\"address\"`` type.\n */\n async walkAsync(value, process) {\n const promises = [];\n const result = [value];\n this.#walkAsync(promises, value, process, (value) => {\n result[0] = value;\n });\n if (promises.length) {\n await Promise.all(promises);\n }\n return result[0];\n }\n /**\n * Creates a new **ParamType** for %%obj%%.\n *\n * If %%allowIndexed%% then the ``indexed`` keyword is permitted,\n * otherwise the ``indexed`` keyword will throw an error.\n */\n static from(obj, allowIndexed) {\n if (ParamType.isParamType(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ParamType.from(lex(obj), allowIndexed);\n }\n else if (obj instanceof TokenString) {\n let type = \"\", baseType = \"\";\n let comps = null;\n if (consumeKeywords(obj, setify([\"tuple\"])).has(\"tuple\") ||\n obj.peekType(\"OPEN_PAREN\")) {\n // Tuple\n baseType = \"tuple\";\n comps = obj.popParams().map((t) => ParamType.from(t));\n type = `tuple(${comps.map((c) => c.format()).join(\",\")})`;\n }\n else {\n // Normal\n type = verifyBasicType(obj.popType(\"TYPE\"));\n baseType = type;\n }\n // Check for Array\n let arrayChildren = null;\n let arrayLength = null;\n while (obj.length && obj.peekType(\"BRACKET\")) {\n const bracket = obj.pop(); //arrays[i];\n arrayChildren = new ParamType(_guard, \"\", type, baseType, null, comps, arrayLength, arrayChildren);\n arrayLength = bracket.value;\n type += bracket.text;\n baseType = \"array\";\n comps = null;\n }\n let indexed = null;\n const keywords = consumeKeywords(obj, KwModifiers);\n if (keywords.has(\"indexed\")) {\n if (!allowIndexed) {\n throw new Error(\"\");\n }\n indexed = true;\n }\n const name = obj.peekType(\"ID\") ? obj.pop().text : \"\";\n if (obj.length) {\n throw new Error(\"leftover tokens\");\n }\n return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren);\n }\n const name = obj.name;\n assertArgument(!name || (typeof name === \"string\" && name.match(regexId)), \"invalid name\", \"obj.name\", name);\n let indexed = obj.indexed;\n if (indexed != null) {\n assertArgument(allowIndexed, \"parameter cannot be indexed\", \"obj.indexed\", obj.indexed);\n indexed = !!indexed;\n }\n let type = obj.type;\n let arrayMatch = type.match(regexArrayType);\n if (arrayMatch) {\n const arrayLength = parseInt(arrayMatch[2] || \"-1\");\n const arrayChildren = ParamType.from({\n type: arrayMatch[1],\n components: obj.components,\n });\n return new ParamType(_guard, name || \"\", type, \"array\", indexed, null, arrayLength, arrayChildren);\n }\n if (type === \"tuple\" ||\n type.startsWith(\"tuple(\" /* fix: ) */) ||\n type.startsWith(\"(\" /* fix: ) */)) {\n const comps = obj.components != null\n ? obj.components.map((c) => ParamType.from(c))\n : null;\n const tuple = new ParamType(_guard, name || \"\", type, \"tuple\", indexed, comps, null, null);\n // @TODO: use lexer to validate and normalize type\n return tuple;\n }\n type = verifyBasicType(obj.type);\n return new ParamType(_guard, name || \"\", type, type, indexed, null, null, null);\n }\n /**\n * Returns true if %%value%% is a **ParamType**.\n */\n static isParamType(value) {\n return value && value[internal] === ParamTypeInternal;\n }\n}\n/**\n * An abstract class to represent An individual fragment from a parse ABI.\n */\nexport class Fragment {\n /**\n * The type of the fragment.\n */\n type;\n /**\n * The inputs for the fragment.\n */\n inputs;\n /**\n * @private\n */\n constructor(guard, type, inputs) {\n assertPrivate(guard, _guard, \"Fragment\");\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { type, inputs });\n }\n /**\n * Creates a new **Fragment** for %%obj%%, wich can be any supported\n * ABI frgament type.\n */\n static from(obj) {\n if (typeof obj === \"string\") {\n // Try parsing JSON...\n try {\n Fragment.from(JSON.parse(obj));\n }\n catch (e) { }\n // ...otherwise, use the human-readable lexer\n return Fragment.from(lex(obj));\n }\n if (obj instanceof TokenString) {\n // Human-readable ABI (already lexed)\n const type = obj.peekKeyword(KwTypes);\n switch (type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n }\n else if (typeof obj === \"object\") {\n // JSON ABI\n switch (obj.type) {\n case \"constructor\":\n return ConstructorFragment.from(obj);\n case \"error\":\n return ErrorFragment.from(obj);\n case \"event\":\n return EventFragment.from(obj);\n case \"fallback\":\n case \"receive\":\n return FallbackFragment.from(obj);\n case \"function\":\n return FunctionFragment.from(obj);\n case \"struct\":\n return StructFragment.from(obj);\n }\n assert(false, `unsupported type: ${obj.type}`, \"UNSUPPORTED_OPERATION\", {\n operation: \"Fragment.from\",\n });\n }\n assertArgument(false, \"unsupported frgament object\", \"obj\", obj);\n }\n /**\n * Returns true if %%value%% is a [[ConstructorFragment]].\n */\n static isConstructor(value) {\n return ConstructorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[ErrorFragment]].\n */\n static isError(value) {\n return ErrorFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is an [[EventFragment]].\n */\n static isEvent(value) {\n return EventFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[FunctionFragment]].\n */\n static isFunction(value) {\n return FunctionFragment.isFragment(value);\n }\n /**\n * Returns true if %%value%% is a [[StructFragment]].\n */\n static isStruct(value) {\n return StructFragment.isFragment(value);\n }\n}\n/**\n * An abstract class to represent An individual fragment\n * which has a name from a parse ABI.\n */\nexport class NamedFragment extends Fragment {\n /**\n * The name of the fragment.\n */\n name;\n /**\n * @private\n */\n constructor(guard, type, name, inputs) {\n super(guard, type, inputs);\n assertArgument(typeof name === \"string\" && name.match(regexId), \"invalid identifier\", \"name\", name);\n inputs = Object.freeze(inputs.slice());\n defineProperties(this, { name });\n }\n}\nfunction joinParams(format, params) {\n return (\"(\" +\n params.map((p) => p.format(format)).join(format === \"full\" ? \", \" : \",\") +\n \")\");\n}\n/**\n * A Fragment which represents a //Custom Error//.\n */\nexport class ErrorFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"error\", name, inputs);\n Object.defineProperty(this, internal, { value: ErrorFragmentInternal });\n }\n /**\n * The Custom Error selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"error\",\n name: this.name,\n inputs: this.inputs.map((input) => JSON.parse(input.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"error\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n return result.join(\" \");\n }\n static from(obj) {\n if (ErrorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ErrorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"error\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new ErrorFragment(_guard, name, inputs);\n }\n return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === ErrorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents an Event.\n */\nexport class EventFragment extends NamedFragment {\n anonymous;\n /**\n * @private\n */\n constructor(guard, name, inputs, anonymous) {\n super(guard, \"event\", name, inputs);\n Object.defineProperty(this, internal, { value: EventFragmentInternal });\n defineProperties(this, { anonymous });\n }\n /**\n * The Event topic hash.\n */\n get topicHash() {\n return id(this.format(\"sighash\"));\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"event\",\n anonymous: this.anonymous,\n name: this.name,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"event\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\" && this.anonymous) {\n result.push(\"anonymous\");\n }\n return result.join(\" \");\n }\n static getTopicHash(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new EventFragment(_guard, name, params, false);\n return fragment.topicHash;\n }\n static from(obj) {\n if (EventFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return EventFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"event\", obj);\n const inputs = consumeParams(obj, true);\n const anonymous = !!consumeKeywords(obj, setify([\"anonymous\"])).has(\"anonymous\");\n consumeEoi(obj);\n return new EventFragment(_guard, name, inputs, anonymous);\n }\n return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous);\n }\n static isFragment(value) {\n return value && value[internal] === EventFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a constructor.\n */\nexport class ConstructorFragment extends Fragment {\n payable;\n energy;\n /**\n * @private\n */\n constructor(guard, type, inputs, payable, energy) {\n super(guard, type, inputs);\n Object.defineProperty(this, internal, {\n value: ConstructorFragmentInternal,\n });\n defineProperties(this, { payable, energy });\n }\n format(format) {\n assert(format != null && format !== \"sighash\", \"cannot format a constructor for sighash\", \"UNSUPPORTED_OPERATION\", { operation: \"format(sighash)\" });\n if (format === \"json\") {\n return JSON.stringify({\n type: \"constructor\",\n stateMutability: this.payable ? \"payable\" : \"undefined\",\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n });\n }\n const result = [`constructor${joinParams(format, this.inputs)}`];\n result.push(this.payable ? \"payable\" : \"nonpayable\");\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n return result.join(\" \");\n }\n static from(obj) {\n if (ConstructorFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return ConstructorFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n consumeKeywords(obj, setify([\"constructor\"]));\n const inputs = consumeParams(obj);\n const payable = !!consumeKeywords(obj, setify([\"payable\"])).has(\"payable\");\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new ConstructorFragment(_guard, \"constructor\", inputs, payable, energy);\n }\n return new ConstructorFragment(_guard, \"constructor\", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === ConstructorFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FallbackFragment extends Fragment {\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n constructor(guard, inputs, payable) {\n super(guard, \"fallback\", inputs);\n Object.defineProperty(this, internal, { value: FallbackFragmentInternal });\n defineProperties(this, { payable });\n }\n format(format) {\n const type = this.inputs.length === 0 ? \"receive\" : \"fallback\";\n if (format === \"json\") {\n const stateMutability = this.payable ? \"payable\" : \"nonpayable\";\n return JSON.stringify({ type, stateMutability });\n }\n return `${type}()${this.payable ? \" payable\" : \"\"}`;\n }\n static from(obj) {\n if (FallbackFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FallbackFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const errorObj = obj.toString();\n const topIsValid = obj.peekKeyword(setify([\"fallback\", \"receive\"]));\n assertArgument(topIsValid, \"type must be fallback or receive\", \"obj\", errorObj);\n const type = obj.popKeyword(setify([\"fallback\", \"receive\"]));\n // receive()\n if (type === \"receive\") {\n const inputs = consumeParams(obj);\n assertArgument(inputs.length === 0, `receive cannot have arguments`, \"obj.inputs\", inputs);\n consumeKeywords(obj, setify([\"payable\"]));\n consumeEoi(obj);\n return new FallbackFragment(_guard, [], true);\n }\n // fallback() [payable]\n // fallback(bytes) [payable] returns (bytes)\n let inputs = consumeParams(obj);\n if (inputs.length) {\n assertArgument(inputs.length === 1 && inputs[0].type === \"bytes\", \"invalid fallback inputs\", \"obj.inputs\", inputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n else {\n inputs = [ParamType.from(\"bytes\")];\n }\n const mutability = consumeMutability(obj);\n assertArgument(mutability === \"nonpayable\" || mutability === \"payable\", \"fallback cannot be constants\", \"obj.stateMutability\", mutability);\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n const outputs = consumeParams(obj);\n assertArgument(outputs.length === 1 && outputs[0].type === \"bytes\", \"invalid fallback outputs\", \"obj.outputs\", outputs.map((i) => i.format(\"minimal\")).join(\", \"));\n }\n consumeEoi(obj);\n return new FallbackFragment(_guard, inputs, mutability === \"payable\");\n }\n if (obj.type === \"receive\") {\n return new FallbackFragment(_guard, [], true);\n }\n if (obj.type === \"fallback\") {\n const inputs = [ParamType.from(\"bytes\")];\n const payable = obj.stateMutability === \"payable\";\n return new FallbackFragment(_guard, inputs, payable);\n }\n assertArgument(false, \"invalid fallback description\", \"obj\", obj);\n }\n static isFragment(value) {\n return value && value[internal] === FallbackFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a method.\n */\nexport class FunctionFragment extends NamedFragment {\n /**\n * If the function is constant (e.g. ``pure`` or ``view`` functions).\n */\n constant;\n /**\n * The returned types for the result of calling this function.\n */\n outputs;\n /**\n * The state mutability (e.g. ``payable``, ``nonpayable``, ``view``\n * or ``pure``)\n */\n stateMutability;\n /**\n * If the function can be sent value during invocation.\n */\n payable;\n /**\n * The amount of energy to send when calling this function\n */\n energy;\n /**\n * @private\n */\n constructor(guard, name, stateMutability, inputs, outputs, energy) {\n super(guard, \"function\", name, inputs);\n Object.defineProperty(this, internal, { value: FunctionFragmentInternal });\n outputs = Object.freeze(outputs.slice());\n const constant = stateMutability === \"view\" || stateMutability === \"pure\";\n const payable = stateMutability === \"payable\";\n defineProperties(this, {\n constant,\n energy,\n outputs,\n payable,\n stateMutability,\n });\n }\n /**\n * The Function selector.\n */\n get selector() {\n return id(this.format(\"sighash\")).substring(0, 10);\n }\n format(format) {\n if (format == null) {\n format = \"sighash\";\n }\n if (format === \"json\") {\n return JSON.stringify({\n type: \"function\",\n name: this.name,\n constant: this.constant,\n stateMutability: this.stateMutability !== \"nonpayable\"\n ? this.stateMutability\n : undefined,\n payable: this.payable,\n energy: this.energy != null ? this.energy : undefined,\n inputs: this.inputs.map((i) => JSON.parse(i.format(format))),\n outputs: this.outputs.map((o) => JSON.parse(o.format(format))),\n });\n }\n const result = [];\n if (format !== \"sighash\") {\n result.push(\"function\");\n }\n result.push(this.name + joinParams(format, this.inputs));\n if (format !== \"sighash\") {\n if (this.stateMutability !== \"nonpayable\") {\n result.push(this.stateMutability);\n }\n if (this.outputs && this.outputs.length) {\n result.push(\"returns\");\n result.push(joinParams(format, this.outputs));\n }\n if (this.energy != null) {\n result.push(`@${this.energy.toString()}`);\n }\n }\n return result.join(\" \");\n }\n static getSelector(name, params) {\n params = (params || []).map((p) => ParamType.from(p));\n const fragment = new FunctionFragment(_guard, name, \"view\", params, [], null);\n return fragment.selector;\n }\n static from(obj) {\n if (FunctionFragment.isFragment(obj)) {\n return obj;\n }\n if (typeof obj === \"string\") {\n return FunctionFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"function\", obj);\n const inputs = consumeParams(obj);\n const mutability = consumeMutability(obj);\n let outputs = [];\n if (consumeKeywords(obj, setify([\"returns\"])).has(\"returns\")) {\n outputs = consumeParams(obj);\n }\n const energy = consumeEnergy(obj);\n consumeEoi(obj);\n return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy);\n }\n let stateMutability = obj.stateMutability;\n // Use legacy Solidity ABI logic if stateMutability is missing\n if (stateMutability == null) {\n stateMutability = \"payable\";\n if (typeof obj.constant === \"boolean\") {\n stateMutability = \"view\";\n if (!obj.constant) {\n stateMutability = \"payable\";\n if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n }\n else if (typeof obj.payable === \"boolean\" && !obj.payable) {\n stateMutability = \"nonpayable\";\n }\n }\n // @TODO: verifyState for stateMutability (e.g. throw if\n // payable: false but stateMutability is \"nonpayable\")\n return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null);\n }\n static isFragment(value) {\n return value && value[internal] === FunctionFragmentInternal;\n }\n}\n/**\n * A Fragment which represents a structure.\n */\nexport class StructFragment extends NamedFragment {\n /**\n * @private\n */\n constructor(guard, name, inputs) {\n super(guard, \"struct\", name, inputs);\n Object.defineProperty(this, internal, { value: StructFragmentInternal });\n }\n format() {\n throw new Error(\"@TODO\");\n }\n static from(obj) {\n if (typeof obj === \"string\") {\n return StructFragment.from(lex(obj));\n }\n else if (obj instanceof TokenString) {\n const name = consumeName(\"struct\", obj);\n const inputs = consumeParams(obj);\n consumeEoi(obj);\n return new StructFragment(_guard, name, inputs);\n }\n return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []);\n }\n static isFragment(value) {\n return value && value[internal] === StructFragmentInternal;\n }\n}\n//# sourceMappingURL=fragments.js.map"],"names":["getNumber","getBigInt","assertArgument","assertPrivate","defineProperties","assert","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,IAAI,EAAE;AAGN;AACA,SAAS,MAAM,CAAC,KA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AsB;AAClE,IAAI;AACJ;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/index.d.ts b/lib.commonjs/abi/index.d.ts deleted file mode 100644 index ce0ddb016..000000000 --- a/lib.commonjs/abi/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Explain about ABI here... - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ -export { AbiCoder } from "./abi-coder.js"; -export { decodeBytes32String, encodeBytes32String } from "./bytes32.js"; -export { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from "./fragments.js"; -export { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result, } from "./interface.js"; -export { Typed } from "./typed.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, ParamTypeWalkAsyncFunc, ParamTypeWalkFunc, } from "./fragments.js"; -export type { InterfaceAbi } from "./interface.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/index.d.ts.map b/lib.commonjs/abi/index.d.ts.map deleted file mode 100644 index a3a6ec0b1..000000000 --- a/lib.commonjs/abi/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/abi/index.js b/lib.commonjs/abi/index.js deleted file mode 100644 index 65a69af46..000000000 --- a/lib.commonjs/abi/index.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -var abiCoder = require('./abi-coder.js'); -var bytes32 = require('./bytes32.js'); -var fragments = require('./fragments.js'); -var _interface = require('./interface.js'); -var typed = require('./typed.js'); -var abstractCoder = require('./coders/abstract-coder.js'); - - - -exports.AbiCoder = abiCoder.AbiCoder; -exports.decodeBytes32String = bytes32.decodeBytes32String; -exports.encodeBytes32String = bytes32.encodeBytes32String; -exports.ConstructorFragment = fragments.ConstructorFragment; -exports.ErrorFragment = fragments.ErrorFragment; -exports.EventFragment = fragments.EventFragment; -exports.FallbackFragment = fragments.FallbackFragment; -exports.Fragment = fragments.Fragment; -exports.FunctionFragment = fragments.FunctionFragment; -exports.NamedFragment = fragments.NamedFragment; -exports.ParamType = fragments.ParamType; -exports.StructFragment = fragments.StructFragment; -exports.ErrorDescription = _interface.ErrorDescription; -exports.Indexed = _interface.Indexed; -exports.Interface = _interface.Interface; -exports.LogDescription = _interface.LogDescription; -exports.TransactionDescription = _interface.TransactionDescription; -exports.Typed = typed.Typed; -exports.Result = abstractCoder.Result; -exports.checkResultErrors = abstractCoder.checkResultErrors; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/abi/index.js.map b/lib.commonjs/abi/index.js.map deleted file mode 100644 index fee1d887a..000000000 --- a/lib.commonjs/abi/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/interface.d.ts b/lib.commonjs/abi/interface.d.ts deleted file mode 100644 index 62b24ebe4..000000000 --- a/lib.commonjs/abi/interface.d.ts +++ /dev/null @@ -1,270 +0,0 @@ -/** - * About Interface - * - * @_subsection api/abi:Interfaces [interfaces] - */ -import { AbiCoder } from "./abi-coder.js"; -import { checkResultErrors, Result } from "./coders/abstract-coder.js"; -import { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, ParamType } from "./fragments.js"; -import { Typed } from "./typed.js"; -import type { BigNumberish, BytesLike, CallExceptionError, CallExceptionTransaction } from "../utils/index.js"; -import type { JsonFragment } from "./fragments.js"; -export { checkResultErrors, Result }; -export declare class LogDescription { - readonly fragment: EventFragment; - readonly name: string; - readonly signature: string; - readonly topic: string; - readonly args: Result; - constructor(fragment: EventFragment, topic: string, args: Result); -} -export declare class TransactionDescription { - readonly fragment: FunctionFragment; - readonly name: string; - readonly args: Result; - readonly signature: string; - readonly selector: string; - readonly value: bigint; - constructor(fragment: FunctionFragment, selector: string, args: Result, value: bigint); -} -export declare class ErrorDescription { - readonly fragment: ErrorFragment; - readonly name: string; - readonly args: Result; - readonly signature: string; - readonly selector: string; - constructor(fragment: ErrorFragment, selector: string, args: Result); -} -export declare class Indexed { - readonly hash: null | string; - readonly _isIndexed: boolean; - static isIndexed(value: any): value is Indexed; - constructor(hash: null | string); -} -/** - * @TODO - */ -export type InterfaceAbi = string | ReadonlyArray; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -export declare class Interface { - #private; - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - readonly fragments: ReadonlyArray; - /** - * The Contract constructor. - */ - readonly deploy: ConstructorFragment; - /** - * The Fallback method, if any. - */ - readonly fallback: null | FallbackFragment; - /** - * If receiving xcb is supported. - */ - readonly receive: boolean; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments: InterfaceAbi); - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal?: boolean): Array; - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson(): string; - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder(): AbiCoder; - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key: string): string; - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key: string): boolean; - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key: string, values?: Array): null | FunctionFragment; - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback: (func: FunctionFragment, index: number) => void): void; - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key: string): string; - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key: string): boolean; - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key: string, values?: Array): null | EventFragment; - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback: (func: EventFragment, index: number) => void): void; - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key: string, values?: Array): null | ErrorFragment; - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback: (func: ErrorFragment, index: number) => void): void; - _decodeParams(params: ReadonlyArray, data: BytesLike): Result; - _encodeParams(params: ReadonlyArray, values: ReadonlyArray): string; - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result; - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment: FunctionFragment | string, data: BytesLike): Result; - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment: FunctionFragment | string, data: BytesLike): Result; - makeError(_data: BytesLike, tx: CallExceptionTransaction): CallExceptionError; - /** - * Encodes the result data (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - encodeFilterTopics(fragment: EventFragment | string, values: ReadonlyArray): Array>; - encodeEventLog(fragment: EventFragment | string, values: ReadonlyArray): { - data: string; - topics: Array; - }; - decodeEventLog(fragment: EventFragment | string, data: BytesLike, topics?: ReadonlyArray): Result; - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx: { - data: string; - value?: BigNumberish; - }): null | TransactionDescription; - parseCallResult(data: BytesLike): Result; - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log: { - topics: Array; - data: string; - }): null | LogDescription; - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data: BytesLike): null | ErrorDescription; - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value: InterfaceAbi | Interface): Interface; -} -//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/interface.d.ts.map b/lib.commonjs/abi/interface.d.ts.map deleted file mode 100644 index d7d096cce..000000000 --- a/lib.commonjs/abi/interface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,EAAE,QAAQ,EAAE,MA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AI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,CA8CzC;IAGD,cAAc,CACb,QAAQ,EAAE,aAAa,GAAG,MAAM,EAChC,IAAI,EAAE,SAAS,EACf,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAC5B,MAAM,CA8ER;IAED;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,YAAY,CAAC;KACrB,GAAG,IAAI,GAAG,sBAAsB,CAYhC;IAED,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEvC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;KACb,GAAG,IAAI,GAAG,cAAc,CAgBxB;IAED;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,gBAAgB,CAWnD;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAkBtD;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/interface.js b/lib.commonjs/abi/interface.js deleted file mode 100644 index 209138071..000000000 --- a/lib.commonjs/abi/interface.js +++ /dev/null @@ -1,1065 +0,0 @@ -'use strict'; - -var id = require('../hash/id.js'); -require('../constants/numbers.js'); -require('../address/index.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -var sha3 = require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../logger/logger.js'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -var abiCoder = require('./abi-coder.js'); -var abstractCoder = require('./coders/abstract-coder.js'); -var fragments = require('./fragments.js'); -var typed = require('./typed.js'); - -/** - * About Interface - * - * @_subsection api/abi:Interfaces [interfaces] - */ -class LogDescription { - fragment; - name; - signature; - topic; - args; - constructor(fragment, topic, args) { - const name = fragment.name, signature = fragment.format(); - properties.defineProperties(this, { - fragment, - name, - signature, - topic, - args, - }); - } -} -class TransactionDescription { - fragment; - name; - args; - signature; - selector; - value; - constructor(fragment, selector, args, value) { - const name = fragment.name, signature = fragment.format(); - properties.defineProperties(this, { - fragment, - name, - args, - signature, - selector, - value, - }); - } -} -class ErrorDescription { - fragment; - name; - args; - signature; - selector; - constructor(fragment, selector, args) { - const name = fragment.name, signature = fragment.format(); - properties.defineProperties(this, { - fragment, - name, - args, - signature, - selector, - }); - } -} -class Indexed { - hash; - _isIndexed; - static isIndexed(value) { - return !!(value && value._isIndexed); - } - constructor(hash) { - properties.defineProperties(this, { hash, _isIndexed: true }); - } -} -// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require -const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", -}; -const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message) => { - return `reverted with reason string ${JSON.stringify(message)}`; - }, - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - }, - }, -}; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - fragments; - /** - * The Contract constructor. - */ - deploy; - /** - * The Fallback method, if any. - */ - fallback; - /** - * If receiving xcb is supported. - */ - receive; - #errors; - #events; - #functions; - // #structs: Map; - #abiCoder; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments$1) { - let abi = []; - if (typeof fragments$1 === "string") { - abi = JSON.parse(fragments$1); - } - else { - abi = fragments$1; - } - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - const frags = []; - for (const a of abi) { - try { - frags.push(fragments.Fragment.from(a)); - } - catch (error) { - console.log("EE", error); - } - } - properties.defineProperties(this, { - fragments: Object.freeze(frags), - }); - let fallback = null; - let receive = false; - this.#abiCoder = this.getAbiCoder(); - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - properties.defineProperties(this, { - deploy: fragment, - }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } - else { - errors.assertArgument(!fallback || - fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - case "error": - bucket = this.#errors; - break; - default: - return; - } - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - bucket.set(signature, fragment); - }); - // If we do not have a constructor add a default - if (!this.deploy) { - properties.defineProperties(this, { - deploy: fragments.ConstructorFragment.from("constructor()"), - }); - } - properties.defineProperties(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format = minimal ? "minimal" : "full"; - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi = this.fragments.map((f) => f.format("json")); - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return abiCoder.AbiCoder.defaultAbiCoder(); - } - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key, values, forceUnique) { - // Selector - if (data.isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - const lastValue = values.length > 0 ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (typed.Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && - (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!typed.Typed.isTyped(values[j])) { - continue; - } - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && - values && - values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || - Array.isArray(lastArg) || - typeof lastArg !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - errors.assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#functions.get(fragments.FunctionFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key) { - const fragment = this.#getFunction(key, null, false); - errors.assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key) { - return !!this.#getFunction(key, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key, values) { - return this.#getFunction(key, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#functions.get(name), i); - } - } - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key, values, forceUnique) { - // EventTopic - if (data.isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!typed.Typed.isTyped(values[j])) { - continue; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - errors.assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#events.get(fragments.EventFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key) { - const fragment = this.#getEvent(key, null, false); - errors.assertArgument(fragment, "no matching event", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key) { - return !!this.#getEvent(key, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key, values) { - return this.#getEvent(key, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#events.get(name), i); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key, values) { - if (data.isHexString(key)) { - const selector = key.toLowerCase(); - if (BuiltinErrors[selector]) { - return fragments.ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key === "Error") { - return fragments.ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return fragments.ErrorFragment.from("error Panic(uint256)"); - } - return null; - } - else if (matching.length > 1) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - errors.assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - key = fragments.ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return fragments.ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return fragments.ErrorFragment.from("error Panic(uint256)"); - } - const result = this.#errors.get(key); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#errors.get(name), i); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return this.#abiCoder.decode(params, data); - } - _encodeParams(params, values) { - return this.#abiCoder.encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data$1) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - errors.assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - errors.assertArgument(data.dataSlice(data$1, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data$1); - return this._decodeParams(fragment.inputs, data.dataSlice(data$1, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - errors.assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - return data.concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data$1) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - errors.assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - errors.assertArgument(data.dataSlice(data$1, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data$1); - return this._decodeParams(fragment.inputs, data.dataSlice(data$1, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - errors.assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return data.concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data$1) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - errors.assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - let message = "invalid length for result data"; - const bytes = data.getBytesCopy(data$1); - if (bytes.length % 32 === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } - catch (error) { - message = "could not decode result data"; - } - } - // Call returned data with no error, but the data is junk - errors.assert(false, message, "BAD_DATA", { - value: data.hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() }, - }); - } - makeError(_data, tx) { - const data$1 = data.getBytes(_data, "data"); - const error = abiCoder.AbiCoder.getBuiltinCallException("call", tx, data$1); - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = data.hexlify(data$1.slice(0, 4)); - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data$1.slice(4)); - error.revert = { - name: ef.name, - signature: ef.format(), - args, - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } - catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args, - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - errors.assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return data.hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } -*/ - // Create the filter for the event with search criteria (e.g. for xcb_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - errors.assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - errors.assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param, value) => { - if (param.type === "string") { - return id.id(value); - } - else if (param.type === "bytes") { - return sha3.sha256(data.hexlify(value)); - } - if (param.type === "bool" && typeof value === "boolean") { - value = value ? "0x01" : "0x00"; - } - if (param.type.match(/^u?int/)) { - value = maths.toBeHex(value); - } - // Check addresses are valid - if (param.type === "address") { - this.#abiCoder.encode(["address"], [value]); - } - return data.zeroPadValue(data.hexlify(value), 32); - //@TOOD should probably be return toHex(value, 32) - }; - values.forEach((value, index) => { - const param = fragment.inputs[index]; - if (!param.indexed) { - errors.assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); - return; - } - if (value == null) { - topics.push(null); - } - else if (param.baseType === "array" || param.baseType === "tuple") { - errors.assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); - } - else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } - else { - topics.push(encodeTopic(param, value)); - } - }); - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - errors.assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - errors.assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id.id(value)); - } - else if (param.type === "bytes") { - topics.push(sha3.sha256(value)); - } - else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } - else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } - else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics, - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data$1, topics) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - errors.assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - errors.assertArgument(data.isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || - param.type === "bytes" || - param.baseType === "tuple" || - param.baseType === "array") { - indexed.push(fragments.ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } - else { - indexed.push(param); - dynamic.push(false); - } - } - else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, data.concat(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data$1, true); - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values = []; - const keys = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } - else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } - else { - try { - value = resultIndexed[indexedIndex++]; - } - catch (error) { - value = error; - } - } - } - else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } - catch (error) { - value = error; - } - } - values.push(value); - keys.push(param.name || null); - }); - return abstractCoder.Result.fromItems(values, keys); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data$1 = data.getBytes(tx.data, "tx.data"); - const value = maths.getBigInt(tx.value != null ? tx.value : 0, "tx.value"); - const fragment = this.getFunction(data.hexlify(data$1.slice(0, 4))); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data$1.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log) { - const fragment = this.getEvent(log.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data$1) { - const hexData = data.hexlify(data$1); - const fragment = this.getError(data.dataSlice(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data.dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - // JSON - if (typeof value === "string") { - return new Interface(JSON.parse(value)); - } - // Maybe an interface from an older version, or from a symlinked copy - if (typeof value.format === "function") { - return new Interface(value.format("json")); - } - // Array of fragments - return new Interface(value); - } -} - -exports.Result = abstractCoder.Result; -exports.checkResultErrors = abstractCoder.checkResultErrors; -exports.ErrorDescription = ErrorDescription; -exports.Indexed = Indexed; -exports.Interface = Interface; -exports.LogDescription = LogDescription; -exports.TransactionDescription = TransactionDescription; -//# sourceMappingURL=interface.js.map diff --git a/lib.commonjs/abi/interface.js.map b/lib.commonjs/abi/interface.js.map deleted file mode 100644 index 31727f08e..000000000 --- a/lib.commonjs/abi/interface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.js","sources":["../../lib.esm/abi/interface.js"],"sourcesContent":["/**\n * About Interface\n *\n * @_subsection api/abi:Interfaces [interfaces]\n */\nimport { id } from \"../hash/index.js\";\nimport { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert, } from \"../utils/index.js\";\nimport { AbiCoder } from \"./abi-coder.js\";\nimport { checkResultErrors, Result } from \"./coders/abstract-coder.js\";\nimport { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, } from \"./fragments.js\";\nimport { Typed } from \"./typed.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nexport { checkResultErrors, Result };\nexport class LogDescription {\n fragment;\n name;\n signature;\n topic;\n args;\n constructor(fragment, topic, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n signature,\n topic,\n args,\n });\n }\n}\nexport class TransactionDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n value;\n constructor(fragment, selector, args, value) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n value,\n });\n }\n}\nexport class ErrorDescription {\n fragment;\n name;\n args;\n signature;\n selector;\n constructor(fragment, selector, args) {\n const name = fragment.name, signature = fragment.format();\n defineProperties(this, {\n fragment,\n name,\n args,\n signature,\n selector,\n });\n }\n}\nexport class Indexed {\n hash;\n _isIndexed;\n static isIndexed(value) {\n return !!(value && value._isIndexed);\n }\n constructor(hash) {\n defineProperties(this, { hash, _isIndexed: true });\n }\n}\n// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require\nconst PanicReasons = {\n \"0\": \"generic panic\",\n \"1\": \"assert(false)\",\n \"17\": \"arithmetic overflow\",\n \"18\": \"division or modulo by zero\",\n \"33\": \"enum overflow\",\n \"34\": \"invalid encoded storage byte array accessed\",\n \"49\": \"out-of-bounds array access; popping on an empty array\",\n \"50\": \"out-of-bounds access of an array or bytesN\",\n \"65\": \"out of memory\",\n \"81\": \"uninitialized function\",\n};\nconst BuiltinErrors = {\n \"0x08c379a0\": {\n signature: \"Error(string)\",\n name: \"Error\",\n inputs: [\"string\"],\n reason: (message) => {\n return `reverted with reason string ${JSON.stringify(message)}`;\n },\n },\n \"0x4e487b71\": {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n inputs: [\"uint256\"],\n reason: (code) => {\n let reason = \"unknown panic code\";\n if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) {\n reason = PanicReasons[code.toString()];\n }\n return `reverted with panic code 0x${code.toString(16)} (${reason})`;\n },\n },\n};\n/**\n * An Interface abstracts many of the low-level details for\n * encoding and decoding the data on the blockchain.\n *\n * An ABI provides information on how to encode data to send to\n * a Contract, how to decode the results and events and how to\n * interpret revert errors.\n *\n * The ABI can be specified by [any supported format](InterfaceAbi).\n */\nexport class Interface {\n /**\n * All the Contract ABI members (i.e. methods, events, errors, etc).\n */\n fragments;\n /**\n * The Contract constructor.\n */\n deploy;\n /**\n * The Fallback method, if any.\n */\n fallback;\n /**\n * If receiving xcb is supported.\n */\n receive;\n #errors;\n #events;\n #functions;\n // #structs: Map;\n #abiCoder;\n /**\n * Create a new Interface for the %%fragments%%.\n */\n constructor(fragments) {\n let abi = [];\n if (typeof fragments === \"string\") {\n abi = JSON.parse(fragments);\n }\n else {\n abi = fragments;\n }\n this.#functions = new Map();\n this.#errors = new Map();\n this.#events = new Map();\n // this.#structs = new Map();\n const frags = [];\n for (const a of abi) {\n try {\n frags.push(Fragment.from(a));\n }\n catch (error) {\n console.log(\"EE\", error);\n }\n }\n defineProperties(this, {\n fragments: Object.freeze(frags),\n });\n let fallback = null;\n let receive = false;\n this.#abiCoder = this.getAbiCoder();\n // Add all fragments by their signature\n this.fragments.forEach((fragment, index) => {\n let bucket;\n switch (fragment.type) {\n case \"constructor\":\n if (this.deploy) {\n console.log(\"duplicate definition - constructor\");\n return;\n }\n //checkNames(fragment, \"input\", fragment.inputs);\n defineProperties(this, {\n deploy: fragment,\n });\n return;\n case \"fallback\":\n if (fragment.inputs.length === 0) {\n receive = true;\n }\n else {\n assertArgument(!fallback ||\n fragment.payable !== fallback.payable, \"conflicting fallback fragments\", `fragments[${index}]`, fragment);\n fallback = fragment;\n receive = fallback.payable;\n }\n return;\n case \"function\":\n //checkNames(fragment, \"input\", fragment.inputs);\n //checkNames(fragment, \"output\", (fragment).outputs);\n bucket = this.#functions;\n break;\n case \"event\":\n //checkNames(fragment, \"input\", fragment.inputs);\n bucket = this.#events;\n break;\n case \"error\":\n bucket = this.#errors;\n break;\n default:\n return;\n }\n // Two identical entries; ignore it\n const signature = fragment.format();\n if (bucket.has(signature)) {\n return;\n }\n bucket.set(signature, fragment);\n });\n // If we do not have a constructor add a default\n if (!this.deploy) {\n defineProperties(this, {\n deploy: ConstructorFragment.from(\"constructor()\"),\n });\n }\n defineProperties(this, { fallback, receive });\n }\n /**\n * Returns the entire Human-Readable ABI, as an array of\n * signatures, optionally as %%minimal%% strings, which\n * removes parameter names and unneceesary spaces.\n */\n format(minimal) {\n const format = minimal ? \"minimal\" : \"full\";\n const abi = this.fragments.map((f) => f.format(format));\n return abi;\n }\n /**\n * Return the JSON-encoded ABI. This is the format Solidiy\n * returns.\n */\n formatJson() {\n const abi = this.fragments.map((f) => f.format(\"json\"));\n // We need to re-bundle the JSON fragments a bit\n return JSON.stringify(abi.map((j) => JSON.parse(j)));\n }\n /**\n * The ABI coder that will be used to encode and decode binary\n * data.\n */\n getAbiCoder() {\n return AbiCoder.defaultAbiCoder();\n }\n // Find a function definition by any means necessary (unless it is ambiguous)\n #getFunction(key, values, forceUnique) {\n // Selector\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n for (const fragment of this.#functions.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#functions) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n const lastValue = values.length > 0 ? values[values.length - 1] : null;\n let valueLength = values.length;\n let allowOptions = true;\n if (Typed.isTyped(lastValue) && lastValue.type === \"overrides\") {\n allowOptions = false;\n valueLength--;\n }\n // Remove all matches that don't have a compatible length. The args\n // may contain an overrides, so the match may have n or n - 1 parameters\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs.length;\n if (inputs !== valueLength &&\n (!allowOptions || inputs !== valueLength - 1)) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // We are past the inputs\n if (j >= inputs.length) {\n if (values[j].type === \"overrides\") {\n continue;\n }\n matching.splice(i, 1);\n break;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n // We found a single matching signature with an overrides, but the\n // last value is something that cannot possibly be an options\n if (matching.length === 1 &&\n values &&\n values.length !== matching[0].inputs.length) {\n const lastArg = values[values.length - 1];\n if (lastArg == null ||\n Array.isArray(lastArg) ||\n typeof lastArg !== \"object\") {\n matching.splice(0, 1);\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#functions.get(FunctionFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the function name for %%key%%, which may be a function selector,\n * function name or function signature that belongs to the ABI.\n */\n getFunctionName(key) {\n const fragment = this.#getFunction(key, null, false);\n assertArgument(fragment, \"no matching function\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (a function selector, function name or\n * function signature) is present in the ABI.\n *\n * In the case of a function name, the name may be ambiguous, so\n * accessing the [[FunctionFragment]] may require refinement.\n */\n hasFunction(key) {\n return !!this.#getFunction(key, null, false);\n }\n /**\n * Get the [[FunctionFragment]] for %%key%%, which may be a function\n * selector, function name or function signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple functions match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single function in\n * the ABI, this will throw.\n */\n getFunction(key, values) {\n return this.#getFunction(key, values || null, true);\n }\n /**\n * Iterate over all functions, calling %%callback%%, sorted by their name.\n */\n forEachFunction(callback) {\n const names = Array.from(this.#functions.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#functions.get(name), i);\n }\n }\n // Find an event definition by any means necessary (unless it is ambiguous)\n #getEvent(key, values, forceUnique) {\n // EventTopic\n if (isHexString(key)) {\n const eventTopic = key.toLowerCase();\n for (const fragment of this.#events.values()) {\n if (eventTopic === fragment.topicHash) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#events) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (values) {\n // Remove all matches that don't have a compatible length.\n for (let i = matching.length - 1; i >= 0; i--) {\n if (matching[i].inputs.length < values.length) {\n matching.splice(i, 1);\n }\n }\n // Remove all matches that don't match the Typed signature\n for (let i = matching.length - 1; i >= 0; i--) {\n const inputs = matching[i].inputs;\n for (let j = 0; j < values.length; j++) {\n // Not a typed value\n if (!Typed.isTyped(values[j])) {\n continue;\n }\n // Make sure the value type matches the input type\n if (values[j].type !== inputs[j].baseType) {\n matching.splice(i, 1);\n break;\n }\n }\n }\n }\n if (matching.length === 0) {\n return null;\n }\n if (matching.length > 1 && forceUnique) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, \"key\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n const result = this.#events.get(EventFragment.from(key).format());\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Get the event name for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n */\n getEventName(key) {\n const fragment = this.#getEvent(key, null, false);\n assertArgument(fragment, \"no matching event\", \"key\", key);\n return fragment.name;\n }\n /**\n * Returns true if %%key%% (an event topic hash, event name or\n * event signature) is present in the ABI.\n *\n * In the case of an event name, the name may be ambiguous, so\n * accessing the [[EventFragment]] may require refinement.\n */\n hasEvent(key) {\n return !!this.#getEvent(key, null, false);\n }\n /**\n * Get the [[EventFragment]] for %%key%%, which may be a topic hash,\n * event name or event signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple events match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single event in\n * the ABI, this will throw.\n */\n getEvent(key, values) {\n return this.#getEvent(key, values || null, true);\n }\n /**\n * Iterate over all events, calling %%callback%%, sorted by their name.\n */\n forEachEvent(callback) {\n const names = Array.from(this.#events.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#events.get(name), i);\n }\n }\n /**\n * Get the [[ErrorFragment]] for %%key%%, which may be an error\n * selector, error name or error signature that belongs to the ABI.\n *\n * If %%values%% is provided, it will use the Typed API to handle\n * ambiguous cases where multiple errors match by name.\n *\n * If the %%key%% and %%values%% do not refine to a single error in\n * the ABI, this will throw.\n */\n getError(key, values) {\n if (isHexString(key)) {\n const selector = key.toLowerCase();\n if (BuiltinErrors[selector]) {\n return ErrorFragment.from(BuiltinErrors[selector].signature);\n }\n for (const fragment of this.#errors.values()) {\n if (selector === fragment.selector) {\n return fragment;\n }\n }\n return null;\n }\n // It is a bare name, look up the function (will return null if ambiguous)\n if (key.indexOf(\"(\") === -1) {\n const matching = [];\n for (const [name, fragment] of this.#errors) {\n if (name.split(\"(\" /* fix:) */)[0] === key) {\n matching.push(fragment);\n }\n }\n if (matching.length === 0) {\n if (key === \"Error\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n return null;\n }\n else if (matching.length > 1) {\n const matchStr = matching\n .map((m) => JSON.stringify(m.format()))\n .join(\", \");\n assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, \"name\", key);\n }\n return matching[0];\n }\n // Normalize the signature and lookup the function\n key = ErrorFragment.from(key).format();\n if (key === \"Error(string)\") {\n return ErrorFragment.from(\"error Error(string)\");\n }\n if (key === \"Panic(uint256)\") {\n return ErrorFragment.from(\"error Panic(uint256)\");\n }\n const result = this.#errors.get(key);\n if (result) {\n return result;\n }\n return null;\n }\n /**\n * Iterate over all errors, calling %%callback%%, sorted by their name.\n */\n forEachError(callback) {\n const names = Array.from(this.#errors.keys());\n names.sort((a, b) => a.localeCompare(b));\n for (let i = 0; i < names.length; i++) {\n const name = names[i];\n callback(this.#errors.get(name), i);\n }\n }\n // Get the 4-byte selector used by Solidity to identify a function\n /*\n getSelector(fragment: ErrorFragment | FunctionFragment): string {\n if (typeof(fragment) === \"string\") {\n const matches: Array = [ ];\n\n try { matches.push(this.getFunction(fragment)); } catch (error) { }\n try { matches.push(this.getError(fragment)); } catch (_) { }\n\n if (matches.length === 0) {\n logger.throwArgumentError(\"unknown fragment\", \"key\", fragment);\n } else if (matches.length > 1) {\n logger.throwArgumentError(\"ambiguous fragment matches function and error\", \"key\", fragment);\n }\n\n fragment = matches[0];\n }\n\n return dataSlice(id(fragment.format()), 0, 4);\n }\n */\n // Get the 32-byte topic hash used by Solidity to identify an event\n /*\n getEventTopic(fragment: EventFragment): string {\n //if (typeof(fragment) === \"string\") { fragment = this.getEvent(eventFragment); }\n return id(fragment.format());\n }\n */\n _decodeParams(params, data) {\n return this.#abiCoder.decode(params, data);\n }\n _encodeParams(params, values) {\n return this.#abiCoder.encode(params, values);\n }\n /**\n * Encodes a ``tx.data`` object for deploying the Contract with\n * the %%values%% as the constructor arguments.\n */\n encodeDeploy(values) {\n return this._encodeParams(this.deploy.inputs, values || []);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified error (see [[getError]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeErrorResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the transaction revert data for a call result that\n * reverted from the the Contract with the sepcified %%error%%\n * (see [[getError]] for valid values for %%fragment%%) with the %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeErrorResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getError(fragment);\n assertArgument(f, \"unknown error\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the %%data%% from a transaction ``tx.data`` for\n * the function specified (see [[getFunction]] for valid values\n * for %%fragment%%).\n *\n * Most developers should prefer the [[parseTransaction]] method\n * instead, which will automatically detect the fragment.\n */\n decodeFunctionData(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, \"data\", data);\n return this._decodeParams(fragment.inputs, dataSlice(data, 4));\n }\n /**\n * Encodes the ``tx.data`` for a transaction that calls the function\n * specified (see [[getFunction]] for valid values for %%fragment%%) with\n * the %%values%%.\n */\n encodeFunctionData(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return concat([\n fragment.selector,\n this._encodeParams(fragment.inputs, values || []),\n ]);\n }\n /**\n * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values for\n * %%key%%).\n *\n * Most developers should prefer the [[parseCallResult]] method instead,\n * which will automatically detect a ``CALL_EXCEPTION`` and throw the\n * corresponding error.\n */\n decodeFunctionResult(fragment, data) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n let message = \"invalid length for result data\";\n const bytes = getBytesCopy(data);\n if (bytes.length % 32 === 0) {\n try {\n return this.#abiCoder.decode(fragment.outputs, bytes);\n }\n catch (error) {\n message = \"could not decode result data\";\n }\n }\n // Call returned data with no error, but the data is junk\n assert(false, message, \"BAD_DATA\", {\n value: hexlify(bytes),\n info: { method: fragment.name, signature: fragment.format() },\n });\n }\n makeError(_data, tx) {\n const data = getBytes(_data, \"data\");\n const error = AbiCoder.getBuiltinCallException(\"call\", tx, data);\n // Not a built-in error; try finding a custom error\n const customPrefix = \"execution reverted (unknown custom error)\";\n if (error.message.startsWith(customPrefix)) {\n const selector = hexlify(data.slice(0, 4));\n const ef = this.getError(selector);\n if (ef) {\n try {\n const args = this.#abiCoder.decode(ef.inputs, data.slice(4));\n error.revert = {\n name: ef.name,\n signature: ef.format(),\n args,\n };\n error.reason = error.revert.signature;\n error.message = `execution reverted: ${error.reason}`;\n }\n catch (e) {\n error.message = `execution reverted (coult not decode custom error)`;\n }\n }\n }\n // Add the invocation, if available\n const parsed = this.parseTransaction(tx);\n if (parsed) {\n error.invocation = {\n method: parsed.name,\n signature: parsed.signature,\n args: parsed.args,\n };\n }\n return error;\n }\n /**\n * Encodes the result data (e.g. from an ``xcb_call``) for the\n * specified function (see [[getFunction]] for valid values\n * for %%fragment%%) with %%values%%.\n *\n * This is generally not used by most developers, unless trying to mock\n * a result from a Contract.\n */\n encodeFunctionResult(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getFunction(fragment);\n assertArgument(f, \"unknown function\", \"fragment\", fragment);\n fragment = f;\n }\n return hexlify(this.#abiCoder.encode(fragment.outputs, values || []));\n }\n /*\n spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> {\n const promises: Array> = [ ];\n const process = function(type: ParamType, value: any): any {\n if (type.baseType === \"array\") {\n return descend(type.child\n }\n if (type. === \"address\") {\n }\n };\n\n const descend = function (inputs: Array, values: ReadonlyArray) {\n if (inputs.length !== values.length) { throw new Error(\"length mismatch\"); }\n };\n\n const result: Array = [ ];\n values.forEach((value, index) => {\n if (value == null) {\n topics.push(null);\n } else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n logger.throwArgumentError(\"filtering with tuples or arrays not supported\", (\"contract.\" + param.name), value);\n } else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n } else {\n topics.push(encodeTopic(param, value));\n }\n });\n }\n*/\n // Create the filter for the event with search criteria (e.g. for xcb_filterLog)\n encodeFilterTopics(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, \"UNEXPECTED_ARGUMENT\", { count: values.length, expectedCount: fragment.inputs.length });\n const topics = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n // @TODO: Use the coders for this; to properly support tuples, etc.\n const encodeTopic = (param, value) => {\n if (param.type === \"string\") {\n return id(value);\n }\n else if (param.type === \"bytes\") {\n return sha256(hexlify(value));\n }\n if (param.type === \"bool\" && typeof value === \"boolean\") {\n value = value ? \"0x01\" : \"0x00\";\n }\n if (param.type.match(/^u?int/)) {\n value = toBeHex(value);\n }\n // Check addresses are valid\n if (param.type === \"address\") {\n this.#abiCoder.encode([\"address\"], [value]);\n }\n return zeroPadValue(hexlify(value), 32);\n //@TOOD should probably be return toHex(value, 32)\n };\n values.forEach((value, index) => {\n const param = fragment.inputs[index];\n if (!param.indexed) {\n assertArgument(value == null, \"cannot filter non-indexed parameters; must be null\", \"contract.\" + param.name, value);\n return;\n }\n if (value == null) {\n topics.push(null);\n }\n else if (param.baseType === \"array\" || param.baseType === \"tuple\") {\n assertArgument(false, \"filtering with tuples or arrays not supported\", \"contract.\" + param.name, value);\n }\n else if (Array.isArray(value)) {\n topics.push(value.map((value) => encodeTopic(param, value)));\n }\n else {\n topics.push(encodeTopic(param, value));\n }\n });\n // Trim off trailing nulls\n while (topics.length && topics[topics.length - 1] === null) {\n topics.pop();\n }\n return topics;\n }\n encodeEventLog(fragment, values) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n const topics = [];\n const dataTypes = [];\n const dataValues = [];\n if (!fragment.anonymous) {\n topics.push(fragment.topicHash);\n }\n assertArgument(values.length === fragment.inputs.length, \"event arguments/values mismatch\", \"values\", values);\n fragment.inputs.forEach((param, index) => {\n const value = values[index];\n if (param.indexed) {\n if (param.type === \"string\") {\n topics.push(id(value));\n }\n else if (param.type === \"bytes\") {\n topics.push(sha256(value));\n }\n else if (param.baseType === \"tuple\" || param.baseType === \"array\") {\n // @TODO\n throw new Error(\"not implemented\");\n }\n else {\n topics.push(this.#abiCoder.encode([param.type], [value]));\n }\n }\n else {\n dataTypes.push(param);\n dataValues.push(value);\n }\n });\n return {\n data: this.#abiCoder.encode(dataTypes, dataValues),\n topics: topics,\n };\n }\n // Decode a filter for the event and the search criteria\n decodeEventLog(fragment, data, topics) {\n if (typeof fragment === \"string\") {\n const f = this.getEvent(fragment);\n assertArgument(f, \"unknown event\", \"eventFragment\", fragment);\n fragment = f;\n }\n if (topics != null && !fragment.anonymous) {\n const eventTopic = fragment.topicHash;\n assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, \"fragment/topic mismatch\", \"topics[0]\", topics[0]);\n topics = topics.slice(1);\n }\n const indexed = [];\n const nonIndexed = [];\n const dynamic = [];\n fragment.inputs.forEach((param, index) => {\n if (param.indexed) {\n if (param.type === \"string\" ||\n param.type === \"bytes\" ||\n param.baseType === \"tuple\" ||\n param.baseType === \"array\") {\n indexed.push(ParamType.from({ type: \"bytes32\", name: param.name }));\n dynamic.push(true);\n }\n else {\n indexed.push(param);\n dynamic.push(false);\n }\n }\n else {\n nonIndexed.push(param);\n dynamic.push(false);\n }\n });\n const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null;\n const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true);\n //const result: (Array & { [ key: string ]: any }) = [ ];\n const values = [];\n const keys = [];\n let nonIndexedIndex = 0, indexedIndex = 0;\n fragment.inputs.forEach((param, index) => {\n let value = null;\n if (param.indexed) {\n if (resultIndexed == null) {\n value = new Indexed(null);\n }\n else if (dynamic[index]) {\n value = new Indexed(resultIndexed[indexedIndex++]);\n }\n else {\n try {\n value = resultIndexed[indexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n }\n else {\n try {\n value = resultNonIndexed[nonIndexedIndex++];\n }\n catch (error) {\n value = error;\n }\n }\n values.push(value);\n keys.push(param.name || null);\n });\n return Result.fromItems(values, keys);\n }\n /**\n * Parses a transaction, finding the matching function and extracts\n * the parameter values along with other useful function details.\n *\n * If the matching function cannot be found, return null.\n */\n parseTransaction(tx) {\n const data = getBytes(tx.data, \"tx.data\");\n const value = getBigInt(tx.value != null ? tx.value : 0, \"tx.value\");\n const fragment = this.getFunction(hexlify(data.slice(0, 4)));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, data.slice(4));\n return new TransactionDescription(fragment, fragment.selector, args, value);\n }\n parseCallResult(data) {\n throw new Error(\"@TODO\");\n }\n /**\n * Parses a receipt log, finding the matching event and extracts\n * the parameter values along with other useful event details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseLog(log) {\n const fragment = this.getEvent(log.topics[0]);\n if (!fragment || fragment.anonymous) {\n return null;\n }\n // @TODO: If anonymous, and the only method, and the input count matches, should we parse?\n // Probably not, because just because it is the only event in the ABI does\n // not mean we have the full ABI; maybe just a fragment?\n return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics));\n }\n /**\n * Parses a revert data, finding the matching error and extracts\n * the parameter values along with other useful error details.\n *\n * If the matching event cannot be found, returns null.\n */\n parseError(data) {\n const hexData = hexlify(data);\n const fragment = this.getError(dataSlice(hexData, 0, 4));\n if (!fragment) {\n return null;\n }\n const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4));\n return new ErrorDescription(fragment, fragment.selector, args);\n }\n /**\n * Creates a new [[Interface]] from the ABI %%value%%.\n *\n * The %%value%% may be provided as an existing [[Interface]] object,\n * a JSON-encoded ABI or any Human-Readable ABI format.\n */\n static from(value) {\n // Already an Interface, which is immutable\n if (value instanceof Interface) {\n return value;\n }\n // JSON\n if (typeof value === \"string\") {\n return new Interface(JSON.parse(value));\n }\n // Maybe an interface from an older version, or from a symlinked copy\n if (typeof value.format === \"function\") {\n return new Interface(value.format(\"json\"));\n }\n // Array of fragments\n return new Interface(value);\n }\n}\n//# sourceMappingURL=interface.js.map"],"names":["defineProperties","fragments","Fragment","assertArgument","ConstructorFragment","AbiCoder","isHexString","Typed","FunctionFragment","EventFragment","ErrorFragment","data","dataSlice","concat","getBytesCopy","assert","hexlify","getBytes","id","sha256","toBeHex","zeroPadValue","ParamType","Result","getBigInt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AASO,MAAM,cAAc,CAAC;AAC5B,I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,EAAE,CAAC,CAAC,CAAC;AAChE,QAAQ,IAAI,CAAC,QAAQ,EAAE;AACvB,YAAY,OAAO,IAAI;AACvB,QAAQ;AACR,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAEA,cAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAClF,QAAQ,OAAO,IAAI,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;AACtE,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,IAAI,CAAC,KAAK,EAAE;AACvB;AACA,QAAQ,IAAI,KAAK,YAAY,SAAS,EAAE;AACxC,YAAY,OAAO,KAAK;AACxB,QAAQ;AACR;AACA,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,YAAY,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACnD,QAAQ;AACR;AACA,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,EAAE;AAChD,YAAY,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AACtD,QAAQ;AACR;AACA,QAAQ,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC;AACnC,IAAI;AACJ;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/abi/typed.d.ts b/lib.commonjs/abi/typed.d.ts deleted file mode 100644 index 3dce9d6a9..000000000 --- a/lib.commonjs/abi/typed.d.ts +++ /dev/null @@ -1,172 +0,0 @@ -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -import type { Addressable } from "../address/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { Result } from "./coders/abstract-coder.js"; -export interface TypedNumber extends Typed { - value: number; - defaultValue(): number; - minValue(): number; - maxValue(): number; -} -export interface TypedBigInt extends Typed { - value: bigint; - defaultValue(): bigint; - minValue(): bigint; - maxValue(): bigint; -} -export interface TypedData extends Typed { - value: string; - defaultValue(): string; -} -export interface TypedString extends Typed { - value: string; - defaultValue(): string; -} -export declare class Typed { - #private; - readonly type: string; - readonly value: any; - readonly _typedSymbol: Symbol; - constructor(gaurd: any, type: string, value: any, options?: any); - format(): string; - defaultValue(): string | number | bigint | Result; - minValue(): string | number | bigint; - maxValue(): string | number | bigint; - isBigInt(): this is TypedBigInt; - isData(): this is TypedData; - isString(): this is TypedString; - get tupleName(): null | string; - get arrayLength(): null | number; - static from(type: string, value: any): Typed; - static uint8(v: BigNumberish): Typed; - static uint16(v: BigNumberish): Typed; - static uint24(v: BigNumberish): Typed; - static uint32(v: BigNumberish): Typed; - static uint40(v: BigNumberish): Typed; - static uint48(v: BigNumberish): Typed; - static uint56(v: BigNumberish): Typed; - static uint64(v: BigNumberish): Typed; - static uint72(v: BigNumberish): Typed; - static uint80(v: BigNumberish): Typed; - static uint88(v: BigNumberish): Typed; - static uint96(v: BigNumberish): Typed; - static uint104(v: BigNumberish): Typed; - static uint112(v: BigNumberish): Typed; - static uint120(v: BigNumberish): Typed; - static uint128(v: BigNumberish): Typed; - static uint136(v: BigNumberish): Typed; - static uint144(v: BigNumberish): Typed; - static uint152(v: BigNumberish): Typed; - static uint160(v: BigNumberish): Typed; - static uint168(v: BigNumberish): Typed; - static uint176(v: BigNumberish): Typed; - static uint184(v: BigNumberish): Typed; - static uint192(v: BigNumberish): Typed; - static uint200(v: BigNumberish): Typed; - static uint208(v: BigNumberish): Typed; - static uint216(v: BigNumberish): Typed; - static uint224(v: BigNumberish): Typed; - static uint232(v: BigNumberish): Typed; - static uint240(v: BigNumberish): Typed; - static uint248(v: BigNumberish): Typed; - static uint256(v: BigNumberish): Typed; - static uint(v: BigNumberish): Typed; - static int8(v: BigNumberish): Typed; - static int16(v: BigNumberish): Typed; - static int24(v: BigNumberish): Typed; - static int32(v: BigNumberish): Typed; - static int40(v: BigNumberish): Typed; - static int48(v: BigNumberish): Typed; - static int56(v: BigNumberish): Typed; - static int64(v: BigNumberish): Typed; - static int72(v: BigNumberish): Typed; - static int80(v: BigNumberish): Typed; - static int88(v: BigNumberish): Typed; - static int96(v: BigNumberish): Typed; - static int104(v: BigNumberish): Typed; - static int112(v: BigNumberish): Typed; - static int120(v: BigNumberish): Typed; - static int128(v: BigNumberish): Typed; - static int136(v: BigNumberish): Typed; - static int144(v: BigNumberish): Typed; - static int152(v: BigNumberish): Typed; - static int160(v: BigNumberish): Typed; - static int168(v: BigNumberish): Typed; - static int176(v: BigNumberish): Typed; - static int184(v: BigNumberish): Typed; - static int192(v: BigNumberish): Typed; - static int200(v: BigNumberish): Typed; - static int208(v: BigNumberish): Typed; - static int216(v: BigNumberish): Typed; - static int224(v: BigNumberish): Typed; - static int232(v: BigNumberish): Typed; - static int240(v: BigNumberish): Typed; - static int248(v: BigNumberish): Typed; - static int256(v: BigNumberish): Typed; - static int(v: BigNumberish): Typed; - static bytes1(v: BytesLike): Typed; - static bytes2(v: BytesLike): Typed; - static bytes3(v: BytesLike): Typed; - static bytes4(v: BytesLike): Typed; - static bytes5(v: BytesLike): Typed; - static bytes6(v: BytesLike): Typed; - static bytes7(v: BytesLike): Typed; - static bytes8(v: BytesLike): Typed; - static bytes9(v: BytesLike): Typed; - static bytes10(v: BytesLike): Typed; - static bytes11(v: BytesLike): Typed; - static bytes12(v: BytesLike): Typed; - static bytes13(v: BytesLike): Typed; - static bytes14(v: BytesLike): Typed; - static bytes15(v: BytesLike): Typed; - static bytes16(v: BytesLike): Typed; - static bytes17(v: BytesLike): Typed; - static bytes18(v: BytesLike): Typed; - static bytes19(v: BytesLike): Typed; - static bytes20(v: BytesLike): Typed; - static bytes21(v: BytesLike): Typed; - static bytes22(v: BytesLike): Typed; - static bytes23(v: BytesLike): Typed; - static bytes24(v: BytesLike): Typed; - static bytes25(v: BytesLike): Typed; - static bytes26(v: BytesLike): Typed; - static bytes27(v: BytesLike): Typed; - static bytes28(v: BytesLike): Typed; - static bytes29(v: BytesLike): Typed; - static bytes30(v: BytesLike): Typed; - static bytes31(v: BytesLike): Typed; - static bytes32(v: BytesLike): Typed; - static address(v: string | Addressable): Typed; - static bool(v: any): Typed; - static bytes(v: BytesLike): Typed; - static string(v: string): Typed; - static array(v: Array, dynamic?: null | boolean): Typed; - static tuple(v: Array | Record, name?: string): Typed; - static overrides(v: Record): Typed; - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value: any): value is Typed; - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value: Typed | T, type: string): T; -} -//# sourceMappingURL=typed.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/abi/typed.d.ts.map b/lib.commonjs/abi/typed.d.ts.map deleted file mode 100644 index 80e5667ff..000000000 --- a/lib.commonjs/abi/typed.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAuBzD,MAAM,WAAW,WAAY,SAAQ,KAAK;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;IACvB,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;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AElC;IACD,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,KAAK,CAElC;IACD,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,KAAK,CAElC;IACD,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,SAAS,GAAG,KAAK,CAElC;IAED,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,KAAK,CAE7C;IACD,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,GAAG,KAAK,CAEzB;IACD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,KAAK,CAEhC;IACD,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,CAE9B;IAED,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,KAAK,CAGnE;IAED,MAAM,CAAC,KAAK,CACX,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,EACnD,IAAI,CAAC,EAAE,MAAM,GACX,KAAK,CAGP;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAE9C;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEzC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAQvD;CACD"} \ No newline at end of file diff --git a/lib.commonjs/abi/typed.js b/lib.commonjs/abi/typed.js deleted file mode 100644 index 20c406ca2..000000000 --- a/lib.commonjs/abi/typed.js +++ /dev/null @@ -1,455 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -const _gaurd = {}; -function n(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { - signed, - width, - }); -} -function b(value, size) { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size }); -} -const _typedSymbol = Symbol.for("_corebc_typed"); -class Typed { - type; - value; - #options; - _typedSymbol; - constructor(gaurd, type, value, options) { - if (options == null) { - options = null; - } - errors.assertPrivate(_gaurd, gaurd, "Typed"); - properties.defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - // Check the value is valid - this.format(); - } - format() { - if (this.type === "array") { - throw new Error(""); - } - else if (this.type === "dynamicArray") { - throw new Error(""); - } - else if (this.type === "tuple") { - return `tuple(${this.value.map((v) => v.format()).join(",")})`; - } - return this.type; - } - defaultValue() { - return 0; - } - minValue() { - return 0; - } - maxValue() { - return 0; - } - isBigInt() { - return !!this.type.match(/^u?int[0-9]+$/); - } - isData() { - return this.type.startsWith("bytes"); - } - isString() { - return this.type === "string"; - } - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return this.value.length; - } - return null; - } - static from(type, value) { - return new Typed(_gaurd, type, value); - } - static uint8(v) { - return n(v, 8); - } - static uint16(v) { - return n(v, 16); - } - static uint24(v) { - return n(v, 24); - } - static uint32(v) { - return n(v, 32); - } - static uint40(v) { - return n(v, 40); - } - static uint48(v) { - return n(v, 48); - } - static uint56(v) { - return n(v, 56); - } - static uint64(v) { - return n(v, 64); - } - static uint72(v) { - return n(v, 72); - } - static uint80(v) { - return n(v, 80); - } - static uint88(v) { - return n(v, 88); - } - static uint96(v) { - return n(v, 96); - } - static uint104(v) { - return n(v, 104); - } - static uint112(v) { - return n(v, 112); - } - static uint120(v) { - return n(v, 120); - } - static uint128(v) { - return n(v, 128); - } - static uint136(v) { - return n(v, 136); - } - static uint144(v) { - return n(v, 144); - } - static uint152(v) { - return n(v, 152); - } - static uint160(v) { - return n(v, 160); - } - static uint168(v) { - return n(v, 168); - } - static uint176(v) { - return n(v, 176); - } - static uint184(v) { - return n(v, 184); - } - static uint192(v) { - return n(v, 192); - } - static uint200(v) { - return n(v, 200); - } - static uint208(v) { - return n(v, 208); - } - static uint216(v) { - return n(v, 216); - } - static uint224(v) { - return n(v, 224); - } - static uint232(v) { - return n(v, 232); - } - static uint240(v) { - return n(v, 240); - } - static uint248(v) { - return n(v, 248); - } - static uint256(v) { - return n(v, 256); - } - static uint(v) { - return n(v, 256); - } - static int8(v) { - return n(v, -8); - } - static int16(v) { - return n(v, -16); - } - static int24(v) { - return n(v, -24); - } - static int32(v) { - return n(v, -32); - } - static int40(v) { - return n(v, -40); - } - static int48(v) { - return n(v, -48); - } - static int56(v) { - return n(v, -56); - } - static int64(v) { - return n(v, -64); - } - static int72(v) { - return n(v, -72); - } - static int80(v) { - return n(v, -80); - } - static int88(v) { - return n(v, -88); - } - static int96(v) { - return n(v, -96); - } - static int104(v) { - return n(v, -104); - } - static int112(v) { - return n(v, -112); - } - static int120(v) { - return n(v, -120); - } - static int128(v) { - return n(v, -128); - } - static int136(v) { - return n(v, -136); - } - static int144(v) { - return n(v, -144); - } - static int152(v) { - return n(v, -152); - } - static int160(v) { - return n(v, -160); - } - static int168(v) { - return n(v, -168); - } - static int176(v) { - return n(v, -176); - } - static int184(v) { - return n(v, -184); - } - static int192(v) { - return n(v, -192); - } - static int200(v) { - return n(v, -200); - } - static int208(v) { - return n(v, -208); - } - static int216(v) { - return n(v, -216); - } - static int224(v) { - return n(v, -224); - } - static int232(v) { - return n(v, -232); - } - static int240(v) { - return n(v, -240); - } - static int248(v) { - return n(v, -248); - } - static int256(v) { - return n(v, -256); - } - static int(v) { - return n(v, -256); - } - static bytes1(v) { - return b(v, 1); - } - static bytes2(v) { - return b(v, 2); - } - static bytes3(v) { - return b(v, 3); - } - static bytes4(v) { - return b(v, 4); - } - static bytes5(v) { - return b(v, 5); - } - static bytes6(v) { - return b(v, 6); - } - static bytes7(v) { - return b(v, 7); - } - static bytes8(v) { - return b(v, 8); - } - static bytes9(v) { - return b(v, 9); - } - static bytes10(v) { - return b(v, 10); - } - static bytes11(v) { - return b(v, 11); - } - static bytes12(v) { - return b(v, 12); - } - static bytes13(v) { - return b(v, 13); - } - static bytes14(v) { - return b(v, 14); - } - static bytes15(v) { - return b(v, 15); - } - static bytes16(v) { - return b(v, 16); - } - static bytes17(v) { - return b(v, 17); - } - static bytes18(v) { - return b(v, 18); - } - static bytes19(v) { - return b(v, 19); - } - static bytes20(v) { - return b(v, 20); - } - static bytes21(v) { - return b(v, 21); - } - static bytes22(v) { - return b(v, 22); - } - static bytes23(v) { - return b(v, 23); - } - static bytes24(v) { - return b(v, 24); - } - static bytes25(v) { - return b(v, 25); - } - static bytes26(v) { - return b(v, 26); - } - static bytes27(v) { - return b(v, 27); - } - static bytes28(v) { - return b(v, 28); - } - static bytes29(v) { - return b(v, 29); - } - static bytes30(v) { - return b(v, 30); - } - static bytes31(v) { - return b(v, 31); - } - static bytes32(v) { - return b(v, 32); - } - static address(v) { - return new Typed(_gaurd, "address", v); - } - static bool(v) { - return new Typed(_gaurd, "bool", !!v); - } - static bytes(v) { - return new Typed(_gaurd, "bytes", v); - } - static string(v) { - return new Typed(_gaurd, "string", v); - } - static array(v, dynamic) { - throw new Error("not implemented yet"); - } - static tuple(v, name) { - throw new Error("not implemented yet"); - } - static overrides(v) { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return value && value._typedSymbol === _typedSymbol; - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type) { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } -} - -exports.Typed = Typed; -//# sourceMappingURL=typed.js.map diff --git a/lib.commonjs/abi/typed.js.map b/lib.commonjs/abi/typed.js.map deleted file mode 100644 index 179b80a23..000000000 --- a/lib.commonjs/abi/typed.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed.js","sources":["../../lib.esm/abi/typed.js"],"sourcesContent":["/**\n * A Typed object allows a value to have its type explicitly\n * specified.\n *\n * For example, in Solidity, the value ``45`` could represent a\n * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent\n * a ``bytes2`` or ``bytes``.\n *\n * Since JavaScript has no meaningful way to explicitly inform any\n * APIs which what the type is, this allows transparent interoperation\n * with Soldity.\n *\n * @_subsection: api/abi:Typed Values\n */\nimport { assertPrivate, defineProperties } from \"../utils/index.js\";\nconst _gaurd = {};\nfunction n(value, width) {\n let signed = false;\n if (width < 0) {\n signed = true;\n width *= -1;\n }\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `${signed ? \"\" : \"u\"}int${width}`, value, {\n signed,\n width,\n });\n}\nfunction b(value, size) {\n // @TODO: Check range is valid for value\n return new Typed(_gaurd, `bytes${size ? size : \"\"}`, value, { size });\n}\nconst _typedSymbol = Symbol.for(\"_corebc_typed\");\nexport class Typed {\n type;\n value;\n #options;\n _typedSymbol;\n constructor(gaurd, type, value, options) {\n if (options == null) {\n options = null;\n }\n assertPrivate(_gaurd, gaurd, \"Typed\");\n defineProperties(this, { _typedSymbol, type, value });\n this.#options = options;\n // Check the value is valid\n this.format();\n }\n format() {\n if (this.type === \"array\") {\n throw new Error(\"\");\n }\n else if (this.type === \"dynamicArray\") {\n throw new Error(\"\");\n }\n else if (this.type === \"tuple\") {\n return `tuple(${this.value.map((v) => v.format()).join(\",\")})`;\n }\n return this.type;\n }\n defaultValue() {\n return 0;\n }\n minValue() {\n return 0;\n }\n maxValue() {\n return 0;\n }\n isBigInt() {\n return !!this.type.match(/^u?int[0-9]+$/);\n }\n isData() {\n return this.type.startsWith(\"bytes\");\n }\n isString() {\n return this.type === \"string\";\n }\n get tupleName() {\n if (this.type !== \"tuple\") {\n throw TypeError(\"not a tuple\");\n }\n return this.#options;\n }\n // Returns the length of this type as an array\n // - `null` indicates the length is unforced, it could be dynamic\n // - `-1` indicates the length is dynamic\n // - any other value indicates it is a static array and is its length\n get arrayLength() {\n if (this.type !== \"array\") {\n throw TypeError(\"not an array\");\n }\n if (this.#options === true) {\n return -1;\n }\n if (this.#options === false) {\n return this.value.length;\n }\n return null;\n }\n static from(type, value) {\n return new Typed(_gaurd, type, value);\n }\n static uint8(v) {\n return n(v, 8);\n }\n static uint16(v) {\n return n(v, 16);\n }\n static uint24(v) {\n return n(v, 24);\n }\n static uint32(v) {\n return n(v, 32);\n }\n static uint40(v) {\n return n(v, 40);\n }\n static uint48(v) {\n return n(v, 48);\n }\n static uint56(v) {\n return n(v, 56);\n }\n static uint64(v) {\n return n(v, 64);\n }\n static uint72(v) {\n return n(v, 72);\n }\n static uint80(v) {\n return n(v, 80);\n }\n static uint88(v) {\n return n(v, 88);\n }\n static uint96(v) {\n return n(v, 96);\n }\n static uint104(v) {\n return n(v, 104);\n }\n static uint112(v) {\n return n(v, 112);\n }\n static uint120(v) {\n return n(v, 120);\n }\n static uint128(v) {\n return n(v, 128);\n }\n static uint136(v) {\n return n(v, 136);\n }\n static uint144(v) {\n return n(v, 144);\n }\n static uint152(v) {\n return n(v, 152);\n }\n static uint160(v) {\n return n(v, 160);\n }\n static uint168(v) {\n return n(v, 168);\n }\n static uint176(v) {\n return n(v, 176);\n }\n static uint184(v) {\n return n(v, 184);\n }\n static uint192(v) {\n return n(v, 192);\n }\n static uint200(v) {\n return n(v, 200);\n }\n static uint208(v) {\n return n(v, 208);\n }\n static uint216(v) {\n return n(v, 216);\n }\n static uint224(v) {\n return n(v, 224);\n }\n static uint232(v) {\n return n(v, 232);\n }\n static uint240(v) {\n return n(v, 240);\n }\n static uint248(v) {\n return n(v, 248);\n }\n static uint256(v) {\n return n(v, 256);\n }\n static uint(v) {\n return n(v, 256);\n }\n static int8(v) {\n return n(v, -8);\n }\n static int16(v) {\n return n(v, -16);\n }\n static int24(v) {\n return n(v, -24);\n }\n static int32(v) {\n return n(v, -32);\n }\n static int40(v) {\n return n(v, -40);\n }\n static int48(v) {\n return n(v, -48);\n }\n static int56(v) {\n return n(v, -56);\n }\n static int64(v) {\n return n(v, -64);\n }\n static int72(v) {\n return n(v, -72);\n }\n static int80(v) {\n return n(v, -80);\n }\n static int88(v) {\n return n(v, -88);\n }\n static int96(v) {\n return n(v, -96);\n }\n static int104(v) {\n return n(v, -104);\n }\n static int112(v) {\n return n(v, -112);\n }\n static int120(v) {\n return n(v, -120);\n }\n static int128(v) {\n return n(v, -128);\n }\n static int136(v) {\n return n(v, -136);\n }\n static int144(v) {\n return n(v, -144);\n }\n static int152(v) {\n return n(v, -152);\n }\n static int160(v) {\n return n(v, -160);\n }\n static int168(v) {\n return n(v, -168);\n }\n static int176(v) {\n return n(v, -176);\n }\n static int184(v) {\n return n(v, -184);\n }\n static int192(v) {\n return n(v, -192);\n }\n static int200(v) {\n return n(v, -200);\n }\n static int208(v) {\n return n(v, -208);\n }\n static int216(v) {\n return n(v, -216);\n }\n static int224(v) {\n return n(v, -224);\n }\n static int232(v) {\n return n(v, -232);\n }\n static int240(v) {\n return n(v, -240);\n }\n static int248(v) {\n return n(v, -248);\n }\n static int256(v) {\n return n(v, -256);\n }\n static int(v) {\n return n(v, -256);\n }\n static bytes1(v) {\n return b(v, 1);\n }\n static bytes2(v) {\n return b(v, 2);\n }\n static bytes3(v) {\n return b(v, 3);\n }\n static bytes4(v) {\n return b(v, 4);\n }\n static bytes5(v) {\n return b(v, 5);\n }\n static bytes6(v) {\n return b(v, 6);\n }\n static bytes7(v) {\n return b(v, 7);\n }\n static bytes8(v) {\n return b(v, 8);\n }\n static bytes9(v) {\n return b(v, 9);\n }\n static bytes10(v) {\n return b(v, 10);\n }\n static bytes11(v) {\n return b(v, 11);\n }\n static bytes12(v) {\n return b(v, 12);\n }\n static bytes13(v) {\n return b(v, 13);\n }\n static bytes14(v) {\n return b(v, 14);\n }\n static bytes15(v) {\n return b(v, 15);\n }\n static bytes16(v) {\n return b(v, 16);\n }\n static bytes17(v) {\n return b(v, 17);\n }\n static bytes18(v) {\n return b(v, 18);\n }\n static bytes19(v) {\n return b(v, 19);\n }\n static bytes20(v) {\n return b(v, 20);\n }\n static bytes21(v) {\n return b(v, 21);\n }\n static bytes22(v) {\n return b(v, 22);\n }\n static bytes23(v) {\n return b(v, 23);\n }\n static bytes24(v) {\n return b(v, 24);\n }\n static bytes25(v) {\n return b(v, 25);\n }\n static bytes26(v) {\n return b(v, 26);\n }\n static bytes27(v) {\n return b(v, 27);\n }\n static bytes28(v) {\n return b(v, 28);\n }\n static bytes29(v) {\n return b(v, 29);\n }\n static bytes30(v) {\n return b(v, 30);\n }\n static bytes31(v) {\n return b(v, 31);\n }\n static bytes32(v) {\n return b(v, 32);\n }\n static address(v) {\n return new Typed(_gaurd, \"address\", v);\n }\n static bool(v) {\n return new Typed(_gaurd, \"bool\", !!v);\n }\n static bytes(v) {\n return new Typed(_gaurd, \"bytes\", v);\n }\n static string(v) {\n return new Typed(_gaurd, \"string\", v);\n }\n static array(v, dynamic) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"array\", v, dynamic);\n }\n static tuple(v, name) {\n throw new Error(\"not implemented yet\");\n return new Typed(_gaurd, \"tuple\", v, name);\n }\n static overrides(v) {\n return new Typed(_gaurd, \"overrides\", Object.assign({}, v));\n }\n /**\n * Returns true only if %%value%% is a [[Typed]] instance.\n */\n static isTyped(value) {\n return value && value._typedSymbol === _typedSymbol;\n }\n /**\n * If the value is a [[Typed]] instance, validates the underlying value\n * and returns it, otherwise returns value directly.\n *\n * This is useful for functions that with to accept either a [[Typed]]\n * object or values.\n */\n static dereference(value, type) {\n if (Typed.isTyped(value)) {\n if (value.type !== type) {\n throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);\n }\n return value.value;\n }\n return value;\n }\n}\n//# sourceMappingURL=typed.js.map"],"names":["assertPrivate","defineProperties"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,MAAM,GAAG,EAAE;AACjB,SAAS,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE;AACzB,IAAI,IAAI,MAAM,GAAG,KAAK;AACtB,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE;AACnB,QAAQ,MAAM,GAAG,IAAI;AACrB,QAAQ,KAAK,IAAI,EAAE;AACnB,IAAI;AACJ;AACA,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE;AACvE,QAAQ,MAAM;AACd,QAAQ,KAAK;AACb,KAAK,CAAC;AACN;AACA,SAAS,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE;AACxB;AACA,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IA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AI,OAAO,MAAM,CAAC,CAAC,EAAE;AACrB,QAAQ,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC7C,IAAI;AACJ,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE;AAC7B,QAAQ,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC;AAE9C,IAAI;AACJ,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE;AAC1B,QAAQ,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC;AAE9C,IAAI;AACJ,IAAI,OAAO,SAAS,CAAC,CAAC,EAAE;AACxB,QAAQ,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACnE,IAAI;AACJ;AACA;AACA;AACA,IAAI,OAAO,OAAO,CAAC,KAAK,EAAE;AAC1B,QAAQ,OAAO,KAAK,IAAI,KAAK,CAAC,YAAY,KAAK,YAAY;AAC3D,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE;AACpC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAClC,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE;AACrC,gBAAgB,MAAM,IAAI,KAAK,CAAC,CAAC,uBAAuB,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACpF,YAAY;AACZ,YAAY,OAAO,KAAK,CAAC,KAAK;AAC9B,QAAQ;AACR,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/address/checks.d.ts b/lib.commonjs/address/checks.d.ts deleted file mode 100644 index 865b0aca9..000000000 --- a/lib.commonjs/address/checks.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Addressable, AddressLike } from "./index.js"; -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.corebc.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -export declare function isAddressable(value: any): value is Addressable; -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -export declare function isAddress(value: any): value is string; -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -export declare function resolveAddress(target: AddressLike): string | Promise; -//# sourceMappingURL=checks.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/address/checks.d.ts.map b/lib.commonjs/address/checks.d.ts.map deleted file mode 100644 index 936fbc09c..000000000 --- a/lib.commonjs/address/checks.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAMrD;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAe5E"} \ No newline at end of file diff --git a/lib.commonjs/address/checks.js b/lib.commonjs/address/checks.js deleted file mode 100644 index 4eaca62e9..000000000 --- a/lib.commonjs/address/checks.js +++ /dev/null @@ -1,125 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var index = require('./index.js'); - -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.corebc.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -function isAddressable(value) { - return value && typeof value.getAddress === "function"; -} -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -function isAddress(value) { - try { - index.getAddress(value); - return true; - } - catch (error) { } - return false; -} -async function checkAddress(target, promise) { - const result = await promise; - if (result == null || - result === "0x0000000000000000000000000000000000000000") { - errors.assert(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - errors.assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return index.getAddress(result); -} -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -function resolveAddress(target) { - if (typeof target === "string") { - return index.getAddress(target); - // assert(resolver != null, "ENS resolution requires a provider", - // "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - // return checkAddress(target, resolver.resolveName(target)); - } - else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } - else if (target && typeof target.then === "function") { - return checkAddress(target, target); - } - errors.assertArgument(false, "unsupported addressable value", "target", target); -} - -exports.isAddress = isAddress; -exports.isAddressable = isAddressable; -exports.resolveAddress = resolveAddress; -//# sourceMappingURL=checks.js.map diff --git a/lib.commonjs/address/checks.js.map b/lib.commonjs/address/checks.js.map deleted file mode 100644 index 5ce9ae069..000000000 --- a/lib.commonjs/address/checks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checks.js","sources":["../../lib.esm/address/checks.js"],"sourcesContent":["import { assert, assertArgument } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\n/**\n * Returns true if %%value%% is an object which implements the\n * [[Addressable]] interface.\n *\n * @example:\n * // Wallets and AbstractSigner sub-classes\n * isAddressable(Wallet.createRandom())\n * //_result:\n *\n * // Contracts\n * contract = new Contract(\"dai.tokens.corebc.eth\", [ ], provider)\n * isAddressable(contract)\n * //_result:\n */\nexport function isAddressable(value) {\n return value && typeof value.getAddress === \"function\";\n}\n/**\n * Returns true if %%value%% is a valid address.\n *\n * @example:\n * // Valid address\n * isAddress(\"0x8ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Valid ICAP address\n * isAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\")\n * //_result:\n *\n * // Invalid checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBa72\")\n * //_result:\n *\n * // Invalid ICAP checksum\n * isAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_result:\n *\n * // Not an address (an ENS name requires a provided and an\n * // asynchronous API to access)\n * isAddress(\"ricmoo.eth\")\n * //_result:\n */\nexport function isAddress(value) {\n try {\n getAddress(value);\n return true;\n }\n catch (error) { }\n return false;\n}\nasync function checkAddress(target, promise) {\n const result = await promise;\n if (result == null ||\n result === \"0x0000000000000000000000000000000000000000\") {\n assert(typeof target !== \"string\", \"unconfigured name\", \"UNCONFIGURED_NAME\", { value: target });\n assertArgument(false, \"invalid AddressLike value; did not resolve to a value address\", \"target\", target);\n }\n return getAddress(result);\n}\n/**\n * Resolves to an address for the %%target%%, which may be any\n * supported address type, an [[Addressable]] or a Promise which\n * resolves to an address.\n *\n * If an ENS name is provided, but that name has not been correctly\n * configured a [[UnconfiguredNameError]] is thrown.\n *\n * @example:\n * addr = \"0x6B175474E89094C44Da98b954EedeAC495271d0F\"\n *\n * // Addresses are return synchronously\n * resolveAddress(addr, provider)\n * //_result:\n *\n * // Address promises are resolved asynchronously\n * resolveAddress(Promise.resolve(addr))\n * //_result:\n *\n *\n * // Addressable objects are resolved asynchronously\n * contract = new Contract(addr, [ ])\n * resolveAddress(contract, provider)\n * //_result:\n *\n * // Unconfigured ENS names reject\n * resolveAddress(\"nothing-here.ricmoo.eth\", provider)\n * //_error:\n *\n * // ENS names require a NameResolver object passed in\n * // (notice the provider was omitted)\n * resolveAddress(\"nothing-here.ricmoo.eth\")\n * //_error:\n */\nexport function resolveAddress(target) {\n if (typeof target === \"string\") {\n return getAddress(target);\n // assert(resolver != null, \"ENS resolution requires a provider\",\n // \"UNSUPPORTED_OPERATION\", { operation: \"resolveName\" });\n // return checkAddress(target, resolver.resolveName(target));\n }\n else if (isAddressable(target)) {\n return checkAddress(target, target.getAddress());\n }\n else if (target && typeof target.then === \"function\") {\n return checkAddress(target, target);\n }\n assertArgument(false, \"unsupported addressable value\", \"target\", target);\n}\n//# sourceMappingURL=checks.js.map"],"names":["getAddress","assert","assertArgument"],"mappings":";;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,KAAK,EAAE;AACrC,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,IAAI;AACR,QAAQA,gBAAU,CAAC,KAAK,CAAC;AACzB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE,EAAE;AACpB,IAAI,OAAO,KAAK;AAChB;AACA,eAAe,YAAY,CAAC,MAAM,EAAE,OAAO,EAAE;AAC7C,IAAI,MAAM,MAAM,GAAG,MAAM,OAAO;AAChC,IAAI,IAAI,MAAM,IAAI,IAAI;AACtB,QAAQ,MAAM,KAAK,4CAA4C,EAAE;AACjE,QAAQC,aAAM,CAAC,OAAO,MAAM,KAAK,QAAQ,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACvG,QAAQC,qBAAc,CAAC,KAAK,EAAE,+DAA+D,EAAE,QAAQ,EAAE,MAAM,CAAC;AAChH,IAAI;AACJ,IAAI,OAAOF,gBAAU,CAAC,MAAM,CAAC;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,MAAM,EAAE;AACvC,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACpC,QAAQ,OAAOA,gBAAU,CAAC,MAAM,CAAC;AACjC;AACA;AACA;AACA,IAAI;AACJ,SAAS,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE;AACpC,QAAQ,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;AACxD,IAAI;AACJ,SAAS,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE;AAC1D,QAAQ,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;AAC3C,IAAI;AACJ,IAAIE,qBAAc,CAAC,KAAK,EAAE,+BAA+B,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC5E;;;;"} \ No newline at end of file diff --git a/lib.commonjs/address/contract-address.d.ts b/lib.commonjs/address/contract-address.d.ts deleted file mode 100644 index 5aaa076ad..000000000 --- a/lib.commonjs/address/contract-address.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -export declare function getCreateAddress(tx: { - from: string; - nonce: BigNumberish; -}): string; -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -export declare function getCreate2Address(from: string, salt: BytesLike, initCodeHash: BytesLike): string; -//# sourceMappingURL=contract-address.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/address/contract-address.d.ts.map b/lib.commonjs/address/contract-address.d.ts.map deleted file mode 100644 index c9b527dd2..000000000 --- a/lib.commonjs/address/contract-address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,GAAG,MAAM,CAcT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,SAAS,GACrB,MAAM,CAoBR"} \ No newline at end of file diff --git a/lib.commonjs/address/contract-address.js b/lib.commonjs/address/contract-address.js deleted file mode 100644 index 22c883e0e..000000000 --- a/lib.commonjs/address/contract-address.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -var data = require('../utils/data.js'); -require('../utils/errors.js'); -var logger$1 = require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -var index = require('./index.js'); -var sha3 = require('../crypto/sha3.js'); -var address = require('../transaction/address.js'); - -const logger = new logger$1.Logger("contract-address/0.0.1"); -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -function getCreateAddress(tx) { - const from = index.getAddress(tx.from); - const nonce = maths.getBigInt(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } - else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } - else { - nonceHex = "0x" + nonceHex; - } - return index.getAddress(from); -} -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -function getCreate2Address(from, salt, initCodeHash) { - if (data.hexDataLength(salt) !== 32) { - logger.throwArgumentError("salt must be 32 bytes", "salt", salt); - } - if (data.hexDataLength(initCodeHash) !== 32) { - logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash); - } - const val = data.hexDataSlice(sha3.sha256(data.concat(["0xff", index.getAddress(from), salt, initCodeHash])), 12); - console.log({ "contract-address/74=>should be string": val }); - const prefix = from.substring(2, 4); - const checksum = index.calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + address.removeHexPrefix(val); -} - -exports.getCreate2Address = getCreate2Address; -exports.getCreateAddress = getCreateAddress; -//# sourceMappingURL=contract-address.js.map diff --git a/lib.commonjs/address/contract-address.js.map b/lib.commonjs/address/contract-address.js.map deleted file mode 100644 index ebc6c8aae..000000000 --- a/lib.commonjs/address/contract-address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract-address.js","sources":["../../lib.esm/address/contract-address.js"],"sourcesContent":["import { concat, \n// dataSlice,\ngetBigInt,\n// encodeRlp\n } from \"../utils/index.js\";\nimport { getAddress } from \"./index.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { hexDataLength, hexDataSlice } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { removeHexPrefix } from \"../transaction/address.js\";\nimport { calculateCheckSum } from \"./index.js\";\nconst logger = new Logger(\"contract-address/0.0.1\");\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(from);\n}\n/**\n * Returns the address that would result from a ``CREATE2`` operation\n * with the given %%from%%, %%salt%% and %%initCodeHash%%.\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 * getCreate2Address(from, salt, initCodeHash)\n * //_result:\n */\nexport function getCreate2Address(from, salt, initCodeHash) {\n if (hexDataLength(salt) !== 32) {\n logger.throwArgumentError(\"salt must be 32 bytes\", \"salt\", salt);\n }\n if (hexDataLength(initCodeHash) !== 32) {\n logger.throwArgumentError(\"initCodeHash must be 32 bytes\", \"initCodeHash\", initCodeHash);\n }\n const val = hexDataSlice(sha256(concat([\"0xff\", getAddress(from), salt, initCodeHash])), 12);\n console.log({ \"contract-address/74=>should be string\": val });\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\n//# sourceMappingURL=contract-address.js.map"],"names":["Logger","getAddress","getBigInt","hexDataLength","hexDataSlice","sha256","concat","calculateCheckSum","removeHexPrefix"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,wBAAwB,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,EAAE,EAAE;AACrC,IAAI,MAAM,IAAI,GAAGC,gBAAU,CAAC,EAAE,CAAC,IAAI,CAAC;AACpC,IAAI,MAAM,KAAK,GAAGC,eAAS,CAAC,EAAE,CAAC,KAAK,EAAE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,MAAM,CAAC;AACnD,IAAI,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAGC,uBAAe,CAAC,GAAG,CAAC;AAC1D;;;"} \ No newline at end of file diff --git a/lib.commonjs/address/index.d.ts b/lib.commonjs/address/index.d.ts deleted file mode 100644 index 180d9faa2..000000000 --- a/lib.commonjs/address/index.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Addresses are a fundamental part of interacting with Core. They - * represent the gloabal identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Core Naming Service (CNS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -/** - * An interface for objects which have an address, and can - * resolve it asyncronously. - * - * This allows objects such as [[Signer]] or [[Contract]] to - * be used most places an address can be, for example getting - * the [balance](Provider-getBalance). - */ -export interface Addressable { - /** - * Get the object address. - */ - getAddress(): Promise; -} -/** - * Anything that can be used to return or resolve an address. - */ -export type AddressLike = string | Promise | Addressable; -/** - * An interface for any object which can resolve an ENS name. - */ -export interface NameResolver { -} -import { BigNumberish } from "../bigNumber/bigNumber.js"; -declare function calculateCheckSum(_address: string, _prefix: string): string; -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Core uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -declare function getAddress(address: string): string; -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -declare function getIcapAddress(address: string): string; -declare function networkIdToPrefix(networkId: number): string; -declare function getContractAddress(transaction: { - from: string; - nonce: BigNumberish; -}): string; -export { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/address/index.d.ts.map b/lib.commonjs/address/index.d.ts.map deleted file mode 100644 index 86a6e44f8..000000000 --- a/lib.commonjs/address/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;CAQ5B;AAED,OAAO,EAAa,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA8BpE,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBpE;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoB3C;AACD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,UAmBA;AAED,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GAClB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/address/index.js b/lib.commonjs/address/index.js deleted file mode 100644 index 98d960fac..000000000 --- a/lib.commonjs/address/index.js +++ /dev/null @@ -1,205 +0,0 @@ -'use strict'; - -var bigNumber = require('../bigNumber/bigNumber.js'); -var rlp = require('../crypto/rlp.js'); -var sha3 = require('../crypto/sha3.js'); -var logger$1 = require('../logger/logger.js'); -var data = require('../utils/data.js'); - -/** - * Addresses are a fundamental part of interacting with Core. They - * represent the gloabal identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Core Naming Service (CNS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -const logger = new logger$1.Logger("address/0.0.1"); -const precompiledAddresses = [ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000002", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000005", - "0000000000000000000000000000000000000000000000000000000000000006", - "0000000000000000000000000000000000000000000000000000000000000007", - "0000000000000000000000000000000000000000000000000000000000000008", - "0000000000000000000000000000000000000000000000000000000000000009", -]; -function removeHexPrefix(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; -} -function calculateCheckSum(_address, _prefix) { - const address = data.getBytes("0x" + _address.replace("0x", "")); - const prefix = data.getBytes("0x" + _prefix.replace("0x", "")); - const tmpConcated = new Uint8Array([...address, ...prefix]); - const hexedConcat = data.hexlify(tmpConcated).replace("0x", "") + "00"; - const mods = Array.from(hexedConcat.toUpperCase(), (c) => { - const charCode = c.charCodeAt(0); - return charCode > 64 && charCode < 91 - ? (charCode - 55).toString() - : (charCode - 48).toString(); - }).join(""); - const bigVal = BigInt(mods); - const val97 = BigInt(97); - const val98 = BigInt(98); - const remainder = bigVal % val97; - const checkSum = val98 - remainder; - const result = checkSum > 9 ? checkSum.toString() : "0" + checkSum.toString(); - return result; -} -// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number -// Create lookup table -const ibanLookup = {}; -for (let i = 0; i < 10; i++) { - ibanLookup[String(i)] = String(i); -} -for (let i = 0; i < 26; i++) { - ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); -} -// How many decimal digits can we process? (for 64-bit float, this is 15) -// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER)); -const safeDigits = 15; -function ibanChecksum(address) { - address = address.toUpperCase(); - address = address.substring(4) + address.substring(0, 2) + "00"; - let expanded = address - .split("") - .map((c) => { - return ibanLookup[c]; - }) - .join(""); - // Javascript can handle integers safely up to 15 (decimal) digits - while (expanded.length >= safeDigits) { - let block = expanded.substring(0, safeDigits); - expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length); - } - let checksum = String(98 - (parseInt(expanded, 10) % 97)); - while (checksum.length < 2) { - checksum = "0" + checksum; - } - return checksum; -} -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Core uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -function getAddress(address) { - if (typeof address !== "string") { - logger.throwArgumentError("invalid address", "address", address); - } - if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) { - logger.throwArgumentError("invalid address", "address", address); - } - const raw = removeHexPrefix(address); - if (precompiledAddresses.includes(raw)) { - return "0x" + raw; - } - const prefix = raw.substring(0, 2); - const val = raw.substring(4); - const checksum = calculateCheckSum(val, prefix); - if (checksum !== raw.substring(2, 4)) { - logger.throwArgumentError("bad address checksum", "address", address); - } - return "0x" + prefix + checksum + val; -} -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -function getIcapAddress(address) { - //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); - let base36 = BigInt(getAddress(address)).toString(36).toUpperCase(); - while (base36.length < 30) { - base36 = "0" + base36; - } - return "XE" + ibanChecksum("XE00" + base36) + base36; -} -function networkIdToPrefix(networkId) { - if (networkId == 1) { - return "cb"; - } - else if (networkId == 3 || networkId == 4) { - return "ab"; - } - else if (networkId > 10 || networkId == 0) { - return "ce"; - } - else { - logger.throwArgumentError("bad networkId", "networkId", networkId); - return ""; - } -} -function getContractAddress(transaction) { - let from = null; - try { - from = getAddress(transaction.from); - } - catch (error) { - logger.throwArgumentError("missing from address", "transaction", transaction); - } - const nonce = data.stripZeros(data.arrayify(bigNumber.BigNumber.from(transaction.nonce).toHexString())); - const val = data.hexDataSlice(sha3.sha256(rlp.encode([from, nonce])), 12); - const prefix = from.substring(2, 4); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); -} - -exports.calculateCheckSum = calculateCheckSum; -exports.getAddress = getAddress; -exports.getContractAddress = getContractAddress; -exports.getIcapAddress = getIcapAddress; -exports.networkIdToPrefix = networkIdToPrefix; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/address/index.js.map b/lib.commonjs/address/index.js.map deleted file mode 100644 index 28cefeeff..000000000 --- a/lib.commonjs/address/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../lib.esm/address/index.js"],"sourcesContent":["/**\n * Addresses are a fundamental part of interacting with Core. They\n * represent the gloabal identity of Externally Owned Accounts (accounts\n * backed by a private key) and contracts.\n *\n * The Core Naming Service (CNS) provides an interconnected ecosystem\n * of contracts, standards and libraries which enable looking up an\n * address for an ENS name.\n *\n * These functions help convert between various formats, validate\n * addresses and safely resolve ENS names.\n *\n * @_section: api/address:Addresses [about-addresses]\n */\nnull;\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { encode } from \"../crypto/rlp.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexDataSlice, hexlify, stripZeros, } from \"../utils/data.js\";\nconst logger = new Logger(\"address/0.0.1\");\nconst precompiledAddresses = [\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n \"0000000000000000000000000000000000000000000000000000000000000001\",\n \"0000000000000000000000000000000000000000000000000000000000000002\",\n \"0000000000000000000000000000000000000000000000000000000000000003\",\n \"0000000000000000000000000000000000000000000000000000000000000004\",\n \"0000000000000000000000000000000000000000000000000000000000000005\",\n \"0000000000000000000000000000000000000000000000000000000000000006\",\n \"0000000000000000000000000000000000000000000000000000000000000007\",\n \"0000000000000000000000000000000000000000000000000000000000000008\",\n \"0000000000000000000000000000000000000000000000000000000000000009\",\n];\nfunction removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nfunction calculateCheckSum(_address, _prefix) {\n const address = getBytes(\"0x\" + _address.replace(\"0x\", \"\"));\n const prefix = getBytes(\"0x\" + _prefix.replace(\"0x\", \"\"));\n const tmpConcated = new Uint8Array([...address, ...prefix]);\n const hexedConcat = hexlify(tmpConcated).replace(\"0x\", \"\") + \"00\";\n const mods = Array.from(hexedConcat.toUpperCase(), (c) => {\n const charCode = c.charCodeAt(0);\n return charCode > 64 && charCode < 91\n ? (charCode - 55).toString()\n : (charCode - 48).toString();\n }).join(\"\");\n const bigVal = BigInt(mods);\n const val97 = BigInt(97);\n const val98 = BigInt(98);\n const remainder = bigVal % val97;\n const checkSum = val98 - remainder;\n const result = checkSum > 9 ? checkSum.toString() : \"0\" + checkSum.toString();\n return result;\n}\n// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number\n// Create lookup table\nconst ibanLookup = {};\nfor (let i = 0; i < 10; i++) {\n ibanLookup[String(i)] = String(i);\n}\nfor (let i = 0; i < 26; i++) {\n ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);\n}\n// How many decimal digits can we process? (for 64-bit float, this is 15)\n// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER));\nconst safeDigits = 15;\nfunction ibanChecksum(address) {\n address = address.toUpperCase();\n address = address.substring(4) + address.substring(0, 2) + \"00\";\n let expanded = address\n .split(\"\")\n .map((c) => {\n return ibanLookup[c];\n })\n .join(\"\");\n // Javascript can handle integers safely up to 15 (decimal) digits\n while (expanded.length >= safeDigits) {\n let block = expanded.substring(0, safeDigits);\n expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length);\n }\n let checksum = String(98 - (parseInt(expanded, 10) % 97));\n while (checksum.length < 2) {\n checksum = \"0\" + checksum;\n }\n return checksum;\n}\n/**\n * Returns a normalized and checksumed address for %%address%%.\n * This accepts non-checksum addresses, checksum addresses and\n * [[getIcapAddress]] formats.\n *\n * The checksum in Core uses the capitalization (upper-case\n * vs lower-case) of the characters within an address to encode\n * its checksum, which offers, on average, a checksum of 15-bits.\n *\n * If %%address%% contains both upper-case and lower-case, it is\n * assumed to already be a checksum address and its checksum is\n * validated, and if the address fails its expected checksum an\n * error is thrown.\n *\n * If you wish the checksum of %%address%% to be ignore, it should\n * be converted to lower-case (i.e. ``.toLowercase()``) before\n * being passed in. This should be a very rare situation though,\n * that you wish to bypass the safegaurds in place to protect\n * against an address that has been incorrectly copied from another\n * source.\n *\n * @example:\n * // Adds the checksum (via upper-casing specific letters)\n * getAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\")\n * //_result:\n *\n * // Converts ICAP address and adds checksum\n * getAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if an address contains mixed case,\n * // but the checksum fails\n * getAddress(\"0x8Ba1f109551bD432803012645Ac136ddd64DBA72\")\n * //_error:\n */\nfunction getAddress(address) {\n if (typeof address !== \"string\") {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) {\n logger.throwArgumentError(\"invalid address\", \"address\", address);\n }\n const raw = removeHexPrefix(address);\n if (precompiledAddresses.includes(raw)) {\n return \"0x\" + raw;\n }\n const prefix = raw.substring(0, 2);\n const val = raw.substring(4);\n const checksum = calculateCheckSum(val, prefix);\n if (checksum !== raw.substring(2, 4)) {\n logger.throwArgumentError(\"bad address checksum\", \"address\", address);\n }\n return \"0x\" + prefix + checksum + val;\n}\n/**\n * The [ICAP Address format](link-icap) format is an early checksum\n * format which attempts to be compatible with the banking\n * industry [IBAN format](link-wiki-iban) for bank accounts.\n *\n * It is no longer common or a recommended format.\n *\n * @example:\n * getIcapAddress(\"0x8ba1f109551bd432803012645ac136ddd64dba72\");\n * //_result:\n *\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36\");\n * //_result:\n *\n * // Throws an error if the ICAP checksum is wrong\n * getIcapAddress(\"XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37\");\n * //_error:\n */\nfunction getIcapAddress(address) {\n //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase();\n let base36 = BigInt(getAddress(address)).toString(36).toUpperCase();\n while (base36.length < 30) {\n base36 = \"0\" + base36;\n }\n return \"XE\" + ibanChecksum(\"XE00\" + base36) + base36;\n}\nfunction networkIdToPrefix(networkId) {\n if (networkId == 1) {\n return \"cb\";\n }\n else if (networkId == 3 || networkId == 4) {\n return \"ab\";\n }\n else if (networkId > 10 || networkId == 0) {\n return \"ce\";\n }\n else {\n logger.throwArgumentError(\"bad networkId\", \"networkId\", networkId);\n return \"\";\n }\n}\nfunction getContractAddress(transaction) {\n let from = null;\n try {\n from = getAddress(transaction.from);\n }\n catch (error) {\n logger.throwArgumentError(\"missing from address\", \"transaction\", transaction);\n }\n const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString()));\n const val = hexDataSlice(sha256(encode([from, nonce])), 12);\n const prefix = from.substring(2, 4);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, };\n//# sourceMappingURL=index.js.map"],"names":["Logger","getBytes","hexlify","stripZeros","arrayify","BigNumber","hexDataSlice","sha256","encode"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAOA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,eAAe,CAAC;AAC1C,MAAM,oBAAoB,GAAG;AAC7B,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,IAAI,kEAAkE;AACtE,CAAC;AACD,SAAS,eAAe,CAAC,GAAG,EAAE;AAC9B,IAAI,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG;AAChE;AACA,SAAS,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE;AAC9C,IAAI,MAAM,OAAO,GAAGC,aAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC/D,IAAI,MAAM,MAAM,GAAGA,aAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC7D,IAAI,MAAM,WAAW,GAAG,IAAI,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;AAC/D,IAAI,MAAM,WAAW,GAAGC,YAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI;AACrE,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,WAA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OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC;AAC1D;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/bigNumber/bigNumber.d.ts b/lib.commonjs/bigNumber/bigNumber.d.ts deleted file mode 100644 index 089132488..000000000 --- a/lib.commonjs/bigNumber/bigNumber.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Bytes, Hexable } from "../utils/data.js"; -export type BigNumberish = BigNumber | Bytes | bigint | string | number; -export declare function isBigNumberish(value: any): value is BigNumberish; -export declare class BigNumber implements Hexable { - readonly _hex: string; - readonly _isBigNumber: boolean; - constructor(constructorGuard: any, hex: string); - fromTwos(value: number): BigNumber; - toTwos(value: number): BigNumber; - abs(): BigNumber; - add(other: BigNumberish): BigNumber; - sub(other: BigNumberish): BigNumber; - div(other: BigNumberish): BigNumber; - mul(other: BigNumberish): BigNumber; - mod(other: BigNumberish): BigNumber; - pow(other: BigNumberish): BigNumber; - and(other: BigNumberish): BigNumber; - or(other: BigNumberish): BigNumber; - xor(other: BigNumberish): BigNumber; - mask(value: number): BigNumber; - shl(value: number): BigNumber; - shr(value: number): BigNumber; - eq(other: BigNumberish): boolean; - lt(other: BigNumberish): boolean; - lte(other: BigNumberish): boolean; - gt(other: BigNumberish): boolean; - gte(other: BigNumberish): boolean; - isNegative(): boolean; - isZero(): boolean; - toNumber(): number; - toBigInt(): bigint; - toString(): string; - toHexString(): string; - toJSON(key?: string): any; - static from(value: any): BigNumber; - static isBigNumber(value: any): value is BigNumber; -} -export declare function _base36To16(value: string): string; -export declare function _base16To36(value: string): string; -//# sourceMappingURL=bigNumber.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/bigNumber/bigNumber.d.ts.map b/lib.commonjs/bigNumber/bigNumber.d.ts.map deleted file mode 100644 index 5dcf4c8f7..000000000 --- a/lib.commonjs/bigNumber/bigNumber.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bigNumber.d.ts","sourceR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G,SAAS,CAK5B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,MAAM,IAAI,OAAO,CAEhB;IAED,QAAQ,IAAI,MAAM,CAQjB;IAED,QAAQ,IAAI,MAAM,CAYjB;IAED,QAAQ,IAAI,MAAM,CAyBjB;IAED,WAAW,IAAI,MAAM,CAEpB;IAED,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAExB;IAED,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAuEjC;IAED,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAEjD;CACD;AA6ED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"} \ No newline at end of file diff --git a/lib.commonjs/bigNumber/bigNumber.js b/lib.commonjs/bigNumber/bigNumber.js deleted file mode 100644 index 75ec96f44..000000000 --- a/lib.commonjs/bigNumber/bigNumber.js +++ /dev/null @@ -1,313 +0,0 @@ -'use strict'; - -var _BN = require('bn.js'); -var logger$1 = require('../logger/logger.js'); -var data = require('../utils/data.js'); - -var BN = _BN.BN; -const logger = new logger$1.Logger("bigNumber/0.0.1"); -const _constructorGuard = {}; -const MAX_SAFE = 0x1fffffffffffff; -function isBigNumberish(value) { - return (value != null && - (BigNumber.isBigNumber(value) || - (typeof value === "number" && value % 1 === 0) || - (typeof value === "string" && !!value.match(/^-?[0-9]+$/)) || - data.isHexString(value) || - typeof value === "bigint" || - data.isBytes(value))); -} -// Only warn about passing 10 into radix once -let _warnedToStringRadix = false; -class BigNumber { - _hex; - _isBigNumber; - constructor(constructorGuard, hex) { - logger.checkNew(new.target, BigNumber); - if (constructorGuard !== _constructorGuard) { - logger.throwError("cannot call constructor directly; use BigNumber.from", logger$1.Logger.errors.UNSUPPORTED_OPERATION, { - operation: "new (BigNumber)", - }); - } - this._hex = hex; - this._isBigNumber = true; - Object.freeze(this); - } - fromTwos(value) { - return toBigNumber(toBN(this).fromTwos(value)); - } - toTwos(value) { - return toBigNumber(toBN(this).toTwos(value)); - } - abs() { - if (this._hex[0] === "-") { - return BigNumber.from(this._hex.substring(1)); - } - return this; - } - add(other) { - return toBigNumber(toBN(this).add(toBN(other))); - } - sub(other) { - return toBigNumber(toBN(this).sub(toBN(other))); - } - div(other) { - const o = BigNumber.from(other); - if (o.isZero()) { - throwFault("division by zero", "div"); - } - return toBigNumber(toBN(this).div(toBN(other))); - } - mul(other) { - return toBigNumber(toBN(this).mul(toBN(other))); - } - mod(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot modulo negative values", "mod"); - } - return toBigNumber(toBN(this).umod(value)); - } - pow(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot raise to negative values", "pow"); - } - return toBigNumber(toBN(this).pow(value)); - } - and(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'and' negative values", "and"); - } - return toBigNumber(toBN(this).and(value)); - } - or(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'or' negative values", "or"); - } - return toBigNumber(toBN(this).or(value)); - } - xor(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'xor' negative values", "xor"); - } - return toBigNumber(toBN(this).xor(value)); - } - mask(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot mask negative values", "mask"); - } - return toBigNumber(toBN(this).maskn(value)); - } - shl(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shl"); - } - return toBigNumber(toBN(this).shln(value)); - } - shr(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shr"); - } - return toBigNumber(toBN(this).shrn(value)); - } - eq(other) { - return toBN(this).eq(toBN(other)); - } - lt(other) { - return toBN(this).lt(toBN(other)); - } - lte(other) { - return toBN(this).lte(toBN(other)); - } - gt(other) { - return toBN(this).gt(toBN(other)); - } - gte(other) { - return toBN(this).gte(toBN(other)); - } - isNegative() { - return this._hex[0] === "-"; - } - isZero() { - return toBN(this).isZero(); - } - toNumber() { - try { - return toBN(this).toNumber(); - } - catch (error) { - throwFault("overflow", "toNumber", this.toString()); - } - // @ts-ignore - return null; - } - toBigInt() { - try { - return BigInt(this.toString()); - } - catch (e) { } - return logger.throwError("this platform does not support BigInt", logger$1.Logger.errors.UNSUPPORTED_OPERATION, { - value: this.toString(), - }); - } - toString() { - // Lots of people expect this, which we do not support, so check (See: #889) - if (arguments.length > 0) { - if (arguments[0] === 10) { - if (!_warnedToStringRadix) { - _warnedToStringRadix = true; - logger.warn("BigNumber.toString does not accept any parameters; base-10 is assumed"); - } - } - else if (arguments[0] === 16) { - logger.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", logger$1.Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - else { - logger.throwError("BigNumber.toString does not accept parameters", logger$1.Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - } - return toBN(this).toString(10); - } - toHexString() { - return this._hex; - } - toJSON(key) { - return { type: "BigNumber", hex: this.toHexString() }; - } - static from(value) { - if (value instanceof BigNumber) { - return value; - } - if (typeof value === "string") { - if (value.match(/^-?0x[0-9a-f]+$/i)) { - return new BigNumber(_constructorGuard, toHex(value)); - } - if (value.match(/^-?[0-9]+$/)) { - return new BigNumber(_constructorGuard, toHex(new BN(value))); - } - return logger.throwArgumentError("invalid BigNumber string", "value", value); - } - if (typeof value === "number") { - if (value % 1) { - throwFault("underflow", "BigNumber.from", value); - } - if (value >= MAX_SAFE || value <= -MAX_SAFE) { - throwFault("overflow", "BigNumber.from", value); - } - return BigNumber.from(String(value)); - } - const anyValue = value; - if (typeof anyValue === "bigint") { - return BigNumber.from(anyValue.toString()); - } - if (data.isBytes(anyValue)) { - return BigNumber.from(data.hexlify(anyValue)); - } - if (anyValue) { - // Hexable interface (takes priority) - if (anyValue.toHexString) { - const hex = anyValue.toHexString(); - if (typeof hex === "string") { - return BigNumber.from(hex); - } - } - else { - // For now, handle legacy JSON-ified values (goes away in v6) - let hex = anyValue._hex; - // New-form JSON - if (hex == null && anyValue.type === "BigNumber") { - hex = anyValue.hex; - } - if (typeof hex === "string") { - if (data.isHexString(hex) || - (hex[0] === "-" && data.isHexString(hex.substring(1)))) { - return BigNumber.from(hex); - } - } - } - } - return logger.throwArgumentError("invalid BigNumber value", "value", value); - } - static isBigNumber(value) { - return !!(value && value._isBigNumber); - } -} -// Normalize the hex string -// @ts-ignore -function toHex(value) { - // For BN, call on the hex string - if (typeof value !== "string") { - return toHex(value.toString(16)); - } - // If negative, prepend the negative sign to the normalized positive value - if (value[0] === "-") { - // Strip off the negative sign - value = value.substring(1); - // Cannot have multiple negative signs (e.g. "--0x04") - if (value[0] === "-") { - logger.throwArgumentError("invalid hex", "value", value); - } - // Call toHex on the positive component - value = toHex(value); - // Do not allow "-0x00" - if (value === "0x00") { - return value; - } - // Negate the value - return "-" + value; - } - // Add a "0x" prefix if missing - if (value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - // Normalize zero - if (value === "0x") { - return "0x00"; - } - // Make the string even length - if (value.length % 2) { - value = "0x0" + value.substring(2); - } - // Trim to smallest even-length string - while (value.length > 4 && value.substring(0, 4) === "0x00") { - value = "0x" + value.substring(4); - } - return value; -} -// @ts-ignore -function toBigNumber(value) { - return BigNumber.from(toHex(value)); -} -// @ts-ignore -function toBN(value) { - const hex = BigNumber.from(value).toHexString(); - if (hex[0] === "-") { - return new BN("-" + hex.substring(3), 16); - } - return new BN(hex.substring(2), 16); -} -function throwFault(fault, operation, value) { - const params = { fault: fault, operation: operation }; - if (value != null) { - params.value = value; - } - return logger.throwError(fault, logger$1.Logger.errors.NUMERIC_FAULT, params); -} -// value should have no prefix -function _base36To16(value) { - return new BN(value, 36).toString(16); -} -// value should have no prefix -function _base16To36(value) { - return new BN(value, 16).toString(36); -} - -exports.BigNumber = BigNumber; -exports._base16To36 = _base16To36; -exports._base36To16 = _base36To16; -exports.isBigNumberish = isBigNumberish; -//# sourceMappingURL=bigNumber.js.map diff --git a/lib.commonjs/bigNumber/bigNumber.js.map b/lib.commonjs/bigNumber/bigNumber.js.map deleted file mode 100644 index 4048029b7..000000000 --- a/lib.commonjs/bigNumber/bigNumber.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bigNumber.js","sources":["../../lib.esm/bigNumber/bigNumber.js"],"sourcesContent":["\"use strict\";\n/**\n * BigNumber\n *\n * A wrapper around the BN.js object. We use the BN.js library\n * because it is used by elliptic, so it is required regardless.\n *\n */\nimport _BN from \"bn.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { isBytes, hexlify, isHexString, } from \"../utils/data.js\";\nvar BN = _BN.BN;\nconst logger = new Logger(\"bigNumber/0.0.1\");\nconst _constructorGuard = {};\nconst MAX_SAFE = 0x1fffffffffffff;\nexport function isBigNumberish(value) {\n return (value != null &&\n (BigNumber.isBigNumber(value) ||\n (typeof value === \"number\" && value % 1 === 0) ||\n (typeof value === \"string\" && !!value.match(/^-?[0-9]+$/)) ||\n isHexString(value) ||\n typeof value === \"bigint\" ||\n isBytes(value)));\n}\n// Only warn about passing 10 into radix once\nlet _warnedToStringRadix = false;\nexport class BigNumber {\n _hex;\n _isBigNumber;\n constructor(constructorGuard, hex) {\n logger.checkNew(new.target, BigNumber);\n if (constructorGuard !== _constructorGuard) {\n logger.throwError(\"cannot call constructor directly; use BigNumber.from\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"new (BigNumber)\",\n });\n }\n this._hex = hex;\n this._isBigNumber = true;\n Object.freeze(this);\n }\n fromTwos(value) {\n return toBigNumber(toBN(this).fromTwos(value));\n }\n toTwos(value) {\n return toBigNumber(toBN(this).toTwos(value));\n }\n abs() {\n if (this._hex[0] === \"-\") {\n return BigNumber.from(this._hex.substring(1));\n }\n return this;\n }\n add(other) {\n return toBigNumber(toBN(this).add(toBN(other)));\n }\n sub(other) {\n return toBigNumber(toBN(this).sub(toBN(other)));\n }\n div(other) {\n const o = BigNumber.from(other);\n if (o.isZero()) {\n throwFault(\"division by zero\", \"div\");\n }\n return toBigNumber(toBN(this).div(toBN(other)));\n }\n mul(other) {\n return toBigNumber(toBN(this).mul(toBN(other)));\n }\n mod(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot modulo negative values\", \"mod\");\n }\n return toBigNumber(toBN(this).umod(value));\n }\n pow(other) {\n const value = toBN(other);\n if (value.isNeg()) {\n throwFault(\"cannot raise to negative values\", \"pow\");\n }\n return toBigNumber(toBN(this).pow(value));\n }\n and(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'and' negative values\", \"and\");\n }\n return toBigNumber(toBN(this).and(value));\n }\n or(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'or' negative values\", \"or\");\n }\n return toBigNumber(toBN(this).or(value));\n }\n xor(other) {\n const value = toBN(other);\n if (this.isNegative() || value.isNeg()) {\n throwFault(\"cannot 'xor' negative values\", \"xor\");\n }\n return toBigNumber(toBN(this).xor(value));\n }\n mask(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot mask negative values\", \"mask\");\n }\n return toBigNumber(toBN(this).maskn(value));\n }\n shl(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shl\");\n }\n return toBigNumber(toBN(this).shln(value));\n }\n shr(value) {\n if (this.isNegative() || value < 0) {\n throwFault(\"cannot shift negative values\", \"shr\");\n }\n return toBigNumber(toBN(this).shrn(value));\n }\n eq(other) {\n return toBN(this).eq(toBN(other));\n }\n lt(other) {\n return toBN(this).lt(toBN(other));\n }\n lte(other) {\n return toBN(this).lte(toBN(other));\n }\n gt(other) {\n return toBN(this).gt(toBN(other));\n }\n gte(other) {\n return toBN(this).gte(toBN(other));\n }\n isNegative() {\n return this._hex[0] === \"-\";\n }\n isZero() {\n return toBN(this).isZero();\n }\n toNumber() {\n try {\n return toBN(this).toNumber();\n }\n catch (error) {\n throwFault(\"overflow\", \"toNumber\", this.toString());\n }\n // @ts-ignore\n return null;\n }\n toBigInt() {\n try {\n return BigInt(this.toString());\n }\n catch (e) { }\n return logger.throwError(\"this platform does not support BigInt\", Logger.errors.UNSUPPORTED_OPERATION, {\n value: this.toString(),\n });\n }\n toString() {\n // Lots of people expect this, which we do not support, so check (See: #889)\n if (arguments.length > 0) {\n if (arguments[0] === 10) {\n if (!_warnedToStringRadix) {\n _warnedToStringRadix = true;\n logger.warn(\"BigNumber.toString does not accept any parameters; base-10 is assumed\");\n }\n }\n else if (arguments[0] === 16) {\n logger.throwError(\"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n else {\n logger.throwError(\"BigNumber.toString does not accept parameters\", Logger.errors.UNEXPECTED_ARGUMENT, {});\n }\n }\n return toBN(this).toString(10);\n }\n toHexString() {\n return this._hex;\n }\n toJSON(key) {\n return { type: \"BigNumber\", hex: this.toHexString() };\n }\n static from(value) {\n if (value instanceof BigNumber) {\n return value;\n }\n if (typeof value === \"string\") {\n if (value.match(/^-?0x[0-9a-f]+$/i)) {\n return new BigNumber(_constructorGuard, toHex(value));\n }\n if (value.match(/^-?[0-9]+$/)) {\n return new BigNumber(_constructorGuard, toHex(new BN(value)));\n }\n return logger.throwArgumentError(\"invalid BigNumber string\", \"value\", value);\n }\n if (typeof value === \"number\") {\n if (value % 1) {\n throwFault(\"underflow\", \"BigNumber.from\", value);\n }\n if (value >= MAX_SAFE || value <= -MAX_SAFE) {\n throwFault(\"overflow\", \"BigNumber.from\", value);\n }\n return BigNumber.from(String(value));\n }\n const anyValue = value;\n if (typeof anyValue === \"bigint\") {\n return BigNumber.from(anyValue.toString());\n }\n if (isBytes(anyValue)) {\n return BigNumber.from(hexlify(anyValue));\n }\n if (anyValue) {\n // Hexable interface (takes priority)\n if (anyValue.toHexString) {\n const hex = anyValue.toHexString();\n if (typeof hex === \"string\") {\n return BigNumber.from(hex);\n }\n }\n else {\n // For now, handle legacy JSON-ified values (goes away in v6)\n let hex = anyValue._hex;\n // New-form JSON\n if (hex == null && anyValue.type === \"BigNumber\") {\n hex = anyValue.hex;\n }\n if (typeof hex === \"string\") {\n if (isHexString(hex) ||\n (hex[0] === \"-\" && isHexString(hex.substring(1)))) {\n return BigNumber.from(hex);\n }\n }\n }\n }\n return logger.throwArgumentError(\"invalid BigNumber value\", \"value\", value);\n }\n static isBigNumber(value) {\n return !!(value && value._isBigNumber);\n }\n}\n// Normalize the hex string\n// @ts-ignore\nfunction toHex(value) {\n // For BN, call on the hex string\n if (typeof value !== \"string\") {\n return toHex(value.toString(16));\n }\n // If negative, prepend the negative sign to the normalized positive value\n if (value[0] === \"-\") {\n // Strip off the negative sign\n value = value.substring(1);\n // Cannot have multiple negative signs (e.g. \"--0x04\")\n if (value[0] === \"-\") {\n logger.throwArgumentError(\"invalid hex\", \"value\", value);\n }\n // Call toHex on the positive component\n value = toHex(value);\n // Do not allow \"-0x00\"\n if (value === \"0x00\") {\n return value;\n }\n // Negate the value\n return \"-\" + value;\n }\n // Add a \"0x\" prefix if missing\n if (value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n // Normalize zero\n if (value === \"0x\") {\n return \"0x00\";\n }\n // Make the string even length\n if (value.length % 2) {\n value = \"0x0\" + value.substring(2);\n }\n // Trim to smallest even-length string\n while (value.length > 4 && value.substring(0, 4) === \"0x00\") {\n value = \"0x\" + value.substring(4);\n }\n return value;\n}\n// @ts-ignore\nfunction toBigNumber(value) {\n return BigNumber.from(toHex(value));\n}\n// @ts-ignore\nfunction toBN(value) {\n const hex = BigNumber.from(value).toHexString();\n if (hex[0] === \"-\") {\n return new BN(\"-\" + hex.substring(3), 16);\n }\n return new BN(hex.substring(2), 16);\n}\nfunction throwFault(fault, operation, value) {\n const params = { fault: fault, operation: operation };\n if (value != null) {\n params.value = value;\n }\n return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params);\n}\n// value should have no prefix\nexport function _base36To16(value) {\n return new BN(value, 36).toString(16);\n}\n// value should have no prefix\nexport function _base16To36(value) {\n return new BN(value, 16).toString(36);\n}\n//# sourceMappingURL=bigNumber.js.map"],"names":["Logger","isHexString","isBytes","hexlify"],"mappings":";;;;;;AAWA,IAAI,EAAE,GAAG,GAAG,CAAC,EAAE;AACf,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,iBAAiB,CAAC;AAC5C,MAAM,iBAAiB,GAAG,EAAE;AAC5B,MAAM,QAAQ,GAAG,gBAAgB;AAC1B,SAAS,cAAc,CAAC,KAAK,EAAE;AACtC,IAAI,QAAQ,KAAK,IAAI,IAAI;AACzB,SAAS,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC;AACrC,aAAa,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC;AAC1D,aAAa,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACtE,YAAYC,gBAAW,CAAC,KAAK,CAAC;AAC9B,YAAY,OAAO,KAAK,KAAK,QAAQ;AACrC,YAAYC,YAAO,CAAC,KAAK,CAAC,CAAC;AAC3B;AACA;AACA,IAAI,oBAAoB,GAAG,KAAK;AACzB,MAAM,SAAS,CAAC;AACvB,IAAI,IAAI;AACR,IAAI,YAAY;AAChB,IAAI,WAAW,CAAC,gBAAgB,EAAE,GAAG,EAAE;AACvC,QAAQ,MAAM,CAAC,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AU,CAAC,KAAK,EAAED,eAAM,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC;AACxE;AACA;AACO,SAAS,WAAW,CAAC,KAAK,EAAE;AACnC,IAAI,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AACzC;AACA;AACO,SAAS,WAAW,CAAC,KAAK,EAAE;AACnC,IAAI,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AACzC;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/cip/custom-units.d.ts b/lib.commonjs/cip/custom-units.d.ts deleted file mode 100644 index 58031982f..000000000 --- a/lib.commonjs/cip/custom-units.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { AddressLike } from "../address/index.js"; -import { Contract } from "../contract/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -export declare const customUnitAbi: readonly string[]; -export declare class CustomUnitDiscovery { - readonly preferredUnit: string; - readonly supportedUnits: readonly string[]; - constructor(units: readonly string[], preferredUnit: string); - get isValid(): boolean; - supports(unit: string): boolean; -} -/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ -export declare class CustomUnitBalance { - readonly canonicalAmount: bigint; - readonly unitAmount: bigint; - readonly unit: string; - constructor(canonicalAmount: bigint, unitAmount: bigint, unit: string); - get multiplierNumerator(): bigint; - get multiplierDenominator(): bigint; -} -/** Core custom-unit contract convention used by Tone and Core API. */ -export declare class CustomUnitToken { - readonly contract: Contract; - constructor(address: string, runner: ContractRunner); - supportsUnit(unit: string, blockTag?: BlockTag): Promise; - supportedUnits(blockTag?: BlockTag): Promise; - preferredUnit(blockTag?: BlockTag): Promise; - discover(blockTag?: BlockTag): Promise; - canonicalBalance(account: AddressLike, blockTag?: BlockTag): Promise; - balanceOfUnit(account: AddressLike, unit: string, blockTag?: BlockTag): Promise; - balance(account: AddressLike, unit?: string, blockTag?: BlockTag): Promise; -} -//# sourceMappingURL=custom-units.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/cip/custom-units.d.ts.map b/lib.commonjs/cip/custom-units.d.ts.map deleted file mode 100644 index 69faaea75..000000000 --- a/lib.commonjs/cip/custom-units.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"custom-units.d.ts","sourceRoot":"","sources":["../../src.ts/cip/custom-units.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,eAAO,MAAM,aAAa,mBAMxB,CAAC;AACH,qBAAa,mBAAmB;IAI9B,QAAQ,CAAC,aAAa,EAAE,MAAM;IAH/B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,YACC,KAAK,EAAE,SAAS,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,EAG9B;IACD,IAAI,OAAO,IAAI,OAAO,CAMrB;IACD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9B;CACD;AACD,iFAAiF;AACjF,qBAAa,iBAAiB;IAE5B,QAAQ,CAAC,eAAe,EAAE,MAAM;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM;IAHtB,YACU,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAClB;IACJ,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IACD,IAAI,qBAAqB,IAAI,MAAM,CAElC;CACD;AACD,sEAAsE;AACtE,qBAAa,eAAe;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,YAAY,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAElD;IACK,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAKtE;IACK,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAIpE;IACK,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAExD;IACK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAOvE;IACD,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3E;IACD,aAAa,CACZ,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,CAAC,CAGjB;IACK,OAAO,CACZ,OAAO,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAO5B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/cip/custom-units.js b/lib.commonjs/cip/custom-units.js deleted file mode 100644 index 483a9ed29..000000000 --- a/lib.commonjs/cip/custom-units.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict'; - -var contract = require('../contract/contract.js'); -require('../abi/abi-coder.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../abi/fragments.js'); -require('../crypto/keccak.js'); -require('../crypto/sha3.js'); -require('../constants/numbers.js'); -require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -require('../providers/provider.js'); - -const customUnitAbi = Object.freeze([ - "function supportsUnit(string unit) view returns (bool)", - "function supportedUnits() view returns (string[])", - "function preferredUnit() view returns (string)", - "function balanceOf(address account) view returns (uint256)", - "function balanceOfUnit(address account, string unit) view returns (uint256)", -]); -class CustomUnitDiscovery { - preferredUnit; - supportedUnits; - constructor(units, preferredUnit) { - this.preferredUnit = preferredUnit; - this.supportedUnits = Object.freeze([...units]); - } - get isValid() { - return (this.supports("units") && - this.preferredUnit !== "" && - this.supports(this.preferredUnit)); - } - supports(unit) { - return this.supportedUnits.includes(unit); - } -} -/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ -class CustomUnitBalance { - canonicalAmount; - unitAmount; - unit; - constructor(canonicalAmount, unitAmount, unit) { - this.canonicalAmount = canonicalAmount; - this.unitAmount = unitAmount; - this.unit = unit; - } - get multiplierNumerator() { - return this.unitAmount; - } - get multiplierDenominator() { - return this.canonicalAmount; - } -} -/** Core custom-unit contract convention used by Tone and Core API. */ -class CustomUnitToken { - contract; - constructor(address, runner) { - this.contract = new contract.Contract(address, customUnitAbi, runner); - } - async supportsUnit(unit, blockTag) { - return (unit.trim() !== "" && - (await this.contract.supportsUnit(unit.trim(), { blockTag }))); - } - async supportedUnits(blockTag) { - return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag }))); - } - async preferredUnit(blockTag) { - return (await this.contract.preferredUnit({ blockTag })).trim(); - } - async discover(blockTag) { - if (!(await this.supportsUnit("units", blockTag))) - return null; - const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag)); - return discovery.isValid ? discovery : null; - } - canonicalBalance(account, blockTag) { - return this.contract.balanceOf(account, { blockTag }); - } - balanceOfUnit(account, unit, blockTag) { - if (!unit.trim()) - throw new TypeError("unit must not be empty"); - return this.contract.balanceOfUnit(account, unit.trim(), { blockTag }); - } - async balance(account, unit, blockTag) { - const resolved = unit?.trim() || (await this.preferredUnit(blockTag)); - const [canonical, calculated] = await Promise.all([ - this.canonicalBalance(account, blockTag), - this.balanceOfUnit(account, resolved, blockTag), - ]); - return new CustomUnitBalance(canonical, calculated, resolved); - } -} - -exports.CustomUnitBalance = CustomUnitBalance; -exports.CustomUnitDiscovery = CustomUnitDiscovery; -exports.CustomUnitToken = CustomUnitToken; -exports.customUnitAbi = customUnitAbi; -//# sourceMappingURL=custom-units.js.map diff --git a/lib.commonjs/cip/custom-units.js.map b/lib.commonjs/cip/custom-units.js.map deleted file mode 100644 index 33da55ab8..000000000 --- a/lib.commonjs/cip/custom-units.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"custom-units.js","sources":["../../lib.esm/cip/custom-units.js"],"sourcesContent":["import { Contract } from \"../contract/index.js\";\nexport const customUnitAbi = Object.freeze([\n \"function supportsUnit(string unit) view returns (bool)\",\n \"function supportedUnits() view returns (string[])\",\n \"function preferredUnit() view returns (string)\",\n \"function balanceOf(address account) view returns (uint256)\",\n \"function balanceOfUnit(address account, string unit) view returns (uint256)\",\n]);\nexport class CustomUnitDiscovery {\n preferredUnit;\n supportedUnits;\n constructor(units, preferredUnit) {\n this.preferredUnit = preferredUnit;\n this.supportedUnits = Object.freeze([...units]);\n }\n get isValid() {\n return (this.supports(\"units\") &&\n this.preferredUnit !== \"\" &&\n this.supports(this.preferredUnit));\n }\n supports(unit) {\n return this.supportedUnits.includes(unit);\n }\n}\n/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */\nexport class CustomUnitBalance {\n canonicalAmount;\n unitAmount;\n unit;\n constructor(canonicalAmount, unitAmount, unit) {\n this.canonicalAmount = canonicalAmount;\n this.unitAmount = unitAmount;\n this.unit = unit;\n }\n get multiplierNumerator() {\n return this.unitAmount;\n }\n get multiplierDenominator() {\n return this.canonicalAmount;\n }\n}\n/** Core custom-unit contract convention used by Tone and Core API. */\nexport class CustomUnitToken {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, customUnitAbi, runner);\n }\n async supportsUnit(unit, blockTag) {\n return (unit.trim() !== \"\" &&\n (await this.contract.supportsUnit(unit.trim(), { blockTag })));\n }\n async supportedUnits(blockTag) {\n return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag })));\n }\n async preferredUnit(blockTag) {\n return (await this.contract.preferredUnit({ blockTag })).trim();\n }\n async discover(blockTag) {\n if (!(await this.supportsUnit(\"units\", blockTag)))\n return null;\n const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag));\n return discovery.isValid ? discovery : null;\n }\n canonicalBalance(account, blockTag) {\n return this.contract.balanceOf(account, { blockTag });\n }\n balanceOfUnit(account, unit, blockTag) {\n if (!unit.trim())\n throw new TypeError(\"unit must not be empty\");\n return this.contract.balanceOfUnit(account, unit.trim(), { blockTag });\n }\n async balance(account, unit, blockTag) {\n const resolved = unit?.trim() || (await this.preferredUnit(blockTag));\n const [canonical, calculated] = await Promise.all([\n this.canonicalBalance(account, blockTag),\n this.balanceOfUnit(account, resolved, blockTag),\n ]);\n return new CustomUnitBalance(canonical, calculated, resolved);\n }\n}\n//# sourceMappingURL=custom-units.js.map"],"names":["Contract"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACY,MAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;AAC3C,IAAI,wDAAwD;AAC5D,IAAI,mDAAmD;AACvD,IAAI,gDAAgD;AACpD,IAAI,4DAA4D;AAChE,IAAI,6EAA6E;AACjF,CAAC;AACM,MAAM,mBAAmB,CAAC;AACjC,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,IAAI,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE;AACtC,QAAQ,IAAI,CAAC,aAAa,GAAG,aAAa;AAC1C,QAAQ,IAAI,CAAC,cAAc,GAAG,MAAM,CA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AAE,QAAQ,EAAE,CAAC;AAC9E,IAAI;AACJ,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;AAC3C,QAAQ,MAAM,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAC7E,QAAQ,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;AAC1D,YAAY,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC;AACpD,YAAY,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;AAC3D,SAAS,CAAC;AACV,QAAQ,OAAO,IAAI,iBAAiB,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC;AACrE,IAAI;AACJ;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/cip/index.d.ts b/lib.commonjs/cip/index.d.ts deleted file mode 100644 index cdd86e31b..000000000 --- a/lib.commonjs/cip/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Contract } from "../contract/index.js"; -import type { Overrides, ContractTransactionResponse } from "../contract/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -import { IpfsGateway } from "../ipfs/index.js"; -/** On-chain interface defined by CIP-150. */ -export declare const cip150Abi: readonly string[]; -export interface Cip150MetadataEntry { - readonly key: string; - readonly value: string; - readonly sealed?: boolean; -} -export declare const cip151TokenExpirationKey = "tokenExpiration"; -export declare const cip151TradingStopKey = "tradingStop"; -export declare const cip152LabKey = "lab"; -/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ -export declare class Cip151Lifecycle { - readonly tokenExpiration: bigint | null; - readonly tradingStop: bigint | null; - constructor(metadata?: Readonly>); - isExpiredAt(seconds: bigint): boolean; - isTradingStoppedAt(seconds: bigint): boolean; -} -export interface Cip152LabMeasurement { - readonly value: string | number; - readonly unit?: string; -} -/** Validates certificate structure, not the authenticity of its issuer. */ -export declare class Cip152LabCertificate { - readonly measurements: Readonly>; - constructor(json: unknown); -} -/** Typed metadata reader and writer. Writes require a signer as runner. */ -export declare class Cip150MetadataContract { - readonly contract: Contract; - constructor(address: string, runner: ContractRunner); - getValue(key: string, blockTag?: BlockTag): Promise; - hasKey(key: string, blockTag?: BlockTag): Promise; - isSealed(key: string, blockTag?: BlockTag): Promise; - listKeys(blockTag?: BlockTag): Promise; - getByIndex(index: bigint, blockTag?: BlockTag): Promise; - count(blockTag?: BlockTag): Promise; - readAll(blockTag?: BlockTag, includeSealedState?: boolean): Promise; - setValue(key: string, value: string, overrides?: Overrides): Promise; - sealKey(key: string, overrides?: Overrides): Promise; - readLifecycle(blockTag?: BlockTag): Promise; - readLabCertificate(gateway: IpfsGateway, blockTag?: BlockTag): Promise; -} -export { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from "./custom-units.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/cip/index.d.ts.map b/lib.commonjs/cip/index.d.ts.map deleted file mode 100644 index d0120ee3c..000000000 --- a/lib.commonjs/cip/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/cip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EACX,SAAS,EACT,2BAA2B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,6CAA6C;AAC7C,eAAO,MAAM,SAAS,mBASpB,CAAC;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,E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AE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAE3D;IACK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAI9D;IACK,UAAU,CACf,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAK9B;IACD,KAAK,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAE1C;IACK,OAAO,CACZ,QAAQ,CAAC,EAAE,QAAQ,EACnB,kBAAkB,UAAO,GACvB,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC,CAazC;IACD,QAAQ,CACP,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,SAAc,GACvB,OAAO,CAAC,2BAA2B,CAAC,CAEtC;IACD,OAAO,CACN,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,SAAc,GACvB,OAAO,CAAC,2BAA2B,CAAC,CAEtC;IACK,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAOjE;IACK,kBAAkB,CACvB,OAAO,EAAE,WAAW,EACpB,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAMtC;CACD;AACD,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACb,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/cip/index.js b/lib.commonjs/cip/index.js deleted file mode 100644 index 0178da54f..000000000 --- a/lib.commonjs/cip/index.js +++ /dev/null @@ -1,167 +0,0 @@ -'use strict'; - -var contract = require('../contract/contract.js'); -require('../abi/abi-coder.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../abi/fragments.js'); -require('../crypto/keccak.js'); -require('../crypto/sha3.js'); -require('../constants/numbers.js'); -require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -require('../providers/provider.js'); -var customUnits = require('./custom-units.js'); - -/** On-chain interface defined by CIP-150. */ -const cip150Abi = Object.freeze([ - "function getMetadataValue(string key) view returns (string value)", - "function hasMetadataKey(string key) view returns (bool exists)", - "function isMetadataSealed(string key) view returns (bool sealed)", - "function listMetadataKeys() view returns (string[] keys)", - "function getMetadataByIndex(uint256 index) view returns (string key, string value)", - "function metadataCount() view returns (uint256 total)", - "function setMetadataValue(string key, string value)", - "function sealMetadataKey(string key)", -]); -const cip151TokenExpirationKey = "tokenExpiration"; -const cip151TradingStopKey = "tradingStop"; -const cip152LabKey = "lab"; -/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ -class Cip151Lifecycle { - tokenExpiration; - tradingStop; - constructor(metadata = {}) { - const parse = (key) => { - const value = metadata[key]; - if (value == null || value === "") - return null; - if (!/^\d+$/.test(value)) - throw new TypeError(`${key} must be a non-negative Unix timestamp`); - return BigInt(value); - }; - this.tokenExpiration = parse(cip151TokenExpirationKey); - this.tradingStop = parse(cip151TradingStopKey); - } - isExpiredAt(seconds) { - return this.tokenExpiration !== null && seconds >= this.tokenExpiration; - } - isTradingStoppedAt(seconds) { - return this.tradingStop !== null && seconds >= this.tradingStop; - } -} -/** Validates certificate structure, not the authenticity of its issuer. */ -class Cip152LabCertificate { - measurements; - constructor(json) { - if (json === null || typeof json !== "object" || Array.isArray(json)) - throw new TypeError("CIP-152 lab.json must be an object"); - const measurements = Object.create(null); - for (const [key, property] of Object.entries(json)) { - if (!property || - typeof property !== "object" || - Array.isArray(property) || - !Object.hasOwn(property, "value")) - throw new TypeError(`CIP-152 property ${key} must contain a value`); - const { value, unit } = property; - if (!(typeof value === "string" || - (typeof value === "number" && Number.isFinite(value)))) - throw new TypeError(`CIP-152 property ${key} has an invalid value`); - if (unit != null && typeof unit !== "string") - throw new TypeError(`CIP-152 property ${key} has an invalid unit`); - measurements[key] = Object.freeze(unit == null ? { value } : { value, unit }); - } - this.measurements = Object.freeze(measurements); - } -} -/** Typed metadata reader and writer. Writes require a signer as runner. */ -class Cip150MetadataContract { - contract; - constructor(address, runner) { - this.contract = new contract.Contract(address, cip150Abi, runner); - } - getValue(key, blockTag) { - return this.contract.getMetadataValue(key, { blockTag }); - } - hasKey(key, blockTag) { - return this.contract.hasMetadataKey(key, { blockTag }); - } - isSealed(key, blockTag) { - return this.contract.isMetadataSealed(key, { blockTag }); - } - async listKeys(blockTag) { - return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag }))); - } - async getByIndex(index, blockTag) { - const [key, value] = await this.contract.getMetadataByIndex(index, { - blockTag, - }); - return Object.freeze({ key, value }); - } - count(blockTag) { - return this.contract.metadataCount({ blockTag }); - } - async readAll(blockTag, includeSealedState = true) { - const entries = []; - for (const key of await this.listKeys(blockTag)) { - const value = await this.getValue(key, blockTag); - entries.push(Object.freeze(includeSealedState - ? { key, value, sealed: await this.isSealed(key, blockTag) } - : { key, value })); - } - return Object.freeze(entries); - } - setValue(key, value, overrides = {}) { - return this.contract.setMetadataValue(key, value, overrides); - } - sealKey(key, overrides = {}) { - return this.contract.sealMetadataKey(key, overrides); - } - async readLifecycle(blockTag) { - const metadata = {}; - for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) { - if (await this.hasKey(key, blockTag)) - metadata[key] = await this.getValue(key, blockTag); - } - return new Cip151Lifecycle(metadata); - } - async readLabCertificate(gateway, blockTag) { - if (!(await this.hasKey(cip152LabKey, blockTag))) - return null; - const reference = await this.getValue(cip152LabKey, blockTag); - if (!gateway.resolve(reference).pathname.endsWith("/lab.json")) - throw new TypeError("CIP-152 reference must point to lab.json"); - return new Cip152LabCertificate(await gateway.readJson(reference)); - } -} - -exports.CustomUnitBalance = customUnits.CustomUnitBalance; -exports.CustomUnitDiscovery = customUnits.CustomUnitDiscovery; -exports.CustomUnitToken = customUnits.CustomUnitToken; -exports.customUnitAbi = customUnits.customUnitAbi; -exports.Cip150MetadataContract = Cip150MetadataContract; -exports.Cip151Lifecycle = Cip151Lifecycle; -exports.Cip152LabCertificate = Cip152LabCertificate; -exports.cip150Abi = cip150Abi; -exports.cip151TokenExpirationKey = cip151TokenExpirationKey; -exports.cip151TradingStopKey = cip151TradingStopKey; -exports.cip152LabKey = cip152LabKey; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/cip/index.js.map b/lib.commonjs/cip/index.js.map deleted file mode 100644 index 726708259..000000000 --- a/lib.commonjs/cip/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../lib.esm/cip/index.js"],"sourcesContent":["import { Contract } from \"../contract/index.js\";\n/** On-chain interface defined by CIP-150. */\nexport const cip150Abi = Object.freeze([\n \"function getMetadataValue(string key) view returns (string value)\",\n \"function hasMetadataKey(string key) view returns (bool exists)\",\n \"function isMetadataSealed(string key) view returns (bool sealed)\",\n \"function listMetadataKeys() view returns (string[] keys)\",\n \"function getMetadataByIndex(uint256 index) view returns (string key, string value)\",\n \"function metadataCount() view returns (uint256 total)\",\n \"function setMetadataValue(string key, string value)\",\n \"function sealMetadataKey(string key)\",\n]);\nexport const cip151TokenExpirationKey = \"tokenExpiration\";\nexport const cip151TradingStopKey = \"tradingStop\";\nexport const cip152LabKey = \"lab\";\n/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */\nexport class Cip151Lifecycle {\n tokenExpiration;\n tradingStop;\n constructor(metadata = {}) {\n const parse = (key) => {\n const value = metadata[key];\n if (value == null || value === \"\")\n return null;\n if (!/^\\d+$/.test(value))\n throw new TypeError(`${key} must be a non-negative Unix timestamp`);\n return BigInt(value);\n };\n this.tokenExpiration = parse(cip151TokenExpirationKey);\n this.tradingStop = parse(cip151TradingStopKey);\n }\n isExpiredAt(seconds) {\n return this.tokenExpiration !== null && seconds >= this.tokenExpiration;\n }\n isTradingStoppedAt(seconds) {\n return this.tradingStop !== null && seconds >= this.tradingStop;\n }\n}\n/** Validates certificate structure, not the authenticity of its issuer. */\nexport class Cip152LabCertificate {\n measurements;\n constructor(json) {\n if (json === null || typeof json !== \"object\" || Array.isArray(json))\n throw new TypeError(\"CIP-152 lab.json must be an object\");\n const measurements = Object.create(null);\n for (const [key, property] of Object.entries(json)) {\n if (!property ||\n typeof property !== \"object\" ||\n Array.isArray(property) ||\n !Object.hasOwn(property, \"value\"))\n throw new TypeError(`CIP-152 property ${key} must contain a value`);\n const { value, unit } = property;\n if (!(typeof value === \"string\" ||\n (typeof value === \"number\" && Number.isFinite(value))))\n throw new TypeError(`CIP-152 property ${key} has an invalid value`);\n if (unit != null && typeof unit !== \"string\")\n throw new TypeError(`CIP-152 property ${key} has an invalid unit`);\n measurements[key] = Object.freeze(unit == null ? { value } : { value, unit });\n }\n this.measurements = Object.freeze(measurements);\n }\n}\n/** Typed metadata reader and writer. Writes require a signer as runner. */\nexport class Cip150MetadataContract {\n contract;\n constructor(address, runner) {\n this.contract = new Contract(address, cip150Abi, runner);\n }\n getValue(key, blockTag) {\n return this.contract.getMetadataValue(key, { blockTag });\n }\n hasKey(key, blockTag) {\n return this.contract.hasMetadataKey(key, { blockTag });\n }\n isSealed(key, blockTag) {\n return this.contract.isMetadataSealed(key, { blockTag });\n }\n async listKeys(blockTag) {\n return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag })));\n }\n async getByIndex(index, blockTag) {\n const [key, value] = await this.contract.getMetadataByIndex(index, {\n blockTag,\n });\n return Object.freeze({ key, value });\n }\n count(blockTag) {\n return this.contract.metadataCount({ blockTag });\n }\n async readAll(blockTag, includeSealedState = true) {\n const entries = [];\n for (const key of await this.listKeys(blockTag)) {\n const value = await this.getValue(key, blockTag);\n entries.push(Object.freeze(includeSealedState\n ? { key, value, sealed: await this.isSealed(key, blockTag) }\n : { key, value }));\n }\n return Object.freeze(entries);\n }\n setValue(key, value, overrides = {}) {\n return this.contract.setMetadataValue(key, value, overrides);\n }\n sealKey(key, overrides = {}) {\n return this.contract.sealMetadataKey(key, overrides);\n }\n async readLifecycle(blockTag) {\n const metadata = {};\n for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) {\n if (await this.hasKey(key, blockTag))\n metadata[key] = await this.getValue(key, blockTag);\n }\n return new Cip151Lifecycle(metadata);\n }\n async readLabCertificate(gateway, blockTag) {\n if (!(await this.hasKey(cip152LabKey, blockTag)))\n return null;\n const reference = await this.getValue(cip152LabKey, blockTag);\n if (!gateway.resolve(reference).pathname.endsWith(\"/lab.json\"))\n throw new TypeError(\"CIP-152 reference must point to lab.json\");\n return new Cip152LabCertificate(await gateway.readJson(reference));\n }\n}\nexport { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from \"./custom-units.js\";\n//# sourceMappingURL=index.js.map"],"names":["Contract"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AACY,MAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;AACvC,IAAI,mEAAmE;AACvE,IAAI,gEAAgE;AACpE,IAAI,kEAAkE;AACtE,IAAI,0DAA0D;AAC9D,IAAI,oFAAoF;AACxF,IAAI,uDAAuD;AAC3D,IAAI,qDAAqD;AACzD,IAAI,sCAAsC;AAC1C,CAAC;AACW,MAAC,wBAAwB,GAAG;AAC5B,MAAC,oBAAoB,GAAG;AACxB,MAAC,YAAY,GAAG;AAC5B;AACO,MAAM,eAAe,CAAC;AAC7B,IAAI,eAAe;AACnB,IAAI,WAAW;AACf,IAAI,WAAW,CAAC,QAAQ,GAAG,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M,kBAAkB,CAAC,OAAO,EAAE,QAAQ,EAAE;AAChD,QAAQ,IAAI,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AACxD,YAAY,OAAO,IAAI;AACvB,QAAQ,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC;AACrE,QAAQ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC;AACtE,YAAY,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC;AAC3E,QAAQ,OAAO,IAAI,oBAAoB,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC1E,IAAI;AACJ;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/addresses.d.ts b/lib.commonjs/constants/addresses.d.ts deleted file mode 100644 index a32d6be03..000000000 --- a/lib.commonjs/constants/addresses.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -export declare const ZeroAddress: string; -//# sourceMappingURL=addresses.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/constants/addresses.d.ts.map b/lib.commonjs/constants/addresses.d.ts.map deleted file mode 100644 index a67118b65..000000000 --- a/lib.commonjs/constants/addresses.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src.ts/constants/addresses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAqD,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/constants/addresses.js b/lib.commonjs/constants/addresses.js deleted file mode 100644 index 3b1640315..000000000 --- a/lib.commonjs/constants/addresses.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -const ZeroAddress = "0x0000000000000000000000000000000000000000"; - -exports.ZeroAddress = ZeroAddress; -//# sourceMappingURL=addresses.js.map diff --git a/lib.commonjs/constants/addresses.js.map b/lib.commonjs/constants/addresses.js.map deleted file mode 100644 index 7d6277974..000000000 --- a/lib.commonjs/constants/addresses.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.js","sources":["../../lib.esm/constants/addresses.js"],"sourcesContent":["/**\n * A constant for the zero address.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000\"``)\n */\nexport const ZeroAddress = \"0x0000000000000000000000000000000000000000\";\n//# sourceMappingURL=addresses.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACY,MAAC,WAAW,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/hashes.d.ts b/lib.commonjs/constants/hashes.d.ts deleted file mode 100644 index 784df7156..000000000 --- a/lib.commonjs/constants/hashes.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -export declare const ZeroHash: string; -//# sourceMappingURL=hashes.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/constants/hashes.d.ts.map b/lib.commonjs/constants/hashes.d.ts.map deleted file mode 100644 index 225420a8c..000000000 --- a/lib.commonjs/constants/hashes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAC8C,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/constants/hashes.js b/lib.commonjs/constants/hashes.js deleted file mode 100644 index a6d63f064..000000000 --- a/lib.commonjs/constants/hashes.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; - -exports.ZeroHash = ZeroHash; -//# sourceMappingURL=hashes.js.map diff --git a/lib.commonjs/constants/hashes.js.map b/lib.commonjs/constants/hashes.js.map deleted file mode 100644 index 074999b16..000000000 --- a/lib.commonjs/constants/hashes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hashes.js","sources":["../../lib.esm/constants/hashes.js"],"sourcesContent":["/**\n * A constant for the zero hash.\n *\n * (**i.e.** ``\"0x0000000000000000000000000000000000000000000000000000000000000000\"``)\n */\nexport const ZeroHash = \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n//# sourceMappingURL=hashes.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/index.d.ts b/lib.commonjs/constants/index.d.ts deleted file mode 100644 index ba9ae1821..000000000 --- a/lib.commonjs/constants/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Some common constants useful for Core. - * - * @_section: api/constants: Constants [about-constants] - */ -export { ZeroAddress } from "./addresses.js"; -export { ZeroHash } from "./hashes.js"; -export { N, NegativeOne, Zero, One, Two, OrePerXCB, MaxUint256, MinInt256, MaxInt256, } from "./numbers.js"; -export { CoreSymbol, MessagePrefix } from "./strings.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/constants/index.d.ts.map b/lib.commonjs/constants/index.d.ts.map deleted file mode 100644 index d703c7245..000000000 --- a/lib.commonjs/constants/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/constants/index.js b/lib.commonjs/constants/index.js deleted file mode 100644 index afd46fd37..000000000 --- a/lib.commonjs/constants/index.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var addresses = require('./addresses.js'); -var hashes = require('./hashes.js'); -var numbers = require('./numbers.js'); -var strings = require('./strings.js'); - - - -exports.ZeroAddress = addresses.ZeroAddress; -exports.ZeroHash = hashes.ZeroHash; -exports.MaxInt256 = numbers.MaxInt256; -exports.MaxUint256 = numbers.MaxUint256; -exports.MinInt256 = numbers.MinInt256; -exports.N = numbers.N; -exports.NegativeOne = numbers.NegativeOne; -exports.One = numbers.One; -exports.OrePerXCB = numbers.OrePerXCB; -exports.Two = numbers.Two; -exports.Zero = numbers.Zero; -exports.CoreSymbol = strings.CoreSymbol; -exports.MessagePrefix = strings.MessagePrefix; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/constants/index.js.map b/lib.commonjs/constants/index.js.map deleted file mode 100644 index 3509b69b8..000000000 --- a/lib.commonjs/constants/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/numbers.d.ts b/lib.commonjs/constants/numbers.d.ts deleted file mode 100644 index ac92f9623..000000000 --- a/lib.commonjs/constants/numbers.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -export declare const N: bigint; -/** - * A constant for the number of ore in a single xcb. - * - * (**i.e.** ``1000000000000000000n``) - */ -export declare const OrePerXCB: bigint; -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxUint256: bigint; -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -export declare const MinInt256: bigint; -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxInt256: bigint; -export declare const NegativeOne: bigint; -export declare const Zero: bigint; -export declare const One: bigint; -export declare const Two: bigint; -//# sourceMappingURL=numbers.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/constants/numbers.d.ts.map b/lib.commonjs/constants/numbers.d.ts.map deleted file mode 100644 index 927678af4..000000000 --- a/lib.commonjs/constants/numbers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAEf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEb,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAiC,CAAC;AAC5D,eAAO,MAAM,IAAI,EAAE,MAAgC,CAAC;AACpD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC;AACnD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/constants/numbers.js b/lib.commonjs/constants/numbers.js deleted file mode 100644 index 740548101..000000000 --- a/lib.commonjs/constants/numbers.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -/** - * A constant for the number of ore in a single xcb. - * - * (**i.e.** ``1000000000000000000n``) - */ -const OrePerXCB = BigInt("1000000000000000000"); -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * - BigInt(-1); -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -const NegativeOne = /*#__PURE__*/ BigInt(-1); -const Zero = /*#__PURE__*/ BigInt(0); -const One = /*#__PURE__*/ BigInt(1); -const Two = /*#__PURE__*/ BigInt(2); - -exports.MaxInt256 = MaxInt256; -exports.MaxUint256 = MaxUint256; -exports.MinInt256 = MinInt256; -exports.N = N; -exports.NegativeOne = NegativeOne; -exports.One = One; -exports.OrePerXCB = OrePerXCB; -exports.Two = Two; -exports.Zero = Zero; -//# sourceMappingURL=numbers.js.map diff --git a/lib.commonjs/constants/numbers.js.map b/lib.commonjs/constants/numbers.js.map deleted file mode 100644 index c81780848..000000000 --- a/lib.commonjs/constants/numbers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"numbers.js","sources":["../../lib.esm/constants/numbers.js"],"sourcesContent":["/**\n * A constant for the order N for the secp256k1 curve.\n *\n * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``)\n */\nexport const N = BigInt(\"0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141\");\n/**\n * A constant for the number of ore in a single xcb.\n *\n * (**i.e.** ``1000000000000000000n``)\n */\nexport const OrePerXCB = BigInt(\"1000000000000000000\");\n/**\n * A constant for the maximum value for a ``uint256``.\n *\n * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxUint256 = BigInt(\"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n/**\n * A constant for the minimum value for an ``int256``.\n *\n * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``)\n */\nexport const MinInt256 = BigInt(\"0x8000000000000000000000000000000000000000000000000000000000000000\") *\n BigInt(-1);\n/**\n * A constant for the maximum value for an ``int256``.\n *\n * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``)\n */\nexport const MaxInt256 = BigInt(\"0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\nexport const NegativeOne = /*#__PURE__*/ BigInt(-1);\nexport const Zero = /*#__PURE__*/ BigInt(0);\nexport const One = /*#__PURE__*/ BigInt(1);\nexport const Two = /*#__PURE__*/ BigInt(2);\n//# sourceMappingURL=numbers.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACY,MAAC,CAAC,GAAG,MAAM,CAAC,oEAAoE;AAC5F;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG,MAAM,CAAC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAG,MAAM,CAAC,oEAAoE;AACrG;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG,MAAM,CAAC,oEAAoE,CAAC;AACrG,IAAI,MAAM,CAAC,EAAE;AACb;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG,MAAM,CAAC,oEAAoE;AACxF,MAAC,WAAW,iBAAiB,MAAM,CAAC,EAAE;AACtC,MAAC,IAAI,iBAAiB,MAAM,CAAC,CAAC;AAC9B,MAAC,GAAG,iBAAiB,MAAM,CAAC,CAAC;AAC7B,MAAC,GAAG,iBAAiB,MAAM,CAAC,CAAC;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/constants/strings.d.ts b/lib.commonjs/constants/strings.d.ts deleted file mode 100644 index 164253121..000000000 --- a/lib.commonjs/constants/strings.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A constant for the core symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -export declare const CoreSymbol: string; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Core Signed Message:\\n"``) - */ -export declare const MessagePrefix: string; -//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/constants/strings.d.ts.map b/lib.commonjs/constants/strings.d.ts.map deleted file mode 100644 index 788cc8ce6..000000000 --- a/lib.commonjs/constants/strings.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src.ts/constants/strings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAiB,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAqC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/constants/strings.js b/lib.commonjs/constants/strings.js deleted file mode 100644 index fd997324c..000000000 --- a/lib.commonjs/constants/strings.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -// NFKC (composed) // (decomposed) -/** - * A constant for the core symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -const CoreSymbol = "\u039e"; // "\uD835\uDF63"; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Core Signed Message:\\n"``) - */ -const MessagePrefix = "\x19Core Signed Message:\n"; - -exports.CoreSymbol = CoreSymbol; -exports.MessagePrefix = MessagePrefix; -//# sourceMappingURL=strings.js.map diff --git a/lib.commonjs/constants/strings.js.map b/lib.commonjs/constants/strings.js.map deleted file mode 100644 index f48393eb1..000000000 --- a/lib.commonjs/constants/strings.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.js","sources":["../../lib.esm/constants/strings.js"],"sourcesContent":["// NFKC (composed) // (decomposed)\n/**\n * A constant for the core symbol (normalized using NFKC).\n *\n * (**i.e.** ``\"\\\\u039e\"``)\n */\nexport const CoreSymbol = \"\\u039e\"; // \"\\uD835\\uDF63\";\n/**\n * A constant for the [[link-eip-191]] personal message prefix.\n *\n * (**i.e.** ``\"\\\\x19Core Signed Message:\\\\n\"``)\n */\nexport const MessagePrefix = \"\\x19Core Signed Message:\\n\";\n//# sourceMappingURL=strings.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,UAAU,GAAG,SAAS;AACnC;AACA;AACA;AACA;AACA;AACY,MAAC,aAAa,GAAG;;;"} \ No newline at end of file diff --git a/lib.commonjs/contract/contract.d.ts b/lib.commonjs/contract/contract.d.ts deleted file mode 100644 index 637e513de..000000000 --- a/lib.commonjs/contract/contract.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Indexed, Interface } from "../abi/index.js"; -import { Log, TransactionResponse } from "../providers/provider.js"; -import { ContractTransactionResponse, EventLog } from "./wrappers.js"; -import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js"; -import type { Addressable } from "../address/index.js"; -import type { EventEmitterable, Listener } from "../utils/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction, WrappedFallback } from "./types.js"; -/** - * @_ignore: - */ -export declare function copyOverrides(arg: any, allowed?: Array): Promise>; -/** - * @_ignore: - */ -export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray, args: Array): Promise>; -declare const internal: unique symbol; -export declare class BaseContract implements Addressable, EventEmitterable { - readonly target: string | Addressable; - readonly interface: Interface; - readonly runner: null | ContractRunner; - readonly filters: Record; - readonly [internal]: any; - readonly fallback: null | WrappedFallback; - constructor(target: string | Addressable, abi: Interface | InterfaceAbi, runner?: null | ContractRunner, _deployTx?: null | TransactionResponse); - connect(runner: null | ContractRunner): BaseContract; - getAddress(): Promise; - getDeployedCode(): Promise; - waitForDeployment(): Promise; - deploymentTransaction(): null | ContractTransactionResponse; - getFunction(key: string | FunctionFragment): T; - getEvent(key: string | EventFragment): ContractEvent; - queryTransaction(hash: string): Promise>; - queryFilter(event: ContractEventName, fromBlock?: BlockTag, toBlock?: BlockTag): Promise>; - on(event: ContractEventName, listener: Listener): Promise; - once(event: ContractEventName, listener: Listener): Promise; - emit(event: ContractEventName, ...args: Array): Promise; - listenerCount(event?: ContractEventName): Promise; - listeners(event?: ContractEventName): Promise>; - off(event: ContractEventName, listener?: Listener): Promise; - removeAllListeners(event?: ContractEventName): Promise; - addListener(event: ContractEventName, listener: Listener): Promise; - removeListener(event: ContractEventName, listener: Listener): Promise; - static buildClass(abi: InterfaceAbi): new (target: string, runner?: null | ContractRunner) => BaseContract & Omit; - static from(target: string, abi: InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit; - static isIndexed(value: any): value is Indexed; -} -declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: null | ContractRunner) => BaseContract & Omit; -export declare class Contract extends Contract_base { -} -export {}; -//# sourceMappingURL=contract.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/contract/contract.d.ts.map b/lib.commonjs/contract/contract.d.ts.map deleted file mode 100644 index 93e959992..000000000 --- a/lib.commonjs/contract/contract.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":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CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAM5C;IACD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAE7C;CACD;0CAGQ,MAAM,OACT,YAAY,WACR,IAAI,GAAG,cAAc,KAC1B,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/D,qBAAa,QAAS,SAAQ,aAAe;CAAG"} \ No newline at end of file diff --git a/lib.commonjs/contract/contract.js b/lib.commonjs/contract/contract.js deleted file mode 100644 index 9aae2ac98..000000000 --- a/lib.commonjs/contract/contract.js +++ /dev/null @@ -1,803 +0,0 @@ -'use strict'; - -require('../abi/abi-coder.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../abi/fragments.js'); -var _interface = require('../abi/interface.js'); -var typed = require('../abi/typed.js'); -var checks = require('../address/checks.js'); -var provider = require('../providers/provider.js'); -var wrappers = require('./wrappers.js'); - -const BN_0 = BigInt(0); -function canCall(value) { - return value && typeof value.call === "function"; -} -function canEstimate(value) { - return value && typeof value.estimateEnergy === "function"; -} -function canResolve(value) { - return value && typeof value.resolveName === "function"; -} -function canSend(value) { - return value && typeof value.sendTransaction === "function"; -} -class PreparedTopicFilter { - #filter; - fragment; - constructor(contract, fragment, args) { - properties.defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - // Recursively descend into args and resolve any addresses - this.#filter = (async function () { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - return checks.resolveAddress(value); - } - return value; - }); - })); - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - getTopicFilter() { - return this.#filter; - } -} -// A = Arguments passed in as a tuple -// R = The result type of the call (i.e. if only one return type, -// the qualified type, otherwise Result) -// D = The type the default call will return (i.e. R for view/pure, -// TransactionResponse otherwise) -//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { -function getRunner(value, feature) { - if (value == null) { - return null; - } - if (typeof value[feature] === "function") { - return value; - } - if (value.provider && typeof value.provider[feature] === "function") { - return value.provider; - } - return null; -} -function getProvider(value) { - if (value == null) { - return null; - } - return value.provider || null; -} -/** - * @_ignore: - */ -async function copyOverrides(arg, allowed) { - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = provider.copyRequest(typed.Typed.dereference(arg, "overrides")); - errors.assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - errors.assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); - // Resolve any from - if (overrides.from) { - overrides.from = await checks.resolveAddress(overrides.from); - } - return overrides; -} -/** - * @_ignore: - */ -async function resolveArgs(_runner, inputs, args) { - // Recursively descend into args and resolve any addresses - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = typed.Typed.dereference(value, type); - if (type === "address") { - return checks.resolveAddress(value); - } - return value; - }); - })); -} -function buildWrappedFallback(contract) { - const populateTransaction = async function (overrides) { - // If an overrides was passed in, copy it and normalize the values - const tx = (await copyOverrides(overrides, ["data"])); - tx.to = await contract.getAddress(); - const iface = contract.interface; - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - errors.assertArgument(payable || (tx.value || BN_0) === BN_0, "cannot send value to non-payable contract", "overrides.value", tx.value); - // Only allow fallback contracts to set non-empty data - errors.assertArgument(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data); - return tx; - }; - const staticCall = async function (overrides) { - const runner = getRunner(contract.runner, "call"); - errors.assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(overrides); - try { - return await runner.call(tx); - } - catch (error) { - if (errors.isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - const send = async function (overrides) { - const runner = contract.runner; - errors.assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new wrappers.ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (overrides) { - const runner = getRunner(contract.runner, "estimateEnergy"); - errors.assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(overrides)); - }; - const method = async (overrides) => { - return await send(overrides); - }; - properties.defineProperties(method, { - _contract: contract, - estimateEnergy, - populateTransaction, - send, - staticCall, - }); - return method; -} -function buildWrappedMethod(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getFunction(key, args); - errors.assert(fragment, "no matching fragment in getFragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const populateTransaction = async function (...args) { - const fragment = getFragment(...args); - // If an overrides was passed in, copy it and normalize the values - let overrides = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await properties.resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs), - })); - }; - const staticCall = async function (...args) { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return result; - }; - const send = async function (...args) { - const runner = contract.runner; - errors.assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new wrappers.ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (...args) { - const runner = getRunner(contract.runner, "estimateEnergy"); - errors.assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(...args)); - }; - const staticCallResult = async function (...args) { - const runner = getRunner(contract.runner, "call"); - errors.assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(...args); - let result = "0x"; - try { - result = await runner.call(tx); - } - catch (error) { - if (errors.isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - const method = async (...args) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - properties.defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, - _key: key, - getFragment, - estimateEnergy, - populateTransaction, - send, - staticCall, - staticCallResult, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - errors.assert(fragment, "no matching fragment in defineProperty", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; -} -function buildWrappedEvent(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getEvent(key, args); - errors.assert(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const method = function (...args) { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - properties.defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, - _key: key, - getFragment, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - errors.assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; -} -// The combination of TypeScrype, Private Fields and Proxies makes -// the world go boom; so we hide variables with some trickery keeping -// a symbol attached to each BaseContract which its sub-class (even -// via a Proxy) can reach and use to look up its internal values. -const internal = Symbol.for("_corebcInternal_contract"); -const internalValues = new WeakMap(); -function setInternal(contract, values) { - internalValues.set(contract[internal], values); -} -function getInternal(contract) { - return internalValues.get(contract[internal]); -} -function isDeferred(value) { - return (value && - typeof value === "object" && - "getTopicFilter" in value && - typeof value.getTopicFilter === "function" && - value.fragment); -} -async function getSubInfo(contract, event) { - let topics; - let fragment = null; - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - if (Array.isArray(event)) { - const topicHashify = function (name) { - if (data.isHexString(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - errors.assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } - else if (event === "*") { - topics = [null]; - } - else if (typeof event === "string") { - if (data.isHexString(event, 32)) { - // Topic Hash - topics = [event]; - } - else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - errors.assertArgument(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } - else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } - else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } - else { - errors.assertArgument(false, "unknown event name", "event", event); - } - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - const tag = topics - .map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }) - .join("&"); - return { fragment, tag, topics }; -} -async function hasSub(contract, event) { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; -} -async function getSub(contract, operation, event) { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - errors.assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); - const { fragment, tag, topics } = await getSubInfo(contract, event); - const { addr, subs } = getInternal(contract); - let sub = subs.get(tag); - if (!sub) { - const address = addr ? addr : contract; - const filter = { address, topics }; - const listener = (log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - // If fragment is null, we do not deconstruct the args to emit - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment - ? contract.interface.decodeEventLog(fragment, log.data, log.topics) - : []; - emit(contract, event, args, (listener) => { - return new wrappers.ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } - else { - emit(contract, event, [], (listener) => { - return new wrappers.ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - let starting = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - const stop = async () => { - if (starting.length == 0) { - return; - } - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; -} -// We use this to ensure one emit resolves before firing the next to -// ensure correct ordering (note this cannot throw and just adds the -// notice to the event queu using setTimeout). -let lastEmit = Promise.resolve(); -async function _emit(contract, event, args, payloadFunc) { - await lastEmit; - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } - catch (error) { } - return !once; - }); - return count > 0; -} -async function emit(contract, event, args, payloadFunc) { - try { - await lastEmit; - } - catch (error) { } - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; -} -const passProperties = ["then"]; -class BaseContract { - target; - interface; - runner; - filters; - [internal]; - fallback; - constructor(target, abi, runner, _deployTx) { - if (runner == null) { - runner = null; - } - const iface = _interface.Interface.from(abi); - properties.defineProperties(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - let addrPromise; - let addr = null; - let deployTx = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new wrappers.ContractTransactionResponse(this.interface, provider, _deployTx); - } - let subs = new Map(); - // Resolve the target as the address - if (typeof target === "string") { - if (data.isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } - else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw errors.makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - }); - } - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - } - else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - // Add the event filters - const filters = new Proxy({}, { - get: (target, _prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = this.getEvent(prop); - if (result) { - return result; - } - throw new Error(`unknown contract event: ${prop}`); - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop))); - }, - }); - properties.defineProperties(this, { filters }); - properties.defineProperties(this, { - fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null, - }); - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, _prop, receiver) => { - if (_prop in target || passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = target.getFunction(prop); - if (result) { - return result; - } - throw new Error(`unknown contract method: ${prop}`); - }, - has: (target, prop) => { - if (prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return target.interface.hasFunction(String(prop)); - }, - }); - } - connect(runner) { - return new BaseContract(this.target, this.interface, runner); - } - async getAddress() { - return await getInternal(this).addrPromise; - } - async getDeployedCode() { - const provider = getProvider(this.runner); - errors.assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - async waitForDeployment() { - // We have the deployement transaction; just use that (throws if deployement fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - errors.assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } - catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - deploymentTransaction() { - return getInternal(this).deployTx; - } - getFunction(key) { - if (typeof key !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - getEvent(key) { - if (typeof key !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - async queryTransaction(hash) { - // Is this useful? - throw new Error("@TODO"); - } - async queryFilter(event, fromBlock, toBlock) { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = addr ? addr : await addrPromise; - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - const provider$1 = getProvider(this.runner); - errors.assert(provider$1, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider$1.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - if (foundFragment) { - return new wrappers.EventLog(log, this.interface, foundFragment); - } - else { - return new provider.Log(log, provider$1); - } - }); - } - async on(event, listener) { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - async once(event, listener) { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - async emit(event, ...args) { - return await emit(this, event, args, null); - } - async listenerCount(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - const { subs } = getInternal(this); - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - const { subs } = getInternal(this); - let result = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return await this.off(event, listener); - } - static buildClass(abi) { - class CustomContract extends BaseContract { - constructor(address, runner = null) { - super(address, abi, runner); - } - } - return CustomContract; - } - static from(target, abi, runner) { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract; - } - static isIndexed(value) { - return _interface.Indexed.isIndexed(value); - } -} -function _ContractBase() { - return BaseContract; -} -class Contract extends _ContractBase() { -} - -exports.BaseContract = BaseContract; -exports.Contract = Contract; -exports.copyOverrides = copyOverrides; -exports.resolveArgs = resolveArgs; -//# sourceMappingURL=contract.js.map diff --git a/lib.commonjs/contract/contract.js.map b/lib.commonjs/contract/contract.js.map deleted file mode 100644 index 8f5aba91f..000000000 --- a/lib.commonjs/contract/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sources":["../../lib.esm/contract/contract.js"],"sourcesContent":["import { Indexed, Interface, Typed } from \"../abi/index.js\";\nimport { resolveAddress } from \"../address/checks.js\";\nimport { copyRequest, Log, } from \"../providers/provider.js\";\nimport { defineProperties, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument, } from \"../utils/index.js\";\nimport { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, } from \"./wrappers.js\";\nconst BN_0 = BigInt(0);\nfunction canCall(value) {\n return value && typeof value.call === \"function\";\n}\nfunction canEstimate(value) {\n return value && typeof value.estimateEnergy === \"function\";\n}\nfunction canResolve(value) {\n return value && typeof value.resolveName === \"function\";\n}\nfunction canSend(value) {\n return value && typeof value.sendTransaction === \"function\";\n}\nclass PreparedTopicFilter {\n #filter;\n fragment;\n constructor(contract, fragment, args) {\n defineProperties(this, { fragment });\n if (fragment.inputs.length < args.length) {\n throw new Error(\"too many arguments\");\n }\n // Recursively descend into args and resolve any addresses\n this.#filter = (async function () {\n const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => {\n const arg = args[index];\n if (arg == null) {\n return null;\n }\n return param.walkAsync(args[index], (type, value) => {\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n return contract.interface.encodeFilterTopics(fragment, resolvedArgs);\n })();\n }\n getTopicFilter() {\n return this.#filter;\n }\n}\n// A = Arguments passed in as a tuple\n// R = The result type of the call (i.e. if only one return type,\n// the qualified type, otherwise Result)\n// D = The type the default call will return (i.e. R for view/pure,\n// TransactionResponse otherwise)\n//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> {\nfunction getRunner(value, feature) {\n if (value == null) {\n return null;\n }\n if (typeof value[feature] === \"function\") {\n return value;\n }\n if (value.provider && typeof value.provider[feature] === \"function\") {\n return value.provider;\n }\n return null;\n}\nfunction getProvider(value) {\n if (value == null) {\n return null;\n }\n return value.provider || null;\n}\n/**\n * @_ignore:\n */\nexport async function copyOverrides(arg, allowed) {\n // Create a shallow copy (we'll deep-ify anything needed during normalizing)\n const overrides = copyRequest(Typed.dereference(arg, \"overrides\"));\n assertArgument(overrides.to == null || (allowed || []).indexOf(\"to\") >= 0, \"cannot override to\", \"overrides.to\", overrides.to);\n assertArgument(overrides.data == null || (allowed || []).indexOf(\"data\") >= 0, \"cannot override data\", \"overrides.data\", overrides.data);\n // Resolve any from\n if (overrides.from) {\n overrides.from = await resolveAddress(overrides.from);\n }\n return overrides;\n}\n/**\n * @_ignore:\n */\nexport async function resolveArgs(_runner, inputs, args) {\n // Recursively descend into args and resolve any addresses\n return await Promise.all(inputs.map((param, index) => {\n return param.walkAsync(args[index], (type, value) => {\n value = Typed.dereference(value, type);\n if (type === \"address\") {\n return resolveAddress(value);\n }\n return value;\n });\n }));\n}\nfunction buildWrappedFallback(contract) {\n const populateTransaction = async function (overrides) {\n // If an overrides was passed in, copy it and normalize the values\n const tx = (await copyOverrides(overrides, [\"data\"]));\n tx.to = await contract.getAddress();\n const iface = contract.interface;\n // Only allow payable contracts to set non-zero value\n const payable = iface.receive || (iface.fallback && iface.fallback.payable);\n assertArgument(payable || (tx.value || BN_0) === BN_0, \"cannot send value to non-payable contract\", \"overrides.value\", tx.value);\n // Only allow fallback contracts to set non-empty data\n assertArgument(iface.fallback || (tx.data || \"0x\") === \"0x\", \"cannot send data to receive-only contract\", \"overrides.data\", tx.data);\n return tx;\n };\n const staticCall = async function (overrides) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(overrides);\n try {\n return await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n };\n const send = async function (overrides) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(overrides));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (overrides) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(overrides));\n };\n const method = async (overrides) => {\n return await send(overrides);\n };\n defineProperties(method, {\n _contract: contract,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n });\n return method;\n}\nfunction buildWrappedMethod(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getFunction(key, args);\n assert(fragment, \"no matching fragment in getFragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const populateTransaction = async function (...args) {\n const fragment = getFragment(...args);\n // If an overrides was passed in, copy it and normalize the values\n let overrides = {};\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"internal error: fragment inputs doesn't match arguments; should not happen\");\n }\n const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args);\n return Object.assign({}, overrides, await resolveProperties({\n to: contract.getAddress(),\n data: contract.interface.encodeFunctionData(fragment, resolvedArgs),\n }));\n };\n const staticCall = async function (...args) {\n const result = await staticCallResult(...args);\n if (result.length === 1) {\n return result[0];\n }\n return result;\n };\n const send = async function (...args) {\n const runner = contract.runner;\n assert(canSend(runner), \"contract runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", { operation: \"sendTransaction\" });\n const tx = await runner.sendTransaction(await populateTransaction(...args));\n const provider = getProvider(contract.runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n return new ContractTransactionResponse(contract.interface, provider, tx);\n };\n const estimateEnergy = async function (...args) {\n const runner = getRunner(contract.runner, \"estimateEnergy\");\n assert(canEstimate(runner), \"contract runner does not support energy estimation\", \"UNSUPPORTED_OPERATION\", { operation: \"estimateEnergy\" });\n return await runner.estimateEnergy(await populateTransaction(...args));\n };\n const staticCallResult = async function (...args) {\n const runner = getRunner(contract.runner, \"call\");\n assert(canCall(runner), \"contract runner does not support calling\", \"UNSUPPORTED_OPERATION\", { operation: \"call\" });\n const tx = await populateTransaction(...args);\n let result = \"0x\";\n try {\n result = await runner.call(tx);\n }\n catch (error) {\n if (isCallException(error) && error.data) {\n throw contract.interface.makeError(error.data, tx);\n }\n throw error;\n }\n const fragment = getFragment(...args);\n return contract.interface.decodeFunctionResult(fragment, result);\n };\n const method = async (...args) => {\n const fragment = getFragment(...args);\n if (fragment.constant) {\n return await staticCall(...args);\n }\n return await send(...args);\n };\n defineProperties(method, {\n name: contract.interface.getFunctionName(key),\n _contract: contract,\n _key: key,\n getFragment,\n estimateEnergy,\n populateTransaction,\n send,\n staticCall,\n staticCallResult,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getFunction(key);\n assert(fragment, \"no matching fragment in defineProperty\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\nfunction buildWrappedEvent(contract, key) {\n const getFragment = function (...args) {\n const fragment = contract.interface.getEvent(key, args);\n assert(fragment, \"no matching fragment in\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n };\n const method = function (...args) {\n return new PreparedTopicFilter(contract, getFragment(...args), args);\n };\n defineProperties(method, {\n name: contract.interface.getEventName(key),\n _contract: contract,\n _key: key,\n getFragment,\n });\n // Only works on non-ambiguous keys (refined fragment is always non-ambiguous)\n Object.defineProperty(method, \"fragment\", {\n configurable: false,\n enumerable: true,\n get: () => {\n const fragment = contract.interface.getEvent(key);\n assert(fragment, \"no matching fragment\", \"UNSUPPORTED_OPERATION\", {\n operation: \"fragment\",\n });\n return fragment;\n },\n });\n return method;\n}\n// The combination of TypeScrype, Private Fields and Proxies makes\n// the world go boom; so we hide variables with some trickery keeping\n// a symbol attached to each BaseContract which its sub-class (even\n// via a Proxy) can reach and use to look up its internal values.\nconst internal = Symbol.for(\"_corebcInternal_contract\");\nconst internalValues = new WeakMap();\nfunction setInternal(contract, values) {\n internalValues.set(contract[internal], values);\n}\nfunction getInternal(contract) {\n return internalValues.get(contract[internal]);\n}\nfunction isDeferred(value) {\n return (value &&\n typeof value === \"object\" &&\n \"getTopicFilter\" in value &&\n typeof value.getTopicFilter === \"function\" &&\n value.fragment);\n}\nasync function getSubInfo(contract, event) {\n let topics;\n let fragment = null;\n // Convert named events to topicHash and get the fragment for\n // events which need deconstructing.\n if (Array.isArray(event)) {\n const topicHashify = function (name) {\n if (isHexString(name, 32)) {\n return name;\n }\n const fragment = contract.interface.getEvent(name);\n assertArgument(fragment, \"unknown fragment\", \"name\", name);\n return fragment.topicHash;\n };\n // Array of Topics and Names; e.g. `[ \"0x1234...89ab\", \"Transfer(address)\" ]`\n topics = event.map((e) => {\n if (e == null) {\n return null;\n }\n if (Array.isArray(e)) {\n return e.map(topicHashify);\n }\n return topicHashify(e);\n });\n }\n else if (event === \"*\") {\n topics = [null];\n }\n else if (typeof event === \"string\") {\n if (isHexString(event, 32)) {\n // Topic Hash\n topics = [event];\n }\n else {\n // Name or Signature; e.g. `\"Transfer\", `\"Transfer(address)\"`\n fragment = contract.interface.getEvent(event);\n assertArgument(fragment, \"unknown fragment\", \"event\", event);\n topics = [fragment.topicHash];\n }\n }\n else if (isDeferred(event)) {\n // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)`\n topics = await event.getTopicFilter();\n }\n else if (\"fragment\" in event) {\n // ContractEvent; e.g. `contract.filter.Transfer`\n fragment = event.fragment;\n topics = [fragment.topicHash];\n }\n else {\n assertArgument(false, \"unknown event name\", \"event\", event);\n }\n // Normalize topics and sort TopicSets\n topics = topics.map((t) => {\n if (t == null) {\n return null;\n }\n if (Array.isArray(t)) {\n const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values());\n if (items.length === 1) {\n return items[0];\n }\n items.sort();\n return items;\n }\n return t.toLowerCase();\n });\n const tag = topics\n .map((t) => {\n if (t == null) {\n return \"null\";\n }\n if (Array.isArray(t)) {\n return t.join(\"|\");\n }\n return t;\n })\n .join(\"&\");\n return { fragment, tag, topics };\n}\nasync function hasSub(contract, event) {\n const { subs } = getInternal(contract);\n return subs.get((await getSubInfo(contract, event)).tag) || null;\n}\nasync function getSub(contract, operation, event) {\n // Make sure our runner can actually subscribe to events\n const provider = getProvider(contract.runner);\n assert(provider, \"contract runner does not support subscribing\", \"UNSUPPORTED_OPERATION\", { operation });\n const { fragment, tag, topics } = await getSubInfo(contract, event);\n const { addr, subs } = getInternal(contract);\n let sub = subs.get(tag);\n if (!sub) {\n const address = addr ? addr : contract;\n const filter = { address, topics };\n const listener = (log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = contract.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n // If fragment is null, we do not deconstruct the args to emit\n if (foundFragment) {\n const _foundFragment = foundFragment;\n const args = fragment\n ? contract.interface.decodeEventLog(fragment, log.data, log.topics)\n : [];\n emit(contract, event, args, (listener) => {\n return new ContractEventPayload(contract, listener, event, _foundFragment, log);\n });\n }\n else {\n emit(contract, event, [], (listener) => {\n return new ContractUnknownEventPayload(contract, listener, event, log);\n });\n }\n };\n let starting = [];\n const start = () => {\n if (starting.length) {\n return;\n }\n starting.push(provider.on(filter, listener));\n };\n const stop = async () => {\n if (starting.length == 0) {\n return;\n }\n let started = starting;\n starting = [];\n await Promise.all(started);\n provider.off(filter, listener);\n };\n sub = { tag, listeners: [], start, stop };\n subs.set(tag, sub);\n }\n return sub;\n}\n// We use this to ensure one emit resolves before firing the next to\n// ensure correct ordering (note this cannot throw and just adds the\n// notice to the event queu using setTimeout).\nlet lastEmit = Promise.resolve();\nasync function _emit(contract, event, args, payloadFunc) {\n await lastEmit;\n const sub = await hasSub(contract, event);\n if (!sub) {\n return false;\n }\n const count = sub.listeners.length;\n sub.listeners = sub.listeners.filter(({ listener, once }) => {\n const passArgs = Array.from(args);\n if (payloadFunc) {\n passArgs.push(payloadFunc(once ? null : listener));\n }\n try {\n listener.call(contract, ...passArgs);\n }\n catch (error) { }\n return !once;\n });\n return count > 0;\n}\nasync function emit(contract, event, args, payloadFunc) {\n try {\n await lastEmit;\n }\n catch (error) { }\n const resultPromise = _emit(contract, event, args, payloadFunc);\n lastEmit = resultPromise;\n return await resultPromise;\n}\nconst passProperties = [\"then\"];\nexport class BaseContract {\n target;\n interface;\n runner;\n filters;\n [internal];\n fallback;\n constructor(target, abi, runner, _deployTx) {\n if (runner == null) {\n runner = null;\n }\n const iface = Interface.from(abi);\n defineProperties(this, { target, runner, interface: iface });\n Object.defineProperty(this, internal, { value: {} });\n let addrPromise;\n let addr = null;\n let deployTx = null;\n if (_deployTx) {\n const provider = getProvider(runner);\n // @TODO: the provider can be null; make a custom dummy provider that will throw a\n // meaningful error\n deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx);\n }\n let subs = new Map();\n // Resolve the target as the address\n if (typeof target === \"string\") {\n if (isHexString(target)) {\n addr = target;\n addrPromise = Promise.resolve(target);\n }\n else {\n const resolver = getRunner(runner, \"resolveName\");\n if (!canResolve(resolver)) {\n throw makeError(\"contract runner does not support name resolution\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n });\n }\n addrPromise = resolver.resolveName(target).then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n }\n else {\n addrPromise = target.getAddress().then((addr) => {\n if (addr == null) {\n throw new Error(\"TODO\");\n }\n getInternal(this).addr = addr;\n return addr;\n });\n }\n // Set our private values\n setInternal(this, { addrPromise, addr, deployTx, subs });\n // Add the event filters\n const filters = new Proxy({}, {\n get: (target, _prop, receiver) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = this.getEvent(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract event: ${prop}`);\n },\n has: (target, prop) => {\n // Pass important checks (like `then` for Promise) through\n if (passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop)));\n },\n });\n defineProperties(this, { filters });\n defineProperties(this, {\n fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null,\n });\n // Return a Proxy that will respond to functions\n return new Proxy(this, {\n get: (target, _prop, receiver) => {\n if (_prop in target || passProperties.indexOf(_prop) >= 0) {\n return Reflect.get(target, _prop, receiver);\n }\n const prop = String(_prop);\n const result = target.getFunction(prop);\n if (result) {\n return result;\n }\n throw new Error(`unknown contract method: ${prop}`);\n },\n has: (target, prop) => {\n if (prop in target || passProperties.indexOf(prop) >= 0) {\n return Reflect.has(target, prop);\n }\n return target.interface.hasFunction(String(prop));\n },\n });\n }\n connect(runner) {\n return new BaseContract(this.target, this.interface, runner);\n }\n async getAddress() {\n return await getInternal(this).addrPromise;\n }\n async getDeployedCode() {\n const provider = getProvider(this.runner);\n assert(provider, \"runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"getDeployedCode\" });\n const code = await provider.getCode(await this.getAddress());\n if (code === \"0x\") {\n return null;\n }\n return code;\n }\n async waitForDeployment() {\n // We have the deployement transaction; just use that (throws if deployement fails)\n const deployTx = this.deploymentTransaction();\n if (deployTx) {\n await deployTx.wait();\n return this;\n }\n // Check for code\n const code = await this.getDeployedCode();\n if (code != null) {\n return this;\n }\n // Make sure we can subscribe to a provider event\n const provider = getProvider(this.runner);\n assert(provider != null, \"contract runner does not support .provider\", \"UNSUPPORTED_OPERATION\", { operation: \"waitForDeployment\" });\n return new Promise((resolve, reject) => {\n const checkCode = async () => {\n try {\n const code = await this.getDeployedCode();\n if (code != null) {\n return resolve(this);\n }\n provider.once(\"block\", checkCode);\n }\n catch (error) {\n reject(error);\n }\n };\n checkCode();\n });\n }\n deploymentTransaction() {\n return getInternal(this).deployTx;\n }\n getFunction(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n const func = buildWrappedMethod(this, key);\n return func;\n }\n getEvent(key) {\n if (typeof key !== \"string\") {\n key = key.format();\n }\n return buildWrappedEvent(this, key);\n }\n async queryTransaction(hash) {\n // Is this useful?\n throw new Error(\"@TODO\");\n }\n async queryFilter(event, fromBlock, toBlock) {\n if (fromBlock == null) {\n fromBlock = 0;\n }\n if (toBlock == null) {\n toBlock = \"latest\";\n }\n const { addr, addrPromise } = getInternal(this);\n const address = addr ? addr : await addrPromise;\n const { fragment, topics } = await getSubInfo(this, event);\n const filter = { address, topics, fromBlock, toBlock };\n const provider = getProvider(this.runner);\n assert(provider, \"contract runner does not have a provider\", \"UNSUPPORTED_OPERATION\", { operation: \"queryFilter\" });\n return (await provider.getLogs(filter)).map((log) => {\n let foundFragment = fragment;\n if (foundFragment == null) {\n try {\n foundFragment = this.interface.getEvent(log.topics[0]);\n }\n catch (error) { }\n }\n if (foundFragment) {\n return new EventLog(log, this.interface, foundFragment);\n }\n else {\n return new Log(log, provider);\n }\n });\n }\n async on(event, listener) {\n const sub = await getSub(this, \"on\", event);\n sub.listeners.push({ listener, once: false });\n sub.start();\n return this;\n }\n async once(event, listener) {\n const sub = await getSub(this, \"once\", event);\n sub.listeners.push({ listener, once: true });\n sub.start();\n return this;\n }\n async emit(event, ...args) {\n return await emit(this, event, args, null);\n }\n async listenerCount(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return 0;\n }\n return sub.listeners.length;\n }\n const { subs } = getInternal(this);\n let total = 0;\n for (const { listeners } of subs.values()) {\n total += listeners.length;\n }\n return total;\n }\n async listeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return [];\n }\n return sub.listeners.map(({ listener }) => listener);\n }\n const { subs } = getInternal(this);\n let result = [];\n for (const { listeners } of subs.values()) {\n result = result.concat(listeners.map(({ listener }) => listener));\n }\n return result;\n }\n async off(event, listener) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n if (listener) {\n const index = sub.listeners\n .map(({ listener }) => listener)\n .indexOf(listener);\n if (index >= 0) {\n sub.listeners.splice(index, 1);\n }\n }\n if (listener == null || sub.listeners.length === 0) {\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n return this;\n }\n async removeAllListeners(event) {\n if (event) {\n const sub = await hasSub(this, event);\n if (!sub) {\n return this;\n }\n sub.stop();\n getInternal(this).subs.delete(sub.tag);\n }\n else {\n const { subs } = getInternal(this);\n for (const { tag, stop } of subs.values()) {\n stop();\n 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 await this.off(event, listener);\n }\n static buildClass(abi) {\n class CustomContract extends BaseContract {\n constructor(address, runner = null) {\n super(address, abi, runner);\n }\n }\n return CustomContract;\n }\n static from(target, abi, runner) {\n if (runner == null) {\n runner = null;\n }\n const contract = new this(target, abi, runner);\n return contract;\n }\n static isIndexed(value) {\n return Indexed.isIndexed(value);\n }\n}\nfunction _ContractBase() {\n return BaseContract;\n}\nexport class Contract extends _ContractBase() {\n}\n//# sourceMappingURL=contract.js.map"],"names":["defineProperties","resolveAddress","copyRequest","Typed","assertArgument","assert","isCallException","ContractTransactionResponse","resolveProperties","isHexString","ContractEventPayload","ContractUnknownEventPayload","Interface","makeError","provider","EventLog","Log","Indexed"],"mappings":";;;;;;;;;;;;;;;;;;;AAKA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,SAAS,OAAO,CAAC,KAAK,EAAE;AACxB,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;AACpD;AACA,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,cAAc,KAAK,UAAU;AAC9D;AACA,SAAS,UAAU,CAAC,KAAK,EAAE;AAC3B,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,WAAW,KAAK,UAAU;AAC3D;AACA,SAAS,OAAO,CAAC,KAAK,EAAE;AACxB,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,eAAe,KAAK,UAAU;AAC/D;AACA,MAAM,mBAAmB,CAAC;AAC1B,IAAI,OAAO;AACX,IAAI,QAAQ;AACZ,IAAI,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;AAC1C,QAAQA,2BAAgB,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC;AAC5C,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;AAClD,YAAY,MAAM,IAA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G,EAAE,MAAM,EAAE;AACrC,QAAQ,IAAI,MAAM,IAAI,IAAI,EAAE;AAC5B,YAAY,MAAM,GAAG,IAAI;AACzB,QAAQ;AACR,QAAQ,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC;AACtD,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ,IAAI,OAAO,SAAS,CAAC,KAAK,EAAE;AAC5B,QAAQ,OAAOG,kBAAO,CAAC,SAAS,CAAC,KAAK,CAAC;AACvC,IAAI;AACJ;AACA,SAAS,aAAa,GAAG;AACzB,IAAI,OAAO,YAAY;AACvB;AACO,MAAM,QAAQ,SAAS,aAAa,EAAE,CAAC;AAC9C;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/contract/factory.d.ts b/lib.commonjs/contract/factory.d.ts deleted file mode 100644 index f58d98552..000000000 --- a/lib.commonjs/contract/factory.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Interface } from "../abi/index.js"; -import { BaseContract } from "./contract.js"; -import type { InterfaceAbi } from "../abi/index.js"; -import type { ContractRunner } from "../providers/index.js"; -import type { BytesLike } from "../utils/index.js"; -import type { ContractInterface, ContractMethodArgs, ContractDeployTransaction } from "./types.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -export declare class ContractFactory = Array, I = BaseContract> { - readonly interface: Interface; - readonly bytecode: string; - readonly runner: null | ContractRunner; - constructor(abi: Interface | InterfaceAbi, bytecode: BytesLike | { - object: string; - }, runner?: null | ContractRunner); - getDeployTransaction(...args: ContractMethodArgs): Promise; - deploy(...args: ContractMethodArgs): Promise>; - connect(runner: null | ContractRunner): ContractFactory; - static fromSolidity = Array, I = ContractInterface>(output: any, runner?: ContractRunner): ContractFactory; -} -//# sourceMappingURL=factory.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/contract/factory.d.ts.map b/lib.commonjs/contract/factory.d.ts.map deleted file mode 100644 index e49bf553e..000000000 --- a/lib.commonjs/contract/factory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C,CAC/B,CAoBA;IAED,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAE5D;IAED,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAC3E,MAAM,EAAE,GAAG,EACX,MAAM,CAAC,EAAE,cAAc,GACrB,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAiBvB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/contract/factory.js b/lib.commonjs/contract/factory.js deleted file mode 100644 index aed43aed8..000000000 --- a/lib.commonjs/contract/factory.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict'; - -require('../abi/abi-coder.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../abi/fragments.js'); -var _interface = require('../abi/interface.js'); -var contractAddress = require('../address/contract-address.js'); -var contract = require('./contract.js'); - -// A = Arguments to the constructor -// I = Interface of deployed contracts -class ContractFactory { - interface; - bytecode; - runner; - constructor(abi, bytecode, runner) { - const iface = _interface.Interface.from(abi); - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = data.hexlify(data.getBytes(bytecode)); - } - else if (typeof bytecode === "string") { - bytecode = bytecode; - } - else if (data.isBytes(bytecode)) { - bytecode = data.hexlify(bytecode); - } - else if (bytecode && typeof bytecode.object === "string") { - // Allow the bytecode object from the Solidity compiler - bytecode = bytecode.object; - } - else { - // Crash in the next verification step - bytecode = "!"; - } - properties.defineProperties(this, { - // @ts-ignore - bytecode, - interface: iface, - runner: runner || null, - }); - } - async getDeployTransaction(...args) { - let overrides = {}; - const fragment = this.interface.deploy; - if (fragment.inputs.length + 1 === args.length) { - overrides = await contract.copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - const resolvedArgs = await contract.resolveArgs(this.runner, fragment.inputs, args); - const data$1 = data.concat([ - this.bytecode, - this.interface.encodeDeploy(resolvedArgs), - ]); - return Object.assign({}, overrides, { data: data$1 }); - } - async deploy(...args) { - const tx = await this.getDeployTransaction(...args); - errors.assert(this.runner && typeof this.runner.sendTransaction === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction", - }); - const sentTx = await this.runner.sendTransaction(tx); - const address = contractAddress.getCreateAddress(sentTx); - return new contract.BaseContract(address, this.interface, this.runner, sentTx); - } - connect(runner) { - return new ContractFactory(this.interface, this.bytecode, runner); - } - static fromSolidity(output, runner) { - errors.assertArgument(output != null, "bad compiler output", "output", output); - if (typeof output === "string") { - output = JSON.parse(output); - } - const abi = output.abi; - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } - else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - return new this(abi, bytecode, runner); - } -} - -exports.ContractFactory = ContractFactory; -//# sourceMappingURL=factory.js.map diff --git a/lib.commonjs/contract/factory.js.map b/lib.commonjs/contract/factory.js.map deleted file mode 100644 index f120cf7d9..000000000 --- a/lib.commonjs/contract/factory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"factory.js","sources":["../../lib.esm/contract/factory.js"],"sourcesContent":["import { Interface } from \"../abi/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.js\";\nimport { concat, defineProperties, getBytes, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { BaseContract, copyOverrides, resolveArgs } from \"./contract.js\";\nimport { isBytes } from \"../utils/data.js\";\n// A = Arguments to the constructor\n// I = Interface of deployed contracts\nexport class ContractFactory {\n interface;\n bytecode;\n runner;\n constructor(abi, bytecode, runner) {\n const iface = Interface.from(abi);\n // Dereference Solidity bytecode objects and allow a missing `0x`-prefix\n if (bytecode instanceof Uint8Array) {\n bytecode = hexlify(getBytes(bytecode));\n }\n else if (typeof bytecode === \"string\") {\n bytecode = bytecode;\n }\n else if (isBytes(bytecode)) {\n bytecode = hexlify(bytecode);\n }\n else if (bytecode && typeof bytecode.object === \"string\") {\n // Allow the bytecode object from the Solidity compiler\n bytecode = bytecode.object;\n }\n else {\n // Crash in the next verification step\n bytecode = \"!\";\n }\n defineProperties(this, {\n // @ts-ignore\n bytecode,\n interface: iface,\n runner: runner || null,\n });\n }\n async getDeployTransaction(...args) {\n let overrides = {};\n const fragment = this.interface.deploy;\n if (fragment.inputs.length + 1 === args.length) {\n overrides = await copyOverrides(args.pop());\n }\n if (fragment.inputs.length !== args.length) {\n throw new Error(\"incorrect number of arguments to constructor\");\n }\n const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args);\n const data = concat([\n this.bytecode,\n this.interface.encodeDeploy(resolvedArgs),\n ]);\n return Object.assign({}, overrides, { data });\n }\n async deploy(...args) {\n const tx = await this.getDeployTransaction(...args);\n assert(this.runner && typeof this.runner.sendTransaction === \"function\", \"factory runner does not support sending transactions\", \"UNSUPPORTED_OPERATION\", {\n operation: \"sendTransaction\",\n });\n const sentTx = await this.runner.sendTransaction(tx);\n const address = getCreateAddress(sentTx);\n return new BaseContract(address, this.interface, this.runner, sentTx);\n }\n connect(runner) {\n return new ContractFactory(this.interface, this.bytecode, runner);\n }\n static fromSolidity(output, runner) {\n assertArgument(output != null, \"bad compiler output\", \"output\", output);\n if (typeof output === \"string\") {\n output = JSON.parse(output);\n }\n const abi = output.abi;\n let bytecode = \"\";\n if (output.bytecode) {\n bytecode = output.bytecode;\n }\n else if (output.evm && output.evm.bytecode) {\n bytecode = output.evm.bytecode;\n }\n return new this(abi, bytecode, runner);\n }\n}\n//# sourceMappingURL=factory.js.map"],"names":["Interface","hexlify","getBytes","isBytes","defineProperties","copyOverrides","resolveArgs","data","concat","assert","getCreateAddress","BaseContract","assertArgument"],"mappings":";;;;;;;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,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC;AACzE,IAAI;AACJ,IAAI,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE;AACxC,QAAQC,qBAAc,CAAC,MAAM,IAAI,IAAI,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC/E,QAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AACxC,YAAY,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;AACvC,QAAQ;AACR,QAAQ,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG;AAC9B,QAAQ,IAAI,QAAQ,GAAG,EAAE;AACzB,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE;AAC7B,YAAY,QAAQ,GAAG,MAAM,CAAC,QAAQ;AACtC,QAAQ;AACR,aAAa,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;AACpD,YAAY,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ;AAC1C,QAAQ;AACR,QAAQ,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC9C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/contract/index.d.ts b/lib.commonjs/contract/index.d.ts deleted file mode 100644 index 8be93dacb..000000000 --- a/lib.commonjs/contract/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * About contracts... - * - * @_section: api/contract:Contracts [about-contracts] - */ -export { BaseContract, Contract } from "./contract.js"; -export { ContractFactory } from "./factory.js"; -export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./wrappers.js"; -export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, WrappedFallback, } from "./types.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/contract/index.d.ts.map b/lib.commonjs/contract/index.d.ts.map deleted file mode 100644 index a5098a449..000000000 --- a/lib.commonjs/contract/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/contract/index.js b/lib.commonjs/contract/index.js deleted file mode 100644 index 309b3068e..000000000 --- a/lib.commonjs/contract/index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var contract = require('./contract.js'); -var factory = require('./factory.js'); -var wrappers = require('./wrappers.js'); - - - -exports.BaseContract = contract.BaseContract; -exports.Contract = contract.Contract; -exports.ContractFactory = factory.ContractFactory; -exports.ContractEventPayload = wrappers.ContractEventPayload; -exports.ContractTransactionReceipt = wrappers.ContractTransactionReceipt; -exports.ContractTransactionResponse = wrappers.ContractTransactionResponse; -exports.ContractUnknownEventPayload = wrappers.ContractUnknownEventPayload; -exports.EventLog = wrappers.EventLog; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/contract/index.js.map b/lib.commonjs/contract/index.js.map deleted file mode 100644 index c290a0fe8..000000000 --- a/lib.commonjs/contract/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/contract/types.d.ts b/lib.commonjs/contract/types.d.ts deleted file mode 100644 index cf836c128..000000000 --- a/lib.commonjs/contract/types.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { EventFragment, FunctionFragment, Result, Typed } from "../abi/index.js"; -import type { TransactionRequest, PreparedTransactionRequest, TopicFilter } from "../providers/index.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -export type ContractEventName = string | ContractEvent | TopicFilter | DeferredTopicFilter; -export interface ContractInterface { - [name: string]: BaseContractMethod; -} -export interface DeferredTopicFilter { - getTopicFilter(): Promise; - fragment: EventFragment; -} -export interface ContractTransaction extends PreparedTransactionRequest { - to: string; - data: string; - from?: string; -} -export interface ContractDeployTransaction extends Omit { -} -export interface Overrides extends Omit { -} -export type PostfixOverrides> = A | [...A, Overrides]; -export type ContractMethodArgs> = PostfixOverrides<{ - [I in keyof A]-?: A[I] | Typed; -}>; -export interface BaseContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { - (...args: ContractMethodArgs): Promise; - name: string; - fragment: FunctionFragment; - getFragment(...args: ContractMethodArgs): FunctionFragment; - populateTransaction(...args: ContractMethodArgs): Promise; - staticCall(...args: ContractMethodArgs): Promise; - send(...args: ContractMethodArgs): Promise; - estimateEnergy(...args: ContractMethodArgs): Promise; - staticCallResult(...args: ContractMethodArgs): Promise; -} -export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> extends BaseContractMethod { -} -export interface ConstantContractMethod, R = any> extends ContractMethod { -} -export type ContractEventArgs> = { - [I in keyof A]?: A[I] | Typed | null; -}; -export interface ContractEvent = Array> { - (...args: ContractEventArgs): DeferredTopicFilter; - name: string; - fragment: EventFragment; - getFragment(...args: ContractEventArgs): EventFragment; -} -export interface WrappedFallback { - (overrides?: Omit): Promise; - populateTransaction(overrides?: Omit): Promise; - staticCall(overrides?: Omit): Promise; - send(overrides?: Omit): Promise; - estimateEnergy(overrides?: Omit): Promise; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/contract/types.d.ts.map b/lib.commonjs/contract/types.d.ts.map deleted file mode 100644 index d356fb5ec..000000000 --- a/lib.commonjs/contract/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,KAAK,EACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAGjE,MAAM,MAAM,iBAAiB,GAC5B,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,mBAAmB,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IACjC,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IACnC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IAEtE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAGD,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CACtD,mBAAmB,EACnB,IAAI,CACJ;CAAG;AAGJ,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC;CAAG;AAG7E,MAAM,MAAM,gBAAgB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AAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxE,IAAI,CACH,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GACxC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5E"} \ No newline at end of file diff --git a/lib.commonjs/contract/types.js b/lib.commonjs/contract/types.js deleted file mode 100644 index ed5ab0fb8..000000000 --- a/lib.commonjs/contract/types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=types.js.map diff --git a/lib.commonjs/contract/types.js.map b/lib.commonjs/contract/types.js.map deleted file mode 100644 index 705032fd5..000000000 --- a/lib.commonjs/contract/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/contract/wrappers.d.ts b/lib.commonjs/contract/wrappers.d.ts deleted file mode 100644 index 184e06900..000000000 --- a/lib.commonjs/contract/wrappers.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Block, Log, TransactionReceipt, TransactionResponse } from "../providers/provider.js"; -import { EventPayload } from "../utils/index.js"; -import type { EventFragment, Interface, Result } from "../abi/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Provider } from "../providers/index.js"; -import type { BaseContract } from "./contract.js"; -import type { ContractEventName } from "./types.js"; -export declare class EventLog extends Log { - readonly interface: Interface; - readonly fragment: EventFragment; - readonly args: Result; - constructor(log: Log, iface: Interface, fragment: EventFragment); - get eventName(): string; - get eventSignature(): string; -} -export declare class ContractTransactionReceipt extends TransactionReceipt { - #private; - constructor(iface: Interface, provider: Provider, tx: TransactionReceipt); - get logs(): Array; -} -export declare class ContractTransactionResponse extends TransactionResponse { - #private; - constructor(iface: Interface, provider: Provider, tx: TransactionResponse); - wait(confirms?: number): Promise; -} -export declare class ContractUnknownEventPayload extends EventPayload { - readonly log: Log; - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log); - getBlock(): Promise; - getTransaction(): Promise; - getTransactionReceipt(): Promise; -} -export declare class ContractEventPayload extends ContractUnknownEventPayload { - readonly fragment: EventFragment; - readonly log: EventLog; - readonly args: Result; - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, fragment: EventFragment, _log: Log); - get eventName(): string; - get eventSignature(): string; -} -//# sourceMappingURL=wrappers.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/contract/wrappers.d.ts.map b/lib.commonjs/contract/wrappers.d.ts.map deleted file mode 100644 index 4538896c6..000000000 --- a/lib.commonjs/contract/wrappers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,EACL,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,qBAAa,QAAS,SAAQ,GAAG;IAChC,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,GAAG,EA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EACvB,IAAI,EAAE,GAAG,EAcT;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/contract/wrappers.js b/lib.commonjs/contract/wrappers.js deleted file mode 100644 index d28e5f1b4..000000000 --- a/lib.commonjs/contract/wrappers.js +++ /dev/null @@ -1,100 +0,0 @@ -'use strict'; - -var provider = require('../providers/provider.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -var events = require('../utils/events.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -class EventLog extends provider.Log { - interface; - fragment; - args; - constructor(log, iface, fragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - properties.defineProperties(this, { args, fragment, interface: iface }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } -} -class ContractTransactionReceipt extends provider.TransactionReceipt { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - get logs() { - return super.logs.map((log) => { - const fragment = log.topics.length - ? this.#iface.getEvent(log.topics[0]) - : null; - if (fragment) { - return new EventLog(log, this.#iface, fragment); - } - else { - return log; - } - }); - } -} -class ContractTransactionResponse extends provider.TransactionResponse { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - async wait(confirms) { - const receipt = await super.wait(); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } -} -class ContractUnknownEventPayload extends events.EventPayload { - log; - constructor(contract, listener, filter, log) { - super(contract, listener, filter); - properties.defineProperties(this, { log }); - } - async getBlock() { - return await this.log.getBlock(); - } - async getTransaction() { - return await this.log.getTransaction(); - } - async getTransactionReceipt() { - return await this.log.getTransactionReceipt(); - } -} -class ContractEventPayload extends ContractUnknownEventPayload { - constructor(contract, listener, filter, fragment, _log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - properties.defineProperties(this, { args, fragment }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } -} - -exports.ContractEventPayload = ContractEventPayload; -exports.ContractTransactionReceipt = ContractTransactionReceipt; -exports.ContractTransactionResponse = ContractTransactionResponse; -exports.ContractUnknownEventPayload = ContractUnknownEventPayload; -exports.EventLog = EventLog; -//# sourceMappingURL=wrappers.js.map diff --git a/lib.commonjs/contract/wrappers.js.map b/lib.commonjs/contract/wrappers.js.map deleted file mode 100644 index 7a91acafc..000000000 --- a/lib.commonjs/contract/wrappers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.js","sources":["../../lib.esm/contract/wrappers.js"],"sourcesContent":["import { Log, TransactionReceipt, TransactionResponse, } from \"../providers/provider.js\";\nimport { defineProperties, EventPayload } from \"../utils/index.js\";\nexport class EventLog extends Log {\n interface;\n fragment;\n args;\n constructor(log, iface, fragment) {\n super(log, log.provider);\n const args = iface.decodeEventLog(fragment, log.data, log.topics);\n defineProperties(this, { args, fragment, interface: iface });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\nexport class ContractTransactionReceipt extends TransactionReceipt {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n get logs() {\n return super.logs.map((log) => {\n const fragment = log.topics.length\n ? this.#iface.getEvent(log.topics[0])\n : null;\n if (fragment) {\n return new EventLog(log, this.#iface, fragment);\n }\n else {\n return log;\n }\n });\n }\n}\nexport class ContractTransactionResponse extends TransactionResponse {\n #iface;\n constructor(iface, provider, tx) {\n super(tx, provider);\n this.#iface = iface;\n }\n async wait(confirms) {\n const receipt = await super.wait();\n if (receipt == null) {\n return null;\n }\n return new ContractTransactionReceipt(this.#iface, this.provider, receipt);\n }\n}\nexport class ContractUnknownEventPayload extends EventPayload {\n log;\n constructor(contract, listener, filter, log) {\n super(contract, listener, filter);\n defineProperties(this, { log });\n }\n async getBlock() {\n return await this.log.getBlock();\n }\n async getTransaction() {\n return await this.log.getTransaction();\n }\n async getTransactionReceipt() {\n return await this.log.getTransactionReceipt();\n }\n}\nexport class ContractEventPayload extends ContractUnknownEventPayload {\n constructor(contract, listener, filter, fragment, _log) {\n super(contract, listener, filter, new EventLog(_log, contract.interface, fragment));\n const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics);\n defineProperties(this, { args, fragment });\n }\n get eventName() {\n return this.fragment.name;\n }\n get eventSignature() {\n return this.fragment.format();\n }\n}\n//# sourceMappingURL=wrappers.js.map"],"names":["Log","defineProperties","TransactionReceipt","TransactionResponse","EventPayload"],"mappings":";;;;;;;;;;;;;;AAEO,MAAM,QAAQ,SAASA,YAAG,CAAC;AAClC,IAAI,SAAS;AACb,IAAI,QAAQ;AACZ,IAAI,IAAI;AACR,IAAI,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE;AACtC,QAAQ,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC;AAChC,QAAQ,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC;AACzE,QAAQC,2BAAgB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACpE,IAAI;AACJ,IAAI,IAAI,SAAS,GAAG;AACpB,QAAQ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI;AACjC,IAAI;AACJ,IAAI,IAAI,cAAc,GAAG;AACzB,QAAQ,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;AACrC,IAAI;AACJ;AACO,MAAM,0BAA0B,SAASC,2BAAkB,CAAC;AACnE,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,KAAK,EAAE,QAAQ,EA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;"} \ No newline at end of file diff --git a/lib.commonjs/corebc.d.ts b/lib.commonjs/corebc.d.ts deleted file mode 100644 index 1dede3269..000000000 --- a/lib.commonjs/corebc.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export { version } from "./_version.js"; -export { publicToAddress } from "./transaction/address.js"; -export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js"; -export { getAddress, networkIdToPrefix } from "./address/index.js"; -export { getCreate2Address, getCreateAddress, } from "./address/contract-address.js"; -export { isAddressable, isAddress, resolveAddress } from "./address/checks.js"; -export { ZeroAddress, OrePerXCB, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, CoreSymbol, MessagePrefix, } from "./constants/index.js"; -export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js"; -export { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Ed448Goldilock, Signature, SigningKey, keccak256, } from "./crypto/index.js"; -export { id, hashMessage, verifyMessage, solidityPacked, solidityPackedSha256, TypedDataEncoder, verifyTypedData, } from "./hash/index.js"; -export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, Network, FeeDataNetworkPlugin, EnergyCostPlugin, NetworkPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage, } from "./providers/index.js"; -export { accessListify, computeAddress, recoverAddress, Transaction, } from "./transaction/index.js"; -export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatXCB, parseXCB, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, arrayify, hexConcat, } from "./utils/index.js"; -export { Mnemonic, BaseWallet, HDNodeWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js"; -export { BigNumber } from "./bigNumber/bigNumber.js"; -export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists, } from "./wordlists/index.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc, } from "./abi/index.js"; -export type { Addressable, AddressLike, NameResolver, } from "./address/index.js"; -export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback, } from "./contract/index.js"; -export type { ProgressCallback, SignatureLike } from "./crypto/index.js"; -export type { TypedDataDomain, TypedDataField } from "./hash/index.js"; -export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, EnergyCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike, } from "./providers/index.js"; -export type { AccessList, AccessListish, AccessListEntry, TransactionLike, } from "./transaction/index.js"; -export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, CoreBCError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedCoreBCError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener, } from "./utils/index.js"; -export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions, } from "./wallet/index.js"; -export * from "./cip/index.js"; -export * from "./ipfs/index.js"; -//# sourceMappingURL=corebc.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/corebc.d.ts.map b/lib.commonjs/corebc.d.ts.map deleted file mode 100644 index c9c604763..000000000 --- a/lib.commonjs/corebc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"corebc.d.ts","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D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,sBAAsB,CAAC;AAE9B,YAAY,EACX,UAAU,EACV,aAAa,EACb,eAAe,EACf,eAAe,GACf,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACX,SAAS,EACT,YAAY,EACZ,OAAO,EACP,SAAS,EACT,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,GACR,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACX,gBAAgB,EAChB,eAAe,EACf,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/corebc.js b/lib.commonjs/corebc.js deleted file mode 100644 index 3f53d34d5..000000000 --- a/lib.commonjs/corebc.js +++ /dev/null @@ -1,283 +0,0 @@ -'use strict'; - -var _version = require('./_version.js'); -var address = require('./transaction/address.js'); -var abiCoder = require('./abi/abi-coder.js'); -var bytes32 = require('./abi/bytes32.js'); -var fragments = require('./abi/fragments.js'); -var _interface = require('./abi/interface.js'); -var typed = require('./abi/typed.js'); -var index$2 = require('./address/index.js'); -var contractAddress = require('./address/contract-address.js'); -var checks = require('./address/checks.js'); -var addresses = require('./constants/addresses.js'); -var hashes = require('./constants/hashes.js'); -var numbers = require('./constants/numbers.js'); -var strings = require('./constants/strings.js'); -var contract = require('./contract/contract.js'); -var factory = require('./contract/factory.js'); -var wrappers = require('./contract/wrappers.js'); -var index$3 = require('./crypto/index.js'); -var id = require('./hash/id.js'); -var message = require('./hash/message.js'); -var solidity = require('./hash/solidity.js'); -var typedData = require('./hash/typed-data.js'); -var abstractProvider = require('./providers/abstract-provider.js'); -var abstractSigner = require('./providers/abstract-signer.js'); -var community = require('./providers/community.js'); -var defaultProvider = require('./providers/default-provider.js'); -var network = require('./providers/network.js'); -var signerNoncemanager = require('./providers/signer-noncemanager.js'); -var pluginsNetwork = require('./providers/plugins-network.js'); -var provider = require('./providers/provider.js'); -var providerFallback = require('./providers/provider-fallback.js'); -var providerJsonrpc = require('./providers/provider-jsonrpc.js'); -var providerBrowser = require('./providers/provider-browser.js'); -var providerAlchemy = require('./providers/provider-alchemy.js'); -var providerAnkr = require('./providers/provider-ankr.js'); -var providerCloudflare = require('./providers/provider-cloudflare.js'); -var providerInfura = require('./providers/provider-infura.js'); -var providerPocket = require('./providers/provider-pocket.js'); -var providerQuicknode = require('./providers/provider-quicknode.js'); -var providerIpcsocket = require('./providers/provider-ipcsocket.js'); -var providerSocket = require('./providers/provider-socket.js'); -var providerWebsocket = require('./providers/provider-websocket.js'); -var accesslist = require('./transaction/accesslist.js'); -var transaction = require('./transaction/transaction.js'); -var base58 = require('./utils/base58.js'); -var base64 = require('./utils/base64.js'); -var data = require('./utils/data.js'); -var errors = require('./utils/errors.js'); -var events = require('./utils/events.js'); -var fetch = require('./utils/fetch.js'); -var fixednumber = require('./utils/fixednumber.js'); -var maths = require('./utils/maths.js'); -var properties = require('./utils/properties.js'); -var rlpDecode = require('./utils/rlp-decode.js'); -var rlpEncode = require('./utils/rlp-encode.js'); -var units = require('./utils/units.js'); -var utf8 = require('./utils/utf8.js'); -var uuid = require('./utils/uuid.js'); -var baseWallet = require('./wallet/base-wallet.js'); -var hdwallet = require('./wallet/hdwallet.js'); -var jsonCrowdsale = require('./wallet/json-crowdsale.js'); -var jsonKeystore = require('./wallet/json-keystore.js'); -var mnemonic = require('./wallet/mnemonic.js'); -var wallet = require('./wallet/wallet.js'); -var bigNumber = require('./bigNumber/bigNumber.js'); -var wordlist = require('./wordlists/wordlist.js'); -var langEn = require('./wordlists/lang-en.js'); -var wordlistOwl = require('./wordlists/wordlist-owl.js'); -var wordlistOwla = require('./wordlists/wordlist-owla.js'); -var wordlists = require('./wordlists/wordlists.js'); -var index = require('./cip/index.js'); -var index$1 = require('./ipfs/index.js'); -var customUnits = require('./cip/custom-units.js'); -var ed448goldilock = require('./crypto/ed448goldilock.js'); -var abstractCoder = require('./abi/coders/abstract-coder.js'); -var signature = require('./crypto/signature.js'); -var signingKey = require('./crypto/signing-key.js'); -var hmac = require('./crypto/hmac.js'); -var keccak = require('./crypto/keccak.js'); -var pbkdf2 = require('./crypto/pbkdf2.js'); -var random = require('./crypto/random.js'); -var ripemd160 = require('./crypto/ripemd160.js'); -var scrypt = require('./crypto/scrypt.js'); -var sha3 = require('./crypto/sha3.js'); - - - -exports.version = _version.version; -exports.computeAddress = address.computeAddress; -exports.publicToAddress = address.publicToAddress; -exports.recoverAddress = address.recoverAddress; -exports.AbiCoder = abiCoder.AbiCoder; -exports.decodeBytes32String = bytes32.decodeBytes32String; -exports.encodeBytes32String = bytes32.encodeBytes32String; -exports.ConstructorFragment = fragments.ConstructorFragment; -exports.ErrorFragment = fragments.ErrorFragment; -exports.EventFragment = fragments.EventFragment; -exports.FallbackFragment = fragments.FallbackFragment; -exports.Fragment = fragments.Fragment; -exports.FunctionFragment = fragments.FunctionFragment; -exports.NamedFragment = fragments.NamedFragment; -exports.ParamType = fragments.ParamType; -exports.StructFragment = fragments.StructFragment; -exports.ErrorDescription = _interface.ErrorDescription; -exports.Indexed = _interface.Indexed; -exports.Interface = _interface.Interface; -exports.LogDescription = _interface.LogDescription; -exports.TransactionDescription = _interface.TransactionDescription; -exports.Typed = typed.Typed; -exports.getAddress = index$2.getAddress; -exports.networkIdToPrefix = index$2.networkIdToPrefix; -exports.getCreate2Address = contractAddress.getCreate2Address; -exports.getCreateAddress = contractAddress.getCreateAddress; -exports.isAddress = checks.isAddress; -exports.isAddressable = checks.isAddressable; -exports.resolveAddress = checks.resolveAddress; -exports.ZeroAddress = addresses.ZeroAddress; -exports.ZeroHash = hashes.ZeroHash; -exports.MaxInt256 = numbers.MaxInt256; -exports.MaxUint256 = numbers.MaxUint256; -exports.MinInt256 = numbers.MinInt256; -exports.N = numbers.N; -exports.OrePerXCB = numbers.OrePerXCB; -exports.CoreSymbol = strings.CoreSymbol; -exports.MessagePrefix = strings.MessagePrefix; -exports.BaseContract = contract.BaseContract; -exports.Contract = contract.Contract; -exports.ContractFactory = factory.ContractFactory; -exports.ContractEventPayload = wrappers.ContractEventPayload; -exports.ContractTransactionReceipt = wrappers.ContractTransactionReceipt; -exports.ContractTransactionResponse = wrappers.ContractTransactionResponse; -exports.ContractUnknownEventPayload = wrappers.ContractUnknownEventPayload; -exports.EventLog = wrappers.EventLog; -exports.lock = index$3.lock; -exports.id = id.id; -exports.hashMessage = message.hashMessage; -exports.verifyMessage = message.verifyMessage; -exports.solidityPacked = solidity.solidityPacked; -exports.solidityPackedSha256 = solidity.solidityPackedSha256; -exports.TypedDataEncoder = typedData.TypedDataEncoder; -exports.verifyTypedData = typedData.verifyTypedData; -exports.AbstractProvider = abstractProvider.AbstractProvider; -exports.UnmanagedSubscriber = abstractProvider.UnmanagedSubscriber; -exports.AbstractSigner = abstractSigner.AbstractSigner; -exports.VoidSigner = abstractSigner.VoidSigner; -exports.showThrottleMessage = community.showThrottleMessage; -exports.getDefaultProvider = defaultProvider.getDefaultProvider; -exports.Network = network.Network; -exports.NonceManager = signerNoncemanager.NonceManager; -exports.EnergyCostPlugin = pluginsNetwork.EnergyCostPlugin; -exports.FeeDataNetworkPlugin = pluginsNetwork.FeeDataNetworkPlugin; -exports.NetworkPlugin = pluginsNetwork.NetworkPlugin; -exports.Block = provider.Block; -exports.FeeData = provider.FeeData; -exports.Log = provider.Log; -exports.TransactionReceipt = provider.TransactionReceipt; -exports.TransactionResponse = provider.TransactionResponse; -exports.copyRequest = provider.copyRequest; -exports.FallbackProvider = providerFallback.FallbackProvider; -exports.JsonRpcApiProvider = providerJsonrpc.JsonRpcApiProvider; -exports.JsonRpcProvider = providerJsonrpc.JsonRpcProvider; -exports.JsonRpcSigner = providerJsonrpc.JsonRpcSigner; -exports.BrowserProvider = providerBrowser.BrowserProvider; -exports.AlchemyProvider = providerAlchemy.AlchemyProvider; -exports.AnkrProvider = providerAnkr.AnkrProvider; -exports.CloudflareProvider = providerCloudflare.CloudflareProvider; -exports.InfuraProvider = providerInfura.InfuraProvider; -exports.InfuraWebSocketProvider = providerInfura.InfuraWebSocketProvider; -exports.PocketProvider = providerPocket.PocketProvider; -exports.QuickNodeProvider = providerQuicknode.QuickNodeProvider; -exports.IpcSocketProvider = providerIpcsocket.IpcSocketProvider; -exports.SocketBlockSubscriber = providerSocket.SocketBlockSubscriber; -exports.SocketEventSubscriber = providerSocket.SocketEventSubscriber; -exports.SocketPendingSubscriber = providerSocket.SocketPendingSubscriber; -exports.SocketProvider = providerSocket.SocketProvider; -exports.SocketSubscriber = providerSocket.SocketSubscriber; -exports.WebSocketProvider = providerWebsocket.WebSocketProvider; -exports.accessListify = accesslist.accessListify; -exports.Transaction = transaction.Transaction; -exports.decodeBase58 = base58.decodeBase58; -exports.encodeBase58 = base58.encodeBase58; -exports.decodeBase64 = base64.decodeBase64; -exports.encodeBase64 = base64.encodeBase64; -exports.arrayify = data.arrayify; -exports.concat = data.concat; -exports.dataLength = data.dataLength; -exports.dataSlice = data.dataSlice; -exports.getBytes = data.getBytes; -exports.getBytesCopy = data.getBytesCopy; -exports.hexConcat = data.hexConcat; -exports.hexlify = data.hexlify; -exports.isBytesLike = data.isBytesLike; -exports.isHexString = data.isHexString; -exports.stripZerosLeft = data.stripZerosLeft; -exports.zeroPadBytes = data.zeroPadBytes; -exports.zeroPadValue = data.zeroPadValue; -exports.assert = errors.assert; -exports.assertArgument = errors.assertArgument; -exports.assertArgumentCount = errors.assertArgumentCount; -exports.assertNormalize = errors.assertNormalize; -exports.assertPrivate = errors.assertPrivate; -exports.isCallException = errors.isCallException; -exports.isError = errors.isError; -exports.makeError = errors.makeError; -exports.EventPayload = events.EventPayload; -exports.FetchCancelSignal = fetch.FetchCancelSignal; -exports.FetchRequest = fetch.FetchRequest; -exports.FetchResponse = fetch.FetchResponse; -exports.FixedNumber = fixednumber.FixedNumber; -exports.fromTwos = maths.fromTwos; -exports.getBigInt = maths.getBigInt; -exports.getNumber = maths.getNumber; -exports.getUint = maths.getUint; -exports.mask = maths.mask; -exports.toBeArray = maths.toBeArray; -exports.toBeHex = maths.toBeHex; -exports.toBigInt = maths.toBigInt; -exports.toNumber = maths.toNumber; -exports.toQuantity = maths.toQuantity; -exports.toTwos = maths.toTwos; -exports.defineProperties = properties.defineProperties; -exports.resolveProperties = properties.resolveProperties; -exports.decodeRlp = rlpDecode.decodeRlp; -exports.encodeRlp = rlpEncode.encodeRlp; -exports.formatUnits = units.formatUnits; -exports.formatXCB = units.formatXCB; -exports.parseUnits = units.parseUnits; -exports.parseXCB = units.parseXCB; -exports.Utf8ErrorFuncs = utf8.Utf8ErrorFuncs; -exports.toUtf8Bytes = utf8.toUtf8Bytes; -exports.toUtf8CodePoints = utf8.toUtf8CodePoints; -exports.toUtf8String = utf8.toUtf8String; -exports.uuidV4 = uuid.uuidV4; -exports.BaseWallet = baseWallet.BaseWallet; -exports.HDNodeWallet = hdwallet.HDNodeWallet; -exports.defaultPath = hdwallet.defaultPath; -exports.getAccountPath = hdwallet.getAccountPath; -exports.getIndexedAccountPath = hdwallet.getIndexedAccountPath; -exports.decryptCrowdsaleJson = jsonCrowdsale.decryptCrowdsaleJson; -exports.isCrowdsaleJson = jsonCrowdsale.isCrowdsaleJson; -exports.decryptKeystoreJson = jsonKeystore.decryptKeystoreJson; -exports.decryptKeystoreJsonSync = jsonKeystore.decryptKeystoreJsonSync; -exports.encryptKeystoreJson = jsonKeystore.encryptKeystoreJson; -exports.encryptKeystoreJsonSync = jsonKeystore.encryptKeystoreJsonSync; -exports.isKeystoreJson = jsonKeystore.isKeystoreJson; -exports.Mnemonic = mnemonic.Mnemonic; -exports.Wallet = wallet.Wallet; -exports.BigNumber = bigNumber.BigNumber; -exports.Wordlist = wordlist.Wordlist; -exports.LangEn = langEn.LangEn; -exports.WordlistOwl = wordlistOwl.WordlistOwl; -exports.WordlistOwlA = wordlistOwla.WordlistOwlA; -exports.wordlists = wordlists.wordlists; -exports.Cip150MetadataContract = index.Cip150MetadataContract; -exports.Cip151Lifecycle = index.Cip151Lifecycle; -exports.Cip152LabCertificate = index.Cip152LabCertificate; -exports.cip150Abi = index.cip150Abi; -exports.cip151TokenExpirationKey = index.cip151TokenExpirationKey; -exports.cip151TradingStopKey = index.cip151TradingStopKey; -exports.cip152LabKey = index.cip152LabKey; -exports.IpfsGateway = index$1.IpfsGateway; -exports.defaultIpfsGatewayTemplate = index$1.defaultIpfsGatewayTemplate; -exports.CustomUnitBalance = customUnits.CustomUnitBalance; -exports.CustomUnitDiscovery = customUnits.CustomUnitDiscovery; -exports.CustomUnitToken = customUnits.CustomUnitToken; -exports.customUnitAbi = customUnits.customUnitAbi; -exports.Ed448Goldilock = ed448goldilock.Ed448Goldilock; -exports.Result = abstractCoder.Result; -exports.checkResultErrors = abstractCoder.checkResultErrors; -exports.Signature = signature.Signature; -exports.SigningKey = signingKey.SigningKey; -exports.computeHmac = hmac.computeHmac; -exports.keccak256 = keccak.keccak256; -exports.pbkdf2 = pbkdf2.pbkdf2; -exports.randomBytes = random.randomBytes; -exports.ripemd160 = ripemd160.ripemd160; -exports.scrypt = scrypt.scrypt; -exports.scryptSync = scrypt.scryptSync; -exports.sha256 = sha3.sha256; -exports.sha512 = sha3.sha512; -//# sourceMappingURL=corebc.js.map diff --git a/lib.commonjs/corebc.js.map b/lib.commonjs/corebc.js.map deleted file mode 100644 index 64171a01f..000000000 --- a/lib.commonjs/corebc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"corebc.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-ed448.d.ts b/lib.commonjs/crypto/browser-ed448.d.ts deleted file mode 100644 index 7b2b7d29a..000000000 --- a/lib.commonjs/crypto/browser-ed448.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Ed448Backend } from "./ed448-types.js"; -declare const ed448: Ed448Backend; -export default ed448; -//# sourceMappingURL=browser-ed448.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-ed448.d.ts.map b/lib.commonjs/crypto/browser-ed448.d.ts.map deleted file mode 100644 index 33a4fd898..000000000 --- a/lib.commonjs/crypto/browser-ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-ed448.js b/lib.commonjs/crypto/browser-ed448.js deleted file mode 100644 index ad139a761..000000000 --- a/lib.commonjs/crypto/browser-ed448.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var backend = require('bcrypto/lib/ed448-browser.js'); - -// bcrypto does not ship TypeScript declarations. -// @ts-ignore -const ed448 = backend; - -exports.default = ed448; -//# sourceMappingURL=browser-ed448.js.map diff --git a/lib.commonjs/crypto/browser-ed448.js.map b/lib.commonjs/crypto/browser-ed448.js.map deleted file mode 100644 index 0e2ad36d4..000000000 --- a/lib.commonjs/crypto/browser-ed448.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-ed448.js","sources":["../../lib.esm/crypto/browser-ed448.js"],"sourcesContent":["// bcrypto does not ship TypeScript declarations.\n// @ts-ignore\nimport backend from \"bcrypto/lib/ed448-browser.js\";\nconst ed448 = backend;\nexport default ed448;\n//# sourceMappingURL=browser-ed448.js.map"],"names":[],"mappings":";;;;;;AAAA;AACA;AAEK,MAAC,KAAK,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-sha3.d.ts b/lib.commonjs/crypto/browser-sha3.d.ts deleted file mode 100644 index 3b83a4fbb..000000000 --- a/lib.commonjs/crypto/browser-sha3.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BytesLike } from "../utils/data.js"; -import { SupportedAlgorithm } from "./sha3.js"; -export declare function ripemd160(data: BytesLike): string; -export declare function sha256(data: BytesLike): string; -export declare function sha512(data: BytesLike): string; -export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string; -//# sourceMappingURL=browser-sha3.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-sha3.d.ts.map b/lib.commonjs/crypto/browser-sha3.d.ts.map deleted file mode 100644 index 61f4a3fba..000000000 --- a/lib.commonjs/crypto/browser-sha3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AASA,OAAO,EAAY,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR"} \ No newline at end of file diff --git a/lib.commonjs/crypto/browser-sha3.js b/lib.commonjs/crypto/browser-sha3.js deleted file mode 100644 index 4c1ecb23e..000000000 --- a/lib.commonjs/crypto/browser-sha3.js +++ /dev/null @@ -1,46 +0,0 @@ -'use strict'; - -var buffer = require('buffer'); -var _ripemd160 = require('bcrypto/lib/ripemd160-browser'); -var sha3$1 = require('bcrypto/lib/sha3-browser.js'); -var logger$1 = require('../logger/logger.js'); -var data = require('../utils/data.js'); -var sha3 = require('./sha3.js'); - -const logger = new logger$1.Logger("corebc-crypto/browser-sha3/0.0.1"); -function ripemd160(data$1) { - const d = buffer.Buffer.from(data.arrayify(data$1)); - const h = _ripemd160.digest(d); - return data.hexlify(h); -} -function sha256(data$1) { - const d = buffer.Buffer.from(data.arrayify(data$1)); - const h = sha3$1.digest(d, 256); - return data.hexlify(h); -} -function sha512(data$1) { - const d = buffer.Buffer.from(data.arrayify(data$1)); - const h = sha3$1.digest(d, 512); - return data.hexlify(h); -} -function computeHmac(algorithm, key, data$1) { - const d = buffer.Buffer.from(data.arrayify(data$1)); - const k = buffer.Buffer.from(data.arrayify(key)); - if (algorithm === sha3.SupportedAlgorithm.sha256) { - return data.hexlify(sha3$1.mac(d, k, 256)); - } - else if (algorithm === sha3.SupportedAlgorithm.sha512) { - return data.hexlify(sha3$1.mac(d, k, 512)); - } - logger.throwError("unsupported algorithm - " + algorithm, logger$1.Logger.errors.UNSUPPORTED_OPERATION, { - operation: "computeHmac", - algorithm: algorithm, - }); - return ""; -} - -exports.computeHmac = computeHmac; -exports.ripemd160 = ripemd160; -exports.sha256 = sha256; -exports.sha512 = sha512; -//# sourceMappingURL=browser-sha3.js.map diff --git a/lib.commonjs/crypto/browser-sha3.js.map b/lib.commonjs/crypto/browser-sha3.js.map deleted file mode 100644 index 983fea18b..000000000 --- a/lib.commonjs/crypto/browser-sha3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-sha3.js","sources":["../../lib.esm/crypto/browser-sha3.js"],"sourcesContent":["import { Buffer } from \"buffer\";\n(\"use strict\");\n// @ts-ignore\nimport _ripemd160 from \"bcrypto/lib/ripemd160-browser\";\n// @ts-ignore\nimport sha3 from \"bcrypto/lib/sha3-browser.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify } from \"../utils/data.js\";\nimport { SupportedAlgorithm } from \"./sha3.js\";\nconst logger = new Logger(\"corebc-crypto/browser-sha3/0.0.1\");\nexport function ripemd160(data) {\n const d = Buffer.from(arrayify(data));\n const h = _ripemd160.digest(d);\n return hexlify(h);\n}\nexport function sha256(data) {\n const d = Buffer.from(arrayify(data));\n const h = sha3.digest(d, 256);\n return hexlify(h);\n}\nexport function sha512(data) {\n const d = Buffer.from(arrayify(data));\n const h = sha3.digest(d, 512);\n return hexlify(h);\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(sha3.mac(d, k, 256));\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(sha3.mac(d, k, 512));\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\n//# sourceMappingURL=browser-sha3.js.map"],"names":["Logger","data","Buffer","arrayify","hexlify","sha3","SupportedAlgorithm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IAAI,SAAS,KAAKC,uBAAkB,CAAC,MAAM,EAAE;AACtD,QAAQ,OAAOF,YAAO,CAACC,MAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3C,IAAI;AACJ,IAAI,MAAM,CAAC,UAAU,CAAC,0BAA0B,GAAG,SAAS,EAAEL,eAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;AACnG,QAAQ,SAAS,EAAE,aAAa;AAChC,QAAQ,SAAS,EAAE,SAAS;AAC5B,KAAK,CAAC;AACN,IAAI,OAAO,EAAE;AACb;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto-browser.d.ts b/lib.commonjs/crypto/crypto-browser.d.ts deleted file mode 100644 index c1f839009..000000000 --- a/lib.commonjs/crypto/crypto-browser.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import ed448 from "./browser-ed448.js"; -export { ed448 }; -export { Ed448Goldilock } from "./ed448goldilock-browser.js"; -declare global { - interface Window { - } - const window: Window; - const self: Window; -} -export interface CryptoHasher { - update(data: Uint8Array): CryptoHasher; - digest(): Uint8Array; -} -export declare function createHash(algo: string): CryptoHasher; -export declare function createHmac(_algo: string, key: Uint8Array): CryptoHasher; -export declare function pbkdf2Sync(password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, _algo: "sha256" | "sha512"): Uint8Array; -export declare function randomBytes(length: number): Uint8Array; -//# sourceMappingURL=crypto-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto-browser.d.ts.map b/lib.commonjs/crypto/crypto-browser.d.ts.map deleted file mode 100644 index 96b1570a8..000000000 --- a/lib.commonjs/crypto/crypto-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;KAAG;IAEnB,MAAM,MAAM,EAAE,MAAM,CAAC;IAErB,MAAM,IAAI,EAAE,MAAM,CAAC;CACnB;AAmBD,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAcrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAMvE;AAED,wBAAgB,UAAU,CACzB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,GAAG,QAAQ,GACxB,UAAU,CAIZ;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAoBtD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto-browser.js b/lib.commonjs/crypto/crypto-browser.js deleted file mode 100644 index c9ae3fb7e..000000000 --- a/lib.commonjs/crypto/crypto-browser.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -var legacy_js = require('@noble/hashes/legacy.js'); -var hmac_js = require('@noble/hashes/hmac.js'); -var pbkdf2_js = require('@noble/hashes/pbkdf2.js'); -var sha2_js = require('@noble/hashes/sha2.js'); -var sha3_js = require('@noble/hashes/sha3.js'); -var browserEd448 = require('./browser-ed448.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var ed448goldilockBrowser = require('./ed448goldilock-browser.js'); - -/* Browser Crypto Shims */ -function getGlobal() { - if (typeof globalThis !== "undefined") - return globalThis; - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); -} -const anyGlobal = getGlobal(); -const crypto = anyGlobal.crypto || anyGlobal.msCrypto; -function createHash(algo) { - switch (algo) { - case "ripemd160": - return legacy_js.ripemd160.create(); - case "sha256": - return sha2_js.sha256.create(); - case "sha512": - return sha2_js.sha512.create(); - case "sha3-256": - return sha3_js.sha3_256.create(); - case "sha3-512": - return sha3_js.sha3_512.create(); - } - errors.assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); -} -function createHmac(_algo, key) { - const algo = { sha256: sha2_js.sha256, sha512: sha2_js.sha512, "sha3-256": sha3_js.sha3_256, "sha3-512": sha3_js.sha3_512 }[_algo]; - errors.assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac_js.hmac.create(algo, key); -} -function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = { sha256: sha2_js.sha256, sha512: sha2_js.sha512 }[_algo]; - errors.assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2_js.pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen }); -} -function randomBytes(length) { - errors.assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes", - }); - errors.assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; -} - -exports.ed448 = browserEd448.default; -exports.Ed448Goldilock = ed448goldilockBrowser.Ed448Goldilock; -exports.createHash = createHash; -exports.createHmac = createHmac; -exports.pbkdf2Sync = pbkdf2Sync; -exports.randomBytes = randomBytes; -//# sourceMappingURL=crypto-browser.js.map diff --git a/lib.commonjs/crypto/crypto-browser.js.map b/lib.commonjs/crypto/crypto-browser.js.map deleted file mode 100644 index 6fbce7686..000000000 --- a/lib.commonjs/crypto/crypto-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto-browser.js","sources":["../../lib.esm/crypto/crypto-browser.js"],"sourcesContent":["/* Browser Crypto Shims */\nimport { ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { hmac } from \"@noble/hashes/hmac.js\";\nimport { pbkdf2 } from \"@noble/hashes/pbkdf2.js\";\nimport { sha256 } from \"@noble/hashes/sha2.js\";\nimport { sha512 } from \"@noble/hashes/sha2.js\";\nimport { sha3_256, sha3_512 } from \"@noble/hashes/sha3.js\";\nimport ed448 from \"./browser-ed448.js\";\nimport { assert, assertArgument } from \"../utils/index.js\";\nexport { ed448 };\nexport { Ed448Goldilock } from \"./ed448goldilock-browser.js\";\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\")\n return globalThis;\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst anyGlobal = getGlobal();\nconst crypto = anyGlobal.crypto || anyGlobal.msCrypto;\nexport function createHash(algo) {\n switch (algo) {\n case \"ripemd160\":\n return ripemd160.create();\n case \"sha256\":\n return sha256.create();\n case \"sha512\":\n return sha512.create();\n case \"sha3-256\":\n return sha3_256.create();\n case \"sha3-512\":\n return sha3_512.create();\n }\n assertArgument(false, \"invalid hashing algorithm name\", \"algorithm\", algo);\n}\nexport function createHmac(_algo, key) {\n const algo = { sha256, sha512, \"sha3-256\": sha3_256, \"sha3-512\": sha3_512 }[_algo];\n assertArgument(algo != null, \"invalid hmac algorithm\", \"algorithm\", _algo);\n return hmac.create(algo, key);\n}\nexport function pbkdf2Sync(password, salt, iterations, keylen, _algo) {\n const algo = { sha256, sha512 }[_algo];\n assertArgument(algo != null, \"invalid pbkdf2 algorithm\", \"algorithm\", _algo);\n return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen });\n}\nexport function randomBytes(length) {\n assert(crypto != null, \"platform does not support secure random numbers\", \"UNSUPPORTED_OPERATION\", {\n operation: \"randomBytes\",\n });\n assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, \"invalid length\", \"length\", length);\n const result = new Uint8Array(length);\n crypto.getRandomValues(result);\n return result;\n}\n//# sourceMappingURL=crypto-browser.js.map"],"names":["ripemd160","sha256","sha512","sha3_256","sha3_512","assertArgument","hmac","pbkdf2","assert"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAWA,SAAS,SAAS,GAAG;AACrB,IAAI,IAAI,OAAO,UAAU,KAAK,WAAW;AACzC,QAAQ,OAAO,UAAU;AACzB,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AACrC,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;AACrD;AACA,MAAM,SAAS,GAAG,SAAS,EAAE;AAC7B,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,IAAI,SAAS,CAAC,QAAQ;AAC9C,SAAS,UAAU,CAAC,IAAI,EAAE;AACjC,IAAI,QAAQ,IAAI;AAChB,QAAQ,KAAK,WAAW;AACxB,YAAY,OAAOA,mBAAS,CAAC,MAAM,EAAE;AACrC,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAOC,cAAM,CAAC,MAAM,EAAE;AAClC,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAOC,cAAM,CAAC,MAAM,EAAE;AAClC,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAOC,gBAAQ,CAAC,MAAM,EAAE;AACpC,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAOC,gBAAQ,CAAC,MAAM,EAAE;AACpC;AACA,IAAIC,qBAAc,CAAC,KAAK,EAAE,gCAAgC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;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto.d.ts b/lib.commonjs/crypto/crypto.d.ts deleted file mode 100644 index 67011fd36..000000000 --- a/lib.commonjs/crypto/crypto.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -import ed448 from "./ed448.js"; -export { ed448 }; -export { Ed448Goldilock } from "./ed448goldilock.js"; -export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto"; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto.d.ts.map b/lib.commonjs/crypto/crypto.d.ts.map deleted file mode 100644 index 551ce5172..000000000 --- a/lib.commonjs/crypto/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/crypto/crypto.js b/lib.commonjs/crypto/crypto.js deleted file mode 100644 index 9cac1a015..000000000 --- a/lib.commonjs/crypto/crypto.js +++ /dev/null @@ -1,27 +0,0 @@ -'use strict'; - -var ed448 = require('./ed448.js'); -var ed448goldilock = require('./ed448goldilock.js'); -var crypto = require('crypto'); - - - -exports.ed448 = ed448.default; -exports.Ed448Goldilock = ed448goldilock.Ed448Goldilock; -Object.defineProperty(exports, "createHash", { - enumerable: true, - get: function () { return crypto.createHash; } -}); -Object.defineProperty(exports, "createHmac", { - enumerable: true, - get: function () { return crypto.createHmac; } -}); -Object.defineProperty(exports, "pbkdf2Sync", { - enumerable: true, - get: function () { return crypto.pbkdf2Sync; } -}); -Object.defineProperty(exports, "randomBytes", { - enumerable: true, - get: function () { return crypto.randomBytes; } -}); -//# sourceMappingURL=crypto.js.map diff --git a/lib.commonjs/crypto/crypto.js.map b/lib.commonjs/crypto/crypto.js.map deleted file mode 100644 index a098d9444..000000000 --- a/lib.commonjs/crypto/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448-types.d.ts b/lib.commonjs/crypto/ed448-types.d.ts deleted file mode 100644 index 705f54df5..000000000 --- a/lib.commonjs/crypto/ed448-types.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Buffer } from "buffer"; -/** Buffer-based bcrypto Ed448 operations used by Core signing. */ -export interface Ed448Backend { - privateKeyGenerate(): Buffer; - publicKeyCreate(key: Buffer): Buffer; - publicKeyFromScalar(scalar: Buffer): Buffer; - publicKeyVerify(key: Buffer): boolean; - publicKeyCombine(keys: Buffer[]): Buffer; - sign(message: Buffer, key: Buffer): Buffer; - signWithScalar(message: Buffer, scalar: Buffer, prefix: Buffer): Buffer; - verify(message: Buffer, signature: Buffer, publicKey: Buffer): boolean; - derive(publicKey: Buffer, key: Buffer): Buffer; - deriveWithScalar(publicKey: Buffer, scalar: Buffer): Buffer; -} -//# sourceMappingURL=ed448-types.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448-types.d.ts.map b/lib.commonjs/crypto/ed448-types.d.ts.map deleted file mode 100644 index 209f88584..000000000 --- a/lib.commonjs/crypto/ed448-types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448-types.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC5B,kBAAkB,IAAI,MAAM,CAAC;IAC7B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5D"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448-types.js b/lib.commonjs/crypto/ed448-types.js deleted file mode 100644 index d036b4192..000000000 --- a/lib.commonjs/crypto/ed448-types.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=ed448-types.js.map diff --git a/lib.commonjs/crypto/ed448-types.js.map b/lib.commonjs/crypto/ed448-types.js.map deleted file mode 100644 index 387505732..000000000 --- a/lib.commonjs/crypto/ed448-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448-types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448.d.ts b/lib.commonjs/crypto/ed448.d.ts deleted file mode 100644 index fd3e5a866..000000000 --- a/lib.commonjs/crypto/ed448.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Ed448Backend } from "./ed448-types.js"; -declare const ed448: Ed448Backend; -export default ed448; -//# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448.d.ts.map b/lib.commonjs/crypto/ed448.d.ts.map deleted file mode 100644 index 7ea835437..000000000 --- a/lib.commonjs/crypto/ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448.js b/lib.commonjs/crypto/ed448.js deleted file mode 100644 index 13ed9d94f..000000000 --- a/lib.commonjs/crypto/ed448.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var backend = require('bcrypto/lib/ed448.js'); - -// bcrypto does not ship TypeScript declarations. -// @ts-ignore -const ed448 = backend; - -exports.default = ed448; -//# sourceMappingURL=ed448.js.map diff --git a/lib.commonjs/crypto/ed448.js.map b/lib.commonjs/crypto/ed448.js.map deleted file mode 100644 index 83df9098a..000000000 --- a/lib.commonjs/crypto/ed448.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.js","sources":["../../lib.esm/crypto/ed448.js"],"sourcesContent":["// bcrypto does not ship TypeScript declarations.\n// @ts-ignore\nimport backend from \"bcrypto/lib/ed448.js\";\nconst ed448 = backend;\nexport default ed448;\n//# sourceMappingURL=ed448.js.map"],"names":[],"mappings":";;;;;;AAAA;AACA;AAEK,MAAC,KAAK,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock-browser.d.ts b/lib.commonjs/crypto/ed448goldilock-browser.d.ts deleted file mode 100644 index 58df73a6f..000000000 --- a/lib.commonjs/crypto/ed448goldilock-browser.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Buffer } from "buffer"; -export declare class Ed448Goldilock { - static _channel: import("./ed448-types.js").Ed448Backend; - static generatePrivateKey(): Buffer; - static getPublicKeyFromPrivateKey(privateKey: string): string; - static signWithPrivateKey(privateKey: string, msg: string): string; - static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; - static verifySignature(msgHash: string, signedMsg: string, pubKey: string): boolean; - static SHA512Hash(password: string, salt: string): string; - static concatenateAndHex(prefix: number, key: string, index: number, salt: string): string; - static addScalar(a: string, b: string): string; - static seedToExtendedPrivate(seed: string): string; - static childPrivateToPrivate(s: string, index: number): string; - static HDWalletGenerateKeyFromSeed(seed: string, index: number): string; -} -//# sourceMappingURL=ed448goldilock-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock-browser.d.ts.map b/lib.commonjs/crypto/ed448goldilock-browser.d.ts.map deleted file mode 100644 index 976a9855d..000000000 --- a/lib.commonjs/crypto/ed448goldilock-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock-browser.js b/lib.commonjs/crypto/ed448goldilock-browser.js deleted file mode 100644 index f8e8e7229..000000000 --- a/lib.commonjs/crypto/ed448goldilock-browser.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -var buffer = require('buffer'); -var browserEd448 = require('./browser-ed448.js'); -var pbkdf2 = require('bcrypto/lib/pbkdf2-browser.js'); -var SHA3_512 = require('bcrypto/lib/sha3-512.js'); - -class Ed448Goldilock { - static _channel = browserEd448.default; - static generatePrivateKey() { - var privateKey = browserEd448.default.privateKeyGenerate(); - privateKey[56] &= 0x7f; - return privateKey; - } - static getPublicKeyFromPrivateKey(privateKey) { - var secret = buffer.Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var scalar = secret.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - var publicKey = this._channel.publicKeyFromScalar(scalar); - return buffer.Buffer.from(publicKey).toString("hex"); - } - else { - var publicKey = this._channel.publicKeyCreate(secret); - return buffer.Buffer.from(publicKey).toString("hex"); - } - } - static signWithPrivateKey(privateKey, msg) { - var msgToSign = buffer.Buffer.from(msg, "hex"); - var secret = buffer.Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var prefix = secret.slice(0, 57); - prefix[0] &= 0xfc; - prefix[56] = 0; - prefix[55] |= 0x80; - var scalar = prefix.slice(0, 56); - var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return buffer.Buffer.from(signedMessage).toString("hex"); - } - else { - var signedMessage = this._channel.sign(msgToSign, secret); - return buffer.Buffer.from(signedMessage).toString("hex"); - } - } - static signWithPrivateKeyNConcatPubkey(privateKey, msg) { - var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); - var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); - return signedMessage + publicKey; - } - static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(buffer.Buffer.from(msgHash, "hex"), buffer.Buffer.from(signedMsg, "hex"), buffer.Buffer.from(pubKey, "hex")); - } - static SHA512Hash(password, salt) { - var p1 = buffer.Buffer.from(password, "hex"); - var s1 = buffer.Buffer.from(salt, "hex"); - return buffer.Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); - } - static concatenateAndHex(prefix, key, index, salt) { - var ind = buffer.Buffer.alloc(4); - var p = buffer.Buffer.alloc(1); - p[0] = prefix % 256; - var j = index; - for (let i = 0; i < 4; i++) { - ind[i] = j % 256; - j = Math.floor(j / 256); - } - var t = p.toString("hex") + key + ind.toString("hex"); - return Ed448Goldilock.SHA512Hash(t, salt); - } - static addScalar(a, b) { - var a1 = buffer.Buffer.from(a, "hex"); - var b1 = buffer.Buffer.from(b.substr(0, 106) + "00000000", "hex"); - b1[0] &= 0xfc; - var c = buffer.Buffer.alloc(57); - var hold = 0; - for (let i = 0; i < 57; i++) { - hold += a1[i] + b1[i]; - c[i] = hold % 256; - hold = Math.floor(hold / 256); - } - return c.toString("hex"); - } - static seedToExtendedPrivate(seed) { - var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); - var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = buffer.Buffer.from(s2, "hex"); - b[56] |= 0x80; - b[55] |= 0x80; - b[55] &= 0xbf; - var s3 = b.toString("hex"); - return s1 + s3; - } - static childPrivateToPrivate(s, index) { - var s0 = s.substr(0, 114); - var s1 = s.substr(114, 228); - var r0, r1; - if (index >= 0x80000000) { - r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - else { - var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); - r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - } - static HDWalletGenerateKeyFromSeed(seed, index) { - var m = Ed448Goldilock.seedToExtendedPrivate(seed); - var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); - var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); - var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); - var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); - var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); - return k5.substr(114, 228); - } -} - -exports.Ed448Goldilock = Ed448Goldilock; -//# sourceMappingURL=ed448goldilock-browser.js.map diff --git a/lib.commonjs/crypto/ed448goldilock-browser.js.map b/lib.commonjs/crypto/ed448goldilock-browser.js.map deleted file mode 100644 index 0e87b2453..000000000 --- a/lib.commonjs/crypto/ed448goldilock-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock-browser.js","sources":["../../lib.esm/crypto/ed448goldilock-browser.js"],"sourcesContent":["import { Buffer } from \"buffer\";\n// @ts-ignore\nimport ed448 from \"./browser-ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"./pbkdf2-browser.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(Buffer.from(msgHash, \"hex\"), Buffer.from(signedMsg, \"hex\"), Buffer.from(pubKey, \"hex\"));\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock-browser.js.map"],"names":["ed448","Buffer"],"mappings":";;;;;;;AAOO,MAAM,cAAc,CAAC;AAC5B,IAAI,OAAO,QAAQ,GAAGA,oBAAK;AAC3B,IAAI,OAAO,kBAAkB,GAAG;AAChC,QAAQ,IAAI,UAAU,GAAGA,oBAAK,CAAC,kBAAkB,EAAE;AACnD,QAAQ,UAAU,CAAC,EAAE,CAAC,IAAI,IAAI;AAC9B,QAAQ,OAAO,UAAU;AACzB,IAAI;AACJ,IAAI,OAAO,0BAA0B,CAAC,UAAU,EAAE;AAClD,QAAQ,IAAI,MAAM,GAAGC,aAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;AACnD,QAAQ,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE;AAC9B,YAAY,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AAC5C,YAAY,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI;AAC7B,YAAY,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI;AAC9B,YAAY,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC;AACrE,YAAY,OAAOA,aAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;AACzD,QAAQ;AACR,aAAa;AACb,YAAY,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC;AACjE,YAAY,OAAOA,aAAM,CAAC,IAAI,CAAC,S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YAAY,EAAE,GAAG,cAAc,CAAC,iBAAiB,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC;AACpE,YAAY,OAAO,EAAE,GAAG,cAAc,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AACxD,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,2BAA2B,CAAC,IAAI,EAAE,KAAK,EAAE;AACpD,QAAQ,IAAI,CAAC,GAAG,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC;AAC1D,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,EAAE,UAAU,GAAG,EAAE,CAAC;AACzE,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC;AAC3E,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC;AACzE,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC;AACzE,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC;AAChE,QAAQ,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock.d.ts b/lib.commonjs/crypto/ed448goldilock.d.ts deleted file mode 100644 index 3dff60994..000000000 --- a/lib.commonjs/crypto/ed448goldilock.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Buffer } from "buffer"; -export declare class Ed448Goldilock { - static _channel: import("./ed448-types.js").Ed448Backend; - static generatePrivateKey(): Buffer; - static getPublicKeyFromPrivateKey(privateKey: string): string; - static signWithPrivateKey(privateKey: string, msg: string): string; - static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; - static verifySignature(msgHash: string, signedMsg: string, pubKey: string): boolean; - static SHA512Hash(password: string, salt: string): string; - static concatenateAndHex(prefix: number, key: string, index: number, salt: string): string; - static addScalar(a: string, b: string): string; - static seedToExtendedPrivate(seed: string): string; - static childPrivateToPrivate(s: string, index: number): string; - static HDWalletGenerateKeyFromSeed(seed: string, index: number): string; -} -//# sourceMappingURL=ed448goldilock.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock.d.ts.map b/lib.commonjs/crypto/ed448goldilock.d.ts.map deleted file mode 100644 index 7cd4dfaca..000000000 --- a/lib.commonjs/crypto/ed448goldilock.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ed448goldilock.js b/lib.commonjs/crypto/ed448goldilock.js deleted file mode 100644 index 895d79902..000000000 --- a/lib.commonjs/crypto/ed448goldilock.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -var buffer = require('buffer'); -var ed448 = require('./ed448.js'); -var pbkdf2 = require('bcrypto/lib/pbkdf2.js'); -var SHA3_512 = require('bcrypto/lib/sha3-512.js'); - -class Ed448Goldilock { - static _channel = ed448.default; - static generatePrivateKey() { - var privateKey = ed448.default.privateKeyGenerate(); - privateKey[56] &= 0x7f; - return privateKey; - } - static getPublicKeyFromPrivateKey(privateKey) { - var secret = buffer.Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var scalar = secret.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - var publicKey = this._channel.publicKeyFromScalar(scalar); - return buffer.Buffer.from(publicKey).toString("hex"); - } - else { - var publicKey = this._channel.publicKeyCreate(secret); - return buffer.Buffer.from(publicKey).toString("hex"); - } - } - static signWithPrivateKey(privateKey, msg) { - var msgToSign = buffer.Buffer.from(msg, "hex"); - var secret = buffer.Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var prefix = secret.slice(0, 57); - prefix[0] &= 0xfc; - prefix[56] = 0; - prefix[55] |= 0x80; - var scalar = prefix.slice(0, 56); - var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return buffer.Buffer.from(signedMessage).toString("hex"); - } - else { - var signedMessage = this._channel.sign(msgToSign, secret); - return buffer.Buffer.from(signedMessage).toString("hex"); - } - } - static signWithPrivateKeyNConcatPubkey(privateKey, msg) { - var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); - var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); - return signedMessage + publicKey; - } - static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(buffer.Buffer.from(msgHash, "hex"), buffer.Buffer.from(signedMsg, "hex"), buffer.Buffer.from(pubKey, "hex")); - } - static SHA512Hash(password, salt) { - var p1 = buffer.Buffer.from(password, "hex"); - var s1 = buffer.Buffer.from(salt, "hex"); - return buffer.Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); - } - static concatenateAndHex(prefix, key, index, salt) { - var ind = buffer.Buffer.alloc(4); - var p = buffer.Buffer.alloc(1); - p[0] = prefix % 256; - var j = index; - for (let i = 0; i < 4; i++) { - ind[i] = j % 256; - j = Math.floor(j / 256); - } - var t = p.toString("hex") + key + ind.toString("hex"); - return Ed448Goldilock.SHA512Hash(t, salt); - } - static addScalar(a, b) { - var a1 = buffer.Buffer.from(a, "hex"); - var b1 = buffer.Buffer.from(b.substr(0, 106) + "00000000", "hex"); - b1[0] &= 0xfc; - var c = buffer.Buffer.alloc(57); - var hold = 0; - for (let i = 0; i < 57; i++) { - hold += a1[i] + b1[i]; - c[i] = hold % 256; - hold = Math.floor(hold / 256); - } - return c.toString("hex"); - } - static seedToExtendedPrivate(seed) { - var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); - var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = buffer.Buffer.from(s2, "hex"); - b[56] |= 0x80; - b[55] |= 0x80; - b[55] &= 0xbf; - var s3 = b.toString("hex"); - return s1 + s3; - } - static childPrivateToPrivate(s, index) { - var s0 = s.substr(0, 114); - var s1 = s.substr(114, 228); - var r0, r1; - if (index >= 0x80000000) { - r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - else { - var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); - r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - } - static HDWalletGenerateKeyFromSeed(seed, index) { - var m = Ed448Goldilock.seedToExtendedPrivate(seed); - var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); - var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); - var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); - var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); - var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); - return k5.substr(114, 228); - } -} - -exports.Ed448Goldilock = Ed448Goldilock; -//# sourceMappingURL=ed448goldilock.js.map diff --git a/lib.commonjs/crypto/ed448goldilock.js.map b/lib.commonjs/crypto/ed448goldilock.js.map deleted file mode 100644 index 76a3dc398..000000000 --- a/lib.commonjs/crypto/ed448goldilock.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock.js","sources":["../../lib.esm/crypto/ed448goldilock.js"],"sourcesContent":["import { Buffer } from \"buffer\";\n// @ts-ignore\nimport ed448 from \"./ed448.js\";\n// @ts-ignore\nimport pbkdf2 from \"bcrypto/lib/pbkdf2.js\";\n// @ts-ignore\nimport SHA3_512 from \"bcrypto/lib/sha3-512.js\";\nexport class Ed448Goldilock {\n static _channel = ed448;\n static generatePrivateKey() {\n var privateKey = ed448.privateKeyGenerate();\n privateKey[56] &= 0x7f;\n return privateKey;\n }\n static getPublicKeyFromPrivateKey(privateKey) {\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var scalar = secret.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n var publicKey = this._channel.publicKeyFromScalar(scalar);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n else {\n var publicKey = this._channel.publicKeyCreate(secret);\n return Buffer.from(publicKey).toString(\"hex\");\n }\n }\n static signWithPrivateKey(privateKey, msg) {\n var msgToSign = Buffer.from(msg, \"hex\");\n var secret = Buffer.from(privateKey, \"hex\");\n if (secret[56] > 127) {\n var prefix = secret.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[56] = 0;\n prefix[55] |= 0x80;\n var scalar = prefix.slice(0, 56);\n var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n else {\n var signedMessage = this._channel.sign(msgToSign, secret);\n return Buffer.from(signedMessage).toString(\"hex\");\n }\n }\n static signWithPrivateKeyNConcatPubkey(privateKey, msg) {\n var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg);\n var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey);\n return signedMessage + publicKey;\n }\n static verifySignature(msgHash, signedMsg, pubKey) {\n return this._channel.verify(Buffer.from(msgHash, \"hex\"), Buffer.from(signedMsg, \"hex\"), Buffer.from(pubKey, \"hex\"));\n }\n static SHA512Hash(password, salt) {\n var p1 = Buffer.from(password, \"hex\");\n var s1 = Buffer.from(salt, \"hex\");\n return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString(\"hex\");\n }\n static concatenateAndHex(prefix, key, index, salt) {\n var ind = Buffer.alloc(4);\n var p = Buffer.alloc(1);\n p[0] = prefix % 256;\n var j = index;\n for (let i = 0; i < 4; i++) {\n ind[i] = j % 256;\n j = Math.floor(j / 256);\n }\n var t = p.toString(\"hex\") + key + ind.toString(\"hex\");\n return Ed448Goldilock.SHA512Hash(t, salt);\n }\n static addScalar(a, b) {\n var a1 = Buffer.from(a, \"hex\");\n var b1 = Buffer.from(b.substr(0, 106) + \"00000000\", \"hex\");\n b1[0] &= 0xfc;\n var c = Buffer.alloc(57);\n var hold = 0;\n for (let i = 0; i < 57; i++) {\n hold += a1[i] + b1[i];\n c[i] = hold % 256;\n hold = Math.floor(hold / 256);\n }\n return c.toString(\"hex\");\n }\n static seedToExtendedPrivate(seed) {\n var s1 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f72746865636861696e\");\n var s2 = Ed448Goldilock.SHA512Hash(seed, \"6d6e656d6f6e6963666f727468656b6579\");\n var b = Buffer.from(s2, \"hex\");\n b[56] |= 0x80;\n b[55] |= 0x80;\n b[55] &= 0xbf;\n var s3 = b.toString(\"hex\");\n return s1 + s3;\n }\n static childPrivateToPrivate(s, index) {\n var s0 = s.substr(0, 114);\n var s1 = s.substr(114, 228);\n var r0, r1;\n if (index >= 0x80000000) {\n r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n else {\n var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1);\n r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0);\n r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0);\n return r0 + Ed448Goldilock.addScalar(s1, r1);\n }\n }\n static HDWalletGenerateKeyFromSeed(seed, index) {\n var m = Ed448Goldilock.seedToExtendedPrivate(seed);\n var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44);\n var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654);\n var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0);\n var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0);\n var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index);\n return k5.substr(114, 228);\n }\n}\n//# sourceMappingURL=ed448goldilock.js.map"],"names":["ed448","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Ac,CAAC,qBAAqB,CAAC,IAAI,CAAC;AAC1D,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,EAAE,UAAU,GAAG,EAAE,CAAC;AACzE,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC;AAC3E,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC;AACzE,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC;AACzE,QAAQ,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC;AAChE,QAAQ,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/hmac.d.ts b/lib.commonjs/crypto/hmac.d.ts deleted file mode 100644 index 902055c49..000000000 --- a/lib.commonjs/crypto/hmac.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -declare const _computeHmac: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string; -export declare namespace computeHmac { - export { _computeHmac as _ }; - export var lock: () => void; - export var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/hmac.d.ts.map b/lib.commonjs/crypto/hmac.d.ts.map deleted file mode 100644 index b5c8a51d9..000000000 --- a/lib.commonjs/crypto/hmac.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,YAAY,cACN,QAAQ,GAAG,QAAQ,OACzB,UAAU,QACT,UAAU,KACd,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAC1B,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,GACd,MAAM,CAIR;yBARe,WAAW;aASX,YAAY;;gCAKrB,CACL,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,UAAU,KACZ,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/hmac.js b/lib.commonjs/crypto/hmac.js deleted file mode 100644 index 1a78b028a..000000000 --- a/lib.commonjs/crypto/hmac.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -var crypto = require('crypto'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -/** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ -let locked = false; -const _computeHmac = function (algorithm, key, data) { - return crypto.createHmac(algorithm, key).update(data).digest(); -}; -let __computeHmac = _computeHmac; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -function computeHmac(algorithm, _key, _data) { - const key = data.getBytes(_key, "key"); - const data$1 = data.getBytes(_data, "data"); - return data.hexlify(__computeHmac(algorithm, key, data$1)); -} -computeHmac._ = _computeHmac; -computeHmac.lock = function () { - locked = true; -}; -computeHmac.register = function (func) { - if (locked) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; -}; -Object.freeze(computeHmac); - -exports.computeHmac = computeHmac; -//# sourceMappingURL=hmac.js.map diff --git a/lib.commonjs/crypto/hmac.js.map b/lib.commonjs/crypto/hmac.js.map deleted file mode 100644 index f426aca63..000000000 --- a/lib.commonjs/crypto/hmac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.js","sources":["../../lib.esm/crypto/hmac.js"],"sourcesContent":["/**\n * An **HMAC** enables verification that a given key was used\n * to authenticate a payload.\n *\n * See: [[link-wiki-hmac]]\n *\n * @_subsection: api/crypto:HMAC [about-hmac]\n */\nimport { createHmac } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _computeHmac = function (algorithm, key, data) {\n return createHmac(algorithm, key).update(data).digest();\n};\nlet __computeHmac = _computeHmac;\n/**\n * Return the HMAC for %%data%% using the %%key%% key with the underlying\n * %%algo%% used for compression.\n *\n * @example:\n * key = id(\"some-secret\")\n *\n * // Compute the HMAC\n * computeHmac(\"sha256\", key, \"0x1337\")\n * //_result:\n *\n * // To compute the HMAC of UTF-8 data, the data must be\n * // converted to UTF-8 bytes\n * computeHmac(\"sha256\", key, toUtf8Bytes(\"Hello World\"))\n * //_result:\n *\n */\nexport function computeHmac(algorithm, _key, _data) {\n const key = getBytes(_key, \"key\");\n const data = getBytes(_data, \"data\");\n return hexlify(__computeHmac(algorithm, key, data));\n}\ncomputeHmac._ = _computeHmac;\ncomputeHmac.lock = function () {\n locked = true;\n};\ncomputeHmac.register = function (func) {\n if (locked) {\n throw new Error(\"computeHmac is locked\");\n }\n __computeHmac = func;\n};\nObject.freeze(computeHmac);\n//# sourceMappingURL=hmac.js.map"],"names":["createHmac","getBytes","data","hexlify"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,YAAY,GAAG,UAAU,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE;AACrD,IAAI,OAAOA,iBAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE;AAC3D,CAAC;AACD,IAAI,aAAa,GAAG,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE;AACpD,IAAI,MAAM,GAAG,GAAGC,aAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;AACrC,IAAI,MAAMC,MAAI,GAAGD,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,OAAOE,YAAO,CAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAED,MAAI,CAAC,CAAC;AACvD;AACA,WAAW,CAAC,CAAC,GAAG,YAAY;AAC5B,WAAW,CAAC,IAAI,GAAG,YAAY;AAC/B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,WAAW,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACvC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC;AAChD,IAAI;AACJ,IAAI,aAAa,GAAG,IAAI;AACxB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/index.d.ts b/lib.commonjs/crypto/index.d.ts deleted file mode 100644 index 0730e25c8..000000000 --- a/lib.commonjs/crypto/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A fundamental building block of Core is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -import { computeHmac } from "./hmac.js"; -import { ripemd160 } from "./ripemd160.js"; -import { pbkdf2 } from "./pbkdf2.js"; -import { randomBytes } from "./random.js"; -import { scrypt, scryptSync } from "./scrypt.js"; -import { sha256, sha512 } from "./sha3.js"; -import { Ed448Goldilock } from "./crypto.js"; -import { keccak256 } from "./keccak.js"; -export { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, }; -export { SigningKey } from "./signing-key.js"; -export { Signature } from "./signature.js"; -declare function lock(): void; -export { lock }; -export type { ProgressCallback } from "./scrypt.js"; -export type { SignatureLike } from "./signature.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/index.d.ts.map b/lib.commonjs/crypto/index.d.ts.map deleted file mode 100644 index 76d2d37f8..000000000 --- a/lib.commonjs/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,iBAAS,IAAI,IAAI,IAAI,CAUpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/crypto/index.js b/lib.commonjs/crypto/index.js deleted file mode 100644 index 281f2f81f..000000000 --- a/lib.commonjs/crypto/index.js +++ /dev/null @@ -1,47 +0,0 @@ -'use strict'; - -var hmac = require('./hmac.js'); -var ripemd160 = require('./ripemd160.js'); -var pbkdf2 = require('./pbkdf2.js'); -var random = require('./random.js'); -var scrypt = require('./scrypt.js'); -var sha3 = require('./sha3.js'); -require('bcrypto/lib/ed448.js'); -var ed448goldilock = require('./ed448goldilock.js'); -require('crypto'); -var keccak = require('./keccak.js'); -var signingKey = require('./signing-key.js'); -var signature = require('./signature.js'); - -/** - * A fundamental building block of Core is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -function lock() { - hmac.computeHmac.lock(); - pbkdf2.pbkdf2.lock(); - random.randomBytes.lock(); - ripemd160.ripemd160.lock(); - scrypt.scrypt.lock(); - scrypt.scryptSync.lock(); - sha3.sha256.lock(); - sha3.sha512.lock(); - random.randomBytes.lock(); -} - -exports.computeHmac = hmac.computeHmac; -exports.ripemd160 = ripemd160.ripemd160; -exports.pbkdf2 = pbkdf2.pbkdf2; -exports.randomBytes = random.randomBytes; -exports.scrypt = scrypt.scrypt; -exports.scryptSync = scrypt.scryptSync; -exports.sha256 = sha3.sha256; -exports.sha512 = sha3.sha512; -exports.Ed448Goldilock = ed448goldilock.Ed448Goldilock; -exports.keccak256 = keccak.keccak256; -exports.SigningKey = signingKey.SigningKey; -exports.Signature = signature.Signature; -exports.lock = lock; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/crypto/index.js.map b/lib.commonjs/crypto/index.js.map deleted file mode 100644 index a0a1a2c5f..000000000 --- a/lib.commonjs/crypto/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../lib.esm/crypto/index.js"],"sourcesContent":["/**\n * A fundamental building block of Core is the underlying\n * cryptographic primitives.\n *\n * @_section: api/crypto:Cryptographic Functions [about-crypto]\n */\nnull;\n// We import all these so we can export lock()\nimport { computeHmac } from \"./hmac.js\";\nimport { ripemd160 } from \"./ripemd160.js\";\nimport { pbkdf2 } from \"./pbkdf2.js\";\nimport { randomBytes } from \"./random.js\";\nimport { scrypt, scryptSync } from \"./scrypt.js\";\nimport { sha256, sha512 } from \"./sha3.js\";\nimport { Ed448Goldilock } from \"./crypto.js\";\nimport { keccak256 } from \"./keccak.js\";\nexport { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, };\nexport { SigningKey } from \"./signing-key.js\";\nexport { Signature } from \"./signature.js\";\nfunction lock() {\n computeHmac.lock();\n pbkdf2.lock();\n randomBytes.lock();\n ripemd160.lock();\n scrypt.lock();\n scryptSync.lock();\n sha256.lock();\n sha512.lock();\n randomBytes.lock();\n}\nexport { lock };\n//# sourceMappingURL=index.js.map"],"names":["computeHmac","pbkdf2","randomBytes","ripemd160","scrypt","scryptSync","sha256","sha512"],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAcA,SAAS,IAAI,GAAG;AAChB,IAAIA,gBAAW,CAAC,IAAI,EAAE;AACtB,IAAIC,aAAM,CAAC,IAAI,EAAE;AACjB,IAAIC,kBAAW,CAAC,IAAI,EAAE;AACtB,IAAIC,mBAAS,CAAC,IAAI,EAAE;AACpB,IAAIC,aAAM,CAAC,IAAI,EAAE;AACjB,IAAIC,iBAAU,CAAC,IAAI,EAAE;AACrB,IAAIC,WAAM,CAAC,IAAI,EAAE;AACjB,IAAIC,WAAM,CAAC,IAAI,EAAE;AACjB,IAAIL,kBAAW,CAAC,IAAI,EAAE;AACtB;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/keccak.d.ts b/lib.commonjs/crypto/keccak.d.ts deleted file mode 100644 index a2b3dd879..000000000 --- a/lib.commonjs/crypto/keccak.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -import type { BytesLike } from "../utils/index.js"; -declare const _keccak256: (data: Uint8Array) => Uint8Array; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -export declare function keccak256(_data: BytesLike): string; -export declare namespace keccak256 { - export { _keccak256 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=keccak.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/keccak.d.ts.map b/lib.commonjs/crypto/keccak.d.ts.map deleted file mode 100644 index dfe4be3ef..000000000 --- a/lib.commonjs/crypto/keccak.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/keccak.js b/lib.commonjs/crypto/keccak.js deleted file mode 100644 index c2ce1cb0c..000000000 --- a/lib.commonjs/crypto/keccak.js +++ /dev/null @@ -1,63 +0,0 @@ -'use strict'; - -var sha3_js = require('@noble/hashes/sha3.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -let locked = false; -const _keccak256 = function (data) { - return sha3_js.keccak_256(data); -}; -let __keccak256 = _keccak256; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -function keccak256(_data) { - const data$1 = data.getBytes(_data, "data"); - return data.hexlify(__keccak256(data$1)); -} -keccak256._ = _keccak256; -keccak256.lock = function () { - locked = true; -}; -keccak256.register = function (func) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; -}; -Object.freeze(keccak256); - -exports.keccak256 = keccak256; -//# sourceMappingURL=keccak.js.map diff --git a/lib.commonjs/crypto/keccak.js.map b/lib.commonjs/crypto/keccak.js.map deleted file mode 100644 index 32246deff..000000000 --- a/lib.commonjs/crypto/keccak.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.js","sources":["../../lib.esm/crypto/keccak.js"],"sourcesContent":["/**\n * Cryptographic hashing functions\n *\n * @_subsection: api/crypto:Hash Functions [about-crypto-hashing]\n */\nimport { keccak_256 } from \"@noble/hashes/sha3.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _keccak256 = function (data) {\n return keccak_256(data);\n};\nlet __keccak256 = _keccak256;\n/**\n * Compute the cryptographic KECCAK256 hash of %%data%%.\n *\n * The %%data%% **must** be a data representation, to compute the\n * hash of UTF-8 data use the [[id]] function.\n *\n * @returns DataHexstring\n * @example:\n * keccak256(\"0x\")\n * //_result:\n *\n * keccak256(\"0x1337\")\n * //_result:\n *\n * keccak256(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n * // Strings are assumed to be DataHexString, otherwise it will\n * // throw. To hash UTF-8 data, see the note above.\n * keccak256(\"Hello World\")\n * //_error:\n */\nexport function keccak256(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__keccak256(data));\n}\nkeccak256._ = _keccak256;\nkeccak256.lock = function () {\n locked = true;\n};\nkeccak256.register = function (func) {\n if (locked) {\n throw new TypeError(\"keccak256 is locked\");\n }\n __keccak256 = func;\n};\nObject.freeze(keccak256);\n//# sourceMappingURL=keccak.js.map"],"names":["keccak_256","data","getBytes","hexlify"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAGA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,UAAU,GAAG,UAAU,IAAI,EAAE;AACnC,IAAI,OAAOA,kBAAU,CAAC,IAAI,CAAC;AAC3B,CAAC;AACD,IAAI,WAAW,GAAG,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,MAAMC,MAAI,GAAGC,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,OAAOC,YAAO,CAAC,WAAW,CAACF,MAAI,CAAC,CAAC;AACrC;AACA,SAAS,CAAC,CAAC,GAAG,UAAU;AACxB,SAAS,CAAC,IAAI,GAAG,YAAY;AAC7B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACrC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC;AAClD,IAAI;AACJ,IAAI,WAAW,GAAG,IAAI;AACtB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2-browser.d.ts b/lib.commonjs/crypto/pbkdf2-browser.d.ts deleted file mode 100644 index 31ae18ebe..000000000 --- a/lib.commonjs/crypto/pbkdf2-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import pbkdf2 from "bcrypto/lib/pbkdf2-browser.js"; -export default pbkdf2; -//# sourceMappingURL=pbkdf2-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2-browser.d.ts.map b/lib.commonjs/crypto/pbkdf2-browser.d.ts.map deleted file mode 100644 index 97bf68048..000000000 --- a/lib.commonjs/crypto/pbkdf2-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,+BAA+B,CAAC;eACpC,MAAM"} \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2-browser.js b/lib.commonjs/crypto/pbkdf2-browser.js deleted file mode 100644 index baea974bd..000000000 --- a/lib.commonjs/crypto/pbkdf2-browser.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var pbkdf2 = require('bcrypto/lib/pbkdf2-browser.js'); - -// @ts-ignore - -exports.default = pbkdf2; -//# sourceMappingURL=pbkdf2-browser.js.map diff --git a/lib.commonjs/crypto/pbkdf2-browser.js.map b/lib.commonjs/crypto/pbkdf2-browser.js.map deleted file mode 100644 index 007d860a6..000000000 --- a/lib.commonjs/crypto/pbkdf2-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2-browser.js","sources":["../../lib.esm/crypto/pbkdf2-browser.js"],"sourcesContent":["// @ts-ignore\nimport pbkdf2 from \"bcrypto/lib/pbkdf2-browser.js\";\nexport default pbkdf2;\n//# sourceMappingURL=pbkdf2-browser.js.map"],"names":[],"mappings":";;;;;;AAAA;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2.d.ts b/lib.commonjs/crypto/pbkdf2.d.ts deleted file mode 100644 index c2da81c40..000000000 --- a/lib.commonjs/crypto/pbkdf2.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -import type { BytesLike } from "../utils/index.js"; -declare const _pbkdf2: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string; -export declare namespace pbkdf2 { - export { _pbkdf2 as _ }; - export var lock: () => void; - export var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; -} -export {}; -//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2.d.ts.map b/lib.commonjs/crypto/pbkdf2.d.ts.map deleted file mode 100644 index fc5ad966d..000000000 --- a/lib.commonjs/crypto/pbkdf2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,OAAO,aACF,UAAU,QACd,UAAU,cACJ,MAAM,UACV,MAAM,QACR,QAAQ,GAAG,QAAQ,KACvB,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACrB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GACvB,MAAM,CAIR;yBAVe,MAAM;aAWX,OAAO;2BACS,IAAI;gCAIxB,CACL,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,KACrB,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/pbkdf2.js b/lib.commonjs/crypto/pbkdf2.js deleted file mode 100644 index c1da63367..000000000 --- a/lib.commonjs/crypto/pbkdf2.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -var crypto = require('crypto'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -let locked = false; -const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return crypto.pbkdf2Sync(password, salt, iterations, keylen, algo); -}; -let __pbkdf2 = _pbkdf2; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = data.getBytes(_password, "password"); - const salt = data.getBytes(_salt, "salt"); - return data.hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); -} -pbkdf2._ = _pbkdf2; -pbkdf2.lock = function () { - locked = true; -}; -pbkdf2.register = function (func) { - if (locked) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; -}; -Object.freeze(pbkdf2); - -exports.pbkdf2 = pbkdf2; -//# sourceMappingURL=pbkdf2.js.map diff --git a/lib.commonjs/crypto/pbkdf2.js.map b/lib.commonjs/crypto/pbkdf2.js.map deleted file mode 100644 index 5eb672f83..000000000 --- a/lib.commonjs/crypto/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sources":["../../lib.esm/crypto/pbkdf2.js"],"sourcesContent":["/**\n * A **Password-Based Key-Derivation Function** is designed to create\n * a sequence of bytes suitible as a **key** from a human-rememberable\n * password.\n *\n * @_subsection: api/crypto:Passwords [about-pbkdf]\n */\nimport { pbkdf2Sync } from \"./crypto.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _pbkdf2 = function (password, salt, iterations, keylen, algo) {\n return pbkdf2Sync(password, salt, iterations, keylen, algo);\n};\nlet __pbkdf2 = _pbkdf2;\n/**\n * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using\n * the %%salt%% and using %%iterations%% of %%algo%%.\n *\n * This PBKDF is outdated and should not be used in new projects, but is\n * required to decrypt older files.\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the PBKDF2\n * pbkdf2(passwordBytes, salt, 1024, 16, \"sha256\")\n * //_result:\n */\nexport function pbkdf2(_password, _salt, iterations, keylen, algo) {\n const password = getBytes(_password, \"password\");\n const salt = getBytes(_salt, \"salt\");\n return hexlify(__pbkdf2(password, salt, iterations, keylen, algo));\n}\npbkdf2._ = _pbkdf2;\npbkdf2.lock = function () {\n locked = true;\n};\npbkdf2.register = function (func) {\n if (locked) {\n throw new Error(\"pbkdf2 is locked\");\n }\n __pbkdf2 = func;\n};\nObject.freeze(pbkdf2);\n//# sourceMappingURL=pbkdf2.js.map"],"names":["pbkdf2Sync","getBytes","hexlify"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,OAAO,GAAG,UAAU,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;AACpE,IAAI,OAAOA,iBAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC;AAC/D,CAAC;AACD,IAAI,QAAQ,GAAG,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE;AACnE,IAAI,MAAM,QAAQ,GAAGC,aAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;AACpD,IAAI,MAAM,IAAI,GAAGA,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,OAAOC,YAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACtE;AACA,MAAM,CAAC,CAAC,GAAG,OAAO;AAClB,MAAM,CAAC,IAAI,GAAG,YAAY;AAC1B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,MAAM,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AAClC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC;AAC3C,IAAI;AACJ,IAAI,QAAQ,GAAG,IAAI;AACnB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/random.d.ts b/lib.commonjs/crypto/random.d.ts deleted file mode 100644 index 609ec0ec0..000000000 --- a/lib.commonjs/crypto/random.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -declare const _randomBytes: (length: number) => Uint8Array; -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -export declare function randomBytes(length: number): Uint8Array; -export declare namespace randomBytes { - export { _randomBytes as _ }; - export var lock: () => void; - export var register: (func: (length: number) => Uint8Array) => void; -} -export {}; -//# sourceMappingURL=random.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/random.d.ts.map b/lib.commonjs/crypto/random.d.ts.map deleted file mode 100644 index 0e9d29e7b..000000000 --- a/lib.commonjs/crypto/random.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY,WAAqB,MAAM,KAAG,UAE/C,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW;aAIX,YAAY;2BACI,IAAI;gCAGG,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU"} \ No newline at end of file diff --git a/lib.commonjs/crypto/random.js b/lib.commonjs/crypto/random.js deleted file mode 100644 index 7bfad060b..000000000 --- a/lib.commonjs/crypto/random.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -var crypto = require('crypto'); - -/** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ -let locked = false; -const _randomBytes = function (length) { - return new Uint8Array(crypto.randomBytes(length)); -}; -let __randomBytes = _randomBytes; -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -function randomBytes(length) { - return __randomBytes(length); -} -randomBytes._ = _randomBytes; -randomBytes.lock = function () { - locked = true; -}; -randomBytes.register = function (func) { - if (locked) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; -}; -Object.freeze(randomBytes); - -exports.randomBytes = randomBytes; -//# sourceMappingURL=random.js.map diff --git a/lib.commonjs/crypto/random.js.map b/lib.commonjs/crypto/random.js.map deleted file mode 100644 index 842f2fcee..000000000 --- a/lib.commonjs/crypto/random.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.js","sources":["../../lib.esm/crypto/random.js"],"sourcesContent":["/**\n * A **Cryptographically Secure Random Value** is one that has been\n * generated with additional care take to prevent side-channels\n * from allowing others to detect it and prevent others from through\n * coincidence generate the same values.\n *\n * @_subsection: api/crypto:Random Values [about-crypto-random]\n */\nimport { randomBytes as crypto_random } from \"./crypto.js\";\nlet locked = false;\nconst _randomBytes = function (length) {\n return new Uint8Array(crypto_random(length));\n};\nlet __randomBytes = _randomBytes;\n/**\n * Return %%length%% bytes of cryptographically secure random data.\n *\n * @example:\n * randomBytes(8)\n * //_result:\n */\nexport function randomBytes(length) {\n return __randomBytes(length);\n}\nrandomBytes._ = _randomBytes;\nrandomBytes.lock = function () {\n locked = true;\n};\nrandomBytes.register = function (func) {\n if (locked) {\n throw new Error(\"randomBytes is locked\");\n }\n __randomBytes = func;\n};\nObject.freeze(randomBytes);\n//# sourceMappingURL=random.js.map"],"names":["crypto_random"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,YAAY,GAAG,UAAU,MAAM,EAAE;AACvC,IAAI,OAAO,IAAI,UAAU,CAACA,kBAAa,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC;AACD,IAAI,aAAa,GAAG,YAAY;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,MAAM,EAAE;AACpC,IAAI,OAAO,aAAa,CAAC,MAAM,CAAC;AAChC;AACA,WAAW,CAAC,CAAC,GAAG,YAAY;AAC5B,WAAW,CAAC,IAAI,GAAG,YAAY;AAC/B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,WAAW,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACvC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC;AAChD,IAAI;AACJ,IAAI,aAAa,GAAG,IAAI;AACxB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ripemd160.d.ts b/lib.commonjs/crypto/ripemd160.d.ts deleted file mode 100644 index a38b5f516..000000000 --- a/lib.commonjs/crypto/ripemd160.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -declare const _ripemd160: (data: Uint8Array) => Uint8Array; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare function ripemd160(_data: BytesLike): string; -export declare namespace ripemd160 { - export { _ripemd160 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/ripemd160.d.ts.map b/lib.commonjs/crypto/ripemd160.d.ts.map deleted file mode 100644 index 68683ca8b..000000000 --- a/lib.commonjs/crypto/ripemd160.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/ripemd160.js b/lib.commonjs/crypto/ripemd160.js deleted file mode 100644 index 300a4a960..000000000 --- a/lib.commonjs/crypto/ripemd160.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var legacy_js = require('@noble/hashes/legacy.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -let locked = false; -const _ripemd160 = function (data) { - return legacy_js.ripemd160(data); -}; -let __ripemd160 = _ripemd160; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -function ripemd160(_data) { - const data$1 = data.getBytes(_data, "data"); - return data.hexlify(__ripemd160(data$1)); -} -ripemd160._ = _ripemd160; -ripemd160.lock = function () { - locked = true; -}; -ripemd160.register = function (func) { - if (locked) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; -}; -Object.freeze(ripemd160); - -exports.ripemd160 = ripemd160; -//# sourceMappingURL=ripemd160.js.map diff --git a/lib.commonjs/crypto/ripemd160.js.map b/lib.commonjs/crypto/ripemd160.js.map deleted file mode 100644 index 18be84c0d..000000000 --- a/lib.commonjs/crypto/ripemd160.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.js","sources":["../../lib.esm/crypto/ripemd160.js"],"sourcesContent":["import { ripemd160 as noble_ripemd160 } from \"@noble/hashes/legacy.js\";\nimport { getBytes, hexlify } from \"../utils/index.js\";\nlet locked = false;\nconst _ripemd160 = function (data) {\n return noble_ripemd160(data);\n};\nlet __ripemd160 = _ripemd160;\n/**\n * Compute the cryptographic RIPEMD-160 hash of %%data%%.\n *\n * @_docloc: api/crypto:Hash Functions\n * @returns DataHexstring\n *\n * @example:\n * ripemd160(\"0x\")\n * //_result:\n *\n * ripemd160(\"0x1337\")\n * //_result:\n *\n * ripemd160(new Uint8Array([ 0x13, 0x37 ]))\n * //_result:\n *\n */\nexport function ripemd160(_data) {\n const data = getBytes(_data, \"data\");\n return hexlify(__ripemd160(data));\n}\nripemd160._ = _ripemd160;\nripemd160.lock = function () {\n locked = true;\n};\nripemd160.register = function (func) {\n if (locked) {\n throw new TypeError(\"ripemd160 is locked\");\n }\n __ripemd160 = func;\n};\nObject.freeze(ripemd160);\n//# sourceMappingURL=ripemd160.js.map"],"names":["noble_ripemd160","data","getBytes","hexlify"],"mappings":";;;;;;;;;;;;;AAEA,IAAI,MAAM,GAAG,KAAK;AAClB,MAAM,UAAU,GAAG,UAAU,IAAI,EAAE;AACnC,IAAI,OAAOA,mBAAe,CAAC,IAAI,CAAC;AAChC,CAAC;AACD,IAAI,WAAW,GAAG,UAAU;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,MAAMC,MAAI,GAAGC,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,OAAOC,YAAO,CAAC,WAAW,CAACF,MAAI,CAAC,CAAC;AACrC;AACA,SAAS,CAAC,CAAC,GAAG,UAAU;AACxB,SAAS,CAAC,IAAI,GAAG,YAAY;AAC7B,IAAI,MAAM,GAAG,IAAI;AACjB,CAAC;AACD,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACrC,IAAI,IAAI,MAAM,EAAE;AAChB,QAAQ,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC;AAClD,IAAI;AACJ,IAAI,WAAW,GAAG,IAAI;AACtB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/rlp.d.ts b/lib.commonjs/crypto/rlp.d.ts deleted file mode 100644 index 42970ab48..000000000 --- a/lib.commonjs/crypto/rlp.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { BytesLike } from "../utils/data.js"; -export declare function encode(object: any): string; -export declare function decode(data: BytesLike): any; -//# sourceMappingURL=rlp.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/rlp.d.ts.map b/lib.commonjs/crypto/rlp.d.ts.map deleted file mode 100644 index 6c9570fb1..000000000 --- a/lib.commonjs/crypto/rlp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/rlp.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,SAAS,EAAwB,MAAM,kBAAkB,CAAC;AA+D7E,wBAAgB,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAE1C;AAkHD,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,GAAG,CAO3C"} \ No newline at end of file diff --git a/lib.commonjs/crypto/rlp.js b/lib.commonjs/crypto/rlp.js deleted file mode 100644 index 98b66fc9b..000000000 --- a/lib.commonjs/crypto/rlp.js +++ /dev/null @@ -1,124 +0,0 @@ -'use strict'; - -var logger$1 = require('../logger/logger.js'); -var data = require('../utils/data.js'); - -const logger = new logger$1.Logger("rlp/0.0.1"); -function arrayifyInteger(value) { - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; -} -function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - if (!data.isBytesLike(object)) { - logger.throwArgumentError("RLP object must be BytesLike", "object", object); - } - const data$1 = Array.prototype.slice.call(data.arrayify(object)); - if (data$1.length === 1 && data$1[0] <= 0x7f) { - return data$1; - } - else if (data$1.length <= 55) { - data$1.unshift(0x80 + data$1.length); - return data$1; - } - const length = arrayifyInteger(data$1.length); - length.unshift(0xb7 + length.length); - return length.concat(data$1); -} -function encode(object) { - return data.hexlify(_encode(object)); -} -function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - if (childOffset > offset + 1 + length) { - logger.throwError("child data too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); - } - } - return { consumed: 1 + length, result: result }; -} -// returns { consumed: number, result: Object } -function _decode(data$1, offset) { - if (data$1.length === 0) { - logger.throwError("data too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); - } - // Array with extra length prefix - if (data$1[offset] >= 0xf8) { - const lengthLength = data$1[offset] - 0xf7; - if (offset + 1 + lengthLength > data$1.length) { - logger.throwError("data short segment too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger(data$1, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data$1.length) { - logger.throwError("data long segment too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren(data$1, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data$1[offset] >= 0xc0) { - const length = data$1[offset] - 0xc0; - if (offset + 1 + length > data$1.length) { - logger.throwError("data array too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren(data$1, offset, offset + 1, length); - } - else if (data$1[offset] >= 0xb8) { - const lengthLength = data$1[offset] - 0xb7; - if (offset + 1 + lengthLength > data$1.length) { - logger.throwError("data array too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger(data$1, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data$1.length) { - logger.throwError("data array too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); - } - const result = data.hexlify(data$1.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data$1[offset] >= 0x80) { - const length = data$1[offset] - 0x80; - if (offset + 1 + length > data$1.length) { - logger.throwError("data too short", logger$1.Logger.errors.BUFFER_OVERRUN, {}); - } - const result = data.hexlify(data$1.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: data.hexlify(data$1[offset]) }; -} -function decode(data$1) { - const bytes = data.arrayify(data$1); - const decoded = _decode(bytes, 0); - if (decoded.consumed !== bytes.length) { - logger.throwArgumentError("invalid rlp data", "data", data$1); - } - return decoded.result; -} - -exports.decode = decode; -exports.encode = encode; -//# sourceMappingURL=rlp.js.map diff --git a/lib.commonjs/crypto/rlp.js.map b/lib.commonjs/crypto/rlp.js.map deleted file mode 100644 index 7cb058d00..000000000 --- a/lib.commonjs/crypto/rlp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.js","sources":["../../lib.esm/crypto/rlp.js"],"sourcesContent":["\"use strict\";\nimport { Logger } from \"../logger/logger.js\";\nimport { arrayify, hexlify, isBytesLike } from \"../utils/data.js\";\nconst logger = new Logger(\"rlp/0.0.1\");\nfunction arrayifyInteger(value) {\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value >>= 8;\n }\n return 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 _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 if (!isBytesLike(object)) {\n logger.throwArgumentError(\"RLP object must be BytesLike\", \"object\", object);\n }\n const data = Array.prototype.slice.call(arrayify(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}\nexport function encode(object) {\n return hexlify(_encode(object));\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 if (childOffset > offset + 1 + length) {\n logger.throwError(\"child data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n }\n return { consumed: 1 + length, result: result };\n}\n// returns { consumed: number, result: Object }\nfunction _decode(data, offset) {\n if (data.length === 0) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n // Array with extra length prefix\n if (data[offset] >= 0xf8) {\n const lengthLength = data[offset] - 0xf7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data short segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data long segment too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);\n }\n else if (data[offset] >= 0xc0) {\n const length = data[offset] - 0xc0;\n if (offset + 1 + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n return _decodeChildren(data, offset, offset + 1, length);\n }\n else if (data[offset] >= 0xb8) {\n const lengthLength = data[offset] - 0xb7;\n if (offset + 1 + lengthLength > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const length = unarrayifyInteger(data, offset + 1, lengthLength);\n if (offset + 1 + lengthLength + length > data.length) {\n logger.throwError(\"data array too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\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 if (offset + 1 + length > data.length) {\n logger.throwError(\"data too short\", Logger.errors.BUFFER_OVERRUN, {});\n }\n const result = hexlify(data.slice(offset + 1, offset + 1 + length));\n return { consumed: 1 + length, result: result };\n }\n return { consumed: 1, result: hexlify(data[offset]) };\n}\nexport function decode(data) {\n const bytes = arrayify(data);\n const decoded = _decode(bytes, 0);\n if (decoded.consumed !== bytes.length) {\n logger.throwArgumentError(\"invalid rlp data\", \"data\", data);\n }\n return decoded.result;\n}\n//# sourceMappingURL=rlp.js.map"],"names":["Logger","isBytesLike","data","arrayify","hexlify"],"mappings":";;;;;AAGA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,WAAW,CAAC;AACtC,SAAS,eAAe,CAAC,KAAK,EAAE;AAChC,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,OAAO,KAAK,EAAE;AAClB;AACA,QAAQ,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;AACpC,QAAQ,KAAK,KAAK,CAAC;AACnB,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;AACA,SAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACjD,IAAI,IAAI,MAAM,GAAG,CAAC;AAClB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,QAAQ,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,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AM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;AAC3E,QAAQ,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AACvD,IAAI;AACJ,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAEE,YAAO,CAACF,MAAI,CAAC,MAAM,CAAC,CAAC,EAAE;AACzD;AACO,SAAS,MAAM,CAACA,MAAI,EAAE;AAC7B,IAAI,MAAM,KAAK,GAAGC,aAAQ,CAACD,MAAI,CAAC;AAChC,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;AACrC,IAAI,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,EAAE;AAC3C,QAAQ,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,EAAEA,MAAI,CAAC;AACnE,IAAI;AACJ,IAAI,OAAO,OAAO,CAAC,MAAM;AACzB;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/scrypt.d.ts b/lib.commonjs/crypto/scrypt.d.ts deleted file mode 100644 index a00b5a43b..000000000 --- a/lib.commonjs/crypto/scrypt.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * A callback during long-running operations to update any - * UI or provide programatic access to the progress. - * - * The %%percent%% is a value between ``0`` and ``1``. - * - * @_docloc: api/crypto:Passwords - */ -export type ProgressCallback = (percent: number) => void; -declare const _scryptAsync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback) => Promise & Uint8Array>; -declare const _scryptSync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array & Uint8Array; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise; -export declare namespace scrypt { - export { _scryptAsync as _ }; - export var lock: () => void; - export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback) => Promise) => void; -} -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string; -export declare namespace scryptSync { - export { _scryptSync as _ }; - export var lock: () => void; - export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/scrypt.d.ts.map b/lib.commonjs/crypto/scrypt.d.ts.map deleted file mode 100644 index 23c428160..000000000 --- a/lib.commonjs/crypto/scrypt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;AAKzD,QAAA,MAAM,YAAY,WACT,UAAU,QACZ,UAAU,KACb,MAAM,KACN,MAAM,KACN,MAAM,SACF,MAAM,eACA,gBAAgB,mEAG7B,CAAC;AACF,QAAA,MAAM,WAAW,WACR,UAAU,QACZ,UAAU,KACb,MAAM,KACN,MAAM,KACN,MAAM,SACF,MAAM,0DAGb,CAAC;AAoBF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,MAAM,CAC3B,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,MAAM,CAAC,CAIjB;yBAZqB,MAAM;aAajB,YAAY;2BACI,IAAI;gCAIxB,CACL,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,gBAAgB,KACvB,OAAO,CAAC,SAAS,CAAC;;AASxB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CACzB,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,SAAS,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,GACX,MAAM,CAIR;yBAXe,UAAU;aAYX,WAAW;2BACK,IAAI;gCAI5B,CACL,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,KACT,SAAS"} \ No newline at end of file diff --git a/lib.commonjs/crypto/scrypt.js b/lib.commonjs/crypto/scrypt.js deleted file mode 100644 index 934021e9e..000000000 --- a/lib.commonjs/crypto/scrypt.js +++ /dev/null @@ -1,117 +0,0 @@ -'use strict'; - -var scrypt_js = require('@noble/hashes/scrypt.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -let lockedSync = false, lockedAsync = false; -const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await scrypt_js.scryptAsync(passwd, salt, { N, r, p, dkLen, onProgress }); -}; -const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return scrypt_js.scrypt(passwd, salt, { N, r, p, dkLen }); -}; -let __scryptAsync = _scryptAsync; -let __scryptSync = _scryptSync; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = data.getBytes(_passwd, "passwd"); - const salt = data.getBytes(_salt, "salt"); - return data.hexlify(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); -} -scrypt._ = _scryptAsync; -scrypt.lock = function () { - lockedAsync = true; -}; -scrypt.register = function (func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; -}; -Object.freeze(scrypt); -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = data.getBytes(_passwd, "passwd"); - const salt = data.getBytes(_salt, "salt"); - return data.hexlify(__scryptSync(passwd, salt, N, r, p, dkLen)); -} -scryptSync._ = _scryptSync; -scryptSync.lock = function () { - lockedSync = true; -}; -scryptSync.register = function (func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; -}; -Object.freeze(scryptSync); - -exports.scrypt = scrypt; -exports.scryptSync = scryptSync; -//# sourceMappingURL=scrypt.js.map diff --git a/lib.commonjs/crypto/scrypt.js.map b/lib.commonjs/crypto/scrypt.js.map deleted file mode 100644 index e8b48e979..000000000 --- a/lib.commonjs/crypto/scrypt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.js","sources":["../../lib.esm/crypto/scrypt.js"],"sourcesContent":["import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from \"@noble/hashes/scrypt.js\";\nimport { getBytes, hexlify as H } from \"../utils/index.js\";\nlet lockedSync = false, lockedAsync = false;\nconst _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) {\n return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress });\n};\nconst _scryptSync = function (passwd, salt, N, r, p, dkLen) {\n return _nobleSync(passwd, salt, { N, r, p, dkLen });\n};\nlet __scryptAsync = _scryptAsync;\nlet __scryptSync = _scryptSync;\n/**\n * The [[link-wiki-scrypt]] uses a memory and cpu hard method of\n * derivation to increase the resource cost to brute-force a password\n * for a given key.\n *\n * This means this algorithm is intentionally slow, and can be tuned to\n * become slower. As computation and memory speed improve over time,\n * increasing the difficulty maintains the cost of an attacker.\n *\n * For example, if a target time of 5 seconds is used, a legitimate user\n * which knows their password requires only 5 seconds to unlock their\n * account. A 6 character password has 68 billion possibilities, which\n * would require an attacker to invest over 10,000 years of CPU time. This\n * is of course a crude example (as password generally aren't random),\n * but demonstrates to value of imposing large costs to decryption.\n *\n * For this reason, if building a UI which involved decrypting or\n * encrypting datsa using scrypt, it is recommended to use a\n * [[ProgressCallback]] (as event short periods can seem lik an eternity\n * if the UI freezes). Including the phrase //\"decrypting\"// in the UI\n * can also help, assuring the user their waiting is for a good reason.\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scrypt(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress));\n}\nscrypt._ = _scryptAsync;\nscrypt.lock = function () {\n lockedAsync = true;\n};\nscrypt.register = function (func) {\n if (lockedAsync) {\n throw new Error(\"scrypt is locked\");\n }\n __scryptAsync = func;\n};\nObject.freeze(scrypt);\n/**\n * Provides a synchronous variant of [[scrypt]].\n *\n * This will completely lock up and freeze the UI in a browser and will\n * prevent any event loop from progressing. For this reason, it is\n * preferred to use the [async variant](scrypt).\n *\n * @_docloc: api/crypto:Passwords\n *\n * @example:\n * // The password must be converted to bytes, and it is generally\n * // best practices to ensure the string has been normalized. Many\n * // formats explicitly indicate the normalization form to use.\n * password = \"hello\"\n * passwordBytes = toUtf8Bytes(password, \"NFKC\")\n *\n * salt = id(\"some-salt\")\n *\n * // Compute the scrypt\n * scryptSync(passwordBytes, salt, 1024, 8, 1, 16)\n * //_result:\n */\nexport function scryptSync(_passwd, _salt, N, r, p, dkLen) {\n const passwd = getBytes(_passwd, \"passwd\");\n const salt = getBytes(_salt, \"salt\");\n return H(__scryptSync(passwd, salt, N, r, p, dkLen));\n}\nscryptSync._ = _scryptSync;\nscryptSync.lock = function () {\n lockedSync = true;\n};\nscryptSync.register = function (func) {\n if (lockedSync) {\n throw new Error(\"scryptSync is locked\");\n }\n __scryptSync = func;\n};\nObject.freeze(scryptSync);\n//# sourceMappingURL=scrypt.js.map"],"names":["_nobleAsync","_nobleSync","getBytes","H"],"mappings":";;;;;;;;;;;;;AAEA,IAAI,UAA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AG,YAAY;AAC1B,IAAI,WAAW,GAAG,IAAI;AACtB,CAAC;AACD,MAAM,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AAClC,IAAI,IAAI,WAAW,EAAE;AACrB,QAAQ,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC;AAC3C,IAAI;AACJ,IAAI,aAAa,GAAG,IAAI;AACxB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE;AAC3D,IAAI,MAAM,MAAM,GAAGD,aAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;AAC9C,IAAI,MAAM,IAAI,GAAGA,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,OAAOC,YAAC,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;AACxD;AACA,UAAU,CAAC,CAAC,GAAG,WAAW;AAC1B,UAAU,CAAC,IAAI,GAAG,YAAY;AAC9B,IAAI,UAAU,GAAG,IAAI;AACrB,CAAC;AACD,UAAU,CAAC,QAAQ,GAAG,UAAU,IAAI,EAAE;AACtC,IAAI,IAAI,UAAU,EAAE;AACpB,QAAQ,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC;AAC/C,IAAI;AACJ,IAAI,YAAY,GAAG,IAAI;AACvB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/sha3.d.ts b/lib.commonjs/crypto/sha3.d.ts deleted file mode 100644 index 34e1d42f6..000000000 --- a/lib.commonjs/crypto/sha3.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { BytesLike } from "../utils/data.js"; -declare const _sha256: (data: Uint8Array) => string; -declare const _sha512: (data: Uint8Array) => string; -/** - * Compute the cryptographic SHA3-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare enum SupportedAlgorithm { - sha256 = "sha256", - sha512 = "sha512" -} -export declare function ripemd160(data: BytesLike): string; -export declare function sha256(data: BytesLike): string; -export declare namespace sha256 { - export { _sha256 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export declare function legacySha256(data: BytesLike): string; -export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string; -/** - * Compute the cryptographic SHA3-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -export declare function sha512(data: BytesLike): string; -export declare namespace sha512 { - export { _sha512 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/sha3.d.ts.map b/lib.commonjs/crypto/sha3.d.ts.map deleted file mode 100644 index d71f0360e..000000000 --- a/lib.commonjs/crypto/sha3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAqB,MAAM,kBAAkB,CAAC;AAM1E,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AACvD,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AAOvD;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,kBAAkB;IAC7B,MAAM,WAAW;IACjB,MAAM,WAAW;CACjB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAkCX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI;;AAlCxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIpD;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR;AAcD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAGX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI"} \ No newline at end of file diff --git a/lib.commonjs/crypto/sha3.js b/lib.commonjs/crypto/sha3.js deleted file mode 100644 index 5dcf3b220..000000000 --- a/lib.commonjs/crypto/sha3.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -var logger$1 = require('../logger/logger.js'); -var data = require('../utils/data.js'); -require('bcrypto/lib/ed448.js'); -var buffer = require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -var crypto = require('crypto'); - -const logger = new logger$1.Logger("sha3/0.0.1"); -const _sha256 = (data$1) => data.hexlify(crypto.createHash("sha3-256").update(data$1).digest()); -const _sha512 = (data$1) => data.hexlify(crypto.createHash("sha3-512").update(data$1).digest()); -let __sha256 = _sha256; -let __sha512 = _sha512; -let locked256 = false, locked512 = false; -/** - * Compute the cryptographic SHA3-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -exports.SupportedAlgorithm = void 0; -(function (SupportedAlgorithm) { - SupportedAlgorithm["sha256"] = "sha256"; - SupportedAlgorithm["sha512"] = "sha512"; -})(exports.SupportedAlgorithm || (exports.SupportedAlgorithm = {})); -function ripemd160(data$1) { - return data.hexlify(crypto.createHash("ripemd160").update(data.getBytes(data$1)).digest()); -} -function sha256(data$1) { - return data.hexlify(__sha256(data.getBytes(data$1))); -} -function legacySha256(data$1) { - const _data = data.getBytes(data$1, "data"); - const hexlified = data.hexlify(crypto.createHash("sha256").update(_data).digest()); - return hexlified; -} -function computeHmac(algorithm, key, data$1) { - const d = buffer.Buffer.from(data.arrayify(data$1)); - const k = buffer.Buffer.from(data.arrayify(key)); - if (algorithm === exports.SupportedAlgorithm.sha256) { - return data.hexlify(crypto.createHmac("sha3-256", k).update(d).digest()); - } - else if (algorithm === exports.SupportedAlgorithm.sha512) { - return data.hexlify(crypto.createHmac("sha3-512", k).update(d).digest()); - } - logger.throwError("unsupported algorithm - " + algorithm, logger$1.Logger.errors.UNSUPPORTED_OPERATION, { - operation: "computeHmac", - algorithm: algorithm, - }); - return ""; -} -sha256._ = _sha256; -sha256.lock = function () { - locked256 = true; -}; -sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; -}; -Object.freeze(sha256); -/** - * Compute the cryptographic SHA3-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -function sha512(data$1) { - return data.hexlify(__sha512(data.getBytes(data$1))); -} -sha512._ = _sha512; -sha512.lock = function () { - locked512 = true; -}; -sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; -}; -Object.freeze(sha512); - -exports.computeHmac = computeHmac; -exports.legacySha256 = legacySha256; -exports.ripemd160 = ripemd160; -exports.sha256 = sha256; -exports.sha512 = sha512; -//# sourceMappingURL=sha3.js.map diff --git a/lib.commonjs/crypto/sha3.js.map b/lib.commonjs/crypto/sha3.js.map deleted file mode 100644 index b1ff02c47..000000000 --- a/lib.commonjs/crypto/sha3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.js","sources":["../../lib.esm/crypto/sha3.js"],"sourcesContent":["import { Logger } from \"../logger/logger.js\";\nimport { arrayify, getBytes, hexlify } from \"../utils/data.js\";\nimport { createHash, createHmac } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"sha3/0.0.1\");\nconst _sha256 = (data) => hexlify(createHash(\"sha3-256\").update(data).digest());\nconst _sha512 = (data) => hexlify(createHash(\"sha3-512\").update(data).digest());\nlet __sha256 = _sha256;\nlet __sha512 = _sha512;\nlet locked256 = false, locked512 = false;\n/**\n * Compute the cryptographic SHA3-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 var SupportedAlgorithm;\n(function (SupportedAlgorithm) {\n SupportedAlgorithm[\"sha256\"] = \"sha256\";\n SupportedAlgorithm[\"sha512\"] = \"sha512\";\n})(SupportedAlgorithm || (SupportedAlgorithm = {}));\nexport function ripemd160(data) {\n return hexlify(createHash(\"ripemd160\").update(getBytes(data)).digest());\n}\nexport function sha256(data) {\n return hexlify(__sha256(getBytes(data)));\n}\nexport function legacySha256(data) {\n const _data = getBytes(data, \"data\");\n const hexlified = hexlify(createHash(\"sha256\").update(_data).digest());\n return hexlified;\n}\nexport function computeHmac(algorithm, key, data) {\n const d = Buffer.from(arrayify(data));\n const k = Buffer.from(arrayify(key));\n if (algorithm === SupportedAlgorithm.sha256) {\n return hexlify(createHmac(\"sha3-256\", k).update(d).digest());\n }\n else if (algorithm === SupportedAlgorithm.sha512) {\n return hexlify(createHmac(\"sha3-512\", k).update(d).digest());\n }\n logger.throwError(\"unsupported algorithm - \" + algorithm, Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"computeHmac\",\n algorithm: algorithm,\n });\n return \"\";\n}\nsha256._ = _sha256;\nsha256.lock = function () {\n locked256 = true;\n};\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 SHA3-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 return hexlify(__sha512(getBytes(data)));\n}\nsha512._ = _sha512;\nsha512.lock = function () {\n locked512 = true;\n};\nsha512.register = function (func) {\n if (locked512) {\n throw new Error(\"sha512 is locked\");\n }\n __sha512 = func;\n};\nObject.freeze(sha512);\n//# sourceMappingURL=sha3.js.map"],"names":["Logger","data","hexlify","createHash","SupportedAlgorithm","getBytes","Buffer","arrayify","createHmac"],"mappings":";;;;;;;;;;AAIA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,YAAY,CAAC;AACvC,MAAM,OAAO,GAAG,CAACC,MAAI,KAAKC,YAAO,CAACC,iBAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAACF,MAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC/E,MAAM,OAAO,GAAG,CAACA,MAAI,KAAKC,YAAO,CAACC,iBAAU,CAAC,UAAU,CAAC,CAAC,MAAM,CAACF,MAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AAC/E,IAAI,QAAQ,GAAG,OAAO;AACtB,IAAI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AAI,EAAE;AAClC,IAAI,IAAI,SAAS,EAAE;AACnB,QAAQ,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC;AAC3C,IAAI;AACJ,IAAI,QAAQ,GAAG,IAAI;AACnB,CAAC;AACD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/signature.d.ts b/lib.commonjs/crypto/signature.d.ts deleted file mode 100644 index 075005c42..000000000 --- a/lib.commonjs/crypto/signature.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * A SignatureLike - * - * @_docloc: api/crypto:Signing - */ -export type SignatureLike = string; -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -export declare class Signature { - #private; - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r(): string; - set r(value: BytesLike); - /** - * The ``s`` value for a signature. - */ - get s(): string; - set s(_value: BytesLike); - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v(): 27 | 28; - set v(value: BigNumberish); - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV(): null | bigint; - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacynetworkId(): null | bigint; - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity(): 0 | 1; - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS(): string; - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized(): string; - /** - * The serialized representation. - */ - get serialized(): string; - /** - * @private - */ - constructor(guard: any, r: string, s: string, v: 27 | 28); - /** - * Returns a new identical [[Signature]]. - */ - clone(): Signature; - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON(): any; - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getnetworkId(45) - * //_result: - * - * Signature.getnetworkId(46) - * //_result: - */ - static getnetworkId(v: BigNumberish): bigint; - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getnetworkIdV(5, 27) - * //_result: - * - * Signature.getnetworkIdV(5, 28) - * //_result: - * - */ - static getnetworkIdV(networkId: BigNumberish, v: 27 | 28): bigint; - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v: BigNumberish): 27 | 28; -} -//# sourceMappingURL=signature.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/signature.d.ts.map b/lib.commonjs/crypto/signature.d.ts.map deleted file mode 100644 index cf72d7bd1..000000000 --- a/lib.commonjs/crypto/signature.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcjE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,SAAS;;IAMrB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAGrB;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAUtB;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAEf;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,YAAY,EAIxB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,IAAI,GAAG,MAAM,CAE5B;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,IAAI,GAAG,MAAM,CAMnC;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAOxB;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAMvD;IAMD;;OAEG;IACH,KAAK,IAAI,SAAS,CAMjB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CASZ;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAY3C;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM,CAEhE;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE,CAc9C;CAUD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/signature.js b/lib.commonjs/crypto/signature.js deleted file mode 100644 index 973f9dca2..000000000 --- a/lib.commonjs/crypto/signature.js +++ /dev/null @@ -1,234 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); - -// Constants -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_2 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const _guard = {}; -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -class Signature { - #r; - #s; - #v; - #networkV; - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { - return this.#r; - } - set r(value) { - errors.assertArgument(data.dataLength(value) === 32, "invalid r", "value", value); - this.#r = data.hexlify(value); - } - /** - * The ``s`` value for a signature. - */ - get s() { - return this.#s; - } - set s(_value) { - errors.assertArgument(data.dataLength(_value) === 32, "invalid s", "value", _value); - const value = data.hexlify(_value); - errors.assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); - this.#s = value; - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { - return this.#v; - } - set v(value) { - const v = maths.getNumber(value, "value"); - errors.assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { - return this.#networkV; - } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacynetworkId() { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getnetworkId(v); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return this.v === 27 ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - // The EIP-2098 compact representation - const yParityAndS = data.getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return data.hexlify(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return data.concat([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return data.concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); - } - /** - * @private - */ - constructor(guard, r, s, v) { - errors.assertPrivate(guard, _guard, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - [Symbol.for("nodejs.util.inspect.custom")]() { - return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone = new Signature(_guard, this.r, this.s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: networkV != null ? networkV.toString() : null, - r: this.r, - s: this.s, - v: this.v, - }; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getnetworkId(45) - * //_result: - * - * Signature.getnetworkId(46) - * //_result: - */ - static getnetworkId(v) { - const bv = maths.getBigInt(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if (bv == BN_27 || bv == BN_28) { - return BN_0; - } - // Bad value for an EIP-155 v - errors.assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); - return (bv - BN_35) / BN_2; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getnetworkIdV(5, 27) - * //_result: - * - * Signature.getnetworkIdV(5, 28) - * //_result: - * - */ - static getnetworkIdV(networkId, v) { - return maths.getBigInt(networkId) * BN_2 + BigInt(35 + v - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v) { - const bv = maths.getBigInt(v); - if (bv === BN_0 || bv === BN_27) { - return 27; - } - if (bv === BN_1 || bv === BN_28) { - return 28; - } - errors.assertArgument(bv >= BN_35, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return bv & BN_1 ? 27 : 28; - } -} - -exports.Signature = Signature; -//# sourceMappingURL=signature.js.map diff --git a/lib.commonjs/crypto/signature.js.map b/lib.commonjs/crypto/signature.js.map deleted file mode 100644 index fd22ccb6c..000000000 --- a/lib.commonjs/crypto/signature.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signature.js","sources":["../../lib.esm/crypto/signature.js"],"sourcesContent":["import { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate, } from \"../utils/index.js\";\n// Constants\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_2 = BigInt(2);\nconst BN_27 = BigInt(27);\nconst BN_28 = BigInt(28);\nconst BN_35 = BigInt(35);\nconst _guard = {};\n/**\n * A Signature @TODO\n *\n *\n * @_docloc: api/crypto:Signing\n */\nexport class Signature {\n #r;\n #s;\n #v;\n #networkV;\n /**\n * The ``r`` value for a signautre.\n *\n * This represents the ``x`` coordinate of a \"reference\" or\n * challenge point, from which the ``y`` can be computed.\n */\n get r() {\n return this.#r;\n }\n set r(value) {\n assertArgument(dataLength(value) === 32, \"invalid r\", \"value\", value);\n this.#r = hexlify(value);\n }\n /**\n * The ``s`` value for a signature.\n */\n get s() {\n return this.#s;\n }\n set s(_value) {\n assertArgument(dataLength(_value) === 32, \"invalid s\", \"value\", _value);\n const value = hexlify(_value);\n assertArgument(parseInt(value.substring(0, 3)) < 8, \"non-canonical s\", \"value\", value);\n this.#s = value;\n }\n /**\n * The ``v`` value for a signature.\n *\n * Since a given ``x`` value for ``r`` has two possible values for\n * its correspondin ``y``, the ``v`` indicates which of the two ``y``\n * values to use.\n *\n * It is normalized to the values ``27`` or ``28`` for legacy\n * purposes.\n */\n get v() {\n return this.#v;\n }\n set v(value) {\n const v = getNumber(value, \"value\");\n assertArgument(v === 27 || v === 28, \"invalid v\", \"v\", value);\n this.#v = v;\n }\n /**\n * The EIP-155 ``v`` for legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get networkV() {\n return this.#networkV;\n }\n /**\n * The chain ID for EIP-155 legacy transactions. For non-legacy\n * transactions, this value is ``null``.\n */\n get legacynetworkId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getnetworkId(v);\n }\n /**\n * The ``yParity`` for the signature.\n *\n * See ``v`` for more details on how this value is used.\n */\n get yParity() {\n return this.v === 27 ? 0 : 1;\n }\n /**\n * The [[link-eip-2098]] compact representation of the ``yParity``\n * and ``s`` compacted into a single ``bytes32``.\n */\n get yParityAndS() {\n // The EIP-2098 compact representation\n const yParityAndS = getBytes(this.s);\n if (this.yParity) {\n yParityAndS[0] |= 0x80;\n }\n return hexlify(yParityAndS);\n }\n /**\n * The [[link-eip-2098]] compact representation.\n */\n get compactSerialized() {\n return concat([this.r, this.yParityAndS]);\n }\n /**\n * The serialized representation.\n */\n get serialized() {\n return concat([this.r, this.s, this.yParity ? \"0x1c\" : \"0x1b\"]);\n }\n /**\n * @private\n */\n constructor(guard, r, s, v) {\n assertPrivate(guard, _guard, \"Signature\");\n this.#r = r;\n this.#s = s;\n this.#v = v;\n this.#networkV = null;\n }\n [Symbol.for(\"nodejs.util.inspect.custom\")]() {\n return `Signature { r: \"${this.r}\", s: \"${this.s}\", yParity: ${this.yParity}, networkV: ${this.networkV} }`;\n }\n /**\n * Returns a new identical [[Signature]].\n */\n clone() {\n const clone = new Signature(_guard, this.r, this.s, this.v);\n if (this.networkV) {\n clone.#networkV = this.networkV;\n }\n return clone;\n }\n /**\n * Returns a representation that is compatible with ``JSON.stringify``.\n */\n toJSON() {\n const networkV = this.networkV;\n return {\n _type: \"signature\",\n networkV: networkV != null ? networkV.toString() : null,\n r: this.r,\n s: this.s,\n v: this.v,\n };\n }\n /**\n * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions.\n *\n * @example:\n * Signature.getnetworkId(45)\n * //_result:\n *\n * Signature.getnetworkId(46)\n * //_result:\n */\n static getnetworkId(v) {\n const bv = getBigInt(v, \"v\");\n // The v is not an EIP-155 v, so it is the unspecified chain ID\n if (bv == BN_27 || bv == BN_28) {\n return BN_0;\n }\n // Bad value for an EIP-155 v\n assertArgument(bv >= BN_35, \"invalid EIP-155 v\", \"v\", v);\n return (bv - BN_35) / BN_2;\n }\n /**\n * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions.\n *\n * Legacy transactions which use [[link-eip-155]] hijack the ``v``\n * property to include the chain ID.\n *\n * @example:\n * Signature.getnetworkIdV(5, 27)\n * //_result:\n *\n * Signature.getnetworkIdV(5, 28)\n * //_result:\n *\n */\n static getnetworkIdV(networkId, v) {\n return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27);\n }\n /**\n * Compute the normalized legacy transaction ``v`` from a ``yParirty``,\n * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction.\n *\n * @example:\n * // The values 0 and 1 imply v is actually yParity\n * Signature.getNormalizedV(0)\n * //_result:\n *\n * // Legacy non-EIP-1559 transaction (i.e. 27 or 28)\n * Signature.getNormalizedV(27)\n * //_result:\n *\n * // Legacy EIP-155 transaction (i.e. >= 35)\n * Signature.getNormalizedV(46)\n * //_result:\n *\n * // Invalid values throw\n * Signature.getNormalizedV(5)\n * //_error:\n */\n static getNormalizedV(v) {\n const bv = getBigInt(v);\n if (bv === BN_0 || bv === BN_27) {\n return 27;\n }\n if (bv === BN_1 || bv === BN_28) {\n return 28;\n }\n assertArgument(bv >= BN_35, \"invalid v\", \"v\", v);\n // Otherwise, EIP-155 v means odd is 27 and even is 28\n return bv & BN_1 ? 27 : 28;\n }\n}\n//# sourceMappingURL=signature.js.map"],"names":["assertArgument","dataLength","hexlify","getNumber","getBytes","concat","assertPrivate","getBigInt"],"mappings":";;;;;;;;;;;;AACA;AACA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,MAAM,MAAM,GAAG,EAAE;AACjB;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,SAAS,CAAC;AACvB,IAAI,EAAE;AACN,IAAI,EAAE;AACN,IAAI,EAAE;AACN,IAAI,SAAS;AACb;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC,GAAG;AACZ,QAAQ,OAAO,IAAI,CAAC,EAAE;AACtB,IAAI;AACJ,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE;AACjB,QAAQA,qBAAc,CAACC,eAAU,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,CAAC;AAC7E,QAAQ,IAAI,CAAC,EAAE,GAAGC,YAAO,CAAC,KAAK,CAAC;AAChC,IAAI;AACJ;AACA;AACA;AACA,IAAI,IAAI,CAAC,GAAG;AACZ,QAAQ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AI;AAClC,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,aAAa,CAAC,SAAS,EAAE,CAAC,EAAE;AACvC,QAAQ,OAAOO,eAAS,CAAC,SAAS,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;AAChE,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,cAAc,CAAC,CAAC,EAAE;AAC7B,QAAQ,MAAM,EAAE,GAAGA,eAAS,CAAC,CAAC,CAAC;AAC/B,QAAQ,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE;AACzC,YAAY,OAAO,EAAE;AACrB,QAAQ;AACR,QAAQ,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE;AACzC,YAAY,OAAO,EAAE;AACrB,QAAQ;AACR,QAAQP,qBAAc,CAAC,EAAE,IAAI,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC;AACxD;AACA,QAAQ,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/crypto/signing-key.d.ts b/lib.commonjs/crypto/signing-key.d.ts deleted file mode 100644 index 3ce0c2ea0..000000000 --- a/lib.commonjs/crypto/signing-key.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -import type { BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "./index.js"; -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -export declare class SigningKey { - #private; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey: BytesLike); - /** - * The private key. - */ - get privateKey(): string; - /** The 57-byte Ed448 public key encoded as hex. */ - get publicKey(): string; - /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ - get compressedPublicKey(): string; - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest: BytesLike): string; - /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ - computeSharedSecret(other: BytesLike): string; - /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ - static computePublicKey(key: BytesLike, compressed?: boolean): string; - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string; - /** Adds two encoded Ed448 public points. The compression flag is ignored. */ - static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string; -} -//# sourceMappingURL=signing-key.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/crypto/signing-key.d.ts.map b/lib.commonjs/crypto/signing-key.d.ts.map deleted file mode 100644 index 1185a52a8..000000000 --- a/lib.commonjs/crypto/signing-key.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD;;;GAGG;AACH,qBAAa,UAAU;;IAGtB;;OAEG;IACH,YAAY,UAAU,EAAE,SAAS,EAYhC;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,mDAAmD;IACnD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,sEAAsE;IACtE,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAiC9B;IAED,uGAAuG;IACvG,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAgB5C;IAED,gGAAgG;IAChG,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAgBpE;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAmB3E;IAED,6EAA6E;IAC7E,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAY3E;CACD"} \ No newline at end of file diff --git a/lib.commonjs/crypto/signing-key.js b/lib.commonjs/crypto/signing-key.js deleted file mode 100644 index 8d03db6c2..000000000 --- a/lib.commonjs/crypto/signing-key.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var logger$1 = require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var ed448 = require('./ed448.js'); -var buffer = require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); - -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -const logger = new logger$1.Logger("signing-key/0.0.1"); -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -class SigningKey { - #privateKey; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - const normalized = typeof privateKey === "string" && !privateKey.startsWith("0x") - ? "0x" + privateKey - : privateKey; - errors.assertArgument(data.dataLength(normalized) === 57, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = data.hexlify(normalized); - } - /** - * The private key. - */ - get privateKey() { - return this.#privateKey; - } - /** The 57-byte Ed448 public key encoded as hex. */ - get publicKey() { - return SigningKey.computePublicKey(this.#privateKey); - } - /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ - get compressedPublicKey() { - return SigningKey.computePublicKey(this.#privateKey, true); - } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest) { - const key = data.getBytesCopy(this.#privateKey); - errors.assertArgument(data.dataLength(digest) === 32, "invalid digest length", "digest", digest); - const keyBuffer = new Uint8Array(data.arrayify(key)); - if (keyBuffer.length !== 57) { - logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - const digestBuffer = new Uint8Array(data.arrayify(digest)); - if (digestBuffer.length !== 32) { - logger.throwArgumentError("bad digest length", "digest", digest); - } - if (keyBuffer[56] > 127) { - const prefix = keyBuffer.slice(0, 57); - prefix[0] &= 0xfc; - prefix[55] |= 0x80; - prefix[56] = 0; - const scalar = prefix.slice(0, 56); - const bufferDigest = buffer.Buffer.from(digestBuffer); - const bufferPrfx = buffer.Buffer.from(prefix); - const bufferScalar = buffer.Buffer.from(scalar); - const sig = ed448.default.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); - const hexlified = data.hexlify(sig); - return data.hexConcat([hexlified, this.publicKey]); - } - const sig = ed448.default.sign(buffer.Buffer.from(digestBuffer), buffer.Buffer.from(keyBuffer)); - const hexlified = data.hexlify(sig); - return data.hexConcat([hexlified, this.publicKey]); - } - /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ - computeSharedSecret(other) { - const pub = buffer.Buffer.from(data.getBytesCopy(other)); - errors.assertArgument(pub.length === 57 && ed448.default.publicKeyVerify(pub), "invalid public key", "other", other); - const key = buffer.Buffer.from(data.getBytesCopy(this.#privateKey)); - if (key[56] > 127) { - const scalar = key.subarray(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - return data.hexlify(ed448.default.deriveWithScalar(pub, scalar)); - } - return data.hexlify(ed448.default.derive(pub, key)); - } - /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ - static computePublicKey(key, compressed) { - const bytes = buffer.Buffer.from(data.arrayify(key)); - if (bytes.length !== 57) { - logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - if (bytes[56] > 127) { - const scalar = bytes.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - const pub = ed448.default.publicKeyFromScalar(scalar); - return data.hexlify(pub); - } - const pub = ed448.default.publicKeyCreate(bytes); - return data.hexlify(pub); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest, signature) { - errors.assertArgument(data.dataLength(digest) === 32, "invalid digest length", "digest", digest); - const digestBuffer = buffer.Buffer.from(data.arrayify(digest)); - const sigBuffer = buffer.Buffer.from(data.arrayify(signature)); - if (sigBuffer.length !== 171) { - logger.throwArgumentError("invalid signature", "signature", signature); - } - const sig = sigBuffer.slice(0, 114); - const pub = sigBuffer.slice(114); - if (ed448.default.verify(digestBuffer, sig, pub)) { - return data.hexlify(pub); - } - logger.throwArgumentError("invalid signature", "signature", signature); - return ""; - } - /** Adds two encoded Ed448 public points. The compression flag is ignored. */ - static addPoints(p0, p1, compressed) { - const points = [p0, p1].map((point) => { - const bytes = buffer.Buffer.from(data.getBytesCopy(point)); - errors.assertArgument(bytes.length === 57 && ed448.default.publicKeyVerify(bytes), "invalid public key", "point", point); - return bytes; - }); - return data.hexlify(ed448.default.publicKeyCombine(points)); - } -} - -exports.SigningKey = SigningKey; -//# sourceMappingURL=signing-key.js.map diff --git a/lib.commonjs/crypto/signing-key.js.map b/lib.commonjs/crypto/signing-key.js.map deleted file mode 100644 index 58d1a543d..000000000 --- a/lib.commonjs/crypto/signing-key.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signing-key.js","sources":["../../lib.esm/crypto/signing-key.js"],"sourcesContent":["/**\n * Add details about signing here.\n *\n * @_subsection: api/crypto:Signing [about-signing]\n */\nimport { dataLength, getBytesCopy, hexlify, assertArgument, } from \"../utils/index.js\";\nimport { arrayify, hexConcat } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport { ed448 } from \"./crypto.js\";\nimport { Buffer } from \"buffer\";\nconst logger = new Logger(\"signing-key/0.0.1\");\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 const normalized = typeof privateKey === \"string\" && !privateKey.startsWith(\"0x\")\n ? \"0x\" + privateKey\n : privateKey;\n assertArgument(dataLength(normalized) === 57, \"invalid private key\", \"privateKey\", \"[REDACTED]\");\n this.#privateKey = hexlify(normalized);\n }\n /**\n * The private key.\n */\n get privateKey() {\n return this.#privateKey;\n }\n /** The 57-byte Ed448 public key encoded as hex. */\n get publicKey() {\n return SigningKey.computePublicKey(this.#privateKey);\n }\n /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */\n get compressedPublicKey() {\n return SigningKey.computePublicKey(this.#privateKey, true);\n }\n /**\n * Return the signature of the signed %%digest%%.\n */\n sign(digest) {\n const key = getBytesCopy(this.#privateKey);\n assertArgument(dataLength(digest) === 32, \"invalid digest length\", \"digest\", digest);\n const keyBuffer = new Uint8Array(arrayify(key));\n if (keyBuffer.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n const digestBuffer = new Uint8Array(arrayify(digest));\n if (digestBuffer.length !== 32) {\n logger.throwArgumentError(\"bad digest length\", \"digest\", digest);\n }\n if (keyBuffer[56] > 127) {\n const prefix = keyBuffer.slice(0, 57);\n prefix[0] &= 0xfc;\n prefix[55] |= 0x80;\n prefix[56] = 0;\n const scalar = prefix.slice(0, 56);\n const bufferDigest = Buffer.from(digestBuffer);\n const bufferPrfx = Buffer.from(prefix);\n const bufferScalar = Buffer.from(scalar);\n const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx);\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer));\n const hexlified = hexlify(sig);\n return hexConcat([hexlified, this.publicKey]);\n }\n /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */\n computeSharedSecret(other) {\n const pub = Buffer.from(getBytesCopy(other));\n assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), \"invalid public key\", \"other\", other);\n const key = Buffer.from(getBytesCopy(this.#privateKey));\n if (key[56] > 127) {\n const scalar = key.subarray(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n return hexlify(ed448.deriveWithScalar(pub, scalar));\n }\n return hexlify(ed448.derive(pub, key));\n }\n /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */\n static computePublicKey(key, compressed) {\n const bytes = Buffer.from(arrayify(key));\n if (bytes.length !== 57) {\n logger.throwArgumentError(\"invalid private key\", \"key\", \"[REDACTED]\");\n }\n if (bytes[56] > 127) {\n const scalar = bytes.slice(0, 56);\n scalar[0] &= 0xfc;\n scalar[55] |= 0x80;\n const pub = ed448.publicKeyFromScalar(scalar);\n return hexlify(pub);\n }\n const pub = ed448.publicKeyCreate(bytes);\n return hexlify(pub);\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 digestBuffer = Buffer.from(arrayify(digest));\n const sigBuffer = Buffer.from(arrayify(signature));\n if (sigBuffer.length !== 171) {\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n }\n const sig = sigBuffer.slice(0, 114);\n const pub = sigBuffer.slice(114);\n if (ed448.verify(digestBuffer, sig, pub)) {\n return hexlify(pub);\n }\n logger.throwArgumentError(\"invalid signature\", \"signature\", signature);\n return \"\";\n }\n /** Adds two encoded Ed448 public points. The compression flag is ignored. */\n static addPoints(p0, p1, compressed) {\n const points = [p0, p1].map((point) => {\n const bytes = Buffer.from(getBytesCopy(point));\n assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), \"invalid public key\", \"point\", point);\n return bytes;\n });\n return hexlify(ed448.publicKeyCombine(points));\n }\n}\n//# sourceMappingURL=signing-key.js.map"],"names":["Logger","assertArgument","dataLength","hexlify","getBytesCopy","arrayify","Buffer","ed448","hexConcat"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAMA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,mBAAmB,CAAC;AAC9C;AACA;AACA;AACA;AACO,MAAM,UAAU,CAAC;AACxB,IAAI,WAAW;AACf;AACA;AACA;AACA,IAAI,WAAW,CAAC,UAAU,EAAE;AAC5B,QAAQ,MAAM,UAAU,GAAG,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI;AACxF,cAAc,IAAI,GAAG;AACrB,cAAc,UAAU;AACxB,QAAQC,qBAAc,CAACC,eAAU,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,CAAC;AACxG,QAAQ,IAAI,CAAC,WAAW,GAAGC,YAAO,CAAC,UAAU,CAAC;AAC9C,IAAI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GG,aAAM,CAAC,IAAI,CAACF,iBAAY,CAAC,KAAK,CAAC,CAAC;AAC1D,YAAYH,qBAAc,CAAC,KAAK,CAAC,MAAM,KAAK,EAAE,IAAIM,aAAK,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,CAAC;AACrH,YAAY,OAAO,KAAK;AACxB,QAAQ,CAAC,CAAC;AACV,QAAQ,OAAOJ,YAAO,CAACI,aAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACtD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/hash/id.d.ts b/lib.commonjs/hash/id.d.ts deleted file mode 100644 index c55374a67..000000000 --- a/lib.commonjs/hash/id.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * - * @example: - * id("hello world") - * //_result: - */ -export declare function id(value: string, useKeccak?: boolean): string; -//# sourceMappingURL=id.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/hash/id.d.ts.map b/lib.commonjs/hash/id.d.ts.map deleted file mode 100644 index 140f79634..000000000 --- a/lib.commonjs/hash/id.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAK7D"} \ No newline at end of file diff --git a/lib.commonjs/hash/id.js b/lib.commonjs/hash/id.js deleted file mode 100644 index f0bfb4d35..000000000 --- a/lib.commonjs/hash/id.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -var keccak = require('../crypto/keccak.js'); -var sha3 = require('../crypto/sha3.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -var utf8 = require('../utils/utf8.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * - * @example: - * id("hello world") - * //_result: - */ -function id(value, useKeccak) { - if (useKeccak) { - return keccak.keccak256(utf8.toUtf8Bytes(value)); - } - return sha3.sha256(utf8.toUtf8Bytes(value)); -} - -exports.id = id; -//# sourceMappingURL=id.js.map diff --git a/lib.commonjs/hash/id.js.map b/lib.commonjs/hash/id.js.map deleted file mode 100644 index 93d75d68e..000000000 --- a/lib.commonjs/hash/id.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.js","sources":["../../lib.esm/hash/id.js"],"sourcesContent":["import { keccak256 } from \"../crypto/keccak.js\";\nimport { sha256 } from \"../crypto/sha3.js\";\nimport { toUtf8Bytes } from \"../utils/index.js\";\n/**\n * A simple hashing function which operates on UTF-8 strings to\n * compute an 32-byte identifier.\n *\n *\n * @example:\n * id(\"hello world\")\n * //_result:\n */\nexport function id(value, useKeccak) {\n if (useKeccak) {\n return keccak256(toUtf8Bytes(value));\n }\n return sha256(toUtf8Bytes(value));\n}\n//# sourceMappingURL=id.js.map"],"names":["keccak256","toUtf8Bytes","sha256"],"mappings":";;;;;;;;;;;;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE;AACrC,IAAI,IAAI,SAAS,EAAE;AACnB,QAAQ,OAAOA,gBAAS,CAACC,gBAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,IAAI;AACJ,IAAI,OAAOC,WAAM,CAACD,gBAAW,CAAC,KAAK,CAAC,CAAC;AACrC;;"} \ No newline at end of file diff --git a/lib.commonjs/hash/index.d.ts b/lib.commonjs/hash/index.d.ts deleted file mode 100644 index a9ba6fa23..000000000 --- a/lib.commonjs/hash/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * About hashing here... - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ -export { id } from "./id.js"; -export { hashMessage, verifyMessage } from "./message.js"; -export { solidityPacked, solidityPackedSha256 } from "./solidity.js"; -export { TypedDataEncoder, verifyTypedData } from "./typed-data.js"; -export type { TypedDataDomain, TypedDataField } from "./typed-data.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/hash/index.d.ts.map b/lib.commonjs/hash/index.d.ts.map deleted file mode 100644 index 70eb7509e..000000000 --- a/lib.commonjs/hash/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/hash/index.js b/lib.commonjs/hash/index.js deleted file mode 100644 index cfb8541ba..000000000 --- a/lib.commonjs/hash/index.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var id = require('./id.js'); -var message = require('./message.js'); -var solidity = require('./solidity.js'); -var typedData = require('./typed-data.js'); - - - -exports.id = id.id; -exports.hashMessage = message.hashMessage; -exports.verifyMessage = message.verifyMessage; -exports.solidityPacked = solidity.solidityPacked; -exports.solidityPackedSha256 = solidity.solidityPackedSha256; -exports.TypedDataEncoder = typedData.TypedDataEncoder; -exports.verifyTypedData = typedData.verifyTypedData; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/hash/index.js.map b/lib.commonjs/hash/index.js.map deleted file mode 100644 index c290a0fe8..000000000 --- a/lib.commonjs/hash/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/hash/message.d.ts b/lib.commonjs/hash/message.d.ts deleted file mode 100644 index c7776facd..000000000 --- a/lib.commonjs/hash/message.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { SignatureLike } from "../crypto/index.js"; -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -export declare function hashMessage(message: Uint8Array | string): string; -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export declare function verifyMessage(message: Uint8Array | string, sig: SignatureLike, prefix: string): string; -//# sourceMappingURL=message.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/hash/message.d.ts.map b/lib.commonjs/hash/message.d.ts.map deleted file mode 100644 index 8c0421a97..000000000 --- a/lib.commonjs/hash/message.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAWhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,GACZ,MAAM,CAGR"} \ No newline at end of file diff --git a/lib.commonjs/hash/message.js b/lib.commonjs/hash/message.js deleted file mode 100644 index b7090a9ac..000000000 --- a/lib.commonjs/hash/message.js +++ /dev/null @@ -1,79 +0,0 @@ -'use strict'; - -require('../constants/numbers.js'); -var strings = require('../constants/strings.js'); -require('../address/index.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -require('../utils/errors.js'); -require('../logger/logger.js'); -var utf8 = require('../utils/utf8.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var address = require('../transaction/address.js'); -require('../transaction/transaction.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -var sha3 = require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../crypto/signature.js'); - -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -function hashMessage(message) { - if (typeof message === "string") { - message = utf8.toUtf8Bytes(message); - } - return sha3.sha256(data.concat([ - utf8.toUtf8Bytes(strings.MessagePrefix), - utf8.toUtf8Bytes(String(message.length)), - message, - ])); -} -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -function verifyMessage(message, sig, prefix) { - const digest = hashMessage(message); - return address.recoverAddress(digest, sig, prefix); -} - -exports.hashMessage = hashMessage; -exports.verifyMessage = verifyMessage; -//# sourceMappingURL=message.js.map diff --git a/lib.commonjs/hash/message.js.map b/lib.commonjs/hash/message.js.map deleted file mode 100644 index bc8a80bbb..000000000 --- a/lib.commonjs/hash/message.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.js","sources":["../../lib.esm/hash/message.js"],"sourcesContent":["import { MessagePrefix } from \"../constants/index.js\";\nimport { recoverAddress } from \"../transaction/index.js\";\nimport { concat, toUtf8Bytes } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * Computes the [[link-eip-191]] personal-sign message digest to sign.\n *\n *\n * If %%message%% is a string, it is converted to its UTF-8 bytes\n * first. To compute the digest of a [[DataHexString]], it must be converted\n * to [bytes](getBytes).\n *\n * @example:\n * hashMessage(\"Hello World\")\n * //_result:\n *\n * // Hashes the SIX (6) string characters, i.e.\n * // [ \"0\", \"x\", \"4\", \"2\", \"4\", \"3\" ]\n * hashMessage(\"0x4243\")\n * //_result:\n *\n * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]...\n * hashMessage(getBytes(\"0x4243\"))\n * //_result:\n *\n * // ...which is equal to using data\n * hashMessage(new Uint8Array([ 0x42, 0x43 ]))\n * //_result:\n *\n */\nexport function hashMessage(message) {\n if (typeof message === \"string\") {\n message = toUtf8Bytes(message);\n }\n return sha256(concat([\n toUtf8Bytes(MessagePrefix),\n toUtf8Bytes(String(message.length)),\n message,\n ]));\n}\n/**\n * Return the address of the private key that produced\n * the signature %%sig%% during signing for %%message%%.\n */\nexport function verifyMessage(message, sig, prefix) {\n const digest = hashMessage(message);\n return recoverAddress(digest, sig, prefix);\n}\n//# sourceMappingURL=message.js.map"],"names":["toUtf8Bytes","sha256","concat","MessagePrefix","recoverAddress"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,OAAO,EAAE;AACrC,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;AACrC,QAAQ,OAAO,GAAGA,gBAAW,CAAC,OAAO,CAAC;AACtC,IAAI;AACJ,IAAI,OAAOC,WAAM,CAACC,WAAM,CAAC;AACzB,QAAQF,gBAAW,CAACG,qBAAa,CAAC;AAClC,QAAQH,gBAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3C,QAAQ,OAAO;AACf,KAAK,CAAC,CAAC;AACP;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE;AACpD,IAAI,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC;AACvC,IAAI,OAAOI,sBAAc,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC;AAC9C;;;"} \ No newline at end of file diff --git a/lib.commonjs/hash/solidity.d.ts b/lib.commonjs/hash/solidity.d.ts deleted file mode 100644 index f6e66a454..000000000 --- a/lib.commonjs/hash/solidity.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPacked(types: ReadonlyArray, values: ReadonlyArray): string; -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPackedSha256(types: ReadonlyArray, values: ReadonlyArray): string; -//# sourceMappingURL=solidity.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/hash/solidity.d.ts.map b/lib.commonjs/hash/solidity.d.ts.map deleted file mode 100644 index 8a06af8f2..000000000 --- a/lib.commonjs/hash/solidity.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAER"} \ No newline at end of file diff --git a/lib.commonjs/hash/solidity.js b/lib.commonjs/hash/solidity.js deleted file mode 100644 index 1994777d8..000000000 --- a/lib.commonjs/hash/solidity.js +++ /dev/null @@ -1,121 +0,0 @@ -'use strict'; - -var index = require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -var sha3 = require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -var utf8 = require('../utils/utf8.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -require('../crypto/signature.js'); - -const regexBytes = new RegExp("^bytes([0-9]+)$"); -const regexNumber = new RegExp("^(u?int)([0-9]*)$"); -const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); -function _pack(type, value, isArray) { - switch (type) { - case "address": - if (isArray) { - return data.getBytes(data.zeroPadValue(value, 32)); - } - return data.getBytes(index.getAddress(value)); - case "string": - return utf8.toUtf8Bytes(value); - case "bytes": - return data.getBytes(value); - case "bool": - value = !!value ? "0x01" : "0x00"; - if (isArray) { - return data.getBytes(data.zeroPadValue(value, 32)); - } - return data.getBytes(value); - } - let match = type.match(regexNumber); - if (match) { - let signed = match[1] === "int"; - let size = parseInt(match[2] || "256"); - errors.assertArgument((!match[2] || match[2] === String(size)) && - size % 8 === 0 && - size !== 0 && - size <= 256, "invalid number type", "type", type); - if (isArray) { - size = 256; - } - if (signed) { - value = maths.toTwos(value, size); - } - return data.getBytes(data.zeroPadValue(maths.toBeArray(value), size / 8)); - } - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - errors.assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - errors.assertArgument(data.dataLength(value) === size, `invalid value for ${type}`, "value", value); - if (isArray) { - return data.getBytes(data.zeroPadBytes(value, 32)); - } - return value; - } - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - errors.assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); - const result = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return data.getBytes(data.concat(result)); - } - errors.assertArgument(false, "invalid type", "type", type); -} -// @TODO: Array Enum -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPacked(types, values) { - errors.assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - const tight = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return data.hexlify(data.concat(tight)); -} -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -function solidityPackedSha256(types, values) { - return sha3.sha256(solidityPacked(types, values)); -} - -exports.solidityPacked = solidityPacked; -exports.solidityPackedSha256 = solidityPackedSha256; -//# sourceMappingURL=solidity.js.map diff --git a/lib.commonjs/hash/solidity.js.map b/lib.commonjs/hash/solidity.js.map deleted file mode 100644 index 4907fcfa1..000000000 --- a/lib.commonjs/hash/solidity.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"solidity.js","sources":["../../lib.esm/hash/solidity.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { sha256 as _sha256 } from \"../crypto/index.js\";\nimport { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument, } from \"../utils/index.js\";\nconst regexBytes = new RegExp(\"^bytes([0-9]+)$\");\nconst regexNumber = new RegExp(\"^(u?int)([0-9]*)$\");\nconst regexArray = new RegExp(\"^(.*)\\\\[([0-9]*)\\\\]$\");\nfunction _pack(type, value, isArray) {\n switch (type) {\n case \"address\":\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(getAddress(value));\n case \"string\":\n return toUtf8Bytes(value);\n case \"bytes\":\n return getBytes(value);\n case \"bool\":\n value = !!value ? \"0x01\" : \"0x00\";\n if (isArray) {\n return getBytes(zeroPadValue(value, 32));\n }\n return getBytes(value);\n }\n let match = type.match(regexNumber);\n if (match) {\n let signed = match[1] === \"int\";\n let size = parseInt(match[2] || \"256\");\n assertArgument((!match[2] || match[2] === String(size)) &&\n size % 8 === 0 &&\n size !== 0 &&\n size <= 256, \"invalid number type\", \"type\", type);\n if (isArray) {\n size = 256;\n }\n if (signed) {\n value = toTwos(value, size);\n }\n return getBytes(zeroPadValue(toBeArray(value), size / 8));\n }\n match = type.match(regexBytes);\n if (match) {\n const size = parseInt(match[1]);\n assertArgument(String(size) === match[1] && size !== 0 && size <= 32, \"invalid bytes type\", \"type\", type);\n assertArgument(dataLength(value) === size, `invalid value for ${type}`, \"value\", value);\n if (isArray) {\n return getBytes(zeroPadBytes(value, 32));\n }\n return value;\n }\n match = type.match(regexArray);\n if (match && Array.isArray(value)) {\n const baseType = match[1];\n const count = parseInt(match[2] || String(value.length));\n assertArgument(count === value.length, `invalid array length for ${type}`, \"value\", value);\n const result = [];\n value.forEach(function (value) {\n result.push(_pack(baseType, value, true));\n });\n return getBytes(concat(result));\n }\n assertArgument(false, \"invalid type\", \"type\", type);\n}\n// @TODO: Array Enum\n/**\n * Computes the [[link-solc-packed]] representation of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPacked([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPacked(types, values) {\n assertArgument(types.length === values.length, \"wrong number of values; expected ${ types.length }\", \"values\", values);\n const tight = [];\n types.forEach(function (type, index) {\n tight.push(_pack(type, values[index]));\n });\n return hexlify(concat(tight));\n}\n/**\n * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%%\n * respectively to their %%types%%.\n *\n * @example:\n * addr = \"0x8ba1f109551bd432803012645ac136ddd64dba72\"\n * solidityPackedSha256([ \"address\", \"uint\" ], [ addr, 45 ]);\n * //_result:\n */\nexport function solidityPackedSha256(types, values) {\n return _sha256(solidityPacked(types, values));\n}\n//# sourceMappingURL=solidity.js.map"],"names":["getBytes","zeroPadValue","getAddress","toUtf8Bytes","assertArgument","toTwos","toBeArray","dataLength","zeroPadBytes","concat","hexlify","_sha256"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC;AAChD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC;AACnD,MAAM,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a/lib.commonjs/hash/typed-data.d.ts b/lib.commonjs/hash/typed-data.d.ts deleted file mode 100644 index 76130b694..000000000 --- a/lib.commonjs/hash/typed-data.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -export interface TypedDataDomain { - name?: null | string; - version?: null | string; - networkId?: null | BigNumberish; - verifyingContract?: null | string; - salt?: null | BytesLike; -} -export interface TypedDataField { - name: string; - type: string; -} -export declare class TypedDataEncoder { - #private; - readonly primaryType: string; - get types(): Record>; - constructor(types: Record>); - getEncoder(type: string): (value: any) => string; - encodeType(name: string): string; - encodeData(type: string, value: any): string; - hashStruct(name: string, value: Record): string; - encode(value: Record): string; - hash(value: Record): string; - _visit(type: string, value: any, callback: (type: string, data: any) => any): any; - visit(value: Record, callback: (type: string, data: any) => any): any; - static from(types: Record>): TypedDataEncoder; - static getPrimaryType(types: Record>): string; - static hashStruct(name: string, types: Record>, value: Record): string; - static hashDomain(domain: TypedDataDomain): string; - static encode(domain: TypedDataDomain, types: Record>, value: Record): string; - static hash(domain: TypedDataDomain, types: Record>, value: Record): string; - static resolveNames(domain: TypedDataDomain, types: Record>, value: Record, resolveName: (name: string) => Promise): Promise<{ - domain: TypedDataDomain; - value: any; - }>; - static getPayload(domain: TypedDataDomain, types: Record>, value: Record): any; -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -export declare function verifyTypedData(domain: TypedDataDomain, types: Record>, value: Record, signature: string, prefix: string): string; -//# sourceMappingURL=typed-data.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/hash/typed-data.d.ts.map b/lib.commonjs/hash/typed-data.d.ts.map deleted file mode 100644 index 27a189723..000000000 --- a/lib.commonjs/hash/typed-data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed-data.d.ts","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,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GAAG,CAAC,EAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAC5C,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC,CAoDlD;IAED,MAAM,CAAC,UAAU,CAChB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,GAAG,CAiEL;CACD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,MAAM,CAMR"} \ No newline at end of file diff --git a/lib.commonjs/hash/typed-data.js b/lib.commonjs/hash/typed-data.js deleted file mode 100644 index 66b24a7e9..000000000 --- a/lib.commonjs/hash/typed-data.js +++ /dev/null @@ -1,450 +0,0 @@ -'use strict'; - -var index = require('../address/index.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -var address = require('../transaction/address.js'); -require('../transaction/transaction.js'); -var id = require('./id.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -var sha3 = require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../logger/logger.js'); -require('../crypto/signature.js'); - -const padding = new Uint8Array(32); -padding.fill(0); -const BN__1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -function hexPadRight(value) { - const bytes = data.getBytes(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return data.concat([bytes, padding.slice(padOffset)]); - } - return data.hexlify(bytes); -} -const hexTrue = maths.toBeHex(BN_1, 32); -const hexFalse = maths.toBeHex(BN_0, 32); -const domainFieldTypes = { - name: "string", - version: "string", - networkId: "uint256", - verifyingContract: "address", - salt: "bytes32", -}; -const domainFieldNames = [ - "name", - "version", - "networkId", - "verifyingContract", - "salt", -]; -function checkString(key) { - return function (value) { - errors.assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); - return value; - }; -} -const domainChecks = { - name: checkString("name"), - version: checkString("version"), - networkId: function (_value) { - const value = maths.getBigInt(_value, "domain.networkId"); - errors.assertArgument(value >= 0, "invalid chain ID", "domain.networkId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return maths.toQuantity(value); - }, - verifyingContract: function (value) { - try { - return index.getAddress(value).toLowerCase(); - } - catch (error) { } - errors.assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function (value) { - const bytes = data.getBytes(value, "domain.salt"); - errors.assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return data.hexlify(bytes); - }, -}; -function getBaseEncoder(type) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d*)$/); - if (match) { - const signed = match[1] === ""; - const width = parseInt(match[2] || "256"); - errors.assertArgument(width % 8 === 0 && - width !== 0 && - width <= 256 && - (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type); - const boundsUpper = maths.mask(BN_MAX_UINT256, signed ? width - 1 : width); - const boundsLower = signed ? (boundsUpper + BN_1) * BN__1 : BN_0; - return function (_value) { - const value = maths.getBigInt(_value, "value"); - errors.assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return maths.toBeHex(signed ? maths.toTwos(value, 256) : value, 32); - }; - } - } - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - errors.assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - return function (value) { - const bytes = data.getBytes(value); - errors.assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type) { - case "address": - return function (value) { - return data.zeroPadValue(index.getAddress(value), 32); - }; - case "bool": - return function (value) { - return !value ? hexFalse : hexTrue; - }; - case "bytes": - return function (value) { - return sha3.sha256(value); - }; - case "string": - return function (value) { - return id.id(value); - }; - } - return null; -} -function encodeType(name, fields) { - return `${name}(${fields - .map(({ name, type }) => type + " " + name) - .join(",")})`; -} -class TypedDataEncoder { - primaryType; - #types; - get types() { - return JSON.parse(this.#types); - } - #fullTypes; - #encoderCache; - constructor(types) { - this.#types = JSON.stringify(types); - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - // Link struct types to their direct child structs - const links = new Map(); - // Link structs to structs which contain them as a child - const parents = new Map(); - // Link all subtypes within a given struct - const subtypes = new Map(); - Object.keys(types).forEach((type) => { - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - for (const name in types) { - const uniqueNames = new Set(); - for (const field of types[name]) { - // Check each field has a unique name - errors.assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types); - uniqueNames.add(field.name); - // Get the base type (drop any array specifiers) - const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1] || null; - errors.assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types); - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - errors.assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types); - // Add linkage - parents.get(baseType).push(name); - links.get(name).add(baseType); - } - } - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => parents.get(n).length === 0); - errors.assertArgument(primaryTypes.length !== 0, "missing primary type", "types", types); - errors.assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes - .map((t) => JSON.stringify(t)) - .join(", ")}`, "types", types); - properties.defineProperties(this, { primaryType: primaryTypes[0] }); - // Check for circular type references - function checkCircular(type, found) { - errors.assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types); - found.add(type); - for (const child of links.get(type)) { - if (!parents.has(child)) { - continue; - } - // Recursively check children - checkCircular(child, found); - // Mark all ancestors as having this decendant - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + - st.map((t) => encodeType(t, types[t])).join("")); - } - } - getEncoder(type) { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - #getEncoder(type) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - const subtype = match[1]; - const subEncoder = this.getEncoder(subtype); - return (value) => { - errors.assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(sha3.sha256); - } - return sha3.sha256(data.concat(result)); - }; - } - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id.id(this.#fullTypes.get(type)); - return (value) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return sha3.sha256(result); - } - return result; - }); - values.unshift(encodedType); - return data.concat(values); - }; - } - errors.assertArgument(false, `unknown type: ${type}`, "type", type); - } - encodeType(name) { - const result = this.#fullTypes.get(name); - errors.assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); - return result; - } - encodeData(type, value) { - return this.getEncoder(type)(value); - } - hashStruct(name, value) { - return sha3.sha256(this.encodeData(name, value)); - } - encode(value) { - return this.encodeData(this.primaryType, value); - } - hash(value) { - return this.hashStruct(this.primaryType, value); - } - _visit(type, value, callback) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - errors.assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - return value.map((v) => this._visit(match[1], v, callback)); - } - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, {}); - } - errors.assertArgument(false, `unknown type: ${type}`, "type", type); - } - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - static from(types) { - return new TypedDataEncoder(types); - } - static getPrimaryType(types) { - return TypedDataEncoder.from(types).primaryType; - } - static hashStruct(name, types, value) { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - static hashDomain(domain) { - const domainFields = []; - for (const name in domain) { - if (domain[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - errors.assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); - domainFields.push({ name, type }); - } - domainFields.sort((a, b) => { - return (domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name)); - }); - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - static encode(domain, types, value) { - return data.concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value), - ]); - } - static hash(domain, types, value) { - return sha3.sha256(TypedDataEncoder.encode(domain, types, value)); - } - // Replaces all address types with ENS names with their looked up address - static async resolveNames(domain, types, value, resolveName) { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - // Allow passing null to ignore value - for (const key in domain) { - if (domain[key] == null) { - delete domain[key]; - } - } - // Look up all ENS names - const ensCache = {}; - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && - !data.isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - // Get a list of all the addresses - encoder.visit(value, (type, value) => { - if (type === "address" && !data.isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - // Replace all ENS names with their address - value = encoder.visit(value, (type, value) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - return { domain, value }; - } - static getPayload(domain, types, value) { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - // Derive the EIP712Domain Struct reference type - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name) => { - const value = domain[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - const encoder = TypedDataEncoder.from(types); - const typesWithDomain = Object.assign({}, types); - errors.assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - typesWithDomain.EIP712Domain = domainTypes; - // Validate the data structures and types - encoder.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type, value) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return data.hexlify(data.getBytes(value)); - } - // uint or int - if (type.match(/^u?int/)) { - return maths.getBigInt(value).toString(); - } - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - errors.assertArgument(typeof value === "string", "invalid string", "value", value); - return value; - } - errors.assertArgument(false, "unsupported type", "type", type); - }), - }; - } -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -function verifyTypedData(domain, types, value, signature, prefix) { - return address.recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix); -} - -exports.TypedDataEncoder = TypedDataEncoder; -exports.verifyTypedData = verifyTypedData; -//# sourceMappingURL=typed-data.js.map diff --git a/lib.commonjs/hash/typed-data.js.map b/lib.commonjs/hash/typed-data.js.map deleted file mode 100644 index 078a523e3..000000000 --- a/lib.commonjs/hash/typed-data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed-data.js","sources":["../../lib.esm/hash/typed-data.js"],"sourcesContent":["import { getAddress } from \"../address/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\";\nimport { sha256 } from \"../crypto/index.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\");\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 networkId: \"uint256\",\n verifyingContract: \"address\",\n salt: \"bytes32\",\n};\nconst domainFieldNames = [\n \"name\",\n \"version\",\n \"networkId\",\n \"verifyingContract\",\n \"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 networkId: function (_value) {\n const value = getBigInt(_value, \"domain.networkId\");\n assertArgument(value >= 0, \"invalid chain ID\", \"domain.networkId\", _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] || \"256\");\n assertArgument(width % 8 === 0 &&\n width !== 0 &&\n width <= 256 &&\n (match[2] == null || 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\":\n return function (value) {\n return zeroPadValue(getAddress(value), 32);\n };\n case \"bool\":\n return function (value) {\n return !value ? hexFalse : hexTrue;\n };\n case \"bytes\":\n return function (value) {\n return sha256(value);\n };\n case \"string\":\n return function (value) {\n return id(value);\n };\n }\n return null;\n}\nfunction encodeType(name, fields) {\n return `${name}(${fields\n .map(({ name, type }) => type + \" \" + name)\n .join(\",\")})`;\n}\nexport class TypedDataEncoder {\n primaryType;\n #types;\n get types() {\n return JSON.parse(this.#types);\n }\n #fullTypes;\n #encoderCache;\n constructor(types) {\n this.#types = JSON.stringify(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 Object.keys(types).forEach((type) => {\n links.set(type, new Set());\n parents.set(type, []);\n subtypes.set(type, new Set());\n });\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 = field.type.match(/^([^\\x5b]*)(\\x5b|$)/)[1] || null;\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\n .map((t) => JSON.stringify(t))\n .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]) +\n st.map((t) => encodeType(t, types[t])).join(\"\"));\n }\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n const subtype = match[1];\n const subEncoder = this.getEncoder(subtype);\n return (value) => {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n let result = value.map(subEncoder);\n if (this.#fullTypes.has(subtype)) {\n result = result.map(sha256);\n }\n return sha256(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 sha256(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 encodeType(name) {\n const result = this.#fullTypes.get(name);\n assertArgument(result, `unknown type: ${JSON.stringify(name)}`, \"name\", name);\n return result;\n }\n encodeData(type, value) {\n return this.getEncoder(type)(value);\n }\n hashStruct(name, value) {\n return sha256(this.encodeData(name, value));\n }\n encode(value) {\n return this.encodeData(this.primaryType, value);\n }\n hash(value) {\n return this.hashStruct(this.primaryType, value);\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 match = type.match(/^(.*)(\\x5b(\\d*)\\x5d)$/);\n if (match) {\n assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, \"value\", value);\n return value.map((v) => this._visit(match[1], 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 visit(value, callback) {\n return this._visit(this.primaryType, value, callback);\n }\n static from(types) {\n return new TypedDataEncoder(types);\n }\n static getPrimaryType(types) {\n return TypedDataEncoder.from(types).primaryType;\n }\n static hashStruct(name, types, value) {\n return TypedDataEncoder.from(types).hashStruct(name, value);\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 static encode(domain, types, value) {\n return concat([\n \"0x1901\",\n TypedDataEncoder.hashDomain(domain),\n TypedDataEncoder.from(types).hash(value),\n ]);\n }\n static hash(domain, types, value) {\n return sha256(TypedDataEncoder.encode(domain, types, value));\n }\n // Replaces all address types with ENS names with their looked up address\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 &&\n !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 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 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, prefix) {\n return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix);\n}\n//# sourceMappingURL=typed-data.js.map"],"names":["getBytes","concat","hexlify","toBeHex","assertArgument","getBigInt","toQuantity","getAddress","mask","toTwos","zeroPadValue","sha256","id","defineProperties","isHexString","recoverAddress"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACf,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,cAAc,GAAG,MAAM,CAAC,oEAAoE,CAAC;AACnG,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,IAAI,MAAM,KAAK,GAAGA,aAAQ,CAAC,KAAK,CAAC;AACjC,IAAI,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,EAAE;AACvC,IAAI,IAAI,SAAS,EAAE;AACnB,QAAQ,OAAOC,WAAM,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACxD,IAAI;AACJ,IAAI,OAAOC,YAAO,CAAC,KAAK,CAAC;AACzB;AACA,MAAM,OAAO,GAAGC,aAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AACjC,MAAM,QAAQ,GAAGA,aAAO,CAAC,IAAI,EAAE,EAAE,CAAC;AAClC,MAAM,gBAAgB,GAAG;AACzB,IAAI,IAAI,EAAE,QAAQ;AAClB,IAAI,OAAO,EAAE,QAAQ;AACrB,IAAI,SAAS,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AY;AAChC,YAAY,WAAW,EAAE,OAAO,CAAC,WAAW;AAC5C,YAAY,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK;AAC3D;AACA,gBAAgB,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE;AAC/C,oBAAoB,OAAOF,YAAO,CAACF,aAAQ,CAAC,KAAK,CAAC,CAAC;AACnD,gBAAgB;AAChB;AACA,gBAAgB,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;AAC1C,oBAAoB,OAAOK,eAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;AACtD,gBAAgB;AAChB,gBAAgB,QAAQ,IAAI;AAC5B,oBAAoB,KAAK,SAAS;AAClC,wBAAwB,OAAO,KAAK,CAAC,WAAW,EAAE;AAClD,oBAAoB,KAAK,MAAM;AAC/B,wBAAwB,OAAO,CAAC,CAAC,KAAK;AACtC,oBAAoB,KAAK,QAAQ;AACjC,wBAAwBD,qBAAc,CAAC,OAAO,KAAK,KAAK,QAAQ,EAAE,gBAAgB,EAAE,OAAO,EAAE,KAAK,CAAC;AACnG,wBAAwB,OAAO,KAAK;AACpC;AACA,gBAAgBA,qBAAc,CAAC,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,IAAI,CAAC;AACvE,YAAY,CAAC,CAAC;AACd,SAAS;AACT,IAAI;AACJ;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE;AACzE,IAAI,OAAOW,sBAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC;AACzF;;;"} \ No newline at end of file diff --git a/lib.commonjs/index.d.ts b/lib.commonjs/index.d.ts deleted file mode 100644 index 3fd593002..000000000 --- a/lib.commonjs/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the CoreBC library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -import { Buffer } from "buffer"; -export { Buffer }; -import * as corebc from "./corebc.js"; -export { corebc }; -export * from "./corebc.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/index.d.ts.map b/lib.commonjs/index.d.ts.map deleted file mode 100644 index 5841be6e6..000000000 --- a/lib.commonjs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/index.js b/lib.commonjs/index.js deleted file mode 100644 index afeb7ca2a..000000000 --- a/lib.commonjs/index.js +++ /dev/null @@ -1,290 +0,0 @@ -'use strict'; - -var buffer = require('buffer'); -var corebc = require('./corebc.js'); -var abiCoder = require('./abi/abi-coder.js'); -var abstractProvider = require('./providers/abstract-provider.js'); -var abstractSigner = require('./providers/abstract-signer.js'); -var providerAlchemy = require('./providers/provider-alchemy.js'); -var providerAnkr = require('./providers/provider-ankr.js'); -var contract = require('./contract/contract.js'); -var baseWallet = require('./wallet/base-wallet.js'); -var bigNumber = require('./bigNumber/bigNumber.js'); -var provider = require('./providers/provider.js'); -var providerBrowser = require('./providers/provider-browser.js'); -var index = require('./cip/index.js'); -var providerCloudflare = require('./providers/provider-cloudflare.js'); -var fragments = require('./abi/fragments.js'); -var wrappers = require('./contract/wrappers.js'); -var factory = require('./contract/factory.js'); -var strings = require('./constants/strings.js'); -var customUnits = require('./cip/custom-units.js'); -var ed448goldilock = require('./crypto/ed448goldilock.js'); -var pluginsNetwork = require('./providers/plugins-network.js'); -var _interface = require('./abi/interface.js'); -var events = require('./utils/events.js'); -var providerFallback = require('./providers/provider-fallback.js'); -var fetch = require('./utils/fetch.js'); -var fixednumber = require('./utils/fixednumber.js'); -var hdwallet = require('./wallet/hdwallet.js'); -var providerInfura = require('./providers/provider-infura.js'); -var providerIpcsocket = require('./providers/provider-ipcsocket.js'); -var index$1 = require('./ipfs/index.js'); -var providerJsonrpc = require('./providers/provider-jsonrpc.js'); -var langEn = require('./wordlists/lang-en.js'); -var numbers = require('./constants/numbers.js'); -var mnemonic = require('./wallet/mnemonic.js'); -var network = require('./providers/network.js'); -var signerNoncemanager = require('./providers/signer-noncemanager.js'); -var providerPocket = require('./providers/provider-pocket.js'); -var providerQuicknode = require('./providers/provider-quicknode.js'); -var abstractCoder = require('./abi/coders/abstract-coder.js'); -var signature = require('./crypto/signature.js'); -var signingKey = require('./crypto/signing-key.js'); -var providerSocket = require('./providers/provider-socket.js'); -var transaction = require('./transaction/transaction.js'); -var typed = require('./abi/typed.js'); -var typedData = require('./hash/typed-data.js'); -var utf8 = require('./utils/utf8.js'); -var wallet = require('./wallet/wallet.js'); -var providerWebsocket = require('./providers/provider-websocket.js'); -var wordlist = require('./wordlists/wordlist.js'); -var wordlistOwl = require('./wordlists/wordlist-owl.js'); -var wordlistOwla = require('./wordlists/wordlist-owla.js'); -var addresses = require('./constants/addresses.js'); -var hashes = require('./constants/hashes.js'); -var accesslist = require('./transaction/accesslist.js'); -var data = require('./utils/data.js'); -var errors = require('./utils/errors.js'); -var address = require('./transaction/address.js'); -var hmac = require('./crypto/hmac.js'); -var base58 = require('./utils/base58.js'); -var base64 = require('./utils/base64.js'); -var bytes32 = require('./abi/bytes32.js'); -var rlpDecode = require('./utils/rlp-decode.js'); -var jsonCrowdsale = require('./wallet/json-crowdsale.js'); -var jsonKeystore = require('./wallet/json-keystore.js'); -var properties = require('./utils/properties.js'); -var rlpEncode = require('./utils/rlp-encode.js'); -var units = require('./utils/units.js'); -var maths = require('./utils/maths.js'); -var index$2 = require('./address/index.js'); -var contractAddress = require('./address/contract-address.js'); -var defaultProvider = require('./providers/default-provider.js'); -var message = require('./hash/message.js'); -var id = require('./hash/id.js'); -var checks = require('./address/checks.js'); -var keccak = require('./crypto/keccak.js'); -var index$3 = require('./crypto/index.js'); -var pbkdf2 = require('./crypto/pbkdf2.js'); -var random = require('./crypto/random.js'); -var ripemd160 = require('./crypto/ripemd160.js'); -var scrypt = require('./crypto/scrypt.js'); -var sha3 = require('./crypto/sha3.js'); -var community = require('./providers/community.js'); -var solidity = require('./hash/solidity.js'); -var uuid = require('./utils/uuid.js'); -var _version = require('./_version.js'); -var wordlists = require('./wordlists/wordlists.js'); - - - -Object.defineProperty(exports, "Buffer", { - enumerable: true, - get: function () { return buffer.Buffer; } -}); -exports.corebc = corebc; -exports.AbiCoder = abiCoder.AbiCoder; -exports.AbstractProvider = abstractProvider.AbstractProvider; -exports.UnmanagedSubscriber = abstractProvider.UnmanagedSubscriber; -exports.AbstractSigner = abstractSigner.AbstractSigner; -exports.VoidSigner = abstractSigner.VoidSigner; -exports.AlchemyProvider = providerAlchemy.AlchemyProvider; -exports.AnkrProvider = providerAnkr.AnkrProvider; -exports.BaseContract = contract.BaseContract; -exports.Contract = contract.Contract; -exports.BaseWallet = baseWallet.BaseWallet; -exports.BigNumber = bigNumber.BigNumber; -exports.Block = provider.Block; -exports.FeeData = provider.FeeData; -exports.Log = provider.Log; -exports.TransactionReceipt = provider.TransactionReceipt; -exports.TransactionResponse = provider.TransactionResponse; -exports.copyRequest = provider.copyRequest; -exports.BrowserProvider = providerBrowser.BrowserProvider; -exports.Cip150MetadataContract = index.Cip150MetadataContract; -exports.Cip151Lifecycle = index.Cip151Lifecycle; -exports.Cip152LabCertificate = index.Cip152LabCertificate; -exports.cip150Abi = index.cip150Abi; -exports.cip151TokenExpirationKey = index.cip151TokenExpirationKey; -exports.cip151TradingStopKey = index.cip151TradingStopKey; -exports.cip152LabKey = index.cip152LabKey; -exports.CloudflareProvider = providerCloudflare.CloudflareProvider; -exports.ConstructorFragment = fragments.ConstructorFragment; -exports.ErrorFragment = fragments.ErrorFragment; -exports.EventFragment = fragments.EventFragment; -exports.FallbackFragment = fragments.FallbackFragment; -exports.Fragment = fragments.Fragment; -exports.FunctionFragment = fragments.FunctionFragment; -exports.NamedFragment = fragments.NamedFragment; -exports.ParamType = fragments.ParamType; -exports.StructFragment = fragments.StructFragment; -exports.ContractEventPayload = wrappers.ContractEventPayload; -exports.ContractTransactionReceipt = wrappers.ContractTransactionReceipt; -exports.ContractTransactionResponse = wrappers.ContractTransactionResponse; -exports.ContractUnknownEventPayload = wrappers.ContractUnknownEventPayload; -exports.EventLog = wrappers.EventLog; -exports.ContractFactory = factory.ContractFactory; -exports.CoreSymbol = strings.CoreSymbol; -exports.MessagePrefix = strings.MessagePrefix; -exports.CustomUnitBalance = customUnits.CustomUnitBalance; -exports.CustomUnitDiscovery = customUnits.CustomUnitDiscovery; -exports.CustomUnitToken = customUnits.CustomUnitToken; -exports.customUnitAbi = customUnits.customUnitAbi; -exports.Ed448Goldilock = ed448goldilock.Ed448Goldilock; -exports.EnergyCostPlugin = pluginsNetwork.EnergyCostPlugin; -exports.FeeDataNetworkPlugin = pluginsNetwork.FeeDataNetworkPlugin; -exports.NetworkPlugin = pluginsNetwork.NetworkPlugin; -exports.ErrorDescription = _interface.ErrorDescription; -exports.Indexed = _interface.Indexed; -exports.Interface = _interface.Interface; -exports.LogDescription = _interface.LogDescription; -exports.TransactionDescription = _interface.TransactionDescription; -exports.EventPayload = events.EventPayload; -exports.FallbackProvider = providerFallback.FallbackProvider; -exports.FetchCancelSignal = fetch.FetchCancelSignal; -exports.FetchRequest = fetch.FetchRequest; -exports.FetchResponse = fetch.FetchResponse; -exports.FixedNumber = fixednumber.FixedNumber; -exports.HDNodeWallet = hdwallet.HDNodeWallet; -exports.defaultPath = hdwallet.defaultPath; -exports.getAccountPath = hdwallet.getAccountPath; -exports.getIndexedAccountPath = hdwallet.getIndexedAccountPath; -exports.InfuraProvider = providerInfura.InfuraProvider; -exports.InfuraWebSocketProvider = providerInfura.InfuraWebSocketProvider; -exports.IpcSocketProvider = providerIpcsocket.IpcSocketProvider; -exports.IpfsGateway = index$1.IpfsGateway; -exports.defaultIpfsGatewayTemplate = index$1.defaultIpfsGatewayTemplate; -exports.JsonRpcApiProvider = providerJsonrpc.JsonRpcApiProvider; -exports.JsonRpcProvider = providerJsonrpc.JsonRpcProvider; -exports.JsonRpcSigner = providerJsonrpc.JsonRpcSigner; -exports.LangEn = langEn.LangEn; -exports.MaxInt256 = numbers.MaxInt256; -exports.MaxUint256 = numbers.MaxUint256; -exports.MinInt256 = numbers.MinInt256; -exports.N = numbers.N; -exports.OrePerXCB = numbers.OrePerXCB; -exports.Mnemonic = mnemonic.Mnemonic; -exports.Network = network.Network; -exports.NonceManager = signerNoncemanager.NonceManager; -exports.PocketProvider = providerPocket.PocketProvider; -exports.QuickNodeProvider = providerQuicknode.QuickNodeProvider; -exports.Result = abstractCoder.Result; -exports.checkResultErrors = abstractCoder.checkResultErrors; -exports.Signature = signature.Signature; -exports.SigningKey = signingKey.SigningKey; -exports.SocketBlockSubscriber = providerSocket.SocketBlockSubscriber; -exports.SocketEventSubscriber = providerSocket.SocketEventSubscriber; -exports.SocketPendingSubscriber = providerSocket.SocketPendingSubscriber; -exports.SocketProvider = providerSocket.SocketProvider; -exports.SocketSubscriber = providerSocket.SocketSubscriber; -exports.Transaction = transaction.Transaction; -exports.Typed = typed.Typed; -exports.TypedDataEncoder = typedData.TypedDataEncoder; -exports.verifyTypedData = typedData.verifyTypedData; -exports.Utf8ErrorFuncs = utf8.Utf8ErrorFuncs; -exports.toUtf8Bytes = utf8.toUtf8Bytes; -exports.toUtf8CodePoints = utf8.toUtf8CodePoints; -exports.toUtf8String = utf8.toUtf8String; -exports.Wallet = wallet.Wallet; -exports.WebSocketProvider = providerWebsocket.WebSocketProvider; -exports.Wordlist = wordlist.Wordlist; -exports.WordlistOwl = wordlistOwl.WordlistOwl; -exports.WordlistOwlA = wordlistOwla.WordlistOwlA; -exports.ZeroAddress = addresses.ZeroAddress; -exports.ZeroHash = hashes.ZeroHash; -exports.accessListify = accesslist.accessListify; -exports.arrayify = data.arrayify; -exports.concat = data.concat; -exports.dataLength = data.dataLength; -exports.dataSlice = data.dataSlice; -exports.getBytes = data.getBytes; -exports.getBytesCopy = data.getBytesCopy; -exports.hexConcat = data.hexConcat; -exports.hexlify = data.hexlify; -exports.isBytesLike = data.isBytesLike; -exports.isHexString = data.isHexString; -exports.stripZerosLeft = data.stripZerosLeft; -exports.zeroPadBytes = data.zeroPadBytes; -exports.zeroPadValue = data.zeroPadValue; -exports.assert = errors.assert; -exports.assertArgument = errors.assertArgument; -exports.assertArgumentCount = errors.assertArgumentCount; -exports.assertNormalize = errors.assertNormalize; -exports.assertPrivate = errors.assertPrivate; -exports.isCallException = errors.isCallException; -exports.isError = errors.isError; -exports.makeError = errors.makeError; -exports.computeAddress = address.computeAddress; -exports.publicToAddress = address.publicToAddress; -exports.recoverAddress = address.recoverAddress; -exports.computeHmac = hmac.computeHmac; -exports.decodeBase58 = base58.decodeBase58; -exports.encodeBase58 = base58.encodeBase58; -exports.decodeBase64 = base64.decodeBase64; -exports.encodeBase64 = base64.encodeBase64; -exports.decodeBytes32String = bytes32.decodeBytes32String; -exports.encodeBytes32String = bytes32.encodeBytes32String; -exports.decodeRlp = rlpDecode.decodeRlp; -exports.decryptCrowdsaleJson = jsonCrowdsale.decryptCrowdsaleJson; -exports.isCrowdsaleJson = jsonCrowdsale.isCrowdsaleJson; -exports.decryptKeystoreJson = jsonKeystore.decryptKeystoreJson; -exports.decryptKeystoreJsonSync = jsonKeystore.decryptKeystoreJsonSync; -exports.encryptKeystoreJson = jsonKeystore.encryptKeystoreJson; -exports.encryptKeystoreJsonSync = jsonKeystore.encryptKeystoreJsonSync; -exports.isKeystoreJson = jsonKeystore.isKeystoreJson; -exports.defineProperties = properties.defineProperties; -exports.resolveProperties = properties.resolveProperties; -exports.encodeRlp = rlpEncode.encodeRlp; -exports.formatUnits = units.formatUnits; -exports.formatXCB = units.formatXCB; -exports.parseUnits = units.parseUnits; -exports.parseXCB = units.parseXCB; -exports.fromTwos = maths.fromTwos; -exports.getBigInt = maths.getBigInt; -exports.getNumber = maths.getNumber; -exports.getUint = maths.getUint; -exports.mask = maths.mask; -exports.toBeArray = maths.toBeArray; -exports.toBeHex = maths.toBeHex; -exports.toBigInt = maths.toBigInt; -exports.toNumber = maths.toNumber; -exports.toQuantity = maths.toQuantity; -exports.toTwos = maths.toTwos; -exports.getAddress = index$2.getAddress; -exports.networkIdToPrefix = index$2.networkIdToPrefix; -exports.getCreate2Address = contractAddress.getCreate2Address; -exports.getCreateAddress = contractAddress.getCreateAddress; -exports.getDefaultProvider = defaultProvider.getDefaultProvider; -exports.hashMessage = message.hashMessage; -exports.verifyMessage = message.verifyMessage; -exports.id = id.id; -exports.isAddress = checks.isAddress; -exports.isAddressable = checks.isAddressable; -exports.resolveAddress = checks.resolveAddress; -exports.keccak256 = keccak.keccak256; -exports.lock = index$3.lock; -exports.pbkdf2 = pbkdf2.pbkdf2; -exports.randomBytes = random.randomBytes; -exports.ripemd160 = ripemd160.ripemd160; -exports.scrypt = scrypt.scrypt; -exports.scryptSync = scrypt.scryptSync; -exports.sha256 = sha3.sha256; -exports.sha512 = sha3.sha512; -exports.showThrottleMessage = community.showThrottleMessage; -exports.solidityPacked = solidity.solidityPacked; -exports.solidityPackedSha256 = solidity.solidityPackedSha256; -exports.uuidV4 = uuid.uuidV4; -exports.version = _version.version; -exports.wordlists = wordlists.wordlists; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/index.js.map b/lib.commonjs/index.js.map deleted file mode 100644 index 82081e26c..000000000 --- a/lib.commonjs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/ipfs/index.d.ts b/lib.commonjs/ipfs/index.d.ts deleted file mode 100644 index e1bf33eb0..000000000 --- a/lib.commonjs/ipfs/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export declare const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; -export interface IpfsGatewayOptions { - template?: string; - maxResponseBytes?: number; - timeoutMs?: number; - fetch?: typeof globalThis.fetch; -} -/** Configurable IPFS resolution and bounded JSON loading. */ -export declare class IpfsGateway { - #private; - readonly template: string; - readonly maxResponseBytes: number; - readonly timeoutMs: number; - constructor(options?: IpfsGatewayOptions); - resolve(reference: string): URL; - readJson(reference: string): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/ipfs/index.d.ts.map b/lib.commonjs/ipfs/index.d.ts.map deleted file mode 100644 index baabf24dc..000000000 --- a/lib.commonjs/ipfs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/ipfs/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CAChC;AACD,6DAA6D;AAC7D,qBAAa,WAAW;;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,YAAY,OAAO,GAAE,kBAAuB,EAgB3C;IACD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAe9B;IACK,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0ClD;CACD"} \ No newline at end of file diff --git a/lib.commonjs/ipfs/index.js b/lib.commonjs/ipfs/index.js deleted file mode 100644 index 55be65f85..000000000 --- a/lib.commonjs/ipfs/index.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - -const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; -/** Configurable IPFS resolution and bounded JSON loading. */ -class IpfsGateway { - template; - maxResponseBytes; - timeoutMs; - #fetch; - constructor(options = {}) { - this.template = options.template ?? defaultIpfsGatewayTemplate; - this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024; - this.timeoutMs = options.timeoutMs ?? 30_000; - this.#fetch = options.fetch ?? globalThis.fetch; - const templateUrl = new URL(this.template.replace("{cid}", "cid")); - if (!/^https?:$/.test(templateUrl.protocol) || - this.template.split("{cid}").length !== 2) - throw new TypeError("gateway template must be HTTP(S) and contain one {cid}"); - for (const value of [this.maxResponseBytes, this.timeoutMs]) - if (!Number.isSafeInteger(value) || value <= 0) - throw new TypeError("gateway limits must be positive safe integers"); - } - resolve(reference) { - const value = reference.trim(); - if (/^https?:\/\//i.test(value)) - return new URL(value); - const path = value.replace(/^ipfs:\/\//, "").replace(/^\/?ipfs\//, ""); - if (!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path) || - path.split("/").some((part) => part === "." || part === "..")) - throw new TypeError("invalid IPFS reference"); - return new URL(this.template.replace("{cid}", path.split("/").map(encodeURIComponent).join("/"))); - } - async readJson(reference) { - const controller = new AbortController(); - const timer = setTimeout(() => controller.abort(), this.timeoutMs); - let reader; - try { - const response = await this.#fetch(this.resolve(reference), { - headers: { accept: "application/json" }, - signal: controller.signal, - }); - if (!response.ok) { - await response.body?.cancel(); - throw new Error(`IPFS gateway returned HTTP ${response.status}`); - } - if (!response.body) - throw new Error("IPFS gateway returned an empty body"); - reader = response.body.getReader(); - const chunks = []; - let length = 0; - while (true) { - const { done, value } = await reader.read(); - if (done) - break; - length += value.length; - if (length > this.maxResponseBytes) - throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`); - chunks.push(value); - } - const bytes = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - bytes.set(chunk, offset); - offset += chunk.length; - } - return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)); - } - finally { - clearTimeout(timer); - await reader?.cancel().catch(() => { }); - reader?.releaseLock(); - } - } -} - -exports.IpfsGateway = IpfsGateway; -exports.defaultIpfsGatewayTemplate = defaultIpfsGatewayTemplate; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/ipfs/index.js.map b/lib.commonjs/ipfs/index.js.map deleted file mode 100644 index 8ea032c86..000000000 --- a/lib.commonjs/ipfs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../../lib.esm/ipfs/index.js"],"sourcesContent":["export const defaultIpfsGatewayTemplate = \"https://ipf.sk/{cid}\";\n/** Configurable IPFS resolution and bounded JSON loading. */\nexport class IpfsGateway {\n template;\n maxResponseBytes;\n timeoutMs;\n #fetch;\n constructor(options = {}) {\n this.template = options.template ?? defaultIpfsGatewayTemplate;\n this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024;\n this.timeoutMs = options.timeoutMs ?? 30_000;\n this.#fetch = options.fetch ?? globalThis.fetch;\n const templateUrl = new URL(this.template.replace(\"{cid}\", \"cid\"));\n if (!/^https?:$/.test(templateUrl.protocol) ||\n this.template.split(\"{cid}\").length !== 2)\n throw new TypeError(\"gateway template must be HTTP(S) and contain one {cid}\");\n for (const value of [this.maxResponseBytes, this.timeoutMs])\n if (!Number.isSafeInteger(value) || value <= 0)\n throw new TypeError(\"gateway limits must be positive safe integers\");\n }\n resolve(reference) {\n const value = reference.trim();\n if (/^https?:\\/\\//i.test(value))\n return new URL(value);\n const path = value.replace(/^ipfs:\\/\\//, \"\").replace(/^\\/?ipfs\\//, \"\");\n if (!/^[A-Za-z0-9]+(?:\\/[^?#]*)?$/.test(path) ||\n path.split(\"/\").some((part) => part === \".\" || part === \"..\"))\n throw new TypeError(\"invalid IPFS reference\");\n return new URL(this.template.replace(\"{cid}\", path.split(\"/\").map(encodeURIComponent).join(\"/\")));\n }\n async readJson(reference) {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n let reader;\n try {\n const response = await this.#fetch(this.resolve(reference), {\n headers: { accept: \"application/json\" },\n signal: controller.signal,\n });\n if (!response.ok) {\n await response.body?.cancel();\n throw new Error(`IPFS gateway returned HTTP ${response.status}`);\n }\n if (!response.body)\n throw new Error(\"IPFS gateway returned an empty body\");\n reader = response.body.getReader();\n const chunks = [];\n let length = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done)\n break;\n length += value.length;\n if (length > this.maxResponseBytes)\n throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`);\n chunks.push(value);\n }\n const bytes = new Uint8Array(length);\n let offset = 0;\n for (const chunk of chunks) {\n bytes.set(chunk, offset);\n offset += chunk.length;\n }\n return JSON.parse(new TextDecoder(\"utf-8\", { fatal: true }).decode(bytes));\n }\n finally {\n clearTimeout(timer);\n await reader?.cancel().catch(() => { });\n reader?.releaseLock();\n }\n }\n}\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;AAAY,MAAC,0BAA0B,GAAG;AAC1C;AACO,MAAM,WAAW,CAAC;AACzB,IAAI,QAAQ;AACZ,IAAI,gBAAgB;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;;;"} \ No newline at end of file diff --git a/lib.commonjs/logger/logger.d.ts b/lib.commonjs/logger/logger.d.ts deleted file mode 100644 index df72240a3..000000000 --- a/lib.commonjs/logger/logger.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export declare enum LogLevel { - DEBUG = "DEBUG", - INFO = "INFO", - WARNING = "WARNING", - ERROR = "ERROR", - OFF = "OFF" -} -export declare enum ErrorCode { - UNKNOWN_ERROR = "UNKNOWN_ERROR", - NOT_IMPLEMENTED = "NOT_IMPLEMENTED", - UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION", - NETWORK_ERROR = "NETWORK_ERROR", - SERVER_ERROR = "SERVER_ERROR", - TIMEOUT = "TIMEOUT", - BUFFER_OVERRUN = "BUFFER_OVERRUN", - NUMERIC_FAULT = "NUMERIC_FAULT", - MISSING_NEW = "MISSING_NEW", - INVALID_ARGUMENT = "INVALID_ARGUMENT", - MISSING_ARGUMENT = "MISSING_ARGUMENT", - UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT", - CALL_EXCEPTION = "CALL_EXCEPTION", - INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS", - NONCE_EXPIRED = "NONCE_EXPIRED", - REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED", - UNPREDICTABLE_ENERGY_LIMIT = "UNPREDICTABLE_ENERGY_LIMIT", - TRANSACTION_REPLACED = "TRANSACTION_REPLACED" -} -export declare class Logger { - readonly version: string; - static errors: typeof ErrorCode; - static levels: typeof LogLevel; - constructor(version: string); - _log(logLevel: LogLevel, args: Array): void; - debug(...args: Array): void; - info(...args: Array): void; - warn(...args: Array): void; - makeError(message: string, code?: ErrorCode, params?: any): Error; - throwError(message: string, code?: ErrorCode, params?: any): never; - throwArgumentError(message: string, name: string, value: any): never; - assert(condition: any, message: string, code?: ErrorCode, params?: any): void; - assertArgument(condition: any, message: string, name: string, value: any): void; - checkNormalize(message?: string): void; - checkSafeUint53(value: number, message?: string): void; - checkArgumentCount(count: number, expectedCount: number, message?: string): void; - checkNew(target: any, kind: any): void; - checkAbstract(target: any, kind: any): void; - static globalLogger(): Logger; - static setCensorship(censorship: boolean, permanent?: boolean): void; - static setLogLevel(logLevel: LogLevel): void; - static from(version: string): Logger; -} -//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/logger/logger.d.ts.map b/lib.commonjs/logger/logger.d.ts.map deleted file mode 100644 index 1880f0d16..000000000 --- a/lib.commonjs/logger/logger.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src.ts/logger/logger.ts"],"names":[],"mappings":"AAmDA,oBAAY,QAAQ;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,GAAG,QAAQ;CACX;AAED,oBAAY,SAAS;IAKpB,aAAa,kBAAkB;IAG/B,eAAe,oBAAoB;IAInC,qBAAqB,0BAA0B;IAI/C,aAAa,kBAAkB;IAG/B,YAAY,iBAAiB;IAG7B,OAAO,YAAY;IAMnB,cAAc,mBAAmB;IAKjC,aAAa,kBAAkB;IAO/B,WAAW,gBAAgB;IAK3B,gBAAgB,qBAAqB;IAKrC,gBAAgB,qBAAqB;IAKrC,mBAAmB,wBAAwB;IAa3C,cAAc,mBAAmB;IAIjC,kBAAkB,uBAAuB;IAIzC,aAAa,kBAAkB;IAI/B,uBAAuB,4BAA4B;IAInD,0BAA0B,+BAA+B;IAQzD,oBAAoB,yBAAyB;CAC7C;AAID,qBAAa,MAAM;IAClB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAW;IAEnC,MAAM,CAAC,MAAM,mBAAa;IAE1B,MAAM,CAAC,MAAM,kBAAY;IAEzB,YAAY,OAAO,EAAE,MAAM,EAM1B;IAED,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAS/C;IAED,KAAK,CAA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AC,YAAY,IAAI,MAAM,CAK5B;IAED,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CA0BnE;IAED,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAO3C;IAED,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/logger/logger.js b/lib.commonjs/logger/logger.js deleted file mode 100644 index 3f30402be..000000000 --- a/lib.commonjs/logger/logger.js +++ /dev/null @@ -1,329 +0,0 @@ -'use strict'; - -let _permanentCensorErrors = false; -let _censorErrors = false; -const LogLevels = { - debug: 1, - default: 2, - info: 2, - warning: 3, - error: 4, - off: 5, -}; -let _logLevel = LogLevels["default"]; -let _globalLogger = null; -function _checkNormalize() { - try { - const missing = []; - // Make sure all forms of normalization are supported - ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { - try { - if ("test".normalize(form) !== "test") { - throw new Error("bad normalize"); - } - } - catch (error) { - missing.push(form); - } - }); - if (missing.length) { - throw new Error("missing " + missing.join(", ")); - } - if (String.fromCharCode(0xe9).normalize("NFD") !== - String.fromCharCode(0x65, 0x0301)) { - throw new Error("broken implementation"); - } - } - catch (error) { - return error.message; - } - return null; -} -const _normalizeError = _checkNormalize(); -exports.LogLevel = void 0; -(function (LogLevel) { - LogLevel["DEBUG"] = "DEBUG"; - LogLevel["INFO"] = "INFO"; - LogLevel["WARNING"] = "WARNING"; - LogLevel["ERROR"] = "ERROR"; - LogLevel["OFF"] = "OFF"; -})(exports.LogLevel || (exports.LogLevel = {})); -exports.ErrorCode = void 0; -(function (ErrorCode) { - /////////////////// - // Generic Errors - // Unknown Error - ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR"; - // Not Implemented - ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED"; - // Unsupported Operation - // - operation - ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION"; - // Network Error (i.e. Core Network, such as an invalid network ID) - // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) - ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR"; - // Some sort of bad response from the server - ErrorCode["SERVER_ERROR"] = "SERVER_ERROR"; - // Timeout - ErrorCode["TIMEOUT"] = "TIMEOUT"; - /////////////////// - // Operational Errors - // Buffer Overrun - ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN"; - // Numeric Fault - // - operation: the operation being executed - // - fault: the reason this faulted - ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT"; - /////////////////// - // Argument Errors - // Missing new operator to an object - // - name: The name of the class - ErrorCode["MISSING_NEW"] = "MISSING_NEW"; - // Invalid argument (e.g. value is incompatible with type) to a function: - // - argument: The argument name that was invalid - // - value: The value of the argument - ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT"; - // Missing argument to a function: - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT"; - // Too many arguments - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT"; - /////////////////// - // Blockchain Errors - // Call exception - // - transaction: the transaction - // - address?: the contract address - // - args?: The arguments passed into the function - // - method?: The Solidity method signature - // - errorSignature?: The EIP848 error signature - // - errorArgs?: The EIP848 error parameters - // - reason: The reason (only for EIP848 "Error(string)") - ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION"; - // Insufficient funds (< value + energyLimit * energyPrice) - // - transaction: the transaction attempted - ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS"; - // Nonce has already been used - // - transaction: the transaction attempted - ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED"; - // The replacement fee for the transaction is too low - // - transaction: the transaction attempted - ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED"; - // The energy limit could not be estimated - // - transaction: the transaction passed to estimateEnergy - ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"] = "UNPREDICTABLE_ENERGY_LIMIT"; - // The transaction was replaced by one with a higher energy price - // - reason: "cancelled", "replaced" or "repriced" - // - cancelled: true if reason == "cancelled" or reason == "replaced") - // - hash: original transaction hash - // - replacement: the full TransactionsResponse for the replacement - // - receipt: the receipt of the replacement - ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; -})(exports.ErrorCode || (exports.ErrorCode = {})); -const HEX = "0123456789abcdef"; -class Logger { - version = "0.0.1"; - static errors = exports.ErrorCode; - static levels = exports.LogLevel; - constructor(version) { - Object.defineProperty(this, "version", { - enumerable: true, - value: version, - writable: false, - }); - } - _log(logLevel, args) { - const level = logLevel.toLowerCase(); - if (LogLevels[level] == null) { - this.throwArgumentError("invalid log level name", "logLevel", logLevel); - } - if (_logLevel > LogLevels[level]) { - return; - } - console.log.apply(console, args); - } - debug(...args) { - this._log(Logger.levels.DEBUG, args); - } - info(...args) { - this._log(Logger.levels.INFO, args); - } - warn(...args) { - this._log(Logger.levels.WARNING, args); - } - makeError(message, code, params) { - // Errors are being censored - if (_censorErrors) { - return this.makeError("censored error", code, {}); - } - if (!code) { - code = Logger.errors.UNKNOWN_ERROR; - } - if (!params) { - params = {}; - } - const messageDetails = []; - Object.keys(params).forEach((key) => { - const value = params[key]; - try { - if (value instanceof Uint8Array) { - let hex = ""; - for (let i = 0; i < value.length; i++) { - hex += HEX[value[i] >> 4]; - hex += HEX[value[i] & 0x0f]; - } - messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); - } - else { - messageDetails.push(key + "=" + JSON.stringify(value)); - } - } - catch (error) { - messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); - } - }); - messageDetails.push(`code=${code}`); - messageDetails.push(`version=${this.version}`); - const reason = message; - if (messageDetails.length) { - message += " (" + messageDetails.join(", ") + ")"; - } - // @TODO: Any?? - const error = new Error(message); - error.reason = reason; - error.code = code; - Object.keys(params).forEach(function (key) { - error[key] = params[key]; - }); - return error; - } - throwError(message, code, params) { - throw this.makeError(message, code, params); - } - throwArgumentError(message, name, value) { - return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { - argument: name, - value: value, - }); - } - assert(condition, message, code, params) { - if (!!condition) { - return; - } - this.throwError(message, code, params); - } - assertArgument(condition, message, name, value) { - if (!!condition) { - return; - } - this.throwArgumentError(message, name, value); - } - checkNormalize(message) { - if (_normalizeError) { - this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "String.prototype.normalize", - form: _normalizeError, - }); - } - } - checkSafeUint53(value, message) { - if (typeof value !== "number") { - return; - } - if (message == null) { - message = "value not safe"; - } - if (value < 0 || value >= 0x1fffffffffffff) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "out-of-safe-range", - value: value, - }); - } - if (value % 1) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "non-integer", - value: value, - }); - } - } - checkArgumentCount(count, expectedCount, message) { - if (message) { - message = ": " + message; - } - else { - message = ""; - } - if (count < expectedCount) { - this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - if (count > expectedCount) { - this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - } - checkNew(target, kind) { - if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - checkAbstract(target, kind) { - if (target === kind) { - this.throwError("cannot instantiate abstract class " + - JSON.stringify(kind.name) + - " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }); - } - else if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - static globalLogger() { - if (!_globalLogger) { - _globalLogger = new Logger("logger/0.0.1"); - } - return _globalLogger; - } - static setCensorship(censorship, permanent) { - if (!censorship && permanent) { - this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - if (_permanentCensorErrors) { - if (!censorship) { - return; - } - this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - _censorErrors = !!censorship; - _permanentCensorErrors = !!permanent; - } - static setLogLevel(logLevel) { - const level = LogLevels[logLevel.toLowerCase()]; - if (level == null) { - Logger.globalLogger().warn("invalid log level - " + logLevel); - return; - } - _logLevel = level; - } - static from(version) { - return new Logger(version); - } -} - -exports.Logger = Logger; -//# sourceMappingURL=logger.js.map diff --git a/lib.commonjs/logger/logger.js.map b/lib.commonjs/logger/logger.js.map deleted file mode 100644 index 29afbfaa1..000000000 --- a/lib.commonjs/logger/logger.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.js","sources":["../../lib.esm/logger/logger.js"],"sourcesContent":["\"use strict\";\nlet _permanentCensorErrors = false;\nlet _censorErrors = false;\nconst LogLevels = {\n debug: 1,\n default: 2,\n info: 2,\n warning: 3,\n error: 4,\n off: 5,\n};\nlet _logLevel = LogLevels[\"default\"];\nlet _globalLogger = null;\nfunction _checkNormalize() {\n try {\n const missing = [];\n // Make sure all forms of normalization are supported\n [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].forEach((form) => {\n try {\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad normalize\");\n }\n }\n catch (error) {\n missing.push(form);\n }\n });\n if (missing.length) {\n throw new Error(\"missing \" + missing.join(\", \"));\n }\n if (String.fromCharCode(0xe9).normalize(\"NFD\") !==\n String.fromCharCode(0x65, 0x0301)) {\n throw new Error(\"broken implementation\");\n }\n }\n catch (error) {\n return error.message;\n }\n return null;\n}\nconst _normalizeError = _checkNormalize();\nexport var LogLevel;\n(function (LogLevel) {\n LogLevel[\"DEBUG\"] = \"DEBUG\";\n LogLevel[\"INFO\"] = \"INFO\";\n LogLevel[\"WARNING\"] = \"WARNING\";\n LogLevel[\"ERROR\"] = \"ERROR\";\n LogLevel[\"OFF\"] = \"OFF\";\n})(LogLevel || (LogLevel = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ///////////////////\n // Generic Errors\n // Unknown Error\n ErrorCode[\"UNKNOWN_ERROR\"] = \"UNKNOWN_ERROR\";\n // Not Implemented\n ErrorCode[\"NOT_IMPLEMENTED\"] = \"NOT_IMPLEMENTED\";\n // Unsupported Operation\n // - operation\n ErrorCode[\"UNSUPPORTED_OPERATION\"] = \"UNSUPPORTED_OPERATION\";\n // Network Error (i.e. Core Network, such as an invalid network ID)\n // - event (\"noNetwork\" is not re-thrown in provider.ready; otherwise thrown)\n ErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n // Some sort of bad response from the server\n ErrorCode[\"SERVER_ERROR\"] = \"SERVER_ERROR\";\n // Timeout\n ErrorCode[\"TIMEOUT\"] = \"TIMEOUT\";\n ///////////////////\n // Operational Errors\n // Buffer Overrun\n ErrorCode[\"BUFFER_OVERRUN\"] = \"BUFFER_OVERRUN\";\n // Numeric Fault\n // - operation: the operation being executed\n // - fault: the reason this faulted\n ErrorCode[\"NUMERIC_FAULT\"] = \"NUMERIC_FAULT\";\n ///////////////////\n // Argument Errors\n // Missing new operator to an object\n // - name: The name of the class\n ErrorCode[\"MISSING_NEW\"] = \"MISSING_NEW\";\n // Invalid argument (e.g. value is incompatible with type) to a function:\n // - argument: The argument name that was invalid\n // - value: The value of the argument\n ErrorCode[\"INVALID_ARGUMENT\"] = \"INVALID_ARGUMENT\";\n // Missing argument to a function:\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"MISSING_ARGUMENT\"] = \"MISSING_ARGUMENT\";\n // Too many arguments\n // - count: The number of arguments received\n // - expectedCount: The number of arguments expected\n ErrorCode[\"UNEXPECTED_ARGUMENT\"] = \"UNEXPECTED_ARGUMENT\";\n ///////////////////\n // Blockchain Errors\n // Call exception\n // - transaction: the transaction\n // - address?: the contract address\n // - args?: The arguments passed into the function\n // - method?: The Solidity method signature\n // - errorSignature?: The EIP848 error signature\n // - errorArgs?: The EIP848 error parameters\n // - reason: The reason (only for EIP848 \"Error(string)\")\n ErrorCode[\"CALL_EXCEPTION\"] = \"CALL_EXCEPTION\";\n // Insufficient funds (< value + energyLimit * energyPrice)\n // - transaction: the transaction attempted\n ErrorCode[\"INSUFFICIENT_FUNDS\"] = \"INSUFFICIENT_FUNDS\";\n // Nonce has already been used\n // - transaction: the transaction attempted\n ErrorCode[\"NONCE_EXPIRED\"] = \"NONCE_EXPIRED\";\n // The replacement fee for the transaction is too low\n // - transaction: the transaction attempted\n ErrorCode[\"REPLACEMENT_UNDERPRICED\"] = \"REPLACEMENT_UNDERPRICED\";\n // The energy limit could not be estimated\n // - transaction: the transaction passed to estimateEnergy\n ErrorCode[\"UNPREDICTABLE_ENERGY_LIMIT\"] = \"UNPREDICTABLE_ENERGY_LIMIT\";\n // The transaction was replaced by one with a higher energy price\n // - reason: \"cancelled\", \"replaced\" or \"repriced\"\n // - cancelled: true if reason == \"cancelled\" or reason == \"replaced\")\n // - hash: original transaction hash\n // - replacement: the full TransactionsResponse for the replacement\n // - receipt: the receipt of the replacement\n ErrorCode[\"TRANSACTION_REPLACED\"] = \"TRANSACTION_REPLACED\";\n})(ErrorCode || (ErrorCode = {}));\nconst HEX = \"0123456789abcdef\";\nexport class Logger {\n version = \"0.0.1\";\n static errors = ErrorCode;\n static levels = LogLevel;\n constructor(version) {\n Object.defineProperty(this, \"version\", {\n enumerable: true,\n value: version,\n writable: false,\n });\n }\n _log(logLevel, args) {\n const level = logLevel.toLowerCase();\n if (LogLevels[level] == null) {\n this.throwArgumentError(\"invalid log level name\", \"logLevel\", logLevel);\n }\n if (_logLevel > LogLevels[level]) {\n return;\n }\n console.log.apply(console, args);\n }\n debug(...args) {\n this._log(Logger.levels.DEBUG, args);\n }\n info(...args) {\n this._log(Logger.levels.INFO, args);\n }\n warn(...args) {\n this._log(Logger.levels.WARNING, args);\n }\n makeError(message, code, params) {\n // Errors are being censored\n if (_censorErrors) {\n return this.makeError(\"censored error\", code, {});\n }\n if (!code) {\n code = Logger.errors.UNKNOWN_ERROR;\n }\n if (!params) {\n params = {};\n }\n const messageDetails = [];\n Object.keys(params).forEach((key) => {\n const value = params[key];\n try {\n if (value instanceof Uint8Array) {\n let hex = \"\";\n for (let i = 0; i < value.length; i++) {\n hex += HEX[value[i] >> 4];\n hex += HEX[value[i] & 0x0f];\n }\n messageDetails.push(key + \"=Uint8Array(0x\" + hex + \")\");\n }\n else {\n messageDetails.push(key + \"=\" + JSON.stringify(value));\n }\n }\n catch (error) {\n messageDetails.push(key + \"=\" + JSON.stringify(params[key].toString()));\n }\n });\n messageDetails.push(`code=${code}`);\n messageDetails.push(`version=${this.version}`);\n const reason = message;\n if (messageDetails.length) {\n message += \" (\" + messageDetails.join(\", \") + \")\";\n }\n // @TODO: Any??\n const error = new Error(message);\n error.reason = reason;\n error.code = code;\n Object.keys(params).forEach(function (key) {\n error[key] = params[key];\n });\n return error;\n }\n throwError(message, code, params) {\n throw this.makeError(message, code, params);\n }\n throwArgumentError(message, name, value) {\n return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {\n argument: name,\n value: value,\n });\n }\n assert(condition, message, code, params) {\n if (!!condition) {\n return;\n }\n this.throwError(message, code, params);\n }\n assertArgument(condition, message, name, value) {\n if (!!condition) {\n return;\n }\n this.throwArgumentError(message, name, value);\n }\n checkNormalize(message) {\n if (message == null) {\n message = \"platform missing String.prototype.normalize\";\n }\n if (_normalizeError) {\n this.throwError(\"platform missing String.prototype.normalize\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"String.prototype.normalize\",\n form: _normalizeError,\n });\n }\n }\n checkSafeUint53(value, message) {\n if (typeof value !== \"number\") {\n return;\n }\n if (message == null) {\n message = \"value not safe\";\n }\n if (value < 0 || value >= 0x1fffffffffffff) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"out-of-safe-range\",\n value: value,\n });\n }\n if (value % 1) {\n this.throwError(message, Logger.errors.NUMERIC_FAULT, {\n operation: \"checkSafeInteger\",\n fault: \"non-integer\",\n value: value,\n });\n }\n }\n checkArgumentCount(count, expectedCount, message) {\n if (message) {\n message = \": \" + message;\n }\n else {\n message = \"\";\n }\n if (count < expectedCount) {\n this.throwError(\"missing argument\" + message, Logger.errors.MISSING_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n if (count > expectedCount) {\n this.throwError(\"too many arguments\" + message, Logger.errors.UNEXPECTED_ARGUMENT, {\n count: count,\n expectedCount: expectedCount,\n });\n }\n }\n checkNew(target, kind) {\n if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n checkAbstract(target, kind) {\n if (target === kind) {\n this.throwError(\"cannot instantiate abstract class \" +\n JSON.stringify(kind.name) +\n \" directly; use a sub-class\", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: \"new\" });\n }\n else if (target === Object || target == null) {\n this.throwError(\"missing new\", Logger.errors.MISSING_NEW, {\n name: kind.name,\n });\n }\n }\n static globalLogger() {\n if (!_globalLogger) {\n _globalLogger = new Logger(\"logger/0.0.1\");\n }\n return _globalLogger;\n }\n static setCensorship(censorship, permanent) {\n if (!censorship && permanent) {\n this.globalLogger().throwError(\"cannot permanently disable censorship\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n if (_permanentCensorErrors) {\n if (!censorship) {\n return;\n }\n this.globalLogger().throwError(\"error censorship permanent\", Logger.errors.UNSUPPORTED_OPERATION, {\n operation: \"setCensorship\",\n });\n }\n _censorErrors = !!censorship;\n _permanentCensorErrors = !!permanent;\n }\n static setLogLevel(logLevel) {\n const level = LogLevels[logLevel.toLowerCase()];\n if (level == null) {\n Logger.globalLogger().warn(\"invalid log level - \" + logLevel);\n return;\n }\n _logLevel = level;\n }\n static from(version) {\n return new Logger(version);\n }\n}\n//# sourceMappingURL=logger.js.map"],"names":["LogLevel","ErrorCode"],"mappings":";;AACA,IAAI,sBAAsB,GAAG,KAAK;AAClC,IAAI,aAAa,GAAG,KAAK;AACzB,MAAM,SAAS,GAAG;AAClB,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,KAAK,EAAE,CAAC;AACZ,IAAI,GAAG,EAAE,CAAC;AACV,CAAC;AACD,IAAI,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;AACpC,IAAI,aAAa,GAAG,IAAI;AACxB,SAAS,eAAe,GAAG;AAC3B,IAAI,IAAI;AACR,QAAQ,MAAM,OAAO,GAAG,EAAE;AAC1B;AACA,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK;AACzD,YAAY,IAAI;AAChB,gBAAgB,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE;AACvD,oBAAoB,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC;AACpD,gBAAgB;AAChB,YAAY;AACZ,YAAY,OAAO,KAAK,EAAE;AAC1B,gBAAgB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;AAClC,YAAY;AACZ,QAAQ,CAAC,CAAC;AACV,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE;AAC5B,YAAY,MAAM,IAAI,KAAK,CAAC,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5D,QAAQ;AACR,QAAQ,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,CAA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SAAS,GAAG,KAAK;AACzB,IAAI;AACJ,IAAI,OAAO,IAAI,CAAC,OAAO,EAAE;AACzB,QAAQ,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/package.json b/lib.commonjs/package.json deleted file mode 100644 index 0292b9956..000000000 --- a/lib.commonjs/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"commonjs"} \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-provider.d.ts b/lib.commonjs/providers/abstract-provider.d.ts deleted file mode 100644 index 79ee0dee3..000000000 --- a/lib.commonjs/providers/abstract-provider.d.ts +++ /dev/null @@ -1,211 +0,0 @@ -/** - * About Subclassing the Provider... - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { Block, FeeData, Log, TransactionReceipt, TransactionResponse } from "./provider.js"; -import type { AddressLike } from "../address/index.js"; -import type { BigNumberish } from "../utils/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Networkish } from "./network.js"; -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -import type { BlockTag, EventFilter, Filter, FilterByBlockHash, OrphanFilter, PreparedTransactionRequest, Provider, ProviderEvent, TransactionRequest } from "./provider.js"; -export type DebugEventAbstractProvider = { - action: "sendCcipReadFetchRequest"; - request: FetchRequest; - index: number; - urls: Array; -} | { - action: "receiveCcipReadFetchResult"; - request: FetchRequest; - result: any; -} | { - action: "receiveCcipReadFetchError"; - request: FetchRequest; - result: any; -} | { - action: "sendCcipReadCall"; - transaction: { - to: string; - data: string; - }; -} | { - action: "receiveCcipReadCallResult"; - transaction: { - to: string; - data: string; - }; - result: string; -} | { - action: "receiveCcipReadCallError"; - transaction: { - to: string; - data: string; - }; - error: Error; -}; -export type Subscription = { - type: "block" | "close" | "debug" | "error" | "network" | "pending"; - tag: string; -} | { - type: "transaction"; - tag: string; - hash: string; -} | { - type: "event"; - tag: string; - filter: EventFilter; -} | { - type: "orphan"; - tag: string; - filter: OrphanFilter; -}; -export interface Subscriber { - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; - pollingInterval?: number; -} -export declare class UnmanagedSubscriber implements Subscriber { - name: string; - constructor(name: string); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -export interface AbstractProviderPlugin { - readonly name: string; - connect(provider: AbstractProvider): AbstractProviderPlugin; -} -export type PerformActionFilter = { - address?: string | Array; - topics?: Array>; - fromBlock?: BlockTag; - toBlock?: BlockTag; -} | { - address?: string | Array; - topics?: Array>; - blockHash?: string; -}; -export interface PerformActionTransaction extends PreparedTransactionRequest { - to?: string; - from?: string; -} -export type PerformActionRequest = { - method: "broadcastTransaction"; - signedTransaction: string; -} | { - method: "call"; - transaction: PerformActionTransaction; - blockTag: BlockTag; -} | { - method: "networkId"; -} | { - method: "estimateEnergy"; - transaction: PerformActionTransaction; -} | { - method: "getBalance"; - address: string; - blockTag: BlockTag; -} | { - method: "getBlock"; - blockTag: BlockTag; - includeTransactions: boolean; -} | { - method: "getBlock"; - blockHash: string; - includeTransactions: boolean; -} | { - method: "getBlockNumber"; -} | { - method: "getCode"; - address: string; - blockTag: BlockTag; -} | { - method: "getEnergyPrice"; -} | { - method: "getLogs"; - filter: PerformActionFilter; -} | { - method: "getStorage"; - address: string; - position: bigint; - blockTag: BlockTag; -} | { - method: "getTransaction"; - hash: string; -} | { - method: "getTransactionCount"; - address: string; - blockTag: BlockTag; -} | { - method: "getTransactionReceipt"; - hash: string; -} | { - method: "getTransactionResult"; - hash: string; -}; -export declare class AbstractProvider implements Provider { - #private; - constructor(_network?: "any" | Networkish); - get provider(): this; - get plugins(): Array; - attachPlugin(plugin: AbstractProviderPlugin): this; - getPlugin(name: string): null | T; - get disableCcipRead(): boolean; - set disableCcipRead(value: boolean); - ccipReadFetch(tx: PerformActionTransaction, calldata: string, urls: Array): Promise; - _wrapBlock(value: BlockParams, network: Network): Block; - _wrapLog(value: LogParams, network: Network): Log; - _wrapTransactionReceipt(value: TransactionReceiptParams, network: Network): TransactionReceipt; - _wrapTransactionResponse(tx: TransactionResponseParams, network: Network): TransactionResponse; - _detectNetwork(): Promise; - _perform(req: PerformActionRequest): Promise; - getBlockNumber(): Promise; - _getAddress(address: AddressLike): string | Promise; - _getBlockTag(blockTag?: BlockTag): string | Promise; - _getFilter(filter: Filter | FilterByBlockHash): PerformActionFilter | Promise; - _getTransactionRequest(_request: TransactionRequest): PerformActionTransaction | Promise; - getNetwork(): Promise; - getEnergyPrice(): Promise; - getFeeData(): Promise; - estimateEnergy(_tx: TransactionRequest): Promise; - call(_tx: TransactionRequest): Promise; - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - getStorage(address: AddressLike, _position: BigNumberish, blockTag?: BlockTag): Promise; - broadcastTransaction(signedTx: string): Promise; - getBlock(block: BlockTag | string, prefetchTxs?: boolean): Promise; - getTransaction(hash: string): Promise; - getTransactionReceipt(hash: string): Promise; - getTransactionResult(hash: string): Promise; - getLogs(_filter: Filter | FilterByBlockHash): Promise>; - _getProvider(networkId: number): AbstractProvider; - waitForTransaction(hash: string, _confirms?: null | number, timeout?: null | number): Promise; - waitForBlock(blockTag?: BlockTag): Promise; - _clearTimeout(timerId: number): void; - _setTimeout(_func: () => void, timeout?: number): number; - _forEachSubscriber(func: (s: Subscriber) => void): void; - _getSubscriber(sub: Subscription): Subscriber; - _recoverSubscriber(oldSub: Subscriber, newSub: Subscriber): void; - on(event: ProviderEvent, listener: Listener): Promise; - once(event: ProviderEvent, listener: Listener): Promise; - emit(event: ProviderEvent, ...args: Array): Promise; - listenerCount(event?: ProviderEvent): Promise; - listeners(event?: ProviderEvent): Promise>; - off(event: ProviderEvent, listener?: Listener): Promise; - removeAllListeners(event?: ProviderEvent): Promise; - addListener(event: ProviderEvent, listener: Listener): Promise; - removeListener(event: ProviderEvent, listener: Listener): Promise; - destroy(): void; - get paused(): boolean; - set paused(pause: boolean); - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=abstract-provider.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-provider.d.ts.map b/lib.commonjs/providers/abstract-provider.d.ts.map deleted file mode 100644 index b293b4e8f..000000000 --- a/lib.commonjs/providers/abstract-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAaN,YAAY,EAOZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAEN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACX,QAAQ,EACR,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,MAAM,eAAe,CAAC;AA2CvB,MAAM,MAAM,0BAA0B,GACnC;IACA,MAAM,EAAE,0BAA0B,CAAC;IACnC,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IAC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AE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWlE;IAEK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBtE;IAEK,aAAa,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAc1D;IAEK,SAAS,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAa/D;IAEK,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBlE;IAEK,kBAAkB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB7D;IAGK,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;IAGK,cAAc,CACnB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;IAID,OAAO,IAAI,IAAI,CAQd;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAUxB;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CA6BrC;IAED,MAAM,IAAI,IAAI,CAoBb;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-provider.js b/lib.commonjs/providers/abstract-provider.js deleted file mode 100644 index 1d5ca8c82..000000000 --- a/lib.commonjs/providers/abstract-provider.js +++ /dev/null @@ -1,1264 +0,0 @@ -'use strict'; - -var checks = require('../address/checks.js'); -require('../address/index.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var events = require('../utils/events.js'); -var fetch = require('../utils/fetch.js'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -var properties = require('../utils/properties.js'); -var utf8 = require('../utils/utf8.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../logger/logger.js'); -require('../crypto/signature.js'); -var transaction = require('../transaction/transaction.js'); -var format = require('./format.js'); -var network = require('./network.js'); -var provider = require('./provider.js'); -var subscriberPolling = require('./subscriber-polling.js'); - -/** - * About Subclassing the Provider... - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -// @TODO -// Event coalescence -// When we register an event with an async value (e.g. address is a Signer -// or ENS name), we need to add it immeidately for the Event API, but also -// need time to resolve the address. Upon resolving the address, we need to -// migrate the listener to the static event. We also need to maintain a map -// of Signer/ENS name to address so we can sync respond to listenerCount. -const MAX_CCIP_REDIRECTS = 10; -function isPromise(value) { - return value && typeof value.then === "function"; -} -function getTag(prefix, value) { - return (prefix + - ":" + - JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof v === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof v === "string") { - return v.toLowerCase(); - } - // Sort object keys - if (typeof v === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, {}); - } - return v; - })); -} -class UnmanagedSubscriber { - name; - constructor(name) { - properties.defineProperties(this, { name }); - } - start() { } - stop() { } - pause(dropWhilePaused) { } - resume() { } -} -function copy(value) { - return JSON.parse(JSON.stringify(value)); -} -function concisify(items) { - items = Array.from(new Set(items).values()); - items.sort(); - return items; -} -async function getSubscription(_event, provider) { - if (_event == null) { - throw new Error("invalid event"); - } - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - if (typeof _event === "string") { - switch (_event) { - case "block": - case "pending": - case "debug": - case "error": - case "network": { - return { type: _event, tag: _event }; - } - } - } - if (data.isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - if (_event.orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { - type: "orphan", - tag: getTag("orphan", event), - filter: copy(event), - }; - } - if (_event.address || _event.topics) { - const event = _event; - const filter = { - topics: (event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }), - }; - if (event.address) { - const addresses = []; - const promises = []; - const addAddress = (addr) => { - if (data.isHexString(addr)) { - addresses.push(addr); - } - else { - promises.push((async () => { - addresses.push(await checks.resolveAddress(addr)); - })()); - } - }; - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } - else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - return { filter, tag: getTag("event", filter), type: "event" }; - } - errors.assertArgument(false, "unknown ProviderEvent", "event", _event); -} -function getTime() { - return new Date().getTime(); -} -class AbstractProvider { - #subs; - #plugins; - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState; - #networkPromise; - #anyNetwork; - #performCache; - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber; - #nextTimer; - #timers; - #disableCcipRead; - // @TODO: This should be a () => Promise so network can be - // done when needed; or rely entirely on _detectNetwork? - constructor(_network) { - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } - else if (_network) { - const network$1 = network.Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network$1); - setTimeout(() => { - this.emit("network", network$1, null); - }, 0); - } - else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - this.#lastBlockNumber = -1; - this.#performCache = new Map(); - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - this.#nextTimer = 1; - this.#timers = new Map(); - this.#disableCcipRead = false; - } - get provider() { - return this; - } - get plugins() { - return Array.from(this.#plugins.values()); - } - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - getPlugin(name) { - return this.#plugins.get(name) || null; - } - get disableCcipRead() { - return this.#disableCcipRead; - } - set disableCcipRead(value) { - this.#disableCcipRead = !!value; - } - // Shares multiple identical requests made during the same 250ms - async #perform(req) { - // Create a tag - const tag = getTag(req.method, req); - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, 250); - } - return await perform; - } - async ccipReadFetch(tx, calldata, urls) { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - const errorMessages = []; - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new fetch.FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - this.emit("debug", { - action: "sendCcipReadFetchRequest", - request, - index: i, - urls, - }); - let errorMessage = "unknown error"; - const resp = await request.send(); - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { - action: "receiveCcipReadFetchResult", - request, - result, - }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { - action: "receiveCcipReadFetchError", - request, - result, - }); - } - catch (error) { } - // 4xx indicates the result is not present; stop - errors.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 }, - }); - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - errors.assert(false, `error encountered during CCIP fetch: ${errorMessages - .map((m) => JSON.stringify(m)) - .join(", ")}`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, - info: { urls, errorMessages }, - }); - } - _wrapBlock(value, network) { - return new provider.Block(format.formatBlock(value), this); - } - _wrapLog(value, network) { - return new provider.Log(format.formatLog(value), this); - } - _wrapTransactionReceipt(value, network) { - return new provider.TransactionReceipt(format.formatTransactionReceipt(value), this); - } - _wrapTransactionResponse(tx, network) { - return new provider.TransactionResponse(format.formatTransactionResponse(tx), this); - } - _detectNetwork() { - errors.assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork", - }); - } - // Sub-classes should override this and handle PerformActionRequest requests, calling - // the super for any unhandled actions. - async _perform(req) { - errors.assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req, - }); - } - // State - async getBlockNumber() { - const blockNumber = maths.getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - _getAddress(address) { - return checks.resolveAddress(address); - } - _getBlockTag(blockTag) { - if (blockTag == null) { - return "latest"; - } - switch (blockTag) { - case "earliest": - return "0x0"; - case "latest": - case "pending": - case "safe": - case "finalized": - return blockTag; - } - if (data.isHexString(blockTag)) { - if (data.isHexString(blockTag, 32)) { - return blockTag; - } - return maths.toQuantity(blockTag); - } - if (typeof blockTag === "bigint") { - blockTag = maths.getNumber(blockTag, "blockTag"); - } - if (typeof blockTag === "number") { - if (blockTag >= 0) { - return maths.toQuantity(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return maths.toQuantity(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => maths.toQuantity(b + blockTag)); - } - errors.assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - _getFilter(filter) { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - const blockHash = "blockHash" in filter ? filter.blockHash : undefined; - const resolve = (_address, fromBlock, toBlock) => { - let address = undefined; - switch (_address.length) { - case 0: - break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - return filter; - }; - // Addresses could be async (ENS names or Addressables) - let address = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } - else { - address.push(this._getAddress(filter.address)); - } - } - let fromBlock = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - let toBlock = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - if (address.filter((a) => typeof a !== "string").length || - (fromBlock != null && typeof fromBlock !== "string") || - (toBlock != null && typeof toBlock !== "string")) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - return resolve(address, fromBlock, toBlock); - } - _getTransactionRequest(_request) { - const request = provider.copyRequest(_request); - const promises = []; - ["to", "from"].forEach((key) => { - if (request[key] == null) { - return; - } - const addr = checks.resolveAddress(request[key]); - if (isPromise(addr)) { - promises.push((async function () { - request[key] = await addr; - })()); - } - else { - request[key] = addr; - } - }); - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise(blockTag)) { - promises.push((async function () { - request.blockTag = await blockTag; - })()); - } - else { - request.blockTag = blockTag; - } - } - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - return request; - } - async getNetwork() { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = this._detectNetwork().then((network) => { - this.emit("network", network, null); - return network; - }, (error) => { - // Reset the networkPromise on failure, so we will try again - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - }); - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - const networkPromise = this.#networkPromise; - const [expected, actual] = await Promise.all([ - networkPromise, // Possibly an explicit Network - this._detectNetwork(), // The actual connected network - ]); - if (expected.networkId !== actual.networkId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } - else { - // Otherwise, we do not allow changes to the underlying network - errors.assert(false, `network changed: ${expected.networkId} => ${actual.networkId} `, "NETWORK_ERROR", { - event: "changed", - }); - } - } - return expected.clone(); - } - async getEnergyPrice() { - const { energyPrice } = await properties.resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return maths.getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new provider.FeeData(energyPrice); - } - async getFeeData() { - const { energyPrice } = await properties.resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return maths.getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new provider.FeeData(energyPrice); - } - async estimateEnergy(_tx) { - let tx = this._getTransactionRequest(_tx); - if (isPromise(tx)) { - tx = await tx; - } - return maths.getBigInt(await this.#perform({ - method: "estimateEnergy", - transaction: tx, - }), "%response"); - } - async #call(tx, blockTag, attempt) { - errors.assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }), - }); - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = provider.copyRequest(tx); - try { - return data.hexlify(await this._perform({ method: "call", transaction, blockTag })); - } - catch (error) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && - errors.isCallException(error) && - error.data && - attempt >= 0 && - blockTag === "latest" && - transaction.to != null && - data.dataSlice(error.data, 0, 4) === "0x556f1830") { - const data$1 = error.data; - const txSender = await checks.resolveAddress(transaction.to); - // Parse the CCIP Read Arguments - let ccipArgs; - try { - ccipArgs = parseOffchainLookup(data.dataSlice(error.data, 4)); - } - catch (error) { - errors.assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", - transaction, - info: { data: data$1 }, - }); - } - // Check the sender of the OffchainLookup matches the transaction - errors.assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data: data$1, - reason: "OffchainLookup", - transaction: transaction, // @TODO: populate data? - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs, - }, - }); - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - errors.assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", - transaction, - info: { data: error.data, errorArgs: ccipArgs.errorArgs }, - }); - const tx = { - to: txSender, - data: data.concat([ - ccipArgs.selector, - encodeBytes([ccipResult, ccipArgs.extraData]), - ]), - }; - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { - action: "receiveCcipReadCallResult", - transaction: Object.assign({}, tx), - result, - }); - return result; - } - catch (error) { - this.emit("debug", { - action: "receiveCcipReadCallError", - transaction: Object.assign({}, tx), - error, - }); - throw error; - } - } - throw error; - } - } - async #checkNetwork(promise) { - const { value } = await properties.resolveProperties({ - network: this.getNetwork(), - value: promise, - }); - return value; - } - async call(_tx) { - const { tx, blockTag } = await properties.resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag), - }); - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); - } - // Account - async #getAccountValue(request, _address, _blockTag) { - let address = this._getAddress(_address); - let blockTag = this._getBlockTag(_blockTag); - if (typeof address !== "string" || typeof blockTag !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - async getBalance(address, blockTag) { - return maths.getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - async getTransactionCount(address, blockTag) { - return maths.getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - async getCode(address, blockTag) { - return data.hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - async getStorage(address, _position, blockTag) { - const position = maths.getBigInt(_position, "position"); - return data.hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - // Write - async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await properties.resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx, - }), - network: this.getNetwork(), - }); - const tx = transaction.Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - async #getBlock(block, includeTransactions) { - // @TODO: Add CustomBlockPlugin check - if (data.isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", - blockHash: block, - includeTransactions, - }); - } - let blockTag = this._getBlockTag(block); - if (typeof blockTag !== "string") { - blockTag = await blockTag; - } - return await this.#perform({ - method: "getBlock", - blockTag, - includeTransactions, - }); - } - // Queries - async getBlock(block, prefetchTxs) { - const { network, params } = await properties.resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs), - }); - if (params == null) { - return null; - } - return this._wrapBlock(params, network); - } - async getTransaction(hash) { - const { network, params } = await properties.resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }), - }); - if (params == null) { - return null; - } - return this._wrapTransactionResponse(params, network); - } - async getTransactionReceipt(hash) { - const { network, params } = await properties.resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }), - }); - if (params == null) { - return null; - } - // Some backends did not backfill the effectiveEnergyPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.energyPrice == null && params.effectiveEnergyPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error("report this; could not find tx or effectiveEnergyPrice"); - } - params.effectiveEnergyPrice = tx.energyPrice; - } - return this._wrapTransactionReceipt(params, network); - } - async getTransactionResult(hash) { - const { result } = await properties.resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }), - }); - if (result == null) { - return null; - } - return data.hexlify(result); - } - // Bloom-filter Queries - async getLogs(_filter) { - let filter = this._getFilter(_filter); - if (isPromise(filter)) { - filter = await filter; - } - const { network, params } = await properties.resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getLogs", filter }), - }); - return params.map((p) => this._wrapLog(p, network)); - } - // ENS - _getProvider(networkId) { - errors.assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()", - }); - } - async waitForTransaction(hash, _confirms, timeout) { - const confirms = _confirms != null ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - return new Promise(async (resolve, reject) => { - let timer = null; - const listener = async (blockNumber) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } - catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }; - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject(errors.makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - listener(await this.getBlockNumber()); - }); - } - async waitForBlock(blockTag) { - errors.assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock", - }); - } - _clearTimeout(timerId) { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - _setTimeout(_func, timeout) { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } - else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime() }); - } - return timerId; - } - _forEachSubscriber(func) { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - // Event API; sub-classes should override this; any supported - // event filter will have been munged into an EventFilter - _getSubscriber(sub) { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": - return new subscriberPolling.PollingBlockSubscriber(this); - case "event": - return new subscriberPolling.PollingEventSubscriber(this, sub.filter); - case "transaction": - return new subscriberPolling.PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new subscriberPolling.PollingOrphanSubscriber(this, sub.filter); - } - throw new Error(`unsupported event: ${sub.type}`); - } - _recoverSubscriber(oldSub, newSub) { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - async #hasSub(event, emitArgs) { - let sub = await getSubscription(event); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && - emitArgs && - emitArgs.length > 0 && - emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }); - } - return this.#subs.get(sub.tag) || null; - } - async #getSub(event) { - const subscription = await getSubscription(event); - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { - subscriber, - tag, - addressableMap, - nameMap, - started: false, - listeners: [], - }; - this.#subs.set(tag, sub); - } - return sub; - } - async on(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async once(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async emit(event, ...args) { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new events.EventPayload(this, once ? null : listener, event); - try { - listener.call(this, ...args, payload); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return count > 0; - } - async listenerCount(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return this.off(event, listener); - } - // Sub-classes should override this to shutdown any sockets, etc. - // but MUST call this super.shutdown. - destroy() { - // Stop all listeners - this.removeAllListeners(); - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - } - get paused() { - return this.#pausedState != null; - } - set paused(pause) { - if (!!pause === this.paused) { - return; - } - if (this.paused) { - this.resume(); - } - else { - this.pause(false); - } - } - pause(dropWhilePaused) { - this.#lastBlockNumber = -1; - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - errors.assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause", - }); - } - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - // Remaining time needed for when we become unpaused - timer.time = getTime() - timer.time; - } - } - resume() { - if (this.#pausedState == null) { - return; - } - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime(); - // Start the timer - setTimeout(timer.func, timeout); - } - } -} -function _parseString(result, start) { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return utf8.toUtf8String(bytes); - } - } - catch (error) { } - return null; -} -function _parseBytes(result, start) { - if (result === "0x") { - return null; - } - try { - const offset = maths.getNumber(data.dataSlice(result, start, start + 32)); - const length = maths.getNumber(data.dataSlice(result, offset, offset + 32)); - return data.dataSlice(result, offset + 32, offset + 32 + length); - } - catch (error) { } - return null; -} -function numPad(value) { - const result = maths.toBeArray(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; -} -function bytesPad(value) { - if (value.length % 32 === 0) { - return value; - } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; -} -const empty = new Uint8Array([]); -// ABI Encodes a series of (bytes, bytes, ...) -function encodeBytes(datas) { - const result = []; - let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - for (let i = 0; i < datas.length; i++) { - const data$1 = data.getBytes(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data$1.length)); - result.push(bytesPad(data$1)); - byteCount += 32 + Math.ceil(data$1.length / 32) * 32; - } - return data.concat(result); -} -const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; -function parseOffchainLookup(data$1) { - const result = { - sender: "", - urls: [], - calldata: "", - selector: "", - extraData: "", - errorArgs: [], - }; - errors.assert(data.dataLength(data$1) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data", - }); - const sender = data.dataSlice(data$1, 0, 32); - errors.assert(data.dataSlice(sender, 0, 12) === data.dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender", - }); - result.sender = data.dataSlice(sender, 12); - // Read the URLs from the response - try { - const urls = []; - const urlsOffset = maths.getNumber(data.dataSlice(data$1, 32, 64)); - const urlsLength = maths.getNumber(data.dataSlice(data$1, urlsOffset, urlsOffset + 32)); - const urlsData = data.dataSlice(data$1, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } - catch (error) { - errors.assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls", - }); - } - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data$1, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } - catch (error) { - errors.assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata", - }); - } - // Get the callbackSelector (bytes4) - errors.assert(data.dataSlice(data$1, 100, 128) === data.dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector", - }); - result.selector = data.dataSlice(data$1, 96, 100); - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data$1, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } - catch (error) { - errors.assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData", - }); - } - result.errorArgs = "sender,urls,calldata,selector,extraData" - .split(/,/) - .map((k) => result[k]); - return result; -} - -exports.AbstractProvider = AbstractProvider; -exports.UnmanagedSubscriber = UnmanagedSubscriber; -//# sourceMappingURL=abstract-provider.js.map diff --git a/lib.commonjs/providers/abstract-provider.js.map b/lib.commonjs/providers/abstract-provider.js.map deleted file mode 100644 index 986d3f7f5..000000000 --- a/lib.commonjs/providers/abstract-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-provider.js","sources":["../../lib.esm/providers/abstract-provider.js"],"sourcesContent":["/**\n * About Subclassing the Provider...\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/checks.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 { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse, } from \"./format.js\";\nimport { Network } from \"./network.js\";\nimport { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse, } from \"./provider.js\";\nimport { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber, } from \"./subscriber-polling.js\";\nconst MAX_CCIP_REDIRECTS = 10;\nfunction isPromise(value) {\n return value && typeof value.then === \"function\";\n}\nfunction getTag(prefix, value) {\n return (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 // 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}\nexport class UnmanagedSubscriber {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\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 \"pending\":\n case \"debug\":\n case \"error\":\n case \"network\": {\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 {\n type: \"orphan\",\n tag: getTag(\"orphan\", event),\n filter: copy(event),\n };\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));\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() {\n return new Date().getTime();\n}\nexport class AbstractProvider {\n #subs;\n #plugins;\n // null=unpaused, true=paused+dropWhilePaused, false=paused\n #pausedState;\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 // @TODO: This should be a () => Promise so network can be\n // done when needed; or rely entirely on _detectNetwork?\n constructor(_network) {\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(() => {\n this.emit(\"network\", network, null);\n }, 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.#nextTimer = 1;\n this.#timers = new Map();\n this.#disableCcipRead = false;\n }\n get provider() {\n return this;\n }\n get plugins() {\n return Array.from(this.#plugins.values());\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 getPlugin(name) {\n return this.#plugins.get(name) || null;\n }\n get disableCcipRead() {\n return this.#disableCcipRead;\n }\n set disableCcipRead(value) {\n this.#disableCcipRead = !!value;\n }\n // Shares multiple identical requests made during the same 250ms\n async #perform(req) {\n // Create a tag\n const tag = getTag(req.method, req);\n let perform = this.#performCache.get(tag);\n if (!perform) {\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 }, 250);\n }\n return await perform;\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\", {\n action: \"sendCcipReadFetchRequest\",\n request,\n index: i,\n urls,\n });\n let errorMessage = \"unknown error\";\n const resp = await request.send();\n try {\n const result = resp.bodyJson;\n if (result.data) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchResult\",\n request,\n result,\n });\n return result.data;\n }\n if (result.message) {\n errorMessage = result.message;\n }\n this.emit(\"debug\", {\n action: \"receiveCcipReadFetchError\",\n request,\n result,\n });\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\", {\n reason: \"404_MISSING_RESOURCE\",\n transaction: tx,\n info: { url, errorMessage },\n });\n // 5xx indicates server issue; try the next url\n errorMessages.push(errorMessage);\n }\n assert(false, `error encountered during CCIP fetch: ${errorMessages\n .map((m) => JSON.stringify(m))\n .join(\", \")}`, \"OFFCHAIN_FAULT\", {\n reason: \"500_SERVER_ERROR\",\n transaction: tx,\n info: { urls, errorMessages },\n });\n }\n _wrapBlock(value, network) {\n return new Block(formatBlock(value), this);\n }\n _wrapLog(value, network) {\n return new Log(formatLog(value), this);\n }\n _wrapTransactionReceipt(value, network) {\n return new TransactionReceipt(formatTransactionReceipt(value), this);\n }\n _wrapTransactionResponse(tx, network) {\n return new TransactionResponse(formatTransactionResponse(tx), this);\n }\n _detectNetwork() {\n assert(false, \"sub-classes must implement this\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_detectNetwork\",\n });\n }\n // Sub-classes should override this and handle PerformActionRequest requests, calling\n // the super for any unhandled actions.\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 _getAddress(address) {\n return resolveAddress(address);\n }\n _getBlockTag(blockTag) {\n if (blockTag == null) {\n return \"latest\";\n }\n switch (blockTag) {\n case \"earliest\":\n return \"0x0\";\n case \"latest\":\n case \"pending\":\n case \"safe\":\n case \"finalized\":\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 _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:\n 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 _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]);\n if (isPromise(addr)) {\n promises.push((async function () {\n request[key] = await addr;\n })());\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 () {\n request.blockTag = await blockTag;\n })());\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 = this._detectNetwork().then((network) => {\n this.emit(\"network\", network, null);\n return network;\n }, (error) => {\n // Reset the networkPromise on failure, so we will try again\n if (this.#networkPromise === detectNetwork) {\n this.#networkPromise = null;\n }\n throw error;\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, // Possibly an explicit Network\n this._detectNetwork(), // The actual connected network\n ]);\n if (expected.networkId !== actual.networkId) {\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.networkId} => ${actual.networkId} `, \"NETWORK_ERROR\", {\n event: \"changed\",\n });\n }\n }\n return expected.clone();\n }\n async getEnergyPrice() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async getFeeData() {\n const { energyPrice } = await resolveProperties({\n block: this.getBlock(\"latest\"),\n energyPrice: (async () => {\n try {\n const energyPrice = await this.#perform({ method: \"getEnergyPrice\" });\n return getBigInt(energyPrice, \"%response\");\n }\n catch (error) { }\n return null;\n })(),\n });\n return new FeeData(energyPrice);\n }\n async estimateEnergy(_tx) {\n let tx = this._getTransactionRequest(_tx);\n if (isPromise(tx)) {\n tx = await tx;\n }\n return getBigInt(await this.#perform({\n method: \"estimateEnergy\",\n 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 return hexlify(await this._perform({ method: \"call\", transaction, blockTag }));\n }\n catch (error) {\n // CCIP Read OffchainLookup\n if (!this.disableCcipRead &&\n isCallException(error) &&\n error.data &&\n attempt >= 0 &&\n blockTag === \"latest\" &&\n transaction.to != null &&\n dataSlice(error.data, 0, 4) === \"0x556f1830\") {\n const data = error.data;\n const txSender = await resolveAddress(transaction.to);\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\",\n transaction,\n 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, // @TODO: populate data?\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\",\n transaction,\n info: { data: error.data, errorArgs: ccipArgs.errorArgs },\n });\n const tx = {\n to: txSender,\n data: concat([\n ccipArgs.selector,\n encodeBytes([ccipResult, ccipArgs.extraData]),\n ]),\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\", {\n action: \"receiveCcipReadCallResult\",\n transaction: Object.assign({}, tx),\n result,\n });\n return result;\n }\n catch (error) {\n this.emit(\"debug\", {\n action: \"receiveCcipReadCallError\",\n transaction: Object.assign({}, tx),\n error,\n });\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\",\n blockHash: block,\n 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\",\n blockTag,\n 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 effectiveEnergyPrice into old transactions\n // in the receipt, so we look it up manually and inject it.\n if (params.energyPrice == null && params.effectiveEnergyPrice == 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 effectiveEnergyPrice\");\n }\n params.effectiveEnergyPrice = tx.energyPrice;\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(networkId) {\n assert(false, \"provider cannot connect to target network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"_getProvider()\",\n });\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 _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 _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 _forEachSubscriber(func) {\n for (const sub of this.#subs.values()) {\n func(sub.subscriber);\n }\n }\n // Event API; sub-classes should override this; any supported\n // event filter will have been munged into an EventFilter\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 return new PollingBlockSubscriber(this);\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 _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\" &&\n emitArgs &&\n emitArgs.length > 0 &&\n 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 = {\n subscriber,\n tag,\n addressableMap,\n nameMap,\n started: false,\n listeners: [],\n };\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 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\n .map(({ listener }) => listener)\n .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 // Sub-classes should override this to shutdown any sockets, etc.\n // but MUST call this super.shutdown.\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 }\n get paused() {\n return this.#pausedState != null;\n }\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 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 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: \"\",\n urls: [],\n calldata: \"\",\n selector: \"\",\n extraData: \"\",\n 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\"\n .split(/,/)\n .map((k) => result[k]);\n return result;\n}\n//# sourceMappingURL=abstract-provider.js.map"],"names":["defineProperties","isHexString","resolveAddress","assertArgument","network","Network","FetchRequest","assert","Block","formatBlock","Log","formatLog","TransactionReceipt","formatTransactionReceipt","TransactionResponse","formatTransactionResponse","getNumber","toQuantity","copyRequest","resolveProperties","getBigInt","FeeData","hexlify","isCallException","dataSlice","data","concat","Transaction","makeError","PollingBlockSubscriber","PollingEventSubscriber","PollingTransactionSubscriber","PollingOrphanSubscriber","EventPayload","toUtf8String","toBeArray","getBytes","dataLength"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA,MAAM,kBAAkB,GAAG,EAAE;AAC7B,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;AACpD;AACA,SAAS,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE;AAC/B,IAAI,QAAQ,MAAM;AAClB,QAAQ,GAAG;AACX,QAAQ,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK;AACxC,YAAY,IAAI,CAAC,IAAI,IAAI,EAAE;AAC3B,gBAAgB,OAAO,MAAM;AAC7B,YAAY;AACZ,YAAY,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;AACvC,gBAAgB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC/C,YAAY;AACZ,YAAY,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;AACvC,gBAAgB,OAAO,CAAC,CAAC,WAAW,EAAE;AACtC,YAAY;AACZ;AACA,YAAY,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;AAC5D,gBAAgB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC3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,IAAI;AACJ;AACA,IAAIA,aAAM,CAACiB,cAAS,CAACC,MAAI,EAAE,GAAG,EAAE,GAAG,CAAC,KAAKD,cAAS,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,0CAA0C,EAAE,gBAAgB,EAAE;AAChI,QAAQ,MAAM,EAAE,0CAA0C;AAC1D,KAAK,CAAC;AACN,IAAI,MAAM,CAAC,QAAQ,GAAGA,cAAS,CAACC,MAAI,EAAE,EAAE,EAAE,GAAG,CAAC;AAC9C;AACA,IAAI,IAAI;AACR,QAAQ,MAAM,SAAS,GAAG,WAAW,CAACA,MAAI,EAAE,GAAG,CAAC;AAChD,QAAQ,IAAI,SAAS,IAAI,IAAI,EAAE;AAC/B,YAAY,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AACpC,QAAQ;AACR,QAAQ,MAAM,CAAC,SAAS,GAAG,SAAS;AACpC,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQlB,aAAM,CAAC,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE;AAC5E,YAAY,MAAM,EAAE,kCAAkC;AACtD,SAAS,CAAC;AACV,IAAI;AACJ,IAAI,MAAM,CAAC,SAAS,GAAG;AACvB,SAAS,KAAK,CAAC,GAAG;AAClB,SAAS,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9B,IAAI,OAAO,MAAM;AACjB;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-signer.d.ts b/lib.commonjs/providers/abstract-signer.d.ts deleted file mode 100644 index ab4997033..000000000 --- a/lib.commonjs/providers/abstract-signer.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -export declare abstract class AbstractSigner

implements Signer { - readonly provider: P; - constructor(provider?: P); - abstract getAddress(): Promise; - abstract connect(provider: null | Provider): Signer; - getNonce(blockTag?: BlockTag): Promise; - populateCall(tx: TransactionRequest): Promise>; - populateTransaction(tx: TransactionRequest): Promise>; - estimateEnergy(tx: TransactionRequest): Promise; - call(tx: TransactionRequest): Promise; - resolveName(name: string): Promise; - sendTransaction(tx: TransactionRequest): Promise; - abstract signTransaction(tx: TransactionRequest): Promise; - abstract signMessage(message: string | Uint8Array): Promise; - abstract signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -export declare class VoidSigner extends AbstractSigner { - #private; - readonly address: string; - constructor(address: string, provider?: null | Provider); - getAddress(): Promise; - connect(provider: null | Provider): VoidSigner; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=abstract-signer.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-signer.d.ts.map b/lib.commonjs/providers/abstract-signer.d.ts.map deleted file mode 100644 index 35aaa1ca6..000000000 --- a/lib.commonjs/providers/abstract-signer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuC1C,8BAAsB,cAAc,CACnC,CAAC,SAAS,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAC1C,YAAW,MAAM;IAClB,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAC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C,OAAO,EAAG,MAAM,CAAC;IAE1B,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,EAGtD;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAE7C;IAQK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/abstract-signer.js b/lib.commonjs/providers/abstract-signer.js deleted file mode 100644 index 9d341617d..000000000 --- a/lib.commonjs/providers/abstract-signer.js +++ /dev/null @@ -1,155 +0,0 @@ -'use strict'; - -var checks = require('../address/checks.js'); -var index = require('../address/index.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../crypto/signature.js'); -var transaction = require('../transaction/transaction.js'); -var provider = require('./provider.js'); - -/** - * About Abstract Signer and subclassing - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ -function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - errors.assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); -} -async function populate(signer, tx) { - let pop = provider.copyRequest(tx); - if (pop.to != null) { - pop.to = checks.resolveAddress(pop.to); - } - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([signer.getAddress(), checks.resolveAddress(from)]).then(([address, from]) => { - errors.assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); - return address; - }); - } - else { - pop.from = signer.getAddress(); - } - return await properties.resolveProperties(pop); -} -class AbstractSigner { - provider; - constructor(provider) { - properties.defineProperties(this, { provider: provider || null }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.energyLimit == null) { - pop.energyLimit = await this.estimateEnergy(pop); - } - // Populate the chain ID - const network = await this.provider.getNetwork(); - if (pop.networkId != null) { - const networkId = maths.getBigInt(pop.networkId); - errors.assertArgument(networkId === network.networkId, "transaction networkId mismatch", "tx.networkId", tx.networkId); - } - else { - pop.networkId = network.networkId; - } - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - // We need to auto-detect the intended type of this transaction... - if (feeData.energyPrice != null) { - // Network doesn't support EIP-1559... - // Populate missing fee data - if (pop.energyPrice == null) { - pop.energyPrice = feeData.energyPrice; - } - } - else { - // getFeeData has failed us. - errors.assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData", - }); - } - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await properties.resolveProperties(pop); - } - async estimateEnergy(tx) { - return checkProvider(this, "estimateEnergy").estimateEnergy(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name) { - return index.getAddress(name); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = transaction.Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } -} -class VoidSigner extends AbstractSigner { - address; - constructor(address, provider) { - super(provider); - properties.defineProperties(this, { address }); - } - async getAddress() { - return this.address; - } - connect(provider) { - return new VoidSigner(this.address, provider); - } - #throwUnsupported(suffix, operation) { - errors.assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { - operation, - }); - } - async signTransaction(tx) { - this.#throwUnsupported("transactions", "signTransaction"); - } - async signMessage(message) { - this.#throwUnsupported("messages", "signMessage"); - } - async signTypedData(domain, types, value) { - this.#throwUnsupported("typed-data", "signTypedData"); - } -} - -exports.AbstractSigner = AbstractSigner; -exports.VoidSigner = VoidSigner; -//# sourceMappingURL=abstract-signer.js.map diff --git a/lib.commonjs/providers/abstract-signer.js.map b/lib.commonjs/providers/abstract-signer.js.map deleted file mode 100644 index fc4347d41..000000000 --- a/lib.commonjs/providers/abstract-signer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-signer.js","sources":["../../lib.esm/providers/abstract-signer.js"],"sourcesContent":["/**\n * About Abstract Signer and subclassing\n *\n * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer]\n */\nimport { resolveAddress } from \"../address/checks.js\";\nimport { getAddress } 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);\n }\n if (pop.from != null) {\n const from = pop.from;\n pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).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}\nexport class AbstractSigner {\n provider;\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.energyLimit == null) {\n pop.energyLimit = await this.estimateEnergy(pop);\n }\n // Populate the chain ID\n const network = await this.provider.getNetwork();\n if (pop.networkId != null) {\n const networkId = getBigInt(pop.networkId);\n assertArgument(networkId === network.networkId, \"transaction networkId mismatch\", \"tx.networkId\", tx.networkId);\n }\n else {\n pop.networkId = network.networkId;\n }\n // We need to get fee data to determine things\n const feeData = await provider.getFeeData();\n // We need to auto-detect the intended type of this transaction...\n if (feeData.energyPrice != null) {\n // Network doesn't support EIP-1559...\n // Populate missing fee data\n if (pop.energyPrice == null) {\n pop.energyPrice = feeData.energyPrice;\n }\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 //@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 estimateEnergy(tx) {\n return checkProvider(this, \"estimateEnergy\").estimateEnergy(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 return getAddress(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}\nexport class VoidSigner extends AbstractSigner {\n address;\n constructor(address, provider) {\n super(provider);\n defineProperties(this, { address });\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new VoidSigner(this.address, provider);\n }\n #throwUnsupported(suffix, operation) {\n assert(false, `VoidSigner cannot sign ${suffix}`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\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"],"names":["assert","copyRequest","resolveAddress","assertArgument","resolveProperties","defineProperties","getBigInt","getAddress","Transaction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAMA,SAAS,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE;AAC1C,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE;AACzB,QAAQ,OAAO,MAAM,CAAC,QAAQ;AAC9B,IAAI;AACJ,IAAIA,aAAM,CAAC,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,CAAC;AAC7E;AACA,eAAe,QAAQ,CAAC,MAAM,EAAE,EAAE,EAAE;AACpC,IAAI,IAAI,GAAG,GAAGC,oBAAW,CAAC,EAAE,CAAC;AAC7B,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,IAAI,EAAE;AACxB,QAAQ,GAAG,CAAC,EAAE,GAAGC,qBAAc,CAAC,GAAG,CAAC,EAAE,CAAC;AACvC,IAAI;AACJ,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,EAAE;AAC1B,QAAQ,MAAM,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OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;AACrD,IAAI;AACJ,IAAI,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE;AACzC,QAAQL,aAAM,CAAC,KAAK,EAAE,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC,EAAE,uBAAuB,EAAE;AACnF,YAAY,SAAS;AACrB,SAAS,CAAC;AACV,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,EAAE,EAAE;AAC9B,QAAQ,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC;AACjE,IAAI;AACJ,IAAI,MAAM,WAAW,CAAC,OAAO,EAAE;AAC/B,QAAQ,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC;AACzD,IAAI;AACJ,IAAI,MAAM,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;AAC9C,QAAQ,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,eAAe,CAAC;AAC7D,IAAI;AACJ;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/community.d.ts b/lib.commonjs/providers/community.d.ts deleted file mode 100644 index a61908d27..000000000 --- a/lib.commonjs/providers/community.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * There are many awesome community services that provide Core - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -/** - * Providers which offer community credentials should extend this - * to notify any interested consumers whether community credentials - * are in-use. - */ -export interface CommunityResourcable { - /** - * Returns true of the instance is connected using the community - * credentials. - */ - isCommunityResource(): boolean; -} -/** - * Displays a warning in tht console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -export declare function showThrottleMessage(service: string): void; -//# sourceMappingURL=community.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/community.d.ts.map b/lib.commonjs/providers/community.d.ts.map deleted file mode 100644 index e36ebbacf..000000000 --- a/lib.commonjs/providers/community.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAC/B;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA4BzD"} \ No newline at end of file diff --git a/lib.commonjs/providers/community.js b/lib.commonjs/providers/community.js deleted file mode 100644 index f46e060ae..000000000 --- a/lib.commonjs/providers/community.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -/** - * There are many awesome community services that provide Core - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -// Show the throttle message only once per service -const shown = new Set(); -/** - * Displays a warning in tht console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -function showThrottleMessage(service) { - if (shown.has(service)) { - return; - } - shown.add(service); - console.log("========= NOTICE ========="); - console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); -} - -exports.showThrottleMessage = showThrottleMessage; -//# sourceMappingURL=community.js.map diff --git a/lib.commonjs/providers/community.js.map b/lib.commonjs/providers/community.js.map deleted file mode 100644 index 6c088f295..000000000 --- a/lib.commonjs/providers/community.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"community.js","sources":["../../lib.esm/providers/community.js"],"sourcesContent":["/**\n * There are many awesome community services that provide Core\n * nodes both for developers just starting out and for large-scale\n * communities.\n *\n * @_section: api/providers/thirdparty: Community Providers [thirdparty]\n */\n// Show the throttle message only once per service\nconst shown = new Set();\n/**\n * Displays a warning in tht console when the community resource is\n * being used too heavily by the app, recommending the developer\n * acquire their own credentials instead of using the community\n * credentials.\n *\n * The notification will only occur once per service.\n */\nexport function showThrottleMessage(service) {\n if (shown.has(service)) {\n return;\n }\n shown.add(service);\n console.log(\"========= NOTICE =========\");\n console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`);\n console.log(\"\");\n console.log(\"The default API keys for each service are provided as a highly-throttled,\");\n console.log(\"community resource for low-traffic projects and early prototyping.\");\n console.log(\"\");\n console.log(\"While your application will continue to function, we highly recommended\");\n console.log(\"signing up for your own API keys to improve performance, increase your\");\n console.log(\"request rate/limit and enable other perks, such as metrics and advanced APIs.\");\n console.log(\"\");\n}\n//# sourceMappingURL=community.js.map"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAE;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,OAAO,EAAE;AAC7C,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;AAC5B,QAAQ;AACR,IAAI;AACJ,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC;AACtB,IAAI,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;AAC7C,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,0BAA0B,EAAE,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAC3F,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AACnB,IAAI,OAAO,CAAC,GAAG,CAAC,2EAA2E,CAAC;AAC5F,IAAI,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC;AACrF,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AACnB,IAAI,OAAO,CAAC,GAAG,CAAC,yEAAyE,CAAC;AAC1F,IAAI,OAAO,CAAC,GAAG,CAAC,wEAAwE,CAAC;AACzF,IAAI,OAAO,CAAC,GAAG,CAAC,+EAA+E,CAAC;AAChG,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AACnB;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/contracts.d.ts b/lib.commonjs/providers/contracts.d.ts deleted file mode 100644 index 187f28cce..000000000 --- a/lib.commonjs/providers/contracts.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -export interface ContractRunner { - provider: null | Provider; - estimateEnergy?: (tx: TransactionRequest) => Promise; - call?: (tx: TransactionRequest) => Promise; - resolveName?: (name: string) => Promise; - sendTransaction?: (tx: TransactionRequest) => Promise; -} -//# sourceMappingURL=contracts.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/contracts.d.ts.map b/lib.commonjs/providers/contracts.d.ts.map deleted file mode 100644 index 29a278289..000000000 --- a/lib.commonjs/providers/contracts.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAG1B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7D,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAGvD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC3E"} \ No newline at end of file diff --git a/lib.commonjs/providers/contracts.js b/lib.commonjs/providers/contracts.js deleted file mode 100644 index 7cd373ee0..000000000 --- a/lib.commonjs/providers/contracts.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=contracts.js.map diff --git a/lib.commonjs/providers/contracts.js.map b/lib.commonjs/providers/contracts.js.map deleted file mode 100644 index 749bf4924..000000000 --- a/lib.commonjs/providers/contracts.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contracts.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/providers/default-provider.d.ts b/lib.commonjs/providers/default-provider.d.ts deleted file mode 100644 index 657919cb1..000000000 --- a/lib.commonjs/providers/default-provider.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AbstractProvider } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import { WebSocketLike } from "./provider-websocket.js"; -export declare function getDefaultProvider(network: string | Networkish | WebSocketLike, options?: any): AbstractProvider; -//# sourceMappingURL=default-provider.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/default-provider.d.ts.map b/lib.commonjs/providers/default-provider.d.ts.map deleted file mode 100644 index 6e1d55294..000000000 --- a/lib.commonjs/providers/default-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxD,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAC5C,OAAO,CAAC,EAAE,GAAG,GACX,gBAAgB,CA6FlB"} \ No newline at end of file diff --git a/lib.commonjs/providers/default-provider.js b/lib.commonjs/providers/default-provider.js deleted file mode 100644 index 0fa81d2d9..000000000 --- a/lib.commonjs/providers/default-provider.js +++ /dev/null @@ -1,109 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var providerAnkr = require('./provider-ankr.js'); -var providerAlchemy = require('./provider-alchemy.js'); -var providerCloudflare = require('./provider-cloudflare.js'); -var providerInfura = require('./provider-infura.js'); -var providerQuicknode = require('./provider-quicknode.js'); -var providerFallback = require('./provider-fallback.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); -var providerWebsocket = require('./provider-websocket.js'); - -function isWebSocketLike(value) { - return (value && - typeof value.send === "function" && - typeof value.close === "function"); -} -function getDefaultProvider(network, options) { - if (options == null) { - options = {}; - } - if (typeof network === "string" && network.match(/^https?:/)) { - return new providerJsonrpc.JsonRpcProvider(network); - } - if ((typeof network === "string" && network.match(/^wss?:/)) || - isWebSocketLike(network)) { - return new providerWebsocket.WebSocketProvider(network); - } - const providers = []; - if (options.alchemy !== "-") { - try { - providers.push(new providerAlchemy.AlchemyProvider(network, options.alchemy)); - } - catch (error) { - console.log(error); - } - } - if (options.ankr !== "-" && options.ankr != null) { - try { - providers.push(new providerAnkr.AnkrProvider(network, options.ankr)); - } - catch (error) { - console.log(error); - } - } - if (options.cloudflare !== "-") { - try { - providers.push(new providerCloudflare.CloudflareProvider(network)); - } - catch (error) { - console.log(error); - } - } - if (options.infura !== "-") { - try { - let projectId = options.infura; - let projectSecret = undefined; - if (typeof projectId === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new providerInfura.InfuraProvider(network, projectId, projectSecret)); - } - catch (error) { - console.log(error); - } - } - /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } -*/ - if (options.quicknode !== "-") { - try { - let token = options.quicknode; - providers.push(new providerQuicknode.QuickNodeProvider(network, token)); - } - catch (error) { - console.log(error); - } - } - errors.assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider", - }); - if (providers.length === 1) { - return providers[0]; - } - return new providerFallback.FallbackProvider(providers); -} - -exports.getDefaultProvider = getDefaultProvider; -//# sourceMappingURL=default-provider.js.map diff --git a/lib.commonjs/providers/default-provider.js.map b/lib.commonjs/providers/default-provider.js.map deleted file mode 100644 index 445a2268f..000000000 --- a/lib.commonjs/providers/default-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-provider.js","sources":["../../lib.esm/providers/default-provider.js"],"sourcesContent":["import { assert } from \"../utils/index.js\";\nimport { AnkrProvider } from \"./provider-ankr.js\";\nimport { AlchemyProvider } from \"./provider-alchemy.js\";\nimport { CloudflareProvider } from \"./provider-cloudflare.js\";\nimport { InfuraProvider } from \"./provider-infura.js\";\n//import { PocketProvider } from \"./provider-pocket.js\";\nimport { QuickNodeProvider } from \"./provider-quicknode.js\";\nimport { FallbackProvider } from \"./provider-fallback.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nfunction isWebSocketLike(value) {\n return (value &&\n typeof value.send === \"function\" &&\n typeof value.close === \"function\");\n}\nexport function getDefaultProvider(network, options) {\n if (options == null) {\n options = {};\n }\n if (typeof network === \"string\" && network.match(/^https?:/)) {\n return new JsonRpcProvider(network);\n }\n if ((typeof network === \"string\" && network.match(/^wss?:/)) ||\n isWebSocketLike(network)) {\n return new WebSocketProvider(network);\n }\n const providers = [];\n if (options.alchemy !== \"-\") {\n try {\n providers.push(new AlchemyProvider(network, options.alchemy));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.ankr !== \"-\" && options.ankr != null) {\n try {\n providers.push(new AnkrProvider(network, options.ankr));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.cloudflare !== \"-\") {\n try {\n providers.push(new CloudflareProvider(network));\n }\n catch (error) {\n console.log(error);\n }\n }\n if (options.infura !== \"-\") {\n try {\n let projectId = options.infura;\n let projectSecret = undefined;\n if (typeof projectId === \"object\") {\n projectSecret = projectId.projectSecret;\n projectId = projectId.projectId;\n }\n providers.push(new InfuraProvider(network, projectId, projectSecret));\n }\n catch (error) {\n console.log(error);\n }\n }\n /*\n if (options.pocket !== \"-\") {\n try {\n let appId = options.pocket;\n let secretKey: undefined | string = undefined;\n let loadBalancer: undefined | boolean = undefined;\n if (typeof(appId) === \"object\") {\n loadBalancer = !!appId.loadBalancer;\n secretKey = appId.secretKey;\n appId = appId.appId;\n }\n providers.push(new PocketProvider(network, appId, secretKey, loadBalancer));\n } catch (error) { console.log(error); }\n }\n*/\n if (options.quicknode !== \"-\") {\n try {\n let token = options.quicknode;\n providers.push(new QuickNodeProvider(network, token));\n }\n catch (error) {\n console.log(error);\n }\n }\n assert(providers.length, \"unsupported default network\", \"UNSUPPORTED_OPERATION\", {\n operation: \"getDefaultProvider\",\n });\n if (providers.length === 1) {\n return providers[0];\n }\n return new FallbackProvider(providers);\n}\n//# sourceMappingURL=default-provider.js.map"],"names":["JsonRpcProvider","WebSocketProvider","AlchemyProvider","AnkrProvider","CloudflareProvider","InfuraProvider","QuickNodeProvider","assert","FallbackProvider"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,SAAS,eAAe,CAAC,KAAK,EAAE;AAChC,IAAI,QAAQ,KAAK;AACjB,QAAQ,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU;AACxC,QAAQ,OAAO,KAAK,CAAC,KAAK,KAAK,UAAU;AACzC;AACO,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N,IAAI,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;AAChC,QAAQ,OAAO,SAAS,CAAC,CAAC,CAAC;AAC3B,IAAI;AACJ,IAAI,OAAO,IAAIC,iCAAgB,CAAC,SAAS,CAAC;AAC1C;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/format.d.ts b/lib.commonjs/providers/format.d.ts deleted file mode 100644 index e088632a0..000000000 --- a/lib.commonjs/providers/format.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -export type FormatFunc = (value: any) => any; -export declare function allowNull(format: FormatFunc, nullValue?: any): FormatFunc; -export declare function arrayOf(format: FormatFunc): FormatFunc; -export declare function object(format: Record, altNames?: Record>): FormatFunc; -export declare function formatBoolean(value: any): boolean; -export declare function formatData(value: string): string; -export declare function formatHash(value: any): string; -export declare function formatUint256(value: any): string; -export declare function formatLog(value: any): LogParams; -export declare function formatBlock(value: any): BlockParams; -export declare function formatReceiptLog(value: any): LogParams; -export declare function formatTransactionReceipt(value: any): TransactionReceiptParams; -export declare function formatTransactionResponse(value: any): TransactionResponseParams; -//# sourceMappingURL=format.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/format.d.ts.map b/lib.commonjs/providers/format.d.ts.map deleted file mode 100644 index 1c35b4b35..000000000 --- a/lib.commonjs/providers/format.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAIzB,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAOzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAOtD;AAKD,wBAAgB,MAAM,CACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GACtC,UAAU,CA+BZ;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAejD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAG7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAmBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAE/C;AAoBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,CAWnD;AAkBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAEtD;AA6BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,wBAAwB,CAE7E;AAED,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,GAAG,GACR,yBAAyB,CA0G3B"} \ No newline at end of file diff --git a/lib.commonjs/providers/format.js b/lib.commonjs/providers/format.js deleted file mode 100644 index 77f4b533b..000000000 --- a/lib.commonjs/providers/format.js +++ /dev/null @@ -1,288 +0,0 @@ -'use strict'; - -var index = require('../address/index.js'); -var contractAddress = require('../address/contract-address.js'); -var accesslist = require('../transaction/accesslist.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); - -/** - * @_ignore - */ -const BN_0 = BigInt(0); -function allowNull(format, nullValue) { - return function (value) { - if (value == null) { - return nullValue; - } - return format(value); - }; -} -function arrayOf(format) { - return (array) => { - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }; -} -// Requires an object which matches a fleet of other formatters -// Any FormatFunc may return `undefined` to have the value omitted -// from the result object. Calls preserve `this`. -function object(format, altNames) { - return (value) => { - const result = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } - catch (error) { - const message = error instanceof Error ? error.message : "not-an-error"; - errors.assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); - } - } - return result; - }; -} -function formatBoolean(value) { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - errors.assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); -} -function formatData(value) { - errors.assertArgument(data.isHexString(value, true), "invalid data", "value", value); - return value; -} -function formatHash(value) { - errors.assertArgument(data.isHexString(value, 32), "invalid hash", "value", value); - return value; -} -function formatUint256(value) { - if (!data.isHexString(value)) { - throw new Error("invalid uint256"); - } - return data.zeroPadValue(value, 32); -} -const _formatLog = object({ - address: index.getAddress, - blockHash: formatHash, - blockNumber: maths.getNumber, - data: formatData, - index: maths.getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: maths.getNumber, -}, { - index: ["logIndex"], -}); -function formatLog(value) { - return _formatLog(value); -} -const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - number: maths.getNumber, - timestamp: maths.getNumber, - nonce: allowNull(formatData), - difficulty: maths.getBigInt, - energyLimit: maths.getBigInt, - energyUsed: maths.getBigInt, - miner: allowNull(index.getAddress), - extraData: formatData, - baseFeePerEnergy: allowNull(maths.getBigInt), -}); -function formatBlock(value) { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return formatTransactionResponse(tx); - }); - return result; -} -const _formatReceiptLog = object({ - transactionIndex: maths.getNumber, - blockNumber: maths.getNumber, - transactionHash: formatHash, - address: index.getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: maths.getNumber, - blockHash: formatHash, -}, { - index: ["logIndex"], -}); -function formatReceiptLog(value) { - return _formatReceiptLog(value); -} -const _formatTransactionReceipt = object({ - to: allowNull(index.getAddress, null), - from: allowNull(index.getAddress, null), - contractAddress: allowNull(index.getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: maths.getNumber, - root: allowNull(data.hexlify), - energyUsed: maths.getBigInt, - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: maths.getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeEnergyUsed: maths.getBigInt, - effectiveEnergyPrice: allowNull(maths.getBigInt), - status: allowNull(maths.getNumber), - type: allowNull(maths.getNumber, 0), -}, { - effectiveEnergyPrice: ["energyPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], -}); -function formatTransactionReceipt(value) { - return _formatTransactionReceipt(value); -} -function formatTransactionResponse(value) { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && !index.getAddress(value.to) && maths.getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - const result = object({ - hash: formatHash, - type: (value) => { - if (value === "0x" || value == null) { - return 0; - } - return maths.getNumber(value); - }, - accessList: allowNull(accesslist.accessListify, null), - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(maths.getNumber, null), - transactionIndex: allowNull(maths.getNumber, null), - //confirmations: allowNull(getNumber, null), - from: index.getAddress, - maxFeePerEnergy: allowNull(maths.getBigInt), - energyLimit: maths.getBigInt, - to: allowNull(index.getAddress, null), - value: maths.getBigInt, - nonce: maths.getNumber, - data: formatData, - creates: allowNull(index.getAddress, null), - networkId: allowNull(maths.getBigInt, null), - }, { - data: ["input"], - energyLimit: ["energy"], - })(value); - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = contractAddress.getCreateAddress(result); - } - // Compute the signature - if (value.signature) { - result.signature = value.signature; - } - else { - result.signature = value; - } - // Some backends omit networkId on legacy transactions, but we can compute it - if (result.networkId == null) { - const networkId = result.signature.legacynetworkId; - if (networkId != null) { - result.networkId = networkId; - } - } - // @TODO: check networkId - /* - if (value.networkId != null) { - let networkId = value.networkId; - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - result.networkId = networkId; - - } else { - let networkId = value.networkId; - - // geth-etc returns networkId - if (networkId == null && result.v == null) { - networkId = value.networkId; - } - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - if (typeof(networkId) !== "number" && result.v != null) { - networkId = (result.v - 35) / 2; - if (networkId < 0) { networkId = 0; } - networkId = parseInt(networkId); - } - - if (typeof(networkId) !== "number") { networkId = 0; } - - result.networkId = networkId; - } - */ - // 0x0000... should actually be null - if (result.blockHash && maths.getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } - return result; -} - -exports.allowNull = allowNull; -exports.arrayOf = arrayOf; -exports.formatBlock = formatBlock; -exports.formatBoolean = formatBoolean; -exports.formatData = formatData; -exports.formatHash = formatHash; -exports.formatLog = formatLog; -exports.formatReceiptLog = formatReceiptLog; -exports.formatTransactionReceipt = formatTransactionReceipt; -exports.formatTransactionResponse = formatTransactionResponse; -exports.formatUint256 = formatUint256; -exports.object = object; -//# sourceMappingURL=format.js.map diff --git a/lib.commonjs/providers/format.js.map b/lib.commonjs/providers/format.js.map deleted file mode 100644 index 30eb78244..000000000 --- a/lib.commonjs/providers/format.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.js","sources":["../../lib.esm/providers/format.js"],"sourcesContent":["/**\n * @_ignore\n */\nimport { getAddress } from \"../address/index.js\";\nimport { getCreateAddress } from \"../address/contract-address.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) {\n return (array) => {\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 number: getNumber,\n timestamp: getNumber,\n nonce: allowNull(formatData),\n difficulty: getBigInt,\n energyLimit: getBigInt,\n energyUsed: getBigInt,\n miner: allowNull(getAddress),\n extraData: formatData,\n baseFeePerEnergy: allowNull(getBigInt),\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 energyUsed: getBigInt,\n logsBloom: allowNull(formatData),\n blockHash: formatHash,\n hash: formatHash,\n logs: arrayOf(formatReceiptLog),\n blockNumber: getNumber,\n //confirmations: allowNull(getNumber, null),\n cumulativeEnergyUsed: getBigInt,\n effectiveEnergyPrice: allowNull(getBigInt),\n status: allowNull(getNumber),\n type: allowNull(getNumber, 0),\n}, {\n effectiveEnergyPrice: [\"energyPrice\"],\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 && !getAddress(value.to) && getBigInt(value.to) === BN_0) {\n value.to = \"0x0000000000000000000000000000000000000000\";\n }\n const result = object({\n hash: formatHash,\n type: (value) => {\n if (value === \"0x\" || value == null) {\n return 0;\n }\n return getNumber(value);\n },\n accessList: allowNull(accessListify, null),\n blockHash: allowNull(formatHash, null),\n blockNumber: allowNull(getNumber, null),\n transactionIndex: allowNull(getNumber, null),\n //confirmations: allowNull(getNumber, null),\n from: getAddress,\n maxFeePerEnergy: allowNull(getBigInt),\n energyLimit: getBigInt,\n to: allowNull(getAddress, null),\n value: getBigInt,\n nonce: getNumber,\n data: formatData,\n creates: allowNull(getAddress, null),\n networkId: allowNull(getBigInt, null),\n }, {\n data: [\"input\"],\n energyLimit: [\"energy\"],\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 // Compute the signature\n if (value.signature) {\n result.signature = value.signature;\n }\n else {\n result.signature = value;\n }\n // Some backends omit networkId on legacy transactions, but we can compute it\n if (result.networkId == null) {\n const networkId = result.signature.legacynetworkId;\n if (networkId != null) {\n result.networkId = networkId;\n }\n }\n // @TODO: check networkId\n /*\n if (value.networkId != null) {\n let networkId = value.networkId;\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n result.networkId = networkId;\n\n } else {\n let networkId = value.networkId;\n\n // geth-etc returns networkId\n if (networkId == null && result.v == null) {\n networkId = value.networkId;\n }\n\n if (isHexString(networkId)) {\n networkId = BigNumber.from(networkId).toNumber();\n }\n\n if (typeof(networkId) !== \"number\" && result.v != null) {\n networkId = (result.v - 35) / 2;\n if (networkId < 0) { networkId = 0; }\n networkId = parseInt(networkId);\n }\n\n if (typeof(networkId) !== \"number\") { networkId = 0; }\n\n result.networkId = networkId;\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"],"names":["assert","assertArgument","isHexString","zeroPadValue","getAddress","getNumber","getBigInt","hexlify","accessListify","getCreateAddress"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAKA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACf,SAAS,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE;AAC7C,IAAI,OAAO,UAAU,KAAK,EAAE;AAC5B,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;AAC3B,YAAY,OAAO,SAAS;AAC5B,QAAQ;AACR,QAAQ,OAAO,MAAM,CAAC,KAAK,CAAC;AAC5B,IAAI,CAAC;AACL;AACO,SAAS,OAAO,CAAC,MAAM,EAAE;AAChC,IAAI,OAAO,CAAC,KAAK,KAAK;AACtB,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACnC,YAAY,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC;AAC3C,QAAQ;AACR,QAAQ,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;AAC1C,IAAI,CAAC;AACL;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE;AACzC,IAAI,OAAO,CAAC,KAAK,KAAK;AACtB,QAAQ,MAAM,MAAM,GAAG,EAAE;AACzB,QAAQ,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;AAClC,YAAY,IAAI,MAAM,GAAG,GAAG;AAC5B,YAAY,IAAI,QAAQ,IAAI,GAAG,IAAI,QAAQ,IAAI,EAAE,MAAM,IAAI,KAAK,CAAC,EAAE;AACnE,gBAAgB,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE;AACp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AM,CAAC,SAAS,IAAI,IAAI,EAAE;AAClC,QAAQ,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,eAAe;AAC1D,QAAQ,IAAI,SAAS,IAAI,IAAI,EAAE;AAC/B,YAAY,MAAM,CAAC,SAAS,GAAG,SAAS;AACxC,QAAQ;AACR,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAI,IAAI,MAAM,CAAC,SAAS,IAAIH,eAAS,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;AAClE,QAAQ,MAAM,CAAC,SAAS,GAAG,IAAI;AAC/B,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/formatting.d.ts b/lib.commonjs/providers/formatting.d.ts deleted file mode 100644 index 82736fe7c..000000000 --- a/lib.commonjs/providers/formatting.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ -export interface BlockParams { - hash?: null | string; - number: number; - timestamp: number; - parentHash: string; - nonce: string; - difficulty: bigint; - energyLimit: bigint; - energyUsed: bigint; - miner: string; - extraData: string; - baseFeePerEnergy: null | bigint; - transactions: ReadonlyArray; -} -export interface LogParams { - transactionHash: string; - blockHash: string; - blockNumber: number; - removed: boolean; - address: string; - data: string; - topics: ReadonlyArray; - index: number; - transactionIndex: number; -} -export interface TransactionReceiptParams { - to: null | string; - from: string; - contractAddress: null | string; - hash: string; - index: number; - blockHash: string; - blockNumber: number; - logsBloom: string; - logs: ReadonlyArray; - energyUsed: bigint; - cumulativeEnergyUsed: bigint; - energyPrice?: null | bigint; - effectiveEnergyPrice?: null | bigint; - type: number; - status: null | number; - root: null | string; -} -export interface TransactionResponseParams { - blockNumber: null | number; - blockHash: null | string; - hash: string; - index: number; - type: number; - to: null | string; - from: string; - nonce: number; - energyLimit: bigint; - energyPrice: bigint; - data: string; - value: bigint; - networkId: bigint; - signature: string; -} -//# sourceMappingURL=formatting.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/formatting.d.ts.map b/lib.commonjs/providers/formatting.d.ts.map deleted file mode 100644 index 5d7ddfb6b..000000000 --- a/lib.commonjs/providers/formatting.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwDH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;IAEhC,YAAY,EAAE,aAAa,CAAC,MAAM,GAAG,yBAAyB,CAAC,CAAC;CAChE;AAKD,MAAM,WAAW,SAAS;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE9B,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAKD,MAAM,WAAW,wBAAwB;IACxC,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,IAAI,GAAG,MAAM,CAAC;IAE/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAE/B,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErC,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;CACpB;AAmBD,MAAM,WAAW,yBAAyB;IACzC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CAClB"} \ No newline at end of file diff --git a/lib.commonjs/providers/formatting.js b/lib.commonjs/providers/formatting.js deleted file mode 100644 index f393db163..000000000 --- a/lib.commonjs/providers/formatting.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=formatting.js.map diff --git a/lib.commonjs/providers/formatting.js.map b/lib.commonjs/providers/formatting.js.map deleted file mode 100644 index b33094d3d..000000000 --- a/lib.commonjs/providers/formatting.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"formatting.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/providers/index.d.ts b/lib.commonjs/providers/index.d.ts deleted file mode 100644 index 7e80c01e9..000000000 --- a/lib.commonjs/providers/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * About providers. - * - * @_section: api/providers:Providers [about-providers] - */ -export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -export { AbstractSigner, VoidSigner } from "./abstract-signer.js"; -export { showThrottleMessage } from "./community.js"; -export { getDefaultProvider } from "./default-provider.js"; -export { Network } from "./network.js"; -export { NonceManager } from "./signer-noncemanager.js"; -export { NetworkPlugin, EnergyCostPlugin, FeeDataNetworkPlugin, } from "./plugins-network.js"; -export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest, } from "./provider.js"; -export { FallbackProvider } from "./provider-fallback.js"; -export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, } from "./provider-jsonrpc.js"; -export { BrowserProvider } from "./provider-browser.js"; -export { AlchemyProvider } from "./provider-alchemy.js"; -export { AnkrProvider } from "./provider-ankr.js"; -export { CloudflareProvider } from "./provider-cloudflare.js"; -export { InfuraProvider, InfuraWebSocketProvider } from "./provider-infura.js"; -export { PocketProvider } from "./provider-pocket.js"; -export { QuickNodeProvider } from "./provider-quicknode.js"; -import { IpcSocketProvider } from "./provider-ipcsocket.js"; -export { IpcSocketProvider }; -export { SocketProvider } from "./provider-socket.js"; -export { WebSocketProvider } from "./provider-websocket.js"; -export { SocketSubscriber, SocketBlockSubscriber, SocketPendingSubscriber, SocketEventSubscriber, } from "./provider-socket.js"; -export type { Subscription, Subscriber, AbstractProviderPlugin, PerformActionFilter, PerformActionTransaction, PerformActionRequest, } from "./abstract-provider.js"; -export type { ContractRunner } from "./contracts.js"; -export type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams, } from "./formatting.js"; -export type { Networkish } from "./network.js"; -export type { EnergyCostParameters } from "./plugins-network.js"; -export type { BlockTag, TransactionRequest, PreparedTransactionRequest, EventFilter, Filter, FilterByBlockHash, OrphanFilter, ProviderEvent, TopicFilter, Provider, MinedBlock, MinedTransactionResponse, } from "./provider.js"; -export type { DebugEventBrowserProvider, Eip1193Provider, } from "./provider-browser.js"; -export type { JsonRpcPayload, JsonRpcResult, JsonRpcError, JsonRpcApiProviderOptions, JsonRpcTransactionRequest, } from "./provider-jsonrpc.js"; -export type { WebSocketCreator, WebSocketLike } from "./provider-websocket.js"; -export type { Signer } from "./signer.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/index.d.ts.map b/lib.commonjs/providers/index.d.ts.map deleted file mode 100644 index 25fe43a45..000000000 --- a/lib.commonjs/providers/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAm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BAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,wBAAwB,GACxB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,yBAAyB,EACzB,eAAe,GACf,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE/E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/providers/index.js b/lib.commonjs/providers/index.js deleted file mode 100644 index c2acec377..000000000 --- a/lib.commonjs/providers/index.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -var abstractProvider = require('./abstract-provider.js'); -var abstractSigner = require('./abstract-signer.js'); -var community = require('./community.js'); -var defaultProvider = require('./default-provider.js'); -var network = require('./network.js'); -var signerNoncemanager = require('./signer-noncemanager.js'); -var pluginsNetwork = require('./plugins-network.js'); -var provider = require('./provider.js'); -var providerFallback = require('./provider-fallback.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); -var providerBrowser = require('./provider-browser.js'); -var providerAlchemy = require('./provider-alchemy.js'); -var providerAnkr = require('./provider-ankr.js'); -var providerCloudflare = require('./provider-cloudflare.js'); -var providerInfura = require('./provider-infura.js'); -var providerPocket = require('./provider-pocket.js'); -var providerQuicknode = require('./provider-quicknode.js'); -var providerIpcsocket = require('./provider-ipcsocket.js'); -var providerSocket = require('./provider-socket.js'); -var providerWebsocket = require('./provider-websocket.js'); - - - -exports.AbstractProvider = abstractProvider.AbstractProvider; -exports.UnmanagedSubscriber = abstractProvider.UnmanagedSubscriber; -exports.AbstractSigner = abstractSigner.AbstractSigner; -exports.VoidSigner = abstractSigner.VoidSigner; -exports.showThrottleMessage = community.showThrottleMessage; -exports.getDefaultProvider = defaultProvider.getDefaultProvider; -exports.Network = network.Network; -exports.NonceManager = signerNoncemanager.NonceManager; -exports.EnergyCostPlugin = pluginsNetwork.EnergyCostPlugin; -exports.FeeDataNetworkPlugin = pluginsNetwork.FeeDataNetworkPlugin; -exports.NetworkPlugin = pluginsNetwork.NetworkPlugin; -exports.Block = provider.Block; -exports.FeeData = provider.FeeData; -exports.Log = provider.Log; -exports.TransactionReceipt = provider.TransactionReceipt; -exports.TransactionResponse = provider.TransactionResponse; -exports.copyRequest = provider.copyRequest; -exports.FallbackProvider = providerFallback.FallbackProvider; -exports.JsonRpcApiProvider = providerJsonrpc.JsonRpcApiProvider; -exports.JsonRpcProvider = providerJsonrpc.JsonRpcProvider; -exports.JsonRpcSigner = providerJsonrpc.JsonRpcSigner; -exports.BrowserProvider = providerBrowser.BrowserProvider; -exports.AlchemyProvider = providerAlchemy.AlchemyProvider; -exports.AnkrProvider = providerAnkr.AnkrProvider; -exports.CloudflareProvider = providerCloudflare.CloudflareProvider; -exports.InfuraProvider = providerInfura.InfuraProvider; -exports.InfuraWebSocketProvider = providerInfura.InfuraWebSocketProvider; -exports.PocketProvider = providerPocket.PocketProvider; -exports.QuickNodeProvider = providerQuicknode.QuickNodeProvider; -exports.IpcSocketProvider = providerIpcsocket.IpcSocketProvider; -exports.SocketBlockSubscriber = providerSocket.SocketBlockSubscriber; -exports.SocketEventSubscriber = providerSocket.SocketEventSubscriber; -exports.SocketPendingSubscriber = providerSocket.SocketPendingSubscriber; -exports.SocketProvider = providerSocket.SocketProvider; -exports.SocketSubscriber = providerSocket.SocketSubscriber; -exports.WebSocketProvider = providerWebsocket.WebSocketProvider; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/providers/index.js.map b/lib.commonjs/providers/index.js.map deleted file mode 100644 index 3a027fdd6..000000000 --- a/lib.commonjs/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/network.d.ts b/lib.commonjs/providers/network.d.ts deleted file mode 100644 index eb935dd8b..000000000 --- a/lib.commonjs/providers/network.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import type { BigNumberish } from "../utils/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { NetworkPlugin } from "./plugins-network.js"; -/** - * A Networkish can be used to allude to a Network, by specifing: - * - a [[Network]] object - * - a well-known (or registered) network name - * - a well-known (or registered) chain ID - * - an object with sufficient details to describe a network - */ -export type Networkish = Network | number | bigint | string | { - name?: string; - networkId?: number; - ensAddress?: string; - ensNetwork?: number; -}; -export declare class Network { - #private; - constructor(name: string, networkId: BigNumberish); - toJSON(): any; - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name(): string; - set name(value: string); - /** - * The network chain ID. - */ - get networkId(): bigint; - set networkId(value: BigNumberish); - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other: Networkish): boolean; - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins(): Array; - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin: NetworkPlugin): this; - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name: string): null | T; - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename: string): Array; - /** - * Create a copy of this Network. - */ - clone(): Network; - /** - * Compute the intrinsic energy required for a transaction. - * - * A EnergyCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicEnergy(tx: TransactionLike): number; - /** - * Returns a new Network for the %%network%% name or networkId. - */ - static from(network?: Networkish): Network; - /** - * Register %%nameOrnetworkId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrnetworkId: string | number | bigint, networkFunc: () => Network): void; -} -//# sourceMappingURL=network.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/network.d.ts.map b/lib.commonjs/providers/network.d.ts.map deleted file mode 100644 index 639456c16..000000000 --- a/lib.commonjs/providers/network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GACnB,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN;IACA,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAiBL,qBAAa,OAAO;;IAMnB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAIhD;IAED,MAAM,IAAI,GAAG,CAEZ;IAED;;;;;OAKG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,YAAY,EAEhC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAiClC;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,KAAK,CAAC,aAAa,CAAC,CAElC;IAED;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAMxC;IAED;;;;OAIG;IACH,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,CAAC,CAEzE;IAED;;;OAGG;IACH,UAAU,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EACjD,QAAQ,EAAE,MAAM,GACd,KAAK,CAAC,CAAC,CAAC,CAIV;IAED;;OAEG;IACH,KAAK,IAAI,OAAO,CAMf;IAED;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,EAAE,eAAe,GAAG,MAAM,CAqBlD;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAuDzC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,WAAW,EAAE,MAAM,OAAO,GACxB,IAAI,CAcN;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/network.js b/lib.commonjs/providers/network.js deleted file mode 100644 index a45404fad..000000000 --- a/lib.commonjs/providers/network.js +++ /dev/null @@ -1,261 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -var pluginsNetwork = require('./plugins-network.js'); - -/** - * About networks - * - * @_subsection: api/providers:Networks [networks] - */ -/* * * * -// Networks which operation against an L2 can use this plugin to -// specify how to access L1, for the purpose of resolving ENS, -// for example. -export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; -*/ -// Networks or clients with a higher need for security (such as clients -// that may automatically make CCIP requests without user interaction) -// can use this plugin to anonymize requests or intercept CCIP requests -// to notify and/or receive authorization from the user -const Networks = new Map(); -class Network { - #name; - #networkId; - #plugins; - constructor(name, networkId) { - this.#name = name; - this.#networkId = maths.getBigInt(networkId); - this.#plugins = new Map(); - } - toJSON() { - return { name: this.name, networkId: String(this.networkId) }; - } - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name() { - return this.#name; - } - set name(value) { - this.#name = value; - } - /** - * The network chain ID. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = maths.getBigInt(value, "networkId"); - } - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other) { - if (other == null) { - return false; - } - if (typeof other === "string") { - try { - return this.networkId === maths.getBigInt(other); - } - catch (error) { } - return this.name === other; - } - if (typeof other === "number" || typeof other === "bigint") { - try { - return this.networkId === maths.getBigInt(other); - } - catch (error) { } - return false; - } - if (typeof other === "object") { - if (other.networkId != null) { - try { - return this.networkId === maths.getBigInt(other.networkId); - } - catch (error) { } - return false; - } - if (other.name != null) { - return this.name === other.name; - } - return false; - } - return false; - } - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name) { - return this.#plugins.get(name) || null; - } - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename) { - return (this.plugins.filter((p) => p.name.split("#")[0] === basename)); - } - /** - * Create a copy of this Network. - */ - clone() { - const clone = new Network(this.name, this.networkId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - /** - * Compute the intrinsic energy required for a transaction. - * - * A EnergyCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicEnergy(tx) { - const costs = this.getPlugin("org.corebc.plugins.network.EnergyCost") || new pluginsNetwork.EnergyCostPlugin(); - let energy = costs.txBase; - if (tx.to == null) { - energy += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - energy += costs.txDataZero; - } - else { - energy += costs.txDataNonzero; - } - } - } - return energy; - } - /** - * Returns a new Network for the %%network%% name or networkId. - */ - static from(network) { - injectCommonNetworks(); - // Default network - if (network == null) { - return Network.from("mainnet"); - } - // Canonical name or chain ID - if (typeof network === "number") { - network = BigInt(network); - } - if (typeof network === "string" || typeof network === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof network === "bigint") { - return new Network("unknown", network); - } - errors.assertArgument(false, "unknown network", "network", network); - } - // Clonable with network-like abilities - if (typeof network.clone === "function") { - const clone = network.clone(); - //if (typeof(network.name) !== "string" || typeof(network.networkId) !== "number") { - //} - return clone; - } - // Networkish - if (typeof network === "object") { - errors.assertArgument(typeof network.name === "string" && - typeof network.networkId === "number", "invalid network object name or networkId", "network", network); - const custom = new Network(network.name, network.networkId); - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - return custom; - } - errors.assertArgument(false, "invalid network", "network", network); - } - /** - * Register %%nameOrnetworkId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrnetworkId, networkFunc) { - if (typeof nameOrnetworkId === "number") { - nameOrnetworkId = BigInt(nameOrnetworkId); - } - const existing = Networks.get(nameOrnetworkId); - if (existing) { - errors.assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrnetworkId", nameOrnetworkId); - } - Networks.set(nameOrnetworkId, networkFunc); - } -} -// See: https://chainlist.org -let injected = false; -function injectCommonNetworks() { - if (injected) { - return; - } - injected = true; - /// Register popular Core networks - function registerEth(name, networkId, options) { - const func = function () { - const network = new Network(name, networkId); - network.attachPlugin(new pluginsNetwork.EnergyCostPlugin()); - return network; - }; - // Register the network by name and chain ID - Network.register(name, func); - Network.register(networkId, func); - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - registerEth("mainnet", 1, { altNames: ["homestead"] }); - registerEth("ropsten", 3, { }); - registerEth("rinkeby", 4, { }); - registerEth("goerli", 5, { }); - registerEth("kovan", 42, { }); - registerEth("sepolia", 11155111, {}); - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - registerEth("xdai", 100, { }); -} - -exports.Network = Network; -//# sourceMappingURL=network.js.map diff --git a/lib.commonjs/providers/network.js.map b/lib.commonjs/providers/network.js.map deleted file mode 100644 index 1c247bfde..000000000 --- a/lib.commonjs/providers/network.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"network.js","sources":["../../lib.esm/providers/network.js"],"sourcesContent":["/**\n * About networks\n *\n * @_subsection: api/providers:Networks [networks]\n */\nimport { getBigInt, assertArgument } from \"../utils/index.js\";\nimport { EnergyCostPlugin } from \"./plugins-network.js\";\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*/\n// Networks or clients with a higher need for security (such as clients\n// that may automatically make CCIP requests without user interaction)\n// can use this plugin to anonymize requests or intercept CCIP requests\n// to notify and/or receive authorization from the user\nconst Networks = new Map();\nexport class Network {\n #name;\n #networkId;\n #plugins;\n constructor(name, networkId) {\n this.#name = name;\n this.#networkId = getBigInt(networkId);\n this.#plugins = new Map();\n }\n toJSON() {\n return { name: this.name, networkId: String(this.networkId) };\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() {\n return this.#name;\n }\n set name(value) {\n this.#name = value;\n }\n /**\n * The network chain ID.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value, \"networkId\");\n }\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.networkId === 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.networkId === getBigInt(other);\n }\n catch (error) { }\n return false;\n }\n if (typeof other === \"object\") {\n if (other.networkId != null) {\n try {\n return this.networkId === getBigInt(other.networkId);\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.networkId);\n this.plugins.forEach((plugin) => {\n clone.attachPlugin(plugin.clone());\n });\n return clone;\n }\n /**\n * Compute the intrinsic energy required for a transaction.\n *\n * A EnergyCostPlugin can be attached to override the default\n * values.\n */\n computeIntrinsicEnergy(tx) {\n const costs = this.getPlugin(\"org.corebc.plugins.network.EnergyCost\") || new EnergyCostPlugin();\n let energy = costs.txBase;\n if (tx.to == null) {\n energy += 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 energy += costs.txDataZero;\n }\n else {\n energy += costs.txDataNonzero;\n }\n }\n }\n return energy;\n }\n /**\n * Returns a new Network for the %%network%% name or networkId.\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.networkId) !== \"number\") {\n //}\n return clone;\n }\n // Networkish\n if (typeof network === \"object\") {\n assertArgument(typeof network.name === \"string\" &&\n typeof network.networkId === \"number\", \"invalid network object name or networkId\", \"network\", network);\n const custom = new Network(network.name, network.networkId);\n //if ((network).layerOneConnection) {\n // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection));\n //}\n return custom;\n }\n assertArgument(false, \"invalid network\", \"network\", network);\n }\n /**\n * Register %%nameOrnetworkId%% with a function which returns\n * an instance of a Network representing that chain.\n */\n static register(nameOrnetworkId, networkFunc) {\n if (typeof nameOrnetworkId === \"number\") {\n nameOrnetworkId = BigInt(nameOrnetworkId);\n }\n const existing = Networks.get(nameOrnetworkId);\n if (existing) {\n assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, \"nameOrnetworkId\", nameOrnetworkId);\n }\n Networks.set(nameOrnetworkId, networkFunc);\n }\n}\n// See: https://chainlist.org\nlet injected = false;\nfunction injectCommonNetworks() {\n if (injected) {\n return;\n }\n injected = true;\n /// Register popular Core networks\n function registerEth(name, networkId, options) {\n const func = function () {\n const network = new Network(name, networkId);\n network.attachPlugin(new EnergyCostPlugin());\n return network;\n };\n // Register the network by name and chain ID\n Network.register(name, func);\n Network.register(networkId, func);\n if (options.altNames) {\n options.altNames.forEach((name) => {\n Network.register(name, func);\n });\n }\n }\n registerEth(\"mainnet\", 1, { ensNetwork: 1, altNames: [\"homestead\"] });\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 registerEth(\"classic\", 61, {});\n registerEth(\"classicKotti\", 6, {});\n registerEth(\"xdai\", 100, { ensNetwork: 1 });\n}\n//# sourceMappingURL=network.js.map"],"names":["getBigInt","EnergyCostPlugin","assertArgument"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAE;AACnB,MAAM,OAAO,CAAC;AACrB,IAAI,KAAK;AACT,IAAI,UAAU;AACd,IAAI,QAAQ;AACZ,IAAI,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE;AACjC,QAAQ,IAAI,CAAC,KAAK,GAAG,IAAI;AACzB,QAAQ,IAAI,CAAC,UAAU,GAAGA,eAAS,CAAC,SAAS,CAAC;AAC9C,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE;AACjC,IAAI;AACJ,IAAI,MAAM,GAAG;AACb,QAAQ,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;AACrE,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,IAAI,GAAG;AACf,QAAQ,OAAO,IAAI,CAAC,KAAK;AACzB,IAAI;AACJ,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;AACpB,QAAQ,IAAI,CAAC,KAAK,G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AACJ,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC,EAAE,EAAiB,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;AACzE,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC,EAAE,EAAgB,CAAC,CAAC;AAChD,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC,EAAE,EAAgB,CAAC,CAAC;AAChD,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAgB,CAAC,CAAC;AAC/C,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAiB,CAAC,CAAC;AAChD,IAAI,WAAW,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AACxC,IAAI,WAAW,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC;AAClC,IAAI,WAAW,CAAC,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC;AACtC,IAAI,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,EAAgB,CAAC,CAAC;AAC/C;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/pagination.d.ts b/lib.commonjs/providers/pagination.d.ts deleted file mode 100644 index a772a85c2..000000000 --- a/lib.commonjs/providers/pagination.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface PaginationResult extends Array { - next(): Promise>; - totalResults: null | number; - done: boolean; -} -//# sourceMappingURL=pagination.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/pagination.d.ts.map b/lib.commonjs/providers/pagination.d.ts.map deleted file mode 100644 index 8ff265391..000000000 --- a/lib.commonjs/providers/pagination.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACpD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACd"} \ No newline at end of file diff --git a/lib.commonjs/providers/pagination.js b/lib.commonjs/providers/pagination.js deleted file mode 100644 index 147dfd614..000000000 --- a/lib.commonjs/providers/pagination.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=pagination.js.map diff --git a/lib.commonjs/providers/pagination.js.map b/lib.commonjs/providers/pagination.js.map deleted file mode 100644 index baaa1402a..000000000 --- a/lib.commonjs/providers/pagination.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/providers/plugin-fallback.d.ts b/lib.commonjs/providers/plugin-fallback.d.ts deleted file mode 100644 index 10009e4b3..000000000 --- a/lib.commonjs/providers/plugin-fallback.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AbstractProviderPlugin } from "./abstract-provider.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -export declare const PluginIdFallbackProvider = "org.corebc.plugins.provider.QualifiedPlugin"; -export declare class CheckQualifiedPlugin implements AbstractProviderPlugin { - name: string; - constructor(); - connect(provider: AbstractProvider): CheckQualifiedPlugin; - isQualified(action: PerformActionRequest, result: any): boolean; -} -export declare class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action: PerformActionRequest, result: any): boolean; -} -//# sourceMappingURL=plugin-fallback.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/plugin-fallback.d.ts.map b/lib.commonjs/providers/plugin-fallback.d.ts.map deleted file mode 100644 index d639bafb3..000000000 --- a/lib.commonjs/providers/plugin-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,wBAAwB,gDACS,CAAC;AAE/C,qBAAa,oBAAqB,YAAW,sBAAsB;IAC1D,IAAI,EAAE,MAAM,CAAC;IAErB,cAIC;IAED,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB,CAExD;IAID,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAE9D;CACD;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACxE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAU9D;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/plugin-fallback.js b/lib.commonjs/providers/plugin-fallback.js deleted file mode 100644 index ce1487ef2..000000000 --- a/lib.commonjs/providers/plugin-fallback.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -const PluginIdFallbackProvider = "org.corebc.plugins.provider.QualifiedPlugin"; -class CheckQualifiedPlugin { - constructor() { - properties.defineProperties(this, { - name: PluginIdFallbackProvider, - }); - } - connect(provider) { - return this; - } - // Retruns true if this value should be considered qualified for - // inclusion in the quorum. - isQualified(action, result) { - return true; - } -} -class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action, result) { - if (action.method === "getTransaction" || - action.method === "getTransactionReceipt") { - if (result == null) { - return false; - } - } - return super.isQualified(action, result); - } -} - -exports.CheckQualifiedPlugin = CheckQualifiedPlugin; -exports.PluginIdFallbackProvider = PluginIdFallbackProvider; -exports.PossiblyPrunedTransactionPlugin = PossiblyPrunedTransactionPlugin; -//# sourceMappingURL=plugin-fallback.js.map diff --git a/lib.commonjs/providers/plugin-fallback.js.map b/lib.commonjs/providers/plugin-fallback.js.map deleted file mode 100644 index d33011698..000000000 --- a/lib.commonjs/providers/plugin-fallback.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugin-fallback.js","sources":["../../lib.esm/providers/plugin-fallback.js"],"sourcesContent":["import { defineProperties } from \"../utils/index.js\";\nexport const PluginIdFallbackProvider = \"org.corebc.plugins.provider.QualifiedPlugin\";\nexport class CheckQualifiedPlugin {\n constructor() {\n defineProperties(this, {\n name: PluginIdFallbackProvider,\n });\n }\n connect(provider) {\n return this;\n }\n // Retruns true if this value should be considered qualified for\n // inclusion in the quorum.\n isQualified(action, result) {\n return true;\n }\n}\nexport class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin {\n isQualified(action, result) {\n if (action.method === \"getTransaction\" ||\n action.method === \"getTransactionReceipt\") {\n if (result == null) {\n return false;\n }\n }\n return super.isQualified(action, result);\n }\n}\n//# sourceMappingURL=plugin-fallback.js.map"],"names":["defineProperties"],"mappings":";;;;;;;;;;;;AACY,MAAC,wBAAwB,GAAG;AACjC,MAAM,oBAAoB,CAAC;AAClC,IAAI,WAAW,GAAG;AAClB,QAAQA,2BAAgB,CAAC,IAAI,EAAE;AAC/B,YAAY,IAAI,EAAE,wBAAwB;AAC1C,SAAS,CAAC;AACV,IAAI;AACJ,IAAI,OAAO,CAAC,QAAQ,EAAE;AACtB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE;AAChC,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ;AACO,MAAM,+BAA+B,SAAS,oBAAoB,CAAC;AAC1E,IAAI,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE;AAChC,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,gBAAgB;AAC9C,YAAY,MAAM,CAAC,MAAM,KAAK,uBAAuB,EAAE;AACvD,YAAY,IAAI,MAAM,IAAI,IAAI,EAAE;AAChC,gBAAgB,OAAO,KAAK;AAC5B,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC;AAChD,IAAI;AACJ;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/plugins-network.d.ts b/lib.commonjs/providers/plugins-network.d.ts deleted file mode 100644 index 80364b3ad..000000000 --- a/lib.commonjs/providers/plugins-network.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { FeeData, Provider } from "./provider.js"; -export declare class NetworkPlugin { - readonly name: string; - constructor(name: string); - clone(): NetworkPlugin; -} -export type EnergyCostParameters = { - txBase?: number; - txCreate?: number; - txDataZero?: number; - txDataNonzero?: number; - txAccessListStorageKey?: number; - txAccessListAddress?: number; -}; -export declare class EnergyCostPlugin extends NetworkPlugin implements EnergyCostParameters { - readonly effectiveBlock: number; - readonly txBase: number; - readonly txCreate: number; - readonly txDataZero: number; - readonly txDataNonzero: number; - readonly txAccessListStorageKey: number; - readonly txAccessListAddress: number; - constructor(effectiveBlock?: number, costs?: EnergyCostParameters); - clone(): EnergyCostPlugin; -} -export declare class FeeDataNetworkPlugin extends NetworkPlugin { - #private; - get feeDataFunc(): (provider: Provider) => Promise; - constructor(feeDataFunc: (provider: Provider) => Promise); - getFeeData(provider: Provider): Promise; - clone(): FeeDataNetworkPlugin; -} -//# sourceMappingURL=plugins-network.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/plugins-network.d.ts.map b/lib.commonjs/providers/plugins-network.d.ts.map deleted file mode 100644 index bcea34835..000000000 --- a/lib.commonjs/providers/plugins-network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugins-network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvD,q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network.js b/lib.commonjs/providers/plugins-network.js deleted file mode 100644 index 388c0ec26..000000000 --- a/lib.commonjs/providers/plugins-network.js +++ /dev/null @@ -1,94 +0,0 @@ -'use strict'; - -var properties = require('../utils/properties.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -class NetworkPlugin { - name; - constructor(name) { - properties.defineProperties(this, { name }); - } - clone() { - return new NetworkPlugin(this.name); - } -} -class EnergyCostPlugin extends NetworkPlugin { - effectiveBlock; - txBase; - txCreate; - txDataZero; - txDataNonzero; - txAccessListStorageKey; - txAccessListAddress; - constructor(effectiveBlock, costs) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock || 0}`); - const props = { effectiveBlock }; - function set(name, nullish) { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - errors.assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs); - props[name] = value; - } - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - properties.defineProperties(this, props); - } - clone() { - return new EnergyCostPlugin(this.effectiveBlock, this); - } -} -class FeeDataNetworkPlugin extends NetworkPlugin { - #feeDataFunc; - get feeDataFunc() { - return this.#feeDataFunc; - } - constructor(feeDataFunc) { - super("org.corebc.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - async getFeeData(provider) { - return await this.#feeDataFunc(provider); - } - clone() { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } -} -/* -export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } -} -*/ - -exports.EnergyCostPlugin = EnergyCostPlugin; -exports.FeeDataNetworkPlugin = FeeDataNetworkPlugin; -exports.NetworkPlugin = NetworkPlugin; -//# sourceMappingURL=plugins-network.js.map diff --git a/lib.commonjs/providers/plugins-network.js.map b/lib.commonjs/providers/plugins-network.js.map deleted file mode 100644 index 1a683d59e..000000000 --- a/lib.commonjs/providers/plugins-network.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugins-network.js","sources":["../../lib.esm/providers/plugins-network.js"],"sourcesContent":["import { defineProperties } from \"../utils/properties.js\";\nimport { assertArgument } from \"../utils/index.js\";\nexport class NetworkPlugin {\n name;\n constructor(name) {\n defineProperties(this, { name });\n }\n clone() {\n return new NetworkPlugin(this.name);\n }\n}\nexport class EnergyCostPlugin extends NetworkPlugin {\n effectiveBlock;\n txBase;\n txCreate;\n txDataZero;\n txDataNonzero;\n txAccessListStorageKey;\n txAccessListAddress;\n constructor(effectiveBlock, costs) {\n if (effectiveBlock == null) {\n effectiveBlock = 0;\n }\n super(`org.corebc.network.plugins.EnergyCost#${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 clone() {\n return new EnergyCostPlugin(this.effectiveBlock, this);\n }\n}\nexport class FeeDataNetworkPlugin extends NetworkPlugin {\n #feeDataFunc;\n get feeDataFunc() {\n return this.#feeDataFunc;\n }\n constructor(feeDataFunc) {\n super(\"org.corebc.plugins.network.FeeData\");\n this.#feeDataFunc = feeDataFunc;\n }\n async getFeeData(provider) {\n return await this.#feeDataFunc(provider);\n }\n clone() {\n return new FeeDataNetworkPlugin(this.#feeDataFunc);\n }\n}\n/*\nexport class CustomBlockNetworkPlugin extends NetworkPlugin {\n readonly #blockFunc: (provider: Provider, block: BlockParams) => Block;\n readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block;\n\n async getBlock(provider: Provider, block: BlockParams): Promise> {\n return await this.#blockFunc(provider, block);\n }\n\n async getBlockions(provider: Provider, block: BlockParams): Promise> {\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"],"names":["defineProperties","assertArgument"],"mappings":";;;;;;;;;;;;AAEO,MAAM,aAAa,CAAC;AAC3B,IAAI,IAAI;AACR,IAAI,WAAW,CAAC,IAAI,EAAE;AACtB,QAAQA,2BAAgB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;AACxC,IAAI;AACJ,IAAI,KAAK,GAAG;AACZ,QAAQ,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;AAC3C,IAAI;AACJ;AACO,MAAM,gBAAgB,SAAS,aAAa,CAAC;AACpD,IAAI,cAAc;AAClB,IAAI,MAAM;AACV,IAAI,QAAQ;AACZ,IAAI,UAAU;AACd,IAAI,aAAa;AACjB,IAAI,sBAAsB;AAC1B,IAAI,mBAAmB;AACvB,IAAI,WAAW,CAAC,cAAc,EAAE,KAAK,EAAE;AACvC,QAAQ,IAAI,cAAc,IAAI,IAAI,EAAE;AACpC,YAAY,cAAc,GAAG,CAAC;AAC9B,QAAQ;AACR,QAAQ,KAAK,CAAC,CAAC,sCAAsC,EAAE,cAAc,IAAI,CAAC,CAAC,CAAC,CAAC;AAC7E,QAAQ,MAAM,KA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;AAC/B,QAAQ,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;AAChD,IAAI;AACJ,IAAI,KAAK,GAAG;AACZ,QAAQ,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC;AAC1D,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-alchemy.d.ts b/lib.commonjs/providers/provider-alchemy.d.ts deleted file mode 100644 index 17af0df46..000000000 --- a/lib.commonjs/providers/provider-alchemy.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * About Alchemy - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -export declare class AlchemyProvider extends JsonRpcProvider implements CommunityResourcable { - readonly apiKey: string; - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(networkId: number): AbstractProvider; - _perform(req: PerformActionRequest): Promise; - isCommunityResource(): boolean; - static getRequest(network: Network, apiKey?: string): FetchRequest; -} -//# sourceMappingURL=provider-alchemy.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-alchemy.d.ts.map b/lib.commonjs/providers/provider-alchemy.d.ts.map deleted file mode 100644 index 4e4c121cd..000000000 --- a/lib.commonjs/providers/provider-alchemy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKN,YAAY,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;;;GAUG;AACH,qBAAa,eACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAaxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAEK,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,CAyCtD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAkBjE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-alchemy.js b/lib.commonjs/providers/provider-alchemy.js deleted file mode 100644 index aaafca3be..000000000 --- a/lib.commonjs/providers/provider-alchemy.js +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -var fetch = require('../utils/fetch.js'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var community = require('./community.js'); -var network = require('./network.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); - -/** - * About Alchemy - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.alchemyapi.io"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - } - errors.assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -class AlchemyProvider extends providerJsonrpc.JsonRpcProvider { - apiKey; - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network$1 = network.Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = AlchemyProvider.getRequest(network$1, apiKey); - super(request, network$1, { staticNetwork: network$1 }); - properties.defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AlchemyProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - async _perform(req) { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await properties.resolveProperties({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash), - }); - if (trace == null || tx == null) { - return null; - } - let data; - let error = false; - try { - data = trace[0].result.output; - error = trace[0].error === "Reverted"; - } - catch (error) { } - if (data) { - errors.assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null, // @TODO - }); - return data; - } - errors.assert(false, "could not parse trace result", "BAD_DATA", { - value: trace, - }); - } - return await super._perform(req); - } - isCommunityResource() { - return this.apiKey === defaultApiKey; - } - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/v2/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - community.showThrottleMessage("alchemy"); - return true; - }; - } - return request; - } -} - -exports.AlchemyProvider = AlchemyProvider; -//# sourceMappingURL=provider-alchemy.js.map diff --git a/lib.commonjs/providers/provider-alchemy.js.map b/lib.commonjs/providers/provider-alchemy.js.map deleted file mode 100644 index 90267243c..000000000 --- a/lib.commonjs/providers/provider-alchemy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-alchemy.js","sources":["../../lib.esm/providers/provider-alchemy.js"],"sourcesContent":["/**\n * About Alchemy\n *\n * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy]\n */\nimport { defineProperties, resolveProperties, assert, assertArgument, FetchRequest, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.alchemyapi.io\";\n case \"goerli\":\n return \"eth-goerli.g.alchemy.com\";\n case \"sepolia\":\n return \"eth-sepolia.g.alchemy.com\";\n case \"arbitrum\":\n return \"arb-mainnet.g.alchemy.com\";\n case \"arbitrum-goerli\":\n return \"arb-goerli.g.alchemy.com\";\n case \"matic\":\n return \"polygon-mainnet.g.alchemy.com\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.g.alchemy.com\";\n case \"optimism\":\n return \"opt-mainnet.g.alchemy.com\";\n case \"optimism-goerli\":\n return \"opt-goerli.g.alchemy.com\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AlchemyProvider** connects to the [[link-alchemy]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-alchemy-signup).\n *\n * @_docloc: api/providers/thirdparty\n */\nexport class AlchemyProvider extends JsonRpcProvider {\n apiKey;\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = AlchemyProvider.getRequest(network, apiKey);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AlchemyProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n async _perform(req) {\n // https://docs.alchemy.com/reference/trace-transaction\n if (req.method === \"getTransactionResult\") {\n const { trace, tx } = await resolveProperties({\n trace: this.send(\"trace_transaction\", [req.hash]),\n tx: this.getTransaction(req.hash),\n });\n if (trace == null || tx == null) {\n return null;\n }\n let data;\n let error = false;\n try {\n data = trace[0].result.output;\n error = trace[0].error === \"Reverted\";\n }\n catch (error) { }\n if (data) {\n assert(!error, \"an error occurred during transaction executions\", \"CALL_EXCEPTION\", {\n action: \"getTransactionResult\",\n data,\n reason: null,\n transaction: tx,\n invocation: null,\n revert: null, // @TODO\n });\n return data;\n }\n assert(false, \"could not parse trace result\", \"BAD_DATA\", {\n value: trace,\n });\n }\n return await super._perform(req);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v2/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"alchemy\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-alchemy.js.map"],"names":["assertArgument","JsonRpcProvider","network","Network","defineProperties","resolveProperties","assert","FetchRequest","showThrottleMessage"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAKA,MAAM,aAAa,GAAG,kCAAkC;AACxD,SAAS,OAAO,CAAC,IAAI,EAAE;AACvB,IAAI,QAAQ,IAAI;AAChB,QAAQ,KAAK,SAAS;AACtB,YAAY,OAAO,2BAA2B;AAC9C,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAO,0BAA0B;AAC7C,QAAQ,KAAK,SAAS;AACtB,YAAY,OAAO,2BAA2B;AAC9C,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAO,2BAA2B;AAC9C,QAAQ,KAAK,iBAAiB;AAC9B,YAAY,OAAO,0BAA0B;AAC7C,QAAQ,KAAK,OAAO;AACpB,YAAY,OAAO,+BAA+B;AAClD,QAAQ,KAAK,cAAc;AAC3B,YAAY,OAAO,8BAA8B;AACjD,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAO,2BAA2B;AAC9C,QAAQ,KAAK,iBAAiB;AAC9B,YAAY,OAAO,0BAA0B;AAC7C;AACA,IAAIA,qBAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,eAAe,SAASC,+BAAe,CAAC;AACrD,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE;AAClC,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,SAAS;AAChC,QAAQ;AACR,QAAQ,MAAMC,SAAO,GAAGC,eAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC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C,SAAS,CAAC;AAC9C,gBAAgB,OAAO,IAAI;AAC3B,YAAY,CAAC;AACb,QAAQ;AACR,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ankr.d.ts b/lib.commonjs/providers/provider-ankr.d.ts deleted file mode 100644 index 77af5a3a0..000000000 --- a/lib.commonjs/providers/provider-ankr.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -import type { JsonRpcError, JsonRpcPayload } from "./provider-jsonrpc.js"; -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -export declare class AnkrProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key for the Ankr connection. - */ - readonly apiKey: string; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(networkId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-ankr.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ankr.d.ts.map b/lib.commonjs/providers/provider-ankr.d.ts.map deleted file mode 100644 index d0704e281..000000000 --- a/lib.commonjs/providers/provider-ankr.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoB1E;;;;;;;;GAQG;AACH,qBAAa,YACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAgBxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAkBxE;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAY/D;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ankr.js b/lib.commonjs/providers/provider-ankr.js deleted file mode 100644 index f1823acf4..000000000 --- a/lib.commonjs/providers/provider-ankr.js +++ /dev/null @@ -1,116 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -var fetch = require('../utils/fetch.js'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var community = require('./community.js'); -var network = require('./network.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); - -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -const defaultApiKey = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; -function getHost(name) { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/xcb_goerli"; - case "matic": - return "rpc.ankr.com/polygon"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - } - errors.assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -class AnkrProvider extends providerJsonrpc.JsonRpcProvider { - /** - * The API key for the Ankr connection. - */ - apiKey; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network$1 = network.Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network$1 }; - const request = AnkrProvider.getRequest(network$1, apiKey); - super(request, network$1, options); - properties.defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AnkrProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - community.showThrottleMessage("AnkrProvider"); - return true; - }; - } - return request; - } - getRpcError(payload, error) { - if (payload.method === "xcb_sendRawTransaction") { - if (error && - error.error && - error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - return super.getRpcError(payload, error); - } - isCommunityResource() { - return this.apiKey === defaultApiKey; - } -} - -exports.AnkrProvider = AnkrProvider; -//# sourceMappingURL=provider-ankr.js.map diff --git a/lib.commonjs/providers/provider-ankr.js.map b/lib.commonjs/providers/provider-ankr.js.map deleted file mode 100644 index e22badaaf..000000000 --- a/lib.commonjs/providers/provider-ankr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ankr.js","sources":["../../lib.esm/providers/provider-ankr.js"],"sourcesContent":["/**\n * [[link-ankr]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Ankr [providers-ankr]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApiKey = \"9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"rpc.ankr.com/eth\";\n case \"goerli\":\n return \"rpc.ankr.com/xcb_goerli\";\n case \"matic\":\n return \"rpc.ankr.com/polygon\";\n case \"arbitrum\":\n return \"rpc.ankr.com/arbitrum\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **AnkrProvider** connects to the [[link-ankr]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-ankr-signup).\n */\nexport class AnkrProvider extends JsonRpcProvider {\n /**\n * The API key for the Ankr connection.\n */\n apiKey;\n /**\n * Create a new **AnkrProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, apiKey) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n // Ankr does not support filterId, so we force polling\n const options = { polling: true, staticNetwork: network };\n const request = AnkrProvider.getRequest(network, apiKey);\n super(request, network, options);\n defineProperties(this, { apiKey });\n }\n _getProvider(networkId) {\n try {\n return new AnkrProvider(networkId, this.apiKey);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%apiKey%%.\n */\n static getRequest(network, apiKey) {\n if (apiKey == null) {\n apiKey = defaultApiKey;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${apiKey}`);\n request.allowGzip = true;\n if (apiKey === defaultApiKey) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"AnkrProvider\");\n return true;\n };\n }\n return request;\n }\n getRpcError(payload, error) {\n if (payload.method === \"xcb_sendRawTransaction\") {\n if (error &&\n error.error &&\n error.error.message === \"INTERNAL_ERROR: could not replace existing tx\") {\n error.error.message = \"replacement transaction underpriced\";\n }\n }\n return super.getRpcError(payload, error);\n }\n isCommunityResource() {\n return this.apiKey === defaultApiKey;\n }\n}\n//# sourceMappingURL=provider-ankr.js.map"],"names":["assertArgument","JsonRpcProvider","network","Network","defineProperties","FetchRequest","showTh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,CAAC;AAChD,IAAI;AACJ,IAAI,mBAAmB,GAAG;AAC1B,QAAQ,OAAO,IAAI,CAAC,MAAM,KAAK,aAAa;AAC5C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-browser.d.ts b/lib.commonjs/providers/provider-browser.d.ts deleted file mode 100644 index 2e917663a..000000000 --- a/lib.commonjs/providers/provider-browser.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js"; -import type { JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcSigner } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -export interface Eip1193Provider { - request(request: { - method: string; - params?: Array | Record; - }): Promise; -} -export type DebugEventBrowserProvider = { - action: "sendEip1193Payload"; - payload: { - method: string; - params: Array; - }; -} | { - action: "receiveEip1193Result"; - result: any; -} | { - action: "receiveEip1193Error"; - error: Error; -}; -export declare class BrowserProvider extends JsonRpcApiPollingProvider { - #private; - constructor(core: Eip1193Provider, network?: Networkish); - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - hasSigner(address: number | string): Promise; - getSigner(address?: number | string): Promise; -} -//# sourceMappingURL=provider-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-browser.d.ts.map b/lib.commonjs/providers/provider-browser.d.ts.map deleted file mode 100644 index 890c4678c..000000000 --- a/lib.commonjs/providers/provider-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE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CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-browser.js b/lib.commonjs/providers/provider-browser.js deleted file mode 100644 index dd5b61b7d..000000000 --- a/lib.commonjs/providers/provider-browser.js +++ /dev/null @@ -1,99 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); - -class BrowserProvider extends providerJsonrpc.JsonRpcApiPollingProvider { - #request; - constructor(core, network) { - super(network, { batchMaxCount: 1 }); - this.#request = async (method, params) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await core.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } - catch (e) { - const error = new Error(e.message); - error.code = e.code; - error.data = e.data; - error.payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - async send(method, params) { - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - errors.assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } - catch (e) { - return [ - { - id: payload.id, - error: { code: e.code, data: e.data, message: e.message }, - }, - ]; - } - } - getRpcError(payload, error) { - error = JSON.parse(JSON.stringify(error)); - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into - switch (error.error.code || -1) { - case 4001: - error.error.message = `corebc-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `corebc-unsupported: ${error.error.message}`; - break; - } - return super.getRpcError(payload, error); - } - async hasSigner(address) { - if (address == null) { - address = 0; - } - const accounts = await this.send("xcb_accounts", []); - if (typeof address === "number") { - return accounts.length > address; - } - address = address.toLowerCase(); - return (accounts.filter((a) => a.toLowerCase() === address).length !== 0); - } - async getSigner(address) { - if (address == null) { - address = 0; - } - if (!(await this.hasSigner(address))) { - try { - //const resp = - await this.#request("xcb_requestAccounts", []); - //console.log("RESP", resp); - } - catch (error) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - return await super.getSigner(address); - } -} - -exports.BrowserProvider = BrowserProvider; -//# sourceMappingURL=provider-browser.js.map diff --git a/lib.commonjs/providers/provider-browser.js.map b/lib.commonjs/providers/provider-browser.js.map deleted file mode 100644 index 41f6c99c0..000000000 --- a/lib.commonjs/providers/provider-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-browser.js","sources":["../../lib.esm/providers/provider-browser.js"],"sourcesContent":["import { assertArgument } from \"../utils/index.js\";\nimport { JsonRpcApiPollingProvider } from \"./provider-jsonrpc.js\";\nexport class BrowserProvider extends JsonRpcApiPollingProvider {\n #request;\n constructor(core, network) {\n super(network, { batchMaxCount: 1 });\n this.#request = async (method, params) => {\n const payload = { method, params };\n this.emit(\"debug\", { action: \"sendEip1193Request\", payload });\n try {\n const result = await core.request(payload);\n this.emit(\"debug\", { action: \"receiveEip1193Result\", result });\n return result;\n }\n catch (e) {\n const error = new Error(e.message);\n error.code = e.code;\n error.data = e.data;\n error.payload = payload;\n this.emit(\"debug\", { action: \"receiveEip1193Error\", error });\n throw error;\n }\n };\n }\n async send(method, params) {\n await this._start();\n return await super.send(method, params);\n }\n async _send(payload) {\n assertArgument(!Array.isArray(payload), \"EIP-1193 does not support batch request\", \"payload\", payload);\n try {\n const result = await this.#request(payload.method, payload.params || []);\n return [{ id: payload.id, result }];\n }\n catch (e) {\n return [\n {\n id: payload.id,\n error: { code: e.code, data: e.data, message: e.message },\n },\n ];\n }\n }\n getRpcError(payload, error) {\n error = JSON.parse(JSON.stringify(error));\n // EIP-1193 gives us some machine-readable error codes, so rewrite\n // them into\n switch (error.error.code || -1) {\n case 4001:\n error.error.message = `corebc-user-denied: ${error.error.message}`;\n break;\n case 4200:\n error.error.message = `corebc-unsupported: ${error.error.message}`;\n break;\n }\n return super.getRpcError(payload, error);\n }\n async hasSigner(address) {\n if (address == null) {\n address = 0;\n }\n const accounts = await this.send(\"xcb_accounts\", []);\n if (typeof address === \"number\") {\n return accounts.length > address;\n }\n address = address.toLowerCase();\n return (accounts.filter((a) => a.toLowerCase() === address).length !== 0);\n }\n async getSigner(address) {\n if (address == null) {\n address = 0;\n }\n if (!(await this.hasSigner(address))) {\n try {\n //const resp =\n await this.#request(\"xcb_requestAccounts\", []);\n //console.log(\"RESP\", resp);\n }\n catch (error) {\n const payload = error.payload;\n throw this.getRpcError(payload, { id: payload.id, error });\n }\n }\n return await super.getSigner(address);\n }\n}\n//# sourceMappingURL=provider-browser.js.map"],"names":["JsonRpcApiPollingProvider","assertArgument"],"mappings":";;;;;;;;;;;;AAEO,MAAM,eAAe,SAASA,yCAAyB,CAAC;AAC/D,IAAI,QAAQ;AACZ,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE;AAC/B,QAAQ,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;AAC5C,QAAQ,IAAI,CAAC,QAAQ,GAAG,OAAO,MAAM,EAAE,MAAM,KAAK;AAClD,YAAY,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;AAC9C,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC;AACzE,YAAY,IAAI;AAChB,gBAAgB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;AAC1D,gBAAgB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,CAAC;AAC9E,gBAAgB,OAAO,MAAM;AAC7B,YAAY;AACZ,YAAY,OAAO,CAAC,EAAE;AACtB,gBAAgB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;AAClD,gBAAgB,KAAK,CAAC,IAAI,GAAG,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C,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;AAC9C,YAAY,IAAI;AAChB;AACA,gBAAgB,MAAM,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,CAAC;AAC9D;AACA,YAAY;AACZ,YAAY,OAAO,KAAK,EAAE;AAC1B,gBAAgB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO;AAC7C,gBAAgB,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC;AAC1E,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;AAC7C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-cloudflare.d.ts b/lib.commonjs/providers/provider-cloudflare.d.ts deleted file mode 100644 index 869651f44..000000000 --- a/lib.commonjs/providers/provider-cloudflare.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * About Cloudflare... - */ -export declare class CloudflareProvider extends JsonRpcProvider { - constructor(_network?: Networkish); -} -//# sourceMappingURL=provider-cloudflare.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-cloudflare.d.ts.map b/lib.commonjs/providers/provider-cloudflare.d.ts.map deleted file mode 100644 index 8dbb47f78..000000000 --- a/lib.commonjs/providers/provider-cloudflare.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACtD,YAAY,QAAQ,CAAC,EAAE,UAAU,EAYhC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-cloudflare.js b/lib.commonjs/providers/provider-cloudflare.js deleted file mode 100644 index eeee0f71a..000000000 --- a/lib.commonjs/providers/provider-cloudflare.js +++ /dev/null @@ -1,34 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var network = require('./network.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); - -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -/** - * About Cloudflare... - */ -class CloudflareProvider extends providerJsonrpc.JsonRpcProvider { - constructor(_network) { - if (_network == null) { - _network = "mainnet"; - } - const network$1 = network.Network.from(_network); - errors.assertArgument(network$1.name === "mainnet", "unsupported network", "network", _network); - super("https://cloudflare-eth.com/", network$1, { staticNetwork: network$1 }); - } -} - -exports.CloudflareProvider = CloudflareProvider; -//# sourceMappingURL=provider-cloudflare.js.map diff --git a/lib.commonjs/providers/provider-cloudflare.js.map b/lib.commonjs/providers/provider-cloudflare.js.map deleted file mode 100644 index f545506a1..000000000 --- a/lib.commonjs/providers/provider-cloudflare.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-cloudflare.js","sources":["../../lib.esm/providers/provider-cloudflare.js"],"sourcesContent":["/**\n * About Cloudflare\n *\n * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare]\n */\nimport { assertArgument } from \"../utils/index.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\n/**\n * About Cloudflare...\n */\nexport class CloudflareProvider extends JsonRpcProvider {\n constructor(_network) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n assertArgument(network.name === \"mainnet\", \"unsupported network\", \"network\", _network);\n super(\"https://cloudflare-eth.com/\", network, { staticNetwork: network });\n }\n}\n//# sourceMappingURL=provider-cloudflare.js.map"],"names":["JsonRpcProvider","network","Network","assertArgument"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACO,MAAM,kBAAkB,SAASA,+BAAe,CAAC;AACxD,IAAI,WAAW,CAAC,QAAQ,EAAE;AAC1B,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,SAAS;AAChC,QAAQ;AACR,QAAQ,MAAMC,SAAO,GAAGC,eAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC9C,QAAQC,qBAAc,CAACF,SAAO,CAAC,IAAI,KAAK,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,CAAC;AAC9F,QAAQ,KAAK,CAAC,6BAA6B,EAAEA,SAAO,EAAE,EAAE,aAAa,EAAEA,SAAO,EAAE,CAAC;AACjF,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-fallback.d.ts b/lib.commonjs/providers/provider-fallback.d.ts deleted file mode 100644 index bf814a2ff..000000000 --- a/lib.commonjs/providers/provider-fallback.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import type { PerformActionRequest } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -/** - * A configuration entry for how to use a [[Provider]]. - */ -export interface FallbackProviderConfig { - provider: AbstractProvider; - stallTimeout?: number; - priority?: number; - weight?: number; -} -/** - * The statistics and state maintained for a [[Provider]]. - */ -export interface FallbackProviderState extends Required { - blockNumber: number; - requests: number; - errorResponses: number; - lateResponses: number; - outOfSync: number; - unsupportedEvents: number; - rollingDuration: number; - score: number; -} -/** - * Additional options to configure a [[FallbackProvider]]. - */ -export type FallbackProviderOptions = { - quorum: number; - eventQuorum: number; - eventWorkers: number; -}; -/** - * A Fallback Provider. - * - */ -export declare class FallbackProvider extends AbstractProvider { - #private; - readonly quorum: number; - readonly eventQuorum: number; - readonly eventWorkers: number; - constructor(providers: Array, network?: Networkish); - get providerConfigs(): Array; - _detectNetwork(): Promise; - _translatePerform(provider: AbstractProvider, req: PerformActionRequest): Promise; - _perform(req: PerformActionRequest): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-fallback.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-fallback.d.ts.map b/lib.commonjs/providers/provider-fallback.d.ts.map deleted file mode 100644 index 95bda52bd..000000000 --- a/lib.commonjs/providers/provider-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiC/C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAEtC,QAAQ,EAAE,gBAAgB,CAAC;IAI3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IAE9E,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,cAAc,EAAE,MAAM,CAAC;IAGvB,aAAa,EAAE,MAAM,CAAC;IAGtB,SAAS,EAAE,MAAM,CAAC;IAGlB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,eAAe,EAAE,MAAM,CAAC;IAGxB,KAAK,EAAE,MAAM,CAAC;CACd;AAsCD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAGrC,MAAM,EAAE,MAAM,CAAC;IAIf,WAAW,EAAE,MAAM,CAAC;IAKpB,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AA4MF;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAO9B,YACC,SAAS,EAAE,KAAK,CAAC,gBAAgB,GAAG,sBAAsB,CAAC,EAC3D,OAAO,CAAC,EAAE,UAAU,EAwBpB;IAED,IAAI,eAAe,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAUlD;IAEK,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAIvC;IAOK,iBAAiB,CACtB,QAAQ,EAAE,gBAAgB,EAC1B,GAAG,EAAE,oBAAoB,GACvB,OAAO,CAAC,GAAG,CAAC,CAyCd;IA4QK,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,CAAC,CAmD7D;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAK7B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-fallback.js b/lib.commonjs/providers/provider-fallback.js deleted file mode 100644 index e12b96674..000000000 --- a/lib.commonjs/providers/provider-fallback.js +++ /dev/null @@ -1,553 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -var abstractProvider = require('./abstract-provider.js'); -var network = require('./network.js'); - -/** - * Explain all the nitty-gritty about the **FallbackProvider**. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ -const BN_1 = BigInt("1"); -const BN_2 = BigInt("2"); -function shuffle(array) { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } -} -function stall(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); -} -function getTime() { - return new Date().getTime(); -} -function stringify(value) { - return JSON.stringify(value, (key, value) => { - if (typeof value === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); -} -const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; -const defaultState = { - blockNumber: -2, - requests: 0, - lateResponses: 0, - errorResponses: 0, - outOfSync: -1, - unsupportedEvents: 0, - rollingDuration: 0, - score: 0, - _network: null, - _updateNumber: null, - _totalTime: 0, -}; -async function waitForSync(config, blockNumber) { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - } -} -function _normalize(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[" + value.map(_normalize).join(",") + "]"; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return _normalize(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{" + - keys - .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`) - .join(",") + - "}"); - } - } - console.log("Could not serialize", value); - throw new Error("Hmm..."); -} -function normalizeResult(value) { - if ("error" in value) { - const error = value.error; - return { tag: _normalize(error), value: error }; - } - const result = value.result; - return { tag: _normalize(result), value: result }; -} -// This strategy picks the highest weight result, as long as the weight is -// equal to or greater than quorum -function checkQuorum(quorum, results) { - const tally = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - let best = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - if (best) { - return best.value; - } - return undefined; -} -function getMedian(quorum, results) { - let resultWeight = 0; - const errorMap = new Map(); - let bestError = null; - const values = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } - else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - // We do not have quorum for a result - return undefined; - } - // Get the sorted values - values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0)); - const mid = Math.floor(values.length / 2); - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; -} -function getAnyResult(quorum, results) { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - // Nope! - return undefined; -} -function getFuzzyMode(quorum, results) { - if (quorum === 1) { - return maths.getNumber(getMedian(quorum, results), "%internal"); - } - const tally = new Map(); - const add = (result, weight) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - for (const { weight, value } of results) { - const r = maths.getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - let bestWeight = 0; - let bestResult = undefined; - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && - (weight > bestWeight || - (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - return bestResult; -} -/** - * A Fallback Provider. - * - */ -class FallbackProvider extends abstractProvider.AbstractProvider { - quorum; - eventQuorum; - eventWorkers; - #configs; - #height; - #initialSyncPromise; - constructor(providers, network) { - super(network); - this.#configs = providers.map((p) => { - if (p instanceof abstractProvider.AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } - else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - this.#height = -2; - this.#initialSyncPromise = null; - this.quorum = 2; //Math.ceil(providers.length / 2); - this.eventQuorum = 1; - this.eventWorkers = 1; - errors.assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), "quorum exceed provider wieght", "quorum", this.quorum); - } - get providerConfigs() { - return this.#configs.map((c) => { - const result = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - async _detectNetwork() { - return network.Network.from(maths.getBigInt(await this._perform({ method: "networkId" }))); - } - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - async _translatePerform(provider, req) { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); - case "networkId": - return (await provider.getNetwork()).networkId; - case "estimateEnergy": - return await provider.estimateEnergy(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = "blockHash" in req ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getEnergyPrice": - return (await provider.getFeeData()).energyPrice; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running) { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - const configs = Array.from(running).map((r) => r.config); - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => b.priority - a.priority); - for (const config of allConfigs) { - if (configs.indexOf(config) === -1) { - return config; - } - } - return null; - } - // Adds a new runner (if available) to running. - #addRunner(running, req) { - const config = this.#getNextConfig(running); - // No runners available - if (config == null) { - return null; - } - // Create a new runner - const runner = { - config, - result: null, - didBump: false, - perform: null, - staller: null, - }; - const now = getTime(); - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } - catch (error) { - config.errorResponses++; - runner.result = { error }; - } - const dt = getTime() - now; - config._totalTime += dt; - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - runner.perform = null; - })(); - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall(config.stallTimeout); - runner.staller = null; - })(); - running.add(runner); - return runner; - } - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync() { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises = []; - this.#configs.forEach((config) => { - promises.push(waitForSync(config, 0)); - promises.push((async () => { - config._network = await config.provider.getNetwork(); - })()); - }); - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - // Check all the networks match - let networkId = null; - for (const config of this.#configs) { - const network = config._network; - if (networkId == null) { - networkId = network.networkId; - } - else if (network.networkId !== networkId) { - errors.assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider", - }); - } - } - })(); - } - await initialSync; - } - async #checkQuorum(running, req) { - // Get all the result objects - const results = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) { - return undefined; - } - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil(maths.getNumber(getMedian(this.quorum, this.#configs.map((c) => ({ - value: c.blockNumber, - tag: maths.getNumber(c.blockNumber).toString(), - weight: c.weight, - }))))); - } - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - case "getEnergyPrice": - case "estimateEnergy": - return getMedian(this.quorum, results); - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - case "call": - case "networkId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - errors.assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify(req.method)})`, - }); - } - async #waitForQuorum(running, req) { - if (running.size === 0) { - throw new Error("no runners?!"); - } - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting = []; - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - // All providers have returned, and we have no result - errors.assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { - request: req, - results: Array.from(running).map((r) => stringify(r.result)), - }, - }); - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - async _perform(req) { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => { - try { - const result = await provider._perform(req); - return Object.assign(normalizeResult({ result }), { weight }); - } - catch (error) { - return Object.assign(normalizeResult({ error }), { weight }); - } - })); - const result = getAnyResult(this.quorum, results); - errors.assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) }, - }); - if (result instanceof Error) { - throw result; - } - return result; - } - await this.#initialSync(); - // Bootstrap enough runners to meet quorum - const running = new Set(); - for (let i = 0; i < this.quorum; i++) { - this.#addRunner(running, req); - } - const result = await this.#waitForQuorum(running, req); - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - return result; - } - async destroy() { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } -} - -exports.FallbackProvider = FallbackProvider; -//# sourceMappingURL=provider-fallback.js.map diff --git a/lib.commonjs/providers/provider-fallback.js.map b/lib.commonjs/providers/provider-fallback.js.map deleted file mode 100644 index 5d06421f5..000000000 --- a/lib.commonjs/providers/provider-fallback.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-fallback.js","sources":["../../lib.esm/providers/provider-fallback.js"],"sourcesContent":["/**\n * Explain all the nitty-gritty about the **FallbackProvider**.\n *\n * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider]\n */\nimport { getBigInt, getNumber, assert, assertArgument, } from \"../utils/index.js\";\nimport { AbstractProvider } from \"./abstract-provider.js\";\nimport { Network } from \"./network.js\";\nconst BN_1 = BigInt(\"1\");\nconst BN_2 = BigInt(\"2\");\nfunction shuffle(array) {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(resolve, duration);\n });\n}\nfunction getTime() {\n return new Date().getTime();\n}\nfunction stringify(value) {\n return JSON.stringify(value, (key, value) => {\n if (typeof value === \"bigint\") {\n return { type: \"bigint\", value: value.toString() };\n }\n return value;\n });\n}\nconst defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 };\nconst defaultState = {\n blockNumber: -2,\n requests: 0,\n lateResponses: 0,\n errorResponses: 0,\n outOfSync: -1,\n unsupportedEvents: 0,\n rollingDuration: 0,\n score: 0,\n _network: null,\n _updateNumber: null,\n _totalTime: 0,\n};\nasync function waitForSync(config, blockNumber) {\n while (config.blockNumber < 0 || config.blockNumber < blockNumber) {\n if (!config._updateNumber) {\n config._updateNumber = (async () => {\n const blockNumber = await config.provider.getBlockNumber();\n if (blockNumber > config.blockNumber) {\n config.blockNumber = blockNumber;\n }\n config._updateNumber = null;\n })();\n }\n await config._updateNumber;\n config.outOfSync++;\n }\n}\nfunction _normalize(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[\" + value.map(_normalize).join(\",\") + \"]\";\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return _normalize(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n case \"number\":\n return BigInt(value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{\" +\n keys\n .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`)\n .join(\",\") +\n \"}\");\n }\n }\n console.log(\"Could not serialize\", value);\n throw new Error(\"Hmm...\");\n}\nfunction normalizeResult(value) {\n if (\"error\" in value) {\n const error = value.error;\n return { tag: _normalize(error), value: error };\n }\n const result = value.result;\n return { tag: _normalize(result), value: result };\n}\n// This strategy picks the highest weight result, as long as the weight is\n// equal to or greater than quorum\nfunction checkQuorum(quorum, results) {\n const tally = new Map();\n for (const { value, tag, weight } of results) {\n const t = tally.get(tag) || { value, weight: 0 };\n t.weight += weight;\n tally.set(tag, t);\n }\n let best = null;\n for (const r of tally.values()) {\n if (r.weight >= quorum && (!best || r.weight > best.weight)) {\n best = r;\n }\n }\n if (best) {\n return best.value;\n }\n return undefined;\n}\nfunction getMedian(quorum, results) {\n let resultWeight = 0;\n const errorMap = new Map();\n let bestError = null;\n const values = [];\n for (const { value, tag, weight } of results) {\n if (value instanceof Error) {\n const e = errorMap.get(tag) || { value, weight: 0 };\n e.weight += weight;\n errorMap.set(tag, e);\n if (bestError == null || e.weight > bestError.weight) {\n bestError = e;\n }\n }\n else {\n values.push(BigInt(value));\n resultWeight += weight;\n }\n }\n if (resultWeight < quorum) {\n // We have quorum for an error\n if (bestError && bestError.weight >= quorum) {\n return bestError.value;\n }\n // We do not have quorum for a result\n return undefined;\n }\n // Get the sorted values\n values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0));\n const mid = Math.floor(values.length / 2);\n // Odd-length; take the middle value\n if (values.length % 2) {\n return values[mid];\n }\n // Even length; take the ceiling of the mean of the center two values\n return (values[mid - 1] + values[mid] + BN_1) / BN_2;\n}\nfunction getAnyResult(quorum, results) {\n // If any value or error meets quorum, that is our preferred result\n const result = checkQuorum(quorum, results);\n if (result !== undefined) {\n return result;\n }\n // Otherwise, do we have any result?\n for (const r of results) {\n if (r.value) {\n return r.value;\n }\n }\n // Nope!\n return undefined;\n}\nfunction getFuzzyMode(quorum, results) {\n if (quorum === 1) {\n return getNumber(getMedian(quorum, results), \"%internal\");\n }\n const tally = new Map();\n const add = (result, weight) => {\n const t = tally.get(result) || { result, weight: 0 };\n t.weight += weight;\n tally.set(result, t);\n };\n for (const { weight, value } of results) {\n const r = getNumber(value);\n add(r - 1, weight);\n add(r, weight);\n add(r + 1, weight);\n }\n let bestWeight = 0;\n let bestResult = undefined;\n for (const { weight, result } of tally.values()) {\n // Use this result, if this result meets quorum and has either:\n // - a better weight\n // - or equal weight, but the result is larger\n if (weight >= quorum &&\n (weight > bestWeight ||\n (bestResult != null && weight === bestWeight && result > bestResult))) {\n bestWeight = weight;\n bestResult = result;\n }\n }\n return bestResult;\n}\n/**\n * A Fallback Provider.\n *\n */\nexport class FallbackProvider extends AbstractProvider {\n quorum;\n eventQuorum;\n eventWorkers;\n #configs;\n #height;\n #initialSyncPromise;\n constructor(providers, network) {\n super(network);\n this.#configs = providers.map((p) => {\n if (p instanceof AbstractProvider) {\n return Object.assign({ provider: p }, defaultConfig, defaultState);\n }\n else {\n return Object.assign({}, defaultConfig, p, defaultState);\n }\n });\n this.#height = -2;\n this.#initialSyncPromise = null;\n this.quorum = 2; //Math.ceil(providers.length / 2);\n this.eventQuorum = 1;\n this.eventWorkers = 1;\n assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), \"quorum exceed provider wieght\", \"quorum\", this.quorum);\n }\n get providerConfigs() {\n return this.#configs.map((c) => {\n const result = Object.assign({}, c);\n for (const key in result) {\n if (key[0] === \"_\") {\n delete result[key];\n }\n }\n return result;\n });\n }\n async _detectNetwork() {\n return Network.from(getBigInt(await this._perform({ method: \"networkId\" })));\n }\n // @TODO: Add support to select providers to be the event subscriber\n //_getSubscriber(sub: Subscription): Subscriber {\n // throw new Error(\"@TODO\");\n //}\n async _translatePerform(provider, req) {\n switch (req.method) {\n case \"broadcastTransaction\":\n return await provider.broadcastTransaction(req.signedTransaction);\n case \"call\":\n return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag }));\n case \"networkId\":\n return (await provider.getNetwork()).networkId;\n case \"estimateEnergy\":\n return await provider.estimateEnergy(req.transaction);\n case \"getBalance\":\n return await provider.getBalance(req.address, req.blockTag);\n case \"getBlock\": {\n const block = \"blockHash\" in req ? req.blockHash : req.blockTag;\n return await provider.getBlock(block, req.includeTransactions);\n }\n case \"getBlockNumber\":\n return await provider.getBlockNumber();\n case \"getCode\":\n return await provider.getCode(req.address, req.blockTag);\n case \"getEnergyPrice\":\n return (await provider.getFeeData()).energyPrice;\n case \"getLogs\":\n return await provider.getLogs(req.filter);\n case \"getStorage\":\n return await provider.getStorage(req.address, req.position, req.blockTag);\n case \"getTransaction\":\n return await provider.getTransaction(req.hash);\n case \"getTransactionCount\":\n return await provider.getTransactionCount(req.address, req.blockTag);\n case \"getTransactionReceipt\":\n return await provider.getTransactionReceipt(req.hash);\n case \"getTransactionResult\":\n return await provider.getTransactionResult(req.hash);\n }\n }\n // Grab the next (random) config that is not already part of\n // the running set\n #getNextConfig(running) {\n // @TODO: Maybe do a check here to favour (heavily) providers that\n // do not require waitForSync and disfavour providers that\n // seem down-ish or are behaving slowly\n const configs = Array.from(running).map((r) => r.config);\n // Shuffle the states, sorted by priority\n const allConfigs = this.#configs.slice();\n shuffle(allConfigs);\n allConfigs.sort((a, b) => b.priority - a.priority);\n for (const config of allConfigs) {\n if (configs.indexOf(config) === -1) {\n return config;\n }\n }\n return null;\n }\n // Adds a new runner (if available) to running.\n #addRunner(running, req) {\n const config = this.#getNextConfig(running);\n // No runners available\n if (config == null) {\n return null;\n }\n // Create a new runner\n const runner = {\n config,\n result: null,\n didBump: false,\n perform: null,\n staller: null,\n };\n const now = getTime();\n // Start performing this operation\n runner.perform = (async () => {\n try {\n config.requests++;\n const result = await this._translatePerform(config.provider, req);\n runner.result = { result };\n }\n catch (error) {\n config.errorResponses++;\n runner.result = { error };\n }\n const dt = getTime() - now;\n config._totalTime += dt;\n config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt;\n runner.perform = null;\n })();\n // Start a staller; when this times out, it's time to force\n // kicking off another runner because we are taking too long\n runner.staller = (async () => {\n await stall(config.stallTimeout);\n runner.staller = null;\n })();\n running.add(runner);\n return runner;\n }\n // Initializes the blockNumber and network for each runner and\n // blocks until initialized\n async #initialSync() {\n let initialSync = this.#initialSyncPromise;\n if (!initialSync) {\n const promises = [];\n this.#configs.forEach((config) => {\n promises.push(waitForSync(config, 0));\n promises.push((async () => {\n config._network = await config.provider.getNetwork();\n })());\n });\n this.#initialSyncPromise = initialSync = (async () => {\n // Wait for all providers to have a block number and network\n await Promise.all(promises);\n // Check all the networks match\n let networkId = null;\n for (const config of this.#configs) {\n const network = config._network;\n if (networkId == null) {\n networkId = network.networkId;\n }\n else if (network.networkId !== networkId) {\n assert(false, \"cannot mix providers on different networks\", \"UNSUPPORTED_OPERATION\", {\n operation: \"new FallbackProvider\",\n });\n }\n }\n })();\n }\n await initialSync;\n }\n async #checkQuorum(running, req) {\n // Get all the result objects\n const results = [];\n for (const runner of running) {\n if (runner.result != null) {\n const { tag, value } = normalizeResult(runner.result);\n results.push({ tag, value, weight: runner.config.weight });\n }\n }\n // Are there enough results to event meet quorum?\n if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) {\n return undefined;\n }\n switch (req.method) {\n case \"getBlockNumber\": {\n // We need to get the bootstrap block height\n if (this.#height === -2) {\n this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({\n value: c.blockNumber,\n tag: getNumber(c.blockNumber).toString(),\n weight: c.weight,\n })))));\n }\n // Find the mode across all the providers, allowing for\n // a little drift between block heights\n const mode = getFuzzyMode(this.quorum, results);\n if (mode === undefined) {\n return undefined;\n }\n if (mode > this.#height) {\n this.#height = mode;\n }\n return this.#height;\n }\n case \"getEnergyPrice\":\n case \"estimateEnergy\":\n return getMedian(this.quorum, results);\n case \"getBlock\":\n // Pending blocks are in the mempool and already\n // quite untrustworthy; just grab anything\n if (\"blockTag\" in req && req.blockTag === \"pending\") {\n return getAnyResult(this.quorum, results);\n }\n return checkQuorum(this.quorum, results);\n case \"call\":\n case \"networkId\":\n case \"getBalance\":\n case \"getTransactionCount\":\n case \"getCode\":\n case \"getStorage\":\n case \"getTransaction\":\n case \"getTransactionReceipt\":\n case \"getLogs\":\n return checkQuorum(this.quorum, results);\n case \"broadcastTransaction\":\n return getAnyResult(this.quorum, results);\n }\n assert(false, \"unsupported method\", \"UNSUPPORTED_OPERATION\", {\n operation: `_perform(${stringify(req.method)})`,\n });\n }\n async #waitForQuorum(running, req) {\n if (running.size === 0) {\n throw new Error(\"no runners?!\");\n }\n // Any promises that are interesting to watch for; an expired stall\n // or a successful perform\n const interesting = [];\n let newRunners = 0;\n for (const runner of running) {\n // No responses, yet; keep an eye on it\n if (runner.perform) {\n interesting.push(runner.perform);\n }\n // Still stalling...\n if (runner.staller) {\n interesting.push(runner.staller);\n continue;\n }\n // This runner has already triggered another runner\n if (runner.didBump) {\n continue;\n }\n // Got a response (result or error) or stalled; kick off another runner\n runner.didBump = true;\n newRunners++;\n }\n // Check if we have reached quorum on a result (or error)\n const value = await this.#checkQuorum(running, req);\n if (value !== undefined) {\n if (value instanceof Error) {\n throw value;\n }\n return value;\n }\n // Add any new runners, because a staller timed out or a result\n // or error response came in.\n for (let i = 0; i < newRunners; i++) {\n this.#addRunner(running, req);\n }\n // All providers have returned, and we have no result\n assert(interesting.length > 0, \"quorum not met\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: {\n request: req,\n results: Array.from(running).map((r) => stringify(r.result)),\n },\n });\n // Wait for someone to either complete its perform or stall out\n await Promise.race(interesting);\n // This is recursive, but at worst case the depth is 2x the\n // number of providers (each has a perform and a staller)\n return await this.#waitForQuorum(running, req);\n }\n async _perform(req) {\n // Broadcasting a transaction is rare (ish) and already incurs\n // a cost on the user, so spamming is safe-ish. Just send it to\n // every backend.\n if (req.method === \"broadcastTransaction\") {\n const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => {\n try {\n const result = await provider._perform(req);\n return Object.assign(normalizeResult({ result }), { weight });\n }\n catch (error) {\n return Object.assign(normalizeResult({ error }), { weight });\n }\n }));\n const result = getAnyResult(this.quorum, results);\n assert(result !== undefined, \"problem multi-broadcasting\", \"SERVER_ERROR\", {\n request: \"%sub-requests\",\n info: { request: req, results: results.map(stringify) },\n });\n if (result instanceof Error) {\n throw result;\n }\n return result;\n }\n await this.#initialSync();\n // Bootstrap enough runners to meet quorum\n const running = new Set();\n for (let i = 0; i < this.quorum; i++) {\n this.#addRunner(running, req);\n }\n const result = await this.#waitForQuorum(running, req);\n // Track requests sent to a provider that are still\n // outstanding after quorum has been otherwise found\n for (const runner of running) {\n if (runner.perform && runner.result == null) {\n runner.config.lateResponses++;\n }\n }\n return result;\n }\n async destroy() {\n for (const { provider } of this.#configs) {\n provider.destroy();\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-fallback.js.map"],"names":["getNumber","AbstractProvider","assertArgument","Network","getBigInt","assert"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAIA,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC;AACxB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC;AACxB,SAAS,OAAO,CAAC,KAAK,EAAE;AACxB,IAAI,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC/C,QAAQ,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,QAAQ,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC;AAC5B,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;AAC3B,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG;AACtB,IAAI;AACJ;AACA,SAAS,KAAK,CAAC,QAAQ,EAAE;AACzB,IA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EAAE,CAAC,EAAE,EAAE;AAC9C,YAAY,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC;AACzC,QAAQ;AACR,QAAQ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC;AAC9D;AACA;AACA,QAAQ,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;AACtC,YAAY,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;AACzD,gBAAgB,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;AAC7C,YAAY;AACZ,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE;AAClD,YAAY,QAAQ,CAAC,OAAO,EAAE;AAC9B,QAAQ;AACR,QAAQ,KAAK,CAAC,OAAO,EAAE;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-infura.d.ts b/lib.commonjs/providers/provider-infura.d.ts deleted file mode 100644 index e09baec46..000000000 --- a/lib.commonjs/providers/provider-infura.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { WebSocketProvider } from "./provider-websocket.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network?: Networkish, projectId?: string); - isCommunityResource(): boolean; -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network?: Networkish, projectId?: null | string, projectSecret?: null | string); - _getProvider(networkId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network?: Networkish, projectId?: string): InfuraWebSocketProvider; - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network: Network, projectId?: null | string, projectSecret?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-infura.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-infura.d.ts.map b/lib.commonjs/providers/provider-infura.d.ts.map deleted file mode 100644 index 2d942d185..000000000 --- a/lib.commonjs/providers/provider-infura.d.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KhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAC1B,OAAO,CAAC,EAAE,UAAU,EACpB,SAAS,CAAC,EAAE,MAAM,GAChB,uBAAuB,CAEzB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC3B,YAAY,CAwBd;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-infura.js b/lib.commonjs/providers/provider-infura.js deleted file mode 100644 index 139cfb4f9..000000000 --- a/lib.commonjs/providers/provider-infura.js +++ /dev/null @@ -1,179 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -var fetch = require('../utils/fetch.js'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var community = require('./community.js'); -var network = require('./network.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); -var providerWebsocket = require('./provider-websocket.js'); - -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -const defaultProjectId = "84842078b09946638c03157f83405213"; -function getHost(name) { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - } - errors.assertArgument(false, "unsupported network", "network", name); -} -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -class InfuraWebSocketProvider extends providerWebsocket.WebSocketProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network, projectId) { - const provider = new InfuraProvider(network, projectId); - const req = provider._getConnection(); - errors.assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, network); - properties.defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret, - }); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -class InfuraProvider extends providerJsonrpc.JsonRpcProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network, projectId, projectSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network$1 = network.Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = InfuraProvider.getRequest(network$1, projectId, projectSecret); - super(request, network$1, { staticNetwork: network$1 }); - properties.defineProperties(this, { projectId, projectSecret }); - } - _getProvider(networkId) { - try { - return new InfuraProvider(networkId, this.projectId, this.projectSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network, projectId) { - return new InfuraWebSocketProvider(network, projectId); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network, projectId, projectSecret) { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/v3/${projectId}`); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - community.showThrottleMessage("InfuraProvider"); - return true; - }; - } - return request; - } -} - -exports.InfuraProvider = InfuraProvider; -exports.InfuraWebSocketProvider = InfuraWebSocketProvider; -//# sourceMappingURL=provider-infura.js.map diff --git a/lib.commonjs/providers/provider-infura.js.map b/lib.commonjs/providers/provider-infura.js.map deleted file mode 100644 index c805e87ac..000000000 --- a/lib.commonjs/providers/provider-infura.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-infura.js","sources":["../../lib.esm/providers/provider-infura.js"],"sourcesContent":["/**\n * [[link-infura]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Sepolia Testnet (``sepolia``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:INFURA [providers-infura]\n */\nimport { defineProperties, FetchRequest, assert, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nimport { WebSocketProvider } from \"./provider-websocket.js\";\nconst defaultProjectId = \"84842078b09946638c03157f83405213\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"mainnet.infura.io\";\n case \"goerli\":\n return \"goerli.infura.io\";\n case \"sepolia\":\n return \"sepolia.infura.io\";\n case \"arbitrum\":\n return \"arbitrum-mainnet.infura.io\";\n case \"arbitrum-goerli\":\n return \"arbitrum-goerli.infura.io\";\n case \"matic\":\n return \"polygon-mainnet.infura.io\";\n case \"matic-mumbai\":\n return \"polygon-mumbai.infura.io\";\n case \"optimism\":\n return \"optimism-mainnet.infura.io\";\n case \"optimism-goerli\":\n return \"optimism-goerli.infura.io\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **InfuraWebSocketProvider** connects to the [[link-infura]]\n * WebSocket end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraWebSocketProvider extends WebSocketProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n constructor(network, projectId) {\n const provider = new InfuraProvider(network, projectId);\n const req = provider._getConnection();\n assert(!req.credentials, \"INFURA WebSocket project secrets unsupported\", \"UNSUPPORTED_OPERATION\", { operation: \"InfuraProvider.getWebSocketProvider()\" });\n const url = req.url.replace(/^http/i, \"ws\").replace(\"/v3/\", \"/ws/v3/\");\n super(url, network);\n defineProperties(this, {\n projectId: provider.projectId,\n projectSecret: provider.projectSecret,\n });\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n}\n/**\n * The **InfuraProvider** connects to the [[link-infura]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-infura-signup).\n */\nexport class InfuraProvider extends JsonRpcProvider {\n /**\n * The Project ID for the INFURA connection.\n */\n projectId;\n /**\n * The Project Secret.\n *\n * If null, no authenticated requests are made. This should not\n * be used outside of private contexts.\n */\n projectSecret;\n /**\n * Creates a new **InfuraProvider**.\n */\n constructor(_network, projectId, projectSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = InfuraProvider.getRequest(network, projectId, projectSecret);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { projectId, projectSecret });\n }\n _getProvider(networkId) {\n try {\n return new InfuraProvider(networkId, this.projectId, this.projectSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.projectId === defaultProjectId;\n }\n /**\n * Creates a new **InfuraWebSocketProvider**.\n */\n static getWebSocketProvider(network, projectId) {\n return new InfuraWebSocketProvider(network, projectId);\n }\n /**\n * Returns a prepared request for connecting to %%network%%\n * with %%projectId%% and %%projectSecret%%.\n */\n static getRequest(network, projectId, projectSecret) {\n if (projectId == null) {\n projectId = defaultProjectId;\n }\n if (projectSecret == null) {\n projectSecret = null;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v3/${projectId}`);\n request.allowGzip = true;\n if (projectSecret) {\n request.setCredentials(\"\", projectSecret);\n }\n if (projectId === defaultProjectId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"InfuraProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-infura.js.map"],"names":["assertArgument","WebSocketProvider","assert","defineProperties","JsonR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,OAAO,CAAC,SAAS,GAAG,OAAO,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK;AACtE,gBAAgBC,6BAAmB,CAAC,gBAAgB,CAAC;AACrD,gBAAgB,OAAO,IAAI;AAC3B,YAAY,CAAC;AACb,QAAQ;AACR,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ipcsocket-browser.d.ts b/lib.commonjs/providers/provider-ipcsocket-browser.d.ts deleted file mode 100644 index 6aae787dc..000000000 --- a/lib.commonjs/providers/provider-ipcsocket-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const IpcSocketProvider: undefined; -export { IpcSocketProvider }; -//# sourceMappingURL=provider-ipcsocket-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ipcsocket-browser.d.ts.map b/lib.commonjs/providers/provider-ipcsocket-browser.d.ts.map deleted file mode 100644 index e49cd58d3..000000000 --- a/lib.commonjs/providers/provider-ipcsocket-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket-browser.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB,WAAY,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ipcsocket-browser.js b/lib.commonjs/providers/provider-ipcsocket-browser.js deleted file mode 100644 index 08c2dad76..000000000 --- a/lib.commonjs/providers/provider-ipcsocket-browser.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -const IpcSocketProvider = undefined; - -exports.IpcSocketProvider = IpcSocketProvider; -//# sourceMappingURL=provider-ipcsocket-browser.js.map diff --git a/lib.commonjs/providers/provider-ipcsocket-browser.js.map b/lib.commonjs/providers/provider-ipcsocket-browser.js.map deleted file mode 100644 index c2341764b..000000000 --- a/lib.commonjs/providers/provider-ipcsocket-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket-browser.js","sources":["../../lib.esm/providers/provider-ipcsocket-browser.js"],"sourcesContent":["const IpcSocketProvider = undefined;\nexport { IpcSocketProvider };\n//# sourceMappingURL=provider-ipcsocket-browser.js.map"],"names":[],"mappings":";;AAAK,MAAC,iBAAiB,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ipcsocket.d.ts b/lib.commonjs/providers/provider-ipcsocket.d.ts deleted file mode 100644 index 9f92c9d4f..000000000 --- a/lib.commonjs/providers/provider-ipcsocket.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// -import { SocketProvider } from "./provider-socket.js"; -import type { Socket } from "net"; -import type { Networkish } from "./network.js"; -export declare class IpcSocketProvider extends SocketProvider { - #private; - get socket(): Socket; - constructor(path: string, network?: Networkish); - destroy(): void; - _write(message: string): Promise; -} -//# sourceMappingURL=provider-ipcsocket.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ipcsocket.d.ts.map b/lib.commonjs/providers/provider-ipcsocket.d.ts.map deleted file mode 100644 index 93bec7dd7..000000000 --- a/lib.commonjs/providers/provider-ipcsocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB/C,qBAAa,iBAAkB,SAAQ,cAAc;;IAEpD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EA+B7C;IAED,OAAO,IAAI,IAAI,CAKd;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-ipcsocket.js b/lib.commonjs/providers/provider-ipcsocket.js deleted file mode 100644 index 6928129ec..000000000 --- a/lib.commonjs/providers/provider-ipcsocket.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -var net = require('net'); -var providerSocket = require('./provider-socket.js'); - -/// -// @TODO: Is this sufficient? Is this robust? Will newlines occur between -// all payloads and only between payloads? -function splitBuffer(data) { - const messages = []; - let lastStart = 0; - while (true) { - const nl = data.indexOf(10, lastStart); - if (nl === -1) { - break; - } - messages.push(data.subarray(lastStart, nl).toString().trim()); - lastStart = nl + 1; - } - return { messages, remaining: data.subarray(lastStart) }; -} -class IpcSocketProvider extends providerSocket.SocketProvider { - #socket; - get socket() { - return this.#socket; - } - constructor(path, network) { - super(network); - this.#socket = net.connect(path); - this.socket.on("ready", async () => { - try { - await this._start(); - } - catch (error) { - console.log("failed to start IpcSocketProvider", error); - // @TODO: Now what? Restart? - } - }); - let response = Buffer.alloc(0); - this.socket.on("data", (data) => { - response = Buffer.concat([ - response, - typeof data === "string" ? Buffer.from(data) : data, - ]); - const { messages, remaining } = splitBuffer(response); - messages.forEach((message) => { - this._processMessage(message); - }); - response = remaining; - }); - this.socket.on("end", () => { - this.emit("close"); - this.socket.destroy(); - this.socket.end(); - }); - } - destroy() { - this.socket.destroy(); - this.socket.end(); - super.destroy(); - } - async _write(message) { - this.socket.write(message); - } -} - -exports.IpcSocketProvider = IpcSocketProvider; -//# sourceMappingURL=provider-ipcsocket.js.map diff --git a/lib.commonjs/providers/provider-ipcsocket.js.map b/lib.commonjs/providers/provider-ipcsocket.js.map deleted file mode 100644 index aac21cc46..000000000 --- a/lib.commonjs/providers/provider-ipcsocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket.js","sources":["../../lib.esm/providers/provider-ipcsocket.js"],"sourcesContent":["/// \nimport { connect } from \"net\";\nimport { SocketProvider } from \"./provider-socket.js\";\n// @TODO: Is this sufficient? Is this robust? Will newlines occur between\n// all payloads and only between payloads?\nfunction splitBuffer(data) {\n const messages = [];\n let lastStart = 0;\n while (true) {\n const nl = data.indexOf(10, lastStart);\n if (nl === -1) {\n break;\n }\n messages.push(data.subarray(lastStart, nl).toString().trim());\n lastStart = nl + 1;\n }\n return { messages, remaining: data.subarray(lastStart) };\n}\nexport class IpcSocketProvider extends SocketProvider {\n #socket;\n get socket() {\n return this.#socket;\n }\n constructor(path, network) {\n super(network);\n this.#socket = connect(path);\n this.socket.on(\"ready\", async () => {\n try {\n await this._start();\n }\n catch (error) {\n console.log(\"failed to start IpcSocketProvider\", error);\n // @TODO: Now what? Restart?\n }\n });\n let response = Buffer.alloc(0);\n this.socket.on(\"data\", (data) => {\n response = Buffer.concat([\n response,\n typeof data === \"string\" ? Buffer.from(data) : data,\n ]);\n const { messages, remaining } = splitBuffer(response);\n messages.forEach((message) => {\n this._processMessage(message);\n });\n response = remaining;\n });\n this.socket.on(\"end\", () => {\n this.emit(\"close\");\n this.socket.destroy();\n this.socket.end();\n });\n }\n destroy() {\n this.socket.destroy();\n this.socket.end();\n super.destroy();\n }\n async _write(message) {\n this.socket.write(message);\n }\n}\n//# sourceMappingURL=provider-ipcsocket.js.map"],"names":["SocketProvider","connect"],"mappings":";;;;;AAAA;AAGA;AACA;AACA,SAAS,WAAW,CAAC,IAAI,EAAE;AAC3B,IAAI,MAAM,QAAQ,GAAG,EAAE;AACvB,IAAI,IAAI,SAAS,GAAG,CAAC;AACrB,IAAI,OAAO,IAAI,EAAE;AACjB,QAAQ,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC;AAC9C,QAAQ,IAAI,EAAE,KAAK,EAAE,EAAE;AACvB,YAAY;AACZ,QAAQ;AACR,QAAQ,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,EAAE,CAAC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AAC1C,gBAAgB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;AAC7C,YAAY,CAAC,CAAC;AACd,YAAY,QAAQ,GAAG,SAAS;AAChC,QAAQ,CAAC,CAAC;AACV,QAAQ,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM;AACpC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;AAC9B,YAAY,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;AACjC,YAAY,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;AAC7B,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ,IAAI,OAAO,GAAG;AACd,QAAQ,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;AAC7B,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;AACzB,QAAQ,KAAK,CAAC,OAAO,EAAE;AACvB,IAAI;AACJ,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;AAClC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-jsonrpc.d.ts b/lib.commonjs/providers/provider-jsonrpc.d.ts deleted file mode 100644 index f4dc34d1e..000000000 --- a/lib.commonjs/providers/provider-jsonrpc.d.ts +++ /dev/null @@ -1,267 +0,0 @@ -/** - * About JSON-RPC... - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { AbstractSigner } from "./abstract-signer.js"; -import { Network } from "./network.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { PerformActionRequest, Subscriber, Subscription } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -/** - * A JSON-RPC payload, which are sent to a JSON-RPC server. - */ -export type JsonRpcPayload = { - id: number; - method: string; - params: Array | Record; - jsonrpc: "2.0"; -}; -/** - * A JSON-RPC result, which are returned on success from a JSON-RPC server. - */ -export type JsonRpcResult = { - id: number; - result: any; -}; -/** - * A JSON-RPC error, which are returned on failure from a JSON-RPC server. - */ -export type JsonRpcError = { - id: number; - error: { - code: number; - message?: string; - data?: any; - }; -}; -/** - * When subscribing to the ``"debug"`` event, the [[Listener]] will - * receive this object as the first parameter. - */ -export type DebugEventJsonRpcApiProvider = { - action: "sendRpcPayload"; - payload: JsonRpcPayload | Array; -} | { - action: "receiveRpcResult"; - result: Array; -} | { - action: "receiveRpcError"; - error: Error; -}; -/** - * Options for configuring a [[JsonRpcApiProvider]]. Much of this - * is targetted towards sub-classes, which often will not expose - * any of these options to their consumers. - * - * **``polling``** - use the polling strategy is used immediately - * for events; otherwise, attempt to use filters and fall back onto - * polling (default: ``false``) - * - * **``staticNetwork``** - do not request chain ID on requests to - * validate the underlying chain has not changed (default: ``null``) - * - * This should **ONLY** be used if it is **certain** that the network - * cannot change, such as when using INFURA (since the URL dictates the - * network). If the network is assumed static and it does change, this - * can have tragic consequences. For example, this **CANNOT** be used - * with MetaMask, since the used can select a new network from the - * drop-down at any time. - * - * **``batchStallTime``** - how long (ms) to aggregate requests into a - * single batch. ``0`` indicates batching will only encompass the current - * event loop. If ``batchMaxCount = 1``, this is ignored. (default: ``10``) - * - * **``batchMaxSize``** - target maximum size (bytes) to allow per batch - * request (default: 1Mb) - * - * **``batchMaxCount``** - maximum number of requests to allow in a batch. - * If ``batchMaxCount = 1``, then batching is disabled. (default: ``100``) - */ -export type JsonRpcApiProviderOptions = { - polling?: boolean; - staticNetwork?: null | Network; - batchStallTime?: number; - batchMaxSize?: number; - batchMaxCount?: number; -}; -export interface JsonRpcTransactionRequest { - from?: string; - to?: string; - data?: string; - networkId?: string; - type?: string; - energy?: string; - energyPrice?: string; - nonce?: string; - value?: string; - accessList?: Array<{ - address: string; - storageKeys: Array; - }>; -} -export declare class JsonRpcSigner extends AbstractSigner { - address: string; - constructor(provider: JsonRpcApiProvider, address: string); - connect(provider: null | Provider): Signer; - getAddress(): Promise; - populateTransaction(tx: TransactionRequest): Promise>; - sendUncheckedTransaction(_tx: TransactionRequest): Promise; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(_tx: TransactionRequest): Promise; - signMessage(_message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, _value: Record): Promise; - unlock(password: string): Promise; - _legacySignMessage(_message: string | Uint8Array): Promise; -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -export declare abstract class JsonRpcApiProvider extends AbstractProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key: K): JsonRpcApiProviderOptions[K]; - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network(): Network; - /** - * Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel. - * - * Sub-classes **MUST** override this. - */ - abstract _send(payload: JsonRpcPayload | Array): Promise>; - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - _perform(req: PerformActionRequest): Promise; - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - _detectNetwork(): Promise; - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start(): void; - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - _waitUntilReady(): Promise; - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub: Subscription): Subscriber; - /** - * Returns true only if the [[_start]] has been called. - */ - get ready(): boolean; - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest; - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req: PerformActionRequest): null | { - method: string; - args: Array; - }; - /** - * Returns an CoreBC-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error; - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method: string, params: Array | Record): Promise; - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - getSigner(address?: number | string): Promise; - listAccounts(): Promise>; -} -export declare abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - _getSubscriber(sub: Subscription): Subscriber; - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval(): number; - set pollingInterval(value: number); -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -export declare class JsonRpcProvider extends JsonRpcApiPollingProvider { - #private; - constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions); - _getConnection(): FetchRequest; - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; -} -//# sourceMappingURL=provider-jsonrpc.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-jsonrpc.d.ts.map b/lib.commonjs/providers/provider-jsonrpc.d.ts.map deleted file mode 100644 index 0635f491a..000000000 --- a/lib.commonjs/providers/provider-jsonrpc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAUN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOvC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACX,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuD1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,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ib.commonjs/providers/provider-jsonrpc.js deleted file mode 100644 index 0c81c651c..000000000 --- a/lib.commonjs/providers/provider-jsonrpc.js +++ /dev/null @@ -1,885 +0,0 @@ -'use strict'; - -var abiCoder = require('../abi/abi-coder.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -var fetch = require('../utils/fetch.js'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -var utf8 = require('../utils/utf8.js'); -require('../abi/fragments.js'); -require('../crypto/keccak.js'); -require('../crypto/sha3.js'); -require('../constants/numbers.js'); -var index = require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../logger/logger.js'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); -var typedData = require('../hash/typed-data.js'); -var abstractProvider = require('./abstract-provider.js'); -var abstractSigner = require('./abstract-signer.js'); -var network = require('./network.js'); -var subscriberFilterid = require('./subscriber-filterid.js'); -var subscriberPolling = require('./subscriber-polling.js'); -var checks = require('../address/checks.js'); - -/** - * About JSON-RPC... - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -// @TODO: -// - Add the batching API -const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); -//const Methods = "getAddress,then".split(/,/g); -function deepCopy(value) { - if (value == null || Primitive.indexOf(typeof value) >= 0) { - return value; - } - // Keep any Addressable - if (typeof value.getAddress === "function") { - return value; - } - if (Array.isArray(value)) { - return value.map(deepCopy); - } - if (typeof value === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = value[key]; - return accum; - }, {}); - } - throw new Error(`should not happen: ${value} (${typeof value})`); -} -function stall(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); -} -function getLowerCase(value) { - if (value) { - return value.toLowerCase(); - } - return value; -} -function isPollable(value) { - return value && typeof value.pollingInterval === "number"; -} -const defaultOptions = { - polling: false, - staticNetwork: null, - batchStallTime: 10, // 10ms - batchMaxSize: 1 << 20, // 1Mb - batchMaxCount: 100, // 100 requests -}; -// @TODO: Unchecked Signers -class JsonRpcSigner extends abstractSigner.AbstractSigner { - address; - constructor(provider, address) { - super(provider); - address = index.getAddress(address); - properties.defineProperties(this, { address }); - } - connect(provider) { - errors.assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect", - }); - } - async getAddress() { - return this.address; - } - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx) { - return await this.populateCall(tx); - } - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx) { - const tx = deepCopy(_tx); - const promises = []; - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await checks.resolveAddress(_from); - errors.assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } - else { - tx.from = this.address; - } - // The JSON-RPC for xcb_sendTransaction uses 90000 energy; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.energyLimit == null) { - promises.push((async () => { - tx.energyLimit = await this.provider.estimateEnergy({ - ...tx, - from: this.address, - }); - })()); - } - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await checks.resolveAddress(_to); - })()); - } - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - const hexTx = this.provider.getRpcTransaction(tx); - return this.provider.send("xcb_sendTransaction", [hexTx]); - } - async sendTransaction(tx) { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - const checkTx = async () => { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - // Wait another 4 seconds - this.provider._setTimeout(() => { - checkTx(); - }, timeouts.pop() || 4000); - }; - checkTx(); - }); - } - async signTransaction(_tx) { - const tx = deepCopy(_tx); - // Make sure the from matches the sender - if (tx.from) { - const from = await checks.resolveAddress(tx.from); - errors.assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - } - else { - tx.from = this.address; - } - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("xcb_signTransaction", [hexTx]); - } - async signMessage(_message) { - const message = typeof _message === "string" ? utf8.toUtf8Bytes(_message) : _message; - return await this.provider.send("personal_sign", [ - data.hexlify(message), - this.address.toLowerCase(), - ]); - } - async signTypedData(domain, types, _value) { - const value = deepCopy(_value); - // Populate any ENS names (in-place) - const populated = await typedData.TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await checks.resolveAddress(value); - errors.assertArgument(address != null, "TypedData does not support null address", "value", value); - return address; - }); - return await this.provider.send("xcb_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(typedData.TypedDataEncoder.getPayload(populated.domain, types, populated.value)), - ]); - } - async unlock(password) { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), - password, - null, - ]); - } - async _legacySignMessage(_message) { - const message = typeof _message === "string" ? utf8.toUtf8Bytes(_message) : _message; - return await this.provider.send("xcb_sign", [ - this.address.toLowerCase(), - data.hexlify(message), - ]); - } -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -class JsonRpcApiProvider extends abstractProvider.AbstractProvider { - #options; - // The next ID to use for the JSON-RPC ID field - #nextId; - // Payloads are queued and triggered in batches using the drainTimer - #payloads; - #drainTimer; - #notReady; - #network; - #scheduleDrain() { - if (this.#drainTimer) { - return; - } - // If we aren't using batching, no hard in sending it immeidately - const stallTime = this._getOption("batchMaxCount") === 1 - ? 0 - : this._getOption("batchStallTime"); - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - const payloads = this.#payloads; - this.#payloads = []; - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [payloads.shift()]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push(payloads.shift()); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift(batch.pop()); - break; - } - } - // Process the result to each payload - (async () => { - const payload = batch.length === 1 ? batch[0].payload : batch.map((p) => p.payload); - this.emit("debug", { action: "sendRpcPayload", payload }); - try { - // console.log({payload}) - const result = await this._send(payload); - // console.log({result}) - this.emit("debug", { action: "receiveRpcResult", result }); - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - // Find the matching result - const resp = result.filter((r) => r.id === payload.id)[0]; - // No result; the node failed us in unexpected ways - if (resp == null) { - return reject(errors.makeError("no response from server", "BAD_DATA", { - value: result, - info: { payload }, - })); - } - // The response is an error - if ("error" in resp) { - return reject(this.getRpcError(payload, resp)); - } - // All good; send the result - resolve(resp.result); - } - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - constructor(network, options) { - super(network); - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - this.#payloads = []; - this.#drainTimer = null; - this.#network = null; - { - let resolve = null; - const promise = new Promise((_resolve) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - // Make sure any static network is compatbile with the provided netwrok - const staticNetwork = this._getOption("staticNetwork"); - if (staticNetwork) { - errors.assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key) { - return this.#options[key]; - } - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network() { - errors.assert(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - /* - { - assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { - operation: "jsonRpcApiProvider._send" - }); - } - */ - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req) { - const request = this.getRpcRequest(req); - if (request != null) { - return await this.send(request.method, request.args); - } - return super._perform(req); - } - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork() { - const network$1 = this._getOption("staticNetwork"); - if (network$1) { - return network$1; - } - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - return network.Network.from(maths.getBigInt(await this.send("xcb_networkId", []))); - } - // We are not ready yet; use the primitive _send - const payload = { - id: this.#nextId++, - method: "xcb_networkId", - params: [], - jsonrpc: "2.0", - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return network.Network.from(maths.getBigInt(result.result)); - } - throw this.getRpcError(payload, result); - } - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start() { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - this.#notReady.resolve(); - this.#notReady = null; - (async () => { - // Bootstrap the network - while (this.#network == null) { - try { - this.#network = await this._detectNetwork(); - } - catch (error) { - console.log("JsonRpcProvider failed to startup; retry in 1s"); - await stall(1000); - } - } - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady() { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub) { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new subscriberFilterid.FilterIdPendingSubscriber(this); - } - if (sub.type === "event") { - if (this._getOption("polling")) { - return new subscriberPolling.PollingEventSubscriber(this, sub.filter); - } - return new subscriberFilterid.FilterIdEventSubscriber(this, sub.filter); - } - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new abstractProvider.UnmanagedSubscriber("orphan"); - } - return super._getSubscriber(sub); - } - /** - * Returns true only if the [[_start]] has been called. - */ - get ready() { - return this.#notReady == null; - } - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx) { - const result = {}; - // JSON-RPC now requires numeric values to be "quantity" values - [ - "networkId", - "energyLimit", - "energyPrice", - "type", - "nonce", - "value", - ].forEach((key) => { - if (tx[key] == null) { - return; - } - let dstKey = key; - if (key === "energyLimit") { - dstKey = "energy"; - } - result[dstKey] = maths.toQuantity(maths.getBigInt(tx[key], `tx.${key}`)); - }); - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if (tx[key] == null) { - return; - } - result[key] = data.hexlify(tx[key]); - }); - return result; - } - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req) { - switch (req.method) { - case "networkId": - return { method: "xcb_networkId", args: [] }; - case "getBlockNumber": - return { method: "xcb_blockNumber", args: [] }; - case "getEnergyPrice": - return { method: "xcb_energyPrice", args: [] }; - case "getBalance": { - return { - method: "xcb_getBalance", - args: [getLowerCase(req.address), req.blockTag], - }; - } - case "getTransactionCount": - return { - method: "xcb_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getCode": - return { - method: "xcb_getCode", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getStorage": - return { - method: "xcb_getStorageAt", - args: [ - getLowerCase(req.address), - "0x" + req.position.toString(16), - req.blockTag, - ], - }; - case "broadcastTransaction": - return { - method: "xcb_sendRawTransaction", - args: [req.signedTransaction], - }; - case "getBlock": - if ("blockTag" in req) { - return { - method: "xcb_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions], - }; - } - else if ("blockHash" in req) { - return { - method: "xcb_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions], - }; - } - break; - case "getTransaction": - return { - method: "xcb_getTransactionByHash", - args: [req.hash], - }; - case "getTransactionReceipt": - return { - method: "xcb_getTransactionReceipt", - args: [req.hash], - }; - case "call": - return { - method: "xcb_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag], - }; - case "estimateEnergy": { - return { - method: "xcb_estimateEnergy", - args: [this.getRpcTransaction(req.transaction)], - }; - } - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } - else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "xcb_getLogs", args: [req.filter] }; - } - return null; - } - /** - * Returns an CoreBC-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload, _error) { - const { method } = payload; - const { error } = _error; - if (method === "xcb_estimateEnergy" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return errors.makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: payload.params[0], - info: { payload, error }, - }); - } - } - if (method === "xcb_call" || method === "xcb_estimateEnergy") { - const result = spelunkData(error); - const e = abiCoder.AbiCoder.getBuiltinCallException(method === "xcb_call" ? "call" : "estimateEnergy", payload.params[0], result ? result.data : null); - e.info = { error, payload }; - return e; - } - // Only estimateEnergy and call can return arbitrary contract-defined text, so now we - // we can process text safely. - const message = JSON.stringify(spelunkMessage(error)); - if (typeof error.message === "string" && - error.message.match(/user denied|corebc-user-denied/i)) { - const actionMap = { - xcb_sign: "signMessage", - personal_sign: "signMessage", - xcb_signTypedData_v4: "signTypedData", - xcb_signTransaction: "signTransaction", - xcb_sendTransaction: "sendTransaction", - xcb_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - return errors.makeError(`user rejected action`, "ACTION_REJECTED", { - action: actionMap[method] || "unknown", - reason: "rejected", - info: { payload, error }, - }); - } - if (method === "xcb_sendRawTransaction" || - method === "xcb_sendTransaction") { - const transaction = payload.params[0]; - if (message.match(/insufficient funds|base fee exceeds energy limit/i)) { - return errors.makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, - info: { error }, - }); - } - if (message.match(/nonce/i) && message.match(/too low/i)) { - return errors.makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction, - info: { error }, - }); - } - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && - message.match(/underpriced/i)) { - return errors.makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction, - info: { error }, - }); - } - if (message.match(/only replay-protected/i)) { - return errors.makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, - info: { transaction, info: { error } }, - }); - } - } - if (message.match(/the method .* does not exist/i)) { - return errors.makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, - info: { error }, - }); - } - return errors.makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); - } - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method, params) { - // @TODO: cache networkId?? purge on switch_networks - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, - reject, - payload: { method, params, id, jsonrpc: "2.0" }, - }); - }); - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - return promise; - } - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address) { - if (address == null) { - address = 0; - } - const accountsPromise = this.send("xcb_accounts", []); - // Account index - if (typeof address === "number") { - const accounts = await accountsPromise; - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - const { accounts } = await properties.resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise, - }); - // Account address - address = index.getAddress(address); - for (const account of accounts) { - if (index.getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - throw new Error("invalid account"); - } - async listAccounts() { - const accounts = await this.send("xcb_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } -} -class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval; - constructor(network, options) { - super(network, options); - this.#pollingInterval = 4000; - } - _getSubscriber(sub) { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval() { - return this.#pollingInterval; - } - set pollingInterval(value) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect; - constructor(url, network, options) { - if (url == null) { - url = "http://localhost:8545"; - } - super(network, options); - if (typeof url === "string") { - this.#connect = new fetch.FetchRequest(url); - } - else { - this.#connect = url.clone(); - } - } - _getConnection() { - return this.#connect.clone(); - } - async send(method, params) { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. xcb_networkId) until we absolutely have to. - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - return resp; - } -} -function spelunkData(value) { - if (value == null) { - return null; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string" && - value.message.match("reverted") && - data.isHexString(value.data)) { - return { message: value.message, data: value.data }; - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return spelunkData(JSON.parse(value)); - } - catch (error) { } - } - return null; -} -function _spelunkMessage(value, result) { - if (value == null) { - return; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string") { - result.push(value.message); - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } - catch (error) { } - } -} -function spelunkMessage(value) { - const result = []; - _spelunkMessage(value, result); - return result; -} - -exports.JsonRpcApiPollingProvider = JsonRpcApiPollingProvider; -exports.JsonRpcApiProvider = JsonRpcApiProvider; -exports.JsonRpcProvider = JsonRpcProvider; -exports.JsonRpcSigner = JsonRpcSigner; -//# sourceMappingURL=provider-jsonrpc.js.map diff --git a/lib.commonjs/providers/provider-jsonrpc.js.map b/lib.commonjs/providers/provider-jsonrpc.js.map deleted file mode 100644 index 93cbf8b8e..000000000 --- a/lib.commonjs/providers/provider-jsonrpc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-jsonrpc.js","sources":["../../lib.esm/providers/provider-jsonrpc.js"],"sourcesContent":["/**\n * About JSON-RPC...\n *\n * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider]\n */\n// @TODO:\n// - Add the batching API\nimport { AbiCoder } from \"../abi/index.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { TypedDataEncoder } from \"../hash/index.js\";\nimport { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, 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\";\nimport { resolveAddress } from \"../address/checks.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) => {\n setTimeout(resolve, duration);\n });\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, // 10ms\n batchMaxSize: 1 << 20, // 1Mb\n batchMaxCount: 100, // 100 requests\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);\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 xcb_sendTransaction uses 90000 energy; 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.energyLimit == null) {\n promises.push((async () => {\n tx.energyLimit = await this.provider.estimateEnergy({\n ...tx,\n from: this.address,\n });\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);\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(\"xcb_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 const checkTx = async () => {\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 // Wait another 4 seconds\n this.provider._setTimeout(() => {\n checkTx();\n }, 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);\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(\"xcb_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),\n 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(\"xcb_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(),\n password,\n null,\n ]);\n }\n async _legacySignMessage(_message) {\n const message = typeof _message === \"string\" ? toUtf8Bytes(_message) : _message;\n return await this.provider.send(\"xcb_sign\", [\n this.address.toLowerCase(),\n 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 #scheduleDrain() {\n if (this.#drainTimer) {\n return;\n }\n // If we aren't using batching, no hard in sending it immeidately\n const stallTime = this._getOption(\"batchMaxCount\") === 1\n ? 0\n : 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 // console.log({payload})\n const result = await this._send(payload);\n // console.log({result})\n this.emit(\"debug\", { action: \"receiveRpcResult\", result });\n // Process results in batch order\n for (const { resolve, reject, payload } of batch) {\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 return reject(makeError(\"no response from server\", \"BAD_DATA\", {\n value: result,\n info: { payload },\n }));\n }\n // The response is an error\n if (\"error\" in resp) {\n return reject(this.getRpcError(payload, resp));\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);\n this.#nextId = 1;\n this.#options = Object.assign({}, defaultOptions, options || {});\n this.#payloads = [];\n this.#drainTimer = null;\n this.#network = null;\n {\n let resolve = null;\n const promise = new Promise((_resolve) => {\n resolve = _resolve;\n });\n this.#notReady = { promise, resolve };\n }\n // Make sure any static network is compatbile with the provided netwrok\n const staticNetwork = this._getOption(\"staticNetwork\");\n if (staticNetwork) {\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 {\n assert(false, \"sub-classes must override _send\", \"UNSUPPORTED_OPERATION\", {\n operation: \"jsonRpcApiProvider._send\"\n });\n }\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 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 return network;\n }\n // If we are ready, use ``send``, which enabled requests to be batched\n if (this.ready) {\n return Network.from(getBigInt(await this.send(\"xcb_networkId\", [])));\n }\n // We are not ready yet; use the primitive _send\n const payload = {\n id: this.#nextId++,\n method: \"xcb_networkId\",\n params: [],\n jsonrpc: \"2.0\",\n };\n this.emit(\"debug\", { action: \"sendRpcPayload\", payload });\n let result;\n try {\n result = (await this._send(payload))[0];\n }\n catch (error) {\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 /**\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) {\n try {\n this.#network = await this._detectNetwork();\n }\n catch (error) {\n console.log(\"JsonRpcProvider failed to startup; retry in 1s\");\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() {\n return this.#notReady == null;\n }\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 [\n \"networkId\",\n \"energyLimit\",\n \"energyPrice\",\n \"type\",\n \"nonce\",\n \"value\",\n ].forEach((key) => {\n if (tx[key] == null) {\n return;\n }\n let dstKey = key;\n if (key === \"energyLimit\") {\n dstKey = \"energy\";\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 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 \"networkId\":\n return { method: \"xcb_networkId\", args: [] };\n case \"getBlockNumber\":\n return { method: \"xcb_blockNumber\", args: [] };\n case \"getEnergyPrice\":\n return { method: \"xcb_energyPrice\", args: [] };\n case \"getBalance\": {\n return {\n method: \"xcb_getBalance\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n }\n case \"getTransactionCount\":\n return {\n method: \"xcb_getTransactionCount\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getCode\":\n return {\n method: \"xcb_getCode\",\n args: [getLowerCase(req.address), req.blockTag],\n };\n case \"getStorage\":\n return {\n method: \"xcb_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: \"xcb_sendRawTransaction\",\n args: [req.signedTransaction],\n };\n case \"getBlock\":\n if (\"blockTag\" in req) {\n return {\n method: \"xcb_getBlockByNumber\",\n args: [req.blockTag, !!req.includeTransactions],\n };\n }\n else if (\"blockHash\" in req) {\n return {\n method: \"xcb_getBlockByHash\",\n args: [req.blockHash, !!req.includeTransactions],\n };\n }\n break;\n case \"getTransaction\":\n return {\n method: \"xcb_getTransactionByHash\",\n args: [req.hash],\n };\n case \"getTransactionReceipt\":\n return {\n method: \"xcb_getTransactionReceipt\",\n args: [req.hash],\n };\n case \"call\":\n return {\n method: \"xcb_call\",\n args: [this.getRpcTransaction(req.transaction), req.blockTag],\n };\n case \"estimateEnergy\": {\n return {\n method: \"xcb_estimateEnergy\",\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: \"xcb_getLogs\", args: [req.filter] };\n }\n return null;\n }\n /**\n * Returns an CoreBC-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 === \"xcb_estimateEnergy\" && 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 }\n if (method === \"xcb_call\" || method === \"xcb_estimateEnergy\") {\n const result = spelunkData(error);\n const e = AbiCoder.getBuiltinCallException(method === \"xcb_call\" ? \"call\" : \"estimateEnergy\", payload.params[0], result ? result.data : null);\n e.info = { error, payload };\n return e;\n }\n // Only estimateEnergy 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\" &&\n error.message.match(/user denied|corebc-user-denied/i)) {\n const actionMap = {\n xcb_sign: \"signMessage\",\n personal_sign: \"signMessage\",\n xcb_signTypedData_v4: \"signTypedData\",\n xcb_signTransaction: \"signTransaction\",\n xcb_sendTransaction: \"sendTransaction\",\n xcb_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 === \"xcb_sendRawTransaction\" ||\n method === \"xcb_sendTransaction\") {\n const transaction = payload.params[0];\n if (message.match(/insufficient funds|base fee exceeds energy limit/i)) {\n return makeError(\"insufficient funds for intrinsic transaction cost\", \"INSUFFICIENT_FUNDS\", {\n transaction,\n 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\", {\n transaction,\n info: { error },\n });\n }\n // \"replacement transaction underpriced\"\n if (message.match(/replacement transaction/i) &&\n message.match(/underpriced/i)) {\n return makeError(\"replacement fee too low\", \"REPLACEMENT_UNDERPRICED\", {\n transaction,\n info: { error },\n });\n }\n if (message.match(/only replay-protected/i)) {\n return makeError(\"legacy pre-eip-155 transactions not supported\", \"UNSUPPORTED_OPERATION\", {\n operation: method,\n info: { transaction, info: { error } },\n });\n }\n }\n if (message.match(/the method .* does not exist/i)) {\n return makeError(\"unsupported operation\", \"UNSUPPORTED_OPERATION\", {\n operation: payload.method,\n info: { error },\n });\n }\n return makeError(\"could not coalesce error\", \"UNKNOWN_ERROR\", { error });\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 networkId?? purge on switch_networks\n const id = this.#nextId++;\n const promise = new Promise((resolve, reject) => {\n this.#payloads.push({\n resolve,\n 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(\"xcb_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(\"xcb_accounts\", []);\n return accounts.map((a) => new JsonRpcSigner(this, a));\n }\n}\nexport class JsonRpcApiPollingProvider extends JsonRpcApiProvider {\n #pollingInterval;\n constructor(network, options) {\n super(network, options);\n this.#pollingInterval = 4000;\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() {\n return this.#pollingInterval;\n }\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. xcb_networkId) 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\" &&\n value.message.match(\"reverted\") &&\n 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"],"names":["AbstractSigner","getAddress","defineProperties","assert","resolveAddress","assertArgument","toUtf8Bytes","hexlify","TypedDataEncoder","AbstractProvider","makeError","network","Network","getBigInt","FilterIdPendingSubscriber","PollingEventSubscriber","FilterIdEventSubscriber","UnmanagedSubscriber","toQuantity","AbiCoder","resolveProperties","FetchRequest","isHexString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAC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ts b/lib.commonjs/providers/provider-pocket.d.ts deleted file mode 100644 index 01b2fd311..000000000 --- a/lib.commonjs/providers/provider-pocket.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -export declare class PocketProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Application ID for the Pocket connection. - */ - readonly applicationId: string; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - readonly applicationSecret: null | string; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, applicationId?: null | string, applicationSecret?: null | string); - _getProvider(networkId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network: Network, applicationId?: null | string, applicationSecret?: null | string): FetchRequest; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-pocket.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-pocket.d.ts.map b/lib.commonjs/providers/provider-pocket.d.ts.map deleted file mode 100644 index aaf617488..000000000 --- a/lib.commonjs/providers/provider-pocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB/C;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,EA0BjC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAShD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAC/B,YAAY,CAsBd;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-pocket.js b/lib.commonjs/providers/provider-pocket.js deleted file mode 100644 index abfab147f..000000000 --- a/lib.commonjs/providers/provider-pocket.js +++ /dev/null @@ -1,119 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -var fetch = require('../utils/fetch.js'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var community = require('./community.js'); -var network = require('./network.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); - -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - errors.assertArgument(false, "unsupported network", "network", name); -} -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -class PocketProvider extends providerJsonrpc.JsonRpcProvider { - /** - * The Application ID for the Pocket connection. - */ - applicationId; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - applicationSecret; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, applicationId, applicationSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network$1 = network.Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - const options = { staticNetwork: network$1 }; - const request = PocketProvider.getRequest(network$1, applicationId, applicationSecret); - super(request, network$1, options); - properties.defineProperties(this, { - applicationId, - applicationSecret, - }); - } - _getProvider(networkId) { - try { - return new PocketProvider(networkId, this.applicationId, this.applicationSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network, applicationId, applicationSecret) { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); - request.allowGzip = true; - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - community.showThrottleMessage("PocketProvider"); - return true; - }; - } - return request; - } - isCommunityResource() { - return this.applicationId === defaultApplicationId; - } -} - -exports.PocketProvider = PocketProvider; -//# sourceMappingURL=provider-pocket.js.map diff --git a/lib.commonjs/providers/provider-pocket.js.map b/lib.commonjs/providers/provider-pocket.js.map deleted file mode 100644 index 3a527d6c1..000000000 --- a/lib.commonjs/providers/provider-pocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-pocket.js","sources":["../../lib.esm/providers/provider-pocket.js"],"sourcesContent":["/**\n * [[link-pocket]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Polygon (``matic``)\n * - Arbitrum (``arbitrum``)\n *\n * @_subsection: api/providers/thirdparty:Pocket [providers-pocket]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultApplicationId = \"62e1ad51b37b8e00394bda3b\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"eth-mainnet.gateway.pokt.network\";\n case \"goerli\":\n return \"eth-goerli.gateway.pokt.network\";\n case \"matic\":\n return \"poly-mainnet.gateway.pokt.network\";\n case \"matic-mumbai\":\n return \"polygon-mumbai-rpc.gateway.pokt.network\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **PocketProvider** connects to the [[link-pocket]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API key is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-pocket-signup).\n */\nexport class PocketProvider extends JsonRpcProvider {\n /**\n * The Application ID for the Pocket connection.\n */\n applicationId;\n /**\n * The Application Secret for making authenticated requests\n * to the Pocket connection.\n */\n applicationSecret;\n /**\n * Create a new **PocketProvider**.\n *\n * By default connecting to ``mainnet`` with a highly throttled\n * API key.\n */\n constructor(_network, applicationId, applicationSecret) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n if (applicationSecret == null) {\n applicationSecret = null;\n }\n const options = { staticNetwork: network };\n const request = PocketProvider.getRequest(network, applicationId, applicationSecret);\n super(request, network, options);\n defineProperties(this, {\n applicationId,\n applicationSecret,\n });\n }\n _getProvider(networkId) {\n try {\n return new PocketProvider(networkId, this.applicationId, this.applicationSecret);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n /**\n * Returns a prepared request for connecting to %%network%% with\n * %%applicationId%%.\n */\n static getRequest(network, applicationId, applicationSecret) {\n if (applicationId == null) {\n applicationId = defaultApplicationId;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/v1/lb/${applicationId}`);\n request.allowGzip = true;\n if (applicationSecret) {\n request.setCredentials(\"\", applicationSecret);\n }\n if (applicationId === defaultApplicationId) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"PocketProvider\");\n return true;\n };\n }\n return request;\n }\n isCommunityResource() {\n return this.applicationId === defaultApplicationId;\n }\n}\n//# sourceMappingURL=provider-pocket.js.map"],"names":["assertArgument","JsonRpcProvider","network","Network","defineProperties","FetchRequest","showThrottleMessage"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,MAAM,oBAAoB,GAAG,0BAA0B;AACvD,SAAS,OAAO,CAA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S,CAAC;AACV,IAAI;AACJ,IAAI,YAAY,CAAC,SAAS,EAAE;AAC5B,QAAQ,IAAI;AACZ,YAAY,OAAO,IAAI,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,iBAAiB,CAAC;AAC5F,QAAQ;AACR,QAAQ,OAAO,KAAK,EAAE,EAAE;AACxB,QAAQ,OAAO,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC;AAC5C,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE;AACjE,QAAQ,IAAI,aAAa,IAAI,IAAI,EAAE;AACnC,YAAY,aAAa,GAAG,oBAAoB;AAChD,QAAQ;AACR,QAAQ,MAAM,OAAO,GAAG,IAAIC,kBAAY,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC;AACpG,QAAQ,OAAO,CAAC,SAAS,GAAG,IAAI;AAChC,QAAQ,IAAI,iBAAiB,EAAE;AAC/B,YAAY,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC;AACzD,QAAQ;AACR,QAAQ,IAAI,aAAa,KAAK,oBAAoB,EAAE;AACpD,YAAY,OAAO,CAAC,SAAS,GAAG,OAAO,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK;AACtE,gBAAgBC,6BAAmB,CAAC,gBAAgB,CAAC;AACrD,gBAAgB,OAAO,IAAI;AAC3B,YAAY,CAAC;AACb,QAAQ;AACR,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ,IAAI,mBAAmB,GAAG;AAC1B,QAAQ,OAAO,IAAI,CAAC,aAAa,KAAK,oBAAoB;AAC1D,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-quicknode.d.ts b/lib.commonjs/providers/provider-quicknode.d.ts deleted file mode 100644 index 610dc234a..000000000 --- a/lib.commonjs/providers/provider-quicknode.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -export declare class QuickNodeProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API token. - */ - readonly token: string; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network?: Networkish, token?: null | string); - _getProvider(networkId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network: Network, token?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-quicknode.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-quicknode.d.ts.map b/lib.commonjs/providers/provider-quicknode.d.ts.map deleted file mode 100644 index f3be4df32..000000000 --- a/lib.commonjs/providers/provider-quicknode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B/C;;;;;;;;GAQG;AACH,qBAAa,iBACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,EAavD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAmBvE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-quicknode.js b/lib.commonjs/providers/provider-quicknode.js deleted file mode 100644 index 34dc92116..000000000 --- a/lib.commonjs/providers/provider-quicknode.js +++ /dev/null @@ -1,112 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -var fetch = require('../utils/fetch.js'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var community = require('./community.js'); -var network = require('./network.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); - -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; -function getHost(name) { - switch (name) { - case "mainnet": - return "corebc.quiknode.pro"; - case "arbitrum": - return "corebc.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "corebc.arbitrum-goerli.quiknode.pro"; - case "matic": - return "corebc.matic.quiknode.pro"; - case "matic-mumbai": - return "corebc.matic-testnet.quiknode.pro"; - case "optimism": - return "corebc.optimism.quiknode.pro"; - case "optimism-goerli": - return "corebc.optimism-goerli.quiknode.pro"; - } - errors.assertArgument(false, "unsupported network", "network", name); -} -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -class QuickNodeProvider extends providerJsonrpc.JsonRpcProvider { - /** - * The API token. - */ - token; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network, token) { - if (_network == null) { - _network = "mainnet"; - } - const network$1 = network.Network.from(_network); - if (token == null) { - token = defaultToken; - } - const request = QuickNodeProvider.getRequest(network$1, token); - super(request, network$1, { staticNetwork: network$1 }); - properties.defineProperties(this, { token }); - } - _getProvider(networkId) { - try { - return new QuickNodeProvider(networkId, this.token); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.token === defaultToken; - } - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network, token) { - if (token == null) { - token = defaultToken; - } - const request = new fetch.FetchRequest(`https:/\/${getHost(network.name)}/${token}`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - community.showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - return request; - } -} - -exports.QuickNodeProvider = QuickNodeProvider; -//# sourceMappingURL=provider-quicknode.js.map diff --git a/lib.commonjs/providers/provider-quicknode.js.map b/lib.commonjs/providers/provider-quicknode.js.map deleted file mode 100644 index 8bd5bb1e8..000000000 --- a/lib.commonjs/providers/provider-quicknode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-quicknode.js","sources":["../../lib.esm/providers/provider-quicknode.js"],"sourcesContent":["/**\n * [[link-quicknode]] provides a third-party service for connecting to\n * various blockchains over JSON-RPC.\n *\n * **Supported Networks**\n *\n * - Core Mainnet (``mainnet``)\n * - Goerli Testnet (``goerli``)\n * - Arbitrum (``arbitrum``)\n * - Arbitrum Goerli Testnet (``arbitrum-goerli``)\n * - Optimism (``optimism``)\n * - Optimism Goerli Testnet (``optimism-goerli``)\n * - Polygon (``matic``)\n * - Polygon Mumbai Testnet (``matic-mumbai``)\n *\n * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode]\n */\nimport { defineProperties, FetchRequest, assertArgument, } from \"../utils/index.js\";\nimport { showThrottleMessage } from \"./community.js\";\nimport { Network } from \"./network.js\";\nimport { JsonRpcProvider } from \"./provider-jsonrpc.js\";\nconst defaultToken = \"919b412a057b5e9c9b6dce193c5a60242d6efadb\";\nfunction getHost(name) {\n switch (name) {\n case \"mainnet\":\n return \"corebc.quiknode.pro\";\n case \"arbitrum\":\n return \"corebc.arbitrum-mainnet.quiknode.pro\";\n case \"arbitrum-goerli\":\n return \"corebc.arbitrum-goerli.quiknode.pro\";\n case \"matic\":\n return \"corebc.matic.quiknode.pro\";\n case \"matic-mumbai\":\n return \"corebc.matic-testnet.quiknode.pro\";\n case \"optimism\":\n return \"corebc.optimism.quiknode.pro\";\n case \"optimism-goerli\":\n return \"corebc.optimism-goerli.quiknode.pro\";\n }\n assertArgument(false, \"unsupported network\", \"network\", name);\n}\n/**\n * The **QuickNodeProvider** connects to the [[link-quicknode]]\n * JSON-RPC end-points.\n *\n * By default, a highly-throttled API token is used, which is\n * appropriate for quick prototypes and simple scripts. To\n * gain access to an increased rate-limit, it is highly\n * recommended to [sign up here](link-quicknode).\n */\nexport class QuickNodeProvider extends JsonRpcProvider {\n /**\n * The API token.\n */\n token;\n /**\n * Creates a new **QuickNodeProvider**.\n */\n constructor(_network, token) {\n if (_network == null) {\n _network = \"mainnet\";\n }\n const network = Network.from(_network);\n if (token == null) {\n token = defaultToken;\n }\n const request = QuickNodeProvider.getRequest(network, token);\n super(request, network, { staticNetwork: network });\n defineProperties(this, { token });\n }\n _getProvider(networkId) {\n try {\n return new QuickNodeProvider(networkId, this.token);\n }\n catch (error) { }\n return super._getProvider(networkId);\n }\n isCommunityResource() {\n return this.token === defaultToken;\n }\n /**\n * Returns a new request prepared for %%network%% and the\n * %%token%%.\n */\n static getRequest(network, token) {\n if (token == null) {\n token = defaultToken;\n }\n const request = new FetchRequest(`https:/\\/${getHost(network.name)}/${token}`);\n request.allowGzip = true;\n //if (projectSecret) { request.setCredentials(\"\", projectSecret); }\n if (token === defaultToken) {\n request.retryFunc = async (request, response, attempt) => {\n showThrottleMessage(\"QuickNodeProvider\");\n return true;\n };\n }\n return request;\n }\n}\n//# sourceMappingURL=provider-quicknode.js.map"],"names":["assertArgument","JsonRpcProvider","network","Network","defineProperties","FetchRequest","showThrottleMessage"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA,MAAM,YAAY,GAAG,0CAA0C;AAC/D,SAAS,OAAO,CAAC,IAAI,EAAE;AACvB,IAAI,QAAQ,IAAI;AAChB,QAAQ,KAAK,SAAS;AACtB,YAAY,OAAO,qBAAqB;AACxC,QAAQ,KAAK,UAAU;AACvB,YAAY,OAAO,sCAAsC;AACzD,QAAQ,KAAK,iBA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AS,CAAC;AAC5C,IAAI;AACJ,IAAI,mBAAmB,GAAG;AAC1B,QAAQ,OAAO,IAAI,CAAC,KAAK,KAAK,YAAY;AAC1C,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE;AACtC,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;AAC3B,YAAY,KAAK,GAAG,YAAY;AAChC,QAAQ;AACR,QAAQ,MAAM,OAAO,GAAG,IAAIC,kBAAY,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACtF,QAAQ,OAAO,CAAC,SAAS,GAAG,IAAI;AAChC;AACA,QAAQ,IAAI,KAAK,KAAK,YAAY,EAAE;AACpC,YAAY,OAAO,CAAC,SAAS,GAAG,OAAO,OAAO,EAAE,QAAQ,EAAE,OAAO,KAAK;AACtE,gBAAgBC,6BAAmB,CAAC,mBAAmB,CAAC;AACxD,gBAAgB,OAAO,IAAI;AAC3B,YAAY,CAAC;AACb,QAAQ;AACR,QAAQ,OAAO,OAAO;AACtB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-socket.d.ts b/lib.commonjs/providers/provider-socket.d.ts deleted file mode 100644 index 7ee5054ce..000000000 --- a/lib.commonjs/providers/provider-socket.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider - */ -import { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -import type { Subscriber, Subscription } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcError, JsonRpcPayload, JsonRpcResult } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -export declare class SocketSubscriber implements Subscriber { - #private; - get filter(): Array; - constructor(provider: SocketProvider, filter: Array); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; - _handleMessage(message: any): void; - _emit(provider: SocketProvider, message: any): Promise; -} -export declare class SocketBlockSubscriber extends SocketSubscriber { - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -export declare class SocketPendingSubscriber extends SocketSubscriber { - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -export declare class SocketEventSubscriber extends SocketSubscriber { - #private; - get logFilter(): EventFilter; - constructor(provider: SocketProvider, filter: EventFilter); - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * SocketProvider... - * - */ -export declare class SocketProvider extends JsonRpcApiProvider { - #private; - constructor(network?: Networkish); - _getSubscriber(sub: Subscription): Subscriber; - _register(filterId: number | string, subscriber: SocketSubscriber): void; - _send(payload: JsonRpcPayload | Array): Promise>; - _processMessage(message: string): Promise; - _write(message: string): Promise; -} -//# sourceMappingURL=provider-socket.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-socket.d.ts.map b/lib.commonjs/providers/provider-socket.d.ts.map deleted file mode 100644 index e919560e4..000000000 --- a/lib.commonjs/providers/provider-socket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-socket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,aAAa,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU/C,qBAAa,gBAA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,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI,CASvE;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAuB9C;IAkBK,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCpD;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-socket.js b/lib.commonjs/providers/provider-socket.js deleted file mode 100644 index b6868ff7c..000000000 --- a/lib.commonjs/providers/provider-socket.js +++ /dev/null @@ -1,241 +0,0 @@ -'use strict'; - -var abstractProvider = require('./abstract-provider.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var providerJsonrpc = require('./provider-jsonrpc.js'); - -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider - */ -class SocketSubscriber { - #provider; - #filter; - get filter() { - return JSON.parse(this.#filter); - } - #filterId; - #paused; - #emitPromise; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - start() { - this.#filterId = this.#provider - .send("xcb_subscribe", this.filter) - .then((filterId) => { - this.#provider._register(filterId, this); - return filterId; - }); - } - stop() { - this.#filterId.then((filterId) => { - this.#provider.send("xcb_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused) { - errors.assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - resume() { - this.#paused = null; - } - _handleMessage(message) { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } - else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - async _emit(provider, message) { - throw new Error("sub-classes must implemente this; _emit"); - } -} -class SocketBlockSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newHeads"]); - } - async _emit(provider, message) { - provider.emit("block", parseInt(message.number)); - } -} -class SocketPendingSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newPendingTransactions"]); - } - async _emit(provider, message) { - provider.emit("pending", message); - } -} -class SocketEventSubscriber extends SocketSubscriber { - #logFilter; - get logFilter() { - return JSON.parse(this.#logFilter); - } - constructor(provider, filter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - async _emit(provider, message) { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } -} -/** - * SocketProvider... - * - */ -class SocketProvider extends providerJsonrpc.JsonRpcApiProvider { - #callbacks; - // Maps each filterId to its subscriber - #subs; - // If any events come in before a subscriber has finished - // registering, queue them - #pending; - constructor(network) { - super(network, { batchMaxCount: 1 }); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - _getSubscriber(sub) { - switch (sub.type) { - case "close": - return new abstractProvider.UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new abstractProvider.UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - _register(filterId, subscriber) { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - async _send(payload) { - // WebSocket provider doesn't accept batches - errors.assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - // @TODO: stringify payloads here and store to prevent mutations - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - // Write the request to the socket - await this._write(JSON.stringify(payload)); - return [await promise]; - } - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - // Sub-classes must call this for each message - async _processMessage(message) { - const result = (JSON.parse(message)); - if ("id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", errors.makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result, - })); - return; - } - this.#callbacks.delete(result.id); - callback.resolve(result); - } - else if (result.method === "xcb_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } - else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - } - async _write(message) { - throw new Error("sub-classes must override this"); - } -} - -exports.SocketBlockSubscriber = SocketBlockSubscriber; -exports.SocketEventSubscriber = SocketEventSubscriber; -exports.SocketPendingSubscriber = SocketPendingSubscriber; -exports.SocketProvider = SocketProvider; -exports.SocketSubscriber = SocketSubscriber; -//# sourceMappingURL=provider-socket.js.map diff --git a/lib.commonjs/providers/provider-socket.js.map b/lib.commonjs/providers/provider-socket.js.map deleted file mode 100644 index 8330a7e9b..000000000 --- a/lib.commonjs/providers/provider-socket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-socket.js","sources":["../../lib.esm/providers/provider-socket.js"],"sourcesContent":["/**\n * Generic long-lived socket provider.\n *\n * Sub-classing notes\n * - a sub-class MUST call the `_start()` method once connected\n * - a sub-class MUST override the `_write(string)` method\n * - a sub-class MUST call `_processMessage(string)` for each message\n *\n * @_subsection: api/providers/abstract-provider\n */\nimport { UnmanagedSubscriber } from \"./abstract-provider.js\";\nimport { assert, assertArgument, makeError } from \"../utils/index.js\";\nimport { JsonRpcApiProvider } from \"./provider-jsonrpc.js\";\nexport class SocketSubscriber {\n #provider;\n #filter;\n get filter() {\n return JSON.parse(this.#filter);\n }\n #filterId;\n #paused;\n #emitPromise;\n constructor(provider, filter) {\n this.#provider = provider;\n this.#filter = JSON.stringify(filter);\n this.#filterId = null;\n this.#paused = null;\n this.#emitPromise = null;\n }\n start() {\n this.#filterId = this.#provider\n .send(\"xcb_subscribe\", this.filter)\n .then((filterId) => {\n this.#provider._register(filterId, this);\n return filterId;\n });\n }\n stop() {\n this.#filterId.then((filterId) => {\n this.#provider.send(\"xcb_unsubscribe\", [filterId]);\n });\n this.#filterId = null;\n }\n // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs\n // and resume\n pause(dropWhilePaused) {\n assert(dropWhilePaused, \"preserve logs while paused not supported by SocketSubscriber yet\", \"UNSUPPORTED_OPERATION\", { operation: \"pause(false)\" });\n this.#paused = !!dropWhilePaused;\n }\n resume() {\n this.#paused = null;\n }\n _handleMessage(message) {\n if (this.#filterId == null) {\n return;\n }\n if (this.#paused === null) {\n let emitPromise = this.#emitPromise;\n if (emitPromise == null) {\n emitPromise = this._emit(this.#provider, message);\n }\n else {\n emitPromise = emitPromise.then(async () => {\n await this._emit(this.#provider, message);\n });\n }\n this.#emitPromise = emitPromise.then(() => {\n if (this.#emitPromise === emitPromise) {\n this.#emitPromise = null;\n }\n });\n }\n }\n async _emit(provider, message) {\n throw new Error(\"sub-classes must implemente this; _emit\");\n }\n}\nexport class SocketBlockSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newHeads\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"block\", parseInt(message.number));\n }\n}\nexport class SocketPendingSubscriber extends SocketSubscriber {\n constructor(provider) {\n super(provider, [\"newPendingTransactions\"]);\n }\n async _emit(provider, message) {\n provider.emit(\"pending\", message);\n }\n}\nexport class SocketEventSubscriber extends SocketSubscriber {\n #logFilter;\n get logFilter() {\n return JSON.parse(this.#logFilter);\n }\n constructor(provider, filter) {\n super(provider, [\"logs\", filter]);\n this.#logFilter = JSON.stringify(filter);\n }\n async _emit(provider, message) {\n provider.emit(this.logFilter, provider._wrapLog(message, provider._network));\n }\n}\n/**\n * SocketProvider...\n *\n */\nexport class SocketProvider extends JsonRpcApiProvider {\n #callbacks;\n // Maps each filterId to its subscriber\n #subs;\n // If any events come in before a subscriber has finished\n // registering, queue them\n #pending;\n constructor(network) {\n super(network, { batchMaxCount: 1 });\n this.#callbacks = new Map();\n this.#subs = new Map();\n this.#pending = new Map();\n }\n // This value is only valid after _start has been called\n /*\n get _network(): Network {\n if (this.#network == null) {\n throw new Error(\"this shouldn't happen\");\n }\n return this.#network.clone();\n }\n */\n _getSubscriber(sub) {\n switch (sub.type) {\n case \"close\":\n return new UnmanagedSubscriber(\"close\");\n case \"block\":\n return new SocketBlockSubscriber(this);\n case \"pending\":\n return new SocketPendingSubscriber(this);\n case \"event\":\n return new SocketEventSubscriber(this, sub.filter);\n case \"orphan\":\n // Handled auto-matically within AbstractProvider\n // when the log.removed = true\n if (sub.filter.orphan === \"drop-log\") {\n return new UnmanagedSubscriber(\"drop-log\");\n }\n }\n return super._getSubscriber(sub);\n }\n _register(filterId, subscriber) {\n this.#subs.set(filterId, subscriber);\n const pending = this.#pending.get(filterId);\n if (pending) {\n for (const message of pending) {\n subscriber._handleMessage(message);\n }\n this.#pending.delete(filterId);\n }\n }\n async _send(payload) {\n // WebSocket provider doesn't accept batches\n assertArgument(!Array.isArray(payload), \"WebSocket does not support batch send\", \"payload\", payload);\n // @TODO: stringify payloads here and store to prevent mutations\n // Prepare a promise to respond to\n const promise = new Promise((resolve, reject) => {\n this.#callbacks.set(payload.id, { payload, resolve, reject });\n });\n // Wait until the socket is connected before writing to it\n await this._waitUntilReady();\n // Write the request to the socket\n await this._write(JSON.stringify(payload));\n return [await promise];\n }\n // Sub-classes must call this once they are connected\n /*\n async _start(): Promise {\n if (this.#ready) { return; }\n\n for (const { payload } of this.#callbacks.values()) {\n await this._write(JSON.stringify(payload));\n }\n\n this.#ready = (async function() {\n await super._start();\n })();\n }\n */\n // Sub-classes must call this for each message\n async _processMessage(message) {\n const result = (JSON.parse(message));\n if (\"id\" in result) {\n const callback = this.#callbacks.get(result.id);\n if (callback == null) {\n this.emit(\"error\", makeError(\"received result for unknown id\", \"UNKNOWN_ERROR\", {\n reasonCode: \"UNKNOWN_ID\",\n result,\n }));\n return;\n }\n this.#callbacks.delete(result.id);\n callback.resolve(result);\n }\n else if (result.method === \"xcb_subscription\") {\n const filterId = result.params.subscription;\n const subscriber = this.#subs.get(filterId);\n if (subscriber) {\n subscriber._handleMessage(result.params.result);\n }\n else {\n let pending = this.#pending.get(filterId);\n if (pending == null) {\n pending = [];\n this.#pending.set(filterId, pending);\n }\n pending.push(result.params.result);\n }\n }\n }\n async _write(message) {\n throw new Error(\"sub-classes must override this\");\n }\n}\n//# sourceMappingURL=provider-socket.js.map"],"names":["assert","JsonRpcApiProvider","UnmanagedSubscriber","assertArgument","makeError"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIO,MAAM,gBAAgB,CAAC;AAC9B,IAAI,SAAS;AACb,IAAI,OAAO;AACX,IAAI,IAAI,MAAM,GAAG;AACjB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M,CAAC,MAAM,CAAC,EAAE,CAAC;AAC7C,YAAY,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;AACpC,QAAQ;AACR,aAAa,IAAI,MAAM,CAAC,MAAM,KAAK,kBAAkB,EAAE;AACvD,YAAY,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY;AACvD,YAAY,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;AACvD,YAAY,IAAI,UAAU,EAAE;AAC5B,gBAAgB,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAC/D,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,IAAI,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;AACzD,gBAAgB,IAAI,OAAO,IAAI,IAAI,EAAE;AACrC,oBAAoB,OAAO,GAAG,EAAE;AAChC,oBAAoB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC;AACxD,gBAAgB;AAChB,gBAAgB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;AAClD,YAAY;AACZ,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,MAAM,CAAC,OAAO,EAAE;AAC1B,QAAQ,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;AACzD,IAAI;AACJ;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-websocket.d.ts b/lib.commonjs/providers/provider-websocket.d.ts deleted file mode 100644 index 9938502d0..000000000 --- a/lib.commonjs/providers/provider-websocket.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SocketProvider } from "./provider-socket.js"; -import type { Networkish } from "./network.js"; -export interface WebSocketLike { - onopen: null | ((...args: Array) => any); - onmessage: null | ((...args: Array) => any); - onerror: null | ((...args: Array) => any); - readyState: number; - send(payload: any): void; - close(code?: number, reason?: string): void; -} -export type WebSocketCreator = () => WebSocketLike; -export declare class WebSocketProvider extends SocketProvider { - #private; - get websocket(): WebSocketLike; - constructor(url: string | WebSocketLike | WebSocketCreator, network?: Networkish); - _write(message: string): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-websocket.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider-websocket.d.ts.map b/lib.commonjs/providers/provider-websocket.d.ts.map deleted file mode 100644 index 57f785f9c..000000000 --- a/lib.commonjs/providers/provider-websocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-websocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9C,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IACjD,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD,qBAAa,iBAAkB,SAAQ,cAAc;;IAIpD,IAAI,SAAS,IAAI,aAAa,CAK7B;IAED,YACC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,gBAAgB,EAC9C,OAAO,CAAC,EAAE,UAAU,EA4CpB;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAM7B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider-websocket.js b/lib.commonjs/providers/provider-websocket.js deleted file mode 100644 index 6c5370958..000000000 --- a/lib.commonjs/providers/provider-websocket.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -var ws = require('ws'); -var providerSocket = require('./provider-socket.js'); - -class WebSocketProvider extends providerSocket.SocketProvider { - #connect; - #websocket; - get websocket() { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } - constructor(url, network) { - super(network); - if (typeof url === "string") { - this.#connect = () => { - return new ws.WebSocket(url); - }; - this.#websocket = this.#connect(); - } - else if (typeof url === "function") { - this.#connect = url; - this.#websocket = url(); - } - else { - this.#connect = null; - this.#websocket = url; - } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } - catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - this.websocket.onmessage = (message) => { - this._processMessage(message.data); - }; - /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; -*/ - } - async _write(message) { - this.websocket.send(message); - } - async destroy() { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } -} - -exports.WebSocketProvider = WebSocketProvider; -//# sourceMappingURL=provider-websocket.js.map diff --git a/lib.commonjs/providers/provider-websocket.js.map b/lib.commonjs/providers/provider-websocket.js.map deleted file mode 100644 index 3c41971ed..000000000 --- a/lib.commonjs/providers/provider-websocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-websocket.js","sources":["../../lib.esm/providers/provider-websocket.js"],"sourcesContent":["import { WebSocket as _WebSocket } from \"./ws.js\"; /*-browser*/\nimport { SocketProvider } from \"./provider-socket.js\";\nexport class WebSocketProvider extends SocketProvider {\n #connect;\n #websocket;\n get websocket() {\n if (this.#websocket == null) {\n throw new Error(\"websocket closed\");\n }\n return this.#websocket;\n }\n constructor(url, network) {\n super(network);\n if (typeof url === \"string\") {\n this.#connect = () => {\n return new _WebSocket(url);\n };\n this.#websocket = this.#connect();\n }\n else if (typeof url === \"function\") {\n this.#connect = url;\n this.#websocket = url();\n }\n else {\n this.#connect = null;\n this.#websocket = url;\n }\n this.websocket.onopen = async () => {\n try {\n await this._start();\n this.resume();\n }\n catch (error) {\n console.log(\"failed to start WebsocketProvider\", error);\n // @TODO: now what? Attempt reconnect?\n }\n };\n this.websocket.onmessage = (message) => {\n this._processMessage(message.data);\n };\n /*\n this.websocket.onclose = (event) => {\n // @TODO: What event.code should we reconnect on?\n const reconnect = false;\n if (reconnect) {\n this.pause(true);\n if (this.#connect) {\n this.#websocket = this.#connect();\n this.#websocket.onopen = ...\n // @TODO: this requires the super class to rebroadcast; move it there\n }\n this._reconnect();\n }\n };\n*/\n }\n async _write(message) {\n this.websocket.send(message);\n }\n async destroy() {\n if (this.#websocket != null) {\n this.#websocket.close();\n this.#websocket = null;\n }\n super.destroy();\n }\n}\n//# sourceMappingURL=provider-websocket.js.map"],"names":["SocketProvider","_WebSocket"],"mappings":";;;;;AAEO,MAAM,iBAAiB,SAASA,6BAAc,CAAC;AACtD,IAAI,QAAQ;AACZ,IAAI,UAAU;AACd,IAAI,IAAI,SAAS,GAAG;AACpB,QAAQ,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;AACrC,YAAY,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC;AAC/C,QAAQ;AACR,QAAQ,OAAO,IAAI,CAAC,UAAU;AAC9B,IAAI;AAC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I;AACJ,IAAI,MAAM,OAAO,GAAG;AACpB,QAAQ,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;AACrC,YAAY,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE;AACnC,YAAY,IAAI,CAAC,UAAU,GAAG,IAAI;AAClC,QAAQ;AACR,QAAQ,KAAK,CAAC,OAAO,EAAE;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider.d.ts b/lib.commonjs/providers/provider.d.ts deleted file mode 100644 index 68556f754..000000000 --- a/lib.commonjs/providers/provider.d.ts +++ /dev/null @@ -1,623 +0,0 @@ -import type { AddressLike, NameResolver } from "../address/index.js"; -import type { BigNumberish, EventEmitterable } from "../utils/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { Network } from "./network.js"; -export type BlockTag = BigNumberish | string; -import { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -export declare class FeeData { - /** - * The energy price for legacy networks. - */ - readonly energyPrice: null | bigint; - constructor(energyPrice?: null | bigint); - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; -} -export interface TransactionRequest { - type?: null | number; - to?: null | AddressLike; - from?: null | AddressLike; - nonce?: null | number; - energyLimit?: null | BigNumberish; - energyPrice?: null | BigNumberish; - data?: null | string; - value?: null | BigNumberish; - networkId?: null | BigNumberish; - customData?: any; - blockTag?: BlockTag; - enableCcipRead?: boolean; -} -export interface PreparedTransactionRequest { - to?: AddressLike; - from?: AddressLike; - nonce?: number; - energyLimit?: bigint; - energyPrice?: bigint; - data?: string; - value?: bigint; - networkId?: bigint; - customData?: any; - blockTag?: BlockTag; - enableCcipRead?: boolean; -} -export declare function copyRequest(req: TransactionRequest): PreparedTransactionRequest; -/** - * An Interface to indicate a [[Block]] has been included in the - * blockchain. This asserts a Type Guard that necessary properties - * are non-null. - * - * Before a block is included, it is a //pending// block. - */ -export interface MinedBlock extends Block { - readonly number: number; - readonly hash: string; - readonly timestamp: number; - readonly date: Date; - readonly miner: string; -} -/** - * A **Block** represents the data associated with a full block on - * Core. - */ -export declare class Block implements BlockParams, Iterable { - #private; - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - readonly number: number; - /** - * The block hash. - */ - readonly hash: null | string; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - readonly timestamp: number; - /** - * The block hash of the parent block. - */ - readonly parentHash: string; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - readonly nonce: string; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - readonly difficulty: bigint; - /** - * The total energy limit for this block. - */ - readonly energyLimit: bigint; - /** - * The total energy used in this block. - */ - readonly energyUsed: bigint; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - readonly miner: string; - /** - * Any extra data the validator wished to include. - */ - readonly extraData: string; - /** - * The base fee per energy that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - readonly baseFeePerEnergy: null | bigint; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block: BlockParams, provider: Provider); - /** - * Returns the list of transaction hashes. - */ - get transactions(): ReadonlyArray; - /** - * Returns the complete transactions for blocks which - * prefetched them, by passing ``true`` to %%prefetchTxs%% - * into [[provider_getBlock]]. - */ - get prefetchedTransactions(): Array; - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; - [Symbol.iterator](): Iterator; - /** - * The number of transactions in this block. - */ - get length(): number; - /** - * The [[link-js-date]] this block was included at. - */ - get date(): null | Date; - /** - * Get the transaction at %%indexe%% within this block. - */ - getTransaction(indexOrHash: number | string): Promise; - getPrefetchedTransaction(indexOrHash: number | string): TransactionResponse; - /** - * Has this block been mined. - * - * If true, the block has been typed-gaurded that all mined - * properties are non-null. - */ - isMined(): this is MinedBlock; - /** - * - */ - isLondon(): this is Block & { - baseFeePerEnergy: bigint; - }; - orphanedEvent(): OrphanFilter; -} -export declare class Log implements LogParams { - readonly provider: Provider; - readonly transactionHash: string; - readonly blockHash: string; - readonly blockNumber: number; - readonly removed: boolean; - readonly address: string; - readonly data: string; - readonly topics: ReadonlyArray; - readonly index: number; - readonly transactionIndex: number; - constructor(log: LogParams, provider: Provider); - toJSON(): any; - getBlock(): Promise; - getTransaction(): Promise; - getTransactionReceipt(): Promise; - removedEvent(): OrphanFilter; -} -export declare class TransactionReceipt implements TransactionReceiptParams, Iterable { - #private; - readonly provider: Provider; - readonly to: null | string; - readonly from: string; - readonly contractAddress: null | string; - readonly hash: string; - readonly index: number; - readonly blockHash: string; - readonly blockNumber: number; - readonly logsBloom: string; - readonly energyUsed: bigint; - readonly cumulativeEnergyUsed: bigint; - readonly energyPrice: bigint; - readonly type: number; - readonly status: null | number; - readonly root: null | string; - constructor(tx: TransactionReceiptParams, provider: Provider); - get logs(): ReadonlyArray; - toJSON(): any; - get length(): number; - [Symbol.iterator](): Iterator; - get fee(): bigint; - getBlock(): Promise; - getTransaction(): Promise; - getResult(): Promise; - confirmations(): Promise; - removedEvent(): OrphanFilter; - reorderedEvent(other?: TransactionResponse): OrphanFilter; -} -export interface MinedTransactionResponse extends TransactionResponse { - blockNumber: number; - blockHash: string; - date: Date; -} -export declare class TransactionResponse implements TransactionLike, TransactionResponseParams { - #private; - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - readonly provider: Provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockNumber: null | number; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockHash: null | string; - /** - * The index within the block that this transaction resides at. - */ - readonly index: number; - /** - * The transaction hash. - */ - readonly hash: string; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - readonly type: number; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - readonly to: null | string; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - readonly from: string; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - readonly nonce: number; - /** - * The maximum units of energy this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - readonly energyLimit: bigint; - /** - * The energy price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective energy price// (the fee per energy that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerEnergy]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of energy the transaction - * consumes. - */ - readonly energyPrice: bigint; - /** - * The data. - */ - readonly data: string; - /** - * The value, in ore. Use [[formatXCB]] to format this value - * as xcb. - */ - readonly value: bigint; - /** - * The chain ID. - */ - readonly networkId: bigint; - /** - * The signature. - */ - readonly signature: string; - /** - * Create a new TransactionResponse with %%tx%% parameters - * connected to %%provider%%. - */ - constructor(tx: TransactionResponseParams, provider: Provider); - /** - * Returns a JSON representation of this transaction. - */ - toJSON(): any; - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - getBlock(): Promise; - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - getTransaction(): Promise; - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - wait(_confirms?: number, _timeout?: number): Promise; - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined(): this is MinedTransactionResponse; - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy(): this is TransactionResponse & { - accessList: null; - maxFeePerEnergy: null; - maxPriorityFeePerEnergy: null; - }; - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent(): OrphanFilter; - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter; - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock: number): TransactionResponse; -} -/** - * An Orphan Filter allows detecting when an orphan block has - * resulted in dropping a block or transaction or has resulted - * in transactions changing order. - * - * Not currently fully supported. - */ -export type OrphanFilter = { - orphan: "drop-block"; - hash: string; - number: number; -} | { - orphan: "drop-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "reorder-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "drop-log"; - log: { - transactionHash: string; - blockHash: string; - blockNumber: number; - address: string; - data: string; - topics: ReadonlyArray; - index: number; - }; -}; -/** - * A **TopicFilter** provides a struture to define bloom-filter - * queries. - * - * Each field that is ``null`` matches **any** value, a field that is - * a ``string`` must match exactly that value and and ``array`` is - * effectively an ``OR``-ed set, where any one of those values must - * match. - */ -export type TopicFilter = Array>; -export interface EventFilter { - address?: AddressLike | Array; - topics?: TopicFilter; -} -export interface Filter extends EventFilter { - fromBlock?: BlockTag; - toBlock?: BlockTag; -} -export interface FilterByBlockHash extends EventFilter { - blockHash?: string; -} -export type ProviderEvent = string | Array> | EventFilter | OrphanFilter; -/** - * A **Provider** is the primary method to interact with the read-only - * content on Core. - * - * It allows access to details about accounts, blocks and transactions - * and the ability to query event logs and simulate contract execution. - * - * Account data includes the [balance](getBalance), - * [transaction count](getTransactionCount), [code](getCode) and - * [state trie storage](getStorage). - * - * Simulating execution can be used to [call](call), - * [estimate energy](estimateEnergy) and - * [get transaction results](getTransactionResult). - * - * The [[broadcastTransaction]] is the only method which allows updating - * the blockchain, but it is usually accessed by a [[Signer]], since a - * private key must be used to sign the transaction before it can be - * broadcast. - */ -export interface Provider extends ContractRunner, EventEmitterable, NameResolver { - /** - * The provider iteself. - * - * This is part of the necessary API for executing a contract, as - * it provides a common property on any [[ContractRunner]] that - * can be used to access the read-only portion of the runner. - */ - provider: this; - /** - * Shutdown any resources this provider is using. No additional - * calls should be made to this provider after calling this. - */ - destroy(): void; - /** - * Get the current block number. - */ - getBlockNumber(): Promise; - /** - * Get the connected [[Network]]. - */ - getNetwork(): Promise; - /** - * Get the best guess at the recommended [[FeeData]]. - */ - getFeeData(): Promise; - /** - * Get the account balance (in ore) of %%address%%. If %%blockTag%% - * is specified and the node supports archive access for that - * %%blockTag%%, the balance is as of that [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the number of transactions ever sent for %%address%%, which - * is used as the ``nonce`` when sending a transaction. If - * %%blockTag%% is specified and the node supports archive access - * for that %%blockTag%%, the transaction count is as of that - * [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the bytecode for %%address%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the storage slot value for %%address%% at slot %%position%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getStorage(address: AddressLike, position: BigNumberish, blockTag?: BlockTag): Promise; - /** - * Estimates the amount of energy required to executre %%tx%%. - */ - estimateEnergy(tx: TransactionRequest): Promise; - /** - * Simulate the execution of %%tx%%. If the call reverts, it will - * throw a [[CallExceptionError]] which includes the revert data. - */ - call(tx: TransactionRequest): Promise; - /** - * Broadcasts the %%signedTx%% to the network, adding it to the - * memory pool of any node for which the transaction meets the - * rebroadcast requirements. - */ - broadcastTransaction(signedTx: string): Promise; - /** - * Resolves to the block for %%blockHashOrBlockTag%%. - * - * If %%prefetchTxs%%, and the backend supports including transactions - * with block requests, all transactions will be included and the - * [[Block]] object will not need to make remote calls for getting - * transactions. - */ - getBlock(blockHashOrBlockTag: BlockTag | string, prefetchTxs?: boolean): Promise; - /** - * Resolves to the transaction for %%hash%%. - * - * If the transaction is unknown or on pruning nodes which - * discard old transactions this resolves to ``null``. - */ - getTransaction(hash: string): Promise; - /** - * Resolves to the transaction receipt for %%hash%%, if mined. - * - * If the transaction has not been mined, is unknown or on - * pruning nodes which discard old transactions this resolves to - * ``null``. - */ - getTransactionReceipt(hash: string): Promise; - /** - * Resolves to the result returned by the executions of %%hash%%. - * - * This is only supported on nodes with archive access and with - * the necessary debug APIs enabled. - */ - getTransactionResult(hash: string): Promise; - /** - * Resolves to the list of Logs that match %%filter%% - */ - getLogs(filter: Filter | FilterByBlockHash): Promise>; - /** - * Resolves to the address configured for the %%ensName%% or - * ``null`` if unconfigured. - */ - /** - * Waits until the transaction %%hash%% is mined and has %%confirms%% - * confirmations. - */ - waitForTransaction(hash: string, confirms?: number, timeout?: number): Promise; - /** - * Resolves to the block at %%blockTag%% once it has been mined. - * - * This can be useful for waiting some number of blocks by using - * the ``currentBlockNumber + N``. - */ - waitForBlock(blockTag?: BlockTag): Promise; -} -//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/provider.d.ts.map b/lib.commonjs/providers/provider.d.ts.map deleted file mode 100644 index 5f7427dc0..000000000 --- a/lib.commonjs/providers/provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAE7C,OAAO,EACN,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAoBzB;;;GAGG;AACH,qBAAa,OAAO;IACnB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAG,IAAI,GAAG,MAAM,CAAC;IAErC,YAAY,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,EAItC;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CAMZ;CACD;AAED,MAAM,WAAW,kBAAkB;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,EAAE,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC;IACxB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,WAAW,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;IAEzB;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,mBAAmB,CAAC,CAAC;IAElE;;;;;;OAMG;IACH,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAExE;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAK3D;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAKjE;;;OAGG;IAEH;;;OAGG;IACH,kBAAkB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAClD"} \ No newline at end of file diff --git a/lib.commonjs/providers/provider.js b/lib.commonjs/providers/provider.js deleted file mode 100644 index efd1914eb..000000000 --- a/lib.commonjs/providers/provider.js +++ /dev/null @@ -1,966 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); - -const BN_0 = BigInt(0); -// ----------------------- -function getValue(value) { - if (value == null) { - return null; - } - return value; -} -function toJson(value) { - if (value == null) { - return null; - } - return value.toString(); -} -// @TODO? implements Required -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -class FeeData { - /** - * The energy price for legacy networks. - */ - energyPrice; - constructor(energyPrice) { - properties.defineProperties(this, { - energyPrice: getValue(energyPrice), - }); - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { energyPrice } = this; - return { - _type: "FeeData", - energyPrice: toJson(energyPrice), - }; - } -} -function copyRequest(req) { - const result = {}; - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = data.hexlify(req.data); - } - const bigIntKeys = "networkId,energyLimit,energyPrice,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = maths.getBigInt(req[key], `request.${key}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = maths.getNumber(req[key], `request.${key}`); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipReadEnabled = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - return result; -} -/** - * A **Block** represents the data associated with a full block on - * Core. - */ -class Block { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - number; - /** - * The block hash. - */ - hash; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - timestamp; - /** - * The block hash of the parent block. - */ - parentHash; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - nonce; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - difficulty; - /** - * The total energy limit for this block. - */ - energyLimit; - /** - * The total energy used in this block. - */ - energyUsed; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - miner; - /** - * Any extra data the validator wished to include. - */ - extraData; - /** - * The base fee per energy that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - baseFeePerEnergy; - #transactions; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block, provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof tx !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - properties.defineProperties(this, { - provider, - hash: getValue(block.hash), - number: block.number, - timestamp: block.timestamp, - parentHash: block.parentHash, - nonce: block.nonce, - difficulty: block.difficulty, - energyLimit: block.energyLimit, - energyUsed: block.energyUsed, - miner: block.miner, - extraData: block.extraData, - baseFeePerEnergy: getValue(block.baseFeePerEnergy), - }); - } - /** - * Returns the list of transaction hashes. - */ - get transactions() { - return this.#transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return tx.hash; - }); - } - /** - * Returns the complete transactions for blocks which - * prefetched them, by passing ``true`` to %%prefetchTxs%% - * into [[provider_getBlock]]. - */ - get prefetchedTransactions() { - const txs = this.#transactions.slice(); - // Doesn't matter... - if (txs.length === 0) { - return []; - } - // Make sure we prefetched the transactions - errors.assert(typeof txs[0] === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()", - }); - return txs; - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this; - return { - _type: "Block", - baseFeePerEnergy: toJson(baseFeePerEnergy), - difficulty: toJson(difficulty), - extraData, - energyLimit: toJson(energyLimit), - energyUsed: toJson(energyUsed), - hash, - miner, - nonce, - number, - parentHash, - timestamp, - transactions, - }; - } - [Symbol.iterator]() { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The number of transactions in this block. - */ - get length() { - return this.#transactions.length; - } - /** - * The [[link-js-date]] this block was included at. - */ - get date() { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash) { - // Find the internal value by its index or hash - let tx = undefined; - if (typeof indexOrHash === "number") { - tx = this.#transactions[indexOrHash]; - } - else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof v === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } - else { - if (v.hash === hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - if (typeof tx === "string") { - return await this.provider.getTransaction(tx); - } - else { - return tx; - } - } - getPrefetchedTransaction(indexOrHash) { - const txs = this.prefetchedTransactions; - if (typeof indexOrHash === "number") { - return txs[indexOrHash]; - } - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - errors.assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); - } - /** - * Has this block been mined. - * - * If true, the block has been typed-gaurded that all mined - * properties are non-null. - */ - isMined() { - return !!this.hash; - } - /** - * - */ - isLondon() { - return !!this.baseFeePerEnergy; - } - orphanedEvent() { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } -} -////////////////////// -// Log -class Log { - provider; - transactionHash; - blockHash; - blockNumber; - removed; - address; - data; - topics; - index; - transactionIndex; - constructor(log, provider) { - this.provider = provider; - const topics = Object.freeze(log.topics.slice()); - properties.defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - removed: log.removed, - address: log.address, - data: log.data, - topics, - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - toJSON() { - const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this; - return { - _type: "log", - address, - blockHash, - blockNumber, - data, - index, - removed, - topics, - transactionHash, - transactionIndex, - }; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - errors.assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.transactionHash); - errors.assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - async getTransactionReceipt() { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - errors.assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); - return receipt; - } - removedEvent() { - return createRemovedLogFilter(this); - } -} -////////////////////// -// Transaction Receipt -/* -export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; -} - -export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; -} -*/ -class TransactionReceipt { - provider; - to; - from; - contractAddress; - hash; - index; - blockHash; - blockNumber; - logsBloom; - energyUsed; - cumulativeEnergyUsed; - energyPrice; - type; - //readonly byzantium!: boolean; - status; - root; - #logs; - constructor(tx, provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - properties.defineProperties(this, { - provider, - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - hash: tx.hash, - index: tx.index, - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - logsBloom: tx.logsBloom, - energyUsed: tx.energyUsed, - cumulativeEnergyUsed: tx.cumulativeEnergyUsed, - energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice), - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root, - }); - } - get logs() { - return this.#logs; - } - toJSON() { - const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, - status, root, } = this; - return { - _type: "TransactionReceipt", - blockHash, - blockNumber, - //byzantium, - contractAddress, - cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed), - from, - energyPrice: toJson(this.energyPrice), - energyUsed: toJson(this.energyUsed), - hash, - index, - logs, - logsBloom, - root, - status, - to, - }; - } - get length() { - return this.logs.length; - } - [Symbol.iterator]() { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - }, - }; - } - get fee() { - return this.energyUsed * this.energyPrice; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - async getResult() { - return await this.provider.getTransactionResult(this.hash); - } - async confirmations() { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - removedEvent() { - return createRemovedTransactionFilter(this); - } - reorderedEvent(other) { - errors.assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } -} -/* -export type ReplacementDetectionSetup = { - to: string; - from: string; - value: bigint; - data: string; - nonce: number; - block: number; -}; -*/ -class TransactionResponse { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockNumber; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockHash; - /** - * The index within the block that this transaction resides at. - */ - index; - /** - * The transaction hash. - */ - hash; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - type; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - to; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - from; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - nonce; - /** - * The maximum units of energy this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - energyLimit; - /** - * The energy price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective energy price// (the fee per energy that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerEnergy]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of energy the transaction - * consumes. - */ - energyPrice; - /** - * The data. - */ - data; - /** - * The value, in ore. Use [[formatXCB]] to format this value - * as xcb. - */ - value; - /** - * The chain ID. - */ - networkId; - /** - * The signature. - */ - signature; - #startBlock; - /** - * Create a new TransactionResponse with %%tx%% parameters - * connected to %%provider%%. - */ - constructor(tx, provider) { - this.provider = provider; - this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null; - this.blockHash = tx.blockHash != null ? tx.blockHash : null; - this.hash = tx.hash; - this.index = tx.index; - this.from = tx.from; - this.to = tx.to || null; - this.energyLimit = tx.energyLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - this.energyPrice = tx.energyPrice; - this.networkId = tx.networkId; - this.signature = tx.signature; - this.#startBlock = -1; - } - /** - * Returns a JSON representation of this transaction. - */ - toJSON() { - const { index, hash, type, to, from, nonce, data, signature } = this; - return { - _type: "TransactionReceipt", - networkId: toJson(this.networkId), - data, - from, - energyLimit: toJson(this.energyLimit), - energyPrice: toJson(this.energyPrice), - hash, - nonce, - signature, - to, - index, - type, - value: toJson(this.value), - }; - } - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock() { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction() { - return this.provider.getTransaction(this.hash); - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms, _timeout) { - const confirms = _confirms == null ? 1 : _confirms; - const timeout = _timeout == null ? 0 : _timeout; - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = startBlock === -1 ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await properties.resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from), - }); - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - // We were replaced; start scanning for that transaction - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx = await block.getTransaction(i); - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - // We will retry this on the next block (this case could be optimized) - if (blockNumber - receipt.blockNumber + 1 < confirms) { - return; - } - // The reason we were replaced - let reason = "replaced"; - if (tx.data === this.data && - tx.to === this.to && - tx.value === this.value) { - reason = "repriced"; - } - else if (tx.data === "0x" && - tx.from === tx.to && - tx.value === BN_0) { - reason = "cancelled"; - } - errors.assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: reason === "replaced" || reason === "cancelled", - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt, - }); - } - } - nextScan++; - } - return; - }; - const receipt = await this.provider.getTransactionReceipt(this.hash); - if (receipt) { - if ((await receipt.confirmations()) >= confirms) { - return receipt; - } - } - else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers = []; - const cancel = () => { - cancellers.forEach((c) => c()); - }; - // On cancel, stop scanning for replacements - cancellers.push(() => { - stopScanning = true; - }); - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(errors.makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { - clearTimeout(timer); - }); - } - const txListener = async (receipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - resolve(receipt); - } - }; - cancellers.push(() => { - this.provider.off(this.hash, txListener); - }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } - catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (errors.isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { - this.provider.off("block", replaceListener); - }); - this.provider.once("block", replaceListener); - } - }); - return await waiter; - } - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined() { - return this.blockHash != null; - } - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy() { - return this.type === 0; - } - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent() { - errors.assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other) { - errors.assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - errors.assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createReorderedTransactionFilter(this, other); - } - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock) { - errors.assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } -} -function createOrphanedBlockFilter(block) { - return { orphan: "drop-block", hash: block.hash, number: block.number }; -} -function createReorderedTransactionFilter(tx, other) { - return { orphan: "reorder-transaction", tx, other }; -} -function createRemovedTransactionFilter(tx) { - return { orphan: "drop-transaction", tx }; -} -function createRemovedLogFilter(log) { - return { - orphan: "drop-log", - log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index, - }, - }; -} - -exports.Block = Block; -exports.FeeData = FeeData; -exports.Log = Log; -exports.TransactionReceipt = TransactionReceipt; -exports.TransactionResponse = TransactionResponse; -exports.copyRequest = copyRequest; -//# sourceMappingURL=provider.js.map diff --git a/lib.commonjs/providers/provider.js.map b/lib.commonjs/providers/provider.js.map deleted file mode 100644 index 00a976d6d..000000000 --- a/lib.commonjs/providers/provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.js","sources":["../../lib.esm/providers/provider.js"],"sourcesContent":["import { defineProperties, getBigInt, getNumber, hexlify, resolveProperties, assert, assertArgument, isError, makeError, } from \"../utils/index.js\";\nconst BN_0 = BigInt(0);\n// -----------------------\nfunction getValue(value) {\n if (value == null) {\n return null;\n }\n return value;\n}\nfunction toJson(value) {\n if (value == null) {\n return null;\n }\n return value.toString();\n}\n// @TODO? implements Required\n/**\n * A **FeeData** wraps all the fee-related values associated with\n * the network.\n */\nexport class FeeData {\n /**\n * The energy price for legacy networks.\n */\n energyPrice;\n constructor(energyPrice) {\n defineProperties(this, {\n energyPrice: getValue(energyPrice),\n });\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { energyPrice } = this;\n return {\n _type: \"FeeData\",\n energyPrice: toJson(energyPrice),\n };\n }\n}\nexport function copyRequest(req) {\n const result = {};\n // These could be addresses, ENS names or Addressables\n if (req.to) {\n result.to = req.to;\n }\n if (req.from) {\n result.from = req.from;\n }\n if (req.data) {\n result.data = hexlify(req.data);\n }\n const bigIntKeys = \"networkId,energyLimit,energyPrice,value\".split(/,/);\n for (const key of bigIntKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getBigInt(req[key], `request.${key}`);\n }\n const numberKeys = \"type,nonce\".split(/,/);\n for (const key of numberKeys) {\n if (!(key in req) || req[key] == null) {\n continue;\n }\n result[key] = getNumber(req[key], `request.${key}`);\n }\n if (\"blockTag\" in req) {\n result.blockTag = req.blockTag;\n }\n if (\"enableCcipRead\" in req) {\n result.enableCcipReadEnabled = !!req.enableCcipRead;\n }\n if (\"customData\" in req) {\n result.customData = req.customData;\n }\n return result;\n}\n/**\n * A **Block** represents the data associated with a full block on\n * Core.\n */\nexport class Block {\n /**\n * The provider connected to the block used to fetch additional details\n * if necessary.\n */\n provider;\n /**\n * The block number, sometimes called the block height. This is a\n * sequential number that is one higher than the parent block.\n */\n number;\n /**\n * The block hash.\n */\n hash;\n /**\n * The timestamp for this block, which is the number of seconds since\n * epoch that this block was included.\n */\n timestamp;\n /**\n * The block hash of the parent block.\n */\n parentHash;\n /**\n * The nonce.\n *\n * On legacy networks, this is the random number inserted which\n * permitted the difficulty target to be reached.\n */\n nonce;\n /**\n * The difficulty target.\n *\n * On legacy networks, this is the proof-of-work target required\n * for a block to meet the protocol rules to be included.\n *\n * On modern networks, this is a random number arrived at using\n * randao. @TODO: Find links?\n */\n difficulty;\n /**\n * The total energy limit for this block.\n */\n energyLimit;\n /**\n * The total energy used in this block.\n */\n energyUsed;\n /**\n * The miner coinbase address, wihch receives any subsidies for\n * including this block.\n */\n miner;\n /**\n * Any extra data the validator wished to include.\n */\n extraData;\n /**\n * The base fee per energy that all transactions in this block were\n * charged.\n *\n * This adjusts after each block, depending on how congested the network\n * is.\n */\n baseFeePerEnergy;\n #transactions;\n /**\n * Create a new **Block** object.\n *\n * This should generally not be necessary as the unless implementing a\n * low-level library.\n */\n constructor(block, provider) {\n this.#transactions = block.transactions.map((tx) => {\n if (typeof tx !== \"string\") {\n return new TransactionResponse(tx, provider);\n }\n return tx;\n });\n defineProperties(this, {\n provider,\n hash: getValue(block.hash),\n number: block.number,\n timestamp: block.timestamp,\n parentHash: block.parentHash,\n nonce: block.nonce,\n difficulty: block.difficulty,\n energyLimit: block.energyLimit,\n energyUsed: block.energyUsed,\n miner: block.miner,\n extraData: block.extraData,\n baseFeePerEnergy: getValue(block.baseFeePerEnergy),\n });\n }\n /**\n * Returns the list of transaction hashes.\n */\n get transactions() {\n return this.#transactions.map((tx) => {\n if (typeof tx === \"string\") {\n return tx;\n }\n return tx.hash;\n });\n }\n /**\n * Returns the complete transactions for blocks which\n * prefetched them, by passing ``true`` to %%prefetchTxs%%\n * into [[provider_getBlock]].\n */\n get prefetchedTransactions() {\n const txs = this.#transactions.slice();\n // Doesn't matter...\n if (txs.length === 0) {\n return [];\n }\n // Make sure we prefetched the transactions\n assert(typeof txs[0] === \"object\", \"transactions were not prefetched with block request\", \"UNSUPPORTED_OPERATION\", {\n operation: \"transactionResponses()\",\n });\n return txs;\n }\n /**\n * Returns a JSON-friendly value.\n */\n toJSON() {\n const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this;\n return {\n _type: \"Block\",\n baseFeePerEnergy: toJson(baseFeePerEnergy),\n difficulty: toJson(difficulty),\n extraData,\n energyLimit: toJson(energyLimit),\n energyUsed: toJson(energyUsed),\n hash,\n miner,\n nonce,\n number,\n parentHash,\n timestamp,\n transactions,\n };\n }\n [Symbol.iterator]() {\n let index = 0;\n const txs = this.transactions;\n return {\n next: () => {\n if (index < this.length) {\n return {\n value: txs[index++],\n done: false,\n };\n }\n return { value: undefined, done: true };\n },\n };\n }\n /**\n * The number of transactions in this block.\n */\n get length() {\n return this.#transactions.length;\n }\n /**\n * The [[link-js-date]] this block was included at.\n */\n get date() {\n if (this.timestamp == null) {\n return null;\n }\n return new Date(this.timestamp * 1000);\n }\n /**\n * Get the transaction at %%indexe%% within this block.\n */\n async getTransaction(indexOrHash) {\n // Find the internal value by its index or hash\n let tx = undefined;\n if (typeof indexOrHash === \"number\") {\n tx = this.#transactions[indexOrHash];\n }\n else {\n const hash = indexOrHash.toLowerCase();\n for (const v of this.#transactions) {\n if (typeof v === \"string\") {\n if (v !== hash) {\n continue;\n }\n tx = v;\n break;\n }\n else {\n if (v.hash === hash) {\n continue;\n }\n tx = v;\n break;\n }\n }\n }\n if (tx == null) {\n throw new Error(\"no such tx\");\n }\n if (typeof tx === \"string\") {\n return await this.provider.getTransaction(tx);\n }\n else {\n return tx;\n }\n }\n getPrefetchedTransaction(indexOrHash) {\n const txs = this.prefetchedTransactions;\n if (typeof indexOrHash === \"number\") {\n return txs[indexOrHash];\n }\n indexOrHash = indexOrHash.toLowerCase();\n for (const tx of txs) {\n if (tx.hash === indexOrHash) {\n return tx;\n }\n }\n assertArgument(false, \"no matching transaction\", \"indexOrHash\", indexOrHash);\n }\n /**\n * Has this block been mined.\n *\n * If true, the block has been typed-gaurded that all mined\n * properties are non-null.\n */\n isMined() {\n return !!this.hash;\n }\n /**\n *\n */\n isLondon() {\n return !!this.baseFeePerEnergy;\n }\n orphanedEvent() {\n if (!this.isMined()) {\n throw new Error(\"\");\n }\n return createOrphanedBlockFilter(this);\n }\n}\n//////////////////////\n// Log\nexport class Log {\n provider;\n transactionHash;\n blockHash;\n blockNumber;\n removed;\n address;\n data;\n topics;\n index;\n transactionIndex;\n constructor(log, provider) {\n this.provider = provider;\n const topics = Object.freeze(log.topics.slice());\n defineProperties(this, {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n removed: log.removed,\n address: log.address,\n data: log.data,\n topics,\n index: log.index,\n transactionIndex: log.transactionIndex,\n });\n }\n toJSON() {\n const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this;\n return {\n _type: \"log\",\n address,\n blockHash,\n blockNumber,\n data,\n index,\n removed,\n topics,\n transactionHash,\n transactionIndex,\n };\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n assert(!!block, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.transactionHash);\n assert(!!tx, \"failed to find transaction\", \"UNKNOWN_ERROR\", {});\n return tx;\n }\n async getTransactionReceipt() {\n const receipt = await this.provider.getTransactionReceipt(this.transactionHash);\n assert(!!receipt, \"failed to find transaction receipt\", \"UNKNOWN_ERROR\", {});\n return receipt;\n }\n removedEvent() {\n return createRemovedLogFilter(this);\n }\n}\n//////////////////////\n// Transaction Receipt\n/*\nexport interface LegacyTransactionReceipt {\n byzantium: false;\n status: null;\n root: string;\n}\n\nexport interface ByzantiumTransactionReceipt {\n byzantium: true;\n status: number;\n root: null;\n}\n*/\nexport class TransactionReceipt {\n provider;\n to;\n from;\n contractAddress;\n hash;\n index;\n blockHash;\n blockNumber;\n logsBloom;\n energyUsed;\n cumulativeEnergyUsed;\n energyPrice;\n type;\n //readonly byzantium!: boolean;\n status;\n root;\n #logs;\n constructor(tx, provider) {\n this.#logs = Object.freeze(tx.logs.map((log) => {\n return new Log(log, provider);\n }));\n defineProperties(this, {\n provider,\n to: tx.to,\n from: tx.from,\n contractAddress: tx.contractAddress,\n hash: tx.hash,\n index: tx.index,\n blockHash: tx.blockHash,\n blockNumber: tx.blockNumber,\n logsBloom: tx.logsBloom,\n energyUsed: tx.energyUsed,\n cumulativeEnergyUsed: tx.cumulativeEnergyUsed,\n energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice),\n //byzantium: tx.byzantium,\n status: tx.status,\n root: tx.root,\n });\n }\n get logs() {\n return this.#logs;\n }\n toJSON() {\n const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium,\n status, root, } = this;\n return {\n _type: \"TransactionReceipt\",\n blockHash,\n blockNumber,\n //byzantium,\n contractAddress,\n cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed),\n from,\n energyPrice: toJson(this.energyPrice),\n energyUsed: toJson(this.energyUsed),\n hash,\n index,\n logs,\n logsBloom,\n root,\n status,\n to,\n };\n }\n get length() {\n return this.logs.length;\n }\n [Symbol.iterator]() {\n let index = 0;\n return {\n next: () => {\n if (index < this.length) {\n return { value: this.logs[index++], done: false };\n }\n return { value: undefined, done: true };\n },\n };\n }\n get fee() {\n return this.energyUsed * this.energyPrice;\n }\n async getBlock() {\n const block = await this.provider.getBlock(this.blockHash);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n async getTransaction() {\n const tx = await this.provider.getTransaction(this.hash);\n if (tx == null) {\n throw new Error(\"TODO\");\n }\n return tx;\n }\n async getResult() {\n return await this.provider.getTransactionResult(this.hash);\n }\n async confirmations() {\n return (await this.provider.getBlockNumber()) - this.blockNumber + 1;\n }\n removedEvent() {\n return createRemovedTransactionFilter(this);\n }\n reorderedEvent(other) {\n assert(!other || other.isMined(), \"unmined 'other' transction cannot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"reorderedEvent(other)\" });\n return createReorderedTransactionFilter(this, other);\n }\n}\n/*\nexport type ReplacementDetectionSetup = {\n to: string;\n from: string;\n value: bigint;\n data: string;\n nonce: number;\n block: number;\n};\n*/\nexport class TransactionResponse {\n /**\n * The provider this is connected to, which will influence how its\n * methods will resolve its async inspection methods.\n */\n provider;\n /**\n * The block number of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockNumber;\n /**\n * The blockHash of the block that this transaction was included in.\n *\n * This is ``null`` for pending transactions.\n */\n blockHash;\n /**\n * The index within the block that this transaction resides at.\n */\n index;\n /**\n * The transaction hash.\n */\n hash;\n /**\n * The [[link-eip-2718]] transaction envelope type. This is\n * ``0`` for legacy transactions types.\n */\n type;\n /**\n * The receiver of this transaction.\n *\n * If ``null``, then the transaction is an initcode transaction.\n * This means the result of executing the [[data]] will be deployed\n * as a new contract on chain (assuming it does not revert) and the\n * address may be computed using [[getCreateAddress]].\n */\n to;\n /**\n * The sender of this transaction. It is implicitly computed\n * from the transaction pre-image hash (as the digest) and the\n * [[signature]] using ecrecover.\n */\n from;\n /**\n * The nonce, which is used to prevent replay attacks and offer\n * a method to ensure transactions from a given sender are explicitly\n * ordered.\n *\n * When sending a transaction, this must be equal to the number of\n * transactions ever sent by [[from]].\n */\n nonce;\n /**\n * The maximum units of energy this transaction can consume. If execution\n * exceeds this, the entries transaction is reverted and the sender\n * is charged for the full amount, despite not state changes being made.\n */\n energyLimit;\n /**\n * The energy price can have various values, depending on the network.\n *\n * In modern networks, for transactions that are included this is\n * the //effective energy price// (the fee per energy that was actually\n * charged), while for transactions that have not been included yet\n * is the [[maxFeePerEnergy]].\n *\n * For legacy transactions, or transactions on legacy networks, this\n * is the fee that will be charged per unit of energy the transaction\n * consumes.\n */\n energyPrice;\n /**\n * The data.\n */\n data;\n /**\n * The value, in ore. Use [[formatXCB]] to format this value\n * as xcb.\n */\n value;\n /**\n * The chain ID.\n */\n networkId;\n /**\n * The signature.\n */\n signature;\n #startBlock;\n /**\n * Create a new TransactionResponse with %%tx%% parameters\n * connected to %%provider%%.\n */\n constructor(tx, provider) {\n this.provider = provider;\n this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null;\n this.blockHash = tx.blockHash != null ? tx.blockHash : null;\n this.hash = tx.hash;\n this.index = tx.index;\n this.from = tx.from;\n this.to = tx.to || null;\n this.energyLimit = tx.energyLimit;\n this.nonce = tx.nonce;\n this.data = tx.data;\n this.value = tx.value;\n this.energyPrice = tx.energyPrice;\n this.networkId = tx.networkId;\n this.signature = tx.signature;\n this.#startBlock = -1;\n }\n /**\n * Returns a JSON representation of this transaction.\n */\n toJSON() {\n const { index, hash, type, to, from, nonce, data, signature } = this;\n return {\n _type: \"TransactionReceipt\",\n networkId: toJson(this.networkId),\n data,\n from,\n energyLimit: toJson(this.energyLimit),\n energyPrice: toJson(this.energyPrice),\n hash,\n nonce,\n signature,\n to,\n index,\n type,\n value: toJson(this.value),\n };\n }\n /**\n * Resolves to the Block that this transaction was included in.\n *\n * This will return null if the transaction has not been included yet.\n */\n async getBlock() {\n let blockNumber = this.blockNumber;\n if (blockNumber == null) {\n const tx = await this.getTransaction();\n if (tx) {\n blockNumber = tx.blockNumber;\n }\n }\n if (blockNumber == null) {\n return null;\n }\n const block = this.provider.getBlock(blockNumber);\n if (block == null) {\n throw new Error(\"TODO\");\n }\n return block;\n }\n /**\n * Resolves to this transaction being re-requested from the\n * provider. This can be used if you have an unmined transaction\n * and wish to get an up-to-date populated instance.\n */\n async getTransaction() {\n return this.provider.getTransaction(this.hash);\n }\n /**\n * Resolves once this transaction has been mined and has\n * %%confirms%% blocks including it (default: ``1``) with an\n * optional %%timeout%%.\n *\n * This can resolve to ``null`` only if %%confirms%% is ``0``\n * and the transaction has not been mined, otherwise this will\n * wait until enough confirmations have completed.\n */\n async wait(_confirms, _timeout) {\n const confirms = _confirms == null ? 1 : _confirms;\n const timeout = _timeout == null ? 0 : _timeout;\n let startBlock = this.#startBlock;\n let nextScan = -1;\n let stopScanning = startBlock === -1 ? true : false;\n const checkReplacement = async () => {\n // Get the current transaction count for this sender\n if (stopScanning) {\n return null;\n }\n const { blockNumber, nonce } = await resolveProperties({\n blockNumber: this.provider.getBlockNumber(),\n nonce: this.provider.getTransactionCount(this.from),\n });\n // No transaction or our nonce has not been mined yet; but we\n // can start scanning later when we do start\n if (nonce < this.nonce) {\n startBlock = blockNumber;\n return;\n }\n // We were mined; no replacement\n if (stopScanning) {\n return null;\n }\n const mined = await this.getTransaction();\n if (mined && mined.blockNumber != null) {\n return;\n }\n // We were replaced; start scanning for that transaction\n // Starting to scan; look back a few extra blocks for safety\n if (nextScan === -1) {\n nextScan = startBlock - 3;\n if (nextScan < this.#startBlock) {\n nextScan = this.#startBlock;\n }\n }\n while (nextScan <= blockNumber) {\n // Get the next block to scan\n if (stopScanning) {\n return null;\n }\n const block = await this.provider.getBlock(nextScan, true);\n // This should not happen; but we'll try again shortly\n if (block == null) {\n return;\n }\n // We were mined; no replacement\n for (const hash of block) {\n if (hash === this.hash) {\n return;\n }\n }\n // Search for the transaction that replaced us\n for (let i = 0; i < block.length; i++) {\n const tx = await block.getTransaction(i);\n if (tx.from === this.from && tx.nonce === this.nonce) {\n // Get the receipt\n if (stopScanning) {\n return null;\n }\n const receipt = await this.provider.getTransactionReceipt(tx.hash);\n // This should not happen; but we'll try again shortly\n if (receipt == null) {\n return;\n }\n // We will retry this on the next block (this case could be optimized)\n if (blockNumber - receipt.blockNumber + 1 < confirms) {\n return;\n }\n // The reason we were replaced\n let reason = \"replaced\";\n if (tx.data === this.data &&\n tx.to === this.to &&\n tx.value === this.value) {\n reason = \"repriced\";\n }\n else if (tx.data === \"0x\" &&\n tx.from === tx.to &&\n tx.value === BN_0) {\n reason = \"cancelled\";\n }\n assert(false, \"transaction was replaced\", \"TRANSACTION_REPLACED\", {\n cancelled: reason === \"replaced\" || reason === \"cancelled\",\n reason,\n replacement: tx.replaceableTransaction(startBlock),\n hash: tx.hash,\n receipt,\n });\n }\n }\n nextScan++;\n }\n return;\n };\n const receipt = await this.provider.getTransactionReceipt(this.hash);\n if (receipt) {\n if ((await receipt.confirmations()) >= confirms) {\n return receipt;\n }\n }\n else {\n // Check for a replacement; throws if a replacement was found\n await checkReplacement();\n // Allow null only when the confirms is 0\n if (confirms === 0) {\n return null;\n }\n }\n const waiter = new Promise((resolve, reject) => {\n // List of things to cancel when we have a result (one way or the other)\n const cancellers = [];\n const cancel = () => {\n cancellers.forEach((c) => c());\n };\n // On cancel, stop scanning for replacements\n cancellers.push(() => {\n stopScanning = true;\n });\n // Set up any timeout requested\n if (timeout > 0) {\n const timer = setTimeout(() => {\n cancel();\n reject(makeError(\"wait for transaction timeout\", \"TIMEOUT\"));\n }, timeout);\n cancellers.push(() => {\n clearTimeout(timer);\n });\n }\n const txListener = async (receipt) => {\n // Done; return it!\n if ((await receipt.confirmations()) >= confirms) {\n cancel();\n resolve(receipt);\n }\n };\n cancellers.push(() => {\n this.provider.off(this.hash, txListener);\n });\n this.provider.on(this.hash, txListener);\n // We support replacement detection; start checking\n if (startBlock >= 0) {\n const replaceListener = async () => {\n try {\n // Check for a replacement; this throws only if one is found\n await checkReplacement();\n }\n catch (error) {\n // We were replaced (with enough confirms); re-throw the error\n if (isError(error, \"TRANSACTION_REPLACED\")) {\n cancel();\n reject(error);\n return;\n }\n }\n // Rescheudle a check on the next block\n if (!stopScanning) {\n this.provider.once(\"block\", replaceListener);\n }\n };\n cancellers.push(() => {\n this.provider.off(\"block\", replaceListener);\n });\n this.provider.once(\"block\", replaceListener);\n }\n });\n return await waiter;\n }\n /**\n * Returns ``true`` if this transaction has been included.\n *\n * This is effective only as of the time the TransactionResponse\n * was instantiated. To get up-to-date information, use\n * [[getTransaction]].\n *\n * This provides a Type Guard that this transaction will have\n * non-null property values for properties that are null for\n * unmined transactions.\n */\n isMined() {\n return this.blockHash != null;\n }\n /**\n * Returns true if the transaction is a legacy (i.e. ``type == 0``)\n * transaction.\n *\n * This provides a Type Guard that this transaction will have\n * the ``null``-ness for hardfork-specific properties set correctly.\n */\n isLegacy() {\n return this.type === 0;\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that evict this transaction.\n */\n removedEvent() {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createRemovedTransactionFilter(this);\n }\n /**\n * Returns a filter which can be used to listen for orphan events\n * that re-order this event against %%other%%.\n */\n reorderedEvent(other) {\n assert(this.isMined(), \"unmined transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n assert(!other || other.isMined(), \"unmined 'other' transaction canot be orphaned\", \"UNSUPPORTED_OPERATION\", { operation: \"removeEvent()\" });\n return createReorderedTransactionFilter(this, other);\n }\n /**\n * Returns a new TransactionResponse instance which has the ability to\n * detect (and throw an error) if the transaction is replaced, which\n * will begin scanning at %%startBlock%%.\n *\n * This should generally not be used by developers and is intended\n * primarily for internal use. Setting an incorrect %%startBlock%% can\n * have devastating performance consequences if used incorrectly.\n */\n replaceableTransaction(startBlock) {\n assertArgument(Number.isInteger(startBlock) && startBlock >= 0, \"invalid startBlock\", \"startBlock\", startBlock);\n const tx = new TransactionResponse(this, this.provider);\n tx.#startBlock = startBlock;\n return tx;\n }\n}\nfunction createOrphanedBlockFilter(block) {\n return { orphan: \"drop-block\", hash: block.hash, number: block.number };\n}\nfunction createReorderedTransactionFilter(tx, other) {\n return { orphan: \"reorder-transaction\", tx, other };\n}\nfunction createRemovedTransactionFilter(tx) {\n return { orphan: \"drop-transaction\", tx };\n}\nfunction createRemovedLogFilter(log) {\n return {\n orphan: \"drop-log\",\n log: {\n transactionHash: log.transactionHash,\n blockHash: log.blockHash,\n blockNumber: log.blockNumber,\n address: log.address,\n data: log.data,\n topics: Object.freeze(log.topics.slice()),\n index: log.index,\n },\n };\n}\n//# sourceMappingURL=provider.js.map"],"names":["defineProperties","hexl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E,UAAU;AAC1B,QAAQ,GAAG,EAAE;AACb,YAAY,eAAe,EAAE,GAAG,CAAC,eAAe;AAChD,YAAY,SAAS,EAAE,GAAG,CAAC,SAAS;AACpC,YAAY,WAAW,EAAE,GAAG,CAAC,WAAW;AACxC,YAAY,OAAO,EAAE,GAAG,CAAC,OAAO;AAChC,YAAY,IAAI,EAAE,GAAG,CAAC,IAAI;AAC1B,YAAY,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;AACrD,YAAY,KAAK,EAAE,GAAG,CAAC,KAAK;AAC5B,SAAS;AACT,KAAK;AACL;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/signer-noncemanager.d.ts b/lib.commonjs/providers/signer-noncemanager.d.ts deleted file mode 100644 index 31eae80ab..000000000 --- a/lib.commonjs/providers/signer-noncemanager.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AbstractSigner } from "./abstract-signer.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -export declare class NonceManager extends AbstractSigner { - #private; - signer: Signer; - constructor(signer: Signer); - getAddress(): Promise; - connect(provider: null | Provider): NonceManager; - getNonce(blockTag?: BlockTag): Promise; - increment(): void; - reset(): void; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=signer-noncemanager.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/signer-noncemanager.d.ts.map b/lib.commonjs/providers/signer-noncemanager.d.ts.map deleted file mode 100644 index ccd407c82..000000000 --- a/lib.commonjs/providers/signer-noncemanager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer-noncemanager.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,YAAa,SAAQ,cAAc;;IAC/C,MAAM,EAAG,MAAM,CAAC;IAKhB,YAAY,MAAM,EAAE,MAAM,EAMzB;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,YAAY,CAE/C;IAEK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAWnD;IAED,SAAS,IAAI,IAAI,CAEhB;IAED,KAAK,IAAI,IAAI,CAGZ;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAU1E;IAED,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvD;IAED,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzD;IAED,aAAa,CACZ,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/signer-noncemanager.js b/lib.commonjs/providers/signer-noncemanager.js deleted file mode 100644 index e5114586c..000000000 --- a/lib.commonjs/providers/signer-noncemanager.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var abstractSigner = require('./abstract-signer.js'); - -class NonceManager extends abstractSigner.AbstractSigner { - signer; - #noncePromise; - #delta; - constructor(signer) { - super(signer.provider); - properties.defineProperties(this, { signer }); - this.#noncePromise = null; - this.#delta = 0; - } - async getAddress() { - return this.signer.getAddress(); - } - connect(provider) { - return new NonceManager(this.signer.connect(provider)); - } - async getNonce(blockTag) { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - return super.getNonce(blockTag); - } - increment() { - this.#delta++; - } - reset() { - this.#delta = 0; - this.#noncePromise = null; - } - async sendTransaction(tx) { - const noncePromise = this.getNonce("pending"); - this.increment(); - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - signTransaction(tx) { - return this.signer.signTransaction(tx); - } - signMessage(message) { - return this.signer.signMessage(message); - } - signTypedData(domain, types, value) { - return this.signer.signTypedData(domain, types, value); - } -} - -exports.NonceManager = NonceManager; -//# sourceMappingURL=signer-noncemanager.js.map diff --git a/lib.commonjs/providers/signer-noncemanager.js.map b/lib.commonjs/providers/signer-noncemanager.js.map deleted file mode 100644 index aea6b9033..000000000 --- a/lib.commonjs/providers/signer-noncemanager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer-noncemanager.js","sources":["../../lib.esm/providers/signer-noncemanager.js"],"sourcesContent":["import { defineProperties } from \"../utils/index.js\";\nimport { AbstractSigner } from \"./abstract-signer.js\";\nexport class NonceManager extends AbstractSigner {\n signer;\n #noncePromise;\n #delta;\n constructor(signer) {\n super(signer.provider);\n defineProperties(this, { signer });\n this.#noncePromise = null;\n this.#delta = 0;\n }\n async getAddress() {\n return this.signer.getAddress();\n }\n connect(provider) {\n return new NonceManager(this.signer.connect(provider));\n }\n async getNonce(blockTag) {\n if (blockTag === \"pending\") {\n if (this.#noncePromise == null) {\n this.#noncePromise = super.getNonce(\"pending\");\n }\n const delta = this.#delta;\n return (await this.#noncePromise) + delta;\n }\n return super.getNonce(blockTag);\n }\n increment() {\n this.#delta++;\n }\n reset() {\n this.#delta = 0;\n this.#noncePromise = null;\n }\n async sendTransaction(tx) {\n const noncePromise = this.getNonce(\"pending\");\n this.increment();\n tx = await this.signer.populateTransaction(tx);\n tx.nonce = await noncePromise;\n // @TODO: Maybe handle interesting/recoverable errors?\n // Like don't increment if the tx was certainly not sent\n return await this.signer.sendTransaction(tx);\n }\n signTransaction(tx) {\n return this.signer.signTransaction(tx);\n }\n signMessage(message) {\n return this.signer.signMessage(message);\n }\n signTypedData(domain, types, value) {\n return this.signer.signTypedData(domain, types, value);\n }\n}\n//# sourceMappingURL=signer-noncemanager.js.map"],"names":["AbstractSigner","defineProperties"],"mappings":";;;;;;;;;;;;;AAEO,MAAM,YAAY,SAASA,6BAAc,CAAC;AACjD,IAAI,MAAM;AACV,IAAI,aAAa;AACjB,IAAI,MAAM;AACV,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQ,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC;AAC9B,QAAQC,2BAAgB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC;AAC1C,QAAQ,IAAI,CAAC,aAAa,GAAG,IAAI;AACjC,QAAQ,IAAI,CAAC,MAAM,GAAG,CAAC;AACvB,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;AACvC,IAAI;AACJ,IAAI,OAAO,CAAC,QAAQ,EAAE;AACtB,QAAQ,OAAO,IAAI,YAAY,CAAC,IAAI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IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;AAC/C,IAAI;AACJ,IAAI,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;AACxC,QAAQ,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;AAC9D,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/signer.d.ts b/lib.commonjs/providers/signer.d.ts deleted file mode 100644 index a6383a32f..000000000 --- a/lib.commonjs/providers/signer.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { Addressable, NameResolver } from "../address/index.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -/** - * A Signer represents an account on the Core Blockchain, and is most often - * backed by a private key represented by a mnemonic or residing on a Hardware Wallet. - * - * The API remains abstract though, so that it can deal with more advanced exotic - * Signing entities, such as Smart Contract Wallets or Virtual Wallets (where the - * private key may not be known). - */ -export interface Signer extends Addressable, ContractRunner, NameResolver { - /** - * The [[Provider]] attached to this Signer (if any). - */ - provider: null | Provider; - /** - * Returns a new instance of this Signer connected to //provider// or detached - * from any Provider if null. - */ - connect(provider: null | Provider): Signer; - /** - * Get the address of the Signer. - */ - getAddress(): Promise; - /** - * Gets the next nonce required for this Signer to send a transaction. - * - * @param blockTag - The blocktag to base the transaction count on, keep in mind - * many nodes do not honour this value and silently ignore it [default: ``"latest"``] - */ - getNonce(blockTag?: BlockTag): Promise; - /** - * Prepares a {@link TransactionRequest} for calling: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - * @param tx - The call to prepare - */ - populateCall(tx: TransactionRequest): Promise>; - /** - * Prepares a {@link TransactionRequest} for sending to the network by - * populating any missing properties: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``energyLimit`` via ``signer.estimateEnergy(tx)`` - * - populates ``networkId`` via ``signer.provider.getNetwork()`` - * - populates ``type`` and relevant fee data for that type (``energyPrice`` - * for legacy transactions, ``maxFeePerEnergy`` for EIP-1559, etc) - * - * @note Some Signer implementations may skip populating properties that - * are populated downstream; for example JsonRpcSigner defers to the - * node to populate the nonce and fee data. - * - * @param tx - The call to prepare - */ - populateTransaction(tx: TransactionRequest): Promise>; - /** - * Estimates the required energy required to execute //tx// on the Blockchain. This - * will be the expected amount a transaction will require as its ``energyLimit`` - * to successfully run all the necessary computations and store the needed state - * that the transaction intends. - * - * Keep in mind that this is **best efforts**, since the state of the Blockchain - * is in flux, which could affect transaction energy requirements. - * - * @throws UNPREDICTABLE_ENERGY_LIMIT A transaction that is believed by the node to likely - * fail will throw an error during energy estimation. This could indicate that it - * will actually fail or that the circumstances are simply too complex for the - * node to take into account. In these cases, a manually determined ``energyLimit`` - * will need to be made. - */ - estimateEnergy(tx: TransactionRequest): Promise; - /** - * Evaluates the //tx// by running it against the current Blockchain state. This - * cannot change state and has no cost in xcb, as it is effectively simulating - * execution. - * - * This can be used to have the Blockchain perform computations based on its state - * (e.g. running a Contract's getters) or to simulate the effect of a transaction - * before actually performing an operation. - */ - call(tx: TransactionRequest): Promise; - /** - * Resolves an ENS Name to an address. - */ - resolveName(name: string): Promise; - /** - * Signs %%tx%%, returning the fully signed transaction. This does not - * populate any additional properties within the transaction. - */ - signTransaction(tx: TransactionRequest): Promise; - /** - * Sends %%tx%% to the Network. The ``signer.populateTransaction(tx)`` - * is called first to ensure all necessary properties for the - * transaction to be valid have been popualted first. - */ - sendTransaction(tx: TransactionRequest): Promise; - /** - * Signers an [[link-eip-191]] prefixed personal message. - * - * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is **not** - * interpretted as a [[BytesLike]]; so the string ``"0x1234"`` is signed as six - * characters, **not** two bytes. - * - * To sign that example as two bytes, the Uint8Array should be used - * (i.e. ``new Uint8Array([ 0x12, 0x34 ])``). - */ - signMessage(message: string | Uint8Array): Promise; - /** - * Signs the [[link-eip-712]] typed data. - */ - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=signer.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/signer.d.ts.map b/lib.commonjs/providers/signer.d.ts.map deleted file mode 100644 index d5935e8bb..000000000 --- a/lib.commonjs/providers/signer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,WAAW,EAAE,cAAc,EAAE,YAAY;IACxE;;OAEG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IAK3C;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAK/C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvE;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAK9E;;;;;;;;;;;;;;OAcG;IACH,cAAc,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9C;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAKlD;;;OAGG;IACH,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzD;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEtE;;;;;;;;;OASG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3D;;OAEG;IACH,aAAa,CACZ,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/lib.commonjs/providers/signer.js b/lib.commonjs/providers/signer.js deleted file mode 100644 index 020fda188..000000000 --- a/lib.commonjs/providers/signer.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -//# sourceMappingURL=signer.js.map diff --git a/lib.commonjs/providers/signer.js.map b/lib.commonjs/providers/signer.js.map deleted file mode 100644 index 96c6deffe..000000000 --- a/lib.commonjs/providers/signer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-connection.d.ts b/lib.commonjs/providers/subscriber-connection.d.ts deleted file mode 100644 index b235e3b46..000000000 --- a/lib.commonjs/providers/subscriber-connection.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Subscriber } from "./abstract-provider.js"; -import type { Provider } from "./provider.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export interface ConnectionRpcProvider extends Provider { - _subscribe(param: Array, processFunc: (result: any) => void): number; - _unsubscribe(filterId: number): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class BlockConnectionSubscriber implements Subscriber { - #private; - constructor(provider: ConnectionRpcProvider); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-connection.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-connection.d.ts.map b/lib.commonjs/providers/subscriber-connection.d.ts.map deleted file mode 100644 index baef99405..000000000 --- a/lib.commonjs/providers/subscriber-connection.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAEtD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;IAQ3D,YAAY,QAAQ,EAAE,qBAAqB,EAK1C;IAED,KAAK,IAAI,IAAI,CAeZ;IAED,IAAI,IAAI,IAAI,CAUX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-connection.js b/lib.commonjs/providers/subscriber-connection.js deleted file mode 100644 index 08970fdf2..000000000 --- a/lib.commonjs/providers/subscriber-connection.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); - -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class BlockConnectionSubscriber { - #provider; - #blockNumber; - #running; - #filterId; - constructor(provider) { - this.#provider = provider; - this.#blockNumber = -2; - this.#running = false; - this.#filterId = null; - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#filterId = this.#provider._subscribe(["newHeads"], (result) => { - const blockNumber = maths.getNumber(result.number); - const initial = this.#blockNumber === -2 ? blockNumber : this.#blockNumber + 1; - for (let b = initial; b <= blockNumber; b++) { - this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - }); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - if (this.#filterId != null) { - this.#provider._unsubscribe(this.#filterId); - this.#filterId = null; - } - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#blockNumber = -2; - } - this.stop(); - } - resume() { - this.start(); - } -} - -exports.BlockConnectionSubscriber = BlockConnectionSubscriber; -//# sourceMappingURL=subscriber-connection.js.map diff --git a/lib.commonjs/providers/subscriber-connection.js.map b/lib.commonjs/providers/subscriber-connection.js.map deleted file mode 100644 index 5368de059..000000000 --- a/lib.commonjs/providers/subscriber-connection.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-connection.js","sources":["../../lib.esm/providers/subscriber-connection.js"],"sourcesContent":["import { getNumber } from \"../utils/index.js\";\n/**\n * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class BlockConnectionSubscriber {\n #provider;\n #blockNumber;\n #running;\n #filterId;\n constructor(provider) {\n this.#provider = provider;\n this.#blockNumber = -2;\n this.#running = false;\n this.#filterId = null;\n }\n start() {\n if (this.#running) {\n return;\n }\n this.#running = true;\n this.#filterId = this.#provider._subscribe([\"newHeads\"], (result) => {\n const blockNumber = getNumber(result.number);\n const initial = this.#blockNumber === -2 ? blockNumber : this.#blockNumber + 1;\n for (let b = initial; b <= blockNumber; b++) {\n this.#provider.emit(\"block\", b);\n }\n this.#blockNumber = blockNumber;\n });\n }\n stop() {\n if (!this.#running) {\n return;\n }\n this.#running = false;\n if (this.#filterId != null) {\n this.#provider._unsubscribe(this.#filterId);\n this.#filterId = null;\n }\n }\n pause(dropWhilePaused) {\n if (dropWhilePaused) {\n this.#blockNumber = -2;\n }\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n//# sourceMappingURL=subscriber-connection.js.map"],"names":["getNumber"],"mappings":";;;;;;;;;;;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,CAAC;AACvC,IAAI,SAAS;AACb,IAAI,YAAY;AAChB,IAAI,QAAQ;AACZ,IAAI,SAAS;AACb,IAAI,WAAW,CAAC,QAAQ,EAAE;AAC1B,QAAQ,IAAI,CAAC,SAAS,GAAG,QAAQ;AACjC,QAAQ,IAAI,CAAC,YAAY,GAAG,EAAE;AAC9B,QAAQ,IAAI,CAAC,QAAQ,GAAG,KAAK;AAC7B,QAAQ,IAAI,CAAC,SAAS,GAAG,IAAI;AAC7B,IAAI;AACJ,IAAI,KAAK,GAAG;AACZ,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE;AAC3B,YAAY;AACZ,QAAQ;AACR,QAAQ,IAAI,CAAC,QAAQ,GAAG,IAAI;AAC5B,QAAQ,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,MAAM,KAAK;AAC7E,YAAY,MAAM,WAAW,GAAGA,eAAS,CAAC,MAAM,CAAC,MAAM,CAAC;AACxD,YAAY,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,KAAK,EAAE,GAAG,WAAW,GAAG,IAAI,CAAC,YAAY,GAAG,CAAC;AAC1F,YAAY,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE;AACzD,gBAAgB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;AAC/C,YAAY;AACZ,YAAY,IAAI,CAAC,YAAY,GAAG,WAAW;AAC3C,QAAQ,CAAC,CAAC;AACV,IAAI;AACJ,IAAI,IAAI,GAAG;AACX,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC5B,YAAY;AACZ,QAAQ;AACR,QAAQ,IAAI,CAAC,QAAQ,GAAG,KAAK;AAC7B,QAAQ,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;AACpC,YAAY,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC;AACvD,YAAY,IAAI,CAAC,SAAS,GAAG,IAAI;AACjC,QAAQ;AACR,IAAI;AACJ,IAAI,KAAK,CAAC,eAAe,EAAE;AAC3B,QAAQ,IAAI,eAAe,EAAE;AAC7B,YAAY,IAAI,CAAC,YAAY,GAAG,EAAE;AAClC,QAAQ;AACR,QAAQ,IAAI,CAAC,IAAI,EAAE;AACnB,IAAI;AACJ,IAAI,MAAM,GAAG;AACb,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-filterid.d.ts b/lib.commonjs/providers/subscriber-filterid.d.ts deleted file mode 100644 index 3e58a6871..000000000 --- a/lib.commonjs/providers/subscriber-filterid.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdSubscriber implements Subscriber { - #private; - constructor(provider: JsonRpcApiProvider); - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: AbstractProvider, result: Array): Promise; - _recover(provider: AbstractProvider): Subscriber; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdEventSubscriber extends FilterIdSubscriber { - #private; - constructor(provider: JsonRpcApiProvider, filter: EventFilter); - _recover(provider: AbstractProvider): Subscriber; - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdPendingSubscriber extends FilterIdSubscriber { - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -//# sourceMappingURL=subscriber-filterid.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-filterid.d.ts.map b/lib.commonjs/providers/subscriber-filterid.d.ts.map deleted file mode 100644 index 957e1320c..000000000 --- a/lib.commonjs/providers/subscriber-filterid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EA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AG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-filterid.js b/lib.commonjs/providers/subscriber-filterid.js deleted file mode 100644 index fbb13cf29..000000000 --- a/lib.commonjs/providers/subscriber-filterid.js +++ /dev/null @@ -1,172 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var subscriberPolling = require('./subscriber-polling.js'); - -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdSubscriber { - #provider; - #filterIdPromise; - #poller; - #running; - #network; - #hault; - constructor(provider) { - this.#provider = provider; - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#network = null; - this.#hault = false; - } - _subscribe(provider) { - throw new Error("subclasses must override this"); - } - _emitResults(provider, result) { - throw new Error("subclasses must override this"); - } - _recover(provider) { - throw new Error("subclasses must override this"); - } - async #poll(blockNumber) { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - // Get the Filter ID - let filterId = null; - try { - filterId = await this.#filterIdPromise; - } - catch (error) { - if (!errors.isError(error, "UNSUPPORTED_OPERATION") || - error.operation !== "xcb_newFilter") { - throw error; - } - } - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - if (this.#network.networkId !== network.networkId) { - throw new Error("chaid changed"); - } - if (this.#hault) { - return; - } - const result = await this.#provider.send("xcb_getFilterChanges", [ - filterId, - ]); - await this._emitResults(this.#provider, result); - } - catch (error) { - console.log("@TODO", error); - } - this.#provider.once("block", this.#poller); - } - #teardown() { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - this.#provider.send("xcb_uninstallFilter", [filterId]); - }); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - resume() { - this.start(); - } -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdEventSubscriber extends FilterIdSubscriber { - #event; - constructor(provider, filter) { - super(provider); - this.#event = copy(filter); - } - _recover(provider) { - return new subscriberPolling.PollingEventSubscriber(provider, this.#event); - } - async _subscribe(provider) { - const filterId = await provider.send("xcb_newFilter", [this.#event]); - return filterId; - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider) { - return await provider.send("xcb_newPendingTransactionFilter", []); - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit("pending", result); - } - } -} - -exports.FilterIdEventSubscriber = FilterIdEventSubscriber; -exports.FilterIdPendingSubscriber = FilterIdPendingSubscriber; -exports.FilterIdSubscriber = FilterIdSubscriber; -//# sourceMappingURL=subscriber-filterid.js.map diff --git a/lib.commonjs/providers/subscriber-filterid.js.map b/lib.commonjs/providers/subscriber-filterid.js.map deleted file mode 100644 index 70d85f1fb..000000000 --- a/lib.commonjs/providers/subscriber-filterid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-filterid.js","sources":["../../lib.esm/providers/subscriber-filterid.js"],"sourcesContent":["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 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 _subscribe(provider) {\n throw new Error(\"subclasses must override this\");\n }\n _emitResults(provider, result) {\n throw new Error(\"subclasses must override this\");\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\") ||\n error.operation !== \"xcb_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.networkId !== network.networkId) {\n throw new Error(\"chaid changed\");\n }\n if (this.#hault) {\n return;\n }\n const result = await this.#provider.send(\"xcb_getFilterChanges\", [\n filterId,\n ]);\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 this.#provider.send(\"xcb_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() {\n this.start();\n }\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 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(\"xcb_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(\"xcb_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"],"names":["isError","PollingEventSubscriber"],"mappings":";;;;;;;;;;;;AAEA,SAAS,IAAI,CAAC,GAAG,EAAE;AACnB,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,kBAAkB,CAAC;AAChC,IAAI,S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AQ,KAAK,CAAC,QAAQ,CAAC;AACvB,QAAQ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAClC,IAAI;AACJ,IAAI,QAAQ,CAAC,QAAQ,EAAE;AACvB,QAAQ,OAAO,IAAIC,wCAAsB,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;AAChE,IAAI;AACJ,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC5E,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE;AAC1C,QAAQ,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;AACtC,YAAY,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACpF,QAAQ;AACR,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,SAAS,kBAAkB,CAAC;AAClE,IAAI,MAAM,UAAU,CAAC,QAAQ,EAAE;AAC/B,QAAQ,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAE,CAAC;AACzE,IAAI;AACJ,IAAI,MAAM,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE;AAC1C,QAAQ,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;AACtC,YAAY,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC;AAC5C,QAAQ;AACR,IAAI;AACJ;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-polling.d.ts b/lib.commonjs/providers/subscriber-polling.d.ts deleted file mode 100644 index fcf4a8070..000000000 --- a/lib.commonjs/providers/subscriber-polling.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter, OrphanFilter, ProviderEvent } from "./provider.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare function getPollingSubscriber(provider: AbstractProvider, event: ProviderEvent): Subscriber; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingBlockSubscriber implements Subscriber { - #private; - constructor(provider: AbstractProvider); - get pollingInterval(): number; - set pollingInterval(value: number); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class OnBlockSubscriber implements Subscriber { - #private; - constructor(provider: AbstractProvider); - _poll(blockNumber: number, provider: AbstractProvider): Promise; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingOrphanSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, filter: OrphanFilter); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingTransactionSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, hash: string); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingEventSubscriber implements Subscriber { - #private; - constructor(provider: AbstractProvider, filter: EventFilter); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-polling.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-polling.d.ts.map b/lib.commonjs/providers/subscriber-polling.d.ts.map deleted file mode 100644 index 9fd6aa7aa..000000000 --- a/lib.commonjs/providers/subscriber-polling.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-polling.d.ts","sourceR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,4BAA6B,SAAQ,iBAAiB;;IAGlE,YAAY,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAGnD;IAEK,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1E;CACD;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAWxD,YAAY,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAM1D;IA6BD,KAAK,IAAI,IAAI,CAYZ;IAED,IAAI,IAAI,IAAI,CAOX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/lib.commonjs/providers/subscriber-polling.js b/lib.commonjs/providers/subscriber-polling.js deleted file mode 100644 index 4794c69ec..000000000 --- a/lib.commonjs/providers/subscriber-polling.js +++ /dev/null @@ -1,265 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -function getPollingSubscriber(provider, event) { - if (event === "block") { - return new PollingBlockSubscriber(provider); - } - if (data.isHexString(event, 32)) { - return new PollingTransactionSubscriber(provider, event); - } - errors.assert(false, "unsupported polling event", "UNSUPPORTED_OPERATION", { - operation: "getPollingSubscriber", - info: { event }, - }); -} -// @TODO: refactor this -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class PollingBlockSubscriber { - #provider; - #poller; - #interval; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - this.#blockNumber = -2; - } - get pollingInterval() { - return this.#interval; - } - set pollingInterval(value) { - this.#interval = value; - } - async #poll() { - try { - const blockNumber = await this.#provider.getBlockNumber(); - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - // @TODO: Put a cap on the maximum number of events per loop? - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - await this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - } - } - catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - // We have been stopped - if (this.#poller == null) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - start() { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - stop() { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class OnBlockSubscriber { - #provider; - #poll; - #running; - constructor(provider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber) => { - this._poll(blockNumber, this.#provider); - }; - } - async _poll(blockNumber, provider) { - throw new Error("sub-classes must override this"); - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poll); - } - pause(dropWhilePaused) { - this.stop(); - } - resume() { - this.start(); - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter; - constructor(provider, filter) { - super(provider); - this.#filter = copy(filter); - } - async _poll(blockNumber, provider) { - throw new Error("@TODO"); - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash; - constructor(provider, hash) { - super(provider); - this.#hash = hash; - } - async _poll(blockNumber, provider) { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -class PollingEventSubscriber { - #provider; - #filter; - #poller; - #running; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = copy(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - async #poll(blockNumber) { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - const filter = copy(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - this.#blockNumber = blockNumber; - for (const log of logs) { - this.#provider.emit(this.#filter, log); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} - -exports.OnBlockSubscriber = OnBlockSubscriber; -exports.PollingBlockSubscriber = PollingBlockSubscriber; -exports.PollingEventSubscriber = PollingEventSubscriber; -exports.PollingOrphanSubscriber = PollingOrphanSubscriber; -exports.PollingTransactionSubscriber = PollingTransactionSubscriber; -exports.getPollingSubscriber = getPollingSubscriber; -//# sourceMappingURL=subscriber-polling.js.map diff --git a/lib.commonjs/providers/subscriber-polling.js.map b/lib.commonjs/providers/subscriber-polling.js.map deleted file mode 100644 index 8f9ba73e0..000000000 --- a/lib.commonjs/providers/subscriber-polling.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-polling.js","sources":["../../lib.esm/providers/subscriber-polling.js"],"sourcesContent":["import { assert, isHexString } from \"../utils/index.js\";\nfunction copy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}\n/**\n * @TODO\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\",\n info: { event },\n });\n}\n// @TODO: refactor this\n/**\n * @TODO\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 constructor(provider) {\n this.#provider = provider;\n this.#poller = null;\n this.#interval = 4000;\n this.#blockNumber = -2;\n }\n get pollingInterval() {\n return this.#interval;\n }\n set pollingInterval(value) {\n this.#interval = value;\n }\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class OnBlockSubscriber {\n #provider;\n #poll;\n #running;\n constructor(provider) {\n this.#provider = provider;\n this.#running = false;\n this.#poll = (blockNumber) => {\n this._poll(blockNumber, this.#provider);\n };\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) {\n this.stop();\n }\n resume() {\n this.start();\n }\n}\n/**\n * @TODO\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 * @TODO\n *\n * @_docloc: api/providers/abstract-provider\n */\nexport class PollingTransactionSubscriber extends OnBlockSubscriber {\n #hash;\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 * @TODO\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 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 this.#blockNumber = blockNumber;\n for (const log of logs) {\n this.#provider.emit(this.#filter, log);\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"],"names":["isHexString","assert"],"mappings":";;;;;;;;;;;;AACA,SAAS,IAAI,CAAC,GAAG,EAAE;AACnB,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE;AACtD,IAAI,IAAI,KAAK,KAAK,OAAO,EAAE;AAC3B,QAAQ,OAAO,IAAI,sBAAsB,CAAC,QAAQ,CAAC;AACnD,IAAI;AACJ,IAAI,IAAIA,gBAAW,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE;AAChC,QAAQ,OAAO,IAAI,4BAA4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I,CAAC,CAAC,WAAW,KAAK;AAClE,gBAAgB,IAAI,CAAC,YAAY,GAAG,WAAW;AAC/C,YAAY,CAAC,CAAC;AACd,QAAQ;AACR,QAAQ,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;AAChD,IAAI;AACJ,IAAI,IAAI,GAAG;AACX,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;AAC5B,YAAY;AACZ,QAAQ;AACR,QAAQ,IAAI,CAAC,QAAQ,GAAG,KAAK;AAC7B,QAAQ,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;AACjD,IAAI;AACJ,IAAI,KAAK,CAAC,eAAe,EAAE;AAC3B,QAAQ,IAAI,CAAC,IAAI,EAAE;AACnB,QAAQ,IAAI,eAAe,EAAE;AAC7B,YAAY,IAAI,CAAC,YAAY,GAAG,EAAE;AAClC,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,GAAG;AACb,QAAQ,IAAI,CAAC,KAAK,EAAE;AACpB,IAAI;AACJ;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/ws-browser.d.ts b/lib.commonjs/providers/ws-browser.d.ts deleted file mode 100644 index d92720422..000000000 --- a/lib.commonjs/providers/ws-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _WebSocket: any; -export { _WebSocket as WebSocket }; -//# sourceMappingURL=ws-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/ws-browser.d.ts.map b/lib.commonjs/providers/ws-browser.d.ts.map deleted file mode 100644 index 63da59ec3..000000000 --- a/lib.commonjs/providers/ws-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":"AAaA,QAAA,MAAM,UAAU,KAAwB,CAAC;AAEzC,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/providers/ws-browser.js b/lib.commonjs/providers/ws-browser.js deleted file mode 100644 index 57a37406f..000000000 --- a/lib.commonjs/providers/ws-browser.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -function getGlobal() { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); -} -const _WebSocket = getGlobal().WebSocket; - -exports.WebSocket = _WebSocket; -//# sourceMappingURL=ws-browser.js.map diff --git a/lib.commonjs/providers/ws-browser.js.map b/lib.commonjs/providers/ws-browser.js.map deleted file mode 100644 index d61cc0e44..000000000 --- a/lib.commonjs/providers/ws-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws-browser.js","sources":["../../lib.esm/providers/ws-browser.js"],"sourcesContent":["function getGlobal() {\n if (typeof self !== \"undefined\") {\n return self;\n }\n if (typeof window !== \"undefined\") {\n return window;\n }\n if (typeof global !== \"undefined\") {\n return global;\n }\n throw new Error(\"unable to locate global object\");\n}\nconst _WebSocket = getGlobal().WebSocket;\nexport { _WebSocket as WebSocket };\n//# sourceMappingURL=ws-browser.js.map"],"names":[],"mappings":";;AAAA,SAAS,SAAS,GAAG;AACrB,IAAI,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE;AACrC,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;AACvC,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;AACrD;AACK,MAAC,UAAU,GAAG,SAAS,EAAE,CAAC;;"} \ No newline at end of file diff --git a/lib.commonjs/providers/ws.d.ts b/lib.commonjs/providers/ws.d.ts deleted file mode 100644 index 75d53b7d4..000000000 --- a/lib.commonjs/providers/ws.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { WebSocket } from "ws"; -//# sourceMappingURL=ws.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/providers/ws.d.ts.map b/lib.commonjs/providers/ws.d.ts.map deleted file mode 100644 index c424f8d82..000000000 --- a/lib.commonjs/providers/ws.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/providers/ws.js b/lib.commonjs/providers/ws.js deleted file mode 100644 index 9c02ea4db..000000000 --- a/lib.commonjs/providers/ws.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - -var ws = require('ws'); - - - -Object.defineProperty(exports, "WebSocket", { - enumerable: true, - get: function () { return ws.WebSocket; } -}); -//# sourceMappingURL=ws.js.map diff --git a/lib.commonjs/providers/ws.js.map b/lib.commonjs/providers/ws.js.map deleted file mode 100644 index b0586736c..000000000 --- a/lib.commonjs/providers/ws.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/transaction/accesslist.d.ts b/lib.commonjs/transaction/accesslist.d.ts deleted file mode 100644 index aac12cccf..000000000 --- a/lib.commonjs/transaction/accesslist.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AccessList, AccessListish } from "./index.js"; -/** - * Returns a [[AccessList]] from any corebcsupported access-list structure. - */ -export declare function accessListify(value: AccessListish): AccessList; -//# sourceMappingURL=accesslist.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/transaction/accesslist.d.ts.map b/lib.commonjs/transaction/accesslist.d.ts.map deleted file mode 100644 index 4bd8ae700..000000000 --- a/lib.commonjs/transaction/accesslist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accesslist.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAoB5D;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CA+C9D"} \ No newline at end of file diff --git a/lib.commonjs/transaction/accesslist.js b/lib.commonjs/transaction/accesslist.js deleted file mode 100644 index 41aafeeb2..000000000 --- a/lib.commonjs/transaction/accesslist.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - -var index = require('../address/index.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -function accessSetify(addr, storageKeys) { - return { - address: index.getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - errors.assertArgument(data.isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); - return storageKey.toLowerCase(); - }), - }; -} -/** - * Returns a [[AccessList]] from any corebcsupported access-list structure. - */ -function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set, index) => { - if (Array.isArray(set)) { - errors.assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); - return accessSetify(set[0], set[1]); - } - errors.assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - errors.assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => a.address.localeCompare(b.address)); - return result; -} - -exports.accessListify = accessListify; -//# sourceMappingURL=accesslist.js.map diff --git a/lib.commonjs/transaction/accesslist.js.map b/lib.commonjs/transaction/accesslist.js.map deleted file mode 100644 index ff9c42d42..000000000 --- a/lib.commonjs/transaction/accesslist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accesslist.js","sources":["../../lib.esm/transaction/accesslist.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { assertArgument, isHexString } from \"../utils/index.js\";\nfunction accessSetify(addr, storageKeys) {\n return {\n address: getAddress(addr),\n storageKeys: storageKeys.map((storageKey, index) => {\n assertArgument(isHexString(storageKey, 32), \"invalid slot\", `storageKeys[${index}]`, storageKey);\n return storageKey.toLowerCase();\n }),\n };\n}\n/**\n * Returns a [[AccessList]] from any corebcsupported access-list structure.\n */\nexport function accessListify(value) {\n if (Array.isArray(value)) {\n return value.map((set, index) => {\n if (Array.isArray(set)) {\n assertArgument(set.length === 2, \"invalid slot set\", `value[${index}]`, set);\n return accessSetify(set[0], set[1]);\n }\n assertArgument(set != null && typeof set === \"object\", \"invalid address-slot set\", \"value\", value);\n return accessSetify(set.address, set.storageKeys);\n });\n }\n assertArgument(value != null && typeof value === \"object\", \"invalid access list\", \"value\", value);\n const result = Object.keys(value).map((addr) => {\n const storageKeys = value[addr].reduce((accum, storageKey) => {\n accum[storageKey] = true;\n return accum;\n }, {});\n return accessSetify(addr, Object.keys(storageKeys).sort());\n });\n result.sort((a, b) => a.address.localeCompare(b.address));\n return result;\n}\n//# sourceMappingURL=accesslist.js.map"],"names":["getAddress","assertArgument","isHexString"],"mappings":";;;;;;;;;;;;;AAEA,SAAS,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE;AACzC,IAAI,OAAO;AACX,QAAQ,OAAO,EAAEA,gBAAU,CAAC,IAAI,CAAC;AACjC,QAAQ,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,KAAK;AAC5D,YAAYC,qBAAc,CAACC,gBAAW,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC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AG,IAAI;AACpC,YAAY,OAAO,KAAK;AACxB,QAAQ,CAAC,EAAE,EAAE,CAAC;AACd,QAAQ,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,CAAC;AAClE,IAAI,CAAC,CAAC;AACN,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC7D,IAAI,OAAO,MAAM;AACjB;;"} \ No newline at end of file diff --git a/lib.commonjs/transaction/address.d.ts b/lib.commonjs/transaction/address.d.ts deleted file mode 100644 index 5abba54e2..000000000 --- a/lib.commonjs/transaction/address.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -export declare function removeHexPrefix(val: string): string; -export declare function publicToAddress(key: BytesLike | string, prefix: string): string; -export declare function computeAddress(key: string | SigningKey, prefix: string): string; -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -export declare function recoverAddress(digest: BytesLike, signature: SignatureLike, prefix: string): string; -export declare function extractPrefix(address: string): string; -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/transaction/address.d.ts.map b/lib.commonjs/transaction/address.d.ts.map deleted file mode 100644 index 48e65cc8e..000000000 --- a/lib.commonjs/transaction/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAC9B,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AAED,wBAAgB,cAAc,CAC7B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"} \ No newline at end of file diff --git a/lib.commonjs/transaction/address.js b/lib.commonjs/transaction/address.js deleted file mode 100644 index f3766a262..000000000 --- a/lib.commonjs/transaction/address.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -var index = require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -var sha3 = require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -var signingKey = require('../crypto/signing-key.js'); -require('../crypto/signature.js'); -var data = require('../utils/data.js'); - -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -function removeHexPrefix(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; -} -function publicToAddress(key, prefix) { - const val = data.hexDataSlice(sha3.sha256(key), 12); - const checksum = index.calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); -} -function computeAddress(key, prefix) { - let pubkey; - if (typeof key === "string") { - pubkey = signingKey.SigningKey.computePublicKey(key, false); - } - else { - pubkey = key.publicKey; - } - return publicToAddress(pubkey, prefix); // getAddress(sha256("0x" + pubkey.substring(4)).substring(26)); -} -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -function recoverAddress(digest, signature, prefix) { - // return computeAddress(SigningKey.recoverPublicKey(digest, signature)); - const publicKey = signingKey.SigningKey.recoverPublicKey(data.arrayify(digest), signature); - return publicToAddress(publicKey, prefix); -} -function extractPrefix(address) { - address = index.getAddress(address); - return address.substring(2, 4); -} - -exports.computeAddress = computeAddress; -exports.extractPrefix = extractPrefix; -exports.publicToAddress = publicToAddress; -exports.recoverAddress = recoverAddress; -exports.removeHexPrefix = removeHexPrefix; -//# sourceMappingURL=address.js.map diff --git a/lib.commonjs/transaction/address.js.map b/lib.commonjs/transaction/address.js.map deleted file mode 100644 index 0e89db281..000000000 --- a/lib.commonjs/transaction/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sources":["../../lib.esm/transaction/address.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { arrayify, hexDataSlice } from \"../utils/data.js\";\nimport { calculateCheckSum } from \"../address/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 removeHexPrefix(val) {\n return val.substring(0, 2) === \"0x\" ? val.substring(2) : val;\n}\nexport function publicToAddress(key, prefix) {\n const val = hexDataSlice(sha256(key), 12);\n const checksum = calculateCheckSum(val, prefix);\n return \"0x\" + prefix + checksum + removeHexPrefix(val);\n}\nexport function computeAddress(key, prefix) {\n let pubkey;\n if (typeof key === \"string\") {\n pubkey = SigningKey.computePublicKey(key, false);\n }\n else {\n pubkey = key.publicKey;\n }\n return publicToAddress(pubkey, prefix); // getAddress(sha256(\"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, prefix) {\n // return computeAddress(SigningKey.recoverPublicKey(digest, signature));\n const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature);\n return publicToAddress(publicKey, prefix);\n}\nexport function extractPrefix(address) {\n address = getAddress(address);\n return address.substring(2, 4);\n}\n//# sourceMappingURL=address.js.map"],"names":["hexDataSlice","sha256","calculateCheckSum","SigningKey","arrayify","getAddress"],"mappings":";;;;;;;;;;;;;;;;;;;AAIA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,GAAG,EAAE;AACrC,IAAI,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG;AAChE;AACO,SAAS,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE;AAC7C,IAAI,MAAM,GAAG,GAAGA,iBAAY,CAACC,WAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;AAC7C,IAAI,MAAM,QAAQ,GAAGC,uBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC;AACnD,IAAI,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC;AAC1D;AACO,SAAS,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE;AAC5C,IAAI,IAAI,MAAM;AACd,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AACjC,QAAQ,MAAM,GAAGC,qBAAU,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC;AACxD,IAAI;AACJ,SAAS;AACT,QAAQ,MAAM,GAAG,GAAG,CAAC,SAAS;AAC9B,IAAI;AACJ,IAAI,OAAO,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE;AAC1D;AACA,IAAI,MAAM,SAAS,GAAGA,qBAAU,CAAC,gBAAgB,CAACC,aAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;AAC9E,IAAI,OAAO,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC;AAC7C;AACO,SAAS,aAAa,CAAC,OAAO,EAAE;AACvC,IAAI,OAAO,GAAGC,gBAAU,CAAC,OAAO,CAAC;AACjC,IAAI,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;AAClC;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/transaction/index.d.ts b/lib.commonjs/transaction/index.d.ts deleted file mode 100644 index 01bca63fa..000000000 --- a/lib.commonjs/transaction/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Transactions.. - * - * @_section api/transaction:Transactions [about-transactions] - */ -/** - * A single [[AccessList]] entry of storage keys (slots) for an address. - */ -export type AccessListEntry = { - address: string; - storageKeys: Array; -}; -/** - * An ordered collection of [[AccessList]] entries. - */ -export type AccessList = Array; -/** - * Any corebc-supported access list structure. - */ -export type AccessListish = AccessList | Array<[string, Array]> | Record>; -export { accessListify } from "./accesslist.js"; -export { computeAddress, recoverAddress } from "./address.js"; -export { Transaction } from "./transaction.js"; -export type { TransactionLike } from "./transaction.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/transaction/index.d.ts.map b/lib.commonjs/transaction/index.d.ts.map deleted file mode 100644 index 4c5a4305f..000000000 --- a/lib.commonjs/transaction/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GACxB,UAAU,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/transaction/index.js b/lib.commonjs/transaction/index.js deleted file mode 100644 index fe5bd1c87..000000000 --- a/lib.commonjs/transaction/index.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -var accesslist = require('./accesslist.js'); -var address = require('./address.js'); -var transaction = require('./transaction.js'); - - - -exports.accessListify = accesslist.accessListify; -exports.computeAddress = address.computeAddress; -exports.recoverAddress = address.recoverAddress; -exports.Transaction = transaction.Transaction; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/transaction/index.js.map b/lib.commonjs/transaction/index.js.map deleted file mode 100644 index 7d4da4a80..000000000 --- a/lib.commonjs/transaction/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/transaction/transaction.d.ts b/lib.commonjs/transaction/transaction.d.ts deleted file mode 100644 index 83340f6b5..000000000 --- a/lib.commonjs/transaction/transaction.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { Signature } from "../crypto/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -export interface TransactionLike { - /** - * The recipient address or ``null`` for an ``init`` transaction. - */ - to?: null | A; - /** - * The sender. - */ - from?: null | A; - /** - * The nonce. - */ - nonce?: null | number; - /** - * The maximum amount of energy that can be used. - */ - energyLimit?: null | BigNumberish; - /** - * The energy price for legacy and berlin transactions. - */ - energyPrice?: null | BigNumberish; - /** - * The data. - */ - data?: null | string; - /** - * The value (in ore) to send. - */ - value?: null | BigNumberish; - /** - * The chain ID the transaction is valid on. - */ - networkId?: null | BigNumberish; - /** - * The transaction hash. - */ - hash?: null | string; - /** - * The signature provided by the sender. - */ - signature?: null | SignatureLike; -} -/** - * A **Transaction** describes an operation to be executed on - * Core by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in corebc) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -export declare class Transaction implements TransactionLike { - #private; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to(): null | string; - set to(value: null | string); - /** - * The transaction nonce. - */ - get nonce(): number; - set nonce(value: BigNumberish); - /** - * The energy limit. - */ - get energyLimit(): bigint; - set energyLimit(value: BigNumberish); - /** - * The energy price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get energyPrice(): null | bigint; - set energyPrice(value: null | BigNumberish); - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data(): string; - set data(value: BytesLike); - /** - * The amount of xcb (in ore) to send in this transactions. - */ - get value(): bigint; - set value(value: BigNumberish); - /** - * The chain ID this transaction is valid on. - */ - get networkId(): bigint; - set networkId(value: BigNumberish); - /** - * If signed, the signature for this transaction. - */ - get signature(): null | string; - set signature(value: null | SignatureLike); - /** - * Creates a new Transaction with default values. - */ - constructor(); - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash(): null | string; - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash(): string; - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from(): null | string; - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey(): null | string; - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned(): this is Transaction & { - type: number; - typeName: string; - from: string; - signature: Signature; - }; - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized(): string; - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized(): string; - /** - * Create a copy of this transaciton. - */ - clone(): Transaction; - /** - * Return a JSON-friendly object. - */ - toJSON(): any; - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx?: string | TransactionLike): Transaction; -} -//# sourceMappingURL=transaction.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/transaction/transaction.d.ts.map b/lib.commonjs/transaction/transaction.d.ts.map deleted file mode 100644 index e3c637686..000000000 --- a/lib.commonjs/transaction/transaction.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM;IAC1C;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE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AI,GAAG,aAAa,EAExC;IAED;;OAEG;IACH,cASC;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,CAKxB;IAED;;;;;OAKG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,CAMxB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,IAAI,GAAG,MAAM,CAKjC;IAED;;;;;OAKG;IACH,QAAQ,IAAI,IAAI,IAAI,WAAW,GAAG;QACjC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,SAAS,CAAC;KACrB,CAGA;IAED;;;;;OAKG;IACH,IAAI,UAAU,IAAI,MAAM,CAQvB;IAED;;;;;OAKG;IACH,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,KAAK,IAAI,WAAW,CAEnB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CAkBZ;IAED;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW,CA4D9D;CACD"} \ No newline at end of file diff --git a/lib.commonjs/transaction/transaction.js b/lib.commonjs/transaction/transaction.js deleted file mode 100644 index 45347c2d4..000000000 --- a/lib.commonjs/transaction/transaction.js +++ /dev/null @@ -1,388 +0,0 @@ -'use strict'; - -var index = require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -var sha3 = require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -var signingKey = require('../crypto/signing-key.js'); -require('../crypto/signature.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -var address = require('./address.js'); -var logger$1 = require('../logger/logger.js'); -var rlp = require('../crypto/rlp.js'); -var bigNumber = require('../bigNumber/bigNumber.js'); - -const logger = new logger$1.Logger("transaction/0.0.1"); -const BN_0 = BigInt(0); -function handleAddress(value) { - if (value === "0x") { - return null; - } - return index.getAddress(value); -} -function parse(data) { - const handleNumber = (value) => { - // @ts-ignore - if (value === "0x") { - return bigNumber.BigNumber.from(0); - } - return bigNumber.BigNumber.from(value); - }; - const transaction = rlp.decode(data); - if (transaction.length !== 7 && transaction.length !== 8) { - logger.throwArgumentError("invalid raw transaction", "data", data); - } - const isSigned = transaction.length === 8; - const tx = { - nonce: Number(handleNumber(transaction[0])), - energyPrice: handleNumber(transaction[1]).toBigInt(), - energyLimit: handleNumber(transaction[2]).toBigInt(), - networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(), - to: handleAddress(transaction[isSigned ? 4 : 3]), - value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(), - data: transaction[isSigned ? 6 : 5], - }; - if (transaction.length === 8) { - const prefix = index.networkIdToPrefix(Number(tx.networkId)); - const digest = sha3.sha256(serialize(tx)); - tx.hash = sha3.sha256(serialize(tx, transaction[7])); - tx.from = address.recoverAddress(digest, transaction[7], prefix); - tx.signature = transaction[7]; - } - return tx; -} -const unsignedTransactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, - { name: "networkId", maxLength: 32, numeric: true }, -]; -const transactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "networkId", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, -]; -const allowedTransactionKeys = { - networkId: true, - data: true, - energyLimit: true, - energyPrice: true, - nonce: true, - to: true, - value: true, -}; -function serialize(transaction, signature) { - properties.checkProperties(transaction, allowedTransactionKeys); - const raw = []; - (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) { - let value = transaction[name] || []; - const options = {}; - if (numeric) { - options.hexPad = "left"; - } - const tmpHexlified = data.hexlify(value, options); - value = data.arrayify(tmpHexlified); - // Fixed-width field - if (length && value.length !== length && value.length > 0) { - logger.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - // Variable-width (with a maximum) - if (maxLength) { - value = data.stripZeros(value); - if (value.length > maxLength) { - logger.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - } - const hexlified = data.hexlify(value); - raw.push(hexlified); - }); - if (!!signature) { - raw.push(data.hexlify(signature)); - } - const finalValue = rlp.encode(raw); - return finalValue; -} -/** - * A **Transaction** describes an operation to be executed on - * Core by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in corebc) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -class Transaction { - #to; - #data; - #nonce; - #energyLimit; - #energyPrice; - #value; - #networkId; - #sig; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - return this.#to; - } - set to(value) { - this.#to = value == null ? null : index.getAddress(value); - } - /** - * The transaction nonce. - */ - get nonce() { - return this.#nonce; - } - set nonce(value) { - this.#nonce = maths.getNumber(value, "value"); - } - /** - * The energy limit. - */ - get energyLimit() { - return this.#energyLimit; - } - set energyLimit(value) { - this.#energyLimit = maths.getBigInt(value); - } - /** - * The energy price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get energyPrice() { - const value = this.#energyPrice; - if (value == null) { - return BN_0; - } - return value; - } - set energyPrice(value) { - this.#energyPrice = value == null ? null : maths.getBigInt(value, "energyPrice"); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { - return this.#data; - } - set data(value) { - this.#data = data.hexlify(value); - } - /** - * The amount of xcb (in ore) to send in this transactions. - */ - get value() { - return this.#value; - } - set value(value) { - this.#value = maths.getBigInt(value, "value"); - } - /** - * The chain ID this transaction is valid on. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = maths.getBigInt(value); - } - /** - * If signed, the signature for this transaction. - */ - get signature() { - return this.#sig || null; - } - set signature(value) { - this.#sig = value == null ? null : value; - } - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#to = null; - this.#nonce = 0; - this.#energyLimit = BigInt(0); - this.#energyPrice = null; - this.#data = "0x"; - this.#value = BigInt(0); - this.#networkId = BigInt(0); - this.#sig = null; - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return sha3.sha256(this.serialized); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return sha3.sha256(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - const prefix = index.networkIdToPrefix(Number(this.#networkId)); - return address.recoverAddress(this.unsignedHash, this.signature, prefix); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return signingKey.SigningKey.recoverPublicKey(this.unsignedHash, this.signature); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - //isSigned(): this is SignedTransaction { - return this.signature != null; - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - errors.assert(this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - return serialize(this, this.signature); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return serialize(this); - } - /** - * Create a copy of this transaciton. - */ - clone() { - return Transaction.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s = (v) => { - if (v == null) { - return null; - } - return v.toString(); - }; - return { - to: this.to, - data: this.data, - nonce: this.nonce, - energyLimit: s(this.energyLimit), - energyPrice: s(this.energyPrice), - value: s(this.value), - networkId: s(this.networkId), - sig: this.signature ? this.signature : null, - }; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new Transaction(); - } - if (typeof tx === "string") { - const payload = data.getBytes(tx); - return Transaction.from(parse(payload)); - } - const result = new Transaction(); - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.energyLimit != null) { - result.energyLimit = tx.energyLimit; - } - if (tx.energyPrice != null) { - result.energyPrice = tx.energyPrice; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.networkId != null) { - result.networkId = tx.networkId; - } - if (tx.signature != null) { - result.signature = tx.signature; - } - if (tx.hash != null) { - errors.assertArgument(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); - errors.assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - errors.assertArgument(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); - errors.assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } -} - -exports.Transaction = Transaction; -//# sourceMappingURL=transaction.js.map diff --git a/lib.commonjs/transaction/transaction.js.map b/lib.commonjs/transaction/transaction.js.map deleted file mode 100644 index 34d58270c..000000000 --- a/lib.commonjs/transaction/transaction.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transaction.js","sources":["../../lib.esm/transaction/transaction.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { sha256, SigningKey } from \"../crypto/index.js\";\nimport { getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, } from \"../utils/index.js\";\nimport { recoverAddress } from \"./address.js\";\nimport { checkProperties } from \"../utils/properties.js\";\nimport { arrayify, stripZeros } from \"../utils/data.js\";\nimport { Logger } from \"../logger/logger.js\";\nimport * as RLP from \"../crypto/rlp.js\";\nimport { BigNumber } from \"../bigNumber/bigNumber.js\";\nimport { networkIdToPrefix } from \"../address/index.js\";\nconst logger = new Logger(\"transaction/0.0.1\");\nconst BN_0 = BigInt(0);\nfunction handleAddress(value) {\n if (value === \"0x\") {\n return null;\n }\n return getAddress(value);\n}\nfunction parse(data) {\n const handleNumber = (value) => {\n // @ts-ignore\n if (value === \"0x\") {\n return BigNumber.from(0);\n }\n return BigNumber.from(value);\n };\n const transaction = RLP.decode(data);\n if (transaction.length !== 7 && transaction.length !== 8) {\n logger.throwArgumentError(\"invalid raw transaction\", \"data\", data);\n }\n const isSigned = transaction.length === 8;\n const tx = {\n nonce: Number(handleNumber(transaction[0])),\n energyPrice: handleNumber(transaction[1]).toBigInt(),\n energyLimit: handleNumber(transaction[2]).toBigInt(),\n networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(),\n to: handleAddress(transaction[isSigned ? 4 : 3]),\n value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(),\n data: transaction[isSigned ? 6 : 5],\n };\n if (transaction.length === 8) {\n const prefix = networkIdToPrefix(Number(tx.networkId));\n const digest = sha256(serialize(tx));\n tx.hash = sha256(serialize(tx, transaction[7]));\n tx.from = recoverAddress(digest, transaction[7], prefix);\n tx.signature = transaction[7];\n }\n return tx;\n}\nconst unsignedTransactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n { name: \"networkId\", maxLength: 32, numeric: true },\n];\nconst transactionFields = [\n { name: \"nonce\", maxLength: 32, numeric: true },\n { name: \"energyPrice\", maxLength: 32, numeric: true },\n { name: \"energyLimit\", maxLength: 32, numeric: true },\n { name: \"networkId\", maxLength: 32, numeric: true },\n { name: \"to\", length: 22 },\n { name: \"value\", maxLength: 32, numeric: true },\n { name: \"data\" },\n];\nconst allowedTransactionKeys = {\n networkId: true,\n data: true,\n energyLimit: true,\n energyPrice: true,\n nonce: true,\n to: true,\n value: true,\n};\nfunction serialize(transaction, signature) {\n checkProperties(transaction, allowedTransactionKeys);\n const raw = [];\n (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) {\n let value = transaction[name] || [];\n const options = {};\n if (numeric) {\n options.hexPad = \"left\";\n }\n const tmpHexlified = hexlify(value, options);\n value = arrayify(tmpHexlified);\n // Fixed-width field\n if (length && value.length !== length && value.length > 0) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n // Variable-width (with a maximum)\n if (maxLength) {\n value = stripZeros(value);\n if (value.length > maxLength) {\n logger.throwArgumentError(\"invalid length for \" + name, \"transaction:\" + name, value);\n }\n }\n const hexlified = hexlify(value);\n raw.push(hexlified);\n });\n if (!!signature) {\n raw.push(hexlify(signature));\n }\n const finalValue = RLP.encode(raw);\n return finalValue;\n}\n/**\n * A **Transaction** describes an operation to be executed on\n * Core by an Externally Owned Account (EOA). It includes\n * who (the [[to]] address), what (the [[data]]) and how much (the\n * [[value]] in corebc) 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 #to;\n #data;\n #nonce;\n #energyLimit;\n #energyPrice;\n #value;\n #networkId;\n #sig;\n /**\n * The ``to`` address for the transaction or ``null`` if the\n * transaction is an ``init`` transaction.\n */\n get to() {\n return this.#to;\n }\n set to(value) {\n this.#to = value == null ? null : getAddress(value);\n }\n /**\n * The transaction nonce.\n */\n get nonce() {\n return this.#nonce;\n }\n set nonce(value) {\n this.#nonce = getNumber(value, \"value\");\n }\n /**\n * The energy limit.\n */\n get energyLimit() {\n return this.#energyLimit;\n }\n set energyLimit(value) {\n this.#energyLimit = getBigInt(value);\n }\n /**\n * The energy 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 energyPrice() {\n const value = this.#energyPrice;\n if (value == null) {\n return BN_0;\n }\n return value;\n }\n set energyPrice(value) {\n this.#energyPrice = value == null ? null : getBigInt(value, \"energyPrice\");\n }\n /**\n * The transaction data. For ``init`` transactions this is the\n * deployment code.\n */\n get data() {\n return this.#data;\n }\n set data(value) {\n this.#data = hexlify(value);\n }\n /**\n * The amount of xcb (in ore) to send in this transactions.\n */\n get value() {\n return this.#value;\n }\n set value(value) {\n this.#value = getBigInt(value, \"value\");\n }\n /**\n * The chain ID this transaction is valid on.\n */\n get networkId() {\n return this.#networkId;\n }\n set networkId(value) {\n this.#networkId = getBigInt(value);\n }\n /**\n * If signed, the signature for this transaction.\n */\n get signature() {\n return this.#sig || null;\n }\n set signature(value) {\n this.#sig = value == null ? null : value;\n }\n /**\n * Creates a new Transaction with default values.\n */\n constructor() {\n this.#to = null;\n this.#nonce = 0;\n this.#energyLimit = BigInt(0);\n this.#energyPrice = null;\n this.#data = \"0x\";\n this.#value = BigInt(0);\n this.#networkId = BigInt(0);\n this.#sig = 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 sha256(this.serialized);\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 sha256(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 const prefix = networkIdToPrefix(Number(this.#networkId));\n return recoverAddress(this.unsignedHash, this.signature, prefix);\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);\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 //isSigned(): this is SignedTransaction {\n return this.signature != null;\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 assert(this.signature != null, \"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized\", \"UNSUPPORTED_OPERATION\", { operation: \".serialized\" });\n return serialize(this, this.signature);\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 serialize(this);\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 to: this.to,\n data: this.data,\n nonce: this.nonce,\n energyLimit: s(this.energyLimit),\n energyPrice: s(this.energyPrice),\n value: s(this.value),\n networkId: s(this.networkId),\n sig: this.signature ? this.signature : null,\n };\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 return Transaction.from(parse(payload));\n }\n const result = new Transaction();\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.energyLimit != null) {\n result.energyLimit = tx.energyLimit;\n }\n if (tx.energyPrice != null) {\n result.energyPrice = tx.energyPrice;\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.networkId != null) {\n result.networkId = tx.networkId;\n }\n if (tx.signature != null) {\n result.signature = tx.signature;\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"],"names":["Logger","getAddress","BigNumber","RLP.decode","networkIdToPrefix","sha256","recoverAddress","checkProperties","hexlify","arrayify","stripZeros","RLP.encode","getNumber","getBigInt","SigningKey","assert","getBytes","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,mBAAmB,CAAC;AAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,IAAI,IAAI,KAAK,KAAK,IAAI,EAAE;AACxB,QAAQ,OAAO,IAAI;AACnB,IAAI;AACJ,IAAI,OAAOC,gBAAU,CAAC,KAAK,CAAC;AAC5B;AACA,SAAS,KAAK,CAAC,IAAI,EAAE;AACrB,IAAI,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK;AACpC;AACA,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE;AAC5B,YAAY,OAAOC,mBAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AACpC,QAAQ;AACR,QAAQ,OAAOA,mBAAS,CAAC,IAAI,CAAC,KAAK,CAAC;AACpC,IAAI,CAAC;AACL,IAAI,MAAM,WAAW,GAAGC,UAAU,CAAC,IAAI,CAAC;AACxC,IAAI,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CA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,EAAE,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC;AAClH,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/base58.d.ts b/lib.commonjs/utils/base58.d.ts deleted file mode 100644 index 8b377936b..000000000 --- a/lib.commonjs/utils/base58.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -import type { BytesLike } from "./index.js"; -/** - * Encode %%value%% as a Base58-encoded string. - */ -export declare function encodeBase58(_value: BytesLike): string; -/** - * Decode the Base58-encoded %%value%%. - */ -export declare function decodeBase58(value: string): bigint; -//# sourceMappingURL=base58.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/base58.d.ts.map b/lib.commonjs/utils/base58.d.ts.map deleted file mode 100644 index 21386c9f3..000000000 --- a/lib.commonjs/utils/base58.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base58.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAoB5C;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAQtD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD"} \ No newline at end of file diff --git a/lib.commonjs/utils/base58.js b/lib.commonjs/utils/base58.js deleted file mode 100644 index c284b7f66..000000000 --- a/lib.commonjs/utils/base58.js +++ /dev/null @@ -1,61 +0,0 @@ -'use strict'; - -var data = require('./data.js'); -var errors = require('./errors.js'); -var maths = require('./maths.js'); - -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -let Lookup = null; -function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - errors.assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; -} -const BN_0 = BigInt(0); -const BN_58 = BigInt(58); -/** - * Encode %%value%% as a Base58-encoded string. - */ -function encodeBase58(_value) { - let value = maths.toBigInt(data.getBytes(_value)); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - return result; -} -/** - * Decode the Base58-encoded %%value%%. - */ -function decodeBase58(value) { - let result = BN_0; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; -} - -exports.decodeBase58 = decodeBase58; -exports.encodeBase58 = encodeBase58; -//# sourceMappingURL=base58.js.map diff --git a/lib.commonjs/utils/base58.js.map b/lib.commonjs/utils/base58.js.map deleted file mode 100644 index 197acb146..000000000 --- a/lib.commonjs/utils/base58.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base58.js","sources":["../../lib.esm/utils/base58.js"],"sourcesContent":["/**\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 let value = toBigInt(getBytes(_value));\n let result = \"\";\n while (value) {\n result = Alphabet[Number(value % BN_58)] + result;\n value /= BN_58;\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"],"names":["assertArgument","toBigInt","getBytes"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,MAAM,QAAQ,GAAG,4DAA4D;AAC7E,IAAI,MAAM,GAAG,IAAI;AACjB,SAAS,QAAQ,CAAC,MAAM,EAAE;AAC1B,IAAI,IAAI,MAAM,IAAI,IAAI,EAAE;AACxB,QAAQ,MAAM,GAAG,EAAE;AACnB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAClD,YAAY,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;AAC3C,QAAQ;AACR,IAAI;AACJ,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACjC,IAAIA,qBAAc,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC;AAC5E,IAAI,OAAO,MAAM;AACjB;AACA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC;AACxB;AACA;AACA;AACO,SAAS,YAAY,CAAC,MAAM,EAAE;AACrC,IAAI,IAAI,KAAK,GAAGC,cAAQ,CAACC,aAAQ,CAAC,MAAM,CAAC,CAAC;AAC1C,IAAI,IAAI,MAAM,GAAG,EAAE;AACnB,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,MAAM;AACzD,QAAQ,KAAK,IAAI,KAAK;AACtB,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,IAAI,MAAM,GAAG,IAAI;AACrB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC3C,QAAQ,MAAM,IAAI,KAAK;AACvB,QAAQ,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpC,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/base64-browser.d.ts b/lib.commonjs/utils/base64-browser.d.ts deleted file mode 100644 index ea96c442c..000000000 --- a/lib.commonjs/utils/base64-browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BytesLike } from "./data.js"; -export declare function decodeBase64(textData: string): Uint8Array; -export declare function encodeBase64(_data: BytesLike): string; -//# sourceMappingURL=base64-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/base64-browser.d.ts.map b/lib.commonjs/utils/base64-browser.d.ts.map deleted file mode 100644 index 83a734cd1..000000000 --- a/lib.commonjs/utils/base64-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAOzD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAOrD"} \ No newline at end of file diff --git a/lib.commonjs/utils/base64-browser.js b/lib.commonjs/utils/base64-browser.js deleted file mode 100644 index 233688182..000000000 --- a/lib.commonjs/utils/base64-browser.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -var data = require('./data.js'); - -// utils/base64-browser -function decodeBase64(textData) { - textData = atob(textData); - const data$1 = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data$1[i] = textData.charCodeAt(i); - } - return data.getBytes(data$1); -} -function encodeBase64(_data) { - const data$1 = data.getBytes(_data); - let textData = ""; - for (let i = 0; i < data$1.length; i++) { - textData += String.fromCharCode(data$1[i]); - } - return btoa(textData); -} - -exports.decodeBase64 = decodeBase64; -exports.encodeBase64 = encodeBase64; -//# sourceMappingURL=base64-browser.js.map diff --git a/lib.commonjs/utils/base64-browser.js.map b/lib.commonjs/utils/base64-browser.js.map deleted file mode 100644 index 0268d48b0..000000000 --- a/lib.commonjs/utils/base64-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64-browser.js","sources":["../../lib.esm/utils/base64-browser.js"],"sourcesContent":["// utils/base64-browser\nimport { getBytes } from \"./data.js\";\nexport function decodeBase64(textData) {\n textData = atob(textData);\n const data = new Uint8Array(textData.length);\n for (let i = 0; i < textData.length; i++) {\n data[i] = textData.charCodeAt(i);\n }\n return getBytes(data);\n}\nexport function encodeBase64(_data) {\n const data = getBytes(_data);\n let textData = \"\";\n for (let i = 0; i < data.length; i++) {\n textData += String.fromCharCode(data[i]);\n }\n return btoa(textData);\n}\n//# sourceMappingURL=base64-browser.js.map"],"names":["data","getBytes"],"mappings":";;;;AAAA;AAEO,SAAS,YAAY,CAAC,QAAQ,EAAE;AACvC,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;AAC7B,IAAI,MAAMA,MAAI,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChD,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC9C,QAAQA,MAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;AACxC,IAAI;AACJ,IAAI,OAAOC,aAAQ,CAACD,MAAI,CAAC;AACzB;AACO,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,MAAMA,MAAI,GAAGC,aAAQ,CAAC,KAAK,CAAC;AAChC,IAAI,IAAI,QAAQ,GAAG,EAAE;AACrB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAGD,MAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1C,QAAQ,QAAQ,IAAI,MAAM,CAAC,YAAY,CAACA,MAAI,CAAC,CAAC,CAAC,CAAC;AAChD,IAAI;AACJ,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC;AACzB;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/base64.d.ts b/lib.commonjs/utils/base64.d.ts deleted file mode 100644 index 0cab53288..000000000 --- a/lib.commonjs/utils/base64.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -export declare function decodeBase64(value: string): Uint8Array; -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -export declare function encodeBase64(data: BytesLike): string; -//# sourceMappingURL=base64.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/base64.d.ts.map b/lib.commonjs/utils/base64.d.ts.map deleted file mode 100644 index 34656262c..000000000 --- a/lib.commonjs/utils/base64.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAEtD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEpD"} \ No newline at end of file diff --git a/lib.commonjs/utils/base64.js b/lib.commonjs/utils/base64.js deleted file mode 100644 index c3d3c8b92..000000000 --- a/lib.commonjs/utils/base64.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; - -var data = require('./data.js'); - -/** - * [Base64 encoding](link-wiki-base64) using 6-bit words to encode - * arbitrary bytes into a string using 65 printable symbols, the - * upper-case and lower-case alphabet, the digits ``0`` through ``9``, - * ``"+"`` and ``"/"`` with the ``"="`` used for padding. - * - * @_subsection: api/utils:Base64 Encoding [about-base64] - */ -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -function decodeBase64(value) { - return data.getBytesCopy(Buffer.from(value, "base64")); -} -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -function encodeBase64(data$1) { - return Buffer.from(data.getBytes(data$1)).toString("base64"); -} - -exports.decodeBase64 = decodeBase64; -exports.encodeBase64 = encodeBase64; -//# sourceMappingURL=base64.js.map diff --git a/lib.commonjs/utils/base64.js.map b/lib.commonjs/utils/base64.js.map deleted file mode 100644 index d530da897..000000000 --- a/lib.commonjs/utils/base64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.js","sources":["../../lib.esm/utils/base64.js"],"sourcesContent":["/**\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 * 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"],"names":["getBytesCopy","data","getBytes"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE;AACpC,IAAI,OAAOA,iBAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAACC,MAAI,EAAE;AACnC,IAAI,OAAO,MAAM,CAAC,IAAI,CAACC,aAAQ,CAACD,MAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACzD;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/data.d.ts b/lib.commonjs/utils/data.d.ts deleted file mode 100644 index 59cca6eba..000000000 --- a/lib.commonjs/utils/data.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -/** - * A [[HexString]] whose length is even, which ensures it is a valid - * representation of binary data. - */ -export type DataHexString = string; -/** - * A string which is prefixed with ``0x`` and followed by any number - * of case-agnostic hexadecimal characters. - * - * It must match the regular expression ``/0x[0-9A-Fa-f]*\/``. - */ -export type HexString = string; -/** - * An object that can be used to represent binary data. - */ -export type Bytes = ArrayLike; -export type BytesLike = Bytes | string; -export type DataOptions = { - allowMissingPrefix?: boolean; - hexPad?: "left" | "right" | null; -}; -export interface Hexable { - toHexString(): string; -} -export declare function isBytes(value: any): value is Bytes; -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -export declare function getBytes(value: BytesLike, name?: string): Uint8Array; -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -export declare function getBytesCopy(value: BytesLike, name?: string): Uint8Array; -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -export declare function isHexString(value: any, length?: number | boolean): value is `0x${string}`; -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -export declare function isBytesLike(value: any): value is BytesLike; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -export declare function hexlify(value: BytesLike | Hexable | number | bigint, options?: DataOptions): string; -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -export declare function concat(items: ReadonlyArray): string; -export declare function hexDataSlice(data: BytesLike, offset: number, endOffset?: number): string; -export declare function hexDataLength(data: BytesLike): number | null; -/** - * Returns the length of %%data%%, in bytes. - */ -export declare function dataLength(data: BytesLike): number; -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -export declare function dataSlice(data: BytesLike, start?: number, end?: number): string; -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -export declare function stripZerosLeft(data: BytesLike): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -export declare function zeroPadValue(data: BytesLike, length: number): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -export declare function zeroPadBytes(data: BytesLike, length: number): string; -export declare function stripZeros(value: BytesLike): Uint8Array; -export declare function arrayify(value: BytesLike | Hexable | number, options?: DataOptions): Uint8Array; -export declare function hexConcat(items: ReadonlyArray): string; -//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/data.d.ts.map b/lib.commonjs/utils/data.d.ts.map deleted file mode 100644 index 3b65817ca..000000000 --- a/lib.commonjs/utils/data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG;IACzB,kBAAkB,CAAC,EAAE,O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,MAAM,EACd,GAAG,CAAC,EAAE,MAAM,GACV,MAAM,CAYR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAMtD;AA0BD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAmBvD;AAED,wBAAgB,QAAQ,CACvB,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,EACnC,OAAO,CAAC,EAAE,WAAW,GACnB,UAAU,CAuDZ;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAMjE"} \ No newline at end of file diff --git a/lib.commonjs/utils/data.js b/lib.commonjs/utils/data.js deleted file mode 100644 index 525dd8821..000000000 --- a/lib.commonjs/utils/data.js +++ /dev/null @@ -1,376 +0,0 @@ -'use strict'; - -var logger$1 = require('../logger/logger.js'); -var errors = require('./errors.js'); - -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -const logger = new logger$1.Logger("utils/data/0.0.1"); -function isHexable(value) { - return !!value.toHexString; -} -function isInteger(value) { - return typeof value === "number" && value == value && value % 1 === 0; -} -function isBytes(value) { - if (value == null) { - return false; - } - if (value.constructor === Uint8Array) { - return true; - } - if (typeof value === "string") { - return false; - } - if (!isInteger(value.length) || value.length < 0) { - return false; - } - for (let i = 0; i < value.length; i++) { - const v = value[i]; - if (!isInteger(v) || v < 0 || v >= 256) { - return false; - } - } - return true; -} -function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - errors.assertArgument(false, "invalid BytesLike value", name || "value", value); -} -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -function getBytes(value, name) { - return _getBytes(value, name, false); -} -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -function getBytesCopy(value, name) { - return _getBytes(value, name, true); -} -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -function isHexString(value, length) { - if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof length === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && value.length % 2 !== 0) { - return false; - } - return true; -} -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -function isBytesLike(value) { - return isHexString(value, true) || value instanceof Uint8Array; -} -const HexCharacters = "0123456789abcdef"; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -function hexlify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "string") { - if (value.includes(",") && value.startsWith("0x")) { - const v = value - .replace("0x", "") - .split(",") - .map((item) => Number(item)); - // @ts-ignore - value = new Uint8Array(v); - } - } - if (typeof value === "number") { - logger.checkSafeUint53(value, "invalid hexlify value"); - let hex = ""; - while (value) { - hex = HexCharacters[value & 0xf] + hex; - value = Math.floor(value / 16); - } - if (hex.length) { - if (hex.length % 2) { - hex = "0" + hex; - } - return "0x" + hex; - } - return "0x00"; - } - if (typeof value === "bigint") { - value = value.toString(16); - if (value.length % 2) { - return "0x0" + value; - } - return "0x" + value; - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - return value.toHexString(); - } - if (isHexString(value)) { - if (value.length % 2) { - if (options.hexPad === "left") { - value = "0x0" + value.substring(2); - } - else if (options.hexPad === "right") { - value += "0"; - } - else { - logger.throwArgumentError("hex data is odd-length", "value", value); - } - } - return value.toLowerCase(); - } - if (isBytes(value)) { - let result = "0x"; - for (let i = 0; i < value.length; i++) { - let v = value[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; - } - return logger.throwArgumentError("invalid hexlify value", "value", value); -} -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -function concat(items) { - return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); -} -function hexDataSlice(data, offset, endOffset) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - logger.throwArgumentError("invalid hexData", "value", data); - } - offset = 2 + 2 * offset; - if (endOffset != null) { - return "0x" + data.substring(offset, 2 + 2 * endOffset); - } - return "0x" + data.substring(offset); -} -function hexDataLength(data) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - return null; - } - return (data.length - 2) / 2; -} -/** - * Returns the length of %%data%%, in bytes. - */ -function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; -} -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - errors.assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: bytes.length, - offset: end, - }); - } - return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); -} -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; -} -function zeroPad(data, length, left) { - const bytes = getBytes(data); - errors.assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1, - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -function zeroPadValue(data, length) { - return zeroPad(data, length, true); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -function zeroPadBytes(data, length) { - return zeroPad(data, length, false); -} -function stripZeros(value) { - let result = arrayify(value); - if (result.length === 0) { - return result; - } - // Find the first non-zero entry - let start = 0; - while (start < result.length && result[start] === 0) { - start++; - } - // If we started with zeros, strip them - if (start) { - result = result.slice(start); - } - return result; -} -function arrayify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "number") { - logger.checkSafeUint53(value, "invalid arrayify value"); - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value = parseInt(String(value / 256)); - } - if (result.length === 0) { - result.push(0); - } - return new Uint8Array(result); - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - value = value.toHexString(); - } - if (isHexString(value)) { - let hex = value.substring(2); - if (hex.length % 2) { - if (options.hexPad === "left") { - hex = "0x0" + hex.substring(2); - } - else if (options.hexPad === "right") { - hex += "0"; - } - else { - logger.throwArgumentError("hex data is odd-length", "value", value); - } - } - const result = []; - for (let i = 0; i < hex.length; i += 2) { - // @ts-ignore - result.push(parseInt(hex.substring(i, i + 2), 16)); - } - return new Uint8Array(result); - } - if (isBytes(value)) { - return new Uint8Array(value); - } - return logger.throwArgumentError("invalid arrayify value", "value", value); -} -function hexConcat(items) { - let result = "0x"; - items.forEach((item) => { - result += hexlify(item).substring(2); - }); - return result; -} - -exports.arrayify = arrayify; -exports.concat = concat; -exports.dataLength = dataLength; -exports.dataSlice = dataSlice; -exports.getBytes = getBytes; -exports.getBytesCopy = getBytesCopy; -exports.hexConcat = hexConcat; -exports.hexDataLength = hexDataLength; -exports.hexDataSlice = hexDataSlice; -exports.hexlify = hexlify; -exports.isBytes = isBytes; -exports.isBytesLike = isBytesLike; -exports.isHexString = isHexString; -exports.stripZeros = stripZeros; -exports.stripZerosLeft = stripZerosLeft; -exports.zeroPadBytes = zeroPadBytes; -exports.zeroPadValue = zeroPadValue; -//# sourceMappingURL=data.js.map diff --git a/lib.commonjs/utils/data.js.map b/lib.commonjs/utils/data.js.map deleted file mode 100644 index 03d881026..000000000 --- a/lib.commonjs/utils/data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data.js","sources":["../../lib.esm/utils/data.js"],"sourcesContent":["/**\n * Some data helpers.\n *\n *\n * @_subsection api/utils:Data Helpers [about-data]\n */\nimport { Logger } from \"../logger/logger.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst logger = new Logger(\"utils/data/0.0.1\");\nfunction isHexable(value) {\n return !!value.toHexString;\n}\nfunction isInteger(value) {\n return typeof value === \"number\" && value == value && value % 1 === 0;\n}\nexport function isBytes(value) {\n if (value == null) {\n return false;\n }\n if (value.constructor === Uint8Array) {\n return true;\n }\n if (typeof value === \"string\") {\n return false;\n }\n if (!isInteger(value.length) || value.length < 0) {\n return false;\n }\n for (let i = 0; i < value.length; i++) {\n const v = value[i];\n if (!isInteger(v) || v < 0 || v >= 256) {\n return false;\n }\n }\n return true;\n}\nfunction _getBytes(value, name, copy) {\n if (value instanceof Uint8Array) {\n if (copy) {\n return new Uint8Array(value);\n }\n return value;\n }\n if (typeof value === \"string\" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) {\n const result = new Uint8Array((value.length - 2) / 2);\n let offset = 2;\n for (let i = 0; i < result.length; i++) {\n result[i] = parseInt(value.substring(offset, offset + 2), 16);\n offset += 2;\n }\n return result;\n }\n assertArgument(false, \"invalid BytesLike value\", name || \"value\", value);\n}\n/**\n * Get a typed Uint8Array for %%value%%. If already a Uint8Array\n * the original %%value%% is returned; if a copy is required use\n * [[getBytesCopy]].\n *\n * @see: getBytesCopy\n */\nexport function getBytes(value, name) {\n return _getBytes(value, name, false);\n}\n/**\n * Get a typed Uint8Array for %%value%%, creating a copy if necessary\n * to prevent any modifications of the returned value from being\n * reflected elsewhere.\n *\n * @see: getBytes\n */\nexport function getBytesCopy(value, name) {\n return _getBytes(value, name, true);\n}\n/**\n * Returns true if %%value%% is a valid [[HexString]].\n *\n * If %%length%% is ``true`` or a //number//, it also checks that\n * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//)\n * bytes of data (e.g. ``0x1234`` is 2 bytes).\n */\nexport function isHexString(value, length) {\n if (typeof value !== \"string\" || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n return false;\n }\n if (typeof length === \"number\" && value.length !== 2 + 2 * length) {\n return false;\n }\n if (length === true && value.length % 2 !== 0) {\n return false;\n }\n return true;\n}\n/**\n * Returns true if %%value%% is a valid representation of arbitrary\n * data (i.e. a valid [[DataHexString]] or a Uint8Array).\n */\nexport function isBytesLike(value) {\n return isHexString(value, true) || value instanceof Uint8Array;\n}\nconst HexCharacters = \"0123456789abcdef\";\n/**\n * Returns a [[DataHexString]] representation of %%data%%.\n */\nexport function hexlify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"string\") {\n if (value.includes(\",\") && value.startsWith(\"0x\")) {\n const v = value\n .replace(\"0x\", \"\")\n .split(\",\")\n .map((item) => Number(item));\n // @ts-ignore\n value = new Uint8Array(v);\n }\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid hexlify value\");\n let hex = \"\";\n while (value) {\n hex = HexCharacters[value & 0xf] + hex;\n value = Math.floor(value / 16);\n }\n if (hex.length) {\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n return \"0x\" + hex;\n }\n return \"0x00\";\n }\n if (typeof value === \"bigint\") {\n value = value.toString(16);\n if (value.length % 2) {\n return \"0x0\" + value;\n }\n return \"0x\" + value;\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n return value.toHexString();\n }\n if (isHexString(value)) {\n if (value.length % 2) {\n if (options.hexPad === \"left\") {\n value = \"0x0\" + value.substring(2);\n }\n else if (options.hexPad === \"right\") {\n value += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n return value.toLowerCase();\n }\n if (isBytes(value)) {\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n let v = value[i];\n result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f];\n }\n return result;\n }\n return logger.throwArgumentError(\"invalid hexlify value\", \"value\", value);\n}\n/**\n * Returns a [[DataHexString]] by concatenating all values\n * within %%data%%.\n */\nexport function concat(items) {\n return \"0x\" + items.map((d) => hexlify(d).substring(2)).join(\"\");\n}\nexport function hexDataSlice(data, offset, endOffset) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n logger.throwArgumentError(\"invalid hexData\", \"value\", data);\n }\n offset = 2 + 2 * offset;\n if (endOffset != null) {\n return \"0x\" + data.substring(offset, 2 + 2 * endOffset);\n }\n return \"0x\" + data.substring(offset);\n}\nexport function hexDataLength(data) {\n if (typeof data !== \"string\") {\n data = hexlify(data);\n }\n else if (!isHexString(data) || data.length % 2) {\n return null;\n }\n return (data.length - 2) / 2;\n}\n/**\n * Returns the length of %%data%%, in bytes.\n */\nexport function dataLength(data) {\n if (isHexString(data, true)) {\n return (data.length - 2) / 2;\n }\n return getBytes(data).length;\n}\n/**\n * Returns a [[DataHexString]] by slicing %%data%% from the %%start%%\n * offset to the %%end%% offset.\n *\n * By default %%start%% is 0 and %%end%% is the length of %%data%%.\n */\nexport function dataSlice(data, start, end) {\n const bytes = getBytes(data);\n if (end != null && end > bytes.length) {\n assert(false, \"cannot slice beyond data bounds\", \"BUFFER_OVERRUN\", {\n buffer: bytes,\n length: bytes.length,\n offset: end,\n });\n }\n return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));\n}\n/**\n * Return the [[DataHexString]] result by stripping all **leading**\n ** zero bytes from %%data%%.\n */\nexport function stripZerosLeft(data) {\n let bytes = hexlify(data).substring(2);\n while (bytes.startsWith(\"00\")) {\n bytes = bytes.substring(2);\n }\n return \"0x\" + bytes;\n}\nfunction zeroPad(data, length, left) {\n const bytes = getBytes(data);\n assert(length >= bytes.length, \"padding exceeds data length\", \"BUFFER_OVERRUN\", {\n buffer: new Uint8Array(bytes),\n length: length,\n offset: length + 1,\n });\n const result = new Uint8Array(length);\n result.fill(0);\n if (left) {\n result.set(bytes, length - bytes.length);\n }\n else {\n result.set(bytes, 0);\n }\n return hexlify(result);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **left**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **values** are in Solidity\n * (e.g. ``uint128``).\n */\nexport function zeroPadValue(data, length) {\n return zeroPad(data, length, true);\n}\n/**\n * Return the [[DataHexString]] of %%data%% padded on the **right**\n * to %%length%% bytes.\n *\n * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is\n * thrown.\n *\n * This pads data the same as **bytes** are in Solidity\n * (e.g. ``bytes16``).\n */\nexport function zeroPadBytes(data, length) {\n return zeroPad(data, length, false);\n}\nexport function stripZeros(value) {\n let result = arrayify(value);\n if (result.length === 0) {\n return result;\n }\n // Find the first non-zero entry\n let start = 0;\n while (start < result.length && result[start] === 0) {\n start++;\n }\n // If we started with zeros, strip them\n if (start) {\n result = result.slice(start);\n }\n return result;\n}\nexport function arrayify(value, options) {\n if (!options) {\n options = {};\n }\n if (typeof value === \"number\") {\n logger.checkSafeUint53(value, \"invalid arrayify value\");\n const result = [];\n while (value) {\n // @ts-ignore\n result.unshift(value & 0xff);\n value = parseInt(String(value / 256));\n }\n if (result.length === 0) {\n result.push(0);\n }\n return new Uint8Array(result);\n }\n if (options.allowMissingPrefix &&\n typeof value === \"string\" &&\n value.substring(0, 2) !== \"0x\") {\n value = \"0x\" + value;\n }\n if (isHexable(value)) {\n value = value.toHexString();\n }\n if (isHexString(value)) {\n let hex = value.substring(2);\n if (hex.length % 2) {\n if (options.hexPad === \"left\") {\n hex = \"0x0\" + hex.substring(2);\n }\n else if (options.hexPad === \"right\") {\n hex += \"0\";\n }\n else {\n logger.throwArgumentError(\"hex data is odd-length\", \"value\", value);\n }\n }\n const result = [];\n for (let i = 0; i < hex.length; i += 2) {\n // @ts-ignore\n result.push(parseInt(hex.substring(i, i + 2), 16));\n }\n return new Uint8Array(result);\n }\n if (isBytes(value)) {\n return new Uint8Array(value);\n }\n return logger.throwArgumentError(\"invalid arrayify value\", \"value\", value);\n}\nexport function hexConcat(items) {\n let result = \"0x\";\n items.forEach((item) => {\n result += hexlify(item).substring(2);\n });\n return result;\n}\n//# sourceMappingURL=data.js.map"],"names":["Logger","assertArgument","assert"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,MAAM,GAAG,IAAIA,eAAM,CAAC,kBAAkB,CAAC;AAC7C,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,OAAO,CAAC,CAAC,KAAK,CAAC,WAAW;AAC9B;AACA,SAAS,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C,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;AAChD;AACA,YAAY,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9D,QAAQ;AACR,QAAQ,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC;AACrC,IAAI;AACJ,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;AACxB,QAAQ,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC;AACpC,IAAI;AACJ,IAAI,OAAO,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,EAAE,OAAO,EAAE,KAAK,CAAC;AAC9E;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,IAAI,MAAM,GAAG,IAAI;AACrB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK;AAC5B,QAAQ,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5C,IAAI,CAAC,CAAC;AACN,IAAI,OAAO,MAAM;AACjB;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/errors.d.ts b/lib.commonjs/utils/errors.d.ts deleted file mode 100644 index 130aa0621..000000000 --- a/lib.commonjs/utils/errors.d.ts +++ /dev/null @@ -1,486 +0,0 @@ -/** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -import type { TransactionRequest, TransactionReceipt, TransactionResponse } from "../providers/index.js"; -import type { FetchRequest, FetchResponse } from "./fetch.js"; -export type ErrorInfo = Omit; -/** - * All errors emitted by corebc have an **ErrorCode** to help - * identify and coalesce errors to simplfy programatic analysis. - * - * Each **ErrorCode** is the %%code%% proerty of a coresponding - * [[corebcError]]. - * - * **Generic Errors** - * - * **``"UNKNOWN_ERROR"``** - see [[UnknownError]] - * - * **``"NOT_IMPLEMENTED"``** - see [[NotImplementedError]] - * - * **``"UNSUPPORTED_OPERATION"``** - see [[UnsupportedOperationError]] - * - * **``"NETWORK_ERROR"``** - see [[NetworkError]] - * - * **``"SERVER_ERROR"``** - see [[ServerError]] - * - * **``"TIMEOUT"``** - see [[TimeoutError]] - * - * **``"BAD_DATA"``** - see [[BadDataError]] - * - * **``"CANCELLED"``** - see [[CancelledError]] - * - * **Operational Errors** - * - * **``"BUFFER_OVERRUN"``** - see [[BufferOverrunError]] - * - * **``"NUMERIC_FAULT"``** - see [[NumericFaultError]] - * - * **Argument Errors** - * - * **``"INVALID_ARGUMENT"``** - see [[InvalidArgumentError]] - * - * **``"MISSING_ARGUMENT"``** - see [[MissingArgumentError]] - * - * **``"UNEXPECTED_ARGUMENT"``** - see [[UnexpectedArgumentError]] - * - * **``"VALUE_MISMATCH"``** - //unused// - * - * **Blockchain Errors** - * - * **``"CALL_EXCEPTION"``** - see [[CallExceptionError]] - * - * **``"INSUFFICIENT_FUNDS"``** - see [[InsufficientFundsError]] - * - * **``"NONCE_EXPIRED"``** - see [[NonceExpiredError]] - * - * **``"REPLACEMENT_UNDERPRICED"``** - see [[ReplacementUnderpricedError]] - * - * **``"TRANSACTION_REPLACED"``** - see [[TransactionReplacedError]] - * - * **``"UNCONFIGURED_NAME"``** - see [[UnconfiguredNameError]] - * - * **``"OFFCHAIN_FAULT"``** - see [[OffchainFaultError]] - * - * **User Interaction Errors** - * - * **``"ACTION_REJECTED"``** - see [[ActionRejectedError]] - */ -export type ErrorCode = "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | "CANCELLED" | "BUFFER_OVERRUN" | "NUMERIC_FAULT" | "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | "VALUE_MISMATCH" | "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | "ACTION_REJECTED"; -/** - * All errors in corebc include properties to assist in - * machine-readable errors. - */ -export interface CoreBCError extends Error { - /** - * The string error code. - */ - code: ErrorCode; - /** - * Additional info regarding the error that may be useful. - * - * This is generally helpful mostly for human-based debugging. - */ - info?: Record; - /** - * Any related error. - */ - error?: Error; -} -/** - * This Error is a catch-all for when there is no way for corebc to - * know what the underlying problem is. - */ -export interface UnknownError extends CoreBCError<"UNKNOWN_ERROR"> { - [key: string]: any; -} -/** - * This Error is mostly used as a stub for functionality that is - * intended for the future, but is currently not implemented. - */ -export interface NotImplementedError extends CoreBCError<"NOT_IMPLEMENTED"> { - /** - * The attempted operation. - */ - operation: string; -} -/** - * This Error indicates that the attempted operation is not supported. - * - * This could range from a specifc JSON-RPC end-point not supporting - * a feature to a specific configuration of an object prohibiting the - * operation. - * - * For example, a [[Wallet]] with no connected [[Provider]] is unable - * to send a transaction. - */ -export interface UnsupportedOperationError extends CoreBCError<"UNSUPPORTED_OPERATION"> { - /** - * The attempted operation. - */ - operation: string; -} -export interface NetworkError extends CoreBCError<"NETWORK_ERROR"> { - event: string; -} -/** - * This Error indicates there was a problem fetching a resource from - * a server. - */ -export interface ServerError extends CoreBCError<"SERVER_ERROR"> { - /** - * The requested resource. - */ - request: FetchRequest | string; - /** - * The response received from the server, if available. - */ - response?: FetchResponse; -} -/** - * This Error indicates that the timeout duration has expired and - * that the operation has been implicitly cancelled. - * - * The side-effect of the operation may still occur, as this - * generally means a request has been sent and there has simply - * been no response to indicate whether it was processed or not. - */ -export interface TimeoutError extends CoreBCError<"TIMEOUT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The reason. - */ - reason: string; - /** - * The resource request, if available. - */ - request?: FetchRequest; -} -/** - * This Error indicates that a provided set of data cannot - * be correctly interpretted. - */ -export interface BadDataError extends CoreBCError<"BAD_DATA"> { - /** - * The data. - */ - value: any; -} -/** - * This Error indicates that the operation was cancelled by a - * programmatic call, for example to ``cancel()``. - */ -export interface CancelledError extends CoreBCError<"CANCELLED"> { -} -/** - * This Error indicates an attempt was made to read outside the bounds - * of protected data. - * - * Most operations in corebc are protected by bounds checks, to mitigate - * exploits when parsing data. - */ -export interface BufferOverrunError extends CoreBCError<"BUFFER_OVERRUN"> { - /** - * The buffer that was overrun. - */ - buffer: Uint8Array; - /** - * The length of the buffer. - */ - length: number; - /** - * The offset that was requested. - */ - offset: number; -} -/** - * This Error indicates an operation which would result in incorrect - * arithmetic output has occurred. - * - * For example, trying to divide by zero or using a ``uint8`` to store - * a negative value. - */ -export interface NumericFaultError extends CoreBCError<"NUMERIC_FAULT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The fault reported. - */ - fault: string; - /** - * The value the operation was attempted against. - */ - value: any; -} -/** - * This Error indicates an incorrect type or value was passed to - * a function or method. - */ -export interface InvalidArgumentError extends CoreBCError<"INVALID_ARGUMENT"> { - /** - * The name of the argument. - */ - argument: string; - /** - * The value that was provided. - */ - value: any; - info?: Record; -} -/** - * This Error indicates there were too few arguments were provided. - */ -export interface MissingArgumentError extends CoreBCError<"MISSING_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * This Error indicates too many arguments were provided. - */ -export interface UnexpectedArgumentError extends CoreBCError<"UNEXPECTED_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * The action that resulted in the error. - */ -export type CallExceptionAction = "call" | "estimateEnergy" | "getTransactionResult" | "unknown"; -/** - * The related transaction that caused the error. - */ -export type CallExceptionTransaction = { - to: null | string; - from?: string; - data: string; -}; -/** - * This **Error** indicates a transaction reverted. - */ -export interface CallExceptionError extends CoreBCError<"CALL_EXCEPTION"> { - /** - * The action being performed when the revert was encountered. - */ - action: CallExceptionAction; - /** - * The revert data returned. - */ - data: null | string; - /** - * A human-readable representation of data, if possible. - */ - reason: null | string; - /** - * The transaction that triggered the exception. - */ - transaction: CallExceptionTransaction; - /** - * The contract invocation details, if available. - */ - invocation: null | { - method: string; - signature: string; - args: Array; - }; - /** - * The built-in or custom revert error, if available - */ - revert: null | { - signature: string; - name: string; - args: Array; - }; -} -/** - * The sending account has insufficient funds to cover the - * entire transaction cost. - */ -export interface InsufficientFundsError extends CoreBCError<"INSUFFICIENT_FUNDS"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * The sending account has already used this nonce in a - * transaction that has been included. - */ -export interface NonceExpiredError extends CoreBCError<"NONCE_EXPIRED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A CCIP-read exception, which cannot be recovered from or - * be further processed. - */ -export interface OffchainFaultError extends CoreBCError<"OFFCHAIN_FAULT"> { - /** - * The transaction. - */ - transaction?: TransactionRequest; - /** - * The reason the CCIP-read failed. - */ - reason: string; -} -/** - * An attempt was made to replace a transaction, but with an - * insufficient additional fee to afford evicting the old - * transaction from the memory pool. - */ -export interface ReplacementUnderpricedError extends CoreBCError<"REPLACEMENT_UNDERPRICED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A pending transaction was replaced by another. - */ -export interface TransactionReplacedError extends CoreBCError<"TRANSACTION_REPLACED"> { - /** - * If the transaction was cancelled, such that the original - * effects of the transaction cannot be assured. - */ - cancelled: boolean; - /** - * The reason the transaction was replaced. - */ - reason: "repriced" | "cancelled" | "replaced"; - /** - * The hash of the replaced transaction. - */ - hash: string; - /** - * The transaction that replaced the transaction. - */ - replacement: TransactionResponse; - /** - * The receipt of the transaction that replace the transaction. - */ - receipt: TransactionReceipt; -} -/** - * This Error indicates an ENS name was used, but the name has not - * been configured. - * - * This could indicate an ENS name is unowned or that the current - * address being pointed to is the [[ZeroAddress]]. - */ -export interface UnconfiguredNameError extends CoreBCError<"UNCONFIGURED_NAME"> { - /** - * The ENS name that was requested - */ - value: string; -} -/** - * This Error indicates a request was rejected by the user. - * - * In most clients (such as MetaMask), when an operation requires user - * authorization (such as ``signer.sendTransaction``), the client - * presents a dialog box to the user. If the user denies the request - * this error is thrown. - */ -export interface ActionRejectedError extends CoreBCError<"ACTION_REJECTED"> { - /** - * The requested action. - */ - action: "requestAccess" | "sendTransaction" | "signMessage" | "signTransaction" | "signTypedData" | "unknown"; - /** - * The reason the action was rejected. - * - * If there is already a pending request, some clients may indicate - * there is already a ``"pending"`` action. This prevents an app - * from spamming the user. - */ - reason: "expired" | "rejected" | "pending"; -} -/** - * A conditional type that transforms the [[ErrorCode]] T into - * its corebcError type. - * - * @flatworm-skip-docs - */ -export type CodedCoreBCError = T extends "UNKNOWN_ERROR" ? UnknownError : T extends "NOT_IMPLEMENTED" ? NotImplementedError : T extends "UNSUPPORTED_OPERATION" ? UnsupportedOperationError : T extends "NETWORK_ERROR" ? NetworkError : T extends "SERVER_ERROR" ? ServerError : T extends "TIMEOUT" ? TimeoutError : T extends "BAD_DATA" ? BadDataError : T extends "CANCELLED" ? CancelledError : T extends "BUFFER_OVERRUN" ? BufferOverrunError : T extends "NUMERIC_FAULT" ? NumericFaultError : T extends "INVALID_ARGUMENT" ? InvalidArgumentError : T extends "MISSING_ARGUMENT" ? MissingArgumentError : T extends "UNEXPECTED_ARGUMENT" ? UnexpectedArgumentError : T extends "CALL_EXCEPTION" ? CallExceptionError : T extends "INSUFFICIENT_FUNDS" ? InsufficientFundsError : T extends "NONCE_EXPIRED" ? NonceExpiredError : T extends "OFFCHAIN_FAULT" ? OffchainFaultError : T extends "REPLACEMENT_UNDERPRICED" ? ReplacementUnderpricedError : T extends "TRANSACTION_REPLACED" ? TransactionReplacedError : T extends "UNCONFIGURED_NAME" ? UnconfiguredNameError : T extends "ACTION_REJECTED" ? ActionRejectedError : never; -/** - * Returns true if the %%error%% matches an error thrown by corebc - * that matches the error %%code%%. - * - * In TypeScript envornoments, this can be used to check that %%error%% - * matches an corebcError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -export declare function isError>(error: any, code: K): error is T; -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -export declare function isCallException(error: any): error is CallExceptionError; -/** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ -export declare function makeError>(message: string, code: K, info?: ErrorInfo): T; -/** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -export declare function assert>(check: unknown, message: string, code: K, info?: ErrorInfo): asserts check; -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -export declare function assertArgument(check: unknown, message: string, name: string, value: unknown): asserts check; -export declare function assertArgumentCount(count: number, expectedCount: number, message?: string): void; -/** - * Throws if the normalization %%form%% is not supported. - */ -export declare function assertNormalize(form: string): void; -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -export declare function assertPrivate(givenGuard: any, guard: any, className?: string): void; -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/errors.d.ts.map b/lib.commonjs/utils/errors.d.ts.map deleted file mode 100644 index b9eff4781..000000000 --- a/lib.commonjs/utils/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACX,kBAAkB,EAClB,k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C,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,kBAAkB,CAEvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,EAC3E,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,CAAC,EACP,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GACjB,CAAC,CA+CH;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,EACxE,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,CAAC,EACP,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GACjB,OAAO,CAAC,KAAK,CAIf;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACZ,OAAO,CAAC,KAAK,CAEf;AAED,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CA2BN;AA8BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,UAAU,EAAE,GAAG,EACf,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,MAAM,GAChB,IAAI,CAoBN"} \ No newline at end of file diff --git a/lib.commonjs/utils/errors.js b/lib.commonjs/utils/errors.js deleted file mode 100644 index 4511ea4fd..000000000 --- a/lib.commonjs/utils/errors.js +++ /dev/null @@ -1,227 +0,0 @@ -'use strict'; - -var _version = require('../_version.js'); -var properties = require('./properties.js'); - -/** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -function stringify(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[ " + value.map(stringify).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return stringify(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "number": - return value.toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{ " + - keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(", ") + - " }"); - } - } - return `[ COULD NOT SERIALIZE ]`; -} -/** - * Returns true if the %%error%% matches an error thrown by corebc - * that matches the error %%code%%. - * - * In TypeScript envornoments, this can be used to check that %%error%% - * matches an corebcError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -function isError(error, code) { - return error && error.code === code; -} -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); -} -/** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ -function makeError(message, code, info) { - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify(info)}`); - } - for (const key in info) { - const value = info[key]; - // try { - details.push(key + "=" + stringify(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${_version.version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - properties.defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - return error; -} -/** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } -} -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} -function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing arguemnt" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); - assert(count <= expectedCount, "too many arguemnts" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); -} -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; -}, []); -/** - * Throws if the normalization %%form%% is not supported. - */ -function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", - info: { form }, - }); -} -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation, - }); - } -} - -exports.assert = assert; -exports.assertArgument = assertArgument; -exports.assertArgumentCount = assertArgumentCount; -exports.assertNormalize = assertNormalize; -exports.assertPrivate = assertPrivate; -exports.isCallException = isCallException; -exports.isError = isError; -exports.makeError = makeError; -//# sourceMappingURL=errors.js.map diff --git a/lib.commonjs/utils/errors.js.map b/lib.commonjs/utils/errors.js.map deleted file mode 100644 index 8e7fb6035..000000000 --- a/lib.commonjs/utils/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sources":["../../lib.esm/utils/errors.js"],"sourcesContent":["/**\n * About Errors.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + value.map(stringify).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof value === \"object\" && typeof value.toJSON === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof value) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return value.toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return (\"{ \" +\n keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") +\n \" }\");\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by corebc\n * that matches the error %%code%%.\n *\n * In TypeScript envornoments, this can be used to check that %%error%%\n * matches an corebcError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return error && error.code === code;\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format corebc emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties\n * for the corresponding corebcError.\n *\n * Each error in corebc includes the version of corebc, a\n * machine-readable [[ErrorCode]], and depneding on %%code%%, additional\n * required properties. The error message will also include the %%meeage%%,\n * corebc version, %%code%% and all aditional properties, serialized.\n */\nexport function makeError(message, code, info) {\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n const value = info[key];\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n return error;\n}\n/**\n * Throws an corebcError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing arguemnt\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n assert(count <= expectedCount, \"too many arguemnts\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount,\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\",\n info: { form },\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation,\n });\n }\n}\n//# sourceMappingURL=errors.js.map"],"names":["version","defineProperties"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AAGA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,IAAI,KAAK,IAAI,IAAI,EAAE;AACvB,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AAC9B,QAAQ,OAAO,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI;AAC5D,IAAI;AACJ,IAAI,IAAI,KAAK,YAAY,UAAU,EAAE;AACrC,QAAQ,MAAM,GAAG,GAAG,kBAAkB;AACtC,QAAQ,IAAI,MAAM,GAAG,IAAI;AACzB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,YAAY,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACxC,YAAY,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AACzC,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,EAAE;AACzE,QAAQ,OAAO,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;AACxC,IAAI;AACJ,IAAI,QAAQ,OAAO,KAAK;AACxB,QAAQ,KAAK,SAAS;AACtB,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAO,KAAK,CAAC,QAAQ,EAAE;AACnC,QAAQ,KAAK,QAAQ;AACrB,YAAY,OAAO,MAAM,C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,QAAQ,MAAM,CAAC,KAAK,EAAE,CAAC,yBAAyB,EAAE,MAAM,CAAC,aAAa,CAAC,EAAE,uBAAuB,EAAE;AAClG,YAAY,SAAS;AACrB,SAAS,CAAC;AACV,IAAI;AACJ;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/events.d.ts b/lib.commonjs/utils/events.d.ts deleted file mode 100644 index 5da088923..000000000 --- a/lib.commonjs/utils/events.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * A callback function called when a an event is triggered. - */ -export type Listener = (...args: Array) => void; -/** - * An **EventEmitterable** behaves similar to an EventEmitter - * except provides async access to its methods. - * - * An EventEmitter implements the observer pattern. - */ -export interface EventEmitterable { - /** - * Registers a %%listener%% that is called whenever the - * %%event%% occurs until unregistered. - */ - on(event: T, listener: Listener): Promise; - /** - * Registers a %%listener%% that is called the next time - * %%event%% occurs. - */ - once(event: T, listener: Listener): Promise; - /** - * Triggers each listener for %%event%% with the %%args%%. - */ - emit(event: T, ...args: Array): Promise; - /** - * Resolves to the number of listeners for %%event%%. - */ - listenerCount(event?: T): Promise; - /** - * Resolves to the listeners for %%event%%. - */ - listeners(event?: T): Promise>; - /** - * Unregister the %%listener%% for %%event%%. If %%listener%% - * is unspecified, all listeners are unregistered. - */ - off(event: T, listener?: Listener): Promise; - /** - * Unregister all listeners for %%event%%. - */ - removeAllListeners(event?: T): Promise; - /** - * Alias for [[on]]. - */ - addListener(event: T, listener: Listener): Promise; - /** - * Alias for [[off]]. - */ - removeListener(event: T, listener: Listener): Promise; -} -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -export declare class EventPayload { - #private; - /** - * The event filter. - */ - readonly filter: T; - /** - * The **EventEmitterable**. - */ - readonly emitter: EventEmitterable; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter: EventEmitterable, listener: null | Listener, filter: T); - /** - * Unregister the triggered listener for future events. - */ - removeListener(): Promise; -} -//# sourceMappingURL=events.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/events.d.ts.map b/lib.commonjs/utils/events.d.ts.map deleted file mode 100644 index 140670f11..000000000 --- a/lib.commonjs/utils/events.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAClC;;;OAGG;IACH,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtD;;OAEG;IACH,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,qBAAa,YAAY,CAAC,CAAC;;IAC1B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,CAAC,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAIvC;;;OAGG;IACH,YACC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC5B,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,CAAC,EAIT;IAED;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/utils/events.js b/lib.commonjs/utils/events.js deleted file mode 100644 index fd70774f2..000000000 --- a/lib.commonjs/utils/events.js +++ /dev/null @@ -1,45 +0,0 @@ -'use strict'; - -var properties = require('./properties.js'); - -/** - * Explain events... - * - * @_section api/utils/events:Events [about-events] - */ -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -class EventPayload { - /** - * The event filter. - */ - filter; - /** - * The **EventEmitterable**. - */ - emitter; - #listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter, listener, filter) { - this.#listener = listener; - properties.defineProperties(this, { emitter, filter }); - } - /** - * Unregister the triggered listener for future events. - */ - async removeListener() { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } -} - -exports.EventPayload = EventPayload; -//# sourceMappingURL=events.js.map diff --git a/lib.commonjs/utils/events.js.map b/lib.commonjs/utils/events.js.map deleted file mode 100644 index 8a2cc35f0..000000000 --- a/lib.commonjs/utils/events.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.js","sources":["../../lib.esm/utils/events.js"],"sourcesContent":["/**\n * Explain events...\n *\n * @_section api/utils/events:Events [about-events]\n */\nimport { defineProperties } from \"./properties.js\";\n/**\n * When an [[EventEmitterable]] triggers a [[Listener]], the\n * callback always ahas one additional argument passed, which is\n * an **EventPayload**.\n */\nexport class EventPayload {\n /**\n * The event filter.\n */\n filter;\n /**\n * The **EventEmitterable**.\n */\n emitter;\n #listener;\n /**\n * Create a new **EventPayload** for %%emitter%% with\n * the %%listener%% and for %%filter%%.\n */\n constructor(emitter, listener, filter) {\n this.#listener = listener;\n defineProperties(this, { emitter, filter });\n }\n /**\n * Unregister the triggered listener for future events.\n */\n async removeListener() {\n if (this.#listener == null) {\n return;\n }\n await this.emitter.off(this.filter, this.#listener);\n }\n}\n//# sourceMappingURL=events.js.map"],"names":["defineProperties"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,CAAC;AAC1B;AACA;AACA;AACA,IAAI,MAAM;AACV;AACA;AACA;AACA,IAAI,OAAO;AACX,IAAI,SAAS;AACb;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC3C,QAAQ,IAAI,CAAC,SAAS,GAAG,QAAQ;AACjC,QAAQA,2BAAgB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AACnD,IAAI;AACJ;AACA;AACA;AACA,IAAI,MAAM,cAAc,GAAG;AAC3B,QAAQ,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE;AACpC,YAAY;AACZ,QAAQ;AACR,QAAQ,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC;AAC3D,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/fetch.d.ts b/lib.commonjs/utils/fetch.d.ts deleted file mode 100644 index 7d226ccc0..000000000 --- a/lib.commonjs/utils/fetch.d.ts +++ /dev/null @@ -1,327 +0,0 @@ -export type GetUrlResponse = { - statusCode: number; - statusMessage: string; - headers: Record; - body: null | Uint8Array; -}; -export type FetchThrottleParams = { - maxAttempts?: number; - slotInterval?: number; -}; -/** - * Called before any network request, allowing updated headers (e.g. Bearer tokens), etc. - */ -export type FetchPreflightFunc = (req: FetchRequest) => Promise; -/** - * Called on the response, allowing client-based throttling logic or post-processing. - */ -export type FetchProcessFunc = (req: FetchRequest, resp: FetchResponse) => Promise; -/** - * Called prior to each retry; return true to retry, false to abort. - */ -export type FetchRetryFunc = (req: FetchRequest, resp: FetchResponse, attempt: number) => Promise; -/** - * Called on Gateway URLs. - */ -export type FetchGatewayFunc = (url: string, signal?: FetchCancelSignal) => Promise; -/** - * Used to perform a fetch; use this to override the underlying network - * fetch layer. In NodeJS, the default uses the "http" and "https" libraries - * and in the browser ``fetch`` is used. If you wish to use Axios, this is - * how you would register it. - */ -export type FetchGetUrlFunc = (req: FetchRequest, signal?: FetchCancelSignal) => Promise; -/** - * @_ignore - */ -export declare class FetchCancelSignal { - #private; - constructor(request: FetchRequest); - addListener(listener: () => void): void; - get cancelled(): boolean; - checkSignal(): void; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -export declare class FetchRequest implements Iterable<[key: string, value: string]> { - #private; - /** - * The fetch URI to requrest. - */ - get url(): string; - set url(url: string); - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . - * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrincis ``Content-Type`` is - * set to ``application/json``. - */ - get body(): null | Uint8Array; - set body(body: null | string | Readonly | Readonly); - /** - * Returns true if the request has a body. - */ - hasBody(): this is FetchRequest & { - body: Uint8Array; - }; - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method(): string; - set method(method: null | string); - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any chnages will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers(): Record; - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key: string, value: string | number): void; - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders(): void; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials(): null | string; - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username: string, password: string): void; - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip(): boolean; - set allowGzip(value: boolean); - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication(): boolean; - set allowInsecureAuthentication(value: boolean); - /** - * The timeout (in milliseconds) to wait for a complere response. - * //(default: 5 minutes)// - */ - get timeout(): number; - set timeout(timeout: number); - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc(): null | FetchPreflightFunc; - set preflightFunc(preflight: null | FetchPreflightFunc); - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc(): null | FetchProcessFunc; - set processFunc(process: null | FetchProcessFunc); - /** - * This function is called on each retry attempt. - */ - get retryFunc(): null | FetchRetryFunc; - set retryFunc(retry: null | FetchRetryFunc); - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url: string); - toString(): string; - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params: FetchThrottleParams): void; - /** - * Resolves to the response by sending the request. - */ - send(): Promise; - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel(): void; - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location: string): FetchRequest; - /** - * Create a new copy of this request. - */ - clone(): FetchRequest; - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig(): void; - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme: string): null | FetchGatewayFunc; - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme: string, func: FetchGatewayFunc): void; - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl: FetchGetUrlFunc): void; - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway(): FetchGatewayFunc; - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc; -} -/** - * The response for a FetchREquest. - */ -export declare class FetchResponse implements Iterable<[key: string, value: string]> { - #private; - toString(): string; - /** - * The response status code. - */ - get statusCode(): number; - /** - * The response status message. - */ - get statusMessage(): string; - /** - * The response headers. All keys are lower-case. - */ - get headers(): Record; - /** - * The response body, or ``null`` if there was no body. - */ - get body(): null | Readonly; - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText(): string; - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson(): any; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - constructor(statusCode: number, statusMessage: string, headers: Readonly>, body: null | Uint8Array, request?: FetchRequest); - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message?: string, error?: Error): FetchResponse; - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message?: string, stall?: number): never; - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Returns true of the response has a body. - */ - hasBody(): this is FetchResponse & { - body: Uint8Array; - }; - /** - * The request made for this response. - */ - get request(): null | FetchRequest; - /** - * Returns true if this response was a success statusCode. - */ - ok(): boolean; - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk(): void; -} -//# sourceMappingURL=fetch.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/fetch.d.ts.map b/lib.commonjs/utils/fetch.d.ts.map deleted file mode 100644 index 59bbdc142..000000000 --- a/lib.commonjs/utils/fetch.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AAaA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OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAiB1D;IAED;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7B;IAED;;OAEG;IACH,OAAO,IAAI,IAAI,IAAI,aAAa,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAEtD;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,IAAI,GAAG,YAAY,CAEjC;IAED;;OAEG;IACH,EAAE,IAAI,OAAO,CAMZ;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAaf;CACD"} \ No newline at end of file diff --git a/lib.commonjs/utils/fetch.js b/lib.commonjs/utils/fetch.js deleted file mode 100644 index dffad454b..000000000 --- a/lib.commonjs/utils/fetch.js +++ /dev/null @@ -1,832 +0,0 @@ -'use strict'; - -var base64 = require('./base64.js'); -var data = require('./data.js'); -var errors = require('./errors.js'); -var properties = require('./properties.js'); -var utf8 = require('./utf8.js'); -var geturl = require('./geturl.js'); - -/** - * Explain fetching here... - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ -const MAX_ATTEMPTS = 12; -const SLOT_INTERVAL = 250; -// The global FetchGetUrlFunc implementation. -let getUrlFunc = geturl.getUrl; -const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); -const reIpfs = new RegExp("^ipfs://(ipfs/)?(.*)$", "i"); -// If locked, new Gateways cannot be added -let locked = false; -// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs -async function dataGatewayFunc(url, signal) { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse(200, "OK", { - "content-type": match[1] || "text/plain", - }, match[2] ? base64.decodeBase64(match[3]) : unpercent(match[3])); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); - } -} -/** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ -function getIpfsGatewayFunc(baseUrl) { - async function gatewayIpfs(url, signal) { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); - } - } - return gatewayIpfs; -} -const Gateways = { - data: dataGatewayFunc, - ipfs: getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/"), -}; -const fetchSignals = new WeakMap(); -/** - * @_ignore - */ -class FetchCancelSignal { - #listeners; - #cancelled; - constructor(request) { - this.#listeners = []; - this.#cancelled = false; - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - for (const listener of this.#listeners) { - setTimeout(() => { - listener(); - }, 0); - } - this.#listeners = []; - }); - } - addListener(listener) { - errors.assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener", - }); - this.#listeners.push(listener); - } - get cancelled() { - return this.#cancelled; - } - checkSignal() { - errors.assert(!this.cancelled, "cancelled", "CANCELLED", {}); - } -} -// Check the signal, throwing if it is cancelled -function checkSignal(signal) { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -class FetchRequest { - #allowInsecure; - #gzip; - #headers; - #method; - #timeout; - #url; - #body; - #bodyType; - #creds; - // Hooks - #preflight; - #process; - #retry; - #signal; - #throttle; - /** - * The fetch URI to requrest. - */ - get url() { - return this.#url; - } - set url(url) { - this.#url = String(url); - } - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . - * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrincis ``Content-Type`` is - * set to ``application/json``. - */ - get body() { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } - else if (typeof body === "string") { - this.#body = utf8.toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } - else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } - else if (typeof body === "object") { - this.#body = utf8.toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } - else { - throw new Error("invalid body"); - } - } - /** - * Returns true if the request has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method() { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any chnages will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers() { - const headers = Object.assign({}, this.#headers); - if (this.#creds) { - headers["authorization"] = `Basic ${base64.encodeBase64(utf8.toUtf8Bytes(this.#creds))}`; - } - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - return headers; - } - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key, value) { - this.#headers[String(key).toLowerCase()] = String(value); - } - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders() { - this.#headers = {}; - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials() { - return this.#creds || null; - } - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username, password) { - errors.assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${username}:${password}`; - } - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip() { - return this.#gzip; - } - set allowGzip(value) { - this.#gzip = !!value; - } - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication() { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value) { - this.#allowInsecure = !!value; - } - /** - * The timeout (in milliseconds) to wait for a complere response. - * //(default: 5 minutes)// - */ - get timeout() { - return this.#timeout; - } - set timeout(timeout) { - errors.assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc() { - return this.#preflight || null; - } - set preflightFunc(preflight) { - this.#preflight = preflight; - } - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc() { - return this.#process || null; - } - set processFunc(process) { - this.#process = process; - } - /** - * This function is called on each retry attempt. - */ - get retryFunc() { - return this.#retry || null; - } - set retryFunc(retry) { - this.#retry = retry; - } - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url) { - this.#url = String(url); - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS, - }; - } - toString() { - return ``; - } - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params) { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - async #send(attempt, expires, delay, _request, _response) { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - errors.assert(getTime() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", - reason: "timeout", - request: _request, - }); - if (delay > 0) { - await wait(delay); - } - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Ignore throttling - } - } - return response; - } - req = result; - } - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - const resp = await getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req - .redirect(location) - .#send(attempt + 1, expires, 0, _request, response); - } - catch (error) { } - // Things won't get any better on another attempt; abort - return response; - } - else if (response.statusCode === 429) { - // Throttle - if (this.retryFunc == null || - (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof retryAfter === "string" && - retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Throttle - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (error.stall >= 0) { - delay = error.stall; - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - return response; - } - /** - * Resolves to the response by sending the request. - */ - send() { - errors.assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); - } - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel() { - errors.assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location) { - // Redirection; for now we only support absolute locataions - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - errors.assert(this.method === "GET" && - (current !== "https" || target !== "http") && - location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`, - }); - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - return req; - } - /** - * Create a new copy of this request. - */ - clone() { - const clone = new FetchRequest(this.url); - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - if (this.allowGzip) { - clone.allowGzip = true; - } - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - return clone; - } - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig() { - locked = true; - } - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme) { - return Gateways[scheme.toLowerCase()] || null; - } - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme, func) { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl) { - if (locked) { - throw new Error("gateways locked"); - } - getUrlFunc = getUrl; - } - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway() { - return dataGatewayFunc; - } - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl) { - return getIpfsGatewayFunc(baseUrl); - } -} -/** - * The response for a FetchREquest. - */ -class FetchResponse { - #statusCode; - #statusMessage; - #headers; - #body; - #request; - #error; - toString() { - return ``; - } - /** - * The response status code. - */ - get statusCode() { - return this.#statusCode; - } - /** - * The response status message. - */ - get statusMessage() { - return this.#statusMessage; - } - /** - * The response headers. All keys are lower-case. - */ - get headers() { - return Object.assign({}, this.#headers); - } - /** - * The response body, or ``null`` if there was no body. - */ - get body() { - return this.#body == null ? null : new Uint8Array(this.#body); - } - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText() { - try { - return this.#body == null ? "" : utf8.toUtf8String(this.#body); - } - catch (error) { - errors.assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", - info: { response: this }, - }); - } - } - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson() { - try { - return JSON.parse(this.bodyText); - } - catch (error) { - errors.assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", - info: { response: this }, - }); - } - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - constructor(statusCode, statusMessage, headers, body, request) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, {}); - this.#body = body == null ? null : new Uint8Array(body); - this.#request = request || null; - this.#error = { message: "" }; - } - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message, error) { - let statusMessage; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } - else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message, stall) { - if (stall == null) { - stall = -1; - } - else { - errors.assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - const error = new Error(message || "throttling requests"); - properties.defineProperties(error, { stall, throttle: true }); - throw error; - } - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Returns true of the response has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The request made for this response. - */ - get request() { - return this.#request; - } - /** - * Returns true if this response was a success statusCode. - */ - ok() { - return (this.#error.message === "" && - this.statusCode >= 200 && - this.statusCode < 300); - } - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk() { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - errors.assert(false, message, "SERVER_ERROR", { - request: this.request || "unknown request", - response: this, - error, - }); - } -} -function getTime() { - return new Date().getTime(); -} -function unpercent(value) { - return utf8.toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); -} -function wait(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); -} - -exports.FetchCancelSignal = FetchCancelSignal; -exports.FetchRequest = FetchRequest; -exports.FetchResponse = FetchResponse; -//# sourceMappingURL=fetch.js.map diff --git a/lib.commonjs/utils/fetch.js.map b/lib.commonjs/utils/fetch.js.map deleted file mode 100644 index 6704ea6b4..000000000 --- a/lib.commonjs/utils/fetch.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fetch.js","sources":["../../lib.esm/utils/fetch.js"],"sourcesContent":["/**\n * Explain fetching here...\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 { getUrl } from \"./geturl.js\";\nconst MAX_ATTEMPTS = 12;\nconst SLOT_INTERVAL = 250;\n// The global FetchGetUrlFunc implementation.\nlet getUrlFunc = getUrl;\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(() => {\n listener();\n }, 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() {\n return this.#cancelled;\n }\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 /**\n * The fetch URI to requrest.\n */\n get url() {\n return this.#url;\n }\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``) and the .\n *\n * If %%body%% is a string, the intrincis ``Content-Type`` is set to\n * ``text/plain``.\n *\n * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to\n * ``application/octet-stream``.\n *\n * If %%body%% is any other object, the intrincis ``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 chnages 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 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]],\n 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 complere response.\n * //(default: 5 minutes)//\n */\n get timeout() {\n return this.#timeout;\n }\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 * 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 }\n toString() {\n return ``;\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\",\n reason: \"timeout\",\n 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\n .makeServerError(\"error in post-processing function\", error)\n .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 getUrlFunc(req, checkSignal(_request.#signal));\n let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request);\n if (response.statusCode === 301 || response.statusCode === 302) {\n // Redirect\n try {\n const location = response.headers.location || \"\";\n return req\n .redirect(location)\n .#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 ||\n (await this.retryFunc(req, response, attempt))) {\n const retryAfter = response.headers[\"retry-after\"];\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (typeof retryAfter === \"string\" &&\n retryAfter.match(/^[1-9][0-9]*$/)) {\n delay = parseInt(retryAfter);\n }\n return req\n .clone()\n .#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\n .makeServerError(\"error in post-processing function\", error)\n .assertOk();\n }\n // Throttle\n let delay = this.#throttle.slotInterval *\n Math.trunc(Math.random() * Math.pow(2, attempt));\n if (error.stall >= 0) {\n delay = error.stall;\n }\n return req\n .clone()\n .#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 locataions\n const current = this.url.split(\":\")[0].toLowerCase();\n const target = location.split(\":\")[0].toLowerCase();\n // Don't allow redirecting:\n // - non-GET requests\n // - downgrading the security (e.g. https => http)\n // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?]\n assert(this.method === \"GET\" &&\n (current !== \"https\" || target !== \"http\") &&\n 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 = \"GET\";\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 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 getUrlFunc = getUrl;\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 * 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 ``;\n }\n /**\n * The response status code.\n */\n get statusCode() {\n return this.#statusCode;\n }\n /**\n * The response status message.\n */\n get statusMessage() {\n return this.#statusMessage;\n }\n /**\n * The response headers. All keys are lower-case.\n */\n get headers() {\n return Object.assign({}, this.#headers);\n }\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\",\n 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\",\n 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]],\n 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 of 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() {\n return this.#request;\n }\n /**\n * Returns true if this response was a success statusCode.\n */\n ok() {\n return (this.#error.message === \"\" &&\n this.statusCode >= 200 &&\n 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 assert(false, message, \"SERVER_ERROR\", {\n request: this.request || \"unknown request\",\n response: this,\n error,\n });\n }\n}\nfunction getTime() {\n return new Date().getTime();\n}\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"],"names":["getUrl","decodeBase64","assert","toUtf8Bytes","encodeBase64","assertArgument","hexlify","toUtf8String","defineProperties"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAOA,MAAM,YAAY,GAAG,EAAE;AACvB,MAAM,aAAa,GAAG,GAAG;AACzB;AACA,IAAI,UAAU,GAAGA,aAAM;AACvB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,iCAAiC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K,EAAE,EAAE;AAC5B,YAAY,OAAO,GAAG,CAAC,gBAAgB,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;AAChF,QAAQ;AACR,QAAQN,aAAM,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE;AAC/C,YAAY,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,iBAAiB;AACtD,YAAY,QAAQ,EAAE,IAAI;AAC1B,YAAY,KAAK;AACjB,SAAS,CAAC;AACV,IAAI;AACJ;AACA,SAAS,OAAO,GAAG;AACnB,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;AAC/B;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,OAAOC,gBAAW,CAAC,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK;AAC7E,QAAQ,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACtD,IAAI,CAAC,CAAC,CAAC;AACP;AACA,SAAS,IAAI,CAAC,KAAK,EAAE;AACrB,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC/D;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/fixednumber.d.ts b/lib.commonjs/utils/fixednumber.d.ts deleted file mode 100644 index c8a28f158..000000000 --- a/lib.commonjs/utils/fixednumber.d.ts +++ /dev/null @@ -1,252 +0,0 @@ -import type { BigNumberish, BytesLike } from "./index.js"; -/** - * A description of a fixed-point arithmetic field. - * - * When specifying the fixed format, the values override the default of - * a ``fixed128x18``, which implies a signed 128-bit value with 18 - * decimals of precision. - * - * The alias ``fixed`` and ``ufixed`` can be used for ``fixed128x18`` and - * ``ufixed128x18`` respectively. - * - * When a fixed format string begins with a ``u``, it indicates the field - * is unsigned, so any negative values will overflow. The first number - * indicates the bit-width and the second number indicates the decimal - * precision. - * - * When a ``number`` is used for a fixed format, it indicates the number - * of decimal places, and the default width and signed-ness will be used. - * - * The bit-width must be byte aligned and the decimals can be at most 80. - */ -export type FixedFormat = number | string | { - signed?: boolean; - width?: number; - decimals?: number; -}; -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, an value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -export declare class FixedNumber { - #private; - /** - * The specific fixed-point arithmetic field for this value. - */ - readonly format: string; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - readonly _value: string; - /** - * @private - */ - constructor(guard: any, value: bigint, format: any); - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed(): boolean; - /** - * The number of bits available to store the value. - */ - get width(): number; - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals(): number; - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value(): bigint; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other: FixedNumber): FixedNumber; - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%other%% is larger and ``0`` implies - * both are equal. - */ - cmp(other: FixedNumber): number; - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other: FixedNumber): boolean; - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor(): FixedNumber; - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling(): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals?: number): FixedNumber; - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero(): boolean; - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative(): boolean; - /** - * Returns the string representation of %%this%%. - */ - toString(): string; - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat(): number; - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value: BigNumberish, decimals?: number, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value: string, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value: BytesLike, _format?: FixedFormat): FixedNumber; -} -//# sourceMappingURL=fixednumber.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/fixednumber.d.ts.map b/lib.commonjs/utils/fixednumber.d.ts.map deleted file mode 100644 index 0acb110cb..000000000 --- a/lib.commonjs/utils/fixednumber.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4C1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,WAAW,GACpB,MAAM,GACN,MAAM,GACN;IACA,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAoJL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,WAAW;;IACvB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAUzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAMzB;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAYjD;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;OAGG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IA2CD;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAEzC;IAED;;;;OAIG;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,UAAU,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,QAAQ,IAAI,MAAM,CAEjB;IAED;;;;;;OAMG;IACH,aAAa,IAAI,MAAM,CAEtB;IAED;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAEzC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,CACf,MAAM,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,WAAW,GACnB,WAAW,CA4Bb;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAuCpE;IAED;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAWtE;CACD"} \ No newline at end of file diff --git a/lib.commonjs/utils/fixednumber.js b/lib.commonjs/utils/fixednumber.js deleted file mode 100644 index e74e6dfd9..000000000 --- a/lib.commonjs/utils/fixednumber.js +++ /dev/null @@ -1,581 +0,0 @@ -'use strict'; - -var data = require('./data.js'); -var errors = require('./errors.js'); -var maths = require('./maths.js'); -var properties = require('./properties.js'); - -var _a; -const BN_N1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_5 = BigInt(5); -const _guard = {}; -// Constant to pull zeros from for multipliers -let Zeros = "0000"; -while (Zeros.length < 80) { - Zeros += Zeros; -} -// Returns a string "1" followed by decimal "0"s -function getTens(decimals) { - let result = Zeros; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); -} -function checkValue(val, format, safeOp) { - const width = BigInt(format.width); - if (format.signed) { - const limit = BN_1 << (width - BN_1); - errors.assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - if (val > BN_0) { - val = maths.fromTwos(maths.mask(val, width), width); - } - else { - val = -maths.fromTwos(maths.mask(-val, width), width); - } - } - else { - const limit = BN_1 << width; - errors.assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - val = (((val % limit) + limit) % limit) & (limit - BN_1); - } - return val; -} -function getFormat(value) { - if (typeof value === "number") { - value = `fixed128x${value}`; - } - let signed = true; - let width = 128; - let decimals = 18; - if (typeof value === "string") { - // Parse the format string - if (value === "fixed") ; - else if (value === "ufixed") { - signed = false; - } - else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - errors.assertArgument(match, "invalid fixed format", "format", value); - signed = match[1] !== "u"; - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } - else if (value) { - // Extract the values from the object - const v = value; - const check = (key, type, defaultValue) => { - if (v[key] == null) { - return defaultValue; - } - errors.assertArgument(typeof v[key] === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - errors.assertArgument(width % 8 === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - errors.assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - return { signed, width, decimals, name }; -} -function toString(val, decimals) { - let negative = ""; - if (val < BN_0) { - negative = "-"; - val *= BN_N1; - } - let str = val.toString(); - // No decimal point for whole values - if (decimals === 0) { - return negative + str; - } - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros + str; - } - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - return negative + str; -} -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, an value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - format; - #format; - // The actual value (accounting for decimals) - #val; - // A base-10 value to multiple values by to maintain the magnitude - #tens; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - _value; - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - /** - * @private - */ - constructor(guard, value, format) { - errors.assertPrivate(guard, _guard, "FixedNumber"); - this.#val = value; - this.#format = format; - const _value = toString(value, format.decimals); - properties.defineProperties(this, { format: format.name, _value }); - this.#tens = getTens(format.decimals); - } - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed() { - return this.#format.signed; - } - /** - * The number of bits available to store the value. - */ - get width() { - return this.#format.width; - } - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals() { - return this.#format.decimals; - } - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value() { - return this.#val; - } - #checkFormat(other) { - errors.assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); - } - #checkValue(val, safeOp) { - /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } -*/ - val = checkValue(val, this.#format, safeOp); - return new _a(_guard, val, this.#format); - } - #add(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other) { - return this.#add(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other) { - return this.#add(other, "add"); - } - #sub(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other) { - return this.#sub(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other) { - return this.#sub(other, "sub"); - } - #mul(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other) { - return this.#mul(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other) { - return this.#mul(other, "mul"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other) { - this.#checkFormat(other); - const value = this.#val * other.#val; - errors.assert(value % this.#tens === BN_0, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - #div(o, safeOp) { - errors.assert(o.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other) { - return this.#div(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other) { - return this.#div(other, "div"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other) { - errors.assert(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(other); - const value = this.#val * this.#tens; - errors.assert(value % other.#val === BN_0, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%other%% is larger and ``0`` implies - * both are equal. - */ - cmp(other) { - let a = this.value, b = other.value; - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } - else if (delta < 0) { - a *= getTens(-delta); - } - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return -1; - } - return 0; - } - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other) { - return this.cmp(other) === 0; - } - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other) { - return this.cmp(other) < 0; - } - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other) { - return this.cmp(other) <= 0; - } - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other) { - return this.cmp(other) > 0; - } - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other) { - return this.cmp(other) >= 0; - } - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor() { - let val = this.#val; - if (this.#val < BN_0) { - val -= this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling() { - let val = this.#val; - if (this.#val > BN_0) { - val += this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals) { - if (decimals == null) { - decimals = 0; - } - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - checkValue(value, this.#format, "round"); - return new _a(_guard, value, this.#format); - } - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero() { - return this.#val === BN_0; - } - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative() { - return this.#val < BN_0; - } - /** - * Returns the string representation of %%this%%. - */ - toString() { - return this._value; - } - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat() { - return parseFloat(this.toString()); - } - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format) { - return _a.fromString(this.toString(), format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value, decimals, _format) { - if (decimals == null) { - decimals = 0; - } - const format = getFormat(_format); - let value = maths.getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - errors.assert(value % tens === BN_0, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", - fault: "underflow", - value: _value, - }); - value /= tens; - } - else if (delta < 0) { - value *= getTens(-delta); - } - checkValue(value, format, "fromValue"); - return new _a(_guard, value, format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value, _format) { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - errors.assertArgument(match && match[2].length + match[3].length > 0, "invalid FixedNumber string value", "value", _value); - const format = getFormat(_format); - let whole = match[2] || "0", decimal = match[3] || ""; - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros; - } - // Check precision is safe - errors.assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", - fault: "underflow", - value: _value, - }); - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - const value = BigInt(match[1] + whole + decimal); - checkValue(value, format, "fromString"); - return new _a(_guard, value, format); - } - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value, _format) { - let value = maths.toBigInt(data.getBytes(_value, "value")); - const format = getFormat(_format); - if (format.signed) { - value = maths.fromTwos(value, format.width); - } - checkValue(value, format, "fromBytes"); - return new _a(_guard, value, format); - } -} -_a = FixedNumber; -//const f1 = FixedNumber.fromString("12.56", "fixed16x2"); -//const f2 = FixedNumber.fromString("0.3", "fixed16x2"); -//console.log(f1.divSignal(f2)); -//const BUMP = FixedNumber.from("0.5"); - -exports.FixedNumber = FixedNumber; -//# sourceMappingURL=fixednumber.js.map diff --git a/lib.commonjs/utils/fixednumber.js.map b/lib.commonjs/utils/fixednumber.js.map deleted file mode 100644 index f9cc02319..000000000 --- a/lib.commonjs/utils/fixednumber.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixednumber.js","sources":["../../lib.esm/utils/fixednumber.js"],"sourcesContent":["var _a;\n/**\n * About fixed-point math...\n *\n * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math]\n */\nimport { getBytes } from \"./data.js\";\nimport { assert, assertArgument, assertPrivate } from \"./errors.js\";\nimport { getBigInt, fromTwos, mask, toBigInt } from \"./maths.js\";\nimport { defineProperties } from \"./properties.js\";\nconst BN_N1 = BigInt(-1);\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\nconst BN_5 = BigInt(5);\nconst _guard = {};\n// Constant to pull zeros from for multipliers\nlet Zeros = \"0000\";\nwhile (Zeros.length < 80) {\n Zeros += Zeros;\n}\n// Returns a string \"1\" followed by decimal \"0\"s\nfunction getTens(decimals) {\n let result = Zeros;\n while (result.length < decimals) {\n result += result;\n }\n return BigInt(\"1\" + result.substring(0, decimals));\n}\nfunction checkValue(val, format, safeOp) {\n const width = BigInt(format.width);\n if (format.signed) {\n const limit = BN_1 << (width - BN_1);\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n }\n else {\n val = -fromTwos(mask(-val, width), width);\n }\n }\n else {\n const limit = BN_1 << width;\n assert(safeOp == null || (val >= 0 && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp,\n fault: \"overflow\",\n value: val,\n });\n val = (((val % limit) + limit) % limit) & (limit - BN_1);\n }\n return val;\n}\nfunction getFormat(value) {\n if (typeof value === \"number\") {\n value = `fixed128x${value}`;\n }\n let signed = true;\n let width = 128;\n let decimals = 18;\n if (typeof value === \"string\") {\n // Parse the format string\n if (value === \"fixed\") {\n // defaults...\n }\n else if (value === \"ufixed\") {\n signed = false;\n }\n else {\n const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);\n assertArgument(match, \"invalid fixed format\", \"format\", value);\n signed = match[1] !== \"u\";\n width = parseInt(match[2]);\n decimals = parseInt(match[3]);\n }\n }\n else if (value) {\n // Extract the values from the object\n const v = value;\n const check = (key, type, defaultValue) => {\n if (v[key] == null) {\n return defaultValue;\n }\n assertArgument(typeof v[key] === type, \"invalid fixed format (\" + key + \" not \" + type + \")\", \"format.\" + key, v[key]);\n return v[key];\n };\n signed = check(\"signed\", \"boolean\", signed);\n width = check(\"width\", \"number\", width);\n decimals = check(\"decimals\", \"number\", decimals);\n }\n assertArgument(width % 8 === 0, \"invalid FixedNumber width (not byte aligned)\", \"format.width\", width);\n assertArgument(decimals <= 80, \"invalid FixedNumber decimals (too large)\", \"format.decimals\", decimals);\n const name = (signed ? \"\" : \"u\") + \"fixed\" + String(width) + \"x\" + String(decimals);\n return { signed, width, decimals, name };\n}\nfunction toString(val, decimals) {\n let negative = \"\";\n if (val < BN_0) {\n negative = \"-\";\n val *= BN_N1;\n }\n let str = val.toString();\n // No decimal point for whole values\n if (decimals === 0) {\n return negative + str;\n }\n // Pad out to the whole component (including a whole digit)\n while (str.length <= decimals) {\n str = Zeros + str;\n }\n // Insert the decimal point\n const index = str.length - decimals;\n str = str.substring(0, index) + \".\" + str.substring(index);\n // Trim the whole component (leaving at least one 0)\n while (str[0] === \"0\" && str[1] !== \".\") {\n str = str.substring(1);\n }\n // Trim the decimal component (leaving at least one 0)\n while (str[str.length - 1] === \"0\" && str[str.length - 2] !== \".\") {\n str = str.substring(0, str.length - 1);\n }\n return negative + str;\n}\n/**\n * A FixedNumber represents a value over its [[FixedFormat]]\n * arithmetic field.\n *\n * A FixedNumber can be used to perform math, losslessly, on\n * values which have decmial places.\n *\n * A FixedNumber has a fixed bit-width to store values in, and stores all\n * values internally by multiplying the value by 10 raised to the power of\n * %%decimals%%.\n *\n * If operations are performed that cause a value to grow too high (close to\n * positive infinity) or too low (close to negative infinity), the value\n * is said to //overflow//.\n *\n * For example, an 8-bit signed value, with 0 decimals may only be within\n * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become\n * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``.\n *\n * Many operation have a normal and //unsafe// variant. The normal variant\n * will throw a [[NumericFaultError]] on any overflow, while the //unsafe//\n * variant will silently allow overflow, corrupting its value value.\n *\n * If operations are performed that cause a value to become too small\n * (close to zero), the value loses precison and is said to //underflow//.\n *\n * For example, an value with 1 decimal place may store a number as small\n * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit\n * into 1 decimal place, so underflow occurs which means precision is lost\n * and the value becomes ``0``.\n *\n * Some operations have a normal and //signalling// variant. The normal\n * variant will silently ignore underflow, while the //signalling// variant\n * will thow a [[NumericFaultError]] on underflow.\n */\nexport class FixedNumber {\n /**\n * The specific fixed-point arithmetic field for this value.\n */\n format;\n #format;\n // The actual value (accounting for decimals)\n #val;\n // A base-10 value to multiple values by to maintain the magnitude\n #tens;\n /**\n * This is a property so console.log shows a human-meaningful value.\n *\n * @private\n */\n _value;\n // Use this when changing this file to get some typing info,\n // but then switch to any to mask the internal type\n //constructor(guard: any, value: bigint, format: _FixedFormat) {\n /**\n * @private\n */\n constructor(guard, value, format) {\n assertPrivate(guard, _guard, \"FixedNumber\");\n this.#val = value;\n this.#format = format;\n const _value = toString(value, format.decimals);\n defineProperties(this, { format: format.name, _value });\n this.#tens = getTens(format.decimals);\n }\n /**\n * If true, negative values are permitted, otherwise only\n * positive values and zero are allowed.\n */\n get signed() {\n return this.#format.signed;\n }\n /**\n * The number of bits available to store the value.\n */\n get width() {\n return this.#format.width;\n }\n /**\n * The number of decimal places in the fixed-point arithment field.\n */\n get decimals() {\n return this.#format.decimals;\n }\n /**\n * The value as an integer, based on the smallest unit the\n * [[decimals]] allow.\n */\n get value() {\n return this.#val;\n }\n #checkFormat(other) {\n assertArgument(this.format === other.format, \"incompatible format; use fixedNumber.toFormat\", \"other\", other);\n }\n #checkValue(val, safeOp) {\n /*\n const width = BigInt(this.width);\n if (this.signed) {\n const limit = (BN_1 << (width - BN_1));\n assert(safeOp == null || (val >= -limit && val < limit), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n\n if (val > BN_0) {\n val = fromTwos(mask(val, width), width);\n } else {\n val = -fromTwos(mask(-val, width), width);\n }\n\n } else {\n const masked = mask(val, width);\n assert(safeOp == null || (val >= 0 && val === masked), \"overflow\", \"NUMERIC_FAULT\", {\n operation: safeOp, fault: \"overflow\", value: val\n });\n val = masked;\n }\n*/\n val = checkValue(val, this.#format, safeOp);\n return new _a(_guard, val, this.#format);\n }\n #add(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val + o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%, ignoring overflow.\n */\n addUnsafe(other) {\n return this.#add(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% added\n * to %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n add(other) {\n return this.#add(other, \"add\");\n }\n #sub(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue(this.#val - o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%, ignoring overflow.\n */\n subUnsafe(other) {\n return this.#sub(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%other%% subtracted\n * from %%this%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n sub(other) {\n return this.#sub(other, \"sub\");\n }\n #mul(o, safeOp) {\n this.#checkFormat(o);\n return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%, ignoring overflow and underflow (precision loss).\n */\n mulUnsafe(other) {\n return this.#mul(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs.\n */\n mul(other) {\n return this.#mul(other, \"mul\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% multiplied\n * by %%other%%. A [[NumericFaultError]] is thrown if overflow\n * occurs or if underflow (precision loss) occurs.\n */\n mulSignal(other) {\n this.#checkFormat(other);\n const value = this.#val * other.#val;\n assert(value % this.#tens === BN_0, \"precision lost during signalling mul\", \"NUMERIC_FAULT\", {\n operation: \"mulSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / this.#tens, \"mulSignal\");\n }\n #div(o, safeOp) {\n assert(o.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(o);\n return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n divUnsafe(other) {\n return this.#div(other);\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%, ignoring underflow (precision loss). A\n * [[NumericFaultError]] is thrown if overflow occurs.\n */\n div(other) {\n return this.#div(other, \"div\");\n }\n /**\n * Returns a new [[FixedNumber]] with the result of %%this%% divided\n * by %%other%%. A [[NumericFaultError]] is thrown if underflow\n * (precision loss) occurs.\n */\n divSignal(other) {\n assert(other.#val !== BN_0, \"division by zero\", \"NUMERIC_FAULT\", {\n operation: \"div\",\n fault: \"divide-by-zero\",\n value: this,\n });\n this.#checkFormat(other);\n const value = this.#val * this.#tens;\n assert(value % other.#val === BN_0, \"precision lost during signalling div\", \"NUMERIC_FAULT\", {\n operation: \"divSignal\",\n fault: \"underflow\",\n value: this,\n });\n return this.#checkValue(value / other.#val, \"divSignal\");\n }\n /**\n * Returns a comparison result between %%this%% and %%other%%.\n *\n * This is suitable for use in sorting, where ``-1`` implies %%this%%\n * is smaller, ``1`` implies %%other%% is larger and ``0`` implies\n * both are equal.\n */\n cmp(other) {\n let a = this.value, b = other.value;\n // Coerce a and b to the same magnitude\n const delta = this.decimals - other.decimals;\n if (delta > 0) {\n b *= getTens(delta);\n }\n else if (delta < 0) {\n a *= getTens(-delta);\n }\n // Comnpare\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return -1;\n }\n return 0;\n }\n /**\n * Returns true if %%other%% is equal to %%this%%.\n */\n eq(other) {\n return this.cmp(other) === 0;\n }\n /**\n * Returns true if %%other%% is less than to %%this%%.\n */\n lt(other) {\n return this.cmp(other) < 0;\n }\n /**\n * Returns true if %%other%% is less than or equal to %%this%%.\n */\n lte(other) {\n return this.cmp(other) <= 0;\n }\n /**\n * Returns true if %%other%% is greater than to %%this%%.\n */\n gt(other) {\n return this.cmp(other) > 0;\n }\n /**\n * Returns true if %%other%% is greater than or equal to %%this%%.\n */\n gte(other) {\n return this.cmp(other) >= 0;\n }\n /**\n * Returns a new [[FixedNumber]] which is the largest **integer**\n * that is less than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n floor() {\n let val = this.#val;\n if (this.#val < BN_0) {\n val -= this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"floor\");\n }\n /**\n * Returns a new [[FixedNumber]] which is the smallest **integer**\n * that is greater than or equal to %%this%%.\n *\n * The decimal component of the result will always be ``0``.\n */\n ceiling() {\n let val = this.#val;\n if (this.#val > BN_0) {\n val += this.#tens - BN_1;\n }\n val = (this.#val / this.#tens) * this.#tens;\n return this.#checkValue(val, \"ceiling\");\n }\n /**\n * Returns a new [[FixedNumber]] with the decimal component\n * rounded up on ties at %%decimals%% places.\n */\n round(decimals) {\n if (decimals == null) {\n decimals = 0;\n }\n // Not enough precision to not already be rounded\n if (decimals >= this.decimals) {\n return this;\n }\n const delta = this.decimals - decimals;\n const bump = BN_5 * getTens(delta - 1);\n let value = this.value + bump;\n const tens = getTens(delta);\n value = (value / tens) * tens;\n checkValue(value, this.#format, \"round\");\n return new _a(_guard, value, this.#format);\n }\n /**\n * Returns true if %%this%% is equal to ``0``.\n */\n isZero() {\n return this.#val === BN_0;\n }\n /**\n * Returns true if %%this%% is less than ``0``.\n */\n isNegative() {\n return this.#val < BN_0;\n }\n /**\n * Returns the string representation of %%this%%.\n */\n toString() {\n return this._value;\n }\n /**\n * Returns a float approximation.\n *\n * Due to IEEE 754 precission (or lack thereof), this function\n * can only return an approximation and most values will contain\n * rounding errors.\n */\n toUnsafeFloat() {\n return parseFloat(this.toString());\n }\n /**\n * Return a new [[FixedNumber]] with the same value but has had\n * its field set to %%format%%.\n *\n * This will throw if the value cannot fit into %%format%%.\n */\n toFormat(format) {\n return _a.fromString(this.toString(), format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% divided by\n * %%decimal%% places with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% (once adjusted\n * for %%decimals%%) cannot fit in %%format%%, either due to overflow\n * or underflow (precision loss).\n */\n static fromValue(_value, decimals, _format) {\n if (decimals == null) {\n decimals = 0;\n }\n const format = getFormat(_format);\n let value = getBigInt(_value, \"value\");\n const delta = decimals - format.decimals;\n if (delta > 0) {\n const tens = getTens(delta);\n assert(value % tens === BN_0, \"value loses precision for format\", \"NUMERIC_FAULT\", {\n operation: \"fromValue\",\n fault: \"underflow\",\n value: _value,\n });\n value /= tens;\n }\n else if (delta < 0) {\n value *= getTens(-delta);\n }\n checkValue(value, format, \"fromValue\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] for %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%%, either due to overflow or underflow (precision loss).\n */\n static fromString(_value, _format) {\n const match = _value.match(/^(-?)([0-9]*)\\.?([0-9]*)$/);\n assertArgument(match && match[2].length + match[3].length > 0, \"invalid FixedNumber string value\", \"value\", _value);\n const format = getFormat(_format);\n let whole = match[2] || \"0\", decimal = match[3] || \"\";\n // Pad out the decimals\n while (decimal.length < format.decimals) {\n decimal += Zeros;\n }\n // Check precision is safe\n assert(decimal.substring(format.decimals).match(/^0*$/), \"too many decimals for format\", \"NUMERIC_FAULT\", {\n operation: \"fromString\",\n fault: \"underflow\",\n value: _value,\n });\n // Remove extra padding\n decimal = decimal.substring(0, format.decimals);\n const value = BigInt(match[1] + whole + decimal);\n checkValue(value, format, \"fromString\");\n return new _a(_guard, value, format);\n }\n /**\n * Creates a new [[FixedNumber]] with the big-endian representation\n * %%value%% with %%format%%.\n *\n * This will throw a [[NumericFaultError]] if %%value%% cannot fit\n * in %%format%% due to overflow.\n */\n static fromBytes(_value, _format) {\n let value = toBigInt(getBytes(_value, \"value\"));\n const format = getFormat(_format);\n if (format.signed) {\n value = fromTwos(value, format.width);\n }\n checkValue(value, format, \"fromBytes\");\n return new _a(_guard, value, format);\n }\n}\n_a = FixedNumber;\n//const f1 = FixedNumber.fromString(\"12.56\", \"fixed16x2\");\n//const f2 = FixedNumber.fromString(\"0.3\", \"fixed16x2\");\n//console.log(f1.divSignal(f2));\n//const BUMP = FixedNumber.from(\"0.5\");\n//# sourceMappingURL=fixednumber.js.map"],"names":["assert","fromTwos","m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AM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;AACzC,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE;AAC3B,YAAY,KAAK,GAAGP,cAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;AACjD,QAAQ;AACR,QAAQ,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC;AAC9C,QAAQ,OAAO,IAAI,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;AAC5C,IAAI;AACJ;AACA,EAAE,GAAG,WAAW;AAChB;AACA;AACA;AACA;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/geturl-browser.d.ts b/lib.commonjs/utils/geturl-browser.d.ts deleted file mode 100644 index 29cebe088..000000000 --- a/lib.commonjs/utils/geturl-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -export declare function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/geturl-browser.d.ts.map b/lib.commonjs/utils/geturl-browser.d.ts.map deleted file mode 100644 index 3190d62cc..000000000 --- a/lib.commonjs/utils/geturl-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAIpB,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA0DrC"} \ No newline at end of file diff --git a/lib.commonjs/utils/geturl-browser.js b/lib.commonjs/utils/geturl-browser.js deleted file mode 100644 index fa82088d1..000000000 --- a/lib.commonjs/utils/geturl-browser.js +++ /dev/null @@ -1,52 +0,0 @@ -'use strict'; - -var errors = require('./errors.js'); - -// @TODO: timeout is completely ignored; start a Promise.any with a reject? -// @ts-ignore -async function getUrl(req, _signal) { - const protocol = req.url.split(":")[0].toLowerCase(); - errors.assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request", - }); - errors.assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request", - }); - let signal = undefined; - if (_signal) { - const controller = new AbortController(); - signal = controller.signal; - _signal.addListener(() => { - controller.abort(); - }); - } - const init = { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal, - }; - try { - const resp = await fetch(req.url, init); - const headers = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - const respBody = await resp.arrayBuffer(); - const body = respBody == null ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, - body, - }; - } - catch (error) { - console.log({ error }); - return undefined; - } -} - -exports.getUrl = getUrl; -//# sourceMappingURL=geturl-browser.js.map diff --git a/lib.commonjs/utils/geturl-browser.js.map b/lib.commonjs/utils/geturl-browser.js.map deleted file mode 100644 index 94eb56af8..000000000 --- a/lib.commonjs/utils/geturl-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl-browser.js","sources":["../../lib.esm/utils/geturl-browser.js"],"sourcesContent":["import { assert } from \"./errors.js\";\n// @TODO: timeout is completely ignored; start a Promise.any with a reject?\n// @ts-ignore\nexport async function getUrl(req, _signal) {\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 let signal = undefined;\n if (_signal) {\n const controller = new AbortController();\n signal = controller.signal;\n _signal.addListener(() => {\n controller.abort();\n });\n }\n const init = {\n method: req.method,\n headers: new Headers(Array.from(req)),\n body: req.body || undefined,\n signal,\n };\n try {\n const resp = await fetch(req.url, init);\n const headers = {};\n resp.headers.forEach((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const respBody = await resp.arrayBuffer();\n const body = respBody == null ? null : new Uint8Array(respBody);\n return {\n statusCode: resp.status,\n statusMessage: resp.statusText,\n headers,\n body,\n };\n }\n catch (error) {\n console.log({ error });\n return undefined;\n }\n}\n//# sourceMappingURL=geturl-browser.js.map"],"names":["assert"],"mappings":";;;;AACA;AACA;AACO,eAAe,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE;AAC3C,IAAI,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;AACxD,IAAIA,aAAM,CAAC,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC,EAAE,uBAAuB,EAAE;AACrH,QAAQ,IAAI,EAAE,EAAE,QAAQ,EAAE;AAC1B,QAAQ,SAAS,EAAE,SAAS;AAC5B,KAAK,CAAC;AACN,IAAIA,aAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,2BAA2B,EAAE,6CAA6C,EAAE,uBAAuB,EAAE;AAChK,QAAQ,SAAS,EAAE,SAAS;AAC5B,KAAK,CAAC;AACN,IAAI,IAAI,MAAM,GAAG,SAAS;AAC1B,IAAI,IAAI,OAAO,EAAE;AACjB,QAAQ,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE;AAChD,QAAQ,MAAM,GAAG,UAAU,CAAC,MAAM;AAClC,QAAQ,OAAO,CAAC,WAAW,CAAC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null @@ -1,6 +0,0 @@ -import type { FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -/** - * @_ignore: - */ -export declare function getUrl(req: FetchRequest, signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/geturl.d.ts.map b/lib.commonjs/utils/geturl.d.ts.map deleted file mode 100644 index 7728357a3..000000000 --- a/lib.commonjs/utils/geturl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,cAAc,CAAC,CAqGzB"} \ No newline at end of file diff --git a/lib.commonjs/utils/geturl.js b/lib.commonjs/utils/geturl.js deleted file mode 100644 index e072214ff..000000000 --- a/lib.commonjs/utils/geturl.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -var http = require('http'); -var https = require('https'); -var zlib = require('zlib'); -var errors = require('./errors.js'); -var data = require('./data.js'); - -/** - * @_ignore: - */ -async function getUrl(req, signal) { - const protocol = req.url.split(":")[0].toLowerCase(); - errors.assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request", - }); - errors.assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request", - }); - const method = req.method; - const headers = Object.assign({}, req.headers); - const options = { method, headers }; - const request = (protocol === "http" ? http : https).request(req.url, options); - request.setTimeout(req.timeout); - const body = req.body; - if (body) { - request.write(Buffer.from(body)); - } - request.end(); - return new Promise((resolve, reject) => { - // @TODO: Node 15 added AbortSignal; once we drop support for - // Node14, we can add that in here too - request.once("response", (resp) => { - const statusCode = resp.statusCode || 0; - const statusMessage = resp.statusMessage || ""; - const headers = Object.keys(resp.headers || {}).reduce((accum, name) => { - let value = resp.headers[name] || ""; - if (Array.isArray(value)) { - value = value.join(", "); - } - accum[name] = value; - return accum; - }, {}); - let body = null; - //resp.setEncoding("utf8"); - resp.on("data", (chunk) => { - if (signal) { - try { - signal.checkSignal(); - } - catch (error) { - return reject(error); - } - } - if (body == null) { - body = chunk; - } - else { - const newBody = new Uint8Array(body.length + chunk.length); - newBody.set(body, 0); - newBody.set(chunk, body.length); - body = newBody; - } - }); - resp.on("end", () => { - if (headers["content-encoding"] === "gzip" && body) { - body = data.getBytes(zlib.gunzipSync(body)); - } - resolve({ statusCode, statusMessage, headers, body }); - }); - resp.on("error", (error) => { - //@TODO: Should this just return nornal response with a server error? - error.response = { statusCode, statusMessage, headers, body }; - reject(error); - }); - }); - request.on("error", (error) => { - reject(error); - }); - }); -} - -exports.getUrl = getUrl; -//# sourceMappingURL=geturl.js.map diff --git a/lib.commonjs/utils/geturl.js.map b/lib.commonjs/utils/geturl.js.map deleted file mode 100644 index 42cf86ed3..000000000 --- a/lib.commonjs/utils/geturl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl.js","sources":["../../lib.esm/utils/geturl.js"],"sourcesContent":["import http from \"http\";\nimport https from \"https\";\nimport { gunzipSync } from \"zlib\";\nimport { assert } from \"./errors.js\";\nimport { getBytes } from \"./data.js\";\n/**\n * @_ignore:\n */\nexport async function getUrl(req, signal) {\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 options = { method, headers };\n const request = (protocol === \"http\" ? http : https).request(req.url, options);\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 // @TODO: Node 15 added AbortSignal; once we drop support for\n // Node14, we can add that in here too\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 if (headers[\"content-encoding\"] === \"gzip\" && body) {\n body = getBytes(gunzipSync(body));\n }\n resolve({ statusCode, statusMessage, headers, body });\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) => {\n reject(error);\n });\n });\n}\n//# sourceMappingURL=geturl.js.map"],"names":["assert","getBytes","gunzipSync"],"mappings":";;;;;;;;AAKA;AACA;AACA;AACO,eAAe,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE;AAC1C,IAAI,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE;AACxD,IAAIA,aAAM,CAAC,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC,EAAE,uBAAuB,EA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AK,MAAM,IAAI,IAAI,EAAE;AACpE,oBAAoB,IAAI,GAAGC,aAAQ,CAACC,eAAU,CAAC,IAAI,CAAC,CAAC;AACrD,gBAAgB;AAChB,gBAAgB,OAAO,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AACrE,YAAY,CAAC,CAAC;AACd,YAAY,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,KAAK;AACxC;AACA,gBAAgB,KAAK,CAAC,QAAQ,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE;AAC7E,gBAAgB,MAAM,CAAC,KAAK,CAAC;AAC7B,YAAY,CAAC,CAAC;AACd,QAAQ,CAAC,CAAC;AACV,QAAQ,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,KAAK;AACvC,YAAY,MAAM,CAAC,KAAK,CAAC;AACzB,QAAQ,CAAC,CAAC;AACV,IAAI,CAAC,CAAC;AACN;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/index.d.ts b/lib.commonjs/utils/index.d.ts deleted file mode 100644 index 40183df8b..000000000 --- a/lib.commonjs/utils/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * There are many simple utilities required to interact with - * Core and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ -export { decodeBase58, encodeBase58 } from "./base58.js"; -export { decodeBase64, encodeBase64 } from "./base64.js"; -export { getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice, stripZerosLeft, zeroPadValue, zeroPadBytes, arrayify, hexConcat, } from "./data.js"; -export { isCallException, isError, assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError, } from "./errors.js"; -export { EventPayload } from "./events.js"; -export { FetchRequest, FetchResponse, FetchCancelSignal } from "./fetch.js"; -export { FixedNumber } from "./fixednumber.js"; -export { fromTwos, toTwos, mask, getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity, } from "./maths.js"; -export { resolveProperties, defineProperties } from "./properties.js"; -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -export { formatXCB, parseXCB, formatUnits, parseUnits } from "./units.js"; -export { toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, } from "./utf8.js"; -export { uuidV4 } from "./uuid.js"; -export type { BytesLike } from "./data.js"; -export type { ErrorCode, CoreBCError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CallExceptionAction, CallExceptionTransaction, CodedCoreBCError, } from "./errors.js"; -export type { EventEmitterable, Listener } from "./events.js"; -export type { GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, } from "./fetch.js"; -export type { FixedFormat } from "./fixednumber.js"; -export type { BigNumberish, Numeric } from "./maths.js"; -export type { RlpStructuredData } from "./rlp.js"; -export type { Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, } from "./utf8.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/index.d.ts.map b/lib.commonjs/utils/index.d.ts.map deleted file mode 100644 index 2be8f026a..000000000 --- a/lib.commonjs/utils/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAA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AkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9D,YAAY,EACX,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,GACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EACX,aAAa,EACb,wBAAwB,EACxB,eAAe,GACf,MAAM,WAAW,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/utils/index.js b/lib.commonjs/utils/index.js deleted file mode 100644 index ab2efdadf..000000000 --- a/lib.commonjs/utils/index.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - -var base58 = require('./base58.js'); -var base64 = require('./base64.js'); -var data = require('./data.js'); -var errors = require('./errors.js'); -var events = require('./events.js'); -var fetch = require('./fetch.js'); -var fixednumber = require('./fixednumber.js'); -var maths = require('./maths.js'); -var properties = require('./properties.js'); -var rlpDecode = require('./rlp-decode.js'); -var rlpEncode = require('./rlp-encode.js'); -var units = require('./units.js'); -var utf8 = require('./utf8.js'); -var uuid = require('./uuid.js'); - - - -exports.decodeBase58 = base58.decodeBase58; -exports.encodeBase58 = base58.encodeBase58; -exports.decodeBase64 = base64.decodeBase64; -exports.encodeBase64 = base64.encodeBase64; -exports.arrayify = data.arrayify; -exports.concat = data.concat; -exports.dataLength = data.dataLength; -exports.dataSlice = data.dataSlice; -exports.getBytes = data.getBytes; -exports.getBytesCopy = data.getBytesCopy; -exports.hexConcat = data.hexConcat; -exports.hexlify = data.hexlify; -exports.isBytesLike = data.isBytesLike; -exports.isHexString = data.isHexString; -exports.stripZerosLeft = data.stripZerosLeft; -exports.zeroPadBytes = data.zeroPadBytes; -exports.zeroPadValue = data.zeroPadValue; -exports.assert = errors.assert; -exports.assertArgument = errors.assertArgument; -exports.assertArgumentCount = errors.assertArgumentCount; -exports.assertNormalize = errors.assertNormalize; -exports.assertPrivate = errors.assertPrivate; -exports.isCallException = errors.isCallException; -exports.isError = errors.isError; -exports.makeError = errors.makeError; -exports.EventPayload = events.EventPayload; -exports.FetchCancelSignal = fetch.FetchCancelSignal; -exports.FetchRequest = fetch.FetchRequest; -exports.FetchResponse = fetch.FetchResponse; -exports.FixedNumber = fixednumber.FixedNumber; -exports.fromTwos = maths.fromTwos; -exports.getBigInt = maths.getBigInt; -exports.getNumber = maths.getNumber; -exports.getUint = maths.getUint; -exports.mask = maths.mask; -exports.toBeArray = maths.toBeArray; -exports.toBeHex = maths.toBeHex; -exports.toBigInt = maths.toBigInt; -exports.toNumber = maths.toNumber; -exports.toQuantity = maths.toQuantity; -exports.toTwos = maths.toTwos; -exports.defineProperties = properties.defineProperties; -exports.resolveProperties = properties.resolveProperties; -exports.decodeRlp = rlpDecode.decodeRlp; -exports.encodeRlp = rlpEncode.encodeRlp; -exports.formatUnits = units.formatUnits; -exports.formatXCB = units.formatXCB; -exports.parseUnits = units.parseUnits; -exports.parseXCB = units.parseXCB; -exports.Utf8ErrorFuncs = utf8.Utf8ErrorFuncs; -exports.toUtf8Bytes = utf8.toUtf8Bytes; -exports.toUtf8CodePoints = utf8.toUtf8CodePoints; -exports.toUtf8String = utf8.toUtf8String; -exports.uuidV4 = uuid.uuidV4; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/utils/index.js.map b/lib.commonjs/utils/index.js.map deleted file mode 100644 index 3a142573c..000000000 --- a/lib.commonjs/utils/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/maths.d.ts b/lib.commonjs/utils/maths.d.ts deleted file mode 100644 index e1fd19522..000000000 --- a/lib.commonjs/utils/maths.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Any type that can be used where a numeric value is needed. - */ -export type Numeric = number | bigint; -/** - * Any type that can be used where a big number is needed. - */ -export type BigNumberish = string | Numeric; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -export declare function fromTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -export declare function toTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -export declare function mask(_value: BigNumberish, _bits: Numeric): bigint; -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getBigInt(value: BigNumberish, name?: string): bigint; -export declare function getUint(value: BigNumberish, name?: string): bigint; -export declare function toBigInt(value: BigNumberish | Uint8Array): bigint; -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getNumber(value: BigNumberish, name?: string): number; -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -export declare function toNumber(value: BigNumberish | Uint8Array): number; -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -export declare function toBeHex(_value: BigNumberish, _width?: Numeric): string; -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -export declare function toBeArray(_value: BigNumberish): Uint8Array; -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -export declare function toQuantity(value: BytesLike | BigNumberish): string; -//# sourceMappingURL=maths.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/maths.d.ts.map b/lib.commonjs/utils/maths.d.ts.map deleted file mode 100644 index 375586bed..000000000 --- a/lib.commonjs/utils/maths.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maths.d.ts","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAU5C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAiBtE;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAwBpE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAIjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAqCpE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAQlE;AAQD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAWjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAwCpE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAEjE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CA8BtE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAmB1D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAWlE"} \ No newline at end of file diff --git a/lib.commonjs/utils/maths.js b/lib.commonjs/utils/maths.js deleted file mode 100644 index f54d2d173..000000000 --- a/lib.commonjs/utils/maths.js +++ /dev/null @@ -1,235 +0,0 @@ -'use strict'; - -var data = require('./data.js'); -var errors = require('./errors.js'); - -/** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; -// IEEE 754 support 53-bits of mantissa -const maxValue = 0x1fffffffffffff; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -function fromTwos(_value, _width) { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - errors.assert(value >> width === BN_0, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", - fault: "overflow", - value: _value, - }); - // Top bit set; treat as a negative value - if (value >> (width - BN_1)) { - const mask = (BN_1 << width) - BN_1; - return -((~value & mask) + BN_1); - } - return value; -} -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -function toTwos(_value, _width) { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = BN_1 << (width - BN_1); - if (value < BN_0) { - value = -value; - errors.assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - const mask = (BN_1 << width) - BN_1; - return (~value & mask) + BN_1; - } - else { - errors.assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - } - return value; -} -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -function mask(_value, _bits) { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1 << bits) - BN_1); -} -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -function getBigInt(value, name) { - switch (typeof value) { - case "bigint": - return value; - case "number": - errors.assertArgument(Number.isInteger(value), "underflow", name || "value", value); - errors.assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } - catch (e) { - errors.assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); - } - } - errors.assertArgument(false, "invalid BigNumberish value", name || "value", value); -} -function getUint(value, name) { - const result = getBigInt(value, name); - errors.assert(result >= BN_0, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", - operation: "getUint", - value, - }); - return result; -} -const Nibbles = "0123456789abcdef"; -/* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ -function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles[v >> 4]; - result += Nibbles[v & 0x0f]; - } - return BigInt(result); - } - return getBigInt(value); -} -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -function getNumber(value, name) { - switch (typeof value) { - case "bigint": - errors.assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - errors.assertArgument(Number.isInteger(value), "underflow", name || "value", value); - errors.assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } - catch (e) { - errors.assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); - } - } - errors.assertArgument(false, "invalid numeric value", name || "value", value); -} -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -function toNumber(value) { - return getNumber(toBigInt(value)); -} -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -function toBeHex(_value, _width) { - const value = getUint(_value, "value"); - let result = value.toString(16); - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } - else { - const width = getNumber(_width, "width"); - errors.assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value, - }); - // Pad the value to the required width - while (result.length < width * 2) { - result = "0" + result; - } - } - return "0x" + result; -} -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -function toBeArray(_value) { - const value = getUint(_value, "value"); - if (value === BN_0) { - return new Uint8Array([]); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - return result; -} -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -function toQuantity(value) { - let result = data.hexlify(data.isBytesLike(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; -} - -exports.fromTwos = fromTwos; -exports.getBigInt = getBigInt; -exports.getNumber = getNumber; -exports.getUint = getUint; -exports.mask = mask; -exports.toBeArray = toBeArray; -exports.toBeHex = toBeHex; -exports.toBigInt = toBigInt; -exports.toNumber = toNumber; -exports.toQuantity = toQuantity; -exports.toTwos = toTwos; -//# sourceMappingURL=maths.js.map diff --git a/lib.commonjs/utils/maths.js.map b/lib.commonjs/utils/maths.js.map deleted file mode 100644 index 951eb3710..000000000 --- a/lib.commonjs/utils/maths.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maths.js","sources":["../../lib.esm/utils/maths.js"],"sourcesContent":["/**\n * Some mathematic operations.\n *\n * @_subsection: api/utils:Math Helpers [about-maths]\n */\nimport { hexlify, isBytesLike } from \"./data.js\";\nimport { assert, assertArgument } from \"./errors.js\";\nconst BN_0 = BigInt(0);\nconst BN_1 = BigInt(1);\n//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1;\n// IEEE 754 support 53-bits of mantissa\nconst maxValue = 0x1fffffffffffff;\n/**\n * Convert %%value%% from a twos-compliment representation of %%width%%\n * bits to its value.\n *\n * If the highest bit is ``1``, the result will be negative.\n */\nexport function fromTwos(_value, _width) {\n const value = getUint(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n assert(value >> width === BN_0, \"overflow\", \"NUMERIC_FAULT\", {\n operation: \"fromTwos\",\n fault: \"overflow\",\n value: _value,\n });\n // Top bit set; treat as a negative value\n if (value >> (width - BN_1)) {\n const mask = (BN_1 << width) - BN_1;\n return -((~value & mask) + BN_1);\n }\n return value;\n}\n/**\n * Convert %%value%% to a twos-compliment representation of\n * %%width%% bits.\n *\n * The result will always be positive.\n */\nexport function toTwos(_value, _width) {\n let value = getBigInt(_value, \"value\");\n const width = BigInt(getNumber(_width, \"width\"));\n const limit = BN_1 << (width - BN_1);\n if (value < BN_0) {\n value = -value;\n assert(value <= limit, \"too low\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n const mask = (BN_1 << width) - BN_1;\n return (~value & mask) + BN_1;\n }\n else {\n assert(value < limit, \"too high\", \"NUMERIC_FAULT\", {\n operation: \"toTwos\",\n fault: \"overflow\",\n value: _value,\n });\n }\n return value;\n}\n/**\n * Mask %%value%% with a bitmask of %%bits%% ones.\n */\nexport function mask(_value, _bits) {\n const value = getUint(_value, \"value\");\n const bits = BigInt(getNumber(_bits, \"bits\"));\n return value & ((BN_1 << bits) - BN_1);\n}\n/**\n * Gets a BigInt from %%value%%. If it is an invalid value for\n * a BigInt, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getBigInt(value, name) {\n switch (typeof value) {\n case \"bigint\":\n return value;\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return BigInt(value);\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n if (value[0] === \"-\" && value[1] !== \"-\") {\n return -BigInt(value.substring(1));\n }\n return BigInt(value);\n }\n catch (e) {\n assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid BigNumberish value\", name || \"value\", value);\n}\nexport function getUint(value, name) {\n const result = getBigInt(value, name);\n assert(result >= BN_0, \"unsigned value cannot be negative\", \"NUMERIC_FAULT\", {\n fault: \"overflow\",\n operation: \"getUint\",\n value,\n });\n return result;\n}\nconst Nibbles = \"0123456789abcdef\";\n/*\n * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data.\n */\nexport function toBigInt(value) {\n if (value instanceof Uint8Array) {\n let result = \"0x0\";\n for (const v of value) {\n result += Nibbles[v >> 4];\n result += Nibbles[v & 0x0f];\n }\n return BigInt(result);\n }\n return getBigInt(value);\n}\n/**\n * Gets a //number// from %%value%%. If it is an invalid value for\n * a //number//, then an ArgumentError will be thrown for %%name%%.\n */\nexport function getNumber(value, name) {\n switch (typeof value) {\n case \"bigint\":\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return Number(value);\n case \"number\":\n assertArgument(Number.isInteger(value), \"underflow\", name || \"value\", value);\n assertArgument(value >= -maxValue && value <= maxValue, \"overflow\", name || \"value\", value);\n return value;\n case \"string\":\n try {\n if (value === \"\") {\n throw new Error(\"empty string\");\n }\n return getNumber(BigInt(value), name);\n }\n catch (e) {\n assertArgument(false, `invalid numeric string: ${e.message}`, name || \"value\", value);\n }\n }\n assertArgument(false, \"invalid numeric value\", name || \"value\", value);\n}\n/**\n * Converts %%value%% to a number. If %%value%% is a Uint8Array, it\n * is treated as Big Endian data. Throws if the value is not safe.\n */\nexport function toNumber(value) {\n return getNumber(toBigInt(value));\n}\n/**\n * Converts %%value%% to a Big Endian hexstring, optionally padded to\n * %%width%% bytes.\n */\nexport function toBeHex(_value, _width) {\n const value = getUint(_value, \"value\");\n let result = value.toString(16);\n if (_width == null) {\n // Ensure the value is of even length\n if (result.length % 2) {\n result = \"0\" + result;\n }\n }\n else {\n const width = getNumber(_width, \"width\");\n assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, \"NUMERIC_FAULT\", {\n operation: \"toBeHex\",\n fault: \"overflow\",\n value: _value,\n });\n // Pad the value to the required width\n while (result.length < width * 2) {\n result = \"0\" + result;\n }\n }\n return \"0x\" + result;\n}\n/**\n * Converts %%value%% to a Big Endian Uint8Array.\n */\nexport function toBeArray(_value) {\n const value = getUint(_value, \"value\");\n if (value === BN_0) {\n return new Uint8Array([]);\n }\n let hex = value.toString(16);\n if (hex.length % 2) {\n hex = \"0\" + hex;\n }\n const result = new Uint8Array(hex.length / 2);\n for (let i = 0; i < result.length; i++) {\n const offset = i * 2;\n result[i] = parseInt(hex.substring(offset, offset + 2), 16);\n }\n return result;\n}\n/**\n * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//.\n *\n * A //Quantity// does not have and leading 0 values unless the value is\n * the literal value `0x0`. This is most commonly used for JSSON-RPC\n * numeric values.\n */\nexport function toQuantity(value) {\n let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2);\n while (result.startsWith(\"0\")) {\n result = result.substring(1);\n }\n if (result === \"\") {\n result = \"0\";\n }\n return \"0x\" + result;\n}\n//# sourceMappingURL=maths.js.map"],"names":["assert","assertArgument","hexlify","isBytesLike"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AAGA,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC;AACtB;AACA;AACA,MAAM,QAAQ,GAAG,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE;AACzC,IAAI,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC;AAC1C,IAAI,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,IAAIA,aAAM,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE;AACjE,QAAQ,SAAS,EAAE,UAAU;AAC7B,QAAQ,KAAK,EAAE,UAAU;AACzB,QAAQ,KAAK,EAAE,MAAM;AACrB,KAAK,CAAC;AACN;AACA,IAAI,IAAI,KAAK,KAAK,KAAK,GAAG,IAAI,CAAC,EAAE;AACjC,QAAQ,MAAM,IAAI,GAAG,CAAC,IAAI,IAAI,KAAK,IAAI,IAAI;AAC3C,QAAQ,OAAO,EAAE,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC;AACxC,IAAI;AACJ,IAAI,OAAO,KAAK;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;AACvC,IAAI,IAAI,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;AAC1C,IAAI,MAA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,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AACnC,QAAQ,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;AACpC,IAAI;AACJ,IAAI,IAAI,MAAM,KAAK,EAAE,EAAE;AACvB,QAAQ,MAAM,GAAG,GAAG;AACpB,IAAI;AACJ,IAAI,OAAO,IAAI,GAAG,MAAM;AACxB;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/properties.d.ts b/lib.commonjs/utils/properties.d.ts deleted file mode 100644 index f7871cc89..000000000 --- a/lib.commonjs/utils/properties.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -export declare function resolveProperties(value: { - [P in keyof T]: T[P] | Promise; -}): Promise; -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -export declare function defineProperties(target: T, values: { - [K in keyof T]?: T[K]; -}, types?: { - [K in keyof T]?: string; -}): void; -export declare function checkProperties(object: any, properties: { - [name: string]: boolean; -}): void; -//# sourceMappingURL=properties.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/properties.d.ts.map b/lib.commonjs/utils/properties.d.ts.map deleted file mode 100644 index b675427ea..000000000 --- a/lib.commonjs/utils/properties.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAChD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACjC,KAAK,CAAC,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAAE,GACjC,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC9B,MAAM,EAAE,GAAG,EACX,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACrC,IAAI,CAcN"} \ No newline at end of file diff --git a/lib.commonjs/utils/properties.js b/lib.commonjs/utils/properties.js deleted file mode 100644 index 97ef50637..000000000 --- a/lib.commonjs/utils/properties.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -var logger$1 = require('../logger/logger.js'); - -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -const logger = new logger$1.Logger("utils/properties/0.0.1"); -function checkType(value, type, name) { - const types = type.split("|").map((t) => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof value === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; -} -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); -} -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = types ? types[key] : null; - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { - enumerable: true, - value, - writable: false, - }); - } -} -function checkProperties(object, properties) { - if (!object || typeof object !== "object") { - logger.throwArgumentError("invalid object", "object", object); - } - Object.keys(object).forEach((key) => { - if (!properties[key]) { - logger.throwArgumentError("invalid object key - " + key, "transaction:" + key, object); - } - }); -} - -exports.checkProperties = checkProperties; -exports.defineProperties = defineProperties; -exports.resolveProperties = resolveProperties; -//# sourceMappingURL=properties.js.map diff --git a/lib.commonjs/utils/properties.js.map b/lib.commonjs/utils/properties.js.map deleted file mode 100644 index 89bdce968..000000000 --- a/lib.commonjs/utils/properties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.js","sources":["../../lib.esm/utils/properties.js"],"sourcesContent":["import { Logger } from \"../logger/logger.js\";\n/**\n * Property helper functions.\n *\n * @_subsection api/utils:Properties [about-properties]\n */\nconst logger = new Logger(\"utils/properties/0.0.1\");\nfunction checkType(value, type, name) {\n const types = type.split(\"|\").map((t) => t.trim());\n for (let i = 0; i < types.length; i++) {\n switch (type) {\n case \"any\":\n return;\n case \"bigint\":\n case \"boolean\":\n case \"number\":\n case \"string\":\n if (typeof value === type) {\n return;\n }\n }\n }\n const error = new Error(`invalid value for type ${type}`);\n error.code = \"INVALID_ARGUMENT\";\n error.argument = `value.${name}`;\n error.value = value;\n throw error;\n}\n/**\n * Resolves to a new object that is a copy of %%value%%, but with all\n * values resolved.\n */\nexport async function resolveProperties(value) {\n const keys = Object.keys(value);\n const results = await Promise.all(keys.map((k) => Promise.resolve(value[k])));\n return results.reduce((accum, v, index) => {\n accum[keys[index]] = v;\n return accum;\n }, {});\n}\n/**\n * Assigns the %%values%% to %%target%% as read-only values.\n *\n * It %%types%% is specified, the values are checked.\n */\nexport function defineProperties(target, values, types) {\n for (let key in values) {\n let value = values[key];\n const type = types ? types[key] : null;\n if (type) {\n checkType(value, type, key);\n }\n Object.defineProperty(target, key, {\n enumerable: true,\n value,\n writable: false,\n });\n }\n}\nexport function checkProperties(object, properties) {\n if (!object || typeof object !== \"object\") {\n logger.throwArgumentError(\"invalid object\", \"object\", object);\n }\n Object.keys(object).forEach((key) => {\n if (!properties[key]) {\n logger.throwArgumentError(\"invalid object key - \" + key, \"transaction:\" + key, object);\n }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AAG,GAAG,EAAE,MAAM,CAAC;AAClG,QAAQ;AACR,IAAI,CAAC,CAAC;AACN;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/rlp-decode.d.ts b/lib.commonjs/utils/rlp-decode.d.ts deleted file mode 100644 index b77b08b9c..000000000 --- a/lib.commonjs/utils/rlp-decode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BytesLike, RlpStructuredData } from "./index.js"; -/** - * Decodes %%data%% into the structured data it represents. - */ -export declare function decodeRlp(_data: BytesLike): RlpStructuredData; -//# sourceMappingURL=rlp-decode.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/rlp-decode.d.ts.map b/lib.commonjs/utils/rlp-decode.d.ts.map deleted file mode 100644 index b82126ab8..000000000 --- a/lib.commonjs/utils/rlp-decode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-decode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAyH/D;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB,CAU7D"} \ No newline at end of file diff --git a/lib.commonjs/utils/rlp-decode.js b/lib.commonjs/utils/rlp-decode.js deleted file mode 100644 index cadf9dc7e..000000000 --- a/lib.commonjs/utils/rlp-decode.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -var data = require('./data.js'); -var errors = require('./errors.js'); - -function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; -} -function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; -} -function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - errors.assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, - length, - offset, - }); - } - return { consumed: 1 + length, result: result }; -} -// returns { consumed: number, result: Object } -function _decode(data$1, offset) { - errors.assert(data$1.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data$1, - length: 0, - offset: 1, - }); - const checkOffset = (offset) => { - errors.assert(offset <= data$1.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data$1, - length: data$1.length, - offset, - }); - }; - // Array with extra length prefix - if (data$1[offset] >= 0xf8) { - const lengthLength = data$1[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data$1, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data$1, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data$1[offset] >= 0xc0) { - const length = data$1[offset] - 0xc0; - checkOffset(offset + 1 + length); - return _decodeChildren(data$1, offset, offset + 1, length); - } - else if (data$1[offset] >= 0xb8) { - const lengthLength = data$1[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data$1, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - const result = data.hexlify(data$1.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data$1[offset] >= 0x80) { - const length = data$1[offset] - 0x80; - checkOffset(offset + 1 + length); - const result = data.hexlify(data$1.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlifyByte(data$1[offset]) }; -} -/** - * Decodes %%data%% into the structured data it represents. - */ -function decodeRlp(_data) { - const data$1 = data.getBytes(_data, "data"); - const decoded = _decode(data$1, 0); - errors.assertArgument(decoded.consumed === data$1.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; -} - -exports.decodeRlp = decodeRlp; -//# sourceMappingURL=rlp-decode.js.map diff --git a/lib.commonjs/utils/rlp-decode.js.map b/lib.commonjs/utils/rlp-decode.js.map deleted file mode 100644 index 9f33278b8..000000000 --- a/lib.commonjs/utils/rlp-decode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-decode.js","sources":["../../lib.esm/utils/rlp-decode.js"],"sourcesContent":["import { 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,\n length,\n 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,\n length: 0,\n offset: 1,\n });\n const checkOffset = (offset) => {\n assert(offset <= data.length, \"data short segment too short\", \"BUFFER_OVERRUN\", {\n buffer: data,\n length: data.length,\n 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"],"names":["assert","data","hexlify","getBytes","assertArgument"],"mappings":";;;;;AAGA,SAAS,WAAW,CAAC,KAAK,EAAE;AAC5B,IAAI,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;AACnC,IAAI,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;AAC9B,QAAQ,MAAM,GAAG,GAAG,GAAG,MAAM;AAC7B,IAAI;AACJ,IAAI,OAAO,IAAI,GAAG,MAAM;AACxB;AACA,SAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACjD,IAAI,IAAI,MAAM,GAAG,CAAC;AAClB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;AACrC,QAAQ,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;AAChD,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;AACA,SAAS,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE;AAC5D,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,OAAO,WAAW,GA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MAAI,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;AACnC,QAAQ,MAAM,MAAM,GAAGA,MAAI,CAAC,MAAM,CAAC,GAAG,IAAI;AAC1C,QAAQ,WAAW,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;AACxC,QAAQ,MAAM,MAAM,GAAGC,YAAO,CAACD,MAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;AAC3E,QAAQ,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AACvD,IAAI;AACJ,IAAI,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAACA,MAAI,CAAC,MAAM,CAAC,CAAC,EAAE;AAC7D;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,IAAI,MAAMA,MAAI,GAAGE,aAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;AACxC,IAAI,MAAM,OAAO,GAAG,OAAO,CAACF,MAAI,EAAE,CAAC,CAAC;AACpC,IAAIG,qBAAc,CAAC,OAAO,CAAC,QAAQ,KAAKH,MAAI,CAAC,MAAM,EAAE,mCAAmC,EAAE,MAAM,EAAE,KAAK,CAAC;AACxG,IAAI,OAAO,OAAO,CAAC,MAAM;AACzB;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/rlp-encode.d.ts b/lib.commonjs/utils/rlp-encode.d.ts deleted file mode 100644 index 9c3d024ac..000000000 --- a/lib.commonjs/utils/rlp-encode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RlpStructuredData } from "./rlp.js"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -export declare function encodeRlp(object: RlpStructuredData): string; -//# sourceMappingURL=rlp-encode.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/rlp-encode.d.ts.map b/lib.commonjs/utils/rlp-encode.d.ts.map deleted file mode 100644 index 3fa6ef0ba..000000000 --- a/lib.commonjs/utils/rlp-encode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-encode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAgDlD;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAO3D"} \ No newline at end of file diff --git a/lib.commonjs/utils/rlp-encode.js b/lib.commonjs/utils/rlp-encode.js deleted file mode 100644 index c3516d8f0..000000000 --- a/lib.commonjs/utils/rlp-encode.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -var data = require('./data.js'); - -function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - const data$1 = Array.prototype.slice.call(data.getBytes(object, "object")); - if (data$1.length === 1 && data$1[0] <= 0x7f) { - return data$1; - } - else if (data$1.length <= 55) { - data$1.unshift(0x80 + data$1.length); - return data$1; - } - const length = arrayifyInteger(data$1.length); - length.unshift(0xb7 + length.length); - return length.concat(data$1); -} -const nibbles = "0123456789abcdef"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -function encodeRlp(object) { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; -} - -exports.encodeRlp = encodeRlp; -//# sourceMappingURL=rlp-encode.js.map diff --git a/lib.commonjs/utils/rlp-encode.js.map b/lib.commonjs/utils/rlp-encode.js.map deleted file mode 100644 index 401871b88..000000000 --- a/lib.commonjs/utils/rlp-encode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-encode.js","sources":["../../lib.esm/utils/rlp-encode.js"],"sourcesContent":["import { 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"],"names":["data","getBytes"],"mappings":";;;;AACA,SAAS,eAAe,CAAC,KAAK,EAAE;AAChC,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;AACpC,QAAQ,KAAK,KAAK,CAAC;AACnB,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;AACA,SAAS,OAAO,CAAC,MAAM,EAAE;AACzB,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AAC/B,QAAQ,IAAI,OAAO,GAAG,EAAE;AACxB,QAAQ,MAAM,CAAC,OAAO,CAAC,UAAU,KAAK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AACrB,IAAI,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE;AACrC,QAAQ,MAAM,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AACjC,QAAQ,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC;AAClC,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/rlp.d.ts b/lib.commonjs/utils/rlp.d.ts deleted file mode 100644 index 6ef450115..000000000 --- a/lib.commonjs/utils/rlp.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The [[link-rlp]] (RLP) encoding is used throughout Core - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -/** - * An RLP-encoded structure. - */ -export type RlpStructuredData = string | Array; -//# sourceMappingURL=rlp.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/rlp.d.ts.map b/lib.commonjs/utils/rlp.d.ts.map deleted file mode 100644 index c5043abd3..000000000 --- a/lib.commonjs/utils/rlp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/utils/rlp.js b/lib.commonjs/utils/rlp.js deleted file mode 100644 index 9ef537190..000000000 --- a/lib.commonjs/utils/rlp.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var rlpDecode = require('./rlp-decode.js'); -var rlpEncode = require('./rlp-encode.js'); - - - -exports.decodeRlp = rlpDecode.decodeRlp; -exports.encodeRlp = rlpEncode.encodeRlp; -//# sourceMappingURL=rlp.js.map diff --git a/lib.commonjs/utils/rlp.js.map b/lib.commonjs/utils/rlp.js.map deleted file mode 100644 index 96c115a36..000000000 --- a/lib.commonjs/utils/rlp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/units.d.ts b/lib.commonjs/utils/units.d.ts deleted file mode 100644 index dfb7a32a6..000000000 --- a/lib.commonjs/utils/units.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { BigNumberish, Numeric } from "../utils/index.js"; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit - * - */ -export declare function formatUnits(value: BigNumberish, unit?: string | Numeric): string; -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit. - */ -export declare const scientificToDecimal: (num: string | number) => string | number; -export declare const trimDecimals: (n: string, decimals?: number) => string; -export declare function parseUnits(value: string, unit?: string | Numeric): bigint; -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -export declare function formatXCB(ore: BigNumberish): string; -/** - * Converts the //decimal string// %%xcb%% to a BigInt, using 18 - * decimal places. - */ -export declare function parseXCB(xcb: string): bigint; -//# sourceMappingURL=units.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/units.d.ts.map b/lib.commonjs/utils/units.d.ts.map deleted file mode 100644 index fef9d60bc..000000000 --- a/lib.commonjs/utils/units.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,YAAY,EACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GACrB,MAAM,CAWR;AAED;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,QAAS,MAAM,GAAG,MAAM,oBA6CvD,CAAC;AACF,eAAO,MAAM,YAAY,MAAO,MAAM,8BAQrC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAsBzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"} \ No newline at end of file diff --git a/lib.commonjs/utils/units.js b/lib.commonjs/utils/units.js deleted file mode 100644 index 73d396a2e..000000000 --- a/lib.commonjs/utils/units.js +++ /dev/null @@ -1,161 +0,0 @@ -'use strict'; - -var errors = require('./errors.js'); -var fixednumber = require('./fixednumber.js'); -var maths = require('./maths.js'); - -/** - * Most interactions with Core requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Core, //Core// is divisible to 18 decimal places, - * where each individual unit is called a //ore//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ -const names = [ - ///Ore, the smallest and atomic amount of Core - "ore", - ///fecore, 1000 ore - "fecore", - ///Picore, one million ore - "picore", - ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices. - "nacore", - ///Μcore, 10^12 ore or 1 μCore - "mcore", - ///micore, 10^15 ore or 1 mcore - "micore", - "core", -]; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit - * - */ -function formatUnits(value, unit) { - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - errors.assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = maths.getNumber(unit, "unit"); - } - return fixednumber.FixedNumber.fromValue(value, decimals, { decimals }).toString(); -} -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit. - */ -const scientificToDecimal = (num) => { - // @ts-ignore - var nsign = Math.sign(num); - //remove the sign - // @ts-ignore - num = Math.abs(num); - //if the number is in scientific notation remove it - // @ts-ignore - if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) { - var zero = "0", - // @ts-ignore - parts = String(num).toLowerCase().split("e"), //split into coeff and exponent - e = parts.pop(), //store the exponential part - // @ts-ignore - l = Math.abs(e), //get the number of zeros - // @ts-ignore - sign = e / l, coeff_array = parts[0].split("."); - if (sign === -1) { - l = l - coeff_array[0].length; - if (l < 0) { - // @ts-ignore - num = - coeff_array[0].slice(0, l) + - "." + - coeff_array[0].slice(l) + - (coeff_array.length === 2 ? coeff_array[1] : ""); - } - else { - // @ts-ignore - num = zero + "." + new Array(l + 1).join(zero) + coeff_array.join(""); - } - } - else { - var dec = coeff_array[1]; - if (dec) - l = l - dec.length; - if (l < 0) { - // @ts-ignore - num = coeff_array[0] + dec.slice(0, l) + "." + dec.slice(l); - } - else { - // @ts-ignore - num = coeff_array.join("") + new Array(l + 1).join(zero); - } - } - } - // @ts-ignore - return nsign < 0 ? "-" + num : num; -}; -const trimDecimals = (n, decimals = 18) => { - n += ""; - if (n.indexOf(".") === -1) - return n; - const arr = n.split("."); - const fraction = arr[1].substr(0, decimals); - return arr[0] + "." + fraction; -}; -function parseUnits(value, unit) { - errors.assertArgument(typeof value === "string", "value must be a string", "value", value); - if (value.includes("e")) { - value = scientificToDecimal(value).toString(); - } - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - errors.assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - value = trimDecimals(value, decimals); - } - else if (unit != null) { - decimals = maths.getNumber(unit, "unit"); - value = trimDecimals(value, decimals); - } - return fixednumber.FixedNumber.fromString(value, { decimals }).value; -} -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -function formatXCB(ore) { - return formatUnits(ore, 18); -} -/** - * Converts the //decimal string// %%xcb%% to a BigInt, using 18 - * decimal places. - */ -function parseXCB(xcb) { - return parseUnits(xcb, 18); -} - -exports.formatUnits = formatUnits; -exports.formatXCB = formatXCB; -exports.parseUnits = parseUnits; -exports.parseXCB = parseXCB; -exports.scientificToDecimal = scientificToDecimal; -exports.trimDecimals = trimDecimals; -//# sourceMappingURL=units.js.map diff --git a/lib.commonjs/utils/units.js.map b/lib.commonjs/utils/units.js.map deleted file mode 100644 index 936c8a909..000000000 --- a/lib.commonjs/utils/units.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"units.js","sources":["../../lib.esm/utils/units.js"],"sourcesContent":["/**\n * Most interactions with Core requires integer values, which use\n * the smallest magnitude unit.\n *\n * For example, imagine dealing with dollars and cents. Since dollars\n * are divisible, non-integer values are possible, such as ``$10.77``.\n * By using the smallest indivisible unit (i.e. cents), the value can\n * be kept as the integer ``1077``.\n *\n * When receiving decimal input from the user (as a decimal string),\n * the value should be converted to an integer and when showing a user\n * a value, the integer value should be converted to a decimal string.\n *\n * This creates a clear distinction, between values to be used by code\n * (integers) and values used for display logic to users (decimals).\n *\n * The native unit in Core, //Core// is divisible to 18 decimal places,\n * where each individual unit is called a //ore//.\n *\n * @_subsection api/utils:Unit Conversion [about-units]\n */\nimport { assertArgument } from \"./errors.js\";\nimport { FixedNumber } from \"./fixednumber.js\";\nimport { getNumber } from \"./maths.js\";\nconst names = [\n ///Ore, the smallest and atomic amount of Core\n \"ore\",\n ///fecore, 1000 ore\n \"fecore\",\n ///Picore, one million ore\n \"picore\",\n ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices.\n \"nacore\",\n ///Μcore, 10^12 ore or 1 μCore\n \"mcore\",\n ///micore, 10^15 ore or 1 mcore\n \"micore\",\n \"core\",\n];\n/**\n * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal\n * places. The %%unit%% may be the number of decimal places or the name of\n * a unit\n *\n */\nexport function formatUnits(value, unit) {\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n }\n return FixedNumber.fromValue(value, decimals, { decimals }).toString();\n}\n/**\n * Converts the //decimal string// %%value%% to a BigInt, assuming\n * %%unit%% decimal places. The %%unit%% may the number of decimal places\n * or the name of a unit.\n */\nexport const scientificToDecimal = (num) => {\n // @ts-ignore\n var nsign = Math.sign(num);\n //remove the sign\n // @ts-ignore\n num = Math.abs(num);\n //if the number is in scientific notation remove it\n // @ts-ignore\n if (/\\d+\\.?\\d*e[\\+\\-]*\\d+/i.test(num)) {\n var zero = \"0\", \n // @ts-ignore\n parts = String(num).toLowerCase().split(\"e\"), //split into coeff and exponent\n e = parts.pop(), //store the exponential part\n // @ts-ignore\n l = Math.abs(e), //get the number of zeros\n // @ts-ignore\n sign = e / l, coeff_array = parts[0].split(\".\");\n if (sign === -1) {\n l = l - coeff_array[0].length;\n if (l < 0) {\n // @ts-ignore\n num =\n coeff_array[0].slice(0, l) +\n \".\" +\n coeff_array[0].slice(l) +\n (coeff_array.length === 2 ? coeff_array[1] : \"\");\n }\n else {\n // @ts-ignore\n num = zero + \".\" + new Array(l + 1).join(zero) + coeff_array.join(\"\");\n }\n }\n else {\n var dec = coeff_array[1];\n if (dec)\n l = l - dec.length;\n if (l < 0) {\n // @ts-ignore\n num = coeff_array[0] + dec.slice(0, l) + \".\" + dec.slice(l);\n }\n else {\n // @ts-ignore\n num = coeff_array.join(\"\") + new Array(l + 1).join(zero);\n }\n }\n }\n // @ts-ignore\n return nsign < 0 ? \"-\" + num : num;\n};\nexport const trimDecimals = (n, decimals = 18) => {\n n += \"\";\n if (n.indexOf(\".\") === -1)\n return n;\n const arr = n.split(\".\");\n const fraction = arr[1].substr(0, decimals);\n return arr[0] + \".\" + fraction;\n};\nexport function parseUnits(value, unit) {\n assertArgument(typeof value === \"string\", \"value must be a string\", \"value\", value);\n if (value.includes(\"e\")) {\n value = scientificToDecimal(value).toString();\n }\n let decimals = 18;\n if (typeof unit === \"string\") {\n const index = names.indexOf(unit);\n assertArgument(index >= 0, \"invalid unit\", \"unit\", unit);\n decimals = 3 * index;\n value = trimDecimals(value, decimals);\n }\n else if (unit != null) {\n decimals = getNumber(unit, \"unit\");\n value = trimDecimals(value, decimals);\n }\n return FixedNumber.fromString(value, { decimals }).value;\n}\n/**\n * Converts %%value%% into a //decimal string// using 18 decimal places.\n */\nexport function formatXCB(ore) {\n return formatUnits(ore, 18);\n}\n/**\n * Converts the //decimal string// %%xcb%% to a BigInt, using 18\n * decimal places.\n */\nexport function parseXCB(xcb) {\n return parseUnits(xcb, 18);\n}\n//# sourceMappingURL=units.js.map"],"names":["assertArgument","getNumber","FixedNumber"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA,MAAM,KAAK,GAAG;AACd;AACA,IAAI,KAAK;AACT;AACA,IAAI,QAAQ;AACZ;AACA,IAAI,QAAQ;AACZ;AACA,IAAI,QAAQ;AACZ;AACA,IAAI,OAAO;AACX;AACA,IAAI,QAAQ;AACZ,IAAI,MAAM;AACV,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,KAAK,EAAE,IAA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AAM,CAAC;AAC1C,QAAQ,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7C,IAAI;AACJ,IAAI,OAAOC,uBAAW,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK;AAC5D;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAC,GAAG,EAAE;AAC/B,IAAI,OAAO,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC;AAC/B;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,GAAG,EAAE;AAC9B,IAAI,OAAO,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC;AAC9B;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/utf8.d.ts b/lib.commonjs/utils/utf8.d.ts deleted file mode 100644 index 7bb87cc7d..000000000 --- a/lib.commonjs/utils/utf8.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * The stanard normalization forms. - */ -export type UnicodeNormalizationForm = "NFC" | "NFD" | "NFKC" | "NFKD"; -/** - * When using the UTF-8 error API the following errors can be intercepted - * and processed as the %%reason%% passed to the [[Utf8ErrorFunc]]. - * - * **``"UNEXPECTED_CONTINUE"``** - a continuation byte was present where there - * was nothing to continue. - * - * **``"BAD_PREFIX"``** - an invalid (non-continuation) byte to start a - * UTF-8 codepoint was found. - * - * **``"OVERRUN"``** - the string is too short to process the expected - * codepoint length. - * - * **``"MISSING_CONTINUE"``** - a missing continuation byte was expected but - * not found. The %%offset%% indicates the index the continuation byte - * was expected at. - * - * **``"OUT_OF_RANGE"``** - the computed code point is outside the range - * for UTF-8. The %%badCodepoint%% indicates the computed codepoint, which was - * outside the valid UTF-8 range. - * - * **``"UTF16_SURROGATE"``** - the UTF-8 strings contained a UTF-16 surrogate - * pair. The %%badCodepoint%% is the computed codepoint, which was inside the - * UTF-16 surrogate range. - * - * **``"OVERLONG"``** - the string is an overlong representation. The - * %%badCodepoint%% indicates the computed codepoint, which has already - * been bounds checked. - * - * - * @returns string - */ -export type Utf8ErrorReason = "UNEXPECTED_CONTINUE" | "BAD_PREFIX" | "OVERRUN" | "MISSING_CONTINUE" | "OUT_OF_RANGE" | "UTF16_SURROGATE" | "OVERLONG"; -/** - * A callback that can be used with [[toUtf8String]] to analysis or - * recovery from invalid UTF-8 data. - * - * Parsing UTF-8 data is done through a simple Finite-State Machine (FSM) - * which calls the ``Utf8ErrorFunc`` if a fault is detected. - * - * The %%reason%% indicates where in the FSM execution the fault - * occurred and the %%offset%% indicates where the input failed. - * - * The %%bytes%% represents the raw UTF-8 data that was provided and - * %%output%% is the current array of UTF-8 code-points, which may - * be updated by the ``Utf8ErrorFunc``. - * - * The value of the %%badCodepoint%% depends on the %%reason%%. See - * [[Utf8ErrorReason]] for details. - * - * The function should return the number of bytes that should be skipped - * when control resumes to the FSM. - */ -export type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number) => number; -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -export declare const Utf8ErrorFuncs: Readonly>; -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm): Uint8Array; -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -export declare function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string; -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8CodePoints(str: string, form?: UnicodeNormalizationForm): Array; -//# sourceMappingURL=utf8.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/utf8.d.ts.map b/lib.commonjs/utils/utf8.d.ts.map deleted file mode 100644 index febc8e114..000000000 --- a/lib.commonjs/utils/utf8.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.d.ts","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,eAAe,GACxB,qBAAqB,GACrB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,UAAU,CAAC;AAEd;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,CAC3B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EACrB,YAAY,CAAC,EAAE,MAAM,KACjB,MAAM,CAAC;AAwEZ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACpC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,aAAa,CAAC,CAKpD,CAAC;AA2GH;;;;GAIG;AACH,wBAAgB,WAAW,CAC1B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,UAAU,CAwCZ;AAkBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,aAAa,GACrB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,KAAK,CAAC,MAAM,CAAC,CAEf"} \ No newline at end of file diff --git a/lib.commonjs/utils/utf8.js b/lib.commonjs/utils/utf8.js deleted file mode 100644 index 97cc256e9..000000000 --- a/lib.commonjs/utils/utf8.js +++ /dev/null @@ -1,228 +0,0 @@ -'use strict'; - -var data = require('./data.js'); -var errors = require('./errors.js'); - -/** - * Using strings in Core (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ -function errorFunc(reason, offset, bytes, output, badCodepoint) { - errors.assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); -} -function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; -} -function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - errors.assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes); -} -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc, -}); -// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 -function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = data.getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; -} -// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8Bytes(str, form) { - if (form != null) { - errors.assertNormalize(form); - str = str.normalize(form); - } - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - errors.assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); -} -//export -function _toUtf8String(codePoints) { - return codePoints - .map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00); - }) - .join(""); -} -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); -} -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -function toUtf8CodePoints(str, form) { - return getUtf8CodePoints(toUtf8Bytes(str, form)); -} - -exports.Utf8ErrorFuncs = Utf8ErrorFuncs; -exports.toUtf8Bytes = toUtf8Bytes; -exports.toUtf8CodePoints = toUtf8CodePoints; -exports.toUtf8String = toUtf8String; -//# sourceMappingURL=utf8.js.map diff --git a/lib.commonjs/utils/utf8.js.map b/lib.commonjs/utils/utf8.js.map deleted file mode 100644 index 8f0a35e66..000000000 --- a/lib.commonjs/utils/utf8.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.js","sources":["../../lib.esm/utils/utf8.js"],"sourcesContent":["/**\n * Using strings in Core (or any security-basd system) requires\n * additional care. These utilities attempt to mitigate some of the\n * safety issues as well as provide the ability to recover and analyse\n * strings.\n *\n * @_subsection api/utils:Strings and UTF-8 [about-strings]\n */\nimport { getBytes } from \"./data.js\";\nimport { assertArgument, assertNormalize } from \"./errors.js\";\nfunction errorFunc(reason, offset, bytes, output, badCodepoint) {\n assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, \"bytes\", bytes);\n}\nfunction ignoreFunc(reason, offset, bytes, output, badCodepoint) {\n // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes\n if (reason === \"BAD_PREFIX\" || reason === \"UNEXPECTED_CONTINUE\") {\n let i = 0;\n for (let o = offset + 1; o < bytes.length; o++) {\n if (bytes[o] >> 6 !== 0x02) {\n break;\n }\n i++;\n }\n return i;\n }\n // This byte runs us past the end of the string, so just jump to the end\n // (but the first byte was read already read and therefore skipped)\n if (reason === \"OVERRUN\") {\n return bytes.length - offset - 1;\n }\n // Nothing to skip\n return 0;\n}\nfunction replaceFunc(reason, offset, bytes, output, badCodepoint) {\n // Overlong representations are otherwise \"valid\" code points; just non-deistingtished\n if (reason === \"OVERLONG\") {\n assertArgument(typeof badCodepoint === \"number\", \"invalid bad code point for replacement\", \"badCodepoint\", badCodepoint);\n output.push(badCodepoint);\n return 0;\n }\n // Put the replacement character into the output\n output.push(0xfffd);\n // Otherwise, process as if ignoring errors\n return ignoreFunc(reason, offset, bytes, output, badCodepoint);\n}\n/**\n * A handful of popular, built-in UTF-8 error handling strategies.\n *\n * **``\"error\"``** - throws on ANY illegal UTF-8 sequence or\n * non-canonical (overlong) codepoints (this is the default)\n *\n * **``\"ignore\"``** - silently drops any illegal UTF-8 sequence\n * and accepts non-canonical (overlong) codepoints\n *\n * **``\"replace\"``** - replace any illegal UTF-8 sequence with the\n * UTF-8 replacement character (i.e. ``\"\\\\ufffd\"``) and accepts\n * non-canonical (overlong) codepoints\n *\n * @returns: Record<\"error\" | \"ignore\" | \"replace\", Utf8ErrorFunc>\n */\nexport const Utf8ErrorFuncs = Object.freeze({\n error: errorFunc,\n ignore: ignoreFunc,\n replace: replaceFunc,\n});\n// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499\nfunction getUtf8CodePoints(_bytes, onError) {\n if (onError == null) {\n onError = Utf8ErrorFuncs.error;\n }\n const bytes = getBytes(_bytes, \"bytes\");\n const result = [];\n let i = 0;\n // Invalid bytes are ignored\n while (i < bytes.length) {\n const c = bytes[i++];\n // 0xxx xxxx\n if (c >> 7 === 0) {\n result.push(c);\n continue;\n }\n // Multibyte; how many bytes left for this character?\n let extraLength = null;\n let overlongMask = null;\n // 110x xxxx 10xx xxxx\n if ((c & 0xe0) === 0xc0) {\n extraLength = 1;\n overlongMask = 0x7f;\n // 1110 xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf0) === 0xe0) {\n extraLength = 2;\n overlongMask = 0x7ff;\n // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx\n }\n else if ((c & 0xf8) === 0xf0) {\n extraLength = 3;\n overlongMask = 0xffff;\n }\n else {\n if ((c & 0xc0) === 0x80) {\n i += onError(\"UNEXPECTED_CONTINUE\", i - 1, bytes, result);\n }\n else {\n i += onError(\"BAD_PREFIX\", i - 1, bytes, result);\n }\n continue;\n }\n // Do we have enough bytes in our data?\n if (i - 1 + extraLength >= bytes.length) {\n i += onError(\"OVERRUN\", i - 1, bytes, result);\n continue;\n }\n // Remove the length prefix from the char\n let res = c & ((1 << (8 - extraLength - 1)) - 1);\n for (let j = 0; j < extraLength; j++) {\n let nextChar = bytes[i];\n // Invalid continuation byte\n if ((nextChar & 0xc0) != 0x80) {\n i += onError(\"MISSING_CONTINUE\", i, bytes, result);\n res = null;\n break;\n }\n res = (res << 6) | (nextChar & 0x3f);\n i++;\n }\n // See above loop for invalid continuation byte\n if (res === null) {\n continue;\n }\n // Maximum code point\n if (res > 0x10ffff) {\n i += onError(\"OUT_OF_RANGE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Reserved for UTF-16 surrogate halves\n if (res >= 0xd800 && res <= 0xdfff) {\n i += onError(\"UTF16_SURROGATE\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n // Check for overlong sequences (more bytes than needed)\n if (res <= overlongMask) {\n i += onError(\"OVERLONG\", i - 1 - extraLength, bytes, result, res);\n continue;\n }\n result.push(res);\n }\n return result;\n}\n// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array\n/**\n * Returns the UTF-8 byte representation of %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8Bytes(str, form) {\n if (form != null) {\n assertNormalize(form);\n str = str.normalize(form);\n }\n let result = [];\n for (let i = 0; i < str.length; i++) {\n const c = str.charCodeAt(i);\n if (c < 0x80) {\n result.push(c);\n }\n else if (c < 0x800) {\n result.push((c >> 6) | 0xc0);\n result.push((c & 0x3f) | 0x80);\n }\n else if ((c & 0xfc00) == 0xd800) {\n i++;\n const c2 = str.charCodeAt(i);\n assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, \"invalid surrogate pair\", \"str\", str);\n // Surrogate Pair\n const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n result.push((pair >> 18) | 0xf0);\n result.push(((pair >> 12) & 0x3f) | 0x80);\n result.push(((pair >> 6) & 0x3f) | 0x80);\n result.push((pair & 0x3f) | 0x80);\n }\n else {\n result.push((c >> 12) | 0xe0);\n result.push(((c >> 6) & 0x3f) | 0x80);\n result.push((c & 0x3f) | 0x80);\n }\n }\n return new Uint8Array(result);\n}\n//export\nfunction _toUtf8String(codePoints) {\n return codePoints\n .map((codePoint) => {\n if (codePoint <= 0xffff) {\n return String.fromCharCode(codePoint);\n }\n codePoint -= 0x10000;\n return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00);\n })\n .join(\"\");\n}\n/**\n * Returns the string represented by the UTF-8 data %%bytes%%.\n *\n * When %%onError%% function is specified, it is called on UTF-8\n * errors allowing recovery using the [[Utf8ErrorFunc]] API.\n * (default: [error](Utf8ErrorFuncs))\n */\nexport function toUtf8String(bytes, onError) {\n return _toUtf8String(getUtf8CodePoints(bytes, onError));\n}\n/**\n * Returns the UTF-8 code-points for %%str%%.\n *\n * If %%form%% is specified, the string is normalized.\n */\nexport function toUtf8CodePoints(str, form) {\n return getUtf8CodePoints(toUtf8Bytes(str, form));\n}\n//# sourceMappingURL=utf8.js.map"],"names":["assertArgument","getBytes","assertNormalize"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAAS,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE;AAChE,IAAIA,qBAAc,CAAC,KAAK,EAAE,CAAC,4BAA4B,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC;AAC7F;AACA,SAAS,UAAU,CAAC,MAAM,EAAE,MA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AO;AACX,SAAS,GAAG,CAAC,CAAC,SAAS,KAAK;AAC5B,QAAQ,IAAI,SAAS,IAAI,MAAM,EAAE;AACjC,YAAY,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC;AACjD,QAAQ;AACR,QAAQ,SAAS,IAAI,OAAO;AAC5B,QAAQ,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,IAAI,EAAE,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC,SAAS,GAAG,KAAK,IAAI,MAAM,CAAC;AACtG,IAAI,CAAC;AACL,SAAS,IAAI,CAAC,EAAE,CAAC;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE;AAC7C,IAAI,OAAO,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE;AAC5C,IAAI,OAAO,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AACpD;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/utils/uuid.d.ts b/lib.commonjs/utils/uuid.d.ts deleted file mode 100644 index 7b7465157..000000000 --- a/lib.commonjs/utils/uuid.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -export declare function uuidV4(randomBytes: BytesLike): string; -//# sourceMappingURL=uuid.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/utils/uuid.d.ts.map b/lib.commonjs/utils/uuid.d.ts.map deleted file mode 100644 index f3cf307c6..000000000 --- a/lib.commonjs/utils/uuid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAqBrD"} \ No newline at end of file diff --git a/lib.commonjs/utils/uuid.js b/lib.commonjs/utils/uuid.js deleted file mode 100644 index 865e3d08d..000000000 --- a/lib.commonjs/utils/uuid.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -var data = require('./data.js'); - -/** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -function uuidV4(randomBytes) { - const bytes = data.getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = data.hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} - -exports.uuidV4 = uuidV4; -//# sourceMappingURL=uuid.js.map diff --git a/lib.commonjs/utils/uuid.js.map b/lib.commonjs/utils/uuid.js.map deleted file mode 100644 index b87f40c09..000000000 --- a/lib.commonjs/utils/uuid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.js","sources":["../../lib.esm/utils/uuid.js"],"sourcesContent":["/**\n * Explain UUID and link to RFC here.\n *\n * @_subsection: api/utils:UUID [about-uuid]\n */\nimport { getBytes, hexlify } from \"./data.js\";\n/**\n * Returns the version 4 [[link-uuid]] for the %%randomBytes%%.\n *\n * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n */\nexport function uuidV4(randomBytes) {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n const value = hexlify(bytes);\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n//# sourceMappingURL=uuid.js.map"],"names":["getBytes","hexlify"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,WAAW,EAAE;AACpC,IAAI,MAAM,KAAK,GAAGA,aAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;AACtD;AACA;AACA,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI;AACvC;AACA;AACA;AACA,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,IAAI;AACvC,IAAI,MAAM,KAAK,GAAGC,YAAO,CAAC,KAAK,CAAC;AAChC,IAAI,OAAO;AACX,QAAQ,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;AAC9B,QAAQ,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AAC/B,QAAQ,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AAC/B,QAAQ,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AAC/B,QAAQ,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACf;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/base-wallet.d.ts b/lib.commonjs/wallet/base-wallet.d.ts deleted file mode 100644 index a788c67b2..000000000 --- a/lib.commonjs/wallet/base-wallet.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { AbstractSigner } from "../providers/index.js"; -import { SigningKey } from "../crypto/index.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { Provider, TransactionRequest } from "../providers/index.js"; -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -export declare class BaseWallet extends AbstractSigner { - #private; - /** - * The wallet address. - */ - readonly address: string; - readonly prefix: string; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor({ signingKey, prefix, provider, }: { - signingKey: SigningKey; - prefix: string; - provider?: null | Provider; - }); - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey(): SigningKey; - /** - * The private key for this wallet. - */ - get privateKey(): string; - getAddress(): Promise; - connect(provider: null | Provider): BaseWallet; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message: string | Uint8Array): string; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=base-wallet.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/base-wallet.d.ts.map b/lib.commonjs/wallet/base-wallet.d.ts.map deleted file mode 100644 index 9b7a9bb96..000000000 --- a/lib.commonjs/wallet/base-wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AASvD,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG1E;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,cAAc;;IAC7C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAIxB;;;;;;OAMG;IACH,YAAY,EACX,UAAU,EACV,MAAM,EACN,QAAQ,GACR,EAAE;QACF,UAAU,EAAE,UAAU,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,EAcA;IAKD;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAM7C;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAID;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAEpD;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAgCjB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wallet/base-wallet.js b/lib.commonjs/wallet/base-wallet.js deleted file mode 100644 index 7e35967e6..000000000 --- a/lib.commonjs/wallet/base-wallet.js +++ /dev/null @@ -1,151 +0,0 @@ -'use strict'; - -var index = require('../address/index.js'); -require('../crypto/keccak.js'); -var sha3 = require('../crypto/sha3.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var message = require('../hash/message.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/signature.js'); -var typedData = require('../hash/typed-data.js'); -var address = require('../transaction/address.js'); -var transaction = require('../transaction/transaction.js'); -require('../providers/format.js'); -require('../providers/provider.js'); -var abstractSigner = require('../providers/abstract-signer.js'); -require('../abi/abi-coder.js'); -require('../abi/fragments.js'); -require('ws'); -require('../providers/provider-fallback.js'); -require('net'); - -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -class BaseWallet extends abstractSigner.AbstractSigner { - /** - * The wallet address. - */ - address; - prefix; - #signingKey; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor({ signingKey, prefix, provider, }) { - super(provider); - this.prefix = prefix; - errors.assertArgument(signingKey && typeof signingKey.sign === "function", "invalid signingKey key", "signingKey", "[ REDACTED ]"); - this.#signingKey = signingKey; - const address$1 = address.computeAddress(this.#signingKey, prefix); - properties.defineProperties(this, { address: address$1 }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { - return this.#signingKey; - } - /** - * The private key for this wallet. - */ - get privateKey() { - return this.signingKey.privateKey; - } - async getAddress() { - return this.address; - } - connect(provider) { - return new BaseWallet({ - signingKey: this.#signingKey, - prefix: this.prefix, - provider, - }); - } - async signTransaction(tx) { - // Replace any Addressable or ENS name with an address - const { to, from } = await properties.resolveProperties({ - to: tx.to || undefined, - from: tx.from || undefined, - }); - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - errors.assertArgument(index.getAddress(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - // Build the transaction - const btx = transaction.Transaction.from(tx); - const unSignedSerialized = btx.unsignedSerialized; - const unsignedHash = sha3.sha256(unSignedSerialized); - // sha256(btx.unsignedSerialized) - btx.signature = this.signingKey.sign(unsignedHash); - return btx.serialized; - } - async signMessage(message) { - return this.signMessageSync(message); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message$1) { - return this.signingKey.sign(message.hashMessage(message$1)); - } - async signTypedData(domain, types, value) { - // Populate any ENS names - const populated = await typedData.TypedDataEncoder.resolveNames(domain, types, value, async (name) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - errors.assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name }, - }); - const address = index.getAddress(name); - errors.assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name, - }); - return address; - }); - return this.signingKey.sign(typedData.TypedDataEncoder.hash(populated.domain, types, populated.value)); - } -} - -exports.BaseWallet = BaseWallet; -//# sourceMappingURL=base-wallet.js.map diff --git a/lib.commonjs/wallet/base-wallet.js.map b/lib.commonjs/wallet/base-wallet.js.map deleted file mode 100644 index 77e7e19e5..000000000 --- a/lib.commonjs/wallet/base-wallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-wallet.js","sources":["../../lib.esm/wallet/base-wallet.js"],"sourcesContent":["import { getAddress } from \"../address/index.js\";\nimport { hashMessage, TypedDataEncoder } from \"../hash/index.js\";\nimport { AbstractSigner } from \"../providers/index.js\";\nimport { computeAddress, Transaction } from \"../transaction/index.js\";\nimport { defineProperties, resolveProperties, assert, assertArgument, } from \"../utils/index.js\";\nimport { sha256 } from \"../crypto/index.js\";\n/**\n * The **BaseWallet** is a stream-lined implementation of a\n * [[Signer]] that operates with a private key.\n *\n * It is preferred to use the [[Wallet]] class, as it offers\n * additional functionality and simplifies loading a variety\n * of JSON formats, Mnemonic Phrases, etc.\n *\n * This class may be of use for those attempting to implement\n * a minimal Signer.\n */\nexport class BaseWallet extends AbstractSigner {\n /**\n * The wallet address.\n */\n address;\n prefix;\n #signingKey;\n /**\n * Creates a new BaseWallet for %%privateKey%%, optionally\n * connected to %%provider%%.\n *\n * If %%provider%% is not specified, only offline methods can\n * be used.\n */\n constructor({ signingKey, prefix, provider, }) {\n super(provider);\n this.prefix = prefix;\n assertArgument(signingKey && typeof signingKey.sign === \"function\", \"invalid signingKey key\", \"signingKey\", \"[ REDACTED ]\");\n this.#signingKey = signingKey;\n const address = computeAddress(this.#signingKey, prefix);\n defineProperties(this, { address });\n }\n // Store private values behind getters to reduce visibility\n // in console.log\n /**\n * The [[SigningKey]] used for signing payloads.\n */\n get signingKey() {\n return this.#signingKey;\n }\n /**\n * The private key for this wallet.\n */\n get privateKey() {\n return this.signingKey.privateKey;\n }\n async getAddress() {\n return this.address;\n }\n connect(provider) {\n return new BaseWallet({\n signingKey: this.#signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n async signTransaction(tx) {\n // Replace any Addressable or ENS name with an address\n const { to, from } = await resolveProperties({\n to: tx.to || undefined,\n from: tx.from || undefined,\n });\n if (to != null) {\n tx.to = to;\n }\n if (from != null) {\n tx.from = from;\n }\n if (tx.from != null) {\n assertArgument(getAddress(tx.from) === this.address, \"transaction from address mismatch\", \"tx.from\", tx.from);\n delete tx.from;\n }\n // Build the transaction\n const btx = Transaction.from(tx);\n const unSignedSerialized = btx.unsignedSerialized;\n const unsignedHash = sha256(unSignedSerialized);\n // sha256(btx.unsignedSerialized)\n btx.signature = this.signingKey.sign(unsignedHash);\n return btx.serialized;\n }\n async signMessage(message) {\n return this.signMessageSync(message);\n }\n // @TODO: Add a secialized signTx and signTyped sync that enforces\n // all parameters are known?\n /**\n * Returns the signature for %%message%% signed with this wallet.\n */\n signMessageSync(message) {\n return this.signingKey.sign(hashMessage(message));\n }\n async signTypedData(domain, types, value) {\n // Populate any ENS names\n const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => {\n // @TODO: this should use resolveName; addresses don't\n // need a provider\n assert(this.provider != null, \"cannot resolve ENS names without a provider\", \"UNSUPPORTED_OPERATION\", {\n operation: \"resolveName\",\n info: { name },\n });\n const address = getAddress(name);\n assert(address != null, \"unconfigured ENS name\", \"UNCONFIGURED_NAME\", {\n value: name,\n });\n return address;\n });\n return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value));\n }\n}\n//# sourceMappingURL=base-wallet.js.map"],"names":["AbstractSigner","assertArgument","address","computeAddress","defineProperties","resolveProperties","getAddress","Transaction","sha256","message","hashMessage","TypedDataEncoder","assert"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,UAAU,SAASA,6BAAc,CAAC;AAC/C;AACA;AACA;AACA,IAAI,OAAO;AACX,IAAI,MAAM;AACV,IAAI,WAAW;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,GAAG,EAAE;AACnD,QAAQ,KAAK,CAAC,QAAQ,CAAC;AACvB,QAAQ,IAAI,CAAC,MAAM,GAAG,MAAM;AAC5B,QAAQC,qBAAc,CAAC,UAAU,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,UAAU,EAAE,wBAAwB,EAAE,YAAY,EAAE,cAAc,CAAC;AACnI,QAAQ,IAAI,CAAC,WAAW,GAAG,UAAU;AACrC,QAAQ,MAAMC,SAAO,GAAGC,sBAAc,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;AAChE,QAAQC,2BAAgB,CAAC,IAAI,EAAE,WAAEF,SAAO,EAAE,CAAC;AAC3C,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,WAAW;AAC/B,IAAI;AACJ;AACA;AACA;AACA,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU;AACzC,IAAI;AACJ,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,IAAI,CAAC,OAAO;AAC3B,IAAI;AACJ,IAAI,OAAO,CAAC,QAAQ,EAAE;AACtB,QAAQ,OAAO,IAAI,UAAU,CAAC;AAC9B,YAAY,UAAU,EAAE,IAAI,CAAC,WAAW;AACxC,YAAY,M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A;AACA;AACA;AACA,IAAI,eAAe,CAACC,SAAO,EAAE;AAC7B,QAAQ,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAACC,mBAAW,CAACD,SAAO,CAAC,CAAC;AACzD,IAAI;AACJ,IAAI,MAAM,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;AAC9C;AACA,QAAQ,MAAM,SAAS,GAAG,MAAME,0BAAgB,CAAC,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,KAAK;AACpG;AACA;AACA,YAAYC,aAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE,6CAA6C,EAAE,uBAAuB,EAAE;AAClH,gBAAgB,SAAS,EAAE,aAAa;AACxC,gBAAgB,IAAI,EAAE,EAAE,IAAI,EAAE;AAC9B,aAAa,CAAC;AACd,YAAY,MAAM,OAAO,GAAGN,gBAAU,CAAC,IAAI,CAAC;AAC5C,YAAYM,aAAM,CAAC,OAAO,IAAI,IAAI,EAAE,uBAAuB,EAAE,mBAAmB,EAAE;AAClF,gBAAgB,KAAK,EAAE,IAAI;AAC3B,aAAa,CAAC;AACd,YAAY,OAAO,OAAO;AAC1B,QAAQ,CAAC,CAAC;AACV,QAAQ,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAACD,0BAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;AACpG,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/english_words.d.ts b/lib.commonjs/wallet/english_words.d.ts deleted file mode 100644 index fec60c704..000000000 --- a/lib.commonjs/wallet/english_words.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const englishWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=english_words.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/english_words.d.ts.map b/lib.commonjs/wallet/english_words.d.ts.map deleted file mode 100644 index b0bd73fa9..000000000 --- a/lib.commonjs/wallet/english_words.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"english_words.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,i0VACsyV,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wallet/english_words.js b/lib.commonjs/wallet/english_words.js deleted file mode 100644 index bef513a7d..000000000 --- a/lib.commonjs/wallet/english_words.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -const englishWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; - -exports.englishWords = englishWords; -//# sourceMappingURL=english_words.js.map diff --git a/lib.commonjs/wallet/english_words.js.map b/lib.commonjs/wallet/english_words.js.map deleted file mode 100644 index 8e1a05059..000000000 --- a/lib.commonjs/wallet/english_words.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"english_words.js","sources":["../../lib.esm/wallet/english_words.js"],"sourcesContent":["export const englishWords = \"AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo\";\n//# sourceMappingURL=english_words.js.map"],"names":[],"mappings":";;AAAY,MAAC,YAAY,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/hdwallet.d.ts b/lib.commonjs/wallet/hdwallet.d.ts deleted file mode 100644 index 7c96fb8a0..000000000 --- a/lib.commonjs/wallet/hdwallet.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -import { SigningKey } from "../crypto/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { Mnemonic } from "./mnemonic.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -import type { Numeric } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -export declare const defaultPath: string; -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -export declare class HDNodeWallet extends BaseWallet { - #private; - /** - * The compressed public key. - */ - readonly publicKey: string; - prefix: string; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint: string; - /** - * The parent fingerprint. - */ - readonly parentFingerprint: string; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - readonly mnemonic: null | Mnemonic; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - readonly path: null | string; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index: number; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth: number; - /** - * @private - */ - constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }: { - guard: any; - seed: string; - signingKey: SigningKey; - parentFingerprint: string; - path: null | string; - index: number; - depth: number; - mnemonic: null | Mnemonic; - provider: null | Provider; - prefix: string; - }); - connect(provider: null | Provider): HDNodeWallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { - path: string; - }; - /** - * Return the child for %%index%%. - */ - deriveChild(_index: number): HDNodeWallet; - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path: string): HDNodeWallet; - /** - * Creates a new random HDNode. - */ - static createRandom(prefix: string, password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet; - /** - * Create am HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic: Mnemonic, prefix: string, path?: string): HDNodeWallet; - static mnemonicToSeed(mnemonic: string, password?: string): string; - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase({ phrase, prefix, password, path, wordlist, }: { - phrase: string; - prefix: string; - password?: string; - path?: string; - wordlist?: Wordlist; - }): HDNodeWallet; - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed({ seed, prefix, path, }: { - seed: string; - prefix: string; - path?: string; - }): HDNodeWallet; -} -/** - * Returns the [[link-bip-32]] path for the acount at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -export declare function getAccountPath(_index: Numeric): string; -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -export declare function getIndexedAccountPath(_index: Numeric): string; -//# sourceMappingURL=hdwallet.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/hdwallet.d.ts.map b/lib.commonjs/wallet/hdwallet.d.ts.map deleted file mode 100644 index 6ff875955..000000000 --- a/lib.commonjs/wallet/hdwallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hdwallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAA0B,UAAU,EAAU,MAAM,oBAAoB,CAAC;AAUhF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,Q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AM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,YAAY,CAOf;CACD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAStD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAS7D"} \ No newline at end of file diff --git a/lib.commonjs/wallet/hdwallet.js b/lib.commonjs/wallet/hdwallet.js deleted file mode 100644 index 96a7900c5..000000000 --- a/lib.commonjs/wallet/hdwallet.js +++ /dev/null @@ -1,392 +0,0 @@ -'use strict'; - -require('../crypto/hmac.js'); -var ripemd160 = require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -var random = require('../crypto/random.js'); -require('../crypto/scrypt.js'); -var sha3 = require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -var ed448goldilock = require('../crypto/ed448goldilock.js'); -require('crypto'); -require('../crypto/keccak.js'); -var signingKey = require('../crypto/signing-key.js'); -require('../crypto/signature.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -var maths = require('../utils/maths.js'); -var langEn = require('../wordlists/lang-en.js'); -var baseWallet = require('./base-wallet.js'); -var mnemonic = require('./mnemonic.js'); -var jsonKeystore = require('./json-keystore.js'); -var mnemonicToSeed = require('./mnemonicToSeed.js'); - -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -// import { arrayify, -// // hexDataSlice -// } from "../utils/data.js"; -// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array { -// const p = getBytes(password); -// const s = getBytes(salt); -// return getBytes(pbkdf2(p, s, 2048, 57, "sha512")); -// } -/** - * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -const defaultPath = "m"; -// "Bitcoin seed" -// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); -const HardenedBit = 0x80000000; -// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array { -// b = getBytes(concat([b.slice(0, 53), "0x00000000"])); -// b[0] &= 0xfc; -// const c = new Uint8Array(57); -// let hold = 0; -// for (let i = 0; i < 57; i++) { -// hold += a[i] + b[i]; -// c[i] = hold % 256; -// hold = Math.floor(hold / 256); -// } -// return c; -// }; -const _guard = {}; -function derivePath(node, path) { - const components = path.split("/"); - errors.assertArgument(components.length > 0 && (components[0] === "m" || node.depth > 0), "invalid path", "path", path); - if (components[0] === "m") { - components.shift(); - } - let result = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - errors.assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(HardenedBit + index); - } - else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - errors.assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(index); - } - else { - errors.assertArgument(false, "invalid path component", `path[${i}]`, component); - } - } - return result; -} -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -class HDNodeWallet extends baseWallet.BaseWallet { - /** - * The compressed public key. - */ - publicKey; - prefix; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent fingerprint. - */ - parentFingerprint; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - mnemonic; - #seed; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) { - super({ - signingKey, - prefix, - provider, - }); - errors.assertPrivate(guard, _guard, "HDNodeWallet"); - properties.defineProperties(this, { publicKey: signingKey.publicKey }); - this.prefix = prefix; - this.#seed = seed; - const fingerprint = data.dataSlice(ripemd160.ripemd160(sha3.sha256(this.publicKey)), 0, 4); - properties.defineProperties(this, { - parentFingerprint, - fingerprint, - path, - index, - depth, - }); - properties.defineProperties(this, { mnemonic }); - } - connect(provider) { - return new HDNodeWallet({ - guard: _guard, - signingKey: this.signingKey, - parentFingerprint: this.parentFingerprint, - path: this.path, - index: this.index, - depth: this.depth, - seed: this.#seed, - mnemonic: this.mnemonic, - provider, - prefix: this.prefix, - }); - } - #account() { - const account = { - address: this.address, - privateKey: this.privateKey, - }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy, - }; - } - return account; - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await jsonKeystore.encryptKeystoreJson(this.#account(), password, { - progressCallback, - }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return jsonKeystore.encryptKeystoreJsonSync(this.#account(), password); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { - return this.path != null; - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const newPrivateKey = ed448goldilock.Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index)); - const newSigningKey = new signingKey.SigningKey(newPrivateKey); - // Base path - let path = this.path; - if (path) { - path += "/" + (_index & ~HardenedBit); - if (_index & HardenedBit) { - path += "'"; - } - } - return new HDNodeWallet({ - guard: _guard, - signingKey: newSigningKey, - parentFingerprint: this.fingerprint, - path, - index: _index, - seed: this.#seed, - depth: this.depth + 1, - mnemonic: this.mnemonic, - provider: this.provider, - prefix: this.prefix, - }); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - static #fromSeed({ _seed, mnemonic, prefix, path, }) { - const extendetPrivateKey = ed448goldilock.Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0); - const signingKey$1 = new signingKey.SigningKey(extendetPrivateKey); - // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length }) - return new HDNodeWallet({ - seed: _seed, - guard: _guard, - signingKey: signingKey$1, - parentFingerprint: "0x00000000", - path: path || defaultPath, - index: 0, - depth: 0, - mnemonic, - provider: null, - prefix, - }); - } - /** - * Creates a new random HDNode. - */ - static createRandom(prefix, password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = langEn.LangEn.wordlist(); - } - const mnemonic$1 = mnemonic.Mnemonic.fromEntropy(random.randomBytes(32), password, wordlist); - return HDNodeWallet.#fromSeed({ - _seed: mnemonic$1.computeSeed(), - mnemonic: mnemonic$1, - prefix, - }).derivePath(path); - } - /** - * Create am HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, prefix, path) { - if (!path) { - path = defaultPath; - } - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - static mnemonicToSeed(mnemonic, password) { - const seed = mnemonicToSeed.mnemonicToSeed(mnemonic, password); - return seed; - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase({ phrase, prefix, password, path, wordlist, }) { - if (!password) { - password = ""; - } - if (!path) { - path = defaultPath; - } - if (!wordlist) { - wordlist = langEn.LangEn.wordlist(); - } - const mnemonic$1 = mnemonic.Mnemonic.fromPhrase({ phrase, password, wordlist }); - const _seed = mnemonic$1.computeSeed(); - return HDNodeWallet.#fromSeed({ - _seed, - mnemonic: mnemonic$1, - prefix, - }).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed({ seed, prefix, path, }) { - return HDNodeWallet.#fromSeed({ - _seed: seed, - mnemonic: null, - path: path || defaultPath, - prefix, - }); - } -} -/* -export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } -} -*/ -/** - * Returns the [[link-bip-32]] path for the acount at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -function getAccountPath(_index) { - const index = maths.getNumber(_index, "index"); - errors.assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${index}'/0/0`; -} -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -function getIndexedAccountPath(_index) { - const index = maths.getNumber(_index, "index"); - errors.assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${index}`; -} - -exports.HDNodeWallet = HDNodeWallet; -exports.defaultPath = defaultPath; -exports.getAccountPath = getAccountPath; -exports.getIndexedAccountPath = getIndexedAccountPath; -//# sourceMappingURL=hdwallet.js.map diff --git a/lib.commonjs/wallet/hdwallet.js.map b/lib.commonjs/wallet/hdwallet.js.map deleted file mode 100644 index 5f1d3e330..000000000 --- a/lib.commonjs/wallet/hdwallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hdwallet.js","sources":["../../lib.esm/wallet/hdwallet.js"],"sourcesContent":["/**\n * Explain HD Wallets..\n *\n * @_subsection: api/wallet:HD Wallets [hd-wallets]\n */\nimport { randomBytes, ripemd160, SigningKey, sha256 } from \"../crypto/index.js\";\nimport { dataSlice, defineProperties, getNumber, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { encryptKeystoreJson, encryptKeystoreJsonSync, } from \"./json-keystore.js\";\nimport { Ed448Goldilock } from \"../crypto/crypto.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// import { arrayify,\n// // hexDataSlice\n// } from \"../utils/data.js\";\n// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array {\n// const p = getBytes(password);\n// const s = getBytes(salt);\n// return getBytes(pbkdf2(p, s, 2048, 57, \"sha512\"));\n// }\n/**\n * The default derivation path for Core HD Nodes. (i.e. ``\"m/44'/60'/0'/0/0\"``)\n */\nexport const defaultPath = \"m\";\n// \"Bitcoin seed\"\n// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]);\nconst HardenedBit = 0x80000000;\n// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array {\n// b = getBytes(concat([b.slice(0, 53), \"0x00000000\"]));\n// b[0] &= 0xfc;\n// const c = new Uint8Array(57);\n// let hold = 0;\n// for (let i = 0; i < 57; i++) {\n// hold += a[i] + b[i];\n// c[i] = hold % 256;\n// hold = Math.floor(hold / 256);\n// }\n// return c;\n// };\nconst _guard = {};\nfunction derivePath(node, path) {\n const components = path.split(\"/\");\n assertArgument(components.length > 0 && (components[0] === \"m\" || node.depth > 0), \"invalid path\", \"path\", path);\n if (components[0] === \"m\") {\n components.shift();\n }\n let result = node;\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n if (component.match(/^[0-9]+'$/)) {\n const index = parseInt(component.substring(0, component.length - 1));\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(HardenedBit + index);\n }\n else if (component.match(/^[0-9]+$/)) {\n const index = parseInt(component);\n assertArgument(index < HardenedBit, \"invalid path index\", `path[${i}]`, component);\n result = result.deriveChild(index);\n }\n else {\n assertArgument(false, \"invalid path component\", `path[${i}]`, component);\n }\n }\n return result;\n}\n/**\n * An **HDNodeWallet** is a [[Signer]] backed by the private key derived\n * from an HD Node using the [[link-bip-32]] stantard.\n *\n * An HD Node forms a hierarchal structure with each HD Node having a\n * private key and the ability to derive child HD Nodes, defined by\n * a path indicating the index of each child.\n */\nexport class HDNodeWallet extends BaseWallet {\n /**\n * The compressed public key.\n */\n publicKey;\n prefix;\n /**\n * The fingerprint.\n *\n * A fingerprint allows quick qay to detect parent and child nodes,\n * but developers should be prepared to deal with collisions as it\n * is only 4 bytes.\n */\n fingerprint;\n /**\n * The parent fingerprint.\n */\n parentFingerprint;\n /**\n * The mnemonic used to create this HD Node, if available.\n *\n * Sources such as extended keys do not encode the mnemonic, in\n * which case this will be ``null``.\n */\n mnemonic;\n #seed;\n /**\n * The derivation path of this wallet.\n *\n * Since extended keys do not provider full path details, this\n * may be ``null``, if instantiated from a source that does not\n * enocde it.\n */\n path;\n /**\n * The child index of this wallet. Values over ``2 *\\* 31`` indicate\n * the node is hardened.\n */\n index;\n /**\n * The depth of this wallet, which is the number of components\n * in its path.\n */\n depth;\n /**\n * @private\n */\n constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) {\n super({\n signingKey,\n prefix,\n provider,\n });\n assertPrivate(guard, _guard, \"HDNodeWallet\");\n defineProperties(this, { publicKey: signingKey.publicKey });\n this.prefix = prefix;\n this.#seed = seed;\n const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4);\n defineProperties(this, {\n parentFingerprint,\n fingerprint,\n path,\n index,\n depth,\n });\n defineProperties(this, { mnemonic });\n }\n connect(provider) {\n return new HDNodeWallet({\n guard: _guard,\n signingKey: this.signingKey,\n parentFingerprint: this.parentFingerprint,\n path: this.path,\n index: this.index,\n depth: this.depth,\n seed: this.#seed,\n mnemonic: this.mnemonic,\n provider,\n prefix: this.prefix,\n });\n }\n #account() {\n const account = {\n address: this.address,\n privateKey: this.privateKey,\n };\n const m = this.mnemonic;\n if (this.path && m && m.wordlist.locale === \"en\" && m.password === \"\") {\n account.mnemonic = {\n path: this.path,\n locale: \"en\",\n entropy: m.entropy,\n };\n }\n return account;\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n return await encryptKeystoreJson(this.#account(), password, {\n progressCallback,\n });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n return encryptKeystoreJsonSync(this.#account(), password);\n }\n /**\n * Returns true if this wallet has a path, providing a Type Guard\n * that the path is non-null.\n */\n hasPath() {\n return this.path != null;\n }\n /**\n * Return the child for %%index%%.\n */\n deriveChild(_index) {\n const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index));\n const newSigningKey = new SigningKey(newPrivateKey);\n // Base path\n let path = this.path;\n if (path) {\n path += \"/\" + (_index & ~HardenedBit);\n if (_index & HardenedBit) {\n path += \"'\";\n }\n }\n return new HDNodeWallet({\n guard: _guard,\n signingKey: newSigningKey,\n parentFingerprint: this.fingerprint,\n path,\n index: _index,\n seed: this.#seed,\n depth: this.depth + 1,\n mnemonic: this.mnemonic,\n provider: this.provider,\n prefix: this.prefix,\n });\n }\n /**\n * Return the HDNode for %%path%% from this node.\n */\n derivePath(path) {\n return derivePath(this, path);\n }\n static #fromSeed({ _seed, mnemonic, prefix, path, }) {\n const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0);\n const signingKey = new SigningKey(extendetPrivateKey);\n // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length })\n return new HDNodeWallet({\n seed: _seed,\n guard: _guard,\n signingKey,\n parentFingerprint: \"0x00000000\",\n path: path || defaultPath,\n index: 0,\n depth: 0,\n mnemonic,\n provider: null,\n prefix,\n });\n }\n /**\n * Creates a new random HDNode.\n */\n static createRandom(prefix, password, path, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (path == null) {\n path = defaultPath;\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist);\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Create am HD Node from %%mnemonic%%.\n */\n static fromMnemonic(mnemonic, prefix, path) {\n if (!path) {\n path = defaultPath;\n }\n return HDNodeWallet.#fromSeed({\n _seed: mnemonic.computeSeed(),\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n static mnemonicToSeed(mnemonic, password) {\n const seed = mnemonicToSeed(mnemonic, password);\n return seed;\n }\n /**\n * Creates an HD Node from a mnemonic %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, password, path, wordlist, }) {\n if (!password) {\n password = \"\";\n }\n if (!path) {\n path = defaultPath;\n }\n if (!wordlist) {\n wordlist = LangEn.wordlist();\n }\n const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist });\n const _seed = mnemonic.computeSeed();\n return HDNodeWallet.#fromSeed({\n _seed,\n mnemonic,\n prefix,\n }).derivePath(path);\n }\n /**\n * Creates an HD Node from a %%seed%%.\n */\n static fromSeed({ seed, prefix, path, }) {\n return HDNodeWallet.#fromSeed({\n _seed: seed,\n mnemonic: null,\n path: path || defaultPath,\n prefix,\n });\n }\n}\n/*\nexport class HDNodeWalletManager {\n #root: HDNodeWallet;\n\n constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) {\n if (password == null) { password = \"\"; }\n if (path == null) { path = \"m/44'/60'/0'/0\"; }\n if (locale == null) { locale = LangEn.wordlist(); }\n this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale);\n }\n\n getSigner(index?: number): HDNodeWallet {\n return this.#root.deriveChild((index == null) ? 0: index);\n }\n}\n*/\n/**\n * Returns the [[link-bip-32]] path for the acount at %%index%%.\n *\n * This is the pattern used by wallets like Ledger.\n *\n * There is also an [alternate pattern](getIndexedAccountPath) used by\n * some software.\n */\nexport function getAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/${index}'/0/0`;\n}\n/**\n * Returns the path using an alternative pattern for deriving accounts,\n * at %%index%%.\n *\n * This derivation path uses the //index// component rather than the\n * //account// component to derive sequential accounts.\n *\n * This is the pattern used by wallets like MetaMask.\n */\nexport function getIndexedAccountPath(_index) {\n const index = getNumber(_index, \"index\");\n assertArgument(index >= 0 && index < HardenedBit, \"invalid account index\", \"index\", index);\n return `m/44'/60'/0'/0/${index}`;\n}\n//# sourceMappingURL=hdwallet.js.map"],"names":["assertArgument","BaseWallet","assertPrivate","defineProperties","dataSlice","ripemd160","sha256","encryptKeystoreJson","encryptKeystoreJsonSync","Ed448Goldilock","SigningKey","signingKey","LangEn","mnemonic","Mnemon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;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,MAAM,EAAE;AACvC,IAAI,MAAM,KAAK,GAAGI,eAAS,CAAC,MAAM,EAAE,OAAO,CAAC;AAC5C,IAAIjB,qBAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,KAAK,CAAC;AAC9F,IAAI,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,qBAAqB,CAAC,MAAM,EAAE;AAC9C,IAAI,MAAM,KAAK,GAAGiB,eAAS,CAAC,MAAM,EAAE,OAAO,CAAC;AAC5C,IAAIjB,qBAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EAAE,uBAAuB,EAAE,OAAO,EAAE,KAAK,CAAC;AAC9F,IAAI,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;AACpC;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/index.d.ts b/lib.commonjs/wallet/index.d.ts deleted file mode 100644 index d3db8f37c..000000000 --- a/lib.commonjs/wallet/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * When interacting with Core, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ -export { BaseWallet } from "./base-wallet.js"; -export { defaultPath, getAccountPath, getIndexedAccountPath, HDNodeWallet, } from "./hdwallet.js"; -export { isCrowdsaleJson, decryptCrowdsaleJson } from "./json-crowdsale.js"; -export { isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./json-keystore.js"; -export { Mnemonic } from "./mnemonic.js"; -export { Wallet } from "./wallet.js"; -export type { CrowdsaleAccount } from "./json-crowdsale.js"; -export type { KeystoreAccount, EncryptOptions } from "./json-keystore.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/index.d.ts.map b/lib.commonjs/wallet/index.d.ts.map deleted file mode 100644 index f380a0adc..000000000 --- a/lib.commonjs/wallet/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wallet/index.js b/lib.commonjs/wallet/index.js deleted file mode 100644 index 5010e79fb..000000000 --- a/lib.commonjs/wallet/index.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict'; - -var baseWallet = require('./base-wallet.js'); -var hdwallet = require('./hdwallet.js'); -var jsonCrowdsale = require('./json-crowdsale.js'); -var jsonKeystore = require('./json-keystore.js'); -var mnemonic = require('./mnemonic.js'); -var wallet = require('./wallet.js'); - - - -exports.BaseWallet = baseWallet.BaseWallet; -exports.HDNodeWallet = hdwallet.HDNodeWallet; -exports.defaultPath = hdwallet.defaultPath; -exports.getAccountPath = hdwallet.getAccountPath; -exports.getIndexedAccountPath = hdwallet.getIndexedAccountPath; -exports.decryptCrowdsaleJson = jsonCrowdsale.decryptCrowdsaleJson; -exports.isCrowdsaleJson = jsonCrowdsale.isCrowdsaleJson; -exports.decryptKeystoreJson = jsonKeystore.decryptKeystoreJson; -exports.decryptKeystoreJsonSync = jsonKeystore.decryptKeystoreJsonSync; -exports.encryptKeystoreJson = jsonKeystore.encryptKeystoreJson; -exports.encryptKeystoreJsonSync = jsonKeystore.encryptKeystoreJsonSync; -exports.isKeystoreJson = jsonKeystore.isKeystoreJson; -exports.Mnemonic = mnemonic.Mnemonic; -exports.Wallet = wallet.Wallet; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/wallet/index.js.map b/lib.commonjs/wallet/index.js.map deleted file mode 100644 index cea46236a..000000000 --- a/lib.commonjs/wallet/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/json-crowdsale.d.ts b/lib.commonjs/wallet/json-crowdsale.d.ts deleted file mode 100644 index 65b5f0251..000000000 --- a/lib.commonjs/wallet/json-crowdsale.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * The data stored within a JSON Crowdsale wallet is fairly - * minimal. - */ -export type CrowdsaleAccount = { - privateKey: string; - address: string; -}; -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -export declare function isCrowdsaleJson(json: string): boolean; -/** - * Before Core launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive xcb - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -export declare function decryptCrowdsaleJson(json: string, _password: string | Uint8Array): CrowdsaleAccount; -//# sourceMappingURL=json-crowdsale.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/json-crowdsale.d.ts.map b/lib.commonjs/wallet/json-crowdsale.d.ts.map deleted file mode 100644 index db8057554..000000000 --- a/lib.commonjs/wallet/json-crowdsale.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,gBAAgB,CAmClB"} \ No newline at end of file diff --git a/lib.commonjs/wallet/json-crowdsale.js b/lib.commonjs/wallet/json-crowdsale.js deleted file mode 100644 index 0f3e1b48c..000000000 --- a/lib.commonjs/wallet/json-crowdsale.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - -var pkg = require('aes-js'); -var index = require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -var pbkdf2 = require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../crypto/signature.js'); -var id = require('../hash/id.js'); -require('../constants/numbers.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -var utils = require('./utils.js'); - -/** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -// @ts-ignore -const { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg; -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -function isCrowdsaleJson(json) { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } - catch (error) { } - return false; -} -/** - * Before Core launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive xcb - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -function decryptCrowdsaleJson(json, _password) { - const data$1 = JSON.parse(json); - const password = utils.getPassword(_password); - // Core Address - const address = index.getAddress(utils.spelunk(data$1, "ethaddr:string!")); - // Encrypted Seed - const encseed = utils.looseArrayify(utils.spelunk(data$1, "encseed:string!")); - errors.assertArgument(encseed && encseed.length % 16 === 0, "invalid encseed", "json", json); - const key = data.getBytes(pbkdf2.pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(data.getBytes(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - return { address, privateKey: id.id(seedHex) }; -} - -exports.decryptCrowdsaleJson = decryptCrowdsaleJson; -exports.isCrowdsaleJson = isCrowdsaleJson; -//# sourceMappingURL=json-crowdsale.js.map diff --git a/lib.commonjs/wallet/json-crowdsale.js.map b/lib.commonjs/wallet/json-crowdsale.js.map deleted file mode 100644 index b16e7b32a..000000000 --- a/lib.commonjs/wallet/json-crowdsale.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-crowdsale.js","sources":["../../lib.esm/wallet/json-crowdsale.js"],"sourcesContent":["/**\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2 } from \"../crypto/index.js\";\nimport { id } from \"../hash/index.js\";\nimport { getBytes, assertArgument } from \"../utils/index.js\";\nimport { getPassword, looseArrayify, spelunk } from \"./utils.js\";\n/**\n * Returns true if %%json%% is a valid JSON Crowdsale wallet.\n */\nexport function isCrowdsaleJson(json) {\n try {\n const data = JSON.parse(json);\n if (data.encseed) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\n/**\n * Before Core launched, it was necessary to create a wallet\n * format for backers to use, which would be used to receive xcb\n * as a reward for contributing to the project.\n *\n * The [[link-crowdsale]] format is now obsolete, but it is still\n * useful to support and the additional code is fairly trivial as\n * all the primitives required are used through core portions of\n * the library.\n */\nexport function decryptCrowdsaleJson(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n // Core Address\n const address = getAddress(spelunk(data, \"ethaddr:string!\"));\n // Encrypted Seed\n const encseed = looseArrayify(spelunk(data, \"encseed:string!\"));\n assertArgument(encseed && encseed.length % 16 === 0, \"invalid encseed\", \"json\", json);\n const key = getBytes(pbkdf2(password, password, 2000, 32, \"sha256\")).slice(0, 16);\n const iv = encseed.slice(0, 16);\n const encryptedSeed = encseed.slice(16);\n // Decrypt the seed\n const aesCbc = new CBC(key, iv);\n const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed)));\n // This wallet format is weird... Convert the binary encoded hex to a string.\n let seedHex = \"\";\n for (let i = 0; i < seed.length; i++) {\n seedHex += String.fromCharCode(seed[i]);\n }\n return { address, privateKey: id(seedHex) };\n}\n//# sourceMappingURL=json-crowdsale.js.map"],"names":["data","getPassword","getAddress","spelunk","looseArrayify","assertArgument","getBytes","pbkdf2","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AAEA,MAAM,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,GAAG,GAAG,GAAG;AAM1F;AACA;AACA;AACO,SAAS,eAAe,CAAC,IAAI,EAAE;AACtC,IAAI,IAAI;AACR,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AACrC,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE;AAC1B,YAAY,OAAO,IAAI;AACvB,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE,EAAE;AACpB,IAAI,OAAO,KAAK;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE;AACtD,IAAI,MAAMA,MAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AACjC,IAAI,MAAM,QAAQ,GAAGC,iBAAW,CAAC,SAAS,CAAC;AAC3C;AACA,IAAI,MAAM,OAAO,GAAGC,gBAAU,CAACC,aAAO,CAACH,MAAI,EAAE,iBAAiB,CAAC,CAAC;AAChE;AACA,IAAI,MAAM,OAAO,GAAGI,mBAAa,CAACD,aAAO,CAACH,MAAI,EAAE,iBAAiB,CAAC,CAAC;AACnE,IAAIK,qBAAc,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,EAAE,KAAK,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,IAAI,CAAC;AACzF,IAAI,MAAM,GAAG,GAAGC,aAAQ,CAACC,aAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AACrF,IAAI,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AACnC,IAAI,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;AAC3C;AACA,IAAI,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC;AACnC,IAAI,MAAM,IAAI,GAAG,UAAU,CAACD,aAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;AACpE;AACA,IAAI,IAAI,OAAO,GAAG,EAAE;AACpB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1C,QAAQ,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC/C,IAAI;AACJ,IAAI,OAAO,EAAE,OAAO,EAAE,UAAU,EAAEE,KAAE,CAAC,OAAO,CAAC,EAAE;AAC/C;;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/json-keystore.d.ts b/lib.commonjs/wallet/json-keystore.d.ts deleted file mode 100644 index 363fd7956..000000000 --- a/lib.commonjs/wallet/json-keystore.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { ProgressCallback } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * The contents of a JSON Keystore Wallet. - */ -export type KeystoreAccount = { - address: string; - privateKey: string; - mnemonic?: { - path?: string; - locale?: string; - entropy: string; - }; -}; -/** - * The parameters to use when encrypting a JSON Keystore Wallet. - */ -export type EncryptOptions = { - progressCallback?: ProgressCallback; - iv?: BytesLike; - entropy?: BytesLike; - client?: string; - salt?: BytesLike; - uuid?: string; - scrypt?: { - N?: number; - r?: number; - p?: number; - }; -}; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -export declare function isKeystoreJson(json: string): boolean; -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -export declare function decryptKeystoreJsonSync(json: string, _password: string | Uint8Array): KeystoreAccount; -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -export declare function decryptKeystoreJson(json: string, _password: string | Uint8Array, progress?: ProgressCallback): Promise; -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -export declare function encryptKeystoreJsonSync(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): string; -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -export declare function encryptKeystoreJson(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): Promise; -//# sourceMappingURL=json-keystore.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/json-keystore.d.ts.map b/lib.commonjs/wallet/json-keystore.d.ts.map deleted file mode 100644 index 742508cc1..000000000 --- a/lib.commonjs/wallet/json-keystore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,gBAAg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AAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,MAAM,CASR;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,MAAM,CAAC,CAiBjB"} \ No newline at end of file diff --git a/lib.commonjs/wallet/json-keystore.js b/lib.commonjs/wallet/json-keystore.js deleted file mode 100644 index bcd249090..000000000 --- a/lib.commonjs/wallet/json-keystore.js +++ /dev/null @@ -1,365 +0,0 @@ -'use strict'; - -var pkg = require('aes-js'); -var index = require('../address/index.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -var pbkdf2 = require('../crypto/pbkdf2.js'); -var random = require('../crypto/random.js'); -var scrypt = require('../crypto/scrypt.js'); -var sha3 = require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var uuid = require('../utils/uuid.js'); -require('../crypto/signature.js'); -var utils = require('./utils.js'); -var _version = require('../_version.js'); -var address = require('../transaction/address.js'); - -/** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Core along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -// @ts-ignore -const { Counter, ModeOfOperation: { ctr: CTR }, } = pkg; -const defaultPath = "m/44'/60'/0'/0/0"; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -function isKeystoreJson(json) { - try { - const data = JSON.parse(json); - const version = data.version != null ? parseInt(data.version) : 0; - if (version === 3) { - return true; - } - } - catch (error) { } - return false; -} -function decrypt(data$1, key, ciphertext) { - const cipher = utils.spelunk(data$1, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = utils.spelunk(data$1, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, new Counter(iv)); - return data.hexlify(aesCtr.decrypt(ciphertext)); - } - errors.assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt", - }); -} -function getAccount(data$1, _key) { - const key = data.getBytes(_key); - const ciphertext = utils.spelunk(data$1, "crypto.ciphertext:data!"); - const computedMAC = data.hexlify(sha3.sha256(data.concat([key.slice(16, 32), ciphertext]))).substring(2); - const expectedMAC = utils.spelunk(data$1, "crypto.mac:string!"); - let difference = 0; - const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC); - if (validMAC) { - const actual = data.getBytes("0x" + computedMAC); - const expected = data.getBytes("0x" + expectedMAC); - for (let i = 0; i < actual.length; i++) - difference |= actual[i] ^ expected[i]; - } - errors.assertArgument(validMAC && difference === 0, "incorrect password", "password", "[REDACTED]"); - const privateKey = decrypt(data$1, key.slice(0, 16), ciphertext); - const address$1 = index.getAddress(data$1.address); - const prefix = address.extractPrefix(address$1); - if (address.computeAddress(privateKey, prefix) !== address$1) { - throw new Error("address mismatch"); - } - if (data$1.address) { - let check = data$1.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - errors.assertArgument(index.getAddress(check) === address$1, "keystore address/privateKey mismatch", "address", data$1.address); - } - const account = { address: address$1, privateKey }; - // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase - const version = utils.spelunk(data$1, "x-corebc.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = utils.spelunk(data$1, "x-corebc.mnemonicCiphertext:data!"); - const mnemonicIv = utils.spelunk(data$1, "x-corebc.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); - account.mnemonic = { - path: utils.spelunk(data$1, "x-corebc.path:string") || defaultPath, - locale: utils.spelunk(data$1, "x-corebc.locale:string") || "en", - entropy: data.hexlify(data.getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))), - }; - } - return account; -} -// Match Core Web3Dart's wallet KDF resource limits. -function validateScrypt(N, r, p) { - errors.assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, "unsafe scrypt N", "kdf.N", N); - errors.assertArgument(Number.isSafeInteger(r) && - Number.isSafeInteger(p) && - r > 0 && - p > 0 && - r * p <= 1048576 && - 128 * N * r <= 256 * 1024 * 1024, "unsafe scrypt work or memory requirement", "kdf", { N, r, p }); -} -function getDecryptKdfParams(data) { - const kdf = utils.spelunk(data, "crypto.kdf:string"); - if (kdf && typeof kdf === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = utils.spelunk(data, "crypto.kdfparams.salt:data!"); - const N = utils.spelunk(data, "crypto.kdfparams.n:int!"); - const r = utils.spelunk(data, "crypto.kdfparams.r:int!"); - const p = utils.spelunk(data, "crypto.kdfparams.p:int!"); - validateScrypt(N, r, p); - const dkLen = utils.spelunk(data, "crypto.kdfparams.dklen:int!"); - errors.assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } - else if (kdf.toLowerCase() === "pbkdf2") { - const salt = utils.spelunk(data, "crypto.kdfparams.salt:data!"); - const prf = utils.spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - errors.assertArgument(prf === "hmac-sha256" || prf === "hmac-sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = utils.spelunk(data, "crypto.kdfparams.c:int!"); - errors.assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, "unsafe PBKDF2 iteration count", "kdf.c", count); - const dkLen = utils.spelunk(data, "crypto.kdfparams.dklen:int!"); - errors.assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { - name: "pbkdf2", - salt, - count, - dkLen, - algorithm: algorithm, - }; - } - } - errors.assertArgument(false, "unsupported key-derivation function", "kdf", kdf); -} -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -function decryptKeystoreJsonSync(json, _password) { - const data = JSON.parse(json); - const password = utils.getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2.pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - errors.assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = scrypt.scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); -} -function stall(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); -} -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -async function decryptKeystoreJson(json, _password, progress) { - const data = JSON.parse(json); - const password = utils.getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2.pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall(0); - } - return getAccount(data, key); - } - errors.assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = await scrypt.scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); -} -function getEncryptKdfParams(options) { - // Check/generate the salt - const salt = options.salt != null - ? data.getBytes(options.salt, "options.salt") - : random.randomBytes(32); - // Override the scrypt password-based key derivation function parameters - let N = 1 << 17, r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N != null) { - N = options.scrypt.N; - } - if (options.scrypt.r != null) { - r = options.scrypt.r; - } - if (options.scrypt.p != null) { - p = options.scrypt.p; - } - } - validateScrypt(N, r, p); - return { name: "scrypt", dkLen: 32, salt, N, r, p }; -} -function _encryptKeystore(key, kdf, account, options) { - const privateKey = data.getBytes(account.privateKey, "privateKey"); - // Override initialization vector - const iv = options.iv != null ? data.getBytes(options.iv, "options.iv") : random.randomBytes(16); - errors.assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - // Override the uuid - const uuidRandom = options.uuid != null - ? data.getBytes(options.uuid, "options.uuid") - : random.randomBytes(16); - errors.assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - // Encrypt the private key - const aesCtr = new CTR(derivedKey, new Counter(iv)); - const ciphertext = data.getBytes(aesCtr.encrypt(privateKey)); - // Compute the message authentication code, used to check the password - const mac = sha3.sha256(data.concat([macPrefix, ciphertext])); - const data$1 = { - address: account.address.substring(2).toLowerCase(), - id: uuid.uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: data.hexlify(iv).substring(2), - }, - ciphertext: data.hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: data.hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r, - }, - mac: mac.substring(2), - }, - }; - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = options.client != null ? options.client : `corebc/${_version.version}`; - const path = account.mnemonic.path || defaultPath; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key.slice(32, 64); - const entropy = data.getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = random.randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); - const mnemonicCiphertext = data.getBytes(mnemonicAesCtr.encrypt(entropy)); - const now = new Date(); - const timestamp = now.getUTCFullYear() + - "-" + - utils.zpad(now.getUTCMonth() + 1, 2) + - "-" + - utils.zpad(now.getUTCDate(), 2) + - "T" + - utils.zpad(now.getUTCHours(), 2) + - "-" + - utils.zpad(now.getUTCMinutes(), 2) + - "-" + - utils.zpad(now.getUTCSeconds(), 2) + - ".0Z"; - const gethFilename = "UTC--" + timestamp + "--" + data$1.address; - data$1["x-corebc"] = { - client, - gethFilename, - path, - locale, - mnemonicCounter: data.hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: data.hexlify(mnemonicCiphertext).substring(2), - version: "0.1", - }; - } - return JSON.stringify(data$1); -} -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = utils.getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scrypt.scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(data.getBytes(key), kdf, account, options); -} -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = utils.getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt.scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(data.getBytes(key), kdf, account, options); -} - -exports.decryptKeystoreJson = decryptKeystoreJson; -exports.decryptKeystoreJsonSync = decryptKeystoreJsonSync; -exports.encryptKeystoreJson = encryptKeystoreJson; -exports.encryptKeystoreJsonSync = encryptKeystoreJsonSync; -exports.isKeystoreJson = isKeystoreJson; -//# sourceMappingURL=json-keystore.js.map diff --git a/lib.commonjs/wallet/json-keystore.js.map b/lib.commonjs/wallet/json-keystore.js.map deleted file mode 100644 index 9e13218bd..000000000 --- a/lib.commonjs/wallet/json-keystore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-keystore.js","sources":["../../lib.esm/wallet/json-keystore.js"],"sourcesContent":["/**\n * The JSON Wallet formats allow a simple way to store the private\n * keys needed in Core along with related information and allows\n * for extensible forms of encryption.\n *\n * These utilities facilitate decrypting and encrypting the most common\n * JSON Wallet formats.\n *\n * @_subsection: api/wallet:JSON Wallets [json-wallets]\n */\n// @ts-ignore\nimport pkg from \"aes-js\";\nconst { Counter, ModeOfOperation: { ctr: CTR }, } = pkg;\nimport { getAddress } from \"../address/index.js\";\nimport { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from \"../crypto/index.js\";\nimport { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from \"../utils/index.js\";\nimport { getPassword, spelunk, zpad } from \"./utils.js\";\nimport { version } from \"../_version.js\";\nimport { computeAddress, extractPrefix } from \"../transaction/address.js\";\nconst defaultPath = \"m/44'/60'/0'/0/0\";\n/**\n * Returns true if %%json%% is a valid JSON Keystore Wallet.\n */\nexport function isKeystoreJson(json) {\n try {\n const data = JSON.parse(json);\n const version = data.version != null ? parseInt(data.version) : 0;\n if (version === 3) {\n return true;\n }\n }\n catch (error) { }\n return false;\n}\nfunction decrypt(data, key, ciphertext) {\n const cipher = spelunk(data, \"crypto.cipher:string\");\n if (cipher === \"aes-128-ctr\") {\n const iv = spelunk(data, \"crypto.cipherparams.iv:data!\");\n const aesCtr = new CTR(key, new Counter(iv));\n return hexlify(aesCtr.decrypt(ciphertext));\n }\n assert(false, \"unsupported cipher\", \"UNSUPPORTED_OPERATION\", {\n operation: \"decrypt\",\n });\n}\nfunction getAccount(data, _key) {\n const key = getBytes(_key);\n const ciphertext = spelunk(data, \"crypto.ciphertext:data!\");\n const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2);\n const expectedMAC = spelunk(data, \"crypto.mac:string!\");\n let difference = 0;\n const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC);\n if (validMAC) {\n const actual = getBytes(\"0x\" + computedMAC);\n const expected = getBytes(\"0x\" + expectedMAC);\n for (let i = 0; i < actual.length; i++)\n difference |= actual[i] ^ expected[i];\n }\n assertArgument(validMAC && difference === 0, \"incorrect password\", \"password\", \"[REDACTED]\");\n const privateKey = decrypt(data, key.slice(0, 16), ciphertext);\n const address = getAddress(data.address);\n const prefix = extractPrefix(address);\n if (computeAddress(privateKey, prefix) !== address) {\n throw new Error(\"address mismatch\");\n }\n if (data.address) {\n let check = data.address.toLowerCase();\n if (!check.startsWith(\"0x\")) {\n check = \"0x\" + check;\n }\n assertArgument(getAddress(check) === address, \"keystore address/privateKey mismatch\", \"address\", data.address);\n }\n const account = { address, privateKey };\n // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase\n const version = spelunk(data, \"x-corebc.version:string\");\n if (version === \"0.1\") {\n const mnemonicKey = key.slice(32, 64);\n const mnemonicCiphertext = spelunk(data, \"x-corebc.mnemonicCiphertext:data!\");\n const mnemonicIv = spelunk(data, \"x-corebc.mnemonicCounter:data!\");\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n account.mnemonic = {\n path: spelunk(data, \"x-corebc.path:string\") || defaultPath,\n locale: spelunk(data, \"x-corebc.locale:string\") || \"en\",\n entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))),\n };\n }\n return account;\n}\n// Match Core Web3Dart's wallet KDF resource limits.\nfunction validateScrypt(N, r, p) {\n assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, \"unsafe scrypt N\", \"kdf.N\", N);\n assertArgument(Number.isSafeInteger(r) &&\n Number.isSafeInteger(p) &&\n r > 0 &&\n p > 0 &&\n r * p <= 1048576 &&\n 128 * N * r <= 256 * 1024 * 1024, \"unsafe scrypt work or memory requirement\", \"kdf\", { N, r, p });\n}\nfunction getDecryptKdfParams(data) {\n const kdf = spelunk(data, \"crypto.kdf:string\");\n if (kdf && typeof kdf === \"string\") {\n if (kdf.toLowerCase() === \"scrypt\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const N = spelunk(data, \"crypto.kdfparams.n:int!\");\n const r = spelunk(data, \"crypto.kdfparams.r:int!\");\n const p = spelunk(data, \"crypto.kdfparams.p:int!\");\n validateScrypt(N, r, p);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dflen\", dkLen);\n return { name: \"scrypt\", salt, N, r, p, dkLen: 64 };\n }\n else if (kdf.toLowerCase() === \"pbkdf2\") {\n const salt = spelunk(data, \"crypto.kdfparams.salt:data!\");\n const prf = spelunk(data, \"crypto.kdfparams.prf:string!\");\n const algorithm = prf.split(\"-\").pop();\n assertArgument(prf === \"hmac-sha256\" || prf === \"hmac-sha512\", \"invalid kdf.pdf\", \"kdf.pdf\", prf);\n const count = spelunk(data, \"crypto.kdfparams.c:int!\");\n assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, \"unsafe PBKDF2 iteration count\", \"kdf.c\", count);\n const dkLen = spelunk(data, \"crypto.kdfparams.dklen:int!\");\n assertArgument(dkLen === 32, \"invalid kdf.dklen\", \"kdf.dklen\", dkLen);\n return {\n name: \"pbkdf2\",\n salt,\n count,\n dkLen,\n algorithm: algorithm,\n };\n }\n }\n assertArgument(false, \"unsupported key-derivation function\", \"kdf\", kdf);\n}\n/**\n * Returns the account details for the JSON Keystore Wallet %%json%%\n * using %%password%%.\n *\n * It is preferred to use the [async version](decryptKeystoreJson)\n * instead, which allows a [[ProgressCallback]] to keep the user informed\n * as to the decryption status.\n *\n * This method will block the event loop (freezing all UI) until decryption\n * is complete, which can take quite some time, depending on the wallet\n * paramters and platform.\n */\nexport function decryptKeystoreJsonSync(json, _password) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = scryptSync(password, salt, N, r, p, dkLen);\n return getAccount(data, key);\n}\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * Resolves to the decrypted JSON Keystore Wallet %%json%% using the\n * %%password%%.\n *\n * If provided, %%progress%% will be called periodically during the\n * decrpytion to provide feedback, and if the function returns\n * ``false`` will halt decryption.\n *\n * The %%progressCallback%% will **always** receive ``0`` before\n * decryption begins and ``1`` when complete.\n */\nexport async function decryptKeystoreJson(json, _password, progress) {\n const data = JSON.parse(json);\n const password = getPassword(_password);\n const params = getDecryptKdfParams(data);\n if (params.name === \"pbkdf2\") {\n if (progress) {\n progress(0);\n await stall(0);\n }\n const { salt, count, dkLen, algorithm } = params;\n const key = pbkdf2(password, salt, count, dkLen, algorithm);\n if (progress) {\n progress(1);\n await stall(0);\n }\n return getAccount(data, key);\n }\n assert(params.name === \"scrypt\", \"cannot be reached\", \"UNKNOWN_ERROR\", {\n params,\n });\n const { salt, N, r, p, dkLen } = params;\n const key = await scrypt(password, salt, N, r, p, dkLen, progress);\n return getAccount(data, key);\n}\nfunction getEncryptKdfParams(options) {\n // Check/generate the salt\n const salt = options.salt != null\n ? getBytes(options.salt, \"options.salt\")\n : randomBytes(32);\n // Override the scrypt password-based key derivation function parameters\n let N = 1 << 17, r = 8, p = 1;\n if (options.scrypt) {\n if (options.scrypt.N != null) {\n N = options.scrypt.N;\n }\n if (options.scrypt.r != null) {\n r = options.scrypt.r;\n }\n if (options.scrypt.p != null) {\n p = options.scrypt.p;\n }\n }\n validateScrypt(N, r, p);\n return { name: \"scrypt\", dkLen: 32, salt, N, r, p };\n}\nfunction _encryptKeystore(key, kdf, account, options) {\n const privateKey = getBytes(account.privateKey, \"privateKey\");\n // Override initialization vector\n const iv = options.iv != null ? getBytes(options.iv, \"options.iv\") : randomBytes(16);\n assertArgument(iv.length === 16, \"invalid options.iv length\", \"options.iv\", options.iv);\n // Override the uuid\n const uuidRandom = options.uuid != null\n ? getBytes(options.uuid, \"options.uuid\")\n : randomBytes(16);\n assertArgument(uuidRandom.length === 16, \"invalid options.uuid length\", \"options.uuid\", options.iv);\n // This will be used to encrypt the wallet (as per Web3 secret storage)\n // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix)\n // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet)\n const derivedKey = key.slice(0, 16);\n const macPrefix = key.slice(16, 32);\n // Encrypt the private key\n const aesCtr = new CTR(derivedKey, new Counter(iv));\n const ciphertext = getBytes(aesCtr.encrypt(privateKey));\n // Compute the message authentication code, used to check the password\n const mac = sha256(concat([macPrefix, ciphertext]));\n const data = {\n address: account.address.substring(2).toLowerCase(),\n id: uuidV4(uuidRandom),\n version: 3,\n Crypto: {\n cipher: \"aes-128-ctr\",\n cipherparams: {\n iv: hexlify(iv).substring(2),\n },\n ciphertext: hexlify(ciphertext).substring(2),\n kdf: \"scrypt\",\n kdfparams: {\n salt: hexlify(kdf.salt).substring(2),\n n: kdf.N,\n dklen: 32,\n p: kdf.p,\n r: kdf.r,\n },\n mac: mac.substring(2),\n },\n };\n // If we have a mnemonic, encrypt it into the JSON wallet\n if (account.mnemonic) {\n const client = options.client != null ? options.client : `corebc/${version}`;\n const path = account.mnemonic.path || defaultPath;\n const locale = account.mnemonic.locale || \"en\";\n const mnemonicKey = key.slice(32, 64);\n const entropy = getBytes(account.mnemonic.entropy, \"account.mnemonic.entropy\");\n const mnemonicIv = randomBytes(16);\n const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv));\n const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy));\n const now = new Date();\n const timestamp = now.getUTCFullYear() +\n \"-\" +\n zpad(now.getUTCMonth() + 1, 2) +\n \"-\" +\n zpad(now.getUTCDate(), 2) +\n \"T\" +\n zpad(now.getUTCHours(), 2) +\n \"-\" +\n zpad(now.getUTCMinutes(), 2) +\n \"-\" +\n zpad(now.getUTCSeconds(), 2) +\n \".0Z\";\n const gethFilename = \"UTC--\" + timestamp + \"--\" + data.address;\n data[\"x-corebc\"] = {\n client,\n gethFilename,\n path,\n locale,\n mnemonicCounter: hexlify(mnemonicIv).substring(2),\n mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2),\n version: \"0.1\",\n };\n }\n return JSON.stringify(data);\n}\n/**\n * Return the JSON Keystore Wallet for %%account%% encrypted with\n * %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used. Any provided [[ProgressCallback]] is ignord.\n */\nexport function encryptKeystoreJsonSync(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n/**\n * Resolved to the JSON Keystore Wallet for %%account%% encrypted\n * with %%password%%.\n *\n * The %%options%% can be used to tune the password-based key\n * derivation function parameters, explicitly set the random values\n * used and provide a [[ProgressCallback]] to receive periodic updates\n * on the completion status..\n */\nexport async function encryptKeystoreJson(account, password, options) {\n if (options == null) {\n options = {};\n }\n const passwordBytes = getPassword(password);\n const kdf = getEncryptKdfParams(options);\n const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback);\n return _encryptKeystore(getBytes(key), kdf, account, options);\n}\n//# sourceMappingURL=json-keystore.js.map"],"names":["data","spelunk","hexlify","assert","getBytes","sha256","concat","assertArgument","address","getAddress","extractPrefix","computeAddress","getPassword","pbkdf2","scryptSync","scrypt","randomBytes","uuidV4","version","zpad"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG;AAOvD,MAAM,WAAW,GAAG,kBAAkB;AACtC;AACA;AACA;AACO,SAAS,cAAc,CAAC,IAAI,EAAE;AACrC,IAAI,IAAI;AACR,QAAQ,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;AACrC,QAAQ,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC;AACzE,QAAQ,IAAI,OAAO,KAAK,CAAC,EAAE;AAC3B,YAAY,OAAO,IAAI;AACvB,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE,EAAE;AACpB,IAAI,OAAO,KAAK;AAChB;AACA,SAAS,OAAO,CAACA,MAAI,EAAE,GAAG,EAAE,UAAU,EAAE;AACxC,IAAI,MAAM,MAAM,GAAGC,aAAO,CAACD,MAAI,EAAE,sBAAsB,CAAC;AACxD,IAAI,IAAI,MAAM,KAAK,aAAa,EAAE;AAClC,QAAQ,MAAM,EAAE,GAAGC,aAAO,CAACD,MAAI,EAAE,8BAA8B,CAAC;AAChE,QAAQ,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,IAA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G,GAAG,mBAAmB,CAAC,OAAO,CAAC;AAC5C,IAAI,MAAM,GAAG,GAAG,MAAMG,aAAM,CAAC,aAAa,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,gBAAgB,CAAC;AACxG,IAAI,OAAO,gBAAgB,CAACX,aAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC;AACjE;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonic.d.ts b/lib.commonjs/wallet/mnemonic.d.ts deleted file mode 100644 index 64ef1a10e..000000000 --- a/lib.commonjs/wallet/mnemonic.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -export declare class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - readonly phrase: string; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - readonly password: string; - /** - * The wordlist for this mnemonic. - */ - readonly wordlist: Wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - readonly entropy: string; - /** - * @private - */ - constructor(guard: any, entropy: string, phrase: string, password?: null | string, wordlist?: null | Wordlist); - /** - * Returns the seed for the mnemonic. - */ - computeSeed(): string; - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase({ phrase, password, wordlist, }: { - phrase: string; - password?: null | string; - wordlist?: null | Wordlist; - }): Mnemonic; - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy: BytesLike, password?: null | string, wordlist?: null | Wordlist): Mnemonic; - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy: BytesLike, wordlist?: null | Wordlist): string; - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string; - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean; -} -//# sourceMappingURL=mnemonic.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonic.d.ts.map b/lib.commonjs/wallet/mnemonic.d.ts.map deleted file mode 100644 index 1f5e4541d..000000000 --- a/lib.commonjs/wallet/mnemonic.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA6HtD;;;GAGG;AACH,qBAAa,QAAQ;IACpB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAE1B;;OAEG;IACH,YACC,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,EAU1B;IAED;;OAEG;IACH,WAAW,IAAI,MAAM,CAEpB;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,QAAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,GAAG,QAAQ,CAKX;IAED;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CACjB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,QAAQ,CAIV;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CACrB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,MAAM,CAGR;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAEzE;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,OAAO,CAM1E;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonic.js b/lib.commonjs/wallet/mnemonic.js deleted file mode 100644 index e134591c9..000000000 --- a/lib.commonjs/wallet/mnemonic.js +++ /dev/null @@ -1,179 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var langEn = require('../wordlists/lang-en.js'); -var sha3 = require('../crypto/sha3.js'); -var mnemonicToSeed = require('./mnemonicToSeed.js'); - -// Returns a byte with the MSB bits set -function getUpperMask(bits) { - return (((1 << bits) - 1) << (8 - bits)) & 0xff; -} -// Returns a byte with the LSB bits set -function getLowerMask(bits) { - return ((1 << bits) - 1) & 0xff; -} -function mnemonicToEntropy(mnemonic, wordlist) { - errors.assertNormalize("NFKD"); - if (wordlist == null) { - wordlist = langEn.LangEn.wordlist(); - } - const words = wordlist.split(mnemonic); - errors.assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8)); - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - errors.assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= 1 << (7 - (offset % 8)); - } - offset++; - } - } - const entropyBits = (32 * words.length) / 3; - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum = data.getBytes(sha3.legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - errors.assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return data.hexlify(entropy.slice(0, entropyBits / 8)); -} -function entropyToMnemonic(entropy, wordlist) { - errors.assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist == null) { - wordlist = langEn.LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - remainingBits -= 8; - // This byte will complete an 11-bit index - } - else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt(sha3.legacySha256(entropy).substring(2, 4), 16) & - getUpperMask(checksumBits); - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= checksum >> (8 - checksumBits); - return wordlist.join(indices.map((index) => wordlist.getWord(index))); -} -const _guard = {}; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - phrase; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - password; - /** - * The wordlist for this mnemonic. - */ - wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - entropy; - /** - * @private - */ - constructor(guard, entropy, phrase, password, wordlist) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = langEn.LangEn.wordlist(); - } - errors.assertPrivate(guard, _guard, "Mnemonic"); - properties.defineProperties(this, { phrase, password, wordlist, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - return mnemonicToSeed.mnemonicToSeed(this.phrase, this.password); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase({ phrase, password, wordlist, }) { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(data.getBytes(entropy), wordlist); - return new Mnemonic(_guard, entropy, phrase, password, wordlist); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist) { - const entropy = data.getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard, data.hexlify(entropy), phrase, password, wordlist); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist) { - const entropy = data.getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist) { - return mnemonicToEntropy(phrase, wordlist); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist) { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } - catch (error) { } - return false; - } -} - -exports.Mnemonic = Mnemonic; -//# sourceMappingURL=mnemonic.js.map diff --git a/lib.commonjs/wallet/mnemonic.js.map b/lib.commonjs/wallet/mnemonic.js.map deleted file mode 100644 index cc4b3bb26..000000000 --- a/lib.commonjs/wallet/mnemonic.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonic.js","sources":["../../lib.esm/wallet/mnemonic.js"],"sourcesContent":["import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, } from \"../utils/index.js\";\nimport { LangEn } from \"../wordlists/lang-en.js\";\nimport { legacySha256 } from \"../crypto/sha3.js\";\nimport { mnemonicToSeed } from \"./mnemonicToSeed.js\";\n// Returns a byte with the MSB bits set\nfunction getUpperMask(bits) {\n return (((1 << bits) - 1) << (8 - bits)) & 0xff;\n}\n// Returns a byte with the LSB bits set\nfunction getLowerMask(bits) {\n return ((1 << bits) - 1) & 0xff;\n}\nfunction mnemonicToEntropy(mnemonic, wordlist) {\n assertNormalize(\"NFKD\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const words = wordlist.split(mnemonic);\n assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, \"invalid mnemonic length\", \"mnemonic\", \"[ REDACTED ]\");\n const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8));\n let offset = 0;\n for (let i = 0; i < words.length; i++) {\n let index = wordlist.getWordIndex(words[i].normalize(\"NFKD\"));\n assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, \"mnemonic\", \"[ REDACTED ]\");\n for (let bit = 0; bit < 11; bit++) {\n if (index & (1 << (10 - bit))) {\n entropy[offset >> 3] |= 1 << (7 - (offset % 8));\n }\n offset++;\n }\n }\n const entropyBits = (32 * words.length) / 3;\n const checksumBits = words.length / 3;\n const checksumMask = getUpperMask(checksumBits);\n const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask;\n assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), \"invalid mnemonic checksum\", \"mnemonic\", \"[ REDACTED ]\");\n return hexlify(entropy.slice(0, entropyBits / 8));\n}\nfunction entropyToMnemonic(entropy, wordlist) {\n assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, \"invalid entropy size\", \"entropy\", \"[ REDACTED ]\");\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n const indices = [0];\n let remainingBits = 11;\n for (let i = 0; i < entropy.length; i++) {\n // Consume the whole byte (with still more to go)\n if (remainingBits > 8) {\n indices[indices.length - 1] <<= 8;\n indices[indices.length - 1] |= entropy[i];\n remainingBits -= 8;\n // This byte will complete an 11-bit index\n }\n else {\n indices[indices.length - 1] <<= remainingBits;\n indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits);\n // Start the next word\n indices.push(entropy[i] & getLowerMask(8 - remainingBits));\n remainingBits += 3;\n }\n }\n // Compute the checksum bits\n const checksumBits = entropy.length / 4;\n const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) &\n getUpperMask(checksumBits);\n // Shift the checksum into the word indices\n indices[indices.length - 1] <<= checksumBits;\n indices[indices.length - 1] |= checksum >> (8 - checksumBits);\n return wordlist.join(indices.map((index) => wordlist.getWord(index)));\n}\nconst _guard = {};\n/**\n * A **Mnemonic** wraps all properties required to compute [[link-bip-39]]\n * seeds and convert between phrases and entropy.\n */\nexport class Mnemonic {\n /**\n * The mnemonic phrase of 12, 15, 18, 21 or 24 words.\n *\n * Use the [[wordlist]] ``split`` method to get the individual words.\n */\n phrase;\n /**\n * The password used for this mnemonic. If no password is used this\n * is the empty string (i.e. ``\"\"``) as per the specification.\n */\n password;\n /**\n * The wordlist for this mnemonic.\n */\n wordlist;\n /**\n * The underlying entropy which the mnemonic encodes.\n */\n entropy;\n /**\n * @private\n */\n constructor(guard, entropy, phrase, password, wordlist) {\n if (password == null) {\n password = \"\";\n }\n if (wordlist == null) {\n wordlist = LangEn.wordlist();\n }\n assertPrivate(guard, _guard, \"Mnemonic\");\n defineProperties(this, { phrase, password, wordlist, entropy });\n }\n /**\n * Returns the seed for the mnemonic.\n */\n computeSeed() {\n return mnemonicToSeed(this.phrase, this.password);\n }\n /**\n * Creates a new Mnemonic for the %%phrase%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromPhrase({ phrase, password, wordlist, }) {\n // Normalize the case and space; throws if invalid\n const entropy = mnemonicToEntropy(phrase, wordlist);\n phrase = entropyToMnemonic(getBytes(entropy), wordlist);\n return new Mnemonic(_guard, entropy, phrase, password, wordlist);\n }\n /**\n * Create a new **Mnemonic** from the %%entropy%%.\n *\n * The default %%password%% is the empty string and the default\n * wordlist is the [English wordlists](LangEn).\n */\n static fromEntropy(_entropy, password, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n const phrase = entropyToMnemonic(entropy, wordlist);\n return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist);\n }\n /**\n * Returns the phrase for %%mnemonic%%.\n */\n static entropyToPhrase(_entropy, wordlist) {\n const entropy = getBytes(_entropy, \"entropy\");\n return entropyToMnemonic(entropy, wordlist);\n }\n /**\n * Returns the entropy for %%phrase%%.\n */\n static phraseToEntropy(phrase, wordlist) {\n return mnemonicToEntropy(phrase, wordlist);\n }\n /**\n * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase.\n *\n * This checks all the provided words belong to the %%wordlist%%,\n * that the length is valid and the checksum is correct.\n */\n static isValidMnemonic(phrase, wordlist) {\n try {\n mnemonicToEntropy(phrase, wordlist);\n return true;\n }\n catch (error) { }\n return false;\n }\n}\n//# sourceMappingURL=mnemonic.js.map"],"names":["assertNormalize","LangEn","assertArgument","getBytes","legacySha256","hexlify","assertPrivate","defineProperties","mnemonicToSeed"],"mappings":";;;;;;;;;;;;;;;AAIA;AACA,SAAS,YAAY,CAAC,IAAI,EAAE;AAC5B,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI;AACnD;AACA;AACA,SAAS,YAAY,CAAC,IAAI,EAAE;AAC5B,IAAI,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI;AACnC;AACA,SAAS,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE;AAC/C,IAAIA,sBAAe,CAAC,MAAM,CAAC;AAC3B,IAAI,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC1B,QAAQ,QAAQ,GAAGC,aAAM,CAAC,QAAQ,EAAE;AACpC,IAAI;AACJ,IAAI,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;AAC1C,IAAIC,qBAAc,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE,IAAI,KAAK,CAAC,MAAM,IAAI,EAAE,EAAE,yBAAyB,EAAE,UAAU,EAAE,cAAc,CAAC;AAC7I,IAAI,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;AACtE,IAAI,IAAI,MAAM,GAAG,CAAC;AAClB,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC3C,QAAQ,IAA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C7C,QAAQ,IAAI;AACZ,YAAY,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC;AAC/C,YAAY,OAAO,IAAI;AACvB,QAAQ;AACR,QAAQ,OAAO,KAAK,EAAE,EAAE;AACxB,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonicToSeed.d.ts b/lib.commonjs/wallet/mnemonicToSeed.d.ts deleted file mode 100644 index ee0ed82a0..000000000 --- a/lib.commonjs/wallet/mnemonicToSeed.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function mnemonicToSeed(mnemonic: string, password?: string): string; -//# sourceMappingURL=mnemonicToSeed.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonicToSeed.d.ts.map b/lib.commonjs/wallet/mnemonicToSeed.d.ts.map deleted file mode 100644 index 87afb28cf..000000000 --- a/lib.commonjs/wallet/mnemonicToSeed.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonicToSeed.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E"} \ No newline at end of file diff --git a/lib.commonjs/wallet/mnemonicToSeed.js b/lib.commonjs/wallet/mnemonicToSeed.js deleted file mode 100644 index aaf1b49f5..000000000 --- a/lib.commonjs/wallet/mnemonicToSeed.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var buffer = require('buffer'); -require('bcrypto/lib/ed448.js'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -var crypto = require('crypto'); -var utf8 = require('utf8'); - -function mnemonicToSeed(mnemonic, password) { - if (!password) { - password = ""; - } - const t = generateSeed(mnemonic, password); - return t.goldilock; -} -const generateSeed = (mnemonic, password) => { - const goldilockSaltPrefix = "mnemonic"; - const aesSaltPrefix = "mnemonicfortheAESkey"; - const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); - const aesSalt = utf8.encode(aesSaltPrefix + password); - const goldilockKey = crypto.pbkdf2Sync(buffer.Buffer.from(mnemonic), buffer.Buffer.from(goldilockSalt), 2048, 64, "sha512"); - const aesKeySeed = crypto.pbkdf2Sync(buffer.Buffer.from(mnemonic), buffer.Buffer.from(aesSalt), 2048, 64, "sha512"); - return { - aes: buffer.Buffer.from(aesKeySeed).toString("hex"), - goldilock: buffer.Buffer.from(goldilockKey).toString("hex"), - }; -}; - -exports.mnemonicToSeed = mnemonicToSeed; -//# sourceMappingURL=mnemonicToSeed.js.map diff --git a/lib.commonjs/wallet/mnemonicToSeed.js.map b/lib.commonjs/wallet/mnemonicToSeed.js.map deleted file mode 100644 index 76cbbe0f3..000000000 --- a/lib.commonjs/wallet/mnemonicToSeed.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonicToSeed.js","sources":["../../lib.esm/wallet/mnemonicToSeed.js"],"sourcesContent":["import { Buffer } from \"buffer\";\nimport { pbkdf2Sync } from \"../crypto/crypto.js\";\nimport utf8 from \"utf8\";\nexport function mnemonicToSeed(mnemonic, password) {\n if (!password) {\n password = \"\";\n }\n const t = generateSeed(mnemonic, password);\n return t.goldilock;\n}\nconst generateSeed = (mnemonic, password) => {\n const goldilockSaltPrefix = \"mnemonic\";\n const aesSaltPrefix = \"mnemonicfortheAESkey\";\n const goldilockSalt = utf8.encode(goldilockSaltPrefix + password);\n const aesSalt = utf8.encode(aesSaltPrefix + password);\n const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(goldilockSalt), 2048, 64, \"sha512\");\n const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(aesSalt), 2048, 64, \"sha512\");\n return {\n aes: Buffer.from(aesKeySeed).toString(\"hex\"),\n goldilock: Buffer.from(goldilockKey).toString(\"hex\"),\n };\n};\n//# sourceMappingURL=mnem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deleted file mode 100644 index 0d4baabe8..000000000 --- a/lib.commonjs/wallet/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @_ignore - */ -export declare function looseArrayify(hexString: string): Uint8Array; -export declare function zpad(value: String | number, length: number): String; -export declare function getPassword(password: string | Uint8Array): Uint8Array; -export declare function spelunk(object: any, _path: string): T; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/utils.d.ts.map b/lib.commonjs/wallet/utils.d.ts.map deleted file mode 100644 index 4c02cc44f..000000000 --- a/lib.commonjs/wallet/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAK3D;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMnE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAKrE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAoExD"} \ No newline at end of file diff --git a/lib.commonjs/wallet/utils.js b/lib.commonjs/wallet/utils.js deleted file mode 100644 index 3ea3315e8..000000000 --- a/lib.commonjs/wallet/utils.js +++ /dev/null @@ -1,159 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -var data = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -var utf8 = require('../utils/utf8.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -/** - * @_ignore - */ -function looseArrayify(hexString) { - if (typeof hexString === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return data.getBytesCopy(hexString); -} -function zpad(value, length) { - value = String(value); - while (value.length < length) { - value = "0" + value; - } - return value; -} -function getPassword(password) { - if (typeof password === "string") { - return utf8.toUtf8Bytes(password, "NFKC"); - } - return data.getBytesCopy(password); -} -function spelunk(object, _path) { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - errors.assertArgument(match != null, "invalid path", "path", _path); - const path = match[1]; - const type = match[3]; - const reqd = match[4] === "!"; - let cur = object; - for (const comp of path.toLowerCase().split(".")) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } - else if (typeof cur === "object") { - let found = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } - else { - cur = null; - } - if (cur == null) { - break; - } - } - errors.assertArgument(!reqd || cur != null, "missing required value", "path", path); - if (type && cur != null) { - if (type === "int") { - if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } - else if (Number.isSafeInteger(cur)) { - return cur; - } - } - if (type === "number") { - if (typeof cur === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - if (type === "data") { - if (typeof cur === "string") { - return looseArrayify(cur); - } - } - if (type === "array" && Array.isArray(cur)) { - return cur; - } - if (type === typeof cur) { - return cur; - } - errors.assertArgument(false, `wrong type found for ${type} `, "path", path); - } - return cur; -} -/* -export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; -} - -// "path/to/something:type!" -export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); -} -*/ -// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) -/* -export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -*/ - -exports.getPassword = getPassword; -exports.looseArrayify = looseArrayify; -exports.spelunk = spelunk; -exports.zpad = zpad; -//# sourceMappingURL=utils.js.map diff --git a/lib.commonjs/wallet/utils.js.map b/lib.commonjs/wallet/utils.js.map deleted file mode 100644 index 672ea113f..000000000 --- a/lib.commonjs/wallet/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sources":["../../lib.esm/wallet/utils.js"],"sourcesContent":["/**\n * @_ignore\n */\nimport { getBytesCopy, assertArgument, toUtf8Bytes } from \"../utils/index.js\";\nexport function looseArrayify(hexString) {\n if (typeof hexString === \"string\" && !hexString.startsWith(\"0x\")) {\n hexString = \"0x\" + hexString;\n }\n return getBytesCopy(hexString);\n}\nexport function zpad(value, length) {\n value = String(value);\n while (value.length < length) {\n value = \"0\" + value;\n }\n return value;\n}\nexport function getPassword(password) {\n if (typeof password === \"string\") {\n return toUtf8Bytes(password, \"NFKC\");\n }\n return getBytesCopy(password);\n}\nexport function spelunk(object, _path) {\n const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);\n assertArgument(match != null, \"invalid path\", \"path\", _path);\n const path = match[1];\n const type = match[3];\n const reqd = match[4] === \"!\";\n let cur = object;\n for (const comp of path.toLowerCase().split(\".\")) {\n // Search for a child object with a case-insensitive matching key\n if (Array.isArray(cur)) {\n if (!comp.match(/^[0-9]+$/)) {\n break;\n }\n cur = cur[parseInt(comp)];\n }\n else if (typeof cur === \"object\") {\n let found = null;\n for (const key in cur) {\n if (key.toLowerCase() === comp) {\n found = cur[key];\n break;\n }\n }\n cur = found;\n }\n else {\n cur = null;\n }\n if (cur == null) {\n break;\n }\n }\n assertArgument(!reqd || cur != null, \"missing required value\", \"path\", path);\n if (type && cur != null) {\n if (type === \"int\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9]+$/)) {\n return parseInt(cur);\n }\n else if (Number.isSafeInteger(cur)) {\n return cur;\n }\n }\n if (type === \"number\") {\n if (typeof cur === \"string\" && cur.match(/^-?[0-9.]*$/)) {\n return parseFloat(cur);\n }\n }\n if (type === \"data\") {\n if (typeof cur === \"string\") {\n return looseArrayify(cur);\n }\n }\n if (type === \"array\" && Array.isArray(cur)) {\n return cur;\n }\n if (type === typeof cur) {\n return cur;\n }\n assertArgument(false, `wrong type found for ${type} `, \"path\", path);\n }\n return cur;\n}\n/*\nexport function follow(object: any, path: string): null | string {\n let currentChild = object;\n\n for (const comp of path.toLowerCase().split('/')) {\n\n // Search for a child object with a case-insensitive matching key\n let matchingChild = null;\n for (const key in currentChild) {\n if (key.toLowerCase() === comp) {\n matchingChild = currentChild[key];\n break;\n }\n }\n\n if (matchingChild === null) { return null; }\n\n currentChild = matchingChild;\n }\n\n return currentChild;\n}\n\n// \"path/to/something:type!\"\nexport function followRequired(data: any, path: string): string {\n const value = follow(data, path);\n if (value != null) { return value; }\n return logger.throwArgumentError(\"invalid value\", `data:${ path }`,\n JSON.stringify(data));\n}\n*/\n// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4)\n/*\nexport function uuidV4(randomBytes: BytesLike): string {\n const bytes = getBytes(randomBytes, \"randomBytes\");\n\n // Section: 4.1.3:\n // - time_hi_and_version[12:16] = 0b0100\n bytes[6] = (bytes[6] & 0x0f) | 0x40;\n\n // Section 4.4\n // - clock_seq_hi_and_reserved[6] = 0b0\n // - clock_seq_hi_and_reserved[7] = 0b1\n bytes[8] = (bytes[8] & 0x3f) | 0x80;\n\n const value = hexlify(bytes);\n\n return [\n value.substring(2, 10),\n value.substring(10, 14),\n value.substring(14, 18),\n value.substring(18, 22),\n value.substring(22, 34),\n ].join(\"-\");\n}\n*/\n//# sourceMappingURL=utils.js.map"],"names":["getBytesCopy","toUtf8Bytes","assertArgument"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AAEO,SAAS,aAAa,CAAC,SAAS,EAAE;AACzC,IAAI,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AACtE,QAAQ,SAAS,GAAG,IAAI,GAAG,SAAS;AACpC,IAAI;AACJ,IAAI,OAAOA,iBAAY,CAAC,SAAS,CAAC;AAClC;AACO,SAAS,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;AACpC,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACzB,IAAI,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE;AAClC,QAAQ,KAAK,GAAG,GAAG,GAAG,KAAK;AAC3B,IAAI;AACJ,IAAI,OAAO,KAAK;AAChB;AACO,SAAS,WAAW,CAAC,QAAQ,EAAE;AACtC,IAAI,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AACtC,QAAQ,OAAOC,gBAAW,CAAC,QAAQ,EAAE,MAAM,CAAC;AAC5C,IAAI;AACJ,IAAI,OAAOD,iBAAY,CAAC,QAAQ,CAAC;AACjC;AACO,SAAS,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE;AACvC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,oCAAoC,CAAC;AACnE,IAAIE,qBAAc,CAAC,KAAK,IAAI,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC;AAChE,IAAI,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;AACzB,IAAI,MAAM,I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ode 100644 index 384cb372f..000000000 --- a/lib.commonjs/wallet/wallet.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { HDNodeWallet } from "./hdwallet.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -export declare class Wallet extends BaseWallet { - #private; - /** - * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected - * to %%provider%%. - */ - constructor({ key, prefix, provider, }: { - key: string | SigningKey; - prefix: string; - provider?: null | Provider; - }); - connect(provider: null | Provider): Wallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static fromEncryptedJson(json: string, password: Uint8Array | string, progress?: ProgressCallback): Promise; - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json: string, password: Uint8Array | string): HDNodeWallet | Wallet; - /** - * Creates a new random [[HDNodeWallet]] using the avavilable - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(prefix: string, provider?: null | Provider): HDNodeWallet; - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase({ phrase, prefix, provider, password, }: { - phrase: string; - prefix: string; - provider?: Provider; - password?: string; - }): HDNodeWallet; - static fromSeed({ seed, prefix, provider, path, }: { - seed: string; - prefix: string; - path?: string; - provider?: Provider; - }): HDNodeWallet; -} -//# sourceMappingURL=wallet.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wallet/wallet.d.ts.map b/lib.commonjs/wallet/wallet.d.ts.map deleted file mode 100644 index b640b9ef5..000000000 --- a/lib.commonjs/wallet/wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAe,YAAY,EAAE,MAAM,eAAe,CAAC;AAW1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AActD;;;;;;;;;GASG;AACH,qBAAa,MAAO,SAAQ,UAAU;;IACrC;;;OAGG;IACH,YAAY,EACX,GAAG,EACH,MAAM,EACN,QAAQ,GACR,EAAE;QACF,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,EAWA;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAMzC;IAED;;;;;;OAMG;IACG,OAAO,CACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,EAC7B,gBAAgB,CAAC,EAAE,gBAAgB,GACjC,OAAO,CAAC,MAAM,CAAC,CAGjB;IAED;;;;;;;;;OASG;IACH,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAGjD;IA6CD;;;;;;OAMG;IACH,OAAa,iBAAiB,CAC7B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,EAC7B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,CAiBhC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,GAC3B,YAAY,GAAG,MAAM,CAWvB;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAClB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,YAAY,CAWd;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,YAAY,CAUf;IACD,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAUf;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wallet/wallet.js b/lib.commonjs/wallet/wallet.js deleted file mode 100644 index be82fe7db..000000000 --- a/lib.commonjs/wallet/wallet.js +++ /dev/null @@ -1,205 +0,0 @@ -'use strict'; - -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -var signingKey = require('../crypto/signing-key.js'); -require('../crypto/signature.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var baseWallet = require('./base-wallet.js'); -var hdwallet = require('./hdwallet.js'); -var jsonCrowdsale = require('./json-crowdsale.js'); -var jsonKeystore = require('./json-keystore.js'); -var mnemonic = require('./mnemonic.js'); -var address = require('../transaction/address.js'); - -function stall(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); -} -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -class Wallet extends baseWallet.BaseWallet { - /** - * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected - * to %%provider%%. - */ - constructor({ key, prefix, provider, }) { - if (typeof key === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - let signingKey$1 = typeof key === "string" ? new signingKey.SigningKey(key) : key; - super({ - signingKey: signingKey$1, - prefix, - provider, - }); - } - connect(provider) { - return new Wallet({ - key: this.signingKey, - prefix: this.prefix, - provider, - }); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - const account = { address: this.address, privateKey: this.privateKey }; - return await jsonKeystore.encryptKeystoreJson(account, password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - const account = { address: this.address, privateKey: this.privateKey }; - return jsonKeystore.encryptKeystoreJsonSync(account, password); - } - static #fromAccount(account) { - errors.assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - const address$1 = account.address; - const prefix = address.extractPrefix(address$1); - if ("mnemonic" in account && - account.mnemonic && - account.mnemonic.locale === "en") { - const mnemonic$1 = mnemonic.Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = hdwallet.HDNodeWallet.fromMnemonic(mnemonic$1, prefix, account.mnemonic.path); - if (wallet.address === account.address && - wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - const wallet = new Wallet({ - key: account.privateKey, - prefix, - }); - errors.assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); - return wallet; - } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json, password, progress) { - let account = null; - if (jsonKeystore.isKeystoreJson(json)) { - account = await jsonKeystore.decryptKeystoreJson(json, password, progress); - } - else if (jsonCrowdsale.isCrowdsaleJson(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = jsonCrowdsale.decryptCrowdsaleJson(json, password); - if (progress) { - progress(1); - await stall(0); - } - } - return Wallet.#fromAccount(account); - } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json, password) { - let account = null; - if (jsonKeystore.isKeystoreJson(json)) { - account = jsonKeystore.decryptKeystoreJsonSync(json, password); - } - else if (jsonCrowdsale.isCrowdsaleJson(json)) { - account = jsonCrowdsale.decryptCrowdsaleJson(json, password); - } - else { - errors.assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - return Wallet.#fromAccount(account); - } - /** - * Creates a new random [[HDNodeWallet]] using the avavilable - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(prefix, provider) { - const wallet = hdwallet.HDNodeWallet.createRandom(prefix, undefined, undefined, undefined); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase({ phrase, prefix, provider, password, }) { - const wallet = hdwallet.HDNodeWallet.fromPhrase({ - phrase, - prefix, - password, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - static fromSeed({ seed, prefix, provider, path, }) { - const wallet = hdwallet.HDNodeWallet.fromSeed({ - seed, - prefix, - path: path || hdwallet.defaultPath, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } -} - -exports.Wallet = Wallet; -//# sourceMappingURL=wallet.js.map diff --git a/lib.commonjs/wallet/wallet.js.map b/lib.commonjs/wallet/wallet.js.map deleted file mode 100644 index d8a64e95d..000000000 --- a/lib.commonjs/wallet/wallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet.js","sources":["../../lib.esm/wallet/wallet.js"],"sourcesContent":["import { SigningKey } from \"../crypto/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { BaseWallet } from \"./base-wallet.js\";\nimport { defaultPath, HDNodeWallet } from \"./hdwallet.js\";\nimport { decryptCrowdsaleJson, isCrowdsaleJson } from \"./json-crowdsale.js\";\nimport { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson, } from \"./json-keystore.js\";\nimport { Mnemonic } from \"./mnemonic.js\";\nimport { extractPrefix } from \"../transaction/address.js\";\nfunction stall(duration) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, duration);\n });\n}\n/**\n * A **Wallet** manages a single private key which is used to sign\n * transactions, messages and other common payloads.\n *\n * This class is generally the main entry point for developers\n * that wish to use a private key directly, as it can create\n * instances from a large variety of common sources, including\n * raw private key, [[link-bip-39]] mnemonics and encrypte JSON\n * wallets.\n */\nexport class Wallet extends BaseWallet {\n /**\n * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected\n * to %%provider%%.\n */\n constructor({ key, prefix, provider, }) {\n if (typeof key === \"string\" && !key.startsWith(\"0x\")) {\n key = \"0x\" + key;\n }\n let signingKey = typeof key === \"string\" ? new SigningKey(key) : key;\n super({\n signingKey,\n prefix,\n provider,\n });\n }\n connect(provider) {\n return new Wallet({\n key: this.signingKey,\n prefix: this.prefix,\n provider,\n });\n }\n /**\n * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with\n * %%password%%.\n *\n * If %%progressCallback%% is specified, it will receive periodic\n * updates as the encryption process progreses.\n */\n async encrypt(password, progressCallback) {\n const account = { address: this.address, privateKey: this.privateKey };\n return await encryptKeystoreJson(account, password, { progressCallback });\n }\n /**\n * Returns a [JSON Keystore Wallet](json-wallets) encryped with\n * %%password%%.\n *\n * It is preferred to use the [async version](encrypt) instead,\n * which allows a [[ProgressCallback]] to keep the user informed.\n *\n * This method will block the event loop (freezing all UI) until\n * it is complete, which may be a non-trivial duration.\n */\n encryptSync(password) {\n const account = { address: this.address, privateKey: this.privateKey };\n return encryptKeystoreJsonSync(account, password);\n }\n static #fromAccount(account) {\n assertArgument(account, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n const address = account.address;\n const prefix = extractPrefix(address);\n if (\"mnemonic\" in account &&\n account.mnemonic &&\n account.mnemonic.locale === \"en\") {\n const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy);\n const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path);\n if (wallet.address === account.address &&\n wallet.privateKey === account.privateKey) {\n return wallet;\n }\n console.log(\"WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key\");\n }\n const wallet = new Wallet({\n key: account.privateKey,\n prefix,\n });\n assertArgument(wallet.address === account.address, \"address/privateKey mismatch\", \"json\", \"[ REDACTED ]\");\n return wallet;\n }\n /**\n * Creates (asynchronously) a **Wallet** by decrypting the %%json%%\n * with %%password%%.\n *\n * If %%progress%% is provided, it is called periodically during\n * decryption so that any UI can be updated.\n */\n static async fromEncryptedJson(json, password, progress) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = await decryptKeystoreJson(json, password, progress);\n }\n else if (isCrowdsaleJson(json)) {\n if (progress) {\n progress(0);\n await stall(0);\n }\n account = decryptCrowdsaleJson(json, password);\n if (progress) {\n progress(1);\n await stall(0);\n }\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a **Wallet** by decrypting the %%json%% with %%password%%.\n *\n * The [[fromEncryptedJson]] method is preferred, as this method\n * will lock up and freeze the UI during decryption, which may take\n * some time.\n */\n static fromEncryptedJsonSync(json, password) {\n let account = null;\n if (isKeystoreJson(json)) {\n account = decryptKeystoreJsonSync(json, password);\n }\n else if (isCrowdsaleJson(json)) {\n account = decryptCrowdsaleJson(json, password);\n }\n else {\n assertArgument(false, \"invalid JSON wallet\", \"json\", \"[ REDACTED ]\");\n }\n return Wallet.#fromAccount(account);\n }\n /**\n * Creates a new random [[HDNodeWallet]] using the avavilable\n * [cryptographic random source](randomBytes).\n *\n * If there is no crytographic random source, this will throw.\n */\n static createRandom(prefix, provider) {\n const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined);\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n /**\n * Creates a [[HDNodeWallet]] for %%phrase%%.\n */\n static fromPhrase({ phrase, prefix, provider, password, }) {\n const wallet = HDNodeWallet.fromPhrase({\n phrase,\n prefix,\n password,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n static fromSeed({ seed, prefix, provider, path, }) {\n const wallet = HDNodeWallet.fromSeed({\n seed,\n prefix,\n path: path || defaultPath,\n });\n if (provider) {\n return wallet.connect(provider);\n }\n return wallet;\n }\n}\n//# sourceMappingURL=wallet.js.map"],"names":["BaseWallet","signingKey","SigningKey","encryptKeystoreJson","encryptKeystoreJsonSync","assertArgument","address","extractPrefix","mnemonic","Mnemonic","HDNodeWallet","isKeystoreJson","decryptKeystoreJson","isCrowdsaleJson","decryptCrowdsaleJson","decryptKeystoreJsonSync","defaultPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,KAAK,CAAC,QAAQ,EAAE;AACzB,IAAI,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK;AACpC,QAAQ,UAAU,CAAC,MAAM;AACzB,YAAY,OAAO,EAAE;AACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;AACpB,IAAI,CAAC,CAAC;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,qBAAU,CAAC;AACvC;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAG,EAAE;AAC5C,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC9D,YAAY,GAAG,GAAG,IAAI,GAAG,GAAG;AAC5B,QAAQ;AACR,QAAQ,IAAIC,YAAU,GAAG,OAAO,GAAG,KAAK,QAAQ,GAAG,IAAIC,qBAAU,CAAC,GAAG,CAAC,GAAG,GAAG;AAC5E,QAAQ,KAAK,CAAC;AACd,wBAAYD,YAAU;AACtB,YAAY,MAAM;AAClB,YAAY,QAAQ;AACpB,SAAS,CAAC;AACV,IAAI;AACJ,IAAI,OAAO,CAAC,QAAQ,EAAE;AACtB,QAAQ,OAAO,IAAI,MAAM,CAAC;AAC1B,YAAY,GAAG,EAAE,IAAI,CAAC,UAAU;AAChC,YAAY,MAAM,EAAE,IAAI,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AAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ,IAAI,OAAO,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE;AACvD,QAAQ,MAAM,MAAM,GAAGA,qBAAY,CAAC,QAAQ,CAAC;AAC7C,YAAY,IAAI;AAChB,YAAY,MAAM;AAClB,YAAY,IAAI,EAAE,IAAI,IAAIM,oBAAW;AACrC,SAAS,CAAC;AACV,QAAQ,IAAI,QAAQ,EAAE;AACtB,YAAY,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;AAC3C,QAAQ;AACR,QAAQ,OAAO,MAAM;AACrB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/bit-reader.d.ts b/lib.commonjs/wordlists/bit-reader.d.ts deleted file mode 100644 index 1aa849530..000000000 --- a/lib.commonjs/wordlists/bit-reader.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeBits(width: number, data: string): Array; -//# sourceMappingURL=bit-reader.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/bit-reader.d.ts.map b/lib.commonjs/wordlists/bit-reader.d.ts.map deleted file mode 100644 index 904904c46..000000000 --- a/lib.commonjs/wordlists/bit-reader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bit-reader.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA8BrE"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/bit-reader.js b/lib.commonjs/wordlists/bit-reader.js deleted file mode 100644 index caa2888de..000000000 --- a/lib.commonjs/wordlists/bit-reader.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -/** - * @_ignore - */ -function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = (accum << 6) | Base64.indexOf(data[i]); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = accum >> (bits - width); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; -} - -exports.decodeBits = decodeBits; -//# sourceMappingURL=bit-reader.js.map diff --git a/lib.commonjs/wordlists/bit-reader.js.map b/lib.commonjs/wordlists/bit-reader.js.map deleted file mode 100644 index 28b3137a2..000000000 --- a/lib.commonjs/wordlists/bit-reader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bit-reader.js","sources":["../../lib.esm/wordlists/bit-reader.js"],"sourcesContent":["const Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\n/**\n * @_ignore\n */\nexport function decodeBits(width, data) {\n const maxValue = (1 << width) - 1;\n const result = [];\n let accum = 0, bits = 0, flood = 0;\n for (let i = 0; i < data.length; i++) {\n // Accumulate 6 bits of data\n accum = (accum << 6) | Base64.indexOf(data[i]);\n bits += 6;\n // While we have enough for a word...\n while (bits >= width) {\n // ...read the word\n const value = accum >> (bits - width);\n accum &= (1 << (bits - width)) - 1;\n bits -= width;\n // A value of 0 indicates we exceeded maxValue, it\n // floods over into the next value\n if (value === 0) {\n flood += maxValue;\n }\n else {\n result.push(value + flood);\n flood = 0;\n }\n }\n }\n return result;\n}\n//# sourceMappingURL=bit-reader.js.map"],"names":[],"mappings":";;AAAA,MAAM,MAAM,GAAG,kEAAkE;AACjF;AACA;AACA;AACO,SAAS,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE;AACxC,IAAI,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC;AACrC,IAAI,MAAM,MAAM,GAAG,EAAE;AACrB,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC;AACtC,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC1C;AACA,QAAQ,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACtD,QAAQ,IAAI,IAAI,CAAC;AACjB;AACA,QAAQ,OAAO,IAAI,IAAI,KAAK,EAAE;AAC9B;AACA,YAAY,MAAM,KAAK,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC;AACjD,YAAY,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AAC9C,YAAY,IAAI,IAAI,KAAK;AACzB;AACA;AACA,YAAY,IAAI,KAAK,KAAK,CAAC,EAAE;AAC7B,gBAAgB,KAAK,IAAI,QAAQ;AACjC,YAAY;AACZ,iBAAiB;AACjB,gBAAgB,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AAC1C,gBAAgB,KAAK,GAAG,CAAC;AACzB,YAAY;AACZ,QAAQ;AACR,IAAI;AACJ,IAAI,OAAO,MAAM;AACjB;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/decode-owl.d.ts b/lib.commonjs/wordlists/decode-owl.d.ts deleted file mode 100644 index 8822086bb..000000000 --- a/lib.commonjs/wordlists/decode-owl.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @_ignore - */ -export declare function decode(data: string, subs: string): Array; -/** - * @_ignore - */ -export declare function decodeOwl(data: string): Array; -//# sourceMappingURL=decode-owl.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/decode-owl.d.ts.map b/lib.commonjs/wordlists/decode-owl.d.ts.map deleted file mode 100644 index ce10ef2ad..000000000 --- a/lib.commonjs/wordlists/decode-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owl.ts"],"names":[],"mappings":"AAuBA;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA4BhE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAOrD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/decode-owl.js b/lib.commonjs/wordlists/decode-owl.js deleted file mode 100644 index 7c3e1ec98..000000000 --- a/lib.commonjs/wordlists/decode-owl.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; -function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); -} -/** - * @_ignore - */ -function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); -} -/** - * @_ignore - */ -function decodeOwl(data) { - errors.assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); -} - -exports.decode = decode; -exports.decodeOwl = decodeOwl; -//# sourceMappingURL=decode-owl.js.map diff --git a/lib.commonjs/wordlists/decode-owl.js.map b/lib.commonjs/wordlists/decode-owl.js.map deleted file mode 100644 index 4b334abef..000000000 --- a/lib.commonjs/wordlists/decode-owl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owl.js","sources":["../../lib.esm/wordlists/decode-owl.js"],"sourcesContent":["import { assertArgument } from \"../utils/index.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z]*$/i;\nfunction unfold(words, sep) {\n let initial = 97;\n return words.reduce((accum, word) => {\n if (word === sep) {\n initial++;\n }\n else if (word.match(Word)) {\n accum.push(String.fromCharCode(initial) + word);\n }\n else {\n initial = 97;\n accum.push(word);\n }\n return accum;\n }, []);\n}\n/**\n * @_ignore\n */\nexport function decode(data, subs) {\n // Replace all the substitutions with their expanded form\n for (let i = subsChrs.length - 1; i >= 0; i--) {\n data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2));\n }\n // Get all tle clumps; each suffix, first-increment and second-increment\n const clumps = [];\n const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => {\n if (semi) {\n for (let i = parseInt(semi); i >= 0; i--) {\n clumps.push(\";\");\n }\n }\n else {\n clumps.push(item.toLowerCase());\n }\n return \"\";\n });\n /* c8 ignore start */\n if (leftover) {\n throw new Error(`leftovers: ${JSON.stringify(leftover)}`);\n }\n /* c8 ignore stop */\n return unfold(unfold(clumps, \";\"), \":\");\n}\n/**\n * @_ignore\n */\nexport function decodeOwl(data) {\n assertArgument(data[0] === \"0\", \"unsupported auwl data\", \"data\", data);\n return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length));\n}\n//# sourceMappingURL=decode-owl.js.map"],"names":["assertArgument"],"mappings":";;;;;;;;;;;AACA,MAAM,QAAQ,GAAG,+BAA+B;AAChD,MAAM,IAAI,GAAG,WAAW;AACxB,SAAS,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE;AAC5B,IAAI,IAAI,OAAO,GAAG,EAAE;AACpB,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK;AACzC,QAAQ,IAAI,IAAI,KAAK,GAAG,EAAE;AAC1B,YAAY,OAAO,EAAE;AACrB,QAAQ;AACR,aAAa,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;AACnC,YAAY,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;AAC3D,QAAQ;AACR,aAAa;AACb,YAAY,OAAO,GAAG,EAAE;AACxB,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5B,QAAQ;AACR,QAAQ,OAAO,KAAK;AACpB,IAAI,CAAC,EAAE,EAAE,CAAC;AACV;AACA;AACA;AACA;AACO,SAAS,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE;AACnC;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AACnD,QAAQ,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,G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commonjs/wordlists/decode-owla.d.ts deleted file mode 100644 index 479e6c54a..000000000 --- a/lib.commonjs/wordlists/decode-owla.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeOwlA(data: string, accents: string): Array; -//# sourceMappingURL=decode-owla.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/decode-owla.d.ts.map b/lib.commonjs/wordlists/decode-owla.d.ts.map deleted file mode 100644 index da8636365..000000000 --- a/lib.commonjs/wordlists/decode-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA4BvE"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/decode-owla.js b/lib.commonjs/wordlists/decode-owla.js deleted file mode 100644 index 18ad0d1be..000000000 --- a/lib.commonjs/wordlists/decode-owla.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -var bitReader = require('./bit-reader.js'); -var decodeOwl = require('./decode-owl.js'); - -/** - * @_ignore - */ -function decodeOwlA(data, accents) { - let words = decodeOwl.decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - errors.assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = bitReader.decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); -} - -exports.decodeOwlA = decodeOwlA; -//# sourceMappingURL=decode-owla.js.map diff --git a/lib.commonjs/wordlists/decode-owla.js.map b/lib.commonjs/wordlists/decode-owla.js.map deleted file mode 100644 index 9005a9f01..000000000 --- a/lib.commonjs/wordlists/decode-owla.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owla.js","sources":["../../lib.esm/wordlists/decode-owla.js"],"sourcesContent":["import { assertArgument } from \"../utils/index.js\";\nimport { decodeBits } from \"./bit-reader.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\n/**\n * @_ignore\n */\nexport function decodeOwlA(data, accents) {\n let words = decodeOwl(data).join(\",\");\n // Inject the accents\n accents.split(/,/g).forEach((accent) => {\n const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);\n assertArgument(match !== null, \"internal error parsing accents\", \"accents\", accents);\n let posOffset = 0;\n const positions = decodeBits(parseInt(match[3]), match[4]);\n const charCode = parseInt(match[2]);\n const regex = new RegExp(`([${match[1]}])`, \"g\");\n words = words.replace(regex, (all, letter) => {\n const rem = --positions[posOffset];\n if (rem === 0) {\n letter = String.fromCharCode(letter.charCodeAt(0), charCode);\n posOffset++;\n }\n return letter;\n });\n });\n return words.split(\",\");\n}\n//# sourceMappingURL=decode-owla.js.map"],"names":["decodeOwl","assertArgument","decodeBits"],"mappings":";;;;;;;;;;;;;AAGA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE;AAC1C,IAAI,IAAI,KAAK,GAAGA,mBAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACzC;AACA,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK;AAC5C,QAAQ,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC;AACnE,QAAQC,qBAAc,CAAC,KAAK,KAAK,IAAI,EAAE,gCAAgC,EAAE,SAAS,EAAE,OAAO,CAAC;AAC5F,QAAQ,IAAI,SAAS,GAAG,CAAC;AACzB,QAAQ,MAAM,SAAS,GAAGC,oBAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;AAClE,QAAQ,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3C,QAAQ,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC;AACxD,QAAQ,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK;AACtD,YAAY,MAAM,GAAG,GAAG,EAAE,SAAS,CAAC,SAAS,CAAC;AAC9C,YAAY,IAAI,GAAG,KAAK,CAAC,EAAE;AAC3B,gBAAgB,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC;AAC5E,gBAAgB,SAAS,EAAE;AAC3B,YAAY;AACZ,YAAY,OAAO,MAAM;AACzB,QAAQ,CAAC,CAAC;AACV,IAAI,CAAC,CAAC;AACN,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC3B;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/enwords.d.ts b/lib.commonjs/wordlists/enwords.d.ts deleted file mode 100644 index 8600e64a2..000000000 --- a/lib.commonjs/wordlists/enwords.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const enWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=enwords.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/enwords.d.ts.map b/lib.commonjs/wordlists/enwords.d.ts.map deleted file mode 100644 index ff2c89431..000000000 --- a/lib.commonjs/wordlists/enwords.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"enwords.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,i0VAC2yV,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/enwords.js b/lib.commonjs/wordlists/enwords.js deleted file mode 100644 index 1ddd20b6d..000000000 --- a/lib.commonjs/wordlists/enwords.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; - -const enWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; - -exports.enWords = enWords; -//# sourceMappingURL=enwords.js.map diff --git a/lib.commonjs/wordlists/enwords.js.map b/lib.commonjs/wordlists/enwords.js.map deleted file mode 100644 index e800acf26..000000000 --- a/lib.commonjs/wordlists/enwords.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"enwords.js","sources":["../../lib.esm/wordlists/enwords.js"],"sourcesContent":["export const enWords = \"AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo\";\n//# sourceMappingURL=enwords.js.map"],"names":[],"mappings":";;AAAY,MAAC,OAAO,GAAG;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/generation/encode-latin.d.ts b/lib.commonjs/wordlists/generation/encode-latin.d.ts deleted file mode 100644 index a646e8246..000000000 --- a/lib.commonjs/wordlists/generation/encode-latin.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export declare class BitWriter { - #private; - readonly width: number; - constructor(width: number); - write(value: number): void; - get length(): number; - get data(): string; -} -export interface AccentSet { - accent: number; - follows: string; - positions: Array; - positionsLength: number; - positionData: string; - positionDataLength: number; -} -export declare function extractAccents(words: Array): { - accents: Array; - words: Array; -}; -export declare function encodeOwl(words: Array): { - subs: string; - data: string; -}; -//# sourceMappingURL=encode-latin.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/generation/encode-latin.d.ts.map b/lib.commonjs/wordlists/generation/encode-latin.d.ts.map deleted file mode 100644 index 0a1f29f5d..000000000 --- a/lib.commonjs/wordlists/generation/encode-latin.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAyIA,qBAAa,SAAS;;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAKvB,YAAY,KAAK,EAAE,MAAM,EAIxB;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CASzB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA8BjB;CACD;AAED,MAAM,WAAW,SAAS;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IACrD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,CA+FA;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb,CAmDA"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/generation/encode-latin.js b/lib.commonjs/wordlists/generation/encode-latin.js deleted file mode 100644 index c79ba11ad..000000000 --- a/lib.commonjs/wordlists/generation/encode-latin.js +++ /dev/null @@ -1,364 +0,0 @@ -'use strict'; - -var fs = require('fs'); -var id = require('../../hash/id.js'); -var decodeOwl = require('../decode-owl.js'); -var decodeOwla = require('../decode-owla.js'); - -// OWL Data Format -// -// The Official WordList data format exported by this encoder -// encodes sorted latin-1 words (letters only) based on the -// fact that sorted words have prefixes with substantial -// overlap. -// -// For example, the words: -// [ Another, Apple, Apricot, Bread ] -// could be folded once with a single special character, such -// as ":" to yield: -// [ nother, pple, pricot, :, read ]. -// The First letter has been removed, but can be inferred by -// starting at A and incrementing to the next letter when ":" -// is encountered. -// -// The fold operation can be repeated for large sets as even within -// each folded set, there is substatial overlap in prefix. With the -// second special symbol ";", we get: -// [ ; x 13, other, :, ple, ricot, :, ; x 18, ead ] -// which can be further compressed by using numbers instead of the -// special character: -// [ 13, other, :, ple, ricot, :, 18, ead ] -// and to keep all values within a single byte, we only allow a -// maximum value of 10 (using 0 through 9 to represent 1 through 10), -// we get: -// [ 9, 2, other, :, ple, ricot, :, 9, 7, ead ] -// and we use camel-case to imply the bounrary, giving the final string: -// "92Other:PleRicot:97Ead" -// -// Once the entire latin-1 set has been collapsed, we use the remaining -// printable characters (except " and \, which require 2 bytes to represent -// in string) to substiture for the most common 2-letter pairs of letters -// in the string. -// -// OWLA Accent Format -// -// OWLA first removes all accents, and encodes that data using the OWL -// data format and encodes the accents as a base-64 series of 6-bit -// packed bits representing the distance from one followed letter to the -// next. -// -// For example, the acute accent in a given language may follow either -// a or e, in which case the follow-set is "ae". Each letter in the entire -// set is indexed, so the set of words with the accents: -// "thisA/ppleDoe/sNotMa/tterToMe/" -// " 1^ 2^ 3^ 4^ 5^ 6^ " <-- follow-set members, ALL a's and e's -// which gives the positions: -// [ 0, 2, 3, 4, 6 ] -// which then reduce to the distances -// [ 0, 2, 1, 1, 2 ] -// each of which fit into a 2-bit value, so this can be encoded as the -// base-64 encoded string: -// 00 10 01 01 10 = 001001 1010xx -// -// The base-64 set used has all number replaced with their -// shifted-counterparts to prevent comflicting with the numbers used in -// the fold operation to indicate the number of ";". -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z'`]*$/i; -function fold(words, sep) { - const output = []; - let initial = 97; - for (const word of words) { - if (word.match(Word)) { - while (initial < word.charCodeAt(0)) { - initial++; - output.push(sep); - } - output.push(word.substring(1)); - } - else { - initial = 97; - output.push(word); - } - } - return output; -} -function camelcase(words) { - return words - .map((word) => { - if (word.match(Word)) { - return word[0].toUpperCase() + word.substring(1); - } - else { - return word; - } - }) - .join(""); -} -//let cc = 0, ce = 0; -/* -function getChar(c: string): string { - //if (c === "e") { ce++; } - if (c >= 'a' && c <= 'z') { return c; } - if (c.charCodeAt(1)) { - throw new Error(`bad char: "${ c }"`); - } - //cc++; - return ""; - if (c.charCodeAt(0) === 768) { return "`"; } - if (c.charCodeAt(0) === 769) { return "'"; } - if (c.charCodeAt(0) === 771) { return "~"; } - throw new Error(`Unsupported character: ${ c } (${ c.charCodeAt(0) }, ${ c.charCodeAt(1) })`); -} -function mangle(text: string): { word: string, special: string } { - const result: Array = [ ]; - for (let i = 0; i < text.length; i++) { - const c = getChar(text[i]); - result.push(c); - } - - const word = result.join(""); - if (word[1] >= 'a' && word[1] <= 'z') { return { word, special: " " }; } - return { word: word[0] + word.substring(2), special: word[1] }; -} -*/ -/* - Store: [ accent ][ targets ][ rle data; base64-tail ] - ` ae 3, 100 = (63, 37), 15 - ~ n 63, 64 = (63, 1), 27 -*/ -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -class BitWriter { - width; - #data; - #bitLength; - constructor(width) { - this.width = width; - this.#data = []; - this.#bitLength = 0; - } - write(value) { - const maxValue = (1 << this.width) - 1; - while (value > maxValue) { - this.#data.push(0); - this.#bitLength += this.width; - value -= maxValue; - } - this.#data.push(value); - this.#bitLength += this.width; - } - get length() { - return 1 + Math.trunc((this.#bitLength + 5) / 6); - } - get data() { - let result = String(this.width); - let bits = 0; - let accum = 0; - const data = this.#data.slice(); - let bitMod = this.#bitLength % 6; - while (bitMod !== 0 && bitMod < 6) { - data.push(0); - bitMod += this.width; - } - for (const value of data) { - accum <<= this.width; - accum |= value; - bits += this.width; - if (bits < 6) { - continue; - } - result += Base64[accum >> (bits - 6)]; - bits -= 6; - accum &= (1 << bits) - 1; - } - if (result.length !== this.length) { - throw new Error(`Hmm: ${this.length} ${result.length} ${result}`); - } - return result; - } -} -function sorted(text) { - const letters = text.split(""); - letters.sort(); - return letters.join(""); -} -// if (c.charCodeAt(0) === 768) { return "`"; } -// if (c.charCodeAt(0) === 769) { return "'"; } -// if (c.charCodeAt(0) === 771) { return "~"; } -function extractAccents(words) { - // Build a list that maps accents to the letters it can follow - const followsMap = new Map(); - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= "a" && c <= "z") { - continue; - } - // Make sure this positions and codepoint make sense - if (c.charCodeAt(1)) { - throw new Error(`unsupported codepoint: "${c}"`); - } - if (i === 0) { - throw new Error(`unmatched accent: ${c}`); - } - const ac = c.charCodeAt(0), lastLetter = word[i - 1]; - const follows = followsMap.get(ac) || ""; - if (follows.indexOf(lastLetter) === -1) { - followsMap.set(ac, sorted(follows + lastLetter)); - } - } - } - // Build the positions of each follow-set for those accents - const positionsMap = new Map(); - for (const [accent, follows] of followsMap) { - let count = 0; - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i], ac = c.charCodeAt(0); - if (follows.indexOf(c) >= 0) { - count++; - } - if (ac === accent) { - const pos = positionsMap.get(ac) || []; - pos.push(count); - positionsMap.set(ac, pos); - } - } - } - } - const accents = []; - for (const [accent, follows] of followsMap) { - let last = -1; - const positions = (positionsMap.get(accent) || []).map((value, index) => { - const delta = value - last; - last = value; - if (index === 0) { - return value; - } - return delta; - }); - // Find the best encoding of the position data - let positionData = ""; - for (let i = 2; i < 7; i++) { - const bitWriter = new BitWriter(i); - for (const p of positions) { - bitWriter.write(p); - } - if (positionData === "" || bitWriter.length < positionData.length) { - positionData = bitWriter.data; - } - } - const positionsLength = positions.length; - const positionDataLength = positionData.length; - accents.push({ - accent, - follows, - positions, - positionsLength, - positionData, - positionDataLength, - }); - } - words = words.map((word) => { - let result = ""; - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= "a" && c <= "z") { - result += c; - } - } - return result; - }); - return { accents, words }; -} -// Encode Official WordList -function encodeOwl(words) { - // Fold the sorted words by indicating delta for the first 2 letters - let data = camelcase(fold(fold(words, ":"), ";")); - // Replace semicolons with counts (e.g. ";;;" with "3") - data = data.replace(/(;+)/g, (all, semis) => { - let result = ""; - while (semis.length) { - let count = semis.length; - if (count > 10) { - count = 10; - } - result += String(count - 1); - semis = semis.substring(count); - } - return result; - }); - // Finds the best option for a shortcut replacement using the - // unused ascii7 characters - function findBest() { - const tally = {}; - const l = 2; - for (let i = l; i < data.length; i++) { - const key = data.substring(i - l, i); - tally[key] = (tally[key] || 0) + 1; - } - const sorted = Object.keys(tally).map((text) => { - return { - text, - count: tally[text], - save: tally[text] * (text.length - 1), - }; - }); - sorted.sort((a, b) => b.save - a.save); - return sorted[0].text; - } - // Make substitutions - let subs = ""; - for (let i = 0; i < subsChrs.length; i++) { - const n = subsChrs[i], o = findBest(); - subs += o; - data = data.split(o).join(n); - } - return { data, subs }; -} -// Returns either: -// - OWL data for accent-free latin-1: { data, accentds: "" } -// - OWLA data for accented latin-1: { data, accents } -function encodeWords(_words) { - const { accents, words } = extractAccents(_words); - const { data, subs } = encodeOwl(words); - const accentData = accents - .map(({ accent, follows, positionData }) => { - return `${follows}${accent}${positionData}`; - }) - .join(","); - return { - data: `0${subs}${data}`, - accents: accentData, - }; -} -// CLI -const content = fs.readFileSync(process.argv[2]).toString(); -const words = content.split("\n").filter(Boolean); -const { data, accents } = encodeWords(words); -if (accents) { - const rec = decodeOwla.decodeOwlA(data, accents); - console.log("DATA: ", JSON.stringify(data)); - console.log("ACCENTS: ", JSON.stringify(accents)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id.id(content)); - console.log("RATIO: ", Math.trunc((100 * data.length) / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } -} -else { - const rec = decodeOwl.decodeOwl(data); - console.log("DATA: ", JSON.stringify(data)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id.id(content)); - console.log("RATIO: ", Math.trunc((100 * data.length) / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } -} - -exports.BitWriter = BitWriter; -exports.encodeOwl = encodeOwl; -exports.extractAccents = extractAccents; -//# sourceMappingURL=encode-latin.js.map diff --git a/lib.commonjs/wordlists/generation/encode-latin.js.map b/lib.commonjs/wordlists/generation/encode-latin.js.map deleted file mode 100644 index 967dac258..000000000 --- a/lib.commonjs/wordlists/generation/encode-latin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode-latin.js","sources":["../../../lib.esm/wordlists/generation/encode-latin.js"],"sourcesContent":["// OWL Data Format\n//\n// The Official WordList data format exported by this encoder\n// encodes sorted latin-1 words (letters only) based on the\n// fact that sorted words have prefixes with substantial\n// overlap.\n//\n// For example, the words:\n// [ Another, Apple, Apricot, Bread ]\n// could be folded once with a single special character, such\n// as \":\" to yield:\n// [ nother, pple, pricot, :, read ].\n// The First letter has been removed, but can be inferred by\n// starting at A and incrementing to the next letter when \":\"\n// is encountered.\n//\n// The fold operation can be repeated for large sets as even within\n// each folded set, there is substatial overlap in prefix. With the\n// second special symbol \";\", we get:\n// [ ; x 13, other, :, ple, ricot, :, ; x 18, ead ]\n// which can be further compressed by using numbers instead of the\n// special character:\n// [ 13, other, :, ple, ricot, :, 18, ead ]\n// and to keep all values within a single byte, we only allow a\n// maximum value of 10 (using 0 through 9 to represent 1 through 10),\n// we get:\n// [ 9, 2, other, :, ple, ricot, :, 9, 7, ead ]\n// and we use camel-case to imply the bounrary, giving the final string:\n// \"92Other:PleRicot:97Ead\"\n//\n// Once the entire latin-1 set has been collapsed, we use the remaining\n// printable characters (except \" and \\, which require 2 bytes to represent\n// in string) to substiture for the most common 2-letter pairs of letters\n// in the string.\n//\n// OWLA Accent Format\n//\n// OWLA first removes all accents, and encodes that data using the OWL\n// data format and encodes the accents as a base-64 series of 6-bit\n// packed bits representing the distance from one followed letter to the\n// next.\n//\n// For example, the acute accent in a given language may follow either\n// a or e, in which case the follow-set is \"ae\". Each letter in the entire\n// set is indexed, so the set of words with the accents:\n// \"thisA/ppleDoe/sNotMa/tterToMe/\"\n// \" 1^ 2^ 3^ 4^ 5^ 6^ \" <-- follow-set members, ALL a's and e's\n// which gives the positions:\n// [ 0, 2, 3, 4, 6 ]\n// which then reduce to the distances\n// [ 0, 2, 1, 1, 2 ]\n// each of which fit into a 2-bit value, so this can be encoded as the\n// base-64 encoded string:\n// 00 10 01 01 10 = 001001 1010xx\n//\n// The base-64 set used has all number replaced with their\n// shifted-counterparts to prevent comflicting with the numbers used in\n// the fold operation to indicate the number of \";\".\nimport fs from \"fs\";\nimport { id } from \"../../hash/id.js\";\nimport { decodeOwl } from \"../decode-owl.js\";\nimport { decodeOwlA } from \"../decode-owla.js\";\nconst subsChrs = \" !#$%&'()*+,-./<=>?@[]^_`{|}~\";\nconst Word = /^[a-z'`]*$/i;\nfunction fold(words, sep) {\n const output = [];\n let initial = 97;\n for (const word of words) {\n if (word.match(Word)) {\n while (initial < word.charCodeAt(0)) {\n initial++;\n output.push(sep);\n }\n output.push(word.substring(1));\n }\n else {\n initial = 97;\n output.push(word);\n }\n }\n return output;\n}\nfunction camelcase(words) {\n return words\n .map((word) => {\n if (word.match(Word)) {\n return word[0].toUpperCase() + word.substring(1);\n }\n else {\n return word;\n }\n })\n .join(\"\");\n}\n//let cc = 0, ce = 0;\n/*\nfunction getChar(c: string): string {\n //if (c === \"e\") { ce++; }\n if (c >= 'a' && c <= 'z') { return c; }\n if (c.charCodeAt(1)) {\n throw new Error(`bad char: \"${ c }\"`);\n }\n //cc++;\n return \"\";\n if (c.charCodeAt(0) === 768) { return \"`\"; }\n if (c.charCodeAt(0) === 769) { return \"'\"; }\n if (c.charCodeAt(0) === 771) { return \"~\"; }\n throw new Error(`Unsupported character: ${ c } (${ c.charCodeAt(0) }, ${ c.charCodeAt(1) })`);\n}\nfunction mangle(text: string): { word: string, special: string } {\n const result: Array = [ ];\n for (let i = 0; i < text.length; i++) {\n const c = getChar(text[i]);\n result.push(c);\n }\n\n const word = result.join(\"\");\n if (word[1] >= 'a' && word[1] <= 'z') { return { word, special: \" \" }; }\n return { word: word[0] + word.substring(2), special: word[1] };\n}\n*/\n/*\n Store: [ accent ][ targets ][ rle data; base64-tail ]\n ` ae 3, 100 = (63, 37), 15\n ~ n 63, 64 = (63, 1), 27\n*/\nconst Base64 = \")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_\";\nexport class BitWriter {\n width;\n #data;\n #bitLength;\n constructor(width) {\n this.width = width;\n this.#data = [];\n this.#bitLength = 0;\n }\n write(value) {\n const maxValue = (1 << this.width) - 1;\n while (value > maxValue) {\n this.#data.push(0);\n this.#bitLength += this.width;\n value -= maxValue;\n }\n this.#data.push(value);\n this.#bitLength += this.width;\n }\n get length() {\n return 1 + Math.trunc((this.#bitLength + 5) / 6);\n }\n get data() {\n let result = String(this.width);\n let bits = 0;\n let accum = 0;\n const data = this.#data.slice();\n let bitMod = this.#bitLength % 6;\n while (bitMod !== 0 && bitMod < 6) {\n data.push(0);\n bitMod += this.width;\n }\n for (const value of data) {\n accum <<= this.width;\n accum |= value;\n bits += this.width;\n if (bits < 6) {\n continue;\n }\n result += Base64[accum >> (bits - 6)];\n bits -= 6;\n accum &= (1 << bits) - 1;\n }\n if (result.length !== this.length) {\n throw new Error(`Hmm: ${this.length} ${result.length} ${result}`);\n }\n return result;\n }\n}\nfunction sorted(text) {\n const letters = text.split(\"\");\n letters.sort();\n return letters.join(\"\");\n}\n// if (c.charCodeAt(0) === 768) { return \"`\"; }\n// if (c.charCodeAt(0) === 769) { return \"'\"; }\n// if (c.charCodeAt(0) === 771) { return \"~\"; }\nexport function extractAccents(words) {\n // Build a list that maps accents to the letters it can follow\n const followsMap = new Map();\n for (const word of words) {\n for (let i = 0; i < word.length; i++) {\n const c = word[i];\n if (c >= \"a\" && c <= \"z\") {\n continue;\n }\n // Make sure this positions and codepoint make sense\n if (c.charCodeAt(1)) {\n throw new Error(`unsupported codepoint: \"${c}\"`);\n }\n if (i === 0) {\n throw new Error(`unmatched accent: ${c}`);\n }\n const ac = c.charCodeAt(0), lastLetter = word[i - 1];\n const follows = followsMap.get(ac) || \"\";\n if (follows.indexOf(lastLetter) === -1) {\n followsMap.set(ac, sorted(follows + lastLetter));\n }\n }\n }\n // Build the positions of each follow-set for those accents\n const positionsMap = new Map();\n for (const [accent, follows] of followsMap) {\n let count = 0;\n for (const word of words) {\n for (let i = 0; i < word.length; i++) {\n const c = word[i], ac = c.charCodeAt(0);\n if (follows.indexOf(c) >= 0) {\n count++;\n }\n if (ac === accent) {\n const pos = positionsMap.get(ac) || [];\n pos.push(count);\n positionsMap.set(ac, pos);\n }\n }\n }\n }\n const accents = [];\n for (const [accent, follows] of followsMap) {\n let last = -1;\n const positions = (positionsMap.get(accent) || []).map((value, index) => {\n const delta = value - last;\n last = value;\n if (index === 0) {\n return value;\n }\n return delta;\n });\n // Find the best encoding of the position data\n let positionData = \"\";\n for (let i = 2; i < 7; i++) {\n const bitWriter = new BitWriter(i);\n for (const p of positions) {\n bitWriter.write(p);\n }\n if (positionData === \"\" || bitWriter.length < positionData.length) {\n positionData = bitWriter.data;\n }\n }\n const positionsLength = positions.length;\n const positionDataLength = positionData.length;\n accents.push({\n accent,\n follows,\n positions,\n positionsLength,\n positionData,\n positionDataLength,\n });\n }\n words = words.map((word) => {\n let result = \"\";\n for (let i = 0; i < word.length; i++) {\n const c = word[i];\n if (c >= \"a\" && c <= \"z\") {\n result += c;\n }\n }\n return result;\n });\n return { accents, words };\n}\n// Encode Official WordList\nexport function encodeOwl(words) {\n // Fold the sorted words by indicating delta for the first 2 letters\n let data = camelcase(fold(fold(words, \":\"), \";\"));\n // Replace semicolons with counts (e.g. \";;;\" with \"3\")\n data = data.replace(/(;+)/g, (all, semis) => {\n let result = \"\";\n while (semis.length) {\n let count = semis.length;\n if (count > 10) {\n count = 10;\n }\n result += String(count - 1);\n semis = semis.substring(count);\n }\n return result;\n });\n // Finds the best option for a shortcut replacement using the\n // unused ascii7 characters\n function findBest() {\n const tally = {};\n const l = 2;\n for (let i = l; i < data.length; i++) {\n const key = data.substring(i - l, i);\n tally[key] = (tally[key] || 0) + 1;\n }\n const sorted = Object.keys(tally).map((text) => {\n return {\n text,\n count: tally[text],\n save: tally[text] * (text.length - 1),\n };\n });\n sorted.sort((a, b) => b.save - a.save);\n return sorted[0].text;\n }\n // Make substitutions\n let subs = \"\";\n for (let i = 0; i < subsChrs.length; i++) {\n const n = subsChrs[i], o = findBest();\n subs += o;\n data = data.split(o).join(n);\n }\n return { data, subs };\n}\n// Returns either:\n// - OWL data for accent-free latin-1: { data, accentds: \"\" }\n// - OWLA data for accented latin-1: { data, accents }\nfunction encodeWords(_words) {\n const { accents, words } = extractAccents(_words);\n const { data, subs } = encodeOwl(words);\n const accentData = accents\n .map(({ accent, follows, positionData }) => {\n return `${follows}${accent}${positionData}`;\n })\n .join(\",\");\n return {\n data: `0${subs}${data}`,\n accents: accentData,\n };\n}\n// CLI\nconst content = fs.readFileSync(process.argv[2]).toString();\nconst words = content.split(\"\\n\").filter(Boolean);\nconst { data, accents } = encodeWords(words);\nif (accents) {\n const rec = decodeOwlA(data, accents);\n console.log(\"DATA: \", JSON.stringify(data));\n console.log(\"ACCENTS: \", JSON.stringify(accents));\n console.log(\"LENGTH: \", data.length);\n console.log(\"CHECKSUM: \", id(content));\n console.log(\"RATIO: \", Math.trunc((100 * data.length) / content.length) + \"%\");\n if (rec.join(\"\\n\") !== words.join(\"\\n\")) {\n throw new Error(\"no match!\");\n }\n}\nelse {\n const rec = decodeOwl(data);\n console.log(\"DATA: \", JSON.stringify(data));\n console.log(\"LENGTH: \", data.length);\n console.log(\"CHECKSUM: \", id(content));\n console.log(\"RATIO: \", Math.trunc((100 * data.length) / content.length) + \"%\");\n if (rec.join(\"\\n\") !== words.join(\"\\n\")) {\n throw new Error(\"no match!\");\n }\n}\n//# sourceMappingURL=encode-latin.js.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;AACpC,IAAI;AACJ;AACA,KAAK;AACL,IAAI,MAAM,GAAG,GAAGC,mBAAS,CAAC,IAAI,CAAC;AAC/B,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACnD,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC;AAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAED,KAAE,CAAC,OAAO,CAAC,CAAC;AAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AACrF,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;AAC7C,QAAQ,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC;AACpC,IAAI;AACJ;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/index.d.ts b/lib.commonjs/wordlists/index.d.ts deleted file mode 100644 index 04a911c83..000000000 --- a/lib.commonjs/wordlists/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -export { Wordlist } from "./wordlist.js"; -export { LangEn } from "./lang-en.js"; -export { WordlistOwl } from "./wordlist-owl.js"; -export { WordlistOwlA } from "./wordlist-owla.js"; -export { wordlists } from "./wordlists.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/index.d.ts.map b/lib.commonjs/wordlists/index.d.ts.map deleted file mode 100644 index ecd1d4b63..000000000 --- a/lib.commonjs/wordlists/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/index.js b/lib.commonjs/wordlists/index.js deleted file mode 100644 index 4b079f673..000000000 --- a/lib.commonjs/wordlists/index.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - -var wordlist = require('./wordlist.js'); -var langEn = require('./lang-en.js'); -var wordlistOwl = require('./wordlist-owl.js'); -var wordlistOwla = require('./wordlist-owla.js'); -var wordlists = require('./wordlists.js'); - - - -exports.Wordlist = wordlist.Wordlist; -exports.LangEn = langEn.LangEn; -exports.WordlistOwl = wordlistOwl.WordlistOwl; -exports.WordlistOwlA = wordlistOwla.WordlistOwlA; -exports.wordlists = wordlists.wordlists; -//# sourceMappingURL=index.js.map diff --git a/lib.commonjs/wordlists/index.js.map b/lib.commonjs/wordlists/index.js.map deleted file mode 100644 index 7d29fe54e..000000000 --- a/lib.commonjs/wordlists/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-cz.d.ts b/lib.commonjs/wordlists/lang-cz.d.ts deleted file mode 100644 index c199d4fad..000000000 --- a/lib.commonjs/wordlists/lang-cz.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist(): LangCz; -} -//# sourceMappingURL=lang-cz.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-cz.d.ts.map b/lib.commonjs/wordlists/lang-cz.d.ts.map deleted file mode 100644 index 344196e7e..000000000 --- a/lib.commonjs/wordlists/lang-cz.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-cz.js b/lib.commonjs/wordlists/lang-cz.js deleted file mode 100644 index 89d81d54f..000000000 --- a/lib.commonjs/wordlists/lang-cz.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -var wordlistOwl = require('./wordlist-owl.js'); - -const words = "0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}a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ocn Odr!Rzl.Ut|0AkAl(Am@!Ovu0B,z Tav Ub-Ufa+0Lod Omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk"; -const checksum = "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; -let wordlist = null; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangCz extends wordlistOwl.WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor() { - super("cz", words, checksum); - } - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangCz(); - } - return wordlist; - } -} - -exports.LangCz = LangCz; -//# sourceMappingURL=lang-cz.js.map diff --git a/lib.commonjs/wordlists/lang-cz.js.map b/lib.commonjs/wordlists/lang-cz.js.map deleted file mode 100644 index 1d980703a..000000000 --- a/lib.commonjs/wordlists/lang-cz.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-cz.js","sources":["../../lib.esm/wordlists/lang-cz.js"],"sourcesContent":["import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaUb_U/!U^U+Ur!Xer2A^v#Ambo,An#AtrEp)Ike)KoLohOnzOskevUn{#Usin#Z^Zy2Bl.Bn|})D _D#D'aF{Jar(Kv?LdokLvaN^NkrRzaTikVolZola3D+tL.T'#0Ukot:PartRev&3DrDu+J/JnLaLerLkemLn?N.Nn(N'#NtrumNzZ(2O&2KolivUv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ases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangCz extends WordlistOwl {\n /**\n * Creates a new instance of the Czech language Wordlist.\n *\n * Using the constructor should be unnecessary, instead use the\n * [[wordlist]] singleton method.\n *\n * @_ignore:\n */\n constructor() {\n super(\"cz\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangCz``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangCz();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-cz.js.map"],"names":["WordlistOwl"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,q9NAAq9N;AACn+N,MAAM,QAAQ,GAAG,oEAAoE;AACrF,IAAI,QAAQ,GAAG,IAAI;AACnB;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,uBAAW,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-en.d.ts b/lib.commonjs/wordlists/lang-en.d.ts deleted file mode 100644 index 87a3234bb..000000000 --- a/lib.commonjs/wordlists/lang-en.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEn; -} -//# sourceMappingURL=lang-en.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-en.d.ts.map b/lib.commonjs/wordlists/lang-en.d.ts.map deleted file mode 100644 index bcff43d4d..000000000 --- a/lib.commonjs/wordlists/lang-en.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-en.js b/lib.commonjs/wordlists/lang-en.js deleted file mode 100644 index fa2429b53..000000000 --- a/lib.commonjs/wordlists/lang-en.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -var wordlistOwl = require('./wordlist-owl.js'); - -const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#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s]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurEAyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; -const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; -let wordlist = null; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangEn extends wordlistOwl.WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { - super("en", words, checksum); - } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } -} - -exports.LangEn = LangEn; -//# sourceMappingURL=lang-en.js.map diff --git a/lib.commonjs/wordlists/lang-en.js.map b/lib.commonjs/wordlists/lang-en.js.map deleted file mode 100644 index e64a93b2e..000000000 --- a/lib.commonjs/wordlists/lang-en.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-en.js","sources":["../../lib.esm/wordlists/lang-en.js"],"sourcesContent":["import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChClude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dyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO\";\nconst checksum = \"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60\";\nlet wordlist = null;\n/**\n * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangEn extends WordlistOwl {\n /**\n * Creates a new instance of the English language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langEn]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"en\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangEn``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangEn();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-en.js.map"],"names":["WordlistOwl"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,u3LAAu3L;AACr4L,MAAM,QAAQ,GAAG,oEAAoE;AACrF,IAAI,QAAQ,GAAG,IAAI;AACnB;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,uBAAW,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-es.d.ts b/lib.commonjs/wordlists/lang-es.d.ts deleted file mode 100644 index 7e51683e7..000000000 --- a/lib.commonjs/wordlists/lang-es.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwlA } from "./wordlist-owla.js"; -/** - * The [[link-bip39-es]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEs extends WordlistOwlA { - /** - * Creates a new instance of the Spanish language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEs]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEs``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEs; -} -//# sourceMappingURL=lang-es.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-es.d.ts.map b/lib.commonjs/wordlists/lang-es.d.ts.map deleted file mode 100644 index e52928599..000000000 --- a/lib.commonjs/wordlists/lang-es.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-es.js b/lib.commonjs/wordlists/lang-es.js deleted file mode 100644 index e861d2758..000000000 --- a/lib.commonjs/wordlists/lang-es.js +++ /dev/null @@ -1,39 +0,0 @@ -'use strict'; - -var wordlistOwla = require('./wordlist-owla.js'); - -const words = "0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZo3Bol]D!D+Ld/eb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ngo*Nist)NoN.siNu(idePar'S`S ,Tu#2It+Ogatu-Ove$0Arr{Emor#En^ E-l@IlzoOnt&Ott#Uss#0Elli!Erv#O@0BbalzoBr'C]r(C?,Da,Ffi|G$Ld#L[M`NdaNe|Nnife)Pi!Ppe(P-Rge!Rpas(Rri(R(R.gg'R_l#Spi)S+T^,0AdaAl/Arge!A /Av[ Azzo/EcieEdi!EgRappoReg#Ridu*Rozz&Ru|Ucc&UfoUp[@0B[t)C](Do!Gger{GoL+$On&PerboPpor Rgel#R)g#Ssur)Tu-0Ag&EdeseEgl'El&Enu Ez?IluppoIs+Izze-Ol+Uot&:Bac]Bul#Cci&Citur$LeLis`$MpoVer=Vo/+Zza3CaCn>Lefo$Me-r'MpoMu N@Pog-foRagg'RoTan'To*Tuban.Z'Zzo<5Cc&L,r&L Mbo/MoNfoNsil/Paz'Po*g?PpaRbaRn&R)L,t+Lo)(Lut&L_/Mpa+Ng&N{(NoN+gg'Nve-Po!Ra$Rc#R?n.S}3Det+DovaDu Ge+,I]*Lc)Li=Llu LoceN#Ndemm?N RaceRba,Rgog=Rif~RoRru}Rt~,Sc~Ssil*S+,Te-$Tri=Tus 3Andan.B-n.C[daChingoCi=nzaDim&Gil?G< Go!LeL/$MiniNc{!O/Pe-Rgo/Ro*goRu,n S](S'5Cche)Fo*LuPpa\";\nconst checksum = \"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620\";\nlet wordlist = null;\n/**\n * The [[link-bip39-it]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangIt extends WordlistOwl {\n /**\n * Creates a new instance of the Italian language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langIt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"it\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangIt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangIt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-it.js.map"],"names":["WordlistOwl"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,0+OAA0+O;AACx/O,MAAM,QAAQ,GAAG,oEAAoE;AACrF,IAAI,QAAQ,GAAG,IAAI;AACnB;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,uBAAW,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ja.d.ts b/lib.commonjs/wordlists/lang-ja.d.ts deleted file mode 100644 index 58224a15a..000000000 --- a/lib.commonjs/wordlists/lang-ja.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangJa extends Wordlist { - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor(); - getWord(index: number): string; - getWordIndex(word: string): number; - split(phrase: string): Array; - join(words: Array): string; - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist(): LangJa; -} -//# sourceMappingURL=lang-ja.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ja.d.ts.map b/lib.commonjs/wordlists/lang-ja.d.ts.map deleted file mode 100644 index 82a3ec1e4..000000000 --- a/lib.commonjs/wordlists/lang-ja.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6IzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ja.js b/lib.commonjs/wordlists/lang-ja.js deleted file mode 100644 index 6eecae492..000000000 --- a/lib.commonjs/wordlists/lang-ja.js +++ /dev/null @@ -1,188 +0,0 @@ -'use strict'; - -var id = require('../hash/id.js'); -require('../constants/numbers.js'); -require('../address/index.js'); -require('../utils/base58.js'); -var data$1 = require('../utils/data.js'); -var errors = require('../utils/errors.js'); -require('../logger/logger.js'); -var utf8 = require('../utils/utf8.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -var wordlist$1 = require('./wordlist.js'); - -const data = [ - // 4-kana words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qXKDcNJhKVJrNYKbgJVXKFVJSBNBYBwDNJeQfXNJeEqXNhGJWENJFiJRQlIJbEQJfXxDQqXcfXQFNDEJQFwXUJDYcnUJDJIBgQDIUJTRDJFEqDSJQSJFSJQIJFSOPeZtSJFZJHCJXQfXCTDEqFGJBSJFGJBOfXGJBcqXGJHNJDGJRLiJEJfXEqEJFEJPEFpBEJYJBZJFYBwXUJYiJMEBYJZJyTYTONJXpQMFXFpeGIDdpJFstXpJFcPDLBVSJRLHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC", - // 8-kana words - "BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD", - // 9-kana words - "QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD", - // 10-kana words - "IJBEJqXZJ", -]; -// Maps each character into its kana value (the index) -const mapping = "~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt"; -let _wordlist = null; -function hex(word) { - return data$1.hexlify(utf8.toUtf8Bytes(word)); -} -const KiYoKu = "0xe3818de38284e3818f"; -const KyoKu = "0xe3818de38283e3818f"; -function toString(data) { - return utf8.toUtf8String(new Uint8Array(data)); -} -function loadWords() { - if (_wordlist !== null) { - return _wordlist; - } - const wordlist = []; - // Transforms for normalizing (sort is a not quite UTF-8) - const transform = {}; - // Delete the diacritic marks - transform[toString([227, 130, 154])] = false; - transform[toString([227, 130, 153])] = false; - // Some simple transforms that sort out most of the order - transform[toString([227, 130, 133])] = toString([227, 130, 134]); - transform[toString([227, 129, 163])] = toString([227, 129, 164]); - transform[toString([227, 130, 131])] = toString([227, 130, 132]); - transform[toString([227, 130, 135])] = toString([227, 130, 136]); - // Normalize words using the transform - function normalize(word) { - let result = ""; - for (let i = 0; i < word.length; i++) { - let kana = word[i]; - const target = transform[kana]; - if (target === false) { - continue; - } - if (target) { - kana = target; - } - result += kana; - } - return result; - } - // Sort how the Japanese list is sorted - function sortJapanese(a, b) { - a = normalize(a); - b = normalize(b); - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; - } - // Load all the words - for (let length = 3; length <= 9; length++) { - const d = data[length - 3]; - for (let offset = 0; offset < d.length; offset += length) { - const word = []; - for (let i = 0; i < length; i++) { - const k = mapping.indexOf(d[offset + i]); - word.push(227); - word.push(k & 0x40 ? 130 : 129); - word.push((k & 0x3f) + 128); - } - wordlist.push(toString(word)); - } - } - wordlist.sort(sortJapanese); - // For some reason kyoku and kiyoku are flipped in node (!!). - // The order SHOULD be: - // - kyoku - // - kiyoku - // This should ignore "if", but that doesn't work here?? - /* c8 ignore start */ - if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) { - const tmp = wordlist[442]; - wordlist[442] = wordlist[443]; - wordlist[443] = tmp; - } - /* c8 ignore stop */ - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id.id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== - "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600") { - throw new Error("BIP39 Wordlist for ja (Japanese) FAILED"); - } - /* c8 ignore stop */ - _wordlist = wordlist; - return wordlist; -} -let wordlist = null; -/** - * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangJa extends wordlist$1.Wordlist { - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ja"); - } - getWord(index) { - const words = loadWords(); - errors.assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords().indexOf(word); - } - split(phrase) { - //logger.assertNormalize(); - return phrase.split(/(?:\u3000| )+/g); - } - join(words) { - return words.join("\u3000"); - } - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangJa(); - } - return wordlist; - } -} - -exports.LangJa = LangJa; -//# sourceMappingURL=lang-ja.js.map diff --git a/lib.commonjs/wordlists/lang-ja.js.map b/lib.commonjs/wordlists/lang-ja.js.map deleted file mode 100644 index 55e75d39b..000000000 --- a/lib.commonjs/wordlists/lang-ja.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ja.js","sources":["../../lib.esm/wordlists/lang-ja.js"],"sourcesContent":["import { id } from \"../hash/index.js\";\nimport { hexlify, assertArgument, toUtf8Bytes, toUtf8String, } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n // 4-kana words\n \"AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYN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LHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC\",\n // 8-kana words\n \"BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD\",\n // 9-kana words\n \"QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD\",\n // 10-kana words\n \"IJBEJqXZJ\",\n];\n// Maps each character into its kana value (the index)\nconst mapping = \"~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt\";\nlet _wordlist = null;\nfunction hex(word) {\n return hexlify(toUtf8Bytes(word));\n}\nconst KiYoKu = \"0xe3818de38284e3818f\";\nconst KyoKu = \"0xe3818de38283e3818f\";\nfunction toString(data) {\n return toUtf8String(new Uint8Array(data));\n}\nfunction loadWords() {\n if (_wordlist !== null) {\n return _wordlist;\n }\n const wordlist = [];\n // Transforms for normalizing (sort is a not quite UTF-8)\n const transform = {};\n // Delete the diacritic marks\n transform[toString([227, 130, 154])] = false;\n transform[toString([227, 130, 153])] = false;\n // Some simple transforms that sort out most of the order\n transform[toString([227, 130, 133])] = toString([227, 130, 134]);\n transform[toString([227, 129, 163])] = toString([227, 129, 164]);\n transform[toString([227, 130, 131])] = toString([227, 130, 132]);\n transform[toString([227, 130, 135])] = toString([227, 130, 136]);\n // Normalize words using the transform\n function normalize(word) {\n let result = \"\";\n for (let i = 0; i < word.length; i++) {\n let kana = word[i];\n const target = transform[kana];\n if (target === false) {\n continue;\n }\n if (target) {\n kana = target;\n }\n result += kana;\n }\n return result;\n }\n // Sort how the Japanese list is sorted\n function sortJapanese(a, b) {\n a = normalize(a);\n b = normalize(b);\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n }\n // Load all the words\n for (let length = 3; length <= 9; length++) {\n const d = data[length - 3];\n for (let offset = 0; offset < d.length; offset += length) {\n const word = [];\n for (let i = 0; i < length; i++) {\n const k = mapping.indexOf(d[offset + i]);\n word.push(227);\n word.push(k & 0x40 ? 130 : 129);\n word.push((k & 0x3f) + 128);\n }\n wordlist.push(toString(word));\n }\n }\n wordlist.sort(sortJapanese);\n // For some reason kyoku and kiyoku are flipped in node (!!).\n // The order SHOULD be:\n // - kyoku\n // - kiyoku\n // This should ignore \"if\", but that doesn't work here??\n /* c8 ignore start */\n if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {\n const tmp = wordlist[442];\n wordlist[442] = wordlist[443];\n wordlist[443] = tmp;\n }\n /* c8 ignore stop */\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600\") {\n throw new Error(\"BIP39 Wordlist for ja (Japanese) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangJa extends Wordlist {\n /**\n * Creates a new instance of the Japanese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langJa]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ja\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n split(phrase) {\n //logger.assertNormalize();\n return phrase.split(/(?:\\u3000| )+/g);\n }\n join(words) {\n return words.join(\"\\u3000\");\n }\n /**\n * Returns a singleton instance of a ``LangJa``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangJa();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ja.js.map"],"names":["hexlify","toUtf8Bytes","toUtf8String","id","Wordlist","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,IAAI,GAAG;AACb;AACA,IAAI,orEAAorE;AACxrE;AACA,IAAI,ssGAAssG;AAC1sG;AACA,IAAI,4uDAA4uD;AAChvD;AACA,IAAI,olBAAolB;AACxlB;AACA,IAAI,4JAA4J;AAChK;AACA,IAAI,0GAA0G;AAC9G;AACA,IAAI,WAAW;AACf,CAAC;AACD;AACA,MAAM,OAAO,GAAG,6FAA6F;AAC7G,IAAI,SAAS,GAAG,IAAI;AACpB,SAAS,GAAG,CAAC,IAAI,EAAE;AACnB,IAAI,OAAOA,cAAO,CAACC,gBAAW,CAAC,IAAI,CAAC,CAAC;AACrC;AACA,MAAM,MAAM,GAAG,sBAAsB;AACrC,MAAM,KAAK,GAAG,sBAAsB;AACpC,SAAS,QAAQ,CAAC,IAAI,EAAE;AACxB,IAAI,OAAOC,iBAAY,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;AAC7C;AACA,SAAS,SAAS,GAAG;AACrB,IAAI,IAAI,SAAS,KAAK,IAAI,EAAE;AAC5B,QAAQ,OAAO,SAAS;AACxB,IAAI;AACJ,IAAI,MAAM,QAAQ,GAAG,EAA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oB,EAAE,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC;AAC1G,QAAQ,OAAO,KAAK,CAAC,KAAK,CAAC;AAC3B,IAAI;AACJ,IAAI,YAAY,CAAC,IAAI,EAAE;AACvB,QAAQ,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;AACxC,IAAI;AACJ,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB;AACA,QAAQ,OAAO,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC;AAC7C,IAAI;AACJ,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,QAAQ,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;AACnC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ko.d.ts b/lib.commonjs/wordlists/lang-ko.d.ts deleted file mode 100644 index 4329e0556..000000000 --- a/lib.commonjs/wordlists/lang-ko.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor(); - getWord(index: number): string; - getWordIndex(word: string): number; - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist(): LangKo; -} -//# sourceMappingURL=lang-ko.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ko.d.ts.map b/lib.commonjs/wordlists/lang-ko.d.ts.map deleted file mode 100644 index 4e6fdeecb..000000000 --- a/lib.commonjs/wordlists/lang-ko.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-ko.js b/lib.commonjs/wordlists/lang-ko.js deleted file mode 100644 index 9fb6dc3f2..000000000 --- a/lib.commonjs/wordlists/lang-ko.js +++ /dev/null @@ -1,120 +0,0 @@ -'use strict'; - -var id = require('../hash/id.js'); -require('../constants/numbers.js'); -require('../address/index.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var utf8 = require('../utils/utf8.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -var wordlist$1 = require('./wordlist.js'); - -const data = [ - "OYAa", - "ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnA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Sb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg", - "HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb", - "AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl", -]; -const codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"; -function getHangul(code) { - if (code >= 40) { - code = code + 168 - 40; - } - else if (code >= 19) { - code = code + 97 - 19; - } - return utf8.toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128])); -} -let _wordlist = null; -function loadWords() { - if (_wordlist != null) { - return _wordlist; - } - const wordlist = []; - data.forEach((data, length) => { - length += 4; - for (let i = 0; i < data.length; i += length) { - let word = ""; - for (let j = 0; j < length; j++) { - word += getHangul(codes.indexOf(data[i + j])); - } - wordlist.push(word); - } - }); - wordlist.sort(); - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id.id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== - "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a") { - throw new Error("BIP39 Wordlist for ko (Korean) FAILED"); - } - /* c8 ignore stop */ - _wordlist = wordlist; - return wordlist; -} -let wordlist = null; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangKo extends wordlist$1.Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ko"); - } - getWord(index) { - const words = loadWords(); - errors.assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords().indexOf(word); - } - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangKo(); - } - return wordlist; - } -} - -exports.LangKo = LangKo; -//# sourceMappingURL=lang-ko.js.map diff --git a/lib.commonjs/wordlists/lang-ko.js.map b/lib.commonjs/wordlists/lang-ko.js.map deleted file mode 100644 index 2f7f8878e..000000000 --- a/lib.commonjs/wordlists/lang-ko.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ko.js","sources":["../../lib.esm/wordlists/lang-ko.js"],"sourcesContent":["import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = [\n \"OYAa\",\n \"ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFn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JnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb\",\n \"AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl\",\n];\nconst codes = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*\";\nfunction getHangul(code) {\n if (code >= 40) {\n code = code + 168 - 40;\n }\n else if (code >= 19) {\n code = code + 97 - 19;\n }\n return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128]));\n}\nlet _wordlist = null;\nfunction loadWords() {\n if (_wordlist != null) {\n return _wordlist;\n }\n const wordlist = [];\n data.forEach((data, length) => {\n length += 4;\n for (let i = 0; i < data.length; i += length) {\n let word = \"\";\n for (let j = 0; j < length; j++) {\n word += getHangul(codes.indexOf(data[i + j]));\n }\n wordlist.push(word);\n }\n });\n wordlist.sort();\n // Verify the computed list matches the official list\n /* istanbul ignore if */\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !==\n \"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a\") {\n throw new Error(\"BIP39 Wordlist for ko (Korean) FAILED\");\n }\n /* c8 ignore stop */\n _wordlist = wordlist;\n return wordlist;\n}\nlet wordlist = null;\n/**\n * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangKo extends Wordlist {\n /**\n * Creates a new instance of the Korean language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langKo]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"ko\");\n }\n getWord(index) {\n const words = loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords().indexOf(word);\n }\n /**\n * Returns a singleton instance of a ``LangKo``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangKo();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-ko.js.map"],"names":["toUtf8String","id","Wordlist","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,IAAI,GAAG;AACb,IAAI,MAAM;AACV,IAAI,y5JAAy5J;AAC75J,IAAI,8lIAA8lI;AAClmI,IAAI,i8BAAi8B;AACr8B,IAAI,koCAAkoC;AACtoC,IAAI,yaAAya;AAC7a,IAAI,gHAAgH;AACpH,IAAI,+EAA+E;AACnF,CAAC;AACD,MAAM,KAAK,GAAG,wEAAwE;AACtF,SAAS,SAAS,CAAC,IAAI,EAAE;AACzB,IAAI,IAAI,IAAI,IAAI,EAAE,EAAE;AACpB,QAAQ,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,EAAE;AAC9B,IAAI;AACJ,SAAS,IAAI,IAAI,IAAI,EAAE,EAAE;AACzB,QAAQ,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE;AAC7B,IAAI;AACJ,IAAI,OAAOA,iBAAY,CAAC,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,GAAG,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC;AACtF;AACA,IAAI,SAAS,GAAG,IAAI;AACpB,SAAS,SAAS,GAAG;AACrB,IAAI,IAAI,SAAS,IAAI,IAAI,EAAE;AAC3B,QAAQ,OAAO,SAAS;AACxB,IAAI;AACJ,IAAI,MAAM,QAAQ,GAAG,EAAE;AACvB,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK;AACnC,QAAQ,MAAM,IAAI,CAAC;AACnB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,MAAM,EAAE;AACtD,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CAAC,OAAO,CAAC,IAAI,CAAC;AACxC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-pt.d.ts b/lib.commonjs/wordlists/lang-pt.d.ts deleted file mode 100644 index f218013c6..000000000 --- a/lib.commonjs/wordlists/lang-pt.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist(): LangPt; -} -//# sourceMappingURL=lang-pt.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-pt.d.ts.map b/lib.commonjs/wordlists/lang-pt.d.ts.map deleted file mode 100644 index 024c97c03..000000000 --- a/lib.commonjs/wordlists/lang-pt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-pt.js b/lib.commonjs/wordlists/lang-pt.js deleted file mode 100644 index c326fefba..000000000 --- a/lib.commonjs/wordlists/lang-pt.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -var wordlistOwl = require('./wordlist-owl.js'); - -const words = "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng` Nhec(Njug Nsum'Nt+$Nvi%Op( P{oPi?PoQue%lRagemRdi&Rne)R}h>p|&R[ioR%joRuj>voSs-oS%laT}e%U_UveVil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`aLh(LoLvezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi="; -const checksum = "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; -let wordlist = null; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangPt extends wordlistOwl.WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor() { - super("pt", words, checksum); - } - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangPt(); - } - return wordlist; - } -} - -exports.LangPt = LangPt; -//# sourceMappingURL=lang-pt.js.map diff --git a/lib.commonjs/wordlists/lang-pt.js.map b/lib.commonjs/wordlists/lang-pt.js.map deleted file mode 100644 index 4bb2dd45a..000000000 --- a/lib.commonjs/wordlists/lang-pt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-pt.js","sources":["../../lib.esm/wordlists/lang-pt.js"],"sourcesContent":["import { WordlistOwl } from \"./wordlist-owl.js\";\nconst words = \"0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc Rr#R%'oRvejaTimV^2Aco)Al{aAm#Ap^ArmeAticeAveEfeEg^E'oEqueIco%If[In`oOc&/Ov(UmboU.Uva0CatrizCl}eD!eD['aEn%Gcui$Rurg@T 2A[zaE_Ic OneUbe2A=Ag'Ba@B($rBr C^El/Ent_E,Gum`oIb'IfaIo%L L{aLh(Lid'Lme@L}oLunaM<=Mb* M-.MitivaMov(MplexoMumNc]N=rNec.Nfu,Ng`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Lic}eMetr@Mpat@M~ N&Nc(oNg~ NopseN$ni>-eRiTu#5B(fis)Rp[s>[&Rt'Sp'oS%n$:B`aBle%Bu^C/G `aLh(LoLvezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi=\";\nconst checksum = \"0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac\";\nlet wordlist = null;\n/**\n * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangPt extends WordlistOwl {\n /**\n * Creates a new instance of the Portuguese language Wordlist.\n *\n * This should be unnecessary most of the time as the exported\n * [[langPt]] should suffice.\n *\n * @_ignore:\n */\n constructor() {\n super(\"pt\", words, checksum);\n }\n /**\n * Returns a singleton instance of a ``LangPt``, creating it\n * if this is the first time being called.\n */\n static wordlist() {\n if (wordlist == null) {\n wordlist = new LangPt();\n }\n return wordlist;\n }\n}\n//# sourceMappingURL=lang-pt.js.map"],"names":["WordlistOwl"],"mappings":";;;;AACA,MAAM,KAAK,GAAG,s0OAAs0O;AACp1O,MAAM,QAAQ,GAAG,oEAAoE;AACrF,IAAI,QAAQ,GAAG,IAAI;AACnB;AACA;AACA;AACA;AACA;AACO,MAAM,MAAM,SAASA,uBAAW,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC;AACpC,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,GAAG;AACtB,QAAQ,IAAI,QAAQ,IAAI,IAAI,EAAE;AAC9B,YAAY,QAAQ,GAAG,IAAI,MAAM,EAAE;AACnC,QAAQ;AACR,QAAQ,OAAO,QAAQ;AACvB,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-zh.d.ts b/lib.commonjs/wordlists/lang-zh.d.ts deleted file mode 100644 index 5d0c14c7c..000000000 --- a/lib.commonjs/wordlists/lang-zh.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect: string); - getWord(index: number): string; - getWordIndex(word: string): number; - split(phrase: string): Array; - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect: string): LangZh; -} -//# sourceMappingURL=lang-zh.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-zh.d.ts.map b/lib.commonjs/wordlists/lang-zh.d.ts.map deleted file mode 100644 index 06d1b5870..000000000 --- a/lib.commonjs/wordlists/lang-zh.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;;;OASG;IACH,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKvC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/lang-zh.js b/lib.commonjs/wordlists/lang-zh.js deleted file mode 100644 index 401c00806..000000000 --- a/lib.commonjs/wordlists/lang-zh.js +++ /dev/null @@ -1,125 +0,0 @@ -'use strict'; - -var id = require('../hash/id.js'); -require('../constants/numbers.js'); -require('../address/index.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -var utf8 = require('../utils/utf8.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -var wordlist = require('./wordlist.js'); - -const data = "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN> 2), - 128 + codes.indexOf(data[i * 3 + 1]), - 128 + codes.indexOf(data[i * 3 + 2]), - ]; - if (locale === "zh_tw") { - const common = s % 4; - for (let i = common; i < 3; i++) { - bytes[i] = - codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128); - } - } - wordlist.push(utf8.toUtf8String(new Uint8Array(bytes))); - } - // Verify the computed list matches the official list - const checksum = id.id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== Checks[locale]) { - throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`); - } - /* c8 ignore stop */ - _wordlist[locale] = wordlist; - return wordlist; -} -const wordlists = {}; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -class LangZh extends wordlist.Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect) { - super("zh_" + dialect); - } - getWord(index) { - const words = loadWords(this.locale); - errors.assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords(this.locale).indexOf(word); - } - split(phrase) { - phrase = phrase.replace(/(?:\u3000| )+/g, ""); - return phrase.split(""); - } - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect) { - if (wordlists[dialect] == null) { - wordlists[dialect] = new LangZh(dialect); - } - return wordlists[dialect]; - } -} - -exports.LangZh = LangZh; -//# sourceMappingURL=lang-zh.js.map diff --git a/lib.commonjs/wordlists/lang-zh.js.map b/lib.commonjs/wordlists/lang-zh.js.map deleted file mode 100644 index d106a888f..000000000 --- a/lib.commonjs/wordlists/lang-zh.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-zh.js","sources":["../../lib.esm/wordlists/lang-zh.js"],"sourcesContent":["import { id } from \"../hash/index.js\";\nimport { assertArgument, toUtf8String } from \"../utils/index.js\";\nimport { Wordlist } from \"./wordlist.js\";\nconst data = \"}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN?\";\nfunction loadWords(locale) {\n if (_wordlist[locale] != null) {\n return _wordlist[locale];\n }\n const wordlist = [];\n let deltaOffset = 0;\n for (let i = 0; i < 2048; i++) {\n const s = style.indexOf(data[i * 3]);\n const bytes = [\n 228 + (s >> 2),\n 128 + codes.indexOf(data[i * 3 + 1]),\n 128 + codes.indexOf(data[i * 3 + 2]),\n ];\n if (locale === \"zh_tw\") {\n const common = s % 4;\n for (let i = common; i < 3; i++) {\n bytes[i] =\n codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128);\n }\n }\n wordlist.push(toUtf8String(new Uint8Array(bytes)));\n }\n // Verify the computed list matches the official list\n const checksum = id(wordlist.join(\"\\n\") + \"\\n\");\n /* c8 ignore start */\n if (checksum !== Checks[locale]) {\n throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`);\n }\n /* c8 ignore stop */\n _wordlist[locale] = wordlist;\n return wordlist;\n}\nconst wordlists = {};\n/**\n * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for\n * [mnemonic phrases](link-bip-39).\n *\n * @_docloc: api/wordlists\n */\nexport class LangZh extends Wordlist {\n /**\n * Creates a new instance of the Chinese language Wordlist for\n * the %%dialect%%, either ``\"cn\"`` or ``\"tw\"`` for simplified\n * or traditional, respectively.\n *\n * This should be unnecessary most of the time as the exported\n * [[langZhCn]] and [[langZhTw]] should suffice.\n *\n * @_ignore:\n */\n constructor(dialect) {\n super(\"zh_\" + dialect);\n }\n getWord(index) {\n const words = loadWords(this.locale);\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return loadWords(this.locale).indexOf(word);\n }\n split(phrase) {\n phrase = phrase.replace(/(?:\\u3000| )+/g, \"\");\n return phrase.split(\"\");\n }\n /**\n * Returns a singleton instance of a ``LangZh`` for %%dialect%%,\n * creating it if this is the first time being called.\n *\n * Use the %%dialect%% ``\"cn\"`` or ``\"tw\"`` for simplified or\n * traditional, respectively.\n */\n static wordlist(dialect) {\n if (wordlists[dialect] == null) {\n wordlists[dialect] = new LangZh(dialect);\n }\n return wordlists[dialect];\n }\n}\n//# sourceMappingURL=lang-zh.js.map"],"names":["toUtf8String","id","Wordlist","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAM,IAAI,GAAG,kgMAAkgM;AAC/gM,MAAM,SAAS,GAAG,6lDAA6lD;AAC/mD,MAAM,SAAS,GAAG;AAClB,IAAI,KAAK,EAAE,IAAI;AACf,IAAI,KAAK,EAAE,IAAI;AACf,CAAC;AACD,MAAM,MAAM,GAAG;AACf,IAAI,KAAK,EAAE,oEAAoE;AAC/E,IAAI,KAAK,EAAE,oEAAoE;AAC/E,CAAC;AACD,MAAM,KAAK,GAAG,kEAAkE;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,QAAQ,CAAC,OAAO,EAAE;AAC7B,QAAQ,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE;AACxC,YAAY,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC;AACpD,QAAQ;AACR,QAAQ,OAAO,SAAS,CAAC,OAAO,CAAC;AACjC,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owl.d.ts b/lib.commonjs/wordlists/wordlist-owl.d.ts deleted file mode 100644 index 3a831f7cf..000000000 --- a/lib.commonjs/wordlists/wordlist-owl.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -export declare class WordlistOwl extends Wordlist { - #private; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, checksum: string); - get _data(): string; - _decodeWords(): Array; - getWord(index: number): string; - getWordIndex(word: string): number; -} -//# sourceMappingURL=wordlist-owl.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owl.d.ts.map b/lib.commonjs/wordlists/wordlist-owl.d.ts.map deleted file mode 100644 index cb5198fb8..000000000 --- a/lib.commonjs/wordlists/wordlist-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIxC;;;OAGG;IACH,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAKzD;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;IAoBD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owl.js b/lib.commonjs/wordlists/wordlist-owl.js deleted file mode 100644 index e743232ea..000000000 --- a/lib.commonjs/wordlists/wordlist-owl.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -var id = require('../hash/id.js'); -require('../constants/numbers.js'); -require('../address/index.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -var errors = require('../utils/errors.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); -require('../crypto/hmac.js'); -require('../crypto/ripemd160.js'); -require('../crypto/pbkdf2.js'); -require('../crypto/random.js'); -require('../crypto/scrypt.js'); -require('../crypto/sha3.js'); -require('bcrypto/lib/ed448.js'); -require('buffer'); -require('bcrypto/lib/pbkdf2.js'); -require('bcrypto/lib/sha3-512.js'); -require('crypto'); -require('../crypto/keccak.js'); -require('../crypto/signature.js'); -require('../transaction/transaction.js'); -require('../hash/typed-data.js'); -var decodeOwl = require('./decode-owl.js'); -var wordlist = require('./wordlist.js'); - -// Use the encode-latin.js script to create the necessary -// data files to be consumed by this class -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -class WordlistOwl extends wordlist.Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - get _data() { - return this.#data; - } - _decodeWords() { - return decodeOwl.decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id.id(words.join("\n") + "\n", true); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - errors.assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } -} - -exports.WordlistOwl = WordlistOwl; -//# sourceMappingURL=wordlist-owl.js.map diff --git a/lib.commonjs/wordlists/wordlist-owl.js.map b/lib.commonjs/wordlists/wordlist-owl.js.map deleted file mode 100644 index 3b3a1c8c0..000000000 --- a/lib.commonjs/wordlists/wordlist-owl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owl.js","sources":["../../lib.esm/wordlists/wordlist-owl.js"],"sourcesContent":["// Use the encode-latin.js script to create the necessary\n// data files to be consumed by this class\nimport { id } from \"../hash/index.js\";\nimport { assertArgument } from \"../utils/index.js\";\nimport { decodeOwl } from \"./decode-owl.js\";\nimport { Wordlist } from \"./wordlist.js\";\n/**\n * An OWL format Wordlist is an encoding method that exploits\n * the general locality of alphabetically sorted words to\n * achieve a simple but effective means of compression.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on ASCII-7 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwl extends Wordlist {\n #data;\n #checksum;\n /**\n * Creates a new Wordlist for %%locale%% using the OWL %%data%%\n * and validated against the %%checksum%%.\n */\n constructor(locale, data, checksum) {\n super(locale);\n this.#data = data;\n this.#checksum = checksum;\n this.#words = null;\n }\n get _data() {\n return this.#data;\n }\n _decodeWords() {\n return decodeOwl(this.#data);\n }\n #words;\n #loadWords() {\n if (this.#words == null) {\n const words = this._decodeWords();\n // Verify the computed list matches the official list\n const checksum = id(words.join(\"\\n\") + \"\\n\", true);\n /* c8 ignore start */\n if (checksum !== this.#checksum) {\n throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`);\n }\n /* c8 ignore stop */\n this.#words = words;\n }\n return this.#words;\n }\n getWord(index) {\n const words = this.#loadWords();\n assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, \"index\", index);\n return words[index];\n }\n getWordIndex(word) {\n return this.#loadWords().indexOf(word);\n }\n}\n//# sourceMappingURL=wordlist-owl.js.map"],"names":["Wordlist","decodeOwl","id","assertArgument"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAW,SAASA,iBAAQ,CAAC;AAC1C,IAAI,KAAK;AACT,IAAI,SAAS;AACb;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;AACxC,QAAQ,KAAK,CAAC,MAAM,CAAC;AACrB,QAAQ,IAAI,CAAC,KAAK,GAAG,IAAI;AACzB,QAAQ,IAAI,CAAC,SAAS,GAAG,QAAQ;AACjC,QAAQ,IAAI,CAAC,MAAM,GAAG,IAAI;AAC1B,IAAI;AACJ,IAAI,IAAI,KAAK,GAAG;AAChB,QAAQ,OAAO,IAAI,CAAC,KAAK;AACzB,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAOC,mBAAS,CAAC,IAAI,CAAC,KAAK,CAAC;AACpC,IAAI;AACJ,IAAI,MAAM;AACV,IAAI,UAAU,GAAG;AACjB,QAAQ,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;AACjC,YAAY,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE;AAC7C;AACA,YAAY,MAAM,QAAQ,GAAGC,KAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC;AAC9D;AACA,YAAY,IAAI,QAAQ,KAAK,IAAI,CAAC,SAAS,EAAE;AAC7C,gBAAgB,MAAM,IAAI,KAAK,CAAC,CAAC,mBAAmB,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAC/E,YAAY;AACZ;AACA,YAAY,IAAI,CAAC,MAAM,GAAG,KAAK;AAC/B,QAAQ;AACR,QAAQ,OAAO,IAAI,CAAC,MAAM;AAC1B,IAAI;AACJ,IAAI,OAAO,CAAC,KAAK,EAAE;AACnB,QAAQ,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE;AACvC,QAAQC,qBAAc,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC;AAC1G,QAAQ,OAAO,KAAK,CAAC,KAAK,CAAC;AAC3B,IAAI;AACJ,IAAI,YAAY,CAAC,IAAI,EAAE;AACvB,QAAQ,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;AAC9C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owla.d.ts b/lib.commonjs/wordlists/wordlist-owla.d.ts deleted file mode 100644 index d86086b6e..000000000 --- a/lib.commonjs/wordlists/wordlist-owla.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -export declare class WordlistOwlA extends WordlistOwl { - #private; - constructor(locale: string, data: string, accent: string, checksum: string); - get _accent(): string; - _decodeWords(): Array; -} -//# sourceMappingURL=wordlist-owla.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owla.d.ts.map b/lib.commonjs/wordlists/wordlist-owla.d.ts.map deleted file mode 100644 index ed20b28e0..000000000 --- a/lib.commonjs/wordlists/wordlist-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;IAG5C,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAGzE;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist-owla.js b/lib.commonjs/wordlists/wordlist-owla.js deleted file mode 100644 index ab781d015..000000000 --- a/lib.commonjs/wordlists/wordlist-owla.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - -var wordlistOwl = require('./wordlist-owl.js'); -var decodeOwla = require('./decode-owla.js'); - -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -class WordlistOwlA extends wordlistOwl.WordlistOwl { - #accent; - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - get _accent() { - return this.#accent; - } - _decodeWords() { - return decodeOwla.decodeOwlA(this._data, this._accent); - } -} - -exports.WordlistOwlA = WordlistOwlA; -//# sourceMappingURL=wordlist-owla.js.map diff --git a/lib.commonjs/wordlists/wordlist-owla.js.map b/lib.commonjs/wordlists/wordlist-owla.js.map deleted file mode 100644 index da5e1832e..000000000 --- a/lib.commonjs/wordlists/wordlist-owla.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owla.js","sources":["../../lib.esm/wordlists/wordlist-owla.js"],"sourcesContent":["import { WordlistOwl } from \"./wordlist-owl.js\";\nimport { decodeOwlA } from \"./decode-owla.js\";\n/**\n * An OWL-A format Wordlist extends the OWL format to add an\n * overlay onto an OWL format Wordlist to support diacritic\n * marks.\n *\n * This class is generally not useful to most developers as\n * it is used mainly internally to keep Wordlists for languages\n * based on latin-1 small.\n *\n * If necessary, there are tools within the ``generation/`` folder\n * to create these necessary data.\n */\nexport class WordlistOwlA extends WordlistOwl {\n #accent;\n constructor(locale, data, accent, checksum) {\n super(locale, data, checksum);\n this.#accent = accent;\n }\n get _accent() {\n return this.#accent;\n }\n _decodeWords() {\n return decodeOwlA(this._data, this._accent);\n }\n}\n//# sourceMappingURL=wordlist-owla.js.map"],"names":["WordlistOwl","decodeOwlA"],"mappings":";;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,YAAY,SAASA,uBAAW,CAAC;AAC9C,IAAI,OAAO;AACX,IAAI,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;AAChD,QAAQ,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC;AACrC,QAAQ,IAAI,CAAC,OAAO,GAAG,MAAM;AAC7B,IAAI;AACJ,IAAI,IAAI,OAAO,GAAG;AAClB,QAAQ,OAAO,IAAI,CAAC,OAAO;AAC3B,IAAI;AACJ,IAAI,YAAY,GAAG;AACnB,QAAQ,OAAOC,qBAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;AACnD,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist.d.ts b/lib.commonjs/wordlists/wordlist.d.ts deleted file mode 100644 index 081decc72..000000000 --- a/lib.commonjs/wordlists/wordlist.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -export declare abstract class Wordlist { - locale: string; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale: string); - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase: string): Array; - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words: Array): string; - /** - * Maps an 11-bit value into its coresponding word in the list. - * - * Sub-classes MUST override this. - */ - abstract getWord(index: number): string; - /** - * Maps a word to its corresponding 11-bit value. - * - * Sub-classes MUST override this. - */ - abstract getWordIndex(word: string): number; - static check(wordlist: Wordlist): string; -} -//# sourceMappingURL=wordlist.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist.d.ts.map b/lib.commonjs/wordlists/wordlist.d.ts.map deleted file mode 100644 index c298de76e..000000000 --- a/lib.commonjs/wordlists/wordlist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC7B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAM,EAAE,MAAM,EAEzB;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAEnC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAWvC;CACD"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlist.js b/lib.commonjs/wordlists/wordlist.js deleted file mode 100644 index b9a2a8e5b..000000000 --- a/lib.commonjs/wordlists/wordlist.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict'; - -var id = require('../hash/id.js'); -require('../utils/base58.js'); -require('../logger/logger.js'); -require('../utils/errors.js'); -var properties = require('../utils/properties.js'); -require('http'); -require('https'); -require('zlib'); -require('../utils/fixednumber.js'); -require('../utils/maths.js'); - -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - properties.defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } - static check(wordlist) { - const words = []; - for (let i = 0; i < 2048; i++) { - const word = wordlist.getWord(i); - /* istanbul ignore if */ - if (i !== wordlist.getWordIndex(word)) { - return "0x"; - } - words.push(word); - } - return id.id(words.join("\n") + "\n"); - } -} - -exports.Wordlist = Wordlist; -//# sourceMappingURL=wordlist.js.map diff --git a/lib.commonjs/wordlists/wordlist.js.map b/lib.commonjs/wordlists/wordlist.js.map deleted file mode 100644 index c79f848e6..000000000 --- a/lib.commonjs/wordlists/wordlist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist.js","sources":["../../lib.esm/wordlists/wordlist.js"],"sourcesContent":["import { id } from \"../hash/id.js\";\nimport { defineProperties } from \"../utils/index.js\";\n/**\n * A Wordlist represents a collection of language-specific\n * words used to encode and devoce [[link-bip-39]] encoded data\n * by mapping words to 11-bit values and vice versa.\n */\nexport class Wordlist {\n locale;\n /**\n * Creates a new Wordlist instance.\n *\n * Sub-classes MUST call this if they provide their own constructor,\n * passing in the locale string of the language.\n *\n * Generally there is no need to create instances of a Wordlist,\n * since each language-specific Wordlist creates an instance and\n * there is no state kept internally, so they are safe to share.\n */\n constructor(locale) {\n defineProperties(this, { locale });\n }\n /**\n * Sub-classes may override this to provide a language-specific\n * method for spliting %%phrase%% into individual words.\n *\n * By default, %%phrase%% is split using any sequences of\n * white-space as defined by regular expressions (i.e. ``/\\s+/``).\n */\n split(phrase) {\n return phrase.toLowerCase().split(/\\s+/g);\n }\n /**\n * Sub-classes may override this to provider a language-specific\n * method for joining %%words%% into a phrase.\n *\n * By default, %%words%% are joined by a single space.\n */\n join(words) {\n return words.join(\" \");\n }\n static check(wordlist) {\n const words = [];\n for (let i = 0; i < 2048; i++) {\n const word = wordlist.getWord(i);\n /* istanbul ignore if */\n if (i !== wordlist.getWordIndex(word)) {\n return \"0x\";\n }\n words.push(word);\n }\n return id(words.join(\"\\n\") + \"\\n\");\n }\n}\n//# sourceMappingURL=wordlist.js.map"],"names":["defineProperties","id"],"mappings":";;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,QAAQ,CAAC;AACtB,IAAI,MAAM;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,WAAW,CAAC,MAAM,EAAE;AACxB,QAAQA,2BAAgB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC;AAC1C,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,QAAQ,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;AACjD,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,QAAQ,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AAC9B,IAAI;AACJ,IAAI,OAAO,KAAK,CAAC,QAAQ,EAAE;AAC3B,QAAQ,MAAM,KAAK,GAAG,EAAE;AACxB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;AACvC,YAAY,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5C;AACA,YAAY,IAAI,CAAC,KAAK,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;AACnD,gBAAgB,OAAO,IAAI;AAC3B,YAAY;AACZ,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5B,QAAQ;AACR,QAAQ,OAAOC,KAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAC1C,IAAI;AACJ;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists-browser.d.ts b/lib.commonjs/wordlists/wordlists-browser.d.ts deleted file mode 100644 index d0dbd19c9..000000000 --- a/lib.commonjs/wordlists/wordlists-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -export declare const wordlists: Record; -//# sourceMappingURL=wordlists-browser.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists-browser.d.ts.map b/lib.commonjs/wordlists/wordlists-browser.d.ts.map deleted file mode 100644 index 4cd923879..000000000 --- a/lib.commonjs/wordlists/wordlists-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-browser.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAE9C,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists-browser.js b/lib.commonjs/wordlists/wordlists-browser.js deleted file mode 100644 index 68c2b6386..000000000 --- a/lib.commonjs/wordlists/wordlists-browser.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -var langEn = require('./lang-en.js'); - -const wordlists = { - en: langEn.LangEn.wordlist(), -}; - -exports.wordlists = wordlists; -//# sourceMappingURL=wordlists-browser.js.map diff --git a/lib.commonjs/wordlists/wordlists-browser.js.map b/lib.commonjs/wordlists/wordlists-browser.js.map deleted file mode 100644 index a3401ebd3..000000000 --- a/lib.commonjs/wordlists/wordlists-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-browser.js","sources":["../../lib.esm/wordlists/wordlists-browser.js"],"sourcesContent":["import { LangEn } from \"./lang-en.js\";\nexport const wordlists = {\n en: LangEn.wordlist(),\n};\n//# sourceMappingURL=wordlists-browser.js.map"],"names":["LangEn"],"mappings":";;;;AACY,MAAC,SAAS,GAAG;AACzB,IAAI,EAAE,EAAEA,aAAM,CAAC,QAAQ,EAAE;AACzB;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists-extra.d.ts b/lib.commonjs/wordlists/wordlists-extra.d.ts deleted file mode 100644 index 7e15a233f..000000000 --- a/lib.commonjs/wordlists/wordlists-extra.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { LangCz } from "./lang-cz.js"; -export { LangEs } from "./lang-es.js"; -export { LangFr } from "./lang-fr.js"; -export { LangJa } from "./lang-ja.js"; -export { LangKo } from "./lang-ko.js"; -export { LangIt } from "./lang-it.js"; -export { LangPt } from "./lang-pt.js"; -export { LangZh } from "./lang-zh.js"; -//# sourceMappingURL=wordlists-extra.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists-extra.d.ts.map b/lib.commonjs/wordlists/wordlists-extra.d.ts.map deleted file mode 100644 index 66c6c92cd..000000000 --- a/lib.commonjs/wordlists/wordlists-extra.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-extra.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists-extra.js b/lib.commonjs/wordlists/wordlists-extra.js deleted file mode 100644 index 3c1197fb1..000000000 --- a/lib.commonjs/wordlists/wordlists-extra.js +++ /dev/null @@ -1,22 +0,0 @@ -'use strict'; - -var langCz = require('./lang-cz.js'); -var langEs = require('./lang-es.js'); -var langFr = require('./lang-fr.js'); -var langJa = require('./lang-ja.js'); -var langKo = require('./lang-ko.js'); -var langIt = require('./lang-it.js'); -var langPt = require('./lang-pt.js'); -var langZh = require('./lang-zh.js'); - - - -exports.LangCz = langCz.LangCz; -exports.LangEs = langEs.LangEs; -exports.LangFr = langFr.LangFr; -exports.LangJa = langJa.LangJa; -exports.LangKo = langKo.LangKo; -exports.LangIt = langIt.LangIt; -exports.LangPt = langPt.LangPt; -exports.LangZh = langZh.LangZh; -//# sourceMappingURL=wordlists-extra.js.map diff --git a/lib.commonjs/wordlists/wordlists-extra.js.map b/lib.commonjs/wordlists/wordlists-extra.js.map deleted file mode 100644 index cb9d641e5..000000000 --- a/lib.commonjs/wordlists/wordlists-extra.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists.d.ts b/lib.commonjs/wordlists/wordlists.d.ts deleted file mode 100644 index ab8b0308c..000000000 --- a/lib.commonjs/wordlists/wordlists.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -export declare const wordlists: Record; -//# sourceMappingURL=wordlists.d.ts.map \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists.d.ts.map b/lib.commonjs/wordlists/wordlists.d.ts.map deleted file mode 100644 index 15f92fcf6..000000000 --- a/lib.commonjs/wordlists/wordlists.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAW9C,CAAC"} \ No newline at end of file diff --git a/lib.commonjs/wordlists/wordlists.js b/lib.commonjs/wordlists/wordlists.js deleted file mode 100644 index 0d37a30f7..000000000 --- a/lib.commonjs/wordlists/wordlists.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -var langCz = require('./lang-cz.js'); -var langEn = require('./lang-en.js'); -var langEs = require('./lang-es.js'); -var langFr = require('./lang-fr.js'); -var langJa = require('./lang-ja.js'); -var langKo = require('./lang-ko.js'); -var langIt = require('./lang-it.js'); -var langPt = require('./lang-pt.js'); -var langZh = require('./lang-zh.js'); - -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -const wordlists = { - cz: langCz.LangCz.wordlist(), - en: langEn.LangEn.wordlist(), - es: langEs.LangEs.wordlist(), - fr: langFr.LangFr.wordlist(), - it: langIt.LangIt.wordlist(), - pt: langPt.LangPt.wordlist(), - ja: langJa.LangJa.wordlist(), - ko: langKo.LangKo.wordlist(), - zh_cn: langZh.LangZh.wordlist("cn"), - zh_tw: langZh.LangZh.wordlist("tw"), -}; - -exports.wordlists = wordlists; -//# sourceMappingURL=wordlists.js.map diff --git a/lib.commonjs/wordlists/wordlists.js.map b/lib.commonjs/wordlists/wordlists.js.map deleted file mode 100644 index e4c1b3d7d..000000000 --- a/lib.commonjs/wordlists/wordlists.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists.js","sources":["../../lib.esm/wordlists/wordlists.js"],"sourcesContent":["import { LangCz } from \"./lang-cz.js\";\nimport { LangEn } from \"./lang-en.js\";\nimport { LangEs } from \"./lang-es.js\";\nimport { LangFr } from \"./lang-fr.js\";\nimport { LangJa } from \"./lang-ja.js\";\nimport { LangKo } from \"./lang-ko.js\";\nimport { LangIt } from \"./lang-it.js\";\nimport { LangPt } from \"./lang-pt.js\";\nimport { LangZh } from \"./lang-zh.js\";\n/**\n * The available Wordlists by their\n * [ISO 639-1 Language Code](link-wiki-iso639).\n *\n * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr),\n * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt),\n * [zh_cn](LangZh), [zh_tw](LangZh))\n *\n * The dist files (in the ``/dist`` folder) have had all languages\n * except English stripped out, which reduces the library size by\n * about 80kb. If required, they are available by importing the\n * included ``wordlists-extra.min.js`` file.\n */\nexport const wordlists = {\n cz: LangCz.wordlist(),\n en: LangEn.wordlist(),\n es: LangEs.wordlist(),\n fr: LangFr.wordlist(),\n it: LangIt.wordlist(),\n pt: LangPt.wordlist(),\n ja: LangJa.wordlist(),\n ko: LangKo.wordlist(),\n zh_cn: LangZh.wordlist(\"cn\"),\n zh_tw: LangZh.wordlist(\"tw\"),\n};\n//# sourceMappingURL=wordlists.js.map"],"names":["LangCz","LangEn","LangEs","LangFr","LangIt","LangPt","LangJa","LangKo","LangZh"],"mappings":";;;;;;;;;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,SAAS,GAAG;AACzB,IAAI,EAAE,EAAEA,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,EAAE,EAAEC,aAAM,CAAC,QAAQ,EAAE;AACzB,IAAI,KAAK,EAAEC,aAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AAChC,IAAI,KAAK,EAAEA,aAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AAChC;;"} \ No newline at end of file diff --git a/lib.esm/README.md b/lib.esm/README.md deleted file mode 100644 index ce8d3ba56..000000000 --- a/lib.esm/README.md +++ /dev/null @@ -1,16 +0,0 @@ -ESM Files -========= - -The contents of this folder are for using `import` in ESM -projects. - - -Notes ------ - -The contents are generated via the `npm run build` target -using `tsc` and the `/tsconfig.esm.json` configuration. - -Do not modify the files in this folder. They are deleted on `build-clean`. - -To modify this `README.md`, see the `/output/post-build/lib.esm`. diff --git a/lib.esm/_tests/blockchain-data.d.ts b/lib.esm/_tests/blockchain-data.d.ts deleted file mode 100644 index f9a6125d6..000000000 --- a/lib.esm/_tests/blockchain-data.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -export type TestBlockchainNetwork = "mainnet" | "goerli"; -export interface TestBlockchainAddress { - test: string; - address: string; - code?: string; - nonce?: number; - name?: string; - balance?: bigint; - storage?: Record; -} -export interface TestBlockchainBlock { - test: string; - hash: string; - parentHash: string; - number: number; - timestamp: number; - nonce: string; - difficulty: bigint; - energyLimit: bigint; - energyUsed: bigint; - miner: string; - extraData: string; - transactions: Array; - baseFeePerEnergy?: bigint; -} -export interface TestBlockchainTransaction { - test: string; - hash: string; - blockHash: string; - blockNumber: number; - type: number; - from: string; - energyPrice: bigint; - energyLimit: bigint; - to: string; - value: bigint; - nonce: number; - data: string; - signature: { - r: string; - s: string; - yParity: 0 | 1; - v: number; - networkV: null | bigint; - }; - creates: null | string; - networkId: bigint; - accessList?: Array>>; -} -export interface TestBlockchainReceipt { - test: string; - blockHash: string; - blockNumber: number; - type: number; - contractAddress: null | string; - cumulativeEnergyUsed: bigint; - from: string; - energyUsed: bigint; - energyPrice: bigint; - logs: Array<{ - address: string; - blockHash: string; - blockNumber: number; - data: string; - index: number; - topics: Array; - transactionHash: string; - transactionIndex: number; - }>; - logsBloom: string; - root: null | string; - status: null | number; - to: string; - hash: string; - index: number; -} -export declare const testAddress: Record>; -export declare const testBlock: Record>; -export declare const testTransaction: Record>; -export declare const testReceipt: Record>; -export declare const networkNames: Array; -export declare function networkFeatureAtBlock(feature: string, block: number): boolean; -//# sourceMappingURL=blockchain-data.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/blockchain-data.d.ts.map b/lib.esm/_tests/blockchain-data.d.ts.map deleted file mode 100644 index 640ed0edf..000000000 --- a/lib.esm/_tests/blockchain-data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blockchain-data.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB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file diff --git a/lib.esm/_tests/blockchain-data.js b/lib.esm/_tests/blockchain-data.js deleted file mode 100644 index a75cea7d7..000000000 --- a/lib.esm/_tests/blockchain-data.js +++ /dev/null @@ -1,239 +0,0 @@ -export const testAddress = { - mainnet: [ - { - test: "old-account", - address: "0xAC1639CF97a3A46D431e6d1216f576622894cBB5", - balance: BigInt("4813414100000000"), - nonce: 3, - code: "0x", - }, - { - test: "TheDAO-splitter-contract", - address: "0x3474627D4F63A678266BC17171D87f8570936622", - code: "0x606060405260e060020a60003504630b3ed5368114602e57806337b0574a14605257806356fa47f0146062575b005b602c6004356000546101009004600160a060020a03908116339091161460bb575b50565b60005460ff166060908152602090f35b602c60043560005460ff1615609657600160a060020a038116600034606082818181858883f193505050501515604f576002565b33600160a060020a0316600034606082818181858883f193505050501515604f576002565b600080546101009004600160a060020a03169082606082818181858883f193505050501515604f57600256", - storage: { - "0": "0x0000000000000000000000b2682160c482eb985ec9f3e364eec0a904c44c2300", - }, - }, - { - test: "ricmoo.firefly.eth", - address: "0x8ba1f109551bD432803012645Ac136ddd64DBA72", - name: "ricmoo.firefly.eth", - }, - ], - goerli: [], -}; -export const testBlock = { - mainnet: [ - { - test: "old-homestead-block", - hash: "0x3d6122660cc824376f11ee842f83addc3525e2dd6756b9bcf0affa6aa88cf741", - parentHash: "0xb495a1d7e6663152ae92708da4843337b958146015a2802f4193a410044698c9", - number: 3, - timestamp: 1438270048, - nonce: "0x2e9344e0cbde83ce", - difficulty: BigInt(17154715646), - energyLimit: BigInt("0x1388"), - energyUsed: BigInt("0"), - miner: "0x5088D623ba0fcf0131E0897a91734A4D83596AA0", - extraData: "0x476574682f76312e302e302d66633739643332642f6c696e75782f676f312e34", - transactions: [], - }, - { - test: "london-block", - number: 14413999, - hash: "0x6c79356d40ebb6ed63dc19f5d407f8f1c876047b59dc1a4598cce0e64dcabec5", - parentHash: "0xbf09b0e215f247a5066d19ece5b4c66960771d45fae62985e8d751fb1adcfe2f", - timestamp: 1647654576, - nonce: "0xb4bc9979af5369fe", - difficulty: BigInt("12841513359509721"), - energyLimit: BigInt("30087914"), - energyUsed: BigInt("2008910"), - miner: "0x2A20380DcA5bC24D052acfbf79ba23e988ad0050", - extraData: "0x706f6f6c696e2e636f6d21f7092f019bb92a76", - baseFeePerEnergy: BigInt("40911884304"), - transactions: [ - "0x1c3a398933db10634631f54b435c40c8805c13f12bbac7c3dab858ca44213fa2", - "0xd98947cbdd892cc7f679c903903e6d18a5c5afb19e94437beba79372ad71c347", - "0x4d66190deb55b5820cb0ce9adb972f646fa0f3e64eaeee674bbf3d054bf3d883", - "0x9db7bd5f4c91d6103c714bcbc35df3dc708daa668aaef7449b589dbd3be24dac", - "0x126a43ae4ade4b7fc5c8ac9ebd3dbcf7314f63c60f2804fb49aa25b5c7d80bb1", - "0x82a90aa4b3b1b7873b117c3ff1ca7165ae34b2fc0788cc0cbfd41805d588590d", - "0x7f694a6a9972457753ed3dec164f17272b1c8b1da4eab149df95e31a3e72f606", - "0xdce1cba1ff33f0c23881087d49de3b34fe84c8a6883f3edd75b04fc23e458aac", - "0xbe1c69f825279cebef42d1f0e07397dcddef7fb278b0195e295ede3e156836c4", - "0x1d2f007b3c0f894403973a30e5ffaa78589f873d963e9554c6bb1bd7a3127245", - "0x9c8c78191cf4ae9ae8eee1165153eabe24dbd8b9509b83d5f0caeea85251bb2f", - "0x42e956f4b3dd6535359b272a0d2dab995c364cb48baaf8d0a1981995f3f8c808", - "0xdc2c2e99393e24d5dc66e38665fa1d1ff007d92088ef3fd2549545fdbe862ef6", - "0xaad7be28fffd2e77e8e40bf57f2ac140aa8283ec93c7f3f61a82c79405602f53", - "0x4735f1421b7b30283e87e0799e82e54307d3e5ba14cd54ad8420b57577489a71", - "0x0b9d6aa23aa439b41e86595f2ad91f498adffa3e6e7cb26ac7d73252e59fd3de", - "0xcd93e19bd5d5c5a834fec613116fa01f46eddfd2faa20ef302271b874b9d812a", - "0x5bf1976574a637f5ac0b8bda1a792fa16cc7ce9624d32e9bd6bd9aa6a8f19d2f", - "0x2e778da4f66f10f7b681b605635c6599cdbeea167fc1c4396a097aef5d06de61", - "0xd5fd68eebc4c870ccda081786a74c75c250e9e2d8269b8935edb3adb11b80bb2", - "0x2aec42a11c1d8c1e5198d54aacbc6bebb09bcd5e78f6af81ea09d65c9064734a", - "0xbea2e364ea4959ec438d9ccc2d2f7120c7eaba3b177cc0d7df8ff65d866ef89f", - "0xf48bbb0f838353060da4126a555ce532abf497a9d1108001afffaac513a59ddf", - "0xf5664e4372cce62733a6610efb7701a4a0e552d81f8caa764d8474b3070c6617", - "0x9d3732ddbd20610008ff737da2f61120734a1cbfa864374bcbcf10051e6048cb", - "0xc4d0df5bc6fa51b34ac3c898866d779d4e51a6be4d13be1ec3084b7229b03b47", - "0x90c86ec98b8ad98049b4ee54cb3aa72c5ae743077b830e8a294aa5dc47a1fb18", - ], - }, - ], - goerli: [], -}; -export const testTransaction = { - mainnet: [ - { - test: "legacy", - hash: "0xccc90ab97a74c952fb3376c4a3efb566a58a10df62eb4d44a61e106fcf10ec61", - blockHash: "0x9653f180a5720f3634816eb945a6d722adee52cc47526f6357ac10adaf368135", - blockNumber: 4097745, - // index: 18, - type: 0, - from: "0x32DEF047DeFd076DB21A2D759aff2A591c972248", - energyPrice: BigInt("0x4a817c800"), - energyLimit: BigInt("0x3d090"), - to: "0x6fC21092DA55B392b045eD78F4732bff3C580e2c", - value: BigInt("0x186cc6acd4b0000"), - nonce: 0, - data: "0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000067269636d6f6f0000000000000000000000000000000000000000000000000000", - signature: { - r: "0x1e5605197a03e3f0a168f14749168dfeefc44c9228312dacbffdcbbb13263265", - s: "0x269c3e5b3558267ad91b0a887d51f9f10098771c67b82ea6cb74f29638754f54", - yParity: 1, - v: 28, - networkV: BigInt(38), - }, - creates: null, - networkId: BigInt(1), - }, - { - test: "EIP-1559", - hash: "0x8ff41d0ba5d239acc8c123ff12451a2c15721c838f657e583d355999af4a4349", - blockHash: "0x9d4c3bef68e119841281105da96beb1c7252f357340d7a3355236b3332b197b0", - blockNumber: 12966000, - // index: 185, - type: 2, - from: "0x5afFBa12E9332bbc0E221c8E7BEf7CB7cfB3F281", - to: "0x2258CcD34ae29E6B199b6CD64eb2aEF157df7CdE", - energyLimit: BigInt("21000"), - nonce: 2, - data: "0x", - value: BigInt("1100000000000000"), - energyPrice: BigInt("70578812137"), - networkId: BigInt(1), - signature: { - r: "0xdd26e5478d0aa84e334a0393d335ab24b83de8ecae9290305f15ab884ded246c", - s: "0x6494b4f61b0d9a5a82ecb86d72b301f859f404f0bec9682bbfff619903ecfbe2", - yParity: 1, - v: 28, - networkV: null, - }, - creates: null, - accessList: [], - }, - ], - goerli: [], -}; -export const testReceipt = { - mainnet: [ - { - test: "legacy", - //byzantium: false, - blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", - blockNumber: 0x3c92b5, - type: 0, - contractAddress: null, - cumulativeEnergyUsed: BigInt(0x1cca2e), - from: "0x18C6045651826824FEBBD39d8560584078d1b247", - energyUsed: BigInt(0x14bb7), - energyPrice: BigInt(4100000000), - logs: [ - { - address: "0x314159265dD8dbb310642f98f50C066173C1259b", - blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", - blockNumber: 0x3c92b5, - data: "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247", - index: 0x1a, - topics: [ - "0xce0457fe73731f824cc272376169235128c118b49d344817417c6d108d155e82", - "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae", - "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1", - ], - transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", - transactionIndex: 0x39, - }, - { - address: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef", - blockHash: "0x36b4af7f0538559e581c8588f16477df0f676439ea67fe8d7a2ae4abb20e2566", - blockNumber: 0x3c92b5, - data: "0x000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000000000000000000000000000000000000595a32ce", - index: 0x1b, - topics: [ - "0x0f0c27adfd84b60b6f456b0e87cdccb1e5fb9603991588d87fa99f5b6b61e670", - "0xf0106919d12469348e14ad6a051d0656227e1aba2fefed41737fdf78421b20e1", - "0x00000000000000000000000018c6045651826824febbd39d8560584078d1b247", - ], - transactionHash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", - transactionIndex: 0x39, - }, - ], - logsBloom: "0x00000000000000040000000000100000010000000000000040000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000200000010000000004000000000000000000000000000000000002000000000000000000000000400000000020000000000000000000000000000000000000004000000000000000000000000000000000000000000000000801000000000000000000000020000000000040000000040000000000000000002000000004000000000000000000000000000000000000000000000010000000000000000000000000000000000200000000000000000", - root: "0x9b550a9a640ce50331b64504ef87aaa7e2aaf97344acb6ff111f879b319d2590", - // Should be null for pre-byzantium, but some nodes have backfilled it - status: 1, - to: "0x6090A6e47849629b7245Dfa1Ca21D94cd15878Ef", - hash: "0xc6fcb7d00d536e659a4559d2de29afa9e364094438fef3e72ba80728ce1cb616", - index: 0x39, - }, - { - test: "byzantium", - //byzantium: true, - blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9", - blockNumber: 0x444f76, - type: 0, - contractAddress: null, - cumulativeEnergyUsed: BigInt(0x15bfe7), - from: "0x18C6045651826824FEBBD39d8560584078d1b247", - energyUsed: BigInt(0x1b968), - energyPrice: BigInt(1000000000), - logs: [ - { - address: "0xb90E64082D00437e65A76d4c8187596BC213480a", - blockHash: "0x34e5a6cfbdbb84f7625df1de69d218ade4da72f4a2558064a156674e72e976c9", - blockNumber: 0x444f76, - data: "0x", - index: 0x10, - topics: [ - "0x748d071d1992ee1bfe7a39058114d0a50d5798fe8eb3a9bfb4687f024629a2ce", - "0x5574aa58f7191ccab6de6cf75fe2ea0484f010b852fdd8c6b7ae151d6c2f4b83", - ], - transactionHash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac", - transactionIndex: 0x1e, - }, - ], - logsBloom: "0x00000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000200000000000000008000000000000000000000000000000000000000000000000000000000000000010000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000800000000000000000800000000000000000000000000000000000000", - root: null, - status: 1, - to: "0xb90E64082D00437e65A76d4c8187596BC213480a", - hash: "0x7f1c6a58dc880438236d0b0a4ae166e9e9a038dbea8ec074149bd8b176332cac", - index: 0x1e, - }, - ], - goerli: [], -}; -export const networkNames = ["mainnet", "goerli"]; -export function networkFeatureAtBlock(feature, block) { - switch (feature) { - case "byzantium": - return block >= 4370000; - default: - break; - } - throw new Error(`unknown feature: ${feature}`); -} -//# sourceMappingURL=blockchain-data.js.map \ No newline at end of file diff --git a/lib.esm/_tests/blockchain-data.js.map b/lib.esm/_tests/blockchain-data.js.map deleted file mode 100644 index bb232395e..000000000 --- a/lib.esm/_tests/blockchain-data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"blockchain-data.js","sourceRoot":"","sources":["../../src.ts/_tests/blockchain-data.ts"],"names":[],"mappings":"AAqFA,MAAM,CAAC,MAAM,WAAW,GAGpB;IACH,OAAO,EAAE;QACR;YACC,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,4CAA4C;YACrD,OAAO,EAAE,MAAM,CAAC,kBAAkB,CAAC;YACnC,KAAK,EAAE,CAAC;YACR,IAAI,EAAE,IAAI;SACV;QACD;YACC,IAAI,EAAE,0BAA0B;YAChC,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,kdAAkd;YACxd,OAAO,EAAE;gBACR,GAAG,EAAE,oEAAoE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AC"} \ No newline at end of file diff --git a/lib.esm/_tests/create-provider.d.ts b/lib.esm/_tests/create-provider.d.ts deleted file mode 100644 index ef373e81a..000000000 --- a/lib.esm/_tests/create-provider.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AbstractProvider } from "../index.js"; -export declare function setupProviders(): void; -export declare const providerNames: readonly string[]; -export declare function getProviderNetworks(provider: string): Array; -export declare function getProvider(provider: string, network: string): null | AbstractProvider; -export declare function checkProvider(provider: string, network: string): boolean; -export declare function connect(network: string): AbstractProvider; -//# sourceMappingURL=create-provider.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/create-provider.d.ts.map b/lib.esm/_tests/create-provider.d.ts.map deleted file mode 100644 index 6a71ec23d..000000000 --- a/lib.esm/_tests/create-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AA2EpD,wBAAgB,cAAc,IAAI,IAAI,CAOrC;AAED,eAAO,MAAM,aAAa,mBAAqD,CAAC;AAUhF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAMnE;AAED,wBAAgB,WAAW,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,GACb,IAAI,GAAG,gBAAgB,CAsBzB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAMzD"} \ No newline at end of file diff --git a/lib.esm/_tests/create-provider.js b/lib.esm/_tests/create-provider.js deleted file mode 100644 index 8d38b131c..000000000 --- a/lib.esm/_tests/create-provider.js +++ /dev/null @@ -1,121 +0,0 @@ -import { AlchemyProvider, InfuraProvider, PocketProvider, QuickNodeProvider, FallbackProvider, isError, } from "../index.js"; -const ethNetworks = ["default", "mainnet", "goerli"]; -//const maticNetworks = [ "matic", "maticmum" ]; -const ProviderCreators = [ - { - name: "AlchemyProvider", - networks: ethNetworks, - create: function (network) { - return new AlchemyProvider(network, "YrPw6SWb20vJDRFkhWq8aKnTQ8JRNRHM"); - }, - }, - { - name: "InfuraProvider", - networks: ethNetworks, - create: function (network) { - return new InfuraProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); - }, - }, - { - name: "InfuraWebsocketProvider", - networks: ethNetworks, - create: function (network) { - return InfuraProvider.getWebSocketProvider(network, "49a0efa3aaee4fd99797bfa94d8ce2f1"); - }, - }, - { - name: "PocketProvider", - networks: ethNetworks, - create: function (network) { - return new PocketProvider(network); - }, - }, - { - name: "QuickNodeProvider", - networks: ethNetworks, - create: function (network) { - return new QuickNodeProvider(network); - }, - }, - { - name: "FallbackProvider", - networks: ethNetworks, - create: function (network) { - const providers = []; - for (const providerName of [ - "AlchemyProvider", - "AnkrProvider", - "InfuraProvider", - ]) { - const provider = getProvider(providerName, network); - if (provider) { - providers.push(provider); - } - } - if (providers.length === 0) { - throw new Error("UNSUPPORTED NETWORK"); - } - return new FallbackProvider(providers); - }, - }, -]; -let setup = false; -const cleanup = []; -export function setupProviders() { - after(function () { - for (const func of cleanup) { - func(); - } - }); - setup = true; -} -export const providerNames = Object.freeze(ProviderCreators.map((c) => c.name)); -function getCreator(provider) { - const creators = ProviderCreators.filter((c) => c.name === provider); - if (creators.length === 1) { - return creators[0]; - } - return null; -} -export function getProviderNetworks(provider) { - const creator = getCreator(provider); - if (creator) { - return creator.networks; - } - return []; -} -export function getProvider(provider, network) { - if (setup == false) { - throw new Error("MUST CALL setupProviders in root context"); - } - const creator = getCreator(provider); - try { - if (creator) { - const provider = creator.create(network); - if (provider) { - cleanup.push(() => { - provider.destroy(); - }); - } - return provider; - } - } - catch (error) { - if (!isError(error, "INVALID_ARGUMENT")) { - throw error; - } - } - return null; -} -export function checkProvider(provider, network) { - const creator = getCreator(provider); - return creator != null; -} -export function connect(network) { - const provider = getProvider("InfuraProvider", network); - if (provider == null) { - throw new Error(`could not connect to ${network}`); - } - return provider; -} -//# sourceMappingURL=create-provider.js.map \ No newline at end of file diff --git a/lib.esm/_tests/create-provider.js.map b/lib.esm/_tests/create-provider.js.map deleted file mode 100644 index ffc8a0297..000000000 --- a/lib.esm/_tests/create-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"create-provider.js","sourceRoot":"","sources":["../../src.ts/_tests/create-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,GACP,MAAM,aAAa,CAAC;AAUrB,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;AACrD,gDAAgD;AAEhD,MAAM,gBAAgB,GAA2B;IAChD;QACC,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAChC,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QACzE,CAAC;KACD;IACD;QACC,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAChC,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;QACxE,CAAC;KACD;IACD;QACC,IAAI,EAAE,yBAAyB;QAC/B,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAChC,OAAO,cAAc,CAAC,oBAAoB,CACzC,OAAO,EACP,kCAAkC,CAClC,CAAC;QACH,CAAC;KACD;IACD;QACC,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,WAAW;QACrB,MAAM,EAAE,UAAU,OAAe;YAChC,OAAO,IAAI,cAAc,CAAC,OAAO,CA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,CAAC,QAAQ,CAAC,CAAC;IACrC,OAAO,OAAO,IAAI,IAAI,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,OAAe;IACtC,MAAM,QAAQ,GAAG,WAAW,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACxD,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/test-cip.d.ts b/lib.esm/_tests/test-cip.d.ts deleted file mode 100644 index cc969463b..000000000 --- a/lib.esm/_tests/test-cip.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=test-cip.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/test-cip.d.ts.map b/lib.esm/_tests/test-cip.d.ts.map deleted file mode 100644 index cd282b01e..000000000 --- a/lib.esm/_tests/test-cip.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-cip.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-cip.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/_tests/test-cip.js b/lib.esm/_tests/test-cip.js deleted file mode 100644 index 3936d3067..000000000 --- a/lib.esm/_tests/test-cip.js +++ /dev/null @@ -1,150 +0,0 @@ -import assert from "node:assert/strict"; -import { Interface, Cip150MetadataContract, Cip151Lifecycle, Cip152LabCertificate, CustomUnitToken, cip150Abi, customUnitAbi, IpfsGateway, } from "../index.js"; -const address = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; -describe("CIP metadata and custom units", () => { - it("uses Unix seconds and exact inclusive lifecycle boundaries", () => { - const lifecycle = new Cip151Lifecycle({ - tokenExpiration: "9007199254740993", - tradingStop: "0", - }); - assert.equal(lifecycle.isExpiredAt(9007199254740992n), false); - assert.equal(lifecycle.isExpiredAt(9007199254740993n), true); - assert.equal(lifecycle.isTradingStoppedAt(0n), true); - assert.equal(new Cip151Lifecycle().isExpiredAt(1n), false); - for (const value of ["-1", "1.5", "1e3", " 1", "NaN"]) - assert.throws(() => new Cip151Lifecycle({ tokenExpiration: value })); - }); - it("validates and copies lab measurements", () => { - const input = { moisture: { value: 12, unit: "%" } }; - const lab = new Cip152LabCertificate(input); - input.moisture.value = 99; - assert.equal(lab.measurements.moisture.value, 12); - for (const json of [ - null, - [], - { x: {} }, - { x: { value: true } }, - { x: { value: Infinity } }, - { x: { value: 1, unit: 3 } }, - ]) - assert.throws(() => new Cip152LabCertificate(json)); - }); - it("encodes CIP-150 calls and preserves block references", async () => { - const abi = new Interface(cip150Abi); - const values = { - tokenExpiration: "100", - lab: "ipfs://QmExample/lab.json", - }; - const calls = []; - const metadata = new Cip150MetadataContract(address, { - provider: null, - call: async (tx) => { - assert.equal(tx.blockTag, 42); - const parsed = abi.parseTransaction({ data: tx.data }); - calls.push(parsed.name); - const key = parsed.args.length ? parsed.args[0] : ""; - const result = { - listMetadataKeys: [Object.keys(values)], - metadataCount: [2n], - getMetadataByIndex: ["tokenExpiration", "100"], - hasMetadataKey: [Object.hasOwn(values, key)], - getMetadataValue: [values[key]], - isMetadataSealed: [true], - }; - return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); - }, - }); - assert.equal(await metadata.count(42), 2n); - assert.deepEqual(await metadata.getByIndex(0n, 42), { - key: "tokenExpiration", - value: "100", - }); - assert.equal((await metadata.readAll(42))[0].sealed, true); - assert.equal((await metadata.readAll(42, false))[0].sealed, undefined); - assert.equal((await metadata.readLifecycle(42)).tokenExpiration, 100n); - const gateway = new IpfsGateway({ - fetch: async () => new Response('{"pH":{"value":7}}'), - }); - assert.equal((await metadata.readLabCertificate(gateway, 42)).measurements.pH.value, 7); - values.lab = "ipfs://QmExample/wrong.json"; - await assert.rejects(metadata.readLabCertificate(gateway, 42), /lab.json/); - delete values.lab; - assert.equal(await metadata.readLabCertificate(gateway, 42), null); - await assert.rejects(metadata.setValue("x", "y"), /sendTransaction/); - assert.ok(calls.includes("isMetadataSealed")); - }); - it("discovers custom units and retains balances beyond Number precision", async () => { - const abi = new Interface(customUnitAbi); - const canonical = 9007199254740993n; - const token = new CustomUnitToken(address, { - provider: null, - call: async (tx) => { - assert.equal(tx.blockTag, 10); - const parsed = abi.parseTransaction({ data: tx.data }); - const result = { - supportsUnit: [parsed.args.length > 0 && parsed.args[0] === "units"], - supportedUnits: [["units", "kg"]], - preferredUnit: ["kg"], - balanceOf: [canonical], - balanceOfUnit: [canonical * 3n], - }; - if (parsed.name === "balanceOfUnit") - assert.equal(parsed.args[1], "kg"); - return abi.encodeFunctionResult(parsed.fragment, result[parsed.name]); - }, - }); - assert.equal((await token.discover(10)).supports("kg"), true); - const balance = await token.balance(address, undefined, 10); - assert.equal(balance.multiplierNumerator, canonical * 3n); - assert.equal(balance.multiplierDenominator, canonical); - assert.equal(await token.supportsUnit(" ", 10), false); - assert.throws(() => token.balanceOfUnit(address, " ")); - }); -}); -describe("IPFS gateway", () => { - it("resolves references and rejects unsupported schemes and traversal", () => { - const gateway = new IpfsGateway(); - for (const ref of [ - "ipfs://QmExample/lab.json", - "/ipfs/QmExample/lab.json", - "QmExample/lab.json", - "ipfs://ipfs/QmExample/lab.json", - ]) - assert.equal(gateway.resolve(ref).href, "https://ipf.sk/QmExample/lab.json"); - assert.equal(gateway.resolve("https://example.com/lab.json").href, "https://example.com/lab.json"); - for (const ref of ["", "file:///tmp/lab.json", "QmExample/../lab.json"]) - assert.throws(() => gateway.resolve(ref)); - assert.throws(() => new IpfsGateway({ maxResponseBytes: 0 })); - assert.throws(() => new IpfsGateway({ template: "ftp://example.com/{cid}" })); - }); - it("bounds streamed bodies and cancels oversized responses", async () => { - let cancelled = false; - const gateway = new IpfsGateway({ - maxResponseBytes: 4, - fetch: async () => new Response(new ReadableStream({ - start(c) { - c.enqueue(new Uint8Array(5)); - }, - cancel() { - cancelled = true; - }, - })), - }); - await assert.rejects(gateway.readJson("QmExample"), /exceeds/); - assert.equal(cancelled, true); - }); - it("rejects HTTP errors and invalid JSON", async () => { - await assert.rejects(new IpfsGateway({ - fetch: async () => new Response("no", { status: 404 }), - }).readJson("QmExample"), /404/); - await assert.rejects(new IpfsGateway({ fetch: async () => new Response("not json") }).readJson("QmExample"), SyntaxError); - }); - it("aborts stalled requests", async () => { - const gateway = new IpfsGateway({ - timeoutMs: 5, - fetch: async (_url, init) => new Promise((_resolve, reject) => init.signal.addEventListener("abort", () => reject(new Error("aborted")))), - }); - await assert.rejects(gateway.readJson("QmExample"), /aborted/); - }); -}); -//# sourceMappingURL=test-cip.js.map \ No newline at end of file diff --git a/lib.esm/_tests/test-cip.js.map b/lib.esm/_tests/test-cip.js.map deleted file mode 100644 index b9103561c..000000000 --- a/lib.esm/_tests/test-cip.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-cip.js","sourceRoot":"","sources":["../../src.ts/_tests/test-cip.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACN,SAAS,EACT,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,aAAa,EACb,WAAW,GACX,MAAM,aAAa,CAAC;AAErB,MAAM,OAAO,GAAG,gDAAgD,CAAC;AAEjE,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC9C,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;QACrE,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC;YACrC,eAAe,EAAE,kBAAkB;YACnC,WAAW,EAAE,GAAG;SAChB,CAAC,CAAC;QACH,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,CAAC;QAC7D,MAAM,CA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M,EAAE,GAAG,EAAE,CAAC;SACtD,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EACxB,KAAK,CACL,CAAC;QACF,MAAM,MAAM,CAAC,OAAO,CACnB,IAAI,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,QAAQ,CACxE,WAAW,CACX,EACD,WAAW,CACX,CAAC;IACH,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACxC,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC;YAC/B,SAAS,EAAE,CAAC;YACZ,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,CAC3B,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAChC,IAAK,CAAC,MAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAC5C,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAC5B,CACD;SACF,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/test-contract.d.ts b/lib.esm/_tests/test-contract.d.ts deleted file mode 100644 index 1427a8692..000000000 --- a/lib.esm/_tests/test-contract.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=test-contract.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/test-contract.d.ts.map b/lib.esm/_tests/test-contract.d.ts.map deleted file mode 100644 index fb6a18b4b..000000000 --- a/lib.esm/_tests/test-contract.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-contract.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-contract.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/_tests/test-contract.js b/lib.esm/_tests/test-contract.js deleted file mode 100644 index 3ab6af6e3..000000000 --- a/lib.esm/_tests/test-contract.js +++ /dev/null @@ -1,84 +0,0 @@ -import { getDefaultProvider, Wallet, Transaction, SigningKey, BaseWallet, verifyMessage, isAddressable, } from "../corebc.js"; -import assert from "assert"; -import { networkIdToPrefix } from "../address/index.js"; -const TIMEOUT_PERIOD = 120000; -const tesSignedTransaction = "0xf8ce800a830f423f0496ce276773ac97d16855a3c8faa45399136b56d419486081c880b8ab54bc60412c90c104a89865a43c33f335836bcb473f0cd477ecb2c82e6310676c87b708e3971d009b4a04e518f12454c3ee1aebc19a6b7df00076b834b692b7432611f3dafff0f422dfbae722ba4b989cfc82fee2e539fbbf21d652ea587df59e8421a3a8bc8ca2ba35033598954c54e10c00315484db568379ce94f9c894e3e6e4c7ee216676b713ca892d9b26746ae902a772e217a6a8bb493ce2bb313cf0cb66e76765d4c45ec6b68600"; -const testWalletPhrase = "better artwork flavor fish solve deer orient spread adapt doll attack hour sort copper super income bacon engine skate ill similar wink crack club"; -const testSeed = "ec372b08ffc451a5dd991c68006aa01a033a6a391e0e72d5690c13cff719fdcb2502812dbf5f32a6df828cd22d77a36405bb15bb2637b7e77f99fa60f00d3560"; -const tesPrivateKey = "69bb68c3a00a0cd9cbf2cab316476228c758329bbfe0b1759e8634694a9497afea05bcbf24e2aa0627eac4240484bb71de646a9296872a3c0e"; -const testAddress = "0xab38254e30777140469a3aa168df81182d3d61f9843f"; -const testPublicKey = "0x484ed765af56534f1c98c0f3ac9fb460fbf5c3cf582e54a6cdfc319986ce1bb875d3afcc9c336764348c96264dfeef9565364d7e8e14e9aa80"; -const provider = getDefaultProvider(process.env.COREBC_RPC_URL || "https://xcbapi.corecoin.cc/"); -const mnemonicWallet = Wallet.fromPhrase({ - phrase: testWalletPhrase, - password: "111111", - prefix: networkIdToPrefix(3), -}); -const mnemonicWalletWithoutPassKey = Wallet.fromPhrase({ - phrase: testWalletPhrase, - prefix: networkIdToPrefix(3), -}); -const wallet = Wallet.fromSeed({ - prefix: networkIdToPrefix(3), - seed: testSeed, - provider, -}); -const seedWallet = Wallet.fromSeed({ - prefix: networkIdToPrefix(3), - seed: testSeed, -}); -const signingKey = new SigningKey(tesPrivateKey); -const baseWalletAddress = "0xab03a5fd22b9bee8b8ab877c86e0a2c21765e1d5bfc5"; -const baseWallet = new BaseWallet({ - signingKey, - prefix: networkIdToPrefix(3), - provider, -}); -const randomWallet = Wallet.createRandom(networkIdToPrefix(3), provider); -const transaction = Transaction.from({ - to: "0xce276773ac97d16855a3c8faa45399136b56d4194860", - value: 200n, - nonce: 0, - energyLimit: 999999n, - energyPrice: 10n, - networkId: 4, -}); -describe("Test wallet creation", function () { - after(() => provider.destroy()); - it("can generate a random wallet", function () { - assert.equal(mnemonicWalletWithoutPassKey.publicKey.length, 116); - assert.equal(randomWallet.mnemonic?.phrase.split(" ").length, 24, "mismatch in phrase length"); - assert.equal(isAddressable(randomWallet), true, "random wallet is not addressable"); - }); -}); -describe("Test getting data from blockchain and calling smart contract", function () { - it("can correctly sign a transaction", async function () { - this.timeout(TIMEOUT_PERIOD); - const tx = await baseWallet.signTransaction(transaction); - assert.equal(tx, tesSignedTransaction, "sign transaction failed"); - }); - it("can correctly get signer from signed transaction", async function () { - this.timeout(TIMEOUT_PERIOD); - const message = "my message"; - const signedMessage = await baseWallet.signMessage(message); - const address = verifyMessage(message, signedMessage, networkIdToPrefix(3)); - assert.equal(address, baseWalletAddress, "get address from signed message failed"); - }); - (process.env.COREBC_RPC_URL ? it : it.skip)("can get fee data", async function () { - this.timeout(TIMEOUT_PERIOD); - const feeData = await provider.getFeeData(); - assert.ok(feeData.energyPrice !== null && feeData.energyPrice >= 0n); - }); - it("can generate wallet", function () { - assert.equal(mnemonicWallet.address.length, 46, "mismatch in address length"); - assert.equal(mnemonicWallet.publicKey, testPublicKey, "mismatch in public key"); - assert.equal(mnemonicWallet.address, testAddress, "mismatch in generated address"); - assert.equal(seedWallet.address.length, 46, "mismatch in address length for seed wallet"); - assert.equal(seedWallet.publicKey, testPublicKey, "mismatch in public key for seed wallet"); - assert.equal(seedWallet.address, testAddress, "mismatch in seed length for seed wallet"); - assert.equal(wallet.address.length, 46, "mismatch in address length for wallet"); - assert.equal(wallet.publicKey, testPublicKey, "mismatch in public key for wallet"); - assert.equal(wallet.address, testAddress, "mismatch in seed length for wallet"); - }); -}); -//# sourceMappingURL=test-contract.js.map \ No newline at end of file diff --git a/lib.esm/_tests/test-contract.js.map b/lib.esm/_tests/test-contract.js.map deleted file mode 100644 index 23d4e0571..000000000 --- a/lib.esm/_tests/test-contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-contract.js","sourceRoot":"","sources":["../../src.ts/_tests/test-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,MAAM,EACN,WAAW,EACX,UAAU,EACV,UAAU,EACV,aAAa,EACb,aAAa,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,oBAAoB,GACzB,oaAAoa,CAAC;AACta,MAAM,gBAAgB,GACrB,oJAAoJ,CAAC;AACtJ,MAAM,QAAQ,GACb,kIAAkI,CAAC;AACpI,MAAM,aAAa,GAClB,oHAAoH,CAAC;AACtH,MAAM,WAAW,GAAG,gDAAgD,CAAC;AACrE,MAAM,aAAa,GAClB,sHAAsH,CAAC;AACxH,MAAM,QAAQ,GAAG,kBAAkB,CAClC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,6BAA6B,CAC3D,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC;IACxC,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,QAAQ;IAClB,M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AC;QAC5C,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,KAAK,IAAI,IAAI,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC,CACD,CAAC;IACF,EAAE,CAAC,qBAAqB,EAAE;QACzB,MAAM,CAAC,KAAK,CACX,cAAc,CAAC,OAAO,CAAC,MAAM,EAC7B,EAAE,EACF,4BAA4B,CAC5B,CAAC;QACF,MAAM,CAAC,KAAK,CACX,cAAc,CAAC,SAAS,EACxB,aAAa,EACb,wBAAwB,CACxB,CAAC;QACF,MAAM,CAAC,KAAK,CACX,cAAc,CAAC,OAAO,EACtB,WAAW,EACX,+BAA+B,CAC/B,CAAC;QACF,MAAM,CAAC,KAAK,CACX,UAAU,CAAC,OAAO,CAAC,MAAM,EACzB,EAAE,EACF,4CAA4C,CAC5C,CAAC;QACF,MAAM,CAAC,KAAK,CACX,UAAU,CAAC,SAAS,EACpB,aAAa,EACb,wCAAwC,CACxC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,UAAU,CAAC,OAAO,EAClB,WAAW,EACX,yCAAyC,CACzC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,MAAM,CAAC,OAAO,CAAC,MAAM,EACrB,EAAE,EACF,uCAAuC,CACvC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,MAAM,CAAC,SAAS,EAChB,aAAa,EACb,mCAAmC,CACnC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,MAAM,CAAC,OAAO,EACd,WAAW,EACX,oCAAoC,CACpC,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/test-crypto.d.ts b/lib.esm/_tests/test-crypto.d.ts deleted file mode 100644 index 5e2048d9c..000000000 --- a/lib.esm/_tests/test-crypto.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=test-crypto.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/test-crypto.d.ts.map b/lib.esm/_tests/test-crypto.d.ts.map deleted file mode 100644 index bac9d8b06..000000000 --- a/lib.esm/_tests/test-crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-crypto.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-crypto.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/_tests/test-crypto.js b/lib.esm/_tests/test-crypto.js deleted file mode 100644 index f1e298a02..000000000 --- a/lib.esm/_tests/test-crypto.js +++ /dev/null @@ -1,37 +0,0 @@ -import assert from "node:assert/strict"; -import { SigningKey, getBytes, sha256, ripemd160, scryptSync, scrypt, keccak256, } from "../index.js"; -import { createHash } from "../crypto/crypto-browser.js"; -describe("updated crypto dependencies", () => { - it("matches standard hash and scrypt vectors", async () => { - assert.equal(sha256("0x"), "0xa7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"); - assert.equal(ripemd160("0x"), "0x9c1185a5c5e9fc54612808977ee8f548b2258d31"); - assert.equal(keccak256("0x"), "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"); - const expected = "0x77d6576238657b203b19ca42c18a0497"; - assert.equal(scryptSync("0x", "0x", 16, 1, 1, 16), expected); - assert.equal(await scrypt("0x", "0x", 16, 1, 1, 16), expected); - assert.deepEqual(createHash("sha256").update(new Uint8Array()).digest(), getBytes("0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")); - }); - it("copies byte private keys and validates lengths", () => { - const bytes = new Uint8Array(57).fill(1); - const key = new SigningKey(bytes); - bytes.fill(2); - assert.equal(key.privateKey, "0x" + "01".repeat(57)); - for (const length of [0, 32, 56, 58]) - assert.throws(() => new SigningKey(new Uint8Array(length))); - assert.throws(() => key.sign("0x00")); - }); - it("signs, rejects tampering and derives symmetric Ed448 secrets in both key modes", () => { - const a = new SigningKey("01".repeat(57)); - const b = new SigningKey("02".repeat(56) + "80"); - const digest = sha256("0x1234"); - for (const key of [a, b]) { - const sig = key.sign(digest); - assert.equal(SigningKey.recoverPublicKey(digest, sig), key.publicKey); - assert.throws(() => SigningKey.recoverPublicKey(sha256("0x1235"), sig)); - } - assert.equal(a.computeSharedSecret(b.publicKey), b.computeSharedSecret(a.publicKey)); - assert.equal(SigningKey.addPoints(a.publicKey, b.publicKey), SigningKey.addPoints(b.publicKey, a.publicKey)); - assert.throws(() => a.computeSharedSecret("0x00")); - }); -}); -//# sourceMappingURL=test-crypto.js.map \ No newline at end of file diff --git a/lib.esm/_tests/test-crypto.js.map b/lib.esm/_tests/test-crypto.js.map deleted file mode 100644 index 642d885a2..000000000 --- a/lib.esm/_tests/test-crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-crypto.js","sourceRoot":"","sources":["../../src.ts/_tests/test-crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACN,UAAU,EACV,QAAQ,EACR,MAAM,EACN,SAAS,EACT,UAAU,EACV,MAAM,EACN,SAAS,GACT,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,CAAC,KAAK,CACX,MAAM,CAAC,IAAI,CAAC,EACZ,oEAAoE,CACpE,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,4CAA4C,CAAC,CAAC;QAC5E,MAAM,CAAC,KAAK,CACX,SAAS,CAAC,IAAI,CAAC,EACf,oEAAoE,CACpE,CAAC;QACF,MAAM,QAAQ,GAAG,oCAAoC,CAAC;QACtD,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,Q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C,GAAG,IAAI,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAChC,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YAC1B,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC7B,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;YACtE,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QACzE,CAAC;QACD,MAAM,CAAC,KAAK,CACX,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,EAClC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,CAClC,CAAC;QACF,MAAM,CAAC,KAAK,CACX,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,EAC9C,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,CAC9C,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/test-keystore.d.ts b/lib.esm/_tests/test-keystore.d.ts deleted file mode 100644 index c74023fe2..000000000 --- a/lib.esm/_tests/test-keystore.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=test-keystore.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/test-keystore.d.ts.map b/lib.esm/_tests/test-keystore.d.ts.map deleted file mode 100644 index f298fe780..000000000 --- a/lib.esm/_tests/test-keystore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/test-keystore.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/_tests/test-keystore.js b/lib.esm/_tests/test-keystore.js deleted file mode 100644 index 577f45c7a..000000000 --- a/lib.esm/_tests/test-keystore.js +++ /dev/null @@ -1,41 +0,0 @@ -import assert from "node:assert/strict"; -import { Wallet, networkIdToPrefix, encryptKeystoreJsonSync, encryptKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, } from "../index.js"; -describe("AES keystores", () => { - const wallet = Wallet.fromSeed({ - seed: "01".repeat(64), - prefix: networkIdToPrefix(3), - }); - const account = { address: wallet.address, privateKey: wallet.privateKey }; - const options = { scrypt: { N: 16, r: 1, p: 1 } }; - it("round-trips Ed448 keys with sync and async encryption", async () => { - for (const json of [ - encryptKeystoreJsonSync(account, "test", options), - await encryptKeystoreJson(account, "test", options), - ]) { - assert.deepEqual(decryptKeystoreJsonSync(json, "test"), account); - assert.deepEqual(await decryptKeystoreJson(json, "test"), account); - assert.throws(() => decryptKeystoreJsonSync(json, "wrong"), /incorrect password/); - const changed = JSON.parse(json); - changed.Crypto.mac = "00".repeat(32); - await assert.rejects(decryptKeystoreJson(JSON.stringify(changed), "test"), /incorrect password/); - } - }); - it("rejects unsafe KDF parameters before allocating work", () => { - for (const scrypt of [ - { N: 0 }, - { N: 1 }, - { N: 2 ** 32 }, - { r: 0 }, - { p: 2 ** 30 }, - { N: 1048576, r: 8 }, - ]) - assert.throws(() => encryptKeystoreJsonSync(account, "test", { scrypt }), /unsafe/); - const data = JSON.parse(encryptKeystoreJsonSync(account, "test", options)); - data.Crypto.kdfparams.n = 2 ** 32; - assert.throws(() => decryptKeystoreJsonSync(JSON.stringify(data), "test"), /unsafe/); - data.Crypto.kdf = "pbkdf2"; - Object.assign(data.Crypto.kdfparams, { c: 10000001, prf: "hmac-sha256" }); - assert.throws(() => decryptKeystoreJsonSync(JSON.stringify(data), "test"), /unsafe/); - }); -}); -//# sourceMappingURL=test-keystore.js.map \ No newline at end of file diff --git a/lib.esm/_tests/test-keystore.js.map b/lib.esm/_tests/test-keystore.js.map deleted file mode 100644 index c3cd64192..000000000 --- a/lib.esm/_tests/test-keystore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test-keystore.js","sourceRoot":"","sources":["../../src.ts/_tests/test-keystore.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EACN,MAAM,EACN,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,aAAa,CAAC;AAErB,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC9B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACrB,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;KAC5B,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;IAC3E,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;IAClD,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACtE,KAAK,MAAM,IAAI,IAAI;YAClB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;YACjD,MAAM,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;SACnD,EAAE,CAAC;YACH,MAAM,CAAC,SAAS,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAA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C,MAAM,CACZ,GAAG,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAC3D,QAAQ,CACR,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,QAAQ,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC,CAAC;QAC1E,MAAM,CAAC,MAAM,CACZ,GAAG,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAC3D,QAAQ,CACR,CAAC;IACH,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/_tests/types.d.ts b/lib.esm/_tests/types.d.ts deleted file mode 100644 index 153d8067f..000000000 --- a/lib.esm/_tests/types.d.ts +++ /dev/null @@ -1,191 +0,0 @@ -export type TestCaseAbiVerbose = { - type: "address" | "hexstring" | "number" | "string"; - value: string; -} | { - type: "boolean"; - value: boolean; -} | { - type: "array"; - value: Array; -} | { - type: "object"; - value: Array; -}; -export interface TestCaseAbi { - name: string; - type: string; - value: any; - verbose: TestCaseAbiVerbose; - bytecode: string; - encoded: string; -} -export interface TestCaseAccount { - name: string; - privateKey: string; - address: string; - icap: string; -} -export type TestCaseCreate = { - sender: string; - creates: Array<{ - name: string; - nonce: number; - address: string; - }>; -}; -export type TestCaseCreate2 = { - sender: string; - creates: Array<{ - name: string; - salt: string; - initCode: string; - initCodeHash: string; - address: string; - }>; -}; -export interface TestCaseHash { - name: string; - data: string; - sha256: string; - sha512: string; - ripemd160: string; -} -export interface TestCasePbkdf { - name: string; - password: string; - salt: string; - dkLen: number; - pbkdf2: { - iterations: number; - algorithm: "sha256" | "sha512"; - key: string; - }; - scrypt: { - N: number; - r: number; - p: number; - key: string; - }; -} -export interface TestCaseHmac { - name: string; - data: string; - key: string; - algorithm: "sha256" | "sha512"; - hmac: string; -} -export interface TestCaseHash { - name: string; - data: string; - sha256: string; - sha512: string; - ripemd160: string; -} -export interface TestCaseTypedDataDomain { - name?: string; - version?: string; - networkId?: number; - verifyingContract?: string; - salt?: string; -} -export interface TestCaseTypedDataType { - name: string; - type: string; -} -export interface TestCaseTypedData { - name: string; - domain: TestCaseTypedDataDomain; - primaryType: string; - types: Record>; - data: any; - encoded: string; - digest: string; - privateKey?: string; - signature?: string; -} -export interface TestCaseSolidityHash { - name: string; - types: Array; - ripemd160: string; - sha256: string; - values: Array; -} -export type NestedHexString = string | Array; -export interface TestCaseRlp { - name: string; - encoded: string; - decoded: NestedHexString; -} -export interface TestCaseTransactionTx { - to?: string; - nonce?: number; - energyLimit?: string; - energyPrice?: string; - maxFeePerEnergy?: string; - data?: string; - value?: string; - accessList?: Array<{ - address: string; - storageKeys: Array; - }>; - networkId?: string; -} -export interface TestCaseTransactionSig { - r: string; - s: string; - v: string; -} -export interface TestCaseTransaction { - name: string; - transaction: TestCaseTransactionTx; - privateKey: string; - unsignedLegacy: string; - signedLegacy: string; - unsignedEip155: string; - signedEip155: string; - unsignedBerlin: string; - signedBerlin: string; - unsignedLondon: string; - signedLondon: string; - signatureLegacy: TestCaseTransactionSig; - signatureEip155: TestCaseTransactionSig; - signatureBerlin: TestCaseTransactionSig; - signatureLondon: TestCaseTransactionSig; -} -export interface TestCaseMnemonicNode { - path: string; - chainCode: string; - depth: number; - index: number; - parentFingerprint: string; - fingerprint: string; - publicKey: string; - privateKey: string; - xpriv: string; - xpub: string; -} -export interface TestCaseMnemonic { - name: string; - phrase: string; - phraseHash: string; - password: string; - locale: string; - entropy: string; - seed: string; - nodes: Array; -} -export interface TestCaseWallet { - name: string; - filename: string; - type: string; - address: string; - password: string; - content: string; -} -export interface TestCaseWordlist { - name: string; - filename: string; - locale: string; - content: string; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/lib.esm/_tests/types.d.ts.map b/lib.esm/_tests/types.d.ts.map deleted file mode 100644 index db09709f7..000000000 --- a/lib.esm/_tests/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/_tests/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC3B;IACA,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACpD,KAAK,EAAE,MAAM,CAAC;CACb,GACD;IACA,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CACd,GACD;IACA,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;CAChC,GACD;IACA,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAC;CAChC,CAAC;AAEL,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CAChB;AAKD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,KAAK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C;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CAChB;AAKD,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CAChB"} \ No newline at end of file diff --git a/lib.esm/_tests/types.js b/lib.esm/_tests/types.js deleted file mode 100644 index 718fd38ae..000000000 --- a/lib.esm/_tests/types.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/lib.esm/_tests/types.js.map b/lib.esm/_tests/types.js.map deleted file mode 100644 index 52b4d3276..000000000 --- a/lib.esm/_tests/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src.ts/_tests/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/_version.d.ts b/lib.esm/_version.d.ts deleted file mode 100644 index 515a07b59..000000000 --- a/lib.esm/_version.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/** The current version of corebc; keep in sync with package.json. */ -export declare const version: string; -//# sourceMappingURL=_version.d.ts.map \ No newline at end of file diff --git a/lib.esm/_version.d.ts.map b/lib.esm/_version.d.ts.map deleted file mode 100644 index 99992181e..000000000 --- a/lib.esm/_version.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"} \ No newline at end of file diff --git a/lib.esm/_version.js b/lib.esm/_version.js deleted file mode 100644 index 5ba73f265..000000000 --- a/lib.esm/_version.js +++ /dev/null @@ -1,3 +0,0 @@ -/** The current version of corebc; keep in sync with package.json. */ -export const version = "0.4.1"; -//# sourceMappingURL=_version.js.map \ No newline at end of file diff --git a/lib.esm/_version.js.map b/lib.esm/_version.js.map deleted file mode 100644 index 08e177b22..000000000 --- a/lib.esm/_version.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_version.js","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,MAAM,CAAC,MAAM,OAAO,GAAW,OAAO,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi-types/Tes.d.ts b/lib.esm/abi-types/Tes.d.ts deleted file mode 100644 index ab20b2246..000000000 --- a/lib.esm/abi-types/Tes.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "../corebc.js"; -import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "./common.js"; -export interface TesInterface extends Interface { - getFunction(nameOrSignature: "approve" | "balanceOf" | "batchOwnerOf" | "getApproved" | "isApprovedForAll" | "mint" | "ownerOf" | "safeTransferFrom(address,address,uint256)" | "safeTransferFrom(address,address,uint256,bytes)" | "setApprovalForAll" | "tokenByIndex" | "tokenOfOwnerByIndex" | "totalSupply" | "transferFrom"): FunctionFragment; - getEvent(nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer"): EventFragment; - encodeFunctionData(functionFragment: "approve", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "balanceOf", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "batchOwnerOf", values: [BigNumberish[]]): string; - encodeFunctionData(functionFragment: "getApproved", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "isApprovedForAll", values: [AddressLike, AddressLike]): string; - encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "ownerOf", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256)", values: [AddressLike, AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", values: [AddressLike, AddressLike, BigNumberish, BytesLike]): string; - encodeFunctionData(functionFragment: "setApprovalForAll", values: [AddressLike, boolean]): string; - encodeFunctionData(functionFragment: "tokenByIndex", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "tokenOfOwnerByIndex", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "totalSupply", values?: undefined): string; - encodeFunctionData(functionFragment: "transferFrom", values: [AddressLike, AddressLike, BigNumberish]): string; - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "batchOwnerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getApproved", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "isApprovedForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "setApprovalForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenOfOwnerByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "totalSupply", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "transferFrom", data: BytesLike): Result; -} -export declare namespace ApprovalEvent { - type InputTuple = [ - owner: AddressLike, - approved: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [owner: string, approved: string, tokenId: bigint]; - interface OutputObject { - owner: string; - approved: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace ApprovalForAllEvent { - type InputTuple = [ - owner: AddressLike, - operator: AddressLike, - approved: boolean - ]; - type OutputTuple = [ - owner: string, - operator: string, - approved: boolean - ]; - interface OutputObject { - owner: string; - operator: string; - approved: boolean; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace TransferEvent { - type InputTuple = [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [from: string, to: string, tokenId: bigint]; - interface OutputObject { - from: string; - to: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export interface Tes extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; - attach(addressOrName: AddressLike): this; - deployed(): Promise; - interface: TesInterface; - queryFilter(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - queryFilter(filter: TypedDeferredTopicFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - on(event: TCEvent, listener: TypedListener): Promise; - on(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - once(event: TCEvent, listener: TypedListener): Promise; - once(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - listeners(event: TCEvent): Promise>>; - listeners(eventName?: string): Promise>; - removeAllListeners(event?: TCEvent): Promise; - approve: TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - isApprovedForAll: TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - "safeTransferFrom(address,address,uint256)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - setApprovalForAll: TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; - tokenOfOwnerByIndex: TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - totalSupply: TypedContractMethod<[], [bigint], "view">; - transferFrom: TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(key: string | FunctionFragment): T; - getFunction(nameOrSignature: "approve"): TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "balanceOf"): TypedContractMethod<[owner: AddressLike], [bigint], "view">; - getFunction(nameOrSignature: "batchOwnerOf"): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getFunction(nameOrSignature: "getApproved"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "isApprovedForAll"): TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - getFunction(nameOrSignature: "mint"): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - getFunction(nameOrSignature: "ownerOf"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "setApprovalForAll"): TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "tokenByIndex"): TypedContractMethod<[index: BigNumberish], [bigint], "view">; - getFunction(nameOrSignature: "tokenOfOwnerByIndex"): TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - getFunction(nameOrSignature: "totalSupply"): TypedContractMethod<[], [bigint], "view">; - getFunction(nameOrSignature: "transferFrom"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getEvent(key: "Approval"): TypedContractEvent; - getEvent(key: "ApprovalForAll"): TypedContractEvent; - getEvent(key: "Transfer"): TypedContractEvent; - filters: { - "Approval(address,address,uint256)": TypedContractEvent; - Approval: TypedContractEvent; - "ApprovalForAll(address,address,bool)": TypedContractEvent; - ApprovalForAll: TypedContractEvent; - "Transfer(address,address,uint256)": TypedContractEvent; - Transfer: TypedContractEvent; - }; -} -//# sourceMappingURL=Tes.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi-types/Tes.d.ts.map b/lib.esm/abi-types/Tes.d.ts.map deleted file mode 100644 index 0c7f7bc42..000000000 --- a/lib.esm/abi-types/Tes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes.d.ts","sourceRoot":"","sources":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BAAkB,CACpB,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;IACF,QAAQ,CACP,GAAG,EAAE,UAAU,GACb,kBAAkB,CACpB,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;IAEF,OAAO,EAAE;QACR,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACzD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QACF,cAAc,EAAE,kBAAkB,CACjC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/lib.esm/abi-types/Tes.js b/lib.esm/abi-types/Tes.js deleted file mode 100644 index f3d1598c9..000000000 --- a/lib.esm/abi-types/Tes.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=Tes.js.map \ No newline at end of file diff --git a/lib.esm/abi-types/Tes.js.map b/lib.esm/abi-types/Tes.js.map deleted file mode 100644 index af1f5205d..000000000 --- a/lib.esm/abi-types/Tes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes.js","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/abi-types/Tes_abi.d.ts b/lib.esm/abi-types/Tes_abi.d.ts deleted file mode 100644 index 3df4e144e..000000000 --- a/lib.esm/abi-types/Tes_abi.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "../corebc.js"; -import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "./common.js"; -export interface Tes_abiInterface extends Interface { - getFunction(nameOrSignature: "approve" | "balanceOf" | "batchOwnerOf" | "getApproved" | "isApprovedForAll" | "mint" | "ownerOf" | "safeTransferFrom(address,address,uint256)" | "safeTransferFrom(address,address,uint256,bytes)" | "setApprovalForAll" | "tokenByIndex" | "tokenOfOwnerByIndex" | "totalSupply" | "transferFrom"): FunctionFragment; - getEvent(nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer"): EventFragment; - encodeFunctionData(functionFragment: "approve", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "balanceOf", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "batchOwnerOf", values: [BigNumberish[]]): string; - encodeFunctionData(functionFragment: "getApproved", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "isApprovedForAll", values: [AddressLike, AddressLike]): string; - encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "ownerOf", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256)", values: [AddressLike, AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", values: [AddressLike, AddressLike, BigNumberish, BytesLike]): string; - encodeFunctionData(functionFragment: "setApprovalForAll", values: [AddressLike, boolean]): string; - encodeFunctionData(functionFragment: "tokenByIndex", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "tokenOfOwnerByIndex", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "totalSupply", values?: undefined): string; - encodeFunctionData(functionFragment: "transferFrom", values: [AddressLike, AddressLike, BigNumberish]): string; - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "batchOwnerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getApproved", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "isApprovedForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "setApprovalForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenOfOwnerByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "totalSupply", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "transferFrom", data: BytesLike): Result; -} -export declare namespace ApprovalEvent { - type InputTuple = [ - owner: AddressLike, - approved: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [owner: string, approved: string, tokenId: bigint]; - interface OutputObject { - owner: string; - approved: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace ApprovalForAllEvent { - type InputTuple = [ - owner: AddressLike, - operator: AddressLike, - approved: boolean - ]; - type OutputTuple = [ - owner: string, - operator: string, - approved: boolean - ]; - interface OutputObject { - owner: string; - operator: string; - approved: boolean; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace TransferEvent { - type InputTuple = [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [from: string, to: string, tokenId: bigint]; - interface OutputObject { - from: string; - to: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export interface Tes_abi extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; - attach(addressOrName: AddressLike): this; - deployed(): Promise; - interface: Tes_abiInterface; - queryFilter(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - queryFilter(filter: TypedDeferredTopicFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - on(event: TCEvent, listener: TypedListener): Promise; - on(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - once(event: TCEvent, listener: TypedListener): Promise; - once(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - listeners(event: TCEvent): Promise>>; - listeners(eventName?: string): Promise>; - removeAllListeners(event?: TCEvent): Promise; - approve: TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - isApprovedForAll: TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - "safeTransferFrom(address,address,uint256)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - setApprovalForAll: TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; - tokenOfOwnerByIndex: TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - totalSupply: TypedContractMethod<[], [bigint], "view">; - transferFrom: TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(key: string | FunctionFragment): T; - getFunction(nameOrSignature: "approve"): TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "balanceOf"): TypedContractMethod<[owner: AddressLike], [bigint], "view">; - getFunction(nameOrSignature: "batchOwnerOf"): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getFunction(nameOrSignature: "getApproved"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "isApprovedForAll"): TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - getFunction(nameOrSignature: "mint"): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - getFunction(nameOrSignature: "ownerOf"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "setApprovalForAll"): TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "tokenByIndex"): TypedContractMethod<[index: BigNumberish], [bigint], "view">; - getFunction(nameOrSignature: "tokenOfOwnerByIndex"): TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - getFunction(nameOrSignature: "totalSupply"): TypedContractMethod<[], [bigint], "view">; - getFunction(nameOrSignature: "transferFrom"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getEvent(key: "Approval"): TypedContractEvent; - getEvent(key: "ApprovalForAll"): TypedContractEvent; - getEvent(key: "Transfer"): TypedContractEvent; - filters: { - "Approval(address,address,uint256)": TypedContractEvent; - Approval: TypedContractEvent; - "ApprovalForAll(address,address,bool)": TypedContractEvent; - ApprovalForAll: TypedContractEvent; - "Transfer(address,address,uint256)": TypedContractEvent; - Transfer: TypedContractEvent; - }; -} -//# sourceMappingURL=Tes_abi.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi-types/Tes_abi.d.ts.map b/lib.esm/abi-types/Tes_abi.d.ts.map deleted file mode 100644 index 152cbb189..000000000 --- a/lib.esm/abi-types/Tes_abi.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IAClD,WAAW,CACV,eAAe,EACZ,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAA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WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACzD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QACF,cAAc,EAAE,kBAAkB,CACjC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/lib.esm/abi-types/Tes_abi.js b/lib.esm/abi-types/Tes_abi.js deleted file mode 100644 index d4dbd3bd3..000000000 --- a/lib.esm/abi-types/Tes_abi.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=Tes_abi.js.map \ No newline at end of file diff --git a/lib.esm/abi-types/Tes_abi.js.map b/lib.esm/abi-types/Tes_abi.js.map deleted file mode 100644 index 062e82f0f..000000000 --- a/lib.esm/abi-types/Tes_abi.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi.js","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/abi-types/common.d.ts b/lib.esm/abi-types/common.d.ts deleted file mode 100644 index d6e86d0d7..000000000 --- a/lib.esm/abi-types/common.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { FunctionFragment, Typed, EventFragment, ContractTransaction, ContractTransactionResponse, DeferredTopicFilter, EventLog, TransactionRequest, LogDescription } from "../corebc.js"; -export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent> extends DeferredTopicFilter { -} -export interface TypedContractEvent = any, OutputTuple extends Array = any, OutputObject = any> { - (...args: Partial): TypedDeferredTopicFilter>; - name: string; - fragment: EventFragment; - getFragment(...args: Partial): EventFragment; -} -type __TypechainAOutputTuple = T extends TypedContractEvent ? W : never; -type __TypechainOutputObject = T extends TypedContractEvent ? V : never; -export interface TypedEventLog extends Omit { - args: __TypechainAOutputTuple & __TypechainOutputObject; -} -export interface TypedLogDescription extends Omit { - args: __TypechainAOutputTuple & __TypechainOutputObject; -} -export type TypedListener = (...listenerArg: [ - ...__TypechainAOutputTuple, - TypedEventLog, - ...undefined[] -]) => void; -export type MinCoreBCFactory = { - deploy(...a: ARGS[]): Promise; -}; -export type GetContractTypeFromFactory = F extends MinCoreBCFactory ? C : never; -export type GetARGsTypeFromFactory = F extends MinCoreBCFactory ? Parameters : never; -export type StateMutability = "nonpayable" | "payable" | "view"; -export type BaseOverrides = Omit; -export type NonPayableOverrides = Omit; -export type PayableOverrides = Omit; -export type ViewOverrides = Omit; -export type Overrides = S extends "nonpayable" ? NonPayableOverrides : S extends "payable" ? PayableOverrides : ViewOverrides; -export type PostfixOverrides, S extends StateMutability> = A | [...A, Overrides]; -export type ContractMethodArgs, S extends StateMutability> = PostfixOverrides<{ - [I in keyof A]-?: A[I] | Typed; -}, S>; -export type DefaultReturnType = R extends Array ? R[0] : R; -export interface TypedContractMethod = Array, R = any, S extends StateMutability = "payable"> { - (...args: ContractMethodArgs): S extends "view" ? Promise> : Promise; - name: string; - fragment: FunctionFragment; - getFragment(...args: ContractMethodArgs): FunctionFragment; - populateTransaction(...args: ContractMethodArgs): Promise; - staticCall(...args: ContractMethodArgs): Promise>; - send(...args: ContractMethodArgs): Promise; - estimateGas(...args: ContractMethodArgs): Promise; - staticCallResult(...args: ContractMethodArgs): Promise; -} -export {}; -//# sourceMappingURL=common.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi-types/common.d.ts.map b/lib.esm/abi-types/common.d.ts.map deleted file mode 100644 index b7d6fe89d..000000000 --- a/lib.esm/abi-types/common.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/common.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,cAAc,EACd,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,wBAAwB,CACxC,QAAQ,SAAS,kBAAkB,CAClC,SAAQ,mBAAmB;CAAG;AAEhC,MAAM,WAAW,kBAAkB,CAClC,UAAU,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,EACnC,WAAW,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,EACpC,YAAY,GAAG,GAAG;IAElB,CACC,GAAG,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,GAC1B,wBAAwB,CAC1B,kBAAkB,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,CAAC,CACzD,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,aAAa,CAAC;IACxB,WAAW,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC;CACzD;AAED,KAAK,uBAAuB,CAAC,CAAC,IAC7B,CAAC,SAAS,kBAAkB,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC7D,KAAK,uBAAuB,CAAC,CAAC,IAC7B,CAAC,SAAS,kBAAkB,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEvE,MAAM,WAAW,aAAa,CAAC,OAAO,SAAS,kBAAkB,CAAE,SAAQ,IAAI,CAC9E,QAAQ,EACR,MAAM,CACN;IACA,IAAI,EAAE,uB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C,EAAE,CAAC,CAAC,GAAG,gBAAgB,CAAC;IAEjE,mBAAmB,CAClB,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAChC,UAAU,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,IAAI,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC9E,WAAW,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,gBAAgB,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChE"} \ No newline at end of file diff --git a/lib.esm/abi-types/common.js b/lib.esm/abi-types/common.js deleted file mode 100644 index 6b84ded1c..000000000 --- a/lib.esm/abi-types/common.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/lib.esm/abi-types/common.js.map b/lib.esm/abi-types/common.js.map deleted file mode 100644 index a8598baee..000000000 --- a/lib.esm/abi-types/common.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src.ts/abi-types/common.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes__factory.d.ts b/lib.esm/abi-types/factories/Tes__factory.d.ts deleted file mode 100644 index 9fb691f6d..000000000 --- a/lib.esm/abi-types/factories/Tes__factory.d.ts +++ /dev/null @@ -1,280 +0,0 @@ -import { ContractRunner } from "../../corebc.js"; -import type { Tes, TesInterface } from "../Tes.js"; -export declare class Tes__factory { - static readonly abi: readonly [{ - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "approved"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Approval"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly indexed: false; - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "ApprovalForAll"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Transfer"; - readonly type: "event"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "approve"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }]; - readonly name: "balanceOf"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256[]"; - readonly name: "ids"; - readonly type: "uint256[]"; - }]; - readonly name: "batchOwnerOf"; - readonly outputs: readonly [{ - readonly internalType: "address[]"; - readonly name: ""; - readonly type: "address[]"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "getApproved"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }]; - readonly name: "isApprovedForAll"; - readonly outputs: readonly [{ - readonly internalType: "bool"; - readonly name: ""; - readonly type: "bool"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }]; - readonly name: "mint"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "ownerOf"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }, { - readonly internalType: "bytes"; - readonly name: "data"; - readonly type: "bytes"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "setApprovalForAll"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenOfOwnerByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly []; - readonly name: "totalSupply"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "transferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }]; - static createInterface(): TesInterface; - static connect(address: string, runner?: ContractRunner | null): Tes; -} -//# sourceMappingURL=Tes__factory.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes__factory.d.ts.map b/lib.esm/abi-types/factories/Tes__factory.d.ts.map deleted file mode 100644 index 262b59a93..000000000 --- a/lib.esm/abi-types/factories/Tes__factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuWnD,qBAAa,YAAY;IACxB,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,MAAM;qBACpB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,MAAM;;uBAGR,gBAAgB;uBAChB,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;qBAKX,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAA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EAAE,SAAS;;uBAGX,qBAAqB;;qBAGzB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;uBAIV,aAAa;;qBAGjB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,cAAc;;kCAEH,YAAY;uBACvB,UAAU;OAKU;IAC3B,MAAM,CAAC,eAAe,IAAI,YAAY,CAErC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,GAAG,CAEnE;CACD"} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes__factory.js b/lib.esm/abi-types/factories/Tes__factory.js deleted file mode 100644 index e8cdaadd8..000000000 --- a/lib.esm/abi-types/factories/Tes__factory.js +++ /dev/null @@ -1,370 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { Contract, Interface } from "../../corebc.js"; -const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "approved", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Transfer", - type: "event", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "approve", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - ], - name: "batchOwnerOf", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "getApproved", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "isApprovedForAll", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "mint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ownerOf", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenOfOwnerByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "transferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; -export class Tes__factory { - static abi = _abi; - static createInterface() { - return new Interface(_abi); - } - static connect(address, runner) { - return new Contract(address, _abi, runner); - } -} -//# sourceMappingURL=Tes__factory.js.map \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes__factory.js.map b/lib.esm/abi-types/factories/Tes__factory.js.map deleted file mode 100644 index d54554413..000000000 --- a/lib.esm/abi-types/factories/Tes__factory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes__factory.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AAEpB,OAAO,EAAE,QAAQ,EAAkB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGtE,MAAM,IAAI,GAAG;IACZ;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aACf;SACD;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACb;IACD;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,KAAK;gBACd,YAAY,EAAE,MAAM;gBACpB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,MAAM;aACZ;SACD;QACD,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,OAAO;KACb;IACD;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,E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IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAmB,CAAC;IAC9D,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes_abi__factory.d.ts b/lib.esm/abi-types/factories/Tes_abi__factory.d.ts deleted file mode 100644 index bd8c9ccc6..000000000 --- a/lib.esm/abi-types/factories/Tes_abi__factory.d.ts +++ /dev/null @@ -1,280 +0,0 @@ -import { ContractRunner } from "../../corebc.js"; -import type { Tes_abi, Tes_abiInterface } from "../Tes_abi.js"; -export declare class Tes_abi__factory { - static readonly abi: readonly [{ - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "approved"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Approval"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly indexed: false; - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "ApprovalForAll"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Transfer"; - readonly type: "event"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "approve"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }]; - readonly name: "balanceOf"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256[]"; - readonly name: "ids"; - readonly type: "uint256[]"; - }]; - readonly name: "batchOwnerOf"; - readonly outputs: readonly [{ - readonly internalType: "address[]"; - readonly name: ""; - readonly type: "address[]"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "getApproved"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }]; - readonly name: "isApprovedForAll"; - readonly outputs: readonly [{ - readonly internalType: "bool"; - readonly name: ""; - readonly type: "bool"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }]; - readonly name: "mint"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "ownerOf"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }, { - readonly internalType: "bytes"; - readonly name: "data"; - readonly type: "bytes"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "setApprovalForAll"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenOfOwnerByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly []; - readonly name: "totalSupply"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "transferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }]; - static createInterface(): Tes_abiInterface; - static connect(address: string, runner?: ContractRunner | null): Tes_abi; -} -//# sourceMappingURL=Tes_abi__factory.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes_abi__factory.d.ts.map b/lib.esm/abi-types/factories/Tes_abi__factory.d.ts.map deleted file mode 100644 index 530a4f795..000000000 --- a/lib.esm/abi-types/factories/Tes_abi__factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuW/D,qBAAa,gBAAgB;IAC5B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,MAAM;qBACpB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,MAAM;;uBAGR,gBAAgB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AGR,mBAAmB;;kCAER,YAAY;uBACvB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;uBAGX,cAAc;;qBAGlB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;uBAGX,qBAAqB;;qBAGzB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;uBAIV,aAAa;;qBAGjB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,cAAc;;kCAEH,YAAY;uBACvB,UAAU;OAKU;IAC3B,MAAM,CAAC,eAAe,IAAI,gBAAgB,CAEzC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAEvE;CACD"} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes_abi__factory.js b/lib.esm/abi-types/factories/Tes_abi__factory.js deleted file mode 100644 index fa0ef0747..000000000 --- a/lib.esm/abi-types/factories/Tes_abi__factory.js +++ /dev/null @@ -1,370 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import { Contract, Interface } from "../../corebc.js"; -const _abi = [ - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "approved", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Approval", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "owner", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "operator", - type: "address", - }, - { - indexed: false, - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "ApprovalForAll", - type: "event", - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: "address", - name: "from", - type: "address", - }, - { - indexed: true, - internalType: "address", - name: "to", - type: "address", - }, - { - indexed: true, - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "Transfer", - type: "event", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "approve", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "balanceOf", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256[]", - name: "ids", - type: "uint256[]", - }, - ], - name: "batchOwnerOf", - outputs: [ - { - internalType: "address[]", - name: "", - type: "address[]", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "getApproved", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "operator", - type: "address", - }, - ], - name: "isApprovedForAll", - outputs: [ - { - internalType: "bool", - name: "", - type: "bool", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "to", - type: "address", - }, - ], - name: "mint", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "ownerOf", - outputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - { - internalType: "bytes", - name: "data", - type: "bytes", - }, - ], - name: "safeTransferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "operator", - type: "address", - }, - { - internalType: "bool", - name: "approved", - type: "bool", - }, - ], - name: "setApprovalForAll", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [ - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "uint256", - name: "index", - type: "uint256", - }, - ], - name: "tokenOfOwnerByIndex", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "totalSupply", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "address", - name: "to", - type: "address", - }, - { - internalType: "uint256", - name: "tokenId", - type: "uint256", - }, - ], - name: "transferFrom", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, -]; -export class Tes_abi__factory { - static abi = _abi; - static createInterface() { - return new Interface(_abi); - } - static connect(address, runner) { - return new Contract(address, _abi, runner); - } -} -//# sourceMappingURL=Tes_abi__factory.js.map \ No newline at end of file diff --git a/lib.esm/abi-types/factories/Tes_abi__factory.js.map b/lib.esm/abi-types/factories/Tes_abi__factory.js.map deleted file mode 100644 index e978722e4..000000000 --- a/lib.esm/abi-types/factories/Tes_abi__factory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi__factory.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AAEpB,OAAO,EAAE,QAAQ,EAAkB,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAGtE,MAAM,IAAI,GAAG;IACZ;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aACf;SACD;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACb;IACD;QACC,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACP;gBACC,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aACf;YACD;gBACC,OAAO,EAAE,IAAI;gBAC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YACD;gBACC,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aACf;SACD;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KAChB;CACQ,CAAC;AAEX,MAAM,OAAO,gBAAgB;IAC5B,MAAM,CAAU,GAAG,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,eAAe;QACrB,OAAO,IAAI,SAAS,CAAC,IAAI,CAAqB,CAAC;IAChD,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,MAA8B;QAC7D,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAuB,CAAC;IAClE,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/index.d.ts b/lib.esm/abi-types/factories/index.d.ts deleted file mode 100644 index e6b4dbcc0..000000000 --- a/lib.esm/abi-types/factories/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { Tes__factory } from "./Tes__factory.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi-types/factories/index.d.ts.map b/lib.esm/abi-types/factories/index.d.ts.map deleted file mode 100644 index 2727001fd..000000000 --- a/lib.esm/abi-types/factories/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi-types/factories/index.js b/lib.esm/abi-types/factories/index.js deleted file mode 100644 index aec5242f0..000000000 --- a/lib.esm/abi-types/factories/index.js +++ /dev/null @@ -1,5 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -export { Tes__factory } from "./Tes__factory.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/abi-types/factories/index.js.map b/lib.esm/abi-types/factories/index.js.map deleted file mode 100644 index a0c44e814..000000000 --- a/lib.esm/abi-types/factories/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi-types/index.d.ts b/lib.esm/abi-types/index.d.ts deleted file mode 100644 index ca4fb7b40..000000000 --- a/lib.esm/abi-types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type { Tes } from "./Tes.js"; -export * as factories from "./factories/index.js"; -export { Tes__factory } from "./factories/Tes__factory.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi-types/index.d.ts.map b/lib.esm/abi-types/index.d.ts.map deleted file mode 100644 index 90d11b2fc..000000000 --- a/lib.esm/abi-types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi-types/index.js b/lib.esm/abi-types/index.js deleted file mode 100644 index cb04736a0..000000000 --- a/lib.esm/abi-types/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * as factories from "./factories/index.js"; -export { Tes__factory } from "./factories/Tes__factory.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/abi-types/index.js.map b/lib.esm/abi-types/index.js.map deleted file mode 100644 index 9c9c7ed92..000000000 --- a/lib.esm/abi-types/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/abi-types/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi/abi-coder.d.ts b/lib.esm/abi/abi-coder.d.ts deleted file mode 100644 index 1350031d4..000000000 --- a/lib.esm/abi/abi-coder.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -import { Result } from "./coders/abstract-coder.js"; -import { ParamType } from "./fragments.js"; -import type { BytesLike, CallExceptionAction, CallExceptionError } from "../utils/index.js"; -/** - * About AbiCoder - */ -export declare class AbiCoder { - #private; - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types: ReadonlyArray): Result; - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types: ReadonlyArray, values: ReadonlyArray): string; - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types: ReadonlyArray, data: BytesLike, loose?: boolean): Result; - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder(): AbiCoder; - /** - * Returns an corebc-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action: CallExceptionAction, tx: { - to?: null | string; - from?: null | string; - data?: string; - }, data: null | BytesLike): CallExceptionError; -} -//# sourceMappingURL=abi-coder.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/abi-coder.d.ts.map b/lib.esm/abi/abi-coder.d.ts.map deleted file mode 100644 index ad04d5ac9..000000000 --- a/lib.esm/abi/abi-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACX,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAElB,MAAM,mBAAmB,CAAC;AA8F3B;;GAEG;AACH,qBAAa,QAAQ;;IA2DpB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAMhE;IAED;;;;OAIG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;IAED;;;;;;OAMG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,OAAO,GACb,MAAM,CAMR;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ,CAKjC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/D,IAAI,EAAE,IAAI,GAAG,SAAS,GACpB,kBAAkB,CAOpB;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/abi-coder.js b/lib.esm/abi/abi-coder.js deleted file mode 100644 index 38be576e3..000000000 --- a/lib.esm/abi/abi-coder.js +++ /dev/null @@ -1,204 +0,0 @@ -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -import { assertArgumentCount, assertArgument } from "../utils/index.js"; -import { Reader, Writer } from "./coders/abstract-coder.js"; -import { AddressCoder } from "./coders/address.js"; -import { ArrayCoder } from "./coders/array.js"; -import { BooleanCoder } from "./coders/boolean.js"; -import { BytesCoder } from "./coders/bytes.js"; -import { FixedBytesCoder } from "./coders/fixed-bytes.js"; -import { NullCoder } from "./coders/null.js"; -import { NumberCoder } from "./coders/number.js"; -import { StringCoder } from "./coders/string.js"; -import { TupleCoder } from "./coders/tuple.js"; -import { ParamType } from "./fragments.js"; -import { getAddress } from "../address/index.js"; -import { getBytes, hexlify, makeError } from "../utils/index.js"; -// https://docs.soliditylang.org/en/v0.8.17/control-structures.html -const PanicReasons = new Map(); -PanicReasons.set(0x00, "GENERIC_PANIC"); -PanicReasons.set(0x01, "ASSERT_FALSE"); -PanicReasons.set(0x11, "OVERFLOW"); -PanicReasons.set(0x12, "DIVIDE_BY_ZERO"); -PanicReasons.set(0x21, "ENUM_RANGE_ERROR"); -PanicReasons.set(0x22, "BAD_STORAGE_DATA"); -PanicReasons.set(0x31, "STACK_UNDERFLOW"); -PanicReasons.set(0x32, "ARRAY_RANGE_ERROR"); -PanicReasons.set(0x41, "OUT_OF_MEMORY"); -PanicReasons.set(0x51, "UNINITIALIZED_FUNCTION_CALL"); -const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/); -const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/); -let defaultCoder = null; -function getBuiltinCallException(action, tx, data, abiCoder) { - let message = "missing revert data"; - let reason = null; - const invocation = null; - let revert = null; - if (data) { - message = "execution reverted"; - const bytes = getBytes(data); - data = hexlify(data); - if (bytes.length === 0) { - message += " (no data present; likely require(false) occurred"; - reason = "require(false)"; - } - else if (bytes.length % 32 !== 4) { - message += " (could not decode reason; invalid data length)"; - } - else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") { - // Error(string) - try { - reason = abiCoder.decode(["string"], bytes.slice(4))[0]; - revert = { - signature: "Error(string)", - name: "Error", - args: [reason], - }; - message += `: ${JSON.stringify(reason)}`; - } - catch (error) { - message += " (could not decode reason; invalid string data)"; - } - } - else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") { - // Panic(uint256) - try { - const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]); - revert = { - signature: "Panic(uint256)", - name: "Panic", - args: [code], - }; - reason = `Panic due to ${PanicReasons.get(code) || "UNKNOWN"}(${code})`; - message += `: ${reason}`; - } - catch (error) { - message += " (could not decode panic code)"; - } - } - else { - message += " (unknown custom error)"; - } - } - const transaction = { - to: tx.to ? getAddress(tx.to) : null, - data: tx.data || "0x", - }; - if (tx.from) { - transaction.from = getAddress(tx.from); - } - return makeError(message, "CALL_EXCEPTION", { - action, - data, - reason, - transaction, - invocation, - revert, - }); -} -/** - * About AbiCoder - */ -export class AbiCoder { - #getCoder(param) { - if (param.isArray()) { - return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name); - } - if (param.isTuple()) { - return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name); - } - switch (param.baseType) { - case "address": - return new AddressCoder(param.name); - case "bool": - return new BooleanCoder(param.name); - case "string": - return new StringCoder(param.name); - case "bytes": - return new BytesCoder(param.name); - case "": - return new NullCoder(param.name); - } - // u?int[0-9]* - let match = param.type.match(paramTypeNumber); - if (match) { - let size = parseInt(match[2] || "256"); - assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param); - return new NumberCoder(size / 8, match[1] === "int", param.name); - } - // bytes[0-9]+ - match = param.type.match(paramTypeBytes); - if (match) { - let size = parseInt(match[1]); - assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param); - return new FixedBytesCoder(size, param.name); - } - assertArgument(false, "invalid type", "type", param.type); - } - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.defaultValue(); - } - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types, values) { - assertArgumentCount(values.length, types.length, "types/values length mismatch"); - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - const writer = new Writer(); - coder.encode(writer, values); - return writer.data; - } - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types, data, loose) { - const coders = types.map((type) => this.#getCoder(ParamType.from(type))); - const coder = new TupleCoder(coders, "_"); - return coder.decode(new Reader(data, loose)); - } - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder() { - if (defaultCoder == null) { - defaultCoder = new AbiCoder(); - } - return defaultCoder; - } - /** - * Returns an corebc-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action, tx, data) { - return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder()); - } -} -//# sourceMappingURL=abi-coder.js.map \ No newline at end of file diff --git a/lib.esm/abi/abi-coder.js.map b/lib.esm/abi/abi-coder.js.map deleted file mode 100644 index 2fb988ea7..000000000 --- a/lib.esm/abi/abi-coder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abi-coder.js","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAS,MAAM,EAAU,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AASjE,mEAAmE;AACnE,MAAM,YAAY,GAAwB,IAAI,GAAG,EAAE,CAAC;AACpD,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AACxC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;AACvC,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACnC,YAAY,CAAC,GAAG,CAAC,IAAI,E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AIG;IACH,MAAM,CAAC,eAAe;QACrB,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;YAC1B,YAAY,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC/B,CAAC;QACD,OAAO,YAAY,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC7B,MAA2B,EAC3B,EAA+D,EAC/D,IAAsB;QAEtB,OAAO,uBAAuB,CAC7B,MAAM,EACN,EAAE,EACF,IAAI,EACJ,QAAQ,CAAC,eAAe,EAAE,CAC1B,CAAC;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/bytes32.d.ts b/lib.esm/abi/bytes32.d.ts deleted file mode 100644 index 73455cb5d..000000000 --- a/lib.esm/abi/bytes32.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -import type { BytesLike } from "../utils/index.js"; -/** - * Encodes %%text%% as a Bytes32 string. - */ -export declare function encodeBytes32String(text: string): string; -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -export declare function decodeBytes32String(_bytes: BytesLike): string; -//# sourceMappingURL=bytes32.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/bytes32.d.ts.map b/lib.esm/abi/bytes32.d.ts.map deleted file mode 100644 index 09513605d..000000000 --- a/lib.esm/abi/bytes32.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes32.d.ts","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWxD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAmB7D"} \ No newline at end of file diff --git a/lib.esm/abi/bytes32.js b/lib.esm/abi/bytes32.js deleted file mode 100644 index 95f635d3f..000000000 --- a/lib.esm/abi/bytes32.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -import { getBytes, toUtf8Bytes, toUtf8String, zeroPadBytes, } from "../utils/index.js"; -/** - * Encodes %%text%% as a Bytes32 string. - */ -export function encodeBytes32String(text) { - // Get the bytes - const bytes = toUtf8Bytes(text); - // Check we have room for null-termination - if (bytes.length > 31) { - throw new Error("bytes32 string must be less than 32 bytes"); - } - // Zero-pad (implicitly null-terminates) - return zeroPadBytes(bytes, 32); -} -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -export function decodeBytes32String(_bytes) { - const data = getBytes(_bytes, "bytes"); - // Must be 32 bytes with a null-termination - if (data.length !== 32) { - throw new Error("invalid bytes32 - not 32 bytes long"); - } - if (data[31] !== 0) { - throw new Error("invalid bytes32 string - no null terminator"); - } - // Find the null termination - let length = 31; - while (data[length - 1] === 0) { - length--; - } - // Determine the string value - return toUtf8String(data.slice(0, length)); -} -//# sourceMappingURL=bytes32.js.map \ No newline at end of file diff --git a/lib.esm/abi/bytes32.js.map b/lib.esm/abi/bytes32.js.map deleted file mode 100644 index 2cfdd0378..000000000 --- a/lib.esm/abi/bytes32.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes32.js","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACN,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,YAAY,GACZ,MAAM,mBAAmB,CAAC;AAI3B;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC/C,gBAAgB;IAChB,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAEhC,0CAA0C;IAC1C,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC9D,CAAC;IAED,wCAAwC;IACxC,OAAO,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAiB;IACpD,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC,2CAA2C;IAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACxD,CAAC;IACD,IAAI,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAChE,CAAC;IAED,4BAA4B;IAC5B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,EAAE,CAAC;IACV,CAAC;IAED,6BAA6B;IAC7B,OAAO,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi/coders/abstract-coder.d.ts b/lib.esm/abi/coders/abstract-coder.d.ts deleted file mode 100644 index 53d1481b3..000000000 --- a/lib.esm/abi/coders/abstract-coder.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -import type { BigNumberish, BytesLike } from "../../utils/index.js"; -/** - * @_ignore: - */ -export declare const WordSize: number; -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -export declare class Result extends Array { - #private; - [K: string | number]: any; - /** - * @private - */ - constructor(...args: Array); - /** - * Returns the Result as a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(): Array; - /** - * Returns the Result as an Object with each name-value pair. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(): Record; - /** - * @_ignore - */ - slice(start?: number | undefined, end?: number | undefined): Result; - /** - * @_ignore - */ - filter(callback: (el: any, index: number, array: Result) => boolean, thisArg?: any): Result; - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name: string): any; - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items: Array, keys?: Array): Result; -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -export declare function checkResultErrors(result: Result): Array<{ - path: Array; - error: Error; -}>; -/** - * @_ignore - */ -export declare abstract class Coder { - readonly name: string; - readonly type: string; - readonly localName: string; - readonly dynamic: boolean; - constructor(name: string, type: string, localName: string, dynamic: boolean); - _throwError(message: string, value: any): never; - abstract encode(writer: Writer, value: any): number; - abstract decode(reader: Reader): any; - abstract defaultValue(): any; -} -/** - * @_ignore - */ -export declare class Writer { - #private; - constructor(); - get data(): string; - get length(): number; - appendWriter(writer: Writer): number; - writeBytes(value: BytesLike): number; - writeValue(value: BigNumberish): number; - writeUpdatableValue(): (value: BigNumberish) => void; -} -/** - * @_ignore - */ -export declare class Reader { - #private; - readonly allowLoose: boolean; - constructor(data: BytesLike, allowLoose?: boolean); - get data(): string; - get dataLength(): number; - get consumed(): number; - get bytes(): Uint8Array; - subReader(offset: number): Reader; - readBytes(length: number, loose?: boolean): Uint8Array; - readValue(): bigint; - readIndex(): number; -} -//# sourceMappingURL=abstract-coder.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/abstract-coder.d.ts.map b/lib.esm/abi/coders/abstract-coder.d.ts.map deleted file mode 100644 index df211a063..000000000 --- a/lib.esm/abi/coders/abstract-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AAiBnC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAGrC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE1B;;OAEG;IACH,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAgG9B;IAED;;;;;OAKG;IACH,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CASpB;IAED;;;;;OAKG;IACH,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAqB9B;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAgClE;IAED;;OAEG;IACH,MAAM,CACL,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EAC5D,OAAO,CAAC,EAAE,GAAG,GACX,MAAM,CAgBR;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAa1B;IAED;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,GAAG,MAAM,CAEvE;CACD;AAED;;;;;;;;;;;;GAYG;AAC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SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAMhD;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,UAAU,IAAI,MAAM,CAEvB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,KAAK,IAAI,UAAU,CAEtB;IAuBD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhC;IAGD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,CAKrD;IAGD,SAAS,IAAI,MAAM,CAElB;IAED,SAAS,IAAI,MAAM,CAElB;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/abstract-coder.js b/lib.esm/abi/coders/abstract-coder.js deleted file mode 100644 index ac1945dac..000000000 --- a/lib.esm/abi/coders/abstract-coder.js +++ /dev/null @@ -1,408 +0,0 @@ -import { defineProperties, concat, getBytesCopy, getNumber, hexlify, toBeArray, toBigInt, toNumber, assert, assertArgument, } from "../../utils/index.js"; -/** - * @_ignore: - */ -export const WordSize = 32; -const Padding = new Uint8Array(WordSize); -// Properties used to immediate pass through to the underlying object -// - `then` is used to detect if an object is a Promise for await -const passProperties = ["then"]; -const _guard = {}; -function throwError(name, error) { - const wrapped = new Error(`deferred error during ABI decoding triggered accessing ${name}`); - wrapped.error = error; - throw wrapped; -} -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -export class Result extends Array { - #names; - /** - * @private - */ - constructor(...args) { - // To properly sub-class Array so the other built-in - // functions work, the constructor has to behave fairly - // well. So, in the event we are created via fromItems() - // we build the read-only Result object we want, but on - // any other input, we use the default constructor - // constructor(guard: any, items: Array, keys?: Array); - const guard = args[0]; - let items = args[1]; - let names = (args[2] || []).slice(); - let wrap = true; - if (guard !== _guard) { - items = args; - names = []; - wrap = false; - } - // Can't just pass in ...items since an array of length 1 - // is a special case in the super. - super(items.length); - items.forEach((item, index) => { - this[index] = item; - }); - // Find all unique keys - const nameCounts = names.reduce((accum, name) => { - if (typeof name === "string") { - accum.set(name, (accum.get(name) || 0) + 1); - } - return accum; - }, new Map()); - // Remove any key thats not unique - this.#names = Object.freeze(items.map((item, index) => { - const name = names[index]; - if (name != null && nameCounts.get(name) === 1) { - return name; - } - return null; - })); - if (!wrap) { - return; - } - // A wrapped Result is immutable - Object.freeze(this); - // Proxy indices and names so we can trap deferred errors - return new Proxy(this, { - get: (target, prop, receiver) => { - if (typeof prop === "string") { - // Index accessor - if (prop.match(/^[0-9]+$/)) { - const index = getNumber(prop, "%index"); - if (index < 0 || index >= this.length) { - throw new RangeError("out of result range"); - } - const item = target[index]; - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - return item; - } - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.get(target, prop, receiver); - } - const value = target[prop]; - if (value instanceof Function) { - // Make sure functions work with private variables - // See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#no_private_property_forwarding - return function (...args) { - return value.apply(this === receiver ? target : this, args); - }; - } - else if (!(prop in target)) { - // Possible name accessor - return target.getValue.apply(this === receiver ? target : this, [ - prop, - ]); - } - } - return Reflect.get(target, prop, receiver); - }, - }); - } - /** - * Returns the Result as a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray() { - const result = []; - this.forEach((item, index) => { - if (item instanceof Error) { - throwError(`index ${index}`, item); - } - result.push(item); - }); - return result; - } - /** - * Returns the Result as an Object with each name-value pair. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject() { - return this.#names.reduce((accum, name, index) => { - assert(name != null, "value at index ${ index } unnamed", "UNSUPPORTED_OPERATION", { - operation: "toObject()", - }); - // Add values for names that don't conflict - if (!(name in accum)) { - accum[name] = this.getValue(name); - } - return accum; - }, {}); - } - /** - * @_ignore - */ - slice(start, end) { - if (start == null) { - start = 0; - } - if (start < 0) { - start += this.length; - if (start < 0) { - start = 0; - } - } - if (end == null) { - end = this.length; - } - if (end < 0) { - end += this.length; - if (end < 0) { - end = 0; - } - } - if (end > this.length) { - end = this.length; - } - const result = [], names = []; - for (let i = start; i < end; i++) { - result.push(this[i]); - names.push(this.#names[i]); - } - return new Result(_guard, result, names); - } - /** - * @_ignore - */ - filter(callback, thisArg) { - const result = [], names = []; - for (let i = 0; i < this.length; i++) { - const item = this[i]; - if (item instanceof Error) { - throwError(`index ${i}`, item); - } - if (callback.call(thisArg, item, i, this)) { - result.push(item); - names.push(this.#names[i]); - } - } - return new Result(_guard, result, names); - } - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name) { - const index = this.#names.indexOf(name); - if (index === -1) { - return undefined; - } - const value = this[index]; - if (value instanceof Error) { - throwError(`property ${JSON.stringify(name)}`, value.error); - } - return value; - } - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items, keys) { - return new Result(_guard, items, keys); - } -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -export function checkResultErrors(result) { - // Find the first error (if any) - const errors = []; - const checkErrors = function (path, object) { - if (!Array.isArray(object)) { - return; - } - for (let key in object) { - const childPath = path.slice(); - childPath.push(key); - try { - checkErrors(childPath, object[key]); - } - catch (error) { - errors.push({ path: childPath, error: error }); - } - } - }; - checkErrors([], result); - return errors; -} -function getValue(value) { - let bytes = toBeArray(value); - assert(bytes.length <= WordSize, "value out-of-bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: WordSize, - offset: bytes.length, - }); - if (bytes.length !== WordSize) { - bytes = getBytesCopy(concat([Padding.slice(bytes.length % WordSize), bytes])); - } - return bytes; -} -/** - * @_ignore - */ -export class Coder { - // The coder name: - // - address, uint256, tuple, array, etc. - name; - // The fully expanded type, including composite types: - // - address, uint256, tuple(address,bytes), uint256[3][4][], etc. - type; - // The localName bound in the signature, in this example it is "baz": - // - tuple(address foo, uint bar) baz - localName; - // Whether this type is dynamic: - // - Dynamic: bytes, string, address[], tuple(boolean[]), etc. - // - Not Dynamic: address, uint256, boolean[3], tuple(address, uint8) - dynamic; - constructor(name, type, localName, dynamic) { - defineProperties(this, { name, type, localName, dynamic }, { - name: "string", - type: "string", - localName: "string", - dynamic: "boolean", - }); - } - _throwError(message, value) { - assertArgument(false, message, this.localName, value); - } -} -/** - * @_ignore - */ -export class Writer { - // An array of WordSize lengthed objects to concatenation - #data; - #dataLength; - constructor() { - this.#data = []; - this.#dataLength = 0; - } - get data() { - return concat(this.#data); - } - get length() { - return this.#dataLength; - } - #writeData(data) { - this.#data.push(data); - this.#dataLength += data.length; - return data.length; - } - appendWriter(writer) { - return this.#writeData(getBytesCopy(writer.data)); - } - // Arrayish item; pad on the right to *nearest* WordSize - writeBytes(value) { - let bytes = getBytesCopy(value); - const paddingOffset = bytes.length % WordSize; - if (paddingOffset) { - bytes = getBytesCopy(concat([bytes, Padding.slice(paddingOffset)])); - } - return this.#writeData(bytes); - } - // Numeric item; pad on the left *to* WordSize - writeValue(value) { - return this.#writeData(getValue(value)); - } - // Inserts a numeric place-holder, returning a callback that can - // be used to asjust the value later - writeUpdatableValue() { - const offset = this.#data.length; - this.#data.push(Padding); - this.#dataLength += WordSize; - return (value) => { - this.#data[offset] = getValue(value); - }; - } -} -/** - * @_ignore - */ -export class Reader { - // Allows incomplete unpadded data to be read; otherwise an error - // is raised if attempting to overrun the buffer. This is required - // to deal with an old Solidity bug, in which event data for - // external (not public thoguh) was tightly packed. - allowLoose; - #data; - #offset; - constructor(data, allowLoose) { - defineProperties(this, { allowLoose: !!allowLoose }); - this.#data = getBytesCopy(data); - this.#offset = 0; - } - get data() { - return hexlify(this.#data); - } - get dataLength() { - return this.#data.length; - } - get consumed() { - return this.#offset; - } - get bytes() { - return new Uint8Array(this.#data); - } - #peekBytes(offset, length, loose) { - let alignedLength = Math.ceil(length / WordSize) * WordSize; - if (this.#offset + alignedLength > this.#data.length) { - if (this.allowLoose && - loose && - this.#offset + length <= this.#data.length) { - alignedLength = length; - } - else { - assert(false, "data out-of-bounds", "BUFFER_OVERRUN", { - buffer: getBytesCopy(this.#data), - length: this.#data.length, - offset: this.#offset + alignedLength, - }); - } - } - return this.#data.slice(this.#offset, this.#offset + alignedLength); - } - // Create a sub-reader with the same underlying data, but offset - subReader(offset) { - return new Reader(this.#data.slice(this.#offset + offset), this.allowLoose); - } - // Read bytes - readBytes(length, loose) { - let bytes = this.#peekBytes(0, length, !!loose); - this.#offset += bytes.length; - // @TODO: Make sure the length..end bytes are all 0? - return bytes.slice(0, length); - } - // Read a numeric values - readValue() { - return toBigInt(this.readBytes(WordSize)); - } - readIndex() { - return toNumber(this.readBytes(WordSize)); - } -} -//# sourceMappingURL=abstract-coder.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/abstract-coder.js.map b/lib.esm/abi/coders/abstract-coder.js.map deleted file mode 100644 index c466f7a8a..000000000 --- a/lib.esm/abi/coders/abstract-coder.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-coder.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,SAAS,EACT,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,cAAc,GACd,MAAM,sBAAsB,CAAC;AAI9B;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAW,EAAE,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;AAEzC,qEAAqE;AAC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C,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/address.d.ts b/lib.esm/abi/coders/address.d.ts deleted file mode 100644 index 8befac03a..000000000 --- a/lib.esm/abi/coders/address.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class AddressCoder extends Coder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/address.d.ts.map b/lib.esm/abi/coders/address.d.ts.map deleted file mode 100644 index 030f77d6d..000000000 --- a/lib.esm/abi/coders/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAQrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/address.js b/lib.esm/abi/coders/address.js deleted file mode 100644 index 44c0cfcfc..000000000 --- a/lib.esm/abi/coders/address.js +++ /dev/null @@ -1,29 +0,0 @@ -import { getAddress } from "../../address/index.js"; -import { toBeHex } from "../../utils/maths.js"; -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -/** - * @_ignore - */ -export class AddressCoder extends Coder { - constructor(localName) { - super("address", "address", localName, false); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000"; - } - encode(writer, _value) { - let value = Typed.dereference(_value, "string"); - try { - value = getAddress(value); - } - catch (error) { - return this._throwError(error.message, _value); - } - return writer.writeValue(value); - } - decode(reader) { - return getAddress(toBeHex(reader.readValue(), 22)); - } -} -//# sourceMappingURL=address.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/address.js.map b/lib.esm/abi/coders/address.js.map deleted file mode 100644 index 7ce15954a..000000000 --- a/lib.esm/abi/coders/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAiB;QAC5B,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED,YAAY;QACX,OAAO,4CAA4C,CAAC;IACrD,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QAC5C,IAAI,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChD,IAAI,CAAC;YACJ,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACpD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/anonymous.d.ts b/lib.esm/abi/coders/anonymous.d.ts deleted file mode 100644 index 554bf03f0..000000000 --- a/lib.esm/abi/coders/anonymous.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -export declare class AnonymousCoder extends Coder { - private coder; - constructor(coder: Coder); - defaultValue(): any; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=anonymous.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/anonymous.d.ts.map b/lib.esm/abi/coders/anonymous.d.ts.map deleted file mode 100644 index d0f9d87cb..000000000 --- a/lib.esm/abi/coders/anonymous.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACxC,OAAO,CAAC,KAAK,CAAQ;IAErB,YAAY,KAAK,EAAE,KAAK,EAGvB;IAED,YAAY,IAAI,GAAG,CAElB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAEzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/anonymous.js b/lib.esm/abi/coders/anonymous.js deleted file mode 100644 index b6d953261..000000000 --- a/lib.esm/abi/coders/anonymous.js +++ /dev/null @@ -1,23 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -export class AnonymousCoder extends Coder { - coder; - constructor(coder) { - super(coder.name, coder.type, "_", coder.dynamic); - this.coder = coder; - } - defaultValue() { - return this.coder.defaultValue(); - } - encode(writer, value) { - return this.coder.encode(writer, value); - } - decode(reader) { - return this.coder.decode(reader); - } -} -//# sourceMappingURL=anonymous.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/anonymous.js.map b/lib.esm/abi/coders/anonymous.js.map deleted file mode 100644 index d4b1c86e4..000000000 --- a/lib.esm/abi/coders/anonymous.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anonymous.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAChC,KAAK,CAAQ;IAErB,YAAY,KAAY;QACvB,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED,YAAY;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/array.d.ts b/lib.esm/abi/coders/array.d.ts deleted file mode 100644 index 954c4e17e..000000000 --- a/lib.esm/abi/coders/array.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder, Result, Writer } from "./abstract-coder.js"; -import type { Reader } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare function pack(writer: Writer, coders: ReadonlyArray, values: Array | { - [name: string]: any; -}): number; -/** - * @_ignore - */ -export declare function unpack(reader: Reader, coders: ReadonlyArray): Result; -/** - * @_ignore - */ -export declare class ArrayCoder extends Coder { - readonly coder: Coder; - readonly length: number; - constructor(coder: Coder, length: number, localName: string); - defaultValue(): Array; - encode(writer: Writer, _value: Array | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=array.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/array.d.ts.map b/lib.esm/abi/coders/array.d.ts.map deleted file mode 100644 index 8cdb33a3b..000000000 --- a/lib.esm/abi/coders/array.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAC5B,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC1C,MAAM,CAuER;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAmD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB,YAAY,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAK1D;IAED,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC,CASzB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM,CA0BzD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CA2B1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/array.js b/lib.esm/abi/coders/array.js deleted file mode 100644 index dad291ae6..000000000 --- a/lib.esm/abi/coders/array.js +++ /dev/null @@ -1,165 +0,0 @@ -import { defineProperties, isError, assert, assertArgument, assertArgumentCount, } from "../../utils/index.js"; -import { Typed } from "../typed.js"; -import { Coder, Result, WordSize, Writer } from "./abstract-coder.js"; -import { AnonymousCoder } from "./anonymous.js"; -/** - * @_ignore - */ -export function pack(writer, coders, values) { - let arrayValues = []; - if (Array.isArray(values)) { - arrayValues = values; - } - else if (values && typeof values === "object") { - let unique = {}; - arrayValues = coders.map((coder) => { - const name = coder.localName; - assert(name, "cannot encode object for signature with missing names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - assert(!unique[name], "cannot encode object for signature with duplicate names", "INVALID_ARGUMENT", { argument: "values", info: { coder }, value: values }); - unique[name] = true; - return values[name]; - }); - } - else { - assertArgument(false, "invalid tuple value", "tuple", values); - } - assertArgument(coders.length === arrayValues.length, "types/value length mismatch", "tuple", values); - let staticWriter = new Writer(); - let dynamicWriter = new Writer(); - let updateFuncs = []; - coders.forEach((coder, index) => { - let value = arrayValues[index]; - if (coder.dynamic) { - // Get current dynamic offset (for the future pointer) - let dynamicOffset = dynamicWriter.length; - // Encode the dynamic value into the dynamicWriter - coder.encode(dynamicWriter, value); - // Prepare to populate the correct offset once we are done - let updateFunc = staticWriter.writeUpdatableValue(); - updateFuncs.push((baseOffset) => { - updateFunc(baseOffset + dynamicOffset); - }); - } - else { - coder.encode(staticWriter, value); - } - }); - // Backfill all the dynamic offsets, now that we know the static length - updateFuncs.forEach((func) => { - func(staticWriter.length); - }); - let length = writer.appendWriter(staticWriter); - length += writer.appendWriter(dynamicWriter); - return length; -} -/** - * @_ignore - */ -export function unpack(reader, coders) { - let values = []; - let keys = []; - // A reader anchored to this base - let baseReader = reader.subReader(0); - coders.forEach((coder) => { - let value = null; - if (coder.dynamic) { - let offset = reader.readIndex(); - let offsetReader = baseReader.subReader(offset); - try { - value = coder.decode(offsetReader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - else { - try { - value = coder.decode(reader); - } - catch (error) { - // Cannot recover from this - if (isError(error, "BUFFER_OVERRUN")) { - throw error; - } - value = error; - value.baseType = coder.name; - value.name = coder.localName; - value.type = coder.type; - } - } - if (value == undefined) { - throw new Error("investigate"); - } - values.push(value); - keys.push(coder.localName || null); - }); - return Result.fromItems(values, keys); -} -/** - * @_ignore - */ -export class ArrayCoder extends Coder { - coder; - length; - constructor(coder, length, localName) { - const type = coder.type + "[" + (length >= 0 ? length : "") + "]"; - const dynamic = length === -1 || coder.dynamic; - super("array", type, localName, dynamic); - defineProperties(this, { coder, length }); - } - defaultValue() { - // Verifies the child coder is valid (even if the array is dynamic or 0-length) - const defaultChild = this.coder.defaultValue(); - const result = []; - for (let i = 0; i < this.length; i++) { - result.push(defaultChild); - } - return result; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "array"); - if (!Array.isArray(value)) { - this._throwError("expected array value", value); - } - let count = this.length; - if (count === -1) { - count = value.length; - writer.writeValue(value.length); - } - assertArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : "")); - let coders = []; - for (let i = 0; i < value.length; i++) { - coders.push(this.coder); - } - return pack(writer, coders, value); - } - decode(reader) { - let count = this.length; - if (count === -1) { - count = reader.readIndex(); - // Check that there is *roughly* enough data to ensure - // stray random data is not being read as a length. Each - // slot requires at least 32 bytes for their value (or 32 - // bytes as a link to the data). This could use a much - // tighter bound, but we are erroring on the side of safety. - assert(count * WordSize <= reader.dataLength, "insufficient data length", "BUFFER_OVERRUN", { - buffer: reader.bytes, - offset: count * WordSize, - length: reader.dataLength, - }); - } - let coders = []; - for (let i = 0; i < count; i++) { - coders.push(new AnonymousCoder(this.coder)); - } - return unpack(reader, coders); - } -} -//# sourceMappingURL=array.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/array.js.map b/lib.esm/abi/coders/array.js.map deleted file mode 100644 index ed25ac117..000000000 --- a/lib.esm/abi/coders/array.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIhD;;GAEG;AACH,MAAM,UAAU,IAAI,CACnB,MAAc,EACd,MAA4B,EAC5B,MAA4C;IAE5C,IAAI,WAAW,GAAe,EAAE,CAAC;IAEjC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,WAAW,GAAG,MAAM,CAAC;IACtB,CAAC;SAAM,IAAI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,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/boolean.d.ts b/lib.esm/abi/coders/boolean.d.ts deleted file mode 100644 index f073e37ee..000000000 --- a/lib.esm/abi/coders/boolean.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class BooleanCoder extends Coder { - constructor(localName: string); - defaultValue(): boolean; - encode(writer: Writer, _value: boolean | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=boolean.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/boolean.d.ts.map b/lib.esm/abi/coders/boolean.d.ts.map deleted file mode 100644 index f0c2679a1..000000000 --- a/lib.esm/abi/coders/boolean.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,OAAO,CAEtB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAGtD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/boolean.js b/lib.esm/abi/coders/boolean.js deleted file mode 100644 index 3992319f7..000000000 --- a/lib.esm/abi/coders/boolean.js +++ /dev/null @@ -1,21 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -/** - * @_ignore - */ -export class BooleanCoder extends Coder { - constructor(localName) { - super("bool", "bool", localName, false); - } - defaultValue() { - return false; - } - encode(writer, _value) { - const value = Typed.dereference(_value, "bool"); - return writer.writeValue(value ? 1 : 0); - } - decode(reader) { - return !!reader.readValue(); - } -} -//# sourceMappingURL=boolean.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/boolean.js.map b/lib.esm/abi/coders/boolean.js.map deleted file mode 100644 index 3ad4fa201..000000000 --- a/lib.esm/abi/coders/boolean.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolean.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAiB;QAC5B,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,YAAY;QACX,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAuB;QAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IAC7B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/bytes.d.ts b/lib.esm/abi/coders/bytes.d.ts deleted file mode 100644 index 1e554582f..000000000 --- a/lib.esm/abi/coders/bytes.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class DynamicBytesCoder extends Coder { - constructor(type: string, localName: string); - defaultValue(): string; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -/** - * @_ignore - */ -export declare class BytesCoder extends DynamicBytesCoder { - constructor(localName: string); - decode(reader: Reader): any; -} -//# sourceMappingURL=bytes.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/bytes.d.ts.map b/lib.esm/abi/coders/bytes.d.ts.map deleted file mode 100644 index 956098f28..000000000 --- a/lib.esm/abi/coders/bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAE1C;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;IAChD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/bytes.js b/lib.esm/abi/coders/bytes.js deleted file mode 100644 index 01aad879d..000000000 --- a/lib.esm/abi/coders/bytes.js +++ /dev/null @@ -1,34 +0,0 @@ -import { getBytesCopy, hexlify } from "../../utils/index.js"; -import { Coder } from "./abstract-coder.js"; -/** - * @_ignore - */ -export class DynamicBytesCoder extends Coder { - constructor(type, localName) { - super(type, type, localName, true); - } - defaultValue() { - return "0x"; - } - encode(writer, value) { - value = getBytesCopy(value); - let length = writer.writeValue(value.length); - length += writer.writeBytes(value); - return length; - } - decode(reader) { - return reader.readBytes(reader.readIndex(), true); - } -} -/** - * @_ignore - */ -export class BytesCoder extends DynamicBytesCoder { - constructor(localName) { - super("bytes", localName); - } - decode(reader) { - return hexlify(super.decode(reader)); - } -} -//# sourceMappingURL=bytes.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/bytes.js.map b/lib.esm/abi/coders/bytes.js.map deleted file mode 100644 index 9c2be3ef4..000000000 --- a/lib.esm/abi/coders/bytes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC3C,YAAY,IAAY,EAAE,SAAiB;QAC1C,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IAED,YAAY;QACX,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAChC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;CACD;AAED;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,iBAAiB;IAChD,YAAY,SAAiB;QAC5B,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACtC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/fixed-bytes.d.ts b/lib.esm/abi/coders/fixed-bytes.d.ts deleted file mode 100644 index 5c485fef6..000000000 --- a/lib.esm/abi/coders/fixed-bytes.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BytesLike } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class FixedBytesCoder extends Coder { - readonly size: number; - constructor(size: number, localName: string); - defaultValue(): string; - encode(writer: Writer, _value: BytesLike | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=fixed-bytes.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/fixed-bytes.d.ts.map b/lib.esm/abi/coders/fixed-bytes.d.ts.map deleted file mode 100644 index 9d870c078..000000000 --- a/lib.esm/abi/coders/fixed-bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAI1C;IAED,YAAY,IAAI,MAAM,CAKrB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/fixed-bytes.js b/lib.esm/abi/coders/fixed-bytes.js deleted file mode 100644 index 5e782c6e6..000000000 --- a/lib.esm/abi/coders/fixed-bytes.js +++ /dev/null @@ -1,28 +0,0 @@ -import { defineProperties, getBytesCopy, hexlify } from "../../utils/index.js"; -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -/** - * @_ignore - */ -export class FixedBytesCoder extends Coder { - size; - constructor(size, localName) { - let name = "bytes" + String(size); - super(name, name, localName, false); - defineProperties(this, { size }, { size: "number" }); - } - defaultValue() { - return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2); - } - encode(writer, _value) { - let data = getBytesCopy(Typed.dereference(_value, this.type)); - if (data.length !== this.size) { - this._throwError("incorrect data length", _value); - } - return writer.writeBytes(data); - } - decode(reader) { - return hexlify(reader.readBytes(this.size)); - } -} -//# sourceMappingURL=fixed-bytes.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/fixed-bytes.js.map b/lib.esm/abi/coders/fixed-bytes.js.map deleted file mode 100644 index a3f40c20c..000000000 --- a/lib.esm/abi/coders/fixed-bytes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixed-bytes.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAM5C;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAChC,IAAI,CAAU;IAEvB,YAAY,IAAY,EAAE,SAAiB;QAC1C,IAAI,IAAI,GAAG,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QAClC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACpC,gBAAgB,CAAkB,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,YAAY;QACX,OAAO,oEAAoE,CAAC,SAAS,CACpF,CAAC,EACD,CAAC,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,CACjB,CAAC;IACH,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAyB;QAC/C,IAAI,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/null.d.ts b/lib.esm/abi/coders/null.d.ts deleted file mode 100644 index 5df5da342..000000000 --- a/lib.esm/abi/coders/null.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NullCoder extends Coder { - constructor(localName: string); - defaultValue(): null; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=null.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/null.d.ts.map b/lib.esm/abi/coders/null.d.ts.map deleted file mode 100644 index e2ef8ebc5..000000000 --- a/lib.esm/abi/coders/null.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACnC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,IAAI,CAEnB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAG1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/null.js b/lib.esm/abi/coders/null.js deleted file mode 100644 index 5b7d867a4..000000000 --- a/lib.esm/abi/coders/null.js +++ /dev/null @@ -1,24 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -const Empty = new Uint8Array([]); -/** - * @_ignore - */ -export class NullCoder extends Coder { - constructor(localName) { - super("null", "", localName, false); - } - defaultValue() { - return null; - } - encode(writer, value) { - if (value != null) { - this._throwError("not null", value); - } - return writer.writeBytes(Empty); - } - decode(reader) { - reader.readBytes(0); - return null; - } -} -//# sourceMappingURL=null.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/null.js.map b/lib.esm/abi/coders/null.js.map deleted file mode 100644 index b35177549..000000000 --- a/lib.esm/abi/coders/null.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"null.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG5C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAEjC;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IACnC,YAAY,SAAiB;QAC5B,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,YAAY;QACX,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,KAAU;QAChC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/number.d.ts b/lib.esm/abi/coders/number.d.ts deleted file mode 100644 index 822cc6df2..000000000 --- a/lib.esm/abi/coders/number.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BigNumberish } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NumberCoder extends Coder { - readonly size: number; - readonly signed: boolean; - constructor(size: number, signed: boolean, localName: string); - defaultValue(): number; - encode(writer: Writer, _value: BigNumberish | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=number.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/number.d.ts.map b/lib.esm/abi/coders/number.d.ts.map deleted file mode 100644 index 5af9a7edb..000000000 --- a/lib.esm/abi/coders/number.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAC;IAE1B,YAAY,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAS3D;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM,CAgB3D;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAQ1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/number.js b/lib.esm/abi/coders/number.js deleted file mode 100644 index aead59be7..000000000 --- a/lib.esm/abi/coders/number.js +++ /dev/null @@ -1,45 +0,0 @@ -import { defineProperties, fromTwos, getBigInt, mask, toTwos, } from "../../utils/index.js"; -import { Typed } from "../typed.js"; -import { Coder, WordSize } from "./abstract-coder.js"; -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * @_ignore - */ -export class NumberCoder extends Coder { - size; - signed; - constructor(size, signed, localName) { - const name = (signed ? "int" : "uint") + size * 8; - super(name, name, localName, false); - defineProperties(this, { size, signed }, { size: "number", signed: "boolean" }); - } - defaultValue() { - return 0; - } - encode(writer, _value) { - let value = getBigInt(Typed.dereference(_value, this.type)); - // Check bounds are safe for encoding - let maxUintValue = mask(BN_MAX_UINT256, WordSize * 8); - if (this.signed) { - let bounds = mask(maxUintValue, this.size * 8 - 1); - if (value > bounds || value < -(bounds + BN_1)) { - this._throwError("value out-of-bounds", _value); - } - value = toTwos(value, 8 * WordSize); - } - else if (value < BN_0 || value > mask(maxUintValue, this.size * 8)) { - this._throwError("value out-of-bounds", _value); - } - return writer.writeValue(value); - } - decode(reader) { - let value = mask(reader.readValue(), this.size * 8); - if (this.signed) { - value = fromTwos(value, this.size * 8); - } - return value; - } -} -//# sourceMappingURL=number.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/number.js.map b/lib.esm/abi/coders/number.js.map deleted file mode 100644 index 7a1d8539f..000000000 --- a/lib.esm/abi/coders/number.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,MAAM,GACN,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAMtD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,cAAc,GAAG,MAAM,CAC5B,oEAAoE,CACpE,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC5B,IAAI,CAAU;IACd,MAAM,CAAW;IAE1B,YAAY,IAAY,EAAE,MAAe,EAAE,SAAiB;QAC3D,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,C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C;IAED,MAAM,CAAC,MAAc;QACpB,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAEpD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QACxC,CAAC;QAED,OAAO,KAAK,CAAC;IACd,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/string.d.ts b/lib.esm/abi/coders/string.d.ts deleted file mode 100644 index 8e1c63593..000000000 --- a/lib.esm/abi/coders/string.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { DynamicBytesCoder } from "./bytes.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class StringCoder extends DynamicBytesCoder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=string.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/string.d.ts.map b/lib.esm/abi/coders/string.d.ts.map deleted file mode 100644 index d0158dd8b..000000000 --- a/lib.esm/abi/coders/string.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IACjD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAKrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/string.js b/lib.esm/abi/coders/string.js deleted file mode 100644 index cd8c4bd5e..000000000 --- a/lib.esm/abi/coders/string.js +++ /dev/null @@ -1,21 +0,0 @@ -import { toUtf8Bytes, toUtf8String } from "../../utils/utf8.js"; -import { Typed } from "../typed.js"; -import { DynamicBytesCoder } from "./bytes.js"; -/** - * @_ignore - */ -export class StringCoder extends DynamicBytesCoder { - constructor(localName) { - super("string", localName); - } - defaultValue() { - return ""; - } - encode(writer, _value) { - return super.encode(writer, toUtf8Bytes(Typed.dereference(_value, "string"))); - } - decode(reader) { - return toUtf8String(super.decode(reader)); - } -} -//# sourceMappingURL=string.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/string.js.map b/lib.esm/abi/coders/string.js.map deleted file mode 100644 index 6552cd138..000000000 --- a/lib.esm/abi/coders/string.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.js","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IACjD,YAAY,SAAiB;QAC5B,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED,YAAY;QACX,OAAO,EAAE,CAAC;IACX,CAAC;IAED,MAAM,CAAC,MAAc,EAAE,MAAsB;QAC5C,OAAO,KAAK,CAAC,MAAM,CAClB,MAAM,EACN,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAChD,CAAC;IACH,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,OAAO,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/tuple.d.ts b/lib.esm/abi/coders/tuple.d.ts deleted file mode 100644 index fe3ec0328..000000000 --- a/lib.esm/abi/coders/tuple.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class TupleCoder extends Coder { - readonly coders: ReadonlyArray; - constructor(coders: Array, localName: string); - defaultValue(): any; - encode(writer: Writer, _value: Array | { - [name: string]: any; - } | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=tuple.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/coders/tuple.d.ts.map b/lib.esm/abi/coders/tuple.d.ts.map deleted file mode 100644 index bc66dc09e..000000000 --- a/lib.esm/abi/coders/tuple.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAEvC,YAAY,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,EAelD;IAED,YAAY,IAAI,GAAG,CAwClB;IAED,MAAM,CACL,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,KAAK,GAClD,MAAM,CAGR;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/coders/tuple.js b/lib.esm/abi/coders/tuple.js deleted file mode 100644 index d399f31e3..000000000 --- a/lib.esm/abi/coders/tuple.js +++ /dev/null @@ -1,65 +0,0 @@ -import { defineProperties } from "../../utils/properties.js"; -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import { pack, unpack } from "./array.js"; -/** - * @_ignore - */ -export class TupleCoder extends Coder { - coders; - constructor(coders, localName) { - let dynamic = false; - const types = []; - coders.forEach((coder) => { - if (coder.dynamic) { - dynamic = true; - } - types.push(coder.type); - }); - const type = "tuple(" + types.join(",") + ")"; - super("tuple", type, localName, dynamic); - defineProperties(this, { - coders: Object.freeze(coders.slice()), - }); - } - defaultValue() { - const values = []; - this.coders.forEach((coder) => { - values.push(coder.defaultValue()); - }); - // We only output named properties for uniquely named coders - const uniqueNames = this.coders.reduce((accum, coder) => { - const name = coder.localName; - if (name) { - if (!accum[name]) { - accum[name] = 0; - } - accum[name]++; - } - return accum; - }, {}); - // Add named values - this.coders.forEach((coder, index) => { - let name = coder.localName; - if (!name || uniqueNames[name] !== 1) { - return; - } - if (name === "length") { - name = "_length"; - } - if (values[name] != null) { - return; - } - values[name] = values[index]; - }); - return Object.freeze(values); - } - encode(writer, _value) { - const value = Typed.dereference(_value, "tuple"); - return pack(writer, this.coders, value); - } - decode(reader) { - return unpack(reader, this.coders); - } -} -//# sourceMappingURL=tuple.js.map \ No newline at end of file diff --git a/lib.esm/abi/coders/tuple.js.map b/lib.esm/abi/coders/tuple.js.map deleted file mode 100644 index 7a99b4816..000000000 --- a/lib.esm/abi/coders/tuple.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tuple.js","sourceRoot":"","sources":["../../../src.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file diff --git a/lib.esm/abi/fragments.d.ts b/lib.esm/abi/fragments.d.ts deleted file mode 100644 index 6d88c3596..000000000 --- a/lib.esm/abi/fragments.d.ts +++ /dev/null @@ -1,372 +0,0 @@ -/** - * About frgaments... - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -/** - * A type description in a JSON API. - */ -export interface JsonFragmentType { - /** - * The parameter name. - */ - readonly name?: string; - /** - * If the parameter is indexed. - */ - readonly indexed?: boolean; - /** - * The type of the parameter. - */ - readonly type?: string; - /** - * The internal Solidity type. - */ - readonly internalType?: string; - /** - * The components for a tuple. - */ - readonly components?: ReadonlyArray; -} -/** - * A fragment for a method, event or error in a JSON API. - */ -export interface JsonFragment { - /** - * The name of the error, event, function, etc. - */ - readonly name?: string; - /** - * The type of the fragment (e.g. ``event``, ``"function"``, etc.) - */ - readonly type?: string; - /** - * If the event is anonymous. - */ - readonly anonymous?: boolean; - /** - * If the function is payable. - */ - readonly payable?: boolean; - /** - * If the function is constant. - */ - readonly constant?: boolean; - /** - * The mutability state of the function. - */ - readonly stateMutability?: string; - /** - * The input parameters. - */ - readonly inputs?: ReadonlyArray; - /** - * The output parameters. - */ - readonly outputs?: ReadonlyArray; - /** - * The energy limit to use when sending a transaction for this function. - */ - readonly energy?: string; -} -/** - * The format to serialize the output as. - */ -export type FormatType = "sighash" | "minimal" | "full" | "json"; -/** - * When [walking](ParamType-walk) a [[ParamType]], this is called - * on each component. - */ -export type ParamTypeWalkFunc = (type: string, value: any) => any; -/** - * When [walking asynchronously](ParamType-walkAsync) a [[ParamType]], - * this is called on each component. - */ -export type ParamTypeWalkAsyncFunc = (type: string, value: any) => any | Promise; -/** - * Each input and output of a [[Fragment]] is an Array of **PAramType**. - */ -export declare class ParamType { - #private; - /** - * The local name of the parameter (or ``""`` if unbound) - */ - readonly name: string; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - readonly type: string; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - readonly baseType: string; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - readonly indexed: null | boolean; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - readonly components: null | ReadonlyArray; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - readonly arrayLength: null | number; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - readonly arrayChildren: null | ParamType; - /** - * @private - */ - constructor(guard: any, name: string, type: string, baseType: string, indexed: null | boolean, components: null | ReadonlyArray, arrayLength: null | number, arrayChildren: null | ParamType); - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format?: FormatType): string; - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray(): this is ParamType & { - arrayChildren: ParamType; - arrayLength: number; - }; - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple(): this is ParamType & { - components: ReadonlyArray; - }; - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable(): this is ParamType & { - indexed: boolean; - }; - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value: any, process: ParamTypeWalkFunc): any; - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise; - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj: any, allowIndexed?: boolean): ParamType; - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value: any): value is ParamType; -} -/** - * The type of a [[Fragment]]. - */ -export type FragmentType = "constructor" | "error" | "event" | "fallback" | "function" | "struct"; -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -export declare abstract class Fragment { - /** - * The type of the fragment. - */ - readonly type: FragmentType; - /** - * The inputs for the fragment. - */ - readonly inputs: ReadonlyArray; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray); - /** - * Returns a string representation of this fragment. - */ - abstract format(format?: FormatType): string; - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj: any): Fragment; - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value: any): value is ConstructorFragment; - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value: any): value is ErrorFragment; - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value: any): value is EventFragment; - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value: any): value is FunctionFragment; - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value: any): value is StructFragment; -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -export declare abstract class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - readonly name: string; - /** - * @private - */ - constructor(guard: any, type: FragmentType, name: string, inputs: ReadonlyArray); -} -/** - * A Fragment which represents a //Custom Error//. - */ -export declare class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - /** - * The Custom Error selector. - */ - get selector(): string; - format(format?: FormatType): string; - static from(obj: any): ErrorFragment; - static isFragment(value: any): value is ErrorFragment; -} -/** - * A Fragment which represents an Event. - */ -export declare class EventFragment extends NamedFragment { - readonly anonymous: boolean; - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray, anonymous: boolean); - /** - * The Event topic hash. - */ - get topicHash(): string; - format(format?: FormatType): string; - static getTopicHash(name: string, params?: Array): string; - static from(obj: any): EventFragment; - static isFragment(value: any): value is EventFragment; -} -/** - * A Fragment which represents a constructor. - */ -export declare class ConstructorFragment extends Fragment { - readonly payable: boolean; - readonly energy: null | bigint; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray, payable: boolean, energy: null | bigint); - format(format?: FormatType): string; - static from(obj: any): ConstructorFragment; - static isFragment(value: any): value is ConstructorFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - constructor(guard: any, inputs: ReadonlyArray, payable: boolean); - format(format?: FormatType): string; - static from(obj: any): FallbackFragment; - static isFragment(value: any): value is FallbackFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - readonly constant: boolean; - /** - * The returned types for the result of calling this function. - */ - readonly outputs: ReadonlyArray; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - readonly stateMutability: "payable" | "nonpayable" | "view" | "pure"; - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - /** - * The amount of energy to send when calling this function - */ - readonly energy: null | bigint; - /** - * @private - */ - constructor(guard: any, name: string, stateMutability: "payable" | "nonpayable" | "view" | "pure", inputs: ReadonlyArray, outputs: ReadonlyArray, energy: null | bigint); - /** - * The Function selector. - */ - get selector(): string; - format(format?: FormatType): string; - static getSelector(name: string, params?: Array): string; - static from(obj: any): FunctionFragment; - static isFragment(value: any): value is FunctionFragment; -} -/** - * A Fragment which represents a structure. - */ -export declare class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - format(): string; - static from(obj: any): StructFragment; - static isFragment(value: any): value is FunctionFragment; -} -//# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/fragments.d.ts.map b/lib.esm/abi/fragments.d.ts.map deleted file mode 100644 index b1a1124b4..000000000 --- a/lib.esm/abi/fragments.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAElD;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAEnD;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;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,gBAAgB,CA6DtC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAChD;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAGrE;IAED,MAAM,IAAI,MAAM,CAEf;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,CAepC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/fragments.js b/lib.esm/abi/fragments.js deleted file mode 100644 index 943f442a8..000000000 --- a/lib.esm/abi/fragments.js +++ /dev/null @@ -1,1270 +0,0 @@ -/** - * About frgaments... - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -var _a; -import { defineProperties, getBigInt, getNumber, assert, assertPrivate, assertArgument, } from "../utils/index.js"; -import { id } from "../hash/index.js"; -// [ "a", "b" ] => { "a": 1, "b": 1 } -function setify(items) { - const result = new Set(); - items.forEach((k) => result.add(k)); - return Object.freeze(result); -} -// Visibility Keywords -const _kwVisib = "constant external internal payable private public pure view"; -const KwVisib = setify(_kwVisib.split(" ")); -const _kwTypes = "constructor error event fallback function receive struct"; -const KwTypes = setify(_kwTypes.split(" ")); -const _kwModifiers = "calldata memory storage payable indexed"; -const KwModifiers = setify(_kwModifiers.split(" ")); -const _kwOther = "tuple returns"; -// All Keywords -const _keywords = [_kwTypes, _kwModifiers, _kwOther, _kwVisib].join(" "); -const Keywords = setify(_keywords.split(" ")); -// Single character tokens -const SimpleTokens = { - "(": "OPEN_PAREN", - ")": "CLOSE_PAREN", - "[": "OPEN_BRACKET", - "]": "CLOSE_BRACKET", - ",": "COMMA", - "@": "AT", -}; -// Parser regexes to consume the next token -const regexWhitespacePrefix = new RegExp("^(\\s*)"); -const regexNumberPrefix = new RegExp("^([0-9]+)"); -const regexIdPrefix = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"); -// Parser regexs to check validity -const regexId = new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"); -const regexType = new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"); -class TokenString { - #offset; - #tokens; - get offset() { - return this.#offset; - } - get length() { - return this.#tokens.length - this.#offset; - } - constructor(tokens) { - this.#offset = 0; - this.#tokens = tokens.slice(); - } - clone() { - return new _a(this.#tokens); - } - reset() { - this.#offset = 0; - } - #subTokenString(from = 0, to = 0) { - return new _a(this.#tokens.slice(from, to).map((t) => { - return Object.freeze(Object.assign({}, t, { - match: t.match - from, - linkBack: t.linkBack - from, - linkNext: t.linkNext - from, - })); - })); - } - // Pops and returns the value of the next token, if it is a keyword in allowed; throws if out of tokens - popKeyword(allowed) { - const top = this.peek(); - if (top.type !== "KEYWORD" || !allowed.has(top.text)) { - throw new Error(`expected keyword ${top.text}`); - } - return this.pop().text; - } - // Pops and returns the value of the next token if it is `type`; throws if out of tokens - popType(type) { - if (this.peek().type !== type) { - throw new Error(`expected ${type}; got ${JSON.stringify(this.peek())}`); - } - return this.pop().text; - } - // Pops and returns a "(" TOKENS ")" - popParen() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = this.#subTokenString(this.#offset + 1, top.match + 1); - this.#offset = top.match + 1; - return result; - } - // Pops and returns the items within "(" ITEM1 "," ITEM2 "," ... ")" - popParams() { - const top = this.peek(); - if (top.type !== "OPEN_PAREN") { - throw new Error("bad start"); - } - const result = []; - while (this.#offset < top.match - 1) { - const link = this.peek().linkNext; - result.push(this.#subTokenString(this.#offset + 1, link)); - this.#offset = link; - } - this.#offset = top.match + 1; - return result; - } - // Returns the top Token, throwing if out of tokens - peek() { - if (this.#offset >= this.#tokens.length) { - throw new Error("out-of-bounds"); - } - return this.#tokens[this.#offset]; - } - // Returns the next value, if it is a keyword in `allowed` - peekKeyword(allowed) { - const top = this.peekType("KEYWORD"); - return top != null && allowed.has(top) ? top : null; - } - // Returns the value of the next token if it is `type` - peekType(type) { - if (this.length === 0) { - return null; - } - const top = this.peek(); - return top.type === type ? top.text : null; - } - // Returns the next token; throws if out of tokens - pop() { - const result = this.peek(); - this.#offset++; - return result; - } - toString() { - const tokens = []; - for (let i = this.#offset; i < this.#tokens.length; i++) { - const token = this.#tokens[i]; - tokens.push(`${token.type}:${token.text}`); - } - return ``; - } -} -_a = TokenString; -function lex(text) { - const tokens = []; - const throwError = (message) => { - const token = offset < text.length ? JSON.stringify(text[offset]) : "$EOI"; - throw new Error(`invalid token ${token} at ${offset}: ${message}`); - }; - let brackets = []; - let commas = []; - let offset = 0; - while (offset < text.length) { - // Strip off any leading whitespace - let cur = text.substring(offset); - let match = cur.match(regexWhitespacePrefix); - if (match) { - offset += match[1].length; - cur = text.substring(offset); - } - const token = { - depth: brackets.length, - linkBack: -1, - linkNext: -1, - match: -1, - type: "", - text: "", - offset, - value: -1, - }; - tokens.push(token); - let type = SimpleTokens[cur[0]] || ""; - if (type) { - token.type = type; - token.text = cur[0]; - offset++; - if (type === "OPEN_PAREN") { - brackets.push(tokens.length - 1); - commas.push(tokens.length - 1); - } - else if (type == "CLOSE_PAREN") { - if (brackets.length === 0) { - throwError("no matching open bracket"); - } - token.match = brackets.pop(); - tokens[token.match].match = tokens.length - 1; - token.depth--; - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - } - else if (type === "COMMA") { - token.linkBack = commas.pop(); - tokens[token.linkBack].linkNext = tokens.length - 1; - commas.push(tokens.length - 1); - } - else if (type === "OPEN_BRACKET") { - token.type = "BRACKET"; - } - else if (type === "CLOSE_BRACKET") { - // Remove the CLOSE_BRACKET - let suffix = tokens.pop().text; - if (tokens.length > 0 && tokens[tokens.length - 1].type === "NUMBER") { - const value = tokens.pop().text; - suffix = value + suffix; - tokens[tokens.length - 1].value = - getNumber(value); - } - if (tokens.length === 0 || - tokens[tokens.length - 1].type !== "BRACKET") { - throw new Error("missing opening bracket"); - } - tokens[tokens.length - 1].text += suffix; - } - continue; - } - match = cur.match(regexIdPrefix); - if (match) { - token.text = match[1]; - offset += token.text.length; - if (Keywords.has(token.text)) { - token.type = "KEYWORD"; - continue; - } - if (token.text.match(regexType)) { - token.type = "TYPE"; - continue; - } - token.type = "ID"; - continue; - } - match = cur.match(regexNumberPrefix); - if (match) { - token.text = match[1]; - token.type = "NUMBER"; - offset += token.text.length; - continue; - } - throw new Error(`unexpected token ${JSON.stringify(cur[0])} at position ${offset}`); - } - return new TokenString(tokens.map((t) => Object.freeze(t))); -} -// Check only one of `allowed` is in `set` -function allowSingle(set, allowed) { - let included = []; - for (const key in allowed.keys()) { - if (set.has(key)) { - included.push(key); - } - } - if (included.length > 1) { - throw new Error(`conflicting types: ${included.join(", ")}`); - } -} -// Functions to process a Solidity Signature TokenString from left-to-right for... -// ...the name with an optional type, returning the name -function consumeName(type, tokens) { - if (tokens.peekKeyword(KwTypes)) { - const keyword = tokens.pop().text; - if (keyword !== type) { - throw new Error(`expected ${type}, got ${keyword}`); - } - } - return tokens.popType("ID"); -} -// ...all keywords matching allowed, returning the keywords -function consumeKeywords(tokens, allowed) { - const keywords = new Set(); - while (true) { - const keyword = tokens.peekType("KEYWORD"); - if (keyword == null || (allowed && !allowed.has(keyword))) { - break; - } - tokens.pop(); - if (keywords.has(keyword)) { - throw new Error(`duplicate keywords: ${JSON.stringify(keyword)}`); - } - keywords.add(keyword); - } - return Object.freeze(keywords); -} -// ...all visibility keywords, returning the coalesced mutability -function consumeMutability(tokens) { - let modifiers = consumeKeywords(tokens, KwVisib); - // Detect conflicting modifiers - allowSingle(modifiers, setify("constant payable nonpayable".split(" "))); - allowSingle(modifiers, setify("pure view payable nonpayable".split(" "))); - // Process mutability states - if (modifiers.has("view")) { - return "view"; - } - if (modifiers.has("pure")) { - return "pure"; - } - if (modifiers.has("payable")) { - return "payable"; - } - if (modifiers.has("nonpayable")) { - return "nonpayable"; - } - // Process legacy `constant` last - if (modifiers.has("constant")) { - return "view"; - } - return "nonpayable"; -} -// ...a parameter list, returning the ParamType list -function consumeParams(tokens, allowIndexed) { - return tokens.popParams().map((t) => ParamType.from(t, allowIndexed)); -} -// ...a energy limit, returning a BigNumber or null if none -function consumeEnergy(tokens) { - if (tokens.peekType("AT")) { - tokens.pop(); - if (tokens.peekType("NUMBER")) { - return getBigInt(tokens.pop().text); - } - throw new Error("invalid energy"); - } - return null; -} -function consumeEoi(tokens) { - if (tokens.length) { - throw new Error(`unexpected tokens: ${tokens.toString()}`); - } -} -const regexArrayType = new RegExp(/^(.*)\[([0-9]*)\]$/); -function verifyBasicType(type) { - const match = type.match(regexType); - assertArgument(match, "invalid type", "type", type); - if (type === "uint") { - return "uint256"; - } - if (type === "int") { - return "int256"; - } - if (match[2]) { - // bytesXX - const length = parseInt(match[2]); - assertArgument(length !== 0 && length <= 32, "invalid bytes length", "type", type); - } - else if (match[3]) { - // intXX or uintXX - const size = parseInt(match[3]); - assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid numeric width", "type", type); - } - return type; -} -// Make the Fragment constructors effectively private -const _guard = {}; -const internal = Symbol.for("_corebc_internal"); -const ParamTypeInternal = "_ParamTypeInternal"; -const ErrorFragmentInternal = "_ErrorInternal"; -const EventFragmentInternal = "_EventInternal"; -const ConstructorFragmentInternal = "_ConstructorInternal"; -const FallbackFragmentInternal = "_FallbackInternal"; -const FunctionFragmentInternal = "_FunctionInternal"; -const StructFragmentInternal = "_StructInternal"; -/** - * Each input and output of a [[Fragment]] is an Array of **PAramType**. - */ -export class ParamType { - /** - * The local name of the parameter (or ``""`` if unbound) - */ - name; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - type; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - baseType; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - indexed; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - components; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - arrayLength; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - arrayChildren; - /** - * @private - */ - constructor(guard, name, type, baseType, indexed, components, arrayLength, arrayChildren) { - assertPrivate(guard, _guard, "ParamType"); - Object.defineProperty(this, internal, { value: ParamTypeInternal }); - if (components) { - components = Object.freeze(components.slice()); - } - if (baseType === "array") { - if (arrayLength == null || arrayChildren == null) { - throw new Error(""); - } - } - else if (arrayLength != null || arrayChildren != null) { - throw new Error(""); - } - if (baseType === "tuple") { - if (components == null) { - throw new Error(""); - } - } - else if (components != null) { - throw new Error(""); - } - defineProperties(this, { - name, - type, - baseType, - indexed, - components, - arrayLength, - arrayChildren, - }); - } - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - let result = { - type: this.baseType === "tuple" ? "tuple" : this.type, - name: this.name || undefined, - }; - if (typeof this.indexed === "boolean") { - result.indexed = this.indexed; - } - if (this.isTuple()) { - result.components = this.components.map((c) => JSON.parse(c.format(format))); - } - return JSON.stringify(result); - } - let result = ""; - // Array - if (this.isArray()) { - result += this.arrayChildren.format(format); - result += `[${this.arrayLength < 0 ? "" : String(this.arrayLength)}]`; - } - else { - if (this.isTuple()) { - if (format !== "sighash") { - result += this.type; - } - result += - "(" + - this.components - .map((comp) => comp.format(format)) - .join(format === "full" ? ", " : ",") + - ")"; - } - else { - result += this.type; - } - } - if (format !== "sighash") { - if (this.indexed === true) { - result += " indexed"; - } - if (format === "full" && this.name) { - result += " " + this.name; - } - } - return result; - } - /* - * Returns true if %%value%% is an Array type. - * - * This provides a type gaurd ensuring that the - * [[arrayChildren]] and [[arrayLength]] are non-null. - */ - //static isArray(value: any): value is { arrayChildren: ParamType, arrayLength: number } { - // return value && (value.baseType === "array") - //} - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray() { - return this.baseType === "array"; - } - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple() { - return this.baseType === "tuple"; - } - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable() { - return this.indexed != null; - } - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value, process) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v) => _this.arrayChildren.walk(v, process)); - } - if (this.isTuple()) { - if (!Array.isArray(value)) { - throw new Error("invalid tuple value"); - } - if (value.length !== this.components.length) { - throw new Error("array is wrong length"); - } - const _this = this; - return value.map((v, i) => _this.components[i].walk(v, process)); - } - return process(this.type, value); - } - #walkAsync(promises, value, process, setValue) { - if (this.isArray()) { - if (!Array.isArray(value)) { - throw new Error("invalid array value"); - } - if (this.arrayLength !== -1 && value.length !== this.arrayLength) { - throw new Error("array is wrong length"); - } - const childType = this.arrayChildren; - const result = value.slice(); - result.forEach((value, index) => { - childType.#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - if (this.isTuple()) { - const components = this.components; - // Convert the object into an array - let result; - if (Array.isArray(value)) { - result = value.slice(); - } - else { - if (value == null || typeof value !== "object") { - throw new Error("invalid tuple value"); - } - result = components.map((param) => { - if (!param.name) { - throw new Error("cannot use object value with unnamed components"); - } - if (!(param.name in value)) { - throw new Error(`missing value for component ${param.name}`); - } - return value[param.name]; - }); - } - if (result.length !== this.components.length) { - throw new Error("array is wrong length"); - } - result.forEach((value, index) => { - components[index].#walkAsync(promises, value, process, (value) => { - result[index] = value; - }); - }); - setValue(result); - return; - } - const result = process(this.type, value); - if (result.then) { - promises.push((async function () { - setValue(await result); - })()); - } - else { - setValue(result); - } - } - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - async walkAsync(value, process) { - const promises = []; - const result = [value]; - this.#walkAsync(promises, value, process, (value) => { - result[0] = value; - }); - if (promises.length) { - await Promise.all(promises); - } - return result[0]; - } - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj, allowIndexed) { - if (ParamType.isParamType(obj)) { - return obj; - } - if (typeof obj === "string") { - return ParamType.from(lex(obj), allowIndexed); - } - else if (obj instanceof TokenString) { - let type = "", baseType = ""; - let comps = null; - if (consumeKeywords(obj, setify(["tuple"])).has("tuple") || - obj.peekType("OPEN_PAREN")) { - // Tuple - baseType = "tuple"; - comps = obj.popParams().map((t) => ParamType.from(t)); - type = `tuple(${comps.map((c) => c.format()).join(",")})`; - } - else { - // Normal - type = verifyBasicType(obj.popType("TYPE")); - baseType = type; - } - // Check for Array - let arrayChildren = null; - let arrayLength = null; - while (obj.length && obj.peekType("BRACKET")) { - const bracket = obj.pop(); //arrays[i]; - arrayChildren = new ParamType(_guard, "", type, baseType, null, comps, arrayLength, arrayChildren); - arrayLength = bracket.value; - type += bracket.text; - baseType = "array"; - comps = null; - } - let indexed = null; - const keywords = consumeKeywords(obj, KwModifiers); - if (keywords.has("indexed")) { - if (!allowIndexed) { - throw new Error(""); - } - indexed = true; - } - const name = obj.peekType("ID") ? obj.pop().text : ""; - if (obj.length) { - throw new Error("leftover tokens"); - } - return new ParamType(_guard, name, type, baseType, indexed, comps, arrayLength, arrayChildren); - } - const name = obj.name; - assertArgument(!name || (typeof name === "string" && name.match(regexId)), "invalid name", "obj.name", name); - let indexed = obj.indexed; - if (indexed != null) { - assertArgument(allowIndexed, "parameter cannot be indexed", "obj.indexed", obj.indexed); - indexed = !!indexed; - } - let type = obj.type; - let arrayMatch = type.match(regexArrayType); - if (arrayMatch) { - const arrayLength = parseInt(arrayMatch[2] || "-1"); - const arrayChildren = ParamType.from({ - type: arrayMatch[1], - components: obj.components, - }); - return new ParamType(_guard, name || "", type, "array", indexed, null, arrayLength, arrayChildren); - } - if (type === "tuple" || - type.startsWith("tuple(" /* fix: ) */) || - type.startsWith("(" /* fix: ) */)) { - const comps = obj.components != null - ? obj.components.map((c) => ParamType.from(c)) - : null; - const tuple = new ParamType(_guard, name || "", type, "tuple", indexed, comps, null, null); - // @TODO: use lexer to validate and normalize type - return tuple; - } - type = verifyBasicType(obj.type); - return new ParamType(_guard, name || "", type, type, indexed, null, null, null); - } - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value) { - return value && value[internal] === ParamTypeInternal; - } -} -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -export class Fragment { - /** - * The type of the fragment. - */ - type; - /** - * The inputs for the fragment. - */ - inputs; - /** - * @private - */ - constructor(guard, type, inputs) { - assertPrivate(guard, _guard, "Fragment"); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { type, inputs }); - } - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj) { - if (typeof obj === "string") { - // Try parsing JSON... - try { - Fragment.from(JSON.parse(obj)); - } - catch (e) { } - // ...otherwise, use the human-readable lexer - return Fragment.from(lex(obj)); - } - if (obj instanceof TokenString) { - // Human-readable ABI (already lexed) - const type = obj.peekKeyword(KwTypes); - switch (type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - } - else if (typeof obj === "object") { - // JSON ABI - switch (obj.type) { - case "constructor": - return ConstructorFragment.from(obj); - case "error": - return ErrorFragment.from(obj); - case "event": - return EventFragment.from(obj); - case "fallback": - case "receive": - return FallbackFragment.from(obj); - case "function": - return FunctionFragment.from(obj); - case "struct": - return StructFragment.from(obj); - } - assert(false, `unsupported type: ${obj.type}`, "UNSUPPORTED_OPERATION", { - operation: "Fragment.from", - }); - } - assertArgument(false, "unsupported frgament object", "obj", obj); - } - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value) { - return ConstructorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value) { - return ErrorFragment.isFragment(value); - } - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value) { - return EventFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value) { - return FunctionFragment.isFragment(value); - } - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value) { - return StructFragment.isFragment(value); - } -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -export class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - name; - /** - * @private - */ - constructor(guard, type, name, inputs) { - super(guard, type, inputs); - assertArgument(typeof name === "string" && name.match(regexId), "invalid identifier", "name", name); - inputs = Object.freeze(inputs.slice()); - defineProperties(this, { name }); - } -} -function joinParams(format, params) { - return ("(" + - params.map((p) => p.format(format)).join(format === "full" ? ", " : ",") + - ")"); -} -/** - * A Fragment which represents a //Custom Error//. - */ -export class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "error", name, inputs); - Object.defineProperty(this, internal, { value: ErrorFragmentInternal }); - } - /** - * The Custom Error selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "error", - name: this.name, - inputs: this.inputs.map((input) => JSON.parse(input.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("error"); - } - result.push(this.name + joinParams(format, this.inputs)); - return result.join(" "); - } - static from(obj) { - if (ErrorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ErrorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("error", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new ErrorFragment(_guard, name, inputs); - } - return new ErrorFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal] === ErrorFragmentInternal; - } -} -/** - * A Fragment which represents an Event. - */ -export class EventFragment extends NamedFragment { - anonymous; - /** - * @private - */ - constructor(guard, name, inputs, anonymous) { - super(guard, "event", name, inputs); - Object.defineProperty(this, internal, { value: EventFragmentInternal }); - defineProperties(this, { anonymous }); - } - /** - * The Event topic hash. - */ - get topicHash() { - return id(this.format("sighash")); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "event", - anonymous: this.anonymous, - name: this.name, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("event"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash" && this.anonymous) { - result.push("anonymous"); - } - return result.join(" "); - } - static getTopicHash(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new EventFragment(_guard, name, params, false); - return fragment.topicHash; - } - static from(obj) { - if (EventFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return EventFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("event", obj); - const inputs = consumeParams(obj, true); - const anonymous = !!consumeKeywords(obj, setify(["anonymous"])).has("anonymous"); - consumeEoi(obj); - return new EventFragment(_guard, name, inputs, anonymous); - } - return new EventFragment(_guard, obj.name, obj.inputs ? obj.inputs.map((p) => ParamType.from(p, true)) : [], !!obj.anonymous); - } - static isFragment(value) { - return value && value[internal] === EventFragmentInternal; - } -} -/** - * A Fragment which represents a constructor. - */ -export class ConstructorFragment extends Fragment { - payable; - energy; - /** - * @private - */ - constructor(guard, type, inputs, payable, energy) { - super(guard, type, inputs); - Object.defineProperty(this, internal, { - value: ConstructorFragmentInternal, - }); - defineProperties(this, { payable, energy }); - } - format(format) { - assert(format != null && format !== "sighash", "cannot format a constructor for sighash", "UNSUPPORTED_OPERATION", { operation: "format(sighash)" }); - if (format === "json") { - return JSON.stringify({ - type: "constructor", - stateMutability: this.payable ? "payable" : "undefined", - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - }); - } - const result = [`constructor${joinParams(format, this.inputs)}`]; - result.push(this.payable ? "payable" : "nonpayable"); - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - return result.join(" "); - } - static from(obj) { - if (ConstructorFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return ConstructorFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - consumeKeywords(obj, setify(["constructor"])); - const inputs = consumeParams(obj); - const payable = !!consumeKeywords(obj, setify(["payable"])).has("payable"); - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new ConstructorFragment(_guard, "constructor", inputs, payable, energy); - } - return new ConstructorFragment(_guard, "constructor", obj.inputs ? obj.inputs.map(ParamType.from) : [], !!obj.payable, obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal] === ConstructorFragmentInternal; - } -} -/** - * A Fragment which represents a method. - */ -export class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - payable; - constructor(guard, inputs, payable) { - super(guard, "fallback", inputs); - Object.defineProperty(this, internal, { value: FallbackFragmentInternal }); - defineProperties(this, { payable }); - } - format(format) { - const type = this.inputs.length === 0 ? "receive" : "fallback"; - if (format === "json") { - const stateMutability = this.payable ? "payable" : "nonpayable"; - return JSON.stringify({ type, stateMutability }); - } - return `${type}()${this.payable ? " payable" : ""}`; - } - static from(obj) { - if (FallbackFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FallbackFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const errorObj = obj.toString(); - const topIsValid = obj.peekKeyword(setify(["fallback", "receive"])); - assertArgument(topIsValid, "type must be fallback or receive", "obj", errorObj); - const type = obj.popKeyword(setify(["fallback", "receive"])); - // receive() - if (type === "receive") { - const inputs = consumeParams(obj); - assertArgument(inputs.length === 0, `receive cannot have arguments`, "obj.inputs", inputs); - consumeKeywords(obj, setify(["payable"])); - consumeEoi(obj); - return new FallbackFragment(_guard, [], true); - } - // fallback() [payable] - // fallback(bytes) [payable] returns (bytes) - let inputs = consumeParams(obj); - if (inputs.length) { - assertArgument(inputs.length === 1 && inputs[0].type === "bytes", "invalid fallback inputs", "obj.inputs", inputs.map((i) => i.format("minimal")).join(", ")); - } - else { - inputs = [ParamType.from("bytes")]; - } - const mutability = consumeMutability(obj); - assertArgument(mutability === "nonpayable" || mutability === "payable", "fallback cannot be constants", "obj.stateMutability", mutability); - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - const outputs = consumeParams(obj); - assertArgument(outputs.length === 1 && outputs[0].type === "bytes", "invalid fallback outputs", "obj.outputs", outputs.map((i) => i.format("minimal")).join(", ")); - } - consumeEoi(obj); - return new FallbackFragment(_guard, inputs, mutability === "payable"); - } - if (obj.type === "receive") { - return new FallbackFragment(_guard, [], true); - } - if (obj.type === "fallback") { - const inputs = [ParamType.from("bytes")]; - const payable = obj.stateMutability === "payable"; - return new FallbackFragment(_guard, inputs, payable); - } - assertArgument(false, "invalid fallback description", "obj", obj); - } - static isFragment(value) { - return value && value[internal] === FallbackFragmentInternal; - } -} -/** - * A Fragment which represents a method. - */ -export class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - constant; - /** - * The returned types for the result of calling this function. - */ - outputs; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - stateMutability; - /** - * If the function can be sent value during invocation. - */ - payable; - /** - * The amount of energy to send when calling this function - */ - energy; - /** - * @private - */ - constructor(guard, name, stateMutability, inputs, outputs, energy) { - super(guard, "function", name, inputs); - Object.defineProperty(this, internal, { value: FunctionFragmentInternal }); - outputs = Object.freeze(outputs.slice()); - const constant = stateMutability === "view" || stateMutability === "pure"; - const payable = stateMutability === "payable"; - defineProperties(this, { - constant, - energy, - outputs, - payable, - stateMutability, - }); - } - /** - * The Function selector. - */ - get selector() { - return id(this.format("sighash")).substring(0, 10); - } - format(format) { - if (format == null) { - format = "sighash"; - } - if (format === "json") { - return JSON.stringify({ - type: "function", - name: this.name, - constant: this.constant, - stateMutability: this.stateMutability !== "nonpayable" - ? this.stateMutability - : undefined, - payable: this.payable, - energy: this.energy != null ? this.energy : undefined, - inputs: this.inputs.map((i) => JSON.parse(i.format(format))), - outputs: this.outputs.map((o) => JSON.parse(o.format(format))), - }); - } - const result = []; - if (format !== "sighash") { - result.push("function"); - } - result.push(this.name + joinParams(format, this.inputs)); - if (format !== "sighash") { - if (this.stateMutability !== "nonpayable") { - result.push(this.stateMutability); - } - if (this.outputs && this.outputs.length) { - result.push("returns"); - result.push(joinParams(format, this.outputs)); - } - if (this.energy != null) { - result.push(`@${this.energy.toString()}`); - } - } - return result.join(" "); - } - static getSelector(name, params) { - params = (params || []).map((p) => ParamType.from(p)); - const fragment = new FunctionFragment(_guard, name, "view", params, [], null); - return fragment.selector; - } - static from(obj) { - if (FunctionFragment.isFragment(obj)) { - return obj; - } - if (typeof obj === "string") { - return FunctionFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("function", obj); - const inputs = consumeParams(obj); - const mutability = consumeMutability(obj); - let outputs = []; - if (consumeKeywords(obj, setify(["returns"])).has("returns")) { - outputs = consumeParams(obj); - } - const energy = consumeEnergy(obj); - consumeEoi(obj); - return new FunctionFragment(_guard, name, mutability, inputs, outputs, energy); - } - let stateMutability = obj.stateMutability; - // Use legacy Solidity ABI logic if stateMutability is missing - if (stateMutability == null) { - stateMutability = "payable"; - if (typeof obj.constant === "boolean") { - stateMutability = "view"; - if (!obj.constant) { - stateMutability = "payable"; - if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - } - else if (typeof obj.payable === "boolean" && !obj.payable) { - stateMutability = "nonpayable"; - } - } - // @TODO: verifyState for stateMutability (e.g. throw if - // payable: false but stateMutability is "nonpayable") - return new FunctionFragment(_guard, obj.name, stateMutability, obj.inputs ? obj.inputs.map(ParamType.from) : [], obj.outputs ? obj.outputs.map(ParamType.from) : [], obj.energy != null ? obj.energy : null); - } - static isFragment(value) { - return value && value[internal] === FunctionFragmentInternal; - } -} -/** - * A Fragment which represents a structure. - */ -export class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard, name, inputs) { - super(guard, "struct", name, inputs); - Object.defineProperty(this, internal, { value: StructFragmentInternal }); - } - format() { - throw new Error("@TODO"); - } - static from(obj) { - if (typeof obj === "string") { - return StructFragment.from(lex(obj)); - } - else if (obj instanceof TokenString) { - const name = consumeName("struct", obj); - const inputs = consumeParams(obj); - consumeEoi(obj); - return new StructFragment(_guard, name, inputs); - } - return new StructFragment(_guard, obj.name, obj.inputs ? obj.inputs.map(ParamType.from) : []); - } - static isFragment(value) { - return value && value[internal] === StructFragmentInternal; - } -} -//# sourceMappingURL=fragments.js.map \ No newline at end of file diff --git a/lib.esm/abi/fragments.js.map b/lib.esm/abi/fragments.js.map deleted file mode 100644 index 3a3e5a43c..000000000 --- a/lib.esm/abi/fragments.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.js","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EACN,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,MAAM,EACN,aAAa,EACb,cAAc,GACd,MAAM,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AAC,CAAC,CAAC,CAAC,EAAE,CAChD,CAAC;IACH,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,KAAU;QAC3B,OAAO,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,sBAAsB,CAAC;IAC5D,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/index.d.ts b/lib.esm/abi/index.d.ts deleted file mode 100644 index ce0ddb016..000000000 --- a/lib.esm/abi/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Explain about ABI here... - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ -export { AbiCoder } from "./abi-coder.js"; -export { decodeBytes32String, encodeBytes32String } from "./bytes32.js"; -export { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from "./fragments.js"; -export { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result, } from "./interface.js"; -export { Typed } from "./typed.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, ParamTypeWalkAsyncFunc, ParamTypeWalkFunc, } from "./fragments.js"; -export type { InterfaceAbi } from "./interface.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/index.d.ts.map b/lib.esm/abi/index.d.ts.map deleted file mode 100644 index a3a6ec0b1..000000000 --- a/lib.esm/abi/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi/index.js b/lib.esm/abi/index.js deleted file mode 100644 index 0144c83ef..000000000 --- a/lib.esm/abi/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Explain about ABI here... - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ -////// -export { AbiCoder } from "./abi-coder.js"; -export { decodeBytes32String, encodeBytes32String } from "./bytes32.js"; -export { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from "./fragments.js"; -export { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result, } from "./interface.js"; -export { Typed } from "./typed.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/abi/index.js.map b/lib.esm/abi/index.js.map deleted file mode 100644 index 959af7db5..000000000 --- a/lib.esm/abi/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM;AACN,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/lib.esm/abi/interface.d.ts b/lib.esm/abi/interface.d.ts deleted file mode 100644 index 62b24ebe4..000000000 --- a/lib.esm/abi/interface.d.ts +++ /dev/null @@ -1,270 +0,0 @@ -/** - * About Interface - * - * @_subsection api/abi:Interfaces [interfaces] - */ -import { AbiCoder } from "./abi-coder.js"; -import { checkResultErrors, Result } from "./coders/abstract-coder.js"; -import { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, ParamType } from "./fragments.js"; -import { Typed } from "./typed.js"; -import type { BigNumberish, BytesLike, CallExceptionError, CallExceptionTransaction } from "../utils/index.js"; -import type { JsonFragment } from "./fragments.js"; -export { checkResultErrors, Result }; -export declare class LogDescription { - readonly fragment: EventFragment; - readonly name: string; - readonly signature: string; - readonly topic: string; - readonly args: Result; - constructor(fragment: EventFragment, topic: string, args: Result); -} -export declare class TransactionDescription { - readonly fragment: FunctionFragment; - readonly name: string; - readonly args: Result; - readonly signature: string; - readonly selector: string; - readonly value: bigint; - constructor(fragment: FunctionFragment, selector: string, args: Result, value: bigint); -} -export declare class ErrorDescription { - readonly fragment: ErrorFragment; - readonly name: string; - readonly args: Result; - readonly signature: string; - readonly selector: string; - constructor(fragment: ErrorFragment, selector: string, args: Result); -} -export declare class Indexed { - readonly hash: null | string; - readonly _isIndexed: boolean; - static isIndexed(value: any): value is Indexed; - constructor(hash: null | string); -} -/** - * @TODO - */ -export type InterfaceAbi = string | ReadonlyArray; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -export declare class Interface { - #private; - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - readonly fragments: ReadonlyArray; - /** - * The Contract constructor. - */ - readonly deploy: ConstructorFragment; - /** - * The Fallback method, if any. - */ - readonly fallback: null | FallbackFragment; - /** - * If receiving xcb is supported. - */ - readonly receive: boolean; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments: InterfaceAbi); - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal?: boolean): Array; - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson(): string; - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder(): AbiCoder; - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key: string): string; - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key: string): boolean; - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key: string, values?: Array): null | FunctionFragment; - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback: (func: FunctionFragment, index: number) => void): void; - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key: string): string; - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key: string): boolean; - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key: string, values?: Array): null | EventFragment; - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback: (func: EventFragment, index: number) => void): void; - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key: string, values?: Array): null | ErrorFragment; - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback: (func: ErrorFragment, index: number) => void): void; - _decodeParams(params: ReadonlyArray, data: BytesLike): Result; - _encodeParams(params: ReadonlyArray, values: ReadonlyArray): string; - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result; - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment: FunctionFragment | string, data: BytesLike): Result; - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment: FunctionFragment | string, data: BytesLike): Result; - makeError(_data: BytesLike, tx: CallExceptionTransaction): CallExceptionError; - /** - * Encodes the result data (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - encodeFilterTopics(fragment: EventFragment | string, values: ReadonlyArray): Array>; - encodeEventLog(fragment: EventFragment | string, values: ReadonlyArray): { - data: string; - topics: Array; - }; - decodeEventLog(fragment: EventFragment | string, data: BytesLike, topics?: ReadonlyArray): Result; - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx: { - data: string; - value?: BigNumberish; - }): null | TransactionDescription; - parseCallResult(data: BytesLike): Result; - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log: { - topics: Array; - data: string; - }): null | LogDescription; - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data: BytesLike): null | ErrorDescription; - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value: InterfaceAbi | Interface): Interface; -} -//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/interface.d.ts.map b/lib.esm/abi/interface.d.ts.map deleted file mode 100644 index d7d096cce..000000000 --- a/lib.esm/abi/interface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,EACX,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,wBAAwB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;AAErC,qBAAa,cAAc;IAC1B,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAU/D;CACD;AAED,qBAAa,sBAAsB;IAClC,QAAQ,CAAC,QAAQ,EAAG,gBAAgB,CAAC;IACrC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAG,MAAM,C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C,GAAG,CAAC,GACxB,KAAK,CAAC,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CA8EtC;IAED,cAAc,CACb,QAAQ,EAAE,aAAa,GAAG,MAAM,EAChC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;KAAE,CA8CzC;IAGD,cAAc,CACb,QAAQ,EAAE,aAAa,GAAG,MAAM,EAChC,IAAI,EAAE,SAAS,EACf,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GAC5B,MAAM,CA8ER;IAED;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,EAAE;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,YAAY,CAAC;KACrB,GAAG,IAAI,GAAG,sBAAsB,CAYhC;IAED,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEvC;IAED;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtB,IAAI,EAAE,MAAM,CAAC;KACb,GAAG,IAAI,GAAG,cAAc,CAgBxB;IAED;;;;;OAKG;IACH,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,gBAAgB,CAWnD;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAkBtD;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/interface.js b/lib.esm/abi/interface.js deleted file mode 100644 index 68c1d2999..000000000 --- a/lib.esm/abi/interface.js +++ /dev/null @@ -1,1030 +0,0 @@ -/** - * About Interface - * - * @_subsection api/abi:Interfaces [interfaces] - */ -import { id } from "../hash/index.js"; -import { concat, dataSlice, getBigInt, getBytes, getBytesCopy, hexlify, zeroPadValue, isHexString, defineProperties, assertArgument, toBeHex, assert, } from "../utils/index.js"; -import { AbiCoder } from "./abi-coder.js"; -import { checkResultErrors, Result } from "./coders/abstract-coder.js"; -import { ConstructorFragment, ErrorFragment, EventFragment, Fragment, FunctionFragment, ParamType, } from "./fragments.js"; -import { Typed } from "./typed.js"; -import { sha256 } from "../crypto/sha3.js"; -export { checkResultErrors, Result }; -export class LogDescription { - fragment; - name; - signature; - topic; - args; - constructor(fragment, topic, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - signature, - topic, - args, - }); - } -} -export class TransactionDescription { - fragment; - name; - args; - signature; - selector; - value; - constructor(fragment, selector, args, value) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - value, - }); - } -} -export class ErrorDescription { - fragment; - name; - args; - signature; - selector; - constructor(fragment, selector, args) { - const name = fragment.name, signature = fragment.format(); - defineProperties(this, { - fragment, - name, - args, - signature, - selector, - }); - } -} -export class Indexed { - hash; - _isIndexed; - static isIndexed(value) { - return !!(value && value._isIndexed); - } - constructor(hash) { - defineProperties(this, { hash, _isIndexed: true }); - } -} -// https://docs.soliditylang.org/en/v0.8.13/control-structures.html?highlight=panic#panic-via-assert-and-error-via-require -const PanicReasons = { - "0": "generic panic", - "1": "assert(false)", - "17": "arithmetic overflow", - "18": "division or modulo by zero", - "33": "enum overflow", - "34": "invalid encoded storage byte array accessed", - "49": "out-of-bounds array access; popping on an empty array", - "50": "out-of-bounds access of an array or bytesN", - "65": "out of memory", - "81": "uninitialized function", -}; -const BuiltinErrors = { - "0x08c379a0": { - signature: "Error(string)", - name: "Error", - inputs: ["string"], - reason: (message) => { - return `reverted with reason string ${JSON.stringify(message)}`; - }, - }, - "0x4e487b71": { - signature: "Panic(uint256)", - name: "Panic", - inputs: ["uint256"], - reason: (code) => { - let reason = "unknown panic code"; - if (code >= 0 && code <= 0xff && PanicReasons[code.toString()]) { - reason = PanicReasons[code.toString()]; - } - return `reverted with panic code 0x${code.toString(16)} (${reason})`; - }, - }, -}; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -export class Interface { - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - fragments; - /** - * The Contract constructor. - */ - deploy; - /** - * The Fallback method, if any. - */ - fallback; - /** - * If receiving xcb is supported. - */ - receive; - #errors; - #events; - #functions; - // #structs: Map; - #abiCoder; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments) { - let abi = []; - if (typeof fragments === "string") { - abi = JSON.parse(fragments); - } - else { - abi = fragments; - } - this.#functions = new Map(); - this.#errors = new Map(); - this.#events = new Map(); - // this.#structs = new Map(); - const frags = []; - for (const a of abi) { - try { - frags.push(Fragment.from(a)); - } - catch (error) { - console.log("EE", error); - } - } - defineProperties(this, { - fragments: Object.freeze(frags), - }); - let fallback = null; - let receive = false; - this.#abiCoder = this.getAbiCoder(); - // Add all fragments by their signature - this.fragments.forEach((fragment, index) => { - let bucket; - switch (fragment.type) { - case "constructor": - if (this.deploy) { - console.log("duplicate definition - constructor"); - return; - } - //checkNames(fragment, "input", fragment.inputs); - defineProperties(this, { - deploy: fragment, - }); - return; - case "fallback": - if (fragment.inputs.length === 0) { - receive = true; - } - else { - assertArgument(!fallback || - fragment.payable !== fallback.payable, "conflicting fallback fragments", `fragments[${index}]`, fragment); - fallback = fragment; - receive = fallback.payable; - } - return; - case "function": - //checkNames(fragment, "input", fragment.inputs); - //checkNames(fragment, "output", (fragment).outputs); - bucket = this.#functions; - break; - case "event": - //checkNames(fragment, "input", fragment.inputs); - bucket = this.#events; - break; - case "error": - bucket = this.#errors; - break; - default: - return; - } - // Two identical entries; ignore it - const signature = fragment.format(); - if (bucket.has(signature)) { - return; - } - bucket.set(signature, fragment); - }); - // If we do not have a constructor add a default - if (!this.deploy) { - defineProperties(this, { - deploy: ConstructorFragment.from("constructor()"), - }); - } - defineProperties(this, { fallback, receive }); - } - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal) { - const format = minimal ? "minimal" : "full"; - const abi = this.fragments.map((f) => f.format(format)); - return abi; - } - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson() { - const abi = this.fragments.map((f) => f.format("json")); - // We need to re-bundle the JSON fragments a bit - return JSON.stringify(abi.map((j) => JSON.parse(j))); - } - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder() { - return AbiCoder.defaultAbiCoder(); - } - // Find a function definition by any means necessary (unless it is ambiguous) - #getFunction(key, values, forceUnique) { - // Selector - if (isHexString(key)) { - const selector = key.toLowerCase(); - for (const fragment of this.#functions.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#functions) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - const lastValue = values.length > 0 ? values[values.length - 1] : null; - let valueLength = values.length; - let allowOptions = true; - if (Typed.isTyped(lastValue) && lastValue.type === "overrides") { - allowOptions = false; - valueLength--; - } - // Remove all matches that don't have a compatible length. The args - // may contain an overrides, so the match may have n or n - 1 parameters - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs.length; - if (inputs !== valueLength && - (!allowOptions || inputs !== valueLength - 1)) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // We are past the inputs - if (j >= inputs.length) { - if (values[j].type === "overrides") { - continue; - } - matching.splice(i, 1); - break; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - // We found a single matching signature with an overrides, but the - // last value is something that cannot possibly be an options - if (matching.length === 1 && - values && - values.length !== matching[0].inputs.length) { - const lastArg = values[values.length - 1]; - if (lastArg == null || - Array.isArray(lastArg) || - typeof lastArg !== "object") { - matching.splice(0, 1); - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous function description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#functions.get(FunctionFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key) { - const fragment = this.#getFunction(key, null, false); - assertArgument(fragment, "no matching function", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key) { - return !!this.#getFunction(key, null, false); - } - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key, values) { - return this.#getFunction(key, values || null, true); - } - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback) { - const names = Array.from(this.#functions.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#functions.get(name), i); - } - } - // Find an event definition by any means necessary (unless it is ambiguous) - #getEvent(key, values, forceUnique) { - // EventTopic - if (isHexString(key)) { - const eventTopic = key.toLowerCase(); - for (const fragment of this.#events.values()) { - if (eventTopic === fragment.topicHash) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#events) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (values) { - // Remove all matches that don't have a compatible length. - for (let i = matching.length - 1; i >= 0; i--) { - if (matching[i].inputs.length < values.length) { - matching.splice(i, 1); - } - } - // Remove all matches that don't match the Typed signature - for (let i = matching.length - 1; i >= 0; i--) { - const inputs = matching[i].inputs; - for (let j = 0; j < values.length; j++) { - // Not a typed value - if (!Typed.isTyped(values[j])) { - continue; - } - // Make sure the value type matches the input type - if (values[j].type !== inputs[j].baseType) { - matching.splice(i, 1); - break; - } - } - } - } - if (matching.length === 0) { - return null; - } - if (matching.length > 1 && forceUnique) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous event description (i.e. matches ${matchStr})`, "key", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - const result = this.#events.get(EventFragment.from(key).format()); - if (result) { - return result; - } - return null; - } - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key) { - const fragment = this.#getEvent(key, null, false); - assertArgument(fragment, "no matching event", "key", key); - return fragment.name; - } - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key) { - return !!this.#getEvent(key, null, false); - } - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key, values) { - return this.#getEvent(key, values || null, true); - } - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback) { - const names = Array.from(this.#events.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#events.get(name), i); - } - } - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key, values) { - if (isHexString(key)) { - const selector = key.toLowerCase(); - if (BuiltinErrors[selector]) { - return ErrorFragment.from(BuiltinErrors[selector].signature); - } - for (const fragment of this.#errors.values()) { - if (selector === fragment.selector) { - return fragment; - } - } - return null; - } - // It is a bare name, look up the function (will return null if ambiguous) - if (key.indexOf("(") === -1) { - const matching = []; - for (const [name, fragment] of this.#errors) { - if (name.split("(" /* fix:) */)[0] === key) { - matching.push(fragment); - } - } - if (matching.length === 0) { - if (key === "Error") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic") { - return ErrorFragment.from("error Panic(uint256)"); - } - return null; - } - else if (matching.length > 1) { - const matchStr = matching - .map((m) => JSON.stringify(m.format())) - .join(", "); - assertArgument(false, `ambiguous error description (i.e. ${matchStr})`, "name", key); - } - return matching[0]; - } - // Normalize the signature and lookup the function - key = ErrorFragment.from(key).format(); - if (key === "Error(string)") { - return ErrorFragment.from("error Error(string)"); - } - if (key === "Panic(uint256)") { - return ErrorFragment.from("error Panic(uint256)"); - } - const result = this.#errors.get(key); - if (result) { - return result; - } - return null; - } - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback) { - const names = Array.from(this.#errors.keys()); - names.sort((a, b) => a.localeCompare(b)); - for (let i = 0; i < names.length; i++) { - const name = names[i]; - callback(this.#errors.get(name), i); - } - } - // Get the 4-byte selector used by Solidity to identify a function - /* - getSelector(fragment: ErrorFragment | FunctionFragment): string { - if (typeof(fragment) === "string") { - const matches: Array = [ ]; - - try { matches.push(this.getFunction(fragment)); } catch (error) { } - try { matches.push(this.getError(fragment)); } catch (_) { } - - if (matches.length === 0) { - logger.throwArgumentError("unknown fragment", "key", fragment); - } else if (matches.length > 1) { - logger.throwArgumentError("ambiguous fragment matches function and error", "key", fragment); - } - - fragment = matches[0]; - } - - return dataSlice(id(fragment.format()), 0, 4); - } - */ - // Get the 32-byte topic hash used by Solidity to identify an event - /* - getEventTopic(fragment: EventFragment): string { - //if (typeof(fragment) === "string") { fragment = this.getEvent(eventFragment); } - return id(fragment.format()); - } - */ - _decodeParams(params, data) { - return this.#abiCoder.decode(params, data); - } - _encodeParams(params, values) { - return this.#abiCoder.encode(params, values); - } - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values) { - return this._encodeParams(this.deploy.inputs, values || []); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment, data) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match error ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getError(fragment); - assertArgument(f, "unknown error", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment, data) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - assertArgument(dataSlice(data, 0, 4) === fragment.selector, `data signature does not match function ${fragment.name}.`, "data", data); - return this._decodeParams(fragment.inputs, dataSlice(data, 4)); - } - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return concat([ - fragment.selector, - this._encodeParams(fragment.inputs, values || []), - ]); - } - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment, data) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - let message = "invalid length for result data"; - const bytes = getBytesCopy(data); - if (bytes.length % 32 === 0) { - try { - return this.#abiCoder.decode(fragment.outputs, bytes); - } - catch (error) { - message = "could not decode result data"; - } - } - // Call returned data with no error, but the data is junk - assert(false, message, "BAD_DATA", { - value: hexlify(bytes), - info: { method: fragment.name, signature: fragment.format() }, - }); - } - makeError(_data, tx) { - const data = getBytes(_data, "data"); - const error = AbiCoder.getBuiltinCallException("call", tx, data); - // Not a built-in error; try finding a custom error - const customPrefix = "execution reverted (unknown custom error)"; - if (error.message.startsWith(customPrefix)) { - const selector = hexlify(data.slice(0, 4)); - const ef = this.getError(selector); - if (ef) { - try { - const args = this.#abiCoder.decode(ef.inputs, data.slice(4)); - error.revert = { - name: ef.name, - signature: ef.format(), - args, - }; - error.reason = error.revert.signature; - error.message = `execution reverted: ${error.reason}`; - } - catch (e) { - error.message = `execution reverted (coult not decode custom error)`; - } - } - } - // Add the invocation, if available - const parsed = this.parseTransaction(tx); - if (parsed) { - error.invocation = { - method: parsed.name, - signature: parsed.signature, - args: parsed.args, - }; - } - return error; - } - /** - * Encodes the result data (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment, values) { - if (typeof fragment === "string") { - const f = this.getFunction(fragment); - assertArgument(f, "unknown function", "fragment", fragment); - fragment = f; - } - return hexlify(this.#abiCoder.encode(fragment.outputs, values || [])); - } - /* - spelunk(inputs: Array, values: ReadonlyArray, processfunc: (type: string, value: any) => Promise): Promise> { - const promises: Array> = [ ]; - const process = function(type: ParamType, value: any): any { - if (type.baseType === "array") { - return descend(type.child - } - if (type. === "address") { - } - }; - - const descend = function (inputs: Array, values: ReadonlyArray) { - if (inputs.length !== values.length) { throw new Error("length mismatch"); } - }; - - const result: Array = [ ]; - values.forEach((value, index) => { - if (value == null) { - topics.push(null); - } else if (param.baseType === "array" || param.baseType === "tuple") { - logger.throwArgumentError("filtering with tuples or arrays not supported", ("contract." + param.name), value); - } else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } else { - topics.push(encodeTopic(param, value)); - } - }); - } -*/ - // Create the filter for the event with search criteria (e.g. for xcb_filterLog) - encodeFilterTopics(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - assert(values.length <= fragment.inputs.length, `too many arguments for ${fragment.format()}`, "UNEXPECTED_ARGUMENT", { count: values.length, expectedCount: fragment.inputs.length }); - const topics = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - // @TODO: Use the coders for this; to properly support tuples, etc. - const encodeTopic = (param, value) => { - if (param.type === "string") { - return id(value); - } - else if (param.type === "bytes") { - return sha256(hexlify(value)); - } - if (param.type === "bool" && typeof value === "boolean") { - value = value ? "0x01" : "0x00"; - } - if (param.type.match(/^u?int/)) { - value = toBeHex(value); - } - // Check addresses are valid - if (param.type === "address") { - this.#abiCoder.encode(["address"], [value]); - } - return zeroPadValue(hexlify(value), 32); - //@TOOD should probably be return toHex(value, 32) - }; - values.forEach((value, index) => { - const param = fragment.inputs[index]; - if (!param.indexed) { - assertArgument(value == null, "cannot filter non-indexed parameters; must be null", "contract." + param.name, value); - return; - } - if (value == null) { - topics.push(null); - } - else if (param.baseType === "array" || param.baseType === "tuple") { - assertArgument(false, "filtering with tuples or arrays not supported", "contract." + param.name, value); - } - else if (Array.isArray(value)) { - topics.push(value.map((value) => encodeTopic(param, value))); - } - else { - topics.push(encodeTopic(param, value)); - } - }); - // Trim off trailing nulls - while (topics.length && topics[topics.length - 1] === null) { - topics.pop(); - } - return topics; - } - encodeEventLog(fragment, values) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - const topics = []; - const dataTypes = []; - const dataValues = []; - if (!fragment.anonymous) { - topics.push(fragment.topicHash); - } - assertArgument(values.length === fragment.inputs.length, "event arguments/values mismatch", "values", values); - fragment.inputs.forEach((param, index) => { - const value = values[index]; - if (param.indexed) { - if (param.type === "string") { - topics.push(id(value)); - } - else if (param.type === "bytes") { - topics.push(sha256(value)); - } - else if (param.baseType === "tuple" || param.baseType === "array") { - // @TODO - throw new Error("not implemented"); - } - else { - topics.push(this.#abiCoder.encode([param.type], [value])); - } - } - else { - dataTypes.push(param); - dataValues.push(value); - } - }); - return { - data: this.#abiCoder.encode(dataTypes, dataValues), - topics: topics, - }; - } - // Decode a filter for the event and the search criteria - decodeEventLog(fragment, data, topics) { - if (typeof fragment === "string") { - const f = this.getEvent(fragment); - assertArgument(f, "unknown event", "eventFragment", fragment); - fragment = f; - } - if (topics != null && !fragment.anonymous) { - const eventTopic = fragment.topicHash; - assertArgument(isHexString(topics[0], 32) && topics[0].toLowerCase() === eventTopic, "fragment/topic mismatch", "topics[0]", topics[0]); - topics = topics.slice(1); - } - const indexed = []; - const nonIndexed = []; - const dynamic = []; - fragment.inputs.forEach((param, index) => { - if (param.indexed) { - if (param.type === "string" || - param.type === "bytes" || - param.baseType === "tuple" || - param.baseType === "array") { - indexed.push(ParamType.from({ type: "bytes32", name: param.name })); - dynamic.push(true); - } - else { - indexed.push(param); - dynamic.push(false); - } - } - else { - nonIndexed.push(param); - dynamic.push(false); - } - }); - const resultIndexed = topics != null ? this.#abiCoder.decode(indexed, concat(topics)) : null; - const resultNonIndexed = this.#abiCoder.decode(nonIndexed, data, true); - //const result: (Array & { [ key: string ]: any }) = [ ]; - const values = []; - const keys = []; - let nonIndexedIndex = 0, indexedIndex = 0; - fragment.inputs.forEach((param, index) => { - let value = null; - if (param.indexed) { - if (resultIndexed == null) { - value = new Indexed(null); - } - else if (dynamic[index]) { - value = new Indexed(resultIndexed[indexedIndex++]); - } - else { - try { - value = resultIndexed[indexedIndex++]; - } - catch (error) { - value = error; - } - } - } - else { - try { - value = resultNonIndexed[nonIndexedIndex++]; - } - catch (error) { - value = error; - } - } - values.push(value); - keys.push(param.name || null); - }); - return Result.fromItems(values, keys); - } - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx) { - const data = getBytes(tx.data, "tx.data"); - const value = getBigInt(tx.value != null ? tx.value : 0, "tx.value"); - const fragment = this.getFunction(hexlify(data.slice(0, 4))); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, data.slice(4)); - return new TransactionDescription(fragment, fragment.selector, args, value); - } - parseCallResult(data) { - throw new Error("@TODO"); - } - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log) { - const fragment = this.getEvent(log.topics[0]); - if (!fragment || fragment.anonymous) { - return null; - } - // @TODO: If anonymous, and the only method, and the input count matches, should we parse? - // Probably not, because just because it is the only event in the ABI does - // not mean we have the full ABI; maybe just a fragment? - return new LogDescription(fragment, fragment.topicHash, this.decodeEventLog(fragment, log.data, log.topics)); - } - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data) { - const hexData = hexlify(data); - const fragment = this.getError(dataSlice(hexData, 0, 4)); - if (!fragment) { - return null; - } - const args = this.#abiCoder.decode(fragment.inputs, dataSlice(hexData, 4)); - return new ErrorDescription(fragment, fragment.selector, args); - } - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value) { - // Already an Interface, which is immutable - if (value instanceof Interface) { - return value; - } - // JSON - if (typeof value === "string") { - return new Interface(JSON.parse(value)); - } - // Maybe an interface from an older version, or from a symlinked copy - if (typeof value.format === "function") { - return new Interface(value.format("json")); - } - // Array of fragments - return new Interface(value); - } -} -//# sourceMappingURL=interface.js.map \ No newline at end of file diff --git a/lib.esm/abi/interface.js.map b/lib.esm/abi/interface.js.map deleted file mode 100644 index 9b7c7cecb..000000000 --- a/lib.esm/abi/interface.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EACN,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,MAAM,GACN,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EAEb,QAAQ,EACR,gBAAgB,EAChB,SAAS,GACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY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C,2CAA2C;QAC3C,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;YAChC,OAAO,KAAK,CAAC;QACd,CAAC;QAED,OAAO;QACP,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACzC,CAAC;QAED,qEAAqE;QACrE,IAAI,OAAa,KAAM,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;YAC/C,OAAO,IAAI,SAAS,CAAO,KAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACnD,CAAC;QAED,qBAAqB;QACrB,OAAO,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/typed.d.ts b/lib.esm/abi/typed.d.ts deleted file mode 100644 index 3dce9d6a9..000000000 --- a/lib.esm/abi/typed.d.ts +++ /dev/null @@ -1,172 +0,0 @@ -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -import type { Addressable } from "../address/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { Result } from "./coders/abstract-coder.js"; -export interface TypedNumber extends Typed { - value: number; - defaultValue(): number; - minValue(): number; - maxValue(): number; -} -export interface TypedBigInt extends Typed { - value: bigint; - defaultValue(): bigint; - minValue(): bigint; - maxValue(): bigint; -} -export interface TypedData extends Typed { - value: string; - defaultValue(): string; -} -export interface TypedString extends Typed { - value: string; - defaultValue(): string; -} -export declare class Typed { - #private; - readonly type: string; - readonly value: any; - readonly _typedSymbol: Symbol; - constructor(gaurd: any, type: string, value: any, options?: any); - format(): string; - defaultValue(): string | number | bigint | Result; - minValue(): string | number | bigint; - maxValue(): string | number | bigint; - isBigInt(): this is TypedBigInt; - isData(): this is TypedData; - isString(): this is TypedString; - get tupleName(): null | string; - get arrayLength(): null | number; - static from(type: string, value: any): Typed; - static uint8(v: BigNumberish): Typed; - static uint16(v: BigNumberish): Typed; - static uint24(v: BigNumberish): Typed; - static uint32(v: BigNumberish): Typed; - static uint40(v: BigNumberish): Typed; - static uint48(v: BigNumberish): Typed; - static uint56(v: BigNumberish): Typed; - static uint64(v: BigNumberish): Typed; - static uint72(v: BigNumberish): Typed; - static uint80(v: BigNumberish): Typed; - static uint88(v: BigNumberish): Typed; - static uint96(v: BigNumberish): Typed; - static uint104(v: BigNumberish): Typed; - static uint112(v: BigNumberish): Typed; - static uint120(v: BigNumberish): Typed; - static uint128(v: BigNumberish): Typed; - static uint136(v: BigNumberish): Typed; - static uint144(v: BigNumberish): Typed; - static uint152(v: BigNumberish): Typed; - static uint160(v: BigNumberish): Typed; - static uint168(v: BigNumberish): Typed; - static uint176(v: BigNumberish): Typed; - static uint184(v: BigNumberish): Typed; - static uint192(v: BigNumberish): Typed; - static uint200(v: BigNumberish): Typed; - static uint208(v: BigNumberish): Typed; - static uint216(v: BigNumberish): Typed; - static uint224(v: BigNumberish): Typed; - static uint232(v: BigNumberish): Typed; - static uint240(v: BigNumberish): Typed; - static uint248(v: BigNumberish): Typed; - static uint256(v: BigNumberish): Typed; - static uint(v: BigNumberish): Typed; - static int8(v: BigNumberish): Typed; - static int16(v: BigNumberish): Typed; - static int24(v: BigNumberish): Typed; - static int32(v: BigNumberish): Typed; - static int40(v: BigNumberish): Typed; - static int48(v: BigNumberish): Typed; - static int56(v: BigNumberish): Typed; - static int64(v: BigNumberish): Typed; - static int72(v: BigNumberish): Typed; - static int80(v: BigNumberish): Typed; - static int88(v: BigNumberish): Typed; - static int96(v: BigNumberish): Typed; - static int104(v: BigNumberish): Typed; - static int112(v: BigNumberish): Typed; - static int120(v: BigNumberish): Typed; - static int128(v: BigNumberish): Typed; - static int136(v: BigNumberish): Typed; - static int144(v: BigNumberish): Typed; - static int152(v: BigNumberish): Typed; - static int160(v: BigNumberish): Typed; - static int168(v: BigNumberish): Typed; - static int176(v: BigNumberish): Typed; - static int184(v: BigNumberish): Typed; - static int192(v: BigNumberish): Typed; - static int200(v: BigNumberish): Typed; - static int208(v: BigNumberish): Typed; - static int216(v: BigNumberish): Typed; - static int224(v: BigNumberish): Typed; - static int232(v: BigNumberish): Typed; - static int240(v: BigNumberish): Typed; - static int248(v: BigNumberish): Typed; - static int256(v: BigNumberish): Typed; - static int(v: BigNumberish): Typed; - static bytes1(v: BytesLike): Typed; - static bytes2(v: BytesLike): Typed; - static bytes3(v: BytesLike): Typed; - static bytes4(v: BytesLike): Typed; - static bytes5(v: BytesLike): Typed; - static bytes6(v: BytesLike): Typed; - static bytes7(v: BytesLike): Typed; - static bytes8(v: BytesLike): Typed; - static bytes9(v: BytesLike): Typed; - static bytes10(v: BytesLike): Typed; - static bytes11(v: BytesLike): Typed; - static bytes12(v: BytesLike): Typed; - static bytes13(v: BytesLike): Typed; - static bytes14(v: BytesLike): Typed; - static bytes15(v: BytesLike): Typed; - static bytes16(v: BytesLike): Typed; - static bytes17(v: BytesLike): Typed; - static bytes18(v: BytesLike): Typed; - static bytes19(v: BytesLike): Typed; - static bytes20(v: BytesLike): Typed; - static bytes21(v: BytesLike): Typed; - static bytes22(v: BytesLike): Typed; - static bytes23(v: BytesLike): Typed; - static bytes24(v: BytesLike): Typed; - static bytes25(v: BytesLike): Typed; - static bytes26(v: BytesLike): Typed; - static bytes27(v: BytesLike): Typed; - static bytes28(v: BytesLike): Typed; - static bytes29(v: BytesLike): Typed; - static bytes30(v: BytesLike): Typed; - static bytes31(v: BytesLike): Typed; - static bytes32(v: BytesLike): Typed; - static address(v: string | Addressable): Typed; - static bool(v: any): Typed; - static bytes(v: BytesLike): Typed; - static string(v: string): Typed; - static array(v: Array, dynamic?: null | boolean): Typed; - static tuple(v: Array | Record, name?: string): Typed; - static overrides(v: Record): Typed; - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value: any): value is Typed; - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value: Typed | T, type: string): T; -} -//# sourceMappingURL=typed.d.ts.map \ No newline at end of file diff --git a/lib.esm/abi/typed.d.ts.map b/lib.esm/abi/typed.d.ts.map deleted file mode 100644 index 80e5667ff..000000000 --- a/lib.esm/abi/typed.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed.d.ts","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAuBzD,MAAM,WAAW,WAAY,SAAQ,KAAK;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;IACvB,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAY,SAAQ,KAAK;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;IACvB,QAAQ,IAAI,MAAM,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,SAAU,SAAQ,KAAK;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,WAAY,SAAQ,KAAK;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,IAAI,MAAM,CAAC;CACvB;AAID,qBAAa,KAAK;;IACjB,QAAQ,CAAC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;IACD,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,CAE9B;IAED,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,KAAK,CAGnE;IAED,MAAM,CAAC,KAAK,CACX,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK,CAAC,EACnD,IAAI,CAAC,EAAE,MAAM,GACX,KAAK,CAGP;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAE9C;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEzC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAQvD;CACD"} \ No newline at end of file diff --git a/lib.esm/abi/typed.js b/lib.esm/abi/typed.js deleted file mode 100644 index 7316d7736..000000000 --- a/lib.esm/abi/typed.js +++ /dev/null @@ -1,444 +0,0 @@ -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -import { assertPrivate, defineProperties } from "../utils/index.js"; -const _gaurd = {}; -function n(value, width) { - let signed = false; - if (width < 0) { - signed = true; - width *= -1; - } - // @TODO: Check range is valid for value - return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { - signed, - width, - }); -} -function b(value, size) { - // @TODO: Check range is valid for value - return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size }); -} -const _typedSymbol = Symbol.for("_corebc_typed"); -export class Typed { - type; - value; - #options; - _typedSymbol; - constructor(gaurd, type, value, options) { - if (options == null) { - options = null; - } - assertPrivate(_gaurd, gaurd, "Typed"); - defineProperties(this, { _typedSymbol, type, value }); - this.#options = options; - // Check the value is valid - this.format(); - } - format() { - if (this.type === "array") { - throw new Error(""); - } - else if (this.type === "dynamicArray") { - throw new Error(""); - } - else if (this.type === "tuple") { - return `tuple(${this.value.map((v) => v.format()).join(",")})`; - } - return this.type; - } - defaultValue() { - return 0; - } - minValue() { - return 0; - } - maxValue() { - return 0; - } - isBigInt() { - return !!this.type.match(/^u?int[0-9]+$/); - } - isData() { - return this.type.startsWith("bytes"); - } - isString() { - return this.type === "string"; - } - get tupleName() { - if (this.type !== "tuple") { - throw TypeError("not a tuple"); - } - return this.#options; - } - // Returns the length of this type as an array - // - `null` indicates the length is unforced, it could be dynamic - // - `-1` indicates the length is dynamic - // - any other value indicates it is a static array and is its length - get arrayLength() { - if (this.type !== "array") { - throw TypeError("not an array"); - } - if (this.#options === true) { - return -1; - } - if (this.#options === false) { - return this.value.length; - } - return null; - } - static from(type, value) { - return new Typed(_gaurd, type, value); - } - static uint8(v) { - return n(v, 8); - } - static uint16(v) { - return n(v, 16); - } - static uint24(v) { - return n(v, 24); - } - static uint32(v) { - return n(v, 32); - } - static uint40(v) { - return n(v, 40); - } - static uint48(v) { - return n(v, 48); - } - static uint56(v) { - return n(v, 56); - } - static uint64(v) { - return n(v, 64); - } - static uint72(v) { - return n(v, 72); - } - static uint80(v) { - return n(v, 80); - } - static uint88(v) { - return n(v, 88); - } - static uint96(v) { - return n(v, 96); - } - static uint104(v) { - return n(v, 104); - } - static uint112(v) { - return n(v, 112); - } - static uint120(v) { - return n(v, 120); - } - static uint128(v) { - return n(v, 128); - } - static uint136(v) { - return n(v, 136); - } - static uint144(v) { - return n(v, 144); - } - static uint152(v) { - return n(v, 152); - } - static uint160(v) { - return n(v, 160); - } - static uint168(v) { - return n(v, 168); - } - static uint176(v) { - return n(v, 176); - } - static uint184(v) { - return n(v, 184); - } - static uint192(v) { - return n(v, 192); - } - static uint200(v) { - return n(v, 200); - } - static uint208(v) { - return n(v, 208); - } - static uint216(v) { - return n(v, 216); - } - static uint224(v) { - return n(v, 224); - } - static uint232(v) { - return n(v, 232); - } - static uint240(v) { - return n(v, 240); - } - static uint248(v) { - return n(v, 248); - } - static uint256(v) { - return n(v, 256); - } - static uint(v) { - return n(v, 256); - } - static int8(v) { - return n(v, -8); - } - static int16(v) { - return n(v, -16); - } - static int24(v) { - return n(v, -24); - } - static int32(v) { - return n(v, -32); - } - static int40(v) { - return n(v, -40); - } - static int48(v) { - return n(v, -48); - } - static int56(v) { - return n(v, -56); - } - static int64(v) { - return n(v, -64); - } - static int72(v) { - return n(v, -72); - } - static int80(v) { - return n(v, -80); - } - static int88(v) { - return n(v, -88); - } - static int96(v) { - return n(v, -96); - } - static int104(v) { - return n(v, -104); - } - static int112(v) { - return n(v, -112); - } - static int120(v) { - return n(v, -120); - } - static int128(v) { - return n(v, -128); - } - static int136(v) { - return n(v, -136); - } - static int144(v) { - return n(v, -144); - } - static int152(v) { - return n(v, -152); - } - static int160(v) { - return n(v, -160); - } - static int168(v) { - return n(v, -168); - } - static int176(v) { - return n(v, -176); - } - static int184(v) { - return n(v, -184); - } - static int192(v) { - return n(v, -192); - } - static int200(v) { - return n(v, -200); - } - static int208(v) { - return n(v, -208); - } - static int216(v) { - return n(v, -216); - } - static int224(v) { - return n(v, -224); - } - static int232(v) { - return n(v, -232); - } - static int240(v) { - return n(v, -240); - } - static int248(v) { - return n(v, -248); - } - static int256(v) { - return n(v, -256); - } - static int(v) { - return n(v, -256); - } - static bytes1(v) { - return b(v, 1); - } - static bytes2(v) { - return b(v, 2); - } - static bytes3(v) { - return b(v, 3); - } - static bytes4(v) { - return b(v, 4); - } - static bytes5(v) { - return b(v, 5); - } - static bytes6(v) { - return b(v, 6); - } - static bytes7(v) { - return b(v, 7); - } - static bytes8(v) { - return b(v, 8); - } - static bytes9(v) { - return b(v, 9); - } - static bytes10(v) { - return b(v, 10); - } - static bytes11(v) { - return b(v, 11); - } - static bytes12(v) { - return b(v, 12); - } - static bytes13(v) { - return b(v, 13); - } - static bytes14(v) { - return b(v, 14); - } - static bytes15(v) { - return b(v, 15); - } - static bytes16(v) { - return b(v, 16); - } - static bytes17(v) { - return b(v, 17); - } - static bytes18(v) { - return b(v, 18); - } - static bytes19(v) { - return b(v, 19); - } - static bytes20(v) { - return b(v, 20); - } - static bytes21(v) { - return b(v, 21); - } - static bytes22(v) { - return b(v, 22); - } - static bytes23(v) { - return b(v, 23); - } - static bytes24(v) { - return b(v, 24); - } - static bytes25(v) { - return b(v, 25); - } - static bytes26(v) { - return b(v, 26); - } - static bytes27(v) { - return b(v, 27); - } - static bytes28(v) { - return b(v, 28); - } - static bytes29(v) { - return b(v, 29); - } - static bytes30(v) { - return b(v, 30); - } - static bytes31(v) { - return b(v, 31); - } - static bytes32(v) { - return b(v, 32); - } - static address(v) { - return new Typed(_gaurd, "address", v); - } - static bool(v) { - return new Typed(_gaurd, "bool", !!v); - } - static bytes(v) { - return new Typed(_gaurd, "bytes", v); - } - static string(v) { - return new Typed(_gaurd, "string", v); - } - static array(v, dynamic) { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "array", v, dynamic); - } - static tuple(v, name) { - throw new Error("not implemented yet"); - return new Typed(_gaurd, "tuple", v, name); - } - static overrides(v) { - return new Typed(_gaurd, "overrides", Object.assign({}, v)); - } - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value) { - return value && value._typedSymbol === _typedSymbol; - } - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value, type) { - if (Typed.isTyped(value)) { - if (value.type !== type) { - throw new Error(`invalid type: expecetd ${type}, got ${value.type}`); - } - return value.value; - } - return value; - } -} -//# sourceMappingURL=typed.js.map \ No newline at end of file diff --git a/lib.esm/abi/typed.js.map b/lib.esm/abi/typed.js.map deleted file mode 100644 index 0c2c61aa4..000000000 --- a/lib.esm/abi/typed.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed.js","sourceRoot":"","sources":["../../src.ts/abi/typed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOpE,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,CAAC,CAAC,KAAmB,EAAE,KAAa;IAC5C,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACf,MAAM,GAAG,IAAI,CAAC;QACd,KAAK,IAAI,CAAC,CAAC,CAAC;IACb,CAAC;IAED,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,EAAE,EAAE,KAAK,EAAE;QAClE,MAAM;QACN,KAAK;KACL,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,CAAC,KAAgB,EAAE,IAAa;IACzC,wCAAwC;IACxC,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACvE,CAAC;AA0BD,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAEjD,MAAM,OAAO,KAAK;IACR,IAAI,CAAU;IACd,KAAK,CAAO;IAEZ,QAAQ,CAAM;IAEd,YAAY,CAAU;IAE/B,YAAY,KAAU,EAAE,IAAY,EAAE,KAAU,EAAE,OA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MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,SAAS,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YACtE,CAAC;YACD,OAAO,KAAK,CAAC,KAAK,CAAC;QACpB,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/address/checks.d.ts b/lib.esm/address/checks.d.ts deleted file mode 100644 index 865b0aca9..000000000 --- a/lib.esm/address/checks.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Addressable, AddressLike } from "./index.js"; -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.corebc.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -export declare function isAddressable(value: any): value is Addressable; -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -export declare function isAddress(value: any): value is string; -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -export declare function resolveAddress(target: AddressLike): string | Promise; -//# sourceMappingURL=checks.d.ts.map \ No newline at end of file diff --git a/lib.esm/address/checks.d.ts.map b/lib.esm/address/checks.d.ts.map deleted file mode 100644 index 936fbc09c..000000000 --- a/lib.esm/address/checks.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAMrD;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAe5E"} \ No newline at end of file diff --git a/lib.esm/address/checks.js b/lib.esm/address/checks.js deleted file mode 100644 index 9569278c4..000000000 --- a/lib.esm/address/checks.js +++ /dev/null @@ -1,111 +0,0 @@ -import { assert, assertArgument } from "../utils/index.js"; -import { getAddress } from "./index.js"; -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.corebc.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -export function isAddressable(value) { - return value && typeof value.getAddress === "function"; -} -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -export function isAddress(value) { - try { - getAddress(value); - return true; - } - catch (error) { } - return false; -} -async function checkAddress(target, promise) { - const result = await promise; - if (result == null || - result === "0x0000000000000000000000000000000000000000") { - assert(typeof target !== "string", "unconfigured name", "UNCONFIGURED_NAME", { value: target }); - assertArgument(false, "invalid AddressLike value; did not resolve to a value address", "target", target); - } - return getAddress(result); -} -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -export function resolveAddress(target) { - if (typeof target === "string") { - return getAddress(target); - // assert(resolver != null, "ENS resolution requires a provider", - // "UNSUPPORTED_OPERATION", { operation: "resolveName" }); - // return checkAddress(target, resolver.resolveName(target)); - } - else if (isAddressable(target)) { - return checkAddress(target, target.getAddress()); - } - else if (target && typeof target.then === "function") { - return checkAddress(target, target); - } - assertArgument(false, "unsupported addressable value", "target", target); -} -//# sourceMappingURL=checks.js.map \ No newline at end of file diff --git a/lib.esm/address/checks.js.map b/lib.esm/address/checks.js.map deleted file mode 100644 index 68fb59ffa..000000000 --- a/lib.esm/address/checks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checks.js","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAA4B,UAAU,EAAE,MAAM,YAAY,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,KAAU;IACvC,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,CAAC;AACxD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAU;IACnC,IAAI,CAAC;QACJ,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;IAClB,OAAO,KAAK,CAAC;AACd,CAAC;AAED,KAAK,UAAU,YAAY,CAC1B,MAAW,EACX,OAA+B;IAE/B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;IAC7B,IACC,MAAM,IAAI,IAAI;QACd,MAAM,KAAK,4CAA4C,EACtD,CAAC;QACF,MAAM,CACL,OAAO,MAAM,KAAK,QAAQ,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,EAAE,KAAK,EAAE,MAAM,EAAE,CACjB,CAAC;QACF,cAAc,CACb,KAAK,EACL,+DAA+D,EAC/D,QAAQ,EACR,MAAM,CACN,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,cAAc,CAAC,MAAmB;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;QAE1B,iEAAiE;QACjE,8DAA8D;QAE9D,6DAA6D;IAC9D,CAAC;SAAM,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAClD,CAAC;SAAM,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACxD,OAAO,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAED,cAAc,CAAC,KAAK,EAAE,+BAA+B,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC1E,CAAC"} \ No newline at end of file diff --git a/lib.esm/address/contract-address.d.ts b/lib.esm/address/contract-address.d.ts deleted file mode 100644 index 5aaa076ad..000000000 --- a/lib.esm/address/contract-address.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -export declare function getCreateAddress(tx: { - from: string; - nonce: BigNumberish; -}): string; -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -export declare function getCreate2Address(from: string, salt: BytesLike, initCodeHash: BytesLike): string; -//# sourceMappingURL=contract-address.d.ts.map \ No newline at end of file diff --git a/lib.esm/address/contract-address.d.ts.map b/lib.esm/address/contract-address.d.ts.map deleted file mode 100644 index c9b527dd2..000000000 --- a/lib.esm/address/contract-address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,GAAG,MAAM,CAcT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,SAAS,GACrB,MAAM,CAoBR"} \ No newline at end of file diff --git a/lib.esm/address/contract-address.js b/lib.esm/address/contract-address.js deleted file mode 100644 index 62fbbff5f..000000000 --- a/lib.esm/address/contract-address.js +++ /dev/null @@ -1,75 +0,0 @@ -import { concat, -// dataSlice, -getBigInt, -// encodeRlp - } from "../utils/index.js"; -import { getAddress } from "./index.js"; -import { sha256 } from "../crypto/sha3.js"; -import { hexDataLength, hexDataSlice } from "../utils/data.js"; -import { Logger } from "../logger/logger.js"; -import { removeHexPrefix } from "../transaction/address.js"; -import { calculateCheckSum } from "./index.js"; -const logger = new Logger("contract-address/0.0.1"); -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -export function getCreateAddress(tx) { - const from = getAddress(tx.from); - const nonce = getBigInt(tx.nonce, "tx.nonce"); - let nonceHex = nonce.toString(16); - if (nonceHex === "0") { - nonceHex = "0x"; - } - else if (nonceHex.length % 2) { - nonceHex = "0x0" + nonceHex; - } - else { - nonceHex = "0x" + nonceHex; - } - return getAddress(from); -} -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -export function getCreate2Address(from, salt, initCodeHash) { - if (hexDataLength(salt) !== 32) { - logger.throwArgumentError("salt must be 32 bytes", "salt", salt); - } - if (hexDataLength(initCodeHash) !== 32) { - logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash); - } - const val = hexDataSlice(sha256(concat(["0xff", getAddress(from), salt, initCodeHash])), 12); - console.log({ "contract-address/74=>should be string": val }); - const prefix = from.substring(2, 4); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); -} -//# sourceMappingURL=contract-address.js.map \ No newline at end of file diff --git a/lib.esm/address/contract-address.js.map b/lib.esm/address/contract-address.js.map deleted file mode 100644 index 80e46e0ba..000000000 --- a/lib.esm/address/contract-address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract-address.js","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM;AACN,cAAc;AACd,SAAS;A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E,IAAI,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,aAAa,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC;QACxC,MAAM,CAAC,kBAAkB,CACxB,+BAA+B,EAC/B,cAAc,EACd,YAAY,CACZ,CAAC;IACH,CAAC;IAED,MAAM,GAAG,GAAG,YAAY,CACvB,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EAC9D,EAAE,CACF,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,uCAAuC,EAAE,GAAG,EAAE,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC"} \ No newline at end of file diff --git a/lib.esm/address/index.d.ts b/lib.esm/address/index.d.ts deleted file mode 100644 index 180d9faa2..000000000 --- a/lib.esm/address/index.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Addresses are a fundamental part of interacting with Core. They - * represent the gloabal identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Core Naming Service (CNS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -/** - * An interface for objects which have an address, and can - * resolve it asyncronously. - * - * This allows objects such as [[Signer]] or [[Contract]] to - * be used most places an address can be, for example getting - * the [balance](Provider-getBalance). - */ -export interface Addressable { - /** - * Get the object address. - */ - getAddress(): Promise; -} -/** - * Anything that can be used to return or resolve an address. - */ -export type AddressLike = string | Promise | Addressable; -/** - * An interface for any object which can resolve an ENS name. - */ -export interface NameResolver { -} -import { BigNumberish } from "../bigNumber/bigNumber.js"; -declare function calculateCheckSum(_address: string, _prefix: string): string; -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Core uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -declare function getAddress(address: string): string; -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -declare function getIcapAddress(address: string): string; -declare function networkIdToPrefix(networkId: number): string; -declare function getContractAddress(transaction: { - from: string; - nonce: BigNumberish; -}): string; -export { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/address/index.d.ts.map b/lib.esm/address/index.d.ts.map deleted file mode 100644 index 86a6e44f8..000000000 --- a/lib.esm/address/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;CAQ5B;AAED,OAAO,EAAa,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA8BpE,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBpE;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoB3C;AACD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,UAmBA;AAED,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GAClB,CAAC"} \ No newline at end of file diff --git a/lib.esm/address/index.js b/lib.esm/address/index.js deleted file mode 100644 index 87b6fd155..000000000 --- a/lib.esm/address/index.js +++ /dev/null @@ -1,198 +0,0 @@ -/** - * Addresses are a fundamental part of interacting with Core. They - * represent the gloabal identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Core Naming Service (CNS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -null; -import { BigNumber } from "../bigNumber/bigNumber.js"; -import { encode } from "../crypto/rlp.js"; -import { sha256 } from "../crypto/sha3.js"; -import { Logger } from "../logger/logger.js"; -import { arrayify, getBytes, hexDataSlice, hexlify, stripZeros, } from "../utils/data.js"; -const logger = new Logger("address/0.0.1"); -const precompiledAddresses = [ - "0000000000000000000000000000000000000000000000000000000000000000", - "0000000000000000000000000000000000000000000000000000000000000001", - "0000000000000000000000000000000000000000000000000000000000000002", - "0000000000000000000000000000000000000000000000000000000000000003", - "0000000000000000000000000000000000000000000000000000000000000004", - "0000000000000000000000000000000000000000000000000000000000000005", - "0000000000000000000000000000000000000000000000000000000000000006", - "0000000000000000000000000000000000000000000000000000000000000007", - "0000000000000000000000000000000000000000000000000000000000000008", - "0000000000000000000000000000000000000000000000000000000000000009", -]; -function removeHexPrefix(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; -} -function calculateCheckSum(_address, _prefix) { - const address = getBytes("0x" + _address.replace("0x", "")); - const prefix = getBytes("0x" + _prefix.replace("0x", "")); - const tmpConcated = new Uint8Array([...address, ...prefix]); - const hexedConcat = hexlify(tmpConcated).replace("0x", "") + "00"; - const mods = Array.from(hexedConcat.toUpperCase(), (c) => { - const charCode = c.charCodeAt(0); - return charCode > 64 && charCode < 91 - ? (charCode - 55).toString() - : (charCode - 48).toString(); - }).join(""); - const bigVal = BigInt(mods); - const val97 = BigInt(97); - const val98 = BigInt(98); - const remainder = bigVal % val97; - const checkSum = val98 - remainder; - const result = checkSum > 9 ? checkSum.toString() : "0" + checkSum.toString(); - return result; -} -// See: https://en.wikipedia.org/wiki/International_Bank_Account_Number -// Create lookup table -const ibanLookup = {}; -for (let i = 0; i < 10; i++) { - ibanLookup[String(i)] = String(i); -} -for (let i = 0; i < 26; i++) { - ibanLookup[String.fromCharCode(65 + i)] = String(10 + i); -} -// How many decimal digits can we process? (for 64-bit float, this is 15) -// i.e. Math.floor(Math.log10(Number.MAX_SAFE_INTEGER)); -const safeDigits = 15; -function ibanChecksum(address) { - address = address.toUpperCase(); - address = address.substring(4) + address.substring(0, 2) + "00"; - let expanded = address - .split("") - .map((c) => { - return ibanLookup[c]; - }) - .join(""); - // Javascript can handle integers safely up to 15 (decimal) digits - while (expanded.length >= safeDigits) { - let block = expanded.substring(0, safeDigits); - expanded = (parseInt(block, 10) % 97) + expanded.substring(block.length); - } - let checksum = String(98 - (parseInt(expanded, 10) % 97)); - while (checksum.length < 2) { - checksum = "0" + checksum; - } - return checksum; -} -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Core uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -function getAddress(address) { - if (typeof address !== "string") { - logger.throwArgumentError("invalid address", "address", address); - } - if (!address.match(/^(0x)?[0-9a-fA-F]{44}$/)) { - logger.throwArgumentError("invalid address", "address", address); - } - const raw = removeHexPrefix(address); - if (precompiledAddresses.includes(raw)) { - return "0x" + raw; - } - const prefix = raw.substring(0, 2); - const val = raw.substring(4); - const checksum = calculateCheckSum(val, prefix); - if (checksum !== raw.substring(2, 4)) { - logger.throwArgumentError("bad address checksum", "address", address); - } - return "0x" + prefix + checksum + val; -} -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -function getIcapAddress(address) { - //let base36 = _base16To36(getAddress(address).substring(2)).toUpperCase(); - let base36 = BigInt(getAddress(address)).toString(36).toUpperCase(); - while (base36.length < 30) { - base36 = "0" + base36; - } - return "XE" + ibanChecksum("XE00" + base36) + base36; -} -function networkIdToPrefix(networkId) { - if (networkId == 1) { - return "cb"; - } - else if (networkId == 3 || networkId == 4) { - return "ab"; - } - else if (networkId > 10 || networkId == 0) { - return "ce"; - } - else { - logger.throwArgumentError("bad networkId", "networkId", networkId); - return ""; - } -} -function getContractAddress(transaction) { - let from = null; - try { - from = getAddress(transaction.from); - } - catch (error) { - logger.throwArgumentError("missing from address", "transaction", transaction); - } - const nonce = stripZeros(arrayify(BigNumber.from(transaction.nonce).toHexString())); - const val = hexDataSlice(sha256(encode([from, nonce])), 12); - const prefix = from.substring(2, 4); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); -} -export { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, }; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/address/index.js.map b/lib.esm/address/index.js.map deleted file mode 100644 index 39ad12a5c..000000000 --- a/lib.esm/address/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,IAAI,CAAC;AAmCL,OAAO,EAAE,SAAS,EAAgB,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACN,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,UAAU,GACV,MAAM,kBAAkB,CAAC;AAC1B,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC;AAE3C,MAAM,oBAAoB,GAAG;IAC5B,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;IAClE,kEAAkE;CAClE,CAAC;AAEF,SAAS,eAAe,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AAC9D,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAgB,EAAE,OAAe;IAC3D,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;I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AE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAChD,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;AACxD,CAAC;AAED,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GAClB,CAAC"} \ No newline at end of file diff --git a/lib.esm/bigNumber/bigNumber.d.ts b/lib.esm/bigNumber/bigNumber.d.ts deleted file mode 100644 index 089132488..000000000 --- a/lib.esm/bigNumber/bigNumber.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Bytes, Hexable } from "../utils/data.js"; -export type BigNumberish = BigNumber | Bytes | bigint | string | number; -export declare function isBigNumberish(value: any): value is BigNumberish; -export declare class BigNumber implements Hexable { - readonly _hex: string; - readonly _isBigNumber: boolean; - constructor(constructorGuard: any, hex: string); - fromTwos(value: number): BigNumber; - toTwos(value: number): BigNumber; - abs(): BigNumber; - add(other: BigNumberish): BigNumber; - sub(other: BigNumberish): BigNumber; - div(other: BigNumberish): BigNumber; - mul(other: BigNumberish): BigNumber; - mod(other: BigNumberish): BigNumber; - pow(other: BigNumberish): BigNumber; - and(other: BigNumberish): BigNumber; - or(other: BigNumberish): BigNumber; - xor(other: BigNumberish): BigNumber; - mask(value: number): BigNumber; - shl(value: number): BigNumber; - shr(value: number): BigNumber; - eq(other: BigNumberish): boolean; - lt(other: BigNumberish): boolean; - lte(other: BigNumberish): boolean; - gt(other: BigNumberish): boolean; - gte(other: BigNumberish): boolean; - isNegative(): boolean; - isZero(): boolean; - toNumber(): number; - toBigInt(): bigint; - toString(): string; - toHexString(): string; - toJSON(key?: string): any; - static from(value: any): BigNumber; - static isBigNumber(value: any): value is BigNumber; -} -export declare function _base36To16(value: string): string; -export declare function _base16To36(value: string): string; -//# sourceMappingURL=bigNumber.d.ts.map \ No newline at end of file diff --git a/lib.esm/bigNumber/bigNumber.d.ts.map b/lib.esm/bigNumber/bigNumber.d.ts.map deleted file mode 100644 index 5dcf4c8f7..000000000 --- a/lib.esm/bigNumber/bigNumber.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bigNumber.d.ts","sourceRoot":"","sources":["../../src.ts/bigNumber/bigNumber.ts"],"names":[],"mappings":"AAYA,OAAO,EACN,KAAK,EACL,OAAO,EAIP,MAAM,kBAAkB,CAAC;AAS1B,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAExE,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,YAAY,CAUhE;AAKD,qBAAa,SAAU,YAAW,OAAO;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAE/B,YAAY,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAiB7C;IAED,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAEjC;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAE/B;IAED,GAAG,IAAI,SAAS,CAKf;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAElC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAElC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAElC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMjC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAK7B;IAED,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAK5B;IAED,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAK5B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,MAAM,IAAI,OAAO,CAEhB;IAED,QAAQ,IAAI,MAAM,CAQjB;IAED,QAAQ,IAAI,MAAM,CAYjB;IAED,QAAQ,IAAI,MAAM,CAyBjB;IAED,WAAW,IAAI,MAAM,CAEpB;IAED,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAExB;IAED,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAuEjC;IAED,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAEjD;CACD;AA6ED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"} \ No newline at end of file diff --git a/lib.esm/bigNumber/bigNumber.js b/lib.esm/bigNumber/bigNumber.js deleted file mode 100644 index c23a5ab53..000000000 --- a/lib.esm/bigNumber/bigNumber.js +++ /dev/null @@ -1,313 +0,0 @@ -"use strict"; -/** - * BigNumber - * - * A wrapper around the BN.js object. We use the BN.js library - * because it is used by elliptic, so it is required regardless. - * - */ -import _BN from "bn.js"; -import { Logger } from "../logger/logger.js"; -import { isBytes, hexlify, isHexString, } from "../utils/data.js"; -var BN = _BN.BN; -const logger = new Logger("bigNumber/0.0.1"); -const _constructorGuard = {}; -const MAX_SAFE = 0x1fffffffffffff; -export function isBigNumberish(value) { - return (value != null && - (BigNumber.isBigNumber(value) || - (typeof value === "number" && value % 1 === 0) || - (typeof value === "string" && !!value.match(/^-?[0-9]+$/)) || - isHexString(value) || - typeof value === "bigint" || - isBytes(value))); -} -// Only warn about passing 10 into radix once -let _warnedToStringRadix = false; -export class BigNumber { - _hex; - _isBigNumber; - constructor(constructorGuard, hex) { - logger.checkNew(new.target, BigNumber); - if (constructorGuard !== _constructorGuard) { - logger.throwError("cannot call constructor directly; use BigNumber.from", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "new (BigNumber)", - }); - } - this._hex = hex; - this._isBigNumber = true; - Object.freeze(this); - } - fromTwos(value) { - return toBigNumber(toBN(this).fromTwos(value)); - } - toTwos(value) { - return toBigNumber(toBN(this).toTwos(value)); - } - abs() { - if (this._hex[0] === "-") { - return BigNumber.from(this._hex.substring(1)); - } - return this; - } - add(other) { - return toBigNumber(toBN(this).add(toBN(other))); - } - sub(other) { - return toBigNumber(toBN(this).sub(toBN(other))); - } - div(other) { - const o = BigNumber.from(other); - if (o.isZero()) { - throwFault("division by zero", "div"); - } - return toBigNumber(toBN(this).div(toBN(other))); - } - mul(other) { - return toBigNumber(toBN(this).mul(toBN(other))); - } - mod(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot modulo negative values", "mod"); - } - return toBigNumber(toBN(this).umod(value)); - } - pow(other) { - const value = toBN(other); - if (value.isNeg()) { - throwFault("cannot raise to negative values", "pow"); - } - return toBigNumber(toBN(this).pow(value)); - } - and(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'and' negative values", "and"); - } - return toBigNumber(toBN(this).and(value)); - } - or(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'or' negative values", "or"); - } - return toBigNumber(toBN(this).or(value)); - } - xor(other) { - const value = toBN(other); - if (this.isNegative() || value.isNeg()) { - throwFault("cannot 'xor' negative values", "xor"); - } - return toBigNumber(toBN(this).xor(value)); - } - mask(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot mask negative values", "mask"); - } - return toBigNumber(toBN(this).maskn(value)); - } - shl(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shl"); - } - return toBigNumber(toBN(this).shln(value)); - } - shr(value) { - if (this.isNegative() || value < 0) { - throwFault("cannot shift negative values", "shr"); - } - return toBigNumber(toBN(this).shrn(value)); - } - eq(other) { - return toBN(this).eq(toBN(other)); - } - lt(other) { - return toBN(this).lt(toBN(other)); - } - lte(other) { - return toBN(this).lte(toBN(other)); - } - gt(other) { - return toBN(this).gt(toBN(other)); - } - gte(other) { - return toBN(this).gte(toBN(other)); - } - isNegative() { - return this._hex[0] === "-"; - } - isZero() { - return toBN(this).isZero(); - } - toNumber() { - try { - return toBN(this).toNumber(); - } - catch (error) { - throwFault("overflow", "toNumber", this.toString()); - } - // @ts-ignore - return null; - } - toBigInt() { - try { - return BigInt(this.toString()); - } - catch (e) { } - return logger.throwError("this platform does not support BigInt", Logger.errors.UNSUPPORTED_OPERATION, { - value: this.toString(), - }); - } - toString() { - // Lots of people expect this, which we do not support, so check (See: #889) - if (arguments.length > 0) { - if (arguments[0] === 10) { - if (!_warnedToStringRadix) { - _warnedToStringRadix = true; - logger.warn("BigNumber.toString does not accept any parameters; base-10 is assumed"); - } - } - else if (arguments[0] === 16) { - logger.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - else { - logger.throwError("BigNumber.toString does not accept parameters", Logger.errors.UNEXPECTED_ARGUMENT, {}); - } - } - return toBN(this).toString(10); - } - toHexString() { - return this._hex; - } - toJSON(key) { - return { type: "BigNumber", hex: this.toHexString() }; - } - static from(value) { - if (value instanceof BigNumber) { - return value; - } - if (typeof value === "string") { - if (value.match(/^-?0x[0-9a-f]+$/i)) { - return new BigNumber(_constructorGuard, toHex(value)); - } - if (value.match(/^-?[0-9]+$/)) { - return new BigNumber(_constructorGuard, toHex(new BN(value))); - } - return logger.throwArgumentError("invalid BigNumber string", "value", value); - } - if (typeof value === "number") { - if (value % 1) { - throwFault("underflow", "BigNumber.from", value); - } - if (value >= MAX_SAFE || value <= -MAX_SAFE) { - throwFault("overflow", "BigNumber.from", value); - } - return BigNumber.from(String(value)); - } - const anyValue = value; - if (typeof anyValue === "bigint") { - return BigNumber.from(anyValue.toString()); - } - if (isBytes(anyValue)) { - return BigNumber.from(hexlify(anyValue)); - } - if (anyValue) { - // Hexable interface (takes priority) - if (anyValue.toHexString) { - const hex = anyValue.toHexString(); - if (typeof hex === "string") { - return BigNumber.from(hex); - } - } - else { - // For now, handle legacy JSON-ified values (goes away in v6) - let hex = anyValue._hex; - // New-form JSON - if (hex == null && anyValue.type === "BigNumber") { - hex = anyValue.hex; - } - if (typeof hex === "string") { - if (isHexString(hex) || - (hex[0] === "-" && isHexString(hex.substring(1)))) { - return BigNumber.from(hex); - } - } - } - } - return logger.throwArgumentError("invalid BigNumber value", "value", value); - } - static isBigNumber(value) { - return !!(value && value._isBigNumber); - } -} -// Normalize the hex string -// @ts-ignore -function toHex(value) { - // For BN, call on the hex string - if (typeof value !== "string") { - return toHex(value.toString(16)); - } - // If negative, prepend the negative sign to the normalized positive value - if (value[0] === "-") { - // Strip off the negative sign - value = value.substring(1); - // Cannot have multiple negative signs (e.g. "--0x04") - if (value[0] === "-") { - logger.throwArgumentError("invalid hex", "value", value); - } - // Call toHex on the positive component - value = toHex(value); - // Do not allow "-0x00" - if (value === "0x00") { - return value; - } - // Negate the value - return "-" + value; - } - // Add a "0x" prefix if missing - if (value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - // Normalize zero - if (value === "0x") { - return "0x00"; - } - // Make the string even length - if (value.length % 2) { - value = "0x0" + value.substring(2); - } - // Trim to smallest even-length string - while (value.length > 4 && value.substring(0, 4) === "0x00") { - value = "0x" + value.substring(4); - } - return value; -} -// @ts-ignore -function toBigNumber(value) { - return BigNumber.from(toHex(value)); -} -// @ts-ignore -function toBN(value) { - const hex = BigNumber.from(value).toHexString(); - if (hex[0] === "-") { - return new BN("-" + hex.substring(3), 16); - } - return new BN(hex.substring(2), 16); -} -function throwFault(fault, operation, value) { - const params = { fault: fault, operation: operation }; - if (value != null) { - params.value = value; - } - return logger.throwError(fault, Logger.errors.NUMERIC_FAULT, params); -} -// value should have no prefix -export function _base36To16(value) { - return new BN(value, 36).toString(16); -} -// value should have no prefix -export function _base16To36(value) { - return new BN(value, 16).toString(36); -} -//# sourceMappingURL=bigNumber.js.map \ No newline at end of file diff --git a/lib.esm/bigNumber/bigNumber.js.map b/lib.esm/bigNumber/bigNumber.js.map deleted file mode 100644 index 5ceba96a6..000000000 --- a/lib.esm/bigNumber/bigNumber.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bigNumber.js","sourceRoot":"","sources":["../../src.ts/bigNumber/bigNumber.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;GAMG;AAEH,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAGN,OAAO,EACP,OAAO,EACP,WAAW,GACX,MAAM,kBAAkB,CAAC;AAC1B,IAAO,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;AAEnB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAE7C,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAE7B,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AAIlC,MAAM,UAAU,cAAc,CAAC,KAAU;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EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;IAC3D,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACnB,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACtE,CAAC;AAED,8BAA8B;AAC9B,MAAM,UAAU,WAAW,CAAC,KAAa;IACxC,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC;AAED,8BAA8B;AAC9B,MAAM,UAAU,WAAW,CAAC,KAAa;IACxC,OAAO,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC"} \ No newline at end of file diff --git a/lib.esm/cip/custom-units.d.ts b/lib.esm/cip/custom-units.d.ts deleted file mode 100644 index 58031982f..000000000 --- a/lib.esm/cip/custom-units.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { AddressLike } from "../address/index.js"; -import { Contract } from "../contract/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -export declare const customUnitAbi: readonly string[]; -export declare class CustomUnitDiscovery { - readonly preferredUnit: string; - readonly supportedUnits: readonly string[]; - constructor(units: readonly string[], preferredUnit: string); - get isValid(): boolean; - supports(unit: string): boolean; -} -/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ -export declare class CustomUnitBalance { - readonly canonicalAmount: bigint; - readonly unitAmount: bigint; - readonly unit: string; - constructor(canonicalAmount: bigint, unitAmount: bigint, unit: string); - get multiplierNumerator(): bigint; - get multiplierDenominator(): bigint; -} -/** Core custom-unit contract convention used by Tone and Core API. */ -export declare class CustomUnitToken { - readonly contract: Contract; - constructor(address: string, runner: ContractRunner); - supportsUnit(unit: string, blockTag?: BlockTag): Promise; - supportedUnits(blockTag?: BlockTag): Promise; - preferredUnit(blockTag?: BlockTag): Promise; - discover(blockTag?: BlockTag): Promise; - canonicalBalance(account: AddressLike, blockTag?: BlockTag): Promise; - balanceOfUnit(account: AddressLike, unit: string, blockTag?: BlockTag): Promise; - balance(account: AddressLike, unit?: string, blockTag?: BlockTag): Promise; -} -//# sourceMappingURL=custom-units.d.ts.map \ No newline at end of file diff --git a/lib.esm/cip/custom-units.d.ts.map b/lib.esm/cip/custom-units.d.ts.map deleted file mode 100644 index 69faaea75..000000000 --- a/lib.esm/cip/custom-units.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"custom-units.d.ts","sourceRoot":"","sources":["../../src.ts/cip/custom-units.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,eAAO,MAAM,aAAa,mBAMxB,CAAC;AACH,qBAAa,mBAAmB;IAI9B,QAAQ,CAAC,aAAa,EAAE,MAAM;IAH/B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,YACC,KAAK,EAAE,SAAS,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,EAG9B;IACD,IAAI,OAAO,IAAI,OAAO,CAMrB;IACD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9B;CACD;AACD,iFAAiF;AACjF,qBAAa,iBAAiB;IAE5B,QAAQ,CAAC,eAAe,EAAE,MAAM;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM;IAHtB,YACU,eAAe,EAAE,MAAM,EACvB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAClB;IACJ,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IACD,IAAI,qBAAqB,IAAI,MAAM,CAElC;CACD;AACD,sEAAsE;AACtE,qBAAa,eAAe;IAC3B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,YAAY,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAElD;IACK,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAKtE;IACK,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAIpE;IACK,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAExD;IACK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAOvE;IACD,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3E;IACD,aAAa,CACZ,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,CAAC,CAGjB;IACK,OAAO,CACZ,OAAO,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAO5B;CACD"} \ No newline at end of file diff --git a/lib.esm/cip/custom-units.js b/lib.esm/cip/custom-units.js deleted file mode 100644 index e163cfff3..000000000 --- a/lib.esm/cip/custom-units.js +++ /dev/null @@ -1,81 +0,0 @@ -import { Contract } from "../contract/index.js"; -export const customUnitAbi = Object.freeze([ - "function supportsUnit(string unit) view returns (bool)", - "function supportedUnits() view returns (string[])", - "function preferredUnit() view returns (string)", - "function balanceOf(address account) view returns (uint256)", - "function balanceOfUnit(address account, string unit) view returns (uint256)", -]); -export class CustomUnitDiscovery { - preferredUnit; - supportedUnits; - constructor(units, preferredUnit) { - this.preferredUnit = preferredUnit; - this.supportedUnits = Object.freeze([...units]); - } - get isValid() { - return (this.supports("units") && - this.preferredUnit !== "" && - this.supports(this.preferredUnit)); - } - supports(unit) { - return this.supportedUnits.includes(unit); - } -} -/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ -export class CustomUnitBalance { - canonicalAmount; - unitAmount; - unit; - constructor(canonicalAmount, unitAmount, unit) { - this.canonicalAmount = canonicalAmount; - this.unitAmount = unitAmount; - this.unit = unit; - } - get multiplierNumerator() { - return this.unitAmount; - } - get multiplierDenominator() { - return this.canonicalAmount; - } -} -/** Core custom-unit contract convention used by Tone and Core API. */ -export class CustomUnitToken { - contract; - constructor(address, runner) { - this.contract = new Contract(address, customUnitAbi, runner); - } - async supportsUnit(unit, blockTag) { - return (unit.trim() !== "" && - (await this.contract.supportsUnit(unit.trim(), { blockTag }))); - } - async supportedUnits(blockTag) { - return Object.freeze(Array.from(await this.contract.supportedUnits({ blockTag }))); - } - async preferredUnit(blockTag) { - return (await this.contract.preferredUnit({ blockTag })).trim(); - } - async discover(blockTag) { - if (!(await this.supportsUnit("units", blockTag))) - return null; - const discovery = new CustomUnitDiscovery(await this.supportedUnits(blockTag), await this.preferredUnit(blockTag)); - return discovery.isValid ? discovery : null; - } - canonicalBalance(account, blockTag) { - return this.contract.balanceOf(account, { blockTag }); - } - balanceOfUnit(account, unit, blockTag) { - if (!unit.trim()) - throw new TypeError("unit must not be empty"); - return this.contract.balanceOfUnit(account, unit.trim(), { blockTag }); - } - async balance(account, unit, blockTag) { - const resolved = unit?.trim() || (await this.preferredUnit(blockTag)); - const [canonical, calculated] = await Promise.all([ - this.canonicalBalance(account, blockTag), - this.balanceOfUnit(account, resolved, blockTag), - ]); - return new CustomUnitBalance(canonical, calculated, resolved); - } -} -//# sourceMappingURL=custom-units.js.map \ No newline at end of file diff --git a/lib.esm/cip/custom-units.js.map b/lib.esm/cip/custom-units.js.map deleted file mode 100644 index 3f4c37e22..000000000 --- a/lib.esm/cip/custom-units.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"custom-units.js","sourceRoot":"","sources":["../../src.ts/cip/custom-units.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,wDAAwD;IACxD,mDAAmD;IACnD,gDAAgD;IAChD,4DAA4D;IAC5D,6EAA6E;CAC7E,CAAC,CAAC;AACH,MAAM,OAAO,mBAAmB;IAIrB,aAAa;IAHd,cAAc,CAAoB;IAC3C,YACC,KAAwB,EACf,aAAqB;6BAArB,aAAa;QAEtB,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,IAAI,OAAO;QACV,OAAO,CACN,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;YACtB,IAAI,CAAC,aAAa,KAAK,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CACjC,CAAC;IACH,CAAC;IACD,QAAQ,CAAC,IAAY;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;CACD;AACD,iFAAiF;AACjF,MAAM,OAAO,iBAAiB;IAEnB,eAAe;IACf,UAAU;IACV,IAAI;IAHd,YACU,eAAuB,EACvB,UAAkB,EAClB,IAAY;+BAFZ,eAAe;0BACf,UAAU;oBACV,IAAI;IACX,CAAC;IACJ,IAAI,mBAAmB;QACtB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IACD,IAAI,qBAAqB;QACxB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;CACD;AACD,sEAAsE;AACtE,MAAM,OAAO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AC,SAAS,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,aAAa,CACZ,OAAoB,EACpB,IAAY,EACZ,QAAmB;QAEnB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;YAAE,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,KAAK,CAAC,OAAO,CACZ,OAAoB,EACpB,IAAa,EACb,QAAmB;QAEnB,MAAM,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtE,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACjD,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC;YACxC,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC;SAC/C,CAAC,CAAC;QACH,OAAO,IAAI,iBAAiB,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/D,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/cip/index.d.ts b/lib.esm/cip/index.d.ts deleted file mode 100644 index cdd86e31b..000000000 --- a/lib.esm/cip/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Contract } from "../contract/index.js"; -import type { Overrides, ContractTransactionResponse } from "../contract/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -import { IpfsGateway } from "../ipfs/index.js"; -/** On-chain interface defined by CIP-150. */ -export declare const cip150Abi: readonly string[]; -export interface Cip150MetadataEntry { - readonly key: string; - readonly value: string; - readonly sealed?: boolean; -} -export declare const cip151TokenExpirationKey = "tokenExpiration"; -export declare const cip151TradingStopKey = "tradingStop"; -export declare const cip152LabKey = "lab"; -/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ -export declare class Cip151Lifecycle { - readonly tokenExpiration: bigint | null; - readonly tradingStop: bigint | null; - constructor(metadata?: Readonly>); - isExpiredAt(seconds: bigint): boolean; - isTradingStoppedAt(seconds: bigint): boolean; -} -export interface Cip152LabMeasurement { - readonly value: string | number; - readonly unit?: string; -} -/** Validates certificate structure, not the authenticity of its issuer. */ -export declare class Cip152LabCertificate { - readonly measurements: Readonly>; - constructor(json: unknown); -} -/** Typed metadata reader and writer. Writes require a signer as runner. */ -export declare class Cip150MetadataContract { - readonly contract: Contract; - constructor(address: string, runner: ContractRunner); - getValue(key: string, blockTag?: BlockTag): Promise; - hasKey(key: string, blockTag?: BlockTag): Promise; - isSealed(key: string, blockTag?: BlockTag): Promise; - listKeys(blockTag?: BlockTag): Promise; - getByIndex(index: bigint, blockTag?: BlockTag): Promise; - count(blockTag?: BlockTag): Promise; - readAll(blockTag?: BlockTag, includeSealedState?: boolean): Promise; - setValue(key: string, value: string, overrides?: Overrides): Promise; - sealKey(key: string, overrides?: Overrides): Promise; - readLifecycle(blockTag?: BlockTag): Promise; - readLabCertificate(gateway: IpfsGateway, blockTag?: BlockTag): Promise; -} -export { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from "./custom-units.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/cip/index.d.ts.map b/lib.esm/cip/index.d.ts.map deleted file mode 100644 index d0120ee3c..000000000 --- a/lib.esm/cip/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/cip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EACX,SAAS,EACT,2BAA2B,EAC3B,MAAM,sBAAsB,CAAC;AAC9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M,mBAAmB,CAAC"} \ No newline at end of file diff --git a/lib.esm/cip/index.js b/lib.esm/cip/index.js deleted file mode 100644 index d597ed10a..000000000 --- a/lib.esm/cip/index.js +++ /dev/null @@ -1,124 +0,0 @@ -import { Contract } from "../contract/index.js"; -/** On-chain interface defined by CIP-150. */ -export const cip150Abi = Object.freeze([ - "function getMetadataValue(string key) view returns (string value)", - "function hasMetadataKey(string key) view returns (bool exists)", - "function isMetadataSealed(string key) view returns (bool sealed)", - "function listMetadataKeys() view returns (string[] keys)", - "function getMetadataByIndex(uint256 index) view returns (string key, string value)", - "function metadataCount() view returns (uint256 total)", - "function setMetadataValue(string key, string value)", - "function sealMetadataKey(string key)", -]); -export const cip151TokenExpirationKey = "tokenExpiration"; -export const cip151TradingStopKey = "tradingStop"; -export const cip152LabKey = "lab"; -/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ -export class Cip151Lifecycle { - tokenExpiration; - tradingStop; - constructor(metadata = {}) { - const parse = (key) => { - const value = metadata[key]; - if (value == null || value === "") - return null; - if (!/^\d+$/.test(value)) - throw new TypeError(`${key} must be a non-negative Unix timestamp`); - return BigInt(value); - }; - this.tokenExpiration = parse(cip151TokenExpirationKey); - this.tradingStop = parse(cip151TradingStopKey); - } - isExpiredAt(seconds) { - return this.tokenExpiration !== null && seconds >= this.tokenExpiration; - } - isTradingStoppedAt(seconds) { - return this.tradingStop !== null && seconds >= this.tradingStop; - } -} -/** Validates certificate structure, not the authenticity of its issuer. */ -export class Cip152LabCertificate { - measurements; - constructor(json) { - if (json === null || typeof json !== "object" || Array.isArray(json)) - throw new TypeError("CIP-152 lab.json must be an object"); - const measurements = Object.create(null); - for (const [key, property] of Object.entries(json)) { - if (!property || - typeof property !== "object" || - Array.isArray(property) || - !Object.hasOwn(property, "value")) - throw new TypeError(`CIP-152 property ${key} must contain a value`); - const { value, unit } = property; - if (!(typeof value === "string" || - (typeof value === "number" && Number.isFinite(value)))) - throw new TypeError(`CIP-152 property ${key} has an invalid value`); - if (unit != null && typeof unit !== "string") - throw new TypeError(`CIP-152 property ${key} has an invalid unit`); - measurements[key] = Object.freeze(unit == null ? { value } : { value, unit }); - } - this.measurements = Object.freeze(measurements); - } -} -/** Typed metadata reader and writer. Writes require a signer as runner. */ -export class Cip150MetadataContract { - contract; - constructor(address, runner) { - this.contract = new Contract(address, cip150Abi, runner); - } - getValue(key, blockTag) { - return this.contract.getMetadataValue(key, { blockTag }); - } - hasKey(key, blockTag) { - return this.contract.hasMetadataKey(key, { blockTag }); - } - isSealed(key, blockTag) { - return this.contract.isMetadataSealed(key, { blockTag }); - } - async listKeys(blockTag) { - return Object.freeze(Array.from(await this.contract.listMetadataKeys({ blockTag }))); - } - async getByIndex(index, blockTag) { - const [key, value] = await this.contract.getMetadataByIndex(index, { - blockTag, - }); - return Object.freeze({ key, value }); - } - count(blockTag) { - return this.contract.metadataCount({ blockTag }); - } - async readAll(blockTag, includeSealedState = true) { - const entries = []; - for (const key of await this.listKeys(blockTag)) { - const value = await this.getValue(key, blockTag); - entries.push(Object.freeze(includeSealedState - ? { key, value, sealed: await this.isSealed(key, blockTag) } - : { key, value })); - } - return Object.freeze(entries); - } - setValue(key, value, overrides = {}) { - return this.contract.setMetadataValue(key, value, overrides); - } - sealKey(key, overrides = {}) { - return this.contract.sealMetadataKey(key, overrides); - } - async readLifecycle(blockTag) { - const metadata = {}; - for (const key of [cip151TokenExpirationKey, cip151TradingStopKey]) { - if (await this.hasKey(key, blockTag)) - metadata[key] = await this.getValue(key, blockTag); - } - return new Cip151Lifecycle(metadata); - } - async readLabCertificate(gateway, blockTag) { - if (!(await this.hasKey(cip152LabKey, blockTag))) - return null; - const reference = await this.getValue(cip152LabKey, blockTag); - if (!gateway.resolve(reference).pathname.endsWith("/lab.json")) - throw new TypeError("CIP-152 reference must point to lab.json"); - return new Cip152LabCertificate(await gateway.readJson(reference)); - } -} -export { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from "./custom-units.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/cip/index.js.map b/lib.esm/cip/index.js.map deleted file mode 100644 index 524f8bba1..000000000 --- a/lib.esm/cip/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/cip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAQhD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,mEAAmE;IACnE,gEAAgE;IAChE,kEAAkE;IAClE,0DAA0D;IAC1D,oFAAoF;IACpF,uDAAuD;IACvD,qDAAqD;IACrD,sCAAsC;CACtC,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC;AAElC,iFAAiF;AACjF,MAAM,OAAO,eAAe;IAClB,eAAe,CAAgB;IAC/B,WAAW,CAAgB;IACpC,YAAY,QAAQ,GAAqC,EAAE;QAC1D,MAAM,KAAK,GAAG,CAAC,GAAW,EAAiB,EAAE;YAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC5B,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE;gBAAE,OAAO,IAAI,CAAC;YAC/C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;gBACvB,MAAM,IAAI,SAAS,CAAC,GAAG,GAAG,wCAAwC,CAAC,CAAC;YACrE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;QACvD,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAChD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AAC,aAAa,CAAC,QAAmB;QACtC,MAAM,QAAQ,GAA2B,EAAE,CAAC;QAC5C,KAAK,MAAM,GAAG,IAAI,CAAC,wBAAwB,EAAE,oBAAoB,CAAC,EAAE,CAAC;YACpE,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,QAAQ,CAAC;gBACnC,QAAQ,CAAC,GAAG,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IACD,KAAK,CAAC,kBAAkB,CACvB,OAAoB,EACpB,QAAmB;QAEnB,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;QAC9D,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAC9D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC;YAC7D,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;QACjE,OAAO,IAAI,oBAAoB,CAAC,MAAM,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACpE,CAAC;CACD;AACD,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACb,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/addresses.d.ts b/lib.esm/constants/addresses.d.ts deleted file mode 100644 index a32d6be03..000000000 --- a/lib.esm/constants/addresses.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -export declare const ZeroAddress: string; -//# sourceMappingURL=addresses.d.ts.map \ No newline at end of file diff --git a/lib.esm/constants/addresses.d.ts.map b/lib.esm/constants/addresses.d.ts.map deleted file mode 100644 index a67118b65..000000000 --- a/lib.esm/constants/addresses.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src.ts/constants/addresses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAqD,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/addresses.js b/lib.esm/constants/addresses.js deleted file mode 100644 index 45345cb6e..000000000 --- a/lib.esm/constants/addresses.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -export const ZeroAddress = "0x0000000000000000000000000000000000000000"; -//# sourceMappingURL=addresses.js.map \ No newline at end of file diff --git a/lib.esm/constants/addresses.js.map b/lib.esm/constants/addresses.js.map deleted file mode 100644 index 97fc7dc5f..000000000 --- a/lib.esm/constants/addresses.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.js","sourceRoot":"","sources":["../../src.ts/constants/addresses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAW,4CAA4C,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/hashes.d.ts b/lib.esm/constants/hashes.d.ts deleted file mode 100644 index 784df7156..000000000 --- a/lib.esm/constants/hashes.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -export declare const ZeroHash: string; -//# sourceMappingURL=hashes.d.ts.map \ No newline at end of file diff --git a/lib.esm/constants/hashes.d.ts.map b/lib.esm/constants/hashes.d.ts.map deleted file mode 100644 index 225420a8c..000000000 --- a/lib.esm/constants/hashes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAC8C,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/hashes.js b/lib.esm/constants/hashes.js deleted file mode 100644 index 95bca98a9..000000000 --- a/lib.esm/constants/hashes.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -export const ZeroHash = "0x0000000000000000000000000000000000000000000000000000000000000000"; -//# sourceMappingURL=hashes.js.map \ No newline at end of file diff --git a/lib.esm/constants/hashes.js.map b/lib.esm/constants/hashes.js.map deleted file mode 100644 index 97cb925f5..000000000 --- a/lib.esm/constants/hashes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hashes.js","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GACpB,oEAAoE,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/index.d.ts b/lib.esm/constants/index.d.ts deleted file mode 100644 index ba9ae1821..000000000 --- a/lib.esm/constants/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Some common constants useful for Core. - * - * @_section: api/constants: Constants [about-constants] - */ -export { ZeroAddress } from "./addresses.js"; -export { ZeroHash } from "./hashes.js"; -export { N, NegativeOne, Zero, One, Two, OrePerXCB, MaxUint256, MinInt256, MaxInt256, } from "./numbers.js"; -export { CoreSymbol, MessagePrefix } from "./strings.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/constants/index.d.ts.map b/lib.esm/constants/index.d.ts.map deleted file mode 100644 index d703c7245..000000000 --- a/lib.esm/constants/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/index.js b/lib.esm/constants/index.js deleted file mode 100644 index aed133686..000000000 --- a/lib.esm/constants/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Some common constants useful for Core. - * - * @_section: api/constants: Constants [about-constants] - */ -export { ZeroAddress } from "./addresses.js"; -export { ZeroHash } from "./hashes.js"; -export { N, NegativeOne, Zero, One, Two, OrePerXCB, MaxUint256, MinInt256, MaxInt256, } from "./numbers.js"; -export { CoreSymbol, MessagePrefix } from "./strings.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/constants/index.js.map b/lib.esm/constants/index.js.map deleted file mode 100644 index c114a0d0a..000000000 --- a/lib.esm/constants/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/numbers.d.ts b/lib.esm/constants/numbers.d.ts deleted file mode 100644 index ac92f9623..000000000 --- a/lib.esm/constants/numbers.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -export declare const N: bigint; -/** - * A constant for the number of ore in a single xcb. - * - * (**i.e.** ``1000000000000000000n``) - */ -export declare const OrePerXCB: bigint; -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxUint256: bigint; -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -export declare const MinInt256: bigint; -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxInt256: bigint; -export declare const NegativeOne: bigint; -export declare const Zero: bigint; -export declare const One: bigint; -export declare const Two: bigint; -//# sourceMappingURL=numbers.d.ts.map \ No newline at end of file diff --git a/lib.esm/constants/numbers.d.ts.map b/lib.esm/constants/numbers.d.ts.map deleted file mode 100644 index 927678af4..000000000 --- a/lib.esm/constants/numbers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAEf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEb,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAiC,CAAC;AAC5D,eAAO,MAAM,IAAI,EAAE,MAAgC,CAAC;AACpD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC;AACnD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/numbers.js b/lib.esm/constants/numbers.js deleted file mode 100644 index 6f3d47e93..000000000 --- a/lib.esm/constants/numbers.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -export const N = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); -/** - * A constant for the number of ore in a single xcb. - * - * (**i.e.** ``1000000000000000000n``) - */ -export const OrePerXCB = BigInt("1000000000000000000"); -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export const MaxUint256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -export const MinInt256 = BigInt("0x8000000000000000000000000000000000000000000000000000000000000000") * - BigInt(-1); -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export const MaxInt256 = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -export const NegativeOne = /*#__PURE__*/ BigInt(-1); -export const Zero = /*#__PURE__*/ BigInt(0); -export const One = /*#__PURE__*/ BigInt(1); -export const Two = /*#__PURE__*/ BigInt(2); -//# sourceMappingURL=numbers.js.map \ No newline at end of file diff --git a/lib.esm/constants/numbers.js.map b/lib.esm/constants/numbers.js.map deleted file mode 100644 index 993fb0f41..000000000 --- a/lib.esm/constants/numbers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"numbers.js","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,CAAC,GAAW,MAAM,CAC9B,oEAAoE,CACpE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAW,MAAM,CACvC,oEAAoE,CACpE,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GACrB,MAAM,CAAC,oEAAoE,CAAC;IAC5E,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEZ;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAW,MAAM,CACtC,oEAAoE,CACpE,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,IAAI,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACpD,MAAM,CAAC,MAAM,GAAG,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACnD,MAAM,CAAC,MAAM,GAAG,GAAW,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/strings.d.ts b/lib.esm/constants/strings.d.ts deleted file mode 100644 index 164253121..000000000 --- a/lib.esm/constants/strings.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A constant for the core symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -export declare const CoreSymbol: string; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Core Signed Message:\\n"``) - */ -export declare const MessagePrefix: string; -//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/lib.esm/constants/strings.d.ts.map b/lib.esm/constants/strings.d.ts.map deleted file mode 100644 index 788cc8ce6..000000000 --- a/lib.esm/constants/strings.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src.ts/constants/strings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAiB,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAqC,CAAC"} \ No newline at end of file diff --git a/lib.esm/constants/strings.js b/lib.esm/constants/strings.js deleted file mode 100644 index d2ff152ab..000000000 --- a/lib.esm/constants/strings.js +++ /dev/null @@ -1,14 +0,0 @@ -// NFKC (composed) // (decomposed) -/** - * A constant for the core symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -export const CoreSymbol = "\u039e"; // "\uD835\uDF63"; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Core Signed Message:\\n"``) - */ -export const MessagePrefix = "\x19Core Signed Message:\n"; -//# sourceMappingURL=strings.js.map \ No newline at end of file diff --git a/lib.esm/constants/strings.js.map b/lib.esm/constants/strings.js.map deleted file mode 100644 index 5b867e346..000000000 --- a/lib.esm/constants/strings.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.js","sourceRoot":"","sources":["../../src.ts/constants/strings.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAE9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAW,QAAQ,CAAC,CAAC,kBAAkB;AAE9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAW,4BAA4B,CAAC"} \ No newline at end of file diff --git a/lib.esm/contract/contract.d.ts b/lib.esm/contract/contract.d.ts deleted file mode 100644 index 637e513de..000000000 --- a/lib.esm/contract/contract.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Indexed, Interface } from "../abi/index.js"; -import { Log, TransactionResponse } from "../providers/provider.js"; -import { ContractTransactionResponse, EventLog } from "./wrappers.js"; -import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js"; -import type { Addressable } from "../address/index.js"; -import type { EventEmitterable, Listener } from "../utils/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction, WrappedFallback } from "./types.js"; -/** - * @_ignore: - */ -export declare function copyOverrides(arg: any, allowed?: Array): Promise>; -/** - * @_ignore: - */ -export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray, args: Array): Promise>; -declare const internal: unique symbol; -export declare class BaseContract implements Addressable, EventEmitterable { - readonly target: string | Addressable; - readonly interface: Interface; - readonly runner: null | ContractRunner; - readonly filters: Record; - readonly [internal]: any; - readonly fallback: null | WrappedFallback; - constructor(target: string | Addressable, abi: Interface | InterfaceAbi, runner?: null | ContractRunner, _deployTx?: null | TransactionResponse); - connect(runner: null | ContractRunner): BaseContract; - getAddress(): Promise; - getDeployedCode(): Promise; - waitForDeployment(): Promise; - deploymentTransaction(): null | ContractTransactionResponse; - getFunction(key: string | FunctionFragment): T; - getEvent(key: string | EventFragment): ContractEvent; - queryTransaction(hash: string): Promise>; - queryFilter(event: ContractEventName, fromBlock?: BlockTag, toBlock?: BlockTag): Promise>; - on(event: ContractEventName, listener: Listener): Promise; - once(event: ContractEventName, listener: Listener): Promise; - emit(event: ContractEventName, ...args: Array): Promise; - listenerCount(event?: ContractEventName): Promise; - listeners(event?: ContractEventName): Promise>; - off(event: ContractEventName, listener?: Listener): Promise; - removeAllListeners(event?: ContractEventName): Promise; - addListener(event: ContractEventName, listener: Listener): Promise; - removeListener(event: ContractEventName, listener: Listener): Promise; - static buildClass(abi: InterfaceAbi): new (target: string, runner?: null | ContractRunner) => BaseContract & Omit; - static from(target: string, abi: InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit; - static isIndexed(value: any): value is Indexed; -} -declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: null | ContractRunner) => BaseContract & Omit; -export declare class Contract extends Contract_base { -} -export {}; -//# sourceMappingURL=contract.d.ts.map \ No newline at end of file diff --git a/lib.esm/contract/contract.d.ts.map b/lib.esm/contract/contract.d.ts.map deleted file mode 100644 index 93e959992..000000000 --- a/lib.esm/contract/contract.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAEN,GAAG,EACH,mBAAmB,EACnB,MAAM,0BAA0B,CAAC;AAWlC,OAAO,EAGN,2BAA2B,EAC3B,QAAQ,EACR,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACX,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,SAAS,EAET,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EACX,QAAQ,EACR,cAAc,EAId,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAEX,iBAAiB,EACjB,iBAAiB,EAEjB,cAAc,EAEd,aAAa,EACb,mBAAmB,EAEnB,eAAe,EACf,MAAM,YAAY,CAAC;AA2GpB;;GAEG;AACH,wBAAsB,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,IAAI,EACnE,GAAG,EAAE,GAAG,EACR,OAAO,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GACrB,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,CAuBvC;AAED;;GAEG;AACH,wBAAsB,WAAW,CAChC,OAAO,EAAE,IAAI,GAAG,cAAc,EAC9B,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAChC,IAAI,EAAE,KAA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AAc,KAC1B,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAO9C;IAED,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,EAChC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,GAC5B,YAAY,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAM5C;IACD,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,OAAO,CAE7C;CACD;0CAGQ,MAAM,OACT,YAAY,WACR,IAAI,GAAG,cAAc,KAC1B,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/D,qBAAa,QAAS,SAAQ,aAAe;CAAG"} \ No newline at end of file diff --git a/lib.esm/contract/contract.js b/lib.esm/contract/contract.js deleted file mode 100644 index 9b6b6db26..000000000 --- a/lib.esm/contract/contract.js +++ /dev/null @@ -1,784 +0,0 @@ -import { Indexed, Interface, Typed } from "../abi/index.js"; -import { resolveAddress } from "../address/checks.js"; -import { copyRequest, Log, } from "../providers/provider.js"; -import { defineProperties, isCallException, isHexString, resolveProperties, makeError, assert, assertArgument, } from "../utils/index.js"; -import { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionResponse, EventLog, } from "./wrappers.js"; -const BN_0 = BigInt(0); -function canCall(value) { - return value && typeof value.call === "function"; -} -function canEstimate(value) { - return value && typeof value.estimateEnergy === "function"; -} -function canResolve(value) { - return value && typeof value.resolveName === "function"; -} -function canSend(value) { - return value && typeof value.sendTransaction === "function"; -} -class PreparedTopicFilter { - #filter; - fragment; - constructor(contract, fragment, args) { - defineProperties(this, { fragment }); - if (fragment.inputs.length < args.length) { - throw new Error("too many arguments"); - } - // Recursively descend into args and resolve any addresses - this.#filter = (async function () { - const resolvedArgs = await Promise.all(fragment.inputs.map((param, index) => { - const arg = args[index]; - if (arg == null) { - return null; - } - return param.walkAsync(args[index], (type, value) => { - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - })); - return contract.interface.encodeFilterTopics(fragment, resolvedArgs); - })(); - } - getTopicFilter() { - return this.#filter; - } -} -// A = Arguments passed in as a tuple -// R = The result type of the call (i.e. if only one return type, -// the qualified type, otherwise Result) -// D = The type the default call will return (i.e. R for view/pure, -// TransactionResponse otherwise) -//export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = ContractTransactionResponse> { -function getRunner(value, feature) { - if (value == null) { - return null; - } - if (typeof value[feature] === "function") { - return value; - } - if (value.provider && typeof value.provider[feature] === "function") { - return value.provider; - } - return null; -} -function getProvider(value) { - if (value == null) { - return null; - } - return value.provider || null; -} -/** - * @_ignore: - */ -export async function copyOverrides(arg, allowed) { - // Create a shallow copy (we'll deep-ify anything needed during normalizing) - const overrides = copyRequest(Typed.dereference(arg, "overrides")); - assertArgument(overrides.to == null || (allowed || []).indexOf("to") >= 0, "cannot override to", "overrides.to", overrides.to); - assertArgument(overrides.data == null || (allowed || []).indexOf("data") >= 0, "cannot override data", "overrides.data", overrides.data); - // Resolve any from - if (overrides.from) { - overrides.from = await resolveAddress(overrides.from); - } - return overrides; -} -/** - * @_ignore: - */ -export async function resolveArgs(_runner, inputs, args) { - // Recursively descend into args and resolve any addresses - return await Promise.all(inputs.map((param, index) => { - return param.walkAsync(args[index], (type, value) => { - value = Typed.dereference(value, type); - if (type === "address") { - return resolveAddress(value); - } - return value; - }); - })); -} -function buildWrappedFallback(contract) { - const populateTransaction = async function (overrides) { - // If an overrides was passed in, copy it and normalize the values - const tx = (await copyOverrides(overrides, ["data"])); - tx.to = await contract.getAddress(); - const iface = contract.interface; - // Only allow payable contracts to set non-zero value - const payable = iface.receive || (iface.fallback && iface.fallback.payable); - assertArgument(payable || (tx.value || BN_0) === BN_0, "cannot send value to non-payable contract", "overrides.value", tx.value); - // Only allow fallback contracts to set non-empty data - assertArgument(iface.fallback || (tx.data || "0x") === "0x", "cannot send data to receive-only contract", "overrides.data", tx.data); - return tx; - }; - const staticCall = async function (overrides) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(overrides); - try { - return await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - }; - const send = async function (overrides) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(overrides)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (overrides) { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(overrides)); - }; - const method = async (overrides) => { - return await send(overrides); - }; - defineProperties(method, { - _contract: contract, - estimateEnergy, - populateTransaction, - send, - staticCall, - }); - return method; -} -function buildWrappedMethod(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getFunction(key, args); - assert(fragment, "no matching fragment in getFragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const populateTransaction = async function (...args) { - const fragment = getFragment(...args); - // If an overrides was passed in, copy it and normalize the values - let overrides = {}; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("internal error: fragment inputs doesn't match arguments; should not happen"); - } - const resolvedArgs = await resolveArgs(contract.runner, fragment.inputs, args); - return Object.assign({}, overrides, await resolveProperties({ - to: contract.getAddress(), - data: contract.interface.encodeFunctionData(fragment, resolvedArgs), - })); - }; - const staticCall = async function (...args) { - const result = await staticCallResult(...args); - if (result.length === 1) { - return result[0]; - } - return result; - }; - const send = async function (...args) { - const runner = contract.runner; - assert(canSend(runner), "contract runner does not support sending transactions", "UNSUPPORTED_OPERATION", { operation: "sendTransaction" }); - const tx = await runner.sendTransaction(await populateTransaction(...args)); - const provider = getProvider(contract.runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - return new ContractTransactionResponse(contract.interface, provider, tx); - }; - const estimateEnergy = async function (...args) { - const runner = getRunner(contract.runner, "estimateEnergy"); - assert(canEstimate(runner), "contract runner does not support energy estimation", "UNSUPPORTED_OPERATION", { operation: "estimateEnergy" }); - return await runner.estimateEnergy(await populateTransaction(...args)); - }; - const staticCallResult = async function (...args) { - const runner = getRunner(contract.runner, "call"); - assert(canCall(runner), "contract runner does not support calling", "UNSUPPORTED_OPERATION", { operation: "call" }); - const tx = await populateTransaction(...args); - let result = "0x"; - try { - result = await runner.call(tx); - } - catch (error) { - if (isCallException(error) && error.data) { - throw contract.interface.makeError(error.data, tx); - } - throw error; - } - const fragment = getFragment(...args); - return contract.interface.decodeFunctionResult(fragment, result); - }; - const method = async (...args) => { - const fragment = getFragment(...args); - if (fragment.constant) { - return await staticCall(...args); - } - return await send(...args); - }; - defineProperties(method, { - name: contract.interface.getFunctionName(key), - _contract: contract, - _key: key, - getFragment, - estimateEnergy, - populateTransaction, - send, - staticCall, - staticCallResult, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getFunction(key); - assert(fragment, "no matching fragment in defineProperty", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; -} -function buildWrappedEvent(contract, key) { - const getFragment = function (...args) { - const fragment = contract.interface.getEvent(key, args); - assert(fragment, "no matching fragment in", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }; - const method = function (...args) { - return new PreparedTopicFilter(contract, getFragment(...args), args); - }; - defineProperties(method, { - name: contract.interface.getEventName(key), - _contract: contract, - _key: key, - getFragment, - }); - // Only works on non-ambiguous keys (refined fragment is always non-ambiguous) - Object.defineProperty(method, "fragment", { - configurable: false, - enumerable: true, - get: () => { - const fragment = contract.interface.getEvent(key); - assert(fragment, "no matching fragment", "UNSUPPORTED_OPERATION", { - operation: "fragment", - }); - return fragment; - }, - }); - return method; -} -// The combination of TypeScrype, Private Fields and Proxies makes -// the world go boom; so we hide variables with some trickery keeping -// a symbol attached to each BaseContract which its sub-class (even -// via a Proxy) can reach and use to look up its internal values. -const internal = Symbol.for("_corebcInternal_contract"); -const internalValues = new WeakMap(); -function setInternal(contract, values) { - internalValues.set(contract[internal], values); -} -function getInternal(contract) { - return internalValues.get(contract[internal]); -} -function isDeferred(value) { - return (value && - typeof value === "object" && - "getTopicFilter" in value && - typeof value.getTopicFilter === "function" && - value.fragment); -} -async function getSubInfo(contract, event) { - let topics; - let fragment = null; - // Convert named events to topicHash and get the fragment for - // events which need deconstructing. - if (Array.isArray(event)) { - const topicHashify = function (name) { - if (isHexString(name, 32)) { - return name; - } - const fragment = contract.interface.getEvent(name); - assertArgument(fragment, "unknown fragment", "name", name); - return fragment.topicHash; - }; - // Array of Topics and Names; e.g. `[ "0x1234...89ab", "Transfer(address)" ]` - topics = event.map((e) => { - if (e == null) { - return null; - } - if (Array.isArray(e)) { - return e.map(topicHashify); - } - return topicHashify(e); - }); - } - else if (event === "*") { - topics = [null]; - } - else if (typeof event === "string") { - if (isHexString(event, 32)) { - // Topic Hash - topics = [event]; - } - else { - // Name or Signature; e.g. `"Transfer", `"Transfer(address)"` - fragment = contract.interface.getEvent(event); - assertArgument(fragment, "unknown fragment", "event", event); - topics = [fragment.topicHash]; - } - } - else if (isDeferred(event)) { - // Deferred Topic Filter; e.g. `contract.filter.Transfer(from)` - topics = await event.getTopicFilter(); - } - else if ("fragment" in event) { - // ContractEvent; e.g. `contract.filter.Transfer` - fragment = event.fragment; - topics = [fragment.topicHash]; - } - else { - assertArgument(false, "unknown event name", "event", event); - } - // Normalize topics and sort TopicSets - topics = topics.map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - const items = Array.from(new Set(t.map((t) => t.toLowerCase())).values()); - if (items.length === 1) { - return items[0]; - } - items.sort(); - return items; - } - return t.toLowerCase(); - }); - const tag = topics - .map((t) => { - if (t == null) { - return "null"; - } - if (Array.isArray(t)) { - return t.join("|"); - } - return t; - }) - .join("&"); - return { fragment, tag, topics }; -} -async function hasSub(contract, event) { - const { subs } = getInternal(contract); - return subs.get((await getSubInfo(contract, event)).tag) || null; -} -async function getSub(contract, operation, event) { - // Make sure our runner can actually subscribe to events - const provider = getProvider(contract.runner); - assert(provider, "contract runner does not support subscribing", "UNSUPPORTED_OPERATION", { operation }); - const { fragment, tag, topics } = await getSubInfo(contract, event); - const { addr, subs } = getInternal(contract); - let sub = subs.get(tag); - if (!sub) { - const address = addr ? addr : contract; - const filter = { address, topics }; - const listener = (log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = contract.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - // If fragment is null, we do not deconstruct the args to emit - if (foundFragment) { - const _foundFragment = foundFragment; - const args = fragment - ? contract.interface.decodeEventLog(fragment, log.data, log.topics) - : []; - emit(contract, event, args, (listener) => { - return new ContractEventPayload(contract, listener, event, _foundFragment, log); - }); - } - else { - emit(contract, event, [], (listener) => { - return new ContractUnknownEventPayload(contract, listener, event, log); - }); - } - }; - let starting = []; - const start = () => { - if (starting.length) { - return; - } - starting.push(provider.on(filter, listener)); - }; - const stop = async () => { - if (starting.length == 0) { - return; - } - let started = starting; - starting = []; - await Promise.all(started); - provider.off(filter, listener); - }; - sub = { tag, listeners: [], start, stop }; - subs.set(tag, sub); - } - return sub; -} -// We use this to ensure one emit resolves before firing the next to -// ensure correct ordering (note this cannot throw and just adds the -// notice to the event queu using setTimeout). -let lastEmit = Promise.resolve(); -async function _emit(contract, event, args, payloadFunc) { - await lastEmit; - const sub = await hasSub(contract, event); - if (!sub) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const passArgs = Array.from(args); - if (payloadFunc) { - passArgs.push(payloadFunc(once ? null : listener)); - } - try { - listener.call(contract, ...passArgs); - } - catch (error) { } - return !once; - }); - return count > 0; -} -async function emit(contract, event, args, payloadFunc) { - try { - await lastEmit; - } - catch (error) { } - const resultPromise = _emit(contract, event, args, payloadFunc); - lastEmit = resultPromise; - return await resultPromise; -} -const passProperties = ["then"]; -export class BaseContract { - target; - interface; - runner; - filters; - [internal]; - fallback; - constructor(target, abi, runner, _deployTx) { - if (runner == null) { - runner = null; - } - const iface = Interface.from(abi); - defineProperties(this, { target, runner, interface: iface }); - Object.defineProperty(this, internal, { value: {} }); - let addrPromise; - let addr = null; - let deployTx = null; - if (_deployTx) { - const provider = getProvider(runner); - // @TODO: the provider can be null; make a custom dummy provider that will throw a - // meaningful error - deployTx = new ContractTransactionResponse(this.interface, provider, _deployTx); - } - let subs = new Map(); - // Resolve the target as the address - if (typeof target === "string") { - if (isHexString(target)) { - addr = target; - addrPromise = Promise.resolve(target); - } - else { - const resolver = getRunner(runner, "resolveName"); - if (!canResolve(resolver)) { - throw makeError("contract runner does not support name resolution", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - }); - } - addrPromise = resolver.resolveName(target).then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - } - else { - addrPromise = target.getAddress().then((addr) => { - if (addr == null) { - throw new Error("TODO"); - } - getInternal(this).addr = addr; - return addr; - }); - } - // Set our private values - setInternal(this, { addrPromise, addr, deployTx, subs }); - // Add the event filters - const filters = new Proxy({}, { - get: (target, _prop, receiver) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = this.getEvent(prop); - if (result) { - return result; - } - throw new Error(`unknown contract event: ${prop}`); - }, - has: (target, prop) => { - // Pass important checks (like `then` for Promise) through - if (passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return (Reflect.has(target, prop) || this.interface.hasEvent(String(prop))); - }, - }); - defineProperties(this, { filters }); - defineProperties(this, { - fallback: iface.receive || iface.fallback ? buildWrappedFallback(this) : null, - }); - // Return a Proxy that will respond to functions - return new Proxy(this, { - get: (target, _prop, receiver) => { - if (_prop in target || passProperties.indexOf(_prop) >= 0) { - return Reflect.get(target, _prop, receiver); - } - const prop = String(_prop); - const result = target.getFunction(prop); - if (result) { - return result; - } - throw new Error(`unknown contract method: ${prop}`); - }, - has: (target, prop) => { - if (prop in target || passProperties.indexOf(prop) >= 0) { - return Reflect.has(target, prop); - } - return target.interface.hasFunction(String(prop)); - }, - }); - } - connect(runner) { - return new BaseContract(this.target, this.interface, runner); - } - async getAddress() { - return await getInternal(this).addrPromise; - } - async getDeployedCode() { - const provider = getProvider(this.runner); - assert(provider, "runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "getDeployedCode" }); - const code = await provider.getCode(await this.getAddress()); - if (code === "0x") { - return null; - } - return code; - } - async waitForDeployment() { - // We have the deployement transaction; just use that (throws if deployement fails) - const deployTx = this.deploymentTransaction(); - if (deployTx) { - await deployTx.wait(); - return this; - } - // Check for code - const code = await this.getDeployedCode(); - if (code != null) { - return this; - } - // Make sure we can subscribe to a provider event - const provider = getProvider(this.runner); - assert(provider != null, "contract runner does not support .provider", "UNSUPPORTED_OPERATION", { operation: "waitForDeployment" }); - return new Promise((resolve, reject) => { - const checkCode = async () => { - try { - const code = await this.getDeployedCode(); - if (code != null) { - return resolve(this); - } - provider.once("block", checkCode); - } - catch (error) { - reject(error); - } - }; - checkCode(); - }); - } - deploymentTransaction() { - return getInternal(this).deployTx; - } - getFunction(key) { - if (typeof key !== "string") { - key = key.format(); - } - const func = buildWrappedMethod(this, key); - return func; - } - getEvent(key) { - if (typeof key !== "string") { - key = key.format(); - } - return buildWrappedEvent(this, key); - } - async queryTransaction(hash) { - // Is this useful? - throw new Error("@TODO"); - } - async queryFilter(event, fromBlock, toBlock) { - if (fromBlock == null) { - fromBlock = 0; - } - if (toBlock == null) { - toBlock = "latest"; - } - const { addr, addrPromise } = getInternal(this); - const address = addr ? addr : await addrPromise; - const { fragment, topics } = await getSubInfo(this, event); - const filter = { address, topics, fromBlock, toBlock }; - const provider = getProvider(this.runner); - assert(provider, "contract runner does not have a provider", "UNSUPPORTED_OPERATION", { operation: "queryFilter" }); - return (await provider.getLogs(filter)).map((log) => { - let foundFragment = fragment; - if (foundFragment == null) { - try { - foundFragment = this.interface.getEvent(log.topics[0]); - } - catch (error) { } - } - if (foundFragment) { - return new EventLog(log, this.interface, foundFragment); - } - else { - return new Log(log, provider); - } - }); - } - async on(event, listener) { - const sub = await getSub(this, "on", event); - sub.listeners.push({ listener, once: false }); - sub.start(); - return this; - } - async once(event, listener) { - const sub = await getSub(this, "once", event); - sub.listeners.push({ listener, once: true }); - sub.start(); - return this; - } - async emit(event, ...args) { - return await emit(this, event, args, null); - } - async listenerCount(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - const { subs } = getInternal(this); - let total = 0; - for (const { listeners } of subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - const { subs } = getInternal(this); - let result = []; - for (const { listeners } of subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (listener == null || sub.listeners.length === 0) { - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const sub = await hasSub(this, event); - if (!sub) { - return this; - } - sub.stop(); - getInternal(this).subs.delete(sub.tag); - } - else { - const { subs } = getInternal(this); - for (const { tag, stop } of subs.values()) { - stop(); - subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return await this.off(event, listener); - } - static buildClass(abi) { - class CustomContract extends BaseContract { - constructor(address, runner = null) { - super(address, abi, runner); - } - } - return CustomContract; - } - static from(target, abi, runner) { - if (runner == null) { - runner = null; - } - const contract = new this(target, abi, runner); - return contract; - } - static isIndexed(value) { - return Indexed.isIndexed(value); - } -} -function _ContractBase() { - return BaseContract; -} -export class Contract extends _ContractBase() { -} -//# sourceMappingURL=contract.js.map \ No newline at end of file diff --git a/lib.esm/contract/contract.js.map b/lib.esm/contract/contract.js.map deleted file mode 100644 index 444601d70..000000000 --- a/lib.esm/contract/contract.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACN,WAAW,EACX,GAAG,GAEH,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACN,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,eAAe,CAAC;AAgCvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAkBvB,SAAS,OAAO,CAAC,KAAU;IAC1B,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AAClD,CAAC;AAED,SAAS,WAAW,CAAC,KAAU;IAC9B,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,cAAc,KAAK,UAAU,CAA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M,CAAC,CAAC;YAC7B,CAAC;SACD;QACD,OAAO,cAAqB,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,IAAI,CACV,MAAc,EACd,GAAiB,EACjB,MAA8B;QAE9B,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;YACpB,MAAM,GAAG,IAAI,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,QAAe,CAAC;IACxB,CAAC;IACD,MAAM,CAAC,SAAS,CAAC,KAAU;QAC1B,OAAO,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;CACD;AAED,SAAS,aAAa;IAKrB,OAAO,YAAmB,CAAC;AAC5B,CAAC;AAED,MAAM,OAAO,QAAS,SAAQ,aAAa,EAAE;CAAG"} \ No newline at end of file diff --git a/lib.esm/contract/factory.d.ts b/lib.esm/contract/factory.d.ts deleted file mode 100644 index f58d98552..000000000 --- a/lib.esm/contract/factory.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Interface } from "../abi/index.js"; -import { BaseContract } from "./contract.js"; -import type { InterfaceAbi } from "../abi/index.js"; -import type { ContractRunner } from "../providers/index.js"; -import type { BytesLike } from "../utils/index.js"; -import type { ContractInterface, ContractMethodArgs, ContractDeployTransaction } from "./types.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -export declare class ContractFactory = Array, I = BaseContract> { - readonly interface: Interface; - readonly bytecode: string; - readonly runner: null | ContractRunner; - constructor(abi: Interface | InterfaceAbi, bytecode: BytesLike | { - object: string; - }, runner?: null | ContractRunner); - getDeployTransaction(...args: ContractMethodArgs): Promise; - deploy(...args: ContractMethodArgs): Promise>; - connect(runner: null | ContractRunner): ContractFactory; - static fromSolidity = Array, I = ContractInterface>(output: any, runner?: ContractRunner): ContractFactory; -} -//# sourceMappingURL=factory.d.ts.map \ No newline at end of file diff --git a/lib.esm/contract/factory.d.ts.map b/lib.esm/contract/factory.d.ts.map deleted file mode 100644 index e49bf553e..000000000 --- a/lib.esm/contract/factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,OAAO,EAAE,YAAY,EAA8B,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EACX,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAKjE,qBAAa,eAAe,CAC3B,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EACjC,CAAC,GAAG,YAAY;IAEhB,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAG,IAAI,GAAG,cAAc,CAAC;IAExC,YACC,GAAG,EAAE,SAAS,GAAG,YAAY,EAC7B,QAAQ,EAAE,SAAS,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EACxC,MAAM,CAAC,EAAE,IAAI,GAAG,cAAc,EAyB9B;IAEK,oBAAoB,CACzB,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC,yBAAyB,CAAC,CAoBpC;IAEK,MAAM,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CACpD,YAAY,GAAG;QACd,qBAAqB,IAAI,2BAA2B,CAAC;KACrD,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,YAAY,CAAC,CAC/B,CAoBA;IAED,OAAO,CAAC,MAAM,EAAE,IAAI,GAAG,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAE5D;IAED,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,iBAAiB,EAC3E,MAAM,EAAE,GAAG,EACX,MAAM,CAAC,EAAE,cAAc,GACrB,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAiBvB;CACD"} \ No newline at end of file diff --git a/lib.esm/contract/factory.js b/lib.esm/contract/factory.js deleted file mode 100644 index 420d4fc09..000000000 --- a/lib.esm/contract/factory.js +++ /dev/null @@ -1,83 +0,0 @@ -import { Interface } from "../abi/index.js"; -import { getCreateAddress } from "../address/contract-address.js"; -import { concat, defineProperties, getBytes, hexlify, assert, assertArgument, } from "../utils/index.js"; -import { BaseContract, copyOverrides, resolveArgs } from "./contract.js"; -import { isBytes } from "../utils/data.js"; -// A = Arguments to the constructor -// I = Interface of deployed contracts -export class ContractFactory { - interface; - bytecode; - runner; - constructor(abi, bytecode, runner) { - const iface = Interface.from(abi); - // Dereference Solidity bytecode objects and allow a missing `0x`-prefix - if (bytecode instanceof Uint8Array) { - bytecode = hexlify(getBytes(bytecode)); - } - else if (typeof bytecode === "string") { - bytecode = bytecode; - } - else if (isBytes(bytecode)) { - bytecode = hexlify(bytecode); - } - else if (bytecode && typeof bytecode.object === "string") { - // Allow the bytecode object from the Solidity compiler - bytecode = bytecode.object; - } - else { - // Crash in the next verification step - bytecode = "!"; - } - defineProperties(this, { - // @ts-ignore - bytecode, - interface: iface, - runner: runner || null, - }); - } - async getDeployTransaction(...args) { - let overrides = {}; - const fragment = this.interface.deploy; - if (fragment.inputs.length + 1 === args.length) { - overrides = await copyOverrides(args.pop()); - } - if (fragment.inputs.length !== args.length) { - throw new Error("incorrect number of arguments to constructor"); - } - const resolvedArgs = await resolveArgs(this.runner, fragment.inputs, args); - const data = concat([ - this.bytecode, - this.interface.encodeDeploy(resolvedArgs), - ]); - return Object.assign({}, overrides, { data }); - } - async deploy(...args) { - const tx = await this.getDeployTransaction(...args); - assert(this.runner && typeof this.runner.sendTransaction === "function", "factory runner does not support sending transactions", "UNSUPPORTED_OPERATION", { - operation: "sendTransaction", - }); - const sentTx = await this.runner.sendTransaction(tx); - const address = getCreateAddress(sentTx); - return new BaseContract(address, this.interface, this.runner, sentTx); - } - connect(runner) { - return new ContractFactory(this.interface, this.bytecode, runner); - } - static fromSolidity(output, runner) { - assertArgument(output != null, "bad compiler output", "output", output); - if (typeof output === "string") { - output = JSON.parse(output); - } - const abi = output.abi; - let bytecode = ""; - if (output.bytecode) { - bytecode = output.bytecode; - } - else if (output.evm && output.evm.bytecode) { - bytecode = output.evm.bytecode; - } - return new this(abi, bytecode, runner); - } -} -//# sourceMappingURL=factory.js.map \ No newline at end of file diff --git a/lib.esm/contract/factory.js.map b/lib.esm/contract/factory.js.map deleted file mode 100644 index 6479a66f5..000000000 --- a/lib.esm/contract/factory.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EACN,MAAM,EACN,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAYzE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,mCAAmC;AACnC,sCAAsC;AACtC,MAAM,OAAO,eAAe;IAI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qB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QAExE,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QAEvB,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACrB,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC5B,CAAC;aAAM,IAAI,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAC9C,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAChC,CAAC;QAED,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/contract/index.d.ts b/lib.esm/contract/index.d.ts deleted file mode 100644 index 8be93dacb..000000000 --- a/lib.esm/contract/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * About contracts... - * - * @_section: api/contract:Contracts [about-contracts] - */ -export { BaseContract, Contract } from "./contract.js"; -export { ContractFactory } from "./factory.js"; -export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./wrappers.js"; -export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, WrappedFallback, } from "./types.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/contract/index.d.ts.map b/lib.esm/contract/index.d.ts.map deleted file mode 100644 index a5098a449..000000000 --- a/lib.esm/contract/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/lib.esm/contract/index.js b/lib.esm/contract/index.js deleted file mode 100644 index 6e93aee67..000000000 --- a/lib.esm/contract/index.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * About contracts... - * - * @_section: api/contract:Contracts [about-contracts] - */ -export { BaseContract, Contract } from "./contract.js"; -export { ContractFactory } from "./factory.js"; -export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./wrappers.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/contract/index.js.map b/lib.esm/contract/index.js.map deleted file mode 100644 index bbfe70a1e..000000000 --- a/lib.esm/contract/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,eAAe,CAAC"} \ No newline at end of file diff --git a/lib.esm/contract/types.d.ts b/lib.esm/contract/types.d.ts deleted file mode 100644 index cf836c128..000000000 --- a/lib.esm/contract/types.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { EventFragment, FunctionFragment, Result, Typed } from "../abi/index.js"; -import type { TransactionRequest, PreparedTransactionRequest, TopicFilter } from "../providers/index.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -export type ContractEventName = string | ContractEvent | TopicFilter | DeferredTopicFilter; -export interface ContractInterface { - [name: string]: BaseContractMethod; -} -export interface DeferredTopicFilter { - getTopicFilter(): Promise; - fragment: EventFragment; -} -export interface ContractTransaction extends PreparedTransactionRequest { - to: string; - data: string; - from?: string; -} -export interface ContractDeployTransaction extends Omit { -} -export interface Overrides extends Omit { -} -export type PostfixOverrides> = A | [...A, Overrides]; -export type ContractMethodArgs> = PostfixOverrides<{ - [I in keyof A]-?: A[I] | Typed; -}>; -export interface BaseContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { - (...args: ContractMethodArgs): Promise; - name: string; - fragment: FunctionFragment; - getFragment(...args: ContractMethodArgs): FunctionFragment; - populateTransaction(...args: ContractMethodArgs): Promise; - staticCall(...args: ContractMethodArgs): Promise; - send(...args: ContractMethodArgs): Promise; - estimateEnergy(...args: ContractMethodArgs): Promise; - staticCallResult(...args: ContractMethodArgs): Promise; -} -export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> extends BaseContractMethod { -} -export interface ConstantContractMethod, R = any> extends ContractMethod { -} -export type ContractEventArgs> = { - [I in keyof A]?: A[I] | Typed | null; -}; -export interface ContractEvent = Array> { - (...args: ContractEventArgs): DeferredTopicFilter; - name: string; - fragment: EventFragment; - getFragment(...args: ContractEventArgs): EventFragment; -} -export interface WrappedFallback { - (overrides?: Omit): Promise; - populateTransaction(overrides?: Omit): Promise; - staticCall(overrides?: Omit): Promise; - send(overrides?: Omit): Promise; - estimateEnergy(overrides?: Omit): Promise; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/lib.esm/contract/types.d.ts.map b/lib.esm/contract/types.d.ts.map deleted file mode 100644 index d356fb5ec..000000000 --- a/lib.esm/contract/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,KAAK,EACL,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAGjE,MAAM,MAAM,iBAAiB,GAC5B,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,mBAAmB,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IACjC,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IACnC,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,mBAAoB,SAAQ,0BAA0B;IAEtE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAGD,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CACtD,mBAAmB,EACnB,IAAI,CACJ;CAAG;AAGJ,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,MAAM,CAAC;CAAG;AAG7E,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC;AAC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,EAAE,IAAI,CAAC,GACxC,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,cAAc,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC5E"} \ No newline at end of file diff --git a/lib.esm/contract/types.js b/lib.esm/contract/types.js deleted file mode 100644 index 718fd38ae..000000000 --- a/lib.esm/contract/types.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/lib.esm/contract/types.js.map b/lib.esm/contract/types.js.map deleted file mode 100644 index 595591811..000000000 --- a/lib.esm/contract/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src.ts/contract/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/contract/wrappers.d.ts b/lib.esm/contract/wrappers.d.ts deleted file mode 100644 index 184e06900..000000000 --- a/lib.esm/contract/wrappers.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Block, Log, TransactionReceipt, TransactionResponse } from "../providers/provider.js"; -import { EventPayload } from "../utils/index.js"; -import type { EventFragment, Interface, Result } from "../abi/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Provider } from "../providers/index.js"; -import type { BaseContract } from "./contract.js"; -import type { ContractEventName } from "./types.js"; -export declare class EventLog extends Log { - readonly interface: Interface; - readonly fragment: EventFragment; - readonly args: Result; - constructor(log: Log, iface: Interface, fragment: EventFragment); - get eventName(): string; - get eventSignature(): string; -} -export declare class ContractTransactionReceipt extends TransactionReceipt { - #private; - constructor(iface: Interface, provider: Provider, tx: TransactionReceipt); - get logs(): Array; -} -export declare class ContractTransactionResponse extends TransactionResponse { - #private; - constructor(iface: Interface, provider: Provider, tx: TransactionResponse); - wait(confirms?: number): Promise; -} -export declare class ContractUnknownEventPayload extends EventPayload { - readonly log: Log; - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log); - getBlock(): Promise; - getTransaction(): Promise; - getTransactionReceipt(): Promise; -} -export declare class ContractEventPayload extends ContractUnknownEventPayload { - readonly fragment: EventFragment; - readonly log: EventLog; - readonly args: Result; - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, fragment: EventFragment, _log: Log); - get eventName(): string; - get eventSignature(): string; -} -//# sourceMappingURL=wrappers.d.ts.map \ No newline at end of file diff --git a/lib.esm/contract/wrappers.d.ts.map b/lib.esm/contract/wrappers.d.ts.map deleted file mode 100644 index 4538896c6..000000000 --- a/lib.esm/contract/wrappers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,EACL,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAoB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,qBAAa,QAAS,SAAQ,GAAG;IAChC,QAAQ,CAAC,SAAS,EAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAI9D;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,cAAc,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diff --git a/lib.esm/contract/wrappers.js b/lib.esm/contract/wrappers.js deleted file mode 100644 index bef7ba87d..000000000 --- a/lib.esm/contract/wrappers.js +++ /dev/null @@ -1,82 +0,0 @@ -import { Log, TransactionReceipt, TransactionResponse, } from "../providers/provider.js"; -import { defineProperties, EventPayload } from "../utils/index.js"; -export class EventLog extends Log { - interface; - fragment; - args; - constructor(log, iface, fragment) { - super(log, log.provider); - const args = iface.decodeEventLog(fragment, log.data, log.topics); - defineProperties(this, { args, fragment, interface: iface }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } -} -export class ContractTransactionReceipt extends TransactionReceipt { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - get logs() { - return super.logs.map((log) => { - const fragment = log.topics.length - ? this.#iface.getEvent(log.topics[0]) - : null; - if (fragment) { - return new EventLog(log, this.#iface, fragment); - } - else { - return log; - } - }); - } -} -export class ContractTransactionResponse extends TransactionResponse { - #iface; - constructor(iface, provider, tx) { - super(tx, provider); - this.#iface = iface; - } - async wait(confirms) { - const receipt = await super.wait(); - if (receipt == null) { - return null; - } - return new ContractTransactionReceipt(this.#iface, this.provider, receipt); - } -} -export class ContractUnknownEventPayload extends EventPayload { - log; - constructor(contract, listener, filter, log) { - super(contract, listener, filter); - defineProperties(this, { log }); - } - async getBlock() { - return await this.log.getBlock(); - } - async getTransaction() { - return await this.log.getTransaction(); - } - async getTransactionReceipt() { - return await this.log.getTransactionReceipt(); - } -} -export class ContractEventPayload extends ContractUnknownEventPayload { - constructor(contract, listener, filter, fragment, _log) { - super(contract, listener, filter, new EventLog(_log, contract.interface, fragment)); - const args = contract.interface.decodeEventLog(fragment, this.log.data, this.log.topics); - defineProperties(this, { args, fragment }); - } - get eventName() { - return this.fragment.name; - } - get eventSignature() { - return this.fragment.format(); - } -} -//# sourceMappingURL=wrappers.js.map \ No newline at end of file diff --git a/lib.esm/contract/wrappers.js.map b/lib.esm/contract/wrappers.js.map deleted file mode 100644 index df90db46c..000000000 --- a/lib.esm/contract/wrappers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.js","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,GAAG,EACH,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AASnE,MAAM,OAAO,QAAS,SAAQ,GAAG;IACvB,SAAS,CAAa;IACtB,QAAQ,CAAiB;IACzB,IAAI,CAAU;IAEvB,YAAY,GAAQ,EAAE,KAAgB,EAAE,QAAuB;QAC9D,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;QAClE,gBAAgB,CAAW,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,SAAS;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC3B,CAAC;IACD,IAAI,cAAc;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;CACD;AAED,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IACxD,MAAM,CAAY;IAE3B,YAAY,KAAgB,EAAE,QAAkB,EAAE,EAAsB;QACvE,KAAK,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAI,IAAI;QACP,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAC7B,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAA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QACnB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,qBAAqB;QAC1B,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;IAC/C,CAAC;CACD;AAED,MAAM,OAAO,oBAAqB,SAAQ,2BAA2B;IAKpE,YACC,QAAsB,EACtB,QAAyB,EACzB,MAAyB,EACzB,QAAuB,EACvB,IAAS;QAET,KAAK,CACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,IAAI,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAChD,CAAC;QACF,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,cAAc,CAC7C,QAAQ,EACR,IAAI,CAAC,GAAG,CAAC,IAAI,EACb,IAAI,CAAC,GAAG,CAAC,MAAM,CACf,CAAC;QACF,gBAAgB,CAAuB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,IAAI,SAAS;QACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,cAAc;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/corebc.d.ts b/lib.esm/corebc.d.ts deleted file mode 100644 index 1dede3269..000000000 --- a/lib.esm/corebc.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export { version } from "./_version.js"; -export { publicToAddress } from "./transaction/address.js"; -export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js"; -export { getAddress, networkIdToPrefix } from "./address/index.js"; -export { getCreate2Address, getCreateAddress, } from "./address/contract-address.js"; -export { isAddressable, isAddress, resolveAddress } from "./address/checks.js"; -export { ZeroAddress, OrePerXCB, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, CoreSymbol, MessagePrefix, } from "./constants/index.js"; -export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js"; -export { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Ed448Goldilock, Signature, SigningKey, keccak256, } from "./crypto/index.js"; -export { id, hashMessage, verifyMessage, solidityPacked, solidityPackedSha256, TypedDataEncoder, verifyTypedData, } from "./hash/index.js"; -export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, Network, FeeDataNetworkPlugin, EnergyCostPlugin, NetworkPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage, } from "./providers/index.js"; -export { accessListify, computeAddress, recoverAddress, Transaction, } from "./transaction/index.js"; -export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatXCB, parseXCB, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, arrayify, hexConcat, } from "./utils/index.js"; -export { Mnemonic, BaseWallet, HDNodeWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js"; -export { BigNumber } from "./bigNumber/bigNumber.js"; -export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists, } from "./wordlists/index.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc, } from "./abi/index.js"; -export type { Addressable, AddressLike, NameResolver, } from "./address/index.js"; -export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback, } from "./contract/index.js"; -export type { ProgressCallback, SignatureLike } from "./crypto/index.js"; -export type { TypedDataDomain, TypedDataField } from "./hash/index.js"; -export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, EnergyCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike, } from "./providers/index.js"; -export type { AccessList, AccessListish, AccessListEntry, TransactionLike, } from "./transaction/index.js"; -export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, CoreBCError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedCoreBCError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener, } from "./utils/index.js"; -export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions, } from "./wallet/index.js"; -export * from "./cip/index.js"; -export * from "./ipfs/index.js"; -//# sourceMappingURL=corebc.d.ts.map \ No newline at end of file diff --git a/lib.esm/corebc.d.ts.map b/lib.esm/corebc.d.ts.map deleted file mode 100644 index c9c604763..000000000 --- a/lib.esm/corebc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"corebc.d.ts","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,KAAK,GACL,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACN,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,+BAA+B,CAAC;AAEv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ClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,GACR,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACX,gBAAgB,EAChB,eAAe,EACf,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.esm/corebc.js b/lib.esm/corebc.js deleted file mode 100644 index e44acdfe8..000000000 --- a/lib.esm/corebc.js +++ /dev/null @@ -1,19 +0,0 @@ -export { version } from "./_version.js"; -export { publicToAddress } from "./transaction/address.js"; -export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js"; -export { getAddress, networkIdToPrefix } from "./address/index.js"; -export { getCreate2Address, getCreateAddress, } from "./address/contract-address.js"; -export { isAddressable, isAddress, resolveAddress } from "./address/checks.js"; -export { ZeroAddress, OrePerXCB, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, CoreSymbol, MessagePrefix, } from "./constants/index.js"; -export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js"; -export { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Ed448Goldilock, Signature, SigningKey, keccak256, } from "./crypto/index.js"; -export { id, hashMessage, verifyMessage, solidityPacked, solidityPackedSha256, TypedDataEncoder, verifyTypedData, } from "./hash/index.js"; -export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, Network, FeeDataNetworkPlugin, EnergyCostPlugin, NetworkPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage, } from "./providers/index.js"; -export { accessListify, computeAddress, recoverAddress, Transaction, } from "./transaction/index.js"; -export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatXCB, parseXCB, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, arrayify, hexConcat, } from "./utils/index.js"; -export { Mnemonic, BaseWallet, HDNodeWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js"; -export { BigNumber } from "./bigNumber/bigNumber.js"; -export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists, } from "./wordlists/index.js"; -export * from "./cip/index.js"; -export * from "./ipfs/index.js"; -//# sourceMappingURL=corebc.js.map \ No newline at end of file diff --git a/lib.esm/corebc.js.map b/lib.esm/corebc.js.map deleted file mode 100644 index 27e3e783d..000000000 --- a/lib.esm/corebc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"corebc.js","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,KAAK,GACL,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACN,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EACN,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,CAAC,EACD,QAAQ,EACR,UAAU,EACV,aAAa,GACb,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,IAAI,EACJ,cAAc,EACd,SAAS,EACT,UAAU,EACV,SAAS,GACT,MAAM,mBAAmB,CAAC;AAE3B,OA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AAW,EACX,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,SAAS,GACT,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACN,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,MAAM,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EACN,QAAQ,EACR,MAAM,EACN,WAAW,EACX,YAAY,EACZ,SAAS,GACT,MAAM,sBAAsB,CAAC;AA0I9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/browser-ed448.d.ts b/lib.esm/crypto/browser-ed448.d.ts deleted file mode 100644 index 7b2b7d29a..000000000 --- a/lib.esm/crypto/browser-ed448.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Ed448Backend } from "./ed448-types.js"; -declare const ed448: Ed448Backend; -export default ed448; -//# sourceMappingURL=browser-ed448.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/browser-ed448.d.ts.map b/lib.esm/crypto/browser-ed448.d.ts.map deleted file mode 100644 index 33a4fd898..000000000 --- a/lib.esm/crypto/browser-ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/lib.esm/crypto/browser-ed448.js b/lib.esm/crypto/browser-ed448.js deleted file mode 100644 index f8b6b6f72..000000000 --- a/lib.esm/crypto/browser-ed448.js +++ /dev/null @@ -1,6 +0,0 @@ -// bcrypto does not ship TypeScript declarations. -// @ts-ignore -import backend from "bcrypto/lib/ed448-browser.js"; -const ed448 = backend; -export default ed448; -//# sourceMappingURL=browser-ed448.js.map \ No newline at end of file diff --git a/lib.esm/crypto/browser-ed448.js.map b/lib.esm/crypto/browser-ed448.js.map deleted file mode 100644 index a9fee80b4..000000000 --- a/lib.esm/crypto/browser-ed448.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-ed448.js","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,aAAa;AACb,OAAO,OAAO,MAAM,8BAA8B,CAAC;AAEnD,MAAM,KAAK,GAAiB,OAAO,CAAC;AACpC,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/browser-sha3.d.ts b/lib.esm/crypto/browser-sha3.d.ts deleted file mode 100644 index 3b83a4fbb..000000000 --- a/lib.esm/crypto/browser-sha3.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BytesLike } from "../utils/data.js"; -import { SupportedAlgorithm } from "./sha3.js"; -export declare function ripemd160(data: BytesLike): string; -export declare function sha256(data: BytesLike): string; -export declare function sha512(data: BytesLike): string; -export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string; -//# sourceMappingURL=browser-sha3.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/browser-sha3.d.ts.map b/lib.esm/crypto/browser-sha3.d.ts.map deleted file mode 100644 index 61f4a3fba..000000000 --- a/lib.esm/crypto/browser-sha3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AASA,OAAO,EAAY,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR"} \ No newline at end of file diff --git a/lib.esm/crypto/browser-sha3.js b/lib.esm/crypto/browser-sha3.js deleted file mode 100644 index 7bac13cff..000000000 --- a/lib.esm/crypto/browser-sha3.js +++ /dev/null @@ -1,41 +0,0 @@ -import { Buffer } from "buffer"; -("use strict"); -// @ts-ignore -import _ripemd160 from "bcrypto/lib/ripemd160-browser"; -// @ts-ignore -import sha3 from "bcrypto/lib/sha3-browser.js"; -import { Logger } from "../logger/logger.js"; -import { arrayify, hexlify } from "../utils/data.js"; -import { SupportedAlgorithm } from "./sha3.js"; -const logger = new Logger("corebc-crypto/browser-sha3/0.0.1"); -export function ripemd160(data) { - const d = Buffer.from(arrayify(data)); - const h = _ripemd160.digest(d); - return hexlify(h); -} -export function sha256(data) { - const d = Buffer.from(arrayify(data)); - const h = sha3.digest(d, 256); - return hexlify(h); -} -export function sha512(data) { - const d = Buffer.from(arrayify(data)); - const h = sha3.digest(d, 512); - return hexlify(h); -} -export function computeHmac(algorithm, key, data) { - const d = Buffer.from(arrayify(data)); - const k = Buffer.from(arrayify(key)); - if (algorithm === SupportedAlgorithm.sha256) { - return hexlify(sha3.mac(d, k, 256)); - } - else if (algorithm === SupportedAlgorithm.sha512) { - return hexlify(sha3.mac(d, k, 512)); - } - logger.throwError("unsupported algorithm - " + algorithm, Logger.errors.UNSUPPORTED_OPERATION, { - operation: "computeHmac", - algorithm: algorithm, - }); - return ""; -} -//# sourceMappingURL=browser-sha3.js.map \ No newline at end of file diff --git a/lib.esm/crypto/browser-sha3.js.map b/lib.esm/crypto/browser-sha3.js.map deleted file mode 100644 index 0966a462a..000000000 --- a/lib.esm/crypto/browser-sha3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-sha3.js","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,CAAC,YAAY,CAAC,CAAC;AAEf,aAAa;AACb,OAAO,UAAU,MAAM,+BAA+B,CAAC;AACvD,aAAa;AACb,OAAO,IAAI,MAAM,6BAA6B,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAa,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,kCAAkC,CAAC,CAAC;AAE9D,MAAM,UAAU,SAAS,CAAC,IAAe;IACxC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,MAAM,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC/B,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,IAAe;IACrC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,IAAe;IACrC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,WAAW,CAC1B,SAA6B,EAC7B,GAAc,EACd,IAAe;IAEf,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,SAAS,KAAK,kBAAkB,CAAC,MAAM,EAAE,CAAC;QAC7C,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;SAAM,IAAI,SAAS,KAAK,kBAAkB,CAAC,MAAM,EAAE,CAAC;QACpD,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,UAAU,CAChB,0BAA0B,GAAG,SAAS,EACtC,MAAM,CAAC,MAAM,CAAC,qBAAqB,EACnC;QACC,SAAS,EAAE,aAAa;QACxB,SAAS,EAAE,SAAS;KACpB,CACD,CAAC;IACF,OAAO,EAAE,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/crypto-browser.d.ts b/lib.esm/crypto/crypto-browser.d.ts deleted file mode 100644 index c1f839009..000000000 --- a/lib.esm/crypto/crypto-browser.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import ed448 from "./browser-ed448.js"; -export { ed448 }; -export { Ed448Goldilock } from "./ed448goldilock-browser.js"; -declare global { - interface Window { - } - const window: Window; - const self: Window; -} -export interface CryptoHasher { - update(data: Uint8Array): CryptoHasher; - digest(): Uint8Array; -} -export declare function createHash(algo: string): CryptoHasher; -export declare function createHmac(_algo: string, key: Uint8Array): CryptoHasher; -export declare function pbkdf2Sync(password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, _algo: "sha256" | "sha512"): Uint8Array; -export declare function randomBytes(length: number): Uint8Array; -//# sourceMappingURL=crypto-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/crypto-browser.d.ts.map b/lib.esm/crypto/crypto-browser.d.ts.map deleted file mode 100644 index 96b1570a8..000000000 --- a/lib.esm/crypto/crypto-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;KAAG;IAEnB,MAAM,MAAM,EAAE,MAAM,CAAC;IAErB,MAAM,IAAI,EAAE,MAAM,CAAC;CACnB;AAmBD,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAcrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAMvE;AAED,wBAAgB,UAAU,CACzB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,GAAG,QAAQ,GACxB,UAAU,CAIZ;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAoBtD"} \ No newline at end of file diff --git a/lib.esm/crypto/crypto-browser.js b/lib.esm/crypto/crypto-browser.js deleted file mode 100644 index af974960d..000000000 --- a/lib.esm/crypto/crypto-browser.js +++ /dev/null @@ -1,62 +0,0 @@ -/* Browser Crypto Shims */ -import { ripemd160 } from "@noble/hashes/legacy.js"; -import { hmac } from "@noble/hashes/hmac.js"; -import { pbkdf2 } from "@noble/hashes/pbkdf2.js"; -import { sha256 } from "@noble/hashes/sha2.js"; -import { sha512 } from "@noble/hashes/sha2.js"; -import { sha3_256, sha3_512 } from "@noble/hashes/sha3.js"; -import ed448 from "./browser-ed448.js"; -import { assert, assertArgument } from "../utils/index.js"; -export { ed448 }; -export { Ed448Goldilock } from "./ed448goldilock-browser.js"; -function getGlobal() { - if (typeof globalThis !== "undefined") - return globalThis; - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); -} -const anyGlobal = getGlobal(); -const crypto = anyGlobal.crypto || anyGlobal.msCrypto; -export function createHash(algo) { - switch (algo) { - case "ripemd160": - return ripemd160.create(); - case "sha256": - return sha256.create(); - case "sha512": - return sha512.create(); - case "sha3-256": - return sha3_256.create(); - case "sha3-512": - return sha3_512.create(); - } - assertArgument(false, "invalid hashing algorithm name", "algorithm", algo); -} -export function createHmac(_algo, key) { - const algo = { sha256, sha512, "sha3-256": sha3_256, "sha3-512": sha3_512 }[_algo]; - assertArgument(algo != null, "invalid hmac algorithm", "algorithm", _algo); - return hmac.create(algo, key); -} -export function pbkdf2Sync(password, salt, iterations, keylen, _algo) { - const algo = { sha256, sha512 }[_algo]; - assertArgument(algo != null, "invalid pbkdf2 algorithm", "algorithm", _algo); - return pbkdf2(algo, password, salt, { c: iterations, dkLen: keylen }); -} -export function randomBytes(length) { - assert(crypto != null, "platform does not support secure random numbers", "UNSUPPORTED_OPERATION", { - operation: "randomBytes", - }); - assertArgument(Number.isInteger(length) && length > 0 && length <= 1024, "invalid length", "length", length); - const result = new Uint8Array(length); - crypto.getRandomValues(result); - return result; -} -//# sourceMappingURL=crypto-browser.js.map \ No newline at end of file diff --git a/lib.esm/crypto/crypto-browser.js.map b/lib.esm/crypto/crypto-browser.js.map deleted file mode 100644 index 3e244fd0f..000000000 --- a/lib.esm/crypto/crypto-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAU7D,SAAS,SAAS;IACjB,IAAI,OAAO,UAAU,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC;IACzD,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,SAAS,GAAG,SAAS,EAAE,CAAC;AAC9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KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc;IACzC,MAAM,CACL,MAAM,IAAI,IAAI,EACd,iDAAiD,EACjD,uBAAuB,EACvB;QACC,SAAS,EAAE,aAAa;KACxB,CACD,CAAC;IAEF,cAAc,CACb,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,IAAI,EACxD,gBAAgB,EAChB,QAAQ,EACR,MAAM,CACN,CAAC;IAEF,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/crypto.d.ts b/lib.esm/crypto/crypto.d.ts deleted file mode 100644 index 67011fd36..000000000 --- a/lib.esm/crypto/crypto.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -import ed448 from "./ed448.js"; -export { ed448 }; -export { Ed448Goldilock } from "./ed448goldilock.js"; -export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto"; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/crypto.d.ts.map b/lib.esm/crypto/crypto.d.ts.map deleted file mode 100644 index 551ce5172..000000000 --- a/lib.esm/crypto/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/crypto.js b/lib.esm/crypto/crypto.js deleted file mode 100644 index 2ec24f8f7..000000000 --- a/lib.esm/crypto/crypto.js +++ /dev/null @@ -1,6 +0,0 @@ -/// -import ed448 from "./ed448.js"; -export { ed448 }; -export { Ed448Goldilock } from "./ed448goldilock.js"; -export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto"; -//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/lib.esm/crypto/crypto.js.map b/lib.esm/crypto/crypto.js.map deleted file mode 100644 index 50456e3cc..000000000 --- a/lib.esm/crypto/crypto.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448-types.d.ts b/lib.esm/crypto/ed448-types.d.ts deleted file mode 100644 index 705f54df5..000000000 --- a/lib.esm/crypto/ed448-types.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Buffer } from "buffer"; -/** Buffer-based bcrypto Ed448 operations used by Core signing. */ -export interface Ed448Backend { - privateKeyGenerate(): Buffer; - publicKeyCreate(key: Buffer): Buffer; - publicKeyFromScalar(scalar: Buffer): Buffer; - publicKeyVerify(key: Buffer): boolean; - publicKeyCombine(keys: Buffer[]): Buffer; - sign(message: Buffer, key: Buffer): Buffer; - signWithScalar(message: Buffer, scalar: Buffer, prefix: Buffer): Buffer; - verify(message: Buffer, signature: Buffer, publicKey: Buffer): boolean; - derive(publicKey: Buffer, key: Buffer): Buffer; - deriveWithScalar(publicKey: Buffer, scalar: Buffer): Buffer; -} -//# sourceMappingURL=ed448-types.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448-types.d.ts.map b/lib.esm/crypto/ed448-types.d.ts.map deleted file mode 100644 index 209f88584..000000000 --- a/lib.esm/crypto/ed448-types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448-types.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC5B,kBAAkB,IAAI,MAAM,CAAC;IAC7B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5D"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448-types.js b/lib.esm/crypto/ed448-types.js deleted file mode 100644 index 11baabae1..000000000 --- a/lib.esm/crypto/ed448-types.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=ed448-types.js.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448-types.js.map b/lib.esm/crypto/ed448-types.js.map deleted file mode 100644 index 0564f5549..000000000 --- a/lib.esm/crypto/ed448-types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448-types.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448-types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/crypto/ed448.d.ts b/lib.esm/crypto/ed448.d.ts deleted file mode 100644 index fd3e5a866..000000000 --- a/lib.esm/crypto/ed448.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Ed448Backend } from "./ed448-types.js"; -declare const ed448: Ed448Backend; -export default ed448; -//# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448.d.ts.map b/lib.esm/crypto/ed448.d.ts.map deleted file mode 100644 index 7ea835437..000000000 --- a/lib.esm/crypto/ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448.js b/lib.esm/crypto/ed448.js deleted file mode 100644 index a72f52656..000000000 --- a/lib.esm/crypto/ed448.js +++ /dev/null @@ -1,6 +0,0 @@ -// bcrypto does not ship TypeScript declarations. -// @ts-ignore -import backend from "bcrypto/lib/ed448.js"; -const ed448 = backend; -export default ed448; -//# sourceMappingURL=ed448.js.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448.js.map b/lib.esm/crypto/ed448.js.map deleted file mode 100644 index 210b134ce..000000000 --- a/lib.esm/crypto/ed448.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,aAAa;AACb,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAE3C,MAAM,KAAK,GAAiB,OAAO,CAAC;AACpC,eAAe,KAAK,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock-browser.d.ts b/lib.esm/crypto/ed448goldilock-browser.d.ts deleted file mode 100644 index 58df73a6f..000000000 --- a/lib.esm/crypto/ed448goldilock-browser.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Buffer } from "buffer"; -export declare class Ed448Goldilock { - static _channel: import("./ed448-types.js").Ed448Backend; - static generatePrivateKey(): Buffer; - static getPublicKeyFromPrivateKey(privateKey: string): string; - static signWithPrivateKey(privateKey: string, msg: string): string; - static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; - static verifySignature(msgHash: string, signedMsg: string, pubKey: string): boolean; - static SHA512Hash(password: string, salt: string): string; - static concatenateAndHex(prefix: number, key: string, index: number, salt: string): string; - static addScalar(a: string, b: string): string; - static seedToExtendedPrivate(seed: string): string; - static childPrivateToPrivate(s: string, index: number): string; - static HDWalletGenerateKeyFromSeed(seed: string, index: number): string; -} -//# sourceMappingURL=ed448goldilock-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock-browser.d.ts.map b/lib.esm/crypto/ed448goldilock-browser.d.ts.map deleted file mode 100644 index 976a9855d..000000000 --- a/lib.esm/crypto/ed448goldilock-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock-browser.js b/lib.esm/crypto/ed448goldilock-browser.js deleted file mode 100644 index c8af42378..000000000 --- a/lib.esm/crypto/ed448goldilock-browser.js +++ /dev/null @@ -1,120 +0,0 @@ -import { Buffer } from "buffer"; -// @ts-ignore -import ed448 from "./browser-ed448.js"; -// @ts-ignore -import pbkdf2 from "./pbkdf2-browser.js"; -// @ts-ignore -import SHA3_512 from "bcrypto/lib/sha3-512.js"; -export class Ed448Goldilock { - static _channel = ed448; - static generatePrivateKey() { - var privateKey = ed448.privateKeyGenerate(); - privateKey[56] &= 0x7f; - return privateKey; - } - static getPublicKeyFromPrivateKey(privateKey) { - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var scalar = secret.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - var publicKey = this._channel.publicKeyFromScalar(scalar); - return Buffer.from(publicKey).toString("hex"); - } - else { - var publicKey = this._channel.publicKeyCreate(secret); - return Buffer.from(publicKey).toString("hex"); - } - } - static signWithPrivateKey(privateKey, msg) { - var msgToSign = Buffer.from(msg, "hex"); - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var prefix = secret.slice(0, 57); - prefix[0] &= 0xfc; - prefix[56] = 0; - prefix[55] |= 0x80; - var scalar = prefix.slice(0, 56); - var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return Buffer.from(signedMessage).toString("hex"); - } - else { - var signedMessage = this._channel.sign(msgToSign, secret); - return Buffer.from(signedMessage).toString("hex"); - } - } - static signWithPrivateKeyNConcatPubkey(privateKey, msg) { - var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); - var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); - return signedMessage + publicKey; - } - static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(Buffer.from(msgHash, "hex"), Buffer.from(signedMsg, "hex"), Buffer.from(pubKey, "hex")); - } - static SHA512Hash(password, salt) { - var p1 = Buffer.from(password, "hex"); - var s1 = Buffer.from(salt, "hex"); - return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); - } - static concatenateAndHex(prefix, key, index, salt) { - var ind = Buffer.alloc(4); - var p = Buffer.alloc(1); - p[0] = prefix % 256; - var j = index; - for (let i = 0; i < 4; i++) { - ind[i] = j % 256; - j = Math.floor(j / 256); - } - var t = p.toString("hex") + key + ind.toString("hex"); - return Ed448Goldilock.SHA512Hash(t, salt); - } - static addScalar(a, b) { - var a1 = Buffer.from(a, "hex"); - var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); - b1[0] &= 0xfc; - var c = Buffer.alloc(57); - var hold = 0; - for (let i = 0; i < 57; i++) { - hold += a1[i] + b1[i]; - c[i] = hold % 256; - hold = Math.floor(hold / 256); - } - return c.toString("hex"); - } - static seedToExtendedPrivate(seed) { - var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); - var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = Buffer.from(s2, "hex"); - b[56] |= 0x80; - b[55] |= 0x80; - b[55] &= 0xbf; - var s3 = b.toString("hex"); - return s1 + s3; - } - static childPrivateToPrivate(s, index) { - var s0 = s.substr(0, 114); - var s1 = s.substr(114, 228); - var r0, r1; - if (index >= 0x80000000) { - r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - else { - var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); - r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - } - static HDWalletGenerateKeyFromSeed(seed, index) { - var m = Ed448Goldilock.seedToExtendedPrivate(seed); - var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); - var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); - var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); - var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); - var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); - return k5.substr(114, 228); - } -} -//# sourceMappingURL=ed448goldilock-browser.js.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock-browser.js.map b/lib.esm/crypto/ed448goldilock-browser.js.map deleted file mode 100644 index 80c838e49..000000000 --- a/lib.esm/crypto/ed448goldilock-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,aAAa;AACb,OAAO,KAAK,MAAM,oBAAoB,CAAC;AACvC,aAAa;AACb,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,aAAa;AACb,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAE/C,MAAM,OAAO,cAAc;IAC1B,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;IAExB,MAAM,CAAC,kBAAkB;QACxB,IAAI,UAAU,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAC5C,UAAU,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QACvB,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAkB;QACnD,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC5C,IAAI,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC;YACtB,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;YAClB,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;YACnB,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YAC1D,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/C,CAAC;aAAM,CAAC;YACP,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YACtD,OAAO,MAAM,C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,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAY,EAAE,KAAa;QAC7D,IAAI,CAAC,GAAG,cAAc,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,CAAC,EAAE,UAAU,GAAG,EAAE,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,CAAC;QACpE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAClE,IAAI,EAAE,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACzD,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock.d.ts b/lib.esm/crypto/ed448goldilock.d.ts deleted file mode 100644 index 3dff60994..000000000 --- a/lib.esm/crypto/ed448goldilock.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Buffer } from "buffer"; -export declare class Ed448Goldilock { - static _channel: import("./ed448-types.js").Ed448Backend; - static generatePrivateKey(): Buffer; - static getPublicKeyFromPrivateKey(privateKey: string): string; - static signWithPrivateKey(privateKey: string, msg: string): string; - static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; - static verifySignature(msgHash: string, signedMsg: string, pubKey: string): boolean; - static SHA512Hash(password: string, salt: string): string; - static concatenateAndHex(prefix: number, key: string, index: number, salt: string): string; - static addScalar(a: string, b: string): string; - static seedToExtendedPrivate(seed: string): string; - static childPrivateToPrivate(s: string, index: number): string; - static HDWalletGenerateKeyFromSeed(seed: string, index: number): string; -} -//# sourceMappingURL=ed448goldilock.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock.d.ts.map b/lib.esm/crypto/ed448goldilock.d.ts.map deleted file mode 100644 index 7cd4dfaca..000000000 --- a/lib.esm/crypto/ed448goldilock.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock.js b/lib.esm/crypto/ed448goldilock.js deleted file mode 100644 index 9eaf5adff..000000000 --- a/lib.esm/crypto/ed448goldilock.js +++ /dev/null @@ -1,120 +0,0 @@ -import { Buffer } from "buffer"; -// @ts-ignore -import ed448 from "./ed448.js"; -// @ts-ignore -import pbkdf2 from "bcrypto/lib/pbkdf2.js"; -// @ts-ignore -import SHA3_512 from "bcrypto/lib/sha3-512.js"; -export class Ed448Goldilock { - static _channel = ed448; - static generatePrivateKey() { - var privateKey = ed448.privateKeyGenerate(); - privateKey[56] &= 0x7f; - return privateKey; - } - static getPublicKeyFromPrivateKey(privateKey) { - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var scalar = secret.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - var publicKey = this._channel.publicKeyFromScalar(scalar); - return Buffer.from(publicKey).toString("hex"); - } - else { - var publicKey = this._channel.publicKeyCreate(secret); - return Buffer.from(publicKey).toString("hex"); - } - } - static signWithPrivateKey(privateKey, msg) { - var msgToSign = Buffer.from(msg, "hex"); - var secret = Buffer.from(privateKey, "hex"); - if (secret[56] > 127) { - var prefix = secret.slice(0, 57); - prefix[0] &= 0xfc; - prefix[56] = 0; - prefix[55] |= 0x80; - var scalar = prefix.slice(0, 56); - var signedMessage = this._channel.signWithScalar(msgToSign, scalar, prefix); - return Buffer.from(signedMessage).toString("hex"); - } - else { - var signedMessage = this._channel.sign(msgToSign, secret); - return Buffer.from(signedMessage).toString("hex"); - } - } - static signWithPrivateKeyNConcatPubkey(privateKey, msg) { - var signedMessage = Ed448Goldilock.signWithPrivateKey(privateKey, msg); - var publicKey = Ed448Goldilock.getPublicKeyFromPrivateKey(privateKey); - return signedMessage + publicKey; - } - static verifySignature(msgHash, signedMsg, pubKey) { - return this._channel.verify(Buffer.from(msgHash, "hex"), Buffer.from(signedMsg, "hex"), Buffer.from(pubKey, "hex")); - } - static SHA512Hash(password, salt) { - var p1 = Buffer.from(password, "hex"); - var s1 = Buffer.from(salt, "hex"); - return Buffer.from(pbkdf2.derive(SHA3_512, p1, s1, 2048, 57)).toString("hex"); - } - static concatenateAndHex(prefix, key, index, salt) { - var ind = Buffer.alloc(4); - var p = Buffer.alloc(1); - p[0] = prefix % 256; - var j = index; - for (let i = 0; i < 4; i++) { - ind[i] = j % 256; - j = Math.floor(j / 256); - } - var t = p.toString("hex") + key + ind.toString("hex"); - return Ed448Goldilock.SHA512Hash(t, salt); - } - static addScalar(a, b) { - var a1 = Buffer.from(a, "hex"); - var b1 = Buffer.from(b.substr(0, 106) + "00000000", "hex"); - b1[0] &= 0xfc; - var c = Buffer.alloc(57); - var hold = 0; - for (let i = 0; i < 57; i++) { - hold += a1[i] + b1[i]; - c[i] = hold % 256; - hold = Math.floor(hold / 256); - } - return c.toString("hex"); - } - static seedToExtendedPrivate(seed) { - var s1 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f72746865636861696e"); - var s2 = Ed448Goldilock.SHA512Hash(seed, "6d6e656d6f6e6963666f727468656b6579"); - var b = Buffer.from(s2, "hex"); - b[56] |= 0x80; - b[55] |= 0x80; - b[55] &= 0xbf; - var s3 = b.toString("hex"); - return s1 + s3; - } - static childPrivateToPrivate(s, index) { - var s0 = s.substr(0, 114); - var s1 = s.substr(114, 228); - var r0, r1; - if (index >= 0x80000000) { - r0 = Ed448Goldilock.concatenateAndHex(1, s1, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(0, s1, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - else { - var pub = Ed448Goldilock.getPublicKeyFromPrivateKey(s1); - r0 = Ed448Goldilock.concatenateAndHex(3, pub, index, s0); - r1 = Ed448Goldilock.concatenateAndHex(2, pub, index, s0); - return r0 + Ed448Goldilock.addScalar(s1, r1); - } - } - static HDWalletGenerateKeyFromSeed(seed, index) { - var m = Ed448Goldilock.seedToExtendedPrivate(seed); - var k1 = Ed448Goldilock.childPrivateToPrivate(m, 0x80000000 + 44); - var k2 = Ed448Goldilock.childPrivateToPrivate(k1, 0x80000000 + 654); - var k3 = Ed448Goldilock.childPrivateToPrivate(k2, 0x80000000 + 0); - var k4 = Ed448Goldilock.childPrivateToPrivate(k3, 0x80000000 + 0); - var k5 = Ed448Goldilock.childPrivateToPrivate(k4, index); - return k5.substr(114, 228); - } -} -//# sourceMappingURL=ed448goldilock.js.map \ No newline at end of file diff --git a/lib.esm/crypto/ed448goldilock.js.map b/lib.esm/crypto/ed448goldilock.js.map deleted file mode 100644 index 097bc0178..000000000 --- a/lib.esm/crypto/ed448goldilock.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock.js","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,aAAa;AACb,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,aAAa;AACb,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,aAAa;AACb,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAE/C,MAAM,OAAO,cAAc;IAC1B,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC;IAExB,MAAM,CAAC,kBAAkB;QACxB,IAAI,UAAU,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;QAC5C,UAAU,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QACvB,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAkB;QACnD,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QA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C;IAC5B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/crypto/hmac.d.ts b/lib.esm/crypto/hmac.d.ts deleted file mode 100644 index 902055c49..000000000 --- a/lib.esm/crypto/hmac.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -declare const _computeHmac: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string; -export declare namespace computeHmac { - export { _computeHmac as _ }; - export var lock: () => void; - export var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/hmac.d.ts.map b/lib.esm/crypto/hmac.d.ts.map deleted file mode 100644 index b5c8a51d9..000000000 --- a/lib.esm/crypto/hmac.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,YAAY,cACN,QAAQ,GAAG,QAAQ,OACzB,UAAU,QACT,UAAU,KACd,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAC1B,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,GACd,MAAM,CAIR;yBARe,WAAW;aASX,YAAY;;gCAKrB,CACL,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,UAAU,KACZ,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/hmac.js b/lib.esm/crypto/hmac.js deleted file mode 100644 index 2c3d0f7e1..000000000 --- a/lib.esm/crypto/hmac.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * An **HMAC** enables verification that a given key was used - * to authenticate a payload. - * - * See: [[link-wiki-hmac]] - * - * @_subsection: api/crypto:HMAC [about-hmac] - */ -import { createHmac } from "./crypto.js"; -import { getBytes, hexlify } from "../utils/index.js"; -let locked = false; -const _computeHmac = function (algorithm, key, data) { - return createHmac(algorithm, key).update(data).digest(); -}; -let __computeHmac = _computeHmac; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -export function computeHmac(algorithm, _key, _data) { - const key = getBytes(_key, "key"); - const data = getBytes(_data, "data"); - return hexlify(__computeHmac(algorithm, key, data)); -} -computeHmac._ = _computeHmac; -computeHmac.lock = function () { - locked = true; -}; -computeHmac.register = function (func) { - if (locked) { - throw new Error("computeHmac is locked"); - } - __computeHmac = func; -}; -Object.freeze(computeHmac); -//# sourceMappingURL=hmac.js.map \ No newline at end of file diff --git a/lib.esm/crypto/hmac.js.map b/lib.esm/crypto/hmac.js.map deleted file mode 100644 index 704b0a0e5..000000000 --- a/lib.esm/crypto/hmac.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.js","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UACpB,SAA8B,EAC9B,GAAe,EACf,IAAgB;IAEhB,OAAO,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;AACzD,CAAC,CAAC;AAEF,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAC1B,SAA8B,EAC9B,IAAe,EACf,KAAgB;IAEhB,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAClC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,aAAa,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC;AACD,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAG;IAClB,MAAM,GAAG,IAAI,CAAC;AACf,CAAC,CAAC;AACF,WAAW,CAAC,QAAQ,GAAG,UACtB,IAIc;IAEd,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC1C,CAAC;IACD,aAAa,GAAG,IAAI,CAAC;AACtB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/index.d.ts b/lib.esm/crypto/index.d.ts deleted file mode 100644 index 0730e25c8..000000000 --- a/lib.esm/crypto/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A fundamental building block of Core is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -import { computeHmac } from "./hmac.js"; -import { ripemd160 } from "./ripemd160.js"; -import { pbkdf2 } from "./pbkdf2.js"; -import { randomBytes } from "./random.js"; -import { scrypt, scryptSync } from "./scrypt.js"; -import { sha256, sha512 } from "./sha3.js"; -import { Ed448Goldilock } from "./crypto.js"; -import { keccak256 } from "./keccak.js"; -export { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, }; -export { SigningKey } from "./signing-key.js"; -export { Signature } from "./signature.js"; -declare function lock(): void; -export { lock }; -export type { ProgressCallback } from "./scrypt.js"; -export type { SignatureLike } from "./signature.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/index.d.ts.map b/lib.esm/crypto/index.d.ts.map deleted file mode 100644 index 76d2d37f8..000000000 --- a/lib.esm/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,iBAAS,IAAI,IAAI,IAAI,CAUpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/index.js b/lib.esm/crypto/index.js deleted file mode 100644 index 95c2fdfce..000000000 --- a/lib.esm/crypto/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * A fundamental building block of Core is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -null; -// We import all these so we can export lock() -import { computeHmac } from "./hmac.js"; -import { ripemd160 } from "./ripemd160.js"; -import { pbkdf2 } from "./pbkdf2.js"; -import { randomBytes } from "./random.js"; -import { scrypt, scryptSync } from "./scrypt.js"; -import { sha256, sha512 } from "./sha3.js"; -import { Ed448Goldilock } from "./crypto.js"; -import { keccak256 } from "./keccak.js"; -export { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, }; -export { SigningKey } from "./signing-key.js"; -export { Signature } from "./signature.js"; -function lock() { - computeHmac.lock(); - pbkdf2.lock(); - randomBytes.lock(); - ripemd160.lock(); - scrypt.lock(); - scryptSync.lock(); - sha256.lock(); - sha512.lock(); - randomBytes.lock(); -} -export { lock }; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/crypto/index.js.map b/lib.esm/crypto/index.js.map deleted file mode 100644 index 8bfc5e2d7..000000000 --- a/lib.esm/crypto/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,IAAI,CAAC;AAEL,8CAA8C;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,SAAS,IAAI;IACZ,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,IAAI,EAAE,CAAC;IACnB,SAAS,CAAC,IAAI,EAAE,CAAC;IACjB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,UAAU,CAAC,IAAI,EAAE,CAAC;IAClB,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,MAAM,CAAC,IAAI,EAAE,CAAC;IACd,WAAW,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/keccak.d.ts b/lib.esm/crypto/keccak.d.ts deleted file mode 100644 index a2b3dd879..000000000 --- a/lib.esm/crypto/keccak.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -import type { BytesLike } from "../utils/index.js"; -declare const _keccak256: (data: Uint8Array) => Uint8Array; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -export declare function keccak256(_data: BytesLike): string; -export declare namespace keccak256 { - export { _keccak256 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=keccak.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/keccak.d.ts.map b/lib.esm/crypto/keccak.d.ts.map deleted file mode 100644 index dfe4be3ef..000000000 --- a/lib.esm/crypto/keccak.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/keccak.js b/lib.esm/crypto/keccak.js deleted file mode 100644 index 65c5e43da..000000000 --- a/lib.esm/crypto/keccak.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -import { keccak_256 } from "@noble/hashes/sha3.js"; -import { getBytes, hexlify } from "../utils/index.js"; -let locked = false; -const _keccak256 = function (data) { - return keccak_256(data); -}; -let __keccak256 = _keccak256; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -export function keccak256(_data) { - const data = getBytes(_data, "data"); - return hexlify(__keccak256(data)); -} -keccak256._ = _keccak256; -keccak256.lock = function () { - locked = true; -}; -keccak256.register = function (func) { - if (locked) { - throw new TypeError("keccak256 is locked"); - } - __keccak256 = func; -}; -Object.freeze(keccak256); -//# sourceMappingURL=keccak.js.map \ No newline at end of file diff --git a/lib.esm/crypto/keccak.js.map b/lib.esm/crypto/keccak.js.map deleted file mode 100644 index 05e88834a..000000000 --- a/lib.esm/crypto/keccak.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.js","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAU,IAAgB;IAC5C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC;AAEF,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG;IAChB,MAAM,GAAG,IAAI,CAAC;AACf,CAAC,CAAC;AACF,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAqC;IACnE,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAC5C,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;AACpB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2-browser.d.ts b/lib.esm/crypto/pbkdf2-browser.d.ts deleted file mode 100644 index 31ae18ebe..000000000 --- a/lib.esm/crypto/pbkdf2-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import pbkdf2 from "bcrypto/lib/pbkdf2-browser.js"; -export default pbkdf2; -//# sourceMappingURL=pbkdf2-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2-browser.d.ts.map b/lib.esm/crypto/pbkdf2-browser.d.ts.map deleted file mode 100644 index 97bf68048..000000000 --- a/lib.esm/crypto/pbkdf2-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,+BAA+B,CAAC;eACpC,MAAM"} \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2-browser.js b/lib.esm/crypto/pbkdf2-browser.js deleted file mode 100644 index 8550191c1..000000000 --- a/lib.esm/crypto/pbkdf2-browser.js +++ /dev/null @@ -1,4 +0,0 @@ -// @ts-ignore -import pbkdf2 from "bcrypto/lib/pbkdf2-browser.js"; -export default pbkdf2; -//# sourceMappingURL=pbkdf2-browser.js.map \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2-browser.js.map b/lib.esm/crypto/pbkdf2-browser.js.map deleted file mode 100644 index a393105da..000000000 --- a/lib.esm/crypto/pbkdf2-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2-browser.js","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,MAAM,MAAM,+BAA+B,CAAC;AACnD,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2.d.ts b/lib.esm/crypto/pbkdf2.d.ts deleted file mode 100644 index c2da81c40..000000000 --- a/lib.esm/crypto/pbkdf2.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -import type { BytesLike } from "../utils/index.js"; -declare const _pbkdf2: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string; -export declare namespace pbkdf2 { - export { _pbkdf2 as _ }; - export var lock: () => void; - export var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; -} -export {}; -//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2.d.ts.map b/lib.esm/crypto/pbkdf2.d.ts.map deleted file mode 100644 index fc5ad966d..000000000 --- a/lib.esm/crypto/pbkdf2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,OAAO,aACF,UAAU,QACd,UAAU,cACJ,MAAM,UACV,MAAM,QACR,QAAQ,GAAG,QAAQ,KACvB,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACrB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GACvB,MAAM,CAIR;yBAVe,MAAM;aAWX,OAAO;2BACS,IAAI;gCAIxB,CACL,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,KACrB,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2.js b/lib.esm/crypto/pbkdf2.js deleted file mode 100644 index 2718db2cd..000000000 --- a/lib.esm/crypto/pbkdf2.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -import { pbkdf2Sync } from "./crypto.js"; -import { getBytes, hexlify } from "../utils/index.js"; -let locked = false; -const _pbkdf2 = function (password, salt, iterations, keylen, algo) { - return pbkdf2Sync(password, salt, iterations, keylen, algo); -}; -let __pbkdf2 = _pbkdf2; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -export function pbkdf2(_password, _salt, iterations, keylen, algo) { - const password = getBytes(_password, "password"); - const salt = getBytes(_salt, "salt"); - return hexlify(__pbkdf2(password, salt, iterations, keylen, algo)); -} -pbkdf2._ = _pbkdf2; -pbkdf2.lock = function () { - locked = true; -}; -pbkdf2.register = function (func) { - if (locked) { - throw new Error("pbkdf2 is locked"); - } - __pbkdf2 = func; -}; -Object.freeze(pbkdf2); -//# sourceMappingURL=pbkdf2.js.map \ No newline at end of file diff --git a/lib.esm/crypto/pbkdf2.js.map b/lib.esm/crypto/pbkdf2.js.map deleted file mode 100644 index 77a63b7a5..000000000 --- a/lib.esm/crypto/pbkdf2.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.js","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,OAAO,GAAG,UACf,QAAoB,EACpB,IAAgB,EAChB,UAAkB,EAClB,MAAc,EACd,IAAyB;IAEzB,OAAO,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,IAAI,QAAQ,GAAG,OAAO,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,MAAM,CACrB,SAAoB,EACpB,KAAgB,EAChB,UAAkB,EAClB,MAAc,EACd,IAAyB;IAEzB,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG;IACb,MAAM,GAAG,IAAI,CAAC;AACf,CAAC,CAAC;AACF,MAAM,CAAC,QAAQ,GAAG,UACjB,IAMc;IAEd,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;IACD,QAAQ,GAAG,IAAI,CAAC;AACjB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/random.d.ts b/lib.esm/crypto/random.d.ts deleted file mode 100644 index 609ec0ec0..000000000 --- a/lib.esm/crypto/random.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -declare const _randomBytes: (length: number) => Uint8Array; -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -export declare function randomBytes(length: number): Uint8Array; -export declare namespace randomBytes { - export { _randomBytes as _ }; - export var lock: () => void; - export var register: (func: (length: number) => Uint8Array) => void; -} -export {}; -//# sourceMappingURL=random.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/random.d.ts.map b/lib.esm/crypto/random.d.ts.map deleted file mode 100644 index 0e9d29e7b..000000000 --- a/lib.esm/crypto/random.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY,WAAqB,MAAM,KAAG,UAE/C,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW;aAIX,YAAY;2BACI,IAAI;gCAGG,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU"} \ No newline at end of file diff --git a/lib.esm/crypto/random.js b/lib.esm/crypto/random.js deleted file mode 100644 index 5252676fe..000000000 --- a/lib.esm/crypto/random.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * A **Cryptographically Secure Random Value** is one that has been - * generated with additional care take to prevent side-channels - * from allowing others to detect it and prevent others from through - * coincidence generate the same values. - * - * @_subsection: api/crypto:Random Values [about-crypto-random] - */ -import { randomBytes as crypto_random } from "./crypto.js"; -let locked = false; -const _randomBytes = function (length) { - return new Uint8Array(crypto_random(length)); -}; -let __randomBytes = _randomBytes; -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -export function randomBytes(length) { - return __randomBytes(length); -} -randomBytes._ = _randomBytes; -randomBytes.lock = function () { - locked = true; -}; -randomBytes.register = function (func) { - if (locked) { - throw new Error("randomBytes is locked"); - } - __randomBytes = func; -}; -Object.freeze(randomBytes); -//# sourceMappingURL=random.js.map \ No newline at end of file diff --git a/lib.esm/crypto/random.js.map b/lib.esm/crypto/random.js.map deleted file mode 100644 index 69fc6e771..000000000 --- a/lib.esm/crypto/random.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.js","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3D,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,YAAY,GAAG,UAAU,MAAc;IAC5C,OAAO,IAAI,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,IAAI,aAAa,GAAG,YAAY,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc;IACzC,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,WAAW,CAAC,CAAC,GAAG,YAAY,CAAC;AAC7B,WAAW,CAAC,IAAI,GAAG;IAClB,MAAM,GAAG,IAAI,CAAC;AACf,CAAC,CAAC;AACF,WAAW,CAAC,QAAQ,GAAG,UAAU,IAAoC;IACpE,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC1C,CAAC;IACD,aAAa,GAAG,IAAI,CAAC;AACtB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/ripemd160.d.ts b/lib.esm/crypto/ripemd160.d.ts deleted file mode 100644 index a38b5f516..000000000 --- a/lib.esm/crypto/ripemd160.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -declare const _ripemd160: (data: Uint8Array) => Uint8Array; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare function ripemd160(_data: BytesLike): string; -export declare namespace ripemd160 { - export { _ripemd160 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/ripemd160.d.ts.map b/lib.esm/crypto/ripemd160.d.ts.map deleted file mode 100644 index 68683ca8b..000000000 --- a/lib.esm/crypto/ripemd160.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/ripemd160.js b/lib.esm/crypto/ripemd160.js deleted file mode 100644 index 726abe900..000000000 --- a/lib.esm/crypto/ripemd160.js +++ /dev/null @@ -1,40 +0,0 @@ -import { ripemd160 as noble_ripemd160 } from "@noble/hashes/legacy.js"; -import { getBytes, hexlify } from "../utils/index.js"; -let locked = false; -const _ripemd160 = function (data) { - return noble_ripemd160(data); -}; -let __ripemd160 = _ripemd160; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export function ripemd160(_data) { - const data = getBytes(_data, "data"); - return hexlify(__ripemd160(data)); -} -ripemd160._ = _ripemd160; -ripemd160.lock = function () { - locked = true; -}; -ripemd160.register = function (func) { - if (locked) { - throw new TypeError("ripemd160 is locked"); - } - __ripemd160 = func; -}; -Object.freeze(ripemd160); -//# sourceMappingURL=ripemd160.js.map \ No newline at end of file diff --git a/lib.esm/crypto/ripemd160.js.map b/lib.esm/crypto/ripemd160.js.map deleted file mode 100644 index 7bf82e0ce..000000000 --- a/lib.esm/crypto/ripemd160.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.js","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAItD,IAAI,MAAM,GAAG,KAAK,CAAC;AAEnB,MAAM,UAAU,GAAG,UAAU,IAAgB;IAC5C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,IAAI,WAAW,GAAoC,UAAU,CAAC;AAE9D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;AACnC,CAAC;AACD,SAAS,CAAC,CAAC,GAAG,UAAU,CAAC;AACzB,SAAS,CAAC,IAAI,GAAG;IAChB,MAAM,GAAG,IAAI,CAAC;AACf,CAAC,CAAC;AACF,SAAS,CAAC,QAAQ,GAAG,UAAU,IAAqC;IACnE,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAC;IAC5C,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;AACpB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/rlp.d.ts b/lib.esm/crypto/rlp.d.ts deleted file mode 100644 index 42970ab48..000000000 --- a/lib.esm/crypto/rlp.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { BytesLike } from "../utils/data.js"; -export declare function encode(object: any): string; -export declare function decode(data: BytesLike): any; -//# sourceMappingURL=rlp.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/rlp.d.ts.map b/lib.esm/crypto/rlp.d.ts.map deleted file mode 100644 index 6c9570fb1..000000000 --- a/lib.esm/crypto/rlp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/rlp.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,SAAS,EAAwB,MAAM,kBAAkB,CAAC;AA+D7E,wBAAgB,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAE1C;AAkHD,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,GAAG,CAO3C"} \ No newline at end of file diff --git a/lib.esm/crypto/rlp.js b/lib.esm/crypto/rlp.js deleted file mode 100644 index 946c27b0d..000000000 --- a/lib.esm/crypto/rlp.js +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; -import { Logger } from "../logger/logger.js"; -import { arrayify, hexlify, isBytesLike } from "../utils/data.js"; -const logger = new Logger("rlp/0.0.1"); -function arrayifyInteger(value) { - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; -} -function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - if (!isBytesLike(object)) { - logger.throwArgumentError("RLP object must be BytesLike", "object", object); - } - const data = Array.prototype.slice.call(arrayify(object)); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); -} -export function encode(object) { - return hexlify(_encode(object)); -} -function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - if (childOffset > offset + 1 + length) { - logger.throwError("child data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - } - return { consumed: 1 + length, result: result }; -} -// returns { consumed: number, result: Object } -function _decode(data, offset) { - if (data.length === 0) { - logger.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - if (offset + 1 + lengthLength > data.length) { - logger.throwError("data short segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger.throwError("data long segment too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - if (offset + 1 + length > data.length) { - logger.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - return _decodeChildren(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - if (offset + 1 + lengthLength > data.length) { - logger.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const length = unarrayifyInteger(data, offset + 1, lengthLength); - if (offset + 1 + lengthLength + length > data.length) { - logger.throwError("data array too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - if (offset + 1 + length > data.length) { - logger.throwError("data too short", Logger.errors.BUFFER_OVERRUN, {}); - } - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlify(data[offset]) }; -} -export function decode(data) { - const bytes = arrayify(data); - const decoded = _decode(bytes, 0); - if (decoded.consumed !== bytes.length) { - logger.throwArgumentError("invalid rlp data", "data", data); - } - return decoded.result; -} -//# sourceMappingURL=rlp.js.map \ No newline at end of file diff --git a/lib.esm/crypto/rlp.js.map b/lib.esm/crypto/rlp.js.map deleted file mode 100644 index f42debc58..000000000 --- a/lib.esm/crypto/rlp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.js","sourceRoot":"","sources":["../../src.ts/crypto/rlp.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAa,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE7E,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;AAEvC,SAAS,eAAe,CAAC,KAAa;IACrC,MAAM,MAAM,GAAG,EAAE,CAAC;IAClB,OAAO,KAAK,EAAE,CAAC;QACd,aAAa;QACb,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;QAC7B,KAAK,KAAK,CAAC,CAAC;IACb,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,iBAAiB,CACzB,IAAgB,EAChB,MAAc,EACd,MAAc;IAEd,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,OAAO,CAAC,MAA2B;IAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,IAAI,OAAO,GAAkB,EAAE,CAAC;QACh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AM,UAAU,MAAM,CAAC,IAAe;IACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAClC,IAAI,OAAO,CAAC,QAAQ,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QACvC,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/scrypt.d.ts b/lib.esm/crypto/scrypt.d.ts deleted file mode 100644 index a00b5a43b..000000000 --- a/lib.esm/crypto/scrypt.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * A callback during long-running operations to update any - * UI or provide programatic access to the progress. - * - * The %%percent%% is a value between ``0`` and ``1``. - * - * @_docloc: api/crypto:Passwords - */ -export type ProgressCallback = (percent: number) => void; -declare const _scryptAsync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback) => Promise & Uint8Array>; -declare const _scryptSync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array & Uint8Array; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise; -export declare namespace scrypt { - export { _scryptAsync as _ }; - export var lock: () => void; - export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback) => Promise) => void; -} -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string; -export declare namespace scryptSync { - export { _scryptSync as _ }; - export var lock: () => void; - export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/scrypt.d.ts.map b/lib.esm/crypto/scrypt.d.ts.map deleted file mode 100644 index 23c428160..000000000 --- a/lib.esm/crypto/scrypt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":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AAU,EAClB,IAAI,EAAE,UAAU,EAChB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,KACT,SAAS"} \ No newline at end of file diff --git a/lib.esm/crypto/scrypt.js b/lib.esm/crypto/scrypt.js deleted file mode 100644 index a31ad5a93..000000000 --- a/lib.esm/crypto/scrypt.js +++ /dev/null @@ -1,103 +0,0 @@ -import { scrypt as _nobleSync, scryptAsync as _nobleAsync, } from "@noble/hashes/scrypt.js"; -import { getBytes, hexlify as H } from "../utils/index.js"; -let lockedSync = false, lockedAsync = false; -const _scryptAsync = async function (passwd, salt, N, r, p, dkLen, onProgress) { - return await _nobleAsync(passwd, salt, { N, r, p, dkLen, onProgress }); -}; -const _scryptSync = function (passwd, salt, N, r, p, dkLen) { - return _nobleSync(passwd, salt, { N, r, p, dkLen }); -}; -let __scryptAsync = _scryptAsync; -let __scryptSync = _scryptSync; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export async function scrypt(_passwd, _salt, N, r, p, dkLen, progress) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return H(await __scryptAsync(passwd, salt, N, r, p, dkLen, progress)); -} -scrypt._ = _scryptAsync; -scrypt.lock = function () { - lockedAsync = true; -}; -scrypt.register = function (func) { - if (lockedAsync) { - throw new Error("scrypt is locked"); - } - __scryptAsync = func; -}; -Object.freeze(scrypt); -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export function scryptSync(_passwd, _salt, N, r, p, dkLen) { - const passwd = getBytes(_passwd, "passwd"); - const salt = getBytes(_salt, "salt"); - return H(__scryptSync(passwd, salt, N, r, p, dkLen)); -} -scryptSync._ = _scryptSync; -scryptSync.lock = function () { - lockedSync = true; -}; -scryptSync.register = function (func) { - if (lockedSync) { - throw new Error("scryptSync is locked"); - } - __scryptSync = func; -}; -Object.freeze(scryptSync); -//# sourceMappingURL=scrypt.js.map \ No newline at end of file diff --git a/lib.esm/crypto/scrypt.js.map b/lib.esm/crypto/scrypt.js.map deleted file mode 100644 index 417845075..000000000 --- a/lib.esm/crypto/scrypt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.js","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,IAAI,UAAU,EACpB,WAAW,IAAI,WAAW,GAC1B,MAAM,yBAAyB,CAAC;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GAAG;IACb,WAAW,GAAG,IAAI,CAAC;AACpB,CAAC,CAAC;AACF,MAAM,CAAC,QAAQ,GAAG,UACjB,IAQuB;IAEvB,IAAI,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;IACD,aAAa,GAAG,IAAI,CAAC;AACtB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,UAAU,CACzB,OAAkB,EAClB,KAAgB,EAChB,CAAS,EACT,CAAS,EACT,CAAS,EACT,KAAa;IAEb,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;AACtD,CAAC;AACD,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC;AAC3B,UAAU,CAAC,IAAI,GAAG;IACjB,UAAU,GAAG,IAAI,CAAC;AACnB,CAAC,CAAC;AACF,UAAU,CAAC,QAAQ,GAAG,UACrB,IAOc;IAEd,IAAI,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACzC,CAAC;IACD,YAAY,GAAG,IAAI,CAAC;AACrB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/sha3.d.ts b/lib.esm/crypto/sha3.d.ts deleted file mode 100644 index 34e1d42f6..000000000 --- a/lib.esm/crypto/sha3.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { BytesLike } from "../utils/data.js"; -declare const _sha256: (data: Uint8Array) => string; -declare const _sha512: (data: Uint8Array) => string; -/** - * Compute the cryptographic SHA3-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare enum SupportedAlgorithm { - sha256 = "sha256", - sha512 = "sha512" -} -export declare function ripemd160(data: BytesLike): string; -export declare function sha256(data: BytesLike): string; -export declare namespace sha256 { - export { _sha256 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export declare function legacySha256(data: BytesLike): string; -export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string; -/** - * Compute the cryptographic SHA3-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -export declare function sha512(data: BytesLike): string; -export declare namespace sha512 { - export { _sha512 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/sha3.d.ts.map b/lib.esm/crypto/sha3.d.ts.map deleted file mode 100644 index d71f0360e..000000000 --- a/lib.esm/crypto/sha3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAqB,MAAM,kBAAkB,CAAC;AAM1E,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AACvD,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AAOvD;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,kBAAkB;IAC7B,MAAM,WAAW;IACjB,MAAM,WAAW;CACjB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAkCX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI;;AAlCxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIpD;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR;AAcD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAGX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI"} \ No newline at end of file diff --git a/lib.esm/crypto/sha3.js b/lib.esm/crypto/sha3.js deleted file mode 100644 index 951d632ff..000000000 --- a/lib.esm/crypto/sha3.js +++ /dev/null @@ -1,100 +0,0 @@ -import { Logger } from "../logger/logger.js"; -import { arrayify, getBytes, hexlify } from "../utils/data.js"; -import { createHash, createHmac } from "./crypto.js"; -import { Buffer } from "buffer"; -const logger = new Logger("sha3/0.0.1"); -const _sha256 = (data) => hexlify(createHash("sha3-256").update(data).digest()); -const _sha512 = (data) => hexlify(createHash("sha3-512").update(data).digest()); -let __sha256 = _sha256; -let __sha512 = _sha512; -let locked256 = false, locked512 = false; -/** - * Compute the cryptographic SHA3-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export var SupportedAlgorithm; -(function (SupportedAlgorithm) { - SupportedAlgorithm["sha256"] = "sha256"; - SupportedAlgorithm["sha512"] = "sha512"; -})(SupportedAlgorithm || (SupportedAlgorithm = {})); -export function ripemd160(data) { - return hexlify(createHash("ripemd160").update(getBytes(data)).digest()); -} -export function sha256(data) { - return hexlify(__sha256(getBytes(data))); -} -export function legacySha256(data) { - const _data = getBytes(data, "data"); - const hexlified = hexlify(createHash("sha256").update(_data).digest()); - return hexlified; -} -export function computeHmac(algorithm, key, data) { - const d = Buffer.from(arrayify(data)); - const k = Buffer.from(arrayify(key)); - if (algorithm === SupportedAlgorithm.sha256) { - return hexlify(createHmac("sha3-256", k).update(d).digest()); - } - else if (algorithm === SupportedAlgorithm.sha512) { - return hexlify(createHmac("sha3-512", k).update(d).digest()); - } - logger.throwError("unsupported algorithm - " + algorithm, Logger.errors.UNSUPPORTED_OPERATION, { - operation: "computeHmac", - algorithm: algorithm, - }); - return ""; -} -sha256._ = _sha256; -sha256.lock = function () { - locked256 = true; -}; -sha256.register = function (func) { - if (locked256) { - throw new Error("sha256 is locked"); - } - __sha256 = func; -}; -Object.freeze(sha256); -/** - * Compute the cryptographic SHA3-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -export function sha512(data) { - return hexlify(__sha512(getBytes(data))); -} -sha512._ = _sha512; -sha512.lock = function () { - locked512 = true; -}; -sha512.register = function (func) { - if (locked512) { - throw new Error("sha512 is locked"); - } - __sha512 = func; -}; -Object.freeze(sha512); -//# sourceMappingURL=sha3.js.map \ No newline at end of file diff --git a/lib.esm/crypto/sha3.js.map b/lib.esm/crypto/sha3.js.map deleted file mode 100644 index f79f699fe..000000000 --- a/lib.esm/crypto/sha3.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.js","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,M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MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;IACD,QAAQ,GAAG,IAAI,CAAC;AACjB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAEtB;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,UAAU,MAAM,CAAC,IAAe;IACrC,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC1C,CAAC;AACD,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC;AACnB,MAAM,CAAC,IAAI,GAAG;IACb,SAAS,GAAG,IAAI,CAAC;AAClB,CAAC,CAAC;AACF,MAAM,CAAC,QAAQ,GAAG,UAAU,IAAqC;IAChE,IAAI,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACrC,CAAC;IACD,QAAQ,GAAG,IAAI,CAAC;AACjB,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/crypto/signature.d.ts b/lib.esm/crypto/signature.d.ts deleted file mode 100644 index 075005c42..000000000 --- a/lib.esm/crypto/signature.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * A SignatureLike - * - * @_docloc: api/crypto:Signing - */ -export type SignatureLike = string; -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -export declare class Signature { - #private; - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r(): string; - set r(value: BytesLike); - /** - * The ``s`` value for a signature. - */ - get s(): string; - set s(_value: BytesLike); - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v(): 27 | 28; - set v(value: BigNumberish); - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV(): null | bigint; - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacynetworkId(): null | bigint; - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity(): 0 | 1; - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS(): string; - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized(): string; - /** - * The serialized representation. - */ - get serialized(): string; - /** - * @private - */ - constructor(guard: any, r: string, s: string, v: 27 | 28); - /** - * Returns a new identical [[Signature]]. - */ - clone(): Signature; - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON(): any; - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getnetworkId(45) - * //_result: - * - * Signature.getnetworkId(46) - * //_result: - */ - static getnetworkId(v: BigNumberish): bigint; - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getnetworkIdV(5, 27) - * //_result: - * - * Signature.getnetworkIdV(5, 28) - * //_result: - * - */ - static getnetworkIdV(networkId: BigNumberish, v: 27 | 28): bigint; - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v: BigNumberish): 27 | 28; -} -//# sourceMappingURL=signature.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/signature.d.ts.map b/lib.esm/crypto/signature.d.ts.map deleted file mode 100644 index cf72d7bd1..000000000 --- a/lib.esm/crypto/signature.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcjE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,SAAS;;IAMrB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAGrB;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAUtB;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAEf;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,YAAY,EAIxB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,IAAI,GAAG,MAAM,CAE5B;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,IAAI,GAAG,MAAM,CAMnC;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAOxB;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAMvD;IAMD;;OAEG;IACH,KAAK,IAAI,SAAS,CAMjB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CASZ;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAY3C;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM,CAEhE;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE,CAc9C;CAUD"} \ No newline at end of file diff --git a/lib.esm/crypto/signature.js b/lib.esm/crypto/signature.js deleted file mode 100644 index b682de18f..000000000 --- a/lib.esm/crypto/signature.js +++ /dev/null @@ -1,221 +0,0 @@ -import { concat, dataLength, getBigInt, getBytes, getNumber, hexlify, assertArgument, assertPrivate, } from "../utils/index.js"; -// Constants -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_2 = BigInt(2); -const BN_27 = BigInt(27); -const BN_28 = BigInt(28); -const BN_35 = BigInt(35); -const _guard = {}; -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -export class Signature { - #r; - #s; - #v; - #networkV; - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r() { - return this.#r; - } - set r(value) { - assertArgument(dataLength(value) === 32, "invalid r", "value", value); - this.#r = hexlify(value); - } - /** - * The ``s`` value for a signature. - */ - get s() { - return this.#s; - } - set s(_value) { - assertArgument(dataLength(_value) === 32, "invalid s", "value", _value); - const value = hexlify(_value); - assertArgument(parseInt(value.substring(0, 3)) < 8, "non-canonical s", "value", value); - this.#s = value; - } - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v() { - return this.#v; - } - set v(value) { - const v = getNumber(value, "value"); - assertArgument(v === 27 || v === 28, "invalid v", "v", value); - this.#v = v; - } - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV() { - return this.#networkV; - } - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacynetworkId() { - const v = this.networkV; - if (v == null) { - return null; - } - return Signature.getnetworkId(v); - } - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity() { - return this.v === 27 ? 0 : 1; - } - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS() { - // The EIP-2098 compact representation - const yParityAndS = getBytes(this.s); - if (this.yParity) { - yParityAndS[0] |= 0x80; - } - return hexlify(yParityAndS); - } - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized() { - return concat([this.r, this.yParityAndS]); - } - /** - * The serialized representation. - */ - get serialized() { - return concat([this.r, this.s, this.yParity ? "0x1c" : "0x1b"]); - } - /** - * @private - */ - constructor(guard, r, s, v) { - assertPrivate(guard, _guard, "Signature"); - this.#r = r; - this.#s = s; - this.#v = v; - this.#networkV = null; - } - [Symbol.for("nodejs.util.inspect.custom")]() { - return `Signature { r: "${this.r}", s: "${this.s}", yParity: ${this.yParity}, networkV: ${this.networkV} }`; - } - /** - * Returns a new identical [[Signature]]. - */ - clone() { - const clone = new Signature(_guard, this.r, this.s, this.v); - if (this.networkV) { - clone.#networkV = this.networkV; - } - return clone; - } - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON() { - const networkV = this.networkV; - return { - _type: "signature", - networkV: networkV != null ? networkV.toString() : null, - r: this.r, - s: this.s, - v: this.v, - }; - } - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getnetworkId(45) - * //_result: - * - * Signature.getnetworkId(46) - * //_result: - */ - static getnetworkId(v) { - const bv = getBigInt(v, "v"); - // The v is not an EIP-155 v, so it is the unspecified chain ID - if (bv == BN_27 || bv == BN_28) { - return BN_0; - } - // Bad value for an EIP-155 v - assertArgument(bv >= BN_35, "invalid EIP-155 v", "v", v); - return (bv - BN_35) / BN_2; - } - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getnetworkIdV(5, 27) - * //_result: - * - * Signature.getnetworkIdV(5, 28) - * //_result: - * - */ - static getnetworkIdV(networkId, v) { - return getBigInt(networkId) * BN_2 + BigInt(35 + v - 27); - } - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v) { - const bv = getBigInt(v); - if (bv === BN_0 || bv === BN_27) { - return 27; - } - if (bv === BN_1 || bv === BN_28) { - return 28; - } - assertArgument(bv >= BN_35, "invalid v", "v", v); - // Otherwise, EIP-155 v means odd is 27 and even is 28 - return bv & BN_1 ? 27 : 28; - } -} -//# sourceMappingURL=signature.js.map \ No newline at end of file diff --git a/lib.esm/crypto/signature.js.map b/lib.esm/crypto/signature.js.map deleted file mode 100644 index 934189994..000000000 --- a/lib.esm/crypto/signature.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,cAAc,EACd,aAAa,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\ No newline at end of file diff --git a/lib.esm/crypto/signing-key.d.ts b/lib.esm/crypto/signing-key.d.ts deleted file mode 100644 index 3ce0c2ea0..000000000 --- a/lib.esm/crypto/signing-key.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -import type { BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "./index.js"; -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -export declare class SigningKey { - #private; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey: BytesLike); - /** - * The private key. - */ - get privateKey(): string; - /** The 57-byte Ed448 public key encoded as hex. */ - get publicKey(): string; - /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ - get compressedPublicKey(): string; - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest: BytesLike): string; - /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ - computeSharedSecret(other: BytesLike): string; - /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ - static computePublicKey(key: BytesLike, compressed?: boolean): string; - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string; - /** Adds two encoded Ed448 public points. The compression flag is ignored. */ - static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string; -} -//# sourceMappingURL=signing-key.d.ts.map \ No newline at end of file diff --git a/lib.esm/crypto/signing-key.d.ts.map b/lib.esm/crypto/signing-key.d.ts.map deleted file mode 100644 index 1185a52a8..000000000 --- a/lib.esm/crypto/signing-key.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD;;;GAGG;AACH,qBAAa,UAAU;;IAGtB;;OAEG;IACH,YAAY,UAAU,EAAE,SAAS,EAYhC;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,mDAAmD;IACnD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,sEAAsE;IACtE,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAiC9B;IAED,uGAAuG;IACvG,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAgB5C;IAED,gGAAgG;IAChG,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAgBpE;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAmB3E;IAED,6EAA6E;IAC7E,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAY3E;CACD"} \ No newline at end of file diff --git a/lib.esm/crypto/signing-key.js b/lib.esm/crypto/signing-key.js deleted file mode 100644 index 7b3a9cd7c..000000000 --- a/lib.esm/crypto/signing-key.js +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -import { dataLength, getBytesCopy, hexlify, assertArgument, } from "../utils/index.js"; -import { arrayify, hexConcat } from "../utils/data.js"; -import { Logger } from "../logger/logger.js"; -import { ed448 } from "./crypto.js"; -import { Buffer } from "buffer"; -const logger = new Logger("signing-key/0.0.1"); -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -export class SigningKey { - #privateKey; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey) { - const normalized = typeof privateKey === "string" && !privateKey.startsWith("0x") - ? "0x" + privateKey - : privateKey; - assertArgument(dataLength(normalized) === 57, "invalid private key", "privateKey", "[REDACTED]"); - this.#privateKey = hexlify(normalized); - } - /** - * The private key. - */ - get privateKey() { - return this.#privateKey; - } - /** The 57-byte Ed448 public key encoded as hex. */ - get publicKey() { - return SigningKey.computePublicKey(this.#privateKey); - } - /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ - get compressedPublicKey() { - return SigningKey.computePublicKey(this.#privateKey, true); - } - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest) { - const key = getBytesCopy(this.#privateKey); - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const keyBuffer = new Uint8Array(arrayify(key)); - if (keyBuffer.length !== 57) { - logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - const digestBuffer = new Uint8Array(arrayify(digest)); - if (digestBuffer.length !== 32) { - logger.throwArgumentError("bad digest length", "digest", digest); - } - if (keyBuffer[56] > 127) { - const prefix = keyBuffer.slice(0, 57); - prefix[0] &= 0xfc; - prefix[55] |= 0x80; - prefix[56] = 0; - const scalar = prefix.slice(0, 56); - const bufferDigest = Buffer.from(digestBuffer); - const bufferPrfx = Buffer.from(prefix); - const bufferScalar = Buffer.from(scalar); - const sig = ed448.signWithScalar(bufferDigest, bufferScalar, bufferPrfx); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - const sig = ed448.sign(Buffer.from(digestBuffer), Buffer.from(keyBuffer)); - const hexlified = hexlify(sig); - return hexConcat([hexlified, this.publicKey]); - } - /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ - computeSharedSecret(other) { - const pub = Buffer.from(getBytesCopy(other)); - assertArgument(pub.length === 57 && ed448.publicKeyVerify(pub), "invalid public key", "other", other); - const key = Buffer.from(getBytesCopy(this.#privateKey)); - if (key[56] > 127) { - const scalar = key.subarray(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - return hexlify(ed448.deriveWithScalar(pub, scalar)); - } - return hexlify(ed448.derive(pub, key)); - } - /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ - static computePublicKey(key, compressed) { - const bytes = Buffer.from(arrayify(key)); - if (bytes.length !== 57) { - logger.throwArgumentError("invalid private key", "key", "[REDACTED]"); - } - if (bytes[56] > 127) { - const scalar = bytes.slice(0, 56); - scalar[0] &= 0xfc; - scalar[55] |= 0x80; - const pub = ed448.publicKeyFromScalar(scalar); - return hexlify(pub); - } - const pub = ed448.publicKeyCreate(bytes); - return hexlify(pub); - } - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest, signature) { - assertArgument(dataLength(digest) === 32, "invalid digest length", "digest", digest); - const digestBuffer = Buffer.from(arrayify(digest)); - const sigBuffer = Buffer.from(arrayify(signature)); - if (sigBuffer.length !== 171) { - logger.throwArgumentError("invalid signature", "signature", signature); - } - const sig = sigBuffer.slice(0, 114); - const pub = sigBuffer.slice(114); - if (ed448.verify(digestBuffer, sig, pub)) { - return hexlify(pub); - } - logger.throwArgumentError("invalid signature", "signature", signature); - return ""; - } - /** Adds two encoded Ed448 public points. The compression flag is ignored. */ - static addPoints(p0, p1, compressed) { - const points = [p0, p1].map((point) => { - const bytes = Buffer.from(getBytesCopy(point)); - assertArgument(bytes.length === 57 && ed448.publicKeyVerify(bytes), "invalid public key", "point", point); - return bytes; - }); - return hexlify(ed448.publicKeyCombine(points)); - } -} -//# sourceMappingURL=signing-key.js.map \ No newline at end of file diff --git a/lib.esm/crypto/signing-key.js.map b/lib.esm/crypto/signing-key.js.map deleted file mode 100644 index bc7673ee6..000000000 --- a/lib.esm/crypto/signing-key.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signing-key.js","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACN,UAAU,EACV,YAAY,EACZ,OAAO,EACP,cAAc,GACd,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE/C;;;GAGG;AACH,MAAM,OAAO,UAAU;IACtB,WAAW,CAAS;IAEpB;;OAEG;IACH,YAAY,UAAqB;QAChC,MAAM,UAAU,GACf,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC;YAC7D,CAAC,CAAC,IAAI,GAAG,UAAU;YACnB,CAAC,CAAC,UAAU,CAAC;QACf,cAAc,CACb,UAAU,CAAC,UAAU,CAAC,KAAK,EAAE,EAC7B,qBAAqB,EACrB,YAAY,EACZ,YAAY,CACZ,CAAC;QACF,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAI,UAAU;QACb,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED,mDAAmD;IACnD,IAAI,SAAS;QACZ,OAAO,UAAU,CAAC,gBAAgB,CAAC,IAAI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ash/id.d.ts deleted file mode 100644 index c55374a67..000000000 --- a/lib.esm/hash/id.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * - * @example: - * id("hello world") - * //_result: - */ -export declare function id(value: string, useKeccak?: boolean): string; -//# sourceMappingURL=id.d.ts.map \ No newline at end of file diff --git a/lib.esm/hash/id.d.ts.map b/lib.esm/hash/id.d.ts.map deleted file mode 100644 index 140f79634..000000000 --- a/lib.esm/hash/id.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAK7D"} \ No newline at end of file diff --git a/lib.esm/hash/id.js b/lib.esm/hash/id.js deleted file mode 100644 index d8a62e96f..000000000 --- a/lib.esm/hash/id.js +++ /dev/null @@ -1,19 +0,0 @@ -import { keccak256 } from "../crypto/keccak.js"; -import { sha256 } from "../crypto/sha3.js"; -import { toUtf8Bytes } from "../utils/index.js"; -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * - * @example: - * id("hello world") - * //_result: - */ -export function id(value, useKeccak) { - if (useKeccak) { - return keccak256(toUtf8Bytes(value)); - } - return sha256(toUtf8Bytes(value)); -} -//# sourceMappingURL=id.js.map \ No newline at end of file diff --git a/lib.esm/hash/id.js.map b/lib.esm/hash/id.js.map deleted file mode 100644 index 1ed001302..000000000 --- a/lib.esm/hash/id.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,EAAE,CAAC,KAAa,EAAE,SAAmB;IACpD,IAAI,SAAS,EAAE,CAAC;QACf,OAAO,SAAS,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;AACnC,CAAC"} \ No newline at end of file diff --git a/lib.esm/hash/index.d.ts b/lib.esm/hash/index.d.ts deleted file mode 100644 index a9ba6fa23..000000000 --- a/lib.esm/hash/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * About hashing here... - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ -export { id } from "./id.js"; -export { hashMessage, verifyMessage } from "./message.js"; -export { solidityPacked, solidityPackedSha256 } from "./solidity.js"; -export { TypedDataEncoder, verifyTypedData } from "./typed-data.js"; -export type { TypedDataDomain, TypedDataField } from "./typed-data.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/hash/index.d.ts.map b/lib.esm/hash/index.d.ts.map deleted file mode 100644 index 70eb7509e..000000000 --- a/lib.esm/hash/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.esm/hash/index.js b/lib.esm/hash/index.js deleted file mode 100644 index bd803eab7..000000000 --- a/lib.esm/hash/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * About hashing here... - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ -export { id } from "./id.js"; -export { hashMessage, verifyMessage } from "./message.js"; -export { solidityPacked, solidityPackedSha256 } from "./solidity.js"; -export { TypedDataEncoder, verifyTypedData } from "./typed-data.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/hash/index.js.map b/lib.esm/hash/index.js.map deleted file mode 100644 index dafc8e110..000000000 --- a/lib.esm/hash/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.esm/hash/message.d.ts b/lib.esm/hash/message.d.ts deleted file mode 100644 index c7776facd..000000000 --- a/lib.esm/hash/message.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { SignatureLike } from "../crypto/index.js"; -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -export declare function hashMessage(message: Uint8Array | string): string; -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export declare function verifyMessage(message: Uint8Array | string, sig: SignatureLike, prefix: string): string; -//# sourceMappingURL=message.d.ts.map \ No newline at end of file diff --git a/lib.esm/hash/message.d.ts.map b/lib.esm/hash/message.d.ts.map deleted file mode 100644 index 8c0421a97..000000000 --- a/lib.esm/hash/message.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAWhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,GACZ,MAAM,CAGR"} \ No newline at end of file diff --git a/lib.esm/hash/message.js b/lib.esm/hash/message.js deleted file mode 100644 index d7e0be54c..000000000 --- a/lib.esm/hash/message.js +++ /dev/null @@ -1,49 +0,0 @@ -import { MessagePrefix } from "../constants/index.js"; -import { recoverAddress } from "../transaction/index.js"; -import { concat, toUtf8Bytes } from "../utils/index.js"; -import { sha256 } from "../crypto/index.js"; -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -export function hashMessage(message) { - if (typeof message === "string") { - message = toUtf8Bytes(message); - } - return sha256(concat([ - toUtf8Bytes(MessagePrefix), - toUtf8Bytes(String(message.length)), - message, - ])); -} -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export function verifyMessage(message, sig, prefix) { - const digest = hashMessage(message); - return recoverAddress(digest, sig, prefix); -} -//# sourceMappingURL=message.js.map \ No newline at end of file diff --git a/lib.esm/hash/message.js.map b/lib.esm/hash/message.js.map deleted file mode 100644 index 8a4f8edf6..000000000 --- a/lib.esm/hash/message.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAiB,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,WAAW,CAAC,OAA4B;IACvD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,MAAM,CACZ,MAAM,CAAC;QACN,WAAW,CAAC,aAAa,CAAC;QAC1B,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO;KACP,CAAC,CACF,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC5B,OAA4B,EAC5B,GAAkB,EAClB,MAAc;IAEd,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACpC,OAAO,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC"} \ No newline at end of file diff --git a/lib.esm/hash/solidity.d.ts b/lib.esm/hash/solidity.d.ts deleted file mode 100644 index f6e66a454..000000000 --- a/lib.esm/hash/solidity.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPacked(types: ReadonlyArray, values: ReadonlyArray): string; -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPackedSha256(types: ReadonlyArray, values: ReadonlyArray): string; -//# sourceMappingURL=solidity.d.ts.map \ No newline at end of file diff --git a/lib.esm/hash/solidity.d.ts.map b/lib.esm/hash/solidity.d.ts.map deleted file mode 100644 index 8a06af8f2..000000000 --- a/lib.esm/hash/solidity.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAER"} \ No newline at end of file diff --git a/lib.esm/hash/solidity.js b/lib.esm/hash/solidity.js deleted file mode 100644 index b9b2c6199..000000000 --- a/lib.esm/hash/solidity.js +++ /dev/null @@ -1,94 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { sha256 as _sha256 } from "../crypto/index.js"; -import { concat, dataLength, getBytes, hexlify, toBeArray, toTwos, toUtf8Bytes, zeroPadBytes, zeroPadValue, assertArgument, } from "../utils/index.js"; -const regexBytes = new RegExp("^bytes([0-9]+)$"); -const regexNumber = new RegExp("^(u?int)([0-9]*)$"); -const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$"); -function _pack(type, value, isArray) { - switch (type) { - case "address": - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(getAddress(value)); - case "string": - return toUtf8Bytes(value); - case "bytes": - return getBytes(value); - case "bool": - value = !!value ? "0x01" : "0x00"; - if (isArray) { - return getBytes(zeroPadValue(value, 32)); - } - return getBytes(value); - } - let match = type.match(regexNumber); - if (match) { - let signed = match[1] === "int"; - let size = parseInt(match[2] || "256"); - assertArgument((!match[2] || match[2] === String(size)) && - size % 8 === 0 && - size !== 0 && - size <= 256, "invalid number type", "type", type); - if (isArray) { - size = 256; - } - if (signed) { - value = toTwos(value, size); - } - return getBytes(zeroPadValue(toBeArray(value), size / 8)); - } - match = type.match(regexBytes); - if (match) { - const size = parseInt(match[1]); - assertArgument(String(size) === match[1] && size !== 0 && size <= 32, "invalid bytes type", "type", type); - assertArgument(dataLength(value) === size, `invalid value for ${type}`, "value", value); - if (isArray) { - return getBytes(zeroPadBytes(value, 32)); - } - return value; - } - match = type.match(regexArray); - if (match && Array.isArray(value)) { - const baseType = match[1]; - const count = parseInt(match[2] || String(value.length)); - assertArgument(count === value.length, `invalid array length for ${type}`, "value", value); - const result = []; - value.forEach(function (value) { - result.push(_pack(baseType, value, true)); - }); - return getBytes(concat(result)); - } - assertArgument(false, "invalid type", "type", type); -} -// @TODO: Array Enum -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export function solidityPacked(types, values) { - assertArgument(types.length === values.length, "wrong number of values; expected ${ types.length }", "values", values); - const tight = []; - types.forEach(function (type, index) { - tight.push(_pack(type, values[index])); - }); - return hexlify(concat(tight)); -} -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export function solidityPackedSha256(types, values) { - return _sha256(solidityPacked(types, values)); -} -//# sourceMappingURL=solidity.js.map \ No newline at end of file diff --git a/lib.esm/hash/solidity.js.map b/lib.esm/hash/solidity.js.map deleted file mode 100644 index c91bdab97..000000000 --- a/lib.esm/hash/solidity.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"solidity.js","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACN,MAAM,EACN,UAAU,EACV,QAAQ,EACR,OAAO,EACP,SAAS,EACT,MAAM,EACN,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACpD,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAEtD,SAAS,KAAK,CAAC,IAAY,EAAE,KAAU,EAAE,OAAiB;IACzD,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,SAAS;YACb,IAAI,OAAO,EAAE,CAAC;gBACb,OAAO,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE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,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACjC,CAAC;IAED,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,oBAAoB;AAEpB;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC7B,KAA4B,EAC5B,MAA0B;IAE1B,cAAc,CACb,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAC9B,oDAAoD,EACpD,QAAQ,EACR,MAAM,CACN,CAAC;IAEF,MAAM,KAAK,GAAsB,EAAE,CAAC;IACpC,KAAK,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,KAAK;QAClC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CACnC,KAA4B,EAC5B,MAA0B;IAE1B,OAAO,OAAO,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/lib.esm/hash/typed-data.d.ts b/lib.esm/hash/typed-data.d.ts deleted file mode 100644 index 76130b694..000000000 --- a/lib.esm/hash/typed-data.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -export interface TypedDataDomain { - name?: null | string; - version?: null | string; - networkId?: null | BigNumberish; - verifyingContract?: null | string; - salt?: null | BytesLike; -} -export interface TypedDataField { - name: string; - type: string; -} -export declare class TypedDataEncoder { - #private; - readonly primaryType: string; - get types(): Record>; - constructor(types: Record>); - getEncoder(type: string): (value: any) => string; - encodeType(name: string): string; - encodeData(type: string, value: any): string; - hashStruct(name: string, value: Record): string; - encode(value: Record): string; - hash(value: Record): string; - _visit(type: string, value: any, callback: (type: string, data: any) => any): any; - visit(value: Record, callback: (type: string, data: any) => any): any; - static from(types: Record>): TypedDataEncoder; - static getPrimaryType(types: Record>): string; - static hashStruct(name: string, types: Record>, value: Record): string; - static hashDomain(domain: TypedDataDomain): string; - static encode(domain: TypedDataDomain, types: Record>, value: Record): string; - static hash(domain: TypedDataDomain, types: Record>, value: Record): string; - static resolveNames(domain: TypedDataDomain, types: Record>, value: Record, resolveName: (name: string) => Promise): Promise<{ - domain: TypedDataDomain; - value: any; - }>; - static getPayload(domain: TypedDataDomain, types: Record>, value: Record): any; -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -export declare function verifyTypedData(domain: TypedDataDomain, types: Record>, value: Record, signature: string, prefix: string): string; -//# sourceMappingURL=typed-data.d.ts.map \ No newline at end of file diff --git a/lib.esm/hash/typed-data.d.ts.map b/lib.esm/hash/typed-data.d.ts.map deleted file mode 100644 index 27a189723..000000000 --- a/lib.esm/hash/typed-data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed-data.d.ts","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAYjE,MAAM,WAAW,eAAe;IAC/B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAChC,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAqKD,qBAAa,gBAAgB;;IAC5B,QAAQ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CAC9B,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,MAAM,CAMR"} \ No newline at end of file diff --git a/lib.esm/hash/typed-data.js b/lib.esm/hash/typed-data.js deleted file mode 100644 index f0ec2784b..000000000 --- a/lib.esm/hash/typed-data.js +++ /dev/null @@ -1,422 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { recoverAddress } from "../transaction/index.js"; -import { concat, defineProperties, getBigInt, getBytes, hexlify, isHexString, mask, toBeHex, toQuantity, toTwos, zeroPadValue, assertArgument, } from "../utils/index.js"; -import { id } from "./id.js"; -import { sha256 } from "../crypto/index.js"; -const padding = new Uint8Array(32); -padding.fill(0); -const BN__1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_MAX_UINT256 = BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); -function hexPadRight(value) { - const bytes = getBytes(value); - const padOffset = bytes.length % 32; - if (padOffset) { - return concat([bytes, padding.slice(padOffset)]); - } - return hexlify(bytes); -} -const hexTrue = toBeHex(BN_1, 32); -const hexFalse = toBeHex(BN_0, 32); -const domainFieldTypes = { - name: "string", - version: "string", - networkId: "uint256", - verifyingContract: "address", - salt: "bytes32", -}; -const domainFieldNames = [ - "name", - "version", - "networkId", - "verifyingContract", - "salt", -]; -function checkString(key) { - return function (value) { - assertArgument(typeof value === "string", `invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value); - return value; - }; -} -const domainChecks = { - name: checkString("name"), - version: checkString("version"), - networkId: function (_value) { - const value = getBigInt(_value, "domain.networkId"); - assertArgument(value >= 0, "invalid chain ID", "domain.networkId", _value); - if (Number.isSafeInteger(value)) { - return Number(value); - } - return toQuantity(value); - }, - verifyingContract: function (value) { - try { - return getAddress(value).toLowerCase(); - } - catch (error) { } - assertArgument(false, `invalid domain value "verifyingContract"`, "domain.verifyingContract", value); - }, - salt: function (value) { - const bytes = getBytes(value, "domain.salt"); - assertArgument(bytes.length === 32, `invalid domain value "salt"`, "domain.salt", value); - return hexlify(bytes); - }, -}; -function getBaseEncoder(type) { - // intXX and uintXX - { - const match = type.match(/^(u?)int(\d*)$/); - if (match) { - const signed = match[1] === ""; - const width = parseInt(match[2] || "256"); - assertArgument(width % 8 === 0 && - width !== 0 && - width <= 256 && - (match[2] == null || match[2] === String(width)), "invalid numeric width", "type", type); - const boundsUpper = mask(BN_MAX_UINT256, signed ? width - 1 : width); - const boundsLower = signed ? (boundsUpper + BN_1) * BN__1 : BN_0; - return function (_value) { - const value = getBigInt(_value, "value"); - assertArgument(value >= boundsLower && value <= boundsUpper, `value out-of-bounds for ${type}`, "value", value); - return toBeHex(signed ? toTwos(value, 256) : value, 32); - }; - } - } - // bytesXX - { - const match = type.match(/^bytes(\d+)$/); - if (match) { - const width = parseInt(match[1]); - assertArgument(width !== 0 && width <= 32 && match[1] === String(width), "invalid bytes width", "type", type); - return function (value) { - const bytes = getBytes(value); - assertArgument(bytes.length === width, `invalid length for ${type}`, "value", value); - return hexPadRight(value); - }; - } - } - switch (type) { - case "address": - return function (value) { - return zeroPadValue(getAddress(value), 32); - }; - case "bool": - return function (value) { - return !value ? hexFalse : hexTrue; - }; - case "bytes": - return function (value) { - return sha256(value); - }; - case "string": - return function (value) { - return id(value); - }; - } - return null; -} -function encodeType(name, fields) { - return `${name}(${fields - .map(({ name, type }) => type + " " + name) - .join(",")})`; -} -export class TypedDataEncoder { - primaryType; - #types; - get types() { - return JSON.parse(this.#types); - } - #fullTypes; - #encoderCache; - constructor(types) { - this.#types = JSON.stringify(types); - this.#fullTypes = new Map(); - this.#encoderCache = new Map(); - // Link struct types to their direct child structs - const links = new Map(); - // Link structs to structs which contain them as a child - const parents = new Map(); - // Link all subtypes within a given struct - const subtypes = new Map(); - Object.keys(types).forEach((type) => { - links.set(type, new Set()); - parents.set(type, []); - subtypes.set(type, new Set()); - }); - for (const name in types) { - const uniqueNames = new Set(); - for (const field of types[name]) { - // Check each field has a unique name - assertArgument(!uniqueNames.has(field.name), `duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types); - uniqueNames.add(field.name); - // Get the base type (drop any array specifiers) - const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1] || null; - assertArgument(baseType !== name, `circular type reference to ${JSON.stringify(baseType)}`, "types", types); - // Is this a base encoding type? - const encoder = getBaseEncoder(baseType); - if (encoder) { - continue; - } - assertArgument(parents.has(baseType), `unknown type ${JSON.stringify(baseType)}`, "types", types); - // Add linkage - parents.get(baseType).push(name); - links.get(name).add(baseType); - } - } - // Deduce the primary type - const primaryTypes = Array.from(parents.keys()).filter((n) => parents.get(n).length === 0); - assertArgument(primaryTypes.length !== 0, "missing primary type", "types", types); - assertArgument(primaryTypes.length === 1, `ambiguous primary types or unused types: ${primaryTypes - .map((t) => JSON.stringify(t)) - .join(", ")}`, "types", types); - defineProperties(this, { primaryType: primaryTypes[0] }); - // Check for circular type references - function checkCircular(type, found) { - assertArgument(!found.has(type), `circular type reference to ${JSON.stringify(type)}`, "types", types); - found.add(type); - for (const child of links.get(type)) { - if (!parents.has(child)) { - continue; - } - // Recursively check children - checkCircular(child, found); - // Mark all ancestors as having this decendant - for (const subtype of found) { - subtypes.get(subtype).add(child); - } - } - found.delete(type); - } - checkCircular(this.primaryType, new Set()); - // Compute each fully describe type - for (const [name, set] of subtypes) { - const st = Array.from(set); - st.sort(); - this.#fullTypes.set(name, encodeType(name, types[name]) + - st.map((t) => encodeType(t, types[t])).join("")); - } - } - getEncoder(type) { - let encoder = this.#encoderCache.get(type); - if (!encoder) { - encoder = this.#getEncoder(type); - this.#encoderCache.set(type, encoder); - } - return encoder; - } - #getEncoder(type) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return encoder; - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - const subtype = match[1]; - const subEncoder = this.getEncoder(subtype); - return (value) => { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - let result = value.map(subEncoder); - if (this.#fullTypes.has(subtype)) { - result = result.map(sha256); - } - return sha256(concat(result)); - }; - } - // Struct - const fields = this.types[type]; - if (fields) { - const encodedType = id(this.#fullTypes.get(type)); - return (value) => { - const values = fields.map(({ name, type }) => { - const result = this.getEncoder(type)(value[name]); - if (this.#fullTypes.has(type)) { - return sha256(result); - } - return result; - }); - values.unshift(encodedType); - return concat(values); - }; - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - encodeType(name) { - const result = this.#fullTypes.get(name); - assertArgument(result, `unknown type: ${JSON.stringify(name)}`, "name", name); - return result; - } - encodeData(type, value) { - return this.getEncoder(type)(value); - } - hashStruct(name, value) { - return sha256(this.encodeData(name, value)); - } - encode(value) { - return this.encodeData(this.primaryType, value); - } - hash(value) { - return this.hashStruct(this.primaryType, value); - } - _visit(type, value, callback) { - // Basic encoder type (address, bool, uint256, etc) - { - const encoder = getBaseEncoder(type); - if (encoder) { - return callback(type, value); - } - } - // Array - const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/); - if (match) { - assertArgument(!match[3] || parseInt(match[3]) === value.length, `array length mismatch; expected length ${parseInt(match[3])}`, "value", value); - return value.map((v) => this._visit(match[1], v, callback)); - } - // Struct - const fields = this.types[type]; - if (fields) { - return fields.reduce((accum, { name, type }) => { - accum[name] = this._visit(type, value[name], callback); - return accum; - }, {}); - } - assertArgument(false, `unknown type: ${type}`, "type", type); - } - visit(value, callback) { - return this._visit(this.primaryType, value, callback); - } - static from(types) { - return new TypedDataEncoder(types); - } - static getPrimaryType(types) { - return TypedDataEncoder.from(types).primaryType; - } - static hashStruct(name, types, value) { - return TypedDataEncoder.from(types).hashStruct(name, value); - } - static hashDomain(domain) { - const domainFields = []; - for (const name in domain) { - if (domain[name] == null) { - continue; - } - const type = domainFieldTypes[name]; - assertArgument(type, `invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain); - domainFields.push({ name, type }); - } - domainFields.sort((a, b) => { - return (domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name)); - }); - return TypedDataEncoder.hashStruct("EIP712Domain", { EIP712Domain: domainFields }, domain); - } - static encode(domain, types, value) { - return concat([ - "0x1901", - TypedDataEncoder.hashDomain(domain), - TypedDataEncoder.from(types).hash(value), - ]); - } - static hash(domain, types, value) { - return sha256(TypedDataEncoder.encode(domain, types, value)); - } - // Replaces all address types with ENS names with their looked up address - static async resolveNames(domain, types, value, resolveName) { - // Make a copy to isolate it from the object passed in - domain = Object.assign({}, domain); - // Allow passing null to ignore value - for (const key in domain) { - if (domain[key] == null) { - delete domain[key]; - } - } - // Look up all ENS names - const ensCache = {}; - // Do we need to look up the domain's verifyingContract? - if (domain.verifyingContract && - !isHexString(domain.verifyingContract, 20)) { - ensCache[domain.verifyingContract] = "0x"; - } - // We are going to use the encoder to visit all the base values - const encoder = TypedDataEncoder.from(types); - // Get a list of all the addresses - encoder.visit(value, (type, value) => { - if (type === "address" && !isHexString(value, 20)) { - ensCache[value] = "0x"; - } - return value; - }); - // Lookup each name - for (const name in ensCache) { - ensCache[name] = await resolveName(name); - } - // Replace the domain verifyingContract if needed - if (domain.verifyingContract && ensCache[domain.verifyingContract]) { - domain.verifyingContract = ensCache[domain.verifyingContract]; - } - // Replace all ENS names with their address - value = encoder.visit(value, (type, value) => { - if (type === "address" && ensCache[value]) { - return ensCache[value]; - } - return value; - }); - return { domain, value }; - } - static getPayload(domain, types, value) { - // Validate the domain fields - TypedDataEncoder.hashDomain(domain); - // Derive the EIP712Domain Struct reference type - const domainValues = {}; - const domainTypes = []; - domainFieldNames.forEach((name) => { - const value = domain[name]; - if (value == null) { - return; - } - domainValues[name] = domainChecks[name](value); - domainTypes.push({ name, type: domainFieldTypes[name] }); - }); - const encoder = TypedDataEncoder.from(types); - const typesWithDomain = Object.assign({}, types); - assertArgument(typesWithDomain.EIP712Domain == null, "types must not contain EIP712Domain type", "types.EIP712Domain", types); - typesWithDomain.EIP712Domain = domainTypes; - // Validate the data structures and types - encoder.encode(value); - return { - types: typesWithDomain, - domain: domainValues, - primaryType: encoder.primaryType, - message: encoder.visit(value, (type, value) => { - // bytes - if (type.match(/^bytes(\d*)/)) { - return hexlify(getBytes(value)); - } - // uint or int - if (type.match(/^u?int/)) { - return getBigInt(value).toString(); - } - switch (type) { - case "address": - return value.toLowerCase(); - case "bool": - return !!value; - case "string": - assertArgument(typeof value === "string", "invalid string", "value", value); - return value; - } - assertArgument(false, "unsupported type", "type", type); - }), - }; - } -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -export function verifyTypedData(domain, types, value, signature, prefix) { - return recoverAddress(TypedDataEncoder.hash(domain, types, value), signature, prefix); -} -//# sourceMappingURL=typed-data.js.map \ No newline at end of file diff --git a/lib.esm/hash/typed-data.js.map b/lib.esm/hash/typed-data.js.map deleted file mode 100644 index 6c922f01b..000000000 --- a/lib.esm/hash/typed-data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed-data.js","sourceRoot":"","sources":["../../src.ts/hash/typed-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EACN,MAAM,EACN,gBAAgB,EAChB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,WAAW,EACX,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,EACN,YAAY,EACZ,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,MAAM,OAAO,GAAG,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gB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,EAC3C,SAAS,EACT,MAAM,CACN,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/lib.esm/index.d.ts b/lib.esm/index.d.ts deleted file mode 100644 index 3fd593002..000000000 --- a/lib.esm/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the CoreBC library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -import { Buffer } from "buffer"; -export { Buffer }; -import * as corebc from "./corebc.js"; -export { corebc }; -export * from "./corebc.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/index.d.ts.map b/lib.esm/index.d.ts.map deleted file mode 100644 index 5841be6e6..000000000 --- a/lib.esm/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/lib.esm/index.js b/lib.esm/index.js deleted file mode 100644 index 45f378b72..000000000 --- a/lib.esm/index.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the CoreBC library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -import { Buffer } from "buffer"; -export { Buffer }; -import * as corebc from "./corebc.js"; -export { corebc }; -export * from "./corebc.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/index.js.map b/lib.esm/index.js.map deleted file mode 100644 index af4e10759..000000000 --- a/lib.esm/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/lib.esm/ipfs/index.d.ts b/lib.esm/ipfs/index.d.ts deleted file mode 100644 index e1bf33eb0..000000000 --- a/lib.esm/ipfs/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export declare const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; -export interface IpfsGatewayOptions { - template?: string; - maxResponseBytes?: number; - timeoutMs?: number; - fetch?: typeof globalThis.fetch; -} -/** Configurable IPFS resolution and bounded JSON loading. */ -export declare class IpfsGateway { - #private; - readonly template: string; - readonly maxResponseBytes: number; - readonly timeoutMs: number; - constructor(options?: IpfsGatewayOptions); - resolve(reference: string): URL; - readJson(reference: string): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/ipfs/index.d.ts.map b/lib.esm/ipfs/index.d.ts.map deleted file mode 100644 index baabf24dc..000000000 --- a/lib.esm/ipfs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/ipfs/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CAChC;AACD,6DAA6D;AAC7D,qBAAa,WAAW;;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,YAAY,OAAO,GAAE,kBAAuB,EAgB3C;IACD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAe9B;IACK,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0ClD;CACD"} \ No newline at end of file diff --git a/lib.esm/ipfs/index.js b/lib.esm/ipfs/index.js deleted file mode 100644 index 52692a400..000000000 --- a/lib.esm/ipfs/index.js +++ /dev/null @@ -1,73 +0,0 @@ -export const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; -/** Configurable IPFS resolution and bounded JSON loading. */ -export class IpfsGateway { - template; - maxResponseBytes; - timeoutMs; - #fetch; - constructor(options = {}) { - this.template = options.template ?? defaultIpfsGatewayTemplate; - this.maxResponseBytes = options.maxResponseBytes ?? 1024 * 1024; - this.timeoutMs = options.timeoutMs ?? 30_000; - this.#fetch = options.fetch ?? globalThis.fetch; - const templateUrl = new URL(this.template.replace("{cid}", "cid")); - if (!/^https?:$/.test(templateUrl.protocol) || - this.template.split("{cid}").length !== 2) - throw new TypeError("gateway template must be HTTP(S) and contain one {cid}"); - for (const value of [this.maxResponseBytes, this.timeoutMs]) - if (!Number.isSafeInteger(value) || value <= 0) - throw new TypeError("gateway limits must be positive safe integers"); - } - resolve(reference) { - const value = reference.trim(); - if (/^https?:\/\//i.test(value)) - return new URL(value); - const path = value.replace(/^ipfs:\/\//, "").replace(/^\/?ipfs\//, ""); - if (!/^[A-Za-z0-9]+(?:\/[^?#]*)?$/.test(path) || - path.split("/").some((part) => part === "." || part === "..")) - throw new TypeError("invalid IPFS reference"); - return new URL(this.template.replace("{cid}", path.split("/").map(encodeURIComponent).join("/"))); - } - async readJson(reference) { - const controller = new AbortController(); - const timer = setTimeout(() => controller.abort(), this.timeoutMs); - let reader; - try { - const response = await this.#fetch(this.resolve(reference), { - headers: { accept: "application/json" }, - signal: controller.signal, - }); - if (!response.ok) { - await response.body?.cancel(); - throw new Error(`IPFS gateway returned HTTP ${response.status}`); - } - if (!response.body) - throw new Error("IPFS gateway returned an empty body"); - reader = response.body.getReader(); - const chunks = []; - let length = 0; - while (true) { - const { done, value } = await reader.read(); - if (done) - break; - length += value.length; - if (length > this.maxResponseBytes) - throw new Error(`IPFS response exceeds ${this.maxResponseBytes} bytes`); - chunks.push(value); - } - const bytes = new Uint8Array(length); - let offset = 0; - for (const chunk of chunks) { - bytes.set(chunk, offset); - offset += chunk.length; - } - return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes)); - } - finally { - clearTimeout(timer); - await reader?.cancel().catch(() => { }); - reader?.releaseLock(); - } - } -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/ipfs/index.js.map b/lib.esm/ipfs/index.js.map deleted file mode 100644 index c4d8fd221..000000000 --- a/lib.esm/ipfs/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/ipfs/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAOjE,6DAA6D;AAC7D,MAAM,OAAO,WAAW;IACd,QAAQ,CAAS;IACjB,gBAAgB,CAAS;IACzB,SAAS,CAAS;IAClB,MAAM,CAA0B;IACzC,YAAY,OAAO,GAAuB,EAAE;QAC3C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,0BAA0B,CAAC;QAC/D,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,IAAI,GAAG,IAAI,CAAC;QAChE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC;QAC7C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CA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tD,CAAC;gBACH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;YACD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;YACrC,IAAI,MAAM,GAAG,CAAC,CAAC;YACf,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;gBAC5B,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;YACxB,CAAC;YACD,OAAO,IAAI,CAAC,KAAK,CAChB,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;QACH,CAAC;gBAAS,CAAC;YACV,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YACvC,MAAM,EAAE,WAAW,EAAE,CAAC;QACvB,CAAC;IACF,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/logger/logger.d.ts b/lib.esm/logger/logger.d.ts deleted file mode 100644 index df72240a3..000000000 --- a/lib.esm/logger/logger.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export declare enum LogLevel { - DEBUG = "DEBUG", - INFO = "INFO", - WARNING = "WARNING", - ERROR = "ERROR", - OFF = "OFF" -} -export declare enum ErrorCode { - UNKNOWN_ERROR = "UNKNOWN_ERROR", - NOT_IMPLEMENTED = "NOT_IMPLEMENTED", - UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION", - NETWORK_ERROR = "NETWORK_ERROR", - SERVER_ERROR = "SERVER_ERROR", - TIMEOUT = "TIMEOUT", - BUFFER_OVERRUN = "BUFFER_OVERRUN", - NUMERIC_FAULT = "NUMERIC_FAULT", - MISSING_NEW = "MISSING_NEW", - INVALID_ARGUMENT = "INVALID_ARGUMENT", - MISSING_ARGUMENT = "MISSING_ARGUMENT", - UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT", - CALL_EXCEPTION = "CALL_EXCEPTION", - INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS", - NONCE_EXPIRED = "NONCE_EXPIRED", - REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED", - UNPREDICTABLE_ENERGY_LIMIT = "UNPREDICTABLE_ENERGY_LIMIT", - TRANSACTION_REPLACED = "TRANSACTION_REPLACED" -} -export declare class Logger { - readonly version: string; - static errors: typeof ErrorCode; - static levels: typeof LogLevel; - constructor(version: string); - _log(logLevel: LogLevel, args: Array): void; - debug(...args: Array): void; - info(...args: Array): void; - warn(...args: Array): void; - makeError(message: string, code?: ErrorCode, params?: any): Error; - throwError(message: string, code?: ErrorCode, params?: any): never; - throwArgumentError(message: string, name: string, value: any): never; - assert(condition: any, message: string, code?: ErrorCode, params?: any): void; - assertArgument(condition: any, message: string, name: string, value: any): void; - checkNormalize(message?: string): void; - checkSafeUint53(value: number, message?: string): void; - checkArgumentCount(count: number, expectedCount: number, message?: string): void; - checkNew(target: any, kind: any): void; - checkAbstract(target: any, kind: any): void; - static globalLogger(): Logger; - static setCensorship(censorship: boolean, permanent?: boolean): void; - static setLogLevel(logLevel: LogLevel): void; - static from(version: string): Logger; -} -//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/lib.esm/logger/logger.d.ts.map b/lib.esm/logger/logger.d.ts.map deleted file mode 100644 index 1880f0d16..000000000 --- a/lib.esm/logger/logger.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src.ts/logger/logger.ts"],"names":[],"mappings":"AAmDA,oBAAY,QAAQ;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,GAAG,QAAQ;CACX;AAED,oBAAY,SAAS;IAKpB,aAAa,kBAAkB;IA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ACL,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,SAAS,EAChB,MAAM,CAAC,EAAE,GAAG,GACV,IAAI,CAKN;IAED,cAAc,CACb,SAAS,EAAE,GAAG,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,GACR,IAAI,CAKN;IAED,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAcrC;IAED,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAwBrD;IAED,kBAAkB,CACjB,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CA4BN;IAED,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAMrC;IAED,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAc1C;IAED,MAAM,CAAC,YAAY,IAAI,MAAM,CAK5B;IAED,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CA0BnE;IAED,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAO3C;IAED,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnC;CACD"} \ No newline at end of file diff --git a/lib.esm/logger/logger.js b/lib.esm/logger/logger.js deleted file mode 100644 index fcc9c082e..000000000 --- a/lib.esm/logger/logger.js +++ /dev/null @@ -1,329 +0,0 @@ -"use strict"; -let _permanentCensorErrors = false; -let _censorErrors = false; -const LogLevels = { - debug: 1, - default: 2, - info: 2, - warning: 3, - error: 4, - off: 5, -}; -let _logLevel = LogLevels["default"]; -let _globalLogger = null; -function _checkNormalize() { - try { - const missing = []; - // Make sure all forms of normalization are supported - ["NFD", "NFC", "NFKD", "NFKC"].forEach((form) => { - try { - if ("test".normalize(form) !== "test") { - throw new Error("bad normalize"); - } - } - catch (error) { - missing.push(form); - } - }); - if (missing.length) { - throw new Error("missing " + missing.join(", ")); - } - if (String.fromCharCode(0xe9).normalize("NFD") !== - String.fromCharCode(0x65, 0x0301)) { - throw new Error("broken implementation"); - } - } - catch (error) { - return error.message; - } - return null; -} -const _normalizeError = _checkNormalize(); -export var LogLevel; -(function (LogLevel) { - LogLevel["DEBUG"] = "DEBUG"; - LogLevel["INFO"] = "INFO"; - LogLevel["WARNING"] = "WARNING"; - LogLevel["ERROR"] = "ERROR"; - LogLevel["OFF"] = "OFF"; -})(LogLevel || (LogLevel = {})); -export var ErrorCode; -(function (ErrorCode) { - /////////////////// - // Generic Errors - // Unknown Error - ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR"; - // Not Implemented - ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED"; - // Unsupported Operation - // - operation - ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION"; - // Network Error (i.e. Core Network, such as an invalid network ID) - // - event ("noNetwork" is not re-thrown in provider.ready; otherwise thrown) - ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR"; - // Some sort of bad response from the server - ErrorCode["SERVER_ERROR"] = "SERVER_ERROR"; - // Timeout - ErrorCode["TIMEOUT"] = "TIMEOUT"; - /////////////////// - // Operational Errors - // Buffer Overrun - ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN"; - // Numeric Fault - // - operation: the operation being executed - // - fault: the reason this faulted - ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT"; - /////////////////// - // Argument Errors - // Missing new operator to an object - // - name: The name of the class - ErrorCode["MISSING_NEW"] = "MISSING_NEW"; - // Invalid argument (e.g. value is incompatible with type) to a function: - // - argument: The argument name that was invalid - // - value: The value of the argument - ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT"; - // Missing argument to a function: - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT"; - // Too many arguments - // - count: The number of arguments received - // - expectedCount: The number of arguments expected - ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT"; - /////////////////// - // Blockchain Errors - // Call exception - // - transaction: the transaction - // - address?: the contract address - // - args?: The arguments passed into the function - // - method?: The Solidity method signature - // - errorSignature?: The EIP848 error signature - // - errorArgs?: The EIP848 error parameters - // - reason: The reason (only for EIP848 "Error(string)") - ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION"; - // Insufficient funds (< value + energyLimit * energyPrice) - // - transaction: the transaction attempted - ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS"; - // Nonce has already been used - // - transaction: the transaction attempted - ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED"; - // The replacement fee for the transaction is too low - // - transaction: the transaction attempted - ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED"; - // The energy limit could not be estimated - // - transaction: the transaction passed to estimateEnergy - ErrorCode["UNPREDICTABLE_ENERGY_LIMIT"] = "UNPREDICTABLE_ENERGY_LIMIT"; - // The transaction was replaced by one with a higher energy price - // - reason: "cancelled", "replaced" or "repriced" - // - cancelled: true if reason == "cancelled" or reason == "replaced") - // - hash: original transaction hash - // - replacement: the full TransactionsResponse for the replacement - // - receipt: the receipt of the replacement - ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED"; -})(ErrorCode || (ErrorCode = {})); -const HEX = "0123456789abcdef"; -export class Logger { - version = "0.0.1"; - static errors = ErrorCode; - static levels = LogLevel; - constructor(version) { - Object.defineProperty(this, "version", { - enumerable: true, - value: version, - writable: false, - }); - } - _log(logLevel, args) { - const level = logLevel.toLowerCase(); - if (LogLevels[level] == null) { - this.throwArgumentError("invalid log level name", "logLevel", logLevel); - } - if (_logLevel > LogLevels[level]) { - return; - } - console.log.apply(console, args); - } - debug(...args) { - this._log(Logger.levels.DEBUG, args); - } - info(...args) { - this._log(Logger.levels.INFO, args); - } - warn(...args) { - this._log(Logger.levels.WARNING, args); - } - makeError(message, code, params) { - // Errors are being censored - if (_censorErrors) { - return this.makeError("censored error", code, {}); - } - if (!code) { - code = Logger.errors.UNKNOWN_ERROR; - } - if (!params) { - params = {}; - } - const messageDetails = []; - Object.keys(params).forEach((key) => { - const value = params[key]; - try { - if (value instanceof Uint8Array) { - let hex = ""; - for (let i = 0; i < value.length; i++) { - hex += HEX[value[i] >> 4]; - hex += HEX[value[i] & 0x0f]; - } - messageDetails.push(key + "=Uint8Array(0x" + hex + ")"); - } - else { - messageDetails.push(key + "=" + JSON.stringify(value)); - } - } - catch (error) { - messageDetails.push(key + "=" + JSON.stringify(params[key].toString())); - } - }); - messageDetails.push(`code=${code}`); - messageDetails.push(`version=${this.version}`); - const reason = message; - if (messageDetails.length) { - message += " (" + messageDetails.join(", ") + ")"; - } - // @TODO: Any?? - const error = new Error(message); - error.reason = reason; - error.code = code; - Object.keys(params).forEach(function (key) { - error[key] = params[key]; - }); - return error; - } - throwError(message, code, params) { - throw this.makeError(message, code, params); - } - throwArgumentError(message, name, value) { - return this.throwError(message, Logger.errors.INVALID_ARGUMENT, { - argument: name, - value: value, - }); - } - assert(condition, message, code, params) { - if (!!condition) { - return; - } - this.throwError(message, code, params); - } - assertArgument(condition, message, name, value) { - if (!!condition) { - return; - } - this.throwArgumentError(message, name, value); - } - checkNormalize(message) { - if (message == null) { - message = "platform missing String.prototype.normalize"; - } - if (_normalizeError) { - this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "String.prototype.normalize", - form: _normalizeError, - }); - } - } - checkSafeUint53(value, message) { - if (typeof value !== "number") { - return; - } - if (message == null) { - message = "value not safe"; - } - if (value < 0 || value >= 0x1fffffffffffff) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "out-of-safe-range", - value: value, - }); - } - if (value % 1) { - this.throwError(message, Logger.errors.NUMERIC_FAULT, { - operation: "checkSafeInteger", - fault: "non-integer", - value: value, - }); - } - } - checkArgumentCount(count, expectedCount, message) { - if (message) { - message = ": " + message; - } - else { - message = ""; - } - if (count < expectedCount) { - this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - if (count > expectedCount) { - this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, { - count: count, - expectedCount: expectedCount, - }); - } - } - checkNew(target, kind) { - if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - checkAbstract(target, kind) { - if (target === kind) { - this.throwError("cannot instantiate abstract class " + - JSON.stringify(kind.name) + - " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, { name: target.name, operation: "new" }); - } - else if (target === Object || target == null) { - this.throwError("missing new", Logger.errors.MISSING_NEW, { - name: kind.name, - }); - } - } - static globalLogger() { - if (!_globalLogger) { - _globalLogger = new Logger("logger/0.0.1"); - } - return _globalLogger; - } - static setCensorship(censorship, permanent) { - if (!censorship && permanent) { - this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - if (_permanentCensorErrors) { - if (!censorship) { - return; - } - this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, { - operation: "setCensorship", - }); - } - _censorErrors = !!censorship; - _permanentCensorErrors = !!permanent; - } - static setLogLevel(logLevel) { - const level = LogLevels[logLevel.toLowerCase()]; - if (level == null) { - Logger.globalLogger().warn("invalid log level - " + logLevel); - return; - } - _logLevel = level; - } - static from(version) { - return new Logger(version); - } -} -//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/lib.esm/logger/logger.js.map b/lib.esm/logger/logger.js.map deleted file mode 100644 index d92d0abf6..000000000 --- a/lib.esm/log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AAC,MAAM,CAAC,qBAAqB,EACnC;gBACC,SAAS,EAAE,eAAe;aAC1B,CACD,CAAC;QACH,CAAC;QAED,aAAa,GAAG,CAAC,CAAC,UAAU,CAAC;QAC7B,sBAAsB,GAAG,CAAC,CAAC,SAAS,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,QAAkB;QACpC,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAChD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,sBAAsB,GAAG,QAAQ,CAAC,CAAC;YAC9D,OAAO;QACR,CAAC;QACD,SAAS,GAAG,KAAK,CAAC;IACnB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,OAAe;QAC1B,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/package.json b/lib.esm/package.json deleted file mode 100644 index e10f33ed2..000000000 --- a/lib.esm/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "type": "module", - "sideEffects": false, - "browser": { - "./crypto/crypto.js": "./crypto/crypto-browser.js", - "./providers/provider-ipcsocket.js": "./providers/provider-ipcsocket-browser.js", - "./providers/ws.js": "./providers/ws-browser.js", - "./utils/base64.js": "./utils/base64-browser.js", - "./utils/geturl.js": "./utils/geturl-browser.js", - "./crypto/ed448goldilock.js": "./crypto/ed448goldilock-browser.js", - "./wordlists/wordlists.js": "./wordlists/wordlists-browser.js" - } -} diff --git a/lib.esm/providers/abstract-provider.d.ts b/lib.esm/providers/abstract-provider.d.ts deleted file mode 100644 index 79ee0dee3..000000000 --- a/lib.esm/providers/abstract-provider.d.ts +++ /dev/null @@ -1,211 +0,0 @@ -/** - * About Subclassing the Provider... - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { Block, FeeData, Log, TransactionReceipt, TransactionResponse } from "./provider.js"; -import type { AddressLike } from "../address/index.js"; -import type { BigNumberish } from "../utils/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Networkish } from "./network.js"; -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -import type { BlockTag, EventFilter, Filter, FilterByBlockHash, OrphanFilter, PreparedTransactionRequest, Provider, ProviderEvent, TransactionRequest } from "./provider.js"; -export type DebugEventAbstractProvider = { - action: "sendCcipReadFetchRequest"; - request: FetchRequest; - index: number; - urls: Array; -} | { - action: "receiveCcipReadFetchResult"; - request: FetchRequest; - result: any; -} | { - action: "receiveCcipReadFetchError"; - request: FetchRequest; - result: any; -} | { - action: "sendCcipReadCall"; - transaction: { - to: string; - data: string; - }; -} | { - action: "receiveCcipReadCallResult"; - transaction: { - to: string; - data: string; - }; - result: string; -} | { - action: "receiveCcipReadCallError"; - transaction: { - to: string; - data: string; - }; - error: Error; -}; -export type Subscription = { - type: "block" | "close" | "debug" | "error" | "network" | "pending"; - tag: string; -} | { - type: "transaction"; - tag: string; - hash: string; -} | { - type: "event"; - tag: string; - filter: EventFilter; -} | { - type: "orphan"; - tag: string; - filter: OrphanFilter; -}; -export interface Subscriber { - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; - pollingInterval?: number; -} -export declare class UnmanagedSubscriber implements Subscriber { - name: string; - constructor(name: string); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -export interface AbstractProviderPlugin { - readonly name: string; - connect(provider: AbstractProvider): AbstractProviderPlugin; -} -export type PerformActionFilter = { - address?: string | Array; - topics?: Array>; - fromBlock?: BlockTag; - toBlock?: BlockTag; -} | { - address?: string | Array; - topics?: Array>; - blockHash?: string; -}; -export interface PerformActionTransaction extends PreparedTransactionRequest { - to?: string; - from?: string; -} -export type PerformActionRequest = { - method: "broadcastTransaction"; - signedTransaction: string; -} | { - method: "call"; - transaction: PerformActionTransaction; - blockTag: BlockTag; -} | { - method: "networkId"; -} | { - method: "estimateEnergy"; - transaction: PerformActionTransaction; -} | { - method: "getBalance"; - address: string; - blockTag: BlockTag; -} | { - method: "getBlock"; - blockTag: BlockTag; - includeTransactions: boolean; -} | { - method: "getBlock"; - blockHash: string; - includeTransactions: boolean; -} | { - method: "getBlockNumber"; -} | { - method: "getCode"; - address: string; - blockTag: BlockTag; -} | { - method: "getEnergyPrice"; -} | { - method: "getLogs"; - filter: PerformActionFilter; -} | { - method: "getStorage"; - address: string; - position: bigint; - blockTag: BlockTag; -} | { - method: "getTransaction"; - hash: string; -} | { - method: "getTransactionCount"; - address: string; - blockTag: BlockTag; -} | { - method: "getTransactionReceipt"; - hash: string; -} | { - method: "getTransactionResult"; - hash: string; -}; -export declare class AbstractProvider implements Provider { - #private; - constructor(_network?: "any" | Networkish); - get provider(): this; - get plugins(): Array; - attachPlugin(plugin: AbstractProviderPlugin): this; - getPlugin(name: string): null | T; - get disableCcipRead(): boolean; - set disableCcipRead(value: boolean); - ccipReadFetch(tx: PerformActionTransaction, calldata: string, urls: Array): Promise; - _wrapBlock(value: BlockParams, network: Network): Block; - _wrapLog(value: LogParams, network: Network): Log; - _wrapTransactionReceipt(value: TransactionReceiptParams, network: Network): TransactionReceipt; - _wrapTransactionResponse(tx: TransactionResponseParams, network: Network): TransactionResponse; - _detectNetwork(): Promise; - _perform(req: PerformActionRequest): Promise; - getBlockNumber(): Promise; - _getAddress(address: AddressLike): string | Promise; - _getBlockTag(blockTag?: BlockTag): string | Promise; - _getFilter(filter: Filter | FilterByBlockHash): PerformActionFilter | Promise; - _getTransactionRequest(_request: TransactionRequest): PerformActionTransaction | Promise; - getNetwork(): Promise; - getEnergyPrice(): Promise; - getFeeData(): Promise; - estimateEnergy(_tx: TransactionRequest): Promise; - call(_tx: TransactionRequest): Promise; - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - getStorage(address: AddressLike, _position: BigNumberish, blockTag?: BlockTag): Promise; - broadcastTransaction(signedTx: string): Promise; - getBlock(block: BlockTag | string, prefetchTxs?: boolean): Promise; - getTransaction(hash: string): Promise; - getTransactionReceipt(hash: string): Promise; - getTransactionResult(hash: string): Promise; - getLogs(_filter: Filter | FilterByBlockHash): Promise>; - _getProvider(networkId: number): AbstractProvider; - waitForTransaction(hash: string, _confirms?: null | number, timeout?: null | number): Promise; - waitForBlock(blockTag?: BlockTag): Promise; - _clearTimeout(timerId: number): void; - _setTimeout(_func: () => void, timeout?: number): number; - _forEachSubscriber(func: (s: Subscriber) => void): void; - _getSubscriber(sub: Subscription): Subscriber; - _recoverSubscriber(oldSub: Subscriber, newSub: Subscriber): void; - on(event: ProviderEvent, listener: Listener): Promise; - once(event: ProviderEvent, listener: Listener): Promise; - emit(event: ProviderEvent, ...args: Array): Promise; - listenerCount(event?: ProviderEvent): Promise; - listeners(event?: ProviderEvent): Promise>; - off(event: ProviderEvent, listener?: Listener): Promise; - removeAllListeners(event?: ProviderEvent): Promise; - addListener(event: ProviderEvent, listener: Listener): Promise; - removeListener(event: ProviderEvent, listener: Listener): Promise; - destroy(): void; - get paused(): boolean; - set paused(pause: boolean); - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=abstract-provider.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/abstract-provider.d.ts.map b/lib.esm/providers/abstract-provider.d.ts.map deleted file mode 100644 index b293b4e8f..000000000 --- a/lib.esm/providers/abstract-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAaN,YAAY,EAOZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAEN,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I,CAAC,CAgB7D;IAGK,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;IAGK,cAAc,CACnB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;IAID,OAAO,IAAI,IAAI,CAQd;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAUxB;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CA6BrC;IAED,MAAM,IAAI,IAAI,CAoBb;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/abstract-provider.js b/lib.esm/providers/abstract-provider.js deleted file mode 100644 index a1ba76591..000000000 --- a/lib.esm/providers/abstract-provider.js +++ /dev/null @@ -1,1235 +0,0 @@ -/** - * About Subclassing the Provider... - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -// @TODO -// Event coalescence -// When we register an event with an async value (e.g. address is a Signer -// or ENS name), we need to add it immeidately for the Event API, but also -// need time to resolve the address. Upon resolving the address, we need to -// migrate the listener to the static event. We also need to maintain a map -// of Signer/ENS name to address so we can sync respond to listenerCount. -import { resolveAddress } from "../address/checks.js"; -import { Transaction } from "../transaction/index.js"; -import { concat, dataLength, dataSlice, hexlify, isHexString, getBigInt, getBytes, getNumber, isCallException, makeError, assert, assertArgument, FetchRequest, toBeArray, toQuantity, defineProperties, EventPayload, resolveProperties, toUtf8String, } from "../utils/index.js"; -import { formatBlock, formatLog, formatTransactionReceipt, formatTransactionResponse, } from "./format.js"; -import { Network } from "./network.js"; -import { copyRequest, Block, FeeData, Log, TransactionReceipt, TransactionResponse, } from "./provider.js"; -import { PollingBlockSubscriber, PollingEventSubscriber, PollingOrphanSubscriber, PollingTransactionSubscriber, } from "./subscriber-polling.js"; -const MAX_CCIP_REDIRECTS = 10; -function isPromise(value) { - return value && typeof value.then === "function"; -} -function getTag(prefix, value) { - return (prefix + - ":" + - JSON.stringify(value, (k, v) => { - if (v == null) { - return "null"; - } - if (typeof v === "bigint") { - return `bigint:${v.toString()}`; - } - if (typeof v === "string") { - return v.toLowerCase(); - } - // Sort object keys - if (typeof v === "object" && !Array.isArray(v)) { - const keys = Object.keys(v); - keys.sort(); - return keys.reduce((accum, key) => { - accum[key] = v[key]; - return accum; - }, {}); - } - return v; - })); -} -export class UnmanagedSubscriber { - name; - constructor(name) { - defineProperties(this, { name }); - } - start() { } - stop() { } - pause(dropWhilePaused) { } - resume() { } -} -function copy(value) { - return JSON.parse(JSON.stringify(value)); -} -function concisify(items) { - items = Array.from(new Set(items).values()); - items.sort(); - return items; -} -async function getSubscription(_event, provider) { - if (_event == null) { - throw new Error("invalid event"); - } - // Normalize topic array info an EventFilter - if (Array.isArray(_event)) { - _event = { topics: _event }; - } - if (typeof _event === "string") { - switch (_event) { - case "block": - case "pending": - case "debug": - case "error": - case "network": { - return { type: _event, tag: _event }; - } - } - } - if (isHexString(_event, 32)) { - const hash = _event.toLowerCase(); - return { type: "transaction", tag: getTag("tx", { hash }), hash }; - } - if (_event.orphan) { - const event = _event; - // @TODO: Should lowercase and whatnot things here instead of copy... - return { - type: "orphan", - tag: getTag("orphan", event), - filter: copy(event), - }; - } - if (_event.address || _event.topics) { - const event = _event; - const filter = { - topics: (event.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }), - }; - if (event.address) { - const addresses = []; - const promises = []; - const addAddress = (addr) => { - if (isHexString(addr)) { - addresses.push(addr); - } - else { - promises.push((async () => { - addresses.push(await resolveAddress(addr)); - })()); - } - }; - if (Array.isArray(event.address)) { - event.address.forEach(addAddress); - } - else { - addAddress(event.address); - } - if (promises.length) { - await Promise.all(promises); - } - filter.address = concisify(addresses.map((a) => a.toLowerCase())); - } - return { filter, tag: getTag("event", filter), type: "event" }; - } - assertArgument(false, "unknown ProviderEvent", "event", _event); -} -function getTime() { - return new Date().getTime(); -} -export class AbstractProvider { - #subs; - #plugins; - // null=unpaused, true=paused+dropWhilePaused, false=paused - #pausedState; - #networkPromise; - #anyNetwork; - #performCache; - // The most recent block number if running an event or -1 if no "block" event - #lastBlockNumber; - #nextTimer; - #timers; - #disableCcipRead; - // @TODO: This should be a () => Promise so network can be - // done when needed; or rely entirely on _detectNetwork? - constructor(_network) { - if (_network === "any") { - this.#anyNetwork = true; - this.#networkPromise = null; - } - else if (_network) { - const network = Network.from(_network); - this.#anyNetwork = false; - this.#networkPromise = Promise.resolve(network); - setTimeout(() => { - this.emit("network", network, null); - }, 0); - } - else { - this.#anyNetwork = false; - this.#networkPromise = null; - } - this.#lastBlockNumber = -1; - this.#performCache = new Map(); - this.#subs = new Map(); - this.#plugins = new Map(); - this.#pausedState = null; - this.#nextTimer = 1; - this.#timers = new Map(); - this.#disableCcipRead = false; - } - get provider() { - return this; - } - get plugins() { - return Array.from(this.#plugins.values()); - } - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.connect(this)); - return this; - } - getPlugin(name) { - return this.#plugins.get(name) || null; - } - get disableCcipRead() { - return this.#disableCcipRead; - } - set disableCcipRead(value) { - this.#disableCcipRead = !!value; - } - // Shares multiple identical requests made during the same 250ms - async #perform(req) { - // Create a tag - const tag = getTag(req.method, req); - let perform = this.#performCache.get(tag); - if (!perform) { - perform = this._perform(req); - this.#performCache.set(tag, perform); - setTimeout(() => { - if (this.#performCache.get(tag) === perform) { - this.#performCache.delete(tag); - } - }, 250); - } - return await perform; - } - async ccipReadFetch(tx, calldata, urls) { - if (this.disableCcipRead || urls.length === 0 || tx.to == null) { - return null; - } - const sender = tx.to.toLowerCase(); - const data = calldata.toLowerCase(); - const errorMessages = []; - for (let i = 0; i < urls.length; i++) { - const url = urls[i]; - // URL expansion - const href = url.replace("{sender}", sender).replace("{data}", data); - // If no {data} is present, use POST; otherwise GET - //const json: string | null = (url.indexOf("{data}") >= 0) ? null: JSON.stringify({ data, sender }); - //const result = await fetchJson({ url: href, errorPassThrough: true }, json, (value, response) => { - // value.status = response.statusCode; - // return value; - //}); - const request = new FetchRequest(href); - if (url.indexOf("{data}") === -1) { - request.body = { data, sender }; - } - this.emit("debug", { - action: "sendCcipReadFetchRequest", - request, - index: i, - urls, - }); - let errorMessage = "unknown error"; - const resp = await request.send(); - try { - const result = resp.bodyJson; - if (result.data) { - this.emit("debug", { - action: "receiveCcipReadFetchResult", - request, - result, - }); - return result.data; - } - if (result.message) { - errorMessage = result.message; - } - this.emit("debug", { - action: "receiveCcipReadFetchError", - request, - result, - }); - } - catch (error) { } - // 4xx indicates the result is not present; stop - 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 }, - }); - // 5xx indicates server issue; try the next url - errorMessages.push(errorMessage); - } - assert(false, `error encountered during CCIP fetch: ${errorMessages - .map((m) => JSON.stringify(m)) - .join(", ")}`, "OFFCHAIN_FAULT", { - reason: "500_SERVER_ERROR", - transaction: tx, - info: { urls, errorMessages }, - }); - } - _wrapBlock(value, network) { - return new Block(formatBlock(value), this); - } - _wrapLog(value, network) { - return new Log(formatLog(value), this); - } - _wrapTransactionReceipt(value, network) { - return new TransactionReceipt(formatTransactionReceipt(value), this); - } - _wrapTransactionResponse(tx, network) { - return new TransactionResponse(formatTransactionResponse(tx), this); - } - _detectNetwork() { - assert(false, "sub-classes must implement this", "UNSUPPORTED_OPERATION", { - operation: "_detectNetwork", - }); - } - // Sub-classes should override this and handle PerformActionRequest requests, calling - // the super for any unhandled actions. - async _perform(req) { - assert(false, `unsupported method: ${req.method}`, "UNSUPPORTED_OPERATION", { - operation: req.method, - info: req, - }); - } - // State - async getBlockNumber() { - const blockNumber = getNumber(await this.#perform({ method: "getBlockNumber" }), "%response"); - if (this.#lastBlockNumber >= 0) { - this.#lastBlockNumber = blockNumber; - } - return blockNumber; - } - _getAddress(address) { - return resolveAddress(address); - } - _getBlockTag(blockTag) { - if (blockTag == null) { - return "latest"; - } - switch (blockTag) { - case "earliest": - return "0x0"; - case "latest": - case "pending": - case "safe": - case "finalized": - return blockTag; - } - if (isHexString(blockTag)) { - if (isHexString(blockTag, 32)) { - return blockTag; - } - return toQuantity(blockTag); - } - if (typeof blockTag === "bigint") { - blockTag = getNumber(blockTag, "blockTag"); - } - if (typeof blockTag === "number") { - if (blockTag >= 0) { - return toQuantity(blockTag); - } - if (this.#lastBlockNumber >= 0) { - return toQuantity(this.#lastBlockNumber + blockTag); - } - return this.getBlockNumber().then((b) => toQuantity(b + blockTag)); - } - assertArgument(false, "invalid blockTag", "blockTag", blockTag); - } - _getFilter(filter) { - // Create a canonical representation of the topics - const topics = (filter.topics || []).map((t) => { - if (t == null) { - return null; - } - if (Array.isArray(t)) { - return concisify(t.map((t) => t.toLowerCase())); - } - return t.toLowerCase(); - }); - const blockHash = "blockHash" in filter ? filter.blockHash : undefined; - const resolve = (_address, fromBlock, toBlock) => { - let address = undefined; - switch (_address.length) { - case 0: - break; - case 1: - address = _address[0]; - break; - default: - _address.sort(); - address = _address; - } - if (blockHash) { - if (fromBlock != null || toBlock != null) { - throw new Error("invalid filter"); - } - } - const filter = {}; - if (address) { - filter.address = address; - } - if (topics.length) { - filter.topics = topics; - } - if (fromBlock) { - filter.fromBlock = fromBlock; - } - if (toBlock) { - filter.toBlock = toBlock; - } - if (blockHash) { - filter.blockHash = blockHash; - } - return filter; - }; - // Addresses could be async (ENS names or Addressables) - let address = []; - if (filter.address) { - if (Array.isArray(filter.address)) { - for (const addr of filter.address) { - address.push(this._getAddress(addr)); - } - } - else { - address.push(this._getAddress(filter.address)); - } - } - let fromBlock = undefined; - if ("fromBlock" in filter) { - fromBlock = this._getBlockTag(filter.fromBlock); - } - let toBlock = undefined; - if ("toBlock" in filter) { - toBlock = this._getBlockTag(filter.toBlock); - } - if (address.filter((a) => typeof a !== "string").length || - (fromBlock != null && typeof fromBlock !== "string") || - (toBlock != null && typeof toBlock !== "string")) { - return Promise.all([Promise.all(address), fromBlock, toBlock]).then((result) => { - return resolve(result[0], result[1], result[2]); - }); - } - return resolve(address, fromBlock, toBlock); - } - _getTransactionRequest(_request) { - const request = copyRequest(_request); - const promises = []; - ["to", "from"].forEach((key) => { - if (request[key] == null) { - return; - } - const addr = resolveAddress(request[key]); - if (isPromise(addr)) { - promises.push((async function () { - request[key] = await addr; - })()); - } - else { - request[key] = addr; - } - }); - if (request.blockTag != null) { - const blockTag = this._getBlockTag(request.blockTag); - if (isPromise(blockTag)) { - promises.push((async function () { - request.blockTag = await blockTag; - })()); - } - else { - request.blockTag = blockTag; - } - } - if (promises.length) { - return (async function () { - await Promise.all(promises); - return request; - })(); - } - return request; - } - async getNetwork() { - // No explicit network was set and this is our first time - if (this.#networkPromise == null) { - // Detect the current network (shared with all calls) - const detectNetwork = this._detectNetwork().then((network) => { - this.emit("network", network, null); - return network; - }, (error) => { - // Reset the networkPromise on failure, so we will try again - if (this.#networkPromise === detectNetwork) { - this.#networkPromise = null; - } - throw error; - }); - this.#networkPromise = detectNetwork; - return (await detectNetwork).clone(); - } - const networkPromise = this.#networkPromise; - const [expected, actual] = await Promise.all([ - networkPromise, // Possibly an explicit Network - this._detectNetwork(), // The actual connected network - ]); - if (expected.networkId !== actual.networkId) { - if (this.#anyNetwork) { - // The "any" network can change, so notify listeners - this.emit("network", actual, expected); - // Update the network if something else hasn't already changed it - if (this.#networkPromise === networkPromise) { - this.#networkPromise = Promise.resolve(actual); - } - } - else { - // Otherwise, we do not allow changes to the underlying network - assert(false, `network changed: ${expected.networkId} => ${actual.networkId} `, "NETWORK_ERROR", { - event: "changed", - }); - } - } - return expected.clone(); - } - async getEnergyPrice() { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new FeeData(energyPrice); - } - async getFeeData() { - const { energyPrice } = await resolveProperties({ - block: this.getBlock("latest"), - energyPrice: (async () => { - try { - const energyPrice = await this.#perform({ method: "getEnergyPrice" }); - return getBigInt(energyPrice, "%response"); - } - catch (error) { } - return null; - })(), - }); - return new FeeData(energyPrice); - } - async estimateEnergy(_tx) { - let tx = this._getTransactionRequest(_tx); - if (isPromise(tx)) { - tx = await tx; - } - return getBigInt(await this.#perform({ - method: "estimateEnergy", - transaction: tx, - }), "%response"); - } - async #call(tx, blockTag, attempt) { - assert(attempt < MAX_CCIP_REDIRECTS, "CCIP read exceeded maximum redirections", "OFFCHAIN_FAULT", { - reason: "TOO_MANY_REDIRECTS", - transaction: Object.assign({}, tx, { blockTag, enableCcipRead: true }), - }); - // This came in as a PerformActionTransaction, so to/from are safe; we can cast - const transaction = copyRequest(tx); - try { - return hexlify(await this._perform({ method: "call", transaction, blockTag })); - } - catch (error) { - // CCIP Read OffchainLookup - if (!this.disableCcipRead && - isCallException(error) && - error.data && - attempt >= 0 && - blockTag === "latest" && - transaction.to != null && - dataSlice(error.data, 0, 4) === "0x556f1830") { - const data = error.data; - const txSender = await resolveAddress(transaction.to); - // Parse the CCIP Read Arguments - let ccipArgs; - try { - ccipArgs = parseOffchainLookup(dataSlice(error.data, 4)); - } - catch (error) { - assert(false, error.message, "OFFCHAIN_FAULT", { - reason: "BAD_DATA", - transaction, - info: { data }, - }); - } - // Check the sender of the OffchainLookup matches the transaction - assert(ccipArgs.sender.toLowerCase() === txSender.toLowerCase(), "CCIP Read sender mismatch", "CALL_EXCEPTION", { - action: "call", - data, - reason: "OffchainLookup", - transaction: transaction, // @TODO: populate data? - invocation: null, - revert: { - signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)", - name: "OffchainLookup", - args: ccipArgs.errorArgs, - }, - }); - const ccipResult = await this.ccipReadFetch(transaction, ccipArgs.calldata, ccipArgs.urls); - assert(ccipResult != null, "CCIP Read failed to fetch data", "OFFCHAIN_FAULT", { - reason: "FETCH_FAILED", - transaction, - info: { data: error.data, errorArgs: ccipArgs.errorArgs }, - }); - const tx = { - to: txSender, - data: concat([ - ccipArgs.selector, - encodeBytes([ccipResult, ccipArgs.extraData]), - ]), - }; - this.emit("debug", { action: "sendCcipReadCall", transaction: tx }); - try { - const result = await this.#call(tx, blockTag, attempt + 1); - this.emit("debug", { - action: "receiveCcipReadCallResult", - transaction: Object.assign({}, tx), - result, - }); - return result; - } - catch (error) { - this.emit("debug", { - action: "receiveCcipReadCallError", - transaction: Object.assign({}, tx), - error, - }); - throw error; - } - } - throw error; - } - } - async #checkNetwork(promise) { - const { value } = await resolveProperties({ - network: this.getNetwork(), - value: promise, - }); - return value; - } - async call(_tx) { - const { tx, blockTag } = await resolveProperties({ - tx: this._getTransactionRequest(_tx), - blockTag: this._getBlockTag(_tx.blockTag), - }); - return await this.#checkNetwork(this.#call(tx, blockTag, _tx.enableCcipRead ? 0 : -1)); - } - // Account - async #getAccountValue(request, _address, _blockTag) { - let address = this._getAddress(_address); - let blockTag = this._getBlockTag(_blockTag); - if (typeof address !== "string" || typeof blockTag !== "string") { - [address, blockTag] = await Promise.all([address, blockTag]); - } - return await this.#checkNetwork(this.#perform(Object.assign(request, { address, blockTag }))); - } - async getBalance(address, blockTag) { - return getBigInt(await this.#getAccountValue({ method: "getBalance" }, address, blockTag), "%response"); - } - async getTransactionCount(address, blockTag) { - return getNumber(await this.#getAccountValue({ method: "getTransactionCount" }, address, blockTag), "%response"); - } - async getCode(address, blockTag) { - return hexlify(await this.#getAccountValue({ method: "getCode" }, address, blockTag)); - } - async getStorage(address, _position, blockTag) { - const position = getBigInt(_position, "position"); - return hexlify(await this.#getAccountValue({ method: "getStorage", position }, address, blockTag)); - } - // Write - async broadcastTransaction(signedTx) { - const { blockNumber, hash, network } = await resolveProperties({ - blockNumber: this.getBlockNumber(), - hash: this._perform({ - method: "broadcastTransaction", - signedTransaction: signedTx, - }), - network: this.getNetwork(), - }); - const tx = Transaction.from(signedTx); - if (tx.hash !== hash) { - throw new Error("@TODO: the returned hash did not match"); - } - return this._wrapTransactionResponse(tx, network).replaceableTransaction(blockNumber); - } - async #getBlock(block, includeTransactions) { - // @TODO: Add CustomBlockPlugin check - if (isHexString(block, 32)) { - return await this.#perform({ - method: "getBlock", - blockHash: block, - includeTransactions, - }); - } - let blockTag = this._getBlockTag(block); - if (typeof blockTag !== "string") { - blockTag = await blockTag; - } - return await this.#perform({ - method: "getBlock", - blockTag, - includeTransactions, - }); - } - // Queries - async getBlock(block, prefetchTxs) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#getBlock(block, !!prefetchTxs), - }); - if (params == null) { - return null; - } - return this._wrapBlock(params, network); - } - async getTransaction(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransaction", hash }), - }); - if (params == null) { - return null; - } - return this._wrapTransactionResponse(params, network); - } - async getTransactionReceipt(hash) { - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getTransactionReceipt", hash }), - }); - if (params == null) { - return null; - } - // Some backends did not backfill the effectiveEnergyPrice into old transactions - // in the receipt, so we look it up manually and inject it. - if (params.energyPrice == null && params.effectiveEnergyPrice == null) { - const tx = await this.#perform({ method: "getTransaction", hash }); - if (tx == null) { - throw new Error("report this; could not find tx or effectiveEnergyPrice"); - } - params.effectiveEnergyPrice = tx.energyPrice; - } - return this._wrapTransactionReceipt(params, network); - } - async getTransactionResult(hash) { - const { result } = await resolveProperties({ - network: this.getNetwork(), - result: this.#perform({ method: "getTransactionResult", hash }), - }); - if (result == null) { - return null; - } - return hexlify(result); - } - // Bloom-filter Queries - async getLogs(_filter) { - let filter = this._getFilter(_filter); - if (isPromise(filter)) { - filter = await filter; - } - const { network, params } = await resolveProperties({ - network: this.getNetwork(), - params: this.#perform({ method: "getLogs", filter }), - }); - return params.map((p) => this._wrapLog(p, network)); - } - // ENS - _getProvider(networkId) { - assert(false, "provider cannot connect to target network", "UNSUPPORTED_OPERATION", { - operation: "_getProvider()", - }); - } - async waitForTransaction(hash, _confirms, timeout) { - const confirms = _confirms != null ? _confirms : 1; - if (confirms === 0) { - return this.getTransactionReceipt(hash); - } - return new Promise(async (resolve, reject) => { - let timer = null; - const listener = async (blockNumber) => { - try { - const receipt = await this.getTransactionReceipt(hash); - if (receipt != null) { - if (blockNumber - receipt.blockNumber + 1 >= confirms) { - resolve(receipt); - //this.off("block", listener); - if (timer) { - clearTimeout(timer); - timer = null; - } - return; - } - } - } - catch (error) { - console.log("EEE", error); - } - this.once("block", listener); - }; - if (timeout != null) { - timer = setTimeout(() => { - if (timer == null) { - return; - } - timer = null; - this.off("block", listener); - reject(makeError("timeout", "TIMEOUT", { reason: "timeout" })); - }, timeout); - } - listener(await this.getBlockNumber()); - }); - } - async waitForBlock(blockTag) { - assert(false, "not implemented yet", "NOT_IMPLEMENTED", { - operation: "waitForBlock", - }); - } - _clearTimeout(timerId) { - const timer = this.#timers.get(timerId); - if (!timer) { - return; - } - if (timer.timer) { - clearTimeout(timer.timer); - } - this.#timers.delete(timerId); - } - _setTimeout(_func, timeout) { - if (timeout == null) { - timeout = 0; - } - const timerId = this.#nextTimer++; - const func = () => { - this.#timers.delete(timerId); - _func(); - }; - if (this.paused) { - this.#timers.set(timerId, { timer: null, func, time: timeout }); - } - else { - const timer = setTimeout(func, timeout); - this.#timers.set(timerId, { timer, func, time: getTime() }); - } - return timerId; - } - _forEachSubscriber(func) { - for (const sub of this.#subs.values()) { - func(sub.subscriber); - } - } - // Event API; sub-classes should override this; any supported - // event filter will have been munged into an EventFilter - _getSubscriber(sub) { - switch (sub.type) { - case "debug": - case "error": - case "network": - return new UnmanagedSubscriber(sub.type); - case "block": - return new PollingBlockSubscriber(this); - case "event": - return new PollingEventSubscriber(this, sub.filter); - case "transaction": - return new PollingTransactionSubscriber(this, sub.hash); - case "orphan": - return new PollingOrphanSubscriber(this, sub.filter); - } - throw new Error(`unsupported event: ${sub.type}`); - } - _recoverSubscriber(oldSub, newSub) { - for (const sub of this.#subs.values()) { - if (sub.subscriber === oldSub) { - if (sub.started) { - sub.subscriber.stop(); - } - sub.subscriber = newSub; - if (sub.started) { - newSub.start(); - } - if (this.#pausedState != null) { - newSub.pause(this.#pausedState); - } - break; - } - } - } - async #hasSub(event, emitArgs) { - let sub = await getSubscription(event, this); - // This is a log that is removing an existing log; we actually want - // to emit an orphan event for the removed log - if (sub.type === "event" && - emitArgs && - emitArgs.length > 0 && - emitArgs[0].removed === true) { - sub = await getSubscription({ orphan: "drop-log", log: emitArgs[0] }, this); - } - return this.#subs.get(sub.tag) || null; - } - async #getSub(event) { - const subscription = await getSubscription(event, this); - // Prevent tampering with our tag in any subclass' _getSubscriber - const tag = subscription.tag; - let sub = this.#subs.get(tag); - if (!sub) { - const subscriber = this._getSubscriber(subscription); - const addressableMap = new WeakMap(); - const nameMap = new Map(); - sub = { - subscriber, - tag, - addressableMap, - nameMap, - started: false, - listeners: [], - }; - this.#subs.set(tag, sub); - } - return sub; - } - async on(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: false }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async once(event, listener) { - const sub = await this.#getSub(event); - sub.listeners.push({ listener, once: true }); - if (!sub.started) { - sub.subscriber.start(); - sub.started = true; - if (this.#pausedState != null) { - sub.subscriber.pause(this.#pausedState); - } - } - return this; - } - async emit(event, ...args) { - const sub = await this.#hasSub(event, args); - // If there is not subscription or if a recent emit removed - // the last of them (which also deleted the sub) do nothing - if (!sub || sub.listeners.length === 0) { - return false; - } - const count = sub.listeners.length; - sub.listeners = sub.listeners.filter(({ listener, once }) => { - const payload = new EventPayload(this, once ? null : listener, event); - try { - listener.call(this, ...args, payload); - } - catch (error) { } - return !once; - }); - if (sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return count > 0; - } - async listenerCount(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return 0; - } - return sub.listeners.length; - } - let total = 0; - for (const { listeners } of this.#subs.values()) { - total += listeners.length; - } - return total; - } - async listeners(event) { - if (event) { - const sub = await this.#hasSub(event); - if (!sub) { - return []; - } - return sub.listeners.map(({ listener }) => listener); - } - let result = []; - for (const { listeners } of this.#subs.values()) { - result = result.concat(listeners.map(({ listener }) => listener)); - } - return result; - } - async off(event, listener) { - const sub = await this.#hasSub(event); - if (!sub) { - return this; - } - if (listener) { - const index = sub.listeners - .map(({ listener }) => listener) - .indexOf(listener); - if (index >= 0) { - sub.listeners.splice(index, 1); - } - } - if (!listener || sub.listeners.length === 0) { - if (sub.started) { - sub.subscriber.stop(); - } - this.#subs.delete(sub.tag); - } - return this; - } - async removeAllListeners(event) { - if (event) { - const { tag, started, subscriber } = await this.#getSub(event); - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - else { - for (const [tag, { started, subscriber }] of this.#subs) { - if (started) { - subscriber.stop(); - } - this.#subs.delete(tag); - } - } - return this; - } - // Alias for "on" - async addListener(event, listener) { - return await this.on(event, listener); - } - // Alias for "off" - async removeListener(event, listener) { - return this.off(event, listener); - } - // Sub-classes should override this to shutdown any sockets, etc. - // but MUST call this super.shutdown. - destroy() { - // Stop all listeners - this.removeAllListeners(); - // Shut down all tiemrs - for (const timerId of this.#timers.keys()) { - this._clearTimeout(timerId); - } - } - get paused() { - return this.#pausedState != null; - } - set paused(pause) { - if (!!pause === this.paused) { - return; - } - if (this.paused) { - this.resume(); - } - else { - this.pause(false); - } - } - pause(dropWhilePaused) { - this.#lastBlockNumber = -1; - if (this.#pausedState != null) { - if (this.#pausedState == !!dropWhilePaused) { - return; - } - assert(false, "cannot change pause type; resume first", "UNSUPPORTED_OPERATION", { - operation: "pause", - }); - } - this._forEachSubscriber((s) => s.pause(dropWhilePaused)); - this.#pausedState = !!dropWhilePaused; - for (const timer of this.#timers.values()) { - // Clear the timer - if (timer.timer) { - clearTimeout(timer.timer); - } - // Remaining time needed for when we become unpaused - timer.time = getTime() - timer.time; - } - } - resume() { - if (this.#pausedState == null) { - return; - } - this._forEachSubscriber((s) => s.resume()); - this.#pausedState = null; - for (const timer of this.#timers.values()) { - // Remaining time when we were paused - let timeout = timer.time; - if (timeout < 0) { - timeout = 0; - } - // Start time (in cause paused, so we con compute remaininf time) - timer.time = getTime(); - // Start the timer - setTimeout(timer.func, timeout); - } - } -} -function _parseString(result, start) { - try { - const bytes = _parseBytes(result, start); - if (bytes) { - return toUtf8String(bytes); - } - } - catch (error) { } - return null; -} -function _parseBytes(result, start) { - if (result === "0x") { - return null; - } - try { - const offset = getNumber(dataSlice(result, start, start + 32)); - const length = getNumber(dataSlice(result, offset, offset + 32)); - return dataSlice(result, offset + 32, offset + 32 + length); - } - catch (error) { } - return null; -} -function numPad(value) { - const result = toBeArray(value); - if (result.length > 32) { - throw new Error("internal; should not happen"); - } - const padded = new Uint8Array(32); - padded.set(result, 32 - result.length); - return padded; -} -function bytesPad(value) { - if (value.length % 32 === 0) { - return value; - } - const result = new Uint8Array(Math.ceil(value.length / 32) * 32); - result.set(value); - return result; -} -const empty = new Uint8Array([]); -// ABI Encodes a series of (bytes, bytes, ...) -function encodeBytes(datas) { - const result = []; - let byteCount = 0; - // Add place-holders for pointers as we add items - for (let i = 0; i < datas.length; i++) { - result.push(empty); - byteCount += 32; - } - for (let i = 0; i < datas.length; i++) { - const data = getBytes(datas[i]); - // Update the bytes offset - result[i] = numPad(byteCount); - // The length and padded value of data - result.push(numPad(data.length)); - result.push(bytesPad(data)); - byteCount += 32 + Math.ceil(data.length / 32) * 32; - } - return concat(result); -} -const zeros = "0x0000000000000000000000000000000000000000000000000000000000000000"; -function parseOffchainLookup(data) { - const result = { - sender: "", - urls: [], - calldata: "", - selector: "", - extraData: "", - errorArgs: [], - }; - assert(dataLength(data) >= 5 * 32, "insufficient OffchainLookup data", "OFFCHAIN_FAULT", { - reason: "insufficient OffchainLookup data", - }); - const sender = dataSlice(data, 0, 32); - assert(dataSlice(sender, 0, 12) === dataSlice(zeros, 0, 12), "corrupt OffchainLookup sender", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup sender", - }); - result.sender = dataSlice(sender, 12); - // Read the URLs from the response - try { - const urls = []; - const urlsOffset = getNumber(dataSlice(data, 32, 64)); - const urlsLength = getNumber(dataSlice(data, urlsOffset, urlsOffset + 32)); - const urlsData = dataSlice(data, urlsOffset + 32); - for (let u = 0; u < urlsLength; u++) { - const url = _parseString(urlsData, u * 32); - if (url == null) { - throw new Error("abort"); - } - urls.push(url); - } - result.urls = urls; - } - catch (error) { - assert(false, "corrupt OffchainLookup urls", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup urls", - }); - } - // Get the CCIP calldata to forward - try { - const calldata = _parseBytes(data, 64); - if (calldata == null) { - throw new Error("abort"); - } - result.calldata = calldata; - } - catch (error) { - assert(false, "corrupt OffchainLookup calldata", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup calldata", - }); - } - // Get the callbackSelector (bytes4) - assert(dataSlice(data, 100, 128) === dataSlice(zeros, 0, 28), "corrupt OffchainLookup callbaackSelector", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup callbaackSelector", - }); - result.selector = dataSlice(data, 96, 100); - // Get the extra data to send back to the contract as context - try { - const extraData = _parseBytes(data, 128); - if (extraData == null) { - throw new Error("abort"); - } - result.extraData = extraData; - } - catch (error) { - assert(false, "corrupt OffchainLookup extraData", "OFFCHAIN_FAULT", { - reason: "corrupt OffchainLookup extraData", - }); - } - result.errorArgs = "sender,urls,calldata,selector,extraData" - .split(/,/) - .map((k) => result[k]); - return result; -} -//# sourceMappingURL=abstract-provider.js.map \ No newline at end of file diff --git a/lib.esm/providers/abstract-provider.js.map b/lib.esm/providers/abstract-provider.js.map deleted file mode 100644 index b5f87199f..000000000 --- a/lib.esm/providers/abstract-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-provider.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,oBAAoB;AACpB,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,OAAO,EACP,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,eAAe,EACf,SAAS,EACT,MAAM,EACN,cAAc,EACd,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,YAAY,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACN,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACN,WAAW,EACX,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,GAC5B,MAAM,yBAAyB,CAAC;AA4BjC,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAE9B,SAAS,SAAS,CAAU,KAAU;IACrC,OAAO,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AAClD,CAAC;AAED,SAAS,MAAM,CAAC,MAAc,EAAE,KAAU;IACzC,OAAO,CACN,MAAM;QACN,GAAG;QACH,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC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,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,EACrD,0CAA0C,EAC1C,gBAAgB,EAChB;QACC,MAAM,EAAE,0CAA0C;KAClD,CACD,CAAC;IACF,MAAM,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;IAE3C,6DAA6D;IAC7D,IAAI,CAAC;QACJ,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACzC,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QACD,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,CAAC,KAAK,EAAE,kCAAkC,EAAE,gBAAgB,EAAE;YACnE,MAAM,EAAE,kCAAkC;SAC1C,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,SAAS,GAAG,yCAAyC;SAC1D,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAO,MAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/B,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/abstract-signer.d.ts b/lib.esm/providers/abstract-signer.d.ts deleted file mode 100644 index ab4997033..000000000 --- a/lib.esm/providers/abstract-signer.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -export declare abstract class AbstractSigner

implements Signer { - readonly provider: P; - constructor(provider?: P); - abstract getAddress(): Promise; - abstract connect(provider: null | Provider): Signer; - getNonce(blockTag?: BlockTag): Promise; - populateCall(tx: TransactionRequest): Promise>; - populateTransaction(tx: TransactionRequest): Promise>; - estimateEnergy(tx: TransactionRequest): Promise; - call(tx: TransactionRequest): Promise; - resolveName(name: string): Promise; - sendTransaction(tx: TransactionRequest): Promise; - abstract signTransaction(tx: TransactionRequest): Promise; - abstract signMessage(message: string | Uint8Array): Promise; - abstract signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -export declare class VoidSigner extends AbstractSigner { - #private; - readonly address: string; - constructor(address: string, provider?: null | Provider); - getAddress(): Promise; - connect(provider: null | Provider): VoidSigner; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=abstract-signer.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/abstract-signer.d.ts.map b/lib.esm/providers/abstract-signer.d.ts.map deleted file mode 100644 index 35aaa1ca6..000000000 --- a/lib.esm/providers/abstract-signer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuC1C,8BAAsB,cAAc,CACnC,CAAC,SAAS,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAC1C,YAAW,MAAM;IAClB,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAC;IAEtB,YAAY,QAAQ,CAAC,EAAE,CAAC,EAEvB;IAED,QAAQ,CAAC,UAAU,I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AAC,EAAE,IAAI,GAAG,QAAQ,EAGtD;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAE7C;IAQK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/abstract-signer.js b/lib.esm/providers/abstract-signer.js deleted file mode 100644 index 92efcede8..000000000 --- a/lib.esm/providers/abstract-signer.js +++ /dev/null @@ -1,128 +0,0 @@ -/** - * About Abstract Signer and subclassing - * - * @_section: api/providers/abstract-signer: Subclassing Signer [abstract-signer] - */ -import { resolveAddress } from "../address/checks.js"; -import { getAddress } from "../address/index.js"; -import { Transaction } from "../transaction/index.js"; -import { defineProperties, getBigInt, resolveProperties, assert, assertArgument, } from "../utils/index.js"; -import { copyRequest } from "./provider.js"; -function checkProvider(signer, operation) { - if (signer.provider) { - return signer.provider; - } - assert(false, "missing provider", "UNSUPPORTED_OPERATION", { operation }); -} -async function populate(signer, tx) { - let pop = copyRequest(tx); - if (pop.to != null) { - pop.to = resolveAddress(pop.to); - } - if (pop.from != null) { - const from = pop.from; - pop.from = Promise.all([signer.getAddress(), resolveAddress(from)]).then(([address, from]) => { - assertArgument(address.toLowerCase() === from.toLowerCase(), "transaction from mismatch", "tx.from", from); - return address; - }); - } - else { - pop.from = signer.getAddress(); - } - return await resolveProperties(pop); -} -export class AbstractSigner { - provider; - constructor(provider) { - defineProperties(this, { provider: provider || null }); - } - async getNonce(blockTag) { - return checkProvider(this, "getTransactionCount").getTransactionCount(await this.getAddress(), blockTag); - } - async populateCall(tx) { - const pop = await populate(this, tx); - return pop; - } - async populateTransaction(tx) { - const provider = checkProvider(this, "populateTransaction"); - const pop = await populate(this, tx); - if (pop.nonce == null) { - pop.nonce = await this.getNonce("pending"); - } - if (pop.energyLimit == null) { - pop.energyLimit = await this.estimateEnergy(pop); - } - // Populate the chain ID - const network = await this.provider.getNetwork(); - if (pop.networkId != null) { - const networkId = getBigInt(pop.networkId); - assertArgument(networkId === network.networkId, "transaction networkId mismatch", "tx.networkId", tx.networkId); - } - else { - pop.networkId = network.networkId; - } - // We need to get fee data to determine things - const feeData = await provider.getFeeData(); - // We need to auto-detect the intended type of this transaction... - if (feeData.energyPrice != null) { - // Network doesn't support EIP-1559... - // Populate missing fee data - if (pop.energyPrice == null) { - pop.energyPrice = feeData.energyPrice; - } - } - else { - // getFeeData has failed us. - assert(false, "failed to get consistent fee data", "UNSUPPORTED_OPERATION", { - operation: "signer.getFeeData", - }); - } - //@TOOD: Don't await all over the place; save them up for - // the end for better batching - return await resolveProperties(pop); - } - async estimateEnergy(tx) { - return checkProvider(this, "estimateEnergy").estimateEnergy(await this.populateCall(tx)); - } - async call(tx) { - return checkProvider(this, "call").call(await this.populateCall(tx)); - } - async resolveName(name) { - return getAddress(name); - } - async sendTransaction(tx) { - const provider = checkProvider(this, "sendTransaction"); - const pop = await this.populateTransaction(tx); - delete pop.from; - const txObj = Transaction.from(pop); - return await provider.broadcastTransaction(await this.signTransaction(txObj)); - } -} -export class VoidSigner extends AbstractSigner { - address; - constructor(address, provider) { - super(provider); - defineProperties(this, { address }); - } - async getAddress() { - return this.address; - } - connect(provider) { - return new VoidSigner(this.address, provider); - } - #throwUnsupported(suffix, operation) { - assert(false, `VoidSigner cannot sign ${suffix}`, "UNSUPPORTED_OPERATION", { - operation, - }); - } - async signTransaction(tx) { - this.#throwUnsupported("transactions", "signTransaction"); - } - async signMessage(message) { - this.#throwUnsupported("messages", "signMessage"); - } - async signTypedData(domain, types, value) { - this.#throwUnsupported("typed-data", "signTypedData"); - } -} -//# sourceMappingURL=abstract-signer.js.map \ No newline at end of file diff --git a/lib.esm/providers/abstract-signer.js.map b/lib.esm/providers/abstract-signer.js.map deleted file mode 100644 index 6f0de6379..000000000 --- a/lib.esm/providers/abstract-signer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-signer.js","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACN,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAa5C,SAAS,aAAa,CAAC,MAAsB,EAAE,SAAiB;IAC/D,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC,QAAQ,CAAC;IACxB,CAAC;IACD,MAAM,CAAC,KAAK,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,KAAK,UAAU,QAAQ,CACtB,MAAsB,EACtB,EAAsB;IAEtB,IAAI,GAAG,GAAQ,WAAW,CAAC,EAAE,CAAC,CAAC;IAE/B,IAAI,GAAG,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC;QACpB,GAAG,CAAC,EAAE,GAAG,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;QACtB,MAA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Ac,EAAE,SAAiB;QAClD,MAAM,CAAC,KAAK,EAAE,0BAA0B,MAAM,EAAE,EAAE,uBAAuB,EAAE;YAC1E,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAsB;QAC3C,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,OAA4B;QAC7C,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,aAAa,CAClB,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;QAE1B,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;IACvD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/community.d.ts b/lib.esm/providers/community.d.ts deleted file mode 100644 index a61908d27..000000000 --- a/lib.esm/providers/community.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * There are many awesome community services that provide Core - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -/** - * Providers which offer community credentials should extend this - * to notify any interested consumers whether community credentials - * are in-use. - */ -export interface CommunityResourcable { - /** - * Returns true of the instance is connected using the community - * credentials. - */ - isCommunityResource(): boolean; -} -/** - * Displays a warning in tht console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -export declare function showThrottleMessage(service: string): void; -//# sourceMappingURL=community.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/community.d.ts.map b/lib.esm/providers/community.d.ts.map deleted file mode 100644 index e36ebbacf..000000000 --- a/lib.esm/providers/community.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAC/B;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA4BzD"} \ No newline at end of file diff --git a/lib.esm/providers/community.js b/lib.esm/providers/community.js deleted file mode 100644 index a18edb5fb..000000000 --- a/lib.esm/providers/community.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * There are many awesome community services that provide Core - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -// Show the throttle message only once per service -const shown = new Set(); -/** - * Displays a warning in tht console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -export function showThrottleMessage(service) { - if (shown.has(service)) { - return; - } - shown.add(service); - console.log("========= NOTICE ========="); - console.log(`Request-Rate Exceeded for ${service} (this message will not be repeated)`); - console.log(""); - console.log("The default API keys for each service are provided as a highly-throttled,"); - console.log("community resource for low-traffic projects and early prototyping."); - console.log(""); - console.log("While your application will continue to function, we highly recommended"); - console.log("signing up for your own API keys to improve performance, increase your"); - console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."); - console.log(""); -} -//# sourceMappingURL=community.js.map \ No newline at end of file diff --git a/lib.esm/providers/community.js.map b/lib.esm/providers/community.js.map deleted file mode 100644 index 10fc9a9d6..000000000 --- a/lib.esm/providers/community.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"community.js","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,kDAAkD;AAClD,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IAClD,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,OAAO;IACR,CAAC;IACD,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CACV,6BAA6B,OAAO,sCAAsC,CAC1E,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACV,2EAA2E,CAC3E,CAAC;IACF,OAAO,CAAC,GAAG,CACV,oEAAoE,CACpE,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACV,yEAAyE,CACzE,CAAC;IACF,OAAO,CAAC,GAAG,CACV,wEAAwE,CACxE,CAAC;IACF,OAAO,CAAC,GAAG,CACV,+EAA+E,CAC/E,CAAC;IACF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/contracts.d.ts b/lib.esm/providers/contracts.d.ts deleted file mode 100644 index 187f28cce..000000000 --- a/lib.esm/providers/contracts.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -export interface ContractRunner { - provider: null | Provider; - estimateEnergy?: (tx: TransactionRequest) => Promise; - call?: (tx: TransactionRequest) => Promise; - resolveName?: (name: string) => Promise; - sendTransaction?: (tx: TransactionRequest) => Promise; -} -//# sourceMappingURL=contracts.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/contracts.d.ts.map b/lib.esm/providers/contracts.d.ts.map deleted file mode 100644 index 29a278289..000000000 --- a/lib.esm/providers/contracts.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAG1B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7D,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAGvD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC3E"} \ No newline at end of file diff --git a/lib.esm/providers/contracts.js b/lib.esm/providers/contracts.js deleted file mode 100644 index 202a39eb5..000000000 --- a/lib.esm/providers/contracts.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=contracts.js.map \ No newline at end of file diff --git a/lib.esm/providers/contracts.js.map b/lib.esm/providers/contracts.js.map deleted file mode 100644 index 42ac4de89..000000000 --- a/lib.esm/providers/contracts.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/providers/default-provider.d.ts b/lib.esm/providers/default-provider.d.ts deleted file mode 100644 index 657919cb1..000000000 --- a/lib.esm/providers/default-provider.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AbstractProvider } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import { WebSocketLike } from "./provider-websocket.js"; -export declare function getDefaultProvider(network: string | Networkish | WebSocketLike, options?: any): AbstractProvider; -//# sourceMappingURL=default-provider.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/default-provider.d.ts.map b/lib.esm/providers/default-provider.d.ts.map deleted file mode 100644 index 6e1d55294..000000000 --- a/lib.esm/providers/default-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxD,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAC5C,OAAO,CAAC,EAAE,GAAG,GACX,gBAAgB,CA6FlB"} \ No newline at end of file diff --git a/lib.esm/providers/default-provider.js b/lib.esm/providers/default-provider.js deleted file mode 100644 index d915d748c..000000000 --- a/lib.esm/providers/default-provider.js +++ /dev/null @@ -1,98 +0,0 @@ -import { assert } from "../utils/index.js"; -import { AnkrProvider } from "./provider-ankr.js"; -import { AlchemyProvider } from "./provider-alchemy.js"; -import { CloudflareProvider } from "./provider-cloudflare.js"; -import { InfuraProvider } from "./provider-infura.js"; -//import { PocketProvider } from "./provider-pocket.js"; -import { QuickNodeProvider } from "./provider-quicknode.js"; -import { FallbackProvider } from "./provider-fallback.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { WebSocketProvider } from "./provider-websocket.js"; -function isWebSocketLike(value) { - return (value && - typeof value.send === "function" && - typeof value.close === "function"); -} -export function getDefaultProvider(network, options) { - if (options == null) { - options = {}; - } - if (typeof network === "string" && network.match(/^https?:/)) { - return new JsonRpcProvider(network); - } - if ((typeof network === "string" && network.match(/^wss?:/)) || - isWebSocketLike(network)) { - return new WebSocketProvider(network); - } - const providers = []; - if (options.alchemy !== "-") { - try { - providers.push(new AlchemyProvider(network, options.alchemy)); - } - catch (error) { - console.log(error); - } - } - if (options.ankr !== "-" && options.ankr != null) { - try { - providers.push(new AnkrProvider(network, options.ankr)); - } - catch (error) { - console.log(error); - } - } - if (options.cloudflare !== "-") { - try { - providers.push(new CloudflareProvider(network)); - } - catch (error) { - console.log(error); - } - } - if (options.infura !== "-") { - try { - let projectId = options.infura; - let projectSecret = undefined; - if (typeof projectId === "object") { - projectSecret = projectId.projectSecret; - projectId = projectId.projectId; - } - providers.push(new InfuraProvider(network, projectId, projectSecret)); - } - catch (error) { - console.log(error); - } - } - /* - if (options.pocket !== "-") { - try { - let appId = options.pocket; - let secretKey: undefined | string = undefined; - let loadBalancer: undefined | boolean = undefined; - if (typeof(appId) === "object") { - loadBalancer = !!appId.loadBalancer; - secretKey = appId.secretKey; - appId = appId.appId; - } - providers.push(new PocketProvider(network, appId, secretKey, loadBalancer)); - } catch (error) { console.log(error); } - } -*/ - if (options.quicknode !== "-") { - try { - let token = options.quicknode; - providers.push(new QuickNodeProvider(network, token)); - } - catch (error) { - console.log(error); - } - } - assert(providers.length, "unsupported default network", "UNSUPPORTED_OPERATION", { - operation: "getDefaultProvider", - }); - if (providers.length === 1) { - return providers[0]; - } - return new FallbackProvider(providers); -} -//# sourceMappingURL=default-provider.js.map \ No newline at end of file diff --git a/lib.esm/providers/default-provider.js.map b/lib.esm/providers/default-provider.js.map deleted file mode 100644 index bd6f81316..000000000 --- a/lib.esm/providers/default-provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-provider.js","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,wDAAwD;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB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CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;IAED,MAAM,CACL,SAAS,CAAC,MAAM,EAChB,6BAA6B,EAC7B,uBAAuB,EACvB;QACC,SAAS,EAAE,oBAAoB;KAC/B,CACD,CAAC;IAEF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/format.d.ts b/lib.esm/providers/format.d.ts deleted file mode 100644 index e088632a0..000000000 --- a/lib.esm/providers/format.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -export type FormatFunc = (value: any) => any; -export declare function allowNull(format: FormatFunc, nullValue?: any): FormatFunc; -export declare function arrayOf(format: FormatFunc): FormatFunc; -export declare function object(format: Record, altNames?: Record>): FormatFunc; -export declare function formatBoolean(value: any): boolean; -export declare function formatData(value: string): string; -export declare function formatHash(value: any): string; -export declare function formatUint256(value: any): string; -export declare function formatLog(value: any): LogParams; -export declare function formatBlock(value: any): BlockParams; -export declare function formatReceiptLog(value: any): LogParams; -export declare function formatTransactionReceipt(value: any): TransactionReceiptParams; -export declare function formatTransactionResponse(value: any): TransactionResponseParams; -//# sourceMappingURL=format.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/format.d.ts.map b/lib.esm/providers/format.d.ts.map deleted file mode 100644 index 1c35b4b35..000000000 --- a/lib.esm/providers/format.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAIzB,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAOzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAOtD;AAKD,wBAAgB,MAAM,CACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GACtC,UAAU,CA+BZ;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAejD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAG7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAmBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAE/C;AAoBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,CAWnD;AAkBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAEtD;AA6BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,wBAAwB,CAE7E;AAED,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,GAAG,GACR,yBAAyB,CA0G3B"} \ No newline at end of file diff --git a/lib.esm/providers/format.js b/lib.esm/providers/format.js deleted file mode 100644 index 7c55b0fc2..000000000 --- a/lib.esm/providers/format.js +++ /dev/null @@ -1,250 +0,0 @@ -/** - * @_ignore - */ -import { getAddress } from "../address/index.js"; -import { getCreateAddress } from "../address/contract-address.js"; -import { accessListify } from "../transaction/index.js"; -import { getBigInt, getNumber, hexlify, isHexString, zeroPadValue, assert, assertArgument, } from "../utils/index.js"; -const BN_0 = BigInt(0); -export function allowNull(format, nullValue) { - return function (value) { - if (value == null) { - return nullValue; - } - return format(value); - }; -} -export function arrayOf(format) { - return (array) => { - if (!Array.isArray(array)) { - throw new Error("not an array"); - } - return array.map((i) => format(i)); - }; -} -// Requires an object which matches a fleet of other formatters -// Any FormatFunc may return `undefined` to have the value omitted -// from the result object. Calls preserve `this`. -export function object(format, altNames) { - return (value) => { - const result = {}; - for (const key in format) { - let srcKey = key; - if (altNames && key in altNames && !(srcKey in value)) { - for (const altKey of altNames[key]) { - if (altKey in value) { - srcKey = altKey; - break; - } - } - } - try { - const nv = format[key](value[srcKey]); - if (nv !== undefined) { - result[key] = nv; - } - } - catch (error) { - const message = error instanceof Error ? error.message : "not-an-error"; - assert(false, `invalid value for value.${key} (${message})`, "BAD_DATA", { value }); - } - } - return result; - }; -} -export function formatBoolean(value) { - switch (value) { - case true: - case "true": - return true; - case false: - case "false": - return false; - } - assertArgument(false, `invalid boolean; ${JSON.stringify(value)}`, "value", value); -} -export function formatData(value) { - assertArgument(isHexString(value, true), "invalid data", "value", value); - return value; -} -export function formatHash(value) { - assertArgument(isHexString(value, 32), "invalid hash", "value", value); - return value; -} -export function formatUint256(value) { - if (!isHexString(value)) { - throw new Error("invalid uint256"); - } - return zeroPadValue(value, 32); -} -const _formatLog = object({ - address: getAddress, - blockHash: formatHash, - blockNumber: getNumber, - data: formatData, - index: getNumber, - removed: allowNull(formatBoolean, false), - topics: arrayOf(formatHash), - transactionHash: formatHash, - transactionIndex: getNumber, -}, { - index: ["logIndex"], -}); -export function formatLog(value) { - return _formatLog(value); -} -const _formatBlock = object({ - hash: allowNull(formatHash), - parentHash: formatHash, - number: getNumber, - timestamp: getNumber, - nonce: allowNull(formatData), - difficulty: getBigInt, - energyLimit: getBigInt, - energyUsed: getBigInt, - miner: allowNull(getAddress), - extraData: formatData, - baseFeePerEnergy: allowNull(getBigInt), -}); -export function formatBlock(value) { - const result = _formatBlock(value); - result.transactions = value.transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return formatTransactionResponse(tx); - }); - return result; -} -const _formatReceiptLog = object({ - transactionIndex: getNumber, - blockNumber: getNumber, - transactionHash: formatHash, - address: getAddress, - topics: arrayOf(formatHash), - data: formatData, - index: getNumber, - blockHash: formatHash, -}, { - index: ["logIndex"], -}); -export function formatReceiptLog(value) { - return _formatReceiptLog(value); -} -const _formatTransactionReceipt = object({ - to: allowNull(getAddress, null), - from: allowNull(getAddress, null), - contractAddress: allowNull(getAddress, null), - // should be allowNull(hash), but broken-EIP-658 support is handled in receipt - index: getNumber, - root: allowNull(hexlify), - energyUsed: getBigInt, - logsBloom: allowNull(formatData), - blockHash: formatHash, - hash: formatHash, - logs: arrayOf(formatReceiptLog), - blockNumber: getNumber, - //confirmations: allowNull(getNumber, null), - cumulativeEnergyUsed: getBigInt, - effectiveEnergyPrice: allowNull(getBigInt), - status: allowNull(getNumber), - type: allowNull(getNumber, 0), -}, { - effectiveEnergyPrice: ["energyPrice"], - hash: ["transactionHash"], - index: ["transactionIndex"], -}); -export function formatTransactionReceipt(value) { - return _formatTransactionReceipt(value); -} -export function formatTransactionResponse(value) { - // Some clients (TestRPC) do strange things like return 0x0 for the - // 0 address; correct this to be a real address - if (value.to && !getAddress(value.to) && getBigInt(value.to) === BN_0) { - value.to = "0x0000000000000000000000000000000000000000"; - } - const result = object({ - hash: formatHash, - type: (value) => { - if (value === "0x" || value == null) { - return 0; - } - return getNumber(value); - }, - accessList: allowNull(accessListify, null), - blockHash: allowNull(formatHash, null), - blockNumber: allowNull(getNumber, null), - transactionIndex: allowNull(getNumber, null), - //confirmations: allowNull(getNumber, null), - from: getAddress, - maxFeePerEnergy: allowNull(getBigInt), - energyLimit: getBigInt, - to: allowNull(getAddress, null), - value: getBigInt, - nonce: getNumber, - data: formatData, - creates: allowNull(getAddress, null), - networkId: allowNull(getBigInt, null), - }, { - data: ["input"], - energyLimit: ["energy"], - })(value); - // If to and creates are empty, populate the creates from the value - if (result.to == null && result.creates == null) { - result.creates = getCreateAddress(result); - } - // Compute the signature - if (value.signature) { - result.signature = value.signature; - } - else { - result.signature = value; - } - // Some backends omit networkId on legacy transactions, but we can compute it - if (result.networkId == null) { - const networkId = result.signature.legacynetworkId; - if (networkId != null) { - result.networkId = networkId; - } - } - // @TODO: check networkId - /* - if (value.networkId != null) { - let networkId = value.networkId; - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - result.networkId = networkId; - - } else { - let networkId = value.networkId; - - // geth-etc returns networkId - if (networkId == null && result.v == null) { - networkId = value.networkId; - } - - if (isHexString(networkId)) { - networkId = BigNumber.from(networkId).toNumber(); - } - - if (typeof(networkId) !== "number" && result.v != null) { - networkId = (result.v - 35) / 2; - if (networkId < 0) { networkId = 0; } - networkId = parseInt(networkId); - } - - if (typeof(networkId) !== "number") { networkId = 0; } - - result.networkId = networkId; - } - */ - // 0x0000... should actually be null - if (result.blockHash && getBigInt(result.blockHash) === BN_0) { - result.blockHash = null; - } - return result; -} -//# sourceMappingURL=format.js.map \ No newline at end of file diff --git a/lib.esm/providers/format.js.map b/lib.esm/providers/format.js.map deleted file mode 100644 index d729ddee2..000000000 --- a/lib.esm/providers/format.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EACN,SAAS,EACT,SAAS,EACT,OAAO,EACP,WAAW,EACX,YAAY,EACZ,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAS3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAIvB,MAAM,UAAU,SAAS,CAAC,MAAkB,EAA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AW,EAAE,CAAC,QAAQ,CAAC;KACvB,CACD,CAAC,KAAK,CAAC,CAAC;IAET,mEAAmE;IACnE,IAAI,MAAM,CAAC,EAAE,IAAI,IAAI,IAAI,MAAM,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;QACjD,MAAM,CAAC,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED,wBAAwB;IACxB,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QACrB,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IACpC,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,6EAA6E;IAC7E,IAAI,MAAM,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC;QACnD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACvB,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;QAC9B,CAAC;IACF,CAAC;IAED,yBAAyB;IACzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCK;IAEL,oCAAoC;IACpC,IAAI,MAAM,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9D,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/formatting.d.ts b/lib.esm/providers/formatting.d.ts deleted file mode 100644 index 82736fe7c..000000000 --- a/lib.esm/providers/formatting.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ -export interface BlockParams { - hash?: null | string; - number: number; - timestamp: number; - parentHash: string; - nonce: string; - difficulty: bigint; - energyLimit: bigint; - energyUsed: bigint; - miner: string; - extraData: string; - baseFeePerEnergy: null | bigint; - transactions: ReadonlyArray; -} -export interface LogParams { - transactionHash: string; - blockHash: string; - blockNumber: number; - removed: boolean; - address: string; - data: string; - topics: ReadonlyArray; - index: number; - transactionIndex: number; -} -export interface TransactionReceiptParams { - to: null | string; - from: string; - contractAddress: null | string; - hash: string; - index: number; - blockHash: string; - blockNumber: number; - logsBloom: string; - logs: ReadonlyArray; - energyUsed: bigint; - cumulativeEnergyUsed: bigint; - energyPrice?: null | bigint; - effectiveEnergyPrice?: null | bigint; - type: number; - status: null | number; - root: null | string; -} -export interface TransactionResponseParams { - blockNumber: null | number; - blockHash: null | string; - hash: string; - index: number; - type: number; - to: null | string; - from: string; - nonce: number; - energyLimit: bigint; - energyPrice: bigint; - data: string; - value: bigint; - networkId: bigint; - signature: string; -} -//# sourceMappingURL=formatting.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/formatting.d.ts.map b/lib.esm/providers/formatting.d.ts.map deleted file mode 100644 index 5d7ddfb6b..000000000 --- a/lib.esm/providers/formatting.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwDH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;IAEhC,YAAY,EAAE,aAAa,CAAC,MAAM,GAAG,yBAAyB,CAAC,CAAC;CAChE;AA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,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CAClB"} \ No newline at end of file diff --git a/lib.esm/providers/formatting.js b/lib.esm/providers/formatting.js deleted file mode 100644 index 553a878b1..000000000 --- a/lib.esm/providers/formatting.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ -export {}; -//# sourceMappingURL=formatting.js.map \ No newline at end of file diff --git a/lib.esm/providers/formatting.js.map b/lib.esm/providers/formatting.js.map deleted file mode 100644 index aafcc300d..000000000 --- a/lib.esm/providers/formatting.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"formatting.js","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG"} \ No newline at end of file diff --git a/lib.esm/providers/index.d.ts b/lib.esm/providers/index.d.ts deleted file mode 100644 index 7e80c01e9..000000000 --- a/lib.esm/providers/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * About providers. - * - * @_section: api/providers:Providers [about-providers] - */ -export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -export { AbstractSigner, VoidSigner } from "./abstract-signer.js"; -export { showThrottleMessage } from "./community.js"; -export { getDefaultProvider } from "./default-provider.js"; -export { Network } from "./network.js"; -export { NonceManager } from "./signer-noncemanager.js"; -export { NetworkPlugin, EnergyCostPlugin, FeeDataNetworkPlugin, } from "./plugins-network.js"; -export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest, } from "./provider.js"; -export { FallbackProvider } from "./provider-fallback.js"; -export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, } from "./provider-jsonrpc.js"; -export { BrowserProvider } from "./provider-browser.js"; -export { AlchemyProvider } from "./provider-alchemy.js"; -export { AnkrProvider } from "./provider-ankr.js"; -export { CloudflareProvider } from "./provider-cloudflare.js"; -export { InfuraProvider, InfuraWebSocketProvider } from "./provider-infura.js"; -export { PocketProvider } from "./provider-pocket.js"; -export { QuickNodeProvider } from "./provider-quicknode.js"; -import { IpcSocketProvider } from "./provider-ipcsocket.js"; -export { IpcSocketProvider }; -export { SocketProvider } from "./provider-socket.js"; -export { WebSocketProvider } from "./provider-websocket.js"; -export { SocketSubscriber, SocketBlockSubscriber, SocketPendingSubscriber, SocketEventSubscriber, } from "./provider-socket.js"; -export type { Subscription, Subscriber, AbstractProviderPlugin, PerformActionFilter, PerformActionTransaction, PerformActionRequest, } from "./abstract-provider.js"; -export type { ContractRunner } from "./contracts.js"; -export type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams, } from "./formatting.js"; -export type { Networkish } from "./network.js"; -export type { EnergyCostParameters } from "./plugins-network.js"; -export type { BlockTag, TransactionRequest, PreparedTransactionRequest, EventFilter, Filter, FilterByBlockHash, OrphanFilter, ProviderEvent, TopicFilter, Provider, MinedBlock, MinedTransactionResponse, } from "./provider.js"; -export type { DebugEventBrowserProvider, Eip1193Provider, } from "./provider-browser.js"; -export type { JsonRpcPayload, JsonRpcResult, JsonRpcError, JsonRpcApiProviderOptions, JsonRpcTransactionRequest, } from "./provider-jsonrpc.js"; -export type { WebSocketCreator, WebSocketLike } from "./provider-websocket.js"; -export type { Signer } from "./signer.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/index.d.ts.map b/lib.esm/providers/index.d.ts.map deleted file mode 100644 index 25fe43a45..000000000 --- a/lib.esm/providers/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAA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qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACX,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,YAAY,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GACzB,MAAM,iBAAiB,CAAC;AAWzB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,YAAY,EACX,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,wBAAwB,GACxB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,yBAAyB,EACzB,eAAe,GACf,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE/E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/index.js b/lib.esm/providers/index.js deleted file mode 100644 index 8ffd323f7..000000000 --- a/lib.esm/providers/index.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * About providers. - * - * @_section: api/providers:Providers [about-providers] - */ -export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -export { AbstractSigner, VoidSigner } from "./abstract-signer.js"; -export { showThrottleMessage } from "./community.js"; -export { getDefaultProvider } from "./default-provider.js"; -export { Network } from "./network.js"; -export { NonceManager } from "./signer-noncemanager.js"; -export { NetworkPlugin, EnergyCostPlugin, FeeDataNetworkPlugin, } from "./plugins-network.js"; -export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest, -//resolveTransactionRequest, - } from "./provider.js"; -export { FallbackProvider } from "./provider-fallback.js"; -export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, } from "./provider-jsonrpc.js"; -export { BrowserProvider } from "./provider-browser.js"; -export { AlchemyProvider } from "./provider-alchemy.js"; -export { AnkrProvider } from "./provider-ankr.js"; -export { CloudflareProvider } from "./provider-cloudflare.js"; -export { InfuraProvider, InfuraWebSocketProvider } from "./provider-infura.js"; -export { PocketProvider } from "./provider-pocket.js"; -export { QuickNodeProvider } from "./provider-quicknode.js"; -import { IpcSocketProvider } from "./provider-ipcsocket.js"; /*-browser*/ -export { IpcSocketProvider }; -export { SocketProvider } from "./provider-socket.js"; -export { WebSocketProvider } from "./provider-websocket.js"; -export { SocketSubscriber, SocketBlockSubscriber, SocketPendingSubscriber, SocketEventSubscriber, } from "./provider-socket.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/providers/index.js.map b/lib.esm/providers/index.js.map deleted file mode 100644 index a3f1db64e..000000000 --- a/lib.esm/providers/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/providers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EACN,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,WAAW;AACX,4BAA4B;EAC5B,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,aAAa,GACb,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC,CAAC,YAAY;AACzE,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EACN,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/network.d.ts b/lib.esm/providers/network.d.ts deleted file mode 100644 index eb935dd8b..000000000 --- a/lib.esm/providers/network.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import type { BigNumberish } from "../utils/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { NetworkPlugin } from "./plugins-network.js"; -/** - * A Networkish can be used to allude to a Network, by specifing: - * - a [[Network]] object - * - a well-known (or registered) network name - * - a well-known (or registered) chain ID - * - an object with sufficient details to describe a network - */ -export type Networkish = Network | number | bigint | string | { - name?: string; - networkId?: number; - ensAddress?: string; - ensNetwork?: number; -}; -export declare class Network { - #private; - constructor(name: string, networkId: BigNumberish); - toJSON(): any; - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name(): string; - set name(value: string); - /** - * The network chain ID. - */ - get networkId(): bigint; - set networkId(value: BigNumberish); - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other: Networkish): boolean; - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins(): Array; - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin: NetworkPlugin): this; - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name: string): null | T; - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename: string): Array; - /** - * Create a copy of this Network. - */ - clone(): Network; - /** - * Compute the intrinsic energy required for a transaction. - * - * A EnergyCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicEnergy(tx: TransactionLike): number; - /** - * Returns a new Network for the %%network%% name or networkId. - */ - static from(network?: Networkish): Network; - /** - * Register %%nameOrnetworkId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrnetworkId: string | number | bigint, networkFunc: () => Network): void; -} -//# sourceMappingURL=network.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/network.d.ts.map b/lib.esm/providers/network.d.ts.map deleted file mode 100644 index 639456c16..000000000 --- a/lib.esm/providers/network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAA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,CAqBlD;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAuDzC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,WAAW,EAAE,MAAM,OAAO,GACxB,IAAI,CAcN;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/network.js b/lib.esm/providers/network.js deleted file mode 100644 index e5b74e6a1..000000000 --- a/lib.esm/providers/network.js +++ /dev/null @@ -1,249 +0,0 @@ -/** - * About networks - * - * @_subsection: api/providers:Networks [networks] - */ -import { getBigInt, assertArgument } from "../utils/index.js"; -import { EnergyCostPlugin } from "./plugins-network.js"; -/* * * * -// Networks which operation against an L2 can use this plugin to -// specify how to access L1, for the purpose of resolving ENS, -// for example. -export class LayerOneConnectionPlugin extends NetworkPlugin { - readonly provider!: Provider; -*/ -// Networks or clients with a higher need for security (such as clients -// that may automatically make CCIP requests without user interaction) -// can use this plugin to anonymize requests or intercept CCIP requests -// to notify and/or receive authorization from the user -const Networks = new Map(); -export class Network { - #name; - #networkId; - #plugins; - constructor(name, networkId) { - this.#name = name; - this.#networkId = getBigInt(networkId); - this.#plugins = new Map(); - } - toJSON() { - return { name: this.name, networkId: String(this.networkId) }; - } - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name() { - return this.#name; - } - set name(value) { - this.#name = value; - } - /** - * The network chain ID. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = getBigInt(value, "networkId"); - } - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other) { - if (other == null) { - return false; - } - if (typeof other === "string") { - try { - return this.networkId === getBigInt(other); - } - catch (error) { } - return this.name === other; - } - if (typeof other === "number" || typeof other === "bigint") { - try { - return this.networkId === getBigInt(other); - } - catch (error) { } - return false; - } - if (typeof other === "object") { - if (other.networkId != null) { - try { - return this.networkId === getBigInt(other.networkId); - } - catch (error) { } - return false; - } - if (other.name != null) { - return this.name === other.name; - } - return false; - } - return false; - } - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins() { - return Array.from(this.#plugins.values()); - } - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin) { - if (this.#plugins.get(plugin.name)) { - throw new Error(`cannot replace existing plugin: ${plugin.name} `); - } - this.#plugins.set(plugin.name, plugin.clone()); - return this; - } - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name) { - return this.#plugins.get(name) || null; - } - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename) { - return (this.plugins.filter((p) => p.name.split("#")[0] === basename)); - } - /** - * Create a copy of this Network. - */ - clone() { - const clone = new Network(this.name, this.networkId); - this.plugins.forEach((plugin) => { - clone.attachPlugin(plugin.clone()); - }); - return clone; - } - /** - * Compute the intrinsic energy required for a transaction. - * - * A EnergyCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicEnergy(tx) { - const costs = this.getPlugin("org.corebc.plugins.network.EnergyCost") || new EnergyCostPlugin(); - let energy = costs.txBase; - if (tx.to == null) { - energy += costs.txCreate; - } - if (tx.data) { - for (let i = 2; i < tx.data.length; i += 2) { - if (tx.data.substring(i, i + 2) === "00") { - energy += costs.txDataZero; - } - else { - energy += costs.txDataNonzero; - } - } - } - return energy; - } - /** - * Returns a new Network for the %%network%% name or networkId. - */ - static from(network) { - injectCommonNetworks(); - // Default network - if (network == null) { - return Network.from("mainnet"); - } - // Canonical name or chain ID - if (typeof network === "number") { - network = BigInt(network); - } - if (typeof network === "string" || typeof network === "bigint") { - const networkFunc = Networks.get(network); - if (networkFunc) { - return networkFunc(); - } - if (typeof network === "bigint") { - return new Network("unknown", network); - } - assertArgument(false, "unknown network", "network", network); - } - // Clonable with network-like abilities - if (typeof network.clone === "function") { - const clone = network.clone(); - //if (typeof(network.name) !== "string" || typeof(network.networkId) !== "number") { - //} - return clone; - } - // Networkish - if (typeof network === "object") { - assertArgument(typeof network.name === "string" && - typeof network.networkId === "number", "invalid network object name or networkId", "network", network); - const custom = new Network(network.name, network.networkId); - //if ((network).layerOneConnection) { - // custom.attachPlugin(new LayerOneConnectionPlugin((network).layerOneConnection)); - //} - return custom; - } - assertArgument(false, "invalid network", "network", network); - } - /** - * Register %%nameOrnetworkId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrnetworkId, networkFunc) { - if (typeof nameOrnetworkId === "number") { - nameOrnetworkId = BigInt(nameOrnetworkId); - } - const existing = Networks.get(nameOrnetworkId); - if (existing) { - assertArgument(false, `conflicting network for ${JSON.stringify(existing.name)}`, "nameOrnetworkId", nameOrnetworkId); - } - Networks.set(nameOrnetworkId, networkFunc); - } -} -// See: https://chainlist.org -let injected = false; -function injectCommonNetworks() { - if (injected) { - return; - } - injected = true; - /// Register popular Core networks - function registerEth(name, networkId, options) { - const func = function () { - const network = new Network(name, networkId); - network.attachPlugin(new EnergyCostPlugin()); - return network; - }; - // Register the network by name and chain ID - Network.register(name, func); - Network.register(networkId, func); - if (options.altNames) { - options.altNames.forEach((name) => { - Network.register(name, func); - }); - } - } - registerEth("mainnet", 1, { ensNetwork: 1, altNames: ["homestead"] }); - registerEth("ropsten", 3, { ensNetwork: 3 }); - registerEth("rinkeby", 4, { ensNetwork: 4 }); - registerEth("goerli", 5, { ensNetwork: 5 }); - registerEth("kovan", 42, { ensNetwork: 42 }); - registerEth("sepolia", 11155111, {}); - registerEth("classic", 61, {}); - registerEth("classicKotti", 6, {}); - registerEth("xdai", 100, { ensNetwork: 1 }); -} -//# sourceMappingURL=network.js.map \ No newline at end of file diff --git a/lib.esm/providers/network.js.map b/lib.esm/providers/network.js.map deleted file mode 100644 index 5f4096dc5..000000000 --- a/lib.esm/providers/network.js.map +++ /dev/null @@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,EAAE,EAAE,CAAC,CAAC;IAC/B,WAAW,CAAC,cAAc,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEnC,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7C,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/pagination.d.ts b/lib.esm/providers/pagination.d.ts deleted file mode 100644 index a772a85c2..000000000 --- a/lib.esm/providers/pagination.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface PaginationResult extends Array { - next(): Promise>; - totalResults: null | number; - done: boolean; -} -//# sourceMappingURL=pagination.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/pagination.d.ts.map b/lib.esm/providers/pagination.d.ts.map deleted file mode 100644 index 8ff265391..000000000 --- a/lib.esm/providers/pagination.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACpD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACd"} \ No newline at end of file diff --git a/lib.esm/providers/pagination.js b/lib.esm/providers/pagination.js deleted file mode 100644 index dad94f2fa..000000000 --- a/lib.esm/providers/pagination.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=pagination.js.map \ No newline at end of file diff --git a/lib.esm/providers/pagination.js.map b/lib.esm/providers/pagination.js.map deleted file mode 100644 index d08e925cb..000000000 --- a/lib.esm/providers/pagination.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/providers/plugin-fallback.d.ts b/lib.esm/providers/plugin-fallback.d.ts deleted file mode 100644 index 10009e4b3..000000000 --- a/lib.esm/providers/plugin-fallback.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AbstractProviderPlugin } from "./abstract-provider.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -export declare const PluginIdFallbackProvider = "org.corebc.plugins.provider.QualifiedPlugin"; -export declare class CheckQualifiedPlugin implements AbstractProviderPlugin { - name: string; - constructor(); - connect(provider: AbstractProvider): CheckQualifiedPlugin; - isQualified(action: PerformActionRequest, result: any): boolean; -} -export declare class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action: PerformActionRequest, result: any): boolean; -} -//# sourceMappingURL=plugin-fallback.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/plugin-fallback.d.ts.map b/lib.esm/providers/plugin-fallback.d.ts.map deleted file mode 100644 index d639bafb3..000000000 --- a/lib.esm/providers/plugin-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,wBAAwB,gDACS,CAAC;AAE/C,qBAAa,oBAAqB,YAAW,sBAAsB;IAC1D,IAAI,EAAE,MAAM,CAAC;IAErB,cAIC;IAED,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB,CAExD;IAID,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAE9D;CACD;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACxE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAU9D;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/plugin-fallback.js b/lib.esm/providers/plugin-fallback.js deleted file mode 100644 index fa51d1555..000000000 --- a/lib.esm/providers/plugin-fallback.js +++ /dev/null @@ -1,29 +0,0 @@ -import { defineProperties } from "../utils/index.js"; -export const PluginIdFallbackProvider = "org.corebc.plugins.provider.QualifiedPlugin"; -export class CheckQualifiedPlugin { - constructor() { - defineProperties(this, { - name: PluginIdFallbackProvider, - }); - } - connect(provider) { - return this; - } - // Retruns true if this value should be considered qualified for - // inclusion in the quorum. - isQualified(action, result) { - return true; - } -} -export class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action, result) { - if (action.method === "getTransaction" || - action.method === "getTransactionReceipt") { - if (result == null) { - return false; - } - } - return super.isQualified(action, result); - } -} -//# sourceMappingURL=plugin-fallback.js.map \ No newline at end of file diff --git a/lib.esm/providers/plugin-fallback.js.map b/lib.esm/providers/plugin-fallback.js.map deleted file mode 100644 index 14ef61e5a..000000000 --- a/lib.esm/providers/plugin-fallback.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugin-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAOrD,MAAM,CAAC,MAAM,wBAAwB,GACpC,6CAA6C,CAAC;AAE/C,MAAM,OAAO,oBAAoB;IAGhC;QACC,gBAAgB,CAAuB,IAAI,EAAE;YAC5C,IAAI,EAAE,wBAAwB;SAC9B,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,QAA0B;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,gEAAgE;IAChE,2BAA2B;IAC3B,WAAW,CAAC,MAA4B,EAAE,MAAW;QACpD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAED,MAAM,OAAO,+BAAgC,SAAQ,oBAAoB;IACxE,WAAW,CAAC,MAA4B,EAAE,MAAW;QACpD,IACC,MAAM,CAAC,MAAM,KAAK,gBAAgB;YAClC,MAAM,CAAC,MAAM,KAAK,uBAAuB,EACxC,CAAC;YACF,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACpB,OAAO,KAAK,CAAC;YACd,CAAC;QACF,CAAC;QACD,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/plugins-network.d.ts b/lib.esm/providers/plugins-network.d.ts deleted file mode 100644 index 80364b3ad..000000000 --- a/lib.esm/providers/plugins-network.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { FeeData, Provider } from "./provider.js"; -export declare class NetworkPlugin { - readonly name: string; - constructor(name: string); - clone(): NetworkPlugin; -} -export type EnergyCostParameters = { - txBase?: number; - txCreate?: number; - txDataZero?: number; - txDataNonzero?: number; - txAccessListStorageKey?: number; - txAccessListAddress?: number; -}; -export declare class EnergyCostPlugin extends NetworkPlugin implements EnergyCostParameters { - readonly effectiveBlock: number; - readonly txBase: number; - readonly txCreate: number; - readonly txDataZero: number; - readonly txDataNonzero: number; - readonly txAccessListStorageKey: number; - readonly txAccessListAddress: number; - constructor(effectiveBlock?: number, costs?: EnergyCostParameters); - clone(): EnergyCostPlugin; -} -export declare class FeeDataNetworkPlugin extends NetworkPlugin { - #private; - get feeDataFunc(): (provider: Provider) => Promise; - constructor(feeDataFunc: (provider: Provider) => Promise); - getFeeData(provider: Provider): Promise; - clone(): FeeDataNetworkPlugin; -} -//# sourceMappingURL=plugins-network.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/plugins-network.d.ts.map b/lib.esm/providers/plugins-network.d.ts.map deleted file mode 100644 index bcea34835..000000000 --- a/lib.esm/providers/plugins-network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugins-network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"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O,CAAC,CAErD;IAED,KAAK,IAAI,oBAAoB,CAE5B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/plugins-network.js b/lib.esm/providers/plugins-network.js deleted file mode 100644 index b99f976a2..000000000 --- a/lib.esm/providers/plugins-network.js +++ /dev/null @@ -1,80 +0,0 @@ -import { defineProperties } from "../utils/properties.js"; -import { assertArgument } from "../utils/index.js"; -export class NetworkPlugin { - name; - constructor(name) { - defineProperties(this, { name }); - } - clone() { - return new NetworkPlugin(this.name); - } -} -export class EnergyCostPlugin extends NetworkPlugin { - effectiveBlock; - txBase; - txCreate; - txDataZero; - txDataNonzero; - txAccessListStorageKey; - txAccessListAddress; - constructor(effectiveBlock, costs) { - if (effectiveBlock == null) { - effectiveBlock = 0; - } - super(`org.corebc.network.plugins.EnergyCost#${effectiveBlock || 0}`); - const props = { effectiveBlock }; - function set(name, nullish) { - let value = (costs || {})[name]; - if (value == null) { - value = nullish; - } - assertArgument(typeof value === "number", `invalud value for ${name}`, "costs", costs); - props[name] = value; - } - set("txBase", 21000); - set("txCreate", 32000); - set("txDataZero", 4); - set("txDataNonzero", 16); - set("txAccessListStorageKey", 1900); - set("txAccessListAddress", 2400); - defineProperties(this, props); - } - clone() { - return new EnergyCostPlugin(this.effectiveBlock, this); - } -} -export class FeeDataNetworkPlugin extends NetworkPlugin { - #feeDataFunc; - get feeDataFunc() { - return this.#feeDataFunc; - } - constructor(feeDataFunc) { - super("org.corebc.plugins.network.FeeData"); - this.#feeDataFunc = feeDataFunc; - } - async getFeeData(provider) { - return await this.#feeDataFunc(provider); - } - clone() { - return new FeeDataNetworkPlugin(this.#feeDataFunc); - } -} -/* -export class CustomBlockNetworkPlugin extends NetworkPlugin { - readonly #blockFunc: (provider: Provider, block: BlockParams) => Block; - readonly #blockWithTxsFunc: (provider: Provider, block: BlockParams) => Block; - - async getBlock(provider: Provider, block: BlockParams): Promise> { - return await this.#blockFunc(provider, block); - } - - async getBlockions(provider: Provider, block: BlockParams): Promise> { - return await this.#blockWithTxsFunc(provider, block); - } - - clone(): CustomBlockNetworkPlugin { - return new CustomBlockNetworkPlugin(this.#blockFunc, this.#blockWithTxsFunc); - } -} -*/ -//# sourceMappingURL=plugins-network.js.map \ No newline at end of file diff --git a/lib.esm/providers/plugins-network.js.map b/lib.esm/providers/plugins-network.js.map deleted file mode 100644 index e9043abcf..000000000 --- a/lib.esm/providers/plugins-network.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugins-network.js","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,MAAM,OAAO,aAAa;IAChB,IAAI,CAAU;IAEvB,YAAY,IAAY;QACvB,gBAAgB,CAAgB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CAKD;AAcD,MAAM,OAAO,gBACZ,SAAQ,aAAa;IAGZ,cAAc,CAAU;IAExB,MAAM,CAAU;IAChB,QAAQ,CAAU;IAClB,UAAU,CAAU;IACpB,aAAa,CAAU;IACvB,sBAAsB,CAAU;IAChC,mBAAmB,CAAU;IAEtC,YAAY,cAAuB,EAAE,KAA4B;QAChE,IAAI,cAAc,IAAI,IAAI,EAAE,CAAC;YAC5B,cAAc,GAAG,CAAC,CAAC;QACpB,CAAC;QACD,KAAK,CAAC,yCAAyC,cAAc,IAAI,CAAC,EAAE,CAAC,CAAC;QAEtE,MAAM,KAAK,GAA2B,EAAE,cAAc,EAAE,CAAC;QACzD,SAAS,GAAG,CAAC,IAAgC,EAAE,OAAe;YAC7D,IAAI,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;YAChC,IAAI,KAAK,IAA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file mode 100644 index 17af0df46..000000000 --- a/lib.esm/providers/provider-alchemy.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * About Alchemy - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -export declare class AlchemyProvider extends JsonRpcProvider implements CommunityResourcable { - readonly apiKey: string; - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(networkId: number): AbstractProvider; - _perform(req: PerformActionRequest): Promise; - isCommunityResource(): boolean; - static getRequest(network: Network, apiKey?: string): FetchRequest; -} -//# sourceMappingURL=provider-alchemy.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-alchemy.d.ts.map b/lib.esm/providers/provider-alchemy.d.ts.map deleted file mode 100644 index 4e4c121cd..000000000 --- a/lib.esm/providers/provider-alchemy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKN,YAAY,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;;;GAUG;AACH,qBAAa,eACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAaxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAEK,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,CAyCtD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAkBjE;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-alchemy.js b/lib.esm/providers/provider-alchemy.js deleted file mode 100644 index b5dea5337..000000000 --- a/lib.esm/providers/provider-alchemy.js +++ /dev/null @@ -1,118 +0,0 @@ -/** - * About Alchemy - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -import { defineProperties, resolveProperties, assert, assertArgument, FetchRequest, } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -const defaultApiKey = "_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.alchemyapi.io"; - case "goerli": - return "eth-goerli.g.alchemy.com"; - case "sepolia": - return "eth-sepolia.g.alchemy.com"; - case "arbitrum": - return "arb-mainnet.g.alchemy.com"; - case "arbitrum-goerli": - return "arb-goerli.g.alchemy.com"; - case "matic": - return "polygon-mainnet.g.alchemy.com"; - case "matic-mumbai": - return "polygon-mumbai.g.alchemy.com"; - case "optimism": - return "opt-mainnet.g.alchemy.com"; - case "optimism-goerli": - return "opt-goerli.g.alchemy.com"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -export class AlchemyProvider extends JsonRpcProvider { - apiKey; - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = AlchemyProvider.getRequest(network, apiKey); - super(request, network, { staticNetwork: network }); - defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AlchemyProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - async _perform(req) { - // https://docs.alchemy.com/reference/trace-transaction - if (req.method === "getTransactionResult") { - const { trace, tx } = await resolveProperties({ - trace: this.send("trace_transaction", [req.hash]), - tx: this.getTransaction(req.hash), - }); - if (trace == null || tx == null) { - return null; - } - let data; - let error = false; - try { - data = trace[0].result.output; - error = trace[0].error === "Reverted"; - } - catch (error) { } - if (data) { - assert(!error, "an error occurred during transaction executions", "CALL_EXCEPTION", { - action: "getTransactionResult", - data, - reason: null, - transaction: tx, - invocation: null, - revert: null, // @TODO - }); - return data; - } - assert(false, "could not parse trace result", "BAD_DATA", { - value: trace, - }); - } - return await super._perform(req); - } - isCommunityResource() { - return this.apiKey === defaultApiKey; - } - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v2/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("alchemy"); - return true; - }; - } - return request; - } -} -//# sourceMappingURL=provider-alchemy.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-alchemy.js.map b/lib.esm/providers/provider-alchemy.js.map deleted file mode 100644 index d556e0836..000000000 --- a/lib.esm/providers/provider-alchemy.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-alchemy.js","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,cAAc,EACd,YAAY,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AASxD,MAAM,aAAa,GAAG,kCAAkC,CAAC;AAEzD,SAAS,OAAO,CAAC,IAAY;IAC5B,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,SAAS;YACb,OAAO,2BAA2B,CAAC;QACpC,KAAK,QAAQ;YACZ,OAAO,0BAA0B,CAAC;QACnC,KAAK,SAAS;YACb,OAAO,2BAA2B,CAAC;QAEpC,KAAK,UAAU;YACd,OAAO,2BAA2B,CAAC;QACpC,KAAK,iBAAiB;YACrB,OAAO,0BAA0B,CAAC;QACnC,KAAK,OAAO;YACX,OAAO,+BAA+B,CAAC;QACxC,KAAK,cAAc;YAClB,OAAO,8BAA8B,CAAC;QACvC,KAAK,UAAU;YACd,OAAO,2BAA2B,CAAC;QACpC,KAAK,iBAAiB;YACrB,OAAO,0BAA0B,CAAC;IACpC,CAAC;IAED,cAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAO,eACZ,SAAQ,eAAe;IAGd,MAAM,CAAU;IAEzB,YAAY,QAAqB,EAAE,MAAsB;QACxD,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,SAAS,CAAC;QACtB,CAA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,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-ankr.d.ts b/lib.esm/providers/provider-ankr.d.ts deleted file mode 100644 index 77af5a3a0..000000000 --- a/lib.esm/providers/provider-ankr.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -import type { JsonRpcError, JsonRpcPayload } from "./provider-jsonrpc.js"; -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -export declare class AnkrProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key for the Ankr connection. - */ - readonly apiKey: string; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(networkId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-ankr.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-ankr.d.ts.map b/lib.esm/providers/provider-ankr.d.ts.map deleted file mode 100644 index d0704e281..000000000 --- a/lib.esm/providers/provider-ankr.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoB1E;;;;;;;;GAQG;AACH,qBAAa,YACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAgBxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAkBxE;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAY/D;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-ankr.js b/lib.esm/providers/provider-ankr.js deleted file mode 100644 index 1480fe920..000000000 --- a/lib.esm/providers/provider-ankr.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -import { defineProperties, FetchRequest, assertArgument, } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -const defaultApiKey = "9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972"; -function getHost(name) { - switch (name) { - case "mainnet": - return "rpc.ankr.com/eth"; - case "goerli": - return "rpc.ankr.com/xcb_goerli"; - case "matic": - return "rpc.ankr.com/polygon"; - case "arbitrum": - return "rpc.ankr.com/arbitrum"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -export class AnkrProvider extends JsonRpcProvider { - /** - * The API key for the Ankr connection. - */ - apiKey; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, apiKey) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (apiKey == null) { - apiKey = defaultApiKey; - } - // Ankr does not support filterId, so we force polling - const options = { polling: true, staticNetwork: network }; - const request = AnkrProvider.getRequest(network, apiKey); - super(request, network, options); - defineProperties(this, { apiKey }); - } - _getProvider(networkId) { - try { - return new AnkrProvider(networkId, this.apiKey); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network, apiKey) { - if (apiKey == null) { - apiKey = defaultApiKey; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/${apiKey}`); - request.allowGzip = true; - if (apiKey === defaultApiKey) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("AnkrProvider"); - return true; - }; - } - return request; - } - getRpcError(payload, error) { - if (payload.method === "xcb_sendRawTransaction") { - if (error && - error.error && - error.error.message === "INTERNAL_ERROR: could not replace existing tx") { - error.error.message = "replacement transaction underpriced"; - } - } - return super.getRpcError(payload, error); - } - isCommunityResource() { - return this.apiKey === defaultApiKey; - } -} -//# sourceMappingURL=provider-ankr.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-ankr.js.map b/lib.esm/providers/provider-ankr.js.map deleted file mode 100644 index 86a5019e3..000000000 --- a/lib.esm/providers/provider-ankr.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ankr.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxD,MAAM,aAAa,GAClB,kEAAkE,CAAC;AAEpE,SAAS,OAAO,CAAC,IAAY;IAC5B,QAAQ,IAAI,EAAE,CAAC;QACd,KAAK,SAAS;YACb,OAAO,kBAAkB,CAAC;QAC3B,KAAK,QAAQ;YACZ,OAAO,yBAAyB,CAAC;QAClC,KAAK,OAAO;YACX,OAAO,sBAAsB,CAAC;QAC/B,KAAK,UAAU;YACd,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAED,cAAc,CAAC,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,OAAO,YACZ,SAAQ,eAAe;IAGvB;;OAEG;IACM,MAAM,CAAU;IAEzB;;;;;OAKG;IACH,YAAY,QAAqB,EAAE,MAAsB;QACxD,IA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cAAc,CAAC,CAAC;gBACpC,OAAO,IAAI,CAAC;YACb,CAAC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,OAAuB,EAAE,KAAmB;QACvD,IAAI,OAAO,CAAC,MAAM,KAAK,wBAAwB,EAAE,CAAC;YACjD,IACC,KAAK;gBACL,KAAK,CAAC,KAAK;gBACX,KAAK,CAAC,KAAK,CAAC,OAAO,KAAK,+CAA+C,EACtE,CAAC;gBACF,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,qCAAqC,CAAC;YAC7D,CAAC;QACF,CAAC;QAED,OAAO,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,mBAAmB;QAClB,OAAO,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC;IACtC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-browser.d.ts b/lib.esm/providers/provider-browser.d.ts deleted file mode 100644 index 2e917663a..000000000 --- a/lib.esm/providers/provider-browser.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js"; -import type { JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcSigner } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -export interface Eip1193Provider { - request(request: { - method: string; - params?: Array | Record; - }): Promise; -} -export type DebugEventBrowserProvider = { - action: "sendEip1193Payload"; - payload: { - method: string; - params: Array; - }; -} | { - action: "receiveEip1193Result"; - result: any; -} | { - action: "receiveEip1193Error"; - error: Error; -}; -export declare class BrowserProvider extends JsonRpcApiPollingProvider { - #private; - constructor(core: Eip1193Provider, network?: Networkish); - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - hasSigner(address: number | string): Promise; - getSigner(address?: number | string): Promise; -} -//# sourceMappingURL=provider-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-browser.d.ts.map b/lib.esm/providers/provider-browser.d.ts.map deleted file mode 100644 index 890c4678c..000000000 --- a/lib.esm/providers/provider-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC/B,OAAO,CAAC,OAAO,EAAE;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC1C,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,MAAM,MAAM,yBAAyB,GAClC;IACA,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;CAC/C,GACD;IACA,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAC;CACX,GACD;IACA,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;CACZ,CAAC;AAEL,qBAAa,eAAgB,SAAQ,yBAAyB;;IAM7D,YAAY,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,UAAU,EAsBtD;IAEK,IAAI,CACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACtC,OAAO,CAAC,GAAG,CAAC,CAId;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAmB9C;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAe/D;IAEK,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAc1D;IAEK,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiBjE;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-browser.js b/lib.esm/providers/provider-browser.js deleted file mode 100644 index 82c9272af..000000000 --- a/lib.esm/providers/provider-browser.js +++ /dev/null @@ -1,87 +0,0 @@ -import { assertArgument } from "../utils/index.js"; -import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js"; -export class BrowserProvider extends JsonRpcApiPollingProvider { - #request; - constructor(core, network) { - super(network, { batchMaxCount: 1 }); - this.#request = async (method, params) => { - const payload = { method, params }; - this.emit("debug", { action: "sendEip1193Request", payload }); - try { - const result = await core.request(payload); - this.emit("debug", { action: "receiveEip1193Result", result }); - return result; - } - catch (e) { - const error = new Error(e.message); - error.code = e.code; - error.data = e.data; - error.payload = payload; - this.emit("debug", { action: "receiveEip1193Error", error }); - throw error; - } - }; - } - async send(method, params) { - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - assertArgument(!Array.isArray(payload), "EIP-1193 does not support batch request", "payload", payload); - try { - const result = await this.#request(payload.method, payload.params || []); - return [{ id: payload.id, result }]; - } - catch (e) { - return [ - { - id: payload.id, - error: { code: e.code, data: e.data, message: e.message }, - }, - ]; - } - } - getRpcError(payload, error) { - error = JSON.parse(JSON.stringify(error)); - // EIP-1193 gives us some machine-readable error codes, so rewrite - // them into - switch (error.error.code || -1) { - case 4001: - error.error.message = `corebc-user-denied: ${error.error.message}`; - break; - case 4200: - error.error.message = `corebc-unsupported: ${error.error.message}`; - break; - } - return super.getRpcError(payload, error); - } - async hasSigner(address) { - if (address == null) { - address = 0; - } - const accounts = await this.send("xcb_accounts", []); - if (typeof address === "number") { - return accounts.length > address; - } - address = address.toLowerCase(); - return (accounts.filter((a) => a.toLowerCase() === address).length !== 0); - } - async getSigner(address) { - if (address == null) { - address = 0; - } - if (!(await this.hasSigner(address))) { - try { - //const resp = - await this.#request("xcb_requestAccounts", []); - //console.log("RESP", resp); - } - catch (error) { - const payload = error.payload; - throw this.getRpcError(payload, { id: payload.id, error }); - } - } - return await super.getSigner(address); - } -} -//# sourceMappingURL=provider-browser.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-browser.js.map b/lib.esm/providers/provider-browser.js.map deleted file mode 100644 index 531343e04..000000000 --- a/lib.esm/providers/provider-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AA+BlE,MAAM,OAAO,eAAgB,SAAQ,yBAAyB;IAC7D,QAAQ,CAGU;IAElB,YAAY,IAAqB,EAAE,OAAoB;QACtD,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,KAAK,EACpB,MAAc,EACd,MAAwC,EACvC,EAAE;YACH,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,CAAC,CAAC;YAC9D,IAAI,CAAC;gBACJ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,C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CAAC;IACH,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,OAAyB;QACxC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACrB,OAAO,GAAG,CAAC,CAAC;QACb,CAAC;QAED,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;YACtC,IAAI,CAAC;gBACJ,cAAc;gBACd,MAAM,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;gBAC/C,4BAA4B;YAC7B,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACrB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;gBAC9B,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC5D,CAAC;QACF,CAAC;QAED,OAAO,MAAM,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-cloudflare.d.ts b/lib.esm/providers/provider-cloudflare.d.ts deleted file mode 100644 index 869651f44..000000000 --- a/lib.esm/providers/provider-cloudflare.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * About Cloudflare... - */ -export declare class CloudflareProvider extends JsonRpcProvider { - constructor(_network?: Networkish); -} -//# sourceMappingURL=provider-cloudflare.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-cloudflare.d.ts.map b/lib.esm/providers/provider-cloudflare.d.ts.map deleted file mode 100644 index 8dbb47f78..000000000 --- a/lib.esm/providers/provider-cloudflare.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACtD,YAAY,QAAQ,CAAC,EAAE,UAAU,EAYhC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-cloudflare.js b/lib.esm/providers/provider-cloudflare.js deleted file mode 100644 index e74cb2f58..000000000 --- a/lib.esm/providers/provider-cloudflare.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -import { assertArgument } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -/** - * About Cloudflare... - */ -export class CloudflareProvider extends JsonRpcProvider { - constructor(_network) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - assertArgument(network.name === "mainnet", "unsupported network", "network", _network); - super("https://cloudflare-eth.com/", network, { staticNetwork: network }); - } -} -//# sourceMappingURL=provider-cloudflare.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-cloudflare.js.map b/lib.esm/providers/provider-cloudflare.js.map deleted file mode 100644 index 182374d83..000000000 --- a/lib.esm/providers/provider-cloudflare.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-cloudflare.js","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAIxD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACtD,YAAY,QAAqB;QAChC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,SAAS,CAAC;QACtB,CAAC;QACD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,cAAc,CACb,OAAO,CAAC,IAAI,KAAK,SAAS,EAC1B,qBAAqB,EACrB,SAAS,EACT,QAAQ,CACR,CAAC;QACF,KAAK,CAAC,6BAA6B,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-fallback.d.ts b/lib.esm/providers/provider-fallback.d.ts deleted file mode 100644 index bf814a2ff..000000000 --- a/lib.esm/providers/provider-fallback.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import type { PerformActionRequest } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -/** - * A configuration entry for how to use a [[Provider]]. - */ -export interface FallbackProviderConfig { - provider: AbstractProvider; - stallTimeout?: number; - priority?: number; - weight?: number; -} -/** - * The statistics and state maintained for a [[Provider]]. - */ -export interface FallbackProviderState extends Required { - blockNumber: number; - requests: number; - errorResponses: number; - lateResponses: number; - outOfSync: number; - unsupportedEvents: number; - rollingDuration: number; - score: number; -} -/** - * Additional options to configure a [[FallbackProvider]]. - */ -export type FallbackProviderOptions = { - quorum: number; - eventQuorum: number; - eventWorkers: number; -}; -/** - * A Fallback Provider. - * - */ -export declare class FallbackProvider extends AbstractProvider { - #private; - readonly quorum: number; - readonly eventQuorum: number; - readonly eventWorkers: number; - constructor(providers: Array, network?: Networkish); - get providerConfigs(): Array; - _detectNetwork(): Promise; - _translatePerform(provider: AbstractProvider, req: PerformActionRequest): Promise; - _perform(req: PerformActionRequest): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-fallback.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-fallback.d.ts.map b/lib.esm/providers/provider-fallback.d.ts.map deleted file mode 100644 index 95bda52bd..000000000 --- a/lib.esm/providers/provider-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiC/C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAEtC,QAAQ,EAAE,gBAAgB,CAAC;IAI3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IAE9E,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,cAAc,EAAE,MAAM,CAAC;IAGvB,aAAa,EAAE,MAAM,CAAC;IAGtB,SAAS,EAAE,MAAM,CAAC;IAGlB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,eAAe,EAAE,MAAM,CAAC;IAGxB,KAAK,EAAE,MAAM,CAAC;CACd;AAsCD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAGrC,MAAM,EAAE,MAAM,CAAC;IAIf,WAAW,EAAE,MAAM,CAAC;IAKpB,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AA4MF;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAO9B,YACC,SAAS,EAAE,KAAK,CAAC,gBAAgB,GAAG,sBAAsB,CAAC,EAC3D,OAAO,CAAC,EAAE,UAAU,EAwBpB;IAED,IAAI,eAAe,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAUlD;IAEK,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAIvC;IAOK,iBAAiB,CACtB,QAAQ,EAAE,gBAAgB,EAC1B,GAAG,EAAE,oBAAoB,GACvB,OAAO,CAAC,GAAG,CAAC,CAyCd;IA4QK,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,CAAC,CAmD7D;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAK7B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-fallback.js b/lib.esm/providers/provider-fallback.js deleted file mode 100644 index b7bbad61c..000000000 --- a/lib.esm/providers/provider-fallback.js +++ /dev/null @@ -1,541 +0,0 @@ -/** - * Explain all the nitty-gritty about the **FallbackProvider**. - * - * @_section: api/providers/fallback-provider:Fallback Provider [about-fallback-provider] - */ -import { getBigInt, getNumber, assert, assertArgument, } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -const BN_1 = BigInt("1"); -const BN_2 = BigInt("2"); -function shuffle(array) { - for (let i = array.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - const tmp = array[i]; - array[i] = array[j]; - array[j] = tmp; - } -} -function stall(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); -} -function getTime() { - return new Date().getTime(); -} -function stringify(value) { - return JSON.stringify(value, (key, value) => { - if (typeof value === "bigint") { - return { type: "bigint", value: value.toString() }; - } - return value; - }); -} -const defaultConfig = { stallTimeout: 400, priority: 1, weight: 1 }; -const defaultState = { - blockNumber: -2, - requests: 0, - lateResponses: 0, - errorResponses: 0, - outOfSync: -1, - unsupportedEvents: 0, - rollingDuration: 0, - score: 0, - _network: null, - _updateNumber: null, - _totalTime: 0, -}; -async function waitForSync(config, blockNumber) { - while (config.blockNumber < 0 || config.blockNumber < blockNumber) { - if (!config._updateNumber) { - config._updateNumber = (async () => { - const blockNumber = await config.provider.getBlockNumber(); - if (blockNumber > config.blockNumber) { - config.blockNumber = blockNumber; - } - config._updateNumber = null; - })(); - } - await config._updateNumber; - config.outOfSync++; - } -} -function _normalize(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[" + value.map(_normalize).join(",") + "]"; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return _normalize(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - case "number": - return BigInt(value).toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{" + - keys - .map((k) => `${JSON.stringify(k)}:${_normalize(value[k])}`) - .join(",") + - "}"); - } - } - console.log("Could not serialize", value); - throw new Error("Hmm..."); -} -function normalizeResult(value) { - if ("error" in value) { - const error = value.error; - return { tag: _normalize(error), value: error }; - } - const result = value.result; - return { tag: _normalize(result), value: result }; -} -// This strategy picks the highest weight result, as long as the weight is -// equal to or greater than quorum -function checkQuorum(quorum, results) { - const tally = new Map(); - for (const { value, tag, weight } of results) { - const t = tally.get(tag) || { value, weight: 0 }; - t.weight += weight; - tally.set(tag, t); - } - let best = null; - for (const r of tally.values()) { - if (r.weight >= quorum && (!best || r.weight > best.weight)) { - best = r; - } - } - if (best) { - return best.value; - } - return undefined; -} -function getMedian(quorum, results) { - let resultWeight = 0; - const errorMap = new Map(); - let bestError = null; - const values = []; - for (const { value, tag, weight } of results) { - if (value instanceof Error) { - const e = errorMap.get(tag) || { value, weight: 0 }; - e.weight += weight; - errorMap.set(tag, e); - if (bestError == null || e.weight > bestError.weight) { - bestError = e; - } - } - else { - values.push(BigInt(value)); - resultWeight += weight; - } - } - if (resultWeight < quorum) { - // We have quorum for an error - if (bestError && bestError.weight >= quorum) { - return bestError.value; - } - // We do not have quorum for a result - return undefined; - } - // Get the sorted values - values.sort((a, b) => (a < b ? -1 : b > a ? 1 : 0)); - const mid = Math.floor(values.length / 2); - // Odd-length; take the middle value - if (values.length % 2) { - return values[mid]; - } - // Even length; take the ceiling of the mean of the center two values - return (values[mid - 1] + values[mid] + BN_1) / BN_2; -} -function getAnyResult(quorum, results) { - // If any value or error meets quorum, that is our preferred result - const result = checkQuorum(quorum, results); - if (result !== undefined) { - return result; - } - // Otherwise, do we have any result? - for (const r of results) { - if (r.value) { - return r.value; - } - } - // Nope! - return undefined; -} -function getFuzzyMode(quorum, results) { - if (quorum === 1) { - return getNumber(getMedian(quorum, results), "%internal"); - } - const tally = new Map(); - const add = (result, weight) => { - const t = tally.get(result) || { result, weight: 0 }; - t.weight += weight; - tally.set(result, t); - }; - for (const { weight, value } of results) { - const r = getNumber(value); - add(r - 1, weight); - add(r, weight); - add(r + 1, weight); - } - let bestWeight = 0; - let bestResult = undefined; - for (const { weight, result } of tally.values()) { - // Use this result, if this result meets quorum and has either: - // - a better weight - // - or equal weight, but the result is larger - if (weight >= quorum && - (weight > bestWeight || - (bestResult != null && weight === bestWeight && result > bestResult))) { - bestWeight = weight; - bestResult = result; - } - } - return bestResult; -} -/** - * A Fallback Provider. - * - */ -export class FallbackProvider extends AbstractProvider { - quorum; - eventQuorum; - eventWorkers; - #configs; - #height; - #initialSyncPromise; - constructor(providers, network) { - super(network); - this.#configs = providers.map((p) => { - if (p instanceof AbstractProvider) { - return Object.assign({ provider: p }, defaultConfig, defaultState); - } - else { - return Object.assign({}, defaultConfig, p, defaultState); - } - }); - this.#height = -2; - this.#initialSyncPromise = null; - this.quorum = 2; //Math.ceil(providers.length / 2); - this.eventQuorum = 1; - this.eventWorkers = 1; - assertArgument(this.quorum <= this.#configs.reduce((a, c) => a + c.weight, 0), "quorum exceed provider wieght", "quorum", this.quorum); - } - get providerConfigs() { - return this.#configs.map((c) => { - const result = Object.assign({}, c); - for (const key in result) { - if (key[0] === "_") { - delete result[key]; - } - } - return result; - }); - } - async _detectNetwork() { - return Network.from(getBigInt(await this._perform({ method: "networkId" }))); - } - // @TODO: Add support to select providers to be the event subscriber - //_getSubscriber(sub: Subscription): Subscriber { - // throw new Error("@TODO"); - //} - async _translatePerform(provider, req) { - switch (req.method) { - case "broadcastTransaction": - return await provider.broadcastTransaction(req.signedTransaction); - case "call": - return await provider.call(Object.assign({}, req.transaction, { blockTag: req.blockTag })); - case "networkId": - return (await provider.getNetwork()).networkId; - case "estimateEnergy": - return await provider.estimateEnergy(req.transaction); - case "getBalance": - return await provider.getBalance(req.address, req.blockTag); - case "getBlock": { - const block = "blockHash" in req ? req.blockHash : req.blockTag; - return await provider.getBlock(block, req.includeTransactions); - } - case "getBlockNumber": - return await provider.getBlockNumber(); - case "getCode": - return await provider.getCode(req.address, req.blockTag); - case "getEnergyPrice": - return (await provider.getFeeData()).energyPrice; - case "getLogs": - return await provider.getLogs(req.filter); - case "getStorage": - return await provider.getStorage(req.address, req.position, req.blockTag); - case "getTransaction": - return await provider.getTransaction(req.hash); - case "getTransactionCount": - return await provider.getTransactionCount(req.address, req.blockTag); - case "getTransactionReceipt": - return await provider.getTransactionReceipt(req.hash); - case "getTransactionResult": - return await provider.getTransactionResult(req.hash); - } - } - // Grab the next (random) config that is not already part of - // the running set - #getNextConfig(running) { - // @TODO: Maybe do a check here to favour (heavily) providers that - // do not require waitForSync and disfavour providers that - // seem down-ish or are behaving slowly - const configs = Array.from(running).map((r) => r.config); - // Shuffle the states, sorted by priority - const allConfigs = this.#configs.slice(); - shuffle(allConfigs); - allConfigs.sort((a, b) => b.priority - a.priority); - for (const config of allConfigs) { - if (configs.indexOf(config) === -1) { - return config; - } - } - return null; - } - // Adds a new runner (if available) to running. - #addRunner(running, req) { - const config = this.#getNextConfig(running); - // No runners available - if (config == null) { - return null; - } - // Create a new runner - const runner = { - config, - result: null, - didBump: false, - perform: null, - staller: null, - }; - const now = getTime(); - // Start performing this operation - runner.perform = (async () => { - try { - config.requests++; - const result = await this._translatePerform(config.provider, req); - runner.result = { result }; - } - catch (error) { - config.errorResponses++; - runner.result = { error }; - } - const dt = getTime() - now; - config._totalTime += dt; - config.rollingDuration = 0.95 * config.rollingDuration + 0.05 * dt; - runner.perform = null; - })(); - // Start a staller; when this times out, it's time to force - // kicking off another runner because we are taking too long - runner.staller = (async () => { - await stall(config.stallTimeout); - runner.staller = null; - })(); - running.add(runner); - return runner; - } - // Initializes the blockNumber and network for each runner and - // blocks until initialized - async #initialSync() { - let initialSync = this.#initialSyncPromise; - if (!initialSync) { - const promises = []; - this.#configs.forEach((config) => { - promises.push(waitForSync(config, 0)); - promises.push((async () => { - config._network = await config.provider.getNetwork(); - })()); - }); - this.#initialSyncPromise = initialSync = (async () => { - // Wait for all providers to have a block number and network - await Promise.all(promises); - // Check all the networks match - let networkId = null; - for (const config of this.#configs) { - const network = config._network; - if (networkId == null) { - networkId = network.networkId; - } - else if (network.networkId !== networkId) { - assert(false, "cannot mix providers on different networks", "UNSUPPORTED_OPERATION", { - operation: "new FallbackProvider", - }); - } - } - })(); - } - await initialSync; - } - async #checkQuorum(running, req) { - // Get all the result objects - const results = []; - for (const runner of running) { - if (runner.result != null) { - const { tag, value } = normalizeResult(runner.result); - results.push({ tag, value, weight: runner.config.weight }); - } - } - // Are there enough results to event meet quorum? - if (results.reduce((a, r) => a + r.weight, 0) < this.quorum) { - return undefined; - } - switch (req.method) { - case "getBlockNumber": { - // We need to get the bootstrap block height - if (this.#height === -2) { - this.#height = Math.ceil(getNumber(getMedian(this.quorum, this.#configs.map((c) => ({ - value: c.blockNumber, - tag: getNumber(c.blockNumber).toString(), - weight: c.weight, - }))))); - } - // Find the mode across all the providers, allowing for - // a little drift between block heights - const mode = getFuzzyMode(this.quorum, results); - if (mode === undefined) { - return undefined; - } - if (mode > this.#height) { - this.#height = mode; - } - return this.#height; - } - case "getEnergyPrice": - case "estimateEnergy": - return getMedian(this.quorum, results); - case "getBlock": - // Pending blocks are in the mempool and already - // quite untrustworthy; just grab anything - if ("blockTag" in req && req.blockTag === "pending") { - return getAnyResult(this.quorum, results); - } - return checkQuorum(this.quorum, results); - case "call": - case "networkId": - case "getBalance": - case "getTransactionCount": - case "getCode": - case "getStorage": - case "getTransaction": - case "getTransactionReceipt": - case "getLogs": - return checkQuorum(this.quorum, results); - case "broadcastTransaction": - return getAnyResult(this.quorum, results); - } - assert(false, "unsupported method", "UNSUPPORTED_OPERATION", { - operation: `_perform(${stringify(req.method)})`, - }); - } - async #waitForQuorum(running, req) { - if (running.size === 0) { - throw new Error("no runners?!"); - } - // Any promises that are interesting to watch for; an expired stall - // or a successful perform - const interesting = []; - let newRunners = 0; - for (const runner of running) { - // No responses, yet; keep an eye on it - if (runner.perform) { - interesting.push(runner.perform); - } - // Still stalling... - if (runner.staller) { - interesting.push(runner.staller); - continue; - } - // This runner has already triggered another runner - if (runner.didBump) { - continue; - } - // Got a response (result or error) or stalled; kick off another runner - runner.didBump = true; - newRunners++; - } - // Check if we have reached quorum on a result (or error) - const value = await this.#checkQuorum(running, req); - if (value !== undefined) { - if (value instanceof Error) { - throw value; - } - return value; - } - // Add any new runners, because a staller timed out or a result - // or error response came in. - for (let i = 0; i < newRunners; i++) { - this.#addRunner(running, req); - } - // All providers have returned, and we have no result - assert(interesting.length > 0, "quorum not met", "SERVER_ERROR", { - request: "%sub-requests", - info: { - request: req, - results: Array.from(running).map((r) => stringify(r.result)), - }, - }); - // Wait for someone to either complete its perform or stall out - await Promise.race(interesting); - // This is recursive, but at worst case the depth is 2x the - // number of providers (each has a perform and a staller) - return await this.#waitForQuorum(running, req); - } - async _perform(req) { - // Broadcasting a transaction is rare (ish) and already incurs - // a cost on the user, so spamming is safe-ish. Just send it to - // every backend. - if (req.method === "broadcastTransaction") { - const results = await Promise.all(this.#configs.map(async ({ provider, weight }) => { - try { - const result = await provider._perform(req); - return Object.assign(normalizeResult({ result }), { weight }); - } - catch (error) { - return Object.assign(normalizeResult({ error }), { weight }); - } - })); - const result = getAnyResult(this.quorum, results); - assert(result !== undefined, "problem multi-broadcasting", "SERVER_ERROR", { - request: "%sub-requests", - info: { request: req, results: results.map(stringify) }, - }); - if (result instanceof Error) { - throw result; - } - return result; - } - await this.#initialSync(); - // Bootstrap enough runners to meet quorum - const running = new Set(); - for (let i = 0; i < this.quorum; i++) { - this.#addRunner(running, req); - } - const result = await this.#waitForQuorum(running, req); - // Track requests sent to a provider that are still - // outstanding after quorum has been otherwise found - for (const runner of running) { - if (runner.perform && runner.result == null) { - runner.config.lateResponses++; - } - } - return result; - } - async destroy() { - for (const { provider } of this.#configs) { - provider.destroy(); - } - super.destroy(); - } -} -//# sourceMappingURL=provider-fallback.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-fallback.js.map b/lib.esm/providers/provider-fallback.js.map deleted file mode 100644 index ac840f3d2..000000000 --- a/lib.esm/providers/provider-fallback.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-fallback.js","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,SAAS,EACT,SAAS,EACT,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAKvC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AAEzB,SAAS,OAAO,CAAU,KAAe;IACxC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,G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E,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;aACvD,CACD,CAAC;YACF,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;gBAC7B,MAAM,MAAM,CAAC;YACd,CAAC;YACD,OAAO,MAAM,CAAC;QACf,CAAC;QAED,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QAE1B,0CAA0C;QAC1C,MAAM,OAAO,GAAqB,IAAI,GAAG,EAAE,CAAC;QAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC/B,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAEvD,mDAAmD;QACnD,oDAAoD;QACpD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC9B,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;gBAC7C,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;YAC/B,CAAC;QACF,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,KAAK,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC1C,QAAQ,CAAC,OAAO,EAAE,CAAC;QACpB,CAAC;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-infura.d.ts b/lib.esm/providers/provider-infura.d.ts deleted file mode 100644 index e09baec46..000000000 --- a/lib.esm/providers/provider-infura.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { WebSocketProvider } from "./provider-websocket.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network?: Networkish, projectId?: string); - isCommunityResource(): boolean; -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network?: Networkish, projectId?: null | string, projectSecret?: null | string); - _getProvider(networkId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network?: Networkish, projectId?: string): InfuraWebSocketProvider; - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network: Network, projectId?: null | string, projectSecret?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-infura.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-infura.d.ts.map b/lib.esm/providers/provider-infura.d.ts.map deleted file mode 100644 index 2d942d185..000000000 --- a/lib.esm/providers/provider-infura.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAEN,YAAY,EAGZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;GAQG;AACH,qBAAa,uBACZ,SAAQ,iBACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,YAAY,OAAO,CAAC,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,MAAM,EAkBnD;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD;AAED;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,EAAG,IAAI,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAqB7B;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB,CAC1B,OAAO,CAAC,EAAE,UAAU,EACpB,SAAS,CAAC,EAAE,MAAM,GAChB,uBAAuB,CAEzB;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC3B,YAAY,CAwBd;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-infura.js b/lib.esm/providers/provider-infura.js deleted file mode 100644 index 8c697d112..000000000 --- a/lib.esm/providers/provider-infura.js +++ /dev/null @@ -1,167 +0,0 @@ -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -import { defineProperties, FetchRequest, assert, assertArgument, } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { WebSocketProvider } from "./provider-websocket.js"; -const defaultProjectId = "84842078b09946638c03157f83405213"; -function getHost(name) { - switch (name) { - case "mainnet": - return "mainnet.infura.io"; - case "goerli": - return "goerli.infura.io"; - case "sepolia": - return "sepolia.infura.io"; - case "arbitrum": - return "arbitrum-mainnet.infura.io"; - case "arbitrum-goerli": - return "arbitrum-goerli.infura.io"; - case "matic": - return "polygon-mainnet.infura.io"; - case "matic-mumbai": - return "polygon-mumbai.infura.io"; - case "optimism": - return "optimism-mainnet.infura.io"; - case "optimism-goerli": - return "optimism-goerli.infura.io"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export class InfuraWebSocketProvider extends WebSocketProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network, projectId) { - const provider = new InfuraProvider(network, projectId); - const req = provider._getConnection(); - assert(!req.credentials, "INFURA WebSocket project secrets unsupported", "UNSUPPORTED_OPERATION", { operation: "InfuraProvider.getWebSocketProvider()" }); - const url = req.url.replace(/^http/i, "ws").replace("/v3/", "/ws/v3/"); - super(url, network); - defineProperties(this, { - projectId: provider.projectId, - projectSecret: provider.projectSecret, - }); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export class InfuraProvider extends JsonRpcProvider { - /** - * The Project ID for the INFURA connection. - */ - projectId; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - projectSecret; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network, projectId, projectSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = InfuraProvider.getRequest(network, projectId, projectSecret); - super(request, network, { staticNetwork: network }); - defineProperties(this, { projectId, projectSecret }); - } - _getProvider(networkId) { - try { - return new InfuraProvider(networkId, this.projectId, this.projectSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.projectId === defaultProjectId; - } - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network, projectId) { - return new InfuraWebSocketProvider(network, projectId); - } - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network, projectId, projectSecret) { - if (projectId == null) { - projectId = defaultProjectId; - } - if (projectSecret == null) { - projectSecret = null; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v3/${projectId}`); - request.allowGzip = true; - if (projectSecret) { - request.setCredentials("", projectSecret); - } - if (projectId === defaultProjectId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("InfuraProvider"); - return true; - }; - } - return request; - } -} -//# sourceMappingURL=provider-infura.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-infura.js.map b/lib.esm/providers/provider-infura.js.map deleted file mode 100644 index f81e5ad3a..000000000 --- a/lib.esm/providers/provider-infura.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-infura.js","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO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ib.esm/providers/provider-ipcsocket-browser.d.ts deleted file mode 100644 index 6aae787dc..000000000 --- a/lib.esm/providers/provider-ipcsocket-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const IpcSocketProvider: undefined; -export { IpcSocketProvider }; -//# sourceMappingURL=provider-ipcsocket-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-ipcsocket-browser.d.ts.map b/lib.esm/providers/provider-ipcsocket-browser.d.ts.map deleted file mode 100644 index e49cd58d3..000000000 --- a/lib.esm/providers/provider-ipcsocket-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket-browser.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB,WAAY,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/provider-ipcsocket-browser.js b/lib.esm/providers/provider-ipcsocket-browser.js deleted file mode 100644 index d94074ea4..000000000 --- a/lib.esm/providers/provider-ipcsocket-browser.js +++ /dev/null @@ -1,3 +0,0 @@ -const IpcSocketProvider = undefined; -export { IpcSocketProvider }; -//# sourceMappingURL=provider-ipcsocket-browser.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-ipcsocket-browser.js.map b/lib.esm/providers/provider-ipcsocket-browser.js.map deleted file mode 100644 index 1df6d95ae..000000000 --- a/lib.esm/providers/provider-ipcsocket-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket-browser.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket-browser.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/provider-ipcsocket.d.ts b/lib.esm/providers/provider-ipcsocket.d.ts deleted file mode 100644 index 9f92c9d4f..000000000 --- a/lib.esm/providers/provider-ipcsocket.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// -import { SocketProvider } from "./provider-socket.js"; -import type { Socket } from "net"; -import type { Networkish } from "./network.js"; -export declare class IpcSocketProvider extends SocketProvider { - #private; - get socket(): Socket; - constructor(path: string, network?: Networkish); - destroy(): void; - _write(message: string): Promise; -} -//# sourceMappingURL=provider-ipcsocket.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-ipcsocket.d.ts.map b/lib.esm/providers/provider-ipcsocket.d.ts.map deleted file mode 100644 index 93bec7dd7..000000000 --- a/lib.esm/providers/provider-ipcsocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB/C,qBAAa,iBAAkB,SAAQ,cAAc;;IAEpD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EA+B7C;IAED,OAAO,IAAI,IAAI,CAKd;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-ipcsocket.js b/lib.esm/providers/provider-ipcsocket.js deleted file mode 100644 index cb9f9035b..000000000 --- a/lib.esm/providers/provider-ipcsocket.js +++ /dev/null @@ -1,63 +0,0 @@ -/// -import { connect } from "net"; -import { SocketProvider } from "./provider-socket.js"; -// @TODO: Is this sufficient? Is this robust? Will newlines occur between -// all payloads and only between payloads? -function splitBuffer(data) { - const messages = []; - let lastStart = 0; - while (true) { - const nl = data.indexOf(10, lastStart); - if (nl === -1) { - break; - } - messages.push(data.subarray(lastStart, nl).toString().trim()); - lastStart = nl + 1; - } - return { messages, remaining: data.subarray(lastStart) }; -} -export class IpcSocketProvider extends SocketProvider { - #socket; - get socket() { - return this.#socket; - } - constructor(path, network) { - super(network); - this.#socket = connect(path); - this.socket.on("ready", async () => { - try { - await this._start(); - } - catch (error) { - console.log("failed to start IpcSocketProvider", error); - // @TODO: Now what? Restart? - } - }); - let response = Buffer.alloc(0); - this.socket.on("data", (data) => { - response = Buffer.concat([ - response, - typeof data === "string" ? Buffer.from(data) : data, - ]); - const { messages, remaining } = splitBuffer(response); - messages.forEach((message) => { - this._processMessage(message); - }); - response = remaining; - }); - this.socket.on("end", () => { - this.emit("close"); - this.socket.destroy(); - this.socket.end(); - }); - } - destroy() { - this.socket.destroy(); - this.socket.end(); - super.destroy(); - } - async _write(message) { - this.socket.write(message); - } -} -//# sourceMappingURL=provider-ipcsocket.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-ipcsocket.js.map b/lib.esm/providers/provider-ipcsocket.js.map deleted file mode 100644 index da850b822..000000000 --- a/lib.esm/providers/provider-ipcsocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,yEAAyE;AACzE,0CAA0C;AAC1C,SAAS,WAAW,CAAC,IAAY;IAIhC,MAAM,QAAQ,GAAkB,EAAE,CAAC;IAEnC,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,OAAO,IAAI,EAAE,CAAC;QACb,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC,CAAC,EAA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,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;YACtD,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC5B,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;YACH,QAAQ,GAAG,SAAS,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YAC1B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO;QACN,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACtB,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QAElB,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-jsonrpc.d.ts b/lib.esm/providers/provider-jsonrpc.d.ts deleted file mode 100644 index f4dc34d1e..000000000 --- a/lib.esm/providers/provider-jsonrpc.d.ts +++ /dev/null @@ -1,267 +0,0 @@ -/** - * About JSON-RPC... - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { AbstractSigner } from "./abstract-signer.js"; -import { Network } from "./network.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { PerformActionRequest, Subscriber, Subscription } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -/** - * A JSON-RPC payload, which are sent to a JSON-RPC server. - */ -export type JsonRpcPayload = { - id: number; - method: string; - params: Array | Record; - jsonrpc: "2.0"; -}; -/** - * A JSON-RPC result, which are returned on success from a JSON-RPC server. - */ -export type JsonRpcResult = { - id: number; - result: any; -}; -/** - * A JSON-RPC error, which are returned on failure from a JSON-RPC server. - */ -export type JsonRpcError = { - id: number; - error: { - code: number; - message?: string; - data?: any; - }; -}; -/** - * When subscribing to the ``"debug"`` event, the [[Listener]] will - * receive this object as the first parameter. - */ -export type DebugEventJsonRpcApiProvider = { - action: "sendRpcPayload"; - payload: JsonRpcPayload | Array; -} | { - action: "receiveRpcResult"; - result: Array; -} | { - action: "receiveRpcError"; - error: Error; -}; -/** - * Options for configuring a [[JsonRpcApiProvider]]. Much of this - * is targetted towards sub-classes, which often will not expose - * any of these options to their consumers. - * - * **``polling``** - use the polling strategy is used immediately - * for events; otherwise, attempt to use filters and fall back onto - * polling (default: ``false``) - * - * **``staticNetwork``** - do not request chain ID on requests to - * validate the underlying chain has not changed (default: ``null``) - * - * This should **ONLY** be used if it is **certain** that the network - * cannot change, such as when using INFURA (since the URL dictates the - * network). If the network is assumed static and it does change, this - * can have tragic consequences. For example, this **CANNOT** be used - * with MetaMask, since the used can select a new network from the - * drop-down at any time. - * - * **``batchStallTime``** - how long (ms) to aggregate requests into a - * single batch. ``0`` indicates batching will only encompass the current - * event loop. If ``batchMaxCount = 1``, this is ignored. (default: ``10``) - * - * **``batchMaxSize``** - target maximum size (bytes) to allow per batch - * request (default: 1Mb) - * - * **``batchMaxCount``** - maximum number of requests to allow in a batch. - * If ``batchMaxCount = 1``, then batching is disabled. (default: ``100``) - */ -export type JsonRpcApiProviderOptions = { - polling?: boolean; - staticNetwork?: null | Network; - batchStallTime?: number; - batchMaxSize?: number; - batchMaxCount?: number; -}; -export interface JsonRpcTransactionRequest { - from?: string; - to?: string; - data?: string; - networkId?: string; - type?: string; - energy?: string; - energyPrice?: string; - nonce?: string; - value?: string; - accessList?: Array<{ - address: string; - storageKeys: Array; - }>; -} -export declare class JsonRpcSigner extends AbstractSigner { - address: string; - constructor(provider: JsonRpcApiProvider, address: string); - connect(provider: null | Provider): Signer; - getAddress(): Promise; - populateTransaction(tx: TransactionRequest): Promise>; - sendUncheckedTransaction(_tx: TransactionRequest): Promise; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(_tx: TransactionRequest): Promise; - signMessage(_message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, _value: Record): Promise; - unlock(password: string): Promise; - _legacySignMessage(_message: string | Uint8Array): Promise; -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -export declare abstract class JsonRpcApiProvider extends AbstractProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key: K): JsonRpcApiProviderOptions[K]; - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network(): Network; - /** - * Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel. - * - * Sub-classes **MUST** override this. - */ - abstract _send(payload: JsonRpcPayload | Array): Promise>; - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - _perform(req: PerformActionRequest): Promise; - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - _detectNetwork(): Promise; - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start(): void; - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - _waitUntilReady(): Promise; - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub: Subscription): Subscriber; - /** - * Returns true only if the [[_start]] has been called. - */ - get ready(): boolean; - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest; - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req: PerformActionRequest): null | { - method: string; - args: Array; - }; - /** - * Returns an CoreBC-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error; - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method: string, params: Array | Record): Promise; - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - getSigner(address?: number | string): Promise; - listAccounts(): Promise>; -} -export declare abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - _getSubscriber(sub: Subscription): Subscriber; - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval(): number; - set pollingInterval(value: number); -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -export declare class JsonRpcProvider extends JsonRpcApiPollingProvider { - #private; - constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions); - _getConnection(): FetchRequest; - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; -} -//# sourceMappingURL=provider-jsonrpc.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-jsonrpc.d.ts.map b/lib.esm/providers/provider-jsonrpc.d.ts.map deleted file mode 100644 index 0635f491a..000000000 --- a/lib.esm/providers/provider-jsonrpc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAUN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOvC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACX,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuD1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,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 No newline at end of file diff --git a/lib.esm/providers/provider-jsonrpc.js b/lib.esm/providers/provider-jsonrpc.js deleted file mode 100644 index bb8dcca74..000000000 --- a/lib.esm/providers/provider-jsonrpc.js +++ /dev/null @@ -1,853 +0,0 @@ -/** - * About JSON-RPC... - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -// @TODO: -// - Add the batching API -import { AbiCoder } from "../abi/index.js"; -import { getAddress } from "../address/index.js"; -import { TypedDataEncoder } from "../hash/index.js"; -import { defineProperties, getBigInt, hexlify, isHexString, toQuantity, toUtf8Bytes, makeError, assert, assertArgument, FetchRequest, resolveProperties, } from "../utils/index.js"; -import { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -import { AbstractSigner } from "./abstract-signer.js"; -import { Network } from "./network.js"; -import { FilterIdEventSubscriber, FilterIdPendingSubscriber, } from "./subscriber-filterid.js"; -import { PollingEventSubscriber } from "./subscriber-polling.js"; -import { resolveAddress } from "../address/checks.js"; -const Primitive = "bigint,boolean,function,number,string,symbol".split(/,/g); -//const Methods = "getAddress,then".split(/,/g); -function deepCopy(value) { - if (value == null || Primitive.indexOf(typeof value) >= 0) { - return value; - } - // Keep any Addressable - if (typeof value.getAddress === "function") { - return value; - } - if (Array.isArray(value)) { - return value.map(deepCopy); - } - if (typeof value === "object") { - return Object.keys(value).reduce((accum, key) => { - accum[key] = value[key]; - return accum; - }, {}); - } - throw new Error(`should not happen: ${value} (${typeof value})`); -} -function stall(duration) { - return new Promise((resolve) => { - setTimeout(resolve, duration); - }); -} -function getLowerCase(value) { - if (value) { - return value.toLowerCase(); - } - return value; -} -function isPollable(value) { - return value && typeof value.pollingInterval === "number"; -} -const defaultOptions = { - polling: false, - staticNetwork: null, - batchStallTime: 10, // 10ms - batchMaxSize: 1 << 20, // 1Mb - batchMaxCount: 100, // 100 requests -}; -// @TODO: Unchecked Signers -export class JsonRpcSigner extends AbstractSigner { - address; - constructor(provider, address) { - super(provider); - address = getAddress(address); - defineProperties(this, { address }); - } - connect(provider) { - assert(false, "cannot reconnect JsonRpcSigner", "UNSUPPORTED_OPERATION", { - operation: "signer.connect", - }); - } - async getAddress() { - return this.address; - } - // JSON-RPC will automatially fill in nonce, etc. so we just check from - async populateTransaction(tx) { - return await this.populateCall(tx); - } - // Returns just the hash of the transaction after sent, which is what - // the bare JSON-RPC API does; - async sendUncheckedTransaction(_tx) { - const tx = deepCopy(_tx); - const promises = []; - // Make sure the from matches the sender - if (tx.from) { - const _from = tx.from; - promises.push((async () => { - const from = await resolveAddress(_from); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - })()); - } - else { - tx.from = this.address; - } - // The JSON-RPC for xcb_sendTransaction uses 90000 energy; if the user - // wishes to use this, it is easy to specify explicitly, otherwise - // we look it up for them. - if (tx.energyLimit == null) { - promises.push((async () => { - tx.energyLimit = await this.provider.estimateEnergy({ - ...tx, - from: this.address, - }); - })()); - } - // The address may be an ENS name or Addressable - if (tx.to != null) { - const _to = tx.to; - promises.push((async () => { - tx.to = await resolveAddress(_to); - })()); - } - // Wait until all of our properties are filled in - if (promises.length) { - await Promise.all(promises); - } - const hexTx = this.provider.getRpcTransaction(tx); - return this.provider.send("xcb_sendTransaction", [hexTx]); - } - async sendTransaction(tx) { - // This cannot be mined any earlier than any recent block - const blockNumber = await this.provider.getBlockNumber(); - // Send the transaction - const hash = await this.sendUncheckedTransaction(tx); - // Unfortunately, JSON-RPC only provides and opaque transaction hash - // for a response, and we need the actual transaction, so we poll - // for it; it should show up very quickly - return await new Promise((resolve, reject) => { - const timeouts = [1000, 100]; - const checkTx = async () => { - // Try getting the transaction - const tx = await this.provider.getTransaction(hash); - if (tx != null) { - resolve(tx.replaceableTransaction(blockNumber)); - return; - } - // Wait another 4 seconds - this.provider._setTimeout(() => { - checkTx(); - }, timeouts.pop() || 4000); - }; - checkTx(); - }); - } - async signTransaction(_tx) { - const tx = deepCopy(_tx); - // Make sure the from matches the sender - if (tx.from) { - const from = await resolveAddress(tx.from); - assertArgument(from != null && from.toLowerCase() === this.address.toLowerCase(), "from address mismatch", "transaction", _tx); - tx.from = from; - } - else { - tx.from = this.address; - } - const hexTx = this.provider.getRpcTransaction(tx); - return await this.provider.send("xcb_signTransaction", [hexTx]); - } - async signMessage(_message) { - const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("personal_sign", [ - hexlify(message), - this.address.toLowerCase(), - ]); - } - async signTypedData(domain, types, _value) { - const value = deepCopy(_value); - // Populate any ENS names (in-place) - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (value) => { - const address = await resolveAddress(value); - assertArgument(address != null, "TypedData does not support null address", "value", value); - return address; - }); - return await this.provider.send("xcb_signTypedData_v4", [ - this.address.toLowerCase(), - JSON.stringify(TypedDataEncoder.getPayload(populated.domain, types, populated.value)), - ]); - } - async unlock(password) { - return this.provider.send("personal_unlockAccount", [ - this.address.toLowerCase(), - password, - null, - ]); - } - async _legacySignMessage(_message) { - const message = typeof _message === "string" ? toUtf8Bytes(_message) : _message; - return await this.provider.send("xcb_sign", [ - this.address.toLowerCase(), - hexlify(message), - ]); - } -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -export class JsonRpcApiProvider extends AbstractProvider { - #options; - // The next ID to use for the JSON-RPC ID field - #nextId; - // Payloads are queued and triggered in batches using the drainTimer - #payloads; - #drainTimer; - #notReady; - #network; - #scheduleDrain() { - if (this.#drainTimer) { - return; - } - // If we aren't using batching, no hard in sending it immeidately - const stallTime = this._getOption("batchMaxCount") === 1 - ? 0 - : this._getOption("batchStallTime"); - this.#drainTimer = setTimeout(() => { - this.#drainTimer = null; - const payloads = this.#payloads; - this.#payloads = []; - while (payloads.length) { - // Create payload batches that satisfy our batch constraints - const batch = [payloads.shift()]; - while (payloads.length) { - if (batch.length === this.#options.batchMaxCount) { - break; - } - batch.push(payloads.shift()); - const bytes = JSON.stringify(batch.map((p) => p.payload)); - if (bytes.length > this.#options.batchMaxSize) { - payloads.unshift(batch.pop()); - break; - } - } - // Process the result to each payload - (async () => { - const payload = batch.length === 1 ? batch[0].payload : batch.map((p) => p.payload); - this.emit("debug", { action: "sendRpcPayload", payload }); - try { - // console.log({payload}) - const result = await this._send(payload); - // console.log({result}) - this.emit("debug", { action: "receiveRpcResult", result }); - // Process results in batch order - for (const { resolve, reject, payload } of batch) { - // Find the matching result - const resp = result.filter((r) => r.id === payload.id)[0]; - // No result; the node failed us in unexpected ways - if (resp == null) { - return reject(makeError("no response from server", "BAD_DATA", { - value: result, - info: { payload }, - })); - } - // The response is an error - if ("error" in resp) { - return reject(this.getRpcError(payload, resp)); - } - // All good; send the result - resolve(resp.result); - } - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - for (const { reject } of batch) { - // @TODO: augment the error with the payload - reject(error); - } - } - })(); - } - }, stallTime); - } - constructor(network, options) { - super(network); - this.#nextId = 1; - this.#options = Object.assign({}, defaultOptions, options || {}); - this.#payloads = []; - this.#drainTimer = null; - this.#network = null; - { - let resolve = null; - const promise = new Promise((_resolve) => { - resolve = _resolve; - }); - this.#notReady = { promise, resolve }; - } - // Make sure any static network is compatbile with the provided netwrok - const staticNetwork = this._getOption("staticNetwork"); - if (staticNetwork) { - assertArgument(network == null || staticNetwork.matches(network), "staticNetwork MUST match network object", "options", options); - this.#network = staticNetwork; - } - } - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key) { - return this.#options[key]; - } - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network() { - assert(this.#network, "network is not available yet", "NETWORK_ERROR"); - return this.#network; - } - /* - { - assert(false, "sub-classes must override _send", "UNSUPPORTED_OPERATION", { - operation: "jsonRpcApiProvider._send" - }); - } - */ - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - async _perform(req) { - const request = this.getRpcRequest(req); - if (request != null) { - return await this.send(request.method, request.args); - } - return super._perform(req); - } - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - async _detectNetwork() { - const network = this._getOption("staticNetwork"); - if (network) { - return network; - } - // If we are ready, use ``send``, which enabled requests to be batched - if (this.ready) { - return Network.from(getBigInt(await this.send("xcb_networkId", []))); - } - // We are not ready yet; use the primitive _send - const payload = { - id: this.#nextId++, - method: "xcb_networkId", - params: [], - jsonrpc: "2.0", - }; - this.emit("debug", { action: "sendRpcPayload", payload }); - let result; - try { - result = (await this._send(payload))[0]; - } - catch (error) { - this.emit("debug", { action: "receiveRpcError", error }); - throw error; - } - this.emit("debug", { action: "receiveRpcResult", result }); - if ("result" in result) { - return Network.from(getBigInt(result.result)); - } - throw this.getRpcError(payload, result); - } - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start() { - if (this.#notReady == null || this.#notReady.resolve == null) { - return; - } - this.#notReady.resolve(); - this.#notReady = null; - (async () => { - // Bootstrap the network - while (this.#network == null) { - try { - this.#network = await this._detectNetwork(); - } - catch (error) { - console.log("JsonRpcProvider failed to startup; retry in 1s"); - await stall(1000); - } - } - // Start dispatching requests - this.#scheduleDrain(); - })(); - } - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - async _waitUntilReady() { - if (this.#notReady == null) { - return; - } - return await this.#notReady.promise; - } - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub) { - // Pending Filters aren't availble via polling - if (sub.type === "pending") { - return new FilterIdPendingSubscriber(this); - } - if (sub.type === "event") { - if (this._getOption("polling")) { - return new PollingEventSubscriber(this, sub.filter); - } - return new FilterIdEventSubscriber(this, sub.filter); - } - // Orphaned Logs are handled automatically, by the filter, since - // logs with removed are emitted by it - if (sub.type === "orphan" && sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("orphan"); - } - return super._getSubscriber(sub); - } - /** - * Returns true only if the [[_start]] has been called. - */ - get ready() { - return this.#notReady == null; - } - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx) { - const result = {}; - // JSON-RPC now requires numeric values to be "quantity" values - [ - "networkId", - "energyLimit", - "energyPrice", - "type", - "nonce", - "value", - ].forEach((key) => { - if (tx[key] == null) { - return; - } - let dstKey = key; - if (key === "energyLimit") { - dstKey = "energy"; - } - result[dstKey] = toQuantity(getBigInt(tx[key], `tx.${key}`)); - }); - // Make sure addresses and data are lowercase - ["from", "to", "data"].forEach((key) => { - if (tx[key] == null) { - return; - } - result[key] = hexlify(tx[key]); - }); - return result; - } - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req) { - switch (req.method) { - case "networkId": - return { method: "xcb_networkId", args: [] }; - case "getBlockNumber": - return { method: "xcb_blockNumber", args: [] }; - case "getEnergyPrice": - return { method: "xcb_energyPrice", args: [] }; - case "getBalance": { - return { - method: "xcb_getBalance", - args: [getLowerCase(req.address), req.blockTag], - }; - } - case "getTransactionCount": - return { - method: "xcb_getTransactionCount", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getCode": - return { - method: "xcb_getCode", - args: [getLowerCase(req.address), req.blockTag], - }; - case "getStorage": - return { - method: "xcb_getStorageAt", - args: [ - getLowerCase(req.address), - "0x" + req.position.toString(16), - req.blockTag, - ], - }; - case "broadcastTransaction": - return { - method: "xcb_sendRawTransaction", - args: [req.signedTransaction], - }; - case "getBlock": - if ("blockTag" in req) { - return { - method: "xcb_getBlockByNumber", - args: [req.blockTag, !!req.includeTransactions], - }; - } - else if ("blockHash" in req) { - return { - method: "xcb_getBlockByHash", - args: [req.blockHash, !!req.includeTransactions], - }; - } - break; - case "getTransaction": - return { - method: "xcb_getTransactionByHash", - args: [req.hash], - }; - case "getTransactionReceipt": - return { - method: "xcb_getTransactionReceipt", - args: [req.hash], - }; - case "call": - return { - method: "xcb_call", - args: [this.getRpcTransaction(req.transaction), req.blockTag], - }; - case "estimateEnergy": { - return { - method: "xcb_estimateEnergy", - args: [this.getRpcTransaction(req.transaction)], - }; - } - case "getLogs": - if (req.filter && req.filter.address != null) { - if (Array.isArray(req.filter.address)) { - req.filter.address = req.filter.address.map(getLowerCase); - } - else { - req.filter.address = getLowerCase(req.filter.address); - } - } - return { method: "xcb_getLogs", args: [req.filter] }; - } - return null; - } - /** - * Returns an CoreBC-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload, _error) { - const { method } = payload; - const { error } = _error; - if (method === "xcb_estimateEnergy" && error.message) { - const msg = error.message; - if (!msg.match(/revert/i) && msg.match(/insufficient funds/i)) { - return makeError("insufficient funds", "INSUFFICIENT_FUNDS", { - transaction: payload.params[0], - info: { payload, error }, - }); - } - } - if (method === "xcb_call" || method === "xcb_estimateEnergy") { - const result = spelunkData(error); - const e = AbiCoder.getBuiltinCallException(method === "xcb_call" ? "call" : "estimateEnergy", payload.params[0], result ? result.data : null); - e.info = { error, payload }; - return e; - } - // Only estimateEnergy and call can return arbitrary contract-defined text, so now we - // we can process text safely. - const message = JSON.stringify(spelunkMessage(error)); - if (typeof error.message === "string" && - error.message.match(/user denied|corebc-user-denied/i)) { - const actionMap = { - xcb_sign: "signMessage", - personal_sign: "signMessage", - xcb_signTypedData_v4: "signTypedData", - xcb_signTransaction: "signTransaction", - xcb_sendTransaction: "sendTransaction", - xcb_requestAccounts: "requestAccess", - wallet_requestAccounts: "requestAccess", - }; - return makeError(`user rejected action`, "ACTION_REJECTED", { - action: actionMap[method] || "unknown", - reason: "rejected", - info: { payload, error }, - }); - } - if (method === "xcb_sendRawTransaction" || - method === "xcb_sendTransaction") { - const transaction = payload.params[0]; - if (message.match(/insufficient funds|base fee exceeds energy limit/i)) { - return makeError("insufficient funds for intrinsic transaction cost", "INSUFFICIENT_FUNDS", { - transaction, - info: { error }, - }); - } - if (message.match(/nonce/i) && message.match(/too low/i)) { - return makeError("nonce has already been used", "NONCE_EXPIRED", { - transaction, - info: { error }, - }); - } - // "replacement transaction underpriced" - if (message.match(/replacement transaction/i) && - message.match(/underpriced/i)) { - return makeError("replacement fee too low", "REPLACEMENT_UNDERPRICED", { - transaction, - info: { error }, - }); - } - if (message.match(/only replay-protected/i)) { - return makeError("legacy pre-eip-155 transactions not supported", "UNSUPPORTED_OPERATION", { - operation: method, - info: { transaction, info: { error } }, - }); - } - } - if (message.match(/the method .* does not exist/i)) { - return makeError("unsupported operation", "UNSUPPORTED_OPERATION", { - operation: payload.method, - info: { error }, - }); - } - return makeError("could not coalesce error", "UNKNOWN_ERROR", { error }); - } - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method, params) { - // @TODO: cache networkId?? purge on switch_networks - const id = this.#nextId++; - const promise = new Promise((resolve, reject) => { - this.#payloads.push({ - resolve, - reject, - payload: { method, params, id, jsonrpc: "2.0" }, - }); - }); - // If there is not a pending drainTimer, set one - this.#scheduleDrain(); - return promise; - } - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - async getSigner(address) { - if (address == null) { - address = 0; - } - const accountsPromise = this.send("xcb_accounts", []); - // Account index - if (typeof address === "number") { - const accounts = await accountsPromise; - if (address >= accounts.length) { - throw new Error("no such account"); - } - return new JsonRpcSigner(this, accounts[address]); - } - const { accounts } = await resolveProperties({ - network: this.getNetwork(), - accounts: accountsPromise, - }); - // Account address - address = getAddress(address); - for (const account of accounts) { - if (getAddress(account) === address) { - return new JsonRpcSigner(this, address); - } - } - throw new Error("invalid account"); - } - async listAccounts() { - const accounts = await this.send("xcb_accounts", []); - return accounts.map((a) => new JsonRpcSigner(this, a)); - } -} -export class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #pollingInterval; - constructor(network, options) { - super(network, options); - this.#pollingInterval = 4000; - } - _getSubscriber(sub) { - const subscriber = super._getSubscriber(sub); - if (isPollable(subscriber)) { - subscriber.pollingInterval = this.#pollingInterval; - } - return subscriber; - } - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval() { - return this.#pollingInterval; - } - set pollingInterval(value) { - if (!Number.isInteger(value) || value < 0) { - throw new Error("invalid interval"); - } - this.#pollingInterval = value; - this._forEachSubscriber((sub) => { - if (isPollable(sub)) { - sub.pollingInterval = this.#pollingInterval; - } - }); - } -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -export class JsonRpcProvider extends JsonRpcApiPollingProvider { - #connect; - constructor(url, network, options) { - if (url == null) { - url = "http://localhost:8545"; - } - super(network, options); - if (typeof url === "string") { - this.#connect = new FetchRequest(url); - } - else { - this.#connect = url.clone(); - } - } - _getConnection() { - return this.#connect.clone(); - } - async send(method, params) { - // All requests are over HTTP, so we can just start handling requests - // We do this here rather than the constructor so that we don't send any - // requests to the network (i.e. xcb_networkId) until we absolutely have to. - await this._start(); - return await super.send(method, params); - } - async _send(payload) { - // Configure a POST connection for the requested method - const request = this._getConnection(); - request.body = JSON.stringify(payload); - request.setHeader("content-type", "application/json"); - const response = await request.send(); - response.assertOk(); - let resp = response.bodyJson; - if (!Array.isArray(resp)) { - resp = [resp]; - } - return resp; - } -} -function spelunkData(value) { - if (value == null) { - return null; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string" && - value.message.match("reverted") && - isHexString(value.data)) { - return { message: value.message, data: value.data }; - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - const result = spelunkData(value[key]); - if (result) { - return result; - } - } - return null; - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return spelunkData(JSON.parse(value)); - } - catch (error) { } - } - return null; -} -function _spelunkMessage(value, result) { - if (value == null) { - return; - } - // These *are* the droids we're looking for. - if (typeof value.message === "string") { - result.push(value.message); - } - // Spelunk further... - if (typeof value === "object") { - for (const key in value) { - _spelunkMessage(value[key], result); - } - } - // Might be a JSON string we can further descend... - if (typeof value === "string") { - try { - return _spelunkMessage(JSON.parse(value), result); - } - catch (error) { } - } -} -function spelunkMessage(value) { - const result = []; - _spelunkMessage(value, result); - return result; -} -//# sourceMappingURL=provider-jsonrpc.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-jsonrpc.js.map b/lib.esm/providers/provider-jsonrpc.js.map deleted file mode 100644 index e00e6340e..000000000 --- a/lib.esm/providers/provider-jsonrpc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-jsonrpc.js","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,SAAS;AACT,yBAAyB;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACN,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EAC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AC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;IAED,mDAAmD;IACnD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC;YACJ,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;QACnD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;IACnB,CAAC;AACF,CAAC;AAED,SAAS,cAAc,CAAC,KAAU;IACjC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/provider-pocket.d.ts b/lib.esm/providers/provider-pocket.d.ts deleted file mode 100644 index 01b2fd311..000000000 --- a/lib.esm/providers/provider-pocket.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -export declare class PocketProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Application ID for the Pocket connection. - */ - readonly applicationId: string; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - readonly applicationSecret: null | string; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, applicationId?: null | string, applicationSecret?: null | string); - _getProvider(networkId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network: Network, applicationId?: null | string, applicationSecret?: null | string): FetchRequest; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-pocket.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-pocket.d.ts.map b/lib.esm/providers/provider-pocket.d.ts.map deleted file mode 100644 index aaf617488..000000000 --- a/lib.esm/providers/provider-pocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB/C;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,EA0BjC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAShD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAC/B,YAAY,CAsBd;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-pocket.js b/lib.esm/providers/provider-pocket.js deleted file mode 100644 index 5f4d5cd44..000000000 --- a/lib.esm/providers/provider-pocket.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -import { defineProperties, FetchRequest, assertArgument, } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -const defaultApplicationId = "62e1ad51b37b8e00394bda3b"; -function getHost(name) { - switch (name) { - case "mainnet": - return "eth-mainnet.gateway.pokt.network"; - case "goerli": - return "eth-goerli.gateway.pokt.network"; - case "matic": - return "poly-mainnet.gateway.pokt.network"; - case "matic-mumbai": - return "polygon-mumbai-rpc.gateway.pokt.network"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -export class PocketProvider extends JsonRpcProvider { - /** - * The Application ID for the Pocket connection. - */ - applicationId; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - applicationSecret; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network, applicationId, applicationSecret) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (applicationId == null) { - applicationId = defaultApplicationId; - } - if (applicationSecret == null) { - applicationSecret = null; - } - const options = { staticNetwork: network }; - const request = PocketProvider.getRequest(network, applicationId, applicationSecret); - super(request, network, options); - defineProperties(this, { - applicationId, - applicationSecret, - }); - } - _getProvider(networkId) { - try { - return new PocketProvider(networkId, this.applicationId, this.applicationSecret); - } - catch (error) { } - return super._getProvider(networkId); - } - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network, applicationId, applicationSecret) { - if (applicationId == null) { - applicationId = defaultApplicationId; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/v1/lb/${applicationId}`); - request.allowGzip = true; - if (applicationSecret) { - request.setCredentials("", applicationSecret); - } - if (applicationId === defaultApplicationId) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("PocketProvider"); - return true; - }; - } - return request; - } - isCommunityResource() { - return this.applicationId === defaultApplicationId; - } -} -//# sourceMappingURL=provider-pocket.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-pocket.js.map b/lib.esm/providers/provider-pocket.js.map deleted file mode 100644 index 7b691e676..000000000 --- a/lib.esm/providers/provider-pocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-pocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EACN,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKxD,MAAM,oBAAoB,GAAG,0BAA0B,CAAC;AAExD,SAAS,OAAO,CAA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,aAAa,EAClB,IAAI,CAAC,iBAAiB,CACtB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;QAClB,OAAO,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAgB,EAChB,aAA6B,EAC7B,iBAAiC;QAEjC,IAAI,aAAa,IAAI,IAAI,EAAE,CAAC;YAC3B,aAAa,GAAG,oBAAoB,CAAC;QACtC,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC/B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,aAAa,EAAE,CAC1D,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QAEzB,IAAI,iBAAiB,EAAE,CAAC;YACvB,OAAO,CAAC,cAAc,CAAC,EAAE,EAAE,iBAAiB,CAAC,CAAC;QAC/C,CAAC;QAED,IAAI,aAAa,KAAK,oBAAoB,EAAE,CAAC;YAC5C,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACxD,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;gBACtC,OAAO,IAAI,CAAC;YACb,CAAC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,mBAAmB;QAClB,OAAO,IAAI,CAAC,aAAa,KAAK,oBAAoB,CAAC;IACpD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-quicknode.d.ts b/lib.esm/providers/provider-quicknode.d.ts deleted file mode 100644 index 610dc234a..000000000 --- a/lib.esm/providers/provider-quicknode.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -export declare class QuickNodeProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API token. - */ - readonly token: string; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network?: Networkish, token?: null | string); - _getProvider(networkId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network: Network, token?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-quicknode.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-quicknode.d.ts.map b/lib.esm/providers/provider-quicknode.d.ts.map deleted file mode 100644 index f3be4df32..000000000 --- a/lib.esm/providers/provider-quicknode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B/C;;;;;;;;GAQG;AACH,qBAAa,iBACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,EAavD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAmBvE;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-quicknode.js b/lib.esm/providers/provider-quicknode.js deleted file mode 100644 index 0adfb3696..000000000 --- a/lib.esm/providers/provider-quicknode.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -import { defineProperties, FetchRequest, assertArgument, } from "../utils/index.js"; -import { showThrottleMessage } from "./community.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -const defaultToken = "919b412a057b5e9c9b6dce193c5a60242d6efadb"; -function getHost(name) { - switch (name) { - case "mainnet": - return "corebc.quiknode.pro"; - case "arbitrum": - return "corebc.arbitrum-mainnet.quiknode.pro"; - case "arbitrum-goerli": - return "corebc.arbitrum-goerli.quiknode.pro"; - case "matic": - return "corebc.matic.quiknode.pro"; - case "matic-mumbai": - return "corebc.matic-testnet.quiknode.pro"; - case "optimism": - return "corebc.optimism.quiknode.pro"; - case "optimism-goerli": - return "corebc.optimism-goerli.quiknode.pro"; - } - assertArgument(false, "unsupported network", "network", name); -} -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -export class QuickNodeProvider extends JsonRpcProvider { - /** - * The API token. - */ - token; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network, token) { - if (_network == null) { - _network = "mainnet"; - } - const network = Network.from(_network); - if (token == null) { - token = defaultToken; - } - const request = QuickNodeProvider.getRequest(network, token); - super(request, network, { staticNetwork: network }); - defineProperties(this, { token }); - } - _getProvider(networkId) { - try { - return new QuickNodeProvider(networkId, this.token); - } - catch (error) { } - return super._getProvider(networkId); - } - isCommunityResource() { - return this.token === defaultToken; - } - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network, token) { - if (token == null) { - token = defaultToken; - } - const request = new FetchRequest(`https:/\/${getHost(network.name)}/${token}`); - request.allowGzip = true; - //if (projectSecret) { request.setCredentials("", projectSecret); } - if (token === defaultToken) { - request.retryFunc = async (request, response, attempt) => { - showThrottleMessage("QuickNodeProvider"); - return true; - }; - } - return request; - } -} -//# sourceMappingURL=provider-quicknode.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-quicknode.js.map b/lib.esm/providers/provider-quicknode.js.map deleted file mode 100644 index 2bead724e..000000000 --- a/lib.esm/providers/provider-quicknode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-quicknode.js","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts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AC,CAAC;QAC7D,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;QAEpD,gBAAgB,CAAoB,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,YAAY,CAAC,SAAiB;QAC7B,IAAI,CAAC;YACJ,OAAO,IAAI,iBAAiB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;QAClB,OAAO,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAED,mBAAmB;QAClB,OAAO,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC;IACpC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAgB,EAAE,KAAqB;QACxD,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,KAAK,GAAG,YAAY,CAAC;QACtB,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,YAAY,CAC/B,YAAY,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAC5C,CAAC;QACF,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,mEAAmE;QAEnE,IAAI,KAAK,KAAK,YAAY,EAAE,CAAC;YAC5B,OAAO,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;gBACxD,mBAAmB,CAAC,mBAAmB,CAAC,CAAC;gBACzC,OAAO,IAAI,CAAC;YACb,CAAC,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-socket.d.ts b/lib.esm/providers/provider-socket.d.ts deleted file mode 100644 index 7ee5054ce..000000000 --- a/lib.esm/providers/provider-socket.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider - */ -import { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -import type { Subscriber, Subscription } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcError, JsonRpcPayload, JsonRpcResult } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -export declare class SocketSubscriber implements Subscriber { - #private; - get filter(): Array; - constructor(provider: SocketProvider, filter: Array); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; - _handleMessage(message: any): void; - _emit(provider: SocketProvider, message: any): Promise; -} -export declare class SocketBlockSubscriber extends SocketSubscriber { - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -export declare class SocketPendingSubscriber extends SocketSubscriber { - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -export declare class SocketEventSubscriber extends SocketSubscriber { - #private; - get logFilter(): EventFilter; - constructor(provider: SocketProvider, filter: EventFilter); - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * SocketProvider... - * - */ -export declare class SocketProvider extends JsonRpcApiProvider { - #private; - constructor(network?: Networkish); - _getSubscriber(sub: Subscription): Subscriber; - _register(filterId: number | string, subscriber: SocketSubscriber): void; - _send(payload: JsonRpcPayload | Array): Promise>; - _processMessage(message: string): Promise; - _write(message: string): Promise; -} -//# sourceMappingURL=provider-socket.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-socket.d.ts.map b/lib.esm/providers/provider-socket.d.ts.map deleted file mode 100644 index e919560e4..000000000 --- a/lib.esm/providers/provider-socket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-socket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAA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cAAc,EAAE,MAAM,EAAE,WAAW,EAGxD;IAEK,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjE;CACD;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;;IAiBrD,YAAY,OAAO,CAAC,EAAE,UAAU,EAK/B;IAYD,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAkB5C;IAED,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI,CASvE;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAuB9C;IAkBK,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCpD;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-socket.js b/lib.esm/providers/provider-socket.js deleted file mode 100644 index 260c94e65..000000000 --- a/lib.esm/providers/provider-socket.js +++ /dev/null @@ -1,225 +0,0 @@ -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider - */ -import { UnmanagedSubscriber } from "./abstract-provider.js"; -import { assert, assertArgument, makeError } from "../utils/index.js"; -import { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -export class SocketSubscriber { - #provider; - #filter; - get filter() { - return JSON.parse(this.#filter); - } - #filterId; - #paused; - #emitPromise; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = JSON.stringify(filter); - this.#filterId = null; - this.#paused = null; - this.#emitPromise = null; - } - start() { - this.#filterId = this.#provider - .send("xcb_subscribe", this.filter) - .then((filterId) => { - this.#provider._register(filterId, this); - return filterId; - }); - } - stop() { - this.#filterId.then((filterId) => { - this.#provider.send("xcb_unsubscribe", [filterId]); - }); - this.#filterId = null; - } - // @TODO: pause should trap the current blockNumber, unsub, and on resume use getLogs - // and resume - pause(dropWhilePaused) { - assert(dropWhilePaused, "preserve logs while paused not supported by SocketSubscriber yet", "UNSUPPORTED_OPERATION", { operation: "pause(false)" }); - this.#paused = !!dropWhilePaused; - } - resume() { - this.#paused = null; - } - _handleMessage(message) { - if (this.#filterId == null) { - return; - } - if (this.#paused === null) { - let emitPromise = this.#emitPromise; - if (emitPromise == null) { - emitPromise = this._emit(this.#provider, message); - } - else { - emitPromise = emitPromise.then(async () => { - await this._emit(this.#provider, message); - }); - } - this.#emitPromise = emitPromise.then(() => { - if (this.#emitPromise === emitPromise) { - this.#emitPromise = null; - } - }); - } - } - async _emit(provider, message) { - throw new Error("sub-classes must implemente this; _emit"); - } -} -export class SocketBlockSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newHeads"]); - } - async _emit(provider, message) { - provider.emit("block", parseInt(message.number)); - } -} -export class SocketPendingSubscriber extends SocketSubscriber { - constructor(provider) { - super(provider, ["newPendingTransactions"]); - } - async _emit(provider, message) { - provider.emit("pending", message); - } -} -export class SocketEventSubscriber extends SocketSubscriber { - #logFilter; - get logFilter() { - return JSON.parse(this.#logFilter); - } - constructor(provider, filter) { - super(provider, ["logs", filter]); - this.#logFilter = JSON.stringify(filter); - } - async _emit(provider, message) { - provider.emit(this.logFilter, provider._wrapLog(message, provider._network)); - } -} -/** - * SocketProvider... - * - */ -export class SocketProvider extends JsonRpcApiProvider { - #callbacks; - // Maps each filterId to its subscriber - #subs; - // If any events come in before a subscriber has finished - // registering, queue them - #pending; - constructor(network) { - super(network, { batchMaxCount: 1 }); - this.#callbacks = new Map(); - this.#subs = new Map(); - this.#pending = new Map(); - } - // This value is only valid after _start has been called - /* - get _network(): Network { - if (this.#network == null) { - throw new Error("this shouldn't happen"); - } - return this.#network.clone(); - } - */ - _getSubscriber(sub) { - switch (sub.type) { - case "close": - return new UnmanagedSubscriber("close"); - case "block": - return new SocketBlockSubscriber(this); - case "pending": - return new SocketPendingSubscriber(this); - case "event": - return new SocketEventSubscriber(this, sub.filter); - case "orphan": - // Handled auto-matically within AbstractProvider - // when the log.removed = true - if (sub.filter.orphan === "drop-log") { - return new UnmanagedSubscriber("drop-log"); - } - } - return super._getSubscriber(sub); - } - _register(filterId, subscriber) { - this.#subs.set(filterId, subscriber); - const pending = this.#pending.get(filterId); - if (pending) { - for (const message of pending) { - subscriber._handleMessage(message); - } - this.#pending.delete(filterId); - } - } - async _send(payload) { - // WebSocket provider doesn't accept batches - assertArgument(!Array.isArray(payload), "WebSocket does not support batch send", "payload", payload); - // @TODO: stringify payloads here and store to prevent mutations - // Prepare a promise to respond to - const promise = new Promise((resolve, reject) => { - this.#callbacks.set(payload.id, { payload, resolve, reject }); - }); - // Wait until the socket is connected before writing to it - await this._waitUntilReady(); - // Write the request to the socket - await this._write(JSON.stringify(payload)); - return [await promise]; - } - // Sub-classes must call this once they are connected - /* - async _start(): Promise { - if (this.#ready) { return; } - - for (const { payload } of this.#callbacks.values()) { - await this._write(JSON.stringify(payload)); - } - - this.#ready = (async function() { - await super._start(); - })(); - } - */ - // Sub-classes must call this for each message - async _processMessage(message) { - const result = (JSON.parse(message)); - if ("id" in result) { - const callback = this.#callbacks.get(result.id); - if (callback == null) { - this.emit("error", makeError("received result for unknown id", "UNKNOWN_ERROR", { - reasonCode: "UNKNOWN_ID", - result, - })); - return; - } - this.#callbacks.delete(result.id); - callback.resolve(result); - } - else if (result.method === "xcb_subscription") { - const filterId = result.params.subscription; - const subscriber = this.#subs.get(filterId); - if (subscriber) { - subscriber._handleMessage(result.params.result); - } - else { - let pending = this.#pending.get(filterId); - if (pending == null) { - pending = []; - this.#pending.set(filterId, pending); - } - pending.push(result.params.result); - } - } - } - async _write(message) { - throw new Error("sub-classes must override this"); - } -} -//# sourceMappingURL=provider-socket.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-socket.js.map b/lib.esm/providers/provider-socket.js.map deleted file mode 100644 index 53b04b7bc..000000000 --- a/lib.esm/providers/provider-socket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-socket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAmB3D,MAAM,OAAO,gBAAgB;IAC5B,SAAS,CAAiB;IAE1B,OAAO,CAAS;IAChB,IAAI,MAAM;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IAED,SAAS,CAAkC;IAC3C,OAAO,CAAiB;IAExB,YAAY,CAAuB;IAEnC,YAAY,QAAwB,EAAE,MAAkB;QACvD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,KAAK;QACJ,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS;aAC7B,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC;aAClC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YAClB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACzC,OAAO,Q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ib.esm/providers/provider-websocket.d.ts deleted file mode 100644 index 9938502d0..000000000 --- a/lib.esm/providers/provider-websocket.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SocketProvider } from "./provider-socket.js"; -import type { Networkish } from "./network.js"; -export interface WebSocketLike { - onopen: null | ((...args: Array) => any); - onmessage: null | ((...args: Array) => any); - onerror: null | ((...args: Array) => any); - readyState: number; - send(payload: any): void; - close(code?: number, reason?: string): void; -} -export type WebSocketCreator = () => WebSocketLike; -export declare class WebSocketProvider extends SocketProvider { - #private; - get websocket(): WebSocketLike; - constructor(url: string | WebSocketLike | WebSocketCreator, network?: Networkish); - _write(message: string): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-websocket.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider-websocket.d.ts.map b/lib.esm/providers/provider-websocket.d.ts.map deleted file mode 100644 index 57f785f9c..000000000 --- a/lib.esm/providers/provider-websocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-websocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9C,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IACjD,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD,qBAAa,iBAAkB,SAAQ,cAAc;;IAIpD,IAAI,SAAS,IAAI,aAAa,CAK7B;IAED,YACC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,gBAAgB,EAC9C,OAAO,CAAC,EAAE,UAAU,EA4CpB;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAM7B;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider-websocket.js b/lib.esm/providers/provider-websocket.js deleted file mode 100644 index b0905e998..000000000 --- a/lib.esm/providers/provider-websocket.js +++ /dev/null @@ -1,68 +0,0 @@ -import { WebSocket as _WebSocket } from "./ws.js"; /*-browser*/ -import { SocketProvider } from "./provider-socket.js"; -export class WebSocketProvider extends SocketProvider { - #connect; - #websocket; - get websocket() { - if (this.#websocket == null) { - throw new Error("websocket closed"); - } - return this.#websocket; - } - constructor(url, network) { - super(network); - if (typeof url === "string") { - this.#connect = () => { - return new _WebSocket(url); - }; - this.#websocket = this.#connect(); - } - else if (typeof url === "function") { - this.#connect = url; - this.#websocket = url(); - } - else { - this.#connect = null; - this.#websocket = url; - } - this.websocket.onopen = async () => { - try { - await this._start(); - this.resume(); - } - catch (error) { - console.log("failed to start WebsocketProvider", error); - // @TODO: now what? Attempt reconnect? - } - }; - this.websocket.onmessage = (message) => { - this._processMessage(message.data); - }; - /* - this.websocket.onclose = (event) => { - // @TODO: What event.code should we reconnect on? - const reconnect = false; - if (reconnect) { - this.pause(true); - if (this.#connect) { - this.#websocket = this.#connect(); - this.#websocket.onopen = ... - // @TODO: this requires the super class to rebroadcast; move it there - } - this._reconnect(); - } - }; -*/ - } - async _write(message) { - this.websocket.send(message); - } - async destroy() { - if (this.#websocket != null) { - this.#websocket.close(); - this.#websocket = null; - } - super.destroy(); - } -} -//# sourceMappingURL=provider-websocket.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider-websocket.js.map b/lib.esm/providers/provider-websocket.js.map deleted file mode 100644 index 4aca54fc4..000000000 --- a/lib.esm/providers/provider-websocket.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-websocket.js","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC,CAAC,YAAY;AAE/D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAiBtD,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IACpD,QAAQ,CAA0B;IAElC,UAAU,CAAuB;IACjC,IAAI,SAAS;QACZ,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,YACC,GAA8C,EAC9C,OAAoB;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC7B,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE;gBACpB,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;YAC5B,CAAC,CAAC;YACF,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnC,CAAC;aAAM,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;YACtC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;YACpB,IAAI,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC;QACzB,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACvB,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE;YAClC,IAAI,CAAC;gBACJ,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;gBACpB,IAAI,CAAC,MAAM,EAAE,CAAC;YACf,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;gBACxD,sCAAsC;YACvC,CAAC;QACF,CAAC,CAAC;QAEF,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,CAAC,OAAyB,EAAE,EAAE;YACxD,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC;QACF;;;;;;;;;;;;;;EAcA;IACD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,OAAe;QAC3B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE,CAAC;YAC7B,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACxB,CAAC;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/provider.d.ts b/lib.esm/providers/provider.d.ts deleted file mode 100644 index 68556f754..000000000 --- a/lib.esm/providers/provider.d.ts +++ /dev/null @@ -1,623 +0,0 @@ -import type { AddressLike, NameResolver } from "../address/index.js"; -import type { BigNumberish, EventEmitterable } from "../utils/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { Network } from "./network.js"; -export type BlockTag = BigNumberish | string; -import { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -export declare class FeeData { - /** - * The energy price for legacy networks. - */ - readonly energyPrice: null | bigint; - constructor(energyPrice?: null | bigint); - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; -} -export interface TransactionRequest { - type?: null | number; - to?: null | AddressLike; - from?: null | AddressLike; - nonce?: null | number; - energyLimit?: null | BigNumberish; - energyPrice?: null | BigNumberish; - data?: null | string; - value?: null | BigNumberish; - networkId?: null | BigNumberish; - customData?: any; - blockTag?: BlockTag; - enableCcipRead?: boolean; -} -export interface PreparedTransactionRequest { - to?: AddressLike; - from?: AddressLike; - nonce?: number; - energyLimit?: bigint; - energyPrice?: bigint; - data?: string; - value?: bigint; - networkId?: bigint; - customData?: any; - blockTag?: BlockTag; - enableCcipRead?: boolean; -} -export declare function copyRequest(req: TransactionRequest): PreparedTransactionRequest; -/** - * An Interface to indicate a [[Block]] has been included in the - * blockchain. This asserts a Type Guard that necessary properties - * are non-null. - * - * Before a block is included, it is a //pending// block. - */ -export interface MinedBlock extends Block { - readonly number: number; - readonly hash: string; - readonly timestamp: number; - readonly date: Date; - readonly miner: string; -} -/** - * A **Block** represents the data associated with a full block on - * Core. - */ -export declare class Block implements BlockParams, Iterable { - #private; - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - readonly number: number; - /** - * The block hash. - */ - readonly hash: null | string; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - readonly timestamp: number; - /** - * The block hash of the parent block. - */ - readonly parentHash: string; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - readonly nonce: string; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - readonly difficulty: bigint; - /** - * The total energy limit for this block. - */ - readonly energyLimit: bigint; - /** - * The total energy used in this block. - */ - readonly energyUsed: bigint; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - readonly miner: string; - /** - * Any extra data the validator wished to include. - */ - readonly extraData: string; - /** - * The base fee per energy that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - readonly baseFeePerEnergy: null | bigint; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block: BlockParams, provider: Provider); - /** - * Returns the list of transaction hashes. - */ - get transactions(): ReadonlyArray; - /** - * Returns the complete transactions for blocks which - * prefetched them, by passing ``true`` to %%prefetchTxs%% - * into [[provider_getBlock]]. - */ - get prefetchedTransactions(): Array; - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; - [Symbol.iterator](): Iterator; - /** - * The number of transactions in this block. - */ - get length(): number; - /** - * The [[link-js-date]] this block was included at. - */ - get date(): null | Date; - /** - * Get the transaction at %%indexe%% within this block. - */ - getTransaction(indexOrHash: number | string): Promise; - getPrefetchedTransaction(indexOrHash: number | string): TransactionResponse; - /** - * Has this block been mined. - * - * If true, the block has been typed-gaurded that all mined - * properties are non-null. - */ - isMined(): this is MinedBlock; - /** - * - */ - isLondon(): this is Block & { - baseFeePerEnergy: bigint; - }; - orphanedEvent(): OrphanFilter; -} -export declare class Log implements LogParams { - readonly provider: Provider; - readonly transactionHash: string; - readonly blockHash: string; - readonly blockNumber: number; - readonly removed: boolean; - readonly address: string; - readonly data: string; - readonly topics: ReadonlyArray; - readonly index: number; - readonly transactionIndex: number; - constructor(log: LogParams, provider: Provider); - toJSON(): any; - getBlock(): Promise; - getTransaction(): Promise; - getTransactionReceipt(): Promise; - removedEvent(): OrphanFilter; -} -export declare class TransactionReceipt implements TransactionReceiptParams, Iterable { - #private; - readonly provider: Provider; - readonly to: null | string; - readonly from: string; - readonly contractAddress: null | string; - readonly hash: string; - readonly index: number; - readonly blockHash: string; - readonly blockNumber: number; - readonly logsBloom: string; - readonly energyUsed: bigint; - readonly cumulativeEnergyUsed: bigint; - readonly energyPrice: bigint; - readonly type: number; - readonly status: null | number; - readonly root: null | string; - constructor(tx: TransactionReceiptParams, provider: Provider); - get logs(): ReadonlyArray; - toJSON(): any; - get length(): number; - [Symbol.iterator](): Iterator; - get fee(): bigint; - getBlock(): Promise; - getTransaction(): Promise; - getResult(): Promise; - confirmations(): Promise; - removedEvent(): OrphanFilter; - reorderedEvent(other?: TransactionResponse): OrphanFilter; -} -export interface MinedTransactionResponse extends TransactionResponse { - blockNumber: number; - blockHash: string; - date: Date; -} -export declare class TransactionResponse implements TransactionLike, TransactionResponseParams { - #private; - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - readonly provider: Provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockNumber: null | number; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockHash: null | string; - /** - * The index within the block that this transaction resides at. - */ - readonly index: number; - /** - * The transaction hash. - */ - readonly hash: string; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - readonly type: number; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - readonly to: null | string; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - readonly from: string; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - readonly nonce: number; - /** - * The maximum units of energy this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - readonly energyLimit: bigint; - /** - * The energy price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective energy price// (the fee per energy that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerEnergy]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of energy the transaction - * consumes. - */ - readonly energyPrice: bigint; - /** - * The data. - */ - readonly data: string; - /** - * The value, in ore. Use [[formatXCB]] to format this value - * as xcb. - */ - readonly value: bigint; - /** - * The chain ID. - */ - readonly networkId: bigint; - /** - * The signature. - */ - readonly signature: string; - /** - * Create a new TransactionResponse with %%tx%% parameters - * connected to %%provider%%. - */ - constructor(tx: TransactionResponseParams, provider: Provider); - /** - * Returns a JSON representation of this transaction. - */ - toJSON(): any; - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - getBlock(): Promise; - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - getTransaction(): Promise; - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - wait(_confirms?: number, _timeout?: number): Promise; - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined(): this is MinedTransactionResponse; - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy(): this is TransactionResponse & { - accessList: null; - maxFeePerEnergy: null; - maxPriorityFeePerEnergy: null; - }; - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent(): OrphanFilter; - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter; - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock: number): TransactionResponse; -} -/** - * An Orphan Filter allows detecting when an orphan block has - * resulted in dropping a block or transaction or has resulted - * in transactions changing order. - * - * Not currently fully supported. - */ -export type OrphanFilter = { - orphan: "drop-block"; - hash: string; - number: number; -} | { - orphan: "drop-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "reorder-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "drop-log"; - log: { - transactionHash: string; - blockHash: string; - blockNumber: number; - address: string; - data: string; - topics: ReadonlyArray; - index: number; - }; -}; -/** - * A **TopicFilter** provides a struture to define bloom-filter - * queries. - * - * Each field that is ``null`` matches **any** value, a field that is - * a ``string`` must match exactly that value and and ``array`` is - * effectively an ``OR``-ed set, where any one of those values must - * match. - */ -export type TopicFilter = Array>; -export interface EventFilter { - address?: AddressLike | Array; - topics?: TopicFilter; -} -export interface Filter extends EventFilter { - fromBlock?: BlockTag; - toBlock?: BlockTag; -} -export interface FilterByBlockHash extends EventFilter { - blockHash?: string; -} -export type ProviderEvent = string | Array> | EventFilter | OrphanFilter; -/** - * A **Provider** is the primary method to interact with the read-only - * content on Core. - * - * It allows access to details about accounts, blocks and transactions - * and the ability to query event logs and simulate contract execution. - * - * Account data includes the [balance](getBalance), - * [transaction count](getTransactionCount), [code](getCode) and - * [state trie storage](getStorage). - * - * Simulating execution can be used to [call](call), - * [estimate energy](estimateEnergy) and - * [get transaction results](getTransactionResult). - * - * The [[broadcastTransaction]] is the only method which allows updating - * the blockchain, but it is usually accessed by a [[Signer]], since a - * private key must be used to sign the transaction before it can be - * broadcast. - */ -export interface Provider extends ContractRunner, EventEmitterable, NameResolver { - /** - * The provider iteself. - * - * This is part of the necessary API for executing a contract, as - * it provides a common property on any [[ContractRunner]] that - * can be used to access the read-only portion of the runner. - */ - provider: this; - /** - * Shutdown any resources this provider is using. No additional - * calls should be made to this provider after calling this. - */ - destroy(): void; - /** - * Get the current block number. - */ - getBlockNumber(): Promise; - /** - * Get the connected [[Network]]. - */ - getNetwork(): Promise; - /** - * Get the best guess at the recommended [[FeeData]]. - */ - getFeeData(): Promise; - /** - * Get the account balance (in ore) of %%address%%. If %%blockTag%% - * is specified and the node supports archive access for that - * %%blockTag%%, the balance is as of that [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the number of transactions ever sent for %%address%%, which - * is used as the ``nonce`` when sending a transaction. If - * %%blockTag%% is specified and the node supports archive access - * for that %%blockTag%%, the transaction count is as of that - * [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the bytecode for %%address%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the storage slot value for %%address%% at slot %%position%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getStorage(address: AddressLike, position: BigNumberish, blockTag?: BlockTag): Promise; - /** - * Estimates the amount of energy required to executre %%tx%%. - */ - estimateEnergy(tx: TransactionRequest): Promise; - /** - * Simulate the execution of %%tx%%. If the call reverts, it will - * throw a [[CallExceptionError]] which includes the revert data. - */ - call(tx: TransactionRequest): Promise; - /** - * Broadcasts the %%signedTx%% to the network, adding it to the - * memory pool of any node for which the transaction meets the - * rebroadcast requirements. - */ - broadcastTransaction(signedTx: string): Promise; - /** - * Resolves to the block for %%blockHashOrBlockTag%%. - * - * If %%prefetchTxs%%, and the backend supports including transactions - * with block requests, all transactions will be included and the - * [[Block]] object will not need to make remote calls for getting - * transactions. - */ - getBlock(blockHashOrBlockTag: BlockTag | string, prefetchTxs?: boolean): Promise; - /** - * Resolves to the transaction for %%hash%%. - * - * If the transaction is unknown or on pruning nodes which - * discard old transactions this resolves to ``null``. - */ - getTransaction(hash: string): Promise; - /** - * Resolves to the transaction receipt for %%hash%%, if mined. - * - * If the transaction has not been mined, is unknown or on - * pruning nodes which discard old transactions this resolves to - * ``null``. - */ - getTransactionReceipt(hash: string): Promise; - /** - * Resolves to the result returned by the executions of %%hash%%. - * - * This is only supported on nodes with archive access and with - * the necessary debug APIs enabled. - */ - getTransactionResult(hash: string): Promise; - /** - * Resolves to the list of Logs that match %%filter%% - */ - getLogs(filter: Filter | FilterByBlockHash): Promise>; - /** - * Resolves to the address configured for the %%ensName%% or - * ``null`` if unconfigured. - */ - /** - * Waits until the transaction %%hash%% is mined and has %%confirms%% - * confirmations. - */ - waitForTransaction(hash: string, confirms?: number, timeout?: number): Promise; - /** - * Resolves to the block at %%blockTag%% once it has been mined. - * - * This can be useful for waiting some number of blocks by using - * the ``currentBlockNumber + N``. - */ - waitForBlock(blockTag?: BlockTag): Promise; -} -//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/provider.d.ts.map b/lib.esm/providers/provider.d.ts.map deleted file mode 100644 index 5f7427dc0..000000000 --- a/lib.esm/providers/provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK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B,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAClD"} \ No newline at end of file diff --git a/lib.esm/providers/provider.js b/lib.esm/providers/provider.js deleted file mode 100644 index e475de66c..000000000 --- a/lib.esm/providers/provider.js +++ /dev/null @@ -1,948 +0,0 @@ -import { defineProperties, getBigInt, getNumber, hexlify, resolveProperties, assert, assertArgument, isError, makeError, } from "../utils/index.js"; -const BN_0 = BigInt(0); -// ----------------------- -function getValue(value) { - if (value == null) { - return null; - } - return value; -} -function toJson(value) { - if (value == null) { - return null; - } - return value.toString(); -} -// @TODO? implements Required -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -export class FeeData { - /** - * The energy price for legacy networks. - */ - energyPrice; - constructor(energyPrice) { - defineProperties(this, { - energyPrice: getValue(energyPrice), - }); - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { energyPrice } = this; - return { - _type: "FeeData", - energyPrice: toJson(energyPrice), - }; - } -} -export function copyRequest(req) { - const result = {}; - // These could be addresses, ENS names or Addressables - if (req.to) { - result.to = req.to; - } - if (req.from) { - result.from = req.from; - } - if (req.data) { - result.data = hexlify(req.data); - } - const bigIntKeys = "networkId,energyLimit,energyPrice,value".split(/,/); - for (const key of bigIntKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getBigInt(req[key], `request.${key}`); - } - const numberKeys = "type,nonce".split(/,/); - for (const key of numberKeys) { - if (!(key in req) || req[key] == null) { - continue; - } - result[key] = getNumber(req[key], `request.${key}`); - } - if ("blockTag" in req) { - result.blockTag = req.blockTag; - } - if ("enableCcipRead" in req) { - result.enableCcipReadEnabled = !!req.enableCcipRead; - } - if ("customData" in req) { - result.customData = req.customData; - } - return result; -} -/** - * A **Block** represents the data associated with a full block on - * Core. - */ -export class Block { - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - number; - /** - * The block hash. - */ - hash; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - timestamp; - /** - * The block hash of the parent block. - */ - parentHash; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - nonce; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - difficulty; - /** - * The total energy limit for this block. - */ - energyLimit; - /** - * The total energy used in this block. - */ - energyUsed; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - miner; - /** - * Any extra data the validator wished to include. - */ - extraData; - /** - * The base fee per energy that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - baseFeePerEnergy; - #transactions; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block, provider) { - this.#transactions = block.transactions.map((tx) => { - if (typeof tx !== "string") { - return new TransactionResponse(tx, provider); - } - return tx; - }); - defineProperties(this, { - provider, - hash: getValue(block.hash), - number: block.number, - timestamp: block.timestamp, - parentHash: block.parentHash, - nonce: block.nonce, - difficulty: block.difficulty, - energyLimit: block.energyLimit, - energyUsed: block.energyUsed, - miner: block.miner, - extraData: block.extraData, - baseFeePerEnergy: getValue(block.baseFeePerEnergy), - }); - } - /** - * Returns the list of transaction hashes. - */ - get transactions() { - return this.#transactions.map((tx) => { - if (typeof tx === "string") { - return tx; - } - return tx.hash; - }); - } - /** - * Returns the complete transactions for blocks which - * prefetched them, by passing ``true`` to %%prefetchTxs%% - * into [[provider_getBlock]]. - */ - get prefetchedTransactions() { - const txs = this.#transactions.slice(); - // Doesn't matter... - if (txs.length === 0) { - return []; - } - // Make sure we prefetched the transactions - assert(typeof txs[0] === "object", "transactions were not prefetched with block request", "UNSUPPORTED_OPERATION", { - operation: "transactionResponses()", - }); - return txs; - } - /** - * Returns a JSON-friendly value. - */ - toJSON() { - const { baseFeePerEnergy, difficulty, extraData, energyLimit, energyUsed, hash, miner, nonce, number, parentHash, timestamp, transactions, } = this; - return { - _type: "Block", - baseFeePerEnergy: toJson(baseFeePerEnergy), - difficulty: toJson(difficulty), - extraData, - energyLimit: toJson(energyLimit), - energyUsed: toJson(energyUsed), - hash, - miner, - nonce, - number, - parentHash, - timestamp, - transactions, - }; - } - [Symbol.iterator]() { - let index = 0; - const txs = this.transactions; - return { - next: () => { - if (index < this.length) { - return { - value: txs[index++], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The number of transactions in this block. - */ - get length() { - return this.#transactions.length; - } - /** - * The [[link-js-date]] this block was included at. - */ - get date() { - if (this.timestamp == null) { - return null; - } - return new Date(this.timestamp * 1000); - } - /** - * Get the transaction at %%indexe%% within this block. - */ - async getTransaction(indexOrHash) { - // Find the internal value by its index or hash - let tx = undefined; - if (typeof indexOrHash === "number") { - tx = this.#transactions[indexOrHash]; - } - else { - const hash = indexOrHash.toLowerCase(); - for (const v of this.#transactions) { - if (typeof v === "string") { - if (v !== hash) { - continue; - } - tx = v; - break; - } - else { - if (v.hash === hash) { - continue; - } - tx = v; - break; - } - } - } - if (tx == null) { - throw new Error("no such tx"); - } - if (typeof tx === "string") { - return await this.provider.getTransaction(tx); - } - else { - return tx; - } - } - getPrefetchedTransaction(indexOrHash) { - const txs = this.prefetchedTransactions; - if (typeof indexOrHash === "number") { - return txs[indexOrHash]; - } - indexOrHash = indexOrHash.toLowerCase(); - for (const tx of txs) { - if (tx.hash === indexOrHash) { - return tx; - } - } - assertArgument(false, "no matching transaction", "indexOrHash", indexOrHash); - } - /** - * Has this block been mined. - * - * If true, the block has been typed-gaurded that all mined - * properties are non-null. - */ - isMined() { - return !!this.hash; - } - /** - * - */ - isLondon() { - return !!this.baseFeePerEnergy; - } - orphanedEvent() { - if (!this.isMined()) { - throw new Error(""); - } - return createOrphanedBlockFilter(this); - } -} -////////////////////// -// Log -export class Log { - provider; - transactionHash; - blockHash; - blockNumber; - removed; - address; - data; - topics; - index; - transactionIndex; - constructor(log, provider) { - this.provider = provider; - const topics = Object.freeze(log.topics.slice()); - defineProperties(this, { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - removed: log.removed, - address: log.address, - data: log.data, - topics, - index: log.index, - transactionIndex: log.transactionIndex, - }); - } - toJSON() { - const { address, blockHash, blockNumber, data, index, removed, topics, transactionHash, transactionIndex, } = this; - return { - _type: "log", - address, - blockHash, - blockNumber, - data, - index, - removed, - topics, - transactionHash, - transactionIndex, - }; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - assert(!!block, "failed to find transaction", "UNKNOWN_ERROR", {}); - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.transactionHash); - assert(!!tx, "failed to find transaction", "UNKNOWN_ERROR", {}); - return tx; - } - async getTransactionReceipt() { - const receipt = await this.provider.getTransactionReceipt(this.transactionHash); - assert(!!receipt, "failed to find transaction receipt", "UNKNOWN_ERROR", {}); - return receipt; - } - removedEvent() { - return createRemovedLogFilter(this); - } -} -////////////////////// -// Transaction Receipt -/* -export interface LegacyTransactionReceipt { - byzantium: false; - status: null; - root: string; -} - -export interface ByzantiumTransactionReceipt { - byzantium: true; - status: number; - root: null; -} -*/ -export class TransactionReceipt { - provider; - to; - from; - contractAddress; - hash; - index; - blockHash; - blockNumber; - logsBloom; - energyUsed; - cumulativeEnergyUsed; - energyPrice; - type; - //readonly byzantium!: boolean; - status; - root; - #logs; - constructor(tx, provider) { - this.#logs = Object.freeze(tx.logs.map((log) => { - return new Log(log, provider); - })); - defineProperties(this, { - provider, - to: tx.to, - from: tx.from, - contractAddress: tx.contractAddress, - hash: tx.hash, - index: tx.index, - blockHash: tx.blockHash, - blockNumber: tx.blockNumber, - logsBloom: tx.logsBloom, - energyUsed: tx.energyUsed, - cumulativeEnergyUsed: tx.cumulativeEnergyUsed, - energyPrice: (tx.effectiveEnergyPrice || tx.energyPrice), - //byzantium: tx.byzantium, - status: tx.status, - root: tx.root, - }); - } - get logs() { - return this.#logs; - } - toJSON() { - const { to, from, contractAddress, hash, index, blockHash, blockNumber, logsBloom, logs, //byzantium, - status, root, } = this; - return { - _type: "TransactionReceipt", - blockHash, - blockNumber, - //byzantium, - contractAddress, - cumulativeEnergyUsed: toJson(this.cumulativeEnergyUsed), - from, - energyPrice: toJson(this.energyPrice), - energyUsed: toJson(this.energyUsed), - hash, - index, - logs, - logsBloom, - root, - status, - to, - }; - } - get length() { - return this.logs.length; - } - [Symbol.iterator]() { - let index = 0; - return { - next: () => { - if (index < this.length) { - return { value: this.logs[index++], done: false }; - } - return { value: undefined, done: true }; - }, - }; - } - get fee() { - return this.energyUsed * this.energyPrice; - } - async getBlock() { - const block = await this.provider.getBlock(this.blockHash); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - async getTransaction() { - const tx = await this.provider.getTransaction(this.hash); - if (tx == null) { - throw new Error("TODO"); - } - return tx; - } - async getResult() { - return await this.provider.getTransactionResult(this.hash); - } - async confirmations() { - return (await this.provider.getBlockNumber()) - this.blockNumber + 1; - } - removedEvent() { - return createRemovedTransactionFilter(this); - } - reorderedEvent(other) { - assert(!other || other.isMined(), "unmined 'other' transction cannot be orphaned", "UNSUPPORTED_OPERATION", { operation: "reorderedEvent(other)" }); - return createReorderedTransactionFilter(this, other); - } -} -/* -export type ReplacementDetectionSetup = { - to: string; - from: string; - value: bigint; - data: string; - nonce: number; - block: number; -}; -*/ -export class TransactionResponse { - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockNumber; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - blockHash; - /** - * The index within the block that this transaction resides at. - */ - index; - /** - * The transaction hash. - */ - hash; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - type; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - to; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - from; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - nonce; - /** - * The maximum units of energy this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - energyLimit; - /** - * The energy price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective energy price// (the fee per energy that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerEnergy]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of energy the transaction - * consumes. - */ - energyPrice; - /** - * The data. - */ - data; - /** - * The value, in ore. Use [[formatXCB]] to format this value - * as xcb. - */ - value; - /** - * The chain ID. - */ - networkId; - /** - * The signature. - */ - signature; - #startBlock; - /** - * Create a new TransactionResponse with %%tx%% parameters - * connected to %%provider%%. - */ - constructor(tx, provider) { - this.provider = provider; - this.blockNumber = tx.blockNumber != null ? tx.blockNumber : null; - this.blockHash = tx.blockHash != null ? tx.blockHash : null; - this.hash = tx.hash; - this.index = tx.index; - this.from = tx.from; - this.to = tx.to || null; - this.energyLimit = tx.energyLimit; - this.nonce = tx.nonce; - this.data = tx.data; - this.value = tx.value; - this.energyPrice = tx.energyPrice; - this.networkId = tx.networkId; - this.signature = tx.signature; - this.#startBlock = -1; - } - /** - * Returns a JSON representation of this transaction. - */ - toJSON() { - const { index, hash, type, to, from, nonce, data, signature } = this; - return { - _type: "TransactionReceipt", - networkId: toJson(this.networkId), - data, - from, - energyLimit: toJson(this.energyLimit), - energyPrice: toJson(this.energyPrice), - hash, - nonce, - signature, - to, - index, - type, - value: toJson(this.value), - }; - } - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - async getBlock() { - let blockNumber = this.blockNumber; - if (blockNumber == null) { - const tx = await this.getTransaction(); - if (tx) { - blockNumber = tx.blockNumber; - } - } - if (blockNumber == null) { - return null; - } - const block = this.provider.getBlock(blockNumber); - if (block == null) { - throw new Error("TODO"); - } - return block; - } - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - async getTransaction() { - return this.provider.getTransaction(this.hash); - } - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - async wait(_confirms, _timeout) { - const confirms = _confirms == null ? 1 : _confirms; - const timeout = _timeout == null ? 0 : _timeout; - let startBlock = this.#startBlock; - let nextScan = -1; - let stopScanning = startBlock === -1 ? true : false; - const checkReplacement = async () => { - // Get the current transaction count for this sender - if (stopScanning) { - return null; - } - const { blockNumber, nonce } = await resolveProperties({ - blockNumber: this.provider.getBlockNumber(), - nonce: this.provider.getTransactionCount(this.from), - }); - // No transaction or our nonce has not been mined yet; but we - // can start scanning later when we do start - if (nonce < this.nonce) { - startBlock = blockNumber; - return; - } - // We were mined; no replacement - if (stopScanning) { - return null; - } - const mined = await this.getTransaction(); - if (mined && mined.blockNumber != null) { - return; - } - // We were replaced; start scanning for that transaction - // Starting to scan; look back a few extra blocks for safety - if (nextScan === -1) { - nextScan = startBlock - 3; - if (nextScan < this.#startBlock) { - nextScan = this.#startBlock; - } - } - while (nextScan <= blockNumber) { - // Get the next block to scan - if (stopScanning) { - return null; - } - const block = await this.provider.getBlock(nextScan, true); - // This should not happen; but we'll try again shortly - if (block == null) { - return; - } - // We were mined; no replacement - for (const hash of block) { - if (hash === this.hash) { - return; - } - } - // Search for the transaction that replaced us - for (let i = 0; i < block.length; i++) { - const tx = await block.getTransaction(i); - if (tx.from === this.from && tx.nonce === this.nonce) { - // Get the receipt - if (stopScanning) { - return null; - } - const receipt = await this.provider.getTransactionReceipt(tx.hash); - // This should not happen; but we'll try again shortly - if (receipt == null) { - return; - } - // We will retry this on the next block (this case could be optimized) - if (blockNumber - receipt.blockNumber + 1 < confirms) { - return; - } - // The reason we were replaced - let reason = "replaced"; - if (tx.data === this.data && - tx.to === this.to && - tx.value === this.value) { - reason = "repriced"; - } - else if (tx.data === "0x" && - tx.from === tx.to && - tx.value === BN_0) { - reason = "cancelled"; - } - assert(false, "transaction was replaced", "TRANSACTION_REPLACED", { - cancelled: reason === "replaced" || reason === "cancelled", - reason, - replacement: tx.replaceableTransaction(startBlock), - hash: tx.hash, - receipt, - }); - } - } - nextScan++; - } - return; - }; - const receipt = await this.provider.getTransactionReceipt(this.hash); - if (receipt) { - if ((await receipt.confirmations()) >= confirms) { - return receipt; - } - } - else { - // Check for a replacement; throws if a replacement was found - await checkReplacement(); - // Allow null only when the confirms is 0 - if (confirms === 0) { - return null; - } - } - const waiter = new Promise((resolve, reject) => { - // List of things to cancel when we have a result (one way or the other) - const cancellers = []; - const cancel = () => { - cancellers.forEach((c) => c()); - }; - // On cancel, stop scanning for replacements - cancellers.push(() => { - stopScanning = true; - }); - // Set up any timeout requested - if (timeout > 0) { - const timer = setTimeout(() => { - cancel(); - reject(makeError("wait for transaction timeout", "TIMEOUT")); - }, timeout); - cancellers.push(() => { - clearTimeout(timer); - }); - } - const txListener = async (receipt) => { - // Done; return it! - if ((await receipt.confirmations()) >= confirms) { - cancel(); - resolve(receipt); - } - }; - cancellers.push(() => { - this.provider.off(this.hash, txListener); - }); - this.provider.on(this.hash, txListener); - // We support replacement detection; start checking - if (startBlock >= 0) { - const replaceListener = async () => { - try { - // Check for a replacement; this throws only if one is found - await checkReplacement(); - } - catch (error) { - // We were replaced (with enough confirms); re-throw the error - if (isError(error, "TRANSACTION_REPLACED")) { - cancel(); - reject(error); - return; - } - } - // Rescheudle a check on the next block - if (!stopScanning) { - this.provider.once("block", replaceListener); - } - }; - cancellers.push(() => { - this.provider.off("block", replaceListener); - }); - this.provider.once("block", replaceListener); - } - }); - return await waiter; - } - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined() { - return this.blockHash != null; - } - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy() { - return this.type === 0; - } - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent() { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createRemovedTransactionFilter(this); - } - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other) { - assert(this.isMined(), "unmined transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - assert(!other || other.isMined(), "unmined 'other' transaction canot be orphaned", "UNSUPPORTED_OPERATION", { operation: "removeEvent()" }); - return createReorderedTransactionFilter(this, other); - } - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock) { - assertArgument(Number.isInteger(startBlock) && startBlock >= 0, "invalid startBlock", "startBlock", startBlock); - const tx = new TransactionResponse(this, this.provider); - tx.#startBlock = startBlock; - return tx; - } -} -function createOrphanedBlockFilter(block) { - return { orphan: "drop-block", hash: block.hash, number: block.number }; -} -function createReorderedTransactionFilter(tx, other) { - return { orphan: "reorder-transaction", tx, other }; -} -function createRemovedTransactionFilter(tx) { - return { orphan: "drop-transaction", tx }; -} -function createRemovedLogFilter(log) { - return { - orphan: "drop-log", - log: { - transactionHash: log.transactionHash, - blockHash: log.blockHash, - blockNumber: log.blockNumber, - address: log.address, - data: log.data, - topics: Object.freeze(log.topics.slice()), - index: log.index, - }, - }; -} -//# sourceMappingURL=provider.js.map \ No newline at end of file diff --git a/lib.esm/providers/provider.js.map b/lib.esm/providers/provider.js.map deleted file mode 100644 index c4b141597..000000000 --- a/lib.esm/providers/provider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,cAAc,EACd,OAAO,EACP,SAAS,GACT,MAAM,mBAAmB,CAAC;AAS3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAWvB,0BAA0B;AAE1B,SAAS,QAAQ,CAAI,KAA2B;IAC/C,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,SAAS,MAAM,CAAC,KAAoB;IACnC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;AACzB,CAAC;AAED,0DAA0D;AAE1D;;;GAGG;AACH,MAAM,OAAO,OAAO;IACnB;;OAEG;IACM,WAAW,CAAiB;IAErC,YAAY,WAA2B;QACtC,gBAAgB,CAAU,IAAI,EAAE;YAC/B,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC;SAClC,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM;QACL,MAAM,EAAE,WAAW,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AAE,kBAAkB,EAAE,EAAE,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,sBAAsB,CAAC,GAQ/B;IACA,OAAO;QACN,MAAM,EAAE,UAAU;QAClB,GAAG,EAAE;YACJ,eAAe,EAAE,GAAG,CAAC,eAAe;YACpC,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACzC,KAAK,EAAE,GAAG,CAAC,KAAK;SAChB;KACD,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/signer-noncemanager.d.ts b/lib.esm/providers/signer-noncemanager.d.ts deleted file mode 100644 index 31eae80ab..000000000 --- a/lib.esm/providers/signer-noncemanager.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AbstractSigner } from "./abstract-signer.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -export declare class NonceManager extends AbstractSigner { - #private; - signer: Signer; - constructor(signer: Signer); - getAddress(): Promise; - connect(provider: null | Provider): NonceManager; - getNonce(blockTag?: BlockTag): Promise; - increment(): void; - reset(): void; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=signer-noncemanager.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/signer-noncemanager.d.ts.map b/lib.esm/providers/signer-noncemanager.d.ts.map deleted file mode 100644 index ccd407c82..000000000 --- a/lib.esm/providers/signer-noncemanager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer-noncemanager.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,YAAa,SAAQ,cAAc;;IAC/C,MAAM,EAAG,MAAM,CAAC;IAKhB,YAAY,MAAM,EAAE,MAAM,EAMzB;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,YAAY,CAE/C;IAEK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAWnD;IAED,SAAS,IAAI,IAAI,CAEhB;IAED,KAAK,IAAI,IAAI,CAGZ;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAU1E;IAED,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvD;IAED,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzD;IAED,aAAa,CACZ,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/signer-noncemanager.js b/lib.esm/providers/signer-noncemanager.js deleted file mode 100644 index 0d34551c1..000000000 --- a/lib.esm/providers/signer-noncemanager.js +++ /dev/null @@ -1,55 +0,0 @@ -import { defineProperties } from "../utils/index.js"; -import { AbstractSigner } from "./abstract-signer.js"; -export class NonceManager extends AbstractSigner { - signer; - #noncePromise; - #delta; - constructor(signer) { - super(signer.provider); - defineProperties(this, { signer }); - this.#noncePromise = null; - this.#delta = 0; - } - async getAddress() { - return this.signer.getAddress(); - } - connect(provider) { - return new NonceManager(this.signer.connect(provider)); - } - async getNonce(blockTag) { - if (blockTag === "pending") { - if (this.#noncePromise == null) { - this.#noncePromise = super.getNonce("pending"); - } - const delta = this.#delta; - return (await this.#noncePromise) + delta; - } - return super.getNonce(blockTag); - } - increment() { - this.#delta++; - } - reset() { - this.#delta = 0; - this.#noncePromise = null; - } - async sendTransaction(tx) { - const noncePromise = this.getNonce("pending"); - this.increment(); - tx = await this.signer.populateTransaction(tx); - tx.nonce = await noncePromise; - // @TODO: Maybe handle interesting/recoverable errors? - // Like don't increment if the tx was certainly not sent - return await this.signer.sendTransaction(tx); - } - signTransaction(tx) { - return this.signer.signTransaction(tx); - } - signMessage(message) { - return this.signer.signMessage(message); - } - signTypedData(domain, types, value) { - return this.signer.signTypedData(domain, types, value); - } -} -//# sourceMappingURL=signer-noncemanager.js.map \ No newline at end of file diff --git a/lib.esm/providers/signer-noncemanager.js.map b/lib.esm/providers/signer-noncemanager.js.map deleted file mode 100644 index a88f21093..000000000 --- a/lib.esm/providers/signer-noncemanager.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer-noncemanager.js","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAYtD,MAAM,OAAO,YAAa,SAAQ,cAAc;IAC/C,MAAM,CAAU;IAEhB,aAAa,CAAyB;IACtC,MAAM,CAAS;IAEf,YAAY,MAAc;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QAC/C,EAAE,CAAC,KAAK,GAAG,MAAM,YAAY,CAAC;QAE9B,sDAAsD;QACtD,wDAAwD;QACxD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,eAAe,CAAC,EAAsB;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IAED,WAAW,CAAC,OAA4B;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,aAAa,CACZ,MAAuB,EACvB,KAA4C,EAC5C,KAA0B;QAE1B,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/signer.d.ts b/lib.esm/providers/signer.d.ts deleted file mode 100644 index a6383a32f..000000000 --- a/lib.esm/providers/signer.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { Addressable, NameResolver } from "../address/index.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -/** - * A Signer represents an account on the Core Blockchain, and is most often - * backed by a private key represented by a mnemonic or residing on a Hardware Wallet. - * - * The API remains abstract though, so that it can deal with more advanced exotic - * Signing entities, such as Smart Contract Wallets or Virtual Wallets (where the - * private key may not be known). - */ -export interface Signer extends Addressable, ContractRunner, NameResolver { - /** - * The [[Provider]] attached to this Signer (if any). - */ - provider: null | Provider; - /** - * Returns a new instance of this Signer connected to //provider// or detached - * from any Provider if null. - */ - connect(provider: null | Provider): Signer; - /** - * Get the address of the Signer. - */ - getAddress(): Promise; - /** - * Gets the next nonce required for this Signer to send a transaction. - * - * @param blockTag - The blocktag to base the transaction count on, keep in mind - * many nodes do not honour this value and silently ignore it [default: ``"latest"``] - */ - getNonce(blockTag?: BlockTag): Promise; - /** - * Prepares a {@link TransactionRequest} for calling: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - * @param tx - The call to prepare - */ - populateCall(tx: TransactionRequest): Promise>; - /** - * Prepares a {@link TransactionRequest} for sending to the network by - * populating any missing properties: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``energyLimit`` via ``signer.estimateEnergy(tx)`` - * - populates ``networkId`` via ``signer.provider.getNetwork()`` - * - populates ``type`` and relevant fee data for that type (``energyPrice`` - * for legacy transactions, ``maxFeePerEnergy`` for EIP-1559, etc) - * - * @note Some Signer implementations may skip populating properties that - * are populated downstream; for example JsonRpcSigner defers to the - * node to populate the nonce and fee data. - * - * @param tx - The call to prepare - */ - populateTransaction(tx: TransactionRequest): Promise>; - /** - * Estimates the required energy required to execute //tx// on the Blockchain. This - * will be the expected amount a transaction will require as its ``energyLimit`` - * to successfully run all the necessary computations and store the needed state - * that the transaction intends. - * - * Keep in mind that this is **best efforts**, since the state of the Blockchain - * is in flux, which could affect transaction energy requirements. - * - * @throws UNPREDICTABLE_ENERGY_LIMIT A transaction that is believed by the node to likely - * fail will throw an error during energy estimation. This could indicate that it - * will actually fail or that the circumstances are simply too complex for the - * node to take into account. In these cases, a manually determined ``energyLimit`` - * will need to be made. - */ - estimateEnergy(tx: TransactionRequest): Promise; - /** - * Evaluates the //tx// by running it against the current Blockchain state. This - * cannot change state and has no cost in xcb, as it is effectively simulating - * execution. - * - * This can be used to have the Blockchain perform computations based on its state - * (e.g. running a Contract's getters) or to simulate the effect of a transaction - * before actually performing an operation. - */ - call(tx: TransactionRequest): Promise; - /** - * Resolves an ENS Name to an address. - */ - resolveName(name: string): Promise; - /** - * Signs %%tx%%, returning the fully signed transaction. This does not - * populate any additional properties within the transaction. - */ - signTransaction(tx: TransactionRequest): Promise; - /** - * Sends %%tx%% to the Network. The ``signer.populateTransaction(tx)`` - * is called first to ensure all necessary properties for the - * transaction to be valid have been popualted first. - */ - sendTransaction(tx: TransactionRequest): Promise; - /** - * Signers an [[link-eip-191]] prefixed personal message. - * - * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is **not** - * interpretted as a [[BytesLike]]; so the string ``"0x1234"`` is signed as six - * characters, **not** two bytes. - * - * To sign that example as two bytes, the Uint8Array should be used - * (i.e. ``new Uint8Array([ 0x12, 0x34 ])``). - */ - signMessage(message: string | Uint8Array): Promise; - /** - * Signs the [[link-eip-712]] typed data. - */ - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=signer.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/signer.d.ts.map b/lib.esm/providers/signer.d.ts.map deleted file mode 100644 index d5935e8bb..000000000 --- a/lib.esm/providers/signer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,WAAW,EAAE,cAAc,EAAE,YAAY;IACxE;;OAEG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ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git a/lib.esm/providers/signer.js b/lib.esm/providers/signer.js deleted file mode 100644 index 7c8f9901a..000000000 --- a/lib.esm/providers/signer.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=signer.js.map \ No newline at end of file diff --git a/lib.esm/providers/signer.js.map b/lib.esm/providers/signer.js.map deleted file mode 100644 index 68d48a837..000000000 --- a/lib.esm/providers/signer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-connection.d.ts b/lib.esm/providers/subscriber-connection.d.ts deleted file mode 100644 index b235e3b46..000000000 --- a/lib.esm/providers/subscriber-connection.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Subscriber } from "./abstract-provider.js"; -import type { Provider } from "./provider.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export interface ConnectionRpcProvider extends Provider { - _subscribe(param: Array, processFunc: (result: any) => void): number; - _unsubscribe(filterId: number): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class BlockConnectionSubscriber implements Subscriber { - #private; - constructor(provider: ConnectionRpcProvider); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-connection.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/subscriber-connection.d.ts.map b/lib.esm/providers/subscriber-connection.d.ts.map deleted file mode 100644 index baef99405..000000000 --- a/lib.esm/providers/subscriber-connection.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAEtD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;IAQ3D,YAAY,QAAQ,EAAE,qBAAqB,EAK1C;IAED,KAAK,IAAI,IAAI,CAeZ;IAED,IAAI,IAAI,IAAI,CAUX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-connection.js b/lib.esm/providers/subscriber-connection.js deleted file mode 100644 index e56ac1eec..000000000 --- a/lib.esm/providers/subscriber-connection.js +++ /dev/null @@ -1,52 +0,0 @@ -import { getNumber } from "../utils/index.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export class BlockConnectionSubscriber { - #provider; - #blockNumber; - #running; - #filterId; - constructor(provider) { - this.#provider = provider; - this.#blockNumber = -2; - this.#running = false; - this.#filterId = null; - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#filterId = this.#provider._subscribe(["newHeads"], (result) => { - const blockNumber = getNumber(result.number); - const initial = this.#blockNumber === -2 ? blockNumber : this.#blockNumber + 1; - for (let b = initial; b <= blockNumber; b++) { - this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - }); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - if (this.#filterId != null) { - this.#provider._unsubscribe(this.#filterId); - this.#filterId = null; - } - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#blockNumber = -2; - } - this.stop(); - } - resume() { - this.start(); - } -} -//# sourceMappingURL=subscriber-connection.js.map \ No newline at end of file diff --git a/lib.esm/providers/subscriber-connection.js.map b/lib.esm/providers/subscriber-connection.js.map deleted file mode 100644 index 111ace64a..000000000 --- a/lib.esm/providers/subscriber-connection.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-connection.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkB9C;;;;GAIG;AACH,MAAM,OAAO,yBAAyB;IACrC,SAAS,CAAwB;IACjC,YAAY,CAAS;IAErB,QAAQ,CAAU;IAElB,SAAS,CAAgB;IAEzB,YAAY,QAA+B;QAC1C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,KAAK;QACJ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,OAAO;QACR,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAErB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,MAAW,EAAE,EAAE;YACxE,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,OAAO,GACZ,IAAI,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;YAChE,KAAK,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,IAAI,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YACjC,CAAC;YACD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QACjC,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,IAAI;QACH,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpB,OAAO;QACR,CAAC;QACD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YAC5B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACvB,CAAC;IACF,CAAC;IAED,KAAK,CAAC,eAAyB;QAC9B,IAAI,eAAe,EAAE,CAAC;YACrB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACxB,CAAC;QACD,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAED,MAAM;QACL,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-filterid.d.ts b/lib.esm/providers/subscriber-filterid.d.ts deleted file mode 100644 index 3e58a6871..000000000 --- a/lib.esm/providers/subscriber-filterid.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdSubscriber implements Subscriber { - #private; - constructor(provider: JsonRpcApiProvider); - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: AbstractProvider, result: Array): Promise; - _recover(provider: AbstractProvider): Subscriber; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdEventSubscriber extends FilterIdSubscriber { - #private; - constructor(provider: JsonRpcApiProvider, filter: EventFilter); - _recover(provider: AbstractProvider): Subscriber; - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdPendingSubscriber extends FilterIdSubscriber { - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -//# sourceMappingURL=subscriber-filterid.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/subscriber-filterid.d.ts.map b/lib.esm/providers/subscriber-filterid.d.ts.map deleted file mode 100644 index 957e1320c..000000000 --- a/lib.esm/providers/subscriber-filterid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE;;;;;;;;;GASG;AACH,qBAAa,kBAAmB,YAAW,UAAU;;IAYpD,YAAY,QAAQ,EAAE,kBAAkB,EAWvC;IAED,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAExD;IAED,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E;IAED,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAE/C;IAgED,KAAK,IAAI,IAAI,CAOZ;IAED,IAAI,IAAI,IAAI,CASX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;;IAG9D,YAAY,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAG5D;IAED,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,GAAG,UAAU,CAE/C;IAEK,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAG9D;IAEK,YAAY,CACjB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;CACD;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,kBAAkB;IAC1D,UAAU,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D;IAEK,YAAY,CACjB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-filterid.js b/lib.esm/providers/subscriber-filterid.js deleted file mode 100644 index c8a64534d..000000000 --- a/lib.esm/providers/subscriber-filterid.js +++ /dev/null @@ -1,158 +0,0 @@ -import { isError } from "../utils/index.js"; -import { PollingEventSubscriber } from "./subscriber-polling.js"; -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -export class FilterIdSubscriber { - #provider; - #filterIdPromise; - #poller; - #running; - #network; - #hault; - constructor(provider) { - this.#provider = provider; - this.#filterIdPromise = null; - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#network = null; - this.#hault = false; - } - _subscribe(provider) { - throw new Error("subclasses must override this"); - } - _emitResults(provider, result) { - throw new Error("subclasses must override this"); - } - _recover(provider) { - throw new Error("subclasses must override this"); - } - async #poll(blockNumber) { - try { - // Subscribe if necessary - if (this.#filterIdPromise == null) { - this.#filterIdPromise = this._subscribe(this.#provider); - } - // Get the Filter ID - let filterId = null; - try { - filterId = await this.#filterIdPromise; - } - catch (error) { - if (!isError(error, "UNSUPPORTED_OPERATION") || - error.operation !== "xcb_newFilter") { - throw error; - } - } - // The backend does not support Filter ID; downgrade to - // polling - if (filterId == null) { - this.#filterIdPromise = null; - this.#provider._recoverSubscriber(this, this._recover(this.#provider)); - return; - } - const network = await this.#provider.getNetwork(); - if (!this.#network) { - this.#network = network; - } - if (this.#network.networkId !== network.networkId) { - throw new Error("chaid changed"); - } - if (this.#hault) { - return; - } - const result = await this.#provider.send("xcb_getFilterChanges", [ - filterId, - ]); - await this._emitResults(this.#provider, result); - } - catch (error) { - console.log("@TODO", error); - } - this.#provider.once("block", this.#poller); - } - #teardown() { - const filterIdPromise = this.#filterIdPromise; - if (filterIdPromise) { - this.#filterIdPromise = null; - filterIdPromise.then((filterId) => { - this.#provider.send("xcb_uninstallFilter", [filterId]); - }); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#hault = true; - this.#teardown(); - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - if (dropWhilePaused) { - this.#teardown(); - } - this.#provider.off("block", this.#poller); - } - resume() { - this.start(); - } -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -export class FilterIdEventSubscriber extends FilterIdSubscriber { - #event; - constructor(provider, filter) { - super(provider); - this.#event = copy(filter); - } - _recover(provider) { - return new PollingEventSubscriber(provider, this.#event); - } - async _subscribe(provider) { - const filterId = await provider.send("xcb_newFilter", [this.#event]); - return filterId; - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit(this.#event, provider._wrapLog(result, provider._network)); - } - } -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -export class FilterIdPendingSubscriber extends FilterIdSubscriber { - async _subscribe(provider) { - return await provider.send("xcb_newPendingTransactionFilter", []); - } - async _emitResults(provider, results) { - for (const result of results) { - provider.emit("pending", result); - } - } -} -//# sourceMappingURL=subscriber-filterid.js.map \ No newline at end of file diff --git a/lib.esm/providers/subscriber-filterid.js.map b/lib.esm/providers/subscriber-filterid.js.map deleted file mode 100644 index e1ccb0808..000000000 --- a/lib.esm/providers/subscriber-filterid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-filterid.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAOjE,SAAS,IAAI,CAAC,GAAQ;IACrB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,kBAAkB;IAC9B,SAAS,CAAqB;IAE9B,gBAAgB,CAAyB;IACzC,OAAO,CAA+B;IAEtC,QAAQ,CAAU;IAElB,QAAQ,CAAiB;IAEzB,MAAM,CAAU;IAEhB,YAAY,QAA4B;QACvC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QAEtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;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EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC1E,CAAC;IACF,CAAC;CACD;AAED;;;;GAIG;AACH,MAAM,OAAO,yBAA0B,SAAQ,kBAAkB;IAChE,KAAK,CAAC,UAAU,CAAC,QAA4B;QAC5C,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,iCAAiC,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,YAAY,CACjB,QAA4B,EAC5B,OAAmB;QAEnB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC9B,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAClC,CAAC;IACF,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-polling.d.ts b/lib.esm/providers/subscriber-polling.d.ts deleted file mode 100644 index fcf4a8070..000000000 --- a/lib.esm/providers/subscriber-polling.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter, OrphanFilter, ProviderEvent } from "./provider.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare function getPollingSubscriber(provider: AbstractProvider, event: ProviderEvent): Subscriber; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingBlockSubscriber implements Subscriber { - #private; - constructor(provider: AbstractProvider); - get pollingInterval(): number; - set pollingInterval(value: number); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class OnBlockSubscriber implements Subscriber { - #private; - constructor(provider: AbstractProvider); - _poll(blockNumber: number, provider: AbstractProvider): Promise; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingOrphanSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, filter: OrphanFilter); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingTransactionSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, hash: string); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingEventSubscriber implements Subscriber { - #private; - constructor(provider: AbstractProvider, filter: EventFilter); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-polling.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/subscriber-polling.d.ts.map b/lib.esm/providers/subscriber-polling.d.ts.map deleted file mode 100644 index 9fd6aa7aa..000000000 --- a/lib.esm/providers/subscriber-polling.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-polling.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9E;;;;GAIG;AACH,wBAAgB,oBAAoB,CACnC,QAAQ,EAAE,gBAAgB,EAC1B,KAAK,EAAE,aAAa,GAClB,UAAU,CAYZ;AAID;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAUxD,YAAY,QAAQ,EAAE,gBAAgB,EAMrC;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IACD,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAEhC;IA2CD,KAAK,IAAI,IAAI,CASZ;IAED,IAAI,IAAI,IAAI,CAMX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,UAAU;;IAKnD,YAAY,QAAQ,EAAE,gBAAgB,EAMrC;IAEK,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1E;IAED,KAAK,IAAI,IAAI,CAQZ;IAED,IAAI,IAAI,IAAI,CAOX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAErC;IACD,MAAM,IAAI,IAAI,CAEb;CACD;AAED;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,iBAAiB;;IAG7D,YAAY,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAG3D;IAEK,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1E;CACD;AAED;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,iBAAiB;;IAGlE,YAAY,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAGnD;IAEK,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1E;CACD;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAWxD,YAAY,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAM1D;IA6BD,KAAK,IAAI,IAAI,CAYZ;IAED,IAAI,IAAI,IAAI,CAOX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/subscriber-polling.js b/lib.esm/providers/subscriber-polling.js deleted file mode 100644 index bf6e01161..000000000 --- a/lib.esm/providers/subscriber-polling.js +++ /dev/null @@ -1,248 +0,0 @@ -import { assert, isHexString } from "../utils/index.js"; -function copy(obj) { - return JSON.parse(JSON.stringify(obj)); -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export function getPollingSubscriber(provider, event) { - if (event === "block") { - return new PollingBlockSubscriber(provider); - } - if (isHexString(event, 32)) { - return new PollingTransactionSubscriber(provider, event); - } - assert(false, "unsupported polling event", "UNSUPPORTED_OPERATION", { - operation: "getPollingSubscriber", - info: { event }, - }); -} -// @TODO: refactor this -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingBlockSubscriber { - #provider; - #poller; - #interval; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider) { - this.#provider = provider; - this.#poller = null; - this.#interval = 4000; - this.#blockNumber = -2; - } - get pollingInterval() { - return this.#interval; - } - set pollingInterval(value) { - this.#interval = value; - } - async #poll() { - try { - const blockNumber = await this.#provider.getBlockNumber(); - // Bootstrap poll to setup our initial block number - if (this.#blockNumber === -2) { - this.#blockNumber = blockNumber; - return; - } - // @TODO: Put a cap on the maximum number of events per loop? - if (blockNumber !== this.#blockNumber) { - for (let b = this.#blockNumber + 1; b <= blockNumber; b++) { - // We have been stopped - if (this.#poller == null) { - return; - } - await this.#provider.emit("block", b); - } - this.#blockNumber = blockNumber; - } - } - catch (error) { - // @TODO: Minor bump, add an "error" event to let subscribers - // know things went awry. - //console.log(error); - } - // We have been stopped - if (this.#poller == null) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - } - start() { - if (this.#poller) { - return; - } - this.#poller = this.#provider._setTimeout(this.#poll.bind(this), this.#interval); - this.#poll(); - } - stop() { - if (!this.#poller) { - return; - } - this.#provider._clearTimeout(this.#poller); - this.#poller = null; - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export class OnBlockSubscriber { - #provider; - #poll; - #running; - constructor(provider) { - this.#provider = provider; - this.#running = false; - this.#poll = (blockNumber) => { - this._poll(blockNumber, this.#provider); - }; - } - async _poll(blockNumber, provider) { - throw new Error("sub-classes must override this"); - } - start() { - if (this.#running) { - return; - } - this.#running = true; - this.#poll(-2); - this.#provider.on("block", this.#poll); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poll); - } - pause(dropWhilePaused) { - this.stop(); - } - resume() { - this.start(); - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingOrphanSubscriber extends OnBlockSubscriber { - #filter; - constructor(provider, filter) { - super(provider); - this.#filter = copy(filter); - } - async _poll(blockNumber, provider) { - throw new Error("@TODO"); - console.log(this.#filter); - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingTransactionSubscriber extends OnBlockSubscriber { - #hash; - constructor(provider, hash) { - super(provider); - this.#hash = hash; - } - async _poll(blockNumber, provider) { - const tx = await provider.getTransactionReceipt(this.#hash); - if (tx) { - provider.emit(this.#hash, tx); - } - } -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export class PollingEventSubscriber { - #provider; - #filter; - #poller; - #running; - // The most recent block we have scanned for events. The value -2 - // indicates we still need to fetch an initial block number - #blockNumber; - constructor(provider, filter) { - this.#provider = provider; - this.#filter = copy(filter); - this.#poller = this.#poll.bind(this); - this.#running = false; - this.#blockNumber = -2; - } - async #poll(blockNumber) { - // The initial block hasn't been determined yet - if (this.#blockNumber === -2) { - return; - } - const filter = copy(this.#filter); - filter.fromBlock = this.#blockNumber + 1; - filter.toBlock = blockNumber; - const logs = await this.#provider.getLogs(filter); - // No logs could just mean the node has not indexed them yet, - // so we keep a sliding window of 60 blocks to keep scanning - if (logs.length === 0) { - if (this.#blockNumber < blockNumber - 60) { - this.#blockNumber = blockNumber - 60; - } - return; - } - this.#blockNumber = blockNumber; - for (const log of logs) { - this.#provider.emit(this.#filter, log); - } - } - start() { - if (this.#running) { - return; - } - this.#running = true; - if (this.#blockNumber === -2) { - this.#provider.getBlockNumber().then((blockNumber) => { - this.#blockNumber = blockNumber; - }); - } - this.#provider.on("block", this.#poller); - } - stop() { - if (!this.#running) { - return; - } - this.#running = false; - this.#provider.off("block", this.#poller); - } - pause(dropWhilePaused) { - this.stop(); - if (dropWhilePaused) { - this.#blockNumber = -2; - } - } - resume() { - this.start(); - } -} -//# sourceMappingURL=subscriber-polling.js.map \ No newline at end of file diff --git a/lib.esm/providers/subscriber-polling.js.map b/lib.esm/providers/subscriber-polling.js.map deleted file mode 100644 index 8ac8f299a..000000000 --- a/lib.esm/providers/subscriber-polling.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-polling.js","sourceRoot":"","sources":["../../src.ts/providers/subscriber-polling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKxD,SAAS,IAAI,CAAC,GAAQ;IACrB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CACnC,QAA0B,EAC1B,KAAoB;IAEpB,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;QACvB,OAAO,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,4BAA4B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,CAAC,KAAK,EAAE,2BAA2B,EAAE,uBAAuB,EAAE;QACnE,SAAS,EAAE,sBAAsB;QACjC,IAAI,EAAE,EAAE,KAAK,EAAE;KACf,CAAC,CAAC;AACJ,CAAC;AAED,uBAAuB;AAEvB;;;;GAIG;AACH,MAAM,OAAO,sBAAsB;IAClC,SAAS,CAAmB;IAC5B,OAAO,CAAgB;IAEvB,SAAS,CAAS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,IAAI,eAAe,EAAE,CAAC;YACrB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;QACxB,CAAC;IACF,CAAC;IAED,MAAM;QACL,IAAI,CAAC,KAAK,EAAE,CAAC;IACd,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/providers/ws-browser.d.ts b/lib.esm/providers/ws-browser.d.ts deleted file mode 100644 index d92720422..000000000 --- a/lib.esm/providers/ws-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _WebSocket: any; -export { _WebSocket as WebSocket }; -//# sourceMappingURL=ws-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/ws-browser.d.ts.map b/lib.esm/providers/ws-browser.d.ts.map deleted file mode 100644 index 63da59ec3..000000000 --- a/lib.esm/providers/ws-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":"AAaA,QAAA,MAAM,UAAU,KAAwB,CAAC;AAEzC,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/ws-browser.js b/lib.esm/providers/ws-browser.js deleted file mode 100644 index b5cca5638..000000000 --- a/lib.esm/providers/ws-browser.js +++ /dev/null @@ -1,15 +0,0 @@ -function getGlobal() { - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw new Error("unable to locate global object"); -} -const _WebSocket = getGlobal().WebSocket; -export { _WebSocket as WebSocket }; -//# sourceMappingURL=ws-browser.js.map \ No newline at end of file diff --git a/lib.esm/providers/ws-browser.js.map b/lib.esm/providers/ws-browser.js.map deleted file mode 100644 index 335e644e4..000000000 --- a/lib.esm/providers/ws-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws-browser.js","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":"AAAA,SAAS,SAAS;IACjB,IAAI,OAAO,IAAI,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QACnC,OAAO,MAAM,CAAC;IACf,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,GAAG,SAAS,EAAE,CAAC,SAAS,CAAC;AAEzC,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/ws.d.ts b/lib.esm/providers/ws.d.ts deleted file mode 100644 index 75d53b7d4..000000000 --- a/lib.esm/providers/ws.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { WebSocket } from "ws"; -//# sourceMappingURL=ws.d.ts.map \ No newline at end of file diff --git a/lib.esm/providers/ws.d.ts.map b/lib.esm/providers/ws.d.ts.map deleted file mode 100644 index c424f8d82..000000000 --- a/lib.esm/providers/ws.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC"} \ No newline at end of file diff --git a/lib.esm/providers/ws.js b/lib.esm/providers/ws.js deleted file mode 100644 index 3fcc8f78b..000000000 --- a/lib.esm/providers/ws.js +++ /dev/null @@ -1,2 +0,0 @@ -export { WebSocket } from "ws"; -//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/lib.esm/providers/ws.js.map b/lib.esm/providers/ws.js.map deleted file mode 100644 index 717e091c5..000000000 --- a/lib.esm/providers/ws.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../src.ts/providers/ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC"} \ No newline at end of file diff --git a/lib.esm/transaction/accesslist.d.ts b/lib.esm/transaction/accesslist.d.ts deleted file mode 100644 index aac12cccf..000000000 --- a/lib.esm/transaction/accesslist.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AccessList, AccessListish } from "./index.js"; -/** - * Returns a [[AccessList]] from any corebcsupported access-list structure. - */ -export declare function accessListify(value: AccessListish): AccessList; -//# sourceMappingURL=accesslist.d.ts.map \ No newline at end of file diff --git a/lib.esm/transaction/accesslist.d.ts.map b/lib.esm/transaction/accesslist.d.ts.map deleted file mode 100644 index 4bd8ae700..000000000 --- a/lib.esm/transaction/accesslist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accesslist.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAoB5D;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CA+C9D"} \ No newline at end of file diff --git a/lib.esm/transaction/accesslist.js b/lib.esm/transaction/accesslist.js deleted file mode 100644 index c80bab54c..000000000 --- a/lib.esm/transaction/accesslist.js +++ /dev/null @@ -1,37 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { assertArgument, isHexString } from "../utils/index.js"; -function accessSetify(addr, storageKeys) { - return { - address: getAddress(addr), - storageKeys: storageKeys.map((storageKey, index) => { - assertArgument(isHexString(storageKey, 32), "invalid slot", `storageKeys[${index}]`, storageKey); - return storageKey.toLowerCase(); - }), - }; -} -/** - * Returns a [[AccessList]] from any corebcsupported access-list structure. - */ -export function accessListify(value) { - if (Array.isArray(value)) { - return value.map((set, index) => { - if (Array.isArray(set)) { - assertArgument(set.length === 2, "invalid slot set", `value[${index}]`, set); - return accessSetify(set[0], set[1]); - } - assertArgument(set != null && typeof set === "object", "invalid address-slot set", "value", value); - return accessSetify(set.address, set.storageKeys); - }); - } - assertArgument(value != null && typeof value === "object", "invalid access list", "value", value); - const result = Object.keys(value).map((addr) => { - const storageKeys = value[addr].reduce((accum, storageKey) => { - accum[storageKey] = true; - return accum; - }, {}); - return accessSetify(addr, Object.keys(storageKeys).sort()); - }); - result.sort((a, b) => a.address.localeCompare(b.address)); - return result; -} -//# sourceMappingURL=accesslist.js.map \ No newline at end of file diff --git a/lib.esm/transaction/accesslist.js.map b/lib.esm/transaction/accesslist.js.map deleted file mode 100644 index 5317671a9..000000000 --- a/lib.esm/transaction/accesslist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accesslist.js","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhE,SAAS,YAAY,CACpB,IAAY,EACZ,WAA0B;IAE1B,OAAO;QACN,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC;QACzB,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;YAClD,cAAc,CACb,WAAW,CAAC,UAAU,EAAE,EAAE,CAAC,EAC3B,cAAc,EACd,eAAe,KAAK,GAAG,EACvB,UAAU,CACV,CAAC;YACF,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC;QACjC,CAAC,CAAC;KACF,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAoB;IACjD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAKC,KAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YAC1B,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBACxB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file mode 100644 index 5abba54e2..000000000 --- a/lib.esm/transaction/address.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -export declare function removeHexPrefix(val: string): string; -export declare function publicToAddress(key: BytesLike | string, prefix: string): string; -export declare function computeAddress(key: string | SigningKey, prefix: string): string; -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -export declare function recoverAddress(digest: BytesLike, signature: SignatureLike, prefix: string): string; -export declare function extractPrefix(address: string): string; -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/lib.esm/transaction/address.d.ts.map b/lib.esm/transaction/address.d.ts.map deleted file mode 100644 index 48e65cc8e..000000000 --- a/lib.esm/transaction/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAC9B,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AAED,wBAAgB,cAAc,CAC7B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"} \ No newline at end of file diff --git a/lib.esm/transaction/address.js b/lib.esm/transaction/address.js deleted file mode 100644 index e8d851762..000000000 --- a/lib.esm/transaction/address.js +++ /dev/null @@ -1,41 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { sha256, SigningKey } from "../crypto/index.js"; -import { arrayify, hexDataSlice } from "../utils/data.js"; -import { calculateCheckSum } from "../address/index.js"; -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -export function removeHexPrefix(val) { - return val.substring(0, 2) === "0x" ? val.substring(2) : val; -} -export function publicToAddress(key, prefix) { - const val = hexDataSlice(sha256(key), 12); - const checksum = calculateCheckSum(val, prefix); - return "0x" + prefix + checksum + removeHexPrefix(val); -} -export function computeAddress(key, prefix) { - let pubkey; - if (typeof key === "string") { - pubkey = SigningKey.computePublicKey(key, false); - } - else { - pubkey = key.publicKey; - } - return publicToAddress(pubkey, prefix); // getAddress(sha256("0x" + pubkey.substring(4)).substring(26)); -} -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -export function recoverAddress(digest, signature, prefix) { - // return computeAddress(SigningKey.recoverPublicKey(digest, signature)); - const publicKey = SigningKey.recoverPublicKey(arrayify(digest), signature); - return publicToAddress(publicKey, prefix); -} -export function extractPrefix(address) { - address = getAddress(address); - return address.substring(2, 4); -} -//# sourceMappingURL=address.js.map \ No newline at end of file diff --git a/lib.esm/transaction/address.js.map b/lib.esm/transaction/address.js.map deleted file mode 100644 index 6f4c15e0c..000000000 --- a/lib.esm/transaction/address.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIxD,O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C3C,CAAC;AACD,MAAM,UAAU,aAAa,CAAC,OAAe;IAC5C,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAChC,CAAC"} \ No newline at end of file diff --git a/lib.esm/transaction/index.d.ts b/lib.esm/transaction/index.d.ts deleted file mode 100644 index 01bca63fa..000000000 --- a/lib.esm/transaction/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Transactions.. - * - * @_section api/transaction:Transactions [about-transactions] - */ -/** - * A single [[AccessList]] entry of storage keys (slots) for an address. - */ -export type AccessListEntry = { - address: string; - storageKeys: Array; -}; -/** - * An ordered collection of [[AccessList]] entries. - */ -export type AccessList = Array; -/** - * Any corebc-supported access list structure. - */ -export type AccessListish = AccessList | Array<[string, Array]> | Record>; -export { accessListify } from "./accesslist.js"; -export { computeAddress, recoverAddress } from "./address.js"; -export { Transaction } from "./transaction.js"; -export type { TransactionLike } from "./transaction.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/transaction/index.d.ts.map b/lib.esm/transaction/index.d.ts.map deleted file mode 100644 index 4c5a4305f..000000000 --- a/lib.esm/transaction/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GACxB,UAAU,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/lib.esm/transaction/index.js b/lib.esm/transaction/index.js deleted file mode 100644 index 31c86a1e7..000000000 --- a/lib.esm/transaction/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Transactions.. - * - * @_section api/transaction:Transactions [about-transactions] - */ -null; -export { accessListify } from "./accesslist.js"; -export { computeAddress, recoverAddress } from "./address.js"; -export { Transaction } from "./transaction.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/transaction/index.js.map b/lib.esm/transaction/index.js.map deleted file mode 100644 index 99d060ed7..000000000 --- a/lib.esm/transaction/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,IAAI,CAAC;AAkBL,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/lib.esm/transaction/transaction.d.ts b/lib.esm/transaction/transaction.d.ts deleted file mode 100644 index 83340f6b5..000000000 --- a/lib.esm/transaction/transaction.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { Signature } from "../crypto/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -export interface TransactionLike { - /** - * The recipient address or ``null`` for an ``init`` transaction. - */ - to?: null | A; - /** - * The sender. - */ - from?: null | A; - /** - * The nonce. - */ - nonce?: null | number; - /** - * The maximum amount of energy that can be used. - */ - energyLimit?: null | BigNumberish; - /** - * The energy price for legacy and berlin transactions. - */ - energyPrice?: null | BigNumberish; - /** - * The data. - */ - data?: null | string; - /** - * The value (in ore) to send. - */ - value?: null | BigNumberish; - /** - * The chain ID the transaction is valid on. - */ - networkId?: null | BigNumberish; - /** - * The transaction hash. - */ - hash?: null | string; - /** - * The signature provided by the sender. - */ - signature?: null | SignatureLike; -} -/** - * A **Transaction** describes an operation to be executed on - * Core by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in corebc) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -export declare class Transaction implements TransactionLike { - #private; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to(): null | string; - set to(value: null | string); - /** - * The transaction nonce. - */ - get nonce(): number; - set nonce(value: BigNumberish); - /** - * The energy limit. - */ - get energyLimit(): bigint; - set energyLimit(value: BigNumberish); - /** - * The energy price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get energyPrice(): null | bigint; - set energyPrice(value: null | BigNumberish); - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data(): string; - set data(value: BytesLike); - /** - * The amount of xcb (in ore) to send in this transactions. - */ - get value(): bigint; - set value(value: BigNumberish); - /** - * The chain ID this transaction is valid on. - */ - get networkId(): bigint; - set networkId(value: BigNumberish); - /** - * If signed, the signature for this transaction. - */ - get signature(): null | string; - set signature(value: null | SignatureLike); - /** - * Creates a new Transaction with default values. - */ - constructor(); - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash(): null | string; - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash(): string; - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from(): null | string; - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey(): null | string; - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned(): this is Transaction & { - type: number; - typeName: string; - from: string; - signature: Signature; - }; - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized(): string; - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized(): string; - /** - * Create a copy of this transaciton. - */ - clone(): Transaction; - /** - * Return a JSON-friendly object. - */ - toJSON(): any; - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx?: string | TransactionLike): Transaction; -} -//# sourceMappingURL=transaction.d.ts.map \ No newline at end of file diff --git a/lib.esm/transaction/transaction.d.ts.map b/lib.esm/transaction/transaction.d.ts.map deleted file mode 100644 index e3c637686..000000000 --- a/lib.esm/transaction/transaction.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM;IAC1C;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE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AI,GAAG,aAAa,EAExC;IAED;;OAEG;IACH,cASC;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,CAKxB;IAED;;;;;OAKG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,CAMxB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,IAAI,GAAG,MAAM,CAKjC;IAED;;;;;OAKG;IACH,QAAQ,IAAI,IAAI,IAAI,WAAW,GAAG;QACjC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,SAAS,CAAC;KACrB,CAGA;IAED;;;;;OAKG;IACH,IAAI,UAAU,IAAI,MAAM,CAQvB;IAED;;;;;OAKG;IACH,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,KAAK,IAAI,WAAW,CAEnB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CAkBZ;IAED;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW,CA4D9D;CACD"} \ No newline at end of file diff --git a/lib.esm/transaction/transaction.js b/lib.esm/transaction/transaction.js deleted file mode 100644 index dcdd2acdb..000000000 --- a/lib.esm/transaction/transaction.js +++ /dev/null @@ -1,365 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { sha256, SigningKey } from "../crypto/index.js"; -import { getBytes, getBigInt, getNumber, hexlify, assert, assertArgument, } from "../utils/index.js"; -import { recoverAddress } from "./address.js"; -import { checkProperties } from "../utils/properties.js"; -import { arrayify, stripZeros } from "../utils/data.js"; -import { Logger } from "../logger/logger.js"; -import * as RLP from "../crypto/rlp.js"; -import { BigNumber } from "../bigNumber/bigNumber.js"; -import { networkIdToPrefix } from "../address/index.js"; -const logger = new Logger("transaction/0.0.1"); -const BN_0 = BigInt(0); -function handleAddress(value) { - if (value === "0x") { - return null; - } - return getAddress(value); -} -function parse(data) { - const handleNumber = (value) => { - // @ts-ignore - if (value === "0x") { - return BigNumber.from(0); - } - return BigNumber.from(value); - }; - const transaction = RLP.decode(data); - if (transaction.length !== 7 && transaction.length !== 8) { - logger.throwArgumentError("invalid raw transaction", "data", data); - } - const isSigned = transaction.length === 8; - const tx = { - nonce: Number(handleNumber(transaction[0])), - energyPrice: handleNumber(transaction[1]).toBigInt(), - energyLimit: handleNumber(transaction[2]).toBigInt(), - networkId: handleNumber(transaction[isSigned ? 3 : 6]).toBigInt(), - to: handleAddress(transaction[isSigned ? 4 : 3]), - value: handleNumber(transaction[isSigned ? 5 : 4]).toBigInt(), - data: transaction[isSigned ? 6 : 5], - }; - if (transaction.length === 8) { - const prefix = networkIdToPrefix(Number(tx.networkId)); - const digest = sha256(serialize(tx)); - tx.hash = sha256(serialize(tx, transaction[7])); - tx.from = recoverAddress(digest, transaction[7], prefix); - tx.signature = transaction[7]; - } - return tx; -} -const unsignedTransactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, - { name: "networkId", maxLength: 32, numeric: true }, -]; -const transactionFields = [ - { name: "nonce", maxLength: 32, numeric: true }, - { name: "energyPrice", maxLength: 32, numeric: true }, - { name: "energyLimit", maxLength: 32, numeric: true }, - { name: "networkId", maxLength: 32, numeric: true }, - { name: "to", length: 22 }, - { name: "value", maxLength: 32, numeric: true }, - { name: "data" }, -]; -const allowedTransactionKeys = { - networkId: true, - data: true, - energyLimit: true, - energyPrice: true, - nonce: true, - to: true, - value: true, -}; -function serialize(transaction, signature) { - checkProperties(transaction, allowedTransactionKeys); - const raw = []; - (!!signature ? transactionFields : unsignedTransactionFields).forEach(function ({ numeric, maxLength, name, length }) { - let value = transaction[name] || []; - const options = {}; - if (numeric) { - options.hexPad = "left"; - } - const tmpHexlified = hexlify(value, options); - value = arrayify(tmpHexlified); - // Fixed-width field - if (length && value.length !== length && value.length > 0) { - logger.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - // Variable-width (with a maximum) - if (maxLength) { - value = stripZeros(value); - if (value.length > maxLength) { - logger.throwArgumentError("invalid length for " + name, "transaction:" + name, value); - } - } - const hexlified = hexlify(value); - raw.push(hexlified); - }); - if (!!signature) { - raw.push(hexlify(signature)); - } - const finalValue = RLP.encode(raw); - return finalValue; -} -/** - * A **Transaction** describes an operation to be executed on - * Core by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in corebc) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -export class Transaction { - #to; - #data; - #nonce; - #energyLimit; - #energyPrice; - #value; - #networkId; - #sig; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to() { - return this.#to; - } - set to(value) { - this.#to = value == null ? null : getAddress(value); - } - /** - * The transaction nonce. - */ - get nonce() { - return this.#nonce; - } - set nonce(value) { - this.#nonce = getNumber(value, "value"); - } - /** - * The energy limit. - */ - get energyLimit() { - return this.#energyLimit; - } - set energyLimit(value) { - this.#energyLimit = getBigInt(value); - } - /** - * The energy price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get energyPrice() { - const value = this.#energyPrice; - if (value == null) { - return BN_0; - } - return value; - } - set energyPrice(value) { - this.#energyPrice = value == null ? null : getBigInt(value, "energyPrice"); - } - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data() { - return this.#data; - } - set data(value) { - this.#data = hexlify(value); - } - /** - * The amount of xcb (in ore) to send in this transactions. - */ - get value() { - return this.#value; - } - set value(value) { - this.#value = getBigInt(value, "value"); - } - /** - * The chain ID this transaction is valid on. - */ - get networkId() { - return this.#networkId; - } - set networkId(value) { - this.#networkId = getBigInt(value); - } - /** - * If signed, the signature for this transaction. - */ - get signature() { - return this.#sig || null; - } - set signature(value) { - this.#sig = value == null ? null : value; - } - /** - * Creates a new Transaction with default values. - */ - constructor() { - this.#to = null; - this.#nonce = 0; - this.#energyLimit = BigInt(0); - this.#energyPrice = null; - this.#data = "0x"; - this.#value = BigInt(0); - this.#networkId = BigInt(0); - this.#sig = null; - } - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash() { - if (this.signature == null) { - return null; - } - return sha256(this.serialized); - } - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash() { - return sha256(this.unsignedSerialized); - } - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from() { - if (this.signature == null) { - return null; - } - const prefix = networkIdToPrefix(Number(this.#networkId)); - return recoverAddress(this.unsignedHash, this.signature, prefix); - } - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey() { - if (this.signature == null) { - return null; - } - return SigningKey.recoverPublicKey(this.unsignedHash, this.signature); - } - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned() { - //isSigned(): this is SignedTransaction { - return this.signature != null; - } - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized() { - assert(this.signature != null, "cannot serialize unsigned transaction; maybe you meant .unsignedSerialized", "UNSUPPORTED_OPERATION", { operation: ".serialized" }); - return serialize(this, this.signature); - } - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized() { - return serialize(this); - } - /** - * Create a copy of this transaciton. - */ - clone() { - return Transaction.from(this); - } - /** - * Return a JSON-friendly object. - */ - toJSON() { - const s = (v) => { - if (v == null) { - return null; - } - return v.toString(); - }; - return { - to: this.to, - data: this.data, - nonce: this.nonce, - energyLimit: s(this.energyLimit), - energyPrice: s(this.energyPrice), - value: s(this.value), - networkId: s(this.networkId), - sig: this.signature ? this.signature : null, - }; - } - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx) { - if (tx == null) { - return new Transaction(); - } - if (typeof tx === "string") { - const payload = getBytes(tx); - return Transaction.from(parse(payload)); - } - const result = new Transaction(); - if (tx.to != null) { - result.to = tx.to; - } - if (tx.nonce != null) { - result.nonce = tx.nonce; - } - if (tx.energyLimit != null) { - result.energyLimit = tx.energyLimit; - } - if (tx.energyPrice != null) { - result.energyPrice = tx.energyPrice; - } - if (tx.data != null) { - result.data = tx.data; - } - if (tx.value != null) { - result.value = tx.value; - } - if (tx.networkId != null) { - result.networkId = tx.networkId; - } - if (tx.signature != null) { - result.signature = tx.signature; - } - if (tx.hash != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define hash", "tx", tx); - assertArgument(result.hash === tx.hash, "hash mismatch", "tx", tx); - } - if (tx.from != null) { - assertArgument(result.isSigned(), "unsigned transaction cannot define from", "tx", tx); - assertArgument(result.from.toLowerCase() === (tx.from || "").toLowerCase(), "from mismatch", "tx", tx); - } - return result; - } -} -//# sourceMappingURL=transaction.js.map \ No newline at end of file diff --git a/lib.esm/transaction/transaction.js.map b/lib.esm/transaction/transaction.js.map deleted file mode 100644 index ab1d2e741..000000000 --- a/lib.esm/transaction/transaction.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAa,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,EACP,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,EAAE,eAAe,E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AAE,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;YACrB,cAAc,CACb,MAAM,CAAC,QAAQ,EAAE,EACjB,yCAAyC,EACzC,IAAI,EACJ,EAAE,CACF,CAAC;YACF,cAAc,CACb,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAC3D,eAAe,EACf,IAAI,EACJ,EAAE,CACF,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/base58.d.ts b/lib.esm/utils/base58.d.ts deleted file mode 100644 index 8b377936b..000000000 --- a/lib.esm/utils/base58.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -import type { BytesLike } from "./index.js"; -/** - * Encode %%value%% as a Base58-encoded string. - */ -export declare function encodeBase58(_value: BytesLike): string; -/** - * Decode the Base58-encoded %%value%%. - */ -export declare function decodeBase58(value: string): bigint; -//# sourceMappingURL=base58.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/base58.d.ts.map b/lib.esm/utils/base58.d.ts.map deleted file mode 100644 index 21386c9f3..000000000 --- a/lib.esm/utils/base58.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base58.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAoB5C;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAQtD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD"} \ No newline at end of file diff --git a/lib.esm/utils/base58.js b/lib.esm/utils/base58.js deleted file mode 100644 index 3d68086b6..000000000 --- a/lib.esm/utils/base58.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -import { getBytes } from "./data.js"; -import { assertArgument } from "./errors.js"; -import { toBigInt } from "./maths.js"; -const Alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; -let Lookup = null; -function getAlpha(letter) { - if (Lookup == null) { - Lookup = {}; - for (let i = 0; i < Alphabet.length; i++) { - Lookup[Alphabet[i]] = BigInt(i); - } - } - const result = Lookup[letter]; - assertArgument(result != null, `invalid base58 value`, "letter", letter); - return result; -} -const BN_0 = BigInt(0); -const BN_58 = BigInt(58); -/** - * Encode %%value%% as a Base58-encoded string. - */ -export function encodeBase58(_value) { - let value = toBigInt(getBytes(_value)); - let result = ""; - while (value) { - result = Alphabet[Number(value % BN_58)] + result; - value /= BN_58; - } - return result; -} -/** - * Decode the Base58-encoded %%value%%. - */ -export function decodeBase58(value) { - let result = BN_0; - for (let i = 0; i < value.length; i++) { - result *= BN_58; - result += getAlpha(value[i]); - } - return result; -} -//# sourceMappingURL=base58.js.map \ No newline at end of file diff --git a/lib.esm/utils/base58.js.map b/lib.esm/utils/base58.js.map deleted file mode 100644 index b32b1f4d5..000000000 --- a/lib.esm/utils/base58.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base58.js","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,QAAQ,GAAG,4DAA4D,CAAC;AAC9E,IAAI,MAAM,GAAkC,IAAI,CAAC;AAEjD,SAAS,QAAQ,CAAC,MAAc;IAC/B,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACpB,MAAM,GAAG,EAAE,CAAC;QACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,cAAc,CAAC,MAAM,IAAI,IAAI,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC;AACf,CAAC;AAED,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;AAEzB;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAiB;IAC7C,IAAI,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACvC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,OAAO,KAAK,EAAE,CAAC;QACd,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC;QAClD,KAAK,IAAI,KAAK,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACzC,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC;QAChB,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/base64-browser.d.ts b/lib.esm/utils/base64-browser.d.ts deleted file mode 100644 index ea96c442c..000000000 --- a/lib.esm/utils/base64-browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BytesLike } from "./data.js"; -export declare function decodeBase64(textData: string): Uint8Array; -export declare function encodeBase64(_data: BytesLike): string; -//# sourceMappingURL=base64-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/base64-browser.d.ts.map b/lib.esm/utils/base64-browser.d.ts.map deleted file mode 100644 index 83a734cd1..000000000 --- a/lib.esm/utils/base64-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAOzD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAOrD"} \ No newline at end of file diff --git a/lib.esm/utils/base64-browser.js b/lib.esm/utils/base64-browser.js deleted file mode 100644 index b9b98a35c..000000000 --- a/lib.esm/utils/base64-browser.js +++ /dev/null @@ -1,19 +0,0 @@ -// utils/base64-browser -import { getBytes } from "./data.js"; -export function decodeBase64(textData) { - textData = atob(textData); - const data = new Uint8Array(textData.length); - for (let i = 0; i < textData.length; i++) { - data[i] = textData.charCodeAt(i); - } - return getBytes(data); -} -export function encodeBase64(_data) { - const data = getBytes(_data); - let textData = ""; - for (let i = 0; i < data.length; i++) { - textData += String.fromCharCode(data[i]); - } - return btoa(textData); -} -//# sourceMappingURL=base64-browser.js.map \ No newline at end of file diff --git a/lib.esm/utils/base64-browser.js.map b/lib.esm/utils/base64-browser.js.map deleted file mode 100644 index 7fad8e1a5..000000000 --- a/lib.esm/utils/base64-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64-browser.js","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":"AAAA,uBAAuB;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC5C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAgB;IAC5C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,QAAQ,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/base64.d.ts b/lib.esm/utils/base64.d.ts deleted file mode 100644 index 0cab53288..000000000 --- a/lib.esm/utils/base64.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -export declare function decodeBase64(value: string): Uint8Array; -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -export declare function encodeBase64(data: BytesLike): string; -//# sourceMappingURL=base64.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/base64.d.ts.map b/lib.esm/utils/base64.d.ts.map deleted file mode 100644 index 34656262c..000000000 --- a/lib.esm/utils/base64.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAEtD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEpD"} \ No newline at end of file diff --git a/lib.esm/utils/base64.js b/lib.esm/utils/base64.js deleted file mode 100644 index ac07c084e..000000000 --- a/lib.esm/utils/base64.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * [Base64 encoding](link-wiki-base64) using 6-bit words to encode - * arbitrary bytes into a string using 65 printable symbols, the - * upper-case and lower-case alphabet, the digits ``0`` through ``9``, - * ``"+"`` and ``"/"`` with the ``"="`` used for padding. - * - * @_subsection: api/utils:Base64 Encoding [about-base64] - */ -import { getBytes, getBytesCopy } from "./data.js"; -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -export function decodeBase64(value) { - return getBytesCopy(Buffer.from(value, "base64")); -} -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -export function encodeBase64(data) { - return Buffer.from(getBytes(data)).toString("base64"); -} -//# sourceMappingURL=base64.js.map \ No newline at end of file diff --git a/lib.esm/utils/base64.js.map b/lib.esm/utils/base64.js.map deleted file mode 100644 index 23aecbc86..000000000 --- a/lib.esm/utils/base64.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAInD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACzC,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY,CAAC,IAAe;IAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACvD,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/data.d.ts b/lib.esm/utils/data.d.ts deleted file mode 100644 index 59cca6eba..000000000 --- a/lib.esm/utils/data.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -/** - * A [[HexString]] whose length is even, which ensures it is a valid - * representation of binary data. - */ -export type DataHexString = string; -/** - * A string which is prefixed with ``0x`` and followed by any number - * of case-agnostic hexadecimal characters. - * - * It must match the regular expression ``/0x[0-9A-Fa-f]*\/``. - */ -export type HexString = string; -/** - * An object that can be used to represent binary data. - */ -export type Bytes = ArrayLike; -export type BytesLike = Bytes | string; -export type DataOptions = { - allowMissingPrefix?: boolean; - hexPad?: "left" | "right" | null; -}; -export interface Hexable { - toHexString(): string; -} -export declare function isBytes(value: any): value is Bytes; -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -export declare function getBytes(value: BytesLike, name?: string): Uint8Array; -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -export declare function getBytesCopy(value: BytesLike, name?: string): Uint8Array; -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -export declare function isHexString(value: any, length?: number | boolean): value is `0x${string}`; -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -export declare function isBytesLike(value: any): value is BytesLike; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -export declare function hexlify(value: BytesLike | Hexable | number | bigint, options?: DataOptions): string; -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -export declare function concat(items: ReadonlyArray): string; -export declare function hexDataSlice(data: BytesLike, offset: number, endOffset?: number): string; -export declare function hexDataLength(data: BytesLike): number | null; -/** - * Returns the length of %%data%%, in bytes. - */ -export declare function dataLength(data: BytesLike): number; -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -export declare function dataSlice(data: BytesLike, start?: number, end?: number): string; -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -export declare function stripZerosLeft(data: BytesLike): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -export declare function zeroPadValue(data: BytesLike, length: number): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -export declare function zeroPadBytes(data: BytesLike, length: number): string; -export declare function stripZeros(value: BytesLike): Uint8Array; -export declare function arrayify(value: BytesLike | Hexable | number, options?: DataOptions): Uint8Array; -export declare function hexConcat(items: ReadonlyArray): string; -//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/data.d.ts.map b/lib.esm/utils/data.d.ts.map deleted file mode 100644 index 3b65817ca..000000000 --- a/lib.esm/utils/data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CACjC,CAAC;AACF,MAAM,WAAW,OAAO;IACvB,WAAW,IAAI,MAAM,CAAC;CACtB;AASD,wBAAgB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAsBlD;AA2BD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAEpE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,UAAU,CAExE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,GAAG,EACV,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GACvB,KAAK,IAAI,KAAK,MAAM,EAAE,CAaxB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAE1D;AAID;;GAEG;AACH,wBAAgB,OAAO,CACtB,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,EAC5C,OAAO,CAAC,EAAE,WAAW,GACnB,MAAM,CA4ER;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAE9D;AAED,wBAAgB,YAAY,CAC3B,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,EACd,SAAS,CAAC,EAAE,MAAM,GAChB,MAAM,CAcR;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,iBAQ5C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAKlD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,MAAM,EACd,GAAG,CAAC,EAAE,MAAM,GACV,MAAM,CAYR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAMtD;AA0BD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAmBvD;AAED,wBAAgB,QAAQ,CACvB,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,EACnC,OAAO,CAAC,EAAE,WAAW,GACnB,UAAU,CAuDZ;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAMjE"} \ No newline at end of file diff --git a/lib.esm/utils/data.js b/lib.esm/utils/data.js deleted file mode 100644 index 5372a06f2..000000000 --- a/lib.esm/utils/data.js +++ /dev/null @@ -1,355 +0,0 @@ -/** - * Some data helpers. - * - * - * @_subsection api/utils:Data Helpers [about-data] - */ -import { Logger } from "../logger/logger.js"; -import { assert, assertArgument } from "./errors.js"; -const logger = new Logger("utils/data/0.0.1"); -function isHexable(value) { - return !!value.toHexString; -} -function isInteger(value) { - return typeof value === "number" && value == value && value % 1 === 0; -} -export function isBytes(value) { - if (value == null) { - return false; - } - if (value.constructor === Uint8Array) { - return true; - } - if (typeof value === "string") { - return false; - } - if (!isInteger(value.length) || value.length < 0) { - return false; - } - for (let i = 0; i < value.length; i++) { - const v = value[i]; - if (!isInteger(v) || v < 0 || v >= 256) { - return false; - } - } - return true; -} -function _getBytes(value, name, copy) { - if (value instanceof Uint8Array) { - if (copy) { - return new Uint8Array(value); - } - return value; - } - if (typeof value === "string" && value.match(/^0x([0-9a-f][0-9a-f])*$/i)) { - const result = new Uint8Array((value.length - 2) / 2); - let offset = 2; - for (let i = 0; i < result.length; i++) { - result[i] = parseInt(value.substring(offset, offset + 2), 16); - offset += 2; - } - return result; - } - assertArgument(false, "invalid BytesLike value", name || "value", value); -} -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -export function getBytes(value, name) { - return _getBytes(value, name, false); -} -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -export function getBytesCopy(value, name) { - return _getBytes(value, name, true); -} -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -export function isHexString(value, length) { - if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) { - return false; - } - if (typeof length === "number" && value.length !== 2 + 2 * length) { - return false; - } - if (length === true && value.length % 2 !== 0) { - return false; - } - return true; -} -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -export function isBytesLike(value) { - return isHexString(value, true) || value instanceof Uint8Array; -} -const HexCharacters = "0123456789abcdef"; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -export function hexlify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "string") { - if (value.includes(",") && value.startsWith("0x")) { - const v = value - .replace("0x", "") - .split(",") - .map((item) => Number(item)); - // @ts-ignore - value = new Uint8Array(v); - } - } - if (typeof value === "number") { - logger.checkSafeUint53(value, "invalid hexlify value"); - let hex = ""; - while (value) { - hex = HexCharacters[value & 0xf] + hex; - value = Math.floor(value / 16); - } - if (hex.length) { - if (hex.length % 2) { - hex = "0" + hex; - } - return "0x" + hex; - } - return "0x00"; - } - if (typeof value === "bigint") { - value = value.toString(16); - if (value.length % 2) { - return "0x0" + value; - } - return "0x" + value; - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - return value.toHexString(); - } - if (isHexString(value)) { - if (value.length % 2) { - if (options.hexPad === "left") { - value = "0x0" + value.substring(2); - } - else if (options.hexPad === "right") { - value += "0"; - } - else { - logger.throwArgumentError("hex data is odd-length", "value", value); - } - } - return value.toLowerCase(); - } - if (isBytes(value)) { - let result = "0x"; - for (let i = 0; i < value.length; i++) { - let v = value[i]; - result += HexCharacters[(v & 0xf0) >> 4] + HexCharacters[v & 0x0f]; - } - return result; - } - return logger.throwArgumentError("invalid hexlify value", "value", value); -} -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -export function concat(items) { - return "0x" + items.map((d) => hexlify(d).substring(2)).join(""); -} -export function hexDataSlice(data, offset, endOffset) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - logger.throwArgumentError("invalid hexData", "value", data); - } - offset = 2 + 2 * offset; - if (endOffset != null) { - return "0x" + data.substring(offset, 2 + 2 * endOffset); - } - return "0x" + data.substring(offset); -} -export function hexDataLength(data) { - if (typeof data !== "string") { - data = hexlify(data); - } - else if (!isHexString(data) || data.length % 2) { - return null; - } - return (data.length - 2) / 2; -} -/** - * Returns the length of %%data%%, in bytes. - */ -export function dataLength(data) { - if (isHexString(data, true)) { - return (data.length - 2) / 2; - } - return getBytes(data).length; -} -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -export function dataSlice(data, start, end) { - const bytes = getBytes(data); - if (end != null && end > bytes.length) { - assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", { - buffer: bytes, - length: bytes.length, - offset: end, - }); - } - return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end)); -} -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -export function stripZerosLeft(data) { - let bytes = hexlify(data).substring(2); - while (bytes.startsWith("00")) { - bytes = bytes.substring(2); - } - return "0x" + bytes; -} -function zeroPad(data, length, left) { - const bytes = getBytes(data); - assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", { - buffer: new Uint8Array(bytes), - length: length, - offset: length + 1, - }); - const result = new Uint8Array(length); - result.fill(0); - if (left) { - result.set(bytes, length - bytes.length); - } - else { - result.set(bytes, 0); - } - return hexlify(result); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -export function zeroPadValue(data, length) { - return zeroPad(data, length, true); -} -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -export function zeroPadBytes(data, length) { - return zeroPad(data, length, false); -} -export function stripZeros(value) { - let result = arrayify(value); - if (result.length === 0) { - return result; - } - // Find the first non-zero entry - let start = 0; - while (start < result.length && result[start] === 0) { - start++; - } - // If we started with zeros, strip them - if (start) { - result = result.slice(start); - } - return result; -} -export function arrayify(value, options) { - if (!options) { - options = {}; - } - if (typeof value === "number") { - logger.checkSafeUint53(value, "invalid arrayify value"); - const result = []; - while (value) { - // @ts-ignore - result.unshift(value & 0xff); - value = parseInt(String(value / 256)); - } - if (result.length === 0) { - result.push(0); - } - return new Uint8Array(result); - } - if (options.allowMissingPrefix && - typeof value === "string" && - value.substring(0, 2) !== "0x") { - value = "0x" + value; - } - if (isHexable(value)) { - value = value.toHexString(); - } - if (isHexString(value)) { - let hex = value.substring(2); - if (hex.length % 2) { - if (options.hexPad === "left") { - hex = "0x0" + hex.substring(2); - } - else if (options.hexPad === "right") { - hex += "0"; - } - else { - logger.throwArgumentError("hex data is odd-length", "value", value); - } - } - const result = []; - for (let i = 0; i < hex.length; i += 2) { - // @ts-ignore - result.push(parseInt(hex.substring(i, i + 2), 16)); - } - return new Uint8Array(result); - } - if (isBytes(value)) { - return new Uint8Array(value); - } - return logger.throwArgumentError("invalid arrayify value", "value", value); -} -export function hexConcat(items) { - let result = "0x"; - items.forEach((item) => { - result += hexlify(item).substring(2); - }); - return result; -} -//# sourceMappingURL=data.js.map \ No newline at end of file diff --git a/lib.esm/utils/data.js.map b/lib.esm/utils/data.js.map deleted file mode 100644 index fb56167fe..000000000 --- a/lib.esm/utils/data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data.js","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,kBAAkB,CAAC,CAAC;AA8B9C,SAAS,SAAS,CAAC,KAAU;IAC5B,OAAO,CAAC,CA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AAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACpD,CAAC;QAED,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACpB,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,MAAM,CAAC,kBAAkB,CAAC,wBAAwB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAA+B;IACxD,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/errors.d.ts b/lib.esm/utils/errors.d.ts deleted file mode 100644 index 130aa0621..000000000 --- a/lib.esm/utils/errors.d.ts +++ /dev/null @@ -1,486 +0,0 @@ -/** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -import type { TransactionRequest, TransactionReceipt, TransactionResponse } from "../providers/index.js"; -import type { FetchRequest, FetchResponse } from "./fetch.js"; -export type ErrorInfo = Omit; -/** - * All errors emitted by corebc have an **ErrorCode** to help - * identify and coalesce errors to simplfy programatic analysis. - * - * Each **ErrorCode** is the %%code%% proerty of a coresponding - * [[corebcError]]. - * - * **Generic Errors** - * - * **``"UNKNOWN_ERROR"``** - see [[UnknownError]] - * - * **``"NOT_IMPLEMENTED"``** - see [[NotImplementedError]] - * - * **``"UNSUPPORTED_OPERATION"``** - see [[UnsupportedOperationError]] - * - * **``"NETWORK_ERROR"``** - see [[NetworkError]] - * - * **``"SERVER_ERROR"``** - see [[ServerError]] - * - * **``"TIMEOUT"``** - see [[TimeoutError]] - * - * **``"BAD_DATA"``** - see [[BadDataError]] - * - * **``"CANCELLED"``** - see [[CancelledError]] - * - * **Operational Errors** - * - * **``"BUFFER_OVERRUN"``** - see [[BufferOverrunError]] - * - * **``"NUMERIC_FAULT"``** - see [[NumericFaultError]] - * - * **Argument Errors** - * - * **``"INVALID_ARGUMENT"``** - see [[InvalidArgumentError]] - * - * **``"MISSING_ARGUMENT"``** - see [[MissingArgumentError]] - * - * **``"UNEXPECTED_ARGUMENT"``** - see [[UnexpectedArgumentError]] - * - * **``"VALUE_MISMATCH"``** - //unused// - * - * **Blockchain Errors** - * - * **``"CALL_EXCEPTION"``** - see [[CallExceptionError]] - * - * **``"INSUFFICIENT_FUNDS"``** - see [[InsufficientFundsError]] - * - * **``"NONCE_EXPIRED"``** - see [[NonceExpiredError]] - * - * **``"REPLACEMENT_UNDERPRICED"``** - see [[ReplacementUnderpricedError]] - * - * **``"TRANSACTION_REPLACED"``** - see [[TransactionReplacedError]] - * - * **``"UNCONFIGURED_NAME"``** - see [[UnconfiguredNameError]] - * - * **``"OFFCHAIN_FAULT"``** - see [[OffchainFaultError]] - * - * **User Interaction Errors** - * - * **``"ACTION_REJECTED"``** - see [[ActionRejectedError]] - */ -export type ErrorCode = "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | "CANCELLED" | "BUFFER_OVERRUN" | "NUMERIC_FAULT" | "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | "VALUE_MISMATCH" | "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | "ACTION_REJECTED"; -/** - * All errors in corebc include properties to assist in - * machine-readable errors. - */ -export interface CoreBCError extends Error { - /** - * The string error code. - */ - code: ErrorCode; - /** - * Additional info regarding the error that may be useful. - * - * This is generally helpful mostly for human-based debugging. - */ - info?: Record; - /** - * Any related error. - */ - error?: Error; -} -/** - * This Error is a catch-all for when there is no way for corebc to - * know what the underlying problem is. - */ -export interface UnknownError extends CoreBCError<"UNKNOWN_ERROR"> { - [key: string]: any; -} -/** - * This Error is mostly used as a stub for functionality that is - * intended for the future, but is currently not implemented. - */ -export interface NotImplementedError extends CoreBCError<"NOT_IMPLEMENTED"> { - /** - * The attempted operation. - */ - operation: string; -} -/** - * This Error indicates that the attempted operation is not supported. - * - * This could range from a specifc JSON-RPC end-point not supporting - * a feature to a specific configuration of an object prohibiting the - * operation. - * - * For example, a [[Wallet]] with no connected [[Provider]] is unable - * to send a transaction. - */ -export interface UnsupportedOperationError extends CoreBCError<"UNSUPPORTED_OPERATION"> { - /** - * The attempted operation. - */ - operation: string; -} -export interface NetworkError extends CoreBCError<"NETWORK_ERROR"> { - event: string; -} -/** - * This Error indicates there was a problem fetching a resource from - * a server. - */ -export interface ServerError extends CoreBCError<"SERVER_ERROR"> { - /** - * The requested resource. - */ - request: FetchRequest | string; - /** - * The response received from the server, if available. - */ - response?: FetchResponse; -} -/** - * This Error indicates that the timeout duration has expired and - * that the operation has been implicitly cancelled. - * - * The side-effect of the operation may still occur, as this - * generally means a request has been sent and there has simply - * been no response to indicate whether it was processed or not. - */ -export interface TimeoutError extends CoreBCError<"TIMEOUT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The reason. - */ - reason: string; - /** - * The resource request, if available. - */ - request?: FetchRequest; -} -/** - * This Error indicates that a provided set of data cannot - * be correctly interpretted. - */ -export interface BadDataError extends CoreBCError<"BAD_DATA"> { - /** - * The data. - */ - value: any; -} -/** - * This Error indicates that the operation was cancelled by a - * programmatic call, for example to ``cancel()``. - */ -export interface CancelledError extends CoreBCError<"CANCELLED"> { -} -/** - * This Error indicates an attempt was made to read outside the bounds - * of protected data. - * - * Most operations in corebc are protected by bounds checks, to mitigate - * exploits when parsing data. - */ -export interface BufferOverrunError extends CoreBCError<"BUFFER_OVERRUN"> { - /** - * The buffer that was overrun. - */ - buffer: Uint8Array; - /** - * The length of the buffer. - */ - length: number; - /** - * The offset that was requested. - */ - offset: number; -} -/** - * This Error indicates an operation which would result in incorrect - * arithmetic output has occurred. - * - * For example, trying to divide by zero or using a ``uint8`` to store - * a negative value. - */ -export interface NumericFaultError extends CoreBCError<"NUMERIC_FAULT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The fault reported. - */ - fault: string; - /** - * The value the operation was attempted against. - */ - value: any; -} -/** - * This Error indicates an incorrect type or value was passed to - * a function or method. - */ -export interface InvalidArgumentError extends CoreBCError<"INVALID_ARGUMENT"> { - /** - * The name of the argument. - */ - argument: string; - /** - * The value that was provided. - */ - value: any; - info?: Record; -} -/** - * This Error indicates there were too few arguments were provided. - */ -export interface MissingArgumentError extends CoreBCError<"MISSING_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * This Error indicates too many arguments were provided. - */ -export interface UnexpectedArgumentError extends CoreBCError<"UNEXPECTED_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * The action that resulted in the error. - */ -export type CallExceptionAction = "call" | "estimateEnergy" | "getTransactionResult" | "unknown"; -/** - * The related transaction that caused the error. - */ -export type CallExceptionTransaction = { - to: null | string; - from?: string; - data: string; -}; -/** - * This **Error** indicates a transaction reverted. - */ -export interface CallExceptionError extends CoreBCError<"CALL_EXCEPTION"> { - /** - * The action being performed when the revert was encountered. - */ - action: CallExceptionAction; - /** - * The revert data returned. - */ - data: null | string; - /** - * A human-readable representation of data, if possible. - */ - reason: null | string; - /** - * The transaction that triggered the exception. - */ - transaction: CallExceptionTransaction; - /** - * The contract invocation details, if available. - */ - invocation: null | { - method: string; - signature: string; - args: Array; - }; - /** - * The built-in or custom revert error, if available - */ - revert: null | { - signature: string; - name: string; - args: Array; - }; -} -/** - * The sending account has insufficient funds to cover the - * entire transaction cost. - */ -export interface InsufficientFundsError extends CoreBCError<"INSUFFICIENT_FUNDS"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * The sending account has already used this nonce in a - * transaction that has been included. - */ -export interface NonceExpiredError extends CoreBCError<"NONCE_EXPIRED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A CCIP-read exception, which cannot be recovered from or - * be further processed. - */ -export interface OffchainFaultError extends CoreBCError<"OFFCHAIN_FAULT"> { - /** - * The transaction. - */ - transaction?: TransactionRequest; - /** - * The reason the CCIP-read failed. - */ - reason: string; -} -/** - * An attempt was made to replace a transaction, but with an - * insufficient additional fee to afford evicting the old - * transaction from the memory pool. - */ -export interface ReplacementUnderpricedError extends CoreBCError<"REPLACEMENT_UNDERPRICED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A pending transaction was replaced by another. - */ -export interface TransactionReplacedError extends CoreBCError<"TRANSACTION_REPLACED"> { - /** - * If the transaction was cancelled, such that the original - * effects of the transaction cannot be assured. - */ - cancelled: boolean; - /** - * The reason the transaction was replaced. - */ - reason: "repriced" | "cancelled" | "replaced"; - /** - * The hash of the replaced transaction. - */ - hash: string; - /** - * The transaction that replaced the transaction. - */ - replacement: TransactionResponse; - /** - * The receipt of the transaction that replace the transaction. - */ - receipt: TransactionReceipt; -} -/** - * This Error indicates an ENS name was used, but the name has not - * been configured. - * - * This could indicate an ENS name is unowned or that the current - * address being pointed to is the [[ZeroAddress]]. - */ -export interface UnconfiguredNameError extends CoreBCError<"UNCONFIGURED_NAME"> { - /** - * The ENS name that was requested - */ - value: string; -} -/** - * This Error indicates a request was rejected by the user. - * - * In most clients (such as MetaMask), when an operation requires user - * authorization (such as ``signer.sendTransaction``), the client - * presents a dialog box to the user. If the user denies the request - * this error is thrown. - */ -export interface ActionRejectedError extends CoreBCError<"ACTION_REJECTED"> { - /** - * The requested action. - */ - action: "requestAccess" | "sendTransaction" | "signMessage" | "signTransaction" | "signTypedData" | "unknown"; - /** - * The reason the action was rejected. - * - * If there is already a pending request, some clients may indicate - * there is already a ``"pending"`` action. This prevents an app - * from spamming the user. - */ - reason: "expired" | "rejected" | "pending"; -} -/** - * A conditional type that transforms the [[ErrorCode]] T into - * its corebcError type. - * - * @flatworm-skip-docs - */ -export type CodedCoreBCError = T extends "UNKNOWN_ERROR" ? UnknownError : T extends "NOT_IMPLEMENTED" ? NotImplementedError : T extends "UNSUPPORTED_OPERATION" ? UnsupportedOperationError : T extends "NETWORK_ERROR" ? NetworkError : T extends "SERVER_ERROR" ? ServerError : T extends "TIMEOUT" ? TimeoutError : T extends "BAD_DATA" ? BadDataError : T extends "CANCELLED" ? CancelledError : T extends "BUFFER_OVERRUN" ? BufferOverrunError : T extends "NUMERIC_FAULT" ? NumericFaultError : T extends "INVALID_ARGUMENT" ? InvalidArgumentError : T extends "MISSING_ARGUMENT" ? MissingArgumentError : T extends "UNEXPECTED_ARGUMENT" ? UnexpectedArgumentError : T extends "CALL_EXCEPTION" ? CallExceptionError : T extends "INSUFFICIENT_FUNDS" ? InsufficientFundsError : T extends "NONCE_EXPIRED" ? NonceExpiredError : T extends "OFFCHAIN_FAULT" ? OffchainFaultError : T extends "REPLACEMENT_UNDERPRICED" ? ReplacementUnderpricedError : T extends "TRANSACTION_REPLACED" ? TransactionReplacedError : T extends "UNCONFIGURED_NAME" ? UnconfiguredNameError : T extends "ACTION_REJECTED" ? ActionRejectedError : never; -/** - * Returns true if the %%error%% matches an error thrown by corebc - * that matches the error %%code%%. - * - * In TypeScript envornoments, this can be used to check that %%error%% - * matches an corebcError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -export declare function isError>(error: any, code: K): error is T; -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -export declare function isCallException(error: any): error is CallExceptionError; -/** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ -export declare function makeError>(message: string, code: K, info?: ErrorInfo): T; -/** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -export declare function assert>(check: unknown, message: string, code: K, info?: ErrorInfo): asserts check; -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -export declare function assertArgument(check: unknown, message: string, name: string, value: unknown): asserts check; -export declare function assertArgumentCount(count: number, expectedCount: number, message?: string): void; -/** - * Throws if the normalization %%form%% is not supported. - */ -export declare function assertNormalize(form: string): void; -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -export declare function assertPrivate(givenGuard: any, guard: any, className?: string): void; -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/errors.d.ts.map b/lib.esm/utils/errors.d.ts.map deleted file mode 100644 index b9eff4781..000000000 --- a/lib.esm/utils/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACX,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAA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AC3E,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,CAAC,EACP,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GACjB,CAAC,CA+CH;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,EACxE,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,CAAC,EACP,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GACjB,OAAO,CAAC,KAAK,CAIf;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACZ,OAAO,CAAC,KAAK,CAEf;AAED,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CA2BN;AA8BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,UAAU,EAAE,GAAG,EACf,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,MAAM,GAChB,IAAI,CAoBN"} \ No newline at end of file diff --git a/lib.esm/utils/errors.js b/lib.esm/utils/errors.js deleted file mode 100644 index 68fee1383..000000000 --- a/lib.esm/utils/errors.js +++ /dev/null @@ -1,215 +0,0 @@ -/** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -import { version } from "../_version.js"; -import { defineProperties } from "./properties.js"; -function stringify(value) { - if (value == null) { - return "null"; - } - if (Array.isArray(value)) { - return "[ " + value.map(stringify).join(", ") + " ]"; - } - if (value instanceof Uint8Array) { - const HEX = "0123456789abcdef"; - let result = "0x"; - for (let i = 0; i < value.length; i++) { - result += HEX[value[i] >> 4]; - result += HEX[value[i] & 0xf]; - } - return result; - } - if (typeof value === "object" && typeof value.toJSON === "function") { - return stringify(value.toJSON()); - } - switch (typeof value) { - case "boolean": - case "symbol": - return value.toString(); - case "bigint": - return BigInt(value).toString(); - case "number": - return value.toString(); - case "string": - return JSON.stringify(value); - case "object": { - const keys = Object.keys(value); - keys.sort(); - return ("{ " + - keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(", ") + - " }"); - } - } - return `[ COULD NOT SERIALIZE ]`; -} -/** - * Returns true if the %%error%% matches an error thrown by corebc - * that matches the error %%code%%. - * - * In TypeScript envornoments, this can be used to check that %%error%% - * matches an corebcError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -export function isError(error, code) { - return error && error.code === code; -} -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -export function isCallException(error) { - return isError(error, "CALL_EXCEPTION"); -} -/** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ -export function makeError(message, code, info) { - { - const details = []; - if (info) { - if ("message" in info || "code" in info || "name" in info) { - throw new Error(`value will overwrite populated values: ${stringify(info)}`); - } - for (const key in info) { - const value = info[key]; - // try { - details.push(key + "=" + stringify(value)); - // } catch (error: any) { - // console.log("MMM", error.message); - // details.push(key + "=[could not serialize object]"); - // } - } - } - details.push(`code=${code}`); - details.push(`version=${version}`); - if (details.length) { - message += " (" + details.join(", ") + ")"; - } - } - let error; - switch (code) { - case "INVALID_ARGUMENT": - error = new TypeError(message); - break; - case "NUMERIC_FAULT": - case "BUFFER_OVERRUN": - error = new RangeError(message); - break; - default: - error = new Error(message); - } - defineProperties(error, { code }); - if (info) { - Object.assign(error, info); - } - return error; -} -/** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -export function assert(check, message, code, info) { - if (!check) { - throw makeError(message, code, info); - } -} -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -export function assertArgument(check, message, name, value) { - assert(check, message, "INVALID_ARGUMENT", { argument: name, value: value }); -} -export function assertArgumentCount(count, expectedCount, message) { - if (message == null) { - message = ""; - } - if (message) { - message = ": " + message; - } - assert(count >= expectedCount, "missing arguemnt" + message, "MISSING_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); - assert(count <= expectedCount, "too many arguemnts" + message, "UNEXPECTED_ARGUMENT", { - count: count, - expectedCount: expectedCount, - }); -} -const _normalizeForms = ["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => { - try { - // General test for normalize - /* c8 ignore start */ - if ("test".normalize(form) !== "test") { - throw new Error("bad"); - } - /* c8 ignore stop */ - if (form === "NFD") { - const check = String.fromCharCode(0xe9).normalize("NFD"); - const expected = String.fromCharCode(0x65, 0x0301); - /* c8 ignore start */ - if (check !== expected) { - throw new Error("broken"); - } - /* c8 ignore stop */ - } - accum.push(form); - } - catch (error) { } - return accum; -}, []); -/** - * Throws if the normalization %%form%% is not supported. - */ -export function assertNormalize(form) { - assert(_normalizeForms.indexOf(form) >= 0, "platform missing String.prototype.normalize", "UNSUPPORTED_OPERATION", { - operation: "String.prototype.normalize", - info: { form }, - }); -} -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -export function assertPrivate(givenGuard, guard, className) { - if (className == null) { - className = ""; - } - if (givenGuard !== guard) { - let method = className, operation = "new"; - if (className) { - method += "."; - operation += " " + className; - } - assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", { - operation, - }); - } -} -//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/lib.esm/utils/errors.js.map b/lib.esm/utils/errors.js.map deleted file mode 100644 index 914595a30..000000000 --- a/lib.esm/utils/errors.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAYnD,SAAS,SAAS,CAAC,KAAU;IAC5B,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QACnB,OAAO,MAAM,CAAC;IACf,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtD,CAAC;IAED,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,kBAAkB,CAAC;QAC/B,IAAI,MAAM,GAAG,IAAI,CAAC;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAC7B,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,EAAE,CAA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AAI,GAAG,GAAG,SAAS,CAAC;QAC9B,CAAC;QACD,MAAM,CACL,KAAK,EACL,4BAA4B,MAAM,eAAe,EACjD,uBAAuB,EACvB;YACC,SAAS;SACT,CACD,CAAC;IACH,CAAC;AACF,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/events.d.ts b/lib.esm/utils/events.d.ts deleted file mode 100644 index 5da088923..000000000 --- a/lib.esm/utils/events.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * A callback function called when a an event is triggered. - */ -export type Listener = (...args: Array) => void; -/** - * An **EventEmitterable** behaves similar to an EventEmitter - * except provides async access to its methods. - * - * An EventEmitter implements the observer pattern. - */ -export interface EventEmitterable { - /** - * Registers a %%listener%% that is called whenever the - * %%event%% occurs until unregistered. - */ - on(event: T, listener: Listener): Promise; - /** - * Registers a %%listener%% that is called the next time - * %%event%% occurs. - */ - once(event: T, listener: Listener): Promise; - /** - * Triggers each listener for %%event%% with the %%args%%. - */ - emit(event: T, ...args: Array): Promise; - /** - * Resolves to the number of listeners for %%event%%. - */ - listenerCount(event?: T): Promise; - /** - * Resolves to the listeners for %%event%%. - */ - listeners(event?: T): Promise>; - /** - * Unregister the %%listener%% for %%event%%. If %%listener%% - * is unspecified, all listeners are unregistered. - */ - off(event: T, listener?: Listener): Promise; - /** - * Unregister all listeners for %%event%%. - */ - removeAllListeners(event?: T): Promise; - /** - * Alias for [[on]]. - */ - addListener(event: T, listener: Listener): Promise; - /** - * Alias for [[off]]. - */ - removeListener(event: T, listener: Listener): Promise; -} -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -export declare class EventPayload { - #private; - /** - * The event filter. - */ - readonly filter: T; - /** - * The **EventEmitterable**. - */ - readonly emitter: EventEmitterable; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter: EventEmitterable, listener: null | Listener, filter: T); - /** - * Unregister the triggered listener for future events. - */ - removeListener(): Promise; -} -//# sourceMappingURL=events.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/events.d.ts.map b/lib.esm/utils/events.d.ts.map deleted file mode 100644 index 140670f11..000000000 --- a/lib.esm/utils/events.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAClC;;;OAGG;IACH,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtD;;OAEG;IACH,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,qBAAa,YAAY,CAAC,CAAC;;IAC1B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,CAAC,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAIvC;;;OAGG;IACH,YACC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC5B,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,CAAC,EAIT;IAED;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpC;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/events.js b/lib.esm/utils/events.js deleted file mode 100644 index adace5470..000000000 --- a/lib.esm/utils/events.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Explain events... - * - * @_section api/utils/events:Events [about-events] - */ -import { defineProperties } from "./properties.js"; -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -export class EventPayload { - /** - * The event filter. - */ - filter; - /** - * The **EventEmitterable**. - */ - emitter; - #listener; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter, listener, filter) { - this.#listener = listener; - defineProperties(this, { emitter, filter }); - } - /** - * Unregister the triggered listener for future events. - */ - async removeListener() { - if (this.#listener == null) { - return; - } - await this.emitter.off(this.filter, this.#listener); - } -} -//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/lib.esm/utils/events.js.map b/lib.esm/utils/events.js.map deleted file mode 100644 index d6fb75a60..000000000 --- a/lib.esm/utils/events.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AA+DnD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACxB;;OAEG;IACM,MAAM,CAAK;IAEpB;;OAEG;IACM,OAAO,CAAuB;IAE9B,SAAS,CAAkB;IAEpC;;;OAGG;IACH,YACC,OAA4B,EAC5B,QAAyB,EACzB,MAAS;QAET,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,gBAAgB,CAAoB,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc;QACnB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;YAC5B,OAAO;QACR,CAAC;QACD,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/fetch.d.ts b/lib.esm/utils/fetch.d.ts deleted file mode 100644 index 7d226ccc0..000000000 --- a/lib.esm/utils/fetch.d.ts +++ /dev/null @@ -1,327 +0,0 @@ -export type GetUrlResponse = { - statusCode: number; - statusMessage: string; - headers: Record; - body: null | Uint8Array; -}; -export type FetchThrottleParams = { - maxAttempts?: number; - slotInterval?: number; -}; -/** - * Called before any network request, allowing updated headers (e.g. Bearer tokens), etc. - */ -export type FetchPreflightFunc = (req: FetchRequest) => Promise; -/** - * Called on the response, allowing client-based throttling logic or post-processing. - */ -export type FetchProcessFunc = (req: FetchRequest, resp: FetchResponse) => Promise; -/** - * Called prior to each retry; return true to retry, false to abort. - */ -export type FetchRetryFunc = (req: FetchRequest, resp: FetchResponse, attempt: number) => Promise; -/** - * Called on Gateway URLs. - */ -export type FetchGatewayFunc = (url: string, signal?: FetchCancelSignal) => Promise; -/** - * Used to perform a fetch; use this to override the underlying network - * fetch layer. In NodeJS, the default uses the "http" and "https" libraries - * and in the browser ``fetch`` is used. If you wish to use Axios, this is - * how you would register it. - */ -export type FetchGetUrlFunc = (req: FetchRequest, signal?: FetchCancelSignal) => Promise; -/** - * @_ignore - */ -export declare class FetchCancelSignal { - #private; - constructor(request: FetchRequest); - addListener(listener: () => void): void; - get cancelled(): boolean; - checkSignal(): void; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -export declare class FetchRequest implements Iterable<[key: string, value: string]> { - #private; - /** - * The fetch URI to requrest. - */ - get url(): string; - set url(url: string); - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . - * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrincis ``Content-Type`` is - * set to ``application/json``. - */ - get body(): null | Uint8Array; - set body(body: null | string | Readonly | Readonly); - /** - * Returns true if the request has a body. - */ - hasBody(): this is FetchRequest & { - body: Uint8Array; - }; - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method(): string; - set method(method: null | string); - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any chnages will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers(): Record; - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key: string, value: string | number): void; - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders(): void; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials(): null | string; - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username: string, password: string): void; - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip(): boolean; - set allowGzip(value: boolean); - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication(): boolean; - set allowInsecureAuthentication(value: boolean); - /** - * The timeout (in milliseconds) to wait for a complere response. - * //(default: 5 minutes)// - */ - get timeout(): number; - set timeout(timeout: number); - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc(): null | FetchPreflightFunc; - set preflightFunc(preflight: null | FetchPreflightFunc); - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc(): null | FetchProcessFunc; - set processFunc(process: null | FetchProcessFunc); - /** - * This function is called on each retry attempt. - */ - get retryFunc(): null | FetchRetryFunc; - set retryFunc(retry: null | FetchRetryFunc); - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url: string); - toString(): string; - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params: FetchThrottleParams): void; - /** - * Resolves to the response by sending the request. - */ - send(): Promise; - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel(): void; - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location: string): FetchRequest; - /** - * Create a new copy of this request. - */ - clone(): FetchRequest; - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig(): void; - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme: string): null | FetchGatewayFunc; - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme: string, func: FetchGatewayFunc): void; - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl: FetchGetUrlFunc): void; - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway(): FetchGatewayFunc; - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc; -} -/** - * The response for a FetchREquest. - */ -export declare class FetchResponse implements Iterable<[key: string, value: string]> { - #private; - toString(): string; - /** - * The response status code. - */ - get statusCode(): number; - /** - * The response status message. - */ - get statusMessage(): string; - /** - * The response headers. All keys are lower-case. - */ - get headers(): Record; - /** - * The response body, or ``null`` if there was no body. - */ - get body(): null | Readonly; - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText(): string; - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson(): any; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - constructor(statusCode: number, statusMessage: string, headers: Readonly>, body: null | Uint8Array, request?: FetchRequest); - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message?: string, error?: Error): FetchResponse; - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message?: string, stall?: number): never; - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Returns true of the response has a body. - */ - hasBody(): this is FetchResponse & { - body: Uint8Array; - }; - /** - * The request made for this response. - */ - get request(): null | FetchRequest; - /** - * Returns true if this response was a success statusCode. - */ - ok(): boolean; - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk(): void; -} -//# sourceMappingURL=fetch.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/fetch.d.ts.map b/lib.esm/utils/fetch.d.ts.map deleted file mode 100644 index 59bbdc142..000000000 --- a/lib.esm/utils/fetch.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,IAAI,GAAG,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC9B,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,KACf,OAAO,CAAC,aAAa,CAAC,CAAC;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AAC,MAAM,EAAE,MAAM,CAAC,CAEpC;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,CAEtC;IAED;;;;;OAKG;IACH,IAAI,QAAQ,IAAI,MAAM,CAcrB;IAED;;;;;OAKG;IACH,IAAI,QAAQ,IAAI,GAAG,CAclB;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAgB1D;IAED,YACC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACzC,IAAI,EAAE,IAAI,GAAG,UAAU,EACvB,OAAO,CAAC,EAAE,YAAY,EAetB;IAED;;;;OAIG;IACH,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,aAAa,CAiB9D;IAED;;;;OAIG;IACH,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAiB1D;IAED;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7B;IAED;;OAEG;IACH,OAAO,IAAI,IAAI,IAAI,aAAa,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAEtD;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,IAAI,GAAG,YAAY,CAEjC;IAED;;OAEG;IACH,EAAE,IAAI,OAAO,CAMZ;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAaf;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/fetch.js b/lib.esm/utils/fetch.js deleted file mode 100644 index 2e5e5ab8e..000000000 --- a/lib.esm/utils/fetch.js +++ /dev/null @@ -1,825 +0,0 @@ -/** - * Explain fetching here... - * - * @_section api/utils/fetching:Fetching Web Content [about-fetch] - */ -import { decodeBase64, encodeBase64 } from "./base64.js"; -import { hexlify } from "./data.js"; -import { assert, assertArgument } from "./errors.js"; -import { defineProperties } from "./properties.js"; -import { toUtf8Bytes, toUtf8String } from "./utf8.js"; -import { getUrl } from "./geturl.js"; -const MAX_ATTEMPTS = 12; -const SLOT_INTERVAL = 250; -// The global FetchGetUrlFunc implementation. -let getUrlFunc = getUrl; -const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i"); -const reIpfs = new RegExp("^ipfs://(ipfs/)?(.*)$", "i"); -// If locked, new Gateways cannot be added -let locked = false; -// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URLs -async function dataGatewayFunc(url, signal) { - try { - const match = url.match(reData); - if (!match) { - throw new Error("invalid data"); - } - return new FetchResponse(200, "OK", { - "content-type": match[1] || "text/plain", - }, match[2] ? decodeBase64(match[3]) : unpercent(match[3])); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid data: URI)", {}, null, new FetchRequest(url)); - } -} -/** - * Returns a [[FetchGatewayFunc]] for fetching content from a standard - * IPFS gateway hosted at %%baseUrl%%. - */ -function getIpfsGatewayFunc(baseUrl) { - async function gatewayIpfs(url, signal) { - try { - const match = url.match(reIpfs); - if (!match) { - throw new Error("invalid link"); - } - return new FetchRequest(`${baseUrl}${match[2]}`); - } - catch (error) { - return new FetchResponse(599, "BAD REQUEST (invalid IPFS URI)", {}, null, new FetchRequest(url)); - } - } - return gatewayIpfs; -} -const Gateways = { - data: dataGatewayFunc, - ipfs: getIpfsGatewayFunc("https://gateway.ipfs.io/ipfs/"), -}; -const fetchSignals = new WeakMap(); -/** - * @_ignore - */ -export class FetchCancelSignal { - #listeners; - #cancelled; - constructor(request) { - this.#listeners = []; - this.#cancelled = false; - fetchSignals.set(request, () => { - if (this.#cancelled) { - return; - } - this.#cancelled = true; - for (const listener of this.#listeners) { - setTimeout(() => { - listener(); - }, 0); - } - this.#listeners = []; - }); - } - addListener(listener) { - assert(!this.#cancelled, "singal already cancelled", "UNSUPPORTED_OPERATION", { - operation: "fetchCancelSignal.addCancelListener", - }); - this.#listeners.push(listener); - } - get cancelled() { - return this.#cancelled; - } - checkSignal() { - assert(!this.cancelled, "cancelled", "CANCELLED", {}); - } -} -// Check the signal, throwing if it is cancelled -function checkSignal(signal) { - if (signal == null) { - throw new Error("missing signal; should not happen"); - } - signal.checkSignal(); - return signal; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -export class FetchRequest { - #allowInsecure; - #gzip; - #headers; - #method; - #timeout; - #url; - #body; - #bodyType; - #creds; - // Hooks - #preflight; - #process; - #retry; - #signal; - #throttle; - /** - * The fetch URI to requrest. - */ - get url() { - return this.#url; - } - set url(url) { - this.#url = String(url); - } - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . - * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrincis ``Content-Type`` is - * set to ``application/json``. - */ - get body() { - if (this.#body == null) { - return null; - } - return new Uint8Array(this.#body); - } - set body(body) { - if (body == null) { - this.#body = undefined; - this.#bodyType = undefined; - } - else if (typeof body === "string") { - this.#body = toUtf8Bytes(body); - this.#bodyType = "text/plain"; - } - else if (body instanceof Uint8Array) { - this.#body = body; - this.#bodyType = "application/octet-stream"; - } - else if (typeof body === "object") { - this.#body = toUtf8Bytes(JSON.stringify(body)); - this.#bodyType = "application/json"; - } - else { - throw new Error("invalid body"); - } - } - /** - * Returns true if the request has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method() { - if (this.#method) { - return this.#method; - } - if (this.hasBody()) { - return "POST"; - } - return "GET"; - } - set method(method) { - if (method == null) { - method = ""; - } - this.#method = String(method).toUpperCase(); - } - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any chnages will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers() { - const headers = Object.assign({}, this.#headers); - if (this.#creds) { - headers["authorization"] = `Basic ${encodeBase64(toUtf8Bytes(this.#creds))}`; - } - if (this.allowGzip) { - headers["accept-encoding"] = "gzip"; - } - if (headers["content-type"] == null && this.#bodyType) { - headers["content-type"] = this.#bodyType; - } - if (this.body) { - headers["content-length"] = String(this.body.length); - } - return headers; - } - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key, value) { - this.#headers[String(key).toLowerCase()] = String(value); - } - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders() { - this.#headers = {}; - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials() { - return this.#creds || null; - } - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username, password) { - assertArgument(!username.match(/:/), "invalid basic authentication username", "username", "[REDACTED]"); - this.#creds = `${username}:${password}`; - } - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip() { - return this.#gzip; - } - set allowGzip(value) { - this.#gzip = !!value; - } - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication() { - return !!this.#allowInsecure; - } - set allowInsecureAuthentication(value) { - this.#allowInsecure = !!value; - } - /** - * The timeout (in milliseconds) to wait for a complere response. - * //(default: 5 minutes)// - */ - get timeout() { - return this.#timeout; - } - set timeout(timeout) { - assertArgument(timeout >= 0, "timeout must be non-zero", "timeout", timeout); - this.#timeout = timeout; - } - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc() { - return this.#preflight || null; - } - set preflightFunc(preflight) { - this.#preflight = preflight; - } - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc() { - return this.#process || null; - } - set processFunc(process) { - this.#process = process; - } - /** - * This function is called on each retry attempt. - */ - get retryFunc() { - return this.#retry || null; - } - set retryFunc(retry) { - this.#retry = retry; - } - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url) { - this.#url = String(url); - this.#allowInsecure = false; - this.#gzip = true; - this.#headers = {}; - this.#method = ""; - this.#timeout = 300000; - this.#throttle = { - slotInterval: SLOT_INTERVAL, - maxAttempts: MAX_ATTEMPTS, - }; - } - toString() { - return ``; - } - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params) { - if (params.slotInterval != null) { - this.#throttle.slotInterval = params.slotInterval; - } - if (params.maxAttempts != null) { - this.#throttle.maxAttempts = params.maxAttempts; - } - } - async #send(attempt, expires, delay, _request, _response) { - if (attempt >= this.#throttle.maxAttempts) { - return _response.makeServerError("exceeded maximum retry limit"); - } - assert(getTime() <= expires, "timeout", "TIMEOUT", { - operation: "request.send", - reason: "timeout", - request: _request, - }); - if (delay > 0) { - await wait(delay); - } - let req = this.clone(); - const scheme = (req.url.split(":")[0] || "").toLowerCase(); - // Process any Gateways - if (scheme in Gateways) { - const result = await Gateways[scheme](req.url, checkSignal(_request.#signal)); - if (result instanceof FetchResponse) { - let response = result; - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Ignore throttling - } - } - return response; - } - req = result; - } - // We have a preflight function; update the request - if (this.preflightFunc) { - req = await this.preflightFunc(req); - } - const resp = await getUrlFunc(req, checkSignal(_request.#signal)); - let response = new FetchResponse(resp.statusCode, resp.statusMessage, resp.headers, resp.body, _request); - if (response.statusCode === 301 || response.statusCode === 302) { - // Redirect - try { - const location = response.headers.location || ""; - return req - .redirect(location) - .#send(attempt + 1, expires, 0, _request, response); - } - catch (error) { } - // Things won't get any better on another attempt; abort - return response; - } - else if (response.statusCode === 429) { - // Throttle - if (this.retryFunc == null || - (await this.retryFunc(req, response, attempt))) { - const retryAfter = response.headers["retry-after"]; - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (typeof retryAfter === "string" && - retryAfter.match(/^[1-9][0-9]*$/)) { - delay = parseInt(retryAfter); - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - if (this.processFunc) { - checkSignal(_request.#signal); - try { - response = await this.processFunc(req, response); - } - catch (error) { - // Something went wrong during processing; throw a 5xx server error - if (error.throttle == null || typeof error.stall !== "number") { - response - .makeServerError("error in post-processing function", error) - .assertOk(); - } - // Throttle - let delay = this.#throttle.slotInterval * - Math.trunc(Math.random() * Math.pow(2, attempt)); - if (error.stall >= 0) { - delay = error.stall; - } - return req - .clone() - .#send(attempt + 1, expires, delay, _request, response); - } - } - return response; - } - /** - * Resolves to the response by sending the request. - */ - send() { - assert(this.#signal == null, "request already sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.send" }); - this.#signal = new FetchCancelSignal(this); - return this.#send(0, getTime() + this.timeout, 0, this, new FetchResponse(0, "", {}, null, this)); - } - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel() { - assert(this.#signal != null, "request has not been sent", "UNSUPPORTED_OPERATION", { operation: "fetchRequest.cancel" }); - const signal = fetchSignals.get(this); - if (!signal) { - throw new Error("missing signal; should not happen"); - } - signal(); - } - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location) { - // Redirection; for now we only support absolute locataions - const current = this.url.split(":")[0].toLowerCase(); - const target = location.split(":")[0].toLowerCase(); - // Don't allow redirecting: - // - non-GET requests - // - downgrading the security (e.g. https => http) - // - to non-HTTP (or non-HTTPS) protocols [this could be relaxed?] - assert(this.method === "GET" && - (current !== "https" || target !== "http") && - location.match(/^https?:/), `unsupported redirect`, "UNSUPPORTED_OPERATION", { - operation: `redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(location)})`, - }); - // Create a copy of this request, with a new URL - const req = new FetchRequest(location); - req.method = "GET"; - req.allowGzip = this.allowGzip; - req.timeout = this.timeout; - req.#headers = Object.assign({}, this.#headers); - if (this.#body) { - req.#body = new Uint8Array(this.#body); - } - req.#bodyType = this.#bodyType; - // Do not forward credentials unless on the same domain; only absolute - //req.allowInsecure = false; - // paths are currently supported; may want a way to specify to forward? - //setStore(req.#props, "creds", getStore(this.#pros, "creds")); - return req; - } - /** - * Create a new copy of this request. - */ - clone() { - const clone = new FetchRequest(this.url); - // Preserve "default method" (i.e. null) - clone.#method = this.#method; - // Preserve "default body" with type, copying the Uint8Array is present - if (this.#body) { - clone.#body = this.#body; - } - clone.#bodyType = this.#bodyType; - // Preserve "default headers" - clone.#headers = Object.assign({}, this.#headers); - // Credentials is readonly, so we copy internally - clone.#creds = this.#creds; - if (this.allowGzip) { - clone.allowGzip = true; - } - clone.timeout = this.timeout; - if (this.allowInsecureAuthentication) { - clone.allowInsecureAuthentication = true; - } - clone.#preflight = this.#preflight; - clone.#process = this.#process; - clone.#retry = this.#retry; - return clone; - } - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig() { - locked = true; - } - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme) { - return Gateways[scheme.toLowerCase()] || null; - } - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme, func) { - scheme = scheme.toLowerCase(); - if (scheme === "http" || scheme === "https") { - throw new Error(`cannot intercept ${scheme}; use registerGetUrl`); - } - if (locked) { - throw new Error("gateways locked"); - } - Gateways[scheme] = func; - } - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl) { - if (locked) { - throw new Error("gateways locked"); - } - getUrlFunc = getUrl; - } - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway() { - return dataGatewayFunc; - } - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl) { - return getIpfsGatewayFunc(baseUrl); - } -} -/** - * The response for a FetchREquest. - */ -export class FetchResponse { - #statusCode; - #statusMessage; - #headers; - #body; - #request; - #error; - toString() { - return ``; - } - /** - * The response status code. - */ - get statusCode() { - return this.#statusCode; - } - /** - * The response status message. - */ - get statusMessage() { - return this.#statusMessage; - } - /** - * The response headers. All keys are lower-case. - */ - get headers() { - return Object.assign({}, this.#headers); - } - /** - * The response body, or ``null`` if there was no body. - */ - get body() { - return this.#body == null ? null : new Uint8Array(this.#body); - } - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText() { - try { - return this.#body == null ? "" : toUtf8String(this.#body); - } - catch (error) { - assert(false, "response body is not valid UTF-8 data", "UNSUPPORTED_OPERATION", { - operation: "bodyText", - info: { response: this }, - }); - } - } - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson() { - try { - return JSON.parse(this.bodyText); - } - catch (error) { - assert(false, "response body is not valid JSON", "UNSUPPORTED_OPERATION", { - operation: "bodyJson", - info: { response: this }, - }); - } - } - [Symbol.iterator]() { - const headers = this.headers; - const keys = Object.keys(headers); - let index = 0; - return { - next: () => { - if (index < keys.length) { - const key = keys[index++]; - return { - value: [key, headers[key]], - done: false, - }; - } - return { value: undefined, done: true }; - }, - }; - } - constructor(statusCode, statusMessage, headers, body, request) { - this.#statusCode = statusCode; - this.#statusMessage = statusMessage; - this.#headers = Object.keys(headers).reduce((accum, k) => { - accum[k.toLowerCase()] = String(headers[k]); - return accum; - }, {}); - this.#body = body == null ? null : new Uint8Array(body); - this.#request = request || null; - this.#error = { message: "" }; - } - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message, error) { - let statusMessage; - if (!message) { - message = `${this.statusCode} ${this.statusMessage}`; - statusMessage = `CLIENT ESCALATED SERVER ERROR (${message})`; - } - else { - statusMessage = `CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${message})`; - } - const response = new FetchResponse(599, statusMessage, this.headers, this.body, this.#request || undefined); - response.#error = { message, error }; - return response; - } - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message, stall) { - if (stall == null) { - stall = -1; - } - else { - assertArgument(Number.isInteger(stall) && stall >= 0, "invalid stall timeout", "stall", stall); - } - const error = new Error(message || "throttling requests"); - defineProperties(error, { stall, throttle: true }); - throw error; - } - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key) { - return this.headers[key.toLowerCase()]; - } - /** - * Returns true of the response has a body. - */ - hasBody() { - return this.#body != null; - } - /** - * The request made for this response. - */ - get request() { - return this.#request; - } - /** - * Returns true if this response was a success statusCode. - */ - ok() { - return (this.#error.message === "" && - this.statusCode >= 200 && - this.statusCode < 300); - } - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk() { - if (this.ok()) { - return; - } - let { message, error } = this.#error; - if (message === "") { - message = `server response ${this.statusCode} ${this.statusMessage}`; - } - assert(false, message, "SERVER_ERROR", { - request: this.request || "unknown request", - response: this, - error, - }); - } -} -function getTime() { - return new Date().getTime(); -} -function unpercent(value) { - return toUtf8Bytes(value.replace(/%([0-9a-f][0-9a-f])/gi, (all, code) => { - return String.fromCharCode(parseInt(code, 16)); - })); -} -function wait(delay) { - return new Promise((resolve) => setTimeout(resolve, delay)); -} -//# sourceMappingURL=fetch.js.map \ No newline at end of file diff --git a/lib.esm/utils/fetch.js.map b/lib.esm/utils/fetch.js.map deleted file mode 100644 index b889879bf..000000000 --- a/lib.esm/utils/fetch.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEtD,OAAO,EAAE,MAAM,EA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;IACf,OAAO,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;AAC7B,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC/B,OAAO,WAAW,CACjB,KAAK,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACpD,OAAO,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAChD,CAAC,CAAC,CACF,CAAC;AACH,CAAC;AAED,SAAS,IAAI,CAAC,KAAa;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;AAC7D,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/fixednumber.d.ts b/lib.esm/utils/fixednumber.d.ts deleted file mode 100644 index c8a28f158..000000000 --- a/lib.esm/utils/fixednumber.d.ts +++ /dev/null @@ -1,252 +0,0 @@ -import type { BigNumberish, BytesLike } from "./index.js"; -/** - * A description of a fixed-point arithmetic field. - * - * When specifying the fixed format, the values override the default of - * a ``fixed128x18``, which implies a signed 128-bit value with 18 - * decimals of precision. - * - * The alias ``fixed`` and ``ufixed`` can be used for ``fixed128x18`` and - * ``ufixed128x18`` respectively. - * - * When a fixed format string begins with a ``u``, it indicates the field - * is unsigned, so any negative values will overflow. The first number - * indicates the bit-width and the second number indicates the decimal - * precision. - * - * When a ``number`` is used for a fixed format, it indicates the number - * of decimal places, and the default width and signed-ness will be used. - * - * The bit-width must be byte aligned and the decimals can be at most 80. - */ -export type FixedFormat = number | string | { - signed?: boolean; - width?: number; - decimals?: number; -}; -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, an value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -export declare class FixedNumber { - #private; - /** - * The specific fixed-point arithmetic field for this value. - */ - readonly format: string; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - readonly _value: string; - /** - * @private - */ - constructor(guard: any, value: bigint, format: any); - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed(): boolean; - /** - * The number of bits available to store the value. - */ - get width(): number; - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals(): number; - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value(): bigint; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other: FixedNumber): FixedNumber; - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%other%% is larger and ``0`` implies - * both are equal. - */ - cmp(other: FixedNumber): number; - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other: FixedNumber): boolean; - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor(): FixedNumber; - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling(): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals?: number): FixedNumber; - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero(): boolean; - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative(): boolean; - /** - * Returns the string representation of %%this%%. - */ - toString(): string; - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat(): number; - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value: BigNumberish, decimals?: number, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value: string, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value: BytesLike, _format?: FixedFormat): FixedNumber; -} -//# sourceMappingURL=fixednumber.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/fixednumber.d.ts.map b/lib.esm/utils/fixednumber.d.ts.map deleted file mode 100644 index 0acb110cb..000000000 --- a/lib.esm/utils/fixednumber.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../../src.ts/utils/f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CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAuCpE;IAED;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAWtE;CACD"} \ No newline at end of file diff --git a/lib.esm/utils/fixednumber.js b/lib.esm/utils/fixednumber.js deleted file mode 100644 index 41c98b512..000000000 --- a/lib.esm/utils/fixednumber.js +++ /dev/null @@ -1,583 +0,0 @@ -var _a; -/** - * About fixed-point math... - * - * @_section: api/utils/fixed-point-math:Fixed-Point Maths [about-fixed-point-math] - */ -import { getBytes } from "./data.js"; -import { assert, assertArgument, assertPrivate } from "./errors.js"; -import { getBigInt, fromTwos, mask, toBigInt } from "./maths.js"; -import { defineProperties } from "./properties.js"; -const BN_N1 = BigInt(-1); -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -const BN_5 = BigInt(5); -const _guard = {}; -// Constant to pull zeros from for multipliers -let Zeros = "0000"; -while (Zeros.length < 80) { - Zeros += Zeros; -} -// Returns a string "1" followed by decimal "0"s -function getTens(decimals) { - let result = Zeros; - while (result.length < decimals) { - result += result; - } - return BigInt("1" + result.substring(0, decimals)); -} -function checkValue(val, format, safeOp) { - const width = BigInt(format.width); - if (format.signed) { - const limit = BN_1 << (width - BN_1); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } - else { - val = -fromTwos(mask(-val, width), width); - } - } - else { - const limit = BN_1 << width; - assert(safeOp == null || (val >= 0 && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, - fault: "overflow", - value: val, - }); - val = (((val % limit) + limit) % limit) & (limit - BN_1); - } - return val; -} -function getFormat(value) { - if (typeof value === "number") { - value = `fixed128x${value}`; - } - let signed = true; - let width = 128; - let decimals = 18; - if (typeof value === "string") { - // Parse the format string - if (value === "fixed") { - // defaults... - } - else if (value === "ufixed") { - signed = false; - } - else { - const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/); - assertArgument(match, "invalid fixed format", "format", value); - signed = match[1] !== "u"; - width = parseInt(match[2]); - decimals = parseInt(match[3]); - } - } - else if (value) { - // Extract the values from the object - const v = value; - const check = (key, type, defaultValue) => { - if (v[key] == null) { - return defaultValue; - } - assertArgument(typeof v[key] === type, "invalid fixed format (" + key + " not " + type + ")", "format." + key, v[key]); - return v[key]; - }; - signed = check("signed", "boolean", signed); - width = check("width", "number", width); - decimals = check("decimals", "number", decimals); - } - assertArgument(width % 8 === 0, "invalid FixedNumber width (not byte aligned)", "format.width", width); - assertArgument(decimals <= 80, "invalid FixedNumber decimals (too large)", "format.decimals", decimals); - const name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals); - return { signed, width, decimals, name }; -} -function toString(val, decimals) { - let negative = ""; - if (val < BN_0) { - negative = "-"; - val *= BN_N1; - } - let str = val.toString(); - // No decimal point for whole values - if (decimals === 0) { - return negative + str; - } - // Pad out to the whole component (including a whole digit) - while (str.length <= decimals) { - str = Zeros + str; - } - // Insert the decimal point - const index = str.length - decimals; - str = str.substring(0, index) + "." + str.substring(index); - // Trim the whole component (leaving at least one 0) - while (str[0] === "0" && str[1] !== ".") { - str = str.substring(1); - } - // Trim the decimal component (leaving at least one 0) - while (str[str.length - 1] === "0" && str[str.length - 2] !== ".") { - str = str.substring(0, str.length - 1); - } - return negative + str; -} -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, an value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -export class FixedNumber { - /** - * The specific fixed-point arithmetic field for this value. - */ - format; - #format; - // The actual value (accounting for decimals) - #val; - // A base-10 value to multiple values by to maintain the magnitude - #tens; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - _value; - // Use this when changing this file to get some typing info, - // but then switch to any to mask the internal type - //constructor(guard: any, value: bigint, format: _FixedFormat) { - /** - * @private - */ - constructor(guard, value, format) { - assertPrivate(guard, _guard, "FixedNumber"); - this.#val = value; - this.#format = format; - const _value = toString(value, format.decimals); - defineProperties(this, { format: format.name, _value }); - this.#tens = getTens(format.decimals); - } - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed() { - return this.#format.signed; - } - /** - * The number of bits available to store the value. - */ - get width() { - return this.#format.width; - } - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals() { - return this.#format.decimals; - } - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value() { - return this.#val; - } - #checkFormat(other) { - assertArgument(this.format === other.format, "incompatible format; use fixedNumber.toFormat", "other", other); - } - #checkValue(val, safeOp) { - /* - const width = BigInt(this.width); - if (this.signed) { - const limit = (BN_1 << (width - BN_1)); - assert(safeOp == null || (val >= -limit && val < limit), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - - if (val > BN_0) { - val = fromTwos(mask(val, width), width); - } else { - val = -fromTwos(mask(-val, width), width); - } - - } else { - const masked = mask(val, width); - assert(safeOp == null || (val >= 0 && val === masked), "overflow", "NUMERIC_FAULT", { - operation: safeOp, fault: "overflow", value: val - }); - val = masked; - } -*/ - val = checkValue(val, this.#format, safeOp); - return new _a(_guard, val, this.#format); - } - #add(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val + o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other) { - return this.#add(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other) { - return this.#add(other, "add"); - } - #sub(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue(this.#val - o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other) { - return this.#sub(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other) { - return this.#sub(other, "sub"); - } - #mul(o, safeOp) { - this.#checkFormat(o); - return this.#checkValue((this.#val * o.#val) / this.#tens, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other) { - return this.#mul(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other) { - return this.#mul(other, "mul"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other) { - this.#checkFormat(other); - const value = this.#val * other.#val; - assert(value % this.#tens === BN_0, "precision lost during signalling mul", "NUMERIC_FAULT", { - operation: "mulSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / this.#tens, "mulSignal"); - } - #div(o, safeOp) { - assert(o.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(o); - return this.#checkValue((this.#val * this.#tens) / o.#val, safeOp); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other) { - return this.#div(other); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other) { - return this.#div(other, "div"); - } - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other) { - assert(other.#val !== BN_0, "division by zero", "NUMERIC_FAULT", { - operation: "div", - fault: "divide-by-zero", - value: this, - }); - this.#checkFormat(other); - const value = this.#val * this.#tens; - assert(value % other.#val === BN_0, "precision lost during signalling div", "NUMERIC_FAULT", { - operation: "divSignal", - fault: "underflow", - value: this, - }); - return this.#checkValue(value / other.#val, "divSignal"); - } - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%other%% is larger and ``0`` implies - * both are equal. - */ - cmp(other) { - let a = this.value, b = other.value; - // Coerce a and b to the same magnitude - const delta = this.decimals - other.decimals; - if (delta > 0) { - b *= getTens(delta); - } - else if (delta < 0) { - a *= getTens(-delta); - } - // Comnpare - if (a < b) { - return -1; - } - if (a > b) { - return -1; - } - return 0; - } - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other) { - return this.cmp(other) === 0; - } - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other) { - return this.cmp(other) < 0; - } - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other) { - return this.cmp(other) <= 0; - } - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other) { - return this.cmp(other) > 0; - } - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other) { - return this.cmp(other) >= 0; - } - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor() { - let val = this.#val; - if (this.#val < BN_0) { - val -= this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "floor"); - } - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling() { - let val = this.#val; - if (this.#val > BN_0) { - val += this.#tens - BN_1; - } - val = (this.#val / this.#tens) * this.#tens; - return this.#checkValue(val, "ceiling"); - } - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals) { - if (decimals == null) { - decimals = 0; - } - // Not enough precision to not already be rounded - if (decimals >= this.decimals) { - return this; - } - const delta = this.decimals - decimals; - const bump = BN_5 * getTens(delta - 1); - let value = this.value + bump; - const tens = getTens(delta); - value = (value / tens) * tens; - checkValue(value, this.#format, "round"); - return new _a(_guard, value, this.#format); - } - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero() { - return this.#val === BN_0; - } - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative() { - return this.#val < BN_0; - } - /** - * Returns the string representation of %%this%%. - */ - toString() { - return this._value; - } - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat() { - return parseFloat(this.toString()); - } - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format) { - return _a.fromString(this.toString(), format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value, decimals, _format) { - if (decimals == null) { - decimals = 0; - } - const format = getFormat(_format); - let value = getBigInt(_value, "value"); - const delta = decimals - format.decimals; - if (delta > 0) { - const tens = getTens(delta); - assert(value % tens === BN_0, "value loses precision for format", "NUMERIC_FAULT", { - operation: "fromValue", - fault: "underflow", - value: _value, - }); - value /= tens; - } - else if (delta < 0) { - value *= getTens(-delta); - } - checkValue(value, format, "fromValue"); - return new _a(_guard, value, format); - } - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value, _format) { - const match = _value.match(/^(-?)([0-9]*)\.?([0-9]*)$/); - assertArgument(match && match[2].length + match[3].length > 0, "invalid FixedNumber string value", "value", _value); - const format = getFormat(_format); - let whole = match[2] || "0", decimal = match[3] || ""; - // Pad out the decimals - while (decimal.length < format.decimals) { - decimal += Zeros; - } - // Check precision is safe - assert(decimal.substring(format.decimals).match(/^0*$/), "too many decimals for format", "NUMERIC_FAULT", { - operation: "fromString", - fault: "underflow", - value: _value, - }); - // Remove extra padding - decimal = decimal.substring(0, format.decimals); - const value = BigInt(match[1] + whole + decimal); - checkValue(value, format, "fromString"); - return new _a(_guard, value, format); - } - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value, _format) { - let value = toBigInt(getBytes(_value, "value")); - const format = getFormat(_format); - if (format.signed) { - value = fromTwos(value, format.width); - } - checkValue(value, format, "fromBytes"); - return new _a(_guard, value, format); - } -} -_a = FixedNumber; -//const f1 = FixedNumber.fromString("12.56", "fixed16x2"); -//const f2 = FixedNumber.fromString("0.3", "fixed16x2"); -//console.log(f1.divSignal(f2)); -//const BUMP = FixedNumber.from("0.5"); -//# sourceMappingURL=fixednumber.js.map \ No newline at end of file diff --git a/lib.esm/utils/fixednumber.js.map b/lib.esm/utils/fixednumber.js.map deleted file mode 100644 index 0fe155e05..000000000 --- a/lib.esm/utils/fixednumber.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixednumber.js","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,8CAA8C;AAC9C,IAAI,KAAK,GAAG,MAAM,CAAC;AACnB,OAAO,KAAK,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;IAC1B,KAAK,IAAI,KAAK,CAAC;AAChB,CAAC;AAED,gDAAgD;AAChD,SAAS,OAAO,CAAC,QAAgB;IAChC,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,OAAO,MAAM,CAAC,MAAM,GAAG,QAAQ,EAAE,CAAC;QACjC,MAAM,IAAI,MAAM,CAAC;IAClB,CAAC;IACD,OAAO,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpD,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C1B,MAAM,CACL,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAChD,8BAA8B,EAC9B,eAAe,EACf;YACC,SAAS,EAAE,YAAY;YACvB,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE,MAAM;SACb,CACD,CAAC;QAEF,uBAAuB;QACvB,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAEhD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC;QAEjD,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QAExC,OAAO,IAAI,EAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAiB,EAAE,OAAqB;QACxD,IAAI,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QAElC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YACnB,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QACvC,CAAC;QAED,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;QAEvC,OAAO,IAAI,EAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;CACD;;AAED,0DAA0D;AAC1D,wDAAwD;AACxD,gCAAgC;AAChC,uCAAuC"} \ No newline at end of file diff --git a/lib.esm/utils/geturl-browser.d.ts b/lib.esm/utils/geturl-browser.d.ts deleted file mode 100644 index 29cebe088..000000000 --- a/lib.esm/utils/geturl-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -export declare function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/geturl-browser.d.ts.map b/lib.esm/utils/geturl-browser.d.ts.map deleted file mode 100644 index 3190d62cc..000000000 --- a/lib.esm/utils/geturl-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAIpB,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA0DrC"} \ No newline at end of file diff --git a/lib.esm/utils/geturl-browser.js b/lib.esm/utils/geturl-browser.js deleted file mode 100644 index ce5379c0a..000000000 --- a/lib.esm/utils/geturl-browser.js +++ /dev/null @@ -1,47 +0,0 @@ -import { assert } from "./errors.js"; -// @TODO: timeout is completely ignored; start a Promise.any with a reject? -// @ts-ignore -export async function getUrl(req, _signal) { - const protocol = req.url.split(":")[0].toLowerCase(); - assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request", - }); - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request", - }); - let signal = undefined; - if (_signal) { - const controller = new AbortController(); - signal = controller.signal; - _signal.addListener(() => { - controller.abort(); - }); - } - const init = { - method: req.method, - headers: new Headers(Array.from(req)), - body: req.body || undefined, - signal, - }; - try { - const resp = await fetch(req.url, init); - const headers = {}; - resp.headers.forEach((value, key) => { - headers[key.toLowerCase()] = value; - }); - const respBody = await resp.arrayBuffer(); - const body = respBody == null ? null : new Uint8Array(respBody); - return { - statusCode: resp.status, - statusMessage: resp.statusText, - headers, - body, - }; - } - catch (error) { - console.log({ error }); - return undefined; - } -} -//# sourceMappingURL=geturl-browser.js.map \ No newline at end of file diff --git a/lib.esm/utils/geturl-browser.js.map b/lib.esm/utils/geturl-browser.js.map deleted file mode 100644 index 8973d741b..000000000 --- a/lib.esm/utils/geturl-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl-browser.js","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQrC,2EAA2E;AAC3E,aAAa;AACb,MAAM,CAAC,KAAK,UAAU,MAAM,CAC3B,GAAiB,EACjB,OAA2B;IAE3B,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAErD,MAAM,CACL,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,OAAO,EAC3C,wBAAwB,QAAQ,EAAE,EAClC,uBAAuB,EACvB;QACC,IAAI,EAAE,EAAE,QAAQ,EAAE;QAClB,SAAS,EAAE,SAAS;KACpB,CACD,CAAC;IAEF,MAAM,CACL,QAAQ,KAAK,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,2BAA2B,EAC3E,6CAA6C,EAC7C,uBAAuB,EACvB;QACC,SAAS,EAAE,SAAS;KACpB,CACD,CAAC;IAEF,IAAI,MAAM,GAA4B,SAAS,CAAC;IAChD,IAAI,OAAO,EAAE,CAAC;QACb,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC3B,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE;YACxB,UAAU,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG;QACZ,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,OAAO,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,SAAS;QAC3B,MAAM;KACN,CAAC;IACF,IAAI,CAAC;QACJ,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAExC,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YACnC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;QAEhE,OAAO;YACN,UAAU,EAAE,IAAI,CAAC,MAAM;YACvB,aAAa,EAAE,IAAI,CAAC,UAAU;YAC9B,OAAO;YACP,IAAI;SACJ,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACvB,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/geturl.d.ts b/lib.esm/utils/geturl.d.ts deleted file mode 100644 index a4252134f..000000000 --- a/lib.esm/utils/geturl.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -/** - * @_ignore: - */ -export declare function getUrl(req: FetchRequest, signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/geturl.d.ts.map b/lib.esm/utils/geturl.d.ts.map deleted file mode 100644 index 7728357a3..000000000 --- a/lib.esm/utils/geturl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,cAAc,CAAC,CAqGzB"} \ No newline at end of file diff --git a/lib.esm/utils/geturl.js b/lib.esm/utils/geturl.js deleted file mode 100644 index 075e332d0..000000000 --- a/lib.esm/utils/geturl.js +++ /dev/null @@ -1,80 +0,0 @@ -import http from "http"; -import https from "https"; -import { gunzipSync } from "zlib"; -import { assert } from "./errors.js"; -import { getBytes } from "./data.js"; -/** - * @_ignore: - */ -export async function getUrl(req, signal) { - const protocol = req.url.split(":")[0].toLowerCase(); - assert(protocol === "http" || protocol === "https", `unsupported protocol ${protocol}`, "UNSUPPORTED_OPERATION", { - info: { protocol }, - operation: "request", - }); - assert(protocol === "https" || !req.credentials || req.allowInsecureAuthentication, "insecure authorized connections unsupported", "UNSUPPORTED_OPERATION", { - operation: "request", - }); - const method = req.method; - const headers = Object.assign({}, req.headers); - const options = { method, headers }; - const request = (protocol === "http" ? http : https).request(req.url, options); - request.setTimeout(req.timeout); - const body = req.body; - if (body) { - request.write(Buffer.from(body)); - } - request.end(); - return new Promise((resolve, reject) => { - // @TODO: Node 15 added AbortSignal; once we drop support for - // Node14, we can add that in here too - request.once("response", (resp) => { - const statusCode = resp.statusCode || 0; - const statusMessage = resp.statusMessage || ""; - const headers = Object.keys(resp.headers || {}).reduce((accum, name) => { - let value = resp.headers[name] || ""; - if (Array.isArray(value)) { - value = value.join(", "); - } - accum[name] = value; - return accum; - }, {}); - let body = null; - //resp.setEncoding("utf8"); - resp.on("data", (chunk) => { - if (signal) { - try { - signal.checkSignal(); - } - catch (error) { - return reject(error); - } - } - if (body == null) { - body = chunk; - } - else { - const newBody = new Uint8Array(body.length + chunk.length); - newBody.set(body, 0); - newBody.set(chunk, body.length); - body = newBody; - } - }); - resp.on("end", () => { - if (headers["content-encoding"] === "gzip" && body) { - body = getBytes(gunzipSync(body)); - } - resolve({ statusCode, statusMessage, headers, body }); - }); - resp.on("error", (error) => { - //@TODO: Should this just return nornal response with a server error? - error.response = { statusCode, statusMessage, headers, body }; - reject(error); - }); - }); - request.on("error", (error) => { - reject(error); - }); - }); -} -//# sourceMappingURL=geturl.js.map \ No newline at end of file diff --git a/lib.esm/utils/geturl.js.map b/lib.esm/utils/geturl.js.map deleted file mode 100644 index e5932b8b0..000000000 --- a/lib.esm/utils/geturl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl.js","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAQrC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC3B,GAAiB,EACjB,MAA0B;IAE1B,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAErD,MAAM,CACL,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,OAAO,EAC3C,wBAAwB,QAAQ,EAAE,EACl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MAAM,IAAI,IAAI,EAAE,CAAC;oBACpD,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;gBACnC,CAAC;gBAED,OAAO,CAAC,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACvD,CAAC,CAAC,CAAC;YAEH,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBAC1B,qEAAqE;gBAC/D,KAAM,CAAC,QAAQ,GAAG,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gBACrE,MAAM,CAAC,KAAK,CAAC,CAAC;YACf,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC7B,MAAM,CAAC,KAAK,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/index.d.ts b/lib.esm/utils/index.d.ts deleted file mode 100644 index 40183df8b..000000000 --- a/lib.esm/utils/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * There are many simple utilities required to interact with - * Core and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ -export { decodeBase58, encodeBase58 } from "./base58.js"; -export { decodeBase64, encodeBase64 } from "./base64.js"; -export { getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice, stripZerosLeft, zeroPadValue, zeroPadBytes, arrayify, hexConcat, } from "./data.js"; -export { isCallException, isError, assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError, } from "./errors.js"; -export { EventPayload } from "./events.js"; -export { FetchRequest, FetchResponse, FetchCancelSignal } from "./fetch.js"; -export { FixedNumber } from "./fixednumber.js"; -export { fromTwos, toTwos, mask, getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity, } from "./maths.js"; -export { resolveProperties, defineProperties } from "./properties.js"; -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -export { formatXCB, parseXCB, formatUnits, parseUnits } from "./units.js"; -export { toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, } from "./utf8.js"; -export { uuidV4 } from "./uuid.js"; -export type { BytesLike } from "./data.js"; -export type { ErrorCode, CoreBCError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CallExceptionAction, CallExceptionTransaction, CodedCoreBCError, } from "./errors.js"; -export type { EventEmitterable, Listener } from "./events.js"; -export type { GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, } from "./fetch.js"; -export type { FixedFormat } from "./fixednumber.js"; -export type { BigNumberish, Numeric } from "./maths.js"; -export type { RlpStructuredData } from "./rlp.js"; -export type { Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, } from "./utf8.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/index.d.ts.map b/lib.esm/utils/index.d.ts.map deleted file mode 100644 index 2be8f026a..000000000 --- a/lib.esm/utils/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA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EAClB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE9D,YAAY,EACX,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,eAAe,GACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAExD,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,YAAY,EACX,aAAa,EACb,wBAAwB,EACxB,eAAe,GACf,MAAM,WAAW,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/index.js b/lib.esm/utils/index.js deleted file mode 100644 index 00f5ed0b6..000000000 --- a/lib.esm/utils/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * There are many simple utilities required to interact with - * Core and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ -export { decodeBase58, encodeBase58 } from "./base58.js"; -export { decodeBase64, encodeBase64 } from "./base64.js"; -export { getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice, stripZerosLeft, zeroPadValue, zeroPadBytes, arrayify, hexConcat, } from "./data.js"; -export { isCallException, isError, assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError, } from "./errors.js"; -export { EventPayload } from "./events.js"; -export { FetchRequest, FetchResponse, FetchCancelSignal } from "./fetch.js"; -export { FixedNumber } from "./fixednumber.js"; -export { fromTwos, toTwos, mask, getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity, } from "./maths.js"; -export { resolveProperties, defineProperties } from "./properties.js"; -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -export { formatXCB, parseXCB, formatUnits, parseUnits } from "./units.js"; -export { toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, } from "./utf8.js"; -export { uuidV4 } from "./uuid.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/utils/index.js.map b/lib.esm/utils/index.js.map deleted file mode 100644 index 548d8698a..000000000 --- a/lib.esm/utils/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,GACT,MAAM,WAAW,CAAC;AAEnB,OAAO,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,SAAS,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,GACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE1E,OAAO,EACN,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,cAAc,GACd,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/maths.d.ts b/lib.esm/utils/maths.d.ts deleted file mode 100644 index e1fd19522..000000000 --- a/lib.esm/utils/maths.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Any type that can be used where a numeric value is needed. - */ -export type Numeric = number | bigint; -/** - * Any type that can be used where a big number is needed. - */ -export type BigNumberish = string | Numeric; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -export declare function fromTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -export declare function toTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -export declare function mask(_value: BigNumberish, _bits: Numeric): bigint; -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getBigInt(value: BigNumberish, name?: string): bigint; -export declare function getUint(value: BigNumberish, name?: string): bigint; -export declare function toBigInt(value: BigNumberish | Uint8Array): bigint; -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getNumber(value: BigNumberish, name?: string): number; -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -export declare function toNumber(value: BigNumberish | Uint8Array): number; -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -export declare function toBeHex(_value: BigNumberish, _width?: Numeric): string; -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -export declare function toBeArray(_value: BigNumberish): Uint8Array; -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -export declare function toQuantity(value: BytesLike | BigNumberish): string; -//# sourceMappingURL=maths.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/maths.d.ts.map b/lib.esm/utils/maths.d.ts.map deleted file mode 100644 index 375586bed..000000000 --- a/lib.esm/utils/maths.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maths.d.ts","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAU5C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAiBtE;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAwBpE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAIjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAqCpE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAQlE;AAQD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAWjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAwCpE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAEjE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CA8BtE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAmB1D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAWlE"} \ No newline at end of file diff --git a/lib.esm/utils/maths.js b/lib.esm/utils/maths.js deleted file mode 100644 index 0c99f2808..000000000 --- a/lib.esm/utils/maths.js +++ /dev/null @@ -1,220 +0,0 @@ -/** - * Some mathematic operations. - * - * @_subsection: api/utils:Math Helpers [about-maths] - */ -import { hexlify, isBytesLike } from "./data.js"; -import { assert, assertArgument } from "./errors.js"; -const BN_0 = BigInt(0); -const BN_1 = BigInt(1); -//const BN_Max256 = (BN_1 << BigInt(256)) - BN_1; -// IEEE 754 support 53-bits of mantissa -const maxValue = 0x1fffffffffffff; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -export function fromTwos(_value, _width) { - const value = getUint(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - assert(value >> width === BN_0, "overflow", "NUMERIC_FAULT", { - operation: "fromTwos", - fault: "overflow", - value: _value, - }); - // Top bit set; treat as a negative value - if (value >> (width - BN_1)) { - const mask = (BN_1 << width) - BN_1; - return -((~value & mask) + BN_1); - } - return value; -} -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -export function toTwos(_value, _width) { - let value = getBigInt(_value, "value"); - const width = BigInt(getNumber(_width, "width")); - const limit = BN_1 << (width - BN_1); - if (value < BN_0) { - value = -value; - assert(value <= limit, "too low", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - const mask = (BN_1 << width) - BN_1; - return (~value & mask) + BN_1; - } - else { - assert(value < limit, "too high", "NUMERIC_FAULT", { - operation: "toTwos", - fault: "overflow", - value: _value, - }); - } - return value; -} -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -export function mask(_value, _bits) { - const value = getUint(_value, "value"); - const bits = BigInt(getNumber(_bits, "bits")); - return value & ((BN_1 << bits) - BN_1); -} -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -export function getBigInt(value, name) { - switch (typeof value) { - case "bigint": - return value; - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return BigInt(value); - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - if (value[0] === "-" && value[1] !== "-") { - return -BigInt(value.substring(1)); - } - return BigInt(value); - } - catch (e) { - assertArgument(false, `invalid BigNumberish string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid BigNumberish value", name || "value", value); -} -export function getUint(value, name) { - const result = getBigInt(value, name); - assert(result >= BN_0, "unsigned value cannot be negative", "NUMERIC_FAULT", { - fault: "overflow", - operation: "getUint", - value, - }); - return result; -} -const Nibbles = "0123456789abcdef"; -/* - * Converts %%value%% to a BigInt. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. - */ -export function toBigInt(value) { - if (value instanceof Uint8Array) { - let result = "0x0"; - for (const v of value) { - result += Nibbles[v >> 4]; - result += Nibbles[v & 0x0f]; - } - return BigInt(result); - } - return getBigInt(value); -} -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -export function getNumber(value, name) { - switch (typeof value) { - case "bigint": - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return Number(value); - case "number": - assertArgument(Number.isInteger(value), "underflow", name || "value", value); - assertArgument(value >= -maxValue && value <= maxValue, "overflow", name || "value", value); - return value; - case "string": - try { - if (value === "") { - throw new Error("empty string"); - } - return getNumber(BigInt(value), name); - } - catch (e) { - assertArgument(false, `invalid numeric string: ${e.message}`, name || "value", value); - } - } - assertArgument(false, "invalid numeric value", name || "value", value); -} -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -export function toNumber(value) { - return getNumber(toBigInt(value)); -} -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -export function toBeHex(_value, _width) { - const value = getUint(_value, "value"); - let result = value.toString(16); - if (_width == null) { - // Ensure the value is of even length - if (result.length % 2) { - result = "0" + result; - } - } - else { - const width = getNumber(_width, "width"); - assert(width * 2 >= result.length, `value exceeds width (${width} bits)`, "NUMERIC_FAULT", { - operation: "toBeHex", - fault: "overflow", - value: _value, - }); - // Pad the value to the required width - while (result.length < width * 2) { - result = "0" + result; - } - } - return "0x" + result; -} -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -export function toBeArray(_value) { - const value = getUint(_value, "value"); - if (value === BN_0) { - return new Uint8Array([]); - } - let hex = value.toString(16); - if (hex.length % 2) { - hex = "0" + hex; - } - const result = new Uint8Array(hex.length / 2); - for (let i = 0; i < result.length; i++) { - const offset = i * 2; - result[i] = parseInt(hex.substring(offset, offset + 2), 16); - } - return result; -} -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -export function toQuantity(value) { - let result = hexlify(isBytesLike(value) ? value : toBeArray(value)).substring(2); - while (result.startsWith("0")) { - result = result.substring(1); - } - if (result === "") { - result = "0"; - } - return "0x" + result; -} -//# sourceMappingURL=maths.js.map \ No newline at end of file diff --git a/lib.esm/utils/maths.js.map b/lib.esm/utils/maths.js.map deleted file mode 100644 index c635e9327..000000000 --- a/lib.esm/utils/maths.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maths.js","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAcrD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AACvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;AAEvB,iDAAiD;AAEjD,uCAAuC;AACvC,MAAM,QAAQ,GAAG,gBAAgB,CAAC;AAElC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAoB,EAAE,MAAe;IAC7D,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAEjD,MAAM,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,EAAE,UAAU,EAAE,eAAe,EAAE;QAC5D,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,MAAM;KACb,CAAC,CAAC;IAEH,yCAAyC;IACzC,IAAI,KAAK,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,CAAC,I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AC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAC5E,CAAC,CACD,CAAC;IACF,OAAO,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QACnB,MAAM,GAAG,GAAG,CAAC;IACd,CAAC;IACD,OAAO,IAAI,GAAG,MAAM,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/properties.d.ts b/lib.esm/utils/properties.d.ts deleted file mode 100644 index f7871cc89..000000000 --- a/lib.esm/utils/properties.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -export declare function resolveProperties(value: { - [P in keyof T]: T[P] | Promise; -}): Promise; -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -export declare function defineProperties(target: T, values: { - [K in keyof T]?: T[K]; -}, types?: { - [K in keyof T]?: string; -}): void; -export declare function checkProperties(object: any, properties: { - [name: string]: boolean; -}): void; -//# sourceMappingURL=properties.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/properties.d.ts.map b/lib.esm/utils/properties.d.ts.map deleted file mode 100644 index b675427ea..000000000 --- a/lib.esm/utils/properties.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAChD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACjC,KAAK,CAAC,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAAE,GACjC,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC9B,MAAM,EAAE,GAAG,EACX,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACrC,IAAI,CAcN"} \ No newline at end of file diff --git a/lib.esm/utils/properties.js b/lib.esm/utils/properties.js deleted file mode 100644 index c5b23d630..000000000 --- a/lib.esm/utils/properties.js +++ /dev/null @@ -1,70 +0,0 @@ -import { Logger } from "../logger/logger.js"; -/** - * Property helper functions. - * - * @_subsection api/utils:Properties [about-properties] - */ -const logger = new Logger("utils/properties/0.0.1"); -function checkType(value, type, name) { - const types = type.split("|").map((t) => t.trim()); - for (let i = 0; i < types.length; i++) { - switch (type) { - case "any": - return; - case "bigint": - case "boolean": - case "number": - case "string": - if (typeof value === type) { - return; - } - } - } - const error = new Error(`invalid value for type ${type}`); - error.code = "INVALID_ARGUMENT"; - error.argument = `value.${name}`; - error.value = value; - throw error; -} -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -export async function resolveProperties(value) { - const keys = Object.keys(value); - const results = await Promise.all(keys.map((k) => Promise.resolve(value[k]))); - return results.reduce((accum, v, index) => { - accum[keys[index]] = v; - return accum; - }, {}); -} -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -export function defineProperties(target, values, types) { - for (let key in values) { - let value = values[key]; - const type = types ? types[key] : null; - if (type) { - checkType(value, type, key); - } - Object.defineProperty(target, key, { - enumerable: true, - value, - writable: false, - }); - } -} -export function checkProperties(object, properties) { - if (!object || typeof object !== "object") { - logger.throwArgumentError("invalid object", "object", object); - } - Object.keys(object).forEach((key) => { - if (!properties[key]) { - logger.throwArgumentError("invalid object key - " + key, "transaction:" + key, object); - } - }); -} -//# sourceMappingURL=properties.js.map \ No newline at end of file diff --git a/lib.esm/utils/properties.js.map b/lib.esm/utils/properties.js.map deleted file mode 100644 index 652c693ab..000000000 --- a/lib.esm/utils/properties.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAEpD,SAAS,SAAS,CAAC,KAAU,EAAE,IAAY,EAAE,IAAY;IACxD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,QAAQ,IAAI,EAAE,CAAC;YACd,KAAK,KAAK;gBACT,OAAO;YACR,KAAK,QAAQ,CAAC;YACd,KAAK,SAAS,CAAC;YACf,KAAK,QAAQ,CAAC;YACd,KAAK,QAAQ;gBACZ,IAAI,OAAO,KAAK,KAAK,IAAI,EAAE,CAAC;oBAC3B,OAAO;gBACR,CAAC;QACH,CAAC;IACF,CAAC;IAED,MAAM,KAAK,GAAQ,IAAI,KAAK,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;IAC/D,KAAK,CAAC,IAAI,GAAG,kBAAkB,CAAC;IAChC,KAAK,CAAC,QAAQ,GAAG,SAAS,IAAI,EAAE,CAAC;IACjC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IAEpB,MAAM,KAAK,CAAC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BAAgB,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,kBAAkB,CACxB,uBAAuB,GAAG,GAAG,EAC7B,cAAc,GAAG,GAAG,EACpB,MAAM,CACN,CAAC;QACH,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/rlp-decode.d.ts b/lib.esm/utils/rlp-decode.d.ts deleted file mode 100644 index b77b08b9c..000000000 --- a/lib.esm/utils/rlp-decode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BytesLike, RlpStructuredData } from "./index.js"; -/** - * Decodes %%data%% into the structured data it represents. - */ -export declare function decodeRlp(_data: BytesLike): RlpStructuredData; -//# sourceMappingURL=rlp-decode.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/rlp-decode.d.ts.map b/lib.esm/utils/rlp-decode.d.ts.map deleted file mode 100644 index b82126ab8..000000000 --- a/lib.esm/utils/rlp-decode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-decode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAyH/D;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB,CAU7D"} \ No newline at end of file diff --git a/lib.esm/utils/rlp-decode.js b/lib.esm/utils/rlp-decode.js deleted file mode 100644 index 9a842bb43..000000000 --- a/lib.esm/utils/rlp-decode.js +++ /dev/null @@ -1,84 +0,0 @@ -import { hexlify } from "./data.js"; -import { assert, assertArgument } from "./errors.js"; -import { getBytes } from "./data.js"; -function hexlifyByte(value) { - let result = value.toString(16); - while (result.length < 2) { - result = "0" + result; - } - return "0x" + result; -} -function unarrayifyInteger(data, offset, length) { - let result = 0; - for (let i = 0; i < length; i++) { - result = result * 256 + data[offset + i]; - } - return result; -} -function _decodeChildren(data, offset, childOffset, length) { - const result = []; - while (childOffset < offset + 1 + length) { - const decoded = _decode(data, childOffset); - result.push(decoded.result); - childOffset += decoded.consumed; - assert(childOffset <= offset + 1 + length, "child data too short", "BUFFER_OVERRUN", { - buffer: data, - length, - offset, - }); - } - return { consumed: 1 + length, result: result }; -} -// returns { consumed: number, result: Object } -function _decode(data, offset) { - assert(data.length !== 0, "data too short", "BUFFER_OVERRUN", { - buffer: data, - length: 0, - offset: 1, - }); - const checkOffset = (offset) => { - assert(offset <= data.length, "data short segment too short", "BUFFER_OVERRUN", { - buffer: data, - length: data.length, - offset, - }); - }; - // Array with extra length prefix - if (data[offset] >= 0xf8) { - const lengthLength = data[offset] - 0xf7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length); - } - else if (data[offset] >= 0xc0) { - const length = data[offset] - 0xc0; - checkOffset(offset + 1 + length); - return _decodeChildren(data, offset, offset + 1, length); - } - else if (data[offset] >= 0xb8) { - const lengthLength = data[offset] - 0xb7; - checkOffset(offset + 1 + lengthLength); - const length = unarrayifyInteger(data, offset + 1, lengthLength); - checkOffset(offset + 1 + lengthLength + length); - const result = hexlify(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length)); - return { consumed: 1 + lengthLength + length, result: result }; - } - else if (data[offset] >= 0x80) { - const length = data[offset] - 0x80; - checkOffset(offset + 1 + length); - const result = hexlify(data.slice(offset + 1, offset + 1 + length)); - return { consumed: 1 + length, result: result }; - } - return { consumed: 1, result: hexlifyByte(data[offset]) }; -} -/** - * Decodes %%data%% into the structured data it represents. - */ -export function decodeRlp(_data) { - const data = getBytes(_data, "data"); - const decoded = _decode(data, 0); - assertArgument(decoded.consumed === data.length, "unexpected junk after rlp payload", "data", _data); - return decoded.result; -} -//# sourceMappingURL=rlp-decode.js.map \ No newline at end of file diff --git a/lib.esm/utils/rlp-decode.js.map b/lib.esm/utils/rlp-decode.js.map deleted file mode 100644 index 330a628c4..000000000 --- a/lib.esm/utils/rlp-decode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-decode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,SAAS,WAAW,CAAC,KAAa;IACjC,IAAI,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAChC,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC;IACvB,CAAC;IACD,OAAO,IAAI,GAAG,MAAM,CAAC;AACtB,CAAC;AAED,SAAS,iBAAiB,CACzB,IAAgB,EAChB,MAAc,EACd,MAAc;IAEd,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACjC,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAOD,SAAS,eAAe,CACvB,IAAgB,EAChB,MAAc,EACd,WAAmB,EACnB,MAAc;IAEd,MAAM,MAAM,GAAQ,EAAE,CAAC;IAEvB,OAAO,WAAW,GAAG,MAAM,GAAG,CAAC,GAAG,MAAM,EAAE,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CAAC,GAAG,MAAM,CAAC,CAAC;QAEjC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QACpE,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjD,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,KAAgB;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjC,cAAc,CACb,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,MAAM,EAChC,mCAAmC,EACnC,MAAM,EACN,KAAK,CACL,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,CAAC;AACvB,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/rlp-encode.d.ts b/lib.esm/utils/rlp-encode.d.ts deleted file mode 100644 index 9c3d024ac..000000000 --- a/lib.esm/utils/rlp-encode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RlpStructuredData } from "./rlp.js"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -export declare function encodeRlp(object: RlpStructuredData): string; -//# sourceMappingURL=rlp-encode.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/rlp-encode.d.ts.map b/lib.esm/utils/rlp-encode.d.ts.map deleted file mode 100644 index 3fa6ef0ba..000000000 --- a/lib.esm/utils/rlp-encode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-encode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAgDlD;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAO3D"} \ No newline at end of file diff --git a/lib.esm/utils/rlp-encode.js b/lib.esm/utils/rlp-encode.js deleted file mode 100644 index a4e938225..000000000 --- a/lib.esm/utils/rlp-encode.js +++ /dev/null @@ -1,48 +0,0 @@ -import { getBytes } from "./data.js"; -function arrayifyInteger(value) { - const result = []; - while (value) { - result.unshift(value & 0xff); - value >>= 8; - } - return result; -} -function _encode(object) { - if (Array.isArray(object)) { - let payload = []; - object.forEach(function (child) { - payload = payload.concat(_encode(child)); - }); - if (payload.length <= 55) { - payload.unshift(0xc0 + payload.length); - return payload; - } - const length = arrayifyInteger(payload.length); - length.unshift(0xf7 + length.length); - return length.concat(payload); - } - const data = Array.prototype.slice.call(getBytes(object, "object")); - if (data.length === 1 && data[0] <= 0x7f) { - return data; - } - else if (data.length <= 55) { - data.unshift(0x80 + data.length); - return data; - } - const length = arrayifyInteger(data.length); - length.unshift(0xb7 + length.length); - return length.concat(data); -} -const nibbles = "0123456789abcdef"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -export function encodeRlp(object) { - let result = "0x"; - for (const v of _encode(object)) { - result += nibbles[v >> 4]; - result += nibbles[v & 0xf]; - } - return result; -} -//# sourceMappingURL=rlp-encode.js.map \ No newline at end of file diff --git a/lib.esm/utils/rlp-encode.js.map b/lib.esm/utils/rlp-encode.js.map deleted file mode 100644 index 5fb0749f0..000000000 --- a/lib.esm/utils/rlp-encode.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-encode.js","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,SAAS,eAAe,CAAC,KAAa;IACrC,MAAM,MA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AI,CAAC;IACb,CAAC;IAED,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAErC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,OAAO,GAAG,kBAAkB,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,MAAyB;IAClD,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1B,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAC5B,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/rlp.d.ts b/lib.esm/utils/rlp.d.ts deleted file mode 100644 index 6ef450115..000000000 --- a/lib.esm/utils/rlp.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The [[link-rlp]] (RLP) encoding is used throughout Core - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -/** - * An RLP-encoded structure. - */ -export type RlpStructuredData = string | Array; -//# sourceMappingURL=rlp.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/rlp.d.ts.map b/lib.esm/utils/rlp.d.ts.map deleted file mode 100644 index c5043abd3..000000000 --- a/lib.esm/utils/rlp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/rlp.js b/lib.esm/utils/rlp.js deleted file mode 100644 index 35543b4a9..000000000 --- a/lib.esm/utils/rlp.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * The [[link-rlp]] (RLP) encoding is used throughout Core - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -//# sourceMappingURL=rlp.js.map \ No newline at end of file diff --git a/lib.esm/utils/rlp.js.map b/lib.esm/utils/rlp.js.map deleted file mode 100644 index 6ad8eda8d..000000000 --- a/lib.esm/utils/rlp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.js","sourceRoot":"","sources":["../../src.ts/utils/rlp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/units.d.ts b/lib.esm/utils/units.d.ts deleted file mode 100644 index dfb7a32a6..000000000 --- a/lib.esm/utils/units.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { BigNumberish, Numeric } from "../utils/index.js"; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit - * - */ -export declare function formatUnits(value: BigNumberish, unit?: string | Numeric): string; -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit. - */ -export declare const scientificToDecimal: (num: string | number) => string | number; -export declare const trimDecimals: (n: string, decimals?: number) => string; -export declare function parseUnits(value: string, unit?: string | Numeric): bigint; -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -export declare function formatXCB(ore: BigNumberish): string; -/** - * Converts the //decimal string// %%xcb%% to a BigInt, using 18 - * decimal places. - */ -export declare function parseXCB(xcb: string): bigint; -//# sourceMappingURL=units.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/units.d.ts.map b/lib.esm/utils/units.d.ts.map deleted file mode 100644 index fef9d60bc..000000000 --- a/lib.esm/utils/units.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,YAAY,EACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GACrB,MAAM,CAWR;AAED;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,QAAS,MAAM,GAAG,MAAM,oBA6CvD,CAAC;AACF,eAAO,MAAM,YAAY,MAAO,MAAM,8BAQrC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAsBzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"} \ No newline at end of file diff --git a/lib.esm/utils/units.js b/lib.esm/utils/units.js deleted file mode 100644 index a4b26e5d7..000000000 --- a/lib.esm/utils/units.js +++ /dev/null @@ -1,151 +0,0 @@ -/** - * Most interactions with Core requires integer values, which use - * the smallest magnitude unit. - * - * For example, imagine dealing with dollars and cents. Since dollars - * are divisible, non-integer values are possible, such as ``$10.77``. - * By using the smallest indivisible unit (i.e. cents), the value can - * be kept as the integer ``1077``. - * - * When receiving decimal input from the user (as a decimal string), - * the value should be converted to an integer and when showing a user - * a value, the integer value should be converted to a decimal string. - * - * This creates a clear distinction, between values to be used by code - * (integers) and values used for display logic to users (decimals). - * - * The native unit in Core, //Core// is divisible to 18 decimal places, - * where each individual unit is called a //ore//. - * - * @_subsection api/utils:Unit Conversion [about-units] - */ -import { assertArgument } from "./errors.js"; -import { FixedNumber } from "./fixednumber.js"; -import { getNumber } from "./maths.js"; -const names = [ - ///Ore, the smallest and atomic amount of Core - "ore", - ///fecore, 1000 ore - "fecore", - ///Picore, one million ore - "picore", - ///Nacore, one billion ore. Typically a reasonable unit to measure energy prices. - "nacore", - ///Μcore, 10^12 ore or 1 μCore - "mcore", - ///micore, 10^15 ore or 1 mcore - "micore", - "core", -]; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit - * - */ -export function formatUnits(value, unit) { - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - } - return FixedNumber.fromValue(value, decimals, { decimals }).toString(); -} -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit. - */ -export const scientificToDecimal = (num) => { - // @ts-ignore - var nsign = Math.sign(num); - //remove the sign - // @ts-ignore - num = Math.abs(num); - //if the number is in scientific notation remove it - // @ts-ignore - if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) { - var zero = "0", - // @ts-ignore - parts = String(num).toLowerCase().split("e"), //split into coeff and exponent - e = parts.pop(), //store the exponential part - // @ts-ignore - l = Math.abs(e), //get the number of zeros - // @ts-ignore - sign = e / l, coeff_array = parts[0].split("."); - if (sign === -1) { - l = l - coeff_array[0].length; - if (l < 0) { - // @ts-ignore - num = - coeff_array[0].slice(0, l) + - "." + - coeff_array[0].slice(l) + - (coeff_array.length === 2 ? coeff_array[1] : ""); - } - else { - // @ts-ignore - num = zero + "." + new Array(l + 1).join(zero) + coeff_array.join(""); - } - } - else { - var dec = coeff_array[1]; - if (dec) - l = l - dec.length; - if (l < 0) { - // @ts-ignore - num = coeff_array[0] + dec.slice(0, l) + "." + dec.slice(l); - } - else { - // @ts-ignore - num = coeff_array.join("") + new Array(l + 1).join(zero); - } - } - } - // @ts-ignore - return nsign < 0 ? "-" + num : num; -}; -export const trimDecimals = (n, decimals = 18) => { - n += ""; - if (n.indexOf(".") === -1) - return n; - const arr = n.split("."); - const fraction = arr[1].substr(0, decimals); - return arr[0] + "." + fraction; -}; -export function parseUnits(value, unit) { - assertArgument(typeof value === "string", "value must be a string", "value", value); - if (value.includes("e")) { - value = scientificToDecimal(value).toString(); - } - let decimals = 18; - if (typeof unit === "string") { - const index = names.indexOf(unit); - assertArgument(index >= 0, "invalid unit", "unit", unit); - decimals = 3 * index; - value = trimDecimals(value, decimals); - } - else if (unit != null) { - decimals = getNumber(unit, "unit"); - value = trimDecimals(value, decimals); - } - return FixedNumber.fromString(value, { decimals }).value; -} -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -export function formatXCB(ore) { - return formatUnits(ore, 18); -} -/** - * Converts the //decimal string// %%xcb%% to a BigInt, using 18 - * decimal places. - */ -export function parseXCB(xcb) { - return parseUnits(xcb, 18); -} -//# sourceMappingURL=units.js.map \ No newline at end of file diff --git a/lib.esm/utils/units.js.map b/lib.esm/utils/units.js.map deleted file mode 100644 index 4884e25f6..000000000 --- a/lib.esm/utils/units.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"units.js","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAA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AAE,CAAC;IAC/C,CAAC;IACD,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClC,cAAc,CAAC,KAAK,IAAI,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACzD,QAAQ,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;SAAM,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACzB,QAAQ,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,WAAW,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,GAAiB;IAC1C,OAAO,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW;IACnC,OAAO,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC5B,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/utf8.d.ts b/lib.esm/utils/utf8.d.ts deleted file mode 100644 index 7bb87cc7d..000000000 --- a/lib.esm/utils/utf8.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * The stanard normalization forms. - */ -export type UnicodeNormalizationForm = "NFC" | "NFD" | "NFKC" | "NFKD"; -/** - * When using the UTF-8 error API the following errors can be intercepted - * and processed as the %%reason%% passed to the [[Utf8ErrorFunc]]. - * - * **``"UNEXPECTED_CONTINUE"``** - a continuation byte was present where there - * was nothing to continue. - * - * **``"BAD_PREFIX"``** - an invalid (non-continuation) byte to start a - * UTF-8 codepoint was found. - * - * **``"OVERRUN"``** - the string is too short to process the expected - * codepoint length. - * - * **``"MISSING_CONTINUE"``** - a missing continuation byte was expected but - * not found. The %%offset%% indicates the index the continuation byte - * was expected at. - * - * **``"OUT_OF_RANGE"``** - the computed code point is outside the range - * for UTF-8. The %%badCodepoint%% indicates the computed codepoint, which was - * outside the valid UTF-8 range. - * - * **``"UTF16_SURROGATE"``** - the UTF-8 strings contained a UTF-16 surrogate - * pair. The %%badCodepoint%% is the computed codepoint, which was inside the - * UTF-16 surrogate range. - * - * **``"OVERLONG"``** - the string is an overlong representation. The - * %%badCodepoint%% indicates the computed codepoint, which has already - * been bounds checked. - * - * - * @returns string - */ -export type Utf8ErrorReason = "UNEXPECTED_CONTINUE" | "BAD_PREFIX" | "OVERRUN" | "MISSING_CONTINUE" | "OUT_OF_RANGE" | "UTF16_SURROGATE" | "OVERLONG"; -/** - * A callback that can be used with [[toUtf8String]] to analysis or - * recovery from invalid UTF-8 data. - * - * Parsing UTF-8 data is done through a simple Finite-State Machine (FSM) - * which calls the ``Utf8ErrorFunc`` if a fault is detected. - * - * The %%reason%% indicates where in the FSM execution the fault - * occurred and the %%offset%% indicates where the input failed. - * - * The %%bytes%% represents the raw UTF-8 data that was provided and - * %%output%% is the current array of UTF-8 code-points, which may - * be updated by the ``Utf8ErrorFunc``. - * - * The value of the %%badCodepoint%% depends on the %%reason%%. See - * [[Utf8ErrorReason]] for details. - * - * The function should return the number of bytes that should be skipped - * when control resumes to the FSM. - */ -export type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number) => number; -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -export declare const Utf8ErrorFuncs: Readonly>; -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm): Uint8Array; -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -export declare function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string; -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8CodePoints(str: string, form?: UnicodeNormalizationForm): Array; -//# sourceMappingURL=utf8.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/utf8.d.ts.map b/lib.esm/utils/utf8.d.ts.map deleted file mode 100644 index febc8e114..000000000 --- a/lib.esm/utils/utf8.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.d.ts","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,eAAe,GACxB,qBAAqB,GACrB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,UAAU,CAAC;AAEd;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,CAC3B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EACrB,YAAY,CAAC,EAAE,MAAM,KACjB,MAAM,CAAC;AAwEZ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACpC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,aAAa,CAAC,CAKpD,CAAC;AA2GH;;;;GAIG;AACH,wBAAgB,WAAW,CAC1B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,UAAU,CAwCZ;AAkBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,aAAa,GACrB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,KAAK,CAAC,MAAM,CAAC,CAEf"} \ No newline at end of file diff --git a/lib.esm/utils/utf8.js b/lib.esm/utils/utf8.js deleted file mode 100644 index 316eec228..000000000 --- a/lib.esm/utils/utf8.js +++ /dev/null @@ -1,220 +0,0 @@ -/** - * Using strings in Core (or any security-basd system) requires - * additional care. These utilities attempt to mitigate some of the - * safety issues as well as provide the ability to recover and analyse - * strings. - * - * @_subsection api/utils:Strings and UTF-8 [about-strings] - */ -import { getBytes } from "./data.js"; -import { assertArgument, assertNormalize } from "./errors.js"; -function errorFunc(reason, offset, bytes, output, badCodepoint) { - assertArgument(false, `invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes); -} -function ignoreFunc(reason, offset, bytes, output, badCodepoint) { - // If there is an invalid prefix (including stray continuation), skip any additional continuation bytes - if (reason === "BAD_PREFIX" || reason === "UNEXPECTED_CONTINUE") { - let i = 0; - for (let o = offset + 1; o < bytes.length; o++) { - if (bytes[o] >> 6 !== 0x02) { - break; - } - i++; - } - return i; - } - // This byte runs us past the end of the string, so just jump to the end - // (but the first byte was read already read and therefore skipped) - if (reason === "OVERRUN") { - return bytes.length - offset - 1; - } - // Nothing to skip - return 0; -} -function replaceFunc(reason, offset, bytes, output, badCodepoint) { - // Overlong representations are otherwise "valid" code points; just non-deistingtished - if (reason === "OVERLONG") { - assertArgument(typeof badCodepoint === "number", "invalid bad code point for replacement", "badCodepoint", badCodepoint); - output.push(badCodepoint); - return 0; - } - // Put the replacement character into the output - output.push(0xfffd); - // Otherwise, process as if ignoring errors - return ignoreFunc(reason, offset, bytes, output, badCodepoint); -} -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -export const Utf8ErrorFuncs = Object.freeze({ - error: errorFunc, - ignore: ignoreFunc, - replace: replaceFunc, -}); -// http://stackoverflow.com/questions/13356493/decode-utf-8-with-javascript#13691499 -function getUtf8CodePoints(_bytes, onError) { - if (onError == null) { - onError = Utf8ErrorFuncs.error; - } - const bytes = getBytes(_bytes, "bytes"); - const result = []; - let i = 0; - // Invalid bytes are ignored - while (i < bytes.length) { - const c = bytes[i++]; - // 0xxx xxxx - if (c >> 7 === 0) { - result.push(c); - continue; - } - // Multibyte; how many bytes left for this character? - let extraLength = null; - let overlongMask = null; - // 110x xxxx 10xx xxxx - if ((c & 0xe0) === 0xc0) { - extraLength = 1; - overlongMask = 0x7f; - // 1110 xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf0) === 0xe0) { - extraLength = 2; - overlongMask = 0x7ff; - // 1111 0xxx 10xx xxxx 10xx xxxx 10xx xxxx - } - else if ((c & 0xf8) === 0xf0) { - extraLength = 3; - overlongMask = 0xffff; - } - else { - if ((c & 0xc0) === 0x80) { - i += onError("UNEXPECTED_CONTINUE", i - 1, bytes, result); - } - else { - i += onError("BAD_PREFIX", i - 1, bytes, result); - } - continue; - } - // Do we have enough bytes in our data? - if (i - 1 + extraLength >= bytes.length) { - i += onError("OVERRUN", i - 1, bytes, result); - continue; - } - // Remove the length prefix from the char - let res = c & ((1 << (8 - extraLength - 1)) - 1); - for (let j = 0; j < extraLength; j++) { - let nextChar = bytes[i]; - // Invalid continuation byte - if ((nextChar & 0xc0) != 0x80) { - i += onError("MISSING_CONTINUE", i, bytes, result); - res = null; - break; - } - res = (res << 6) | (nextChar & 0x3f); - i++; - } - // See above loop for invalid continuation byte - if (res === null) { - continue; - } - // Maximum code point - if (res > 0x10ffff) { - i += onError("OUT_OF_RANGE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Reserved for UTF-16 surrogate halves - if (res >= 0xd800 && res <= 0xdfff) { - i += onError("UTF16_SURROGATE", i - 1 - extraLength, bytes, result, res); - continue; - } - // Check for overlong sequences (more bytes than needed) - if (res <= overlongMask) { - i += onError("OVERLONG", i - 1 - extraLength, bytes, result, res); - continue; - } - result.push(res); - } - return result; -} -// http://stackoverflow.com/questions/18729405/how-to-convert-utf8-string-to-byte-array -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export function toUtf8Bytes(str, form) { - if (form != null) { - assertNormalize(form); - str = str.normalize(form); - } - let result = []; - for (let i = 0; i < str.length; i++) { - const c = str.charCodeAt(i); - if (c < 0x80) { - result.push(c); - } - else if (c < 0x800) { - result.push((c >> 6) | 0xc0); - result.push((c & 0x3f) | 0x80); - } - else if ((c & 0xfc00) == 0xd800) { - i++; - const c2 = str.charCodeAt(i); - assertArgument(i < str.length && (c2 & 0xfc00) === 0xdc00, "invalid surrogate pair", "str", str); - // Surrogate Pair - const pair = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff); - result.push((pair >> 18) | 0xf0); - result.push(((pair >> 12) & 0x3f) | 0x80); - result.push(((pair >> 6) & 0x3f) | 0x80); - result.push((pair & 0x3f) | 0x80); - } - else { - result.push((c >> 12) | 0xe0); - result.push(((c >> 6) & 0x3f) | 0x80); - result.push((c & 0x3f) | 0x80); - } - } - return new Uint8Array(result); -} -//export -function _toUtf8String(codePoints) { - return codePoints - .map((codePoint) => { - if (codePoint <= 0xffff) { - return String.fromCharCode(codePoint); - } - codePoint -= 0x10000; - return String.fromCharCode(((codePoint >> 10) & 0x3ff) + 0xd800, (codePoint & 0x3ff) + 0xdc00); - }) - .join(""); -} -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -export function toUtf8String(bytes, onError) { - return _toUtf8String(getUtf8CodePoints(bytes, onError)); -} -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export function toUtf8CodePoints(str, form) { - return getUtf8CodePoints(toUtf8Bytes(str, form)); -} -//# sourceMappingURL=utf8.js.map \ No newline at end of file diff --git a/lib.esm/utils/utf8.js.map b/lib.esm/utils/utf8.js.map deleted file mode 100644 index f46745b4e..000000000 --- a/lib.esm/utils/utf8.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.js","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAgF9D,SAAS,SAAS,CACjB,MAAuB,EACvB,MAAc,EACd,KAAiB,EACjB,MAAqB,EACrB,YAAqB;IAErB,cAAc,CACb,KAAK,EACL,+BAA+B,MAAM,KAAK,MAAM,EAAE,EAClD,OAAO,EACP,KAAK,CACL,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;YAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QAChC,CAAC;IACF,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED,QAAQ;AACR,SAAS,aAAa,CAAC,UAAyB;IAC/C,OAAO,UAAU;SACf,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAClB,IAAI,SAAS,IAAI,MAAM,EAAE,CAAC;YACzB,OAAO,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACvC,CAAC;QACD,SAAS,IAAI,OAAO,CAAC;QACrB,OAAO,MAAM,CAAC,YAAY,CACzB,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,EACpC,CAAC,SAAS,GAAG,KAAK,CAAC,GAAG,MAAM,CAC5B,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC3B,KAAgB,EAChB,OAAuB;IAEvB,OAAO,aAAa,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAC/B,GAAW,EACX,IAA+B;IAE/B,OAAO,iBAAiB,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC"} \ No newline at end of file diff --git a/lib.esm/utils/uuid.d.ts b/lib.esm/utils/uuid.d.ts deleted file mode 100644 index 7b7465157..000000000 --- a/lib.esm/utils/uuid.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -export declare function uuidV4(randomBytes: BytesLike): string; -//# sourceMappingURL=uuid.d.ts.map \ No newline at end of file diff --git a/lib.esm/utils/uuid.d.ts.map b/lib.esm/utils/uuid.d.ts.map deleted file mode 100644 index f3cf307c6..000000000 --- a/lib.esm/utils/uuid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAqBrD"} \ No newline at end of file diff --git a/lib.esm/utils/uuid.js b/lib.esm/utils/uuid.js deleted file mode 100644 index a6a459551..000000000 --- a/lib.esm/utils/uuid.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Explain UUID and link to RFC here. - * - * @_subsection: api/utils:UUID [about-uuid] - */ -import { getBytes, hexlify } from "./data.js"; -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -export function uuidV4(randomBytes) { - const bytes = getBytes(randomBytes, "randomBytes"); - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - const value = hexlify(bytes); - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -//# sourceMappingURL=uuid.js.map \ No newline at end of file diff --git a/lib.esm/utils/uuid.js.map b/lib.esm/utils/uuid.js.map deleted file mode 100644 index 5b9c8f9b4..000000000 --- a/lib.esm/utils/uuid.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAI9C;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,WAAsB;IAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEnD,kBAAkB;IAClB,wCAAwC;IACxC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,cAAc;IACd,uCAAuC;IACvC,uCAAuC;IACvC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAE7B,OAAO;QACN,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC;QACtB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC;KACvB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/base-wallet.d.ts b/lib.esm/wallet/base-wallet.d.ts deleted file mode 100644 index a788c67b2..000000000 --- a/lib.esm/wallet/base-wallet.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { AbstractSigner } from "../providers/index.js"; -import { SigningKey } from "../crypto/index.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { Provider, TransactionRequest } from "../providers/index.js"; -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -export declare class BaseWallet extends AbstractSigner { - #private; - /** - * The wallet address. - */ - readonly address: string; - readonly prefix: string; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor({ signingKey, prefix, provider, }: { - signingKey: SigningKey; - prefix: string; - provider?: null | Provider; - }); - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey(): SigningKey; - /** - * The private key for this wallet. - */ - get privateKey(): string; - getAddress(): Promise; - connect(provider: null | Provider): BaseWallet; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message: string | Uint8Array): string; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=base-wallet.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/base-wallet.d.ts.map b/lib.esm/wallet/base-wallet.d.ts.map deleted file mode 100644 index 9b7a9bb96..000000000 --- a/lib.esm/wallet/base-wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AASvD,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG1E;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,cAAc;;IAC7C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAIxB;;;;;;OAMG;IACH,YAAY,EACX,UAAU,EACV,MAAM,EACN,QAAQ,GACR,EAAE;QACF,UAAU,EAAE,UAAU,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,EAcA;IAKD;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAM7C;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAID;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAEpD;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAgCjB;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/base-wallet.js b/lib.esm/wallet/base-wallet.js deleted file mode 100644 index 043a56468..000000000 --- a/lib.esm/wallet/base-wallet.js +++ /dev/null @@ -1,117 +0,0 @@ -import { getAddress } from "../address/index.js"; -import { hashMessage, TypedDataEncoder } from "../hash/index.js"; -import { AbstractSigner } from "../providers/index.js"; -import { computeAddress, Transaction } from "../transaction/index.js"; -import { defineProperties, resolveProperties, assert, assertArgument, } from "../utils/index.js"; -import { sha256 } from "../crypto/index.js"; -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -export class BaseWallet extends AbstractSigner { - /** - * The wallet address. - */ - address; - prefix; - #signingKey; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor({ signingKey, prefix, provider, }) { - super(provider); - this.prefix = prefix; - assertArgument(signingKey && typeof signingKey.sign === "function", "invalid signingKey key", "signingKey", "[ REDACTED ]"); - this.#signingKey = signingKey; - const address = computeAddress(this.#signingKey, prefix); - defineProperties(this, { address }); - } - // Store private values behind getters to reduce visibility - // in console.log - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey() { - return this.#signingKey; - } - /** - * The private key for this wallet. - */ - get privateKey() { - return this.signingKey.privateKey; - } - async getAddress() { - return this.address; - } - connect(provider) { - return new BaseWallet({ - signingKey: this.#signingKey, - prefix: this.prefix, - provider, - }); - } - async signTransaction(tx) { - // Replace any Addressable or ENS name with an address - const { to, from } = await resolveProperties({ - to: tx.to || undefined, - from: tx.from || undefined, - }); - if (to != null) { - tx.to = to; - } - if (from != null) { - tx.from = from; - } - if (tx.from != null) { - assertArgument(getAddress(tx.from) === this.address, "transaction from address mismatch", "tx.from", tx.from); - delete tx.from; - } - // Build the transaction - const btx = Transaction.from(tx); - const unSignedSerialized = btx.unsignedSerialized; - const unsignedHash = sha256(unSignedSerialized); - // sha256(btx.unsignedSerialized) - btx.signature = this.signingKey.sign(unsignedHash); - return btx.serialized; - } - async signMessage(message) { - return this.signMessageSync(message); - } - // @TODO: Add a secialized signTx and signTyped sync that enforces - // all parameters are known? - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message) { - return this.signingKey.sign(hashMessage(message)); - } - async signTypedData(domain, types, value) { - // Populate any ENS names - const populated = await TypedDataEncoder.resolveNames(domain, types, value, async (name) => { - // @TODO: this should use resolveName; addresses don't - // need a provider - assert(this.provider != null, "cannot resolve ENS names without a provider", "UNSUPPORTED_OPERATION", { - operation: "resolveName", - info: { name }, - }); - const address = getAddress(name); - assert(address != null, "unconfigured ENS name", "UNCONFIGURED_NAME", { - value: name, - }); - return address; - }); - return this.signingKey.sign(TypedDataEncoder.hash(populated.domain, types, populated.value)); - } -} -//# sourceMappingURL=base-wallet.js.map \ No newline at end of file diff --git a/lib.esm/wallet/base-wallet.js.map b/lib.esm/wallet/base-wallet.js.map deleted file mode 100644 index ee6120855..000000000 --- a/lib.esm/wallet/base-wallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EACN,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,MAAM,EAAc,MAAM,oBAAoB,CAAC;AAKxD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,UAAW,SAAQ,cAAc;IAC7C;;OAEG;IACM,OAAO,CAAU;IACjB,MAAM,CAAS;IAEf,WAAW,CAAa;IAEjC;;;;;;OAMG;IACH,YAAY,EACX,UAAU,EACV,MAAM,EACN,QAAQ,GAKR;QACA,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,MAAM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AI,CAAC,CAAC;YACjC,MAAM,CAAC,OAAO,IAAI,IAAI,EAAE,uBAAuB,EAAE,mBAAmB,EAAE;gBACrE,KAAK,EAAE,IAAI;aACX,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC;QAChB,CAAC,CACD,CAAC;QAEF,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAC1B,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,CAAC,CAC/D,CAAC;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/english_words.d.ts b/lib.esm/wallet/english_words.d.ts deleted file mode 100644 index fec60c704..000000000 --- a/lib.esm/wallet/english_words.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const englishWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=english_words.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/english_words.d.ts.map b/lib.esm/wallet/english_words.d.ts.map deleted file mode 100644 index b0bd73fa9..000000000 --- a/lib.esm/wallet/english_words.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"english_words.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,i0VACsyV,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/english_words.js b/lib.esm/wallet/english_words.js deleted file mode 100644 index d8579d386..000000000 --- a/lib.esm/wallet/english_words.js +++ /dev/null @@ -1,2 +0,0 @@ -export const englishWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=english_words.js.map \ No newline at end of file diff --git a/lib.esm/wallet/english_words.js.map b/lib.esm/wallet/english_words.js.map deleted file mode 100644 index ab2578a02..000000000 --- a/lib.esm/wallet/english_words.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"english_words.js","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GACxB,8zVAA8zV,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/hdwallet.d.ts b/lib.esm/wallet/hdwallet.d.ts deleted file mode 100644 index 7c96fb8a0..000000000 --- a/lib.esm/wallet/hdwallet.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -import { SigningKey } from "../crypto/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { Mnemonic } from "./mnemonic.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -import type { Numeric } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -export declare const defaultPath: string; -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -export declare class HDNodeWallet extends BaseWallet { - #private; - /** - * The compressed public key. - */ - readonly publicKey: string; - prefix: string; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint: string; - /** - * The parent fingerprint. - */ - readonly parentFingerprint: string; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - readonly mnemonic: null | Mnemonic; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - readonly path: null | string; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index: number; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth: number; - /** - * @private - */ - constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }: { - guard: any; - seed: string; - signingKey: SigningKey; - parentFingerprint: string; - path: null | string; - index: number; - depth: number; - mnemonic: null | Mnemonic; - provider: null | Provider; - prefix: string; - }); - connect(provider: null | Provider): HDNodeWallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { - path: string; - }; - /** - * Return the child for %%index%%. - */ - deriveChild(_index: number): HDNodeWallet; - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path: string): HDNodeWallet; - /** - * Creates a new random HDNode. - */ - static createRandom(prefix: string, password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet; - /** - * Create am HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic: Mnemonic, prefix: string, path?: string): HDNodeWallet; - static mnemonicToSeed(mnemonic: string, password?: string): string; - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase({ phrase, prefix, password, path, wordlist, }: { - phrase: string; - prefix: string; - password?: string; - path?: string; - wordlist?: Wordlist; - }): HDNodeWallet; - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed({ seed, prefix, path, }: { - seed: string; - prefix: string; - path?: string; - }): HDNodeWallet; -} -/** - * Returns the [[link-bip-32]] path for the acount at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -export declare function getAccountPath(_index: Numeric): string; -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -export declare function getIndexedAccountPath(_index: Numeric): string; -//# sourceMappingURL=hdwallet.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/hdwallet.d.ts.map b/lib.esm/wallet/hdwallet.d.ts.map deleted file mode 100644 index 6ff875955..000000000 --- a/lib.esm/wallet/hdwallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hdwallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAA0B,UAAU,EAAU,MAAM,oBAAoB,CAAC;AAUhF,OAAO,EAAE,UAAU,EAAE,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AC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAiBf;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,YAAY,CAOf;CACD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAStD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAS7D"} \ No newline at end of file diff --git a/lib.esm/wallet/hdwallet.js b/lib.esm/wallet/hdwallet.js deleted file mode 100644 index 2a67913b7..000000000 --- a/lib.esm/wallet/hdwallet.js +++ /dev/null @@ -1,366 +0,0 @@ -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -import { randomBytes, ripemd160, SigningKey, sha256 } from "../crypto/index.js"; -import { dataSlice, defineProperties, getNumber, assertPrivate, assertArgument, } from "../utils/index.js"; -import { LangEn } from "../wordlists/lang-en.js"; -import { BaseWallet } from "./base-wallet.js"; -import { Mnemonic } from "./mnemonic.js"; -import { encryptKeystoreJson, encryptKeystoreJsonSync, } from "./json-keystore.js"; -import { Ed448Goldilock } from "../crypto/crypto.js"; -import { mnemonicToSeed } from "./mnemonicToSeed.js"; -// import { arrayify, -// // hexDataSlice -// } from "../utils/data.js"; -// function sha512Hash(password: BytesLike, salt: BytesLike): Uint8Array { -// const p = getBytes(password); -// const s = getBytes(salt); -// return getBytes(pbkdf2(p, s, 2048, 57, "sha512")); -// } -/** - * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -export const defaultPath = "m"; -// "Bitcoin seed" -// const MasterSecret = new Uint8Array([66, 105, 116, 99, 111, 105, 110, 32, 115, 101, 101, 100]); -const HardenedBit = 0x80000000; -// function addScalar(a: Uint8Array, b: Uint8Array): Uint8Array { -// b = getBytes(concat([b.slice(0, 53), "0x00000000"])); -// b[0] &= 0xfc; -// const c = new Uint8Array(57); -// let hold = 0; -// for (let i = 0; i < 57; i++) { -// hold += a[i] + b[i]; -// c[i] = hold % 256; -// hold = Math.floor(hold / 256); -// } -// return c; -// }; -const _guard = {}; -function derivePath(node, path) { - const components = path.split("/"); - assertArgument(components.length > 0 && (components[0] === "m" || node.depth > 0), "invalid path", "path", path); - if (components[0] === "m") { - components.shift(); - } - let result = node; - for (let i = 0; i < components.length; i++) { - const component = components[i]; - if (component.match(/^[0-9]+'$/)) { - const index = parseInt(component.substring(0, component.length - 1)); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(HardenedBit + index); - } - else if (component.match(/^[0-9]+$/)) { - const index = parseInt(component); - assertArgument(index < HardenedBit, "invalid path index", `path[${i}]`, component); - result = result.deriveChild(index); - } - else { - assertArgument(false, "invalid path component", `path[${i}]`, component); - } - } - return result; -} -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -export class HDNodeWallet extends BaseWallet { - /** - * The compressed public key. - */ - publicKey; - prefix; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - fingerprint; - /** - * The parent fingerprint. - */ - parentFingerprint; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - mnemonic; - #seed; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - path; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - index; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - depth; - /** - * @private - */ - constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }) { - super({ - signingKey, - prefix, - provider, - }); - assertPrivate(guard, _guard, "HDNodeWallet"); - defineProperties(this, { publicKey: signingKey.publicKey }); - this.prefix = prefix; - this.#seed = seed; - const fingerprint = dataSlice(ripemd160(sha256(this.publicKey)), 0, 4); - defineProperties(this, { - parentFingerprint, - fingerprint, - path, - index, - depth, - }); - defineProperties(this, { mnemonic }); - } - connect(provider) { - return new HDNodeWallet({ - guard: _guard, - signingKey: this.signingKey, - parentFingerprint: this.parentFingerprint, - path: this.path, - index: this.index, - depth: this.depth, - seed: this.#seed, - mnemonic: this.mnemonic, - provider, - prefix: this.prefix, - }); - } - #account() { - const account = { - address: this.address, - privateKey: this.privateKey, - }; - const m = this.mnemonic; - if (this.path && m && m.wordlist.locale === "en" && m.password === "") { - account.mnemonic = { - path: this.path, - locale: "en", - entropy: m.entropy, - }; - } - return account; - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - return await encryptKeystoreJson(this.#account(), password, { - progressCallback, - }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - return encryptKeystoreJsonSync(this.#account(), password); - } - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath() { - return this.path != null; - } - /** - * Return the child for %%index%%. - */ - deriveChild(_index) { - const newPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(this.#seed, Number(_index)); - const newSigningKey = new SigningKey(newPrivateKey); - // Base path - let path = this.path; - if (path) { - path += "/" + (_index & ~HardenedBit); - if (_index & HardenedBit) { - path += "'"; - } - } - return new HDNodeWallet({ - guard: _guard, - signingKey: newSigningKey, - parentFingerprint: this.fingerprint, - path, - index: _index, - seed: this.#seed, - depth: this.depth + 1, - mnemonic: this.mnemonic, - provider: this.provider, - prefix: this.prefix, - }); - } - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path) { - return derivePath(this, path); - } - static #fromSeed({ _seed, mnemonic, prefix, path, }) { - const extendetPrivateKey = Ed448Goldilock.HDWalletGenerateKeyFromSeed(_seed, 0); - const signingKey = new SigningKey(extendetPrivateKey); - // console.log({ privateKey, thisKey: signingKey.privateKey,len:tmp.privateKey.length }) - return new HDNodeWallet({ - seed: _seed, - guard: _guard, - signingKey, - parentFingerprint: "0x00000000", - path: path || defaultPath, - index: 0, - depth: 0, - mnemonic, - provider: null, - prefix, - }); - } - /** - * Creates a new random HDNode. - */ - static createRandom(prefix, password, path, wordlist) { - if (password == null) { - password = ""; - } - if (path == null) { - path = defaultPath; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromEntropy(randomBytes(32), password, wordlist); - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - /** - * Create am HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic, prefix, path) { - if (!path) { - path = defaultPath; - } - return HDNodeWallet.#fromSeed({ - _seed: mnemonic.computeSeed(), - mnemonic, - prefix, - }).derivePath(path); - } - static mnemonicToSeed(mnemonic, password) { - const seed = mnemonicToSeed(mnemonic, password); - return seed; - } - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase({ phrase, prefix, password, path, wordlist, }) { - if (!password) { - password = ""; - } - if (!path) { - path = defaultPath; - } - if (!wordlist) { - wordlist = LangEn.wordlist(); - } - const mnemonic = Mnemonic.fromPhrase({ phrase, password, wordlist }); - const _seed = mnemonic.computeSeed(); - return HDNodeWallet.#fromSeed({ - _seed, - mnemonic, - prefix, - }).derivePath(path); - } - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed({ seed, prefix, path, }) { - return HDNodeWallet.#fromSeed({ - _seed: seed, - mnemonic: null, - path: path || defaultPath, - prefix, - }); - } -} -/* -export class HDNodeWalletManager { - #root: HDNodeWallet; - - constructor(phrase: string, password?: null | string, path?: null | string, locale?: null | Wordlist) { - if (password == null) { password = ""; } - if (path == null) { path = "m/44'/60'/0'/0"; } - if (locale == null) { locale = LangEn.wordlist(); } - this.#root = HDNodeWallet.fromPhrase(phrase, password, path, locale); - } - - getSigner(index?: number): HDNodeWallet { - return this.#root.deriveChild((index == null) ? 0: index); - } -} -*/ -/** - * Returns the [[link-bip-32]] path for the acount at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -export function getAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/${index}'/0/0`; -} -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -export function getIndexedAccountPath(_index) { - const index = getNumber(_index, "index"); - assertArgument(index >= 0 && index < HardenedBit, "invalid account index", "index", index); - return `m/44'/60'/0'/0/${index}`; -} -//# sourceMappingURL=hdwallet.js.map \ No newline at end of file diff --git a/lib.esm/wallet/hdwallet.js.map b/lib.esm/wallet/hdwallet.js.map deleted file mode 100644 index 088c0736b..000000000 --- a/lib.esm/wallet/hdwallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hdwallet.js","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,SA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CACb,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,WAAW,EACjC,uBAAuB,EACvB,OAAO,EACP,KAAK,CACL,CAAC;IACF,OAAO,kBAAkB,KAAK,EAAE,CAAC;AAClC,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/index.d.ts b/lib.esm/wallet/index.d.ts deleted file mode 100644 index d3db8f37c..000000000 --- a/lib.esm/wallet/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * When interacting with Core, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ -export { BaseWallet } from "./base-wallet.js"; -export { defaultPath, getAccountPath, getIndexedAccountPath, HDNodeWallet, } from "./hdwallet.js"; -export { isCrowdsaleJson, decryptCrowdsaleJson } from "./json-crowdsale.js"; -export { isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./json-keystore.js"; -export { Mnemonic } from "./mnemonic.js"; -export { Wallet } from "./wallet.js"; -export type { CrowdsaleAccount } from "./json-crowdsale.js"; -export type { KeystoreAccount, EncryptOptions } from "./json-keystore.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/index.d.ts.map b/lib.esm/wallet/index.d.ts.map deleted file mode 100644 index f380a0adc..000000000 --- a/lib.esm/wallet/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/index.js b/lib.esm/wallet/index.js deleted file mode 100644 index 593a62238..000000000 --- a/lib.esm/wallet/index.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * When interacting with Core, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ -export { BaseWallet } from "./base-wallet.js"; -export { defaultPath, getAccountPath, getIndexedAccountPath, HDNodeWallet, } from "./hdwallet.js"; -export { isCrowdsaleJson, decryptCrowdsaleJson } from "./json-crowdsale.js"; -export { isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./json-keystore.js"; -export { Mnemonic } from "./mnemonic.js"; -export { Wallet } from "./wallet.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/wallet/index.js.map b/lib.esm/wallet/index.js.map deleted file mode 100644 index d3dbff105..000000000 --- a/lib.esm/wallet/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/json-crowdsale.d.ts b/lib.esm/wallet/json-crowdsale.d.ts deleted file mode 100644 index 65b5f0251..000000000 --- a/lib.esm/wallet/json-crowdsale.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * The data stored within a JSON Crowdsale wallet is fairly - * minimal. - */ -export type CrowdsaleAccount = { - privateKey: string; - address: string; -}; -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -export declare function isCrowdsaleJson(json: string): boolean; -/** - * Before Core launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive xcb - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -export declare function decryptCrowdsaleJson(json: string, _password: string | Uint8Array): CrowdsaleAccount; -//# sourceMappingURL=json-crowdsale.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/json-crowdsale.d.ts.map b/lib.esm/wallet/json-crowdsale.d.ts.map deleted file mode 100644 index db8057554..000000000 --- a/lib.esm/wallet/json-crowdsale.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,gBAAgB,CAmClB"} \ No newline at end of file diff --git a/lib.esm/wallet/json-crowdsale.js b/lib.esm/wallet/json-crowdsale.js deleted file mode 100644 index c3c9d148f..000000000 --- a/lib.esm/wallet/json-crowdsale.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -// @ts-ignore -import pkg from "aes-js"; -const { ModeOfOperation: { cbc: CBC }, padding: { pkcs7: { strip: pkcs7Strip }, }, } = pkg; -import { getAddress } from "../address/index.js"; -import { pbkdf2 } from "../crypto/index.js"; -import { id } from "../hash/index.js"; -import { getBytes, assertArgument } from "../utils/index.js"; -import { getPassword, looseArrayify, spelunk } from "./utils.js"; -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -export function isCrowdsaleJson(json) { - try { - const data = JSON.parse(json); - if (data.encseed) { - return true; - } - } - catch (error) { } - return false; -} -/** - * Before Core launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive xcb - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -export function decryptCrowdsaleJson(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - // Core Address - const address = getAddress(spelunk(data, "ethaddr:string!")); - // Encrypted Seed - const encseed = looseArrayify(spelunk(data, "encseed:string!")); - assertArgument(encseed && encseed.length % 16 === 0, "invalid encseed", "json", json); - const key = getBytes(pbkdf2(password, password, 2000, 32, "sha256")).slice(0, 16); - const iv = encseed.slice(0, 16); - const encryptedSeed = encseed.slice(16); - // Decrypt the seed - const aesCbc = new CBC(key, iv); - const seed = pkcs7Strip(getBytes(aesCbc.decrypt(encryptedSeed))); - // This wallet format is weird... Convert the binary encoded hex to a string. - let seedHex = ""; - for (let i = 0; i < seed.length; i++) { - seedHex += String.fromCharCode(seed[i]); - } - return { address, privateKey: id(seedHex) }; -} -//# sourceMappingURL=json-crowdsale.js.map \ No newline at end of file diff --git a/lib.esm/wallet/json-crowdsale.js.map b/lib.esm/wallet/json-crowdsale.js.map deleted file mode 100644 index 76fc523ea..000000000 --- a/lib.esm/wallet/json-crowdsale.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-crowdsale.js","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,aAAa;AACb,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,MAAM,EACL,eAAe,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAC7B,OAAO,EAAE,EACR,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,GAC5B,GACD,GAAG,GAAG,CAAC;AACR,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAWjE;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAA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AAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAEjE,6EAA6E;IAC7E,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,OAAO,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;AAC7C,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/json-keystore.d.ts b/lib.esm/wallet/json-keystore.d.ts deleted file mode 100644 index 363fd7956..000000000 --- a/lib.esm/wallet/json-keystore.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { ProgressCallback } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * The contents of a JSON Keystore Wallet. - */ -export type KeystoreAccount = { - address: string; - privateKey: string; - mnemonic?: { - path?: string; - locale?: string; - entropy: string; - }; -}; -/** - * The parameters to use when encrypting a JSON Keystore Wallet. - */ -export type EncryptOptions = { - progressCallback?: ProgressCallback; - iv?: BytesLike; - entropy?: BytesLike; - client?: string; - salt?: BytesLike; - uuid?: string; - scrypt?: { - N?: number; - r?: number; - p?: number; - }; -}; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -export declare function isKeystoreJson(json: string): boolean; -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -export declare function decryptKeystoreJsonSync(json: string, _password: string | Uint8Array): KeystoreAccount; -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -export declare function decryptKeystoreJson(json: string, _password: string | Uint8Array, progress?: ProgressCallback): Promise; -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -export declare function encryptKeystoreJsonSync(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): string; -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -export declare function encryptKeystoreJson(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): Promise; -//# sourceMappingURL=json-keystore.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/json-keystore.d.ts.map b/lib.esm/wallet/json-keystore.d.ts.map deleted file mode 100644 index 742508cc1..000000000 --- a/lib.esm/wallet/json-keystore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACR,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASpD;AAkLD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,eAAe,CAmBjB;AAUD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,EAC9B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,eAAe,CAAC,CA2B1B;AA8ID;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,MAAM,CASR;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,MAAM,CAAC,CAiBjB"} \ No newline at end of file diff --git a/lib.esm/wallet/json-keystore.js b/lib.esm/wallet/json-keystore.js deleted file mode 100644 index 314dec535..000000000 --- a/lib.esm/wallet/json-keystore.js +++ /dev/null @@ -1,335 +0,0 @@ -/** - * The JSON Wallet formats allow a simple way to store the private - * keys needed in Core along with related information and allows - * for extensible forms of encryption. - * - * These utilities facilitate decrypting and encrypting the most common - * JSON Wallet formats. - * - * @_subsection: api/wallet:JSON Wallets [json-wallets] - */ -// @ts-ignore -import pkg from "aes-js"; -const { Counter, ModeOfOperation: { ctr: CTR }, } = pkg; -import { getAddress } from "../address/index.js"; -import { pbkdf2, randomBytes, scrypt, scryptSync, sha256, } from "../crypto/index.js"; -import { concat, getBytes, hexlify, uuidV4, assert, assertArgument, } from "../utils/index.js"; -import { getPassword, spelunk, zpad } from "./utils.js"; -import { version } from "../_version.js"; -import { computeAddress, extractPrefix } from "../transaction/address.js"; -const defaultPath = "m/44'/60'/0'/0/0"; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -export function isKeystoreJson(json) { - try { - const data = JSON.parse(json); - const version = data.version != null ? parseInt(data.version) : 0; - if (version === 3) { - return true; - } - } - catch (error) { } - return false; -} -function decrypt(data, key, ciphertext) { - const cipher = spelunk(data, "crypto.cipher:string"); - if (cipher === "aes-128-ctr") { - const iv = spelunk(data, "crypto.cipherparams.iv:data!"); - const aesCtr = new CTR(key, new Counter(iv)); - return hexlify(aesCtr.decrypt(ciphertext)); - } - assert(false, "unsupported cipher", "UNSUPPORTED_OPERATION", { - operation: "decrypt", - }); -} -function getAccount(data, _key) { - const key = getBytes(_key); - const ciphertext = spelunk(data, "crypto.ciphertext:data!"); - const computedMAC = hexlify(sha256(concat([key.slice(16, 32), ciphertext]))).substring(2); - const expectedMAC = spelunk(data, "crypto.mac:string!"); - let difference = 0; - const validMAC = /^[0-9a-f]{64}$/i.test(expectedMAC); - if (validMAC) { - const actual = getBytes("0x" + computedMAC); - const expected = getBytes("0x" + expectedMAC); - for (let i = 0; i < actual.length; i++) - difference |= actual[i] ^ expected[i]; - } - assertArgument(validMAC && difference === 0, "incorrect password", "password", "[REDACTED]"); - const privateKey = decrypt(data, key.slice(0, 16), ciphertext); - const address = getAddress(data.address); - const prefix = extractPrefix(address); - if (computeAddress(privateKey, prefix) !== address) { - throw new Error("address mismatch"); - } - if (data.address) { - let check = data.address.toLowerCase(); - if (!check.startsWith("0x")) { - check = "0x" + check; - } - assertArgument(getAddress(check) === address, "keystore address/privateKey mismatch", "address", data.address); - } - const account = { address, privateKey }; - // Version 0.1 x-corebc metadata must contain an encrypted mnemonic phrase - const version = spelunk(data, "x-corebc.version:string"); - if (version === "0.1") { - const mnemonicKey = key.slice(32, 64); - const mnemonicCiphertext = spelunk(data, "x-corebc.mnemonicCiphertext:data!"); - const mnemonicIv = spelunk(data, "x-corebc.mnemonicCounter:data!"); - const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); - account.mnemonic = { - path: spelunk(data, "x-corebc.path:string") || defaultPath, - locale: spelunk(data, "x-corebc.locale:string") || "en", - entropy: hexlify(getBytes(mnemonicAesCtr.decrypt(mnemonicCiphertext))), - }; - } - return account; -} -// Match Core Web3Dart's wallet KDF resource limits. -function validateScrypt(N, r, p) { - assertArgument(Number.isSafeInteger(N) && N > 1 && N <= 1048576 && (N & (N - 1)) === 0, "unsafe scrypt N", "kdf.N", N); - assertArgument(Number.isSafeInteger(r) && - Number.isSafeInteger(p) && - r > 0 && - p > 0 && - r * p <= 1048576 && - 128 * N * r <= 256 * 1024 * 1024, "unsafe scrypt work or memory requirement", "kdf", { N, r, p }); -} -function getDecryptKdfParams(data) { - const kdf = spelunk(data, "crypto.kdf:string"); - if (kdf && typeof kdf === "string") { - if (kdf.toLowerCase() === "scrypt") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const N = spelunk(data, "crypto.kdfparams.n:int!"); - const r = spelunk(data, "crypto.kdfparams.r:int!"); - const p = spelunk(data, "crypto.kdfparams.p:int!"); - validateScrypt(N, r, p); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dflen", dkLen); - return { name: "scrypt", salt, N, r, p, dkLen: 64 }; - } - else if (kdf.toLowerCase() === "pbkdf2") { - const salt = spelunk(data, "crypto.kdfparams.salt:data!"); - const prf = spelunk(data, "crypto.kdfparams.prf:string!"); - const algorithm = prf.split("-").pop(); - assertArgument(prf === "hmac-sha256" || prf === "hmac-sha512", "invalid kdf.pdf", "kdf.pdf", prf); - const count = spelunk(data, "crypto.kdfparams.c:int!"); - assertArgument(Number.isSafeInteger(count) && count > 0 && count <= 10_000_000, "unsafe PBKDF2 iteration count", "kdf.c", count); - const dkLen = spelunk(data, "crypto.kdfparams.dklen:int!"); - assertArgument(dkLen === 32, "invalid kdf.dklen", "kdf.dklen", dkLen); - return { - name: "pbkdf2", - salt, - count, - dkLen, - algorithm: algorithm, - }; - } - } - assertArgument(false, "unsupported key-derivation function", "kdf", kdf); -} -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -export function decryptKeystoreJsonSync(json, _password) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = scryptSync(password, salt, N, r, p, dkLen); - return getAccount(data, key); -} -function stall(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); -} -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -export async function decryptKeystoreJson(json, _password, progress) { - const data = JSON.parse(json); - const password = getPassword(_password); - const params = getDecryptKdfParams(data); - if (params.name === "pbkdf2") { - if (progress) { - progress(0); - await stall(0); - } - const { salt, count, dkLen, algorithm } = params; - const key = pbkdf2(password, salt, count, dkLen, algorithm); - if (progress) { - progress(1); - await stall(0); - } - return getAccount(data, key); - } - assert(params.name === "scrypt", "cannot be reached", "UNKNOWN_ERROR", { - params, - }); - const { salt, N, r, p, dkLen } = params; - const key = await scrypt(password, salt, N, r, p, dkLen, progress); - return getAccount(data, key); -} -function getEncryptKdfParams(options) { - // Check/generate the salt - const salt = options.salt != null - ? getBytes(options.salt, "options.salt") - : randomBytes(32); - // Override the scrypt password-based key derivation function parameters - let N = 1 << 17, r = 8, p = 1; - if (options.scrypt) { - if (options.scrypt.N != null) { - N = options.scrypt.N; - } - if (options.scrypt.r != null) { - r = options.scrypt.r; - } - if (options.scrypt.p != null) { - p = options.scrypt.p; - } - } - validateScrypt(N, r, p); - return { name: "scrypt", dkLen: 32, salt, N, r, p }; -} -function _encryptKeystore(key, kdf, account, options) { - const privateKey = getBytes(account.privateKey, "privateKey"); - // Override initialization vector - const iv = options.iv != null ? getBytes(options.iv, "options.iv") : randomBytes(16); - assertArgument(iv.length === 16, "invalid options.iv length", "options.iv", options.iv); - // Override the uuid - const uuidRandom = options.uuid != null - ? getBytes(options.uuid, "options.uuid") - : randomBytes(16); - assertArgument(uuidRandom.length === 16, "invalid options.uuid length", "options.uuid", options.iv); - // This will be used to encrypt the wallet (as per Web3 secret storage) - // - 32 bytes As normal for the Web3 secret storage (derivedKey, macPrefix) - // - 32 bytes AES key to encrypt mnemonic with (required here to be corebc Wallet) - const derivedKey = key.slice(0, 16); - const macPrefix = key.slice(16, 32); - // Encrypt the private key - const aesCtr = new CTR(derivedKey, new Counter(iv)); - const ciphertext = getBytes(aesCtr.encrypt(privateKey)); - // Compute the message authentication code, used to check the password - const mac = sha256(concat([macPrefix, ciphertext])); - const data = { - address: account.address.substring(2).toLowerCase(), - id: uuidV4(uuidRandom), - version: 3, - Crypto: { - cipher: "aes-128-ctr", - cipherparams: { - iv: hexlify(iv).substring(2), - }, - ciphertext: hexlify(ciphertext).substring(2), - kdf: "scrypt", - kdfparams: { - salt: hexlify(kdf.salt).substring(2), - n: kdf.N, - dklen: 32, - p: kdf.p, - r: kdf.r, - }, - mac: mac.substring(2), - }, - }; - // If we have a mnemonic, encrypt it into the JSON wallet - if (account.mnemonic) { - const client = options.client != null ? options.client : `corebc/${version}`; - const path = account.mnemonic.path || defaultPath; - const locale = account.mnemonic.locale || "en"; - const mnemonicKey = key.slice(32, 64); - const entropy = getBytes(account.mnemonic.entropy, "account.mnemonic.entropy"); - const mnemonicIv = randomBytes(16); - const mnemonicAesCtr = new CTR(mnemonicKey, new Counter(mnemonicIv)); - const mnemonicCiphertext = getBytes(mnemonicAesCtr.encrypt(entropy)); - const now = new Date(); - const timestamp = now.getUTCFullYear() + - "-" + - zpad(now.getUTCMonth() + 1, 2) + - "-" + - zpad(now.getUTCDate(), 2) + - "T" + - zpad(now.getUTCHours(), 2) + - "-" + - zpad(now.getUTCMinutes(), 2) + - "-" + - zpad(now.getUTCSeconds(), 2) + - ".0Z"; - const gethFilename = "UTC--" + timestamp + "--" + data.address; - data["x-corebc"] = { - client, - gethFilename, - path, - locale, - mnemonicCounter: hexlify(mnemonicIv).substring(2), - mnemonicCiphertext: hexlify(mnemonicCiphertext).substring(2), - version: "0.1", - }; - } - return JSON.stringify(data); -} -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -export function encryptKeystoreJsonSync(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = scryptSync(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64); - return _encryptKeystore(getBytes(key), kdf, account, options); -} -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -export async function encryptKeystoreJson(account, password, options) { - if (options == null) { - options = {}; - } - const passwordBytes = getPassword(password); - const kdf = getEncryptKdfParams(options); - const key = await scrypt(passwordBytes, kdf.salt, kdf.N, kdf.r, kdf.p, 64, options.progressCallback); - return _encryptKeystore(getBytes(key), kdf, account, options); -} -//# sourceMappingURL=json-keystore.js.map \ No newline at end of file diff --git a/lib.esm/wallet/json-keystore.js.map b/lib.esm/wallet/json-keystore.js.map deleted file mode 100644 index 546c4bb3c..000000000 --- a/lib.esm/wallet/json-keystore.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-keystore.js","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,aAAa;AACb,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,MAAM,EACL,OAAO,EACP,eAAe,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAC7B,GAAG,GAAG,CAAC;AAER,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EACN,MAAM,EACN,WAAW,EACX,MAAM,EACN,UAAU,EACV,MAAM,GACN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAKxD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1E,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAgCvC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IAC1C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AAwB,EACxB,QAA6B,EAC7B,OAAwB;IAExB,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACrB,OAAO,GAAG,EAAE,CAAC;IACd,CAAC;IAED,MAAM,aAAa,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,GAAG,GAAG,MAAM,MAAM,CACvB,aAAa,EACb,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,CAAC,EACL,GAAG,CAAC,CAAC,EACL,GAAG,CAAC,CAAC,EACL,EAAE,EACF,OAAO,CAAC,gBAAgB,CACxB,CAAC;IACF,OAAO,gBAAgB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC"} \ No newline at end of file diff --git a/lib.esm/wallet/mnemonic.d.ts b/lib.esm/wallet/mnemonic.d.ts deleted file mode 100644 index 64ef1a10e..000000000 --- a/lib.esm/wallet/mnemonic.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -export declare class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - readonly phrase: string; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - readonly password: string; - /** - * The wordlist for this mnemonic. - */ - readonly wordlist: Wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - readonly entropy: string; - /** - * @private - */ - constructor(guard: any, entropy: string, phrase: string, password?: null | string, wordlist?: null | Wordlist); - /** - * Returns the seed for the mnemonic. - */ - computeSeed(): string; - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase({ phrase, password, wordlist, }: { - phrase: string; - password?: null | string; - wordlist?: null | Wordlist; - }): Mnemonic; - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy: BytesLike, password?: null | string, wordlist?: null | Wordlist): Mnemonic; - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy: BytesLike, wordlist?: null | Wordlist): string; - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string; - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean; -} -//# sourceMappingURL=mnemonic.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/mnemonic.d.ts.map b/lib.esm/wallet/mnemonic.d.ts.map deleted file mode 100644 index 1f5e4541d..000000000 --- a/lib.esm/wallet/mnemonic.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA6HtD;;;GAGG;AACH,qBAAa,QAAQ;IACpB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAE1B;;OAEG;IACH,YACC,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,EAU1B;IAED;;OAEG;IACH,WAAW,IAAI,MAAM,CAEpB;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,QAAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,GAAG,QAAQ,CAKX;IAED;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CACjB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,QAAQ,CAIV;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CACrB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,MAAM,CAGR;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAEzE;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,OAAO,CAM1E;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/mnemonic.js b/lib.esm/wallet/mnemonic.js deleted file mode 100644 index afcc4470b..000000000 --- a/lib.esm/wallet/mnemonic.js +++ /dev/null @@ -1,166 +0,0 @@ -import { defineProperties, getBytes, hexlify, assertNormalize, assertPrivate, assertArgument, } from "../utils/index.js"; -import { LangEn } from "../wordlists/lang-en.js"; -import { legacySha256 } from "../crypto/sha3.js"; -import { mnemonicToSeed } from "./mnemonicToSeed.js"; -// Returns a byte with the MSB bits set -function getUpperMask(bits) { - return (((1 << bits) - 1) << (8 - bits)) & 0xff; -} -// Returns a byte with the LSB bits set -function getLowerMask(bits) { - return ((1 << bits) - 1) & 0xff; -} -function mnemonicToEntropy(mnemonic, wordlist) { - assertNormalize("NFKD"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const words = wordlist.split(mnemonic); - assertArgument(words.length % 3 === 0 && words.length >= 12 && words.length <= 24, "invalid mnemonic length", "mnemonic", "[ REDACTED ]"); - const entropy = new Uint8Array(Math.ceil((11 * words.length) / 8)); - let offset = 0; - for (let i = 0; i < words.length; i++) { - let index = wordlist.getWordIndex(words[i].normalize("NFKD")); - assertArgument(index >= 0, `invalid mnemonic word at index ${i}`, "mnemonic", "[ REDACTED ]"); - for (let bit = 0; bit < 11; bit++) { - if (index & (1 << (10 - bit))) { - entropy[offset >> 3] |= 1 << (7 - (offset % 8)); - } - offset++; - } - } - const entropyBits = (32 * words.length) / 3; - const checksumBits = words.length / 3; - const checksumMask = getUpperMask(checksumBits); - const checksum = getBytes(legacySha256(entropy.slice(0, entropyBits / 8)))[0] & checksumMask; - assertArgument(checksum === (entropy[entropy.length - 1] & checksumMask), "invalid mnemonic checksum", "mnemonic", "[ REDACTED ]"); - return hexlify(entropy.slice(0, entropyBits / 8)); -} -function entropyToMnemonic(entropy, wordlist) { - assertArgument(entropy.length % 4 === 0 && entropy.length >= 16 && entropy.length <= 32, "invalid entropy size", "entropy", "[ REDACTED ]"); - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - const indices = [0]; - let remainingBits = 11; - for (let i = 0; i < entropy.length; i++) { - // Consume the whole byte (with still more to go) - if (remainingBits > 8) { - indices[indices.length - 1] <<= 8; - indices[indices.length - 1] |= entropy[i]; - remainingBits -= 8; - // This byte will complete an 11-bit index - } - else { - indices[indices.length - 1] <<= remainingBits; - indices[indices.length - 1] |= entropy[i] >> (8 - remainingBits); - // Start the next word - indices.push(entropy[i] & getLowerMask(8 - remainingBits)); - remainingBits += 3; - } - } - // Compute the checksum bits - const checksumBits = entropy.length / 4; - const checksum = parseInt(legacySha256(entropy).substring(2, 4), 16) & - getUpperMask(checksumBits); - // Shift the checksum into the word indices - indices[indices.length - 1] <<= checksumBits; - indices[indices.length - 1] |= checksum >> (8 - checksumBits); - return wordlist.join(indices.map((index) => wordlist.getWord(index))); -} -const _guard = {}; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -export class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - phrase; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - password; - /** - * The wordlist for this mnemonic. - */ - wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - entropy; - /** - * @private - */ - constructor(guard, entropy, phrase, password, wordlist) { - if (password == null) { - password = ""; - } - if (wordlist == null) { - wordlist = LangEn.wordlist(); - } - assertPrivate(guard, _guard, "Mnemonic"); - defineProperties(this, { phrase, password, wordlist, entropy }); - } - /** - * Returns the seed for the mnemonic. - */ - computeSeed() { - return mnemonicToSeed(this.phrase, this.password); - } - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase({ phrase, password, wordlist, }) { - // Normalize the case and space; throws if invalid - const entropy = mnemonicToEntropy(phrase, wordlist); - phrase = entropyToMnemonic(getBytes(entropy), wordlist); - return new Mnemonic(_guard, entropy, phrase, password, wordlist); - } - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy, password, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - const phrase = entropyToMnemonic(entropy, wordlist); - return new Mnemonic(_guard, hexlify(entropy), phrase, password, wordlist); - } - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy, wordlist) { - const entropy = getBytes(_entropy, "entropy"); - return entropyToMnemonic(entropy, wordlist); - } - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase, wordlist) { - return mnemonicToEntropy(phrase, wordlist); - } - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase, wordlist) { - try { - mnemonicToEntropy(phrase, wordlist); - return true; - } - catch (error) { } - return false; - } -} -//# sourceMappingURL=mnemonic.js.map \ No newline at end of file diff --git a/lib.esm/wallet/mnemonic.js.map b/lib.esm/wallet/mnemonic.js.map deleted file mode 100644 index e252eaa4d..000000000 --- a/lib.esm/wallet/mnemonic.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonic.js","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,eAAe,EACf,aAAa,EACb,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAIjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,uCAAuC;AACvC,SAAS,YAAY,CAAC,IAAY;IACjC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;AACjD,CAAC;AAED,uCAAuC;AACvC,SAAS,YAAY,CAAC,IAAY;IACjC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC;AAED,SAAS,iBAAiB,CACzB,QAAgB,EAChB,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MAAM,GAAG,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACpD,OAAO,IAAI,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CACrB,QAAmB,EACnB,QAA0B;QAE1B,MAAM,OAAO,GAAG,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC9C,OAAO,iBAAiB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,QAA0B;QAChE,OAAO,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC5C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAc,EAAE,QAA0B;QAChE,IAAI,CAAC;YACJ,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC;QACb,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC,CAAA,CAAC;QAClB,OAAO,KAAK,CAAC;IACd,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/mnemonicToSeed.d.ts b/lib.esm/wallet/mnemonicToSeed.d.ts deleted file mode 100644 index ee0ed82a0..000000000 --- a/lib.esm/wallet/mnemonicToSeed.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function mnemonicToSeed(mnemonic: string, password?: string): string; -//# sourceMappingURL=mnemonicToSeed.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/mnemonicToSeed.d.ts.map b/lib.esm/wallet/mnemonicToSeed.d.ts.map deleted file mode 100644 index 87afb28cf..000000000 --- a/lib.esm/wallet/mnemonicToSeed.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonicToSeed.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E"} \ No newline at end of file diff --git a/lib.esm/wallet/mnemonicToSeed.js b/lib.esm/wallet/mnemonicToSeed.js deleted file mode 100644 index 578640058..000000000 --- a/lib.esm/wallet/mnemonicToSeed.js +++ /dev/null @@ -1,23 +0,0 @@ -import { Buffer } from "buffer"; -import { pbkdf2Sync } from "../crypto/crypto.js"; -import utf8 from "utf8"; -export function mnemonicToSeed(mnemonic, password) { - if (!password) { - password = ""; - } - const t = generateSeed(mnemonic, password); - return t.goldilock; -} -const generateSeed = (mnemonic, password) => { - const goldilockSaltPrefix = "mnemonic"; - const aesSaltPrefix = "mnemonicfortheAESkey"; - const goldilockSalt = utf8.encode(goldilockSaltPrefix + password); - const aesSalt = utf8.encode(aesSaltPrefix + password); - const goldilockKey = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(goldilockSalt), 2048, 64, "sha512"); - const aesKeySeed = pbkdf2Sync(Buffer.from(mnemonic), Buffer.from(aesSalt), 2048, 64, "sha512"); - return { - aes: Buffer.from(aesKeySeed).toString("hex"), - goldilock: Buffer.from(goldilockKey).toString("hex"), - }; -}; -//# sourceMappingURL=mnemonicToSeed.js.map \ No newline at end of file diff --git a/lib.esm/wallet/mnemonicToSeed.js.map b/lib.esm/wallet/mnemonicToSeed.js.map deleted file mode 100644 index 23438518b..000000000 --- a/lib.esm/wallet/mnemonicToSeed.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonicToSeed.js","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,M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* @_ignore - */ -export declare function looseArrayify(hexString: string): Uint8Array; -export declare function zpad(value: String | number, length: number): String; -export declare function getPassword(password: string | Uint8Array): Uint8Array; -export declare function spelunk(object: any, _path: string): T; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/utils.d.ts.map b/lib.esm/wallet/utils.d.ts.map deleted file mode 100644 index 4c02cc44f..000000000 --- a/lib.esm/wallet/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAK3D;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMnE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAKrE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAoExD"} \ No newline at end of file diff --git a/lib.esm/wallet/utils.js b/lib.esm/wallet/utils.js deleted file mode 100644 index 342f28b5b..000000000 --- a/lib.esm/wallet/utils.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * @_ignore - */ -import { getBytesCopy, assertArgument, toUtf8Bytes } from "../utils/index.js"; -export function looseArrayify(hexString) { - if (typeof hexString === "string" && !hexString.startsWith("0x")) { - hexString = "0x" + hexString; - } - return getBytesCopy(hexString); -} -export function zpad(value, length) { - value = String(value); - while (value.length < length) { - value = "0" + value; - } - return value; -} -export function getPassword(password) { - if (typeof password === "string") { - return toUtf8Bytes(password, "NFKC"); - } - return getBytesCopy(password); -} -export function spelunk(object, _path) { - const match = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i); - assertArgument(match != null, "invalid path", "path", _path); - const path = match[1]; - const type = match[3]; - const reqd = match[4] === "!"; - let cur = object; - for (const comp of path.toLowerCase().split(".")) { - // Search for a child object with a case-insensitive matching key - if (Array.isArray(cur)) { - if (!comp.match(/^[0-9]+$/)) { - break; - } - cur = cur[parseInt(comp)]; - } - else if (typeof cur === "object") { - let found = null; - for (const key in cur) { - if (key.toLowerCase() === comp) { - found = cur[key]; - break; - } - } - cur = found; - } - else { - cur = null; - } - if (cur == null) { - break; - } - } - assertArgument(!reqd || cur != null, "missing required value", "path", path); - if (type && cur != null) { - if (type === "int") { - if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) { - return parseInt(cur); - } - else if (Number.isSafeInteger(cur)) { - return cur; - } - } - if (type === "number") { - if (typeof cur === "string" && cur.match(/^-?[0-9.]*$/)) { - return parseFloat(cur); - } - } - if (type === "data") { - if (typeof cur === "string") { - return looseArrayify(cur); - } - } - if (type === "array" && Array.isArray(cur)) { - return cur; - } - if (type === typeof cur) { - return cur; - } - assertArgument(false, `wrong type found for ${type} `, "path", path); - } - return cur; -} -/* -export function follow(object: any, path: string): null | string { - let currentChild = object; - - for (const comp of path.toLowerCase().split('/')) { - - // Search for a child object with a case-insensitive matching key - let matchingChild = null; - for (const key in currentChild) { - if (key.toLowerCase() === comp) { - matchingChild = currentChild[key]; - break; - } - } - - if (matchingChild === null) { return null; } - - currentChild = matchingChild; - } - - return currentChild; -} - -// "path/to/something:type!" -export function followRequired(data: any, path: string): string { - const value = follow(data, path); - if (value != null) { return value; } - return logger.throwArgumentError("invalid value", `data:${ path }`, - JSON.stringify(data)); -} -*/ -// See: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) -/* -export function uuidV4(randomBytes: BytesLike): string { - const bytes = getBytes(randomBytes, "randomBytes"); - - // Section: 4.1.3: - // - time_hi_and_version[12:16] = 0b0100 - bytes[6] = (bytes[6] & 0x0f) | 0x40; - - // Section 4.4 - // - clock_seq_hi_and_reserved[6] = 0b0 - // - clock_seq_hi_and_reserved[7] = 0b1 - bytes[8] = (bytes[8] & 0x3f) | 0x80; - - const value = hexlify(bytes); - - return [ - value.substring(2, 10), - value.substring(10, 14), - value.substring(14, 18), - value.substring(18, 22), - value.substring(22, 34), - ].join("-"); -} -*/ -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/lib.esm/wallet/utils.js.map b/lib.esm/wallet/utils.js.map deleted file mode 100644 index 7ffbbe739..000000000 --- a/lib.esm/wallet/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src.ts/wallet/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9E,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC9C,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAClE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9B,CAAC;IACD,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,KAAsB,EAAE,MAAc;IAC1D,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACtB,OAAO,KAAK,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC;QAC9B,KAAK,GAAG,GAAG,GAAG,KAAK,CAAC;IACrB,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAA6B;IACxD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,YAAY,CAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,OAAO,CAAI,MAAW,EAAE,KAAa;IACpD,MAAM,KAAK,GAAG,KAA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index 384cb372f..000000000 --- a/lib.esm/wallet/wallet.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { HDNodeWallet } from "./hdwallet.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -export declare class Wallet extends BaseWallet { - #private; - /** - * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected - * to %%provider%%. - */ - constructor({ key, prefix, provider, }: { - key: string | SigningKey; - prefix: string; - provider?: null | Provider; - }); - connect(provider: null | Provider): Wallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static fromEncryptedJson(json: string, password: Uint8Array | string, progress?: ProgressCallback): Promise; - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json: string, password: Uint8Array | string): HDNodeWallet | Wallet; - /** - * Creates a new random [[HDNodeWallet]] using the avavilable - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(prefix: string, provider?: null | Provider): HDNodeWallet; - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase({ phrase, prefix, provider, password, }: { - phrase: string; - prefix: string; - provider?: Provider; - password?: string; - }): HDNodeWallet; - static fromSeed({ seed, prefix, provider, path, }: { - seed: string; - prefix: string; - path?: string; - provider?: Provider; - }): HDNodeWallet; -} -//# sourceMappingURL=wallet.d.ts.map \ No newline at end of file diff --git a/lib.esm/wallet/wallet.d.ts.map b/lib.esm/wallet/wallet.d.ts.map deleted file mode 100644 index b640b9ef5..000000000 --- a/lib.esm/wallet/wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAe,YAAY,EAAE,MAAM,eAAe,CAAC;AAW1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AActD;;;;;;;;;GASG;AACH,qBAAa,MAAO,SAAQ,UAAU;;IACrC;;;OAGG;IACH,YAAY,EACX,GAAG,EACH,MAAM,EACN,QAAQ,GACR,EAAE;QACF,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,EAWA;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAMzC;IAED;;;;;;OAMG;IACG,OAAO,CACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,EAC7B,gBAAgB,CAAC,EAAE,gBAAgB,GACjC,OAAO,CAAC,MAAM,CAAC,CAGjB;IAED;;;;;;;;;OASG;IACH,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAGjD;IA6CD;;;;;;OAMG;IACH,OAAa,iBAAiB,CAC7B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,EAC7B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,CAiBhC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,GAC3B,YAAY,GAAG,MAAM,CAWvB;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAClB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,YAAY,CAWd;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,YAAY,CAUf;IACD,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAUf;CACD"} \ No newline at end of file diff --git a/lib.esm/wallet/wallet.js b/lib.esm/wallet/wallet.js deleted file mode 100644 index 3ad84da77..000000000 --- a/lib.esm/wallet/wallet.js +++ /dev/null @@ -1,180 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import { assertArgument } from "../utils/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { defaultPath, HDNodeWallet } from "./hdwallet.js"; -import { decryptCrowdsaleJson, isCrowdsaleJson } from "./json-crowdsale.js"; -import { decryptKeystoreJson, decryptKeystoreJsonSync, encryptKeystoreJson, encryptKeystoreJsonSync, isKeystoreJson, } from "./json-keystore.js"; -import { Mnemonic } from "./mnemonic.js"; -import { extractPrefix } from "../transaction/address.js"; -function stall(duration) { - return new Promise((resolve) => { - setTimeout(() => { - resolve(); - }, duration); - }); -} -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -export class Wallet extends BaseWallet { - /** - * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected - * to %%provider%%. - */ - constructor({ key, prefix, provider, }) { - if (typeof key === "string" && !key.startsWith("0x")) { - key = "0x" + key; - } - let signingKey = typeof key === "string" ? new SigningKey(key) : key; - super({ - signingKey, - prefix, - provider, - }); - } - connect(provider) { - return new Wallet({ - key: this.signingKey, - prefix: this.prefix, - provider, - }); - } - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - async encrypt(password, progressCallback) { - const account = { address: this.address, privateKey: this.privateKey }; - return await encryptKeystoreJson(account, password, { progressCallback }); - } - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password) { - const account = { address: this.address, privateKey: this.privateKey }; - return encryptKeystoreJsonSync(account, password); - } - static #fromAccount(account) { - assertArgument(account, "invalid JSON wallet", "json", "[ REDACTED ]"); - const address = account.address; - const prefix = extractPrefix(address); - if ("mnemonic" in account && - account.mnemonic && - account.mnemonic.locale === "en") { - const mnemonic = Mnemonic.fromEntropy(account.mnemonic.entropy); - const wallet = HDNodeWallet.fromMnemonic(mnemonic, prefix, account.mnemonic.path); - if (wallet.address === account.address && - wallet.privateKey === account.privateKey) { - return wallet; - } - console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key"); - } - const wallet = new Wallet({ - key: account.privateKey, - prefix, - }); - assertArgument(wallet.address === account.address, "address/privateKey mismatch", "json", "[ REDACTED ]"); - return wallet; - } - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static async fromEncryptedJson(json, password, progress) { - let account = null; - if (isKeystoreJson(json)) { - account = await decryptKeystoreJson(json, password, progress); - } - else if (isCrowdsaleJson(json)) { - if (progress) { - progress(0); - await stall(0); - } - account = decryptCrowdsaleJson(json, password); - if (progress) { - progress(1); - await stall(0); - } - } - return Wallet.#fromAccount(account); - } - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json, password) { - let account = null; - if (isKeystoreJson(json)) { - account = decryptKeystoreJsonSync(json, password); - } - else if (isCrowdsaleJson(json)) { - account = decryptCrowdsaleJson(json, password); - } - else { - assertArgument(false, "invalid JSON wallet", "json", "[ REDACTED ]"); - } - return Wallet.#fromAccount(account); - } - /** - * Creates a new random [[HDNodeWallet]] using the avavilable - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(prefix, provider) { - const wallet = HDNodeWallet.createRandom(prefix, undefined, undefined, undefined); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase({ phrase, prefix, provider, password, }) { - const wallet = HDNodeWallet.fromPhrase({ - phrase, - prefix, - password, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } - static fromSeed({ seed, prefix, provider, path, }) { - const wallet = HDNodeWallet.fromSeed({ - seed, - prefix, - path: path || defaultPath, - }); - if (provider) { - return wallet.connect(provider); - } - return wallet; - } -} -//# sourceMappingURL=wallet.js.map \ No newline at end of file diff --git a/lib.esm/wallet/wallet.js.map b/lib.esm/wallet/wallet.js.map deleted file mode 100644 index 90a9801c4..000000000 --- a/lib.esm/wallet/wallet.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EACN,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAOzC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,SAAS,KAAK,CAAC,QAAgB;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC9B,UAAU,CAAC,GAAG,EAAE;YACf,OAAO,EAAE,CAAC;QACX,CAAC,EAAE,QAAQ,CAAC,CAAC;IACd,CAAC,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU;IACrC;;;OAGG;IACH,YAAY,EACX,GAAG,EACH,MAAM,EACN,QAAQ,GAKR;QACA,IAAI,OAAO,GA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,QAAQ;SACR,CAAC,CAAC;QACH,IAAI,QAAQ,EAAE,CAAC;YACd,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,IAAI,GAMJ;QACA,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC;YACpC,IAAI;YACJ,MAAM;YACN,IAAI,EAAE,IAAI,IAAI,WAAW;SACzB,CAAC,CAAC;QACH,IAAI,QAAQ,EAAE,CAAC;YACd,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/bit-reader.d.ts b/lib.esm/wordlists/bit-reader.d.ts deleted file mode 100644 index 1aa849530..000000000 --- a/lib.esm/wordlists/bit-reader.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeBits(width: number, data: string): Array; -//# sourceMappingURL=bit-reader.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/bit-reader.d.ts.map b/lib.esm/wordlists/bit-reader.d.ts.map deleted file mode 100644 index 904904c46..000000000 --- a/lib.esm/wordlists/bit-reader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bit-reader.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA8BrE"} \ No newline at end of file diff --git a/lib.esm/wordlists/bit-reader.js b/lib.esm/wordlists/bit-reader.js deleted file mode 100644 index 724ac7817..000000000 --- a/lib.esm/wordlists/bit-reader.js +++ /dev/null @@ -1,32 +0,0 @@ -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -/** - * @_ignore - */ -export function decodeBits(width, data) { - const maxValue = (1 << width) - 1; - const result = []; - let accum = 0, bits = 0, flood = 0; - for (let i = 0; i < data.length; i++) { - // Accumulate 6 bits of data - accum = (accum << 6) | Base64.indexOf(data[i]); - bits += 6; - // While we have enough for a word... - while (bits >= width) { - // ...read the word - const value = accum >> (bits - width); - accum &= (1 << (bits - width)) - 1; - bits -= width; - // A value of 0 indicates we exceeded maxValue, it - // floods over into the next value - if (value === 0) { - flood += maxValue; - } - else { - result.push(value + flood); - flood = 0; - } - } - } - return result; -} -//# sourceMappingURL=bit-reader.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/bit-reader.js.map b/lib.esm/wordlists/bit-reader.js.map deleted file mode 100644 index f7282c1a6..000000000 --- a/lib.esm/wordlists/bit-reader.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bit-reader.js","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GACX,kEAAkE,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa,EAAE,IAAY;IACrD,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,IAAI,KAAK,GAAG,CAAC,EACZ,IAAI,GAAG,CAAC,EACR,KAAK,GAAG,CAAC,CAAC;IACX,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,4BAA4B;QAC5B,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,CAAC;QAEV,qCAAqC;QACrC,OAAO,IAAI,IAAI,KAAK,EAAE,CAAC;YACtB,mBAAmB;YACnB,MAAM,KAAK,GAAG,KAAK,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;YACtC,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;YACnC,IAAI,IAAI,KAAK,CAAC;YAEd,kDAAkD;YAClD,kCAAkC;YAClC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;gBACjB,KAAK,IAAI,QAAQ,CAAC;YACnB,CAAC;iBAAM,CAAC;gBACP,MAAM,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC;gBAC3B,KAAK,GAAG,CAAC,CAAC;YACX,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owl.d.ts b/lib.esm/wordlists/decode-owl.d.ts deleted file mode 100644 index 8822086bb..000000000 --- a/lib.esm/wordlists/decode-owl.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @_ignore - */ -export declare function decode(data: string, subs: string): Array; -/** - * @_ignore - */ -export declare function decodeOwl(data: string): Array; -//# sourceMappingURL=decode-owl.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owl.d.ts.map b/lib.esm/wordlists/decode-owl.d.ts.map deleted file mode 100644 index ce10ef2ad..000000000 --- a/lib.esm/wordlists/decode-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owl.ts"],"names":[],"mappings":"AAuBA;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA4BhE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAOrD"} \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owl.js b/lib.esm/wordlists/decode-owl.js deleted file mode 100644 index fe636fde6..000000000 --- a/lib.esm/wordlists/decode-owl.js +++ /dev/null @@ -1,55 +0,0 @@ -import { assertArgument } from "../utils/index.js"; -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z]*$/i; -function unfold(words, sep) { - let initial = 97; - return words.reduce((accum, word) => { - if (word === sep) { - initial++; - } - else if (word.match(Word)) { - accum.push(String.fromCharCode(initial) + word); - } - else { - initial = 97; - accum.push(word); - } - return accum; - }, []); -} -/** - * @_ignore - */ -export function decode(data, subs) { - // Replace all the substitutions with their expanded form - for (let i = subsChrs.length - 1; i >= 0; i--) { - data = data.split(subsChrs[i]).join(subs.substring(2 * i, 2 * i + 2)); - } - // Get all tle clumps; each suffix, first-increment and second-increment - const clumps = []; - const leftover = data.replace(/(:|([0-9])|([A-Z][a-z]*))/g, (all, item, semi, word) => { - if (semi) { - for (let i = parseInt(semi); i >= 0; i--) { - clumps.push(";"); - } - } - else { - clumps.push(item.toLowerCase()); - } - return ""; - }); - /* c8 ignore start */ - if (leftover) { - throw new Error(`leftovers: ${JSON.stringify(leftover)}`); - } - /* c8 ignore stop */ - return unfold(unfold(clumps, ";"), ":"); -} -/** - * @_ignore - */ -export function decodeOwl(data) { - assertArgument(data[0] === "0", "unsupported auwl data", "data", data); - return decode(data.substring(1 + 2 * subsChrs.length), data.substring(1, 1 + 2 * subsChrs.length)); -} -//# sourceMappingURL=decode-owl.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owl.js.map b/lib.esm/wordlists/decode-owl.js.map deleted file mode 100644 index 05bb54eb9..000000000 --- a/lib.esm/wordlists/decode-owl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owl.js","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owl.ts"],"names":[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IAAI,EAAE,IAAI,EAAE,EAAE;QACzB,IAAI,IAAI,EAAE,CAAC;YACV,KAAK,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC1C,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAClB,CAAC;QACF,CAAC;aAAM,CAAC;YACP,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,EAAE,CAAC;IACX,CAAC,CACD,CAAC;IACF,qBAAqB;IACrB,IAAI,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3D,CAAC;IACD,oBAAoB;IAEpB,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,uBAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAEvE,OAAO,MAAM,CACZ,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,EACvC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAC1C,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owla.d.ts b/lib.esm/wordlists/decode-owla.d.ts deleted file mode 100644 index 479e6c54a..000000000 --- a/lib.esm/wordlists/decode-owla.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeOwlA(data: string, accents: string): Array; -//# sourceMappingURL=decode-owla.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owla.d.ts.map b/lib.esm/wordlists/decode-owla.d.ts.map deleted file mode 100644 index da8636365..000000000 --- a/lib.esm/wordlists/decode-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA4BvE"} \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owla.js b/lib.esm/wordlists/decode-owla.js deleted file mode 100644 index 0bae6acf6..000000000 --- a/lib.esm/wordlists/decode-owla.js +++ /dev/null @@ -1,28 +0,0 @@ -import { assertArgument } from "../utils/index.js"; -import { decodeBits } from "./bit-reader.js"; -import { decodeOwl } from "./decode-owl.js"; -/** - * @_ignore - */ -export function decodeOwlA(data, accents) { - let words = decodeOwl(data).join(","); - // Inject the accents - accents.split(/,/g).forEach((accent) => { - const match = accent.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/); - assertArgument(match !== null, "internal error parsing accents", "accents", accents); - let posOffset = 0; - const positions = decodeBits(parseInt(match[3]), match[4]); - const charCode = parseInt(match[2]); - const regex = new RegExp(`([${match[1]}])`, "g"); - words = words.replace(regex, (all, letter) => { - const rem = --positions[posOffset]; - if (rem === 0) { - letter = String.fromCharCode(letter.charCodeAt(0), charCode); - posOffset++; - } - return letter; - }); - }); - return words.split(","); -} -//# sourceMappingURL=decode-owla.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/decode-owla.js.map b/lib.esm/wordlists/decode-owla.js.map deleted file mode 100644 index fb53252a4..000000000 --- a/lib.esm/wordlists/decode-owla.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],"names":[],"mappings":"AAAA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,CAAC;QACf,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/enwords.d.ts b/lib.esm/wordlists/enwords.d.ts deleted file mode 100644 index 8600e64a2..000000000 --- a/lib.esm/wordlists/enwords.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const enWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=enwords.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/enwords.d.ts.map b/lib.esm/wordlists/enwords.d.ts.map deleted file mode 100644 index ff2c89431..000000000 --- a/lib.esm/wordlists/enwords.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"enwords.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,i0VAC2yV,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/enwords.js b/lib.esm/wordlists/enwords.js deleted file mode 100644 index 157adbfd2..000000000 --- a/lib.esm/wordlists/enwords.js +++ /dev/null @@ -1,2 +0,0 @@ -export const enWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=enwords.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/enwords.js.map b/lib.esm/wordlists/enwords.js.map deleted file mode 100644 index 073cd4118..000000000 --- a/lib.esm/wordlists/enwords.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"enwords.js","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GACnB,8zVAA8zV,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/generation/encode-latin.d.ts b/lib.esm/wordlists/generation/encode-latin.d.ts deleted file mode 100644 index a646e8246..000000000 --- a/lib.esm/wordlists/generation/encode-latin.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export declare class BitWriter { - #private; - readonly width: number; - constructor(width: number); - write(value: number): void; - get length(): number; - get data(): string; -} -export interface AccentSet { - accent: number; - follows: string; - positions: Array; - positionsLength: number; - positionData: string; - positionDataLength: number; -} -export declare function extractAccents(words: Array): { - accents: Array; - words: Array; -}; -export declare function encodeOwl(words: Array): { - subs: string; - data: string; -}; -//# sourceMappingURL=encode-latin.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/generation/encode-latin.d.ts.map b/lib.esm/wordlists/generation/encode-latin.d.ts.map deleted file mode 100644 index 0a1f29f5d..000000000 --- a/lib.esm/wordlists/generation/encode-latin.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAyIA,qBAAa,SAAS;;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAKvB,YAAY,KAAK,EAAE,MAAM,EAIxB;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CASzB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA8BjB;CACD;AAED,MAAM,WAAW,SAAS;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IACrD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,CA+FA;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb,CAmDA"} \ No newline at end of file diff --git a/lib.esm/wordlists/generation/encode-latin.js b/lib.esm/wordlists/generation/encode-latin.js deleted file mode 100644 index bc04cf064..000000000 --- a/lib.esm/wordlists/generation/encode-latin.js +++ /dev/null @@ -1,357 +0,0 @@ -// OWL Data Format -// -// The Official WordList data format exported by this encoder -// encodes sorted latin-1 words (letters only) based on the -// fact that sorted words have prefixes with substantial -// overlap. -// -// For example, the words: -// [ Another, Apple, Apricot, Bread ] -// could be folded once with a single special character, such -// as ":" to yield: -// [ nother, pple, pricot, :, read ]. -// The First letter has been removed, but can be inferred by -// starting at A and incrementing to the next letter when ":" -// is encountered. -// -// The fold operation can be repeated for large sets as even within -// each folded set, there is substatial overlap in prefix. With the -// second special symbol ";", we get: -// [ ; x 13, other, :, ple, ricot, :, ; x 18, ead ] -// which can be further compressed by using numbers instead of the -// special character: -// [ 13, other, :, ple, ricot, :, 18, ead ] -// and to keep all values within a single byte, we only allow a -// maximum value of 10 (using 0 through 9 to represent 1 through 10), -// we get: -// [ 9, 2, other, :, ple, ricot, :, 9, 7, ead ] -// and we use camel-case to imply the bounrary, giving the final string: -// "92Other:PleRicot:97Ead" -// -// Once the entire latin-1 set has been collapsed, we use the remaining -// printable characters (except " and \, which require 2 bytes to represent -// in string) to substiture for the most common 2-letter pairs of letters -// in the string. -// -// OWLA Accent Format -// -// OWLA first removes all accents, and encodes that data using the OWL -// data format and encodes the accents as a base-64 series of 6-bit -// packed bits representing the distance from one followed letter to the -// next. -// -// For example, the acute accent in a given language may follow either -// a or e, in which case the follow-set is "ae". Each letter in the entire -// set is indexed, so the set of words with the accents: -// "thisA/ppleDoe/sNotMa/tterToMe/" -// " 1^ 2^ 3^ 4^ 5^ 6^ " <-- follow-set members, ALL a's and e's -// which gives the positions: -// [ 0, 2, 3, 4, 6 ] -// which then reduce to the distances -// [ 0, 2, 1, 1, 2 ] -// each of which fit into a 2-bit value, so this can be encoded as the -// base-64 encoded string: -// 00 10 01 01 10 = 001001 1010xx -// -// The base-64 set used has all number replaced with their -// shifted-counterparts to prevent comflicting with the numbers used in -// the fold operation to indicate the number of ";". -import fs from "fs"; -import { id } from "../../hash/id.js"; -import { decodeOwl } from "../decode-owl.js"; -import { decodeOwlA } from "../decode-owla.js"; -const subsChrs = " !#$%&'()*+,-./<=>?@[]^_`{|}~"; -const Word = /^[a-z'`]*$/i; -function fold(words, sep) { - const output = []; - let initial = 97; - for (const word of words) { - if (word.match(Word)) { - while (initial < word.charCodeAt(0)) { - initial++; - output.push(sep); - } - output.push(word.substring(1)); - } - else { - initial = 97; - output.push(word); - } - } - return output; -} -function camelcase(words) { - return words - .map((word) => { - if (word.match(Word)) { - return word[0].toUpperCase() + word.substring(1); - } - else { - return word; - } - }) - .join(""); -} -//let cc = 0, ce = 0; -/* -function getChar(c: string): string { - //if (c === "e") { ce++; } - if (c >= 'a' && c <= 'z') { return c; } - if (c.charCodeAt(1)) { - throw new Error(`bad char: "${ c }"`); - } - //cc++; - return ""; - if (c.charCodeAt(0) === 768) { return "`"; } - if (c.charCodeAt(0) === 769) { return "'"; } - if (c.charCodeAt(0) === 771) { return "~"; } - throw new Error(`Unsupported character: ${ c } (${ c.charCodeAt(0) }, ${ c.charCodeAt(1) })`); -} -function mangle(text: string): { word: string, special: string } { - const result: Array = [ ]; - for (let i = 0; i < text.length; i++) { - const c = getChar(text[i]); - result.push(c); - } - - const word = result.join(""); - if (word[1] >= 'a' && word[1] <= 'z') { return { word, special: " " }; } - return { word: word[0] + word.substring(2), special: word[1] }; -} -*/ -/* - Store: [ accent ][ targets ][ rle data; base64-tail ] - ` ae 3, 100 = (63, 37), 15 - ~ n 63, 64 = (63, 1), 27 -*/ -const Base64 = ")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; -export class BitWriter { - width; - #data; - #bitLength; - constructor(width) { - this.width = width; - this.#data = []; - this.#bitLength = 0; - } - write(value) { - const maxValue = (1 << this.width) - 1; - while (value > maxValue) { - this.#data.push(0); - this.#bitLength += this.width; - value -= maxValue; - } - this.#data.push(value); - this.#bitLength += this.width; - } - get length() { - return 1 + Math.trunc((this.#bitLength + 5) / 6); - } - get data() { - let result = String(this.width); - let bits = 0; - let accum = 0; - const data = this.#data.slice(); - let bitMod = this.#bitLength % 6; - while (bitMod !== 0 && bitMod < 6) { - data.push(0); - bitMod += this.width; - } - for (const value of data) { - accum <<= this.width; - accum |= value; - bits += this.width; - if (bits < 6) { - continue; - } - result += Base64[accum >> (bits - 6)]; - bits -= 6; - accum &= (1 << bits) - 1; - } - if (result.length !== this.length) { - throw new Error(`Hmm: ${this.length} ${result.length} ${result}`); - } - return result; - } -} -function sorted(text) { - const letters = text.split(""); - letters.sort(); - return letters.join(""); -} -// if (c.charCodeAt(0) === 768) { return "`"; } -// if (c.charCodeAt(0) === 769) { return "'"; } -// if (c.charCodeAt(0) === 771) { return "~"; } -export function extractAccents(words) { - // Build a list that maps accents to the letters it can follow - const followsMap = new Map(); - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= "a" && c <= "z") { - continue; - } - // Make sure this positions and codepoint make sense - if (c.charCodeAt(1)) { - throw new Error(`unsupported codepoint: "${c}"`); - } - if (i === 0) { - throw new Error(`unmatched accent: ${c}`); - } - const ac = c.charCodeAt(0), lastLetter = word[i - 1]; - const follows = followsMap.get(ac) || ""; - if (follows.indexOf(lastLetter) === -1) { - followsMap.set(ac, sorted(follows + lastLetter)); - } - } - } - // Build the positions of each follow-set for those accents - const positionsMap = new Map(); - for (const [accent, follows] of followsMap) { - let count = 0; - for (const word of words) { - for (let i = 0; i < word.length; i++) { - const c = word[i], ac = c.charCodeAt(0); - if (follows.indexOf(c) >= 0) { - count++; - } - if (ac === accent) { - const pos = positionsMap.get(ac) || []; - pos.push(count); - positionsMap.set(ac, pos); - } - } - } - } - const accents = []; - for (const [accent, follows] of followsMap) { - let last = -1; - const positions = (positionsMap.get(accent) || []).map((value, index) => { - const delta = value - last; - last = value; - if (index === 0) { - return value; - } - return delta; - }); - // Find the best encoding of the position data - let positionData = ""; - for (let i = 2; i < 7; i++) { - const bitWriter = new BitWriter(i); - for (const p of positions) { - bitWriter.write(p); - } - if (positionData === "" || bitWriter.length < positionData.length) { - positionData = bitWriter.data; - } - } - const positionsLength = positions.length; - const positionDataLength = positionData.length; - accents.push({ - accent, - follows, - positions, - positionsLength, - positionData, - positionDataLength, - }); - } - words = words.map((word) => { - let result = ""; - for (let i = 0; i < word.length; i++) { - const c = word[i]; - if (c >= "a" && c <= "z") { - result += c; - } - } - return result; - }); - return { accents, words }; -} -// Encode Official WordList -export function encodeOwl(words) { - // Fold the sorted words by indicating delta for the first 2 letters - let data = camelcase(fold(fold(words, ":"), ";")); - // Replace semicolons with counts (e.g. ";;;" with "3") - data = data.replace(/(;+)/g, (all, semis) => { - let result = ""; - while (semis.length) { - let count = semis.length; - if (count > 10) { - count = 10; - } - result += String(count - 1); - semis = semis.substring(count); - } - return result; - }); - // Finds the best option for a shortcut replacement using the - // unused ascii7 characters - function findBest() { - const tally = {}; - const l = 2; - for (let i = l; i < data.length; i++) { - const key = data.substring(i - l, i); - tally[key] = (tally[key] || 0) + 1; - } - const sorted = Object.keys(tally).map((text) => { - return { - text, - count: tally[text], - save: tally[text] * (text.length - 1), - }; - }); - sorted.sort((a, b) => b.save - a.save); - return sorted[0].text; - } - // Make substitutions - let subs = ""; - for (let i = 0; i < subsChrs.length; i++) { - const n = subsChrs[i], o = findBest(); - subs += o; - data = data.split(o).join(n); - } - return { data, subs }; -} -// Returns either: -// - OWL data for accent-free latin-1: { data, accentds: "" } -// - OWLA data for accented latin-1: { data, accents } -function encodeWords(_words) { - const { accents, words } = extractAccents(_words); - const { data, subs } = encodeOwl(words); - const accentData = accents - .map(({ accent, follows, positionData }) => { - return `${follows}${accent}${positionData}`; - }) - .join(","); - return { - data: `0${subs}${data}`, - accents: accentData, - }; -} -// CLI -const content = fs.readFileSync(process.argv[2]).toString(); -const words = content.split("\n").filter(Boolean); -const { data, accents } = encodeWords(words); -if (accents) { - const rec = decodeOwlA(data, accents); - console.log("DATA: ", JSON.stringify(data)); - console.log("ACCENTS: ", JSON.stringify(accents)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id(content)); - console.log("RATIO: ", Math.trunc((100 * data.length) / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } -} -else { - const rec = decodeOwl(data); - console.log("DATA: ", JSON.stringify(data)); - console.log("LENGTH: ", data.length); - console.log("CHECKSUM: ", id(content)); - console.log("RATIO: ", Math.trunc((100 * data.length) / content.length) + "%"); - if (rec.join("\n") !== words.join("\n")) { - throw new Error("no match!"); - } -} -//# sourceMappingURL=encode-latin.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/generation/encode-latin.js.map b/lib.esm/wordlists/generation/encode-latin.js.map deleted file mode 100644 index 7ac8b12a0..000000000 --- a/lib.esm/wordlists/generation/encode-latin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode-latin.js","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,EAAE;AACF,6DAA6D;AAC7D,2DAA2D;AAC3D,wDAAwD;AACxD,WAAW;AACX,EAAE;AACF,0BAA0B;AAC1B,uCAAuC;AACvC,6DAA6D;AAC7D,mBAAmB;AACnB,uCAAuC;AACvC,4DAA4D;AAC5D,6DAA6D;AAC7D,kBAAkB;AAClB,EAAE;AACF,mEAAmE;AACnE,mEAAmE;AACnE,qCAAqC;AACrC,qDAAqD;AACrD,kEAAkE;AAClE,qBAAqB;AACrB,6CAA6C;AAC7C,+DAA+D;AAC/D,qEAAqE;AACrE,UAAU;AACV,iDAAiD;AACjD,wEAAwE;AACxE,6BAA6B;AAC7B,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,yEAAyE;AACzE,iBAAiB;AACjB,EAAE;AACF,qBAAqB;AACrB,EAAE;AACF,sEAAsE;AACtE,mEAAmE;AACnE,wEAAwE;AACxE,QAAQ;AACR,EAAE;AACF,sEAAsE;AACtE,0EAA0E;AAC1E,wDAAwD;AACxD,qCAAqC;AACrC,6EAA6E;AAC7E,6BAA6B;AAC7B,sBAAsB;AACtB,qCAAqC;AACrC,sBAAsB;AACtB,sEAAsE;AACtE,0BAA0B;AAC1B,qCAAqC;AACrC,EAAE;AACF,0DAA0D;AAC1D,uEAAuE;AACvE,oDAAoD;AAEpD,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,kBA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GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;AACF,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/index.d.ts b/lib.esm/wordlists/index.d.ts deleted file mode 100644 index 04a911c83..000000000 --- a/lib.esm/wordlists/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -export { Wordlist } from "./wordlist.js"; -export { LangEn } from "./lang-en.js"; -export { WordlistOwl } from "./wordlist-owl.js"; -export { WordlistOwlA } from "./wordlist-owla.js"; -export { wordlists } from "./wordlists.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/index.d.ts.map b/lib.esm/wordlists/index.d.ts.map deleted file mode 100644 index ecd1d4b63..000000000 --- a/lib.esm/wordlists/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/index.js b/lib.esm/wordlists/index.js deleted file mode 100644 index e3571e6f4..000000000 --- a/lib.esm/wordlists/index.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -export { Wordlist } from "./wordlist.js"; -export { LangEn } from "./lang-en.js"; -export { WordlistOwl } from "./wordlist-owl.js"; -export { WordlistOwlA } from "./wordlist-owla.js"; -export { wordlists } from "./wordlists.js"; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/index.js.map b/lib.esm/wordlists/index.js.map deleted file mode 100644 index 6865131ac..000000000 --- a/lib.esm/wordlists/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src.ts/wordlists/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-cz.d.ts b/lib.esm/wordlists/lang-cz.d.ts deleted file mode 100644 index c199d4fad..000000000 --- a/lib.esm/wordlists/lang-cz.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist(): LangCz; -} -//# sourceMappingURL=lang-cz.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-cz.d.ts.map b/lib.esm/wordlists/lang-cz.d.ts.map deleted file mode 100644 index 344196e7e..000000000 --- a/lib.esm/wordlists/lang-cz.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-cz.js b/lib.esm/wordlists/lang-cz.js deleted file mode 100644 index 71eff6bd9..000000000 --- a/lib.esm/wordlists/lang-cz.js +++ /dev/null @@ -1,33 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -const words = "0itatkastcenaovo$taouleraeki&chor*teci%enbalodaeladet'!Chn=0Di#%E%^1Resa2Rese3CeT'#0EjKohol0Pu)%0A&sDul#Ekdo)Ke)Ti#Ul|3}aOgan%0FaltI$@tPi,%TmaTronom0LasL{i#Ol0Tobus4Yl:B#}R'?TaU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omal RavaR( Rud#Rvu1A^An C`]N (NoOv&Y/l Zav(1I/aR! 0B'.Br0Ed~EnkuEs_aOnR!Uk'odYk"; -const checksum = "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a"; -let wordlist = null; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor() { - super("cz", words, checksum); - } - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangCz(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-cz.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-cz.js.map b/lib.esm/wordlists/lang-cz.js.map deleted file mode 100644 index abb100879..000000000 --- a/lib.esm/wordlists/lang-cz.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-cz.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACV,q9NAAq9N,CAAC;AACv9N,MAAM,QAAQ,GACb,oEAAoE,CAAC;AAEtE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-en.d.ts b/lib.esm/wordlists/lang-en.d.ts deleted file mode 100644 index 87a3234bb..000000000 --- a/lib.esm/wordlists/lang-en.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEn; -} -//# sourceMappingURL=lang-en.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-en.d.ts.map b/lib.esm/wordlists/lang-en.d.ts.map deleted file mode 100644 index bcff43d4d..000000000 --- a/lib.esm/wordlists/lang-en.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-en.js b/lib.esm/wordlists/lang-en.js deleted file mode 100644 index 50fb33fa1..000000000 --- a/lib.esm/wordlists/lang-en.js +++ /dev/null @@ -1,33 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -const words = "0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-EgSe0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-PM&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryFN Noc|PutQuirySSue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/: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Pla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOgAyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NNGradeHoldOnP Set1BOng::Rd3Ar~ow9UUngU`:3BraRo9NeO"; -const checksum = "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"; -let wordlist = null; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor() { - super("en", words, checksum); - } - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangEn(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-en.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-en.js.map b/lib.esm/wordlists/lang-en.js.map deleted file mode 100644 index ad1b69854..000000000 --- a/lib.esm/wordlists/lang-en.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-en.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACV,u3LAAu3L,CAAC;AACz3L,MAAM,QAAQ,GACb,oEAAoE,CAAC;AAEtE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-es.d.ts b/lib.esm/wordlists/lang-es.d.ts deleted file mode 100644 index 7e51683e7..000000000 --- a/lib.esm/wordlists/lang-es.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwlA } from "./wordlist-owla.js"; -/** - * The [[link-bip39-es]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEs extends WordlistOwlA { - /** - * Creates a new instance of the Spanish language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEs]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEs``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEs; -} -//# sourceMappingURL=lang-es.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-es.d.ts.map b/lib.esm/wordlists/lang-es.d.ts.map deleted file mode 100644 index e52928599..000000000 --- a/lib.esm/wordlists/lang-es.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-es.js b/lib.esm/wordlists/lang-es.js deleted file mode 100644 index 7e2116d3f..000000000 --- a/lib.esm/wordlists/lang-es.js +++ /dev/null @@ -1,34 +0,0 @@ -import { WordlistOwlA } from "./wordlist-owla.js"; -const words = "0arertoiotadonoaRteirroenaNonaLsolocoiliaralaorrenadaChoN$n0A>Dom,EjaI!#Oga&O'Or#RazoR*Ue=U<0Ab Adem@CeLe%OmoRa!RozUn0DazD$GeLaM,#S,)T^0AlAnceA+EEl]`E`EstruzI.I<2ErU{U'0Af[nArO)Uc Uf_Ul:BaB^|eH@IleJ Lanz/c.LdeMbuN>Nd-oRb(>RnizR+Scu]S#nSu[Tal]T!@T*Tu%UlZ 3BeBid/=S SoSt@3|oEnNgo2An>OqueUsa2ABi`BoCaCi`DaDegaIn//!oLsaMb-{dNi#N}saiRdeRr SqueTeTinVe{Zal2AvoAzoEchaEveIl=In>IsaOcaOmaOnceO)UjaUs>U#2CeoCleE'EyFan{F.HoIt_L#Rbuj(l(+Sc TacaZ.:Bal=BezaBi`B[CaoDav!D,aErFeI{ImanJaJ.LLam Lc$L&Li{dLleLm/^LvoMaMb$Mel=Mi'Mp}c!Nd?Nel-gu+Nic-#N-.ObaOsPazPi%nPo)Pt Puch((b.RcelRe%Rg(i'RneRpe%R+R%SaS>S!oSpaS#rT^ceT_U{lUsaZ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aEin%EnEp EsIbuIgoIpaIs)IunfoOfeoOmpaOn>OpaO)OzoU>Ue'Ufa2B!@BoEr#MbaM^NelNic(bin(ismoR'T^:0Ic 9C!a0B[l0I{dIrIv!; - join(words: Array): string; - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist(): LangJa; -} -//# sourceMappingURL=lang-ja.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ja.d.ts.map b/lib.esm/wordlists/lang-ja.d.ts.map deleted file mode 100644 index 82a3ec1e4..000000000 --- a/lib.esm/wordlists/lang-ja.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6IzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ja.js b/lib.esm/wordlists/lang-ja.js deleted file mode 100644 index 6dc7001f6..000000000 --- a/lib.esm/wordlists/lang-ja.js +++ /dev/null @@ -1,157 +0,0 @@ -import { id } from "../hash/index.js"; -import { hexlify, assertArgument, toUtf8Bytes, toUtf8String, } from "../utils/index.js"; -import { Wordlist } from "./wordlist.js"; -const data = [ - // 4-kana words - "AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAME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QfXNJeEqXNhGJWENJFiJRQlIJbEQJfXxDQqXcfXQFNDEJQFwXUJDYcnUJDJIBgQDIUJTRDJFEqDSJQSJFSJQIJFSOPeZtSJFZJHCJXQfXCTDEqFGJBSJFGJBOfXGJBcqXGJHNJDGJRLiJEJfXEqEJFEJPEFpBEJYJBZJFYBwXUJYiJMEBYJZJyTYTONJXpQMFXFpeGIDdpJFstXpJFcPDLBVSJRLHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC", - // 8-kana words - "BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD", - // 9-kana words - "QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD", - // 10-kana words - "IJBEJqXZJ", -]; -// Maps each character into its kana value (the index) -const mapping = "~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt"; -let _wordlist = null; -function hex(word) { - return hexlify(toUtf8Bytes(word)); -} -const KiYoKu = "0xe3818de38284e3818f"; -const KyoKu = "0xe3818de38283e3818f"; -function toString(data) { - return toUtf8String(new Uint8Array(data)); -} -function loadWords() { - if (_wordlist !== null) { - return _wordlist; - } - const wordlist = []; - // Transforms for normalizing (sort is a not quite UTF-8) - const transform = {}; - // Delete the diacritic marks - transform[toString([227, 130, 154])] = false; - transform[toString([227, 130, 153])] = false; - // Some simple transforms that sort out most of the order - transform[toString([227, 130, 133])] = toString([227, 130, 134]); - transform[toString([227, 129, 163])] = toString([227, 129, 164]); - transform[toString([227, 130, 131])] = toString([227, 130, 132]); - transform[toString([227, 130, 135])] = toString([227, 130, 136]); - // Normalize words using the transform - function normalize(word) { - let result = ""; - for (let i = 0; i < word.length; i++) { - let kana = word[i]; - const target = transform[kana]; - if (target === false) { - continue; - } - if (target) { - kana = target; - } - result += kana; - } - return result; - } - // Sort how the Japanese list is sorted - function sortJapanese(a, b) { - a = normalize(a); - b = normalize(b); - if (a < b) { - return -1; - } - if (a > b) { - return 1; - } - return 0; - } - // Load all the words - for (let length = 3; length <= 9; length++) { - const d = data[length - 3]; - for (let offset = 0; offset < d.length; offset += length) { - const word = []; - for (let i = 0; i < length; i++) { - const k = mapping.indexOf(d[offset + i]); - word.push(227); - word.push(k & 0x40 ? 130 : 129); - word.push((k & 0x3f) + 128); - } - wordlist.push(toString(word)); - } - } - wordlist.sort(sortJapanese); - // For some reason kyoku and kiyoku are flipped in node (!!). - // The order SHOULD be: - // - kyoku - // - kiyoku - // This should ignore "if", but that doesn't work here?? - /* c8 ignore start */ - if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) { - const tmp = wordlist[442]; - wordlist[442] = wordlist[443]; - wordlist[443] = tmp; - } - /* c8 ignore stop */ - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== - "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600") { - throw new Error("BIP39 Wordlist for ja (Japanese) FAILED"); - } - /* c8 ignore stop */ - _wordlist = wordlist; - return wordlist; -} -let wordlist = null; -/** - * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangJa extends Wordlist { - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ja"); - } - getWord(index) { - const words = loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords().indexOf(word); - } - split(phrase) { - //logger.assertNormalize(); - return phrase.split(/(?:\u3000| )+/g); - } - join(words) { - return words.join("\u3000"); - } - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangJa(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-ja.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ja.js.map b/lib.esm/wordlists/lang-ja.js.map deleted file mode 100644 index c14d46263..000000000 --- a/lib.esm/wordlists/lang-ja.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ja.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EACN,OAAO,EACP,cAAc,EACd,WAAW,EACX,YAAY,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,IAAI,GAAG;IACZ,eAAe;IACf,orEAAorE;IAEprE,eAAe;IACf,ssGAAssG;IAEtsG,eAAe;IACf,4uDAA4uD;IAE5uD,eAAe;IACf,olBAAolB;IAEplB,eAAe;IACf,4JAA4J;IAE5J,eAAe;IACf,0GAA0G;IAE1G,gBAAgB;IAChB,WAAW;CACX,CAAC;AAEF,sDAAsD;AACtD,MAAM,OAAO,GACZ,6FAA6F,CAAC;AAE/F,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,SAAS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CAAC;QACF,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC5D,CAAC;IACD,oBAAoB;IAEpB,SAAS,GAAG,QAAQ,CAAC;IAErB,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,CAAC,CAAC;IACb,CAAC;IAED,OAAO,CAAC,KAAa;QACpB,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;QAC1B,cAAc,CACb,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAClC,uBAAuB,KAAK,EAAE,EAC9B,OAAO,EACP,KAAK,CACL,CAAC;QACF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,IAAY;QACxB,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,MAAc;QACnB,2BAA2B;QAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,CAAC,KAAoB;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ko.d.ts b/lib.esm/wordlists/lang-ko.d.ts deleted file mode 100644 index 4329e0556..000000000 --- a/lib.esm/wordlists/lang-ko.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor(); - getWord(index: number): string; - getWordIndex(word: string): number; - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist(): LangKo; -} -//# sourceMappingURL=lang-ko.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ko.d.ts.map b/lib.esm/wordlists/lang-ko.d.ts.map deleted file mode 100644 index 4e6fdeecb..000000000 --- a/lib.esm/wordlists/lang-ko.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ko.js b/lib.esm/wordlists/lang-ko.js deleted file mode 100644 index eea75d97c..000000000 --- a/lib.esm/wordlists/lang-ko.js +++ /dev/null @@ -1,90 +0,0 @@ -import { id } from "../hash/index.js"; -import { assertArgument, toUtf8String } from "../utils/index.js"; -import { Wordlist } from "./wordlist.js"; -const data = [ - "OYAa", - "ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#Ln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FX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg", - "HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb", - "AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl", -]; -const codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"; -function getHangul(code) { - if (code >= 40) { - code = code + 168 - 40; - } - else if (code >= 19) { - code = code + 97 - 19; - } - return toUtf8String(new Uint8Array([225, (code >> 6) + 132, (code & 0x3f) + 128])); -} -let _wordlist = null; -function loadWords() { - if (_wordlist != null) { - return _wordlist; - } - const wordlist = []; - data.forEach((data, length) => { - length += 4; - for (let i = 0; i < data.length; i += length) { - let word = ""; - for (let j = 0; j < length; j++) { - word += getHangul(codes.indexOf(data[i + j])); - } - wordlist.push(word); - } - }); - wordlist.sort(); - // Verify the computed list matches the official list - /* istanbul ignore if */ - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== - "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a") { - throw new Error("BIP39 Wordlist for ko (Korean) FAILED"); - } - /* c8 ignore stop */ - _wordlist = wordlist; - return wordlist; -} -let wordlist = null; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor() { - super("ko"); - } - getWord(index) { - const words = loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords().indexOf(word); - } - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangKo(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-ko.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-ko.js.map b/lib.esm/wordlists/lang-ko.js.map deleted file mode 100644 index 9a24b792d..000000000 --- a/lib.esm/wordlists/lang-ko.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ko.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,IAAI,GAAG;IACZ,MAAM;IACN,y5JAAy5J;IACz5J,8lIAA8lI;IAC9lI,i8BAAi8B;IACj8B,koCAAkoC;IACloC,yaAAya;IACza,gHAAgH;IAChH,+EAA+E;CAC/E,CAAC;AAEF,MAAM,KAAK,GACV,wEAAwE,CAAC;AAE1E,SAAS,SAAS,CAAC,IAAY;IAC9B,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;QAChB,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,EAAE,CAAC;IACxB,CAAC;SAAM,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;QACvB,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,YAAY,CAClB,IAAI,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,I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EnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,CAAC,CAAC;IACb,CAAC;IAED,OAAO,CAAC,KAAa;QACpB,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;QAC1B,cAAc,CACb,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAClC,uBAAuB,KAAK,EAAE,EAC9B,OAAO,EACP,KAAK,CACL,CAAC;QACF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,IAAY;QACxB,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-pt.d.ts b/lib.esm/wordlists/lang-pt.d.ts deleted file mode 100644 index f218013c6..000000000 --- a/lib.esm/wordlists/lang-pt.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist(): LangPt; -} -//# sourceMappingURL=lang-pt.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-pt.d.ts.map b/lib.esm/wordlists/lang-pt.d.ts.map deleted file mode 100644 index 024c97c03..000000000 --- a/lib.esm/wordlists/lang-pt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-pt.js b/lib.esm/wordlists/lang-pt.js deleted file mode 100644 index 515515cef..000000000 --- a/lib.esm/wordlists/lang-pt.js +++ /dev/null @@ -1,33 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -const words = "0arad!ototealirertainrasoent hoandoaR#riareha!aroele'oronul0Aca%AixoAl A%rDuz'El]Er$IsmoO$ Rum S-&T(i&TigoVo[=0F&.Il#P' S?S* So&/Sun$Tr&0Ac#Adu+Al/A[f E End(Er_EuIng'Ir?IvoOl{oRac Revi=RizU&Um0Di$rM-.R>o+TismoT|@Tu 0Ali An%Ar@Ent&Es,I?Is Ul,1Ila1Ar E=Ei%Ulejo:B BosaC&]uCh `C@GagemI+c>~/Se#S)n%Ta)Te=rTidaTomTuc Unil]3B(IjoIr^IsebolLd!eLezaLgaLisc Ndi$Ng&aNz(RimbauRl*d>_Sou_XigaZ(_3CoCu=En&Foc&Furc G|naLhe%Mest[Mo$rOlog@OmboOsf(aPol Rr-$Scoi$Sne$SpoSsex$TolaZ _2Ind#OcoOque 2A$BagemC#CejoChec]Ico.L^LetimL]LoMb{oNdeNecoNi)Rb~h>d>e&R+c]V*oXe?2AncoAsaAvezaEuIgaIl/Inc OaOchu+Onze O$Uxo2C]DismoF LeRacoScaS$Z*a:Bimb Rn{oRpe%R['>)zRv&/SacoScaSeb[S%loS~oT a)Tiv UleUs?U%l V&oV(na3BolaDil]G}]Lebr L~ Nou+N,N%ioRc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& Dest[D@t+D+G^I$r&IxeLeLicplexoRsi<>%nceRucaSc#SquisaS,aTisc 3AdaC#Ed!eGm-$Last+Lh#Lo.M-)Nc`NguimN]No%N.On{oPocaQue%ResRue)Sc S$laTg-$Rje)Tur Ud!eXof}eZ}&3C C~ DaD-$Di#Do,Du$rGm-$G[=Gun=IvaLe$LvagemM<&M-%N?N/rNsu&Nt#P #Rei>*g>+RvoTemb_T|3GiloLhue)Lic}eMetr@Mpat@M~ N&Nc(oNg~ NopseN$ni>-eRiTu#5B(fis)Rp[s>[&Rt'Sp'oS%n$:B`aBle%Bu^C/G `aLh(LoLvezMdioRef>j>+xaTuagemUr*oXativoXis)3Atr&C(Ci=Cl#Dio,IaIm Lef}eLh#Mp(oN-%N,rN.Rm&RnoRr-oSeSou+St#ToXtu+Xugo3A+G`aJoloMbr MidezNgi=N%'oRagemT~ 5Al]C]L( LiceM^Mil/N`Ntu+Pe%R>ci=RneioRqueRr!>$S.UcaUp{aX*a2Ab&/Acej Adu$rAfeg Aje$AmaAnc ApoAs{oAt?Av E*oEm(Epid EvoIagemIboIcicloId-%Ilog@Ind!eIploItur Iunf&Oc Ombe)OvaUnfoUque2B~ CquesaT` T|i&:7V 3Bigo0HaId!eIf|me3Olog@SoTigaUbu0A=InaUfru':C*aDi G o,I=,LaL-%Lid!eLo[sN)gemQu{oRe)Rr(Sc~ Sil]S,u+Z Zio3A=D Ge.Ic~ L{oLhiceLu=Nce=rNdav&N( Nt[Rb&Rd!eRe?Rg}h>m`/RnizRs R%n%SpaSti=T|i&3Adu$AgemAj Atu+Br?D{aDr @ElaGaG-%Gi G| L ejoNcoNhe)NilOle)R!>tudeSi.S$Tr&V{oZ*/5A=rArG&L<%LeibolL)gemLumo,Nt!e5L$Vuz`a::D[zRope3QueRe.Rife3Ng ::Ng#Rp 3BuL?9Mb Olog@5Mbi="; -const checksum = "0x2219000926df7b50d8aa0a3d495826b988287df4657fbd100e6fe596c8f737ac"; -let wordlist = null; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor() { - super("pt", words, checksum); - } - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist() { - if (wordlist == null) { - wordlist = new LangPt(); - } - return wordlist; - } -} -//# sourceMappingURL=lang-pt.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-pt.js.map b/lib.esm/wordlists/lang-pt.js.map deleted file mode 100644 index 88dbc04f3..000000000 --- a/lib.esm/wordlists/lang-pt.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-pt.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,KAAK,GACV,s0OAAs0O,CAAC;AACx0O,MAAM,QAAQ,GACb,oEAAoE,CAAC;AAEtE,IAAI,QAAQ,GAAkB,IAAI,CAAC;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH;QACC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ;QACd,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-zh.d.ts b/lib.esm/wordlists/lang-zh.d.ts deleted file mode 100644 index 5d0c14c7c..000000000 --- a/lib.esm/wordlists/lang-zh.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect: string); - getWord(index: number): string; - getWordIndex(word: string): number; - split(phrase: string): Array; - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect: string): LangZh; -} -//# sourceMappingURL=lang-zh.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-zh.d.ts.map b/lib.esm/wordlists/lang-zh.d.ts.map deleted file mode 100644 index 06d1b5870..000000000 --- a/lib.esm/wordlists/lang-zh.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;;;OASG;IACH,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKvC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/lang-zh.js b/lib.esm/wordlists/lang-zh.js deleted file mode 100644 index efc68db8b..000000000 --- a/lib.esm/wordlists/lang-zh.js +++ /dev/null @@ -1,95 +0,0 @@ -import { id } from "../hash/index.js"; -import { assertArgument, toUtf8String } from "../utils/index.js"; -import { Wordlist } from "./wordlist.js"; -const data = "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN> 2), - 128 + codes.indexOf(data[i * 3 + 1]), - 128 + codes.indexOf(data[i * 3 + 2]), - ]; - if (locale === "zh_tw") { - const common = s % 4; - for (let i = common; i < 3; i++) { - bytes[i] = - codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128); - } - } - wordlist.push(toUtf8String(new Uint8Array(bytes))); - } - // Verify the computed list matches the official list - const checksum = id(wordlist.join("\n") + "\n"); - /* c8 ignore start */ - if (checksum !== Checks[locale]) { - throw new Error(`BIP39 Wordlist for ${locale} (Chinese) FAILED`); - } - /* c8 ignore stop */ - _wordlist[locale] = wordlist; - return wordlist; -} -const wordlists = {}; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect) { - super("zh_" + dialect); - } - getWord(index) { - const words = loadWords(this.locale); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return loadWords(this.locale).indexOf(word); - } - split(phrase) { - phrase = phrase.replace(/(?:\u3000| )+/g, ""); - return phrase.split(""); - } - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect) { - if (wordlists[dialect] == null) { - wordlists[dialect] = new LangZh(dialect); - } - return wordlists[dialect]; - } -} -//# sourceMappingURL=lang-zh.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/lang-zh.js.map b/lib.esm/wordlists/lang-zh.js.map deleted file mode 100644 index dccaac86c..000000000 --- a/lib.esm/wordlists/lang-zh.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-zh.js","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,IAAI,GACT,kgMAAkgM,CAAC;AACpgM,MAAM,SAAS,GACd,6lDAA6lD,CAAC;AAE/lD,MAAM,SAAS,GAAyC;IACvD,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACX,CAAC;AAEF,MAAM,MAAM,GAA2B;IACtC,KAAK,EAAE,oEAAoE;IAC3E,KAAK,EAAE,oEAAoE;CAC3E,CAAC;AAEF,MAAM,KAAK,GACV,kEAAkE,CAAC;AACpE,MAAM,KAAK,GAAG,4BAA4B,CAAC;AAE3C,SAAS,SAAS,CAAC,MAAc;IAChC,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC,MAAM,CAAkB,CAAC;IAC3C,CAAC;IAED,MAAM,QAAQ,GAAG,EAAE,CAAC;IAEpB,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EA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jB,CAAC;AAED,MAAM,SAAS,GAA2B,EAAE,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,OAAO,MAAO,SAAQ,QAAQ;IACnC;;;;;;;;;OASG;IACH,YAAY,OAAe;QAC1B,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,CAAC,KAAa;QACpB,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrC,cAAc,CACb,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,EAClC,uBAAuB,KAAK,EAAE,EAC9B,OAAO,EACP,KAAK,CACL,CAAC;QACF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,IAAY;QACxB,OAAO,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,MAAc;QACnB,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;QAC9C,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAe;QAC9B,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;YAChC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owl.d.ts b/lib.esm/wordlists/wordlist-owl.d.ts deleted file mode 100644 index 3a831f7cf..000000000 --- a/lib.esm/wordlists/wordlist-owl.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -export declare class WordlistOwl extends Wordlist { - #private; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, checksum: string); - get _data(): string; - _decodeWords(): Array; - getWord(index: number): string; - getWordIndex(word: string): number; -} -//# sourceMappingURL=wordlist-owl.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owl.d.ts.map b/lib.esm/wordlists/wordlist-owl.d.ts.map deleted file mode 100644 index cb5198fb8..000000000 --- a/lib.esm/wordlists/wordlist-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIxC;;;OAGG;IACH,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAKzD;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;IAoBD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owl.js b/lib.esm/wordlists/wordlist-owl.js deleted file mode 100644 index 3444ca545..000000000 --- a/lib.esm/wordlists/wordlist-owl.js +++ /dev/null @@ -1,62 +0,0 @@ -// Use the encode-latin.js script to create the necessary -// data files to be consumed by this class -import { id } from "../hash/index.js"; -import { assertArgument } from "../utils/index.js"; -import { decodeOwl } from "./decode-owl.js"; -import { Wordlist } from "./wordlist.js"; -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -export class WordlistOwl extends Wordlist { - #data; - #checksum; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale, data, checksum) { - super(locale); - this.#data = data; - this.#checksum = checksum; - this.#words = null; - } - get _data() { - return this.#data; - } - _decodeWords() { - return decodeOwl(this.#data); - } - #words; - #loadWords() { - if (this.#words == null) { - const words = this._decodeWords(); - // Verify the computed list matches the official list - const checksum = id(words.join("\n") + "\n", true); - /* c8 ignore start */ - if (checksum !== this.#checksum) { - throw new Error(`BIP39 Wordlist for ${this.locale} FffffAILED`); - } - /* c8 ignore stop */ - this.#words = words; - } - return this.#words; - } - getWord(index) { - const words = this.#loadWords(); - assertArgument(index >= 0 && index < words.length, `invalid word index: ${index}`, "index", index); - return words[index]; - } - getWordIndex(word) { - return this.#loadWords().indexOf(word); - } -} -//# sourceMappingURL=wordlist-owl.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owl.js.map b/lib.esm/wordlists/wordlist-owl.js.map deleted file mode 100644 index 9856e4343..000000000 --- a/lib.esm/wordlists/wordlist-owl.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owl.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,0CAA0C;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,O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AO,EACP,KAAK,CACL,CAAC;QACF,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IAED,YAAY,CAAC,IAAY;QACxB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owla.d.ts b/lib.esm/wordlists/wordlist-owla.d.ts deleted file mode 100644 index d86086b6e..000000000 --- a/lib.esm/wordlists/wordlist-owla.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -export declare class WordlistOwlA extends WordlistOwl { - #private; - constructor(locale: string, data: string, accent: string, checksum: string); - get _accent(): string; - _decodeWords(): Array; -} -//# sourceMappingURL=wordlist-owla.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owla.d.ts.map b/lib.esm/wordlists/wordlist-owla.d.ts.map deleted file mode 100644 index ed20b28e0..000000000 --- a/lib.esm/wordlists/wordlist-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;IAG5C,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAGzE;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owla.js b/lib.esm/wordlists/wordlist-owla.js deleted file mode 100644 index 89249dea2..000000000 --- a/lib.esm/wordlists/wordlist-owla.js +++ /dev/null @@ -1,28 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -import { decodeOwlA } from "./decode-owla.js"; -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -export class WordlistOwlA extends WordlistOwl { - #accent; - constructor(locale, data, accent, checksum) { - super(locale, data, checksum); - this.#accent = accent; - } - get _accent() { - return this.#accent; - } - _decodeWords() { - return decodeOwlA(this._data, this._accent); - } -} -//# sourceMappingURL=wordlist-owla.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist-owla.js.map b/lib.esm/wordlists/wordlist-owla.js.map deleted file mode 100644 index 290c81ea3..000000000 --- a/lib.esm/wordlists/wordlist-owla.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owla.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC5C,OAAO,CAAS;IAEhB,YAAY,MAAc,EAAE,IAAY,EAAE,MAAc,EAAE,QAAgB;QACzE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,YAAY;QACX,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist.d.ts b/lib.esm/wordlists/wordlist.d.ts deleted file mode 100644 index 081decc72..000000000 --- a/lib.esm/wordlists/wordlist.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -export declare abstract class Wordlist { - locale: string; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale: string); - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase: string): Array; - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words: Array): string; - /** - * Maps an 11-bit value into its coresponding word in the list. - * - * Sub-classes MUST override this. - */ - abstract getWord(index: number): string; - /** - * Maps a word to its corresponding 11-bit value. - * - * Sub-classes MUST override this. - */ - abstract getWordIndex(word: string): number; - static check(wordlist: Wordlist): string; -} -//# sourceMappingURL=wordlist.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist.d.ts.map b/lib.esm/wordlists/wordlist.d.ts.map deleted file mode 100644 index c298de76e..000000000 --- a/lib.esm/wordlists/wordlist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC7B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAM,EAAE,MAAM,EAEzB;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAEnC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAWvC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist.js b/lib.esm/wordlists/wordlist.js deleted file mode 100644 index b7ae2c64f..000000000 --- a/lib.esm/wordlists/wordlist.js +++ /dev/null @@ -1,55 +0,0 @@ -import { id } from "../hash/id.js"; -import { defineProperties } from "../utils/index.js"; -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -export class Wordlist { - locale; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale) { - defineProperties(this, { locale }); - } - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase) { - return phrase.toLowerCase().split(/\s+/g); - } - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words) { - return words.join(" "); - } - static check(wordlist) { - const words = []; - for (let i = 0; i < 2048; i++) { - const word = wordlist.getWord(i); - /* istanbul ignore if */ - if (i !== wordlist.getWordIndex(word)) { - return "0x"; - } - words.push(word); - } - return id(words.join("\n") + "\n"); - } -} -//# sourceMappingURL=wordlist.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlist.js.map b/lib.esm/wordlists/wordlist.js.map deleted file mode 100644 index d0daa2a1e..000000000 --- a/lib.esm/wordlists/wordlist.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,MAAM,OAAgB,QAAQ;IAC7B,MAAM,CAAU;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAc;QACzB,gBAAgB,CAAW,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAc;QACnB,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAoB;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAeD,MAAM,CAAC,KAAK,CAAC,QAAkB;QAC9B,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,wBAAwB;YACxB,IAAI,CAAC,KAAK,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;gBACvC,OAAO,IAAI,CAAC;YACb,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACpC,CAAC;CACD"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists-browser.d.ts b/lib.esm/wordlists/wordlists-browser.d.ts deleted file mode 100644 index d0dbd19c9..000000000 --- a/lib.esm/wordlists/wordlists-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -export declare const wordlists: Record; -//# sourceMappingURL=wordlists-browser.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists-browser.d.ts.map b/lib.esm/wordlists/wordlists-browser.d.ts.map deleted file mode 100644 index 4cd923879..000000000 --- a/lib.esm/wordlists/wordlists-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-browser.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAE9C,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists-browser.js b/lib.esm/wordlists/wordlists-browser.js deleted file mode 100644 index 9129fa29b..000000000 --- a/lib.esm/wordlists/wordlists-browser.js +++ /dev/null @@ -1,5 +0,0 @@ -import { LangEn } from "./lang-en.js"; -export const wordlists = { - en: LangEn.wordlist(), -}; -//# sourceMappingURL=wordlists-browser.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists-browser.js.map b/lib.esm/wordlists/wordlists-browser.js.map deleted file mode 100644 index f4a98b126..000000000 --- a/lib.esm/wordlists/wordlists-browser.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-browser.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,MAAM,CAAC,MAAM,SAAS,GAA6B;IAClD,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;CACrB,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists-extra.d.ts b/lib.esm/wordlists/wordlists-extra.d.ts deleted file mode 100644 index 7e15a233f..000000000 --- a/lib.esm/wordlists/wordlists-extra.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { LangCz } from "./lang-cz.js"; -export { LangEs } from "./lang-es.js"; -export { LangFr } from "./lang-fr.js"; -export { LangJa } from "./lang-ja.js"; -export { LangKo } from "./lang-ko.js"; -export { LangIt } from "./lang-it.js"; -export { LangPt } from "./lang-pt.js"; -export { LangZh } from "./lang-zh.js"; -//# sourceMappingURL=wordlists-extra.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists-extra.d.ts.map b/lib.esm/wordlists/wordlists-extra.d.ts.map deleted file mode 100644 index 66c6c92cd..000000000 --- a/lib.esm/wordlists/wordlists-extra.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-extra.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists-extra.js b/lib.esm/wordlists/wordlists-extra.js deleted file mode 100644 index 47e509eb0..000000000 --- a/lib.esm/wordlists/wordlists-extra.js +++ /dev/null @@ -1,9 +0,0 @@ -export { LangCz } from "./lang-cz.js"; -export { LangEs } from "./lang-es.js"; -export { LangFr } from "./lang-fr.js"; -export { LangJa } from "./lang-ja.js"; -export { LangKo } from "./lang-ko.js"; -export { LangIt } from "./lang-it.js"; -export { LangPt } from "./lang-pt.js"; -export { LangZh } from "./lang-zh.js"; -//# sourceMappingURL=wordlists-extra.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists-extra.js.map b/lib.esm/wordlists/wordlists-extra.js.map deleted file mode 100644 index 61bd82063..000000000 --- a/lib.esm/wordlists/wordlists-extra.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-extra.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists.d.ts b/lib.esm/wordlists/wordlists.d.ts deleted file mode 100644 index ab8b0308c..000000000 --- a/lib.esm/wordlists/wordlists.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -export declare const wordlists: Record; -//# sourceMappingURL=wordlists.d.ts.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists.d.ts.map b/lib.esm/wordlists/wordlists.d.ts.map deleted file mode 100644 index 15f92fcf6..000000000 --- a/lib.esm/wordlists/wordlists.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAW9C,CAAC"} \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists.js b/lib.esm/wordlists/wordlists.js deleted file mode 100644 index 45fd2d71e..000000000 --- a/lib.esm/wordlists/wordlists.js +++ /dev/null @@ -1,35 +0,0 @@ -import { LangCz } from "./lang-cz.js"; -import { LangEn } from "./lang-en.js"; -import { LangEs } from "./lang-es.js"; -import { LangFr } from "./lang-fr.js"; -import { LangJa } from "./lang-ja.js"; -import { LangKo } from "./lang-ko.js"; -import { LangIt } from "./lang-it.js"; -import { LangPt } from "./lang-pt.js"; -import { LangZh } from "./lang-zh.js"; -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -export const wordlists = { - cz: LangCz.wordlist(), - en: LangEn.wordlist(), - es: LangEs.wordlist(), - fr: LangFr.wordlist(), - it: LangIt.wordlist(), - pt: LangPt.wordlist(), - ja: LangJa.wordlist(), - ko: LangKo.wordlist(), - zh_cn: LangZh.wordlist("cn"), - zh_tw: LangZh.wordlist("tw"), -}; -//# sourceMappingURL=wordlists.js.map \ No newline at end of file diff --git a/lib.esm/wordlists/wordlists.js.map b/lib.esm/wordlists/wordlists.js.map deleted file mode 100644 index 15c990e52..000000000 --- a/lib.esm/wordlists/wordlists.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists.js","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAA6B;IAClD,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,EAAE,EAAE,MAAM,CAAC,QAAQ,EAAE;IACrB,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;CAC5B,CAAC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 36177b746..000000000 --- a/package-lock.json +++ /dev/null @@ -1,1576 +0,0 @@ -{ - "name": "corebc", - "version": "0.4.1", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "corebc", - "version": "0.4.1", - "license": "CORE", - "dependencies": { - "@noble/hashes": "2.4.0", - "@types/node": "26.4.1", - "aes-js": "3.1.2", - "bcrypto": "^5.5.2", - "bn.js": "^5.2.5", - "buffer": "^6.0.3", - "tslib": "2.8.1", - "utf8": "^3.0.0", - "ws": "8.21.3" - }, - "devDependencies": { - "@rollup/plugin-commonjs": "^29.0.0", - "@rollup/plugin-inject": "^5.0.5", - "@rollup/plugin-node-resolve": "16.0.3", - "@types/bn.js": "^5.2.0", - "@types/mocha": "10.0.10", - "@types/semver": "7.8.0", - "@types/utf8": "^3.0.3", - "c8": "12.0.0", - "mocha": "12.0.0", - "prettier": "^3.9.6", - "rollup": "4.63.1", - "semver": "7.8.5", - "typescript": "7.0.2", - "uglify-js": "3.19.3" - }, - "engines": { - "node": ">=22.12.0" - } - }, - "node_modules/@bcoe/v8-coverage": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz", - "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - } - }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", - "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", - "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@noble/hashes": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.4.0.tgz", - "integrity": "sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==", - "license": "MIT", - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@rollup/plugin-commonjs": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-29.0.3.tgz", - "integrity": "sha512-ZaOxZceP7SOUW7Lqw5IRVweSQYWaeIPnXIGLiB690EBA3FGJTO40EEr2L5yZplJWsgTCogILRSpcAe7+U0Otdg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "commondir": "^1.0.1", - "estree-walker": "^2.0.2", - "fdir": "^6.2.0", - "is-reference": "1.2.1", - "magic-string": "^0.30.3", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=16.0.0 || 14 >= 14.17" - }, - "peerDependencies": { - "rollup": "^2.68.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-commonjs/node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-inject": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@rollup/plugin-inject/-/plugin-inject-5.0.5.tgz", - "integrity": "sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.3" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", - "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "@types/resolve": "1.20.2", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.22.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.78.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/pluginutils": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.4.0.tgz", - "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } - } - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.63.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.1.tgz", - "integrity": "sha512-FQNqd1lRy/0QhDk3xeRIkSBiCpXCiDnZO3YLVdcDKN1UBiKToNftCzcXYNLshmPDUMlu2TdeS8tGcsU6f3YF1Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@types/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-DLbJ1BPqxvQhIGbeu8VbUC1DiAiahHtAYvA0ZEAa4P31F7IaArc8z3C3BRQdWX4mtLQuABG4yzp76ZrS02Ui1Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/estree": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/mocha": { - "version": "10.0.10", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.10.tgz", - "integrity": "sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/node": { - "version": "26.4.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.4.1.tgz", - "integrity": "sha512-k97ENvZWtvA6yqz5/FS6a7duDgOPEeOQOc2iKS/nY6mX6qJUKtLnWzQS+Xj6tXweyj6ZcTAK2Qecetnvi9nCLA==", - "license": "MIT", - "dependencies": { - "undici-types": "~8.3.0" - } - }, - "node_modules/@types/resolve": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/semver": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.8.0.tgz", - "integrity": "sha512-1mAINjtQCXXeLkJ9ehXkwOcBpqtLxiVtKhpUf83DdRNdQKV0iXZpaHYqRr7nj+wvxuJzoAmAwXI+sCNMv1CzLQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@types/utf8": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/utf8/-/utf8-3.0.3.tgz", - "integrity": "sha512-+lqLGxWZsEe4Z6OrzBI7Ym4SMUTaMS5yOrHZ0/IL0bpIye1Qbs4PpobJL2mLDbftUXlPFZR7fu6d1yM+bHLX1w==", - "dev": true, - "license": "MIT" - }, - "node_modules/@typescript/typescript-darwin-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", - "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/aes-js": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.1.2.tgz", - "integrity": "sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==", - "license": "MIT" - }, - "node_modules/ansi-regex": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.3.0.tgz", - "integrity": "sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, - "license": "Python-2.0" - }, - "node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/bcrypto": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/bcrypto/-/bcrypto-5.5.2.tgz", - "integrity": "sha512-k3PF755oJM0+25iOVuraNedF5XneykxRwl+oBoMeQPfYee4qX8hHQhKCsNZWLthNYgi41GH2ysopd/8sDQDhEw==", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "bufio": "~1.0.7", - "loady": "~0.0.5" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/bn.js": { - "version": "5.2.5", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.5.tgz", - "integrity": "sha512-Vq886eXykuP5E6HcKSSStP3bJgrE6In5WKxVUvJ8XGpWWYs2xZHWqUwzCtGgEtBcxyd57KBFDPFoUfNzdaHCNg==", - "license": "MIT" - }, - "node_modules/brace-expansion": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", - "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true, - "license": "ISC" - }, - "node_modules/buffer": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, - "node_modules/bufio": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/bufio/-/bufio-1.0.7.tgz", - "integrity": "sha512-bd1dDQhiC+bEbEfg56IdBv7faWa6OipMs/AFFFvtFnB3wAYjlwQpQRZ0pm6ZkgtfL0pILRXhKxOiQj6UzoMR7A==", - "license": "MIT", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/c8": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/c8/-/c8-12.0.0.tgz", - "integrity": "sha512-4zpJvrd1nKWutnnKC2pXkFmb6iM1l+ffN//o1CzlTNwW7GSOs9a1xrLqkC48nU8oEkjmPZLPiwMsIaOvoF4Pqg==", - "dev": true, - "license": "ISC", - "dependencies": { - "@bcoe/v8-coverage": "^1.0.1", - "@istanbuljs/schema": "^0.1.3", - "find-up": "^5.0.0", - "foreground-child": "^3.1.1", - "istanbul-lib-coverage": "^3.2.0", - "istanbul-lib-report": "^3.0.1", - "istanbul-reports": "^3.1.6", - "test-exclude": "^8.0.0", - "v8-to-istanbul": "^9.0.0", - "yargs": "^18.0.0", - "yargs-parser": "^21.1.1" - }, - "bin": { - "c8": "bin/c8.js" - }, - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=23" - }, - "peerDependencies": { - "monocart-coverage-reports": "^2" - }, - "peerDependenciesMeta": { - "monocart-coverage-reports": { - "optional": true - } - } - }, - "node_modules/chokidar": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", - "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", - "dev": true, - "license": "MIT", - "dependencies": { - "readdirp": "^5.0.0" - }, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/cliui": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", - "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "string-width": "^7.2.0", - "strip-ansi": "^7.1.0", - "wrap-ansi": "^9.0.0" - }, - "engines": { - "node": ">=20" - } - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true, - "license": "MIT" - }, - "node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true, - "license": "MIT" - }, - "node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/diff": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-9.0.0.tgz", - "integrity": "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/emoji-regex": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", - "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", - "dev": true, - "license": "MIT" - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" - } - }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true, - "license": "MIT" - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/foreground-child": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", - "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", - "dev": true, - "license": "ISC", - "dependencies": { - "cross-spawn": "^7.0.6", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/foreground-child/node_modules/cross-spawn": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", - "dev": true, - "license": "MIT", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/foreground-child/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/foreground-child/node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "license": "MIT", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/foreground-child/node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/foreground-child/node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, - "license": "ISC", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-east-asian-width": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", - "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/glob": { - "version": "13.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "minimatch": "^10.2.2", - "minipass": "^7.1.3", - "path-scurry": "^2.0.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/has/node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true, - "license": "MIT" - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true, - "license": "MIT" - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "BSD-3-Clause" - }, - "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "has": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true, - "license": "MIT" - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "*" - } - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true, - "license": "ISC" - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^4.0.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/js-yaml": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.4.1.tgz", - "integrity": "sha512-28R/k+NAjeuf7+CKlTxWZVExJGwVVLwY06DgEnOMz2gEpfNkDcD7QvyiVPT0xy0XXhU8vHsd4Ot42OOPdJG7dQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/puzrin" - }, - { - "type": "github", - "url": "https://github.com/sponsors/nodeca" - } - ], - "license": "MIT", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.mjs" - } - }, - "node_modules/loady": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/loady/-/loady-0.0.5.tgz", - "integrity": "sha512-uxKD2HIj042/HBx77NBcmEPsD+hxCgAtjEWlYNScuUjIsh/62Uyu39GOR68TBR68v+jqDL9zfftCWoUo4y03sQ==", - "license": "MIT", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lru-cache": { - "version": "11.5.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", - "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/magic-string": { - "version": "0.30.21", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.5" - } - }, - "node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/minimatch": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", - "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.8" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minipass": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", - "dev": true, - "license": "BlueOak-1.0.0", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/mocha": { - "version": "12.0.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-12.0.0.tgz", - "integrity": "sha512-NYNh5IFt6WYqm9bi4601m7vix8MZdXC0DwS4gY6WhXO2RgJWhivhISVmq1oklCif18OSI9l+vx5Mdm5oh1XGiQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "browser-stdout": "^1.3.1", - "chokidar": "^5.0.0", - "debug": "^4.3.5", - "diff": "^9.0.0", - "find-up": "^5.0.0", - "glob": "^13.0.0", - "is-path-inside": "^3.0.3", - "is-unicode-supported": "^0.1.0", - "js-yaml": "^5.0.0", - "minimatch": "^10.2.2", - "ms": "^2.1.3", - "picocolors": "^1.1.1", - "serialize-javascript": "^7.0.2", - "strip-json-comments": "^5.0.3", - "supports-color": "^8.1.1", - "workerpool": "^10.0.0" - }, - "bin": { - "mocha": "bin/mocha.js" - }, - "engines": { - "node": "^20.19.0 || >=22.12.0" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "license": "MIT" - }, - "node_modules/path-scurry": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", - "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", - "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prettier": { - "version": "3.9.6", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.6.tgz", - "integrity": "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g==", - "dev": true, - "license": "MIT", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/readdirp": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz", - "integrity": "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/resolve": { - "version": "1.22.6", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", - "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/rollup": { - "version": "4.63.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.63.1.tgz", - "integrity": "sha512-3Df9jsstwhccuEfmAMi9l8XUh/GOkVObmFTU7CCVBysEbcOZLl84jCtaAZMcPiMz2EGKsATzQcU+Xr3n/wU6cg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "1.0.9" - }, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=18.0.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "@napi-rs/lzma-linux-x64-gnu": "1.5.1", - "@rollup/rollup-android-arm-eabi": "4.63.1", - "@rollup/rollup-android-arm64": "4.63.1", - "@rollup/rollup-darwin-arm64": "4.63.1", - "@rollup/rollup-darwin-x64": "4.63.1", - "@rollup/rollup-freebsd-arm64": "4.63.1", - "@rollup/rollup-freebsd-x64": "4.63.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.63.1", - "@rollup/rollup-linux-arm-musleabihf": "4.63.1", - "@rollup/rollup-linux-arm64-gnu": "4.63.1", - "@rollup/rollup-linux-arm64-musl": "4.63.1", - "@rollup/rollup-linux-loong64-gnu": "4.63.1", - "@rollup/rollup-linux-loong64-musl": "4.63.1", - "@rollup/rollup-linux-ppc64-gnu": "4.63.1", - "@rollup/rollup-linux-ppc64-musl": "4.63.1", - "@rollup/rollup-linux-riscv64-gnu": "4.63.1", - "@rollup/rollup-linux-riscv64-musl": "4.63.1", - "@rollup/rollup-linux-s390x-gnu": "4.63.1", - "@rollup/rollup-linux-x64-gnu": "4.63.1", - "@rollup/rollup-linux-x64-musl": "4.63.1", - "@rollup/rollup-openbsd-x64": "4.63.1", - "@rollup/rollup-openharmony-arm64": "4.63.1", - "@rollup/rollup-win32-arm64-msvc": "4.63.1", - "@rollup/rollup-win32-ia32-msvc": "4.63.1", - "@rollup/rollup-win32-x64-gnu": "4.63.1", - "@rollup/rollup-win32-x64-msvc": "4.63.1", - "fsevents": "~2.3.2" - } - }, - "node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/serialize-javascript": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-7.1.1.tgz", - "integrity": "sha512-k3CMsaIvvdSwm8oLB4MXSl0wH2/cwlH7xGcnRd2DaeRmBkbzYmyT8j0tsX60DwD1eRwHTpNpH8ljKu9oUT1MeQ==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=20.0.0" - } - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/string-width": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", - "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/strip-ansi": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", - "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^6.2.2" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/strip-json-comments": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.3.tgz", - "integrity": "sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/test-exclude": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-8.0.0.tgz", - "integrity": "sha512-ZOffsNrXYggvU1mDGHk54I96r26P8SyMjO5slMKSc7+IWmtB/MQKnEC2fP51imB3/pT6YK5cT5E8f+Dd9KdyOQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^13.0.6", - "minimatch": "^10.2.2" - }, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD" - }, - "node_modules/typescript": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", - "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc" - }, - "engines": { - "node": ">=16.20.0" - }, - "optionalDependencies": { - "@typescript/typescript-aix-ppc64": "7.0.2", - "@typescript/typescript-darwin-arm64": "7.0.2", - "@typescript/typescript-darwin-x64": "7.0.2", - "@typescript/typescript-freebsd-arm64": "7.0.2", - "@typescript/typescript-freebsd-x64": "7.0.2", - "@typescript/typescript-linux-arm": "7.0.2", - "@typescript/typescript-linux-arm64": "7.0.2", - "@typescript/typescript-linux-loong64": "7.0.2", - "@typescript/typescript-linux-mips64el": "7.0.2", - "@typescript/typescript-linux-ppc64": "7.0.2", - "@typescript/typescript-linux-riscv64": "7.0.2", - "@typescript/typescript-linux-s390x": "7.0.2", - "@typescript/typescript-linux-x64": "7.0.2", - "@typescript/typescript-netbsd-arm64": "7.0.2", - "@typescript/typescript-netbsd-x64": "7.0.2", - "@typescript/typescript-openbsd-arm64": "7.0.2", - "@typescript/typescript-openbsd-x64": "7.0.2", - "@typescript/typescript-sunos-x64": "7.0.2", - "@typescript/typescript-win32-arm64": "7.0.2", - "@typescript/typescript-win32-x64": "7.0.2" - } - }, - "node_modules/uglify-js": { - "version": "3.19.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", - "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", - "dev": true, - "license": "BSD-2-Clause", - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/undici-types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", - "integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==", - "license": "MIT" - }, - "node_modules/utf8": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", - "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", - "license": "MIT" - }, - "node_modules/v8-to-istanbul": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", - "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", - "dev": true, - "license": "ISC", - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" - }, - "engines": { - "node": ">=10.12.0" - } - }, - "node_modules/workerpool": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-10.0.3.tgz", - "integrity": "sha512-6z2Iis68Wqth93/G/wJP9u+R3O+d2XTlgWChGCwuT1qLbBsOYueGRZuJ++v3mtDP5KjYdy+WzvWC+VWETSVXJA==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/wrap-ansi": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", - "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-styles": "^6.2.1", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", - "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/ws": { - "version": "8.21.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz", - "integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==", - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "18.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.1.0.tgz", - "integrity": "sha512-2rAgRKu54VsHkqI0/tYkmluGXHD4KW7yZoycuqDQ15QOTnc2VVfy0nN/1eMhnQLO00A+dwtK20xuCnc1YGeUyg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cliui": "^9.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "string-width": "^8.2.1", - "y18n": "^5.0.5", - "yargs-parser": "^22.0.0" - }, - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=23" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "dev": true, - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs/node_modules/string-width": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz", - "integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-east-asian-width": "^1.5.0", - "strip-ansi": "^7.1.2" - }, - "engines": { - "node": ">=20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/yargs/node_modules/yargs-parser": { - "version": "22.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", - "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", - "dev": true, - "license": "ISC", - "engines": { - "node": "^20.19.0 || ^22.12.0 || >=23" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/types/_version.d.ts b/types/_version.d.ts deleted file mode 100644 index 515a07b59..000000000 --- a/types/_version.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/** The current version of corebc; keep in sync with package.json. */ -export declare const version: string; -//# sourceMappingURL=_version.d.ts.map \ No newline at end of file diff --git a/types/_version.d.ts.map b/types/_version.d.ts.map deleted file mode 100644 index 99992181e..000000000 --- a/types/_version.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"_version.d.ts","sourceRoot":"","sources":["../src.ts/_version.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,eAAO,MAAM,OAAO,EAAE,MAAgB,CAAC"} \ No newline at end of file diff --git a/types/abi-types/Tes.d.ts b/types/abi-types/Tes.d.ts deleted file mode 100644 index ab20b2246..000000000 --- a/types/abi-types/Tes.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "../corebc.js"; -import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "./common.js"; -export interface TesInterface extends Interface { - getFunction(nameOrSignature: "approve" | "balanceOf" | "batchOwnerOf" | "getApproved" | "isApprovedForAll" | "mint" | "ownerOf" | "safeTransferFrom(address,address,uint256)" | "safeTransferFrom(address,address,uint256,bytes)" | "setApprovalForAll" | "tokenByIndex" | "tokenOfOwnerByIndex" | "totalSupply" | "transferFrom"): FunctionFragment; - getEvent(nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer"): EventFragment; - encodeFunctionData(functionFragment: "approve", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "balanceOf", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "batchOwnerOf", values: [BigNumberish[]]): string; - encodeFunctionData(functionFragment: "getApproved", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "isApprovedForAll", values: [AddressLike, AddressLike]): string; - encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "ownerOf", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256)", values: [AddressLike, AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", values: [AddressLike, AddressLike, BigNumberish, BytesLike]): string; - encodeFunctionData(functionFragment: "setApprovalForAll", values: [AddressLike, boolean]): string; - encodeFunctionData(functionFragment: "tokenByIndex", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "tokenOfOwnerByIndex", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "totalSupply", values?: undefined): string; - encodeFunctionData(functionFragment: "transferFrom", values: [AddressLike, AddressLike, BigNumberish]): string; - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "batchOwnerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getApproved", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "isApprovedForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "setApprovalForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenOfOwnerByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "totalSupply", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "transferFrom", data: BytesLike): Result; -} -export declare namespace ApprovalEvent { - type InputTuple = [ - owner: AddressLike, - approved: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [owner: string, approved: string, tokenId: bigint]; - interface OutputObject { - owner: string; - approved: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace ApprovalForAllEvent { - type InputTuple = [ - owner: AddressLike, - operator: AddressLike, - approved: boolean - ]; - type OutputTuple = [ - owner: string, - operator: string, - approved: boolean - ]; - interface OutputObject { - owner: string; - operator: string; - approved: boolean; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace TransferEvent { - type InputTuple = [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [from: string, to: string, tokenId: bigint]; - interface OutputObject { - from: string; - to: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export interface Tes extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; - attach(addressOrName: AddressLike): this; - deployed(): Promise; - interface: TesInterface; - queryFilter(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - queryFilter(filter: TypedDeferredTopicFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - on(event: TCEvent, listener: TypedListener): Promise; - on(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - once(event: TCEvent, listener: TypedListener): Promise; - once(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - listeners(event: TCEvent): Promise>>; - listeners(eventName?: string): Promise>; - removeAllListeners(event?: TCEvent): Promise; - approve: TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - isApprovedForAll: TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - "safeTransferFrom(address,address,uint256)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - setApprovalForAll: TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; - tokenOfOwnerByIndex: TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - totalSupply: TypedContractMethod<[], [bigint], "view">; - transferFrom: TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(key: string | FunctionFragment): T; - getFunction(nameOrSignature: "approve"): TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "balanceOf"): TypedContractMethod<[owner: AddressLike], [bigint], "view">; - getFunction(nameOrSignature: "batchOwnerOf"): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getFunction(nameOrSignature: "getApproved"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "isApprovedForAll"): TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - getFunction(nameOrSignature: "mint"): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - getFunction(nameOrSignature: "ownerOf"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "setApprovalForAll"): TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "tokenByIndex"): TypedContractMethod<[index: BigNumberish], [bigint], "view">; - getFunction(nameOrSignature: "tokenOfOwnerByIndex"): TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - getFunction(nameOrSignature: "totalSupply"): TypedContractMethod<[], [bigint], "view">; - getFunction(nameOrSignature: "transferFrom"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getEvent(key: "Approval"): TypedContractEvent; - getEvent(key: "ApprovalForAll"): TypedContractEvent; - getEvent(key: "Transfer"): TypedContractEvent; - filters: { - "Approval(address,address,uint256)": TypedContractEvent; - Approval: TypedContractEvent; - "ApprovalForAll(address,address,bool)": TypedContractEvent; - ApprovalForAll: TypedContractEvent; - "Transfer(address,address,uint256)": TypedContractEvent; - Transfer: TypedContractEvent; - }; -} -//# sourceMappingURL=Tes.d.ts.map \ No newline at end of file diff --git a/types/abi-types/Tes.d.ts.map b/types/abi-types/Tes.d.ts.map deleted file mode 100644 index 0c7f7bc42..000000000 --- a/types/abi-types/Tes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC9C,WAAW,CACV,eAAe,EACZ,SAAS,GACT,WAAW,GACX,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,2CAA2C,GAC3C,iDAAiD,GACjD,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,aAAa,GACb,cAAc,GACf,gBAAgB,CAAC;IAEpB,QAAQ,CACP,sBAAsB,EAAE,UAAU,GAAG,gBAAgB,GAAG,UAAU,GAChE,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U,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/types/abi-types/Tes_abi.d.ts b/types/abi-types/Tes_abi.d.ts deleted file mode 100644 index 3df4e144e..000000000 --- a/types/abi-types/Tes_abi.d.ts +++ /dev/null @@ -1,223 +0,0 @@ -import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "../corebc.js"; -import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "./common.js"; -export interface Tes_abiInterface extends Interface { - getFunction(nameOrSignature: "approve" | "balanceOf" | "batchOwnerOf" | "getApproved" | "isApprovedForAll" | "mint" | "ownerOf" | "safeTransferFrom(address,address,uint256)" | "safeTransferFrom(address,address,uint256,bytes)" | "setApprovalForAll" | "tokenByIndex" | "tokenOfOwnerByIndex" | "totalSupply" | "transferFrom"): FunctionFragment; - getEvent(nameOrSignatureOrTopic: "Approval" | "ApprovalForAll" | "Transfer"): EventFragment; - encodeFunctionData(functionFragment: "approve", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "balanceOf", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "batchOwnerOf", values: [BigNumberish[]]): string; - encodeFunctionData(functionFragment: "getApproved", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "isApprovedForAll", values: [AddressLike, AddressLike]): string; - encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "ownerOf", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256)", values: [AddressLike, AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", values: [AddressLike, AddressLike, BigNumberish, BytesLike]): string; - encodeFunctionData(functionFragment: "setApprovalForAll", values: [AddressLike, boolean]): string; - encodeFunctionData(functionFragment: "tokenByIndex", values: [BigNumberish]): string; - encodeFunctionData(functionFragment: "tokenOfOwnerByIndex", values: [AddressLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "totalSupply", values?: undefined): string; - encodeFunctionData(functionFragment: "transferFrom", values: [AddressLike, AddressLike, BigNumberish]): string; - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "batchOwnerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getApproved", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "isApprovedForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "ownerOf", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "safeTransferFrom(address,address,uint256,bytes)", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "setApprovalForAll", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "tokenOfOwnerByIndex", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "totalSupply", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "transferFrom", data: BytesLike): Result; -} -export declare namespace ApprovalEvent { - type InputTuple = [ - owner: AddressLike, - approved: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [owner: string, approved: string, tokenId: bigint]; - interface OutputObject { - owner: string; - approved: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace ApprovalForAllEvent { - type InputTuple = [ - owner: AddressLike, - operator: AddressLike, - approved: boolean - ]; - type OutputTuple = [ - owner: string, - operator: string, - approved: boolean - ]; - interface OutputObject { - owner: string; - operator: string; - approved: boolean; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export declare namespace TransferEvent { - type InputTuple = [ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ]; - type OutputTuple = [from: string, to: string, tokenId: bigint]; - interface OutputObject { - from: string; - to: string; - tokenId: bigint; - } - type Event = TypedContractEvent; - type Filter = TypedDeferredTopicFilter; - type Log = TypedEventLog; - type LogDescription = TypedLogDescription; -} -export interface Tes_abi extends BaseContract { - connect(runner?: ContractRunner | null): BaseContract; - attach(addressOrName: AddressLike): this; - deployed(): Promise; - interface: Tes_abiInterface; - queryFilter(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - queryFilter(filter: TypedDeferredTopicFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>>; - on(event: TCEvent, listener: TypedListener): Promise; - on(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - once(event: TCEvent, listener: TypedListener): Promise; - once(filter: TypedDeferredTopicFilter, listener: TypedListener): Promise; - listeners(event: TCEvent): Promise>>; - listeners(eventName?: string): Promise>; - removeAllListeners(event?: TCEvent): Promise; - approve: TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - balanceOf: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - batchOwnerOf: TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getApproved: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - isApprovedForAll: TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - mint: TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - ownerOf: TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - "safeTransferFrom(address,address,uint256)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - "safeTransferFrom(address,address,uint256,bytes)": TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - setApprovalForAll: TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - tokenByIndex: TypedContractMethod<[index: BigNumberish], [bigint], "view">; - tokenOfOwnerByIndex: TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - totalSupply: TypedContractMethod<[], [bigint], "view">; - transferFrom: TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(key: string | FunctionFragment): T; - getFunction(nameOrSignature: "approve"): TypedContractMethod<[ - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "balanceOf"): TypedContractMethod<[owner: AddressLike], [bigint], "view">; - getFunction(nameOrSignature: "batchOwnerOf"): TypedContractMethod<[ids: BigNumberish[]], [string[]], "view">; - getFunction(nameOrSignature: "getApproved"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "isApprovedForAll"): TypedContractMethod<[ - owner: AddressLike, - operator: AddressLike - ], [ - boolean - ], "view">; - getFunction(nameOrSignature: "mint"): TypedContractMethod<[to: AddressLike], [void], "nonpayable">; - getFunction(nameOrSignature: "ownerOf"): TypedContractMethod<[tokenId: BigNumberish], [string], "view">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "safeTransferFrom(address,address,uint256,bytes)"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish, - data: BytesLike - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "setApprovalForAll"): TypedContractMethod<[ - operator: AddressLike, - approved: boolean - ], [ - void - ], "nonpayable">; - getFunction(nameOrSignature: "tokenByIndex"): TypedContractMethod<[index: BigNumberish], [bigint], "view">; - getFunction(nameOrSignature: "tokenOfOwnerByIndex"): TypedContractMethod<[ - owner: AddressLike, - index: BigNumberish - ], [ - bigint - ], "view">; - getFunction(nameOrSignature: "totalSupply"): TypedContractMethod<[], [bigint], "view">; - getFunction(nameOrSignature: "transferFrom"): TypedContractMethod<[ - from: AddressLike, - to: AddressLike, - tokenId: BigNumberish - ], [ - void - ], "nonpayable">; - getEvent(key: "Approval"): TypedContractEvent; - getEvent(key: "ApprovalForAll"): TypedContractEvent; - getEvent(key: "Transfer"): TypedContractEvent; - filters: { - "Approval(address,address,uint256)": TypedContractEvent; - Approval: TypedContractEvent; - "ApprovalForAll(address,address,bool)": TypedContractEvent; - ApprovalForAll: TypedContractEvent; - "Transfer(address,address,uint256)": TypedContractEvent; - Transfer: TypedContractEvent; - }; -} -//# sourceMappingURL=Tes_abi.d.ts.map \ No newline at end of file diff --git a/types/abi-types/Tes_abi.d.ts.map b/types/abi-types/Tes_abi.d.ts.map deleted file mode 100644 index 152cbb189..000000000 --- a/types/abi-types/Tes_abi.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/Tes_abi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,cAAc,EACd,QAAQ,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,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E,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QAEF,sCAAsC,EAAE,kBAAkB,CACzD,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QACF,cAAc,EAAE,kBAAkB,CACjC,mBAAmB,CAAC,UAAU,EAC9B,mBAAmB,CAAC,WAAW,EAC/B,mBAAmB,CAAC,YAAY,CAChC,CAAC;QAEF,mCAAmC,EAAE,kBAAkB,CACtD,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;QACF,QAAQ,EAAE,kBAAkB,CAC3B,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,WAAW,EACzB,aAAa,CAAC,YAAY,CAC1B,CAAC;KACF,CAAC;CACF"} \ No newline at end of file diff --git a/types/abi-types/common.d.ts b/types/abi-types/common.d.ts deleted file mode 100644 index d6e86d0d7..000000000 --- a/types/abi-types/common.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import type { FunctionFragment, Typed, EventFragment, ContractTransaction, ContractTransactionResponse, DeferredTopicFilter, EventLog, TransactionRequest, LogDescription } from "../corebc.js"; -export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent> extends DeferredTopicFilter { -} -export interface TypedContractEvent = any, OutputTuple extends Array = any, OutputObject = any> { - (...args: Partial): TypedDeferredTopicFilter>; - name: string; - fragment: EventFragment; - getFragment(...args: Partial): EventFragment; -} -type __TypechainAOutputTuple = T extends TypedContractEvent ? W : never; -type __TypechainOutputObject = T extends TypedContractEvent ? V : never; -export interface TypedEventLog extends Omit { - args: __TypechainAOutputTuple & __TypechainOutputObject; -} -export interface TypedLogDescription extends Omit { - args: __TypechainAOutputTuple & __TypechainOutputObject; -} -export type TypedListener = (...listenerArg: [ - ...__TypechainAOutputTuple, - TypedEventLog, - ...undefined[] -]) => void; -export type MinCoreBCFactory = { - deploy(...a: ARGS[]): Promise; -}; -export type GetContractTypeFromFactory = F extends MinCoreBCFactory ? C : never; -export type GetARGsTypeFromFactory = F extends MinCoreBCFactory ? Parameters : never; -export type StateMutability = "nonpayable" | "payable" | "view"; -export type BaseOverrides = Omit; -export type NonPayableOverrides = Omit; -export type PayableOverrides = Omit; -export type ViewOverrides = Omit; -export type Overrides = S extends "nonpayable" ? NonPayableOverrides : S extends "payable" ? PayableOverrides : ViewOverrides; -export type PostfixOverrides, S extends StateMutability> = A | [...A, Overrides]; -export type ContractMethodArgs, S extends StateMutability> = PostfixOverrides<{ - [I in keyof A]-?: A[I] | Typed; -}, S>; -export type DefaultReturnType = R extends Array ? R[0] : R; -export interface TypedContractMethod = Array, R = any, S extends StateMutability = "payable"> { - (...args: ContractMethodArgs): S extends "view" ? Promise> : Promise; - name: string; - fragment: FunctionFragment; - getFragment(...args: ContractMethodArgs): FunctionFragment; - populateTransaction(...args: ContractMethodArgs): Promise; - staticCall(...args: ContractMethodArgs): Promise>; - send(...args: ContractMethodArgs): Promise; - estimateGas(...args: ContractMethodArgs): Promise; - staticCallResult(...args: ContractMethodArgs): Promise; -} -export {}; -//# sourceMappingURL=common.d.ts.map \ No newline at end of file diff --git a/types/abi-types/common.d.ts.map b/types/abi-types/common.d.ts.map deleted file mode 100644 index b7d6fe89d..000000000 --- a/types/abi-types/common.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/common.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,gBAAgB,EAChB,KAAK,EACL,aAAa,EACb,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,cAAc,EACd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AAC;IAC7E,IAAI,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC9E,WAAW,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChE,gBAAgB,CAAC,GAAG,IAAI,EAAE,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAChE"} \ No newline at end of file diff --git a/types/abi-types/factories/Tes__factory.d.ts b/types/abi-types/factories/Tes__factory.d.ts deleted file mode 100644 index 9fb691f6d..000000000 --- a/types/abi-types/factories/Tes__factory.d.ts +++ /dev/null @@ -1,280 +0,0 @@ -import { ContractRunner } from "../../corebc.js"; -import type { Tes, TesInterface } from "../Tes.js"; -export declare class Tes__factory { - static readonly abi: readonly [{ - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "approved"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Approval"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly indexed: false; - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "ApprovalForAll"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Transfer"; - readonly type: "event"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "approve"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }]; - readonly name: "balanceOf"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256[]"; - readonly name: "ids"; - readonly type: "uint256[]"; - }]; - readonly name: "batchOwnerOf"; - readonly outputs: readonly [{ - readonly internalType: "address[]"; - readonly name: ""; - readonly type: "address[]"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "getApproved"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }]; - readonly name: "isApprovedForAll"; - readonly outputs: readonly [{ - readonly internalType: "bool"; - readonly name: ""; - readonly type: "bool"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }]; - readonly name: "mint"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "ownerOf"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }, { - readonly internalType: "bytes"; - readonly name: "data"; - readonly type: "bytes"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "setApprovalForAll"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenOfOwnerByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly []; - readonly name: "totalSupply"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "transferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }]; - static createInterface(): TesInterface; - static connect(address: string, runner?: ContractRunner | null): Tes; -} -//# sourceMappingURL=Tes__factory.d.ts.map \ No newline at end of file diff --git a/types/abi-types/factories/Tes__factory.d.ts.map b/types/abi-types/factories/Tes__factory.d.ts.map deleted file mode 100644 index 262b59a93..000000000 --- a/types/abi-types/factories/Tes__factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAuWnD,qBAAa,YAAY;IACxB,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qB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EnE;CACD"} \ No newline at end of file diff --git a/types/abi-types/factories/Tes_abi__factory.d.ts b/types/abi-types/factories/Tes_abi__factory.d.ts deleted file mode 100644 index bd8c9ccc6..000000000 --- a/types/abi-types/factories/Tes_abi__factory.d.ts +++ /dev/null @@ -1,280 +0,0 @@ -import { ContractRunner } from "../../corebc.js"; -import type { Tes_abi, Tes_abiInterface } from "../Tes_abi.js"; -export declare class Tes_abi__factory { - static readonly abi: readonly [{ - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "approved"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Approval"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly indexed: false; - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "ApprovalForAll"; - readonly type: "event"; - }, { - readonly anonymous: false; - readonly inputs: readonly [{ - readonly indexed: true; - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly indexed: true; - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "Transfer"; - readonly type: "event"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "approve"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }]; - readonly name: "balanceOf"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256[]"; - readonly name: "ids"; - readonly type: "uint256[]"; - }]; - readonly name: "batchOwnerOf"; - readonly outputs: readonly [{ - readonly internalType: "address[]"; - readonly name: ""; - readonly type: "address[]"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "getApproved"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }]; - readonly name: "isApprovedForAll"; - readonly outputs: readonly [{ - readonly internalType: "bool"; - readonly name: ""; - readonly type: "bool"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }]; - readonly name: "mint"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "ownerOf"; - readonly outputs: readonly [{ - readonly internalType: "address"; - readonly name: ""; - readonly type: "address"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }, { - readonly internalType: "bytes"; - readonly name: "data"; - readonly type: "bytes"; - }]; - readonly name: "safeTransferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "operator"; - readonly type: "address"; - }, { - readonly internalType: "bool"; - readonly name: "approved"; - readonly type: "bool"; - }]; - readonly name: "setApprovalForAll"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "owner"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "index"; - readonly type: "uint256"; - }]; - readonly name: "tokenOfOwnerByIndex"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly []; - readonly name: "totalSupply"; - readonly outputs: readonly [{ - readonly internalType: "uint256"; - readonly name: ""; - readonly type: "uint256"; - }]; - readonly stateMutability: "view"; - readonly type: "function"; - }, { - readonly inputs: readonly [{ - readonly internalType: "address"; - readonly name: "from"; - readonly type: "address"; - }, { - readonly internalType: "address"; - readonly name: "to"; - readonly type: "address"; - }, { - readonly internalType: "uint256"; - readonly name: "tokenId"; - readonly type: "uint256"; - }]; - readonly name: "transferFrom"; - readonly outputs: readonly []; - readonly stateMutability: "nonpayable"; - readonly type: "function"; - }]; - static createInterface(): Tes_abiInterface; - static connect(address: string, runner?: ContractRunner | null): Tes_abi; -} -//# sourceMappingURL=Tes_abi__factory.d.ts.map \ No newline at end of file diff --git a/types/abi-types/factories/Tes_abi__factory.d.ts.map b/types/abi-types/factories/Tes_abi__factory.d.ts.map deleted file mode 100644 index 530a4f795..000000000 --- a/types/abi-types/factories/Tes_abi__factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Tes_abi__factory.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/Tes_abi__factory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAY,cAAc,EAAa,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAuW/D,qBAAa,gBAAgB;IAC5B,MAAM,CAAC,QAAQ,CAAC,GAAG;;;qBAjWhB,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,UAAU;uBACV,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,SAAS;;qBAGf,OAAO;qBACP,YAAY,EAAE,MAAM;qBACpB,IAAI,EAAE,UAAU;qBAChB,IAAI,EAAE,MAAM;;uBAGR,gBAAgB;uBAChB,OAAO;;;;qBAMX,OAAO;qBACP,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,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AAI,EAAE,SAAS;;uBAGX,cAAc;;qBAGlB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,OAAO;qBACb,IAAI,EAAE,SAAS;;uBAGX,qBAAqB;;qBAGzB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;uBAIV,aAAa;;qBAGjB,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,EAAE;qBACR,IAAI,EAAE,SAAS;;kCAGA,MAAM;uBACjB,UAAU;;;qBAKd,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,MAAM;qBACZ,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,IAAI;qBACV,IAAI,EAAE,SAAS;;qBAGf,YAAY,EAAE,SAAS;qBACvB,IAAI,EAAE,SAAS;qBACf,IAAI,EAAE,SAAS;;uBAGX,cAAc;;kCAEH,YAAY;uBACvB,UAAU;OAKU;IAC3B,MAAM,CAAC,eAAe,IAAI,gBAAgB,CAEzC;IACD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAEvE;CACD"} \ No newline at end of file diff --git a/types/abi-types/factories/index.d.ts b/types/abi-types/factories/index.d.ts deleted file mode 100644 index e6b4dbcc0..000000000 --- a/types/abi-types/factories/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { Tes__factory } from "./Tes__factory.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/abi-types/factories/index.d.ts.map b/types/abi-types/factories/index.d.ts.map deleted file mode 100644 index 2727001fd..000000000 --- a/types/abi-types/factories/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src.ts/abi-types/factories/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/types/abi-types/index.d.ts b/types/abi-types/index.d.ts deleted file mode 100644 index ca4fb7b40..000000000 --- a/types/abi-types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type { Tes } from "./Tes.js"; -export * as factories from "./factories/index.js"; -export { Tes__factory } from "./factories/Tes__factory.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/abi-types/index.d.ts.map b/types/abi-types/index.d.ts.map deleted file mode 100644 index 90d11b2fc..000000000 --- a/types/abi-types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi-types/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC"} \ No newline at end of file diff --git a/types/abi/abi-coder.d.ts b/types/abi/abi-coder.d.ts deleted file mode 100644 index 1350031d4..000000000 --- a/types/abi/abi-coder.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/** - * When sending values to or receiving values from a [[Contract]], the - * data is generally encoded using the [ABI standard](link-solc-abi). - * - * The AbiCoder provides a utility to encode values to ABI data and - * decode values from ABI data. - * - * Most of the time, developers should favour the [[Contract]] class, - * which further abstracts a lot of the finer details of ABI data. - * - * @_section api/abi/abi-coder:ABI Encoding - */ -import { Result } from "./coders/abstract-coder.js"; -import { ParamType } from "./fragments.js"; -import type { BytesLike, CallExceptionAction, CallExceptionError } from "../utils/index.js"; -/** - * About AbiCoder - */ -export declare class AbiCoder { - #private; - /** - * Get the default values for the given %%types%%. - * - * For example, a ``uint`` is by default ``0`` and ``bool`` - * is by default ``false``. - */ - getDefaultValue(types: ReadonlyArray): Result; - /** - * Encode the %%values%% as the %%types%% into ABI data. - * - * @returns DataHexstring - */ - encode(types: ReadonlyArray, values: ReadonlyArray): string; - /** - * Decode the ABI %%data%% as the %%types%% into values. - * - * If %%loose%% decoding is enabled, then strict padding is - * not enforced. Some older versions of Solidity incorrectly - * padded event data emitted from ``external`` functions. - */ - decode(types: ReadonlyArray, data: BytesLike, loose?: boolean): Result; - /** - * Returns the shared singleton instance of a default [[AbiCoder]]. - * - * On the first call, the instance is created internally. - */ - static defaultAbiCoder(): AbiCoder; - /** - * Returns an corebc-compatible [[CallExceptionError]] Error for the given - * result %%data%% for the [[CallExceptionAction]] %%action%% against - * the Transaction %%tx%%. - */ - static getBuiltinCallException(action: CallExceptionAction, tx: { - to?: null | string; - from?: null | string; - data?: string; - }, data: null | BytesLike): CallExceptionError; -} -//# sourceMappingURL=abi-coder.d.ts.map \ No newline at end of file diff --git a/types/abi/abi-coder.d.ts.map b/types/abi/abi-coder.d.ts.map deleted file mode 100644 index ad04d5ac9..000000000 --- a/types/abi/abi-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abi-coder.d.ts","sourceRoot":"","sources":["../../src.ts/abi/abi-coder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAiB,MAAM,EAAU,MAAM,4BAA4B,CAAC;AAU3E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACX,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAElB,MAAM,mBAAmB,CAAC;AA8F3B;;GAEG;AACH,qBAAa,QAAQ;;IA2DpB;;;;;OAKG;IACH,eAAe,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAMhE;IAED;;;;OAIG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;IAED;;;;;;OAMG;IACH,MAAM,CACL,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC,EACxC,IAAI,EAAE,SAAS,EACf,KAAK,CAAC,EAAE,OAAO,GACb,MAAM,CAMR;IAED;;;;OAIG;IACH,MAAM,CAAC,eAAe,IAAI,QAAQ,CAKjC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,EAAE,EAAE;QAAE,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAC/D,IAAI,EAAE,IAAI,GAAG,SAAS,GACpB,kBAAkB,CAOpB;CACD"} \ No newline at end of file diff --git a/types/abi/bytes32.d.ts b/types/abi/bytes32.d.ts deleted file mode 100644 index 73455cb5d..000000000 --- a/types/abi/bytes32.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * About bytes32 strings... - * - * @_docloc: api/utils:Bytes32 Strings - */ -import type { BytesLike } from "../utils/index.js"; -/** - * Encodes %%text%% as a Bytes32 string. - */ -export declare function encodeBytes32String(text: string): string; -/** - * Encodes the Bytes32-encoded %%bytes%% into a string. - */ -export declare function decodeBytes32String(_bytes: BytesLike): string; -//# sourceMappingURL=bytes32.d.ts.map \ No newline at end of file diff --git a/types/abi/bytes32.d.ts.map b/types/abi/bytes32.d.ts.map deleted file mode 100644 index 09513605d..000000000 --- a/types/abi/bytes32.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes32.d.ts","sourceRoot":"","sources":["../../src.ts/abi/bytes32.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAWxD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAmB7D"} \ No newline at end of file diff --git a/types/abi/coders/abstract-coder.d.ts b/types/abi/coders/abstract-coder.d.ts deleted file mode 100644 index 53d1481b3..000000000 --- a/types/abi/coders/abstract-coder.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -import type { BigNumberish, BytesLike } from "../../utils/index.js"; -/** - * @_ignore: - */ -export declare const WordSize: number; -/** - * A [[Result]] is a sub-class of Array, which allows accessing any - * of its values either positionally by its index or, if keys are - * provided by its name. - * - * @_docloc: api/abi - */ -export declare class Result extends Array { - #private; - [K: string | number]: any; - /** - * @private - */ - constructor(...args: Array); - /** - * Returns the Result as a normal Array. - * - * This will throw if there are any outstanding deferred - * errors. - */ - toArray(): Array; - /** - * Returns the Result as an Object with each name-value pair. - * - * This will throw if any value is unnamed, or if there are - * any outstanding deferred errors. - */ - toObject(): Record; - /** - * @_ignore - */ - slice(start?: number | undefined, end?: number | undefined): Result; - /** - * @_ignore - */ - filter(callback: (el: any, index: number, array: Result) => boolean, thisArg?: any): Result; - /** - * Returns the value for %%name%%. - * - * Since it is possible to have a key whose name conflicts with - * a method on a [[Result]] or its superclass Array, or any - * JavaScript keyword, this ensures all named values are still - * accessible by name. - */ - getValue(name: string): any; - /** - * Creates a new [[Result]] for %%items%% with each entry - * also accessible by its corresponding name in %%keys%%. - */ - static fromItems(items: Array, keys?: Array): Result; -} -/** - * Returns all errors found in a [[Result]]. - * - * Since certain errors encountered when creating a [[Result]] do - * not impact the ability to continue parsing data, they are - * deferred until they are actually accessed. Hence a faulty string - * in an Event that is never used does not impact the program flow. - * - * However, sometimes it may be useful to access, identify or - * validate correctness of a [[Result]]. - * - * @_docloc api/abi - */ -export declare function checkResultErrors(result: Result): Array<{ - path: Array; - error: Error; -}>; -/** - * @_ignore - */ -export declare abstract class Coder { - readonly name: string; - readonly type: string; - readonly localName: string; - readonly dynamic: boolean; - constructor(name: string, type: string, localName: string, dynamic: boolean); - _throwError(message: string, value: any): never; - abstract encode(writer: Writer, value: any): number; - abstract decode(reader: Reader): any; - abstract defaultValue(): any; -} -/** - * @_ignore - */ -export declare class Writer { - #private; - constructor(); - get data(): string; - get length(): number; - appendWriter(writer: Writer): number; - writeBytes(value: BytesLike): number; - writeValue(value: BigNumberish): number; - writeUpdatableValue(): (value: BigNumberish) => void; -} -/** - * @_ignore - */ -export declare class Reader { - #private; - readonly allowLoose: boolean; - constructor(data: BytesLike, allowLoose?: boolean); - get data(): string; - get dataLength(): number; - get consumed(): number; - get bytes(): Uint8Array; - subReader(offset: number): Reader; - readBytes(length: number, loose?: boolean): Uint8Array; - readValue(): bigint; - readIndex(): number; -} -//# sourceMappingURL=abstract-coder.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/abstract-coder.d.ts.map b/types/abi/coders/abstract-coder.d.ts.map deleted file mode 100644 index df211a063..000000000 --- a/types/abi/coders/abstract-coder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-coder.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/abstract-coder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAW,CAAC;AAiBnC;;;;;;GAMG;AACH,qBAAa,MAAO,SAAQ,KAAK,CAAC,GAAG,CAAC;;IAGrC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;IAE1B;;OAEG;IACH,YAAY,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,EAgG9B;IAED;;;;;OAKG;IACH,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CASpB;IAED;;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CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAAC;IACpD,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC;IAErC,QAAQ,CAAC,YAAY,IAAI,GAAG,CAAC;CAC7B;AAED;;GAEG;AACH,qBAAa,MAAM;;IAKlB,cAGC;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAQD,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnC;IAGD,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAOnC;IAGD,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAEtC;IAID,mBAAmB,IAAI,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAOnD;CACD;AAED;;GAEG;AACH,qBAAa,MAAM;;IAKlB,QAAQ,CAAC,UAAU,EAAG,OAAO,CAAC;IAK9B,YAAY,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAMhD;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IACD,IAAI,UAAU,IAAI,MAAM,CAEvB;IACD,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,KAAK,IAAI,UAAU,CAEtB;IAuBD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhC;IAGD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,UAAU,CAKrD;IAGD,SAAS,IAAI,MAAM,CAElB;IAED,SAAS,IAAI,MAAM,CAElB;CACD"} \ No newline at end of file diff --git a/types/abi/coders/address.d.ts b/types/abi/coders/address.d.ts deleted file mode 100644 index 8befac03a..000000000 --- a/types/abi/coders/address.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class AddressCoder extends Coder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/address.d.ts.map b/types/abi/coders/address.d.ts.map deleted file mode 100644 index 030f77d6d..000000000 --- a/types/abi/coders/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/address.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAQrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/anonymous.d.ts b/types/abi/coders/anonymous.d.ts deleted file mode 100644 index 554bf03f0..000000000 --- a/types/abi/coders/anonymous.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * Clones the functionality of an existing Coder, but without a localName - * - * @_ignore - */ -export declare class AnonymousCoder extends Coder { - private coder; - constructor(coder: Coder); - defaultValue(): any; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=anonymous.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/anonymous.d.ts.map b/types/abi/coders/anonymous.d.ts.map deleted file mode 100644 index d0f9d87cb..000000000 --- a/types/abi/coders/anonymous.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"anonymous.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/anonymous.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACxC,OAAO,CAAC,KAAK,CAAQ;IAErB,YAAY,KAAK,EAAE,KAAK,EAGvB;IAED,YAAY,IAAI,GAAG,CAElB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAEzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/array.d.ts b/types/abi/coders/array.d.ts deleted file mode 100644 index 954c4e17e..000000000 --- a/types/abi/coders/array.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder, Result, Writer } from "./abstract-coder.js"; -import type { Reader } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare function pack(writer: Writer, coders: ReadonlyArray, values: Array | { - [name: string]: any; -}): number; -/** - * @_ignore - */ -export declare function unpack(reader: Reader, coders: ReadonlyArray): Result; -/** - * @_ignore - */ -export declare class ArrayCoder extends Coder { - readonly coder: Coder; - readonly length: number; - constructor(coder: Coder, length: number, localName: string); - defaultValue(): Array; - encode(writer: Writer, _value: Array | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=array.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/array.d.ts.map b/types/abi/coders/array.d.ts.map deleted file mode 100644 index 8cdb33a3b..000000000 --- a/types/abi/coders/array.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/array.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAY,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH,wBAAgB,IAAI,CACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,EAC5B,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAC1C,MAAM,CAuER;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,MAAM,CAmD3E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,KAAK,EAAG,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB,YAAY,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAK1D;IAED,YAAY,IAAI,KAAK,CAAC,GAAG,CAAC,CASzB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,MAAM,CA0BzD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CA2B1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/boolean.d.ts b/types/abi/coders/boolean.d.ts deleted file mode 100644 index f073e37ee..000000000 --- a/types/abi/coders/boolean.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class BooleanCoder extends Coder { - constructor(localName: string); - defaultValue(): boolean; - encode(writer: Writer, _value: boolean | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=boolean.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/boolean.d.ts.map b/types/abi/coders/boolean.d.ts.map deleted file mode 100644 index f0c2679a1..000000000 --- a/types/abi/coders/boolean.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACtC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,OAAO,CAEtB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAGtD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/bytes.d.ts b/types/abi/coders/bytes.d.ts deleted file mode 100644 index 1e554582f..000000000 --- a/types/abi/coders/bytes.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class DynamicBytesCoder extends Coder { - constructor(type: string, localName: string); - defaultValue(): string; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -/** - * @_ignore - */ -export declare class BytesCoder extends DynamicBytesCoder { - constructor(localName: string); - decode(reader: Reader): any; -} -//# sourceMappingURL=bytes.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/bytes.d.ts.map b/types/abi/coders/bytes.d.ts.map deleted file mode 100644 index 956098f28..000000000 --- a/types/abi/coders/bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAE1C;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,iBAAiB;IAChD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/fixed-bytes.d.ts b/types/abi/coders/fixed-bytes.d.ts deleted file mode 100644 index 5c485fef6..000000000 --- a/types/abi/coders/fixed-bytes.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BytesLike } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class FixedBytesCoder extends Coder { - readonly size: number; - constructor(size: number, localName: string); - defaultValue(): string; - encode(writer: Writer, _value: BytesLike | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=fixed-bytes.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/fixed-bytes.d.ts.map b/types/abi/coders/fixed-bytes.d.ts.map deleted file mode 100644 index 9d870c078..000000000 --- a/types/abi/coders/fixed-bytes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixed-bytes.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/fixed-bytes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAI1C;IAED,YAAY,IAAI,MAAM,CAKrB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,KAAK,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/null.d.ts b/types/abi/coders/null.d.ts deleted file mode 100644 index 5df5da342..000000000 --- a/types/abi/coders/null.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NullCoder extends Coder { - constructor(localName: string); - defaultValue(): null; - encode(writer: Writer, value: any): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=null.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/null.d.ts.map b/types/abi/coders/null.d.ts.map deleted file mode 100644 index e2ef8ebc5..000000000 --- a/types/abi/coders/null.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"null.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/null.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI1D;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IACnC,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,IAAI,CAEnB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,MAAM,CAKzC;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAG1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/number.d.ts b/types/abi/coders/number.d.ts deleted file mode 100644 index 822cc6df2..000000000 --- a/types/abi/coders/number.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { BigNumberish } from "../../utils/index.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class NumberCoder extends Coder { - readonly size: number; - readonly signed: boolean; - constructor(size: number, signed: boolean, localName: string); - defaultValue(): number; - encode(writer: Writer, _value: BigNumberish | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=number.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/number.d.ts.map b/types/abi/coders/number.d.ts.map deleted file mode 100644 index 5af9a7edb..000000000 --- a/types/abi/coders/number.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/number.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAG,OAAO,CAAC;IAE1B,YAAY,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAS3D;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM,CAgB3D;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAQ1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/string.d.ts b/types/abi/coders/string.d.ts deleted file mode 100644 index 8e1c63593..000000000 --- a/types/abi/coders/string.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Typed } from "../typed.js"; -import { DynamicBytesCoder } from "./bytes.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class StringCoder extends DynamicBytesCoder { - constructor(localName: string); - defaultValue(): string; - encode(writer: Writer, _value: string | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=string.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/string.d.ts.map b/types/abi/coders/string.d.ts.map deleted file mode 100644 index d0158dd8b..000000000 --- a/types/abi/coders/string.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/string.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,WAAY,SAAQ,iBAAiB;IACjD,YAAY,SAAS,EAAE,MAAM,EAE5B;IAED,YAAY,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAKrD;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/coders/tuple.d.ts b/types/abi/coders/tuple.d.ts deleted file mode 100644 index fe3ec0328..000000000 --- a/types/abi/coders/tuple.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Typed } from "../typed.js"; -import { Coder } from "./abstract-coder.js"; -import type { Reader, Writer } from "./abstract-coder.js"; -/** - * @_ignore - */ -export declare class TupleCoder extends Coder { - readonly coders: ReadonlyArray; - constructor(coders: Array, localName: string); - defaultValue(): any; - encode(writer: Writer, _value: Array | { - [name: string]: any; - } | Typed): number; - decode(reader: Reader): any; -} -//# sourceMappingURL=tuple.d.ts.map \ No newline at end of file diff --git a/types/abi/coders/tuple.d.ts.map b/types/abi/coders/tuple.d.ts.map deleted file mode 100644 index bc66dc09e..000000000 --- a/types/abi/coders/tuple.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tuple.d.ts","sourceRoot":"","sources":["../../../src.ts/abi/coders/tuple.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,EAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAEvC,YAAY,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,MAAM,EAelD;IAED,YAAY,IAAI,GAAG,CAwClB;IAED,MAAM,CACL,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,KAAK,GAClD,MAAM,CAGR;IAED,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAE1B;CACD"} \ No newline at end of file diff --git a/types/abi/fragments.d.ts b/types/abi/fragments.d.ts deleted file mode 100644 index 6d88c3596..000000000 --- a/types/abi/fragments.d.ts +++ /dev/null @@ -1,372 +0,0 @@ -/** - * About frgaments... - * - * @_subsection api/abi/abi-coder:Fragments [about-fragments] - */ -/** - * A type description in a JSON API. - */ -export interface JsonFragmentType { - /** - * The parameter name. - */ - readonly name?: string; - /** - * If the parameter is indexed. - */ - readonly indexed?: boolean; - /** - * The type of the parameter. - */ - readonly type?: string; - /** - * The internal Solidity type. - */ - readonly internalType?: string; - /** - * The components for a tuple. - */ - readonly components?: ReadonlyArray; -} -/** - * A fragment for a method, event or error in a JSON API. - */ -export interface JsonFragment { - /** - * The name of the error, event, function, etc. - */ - readonly name?: string; - /** - * The type of the fragment (e.g. ``event``, ``"function"``, etc.) - */ - readonly type?: string; - /** - * If the event is anonymous. - */ - readonly anonymous?: boolean; - /** - * If the function is payable. - */ - readonly payable?: boolean; - /** - * If the function is constant. - */ - readonly constant?: boolean; - /** - * The mutability state of the function. - */ - readonly stateMutability?: string; - /** - * The input parameters. - */ - readonly inputs?: ReadonlyArray; - /** - * The output parameters. - */ - readonly outputs?: ReadonlyArray; - /** - * The energy limit to use when sending a transaction for this function. - */ - readonly energy?: string; -} -/** - * The format to serialize the output as. - */ -export type FormatType = "sighash" | "minimal" | "full" | "json"; -/** - * When [walking](ParamType-walk) a [[ParamType]], this is called - * on each component. - */ -export type ParamTypeWalkFunc = (type: string, value: any) => any; -/** - * When [walking asynchronously](ParamType-walkAsync) a [[ParamType]], - * this is called on each component. - */ -export type ParamTypeWalkAsyncFunc = (type: string, value: any) => any | Promise; -/** - * Each input and output of a [[Fragment]] is an Array of **PAramType**. - */ -export declare class ParamType { - #private; - /** - * The local name of the parameter (or ``""`` if unbound) - */ - readonly name: string; - /** - * The fully qualified type (e.g. ``"address"``, ``"tuple(address)"``, - * ``"uint256[3][]"``) - */ - readonly type: string; - /** - * The base type (e.g. ``"address"``, ``"tuple"``, ``"array"``) - */ - readonly baseType: string; - /** - * True if the parameters is indexed. - * - * For non-indexable types this is ``null``. - */ - readonly indexed: null | boolean; - /** - * The components for the tuple. - * - * For non-tuple types this is ``null``. - */ - readonly components: null | ReadonlyArray; - /** - * The array length, or ``-1`` for dynamic-lengthed arrays. - * - * For non-array types this is ``null``. - */ - readonly arrayLength: null | number; - /** - * The type of each child in the array. - * - * For non-array types this is ``null``. - */ - readonly arrayChildren: null | ParamType; - /** - * @private - */ - constructor(guard: any, name: string, type: string, baseType: string, indexed: null | boolean, components: null | ReadonlyArray, arrayLength: null | number, arrayChildren: null | ParamType); - /** - * Return a string representation of this type. - * - * For example, - * - * ``sighash" => "(uint256,address)"`` - * - * ``"minimal" => "tuple(uint256,address) indexed"`` - * - * ``"full" => "tuple(uint256 foo, address bar) indexed baz"`` - */ - format(format?: FormatType): string; - /** - * Returns true if %%this%% is an Array type. - * - * This provides a type gaurd ensuring that [[arrayChildren]] - * and [[arrayLength]] are non-null. - */ - isArray(): this is ParamType & { - arrayChildren: ParamType; - arrayLength: number; - }; - /** - * Returns true if %%this%% is a Tuple type. - * - * This provides a type gaurd ensuring that [[components]] - * is non-null. - */ - isTuple(): this is ParamType & { - components: ReadonlyArray; - }; - /** - * Returns true if %%this%% is an Indexable type. - * - * This provides a type gaurd ensuring that [[indexed]] - * is non-null. - */ - isIndexable(): this is ParamType & { - indexed: boolean; - }; - /** - * Walks the **ParamType** with %%value%%, calling %%process%% - * on each type, destructing the %%value%% recursively. - */ - walk(value: any, process: ParamTypeWalkFunc): any; - /** - * Walks the **ParamType** with %%value%%, asynchronously calling - * %%process%% on each type, destructing the %%value%% recursively. - * - * This can be used to resolve ENS naes by walking and resolving each - * ``"address"`` type. - */ - walkAsync(value: any, process: ParamTypeWalkAsyncFunc): Promise; - /** - * Creates a new **ParamType** for %%obj%%. - * - * If %%allowIndexed%% then the ``indexed`` keyword is permitted, - * otherwise the ``indexed`` keyword will throw an error. - */ - static from(obj: any, allowIndexed?: boolean): ParamType; - /** - * Returns true if %%value%% is a **ParamType**. - */ - static isParamType(value: any): value is ParamType; -} -/** - * The type of a [[Fragment]]. - */ -export type FragmentType = "constructor" | "error" | "event" | "fallback" | "function" | "struct"; -/** - * An abstract class to represent An individual fragment from a parse ABI. - */ -export declare abstract class Fragment { - /** - * The type of the fragment. - */ - readonly type: FragmentType; - /** - * The inputs for the fragment. - */ - readonly inputs: ReadonlyArray; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray); - /** - * Returns a string representation of this fragment. - */ - abstract format(format?: FormatType): string; - /** - * Creates a new **Fragment** for %%obj%%, wich can be any supported - * ABI frgament type. - */ - static from(obj: any): Fragment; - /** - * Returns true if %%value%% is a [[ConstructorFragment]]. - */ - static isConstructor(value: any): value is ConstructorFragment; - /** - * Returns true if %%value%% is an [[ErrorFragment]]. - */ - static isError(value: any): value is ErrorFragment; - /** - * Returns true if %%value%% is an [[EventFragment]]. - */ - static isEvent(value: any): value is EventFragment; - /** - * Returns true if %%value%% is a [[FunctionFragment]]. - */ - static isFunction(value: any): value is FunctionFragment; - /** - * Returns true if %%value%% is a [[StructFragment]]. - */ - static isStruct(value: any): value is StructFragment; -} -/** - * An abstract class to represent An individual fragment - * which has a name from a parse ABI. - */ -export declare abstract class NamedFragment extends Fragment { - /** - * The name of the fragment. - */ - readonly name: string; - /** - * @private - */ - constructor(guard: any, type: FragmentType, name: string, inputs: ReadonlyArray); -} -/** - * A Fragment which represents a //Custom Error//. - */ -export declare class ErrorFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - /** - * The Custom Error selector. - */ - get selector(): string; - format(format?: FormatType): string; - static from(obj: any): ErrorFragment; - static isFragment(value: any): value is ErrorFragment; -} -/** - * A Fragment which represents an Event. - */ -export declare class EventFragment extends NamedFragment { - readonly anonymous: boolean; - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray, anonymous: boolean); - /** - * The Event topic hash. - */ - get topicHash(): string; - format(format?: FormatType): string; - static getTopicHash(name: string, params?: Array): string; - static from(obj: any): EventFragment; - static isFragment(value: any): value is EventFragment; -} -/** - * A Fragment which represents a constructor. - */ -export declare class ConstructorFragment extends Fragment { - readonly payable: boolean; - readonly energy: null | bigint; - /** - * @private - */ - constructor(guard: any, type: FragmentType, inputs: ReadonlyArray, payable: boolean, energy: null | bigint); - format(format?: FormatType): string; - static from(obj: any): ConstructorFragment; - static isFragment(value: any): value is ConstructorFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FallbackFragment extends Fragment { - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - constructor(guard: any, inputs: ReadonlyArray, payable: boolean); - format(format?: FormatType): string; - static from(obj: any): FallbackFragment; - static isFragment(value: any): value is FallbackFragment; -} -/** - * A Fragment which represents a method. - */ -export declare class FunctionFragment extends NamedFragment { - /** - * If the function is constant (e.g. ``pure`` or ``view`` functions). - */ - readonly constant: boolean; - /** - * The returned types for the result of calling this function. - */ - readonly outputs: ReadonlyArray; - /** - * The state mutability (e.g. ``payable``, ``nonpayable``, ``view`` - * or ``pure``) - */ - readonly stateMutability: "payable" | "nonpayable" | "view" | "pure"; - /** - * If the function can be sent value during invocation. - */ - readonly payable: boolean; - /** - * The amount of energy to send when calling this function - */ - readonly energy: null | bigint; - /** - * @private - */ - constructor(guard: any, name: string, stateMutability: "payable" | "nonpayable" | "view" | "pure", inputs: ReadonlyArray, outputs: ReadonlyArray, energy: null | bigint); - /** - * The Function selector. - */ - get selector(): string; - format(format?: FormatType): string; - static getSelector(name: string, params?: Array): string; - static from(obj: any): FunctionFragment; - static isFragment(value: any): value is FunctionFragment; -} -/** - * A Fragment which represents a structure. - */ -export declare class StructFragment extends NamedFragment { - /** - * @private - */ - constructor(guard: any, name: string, inputs: ReadonlyArray); - format(): string; - static from(obj: any): StructFragment; - static isFragment(value: any): value is FunctionFragment; -} -//# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/types/abi/fragments.d.ts.map b/types/abi/fragments.d.ts.map deleted file mode 100644 index b1a1124b4..000000000 --- a/types/abi/fragments.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../src.ts/abi/fragments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAElD;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;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C,GAAG,MAAM,CAW5D;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,gBAAgB,CA6DtC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,aAAa;IAChD;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,EAGrE;IAED,MAAM,IAAI,MAAM,CAEf;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,cAAc,CAepC;IAED,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,gBAAgB,CAEvD;CACD"} \ No newline at end of file diff --git a/types/abi/index.d.ts b/types/abi/index.d.ts deleted file mode 100644 index ce0ddb016..000000000 --- a/types/abi/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Explain about ABI here... - * - * @_section api/abi:Application Binary Interface [about-abi] - * @_navTitle: ABI - */ -export { AbiCoder } from "./abi-coder.js"; -export { decodeBytes32String, encodeBytes32String } from "./bytes32.js"; -export { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, NamedFragment, ParamType, StructFragment, } from "./fragments.js"; -export { checkResultErrors, Indexed, Interface, ErrorDescription, LogDescription, TransactionDescription, Result, } from "./interface.js"; -export { Typed } from "./typed.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, ParamTypeWalkAsyncFunc, ParamTypeWalkFunc, } from "./fragments.js"; -export type { InterfaceAbi } from "./interface.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/abi/index.d.ts.map b/types/abi/index.d.ts.map deleted file mode 100644 index a3a6ec0b1..000000000 --- a/types/abi/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/abi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,GACd,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACN,iBAAiB,EACjB,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,MAAM,GACN,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,YAAY,EACX,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/types/abi/interface.d.ts b/types/abi/interface.d.ts deleted file mode 100644 index 62b24ebe4..000000000 --- a/types/abi/interface.d.ts +++ /dev/null @@ -1,270 +0,0 @@ -/** - * About Interface - * - * @_subsection api/abi:Interfaces [interfaces] - */ -import { AbiCoder } from "./abi-coder.js"; -import { checkResultErrors, Result } from "./coders/abstract-coder.js"; -import { ConstructorFragment, ErrorFragment, EventFragment, FallbackFragment, Fragment, FunctionFragment, ParamType } from "./fragments.js"; -import { Typed } from "./typed.js"; -import type { BigNumberish, BytesLike, CallExceptionError, CallExceptionTransaction } from "../utils/index.js"; -import type { JsonFragment } from "./fragments.js"; -export { checkResultErrors, Result }; -export declare class LogDescription { - readonly fragment: EventFragment; - readonly name: string; - readonly signature: string; - readonly topic: string; - readonly args: Result; - constructor(fragment: EventFragment, topic: string, args: Result); -} -export declare class TransactionDescription { - readonly fragment: FunctionFragment; - readonly name: string; - readonly args: Result; - readonly signature: string; - readonly selector: string; - readonly value: bigint; - constructor(fragment: FunctionFragment, selector: string, args: Result, value: bigint); -} -export declare class ErrorDescription { - readonly fragment: ErrorFragment; - readonly name: string; - readonly args: Result; - readonly signature: string; - readonly selector: string; - constructor(fragment: ErrorFragment, selector: string, args: Result); -} -export declare class Indexed { - readonly hash: null | string; - readonly _isIndexed: boolean; - static isIndexed(value: any): value is Indexed; - constructor(hash: null | string); -} -/** - * @TODO - */ -export type InterfaceAbi = string | ReadonlyArray; -/** - * An Interface abstracts many of the low-level details for - * encoding and decoding the data on the blockchain. - * - * An ABI provides information on how to encode data to send to - * a Contract, how to decode the results and events and how to - * interpret revert errors. - * - * The ABI can be specified by [any supported format](InterfaceAbi). - */ -export declare class Interface { - #private; - /** - * All the Contract ABI members (i.e. methods, events, errors, etc). - */ - readonly fragments: ReadonlyArray; - /** - * The Contract constructor. - */ - readonly deploy: ConstructorFragment; - /** - * The Fallback method, if any. - */ - readonly fallback: null | FallbackFragment; - /** - * If receiving xcb is supported. - */ - readonly receive: boolean; - /** - * Create a new Interface for the %%fragments%%. - */ - constructor(fragments: InterfaceAbi); - /** - * Returns the entire Human-Readable ABI, as an array of - * signatures, optionally as %%minimal%% strings, which - * removes parameter names and unneceesary spaces. - */ - format(minimal?: boolean): Array; - /** - * Return the JSON-encoded ABI. This is the format Solidiy - * returns. - */ - formatJson(): string; - /** - * The ABI coder that will be used to encode and decode binary - * data. - */ - getAbiCoder(): AbiCoder; - /** - * Get the function name for %%key%%, which may be a function selector, - * function name or function signature that belongs to the ABI. - */ - getFunctionName(key: string): string; - /** - * Returns true if %%key%% (a function selector, function name or - * function signature) is present in the ABI. - * - * In the case of a function name, the name may be ambiguous, so - * accessing the [[FunctionFragment]] may require refinement. - */ - hasFunction(key: string): boolean; - /** - * Get the [[FunctionFragment]] for %%key%%, which may be a function - * selector, function name or function signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple functions match by name. - * - * If the %%key%% and %%values%% do not refine to a single function in - * the ABI, this will throw. - */ - getFunction(key: string, values?: Array): null | FunctionFragment; - /** - * Iterate over all functions, calling %%callback%%, sorted by their name. - */ - forEachFunction(callback: (func: FunctionFragment, index: number) => void): void; - /** - * Get the event name for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - */ - getEventName(key: string): string; - /** - * Returns true if %%key%% (an event topic hash, event name or - * event signature) is present in the ABI. - * - * In the case of an event name, the name may be ambiguous, so - * accessing the [[EventFragment]] may require refinement. - */ - hasEvent(key: string): boolean; - /** - * Get the [[EventFragment]] for %%key%%, which may be a topic hash, - * event name or event signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple events match by name. - * - * If the %%key%% and %%values%% do not refine to a single event in - * the ABI, this will throw. - */ - getEvent(key: string, values?: Array): null | EventFragment; - /** - * Iterate over all events, calling %%callback%%, sorted by their name. - */ - forEachEvent(callback: (func: EventFragment, index: number) => void): void; - /** - * Get the [[ErrorFragment]] for %%key%%, which may be an error - * selector, error name or error signature that belongs to the ABI. - * - * If %%values%% is provided, it will use the Typed API to handle - * ambiguous cases where multiple errors match by name. - * - * If the %%key%% and %%values%% do not refine to a single error in - * the ABI, this will throw. - */ - getError(key: string, values?: Array): null | ErrorFragment; - /** - * Iterate over all errors, calling %%callback%%, sorted by their name. - */ - forEachError(callback: (func: ErrorFragment, index: number) => void): void; - _decodeParams(params: ReadonlyArray, data: BytesLike): Result; - _encodeParams(params: ReadonlyArray, values: ReadonlyArray): string; - /** - * Encodes a ``tx.data`` object for deploying the Contract with - * the %%values%% as the constructor arguments. - */ - encodeDeploy(values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified error (see [[getError]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeErrorResult(fragment: ErrorFragment | string, data: BytesLike): Result; - /** - * Encodes the transaction revert data for a call result that - * reverted from the the Contract with the sepcified %%error%% - * (see [[getError]] for valid values for %%fragment%%) with the %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeErrorResult(fragment: ErrorFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the %%data%% from a transaction ``tx.data`` for - * the function specified (see [[getFunction]] for valid values - * for %%fragment%%). - * - * Most developers should prefer the [[parseTransaction]] method - * instead, which will automatically detect the fragment. - */ - decodeFunctionData(fragment: FunctionFragment | string, data: BytesLike): Result; - /** - * Encodes the ``tx.data`` for a transaction that calls the function - * specified (see [[getFunction]] for valid values for %%fragment%%) with - * the %%values%%. - */ - encodeFunctionData(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - /** - * Decodes the result %%data%% (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values for - * %%key%%). - * - * Most developers should prefer the [[parseCallResult]] method instead, - * which will automatically detect a ``CALL_EXCEPTION`` and throw the - * corresponding error. - */ - decodeFunctionResult(fragment: FunctionFragment | string, data: BytesLike): Result; - makeError(_data: BytesLike, tx: CallExceptionTransaction): CallExceptionError; - /** - * Encodes the result data (e.g. from an ``xcb_call``) for the - * specified function (see [[getFunction]] for valid values - * for %%fragment%%) with %%values%%. - * - * This is generally not used by most developers, unless trying to mock - * a result from a Contract. - */ - encodeFunctionResult(fragment: FunctionFragment | string, values?: ReadonlyArray): string; - encodeFilterTopics(fragment: EventFragment | string, values: ReadonlyArray): Array>; - encodeEventLog(fragment: EventFragment | string, values: ReadonlyArray): { - data: string; - topics: Array; - }; - decodeEventLog(fragment: EventFragment | string, data: BytesLike, topics?: ReadonlyArray): Result; - /** - * Parses a transaction, finding the matching function and extracts - * the parameter values along with other useful function details. - * - * If the matching function cannot be found, return null. - */ - parseTransaction(tx: { - data: string; - value?: BigNumberish; - }): null | TransactionDescription; - parseCallResult(data: BytesLike): Result; - /** - * Parses a receipt log, finding the matching event and extracts - * the parameter values along with other useful event details. - * - * If the matching event cannot be found, returns null. - */ - parseLog(log: { - topics: Array; - data: string; - }): null | LogDescription; - /** - * Parses a revert data, finding the matching error and extracts - * the parameter values along with other useful error details. - * - * If the matching event cannot be found, returns null. - */ - parseError(data: BytesLike): null | ErrorDescription; - /** - * Creates a new [[Interface]] from the ABI %%value%%. - * - * The %%value%% may be provided as an existing [[Interface]] object, - * a JSON-encoded ABI or any Human-Readable ABI format. - */ - static from(value: InterfaceAbi | Interface): Interface; -} -//# sourceMappingURL=interface.d.ts.map \ No newline at end of file diff --git a/types/abi/interface.d.ts.map b/types/abi/interface.d.ts.map deleted file mode 100644 index d7d096cce..000000000 --- a/types/abi/interface.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src.ts/abi/interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EACN,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,KAAK,EACX,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,wBAAwB,EACxB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC;AAErC,qBAAa,cAAc;IAC1B,QAAQ,CAAC,QAAQ,EAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAC5B,QAAQ,CAAC,KA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S,GAAG,IAAI,GAAG,gBAAgB,CAWnD;IAED;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAkBtD;CACD"} \ No newline at end of file diff --git a/types/abi/typed.d.ts b/types/abi/typed.d.ts deleted file mode 100644 index 3dce9d6a9..000000000 --- a/types/abi/typed.d.ts +++ /dev/null @@ -1,172 +0,0 @@ -/** - * A Typed object allows a value to have its type explicitly - * specified. - * - * For example, in Solidity, the value ``45`` could represent a - * ``uint8`` or a ``uint256``. The value ``0x1234`` could represent - * a ``bytes2`` or ``bytes``. - * - * Since JavaScript has no meaningful way to explicitly inform any - * APIs which what the type is, this allows transparent interoperation - * with Soldity. - * - * @_subsection: api/abi:Typed Values - */ -import type { Addressable } from "../address/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { Result } from "./coders/abstract-coder.js"; -export interface TypedNumber extends Typed { - value: number; - defaultValue(): number; - minValue(): number; - maxValue(): number; -} -export interface TypedBigInt extends Typed { - value: bigint; - defaultValue(): bigint; - minValue(): bigint; - maxValue(): bigint; -} -export interface TypedData extends Typed { - value: string; - defaultValue(): string; -} -export interface TypedString extends Typed { - value: string; - defaultValue(): string; -} -export declare class Typed { - #private; - readonly type: string; - readonly value: any; - readonly _typedSymbol: Symbol; - constructor(gaurd: any, type: string, value: any, options?: any); - format(): string; - defaultValue(): string | number | bigint | Result; - minValue(): string | number | bigint; - maxValue(): string | number | bigint; - isBigInt(): this is TypedBigInt; - isData(): this is TypedData; - isString(): this is TypedString; - get tupleName(): null | string; - get arrayLength(): null | number; - static from(type: string, value: any): Typed; - static uint8(v: BigNumberish): Typed; - static uint16(v: BigNumberish): Typed; - static uint24(v: BigNumberish): Typed; - static uint32(v: BigNumberish): Typed; - static uint40(v: BigNumberish): Typed; - static uint48(v: BigNumberish): Typed; - static uint56(v: BigNumberish): Typed; - static uint64(v: BigNumberish): Typed; - static uint72(v: BigNumberish): Typed; - static uint80(v: BigNumberish): Typed; - static uint88(v: BigNumberish): Typed; - static uint96(v: BigNumberish): Typed; - static uint104(v: BigNumberish): Typed; - static uint112(v: BigNumberish): Typed; - static uint120(v: BigNumberish): Typed; - static uint128(v: BigNumberish): Typed; - static uint136(v: BigNumberish): Typed; - static uint144(v: BigNumberish): Typed; - static uint152(v: BigNumberish): Typed; - static uint160(v: BigNumberish): Typed; - static uint168(v: BigNumberish): Typed; - static uint176(v: BigNumberish): Typed; - static uint184(v: BigNumberish): Typed; - static uint192(v: BigNumberish): Typed; - static uint200(v: BigNumberish): Typed; - static uint208(v: BigNumberish): Typed; - static uint216(v: BigNumberish): Typed; - static uint224(v: BigNumberish): Typed; - static uint232(v: BigNumberish): Typed; - static uint240(v: BigNumberish): Typed; - static uint248(v: BigNumberish): Typed; - static uint256(v: BigNumberish): Typed; - static uint(v: BigNumberish): Typed; - static int8(v: BigNumberish): Typed; - static int16(v: BigNumberish): Typed; - static int24(v: BigNumberish): Typed; - static int32(v: BigNumberish): Typed; - static int40(v: BigNumberish): Typed; - static int48(v: BigNumberish): Typed; - static int56(v: BigNumberish): Typed; - static int64(v: BigNumberish): Typed; - static int72(v: BigNumberish): Typed; - static int80(v: BigNumberish): Typed; - static int88(v: BigNumberish): Typed; - static int96(v: BigNumberish): Typed; - static int104(v: BigNumberish): Typed; - static int112(v: BigNumberish): Typed; - static int120(v: BigNumberish): Typed; - static int128(v: BigNumberish): Typed; - static int136(v: BigNumberish): Typed; - static int144(v: BigNumberish): Typed; - static int152(v: BigNumberish): Typed; - static int160(v: BigNumberish): Typed; - static int168(v: BigNumberish): Typed; - static int176(v: BigNumberish): Typed; - static int184(v: BigNumberish): Typed; - static int192(v: BigNumberish): Typed; - static int200(v: BigNumberish): Typed; - static int208(v: BigNumberish): Typed; - static int216(v: BigNumberish): Typed; - static int224(v: BigNumberish): Typed; - static int232(v: BigNumberish): Typed; - static int240(v: BigNumberish): Typed; - static int248(v: BigNumberish): Typed; - static int256(v: BigNumberish): Typed; - static int(v: BigNumberish): Typed; - static bytes1(v: BytesLike): Typed; - static bytes2(v: BytesLike): Typed; - static bytes3(v: BytesLike): Typed; - static bytes4(v: BytesLike): Typed; - static bytes5(v: BytesLike): Typed; - static bytes6(v: BytesLike): Typed; - static bytes7(v: BytesLike): Typed; - static bytes8(v: BytesLike): Typed; - static bytes9(v: BytesLike): Typed; - static bytes10(v: BytesLike): Typed; - static bytes11(v: BytesLike): Typed; - static bytes12(v: BytesLike): Typed; - static bytes13(v: BytesLike): Typed; - static bytes14(v: BytesLike): Typed; - static bytes15(v: BytesLike): Typed; - static bytes16(v: BytesLike): Typed; - static bytes17(v: BytesLike): Typed; - static bytes18(v: BytesLike): Typed; - static bytes19(v: BytesLike): Typed; - static bytes20(v: BytesLike): Typed; - static bytes21(v: BytesLike): Typed; - static bytes22(v: BytesLike): Typed; - static bytes23(v: BytesLike): Typed; - static bytes24(v: BytesLike): Typed; - static bytes25(v: BytesLike): Typed; - static bytes26(v: BytesLike): Typed; - static bytes27(v: BytesLike): Typed; - static bytes28(v: BytesLike): Typed; - static bytes29(v: BytesLike): Typed; - static bytes30(v: BytesLike): Typed; - static bytes31(v: BytesLike): Typed; - static bytes32(v: BytesLike): Typed; - static address(v: string | Addressable): Typed; - static bool(v: any): Typed; - static bytes(v: BytesLike): Typed; - static string(v: string): Typed; - static array(v: Array, dynamic?: null | boolean): Typed; - static tuple(v: Array | Record, name?: string): Typed; - static overrides(v: Record): Typed; - /** - * Returns true only if %%value%% is a [[Typed]] instance. - */ - static isTyped(value: any): value is Typed; - /** - * If the value is a [[Typed]] instance, validates the underlying value - * and returns it, otherwise returns value directly. - * - * This is useful for functions that with to accept either a [[Typed]] - * object or values. - */ - static dereference(value: Typed | T, type: string): T; -} -//# sourceMappingURL=typed.d.ts.map \ No newline at end of file diff --git a/types/abi/typed.d.ts.map b/types/abi/typed.d.ts.map deleted file mode 100644 index 80e5667ff..000000000 --- a/types/abi/typed.d.ts.map +++ /dev/null @@ -1 +0,0 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CAGP;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,KAAK,CAE9C;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAEzC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAQvD;CACD"} \ No newline at end of file diff --git a/types/address/checks.d.ts b/types/address/checks.d.ts deleted file mode 100644 index 865b0aca9..000000000 --- a/types/address/checks.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { Addressable, AddressLike } from "./index.js"; -/** - * Returns true if %%value%% is an object which implements the - * [[Addressable]] interface. - * - * @example: - * // Wallets and AbstractSigner sub-classes - * isAddressable(Wallet.createRandom()) - * //_result: - * - * // Contracts - * contract = new Contract("dai.tokens.corebc.eth", [ ], provider) - * isAddressable(contract) - * //_result: - */ -export declare function isAddressable(value: any): value is Addressable; -/** - * Returns true if %%value%% is a valid address. - * - * @example: - * // Valid address - * isAddress("0x8ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Valid ICAP address - * isAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36") - * //_result: - * - * // Invalid checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBa72") - * //_result: - * - * // Invalid ICAP checksum - * isAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_result: - * - * // Not an address (an ENS name requires a provided and an - * // asynchronous API to access) - * isAddress("ricmoo.eth") - * //_result: - */ -export declare function isAddress(value: any): value is string; -/** - * Resolves to an address for the %%target%%, which may be any - * supported address type, an [[Addressable]] or a Promise which - * resolves to an address. - * - * If an ENS name is provided, but that name has not been correctly - * configured a [[UnconfiguredNameError]] is thrown. - * - * @example: - * addr = "0x6B175474E89094C44Da98b954EedeAC495271d0F" - * - * // Addresses are return synchronously - * resolveAddress(addr, provider) - * //_result: - * - * // Address promises are resolved asynchronously - * resolveAddress(Promise.resolve(addr)) - * //_result: - * - * - * // Addressable objects are resolved asynchronously - * contract = new Contract(addr, [ ]) - * resolveAddress(contract, provider) - * //_result: - * - * // Unconfigured ENS names reject - * resolveAddress("nothing-here.ricmoo.eth", provider) - * //_error: - * - * // ENS names require a NameResolver object passed in - * // (notice the provider was omitted) - * resolveAddress("nothing-here.ricmoo.eth") - * //_error: - */ -export declare function resolveAddress(target: AddressLike): string | Promise; -//# sourceMappingURL=checks.d.ts.map \ No newline at end of file diff --git a/types/address/checks.d.ts.map b/types/address/checks.d.ts.map deleted file mode 100644 index 936fbc09c..000000000 --- a/types/address/checks.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checks.d.ts","sourceRoot":"","sources":["../../src.ts/address/checks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAc,MAAM,YAAY,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAMrD;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAe5E"} \ No newline at end of file diff --git a/types/address/contract-address.d.ts b/types/address/contract-address.d.ts deleted file mode 100644 index 5aaa076ad..000000000 --- a/types/address/contract-address.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * Returns the address that would result from a ``CREATE`` for %%tx%%. - * - * This can be used to compute the address a contract will be - * deployed to by an EOA when sending a deployment transaction (i.e. - * when the ``to`` address is ``null``). - * - * This can also be used to compute the address a contract will be - * deployed to by a contract, by using the contract's address as the - * ``to`` and the contract's nonce. - * - * @example - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72"; - * nonce = 5; - * - * getCreateAddress({ from, nonce }); - * //_result: - */ -export declare function getCreateAddress(tx: { - from: string; - nonce: BigNumberish; -}): string; -/** - * Returns the address that would result from a ``CREATE2`` operation - * with the given %%from%%, %%salt%% and %%initCodeHash%%. - - * For a quick overview and example of ``CREATE2``, see [[link-ricmoo-wisps]]. - * - * @example - * // The address of the contract - * from = "0x8ba1f109551bD432803012645Ac136ddd64DBA72" - * - * // The salt - * salt = id("HelloWorld") - * - * getCreate2Address(from, salt, initCodeHash) - * //_result: - */ -export declare function getCreate2Address(from: string, salt: BytesLike, initCodeHash: BytesLike): string; -//# sourceMappingURL=contract-address.d.ts.map \ No newline at end of file diff --git a/types/address/contract-address.d.ts.map b/types/address/contract-address.d.ts.map deleted file mode 100644 index c9b527dd2..000000000 --- a/types/address/contract-address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract-address.d.ts","sourceRoot":"","sources":["../../src.ts/address/contract-address.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAQjE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,GAAG,MAAM,CAcT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,SAAS,EACf,YAAY,EAAE,SAAS,GACrB,MAAM,CAoBR"} \ No newline at end of file diff --git a/types/address/index.d.ts b/types/address/index.d.ts deleted file mode 100644 index 180d9faa2..000000000 --- a/types/address/index.d.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Addresses are a fundamental part of interacting with Core. They - * represent the gloabal identity of Externally Owned Accounts (accounts - * backed by a private key) and contracts. - * - * The Core Naming Service (CNS) provides an interconnected ecosystem - * of contracts, standards and libraries which enable looking up an - * address for an ENS name. - * - * These functions help convert between various formats, validate - * addresses and safely resolve ENS names. - * - * @_section: api/address:Addresses [about-addresses] - */ -/** - * An interface for objects which have an address, and can - * resolve it asyncronously. - * - * This allows objects such as [[Signer]] or [[Contract]] to - * be used most places an address can be, for example getting - * the [balance](Provider-getBalance). - */ -export interface Addressable { - /** - * Get the object address. - */ - getAddress(): Promise; -} -/** - * Anything that can be used to return or resolve an address. - */ -export type AddressLike = string | Promise | Addressable; -/** - * An interface for any object which can resolve an ENS name. - */ -export interface NameResolver { -} -import { BigNumberish } from "../bigNumber/bigNumber.js"; -declare function calculateCheckSum(_address: string, _prefix: string): string; -/** - * Returns a normalized and checksumed address for %%address%%. - * This accepts non-checksum addresses, checksum addresses and - * [[getIcapAddress]] formats. - * - * The checksum in Core uses the capitalization (upper-case - * vs lower-case) of the characters within an address to encode - * its checksum, which offers, on average, a checksum of 15-bits. - * - * If %%address%% contains both upper-case and lower-case, it is - * assumed to already be a checksum address and its checksum is - * validated, and if the address fails its expected checksum an - * error is thrown. - * - * If you wish the checksum of %%address%% to be ignore, it should - * be converted to lower-case (i.e. ``.toLowercase()``) before - * being passed in. This should be a very rare situation though, - * that you wish to bypass the safegaurds in place to protect - * against an address that has been incorrectly copied from another - * source. - * - * @example: - * // Adds the checksum (via upper-casing specific letters) - * getAddress("0x8ba1f109551bd432803012645ac136ddd64dba72") - * //_result: - * - * // Converts ICAP address and adds checksum - * getAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if an address contains mixed case, - * // but the checksum fails - * getAddress("0x8Ba1f109551bD432803012645Ac136ddd64DBA72") - * //_error: - */ -declare function getAddress(address: string): string; -/** - * The [ICAP Address format](link-icap) format is an early checksum - * format which attempts to be compatible with the banking - * industry [IBAN format](link-wiki-iban) for bank accounts. - * - * It is no longer common or a recommended format. - * - * @example: - * getIcapAddress("0x8ba1f109551bd432803012645ac136ddd64dba72"); - * //_result: - * - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK36"); - * //_result: - * - * // Throws an error if the ICAP checksum is wrong - * getIcapAddress("XE65GB6LDNXYOFTX0NSV3FUWKOWIXAMJK37"); - * //_error: - */ -declare function getIcapAddress(address: string): string; -declare function networkIdToPrefix(networkId: number): string; -declare function getContractAddress(transaction: { - from: string; - nonce: BigNumberish; -}): string; -export { getAddress, getIcapAddress, calculateCheckSum, networkIdToPrefix, getContractAddress, }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/address/index.d.ts.map b/types/address/index.d.ts.map deleted file mode 100644 index 86a6e44f8..000000000 --- a/types/address/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/address/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;CAQ5B;AAED,OAAO,EAAa,YAAY,EAAE,MAAM,2BAA2B,CAAC;AA8BpE,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBpE;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,iBAAS,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAoB3C;AACD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED,iBAAS,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAWpD;AAED,iBAAS,kBAAkB,CAAC,WAAW,EAAE;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;CACpB,UAmBA;AAED,OAAO,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,GAClB,CAAC"} \ No newline at end of file diff --git a/types/bigNumber/bigNumber.d.ts b/types/bigNumber/bigNumber.d.ts deleted file mode 100644 index 089132488..000000000 --- a/types/bigNumber/bigNumber.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Bytes, Hexable } from "../utils/data.js"; -export type BigNumberish = BigNumber | Bytes | bigint | string | number; -export declare function isBigNumberish(value: any): value is BigNumberish; -export declare class BigNumber implements Hexable { - readonly _hex: string; - readonly _isBigNumber: boolean; - constructor(constructorGuard: any, hex: string); - fromTwos(value: number): BigNumber; - toTwos(value: number): BigNumber; - abs(): BigNumber; - add(other: BigNumberish): BigNumber; - sub(other: BigNumberish): BigNumber; - div(other: BigNumberish): BigNumber; - mul(other: BigNumberish): BigNumber; - mod(other: BigNumberish): BigNumber; - pow(other: BigNumberish): BigNumber; - and(other: BigNumberish): BigNumber; - or(other: BigNumberish): BigNumber; - xor(other: BigNumberish): BigNumber; - mask(value: number): BigNumber; - shl(value: number): BigNumber; - shr(value: number): BigNumber; - eq(other: BigNumberish): boolean; - lt(other: BigNumberish): boolean; - lte(other: BigNumberish): boolean; - gt(other: BigNumberish): boolean; - gte(other: BigNumberish): boolean; - isNegative(): boolean; - isZero(): boolean; - toNumber(): number; - toBigInt(): bigint; - toString(): string; - toHexString(): string; - toJSON(key?: string): any; - static from(value: any): BigNumber; - static isBigNumber(value: any): value is BigNumber; -} -export declare function _base36To16(value: string): string; -export declare function _base16To36(value: string): string; -//# sourceMappingURL=bigNumber.d.ts.map \ No newline at end of file diff --git a/types/bigNumber/bigNumber.d.ts.map b/types/bigNumber/bigNumber.d.ts.map deleted file mode 100644 index 5dcf4c8f7..000000000 --- a/types/bigNumber/bigNumber.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bigNumber.d.ts","sourceRoot":"","sources":["../../src.ts/bigNumber/bigNumber.ts"],"names":[],"mappings":"AAYA,OAAO,EACN,KAAK,EACL,OAAO,EAIP,MAAM,kBAAkB,CAAC;AAS1B,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAExE,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,YAAY,CAUhE;AAKD,qBAAa,SAAU,YAAW,OAAO;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAE/B,YAAY,gBAAgB,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAiB7C;IAED,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAEjC;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAE/B;IAED,GAAG,IAAI,SAAS,CAKf;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAElC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAElC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAElC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMjC;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAMlC;IAED,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAK7B;IAED,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAK5B;IAED,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAK5B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,EAAE,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAE/B;IAED,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAEhC;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,MAAM,IAAI,OAAO,CAEhB;IAED,QAAQ,IAAI,MAAM,CAQjB;IAED,QAAQ,IAAI,MAAM,CAYjB;IAED,QAAQ,IAAI,MAAM,CAyBjB;IAED,WAAW,IAAI,MAAM,CAEpB;IAED,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAExB;IAED,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAuEjC;IAED,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAEjD;CACD;AA6ED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAGD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"} \ No newline at end of file diff --git a/types/cip/custom-units.d.ts b/types/cip/custom-units.d.ts deleted file mode 100644 index 58031982f..000000000 --- a/types/cip/custom-units.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { AddressLike } from "../address/index.js"; -import { Contract } from "../contract/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -export declare const customUnitAbi: readonly string[]; -export declare class CustomUnitDiscovery { - readonly preferredUnit: string; - readonly supportedUnits: readonly string[]; - constructor(units: readonly string[], preferredUnit: string); - get isValid(): boolean; - supports(unit: string): boolean; -} -/** Exact balances and multiplier ratio. A zero denominator has no multiplier. */ -export declare class CustomUnitBalance { - readonly canonicalAmount: bigint; - readonly unitAmount: bigint; - readonly unit: string; - constructor(canonicalAmount: bigint, unitAmount: bigint, unit: string); - get multiplierNumerator(): bigint; - get multiplierDenominator(): bigint; -} -/** Core custom-unit contract convention used by Tone and Core API. */ -export declare class CustomUnitToken { - readonly contract: Contract; - constructor(address: string, runner: ContractRunner); - supportsUnit(unit: string, blockTag?: BlockTag): Promise; - supportedUnits(blockTag?: BlockTag): Promise; - preferredUnit(blockTag?: BlockTag): Promise; - discover(blockTag?: BlockTag): Promise; - canonicalBalance(account: AddressLike, blockTag?: BlockTag): Promise; - balanceOfUnit(account: AddressLike, unit: string, blockTag?: BlockTag): Promise; - balance(account: AddressLike, unit?: string, blockTag?: BlockTag): Promise; -} -//# sourceMappingURL=custom-units.d.ts.map \ No newline at end of file diff --git a/types/cip/custom-units.d.ts.map b/types/cip/custom-units.d.ts.map deleted file mode 100644 index 69faaea75..000000000 --- a/types/cip/custom-units.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"custom-units.d.ts","sourceRoot":"","sources":["../../src.ts/cip/custom-units.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEtE,eAAO,MAAM,aAAa,mBAMxB,CAAC;AACH,qBAAa,mBAAmB;IAI9B,QAAQ,CAAC,aAAa,EAAE,MAAM;IAH/B,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,YACC,KAAK,EAAE,SA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AE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAO5B;CACD"} \ No newline at end of file diff --git a/types/cip/index.d.ts b/types/cip/index.d.ts deleted file mode 100644 index cdd86e31b..000000000 --- a/types/cip/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { Contract } from "../contract/index.js"; -import type { Overrides, ContractTransactionResponse } from "../contract/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -import { IpfsGateway } from "../ipfs/index.js"; -/** On-chain interface defined by CIP-150. */ -export declare const cip150Abi: readonly string[]; -export interface Cip150MetadataEntry { - readonly key: string; - readonly value: string; - readonly sealed?: boolean; -} -export declare const cip151TokenExpirationKey = "tokenExpiration"; -export declare const cip151TradingStopKey = "tradingStop"; -export declare const cip152LabKey = "lab"; -/** Lifecycle timestamps in exact Unix seconds; absent values impose no limit. */ -export declare class Cip151Lifecycle { - readonly tokenExpiration: bigint | null; - readonly tradingStop: bigint | null; - constructor(metadata?: Readonly>); - isExpiredAt(seconds: bigint): boolean; - isTradingStoppedAt(seconds: bigint): boolean; -} -export interface Cip152LabMeasurement { - readonly value: string | number; - readonly unit?: string; -} -/** Validates certificate structure, not the authenticity of its issuer. */ -export declare class Cip152LabCertificate { - readonly measurements: Readonly>; - constructor(json: unknown); -} -/** Typed metadata reader and writer. Writes require a signer as runner. */ -export declare class Cip150MetadataContract { - readonly contract: Contract; - constructor(address: string, runner: ContractRunner); - getValue(key: string, blockTag?: BlockTag): Promise; - hasKey(key: string, blockTag?: BlockTag): Promise; - isSealed(key: string, blockTag?: BlockTag): Promise; - listKeys(blockTag?: BlockTag): Promise; - getByIndex(index: bigint, blockTag?: BlockTag): Promise; - count(blockTag?: BlockTag): Promise; - readAll(blockTag?: BlockTag, includeSealedState?: boolean): Promise; - setValue(key: string, value: string, overrides?: Overrides): Promise; - sealKey(key: string, overrides?: Overrides): Promise; - readLifecycle(blockTag?: BlockTag): Promise; - readLabCertificate(gateway: IpfsGateway, blockTag?: BlockTag): Promise; -} -export { CustomUnitToken, CustomUnitBalance, CustomUnitDiscovery, customUnitAbi, } from "./custom-units.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/cip/index.d.ts.map b/types/cip/index.d.ts.map deleted file mode 100644 index d0120ee3c..000000000 --- a/types/cip/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/cip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,EACX,SAAS,EACT,2BAA2B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,6CAA6C;AAC7C,eAAO,MAAM,SAAS,mBASpB,CAAC;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC1B;AACD,eAAO,MAAM,wBAAwB,oBAAoB,CAAC;AAC1D,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAClD,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,iFAAiF;AACjF,qBAAa,eAAe;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,YAAY,QAAQ,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,EAU1D;IACD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEpC;IACD,kBAAk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AAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,SAAc,GACvB,OAAO,CAAC,2BAA2B,CAAC,CAEtC;IACD,OAAO,CACN,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,SAAc,GACvB,OAAO,CAAC,2BAA2B,CAAC,CAEtC;IACK,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CAOjE;IACK,kBAAkB,CACvB,OAAO,EAAE,WAAW,EACpB,QAAQ,CAAC,EAAE,QAAQ,GACjB,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAMtC;CACD;AACD,OAAO,EACN,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,GACb,MAAM,mBAAmB,CAAC"} \ No newline at end of file diff --git a/types/constants/addresses.d.ts b/types/constants/addresses.d.ts deleted file mode 100644 index a32d6be03..000000000 --- a/types/constants/addresses.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero address. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000"``) - */ -export declare const ZeroAddress: string; -//# sourceMappingURL=addresses.d.ts.map \ No newline at end of file diff --git a/types/constants/addresses.d.ts.map b/types/constants/addresses.d.ts.map deleted file mode 100644 index a67118b65..000000000 --- a/types/constants/addresses.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../src.ts/constants/addresses.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAqD,CAAC"} \ No newline at end of file diff --git a/types/constants/hashes.d.ts b/types/constants/hashes.d.ts deleted file mode 100644 index 784df7156..000000000 --- a/types/constants/hashes.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A constant for the zero hash. - * - * (**i.e.** ``"0x0000000000000000000000000000000000000000000000000000000000000000"``) - */ -export declare const ZeroHash: string; -//# sourceMappingURL=hashes.d.ts.map \ No newline at end of file diff --git a/types/constants/hashes.d.ts.map b/types/constants/hashes.d.ts.map deleted file mode 100644 index 225420a8c..000000000 --- a/types/constants/hashes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hashes.d.ts","sourceRoot":"","sources":["../../src.ts/constants/hashes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,MAC8C,CAAC"} \ No newline at end of file diff --git a/types/constants/index.d.ts b/types/constants/index.d.ts deleted file mode 100644 index ba9ae1821..000000000 --- a/types/constants/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Some common constants useful for Core. - * - * @_section: api/constants: Constants [about-constants] - */ -export { ZeroAddress } from "./addresses.js"; -export { ZeroHash } from "./hashes.js"; -export { N, NegativeOne, Zero, One, Two, OrePerXCB, MaxUint256, MinInt256, MaxInt256, } from "./numbers.js"; -export { CoreSymbol, MessagePrefix } from "./strings.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/constants/index.d.ts.map b/types/constants/index.d.ts.map deleted file mode 100644 index d703c7245..000000000 --- a/types/constants/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACN,CAAC,EACD,WAAW,EACX,IAAI,EACJ,GAAG,EACH,GAAG,EACH,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,GACT,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/types/constants/numbers.d.ts b/types/constants/numbers.d.ts deleted file mode 100644 index ac92f9623..000000000 --- a/types/constants/numbers.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * A constant for the order N for the secp256k1 curve. - * - * (**i.e.** ``0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n``) - */ -export declare const N: bigint; -/** - * A constant for the number of ore in a single xcb. - * - * (**i.e.** ``1000000000000000000n``) - */ -export declare const OrePerXCB: bigint; -/** - * A constant for the maximum value for a ``uint256``. - * - * (**i.e.** ``0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxUint256: bigint; -/** - * A constant for the minimum value for an ``int256``. - * - * (**i.e.** ``-8000000000000000000000000000000000000000000000000000000000000000n``) - */ -export declare const MinInt256: bigint; -/** - * A constant for the maximum value for an ``int256``. - * - * (**i.e.** ``0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffn``) - */ -export declare const MaxInt256: bigint; -export declare const NegativeOne: bigint; -export declare const Zero: bigint; -export declare const One: bigint; -export declare const Two: bigint; -//# sourceMappingURL=numbers.d.ts.map \ No newline at end of file diff --git a/types/constants/numbers.d.ts.map b/types/constants/numbers.d.ts.map deleted file mode 100644 index 927678af4..000000000 --- a/types/constants/numbers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src.ts/constants/numbers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,CAAC,EAAE,MAEf,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAsC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAExB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEb,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAEvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAiC,CAAC;AAC5D,eAAO,MAAM,IAAI,EAAE,MAAgC,CAAC;AACpD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC;AACnD,eAAO,MAAM,GAAG,EAAE,MAAgC,CAAC"} \ No newline at end of file diff --git a/types/constants/strings.d.ts b/types/constants/strings.d.ts deleted file mode 100644 index 164253121..000000000 --- a/types/constants/strings.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A constant for the core symbol (normalized using NFKC). - * - * (**i.e.** ``"\\u039e"``) - */ -export declare const CoreSymbol: string; -/** - * A constant for the [[link-eip-191]] personal message prefix. - * - * (**i.e.** ``"\\x19Core Signed Message:\\n"``) - */ -export declare const MessagePrefix: string; -//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/types/constants/strings.d.ts.map b/types/constants/strings.d.ts.map deleted file mode 100644 index 788cc8ce6..000000000 --- a/types/constants/strings.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src.ts/constants/strings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,MAAiB,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,MAAqC,CAAC"} \ No newline at end of file diff --git a/types/contract/contract.d.ts b/types/contract/contract.d.ts deleted file mode 100644 index 637e513de..000000000 --- a/types/contract/contract.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { Indexed, Interface } from "../abi/index.js"; -import { Log, TransactionResponse } from "../providers/provider.js"; -import { ContractTransactionResponse, EventLog } from "./wrappers.js"; -import type { EventFragment, FunctionFragment, InterfaceAbi, ParamType } from "../abi/index.js"; -import type { Addressable } from "../address/index.js"; -import type { EventEmitterable, Listener } from "../utils/index.js"; -import type { BlockTag, ContractRunner } from "../providers/index.js"; -import type { ContractEventName, ContractInterface, ContractMethod, ContractEvent, ContractTransaction, WrappedFallback } from "./types.js"; -/** - * @_ignore: - */ -export declare function copyOverrides(arg: any, allowed?: Array): Promise>; -/** - * @_ignore: - */ -export declare function resolveArgs(_runner: null | ContractRunner, inputs: ReadonlyArray, args: Array): Promise>; -declare const internal: unique symbol; -export declare class BaseContract implements Addressable, EventEmitterable { - readonly target: string | Addressable; - readonly interface: Interface; - readonly runner: null | ContractRunner; - readonly filters: Record; - readonly [internal]: any; - readonly fallback: null | WrappedFallback; - constructor(target: string | Addressable, abi: Interface | InterfaceAbi, runner?: null | ContractRunner, _deployTx?: null | TransactionResponse); - connect(runner: null | ContractRunner): BaseContract; - getAddress(): Promise; - getDeployedCode(): Promise; - waitForDeployment(): Promise; - deploymentTransaction(): null | ContractTransactionResponse; - getFunction(key: string | FunctionFragment): T; - getEvent(key: string | EventFragment): ContractEvent; - queryTransaction(hash: string): Promise>; - queryFilter(event: ContractEventName, fromBlock?: BlockTag, toBlock?: BlockTag): Promise>; - on(event: ContractEventName, listener: Listener): Promise; - once(event: ContractEventName, listener: Listener): Promise; - emit(event: ContractEventName, ...args: Array): Promise; - listenerCount(event?: ContractEventName): Promise; - listeners(event?: ContractEventName): Promise>; - off(event: ContractEventName, listener?: Listener): Promise; - removeAllListeners(event?: ContractEventName): Promise; - addListener(event: ContractEventName, listener: Listener): Promise; - removeListener(event: ContractEventName, listener: Listener): Promise; - static buildClass(abi: InterfaceAbi): new (target: string, runner?: null | ContractRunner) => BaseContract & Omit; - static from(target: string, abi: InterfaceAbi, runner?: null | ContractRunner): BaseContract & Omit; - static isIndexed(value: any): value is Indexed; -} -declare const Contract_base: new (target: string, abi: InterfaceAbi, runner?: null | ContractRunner) => BaseContract & Omit; -export declare class Contract extends Contract_base { -} -export {}; -//# sourceMappingURL=contract.d.ts.map \ No newline at end of file diff --git a/types/contract/contract.d.ts.map b/types/contract/contract.d.ts.map deleted file mode 100644 index 93e959992..000000000 --- a/types/contract/contract.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src.ts/contract/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAS,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EA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,CAE7C;CACD;0CAGQ,MAAM,OACT,YAAY,WACR,IAAI,GAAG,cAAc,KAC1B,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/D,qBAAa,QAAS,SAAQ,aAAe;CAAG"} \ No newline at end of file diff --git a/types/contract/factory.d.ts b/types/contract/factory.d.ts deleted file mode 100644 index f58d98552..000000000 --- a/types/contract/factory.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Interface } from "../abi/index.js"; -import { BaseContract } from "./contract.js"; -import type { InterfaceAbi } from "../abi/index.js"; -import type { ContractRunner } from "../providers/index.js"; -import type { BytesLike } from "../utils/index.js"; -import type { ContractInterface, ContractMethodArgs, ContractDeployTransaction } from "./types.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -export declare class ContractFactory = Array, I = BaseContract> { - readonly interface: Interface; - readonly bytecode: string; - readonly runner: null | ContractRunner; - constructor(abi: Interface | InterfaceAbi, bytecode: BytesLike | { - object: string; - }, runner?: null | ContractRunner); - getDeployTransaction(...args: ContractMethodArgs): Promise; - deploy(...args: ContractMethodArgs): Promise>; - connect(runner: null | ContractRunner): ContractFactory; - static fromSolidity = Array, I = ContractInterface>(output: any, runner?: ContractRunner): ContractFactory; -} -//# sourceMappingURL=factory.d.ts.map \ No newline at end of file diff --git a/types/contract/factory.d.ts.map b/types/contract/factory.d.ts.map deleted file mode 100644 index e49bf553e..000000000 --- a/types/contract/factory.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src.ts/contract/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,OAAO,EAAE,YAAY,EAA8B,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KA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;CACD"} \ No newline at end of file diff --git a/types/contract/index.d.ts b/types/contract/index.d.ts deleted file mode 100644 index 8be93dacb..000000000 --- a/types/contract/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * About contracts... - * - * @_section: api/contract:Contracts [about-contracts] - */ -export { BaseContract, Contract } from "./contract.js"; -export { ContractFactory } from "./factory.js"; -export { ContractEventPayload, ContractUnknownEventPayload, ContractTransactionReceipt, ContractTransactionResponse, EventLog, } from "./wrappers.js"; -export type { BaseContractMethod, ConstantContractMethod, PostfixOverrides, ContractEvent, ContractEventArgs, ContractEventName, ContractDeployTransaction, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, WrappedFallback, } from "./types.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/contract/index.d.ts.map b/types/contract/index.d.ts.map deleted file mode 100644 index a5098a449..000000000 --- a/types/contract/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/contract/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EACN,oBAAoB,EACpB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,QAAQ,GACR,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,GACf,MAAM,YAAY,CAAC"} \ No newline at end of file diff --git a/types/contract/types.d.ts b/types/contract/types.d.ts deleted file mode 100644 index cf836c128..000000000 --- a/types/contract/types.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { EventFragment, FunctionFragment, Result, Typed } from "../abi/index.js"; -import type { TransactionRequest, PreparedTransactionRequest, TopicFilter } from "../providers/index.js"; -import type { ContractTransactionResponse } from "./wrappers.js"; -export type ContractEventName = string | ContractEvent | TopicFilter | DeferredTopicFilter; -export interface ContractInterface { - [name: string]: BaseContractMethod; -} -export interface DeferredTopicFilter { - getTopicFilter(): Promise; - fragment: EventFragment; -} -export interface ContractTransaction extends PreparedTransactionRequest { - to: string; - data: string; - from?: string; -} -export interface ContractDeployTransaction extends Omit { -} -export interface Overrides extends Omit { -} -export type PostfixOverrides> = A | [...A, Overrides]; -export type ContractMethodArgs> = PostfixOverrides<{ - [I in keyof A]-?: A[I] | Typed; -}>; -export interface BaseContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { - (...args: ContractMethodArgs): Promise; - name: string; - fragment: FunctionFragment; - getFragment(...args: ContractMethodArgs): FunctionFragment; - populateTransaction(...args: ContractMethodArgs): Promise; - staticCall(...args: ContractMethodArgs): Promise; - send(...args: ContractMethodArgs): Promise; - estimateEnergy(...args: ContractMethodArgs): Promise; - staticCallResult(...args: ContractMethodArgs): Promise; -} -export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> extends BaseContractMethod { -} -export interface ConstantContractMethod, R = any> extends ContractMethod { -} -export type ContractEventArgs> = { - [I in keyof A]?: A[I] | Typed | null; -}; -export interface ContractEvent = Array> { - (...args: ContractEventArgs): DeferredTopicFilter; - name: string; - fragment: EventFragment; - getFragment(...args: ContractEventArgs): EventFragment; -} -export interface WrappedFallback { - (overrides?: Omit): Promise; - populateTransaction(overrides?: Omit): Promise; - staticCall(overrides?: Omit): Promise; - send(overrides?: Omit): Promise; - estimateEnergy(overrides?: Omit): Promise; -} -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/types/contract/types.d.ts.map b/types/contract/types.d.ts.map deleted file mode 100644 index d356fb5ec..000000000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AC,CAAC;CAC5E"} \ No newline at end of file diff --git a/types/contract/wrappers.d.ts b/types/contract/wrappers.d.ts deleted file mode 100644 index 184e06900..000000000 --- a/types/contract/wrappers.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Block, Log, TransactionReceipt, TransactionResponse } from "../providers/provider.js"; -import { EventPayload } from "../utils/index.js"; -import type { EventFragment, Interface, Result } from "../abi/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Provider } from "../providers/index.js"; -import type { BaseContract } from "./contract.js"; -import type { ContractEventName } from "./types.js"; -export declare class EventLog extends Log { - readonly interface: Interface; - readonly fragment: EventFragment; - readonly args: Result; - constructor(log: Log, iface: Interface, fragment: EventFragment); - get eventName(): string; - get eventSignature(): string; -} -export declare class ContractTransactionReceipt extends TransactionReceipt { - #private; - constructor(iface: Interface, provider: Provider, tx: TransactionReceipt); - get logs(): Array; -} -export declare class ContractTransactionResponse extends TransactionResponse { - #private; - constructor(iface: Interface, provider: Provider, tx: TransactionResponse); - wait(confirms?: number): Promise; -} -export declare class ContractUnknownEventPayload extends EventPayload { - readonly log: Log; - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, log: Log); - getBlock(): Promise; - getTransaction(): Promise; - getTransactionReceipt(): Promise; -} -export declare class ContractEventPayload extends ContractUnknownEventPayload { - readonly fragment: EventFragment; - readonly log: EventLog; - readonly args: Result; - constructor(contract: BaseContract, listener: null | Listener, filter: ContractEventName, fragment: EventFragment, _log: Log); - get eventName(): string; - get eventSignature(): string; -} -//# sourceMappingURL=wrappers.d.ts.map \ No newline at end of file diff --git a/types/contract/wrappers.d.ts.map b/types/contract/wrappers.d.ts.map deleted file mode 100644 index 4538896c6..000000000 --- a/types/contract/wrappers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../src.ts/contract/wrappers.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,EACL,GAAG,EACH,kBAAkB,EAClB,mBA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,EAAG,GAAG,CAAC;IAEnB,YACC,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,iBAAiB,EACzB,GAAG,EAAE,GAAG,EAIR;IAEK,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,CAE/B;IAEK,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAEnD;IAEK,qBAAqB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAEzD;CACD;AAED,qBAAa,oBAAqB,SAAQ,2BAA2B;IACpE,SAAiB,QAAQ,EAAE,aAAa,CAAC;IACzC,SAAiB,GAAG,EAAE,QAAQ,CAAC;IAC/B,SAAiB,IAAI,EAAE,MAAM,CAAC;IAE9B,YACC,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,GAAG,EAcT;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;CACD"} \ No newline at end of file diff --git a/types/corebc.d.ts b/types/corebc.d.ts deleted file mode 100644 index 1dede3269..000000000 --- a/types/corebc.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export { version } from "./_version.js"; -export { publicToAddress } from "./transaction/address.js"; -export { decodeBytes32String, encodeBytes32String, AbiCoder, ConstructorFragment, ErrorFragment, EventFragment, Fragment, FallbackFragment, FunctionFragment, NamedFragment, ParamType, StructFragment, checkResultErrors, ErrorDescription, Indexed, Interface, LogDescription, Result, TransactionDescription, Typed, } from "./abi/index.js"; -export { getAddress, networkIdToPrefix } from "./address/index.js"; -export { getCreate2Address, getCreateAddress, } from "./address/contract-address.js"; -export { isAddressable, isAddress, resolveAddress } from "./address/checks.js"; -export { ZeroAddress, OrePerXCB, MaxUint256, MinInt256, MaxInt256, N, ZeroHash, CoreSymbol, MessagePrefix, } from "./constants/index.js"; -export { BaseContract, Contract, ContractFactory, ContractEventPayload, ContractTransactionReceipt, ContractTransactionResponse, ContractUnknownEventPayload, EventLog, } from "./contract/index.js"; -export { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, lock, Ed448Goldilock, Signature, SigningKey, keccak256, } from "./crypto/index.js"; -export { id, hashMessage, verifyMessage, solidityPacked, solidityPackedSha256, TypedDataEncoder, verifyTypedData, } from "./hash/index.js"; -export { getDefaultProvider, Block, FeeData, Log, TransactionReceipt, TransactionResponse, AbstractSigner, NonceManager, VoidSigner, AbstractProvider, FallbackProvider, JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, BrowserProvider, AlchemyProvider, AnkrProvider, CloudflareProvider, InfuraProvider, InfuraWebSocketProvider, PocketProvider, QuickNodeProvider, IpcSocketProvider, SocketProvider, WebSocketProvider, Network, FeeDataNetworkPlugin, EnergyCostPlugin, NetworkPlugin, SocketBlockSubscriber, SocketEventSubscriber, SocketPendingSubscriber, SocketSubscriber, UnmanagedSubscriber, copyRequest, showThrottleMessage, } from "./providers/index.js"; -export { accessListify, computeAddress, recoverAddress, Transaction, } from "./transaction/index.js"; -export { decodeBase58, encodeBase58, decodeBase64, encodeBase64, concat, dataLength, dataSlice, getBytes, getBytesCopy, hexlify, isHexString, isBytesLike, stripZerosLeft, zeroPadBytes, zeroPadValue, defineProperties, resolveProperties, assert, assertArgument, assertArgumentCount, assertNormalize, assertPrivate, makeError, isCallException, isError, EventPayload, FetchRequest, FetchResponse, FetchCancelSignal, FixedNumber, getBigInt, getNumber, getUint, toBeArray, toBigInt, toBeHex, toNumber, toQuantity, fromTwos, toTwos, mask, formatXCB, parseXCB, formatUnits, parseUnits, toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, decodeRlp, encodeRlp, uuidV4, arrayify, hexConcat, } from "./utils/index.js"; -export { Mnemonic, BaseWallet, HDNodeWallet, Wallet, defaultPath, getAccountPath, getIndexedAccountPath, isCrowdsaleJson, isKeystoreJson, decryptCrowdsaleJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./wallet/index.js"; -export { BigNumber } from "./bigNumber/bigNumber.js"; -export { Wordlist, LangEn, WordlistOwl, WordlistOwlA, wordlists, } from "./wordlists/index.js"; -export type { JsonFragment, JsonFragmentType, FormatType, FragmentType, InterfaceAbi, ParamTypeWalkFunc, ParamTypeWalkAsyncFunc, } from "./abi/index.js"; -export type { Addressable, AddressLike, NameResolver, } from "./address/index.js"; -export type { ConstantContractMethod, ContractEvent, ContractEventArgs, ContractEventName, ContractInterface, ContractMethod, ContractMethodArgs, ContractTransaction, DeferredTopicFilter, Overrides, BaseContractMethod, ContractDeployTransaction, PostfixOverrides, WrappedFallback, } from "./contract/index.js"; -export type { ProgressCallback, SignatureLike } from "./crypto/index.js"; -export type { TypedDataDomain, TypedDataField } from "./hash/index.js"; -export type { Provider, Signer, AbstractProviderPlugin, BlockParams, BlockTag, ContractRunner, DebugEventBrowserProvider, Eip1193Provider, EventFilter, Filter, FilterByBlockHash, EnergyCostParameters, JsonRpcApiProviderOptions, JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcTransactionRequest, LogParams, MinedBlock, MinedTransactionResponse, Networkish, OrphanFilter, PerformActionFilter, PerformActionRequest, PerformActionTransaction, PreparedTransactionRequest, ProviderEvent, Subscriber, Subscription, TopicFilter, TransactionReceiptParams, TransactionRequest, TransactionResponseParams, WebSocketCreator, WebSocketLike, } from "./providers/index.js"; -export type { AccessList, AccessListish, AccessListEntry, TransactionLike, } from "./transaction/index.js"; -export type { BytesLike, BigNumberish, Numeric, ErrorCode, FixedFormat, Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, RlpStructuredData, GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, CoreBCError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CodedCoreBCError, CallExceptionAction, CallExceptionTransaction, EventEmitterable, Listener, } from "./utils/index.js"; -export type { CrowdsaleAccount, KeystoreAccount, EncryptOptions, } from "./wallet/index.js"; -export * from "./cip/index.js"; -export * from "./ipfs/index.js"; -//# sourceMappingURL=corebc.d.ts.map \ No newline at end of file diff --git a/types/corebc.d.ts.map b/types/corebc.d.ts.map deleted file mode 100644 index c9c604763..000000000 --- a/types/corebc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"corebc.d.ts","sourceRoot":"","sources":["../src.ts/corebc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EACN,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,cAAc,EACd,MAAM,EACN,sBAAsB,EACtB,KAAK,GACL,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACN,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EACN,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,EACT,SAAS,EACT,CAAC,EACD,QAAQ,EACR,UAAU,E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ACnB,gBAAgB,EAChB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,QAAQ,GACR,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACX,gBAAgB,EAChB,eAAe,EACf,cAAc,GACd,MAAM,mBAAmB,CAAC;AAE3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/types/crypto/browser-ed448.d.ts b/types/crypto/browser-ed448.d.ts deleted file mode 100644 index 7b2b7d29a..000000000 --- a/types/crypto/browser-ed448.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Ed448Backend } from "./ed448-types.js"; -declare const ed448: Ed448Backend; -export default ed448; -//# sourceMappingURL=browser-ed448.d.ts.map \ No newline at end of file diff --git a/types/crypto/browser-ed448.d.ts.map b/types/crypto/browser-ed448.d.ts.map deleted file mode 100644 index 33a4fd898..000000000 --- a/types/crypto/browser-ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/types/crypto/browser-sha3.d.ts b/types/crypto/browser-sha3.d.ts deleted file mode 100644 index 3b83a4fbb..000000000 --- a/types/crypto/browser-sha3.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BytesLike } from "../utils/data.js"; -import { SupportedAlgorithm } from "./sha3.js"; -export declare function ripemd160(data: BytesLike): string; -export declare function sha256(data: BytesLike): string; -export declare function sha512(data: BytesLike): string; -export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string; -//# sourceMappingURL=browser-sha3.d.ts.map \ No newline at end of file diff --git a/types/crypto/browser-sha3.d.ts.map b/types/crypto/browser-sha3.d.ts.map deleted file mode 100644 index 61f4a3fba..000000000 --- a/types/crypto/browser-sha3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"browser-sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/browser-sha3.ts"],"names":[],"mappings":"AASA,OAAO,EAAY,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAI/C,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAI9C;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR"} \ No newline at end of file diff --git a/types/crypto/crypto-browser.d.ts b/types/crypto/crypto-browser.d.ts deleted file mode 100644 index c1f839009..000000000 --- a/types/crypto/crypto-browser.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import ed448 from "./browser-ed448.js"; -export { ed448 }; -export { Ed448Goldilock } from "./ed448goldilock-browser.js"; -declare global { - interface Window { - } - const window: Window; - const self: Window; -} -export interface CryptoHasher { - update(data: Uint8Array): CryptoHasher; - digest(): Uint8Array; -} -export declare function createHash(algo: string): CryptoHasher; -export declare function createHmac(_algo: string, key: Uint8Array): CryptoHasher; -export declare function pbkdf2Sync(password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, _algo: "sha256" | "sha512"): Uint8Array; -export declare function randomBytes(length: number): Uint8Array; -//# sourceMappingURL=crypto-browser.d.ts.map \ No newline at end of file diff --git a/types/crypto/crypto-browser.d.ts.map b/types/crypto/crypto-browser.d.ts.map deleted file mode 100644 index 96b1570a8..000000000 --- a/types/crypto/crypto-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto-browser.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,oBAAoB,CAAC;AAGvC,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;KAAG;IAEnB,MAAM,MAAM,EAAE,MAAM,CAAC;IAErB,MAAM,IAAI,EAAE,MAAM,CAAC;CACnB;AAmBD,MAAM,WAAW,YAAY;IAC5B,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CAAC;IACvC,MAAM,IAAI,UAAU,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAcrD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,YAAY,CAMvE;AAED,wBAAgB,UAAU,CACzB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,QAAQ,GAAG,QAAQ,GACxB,UAAU,CAIZ;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAoBtD"} \ No newline at end of file diff --git a/types/crypto/crypto.d.ts b/types/crypto/crypto.d.ts deleted file mode 100644 index 67011fd36..000000000 --- a/types/crypto/crypto.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -import ed448 from "./ed448.js"; -export { ed448 }; -export { Ed448Goldilock } from "./ed448goldilock.js"; -export { createHash, createHmac, pbkdf2Sync, randomBytes } from "crypto"; -//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/types/crypto/crypto.d.ts.map b/types/crypto/crypto.d.ts.map deleted file mode 100644 index 551ce5172..000000000 --- a/types/crypto/crypto.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/crypto.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC"} \ No newline at end of file diff --git a/types/crypto/ed448-types.d.ts b/types/crypto/ed448-types.d.ts deleted file mode 100644 index 705f54df5..000000000 --- a/types/crypto/ed448-types.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Buffer } from "buffer"; -/** Buffer-based bcrypto Ed448 operations used by Core signing. */ -export interface Ed448Backend { - privateKeyGenerate(): Buffer; - publicKeyCreate(key: Buffer): Buffer; - publicKeyFromScalar(scalar: Buffer): Buffer; - publicKeyVerify(key: Buffer): boolean; - publicKeyCombine(keys: Buffer[]): Buffer; - sign(message: Buffer, key: Buffer): Buffer; - signWithScalar(message: Buffer, scalar: Buffer, prefix: Buffer): Buffer; - verify(message: Buffer, signature: Buffer, publicKey: Buffer): boolean; - derive(publicKey: Buffer, key: Buffer): Buffer; - deriveWithScalar(publicKey: Buffer, scalar: Buffer): Buffer; -} -//# sourceMappingURL=ed448-types.d.ts.map \ No newline at end of file diff --git a/types/crypto/ed448-types.d.ts.map b/types/crypto/ed448-types.d.ts.map deleted file mode 100644 index 209f88584..000000000 --- a/types/crypto/ed448-types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448-types.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,kEAAkE;AAClE,MAAM,WAAW,YAAY;IAC5B,kBAAkB,IAAI,MAAM,CAAC;IAC7B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrC,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3C,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5D"} \ No newline at end of file diff --git a/types/crypto/ed448.d.ts b/types/crypto/ed448.d.ts deleted file mode 100644 index fd3e5a866..000000000 --- a/types/crypto/ed448.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Ed448Backend } from "./ed448-types.js"; -declare const ed448: Ed448Backend; -export default ed448; -//# sourceMappingURL=ed448.d.ts.map \ No newline at end of file diff --git a/types/crypto/ed448.d.ts.map b/types/crypto/ed448.d.ts.map deleted file mode 100644 index 7ea835437..000000000 --- a/types/crypto/ed448.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,QAAA,MAAM,KAAK,EAAE,YAAsB,CAAC;eACrB,KAAK"} \ No newline at end of file diff --git a/types/crypto/ed448goldilock-browser.d.ts b/types/crypto/ed448goldilock-browser.d.ts deleted file mode 100644 index 58df73a6f..000000000 --- a/types/crypto/ed448goldilock-browser.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Buffer } from "buffer"; -export declare class Ed448Goldilock { - static _channel: import("./ed448-types.js").Ed448Backend; - static generatePrivateKey(): Buffer; - static getPublicKeyFromPrivateKey(privateKey: string): string; - static signWithPrivateKey(privateKey: string, msg: string): string; - static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; - static verifySignature(msgHash: string, signedMsg: string, pubKey: string): boolean; - static SHA512Hash(password: string, salt: string): string; - static concatenateAndHex(prefix: number, key: string, index: number, salt: string): string; - static addScalar(a: string, b: string): string; - static seedToExtendedPrivate(seed: string): string; - static childPrivateToPrivate(s: string, index: number): string; - static HDWalletGenerateKeyFromSeed(seed: string, index: number): string; -} -//# sourceMappingURL=ed448goldilock-browser.d.ts.map \ No newline at end of file diff --git a/types/crypto/ed448goldilock-browser.d.ts.map b/types/crypto/ed448goldilock-browser.d.ts.map deleted file mode 100644 index 976a9855d..000000000 --- a/types/crypto/ed448goldilock-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock-browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/types/crypto/ed448goldilock.d.ts b/types/crypto/ed448goldilock.d.ts deleted file mode 100644 index 3dff60994..000000000 --- a/types/crypto/ed448goldilock.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Buffer } from "buffer"; -export declare class Ed448Goldilock { - static _channel: import("./ed448-types.js").Ed448Backend; - static generatePrivateKey(): Buffer; - static getPublicKeyFromPrivateKey(privateKey: string): string; - static signWithPrivateKey(privateKey: string, msg: string): string; - static signWithPrivateKeyNConcatPubkey(privateKey: string, msg: string): string; - static verifySignature(msgHash: string, signedMsg: string, pubKey: string): boolean; - static SHA512Hash(password: string, salt: string): string; - static concatenateAndHex(prefix: number, key: string, index: number, salt: string): string; - static addScalar(a: string, b: string): string; - static seedToExtendedPrivate(seed: string): string; - static childPrivateToPrivate(s: string, index: number): string; - static HDWalletGenerateKeyFromSeed(seed: string, index: number): string; -} -//# sourceMappingURL=ed448goldilock.d.ts.map \ No newline at end of file diff --git a/types/crypto/ed448goldilock.d.ts.map b/types/crypto/ed448goldilock.d.ts.map deleted file mode 100644 index 7cd4dfaca..000000000 --- a/types/crypto/ed448goldilock.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ed448goldilock.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ed448goldilock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQhC,qBAAa,cAAc;IAC1B,MAAM,CAAC,QAAQ,0CAAS;IAExB,MAAM,CAAC,kBAAkB,4BAIxB;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAY5D;IAED,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAmBjE;IAED,MAAM,CAAC,+BAA+B,CACrC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,GACT,MAAM,CAIR;IAED,MAAM,CAAC,eAAe,CACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,OAAO,CAMT;IAED,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD;IAED,MAAM,CAAC,iBAAiB,CACvB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GACV,MAAM,CAWR;IAED,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAY7C;IAED,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAejD;IAED,MAAM,CAAC,qBAAqB,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAcpD;IAED,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQtE;CACD"} \ No newline at end of file diff --git a/types/crypto/hmac.d.ts b/types/crypto/hmac.d.ts deleted file mode 100644 index 902055c49..000000000 --- a/types/crypto/hmac.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -declare const _computeHmac: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike; -/** - * Return the HMAC for %%data%% using the %%key%% key with the underlying - * %%algo%% used for compression. - * - * @example: - * key = id("some-secret") - * - * // Compute the HMAC - * computeHmac("sha256", key, "0x1337") - * //_result: - * - * // To compute the HMAC of UTF-8 data, the data must be - * // converted to UTF-8 bytes - * computeHmac("sha256", key, toUtf8Bytes("Hello World")) - * //_result: - * - */ -export declare function computeHmac(algorithm: "sha256" | "sha512", _key: BytesLike, _data: BytesLike): string; -export declare namespace computeHmac { - export { _computeHmac as _ }; - export var lock: () => void; - export var register: (func: (algorithm: "sha256" | "sha512", key: Uint8Array, data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=hmac.d.ts.map \ No newline at end of file diff --git a/types/crypto/hmac.d.ts.map b/types/crypto/hmac.d.ts.map deleted file mode 100644 index b5c8a51d9..000000000 --- a/types/crypto/hmac.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hmac.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/hmac.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,YAAY,cACN,QAAQ,GAAG,QAAQ,OACzB,UAAU,QACT,UAAU,KACd,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAC1B,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,SAAS,GACd,MAAM,CAIR;yBARe,WAAW;aASX,YAAY;;gCAKrB,CACL,SAAS,EAAE,QAAQ,GAAG,QAAQ,EAC9B,GAAG,EAAE,UAAU,EACf,IAAI,EAAE,UAAU,KACZ,SAAS"} \ No newline at end of file diff --git a/types/crypto/index.d.ts b/types/crypto/index.d.ts deleted file mode 100644 index 0730e25c8..000000000 --- a/types/crypto/index.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A fundamental building block of Core is the underlying - * cryptographic primitives. - * - * @_section: api/crypto:Cryptographic Functions [about-crypto] - */ -import { computeHmac } from "./hmac.js"; -import { ripemd160 } from "./ripemd160.js"; -import { pbkdf2 } from "./pbkdf2.js"; -import { randomBytes } from "./random.js"; -import { scrypt, scryptSync } from "./scrypt.js"; -import { sha256, sha512 } from "./sha3.js"; -import { Ed448Goldilock } from "./crypto.js"; -import { keccak256 } from "./keccak.js"; -export { computeHmac, randomBytes, ripemd160, sha256, sha512, pbkdf2, scrypt, scryptSync, keccak256, Ed448Goldilock, }; -export { SigningKey } from "./signing-key.js"; -export { Signature } from "./signature.js"; -declare function lock(): void; -export { lock }; -export type { ProgressCallback } from "./scrypt.js"; -export type { SignatureLike } from "./signature.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/crypto/index.d.ts.map b/types/crypto/index.d.ts.map deleted file mode 100644 index 76d2d37f8..000000000 --- a/types/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,WAAW,EACX,WAAW,EACX,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,GACd,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,iBAAS,IAAI,IAAI,IAAI,CAUpB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAKhB,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/types/crypto/keccak.d.ts b/types/crypto/keccak.d.ts deleted file mode 100644 index a2b3dd879..000000000 --- a/types/crypto/keccak.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Cryptographic hashing functions - * - * @_subsection: api/crypto:Hash Functions [about-crypto-hashing] - */ -import type { BytesLike } from "../utils/index.js"; -declare const _keccak256: (data: Uint8Array) => Uint8Array; -/** - * Compute the cryptographic KECCAK256 hash of %%data%%. - * - * The %%data%% **must** be a data representation, to compute the - * hash of UTF-8 data use the [[id]] function. - * - * @returns DataHexstring - * @example: - * keccak256("0x") - * //_result: - * - * keccak256("0x1337") - * //_result: - * - * keccak256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - * // Strings are assumed to be DataHexString, otherwise it will - * // throw. To hash UTF-8 data, see the note above. - * keccak256("Hello World") - * //_error: - */ -export declare function keccak256(_data: BytesLike): string; -export declare namespace keccak256 { - export { _keccak256 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=keccak.d.ts.map \ No newline at end of file diff --git a/types/crypto/keccak.d.ts.map b/types/crypto/keccak.d.ts.map deleted file mode 100644 index dfe4be3ef..000000000 --- a/types/crypto/keccak.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"keccak.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/keccak.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/types/crypto/pbkdf2-browser.d.ts b/types/crypto/pbkdf2-browser.d.ts deleted file mode 100644 index 31ae18ebe..000000000 --- a/types/crypto/pbkdf2-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import pbkdf2 from "bcrypto/lib/pbkdf2-browser.js"; -export default pbkdf2; -//# sourceMappingURL=pbkdf2-browser.d.ts.map \ No newline at end of file diff --git a/types/crypto/pbkdf2-browser.d.ts.map b/types/crypto/pbkdf2-browser.d.ts.map deleted file mode 100644 index 97bf68048..000000000 --- a/types/crypto/pbkdf2-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2-browser.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2-browser.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,+BAA+B,CAAC;eACpC,MAAM"} \ No newline at end of file diff --git a/types/crypto/pbkdf2.d.ts b/types/crypto/pbkdf2.d.ts deleted file mode 100644 index c2da81c40..000000000 --- a/types/crypto/pbkdf2.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * A **Password-Based Key-Derivation Function** is designed to create - * a sequence of bytes suitible as a **key** from a human-rememberable - * password. - * - * @_subsection: api/crypto:Passwords [about-pbkdf] - */ -import type { BytesLike } from "../utils/index.js"; -declare const _pbkdf2: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike; -/** - * Return the [[link-pbkdf2]] for %%keylen%% bytes for %%password%% using - * the %%salt%% and using %%iterations%% of %%algo%%. - * - * This PBKDF is outdated and should not be used in new projects, but is - * required to decrypt older files. - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the PBKDF2 - * pbkdf2(passwordBytes, salt, 1024, 16, "sha256") - * //_result: - */ -export declare function pbkdf2(_password: BytesLike, _salt: BytesLike, iterations: number, keylen: number, algo: "sha256" | "sha512"): string; -export declare namespace pbkdf2 { - export { _pbkdf2 as _ }; - export var lock: () => void; - export var register: (func: (password: Uint8Array, salt: Uint8Array, iterations: number, keylen: number, algo: "sha256" | "sha512") => BytesLike) => void; -} -export {}; -//# sourceMappingURL=pbkdf2.d.ts.map \ No newline at end of file diff --git a/types/crypto/pbkdf2.d.ts.map b/types/crypto/pbkdf2.d.ts.map deleted file mode 100644 index fc5ad966d..000000000 --- a/types/crypto/pbkdf2.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pbkdf2.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/pbkdf2.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,OAAO,aACF,UAAU,QACd,UAAU,cACJ,MAAM,UACV,MAAM,QACR,QAAQ,GAAG,QAAQ,KACvB,SAEF,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CACrB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,GACvB,MAAM,CAIR;yBAVe,MAAM;aAWX,OAAO;2BACS,IAAI;gCAIxB,CACL,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,UAAU,EAChB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,QAAQ,GAAG,QAAQ,KACrB,SAAS"} \ No newline at end of file diff --git a/types/crypto/random.d.ts b/types/crypto/random.d.ts deleted file mode 100644 index 609ec0ec0..000000000 --- a/types/crypto/random.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -declare const _randomBytes: (length: number) => Uint8Array; -/** - * Return %%length%% bytes of cryptographically secure random data. - * - * @example: - * randomBytes(8) - * //_result: - */ -export declare function randomBytes(length: number): Uint8Array; -export declare namespace randomBytes { - export { _randomBytes as _ }; - export var lock: () => void; - export var register: (func: (length: number) => Uint8Array) => void; -} -export {}; -//# sourceMappingURL=random.d.ts.map \ No newline at end of file diff --git a/types/crypto/random.d.ts.map b/types/crypto/random.d.ts.map deleted file mode 100644 index 0e9d29e7b..000000000 --- a/types/crypto/random.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/random.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,YAAY,WAAqB,MAAM,KAAG,UAE/C,CAAC;AAIF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEtD;yBAFe,WAAW;aAIX,YAAY;2BACI,IAAI;gCAGG,CAAC,MAAM,EAAE,MAAM,KAAK,UAAU"} \ No newline at end of file diff --git a/types/crypto/ripemd160.d.ts b/types/crypto/ripemd160.d.ts deleted file mode 100644 index a38b5f516..000000000 --- a/types/crypto/ripemd160.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -declare const _ripemd160: (data: Uint8Array) => Uint8Array; -/** - * Compute the cryptographic RIPEMD-160 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * ripemd160("0x") - * //_result: - * - * ripemd160("0x1337") - * //_result: - * - * ripemd160(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare function ripemd160(_data: BytesLike): string; -export declare namespace ripemd160 { - export { _ripemd160 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=ripemd160.d.ts.map \ No newline at end of file diff --git a/types/crypto/ripemd160.d.ts.map b/types/crypto/ripemd160.d.ts.map deleted file mode 100644 index 68683ca8b..000000000 --- a/types/crypto/ripemd160.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ripemd160.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/ripemd160.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,QAAA,MAAM,UAAU,SAAmB,UAAU,KAAG,UAE/C,CAAC;AAIF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAGlD;yBAHe,SAAS;aAIX,UAAU;2BACM,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS"} \ No newline at end of file diff --git a/types/crypto/rlp.d.ts b/types/crypto/rlp.d.ts deleted file mode 100644 index 42970ab48..000000000 --- a/types/crypto/rlp.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { BytesLike } from "../utils/data.js"; -export declare function encode(object: any): string; -export declare function decode(data: BytesLike): any; -//# sourceMappingURL=rlp.d.ts.map \ No newline at end of file diff --git a/types/crypto/rlp.d.ts.map b/types/crypto/rlp.d.ts.map deleted file mode 100644 index 6c9570fb1..000000000 --- a/types/crypto/rlp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/rlp.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,SAAS,EAAwB,MAAM,kBAAkB,CAAC;AA+D7E,wBAAgB,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAE1C;AAkHD,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,GAAG,CAO3C"} \ No newline at end of file diff --git a/types/crypto/scrypt.d.ts b/types/crypto/scrypt.d.ts deleted file mode 100644 index a00b5a43b..000000000 --- a/types/crypto/scrypt.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -/** - * A callback during long-running operations to update any - * UI or provide programatic access to the progress. - * - * The %%percent%% is a value between ``0`` and ``1``. - * - * @_docloc: api/crypto:Passwords - */ -export type ProgressCallback = (percent: number) => void; -declare const _scryptAsync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, onProgress?: ProgressCallback) => Promise & Uint8Array>; -declare const _scryptSync: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => Uint8Array & Uint8Array; -/** - * The [[link-wiki-scrypt]] uses a memory and cpu hard method of - * derivation to increase the resource cost to brute-force a password - * for a given key. - * - * This means this algorithm is intentionally slow, and can be tuned to - * become slower. As computation and memory speed improve over time, - * increasing the difficulty maintains the cost of an attacker. - * - * For example, if a target time of 5 seconds is used, a legitimate user - * which knows their password requires only 5 seconds to unlock their - * account. A 6 character password has 68 billion possibilities, which - * would require an attacker to invest over 10,000 years of CPU time. This - * is of course a crude example (as password generally aren't random), - * but demonstrates to value of imposing large costs to decryption. - * - * For this reason, if building a UI which involved decrypting or - * encrypting datsa using scrypt, it is recommended to use a - * [[ProgressCallback]] (as event short periods can seem lik an eternity - * if the UI freezes). Including the phrase //"decrypting"// in the UI - * can also help, assuring the user their waiting is for a good reason. - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scrypt(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scrypt(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback): Promise; -export declare namespace scrypt { - export { _scryptAsync as _ }; - export var lock: () => void; - export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number, progress?: ProgressCallback) => Promise) => void; -} -/** - * Provides a synchronous variant of [[scrypt]]. - * - * This will completely lock up and freeze the UI in a browser and will - * prevent any event loop from progressing. For this reason, it is - * preferred to use the [async variant](scrypt). - * - * @_docloc: api/crypto:Passwords - * - * @example: - * // The password must be converted to bytes, and it is generally - * // best practices to ensure the string has been normalized. Many - * // formats explicitly indicate the normalization form to use. - * password = "hello" - * passwordBytes = toUtf8Bytes(password, "NFKC") - * - * salt = id("some-salt") - * - * // Compute the scrypt - * scryptSync(passwordBytes, salt, 1024, 8, 1, 16) - * //_result: - */ -export declare function scryptSync(_passwd: BytesLike, _salt: BytesLike, N: number, r: number, p: number, dkLen: number): string; -export declare namespace scryptSync { - export { _scryptSync as _ }; - export var lock: () => void; - export var register: (func: (passwd: Uint8Array, salt: Uint8Array, N: number, r: number, p: number, dkLen: number) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=scrypt.d.ts.map \ No newline at end of file diff --git a/types/crypto/scrypt.d.ts.map b/types/crypto/scrypt.d.ts.map deleted file mode 100644 index 23c428160..000000000 --- a/types/crypto/scrypt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scrypt.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/scrypt.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE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,CAAC,EAAE,MAAM,EACT,KAAK,EAAE,MAAM,KACT,SAAS"} \ No newline at end of file diff --git a/types/crypto/sha3.d.ts b/types/crypto/sha3.d.ts deleted file mode 100644 index 34e1d42f6..000000000 --- a/types/crypto/sha3.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { BytesLike } from "../utils/data.js"; -declare const _sha256: (data: Uint8Array) => string; -declare const _sha512: (data: Uint8Array) => string; -/** - * Compute the cryptographic SHA3-256 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha256("0x") - * //_result: - * - * sha256("0x1337") - * //_result: - * - * sha256(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - * - */ -export declare enum SupportedAlgorithm { - sha256 = "sha256", - sha512 = "sha512" -} -export declare function ripemd160(data: BytesLike): string; -export declare function sha256(data: BytesLike): string; -export declare namespace sha256 { - export { _sha256 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export declare function legacySha256(data: BytesLike): string; -export declare function computeHmac(algorithm: SupportedAlgorithm, key: BytesLike, data: BytesLike): string; -/** - * Compute the cryptographic SHA3-512 hash of %%data%%. - * - * @_docloc: api/crypto:Hash Functions - * @returns DataHexstring - * - * @example: - * sha512("0x") - * //_result: - * - * sha512("0x1337") - * //_result: - * - * sha512(new Uint8Array([ 0x13, 0x37 ])) - * //_result: - */ -export declare function sha512(data: BytesLike): string; -export declare namespace sha512 { - export { _sha512 as _ }; - export var lock: () => void; - export var register: (func: (data: Uint8Array) => BytesLike) => void; -} -export {}; -//# sourceMappingURL=sha3.d.ts.map \ No newline at end of file diff --git a/types/crypto/sha3.d.ts.map b/types/crypto/sha3.d.ts.map deleted file mode 100644 index d71f0360e..000000000 --- a/types/crypto/sha3.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha3.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/sha3.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,SAAS,EAAqB,MAAM,kBAAkB,CAAC;AAM1E,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AACvD,QAAA,MAAM,OAAO,SAAU,UAAU,KAAG,MACkB,CAAC;AAOvD;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,kBAAkB;IAC7B,MAAM,WAAW;IACjB,MAAM,WAAW;CACjB;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEjD;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAkCX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI;;AAlCxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAIpD;AAED,wBAAgB,WAAW,CAC1B,SAAS,EAAE,kBAAkB,EAC7B,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,SAAS,GACb,MAAM,CAkBR;AAcD;;;;;;;;;;;;;;;GAeG;AAEH,wBAAgB,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAE9C;yBAFe,MAAM;aAGX,OAAO;2BACS,IAAI;gCAGG,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS,KAAG,IAAI"} \ No newline at end of file diff --git a/types/crypto/signature.d.ts b/types/crypto/signature.d.ts deleted file mode 100644 index 075005c42..000000000 --- a/types/crypto/signature.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -/** - * A SignatureLike - * - * @_docloc: api/crypto:Signing - */ -export type SignatureLike = string; -/** - * A Signature @TODO - * - * - * @_docloc: api/crypto:Signing - */ -export declare class Signature { - #private; - /** - * The ``r`` value for a signautre. - * - * This represents the ``x`` coordinate of a "reference" or - * challenge point, from which the ``y`` can be computed. - */ - get r(): string; - set r(value: BytesLike); - /** - * The ``s`` value for a signature. - */ - get s(): string; - set s(_value: BytesLike); - /** - * The ``v`` value for a signature. - * - * Since a given ``x`` value for ``r`` has two possible values for - * its correspondin ``y``, the ``v`` indicates which of the two ``y`` - * values to use. - * - * It is normalized to the values ``27`` or ``28`` for legacy - * purposes. - */ - get v(): 27 | 28; - set v(value: BigNumberish); - /** - * The EIP-155 ``v`` for legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get networkV(): null | bigint; - /** - * The chain ID for EIP-155 legacy transactions. For non-legacy - * transactions, this value is ``null``. - */ - get legacynetworkId(): null | bigint; - /** - * The ``yParity`` for the signature. - * - * See ``v`` for more details on how this value is used. - */ - get yParity(): 0 | 1; - /** - * The [[link-eip-2098]] compact representation of the ``yParity`` - * and ``s`` compacted into a single ``bytes32``. - */ - get yParityAndS(): string; - /** - * The [[link-eip-2098]] compact representation. - */ - get compactSerialized(): string; - /** - * The serialized representation. - */ - get serialized(): string; - /** - * @private - */ - constructor(guard: any, r: string, s: string, v: 27 | 28); - /** - * Returns a new identical [[Signature]]. - */ - clone(): Signature; - /** - * Returns a representation that is compatible with ``JSON.stringify``. - */ - toJSON(): any; - /** - * Compute the chain ID from the ``v`` in a legacy EIP-155 transactions. - * - * @example: - * Signature.getnetworkId(45) - * //_result: - * - * Signature.getnetworkId(46) - * //_result: - */ - static getnetworkId(v: BigNumberish): bigint; - /** - * Compute the ``v`` for a chain ID for a legacy EIP-155 transactions. - * - * Legacy transactions which use [[link-eip-155]] hijack the ``v`` - * property to include the chain ID. - * - * @example: - * Signature.getnetworkIdV(5, 27) - * //_result: - * - * Signature.getnetworkIdV(5, 28) - * //_result: - * - */ - static getnetworkIdV(networkId: BigNumberish, v: 27 | 28): bigint; - /** - * Compute the normalized legacy transaction ``v`` from a ``yParirty``, - * a legacy transaction ``v`` or a legacy [[link-eip-155]] transaction. - * - * @example: - * // The values 0 and 1 imply v is actually yParity - * Signature.getNormalizedV(0) - * //_result: - * - * // Legacy non-EIP-1559 transaction (i.e. 27 or 28) - * Signature.getNormalizedV(27) - * //_result: - * - * // Legacy EIP-155 transaction (i.e. >= 35) - * Signature.getNormalizedV(46) - * //_result: - * - * // Invalid values throw - * Signature.getNormalizedV(5) - * //_error: - */ - static getNormalizedV(v: BigNumberish): 27 | 28; -} -//# sourceMappingURL=signature.d.ts.map \ No newline at end of file diff --git a/types/crypto/signature.d.ts.map b/types/crypto/signature.d.ts.map deleted file mode 100644 index cf72d7bd1..000000000 --- a/types/crypto/signature.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signature.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAcjE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,SAAS;;IAMrB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAGrB;IAED;;OAEG;IACH,IAAI,CAAC,IAAI,MAAM,CAEd;IACD,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAUtB;IAED;;;;;;;;;OASG;IACH,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,CAEf;IACD,IAAI,CAAC,CAAC,KAAK,EAAE,YAAY,EAIxB;IAED;;;OAGG;IACH,IAAI,QAAQ,IAAI,IAAI,GAAG,MAAM,CAE5B;IAED;;;OAGG;IACH,IAAI,eAAe,IAAI,IAAI,GAAG,MAAM,CAMnC;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,CAAC,GAAG,CAAC,CAEnB;IAED;;;OAGG;IACH,IAAI,WAAW,IAAI,MAAM,CAOxB;IAED;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,CAE9B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;OAEG;IACH,YAAY,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAMvD;IAMD;;OAEG;IACH,KAAK,IAAI,SAAS,CAMjB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CASZ;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAY3C;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM,CAEhE;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,EAAE,GAAG,EAAE,CAc9C;CAUD"} \ No newline at end of file diff --git a/types/crypto/signing-key.d.ts b/types/crypto/signing-key.d.ts deleted file mode 100644 index 3ce0c2ea0..000000000 --- a/types/crypto/signing-key.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Add details about signing here. - * - * @_subsection: api/crypto:Signing [about-signing] - */ -import type { BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "./index.js"; -/** - * A **SigningKey** provides high-level access to the elliptic curve - * cryptography (ECC) operations and key management. - */ -export declare class SigningKey { - #private; - /** - * Creates a new **SigningKey** for %%privateKey%%. - */ - constructor(privateKey: BytesLike); - /** - * The private key. - */ - get privateKey(): string; - /** The 57-byte Ed448 public key encoded as hex. */ - get publicKey(): string; - /** Compatibility alias: Ed448 has one 57-byte public-key encoding. */ - get compressedPublicKey(): string; - /** - * Return the signature of the signed %%digest%%. - */ - sign(digest: BytesLike): string; - /** Derives an Ed448 shared secret from a 57-byte public key. Hash it before use as a symmetric key. */ - computeSharedSecret(other: BytesLike): string; - /** Computes an Ed448 public key from a 57-byte private key. The compression flag is ignored. */ - static computePublicKey(key: BytesLike, compressed?: boolean): string; - /** - * Returns the public key for the private key which produced the - * %%signature%% for the given %%digest%%. - * - * @example: - * key = new SigningKey(id("some-secret")) - * digest = id("hello world") - * sig = key.sign(digest) - * - * // Notice the signer public key... - * key.publicKey - * //_result: - * - * // ...is equal to the recovered public key - * SigningKey.recoverPublicKey(digest, sig) - * //_result: - * - */ - static recoverPublicKey(digest: BytesLike, signature: SignatureLike): string; - /** Adds two encoded Ed448 public points. The compression flag is ignored. */ - static addPoints(p0: BytesLike, p1: BytesLike, compressed?: boolean): string; -} -//# sourceMappingURL=signing-key.d.ts.map \ No newline at end of file diff --git a/types/crypto/signing-key.d.ts.map b/types/crypto/signing-key.d.ts.map deleted file mode 100644 index 1185a52a8..000000000 --- a/types/crypto/signing-key.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signing-key.d.ts","sourceRoot":"","sources":["../../src.ts/crypto/signing-key.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD;;;GAGG;AACH,qBAAa,UAAU;;IAGtB;;OAEG;IACH,YAAY,UAAU,EAAE,SAAS,EAYhC;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,mDAAmD;IACnD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,sEAAsE;IACtE,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAiC9B;IAED,uGAAuG;IACvG,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAgB5C;IAED,gGAAgG;IAChG,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAgBpE;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM,CAmB3E;IAED,6EAA6E;IAC7E,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAY3E;CACD"} \ No newline at end of file diff --git a/types/hash/id.d.ts b/types/hash/id.d.ts deleted file mode 100644 index c55374a67..000000000 --- a/types/hash/id.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * A simple hashing function which operates on UTF-8 strings to - * compute an 32-byte identifier. - * - * - * @example: - * id("hello world") - * //_result: - */ -export declare function id(value: string, useKeccak?: boolean): string; -//# sourceMappingURL=id.d.ts.map \ No newline at end of file diff --git a/types/hash/id.d.ts.map b/types/hash/id.d.ts.map deleted file mode 100644 index 140f79634..000000000 --- a/types/hash/id.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src.ts/hash/id.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAK7D"} \ No newline at end of file diff --git a/types/hash/index.d.ts b/types/hash/index.d.ts deleted file mode 100644 index a9ba6fa23..000000000 --- a/types/hash/index.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * About hashing here... - * - * @_section: api/hashing:Hashing Utilities [about-hashing] - */ -export { id } from "./id.js"; -export { hashMessage, verifyMessage } from "./message.js"; -export { solidityPacked, solidityPackedSha256 } from "./solidity.js"; -export { TypedDataEncoder, verifyTypedData } from "./typed-data.js"; -export type { TypedDataDomain, TypedDataField } from "./typed-data.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/hash/index.d.ts.map b/types/hash/index.d.ts.map deleted file mode 100644 index 70eb7509e..000000000 --- a/types/hash/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/hash/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"} \ No newline at end of file diff --git a/types/hash/message.d.ts b/types/hash/message.d.ts deleted file mode 100644 index c7776facd..000000000 --- a/types/hash/message.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { SignatureLike } from "../crypto/index.js"; -/** - * Computes the [[link-eip-191]] personal-sign message digest to sign. - * - * - * If %%message%% is a string, it is converted to its UTF-8 bytes - * first. To compute the digest of a [[DataHexString]], it must be converted - * to [bytes](getBytes). - * - * @example: - * hashMessage("Hello World") - * //_result: - * - * // Hashes the SIX (6) string characters, i.e. - * // [ "0", "x", "4", "2", "4", "3" ] - * hashMessage("0x4243") - * //_result: - * - * // Hashes the TWO (2) bytes [ 0x42, 0x43 ]... - * hashMessage(getBytes("0x4243")) - * //_result: - * - * // ...which is equal to using data - * hashMessage(new Uint8Array([ 0x42, 0x43 ])) - * //_result: - * - */ -export declare function hashMessage(message: Uint8Array | string): string; -/** - * Return the address of the private key that produced - * the signature %%sig%% during signing for %%message%%. - */ -export declare function verifyMessage(message: Uint8Array | string, sig: SignatureLike, prefix: string): string; -//# sourceMappingURL=message.d.ts.map \ No newline at end of file diff --git a/types/hash/message.d.ts.map b/types/hash/message.d.ts.map deleted file mode 100644 index 8c0421a97..000000000 --- a/types/hash/message.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src.ts/hash/message.ts"],"names":[],"mappings":"AAIA,OAAO,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAWhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,OAAO,EAAE,UAAU,GAAG,MAAM,EAC5B,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,MAAM,GACZ,MAAM,CAGR"} \ No newline at end of file diff --git a/types/hash/solidity.d.ts b/types/hash/solidity.d.ts deleted file mode 100644 index f6e66a454..000000000 --- a/types/hash/solidity.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Computes the [[link-solc-packed]] representation of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPacked([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPacked(types: ReadonlyArray, values: ReadonlyArray): string; -/** - * Computes the [[link-solc-packed]] [[sha256]] hash of %%values%% - * respectively to their %%types%%. - * - * @example: - * addr = "0x8ba1f109551bd432803012645ac136ddd64dba72" - * solidityPackedSha256([ "address", "uint" ], [ addr, 45 ]); - * //_result: - */ -export declare function solidityPackedSha256(types: ReadonlyArray, values: ReadonlyArray): string; -//# sourceMappingURL=solidity.d.ts.map \ No newline at end of file diff --git a/types/hash/solidity.d.ts.map b/types/hash/solidity.d.ts.map deleted file mode 100644 index 8a06af8f2..000000000 --- a/types/hash/solidity.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"solidity.d.ts","sourceRoot":"","sources":["../../src.ts/hash/solidity.ts"],"names":[],"mappings":"AA8GA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAaR;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GACxB,MAAM,CAER"} \ No newline at end of file diff --git a/types/hash/typed-data.d.ts b/types/hash/typed-data.d.ts deleted file mode 100644 index 76130b694..000000000 --- a/types/hash/typed-data.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { BigNumberish, BytesLike } from "../utils/index.js"; -export interface TypedDataDomain { - name?: null | string; - version?: null | string; - networkId?: null | BigNumberish; - verifyingContract?: null | string; - salt?: null | BytesLike; -} -export interface TypedDataField { - name: string; - type: string; -} -export declare class TypedDataEncoder { - #private; - readonly primaryType: string; - get types(): Record>; - constructor(types: Record>); - getEncoder(type: string): (value: any) => string; - encodeType(name: string): string; - encodeData(type: string, value: any): string; - hashStruct(name: string, value: Record): string; - encode(value: Record): string; - hash(value: Record): string; - _visit(type: string, value: any, callback: (type: string, data: any) => any): any; - visit(value: Record, callback: (type: string, data: any) => any): any; - static from(types: Record>): TypedDataEncoder; - static getPrimaryType(types: Record>): string; - static hashStruct(name: string, types: Record>, value: Record): string; - static hashDomain(domain: TypedDataDomain): string; - static encode(domain: TypedDataDomain, types: Record>, value: Record): string; - static hash(domain: TypedDataDomain, types: Record>, value: Record): string; - static resolveNames(domain: TypedDataDomain, types: Record>, value: Record, resolveName: (name: string) => Promise): Promise<{ - domain: TypedDataDomain; - value: any; - }>; - static getPayload(domain: TypedDataDomain, types: Record>, value: Record): any; -} -/** - * Compute the address used to sign the typed data for the %%signature%%. - */ -export declare function verifyTypedData(domain: TypedDataDomain, types: Record>, value: Record, signature: string, prefix: string): string; -//# sourceMappingURL=typed-data.d.ts.map \ No newline at end of file diff --git a/types/hash/typed-data.d.ts.map b/types/hash/typed-data.d.ts.map deleted file mode 100644 index 27a189723..000000000 --- a/types/hash/typed-data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"typed-data.d.ts","sourceRoot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E,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAC5C,OAAO,CAAC;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC,CAoDlD;IAED,MAAM,CAAC,UAAU,CAChB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,GAAG,CAiEL;CACD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACZ,MAAM,CAMR"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index 3fd593002..000000000 --- a/types/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The Application Programming Interface (API) is the collection of - * functions, classes and types offered by the CoreBC library. - * - * @_section: api:Application Programming Interface [about-api] - * @_navTitle: API - */ -import { Buffer } from "buffer"; -export { Buffer }; -import * as corebc from "./corebc.js"; -export { corebc }; -export * from "./corebc.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map deleted file mode 100644 index 5841be6e6..000000000 --- a/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src.ts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/types/ipfs/index.d.ts b/types/ipfs/index.d.ts deleted file mode 100644 index e1bf33eb0..000000000 --- a/types/ipfs/index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export declare const defaultIpfsGatewayTemplate = "https://ipf.sk/{cid}"; -export interface IpfsGatewayOptions { - template?: string; - maxResponseBytes?: number; - timeoutMs?: number; - fetch?: typeof globalThis.fetch; -} -/** Configurable IPFS resolution and bounded JSON loading. */ -export declare class IpfsGateway { - #private; - readonly template: string; - readonly maxResponseBytes: number; - readonly timeoutMs: number; - constructor(options?: IpfsGatewayOptions); - resolve(reference: string): URL; - readJson(reference: string): Promise; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/ipfs/index.d.ts.map b/types/ipfs/index.d.ts.map deleted file mode 100644 index baabf24dc..000000000 --- a/types/ipfs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/ipfs/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,yBAAyB,CAAC;AACjE,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CAChC;AACD,6DAA6D;AAC7D,qBAAa,WAAW;;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,YAAY,OAAO,GAAE,kBAAuB,EAgB3C;IACD,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,GAAG,CAe9B;IACK,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0ClD;CACD"} \ No newline at end of file diff --git a/types/logger/logger.d.ts b/types/logger/logger.d.ts deleted file mode 100644 index df72240a3..000000000 --- a/types/logger/logger.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export declare enum LogLevel { - DEBUG = "DEBUG", - INFO = "INFO", - WARNING = "WARNING", - ERROR = "ERROR", - OFF = "OFF" -} -export declare enum ErrorCode { - UNKNOWN_ERROR = "UNKNOWN_ERROR", - NOT_IMPLEMENTED = "NOT_IMPLEMENTED", - UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION", - NETWORK_ERROR = "NETWORK_ERROR", - SERVER_ERROR = "SERVER_ERROR", - TIMEOUT = "TIMEOUT", - BUFFER_OVERRUN = "BUFFER_OVERRUN", - NUMERIC_FAULT = "NUMERIC_FAULT", - MISSING_NEW = "MISSING_NEW", - INVALID_ARGUMENT = "INVALID_ARGUMENT", - MISSING_ARGUMENT = "MISSING_ARGUMENT", - UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT", - CALL_EXCEPTION = "CALL_EXCEPTION", - INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS", - NONCE_EXPIRED = "NONCE_EXPIRED", - REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED", - UNPREDICTABLE_ENERGY_LIMIT = "UNPREDICTABLE_ENERGY_LIMIT", - TRANSACTION_REPLACED = "TRANSACTION_REPLACED" -} -export declare class Logger { - readonly version: string; - static errors: typeof ErrorCode; - static levels: typeof LogLevel; - constructor(version: string); - _log(logLevel: LogLevel, args: Array): void; - debug(...args: Array): void; - info(...args: Array): void; - warn(...args: Array): void; - makeError(message: string, code?: ErrorCode, params?: any): Error; - throwError(message: string, code?: ErrorCode, params?: any): never; - throwArgumentError(message: string, name: string, value: any): never; - assert(condition: any, message: string, code?: ErrorCode, params?: any): void; - assertArgument(condition: any, message: string, name: string, value: any): void; - checkNormalize(message?: string): void; - checkSafeUint53(value: number, message?: string): void; - checkArgumentCount(count: number, expectedCount: number, message?: string): void; - checkNew(target: any, kind: any): void; - checkAbstract(target: any, kind: any): void; - static globalLogger(): Logger; - static setCensorship(censorship: boolean, permanent?: boolean): void; - static setLogLevel(logLevel: LogLevel): void; - static from(version: string): Logger; -} -//# sourceMappingURL=logger.d.ts.map \ No newline at end of file diff --git a/types/logger/logger.d.ts.map b/types/logger/logger.d.ts.map deleted file mode 100644 index 1880f0d16..000000000 --- a/types/logger/logger.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src.ts/logger/logger.ts"],"names":[],"mappings":"AAmDA,oBAAY,QAAQ;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,GAAG,QAAQ;CACX;AAED,oBAAY,SAAS;IAKpB,aAAa,kBAAkB;IAG/B,eAAe,oBAAoB;IAInC,qBAAqB,0BAA0B;IAI/C,aAAa,kBAAkB;IAG/B,YAAY,iBAAiB;IAG7B,OAAO,YAAY;IAMnB,cAAc,mBAAmB;IAKjC,aAAa,kBAAkB;IAO/B,WAAW,gBAAgB;IAK3B,gBAAgB,qBAAqB;IAKrC,gBAAgB,qBAAqB;IAKrC,mBAAmB,wBAAwB;IAa3C,cAAc,mBAAmB;IAIjC,kBAAkB,uBAAuB;IAIzC,aAAa,kBAAkB;IAI/B,uBAAuB,4BAA4B;IAInD,0BAA0B,+BAA+B;IAQzD,oBAAoB,yBAAyB;CAC7C;AAID,qBAAa,MAAM;IAClB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAW;IAEnC,MAAM,CAAC,MAAM,mBAAa;IAE1B,MAAM,CAAC,MAAM,kBAAY;IAEzB,YAAY,OAA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EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAMrC;IAED,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,IAAI,CAc1C;IAED,MAAM,CAAC,YAAY,IAAI,MAAM,CAK5B;IAED,MAAM,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CA0BnE;IAED,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAO3C;IAED,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnC;CACD"} \ No newline at end of file diff --git a/types/providers/abstract-provider.d.ts b/types/providers/abstract-provider.d.ts deleted file mode 100644 index 79ee0dee3..000000000 --- a/types/providers/abstract-provider.d.ts +++ /dev/null @@ -1,211 +0,0 @@ -/** - * About Subclassing the Provider... - * - * @_section: api/providers/abstract-provider: Subclassing Provider [abstract-provider] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { Block, FeeData, Log, TransactionReceipt, TransactionResponse } from "./provider.js"; -import type { AddressLike } from "../address/index.js"; -import type { BigNumberish } from "../utils/index.js"; -import type { Listener } from "../utils/index.js"; -import type { Networkish } from "./network.js"; -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -import type { BlockTag, EventFilter, Filter, FilterByBlockHash, OrphanFilter, PreparedTransactionRequest, Provider, ProviderEvent, TransactionRequest } from "./provider.js"; -export type DebugEventAbstractProvider = { - action: "sendCcipReadFetchRequest"; - request: FetchRequest; - index: number; - urls: Array; -} | { - action: "receiveCcipReadFetchResult"; - request: FetchRequest; - result: any; -} | { - action: "receiveCcipReadFetchError"; - request: FetchRequest; - result: any; -} | { - action: "sendCcipReadCall"; - transaction: { - to: string; - data: string; - }; -} | { - action: "receiveCcipReadCallResult"; - transaction: { - to: string; - data: string; - }; - result: string; -} | { - action: "receiveCcipReadCallError"; - transaction: { - to: string; - data: string; - }; - error: Error; -}; -export type Subscription = { - type: "block" | "close" | "debug" | "error" | "network" | "pending"; - tag: string; -} | { - type: "transaction"; - tag: string; - hash: string; -} | { - type: "event"; - tag: string; - filter: EventFilter; -} | { - type: "orphan"; - tag: string; - filter: OrphanFilter; -}; -export interface Subscriber { - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; - pollingInterval?: number; -} -export declare class UnmanagedSubscriber implements Subscriber { - name: string; - constructor(name: string); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -export interface AbstractProviderPlugin { - readonly name: string; - connect(provider: AbstractProvider): AbstractProviderPlugin; -} -export type PerformActionFilter = { - address?: string | Array; - topics?: Array>; - fromBlock?: BlockTag; - toBlock?: BlockTag; -} | { - address?: string | Array; - topics?: Array>; - blockHash?: string; -}; -export interface PerformActionTransaction extends PreparedTransactionRequest { - to?: string; - from?: string; -} -export type PerformActionRequest = { - method: "broadcastTransaction"; - signedTransaction: string; -} | { - method: "call"; - transaction: PerformActionTransaction; - blockTag: BlockTag; -} | { - method: "networkId"; -} | { - method: "estimateEnergy"; - transaction: PerformActionTransaction; -} | { - method: "getBalance"; - address: string; - blockTag: BlockTag; -} | { - method: "getBlock"; - blockTag: BlockTag; - includeTransactions: boolean; -} | { - method: "getBlock"; - blockHash: string; - includeTransactions: boolean; -} | { - method: "getBlockNumber"; -} | { - method: "getCode"; - address: string; - blockTag: BlockTag; -} | { - method: "getEnergyPrice"; -} | { - method: "getLogs"; - filter: PerformActionFilter; -} | { - method: "getStorage"; - address: string; - position: bigint; - blockTag: BlockTag; -} | { - method: "getTransaction"; - hash: string; -} | { - method: "getTransactionCount"; - address: string; - blockTag: BlockTag; -} | { - method: "getTransactionReceipt"; - hash: string; -} | { - method: "getTransactionResult"; - hash: string; -}; -export declare class AbstractProvider implements Provider { - #private; - constructor(_network?: "any" | Networkish); - get provider(): this; - get plugins(): Array; - attachPlugin(plugin: AbstractProviderPlugin): this; - getPlugin(name: string): null | T; - get disableCcipRead(): boolean; - set disableCcipRead(value: boolean); - ccipReadFetch(tx: PerformActionTransaction, calldata: string, urls: Array): Promise; - _wrapBlock(value: BlockParams, network: Network): Block; - _wrapLog(value: LogParams, network: Network): Log; - _wrapTransactionReceipt(value: TransactionReceiptParams, network: Network): TransactionReceipt; - _wrapTransactionResponse(tx: TransactionResponseParams, network: Network): TransactionResponse; - _detectNetwork(): Promise; - _perform(req: PerformActionRequest): Promise; - getBlockNumber(): Promise; - _getAddress(address: AddressLike): string | Promise; - _getBlockTag(blockTag?: BlockTag): string | Promise; - _getFilter(filter: Filter | FilterByBlockHash): PerformActionFilter | Promise; - _getTransactionRequest(_request: TransactionRequest): PerformActionTransaction | Promise; - getNetwork(): Promise; - getEnergyPrice(): Promise; - getFeeData(): Promise; - estimateEnergy(_tx: TransactionRequest): Promise; - call(_tx: TransactionRequest): Promise; - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - getStorage(address: AddressLike, _position: BigNumberish, blockTag?: BlockTag): Promise; - broadcastTransaction(signedTx: string): Promise; - getBlock(block: BlockTag | string, prefetchTxs?: boolean): Promise; - getTransaction(hash: string): Promise; - getTransactionReceipt(hash: string): Promise; - getTransactionResult(hash: string): Promise; - getLogs(_filter: Filter | FilterByBlockHash): Promise>; - _getProvider(networkId: number): AbstractProvider; - waitForTransaction(hash: string, _confirms?: null | number, timeout?: null | number): Promise; - waitForBlock(blockTag?: BlockTag): Promise; - _clearTimeout(timerId: number): void; - _setTimeout(_func: () => void, timeout?: number): number; - _forEachSubscriber(func: (s: Subscriber) => void): void; - _getSubscriber(sub: Subscription): Subscriber; - _recoverSubscriber(oldSub: Subscriber, newSub: Subscriber): void; - on(event: ProviderEvent, listener: Listener): Promise; - once(event: ProviderEvent, listener: Listener): Promise; - emit(event: ProviderEvent, ...args: Array): Promise; - listenerCount(event?: ProviderEvent): Promise; - listeners(event?: ProviderEvent): Promise>; - off(event: ProviderEvent, listener?: Listener): Promise; - removeAllListeners(event?: ProviderEvent): Promise; - addListener(event: ProviderEvent, listener: Listener): Promise; - removeListener(event: ProviderEvent, listener: Listener): Promise; - destroy(): void; - get paused(): boolean; - set paused(pause: boolean); - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=abstract-provider.d.ts.map \ No newline at end of file diff --git a/types/providers/abstract-provider.d.ts.map b/types/providers/abstract-provider.d.ts.map deleted file mode 100644 index b293b4e8f..000000000 --- a/types/providers/abstract-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-provider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAYH,OAAO,EAaN,YAAY,EAOZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAEN,KAAK,EACL,OAAO,EACP,GAAG,EACH,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAQvB,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAa,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACX,QAAQ,EACR,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,0BAA0B,EAC1B,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,MAAM,eAAe,CAAC;AA2CvB,MAAM,MAAM,0BAA0B,GACnC;IACA,MAAM,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AAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWhE;IAEK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWlE;IAEK,IAAI,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBtE;IAEK,aAAa,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAc1D;IAEK,SAAS,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAa/D;IAEK,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBlE;IAEK,kBAAkB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB7D;IAGK,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;IAGK,cAAc,CACnB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;IAID,OAAO,IAAI,IAAI,CAQd;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IACD,IAAI,MAAM,CAAC,KAAK,EAAE,OAAO,EAUxB;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CA6BrC;IAED,MAAM,IAAI,IAAI,CAoBb;CACD"} \ No newline at end of file diff --git a/types/providers/abstract-signer.d.ts b/types/providers/abstract-signer.d.ts deleted file mode 100644 index ab4997033..000000000 --- a/types/providers/abstract-signer.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -export declare abstract class AbstractSigner

implements Signer { - readonly provider: P; - constructor(provider?: P); - abstract getAddress(): Promise; - abstract connect(provider: null | Provider): Signer; - getNonce(blockTag?: BlockTag): Promise; - populateCall(tx: TransactionRequest): Promise>; - populateTransaction(tx: TransactionRequest): Promise>; - estimateEnergy(tx: TransactionRequest): Promise; - call(tx: TransactionRequest): Promise; - resolveName(name: string): Promise; - sendTransaction(tx: TransactionRequest): Promise; - abstract signTransaction(tx: TransactionRequest): Promise; - abstract signMessage(message: string | Uint8Array): Promise; - abstract signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -export declare class VoidSigner extends AbstractSigner { - #private; - readonly address: string; - constructor(address: string, provider?: null | Provider); - getAddress(): Promise; - connect(provider: null | Provider): VoidSigner; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=abstract-signer.d.ts.map \ No newline at end of file diff --git a/types/providers/abstract-signer.d.ts.map b/types/providers/abstract-signer.d.ts.map deleted file mode 100644 index 35aaa1ca6..000000000 --- a/types/providers/abstract-signer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abstract-signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/abstract-signer.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuC1C,8BAAsB,cAAc,CACnC,CAAC,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M,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;CACnB;AAED,qBAAa,UAAW,SAAQ,cAAc;;IAC7C,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAE1B,YAAY,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,EAGtD;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAE7C;IAQK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/types/providers/community.d.ts b/types/providers/community.d.ts deleted file mode 100644 index a61908d27..000000000 --- a/types/providers/community.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * There are many awesome community services that provide Core - * nodes both for developers just starting out and for large-scale - * communities. - * - * @_section: api/providers/thirdparty: Community Providers [thirdparty] - */ -/** - * Providers which offer community credentials should extend this - * to notify any interested consumers whether community credentials - * are in-use. - */ -export interface CommunityResourcable { - /** - * Returns true of the instance is connected using the community - * credentials. - */ - isCommunityResource(): boolean; -} -/** - * Displays a warning in tht console when the community resource is - * being used too heavily by the app, recommending the developer - * acquire their own credentials instead of using the community - * credentials. - * - * The notification will only occur once per service. - */ -export declare function showThrottleMessage(service: string): void; -//# sourceMappingURL=community.d.ts.map \ No newline at end of file diff --git a/types/providers/community.d.ts.map b/types/providers/community.d.ts.map deleted file mode 100644 index e36ebbacf..000000000 --- a/types/providers/community.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"community.d.ts","sourceRoot":"","sources":["../../src.ts/providers/community.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;CAC/B;AAKD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CA4BzD"} \ No newline at end of file diff --git a/types/providers/contracts.d.ts b/types/providers/contracts.d.ts deleted file mode 100644 index 187f28cce..000000000 --- a/types/providers/contracts.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -export interface ContractRunner { - provider: null | Provider; - estimateEnergy?: (tx: TransactionRequest) => Promise; - call?: (tx: TransactionRequest) => Promise; - resolveName?: (name: string) => Promise; - sendTransaction?: (tx: TransactionRequest) => Promise; -} -//# sourceMappingURL=contracts.d.ts.map \ No newline at end of file diff --git a/types/providers/contracts.d.ts.map b/types/providers/contracts.d.ts.map deleted file mode 100644 index 29a278289..000000000 --- a/types/providers/contracts.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src.ts/providers/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAG1B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAG7D,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAGnD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAGvD,eAAe,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC3E"} \ No newline at end of file diff --git a/types/providers/default-provider.d.ts b/types/providers/default-provider.d.ts deleted file mode 100644 index 657919cb1..000000000 --- a/types/providers/default-provider.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AbstractProvider } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import { WebSocketLike } from "./provider-websocket.js"; -export declare function getDefaultProvider(network: string | Networkish | WebSocketLike, options?: any): AbstractProvider; -//# sourceMappingURL=default-provider.d.ts.map \ No newline at end of file diff --git a/types/providers/default-provider.d.ts.map b/types/providers/default-provider.d.ts.map deleted file mode 100644 index 6e1d55294..000000000 --- a/types/providers/default-provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"default-provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/default-provider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAUxD,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,EAC5C,OAAO,CAAC,EAAE,GAAG,GACX,gBAAgB,CA6FlB"} \ No newline at end of file diff --git a/types/providers/format.d.ts b/types/providers/format.d.ts deleted file mode 100644 index e088632a0..000000000 --- a/types/providers/format.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -export type FormatFunc = (value: any) => any; -export declare function allowNull(format: FormatFunc, nullValue?: any): FormatFunc; -export declare function arrayOf(format: FormatFunc): FormatFunc; -export declare function object(format: Record, altNames?: Record>): FormatFunc; -export declare function formatBoolean(value: any): boolean; -export declare function formatData(value: string): string; -export declare function formatHash(value: any): string; -export declare function formatUint256(value: any): string; -export declare function formatLog(value: any): LogParams; -export declare function formatBlock(value: any): BlockParams; -export declare function formatReceiptLog(value: any): LogParams; -export declare function formatTransactionReceipt(value: any): TransactionReceiptParams; -export declare function formatTransactionResponse(value: any): TransactionResponseParams; -//# sourceMappingURL=format.d.ts.map \ No newline at end of file diff --git a/types/providers/format.d.ts.map b/types/providers/format.d.ts.map deleted file mode 100644 index 1c35b4b35..000000000 --- a/types/providers/format.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src.ts/providers/format.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAIzB,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC;AAE7C,wBAAgB,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAOzE;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAOtD;AAKD,wBAAgB,MAAM,CACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GACtC,UAAU,CA+BZ;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAejD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAG7C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAKhD;AAmBD,wBAAgB,SAAS,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAE/C;AAoBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,WAAW,CAWnD;AAkBD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,GAAG,GAAG,SAAS,CAEtD;AA6BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,wBAAwB,CAE7E;AAED,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,GAAG,GACR,yBAAyB,CA0G3B"} \ No newline at end of file diff --git a/types/providers/formatting.d.ts b/types/providers/formatting.d.ts deleted file mode 100644 index 82736fe7c..000000000 --- a/types/providers/formatting.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * About provider formatting? - * - * @_section: api/providers/formatting:Formatting [provider-formatting] - */ -export interface BlockParams { - hash?: null | string; - number: number; - timestamp: number; - parentHash: string; - nonce: string; - difficulty: bigint; - energyLimit: bigint; - energyUsed: bigint; - miner: string; - extraData: string; - baseFeePerEnergy: null | bigint; - transactions: ReadonlyArray; -} -export interface LogParams { - transactionHash: string; - blockHash: string; - blockNumber: number; - removed: boolean; - address: string; - data: string; - topics: ReadonlyArray; - index: number; - transactionIndex: number; -} -export interface TransactionReceiptParams { - to: null | string; - from: string; - contractAddress: null | string; - hash: string; - index: number; - blockHash: string; - blockNumber: number; - logsBloom: string; - logs: ReadonlyArray; - energyUsed: bigint; - cumulativeEnergyUsed: bigint; - energyPrice?: null | bigint; - effectiveEnergyPrice?: null | bigint; - type: number; - status: null | number; - root: null | string; -} -export interface TransactionResponseParams { - blockNumber: null | number; - blockHash: null | string; - hash: string; - index: number; - type: number; - to: null | string; - from: string; - nonce: number; - energyLimit: bigint; - energyPrice: bigint; - data: string; - value: bigint; - networkId: bigint; - signature: string; -} -//# sourceMappingURL=formatting.d.ts.map \ No newline at end of file diff --git a/types/providers/formatting.d.ts.map b/types/providers/formatting.d.ts.map deleted file mode 100644 index 5d7ddfb6b..000000000 --- a/types/providers/formatting.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src.ts/providers/formatting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwDH,MAAM,WAAW,WAAW;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IAEnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,gBAAgB,EAAE,IAAI,GAAG,MAAM,CAAC;IAEhC,YAAY,EAAE,aAAa,CAAC,MAAM,GAAG,yBAAyB,CAAC,CAAC;CAChE;AAKD,MAAM,WAAW,SAAS;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,OAAO,CAAC;IAEjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE9B,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;CACzB;AAKD,MAAM,WAAW,wBAAwB;IACxC,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,IAAI,GAAG,MAAM,CAAC;IAE/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;IAE/B,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAErC,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;CACpB;AAmBD,MAAM,WAAW,yBAAyB;IACzC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC;IAC3B,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IAEzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,MAAM,CAAC;IAEb,EAAE,EAAE,IAAI,GAAG,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IAEb,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;CAClB"} \ No newline at end of file diff --git a/types/providers/index.d.ts b/types/providers/index.d.ts deleted file mode 100644 index 7e80c01e9..000000000 --- a/types/providers/index.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * About providers. - * - * @_section: api/providers:Providers [about-providers] - */ -export { AbstractProvider, UnmanagedSubscriber } from "./abstract-provider.js"; -export { AbstractSigner, VoidSigner } from "./abstract-signer.js"; -export { showThrottleMessage } from "./community.js"; -export { getDefaultProvider } from "./default-provider.js"; -export { Network } from "./network.js"; -export { NonceManager } from "./signer-noncemanager.js"; -export { NetworkPlugin, EnergyCostPlugin, FeeDataNetworkPlugin, } from "./plugins-network.js"; -export { Block, FeeData, Log, TransactionReceipt, TransactionResponse, copyRequest, } from "./provider.js"; -export { FallbackProvider } from "./provider-fallback.js"; -export { JsonRpcApiProvider, JsonRpcProvider, JsonRpcSigner, } from "./provider-jsonrpc.js"; -export { BrowserProvider } from "./provider-browser.js"; -export { AlchemyProvider } from "./provider-alchemy.js"; -export { AnkrProvider } from "./provider-ankr.js"; -export { CloudflareProvider } from "./provider-cloudflare.js"; -export { InfuraProvider, InfuraWebSocketProvider } from "./provider-infura.js"; -export { PocketProvider } from "./provider-pocket.js"; -export { QuickNodeProvider } from "./provider-quicknode.js"; -import { IpcSocketProvider } from "./provider-ipcsocket.js"; -export { IpcSocketProvider }; -export { SocketProvider } from "./provider-socket.js"; -export { WebSocketProvider } from "./provider-websocket.js"; -export { SocketSubscriber, SocketBlockSubscriber, SocketPendingSubscriber, SocketEventSubscriber, } from "./provider-socket.js"; -export type { Subscription, Subscriber, AbstractProviderPlugin, PerformActionFilter, PerformActionTransaction, PerformActionRequest, } from "./abstract-provider.js"; -export type { ContractRunner } from "./contracts.js"; -export type { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams, } from "./formatting.js"; -export type { Networkish } from "./network.js"; -export type { EnergyCostParameters } from "./plugins-network.js"; -export type { BlockTag, TransactionRequest, PreparedTransactionRequest, EventFilter, Filter, FilterByBlockHash, OrphanFilter, ProviderEvent, TopicFilter, Provider, MinedBlock, MinedTransactionResponse, } from "./provider.js"; -export type { DebugEventBrowserProvider, Eip1193Provider, } from "./provider-browser.js"; -export type { JsonRpcPayload, JsonRpcResult, JsonRpcError, JsonRpcApiProviderOptions, JsonRpcTransactionRequest, } from "./provider-jsonrpc.js"; -export type { WebSocketCreator, WebSocketLike } from "./provider-websocket.js"; -export type { Signer } from "./signer.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/providers/index.d.ts.map b/types/providers/index.d.ts.map deleted file mode 100644 index 25fe43a45..000000000 --- a/types/providers/index.d.ts.map +++ /dev/null @@ -1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,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EACN,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACX,YAAY,EACZ,UAAU,EACV,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,YAAY,EACX,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,GACzB,MAAM,iBAAiB,CAAC;AAWzB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,YAAY,EACX,QAAQ,EACR,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,wBAAwB,GACxB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACX,yBAAyB,EACzB,eAAe,GACf,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EACX,cAAc,EACd,aAAa,EACb,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAE/E,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"} \ No newline at end of file diff --git a/types/providers/network.d.ts b/types/providers/network.d.ts deleted file mode 100644 index eb935dd8b..000000000 --- a/types/providers/network.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import type { BigNumberish } from "../utils/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { NetworkPlugin } from "./plugins-network.js"; -/** - * A Networkish can be used to allude to a Network, by specifing: - * - a [[Network]] object - * - a well-known (or registered) network name - * - a well-known (or registered) chain ID - * - an object with sufficient details to describe a network - */ -export type Networkish = Network | number | bigint | string | { - name?: string; - networkId?: number; - ensAddress?: string; - ensNetwork?: number; -}; -export declare class Network { - #private; - constructor(name: string, networkId: BigNumberish); - toJSON(): any; - /** - * The network common name. - * - * This is the canonical name, as networks migh have multiple - * names. - */ - get name(): string; - set name(value: string); - /** - * The network chain ID. - */ - get networkId(): bigint; - set networkId(value: BigNumberish); - /** - * Returns true if %%other%% matches this network. Any chain ID - * must match, and if no chain ID is present, the name must match. - * - * This method does not currently check for additional properties, - * such as ENS address or plug-in compatibility. - */ - matches(other: Networkish): boolean; - /** - * Returns the list of plugins currently attached to this Network. - */ - get plugins(): Array; - /** - * Attach a new %%plugin%% to this Network. The network name - * must be unique, excluding any fragment. - */ - attachPlugin(plugin: NetworkPlugin): this; - /** - * Return the plugin, if any, matching %%name%% exactly. Plugins - * with fragments will not be returned unless %%name%% includes - * a fragment. - */ - getPlugin(name: string): null | T; - /** - * Gets a list of all plugins that match %%name%%, with otr without - * a fragment. - */ - getPlugins(basename: string): Array; - /** - * Create a copy of this Network. - */ - clone(): Network; - /** - * Compute the intrinsic energy required for a transaction. - * - * A EnergyCostPlugin can be attached to override the default - * values. - */ - computeIntrinsicEnergy(tx: TransactionLike): number; - /** - * Returns a new Network for the %%network%% name or networkId. - */ - static from(network?: Networkish): Network; - /** - * Register %%nameOrnetworkId%% with a function which returns - * an instance of a Network representing that chain. - */ - static register(nameOrnetworkId: string | number | bigint, networkFunc: () => Network): void; -} -//# sourceMappingURL=network.d.ts.map \ No newline at end of file diff --git a/types/providers/network.d.ts.map b/types/providers/network.d.ts.map deleted file mode 100644 index 639456c16..000000000 --- a/types/providers/network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/network.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,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AAE,eAAe,GAAG,MAAM,CAqBlD;IAED;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAuDzC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,CACd,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EACzC,WAAW,EAAE,MAAM,OAAO,GACxB,IAAI,CAcN;CACD"} \ No newline at end of file diff --git a/types/providers/pagination.d.ts b/types/providers/pagination.d.ts deleted file mode 100644 index a772a85c2..000000000 --- a/types/providers/pagination.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface PaginationResult extends Array { - next(): Promise>; - totalResults: null | number; - done: boolean; -} -//# sourceMappingURL=pagination.d.ts.map \ No newline at end of file diff --git a/types/providers/pagination.d.ts.map b/types/providers/pagination.d.ts.map deleted file mode 100644 index 8ff265391..000000000 --- a/types/providers/pagination.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src.ts/providers/pagination.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACpD,IAAI,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAGrC,YAAY,EAAE,IAAI,GAAG,MAAM,CAAC;IAE5B,IAAI,EAAE,OAAO,CAAC;CACd"} \ No newline at end of file diff --git a/types/providers/plugin-fallback.d.ts b/types/providers/plugin-fallback.d.ts deleted file mode 100644 index 10009e4b3..000000000 --- a/types/providers/plugin-fallback.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AbstractProviderPlugin } from "./abstract-provider.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -export declare const PluginIdFallbackProvider = "org.corebc.plugins.provider.QualifiedPlugin"; -export declare class CheckQualifiedPlugin implements AbstractProviderPlugin { - name: string; - constructor(); - connect(provider: AbstractProvider): CheckQualifiedPlugin; - isQualified(action: PerformActionRequest, result: any): boolean; -} -export declare class PossiblyPrunedTransactionPlugin extends CheckQualifiedPlugin { - isQualified(action: PerformActionRequest, result: any): boolean; -} -//# sourceMappingURL=plugin-fallback.d.ts.map \ No newline at end of file diff --git a/types/providers/plugin-fallback.d.ts.map b/types/providers/plugin-fallback.d.ts.map deleted file mode 100644 index d639bafb3..000000000 --- a/types/providers/plugin-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugin-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugin-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAEhC,eAAO,MAAM,wBAAwB,gDACS,CAAC;AAE/C,qBAAa,oBAAqB,YAAW,sBAAsB;IAC1D,IAAI,EAAE,MAAM,CAAC;IAErB,cAIC;IAED,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,oBAAoB,CAExD;IAID,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAE9D;CACD;AAED,qBAAa,+BAAgC,SAAQ,oBAAoB;IACxE,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAU9D;CACD"} \ No newline at end of file diff --git a/types/providers/plugins-network.d.ts b/types/providers/plugins-network.d.ts deleted file mode 100644 index 80364b3ad..000000000 --- a/types/providers/plugins-network.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import type { FeeData, Provider } from "./provider.js"; -export declare class NetworkPlugin { - readonly name: string; - constructor(name: string); - clone(): NetworkPlugin; -} -export type EnergyCostParameters = { - txBase?: number; - txCreate?: number; - txDataZero?: number; - txDataNonzero?: number; - txAccessListStorageKey?: number; - txAccessListAddress?: number; -}; -export declare class EnergyCostPlugin extends NetworkPlugin implements EnergyCostParameters { - readonly effectiveBlock: number; - readonly txBase: number; - readonly txCreate: number; - readonly txDataZero: number; - readonly txDataNonzero: number; - readonly txAccessListStorageKey: number; - readonly txAccessListAddress: number; - constructor(effectiveBlock?: number, costs?: EnergyCostParameters); - clone(): EnergyCostPlugin; -} -export declare class FeeDataNetworkPlugin extends NetworkPlugin { - #private; - get feeDataFunc(): (provider: Provider) => Promise; - constructor(feeDataFunc: (provider: Provider) => Promise); - getFeeData(provider: Provider): Promise; - clone(): FeeDataNetworkPlugin; -} -//# sourceMappingURL=plugins-network.d.ts.map \ No newline at end of file diff --git a/types/providers/plugins-network.d.ts.map b/types/providers/plugins-network.d.ts.map deleted file mode 100644 index bcea34835..000000000 --- a/types/providers/plugins-network.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"plugins-network.d.ts","sourceRoot":"","sources":["../../src.ts/providers/plugins-network.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACvD,qBAAa,aAAa;IACzB,QAAQ,CAAC,IAAI,EAAG,MAAM,CAAC;IAEvB,YAAY,IAAI,EAAE,MAAM,EAEvB;IAED,KAAK,IAAI,aAAa,CAErB;CAKD;AAKD,MAAM,MAAM,oBAAoB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,qBAAa,gBACZ,SAAQ,aACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,cAAc,EAAG,MAAM,CAAC;IAEjC,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAG,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAChC,QAAQ,CAAC,sBAAsB,EAAG,MAAM,CAAC;IACzC,QAAQ,CAAC,mBAAmB,EAAG,MAAM,CAAC;IAEtC,YAAY,cAAc,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,oBAAoB,EA6BhE;IAED,KAAK,IAAI,gBAAgB,CAExB;CACD;AAED,qBAAa,oBAAqB,SAAQ,aAAa;;IAGtD,IAAI,WAAW,IAAI,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,CAE1D;IAED,YAAY,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,OAAO,CAAC,EAGhE;IAEK,UAAU,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAErD;IAED,KAAK,IAAI,oBAAoB,CAE5B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-alchemy.d.ts b/types/providers/provider-alchemy.d.ts deleted file mode 100644 index 17af0df46..000000000 --- a/types/providers/provider-alchemy.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * About Alchemy - * - * @_subsection: api/providers/thirdparty:Alchemy [providers-alchemy] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider, PerformActionRequest } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **AlchemyProvider** connects to the [[link-alchemy]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-alchemy-signup). - * - * @_docloc: api/providers/thirdparty - */ -export declare class AlchemyProvider extends JsonRpcProvider implements CommunityResourcable { - readonly apiKey: string; - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(networkId: number): AbstractProvider; - _perform(req: PerformActionRequest): Promise; - isCommunityResource(): boolean; - static getRequest(network: Network, apiKey?: string): FetchRequest; -} -//# sourceMappingURL=provider-alchemy.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-alchemy.d.ts.map b/types/providers/provider-alchemy.d.ts.map deleted file mode 100644 index 4e4c121cd..000000000 --- a/types/providers/provider-alchemy.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-alchemy.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-alchemy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKN,YAAY,EACZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EACX,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA8B/C;;;;;;;;;;GAUG;AACH,qBAAa,eACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAaxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAEK,QAAQ,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,CAyCtD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,YAAY,CAkBjE;CACD"} \ No newline at end of file diff --git a/types/providers/provider-ankr.d.ts b/types/providers/provider-ankr.d.ts deleted file mode 100644 index 77af5a3a0..000000000 --- a/types/providers/provider-ankr.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * [[link-ankr]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Ankr [providers-ankr] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -import type { JsonRpcError, JsonRpcPayload } from "./provider-jsonrpc.js"; -/** - * The **AnkrProvider** connects to the [[link-ankr]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-ankr-signup). - */ -export declare class AnkrProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API key for the Ankr connection. - */ - readonly apiKey: string; - /** - * Create a new **AnkrProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, apiKey?: null | string); - _getProvider(networkId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%apiKey%%. - */ - static getRequest(network: Network, apiKey?: null | string): FetchRequest; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-ankr.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-ankr.d.ts.map b/types/providers/provider-ankr.d.ts.map deleted file mode 100644 index d0704e281..000000000 --- a/types/providers/provider-ankr.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ankr.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ankr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoB1E;;;;;;;;GAQG;AACH,qBAAa,YACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,EAgBxD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAkBxE;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAY/D;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-browser.d.ts b/types/providers/provider-browser.d.ts deleted file mode 100644 index 2e917663a..000000000 --- a/types/providers/provider-browser.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { JsonRpcApiPollingProvider } from "./provider-jsonrpc.js"; -import type { JsonRpcError, JsonRpcPayload, JsonRpcResult, JsonRpcSigner } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -export interface Eip1193Provider { - request(request: { - method: string; - params?: Array | Record; - }): Promise; -} -export type DebugEventBrowserProvider = { - action: "sendEip1193Payload"; - payload: { - method: string; - params: Array; - }; -} | { - action: "receiveEip1193Result"; - result: any; -} | { - action: "receiveEip1193Error"; - error: Error; -}; -export declare class BrowserProvider extends JsonRpcApiPollingProvider { - #private; - constructor(core: Eip1193Provider, network?: Networkish); - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; - getRpcError(payload: JsonRpcPayload, error: JsonRpcError): Error; - hasSigner(address: number | string): Promise; - getSigner(address?: number | string): Promise; -} -//# sourceMappingURL=provider-browser.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-browser.d.ts.map b/types/providers/provider-browser.d.ts.map deleted file mode 100644 index 890c4678c..000000000 --- a/types/providers/provider-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-browser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC/B,OAAO,CAAC,OAAO,EAAE;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC1C,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,MAAM,MAAM,yBAAyB,GAClC;IACA,MAAM,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;CAC/C,GACD;IACA,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,EAAE,GAAG,CAAC;CACX,GACD;IACA,MAAM,EAAE,qBAAqB,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;CACZ,CAAC;AAEL,qBAAa,eAAgB,SAAQ,yBAAyB;;IAM7D,YAAY,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,UAAU,EAsBtD;IAEK,IAAI,CACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACtC,OAAO,CAAC,GAAG,CAAC,CAId;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAmB9C;IAED,WAAW,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,KAAK,CAe/D;IAEK,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAc1D;IAEK,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiBjE;CACD"} \ No newline at end of file diff --git a/types/providers/provider-cloudflare.d.ts b/types/providers/provider-cloudflare.d.ts deleted file mode 100644 index 869651f44..000000000 --- a/types/providers/provider-cloudflare.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * About Cloudflare - * - * @_subsection: api/providers/thirdparty:Cloudflare [providers-cloudflare] - */ -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -/** - * About Cloudflare... - */ -export declare class CloudflareProvider extends JsonRpcProvider { - constructor(_network?: Networkish); -} -//# sourceMappingURL=provider-cloudflare.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-cloudflare.d.ts.map b/types/providers/provider-cloudflare.d.ts.map deleted file mode 100644 index 8dbb47f78..000000000 --- a/types/providers/provider-cloudflare.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-cloudflare.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-cloudflare.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACtD,YAAY,QAAQ,CAAC,EAAE,UAAU,EAYhC;CACD"} \ No newline at end of file diff --git a/types/providers/provider-fallback.d.ts b/types/providers/provider-fallback.d.ts deleted file mode 100644 index bf814a2ff..000000000 --- a/types/providers/provider-fallback.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import type { PerformActionRequest } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -/** - * A configuration entry for how to use a [[Provider]]. - */ -export interface FallbackProviderConfig { - provider: AbstractProvider; - stallTimeout?: number; - priority?: number; - weight?: number; -} -/** - * The statistics and state maintained for a [[Provider]]. - */ -export interface FallbackProviderState extends Required { - blockNumber: number; - requests: number; - errorResponses: number; - lateResponses: number; - outOfSync: number; - unsupportedEvents: number; - rollingDuration: number; - score: number; -} -/** - * Additional options to configure a [[FallbackProvider]]. - */ -export type FallbackProviderOptions = { - quorum: number; - eventQuorum: number; - eventWorkers: number; -}; -/** - * A Fallback Provider. - * - */ -export declare class FallbackProvider extends AbstractProvider { - #private; - readonly quorum: number; - readonly eventQuorum: number; - readonly eventWorkers: number; - constructor(providers: Array, network?: Networkish); - get providerConfigs(): Array; - _detectNetwork(): Promise; - _translatePerform(provider: AbstractProvider, req: PerformActionRequest): Promise; - _perform(req: PerformActionRequest): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-fallback.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-fallback.d.ts.map b/types/providers/provider-fallback.d.ts.map deleted file mode 100644 index 95bda52bd..000000000 --- a/types/providers/provider-fallback.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-fallback.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-fallback.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAiC/C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IAEtC,QAAQ,EAAE,gBAAgB,CAAC;IAI3B,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ,CAAC,sBAAsB,CAAC;IAE9E,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,cAAc,EAAE,MAAM,CAAC;IAGvB,aAAa,EAAE,MAAM,CAAC;IAGtB,SAAS,EAAE,MAAM,CAAC;IAGlB,iBAAiB,EAAE,MAAM,CAAC;IAG1B,eAAe,EAAE,MAAM,CAAC;IAGxB,KAAK,EAAE,MAAM,CAAC;CACd;AAsCD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAGrC,MAAM,EAAE,MAAM,CAAC;IAIf,WAAW,EAAE,MAAM,CAAC;IAKpB,YAAY,EAAE,MAAM,CAAC;CACrB,CAAC;AA4MF;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAO9B,YACC,SAAS,EAAE,KAAK,CAAC,gBAAgB,GAAG,sBAAsB,CAAC,EAC3D,OAAO,CAAC,EAAE,UAAU,EAwBpB;IAED,IAAI,eAAe,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAUlD;IAEK,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAIvC;IAOK,iBAAiB,CACtB,QAAQ,EAAE,gBAAgB,EAC1B,GAAG,EAAE,oBAAoB,GACvB,OAAO,CAAC,GAAG,CAAC,CAyCd;IA4QK,QAAQ,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,CAAC,CAAC,CAmD7D;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAK7B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-infura.d.ts b/types/providers/provider-infura.d.ts deleted file mode 100644 index e09baec46..000000000 --- a/types/providers/provider-infura.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -/** - * [[link-infura]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Sepolia Testnet (``sepolia``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:INFURA [providers-infura] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import { WebSocketProvider } from "./provider-websocket.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **InfuraWebSocketProvider** connects to the [[link-infura]] - * WebSocket end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraWebSocketProvider extends WebSocketProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - constructor(network?: Networkish, projectId?: string); - isCommunityResource(): boolean; -} -/** - * The **InfuraProvider** connects to the [[link-infura]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-infura-signup). - */ -export declare class InfuraProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Project ID for the INFURA connection. - */ - readonly projectId: string; - /** - * The Project Secret. - * - * If null, no authenticated requests are made. This should not - * be used outside of private contexts. - */ - readonly projectSecret: null | string; - /** - * Creates a new **InfuraProvider**. - */ - constructor(_network?: Networkish, projectId?: null | string, projectSecret?: null | string); - _getProvider(networkId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Creates a new **InfuraWebSocketProvider**. - */ - static getWebSocketProvider(network?: Networkish, projectId?: string): InfuraWebSocketProvider; - /** - * Returns a prepared request for connecting to %%network%% - * with %%projectId%% and %%projectSecret%%. - */ - static getRequest(network: Network, projectId?: null | string, projectSecret?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-infura.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-infura.d.ts.map b/types/providers/provider-infura.d.ts.map deleted file mode 100644 index 2d942d185..000000000 --- a/types/providers/provider-infura.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-infura.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-infura.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,E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B;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,EACzB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC3B,YAAY,CAwBd;CACD"} \ No newline at end of file diff --git a/types/providers/provider-ipcsocket-browser.d.ts b/types/providers/provider-ipcsocket-browser.d.ts deleted file mode 100644 index 6aae787dc..000000000 --- a/types/providers/provider-ipcsocket-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const IpcSocketProvider: undefined; -export { IpcSocketProvider }; -//# sourceMappingURL=provider-ipcsocket-browser.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-ipcsocket-browser.d.ts.map b/types/providers/provider-ipcsocket-browser.d.ts.map deleted file mode 100644 index e49cd58d3..000000000 --- a/types/providers/provider-ipcsocket-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket-browser.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,iBAAiB,WAAY,CAAC;AAEpC,OAAO,EAAE,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/types/providers/provider-ipcsocket.d.ts b/types/providers/provider-ipcsocket.d.ts deleted file mode 100644 index 9f92c9d4f..000000000 --- a/types/providers/provider-ipcsocket.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// -import { SocketProvider } from "./provider-socket.js"; -import type { Socket } from "net"; -import type { Networkish } from "./network.js"; -export declare class IpcSocketProvider extends SocketProvider { - #private; - get socket(): Socket; - constructor(path: string, network?: Networkish); - destroy(): void; - _write(message: string): Promise; -} -//# sourceMappingURL=provider-ipcsocket.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-ipcsocket.d.ts.map b/types/providers/provider-ipcsocket.d.ts.map deleted file mode 100644 index 93bec7dd7..000000000 --- a/types/providers/provider-ipcsocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-ipcsocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-ipcsocket.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB/C,qBAAa,iBAAkB,SAAQ,cAAc;;IAEpD,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EA+B7C;IAED,OAAO,IAAI,IAAI,CAKd;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/types/providers/provider-jsonrpc.d.ts b/types/providers/provider-jsonrpc.d.ts deleted file mode 100644 index f4dc34d1e..000000000 --- a/types/providers/provider-jsonrpc.d.ts +++ /dev/null @@ -1,267 +0,0 @@ -/** - * About JSON-RPC... - * - * @_section: api/providers/jsonrpc:JSON-RPC Provider [about-jsonrpcProvider] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { AbstractSigner } from "./abstract-signer.js"; -import { Network } from "./network.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { PerformActionRequest, Subscriber, Subscription } from "./abstract-provider.js"; -import type { Networkish } from "./network.js"; -import type { Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -/** - * A JSON-RPC payload, which are sent to a JSON-RPC server. - */ -export type JsonRpcPayload = { - id: number; - method: string; - params: Array | Record; - jsonrpc: "2.0"; -}; -/** - * A JSON-RPC result, which are returned on success from a JSON-RPC server. - */ -export type JsonRpcResult = { - id: number; - result: any; -}; -/** - * A JSON-RPC error, which are returned on failure from a JSON-RPC server. - */ -export type JsonRpcError = { - id: number; - error: { - code: number; - message?: string; - data?: any; - }; -}; -/** - * When subscribing to the ``"debug"`` event, the [[Listener]] will - * receive this object as the first parameter. - */ -export type DebugEventJsonRpcApiProvider = { - action: "sendRpcPayload"; - payload: JsonRpcPayload | Array; -} | { - action: "receiveRpcResult"; - result: Array; -} | { - action: "receiveRpcError"; - error: Error; -}; -/** - * Options for configuring a [[JsonRpcApiProvider]]. Much of this - * is targetted towards sub-classes, which often will not expose - * any of these options to their consumers. - * - * **``polling``** - use the polling strategy is used immediately - * for events; otherwise, attempt to use filters and fall back onto - * polling (default: ``false``) - * - * **``staticNetwork``** - do not request chain ID on requests to - * validate the underlying chain has not changed (default: ``null``) - * - * This should **ONLY** be used if it is **certain** that the network - * cannot change, such as when using INFURA (since the URL dictates the - * network). If the network is assumed static and it does change, this - * can have tragic consequences. For example, this **CANNOT** be used - * with MetaMask, since the used can select a new network from the - * drop-down at any time. - * - * **``batchStallTime``** - how long (ms) to aggregate requests into a - * single batch. ``0`` indicates batching will only encompass the current - * event loop. If ``batchMaxCount = 1``, this is ignored. (default: ``10``) - * - * **``batchMaxSize``** - target maximum size (bytes) to allow per batch - * request (default: 1Mb) - * - * **``batchMaxCount``** - maximum number of requests to allow in a batch. - * If ``batchMaxCount = 1``, then batching is disabled. (default: ``100``) - */ -export type JsonRpcApiProviderOptions = { - polling?: boolean; - staticNetwork?: null | Network; - batchStallTime?: number; - batchMaxSize?: number; - batchMaxCount?: number; -}; -export interface JsonRpcTransactionRequest { - from?: string; - to?: string; - data?: string; - networkId?: string; - type?: string; - energy?: string; - energyPrice?: string; - nonce?: string; - value?: string; - accessList?: Array<{ - address: string; - storageKeys: Array; - }>; -} -export declare class JsonRpcSigner extends AbstractSigner { - address: string; - constructor(provider: JsonRpcApiProvider, address: string); - connect(provider: null | Provider): Signer; - getAddress(): Promise; - populateTransaction(tx: TransactionRequest): Promise>; - sendUncheckedTransaction(_tx: TransactionRequest): Promise; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(_tx: TransactionRequest): Promise; - signMessage(_message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, _value: Record): Promise; - unlock(password: string): Promise; - _legacySignMessage(_message: string | Uint8Array): Promise; -} -/** - * The JsonRpcApiProvider is an abstract class and **MUST** be - * sub-classed. - * - * It provides the base for all JSON-RPC-based Provider interaction. - * - * Sub-classing Notes: - * - a sub-class MUST override _send - * - a sub-class MUST call the `_start()` method once connected - */ -export declare abstract class JsonRpcApiProvider extends AbstractProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - /** - * Returns the value associated with the option %%key%%. - * - * Sub-classes can use this to inquire about configuration options. - */ - _getOption(key: K): JsonRpcApiProviderOptions[K]; - /** - * Gets the [[Network]] this provider has committed to. On each call, the network - * is detected, and if it has changed, the call will reject. - */ - get _network(): Network; - /** - * Sends a JSON-RPC %%payload%% (or a batch) to the underlying channel. - * - * Sub-classes **MUST** override this. - */ - abstract _send(payload: JsonRpcPayload | Array): Promise>; - /** - * Resolves to the non-normalized value by performing %%req%%. - * - * Sub-classes may override this to modify behavior of actions, - * and should generally call ``super._perform`` as a fallback. - */ - _perform(req: PerformActionRequest): Promise; - /** - * Sub-classes may override this; it detects the *actual* network that - * we are **currently** connected to. - * - * Keep in mind that [[send]] may only be used once [[ready]], otherwise the - * _send primitive must be used instead. - */ - _detectNetwork(): Promise; - /** - * Sub-classes **MUST** call this. Until [[_start]] has been called, no calls - * will be passed to [[_send]] from [[send]]. If it is overridden, then - * ``super._start()`` **MUST** be called. - * - * Calling it multiple times is safe and has no effect. - */ - _start(): void; - /** - * Resolves once the [[_start]] has been called. This can be used in - * sub-classes to defer sending data until the connection has been - * established. - */ - _waitUntilReady(): Promise; - /** - * Return a Subscriber that will manage the %%sub%%. - * - * Sub-classes may override this to modify the behavior of - * subscription management. - */ - _getSubscriber(sub: Subscription): Subscriber; - /** - * Returns true only if the [[_start]] has been called. - */ - get ready(): boolean; - /** - * Returns %%tx%% as a normalized JSON-RPC transaction request, - * which has all values hexlified and any numeric values converted - * to Quantity values. - */ - getRpcTransaction(tx: TransactionRequest): JsonRpcTransactionRequest; - /** - * Returns the request method and arguments required to perform - * %%req%%. - */ - getRpcRequest(req: PerformActionRequest): null | { - method: string; - args: Array; - }; - /** - * Returns an CoreBC-style Error for the given JSON-RPC error - * %%payload%%, coalescing the various strings and error shapes - * that different nodes return, coercing them into a machine-readable - * standardized error. - */ - getRpcError(payload: JsonRpcPayload, _error: JsonRpcError): Error; - /** - * Requests the %%method%% with %%params%% via the JSON-RPC protocol - * over the underlying channel. This can be used to call methods - * on the backend that do not have a high-level API within the Provider - * API. - * - * This method queues requests according to the batch constraints - * in the options, assigns the request a unique ID. - * - * **Do NOT override** this method in sub-classes; instead - * override [[_send]] or force the options values in the - * call to the constructor to modify this method's behavior. - */ - send(method: string, params: Array | Record): Promise; - /** - * Resolves to the [[Signer]] account for %%address%% managed by - * the client. - * - * If the %%address%% is a number, it is used as an index in the - * the accounts from [[listAccounts]]. - * - * This can only be used on clients which manage accounts (such as - * Geth with imported account or MetaMask). - * - * Throws if the account doesn't exist. - */ - getSigner(address?: number | string): Promise; - listAccounts(): Promise>; -} -export declare abstract class JsonRpcApiPollingProvider extends JsonRpcApiProvider { - #private; - constructor(network?: Networkish, options?: JsonRpcApiProviderOptions); - _getSubscriber(sub: Subscription): Subscriber; - /** - * The polling interval (default: 4000 ms) - */ - get pollingInterval(): number; - set pollingInterval(value: number); -} -/** - * The JsonRpcProvider is one of the most common Providers, - * which performs all operations over HTTP (or HTTPS) requests. - * - * Events are processed by polling the backend for the current block - * number; when it advances, all block-base events are then checked - * for updates. - */ -export declare class JsonRpcProvider extends JsonRpcApiPollingProvider { - #private; - constructor(url?: string | FetchRequest, network?: Networkish, options?: JsonRpcApiProviderOptions); - _getConnection(): FetchRequest; - send(method: string, params: Array | Record): Promise; - _send(payload: JsonRpcPayload | Array): Promise>; -} -//# sourceMappingURL=provider-jsonrpc.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-jsonrpc.d.ts.map b/types/providers/provider-jsonrpc.d.ts.map deleted file mode 100644 index 0635f491a..000000000 --- a/types/providers/provider-jsonrpc.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-jsonrpc.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-jsonrpc.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,EAUN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAuB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAOvC,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EACX,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACX,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuD1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACzC,OAAO,EAAE,KAAK,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,GAAG,CAAC;CACZ,CAA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C,GAAG,OAAO,CAAC,GAAG,CAAC,CAgB3E;IAED;;;;;;;;;;;OAWG;IACG,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CA8BjE;IAEK,YAAY,IAAI,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAGlD;CACD;AAED,8BAAsB,yBAA0B,SAAQ,kBAAkB;;IAEzE,YAAY,OAAO,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,yBAAyB,EAIpE;IAED,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAM5C;IAED;;OAEG;IACH,IAAI,eAAe,IAAI,MAAM,CAE5B;IACD,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAUhC;CACD;AAED;;;;;;;GAOG;AACH,qBAAa,eAAgB,SAAQ,yBAAyB;;IAG7D,YACC,GAAG,CAAC,EAAE,MAAM,GAAG,YAAY,EAC3B,OAAO,CAAC,EAAE,UAAU,EACpB,OAAO,CAAC,EAAE,yBAAyB,EAYnC;IAED,cAAc,IAAI,YAAY,CAE7B;IAEK,IAAI,CACT,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACtC,OAAO,CAAC,GAAG,CAAC,CAOd;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAe/B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-pocket.d.ts b/types/providers/provider-pocket.d.ts deleted file mode 100644 index 01b2fd311..000000000 --- a/types/providers/provider-pocket.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * [[link-pocket]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Polygon (``matic``) - * - Arbitrum (``arbitrum``) - * - * @_subsection: api/providers/thirdparty:Pocket [providers-pocket] - */ -import { FetchRequest } from "../utils/index.js"; -import { AbstractProvider } from "./abstract-provider.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **PocketProvider** connects to the [[link-pocket]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API key is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-pocket-signup). - */ -export declare class PocketProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The Application ID for the Pocket connection. - */ - readonly applicationId: string; - /** - * The Application Secret for making authenticated requests - * to the Pocket connection. - */ - readonly applicationSecret: null | string; - /** - * Create a new **PocketProvider**. - * - * By default connecting to ``mainnet`` with a highly throttled - * API key. - */ - constructor(_network?: Networkish, applicationId?: null | string, applicationSecret?: null | string); - _getProvider(networkId: number): AbstractProvider; - /** - * Returns a prepared request for connecting to %%network%% with - * %%applicationId%%. - */ - static getRequest(network: Network, applicationId?: null | string, applicationSecret?: null | string): FetchRequest; - isCommunityResource(): boolean; -} -//# sourceMappingURL=provider-pocket.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-pocket.d.ts.map b/types/providers/provider-pocket.d.ts.map deleted file mode 100644 index aaf617488..000000000 --- a/types/providers/provider-pocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-pocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-pocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAoB/C;;;;;;;;GAQG;AACH,qBAAa,cACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAG,IAAI,GAAG,MAAM,CAAC;IAE3C;;;;;OAKG;IACH,YACC,QAAQ,CAAC,EAAE,UAAU,EACrB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,EA0BjC;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAShD;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAChB,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,EAC7B,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,GAC/B,YAAY,CAsBd;IAED,mBAAmB,IAAI,OAAO,CAE7B;CACD"} \ No newline at end of file diff --git a/types/providers/provider-quicknode.d.ts b/types/providers/provider-quicknode.d.ts deleted file mode 100644 index 610dc234a..000000000 --- a/types/providers/provider-quicknode.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * [[link-quicknode]] provides a third-party service for connecting to - * various blockchains over JSON-RPC. - * - * **Supported Networks** - * - * - Core Mainnet (``mainnet``) - * - Goerli Testnet (``goerli``) - * - Arbitrum (``arbitrum``) - * - Arbitrum Goerli Testnet (``arbitrum-goerli``) - * - Optimism (``optimism``) - * - Optimism Goerli Testnet (``optimism-goerli``) - * - Polygon (``matic``) - * - Polygon Mumbai Testnet (``matic-mumbai``) - * - * @_subsection: api/providers/thirdparty:QuickNode [providers-quicknode] - */ -import { FetchRequest } from "../utils/index.js"; -import { Network } from "./network.js"; -import { JsonRpcProvider } from "./provider-jsonrpc.js"; -import type { AbstractProvider } from "./abstract-provider.js"; -import type { CommunityResourcable } from "./community.js"; -import type { Networkish } from "./network.js"; -/** - * The **QuickNodeProvider** connects to the [[link-quicknode]] - * JSON-RPC end-points. - * - * By default, a highly-throttled API token is used, which is - * appropriate for quick prototypes and simple scripts. To - * gain access to an increased rate-limit, it is highly - * recommended to [sign up here](link-quicknode). - */ -export declare class QuickNodeProvider extends JsonRpcProvider implements CommunityResourcable { - /** - * The API token. - */ - readonly token: string; - /** - * Creates a new **QuickNodeProvider**. - */ - constructor(_network?: Networkish, token?: null | string); - _getProvider(networkId: number): AbstractProvider; - isCommunityResource(): boolean; - /** - * Returns a new request prepared for %%network%% and the - * %%token%%. - */ - static getRequest(network: Network, token?: null | string): FetchRequest; -} -//# sourceMappingURL=provider-quicknode.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-quicknode.d.ts.map b/types/providers/provider-quicknode.d.ts.map deleted file mode 100644 index f3be4df32..000000000 --- a/types/providers/provider-quicknode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-quicknode.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-quicknode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAEN,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA0B/C;;;;;;;;GAQG;AACH,qBAAa,iBACZ,SAAQ,eACR,YAAW,oBAAoB;IAE/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;OAEG;IACH,YAAY,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,EAavD;IAED,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAKhD;IAED,mBAAmB,IAAI,OAAO,CAE7B;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,YAAY,CAmBvE;CACD"} \ No newline at end of file diff --git a/types/providers/provider-socket.d.ts b/types/providers/provider-socket.d.ts deleted file mode 100644 index 7ee5054ce..000000000 --- a/types/providers/provider-socket.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Generic long-lived socket provider. - * - * Sub-classing notes - * - a sub-class MUST call the `_start()` method once connected - * - a sub-class MUST override the `_write(string)` method - * - a sub-class MUST call `_processMessage(string)` for each message - * - * @_subsection: api/providers/abstract-provider - */ -import { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -import type { Subscriber, Subscription } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcError, JsonRpcPayload, JsonRpcResult } from "./provider-jsonrpc.js"; -import type { Networkish } from "./network.js"; -export declare class SocketSubscriber implements Subscriber { - #private; - get filter(): Array; - constructor(provider: SocketProvider, filter: Array); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; - _handleMessage(message: any): void; - _emit(provider: SocketProvider, message: any): Promise; -} -export declare class SocketBlockSubscriber extends SocketSubscriber { - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -export declare class SocketPendingSubscriber extends SocketSubscriber { - constructor(provider: SocketProvider); - _emit(provider: SocketProvider, message: any): Promise; -} -export declare class SocketEventSubscriber extends SocketSubscriber { - #private; - get logFilter(): EventFilter; - constructor(provider: SocketProvider, filter: EventFilter); - _emit(provider: SocketProvider, message: any): Promise; -} -/** - * SocketProvider... - * - */ -export declare class SocketProvider extends JsonRpcApiProvider { - #private; - constructor(network?: Networkish); - _getSubscriber(sub: Subscription): Subscriber; - _register(filterId: number | string, subscriber: SocketSubscriber): void; - _send(payload: JsonRpcPayload | Array): Promise>; - _processMessage(message: string): Promise; - _write(message: string): Promise; -} -//# sourceMappingURL=provider-socket.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-socket.d.ts.map b/types/providers/provider-socket.d.ts.map deleted file mode 100644 index e919560e4..000000000 --- a/types/providers/provider-socket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-socket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-socket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,aAAa,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU/C,qBAAa,gBAAiB,YAAW,UAAU;;IAIlD,IAAI,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAEvB;IAOD,YAAY,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,EAMvD;IAED,KAAK,IAAI,IAAI,CAOZ;IAED,IAAI,IAAI,IAAI,CAKX;IAID,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAQrC;IAED,MAAM,IAAI,IAAI,CAEb;IAED,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAmBjC;IAEK,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACD;AAED,qBAAa,qBAAsB,SAAQ,gBAAgB;IAC1D,YAAY,QAAQ,EAAE,cAAc,EAEnC;IAEK,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACD;AAED,qBAAa,uBAAwB,SAAQ,gBAAgB;IAC5D,YAAY,QAAQ,EAAE,cAAc,EAEnC;IAEK,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACD;AAED,qBAAa,qBAAsB,SAAQ,gBAAgB;;IAE1D,IAAI,SAAS,IAAI,WAAW,CAE3B;IAED,YAAY,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAGxD;IAEK,KAAK,CAAC,QAAQ,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAKjE;CACD;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;;IAiBrD,YAAY,OAAO,CAAC,EAAE,UAAU,EAK/B;IAYD,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAkB5C;IAED,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI,CASvE;IAEK,KAAK,CACV,OAAO,EAAE,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,GAC7C,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,YAAY,CAAC,CAAC,CAuB9C;IAkBK,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCpD;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;CACD"} \ No newline at end of file diff --git a/types/providers/provider-websocket.d.ts b/types/providers/provider-websocket.d.ts deleted file mode 100644 index 9938502d0..000000000 --- a/types/providers/provider-websocket.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { SocketProvider } from "./provider-socket.js"; -import type { Networkish } from "./network.js"; -export interface WebSocketLike { - onopen: null | ((...args: Array) => any); - onmessage: null | ((...args: Array) => any); - onerror: null | ((...args: Array) => any); - readyState: number; - send(payload: any): void; - close(code?: number, reason?: string): void; -} -export type WebSocketCreator = () => WebSocketLike; -export declare class WebSocketProvider extends SocketProvider { - #private; - get websocket(): WebSocketLike; - constructor(url: string | WebSocketLike | WebSocketCreator, network?: Networkish); - _write(message: string): Promise; - destroy(): Promise; -} -//# sourceMappingURL=provider-websocket.d.ts.map \ No newline at end of file diff --git a/types/providers/provider-websocket.d.ts.map b/types/providers/provider-websocket.d.ts.map deleted file mode 100644 index 57f785f9c..000000000 --- a/types/providers/provider-websocket.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider-websocket.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider-websocket.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAC9C,SAAS,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IACjD,OAAO,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;IAE/C,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC;AAEnD,qBAAa,iBAAkB,SAAQ,cAAc;;IAIpD,IAAI,SAAS,IAAI,aAAa,CAK7B;IAED,YACC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,gBAAgB,EAC9C,OAAO,CAAC,EAAE,UAAU,EA4CpB;IAEK,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3C;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAM7B;CACD"} \ No newline at end of file diff --git a/types/providers/provider.d.ts b/types/providers/provider.d.ts deleted file mode 100644 index 68556f754..000000000 --- a/types/providers/provider.d.ts +++ /dev/null @@ -1,623 +0,0 @@ -import type { AddressLike, NameResolver } from "../address/index.js"; -import type { BigNumberish, EventEmitterable } from "../utils/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { Network } from "./network.js"; -export type BlockTag = BigNumberish | string; -import { BlockParams, LogParams, TransactionReceiptParams, TransactionResponseParams } from "./formatting.js"; -/** - * A **FeeData** wraps all the fee-related values associated with - * the network. - */ -export declare class FeeData { - /** - * The energy price for legacy networks. - */ - readonly energyPrice: null | bigint; - constructor(energyPrice?: null | bigint); - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; -} -export interface TransactionRequest { - type?: null | number; - to?: null | AddressLike; - from?: null | AddressLike; - nonce?: null | number; - energyLimit?: null | BigNumberish; - energyPrice?: null | BigNumberish; - data?: null | string; - value?: null | BigNumberish; - networkId?: null | BigNumberish; - customData?: any; - blockTag?: BlockTag; - enableCcipRead?: boolean; -} -export interface PreparedTransactionRequest { - to?: AddressLike; - from?: AddressLike; - nonce?: number; - energyLimit?: bigint; - energyPrice?: bigint; - data?: string; - value?: bigint; - networkId?: bigint; - customData?: any; - blockTag?: BlockTag; - enableCcipRead?: boolean; -} -export declare function copyRequest(req: TransactionRequest): PreparedTransactionRequest; -/** - * An Interface to indicate a [[Block]] has been included in the - * blockchain. This asserts a Type Guard that necessary properties - * are non-null. - * - * Before a block is included, it is a //pending// block. - */ -export interface MinedBlock extends Block { - readonly number: number; - readonly hash: string; - readonly timestamp: number; - readonly date: Date; - readonly miner: string; -} -/** - * A **Block** represents the data associated with a full block on - * Core. - */ -export declare class Block implements BlockParams, Iterable { - #private; - /** - * The provider connected to the block used to fetch additional details - * if necessary. - */ - readonly provider: Provider; - /** - * The block number, sometimes called the block height. This is a - * sequential number that is one higher than the parent block. - */ - readonly number: number; - /** - * The block hash. - */ - readonly hash: null | string; - /** - * The timestamp for this block, which is the number of seconds since - * epoch that this block was included. - */ - readonly timestamp: number; - /** - * The block hash of the parent block. - */ - readonly parentHash: string; - /** - * The nonce. - * - * On legacy networks, this is the random number inserted which - * permitted the difficulty target to be reached. - */ - readonly nonce: string; - /** - * The difficulty target. - * - * On legacy networks, this is the proof-of-work target required - * for a block to meet the protocol rules to be included. - * - * On modern networks, this is a random number arrived at using - * randao. @TODO: Find links? - */ - readonly difficulty: bigint; - /** - * The total energy limit for this block. - */ - readonly energyLimit: bigint; - /** - * The total energy used in this block. - */ - readonly energyUsed: bigint; - /** - * The miner coinbase address, wihch receives any subsidies for - * including this block. - */ - readonly miner: string; - /** - * Any extra data the validator wished to include. - */ - readonly extraData: string; - /** - * The base fee per energy that all transactions in this block were - * charged. - * - * This adjusts after each block, depending on how congested the network - * is. - */ - readonly baseFeePerEnergy: null | bigint; - /** - * Create a new **Block** object. - * - * This should generally not be necessary as the unless implementing a - * low-level library. - */ - constructor(block: BlockParams, provider: Provider); - /** - * Returns the list of transaction hashes. - */ - get transactions(): ReadonlyArray; - /** - * Returns the complete transactions for blocks which - * prefetched them, by passing ``true`` to %%prefetchTxs%% - * into [[provider_getBlock]]. - */ - get prefetchedTransactions(): Array; - /** - * Returns a JSON-friendly value. - */ - toJSON(): any; - [Symbol.iterator](): Iterator; - /** - * The number of transactions in this block. - */ - get length(): number; - /** - * The [[link-js-date]] this block was included at. - */ - get date(): null | Date; - /** - * Get the transaction at %%indexe%% within this block. - */ - getTransaction(indexOrHash: number | string): Promise; - getPrefetchedTransaction(indexOrHash: number | string): TransactionResponse; - /** - * Has this block been mined. - * - * If true, the block has been typed-gaurded that all mined - * properties are non-null. - */ - isMined(): this is MinedBlock; - /** - * - */ - isLondon(): this is Block & { - baseFeePerEnergy: bigint; - }; - orphanedEvent(): OrphanFilter; -} -export declare class Log implements LogParams { - readonly provider: Provider; - readonly transactionHash: string; - readonly blockHash: string; - readonly blockNumber: number; - readonly removed: boolean; - readonly address: string; - readonly data: string; - readonly topics: ReadonlyArray; - readonly index: number; - readonly transactionIndex: number; - constructor(log: LogParams, provider: Provider); - toJSON(): any; - getBlock(): Promise; - getTransaction(): Promise; - getTransactionReceipt(): Promise; - removedEvent(): OrphanFilter; -} -export declare class TransactionReceipt implements TransactionReceiptParams, Iterable { - #private; - readonly provider: Provider; - readonly to: null | string; - readonly from: string; - readonly contractAddress: null | string; - readonly hash: string; - readonly index: number; - readonly blockHash: string; - readonly blockNumber: number; - readonly logsBloom: string; - readonly energyUsed: bigint; - readonly cumulativeEnergyUsed: bigint; - readonly energyPrice: bigint; - readonly type: number; - readonly status: null | number; - readonly root: null | string; - constructor(tx: TransactionReceiptParams, provider: Provider); - get logs(): ReadonlyArray; - toJSON(): any; - get length(): number; - [Symbol.iterator](): Iterator; - get fee(): bigint; - getBlock(): Promise; - getTransaction(): Promise; - getResult(): Promise; - confirmations(): Promise; - removedEvent(): OrphanFilter; - reorderedEvent(other?: TransactionResponse): OrphanFilter; -} -export interface MinedTransactionResponse extends TransactionResponse { - blockNumber: number; - blockHash: string; - date: Date; -} -export declare class TransactionResponse implements TransactionLike, TransactionResponseParams { - #private; - /** - * The provider this is connected to, which will influence how its - * methods will resolve its async inspection methods. - */ - readonly provider: Provider; - /** - * The block number of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockNumber: null | number; - /** - * The blockHash of the block that this transaction was included in. - * - * This is ``null`` for pending transactions. - */ - readonly blockHash: null | string; - /** - * The index within the block that this transaction resides at. - */ - readonly index: number; - /** - * The transaction hash. - */ - readonly hash: string; - /** - * The [[link-eip-2718]] transaction envelope type. This is - * ``0`` for legacy transactions types. - */ - readonly type: number; - /** - * The receiver of this transaction. - * - * If ``null``, then the transaction is an initcode transaction. - * This means the result of executing the [[data]] will be deployed - * as a new contract on chain (assuming it does not revert) and the - * address may be computed using [[getCreateAddress]]. - */ - readonly to: null | string; - /** - * The sender of this transaction. It is implicitly computed - * from the transaction pre-image hash (as the digest) and the - * [[signature]] using ecrecover. - */ - readonly from: string; - /** - * The nonce, which is used to prevent replay attacks and offer - * a method to ensure transactions from a given sender are explicitly - * ordered. - * - * When sending a transaction, this must be equal to the number of - * transactions ever sent by [[from]]. - */ - readonly nonce: number; - /** - * The maximum units of energy this transaction can consume. If execution - * exceeds this, the entries transaction is reverted and the sender - * is charged for the full amount, despite not state changes being made. - */ - readonly energyLimit: bigint; - /** - * The energy price can have various values, depending on the network. - * - * In modern networks, for transactions that are included this is - * the //effective energy price// (the fee per energy that was actually - * charged), while for transactions that have not been included yet - * is the [[maxFeePerEnergy]]. - * - * For legacy transactions, or transactions on legacy networks, this - * is the fee that will be charged per unit of energy the transaction - * consumes. - */ - readonly energyPrice: bigint; - /** - * The data. - */ - readonly data: string; - /** - * The value, in ore. Use [[formatXCB]] to format this value - * as xcb. - */ - readonly value: bigint; - /** - * The chain ID. - */ - readonly networkId: bigint; - /** - * The signature. - */ - readonly signature: string; - /** - * Create a new TransactionResponse with %%tx%% parameters - * connected to %%provider%%. - */ - constructor(tx: TransactionResponseParams, provider: Provider); - /** - * Returns a JSON representation of this transaction. - */ - toJSON(): any; - /** - * Resolves to the Block that this transaction was included in. - * - * This will return null if the transaction has not been included yet. - */ - getBlock(): Promise; - /** - * Resolves to this transaction being re-requested from the - * provider. This can be used if you have an unmined transaction - * and wish to get an up-to-date populated instance. - */ - getTransaction(): Promise; - /** - * Resolves once this transaction has been mined and has - * %%confirms%% blocks including it (default: ``1``) with an - * optional %%timeout%%. - * - * This can resolve to ``null`` only if %%confirms%% is ``0`` - * and the transaction has not been mined, otherwise this will - * wait until enough confirmations have completed. - */ - wait(_confirms?: number, _timeout?: number): Promise; - /** - * Returns ``true`` if this transaction has been included. - * - * This is effective only as of the time the TransactionResponse - * was instantiated. To get up-to-date information, use - * [[getTransaction]]. - * - * This provides a Type Guard that this transaction will have - * non-null property values for properties that are null for - * unmined transactions. - */ - isMined(): this is MinedTransactionResponse; - /** - * Returns true if the transaction is a legacy (i.e. ``type == 0``) - * transaction. - * - * This provides a Type Guard that this transaction will have - * the ``null``-ness for hardfork-specific properties set correctly. - */ - isLegacy(): this is TransactionResponse & { - accessList: null; - maxFeePerEnergy: null; - maxPriorityFeePerEnergy: null; - }; - /** - * Returns a filter which can be used to listen for orphan events - * that evict this transaction. - */ - removedEvent(): OrphanFilter; - /** - * Returns a filter which can be used to listen for orphan events - * that re-order this event against %%other%%. - */ - reorderedEvent(other?: TransactionResponse): OrphanFilter; - /** - * Returns a new TransactionResponse instance which has the ability to - * detect (and throw an error) if the transaction is replaced, which - * will begin scanning at %%startBlock%%. - * - * This should generally not be used by developers and is intended - * primarily for internal use. Setting an incorrect %%startBlock%% can - * have devastating performance consequences if used incorrectly. - */ - replaceableTransaction(startBlock: number): TransactionResponse; -} -/** - * An Orphan Filter allows detecting when an orphan block has - * resulted in dropping a block or transaction or has resulted - * in transactions changing order. - * - * Not currently fully supported. - */ -export type OrphanFilter = { - orphan: "drop-block"; - hash: string; - number: number; -} | { - orphan: "drop-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "reorder-transaction"; - tx: { - hash: string; - blockHash: string; - blockNumber: number; - }; - other?: { - hash: string; - blockHash: string; - blockNumber: number; - }; -} | { - orphan: "drop-log"; - log: { - transactionHash: string; - blockHash: string; - blockNumber: number; - address: string; - data: string; - topics: ReadonlyArray; - index: number; - }; -}; -/** - * A **TopicFilter** provides a struture to define bloom-filter - * queries. - * - * Each field that is ``null`` matches **any** value, a field that is - * a ``string`` must match exactly that value and and ``array`` is - * effectively an ``OR``-ed set, where any one of those values must - * match. - */ -export type TopicFilter = Array>; -export interface EventFilter { - address?: AddressLike | Array; - topics?: TopicFilter; -} -export interface Filter extends EventFilter { - fromBlock?: BlockTag; - toBlock?: BlockTag; -} -export interface FilterByBlockHash extends EventFilter { - blockHash?: string; -} -export type ProviderEvent = string | Array> | EventFilter | OrphanFilter; -/** - * A **Provider** is the primary method to interact with the read-only - * content on Core. - * - * It allows access to details about accounts, blocks and transactions - * and the ability to query event logs and simulate contract execution. - * - * Account data includes the [balance](getBalance), - * [transaction count](getTransactionCount), [code](getCode) and - * [state trie storage](getStorage). - * - * Simulating execution can be used to [call](call), - * [estimate energy](estimateEnergy) and - * [get transaction results](getTransactionResult). - * - * The [[broadcastTransaction]] is the only method which allows updating - * the blockchain, but it is usually accessed by a [[Signer]], since a - * private key must be used to sign the transaction before it can be - * broadcast. - */ -export interface Provider extends ContractRunner, EventEmitterable, NameResolver { - /** - * The provider iteself. - * - * This is part of the necessary API for executing a contract, as - * it provides a common property on any [[ContractRunner]] that - * can be used to access the read-only portion of the runner. - */ - provider: this; - /** - * Shutdown any resources this provider is using. No additional - * calls should be made to this provider after calling this. - */ - destroy(): void; - /** - * Get the current block number. - */ - getBlockNumber(): Promise; - /** - * Get the connected [[Network]]. - */ - getNetwork(): Promise; - /** - * Get the best guess at the recommended [[FeeData]]. - */ - getFeeData(): Promise; - /** - * Get the account balance (in ore) of %%address%%. If %%blockTag%% - * is specified and the node supports archive access for that - * %%blockTag%%, the balance is as of that [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getBalance(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the number of transactions ever sent for %%address%%, which - * is used as the ``nonce`` when sending a transaction. If - * %%blockTag%% is specified and the node supports archive access - * for that %%blockTag%%, the transaction count is as of that - * [[BlockTag]]. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getTransactionCount(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the bytecode for %%address%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getCode(address: AddressLike, blockTag?: BlockTag): Promise; - /** - * Get the storage slot value for %%address%% at slot %%position%%. - * - * @note On nodes without archive access enabled, the %%blockTag%% may be - * **silently ignored** by the node, which may cause issues if relied on. - */ - getStorage(address: AddressLike, position: BigNumberish, blockTag?: BlockTag): Promise; - /** - * Estimates the amount of energy required to executre %%tx%%. - */ - estimateEnergy(tx: TransactionRequest): Promise; - /** - * Simulate the execution of %%tx%%. If the call reverts, it will - * throw a [[CallExceptionError]] which includes the revert data. - */ - call(tx: TransactionRequest): Promise; - /** - * Broadcasts the %%signedTx%% to the network, adding it to the - * memory pool of any node for which the transaction meets the - * rebroadcast requirements. - */ - broadcastTransaction(signedTx: string): Promise; - /** - * Resolves to the block for %%blockHashOrBlockTag%%. - * - * If %%prefetchTxs%%, and the backend supports including transactions - * with block requests, all transactions will be included and the - * [[Block]] object will not need to make remote calls for getting - * transactions. - */ - getBlock(blockHashOrBlockTag: BlockTag | string, prefetchTxs?: boolean): Promise; - /** - * Resolves to the transaction for %%hash%%. - * - * If the transaction is unknown or on pruning nodes which - * discard old transactions this resolves to ``null``. - */ - getTransaction(hash: string): Promise; - /** - * Resolves to the transaction receipt for %%hash%%, if mined. - * - * If the transaction has not been mined, is unknown or on - * pruning nodes which discard old transactions this resolves to - * ``null``. - */ - getTransactionReceipt(hash: string): Promise; - /** - * Resolves to the result returned by the executions of %%hash%%. - * - * This is only supported on nodes with archive access and with - * the necessary debug APIs enabled. - */ - getTransactionResult(hash: string): Promise; - /** - * Resolves to the list of Logs that match %%filter%% - */ - getLogs(filter: Filter | FilterByBlockHash): Promise>; - /** - * Resolves to the address configured for the %%ensName%% or - * ``null`` if unconfigured. - */ - /** - * Waits until the transaction %%hash%% is mined and has %%confirms%% - * confirmations. - */ - waitForTransaction(hash: string, confirms?: number, timeout?: number): Promise; - /** - * Resolves to the block at %%blockTag%% once it has been mined. - * - * This can be useful for waiting some number of blocks by using - * the ``currentBlockNumber + N``. - */ - waitForBlock(blockTag?: BlockTag): Promise; -} -//# sourceMappingURL=provider.d.ts.map \ No newline at end of file diff --git a/types/providers/provider.d.ts.map b/types/providers/provider.d.ts.map deleted file mode 100644 index 5f7427dc0..000000000 --- a/types/providers/provider.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src.ts/providers/provider.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC;AAE7C,OAAO,EACN,WAAW,EACX,SAAS,EACT,wBAAwB,EACxB,yBAAyB,EACzB,MAAM,iBAAiB,CAAC;AAoBzB;;;GAGG;AACH,qBAAa,OAAO;IACnB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAG,IAAI,GAAG,MAAM,CAAC;IAErC,YAAY,WAAW,CAAC,EAAE,IAAI,GAAG,MAAM,EAItC;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CAMZ;CACD;AAED,MAAM,WAAW,kBAAkB;IAClC,IAAI,CAA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AC,CAAC;IAKrE;;;;;;;OAOG;IACH,QAAQ,CACP,mBAAmB,EAAE,QAAQ,GAAG,MAAM,EACtC,WAAW,CAAC,EAAE,OAAO,GACnB,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;IAEzB;;;;;OAKG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,mBAAmB,CAAC,CAAC;IAElE;;;;;;OAMG;IACH,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAExE;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAK3D;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAKjE;;;OAGG;IAEH;;;OAGG;IACH,kBAAkB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,GAAG,kBAAkB,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAClD"} \ No newline at end of file diff --git a/types/providers/signer-noncemanager.d.ts b/types/providers/signer-noncemanager.d.ts deleted file mode 100644 index 31eae80ab..000000000 --- a/types/providers/signer-noncemanager.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { AbstractSigner } from "./abstract-signer.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -import type { Signer } from "./signer.js"; -export declare class NonceManager extends AbstractSigner { - #private; - signer: Signer; - constructor(signer: Signer); - getAddress(): Promise; - connect(provider: null | Provider): NonceManager; - getNonce(blockTag?: BlockTag): Promise; - increment(): void; - reset(): void; - sendTransaction(tx: TransactionRequest): Promise; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=signer-noncemanager.d.ts.map \ No newline at end of file diff --git a/types/providers/signer-noncemanager.d.ts.map b/types/providers/signer-noncemanager.d.ts.map deleted file mode 100644 index ccd407c82..000000000 --- a/types/providers/signer-noncemanager.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer-noncemanager.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer-noncemanager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,YAAa,SAAQ,cAAc;;IAC/C,MAAM,EAAG,MAAM,CAAC;IAKhB,YAAY,MAAM,EAAE,MAAM,EAMzB;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,YAAY,CAE/C;IAEK,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAWnD;IAED,SAAS,IAAI,IAAI,CAEhB;IAED,KAAK,IAAI,IAAI,CAGZ;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAU1E;IAED,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEvD;IAED,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEzD;IAED,aAAa,CACZ,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAEjB;CACD"} \ No newline at end of file diff --git a/types/providers/signer.d.ts b/types/providers/signer.d.ts deleted file mode 100644 index a6383a32f..000000000 --- a/types/providers/signer.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -import type { Addressable, NameResolver } from "../address/index.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { TransactionLike } from "../transaction/index.js"; -import type { ContractRunner } from "./contracts.js"; -import type { BlockTag, Provider, TransactionRequest, TransactionResponse } from "./provider.js"; -/** - * A Signer represents an account on the Core Blockchain, and is most often - * backed by a private key represented by a mnemonic or residing on a Hardware Wallet. - * - * The API remains abstract though, so that it can deal with more advanced exotic - * Signing entities, such as Smart Contract Wallets or Virtual Wallets (where the - * private key may not be known). - */ -export interface Signer extends Addressable, ContractRunner, NameResolver { - /** - * The [[Provider]] attached to this Signer (if any). - */ - provider: null | Provider; - /** - * Returns a new instance of this Signer connected to //provider// or detached - * from any Provider if null. - */ - connect(provider: null | Provider): Signer; - /** - * Get the address of the Signer. - */ - getAddress(): Promise; - /** - * Gets the next nonce required for this Signer to send a transaction. - * - * @param blockTag - The blocktag to base the transaction count on, keep in mind - * many nodes do not honour this value and silently ignore it [default: ``"latest"``] - */ - getNonce(blockTag?: BlockTag): Promise; - /** - * Prepares a {@link TransactionRequest} for calling: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - * @param tx - The call to prepare - */ - populateCall(tx: TransactionRequest): Promise>; - /** - * Prepares a {@link TransactionRequest} for sending to the network by - * populating any missing properties: - * - resolves ``to`` and ``from`` addresses - * - if ``from`` is specified , check that it matches this Signer - * - populates ``nonce`` via ``signer.getNonce("pending")`` - * - populates ``energyLimit`` via ``signer.estimateEnergy(tx)`` - * - populates ``networkId`` via ``signer.provider.getNetwork()`` - * - populates ``type`` and relevant fee data for that type (``energyPrice`` - * for legacy transactions, ``maxFeePerEnergy`` for EIP-1559, etc) - * - * @note Some Signer implementations may skip populating properties that - * are populated downstream; for example JsonRpcSigner defers to the - * node to populate the nonce and fee data. - * - * @param tx - The call to prepare - */ - populateTransaction(tx: TransactionRequest): Promise>; - /** - * Estimates the required energy required to execute //tx// on the Blockchain. This - * will be the expected amount a transaction will require as its ``energyLimit`` - * to successfully run all the necessary computations and store the needed state - * that the transaction intends. - * - * Keep in mind that this is **best efforts**, since the state of the Blockchain - * is in flux, which could affect transaction energy requirements. - * - * @throws UNPREDICTABLE_ENERGY_LIMIT A transaction that is believed by the node to likely - * fail will throw an error during energy estimation. This could indicate that it - * will actually fail or that the circumstances are simply too complex for the - * node to take into account. In these cases, a manually determined ``energyLimit`` - * will need to be made. - */ - estimateEnergy(tx: TransactionRequest): Promise; - /** - * Evaluates the //tx// by running it against the current Blockchain state. This - * cannot change state and has no cost in xcb, as it is effectively simulating - * execution. - * - * This can be used to have the Blockchain perform computations based on its state - * (e.g. running a Contract's getters) or to simulate the effect of a transaction - * before actually performing an operation. - */ - call(tx: TransactionRequest): Promise; - /** - * Resolves an ENS Name to an address. - */ - resolveName(name: string): Promise; - /** - * Signs %%tx%%, returning the fully signed transaction. This does not - * populate any additional properties within the transaction. - */ - signTransaction(tx: TransactionRequest): Promise; - /** - * Sends %%tx%% to the Network. The ``signer.populateTransaction(tx)`` - * is called first to ensure all necessary properties for the - * transaction to be valid have been popualted first. - */ - sendTransaction(tx: TransactionRequest): Promise; - /** - * Signers an [[link-eip-191]] prefixed personal message. - * - * If the %%message%% is a string, it is signed as UTF-8 encoded bytes. It is **not** - * interpretted as a [[BytesLike]]; so the string ``"0x1234"`` is signed as six - * characters, **not** two bytes. - * - * To sign that example as two bytes, the Uint8Array should be used - * (i.e. ``new Uint8Array([ 0x12, 0x34 ])``). - */ - signMessage(message: string | Uint8Array): Promise; - /** - * Signs the [[link-eip-712]] typed data. - */ - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=signer.d.ts.map \ No newline at end of file diff --git a/types/providers/signer.d.ts.map b/types/providers/signer.d.ts.map deleted file mode 100644 index d5935e8bb..000000000 --- a/types/providers/signer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src.ts/providers/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EACX,QAAQ,EACR,QAAQ,EACR,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,eAAe,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,WAAW,MAAO,SAAQ,WAAW,EAAE,cAAc,EAAE,YAAY;IACxE;;OAEG;IACH,QAAQ,EAAE,IAAI,GAAG,QAAQ,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;IAK3C;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAK/C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAEvE;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAK9E;;;;;;;;;;;;;;OAcG;IACH,cAAc,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAExD;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9C;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,CAAC;IAKlD;;;OAGG;IACH,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzD;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEtE;;;;;;;;;OASG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE3D;;OAEG;IACH,aAAa,CACZ,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAAC;CACnB"} \ No newline at end of file diff --git a/types/providers/subscriber-connection.d.ts b/types/providers/subscriber-connection.d.ts deleted file mode 100644 index b235e3b46..000000000 --- a/types/providers/subscriber-connection.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import type { Subscriber } from "./abstract-provider.js"; -import type { Provider } from "./provider.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export interface ConnectionRpcProvider extends Provider { - _subscribe(param: Array, processFunc: (result: any) => void): number; - _unsubscribe(filterId: number): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class BlockConnectionSubscriber implements Subscriber { - #private; - constructor(provider: ConnectionRpcProvider); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-connection.d.ts.map \ No newline at end of file diff --git a/types/providers/subscriber-connection.d.ts.map b/types/providers/subscriber-connection.d.ts.map deleted file mode 100644 index baef99405..000000000 --- a/types/providers/subscriber-connection.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-connection.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-connection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,qBAAsB,SAAQ,QAAQ;IAEtD,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC;IAC1E,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;;GAIG;AACH,qBAAa,yBAA0B,YAAW,UAAU;;IAQ3D,YAAY,QAAQ,EAAE,qBAAqB,EAK1C;IAED,KAAK,IAAI,IAAI,CAeZ;IAED,IAAI,IAAI,IAAI,CAUX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/types/providers/subscriber-filterid.d.ts b/types/providers/subscriber-filterid.d.ts deleted file mode 100644 index 3e58a6871..000000000 --- a/types/providers/subscriber-filterid.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter } from "./provider.js"; -import type { JsonRpcApiProvider } from "./provider-jsonrpc.js"; -/** - * Some backends support subscribing to events using a Filter ID. - * - * When subscribing with this technique, the node issues a unique - * //Filter ID//. At this point the node dedicates resources to - * the filter, so that periodic calls to follow up on the //Filter ID// - * will receive any events since the last call. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdSubscriber implements Subscriber { - #private; - constructor(provider: JsonRpcApiProvider); - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: AbstractProvider, result: Array): Promise; - _recover(provider: AbstractProvider): Subscriber; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * A **FilterIdSubscriber** for receiving contract events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdEventSubscriber extends FilterIdSubscriber { - #private; - constructor(provider: JsonRpcApiProvider, filter: EventFilter); - _recover(provider: AbstractProvider): Subscriber; - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -/** - * A **FilterIdSubscriber** for receiving pending transactions events. - * - * @_docloc: api/providers/abstract-provider - */ -export declare class FilterIdPendingSubscriber extends FilterIdSubscriber { - _subscribe(provider: JsonRpcApiProvider): Promise; - _emitResults(provider: JsonRpcApiProvider, results: Array): Promise; -} -//# sourceMappingURL=subscriber-filterid.d.ts.map \ No newline at end of file diff --git a/types/providers/subscriber-filterid.d.ts.map b/types/providers/subscriber-filterid.d.ts.map deleted file mode 100644 index 957e1320c..000000000 --- a/types/providers/subscriber-filterid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"subscriber-filterid.d.ts","sourceRoot":"","sources":["../../src.ts/providers/subscriber-filterid.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,kBA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ode 100644 index fcf4a8070..000000000 --- a/types/providers/subscriber-polling.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -import type { AbstractProvider, Subscriber } from "./abstract-provider.js"; -import type { EventFilter, OrphanFilter, ProviderEvent } from "./provider.js"; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare function getPollingSubscriber(provider: AbstractProvider, event: ProviderEvent): Subscriber; -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingBlockSubscriber implements Subscriber { - #private; - constructor(provider: AbstractProvider); - get pollingInterval(): number; - set pollingInterval(value: number); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class OnBlockSubscriber implements Subscriber { - #private; - constructor(provider: AbstractProvider); - _poll(blockNumber: number, provider: AbstractProvider): Promise; - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingOrphanSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, filter: OrphanFilter); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingTransactionSubscriber extends OnBlockSubscriber { - #private; - constructor(provider: AbstractProvider, hash: string); - _poll(blockNumber: number, provider: AbstractProvider): Promise; -} -/** - * @TODO - * - * @_docloc: api/providers/abstract-provider - */ -export declare class PollingEventSubscriber implements Subscriber { - #private; - constructor(provider: AbstractProvider, filter: EventFilter); - start(): void; - stop(): void; - pause(dropWhilePaused?: boolean): void; - resume(): void; -} -//# sourceMappingURL=subscriber-polling.d.ts.map \ No newline at end of file diff --git a/types/providers/subscriber-polling.d.ts.map b/types/providers/subscriber-polling.d.ts.map deleted file mode 100644 index 9fd6aa7aa..000000000 --- a/types/providers/subscriber-polling.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file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ED;;;;GAIG;AACH,qBAAa,4BAA6B,SAAQ,iBAAiB;;IAGlE,YAAY,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAGnD;IAEK,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAK1E;CACD;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,YAAW,UAAU;;IAWxD,YAAY,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,WAAW,EAM1D;IA6BD,KAAK,IAAI,IAAI,CAYZ;IAED,IAAI,IAAI,IAAI,CAOX;IAED,KAAK,CAAC,eAAe,CAAC,EAAE,OAAO,GAAG,IAAI,CAKrC;IAED,MAAM,IAAI,IAAI,CAEb;CACD"} \ No newline at end of file diff --git a/types/providers/ws-browser.d.ts b/types/providers/ws-browser.d.ts deleted file mode 100644 index d92720422..000000000 --- a/types/providers/ws-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const _WebSocket: any; -export { _WebSocket as WebSocket }; -//# sourceMappingURL=ws-browser.d.ts.map \ No newline at end of file diff --git a/types/providers/ws-browser.d.ts.map b/types/providers/ws-browser.d.ts.map deleted file mode 100644 index 63da59ec3..000000000 --- a/types/providers/ws-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws-browser.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws-browser.ts"],"names":[],"mappings":"AAaA,QAAA,MAAM,UAAU,KAAwB,CAAC;AAEzC,OAAO,EAAE,UAAU,IAAI,SAAS,EAAE,CAAC"} \ No newline at end of file diff --git a/types/providers/ws.d.ts b/types/providers/ws.d.ts deleted file mode 100644 index 75d53b7d4..000000000 --- a/types/providers/ws.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { WebSocket } from "ws"; -//# sourceMappingURL=ws.d.ts.map \ No newline at end of file diff --git a/types/providers/ws.d.ts.map b/types/providers/ws.d.ts.map deleted file mode 100644 index c424f8d82..000000000 --- a/types/providers/ws.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ws.d.ts","sourceRoot":"","sources":["../../src.ts/providers/ws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC"} \ No newline at end of file diff --git a/types/transaction/accesslist.d.ts b/types/transaction/accesslist.d.ts deleted file mode 100644 index aac12cccf..000000000 --- a/types/transaction/accesslist.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { AccessList, AccessListish } from "./index.js"; -/** - * Returns a [[AccessList]] from any corebcsupported access-list structure. - */ -export declare function accessListify(value: AccessListish): AccessList; -//# sourceMappingURL=accesslist.d.ts.map \ No newline at end of file diff --git a/types/transaction/accesslist.d.ts.map b/types/transaction/accesslist.d.ts.map deleted file mode 100644 index 4bd8ae700..000000000 --- a/types/transaction/accesslist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"accesslist.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/accesslist.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAoB5D;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,CA+C9D"} \ No newline at end of file diff --git a/types/transaction/address.d.ts b/types/transaction/address.d.ts deleted file mode 100644 index 5abba54e2..000000000 --- a/types/transaction/address.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * Returns the address for the %%key%%. - * - * The key may be any standard form of public key or a private key. - */ -export declare function removeHexPrefix(val: string): string; -export declare function publicToAddress(key: BytesLike | string, prefix: string): string; -export declare function computeAddress(key: string | SigningKey, prefix: string): string; -/** - * Returns the recovered address for the private key that was - * used to sign %%digest%% that resulted in %%signature%%. - */ -export declare function recoverAddress(digest: BytesLike, signature: SignatureLike, prefix: string): string; -export declare function extractPrefix(address: string): string; -//# sourceMappingURL=address.d.ts.map \ No newline at end of file diff --git a/types/transaction/address.d.ts.map b/types/transaction/address.d.ts.map deleted file mode 100644 index 48e65cc8e..000000000 --- a/types/transaction/address.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/address.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD;;;;GAIG;AAEH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED,wBAAgB,eAAe,CAC9B,GAAG,EAAE,SAAS,GAAG,MAAM,EACvB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AAED,wBAAgB,cAAc,CAC7B,GAAG,EAAE,MAAM,GAAG,UAAU,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,GACZ,MAAM,CAIR;AACD,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGrD"} \ No newline at end of file diff --git a/types/transaction/index.d.ts b/types/transaction/index.d.ts deleted file mode 100644 index 01bca63fa..000000000 --- a/types/transaction/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Transactions.. - * - * @_section api/transaction:Transactions [about-transactions] - */ -/** - * A single [[AccessList]] entry of storage keys (slots) for an address. - */ -export type AccessListEntry = { - address: string; - storageKeys: Array; -}; -/** - * An ordered collection of [[AccessList]] entries. - */ -export type AccessList = Array; -/** - * Any corebc-supported access list structure. - */ -export type AccessListish = AccessList | Array<[string, Array]> | Record>; -export { accessListify } from "./accesslist.js"; -export { computeAddress, recoverAddress } from "./address.js"; -export { Transaction } from "./transaction.js"; -export type { TransactionLike } from "./transaction.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/transaction/index.d.ts.map b/types/transaction/index.d.ts.map deleted file mode 100644 index 4c5a4305f..000000000 --- a/types/transaction/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,aAAa,GACxB,UAAU,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC"} \ No newline at end of file diff --git a/types/transaction/transaction.d.ts b/types/transaction/transaction.d.ts deleted file mode 100644 index 83340f6b5..000000000 --- a/types/transaction/transaction.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -import { Signature } from "../crypto/index.js"; -import type { BigNumberish, BytesLike } from "../utils/index.js"; -import type { SignatureLike } from "../crypto/index.js"; -export interface TransactionLike { - /** - * The recipient address or ``null`` for an ``init`` transaction. - */ - to?: null | A; - /** - * The sender. - */ - from?: null | A; - /** - * The nonce. - */ - nonce?: null | number; - /** - * The maximum amount of energy that can be used. - */ - energyLimit?: null | BigNumberish; - /** - * The energy price for legacy and berlin transactions. - */ - energyPrice?: null | BigNumberish; - /** - * The data. - */ - data?: null | string; - /** - * The value (in ore) to send. - */ - value?: null | BigNumberish; - /** - * The chain ID the transaction is valid on. - */ - networkId?: null | BigNumberish; - /** - * The transaction hash. - */ - hash?: null | string; - /** - * The signature provided by the sender. - */ - signature?: null | SignatureLike; -} -/** - * A **Transaction** describes an operation to be executed on - * Core by an Externally Owned Account (EOA). It includes - * who (the [[to]] address), what (the [[data]]) and how much (the - * [[value]] in corebc) the operation should entail. - * - * @example: - * tx = new Transaction() - * //_result: - * - * tx.data = "0x1234"; - * //_result: - */ -export declare class Transaction implements TransactionLike { - #private; - /** - * The ``to`` address for the transaction or ``null`` if the - * transaction is an ``init`` transaction. - */ - get to(): null | string; - set to(value: null | string); - /** - * The transaction nonce. - */ - get nonce(): number; - set nonce(value: BigNumberish); - /** - * The energy limit. - */ - get energyLimit(): bigint; - set energyLimit(value: BigNumberish); - /** - * The energy price. - * - * On legacy networks this defines the fee that will be paid. On - * EIP-1559 networks, this should be ``null``. - */ - get energyPrice(): null | bigint; - set energyPrice(value: null | BigNumberish); - /** - * The transaction data. For ``init`` transactions this is the - * deployment code. - */ - get data(): string; - set data(value: BytesLike); - /** - * The amount of xcb (in ore) to send in this transactions. - */ - get value(): bigint; - set value(value: BigNumberish); - /** - * The chain ID this transaction is valid on. - */ - get networkId(): bigint; - set networkId(value: BigNumberish); - /** - * If signed, the signature for this transaction. - */ - get signature(): null | string; - set signature(value: null | SignatureLike); - /** - * Creates a new Transaction with default values. - */ - constructor(); - /** - * The transaction hash, if signed. Otherwise, ``null``. - */ - get hash(): null | string; - /** - * The pre-image hash of this transaction. - * - * This is the digest that a [[Signer]] must sign to authorize - * this transaction. - */ - get unsignedHash(): string; - /** - * The sending address, if signed. Otherwise, ``null``. - */ - get from(): null | string; - /** - * The public key of the sender, if signed. Otherwise, ``null``. - */ - get fromPublicKey(): null | string; - /** - * Returns true if signed. - * - * This provides a Type Guard that properties requiring a signed - * transaction are non-null. - */ - isSigned(): this is Transaction & { - type: number; - typeName: string; - from: string; - signature: Signature; - }; - /** - * The serialized transaction. - * - * This throws if the transaction is unsigned. For the pre-image, - * use [[unsignedSerialized]]. - */ - get serialized(): string; - /** - * The transaction pre-image. - * - * The hash of this is the digest which needs to be signed to - * authorize this transaction. - */ - get unsignedSerialized(): string; - /** - * Create a copy of this transaciton. - */ - clone(): Transaction; - /** - * Return a JSON-friendly object. - */ - toJSON(): any; - /** - * Create a **Transaction** from a serialized transaction or a - * Transaction-like object. - */ - static from(tx?: string | TransactionLike): Transaction; -} -//# sourceMappingURL=transaction.d.ts.map \ No newline at end of file diff --git a/types/transaction/transaction.d.ts.map b/types/transaction/transaction.d.ts.map deleted file mode 100644 index e3c637686..000000000 --- a/types/transaction/transaction.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../src.ts/transaction/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,SAAS,EAAc,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAWxD,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,MAAM;IAC1C;;OAEG;IACH,EAAE,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAEtB;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,GAAG,YAAY,CAAC;IAElC;;OAEG;IACH,WAAW,CAAC,EAAE,I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,GAAG,aAAa,EAExC;IAED;;OAEG;IACH,cASC;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,CAKxB;IAED;;;;;OAKG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,IAAI,GAAG,MAAM,CAMxB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,IAAI,GAAG,MAAM,CAKjC;IAED;;;;;OAKG;IACH,QAAQ,IAAI,IAAI,IAAI,WAAW,GAAG;QACjC,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,SAAS,CAAC;KACrB,CAGA;IAED;;;;;OAKG;IACH,IAAI,UAAU,IAAI,MAAM,CAQvB;IAED;;;;;OAKG;IACH,IAAI,kBAAkB,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,KAAK,IAAI,WAAW,CAEnB;IAED;;OAEG;IACH,MAAM,IAAI,GAAG,CAkBZ;IAED;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,WAAW,CA4D9D;CACD"} \ No newline at end of file diff --git a/types/utils/base58.d.ts b/types/utils/base58.d.ts deleted file mode 100644 index 8b377936b..000000000 --- a/types/utils/base58.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * The [Base58 Encoding](link-base58) scheme allows a **numeric** value - * to be encoded as a compact string using a radix of 58 using only - * alpha-numeric characters. Confusingly similar characters are omitted - * (i.e. ``"l0O"``). - * - * Note that Base58 encodes a **numeric** value, not arbitrary bytes, - * since any zero-bytes on the left would get removed. To mitigate this - * issue most schemes that use Base58 choose specific high-order values - * to ensure non-zero prefixes. - * - * @_subsection: api/utils:Base58 Encoding [about-base58] - */ -import type { BytesLike } from "./index.js"; -/** - * Encode %%value%% as a Base58-encoded string. - */ -export declare function encodeBase58(_value: BytesLike): string; -/** - * Decode the Base58-encoded %%value%%. - */ -export declare function decodeBase58(value: string): bigint; -//# sourceMappingURL=base58.d.ts.map \ No newline at end of file diff --git a/types/utils/base58.d.ts.map b/types/utils/base58.d.ts.map deleted file mode 100644 index 21386c9f3..000000000 --- a/types/utils/base58.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base58.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base58.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAoB5C;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAQtD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD"} \ No newline at end of file diff --git a/types/utils/base64-browser.d.ts b/types/utils/base64-browser.d.ts deleted file mode 100644 index ea96c442c..000000000 --- a/types/utils/base64-browser.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { BytesLike } from "./data.js"; -export declare function decodeBase64(textData: string): Uint8Array; -export declare function encodeBase64(_data: BytesLike): string; -//# sourceMappingURL=base64-browser.d.ts.map \ No newline at end of file diff --git a/types/utils/base64-browser.d.ts.map b/types/utils/base64-browser.d.ts.map deleted file mode 100644 index 83a734cd1..000000000 --- a/types/utils/base64-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64-browser.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAOzD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAOrD"} \ No newline at end of file diff --git a/types/utils/base64.d.ts b/types/utils/base64.d.ts deleted file mode 100644 index 0cab53288..000000000 --- a/types/utils/base64.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Decodes the base-64 encoded %%value%%. - * - * @example: - * // The decoded value is always binary data... - * result = decodeBase64("SGVsbG8gV29ybGQhIQ==") - * //_result: - * - * // ...use toUtf8String to convert it to a string. - * toUtf8String(result) - * //_result: - * - * // Decoding binary data - * decodeBase64("EjQ=") - * //_result: - */ -export declare function decodeBase64(value: string): Uint8Array; -/** - * Encodes %%data%% as a base-64 encoded string. - * - * @example: - * // Encoding binary data as a hexstring - * encodeBase64("0x1234") - * //_result: - * - * // Encoding binary data as a Uint8Array - * encodeBase64(new Uint8Array([ 0x12, 0x34 ])) - * //_result: - * - * // The input MUST be data... - * encodeBase64("Hello World!!") - * //_error: - * - * // ...use toUtf8Bytes for this. - * encodeBase64(toUtf8Bytes("Hello World!!")) - * //_result: - */ -export declare function encodeBase64(data: BytesLike): string; -//# sourceMappingURL=base64.d.ts.map \ No newline at end of file diff --git a/types/utils/base64.d.ts.map b/types/utils/base64.d.ts.map deleted file mode 100644 index 34656262c..000000000 --- a/types/utils/base64.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src.ts/utils/base64.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAEtD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAEpD"} \ No newline at end of file diff --git a/types/utils/data.d.ts b/types/utils/data.d.ts deleted file mode 100644 index 59cca6eba..000000000 --- a/types/utils/data.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -/** - * A [[HexString]] whose length is even, which ensures it is a valid - * representation of binary data. - */ -export type DataHexString = string; -/** - * A string which is prefixed with ``0x`` and followed by any number - * of case-agnostic hexadecimal characters. - * - * It must match the regular expression ``/0x[0-9A-Fa-f]*\/``. - */ -export type HexString = string; -/** - * An object that can be used to represent binary data. - */ -export type Bytes = ArrayLike; -export type BytesLike = Bytes | string; -export type DataOptions = { - allowMissingPrefix?: boolean; - hexPad?: "left" | "right" | null; -}; -export interface Hexable { - toHexString(): string; -} -export declare function isBytes(value: any): value is Bytes; -/** - * Get a typed Uint8Array for %%value%%. If already a Uint8Array - * the original %%value%% is returned; if a copy is required use - * [[getBytesCopy]]. - * - * @see: getBytesCopy - */ -export declare function getBytes(value: BytesLike, name?: string): Uint8Array; -/** - * Get a typed Uint8Array for %%value%%, creating a copy if necessary - * to prevent any modifications of the returned value from being - * reflected elsewhere. - * - * @see: getBytes - */ -export declare function getBytesCopy(value: BytesLike, name?: string): Uint8Array; -/** - * Returns true if %%value%% is a valid [[HexString]]. - * - * If %%length%% is ``true`` or a //number//, it also checks that - * %%value%% is a valid [[DataHexString]] of %%length%% (if a //number//) - * bytes of data (e.g. ``0x1234`` is 2 bytes). - */ -export declare function isHexString(value: any, length?: number | boolean): value is `0x${string}`; -/** - * Returns true if %%value%% is a valid representation of arbitrary - * data (i.e. a valid [[DataHexString]] or a Uint8Array). - */ -export declare function isBytesLike(value: any): value is BytesLike; -/** - * Returns a [[DataHexString]] representation of %%data%%. - */ -export declare function hexlify(value: BytesLike | Hexable | number | bigint, options?: DataOptions): string; -/** - * Returns a [[DataHexString]] by concatenating all values - * within %%data%%. - */ -export declare function concat(items: ReadonlyArray): string; -export declare function hexDataSlice(data: BytesLike, offset: number, endOffset?: number): string; -export declare function hexDataLength(data: BytesLike): number | null; -/** - * Returns the length of %%data%%, in bytes. - */ -export declare function dataLength(data: BytesLike): number; -/** - * Returns a [[DataHexString]] by slicing %%data%% from the %%start%% - * offset to the %%end%% offset. - * - * By default %%start%% is 0 and %%end%% is the length of %%data%%. - */ -export declare function dataSlice(data: BytesLike, start?: number, end?: number): string; -/** - * Return the [[DataHexString]] result by stripping all **leading** - ** zero bytes from %%data%%. - */ -export declare function stripZerosLeft(data: BytesLike): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **left** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **values** are in Solidity - * (e.g. ``uint128``). - */ -export declare function zeroPadValue(data: BytesLike, length: number): string; -/** - * Return the [[DataHexString]] of %%data%% padded on the **right** - * to %%length%% bytes. - * - * If %%data%% already exceeds %%length%%, a [[BufferOverrunError]] is - * thrown. - * - * This pads data the same as **bytes** are in Solidity - * (e.g. ``bytes16``). - */ -export declare function zeroPadBytes(data: BytesLike, length: number): string; -export declare function stripZeros(value: BytesLike): Uint8Array; -export declare function arrayify(value: BytesLike | Hexable | number, options?: DataOptions): Uint8Array; -export declare function hexConcat(items: ReadonlyArray): string; -//# sourceMappingURL=data.d.ts.map \ No newline at end of file diff --git a/types/utils/data.d.ts.map b/types/utils/data.d.ts.map deleted file mode 100644 index 3b65817ca..000000000 --- a/types/utils/data.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src.ts/utils/data.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CACjC,CAAC;AACF,MAAM,WAAW,OAAO;IACvB,WAAW,IAAI,MAAM,CAAC;CACtB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;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAmBvD;AAED,wBAAgB,QAAQ,CACvB,KAAK,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,EACnC,OAAO,CAAC,EAAE,WAAW,GACnB,UAAU,CAuDZ;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAMjE"} \ No newline at end of file diff --git a/types/utils/errors.d.ts b/types/utils/errors.d.ts deleted file mode 100644 index 130aa0621..000000000 --- a/types/utils/errors.d.ts +++ /dev/null @@ -1,486 +0,0 @@ -/** - * About Errors. - * - * @_section: api/utils/errors:Errors [about-errors] - */ -import type { TransactionRequest, TransactionReceipt, TransactionResponse } from "../providers/index.js"; -import type { FetchRequest, FetchResponse } from "./fetch.js"; -export type ErrorInfo = Omit; -/** - * All errors emitted by corebc have an **ErrorCode** to help - * identify and coalesce errors to simplfy programatic analysis. - * - * Each **ErrorCode** is the %%code%% proerty of a coresponding - * [[corebcError]]. - * - * **Generic Errors** - * - * **``"UNKNOWN_ERROR"``** - see [[UnknownError]] - * - * **``"NOT_IMPLEMENTED"``** - see [[NotImplementedError]] - * - * **``"UNSUPPORTED_OPERATION"``** - see [[UnsupportedOperationError]] - * - * **``"NETWORK_ERROR"``** - see [[NetworkError]] - * - * **``"SERVER_ERROR"``** - see [[ServerError]] - * - * **``"TIMEOUT"``** - see [[TimeoutError]] - * - * **``"BAD_DATA"``** - see [[BadDataError]] - * - * **``"CANCELLED"``** - see [[CancelledError]] - * - * **Operational Errors** - * - * **``"BUFFER_OVERRUN"``** - see [[BufferOverrunError]] - * - * **``"NUMERIC_FAULT"``** - see [[NumericFaultError]] - * - * **Argument Errors** - * - * **``"INVALID_ARGUMENT"``** - see [[InvalidArgumentError]] - * - * **``"MISSING_ARGUMENT"``** - see [[MissingArgumentError]] - * - * **``"UNEXPECTED_ARGUMENT"``** - see [[UnexpectedArgumentError]] - * - * **``"VALUE_MISMATCH"``** - //unused// - * - * **Blockchain Errors** - * - * **``"CALL_EXCEPTION"``** - see [[CallExceptionError]] - * - * **``"INSUFFICIENT_FUNDS"``** - see [[InsufficientFundsError]] - * - * **``"NONCE_EXPIRED"``** - see [[NonceExpiredError]] - * - * **``"REPLACEMENT_UNDERPRICED"``** - see [[ReplacementUnderpricedError]] - * - * **``"TRANSACTION_REPLACED"``** - see [[TransactionReplacedError]] - * - * **``"UNCONFIGURED_NAME"``** - see [[UnconfiguredNameError]] - * - * **``"OFFCHAIN_FAULT"``** - see [[OffchainFaultError]] - * - * **User Interaction Errors** - * - * **``"ACTION_REJECTED"``** - see [[ActionRejectedError]] - */ -export type ErrorCode = "UNKNOWN_ERROR" | "NOT_IMPLEMENTED" | "UNSUPPORTED_OPERATION" | "NETWORK_ERROR" | "SERVER_ERROR" | "TIMEOUT" | "BAD_DATA" | "CANCELLED" | "BUFFER_OVERRUN" | "NUMERIC_FAULT" | "INVALID_ARGUMENT" | "MISSING_ARGUMENT" | "UNEXPECTED_ARGUMENT" | "VALUE_MISMATCH" | "CALL_EXCEPTION" | "INSUFFICIENT_FUNDS" | "NONCE_EXPIRED" | "REPLACEMENT_UNDERPRICED" | "TRANSACTION_REPLACED" | "UNCONFIGURED_NAME" | "OFFCHAIN_FAULT" | "ACTION_REJECTED"; -/** - * All errors in corebc include properties to assist in - * machine-readable errors. - */ -export interface CoreBCError extends Error { - /** - * The string error code. - */ - code: ErrorCode; - /** - * Additional info regarding the error that may be useful. - * - * This is generally helpful mostly for human-based debugging. - */ - info?: Record; - /** - * Any related error. - */ - error?: Error; -} -/** - * This Error is a catch-all for when there is no way for corebc to - * know what the underlying problem is. - */ -export interface UnknownError extends CoreBCError<"UNKNOWN_ERROR"> { - [key: string]: any; -} -/** - * This Error is mostly used as a stub for functionality that is - * intended for the future, but is currently not implemented. - */ -export interface NotImplementedError extends CoreBCError<"NOT_IMPLEMENTED"> { - /** - * The attempted operation. - */ - operation: string; -} -/** - * This Error indicates that the attempted operation is not supported. - * - * This could range from a specifc JSON-RPC end-point not supporting - * a feature to a specific configuration of an object prohibiting the - * operation. - * - * For example, a [[Wallet]] with no connected [[Provider]] is unable - * to send a transaction. - */ -export interface UnsupportedOperationError extends CoreBCError<"UNSUPPORTED_OPERATION"> { - /** - * The attempted operation. - */ - operation: string; -} -export interface NetworkError extends CoreBCError<"NETWORK_ERROR"> { - event: string; -} -/** - * This Error indicates there was a problem fetching a resource from - * a server. - */ -export interface ServerError extends CoreBCError<"SERVER_ERROR"> { - /** - * The requested resource. - */ - request: FetchRequest | string; - /** - * The response received from the server, if available. - */ - response?: FetchResponse; -} -/** - * This Error indicates that the timeout duration has expired and - * that the operation has been implicitly cancelled. - * - * The side-effect of the operation may still occur, as this - * generally means a request has been sent and there has simply - * been no response to indicate whether it was processed or not. - */ -export interface TimeoutError extends CoreBCError<"TIMEOUT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The reason. - */ - reason: string; - /** - * The resource request, if available. - */ - request?: FetchRequest; -} -/** - * This Error indicates that a provided set of data cannot - * be correctly interpretted. - */ -export interface BadDataError extends CoreBCError<"BAD_DATA"> { - /** - * The data. - */ - value: any; -} -/** - * This Error indicates that the operation was cancelled by a - * programmatic call, for example to ``cancel()``. - */ -export interface CancelledError extends CoreBCError<"CANCELLED"> { -} -/** - * This Error indicates an attempt was made to read outside the bounds - * of protected data. - * - * Most operations in corebc are protected by bounds checks, to mitigate - * exploits when parsing data. - */ -export interface BufferOverrunError extends CoreBCError<"BUFFER_OVERRUN"> { - /** - * The buffer that was overrun. - */ - buffer: Uint8Array; - /** - * The length of the buffer. - */ - length: number; - /** - * The offset that was requested. - */ - offset: number; -} -/** - * This Error indicates an operation which would result in incorrect - * arithmetic output has occurred. - * - * For example, trying to divide by zero or using a ``uint8`` to store - * a negative value. - */ -export interface NumericFaultError extends CoreBCError<"NUMERIC_FAULT"> { - /** - * The attempted operation. - */ - operation: string; - /** - * The fault reported. - */ - fault: string; - /** - * The value the operation was attempted against. - */ - value: any; -} -/** - * This Error indicates an incorrect type or value was passed to - * a function or method. - */ -export interface InvalidArgumentError extends CoreBCError<"INVALID_ARGUMENT"> { - /** - * The name of the argument. - */ - argument: string; - /** - * The value that was provided. - */ - value: any; - info?: Record; -} -/** - * This Error indicates there were too few arguments were provided. - */ -export interface MissingArgumentError extends CoreBCError<"MISSING_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * This Error indicates too many arguments were provided. - */ -export interface UnexpectedArgumentError extends CoreBCError<"UNEXPECTED_ARGUMENT"> { - /** - * The number of arguments received. - */ - count: number; - /** - * The number of arguments expected. - */ - expectedCount: number; -} -/** - * The action that resulted in the error. - */ -export type CallExceptionAction = "call" | "estimateEnergy" | "getTransactionResult" | "unknown"; -/** - * The related transaction that caused the error. - */ -export type CallExceptionTransaction = { - to: null | string; - from?: string; - data: string; -}; -/** - * This **Error** indicates a transaction reverted. - */ -export interface CallExceptionError extends CoreBCError<"CALL_EXCEPTION"> { - /** - * The action being performed when the revert was encountered. - */ - action: CallExceptionAction; - /** - * The revert data returned. - */ - data: null | string; - /** - * A human-readable representation of data, if possible. - */ - reason: null | string; - /** - * The transaction that triggered the exception. - */ - transaction: CallExceptionTransaction; - /** - * The contract invocation details, if available. - */ - invocation: null | { - method: string; - signature: string; - args: Array; - }; - /** - * The built-in or custom revert error, if available - */ - revert: null | { - signature: string; - name: string; - args: Array; - }; -} -/** - * The sending account has insufficient funds to cover the - * entire transaction cost. - */ -export interface InsufficientFundsError extends CoreBCError<"INSUFFICIENT_FUNDS"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * The sending account has already used this nonce in a - * transaction that has been included. - */ -export interface NonceExpiredError extends CoreBCError<"NONCE_EXPIRED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A CCIP-read exception, which cannot be recovered from or - * be further processed. - */ -export interface OffchainFaultError extends CoreBCError<"OFFCHAIN_FAULT"> { - /** - * The transaction. - */ - transaction?: TransactionRequest; - /** - * The reason the CCIP-read failed. - */ - reason: string; -} -/** - * An attempt was made to replace a transaction, but with an - * insufficient additional fee to afford evicting the old - * transaction from the memory pool. - */ -export interface ReplacementUnderpricedError extends CoreBCError<"REPLACEMENT_UNDERPRICED"> { - /** - * The transaction. - */ - transaction: TransactionRequest; -} -/** - * A pending transaction was replaced by another. - */ -export interface TransactionReplacedError extends CoreBCError<"TRANSACTION_REPLACED"> { - /** - * If the transaction was cancelled, such that the original - * effects of the transaction cannot be assured. - */ - cancelled: boolean; - /** - * The reason the transaction was replaced. - */ - reason: "repriced" | "cancelled" | "replaced"; - /** - * The hash of the replaced transaction. - */ - hash: string; - /** - * The transaction that replaced the transaction. - */ - replacement: TransactionResponse; - /** - * The receipt of the transaction that replace the transaction. - */ - receipt: TransactionReceipt; -} -/** - * This Error indicates an ENS name was used, but the name has not - * been configured. - * - * This could indicate an ENS name is unowned or that the current - * address being pointed to is the [[ZeroAddress]]. - */ -export interface UnconfiguredNameError extends CoreBCError<"UNCONFIGURED_NAME"> { - /** - * The ENS name that was requested - */ - value: string; -} -/** - * This Error indicates a request was rejected by the user. - * - * In most clients (such as MetaMask), when an operation requires user - * authorization (such as ``signer.sendTransaction``), the client - * presents a dialog box to the user. If the user denies the request - * this error is thrown. - */ -export interface ActionRejectedError extends CoreBCError<"ACTION_REJECTED"> { - /** - * The requested action. - */ - action: "requestAccess" | "sendTransaction" | "signMessage" | "signTransaction" | "signTypedData" | "unknown"; - /** - * The reason the action was rejected. - * - * If there is already a pending request, some clients may indicate - * there is already a ``"pending"`` action. This prevents an app - * from spamming the user. - */ - reason: "expired" | "rejected" | "pending"; -} -/** - * A conditional type that transforms the [[ErrorCode]] T into - * its corebcError type. - * - * @flatworm-skip-docs - */ -export type CodedCoreBCError = T extends "UNKNOWN_ERROR" ? UnknownError : T extends "NOT_IMPLEMENTED" ? NotImplementedError : T extends "UNSUPPORTED_OPERATION" ? UnsupportedOperationError : T extends "NETWORK_ERROR" ? NetworkError : T extends "SERVER_ERROR" ? ServerError : T extends "TIMEOUT" ? TimeoutError : T extends "BAD_DATA" ? BadDataError : T extends "CANCELLED" ? CancelledError : T extends "BUFFER_OVERRUN" ? BufferOverrunError : T extends "NUMERIC_FAULT" ? NumericFaultError : T extends "INVALID_ARGUMENT" ? InvalidArgumentError : T extends "MISSING_ARGUMENT" ? MissingArgumentError : T extends "UNEXPECTED_ARGUMENT" ? UnexpectedArgumentError : T extends "CALL_EXCEPTION" ? CallExceptionError : T extends "INSUFFICIENT_FUNDS" ? InsufficientFundsError : T extends "NONCE_EXPIRED" ? NonceExpiredError : T extends "OFFCHAIN_FAULT" ? OffchainFaultError : T extends "REPLACEMENT_UNDERPRICED" ? ReplacementUnderpricedError : T extends "TRANSACTION_REPLACED" ? TransactionReplacedError : T extends "UNCONFIGURED_NAME" ? UnconfiguredNameError : T extends "ACTION_REJECTED" ? ActionRejectedError : never; -/** - * Returns true if the %%error%% matches an error thrown by corebc - * that matches the error %%code%%. - * - * In TypeScript envornoments, this can be used to check that %%error%% - * matches an corebcError type, which means the expected properties will - * be set. - * - * @See [ErrorCodes](api:ErrorCode) - * @example - * try { - * // code.... - * } catch (e) { - * if (isError(e, "CALL_EXCEPTION")) { - * // The Type Guard has validated this object - * console.log(e.data); - * } - * } - */ -export declare function isError>(error: any, code: K): error is T; -/** - * Returns true if %%error%% is a [[CallExceptionError]. - */ -export declare function isCallException(error: any): error is CallExceptionError; -/** - * Returns a new Error configured to the format corebc emits errors, with - * the %%message%%, [[api:ErrorCode]] %%code%% and additioanl properties - * for the corresponding corebcError. - * - * Each error in corebc includes the version of corebc, a - * machine-readable [[ErrorCode]], and depneding on %%code%%, additional - * required properties. The error message will also include the %%meeage%%, - * corebc version, %%code%% and all aditional properties, serialized. - */ -export declare function makeError>(message: string, code: K, info?: ErrorInfo): T; -/** - * Throws an corebcError with %%message%%, %%code%% and additional error - * %%info%% when %%check%% is falsish.. - * - * @see [[api:makeError]] - */ -export declare function assert>(check: unknown, message: string, code: K, info?: ErrorInfo): asserts check; -/** - * A simple helper to simply ensuring provided arguments match expected - * constraints, throwing if not. - * - * In TypeScript environments, the %%check%% has been asserted true, so - * any further code does not need additional compile-time checks. - */ -export declare function assertArgument(check: unknown, message: string, name: string, value: unknown): asserts check; -export declare function assertArgumentCount(count: number, expectedCount: number, message?: string): void; -/** - * Throws if the normalization %%form%% is not supported. - */ -export declare function assertNormalize(form: string): void; -/** - * Many classes use file-scoped values to guard the constructor, - * making it effectively private. This facilitates that pattern - * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%, - * throwing if not, indicating the %%className%% if provided. - */ -export declare function assertPrivate(givenGuard: any, guard: any, className?: string): void; -//# sourceMappingURL=errors.d.ts.map \ No newline at end of file diff --git a/types/utils/errors.d.ts.map b/types/utils/errors.d.ts.map deleted file mode 100644 index b9eff4781..000000000 --- a/types/utils/errors.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src.ts/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EACX,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;AAiDhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;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AAC,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,EACxE,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,CAAC,EACP,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,GACjB,OAAO,CAAC,KAAK,CAIf;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACZ,OAAO,CAAC,KAAK,CAEf;AAED,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,MAAM,EACb,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,MAAM,GACd,IAAI,CA2BN;AA8BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAUlD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC5B,UAAU,EAAE,GAAG,EACf,KAAK,EAAE,GAAG,EACV,SAAS,CAAC,EAAE,MAAM,GAChB,IAAI,CAoBN"} \ No newline at end of file diff --git a/types/utils/events.d.ts b/types/utils/events.d.ts deleted file mode 100644 index 5da088923..000000000 --- a/types/utils/events.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * A callback function called when a an event is triggered. - */ -export type Listener = (...args: Array) => void; -/** - * An **EventEmitterable** behaves similar to an EventEmitter - * except provides async access to its methods. - * - * An EventEmitter implements the observer pattern. - */ -export interface EventEmitterable { - /** - * Registers a %%listener%% that is called whenever the - * %%event%% occurs until unregistered. - */ - on(event: T, listener: Listener): Promise; - /** - * Registers a %%listener%% that is called the next time - * %%event%% occurs. - */ - once(event: T, listener: Listener): Promise; - /** - * Triggers each listener for %%event%% with the %%args%%. - */ - emit(event: T, ...args: Array): Promise; - /** - * Resolves to the number of listeners for %%event%%. - */ - listenerCount(event?: T): Promise; - /** - * Resolves to the listeners for %%event%%. - */ - listeners(event?: T): Promise>; - /** - * Unregister the %%listener%% for %%event%%. If %%listener%% - * is unspecified, all listeners are unregistered. - */ - off(event: T, listener?: Listener): Promise; - /** - * Unregister all listeners for %%event%%. - */ - removeAllListeners(event?: T): Promise; - /** - * Alias for [[on]]. - */ - addListener(event: T, listener: Listener): Promise; - /** - * Alias for [[off]]. - */ - removeListener(event: T, listener: Listener): Promise; -} -/** - * When an [[EventEmitterable]] triggers a [[Listener]], the - * callback always ahas one additional argument passed, which is - * an **EventPayload**. - */ -export declare class EventPayload { - #private; - /** - * The event filter. - */ - readonly filter: T; - /** - * The **EventEmitterable**. - */ - readonly emitter: EventEmitterable; - /** - * Create a new **EventPayload** for %%emitter%% with - * the %%listener%% and for %%filter%%. - */ - constructor(emitter: EventEmitterable, listener: null | Listener, filter: T); - /** - * Unregister the triggered listener for future events. - */ - removeListener(): Promise; -} -//# sourceMappingURL=events.d.ts.map \ No newline at end of file diff --git a/types/utils/events.d.ts.map b/types/utils/events.d.ts.map deleted file mode 100644 index 140670f11..000000000 --- a/types/utils/events.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src.ts/utils/events.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IAClC;;;OAGG;IACH,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtD;;OAEG;IACH,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1C;;OAEG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C;;;OAGG;IACH,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzD;;OAEG;IACH,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED;;;;GAIG;AACH,qBAAa,YAAY,CAAC,CAAC;;IAC1B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAG,CAAC,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAIvC;;;OAGG;IACH,YACC,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC5B,QAAQ,EAAE,IAAI,GAAG,QAAQ,EACzB,MAAM,EAAE,CAAC,EAIT;IAED;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpC;CACD"} \ No newline at end of file diff --git a/types/utils/fetch.d.ts b/types/utils/fetch.d.ts deleted file mode 100644 index 7d226ccc0..000000000 --- a/types/utils/fetch.d.ts +++ /dev/null @@ -1,327 +0,0 @@ -export type GetUrlResponse = { - statusCode: number; - statusMessage: string; - headers: Record; - body: null | Uint8Array; -}; -export type FetchThrottleParams = { - maxAttempts?: number; - slotInterval?: number; -}; -/** - * Called before any network request, allowing updated headers (e.g. Bearer tokens), etc. - */ -export type FetchPreflightFunc = (req: FetchRequest) => Promise; -/** - * Called on the response, allowing client-based throttling logic or post-processing. - */ -export type FetchProcessFunc = (req: FetchRequest, resp: FetchResponse) => Promise; -/** - * Called prior to each retry; return true to retry, false to abort. - */ -export type FetchRetryFunc = (req: FetchRequest, resp: FetchResponse, attempt: number) => Promise; -/** - * Called on Gateway URLs. - */ -export type FetchGatewayFunc = (url: string, signal?: FetchCancelSignal) => Promise; -/** - * Used to perform a fetch; use this to override the underlying network - * fetch layer. In NodeJS, the default uses the "http" and "https" libraries - * and in the browser ``fetch`` is used. If you wish to use Axios, this is - * how you would register it. - */ -export type FetchGetUrlFunc = (req: FetchRequest, signal?: FetchCancelSignal) => Promise; -/** - * @_ignore - */ -export declare class FetchCancelSignal { - #private; - constructor(request: FetchRequest); - addListener(listener: () => void): void; - get cancelled(): boolean; - checkSignal(): void; -} -/** - * Represents a request for a resource using a URI. - * - * By default, the supported schemes are ``HTTP``, ``HTTPS``, ``data:``, - * and ``IPFS:``. - * - * Additional schemes can be added globally using [[registerGateway]]. - * - * @example: - * req = new FetchRequest("https://www.ricmoo.com") - * resp = await req.send() - * resp.body.length - * //_result: - */ -export declare class FetchRequest implements Iterable<[key: string, value: string]> { - #private; - /** - * The fetch URI to requrest. - */ - get url(): string; - set url(url: string); - /** - * The fetch body, if any, to send as the request body. //(default: null)// - * - * When setting a body, the intrinsic ``Content-Type`` is automatically - * set and will be used if **not overridden** by setting a custom - * header. - * - * If %%body%% is null, the body is cleared (along with the - * intrinsic ``Content-Type``) and the . - * - * If %%body%% is a string, the intrincis ``Content-Type`` is set to - * ``text/plain``. - * - * If %%body%% is a Uint8Array, the intrincis ``Content-Type`` is set to - * ``application/octet-stream``. - * - * If %%body%% is any other object, the intrincis ``Content-Type`` is - * set to ``application/json``. - */ - get body(): null | Uint8Array; - set body(body: null | string | Readonly | Readonly); - /** - * Returns true if the request has a body. - */ - hasBody(): this is FetchRequest & { - body: Uint8Array; - }; - /** - * The HTTP method to use when requesting the URI. If no method - * has been explicitly set, then ``GET`` is used if the body is - * null and ``POST`` otherwise. - */ - get method(): string; - set method(method: null | string); - /** - * The headers that will be used when requesting the URI. All - * keys are lower-case. - * - * This object is a copy, so any chnages will **NOT** be reflected - * in the ``FetchRequest``. - * - * To set a header entry, use the ``setHeader`` method. - */ - get headers(): Record; - /** - * Get the header for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Set the header for %%key%% to %%value%%. All values are coerced - * to a string. - */ - setHeader(key: string, value: string | number): void; - /** - * Clear all headers, resetting all intrinsic headers. - */ - clearHeaders(): void; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - /** - * The value that will be sent for the ``Authorization`` header. - * - * To set the credentials, use the ``setCredentials`` method. - */ - get credentials(): null | string; - /** - * Sets an ``Authorization`` for %%username%% with %%password%%. - */ - setCredentials(username: string, password: string): void; - /** - * Enable and request gzip-encoded responses. The response will - * automatically be decompressed. //(default: true)// - */ - get allowGzip(): boolean; - set allowGzip(value: boolean); - /** - * Allow ``Authentication`` credentials to be sent over insecure - * channels. //(default: false)// - */ - get allowInsecureAuthentication(): boolean; - set allowInsecureAuthentication(value: boolean); - /** - * The timeout (in milliseconds) to wait for a complere response. - * //(default: 5 minutes)// - */ - get timeout(): number; - set timeout(timeout: number); - /** - * This function is called prior to each request, for example - * during a redirection or retry in case of server throttling. - * - * This offers an opportunity to populate headers or update - * content before sending a request. - */ - get preflightFunc(): null | FetchPreflightFunc; - set preflightFunc(preflight: null | FetchPreflightFunc); - /** - * This function is called after each response, offering an - * opportunity to provide client-level throttling or updating - * response data. - * - * Any error thrown in this causes the ``send()`` to throw. - * - * To schedule a retry attempt (assuming the maximum retry limit - * has not been reached), use [[response.throwThrottleError]]. - */ - get processFunc(): null | FetchProcessFunc; - set processFunc(process: null | FetchProcessFunc); - /** - * This function is called on each retry attempt. - */ - get retryFunc(): null | FetchRetryFunc; - set retryFunc(retry: null | FetchRetryFunc); - /** - * Create a new FetchRequest instance with default values. - * - * Once created, each property may be set before issuing a - * ``.send()`` to make the request. - */ - constructor(url: string); - toString(): string; - /** - * Update the throttle parameters used to determine maximum - * attempts and exponential-backoff properties. - */ - setThrottleParams(params: FetchThrottleParams): void; - /** - * Resolves to the response by sending the request. - */ - send(): Promise; - /** - * Cancels the inflight response, causing a ``CANCELLED`` - * error to be rejected from the [[send]]. - */ - cancel(): void; - /** - * Returns a new [[FetchRequest]] that represents the redirection - * to %%location%%. - */ - redirect(location: string): FetchRequest; - /** - * Create a new copy of this request. - */ - clone(): FetchRequest; - /** - * Locks all static configuration for gateways and FetchGetUrlFunc - * registration. - */ - static lockConfig(): void; - /** - * Get the current Gateway function for %%scheme%%. - */ - static getGateway(scheme: string): null | FetchGatewayFunc; - /** - * Use the %%func%% when fetching URIs using %%scheme%%. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGateway(scheme: string, func: FetchGatewayFunc): void; - /** - * Use %%getUrl%% when fetching URIs over HTTP and HTTPS requests. - * - * This method affects all requests globally. - * - * If [[lockConfig]] has been called, no change is made and this - * throws. - */ - static registerGetUrl(getUrl: FetchGetUrlFunc): void; - /** - * Creates a function that can "fetch" data URIs. - * - * Note that this is automatically done internally to support - * data URIs, so it is not necessary to register it. - * - * This is not generally something that is needed, but may - * be useful in a wrapper to perfom custom data URI functionality. - */ - static createDataGateway(): FetchGatewayFunc; - /** - * Creates a function that will fetch IPFS (unvalidated) from - * a custom gateway baseUrl. - * - * The default IPFS gateway used internally is - * ``"https:/\/gateway.ipfs.io/ipfs/"``. - */ - static createIpfsGatewayFunc(baseUrl: string): FetchGatewayFunc; -} -/** - * The response for a FetchREquest. - */ -export declare class FetchResponse implements Iterable<[key: string, value: string]> { - #private; - toString(): string; - /** - * The response status code. - */ - get statusCode(): number; - /** - * The response status message. - */ - get statusMessage(): string; - /** - * The response headers. All keys are lower-case. - */ - get headers(): Record; - /** - * The response body, or ``null`` if there was no body. - */ - get body(): null | Readonly; - /** - * The response body as a UTF-8 encoded string, or the empty - * string (i.e. ``""``) if there was no body. - * - * An error is thrown if the body is invalid UTF-8 data. - */ - get bodyText(): string; - /** - * The response body, decoded as JSON. - * - * An error is thrown if the body is invalid JSON-encoded data - * or if there was no body. - */ - get bodyJson(): any; - [Symbol.iterator](): Iterator<[key: string, value: string]>; - constructor(statusCode: number, statusMessage: string, headers: Readonly>, body: null | Uint8Array, request?: FetchRequest); - /** - * Return a Response with matching headers and body, but with - * an error status code (i.e. 599) and %%message%% with an - * optional %%error%%. - */ - makeServerError(message?: string, error?: Error): FetchResponse; - /** - * If called within a [request.processFunc](FetchRequest-processFunc) - * call, causes the request to retry as if throttled for %%stall%% - * milliseconds. - */ - throwThrottleError(message?: string, stall?: number): never; - /** - * Get the header value for %%key%%, ignoring case. - */ - getHeader(key: string): string; - /** - * Returns true of the response has a body. - */ - hasBody(): this is FetchResponse & { - body: Uint8Array; - }; - /** - * The request made for this response. - */ - get request(): null | FetchRequest; - /** - * Returns true if this response was a success statusCode. - */ - ok(): boolean; - /** - * Throws a ``SERVER_ERROR`` if this response is not ok. - */ - assertOk(): void; -} -//# sourceMappingURL=fetch.d.ts.map \ No newline at end of file diff --git a/types/utils/fetch.d.ts.map b/types/utils/fetch.d.ts.map deleted file mode 100644 index 59bbdc142..000000000 --- a/types/utils/fetch.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fetch.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI,EAAE,IAAI,GAAG,UAAU,CAA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,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAEtD;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,IAAI,GAAG,YAAY,CAEjC;IAED;;OAEG;IACH,EAAE,IAAI,OAAO,CAMZ;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAaf;CACD"} \ No newline at end of file diff --git a/types/utils/fixednumber.d.ts b/types/utils/fixednumber.d.ts deleted file mode 100644 index c8a28f158..000000000 --- a/types/utils/fixednumber.d.ts +++ /dev/null @@ -1,252 +0,0 @@ -import type { BigNumberish, BytesLike } from "./index.js"; -/** - * A description of a fixed-point arithmetic field. - * - * When specifying the fixed format, the values override the default of - * a ``fixed128x18``, which implies a signed 128-bit value with 18 - * decimals of precision. - * - * The alias ``fixed`` and ``ufixed`` can be used for ``fixed128x18`` and - * ``ufixed128x18`` respectively. - * - * When a fixed format string begins with a ``u``, it indicates the field - * is unsigned, so any negative values will overflow. The first number - * indicates the bit-width and the second number indicates the decimal - * precision. - * - * When a ``number`` is used for a fixed format, it indicates the number - * of decimal places, and the default width and signed-ness will be used. - * - * The bit-width must be byte aligned and the decimals can be at most 80. - */ -export type FixedFormat = number | string | { - signed?: boolean; - width?: number; - decimals?: number; -}; -/** - * A FixedNumber represents a value over its [[FixedFormat]] - * arithmetic field. - * - * A FixedNumber can be used to perform math, losslessly, on - * values which have decmial places. - * - * A FixedNumber has a fixed bit-width to store values in, and stores all - * values internally by multiplying the value by 10 raised to the power of - * %%decimals%%. - * - * If operations are performed that cause a value to grow too high (close to - * positive infinity) or too low (close to negative infinity), the value - * is said to //overflow//. - * - * For example, an 8-bit signed value, with 0 decimals may only be within - * the range ``-128`` to ``127``; so ``-128 - 1`` will overflow and become - * ``127``. Likewise, ``127 + 1`` will overflow and become ``-127``. - * - * Many operation have a normal and //unsafe// variant. The normal variant - * will throw a [[NumericFaultError]] on any overflow, while the //unsafe// - * variant will silently allow overflow, corrupting its value value. - * - * If operations are performed that cause a value to become too small - * (close to zero), the value loses precison and is said to //underflow//. - * - * For example, an value with 1 decimal place may store a number as small - * as ``0.1``, but the value of ``0.1 / 2`` is ``0.05``, which cannot fit - * into 1 decimal place, so underflow occurs which means precision is lost - * and the value becomes ``0``. - * - * Some operations have a normal and //signalling// variant. The normal - * variant will silently ignore underflow, while the //signalling// variant - * will thow a [[NumericFaultError]] on underflow. - */ -export declare class FixedNumber { - #private; - /** - * The specific fixed-point arithmetic field for this value. - */ - readonly format: string; - /** - * This is a property so console.log shows a human-meaningful value. - * - * @private - */ - readonly _value: string; - /** - * @private - */ - constructor(guard: any, value: bigint, format: any); - /** - * If true, negative values are permitted, otherwise only - * positive values and zero are allowed. - */ - get signed(): boolean; - /** - * The number of bits available to store the value. - */ - get width(): number; - /** - * The number of decimal places in the fixed-point arithment field. - */ - get decimals(): number; - /** - * The value as an integer, based on the smallest unit the - * [[decimals]] allow. - */ - get value(): bigint; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%, ignoring overflow. - */ - addUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% added - * to %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - add(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%, ignoring overflow. - */ - subUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%other%% subtracted - * from %%this%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - sub(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%, ignoring overflow and underflow (precision loss). - */ - mulUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs. - */ - mul(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% multiplied - * by %%other%%. A [[NumericFaultError]] is thrown if overflow - * occurs or if underflow (precision loss) occurs. - */ - mulSignal(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - divUnsafe(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%, ignoring underflow (precision loss). A - * [[NumericFaultError]] is thrown if overflow occurs. - */ - div(other: FixedNumber): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the result of %%this%% divided - * by %%other%%. A [[NumericFaultError]] is thrown if underflow - * (precision loss) occurs. - */ - divSignal(other: FixedNumber): FixedNumber; - /** - * Returns a comparison result between %%this%% and %%other%%. - * - * This is suitable for use in sorting, where ``-1`` implies %%this%% - * is smaller, ``1`` implies %%other%% is larger and ``0`` implies - * both are equal. - */ - cmp(other: FixedNumber): number; - /** - * Returns true if %%other%% is equal to %%this%%. - */ - eq(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than to %%this%%. - */ - lt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is less than or equal to %%this%%. - */ - lte(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than to %%this%%. - */ - gt(other: FixedNumber): boolean; - /** - * Returns true if %%other%% is greater than or equal to %%this%%. - */ - gte(other: FixedNumber): boolean; - /** - * Returns a new [[FixedNumber]] which is the largest **integer** - * that is less than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - floor(): FixedNumber; - /** - * Returns a new [[FixedNumber]] which is the smallest **integer** - * that is greater than or equal to %%this%%. - * - * The decimal component of the result will always be ``0``. - */ - ceiling(): FixedNumber; - /** - * Returns a new [[FixedNumber]] with the decimal component - * rounded up on ties at %%decimals%% places. - */ - round(decimals?: number): FixedNumber; - /** - * Returns true if %%this%% is equal to ``0``. - */ - isZero(): boolean; - /** - * Returns true if %%this%% is less than ``0``. - */ - isNegative(): boolean; - /** - * Returns the string representation of %%this%%. - */ - toString(): string; - /** - * Returns a float approximation. - * - * Due to IEEE 754 precission (or lack thereof), this function - * can only return an approximation and most values will contain - * rounding errors. - */ - toUnsafeFloat(): number; - /** - * Return a new [[FixedNumber]] with the same value but has had - * its field set to %%format%%. - * - * This will throw if the value cannot fit into %%format%%. - */ - toFormat(format: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% divided by - * %%decimal%% places with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% (once adjusted - * for %%decimals%%) cannot fit in %%format%%, either due to overflow - * or underflow (precision loss). - */ - static fromValue(_value: BigNumberish, decimals?: number, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] for %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%%, either due to overflow or underflow (precision loss). - */ - static fromString(_value: string, _format?: FixedFormat): FixedNumber; - /** - * Creates a new [[FixedNumber]] with the big-endian representation - * %%value%% with %%format%%. - * - * This will throw a [[NumericFaultError]] if %%value%% cannot fit - * in %%format%% due to overflow. - */ - static fromBytes(_value: BytesLike, _format?: FixedFormat): FixedNumber; -} -//# sourceMappingURL=fixednumber.d.ts.map \ No newline at end of file diff --git a/types/utils/fixednumber.d.ts.map b/types/utils/fixednumber.d.ts.map deleted file mode 100644 index 0acb110cb..000000000 --- a/types/utils/fixednumber.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"fixednumber.d.ts","sourceRoot":"","sources":["../../src.ts/utils/fixednumber.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AA4C1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,WAAW,GACpB,MAAM,GACN,MAAM,GACN;IACA,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAoJ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B;IAED;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE9B;IAED;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE9B;IAED;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE/B;IAED;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE9B;IAED;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE/B;IAED;;;;;OAKG;IACH,KAAK,IAAI,WAAW,CAOnB;IAED;;;;;OAKG;IACH,OAAO,IAAI,WAAW,CAOrB;IAED;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAoBpC;IAED;;OAEG;IACH,MAAM,IAAI,OAAO,CAEhB;IAED;;OAEG;IACH,UAAU,IAAI,OAAO,CAEpB;IAED;;OAEG;IACH,QAAQ,IAAI,MAAM,CAEjB;IAED;;;;;;OAMG;IACH,aAAa,IAAI,MAAM,CAEtB;IAED;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAEzC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,CACf,MAAM,EAAE,YAAY,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,WAAW,GACnB,WAAW,CA4Bb;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAuCpE;IAED;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,WAAW,CAWtE;CACD"} \ No newline at end of file diff --git a/types/utils/geturl-browser.d.ts b/types/utils/geturl-browser.d.ts deleted file mode 100644 index 29cebe088..000000000 --- a/types/utils/geturl-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -export declare function getUrl(req: FetchRequest, _signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl-browser.d.ts.map \ No newline at end of file diff --git a/types/utils/geturl-browser.d.ts.map b/types/utils/geturl-browser.d.ts.map deleted file mode 100644 index 3190d62cc..000000000 --- a/types/utils/geturl-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl-browser.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAIpB,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,OAAO,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA0DrC"} \ No newline at end of file diff --git a/types/utils/geturl.d.ts b/types/utils/geturl.d.ts deleted file mode 100644 index a4252134f..000000000 --- a/types/utils/geturl.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { FetchRequest, FetchCancelSignal, GetUrlResponse } from "./fetch.js"; -/** - * @_ignore: - */ -export declare function getUrl(req: FetchRequest, signal?: FetchCancelSignal): Promise; -//# sourceMappingURL=geturl.d.ts.map \ No newline at end of file diff --git a/types/utils/geturl.d.ts.map b/types/utils/geturl.d.ts.map deleted file mode 100644 index 7728357a3..000000000 --- a/types/utils/geturl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geturl.d.ts","sourceRoot":"","sources":["../../src.ts/utils/geturl.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,wBAAsB,MAAM,CAC3B,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,iBAAiB,GACxB,OAAO,CAAC,cAAc,CAAC,CAqGzB"} \ No newline at end of file diff --git a/types/utils/index.d.ts b/types/utils/index.d.ts deleted file mode 100644 index 40183df8b..000000000 --- a/types/utils/index.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * There are many simple utilities required to interact with - * Core and to simplify the library, without increasing - * the library dependencies for simple functions. - * - * @_section api/utils:Utilities [about-utils] - */ -export { decodeBase58, encodeBase58 } from "./base58.js"; -export { decodeBase64, encodeBase64 } from "./base64.js"; -export { getBytes, getBytesCopy, isHexString, isBytesLike, hexlify, concat, dataLength, dataSlice, stripZerosLeft, zeroPadValue, zeroPadBytes, arrayify, hexConcat, } from "./data.js"; -export { isCallException, isError, assert, assertArgument, assertArgumentCount, assertPrivate, assertNormalize, makeError, } from "./errors.js"; -export { EventPayload } from "./events.js"; -export { FetchRequest, FetchResponse, FetchCancelSignal } from "./fetch.js"; -export { FixedNumber } from "./fixednumber.js"; -export { fromTwos, toTwos, mask, getBigInt, getNumber, getUint, toBigInt, toNumber, toBeHex, toBeArray, toQuantity, } from "./maths.js"; -export { resolveProperties, defineProperties } from "./properties.js"; -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -export { formatXCB, parseXCB, formatUnits, parseUnits } from "./units.js"; -export { toUtf8Bytes, toUtf8CodePoints, toUtf8String, Utf8ErrorFuncs, } from "./utf8.js"; -export { uuidV4 } from "./uuid.js"; -export type { BytesLike } from "./data.js"; -export type { ErrorCode, CoreBCError, UnknownError, NotImplementedError, UnsupportedOperationError, NetworkError, ServerError, TimeoutError, BadDataError, CancelledError, BufferOverrunError, NumericFaultError, InvalidArgumentError, MissingArgumentError, UnexpectedArgumentError, CallExceptionError, InsufficientFundsError, NonceExpiredError, OffchainFaultError, ReplacementUnderpricedError, TransactionReplacedError, UnconfiguredNameError, ActionRejectedError, CallExceptionAction, CallExceptionTransaction, CodedCoreBCError, } from "./errors.js"; -export type { EventEmitterable, Listener } from "./events.js"; -export type { GetUrlResponse, FetchPreflightFunc, FetchProcessFunc, FetchRetryFunc, FetchGatewayFunc, FetchGetUrlFunc, } from "./fetch.js"; -export type { FixedFormat } from "./fixednumber.js"; -export type { BigNumberish, Numeric } from "./maths.js"; -export type { RlpStructuredData } from "./rlp.js"; -export type { Utf8ErrorFunc, UnicodeNormalizationForm, Utf8ErrorReason, } from "./utf8.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/utils/index.d.ts.map b/types/utils/index.d.ts.map deleted file mode 100644 index 2be8f026a..000000000 --- a/types/utils/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,OAAO,EACP,MAAM,EACN,UAAU,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,GACT,MAAM,WAAW,CAAC;AAEnB,OAAO,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,SAAS,GACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EACN,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,SAAS,EACT,UAAU,GACV,MAAM,YAAY,C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M,WAAW,CAAC"} \ No newline at end of file diff --git a/types/utils/maths.d.ts b/types/utils/maths.d.ts deleted file mode 100644 index e1fd19522..000000000 --- a/types/utils/maths.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -import type { BytesLike } from "./data.js"; -/** - * Any type that can be used where a numeric value is needed. - */ -export type Numeric = number | bigint; -/** - * Any type that can be used where a big number is needed. - */ -export type BigNumberish = string | Numeric; -/** - * Convert %%value%% from a twos-compliment representation of %%width%% - * bits to its value. - * - * If the highest bit is ``1``, the result will be negative. - */ -export declare function fromTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Convert %%value%% to a twos-compliment representation of - * %%width%% bits. - * - * The result will always be positive. - */ -export declare function toTwos(_value: BigNumberish, _width: Numeric): bigint; -/** - * Mask %%value%% with a bitmask of %%bits%% ones. - */ -export declare function mask(_value: BigNumberish, _bits: Numeric): bigint; -/** - * Gets a BigInt from %%value%%. If it is an invalid value for - * a BigInt, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getBigInt(value: BigNumberish, name?: string): bigint; -export declare function getUint(value: BigNumberish, name?: string): bigint; -export declare function toBigInt(value: BigNumberish | Uint8Array): bigint; -/** - * Gets a //number// from %%value%%. If it is an invalid value for - * a //number//, then an ArgumentError will be thrown for %%name%%. - */ -export declare function getNumber(value: BigNumberish, name?: string): number; -/** - * Converts %%value%% to a number. If %%value%% is a Uint8Array, it - * is treated as Big Endian data. Throws if the value is not safe. - */ -export declare function toNumber(value: BigNumberish | Uint8Array): number; -/** - * Converts %%value%% to a Big Endian hexstring, optionally padded to - * %%width%% bytes. - */ -export declare function toBeHex(_value: BigNumberish, _width?: Numeric): string; -/** - * Converts %%value%% to a Big Endian Uint8Array. - */ -export declare function toBeArray(_value: BigNumberish): Uint8Array; -/** - * Returns a [[HexString]] for %%value%% safe to use as a //Quantity//. - * - * A //Quantity// does not have and leading 0 values unless the value is - * the literal value `0x0`. This is most commonly used for JSSON-RPC - * numeric values. - */ -export declare function toQuantity(value: BytesLike | BigNumberish): string; -//# sourceMappingURL=maths.d.ts.map \ No newline at end of file diff --git a/types/utils/maths.d.ts.map b/types/utils/maths.d.ts.map deleted file mode 100644 index 375586bed..000000000 --- a/types/utils/maths.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"maths.d.ts","sourceRoot":"","sources":["../../src.ts/utils/maths.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,OAAO,CAAC;AAU5C;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAiBtE;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CAwBpE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAIjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAqCpE;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAQlE;AAQD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAWjE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAwCpE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,MAAM,CAEjE;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CA8BtE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAmB1D;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,GAAG,MAAM,CAWlE"} \ No newline at end of file diff --git a/types/utils/properties.d.ts b/types/utils/properties.d.ts deleted file mode 100644 index f7871cc89..000000000 --- a/types/utils/properties.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Resolves to a new object that is a copy of %%value%%, but with all - * values resolved. - */ -export declare function resolveProperties(value: { - [P in keyof T]: T[P] | Promise; -}): Promise; -/** - * Assigns the %%values%% to %%target%% as read-only values. - * - * It %%types%% is specified, the values are checked. - */ -export declare function defineProperties(target: T, values: { - [K in keyof T]?: T[K]; -}, types?: { - [K in keyof T]?: string; -}): void; -export declare function checkProperties(object: any, properties: { - [name: string]: boolean; -}): void; -//# sourceMappingURL=properties.d.ts.map \ No newline at end of file diff --git a/types/utils/properties.d.ts.map b/types/utils/properties.d.ts.map deleted file mode 100644 index b675427ea..000000000 --- a/types/utils/properties.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src.ts/utils/properties.ts"],"names":[],"mappings":"AAiCA;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE;KAChD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACpC,GAAG,OAAO,CAAC,CAAC,CAAC,CAYb;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EACjC,MAAM,EAAE,CAAC,EACT,MAAM,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAAE,EACjC,KAAK,CAAC,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;CAAE,GACjC,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC9B,MAAM,EAAE,GAAG,EACX,UAAU,EAAE;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACrC,IAAI,CAcN"} \ No newline at end of file diff --git a/types/utils/rlp-decode.d.ts b/types/utils/rlp-decode.d.ts deleted file mode 100644 index b77b08b9c..000000000 --- a/types/utils/rlp-decode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { BytesLike, RlpStructuredData } from "./index.js"; -/** - * Decodes %%data%% into the structured data it represents. - */ -export declare function decodeRlp(_data: BytesLike): RlpStructuredData; -//# sourceMappingURL=rlp-decode.d.ts.map \ No newline at end of file diff --git a/types/utils/rlp-decode.d.ts.map b/types/utils/rlp-decode.d.ts.map deleted file mode 100644 index b82126ab8..000000000 --- a/types/utils/rlp-decode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-decode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-decode.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAyH/D;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB,CAU7D"} \ No newline at end of file diff --git a/types/utils/rlp-encode.d.ts b/types/utils/rlp-encode.d.ts deleted file mode 100644 index 9c3d024ac..000000000 --- a/types/utils/rlp-encode.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { RlpStructuredData } from "./rlp.js"; -/** - * Encodes %%object%% as an RLP-encoded [[DataHexString]]. - */ -export declare function encodeRlp(object: RlpStructuredData): string; -//# sourceMappingURL=rlp-encode.d.ts.map \ No newline at end of file diff --git a/types/utils/rlp-encode.d.ts.map b/types/utils/rlp-encode.d.ts.map deleted file mode 100644 index 3fa6ef0ba..000000000 --- a/types/utils/rlp-encode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp-encode.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp-encode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAgDlD;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAO3D"} \ No newline at end of file diff --git a/types/utils/rlp.d.ts b/types/utils/rlp.d.ts deleted file mode 100644 index 6ef450115..000000000 --- a/types/utils/rlp.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * The [[link-rlp]] (RLP) encoding is used throughout Core - * to serialize nested structures of Arrays and data. - * - * @_subsection api/utils:Recursive-Length Prefix [about-rlp] - */ -export { decodeRlp } from "./rlp-decode.js"; -export { encodeRlp } from "./rlp-encode.js"; -/** - * An RLP-encoded structure. - */ -export type RlpStructuredData = string | Array; -//# sourceMappingURL=rlp.d.ts.map \ No newline at end of file diff --git a/types/utils/rlp.d.ts.map b/types/utils/rlp.d.ts.map deleted file mode 100644 index c5043abd3..000000000 --- a/types/utils/rlp.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rlp.d.ts","sourceRoot":"","sources":["../../src.ts/utils/rlp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC"} \ No newline at end of file diff --git a/types/utils/units.d.ts b/types/utils/units.d.ts deleted file mode 100644 index dfb7a32a6..000000000 --- a/types/utils/units.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { BigNumberish, Numeric } from "../utils/index.js"; -/** - * Converts %%value%% into a //decimal string//, assuming %%unit%% decimal - * places. The %%unit%% may be the number of decimal places or the name of - * a unit - * - */ -export declare function formatUnits(value: BigNumberish, unit?: string | Numeric): string; -/** - * Converts the //decimal string// %%value%% to a BigInt, assuming - * %%unit%% decimal places. The %%unit%% may the number of decimal places - * or the name of a unit. - */ -export declare const scientificToDecimal: (num: string | number) => string | number; -export declare const trimDecimals: (n: string, decimals?: number) => string; -export declare function parseUnits(value: string, unit?: string | Numeric): bigint; -/** - * Converts %%value%% into a //decimal string// using 18 decimal places. - */ -export declare function formatXCB(ore: BigNumberish): string; -/** - * Converts the //decimal string// %%xcb%% to a BigInt, using 18 - * decimal places. - */ -export declare function parseXCB(xcb: string): bigint; -//# sourceMappingURL=units.d.ts.map \ No newline at end of file diff --git a/types/utils/units.d.ts.map b/types/utils/units.d.ts.map deleted file mode 100644 index fef9d60bc..000000000 --- a/types/utils/units.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"units.d.ts","sourceRoot":"","sources":["../../src.ts/utils/units.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAwB/D;;;;;GAKG;AACH,wBAAgB,WAAW,CAC1B,KAAK,EAAE,YAAY,EACnB,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GACrB,MAAM,CAWR;AAED;;;;GAIG;AAEH,eAAO,MAAM,mBAAmB,QAAS,MAAM,GAAG,MAAM,oBA6CvD,CAAC;AACF,eAAO,MAAM,YAAY,MAAO,MAAM,8BAQrC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAsBzE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"} \ No newline at end of file diff --git a/types/utils/utf8.d.ts b/types/utils/utf8.d.ts deleted file mode 100644 index 7bb87cc7d..000000000 --- a/types/utils/utf8.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * The stanard normalization forms. - */ -export type UnicodeNormalizationForm = "NFC" | "NFD" | "NFKC" | "NFKD"; -/** - * When using the UTF-8 error API the following errors can be intercepted - * and processed as the %%reason%% passed to the [[Utf8ErrorFunc]]. - * - * **``"UNEXPECTED_CONTINUE"``** - a continuation byte was present where there - * was nothing to continue. - * - * **``"BAD_PREFIX"``** - an invalid (non-continuation) byte to start a - * UTF-8 codepoint was found. - * - * **``"OVERRUN"``** - the string is too short to process the expected - * codepoint length. - * - * **``"MISSING_CONTINUE"``** - a missing continuation byte was expected but - * not found. The %%offset%% indicates the index the continuation byte - * was expected at. - * - * **``"OUT_OF_RANGE"``** - the computed code point is outside the range - * for UTF-8. The %%badCodepoint%% indicates the computed codepoint, which was - * outside the valid UTF-8 range. - * - * **``"UTF16_SURROGATE"``** - the UTF-8 strings contained a UTF-16 surrogate - * pair. The %%badCodepoint%% is the computed codepoint, which was inside the - * UTF-16 surrogate range. - * - * **``"OVERLONG"``** - the string is an overlong representation. The - * %%badCodepoint%% indicates the computed codepoint, which has already - * been bounds checked. - * - * - * @returns string - */ -export type Utf8ErrorReason = "UNEXPECTED_CONTINUE" | "BAD_PREFIX" | "OVERRUN" | "MISSING_CONTINUE" | "OUT_OF_RANGE" | "UTF16_SURROGATE" | "OVERLONG"; -/** - * A callback that can be used with [[toUtf8String]] to analysis or - * recovery from invalid UTF-8 data. - * - * Parsing UTF-8 data is done through a simple Finite-State Machine (FSM) - * which calls the ``Utf8ErrorFunc`` if a fault is detected. - * - * The %%reason%% indicates where in the FSM execution the fault - * occurred and the %%offset%% indicates where the input failed. - * - * The %%bytes%% represents the raw UTF-8 data that was provided and - * %%output%% is the current array of UTF-8 code-points, which may - * be updated by the ``Utf8ErrorFunc``. - * - * The value of the %%badCodepoint%% depends on the %%reason%%. See - * [[Utf8ErrorReason]] for details. - * - * The function should return the number of bytes that should be skipped - * when control resumes to the FSM. - */ -export type Utf8ErrorFunc = (reason: Utf8ErrorReason, offset: number, bytes: Uint8Array, output: Array, badCodepoint?: number) => number; -/** - * A handful of popular, built-in UTF-8 error handling strategies. - * - * **``"error"``** - throws on ANY illegal UTF-8 sequence or - * non-canonical (overlong) codepoints (this is the default) - * - * **``"ignore"``** - silently drops any illegal UTF-8 sequence - * and accepts non-canonical (overlong) codepoints - * - * **``"replace"``** - replace any illegal UTF-8 sequence with the - * UTF-8 replacement character (i.e. ``"\\ufffd"``) and accepts - * non-canonical (overlong) codepoints - * - * @returns: Record<"error" | "ignore" | "replace", Utf8ErrorFunc> - */ -export declare const Utf8ErrorFuncs: Readonly>; -/** - * Returns the UTF-8 byte representation of %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8Bytes(str: string, form?: UnicodeNormalizationForm): Uint8Array; -/** - * Returns the string represented by the UTF-8 data %%bytes%%. - * - * When %%onError%% function is specified, it is called on UTF-8 - * errors allowing recovery using the [[Utf8ErrorFunc]] API. - * (default: [error](Utf8ErrorFuncs)) - */ -export declare function toUtf8String(bytes: BytesLike, onError?: Utf8ErrorFunc): string; -/** - * Returns the UTF-8 code-points for %%str%%. - * - * If %%form%% is specified, the string is normalized. - */ -export declare function toUtf8CodePoints(str: string, form?: UnicodeNormalizationForm): Array; -//# sourceMappingURL=utf8.d.ts.map \ No newline at end of file diff --git a/types/utils/utf8.d.ts.map b/types/utils/utf8.d.ts.map deleted file mode 100644 index febc8e114..000000000 --- a/types/utils/utf8.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utf8.d.ts","sourceRoot":"","sources":["../../src.ts/utils/utf8.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI5C;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,MAAM,eAAe,GACxB,qBAAqB,GACrB,YAAY,GACZ,SAAS,GACT,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,UAAU,CAAC;AAEd;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,aAAa,GAAG,CAC3B,MAAM,EAAE,eAAe,EACvB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EACrB,YAAY,CAAC,EAAE,MAAM,KACjB,MAAM,CAAC;AAwEZ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CACpC,MAAM,CAAC,OAAO,GAAG,QAAQ,GAAG,SAAS,EAAE,aAAa,CAAC,CAKpD,CAAC;AA2GH;;;;GAIG;AACH,wBAAgB,WAAW,CAC1B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,UAAU,CAwCZ;AAkBD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC3B,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,aAAa,GACrB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,wBAAwB,GAC7B,KAAK,CAAC,MAAM,CAAC,CAEf"} \ No newline at end of file diff --git a/types/utils/uuid.d.ts b/types/utils/uuid.d.ts deleted file mode 100644 index 7b7465157..000000000 --- a/types/utils/uuid.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BytesLike } from "./index.js"; -/** - * Returns the version 4 [[link-uuid]] for the %%randomBytes%%. - * - * @see: https://www.ietf.org/rfc/rfc4122.txt (Section 4.4) - */ -export declare function uuidV4(randomBytes: BytesLike): string; -//# sourceMappingURL=uuid.d.ts.map \ No newline at end of file diff --git a/types/utils/uuid.d.ts.map b/types/utils/uuid.d.ts.map deleted file mode 100644 index f3cf307c6..000000000 --- a/types/utils/uuid.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src.ts/utils/uuid.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAqBrD"} \ No newline at end of file diff --git a/types/wallet/base-wallet.d.ts b/types/wallet/base-wallet.d.ts deleted file mode 100644 index a788c67b2..000000000 --- a/types/wallet/base-wallet.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { AbstractSigner } from "../providers/index.js"; -import { SigningKey } from "../crypto/index.js"; -import type { TypedDataDomain, TypedDataField } from "../hash/index.js"; -import type { Provider, TransactionRequest } from "../providers/index.js"; -/** - * The **BaseWallet** is a stream-lined implementation of a - * [[Signer]] that operates with a private key. - * - * It is preferred to use the [[Wallet]] class, as it offers - * additional functionality and simplifies loading a variety - * of JSON formats, Mnemonic Phrases, etc. - * - * This class may be of use for those attempting to implement - * a minimal Signer. - */ -export declare class BaseWallet extends AbstractSigner { - #private; - /** - * The wallet address. - */ - readonly address: string; - readonly prefix: string; - /** - * Creates a new BaseWallet for %%privateKey%%, optionally - * connected to %%provider%%. - * - * If %%provider%% is not specified, only offline methods can - * be used. - */ - constructor({ signingKey, prefix, provider, }: { - signingKey: SigningKey; - prefix: string; - provider?: null | Provider; - }); - /** - * The [[SigningKey]] used for signing payloads. - */ - get signingKey(): SigningKey; - /** - * The private key for this wallet. - */ - get privateKey(): string; - getAddress(): Promise; - connect(provider: null | Provider): BaseWallet; - signTransaction(tx: TransactionRequest): Promise; - signMessage(message: string | Uint8Array): Promise; - /** - * Returns the signature for %%message%% signed with this wallet. - */ - signMessageSync(message: string | Uint8Array): string; - signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; -} -//# sourceMappingURL=base-wallet.d.ts.map \ No newline at end of file diff --git a/types/wallet/base-wallet.d.ts.map b/types/wallet/base-wallet.d.ts.map deleted file mode 100644 index 9b7a9bb96..000000000 --- a/types/wallet/base-wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"base-wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/base-wallet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AASvD,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG1E;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,cAAc;;IAC7C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAIxB;;;;;;OAMG;IACH,YAAY,EACX,UAAU,EACV,MAAM,EACN,QAAQ,GACR,EAAE;QACF,UAAU,EAAE,UAAU,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,EAcA;IAKD;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAEK,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAElC;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,UAAU,CAM7C;IAEK,eAAe,CAAC,EAAE,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B7D;IAEK,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAID;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAEpD;IAEK,aAAa,CAClB,MAAM,EAAE,eAAe,EACvB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,EAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC,CAgCjB;CACD"} \ No newline at end of file diff --git a/types/wallet/english_words.d.ts b/types/wallet/english_words.d.ts deleted file mode 100644 index fec60c704..000000000 --- a/types/wallet/english_words.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const englishWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=english_words.d.ts.map \ No newline at end of file diff --git a/types/wallet/english_words.d.ts.map b/types/wallet/english_words.d.ts.map deleted file mode 100644 index b0bd73fa9..000000000 --- a/types/wallet/english_words.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"english_words.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/english_words.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,i0VACsyV,CAAC"} \ No newline at end of file diff --git a/types/wallet/hdwallet.d.ts b/types/wallet/hdwallet.d.ts deleted file mode 100644 index 7c96fb8a0..000000000 --- a/types/wallet/hdwallet.d.ts +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Explain HD Wallets.. - * - * @_subsection: api/wallet:HD Wallets [hd-wallets] - */ -import { SigningKey } from "../crypto/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { Mnemonic } from "./mnemonic.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -import type { Numeric } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * The default derivation path for Core HD Nodes. (i.e. ``"m/44'/60'/0'/0/0"``) - */ -export declare const defaultPath: string; -/** - * An **HDNodeWallet** is a [[Signer]] backed by the private key derived - * from an HD Node using the [[link-bip-32]] stantard. - * - * An HD Node forms a hierarchal structure with each HD Node having a - * private key and the ability to derive child HD Nodes, defined by - * a path indicating the index of each child. - */ -export declare class HDNodeWallet extends BaseWallet { - #private; - /** - * The compressed public key. - */ - readonly publicKey: string; - prefix: string; - /** - * The fingerprint. - * - * A fingerprint allows quick qay to detect parent and child nodes, - * but developers should be prepared to deal with collisions as it - * is only 4 bytes. - */ - readonly fingerprint: string; - /** - * The parent fingerprint. - */ - readonly parentFingerprint: string; - /** - * The mnemonic used to create this HD Node, if available. - * - * Sources such as extended keys do not encode the mnemonic, in - * which case this will be ``null``. - */ - readonly mnemonic: null | Mnemonic; - /** - * The derivation path of this wallet. - * - * Since extended keys do not provider full path details, this - * may be ``null``, if instantiated from a source that does not - * enocde it. - */ - readonly path: null | string; - /** - * The child index of this wallet. Values over ``2 *\* 31`` indicate - * the node is hardened. - */ - readonly index: number; - /** - * The depth of this wallet, which is the number of components - * in its path. - */ - readonly depth: number; - /** - * @private - */ - constructor({ guard, seed, signingKey, parentFingerprint, path, index, depth, mnemonic, provider, prefix, }: { - guard: any; - seed: string; - signingKey: SigningKey; - parentFingerprint: string; - path: null | string; - index: number; - depth: number; - mnemonic: null | Mnemonic; - provider: null | Provider; - prefix: string; - }); - connect(provider: null | Provider): HDNodeWallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * Returns true if this wallet has a path, providing a Type Guard - * that the path is non-null. - */ - hasPath(): this is { - path: string; - }; - /** - * Return the child for %%index%%. - */ - deriveChild(_index: number): HDNodeWallet; - /** - * Return the HDNode for %%path%% from this node. - */ - derivePath(path: string): HDNodeWallet; - /** - * Creates a new random HDNode. - */ - static createRandom(prefix: string, password?: string, path?: string, wordlist?: Wordlist): HDNodeWallet; - /** - * Create am HD Node from %%mnemonic%%. - */ - static fromMnemonic(mnemonic: Mnemonic, prefix: string, path?: string): HDNodeWallet; - static mnemonicToSeed(mnemonic: string, password?: string): string; - /** - * Creates an HD Node from a mnemonic %%phrase%%. - */ - static fromPhrase({ phrase, prefix, password, path, wordlist, }: { - phrase: string; - prefix: string; - password?: string; - path?: string; - wordlist?: Wordlist; - }): HDNodeWallet; - /** - * Creates an HD Node from a %%seed%%. - */ - static fromSeed({ seed, prefix, path, }: { - seed: string; - prefix: string; - path?: string; - }): HDNodeWallet; -} -/** - * Returns the [[link-bip-32]] path for the acount at %%index%%. - * - * This is the pattern used by wallets like Ledger. - * - * There is also an [alternate pattern](getIndexedAccountPath) used by - * some software. - */ -export declare function getAccountPath(_index: Numeric): string; -/** - * Returns the path using an alternative pattern for deriving accounts, - * at %%index%%. - * - * This derivation path uses the //index// component rather than the - * //account// component to derive sequential accounts. - * - * This is the pattern used by wallets like MetaMask. - */ -export declare function getIndexedAccountPath(_index: Numeric): string; -//# sourceMappingURL=hdwallet.d.ts.map \ No newline at end of file diff --git a/types/wallet/hdwallet.d.ts.map b/types/wallet/hdwallet.d.ts.map deleted file mode 100644 index 6ff875955..000000000 --- a/types/wallet/hdwallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"hdwallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/hdwallet.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAA0B,UAAU,EAAU,MAAM,oBAAoB,CAAC;AAUhF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAMzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAetD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAY,CAAC;AAiFvC;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,UAAU;;IAC3C;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAG,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,EAAG,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,iBAAiB,EAAG,MAAM,CAAC;IAEpC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAG,IAAI,GAAG,QAAQ,CAAC;IAGpC;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAG,IAAI,GAAG,MAAM,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAG,MAAM,CAAC;IAExB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,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,GACX,YAAY,CASd;IACD,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAGjE;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAiBf;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;KACd,GAAG,YAAY,CAOf;CACD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAStD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAS7D"} \ No newline at end of file diff --git a/types/wallet/index.d.ts b/types/wallet/index.d.ts deleted file mode 100644 index d3db8f37c..000000000 --- a/types/wallet/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * When interacting with Core, it is necessary to use a private - * key authenticate actions by signing a payload. - * - * Wallets are the simplest way to expose the concept of an - * //Externally Owner Account// (EOA) as it wraps a private key - * and supports high-level methods to sign common types of interaction - * and send transactions. - * - * The class most developers will want to use is [[Wallet]], which - * can load a private key directly or from any common wallet format. - * - * The [[HDNodeWallet]] can be used when it is necessary to access - * low-level details of how an HD wallets are derived, exported - * or imported. - * - * @_section: api/wallet:Wallets [about-wallets] - */ -export { BaseWallet } from "./base-wallet.js"; -export { defaultPath, getAccountPath, getIndexedAccountPath, HDNodeWallet, } from "./hdwallet.js"; -export { isCrowdsaleJson, decryptCrowdsaleJson } from "./json-crowdsale.js"; -export { isKeystoreJson, decryptKeystoreJsonSync, decryptKeystoreJson, encryptKeystoreJson, encryptKeystoreJsonSync, } from "./json-keystore.js"; -export { Mnemonic } from "./mnemonic.js"; -export { Wallet } from "./wallet.js"; -export type { CrowdsaleAccount } from "./json-crowdsale.js"; -export type { KeystoreAccount, EncryptOptions } from "./json-keystore.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/wallet/index.d.ts.map b/types/wallet/index.d.ts.map deleted file mode 100644 index f380a0adc..000000000 --- a/types/wallet/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACN,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,GACZ,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"} \ No newline at end of file diff --git a/types/wallet/json-crowdsale.d.ts b/types/wallet/json-crowdsale.d.ts deleted file mode 100644 index 65b5f0251..000000000 --- a/types/wallet/json-crowdsale.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * The data stored within a JSON Crowdsale wallet is fairly - * minimal. - */ -export type CrowdsaleAccount = { - privateKey: string; - address: string; -}; -/** - * Returns true if %%json%% is a valid JSON Crowdsale wallet. - */ -export declare function isCrowdsaleJson(json: string): boolean; -/** - * Before Core launched, it was necessary to create a wallet - * format for backers to use, which would be used to receive xcb - * as a reward for contributing to the project. - * - * The [[link-crowdsale]] format is now obsolete, but it is still - * useful to support and the additional code is fairly trivial as - * all the primitives required are used through core portions of - * the library. - */ -export declare function decryptCrowdsaleJson(json: string, _password: string | Uint8Array): CrowdsaleAccount; -//# sourceMappingURL=json-crowdsale.d.ts.map \ No newline at end of file diff --git a/types/wallet/json-crowdsale.d.ts.map b/types/wallet/json-crowdsale.d.ts.map deleted file mode 100644 index db8057554..000000000 --- a/types/wallet/json-crowdsale.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-crowdsale.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-crowdsale.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,gBAAgB,CAmClB"} \ No newline at end of file diff --git a/types/wallet/json-keystore.d.ts b/types/wallet/json-keystore.d.ts deleted file mode 100644 index 363fd7956..000000000 --- a/types/wallet/json-keystore.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { ProgressCallback } from "../crypto/index.js"; -import type { BytesLike } from "../utils/index.js"; -/** - * The contents of a JSON Keystore Wallet. - */ -export type KeystoreAccount = { - address: string; - privateKey: string; - mnemonic?: { - path?: string; - locale?: string; - entropy: string; - }; -}; -/** - * The parameters to use when encrypting a JSON Keystore Wallet. - */ -export type EncryptOptions = { - progressCallback?: ProgressCallback; - iv?: BytesLike; - entropy?: BytesLike; - client?: string; - salt?: BytesLike; - uuid?: string; - scrypt?: { - N?: number; - r?: number; - p?: number; - }; -}; -/** - * Returns true if %%json%% is a valid JSON Keystore Wallet. - */ -export declare function isKeystoreJson(json: string): boolean; -/** - * Returns the account details for the JSON Keystore Wallet %%json%% - * using %%password%%. - * - * It is preferred to use the [async version](decryptKeystoreJson) - * instead, which allows a [[ProgressCallback]] to keep the user informed - * as to the decryption status. - * - * This method will block the event loop (freezing all UI) until decryption - * is complete, which can take quite some time, depending on the wallet - * paramters and platform. - */ -export declare function decryptKeystoreJsonSync(json: string, _password: string | Uint8Array): KeystoreAccount; -/** - * Resolves to the decrypted JSON Keystore Wallet %%json%% using the - * %%password%%. - * - * If provided, %%progress%% will be called periodically during the - * decrpytion to provide feedback, and if the function returns - * ``false`` will halt decryption. - * - * The %%progressCallback%% will **always** receive ``0`` before - * decryption begins and ``1`` when complete. - */ -export declare function decryptKeystoreJson(json: string, _password: string | Uint8Array, progress?: ProgressCallback): Promise; -/** - * Return the JSON Keystore Wallet for %%account%% encrypted with - * %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used. Any provided [[ProgressCallback]] is ignord. - */ -export declare function encryptKeystoreJsonSync(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): string; -/** - * Resolved to the JSON Keystore Wallet for %%account%% encrypted - * with %%password%%. - * - * The %%options%% can be used to tune the password-based key - * derivation function parameters, explicitly set the random values - * used and provide a [[ProgressCallback]] to receive periodic updates - * on the completion status.. - */ -export declare function encryptKeystoreJson(account: KeystoreAccount, password: string | Uint8Array, options?: EncryptOptions): Promise; -//# sourceMappingURL=json-keystore.d.ts.map \ No newline at end of file diff --git a/types/wallet/json-keystore.d.ts.map b/types/wallet/json-keystore.d.ts.map deleted file mode 100644 index 742508cc1..000000000 --- a/types/wallet/json-keystore.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"json-keystore.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/json-keystore.ts"],"names":[],"mappings":"AAoCA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAOnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACV,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,EAAE,CAAC,EAAE,SAAS,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACR,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACX,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CASpD;AAkLD;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,GAC5B,eAAe,CAmBjB;AAUD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACxC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAAG,UAAU,EAC9B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,eAAe,CAAC,CA2B1B;AA8ID;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,MAAM,CASR;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,MAAM,GAAG,UAAU,EAC7B,OAAO,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,MAAM,CAAC,CAiBjB"} \ No newline at end of file diff --git a/types/wallet/mnemonic.d.ts b/types/wallet/mnemonic.d.ts deleted file mode 100644 index 64ef1a10e..000000000 --- a/types/wallet/mnemonic.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -import type { BytesLike } from "../utils/index.js"; -import type { Wordlist } from "../wordlists/index.js"; -/** - * A **Mnemonic** wraps all properties required to compute [[link-bip-39]] - * seeds and convert between phrases and entropy. - */ -export declare class Mnemonic { - /** - * The mnemonic phrase of 12, 15, 18, 21 or 24 words. - * - * Use the [[wordlist]] ``split`` method to get the individual words. - */ - readonly phrase: string; - /** - * The password used for this mnemonic. If no password is used this - * is the empty string (i.e. ``""``) as per the specification. - */ - readonly password: string; - /** - * The wordlist for this mnemonic. - */ - readonly wordlist: Wordlist; - /** - * The underlying entropy which the mnemonic encodes. - */ - readonly entropy: string; - /** - * @private - */ - constructor(guard: any, entropy: string, phrase: string, password?: null | string, wordlist?: null | Wordlist); - /** - * Returns the seed for the mnemonic. - */ - computeSeed(): string; - /** - * Creates a new Mnemonic for the %%phrase%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromPhrase({ phrase, password, wordlist, }: { - phrase: string; - password?: null | string; - wordlist?: null | Wordlist; - }): Mnemonic; - /** - * Create a new **Mnemonic** from the %%entropy%%. - * - * The default %%password%% is the empty string and the default - * wordlist is the [English wordlists](LangEn). - */ - static fromEntropy(_entropy: BytesLike, password?: null | string, wordlist?: null | Wordlist): Mnemonic; - /** - * Returns the phrase for %%mnemonic%%. - */ - static entropyToPhrase(_entropy: BytesLike, wordlist?: null | Wordlist): string; - /** - * Returns the entropy for %%phrase%%. - */ - static phraseToEntropy(phrase: string, wordlist?: null | Wordlist): string; - /** - * Returns true if %%phrase%% is a valid [[link-bip-39]] phrase. - * - * This checks all the provided words belong to the %%wordlist%%, - * that the length is valid and the checksum is correct. - */ - static isValidMnemonic(phrase: string, wordlist?: null | Wordlist): boolean; -} -//# sourceMappingURL=mnemonic.d.ts.map \ No newline at end of file diff --git a/types/wallet/mnemonic.d.ts.map b/types/wallet/mnemonic.d.ts.map deleted file mode 100644 index 1f5e4541d..000000000 --- a/types/wallet/mnemonic.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonic.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA6HtD;;;GAGG;AACH,qBAAa,QAAQ;IACpB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAG,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAG,QAAQ,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAG,MAAM,CAAC;IAE1B;;OAEG;IACH,YACC,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,EAU1B;IAED;;OAEG;IACH,WAAW,IAAI,MAAM,CAEpB;IAED;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,QAAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;QACzB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,GAAG,QAAQ,CAKX;IAED;;;;;OAKG;IACH,MAAM,CAAC,WAAW,CACjB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,MAAM,EACxB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,QAAQ,CAIV;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CACrB,QAAQ,EAAE,SAAS,EACnB,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,MAAM,CAGR;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAEzE;IAED;;;;;OAKG;IACH,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GAAG,OAAO,CAM1E;CACD"} \ No newline at end of file diff --git a/types/wallet/mnemonicToSeed.d.ts b/types/wallet/mnemonicToSeed.d.ts deleted file mode 100644 index ee0ed82a0..000000000 --- a/types/wallet/mnemonicToSeed.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function mnemonicToSeed(mnemonic: string, password?: string): string; -//# sourceMappingURL=mnemonicToSeed.d.ts.map \ No newline at end of file diff --git a/types/wallet/mnemonicToSeed.d.ts.map b/types/wallet/mnemonicToSeed.d.ts.map deleted file mode 100644 index 87afb28cf..000000000 --- a/types/wallet/mnemonicToSeed.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mnemonicToSeed.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/mnemonicToSeed.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1E"} \ No newline at end of file diff --git a/types/wallet/utils.d.ts b/types/wallet/utils.d.ts deleted file mode 100644 index 0d4baabe8..000000000 --- a/types/wallet/utils.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @_ignore - */ -export declare function looseArrayify(hexString: string): Uint8Array; -export declare function zpad(value: String | number, length: number): String; -export declare function getPassword(password: string | Uint8Array): Uint8Array; -export declare function spelunk(object: any, _path: string): T; -//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/types/wallet/utils.d.ts.map b/types/wallet/utils.d.ts.map deleted file mode 100644 index 4c02cc44f..000000000 --- a/types/wallet/utils.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,CAK3D;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMnE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAKrE;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAoExD"} \ No newline at end of file diff --git a/types/wallet/wallet.d.ts b/types/wallet/wallet.d.ts deleted file mode 100644 index 384cb372f..000000000 --- a/types/wallet/wallet.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { SigningKey } from "../crypto/index.js"; -import { BaseWallet } from "./base-wallet.js"; -import { HDNodeWallet } from "./hdwallet.js"; -import type { ProgressCallback } from "../crypto/index.js"; -import type { Provider } from "../providers/index.js"; -/** - * A **Wallet** manages a single private key which is used to sign - * transactions, messages and other common payloads. - * - * This class is generally the main entry point for developers - * that wish to use a private key directly, as it can create - * instances from a large variety of common sources, including - * raw private key, [[link-bip-39]] mnemonics and encrypte JSON - * wallets. - */ -export declare class Wallet extends BaseWallet { - #private; - /** - * Create a new wallet for the %%privateKey%% or %%signingKey%%, optionally connected - * to %%provider%%. - */ - constructor({ key, prefix, provider, }: { - key: string | SigningKey; - prefix: string; - provider?: null | Provider; - }); - connect(provider: null | Provider): Wallet; - /** - * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with - * %%password%%. - * - * If %%progressCallback%% is specified, it will receive periodic - * updates as the encryption process progreses. - */ - encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise; - /** - * Returns a [JSON Keystore Wallet](json-wallets) encryped with - * %%password%%. - * - * It is preferred to use the [async version](encrypt) instead, - * which allows a [[ProgressCallback]] to keep the user informed. - * - * This method will block the event loop (freezing all UI) until - * it is complete, which may be a non-trivial duration. - */ - encryptSync(password: Uint8Array | string): string; - /** - * Creates (asynchronously) a **Wallet** by decrypting the %%json%% - * with %%password%%. - * - * If %%progress%% is provided, it is called periodically during - * decryption so that any UI can be updated. - */ - static fromEncryptedJson(json: string, password: Uint8Array | string, progress?: ProgressCallback): Promise; - /** - * Creates a **Wallet** by decrypting the %%json%% with %%password%%. - * - * The [[fromEncryptedJson]] method is preferred, as this method - * will lock up and freeze the UI during decryption, which may take - * some time. - */ - static fromEncryptedJsonSync(json: string, password: Uint8Array | string): HDNodeWallet | Wallet; - /** - * Creates a new random [[HDNodeWallet]] using the avavilable - * [cryptographic random source](randomBytes). - * - * If there is no crytographic random source, this will throw. - */ - static createRandom(prefix: string, provider?: null | Provider): HDNodeWallet; - /** - * Creates a [[HDNodeWallet]] for %%phrase%%. - */ - static fromPhrase({ phrase, prefix, provider, password, }: { - phrase: string; - prefix: string; - provider?: Provider; - password?: string; - }): HDNodeWallet; - static fromSeed({ seed, prefix, provider, path, }: { - seed: string; - prefix: string; - path?: string; - provider?: Provider; - }): HDNodeWallet; -} -//# sourceMappingURL=wallet.d.ts.map \ No newline at end of file diff --git a/types/wallet/wallet.d.ts.map b/types/wallet/wallet.d.ts.map deleted file mode 100644 index b640b9ef5..000000000 --- a/types/wallet/wallet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src.ts/wallet/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAe,YAAY,EAAE,MAAM,eAAe,CAAC;AAW1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AActD;;;;;;;;;GASG;AACH,qBAAa,MAAO,SAAQ,UAAU;;IACrC;;;OAGG;IACH,YAAY,EACX,GAAG,EACH,MAAM,EACN,QAAQ,GACR,EAAE;QACF,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;QACzB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;KAC3B,EAWA;IAED,OAAO,CAAC,QAAQ,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAMzC;IAED;;;;;;OAMG;IACG,OAAO,CACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,EAC7B,gBAAgB,CAAC,EAAE,gBAAgB,GACjC,OAAO,CAAC,MAAM,CAAC,CAGjB;IAED;;;;;;;;;OASG;IACH,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAGjD;IA6CD;;;;;;OAMG;IACH,OAAa,iBAAiB,CAC7B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,EAC7B,QAAQ,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,GAAG,MAAM,CAAC,CAiBhC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,qBAAqB,CAC3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,UAAU,GAAG,MAAM,GAC3B,YAAY,GAAG,MAAM,CAWvB;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAClB,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,IAAI,GAAG,QAAQ,GACxB,YAAY,CAWd;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EACjB,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,GACR,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,GAAG,YAAY,CAUf;IACD,MAAM,CAAC,QAAQ,CAAC,EACf,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,IAAI,GACJ,EAAE;QACF,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACpB,GAAG,YAAY,CAUf;CACD"} \ No newline at end of file diff --git a/types/wordlists/bit-reader.d.ts b/types/wordlists/bit-reader.d.ts deleted file mode 100644 index 1aa849530..000000000 --- a/types/wordlists/bit-reader.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeBits(width: number, data: string): Array; -//# sourceMappingURL=bit-reader.d.ts.map \ No newline at end of file diff --git a/types/wordlists/bit-reader.d.ts.map b/types/wordlists/bit-reader.d.ts.map deleted file mode 100644 index 904904c46..000000000 --- a/types/wordlists/bit-reader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bit-reader.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/bit-reader.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA8BrE"} \ No newline at end of file diff --git a/types/wordlists/decode-owl.d.ts b/types/wordlists/decode-owl.d.ts deleted file mode 100644 index 8822086bb..000000000 --- a/types/wordlists/decode-owl.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @_ignore - */ -export declare function decode(data: string, subs: string): Array; -/** - * @_ignore - */ -export declare function decodeOwl(data: string): Array; -//# sourceMappingURL=decode-owl.d.ts.map \ No newline at end of file diff --git a/types/wordlists/decode-owl.d.ts.map b/types/wordlists/decode-owl.d.ts.map deleted file mode 100644 index ce10ef2ad..000000000 --- a/types/wordlists/decode-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owl.ts"],"names":[],"mappings":"AAuBA;;GAEG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA4BhE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAOrD"} \ No newline at end of file diff --git a/types/wordlists/decode-owla.d.ts b/types/wordlists/decode-owla.d.ts deleted file mode 100644 index 479e6c54a..000000000 --- a/types/wordlists/decode-owla.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @_ignore - */ -export declare function decodeOwlA(data: string, accents: string): Array; -//# sourceMappingURL=decode-owla.d.ts.map \ No newline at end of file diff --git a/types/wordlists/decode-owla.d.ts.map b/types/wordlists/decode-owla.d.ts.map deleted file mode 100644 index da8636365..000000000 --- a/types/wordlists/decode-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"decode-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/decode-owla.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CA4BvE"} \ No newline at end of file diff --git a/types/wordlists/enwords.d.ts b/types/wordlists/enwords.d.ts deleted file mode 100644 index 8600e64a2..000000000 --- a/types/wordlists/enwords.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const enWords = "AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo"; -//# sourceMappingURL=enwords.d.ts.map \ No newline at end of file diff --git a/types/wordlists/enwords.d.ts.map b/types/wordlists/enwords.d.ts.map deleted file mode 100644 index ff2c89431..000000000 --- a/types/wordlists/enwords.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"enwords.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/enwords.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,i0VAC2yV,CAAC"} \ No newline at end of file diff --git a/types/wordlists/generation/encode-latin.d.ts b/types/wordlists/generation/encode-latin.d.ts deleted file mode 100644 index a646e8246..000000000 --- a/types/wordlists/generation/encode-latin.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export declare class BitWriter { - #private; - readonly width: number; - constructor(width: number); - write(value: number): void; - get length(): number; - get data(): string; -} -export interface AccentSet { - accent: number; - follows: string; - positions: Array; - positionsLength: number; - positionData: string; - positionDataLength: number; -} -export declare function extractAccents(words: Array): { - accents: Array; - words: Array; -}; -export declare function encodeOwl(words: Array): { - subs: string; - data: string; -}; -//# sourceMappingURL=encode-latin.d.ts.map \ No newline at end of file diff --git a/types/wordlists/generation/encode-latin.d.ts.map b/types/wordlists/generation/encode-latin.d.ts.map deleted file mode 100644 index 0a1f29f5d..000000000 --- a/types/wordlists/generation/encode-latin.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"encode-latin.d.ts","sourceRoot":"","sources":["../../../src.ts/wordlists/generation/encode-latin.ts"],"names":[],"mappings":"AAyIA,qBAAa,SAAS;;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAKvB,YAAY,KAAK,EAAE,MAAM,EAIxB;IAED,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CASzB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CA8BjB;CACD;AAED,MAAM,WAAW,SAAS;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAWD,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IACrD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,CA+FA;AAGD,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb,CAmDA"} \ No newline at end of file diff --git a/types/wordlists/index.d.ts b/types/wordlists/index.d.ts deleted file mode 100644 index 04a911c83..000000000 --- a/types/wordlists/index.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * A Wordlist is a set of 2048 words used to encode private keys - * (or other binary data) that is easier for humans to write down, - * transcribe and dictate. - * - * The [[link-bip-39]] standard includes several checksum bits, - * depending on the size of the mnemonic phrase. - * - * A mnemonic phrase may be 12, 15, 18, 21 or 24 words long. For - * most purposes 12 word mnemonics should be used, as including - * additional words increases the difficulty and potential for - * mistakes and does not offer any effective improvement on security. - * - * There are a variety of [[link-bip39-wordlists]] for different - * languages, but for maximal compatibility, the - * [English Wordlist](LangEn) is recommended. - * - * @_section: api/wordlists:Wordlists [about-wordlists] - */ -export { Wordlist } from "./wordlist.js"; -export { LangEn } from "./lang-en.js"; -export { WordlistOwl } from "./wordlist-owl.js"; -export { WordlistOwlA } from "./wordlist-owla.js"; -export { wordlists } from "./wordlists.js"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/wordlists/index.d.ts.map b/types/wordlists/index.d.ts.map deleted file mode 100644 index ecd1d4b63..000000000 --- a/types/wordlists/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"} \ No newline at end of file diff --git a/types/wordlists/lang-cz.d.ts b/types/wordlists/lang-cz.d.ts deleted file mode 100644 index c199d4fad..000000000 --- a/types/wordlists/lang-cz.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-cz]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangCz extends WordlistOwl { - /** - * Creates a new instance of the Czech language Wordlist. - * - * Using the constructor should be unnecessary, instead use the - * [[wordlist]] singleton method. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangCz``, creating it - * if this is the first time being called. - */ - static wordlist(): LangCz; -} -//# sourceMappingURL=lang-cz.d.ts.map \ No newline at end of file diff --git a/types/wordlists/lang-cz.d.ts.map b/types/wordlists/lang-cz.d.ts.map deleted file mode 100644 index 344196e7e..000000000 --- a/types/wordlists/lang-cz.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-cz.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-cz.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-en.d.ts b/types/wordlists/lang-en.d.ts deleted file mode 100644 index 87a3234bb..000000000 --- a/types/wordlists/lang-en.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-en]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEn extends WordlistOwl { - /** - * Creates a new instance of the English language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEn]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEn``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEn; -} -//# sourceMappingURL=lang-en.d.ts.map \ No newline at end of file diff --git a/types/wordlists/lang-en.d.ts.map b/types/wordlists/lang-en.d.ts.map deleted file mode 100644 index bcff43d4d..000000000 --- a/types/wordlists/lang-en.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-en.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-en.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-es.d.ts b/types/wordlists/lang-es.d.ts deleted file mode 100644 index 7e51683e7..000000000 --- a/types/wordlists/lang-es.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwlA } from "./wordlist-owla.js"; -/** - * The [[link-bip39-es]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangEs extends WordlistOwlA { - /** - * Creates a new instance of the Spanish language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langEs]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangEs``, creating it - * if this is the first time being called. - */ - static wordlist(): LangEs; -} -//# sourceMappingURL=lang-es.d.ts.map \ No newline at end of file diff --git a/types/wordlists/lang-es.d.ts.map b/types/wordlists/lang-es.d.ts.map deleted file mode 100644 index e52928599..000000000 --- a/types/wordlists/lang-es.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-es.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-es.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-fr.d.ts b/types/wordlists/lang-fr.d.ts deleted file mode 100644 index f27bf9a80..000000000 --- a/types/wordlists/lang-fr.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwlA } from "./wordlist-owla.js"; -/** - * The [[link-bip39-fr]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangFr extends WordlistOwlA { - /** - * Creates a new instance of the French language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langFr]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangFr``, creating it - * if this is the first time being called. - */ - static wordlist(): LangFr; -} -//# sourceMappingURL=lang-fr.d.ts.map \ No newline at end of file diff --git a/types/wordlists/lang-fr.d.ts.map b/types/wordlists/lang-fr.d.ts.map deleted file mode 100644 index c10fb3e78..000000000 --- a/types/wordlists/lang-fr.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-fr.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-fr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,YAAY;IACvC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-it.d.ts b/types/wordlists/lang-it.d.ts deleted file mode 100644 index 5fda34cd9..000000000 --- a/types/wordlists/lang-it.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-it]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangIt extends WordlistOwl { - /** - * Creates a new instance of the Italian language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langIt]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangIt``, creating it - * if this is the first time being called. - */ - static wordlist(): LangIt; -} -//# sourceMappingURL=lang-it.d.ts.map \ No newline at end of file diff --git a/types/wordlists/lang-it.d.ts.map b/types/wordlists/lang-it.d.ts.map deleted file mode 100644 index fbb232db7..000000000 --- a/types/wordlists/lang-it.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-it.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-it.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-ja.d.ts b/types/wordlists/lang-ja.d.ts deleted file mode 100644 index 58224a15a..000000000 --- a/types/wordlists/lang-ja.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-ja]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangJa extends Wordlist { - /** - * Creates a new instance of the Japanese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langJa]] should suffice. - * - * @_ignore: - */ - constructor(); - getWord(index: number): string; - getWordIndex(word: string): number; - split(phrase: string): Array; - join(words: Array): string; - /** - * Returns a singleton instance of a ``LangJa``, creating it - * if this is the first time being called. - */ - static wordlist(): LangJa; -} -//# sourceMappingURL=lang-ja.d.ts.map \ No newline at end of file diff --git a/types/wordlists/lang-ja.d.ts.map b/types/wordlists/lang-ja.d.ts.map deleted file mode 100644 index 82a3ec1e4..000000000 --- a/types/wordlists/lang-ja.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ja.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ja.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA6IzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-ko.d.ts b/types/wordlists/lang-ko.d.ts deleted file mode 100644 index 4329e0556..000000000 --- a/types/wordlists/lang-ko.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-ko]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangKo extends Wordlist { - /** - * Creates a new instance of the Korean language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langKo]] should suffice. - * - * @_ignore: - */ - constructor(); - getWord(index: number): string; - getWordIndex(word: string): number; - /** - * Returns a singleton instance of a ``LangKo``, creating it - * if this is the first time being called. - */ - static wordlist(): LangKo; -} -//# sourceMappingURL=lang-ko.d.ts.map \ No newline at end of file diff --git a/types/wordlists/lang-ko.d.ts.map b/types/wordlists/lang-ko.d.ts.map deleted file mode 100644 index 4e6fdeecb..000000000 --- a/types/wordlists/lang-ko.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-ko.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-ko.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqEzC;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;OAOG;IACH,cAEC;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-pt.d.ts b/types/wordlists/lang-pt.d.ts deleted file mode 100644 index f218013c6..000000000 --- a/types/wordlists/lang-pt.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * The [[link-bip39-pt]] for [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangPt extends WordlistOwl { - /** - * Creates a new instance of the Portuguese language Wordlist. - * - * This should be unnecessary most of the time as the exported - * [[langPt]] should suffice. - * - * @_ignore: - */ - constructor(); - /** - * Returns a singleton instance of a ``LangPt``, creating it - * if this is the first time being called. - */ - static wordlist(): LangPt; -} -//# sourceMappingURL=lang-pt.d.ts.map \ No newline at end of file diff --git a/types/wordlists/lang-pt.d.ts.map b/types/wordlists/lang-pt.d.ts.map deleted file mode 100644 index 024c97c03..000000000 --- a/types/wordlists/lang-pt.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-pt.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-pt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAShD;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACtC;;;;;;;OAOG;IACH,cAEC;IAED;;;OAGG;IACH,MAAM,CAAC,QAAQ,IAAI,MAAM,CAKxB;CACD"} \ No newline at end of file diff --git a/types/wordlists/lang-zh.d.ts b/types/wordlists/lang-zh.d.ts deleted file mode 100644 index 5d0c14c7c..000000000 --- a/types/wordlists/lang-zh.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * The [[link-bip39-zh_cn]] and [[link-bip39-zh_tw]] for - * [mnemonic phrases](link-bip-39). - * - * @_docloc: api/wordlists - */ -export declare class LangZh extends Wordlist { - /** - * Creates a new instance of the Chinese language Wordlist for - * the %%dialect%%, either ``"cn"`` or ``"tw"`` for simplified - * or traditional, respectively. - * - * This should be unnecessary most of the time as the exported - * [[langZhCn]] and [[langZhTw]] should suffice. - * - * @_ignore: - */ - constructor(dialect: string); - getWord(index: number): string; - getWordIndex(word: string): number; - split(phrase: string): Array; - /** - * Returns a singleton instance of a ``LangZh`` for %%dialect%%, - * creating it if this is the first time being called. - * - * Use the %%dialect%% ``"cn"`` or ``"tw"`` for simplified or - * traditional, respectively. - */ - static wordlist(dialect: string): LangZh; -} -//# sourceMappingURL=lang-zh.d.ts.map \ No newline at end of file diff --git a/types/wordlists/lang-zh.d.ts.map b/types/wordlists/lang-zh.d.ts.map deleted file mode 100644 index 06d1b5870..000000000 --- a/types/wordlists/lang-zh.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"lang-zh.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/lang-zh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA+DzC;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,QAAQ;IACnC;;;;;;;;;OASG;IACH,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;IAED,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAGnC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKvC;CACD"} \ No newline at end of file diff --git a/types/wordlists/wordlist-owl.d.ts b/types/wordlists/wordlist-owl.d.ts deleted file mode 100644 index 3a831f7cf..000000000 --- a/types/wordlists/wordlist-owl.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Wordlist } from "./wordlist.js"; -/** - * An OWL format Wordlist is an encoding method that exploits - * the general locality of alphabetically sorted words to - * achieve a simple but effective means of compression. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on ASCII-7 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -export declare class WordlistOwl extends Wordlist { - #private; - /** - * Creates a new Wordlist for %%locale%% using the OWL %%data%% - * and validated against the %%checksum%%. - */ - constructor(locale: string, data: string, checksum: string); - get _data(): string; - _decodeWords(): Array; - getWord(index: number): string; - getWordIndex(word: string): number; -} -//# sourceMappingURL=wordlist-owl.d.ts.map \ No newline at end of file diff --git a/types/wordlists/wordlist-owl.d.ts.map b/types/wordlists/wordlist-owl.d.ts.map deleted file mode 100644 index cb5198fb8..000000000 --- a/types/wordlists/wordlist-owl.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owl.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owl.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC;;;;;;;;;;;GAWG;AACH,qBAAa,WAAY,SAAQ,QAAQ;;IAIxC;;;OAGG;IACH,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAKzD;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;IAoBD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7B;IAED,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;CACD"} \ No newline at end of file diff --git a/types/wordlists/wordlist-owla.d.ts b/types/wordlists/wordlist-owla.d.ts deleted file mode 100644 index d86086b6e..000000000 --- a/types/wordlists/wordlist-owla.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { WordlistOwl } from "./wordlist-owl.js"; -/** - * An OWL-A format Wordlist extends the OWL format to add an - * overlay onto an OWL format Wordlist to support diacritic - * marks. - * - * This class is generally not useful to most developers as - * it is used mainly internally to keep Wordlists for languages - * based on latin-1 small. - * - * If necessary, there are tools within the ``generation/`` folder - * to create these necessary data. - */ -export declare class WordlistOwlA extends WordlistOwl { - #private; - constructor(locale: string, data: string, accent: string, checksum: string); - get _accent(): string; - _decodeWords(): Array; -} -//# sourceMappingURL=wordlist-owla.d.ts.map \ No newline at end of file diff --git a/types/wordlists/wordlist-owla.d.ts.map b/types/wordlists/wordlist-owla.d.ts.map deleted file mode 100644 index ed20b28e0..000000000 --- a/types/wordlists/wordlist-owla.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist-owla.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist-owla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,WAAW;;IAG5C,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAGzE;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC,CAE5B;CACD"} \ No newline at end of file diff --git a/types/wordlists/wordlist.d.ts b/types/wordlists/wordlist.d.ts deleted file mode 100644 index 081decc72..000000000 --- a/types/wordlists/wordlist.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * A Wordlist represents a collection of language-specific - * words used to encode and devoce [[link-bip-39]] encoded data - * by mapping words to 11-bit values and vice versa. - */ -export declare abstract class Wordlist { - locale: string; - /** - * Creates a new Wordlist instance. - * - * Sub-classes MUST call this if they provide their own constructor, - * passing in the locale string of the language. - * - * Generally there is no need to create instances of a Wordlist, - * since each language-specific Wordlist creates an instance and - * there is no state kept internally, so they are safe to share. - */ - constructor(locale: string); - /** - * Sub-classes may override this to provide a language-specific - * method for spliting %%phrase%% into individual words. - * - * By default, %%phrase%% is split using any sequences of - * white-space as defined by regular expressions (i.e. ``/\s+/``). - */ - split(phrase: string): Array; - /** - * Sub-classes may override this to provider a language-specific - * method for joining %%words%% into a phrase. - * - * By default, %%words%% are joined by a single space. - */ - join(words: Array): string; - /** - * Maps an 11-bit value into its coresponding word in the list. - * - * Sub-classes MUST override this. - */ - abstract getWord(index: number): string; - /** - * Maps a word to its corresponding 11-bit value. - * - * Sub-classes MUST override this. - */ - abstract getWordIndex(word: string): number; - static check(wordlist: Wordlist): string; -} -//# sourceMappingURL=wordlist.d.ts.map \ No newline at end of file diff --git a/types/wordlists/wordlist.d.ts.map b/types/wordlists/wordlist.d.ts.map deleted file mode 100644 index c298de76e..000000000 --- a/types/wordlists/wordlist.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlist.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlist.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,8BAAsB,QAAQ;IAC7B,MAAM,EAAG,MAAM,CAAC;IAEhB;;;;;;;;;OASG;IACH,YAAY,MAAM,EAAE,MAAM,EAEzB;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAEnC;IAED;;;;;OAKG;IACH,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAEjC;IAED;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAWvC;CACD"} \ No newline at end of file diff --git a/types/wordlists/wordlists-browser.d.ts b/types/wordlists/wordlists-browser.d.ts deleted file mode 100644 index d0dbd19c9..000000000 --- a/types/wordlists/wordlists-browser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -export declare const wordlists: Record; -//# sourceMappingURL=wordlists-browser.d.ts.map \ No newline at end of file diff --git a/types/wordlists/wordlists-browser.d.ts.map b/types/wordlists/wordlists-browser.d.ts.map deleted file mode 100644 index 4cd923879..000000000 --- a/types/wordlists/wordlists-browser.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-browser.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAE9C,CAAC"} \ No newline at end of file diff --git a/types/wordlists/wordlists-extra.d.ts b/types/wordlists/wordlists-extra.d.ts deleted file mode 100644 index 7e15a233f..000000000 --- a/types/wordlists/wordlists-extra.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { LangCz } from "./lang-cz.js"; -export { LangEs } from "./lang-es.js"; -export { LangFr } from "./lang-fr.js"; -export { LangJa } from "./lang-ja.js"; -export { LangKo } from "./lang-ko.js"; -export { LangIt } from "./lang-it.js"; -export { LangPt } from "./lang-pt.js"; -export { LangZh } from "./lang-zh.js"; -//# sourceMappingURL=wordlists-extra.d.ts.map \ No newline at end of file diff --git a/types/wordlists/wordlists-extra.d.ts.map b/types/wordlists/wordlists-extra.d.ts.map deleted file mode 100644 index 66c6c92cd..000000000 --- a/types/wordlists/wordlists-extra.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists-extra.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists-extra.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"} \ No newline at end of file diff --git a/types/wordlists/wordlists.d.ts b/types/wordlists/wordlists.d.ts deleted file mode 100644 index ab8b0308c..000000000 --- a/types/wordlists/wordlists.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Wordlist } from "./wordlist.js"; -/** - * The available Wordlists by their - * [ISO 639-1 Language Code](link-wiki-iso639). - * - * (**i.e.** [cz](LangCz), [en](LangEn), [es](LangEs), [fr](LangFr), - * [ja](LangJa), [ko](LangKo), [it](LangIt), [pt](LangPt), - * [zh_cn](LangZh), [zh_tw](LangZh)) - * - * The dist files (in the ``/dist`` folder) have had all languages - * except English stripped out, which reduces the library size by - * about 80kb. If required, they are available by importing the - * included ``wordlists-extra.min.js`` file. - */ -export declare const wordlists: Record; -//# sourceMappingURL=wordlists.d.ts.map \ No newline at end of file diff --git a/types/wordlists/wordlists.d.ts.map b/types/wordlists/wordlists.d.ts.map deleted file mode 100644 index 15f92fcf6..000000000 --- a/types/wordlists/wordlists.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wordlists.d.ts","sourceRoot":"","sources":["../../src.ts/wordlists/wordlists.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAW9C,CAAC"} \ No newline at end of file From 6ef4997ebde2c8f88a9f316e6966ce5c4a35a467 Mon Sep 17 00:00:00 2001 From: Rastislav Date: Mon, 7 Sep 2026 09:20:10 +0200 Subject: [PATCH 3/4] Ignore build outputs and lockfiles and fix source-only CI --- .github/workflows/nodejs.yml | 4 ++-- .github/workflows/publish-npm.yml | 4 ++-- .gitignore | 29 ++++++++++++++++++++++++----- CHANGELOG.md | 4 +++- CONTRIBUTING.md | 12 ++++++------ README.md | 2 +- package.json | 4 ++-- scripts/clean.mjs | 7 ++----- 8 files changed, 42 insertions(+), 24 deletions(-) diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 4ccbff197..551a3e00f 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-node@v6 with: node-version: ${{ matrix.node }} - cache: npm - - run: npm ci + package-manager-cache: false + - run: npm install - run: npm run check - run: npm audit --audit-level=high diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index f66641238..7035569a1 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -22,7 +22,7 @@ jobs: with: node-version: "24" registry-url: https://registry.npmjs.org - cache: npm + package-manager-cache: false - name: Set up npm trusted publishing run: npm install --global npm@11.19.0 - name: Check release version @@ -30,7 +30,7 @@ jobs: RELEASE_TAG: ${{ github.event.release.tag_name }} run: | node --input-type=module -e 'import fs from "node:fs"; const p = JSON.parse(fs.readFileSync("package.json")); if (process.env.RELEASE_TAG.replace(/^v/, "") !== p.version) throw new Error("Release tag must match package.json version");' - - run: npm ci + - run: npm install - run: npm run check - run: npm audit --audit-level=high - name: Pack validated artifacts diff --git a/.gitignore b/.gitignore index 39ff228a6..0c8d30946 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,25 @@ -node_modules/** -output/** -misc/** +# Installed dependencies and generated build outputs +node_modules/ +/dist/ +/lib.esm/ +/lib.commonjs/ +/types/ +/output/ +/coverage/ +.nyc_output/ +*.tsbuildinfo + +# Local tooling and temporary files +/misc/ +.cache/ +.history/ +.env +.env.* +!.env.example +!.env.*.example **/*.swp **/*.tgz -dist/*.gz # Logs logs @@ -22,9 +37,13 @@ lerna-debug.log* .yarn/install-state.gz .pnp.* -# lock files (excluding will cause npm ci inaccessible) +# This library does not commit package-manager lockfiles. +package-lock.json +npm-shrinkwrap.json yarn.lock pnpm-lock.yaml +bun.lock +bun.lockb # Optional npm cache directory .npm diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c77cfa3e..2d7fb9bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,5 +8,7 @@ - Fix AES 3 keystore integration and browser crypto parity; bound wallet KDF resources and compare all MAC bytes. - Synchronize the exported runtime version with the npm package version. - Add typed CIP-150, CIP-151, and CIP-152 helpers, bounded IPFS JSON loading, and exact Core custom-unit balances. -- Add regression tests, package and browser smoke checks, reproducible npm installs, issue forms, and validated npm trusted-publishing workflows. +- Add regression tests, package and browser smoke checks, npm dependency checks, issue forms, and validated npm trusted-publishing workflows. - Update package documentation and contributor instructions. + +- Remove committed build artifacts and lockfiles; generate npm distributions from source and use `npm install` in CI and releases. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 096451e26..cedb5850d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,15 +1,15 @@ # Contributing to corebc.js -Use Node.js 22.12 or newer (Node.js 24 is used for releases) and npm. Install the locked dependencies with `npm ci`. +Use Node.js 22.12 or newer (Node.js 24 is used for releases) and npm. Install dependencies with `npm install`. This library does not commit lockfiles; npm may create an ignored local lockfile. CI resolves dependencies from `package.json` on each fresh runner. ```sh -npm ci +npm install npm run check ``` Edit TypeScript in `src.ts/`. Use tabs for indentation; `npm run format` applies the repository's Prettier configuration. Add regression tests under `src.ts/_tests/test-*.ts` for behavior changes. Keep private keys and RPC credentials out of issues and logs; test vectors must use disposable keys. -`npm run check` builds ESM, CommonJS, browser bundles, and declarations, checks formatting, runs both Node module test suites, and installs a packed archive into a temporary project to check public exports and TypeScript consumers. It also exercises browser bundles without Node globals. Build outputs are tracked in this repository; include regenerated outputs with source changes. `npm run clean` removes generated outputs and `npm run build-all` restores them. +`npm run check` builds ESM, CommonJS, browser bundles, and declarations, checks formatting, runs both Node module test suites, and installs a packed archive into a temporary project to check public exports and TypeScript consumers. It also exercises browser bundles without Node globals. Build outputs are ignored by Git and generated from source for validation and npm publication. Do not commit `dist/`, `lib.esm/`, `lib.commonjs/`, `types/`, or package-manager lockfiles. `npm run clean` removes generated outputs and `npm run build-all` restores them. The live fee-data test is optional because it depends on an external node: @@ -25,10 +25,10 @@ Open a pull request explaining the problem, changed behavior, and validation. Bu ## Releases -1. Update `package.json` and `src.ts/_version.ts` to the intended version, refresh `package-lock.json` with `npm install`, and document changes in `CHANGELOG.md`. -2. Run `npm run check` and commit the source, lockfile, and regenerated artifacts. +1. Update `package.json` and `src.ts/_version.ts` to the intended version, install dependencies with `npm install`, and document changes in `CHANGELOG.md`. +2. Run `npm run check` and commit source, configuration, and documentation changes. 3. Create a GitHub release whose tag is the version, optionally prefixed with `v`. -The release workflow checks the tag against the package version, reruns validation and the dependency audit, and publishes the validated npm archive with provenance. GitHub prereleases use the `next` dist-tag; normal releases use `latest`. +The release workflow checks the tag against the package version, reruns validation and the dependency audit, and publishes the validated npm archive with provenance. Both workflows use `npm install` with package-manager caching disabled; npm creates an ephemeral runner lockfile for the dependency audit. GitHub prereleases use the `next` dist-tag; normal releases use `latest`. Before the first automated release, a package owner must configure an npm trusted publisher for `CorePass/corebc.js`, workflow `publish-npm.yml`. This is an npm account setting, not a repository secret. See [npm trusted publishing](https://docs.npmjs.com/trusted-publishers/). Publishing a GitHub release triggers publication; CI on pull requests does not publish. diff --git a/README.md b/README.md index 316ac2f24..e56375201 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ The UMD bundle `dist/corebc.umd.min.js` exposes `globalThis.corebc`. Secure rand ## Development ```sh -npm ci +npm install npm run check ``` diff --git a/package.json b/package.json index 7ab65501f..bb1800d82 100644 --- a/package.json +++ b/package.json @@ -120,8 +120,8 @@ "build-types": "tsc --project tsconfig.types.json", "clean": "node scripts/clean.mjs", "clean-test": "npm run clean && npm run build-all && npm test", - "format": "prettier --write src.ts scripts package.json tsconfig*.json rollup.config.mjs .github README.md CONTRIBUTING.md CHANGELOG.md HEALTH.md .prettierrc.json", - "lint": "prettier --check src.ts scripts package.json tsconfig*.json rollup.config.mjs .github README.md CONTRIBUTING.md CHANGELOG.md HEALTH.md .prettierrc.json", + "format": "prettier --write src.ts scripts package.json tsconfig*.json rollup.config.mjs .github README.md CONTRIBUTING.md CHANGELOG.md .prettierrc.json", + "lint": "prettier --check src.ts scripts package.json tsconfig*.json rollup.config.mjs .github README.md CONTRIBUTING.md CHANGELOG.md .prettierrc.json", "stats": "echo 'Dependencies' && npm ls --all --omit=dev", "test": "npm run test-esm && npm run test-commonjs", "test-commonjs": "mocha ./lib.commonjs/_tests/test-*.js", diff --git a/scripts/clean.mjs b/scripts/clean.mjs index 1de44ef07..d8a9b9dbf 100644 --- a/scripts/clean.mjs +++ b/scripts/clean.mjs @@ -1,7 +1,4 @@ -import { readdir, rm } from "node:fs/promises"; +import { rm } from "node:fs/promises"; for (const dir of ["dist", "lib.esm", "lib.commonjs", "types"]) { - for (const entry of await readdir(dir).catch(() => [])) { - if (entry === "README.md") continue; - await rm(`${dir}/${entry}`, { recursive: true, force: true }); - } + await rm(dir, { recursive: true, force: true }); } From 789ee2f76223caecd3c821bdceb3951631eb4dd7 Mon Sep 17 00:00:00 2001 From: Rastislav Date: Mon, 7 Sep 2026 10:14:49 +0200 Subject: [PATCH 4/4] update --- .github/ISSUE_TEMPLATE/bug.yml | 2 +- CHANGELOG.md | 3 +-- README.md | 2 +- package.json | 2 +- src.ts/_version.ts | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index c7b6f9073..d80f6e599 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -9,7 +9,7 @@ body: id: version attributes: label: corebc version - placeholder: 0.4.1 or commit hash + placeholder: 1.0.0 or commit hash validations: required: true - type: input diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d7fb9bf0..90068e176 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 1.0.0 - Support the updated Noble hashes, TypeScript 7, Node types, and Rollup dependencies. - Require Node.js 22.12 or newer; regenerate CommonJS through Rollup for ESM dependencies. @@ -10,5 +10,4 @@ - Add typed CIP-150, CIP-151, and CIP-152 helpers, bounded IPFS JSON loading, and exact Core custom-unit balances. - Add regression tests, package and browser smoke checks, npm dependency checks, issue forms, and validated npm trusted-publishing workflows. - Update package documentation and contributor instructions. - - Remove committed build artifacts and lockfiles; generate npm distributions from source and use `npm install` in CI and releases. diff --git a/README.md b/README.md index e56375201..5d47fc5cd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# corebc.js +# CoreBC TypeScript and JavaScript tools for Core Blockchain: Ed448 wallets, signing, Core addresses, `xcb_*` JSON-RPC providers, ABI encoding, smart contracts, and token metadata. diff --git a/package.json b/package.json index bb1800d82..de76d9f52 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "corebc", - "version": "0.4.1", + "version": "1.0.0", "author": "CorePass", "description": "A complete and compact CoreBC library, for Dapps, wallets and any other tools.", "browser": { diff --git a/src.ts/_version.ts b/src.ts/_version.ts index 7e7b72401..ee08390dc 100644 --- a/src.ts/_version.ts +++ b/src.ts/_version.ts @@ -1,2 +1,2 @@ /** The current version of corebc; keep in sync with package.json. */ -export const version: string = "0.4.1"; +export const version: string = "1.0.0";